From 860bb39fe415ba0d2d199d8c905b6a55dbd4560a Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 29 Jun 2022 13:53:45 +0000 Subject: [PATCH 0001/1274] Add rpc method for total_pieces --- client/rpc/src/lib.rs | 10 ++++++++++ pallets/common/src/lib.rs | 2 ++ pallets/fungible/src/common.rs | 4 ++++ pallets/nonfungible/src/common.rs | 4 ++++ pallets/refungible/src/common.rs | 4 ++++ pallets/refungible/src/lib.rs | 5 +++++ primitives/rpc/src/lib.rs | 1 + runtime/common/src/runtime_apis.rs | 4 ++++ 8 files changed, 34 insertions(+) diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index ca56fb5975..a97520d7f4 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -184,12 +184,21 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result>; + #[method(name = "unique_effectiveCollectionLimits")] fn effective_collection_limits( &self, collection_id: CollectionId, at: Option, ) -> Result>; + + #[method(name = "unique_totalPieces")] + fn total_pieces( + &self, + collection_id: CollectionId, + token_id: TokenId, + at: Option, + ) -> Result; } mod rmrk_unique_rpc { @@ -463,6 +472,7 @@ where pass_method!(collection_stats() -> CollectionStats, unique_api); pass_method!(next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Option, unique_api); pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option, unique_api); + pass_method!(total_pieces(collection_id: CollectionId, token_id: TokenId) -> u128, unique_api); } #[allow(deprecated)] diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 7a62b43e7f..706562f657 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -1382,6 +1382,8 @@ pub trait CommonCollectionOperations { fn account_balance(&self, account: T::CrossAccountId) -> u32; /// Amount of specific token account have (Applicable to fungible/refungible) fn balance(&self, account: T::CrossAccountId, token: TokenId) -> u128; + /// Amount of token pieces + fn total_pieces(&self, token: TokenId) -> u128; fn allowance( &self, sender: T::CrossAccountId, diff --git a/pallets/fungible/src/common.rs b/pallets/fungible/src/common.rs index fa3660c780..a39b224018 100644 --- a/pallets/fungible/src/common.rs +++ b/pallets/fungible/src/common.rs @@ -403,4 +403,8 @@ impl CommonCollectionOperations for FungibleHandle { fn refungible_extensions(&self) -> Option<&dyn RefungibleExtensions> { None } + + fn total_pieces(&self, _token: TokenId) -> u128 { + 0 + } } diff --git a/pallets/nonfungible/src/common.rs b/pallets/nonfungible/src/common.rs index 5dd1165c2e..89a049c89e 100644 --- a/pallets/nonfungible/src/common.rs +++ b/pallets/nonfungible/src/common.rs @@ -472,4 +472,8 @@ impl CommonCollectionOperations for NonfungibleHandle { fn refungible_extensions(&self) -> Option<&dyn RefungibleExtensions> { None } + + fn total_pieces(&self, _token: TokenId) -> u128 { + 1 + } } diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index 5296ddb87e..23b085226e 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -409,6 +409,10 @@ impl CommonCollectionOperations for RefungibleHandle { fn refungible_extensions(&self) -> Option<&dyn RefungibleExtensions> { Some(self) } + + fn total_pieces(&self, token: TokenId) -> u128 { + >::total_pieces(self.id, token) + } } impl RefungibleExtensions for RefungibleHandle { diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 78fb1417ad..dde7524caa 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -710,4 +710,9 @@ impl Pallet { >::insert((collection.id, token), amount); Ok(()) } + + fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> u128 { + // Not "try_fold" because total count of pieces is limited by 'MAX_REFUNGIBLE_PIECES'. + >::iter_prefix((collection_id, token_id)).fold(0, |total, piece| total + piece.1) + } } diff --git a/primitives/rpc/src/lib.rs b/primitives/rpc/src/lib.rs index 9375a545ff..05b5c4d995 100644 --- a/primitives/rpc/src/lib.rs +++ b/primitives/rpc/src/lib.rs @@ -80,5 +80,6 @@ sp_api::decl_runtime_apis! { fn collection_stats() -> Result; fn next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result>; fn effective_collection_limits(collection_id: CollectionId) -> Result>; + fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Result; } } diff --git a/runtime/common/src/runtime_apis.rs b/runtime/common/src/runtime_apis.rs index 34dd5758f1..4244d364ba 100644 --- a/runtime/common/src/runtime_apis.rs +++ b/runtime/common/src/runtime_apis.rs @@ -142,6 +142,10 @@ macro_rules! impl_common_runtime_apis { fn effective_collection_limits(collection: CollectionId) -> Result, DispatchError> { Ok(>::effective_collection_limits(collection)) } + + fn total_pieces(collection: CollectionId, token_id: TokenId) -> Result { + dispatch_unique_runtime!(collection.total_pieces(token_id)) + } } impl sp_api::Core for Runtime { From 2d796dacac3713d337cc54f69aae42058a152112 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 30 Jun 2022 08:55:33 +0000 Subject: [PATCH 0002/1274] Fix test. Change source of pieces info. --- pallets/refungible/src/lib.rs | 3 +-- tests/src/refungible.test.ts | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index dde7524caa..32030943cf 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -712,7 +712,6 @@ impl Pallet { } fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> u128 { - // Not "try_fold" because total count of pieces is limited by 'MAX_REFUNGIBLE_PIECES'. - >::iter_prefix((collection_id, token_id)).fold(0, |total, piece| total + piece.1) + >::get((collection_id, token_id)) } } diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 72890520d7..72c1fe15ac 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -68,6 +68,27 @@ describe('integration test: Refungible functionality:', () => { }); }); + it.only('Check total pieces of token', async () => { + await usingApi(async api => { + const createCollectionResult = await createCollection(api, alice, {mode: {type: 'ReFungible'}}); + expect(createCollectionResult.success).to.be.true; + const collectionId = createCollectionResult.collectionId; + const amountPieces = 100n; + const result = await createRefungibleToken(api, alice, collectionId, amountPieces); + expect(result.success).to.be.true; + { + const totalPieces = await api.rpc.unique.totalPieces(collectionId, result.itemId); + expect(totalPieces.toBigInt()).to.be.eq(amountPieces); + } + + await transfer(api, collectionId, result.itemId, alice, bob, 60n); + { + const totalPieces = await api.rpc.unique.totalPieces(collectionId, result.itemId); + expect(totalPieces.toBigInt()).to.be.eq(amountPieces); + } + }); + }); + it('Transfer token pieces', async () => { await usingApi(async api => { const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; From 88ef7226e031d0d998c1cda522d43d18f293fc69 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 30 Jun 2022 12:08:00 +0000 Subject: [PATCH 0003/1274] Test all collection for total_pieces --- client/rpc/src/lib.rs | 4 +- pallets/common/src/lib.rs | 2 +- pallets/fungible/src/common.rs | 10 +++-- pallets/nonfungible/src/common.rs | 4 +- pallets/refungible/src/common.rs | 2 +- pallets/refungible/src/lib.rs | 4 +- primitives/rpc/src/lib.rs | 2 +- runtime/common/src/runtime_apis.rs | 2 +- tests/src/createItem.test.ts | 64 ++++++++++++++++++++++++++++++ tests/src/refungible.test.ts | 21 ---------- 10 files changed, 81 insertions(+), 34 deletions(-) diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index a97520d7f4..2b22c1c4b3 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -198,7 +198,7 @@ pub trait UniqueApi { collection_id: CollectionId, token_id: TokenId, at: Option, - ) -> Result; + ) -> Result>; } mod rmrk_unique_rpc { @@ -472,7 +472,7 @@ where pass_method!(collection_stats() -> CollectionStats, unique_api); pass_method!(next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Option, unique_api); pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option, unique_api); - pass_method!(total_pieces(collection_id: CollectionId, token_id: TokenId) -> u128, unique_api); + pass_method!(total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option, unique_api); } #[allow(deprecated)] diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 706562f657..aecf9e8a4b 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -1383,7 +1383,7 @@ pub trait CommonCollectionOperations { /// Amount of specific token account have (Applicable to fungible/refungible) fn balance(&self, account: T::CrossAccountId, token: TokenId) -> u128; /// Amount of token pieces - fn total_pieces(&self, token: TokenId) -> u128; + fn total_pieces(&self, token: TokenId) -> Option; fn allowance( &self, sender: T::CrossAccountId, diff --git a/pallets/fungible/src/common.rs b/pallets/fungible/src/common.rs index a39b224018..8c6ae396f4 100644 --- a/pallets/fungible/src/common.rs +++ b/pallets/fungible/src/common.rs @@ -25,7 +25,8 @@ use sp_std::{vec::Vec, vec}; use up_data_structs::{Property, PropertyKey, PropertyValue, PropertyKeyPermission}; use crate::{ - Allowance, Balance, Config, Error, FungibleHandle, Pallet, SelfWeightOf, weights::WeightInfo, + Allowance, TotalSupply, Balance, Config, Error, FungibleHandle, Pallet, SelfWeightOf, + weights::WeightInfo, }; pub struct CommonWeights(PhantomData); @@ -404,7 +405,10 @@ impl CommonCollectionOperations for FungibleHandle { None } - fn total_pieces(&self, _token: TokenId) -> u128 { - 0 + fn total_pieces(&self, token: TokenId) -> Option { + if token != TokenId::default() { + return None; + } + >::try_get(self.id).ok() } } diff --git a/pallets/nonfungible/src/common.rs b/pallets/nonfungible/src/common.rs index 89a049c89e..f21b84788e 100644 --- a/pallets/nonfungible/src/common.rs +++ b/pallets/nonfungible/src/common.rs @@ -473,7 +473,7 @@ impl CommonCollectionOperations for NonfungibleHandle { None } - fn total_pieces(&self, _token: TokenId) -> u128 { - 1 + fn total_pieces(&self, _token: TokenId) -> Option { + Some(1) } } diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index 23b085226e..4e024392ef 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -410,7 +410,7 @@ impl CommonCollectionOperations for RefungibleHandle { Some(self) } - fn total_pieces(&self, token: TokenId) -> u128 { + fn total_pieces(&self, token: TokenId) -> Option { >::total_pieces(self.id, token) } } diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 32030943cf..3bea36bc6b 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -711,7 +711,7 @@ impl Pallet { Ok(()) } - fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> u128 { - >::get((collection_id, token_id)) + fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option { + >::try_get((collection_id, token_id)).ok() } } diff --git a/primitives/rpc/src/lib.rs b/primitives/rpc/src/lib.rs index 05b5c4d995..14a50f1c8e 100644 --- a/primitives/rpc/src/lib.rs +++ b/primitives/rpc/src/lib.rs @@ -80,6 +80,6 @@ sp_api::decl_runtime_apis! { fn collection_stats() -> Result; fn next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result>; fn effective_collection_limits(collection_id: CollectionId) -> Result>; - fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Result; + fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Result>; } } diff --git a/runtime/common/src/runtime_apis.rs b/runtime/common/src/runtime_apis.rs index 4244d364ba..2d0531a5a6 100644 --- a/runtime/common/src/runtime_apis.rs +++ b/runtime/common/src/runtime_apis.rs @@ -143,7 +143,7 @@ macro_rules! impl_common_runtime_apis { Ok(>::effective_collection_limits(collection)) } - fn total_pieces(collection: CollectionId, token_id: TokenId) -> Result { + fn total_pieces(collection: CollectionId, token_id: TokenId) -> Result, DispatchError> { dispatch_unique_runtime!(collection.total_pieces(token_id)) } } diff --git a/tests/src/createItem.test.ts b/tests/src/createItem.test.ts index ef1e5a99b0..440014d0b4 100644 --- a/tests/src/createItem.test.ts +++ b/tests/src/createItem.test.ts @@ -24,6 +24,8 @@ import { createCollectionWithPropsExpectSuccess, createItemWithPropsExpectSuccess, createItemWithPropsExpectFailure, + createCollection, + transferExpectSuccess, } from './util/helpers'; const expect = chai.expect; @@ -95,6 +97,68 @@ describe('integration test: ext. ():', () => { await createItemWithPropsExpectSuccess(alice, newCollectionID, createMode, [{key: 'key1', value: 'val1'}]); }); + + it.only('Check total pieces of Fungible token', async () => { + await usingApi(async api => { + const createMode = 'Fungible'; + const collectionId = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}}); + const tokenId = await createItemExpectSuccess(alice, collectionId, createMode, bob.address); + { + const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); + expect(totalPieces.isSome).to.be.true; + expect(totalPieces.unwrap().toBigInt()).to.be.eq(10n); + } + + await transferExpectSuccess(collectionId, tokenId, bob, alice, 1, createMode); + { + const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); + expect(totalPieces.isSome).to.be.true; + expect(totalPieces.unwrap().toBigInt()).to.be.eq(10n); + } + }); + }); + + it.only('Check total pieces of NFT token', async () => { + await usingApi(async api => { + const createMode = 'NFT'; + const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}}); + const tokenId = await createItemExpectSuccess(alice, collectionId, createMode, bob.address); + { + const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); + expect(totalPieces.isSome).to.be.true; + expect(totalPieces.unwrap().toBigInt()).to.be.eq(1n); + } + + await transferExpectSuccess(collectionId, tokenId, bob, alice, 1, createMode); + { + const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); + expect(totalPieces.isSome).to.be.true; + expect(totalPieces.unwrap().toBigInt()).to.be.eq(1n); + } + }); + }); + + it.only('Check total pieces of ReFungible token', async () => { + await usingApi(async api => { + const createMode = 'ReFungible'; + const createCollectionResult = await createCollection(api, alice, {mode: {type: createMode}}); + const collectionId = createCollectionResult.collectionId; + const amountPieces = 100n; + const tokenId = await createItemExpectSuccess(alice, collectionId, createMode, bob.address); + { + const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); + expect(totalPieces.isSome).to.be.true; + expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); + } + + await transferExpectSuccess(collectionId, tokenId, bob, alice, 60n, createMode); + { + const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); + expect(totalPieces.isSome).to.be.true; + expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); + } + }); + }); }); describe('Negative integration test: ext. createItem():', () => { diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 72c1fe15ac..72890520d7 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -68,27 +68,6 @@ describe('integration test: Refungible functionality:', () => { }); }); - it.only('Check total pieces of token', async () => { - await usingApi(async api => { - const createCollectionResult = await createCollection(api, alice, {mode: {type: 'ReFungible'}}); - expect(createCollectionResult.success).to.be.true; - const collectionId = createCollectionResult.collectionId; - const amountPieces = 100n; - const result = await createRefungibleToken(api, alice, collectionId, amountPieces); - expect(result.success).to.be.true; - { - const totalPieces = await api.rpc.unique.totalPieces(collectionId, result.itemId); - expect(totalPieces.toBigInt()).to.be.eq(amountPieces); - } - - await transfer(api, collectionId, result.itemId, alice, bob, 60n); - { - const totalPieces = await api.rpc.unique.totalPieces(collectionId, result.itemId); - expect(totalPieces.toBigInt()).to.be.eq(amountPieces); - } - }); - }); - it('Transfer token pieces', async () => { await usingApi(async api => { const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; From 63e242dc3f1d5b732260f7b0ccadb6100905b631 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 30 Jun 2022 13:41:04 +0000 Subject: [PATCH 0004/1274] Add pieces into token data. Add negative tests. --- pallets/nonfungible/src/common.rs | 8 +++- primitives/data-structs/src/lib.rs | 1 + runtime/common/src/runtime_apis.rs | 3 +- tests/src/createItem.test.ts | 61 ++++++++++++++++++++++++++---- 4 files changed, 63 insertions(+), 10 deletions(-) diff --git a/pallets/nonfungible/src/common.rs b/pallets/nonfungible/src/common.rs index f21b84788e..8adf9b3987 100644 --- a/pallets/nonfungible/src/common.rs +++ b/pallets/nonfungible/src/common.rs @@ -473,7 +473,11 @@ impl CommonCollectionOperations for NonfungibleHandle { None } - fn total_pieces(&self, _token: TokenId) -> Option { - Some(1) + fn total_pieces(&self, token: TokenId) -> Option { + if >::contains_key((self.id, token)) { + Some(1) + } else { + None + } } } diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 2e507606f9..0a60900e18 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -181,6 +181,7 @@ impl TryFrom for TokenId { pub struct TokenData { pub properties: Vec, pub owner: Option, + pub pieces: Option, } pub struct OverflowError; diff --git a/runtime/common/src/runtime_apis.rs b/runtime/common/src/runtime_apis.rs index 2d0531a5a6..b89fc7793d 100644 --- a/runtime/common/src/runtime_apis.rs +++ b/runtime/common/src/runtime_apis.rs @@ -89,7 +89,8 @@ macro_rules! impl_common_runtime_apis { ) -> Result, DispatchError> { let token_data = TokenData { properties: Self::token_properties(collection, token_id, keys)?, - owner: Self::token_owner(collection, token_id)? + owner: Self::token_owner(collection, token_id)?, + pieces: Self::total_pieces(collection, token_id)? }; Ok(token_data) diff --git a/tests/src/createItem.test.ts b/tests/src/createItem.test.ts index 440014d0b4..728d06f6a7 100644 --- a/tests/src/createItem.test.ts +++ b/tests/src/createItem.test.ts @@ -98,47 +98,57 @@ describe('integration test: ext. ():', () => { await createItemWithPropsExpectSuccess(alice, newCollectionID, createMode, [{key: 'key1', value: 'val1'}]); }); - it.only('Check total pieces of Fungible token', async () => { + it('Check total pieces of Fungible token', async () => { await usingApi(async api => { const createMode = 'Fungible'; const collectionId = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}}); + const amountPieces = 10n; const tokenId = await createItemExpectSuccess(alice, collectionId, createMode, bob.address); { const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); expect(totalPieces.isSome).to.be.true; - expect(totalPieces.unwrap().toBigInt()).to.be.eq(10n); + expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); } await transferExpectSuccess(collectionId, tokenId, bob, alice, 1, createMode); { const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); expect(totalPieces.isSome).to.be.true; - expect(totalPieces.unwrap().toBigInt()).to.be.eq(10n); + expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); } + + const totalPieces = (await api.rpc.unique.tokenData(collectionId, tokenId, [])).pieces; + expect(totalPieces.isSome).to.be.true; + expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); }); }); - it.only('Check total pieces of NFT token', async () => { + it('Check total pieces of NFT token', async () => { await usingApi(async api => { const createMode = 'NFT'; const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}}); + const amountPieces = 1n; const tokenId = await createItemExpectSuccess(alice, collectionId, createMode, bob.address); { const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); expect(totalPieces.isSome).to.be.true; - expect(totalPieces.unwrap().toBigInt()).to.be.eq(1n); + expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); } await transferExpectSuccess(collectionId, tokenId, bob, alice, 1, createMode); { const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); expect(totalPieces.isSome).to.be.true; - expect(totalPieces.unwrap().toBigInt()).to.be.eq(1n); + expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); } + + const totalPieces = (await api.rpc.unique.tokenData(collectionId, tokenId, [])).pieces; + expect(totalPieces.isSome).to.be.true; + expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); }); }); - it.only('Check total pieces of ReFungible token', async () => { + it('Check total pieces of ReFungible token', async () => { await usingApi(async api => { const createMode = 'ReFungible'; const createCollectionResult = await createCollection(api, alice, {mode: {type: createMode}}); @@ -157,6 +167,10 @@ describe('integration test: ext. ():', () => { expect(totalPieces.isSome).to.be.true; expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); } + + const totalPieces = (await api.rpc.unique.tokenData(collectionId, tokenId, [])).pieces; + expect(totalPieces.isSome).to.be.true; + expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); }); }); }); @@ -233,4 +247,37 @@ describe('Negative integration test: ext. createItem():', () => { await createItemWithPropsExpectFailure(alice, newCollectionID, 'NFT', [{key: 'k', value: 'vvvvvv'.repeat(5000)}, {key: 'k2', value: 'vvv'.repeat(5000)}]); }); }); + + it('Check total pieces for invalid Fungible token', async () => { + await usingApi(async api => { + const createCollectionResult = await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}}); + const collectionId = createCollectionResult.collectionId; + const invalidTokenId = 1000_000; + + expect((await api.rpc.unique.totalPieces(collectionId, invalidTokenId)).isNone).to.be.true; + expect((await api.rpc.unique.tokenData(collectionId, invalidTokenId, [])).pieces.isNone).to.be.true; + }); + }); + + it('Check total pieces for invalid NFT token', async () => { + await usingApi(async api => { + const createCollectionResult = await createCollection(api, alice, {mode: {type: 'NFT'}}); + const collectionId = createCollectionResult.collectionId; + const invalidTokenId = 1000_000; + + expect((await api.rpc.unique.totalPieces(collectionId, invalidTokenId)).isNone).to.be.true; + expect((await api.rpc.unique.tokenData(collectionId, invalidTokenId, [])).pieces.isNone).to.be.true; + }); + }); + + it('Check total pieces for invalid Refungible token', async () => { + await usingApi(async api => { + const createCollectionResult = await createCollection(api, alice, {mode: {type: 'ReFungible'}}); + const collectionId = createCollectionResult.collectionId; + const invalidTokenId = 1000_000; + + expect((await api.rpc.unique.totalPieces(collectionId, invalidTokenId)).isNone).to.be.true; + expect((await api.rpc.unique.tokenData(collectionId, invalidTokenId, [])).pieces.isNone).to.be.true; + }); + }); }); From 83275847f9074287eb527d1d6cc58092832da667 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 1 Jul 2022 09:13:41 +0000 Subject: [PATCH 0005/1274] Fix PR --- primitives/data-structs/src/lib.rs | 2 +- runtime/common/src/runtime_apis.rs | 2 +- tests/src/interfaces/unique/definitions.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 0a60900e18..3bd999d856 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -181,7 +181,7 @@ impl TryFrom for TokenId { pub struct TokenData { pub properties: Vec, pub owner: Option, - pub pieces: Option, + pub pieces: u128, } pub struct OverflowError; diff --git a/runtime/common/src/runtime_apis.rs b/runtime/common/src/runtime_apis.rs index b89fc7793d..ef73280ac5 100644 --- a/runtime/common/src/runtime_apis.rs +++ b/runtime/common/src/runtime_apis.rs @@ -90,7 +90,7 @@ macro_rules! impl_common_runtime_apis { let token_data = TokenData { properties: Self::token_properties(collection, token_id, keys)?, owner: Self::token_owner(collection, token_id)?, - pieces: Self::total_pieces(collection, token_id)? + pieces: Self::total_pieces(collection, token_id)?.expect("Token pieces always must have some value"), }; Ok(token_data) diff --git a/tests/src/interfaces/unique/definitions.ts b/tests/src/interfaces/unique/definitions.ts index 9229e6eb07..aaa72cc26f 100644 --- a/tests/src/interfaces/unique/definitions.ts +++ b/tests/src/interfaces/unique/definitions.ts @@ -79,5 +79,6 @@ export default { allowed: fun('Check if user is allowed to use collection', [collectionParam, crossAccountParam()], 'bool'), nextSponsored: fun('Get number of blocks when sponsored transaction is available', [collectionParam, crossAccountParam(), tokenParam], 'Option'), effectiveCollectionLimits: fun('Get effective collection limits', [collectionParam], 'Option'), + totalPieces: fun('Get total pieces of token', [collectionParam, tokenParam], 'Option'), }, }; From a5763d49012b808d2df3d0a71c5a10127f7d02d4 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 5 Jul 2022 15:28:00 +0000 Subject: [PATCH 0006/1274] Fix unwrap --- runtime/common/src/runtime_apis.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/common/src/runtime_apis.rs b/runtime/common/src/runtime_apis.rs index ef73280ac5..083c92c988 100644 --- a/runtime/common/src/runtime_apis.rs +++ b/runtime/common/src/runtime_apis.rs @@ -90,7 +90,7 @@ macro_rules! impl_common_runtime_apis { let token_data = TokenData { properties: Self::token_properties(collection, token_id, keys)?, owner: Self::token_owner(collection, token_id)?, - pieces: Self::total_pieces(collection, token_id)?.expect("Token pieces always must have some value"), + pieces: Self::total_pieces(collection, token_id)?.unwrap_or(0), }; Ok(token_data) From 788534ba419ee09f66cfdc2d976f4f63b11b7a26 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 6 Jul 2022 10:27:47 +0000 Subject: [PATCH 0007/1274] Fix total pieces tests --- tests/src/createItem.test.ts | 15 ++- tests/src/interfaces/augment-api-events.ts | 118 ++++++++++----------- tests/src/interfaces/augment-api-rpc.ts | 4 + tests/src/interfaces/default/types.ts | 1 + tests/src/interfaces/lookup.ts | 3 +- tests/src/interfaces/types-lookup.ts | 1 + 6 files changed, 73 insertions(+), 69 deletions(-) diff --git a/tests/src/createItem.test.ts b/tests/src/createItem.test.ts index 728d06f6a7..97c754e87d 100644 --- a/tests/src/createItem.test.ts +++ b/tests/src/createItem.test.ts @@ -118,8 +118,7 @@ describe('integration test: ext. ():', () => { } const totalPieces = (await api.rpc.unique.tokenData(collectionId, tokenId, [])).pieces; - expect(totalPieces.isSome).to.be.true; - expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); + expect(totalPieces.toBigInt()).to.be.eq(amountPieces); }); }); @@ -143,8 +142,7 @@ describe('integration test: ext. ():', () => { } const totalPieces = (await api.rpc.unique.tokenData(collectionId, tokenId, [])).pieces; - expect(totalPieces.isSome).to.be.true; - expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); + expect(totalPieces.toBigInt()).to.be.eq(amountPieces); }); }); @@ -169,8 +167,7 @@ describe('integration test: ext. ():', () => { } const totalPieces = (await api.rpc.unique.tokenData(collectionId, tokenId, [])).pieces; - expect(totalPieces.isSome).to.be.true; - expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); + expect(totalPieces.toBigInt()).to.be.eq(amountPieces); }); }); }); @@ -255,7 +252,7 @@ describe('Negative integration test: ext. createItem():', () => { const invalidTokenId = 1000_000; expect((await api.rpc.unique.totalPieces(collectionId, invalidTokenId)).isNone).to.be.true; - expect((await api.rpc.unique.tokenData(collectionId, invalidTokenId, [])).pieces.isNone).to.be.true; + expect((await api.rpc.unique.tokenData(collectionId, invalidTokenId, [])).pieces.toBigInt()).to.be.eq(0n); }); }); @@ -266,7 +263,7 @@ describe('Negative integration test: ext. createItem():', () => { const invalidTokenId = 1000_000; expect((await api.rpc.unique.totalPieces(collectionId, invalidTokenId)).isNone).to.be.true; - expect((await api.rpc.unique.tokenData(collectionId, invalidTokenId, [])).pieces.isNone).to.be.true; + expect((await api.rpc.unique.tokenData(collectionId, invalidTokenId, [])).pieces.toBigInt()).to.be.eq(0n); }); }); @@ -277,7 +274,7 @@ describe('Negative integration test: ext. createItem():', () => { const invalidTokenId = 1000_000; expect((await api.rpc.unique.totalPieces(collectionId, invalidTokenId)).isNone).to.be.true; - expect((await api.rpc.unique.tokenData(collectionId, invalidTokenId, [])).pieces.isNone).to.be.true; + expect((await api.rpc.unique.tokenData(collectionId, invalidTokenId, [])).pieces.toBigInt()).to.be.eq(0n); }); }); }); diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index 6698d664fd..04bbef5200 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -13,45 +13,45 @@ declare module '@polkadot/api-base/types/events' { /** * A balance was set by root. **/ - BalanceSet: AugmentedEvent; + BalanceSet: AugmentedEvent; /** * Some amount was deposited (e.g. for transaction fees). **/ - Deposit: AugmentedEvent; + Deposit: AugmentedEvent; /** * An account was removed whose balance was non-zero but below ExistentialDeposit, * resulting in an outright loss. **/ - DustLost: AugmentedEvent; + DustLost: AugmentedEvent; /** * An account was created with some free balance. **/ - Endowed: AugmentedEvent; + Endowed: AugmentedEvent; /** * Some balance was reserved (moved from free to reserved). **/ - Reserved: AugmentedEvent; + Reserved: AugmentedEvent; /** * Some balance was moved from the reserve of the first account to the second account. * Final argument indicates the destination balance type. **/ - ReserveRepatriated: AugmentedEvent; + ReserveRepatriated: AugmentedEvent; /** * Some amount was removed from the account (e.g. for misbehavior). **/ - Slashed: AugmentedEvent; + Slashed: AugmentedEvent; /** * Transfer succeeded. **/ - Transfer: AugmentedEvent; + Transfer: AugmentedEvent; /** * Some balance was unreserved (moved from reserved to free). **/ - Unreserved: AugmentedEvent; + Unreserved: AugmentedEvent; /** * Some amount was withdrawn from the account (e.g. for transaction fees). **/ - Withdraw: AugmentedEvent; + Withdraw: AugmentedEvent; /** * Generic event **/ @@ -167,27 +167,27 @@ declare module '@polkadot/api-base/types/events' { /** * Downward message executed with the given outcome. **/ - ExecutedDownward: AugmentedEvent; + ExecutedDownward: AugmentedEvent; /** * Downward message is invalid XCM. **/ - InvalidFormat: AugmentedEvent; + InvalidFormat: AugmentedEvent; /** * Downward message is overweight and was placed in the overweight queue. **/ - OverweightEnqueued: AugmentedEvent; + OverweightEnqueued: AugmentedEvent; /** * Downward message from the overweight queue was executed. **/ - OverweightServiced: AugmentedEvent; + OverweightServiced: AugmentedEvent; /** * Downward message is unsupported version of XCM. **/ - UnsupportedVersion: AugmentedEvent; + UnsupportedVersion: AugmentedEvent; /** * The weight limit for handling downward messages was reached. **/ - WeightExhausted: AugmentedEvent; + WeightExhausted: AugmentedEvent; /** * Generic event **/ @@ -241,19 +241,19 @@ declare module '@polkadot/api-base/types/events' { /** * Downward messages were processed using the given weight. **/ - DownwardMessagesProcessed: AugmentedEvent; + DownwardMessagesProcessed: AugmentedEvent; /** * Some downward messages have been received and will be processed. **/ - DownwardMessagesReceived: AugmentedEvent; + DownwardMessagesReceived: AugmentedEvent; /** * An upgrade has been authorized. **/ - UpgradeAuthorized: AugmentedEvent; + UpgradeAuthorized: AugmentedEvent; /** * The validation function was applied as of the contained relay chain block number. **/ - ValidationFunctionApplied: AugmentedEvent; + ValidationFunctionApplied: AugmentedEvent; /** * The relay-chain aborted the upgrade process. **/ @@ -390,29 +390,29 @@ declare module '@polkadot/api-base/types/events' { [key: string]: AugmentedEvent; }; rmrkCore: { - CollectionCreated: AugmentedEvent; - CollectionDestroyed: AugmentedEvent; - CollectionLocked: AugmentedEvent; - IssuerChanged: AugmentedEvent; - NFTAccepted: AugmentedEvent; - NFTBurned: AugmentedEvent; - NftMinted: AugmentedEvent; - NFTRejected: AugmentedEvent; - NFTSent: AugmentedEvent; - PrioritySet: AugmentedEvent; - PropertySet: AugmentedEvent, Bytes, Bytes]>; - ResourceAccepted: AugmentedEvent; - ResourceAdded: AugmentedEvent; - ResourceRemoval: AugmentedEvent; - ResourceRemovalAccepted: AugmentedEvent; + CollectionCreated: AugmentedEvent; + CollectionDestroyed: AugmentedEvent; + CollectionLocked: AugmentedEvent; + IssuerChanged: AugmentedEvent; + NFTAccepted: AugmentedEvent; + NFTBurned: AugmentedEvent; + NftMinted: AugmentedEvent; + NFTRejected: AugmentedEvent; + NFTSent: AugmentedEvent; + PrioritySet: AugmentedEvent; + PropertySet: AugmentedEvent, key: Bytes, value: Bytes], { collectionId: u32, maybeNftId: Option, key: Bytes, value: Bytes }>; + ResourceAccepted: AugmentedEvent; + ResourceAdded: AugmentedEvent; + ResourceRemoval: AugmentedEvent; + ResourceRemovalAccepted: AugmentedEvent; /** * Generic event **/ [key: string]: AugmentedEvent; }; rmrkEquip: { - BaseCreated: AugmentedEvent; - EquippablesUpdated: AugmentedEvent; + BaseCreated: AugmentedEvent; + EquippablesUpdated: AugmentedEvent; /** * Generic event **/ @@ -422,19 +422,19 @@ declare module '@polkadot/api-base/types/events' { /** * The call for the provided hash was not found so the task has been aborted. **/ - CallLookupFailed: AugmentedEvent, Option, FrameSupportScheduleLookupError]>; + CallLookupFailed: AugmentedEvent, id: Option, error: FrameSupportScheduleLookupError], { task: ITuple<[u32, u32]>, id: Option, error: FrameSupportScheduleLookupError }>; /** * Canceled some task. **/ - Canceled: AugmentedEvent; + Canceled: AugmentedEvent; /** * Dispatched some task. **/ - Dispatched: AugmentedEvent, Option, Result]>; + Dispatched: AugmentedEvent, id: Option, result: Result], { task: ITuple<[u32, u32]>, id: Option, result: Result }>; /** * Scheduled some task. **/ - Scheduled: AugmentedEvent; + Scheduled: AugmentedEvent; /** * Generic event **/ @@ -454,15 +454,15 @@ declare module '@polkadot/api-base/types/events' { /** * The \[sudoer\] just switched identity; the old key is supplied if one existed. **/ - KeyChanged: AugmentedEvent]>; + KeyChanged: AugmentedEvent], { oldSudoer: Option }>; /** * A sudo just took place. \[result\] **/ - Sudid: AugmentedEvent]>; + Sudid: AugmentedEvent], { sudoResult: Result }>; /** * A sudo just took place. \[result\] **/ - SudoAsDone: AugmentedEvent]>; + SudoAsDone: AugmentedEvent], { sudoResult: Result }>; /** * Generic event **/ @@ -476,23 +476,23 @@ declare module '@polkadot/api-base/types/events' { /** * An extrinsic failed. **/ - ExtrinsicFailed: AugmentedEvent; + ExtrinsicFailed: AugmentedEvent; /** * An extrinsic completed successfully. **/ - ExtrinsicSuccess: AugmentedEvent; + ExtrinsicSuccess: AugmentedEvent; /** * An account was reaped. **/ - KilledAccount: AugmentedEvent; + KilledAccount: AugmentedEvent; /** * A new account was created. **/ - NewAccount: AugmentedEvent; + NewAccount: AugmentedEvent; /** * On on-chain remark happened. **/ - Remarked: AugmentedEvent; + Remarked: AugmentedEvent; /** * Generic event **/ @@ -502,31 +502,31 @@ declare module '@polkadot/api-base/types/events' { /** * Some funds have been allocated. **/ - Awarded: AugmentedEvent; + Awarded: AugmentedEvent; /** * Some of our funds have been burnt. **/ - Burnt: AugmentedEvent; + Burnt: AugmentedEvent; /** * Some funds have been deposited. **/ - Deposit: AugmentedEvent; + Deposit: AugmentedEvent; /** * New proposal. **/ - Proposed: AugmentedEvent; + Proposed: AugmentedEvent; /** * A proposal was rejected; funds were slashed. **/ - Rejected: AugmentedEvent; + Rejected: AugmentedEvent; /** * Spending has finished; this is the amount that rolls over until next spend. **/ - Rollover: AugmentedEvent; + Rollover: AugmentedEvent; /** * We have ended a spend period and will now allocate funds. **/ - Spending: AugmentedEvent; + Spending: AugmentedEvent; /** * Generic event **/ @@ -629,15 +629,15 @@ declare module '@polkadot/api-base/types/events' { /** * Claimed vesting. **/ - Claimed: AugmentedEvent; + Claimed: AugmentedEvent; /** * Added new vesting schedule. **/ - VestingScheduleAdded: AugmentedEvent; + VestingScheduleAdded: AugmentedEvent; /** * Updated vesting schedules. **/ - VestingSchedulesUpdated: AugmentedEvent; + VestingSchedulesUpdated: AugmentedEvent; /** * Generic event **/ diff --git a/tests/src/interfaces/augment-api-rpc.ts b/tests/src/interfaces/augment-api-rpc.ts index 07469fc4c4..08d81d5802 100644 --- a/tests/src/interfaces/augment-api-rpc.ts +++ b/tests/src/interfaces/augment-api-rpc.ts @@ -716,6 +716,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { * Get token owner, in case of nested token - find parent recursive **/ topmostTokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; + /** + * Get total pieces of token + **/ + totalPieces: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; /** * Get amount of unique collection tokens **/ diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index c0788206cc..d76bcd5fcc 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -2561,6 +2561,7 @@ export interface UpDataStructsTokenChild extends Struct { export interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; + readonly pieces: u128; } /** @name XcmDoubleEncoded */ diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 52a0c267e4..f58502a4ff 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -2859,7 +2859,8 @@ export default { **/ UpDataStructsTokenData: { properties: 'Vec', - owner: 'Option' + owner: 'Option', + pieces: 'u128' }, /** * Lookup376: up_data_structs::RpcCollection diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 4a299d4fe2..04ac25a6fe 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -2977,6 +2977,7 @@ declare module '@polkadot/types/lookup' { export interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; + readonly pieces: u128; } /** @name UpDataStructsRpcCollection (376) */ From efc33987ff867964645fe38e40d2e2bd62ba65d5 Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 11 Jul 2022 12:05:16 +0300 Subject: [PATCH 0008/1274] Comments and code description added --- pallets/scheduler/src/lib.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/pallets/scheduler/src/lib.rs b/pallets/scheduler/src/lib.rs index 7813bc0d4e..4d51730106 100644 --- a/pallets/scheduler/src/lib.rs +++ b/pallets/scheduler/src/lib.rs @@ -46,6 +46,15 @@ //! If a call is scheduled using proxy or whatever mecanism which adds filter, //! then those filter will not be used when dispatching the schedule call. //! +//! The scheduler is designed for deferred transaction calls by block number. +//! Any user can book a call of a certain transaction to a specific block number. +//! Also possible to book a call with a certain frequency. +//! Key differences from original pallet: +//! Id restricted by 16 bytes +//! Priority limited by HARD DEADLINE (<= 63). Calls over maximum weight don't include to block +//! Maybe_periodic limit is 100 calls +//! Any account allowed to schedule any calls. Account withdraw implemented through default transaction logic. +//! //! ## Interface //! //! ### Dispatchable Functions @@ -143,6 +152,7 @@ mod preimage_provider { pub use preimage_provider::PreimageProviderAndMaybeRecipient; +/// Weight templates for calculating actual fees pub(crate) trait MarginalWeightInfo: WeightInfo { fn item(periodic: bool, named: bool, resolved: Option) -> Weight { match (periodic, named, resolved) { @@ -249,7 +259,7 @@ pub mod pallet { /// If `Some` then the number of blocks to postpone execution for when the item is delayed. type NoPreimagePostponement: Get>; - /// Sponsoring function. + /// Sponsoring function. In this version sposorship is disabled // type SponsorshipHandler: SponsorshipHandler::Call>; /// The helper type used for custom transaction fee logic. @@ -258,6 +268,7 @@ pub mod pallet { /// A Scheduler-Runtime interface for finer payment handling. pub trait DispatchCall { + /// Lock balance required for transaction payment fn reserve_balance( id: ScheduledId, sponsor: ::AccountId, @@ -265,6 +276,7 @@ pub mod pallet { count: u32, ) -> Result<(), DispatchError>; + /// Unlock centain amount from payer fn pay_for_call( id: ScheduledId, sponsor: ::AccountId, @@ -280,6 +292,7 @@ pub mod pallet { TransactionValidityError, >; + /// Cancel schedule reservation and unlock balance fn cancel_reserve( id: ScheduledId, sponsor: ::AccountId, @@ -423,6 +436,7 @@ pub mod pallet { continue; } + // Sender is the account who signed transaction let sender = ensure_signed( <::Origin as From>::from(s.origin.clone()) .into(), @@ -438,6 +452,7 @@ pub mod pallet { // ); // } + // Execute transaction via chain default pipeline let r = T::CallExecutor::dispatch_call(sender, call.clone()); let mut actual_call_weight: Weight = item_weight; @@ -482,8 +497,8 @@ pub mod pallet { Agenda::::append(wake, Some(s)); } } + /// Weight should be 0, because transaction already paid 0 - //total_weight } } From f75f9ea94c9049fb15b2e882480394efaa255dd7 Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 11 Jul 2022 12:10:08 +0300 Subject: [PATCH 0009/1274] Cargo fmt --- pallets/scheduler/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pallets/scheduler/src/lib.rs b/pallets/scheduler/src/lib.rs index 4d51730106..6149c858aa 100644 --- a/pallets/scheduler/src/lib.rs +++ b/pallets/scheduler/src/lib.rs @@ -54,7 +54,7 @@ //! Priority limited by HARD DEADLINE (<= 63). Calls over maximum weight don't include to block //! Maybe_periodic limit is 100 calls //! Any account allowed to schedule any calls. Account withdraw implemented through default transaction logic. -//! +//! //! ## Interface //! //! ### Dispatchable Functions @@ -276,7 +276,7 @@ pub mod pallet { count: u32, ) -> Result<(), DispatchError>; - /// Unlock centain amount from payer + /// Unlock centain amount from payer fn pay_for_call( id: ScheduledId, sponsor: ::AccountId, @@ -497,7 +497,7 @@ pub mod pallet { Agenda::::append(wake, Some(s)); } } - /// Weight should be 0, because transaction already paid + /// Weight should be 0, because transaction already paid 0 } } From 2e3d152f5683f3374a4127a3dabdaa0012d487e1 Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Mon, 11 Jul 2022 09:12:49 +0000 Subject: [PATCH 0010/1274] fix: restrict XCM barrier from trusting parent chain --- runtime/opal/src/lib.rs | 1 - runtime/quartz/src/lib.rs | 1 - runtime/unique/src/lib.rs | 1 - 3 files changed, 3 deletions(-) diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index bded4eb54b..3a3a37411d 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -707,7 +707,6 @@ match_types! { pub type Barrier = ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, - AllowUnpaidExecutionFrom, // ^^^ Parent & its unit plurality gets free execution ); diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index a322cc0654..dc3fa045ac 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -706,7 +706,6 @@ match_types! { pub type Barrier = ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, - AllowUnpaidExecutionFrom, // ^^^ Parent & its unit plurality gets free execution ); diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index 63634c5717..e11cc930b2 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -705,7 +705,6 @@ match_types! { pub type Barrier = ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, - AllowUnpaidExecutionFrom, // ^^^ Parent & its unit plurality gets free execution ); From 10173820255a0e706270dcf68a9008adf1405396 Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Mon, 11 Jul 2022 09:13:40 +0000 Subject: [PATCH 0011/1274] fix: update XCM transfer test --- tests/src/xcmTransfer.test.ts | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/tests/src/xcmTransfer.test.ts b/tests/src/xcmTransfer.test.ts index dae291f2a4..a8b13237f4 100644 --- a/tests/src/xcmTransfer.test.ts +++ b/tests/src/xcmTransfer.test.ts @@ -31,6 +31,7 @@ const expect = chai.expect; const UNIQUE_CHAIN = 1000; const KARURA_CHAIN = 2000; const KARURA_PORT = '9946'; +const TRANSFER_AMOUNT = 2000000000000000000000000n; describe('Integration test: Exchanging QTZ with Karura', () => { let alice: IKeyringPair; @@ -113,7 +114,7 @@ describe('Integration test: Exchanging QTZ with Karura', () => { }, }, fun: { - Fungible: 5000000000, + Fungible: TRANSFER_AMOUNT, }, }, ], @@ -148,19 +149,17 @@ describe('Integration test: Exchanging QTZ with Karura', () => { await usingApi(async (api) => { const destination = { - V0: { - X3: [ - 'Parent', - { - Parachain: UNIQUE_CHAIN, - }, - { - AccountId32: { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: UNIQUE_CHAIN}, + {AccountId32: { network: 'Any', id: alice.addressRaw, - }, - }, - ], + }}, + ], + }, }, }; @@ -168,7 +167,7 @@ describe('Integration test: Exchanging QTZ with Karura', () => { ForeignAsset: 0, }; - const amount = 5000000000; + const amount = TRANSFER_AMOUNT; const destWeight = 50000000; const tx = api.tx.xTokens.transfer(id, amount, destination, destWeight); From e5ffee63ce659e93d1d2112fb5234ab772eefdca Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 11 Jul 2022 21:29:43 +0300 Subject: [PATCH 0012/1274] Doc style fix --- pallets/scheduler/src/lib.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/pallets/scheduler/src/lib.rs b/pallets/scheduler/src/lib.rs index 6149c858aa..35ac33df66 100644 --- a/pallets/scheduler/src/lib.rs +++ b/pallets/scheduler/src/lib.rs @@ -32,7 +32,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! # Schedulerdo_reschedule +//! # Unique scheduler +//! A Pallet for scheduling dispatches. +//! +//! - [`Config`] +//! - [`Call`] +//! - [`Pallet`] +//! +//! ## Overview //! //! This Pallet exposes capabilities for scheduling dispatches to occur at a //! specified block number or at a specified period. These scheduled dispatches @@ -46,7 +53,7 @@ //! If a call is scheduled using proxy or whatever mecanism which adds filter, //! then those filter will not be used when dispatching the schedule call. //! -//! The scheduler is designed for deferred transaction calls by block number. +//! **NOTE:** The unique scheduler is designed for deferred transaction calls by block number. //! Any user can book a call of a certain transaction to a specific block number. //! Also possible to book a call with a certain frequency. //! Key differences from original pallet: @@ -65,6 +72,17 @@ //! * `schedule_named` - augments the `schedule` interface with an additional `Vec` parameter //! that can be used for identification. //! * `cancel_named` - the named complement to the cancel function. +//! +//! ## Interface +//! +//! ### Dispatchable Functions +//! +//! * `schedule` - schedule a dispatch, which may be periodic, to occur at a specified block and +//! with a specified priority. +//! * `cancel` - cancel a scheduled dispatch, specified by block number and index. +//! * `schedule_named` - augments the `schedule` interface with an additional `Vec` parameter +//! that can be used for identification. +//! * `cancel_named` - the named complement to the cancel function. // Ensure we're `no_std` when compiling for Wasm. #![cfg_attr(not(feature = "std"), no_std)] From 3bed4e0e0176fa58a3a98b53812fc5e835d1b832 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 12 Jul 2022 14:05:26 +0300 Subject: [PATCH 0013/1274] Duplicate lines removed --- pallets/scheduler/src/lib.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pallets/scheduler/src/lib.rs b/pallets/scheduler/src/lib.rs index 35ac33df66..62136affb4 100644 --- a/pallets/scheduler/src/lib.rs +++ b/pallets/scheduler/src/lib.rs @@ -72,17 +72,6 @@ //! * `schedule_named` - augments the `schedule` interface with an additional `Vec` parameter //! that can be used for identification. //! * `cancel_named` - the named complement to the cancel function. -//! -//! ## Interface -//! -//! ### Dispatchable Functions -//! -//! * `schedule` - schedule a dispatch, which may be periodic, to occur at a specified block and -//! with a specified priority. -//! * `cancel` - cancel a scheduled dispatch, specified by block number and index. -//! * `schedule_named` - augments the `schedule` interface with an additional `Vec` parameter -//! that can be used for identification. -//! * `cancel_named` - the named complement to the cancel function. // Ensure we're `no_std` when compiling for Wasm. #![cfg_attr(not(feature = "std"), no_std)] From c6eb2378a98cb071bb67e22e8b2b967f4f496157 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 12 Jul 2022 12:20:09 +0000 Subject: [PATCH 0014/1274] doc: added docs for refungible pallet --- pallets/refungible/src/common.rs | 2 + pallets/refungible/src/lib.rs | 154 ++++++++++++++++++++++++++++++- 2 files changed, 153 insertions(+), 3 deletions(-) diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index 8d3fe5744d..0b5da73b43 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -145,6 +145,8 @@ fn map_create_data( } } +/// Implementation of `CommonCollectionOperations` for `RefungibleHandle`. It wraps Refungible Pallete +/// methods and adds weight info. impl CommonCollectionOperations for RefungibleHandle { fn create_item( &self, diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 3bea36bc6b..474da925c4 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -14,6 +14,77 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! # Refungible Pallet +//! +//! The Refungible pallet provides functionality for handling refungible collections and tokens. +//! +//! - [`Config`] +//! - [`RefungibleHandle`] +//! - [`Pallet`] +//! - [`CommonWeights`] +//! +//! ## Overview +//! +//! The Refungible pallet provides functions for: +//! +//! - RFT collection creation and removal +//! - Minting and burning of RFT tokens +//! - Partition and repartition of RFT tokens +//! - Retrieving number of pieces of RFT token +//! - Retrieving account balances +//! - Transfering RFT token pieces +//! - Burning RFT token pieces +//! - Setting and checking allowance for RFT tokens +//! +//! ### Terminology +//! +//! - **RFT token:** Non fungible token that was partitioned to pieces. If an account owns all +//! of the RFT token pieces than it owns the RFT token and can repartition it. +//! +//! - **RFT Collection:** A collection of RFT tokens. All RFT tokens are part of a collection. +//! Each collection has its own settings and set of permissions. +//! +//! - **RFT token piece:** A fungible part of an RFT token. +//! +//! - **Balance:** RFT token pieces owned by an account +//! +//! - **Allowance:** Maximum number of RFT token pieces that one account is allowed to +//! transfer from the balance of another account +//! +//! - **Burning:** The process of “deleting” a token from a collection or removing token pieces from +//! an account balance. +//! +//! ### Implementations +//! +//! The Refungible pallet provides implementations for the following traits. If these traits provide +//! the functionality that you need, then you can avoid coupling with the Refungible pallet. +//! +//! - [`CommonWeightInfo`](pallet_common::CommonWeightInfo): Functions for retrieval of transaction weight +//! - [`CommonCollectionOperations`](pallet_common::CommonCollectionOperations): Functions for dealing +//! with collections +//! - [`RefungibleExtensions`](pallet_common::RefungibleExtensions): Functions specific for refungible +//! collection +//! +//! ## Interface +//! +//! ### Dispatchable Functions +//! +//! - `init_collection` - Create RFT collection. RFT collection can be configured to allow or deny access for +//! some accounts. +//! - `destroy_collection` - Destroy exising RFT collection. There should be no tokens in the collection. +//! - `burn` - Burn some amount of RFT token pieces owned by account. Burns the RFT token if no pieces left. +//! - `transfer` - Transfer some amount of RFT token pieces. Transfers should be enabled for RFT collection. +//! Nests the RFT token if RFT token pieces are sent to another token. +//! - `create_item` - Mint RFT token in collection. Sender should have permission to mint tokens. +//! - `set_allowance` - Set allowance for another account to transfer balance from sender's account. +//! - `repartition` - Repartition token to selected number of pieces. Sender should own all existing pieces. +//! +//! ## Assumptions +//! +//! * Total number of pieces for one token shouldn't exceed `up_data_structs::MAX_REFUNGIBLE_PIECES`. +//! * Total number of tokens of all types shouldn't be greater than `up_data_structs::MAX_TOKEN_PREFIX_LENGTH`. +//! * Sender should be in collection's allow list to perform operations on tokens. + #![cfg_attr(not(feature = "std"), no_std)] use frame_support::{ensure, BoundedVec}; @@ -86,13 +157,17 @@ pub mod pallet { #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); + /// Amount of tokens minted for collection #[pallet::storage] pub type TokensMinted = StorageMap; + + /// Amount of burnt tokens for collection #[pallet::storage] pub type TokensBurnt = StorageMap; + /// Custom data serialized to bytes for token #[pallet::storage] pub type TokenData = StorageNMap< Key = (Key, Key), @@ -100,6 +175,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// Total amount of pieces for token #[pallet::storage] pub type TotalSupply = StorageNMap< Key = (Key, Key), @@ -119,6 +195,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// Amount of tokens owned by account #[pallet::storage] pub type AccountBalance = StorageNMap< Key = ( @@ -130,6 +207,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// Amount of token pieces owned by account #[pallet::storage] pub type Balance = StorageNMap< Key = ( @@ -142,6 +220,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// Allowance set by an owner for a spender for a token #[pallet::storage] pub type Allowance = StorageNMap< Key = ( @@ -188,9 +267,14 @@ impl Deref for RefungibleHandle { } impl Pallet { + /// Get number of RFT tokens in collection pub fn total_supply(collection: &RefungibleHandle) -> u32 { >::get(collection.id) - >::get(collection.id) } + + /// Check that RFT token exists + /// + /// - `token`: Token ID. pub fn token_exists(collection: &RefungibleHandle, token: TokenId) -> bool { >::contains_key((collection.id, token)) } @@ -198,12 +282,22 @@ impl Pallet { // unchecked calls skips any permission checks impl Pallet { + /// Create RFT collection + /// + /// `init_collection` will take non-refundable deposit for collection creation. + /// + /// - `data`: Contains settings for collection limits and permissions. pub fn init_collection( owner: T::CrossAccountId, data: CreateCollectionData, ) -> Result { >::init_collection(owner, data, false) } + + /// Destroy RFT collection + /// + /// `destroy_collection` will throw error if collection contains any tokens. + /// Only owner can destroy collection. pub fn destroy_collection( collection: RefungibleHandle, sender: &T::CrossAccountId, @@ -235,7 +329,10 @@ impl Pallet { .is_some() } - pub fn burn_token(collection: &RefungibleHandle, token_id: TokenId) -> DispatchResult { + pub fn burn_token_unchecked( + collection: &RefungibleHandle, + token_id: TokenId, + ) -> DispatchResult { let burnt = >::get(collection.id) .checked_add(1) .ok_or(ArithmeticError::Overflow)?; @@ -249,6 +346,16 @@ impl Pallet { Ok(()) } + /// Burn RFT token pieces + /// + /// `burn` will decrease total amount of token pieces and amount owned by sender. + /// If sender wouldn't have any pieces left after `burn` than she will stop being + /// one of the owners of the token. If there is no account that owns any pieces of + /// the token than token will be burned too. + /// + /// - `amount`: Amount of token pieces to burn. + /// - `token`: Token who's pieces should be burned + /// - `collection`: Collection that contains the token pub fn burn( collection: &RefungibleHandle, owner: &T::CrossAccountId, @@ -276,7 +383,7 @@ impl Pallet { >::remove((collection.id, owner, token)); >::unnest_if_nested(owner, collection.id, token); >::insert((collection.id, owner), account_balance); - Self::burn_token(collection, token)?; + Self::burn_token_unchecked(collection, token)?; >::deposit_event(CommonEvent::ItemDestroyed( collection.id, token, @@ -319,6 +426,15 @@ impl Pallet { Ok(()) } + /// Transfer RFT token pieces from one account to another. + /// + /// If the sender is no longer owns any pieces after the `transfer` than she stops being an owner of the token. + /// + /// - `from`: Owner of token pieces to transfer. + /// - `to`: Recepient of transfered token pieces. + /// - `amount`: Amount of token pieces to transfer. + /// - `token`: Token whos pieces should be transfered + /// - `collection`: Collection that contains the token pub fn transfer( collection: &RefungibleHandle, from: &T::CrossAccountId, @@ -423,6 +539,11 @@ impl Pallet { Ok(()) } + /// Batched operation to create multiple RFT tokens. + /// + /// Same as `create_item` but creates multiple tokens. + /// + /// - `data`: Same as 'data` in `create_item` but contains data for multiple tokens. pub fn create_multiple_items( collection: &RefungibleHandle, sender: &T::CrossAccountId, @@ -568,6 +689,9 @@ impl Pallet { )) } + /// Set allowance for the spender to `transfer` or `burn` sender's token pieces. + /// + /// - `amount`: Amount of token pieces the spender is allowed to `transfer` or `burn. pub fn set_allowance( collection: &RefungibleHandle, sender: &T::CrossAccountId, @@ -636,6 +760,12 @@ impl Pallet { Ok(allowance) } + /// Transfer RFT token pieces from one account to another. + /// + /// Same as the [`transfer`] but spender doesn't needs to be an owner of the token pieces. + /// The owner should set allowance for the spender to transfer pieces. + /// + /// [`transfer`]: struct.Pallet.html#method.transfer pub fn transfer_from( collection: &RefungibleHandle, spender: &T::CrossAccountId, @@ -657,6 +787,12 @@ impl Pallet { Ok(()) } + /// Burn RFT token pieces from the account. + /// + /// Same as the [`burn`] but spender doesn't need to be an owner of the token pieces. The owner should + /// set allowance for the spender to burn pieces + /// + /// [`burn`]: struct.Pallet.html#method.burn pub fn burn_from( collection: &RefungibleHandle, spender: &T::CrossAccountId, @@ -677,7 +813,13 @@ impl Pallet { Ok(()) } - /// Delegated to `create_multiple_items` + /// Create RFT token. + /// + /// The sender should be the owner/admin of the collection or collection should be configured + /// to allow public minting. + /// + /// - `data`: Contains list of users who will become the owners of the token pieces and amount + /// of token pieces they will receive. pub fn create_item( collection: &RefungibleHandle, sender: &T::CrossAccountId, @@ -687,6 +829,12 @@ impl Pallet { Self::create_multiple_items(collection, sender, vec![data], nesting_budget) } + /// Repartition RFT token. + /// + /// Repartition will set token balance of the sender and total amount of token pieces. + /// Sender should own all of the token pieces. + /// + /// - `amount`: Total amount of token pieces that the token will have after `repartition`. pub fn repartition( collection: &RefungibleHandle, owner: &T::CrossAccountId, From ca9fba1ceb64cf630e9aa32dc4ae349c8a84cd73 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 12 Jul 2022 23:00:13 +0300 Subject: [PATCH 0015/1274] Inflation pallet documentation --- pallets/inflation/src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pallets/inflation/src/lib.rs b/pallets/inflation/src/lib.rs index d4ddfe7853..c2ac38b2e3 100644 --- a/pallets/inflation/src/lib.rs +++ b/pallets/inflation/src/lib.rs @@ -14,6 +14,20 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! # Inflation +//! +//! The inflation pallet is designed to increase the number of tokens at certain intervals. +//! With each iteration, increases the `total_issuance` value for the native token. +//! Executing an `on_initialize` hook at the beginning of each block, causing inflation to begin. +//! +//! ## Interface +//! +//! ### Dispatchable Functions +//! +//! * `start_inflation` - This method sets the inflation start date. Can be only called once. +//! Inflation start block can be backdated and will catch up. The method will create Treasury +//! account if it does not exist and perform the first inflation deposit. + // #![recursion_limit = "1024"] #![cfg_attr(not(feature = "std"), no_std)] From 4655b487128ce622567e9aaf75b189edba71ca04 Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 13 Jul 2022 00:00:38 +0300 Subject: [PATCH 0016/1274] Typos fixed --- pallets/scheduler/src/lib.rs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/pallets/scheduler/src/lib.rs b/pallets/scheduler/src/lib.rs index 4d51730106..7813bc0d4e 100644 --- a/pallets/scheduler/src/lib.rs +++ b/pallets/scheduler/src/lib.rs @@ -46,15 +46,6 @@ //! If a call is scheduled using proxy or whatever mecanism which adds filter, //! then those filter will not be used when dispatching the schedule call. //! -//! The scheduler is designed for deferred transaction calls by block number. -//! Any user can book a call of a certain transaction to a specific block number. -//! Also possible to book a call with a certain frequency. -//! Key differences from original pallet: -//! Id restricted by 16 bytes -//! Priority limited by HARD DEADLINE (<= 63). Calls over maximum weight don't include to block -//! Maybe_periodic limit is 100 calls -//! Any account allowed to schedule any calls. Account withdraw implemented through default transaction logic. -//! //! ## Interface //! //! ### Dispatchable Functions @@ -152,7 +143,6 @@ mod preimage_provider { pub use preimage_provider::PreimageProviderAndMaybeRecipient; -/// Weight templates for calculating actual fees pub(crate) trait MarginalWeightInfo: WeightInfo { fn item(periodic: bool, named: bool, resolved: Option) -> Weight { match (periodic, named, resolved) { @@ -259,7 +249,7 @@ pub mod pallet { /// If `Some` then the number of blocks to postpone execution for when the item is delayed. type NoPreimagePostponement: Get>; - /// Sponsoring function. In this version sposorship is disabled + /// Sponsoring function. // type SponsorshipHandler: SponsorshipHandler::Call>; /// The helper type used for custom transaction fee logic. @@ -268,7 +258,6 @@ pub mod pallet { /// A Scheduler-Runtime interface for finer payment handling. pub trait DispatchCall { - /// Lock balance required for transaction payment fn reserve_balance( id: ScheduledId, sponsor: ::AccountId, @@ -276,7 +265,6 @@ pub mod pallet { count: u32, ) -> Result<(), DispatchError>; - /// Unlock centain amount from payer fn pay_for_call( id: ScheduledId, sponsor: ::AccountId, @@ -292,7 +280,6 @@ pub mod pallet { TransactionValidityError, >; - /// Cancel schedule reservation and unlock balance fn cancel_reserve( id: ScheduledId, sponsor: ::AccountId, @@ -436,7 +423,6 @@ pub mod pallet { continue; } - // Sender is the account who signed transaction let sender = ensure_signed( <::Origin as From>::from(s.origin.clone()) .into(), @@ -452,7 +438,6 @@ pub mod pallet { // ); // } - // Execute transaction via chain default pipeline let r = T::CallExecutor::dispatch_call(sender, call.clone()); let mut actual_call_weight: Weight = item_weight; @@ -497,8 +482,8 @@ pub mod pallet { Agenda::::append(wake, Some(s)); } } - /// Weight should be 0, because transaction already paid 0 + //total_weight } } From 458018a9b70435a4dd5da7af0b78c1e60da1fbd0 Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 13 Jul 2022 11:56:21 +0300 Subject: [PATCH 0017/1274] Documentation extended --- pallets/scheduler/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pallets/scheduler/src/lib.rs b/pallets/scheduler/src/lib.rs index 62136affb4..2677bfbd7d 100644 --- a/pallets/scheduler/src/lib.rs +++ b/pallets/scheduler/src/lib.rs @@ -56,8 +56,10 @@ //! **NOTE:** The unique scheduler is designed for deferred transaction calls by block number. //! Any user can book a call of a certain transaction to a specific block number. //! Also possible to book a call with a certain frequency. +//! //! Key differences from original pallet: -//! Id restricted by 16 bytes +//! https://crates.io/crates/pallet-scheduler +//! Schedule Id restricted by 16 bytes //! Priority limited by HARD DEADLINE (<= 63). Calls over maximum weight don't include to block //! Maybe_periodic limit is 100 calls //! Any account allowed to schedule any calls. Account withdraw implemented through default transaction logic. @@ -460,6 +462,7 @@ pub mod pallet { // } // Execute transaction via chain default pipeline + // That means dispatch will be processed like any user's extrinsic e.g. transaction fees will be taken let r = T::CallExecutor::dispatch_call(sender, call.clone()); let mut actual_call_weight: Weight = item_weight; From 4c545c7371c2a584ae3a636c0fed899db7bf3c09 Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 13 Jul 2022 12:52:09 +0300 Subject: [PATCH 0018/1274] Reworked --- pallets/scheduler/src/lib.rs | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/pallets/scheduler/src/lib.rs b/pallets/scheduler/src/lib.rs index 2677bfbd7d..cc73e277d5 100644 --- a/pallets/scheduler/src/lib.rs +++ b/pallets/scheduler/src/lib.rs @@ -43,34 +43,25 @@ //! //! This Pallet exposes capabilities for scheduling dispatches to occur at a //! specified block number or at a specified period. These scheduled dispatches -//! may be named or anonymous and may be canceled. -//! -//! **NOTE:** The scheduled calls will be dispatched with the default filter -//! for the origin: namely `frame_system::Config::BaseCallFilter` for all origin -//! except root which will get no filter. And not the filter contained in origin -//! use to call `fn schedule`. -//! -//! If a call is scheduled using proxy or whatever mecanism which adds filter, -//! then those filter will not be used when dispatching the schedule call. +//! should be named and may be canceled. //! //! **NOTE:** The unique scheduler is designed for deferred transaction calls by block number. //! Any user can book a call of a certain transaction to a specific block number. //! Also possible to book a call with a certain frequency. //! -//! Key differences from original pallet: +//! Key differences from the original pallet: //! https://crates.io/crates/pallet-scheduler -//! Schedule Id restricted by 16 bytes -//! Priority limited by HARD DEADLINE (<= 63). Calls over maximum weight don't include to block -//! Maybe_periodic limit is 100 calls +//! Schedule Id restricted by 16 bytes. Identificator for booked call. +//! Priority limited by HARD DEADLINE (<= 63). Calls over maximum weight don't include to block. +//! The maximum weight that may be scheduled per block for any dispatchables of less priority than `schedule::HARD_DEADLINE`. +//! Maybe_periodic limit is 100 calls. Reserved for future sponsored transaction support. +//! At 100 calls reserved amount is not so much and this is avoid potential problems with balance locks. //! Any account allowed to schedule any calls. Account withdraw implemented through default transaction logic. //! //! ## Interface //! //! ### Dispatchable Functions //! -//! * `schedule` - schedule a dispatch, which may be periodic, to occur at a specified block and -//! with a specified priority. -//! * `cancel` - cancel a scheduled dispatch, specified by block number and index. //! * `schedule_named` - augments the `schedule` interface with an additional `Vec` parameter //! that can be used for identification. //! * `cancel_named` - the named complement to the cancel function. From 270ecfc60b89351694ef864602559d4f1a55c065 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Wed, 13 Jul 2022 12:33:14 +0000 Subject: [PATCH 0019/1274] doc: added documentation for structure pallet --- pallets/structure/src/benchmarking.rs | 16 +++++ pallets/structure/src/lib.rs | 99 ++++++++++++++++++++++++++- 2 files changed, 114 insertions(+), 1 deletion(-) diff --git a/pallets/structure/src/benchmarking.rs b/pallets/structure/src/benchmarking.rs index 26d8155436..8697b06cff 100644 --- a/pallets/structure/src/benchmarking.rs +++ b/pallets/structure/src/benchmarking.rs @@ -1,3 +1,19 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + use super::*; use frame_benchmarking::{benchmarks, account}; diff --git a/pallets/structure/src/lib.rs b/pallets/structure/src/lib.rs index 58defa2929..13f3b8754b 100644 --- a/pallets/structure/src/lib.rs +++ b/pallets/structure/src/lib.rs @@ -1,3 +1,60 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +//! # Structure Pallet +//! +//! The Structure pallet provides functionality for handling tokens nesting an unnesting. +//! +//! - [`Config`] +//! - [`Pallet`] +//! +//! ## Overview +//! +//! The Structure pallet provides functions for: +//! +//! - Searching for token parents, children and owners. Actual implementation of searching for +//! parent/child is done by pallets corresponding to token's collection type. +//! - Nesting and unnesting tokens. Actual implementation of nesting is done by pallets corresponding +//! to token's collection type. +//! +//! ### Terminology +//! +//! - **Nesting:** Setting up parent-child relationship between tokens. Nested tokens are inhereting +//! owner from their parent. There could be multiple levels of nesting. Token couldn't be nested in +//! it's child token i.e. parent-child relationship graph shouldn't have +//! +//! - **Parent:** Token that current token is nested in. +//! +//! - **Owner:** Account that owns the token and all nested tokens. +//! +//! ## Interface +//! +//! ### Dispatchable Functions +//! +//! - `find_parent` - Find parent of the token. It could be an account or another token. +//! - `parent_chain` - Find chain of parents of the token. +//! - `find_topmost_owner` - Find account or token in the end of the chain of parents. +//! - `check_nesting` - Check if the token could be nested in the other token +//! - `nest_if_sent_to_token` - Nest the token in the other token +//! - `unnest_if_nested` - Unnest the token from the other token +//! +//! ## Assumptions +//! +//! * Total issued balanced of all accounts should be less than `Config::Balance::max_value()`. + #![cfg_attr(not(feature = "std"), no_std)] use pallet_common::CommonCollectionOperations; @@ -82,6 +139,12 @@ pub enum Parent { } impl Pallet { + /// Find account owning the `token` or a token that the `token` is nested in. + /// + /// Returns the enum that have three variants: + /// - [`User`](crate::Parent::User): Contains account. + /// - [`Token`](crate::Parent::Token): Contains token id and collection id. + /// - [`TokenNotFound`](crate::Parent::TokenNotFound): Indicates that parent was not found pub fn find_parent( collection: CollectionId, token: TokenId, @@ -103,6 +166,10 @@ impl Pallet { }) } + /// Find chain of parents of current token + /// + /// Returns the parent of the current token, than the parent of the parent and so on until token without a parent + /// is returned. Returns error if cycle is detected. pub fn parent_chain( mut collection: CollectionId, mut token: TokenId, @@ -133,6 +200,8 @@ impl Pallet { /// Try to dereference address, until finding top level owner /// /// May return token address if parent token not yet exists + /// + /// - `budget`: Limit for searching parents in depth. pub fn find_topmost_owner( collection: CollectionId, token: TokenId, @@ -149,6 +218,10 @@ impl Pallet { }) } + /// Find the topmost parent and check that assigning `for_nest` token as a parent for + /// any token in the parents chain wouldn't create a cycle. + /// + /// - `budget`: Limit for searching parents in depth. pub fn get_checked_topmost_owner( collection: CollectionId, token: TokenId, @@ -177,6 +250,10 @@ impl Pallet { Err(>::DepthLimit.into()) } + /// Burn token and all of it's nested tokens + /// + /// - `self_budget`: Limit for searching children in depth. + /// - `breadth_budget`: Limit of breadth of searching children. pub fn burn_item_recursively( from: T::CrossAccountId, collection: CollectionId, @@ -190,7 +267,14 @@ impl Pallet { dispatch.burn_item_recursively(from.clone(), token, self_budget, breadth_budget) } - /// Check if token indirectly owned by specified user + /// Check if `token` indirectly owned by `user` + /// + /// Returns `true` if `user` is `token`'s owner. Or If token is provided as `user` then + /// check that `user` and `token` have same owner. + /// Checks that assigning `for_nest` token as a parent for any token in the `token`'s + /// parents chain wouldn't create a cycle. + /// + /// - `budget`: Limit for searching parents in depth. pub fn check_indirectly_owned( user: T::CrossAccountId, collection: CollectionId, @@ -207,6 +291,12 @@ impl Pallet { .map(|indirect_owner| indirect_owner == target_parent) } + /// Checks that `under` is valid token and that `token_id` could be nested under it + /// and that `from` is `under`'s owner + /// + /// Returns OK if `under` is not a token + /// + /// - `nesting_budget`: Limit for searching parents in depth. pub fn check_nesting( from: T::CrossAccountId, under: &T::CrossAccountId, @@ -219,6 +309,11 @@ impl Pallet { }) } + /// Nests `token_id` under `under` token + /// + /// Returns OK if `under` is not a token. Checks that nesting is possible. + /// + /// - `nesting_budget`: Limit for searching parents in depth. pub fn nest_if_sent_to_token( from: T::CrossAccountId, under: &T::CrossAccountId, @@ -235,6 +330,7 @@ impl Pallet { }) } + /// Nests `token_id` under `owner` token pub fn nest_if_sent_to_token_unchecked( owner: &T::CrossAccountId, collection_id: CollectionId, @@ -245,6 +341,7 @@ impl Pallet { }); } + /// Unnests `token_id` from `owner`. pub fn unnest_if_nested( owner: &T::CrossAccountId, collection_id: CollectionId, From 0766e08cb8d315cc307d5bcbb0ab0086434f091d Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 13 Jul 2022 21:13:42 +0700 Subject: [PATCH 0020/1274] doc(pallet-fungible): document public api --- pallets/fungible/src/common.rs | 2 + pallets/fungible/src/erc.rs | 2 + pallets/fungible/src/lib.rs | 93 ++++++++++++++++++++++++++++++++-- 3 files changed, 92 insertions(+), 5 deletions(-) diff --git a/pallets/fungible/src/common.rs b/pallets/fungible/src/common.rs index fa3660c780..412b36e330 100644 --- a/pallets/fungible/src/common.rs +++ b/pallets/fungible/src/common.rs @@ -104,6 +104,8 @@ impl CommonWeightInfo for CommonWeights { } } +/// Implementation of `CommonCollectionOperations` for `FungibleHandle`. It wraps FungibleHandle Pallete +/// methods and adds weight info. impl CommonCollectionOperations for FungibleHandle { fn create_item( &self, diff --git a/pallets/fungible/src/erc.rs b/pallets/fungible/src/erc.rs index 8364a08612..fcdcf025a4 100644 --- a/pallets/fungible/src/erc.rs +++ b/pallets/fungible/src/erc.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! ERC-20 standart support implementation. + use core::char::{REPLACEMENT_CHARACTER, decode_utf16}; use core::convert::TryInto; use evm_coder::{ToLog, execution::*, generate_stubgen, solidity_interface, types::*, weight}; diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index d3a9d97c10..d4aef52a49 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -14,6 +14,68 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! # Fungible Pallet +//! +//! The Fungible pallet provides functionality for dealing with fungible assets. +//! +//! - [`CreateItemData`] +//! - [`Config`] +//! - [`FungibleHandle`] +//! - [`Pallet`] +//! - [`TotalSupply`] +//! - [`Balance`] +//! - [`Allowance`] +//! - [`Error`] +//! +//! ## Fungible tokens +//! +//! Fungible tokens or assets are divisible and non-unique. For instance, +//! fiat currencies like the dollar are fungible: A $1 bill +//! in New York City has the same value as a $1 bill in Miami. +//! A fungible token can also be a cryptocurrency like Bitcoin: 1 BTC is worth 1 BTC, +//! no matter where it is issued. Thus, the fungibility refers to a specific currency’s +//! ability to maintain one standard value. As well, it needs to have uniform acceptance. +//! This means that a currency’s history should not be able to affect its value, +//! and this is due to the fact that each piece that is a part of the currency is equal +//! in value when compared to every other piece of that exact same currency. +//! In the world of cryptocurrencies, this is essentially a coin or a token +//! that can be replaced by another identical coin or token, and they are +//! both mutually interchangeable. A popular implementation of fungible tokens is +//! the ERC-20 token standard. +//! +//! ### ERC-20 +//! +//! The [ERC-20](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/) (Ethereum Request for Comments 20), proposed by Fabian Vogelsteller in November 2015, +//! is a Token Standard that implements an API for tokens within Smart Contracts. +//! +//! Example functionalities ERC-20 provides: +//! +//! * transfer tokens from one account to another +//! * get the current token balance of an account +//! * get the total supply of the token available on the network +//! * approve whether an amount of token from an account can be spent by a third-party account +//! +//! ## Overview +//! +//! The module provides functionality for asset management of fungible asset, supports ERC-20 standart, includes: +//! +//! * Asset Issuance +//! * Asset Transferal +//! * Asset Destruction +//! * Delegated Asset Transfers +//! +//! **NOTE:** The created fungible asset always has `token_id` = 0. +//! So `tokenA` and `tokenB` will have different `collection_id`. +//! +//! ### Implementations +//! +//! The Fungible pallet provides implementations for the following traits. +//! +//! - [`WithRecorder`](pallet_evm_coder_substrate::WithRecorder): +//! - [`CommonCollectionOperations`](pallet_common::CommonCollectionOperations): Functions for dealing with collections +//! - [`CommonWeightInfo`](pallet_common::CommonWeightInfo): Functions for retrieval of transaction weight +//! - [`CommonEvmHandler`](pallet_common::erc::CommonEvmHandler): Function for handling EVM runtime calls + #![cfg_attr(not(feature = "std"), no_std)] use core::ops::Deref; @@ -57,13 +119,13 @@ pub mod pallet { pub enum Error { /// Not Fungible item data used to mint in Fungible collection. NotFungibleDataUsedToMintFungibleCollectionToken, - /// Not default id passed as TokenId argument + /// Not default id passed as TokenId argument. FungibleItemsHaveNoId, - /// Tried to set data for fungible item + /// Tried to set data for fungible item. FungibleItemsDontHaveData, - /// Fungible token does not support nested + /// Fungible token does not support nesting. FungibleDisallowsNesting, - /// Setting item properties is not allowed + /// Setting item properties is not allowed. SettingPropertiesNotAllowed, } @@ -78,10 +140,12 @@ pub mod pallet { #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); + /// Total amount of fungible tokens inside a collection. #[pallet::storage] pub type TotalSupply = StorageMap; + /// Amount of tokens owned by an account inside a collection. #[pallet::storage] pub type Balance = StorageNMap< Key = ( @@ -92,6 +156,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// Storage for delegated assets. #[pallet::storage] pub type Allowance = StorageNMap< Key = ( @@ -103,15 +168,19 @@ pub mod pallet { QueryKind = ValueQuery, >; } - +/// Handler for fungible assets. pub struct FungibleHandle(pallet_common::CollectionHandle); impl FungibleHandle { + /// Casts [pallet_common::CollectionHandle] into [FungibleHandle]. pub fn cast(inner: pallet_common::CollectionHandle) -> Self { Self(inner) } + + /// Casts [FungibleHandle] into [pallet_common::CollectionHandle]. pub fn into_inner(self) -> pallet_common::CollectionHandle { self.0 } + /// Returns a mutable reference to the internal [pallet_common::CollectionHandle]. pub fn common_mut(&mut self) -> &mut pallet_common::CollectionHandle { &mut self.0 } @@ -132,13 +201,17 @@ impl Deref for FungibleHandle { } } +/// Pallet implementation for fungible assets impl Pallet { + /// Initializes the collection. Returns [CollectionId] on success, [DispatchError] otherwise. pub fn init_collection( owner: T::CrossAccountId, data: CreateCollectionData, ) -> Result { >::init_collection(owner, data, false) } + + /// Destroys a collection. pub fn destroy_collection( collection: FungibleHandle, sender: &T::CrossAccountId, @@ -159,10 +232,14 @@ impl Pallet { Ok(()) } + ///Checks if collection has tokens. Return `true` if it has. fn collection_has_tokens(collection_id: CollectionId) -> bool { >::get(collection_id) != 0 } + /// Burns the specified amount of the token. If the token balance + /// or total supply is less than the given value, + /// it will return [DispatchError]. pub fn burn( collection: &FungibleHandle, owner: &T::CrossAccountId, @@ -207,6 +284,8 @@ impl Pallet { Ok(()) } + /// Transfers the specified amount of tokens. Will check that + /// the transfer is allowed for the token. pub fn transfer( collection: &FungibleHandle, from: &T::CrossAccountId, @@ -277,6 +356,7 @@ impl Pallet { Ok(()) } + /// Minting tokens for multiple IDs. pub fn create_multiple_items( collection: &FungibleHandle, sender: &T::CrossAccountId, @@ -378,6 +458,7 @@ impl Pallet { )); } + /// Sets the amount of owner tokens that the spender can manage. pub fn set_allowance( collection: &FungibleHandle, owner: &T::CrossAccountId, @@ -441,6 +522,7 @@ impl Pallet { Ok(allowance) } + /// Transfers of tokens that `from` gave to `spender` to manage, to `to` ID. pub fn transfer_from( collection: &FungibleHandle, spender: &T::CrossAccountId, @@ -460,6 +542,7 @@ impl Pallet { Ok(()) } + /// Burns managed tokens. pub fn burn_from( collection: &FungibleHandle, spender: &T::CrossAccountId, From b5d28e55f936bb1357e83d1e5f5ab13553bbf0f1 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 13 Jul 2022 17:37:22 +0200 Subject: [PATCH 0021/1274] fix: dynamic part offset should not include selector --- crates/evm-coder/src/abi.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/evm-coder/src/abi.rs b/crates/evm-coder/src/abi.rs index 2969c6b35b..b63c93b473 100644 --- a/crates/evm-coder/src/abi.rs +++ b/crates/evm-coder/src/abi.rs @@ -184,6 +184,7 @@ impl<'i> AbiReader<'i> { pub struct AbiWriter { static_part: Vec, dynamic_part: Vec<(usize, AbiWriter)>, + had_call: bool, } impl AbiWriter { pub fn new() -> Self { @@ -192,6 +193,7 @@ impl AbiWriter { pub fn new_call(method_id: u32) -> Self { let mut val = Self::new(); val.static_part.extend(&method_id.to_be_bytes()); + val.had_call = true; val } @@ -264,7 +266,7 @@ impl AbiWriter { pub fn finish(mut self) -> Vec { for (static_offset, part) in self.dynamic_part { - let part_offset = self.static_part.len(); + let part_offset = self.static_part.len() - self.had_call.then(|| 4).unwrap_or(0); let encoded_dynamic_offset = usize::to_be_bytes(part_offset); self.static_part[static_offset + ABI_ALIGNMENT - encoded_dynamic_offset.len() From f742d10602a1b1fff3fc425520e5d591e2888ce2 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 14 Jul 2022 07:20:56 +0000 Subject: [PATCH 0022/1274] doc: added comments about burning --- pallets/refungible/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 474da925c4..fd07b9d484 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -349,6 +349,7 @@ impl Pallet { /// Burn RFT token pieces /// /// `burn` will decrease total amount of token pieces and amount owned by sender. + /// `burn` can be called even if there are multiple owners of the RFT token. /// If sender wouldn't have any pieces left after `burn` than she will stop being /// one of the owners of the token. If there is no account that owns any pieces of /// the token than token will be burned too. @@ -831,8 +832,9 @@ impl Pallet { /// Repartition RFT token. /// - /// Repartition will set token balance of the sender and total amount of token pieces. - /// Sender should own all of the token pieces. + /// `repartition` will set token balance of the sender and total amount of token pieces. + /// Sender should own all of the token pieces. `repartition' could be done even if some + /// token pieces were burned before. /// /// - `amount`: Total amount of token pieces that the token will have after `repartition`. pub fn repartition( From 4b7d82846fd8e2bcd7736af3c3da00b26db40f25 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 14 Jul 2022 07:33:06 +0000 Subject: [PATCH 0023/1274] doc: added clarification for `nest_if_sent_to_token_unchecked` method --- pallets/structure/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pallets/structure/src/lib.rs b/pallets/structure/src/lib.rs index 13f3b8754b..f8db5604cf 100644 --- a/pallets/structure/src/lib.rs +++ b/pallets/structure/src/lib.rs @@ -331,6 +331,8 @@ impl Pallet { } /// Nests `token_id` under `owner` token + /// + /// Caller should check that nesting wouldn't cause recursion in nesting pub fn nest_if_sent_to_token_unchecked( owner: &T::CrossAccountId, collection_id: CollectionId, From 73992bf599ce82fd256df8afb6179d7fde32af39 Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Fri, 15 Jul 2022 06:20:14 +0000 Subject: [PATCH 0024/1274] doc: rmrk proxies --- pallets/proxy-rmrk-core/src/benchmarking.rs | 16 + pallets/proxy-rmrk-core/src/lib.rs | 591 +++++++++++++++---- pallets/proxy-rmrk-core/src/misc.rs | 14 +- pallets/proxy-rmrk-core/src/property.rs | 13 +- pallets/proxy-rmrk-core/src/rpc.rs | 30 +- pallets/proxy-rmrk-equip/src/benchmarking.rs | 16 + pallets/proxy-rmrk-equip/src/lib.rs | 174 +++++- pallets/proxy-rmrk-equip/src/rpc.rs | 22 + 8 files changed, 721 insertions(+), 155 deletions(-) diff --git a/pallets/proxy-rmrk-core/src/benchmarking.rs b/pallets/proxy-rmrk-core/src/benchmarking.rs index 2f86c67d9f..26b1ffa79d 100644 --- a/pallets/proxy-rmrk-core/src/benchmarking.rs +++ b/pallets/proxy-rmrk-core/src/benchmarking.rs @@ -1,3 +1,19 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + use sp_std::vec; use frame_benchmarking::{benchmarks, account}; diff --git a/pallets/proxy-rmrk-core/src/lib.rs b/pallets/proxy-rmrk-core/src/lib.rs index 99945492ed..22674d220c 100644 --- a/pallets/proxy-rmrk-core/src/lib.rs +++ b/pallets/proxy-rmrk-core/src/lib.rs @@ -14,6 +14,100 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! # RMRK Core Proxy Pallet +//! +//! A pallet used as proxy for RMRK Core (). +//! +//! - [`Config`] +//! - [`Call`] +//! - [`Pallet`] +//! +//! ## Overview +//! +//! The RMRK Core Proxy pallet mirrors the functionality of RMRK Core, +//! binding its externalities to Unique's own underlying structure. +//! It is purposed to mimic RMRK Core exactly, allowing seamless integrations +//! of solutions based on RMRK. +//! +//! RMRK Core itself contains essential functionality for RMRK's nested and +//! multi-resourced NFTs. +//! +//! *Note*, that while RMRK itself is subject to active development and restructuring, +//! the proxy may be caught temporarily out of date. +//! +//! ### What is RMRK? +//! +//! RMRK is a set of NFT standards which compose several "NFT 2.0 lego" primitives. +//! Putting these legos together allows a user to create NFT systems of arbitrary complexity. +//! +//! Meaning, RMRK NFTs are dynamic, able to nest into each other and form a hierarchy, +//! make use of specific changeable and partially shared metadata in the form of resources, +//! and more. +//! +//! Visit RMRK documentation and repositories to learn more: +//! - Docs: +//! - FAQ: +//! - Substrate code repository: +//! - RMRK spec repository: +//! +//! ## Proxy Implementation +//! +//! An external user is supposed to be able to utilize this proxy as they would +//! utilize RMRK, and get exactly the same results. Normally, Unique transactions +//! are off-limits to RMRK collections and tokens, and vice versa. However, +//! the information stored on chain can be freely interpreted by storage reads and RPCs. +//! +//! ### ID Mapping +//! +//! RMRK's collections' IDs are counted independently of Unique's and start at 0. +//! Note that tokens' IDs still start at 1. +//! The collections themselves, as well as tokens, are stored as Unique collections, +//! and thus RMRK IDs are mapped to Unique IDs (but not vice versa). +//! +//! ### External/Internal Collection Insulation +//! +//! A Unique transaction cannot target collections purposed for RMRK, +//! and they are flagged as `external` to specify that. On the other hand, +//! due to the mapping, RMRK transactions and RPCs simply cannot reach Unique collections. +//! +//! ### Native Properties +//! +//! Many of RMRK's native parameters are stored as scoped properties of a collection +//! or an NFT on the chain. Scoped properties are prefixed with `rmrk:`, where `:` +//! is an unacceptable symbol in user-defined proeprties, which, along with other safeguards, +//! makes them impossible to tamper with. +//! +//! ### Collection and NFT Types +//! +//! RMRK introduces the concept of a Base, which is a catalgoue of Parts, +//! possible components of an NFT. Due to its similarity with the functionality +//! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes +//! are the collection's NFTs. See [`CollectionType`](pallet_rmrk_core::misc::CollectionType) and +//! [`NftType`](pallet_rmrk_core::misc::NftType). +//! +//! ## Interface +//! +//! ### Dispatchables +//! +//! - `create_collection` - Create a new collection of NFTs. +//! - `destroy_collection` - Destroy a collection. +//! - `change_collection_issuer` - Change the issuer of a collection. +//! Analogous to Unique's collection's [`owner`](up_data_structs::Collection). +//! - `lock_collection` - "Lock" the collection and prevent new token creation. **Cannot be undone.** +//! - `mint_nft` - Mint an NFT in a specified collection. +//! - `burn_nft` - Burn an NFT, destroying it and its nested tokens. +//! - `send` - Transfer an NFT from an account/NFT A to another account/NFT B. +//! - `accept_nft` - Accept an NFT sent from another account to self or an owned NFT. +//! - `reject_nft` - Reject an NFT sent from another account to self or owned NFT and **burn it**. +//! - `accept_resource` - Accept the addition of a newly created pending resource to an existing NFT. +//! - `accept_resource_removal` - Accept the removal of a removal-pending resource from an NFT. +//! - `set_property` - Add or edit a custom user property of a token or a collection. +//! - `set_priority` - Set a different order of resource priorities for an NFT. +//! - `add_basic_resource` - Create and set/propose a basic resource for an NFT. +//! - `add_composable_resource` - Create and set/propose a composable resource for an NFT. +//! - `add_slot_resource` - Create and set/propose a slot resource for an NFT. +//! - `remove_resource` - Remove and erase a resource from an NFT. + #![cfg_attr(not(feature = "std"), no_std)] use frame_support::{pallet_prelude::*, transactional, BoundedVec, dispatch::DispatchResult}; @@ -49,6 +143,7 @@ pub use property::*; use RmrkProperty::*; +/// Maximum number of levels of depth in the token nesting tree. pub const NESTING_BUDGET: u32 = 5; type PendingTarget = (CollectionId, TokenId); @@ -66,14 +161,19 @@ pub mod pallet { pub trait Config: frame_system::Config + pallet_common::Config + pallet_nonfungible::Config + account::Config { + /// Overarching event type. type Event: From> + IsType<::Event>; + + /// The weight information of this pallet. type WeightInfo: WeightInfo; } + /// Latest yet-unused collection ID. #[pallet::storage] #[pallet::getter(fn collection_index)] pub type CollectionIndex = StorageValue<_, RmrkCollectionId, ValueQuery>; + /// Mapping from RMRK collection ID to Unique's. #[pallet::storage] pub type UniqueCollectionId = StorageMap<_, Twox64Concat, RmrkCollectionId, CollectionId, ValueQuery>; @@ -159,34 +259,66 @@ pub mod pallet { #[pallet::error] pub enum Error { - /* Unique-specific events */ + /* Unique proxy-specific events */ + /// Property of the type of RMRK collection could not be read successfully. CorruptedCollectionType, - NftTypeEncodeError, + // NftTypeEncodeError, + /// Too many symbols supplied as the property key. The maximum is [256](up_data_structs::MAX_PROPERTY_KEY_LENGTH). RmrkPropertyKeyIsTooLong, + /// Too many bytes supplied as the property value. The maximum is [32768](up_data_structs::MAX_PROPERTY_VALUE_LENGTH). RmrkPropertyValueIsTooLong, + /// Could not find a property by the supplied key. RmrkPropertyIsNotFound, + /// Something went wrong when decoding encoded data from the storage. + /// Perhaps, there was a wrong key supplied for the type, or the data was improperly stored. UnableToDecodeRmrkData, /* RMRK compatible events */ + /// Only destroying collections without tokens is allowed. CollectionNotEmpty, + /// Could not find an ID for a collection. It is likely there were too many collections created on the chain. NoAvailableCollectionId, + /// Token does not exist, or there is no suitable ID for it, likely too many tokens were created in a collection. NoAvailableNftId, + /// Collection does not exist, has a wrong type, or does not map to a Unique ID. CollectionUnknown, + /// No permission to perform action. NoPermission, + /// Token is marked as non-transferable, and thus cannot be transferred. NonTransferable, + /// Too many tokens created in the collection, no new ones are allowed. CollectionFullOrLocked, + /// No such resource found. ResourceDoesntExist, + /// If an NFT is sent to a descendant, that would form a nesting loop, an ouroboros. + /// Sending to self is redundant. CannotSendToDescendentOrSelf, + /// Not the target owner of the sent NFT. CannotAcceptNonOwnedNft, + /// Not the target owner of the sent NFT. CannotRejectNonOwnedNft, + /// NFT was not sent and is not pending. CannotRejectNonPendingNft, + /// Resource is not pending for the operation. ResourceNotPending, + /// Could not find an ID for the resource. Is is likely there were too many resources created on an NFT. NoAvailableResourceId, } #[pallet::call] impl Pallet { - /// Create a collection + // todo :refactor replace every collection_id with rmrk_collection_id (and nft_id) in arguments for uniformity? + + /// Create a new collection of NFTs. + /// + /// # Permissions: + /// * Anyone - will be assigned as the issuer of the collection. + /// + /// # Arguments: + /// - `metadata`: Metadata describing the collection, e.g. IPFS hash. Cannot be changed. + /// - `max`: Optional maximum number of tokens. + /// - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs. + /// Analogous to Unique's [`token_prefix`](up_data_structs::Collection). Cannot be changed. #[transactional] #[pallet::weight(>::create_collection())] pub fn create_collection( @@ -226,8 +358,8 @@ pub mod pallet { T::CrossAccountId::from_sub(sender.clone()), data, [ - Self::rmrk_property(Metadata, &metadata)?, - Self::rmrk_property(CollectionType, &misc::CollectionType::Regular)?, + Self::encode_rmrk_property(Metadata, &metadata)?, + Self::encode_rmrk_property(CollectionType, &misc::CollectionType::Regular)?, ] .into_iter(), )?; @@ -237,8 +369,8 @@ pub mod pallet { >::set_scoped_collection_property( unique_collection_id, - PropertyScope::Rmrk, - Self::rmrk_property(RmrkInternalCollectionId, &rmrk_collection_id)?, + RMRK_SCOPE, + Self::encode_rmrk_property(RmrkInternalCollectionId, &rmrk_collection_id)?, )?; >::mutate(|n| *n += 1); @@ -251,7 +383,15 @@ pub mod pallet { Ok(()) } - /// destroy collection + /// Destroy a collection. + /// + /// Only empty collections can be destroyed. If it has any tokens, they must be burned first. + /// + /// # Permissions: + /// * Collection issuer + /// + /// # Arguments: + /// - `collection_id`: RMRK ID of the collection to destroy. #[transactional] #[pallet::weight(>::destroy_collection())] pub fn destroy_collection( @@ -278,12 +418,14 @@ pub mod pallet { Ok(()) } - /// Change the issuer of a collection + /// Change the issuer of a collection. Analogous to Unique's collection's [`owner`](up_data_structs::Collection). + /// + /// # Permissions: + /// * Collection issuer /// - /// Parameters: - /// - `origin`: sender of the transaction - /// - `collection_id`: collection id of the nft to change issuer of - /// - `new_issuer`: Collection's new issuer + /// # Arguments: + /// - `collection_id`: RMRK collection ID to change the issuer of. + /// - `new_issuer`: Collection's new issuer. #[transactional] #[pallet::weight(>::change_collection_issuer())] pub fn change_collection_issuer( @@ -314,7 +456,13 @@ pub mod pallet { Ok(()) } - /// lock collection + /// "Lock" the collection and prevent new token creation. Cannot be undone. + /// + /// # Permissions: + /// * Collection issuer + /// + /// # Arguments: + /// - `collection_id`: RMRK ID of the collection to lock. #[transactional] #[pallet::weight(>::lock_collection())] pub fn lock_collection( @@ -346,16 +494,19 @@ pub mod pallet { Ok(()) } - /// Mints an NFT in the specified collection - /// Sets metadata and the royalty attribute + /// Mint an NFT in a specified collection. /// - /// Parameters: - /// - `collection_id`: The class of the asset to be minted. - /// - `nft_id`: The nft value of the asset to be minted. - /// - `recipient`: Receiver of the royalty - /// - `royalty`: Permillage reward from each trade for the Recipient - /// - `metadata`: Arbitrary data about an nft, e.g. IPFS hash - /// - `transferable`: Ability to transfer this NFT + /// # Permissions: + /// * Collection issuer + /// + /// # Arguments: + /// - `owner`: Owner account of the NFT. If set to None, defaults to the sender (collection issuer). + /// - `collection_id`: RMRK collection ID for the NFT to be minted within. Cannot be changed. + /// - `recipient`: Receiver account of the royalty. Has no effect if the `royalty_amount` is not set. Cannot be changed. + /// - `royalty_amount`: Optional permillage reward from each trade for the `recipient`. Cannot be changed. + /// - `metadata`: Arbitrary data about an NFT, e.g. IPFS hash. Cannot be changed. + /// - `transferable`: Can this NFT be transferred? Cannot be changed. + /// - `resources`: Resource data to be added to the NFT immediately after minting. #[transactional] #[pallet::weight(>::mint_nft(resources.as_ref().map(|r| r.len() as u32).unwrap_or(0)))] pub fn mint_nft( @@ -390,16 +541,16 @@ pub mod pallet { &cross_owner, &collection, [ - Self::rmrk_property(TokenType, &NftType::Regular)?, - Self::rmrk_property(Transferable, &transferable)?, - Self::rmrk_property(PendingNftAccept, &None::)?, - Self::rmrk_property(RoyaltyInfo, &royalty_info)?, - Self::rmrk_property(Metadata, &metadata)?, - Self::rmrk_property(Equipped, &false)?, - Self::rmrk_property(ResourcePriorities, &>::new())?, - Self::rmrk_property(NextResourceId, &(0 as RmrkResourceId))?, - Self::rmrk_property(PendingChildren, &PendingChildrenSet::new())?, - Self::rmrk_property(AssociatedBases, &BasesMap::new())?, + Self::encode_rmrk_property(TokenType, &NftType::Regular)?, + Self::encode_rmrk_property(Transferable, &transferable)?, + Self::encode_rmrk_property(PendingNftAccept, &None::)?, + Self::encode_rmrk_property(RoyaltyInfo, &royalty_info)?, + Self::encode_rmrk_property(Metadata, &metadata)?, + Self::encode_rmrk_property(Equipped, &false)?, + Self::encode_rmrk_property(ResourcePriorities, &>::new())?, + Self::encode_rmrk_property(NextResourceId, &(0 as RmrkResourceId))?, + Self::encode_rmrk_property(PendingChildren, &PendingChildrenSet::new())?, + Self::encode_rmrk_property(AssociatedBases, &BasesMap::new())?, ] .into_iter(), ) @@ -423,7 +574,21 @@ pub mod pallet { Ok(()) } - /// burn nft + /// Burn an NFT, destroying it and its nested tokens up to the specified limit. + /// If the burning budget is exceeded, the transaction is reverted. + /// + /// This is the way to burn a nested token as well. + /// + /// For more information, see [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively). + /// + /// # Permissions: + /// * Token owner + /// + /// # Arguments: + /// - `collection_id`: RMRK ID of the collection in which the NFT to burn belongs to. + /// - `nft_id`: ID of the NFT to be destroyed. + /// - `max_burns`: Maximum number of tokens to burn, used for nesting. The transaction + /// is reverted if there are more tokens to burn in the nesting tree than this number. #[transactional] #[pallet::weight(>::burn_nft(*max_burns))] pub fn burn_nft( @@ -458,13 +623,19 @@ pub mod pallet { Ok(()) } - /// Transfers a NFT from an Account or NFT A to another Account or NFT B + /// Transfer an NFT from an account/NFT A to another account/NFT B. + /// The token must be transferable. Nesting cannot occur deeper than the [`NESTING_BUDGET`]. + /// + /// If the target owner is an NFT owned by another account, then the NFT will enter + /// the pending state and will have to be accepted by the other account. /// - /// Parameters: - /// - `origin`: sender of the transaction - /// - `rmrk_collection_id`: collection id of the nft to be transferred - /// - `rmrk_nft_id`: nft id of the nft to be transferred - /// - `new_owner`: new owner of the nft which can be either an account or a NFT + /// # Permissions: + /// - Token owner + /// + /// # Arguments: + /// - `collection_id`: RMRK ID of the collection of the NFT to be transferred. + /// - `nft_id`: ID of the NFT to be transferred. + /// - `new_owner`: New owner of the nft which can be either an account or a NFT. #[transactional] #[pallet::weight(>::send())] pub fn send( @@ -535,8 +706,8 @@ pub mod pallet { >::set_scoped_token_property( collection.id, nft_id, - PropertyScope::Rmrk, - Self::rmrk_property::>( + RMRK_SCOPE, + Self::encode_rmrk_property::>( PendingNftAccept, &Some((target_collection_id, target_nft_id.into())), )?, @@ -578,14 +749,18 @@ pub mod pallet { Ok(()) } - /// Accepts an NFT sent from another account to self or owned NFT + /// Accept an NFT sent from another account to self or an owned NFT. + /// + /// The NFT in question must be pending, and, thus, be [sent](`crate::pallet::Call::send`) first. + /// + /// # Permissions: + /// - Token-owner-to-be /// - /// Parameters: - /// - `origin`: sender of the transaction - /// - `rmrk_collection_id`: collection id of the nft to be accepted - /// - `rmrk_nft_id`: nft id of the nft to be accepted - /// - `new_owner`: either origin's account ID or origin-owned NFT, whichever the NFT was - /// sent to + /// # Arguments: + /// - `rmrk_collection_id`: RMRK collection ID of the NFT to be accepted. + /// - `rmrk_nft_id`: ID of the NFT to be accepted. + /// - `new_owner`: Either the sender's account ID or a sender-owned NFT, + /// whichever the accepted NFT was sent to. #[transactional] #[pallet::weight(>::accept_nft())] pub fn accept_nft( @@ -650,8 +825,8 @@ pub mod pallet { >::set_scoped_token_property( collection.id, nft_id, - PropertyScope::Rmrk, - Self::rmrk_property(PendingNftAccept, &None::)?, + RMRK_SCOPE, + Self::encode_rmrk_property(PendingNftAccept, &None::)?, )?; } @@ -665,12 +840,17 @@ pub mod pallet { Ok(()) } - /// Rejects an NFT sent from another account to self or owned NFT - /// - /// Parameters: - /// - `origin`: sender of the transaction - /// - `rmrk_collection_id`: collection id of the nft to be accepted - /// - `rmrk_nft_id`: nft id of the nft to be accepted + /// Reject an NFT sent from another account to self or owned NFT. + /// The NFT in question will not be sent back and burnt instead. + /// + /// The NFT in question must be pending, and, thus, be [sent](`crate::pallet::Call::send`) first. + /// + /// # Permissions: + /// - Token-owner-to-be-not + /// + /// # Arguments: + /// - `rmrk_collection_id`: RMRK ID of the NFT to be rejected. + /// - `rmrk_nft_id`: ID of the NFT to be rejected. #[transactional] #[pallet::weight(>::reject_nft())] pub fn reject_nft( @@ -724,7 +904,19 @@ pub mod pallet { Ok(()) } - /// accept the addition of a new resource to an existing NFT + /// Accept the addition of a newly created pending resource to an existing NFT. + /// + /// This transaction is needed when a resource is created and assigned to an NFT + /// by a non-owner, i.e. the collection issuer, with one of the + /// [`add_...` transactions](crate::pallet::Call::add_basic_resource). + /// + /// # Permissions: + /// - Token owner + /// + /// # Arguments: + /// - `rmrk_collection_id`: RMRK collection ID of the NFT. + /// - `rmrk_nft_id`: ID of the NFT with a pending resource to be accepted. + /// - `resource_id`: ID of the newly created pending resource. #[transactional] #[pallet::weight(>::accept_resource())] pub fn accept_resource( @@ -767,7 +959,18 @@ pub mod pallet { Ok(()) } - /// accept the removal of a resource of an existing NFT + /// Accept the removal of a removal-pending resource from an NFT. + /// + /// This transaction is needed when a non-owner, i.e. the collection issuer, + /// requests a [removal](`crate::pallet::Call::remove_resource`) of a resource from an NFT. + /// + /// # Permissions: + /// - Token owner + /// + /// # Arguments: + /// - `rmrk_collection_id`: RMRK collection ID of the NFT. + /// - `rmrk_nft_id`: ID of the NFT with a resource to be removed. + /// - `resource_id`: ID of the removal-pending resource. #[transactional] #[pallet::weight(>::accept_resource_removal())] pub fn accept_resource_removal( @@ -795,17 +998,17 @@ pub mod pallet { ensure!(cross_sender == nft_owner, >::NoPermission); - let resource_id_key = Self::rmrk_property_key(ResourceId(resource_id))?; + let resource_id_key = Self::get_scoped_property_key(ResourceId(resource_id))?; let resource_info = >::token_aux_property(( collection_id, nft_id, - PropertyScope::Rmrk, + RMRK_SCOPE, resource_id_key.clone(), )) .ok_or(>::ResourceDoesntExist)?; - let resource_info: RmrkResourceInfo = Self::decode_property(&resource_info)?; + let resource_info: RmrkResourceInfo = Self::decode_property_value(&resource_info)?; ensure!( resource_info.pending_removal, @@ -815,7 +1018,7 @@ pub mod pallet { >::remove_token_aux_property( collection_id, nft_id, - PropertyScope::Rmrk, + RMRK_SCOPE, resource_id_key, ); @@ -833,7 +1036,22 @@ pub mod pallet { Ok(()) } - /// set a custom value on an NFT + /// Add or edit a custom user property, a key-value pair, describing the metadata + /// of a token or a collection, on either one of these. + /// + /// Note that in this proxy implementation many details regarding RMRK are stored + /// as scoped properties prefixed with "rmrk:", normally inaccessible + /// to external transactions and RPCs. + /// + /// # Permissions: + /// - Collection issuer - in case of collection property + /// - Token owner - in case of NFT property + /// + /// # Arguments: + /// - `rmrk_collection_id`: RMRK collection ID. + /// - `maybe_nft_id`: Optional ID of the NFT. If left empty, then the property is set for the collection. + /// - `key`: Key of the custom property to be referenced by. + /// - `value`: Value of the custom property to be stored. #[transactional] #[pallet::weight(>::set_property())] pub fn set_property( @@ -863,8 +1081,8 @@ pub mod pallet { >::set_scoped_token_property( collection_id, token_id, - PropertyScope::Rmrk, - Self::rmrk_property(UserProperty(key.as_slice()), &value)?, + RMRK_SCOPE, + Self::encode_rmrk_property(UserProperty(key.as_slice()), &value)?, )?; } None => { @@ -877,8 +1095,8 @@ pub mod pallet { >::set_scoped_collection_property( collection_id, - PropertyScope::Rmrk, - Self::rmrk_property(UserProperty(key.as_slice()), &value)?, + RMRK_SCOPE, + Self::encode_rmrk_property(UserProperty(key.as_slice()), &value)?, )?; } } @@ -893,7 +1111,20 @@ pub mod pallet { Ok(()) } - /// set a different order of resource priority + /// Set a different order of resource priorities for an NFT. Priorities can be used, + /// for example, for order of rendering. + /// + /// Note that the priorities are not updated automatically, and are an empty vector + /// by default. There is no pre-set definition for the order to be particular, + /// it can be interpreted arbitrarily use-case by use-case. + /// + /// # Permissions: + /// - Token owner + /// + /// # Arguments: + /// - `rmrk_collection_id`: RMRK collection ID of the NFT. + /// - `rmrk_nft_id`: ID of the NFT to rearrange resource priorities for. + /// - `priorities`: Ordered vector of resource IDs. #[transactional] #[pallet::weight(>::set_priority())] pub fn set_priority( @@ -920,8 +1151,8 @@ pub mod pallet { >::set_scoped_token_property( collection_id, nft_id, - PropertyScope::Rmrk, - Self::rmrk_property(ResourcePriorities, &priorities.into_inner())?, + RMRK_SCOPE, + Self::encode_rmrk_property(ResourcePriorities, &priorities.into_inner())?, )?; Self::deposit_event(Event::::PrioritySet { @@ -932,7 +1163,23 @@ pub mod pallet { Ok(()) } - /// Create basic resource + /// Create and set/propose a basic resource for an NFT. + /// + /// A resource is considered a part of an NFT, an additional piece of metadata + /// usually serving to add a piece of media on top of the root metadata, be it + /// a different wing on the root template bird or something entirely unrelated. + /// A basic resource is the simplest, lacking a base or composables. + /// + /// See RMRK docs for more information and examples. + /// + /// # Permissions: + /// - Collection issuer - if not the token owner, adding the resource will warrant + /// the owner's [acceptance](crate::pallet::Call::accept_resource). + /// + /// # Arguments: + /// - `rmrk_collection_id`: RMRK collection ID of the NFT. + /// - `nft_id`: ID of the NFT to assign a resource to. + /// - `resource`: Data of the resource to be created. #[transactional] #[pallet::weight(>::add_basic_resource())] pub fn add_basic_resource( @@ -962,7 +1209,23 @@ pub mod pallet { Ok(()) } - /// Create composable resource + /// Create and set/propose a composable resource for an NFT. + /// + /// A resource is considered a part of an NFT, an additional piece of metadata + /// usually serving to add a piece of media on top of the root metadata, be it + /// a different wing on the root template bird or something entirely unrelated. + /// A composable resource links to a base and has a subset of its parts it is composed of. + /// + /// See RMRK docs for more information and examples. + /// + /// # Permissions: + /// - Collection issuer - if not the token owner, adding the resource will warrant + /// the owner's [acceptance](crate::pallet::Call::accept_resource). + /// + /// # Arguments: + /// - `rmrk_collection_id`: RMRK collection ID of the NFT. + /// - `nft_id`: ID of the NFT to assign a resource to. + /// - `resource`: Data of the resource to be created. #[transactional] #[pallet::weight(>::add_composable_resource())] pub fn add_composable_resource( @@ -990,17 +1253,17 @@ pub mod pallet { >::try_mutate_token_aux_property( collection_id, nft_id.into(), - PropertyScope::Rmrk, - Self::rmrk_property_key(AssociatedBases)?, + RMRK_SCOPE, + Self::get_scoped_property_key(AssociatedBases)?, |value| -> DispatchResult { let mut bases: BasesMap = match value { - Some(value) => Self::decode_property(value)?, + Some(value) => Self::decode_property_value(value)?, None => BasesMap::new(), }; *bases.entry(base_id).or_insert(0) += 1; - *value = Some(Self::encode_property(&bases)?); + *value = Some(Self::encode_property_value(&bases)?); Ok(()) }, )?; @@ -1012,7 +1275,23 @@ pub mod pallet { Ok(()) } - /// Create slot resource + /// Create and set/propose a slot resource for an NFT. + /// + /// A resource is considered a part of an NFT, an additional piece of metadata + /// usually serving to add a piece of media on top of the root metadata, be it + /// a different wing on the root template bird or something entirely unrelated. + /// A slot resource links to a base and a slot in it which it now occupies. + /// + /// See RMRK docs for more information and examples. + /// + /// # Permissions: + /// - Collection issuer - if not the token owner, adding the resource will warrant + /// the owner's [acceptance](crate::pallet::Call::accept_resource). + /// + /// # Arguments: + /// - `rmrk_collection_id`: RMRK collection ID of the NFT. + /// - `nft_id`: ID of the NFT to assign a resource to. + /// - `resource`: Data of the resource to be created. #[transactional] #[pallet::weight(>::add_slot_resource())] pub fn add_slot_resource( @@ -1042,7 +1321,18 @@ pub mod pallet { Ok(()) } - /// remove resource + /// Remove and erase a resource from an NFT. + /// + /// If the sender does not own the NFT, then it will be pending confirmation, + /// and will have to be [accepted](crate::pallet::Call::accept_resource_removal) by the token owner. + /// + /// # Permissions + /// - Collection issuer + /// + /// # Arguments + /// - `collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to. + /// - `nft_id`: ID of the NFT with a resource to be removed. + /// - `resource_id`: ID of the resource to be removed. #[transactional] #[pallet::weight(>::remove_resource())] pub fn remove_resource( @@ -1070,31 +1360,34 @@ pub mod pallet { } impl Pallet { - pub fn rmrk_property_key(rmrk_key: RmrkProperty) -> Result { + /// Transform one of possible RMRK keys into a byte key with a RMRK scope. + pub fn get_scoped_property_key(rmrk_key: RmrkProperty) -> Result { let key = rmrk_key.to_key::()?; - let scoped_key = PropertyScope::Rmrk + let scoped_key = RMRK_SCOPE .apply(key) .map_err(|_| >::RmrkPropertyKeyIsTooLong)?; Ok(scoped_key) } - // todo think about renaming these - pub fn rmrk_property( + /// Form a Unique property, transforming a RMRK key into bytes (without assigning the scope yet) + /// and encoding the value from an arbitrary type into bytes. + pub fn encode_rmrk_property( rmrk_key: RmrkProperty, value: &E, ) -> Result { let key = rmrk_key.to_key::()?; - let value = Self::encode_property(value)?; + let value = Self::encode_property_value(value)?; let property = Property { key, value }; Ok(property) } - pub fn encode_property>( + /// Encode property value from an arbitrary type into bytes for storage. + pub fn encode_property_value>( value: &E, ) -> Result, DispatchError> { let value = value @@ -1105,13 +1398,15 @@ impl Pallet { Ok(value) } - pub fn decode_property>( + /// Decode property value from bytes into an arbitrary type. + pub fn decode_property_value>( vec: &BoundedBytes, ) -> Result { vec.decode() .map_err(|_| >::UnableToDecodeRmrkData.into()) } + /// Change the limit of a property value byte vector. pub fn rebind(vec: &BoundedVec) -> Result, DispatchError> where BoundedVec: TryFrom>, @@ -1120,6 +1415,9 @@ impl Pallet { .map_err(|_| >::RmrkPropertyValueIsTooLong.into()) } + /// Initialize a new NFT collection with certain RMRK-scoped properties. + /// + /// See [`init_collection`](pallet_nonfungible::pallet::Pallet::init_collection) for more details. fn init_collection( sender: T::CrossAccountId, data: CreateCollectionData, @@ -1133,13 +1431,16 @@ impl Pallet { >::set_scoped_collection_properties( collection_id?, - PropertyScope::Rmrk, + RMRK_SCOPE, properties, )?; collection_id } + /// Mint a new NFT with certain RMRK-scoped properties. Sender must be the collection owner. + /// + /// See [`create_item`](pallet_nonfungible::pallet::Pallet::create_item) for more details. pub fn create_nft( sender: &T::CrossAccountId, owner: &T::CrossAccountId, @@ -1160,13 +1461,16 @@ impl Pallet { >::set_scoped_token_properties( collection.id, nft_id, - PropertyScope::Rmrk, + RMRK_SCOPE, properties, )?; Ok(nft_id) } + /// Burn an NFT, along with its nested children, limited by `max_burns`. The sender must be the token owner. + /// + /// See [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively) for more details. fn destroy_nft( sender: T::CrossAccountId, collection_id: CollectionId, @@ -1207,48 +1511,54 @@ impl Pallet { ) } + /// Add a sent token pending acceptance to the target owning token as a property. fn insert_pending_child( target: (CollectionId, TokenId), child: (RmrkCollectionId, RmrkNftId), ) -> DispatchResult { - Self::mutate_pending_child(target, |pending_children| { + Self::mutate_pending_children(target, |pending_children| { pending_children.insert(child); }) } + /// Remove a sent token pending acceptance from the target token's properties. fn remove_pending_child( target: (CollectionId, TokenId), child: (RmrkCollectionId, RmrkNftId), ) -> DispatchResult { - Self::mutate_pending_child(target, |pending_children| { + Self::mutate_pending_children(target, |pending_children| { pending_children.remove(&child); }) } - fn mutate_pending_child( + /// Apply a mutation to the property of a token containing sent tokens + /// that are currently pending acceptance. + fn mutate_pending_children( (target_collection_id, target_nft_id): (CollectionId, TokenId), f: impl FnOnce(&mut PendingChildrenSet), ) -> DispatchResult { >::try_mutate_token_aux_property( target_collection_id, target_nft_id, - PropertyScope::Rmrk, - Self::rmrk_property_key(PendingChildren)?, + RMRK_SCOPE, + Self::get_scoped_property_key(PendingChildren)?, |pending_children| -> DispatchResult { let mut map = match pending_children { - Some(map) => Self::decode_property(map)?, + Some(map) => Self::decode_property_value(map)?, None => PendingChildrenSet::new(), }; f(&mut map); - *pending_children = Some(Self::encode_property(&map)?); + *pending_children = Some(Self::encode_property_value(&map)?); Ok(()) }, ) } + /// Get an iterator from a token's property containing tokens sent to it + /// that are currently pending acceptance. fn iterate_pending_children( collection_id: CollectionId, nft_id: TokenId, @@ -1256,18 +1566,20 @@ impl Pallet { let property = >::token_aux_property(( collection_id, nft_id, - PropertyScope::Rmrk, - Self::rmrk_property_key(PendingChildren)?, + RMRK_SCOPE, + Self::get_scoped_property_key(PendingChildren)?, )); let pending_children = match property { - Some(map) => Self::decode_property(&map)?, + Some(map) => Self::decode_property_value(&map)?, None => PendingChildrenSet::new(), }; Ok(pending_children.into_iter()) } + /// Get incremented resource ID from within an NFT's properties and store the new latest ID. + /// Thus, the returned resource ID should be used. fn acquire_next_resource_id( collection_id: CollectionId, nft_id: TokenId, @@ -1282,13 +1594,15 @@ impl Pallet { >::set_scoped_token_property( collection_id, nft_id, - PropertyScope::Rmrk, - Self::rmrk_property(NextResourceId, &next_id)?, + RMRK_SCOPE, + Self::encode_rmrk_property(NextResourceId, &next_id)?, )?; Ok(resource_id) } + /// Create and add a resource for a regular NFT, mark it as pending if the sender + /// is not the token owner. The sender must be the collection owner. fn resource_add( sender: T::AccountId, collection_id: CollectionId, @@ -1319,10 +1633,10 @@ impl Pallet { >::try_mutate_token_aux_property( collection_id, nft_id, - PropertyScope::Rmrk, - Self::rmrk_property_key(ResourceId(id))?, + RMRK_SCOPE, + Self::get_scoped_property_key(ResourceId(id))?, |value| -> DispatchResult { - *value = Some(Self::encode_property(&resource_info)?); + *value = Some(Self::encode_property_value(&resource_info)?); Ok(()) }, @@ -1331,6 +1645,8 @@ impl Pallet { Ok(id) } + /// Designate a resource for erasure from an NFT, and remove it if the sender is the token owner. + /// The sender must be the collection owner. fn resource_remove( sender: T::AccountId, collection_id: CollectionId, @@ -1341,18 +1657,17 @@ impl Pallet { Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?; ensure!(collection.owner == sender, Error::::NoPermission); - let resource_id_key = Self::rmrk_property_key(ResourceId(resource_id))?; - let scope = PropertyScope::Rmrk; + let resource_id_key = Self::get_scoped_property_key(ResourceId(resource_id))?; let resource = >::token_aux_property(( collection_id, nft_id, - scope, + RMRK_SCOPE, resource_id_key.clone(), )) .ok_or(>::ResourceDoesntExist)?; - let resource_info: RmrkResourceInfo = Self::decode_property(&resource)?; + let resource_info: RmrkResourceInfo = Self::decode_property_value(&resource)?; let budget = up_data_structs::budget::Value::new(NESTING_BUDGET); let topmost_owner = @@ -1363,8 +1678,8 @@ impl Pallet { >::remove_token_aux_property( collection_id, nft_id, - PropertyScope::Rmrk, - Self::rmrk_property_key(ResourceId(resource_id))?, + RMRK_SCOPE, + Self::get_scoped_property_key(ResourceId(resource_id))?, ); if let RmrkResourceTypes::Composable(resource) = resource_info.resource { @@ -1383,6 +1698,8 @@ impl Pallet { Ok(()) } + /// Remove one usage of a base from an NFT's property of associated bases. The base will stay, however, + /// if the count of resources using the base is still non-zero. fn remove_associated_base_id( collection_id: CollectionId, nft_id: TokenId, @@ -1391,11 +1708,11 @@ impl Pallet { >::try_mutate_token_aux_property( collection_id, nft_id, - PropertyScope::Rmrk, - Self::rmrk_property_key(AssociatedBases)?, + RMRK_SCOPE, + Self::get_scoped_property_key(AssociatedBases)?, |value| -> DispatchResult { let mut bases: BasesMap = match value { - Some(value) => Self::decode_property(value)?, + Some(value) => Self::decode_property_value(value)?, None => BasesMap::new(), }; @@ -1407,12 +1724,13 @@ impl Pallet { } } - *value = Some(Self::encode_property(&bases)?); + *value = Some(Self::encode_property_value(&bases)?); Ok(()) }, ) } + /// Apply a mutation to a resource stored in the token properties of an NFT. fn try_mutate_resource_info( collection_id: CollectionId, nft_id: TokenId, @@ -1422,15 +1740,15 @@ impl Pallet { >::try_mutate_token_aux_property( collection_id, nft_id, - PropertyScope::Rmrk, - Self::rmrk_property_key(ResourceId(resource_id))?, + RMRK_SCOPE, + Self::get_scoped_property_key(ResourceId(resource_id))?, |value| match value { Some(value) => { - let mut resource_info: RmrkResourceInfo = Self::decode_property(value)?; + let mut resource_info: RmrkResourceInfo = Self::decode_property_value(value)?; f(&mut resource_info)?; - *value = Self::encode_property(&resource_info)?; + *value = Self::encode_property_value(&resource_info)?; Ok(()) } @@ -1439,6 +1757,7 @@ impl Pallet { ) } + /// Change the owner of an NFT collection, ensuring that the sender is the current owner. fn change_collection_owner( collection_id: CollectionId, collection_type: misc::CollectionType, @@ -1454,6 +1773,7 @@ impl Pallet { collection.save() } + /// Ensure that an account is the collection owner/issuer, return an error if not. pub fn check_collection_owner( collection: &NonfungibleHandle, account: &T::CrossAccountId, @@ -1463,10 +1783,12 @@ impl Pallet { .map_err(Self::map_unique_err_to_proxy) } + /// Get the latest yet-unused RMRK collection index from the storage. pub fn last_collection_idx() -> RmrkCollectionId { >::get() } + /// Get a mapping from a RMRK collection ID to its corresponding Unique collection ID. pub fn unique_collection_id( rmrk_collection_id: RmrkCollectionId, ) -> Result { @@ -1474,12 +1796,14 @@ impl Pallet { .map_err(|_| >::CollectionUnknown.into()) } + /// Get a mapping from a Unique collection ID to its RMRK collection ID counterpart, if it exists. pub fn rmrk_collection_id( unique_collection_id: CollectionId, ) -> Result { Self::get_collection_property_decoded(unique_collection_id, RmrkInternalCollectionId) } + /// Fetch a Unique NFT collection. pub fn get_nft_collection( collection_id: CollectionId, ) -> Result, DispatchError> { @@ -1492,29 +1816,35 @@ impl Pallet { } } + /// Check if an NFT collection with such an ID exists. pub fn collection_exists(collection_id: CollectionId) -> bool { >::try_get(collection_id).is_ok() } + /// Fetch and decode a RMRK-scoped collection property value in bytes. pub fn get_collection_property( collection_id: CollectionId, key: RmrkProperty, ) -> Result { let collection_property = >::collection_properties(collection_id) - .get(&Self::rmrk_property_key(key)?) + .get(&Self::get_scoped_property_key(key)?) .ok_or(>::CollectionUnknown)? .clone(); Ok(collection_property) } + /// Fetch a RMRK-scoped collection property and decode it from bytes into an appropriate type. pub fn get_collection_property_decoded( collection_id: CollectionId, key: RmrkProperty, ) -> Result { - Self::decode_property(&Self::get_collection_property(collection_id, key)?) + Self::decode_property_value(&Self::get_collection_property(collection_id, key)?) } + /// Get the type of a collection stored in it as a scoped property. + /// + /// RMRK Core proxy differentiates between regular collections as well as RMRK bases as collections. pub fn get_collection_type( collection_id: CollectionId, ) -> Result { @@ -1527,6 +1857,8 @@ impl Pallet { }) } + /// Ensure that the type of the collection equals the provided type, + /// otherwise return an error. pub fn ensure_collection_type( collection_id: CollectionId, collection_type: misc::CollectionType, @@ -1540,6 +1872,7 @@ impl Pallet { Ok(()) } + /// Fetch an NFT collection, but make sure it has the appropriate type. pub fn get_typed_nft_collection( collection_id: CollectionId, collection_type: misc::CollectionType, @@ -1549,6 +1882,8 @@ impl Pallet { Self::get_nft_collection(collection_id) } + /// Same as [`get_typed_nft_collection`](crate::pallet::Pallet::get_typed_nft_collection), + /// but also return the Unique collection ID. pub fn get_typed_nft_collection_mapped( rmrk_collection_id: RmrkCollectionId, collection_type: misc::CollectionType, @@ -1563,31 +1898,37 @@ impl Pallet { Ok((collection, unique_collection_id)) } + /// Fetch and decode a RMRK-scoped NFT property value in bytes. pub fn get_nft_property( collection_id: CollectionId, nft_id: TokenId, key: RmrkProperty, ) -> Result { let nft_property = >::token_properties((collection_id, nft_id)) - .get(&Self::rmrk_property_key(key)?) + .get(&Self::get_scoped_property_key(key)?) .ok_or(>::RmrkPropertyIsNotFound)? .clone(); Ok(nft_property) } + /// Fetch a RMRK-scoped NFT property and decode it from bytes into an appropriate type. pub fn get_nft_property_decoded( collection_id: CollectionId, nft_id: TokenId, key: RmrkProperty, ) -> Result { - Self::decode_property(&Self::get_nft_property(collection_id, nft_id, key)?) + Self::decode_property_value(&Self::get_nft_property(collection_id, nft_id, key)?) } + /// Check that an NFT exists. pub fn nft_exists(collection_id: CollectionId, nft_id: TokenId) -> bool { >::contains_key((collection_id, nft_id)) } + /// Get the type of an NFT stored in it as a scoped property. + /// + /// RMRK Core proxy differentiates between regular NFTs, and RMRK parts and themes. pub fn get_nft_type( collection_id: CollectionId, token_id: TokenId, @@ -1596,6 +1937,7 @@ impl Pallet { .map_err(|_| >::NoAvailableNftId.into()) } + /// Ensure that the type of the NFT equals the provided type, otherwise return an error. pub fn ensure_nft_type( collection_id: CollectionId, token_id: TokenId, @@ -1607,6 +1949,8 @@ impl Pallet { Ok(()) } + /// Ensure that an account is the owner of the token, either directly + /// or at the top of the nesting hierarchy; return an error if it is not. pub fn ensure_nft_owner( collection_id: CollectionId, token_id: TokenId, @@ -1627,6 +1971,8 @@ impl Pallet { Ok(()) } + /// Fetch non-scoped properties of a collection or a token that match the filter keys supplied, + /// or, if None are provided, return all non-scoped properties. pub fn filter_user_properties( collection_id: CollectionId, token_id: Option, @@ -1672,6 +2018,8 @@ impl Pallet { }) } + /// Get all non-scoped properties from a collection or a token, and apply some transformation + /// to each key-value pair. pub fn iterate_user_properties( collection_id: CollectionId, token_id: Option, @@ -1699,6 +2047,7 @@ impl Pallet { Ok(properties) } + /// Match Unique errors to RMRK's own and return the RMRK error if a match is successful. fn map_unique_err_to_proxy(err: DispatchError) -> DispatchError { map_unique_err_to_proxy! { match err { diff --git a/pallets/proxy-rmrk-core/src/misc.rs b/pallets/proxy-rmrk-core/src/misc.rs index 0c911f96f3..b00a07241e 100644 --- a/pallets/proxy-rmrk-core/src/misc.rs +++ b/pallets/proxy-rmrk-core/src/misc.rs @@ -14,9 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! Miscellaneous helpers and utilities used by the proxy pallet. + use super::*; use codec::{Encode, Decode, Error}; +/// Match errors from one type to another and return an error +/// if a match is successful. #[macro_export] macro_rules! map_unique_err_to_proxy { (match $err:ident { $($unique_err_ty:ident :: $unique_err:ident => $proxy_err:ident),+ $(,)? }) => { @@ -30,8 +34,9 @@ macro_rules! map_unique_err_to_proxy { }; } -// Utilize the RmrkCore pallet for access to Runtime errors. +/// Interface to decode bytes from a bounded vector into an arbitrary type. pub trait RmrkDecode { + /// Try to decode bytes from a bounded vector into an arbitrary type. fn decode(&self) -> Result; } @@ -43,8 +48,9 @@ impl RmrkDecode for BoundedVec { } } -// Utilize the RmrkCore pallet for access to Runtime errors. +/// Interface to "rebind", change the limit of a bounded byte vector. pub trait RmrkRebind { + /// Try to change the limit of a bounded byte vector. fn rebind(&self) -> Result, Error>; } @@ -58,12 +64,16 @@ where } } +/// RMRK Base shares functionality with a regular collection, and is thus +/// stored as one, but they are used for different purposes and need to be differentiated. #[derive(Encode, Decode, PartialEq, Eq)] pub enum CollectionType { Regular, Base, } +/// RMRK Base, being stored as a collection, can have different kinds of tokens, +/// all except the `Regular` type, which is attributed to `Regular` collection. #[derive(Encode, Decode, PartialEq, Eq)] pub enum NftType { Regular, diff --git a/pallets/proxy-rmrk-core/src/property.rs b/pallets/proxy-rmrk-core/src/property.rs index 1d80b03d6a..d466f5321d 100644 --- a/pallets/proxy-rmrk-core/src/property.rs +++ b/pallets/proxy-rmrk-core/src/property.rs @@ -14,13 +14,21 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! Details of storing and handling RMRK properties. + use super::*; use up_data_structs::PropertyScope; use core::convert::AsRef; +/// Property prefix for storing resources. pub const RESOURCE_ID_PREFIX: &str = "rsid-"; +/// Property prefix for storing custom user-defined properties. pub const USER_PROPERTY_PREFIX: &str = "userprop-"; +/// Property scope for RMRK, used to signify that this property +/// was created and is used by RMRK. +pub const RMRK_SCOPE: PropertyScope = PropertyScope::Rmrk; +/// Predefined RMRK property keys for storage of RMRK data format on the Unique chain. pub enum RmrkProperty<'r> { Metadata, CollectionType, @@ -49,6 +57,7 @@ pub enum RmrkProperty<'r> { } impl<'r> RmrkProperty<'r> { + /// Convert a predefined RMRK property key enum into string bytes. pub fn to_key(self) -> Result> { fn get_bytes>(container: &T) -> &[u8] { container.as_ref() @@ -94,9 +103,10 @@ impl<'r> RmrkProperty<'r> { } } +/// Strip a property key of its prefix and RMRK scope. pub fn strip_key_prefix(key: &PropertyKey, prefix: &str) -> Option { let key_prefix = PropertyKey::try_from(prefix.as_bytes().to_vec()).ok()?; - let key_prefix = PropertyScope::Rmrk.apply(key_prefix).ok()?; + let key_prefix = RMRK_SCOPE.apply(key_prefix).ok()?; key.as_slice() .strip_prefix(key_prefix.as_slice())? @@ -105,6 +115,7 @@ pub fn strip_key_prefix(key: &PropertyKey, prefix: &str) -> Option .ok() } +/// Check that the key has the prefix. pub fn is_valid_key_prefix(key: &PropertyKey, prefix: &str) -> bool { strip_key_prefix(key, prefix).is_some() } diff --git a/pallets/proxy-rmrk-core/src/rpc.rs b/pallets/proxy-rmrk-core/src/rpc.rs index df38f71b1f..8223d2a2c1 100644 --- a/pallets/proxy-rmrk-core/src/rpc.rs +++ b/pallets/proxy-rmrk-core/src/rpc.rs @@ -1,9 +1,29 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +//! Realizations of RMRK RPCs (remote procedure calls) related to the Core pallet. + use super::*; +/// Get the latest created collection ID. pub fn last_collection_idx() -> Result { Ok(>::last_collection_idx()) } +/// Get collection info by ID. pub fn collection_by_id( collection_id: RmrkCollectionId, ) -> Result>, DispatchError> { @@ -29,6 +49,7 @@ pub fn collection_by_id( })) } +/// Get NFT info by collection and NFT IDs. pub fn nft_by_id( collection_id: RmrkCollectionId, nft_by_id: RmrkNftId, @@ -83,6 +104,8 @@ pub fn nft_by_id( })) } + +/// Get tokens owned by an account in a collection. pub fn account_tokens( account_id: T::AccountId, collection_id: RmrkCollectionId, @@ -116,6 +139,7 @@ pub fn account_tokens( Ok(tokens) } +/// Get tokens nested in an NFT - its direct children (not the children's children). pub fn nft_children( collection_id: RmrkCollectionId, nft_id: RmrkNftId, @@ -152,6 +176,7 @@ pub fn nft_children( ) } +/// Get collection properties, created by the user - not the proxy-specific properties. pub fn collection_properties( collection_id: RmrkCollectionId, filter_keys: Option>, @@ -174,6 +199,7 @@ pub fn collection_properties( Ok(properties) } +/// Get NFT properties, created by the user - not the proxy-specific properties. pub fn nft_properties( collection_id: RmrkCollectionId, nft_id: RmrkNftId, @@ -199,6 +225,7 @@ pub fn nft_properties( Ok(properties) } +/// Get data of resources of an NFT. pub fn nft_resources( collection_id: RmrkCollectionId, nft_id: RmrkNftId, @@ -226,7 +253,7 @@ pub fn nft_resources( return None; } - let resource_info: RmrkResourceInfo = >::decode_property(&value).ok()?; + let resource_info: RmrkResourceInfo = >::decode_property_value(&value).ok()?; Some(resource_info) }) @@ -235,6 +262,7 @@ pub fn nft_resources( Ok(resources) } +/// Get the priority of a resource in an NFT. pub fn nft_resource_priority( collection_id: RmrkCollectionId, nft_id: RmrkNftId, diff --git a/pallets/proxy-rmrk-equip/src/benchmarking.rs b/pallets/proxy-rmrk-equip/src/benchmarking.rs index a5e72e0a15..574418c47f 100644 --- a/pallets/proxy-rmrk-equip/src/benchmarking.rs +++ b/pallets/proxy-rmrk-equip/src/benchmarking.rs @@ -1,3 +1,19 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + use sp_std::vec; use frame_benchmarking::{benchmarks, account}; diff --git a/pallets/proxy-rmrk-equip/src/lib.rs b/pallets/proxy-rmrk-equip/src/lib.rs index 601811bb69..5a76de8bad 100644 --- a/pallets/proxy-rmrk-equip/src/lib.rs +++ b/pallets/proxy-rmrk-equip/src/lib.rs @@ -14,6 +14,88 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! # RMRK Core Proxy Pallet +//! +//! A pallet used as proxy for RMRK Core (). +//! +//! - [`Config`] +//! - [`Call`] +//! - [`Pallet`] +//! +//! ## Overview +//! +//! The RMRK Equip Proxy pallet mirrors the functionality of RMRK Equip, +//! binding its externalities to Unique's own underlying structure. +//! It is purposed to mimic RMRK Equip exactly, allowing seamless integrations +//! of solutions based on RMRK. +//! +//! RMRK Equip itself contains functionality to equip NFTs, and work with Bases, +//! Parts, and Themes. +//! +//! Equip Proxy is responsible for a more specific area of RMRK, and heavily relies on the Core. +//! For a more foundational description of proxy implementation, please refer to [`pallet_rmrk_core`]. +//! +//! *Note*, that while RMRK itself is subject to active development and restructuring, +//! the proxy may be caught temporarily out of date. +//! +//! ### What is RMRK? +//! +//! RMRK is a set of NFT standards which compose several "NFT 2.0 lego" primitives. +//! Putting these legos together allows a user to create NFT systems of arbitrary complexity. +//! +//! Meaning, RMRK NFTs are dynamic, able to nest into each other and form a hierarchy, +//! make use of specific changeable and partially shared metadata in the form of resources, +//! and more. +//! +//! Visit RMRK documentation and repositories to learn more: +//! - Docs: +//! - FAQ: +//! - Substrate code repository: +//! - RMRK spec repository: +//! +//! ## Proxy Implementation +//! +//! An external user is supposed to be able to utilize this proxy as they would +//! utilize RMRK, and get exactly the same results. Normally, Unique transactions +//! are off-limits to RMRK collections and tokens, and vice versa. However, +//! the information stored on chain can be freely interpreted by storage reads and RPCs. +//! +//! ### ID Mapping +//! +//! RMRK's collections' IDs are counted independently of Unique's and start at 0. +//! Note that tokens' IDs still start at 1. +//! The collections themselves, as well as tokens, are stored as Unique collections, +//! and thus RMRK IDs are mapped to Unique IDs (but not vice versa). +//! +//! ### External/Internal Collection Insulation +//! +//! A Unique transaction cannot target collections purposed for RMRK, +//! and they are flagged as `external` to specify that. On the other hand, +//! due to the mapping, RMRK transactions and RPCs simply cannot reach Unique collections. +//! +//! ### Native Properties +//! +//! Many of RMRK's native parameters are stored as scoped properties of a collection +//! or an NFT on the chain. Scoped properties are prefixed with `rmrk:`, where `:` +//! is an unacceptable symbol in user-defined proeprties, which, along with other safeguards, +//! makes them impossible to tamper with. +//! +//! ### Collection and NFT Types +//! +//! RMRK introduces the concept of a Base, which is a catalgoue of Parts, +//! possible components of an NFT. Due to its similarity with the functionality +//! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes +//! are the collection's NFTs. See [`CollectionType`](pallet_rmrk_core::misc::CollectionType) and +//! [`NftType`](pallet_rmrk_core::misc::NftType). +//! +//! ## Interface +//! +//! ### Dispatchables +//! +//! - `create_base` - Create a new Base. +//! - `theme_add` - Add a Theme to a Base. +//! - `equippable` - Update the array of Collections allowed to be equipped to a Base's specified Slot Part. + #![cfg_attr(not(feature = "std"), no_std)] use frame_support::{pallet_prelude::*, transactional, BoundedVec, dispatch::DispatchResult}; @@ -45,15 +127,20 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config + pallet_rmrk_core::Config { + /// Overarching event type. type Event: From> + IsType<::Event>; + + /// The weight information of this pallet. type WeightInfo: WeightInfo; } + /// Map of a base ID and a part ID to an NFT in the base collection serving as the part. #[pallet::storage] #[pallet::getter(fn internal_part_id)] pub type InernalPartId = StorageDoubleMap<_, Twox64Concat, CollectionId, Twox64Concat, RmrkPartId, TokenId>; + /// Checkmark that a base has a Theme NFT named "default". #[pallet::storage] #[pallet::getter(fn base_has_default_theme)] pub type BaseHasDefaultTheme = @@ -78,26 +165,36 @@ pub mod pallet { #[pallet::error] pub enum Error { + /// No permission to perform action. PermissionError, + /// Could not find an ID for a base collection. It is likely there were too many collections created on the chain. NoAvailableBaseId, + /// Could not find a suitable ID for a part, likely too many part tokens were created in the base. NoAvailablePartId, + /// Base collection linked to this ID does not exist. BaseDoesntExist, + /// No theme named "default" is associated with the Base. NeedsDefaultThemeFirst, + /// Part linked to this ID does not exist. PartDoesntExist, + /// Cannot assign equippables to a fixed part. NoEquippableOnFixedPart, } #[pallet::call] impl Pallet { - /// Creates a new Base. - /// Modeled after [base interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/base.md) + /// Create a new Base. + /// + /// Modeled after the [base interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/base.md) + /// + /// # Permissions + /// - Anyone - will be assigned as the issuer of the base. /// - /// Parameters: - /// - origin: Caller, will be assigned as the issuer of the Base - /// - base_type: media type, e.g. "svg" - /// - symbol: arbitrary client-chosen symbol - /// - parts: array of Fixed and Slot parts composing the base, confined in length by - /// RmrkPartsLimit + /// # Arguments: + /// - `base_type`: Arbitrary media type, e.g. "svg". + /// - `symbol`: Arbitrary client-chosen symbol. + /// - `parts`: Array of Fixed and Slot parts composing the base, + /// confined in length by [`RmrkPartsLimit`](up_data_structs::RmrkPartsLimit). #[transactional] #[pallet::weight(>::create_base(parts.len() as u32))] pub fn create_base( @@ -131,8 +228,8 @@ pub mod pallet { collection_id, PropertyScope::Rmrk, [ - >::rmrk_property(CollectionType, &misc::CollectionType::Base)?, - >::rmrk_property(BaseType, &base_type)?, + >::encode_rmrk_property(CollectionType, &misc::CollectionType::Base)?, + >::encode_rmrk_property(BaseType, &base_type)?, ] .into_iter(), )?; @@ -151,19 +248,21 @@ pub mod pallet { Ok(()) } - /// Adds a Theme to a Base. - /// Modeled after [themeadd interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/themeadd.md) - /// Themes are stored in the Themes storage + /// Add a Theme to a Base. /// A Theme named "default" is required prior to adding other Themes. + /// + /// Modeled after [themeadd interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/themeadd.md). /// - /// Parameters: - /// - origin: The caller of the function, must be issuer of the base - /// - base_id: The Base containing the Theme to be updated - /// - theme: The Theme to add to the Base. A Theme has a name and properties, which are an + /// # Permissions: + /// - Base issuer + /// + /// # Arguments: + /// - `base_id`: Base ID containing the Theme to be updated. + /// - `theme`: Theme to add to the Base. A Theme has a name and properties, which are an /// array of [key, value, inherit]. - /// - key: arbitrary BoundedString, defined by client - /// - value: arbitrary BoundedString, defined by client - /// - inherit: optional bool + /// - `key`: Arbitrary BoundedString, defined by client. + /// - `value`: Arbitrary BoundedString, defined by client. + /// - `inherit`: Optional bool. #[transactional] #[pallet::weight(>::theme_add(theme.properties.len() as u32))] pub fn theme_add( @@ -191,9 +290,9 @@ pub mod pallet { owner, &collection, [ - >::rmrk_property(TokenType, &NftType::Theme)?, - >::rmrk_property(ThemeName, &theme.name)?, - >::rmrk_property(ThemeInherit, &theme.inherit)?, + >::encode_rmrk_property(TokenType, &NftType::Theme)?, + >::encode_rmrk_property(ThemeName, &theme.name)?, + >::encode_rmrk_property(ThemeInherit, &theme.inherit)?, ] .into_iter(), ) @@ -204,7 +303,7 @@ pub mod pallet { collection_id, token_id, PropertyScope::Rmrk, - >::rmrk_property( + >::encode_rmrk_property( UserProperty(property.key.as_slice()), &property.value, )?, @@ -214,6 +313,17 @@ pub mod pallet { Ok(()) } + /// Update the array of Collections allowed to be equipped to a Base's specified Slot Part. + /// + /// Modeled after [equippable interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/equippable.md). + /// + /// # Permissions: + /// - Base issuer + /// + /// # Arguments: + /// - `base_id`: Base containing the Slot Part to be updated. + /// - `part_id`: Slot Part whose Equippable List is being updated. + /// - `equippables`: List of equippables that will override the current Equippables list. #[transactional] #[pallet::weight(>::equippable())] pub fn equippable( @@ -253,7 +363,7 @@ pub mod pallet { base_collection_id, part_id, PropertyScope::Rmrk, - >::rmrk_property(EquippableList, &equippables)?, + >::encode_rmrk_property(EquippableList, &equippables)?, )?; } } @@ -266,6 +376,8 @@ pub mod pallet { } impl Pallet { + /// Create or renew an NFT serving as a part, setting its properties + /// to those of the part. fn create_part( sender: &T::CrossAccountId, collection: &NonfungibleHandle, @@ -298,7 +410,7 @@ impl Pallet { collection.id, token_id, PropertyScope::Rmrk, - >::rmrk_property(ExternalPartId, &part_id)?, + >::encode_rmrk_property(ExternalPartId, &part_id)?, )?; token_id @@ -310,9 +422,9 @@ impl Pallet { token_id, PropertyScope::Rmrk, [ - >::rmrk_property(TokenType, &nft_type)?, - >::rmrk_property(Src, &src)?, - >::rmrk_property(ZIndex, &z_index)?, + >::encode_rmrk_property(TokenType, &nft_type)?, + >::encode_rmrk_property(Src, &src)?, + >::encode_rmrk_property(ZIndex, &z_index)?, ] .into_iter(), )?; @@ -322,13 +434,15 @@ impl Pallet { collection.id, token_id, PropertyScope::Rmrk, - >::rmrk_property(EquippableList, &part.equippable)?, + >::encode_rmrk_property(EquippableList, &part.equippable)?, )?; } Ok(()) } + /// Ensure that the collection under the base ID is a base collection, + /// and fetch it. fn get_base(base_id: CollectionId) -> Result, DispatchError> { let collection = >::get_typed_nft_collection(base_id, misc::CollectionType::Base) diff --git a/pallets/proxy-rmrk-equip/src/rpc.rs b/pallets/proxy-rmrk-equip/src/rpc.rs index 7ca9350298..21baf261d0 100644 --- a/pallets/proxy-rmrk-equip/src/rpc.rs +++ b/pallets/proxy-rmrk-equip/src/rpc.rs @@ -1,7 +1,26 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +//! Realizations of RMRK RPCs (remote procedure calls) related to the Equip pallet. + use super::*; use pallet_rmrk_core::{misc, property::*}; use sp_std::vec::Vec; +/// Get base info by its ID. pub fn base( base_id: RmrkBaseId, ) -> Result>, DispatchError> { @@ -22,6 +41,7 @@ pub fn base( })) } +/// Get all parts of a base. pub fn base_parts(base_id: RmrkBaseId) -> Result, DispatchError> { use pallet_common::CommonCollectionOperations; @@ -93,6 +113,7 @@ pub fn base_parts(base_id: RmrkBaseId) -> Result, D Ok(parts) } +/// Get the theme names belonging to a base. pub fn theme_names(base_id: RmrkBaseId) -> Result, DispatchError> { use pallet_common::CommonCollectionOperations; @@ -124,6 +145,7 @@ pub fn theme_names(base_id: RmrkBaseId) -> Result, Ok(theme_names) } +/// Get theme info, including properties, optionally limited to the provided keys. pub fn theme( base_id: RmrkBaseId, theme_name: RmrkThemeName, From 287a01051415c933fa277ec23b5328f65f7fffeb Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Fri, 15 Jul 2022 06:24:54 +0000 Subject: [PATCH 0025/1274] style: cargo fmt --- pallets/proxy-rmrk-core/src/lib.rs | 199 ++++++++++++------------ pallets/proxy-rmrk-core/src/misc.rs | 2 +- pallets/proxy-rmrk-core/src/property.rs | 2 +- pallets/proxy-rmrk-core/src/rpc.rs | 1 - pallets/proxy-rmrk-equip/src/lib.rs | 83 +++++----- 5 files changed, 142 insertions(+), 145 deletions(-) diff --git a/pallets/proxy-rmrk-core/src/lib.rs b/pallets/proxy-rmrk-core/src/lib.rs index 22674d220c..3b1f2147e5 100644 --- a/pallets/proxy-rmrk-core/src/lib.rs +++ b/pallets/proxy-rmrk-core/src/lib.rs @@ -15,83 +15,83 @@ // along with Unique Network. If not, see . //! # RMRK Core Proxy Pallet -//! +//! //! A pallet used as proxy for RMRK Core (). -//! +//! //! - [`Config`] //! - [`Call`] //! - [`Pallet`] -//! +//! //! ## Overview -//! -//! The RMRK Core Proxy pallet mirrors the functionality of RMRK Core, +//! +//! The RMRK Core Proxy pallet mirrors the functionality of RMRK Core, //! binding its externalities to Unique's own underlying structure. //! It is purposed to mimic RMRK Core exactly, allowing seamless integrations //! of solutions based on RMRK. -//! +//! //! RMRK Core itself contains essential functionality for RMRK's nested and //! multi-resourced NFTs. -//! +//! //! *Note*, that while RMRK itself is subject to active development and restructuring, //! the proxy may be caught temporarily out of date. -//! +//! //! ### What is RMRK? -//! -//! RMRK is a set of NFT standards which compose several "NFT 2.0 lego" primitives. +//! +//! RMRK is a set of NFT standards which compose several "NFT 2.0 lego" primitives. //! Putting these legos together allows a user to create NFT systems of arbitrary complexity. -//! +//! //! Meaning, RMRK NFTs are dynamic, able to nest into each other and form a hierarchy, -//! make use of specific changeable and partially shared metadata in the form of resources, +//! make use of specific changeable and partially shared metadata in the form of resources, //! and more. -//! +//! //! Visit RMRK documentation and repositories to learn more: //! - Docs: //! - FAQ: //! - Substrate code repository: //! - RMRK spec repository: -//! +//! //! ## Proxy Implementation -//! +//! //! An external user is supposed to be able to utilize this proxy as they would //! utilize RMRK, and get exactly the same results. Normally, Unique transactions //! are off-limits to RMRK collections and tokens, and vice versa. However, //! the information stored on chain can be freely interpreted by storage reads and RPCs. -//! +//! //! ### ID Mapping -//! +//! //! RMRK's collections' IDs are counted independently of Unique's and start at 0. //! Note that tokens' IDs still start at 1. //! The collections themselves, as well as tokens, are stored as Unique collections, //! and thus RMRK IDs are mapped to Unique IDs (but not vice versa). -//! +//! //! ### External/Internal Collection Insulation -//! +//! //! A Unique transaction cannot target collections purposed for RMRK, -//! and they are flagged as `external` to specify that. On the other hand, +//! and they are flagged as `external` to specify that. On the other hand, //! due to the mapping, RMRK transactions and RPCs simply cannot reach Unique collections. -//! +//! //! ### Native Properties -//! -//! Many of RMRK's native parameters are stored as scoped properties of a collection +//! +//! Many of RMRK's native parameters are stored as scoped properties of a collection //! or an NFT on the chain. Scoped properties are prefixed with `rmrk:`, where `:` //! is an unacceptable symbol in user-defined proeprties, which, along with other safeguards, //! makes them impossible to tamper with. -//! +//! //! ### Collection and NFT Types -//! -//! RMRK introduces the concept of a Base, which is a catalgoue of Parts, +//! +//! RMRK introduces the concept of a Base, which is a catalgoue of Parts, //! possible components of an NFT. Due to its similarity with the functionality //! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes -//! are the collection's NFTs. See [`CollectionType`](pallet_rmrk_core::misc::CollectionType) and +//! are the collection's NFTs. See [`CollectionType`](pallet_rmrk_core::misc::CollectionType) and //! [`NftType`](pallet_rmrk_core::misc::NftType). -//! +//! //! ## Interface -//! +//! //! ### Dispatchables -//! +//! //! - `create_collection` - Create a new collection of NFTs. //! - `destroy_collection` - Destroy a collection. -//! - `change_collection_issuer` - Change the issuer of a collection. +//! - `change_collection_issuer` - Change the issuer of a collection. //! Analogous to Unique's collection's [`owner`](up_data_structs::Collection). //! - `lock_collection` - "Lock" the collection and prevent new token creation. **Cannot be undone.** //! - `mint_nft` - Mint an NFT in a specified collection. @@ -163,7 +163,7 @@ pub mod pallet { { /// Overarching event type. type Event: From> + IsType<::Event>; - + /// The weight information of this pallet. type WeightInfo: WeightInfo; } @@ -269,7 +269,7 @@ pub mod pallet { RmrkPropertyValueIsTooLong, /// Could not find a property by the supplied key. RmrkPropertyIsNotFound, - /// Something went wrong when decoding encoded data from the storage. + /// Something went wrong when decoding encoded data from the storage. /// Perhaps, there was a wrong key supplied for the type, or the data was improperly stored. UnableToDecodeRmrkData, @@ -290,7 +290,7 @@ pub mod pallet { CollectionFullOrLocked, /// No such resource found. ResourceDoesntExist, - /// If an NFT is sent to a descendant, that would form a nesting loop, an ouroboros. + /// If an NFT is sent to a descendant, that would form a nesting loop, an ouroboros. /// Sending to self is redundant. CannotSendToDescendentOrSelf, /// Not the target owner of the sent NFT. @@ -317,7 +317,7 @@ pub mod pallet { /// # Arguments: /// - `metadata`: Metadata describing the collection, e.g. IPFS hash. Cannot be changed. /// - `max`: Optional maximum number of tokens. - /// - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs. + /// - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs. /// Analogous to Unique's [`token_prefix`](up_data_structs::Collection). Cannot be changed. #[transactional] #[pallet::weight(>::create_collection())] @@ -383,8 +383,8 @@ pub mod pallet { Ok(()) } - /// Destroy a collection. - /// + /// Destroy a collection. + /// /// Only empty collections can be destroyed. If it has any tokens, they must be burned first. /// /// # Permissions: @@ -419,7 +419,7 @@ pub mod pallet { } /// Change the issuer of a collection. Analogous to Unique's collection's [`owner`](up_data_structs::Collection). - /// + /// /// # Permissions: /// * Collection issuer /// @@ -457,7 +457,7 @@ pub mod pallet { } /// "Lock" the collection and prevent new token creation. Cannot be undone. - /// + /// /// # Permissions: /// * Collection issuer /// @@ -498,7 +498,7 @@ pub mod pallet { /// /// # Permissions: /// * Collection issuer - /// + /// /// # Arguments: /// - `owner`: Owner account of the NFT. If set to None, defaults to the sender (collection issuer). /// - `collection_id`: RMRK collection ID for the NFT to be minted within. Cannot be changed. @@ -574,20 +574,20 @@ pub mod pallet { Ok(()) } - /// Burn an NFT, destroying it and its nested tokens up to the specified limit. + /// Burn an NFT, destroying it and its nested tokens up to the specified limit. /// If the burning budget is exceeded, the transaction is reverted. - /// + /// /// This is the way to burn a nested token as well. - /// + /// /// For more information, see [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively). - /// + /// /// # Permissions: /// * Token owner - /// + /// /// # Arguments: /// - `collection_id`: RMRK ID of the collection in which the NFT to burn belongs to. /// - `nft_id`: ID of the NFT to be destroyed. - /// - `max_burns`: Maximum number of tokens to burn, used for nesting. The transaction + /// - `max_burns`: Maximum number of tokens to burn, used for nesting. The transaction /// is reverted if there are more tokens to burn in the nesting tree than this number. #[transactional] #[pallet::weight(>::burn_nft(*max_burns))] @@ -625,13 +625,13 @@ pub mod pallet { /// Transfer an NFT from an account/NFT A to another account/NFT B. /// The token must be transferable. Nesting cannot occur deeper than the [`NESTING_BUDGET`]. - /// + /// /// If the target owner is an NFT owned by another account, then the NFT will enter /// the pending state and will have to be accepted by the other account. /// /// # Permissions: /// - Token owner - /// + /// /// # Arguments: /// - `collection_id`: RMRK ID of the collection of the NFT to be transferred. /// - `nft_id`: ID of the NFT to be transferred. @@ -750,16 +750,16 @@ pub mod pallet { } /// Accept an NFT sent from another account to self or an owned NFT. - /// + /// /// The NFT in question must be pending, and, thus, be [sent](`crate::pallet::Call::send`) first. - /// + /// /// # Permissions: /// - Token-owner-to-be /// /// # Arguments: /// - `rmrk_collection_id`: RMRK collection ID of the NFT to be accepted. /// - `rmrk_nft_id`: ID of the NFT to be accepted. - /// - `new_owner`: Either the sender's account ID or a sender-owned NFT, + /// - `new_owner`: Either the sender's account ID or a sender-owned NFT, /// whichever the accepted NFT was sent to. #[transactional] #[pallet::weight(>::accept_nft())] @@ -842,12 +842,12 @@ pub mod pallet { /// Reject an NFT sent from another account to self or owned NFT. /// The NFT in question will not be sent back and burnt instead. - /// + /// /// The NFT in question must be pending, and, thus, be [sent](`crate::pallet::Call::send`) first. - /// + /// /// # Permissions: /// - Token-owner-to-be-not - /// + /// /// # Arguments: /// - `rmrk_collection_id`: RMRK ID of the NFT to be rejected. /// - `rmrk_nft_id`: ID of the NFT to be rejected. @@ -905,11 +905,11 @@ pub mod pallet { } /// Accept the addition of a newly created pending resource to an existing NFT. - /// + /// /// This transaction is needed when a resource is created and assigned to an NFT - /// by a non-owner, i.e. the collection issuer, with one of the + /// by a non-owner, i.e. the collection issuer, with one of the /// [`add_...` transactions](crate::pallet::Call::add_basic_resource). - /// + /// /// # Permissions: /// - Token owner /// @@ -960,10 +960,10 @@ pub mod pallet { } /// Accept the removal of a removal-pending resource from an NFT. - /// - /// This transaction is needed when a non-owner, i.e. the collection issuer, + /// + /// This transaction is needed when a non-owner, i.e. the collection issuer, /// requests a [removal](`crate::pallet::Call::remove_resource`) of a resource from an NFT. - /// + /// /// # Permissions: /// - Token owner /// @@ -1036,13 +1036,13 @@ pub mod pallet { Ok(()) } - /// Add or edit a custom user property, a key-value pair, describing the metadata + /// Add or edit a custom user property, a key-value pair, describing the metadata /// of a token or a collection, on either one of these. - /// - /// Note that in this proxy implementation many details regarding RMRK are stored - /// as scoped properties prefixed with "rmrk:", normally inaccessible + /// + /// Note that in this proxy implementation many details regarding RMRK are stored + /// as scoped properties prefixed with "rmrk:", normally inaccessible /// to external transactions and RPCs. - /// + /// /// # Permissions: /// - Collection issuer - in case of collection property /// - Token owner - in case of NFT property @@ -1113,11 +1113,11 @@ pub mod pallet { /// Set a different order of resource priorities for an NFT. Priorities can be used, /// for example, for order of rendering. - /// + /// /// Note that the priorities are not updated automatically, and are an empty vector /// by default. There is no pre-set definition for the order to be particular, /// it can be interpreted arbitrarily use-case by use-case. - /// + /// /// # Permissions: /// - Token owner /// @@ -1164,16 +1164,16 @@ pub mod pallet { } /// Create and set/propose a basic resource for an NFT. - /// + /// /// A resource is considered a part of an NFT, an additional piece of metadata /// usually serving to add a piece of media on top of the root metadata, be it /// a different wing on the root template bird or something entirely unrelated. /// A basic resource is the simplest, lacking a base or composables. - /// + /// /// See RMRK docs for more information and examples. - /// + /// /// # Permissions: - /// - Collection issuer - if not the token owner, adding the resource will warrant + /// - Collection issuer - if not the token owner, adding the resource will warrant /// the owner's [acceptance](crate::pallet::Call::accept_resource). /// /// # Arguments: @@ -1210,16 +1210,16 @@ pub mod pallet { } /// Create and set/propose a composable resource for an NFT. - /// + /// /// A resource is considered a part of an NFT, an additional piece of metadata /// usually serving to add a piece of media on top of the root metadata, be it /// a different wing on the root template bird or something entirely unrelated. /// A composable resource links to a base and has a subset of its parts it is composed of. - /// + /// /// See RMRK docs for more information and examples. - /// + /// /// # Permissions: - /// - Collection issuer - if not the token owner, adding the resource will warrant + /// - Collection issuer - if not the token owner, adding the resource will warrant /// the owner's [acceptance](crate::pallet::Call::accept_resource). /// /// # Arguments: @@ -1276,16 +1276,16 @@ pub mod pallet { } /// Create and set/propose a slot resource for an NFT. - /// + /// /// A resource is considered a part of an NFT, an additional piece of metadata /// usually serving to add a piece of media on top of the root metadata, be it /// a different wing on the root template bird or something entirely unrelated. /// A slot resource links to a base and a slot in it which it now occupies. - /// + /// /// See RMRK docs for more information and examples. - /// + /// /// # Permissions: - /// - Collection issuer - if not the token owner, adding the resource will warrant + /// - Collection issuer - if not the token owner, adding the resource will warrant /// the owner's [acceptance](crate::pallet::Call::accept_resource). /// /// # Arguments: @@ -1322,13 +1322,13 @@ pub mod pallet { } /// Remove and erase a resource from an NFT. - /// + /// /// If the sender does not own the NFT, then it will be pending confirmation, /// and will have to be [accepted](crate::pallet::Call::accept_resource_removal) by the token owner. - /// + /// /// # Permissions /// - Collection issuer - /// + /// /// # Arguments /// - `collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to. /// - `nft_id`: ID of the NFT with a resource to be removed. @@ -1371,7 +1371,7 @@ impl Pallet { Ok(scoped_key) } - /// Form a Unique property, transforming a RMRK key into bytes (without assigning the scope yet) + /// Form a Unique property, transforming a RMRK key into bytes (without assigning the scope yet) /// and encoding the value from an arbitrary type into bytes. pub fn encode_rmrk_property( rmrk_key: RmrkProperty, @@ -1416,7 +1416,7 @@ impl Pallet { } /// Initialize a new NFT collection with certain RMRK-scoped properties. - /// + /// /// See [`init_collection`](pallet_nonfungible::pallet::Pallet::init_collection) for more details. fn init_collection( sender: T::CrossAccountId, @@ -1439,7 +1439,7 @@ impl Pallet { } /// Mint a new NFT with certain RMRK-scoped properties. Sender must be the collection owner. - /// + /// /// See [`create_item`](pallet_nonfungible::pallet::Pallet::create_item) for more details. pub fn create_nft( sender: &T::CrossAccountId, @@ -1458,18 +1458,13 @@ impl Pallet { let nft_id = >::current_token_id(collection.id); - >::set_scoped_token_properties( - collection.id, - nft_id, - RMRK_SCOPE, - properties, - )?; + >::set_scoped_token_properties(collection.id, nft_id, RMRK_SCOPE, properties)?; Ok(nft_id) } /// Burn an NFT, along with its nested children, limited by `max_burns`. The sender must be the token owner. - /// + /// /// See [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively) for more details. fn destroy_nft( sender: T::CrossAccountId, @@ -1531,7 +1526,7 @@ impl Pallet { }) } - /// Apply a mutation to the property of a token containing sent tokens + /// Apply a mutation to the property of a token containing sent tokens /// that are currently pending acceptance. fn mutate_pending_children( (target_collection_id, target_nft_id): (CollectionId, TokenId), @@ -1557,7 +1552,7 @@ impl Pallet { ) } - /// Get an iterator from a token's property containing tokens sent to it + /// Get an iterator from a token's property containing tokens sent to it /// that are currently pending acceptance. fn iterate_pending_children( collection_id: CollectionId, @@ -1601,7 +1596,7 @@ impl Pallet { Ok(resource_id) } - /// Create and add a resource for a regular NFT, mark it as pending if the sender + /// Create and add a resource for a regular NFT, mark it as pending if the sender /// is not the token owner. The sender must be the collection owner. fn resource_add( sender: T::AccountId, @@ -1698,7 +1693,7 @@ impl Pallet { Ok(()) } - /// Remove one usage of a base from an NFT's property of associated bases. The base will stay, however, + /// Remove one usage of a base from an NFT's property of associated bases. The base will stay, however, /// if the count of resources using the base is still non-zero. fn remove_associated_base_id( collection_id: CollectionId, @@ -1843,7 +1838,7 @@ impl Pallet { } /// Get the type of a collection stored in it as a scoped property. - /// + /// /// RMRK Core proxy differentiates between regular collections as well as RMRK bases as collections. pub fn get_collection_type( collection_id: CollectionId, @@ -1882,7 +1877,7 @@ impl Pallet { Self::get_nft_collection(collection_id) } - /// Same as [`get_typed_nft_collection`](crate::pallet::Pallet::get_typed_nft_collection), + /// Same as [`get_typed_nft_collection`](crate::pallet::Pallet::get_typed_nft_collection), /// but also return the Unique collection ID. pub fn get_typed_nft_collection_mapped( rmrk_collection_id: RmrkCollectionId, @@ -1927,7 +1922,7 @@ impl Pallet { } /// Get the type of an NFT stored in it as a scoped property. - /// + /// /// RMRK Core proxy differentiates between regular NFTs, and RMRK parts and themes. pub fn get_nft_type( collection_id: CollectionId, @@ -1949,7 +1944,7 @@ impl Pallet { Ok(()) } - /// Ensure that an account is the owner of the token, either directly + /// Ensure that an account is the owner of the token, either directly /// or at the top of the nesting hierarchy; return an error if it is not. pub fn ensure_nft_owner( collection_id: CollectionId, @@ -1971,7 +1966,7 @@ impl Pallet { Ok(()) } - /// Fetch non-scoped properties of a collection or a token that match the filter keys supplied, + /// Fetch non-scoped properties of a collection or a token that match the filter keys supplied, /// or, if None are provided, return all non-scoped properties. pub fn filter_user_properties( collection_id: CollectionId, @@ -2018,7 +2013,7 @@ impl Pallet { }) } - /// Get all non-scoped properties from a collection or a token, and apply some transformation + /// Get all non-scoped properties from a collection or a token, and apply some transformation /// to each key-value pair. pub fn iterate_user_properties( collection_id: CollectionId, diff --git a/pallets/proxy-rmrk-core/src/misc.rs b/pallets/proxy-rmrk-core/src/misc.rs index b00a07241e..2df4557e62 100644 --- a/pallets/proxy-rmrk-core/src/misc.rs +++ b/pallets/proxy-rmrk-core/src/misc.rs @@ -19,7 +19,7 @@ use super::*; use codec::{Encode, Decode, Error}; -/// Match errors from one type to another and return an error +/// Match errors from one type to another and return an error /// if a match is successful. #[macro_export] macro_rules! map_unique_err_to_proxy { diff --git a/pallets/proxy-rmrk-core/src/property.rs b/pallets/proxy-rmrk-core/src/property.rs index d466f5321d..a8e08552d7 100644 --- a/pallets/proxy-rmrk-core/src/property.rs +++ b/pallets/proxy-rmrk-core/src/property.rs @@ -24,7 +24,7 @@ use core::convert::AsRef; pub const RESOURCE_ID_PREFIX: &str = "rsid-"; /// Property prefix for storing custom user-defined properties. pub const USER_PROPERTY_PREFIX: &str = "userprop-"; -/// Property scope for RMRK, used to signify that this property +/// Property scope for RMRK, used to signify that this property /// was created and is used by RMRK. pub const RMRK_SCOPE: PropertyScope = PropertyScope::Rmrk; diff --git a/pallets/proxy-rmrk-core/src/rpc.rs b/pallets/proxy-rmrk-core/src/rpc.rs index 8223d2a2c1..77985d4ff6 100644 --- a/pallets/proxy-rmrk-core/src/rpc.rs +++ b/pallets/proxy-rmrk-core/src/rpc.rs @@ -104,7 +104,6 @@ pub fn nft_by_id( })) } - /// Get tokens owned by an account in a collection. pub fn account_tokens( account_id: T::AccountId, diff --git a/pallets/proxy-rmrk-equip/src/lib.rs b/pallets/proxy-rmrk-equip/src/lib.rs index 5a76de8bad..58d7d06ed1 100644 --- a/pallets/proxy-rmrk-equip/src/lib.rs +++ b/pallets/proxy-rmrk-equip/src/lib.rs @@ -15,83 +15,83 @@ // along with Unique Network. If not, see . //! # RMRK Core Proxy Pallet -//! +//! //! A pallet used as proxy for RMRK Core (). -//! +//! //! - [`Config`] //! - [`Call`] //! - [`Pallet`] -//! +//! //! ## Overview -//! -//! The RMRK Equip Proxy pallet mirrors the functionality of RMRK Equip, +//! +//! The RMRK Equip Proxy pallet mirrors the functionality of RMRK Equip, //! binding its externalities to Unique's own underlying structure. //! It is purposed to mimic RMRK Equip exactly, allowing seamless integrations //! of solutions based on RMRK. -//! +//! //! RMRK Equip itself contains functionality to equip NFTs, and work with Bases, //! Parts, and Themes. -//! -//! Equip Proxy is responsible for a more specific area of RMRK, and heavily relies on the Core. +//! +//! Equip Proxy is responsible for a more specific area of RMRK, and heavily relies on the Core. //! For a more foundational description of proxy implementation, please refer to [`pallet_rmrk_core`]. -//! +//! //! *Note*, that while RMRK itself is subject to active development and restructuring, //! the proxy may be caught temporarily out of date. -//! +//! //! ### What is RMRK? -//! -//! RMRK is a set of NFT standards which compose several "NFT 2.0 lego" primitives. +//! +//! RMRK is a set of NFT standards which compose several "NFT 2.0 lego" primitives. //! Putting these legos together allows a user to create NFT systems of arbitrary complexity. -//! +//! //! Meaning, RMRK NFTs are dynamic, able to nest into each other and form a hierarchy, -//! make use of specific changeable and partially shared metadata in the form of resources, +//! make use of specific changeable and partially shared metadata in the form of resources, //! and more. -//! +//! //! Visit RMRK documentation and repositories to learn more: //! - Docs: //! - FAQ: //! - Substrate code repository: //! - RMRK spec repository: -//! +//! //! ## Proxy Implementation -//! +//! //! An external user is supposed to be able to utilize this proxy as they would //! utilize RMRK, and get exactly the same results. Normally, Unique transactions //! are off-limits to RMRK collections and tokens, and vice versa. However, //! the information stored on chain can be freely interpreted by storage reads and RPCs. -//! +//! //! ### ID Mapping -//! +//! //! RMRK's collections' IDs are counted independently of Unique's and start at 0. //! Note that tokens' IDs still start at 1. //! The collections themselves, as well as tokens, are stored as Unique collections, //! and thus RMRK IDs are mapped to Unique IDs (but not vice versa). -//! +//! //! ### External/Internal Collection Insulation -//! +//! //! A Unique transaction cannot target collections purposed for RMRK, -//! and they are flagged as `external` to specify that. On the other hand, +//! and they are flagged as `external` to specify that. On the other hand, //! due to the mapping, RMRK transactions and RPCs simply cannot reach Unique collections. -//! +//! //! ### Native Properties -//! -//! Many of RMRK's native parameters are stored as scoped properties of a collection +//! +//! Many of RMRK's native parameters are stored as scoped properties of a collection //! or an NFT on the chain. Scoped properties are prefixed with `rmrk:`, where `:` //! is an unacceptable symbol in user-defined proeprties, which, along with other safeguards, //! makes them impossible to tamper with. -//! +//! //! ### Collection and NFT Types -//! -//! RMRK introduces the concept of a Base, which is a catalgoue of Parts, +//! +//! RMRK introduces the concept of a Base, which is a catalgoue of Parts, //! possible components of an NFT. Due to its similarity with the functionality //! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes -//! are the collection's NFTs. See [`CollectionType`](pallet_rmrk_core::misc::CollectionType) and +//! are the collection's NFTs. See [`CollectionType`](pallet_rmrk_core::misc::CollectionType) and //! [`NftType`](pallet_rmrk_core::misc::NftType). -//! +//! //! ## Interface -//! +//! //! ### Dispatchables -//! +//! //! - `create_base` - Create a new Base. //! - `theme_add` - Add a Theme to a Base. //! - `equippable` - Update the array of Collections allowed to be equipped to a Base's specified Slot Part. @@ -184,16 +184,16 @@ pub mod pallet { #[pallet::call] impl Pallet { /// Create a new Base. - /// + /// /// Modeled after the [base interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/base.md) - /// + /// /// # Permissions /// - Anyone - will be assigned as the issuer of the base. /// /// # Arguments: /// - `base_type`: Arbitrary media type, e.g. "svg". /// - `symbol`: Arbitrary client-chosen symbol. - /// - `parts`: Array of Fixed and Slot parts composing the base, + /// - `parts`: Array of Fixed and Slot parts composing the base, /// confined in length by [`RmrkPartsLimit`](up_data_structs::RmrkPartsLimit). #[transactional] #[pallet::weight(>::create_base(parts.len() as u32))] @@ -228,7 +228,10 @@ pub mod pallet { collection_id, PropertyScope::Rmrk, [ - >::encode_rmrk_property(CollectionType, &misc::CollectionType::Base)?, + >::encode_rmrk_property( + CollectionType, + &misc::CollectionType::Base, + )?, >::encode_rmrk_property(BaseType, &base_type)?, ] .into_iter(), @@ -250,12 +253,12 @@ pub mod pallet { /// Add a Theme to a Base. /// A Theme named "default" is required prior to adding other Themes. - /// + /// /// Modeled after [themeadd interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/themeadd.md). /// /// # Permissions: /// - Base issuer - /// + /// /// # Arguments: /// - `base_id`: Base ID containing the Theme to be updated. /// - `theme`: Theme to add to the Base. A Theme has a name and properties, which are an @@ -314,12 +317,12 @@ pub mod pallet { } /// Update the array of Collections allowed to be equipped to a Base's specified Slot Part. - /// + /// /// Modeled after [equippable interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/equippable.md). /// /// # Permissions: /// - Base issuer - /// + /// /// # Arguments: /// - `base_id`: Base containing the Slot Part to be updated. /// - `part_id`: Slot Part whose Equippable List is being updated. From 263bc691fe1aae81266e09b3667860b082ed5488 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 15 Jul 2022 07:47:44 +0000 Subject: [PATCH 0026/1274] docs(pallet_common): Add general documentation. --- pallets/common/src/dispatch.rs | 23 +- pallets/common/src/erc.rs | 104 +++++- pallets/common/src/eth.rs | 6 + pallets/common/src/lib.rs | 625 +++++++++++++++++++++++++++------ 4 files changed, 633 insertions(+), 125 deletions(-) diff --git a/pallets/common/src/dispatch.rs b/pallets/common/src/dispatch.rs index 4a5cdbc5e6..7aa4830a09 100644 --- a/pallets/common/src/dispatch.rs +++ b/pallets/common/src/dispatch.rs @@ -1,3 +1,5 @@ +//! Module with interfaces for dispatching collections. + use frame_support::{ dispatch::{ DispatchResultWithPostInfo, PostDispatchInfo, Weight, DispatchErrorWithPostInfo, @@ -20,7 +22,10 @@ pub fn dispatch_weight() -> Weight { // submit_logs is measured as part of collection pallets } -/// Helper function to implement substrate calls for common collection methods +/// Helper function to implement substrate calls for common collection methods. +/// +/// * `collection` - The collection on which to call the method. +/// * `call` - The function in which to call the corresponding method from [CommonCollectionOperations]. pub fn dispatch_tx< T: Config, C: FnOnce(&dyn CommonCollectionOperations) -> DispatchResultWithPostInfo, @@ -64,15 +69,31 @@ pub fn dispatch_tx< result } +/// Interface for working with different collections through the dispatcher. pub trait CollectionDispatch { + /// Create a collection. The collection will be created according to the value of [data.mode](CreateCollectionData::mode). + /// + /// * `sender` - The user who will become the owner of the collection. + /// * `data` - Description of the created collection. fn create( sender: T::CrossAccountId, data: CreateCollectionData, ) -> DispatchResult; + + /// Delete the collection. + /// + /// * `sender` - The owner of the collection. + /// * `handle` - Collection handle. fn destroy(sender: T::CrossAccountId, handle: CollectionHandle) -> DispatchResult; + /// Get a specialized collection from the handle. + /// + /// * `handle` - Collection handle. fn dispatch(handle: CollectionHandle) -> Self; + + /// Get the collection handle for the corresponding implementation. fn into_inner(self) -> CollectionHandle; + /// Получить реализацию [CommonCollectionOperations]. fn as_dyn(&self) -> &dyn CommonCollectionOperations; } diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 54f1de6100..082fbcfce1 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! This module contains the implementation of pallet methods for evm. + use evm_coder::{ solidity_interface, solidity, ToLog, types::*, @@ -29,29 +31,39 @@ use alloc::format; use crate::{Pallet, CollectionHandle, Config, CollectionProperties}; +/// Events for etherium collection helper. #[derive(ToLog)] pub enum CollectionHelpersEvents { + /// The collection has been created. CollectionCreated { + /// Collection owner. #[indexed] owner: address, + + /// Collection ID. #[indexed] collection_id: address, }, } /// Does not always represent a full collection, for RFT it is either -/// collection (Implementing ERC721), or specific collection token (Implementing ERC20) +/// collection (Implementing ERC721), or specific collection token (Implementing ERC20). pub trait CommonEvmHandler { const CODE: &'static [u8]; fn call(self, handle: &mut impl PrecompileHandle) -> Option; } +/// @title A contract that allows you to work with collections. #[solidity_interface(name = "Collection")] impl CollectionHandle where T::AccountId: From<[u8; 32]>, { + /// Set collection property. + /// + /// @param key Property key. + /// @param value Propery value. fn set_collection_property( &mut self, caller: caller, @@ -60,14 +72,17 @@ where ) -> Result { let caller = T::CrossAccountId::from_eth(caller); let key = >::from(key) - .try_into() - .map_err(|_| "key too large")?; + .try_into() + .map_err(|_| "key too large")?; let value = value.try_into().map_err(|_| "value too large")?; - + >::set_collection_property(self, &caller, Property { key, value }) - .map_err(dispatch_to_evm::) + .map_err(dispatch_to_evm::) } - + + /// Delete collection property. + /// + /// @param key Property key. fn delete_collection_property(&mut self, caller: caller, key: string) -> Result<()> { let caller = T::CrossAccountId::from_eth(caller); let key = >::from(key) @@ -77,7 +92,12 @@ where >::delete_collection_property(self, &caller, key).map_err(dispatch_to_evm::) } - /// Throws error if key not found + /// Get collection property. + /// + /// @dev Throws error if key not found. + /// + /// @param key Property key. + /// @return bytes The property corresponding to the key. fn collection_property(&self, key: string) -> Result { let key = >::from(key) .try_into() @@ -89,6 +109,11 @@ where Ok(prop.to_vec()) } + /// Set the sponsor of the collection. + /// + /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + /// + /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. fn set_collection_sponsor(&mut self, caller: caller, sponsor: address) -> Result { check_is_owner_or_admin(caller, self)?; @@ -98,6 +123,9 @@ where save(self) } + /// Collection sponsorship confirmation. + /// + /// @dev After setting the sponsor for the collection, it must be confirmed with this function. fn confirm_collection_sponsorship(&mut self, caller: caller) -> Result { let caller = T::CrossAccountId::from_eth(caller); if !self @@ -109,6 +137,16 @@ where save(self) } + /// Set limits for the collection. + /// @dev Throws error if limit not found. + /// @param limit Name of the limit. Valid names: + /// "accountTokenOwnershipLimit", + /// "sponsoredDataSize", + /// "sponsoredDataRateLimit", + /// "tokenLimit", + /// "sponsorTransferTimeout", + /// "sponsorApproveTimeout" + /// @param value Value of the limit. #[solidity(rename_selector = "setCollectionLimit")] fn set_int_limit(&mut self, caller: caller, limit: string, value: uint32) -> Result { check_is_owner_or_admin(caller, self)?; @@ -145,6 +183,13 @@ where save(self) } + /// Set limits for the collection. + /// @dev Throws error if limit not found. + /// @param limit Name of the limit. Valid names: + /// "ownerCanTransfer", + /// "ownerCanDestroy", + /// "transfersEnabled" + /// @param value Value of the limit. #[solidity(rename_selector = "setCollectionLimit")] fn set_bool_limit(&mut self, caller: caller, limit: string, value: bool) -> Result { check_is_owner_or_admin(caller, self)?; @@ -172,10 +217,13 @@ where save(self) } + /// Get contract address. fn contract_address(&self, _caller: caller) -> Result
{ Ok(crate::eth::collection_id_to_address(self.id)) } + /// Add collection admin by substrate address. + /// @param new_admin Substrate administrator address. fn add_collection_admin_substrate(&self, caller: caller, new_admin: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); let mut new_admin_arr: [u8; 32] = Default::default(); @@ -186,21 +234,25 @@ where Ok(()) } + /// Remove collection admin by substrate address. + /// @param admin Substrate administrator address. fn remove_collection_admin_substrate( &self, caller: caller, - new_admin: uint256, + admin: uint256, ) -> Result { let caller = T::CrossAccountId::from_eth(caller); - let mut new_admin_arr: [u8; 32] = Default::default(); - new_admin.to_big_endian(&mut new_admin_arr); - let account_id = T::AccountId::from(new_admin_arr); - let new_admin = T::CrossAccountId::from_sub(account_id); - >::toggle_admin(self, &caller, &new_admin, false) + let mut admin_arr: [u8; 32] = Default::default(); + admin.to_big_endian(&mut admin_arr); + let account_id = T::AccountId::from(admin_arr); + let admin = T::CrossAccountId::from_sub(account_id); + >::toggle_admin(self, &caller, &admin, false) .map_err(dispatch_to_evm::)?; Ok(()) } + /// Add collection admin. + /// @param new_admin Address of the added administrator. fn add_collection_admin(&self, caller: caller, new_admin: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let new_admin = T::CrossAccountId::from_eth(new_admin); @@ -208,6 +260,9 @@ where Ok(()) } + /// Remove collection admin. + /// + /// @param new_admin Address of the removed administrator. fn remove_collection_admin(&self, caller: caller, admin: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let admin = T::CrossAccountId::from_eth(admin); @@ -215,6 +270,9 @@ where Ok(()) } + /// Toggle accessibility of collection nesting. + /// + /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' #[solidity(rename_selector = "setCollectionNesting")] fn set_nesting_bool(&mut self, caller: caller, enable: bool) -> Result { check_is_owner_or_admin(caller, self)?; @@ -235,6 +293,10 @@ where save(self) } + /// Toggle accessibility of collection nesting. + /// + /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + /// @param collections Addresses of collections that will be available for nesting. #[solidity(rename_selector = "setCollectionNesting")] fn set_nesting( &mut self, @@ -280,6 +342,10 @@ where save(self) } + /// Set the collection access method. + /// @param mode Access mode + /// 0 for Normal + /// 1 for AllowList fn set_collection_access(&mut self, caller: caller, mode: uint8) -> Result { check_is_owner_or_admin(caller, self)?; let permissions = CollectionPermissions { @@ -300,13 +366,19 @@ where save(self) } + /// Add the user to the allowed list. + /// + /// @param user Address of a trusted user. fn add_to_collection_allow_list(&self, caller: caller, user: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let user = T::CrossAccountId::from_eth(user); >::toggle_allowlist(self, &caller, &user, true).map_err(dispatch_to_evm::)?; Ok(()) } - + + /// Remove the user from the allowed list. + /// + /// @param user Address of a removed user. fn remove_from_collection_allow_list(&self, caller: caller, user: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let user = T::CrossAccountId::from_eth(user); @@ -314,6 +386,9 @@ where Ok(()) } + /// Switch permission for minting. + /// + /// @param mode Enable if "true". fn set_collection_mint_mode(&mut self, caller: caller, mode: bool) -> Result { check_is_owner_or_admin(caller, self)?; let permissions = CollectionPermissions { @@ -351,6 +426,7 @@ fn save(collection: &CollectionHandle) -> Result { Ok(()) } +/// Get the "tokenURI" key as [PropertyKey](up_data_structs::PropertyKey). pub fn token_uri_key() -> up_data_structs::PropertyKey { b"tokenURI" .to_vec() diff --git a/pallets/common/src/eth.rs b/pallets/common/src/eth.rs index 3a49fb3d74..002b7b4f19 100644 --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! The module contains a number of functions for converting and checking etherium identifiers. + use up_data_structs::CollectionId; use sp_core::H160; @@ -23,6 +25,7 @@ const ETH_COLLECTION_PREFIX: [u8; 16] = [ 0x17, 0xc4, 0xe6, 0x45, 0x3c, 0xc4, 0x9a, 0xaa, 0xae, 0xac, 0xa8, 0x94, 0xe6, 0xd9, 0x68, 0x3e, ]; +/// Maps the etherium address of the collection in substrate. pub fn map_eth_to_id(eth: &H160) -> Option { if eth[0..16] != ETH_COLLECTION_PREFIX { return None; @@ -31,6 +34,8 @@ pub fn map_eth_to_id(eth: &H160) -> Option { id_bytes.copy_from_slice(ð[16..20]); Some(CollectionId(u32::from_be_bytes(id_bytes))) } + +/// Maps the substrate collection id in etherium. pub fn collection_id_to_address(id: CollectionId) -> H160 { let mut out = [0; 20]; out[0..16].copy_from_slice(Ð_COLLECTION_PREFIX); @@ -38,6 +43,7 @@ pub fn collection_id_to_address(id: CollectionId) -> H160 { H160(out) } +/// Check if the etherium address is a collection. pub fn is_collection(address: &H160) -> bool { address[0..16] == ETH_COLLECTION_PREFIX } diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 5055b78cdd..840bc7f970 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -14,8 +14,46 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! # Common pallet +//! +//! The Common pallet provides functionality for handling collections. +//! +//! ## Overview +//! +//! The Common pallet provides functions for: +//! +//! - Setting and approving collection soponsor. +//! - Get\set\delete allow list. +//! - Get\set\delete collection properties. +//! - Get\set\delete collection property permissions. +//! - Get\set\delete token property permissions. +//! - Get\set\delete collection administrators. +//! - Checking access permissions. +//! - Provides an interface for common collection operations for different collection types. +//! - Provides dispatching for implementations of common collection operations, see [dispatch] module. +//! - Provides functionality of collection into evm, see [erc] and [eth] module. +//! +//! ### Terminology +//! **Collection sponsor** - For the collection, you can set a sponsor, at whose expense it will +//! be possible to mint tokens. +//! +//! **Allow list** - List of users who have the right to minting tokens. +//! +//! **Collection properties** - Collection properties are simply key-value stores where various +//! metadata can be placed. +//! +//! **Collection property permissions** - For each property in the collection can be set permission +//! to change, see [PropertyPermission]. +//! +//! **Permissions on token properties** - Similar to _permissions on collection properties_, +//! only restrictions apply to token properties. +//! +//! **Collection administrator** - For a collection, you can set administrators who have the right +//! to most actions on the collection. + + +#![warn(missing_docs)] #![cfg_attr(not(feature = "std"), no_std)] - extern crate alloc; use core::ops::{Deref, DerefMut}; @@ -90,14 +128,20 @@ pub mod erc; pub mod eth; pub mod weights; +/// Weight info. pub type SelfWeightOf = ::WeightInfo; +/// Collection handle contains information about collection data and id. +/// Also provides functionality to count consumed gas. #[must_use = "Should call submit_logs or save, otherwise some data will be lost for evm side"] pub struct CollectionHandle { + /// Collection id pub id: CollectionId, collection: Collection, + /// Substrate recorder for counting consumed gas pub recorder: SubstrateRecorder, } + impl WithRecorder for CollectionHandle { fn recorder(&self) -> &SubstrateRecorder { &self.recorder @@ -106,7 +150,9 @@ impl WithRecorder for CollectionHandle { self.recorder } } + impl CollectionHandle { + /// Same as [CollectionHandle::new] but with an explicit gas limit. pub fn new_with_gas_limit(id: CollectionId, gas_limit: u64) -> Option { >::get(id).map(|collection| Self { id, @@ -115,6 +161,7 @@ impl CollectionHandle { }) } + /// Same as [CollectionHandle::new] but with an existed [SubstrateRecorder]. pub fn new_with_recorder(id: CollectionId, recorder: SubstrateRecorder) -> Option { >::get(id).map(|collection| Self { id, @@ -123,14 +170,18 @@ impl CollectionHandle { }) } + /// Retrives collection data from storage and creates collection handle with default parameters. + /// If collection not found return `None` pub fn new(id: CollectionId) -> Option { Self::new_with_gas_limit(id, u64::MAX) } + /// Same as [CollectionHandle::new] but if collection not found [Error::CollectionNotFound] returned. pub fn try_get(id: CollectionId) -> Result { Ok(Self::new(id).ok_or(>::CollectionNotFound)?) } + /// Consume gas for reading. pub fn consume_store_reads(&self, reads: u64) -> evm_coder::execution::Result<()> { self.recorder .consume_gas(T::GasWeightMapping::weight_to_gas( @@ -140,6 +191,7 @@ impl CollectionHandle { )) } + /// Consume gas for writing. pub fn consume_store_writes(&self, writes: u64) -> evm_coder::execution::Result<()> { self.recorder .consume_gas(T::GasWeightMapping::weight_to_gas( @@ -148,16 +200,27 @@ impl CollectionHandle { .saturating_mul(writes), )) } + + /// Save collection to storage. pub fn save(self) -> DispatchResult { >::insert(self.id, self.collection); Ok(()) } + /// Set collection sponsor. + /// + /// Unique collections allows sponsoring for certain actions. + /// This method allows you to set the sponsor of the collection. + /// In order for sponsorship to become active, it must be confirmed through [Self::confirm_sponsorship]. pub fn set_sponsor(&mut self, sponsor: T::AccountId) -> DispatchResult { self.collection.sponsorship = SponsorshipState::Unconfirmed(sponsor); Ok(()) } + /// Confirm sponsorship + /// + /// In order for the sponsorship to become active, the user set as the sponsor must confirm their participation. + /// Before confirming sponsorship, the user must be specified as the sponsor of the collection via [Self::set_sponsor]. pub fn confirm_sponsorship(&mut self, sender: &T::AccountId) -> Result { if self.collection.sponsorship.pending_sponsor() != Some(sender) { return Ok(false); @@ -168,7 +231,7 @@ impl CollectionHandle { } /// Checks that the collection was created with, and must be operated upon through **Unique API**. - /// Now check only the `external_collection` flag and if it's **true**, then return `CollectionIsExternal` error. + /// Now check only the `external_collection` flag and if it's **true**, then return [Error::CollectionIsExternal] error. pub fn check_is_internal(&self) -> DispatchResult { if self.external_collection { return Err(>::CollectionIsExternal)?; @@ -178,7 +241,7 @@ impl CollectionHandle { } /// Checks that the collection was created with, and must be operated upon through an **assimilated API**. - /// Now check only the `external_collection` flag and if it's **false**, then return `CollectionIsInternal` error. + /// Now check only the `external_collection` flag and if it's **false**, then return [Error::CollectionIsInternal] error. pub fn check_is_external(&self) -> DispatchResult { if !self.external_collection { return Err(>::CollectionIsInternal)?; @@ -203,23 +266,34 @@ impl DerefMut for CollectionHandle { } impl CollectionHandle { - pub fn check_is_owner(&self, subject: &T::CrossAccountId) -> DispatchResult { - ensure!(*subject.as_sub() == self.owner, >::NoPermission); + /// Checks if the `user` is the owner of the collection. + pub fn check_is_owner(&self, user: &T::CrossAccountId) -> DispatchResult { + ensure!(*user.as_sub() == self.owner, >::NoPermission); Ok(()) } - pub fn is_owner_or_admin(&self, subject: &T::CrossAccountId) -> bool { - *subject.as_sub() == self.owner || >::get((self.id, subject)) + + /// Returns **true** if the `user` is the owner or administrator of the collection. + pub fn is_owner_or_admin(&self, user: &T::CrossAccountId) -> bool { + *user.as_sub() == self.owner || >::get((self.id, user)) } - pub fn check_is_owner_or_admin(&self, subject: &T::CrossAccountId) -> DispatchResult { - ensure!(self.is_owner_or_admin(subject), >::NoPermission); + + /// Checks if the `user` is the owner or administrator of the collection. + pub fn check_is_owner_or_admin(&self, user: &T::CrossAccountId) -> DispatchResult { + ensure!(self.is_owner_or_admin(user), >::NoPermission); Ok(()) } + + /// Return **true** if `user` was not allowed to have tokens, and he can ignore such restrictions. pub fn ignores_allowance(&self, user: &T::CrossAccountId) -> bool { self.limits.owner_can_transfer() && self.is_owner_or_admin(user) } + + /// Return **true** if `user` does not have enough token parts, and he can ignore such restrictions. pub fn ignores_owned_amount(&self, user: &T::CrossAccountId) -> bool { self.limits.owner_can_transfer() && self.is_owner_or_admin(user) } + + /// Checks if the user is in the allow list. If not [Error::AddressNotInAllowlist] returns. pub fn check_allowlist(&self, user: &T::CrossAccountId) -> DispatchResult { ensure!( >::get((self.id, user)), @@ -249,21 +323,34 @@ pub mod pallet { + TypeInfo + account::Config { + /// Weight info. type WeightInfo: WeightInfo; + + /// Events compatible with [frame_system::Config::Event]. type Event: IsType<::Event> + From>; + /// Currency. type Currency: Currency; + /// Price getter to create the collection. #[pallet::constant] type CollectionCreationPrice: Get< <::Currency as Currency>::Balance, >; + + /// Collection dispatcher. type CollectionDispatch: CollectionDispatch; + /// Treasury account id getter. type TreasuryAccountId: Get; + + /// Contract address getter. type ContractAddress: Get; + /// Mapper for tokens to Etherium addresses. type EvmTokenAddressMapping: TokenAddressMapping; + + /// Mapper for tokens to [CrossAccountId]. type CrossTokenAddressMapping: TokenAddressMapping; } @@ -276,6 +363,7 @@ pub mod pallet { #[pallet::extra_constants] impl Pallet { + /// Maximum admins per collection. pub fn collection_admins_limit() -> u32 { COLLECTION_ADMINS_LIMIT } @@ -285,94 +373,116 @@ pub mod pallet { #[pallet::generate_deposit(pub fn deposit_event)] pub enum Event { /// New collection was created - /// - /// # Arguments - /// - /// * collection_id: Globally unique identifier of newly created collection. - /// - /// * mode: [CollectionMode] converted into u8. - /// - /// * account_id: Collection owner. - CollectionCreated(CollectionId, u8, T::AccountId), + CollectionCreated( + /// Globally unique identifier of newly created collection. + CollectionId, + /// [CollectionMode] converted into _u8_. + u8, + /// Collection owner. + T::AccountId + ), /// New collection was destroyed - /// - /// # Arguments - /// - /// * collection_id: Globally unique identifier of collection. - CollectionDestroyed(CollectionId), + CollectionDestroyed( + /// Globally unique identifier of collection. + CollectionId + ), /// New item was created. - /// - /// # Arguments - /// - /// * collection_id: Id of the collection where item was created. - /// - /// * item_id: Id of an item. Unique within the collection. - /// - /// * recipient: Owner of newly created item - /// - /// * amount: Always 1 for NFT - ItemCreated(CollectionId, TokenId, T::CrossAccountId, u128), + ItemCreated( + /// Id of the collection where item was created. + CollectionId, + /// Id of an item. Unique within the collection. + TokenId, + /// Owner of newly created item + T::CrossAccountId, + /// Always 1 for NFT + u128 + ), /// Collection item was burned. - /// - /// # Arguments - /// - /// * collection_id. - /// - /// * item_id: Identifier of burned NFT. - /// - /// * owner: which user has destroyed its tokens - /// - /// * amount: Always 1 for NFT - ItemDestroyed(CollectionId, TokenId, T::CrossAccountId, u128), + ItemDestroyed( + /// Id of the collection where item was destroyed. + CollectionId, + /// Identifier of burned NFT. + TokenId, + /// Which user has destroyed its tokens. + T::CrossAccountId, + /// Amount of token pieces destroed. Always 1 for NFT. + u128), /// Item was transferred - /// - /// * collection_id: Id of collection to which item is belong - /// - /// * item_id: Id of an item - /// - /// * sender: Original owner of item - /// - /// * recipient: New owner of item - /// - /// * amount: Always 1 for NFT Transfer( + /// Id of collection to which item is belong. CollectionId, + /// Id of an item. TokenId, + /// Original owner of item. T::CrossAccountId, + /// New owner of item. T::CrossAccountId, + /// Amount of token pieces transfered. Always 1 for NFT. u128, ), - /// * collection_id - /// - /// * item_id - /// - /// * sender - /// - /// * spender - /// - /// * amount + /// Amount pieces of token owned by `sender` was approved for `spender`. Approved( + /// Id of collection to which item is belong. CollectionId, + /// Id of an item. TokenId, + /// Original owner of item. T::CrossAccountId, + /// Id for which the approval was granted. T::CrossAccountId, + /// Amount of token pieces transfered. Always 1 for NFT. u128, ), - CollectionPropertySet(CollectionId, PropertyKey), - - CollectionPropertyDeleted(CollectionId, PropertyKey), - - TokenPropertySet(CollectionId, TokenId, PropertyKey), - - TokenPropertyDeleted(CollectionId, TokenId, PropertyKey), - - PropertyPermissionSet(CollectionId, PropertyKey), + /// The colletion property has been set. + CollectionPropertySet( + /// Id of collection to which property has been set. + CollectionId, + /// The property that was set. + PropertyKey + ), + + /// The property has been deleted. + CollectionPropertyDeleted( + /// Id of collection to which property has been deleted. + CollectionId, + /// The property that was deleted. + PropertyKey + ), + + /// The token property has been set. + TokenPropertySet( + /// Identifier of the collection whose token has the property set. + CollectionId, + /// The token for which the property was set. + TokenId, + /// The property that was set. + PropertyKey + ), + + + /// The token property has been deleted. + TokenPropertyDeleted( + /// Identifier of the collection whose token has the property deleted. + CollectionId, + /// The token for which the property was deleted. + TokenId, + /// The property that was deleted. + PropertyKey + ), + + /// The colletion property permission has been set. + PropertyPermissionSet( + /// Id of collection to which property permission has been set. + CollectionId, + /// The property permission that was set. + PropertyKey + ), } #[pallet::error] @@ -460,13 +570,16 @@ pub mod pallet { CollectionIsInternal, } + /// Storage of the count of created collections. #[pallet::storage] pub type CreatedCollectionCount = StorageValue; + + /// Storage of the count of deleted collections. #[pallet::storage] pub type DestroyedCollectionCount = StorageValue; - /// Collection info + /// Storage of collection info. #[pallet::storage] pub type CollectionById = StorageMap< Hasher = Blake2_128Concat, @@ -475,7 +588,7 @@ pub mod pallet { QueryKind = OptionQuery, >; - /// Collection properties + /// Storage of collection properties. #[pallet::storage] #[pallet::getter(fn collection_properties)] pub type CollectionProperties = StorageMap< @@ -486,6 +599,7 @@ pub mod pallet { OnEmpty = up_data_structs::CollectionProperties, >; + /// Storage of collection properties permissions. #[pallet::storage] #[pallet::getter(fn property_permissions)] pub type CollectionPropertyPermissions = StorageMap< @@ -495,6 +609,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// Storage of collection admins count. #[pallet::storage] pub type AdminAmount = StorageMap< Hasher = Blake2_128Concat, @@ -525,7 +640,7 @@ pub mod pallet { QueryKind = ValueQuery, >; - /// Not used by code, exists only to provide some types to metadata + /// Not used by code, exists only to provide some types to metadata. #[pallet::storage] pub type DummyStorageValue = StorageValue< Value = ( @@ -619,7 +734,9 @@ pub mod pallet { } impl Pallet { - /// Ethereum receiver 0x0000000000000000000000000000000000000000 is reserved, and shouldn't own tokens + /// Enshure that receiver address is correct. + /// + /// Ethereum receiver 0x0000000000000000000000000000000000000000 is reserved, and shouldn't own tokens. pub fn ensure_correct_receiver(receiver: &T::CrossAccountId) -> DispatchResult { ensure!( &T::CrossAccountId::from_eth(H160([0; 20])) != receiver, @@ -627,19 +744,27 @@ impl Pallet { ); Ok(()) } + + /// Get a vector of collection admins. pub fn adminlist(collection: CollectionId) -> Vec { >::iter_prefix((collection,)) .map(|(a, _)| a) .collect() } + + /// Get a vector of users allowed to mint tokens. pub fn allowlist(collection: CollectionId) -> Vec { >::iter_prefix((collection,)) .map(|(a, _)| a) .collect() } + + /// Is `user` allowed to mint token in `collection`. pub fn allowed(collection: CollectionId, user: T::CrossAccountId) -> bool { >::get((collection, user)) } + + /// Get statistics of collections. pub fn collection_stats() -> CollectionStats { let created = >::get(); let destroyed = >::get(); @@ -650,6 +775,7 @@ impl Pallet { } } + /// Get the effective limits for the collection. pub fn effective_collection_limits(collection: CollectionId) -> Option { let collection = >::get(collection); if collection.is_none() { @@ -683,6 +809,7 @@ impl Pallet { Some(effective_limits) } + /// Returns information about the `collection` adapted for rpc. pub fn rpc_collection(collection: CollectionId) -> Option> { let Collection { name, @@ -758,9 +885,14 @@ macro_rules! limit_default_clone { } impl Pallet { + /// Create new collection. + /// + /// * `owner` - The owner of the collection. + /// * `data` - Description of the created collection. + /// * `is_external` - Marks that collection managet by not "Unique network". pub fn init_collection( owner: T::CrossAccountId, - data: CreateCollectionData, + data: CreateCollectionData, is_external: bool, ) -> Result { { @@ -858,6 +990,10 @@ impl Pallet { Ok(id) } + /// Destroy collection. + /// + /// * `collection` - Collection handler. + /// * `sender` - The owner or administrator of the collection. pub fn destroy_collection( collection: CollectionHandle, sender: &T::CrossAccountId, @@ -886,6 +1022,11 @@ impl Pallet { Ok(()) } + /// Set collection property. + /// + /// * `collection` - Collection handler. + /// * `sender` - The owner or administrator of the collection. + /// * `property` - The property to set. pub fn set_collection_property( collection: &CollectionHandle, sender: &T::CrossAccountId, @@ -904,6 +1045,11 @@ impl Pallet { Ok(()) } + /// Set scouped collection property. + /// + /// * `collection_id` - ID of the collection for which the property is being set. + /// * `scope` - Property scope. + /// * `property` - The property to set. pub fn set_scoped_collection_property( collection_id: CollectionId, scope: PropertyScope, @@ -913,10 +1059,15 @@ impl Pallet { properties.try_scoped_set(scope, property.key, property.value) }) .map_err(>::from)?; - + Ok(()) } - + + /// Set scouped collection properties. + /// + /// * `collection_id` - ID of the collection for which the properties is being set. + /// * `scope` - Property scope. + /// * `properties` - The properties to set. pub fn set_scoped_collection_properties( collection_id: CollectionId, scope: PropertyScope, @@ -930,6 +1081,11 @@ impl Pallet { Ok(()) } + /// Set collection properties. + /// + /// * `collection` - Collection handler. + /// * `sender` - The owner or administrator of the collection. + /// * `properties` - The properties to set. #[transactional] pub fn set_collection_properties( collection: &CollectionHandle, @@ -939,30 +1095,40 @@ impl Pallet { for property in properties { Self::set_collection_property(collection, sender, property)?; } - + Ok(()) } - + + /// Delete collection property. + /// + /// * `collection` - Collection handler. + /// * `sender` - The owner or administrator of the collection. + /// * `property` - The property to delete. pub fn delete_collection_property( collection: &CollectionHandle, sender: &T::CrossAccountId, property_key: PropertyKey, ) -> DispatchResult { collection.check_is_owner_or_admin(sender)?; - + CollectionProperties::::try_mutate(collection.id, |properties| { properties.remove(&property_key) }) .map_err(>::from)?; - + Self::deposit_event(Event::CollectionPropertyDeleted( collection.id, property_key, )); - + Ok(()) } - + + /// Delete collection properties. + /// + /// * `collection` - Collection handler. + /// * `sender` - The owner or administrator of the collection. + /// * `properties` - The properties to delete. #[transactional] pub fn delete_collection_properties( collection: &CollectionHandle, @@ -972,11 +1138,16 @@ impl Pallet { for key in property_keys { Self::delete_collection_property(collection, sender, key)?; } - + Ok(()) } - - // For migrations + + /// Set collection propetry permission without any checks. + /// + /// Used for migrations. + /// + /// * `collection` - Collection handler. + /// * `property_permissions` - Property permissions. pub fn set_property_permission_unchecked( collection: CollectionId, property_permission: PropertyKeyPermission, @@ -988,6 +1159,11 @@ impl Pallet { Ok(()) } + /// Set collection property permission. + /// + /// * `collection` - Collection handler. + /// * `sender` - The owner or administrator of the collection. + /// * `property_permission` - Property permission. pub fn set_property_permission( collection: &CollectionHandle, sender: &T::CrossAccountId, @@ -1018,6 +1194,11 @@ impl Pallet { Ok(()) } + /// Set token property permission. + /// + /// * `collection` - Collection handler. + /// * `sender` - The owner or administrator of the collection. + /// * `property_permissions` - Property permissions. #[transactional] pub fn set_token_property_permissions( collection: &CollectionHandle, @@ -1031,6 +1212,7 @@ impl Pallet { Ok(()) } + /// Get collection property. pub fn get_collection_property( collection_id: CollectionId, key: &PropertyKey, @@ -1038,6 +1220,7 @@ impl Pallet { Self::collection_properties(collection_id).get(key).cloned() } + /// Convert byte vector to property key vector. pub fn bytes_keys_to_property_keys( keys: Vec>, ) -> Result, DispatchError> { @@ -1049,6 +1232,7 @@ impl Pallet { .collect::, DispatchError>>() } + /// Get properties according to given keys. pub fn filter_collection_properties( collection_id: CollectionId, keys: Option>, @@ -1076,6 +1260,7 @@ impl Pallet { Ok(properties) } + /// Get property permissions according to given keys. pub fn filter_property_permissions( collection_id: CollectionId, keys: Option>, @@ -1105,6 +1290,7 @@ impl Pallet { Ok(key_permissions) } + /// Toggle `user` participation in the `collection`'s allow list. pub fn toggle_allowlist( collection: &CollectionHandle, sender: &T::CrossAccountId, @@ -1124,6 +1310,7 @@ impl Pallet { Ok(()) } + /// Toggle `user` participation in the `collection`'s admin list. pub fn toggle_admin( collection: &CollectionHandle, sender: &T::CrossAccountId, @@ -1159,6 +1346,7 @@ impl Pallet { Ok(()) } + /// Merge set fields from `new_limit` to `old_limit`. pub fn clamp_limits( mode: CollectionMode, old_limit: &CollectionLimits, @@ -1204,20 +1392,22 @@ impl Pallet { Ok(new_limit) } + /// Merge set fields from `new_permission` to `old_permission`. pub fn clamp_permissions( _mode: CollectionMode, - old_limit: &CollectionPermissions, - mut new_limit: CollectionPermissions, + old_permission: &CollectionPermissions, + mut new_permission: CollectionPermissions, ) -> Result { - limit_default_clone!(old_limit, new_limit, + limit_default_clone!(old_permission, new_permission, access => {}, mint_mode => {}, nesting => { /* todo check for permissive, if only it gets out of benchmarks */ }, ); - Ok(new_limit) + Ok(new_permission) } } +/// Indicates unsupported methods by returning [Error::UnsupportedOperation]. #[macro_export] macro_rules! unsupported { () => { @@ -1225,32 +1415,72 @@ macro_rules! unsupported { }; } -/// Worst cases +/// Return weights for various worst-case operations. pub trait CommonWeightInfo { + /// Weight of item creation. fn create_item() -> Weight; + + /// Weight of items creation. fn create_multiple_items(amount: &[CreateItemData]) -> Weight; + + /// Weight of items creation. fn create_multiple_items_ex(cost: &CreateItemExData) -> Weight; + + /// The weight of the burning item. fn burn_item() -> Weight; + + /// Property setting weight. + /// + /// * `amount`- The number of properties to set. fn set_collection_properties(amount: u32) -> Weight; + + /// Collection property deletion weight. + /// + /// * `amount`- The number of properties to set. fn delete_collection_properties(amount: u32) -> Weight; + + /// Token property setting weight. + /// + /// * `amount`- The number of properties to set. fn set_token_properties(amount: u32) -> Weight; + + /// Token property deletion weight. + /// + /// * `amount`- The number of properties to delete. fn delete_token_properties(amount: u32) -> Weight; + + + /// Token property permissions set weight. + /// + /// * `amount`- The number of property permissions to set. fn set_token_property_permissions(amount: u32) -> Weight; + + /// Transfer price of the token or its parts. fn transfer() -> Weight; + + /// The price of setting the permission of the operation from another user. fn approve() -> Weight; + + /// Transfer price from another user. fn transfer_from() -> Weight; - fn burn_from() -> Weight; + /// The price of burning a token from another user. + fn burn_from() -> Weight; + /// Differs from burn_item in case of Fungible and Refungible, as it should burn /// whole users's balance /// - /// This method shouldn't be used directly, as it doesn't count breadth price, use `burn_recursively` instead + /// This method shouldn't be used directly, as it doesn't count breadth price, use [burn_recursively](CommonWeightInfo::burn_recursively) instead fn burn_recursively_self_raw() -> Weight; + /// Cost of iterating over `amount` children while burning, without counting child burning itself /// - /// This method shouldn't be used directly, as it doesn't count depth price, use `burn_recursively` instead + /// This method shouldn't be used directly, as it doesn't count depth price, use [burn_recursively](CommonWeightInfo::burn_recursively) instead fn burn_recursively_breadth_raw(amount: u32) -> Weight; - + + /// The price of recursive burning a token. + /// + /// `max_selfs` - fn burn_recursively(max_selfs: u32, max_breadth: u32) -> Weight { Self::burn_recursively_self_raw() .saturating_mul(max_selfs.max(1) as u64) @@ -1258,11 +1488,23 @@ pub trait CommonWeightInfo { } } +/// Weight info extension trait for refungible pallet. pub trait RefungibleExtensionsWeightInfo { + /// Weight of token repartition. fn repartition() -> Weight; } +/// Common collection operations. +/// +/// It wraps methods in Fungible, Nonfungible and Refungible pallets +/// and adds weight info. pub trait CommonCollectionOperations { + /// Create token. + /// + /// * `sender` - The user who mint the token and pays for the transaction. + /// * `to` - The user who will own the token. + /// * `data` - Token data. + /// * `nesting_budget` - A budget that can be spent on nesting tokens. fn create_item( &self, sender: T::CrossAccountId, @@ -1270,6 +1512,13 @@ pub trait CommonCollectionOperations { data: CreateItemData, nesting_budget: &dyn Budget, ) -> DispatchResultWithPostInfo; + + /// Create multiple tokens. + /// + /// * `sender` - The user who mint the token and pays for the transaction. + /// * `to` - The user who will own the token. + /// * `data` - Token data. + /// * `nesting_budget` - A budget that can be spent on nesting tokens. fn create_multiple_items( &self, sender: T::CrossAccountId, @@ -1277,18 +1526,38 @@ pub trait CommonCollectionOperations { data: Vec, nesting_budget: &dyn Budget, ) -> DispatchResultWithPostInfo; + + /// Create multiple tokens. + /// + /// * `sender` - The user who mint the token and pays for the transaction. + /// * `to` - The user who will own the token. + /// * `data` - Token data. + /// * `nesting_budget` - A budget that can be spent on nesting tokens. fn create_multiple_items_ex( &self, sender: T::CrossAccountId, data: CreateItemExData, nesting_budget: &dyn Budget, ) -> DispatchResultWithPostInfo; + + /// Burn token. + /// + /// * `sender` - The user who owns the token. + /// * `token` - Token id that will burned. + /// * `amount` - The number of parts of the token that will be burned. fn burn_item( &self, sender: T::CrossAccountId, token: TokenId, amount: u128, ) -> DispatchResultWithPostInfo; + + /// Burn token and all nested tokens recursievly. + /// + /// * `sender` - The user who owns the token. + /// * `token` - Token id that will burned. + /// * `self_budget` - The budget that can be spent on burning tokens. + /// * `breadth_budget` - The budget that can be spent on burning nested tokens. fn burn_item_recursively( &self, sender: T::CrossAccountId, @@ -1296,43 +1565,95 @@ pub trait CommonCollectionOperations { self_budget: &dyn Budget, breadth_budget: &dyn Budget, ) -> DispatchResultWithPostInfo; + + /// Set collection properties. + /// + /// * `sender` - Must be either the owner of the collection or its admin. + /// * `properties` - Properties to be set. fn set_collection_properties( &self, sender: T::CrossAccountId, properties: Vec, ) -> DispatchResultWithPostInfo; + + /// Delete collection properties. + /// + /// * `sender` - Must be either the owner of the collection or its admin. + /// * `properties` - The properties to be removed. fn delete_collection_properties( &self, sender: &T::CrossAccountId, property_keys: Vec, ) -> DispatchResultWithPostInfo; + + /// Set token properties. + /// + /// The appropriate [PropertyPermission] for the token property + /// must be set with [Self::set_token_property_permissions]. + /// + /// * `sender` - Must be either the owner of the token or its admin. + /// * `token_id` - The token for which the properties are being set. + /// * `properties` - Properties to be set. + /// * `budget` - Budget for setting properties. fn set_token_properties( &self, sender: T::CrossAccountId, token_id: TokenId, - property: Vec, - nesting_budget: &dyn Budget, + properties: Vec, + budget: &dyn Budget, ) -> DispatchResultWithPostInfo; + + /// Remove token properties. + /// + /// The appropriate [PropertyPermission] for the token property + /// must be set with [Self::set_token_property_permissions]. + /// + /// * `sender` - Must be either the owner of the token or its admin. + /// * `token_id` - The token for which the properties are being remove. + /// * `property_keys` - Keys to remove corresponding properties. + /// * `budget` - Budget for removing properties. fn delete_token_properties( &self, sender: T::CrossAccountId, token_id: TokenId, property_keys: Vec, - nesting_budget: &dyn Budget, + budget: &dyn Budget, ) -> DispatchResultWithPostInfo; + + /// Set token property permissions. + /// + /// * `sender` - Must be either the owner of the token or its admin. + /// * `token_id` - The token for which the properties are being set. + /// * `properties` - Properties to be set. + /// * `budget` - Budget for setting properties. fn set_token_property_permissions( &self, sender: &T::CrossAccountId, property_permissions: Vec, ) -> DispatchResultWithPostInfo; + + /// Transfer amount of token pieces. + /// + /// * `sender` - Donor user. + /// * `to` - Recepient user. + /// * `token` - The token of which parts are being sent. + /// * `amount` - The number of parts of the token that will be transferred. + /// * `budget` - The maximum budget that can be spent on the transfer. fn transfer( &self, sender: T::CrossAccountId, to: T::CrossAccountId, token: TokenId, amount: u128, - nesting_budget: &dyn Budget, + budget: &dyn Budget, ) -> DispatchResultWithPostInfo; + + /// Grant access to another account to transfer parts of the token owned by the calling user via [Self::transfer_from]. + /// + /// * `sender` - The user who grants access to the token. + /// * `spender` - The user to whom the rights are granted. + /// * `token` - The token to which access is granted. + /// * `amount` - The amount of pieces that another user can dispose of. fn approve( &self, sender: T::CrossAccountId, @@ -1340,6 +1661,17 @@ pub trait CommonCollectionOperations { token: TokenId, amount: u128, ) -> DispatchResultWithPostInfo; + + /// Send parts of a token owned by another user. + /// + /// Before calling this method, you must grant rights to the calling user via [Self::approve]. + /// + /// * `sender` - The user who has access to the token. + /// * `from` - The user who owns the token. + /// * `to` - Recepient user. + /// * `token` - The token of which parts are being sent. + /// * `amount` - The number of parts of the token that will be transferred. + /// * `budget` - The maximum budget that can be spent on the transfer. fn transfer_from( &self, sender: T::CrossAccountId, @@ -1347,67 +1679,140 @@ pub trait CommonCollectionOperations { to: T::CrossAccountId, token: TokenId, amount: u128, - nesting_budget: &dyn Budget, + budget: &dyn Budget, ) -> DispatchResultWithPostInfo; + + /// Burn parts of a token owned by another user. + /// + /// Before calling this method, you must grant rights to the calling user via [Self::approve]. + /// + /// * `sender` - The user who has access to the token. + /// * `from` - The user who owns the token. + /// * `token` - The token of which parts are being sent. + /// * `amount` - The number of parts of the token that will be transferred. + /// * `budget` - The maximum budget that can be spent on the burn. fn burn_from( &self, sender: T::CrossAccountId, from: T::CrossAccountId, token: TokenId, amount: u128, - nesting_budget: &dyn Budget, + budget: &dyn Budget, ) -> DispatchResultWithPostInfo; + /// Check permission to nest token. + /// + /// * `sender` - The user who initiated the check. + /// * `from` - The token that is checked for embedding. + /// * `under` - Token under which to check. + /// * `budget` - The maximum budget that can be spent on the check. fn check_nesting( &self, sender: T::CrossAccountId, from: (CollectionId, TokenId), under: TokenId, - nesting_budget: &dyn Budget, + budget: &dyn Budget, ) -> DispatchResult; + /// Nest one token into another. + /// + /// * `under` - Token holder. + /// * `to_nest` - Nested token. fn nest(&self, under: TokenId, to_nest: (CollectionId, TokenId)); + /// Unnest token. + /// + /// * `under` - Token holder. + /// * `to_nest` - Token to unnest. fn unnest(&self, under: TokenId, to_nest: (CollectionId, TokenId)); + /// Get all user tokens. + /// + /// * `account` - Account for which you need to get tokens. fn account_tokens(&self, account: T::CrossAccountId) -> Vec; + + /// Get all the tokens in the collection. fn collection_tokens(&self) -> Vec; + + /// Check if the token exists. + /// + /// * `token` - Id token to check. fn token_exists(&self, token: TokenId) -> bool; + + /// Get the id of the last minted token. fn last_token_id(&self) -> TokenId; + /// Get the owner of the token. + /// + /// * `token` - The token for which you need to find out the owner. fn token_owner(&self, token: TokenId) -> Option; + + /// Get the value of the token property by key. + /// + /// * `token` - Token property to get. + /// * `key` - Property name. fn token_property(&self, token_id: TokenId, key: &PropertyKey) -> Option; - fn token_properties(&self, token_id: TokenId, keys: Option>) -> Vec; + + /// Get a set of token properties by key vector. + /// + /// * `token` - Token property to get. + /// * `keys` - Vector of keys. If this parameter is [None](sp_std::result::Result), + /// then all properties are returned. + fn token_properties(&self, token: TokenId, keys: Option>) -> Vec; + /// Amount of unique collection tokens fn total_supply(&self) -> u32; - /// Amount of different tokens account has (Applicable to nonfungible/refungible) + + /// Amount of different tokens account has. + /// + /// * `account` - The account for which need to get the balance. fn account_balance(&self, account: T::CrossAccountId) -> u32; - /// Amount of specific token account have (Applicable to fungible/refungible) + + /// Amount of specific token account have. fn balance(&self, account: T::CrossAccountId, token: TokenId) -> u128; + /// Amount of token pieces fn total_pieces(&self, token: TokenId) -> Option; + + /// Get the number of parts of the token that a trusted user can manage. + /// + /// * `sender` - Trusted user. + /// * `spender` - Owner of the token. + /// * `token` - The token for which to get the value. fn allowance( &self, sender: T::CrossAccountId, spender: T::CrossAccountId, token: TokenId, ) -> u128; + + /// Get extension for RFT collection. fn refungible_extensions(&self) -> Option<&dyn RefungibleExtensions>; } +/// Extension for RFT collection. pub trait RefungibleExtensions where T: Config, { + /// Change the number of parts of the token. + /// + /// When the value changes down, this function is equivalent to burning parts of the token. + /// + /// * `sender` - The user calling the repartition operation. Must be the owner of the token. + /// * `token` - The token for which you want to change the number of parts. + /// * `amount` - The new value of the parts of the token. fn repartition( &self, - owner: &T::CrossAccountId, + sender: &T::CrossAccountId, token: TokenId, amount: u128, ) -> DispatchResultWithPostInfo; } -// Flexible enough for implementing CommonCollectionOperations +/// Merge [DispatchResult] with [Weight] into [DispatchResultWithPostInfo]. +/// +/// Used for [CommonCollectionOperations] implementations and flexible enough to do so. pub fn with_weight(res: DispatchResult, weight: Weight) -> DispatchResultWithPostInfo { let post_info = PostDispatchInfo { actual_weight: Some(weight), From 7dcd3b7313a5623b2e8ecbae550bdf6ffb9e6c2a Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 15 Jul 2022 07:50:07 +0000 Subject: [PATCH 0027/1274] fmt --- pallets/common/src/dispatch.rs | 8 +- pallets/common/src/erc.rs | 47 ++++--- pallets/common/src/lib.rs | 216 ++++++++++++++++----------------- 3 files changed, 132 insertions(+), 139 deletions(-) diff --git a/pallets/common/src/dispatch.rs b/pallets/common/src/dispatch.rs index 7aa4830a09..0282938a8b 100644 --- a/pallets/common/src/dispatch.rs +++ b/pallets/common/src/dispatch.rs @@ -23,7 +23,7 @@ pub fn dispatch_weight() -> Weight { } /// Helper function to implement substrate calls for common collection methods. -/// +/// /// * `collection` - The collection on which to call the method. /// * `call` - The function in which to call the corresponding method from [CommonCollectionOperations]. pub fn dispatch_tx< @@ -72,7 +72,7 @@ pub fn dispatch_tx< /// Interface for working with different collections through the dispatcher. pub trait CollectionDispatch { /// Create a collection. The collection will be created according to the value of [data.mode](CreateCollectionData::mode). - /// + /// /// * `sender` - The user who will become the owner of the collection. /// * `data` - Description of the created collection. fn create( @@ -81,13 +81,13 @@ pub trait CollectionDispatch { ) -> DispatchResult; /// Delete the collection. - /// + /// /// * `sender` - The owner of the collection. /// * `handle` - Collection handle. fn destroy(sender: T::CrossAccountId, handle: CollectionHandle) -> DispatchResult; /// Get a specialized collection from the handle. - /// + /// /// * `handle` - Collection handle. fn dispatch(handle: CollectionHandle) -> Self; diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 082fbcfce1..b6f84b6ef5 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -61,7 +61,7 @@ where T::AccountId: From<[u8; 32]>, { /// Set collection property. - /// + /// /// @param key Property key. /// @param value Propery value. fn set_collection_property( @@ -72,16 +72,16 @@ where ) -> Result { let caller = T::CrossAccountId::from_eth(caller); let key = >::from(key) - .try_into() - .map_err(|_| "key too large")?; + .try_into() + .map_err(|_| "key too large")?; let value = value.try_into().map_err(|_| "value too large")?; - + >::set_collection_property(self, &caller, Property { key, value }) - .map_err(dispatch_to_evm::) + .map_err(dispatch_to_evm::) } - + /// Delete collection property. - /// + /// /// @param key Property key. fn delete_collection_property(&mut self, caller: caller, key: string) -> Result<()> { let caller = T::CrossAccountId::from_eth(caller); @@ -93,9 +93,9 @@ where } /// Get collection property. - /// + /// /// @dev Throws error if key not found. - /// + /// /// @param key Property key. /// @return bytes The property corresponding to the key. fn collection_property(&self, key: string) -> Result { @@ -110,9 +110,9 @@ where } /// Set the sponsor of the collection. - /// + /// /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - /// + /// /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. fn set_collection_sponsor(&mut self, caller: caller, sponsor: address) -> Result { check_is_owner_or_admin(caller, self)?; @@ -124,7 +124,7 @@ where } /// Collection sponsorship confirmation. - /// + /// /// @dev After setting the sponsor for the collection, it must be confirmed with this function. fn confirm_collection_sponsorship(&mut self, caller: caller) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -236,18 +236,13 @@ where /// Remove collection admin by substrate address. /// @param admin Substrate administrator address. - fn remove_collection_admin_substrate( - &self, - caller: caller, - admin: uint256, - ) -> Result { + fn remove_collection_admin_substrate(&self, caller: caller, admin: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); let mut admin_arr: [u8; 32] = Default::default(); admin.to_big_endian(&mut admin_arr); let account_id = T::AccountId::from(admin_arr); let admin = T::CrossAccountId::from_sub(account_id); - >::toggle_admin(self, &caller, &admin, false) - .map_err(dispatch_to_evm::)?; + >::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::)?; Ok(()) } @@ -261,7 +256,7 @@ where } /// Remove collection admin. - /// + /// /// @param new_admin Address of the removed administrator. fn remove_collection_admin(&self, caller: caller, admin: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -271,7 +266,7 @@ where } /// Toggle accessibility of collection nesting. - /// + /// /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' #[solidity(rename_selector = "setCollectionNesting")] fn set_nesting_bool(&mut self, caller: caller, enable: bool) -> Result { @@ -294,7 +289,7 @@ where } /// Toggle accessibility of collection nesting. - /// + /// /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' /// @param collections Addresses of collections that will be available for nesting. #[solidity(rename_selector = "setCollectionNesting")] @@ -367,7 +362,7 @@ where } /// Add the user to the allowed list. - /// + /// /// @param user Address of a trusted user. fn add_to_collection_allow_list(&self, caller: caller, user: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -375,9 +370,9 @@ where >::toggle_allowlist(self, &caller, &user, true).map_err(dispatch_to_evm::)?; Ok(()) } - + /// Remove the user from the allowed list. - /// + /// /// @param user Address of a removed user. fn remove_from_collection_allow_list(&self, caller: caller, user: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -387,7 +382,7 @@ where } /// Switch permission for minting. - /// + /// /// @param mode Enable if "true". fn set_collection_mint_mode(&mut self, caller: caller, mode: bool) -> Result { check_is_owner_or_admin(caller, self)?; diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 840bc7f970..e93f5660cd 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -17,11 +17,11 @@ //! # Common pallet //! //! The Common pallet provides functionality for handling collections. -//! +//! //! ## Overview -//! +//! //! The Common pallet provides functions for: -//! +//! //! - Setting and approving collection soponsor. //! - Get\set\delete allow list. //! - Get\set\delete collection properties. @@ -32,26 +32,25 @@ //! - Provides an interface for common collection operations for different collection types. //! - Provides dispatching for implementations of common collection operations, see [dispatch] module. //! - Provides functionality of collection into evm, see [erc] and [eth] module. -//! +//! //! ### Terminology -//! **Collection sponsor** - For the collection, you can set a sponsor, at whose expense it will +//! **Collection sponsor** - For the collection, you can set a sponsor, at whose expense it will //! be possible to mint tokens. -//! +//! //! **Allow list** - List of users who have the right to minting tokens. -//! -//! **Collection properties** - Collection properties are simply key-value stores where various +//! +//! **Collection properties** - Collection properties are simply key-value stores where various //! metadata can be placed. -//! -//! **Collection property permissions** - For each property in the collection can be set permission +//! +//! **Collection property permissions** - For each property in the collection can be set permission //! to change, see [PropertyPermission]. -//! -//! **Permissions on token properties** - Similar to _permissions on collection properties_, +//! +//! **Permissions on token properties** - Similar to _permissions on collection properties_, //! only restrictions apply to token properties. -//! -//! **Collection administrator** - For a collection, you can set administrators who have the right +//! +//! **Collection administrator** - For a collection, you can set administrators who have the right //! to most actions on the collection. - #![warn(missing_docs)] #![cfg_attr(not(feature = "std"), no_std)] extern crate alloc; @@ -131,7 +130,7 @@ pub mod weights; /// Weight info. pub type SelfWeightOf = ::WeightInfo; -/// Collection handle contains information about collection data and id. +/// Collection handle contains information about collection data and id. /// Also provides functionality to count consumed gas. #[must_use = "Should call submit_logs or save, otherwise some data will be lost for evm side"] pub struct CollectionHandle { @@ -208,9 +207,9 @@ impl CollectionHandle { } /// Set collection sponsor. - /// - /// Unique collections allows sponsoring for certain actions. - /// This method allows you to set the sponsor of the collection. + /// + /// Unique collections allows sponsoring for certain actions. + /// This method allows you to set the sponsor of the collection. /// In order for sponsorship to become active, it must be confirmed through [Self::confirm_sponsorship]. pub fn set_sponsor(&mut self, sponsor: T::AccountId) -> DispatchResult { self.collection.sponsorship = SponsorshipState::Unconfirmed(sponsor); @@ -218,7 +217,7 @@ impl CollectionHandle { } /// Confirm sponsorship - /// + /// /// In order for the sponsorship to become active, the user set as the sponsor must confirm their participation. /// Before confirming sponsorship, the user must be specified as the sponsor of the collection via [Self::set_sponsor]. pub fn confirm_sponsorship(&mut self, sender: &T::AccountId) -> Result { @@ -379,13 +378,13 @@ pub mod pallet { /// [CollectionMode] converted into _u8_. u8, /// Collection owner. - T::AccountId + T::AccountId, ), /// New collection was destroyed CollectionDestroyed( /// Globally unique identifier of collection. - CollectionId + CollectionId, ), /// New item was created. @@ -397,7 +396,7 @@ pub mod pallet { /// Owner of newly created item T::CrossAccountId, /// Always 1 for NFT - u128 + u128, ), /// Collection item was burned. @@ -409,7 +408,8 @@ pub mod pallet { /// Which user has destroyed its tokens. T::CrossAccountId, /// Amount of token pieces destroed. Always 1 for NFT. - u128), + u128, + ), /// Item was transferred Transfer( @@ -444,17 +444,17 @@ pub mod pallet { /// Id of collection to which property has been set. CollectionId, /// The property that was set. - PropertyKey + PropertyKey, ), - + /// The property has been deleted. CollectionPropertyDeleted( /// Id of collection to which property has been deleted. CollectionId, /// The property that was deleted. - PropertyKey + PropertyKey, ), - + /// The token property has been set. TokenPropertySet( /// Identifier of the collection whose token has the property set. @@ -462,10 +462,9 @@ pub mod pallet { /// The token for which the property was set. TokenId, /// The property that was set. - PropertyKey + PropertyKey, ), - - + /// The token property has been deleted. TokenPropertyDeleted( /// Identifier of the collection whose token has the property deleted. @@ -473,15 +472,15 @@ pub mod pallet { /// The token for which the property was deleted. TokenId, /// The property that was deleted. - PropertyKey + PropertyKey, ), - + /// The colletion property permission has been set. PropertyPermissionSet( /// Id of collection to which property permission has been set. CollectionId, /// The property permission that was set. - PropertyKey + PropertyKey, ), } @@ -735,7 +734,7 @@ pub mod pallet { impl Pallet { /// Enshure that receiver address is correct. - /// + /// /// Ethereum receiver 0x0000000000000000000000000000000000000000 is reserved, and shouldn't own tokens. pub fn ensure_correct_receiver(receiver: &T::CrossAccountId) -> DispatchResult { ensure!( @@ -886,13 +885,13 @@ macro_rules! limit_default_clone { impl Pallet { /// Create new collection. - /// + /// /// * `owner` - The owner of the collection. /// * `data` - Description of the created collection. /// * `is_external` - Marks that collection managet by not "Unique network". pub fn init_collection( owner: T::CrossAccountId, - data: CreateCollectionData, + data: CreateCollectionData, is_external: bool, ) -> Result { { @@ -991,7 +990,7 @@ impl Pallet { } /// Destroy collection. - /// + /// /// * `collection` - Collection handler. /// * `sender` - The owner or administrator of the collection. pub fn destroy_collection( @@ -1023,7 +1022,7 @@ impl Pallet { } /// Set collection property. - /// + /// /// * `collection` - Collection handler. /// * `sender` - The owner or administrator of the collection. /// * `property` - The property to set. @@ -1046,7 +1045,7 @@ impl Pallet { } /// Set scouped collection property. - /// + /// /// * `collection_id` - ID of the collection for which the property is being set. /// * `scope` - Property scope. /// * `property` - The property to set. @@ -1059,12 +1058,12 @@ impl Pallet { properties.try_scoped_set(scope, property.key, property.value) }) .map_err(>::from)?; - + Ok(()) } - + /// Set scouped collection properties. - /// + /// /// * `collection_id` - ID of the collection for which the properties is being set. /// * `scope` - Property scope. /// * `properties` - The properties to set. @@ -1082,7 +1081,7 @@ impl Pallet { } /// Set collection properties. - /// + /// /// * `collection` - Collection handler. /// * `sender` - The owner or administrator of the collection. /// * `properties` - The properties to set. @@ -1095,12 +1094,12 @@ impl Pallet { for property in properties { Self::set_collection_property(collection, sender, property)?; } - + Ok(()) } - + /// Delete collection property. - /// + /// /// * `collection` - Collection handler. /// * `sender` - The owner or administrator of the collection. /// * `property` - The property to delete. @@ -1110,22 +1109,22 @@ impl Pallet { property_key: PropertyKey, ) -> DispatchResult { collection.check_is_owner_or_admin(sender)?; - + CollectionProperties::::try_mutate(collection.id, |properties| { properties.remove(&property_key) }) .map_err(>::from)?; - + Self::deposit_event(Event::CollectionPropertyDeleted( collection.id, property_key, )); - + Ok(()) } - + /// Delete collection properties. - /// + /// /// * `collection` - Collection handler. /// * `sender` - The owner or administrator of the collection. /// * `properties` - The properties to delete. @@ -1138,14 +1137,14 @@ impl Pallet { for key in property_keys { Self::delete_collection_property(collection, sender, key)?; } - + Ok(()) } - + /// Set collection propetry permission without any checks. - /// + /// /// Used for migrations. - /// + /// /// * `collection` - Collection handler. /// * `property_permissions` - Property permissions. pub fn set_property_permission_unchecked( @@ -1160,7 +1159,7 @@ impl Pallet { } /// Set collection property permission. - /// + /// /// * `collection` - Collection handler. /// * `sender` - The owner or administrator of the collection. /// * `property_permission` - Property permission. @@ -1195,7 +1194,7 @@ impl Pallet { } /// Set token property permission. - /// + /// /// * `collection` - Collection handler. /// * `sender` - The owner or administrator of the collection. /// * `property_permissions` - Property permissions. @@ -1430,12 +1429,12 @@ pub trait CommonWeightInfo { fn burn_item() -> Weight; /// Property setting weight. - /// + /// /// * `amount`- The number of properties to set. fn set_collection_properties(amount: u32) -> Weight; /// Collection property deletion weight. - /// + /// /// * `amount`- The number of properties to set. fn delete_collection_properties(amount: u32) -> Weight; @@ -1445,13 +1444,12 @@ pub trait CommonWeightInfo { fn set_token_properties(amount: u32) -> Weight; /// Token property deletion weight. - /// + /// /// * `amount`- The number of properties to delete. fn delete_token_properties(amount: u32) -> Weight; - - + /// Token property permissions set weight. - /// + /// /// * `amount`- The number of property permissions to set. fn set_token_property_permissions(amount: u32) -> Weight; @@ -1466,21 +1464,21 @@ pub trait CommonWeightInfo { /// The price of burning a token from another user. fn burn_from() -> Weight; - + /// Differs from burn_item in case of Fungible and Refungible, as it should burn /// whole users's balance /// /// This method shouldn't be used directly, as it doesn't count breadth price, use [burn_recursively](CommonWeightInfo::burn_recursively) instead fn burn_recursively_self_raw() -> Weight; - + /// Cost of iterating over `amount` children while burning, without counting child burning itself /// /// This method shouldn't be used directly, as it doesn't count depth price, use [burn_recursively](CommonWeightInfo::burn_recursively) instead fn burn_recursively_breadth_raw(amount: u32) -> Weight; - + /// The price of recursive burning a token. /// - /// `max_selfs` - + /// `max_selfs` - fn burn_recursively(max_selfs: u32, max_breadth: u32) -> Weight { Self::burn_recursively_self_raw() .saturating_mul(max_selfs.max(1) as u64) @@ -1495,12 +1493,12 @@ pub trait RefungibleExtensionsWeightInfo { } /// Common collection operations. -/// +/// /// It wraps methods in Fungible, Nonfungible and Refungible pallets /// and adds weight info. pub trait CommonCollectionOperations { /// Create token. - /// + /// /// * `sender` - The user who mint the token and pays for the transaction. /// * `to` - The user who will own the token. /// * `data` - Token data. @@ -1514,7 +1512,7 @@ pub trait CommonCollectionOperations { ) -> DispatchResultWithPostInfo; /// Create multiple tokens. - /// + /// /// * `sender` - The user who mint the token and pays for the transaction. /// * `to` - The user who will own the token. /// * `data` - Token data. @@ -1526,9 +1524,9 @@ pub trait CommonCollectionOperations { data: Vec, nesting_budget: &dyn Budget, ) -> DispatchResultWithPostInfo; - + /// Create multiple tokens. - /// + /// /// * `sender` - The user who mint the token and pays for the transaction. /// * `to` - The user who will own the token. /// * `data` - Token data. @@ -1541,7 +1539,7 @@ pub trait CommonCollectionOperations { ) -> DispatchResultWithPostInfo; /// Burn token. - /// + /// /// * `sender` - The user who owns the token. /// * `token` - Token id that will burned. /// * `amount` - The number of parts of the token that will be burned. @@ -1551,9 +1549,9 @@ pub trait CommonCollectionOperations { token: TokenId, amount: u128, ) -> DispatchResultWithPostInfo; - + /// Burn token and all nested tokens recursievly. - /// + /// /// * `sender` - The user who owns the token. /// * `token` - Token id that will burned. /// * `self_budget` - The budget that can be spent on burning tokens. @@ -1567,7 +1565,7 @@ pub trait CommonCollectionOperations { ) -> DispatchResultWithPostInfo; /// Set collection properties. - /// + /// /// * `sender` - Must be either the owner of the collection or its admin. /// * `properties` - Properties to be set. fn set_collection_properties( @@ -1577,7 +1575,7 @@ pub trait CommonCollectionOperations { ) -> DispatchResultWithPostInfo; /// Delete collection properties. - /// + /// /// * `sender` - Must be either the owner of the collection or its admin. /// * `properties` - The properties to be removed. fn delete_collection_properties( @@ -1587,11 +1585,11 @@ pub trait CommonCollectionOperations { ) -> DispatchResultWithPostInfo; /// Set token properties. - /// - /// The appropriate [PropertyPermission] for the token property + /// + /// The appropriate [PropertyPermission] for the token property /// must be set with [Self::set_token_property_permissions]. - /// - /// * `sender` - Must be either the owner of the token or its admin. + /// + /// * `sender` - Must be either the owner of the token or its admin. /// * `token_id` - The token for which the properties are being set. /// * `properties` - Properties to be set. /// * `budget` - Budget for setting properties. @@ -1604,11 +1602,11 @@ pub trait CommonCollectionOperations { ) -> DispatchResultWithPostInfo; /// Remove token properties. - /// - /// The appropriate [PropertyPermission] for the token property + /// + /// The appropriate [PropertyPermission] for the token property /// must be set with [Self::set_token_property_permissions]. - /// - /// * `sender` - Must be either the owner of the token or its admin. + /// + /// * `sender` - Must be either the owner of the token or its admin. /// * `token_id` - The token for which the properties are being remove. /// * `property_keys` - Keys to remove corresponding properties. /// * `budget` - Budget for removing properties. @@ -1621,8 +1619,8 @@ pub trait CommonCollectionOperations { ) -> DispatchResultWithPostInfo; /// Set token property permissions. - /// - /// * `sender` - Must be either the owner of the token or its admin. + /// + /// * `sender` - Must be either the owner of the token or its admin. /// * `token_id` - The token for which the properties are being set. /// * `properties` - Properties to be set. /// * `budget` - Budget for setting properties. @@ -1633,7 +1631,7 @@ pub trait CommonCollectionOperations { ) -> DispatchResultWithPostInfo; /// Transfer amount of token pieces. - /// + /// /// * `sender` - Donor user. /// * `to` - Recepient user. /// * `token` - The token of which parts are being sent. @@ -1649,7 +1647,7 @@ pub trait CommonCollectionOperations { ) -> DispatchResultWithPostInfo; /// Grant access to another account to transfer parts of the token owned by the calling user via [Self::transfer_from]. - /// + /// /// * `sender` - The user who grants access to the token. /// * `spender` - The user to whom the rights are granted. /// * `token` - The token to which access is granted. @@ -1661,11 +1659,11 @@ pub trait CommonCollectionOperations { token: TokenId, amount: u128, ) -> DispatchResultWithPostInfo; - + /// Send parts of a token owned by another user. - /// + /// /// Before calling this method, you must grant rights to the calling user via [Self::approve]. - /// + /// /// * `sender` - The user who has access to the token. /// * `from` - The user who owns the token. /// * `to` - Recepient user. @@ -1681,11 +1679,11 @@ pub trait CommonCollectionOperations { amount: u128, budget: &dyn Budget, ) -> DispatchResultWithPostInfo; - + /// Burn parts of a token owned by another user. - /// + /// /// Before calling this method, you must grant rights to the calling user via [Self::approve]. - /// + /// /// * `sender` - The user who has access to the token. /// * `from` - The user who owns the token. /// * `token` - The token of which parts are being sent. @@ -1701,7 +1699,7 @@ pub trait CommonCollectionOperations { ) -> DispatchResultWithPostInfo; /// Check permission to nest token. - /// + /// /// * `sender` - The user who initiated the check. /// * `from` - The token that is checked for embedding. /// * `under` - Token under which to check. @@ -1715,19 +1713,19 @@ pub trait CommonCollectionOperations { ) -> DispatchResult; /// Nest one token into another. - /// + /// /// * `under` - Token holder. /// * `to_nest` - Nested token. fn nest(&self, under: TokenId, to_nest: (CollectionId, TokenId)); /// Unnest token. - /// + /// /// * `under` - Token holder. /// * `to_nest` - Token to unnest. fn unnest(&self, under: TokenId, to_nest: (CollectionId, TokenId)); /// Get all user tokens. - /// + /// /// * `account` - Account for which you need to get tokens. fn account_tokens(&self, account: T::CrossAccountId) -> Vec; @@ -1735,7 +1733,7 @@ pub trait CommonCollectionOperations { fn collection_tokens(&self) -> Vec; /// Check if the token exists. - /// + /// /// * `token` - Id token to check. fn token_exists(&self, token: TokenId) -> bool; @@ -1743,18 +1741,18 @@ pub trait CommonCollectionOperations { fn last_token_id(&self) -> TokenId; /// Get the owner of the token. - /// + /// /// * `token` - The token for which you need to find out the owner. fn token_owner(&self, token: TokenId) -> Option; /// Get the value of the token property by key. - /// + /// /// * `token` - Token property to get. /// * `key` - Property name. fn token_property(&self, token_id: TokenId, key: &PropertyKey) -> Option; /// Get a set of token properties by key vector. - /// + /// /// * `token` - Token property to get. /// * `keys` - Vector of keys. If this parameter is [None](sp_std::result::Result), /// then all properties are returned. @@ -1764,7 +1762,7 @@ pub trait CommonCollectionOperations { fn total_supply(&self) -> u32; /// Amount of different tokens account has. - /// + /// /// * `account` - The account for which need to get the balance. fn account_balance(&self, account: T::CrossAccountId) -> u32; @@ -1775,7 +1773,7 @@ pub trait CommonCollectionOperations { fn total_pieces(&self, token: TokenId) -> Option; /// Get the number of parts of the token that a trusted user can manage. - /// + /// /// * `sender` - Trusted user. /// * `spender` - Owner of the token. /// * `token` - The token for which to get the value. @@ -1796,9 +1794,9 @@ where T: Config, { /// Change the number of parts of the token. - /// + /// /// When the value changes down, this function is equivalent to burning parts of the token. - /// + /// /// * `sender` - The user calling the repartition operation. Must be the owner of the token. /// * `token` - The token for which you want to change the number of parts. /// * `amount` - The new value of the parts of the token. @@ -1811,7 +1809,7 @@ where } /// Merge [DispatchResult] with [Weight] into [DispatchResultWithPostInfo]. -/// +/// /// Used for [CommonCollectionOperations] implementations and flexible enough to do so. pub fn with_weight(res: DispatchResult, weight: Weight) -> DispatchResultWithPostInfo { let post_info = PostDispatchInfo { From bd8881ff8a0c3647c25bcc44d3cb150b077b8883 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 23 Jun 2022 13:54:44 +0000 Subject: [PATCH 0028/1274] Add properties to RFT pallet --- pallets/refungible/src/lib.rs | 179 +++++++++++++++++++++++++++++++++- 1 file changed, 177 insertions(+), 2 deletions(-) diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index fd07b9d484..6cd0b69d51 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -87,13 +87,14 @@ #![cfg_attr(not(feature = "std"), no_std)] -use frame_support::{ensure, BoundedVec}; +use frame_support::{ensure, BoundedVec, transactional}; use up_data_structs::{ AccessMode, CollectionId, CustomDataLimit, MAX_REFUNGIBLE_PIECES, TokenId, CreateCollectionData, CreateRefungibleExData, mapping::TokenAddressMapping, budget::Budget, + Property, PropertyScope, TrySetProperty, PropertyKey, PropertyPermission }; use pallet_evm::account::CrossAccountId; -use pallet_common::{Error as CommonError, Event as CommonEvent, Pallet as PalletCommon}; +use pallet_common::{Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, CommonCollectionOperations as _}; use pallet_structure::Pallet as PalletStructure; use sp_runtime::{ArithmeticError, DispatchError, DispatchResult}; use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap}; @@ -175,6 +176,15 @@ pub mod pallet { QueryKind = ValueQuery, >; + #[pallet::storage] + #[pallet::getter(fn token_properties)] + pub type TokenProperties = StorageNMap< + Key = (Key, Key), + Value = up_data_structs::Properties, + QueryKind = ValueQuery, + OnEmpty = up_data_structs::TokenProperties, + >; + /// Total amount of pieces for token #[pallet::storage] pub type TotalSupply = StorageNMap< @@ -278,6 +288,34 @@ impl Pallet { pub fn token_exists(collection: &RefungibleHandle, token: TokenId) -> bool { >::contains_key((collection.id, token)) } + + pub fn set_scoped_token_property( + collection_id: CollectionId, + token_id: TokenId, + scope: PropertyScope, + property: Property, + ) -> DispatchResult { + TokenProperties::::try_mutate((collection_id, token_id), |properties| { + properties.try_scoped_set(scope, property.key, property.value) + }) + .map_err(>::from)?; + + Ok(()) + } + + pub fn set_scoped_token_properties( + collection_id: CollectionId, + token_id: TokenId, + scope: PropertyScope, + properties: impl Iterator, + ) -> DispatchResult { + TokenProperties::::try_mutate((collection_id, token_id), |stored_properties| { + stored_properties.try_scoped_set_from_iter(scope, properties) + }) + .map_err(>::from)?; + + Ok(()) + } } // unchecked calls skips any permission checks @@ -339,6 +377,7 @@ impl Pallet { >::insert(collection.id, burnt); >::remove((collection.id, token_id)); + >::remove((collection.id, token_id)); >::remove((collection.id, token_id)); >::remove_prefix((collection.id, token_id), None); >::remove_prefix((collection.id, token_id), None); @@ -427,6 +466,142 @@ impl Pallet { Ok(()) } + pub fn set_token_property( + collection: &RefungibleHandle, + sender: &T::CrossAccountId, + token_id: TokenId, + property: Property, + is_token_create: bool, + ) -> DispatchResult { + Self::check_token_change_permission( + collection, + sender, + token_id, + &property.key, + is_token_create, + )?; + + >::try_mutate((collection.id, token_id), |properties| { + let property = property.clone(); + properties.try_set(property.key, property.value) + }) + .map_err(>::from)?; + + >::deposit_event(CommonEvent::TokenPropertySet( + collection.id, + token_id, + property.key, + )); + + Ok(()) + } + + #[transactional] + pub fn set_token_properties( + collection: &RefungibleHandle, + sender: &T::CrossAccountId, + token_id: TokenId, + properties: Vec, + is_token_create: bool, + ) -> DispatchResult { + for property in properties { + Self::set_token_property(collection, sender, token_id, property, is_token_create)?; + } + + Ok(()) + } + + pub fn delete_token_property( + collection: &RefungibleHandle, + sender: &T::CrossAccountId, + token_id: TokenId, + property_key: PropertyKey, + ) -> DispatchResult { + Self::check_token_change_permission(collection, sender, token_id, &property_key, false)?; + + >::try_mutate((collection.id, token_id), |properties| { + properties.remove(&property_key) + }) + .map_err(>::from)?; + + >::deposit_event(CommonEvent::TokenPropertyDeleted( + collection.id, + token_id, + property_key, + )); + + Ok(()) + } + + fn check_token_change_permission( + collection: &RefungibleHandle, + sender: &T::CrossAccountId, + token_id: TokenId, + property_key: &PropertyKey, + is_token_create: bool, + ) -> DispatchResult { + let permission = >::property_permissions(collection.id) + .get(property_key) + .cloned() + .unwrap_or_else(PropertyPermission::none); + + // Not "try_fold" because total count of pieces is limited by 'MAX_REFUNGIBLE_PIECES'. + let total_pieces: u128 = >::iter_prefix((collection.id, token_id,)).fold(0, |total, piece| total + piece.1); + let balance = collection.balance(sender.clone(), token_id); + + let check_token_owner = || -> DispatchResult { + ensure!(balance == total_pieces, >::NoPermission); + Ok(()) + }; + + let is_property_exists = TokenProperties::::get((collection.id, token_id)) + .get(property_key) + .is_some(); + + match permission { + PropertyPermission { mutable: false, .. } if is_property_exists => { + Err(>::NoPermission.into()) + } + + PropertyPermission { + collection_admin, + token_owner, + .. + } => { + //TODO: investigate threats during public minting. + if is_token_create && (collection_admin || token_owner) { + return Ok(()); + } + + let mut check_result = Err(>::NoPermission.into()); + + if collection_admin { + check_result = collection.check_is_owner_or_admin(sender); + } + + if token_owner { + check_result.or_else(|_| check_token_owner()) + } else { + check_result + } + } + } + } + + #[transactional] + pub fn delete_token_properties( + collection: &RefungibleHandle, + sender: &T::CrossAccountId, + token_id: TokenId, + property_keys: Vec, + ) -> DispatchResult { + for key in property_keys { + Self::delete_token_property(collection, sender, token_id, key)?; + } + + Ok(()) + } + /// Transfer RFT token pieces from one account to another. /// /// If the sender is no longer owns any pieces after the `transfer` than she stops being an owner of the token. From 956d7c163224346019ae7c934e90e6846f40ccf3 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 24 Jun 2022 11:42:45 +0000 Subject: [PATCH 0029/1274] CORE-410 Setup properties at creation items --- pallets/refungible/src/common.rs | 1 + pallets/refungible/src/lib.rs | 61 +++++++++++++++++++-------- primitives/data-structs/src/lib.rs | 7 +++ tests/src/createMultipleItems.test.ts | 28 ++++++++---- 4 files changed, 71 insertions(+), 26 deletions(-) diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index 0b5da73b43..5508c20365 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -140,6 +140,7 @@ fn map_create_data( out.insert(to.clone(), data.pieces); out.try_into().expect("limit > 0") }, + properties: data.properties, }), _ => fail!(>::NotRefungibleDataUsedToMintFungibleCollectionToken), } diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 6cd0b69d51..2ca3f3c63f 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -87,7 +87,7 @@ #![cfg_attr(not(feature = "std"), no_std)] -use frame_support::{ensure, BoundedVec, transactional}; +use frame_support::{ensure, BoundedVec, transactional, storage::with_transaction}; use up_data_structs::{ AccessMode, CollectionId, CustomDataLimit, MAX_REFUNGIBLE_PIECES, TokenId, CreateCollectionData, CreateRefungibleExData, mapping::TokenAddressMapping, budget::Budget, @@ -96,7 +96,7 @@ use up_data_structs::{ use pallet_evm::account::CrossAccountId; use pallet_common::{Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, CommonCollectionOperations as _}; use pallet_structure::Pallet as PalletStructure; -use sp_runtime::{ArithmeticError, DispatchError, DispatchResult}; +use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome}; use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap}; use core::ops::Deref; use codec::{Encode, Decode, MaxEncodedLen}; @@ -804,32 +804,57 @@ impl Pallet { // ========= + with_transaction(|| { + for (i, data) in data.iter().enumerate() { + let token_id = first_token_id + i as u32 + 1; + >::insert((collection.id, token_id), totals[i]); + + >::insert( + (collection.id, token_id), + ItemData { + const_data: data.const_data.clone(), + }, + ); + + for (user, amount) in data.users.iter() { + if *amount == 0 { + continue; + } + >::insert((collection.id, token_id, &user), amount); + >::insert((collection.id, &user, TokenId(token_id)), true); + >::nest_if_sent_to_token_unchecked( + user, + collection.id, + TokenId(token_id), + ); + } + + if let Err(e) = Self::set_token_properties( + collection, + sender, + TokenId(token_id), + data.properties.clone().into_inner(), + true, + ) { + return TransactionOutcome::Rollback(Err(e)); + } + } + TransactionOutcome::Commit(Ok(())) + })?; + >::insert(collection.id, tokens_minted); + for (account, balance) in balances { >::insert((collection.id, account), balance); } + for (i, token) in data.into_iter().enumerate() { let token_id = first_token_id + i as u32 + 1; - >::insert((collection.id, token_id), totals[i]); - - >::insert( - (collection.id, token_id), - ItemData { - const_data: token.const_data, - }, - ); for (user, amount) in token.users.into_iter() { if amount == 0 { continue; - } - >::insert((collection.id, token_id, &user), amount); - >::insert((collection.id, &user, TokenId(token_id)), true); - >::nest_if_sent_to_token_unchecked( - &user, - collection.id, - TokenId(token_id), - ); + } // TODO: ERC20 transfer event >::deposit_event(CommonEvent::ItemCreated( diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 3bd999d856..d5271128a8 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -534,7 +534,12 @@ pub struct CreateReFungibleData { #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))] #[derivative(Debug(format_with = "bounded::vec_debug"))] pub const_data: BoundedVec, + pub pieces: u128, + + #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))] + #[derivative(Debug(format_with = "bounded::vec_debug"))] + pub properties: CollectionPropertiesVec, } #[derive(Encode, Decode, Debug, Clone, PartialEq, TypeInfo, MaxEncodedLen)] @@ -568,6 +573,8 @@ pub struct CreateRefungibleExData { pub const_data: BoundedVec, #[derivative(Debug(format_with = "bounded::map_debug"))] pub users: BoundedBTreeMap>, + #[derivative(Debug(format_with = "bounded::vec_debug"))] + pub properties: CollectionPropertiesVec, } #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] diff --git a/tests/src/createMultipleItems.test.ts b/tests/src/createMultipleItems.test.ts index f1a7d88540..5de1ae5b35 100644 --- a/tests/src/createMultipleItems.test.ts +++ b/tests/src/createMultipleItems.test.ts @@ -376,14 +376,26 @@ describe('Negative Integration Test createMultipleItems(collection_id, owner, it // ReFungible const collectionIdReFungible = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const argsReFungible = [ - {ReFungible: ['1'.repeat(2049), 10]}, - {ReFungible: ['2'.repeat(2049), 10]}, - {ReFungible: ['3'.repeat(2049), 10]}, - ]; - const createMultipleItemsTxFungible = api.tx.unique - .createMultipleItems(collectionIdReFungible, normalizeAccountId(alice.address), argsReFungible); - await expect(submitTransactionExpectFailAsync(alice, createMultipleItemsTxFungible)).to.be.rejected; + { + const argsReFungible = [ + {ReFungible: ['1'.repeat(2049), 10, []]}, + {ReFungible: ['2'.repeat(2049), 10, []]}, + {ReFungible: ['3'.repeat(2049), 10, []]}, + ]; + const createMultipleItemsTxFungible = api.tx.unique + .createMultipleItems(collectionIdReFungible, normalizeAccountId(alice.address), argsReFungible); + await expect(submitTransactionExpectFailAsync(alice, createMultipleItemsTxFungible)).to.be.rejected; + } + { + const argsReFungible = [ + {ReFungible: {properties: [{key: 'key', value: 'A'.repeat(32769)}]}}, + {ReFungible: {properties: [{key: 'key', value: 'B'.repeat(32769)}]}}, + {ReFungible: {properties: [{key: 'key', value: 'C'.repeat(32769)}]}}, + ]; + const createMultipleItemsTxFungible = api.tx.unique + .createMultipleItems(collectionIdReFungible, normalizeAccountId(alice.address), argsReFungible); + await expect(submitTransactionExpectFailAsync(alice, createMultipleItemsTxFungible)).to.be.rejected; + } }); }); From c4e0a12cf681fb6080d6500015a88e020a96f8d9 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 27 Jun 2022 14:23:07 +0000 Subject: [PATCH 0030/1274] CORE-410 Add test for collection properties --- tests/src/refungible.test.ts | 55 +++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 72890520d7..303a23b10b 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {default as usingApi} from './substrate/substrate-api'; +import {default as usingApi, executeTransaction} from './substrate/substrate-api'; import {IKeyringPair} from '@polkadot/types/types'; import { createCollectionExpectSuccess, @@ -30,6 +30,8 @@ import { transfer, burnItem, repartitionRFT, + createCollectionWithPropsExpectSuccess, + getDetailedCollectionInfo, } from './util/helpers'; import chai from 'chai'; @@ -187,3 +189,54 @@ describe('integration test: Refungible functionality:', () => { }); }); }); + +describe('Test Refungible properties:', () => { + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + alice = privateKeyWrapper('//Alice'); + bob = privateKeyWrapper('//Bob'); + }); + }); + + it('Сreate new collection with properties', async () => { + await usingApi(async api => { + const properties = [{key: 'key1', value: 'val1'}]; + const propertyPermissions = [{key: 'key1', permission: {tokenOwner: true, mutable: false, collectionAdmin: true}}]; + const collectionId = await createCollectionWithPropsExpectSuccess({name: 'A', description: 'B', tokenPrefix: 'C', mode: {type: 'ReFungible'}, + properties: properties, + propPerm: propertyPermissions, + }); + const collection = (await getDetailedCollectionInfo(api, collectionId))!; + expect(collection.properties.toHuman()).to.be.deep.equal(properties); + expect(collection.tokenPropertyPermissions.toHuman()).to.be.deep.equal(propertyPermissions); + }); + }); + + it.only('Set properties for exist collection', async () => { + await usingApi(async api => { + const collectionId = await createCollectionExpectSuccess({name: 'A', description: 'B', tokenPrefix: 'C', mode: {type: 'ReFungible'}, + }); + + const properties = [{key: 'key1', value: 'val1'}]; + // await expect(executeTransaction( + // api, + // alice, + // api.tx.unique.setCollectionProperties(collectionId, properties), + // )).to.not.be.rejected; + + const propertyPermissions = [ + {key: 'key1', permission: {collectionAdmin: true, mutable: false, tokenOwner: true}}, + {key: 'key2', permission: {collectionAdmin: false, mutable: true, tokenOwner: false}}, + ]; + await expect(executeTransaction( + api, + alice, + api.tx.unique.setTokenPropertyPermissions(collectionId, propertyPermissions), + )).to.not.be.rejected; + + const collection = (await getDetailedCollectionInfo(api, collectionId))!; + expect(collection.properties.toHuman()).to.be.deep.equal(properties); + expect(collection.tokenPropertyPermissions.toHuman()).to.be.deep.equal(propertyPermissions); + }); + }); +}); From 73d9a3eafd0edc83c9f3220da7c582092c265abd Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 28 Jun 2022 07:30:30 +0000 Subject: [PATCH 0031/1274] CORE-410 Set collection properties for exist collection --- pallets/refungible/src/common.rs | 60 +++++++++++++++++++++++--------- pallets/refungible/src/lib.rs | 26 +++++++++++++- tests/src/refungible.test.ts | 17 +++++---- 3 files changed, 78 insertions(+), 25 deletions(-) diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index 5508c20365..c155f26852 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -298,46 +298,72 @@ impl CommonCollectionOperations for RefungibleHandle { fn set_collection_properties( &self, - _sender: T::CrossAccountId, - _property: Vec, + sender: T::CrossAccountId, + properties: Vec, ) -> DispatchResultWithPostInfo { - fail!(>::SettingPropertiesNotAllowed) + let weight = >::set_collection_properties(properties.len() as u32); + + with_weight( + >::set_collection_properties(self, &sender, properties), + weight, + ) } fn delete_collection_properties( &self, - _sender: &T::CrossAccountId, - _property_keys: Vec, + sender: &T::CrossAccountId, + property_keys: Vec, ) -> DispatchResultWithPostInfo { - fail!(>::SettingPropertiesNotAllowed) + let weight = >::delete_collection_properties(property_keys.len() as u32); + + with_weight( + >::delete_collection_properties(self, sender, property_keys), + weight, + ) } fn set_token_properties( &self, - _sender: T::CrossAccountId, - _token_id: TokenId, - _property: Vec, + sender: T::CrossAccountId, + token_id: TokenId, + properties: Vec, _nesting_budget: &dyn Budget, ) -> DispatchResultWithPostInfo { - fail!(>::SettingPropertiesNotAllowed) + let weight = >::set_token_properties(properties.len() as u32); + + with_weight( + >::set_token_properties(self, &sender, token_id, properties, false), + weight, + ) } fn set_token_property_permissions( &self, - _sender: &T::CrossAccountId, - _property_permissions: Vec, + sender: &T::CrossAccountId, + property_permissions: Vec, ) -> DispatchResultWithPostInfo { - fail!(>::SettingPropertiesNotAllowed) + let weight = + >::set_token_property_permissions(property_permissions.len() as u32); + + with_weight( + >::set_token_property_permissions(self, sender, property_permissions), + weight, + ) } fn delete_token_properties( &self, - _sender: T::CrossAccountId, - _token_id: TokenId, - _property_keys: Vec, + sender: T::CrossAccountId, + token_id: TokenId, + property_keys: Vec, _nesting_budget: &dyn Budget, ) -> DispatchResultWithPostInfo { - fail!(>::SettingPropertiesNotAllowed) + let weight = >::delete_token_properties(property_keys.len() as u32); + + with_weight( + >::delete_token_properties(self, &sender, token_id, property_keys), + weight, + ) } fn check_nesting( diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 2ca3f3c63f..cc78a82d33 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -91,7 +91,7 @@ use frame_support::{ensure, BoundedVec, transactional, storage::with_transaction use up_data_structs::{ AccessMode, CollectionId, CustomDataLimit, MAX_REFUNGIBLE_PIECES, TokenId, CreateCollectionData, CreateRefungibleExData, mapping::TokenAddressMapping, budget::Budget, - Property, PropertyScope, TrySetProperty, PropertyKey, PropertyPermission + Property, PropertyScope, TrySetProperty, PropertyKey, PropertyPermission, PropertyKeyPermission }; use pallet_evm::account::CrossAccountId; use pallet_common::{Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, CommonCollectionOperations as _}; @@ -1064,4 +1064,28 @@ impl Pallet { fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option { >::try_get((collection_id, token_id)).ok() } + + pub fn set_collection_properties( + collection: &RefungibleHandle, + sender: &T::CrossAccountId, + properties: Vec, + ) -> DispatchResult { + >::set_collection_properties(collection, sender, properties) + } + + pub fn delete_collection_properties( + collection: &RefungibleHandle, + sender: &T::CrossAccountId, + property_keys: Vec, + ) -> DispatchResult { + >::delete_collection_properties(collection, sender, property_keys) + } + + pub fn set_token_property_permissions( + collection: &RefungibleHandle, + sender: &T::CrossAccountId, + property_permissions: Vec, + ) -> DispatchResult { + >::set_token_property_permissions(collection, sender, property_permissions) + } } diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 303a23b10b..ea3ef0ef19 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -212,17 +212,20 @@ describe('Test Refungible properties:', () => { }); }); - it.only('Set properties for exist collection', async () => { + it('Set properties for exist collection', async () => { await usingApi(async api => { const collectionId = await createCollectionExpectSuccess({name: 'A', description: 'B', tokenPrefix: 'C', mode: {type: 'ReFungible'}, }); - const properties = [{key: 'key1', value: 'val1'}]; - // await expect(executeTransaction( - // api, - // alice, - // api.tx.unique.setCollectionProperties(collectionId, properties), - // )).to.not.be.rejected; + const properties = [ + {key: 'key1', value: 'val1'}, + {key: 'key2', value: 'val2'}, + ]; + await expect(executeTransaction( + api, + alice, + api.tx.unique.setCollectionProperties(collectionId, properties), + )).to.not.be.rejected; const propertyPermissions = [ {key: 'key1', permission: {collectionAdmin: true, mutable: false, tokenOwner: true}}, From 51bba919a075d01d3c4cad5e2bd843a3f0a7c0f0 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 29 Jun 2022 07:08:09 +0000 Subject: [PATCH 0032/1274] CORE-410 Adapt collection properties tests for ReFungible collections --- pallets/common/src/lib.rs | 2 +- tests/src/nesting/properties.test.ts | 266 ++++++++++++++++++--------- tests/src/refungible.test.ts | 31 ---- tests/src/util/helpers.ts | 2 +- 4 files changed, 182 insertions(+), 119 deletions(-) diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 5055b78cdd..ad62bebd90 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -833,7 +833,7 @@ impl Pallet { ), ); ::Currency::settle( - &owner.as_sub(), + owner.as_sub(), imbalance, WithdrawReasons::TRANSFER, ExistenceRequirement::KeepAlive, diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index ab0a88ee65..9fbedff254 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -2,6 +2,7 @@ import {expect} from 'chai'; import usingApi, {executeTransaction} from '../substrate/substrate-api'; import { addCollectionAdminExpectSuccess, + CollectionMode, createCollectionExpectSuccess, setCollectionPermissionsExpectSuccess, createItemExpectSuccess, @@ -23,9 +24,9 @@ describe('Composite Properties Test', () => { }); }); - it('Makes sure collectionById supplies required fields', async () => { + async function testMakeSureSuppliesRequired(mode: CollectionMode) { await usingApi(async api => { - const collectionId = await createCollectionExpectSuccess(); + const collectionId = await createCollectionExpectSuccess({mode: mode}); const collectionOption = await api.rpc.unique.collectionById(collectionId); expect(collectionOption.isSome).to.be.true; @@ -57,6 +58,14 @@ describe('Composite Properties Test', () => { expect(collection.tokenPropertyPermissions.toHuman()).to.be.deep.equal(propertyPermissions); expect(collection.properties.toHuman()).to.be.deep.equal(collectionProperties); }); + } + + it('Makes sure collectionById supplies required fields for NFT', async () => { + await testMakeSureSuppliesRequired({type: 'NFT'}); + }); + + it('Makes sure collectionById supplies required fields for ReFungible', async () => { + await testMakeSureSuppliesRequired({type: 'ReFungible'}); }); }); @@ -79,9 +88,10 @@ describe('Integration Test: Collection Properties', () => { }); }); - it('Sets properties for a collection', async () => { + + async function testSetsPropertiesForCollection(mode: string) { await usingApi(async api => { - const events = await executeTransaction(api, bob, api.tx.unique.createCollectionEx({mode: 'NFT'})); + const events = await executeTransaction(api, bob, api.tx.unique.createCollectionEx({mode: mode})); const {collectionId} = getCreateCollectionResult(events); // As owner @@ -106,48 +116,54 @@ describe('Integration Test: Collection Properties', () => { {key: 'black_hole', value: ''}, ]); }); + } + it('Sets properties for a NFT collection', async () => { + await testSetsPropertiesForCollection('NFT'); + }); + it('Sets properties for a ReFungible collection', async () => { + await testSetsPropertiesForCollection('ReFungible'); }); - it('Check valid names for collection properties keys', async () => { + async function testCheckValidNames(mode: string) { await usingApi(async api => { - const events = await executeTransaction(api, bob, api.tx.unique.createCollectionEx({mode: 'NFT'})); + const events = await executeTransaction(api, bob, api.tx.unique.createCollectionEx({mode: mode})); const {collectionId} = getCreateCollectionResult(events); - + // alpha symbols await expect(executeTransaction( api, bob, api.tx.unique.setCollectionProperties(collectionId, [{key: 'alpha'}]), )).to.not.be.rejected; - + // numeric symbols await expect(executeTransaction( api, bob, api.tx.unique.setCollectionProperties(collectionId, [{key: '123'}]), )).to.not.be.rejected; - + // underscore symbol await expect(executeTransaction( api, bob, api.tx.unique.setCollectionProperties(collectionId, [{key: 'black_hole'}]), )).to.not.be.rejected; - + // dash symbol await expect(executeTransaction( api, bob, api.tx.unique.setCollectionProperties(collectionId, [{key: 'semi-automatic'}]), )).to.not.be.rejected; - + // underscore symbol await expect(executeTransaction( api, bob, api.tx.unique.setCollectionProperties(collectionId, [{key: 'build.rs'}]), )).to.not.be.rejected; - + const propertyKeys = ['alpha', '123', 'black_hole', 'semi-automatic', 'build.rs']; const properties = (await api.rpc.unique.collectionProperties(collectionId, propertyKeys)).toHuman(); expect(properties).to.be.deep.equal([ @@ -158,54 +174,72 @@ describe('Integration Test: Collection Properties', () => { {key: 'build.rs', value: ''}, ]); }); + } + it('Check valid names for NFT collection properties keys', async () => { + await testCheckValidNames('NFT'); + }); + it('Check valid names for ReFungible collection properties keys', async () => { + await testCheckValidNames('ReFungible'); }); - it('Changes properties of a collection', async () => { + async function testChangesProperties(mode: CollectionMode) { await usingApi(async api => { - const collection = await createCollectionExpectSuccess(); - + const collection = await createCollectionExpectSuccess({mode: mode}); + await expect(executeTransaction( api, alice, api.tx.unique.setCollectionProperties(collection, [{key: 'electron', value: 'come bond'}, {key: 'black_hole'}]), )).to.not.be.rejected; - + // Mutate the properties await expect(executeTransaction( api, alice, api.tx.unique.setCollectionProperties(collection, [{key: 'electron', value: 'bonded'}, {key: 'black_hole', value: 'LIGO'}]), )).to.not.be.rejected; - + const properties = (await api.rpc.unique.collectionProperties(collection, ['electron', 'black_hole'])).toHuman(); expect(properties).to.be.deep.equal([ {key: 'electron', value: 'bonded'}, {key: 'black_hole', value: 'LIGO'}, ]); }); + } + it('Changes properties of a NFT collection', async () => { + await testChangesProperties({type: 'NFT'}); + }); + it('Changes properties of a ReFungible collection', async () => { + await testChangesProperties({type: 'ReFungible'}); }); - it('Deletes properties of a collection', async () => { + async function testDeleteProperties(mode: CollectionMode) { await usingApi(async api => { - const collection = await createCollectionExpectSuccess(); - + const collection = await createCollectionExpectSuccess({mode: mode}); + await expect(executeTransaction( api, alice, api.tx.unique.setCollectionProperties(collection, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: 'LIGO'}]), )).to.not.be.rejected; - + await expect(executeTransaction( api, alice, api.tx.unique.deleteCollectionProperties(collection, ['electron']), )).to.not.be.rejected; - + const properties = (await api.rpc.unique.collectionProperties(collection, ['electron', 'black_hole'])).toHuman(); expect(properties).to.be.deep.equal([ {key: 'black_hole', value: 'LIGO'}, ]); - }); + }); + } + it('Deletes properties of a NFT collection', async () => { + await testDeleteProperties({type: 'NFT'}); + }); + it('Deletes properties of a ReFungible collection', async () => { + await testDeleteProperties({type: 'ReFungible'}); }); }); @@ -217,10 +251,10 @@ describe('Negative Integration Test: Collection Properties', () => { }); }); - it('Fails to set properties in a collection if not its onwer/administrator', async () => { + async function testFailsSetPropertiesIfNotOwnerOrAdmin(mode: CollectionMode) { await usingApi(async api => { - const collection = await createCollectionExpectSuccess(); - + const collection = await createCollectionExpectSuccess({mode: mode}); + await expect(executeTransaction( api, bob, @@ -230,14 +264,20 @@ describe('Negative Integration Test: Collection Properties', () => { const properties = (await api.query.common.collectionProperties(collection)).toJSON(); expect(properties.map).to.be.empty; expect(properties.consumedSpace).to.equal(0); - }); + }); + } + it('Fails to set properties in a NFT collection if not its onwer/administrator', async () => { + await testFailsSetPropertiesIfNotOwnerOrAdmin({type: 'NFT'}); + }); + it('Fails to set properties in a ReFungible collection if not its onwer/administrator', async () => { + await testFailsSetPropertiesIfNotOwnerOrAdmin({type: 'ReFungible'}); }); - it('Fails to set properties that exceed the limits', async () => { + async function testFailsSetPropertiesThatExeedLimits(mode: CollectionMode) { await usingApi(async api => { - const collection = await createCollectionExpectSuccess(); + const collection = await createCollectionExpectSuccess({mode: mode}); const spaceLimit = (await api.query.common.collectionProperties(collection)).toJSON().spaceLimit as number; - + // Mute the general tx parsing error, too many bytes to process { console.error = () => {}; @@ -247,10 +287,10 @@ describe('Negative Integration Test: Collection Properties', () => { api.tx.unique.setCollectionProperties(collection, [{key: 'electron', value: 'low high '.repeat(Math.ceil(spaceLimit! / 9))}]), )).to.be.rejected; } - + let properties = (await api.rpc.unique.collectionProperties(collection, ['electron'])).toJSON(); expect(properties).to.be.empty; - + await expect(executeTransaction( api, alice, @@ -259,16 +299,22 @@ describe('Negative Integration Test: Collection Properties', () => { {key: 'black_hole', value: '0'.repeat(Math.ceil(spaceLimit! / 2))}, ]), )).to.be.rejectedWith(/common\.NoSpaceForProperty/); - + properties = (await api.rpc.unique.collectionProperties(collection, ['electron', 'black hole'])).toJSON(); expect(properties).to.be.empty; - }); + }); + } + it('Fails to set properties that exceed the limits (NFT)', async () => { + await testFailsSetPropertiesThatExeedLimits({type: 'NFT'}); + }); + it('Fails to set properties that exceed the limits (ReFungible)', async () => { + await testFailsSetPropertiesThatExeedLimits({type: 'ReFungible'}); }); - it('Fails to set more properties than it is allowed', async () => { + async function testFailsSetMorePropertiesThanAllowed(mode: CollectionMode) { await usingApi(async api => { - const collection = await createCollectionExpectSuccess(); - + const collection = await createCollectionExpectSuccess({mode: mode}); + const propertiesToBeSet = []; for (let i = 0; i < 65; i++) { propertiesToBeSet.push({ @@ -276,29 +322,35 @@ describe('Negative Integration Test: Collection Properties', () => { value: Math.random() > 0.5 ? 'high' : 'low', }); } - + await expect(executeTransaction( api, alice, api.tx.unique.setCollectionProperties(collection, propertiesToBeSet), )).to.be.rejectedWith(/common\.PropertyLimitReached/); - + const properties = (await api.query.common.collectionProperties(collection)).toJSON(); expect(properties.map).to.be.empty; expect(properties.consumedSpace).to.equal(0); - }); + }); + } + it('Fails to set more properties than it is allowed (NFT)', async () => { + await testFailsSetMorePropertiesThanAllowed({type: 'NFT'}); }); - - it('Fails to set properties with invalid names', async () => { + it('Fails to set more properties than it is allowed (ReFungible)', async () => { + await testFailsSetMorePropertiesThanAllowed({type: 'ReFungible'}); + }); + + async function testFailsSetPropertiesWithInvalidNames(mode: CollectionMode) { await usingApi(async api => { - const collection = await createCollectionExpectSuccess(); - + const collection = await createCollectionExpectSuccess({mode: mode}); + const invalidProperties = [ [{key: 'electron', value: 'negative'}, {key: 'string theory', value: 'understandable'}], [{key: 'Mr/Sandman', value: 'Bring me a gene'}], [{key: 'déjà vu', value: 'hmm...'}], ]; - + for (let i = 0; i < invalidProperties.length; i++) { await expect(executeTransaction( api, @@ -306,13 +358,13 @@ describe('Negative Integration Test: Collection Properties', () => { api.tx.unique.setCollectionProperties(collection, invalidProperties[i]), ), `on rejecting the new badly-named property #${i}`).to.be.rejectedWith(/common\.InvalidCharacterInPropertyKey/); } - + await expect(executeTransaction( api, alice, api.tx.unique.setCollectionProperties(collection, [{key: '', value: 'nothing must not exist'}]), ), 'on rejecting an unnamed property').to.be.rejectedWith(/common\.EmptyPropertyKey/); - + await expect(executeTransaction( api, alice, @@ -320,14 +372,14 @@ describe('Negative Integration Test: Collection Properties', () => { {key: 'CRISPR-Cas9', value: 'rewriting nature!'}, ]), ), 'on setting the correctly-but-still-badly-named property').to.not.be.rejected; - + const keys = invalidProperties.flatMap(propertySet => propertySet.map(property => property.key)).concat('CRISPR-Cas9').concat(''); - + const properties = (await api.rpc.unique.collectionProperties(collection, keys)).toHuman(); expect(properties).to.be.deep.equal([ {key: 'CRISPR-Cas9', value: 'rewriting nature!'}, ]); - + for (let i = 0; i < invalidProperties.length; i++) { await expect(executeTransaction( api, @@ -336,6 +388,12 @@ describe('Negative Integration Test: Collection Properties', () => { ), `on trying to delete the non-existent badly-named property #${i}`).to.be.rejectedWith(/common\.InvalidCharacterInPropertyKey/); } }); + } + it('Fails to set properties with invalid names (NFT)', async () => { + await testFailsSetPropertiesWithInvalidNames({type: 'NFT'}); + }); + it('Fails to set properties with invalid names (ReFungible)', async () => { + await testFailsSetPropertiesWithInvalidNames({type: 'ReFungible'}); }); }); @@ -357,53 +415,65 @@ describe('Integration Test: Access Rights to Token Properties', () => { }); }); - it('Sets access rights to properties of a collection', async () => { + async function testSetsAccessRightsToProperties(mode: CollectionMode) { await usingApi(async api => { - const collection = await createCollectionExpectSuccess(); - + const collection = await createCollectionExpectSuccess({mode: mode}); + await expect(executeTransaction( api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'skullduggery', permission: {mutable: true}}]), )).to.not.be.rejected; - + await addCollectionAdminExpectSuccess(alice, collection, bob.address); - + await expect(executeTransaction( api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'mindgame', permission: {collectionAdmin: true, tokenOwner: false}}]), )).to.not.be.rejected; - + const propertyRights = (await api.rpc.unique.propertyPermissions(collection, ['skullduggery', 'mindgame'])).toHuman(); expect(propertyRights).to.be.deep.equal([ {key: 'skullduggery', permission: {'mutable': true, 'collectionAdmin': false, 'tokenOwner': false}}, {key: 'mindgame', permission: {'mutable': false, 'collectionAdmin': true, 'tokenOwner': false}}, ]); - }); + }); + } + it('Sets access rights to properties of a collection (NFT)', async () => { + await testSetsAccessRightsToProperties({type: 'NFT'}); + }); + it('Sets access rights to properties of a collection (ReFungible)', async () => { + await testSetsAccessRightsToProperties({type: 'ReFungible'}); }); - it('Changes access rights to properties of a collection', async () => { + async function testChangesAccessRightsToProperty(mode: CollectionMode) { await usingApi(async api => { - const collection = await createCollectionExpectSuccess(); - + const collection = await createCollectionExpectSuccess({mode: mode}); + await expect(executeTransaction( api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'skullduggery', permission: {mutable: true, collectionAdmin: true}}]), )).to.not.be.rejected; - + await expect(executeTransaction( api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'skullduggery', permission: {mutable: false, tokenOwner: true}}]), )).to.not.be.rejected; - + const propertyRights = (await api.rpc.unique.propertyPermissions(collection, ['skullduggery'])).toHuman(); expect(propertyRights).to.be.deep.equal([ {key: 'skullduggery', permission: {'mutable': false, 'collectionAdmin': false, 'tokenOwner': true}}, ]); }); + } + it('Changes access rights to properties of a NFT collection', async () => { + await testChangesAccessRightsToProperty({type: 'NFT'}); + }); + it('Changes access rights to properties of a ReFungible collection', async () => { + await testChangesAccessRightsToProperty({type: 'ReFungible'}); }); }); @@ -415,25 +485,31 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { }); }); - it('Prevents from setting access rights to properties of a collection if not an onwer/admin', async () => { + async function testPreventsFromSettingAccessRightsNotAdminOrOwner(mode: CollectionMode) { await usingApi(async api => { - const collection = await createCollectionExpectSuccess(); - + const collection = await createCollectionExpectSuccess({mode: mode}); + await expect(executeTransaction( api, bob, api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'skullduggery', permission: {mutable: true, tokenOwner: true}}]), )).to.be.rejectedWith(/common\.NoPermission/); - + const propertyRights = (await api.rpc.unique.propertyPermissions(collection, ['skullduggery'])).toJSON(); expect(propertyRights).to.be.empty; }); + } + it('Prevents from setting access rights to properties of a NFT collection if not an onwer/admin', async () => { + await testPreventsFromSettingAccessRightsNotAdminOrOwner({type: 'NFT'}); + }); + it('Prevents from setting access rights to properties of a ReFungible collection if not an onwer/admin', async () => { + await testPreventsFromSettingAccessRightsNotAdminOrOwner({type: 'ReFungible'}); }); - it('Prevents from adding too many possible properties', async () => { + async function testPreventFromAddingTooManyPossibleProperties(mode: CollectionMode) { await usingApi(async api => { - const collection = await createCollectionExpectSuccess(); - + const collection = await createCollectionExpectSuccess({mode: mode}); + const constitution = []; for (let i = 0; i < 65; i++) { constitution.push({ @@ -441,51 +517,63 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { permission: Math.random() > 0.5 ? {mutable: true, collectionAdmin: true, tokenOwner: true} : {}, }); } - + await expect(executeTransaction( api, alice, api.tx.unique.setTokenPropertyPermissions(collection, constitution), )).to.be.rejectedWith(/common\.PropertyLimitReached/); - + const propertyRights = (await api.query.common.collectionPropertyPermissions(collection)).toJSON(); expect(propertyRights).to.be.empty; - }); + }); + } + it('Prevents from adding too many possible properties (NFT)', async () => { + await testPreventFromAddingTooManyPossibleProperties({type: 'NFT'}); + }); + it('Prevents from adding too many possible properties (ReFungible)', async () => { + await testPreventFromAddingTooManyPossibleProperties({type: 'ReFungible'}); }); - it('Prevents access rights to be modified if constant', async () => { + async function testPreventAccessRightsModifiedIfConstant(mode: CollectionMode) { await usingApi(async api => { - const collection = await createCollectionExpectSuccess(); - + const collection = await createCollectionExpectSuccess({mode: mode}); + await expect(executeTransaction( api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'skullduggery', permission: {mutable: false, tokenOwner: true}}]), )).to.not.be.rejected; - + await expect(executeTransaction( api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'skullduggery', permission: {}}]), )).to.be.rejectedWith(/common\.NoPermission/); - + const propertyRights = (await api.rpc.unique.propertyPermissions(collection, ['skullduggery'])).toHuman(); expect(propertyRights).to.deep.equal([ {key: 'skullduggery', permission: {'mutable': false, 'collectionAdmin': false, 'tokenOwner': true}}, ]); - }); + }); + } + it('Prevents access rights to be modified if constant (NFT)', async () => { + await testPreventAccessRightsModifiedIfConstant({type: 'NFT'}); + }); + it('Prevents access rights to be modified if constant (ReFungible)', async () => { + await testPreventAccessRightsModifiedIfConstant({type: 'ReFungible'}); }); - it('Prevents adding properties with invalid names', async () => { + async function testPreventsAddingPropertiesWithInvalidNames(mode: CollectionMode) { await usingApi(async api => { - const collection = await createCollectionExpectSuccess(); - + const collection = await createCollectionExpectSuccess({mode: mode}); + const invalidProperties = [ [{key: 'skullduggery', permission: {tokenOwner: true}}, {key: 'im possible', permission: {collectionAdmin: true}}], [{key: 'G#4', permission: {tokenOwner: true}}], [{key: 'HÆMILTON', permission: {mutable: false, collectionAdmin: true, tokenOwner: true}}], ]; - + for (let i = 0; i < invalidProperties.length; i++) { await expect(executeTransaction( api, @@ -493,13 +581,13 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { api.tx.unique.setTokenPropertyPermissions(collection, invalidProperties[i]), ), `on setting the new badly-named property #${i}`).to.be.rejectedWith(/common\.InvalidCharacterInPropertyKey/); } - + await expect(executeTransaction( api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{key: '', permission: {}}]), ), 'on rejecting an unnamed property').to.be.rejectedWith(/common\.EmptyPropertyKey/); - + const correctKey = '--0x03116e387820CA05'; // PolkadotJS would parse this as an already encoded hex-string await expect(executeTransaction( api, @@ -508,14 +596,20 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { {key: correctKey, permission: {collectionAdmin: true}}, ]), ), 'on setting the correctly-but-still-badly-named property').to.not.be.rejected; - + const keys = invalidProperties.flatMap(propertySet => propertySet.map(property => property.key)).concat(correctKey).concat(''); - + const propertyRights = (await api.rpc.unique.propertyPermissions(collection, keys)).toHuman(); expect(propertyRights).to.be.deep.equal([ {key: correctKey, permission: {mutable: false, collectionAdmin: true, tokenOwner: false}}, ]); }); + } + it('Prevents adding properties with invalid names (NFT)', async () => { + await testPreventsAddingPropertiesWithInvalidNames({type: 'NFT'}); + }); + it('Prevents adding properties with invalid names (ReFungible)', async () => { + await testPreventsAddingPropertiesWithInvalidNames({type: 'ReFungible'}); }); }); diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index ea3ef0ef19..e8eb94a226 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -211,35 +211,4 @@ describe('Test Refungible properties:', () => { expect(collection.tokenPropertyPermissions.toHuman()).to.be.deep.equal(propertyPermissions); }); }); - - it('Set properties for exist collection', async () => { - await usingApi(async api => { - const collectionId = await createCollectionExpectSuccess({name: 'A', description: 'B', tokenPrefix: 'C', mode: {type: 'ReFungible'}, - }); - - const properties = [ - {key: 'key1', value: 'val1'}, - {key: 'key2', value: 'val2'}, - ]; - await expect(executeTransaction( - api, - alice, - api.tx.unique.setCollectionProperties(collectionId, properties), - )).to.not.be.rejected; - - const propertyPermissions = [ - {key: 'key1', permission: {collectionAdmin: true, mutable: false, tokenOwner: true}}, - {key: 'key2', permission: {collectionAdmin: false, mutable: true, tokenOwner: false}}, - ]; - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collectionId, propertyPermissions), - )).to.not.be.rejected; - - const collection = (await getDetailedCollectionInfo(api, collectionId))!; - expect(collection.properties.toHuman()).to.be.deep.equal(properties); - expect(collection.tokenPropertyPermissions.toHuman()).to.be.deep.equal(propertyPermissions); - }); - }); }); diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index a2c0ff054f..d128a3ac65 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -284,7 +284,7 @@ interface ReFungible { type: 'ReFungible'; } -type CollectionMode = Nft | Fungible | ReFungible; +export type CollectionMode = Nft | Fungible | ReFungible; export type Property = { key: any, From c5c3942d47135d1c82d480271376aca7107da8d1 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 29 Jun 2022 07:27:44 +0000 Subject: [PATCH 0033/1274] CORE-410 Adapt token property test for ReFungible collection --- tests/src/nesting/properties.test.ts | 42 ++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index 9fbedff254..0badc56fca 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -647,8 +647,7 @@ describe('Integration Test: Token Properties', () => { nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, token)}); await addCollectionAdminExpectSuccess(alice, collection, bob.address); - await transferExpectSuccess(collection, token, alice, charlie); - }); + await transferExpectSuccess(collection, token, alice, charlie); }); }); it('Reads yet empty properties of a token', async () => { @@ -699,6 +698,45 @@ describe('Integration Test: Token Properties', () => { }); }); + it.only('Assigns properties to a token according to permissions (ReFungible)', async () => { + await usingApi(async api => { + const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); + const token = await createItemExpectSuccess(alice, collection, 'ReFungible'); + await addCollectionAdminExpectSuccess(alice, collection, bob.address); + await transferExpectSuccess(collection, token, alice, charlie, 1, 'ReFungible'); + + const propertyKeys: string[] = []; + let i = 0; + for (const permission of permissions) { + for (const signer of permission.signers) { + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect(executeTransaction( + api, + alice, + api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), + ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; + + await expect(executeTransaction( + api, + signer, + api.tx.unique.setTokenProperties(collection, token, [{key: key, value: 'Serotonin increase'}]), + ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; + } + + i++; + } + + // const properties = (await api.rpc.unique.tokenProperties(collection, token, propertyKeys)).toHuman() as any[]; + // const tokensData = (await api.rpc.unique.tokenData(collection, token, propertyKeys)).toHuman().properties as any[]; + // for (let i = 0; i < properties.length; i++) { + // expect(properties[i].value).to.be.equal('Serotonin increase'); + // expect(tokensData[i].value).to.be.equal('Serotonin increase'); + // } + }); + }); + it('Changes properties of a token according to permissions', async () => { await usingApi(async api => { const propertyKeys: string[] = []; From 77a7be634bdd1544ec152653f58dc1795da98ac4 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 1 Jul 2022 17:59:08 +0300 Subject: [PATCH 0034/1274] CORE-410 Adapt rest token property test for ReFungible collection --- tests/src/nesting/properties.test.ts | 211 +++++++++++++++------------ 1 file changed, 114 insertions(+), 97 deletions(-) diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index 0badc56fca..f542f00feb 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -616,16 +616,13 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { // ---------- TOKEN PROPERTIES describe('Integration Test: Token Properties', () => { - let collection: number; - let token: number; - let nestedToken: number; let permissions: {permission: any, signers: IKeyringPair[]}[]; before(async () => { await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + alice = privateKeyWrapper('//Alice'); // collection owner + bob = privateKeyWrapper('//Bob'); // collection admin + charlie = privateKeyWrapper('//Charlie'); // token owner permissions = [ {permission: {mutable: true, collectionAdmin: true}, signers: [alice, bob]}, @@ -637,35 +634,34 @@ describe('Integration Test: Token Properties', () => { ]; }); }); - - beforeEach(async () => { - await usingApi(async () => { - collection = await createCollectionExpectSuccess(); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); - - token = await createItemExpectSuccess(alice, collection, 'NFT'); - nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, token)}); - - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - await transferExpectSuccess(collection, token, alice, charlie); }); - }); - it('Reads yet empty properties of a token', async () => { + async function testReadsYetEmptyProperties(mode: CollectionMode) { await usingApi(async api => { - const collection = await createCollectionExpectSuccess(); - const token = await createItemExpectSuccess(alice, collection, 'NFT'); + const collection = await createCollectionExpectSuccess({mode: mode}); + const token = await createItemExpectSuccess(alice, collection, mode.type); const properties = (await api.query.nonfungible.tokenProperties(collection, token)).toJSON(); expect(properties.map).to.be.empty; expect(properties.consumedSpace).to.be.equal(0); - + const tokenData = (await api.rpc.unique.tokenData(collection, token, ['anything'])).toJSON().properties; expect(tokenData).to.be.empty; }); + } + it('Reads yet empty properties of a token (NFT)', async () => { + await testReadsYetEmptyProperties({type: 'NFT'}); + }); + it('Reads yet empty properties of a token (ReFungible)', async () => { + await testReadsYetEmptyProperties({type: 'ReFungible'}); }); - it('Assigns properties to a token according to permissions', async () => { + async function testAssignPropertiesAccordingToPermissions(mode: CollectionMode, pieces: number) { await usingApi(async api => { + const collection = await createCollectionExpectSuccess({mode: mode}); + const token = await createItemExpectSuccess(alice, collection, mode.type); + await addCollectionAdminExpectSuccess(alice, collection, bob.address); + await transferExpectSuccess(collection, token, alice, charlie, pieces, mode.type); + const propertyKeys: string[] = []; let i = 0; for (const permission of permissions) { @@ -696,49 +692,21 @@ describe('Integration Test: Token Properties', () => { expect(tokensData[i].value).to.be.equal('Serotonin increase'); } }); + } + it('Assigns properties to a token according to permissions (NFT)', async () => { + await testAssignPropertiesAccordingToPermissions({type: 'NFT'}, 1); + }); + it('Assigns properties to a token according to permissions (ReFungible)', async () => { + await testAssignPropertiesAccordingToPermissions({type: 'ReFungible'}, 100); }); - it.only('Assigns properties to a token according to permissions (ReFungible)', async () => { + async function testChangesPropertiesAccordingPermission(mode: CollectionMode, pieces: number) { await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const token = await createItemExpectSuccess(alice, collection, 'ReFungible'); + const collection = await createCollectionExpectSuccess({mode: mode}); + const token = await createItemExpectSuccess(alice, collection, mode.type); await addCollectionAdminExpectSuccess(alice, collection, bob.address); - await transferExpectSuccess(collection, token, alice, charlie, 1, 'ReFungible'); - - const propertyKeys: string[] = []; - let i = 0; - for (const permission of permissions) { - for (const signer of permission.signers) { - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), - ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.setTokenProperties(collection, token, [{key: key, value: 'Serotonin increase'}]), - ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - } - - i++; - } + await transferExpectSuccess(collection, token, alice, charlie, pieces, mode.type); - // const properties = (await api.rpc.unique.tokenProperties(collection, token, propertyKeys)).toHuman() as any[]; - // const tokensData = (await api.rpc.unique.tokenData(collection, token, propertyKeys)).toHuman().properties as any[]; - // for (let i = 0; i < properties.length; i++) { - // expect(properties[i].value).to.be.equal('Serotonin increase'); - // expect(tokensData[i].value).to.be.equal('Serotonin increase'); - // } - }); - }); - - it('Changes properties of a token according to permissions', async () => { - await usingApi(async api => { const propertyKeys: string[] = []; let i = 0; for (const permission of permissions) { @@ -747,29 +715,29 @@ describe('Integration Test: Token Properties', () => { for (const signer of permission.signers) { const key = i + '_' + signer.address; propertyKeys.push(key); - + await expect(executeTransaction( api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - + await expect(executeTransaction( api, signer, api.tx.unique.setTokenProperties(collection, token, [{key: key, value: 'Serotonin increase'}]), ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - + await expect(executeTransaction( api, signer, api.tx.unique.setTokenProperties(collection, token, [{key: key, value: 'Serotonin stable'}]), ), `on changing property ${i} by ${signer.address}`).to.not.be.rejected; } - + i++; } - + const properties = (await api.rpc.unique.tokenProperties(collection, token, propertyKeys)).toHuman() as any[]; const tokensData = (await api.rpc.unique.tokenData(collection, token, propertyKeys)).toHuman().properties as any[]; for (let i = 0; i < properties.length; i++) { @@ -777,32 +745,43 @@ describe('Integration Test: Token Properties', () => { expect(tokensData[i].value).to.be.equal('Serotonin stable'); } }); + } + it('Changes properties of a token according to permissions (NFT)', async () => { + await testChangesPropertiesAccordingPermission({type: 'NFT'}, 1); + }); + it('Changes properties of a token according to permissions (ReFungible)', async () => { + await testChangesPropertiesAccordingPermission({type: 'ReFungible'}, 100); }); - it('Deletes properties of a token according to permissions', async () => { + async function testDeletePropertiesAccordingPermission(mode: CollectionMode, pieces: number) { await usingApi(async api => { + const collection = await createCollectionExpectSuccess({mode: mode}); + const token = await createItemExpectSuccess(alice, collection, mode.type); + await addCollectionAdminExpectSuccess(alice, collection, bob.address); + await transferExpectSuccess(collection, token, alice, charlie, pieces, mode.type); + const propertyKeys: string[] = []; let i = 0; - + for (const permission of permissions) { if (!permission.permission.mutable) continue; for (const signer of permission.signers) { const key = i + '_' + signer.address; propertyKeys.push(key); - + await expect(executeTransaction( api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - + await expect(executeTransaction( api, signer, api.tx.unique.setTokenProperties(collection, token, [{key: key, value: 'Serotonin increase'}]), ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - + await expect(executeTransaction( api, signer, @@ -812,13 +791,19 @@ describe('Integration Test: Token Properties', () => { i++; } - + const properties = (await api.rpc.unique.tokenProperties(collection, token, propertyKeys)).toJSON() as any[]; expect(properties).to.be.empty; const tokensData = (await api.rpc.unique.tokenData(collection, token, propertyKeys)).toJSON().properties as any[]; expect(tokensData).to.be.empty; expect((await api.query.nonfungible.tokenProperties(collection, token)).toJSON().consumedSpace).to.be.equal(0); }); + } + it('Deletes properties of a token according to permissions (NFT)', async () => { + await testDeletePropertiesAccordingPermission({type: 'NFT'}, 1); + }); + it('Deletes properties of a token according to permissions (ReFungible)', async () => { + await testDeletePropertiesAccordingPermission({type: 'ReFungible'}, 100); }); it('Assigns properties to a nested token according to permissions', async () => { @@ -964,11 +949,11 @@ describe('Negative Integration Test: Token Properties', () => { }); }); - beforeEach(async () => { - collection = await createCollectionExpectSuccess(); - token = await createItemExpectSuccess(alice, collection, 'NFT'); + async function prepare(mode: CollectionMode, pieces: number) { + collection = await createCollectionExpectSuccess({mode: mode}); + token = await createItemExpectSuccess(alice, collection, mode.type); await addCollectionAdminExpectSuccess(alice, collection, bob.address); - await transferExpectSuccess(collection, token, alice, charlie); + await transferExpectSuccess(collection, token, alice, charlie, pieces, mode.type); await usingApi(async api => { let i = 0; @@ -980,71 +965,89 @@ describe('Negative Integration Test: Token Properties', () => { alice, api.tx.unique.setTokenPropertyPermissions(collection, [{key: `${i}`, permission: passage.permission}]), ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - + await expect(executeTransaction( api, signer, api.tx.unique.setTokenProperties(collection, token, [{key: `${i}`, value: 'Serotonin increase'}]), ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - + i++; } - + originalSpace = (await api.query.nonfungible.tokenProperties(collection, token)).toJSON().consumedSpace as number; - }); - }); + }); + } - it('Forbids changing/deleting properties of a token if the user is outside of permissions', async () => { + async function testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(mode: CollectionMode, pieces: number) { + await prepare(mode, pieces); + await usingApi(async api => { let i = -1; for (const forbiddance of constitution) { i++; if (!forbiddance.permission.mutable) continue; - + await expect(executeTransaction( api, forbiddance.sinner, api.tx.unique.setTokenProperties(collection, token, [{key: `${i}`, value: 'Serotonin down'}]), ), `on failing to change property ${i} by ${forbiddance.sinner.address}`).to.be.rejectedWith(/common\.NoPermission/); - + await expect(executeTransaction( api, forbiddance.sinner, api.tx.unique.deleteTokenProperties(collection, token, [`${i}`]), ), `on failing to delete property ${i} by ${forbiddance.sinner.address}`).to.be.rejectedWith(/common\.NoPermission/); } - + const properties = (await api.query.nonfungible.tokenProperties(collection, token)).toJSON(); expect(properties.consumedSpace).to.be.equal(originalSpace); }); + } + it('Forbids changing/deleting properties of a token if the user is outside of permissions (NFT)', async () => { + await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions({type: 'NFT'}, 1); + }); + it('Forbids changing/deleting properties of a token if the user is outside of permissions (ReFungible)', async () => { + await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions({type: 'ReFungible'}, 100); }); - it('Forbids changing/deleting properties of a token if the property is permanent (immutable)', async () => { + async function testForbidsChangingDeletingPropertiesIfPropertyImmutable(mode: CollectionMode, pieces: number) { + await prepare(mode, pieces); + await usingApi(async api => { let i = -1; for (const permission of constitution) { i++; if (permission.permission.mutable) continue; - + await expect(executeTransaction( api, permission.signers[0], api.tx.unique.setTokenProperties(collection, token, [{key: `${i}`, value: 'Serotonin down'}]), ), `on failing to change property ${i} by ${permission.signers[0].address}`).to.be.rejectedWith(/common\.NoPermission/); - + await expect(executeTransaction( api, permission.signers[0], api.tx.unique.deleteTokenProperties(collection, token, [i.toString()]), ), `on failing to delete property ${i} by ${permission.signers[0].address}`).to.be.rejectedWith(/common\.NoPermission/); } - + const properties = (await api.query.nonfungible.tokenProperties(collection, token)).toJSON(); expect(properties.consumedSpace).to.be.equal(originalSpace); - }); + }); + } + it('Forbids changing/deleting properties of a token if the property is permanent (immutable) (NFT)', async () => { + await testForbidsChangingDeletingPropertiesIfPropertyImmutable({type: 'NFT'}, 1); + }); + it('Forbids changing/deleting properties of a token if the property is permanent (immutable) (ReFungible)', async () => { + await testForbidsChangingDeletingPropertiesIfPropertyImmutable({type: 'ReFungible'}, 100); }); - it('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission', async () => { + async function testForbidsAddingPropertiesIfPropertyNotDeclared(mode: CollectionMode, pieces: number) { + await prepare(mode, pieces); + await usingApi(async api => { await expect(executeTransaction( api, @@ -1057,20 +1060,28 @@ describe('Negative Integration Test: Token Properties', () => { alice, api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'now-existent', permission: {}}]), ), 'on setting a new non-permitted property').to.not.be.rejected; - + await expect(executeTransaction( api, alice, api.tx.unique.setTokenProperties(collection, token, [{key: 'now-existent', value: 'I exist!'}]), ), 'on failing to add a property forbidden by the \'None\' permission').to.be.rejectedWith(/common\.NoPermission/); - + expect((await api.rpc.unique.tokenProperties(collection, token, ['non-existent', 'now-existent'])).toJSON()).to.be.empty; const properties = (await api.query.nonfungible.tokenProperties(collection, token)).toJSON(); expect(properties.consumedSpace).to.be.equal(originalSpace); }); + } + it('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (NFT)', async () => { + await testForbidsAddingPropertiesIfPropertyNotDeclared({type: 'NFT'}, 1); + }); + it('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (ReFungible)', async () => { + await testForbidsAddingPropertiesIfPropertyNotDeclared({type: 'ReFungible'}, 100); }); - it('Forbids adding too many properties to a token', async () => { + async function testForbidsAddingTooManyProperties(mode: CollectionMode, pieces: number) { + await prepare(mode, pieces); + await usingApi(async api => { await expect(executeTransaction( api, @@ -1080,7 +1091,7 @@ describe('Negative Integration Test: Token Properties', () => { {key: 'young_years', permission: {collectionAdmin: true, tokenOwner: true}}, ]), ), 'on setting a new non-permitted property').to.not.be.rejected; - + // Mute the general tx parsing error { console.error = () => {}; @@ -1090,7 +1101,7 @@ describe('Negative Integration Test: Token Properties', () => { api.tx.unique.setCollectionProperties(collection, [{key: 'a_holy_book', value: 'word '.repeat(6554)}]), )).to.be.rejected; } - + await expect(executeTransaction( api, alice, @@ -1099,10 +1110,16 @@ describe('Negative Integration Test: Token Properties', () => { {key: 'young_years', value: 'neverending'.repeat(1490)}, ]), )).to.be.rejectedWith(/common\.NoSpaceForProperty/); - + expect((await api.rpc.unique.tokenProperties(collection, token, ['a_holy_book', 'young_years'])).toJSON()).to.be.empty; const propertiesMap = (await api.query.nonfungible.tokenProperties(collection, token)).toJSON(); expect(propertiesMap.consumedSpace).to.be.equal(originalSpace); }); + } + it('Forbids adding too many properties to a token (NFT)', async () => { + await testForbidsAddingTooManyProperties({type: 'NFT'}, 1); + }); + it('Forbids adding too many properties to a token (ReFungible)', async () => { + await testForbidsAddingTooManyProperties({type: 'ReFungible'}, 100); }); }); From a0e06d09ede7785f8836a8eb95f6360961cd97ee Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 1 Jul 2022 18:35:08 +0300 Subject: [PATCH 0035/1274] CORE-410 Add specific ReFungible test for toke permissions. --- tests/src/nesting/properties.test.ts | 94 ++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index f542f00feb..12784c508b 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -1123,3 +1123,97 @@ describe('Negative Integration Test: Token Properties', () => { await testForbidsAddingTooManyProperties({type: 'ReFungible'}, 100); }); }); +<<<<<<< HEAD +======= + +describe('ReFungible token properties permissions tests', () => { + let collection: number; + let token: number; + + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + alice = privateKeyWrapper('//Alice'); + bob = privateKeyWrapper('//Bob'); + charlie = privateKeyWrapper('//Charlie'); + }); + }); + + beforeEach(async () => { + await usingApi(async api => { + collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); + token = await createItemExpectSuccess(alice, collection, 'ReFungible'); + await addCollectionAdminExpectSuccess(alice, collection, bob.address); + + await expect(executeTransaction( + api, + alice, + api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'key', permission: {mutable:true, tokenOwner: true}}]), + )).to.not.be.rejected; + }); + }); + + it('Forbids add token property with tokenOwher==true but signer have\'t all pieces', async () => { + await usingApi(async api => { + await transferExpectSuccess(collection, token, alice, charlie, 33, 'ReFungible'); + + await expect(executeTransaction( + api, + alice, + api.tx.unique.setTokenProperties(collection, token, [ + {key: 'key', value: 'word'}, + ]), + )).to.be.rejectedWith(/common\.NoPermission/); + }); + }); + + it('Forbids mutate token property with tokenOwher==true but signer have\'t all pieces', async () => { + await usingApi(async api => { + await expect(executeTransaction( + api, + alice, + api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'key', permission: {mutable:true, tokenOwner: true}}]), + )).to.not.be.rejected; + + await expect(executeTransaction( + api, + alice, + api.tx.unique.setTokenProperties(collection, token, [ + {key: 'key', value: 'word'}, + ]), + )).to.be.not.rejected; + + await transferExpectSuccess(collection, token, alice, charlie, 33, 'ReFungible'); + + await expect(executeTransaction( + api, + alice, + api.tx.unique.setTokenProperties(collection, token, [ + {key: 'key', value: 'bad word'}, + ]), + )).to.be.rejectedWith(/common\.NoPermission/); + }); + }); + + it('Forbids delete token property with tokenOwher==true but signer have\'t all pieces', async () => { + await usingApi(async api => { + await expect(executeTransaction( + api, + alice, + api.tx.unique.setTokenProperties(collection, token, [ + {key: 'key', value: 'word'}, + ]), + )).to.be.not.rejected; + + await transferExpectSuccess(collection, token, alice, charlie, 33, 'ReFungible'); + + await expect(executeTransaction( + api, + alice, + api.tx.unique.deleteTokenProperties(collection, token, [ + 'key', + ]), + )).to.be.rejectedWith(/common\.NoPermission/); + }); + }); +}); +>>>>>>> 39e5dede (CORE-410 Add specific ReFungible test for toke permissions.) From e574f04bed82e3abb31667304a752bf912dd058a Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 6 Jul 2022 15:17:13 +0300 Subject: [PATCH 0036/1274] CORE-410 Fix after rebase --- tests/src/nesting/properties.test.ts | 231 +++++++++++++-------------- 1 file changed, 114 insertions(+), 117 deletions(-) diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index 12784c508b..0cb3f4331d 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -806,123 +806,123 @@ describe('Integration Test: Token Properties', () => { await testDeletePropertiesAccordingPermission({type: 'ReFungible'}, 100); }); - it('Assigns properties to a nested token according to permissions', async () => { - await usingApi(async api => { - const propertyKeys: string[] = []; - let i = 0; - for (const permission of permissions) { - for (const signer of permission.signers) { - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), - ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]), - ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - } - - i++; - } - - const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toHuman() as any[]; - const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toHuman().properties as any[]; - for (let i = 0; i < properties.length; i++) { - expect(properties[i].value).to.be.equal('Serotonin increase'); - expect(tokensData[i].value).to.be.equal('Serotonin increase'); - } - }); - }); - - it('Changes properties of a nested token according to permissions', async () => { - await usingApi(async api => { - const propertyKeys: string[] = []; - let i = 0; - for (const permission of permissions) { - if (!permission.permission.mutable) continue; + // it('Assigns properties to a nested token according to permissions', async () => { + // await usingApi(async api => { + // const propertyKeys: string[] = []; + // let i = 0; + // for (const permission of permissions) { + // for (const signer of permission.signers) { + // const key = i + '_' + signer.address; + // propertyKeys.push(key); + + // await expect(executeTransaction( + // api, + // alice, + // api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), + // ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; + + // await expect(executeTransaction( + // api, + // signer, + // api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]), + // ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; + // } + + // i++; + // } + + // const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toHuman() as any[]; + // const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toHuman().properties as any[]; + // for (let i = 0; i < properties.length; i++) { + // expect(properties[i].value).to.be.equal('Serotonin increase'); + // expect(tokensData[i].value).to.be.equal('Serotonin increase'); + // } + // }); + // }); + + // it('Changes properties of a nested token according to permissions', async () => { + // await usingApi(async api => { + // const propertyKeys: string[] = []; + // let i = 0; + // for (const permission of permissions) { + // if (!permission.permission.mutable) continue; - for (const signer of permission.signers) { - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), - ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]), - ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin stable'}]), - ), `on changing property ${i} by ${signer.address}`).to.not.be.rejected; - } - - i++; - } - - const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toHuman() as any[]; - const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toHuman().properties as any[]; - for (let i = 0; i < properties.length; i++) { - expect(properties[i].value).to.be.equal('Serotonin stable'); - expect(tokensData[i].value).to.be.equal('Serotonin stable'); - } - }); - }); - - it('Deletes properties of a nested token according to permissions', async () => { - await usingApi(async api => { - const propertyKeys: string[] = []; - let i = 0; - - for (const permission of permissions) { - if (!permission.permission.mutable) continue; + // for (const signer of permission.signers) { + // const key = i + '_' + signer.address; + // propertyKeys.push(key); + + // await expect(executeTransaction( + // api, + // alice, + // api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), + // ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; + + // await expect(executeTransaction( + // api, + // signer, + // api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]), + // ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; + + // await expect(executeTransaction( + // api, + // signer, + // api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin stable'}]), + // ), `on changing property ${i} by ${signer.address}`).to.not.be.rejected; + // } + + // i++; + // } + + // const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toHuman() as any[]; + // const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toHuman().properties as any[]; + // for (let i = 0; i < properties.length; i++) { + // expect(properties[i].value).to.be.equal('Serotonin stable'); + // expect(tokensData[i].value).to.be.equal('Serotonin stable'); + // } + // }); + // }); + + // it('Deletes properties of a nested token according to permissions', async () => { + // await usingApi(async api => { + // const propertyKeys: string[] = []; + // let i = 0; + + // for (const permission of permissions) { + // if (!permission.permission.mutable) continue; - for (const signer of permission.signers) { - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), - ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]), - ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.deleteTokenProperties(collection, nestedToken, [key]), - ), `on deleting property ${i} by ${signer.address}`).to.not.be.rejected; - } + // for (const signer of permission.signers) { + // const key = i + '_' + signer.address; + // propertyKeys.push(key); + + // await expect(executeTransaction( + // api, + // alice, + // api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), + // ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; + + // await expect(executeTransaction( + // api, + // signer, + // api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]), + // ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; + + // await expect(executeTransaction( + // api, + // signer, + // api.tx.unique.deleteTokenProperties(collection, nestedToken, [key]), + // ), `on deleting property ${i} by ${signer.address}`).to.not.be.rejected; + // } - i++; - } - - const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toJSON() as any[]; - expect(properties).to.be.empty; - const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toJSON().properties as any[]; - expect(tokensData).to.be.empty; - expect((await api.query.nonfungible.tokenProperties(collection, nestedToken)).toJSON().consumedSpace).to.be.equal(0); - }); - }); + // i++; + // } + + // const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toJSON() as any[]; + // expect(properties).to.be.empty; + // const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toJSON().properties as any[]; + // expect(tokensData).to.be.empty; + // expect((await api.query.nonfungible.tokenProperties(collection, nestedToken)).toJSON().consumedSpace).to.be.equal(0); + // }); + // }); }); describe('Negative Integration Test: Token Properties', () => { @@ -1123,8 +1123,6 @@ describe('Negative Integration Test: Token Properties', () => { await testForbidsAddingTooManyProperties({type: 'ReFungible'}, 100); }); }); -<<<<<<< HEAD -======= describe('ReFungible token properties permissions tests', () => { let collection: number; @@ -1216,4 +1214,3 @@ describe('ReFungible token properties permissions tests', () => { }); }); }); ->>>>>>> 39e5dede (CORE-410 Add specific ReFungible test for toke permissions.) From 0427b9aac8a21112835725f412985b96f44f1252 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 7 Jul 2022 12:56:31 +0300 Subject: [PATCH 0037/1274] CORE-410 Adapt to prop check root owner --- pallets/refungible/src/common.rs | 21 ++- pallets/refungible/src/lib.rs | 241 ++++++++++++++++------------- primitives/data-structs/src/lib.rs | 4 +- 3 files changed, 156 insertions(+), 110 deletions(-) diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index c155f26852..99dca10fe1 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -327,12 +327,19 @@ impl CommonCollectionOperations for RefungibleHandle { sender: T::CrossAccountId, token_id: TokenId, properties: Vec, - _nesting_budget: &dyn Budget, + nesting_budget: &dyn Budget, ) -> DispatchResultWithPostInfo { let weight = >::set_token_properties(properties.len() as u32); with_weight( - >::set_token_properties(self, &sender, token_id, properties, false), + >::set_token_properties( + self, + &sender, + token_id, + properties.into_iter(), + false, + nesting_budget, + ), weight, ) } @@ -356,12 +363,18 @@ impl CommonCollectionOperations for RefungibleHandle { sender: T::CrossAccountId, token_id: TokenId, property_keys: Vec, - _nesting_budget: &dyn Budget, + nesting_budget: &dyn Budget, ) -> DispatchResultWithPostInfo { let weight = >::delete_token_properties(property_keys.len() as u32); with_weight( - >::delete_token_properties(self, &sender, token_id, property_keys), + >::delete_token_properties( + self, + &sender, + token_id, + property_keys.into_iter(), + nesting_budget, + ), weight, ) } diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index cc78a82d33..43f38009c7 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -87,14 +87,18 @@ #![cfg_attr(not(feature = "std"), no_std)] -use frame_support::{ensure, BoundedVec, transactional, storage::with_transaction}; +use frame_support::{ensure, fail, BoundedVec, transactional, storage::with_transaction}; use up_data_structs::{ AccessMode, CollectionId, CustomDataLimit, MAX_REFUNGIBLE_PIECES, TokenId, CreateCollectionData, CreateRefungibleExData, mapping::TokenAddressMapping, budget::Budget, - Property, PropertyScope, TrySetProperty, PropertyKey, PropertyPermission, PropertyKeyPermission + Property, PropertyScope, TrySetProperty, PropertyKey, PropertyValue, PropertyPermission, + PropertyKeyPermission, }; use pallet_evm::account::CrossAccountId; -use pallet_common::{Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, CommonCollectionOperations as _}; +use pallet_common::{ + Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, + CommonCollectionOperations as _, +}; use pallet_structure::Pallet as PalletStructure; use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome}; use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap}; @@ -466,140 +470,168 @@ impl Pallet { Ok(()) } - pub fn set_token_property( + #[transactional] + fn modify_token_properties( collection: &RefungibleHandle, sender: &T::CrossAccountId, token_id: TokenId, - property: Property, + properties: impl Iterator)>, is_token_create: bool, + nesting_budget: &dyn Budget, ) -> DispatchResult { - Self::check_token_change_permission( - collection, - sender, - token_id, - &property.key, - is_token_create, - )?; + let is_collection_admin = || collection.is_owner_or_admin(sender); + let is_token_owner = || -> Result { + let balance = collection.balance(sender.clone(), token_id); + let total_pieces: u128 = + Self::total_pieces(collection.id, token_id).unwrap_or(u128::MAX); + if balance != total_pieces { + return Ok(false); + } - >::try_mutate((collection.id, token_id), |properties| { - let property = property.clone(); - properties.try_set(property.key, property.value) - }) - .map_err(>::from)?; + let is_bundle_owner = >::check_indirectly_owned( + sender.clone(), + collection.id, + token_id, + None, + nesting_budget, + )?; - >::deposit_event(CommonEvent::TokenPropertySet( - collection.id, - token_id, - property.key, - )); + Ok(is_bundle_owner) + }; + + for (key, value) in properties { + let permission = >::property_permissions(collection.id) + .get(&key) + .cloned() + .unwrap_or_else(PropertyPermission::none); + + let is_property_exists = TokenProperties::::get((collection.id, token_id)) + .get(&key) + .is_some(); + + match permission { + PropertyPermission { mutable: false, .. } if is_property_exists => { + return Err(>::NoPermission.into()); + } + + PropertyPermission { + collection_admin, + token_owner, + .. + } => { + //TODO: investigate threats during public minting. + let is_token_create = + is_token_create && (collection_admin || token_owner) && value.is_some(); + if !(is_token_create + || (collection_admin && is_collection_admin()) + || (token_owner && is_token_owner()?)) + { + fail!(>::NoPermission); + } + } + } + + match value { + Some(value) => { + >::try_mutate((collection.id, token_id), |properties| { + properties.try_set(key.clone(), value) + }) + .map_err(>::from)?; + + >::deposit_event(CommonEvent::TokenPropertySet( + collection.id, + token_id, + key, + )); + } + None => { + >::try_mutate((collection.id, token_id), |properties| { + properties.remove(&key) + }) + .map_err(>::from)?; + + >::deposit_event(CommonEvent::TokenPropertyDeleted( + collection.id, + token_id, + key, + )); + } + } + } Ok(()) } - #[transactional] pub fn set_token_properties( collection: &RefungibleHandle, sender: &T::CrossAccountId, token_id: TokenId, - properties: Vec, + properties: impl Iterator, is_token_create: bool, + nesting_budget: &dyn Budget, ) -> DispatchResult { - for property in properties { - Self::set_token_property(collection, sender, token_id, property, is_token_create)?; - } - - Ok(()) + Self::modify_token_properties( + collection, + sender, + token_id, + properties.map(|p| (p.key, Some(p.value))), + is_token_create, + nesting_budget, + ) } - pub fn delete_token_property( + pub fn set_token_property( collection: &RefungibleHandle, sender: &T::CrossAccountId, token_id: TokenId, - property_key: PropertyKey, + property: Property, + nesting_budget: &dyn Budget, ) -> DispatchResult { - Self::check_token_change_permission(collection, sender, token_id, &property_key, false)?; + let is_token_create = false; - >::try_mutate((collection.id, token_id), |properties| { - properties.remove(&property_key) - }) - .map_err(>::from)?; - - >::deposit_event(CommonEvent::TokenPropertyDeleted( - collection.id, + Self::set_token_properties( + collection, + sender, token_id, - property_key, - )); - - Ok(()) + [property].into_iter(), + is_token_create, + nesting_budget, + ) } - fn check_token_change_permission( + pub fn delete_token_properties( collection: &RefungibleHandle, sender: &T::CrossAccountId, token_id: TokenId, - property_key: &PropertyKey, - is_token_create: bool, + property_keys: impl Iterator, + nesting_budget: &dyn Budget, ) -> DispatchResult { - let permission = >::property_permissions(collection.id) - .get(property_key) - .cloned() - .unwrap_or_else(PropertyPermission::none); - - // Not "try_fold" because total count of pieces is limited by 'MAX_REFUNGIBLE_PIECES'. - let total_pieces: u128 = >::iter_prefix((collection.id, token_id,)).fold(0, |total, piece| total + piece.1); - let balance = collection.balance(sender.clone(), token_id); - - let check_token_owner = || -> DispatchResult { - ensure!(balance == total_pieces, >::NoPermission); - Ok(()) - }; - - let is_property_exists = TokenProperties::::get((collection.id, token_id)) - .get(property_key) - .is_some(); - - match permission { - PropertyPermission { mutable: false, .. } if is_property_exists => { - Err(>::NoPermission.into()) - } - - PropertyPermission { - collection_admin, - token_owner, - .. - } => { - //TODO: investigate threats during public minting. - if is_token_create && (collection_admin || token_owner) { - return Ok(()); - } - - let mut check_result = Err(>::NoPermission.into()); - - if collection_admin { - check_result = collection.check_is_owner_or_admin(sender); - } + let is_token_create = false; - if token_owner { - check_result.or_else(|_| check_token_owner()) - } else { - check_result - } - } - } + Self::modify_token_properties( + collection, + sender, + token_id, + property_keys.into_iter().map(|key| (key, None)), + is_token_create, + nesting_budget, + ) } - #[transactional] - pub fn delete_token_properties( + pub fn delete_token_property( collection: &RefungibleHandle, sender: &T::CrossAccountId, token_id: TokenId, - property_keys: Vec, + property_key: PropertyKey, + nesting_budget: &dyn Budget, ) -> DispatchResult { - for key in property_keys { - Self::delete_token_property(collection, sender, token_id, key)?; - } - - Ok(()) + Self::delete_token_properties( + collection, + sender, + token_id, + [property_key].into_iter(), + nesting_budget, + ) } /// Transfer RFT token pieces from one account to another. @@ -833,8 +865,9 @@ impl Pallet { collection, sender, TokenId(token_id), - data.properties.clone().into_inner(), + data.properties.clone().into_iter(), true, + nesting_budget, ) { return TransactionOutcome::Rollback(Err(e)); } @@ -854,7 +887,7 @@ impl Pallet { for (user, amount) in token.users.into_iter() { if amount == 0 { continue; - } + } // TODO: ERC20 transfer event >::deposit_event(CommonEvent::ItemCreated( @@ -1049,10 +1082,10 @@ impl Pallet { ); ensure!(amount > 0, >::TokenValueTooLow); // Ensure user owns all pieces - let total_supply = >::get((collection.id, token)); + let total_pieces = Self::total_pieces(collection.id, token).unwrap_or(u128::MAX); let balance = >::get((collection.id, token, owner)); ensure!( - total_supply == balance, + total_pieces == balance, >::RepartitionWhileNotOwningAllPieces ); @@ -1064,7 +1097,7 @@ impl Pallet { fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option { >::try_get((collection_id, token_id)).ok() } - + pub fn set_collection_properties( collection: &RefungibleHandle, sender: &T::CrossAccountId, diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index d5271128a8..e8df6b39b3 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -534,9 +534,9 @@ pub struct CreateReFungibleData { #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))] #[derivative(Debug(format_with = "bounded::vec_debug"))] pub const_data: BoundedVec, - + pub pieces: u128, - + #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))] #[derivative(Debug(format_with = "bounded::vec_debug"))] pub properties: CollectionPropertiesVec, From 3cb5e43c69bb03bd7540dcda98b9ea0c0da393b2 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 7 Jul 2022 17:12:58 +0300 Subject: [PATCH 0038/1274] CORE-410 Implement token_owner for Refungible token --- pallets/refungible/src/common.rs | 4 ++-- pallets/refungible/src/lib.rs | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index 99dca10fe1..9296b04f40 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -413,8 +413,8 @@ impl CommonCollectionOperations for RefungibleHandle { TokenId(>::get(self.id)) } - fn token_owner(&self, _token: TokenId) -> Option { - None + fn token_owner(&self, token: TokenId) -> Option { + >::token_owner(self.id, token) } fn token_property(&self, _token_id: TokenId, _key: &PropertyKey) -> Option { diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 43f38009c7..c8dde50b11 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -1094,6 +1094,19 @@ impl Pallet { Ok(()) } + fn token_owner(collection_id: CollectionId, token_id: TokenId) -> Option { + let mut owner = None; + let mut count = 0; + for key in Balance::::iter_key_prefix((collection_id, token_id)) { + count += 1; + if count > 1 { + return None; + } + owner = Some(key); + } + owner + } + fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option { >::try_get((collection_id, token_id)).ok() } From c7ac40c1ba37abe8bb91ce8fc590e7d895dfeba5 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 8 Jul 2022 12:30:42 +0300 Subject: [PATCH 0039/1274] CORE-410 Restor tests --- tests/src/interfaces/augment-api-query.ts | 1 + tests/src/interfaces/default/types.ts | 2 + tests/src/interfaces/lookup.ts | 6 +- tests/src/interfaces/types-lookup.ts | 2 + tests/src/nesting/properties.test.ts | 249 ++++++++++++---------- tests/src/util/helpers.ts | 2 +- 6 files changed, 145 insertions(+), 117 deletions(-) diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 6ed2a40ec5..a083c0840a 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -408,6 +408,7 @@ declare module '@polkadot/api-base/types/storage' { **/ owned: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]> & QueryableStorageEntry; tokenData: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; + tokenProperties: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; tokensBurnt: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; tokensMinted: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; totalSupply: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index d76bcd5fcc..fdf7a56dbe 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -2461,12 +2461,14 @@ export interface UpDataStructsCreateNftExData extends Struct { export interface UpDataStructsCreateReFungibleData extends Struct { readonly constData: Bytes; readonly pieces: u128; + readonly properties: Vec; } /** @name UpDataStructsCreateRefungibleExData */ export interface UpDataStructsCreateRefungibleExData extends Struct { readonly constData: Bytes; readonly users: BTreeMap; + readonly properties: Vec; } /** @name UpDataStructsNestingPermissions */ diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index f58502a4ff..8c86f78454 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -1502,7 +1502,8 @@ export default { **/ UpDataStructsCreateReFungibleData: { constData: 'Bytes', - pieces: 'u128' + pieces: 'u128', + properties: 'Vec' }, /** * Lookup193: up_data_structs::CreateItemExData> @@ -1527,7 +1528,8 @@ export default { **/ UpDataStructsCreateRefungibleExData: { constData: 'Bytes', - users: 'BTreeMap' + users: 'BTreeMap', + properties: 'Vec' }, /** * Lookup204: pallet_unique_scheduler::pallet::Call diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 04ac25a6fe..df155cfbd9 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1629,6 +1629,7 @@ declare module '@polkadot/types/lookup' { export interface UpDataStructsCreateReFungibleData extends Struct { readonly constData: Bytes; readonly pieces: u128; + readonly properties: Vec; } /** @name UpDataStructsCreateItemExData (193) */ @@ -1654,6 +1655,7 @@ declare module '@polkadot/types/lookup' { export interface UpDataStructsCreateRefungibleExData extends Struct { readonly constData: Bytes; readonly users: BTreeMap; + readonly properties: Vec; } /** @name PalletUniqueSchedulerCall (204) */ diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index 0cb3f4331d..4d9abd323c 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -806,123 +806,144 @@ describe('Integration Test: Token Properties', () => { await testDeletePropertiesAccordingPermission({type: 'ReFungible'}, 100); }); - // it('Assigns properties to a nested token according to permissions', async () => { - // await usingApi(async api => { - // const propertyKeys: string[] = []; - // let i = 0; - // for (const permission of permissions) { - // for (const signer of permission.signers) { - // const key = i + '_' + signer.address; - // propertyKeys.push(key); - - // await expect(executeTransaction( - // api, - // alice, - // api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), - // ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - - // await expect(executeTransaction( - // api, - // signer, - // api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]), - // ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - // } - - // i++; - // } - - // const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toHuman() as any[]; - // const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toHuman().properties as any[]; - // for (let i = 0; i < properties.length; i++) { - // expect(properties[i].value).to.be.equal('Serotonin increase'); - // expect(tokensData[i].value).to.be.equal('Serotonin increase'); - // } - // }); - // }); - - // it('Changes properties of a nested token according to permissions', async () => { - // await usingApi(async api => { - // const propertyKeys: string[] = []; - // let i = 0; - // for (const permission of permissions) { - // if (!permission.permission.mutable) continue; + it('Assigns properties to a nested token according to permissions', async () => { + await usingApi(async api => { + const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); + await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); + const token = await createItemExpectSuccess(alice, collection, 'NFT'); + const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, token)}); + await addCollectionAdminExpectSuccess(alice, collection, bob.address); + await transferExpectSuccess(collection, token, alice, charlie); + + const propertyKeys: string[] = []; + let i = 0; + for (const permission of permissions) { + for (const signer of permission.signers) { + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect(executeTransaction( + api, + alice, + api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), + ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; + + await expect(executeTransaction( + api, + signer, + api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]), + ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; + } + + i++; + } + + const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toHuman() as any[]; + const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toHuman().properties as any[]; + for (let i = 0; i < properties.length; i++) { + expect(properties[i].value).to.be.equal('Serotonin increase'); + expect(tokensData[i].value).to.be.equal('Serotonin increase'); + } + }); + }); + + it('Changes properties of a nested token according to permissions', async () => { + await usingApi(async api => { + const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); + await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); + const token = await createItemExpectSuccess(alice, collection, 'NFT'); + const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, token)}); + await addCollectionAdminExpectSuccess(alice, collection, bob.address); + await transferExpectSuccess(collection, token, alice, charlie); + + const propertyKeys: string[] = []; + let i = 0; + for (const permission of permissions) { + if (!permission.permission.mutable) continue; - // for (const signer of permission.signers) { - // const key = i + '_' + signer.address; - // propertyKeys.push(key); - - // await expect(executeTransaction( - // api, - // alice, - // api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), - // ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - - // await expect(executeTransaction( - // api, - // signer, - // api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]), - // ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - - // await expect(executeTransaction( - // api, - // signer, - // api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin stable'}]), - // ), `on changing property ${i} by ${signer.address}`).to.not.be.rejected; - // } - - // i++; - // } - - // const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toHuman() as any[]; - // const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toHuman().properties as any[]; - // for (let i = 0; i < properties.length; i++) { - // expect(properties[i].value).to.be.equal('Serotonin stable'); - // expect(tokensData[i].value).to.be.equal('Serotonin stable'); - // } - // }); - // }); - - // it('Deletes properties of a nested token according to permissions', async () => { - // await usingApi(async api => { - // const propertyKeys: string[] = []; - // let i = 0; - - // for (const permission of permissions) { - // if (!permission.permission.mutable) continue; + for (const signer of permission.signers) { + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect(executeTransaction( + api, + alice, + api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), + ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; + + await expect(executeTransaction( + api, + signer, + api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]), + ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; + + await expect(executeTransaction( + api, + signer, + api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin stable'}]), + ), `on changing property ${i} by ${signer.address}`).to.not.be.rejected; + } + + i++; + } + + const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toHuman() as any[]; + const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toHuman().properties as any[]; + for (let i = 0; i < properties.length; i++) { + expect(properties[i].value).to.be.equal('Serotonin stable'); + expect(tokensData[i].value).to.be.equal('Serotonin stable'); + } + }); + }); + + it('Deletes properties of a nested token according to permissions', async () => { + await usingApi(async api => { + const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); + await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); + const token = await createItemExpectSuccess(alice, collection, 'NFT'); + const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, token)}); + await addCollectionAdminExpectSuccess(alice, collection, bob.address); + await transferExpectSuccess(collection, token, alice, charlie); + + const propertyKeys: string[] = []; + let i = 0; + + for (const permission of permissions) { + if (!permission.permission.mutable) continue; - // for (const signer of permission.signers) { - // const key = i + '_' + signer.address; - // propertyKeys.push(key); - - // await expect(executeTransaction( - // api, - // alice, - // api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), - // ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - - // await expect(executeTransaction( - // api, - // signer, - // api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]), - // ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - - // await expect(executeTransaction( - // api, - // signer, - // api.tx.unique.deleteTokenProperties(collection, nestedToken, [key]), - // ), `on deleting property ${i} by ${signer.address}`).to.not.be.rejected; - // } + for (const signer of permission.signers) { + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect(executeTransaction( + api, + alice, + api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), + ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; + + await expect(executeTransaction( + api, + signer, + api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]), + ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; + + await expect(executeTransaction( + api, + signer, + api.tx.unique.deleteTokenProperties(collection, nestedToken, [key]), + ), `on deleting property ${i} by ${signer.address}`).to.not.be.rejected; + } - // i++; - // } - - // const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toJSON() as any[]; - // expect(properties).to.be.empty; - // const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toJSON().properties as any[]; - // expect(tokensData).to.be.empty; - // expect((await api.query.nonfungible.tokenProperties(collection, nestedToken)).toJSON().consumedSpace).to.be.equal(0); - // }); - // }); + i++; + } + + const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toJSON() as any[]; + expect(properties).to.be.empty; + const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toJSON().properties as any[]; + expect(tokensData).to.be.empty; + expect((await api.query.nonfungible.tokenProperties(collection, nestedToken)).toJSON().consumedSpace).to.be.equal(0); + }); + }); }); describe('Negative Integration Test: Token Properties', () => { diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index d128a3ac65..8c94c53470 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -1414,7 +1414,7 @@ export async function createItemExpectSuccess(sender: IKeyringPair, collectionId tx = api.tx.unique.createItem(collectionId, to, createData as any); } - const events = await submitTransactionAsync(sender, tx); + const events = await executeTransaction(api, sender, tx); const result = getCreateItemResult(events); const itemCountAfter = await getLastTokenId(api, collectionId); From 8e054576cf615387ed1e800fa63f05551dbed5f6 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 15 Jul 2022 10:24:59 +0000 Subject: [PATCH 0040/1274] misc: Changelog's added. --- pallets/refungible/Cargo.toml | 2 +- pallets/refungible/Changelog.md | 3 +++ primitives/data-structs/Cargo.toml | 2 +- primitives/data-structs/Changelog.md | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 pallets/refungible/Changelog.md create mode 100644 primitives/data-structs/Changelog.md diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index c64f51ccb6..a8ad85fe7a 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-refungible" -version = "0.1.0" +version = "0.1.1" license = "GPLv3" edition = "2021" diff --git a/pallets/refungible/Changelog.md b/pallets/refungible/Changelog.md new file mode 100644 index 0000000000..5e47b7d6ed --- /dev/null +++ b/pallets/refungible/Changelog.md @@ -0,0 +1,3 @@ +### 0.1.1 +--- +* Added support for properties for RFT collections and tokens. diff --git a/primitives/data-structs/Cargo.toml b/primitives/data-structs/Cargo.toml index a63ba3d076..22b9a42ffe 100644 --- a/primitives/data-structs/Cargo.toml +++ b/primitives/data-structs/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = 'GPLv3' homepage = "https://unique.network" repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.1.0' +version = '0.1.1' [dependencies] scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/primitives/data-structs/Changelog.md b/primitives/data-structs/Changelog.md new file mode 100644 index 0000000000..4de0308eda --- /dev/null +++ b/primitives/data-structs/Changelog.md @@ -0,0 +1,3 @@ +### 0.1.1 +--- +* Added fields with properties to `CreateReFungibleData` and `CreateRefungibleExData`. \ No newline at end of file From e2d77d3f153d9b05e0e1248fc9037bb7d232352d Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 15 Jul 2022 10:43:02 +0000 Subject: [PATCH 0041/1274] misc: update Cargo.lock --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 011bca7331..b62628298b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6320,7 +6320,7 @@ dependencies = [ [[package]] name = "pallet-refungible" -version = "0.1.0" +version = "0.1.1" dependencies = [ "frame-benchmarking", "frame-support", @@ -12733,7 +12733,7 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "up-data-structs" -version = "0.1.0" +version = "0.1.1" dependencies = [ "derivative", "frame-support", From 31c5482db3c6294214422a7752caff7afd8ca81d Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 15 Jul 2022 13:32:48 +0000 Subject: [PATCH 0042/1274] doc: Fix PR --- pallets/common/src/dispatch.rs | 2 +- pallets/common/src/eth.rs | 2 +- pallets/common/src/lib.rs | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pallets/common/src/dispatch.rs b/pallets/common/src/dispatch.rs index 0282938a8b..3f9d204241 100644 --- a/pallets/common/src/dispatch.rs +++ b/pallets/common/src/dispatch.rs @@ -94,6 +94,6 @@ pub trait CollectionDispatch { /// Get the collection handle for the corresponding implementation. fn into_inner(self) -> CollectionHandle; - /// Получить реализацию [CommonCollectionOperations]. + /// Get the implementation of [CommonCollectionOperations]. fn as_dyn(&self) -> &dyn CommonCollectionOperations; } diff --git a/pallets/common/src/eth.rs b/pallets/common/src/eth.rs index 002b7b4f19..c5bfd6ce58 100644 --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -//! The module contains a number of functions for converting and checking etherium identifiers. +//! The module contains a number of functions for converting and checking ethereum identifiers. use up_data_structs::CollectionId; use sp_core::H160; diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index e93f5660cd..282892f3da 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -132,6 +132,9 @@ pub type SelfWeightOf = ::WeightInfo; /// Collection handle contains information about collection data and id. /// Also provides functionality to count consumed gas. +/// CollectionHandle is used as a generic wrapper for collections of all types. +/// It allows to perform common operations and queries on any collection type, +/// both completely general for all, as well as their respective implementations of [CommonCollectionOperations]. #[must_use = "Should call submit_logs or save, otherwise some data will be lost for evm side"] pub struct CollectionHandle { /// Collection id From 1a56db748b0a12eb13a8e38c06bd2888fb398cc1 Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Mon, 11 Jul 2022 08:52:02 +0000 Subject: [PATCH 0043/1274] doc: architectural changes --- client/rpc/src/lib.rs | 35 +++- pallets/common/src/lib.rs | 94 ++++++--- pallets/fungible/src/lib.rs | 4 + pallets/nonfungible/src/lib.rs | 15 +- pallets/refungible/src/lib.rs | 15 +- pallets/scheduler/src/lib.rs | 3 + pallets/structure/src/lib.rs | 16 +- pallets/unique/src/lib.rs | 216 +++++++++++++++++---- primitives/data-structs/src/lib.rs | 29 ++- tests/src/interfaces/unique/definitions.ts | 10 +- 10 files changed, 346 insertions(+), 91 deletions(-) diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index 2b22c1c4b3..e08db1e34b 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -42,6 +42,7 @@ pub use rmrk_unique_rpc::RmrkApiServer; #[rpc(server)] #[async_trait] pub trait UniqueApi { + /// Get tokens owned by account #[method(name = "unique_accountTokens")] fn account_tokens( &self, @@ -49,12 +50,14 @@ pub trait UniqueApi { account: CrossAccountId, at: Option, ) -> Result>; + /// Get tokens contained in collection #[method(name = "unique_collectionTokens")] fn collection_tokens( &self, collection: CollectionId, at: Option, ) -> Result>; + /// Check if token exists #[method(name = "unique_tokenExists")] fn token_exists( &self, @@ -62,7 +65,7 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result; - + /// Get token owner #[method(name = "unique_tokenOwner")] fn token_owner( &self, @@ -70,6 +73,7 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result>; + /// Get token owner, in case of nested token - find the parent recursively #[method(name = "unique_topmostTokenOwner")] fn topmost_token_owner( &self, @@ -77,6 +81,7 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result>; + /// Get tokens nested directly into the token #[method(name = "unique_tokenChildren")] fn token_children( &self, @@ -84,7 +89,7 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result>; - + /// Get collection properties #[method(name = "unique_collectionProperties")] fn collection_properties( &self, @@ -92,7 +97,7 @@ pub trait UniqueApi { keys: Option>, at: Option, ) -> Result>; - + /// Get token properties #[method(name = "unique_tokenProperties")] fn token_properties( &self, @@ -101,7 +106,7 @@ pub trait UniqueApi { keys: Option>, at: Option, ) -> Result>; - + /// Get property permissions #[method(name = "unique_propertyPermissions")] fn property_permissions( &self, @@ -109,7 +114,7 @@ pub trait UniqueApi { keys: Option>, at: Option, ) -> Result>; - + /// Get token data #[method(name = "unique_tokenData")] fn token_data( &self, @@ -118,9 +123,10 @@ pub trait UniqueApi { keys: Option>, at: Option, ) -> Result>; - + /// Get amount of unique collection tokens #[method(name = "unique_totalSupply")] fn total_supply(&self, collection: CollectionId, at: Option) -> Result; + /// Get owned amount of any user tokens #[method(name = "unique_accountBalance")] fn account_balance( &self, @@ -128,6 +134,7 @@ pub trait UniqueApi { account: CrossAccountId, at: Option, ) -> Result; + /// Get owned amount of specific account token #[method(name = "unique_balance")] fn balance( &self, @@ -136,6 +143,7 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result; + /// Get allowed amount #[method(name = "unique_allowance")] fn allowance( &self, @@ -145,19 +153,21 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result; - + /// Get admin list #[method(name = "unique_adminlist")] fn adminlist( &self, collection: CollectionId, at: Option, ) -> Result>; + /// Get allowlist #[method(name = "unique_allowlist")] fn allowlist( &self, collection: CollectionId, at: Option, ) -> Result>; + /// Check if user is allowed to use collection #[method(name = "unique_allowed")] fn allowed( &self, @@ -165,17 +175,20 @@ pub trait UniqueApi { user: CrossAccountId, at: Option, ) -> Result; + /// Get last token ID created in a collection #[method(name = "unique_lastTokenId")] fn last_token_id(&self, collection: CollectionId, at: Option) -> Result; + /// Get collection by specified ID #[method(name = "unique_collectionById")] fn collection_by_id( &self, collection: CollectionId, at: Option, ) -> Result>>; + /// Get collection stats #[method(name = "unique_collectionStats")] fn collection_stats(&self, at: Option) -> Result; - + /// Get number of blocks when sponsored transaction is available #[method(name = "unique_nextSponsored")] fn next_sponsored( &self, @@ -184,14 +197,14 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result>; - + /// Get effective collection limits #[method(name = "unique_effectiveCollectionLimits")] fn effective_collection_limits( &self, collection_id: CollectionId, at: Option, ) -> Result>; - + /// Get total pieces of token #[method(name = "unique_totalPieces")] fn total_pieces( &self, @@ -304,6 +317,7 @@ mod rmrk_unique_rpc { fn base_parts(&self, base_id: RmrkBaseId, at: Option) -> Result>; #[method(name = "rmrk_themeNames")] + /// Get Base's theme names fn theme_names( &self, base_id: RmrkBaseId, @@ -311,6 +325,7 @@ mod rmrk_unique_rpc { ) -> Result>; #[method(name = "rmrk_themes")] + /// Get Theme info -- name, properties, and inherit flag fn theme( &self, base_id: RmrkBaseId, diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 5055b78cdd..e2a0a34319 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -299,46 +299,48 @@ pub mod pallet { /// /// # Arguments /// - /// * collection_id: Globally unique identifier of collection. + /// * collection_id: Globally unique identifier of collection that has been destroyed. CollectionDestroyed(CollectionId), /// New item was created. /// /// # Arguments /// - /// * collection_id: Id of the collection where item was created. + /// * collection_id: ID of the collection where the item was created. /// - /// * item_id: Id of an item. Unique within the collection. + /// * item_id: ID of the item. Unique within the collection. /// - /// * recipient: Owner of newly created item + /// * recipient: Owner of the newly created item. /// - /// * amount: Always 1 for NFT + /// * amount: The amount of tokens that were created (always 1 for NFT). ItemCreated(CollectionId, TokenId, T::CrossAccountId, u128), /// Collection item was burned. /// /// # Arguments /// - /// * collection_id. + /// * collection_id: Identifier of the collection to which the burned NFT belonged. /// /// * item_id: Identifier of burned NFT. /// - /// * owner: which user has destroyed its tokens + /// * owner: Which user has destroyed their tokens. /// - /// * amount: Always 1 for NFT + /// * amount: The amount of tokens that were destroyed (always 1 for NFT). ItemDestroyed(CollectionId, TokenId, T::CrossAccountId, u128), - /// Item was transferred + /// Item was transferred. + /// + /// # Arguments /// - /// * collection_id: Id of collection to which item is belong + /// * collection_id: ID of the collection to which the item belongs. /// - /// * item_id: Id of an item + /// * item_id: ID of the item trasnferred. /// - /// * sender: Original owner of item + /// * sender: Original owner of the item. /// - /// * recipient: New owner of item + /// * recipient: New owner of the item. /// - /// * amount: Always 1 for NFT + /// * amount: The amount of tokens that were transferred (always 1 for NFT). Transfer( CollectionId, TokenId, @@ -347,6 +349,10 @@ pub mod pallet { u128, ), + /// Sponsoring allowance was approved. + /// + /// # Arguments + /// /// * collection_id /// /// * item_id @@ -364,14 +370,53 @@ pub mod pallet { u128, ), + /// Collection property was added or edited. + /// + /// # Arguments + /// + /// * collection_id: ID of the collection, whose property was just set. + /// + /// * property_key: Key of the property that was just set. CollectionPropertySet(CollectionId, PropertyKey), + /// Collection property was deleted. + /// + /// # Arguments + /// + /// * collection_id: ID of the collection, whose property was just deleted. + /// + /// * property_key: Key of the property that was just deleted. CollectionPropertyDeleted(CollectionId, PropertyKey), + /// Item property was added or edited. + /// + /// # Arguments + /// + /// * collection_id: ID of the collection, whose token's property was just set. + /// + /// * item_id: ID of the item, whose property was just set. + /// + /// * property_key: Key of the property that was just set. TokenPropertySet(CollectionId, TokenId, PropertyKey), + /// Item property was deleted. + /// + /// # Arguments + /// + /// * collection_id: ID of the collection, whose token's property was just deleted. + /// + /// * item_id: ID of the item, whose property was just deleted. + /// + /// * property_key: Key of the property that was just deleted. TokenPropertyDeleted(CollectionId, TokenId, PropertyKey), + /// Token property permission was added or updated for a collection. + /// + /// # Arguments + /// + /// * collection_id: ID of the collection, whose permissions were just set/updated. + /// + /// * property_key: Key of the property of the set/updated permission. PropertyPermissionSet(CollectionId, PropertyKey), } @@ -413,26 +458,26 @@ pub mod pallet { /// Metadata flag frozen MetadataFlagFrozen, - /// Item not exists. + /// Item does not exist TokenNotFound, - /// Item balance not enough. + /// Item is balance not enough TokenValueTooLow, - /// Requested value more than approved. + /// Requested value is more than the approved ApprovedValueTooLow, /// Tried to approve more than owned CantApproveMoreThanOwned, /// Can't transfer tokens to ethereum zero address AddressIsZero, - /// Target collection doesn't supports this operation + /// Target collection doesn't support this operation UnsupportedOperation, - /// Not sufficient funds to perform action + /// Insufficient funds to perform an action NotSufficientFounds, - /// User not passed nesting rule + /// User does not satisfy the nesting rule UserIsNotAllowedToNest, - /// Only tokens from specific collections may nest tokens under this + /// Only tokens from specific collections may nest tokens under this one SourceCollectionIsNotAllowedToNest, /// Tried to store more data than allowed in collection field @@ -447,7 +492,7 @@ pub mod pallet { /// Property key is too long PropertyKeyIsTooLong, - /// Only ASCII letters, digits, and '_', '-' are allowed + /// Only ASCII letters, digits, and symbols '_', '-', and '.' are allowed InvalidCharacterInPropertyKey, /// Empty property keys are forbidden @@ -460,8 +505,11 @@ pub mod pallet { CollectionIsInternal, } + /// The number of created collections. Essentially contains the last collection ID. #[pallet::storage] pub type CreatedCollectionCount = StorageValue; + + /// The number of destroyed collections #[pallet::storage] pub type DestroyedCollectionCount = StorageValue; @@ -486,6 +534,7 @@ pub mod pallet { OnEmpty = up_data_structs::CollectionProperties, >; + /// Token permissions of a collection #[pallet::storage] #[pallet::getter(fn property_permissions)] pub type CollectionPropertyPermissions = StorageMap< @@ -495,6 +544,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// Amount of collection admins #[pallet::storage] pub type AdminAmount = StorageMap< Hasher = Blake2_128Concat, diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index d3a9d97c10..0e18fe4449 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -44,6 +44,7 @@ pub mod common; pub mod erc; pub mod weights; +/// todo:doc? pub type CreateItemData = (::CrossAccountId, u128); pub(crate) type SelfWeightOf = ::WeightInfo; @@ -78,10 +79,12 @@ pub mod pallet { #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); + /// Total amount of fungible tokens inside a collection. #[pallet::storage] pub type TotalSupply = StorageMap; + /// Amount of tokens owned by an account inside a collection. #[pallet::storage] pub type Balance = StorageNMap< Key = ( @@ -92,6 +95,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// todo:doc #[pallet::storage] pub type Allowance = StorageNMap< Key = ( diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 76f647326c..683faf89ba 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -56,6 +56,8 @@ pub mod weights; pub type CreateItemData = CreateNftExData<::CrossAccountId>; pub(crate) type SelfWeightOf = ::WeightInfo; +/// Token data, stored independently from other data used to describe it. +/// Notably contains the owner account address. #[struct_versioning::versioned(version = 2, upper)] #[derive(Encode, Decode, TypeInfo, MaxEncodedLen)] pub struct ItemData { @@ -102,13 +104,17 @@ pub mod pallet { #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); + /// Total amount of minted tokens in a collection. #[pallet::storage] pub type TokensMinted = StorageMap; + + /// Amount of burnt tokens in a collection. #[pallet::storage] pub type TokensBurnt = StorageMap; + /// Token data, used to partially describe a token. #[pallet::storage] pub type TokenData = StorageNMap< Key = (Key, Key), @@ -116,6 +122,7 @@ pub mod pallet { QueryKind = OptionQuery, >; + /// Key-value pairs, describing the metadata of a token. #[pallet::storage] #[pallet::getter(fn token_properties)] pub type TokenProperties = StorageNMap< @@ -125,6 +132,7 @@ pub mod pallet { OnEmpty = up_data_structs::TokenProperties, >; + /// Scoped, auxiliary properties of a token, primarily used for on-chain operations. #[pallet::storage] #[pallet::getter(fn token_aux_property)] pub type TokenAuxProperties = StorageNMap< @@ -138,7 +146,7 @@ pub mod pallet { QueryKind = OptionQuery, >; - /// Used to enumerate tokens owned by account + /// Used to enumerate tokens owned by account. #[pallet::storage] pub type Owned = StorageNMap< Key = ( @@ -150,7 +158,7 @@ pub mod pallet { QueryKind = ValueQuery, >; - /// Used to enumerate token's children + /// Used to enumerate token's children. #[pallet::storage] #[pallet::getter(fn token_children)] pub type TokenChildren = StorageNMap< @@ -163,6 +171,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// Amount of tokens owned in a collection.s #[pallet::storage] pub type AccountBalance = StorageNMap< Key = ( @@ -173,6 +182,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// todo doc #[pallet::storage] pub type Allowance = StorageNMap< Key = (Key, Key), @@ -180,6 +190,7 @@ pub mod pallet { QueryKind = OptionQuery, >; + /// Upgrade from the old schema to properties. #[pallet::hooks] impl Hooks> for Pallet { fn on_runtime_upgrade() -> Weight { diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 3bea36bc6b..81f563d24d 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -38,6 +38,8 @@ pub mod erc; pub mod weights; pub(crate) type SelfWeightOf = ::WeightInfo; +/// Token data, stored independently from other data used to describe it. +/// Notably contains the token metadata. #[struct_versioning::versioned(version = 2, upper)] #[derive(Encode, Decode, Default, TypeInfo, MaxEncodedLen)] pub struct ItemData { @@ -86,13 +88,17 @@ pub mod pallet { #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); + /// Total amount of minted tokens in a collection. #[pallet::storage] pub type TokensMinted = StorageMap; + + /// Amount of tokens burnt in a collection. #[pallet::storage] pub type TokensBurnt = StorageMap; + /// Token data, used to partially describe a token. #[pallet::storage] pub type TokenData = StorageNMap< Key = (Key, Key), @@ -100,6 +106,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// Amount of pieces a refungible token is split into. #[pallet::storage] pub type TotalSupply = StorageNMap< Key = (Key, Key), @@ -107,7 +114,7 @@ pub mod pallet { QueryKind = ValueQuery, >; - /// Used to enumerate tokens owned by account + /// Used to enumerate tokens owned by account. #[pallet::storage] pub type Owned = StorageNMap< Key = ( @@ -119,6 +126,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// Amount of tokens (not pieces) partially owned by an account within a collection. #[pallet::storage] pub type AccountBalance = StorageNMap< Key = ( @@ -130,6 +138,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// Amount of pieces of a token owned by an account. #[pallet::storage] pub type Balance = StorageNMap< Key = ( @@ -142,6 +151,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// todo:doc #[pallet::storage] pub type Allowance = StorageNMap< Key = ( @@ -248,7 +258,7 @@ impl Pallet { // TODO: ERC721 transfer event Ok(()) } - + pub fn burn( collection: &RefungibleHandle, owner: &T::CrossAccountId, @@ -595,6 +605,7 @@ impl Pallet { Ok(()) } + /// todo:doc oh look, a precedent. not pub, too. but it has an unclear use-case. /// Returns allowance, which should be set after transaction fn check_allowed( collection: &RefungibleHandle, diff --git a/pallets/scheduler/src/lib.rs b/pallets/scheduler/src/lib.rs index 7813bc0d4e..b7f1e91f06 100644 --- a/pallets/scheduler/src/lib.rs +++ b/pallets/scheduler/src/lib.rs @@ -258,6 +258,7 @@ pub mod pallet { /// A Scheduler-Runtime interface for finer payment handling. pub trait DispatchCall { + /// Reserve the maximum spendings on a call. fn reserve_balance( id: ScheduledId, sponsor: ::AccountId, @@ -265,6 +266,7 @@ pub mod pallet { count: u32, ) -> Result<(), DispatchError>; + /// Pay for call dispatch (un-reserve) from the reserved funds, returning the change. fn pay_for_call( id: ScheduledId, sponsor: ::AccountId, @@ -280,6 +282,7 @@ pub mod pallet { TransactionValidityError, >; + /// Release reserved funds. fn cancel_reserve( id: ScheduledId, sponsor: ::AccountId, diff --git a/pallets/structure/src/lib.rs b/pallets/structure/src/lib.rs index 58defa2929..525ec533e1 100644 --- a/pallets/structure/src/lib.rs +++ b/pallets/structure/src/lib.rs @@ -25,19 +25,19 @@ pub mod pallet { #[pallet::error] pub enum Error { - /// While searched for owner, got already checked account + /// While searching for the owner, encountered an already checked account, detecting a loop. OuroborosDetected, - /// While searched for owner, encountered depth limit + /// While searching for the owner, reached the depth limit. DepthLimit, - /// While iterating over children, encountered breadth limit + /// While iterating over children, reached the breadth limit. BreadthLimit, - /// While searched for owner, found token owner by not-yet-existing token + /// Couldn't find the token owner that is a token. Perhaps, it does not yet exist. todo:doc? rephrase? TokenNotFound, } #[pallet::event] pub enum Event { - /// Executed call on behalf of token + /// Executed call on behalf of the token. Executed(DispatchResult), } @@ -73,11 +73,11 @@ pub mod pallet { #[derive(PartialEq)] pub enum Parent { - /// Token owned by normal account + /// Token owned by a normal account. User(CrossAccountId), - /// Passed token not found + /// Could not find the token provided as the owner. TokenNotFound, - /// Token owner is another token (target token still may not exist) + /// Token owner is another token (still, the target token may not exist). Token(CollectionId, TokenId), } diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index f935c89688..c36a4b369e 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -101,7 +101,7 @@ decl_event! { /// * admin: Admin address. CollectionAdminAdded(CollectionId, CrossAccountId), - /// Collection owned was change + /// Collection owned was changed /// /// # Arguments /// @@ -137,7 +137,7 @@ decl_event! { /// * admin: Admin address. CollectionAdminRemoved(CollectionId, CrossAccountId), - /// Address was remove from allow list + /// Address was removed from the allow list /// /// # Arguments /// @@ -146,7 +146,7 @@ decl_event! { /// * user: Address. AllowListAddressRemoved(CollectionId, CrossAccountId), - /// Address was add to allow list + /// Address was added to the allow list /// /// # Arguments /// @@ -155,13 +155,18 @@ decl_event! { /// * user: Address. AllowListAddressAdded(CollectionId, CrossAccountId), - /// Collection limits was set + /// Collection limits were set /// /// # Arguments /// /// * collection_id: Globally unique collection identifier. CollectionLimitSet(CollectionId), + /// Collection permissions were set + /// + /// # Arguments + /// + /// * collection_id: Globally unique collection identifier. CollectionPermissionSet(CollectionId), } } @@ -198,7 +203,7 @@ decl_storage! { ChainVersion: u64; //#endregion - //#region Tokens transfer rate limit baskets + //#region Tokens transfer sponosoring rate limit baskets /// (Collection id (controlled?2), who created (real)) /// TODO: Off chain worker should remove from this map when collection gets removed pub CreateItemBasket get(fn create_item_basket): map hasher(blake2_128_concat) (CollectionId, T::AccountId) => Option; @@ -214,11 +219,14 @@ decl_storage! { /// Collection id (controlled?2), token id (controlled?2) #[deprecated] pub VariableMetaDataBasket get(fn variable_meta_data_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option; + /// Last sponsoring of token property setting // todo:doc rephrase this and the following pub TokenPropertyBasket get(fn token_property_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option; - /// Approval sponsoring + /// Last sponsoring of NFT approval in a collection pub NftApproveBasket get(fn nft_approve_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option; + /// Last sponsoring of fungible tokens approval in a collection pub FungibleApproveBasket get(fn fungible_approve_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(twox_64_concat) T::AccountId => Option; + /// Last sponsoring of RFT approval in a collection pub RefungibleApproveBasket get(fn refungible_approve_basket): nmap hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId, hasher(twox_64_concat) T::AccountId => Option; } } @@ -278,9 +286,16 @@ decl_module! { Self::create_collection_ex(origin, data) } - /// This method creates a collection + /// Create a collection with explicit parameters. + /// Prefer it to the deprecated [`created_collection`] method. + /// + /// # Permissions /// - /// Prefer it to deprecated [`created_collection`] method + /// * Anyone. + /// + /// # Arguments + /// + /// * data: explicit create-collection data. #[weight = >::create_collection()] #[transactional] pub fn create_collection_ex(origin, data: CreateCollectionData) -> DispatchResult { @@ -293,11 +308,11 @@ decl_module! { Ok(()) } - /// Destroys collection if no tokens within this collection + /// Destroy the collection if no tokens exist within. /// /// # Permissions /// - /// * Collection Owner. + /// * Collection Owner /// /// # Arguments /// @@ -398,7 +413,7 @@ decl_module! { /// /// # Permissions /// - /// * Collection Owner. + /// * Collection Owner /// /// # Arguments /// @@ -424,40 +439,40 @@ decl_module! { target_collection.save() } - /// Adds an admin of the Collection. + /// Adds an admin of the collection. /// NFT Collection can be controlled by multiple admin addresses (some which can also be servers, for example). Admins can issue and burn NFTs, as well as add and remove other admins, but cannot change NFT or Collection ownership. /// /// # Permissions /// - /// * Collection Owner. - /// * Collection Admin. + /// * Collection Owner + /// * Collection Admin /// /// # Arguments /// /// * collection_id: ID of the Collection to add admin for. /// - /// * new_admin_id: Address of new admin to add. + /// * new_admin: Address of new admin to add. #[weight = >::add_collection_admin()] #[transactional] - pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin_id: T::CrossAccountId) -> DispatchResult { + pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin: T::CrossAccountId) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let collection = >::try_get(collection_id)?; collection.check_is_internal()?; >::deposit_event(Event::::CollectionAdminAdded( collection_id, - new_admin_id.clone() + new_admin.clone() )); - >::toggle_admin(&collection, &sender, &new_admin_id, true) + >::toggle_admin(&collection, &sender, &new_admin, true) } /// Remove admin address of the Collection. An admin address can remove itself. List of admins may become empty, in which case only Collection Owner will be able to add an Admin. /// /// # Permissions /// - /// * Collection Owner. - /// * Collection Admin. + /// * Collection Owner + /// * Collection Admin /// /// # Arguments /// @@ -479,9 +494,12 @@ decl_module! { >::toggle_admin(&collection, &sender, &account_id, false) } + /// Set (invite) a new collection sponsor. If successful, confirmation from the sponsor-to-be will be pending. + /// /// # Permissions /// /// * Collection Owner + /// * Collection Admin /// /// # Arguments /// @@ -507,9 +525,11 @@ decl_module! { target_collection.save() } + /// Confirm own sponsorship of a collection. + /// /// # Permissions /// - /// * Sponsor. + /// * The sponsor to-be /// /// # Arguments /// @@ -538,7 +558,7 @@ decl_module! { /// /// # Permissions /// - /// * Collection owner. + /// * Collection Owner /// /// # Arguments /// @@ -560,12 +580,12 @@ decl_module! { target_collection.save() } - /// This method creates a concrete instance of NFT Collection created with CreateCollection method. + /// Create a concrete instance of NFT Collection created with CreateCollection method. /// /// # Permissions /// - /// * Collection Owner. - /// * Collection Admin. + /// * Collection Owner + /// * Collection Admin /// * Anyone if /// * Allow List is enabled, and /// * Address is added to allow list, and @@ -587,12 +607,12 @@ decl_module! { dispatch_tx::(collection_id, |d| d.create_item(sender, owner, data, &budget)) } - /// This method creates multiple items in a collection created with CreateCollection method. + /// Create multiple items in a collection created with CreateCollection method. /// /// # Permissions /// - /// * Collection Owner. - /// * Collection Admin. + /// * Collection Owner + /// * Collection Admin /// * Anyone if /// * Allow List is enabled, and /// * Address is added to allow list, and @@ -615,6 +635,18 @@ decl_module! { dispatch_tx::(collection_id, |d| d.create_multiple_items(sender, owner, items_data, &budget)) } + /// Add or change collection properties. + /// + /// # Permissions + /// + /// * Collection Owner + /// * Collection Admin + /// + /// # Arguments + /// + /// * collection_id. + /// + /// * properties: a vector of key-value pairs stored as the collection's metadata. Keys support Latin letters, '-', '_', and '.' as symbols. #[weight = T::CommonWeightInfo::set_collection_properties(properties.len() as u32)] #[transactional] pub fn set_collection_properties( @@ -629,6 +661,18 @@ decl_module! { dispatch_tx::(collection_id, |d| d.set_collection_properties(sender, properties)) } + /// Delete specified collection properties. + /// + /// # Permissions + /// + /// * Collection Owner + /// * Collection Admin + /// + /// # Arguments + /// + /// * collection_id. + /// + /// * property_keys: a vector of keys of the properties to be deleted. #[weight = T::CommonWeightInfo::delete_collection_properties(property_keys.len() as u32)] #[transactional] pub fn delete_collection_properties( @@ -643,6 +687,22 @@ decl_module! { dispatch_tx::(collection_id, |d| d.delete_collection_properties(&sender, property_keys)) } + /// Add or change token properties according to collection's permissions. + /// + /// # Permissions + /// + /// * Depends on collection's token property permissions and specified property mutability: + /// * Collection Owner + /// * Collection Admin + /// * Token Owner + /// + /// # Arguments + /// + /// * collection_id. + /// + /// * token_id. + /// + /// * properties: a vector of key-value pairs stored as the token's metadata. Keys support Latin letters, '-', '_', and '.' as symbols. #[weight = T::CommonWeightInfo::set_token_properties(properties.len() as u32)] #[transactional] pub fn set_token_properties( @@ -659,6 +719,22 @@ decl_module! { dispatch_tx::(collection_id, |d| d.set_token_properties(sender, token_id, properties, &budget)) } + /// Delete specified token properties. + /// + /// # Permissions + /// + /// * Depends on collection's token property permissions and specified property mutability: + /// * Collection Owner + /// * Collection Admin + /// * Token Owner + /// + /// # Arguments + /// + /// * collection_id. + /// + /// * token_id. + /// + /// * property_keys: a vector of keys of the properties to be deleted. #[weight = T::CommonWeightInfo::delete_token_properties(property_keys.len() as u32)] #[transactional] pub fn delete_token_properties( @@ -675,6 +751,18 @@ decl_module! { dispatch_tx::(collection_id, |d| d.delete_token_properties(sender, token_id, property_keys, &budget)) } + /// Add or change token property permissions of a collection. + /// + /// # Permissions + /// + /// * Collection Owner + /// * Collection Admin + /// + /// # Arguments + /// + /// * collection_id. + /// + /// * property_permissions: a vector of permissions for property keys. Keys support Latin letters, '-', '_', and '.' as symbols. #[weight = T::CommonWeightInfo::set_token_property_permissions(property_permissions.len() as u32)] #[transactional] pub fn set_token_property_permissions( @@ -689,6 +777,22 @@ decl_module! { dispatch_tx::(collection_id, |d| d.set_token_property_permissions(&sender, property_permissions)) } + /// Create multiple items inside a collection with explicitly specified initial parameters. + /// + /// # Permissions + /// + /// * Collection Owner + /// * Collection Admin + /// * Anyone if + /// * Allow List is enabled, and + /// * Address is added to allow list, and + /// * MintPermission is enabled (see SetMintPermission method) + /// + /// # Arguments + /// + /// * collection_id: ID of the collection. + /// + /// * data: explicit item creation data. #[weight = T::CommonWeightInfo::create_multiple_items_ex(&data)] #[transactional] pub fn create_multiple_items_ex(origin, collection_id: CollectionId, data: CreateItemExData) -> DispatchResultWithPostInfo { @@ -698,11 +802,11 @@ decl_module! { dispatch_tx::(collection_id, |d| d.create_multiple_items_ex(sender, data, &budget)) } - /// Set transfers_enabled value for particular collection + /// Set transfers_enabled value for particular collection. /// /// # Permissions /// - /// * Collection Owner. + /// * Collection Owner /// /// # Arguments /// @@ -723,13 +827,13 @@ decl_module! { target_collection.save() } - /// Destroys a concrete instance of NFT. + /// Destroy a concrete instance of NFT. /// /// # Permissions /// - /// * Collection Owner. - /// * Collection Admin. - /// * Current NFT Owner. + /// * Collection Owner + /// * Collection Admin + /// * Current NFT Owner /// /// # Arguments /// @@ -752,7 +856,7 @@ decl_module! { Ok(post_info) } - /// Destroys a concrete instance of NFT on behalf of the owner + /// Destroy a concrete instance of NFT on behalf of the owner. /// See also: [`approve`] /// /// # Permissions @@ -835,6 +939,7 @@ decl_module! { /// Change ownership of a NFT on behalf of the owner. See Approve method for additional information. After this method executes, the approval is removed so that the approved address will not be able to transfer this NFT again from this owner. /// /// # Permissions + /// /// * Collection Owner /// * Collection Admin /// * Current NFT owner @@ -860,6 +965,18 @@ decl_module! { dispatch_tx::(collection_id, |d| d.transfer_from(sender, from, recipient, item_id, value, &budget)) } + /// Set specific limits of a collection. Empty, or None fields mean chain default. + ///. + /// # Permissions + /// + /// * Collection Owner + /// * Collection Admin + /// + /// # Arguments + /// + /// * collection_id. + /// + /// * new_limit: The new limits of the collection. They will overwrite the current ones. #[weight = >::set_collection_limits()] #[transactional] pub fn set_collection_limits( @@ -882,12 +999,24 @@ decl_module! { target_collection.save() } + /// Set specific permissions of a collection. Empty, or None fields mean chain default. + /// + /// # Permissions + /// + /// * Collection Owner + /// * Collection Admin + /// + /// # Arguments + /// + /// * collection_id. + /// + /// * new_permission: The new permissions of the collection. They will overwrite the current ones. #[weight = >::set_collection_limits()] #[transactional] pub fn set_collection_permissions( origin, collection_id: CollectionId, - new_limit: CollectionPermissions, + new_permission: CollectionPermissions, ) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let mut target_collection = >::try_get(collection_id)?; @@ -895,7 +1024,7 @@ decl_module! { target_collection.check_is_owner_or_admin(&sender)?; let old_limit = &target_collection.permissions; - target_collection.permissions = >::clamp_permissions(target_collection.mode.clone(), &old_limit, new_limit)?; + target_collection.permissions = >::clamp_permissions(target_collection.mode.clone(), &old_limit, new_permission)?; >::deposit_event(Event::::CollectionPermissionSet( collection_id @@ -904,6 +1033,19 @@ decl_module! { target_collection.save() } + /// Re-partition a refungible token, while owning all of its parts. + /// + /// # Permissions + /// + /// * Token Owner (must own every part) + /// + /// # Arguments + /// + /// * collection_id. + /// + /// * token: the ID of the RFT. + /// + /// * amount: The new number of parts into which the token shall be partitioned. #[weight = T::RefungibleExtensionsWeightInfo::repartition()] #[transactional] pub fn repartition( diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 3bd999d856..207939ec35 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -197,7 +197,6 @@ pub type DecimalPoints = u8; #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub enum CollectionMode { NFT, - // decimal points Fungible(DecimalPoints), ReFungible, } @@ -252,12 +251,14 @@ pub struct Ownership { pub enum SponsorshipState { /// The fees are applied to the transaction sender Disabled, + /// Pending confirmation from a sponsor-to-be Unconfirmed(AccountId), /// Transactions are sponsored by specified account Confirmed(AccountId), } impl SponsorshipState { + /// Get the acting sponsor account, if present pub fn sponsor(&self) -> Option<&AccountId> { match self { Self::Confirmed(sponsor) => Some(sponsor), @@ -265,6 +266,7 @@ impl SponsorshipState { } } + /// Get the sponsor account currently pending confirmation, if present pub fn pending_sponsor(&self) -> Option<&AccountId> { match self { Self::Unconfirmed(sponsor) | Self::Confirmed(sponsor) => Some(sponsor), @@ -272,6 +274,7 @@ impl SponsorshipState { } } + /// Is sponsorship set and acting pub fn confirmed(&self) -> bool { matches!(self, Self::Confirmed(_)) } @@ -283,7 +286,7 @@ impl Default for SponsorshipState { } } -/// Used in storage +/// Collection parameters, used in storage (see [`RpcCollection`] for the RPC version) #[struct_versioning::versioned(version = 2, upper)] #[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen)] pub struct Collection { @@ -324,7 +327,7 @@ pub struct Collection { pub meta_update_permission: MetaUpdatePermission, } -/// Used in RPC calls +/// Collection parameters, used in RPC calls (see [`Collection`] for the storage version) #[derive(Encode, Decode, Clone, PartialEq, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct RpcCollection { @@ -362,12 +365,15 @@ pub type CollectionPropertiesPermissionsVec = pub type CollectionPropertiesVec = BoundedVec>; -/// All fields are wrapped in `Option`s, where None means chain default +/// Limits and restrictions of a collection. +/// All fields are wrapped in `Option`s, where None means chain default. // When adding/removing fields from this struct - don't forget to also update clamp_limits #[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct CollectionLimits { + /// Maximum number of owned tokens per account pub account_token_ownership_limit: Option, + /// Maximum size of data of a sponsored transaction pub sponsored_data_size: Option, /// FIXME should we delete this or repurpose it? @@ -375,13 +381,18 @@ pub struct CollectionLimits { /// Some(v) - setVariableMetadata is sponsored /// if there is v block between txs pub sponsored_data_rate_limit: Option, + /// Maximum amount of tokens inside the collection pub token_limit: Option, - // Timeouts for item types in passed blocks + /// Timeout for sponsoring a token transfer in passed blocks pub sponsor_transfer_timeout: Option, + /// Timeout for sponsoring an approval in passed blocks pub sponsor_approve_timeout: Option, + /// Can a token be transferred by the owner pub owner_can_transfer: Option, + /// Can a token be burned by the owner pub owner_can_destroy: Option, + /// Can a token be transferred at all pub transfers_enabled: Option, } @@ -509,6 +520,7 @@ pub struct NestingPermissions { #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub enum SponsoringRateLimit { SponsoringDisabled, + /// Once per how many blocks can sponsorship of a transaction type occur Blocks(u32), } @@ -516,6 +528,7 @@ pub enum SponsoringRateLimit { #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] #[derivative(Debug)] pub struct CreateNftData { + /// Key-value pairs used to describe the token as metadata #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))] #[derivative(Debug(format_with = "bounded::vec_debug"))] pub properties: CollectionPropertiesVec, @@ -524,6 +537,7 @@ pub struct CreateNftData { #[derive(Encode, Decode, MaxEncodedLen, Default, Debug, Clone, PartialEq, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct CreateFungibleData { + /// Number of fungible tokens minted pub value: u128, } @@ -534,6 +548,7 @@ pub struct CreateReFungibleData { #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))] #[derivative(Debug(format_with = "bounded::vec_debug"))] pub const_data: BoundedVec, + /// Number of pieces the RFT is split into pub pieces: u128, } @@ -553,6 +568,7 @@ pub enum CreateItemData { ReFungible(CreateReFungibleData), } +/// Explicit NFT creation data with meta parameters #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] #[derivative(Debug)] pub struct CreateNftExData { @@ -561,6 +577,7 @@ pub struct CreateNftExData { pub owner: CrossAccountId, } +/// Explicit RFT creation data with meta parameters #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] #[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))] pub struct CreateRefungibleExData { @@ -570,6 +587,7 @@ pub struct CreateRefungibleExData { pub users: BoundedBTreeMap>, } +/// Explicit item creation data with meta parameters, namely the owner #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] #[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))] pub enum CreateItemExData { @@ -617,6 +635,7 @@ impl From for CreateItemData { } } +/// Token's address, dictated by its collection and token IDs #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] // todo possibly rename to be used generally as an address pair diff --git a/tests/src/interfaces/unique/definitions.ts b/tests/src/interfaces/unique/definitions.ts index aaa72cc26f..0c5d445f2b 100644 --- a/tests/src/interfaces/unique/definitions.ts +++ b/tests/src/interfaces/unique/definitions.ts @@ -43,13 +43,13 @@ export default { accountTokens: fun('Get tokens owned by account', [collectionParam, crossAccountParam()], 'Vec'), collectionTokens: fun('Get tokens contained in collection', [collectionParam], 'Vec'), - lastTokenId: fun('Get last token id', [collectionParam], 'u32'), + lastTokenId: fun('Get last token ID created in a collection', [collectionParam], 'u32'), totalSupply: fun('Get amount of unique collection tokens', [collectionParam], 'u32'), - accountBalance: fun('Get amount of different user tokens', [collectionParam, crossAccountParam()], 'u32'), - balance: fun('Get amount of specific account token', [collectionParam, crossAccountParam(), tokenParam], 'u128'), + accountBalance: fun('Get owned amount of any user tokens', [collectionParam, crossAccountParam()], 'u32'), + balance: fun('Get owned amount of specific account token', [collectionParam, crossAccountParam(), tokenParam], 'u128'), allowance: fun('Get allowed amount', [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam], 'u128'), tokenOwner: fun('Get token owner', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`), - topmostTokenOwner: fun('Get token owner, in case of nested token - find parent recursive', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`), + topmostTokenOwner: fun('Get token owner, in case of nested token - find the parent recursively', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`), tokenChildren: fun('Get tokens nested directly into the token', [collectionParam, tokenParam], 'Vec'), constMetadata: fun('Get token constant metadata', [collectionParam, tokenParam], 'Vec'), variableMetadata: fun('Get token variable metadata', [collectionParam, tokenParam], 'Vec'), @@ -74,7 +74,7 @@ export default { 'UpDataStructsTokenData', ), tokenExists: fun('Check if token exists', [collectionParam, tokenParam], 'bool'), - collectionById: fun('Get collection by specified id', [collectionParam], 'Option'), + collectionById: fun('Get collection by specified ID', [collectionParam], 'Option'), collectionStats: fun('Get collection stats', [], 'UpDataStructsCollectionStats'), allowed: fun('Check if user is allowed to use collection', [collectionParam, crossAccountParam()], 'bool'), nextSponsored: fun('Get number of blocks when sponsored transaction is available', [collectionParam, crossAccountParam(), tokenParam], 'Option'), From 6035f8d62cec5f8c266805612d51f21fb130fb19 Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Mon, 11 Jul 2022 08:53:27 +0000 Subject: [PATCH 0044/1274] style: cargo fmt --- pallets/common/src/lib.rs | 40 +++++++++++++++++------------------ pallets/refungible/src/lib.rs | 4 ++-- pallets/unique/src/lib.rs | 30 +++++++++++++------------- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index e2a0a34319..ceacbbd8b7 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -329,7 +329,7 @@ pub mod pallet { ItemDestroyed(CollectionId, TokenId, T::CrossAccountId, u128), /// Item was transferred. - /// + /// /// # Arguments /// /// * collection_id: ID of the collection to which the item belongs. @@ -350,9 +350,9 @@ pub mod pallet { ), /// Sponsoring allowance was approved. - /// + /// /// # Arguments - /// + /// /// * collection_id /// /// * item_id @@ -371,51 +371,51 @@ pub mod pallet { ), /// Collection property was added or edited. - /// + /// /// # Arguments - /// + /// /// * collection_id: ID of the collection, whose property was just set. - /// + /// /// * property_key: Key of the property that was just set. CollectionPropertySet(CollectionId, PropertyKey), /// Collection property was deleted. - /// + /// /// # Arguments - /// + /// /// * collection_id: ID of the collection, whose property was just deleted. - /// + /// /// * property_key: Key of the property that was just deleted. CollectionPropertyDeleted(CollectionId, PropertyKey), /// Item property was added or edited. - /// + /// /// # Arguments - /// + /// /// * collection_id: ID of the collection, whose token's property was just set. - /// + /// /// * item_id: ID of the item, whose property was just set. - /// + /// /// * property_key: Key of the property that was just set. TokenPropertySet(CollectionId, TokenId, PropertyKey), /// Item property was deleted. - /// + /// /// # Arguments - /// + /// /// * collection_id: ID of the collection, whose token's property was just deleted. - /// + /// /// * item_id: ID of the item, whose property was just deleted. - /// + /// /// * property_key: Key of the property that was just deleted. TokenPropertyDeleted(CollectionId, TokenId, PropertyKey), /// Token property permission was added or updated for a collection. - /// + /// /// # Arguments - /// + /// /// * collection_id: ID of the collection, whose permissions were just set/updated. - /// + /// /// * property_key: Key of the property of the set/updated permission. PropertyPermissionSet(CollectionId, PropertyKey), } diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 81f563d24d..1473c7c390 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -92,7 +92,7 @@ pub mod pallet { #[pallet::storage] pub type TokensMinted = StorageMap; - + /// Amount of tokens burnt in a collection. #[pallet::storage] pub type TokensBurnt = @@ -258,7 +258,7 @@ impl Pallet { // TODO: ERC721 transfer event Ok(()) } - + pub fn burn( collection: &RefungibleHandle, owner: &T::CrossAccountId, diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index c36a4b369e..b3619b2805 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -163,9 +163,9 @@ decl_event! { CollectionLimitSet(CollectionId), /// Collection permissions were set - /// + /// /// # Arguments - /// + /// /// * collection_id: Globally unique collection identifier. CollectionPermissionSet(CollectionId), } @@ -219,7 +219,7 @@ decl_storage! { /// Collection id (controlled?2), token id (controlled?2) #[deprecated] pub VariableMetaDataBasket get(fn variable_meta_data_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option; - /// Last sponsoring of token property setting // todo:doc rephrase this and the following + /// Last sponsoring of token property setting // todo:doc rephrase this and the following pub TokenPropertyBasket get(fn token_property_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option; /// Last sponsoring of NFT approval in a collection @@ -294,7 +294,7 @@ decl_module! { /// * Anyone. /// /// # Arguments - /// + /// /// * data: explicit create-collection data. #[weight = >::create_collection()] #[transactional] @@ -495,7 +495,7 @@ decl_module! { } /// Set (invite) a new collection sponsor. If successful, confirmation from the sponsor-to-be will be pending. - /// + /// /// # Permissions /// /// * Collection Owner @@ -526,7 +526,7 @@ decl_module! { } /// Confirm own sponsorship of a collection. - /// + /// /// # Permissions /// /// * The sponsor to-be @@ -699,7 +699,7 @@ decl_module! { /// # Arguments /// /// * collection_id. - /// + /// /// * token_id. /// /// * properties: a vector of key-value pairs stored as the token's metadata. Keys support Latin letters, '-', '_', and '.' as symbols. @@ -778,7 +778,7 @@ decl_module! { } /// Create multiple items inside a collection with explicitly specified initial parameters. - /// + /// /// # Permissions /// /// * Collection Owner @@ -792,7 +792,7 @@ decl_module! { /// /// * collection_id: ID of the collection. /// - /// * data: explicit item creation data. + /// * data: explicit item creation data. #[weight = T::CommonWeightInfo::create_multiple_items_ex(&data)] #[transactional] pub fn create_multiple_items_ex(origin, collection_id: CollectionId, data: CreateItemExData) -> DispatchResultWithPostInfo { @@ -939,7 +939,7 @@ decl_module! { /// Change ownership of a NFT on behalf of the owner. See Approve method for additional information. After this method executes, the approval is removed so that the approved address will not be able to transfer this NFT again from this owner. /// /// # Permissions - /// + /// /// * Collection Owner /// * Collection Admin /// * Current NFT owner @@ -968,7 +968,7 @@ decl_module! { /// Set specific limits of a collection. Empty, or None fields mean chain default. ///. /// # Permissions - /// + /// /// * Collection Owner /// * Collection Admin /// @@ -1002,7 +1002,7 @@ decl_module! { /// Set specific permissions of a collection. Empty, or None fields mean chain default. /// /// # Permissions - /// + /// /// * Collection Owner /// * Collection Admin /// @@ -1036,14 +1036,14 @@ decl_module! { /// Re-partition a refungible token, while owning all of its parts. /// /// # Permissions - /// + /// /// * Token Owner (must own every part) /// /// # Arguments /// /// * collection_id. - /// - /// * token: the ID of the RFT. + /// + /// * token: the ID of the RFT. /// /// * amount: The new number of parts into which the token shall be partitioned. #[weight = T::RefungibleExtensionsWeightInfo::repartition()] From 9b4da675e61d411392a27ac6bdc1dc19cbc2be19 Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Mon, 11 Jul 2022 09:11:47 +0000 Subject: [PATCH 0045/1274] doc: minor fixes + typos --- client/rpc/src/lib.rs | 22 ++++++++++++++++++++++ pallets/common/src/lib.rs | 2 +- pallets/fungible/src/lib.rs | 8 ++++---- pallets/nonfungible/src/lib.rs | 4 ++-- pallets/refungible/src/lib.rs | 9 ++++----- pallets/structure/src/lib.rs | 2 +- primitives/data-structs/src/lib.rs | 12 ++++++------ 7 files changed, 40 insertions(+), 19 deletions(-) diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index e08db1e34b..62c6f92fc6 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -50,6 +50,7 @@ pub trait UniqueApi { account: CrossAccountId, at: Option, ) -> Result>; + /// Get tokens contained in collection #[method(name = "unique_collectionTokens")] fn collection_tokens( @@ -57,6 +58,7 @@ pub trait UniqueApi { collection: CollectionId, at: Option, ) -> Result>; + /// Check if token exists #[method(name = "unique_tokenExists")] fn token_exists( @@ -65,6 +67,7 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result; + /// Get token owner #[method(name = "unique_tokenOwner")] fn token_owner( @@ -73,6 +76,7 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result>; + /// Get token owner, in case of nested token - find the parent recursively #[method(name = "unique_topmostTokenOwner")] fn topmost_token_owner( @@ -81,6 +85,7 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result>; + /// Get tokens nested directly into the token #[method(name = "unique_tokenChildren")] fn token_children( @@ -89,6 +94,7 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result>; + /// Get collection properties #[method(name = "unique_collectionProperties")] fn collection_properties( @@ -97,6 +103,7 @@ pub trait UniqueApi { keys: Option>, at: Option, ) -> Result>; + /// Get token properties #[method(name = "unique_tokenProperties")] fn token_properties( @@ -106,6 +113,7 @@ pub trait UniqueApi { keys: Option>, at: Option, ) -> Result>; + /// Get property permissions #[method(name = "unique_propertyPermissions")] fn property_permissions( @@ -114,6 +122,7 @@ pub trait UniqueApi { keys: Option>, at: Option, ) -> Result>; + /// Get token data #[method(name = "unique_tokenData")] fn token_data( @@ -123,9 +132,11 @@ pub trait UniqueApi { keys: Option>, at: Option, ) -> Result>; + /// Get amount of unique collection tokens #[method(name = "unique_totalSupply")] fn total_supply(&self, collection: CollectionId, at: Option) -> Result; + /// Get owned amount of any user tokens #[method(name = "unique_accountBalance")] fn account_balance( @@ -134,6 +145,7 @@ pub trait UniqueApi { account: CrossAccountId, at: Option, ) -> Result; + /// Get owned amount of specific account token #[method(name = "unique_balance")] fn balance( @@ -143,6 +155,7 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result; + /// Get allowed amount #[method(name = "unique_allowance")] fn allowance( @@ -153,6 +166,7 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result; + /// Get admin list #[method(name = "unique_adminlist")] fn adminlist( @@ -160,6 +174,7 @@ pub trait UniqueApi { collection: CollectionId, at: Option, ) -> Result>; + /// Get allowlist #[method(name = "unique_allowlist")] fn allowlist( @@ -167,6 +182,7 @@ pub trait UniqueApi { collection: CollectionId, at: Option, ) -> Result>; + /// Check if user is allowed to use collection #[method(name = "unique_allowed")] fn allowed( @@ -175,9 +191,11 @@ pub trait UniqueApi { user: CrossAccountId, at: Option, ) -> Result; + /// Get last token ID created in a collection #[method(name = "unique_lastTokenId")] fn last_token_id(&self, collection: CollectionId, at: Option) -> Result; + /// Get collection by specified ID #[method(name = "unique_collectionById")] fn collection_by_id( @@ -185,9 +203,11 @@ pub trait UniqueApi { collection: CollectionId, at: Option, ) -> Result>>; + /// Get collection stats #[method(name = "unique_collectionStats")] fn collection_stats(&self, at: Option) -> Result; + /// Get number of blocks when sponsored transaction is available #[method(name = "unique_nextSponsored")] fn next_sponsored( @@ -197,6 +217,7 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result>; + /// Get effective collection limits #[method(name = "unique_effectiveCollectionLimits")] fn effective_collection_limits( @@ -204,6 +225,7 @@ pub trait UniqueApi { collection_id: CollectionId, at: Option, ) -> Result>; + /// Get total pieces of token #[method(name = "unique_totalPieces")] fn total_pieces( diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index ceacbbd8b7..16210916da 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -334,7 +334,7 @@ pub mod pallet { /// /// * collection_id: ID of the collection to which the item belongs. /// - /// * item_id: ID of the item trasnferred. + /// * item_id: ID of the item transferred. /// /// * sender: Original owner of the item. /// diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index 0e18fe4449..697303c9fb 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -58,13 +58,13 @@ pub mod pallet { pub enum Error { /// Not Fungible item data used to mint in Fungible collection. NotFungibleDataUsedToMintFungibleCollectionToken, - /// Not default id passed as TokenId argument + /// Not default id passed as TokenId argument. FungibleItemsHaveNoId, - /// Tried to set data for fungible item + /// Tried to set data for fungible item. FungibleItemsDontHaveData, - /// Fungible token does not support nested + /// Fungible token does not support nesting. FungibleDisallowsNesting, - /// Setting item properties is not allowed + /// Setting item properties is not allowed. SettingPropertiesNotAllowed, } diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 683faf89ba..8dab4cf05e 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -171,7 +171,7 @@ pub mod pallet { QueryKind = ValueQuery, >; - /// Amount of tokens owned in a collection.s + /// Amount of tokens owned in a collection. #[pallet::storage] pub type AccountBalance = StorageNMap< Key = ( @@ -182,7 +182,7 @@ pub mod pallet { QueryKind = ValueQuery, >; - /// todo doc + /// todo:doc #[pallet::storage] pub type Allowance = StorageNMap< Key = (Key, Key), diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 1473c7c390..7f418c9e33 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -64,13 +64,13 @@ pub mod pallet { pub enum Error { /// Not Refungible item data used to mint in Refungible collection. NotRefungibleDataUsedToMintFungibleCollectionToken, - /// Maximum refungibility exceeded + /// Maximum refungibility exceeded. WrongRefungiblePieces, - /// Refungible token can't be repartitioned by user who isn't owns all pieces + /// Refungible token can't be repartitioned by user who isn't owns all pieces. RepartitionWhileNotOwningAllPieces, - /// Refungible token can't nest other tokens + /// Refungible token can't nest other tokens. RefungibleDisallowsNesting, - /// Setting item properties is not allowed + /// Setting item properties is not allowed. SettingPropertiesNotAllowed, } @@ -605,7 +605,6 @@ impl Pallet { Ok(()) } - /// todo:doc oh look, a precedent. not pub, too. but it has an unclear use-case. /// Returns allowance, which should be set after transaction fn check_allowed( collection: &RefungibleHandle, diff --git a/pallets/structure/src/lib.rs b/pallets/structure/src/lib.rs index 525ec533e1..7113c637f4 100644 --- a/pallets/structure/src/lib.rs +++ b/pallets/structure/src/lib.rs @@ -31,7 +31,7 @@ pub mod pallet { DepthLimit, /// While iterating over children, reached the breadth limit. BreadthLimit, - /// Couldn't find the token owner that is a token. Perhaps, it does not yet exist. todo:doc? rephrase? + /// Couldn't find the token owner that is itself a token. TokenNotFound, } diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 207939ec35..703130c305 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -286,7 +286,7 @@ impl Default for SponsorshipState { } } -/// Collection parameters, used in storage (see [`RpcCollection`] for the RPC version) +/// Collection parameters, used in storage (see [`RpcCollection`] for the RPC version). #[struct_versioning::versioned(version = 2, upper)] #[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen)] pub struct Collection { @@ -327,7 +327,7 @@ pub struct Collection { pub meta_update_permission: MetaUpdatePermission, } -/// Collection parameters, used in RPC calls (see [`Collection`] for the storage version) +/// Collection parameters, used in RPC calls (see [`Collection`] for the storage version). #[derive(Encode, Decode, Clone, PartialEq, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct RpcCollection { @@ -568,7 +568,7 @@ pub enum CreateItemData { ReFungible(CreateReFungibleData), } -/// Explicit NFT creation data with meta parameters +/// Explicit NFT creation data with meta parameters. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] #[derivative(Debug)] pub struct CreateNftExData { @@ -577,7 +577,7 @@ pub struct CreateNftExData { pub owner: CrossAccountId, } -/// Explicit RFT creation data with meta parameters +/// Explicit RFT creation data with meta parameters. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] #[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))] pub struct CreateRefungibleExData { @@ -587,7 +587,7 @@ pub struct CreateRefungibleExData { pub users: BoundedBTreeMap>, } -/// Explicit item creation data with meta parameters, namely the owner +/// Explicit item creation data with meta parameters, namely the owner. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] #[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))] pub enum CreateItemExData { @@ -635,7 +635,7 @@ impl From for CreateItemData { } } -/// Token's address, dictated by its collection and token IDs +/// Token's address, dictated by its collection and token IDs. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] // todo possibly rename to be used generally as an address pair From ff0ca4cea89277870dbb84eef9e729c5ac4c07ca Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Mon, 11 Jul 2022 10:00:14 +0000 Subject: [PATCH 0046/1274] doc: adjust documentation style --- pallets/common/src/lib.rs | 83 ++++++++++--------------- pallets/unique/src/lib.rs | 123 ++++++++++++++------------------------ 2 files changed, 74 insertions(+), 132 deletions(-) diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 16210916da..77e0be1260 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -288,59 +288,47 @@ pub mod pallet { /// /// # Arguments /// - /// * collection_id: Globally unique identifier of newly created collection. - /// - /// * mode: [CollectionMode] converted into u8. - /// - /// * account_id: Collection owner. + /// * collection_id - Globally unique identifier of newly created collection. + /// * mode - [CollectionMode] converted into u8. + /// * account_id - Collection owner. CollectionCreated(CollectionId, u8, T::AccountId), /// New collection was destroyed /// /// # Arguments /// - /// * collection_id: Globally unique identifier of collection that has been destroyed. + /// * collection_id - Globally unique identifier of collection that has been destroyed. CollectionDestroyed(CollectionId), /// New item was created. /// /// # Arguments /// - /// * collection_id: ID of the collection where the item was created. - /// - /// * item_id: ID of the item. Unique within the collection. - /// - /// * recipient: Owner of the newly created item. - /// - /// * amount: The amount of tokens that were created (always 1 for NFT). + /// * collection_id - ID of the collection where the item was created. + /// * item_id - ID of the item. Unique within the collection. + /// * recipient - Owner of the newly created item. + /// * amount - The amount of tokens that were created (always 1 for NFT). ItemCreated(CollectionId, TokenId, T::CrossAccountId, u128), /// Collection item was burned. /// /// # Arguments /// - /// * collection_id: Identifier of the collection to which the burned NFT belonged. - /// - /// * item_id: Identifier of burned NFT. - /// - /// * owner: Which user has destroyed their tokens. - /// - /// * amount: The amount of tokens that were destroyed (always 1 for NFT). + /// * collection_id - Identifier of the collection to which the burned NFT belonged. + /// * item_id - Identifier of burned NFT. + /// * owner - Which user has destroyed their tokens. + /// * amount - Amount of tokens that were destroyed (always 1 for NFT). ItemDestroyed(CollectionId, TokenId, T::CrossAccountId, u128), /// Item was transferred. /// /// # Arguments /// - /// * collection_id: ID of the collection to which the item belongs. - /// - /// * item_id: ID of the item transferred. - /// - /// * sender: Original owner of the item. - /// - /// * recipient: New owner of the item. - /// - /// * amount: The amount of tokens that were transferred (always 1 for NFT). + /// * collection_id - ID of the collection to which the item belongs. + /// * item_id - ID of the item transferred. + /// * sender - Original owner of the item. + /// * recipient - New owner of the item. + /// * amount - Amount of tokens that were transferred (always 1 for NFT). Transfer( CollectionId, TokenId, @@ -353,14 +341,10 @@ pub mod pallet { /// /// # Arguments /// - /// * collection_id - /// + /// * collection_id - todo:doc flesh out /// * item_id - /// /// * sender - /// /// * spender - /// /// * amount Approved( CollectionId, @@ -374,49 +358,42 @@ pub mod pallet { /// /// # Arguments /// - /// * collection_id: ID of the collection, whose property was just set. - /// - /// * property_key: Key of the property that was just set. + /// * collection_id - ID of the collection, whose property was just set. + /// * property_key - Key of the property that was just set. CollectionPropertySet(CollectionId, PropertyKey), /// Collection property was deleted. /// /// # Arguments /// - /// * collection_id: ID of the collection, whose property was just deleted. - /// - /// * property_key: Key of the property that was just deleted. + /// * collection_id - ID of the collection, whose property was just deleted. + /// * property_key - Key of the property that was just deleted. CollectionPropertyDeleted(CollectionId, PropertyKey), /// Item property was added or edited. /// /// # Arguments /// - /// * collection_id: ID of the collection, whose token's property was just set. - /// - /// * item_id: ID of the item, whose property was just set. - /// - /// * property_key: Key of the property that was just set. + /// * collection_id - ID of the collection, whose token's property was just set. + /// * item_id - ID of the item, whose property was just set. + /// * property_key - Key of the property that was just set. TokenPropertySet(CollectionId, TokenId, PropertyKey), /// Item property was deleted. /// /// # Arguments /// - /// * collection_id: ID of the collection, whose token's property was just deleted. - /// - /// * item_id: ID of the item, whose property was just deleted. - /// - /// * property_key: Key of the property that was just deleted. + /// * collection_id - ID of the collection, whose token's property was just deleted. + /// * item_id - ID of the item, whose property was just deleted. + /// * property_key - Key of the property that was just deleted. TokenPropertyDeleted(CollectionId, TokenId, PropertyKey), /// Token property permission was added or updated for a collection. /// /// # Arguments /// - /// * collection_id: ID of the collection, whose permissions were just set/updated. - /// - /// * property_key: Key of the property of the set/updated permission. + /// * collection_id - ID of the collection, whose permissions were just set/updated. + /// * property_key - Key of the property of the set/updated permission. PropertyPermissionSet(CollectionId, PropertyKey), } diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index b3619b2805..d8a86e71ed 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -261,12 +261,9 @@ decl_module! { /// # Arguments /// /// * collection_name: UTF-16 string with collection name (limit 64 characters), will be stored as zero-terminated. - /// - /// * collection_description: UTF-16 string with collection description (limit 256 characters), will be stored as zero-terminated. - /// - /// * token_prefix: UTF-8 string with token prefix. - /// - /// * mode: [CollectionMode] collection type and type dependent data. + /// * collection_description - UTF-16 string with collection description (limit 256 characters), will be stored as zero-terminated. + /// * token_prefix - UTF-8 string with token prefix. + /// * mode - [CollectionMode] collection type and type dependent data. // returns collection ID #[weight = >::create_collection()] #[transactional] @@ -316,7 +313,7 @@ decl_module! { /// /// # Arguments /// - /// * collection_id: collection to destroy. + /// * collection_id - collection to destroy. #[weight = >::destroy_collection()] #[transactional] pub fn destroy_collection(origin, collection_id: CollectionId) -> DispatchResult { @@ -349,7 +346,6 @@ decl_module! { /// # Arguments /// /// * collection_id. - /// /// * address. #[weight = >::add_to_allow_list()] #[transactional] @@ -384,7 +380,6 @@ decl_module! { /// # Arguments /// /// * collection_id. - /// /// * address. #[weight = >::remove_from_allow_list()] #[transactional] @@ -418,7 +413,6 @@ decl_module! { /// # Arguments /// /// * collection_id. - /// /// * new_owner. #[weight = >::change_collection_owner()] #[transactional] @@ -449,9 +443,8 @@ decl_module! { /// /// # Arguments /// - /// * collection_id: ID of the Collection to add admin for. - /// - /// * new_admin: Address of new admin to add. + /// * collection_id - ID of the Collection to add admin for. + /// * new_admin - Address of new admin to add. #[weight = >::add_collection_admin()] #[transactional] pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin: T::CrossAccountId) -> DispatchResult { @@ -476,9 +469,8 @@ decl_module! { /// /// # Arguments /// - /// * collection_id: ID of the Collection to remove admin for. - /// - /// * account_id: Address of admin to remove. + /// * collection_id - ID of the Collection to remove admin for. + /// * account_id - Address of admin to remove. #[weight = >::remove_collection_admin()] #[transactional] pub fn remove_collection_admin(origin, collection_id: CollectionId, account_id: T::CrossAccountId) -> DispatchResult { @@ -504,7 +496,6 @@ decl_module! { /// # Arguments /// /// * collection_id. - /// /// * new_sponsor. #[weight = >::set_collection_sponsor()] #[transactional] @@ -529,7 +520,7 @@ decl_module! { /// /// # Permissions /// - /// * The sponsor to-be + /// * Sponsor-to-be /// /// # Arguments /// @@ -593,11 +584,9 @@ decl_module! { /// /// # Arguments /// - /// * collection_id: ID of the collection. - /// - /// * owner: Address, initial owner of the NFT. - /// - /// * data: Token data to store on chain. + /// * collection_id - ID of the collection. + /// * owner - Address, initial owner of the NFT. + /// * data - Token data to store on chain. #[weight = T::CommonWeightInfo::create_item()] #[transactional] pub fn create_item(origin, collection_id: CollectionId, owner: T::CrossAccountId, data: CreateItemData) -> DispatchResultWithPostInfo { @@ -620,11 +609,9 @@ decl_module! { /// /// # Arguments /// - /// * collection_id: ID of the collection. - /// - /// * itemsData: Array items properties. Each property is an array of bytes itself, see [create_item]. - /// - /// * owner: Address, initial owner of the NFT. + /// * collection_id - ID of the collection. + /// * owner - Address, initial owner of the NFT. + /// * items_data - Array items properties. Each property is an array of bytes itself, see [`create_item`]. #[weight = T::CommonWeightInfo::create_multiple_items(&items_data)] #[transactional] pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec) -> DispatchResultWithPostInfo { @@ -645,8 +632,7 @@ decl_module! { /// # Arguments /// /// * collection_id. - /// - /// * properties: a vector of key-value pairs stored as the collection's metadata. Keys support Latin letters, '-', '_', and '.' as symbols. + /// * properties - Vector of key-value pairs stored as the collection's metadata. Keys support Latin letters, '-', '_', and '.' as symbols. #[weight = T::CommonWeightInfo::set_collection_properties(properties.len() as u32)] #[transactional] pub fn set_collection_properties( @@ -671,8 +657,7 @@ decl_module! { /// # Arguments /// /// * collection_id. - /// - /// * property_keys: a vector of keys of the properties to be deleted. + /// * property_keys - Vector of keys of the properties to be deleted. #[weight = T::CommonWeightInfo::delete_collection_properties(property_keys.len() as u32)] #[transactional] pub fn delete_collection_properties( @@ -699,10 +684,8 @@ decl_module! { /// # Arguments /// /// * collection_id. - /// /// * token_id. - /// - /// * properties: a vector of key-value pairs stored as the token's metadata. Keys support Latin letters, '-', '_', and '.' as symbols. + /// * properties - Vector of key-value pairs stored as the token's metadata. Keys support Latin letters, `-`, `_`, and `.` as symbols. #[weight = T::CommonWeightInfo::set_token_properties(properties.len() as u32)] #[transactional] pub fn set_token_properties( @@ -731,10 +714,8 @@ decl_module! { /// # Arguments /// /// * collection_id. - /// /// * token_id. - /// - /// * property_keys: a vector of keys of the properties to be deleted. + /// * property_keys - Vector of keys of the properties to be deleted. #[weight = T::CommonWeightInfo::delete_token_properties(property_keys.len() as u32)] #[transactional] pub fn delete_token_properties( @@ -761,8 +742,7 @@ decl_module! { /// # Arguments /// /// * collection_id. - /// - /// * property_permissions: a vector of permissions for property keys. Keys support Latin letters, '-', '_', and '.' as symbols. + /// * property_permissions - Vector of permissions for property keys. Keys support Latin letters, `-`, `_`, and `.` as symbols. #[weight = T::CommonWeightInfo::set_token_property_permissions(property_permissions.len() as u32)] #[transactional] pub fn set_token_property_permissions( @@ -790,9 +770,8 @@ decl_module! { /// /// # Arguments /// - /// * collection_id: ID of the collection. - /// - /// * data: explicit item creation data. + /// * collection_id - ID of the collection. + /// * data - Explicit item creation data. #[weight = T::CommonWeightInfo::create_multiple_items_ex(&data)] #[transactional] pub fn create_multiple_items_ex(origin, collection_id: CollectionId, data: CreateItemExData) -> DispatchResultWithPostInfo { @@ -810,9 +789,8 @@ decl_module! { /// /// # Arguments /// - /// * collection_id: ID of the collection. - /// - /// * value: New flag value. + /// * collection_id - ID of the collection. + /// * value - New flag value. #[weight = >::set_transfers_enabled_flag()] #[transactional] pub fn set_transfers_enabled_flag(origin, collection_id: CollectionId, value: bool) -> DispatchResult { @@ -837,9 +815,8 @@ decl_module! { /// /// # Arguments /// - /// * collection_id: ID of the collection. - /// - /// * item_id: ID of NFT to burn. + /// * collection_id - ID of the collection. + /// * item_id - ID of NFT to burn. #[weight = T::CommonWeightInfo::burn_item()] #[transactional] pub fn burn_item(origin, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo { @@ -867,11 +844,9 @@ decl_module! { /// /// # Arguments /// - /// * collection_id: ID of the collection. - /// - /// * item_id: ID of NFT to burn. - /// - /// * from: owner of item + /// * collection_id - ID of the collection. + /// * item_id - ID of NFT to burn. + /// * from - The owner of the item from whom it is taken away. #[weight = T::CommonWeightInfo::burn_from()] #[transactional] pub fn burn_from(origin, collection_id: CollectionId, from: T::CrossAccountId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo { @@ -891,16 +866,16 @@ decl_module! { /// /// # Arguments /// - /// * recipient: Address of token recipient. + /// * recipient - Address of token recipient. /// /// * collection_id. /// - /// * item_id: ID of the item + /// * item_id - ID of the item /// * Non-Fungible Mode: Required. /// * Fungible Mode: Ignored. /// * Re-Fungible Mode: Required. /// - /// * value: Amount to transfer. + /// * value - Amount to transfer. /// * Non-Fungible Mode: Ignored /// * Fungible Mode: Must specify transferred amount /// * Re-Fungible Mode: Must specify transferred portion (between 0 and 1) @@ -923,11 +898,9 @@ decl_module! { /// /// # Arguments /// - /// * approved: Address that is approved to transfer this NFT or zero (if needed to remove approval). - /// + /// * approved - Address that is approved to transfer this NFT or zero (if needed to remove approval). /// * collection_id. - /// - /// * item_id: ID of the item. + /// * item_id - ID of the item. #[weight = T::CommonWeightInfo::approve()] #[transactional] pub fn approve(origin, spender: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, amount: u128) -> DispatchResultWithPostInfo { @@ -947,15 +920,11 @@ decl_module! { /// /// # Arguments /// - /// * from: Address that owns token. - /// - /// * recipient: Address of token recipient. - /// + /// * from - Address that currently owns the token. + /// * recipient - Address of the new token-owner-to-be. /// * collection_id. - /// - /// * item_id: ID of the item. - /// - /// * value: Amount to transfer. + /// * item_id - ID of the item to be transferred. + /// * value - Amount to transfer. #[weight = T::CommonWeightInfo::transfer_from()] #[transactional] pub fn transfer_from(origin, from: T::CrossAccountId, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128 ) -> DispatchResultWithPostInfo { @@ -966,7 +935,7 @@ decl_module! { } /// Set specific limits of a collection. Empty, or None fields mean chain default. - ///. + /// /// # Permissions /// /// * Collection Owner @@ -975,8 +944,7 @@ decl_module! { /// # Arguments /// /// * collection_id. - /// - /// * new_limit: The new limits of the collection. They will overwrite the current ones. + /// * new_limit - New limits of the collection. They will overwrite the current ones. #[weight = >::set_collection_limits()] #[transactional] pub fn set_collection_limits( @@ -1009,8 +977,7 @@ decl_module! { /// # Arguments /// /// * collection_id. - /// - /// * new_permission: The new permissions of the collection. They will overwrite the current ones. + /// * new_permission - New permissions of the collection. They will overwrite the current ones. #[weight = >::set_collection_limits()] #[transactional] pub fn set_collection_permissions( @@ -1042,16 +1009,14 @@ decl_module! { /// # Arguments /// /// * collection_id. - /// - /// * token: the ID of the RFT. - /// - /// * amount: The new number of parts into which the token shall be partitioned. + /// * token_id - ID of the RFT. + /// * amount - New number of parts into which the token shall be partitioned. #[weight = T::RefungibleExtensionsWeightInfo::repartition()] #[transactional] pub fn repartition( origin, collection_id: CollectionId, - token: TokenId, + token_id: TokenId, amount: u128, ) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); From 6fe077cb19935930d8640030572f492f37469eb6 Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Tue, 12 Jul 2022 07:04:15 +0000 Subject: [PATCH 0047/1274] doc+refactor: missed fixes --- pallets/common/src/lib.rs | 2 +- pallets/unique/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 77e0be1260..abcce99a6b 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -469,7 +469,7 @@ pub mod pallet { /// Property key is too long PropertyKeyIsTooLong, - /// Only ASCII letters, digits, and symbols '_', '-', and '.' are allowed + /// Only ASCII letters, digits, and symbols `_`, `-`, and `.` are allowed InvalidCharacterInPropertyKey, /// Empty property keys are forbidden diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index d8a86e71ed..c9e0118ae1 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -632,7 +632,7 @@ decl_module! { /// # Arguments /// /// * collection_id. - /// * properties - Vector of key-value pairs stored as the collection's metadata. Keys support Latin letters, '-', '_', and '.' as symbols. + /// * properties - Vector of key-value pairs stored as the collection's metadata. Keys support Latin letters, `-`, `_`, and `.` as symbols. #[weight = T::CommonWeightInfo::set_collection_properties(properties.len() as u32)] #[transactional] pub fn set_collection_properties( @@ -1022,7 +1022,7 @@ decl_module! { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); dispatch_tx::(collection_id, |d| { if let Some(refungible_extensions) = d.refungible_extensions() { - refungible_extensions.repartition(&sender, token, amount) + refungible_extensions.repartition(&sender, token_id, amount) } else { fail!(>::RepartitionCalledOnNonRefungibleCollection) } From e4d5f147c3c0a20a5eefcc51c834161b8f442909 Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Fri, 15 Jul 2022 13:45:16 +0000 Subject: [PATCH 0048/1274] doc: clarifications to primitives and rpcs --- client/rpc/src/lib.rs | 72 ++++++------ primitives/data-structs/src/lib.rs | 38 +++++-- tests/src/interfaces/unique/definitions.ts | 125 ++++++++++++++++----- 3 files changed, 163 insertions(+), 72 deletions(-) diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index 62c6f92fc6..65a97a7f80 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -42,7 +42,7 @@ pub use rmrk_unique_rpc::RmrkApiServer; #[rpc(server)] #[async_trait] pub trait UniqueApi { - /// Get tokens owned by account + /// Get tokens owned by account. #[method(name = "unique_accountTokens")] fn account_tokens( &self, @@ -51,7 +51,7 @@ pub trait UniqueApi { at: Option, ) -> Result>; - /// Get tokens contained in collection + /// Get tokens contained within a collection. #[method(name = "unique_collectionTokens")] fn collection_tokens( &self, @@ -59,7 +59,7 @@ pub trait UniqueApi { at: Option, ) -> Result>; - /// Check if token exists + /// Check if the token exists. #[method(name = "unique_tokenExists")] fn token_exists( &self, @@ -68,7 +68,7 @@ pub trait UniqueApi { at: Option, ) -> Result; - /// Get token owner + /// Get the token owner. #[method(name = "unique_tokenOwner")] fn token_owner( &self, @@ -77,7 +77,7 @@ pub trait UniqueApi { at: Option, ) -> Result>; - /// Get token owner, in case of nested token - find the parent recursively + /// Get the topmost token owner in the hierarchy of a possibly nested token. #[method(name = "unique_topmostTokenOwner")] fn topmost_token_owner( &self, @@ -86,7 +86,7 @@ pub trait UniqueApi { at: Option, ) -> Result>; - /// Get tokens nested directly into the token + /// Get tokens nested directly into the token. #[method(name = "unique_tokenChildren")] fn token_children( &self, @@ -95,7 +95,7 @@ pub trait UniqueApi { at: Option, ) -> Result>; - /// Get collection properties + /// Get collection properties, optionally limited to the provided keys. #[method(name = "unique_collectionProperties")] fn collection_properties( &self, @@ -104,7 +104,7 @@ pub trait UniqueApi { at: Option, ) -> Result>; - /// Get token properties + /// Get token properties, optionally limited to the provided keys. #[method(name = "unique_tokenProperties")] fn token_properties( &self, @@ -114,7 +114,7 @@ pub trait UniqueApi { at: Option, ) -> Result>; - /// Get property permissions + /// Get property permissions, optionally limited to the provided keys. #[method(name = "unique_propertyPermissions")] fn property_permissions( &self, @@ -123,7 +123,7 @@ pub trait UniqueApi { at: Option, ) -> Result>; - /// Get token data + /// Get token data, including properties, optionally limited to the provided keys, and total pieces for an RFT. #[method(name = "unique_tokenData")] fn token_data( &self, @@ -133,11 +133,11 @@ pub trait UniqueApi { at: Option, ) -> Result>; - /// Get amount of unique collection tokens + /// Get the amount of distinctive tokens present in a collection. #[method(name = "unique_totalSupply")] fn total_supply(&self, collection: CollectionId, at: Option) -> Result; - /// Get owned amount of any user tokens + /// Get the amount of any user tokens owned by an account. #[method(name = "unique_accountBalance")] fn account_balance( &self, @@ -146,7 +146,7 @@ pub trait UniqueApi { at: Option, ) -> Result; - /// Get owned amount of specific account token + /// Get the amount of a specific token owned by an account. #[method(name = "unique_balance")] fn balance( &self, @@ -156,7 +156,7 @@ pub trait UniqueApi { at: Option, ) -> Result; - /// Get allowed amount + /// Get the amount of currently possible sponsored transactions on a token for the fee to be taken off a sponsor. #[method(name = "unique_allowance")] fn allowance( &self, @@ -167,7 +167,7 @@ pub trait UniqueApi { at: Option, ) -> Result; - /// Get admin list + /// Get the list of admin accounts of a collection. #[method(name = "unique_adminlist")] fn adminlist( &self, @@ -175,7 +175,7 @@ pub trait UniqueApi { at: Option, ) -> Result>; - /// Get allowlist + /// Get the list of accounts allowed to operate within a collection. #[method(name = "unique_allowlist")] fn allowlist( &self, @@ -183,7 +183,7 @@ pub trait UniqueApi { at: Option, ) -> Result>; - /// Check if user is allowed to use collection + /// Check if a user is allowed to operate within a collection. #[method(name = "unique_allowed")] fn allowed( &self, @@ -192,11 +192,11 @@ pub trait UniqueApi { at: Option, ) -> Result; - /// Get last token ID created in a collection + /// Get the last token ID created in a collection. #[method(name = "unique_lastTokenId")] fn last_token_id(&self, collection: CollectionId, at: Option) -> Result; - /// Get collection by specified ID + /// Get collection info by the specified ID. #[method(name = "unique_collectionById")] fn collection_by_id( &self, @@ -204,11 +204,11 @@ pub trait UniqueApi { at: Option, ) -> Result>>; - /// Get collection stats + /// Get chain stats about collections. #[method(name = "unique_collectionStats")] fn collection_stats(&self, at: Option) -> Result; - /// Get number of blocks when sponsored transaction is available + /// Get the number of blocks until sponsoring a transaction is available. #[method(name = "unique_nextSponsored")] fn next_sponsored( &self, @@ -218,7 +218,7 @@ pub trait UniqueApi { at: Option, ) -> Result>; - /// Get effective collection limits + /// Get effective collection limits. If not explicitly set, get the chain defaults. #[method(name = "unique_effectiveCollectionLimits")] fn effective_collection_limits( &self, @@ -226,7 +226,7 @@ pub trait UniqueApi { at: Option, ) -> Result>; - /// Get total pieces of token + /// Get the total amount of pieces of an RFT. #[method(name = "unique_totalPieces")] fn total_pieces( &self, @@ -253,20 +253,20 @@ mod rmrk_unique_rpc { Theme, > { + /// Get the latest created collection ID. #[method(name = "rmrk_lastCollectionIdx")] - /// Get the latest created collection id fn last_collection_idx(&self, at: Option) -> Result; + /// Get collection info by ID. #[method(name = "rmrk_collectionById")] - /// Get collection by id fn collection_by_id( &self, id: RmrkCollectionId, at: Option, ) -> Result>; + /// Get NFT info by collection and NFT IDs. #[method(name = "rmrk_nftById")] - /// Get NFT by collection id and NFT id fn nft_by_id( &self, collection_id: RmrkCollectionId, @@ -274,8 +274,8 @@ mod rmrk_unique_rpc { at: Option, ) -> Result>; + /// Get tokens owned by an account in a collection. #[method(name = "rmrk_accountTokens")] - /// Get tokens owned by an account in a collection fn account_tokens( &self, account_id: AccountId, @@ -283,8 +283,8 @@ mod rmrk_unique_rpc { at: Option, ) -> Result>; + /// Get tokens nested in an NFT - its direct children (not the children's children). #[method(name = "rmrk_nftChildren")] - /// Get NFT children fn nft_children( &self, collection_id: RmrkCollectionId, @@ -292,8 +292,8 @@ mod rmrk_unique_rpc { at: Option, ) -> Result>; + /// Get collection properties, created by the user - not the proxy-specific properties. #[method(name = "rmrk_collectionProperties")] - /// Get collection properties fn collection_properties( &self, collection_id: RmrkCollectionId, @@ -301,8 +301,8 @@ mod rmrk_unique_rpc { at: Option, ) -> Result>; + /// Get NFT properties, created by the user - not the proxy-specific properties. #[method(name = "rmrk_nftProperties")] - /// Get NFT properties fn nft_properties( &self, collection_id: RmrkCollectionId, @@ -311,8 +311,8 @@ mod rmrk_unique_rpc { at: Option, ) -> Result>; + /// Get data of resources of an NFT. #[method(name = "rmrk_nftResources")] - /// Get NFT resources fn nft_resources( &self, collection_id: RmrkCollectionId, @@ -320,8 +320,8 @@ mod rmrk_unique_rpc { at: Option, ) -> Result>; + /// Get the priority of a resource in an NFT. #[method(name = "rmrk_nftResourcePriority")] - /// Get NFT resource priority fn nft_resource_priority( &self, collection_id: RmrkCollectionId, @@ -330,24 +330,24 @@ mod rmrk_unique_rpc { at: Option, ) -> Result>; + /// Get base info by its ID. #[method(name = "rmrk_base")] - /// Get base info fn base(&self, base_id: RmrkBaseId, at: Option) -> Result>; + /// Get all parts of a base. #[method(name = "rmrk_baseParts")] - /// Get all Base's parts fn base_parts(&self, base_id: RmrkBaseId, at: Option) -> Result>; + /// Get the theme names belonging to a base. #[method(name = "rmrk_themeNames")] - /// Get Base's theme names fn theme_names( &self, base_id: RmrkBaseId, at: Option, ) -> Result>; + /// Get theme info, including properties, optionally limited to the provided keys. #[method(name = "rmrk_themes")] - /// Get Theme info -- name, properties, and inherit flag fn theme( &self, base_id: RmrkBaseId, diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 703130c305..2f3ae1ac39 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -367,32 +367,37 @@ pub type CollectionPropertiesVec = BoundedVec, - /// Maximum size of data of a sponsored transaction + /// Maximum size of data in bytes of a sponsored transaction. Chain default: [`CUSTOM_DATA_LIMIT`] pub sponsored_data_size: Option, /// FIXME should we delete this or repurpose it? /// None - setVariableMetadata is not sponsored /// Some(v) - setVariableMetadata is sponsored /// if there is v block between txs + /// + /// In any case, chain default: [`SponsoringRateLimit::SponsoringDisabled`] pub sponsored_data_rate_limit: Option, - /// Maximum amount of tokens inside the collection + /// Maximum amount of tokens inside the collection. Chain default: [`COLLECTION_TOKEN_LIMIT`] pub token_limit: Option, - /// Timeout for sponsoring a token transfer in passed blocks + /// Timeout for sponsoring a token transfer in passed blocks. Chain default: [`MAX_SPONSOR_TIMEOUT`] pub sponsor_transfer_timeout: Option, - /// Timeout for sponsoring an approval in passed blocks + /// Timeout for sponsoring an approval in passed blocks. Chain default: [`SPONSOR_APPROVE_TIMEOUT`] pub sponsor_approve_timeout: Option, - /// Can a token be transferred by the owner + /// Can a token be transferred by the owner. Chain default: `false` pub owner_can_transfer: Option, - /// Can a token be burned by the owner + /// Can a token be burned by the owner. Chain default: `true` pub owner_can_destroy: Option, - /// Can a token be transferred at all + /// Can a token be transferred at all. Chain default: `true` pub transfers_enabled: Option, } @@ -445,7 +450,10 @@ impl CollectionLimits { } } -// When adding/removing fields from this struct - don't forget to also update clamp_limits +/// Permissions on certain operations within a collection. +/// All fields are wrapped in `Option`s, where None means chain default. +// IMPORTANT: When adding/removing fields from this struct - don't forget to also +// update clamp_limits() in pallet-common. #[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct CollectionPermissions { @@ -500,6 +508,7 @@ impl core::ops::DerefMut for OwnerRestrictedSet { } } +/// Part of collection permissions, if set, defines who is able to nest tokens into other tokens. #[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen, Derivative)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] #[derivative(Debug)] @@ -516,14 +525,17 @@ pub struct NestingPermissions { pub permissive: bool, } +/// Enum denominating how often can sponsoring occur if it is enabled. #[derive(Encode, Decode, Debug, Clone, Copy, PartialEq, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub enum SponsoringRateLimit { + /// Sponsoring is disabled, and the collection sponsor will not pay for transactions SponsoringDisabled, /// Once per how many blocks can sponsorship of a transaction type occur Blocks(u32), } +/// Data used to describe an NFT at creation. #[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] #[derivative(Debug)] @@ -534,17 +546,20 @@ pub struct CreateNftData { pub properties: CollectionPropertiesVec, } +/// Data used to describe a Fungible token at creation. #[derive(Encode, Decode, MaxEncodedLen, Default, Debug, Clone, PartialEq, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct CreateFungibleData { - /// Number of fungible tokens minted + /// Number of fungible coins minted pub value: u128, } +/// Data used to describe a Refungible token at creation. #[derive(Encode, Decode, MaxEncodedLen, Default, PartialEq, Clone, Derivative, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] #[derivative(Debug)] pub struct CreateReFungibleData { + /// Immutable metadata of the token #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))] #[derivative(Debug(format_with = "bounded::vec_debug"))] pub const_data: BoundedVec, @@ -560,6 +575,7 @@ pub enum MetaUpdatePermission { None, } +/// Enum holding data used for creation of all three item types. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub enum CreateItemData { diff --git a/tests/src/interfaces/unique/definitions.ts b/tests/src/interfaces/unique/definitions.ts index 0c5d445f2b..cd83c33792 100644 --- a/tests/src/interfaces/unique/definitions.ts +++ b/tests/src/interfaces/unique/definitions.ts @@ -37,48 +37,123 @@ const fun = (description: string, params: RpcParam[], type: string) => ({ export default { types: {}, rpc: { - adminlist: fun('Get admin list', [collectionParam], 'Vec'), - allowlist: fun('Get allowlist', [collectionParam], 'Vec'), + accountTokens: fun( + 'Get tokens owned by an account in a collection', + [collectionParam, crossAccountParam()], + 'Vec', + ), + collectionTokens: fun( + 'Get tokens contained within a collection', + [collectionParam], + 'Vec', + ), + tokenExists: fun( + 'Check if the token exists', + [collectionParam, tokenParam], + 'bool', + ), - accountTokens: fun('Get tokens owned by account', [collectionParam, crossAccountParam()], 'Vec'), - collectionTokens: fun('Get tokens contained in collection', [collectionParam], 'Vec'), + tokenOwner: fun( + 'Get the token owner', + [collectionParam, tokenParam], + `Option<${CROSS_ACCOUNT_ID_TYPE}>`, + ), + topmostTokenOwner: fun( + 'Get the topmost token owner in the hierarchy of a possibly nested token', + [collectionParam, tokenParam], + `Option<${CROSS_ACCOUNT_ID_TYPE}>`, + ), + tokenChildren: fun( + 'Get tokens nested directly into the token', + [collectionParam, tokenParam], + 'Vec', + ), - lastTokenId: fun('Get last token ID created in a collection', [collectionParam], 'u32'), - totalSupply: fun('Get amount of unique collection tokens', [collectionParam], 'u32'), - accountBalance: fun('Get owned amount of any user tokens', [collectionParam, crossAccountParam()], 'u32'), - balance: fun('Get owned amount of specific account token', [collectionParam, crossAccountParam(), tokenParam], 'u128'), - allowance: fun('Get allowed amount', [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam], 'u128'), - tokenOwner: fun('Get token owner', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`), - topmostTokenOwner: fun('Get token owner, in case of nested token - find the parent recursively', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`), - tokenChildren: fun('Get tokens nested directly into the token', [collectionParam, tokenParam], 'Vec'), - constMetadata: fun('Get token constant metadata', [collectionParam, tokenParam], 'Vec'), - variableMetadata: fun('Get token variable metadata', [collectionParam, tokenParam], 'Vec'), collectionProperties: fun( - 'Get collection properties', + 'Get collection properties, optionally limited to the provided keys', [collectionParam, propertyKeysParam], 'Vec', ), tokenProperties: fun( - 'Get token properties', + 'Get token properties, optionally limited to the provided keys', [collectionParam, tokenParam, propertyKeysParam], 'Vec', ), propertyPermissions: fun( - 'Get property permissions', + 'Get property permissions, optionally limited to the provided keys', [collectionParam, propertyKeysParam], 'Vec', ), + tokenData: fun( - 'Get token data', + 'Get token data, including properties, optionally limited to the provided keys, and total pieces for an RFT', [collectionParam, tokenParam, propertyKeysParam], 'UpDataStructsTokenData', ), - tokenExists: fun('Check if token exists', [collectionParam, tokenParam], 'bool'), - collectionById: fun('Get collection by specified ID', [collectionParam], 'Option'), - collectionStats: fun('Get collection stats', [], 'UpDataStructsCollectionStats'), - allowed: fun('Check if user is allowed to use collection', [collectionParam, crossAccountParam()], 'bool'), - nextSponsored: fun('Get number of blocks when sponsored transaction is available', [collectionParam, crossAccountParam(), tokenParam], 'Option'), - effectiveCollectionLimits: fun('Get effective collection limits', [collectionParam], 'Option'), - totalPieces: fun('Get total pieces of token', [collectionParam, tokenParam], 'Option'), + totalSupply: fun( + 'Get the amount of distinctive tokens present in a collection', + [collectionParam], + 'u32', + ), + + accountBalance: fun( + 'Get the amount of any user tokens owned by an account', + [collectionParam, crossAccountParam()], + 'u32', + ), + balance: fun( + 'Get the amount of a specific token owned by an account', + [collectionParam, crossAccountParam(), tokenParam], + 'u128', + ), + allowance: fun( + 'Get the amount of currently possible sponsored transactions on a token for the fee to be taken off a sponsor', + [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam], + 'u128', + ), + + adminlist: fun( + 'Get the list of admin accounts of a collection', + [collectionParam], + 'Vec', + ), + allowlist: fun( + 'Get the list of accounts allowed to operate within a collection', + [collectionParam], + 'Vec', + ), + allowed: fun( + 'Check if a user is allowed to operate within a collection', + [collectionParam, crossAccountParam()], + 'bool', + ), + + lastTokenId: fun('Get the last token ID created in a collection', [collectionParam], 'u32'), + collectionById: fun( + 'Get a collection by the specified ID', + [collectionParam], + 'Option', + ), + collectionStats: fun( + 'Get chain stats about collections', + [], + 'UpDataStructsCollectionStats', + ), + + nextSponsored: fun( + 'Get the number of blocks until sponsoring a transaction is available', + [collectionParam, crossAccountParam(), tokenParam], + 'Option', + ), + effectiveCollectionLimits: fun( + 'Get effective collection limits', + [collectionParam], + 'Option', + ), + totalPieces: fun( + 'Get the total amount of pieces of an RFT', + [collectionParam, tokenParam], + 'Option', + ), }, }; From 611e7535f9cc8b9be612c7af8bbd66ca922fde9e Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Fri, 15 Jul 2022 16:53:46 +0000 Subject: [PATCH 0049/1274] chore: regenerate types --- tests/src/interfaces/augment-api-errors.ts | 40 +-- tests/src/interfaces/augment-api-events.ts | 111 ++++++--- tests/src/interfaces/augment-api-query.ts | 80 +++++- tests/src/interfaces/augment-api-rpc.ts | 50 ++-- tests/src/interfaces/augment-api-tx.ts | 277 +++++++++++++++------ tests/src/interfaces/default/types.ts | 6 +- tests/src/interfaces/lookup.ts | 6 +- tests/src/interfaces/types-lookup.ts | 6 +- 8 files changed, 398 insertions(+), 178 deletions(-) diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 19a06cea37..a2a6030b65 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -57,7 +57,7 @@ declare module '@polkadot/api-base/types/errors' { **/ AddressNotInAllowlist: AugmentedError; /** - * Requested value more than approved. + * Requested value is more than the approved **/ ApprovedValueTooLow: AugmentedError; /** @@ -113,7 +113,7 @@ declare module '@polkadot/api-base/types/errors' { **/ EmptyPropertyKey: AugmentedError; /** - * Only ASCII letters, digits, and '_', '-' are allowed + * Only ASCII letters, digits, and symbols `_`, `-`, and `.` are allowed **/ InvalidCharacterInPropertyKey: AugmentedError; /** @@ -133,7 +133,7 @@ declare module '@polkadot/api-base/types/errors' { **/ NoSpaceForProperty: AugmentedError; /** - * Not sufficient funds to perform action + * Insufficient funds to perform an action **/ NotSufficientFounds: AugmentedError; /** @@ -153,15 +153,15 @@ declare module '@polkadot/api-base/types/errors' { **/ PublicMintingNotAllowed: AugmentedError; /** - * Only tokens from specific collections may nest tokens under this + * Only tokens from specific collections may nest tokens under this one **/ SourceCollectionIsNotAllowedToNest: AugmentedError; /** - * Item not exists. + * Item does not exist **/ TokenNotFound: AugmentedError; /** - * Item balance not enough. + * Item is balance not enough **/ TokenValueTooLow: AugmentedError; /** @@ -173,11 +173,11 @@ declare module '@polkadot/api-base/types/errors' { **/ TransferNotAllowed: AugmentedError; /** - * Target collection doesn't supports this operation + * Target collection doesn't support this operation **/ UnsupportedOperation: AugmentedError; /** - * User not passed nesting rule + * User does not satisfy the nesting rule **/ UserIsNotAllowedToNest: AugmentedError; /** @@ -277,15 +277,15 @@ declare module '@polkadot/api-base/types/errors' { }; fungible: { /** - * Fungible token does not support nested + * Fungible token does not support nesting. **/ FungibleDisallowsNesting: AugmentedError; /** - * Tried to set data for fungible item + * Tried to set data for fungible item. **/ FungibleItemsDontHaveData: AugmentedError; /** - * Not default id passed as TokenId argument + * Not default id passed as TokenId argument. **/ FungibleItemsHaveNoId: AugmentedError; /** @@ -293,7 +293,7 @@ declare module '@polkadot/api-base/types/errors' { **/ NotFungibleDataUsedToMintFungibleCollectionToken: AugmentedError; /** - * Setting item properties is not allowed + * Setting item properties is not allowed. **/ SettingPropertiesNotAllowed: AugmentedError; /** @@ -425,19 +425,19 @@ declare module '@polkadot/api-base/types/errors' { **/ NotRefungibleDataUsedToMintFungibleCollectionToken: AugmentedError; /** - * Refungible token can't nest other tokens + * Refungible token can't nest other tokens. **/ RefungibleDisallowsNesting: AugmentedError; /** - * Refungible token can't be repartitioned by user who isn't owns all pieces + * Refungible token can't be repartitioned by user who isn't owns all pieces. **/ RepartitionWhileNotOwningAllPieces: AugmentedError; /** - * Setting item properties is not allowed + * Setting item properties is not allowed. **/ SettingPropertiesNotAllowed: AugmentedError; /** - * Maximum refungibility exceeded + * Maximum refungibility exceeded. **/ WrongRefungiblePieces: AugmentedError; /** @@ -508,19 +508,19 @@ declare module '@polkadot/api-base/types/errors' { }; structure: { /** - * While iterating over children, encountered breadth limit + * While iterating over children, reached the breadth limit. **/ BreadthLimit: AugmentedError; /** - * While searched for owner, encountered depth limit + * While searching for the owner, reached the depth limit. **/ DepthLimit: AugmentedError; /** - * While searched for owner, got already checked account + * While searching for the owner, encountered an already checked account, detecting a loop. **/ OuroborosDetected: AugmentedError; /** - * While searched for owner, found token owner by not-yet-existing token + * Couldn't find the token owner that is itself a token. **/ TokenNotFound: AugmentedError; /** diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index 04bbef5200..9c50b43add 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -59,14 +59,14 @@ declare module '@polkadot/api-base/types/events' { }; common: { /** - * * collection_id + * Sponsoring allowance was approved. * - * * item_id + * # Arguments * + * * collection_id - todo:doc flesh out + * * item_id * * sender - * * * spender - * * * amount **/ Approved: AugmentedEvent; @@ -75,11 +75,9 @@ declare module '@polkadot/api-base/types/events' { * * # Arguments * - * * collection_id: Globally unique identifier of newly created collection. - * - * * mode: [CollectionMode] converted into u8. - * - * * account_id: Collection owner. + * * collection_id - Globally unique identifier of newly created collection. + * * mode - [CollectionMode] converted into u8. + * * account_id - Collection owner. **/ CollectionCreated: AugmentedEvent; /** @@ -87,23 +85,36 @@ declare module '@polkadot/api-base/types/events' { * * # Arguments * - * * collection_id: Globally unique identifier of collection. + * * collection_id - Globally unique identifier of collection that has been destroyed. **/ CollectionDestroyed: AugmentedEvent; - CollectionPropertyDeleted: AugmentedEvent; - CollectionPropertySet: AugmentedEvent; /** - * New item was created. + * Collection property was deleted. * * # Arguments * - * * collection_id: Id of the collection where item was created. + * * collection_id - ID of the collection, whose property was just deleted. + * * property_key - Key of the property that was just deleted. + **/ + CollectionPropertyDeleted: AugmentedEvent; + /** + * Collection property was added or edited. + * + * # Arguments * - * * item_id: Id of an item. Unique within the collection. + * * collection_id - ID of the collection, whose property was just set. + * * property_key - Key of the property that was just set. + **/ + CollectionPropertySet: AugmentedEvent; + /** + * New item was created. * - * * recipient: Owner of newly created item + * # Arguments * - * * amount: Always 1 for NFT + * * collection_id - ID of the collection where the item was created. + * * item_id - ID of the item. Unique within the collection. + * * recipient - Owner of the newly created item. + * * amount - The amount of tokens that were created (always 1 for NFT). **/ ItemCreated: AugmentedEvent; /** @@ -111,30 +122,51 @@ declare module '@polkadot/api-base/types/events' { * * # Arguments * - * * collection_id. - * - * * item_id: Identifier of burned NFT. + * * collection_id - Identifier of the collection to which the burned NFT belonged. + * * item_id - Identifier of burned NFT. + * * owner - Which user has destroyed their tokens. + * * amount - Amount of tokens that were destroyed (always 1 for NFT). + **/ + ItemDestroyed: AugmentedEvent; + /** + * Token property permission was added or updated for a collection. * - * * owner: which user has destroyed its tokens + * # Arguments * - * * amount: Always 1 for NFT + * * collection_id - ID of the collection, whose permissions were just set/updated. + * * property_key - Key of the property of the set/updated permission. **/ - ItemDestroyed: AugmentedEvent; PropertyPermissionSet: AugmentedEvent; - TokenPropertyDeleted: AugmentedEvent; - TokenPropertySet: AugmentedEvent; /** - * Item was transferred + * Item property was deleted. * - * * collection_id: Id of collection to which item is belong + * # Arguments + * + * * collection_id - ID of the collection, whose token's property was just deleted. + * * item_id - ID of the item, whose property was just deleted. + * * property_key - Key of the property that was just deleted. + **/ + TokenPropertyDeleted: AugmentedEvent; + /** + * Item property was added or edited. * - * * item_id: Id of an item + * # Arguments * - * * sender: Original owner of item + * * collection_id - ID of the collection, whose token's property was just set. + * * item_id - ID of the item, whose property was just set. + * * property_key - Key of the property that was just set. + **/ + TokenPropertySet: AugmentedEvent; + /** + * Item was transferred. * - * * recipient: New owner of item + * # Arguments * - * * amount: Always 1 for NFT + * * collection_id - ID of the collection to which the item belongs. + * * item_id - ID of the item transferred. + * * sender - Original owner of the item. + * * recipient - New owner of the item. + * * amount - Amount of tokens that were transferred (always 1 for NFT). **/ Transfer: AugmentedEvent; /** @@ -442,7 +474,7 @@ declare module '@polkadot/api-base/types/events' { }; structure: { /** - * Executed call on behalf of token + * Executed call on behalf of the token. **/ Executed: AugmentedEvent]>; /** @@ -534,7 +566,7 @@ declare module '@polkadot/api-base/types/events' { }; unique: { /** - * Address was add to allow list + * Address was added to the allow list * * # Arguments * @@ -544,7 +576,7 @@ declare module '@polkadot/api-base/types/events' { **/ AllowListAddressAdded: AugmentedEvent; /** - * Address was remove from allow list + * Address was removed from the allow list * * # Arguments * @@ -574,7 +606,7 @@ declare module '@polkadot/api-base/types/events' { **/ CollectionAdminRemoved: AugmentedEvent; /** - * Collection limits was set + * Collection limits were set * * # Arguments * @@ -582,7 +614,7 @@ declare module '@polkadot/api-base/types/events' { **/ CollectionLimitSet: AugmentedEvent; /** - * Collection owned was change + * Collection owned was changed * * # Arguments * @@ -591,6 +623,13 @@ declare module '@polkadot/api-base/types/events' { * * owner: New owner address. **/ CollectionOwnedChanged: AugmentedEvent; + /** + * Collection permissions were set + * + * # Arguments + * + * * collection_id: Globally unique collection identifier. + **/ CollectionPermissionSet: AugmentedEvent; /** * Collection sponsor was removed diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 6ed2a40ec5..186ee04fcf 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -69,6 +69,9 @@ declare module '@polkadot/api-base/types/storage' { [key: string]: QueryableStorageEntry; }; common: { + /** + * Amount of collection admins + **/ adminAmount: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; /** * Allowlisted collection users @@ -82,8 +85,17 @@ declare module '@polkadot/api-base/types/storage' { * Collection properties **/ collectionProperties: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; + /** + * Token permissions of a collection + **/ collectionPropertyPermissions: AugmentedQuery Observable>, [u32]> & QueryableStorageEntry; + /** + * The number of created collections. Essentially contains the last collection ID. + **/ createdCollectionCount: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * The number of destroyed collections + **/ destroyedCollectionCount: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Not used by code, exists only to provide some types to metadata @@ -187,8 +199,17 @@ declare module '@polkadot/api-base/types/storage' { [key: string]: QueryableStorageEntry; }; fungible: { + /** + * todo:doc + **/ allowance: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; + /** + * Amount of tokens owned by an account inside a collection. + **/ balance: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; + /** + * Total amount of fungible tokens inside a collection. + **/ totalSupply: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; /** * Generic query @@ -222,20 +243,41 @@ declare module '@polkadot/api-base/types/storage' { [key: string]: QueryableStorageEntry; }; nonfungible: { + /** + * Amount of tokens owned in a collection. + **/ accountBalance: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; + /** + * todo:doc + **/ allowance: AugmentedQuery Observable>, [u32, u32]> & QueryableStorageEntry; /** - * Used to enumerate tokens owned by account + * Used to enumerate tokens owned by account. **/ owned: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]> & QueryableStorageEntry; + /** + * Scoped, auxiliary properties of a token, primarily used for on-chain operations. + **/ tokenAuxProperties: AugmentedQuery Observable>, [u32, u32, UpDataStructsPropertyScope, Bytes]> & QueryableStorageEntry; /** - * Used to enumerate token's children + * Used to enumerate token's children. **/ tokenChildren: AugmentedQuery | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array]) => Observable, [u32, u32, ITuple<[u32, u32]>]> & QueryableStorageEntry]>; + /** + * Token data, used to partially describe a token. + **/ tokenData: AugmentedQuery Observable>, [u32, u32]> & QueryableStorageEntry; + /** + * Key-value pairs, describing the metadata of a token. + **/ tokenProperties: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; + /** + * Amount of burnt tokens in a collection. + **/ tokensBurnt: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; + /** + * Total amount of minted tokens in a collection. + **/ tokensMinted: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; /** * Generic query @@ -400,16 +442,37 @@ declare module '@polkadot/api-base/types/storage' { [key: string]: QueryableStorageEntry; }; refungible: { + /** + * Amount of tokens (not pieces) partially owned by an account within a collection. + **/ accountBalance: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; + /** + * todo:doc + **/ allowance: AugmentedQuery Observable, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; + /** + * Amount of pieces of a token owned by an account. + **/ balance: AugmentedQuery Observable, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; /** - * Used to enumerate tokens owned by account + * Used to enumerate tokens owned by account. **/ owned: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]> & QueryableStorageEntry; + /** + * Token data, used to partially describe a token. + **/ tokenData: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; + /** + * Amount of tokens burnt in a collection. + **/ tokensBurnt: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; + /** + * Total amount of minted tokens in a collection. + **/ tokensMinted: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; + /** + * Amount of pieces a refungible token is split into. + **/ totalSupply: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; /** * Generic query @@ -598,24 +661,33 @@ declare module '@polkadot/api-base/types/storage' { * TODO: Off chain worker should remove from this map when collection gets removed **/ createItemBasket: AugmentedQuery | [u32 | AnyNumber | Uint8Array, AccountId32 | string | Uint8Array]) => Observable>, [ITuple<[u32, AccountId32]>]> & QueryableStorageEntry]>; + /** + * Last sponsoring of fungible tokens approval in a collection + **/ fungibleApproveBasket: AugmentedQuery Observable>, [u32, AccountId32]> & QueryableStorageEntry; /** * Collection id (controlled?2), owning user (real) **/ fungibleTransferBasket: AugmentedQuery Observable>, [u32, AccountId32]> & QueryableStorageEntry; /** - * Approval sponsoring + * Last sponsoring of NFT approval in a collection **/ nftApproveBasket: AugmentedQuery Observable>, [u32, u32]> & QueryableStorageEntry; /** * Collection id (controlled?2), token id (controlled?2) **/ nftTransferBasket: AugmentedQuery Observable>, [u32, u32]> & QueryableStorageEntry; + /** + * Last sponsoring of RFT approval in a collection + **/ refungibleApproveBasket: AugmentedQuery Observable>, [u32, u32, AccountId32]> & QueryableStorageEntry; /** * Collection id (controlled?2), token id (controlled?2) **/ reFungibleTransferBasket: AugmentedQuery Observable>, [u32, u32, AccountId32]> & QueryableStorageEntry; + /** + * Last sponsoring of token property setting // todo:doc rephrase this and the following + **/ tokenPropertyBasket: AugmentedQuery Observable>, [u32, u32]> & QueryableStorageEntry; /** * Variable metadata sponsoring diff --git a/tests/src/interfaces/augment-api-rpc.ts b/tests/src/interfaces/augment-api-rpc.ts index 08d81d5802..abe7794ad1 100644 --- a/tests/src/interfaces/augment-api-rpc.ts +++ b/tests/src/interfaces/augment-api-rpc.ts @@ -629,67 +629,63 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { }; unique: { /** - * Get amount of different user tokens + * Get the amount of any user tokens owned by an account **/ accountBalance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; /** - * Get tokens owned by account + * Get tokens owned by an account in a collection **/ accountTokens: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; /** - * Get admin list + * Get the list of admin accounts of a collection **/ adminlist: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; /** - * Get allowed amount + * Get the amount of currently possible sponsored transactions on a token for the fee to be taken off a sponsor **/ allowance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, sender: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, spender: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; /** - * Check if user is allowed to use collection + * Check if a user is allowed to operate within a collection **/ allowed: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; /** - * Get allowlist + * Get the list of accounts allowed to operate within a collection **/ allowlist: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; /** - * Get amount of specific account token + * Get the amount of a specific token owned by an account **/ balance: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; /** - * Get collection by specified id + * Get a collection by the specified ID **/ collectionById: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; /** - * Get collection properties + * Get collection properties, optionally limited to the provided keys **/ collectionProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec | (Text | string)[], at?: Hash | string | Uint8Array) => Observable>>; /** - * Get collection stats + * Get chain stats about collections **/ collectionStats: AugmentedRpc<(at?: Hash | string | Uint8Array) => Observable>; /** - * Get tokens contained in collection + * Get tokens contained within a collection **/ collectionTokens: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; - /** - * Get token constant metadata - **/ - constMetadata: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; /** * Get effective collection limits **/ effectiveCollectionLimits: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; /** - * Get last token id + * Get the last token ID created in a collection **/ lastTokenId: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; /** - * Get number of blocks when sponsored transaction is available + * Get the number of blocks until sponsoring a transaction is available **/ nextSponsored: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; /** - * Get property permissions + * Get property permissions, optionally limited to the provided keys **/ propertyPermissions: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec | (Text | string)[], at?: Hash | string | Uint8Array) => Observable>>; /** @@ -697,37 +693,33 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { **/ tokenChildren: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; /** - * Get token data + * Get token data, including properties, optionally limited to the provided keys, and total pieces for an RFT **/ tokenData: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec | (Text | string)[], at?: Hash | string | Uint8Array) => Observable>; /** - * Check if token exists + * Check if the token exists **/ tokenExists: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; /** - * Get token owner + * Get the token owner **/ tokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; /** - * Get token properties + * Get token properties, optionally limited to the provided keys **/ tokenProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec | (Text | string)[], at?: Hash | string | Uint8Array) => Observable>>; /** - * Get token owner, in case of nested token - find parent recursive + * Get the topmost token owner in the hierarchy of a possibly nested token **/ topmostTokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; /** - * Get total pieces of token + * Get the total amount of pieces of an RFT **/ totalPieces: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; /** - * Get amount of unique collection tokens + * Get the amount of distinctive tokens present in a collection **/ totalSupply: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; - /** - * Get token variable metadata - **/ - variableMetadata: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; }; web3: { /** diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index 42a78fd5a1..cb68c64562 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -730,21 +730,20 @@ declare module '@polkadot/api-base/types/submittable' { }; unique: { /** - * Adds an admin of the Collection. + * Adds an admin of the collection. * NFT Collection can be controlled by multiple admin addresses (some which can also be servers, for example). Admins can issue and burn NFTs, as well as add and remove other admins, but cannot change NFT or Collection ownership. * * # Permissions * - * * Collection Owner. - * * Collection Admin. + * * Collection Owner + * * Collection Admin * * # Arguments * - * * collection_id: ID of the Collection to add admin for. - * - * * new_admin_id: Address of new admin to add. + * * collection_id - ID of the Collection to add admin for. + * * new_admin - Address of new admin to add. **/ - addCollectionAdmin: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newAdminId: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>; + addCollectionAdmin: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newAdmin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>; /** * Add an address to allow list. * @@ -756,7 +755,6 @@ declare module '@polkadot/api-base/types/submittable' { * # Arguments * * * collection_id. - * * * address. **/ addToAllowList: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, address: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>; @@ -771,15 +769,13 @@ declare module '@polkadot/api-base/types/submittable' { * * # Arguments * - * * approved: Address that is approved to transfer this NFT or zero (if needed to remove approval). - * + * * approved - Address that is approved to transfer this NFT or zero (if needed to remove approval). * * collection_id. - * - * * item_id: ID of the item. + * * item_id - ID of the item. **/ approve: AugmentedSubmittable<(spender: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [PalletEvmAccountBasicCrossAccountIdRepr, u32, u32, u128]>; /** - * Destroys a concrete instance of NFT on behalf of the owner + * Destroy a concrete instance of NFT on behalf of the owner. * See also: [`approve`] * * # Permissions @@ -790,27 +786,24 @@ declare module '@polkadot/api-base/types/submittable' { * * # Arguments * - * * collection_id: ID of the collection. - * - * * item_id: ID of NFT to burn. - * - * * from: owner of item + * * collection_id - ID of the collection. + * * item_id - ID of NFT to burn. + * * from - The owner of the item from whom it is taken away. **/ burnFrom: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, from: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32, u128]>; /** - * Destroys a concrete instance of NFT. + * Destroy a concrete instance of NFT. * * # Permissions * - * * Collection Owner. - * * Collection Admin. - * * Current NFT Owner. + * * Collection Owner + * * Collection Admin + * * Current NFT Owner * * # Arguments * - * * collection_id: ID of the collection. - * - * * item_id: ID of NFT to burn. + * * collection_id - ID of the collection. + * * item_id - ID of NFT to burn. **/ burnItem: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u128]>; /** @@ -818,19 +811,20 @@ declare module '@polkadot/api-base/types/submittable' { * * # Permissions * - * * Collection Owner. + * * Collection Owner * * # Arguments * * * collection_id. - * * * new_owner. **/ changeCollectionOwner: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newOwner: AccountId32 | string | Uint8Array) => SubmittableExtrinsic, [u32, AccountId32]>; /** + * Confirm own sponsorship of a collection. + * * # Permissions * - * * Sponsor. + * * Sponsor-to-be * * # Arguments * @@ -847,27 +841,31 @@ declare module '@polkadot/api-base/types/submittable' { * # Arguments * * * collection_name: UTF-16 string with collection name (limit 64 characters), will be stored as zero-terminated. - * - * * collection_description: UTF-16 string with collection description (limit 256 characters), will be stored as zero-terminated. - * - * * token_prefix: UTF-8 string with token prefix. - * - * * mode: [CollectionMode] collection type and type dependent data. + * * collection_description - UTF-16 string with collection description (limit 256 characters), will be stored as zero-terminated. + * * token_prefix - UTF-8 string with token prefix. + * * mode - [CollectionMode] collection type and type dependent data. **/ createCollection: AugmentedSubmittable<(collectionName: Vec | (u16 | AnyNumber | Uint8Array)[], collectionDescription: Vec | (u16 | AnyNumber | Uint8Array)[], tokenPrefix: Bytes | string | Uint8Array, mode: UpDataStructsCollectionMode | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array) => SubmittableExtrinsic, [Vec, Vec, Bytes, UpDataStructsCollectionMode]>; /** - * This method creates a collection + * Create a collection with explicit parameters. + * Prefer it to the deprecated [`created_collection`] method. + * + * # Permissions * - * Prefer it to deprecated [`created_collection`] method + * * Anyone. + * + * # Arguments + * + * * data: explicit create-collection data. **/ createCollectionEx: AugmentedSubmittable<(data: UpDataStructsCreateCollectionData | { mode?: any; access?: any; name?: any; description?: any; tokenPrefix?: any; pendingSponsor?: any; limits?: any; permissions?: any; tokenPropertyPermissions?: any; properties?: any } | string | Uint8Array) => SubmittableExtrinsic, [UpDataStructsCreateCollectionData]>; /** - * This method creates a concrete instance of NFT Collection created with CreateCollection method. + * Create a concrete instance of NFT Collection created with CreateCollection method. * * # Permissions * - * * Collection Owner. - * * Collection Admin. + * * Collection Owner + * * Collection Admin * * Anyone if * * Allow List is enabled, and * * Address is added to allow list, and @@ -875,20 +873,18 @@ declare module '@polkadot/api-base/types/submittable' { * * # Arguments * - * * collection_id: ID of the collection. - * - * * owner: Address, initial owner of the NFT. - * - * * data: Token data to store on chain. + * * collection_id - ID of the collection. + * * owner - Address, initial owner of the NFT. + * * data - Token data to store on chain. **/ createItem: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, owner: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, data: UpDataStructsCreateItemData | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, PalletEvmAccountBasicCrossAccountIdRepr, UpDataStructsCreateItemData]>; /** - * This method creates multiple items in a collection created with CreateCollection method. + * Create multiple items in a collection created with CreateCollection method. * * # Permissions * - * * Collection Owner. - * * Collection Admin. + * * Collection Owner + * * Collection Admin * * Anyone if * * Allow List is enabled, and * * Address is added to allow list, and @@ -896,26 +892,70 @@ declare module '@polkadot/api-base/types/submittable' { * * # Arguments * - * * collection_id: ID of the collection. + * * collection_id - ID of the collection. + * * owner - Address, initial owner of the NFT. + * * items_data - Array items properties. Each property is an array of bytes itself, see [`create_item`]. + **/ + createMultipleItems: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, owner: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, itemsData: Vec | (UpDataStructsCreateItemData | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [u32, PalletEvmAccountBasicCrossAccountIdRepr, Vec]>; + /** + * Create multiple items inside a collection with explicitly specified initial parameters. + * + * # Permissions + * + * * Collection Owner + * * Collection Admin + * * Anyone if + * * Allow List is enabled, and + * * Address is added to allow list, and + * * MintPermission is enabled (see SetMintPermission method) * - * * itemsData: Array items properties. Each property is an array of bytes itself, see [create_item]. + * # Arguments * - * * owner: Address, initial owner of the NFT. + * * collection_id - ID of the collection. + * * data - Explicit item creation data. **/ - createMultipleItems: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, owner: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, itemsData: Vec | (UpDataStructsCreateItemData | { NFT: any } | { Fungible: any } | { ReFungible: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [u32, PalletEvmAccountBasicCrossAccountIdRepr, Vec]>; createMultipleItemsEx: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, data: UpDataStructsCreateItemExData | { NFT: any } | { Fungible: any } | { RefungibleMultipleItems: any } | { RefungibleMultipleOwners: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, UpDataStructsCreateItemExData]>; + /** + * Delete specified collection properties. + * + * # Permissions + * + * * Collection Owner + * * Collection Admin + * + * # Arguments + * + * * collection_id. + * * property_keys - Vector of keys of the properties to be deleted. + **/ deleteCollectionProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, propertyKeys: Vec | (Bytes | string | Uint8Array)[]) => SubmittableExtrinsic, [u32, Vec]>; + /** + * Delete specified token properties. + * + * # Permissions + * + * * Depends on collection's token property permissions and specified property mutability: + * * Collection Owner + * * Collection Admin + * * Token Owner + * + * # Arguments + * + * * collection_id. + * * token_id. + * * property_keys - Vector of keys of the properties to be deleted. + **/ deleteTokenProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys: Vec | (Bytes | string | Uint8Array)[]) => SubmittableExtrinsic, [u32, u32, Vec]>; /** - * Destroys collection if no tokens within this collection + * Destroy the collection if no tokens exist within. * * # Permissions * - * * Collection Owner. + * * Collection Owner * * # Arguments * - * * collection_id: collection to destroy. + * * collection_id - collection to destroy. **/ destroyCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; /** @@ -923,14 +963,13 @@ declare module '@polkadot/api-base/types/submittable' { * * # Permissions * - * * Collection Owner. - * * Collection Admin. + * * Collection Owner + * * Collection Admin * * # Arguments * - * * collection_id: ID of the Collection to remove admin for. - * - * * account_id: Address of admin to remove. + * * collection_id - ID of the Collection to remove admin for. + * * account_id - Address of admin to remove. **/ removeCollectionAdmin: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, accountId: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>; /** @@ -938,7 +977,7 @@ declare module '@polkadot/api-base/types/submittable' { * * # Permissions * - * * Collection owner. + * * Collection Owner * * # Arguments * @@ -956,40 +995,121 @@ declare module '@polkadot/api-base/types/submittable' { * # Arguments * * * collection_id. - * * * address. **/ removeFromAllowList: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, address: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>; - repartition: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, token: u32 | AnyNumber | Uint8Array, amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u128]>; + /** + * Re-partition a refungible token, while owning all of its parts. + * + * # Permissions + * + * * Token Owner (must own every part) + * + * # Arguments + * + * * collection_id. + * * token_id - ID of the RFT. + * * amount - New number of parts into which the token shall be partitioned. + **/ + repartition: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u128]>; + /** + * Set specific limits of a collection. Empty, or None fields mean chain default. + * + * # Permissions + * + * * Collection Owner + * * Collection Admin + * + * # Arguments + * + * * collection_id. + * * new_limit - New limits of the collection. They will overwrite the current ones. + **/ setCollectionLimits: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newLimit: UpDataStructsCollectionLimits | { accountTokenOwnershipLimit?: any; sponsoredDataSize?: any; sponsoredDataRateLimit?: any; tokenLimit?: any; sponsorTransferTimeout?: any; sponsorApproveTimeout?: any; ownerCanTransfer?: any; ownerCanDestroy?: any; transfersEnabled?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, UpDataStructsCollectionLimits]>; - setCollectionPermissions: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newLimit: UpDataStructsCollectionPermissions | { access?: any; mintMode?: any; nesting?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, UpDataStructsCollectionPermissions]>; - setCollectionProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, properties: Vec | (UpDataStructsProperty | { key?: any; value?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [u32, Vec]>; /** + * Set specific permissions of a collection. Empty, or None fields mean chain default. + * * # Permissions * * * Collection Owner + * * Collection Admin * * # Arguments * * * collection_id. + * * new_permission - New permissions of the collection. They will overwrite the current ones. + **/ + setCollectionPermissions: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newPermission: UpDataStructsCollectionPermissions | { access?: any; mintMode?: any; nesting?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, UpDataStructsCollectionPermissions]>; + /** + * Add or change collection properties. + * + * # Permissions + * + * * Collection Owner + * * Collection Admin + * + * # Arguments * + * * collection_id. + * * properties - Vector of key-value pairs stored as the collection's metadata. Keys support Latin letters, `-`, `_`, and `.` as symbols. + **/ + setCollectionProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, properties: Vec | (UpDataStructsProperty | { key?: any; value?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [u32, Vec]>; + /** + * Set (invite) a new collection sponsor. If successful, confirmation from the sponsor-to-be will be pending. + * + * # Permissions + * + * * Collection Owner + * * Collection Admin + * + * # Arguments + * + * * collection_id. * * new_sponsor. **/ setCollectionSponsor: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newSponsor: AccountId32 | string | Uint8Array) => SubmittableExtrinsic, [u32, AccountId32]>; + /** + * Add or change token properties according to collection's permissions. + * + * # Permissions + * + * * Depends on collection's token property permissions and specified property mutability: + * * Collection Owner + * * Collection Admin + * * Token Owner + * + * # Arguments + * + * * collection_id. + * * token_id. + * * properties - Vector of key-value pairs stored as the token's metadata. Keys support Latin letters, `-`, `_`, and `.` as symbols. + **/ setTokenProperties: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, properties: Vec | (UpDataStructsProperty | { key?: any; value?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [u32, u32, Vec]>; - setTokenPropertyPermissions: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, propertyPermissions: Vec | (UpDataStructsPropertyKeyPermission | { key?: any; permission?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [u32, Vec]>; /** - * Set transfers_enabled value for particular collection + * Add or change token property permissions of a collection. * * # Permissions * - * * Collection Owner. + * * Collection Owner + * * Collection Admin * * # Arguments * - * * collection_id: ID of the collection. + * * collection_id. + * * property_permissions - Vector of permissions for property keys. Keys support Latin letters, `-`, `_`, and `.` as symbols. + **/ + setTokenPropertyPermissions: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, propertyPermissions: Vec | (UpDataStructsPropertyKeyPermission | { key?: any; permission?: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [u32, Vec]>; + /** + * Set transfers_enabled value for particular collection. + * + * # Permissions * - * * value: New flag value. + * * Collection Owner + * + * # Arguments + * + * * collection_id - ID of the collection. + * * value - New flag value. **/ setTransfersEnabledFlag: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, value: bool | boolean | Uint8Array) => SubmittableExtrinsic, [u32, bool]>; /** @@ -1003,16 +1123,16 @@ declare module '@polkadot/api-base/types/submittable' { * * # Arguments * - * * recipient: Address of token recipient. + * * recipient - Address of token recipient. * * * collection_id. * - * * item_id: ID of the item + * * item_id - ID of the item * * Non-Fungible Mode: Required. * * Fungible Mode: Ignored. * * Re-Fungible Mode: Required. * - * * value: Amount to transfer. + * * value - Amount to transfer. * * Non-Fungible Mode: Ignored * * Fungible Mode: Must specify transferred amount * * Re-Fungible Mode: Must specify transferred portion (between 0 and 1) @@ -1022,6 +1142,7 @@ declare module '@polkadot/api-base/types/submittable' { * Change ownership of a NFT on behalf of the owner. See Approve method for additional information. After this method executes, the approval is removed so that the approved address will not be able to transfer this NFT again from this owner. * * # Permissions + * * * Collection Owner * * Collection Admin * * Current NFT owner @@ -1029,15 +1150,11 @@ declare module '@polkadot/api-base/types/submittable' { * * # Arguments * - * * from: Address that owns token. - * - * * recipient: Address of token recipient. - * + * * from - Address that currently owns the token. + * * recipient - Address of the new token-owner-to-be. * * collection_id. - * - * * item_id: ID of the item. - * - * * value: Amount to transfer. + * * item_id - ID of the item to be transferred. + * * value - Amount to transfer. **/ transferFrom: AugmentedSubmittable<(from: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, recipient: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, itemId: u32 | AnyNumber | Uint8Array, value: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u32, u32, u128]>; /** diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index d76bcd5fcc..086e54072b 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -1672,7 +1672,7 @@ export interface PalletUniqueCall extends Enum { readonly isAddCollectionAdmin: boolean; readonly asAddCollectionAdmin: { readonly collectionId: u32; - readonly newAdminId: PalletEvmAccountBasicCrossAccountIdRepr; + readonly newAdmin: PalletEvmAccountBasicCrossAccountIdRepr; } & Struct; readonly isRemoveCollectionAdmin: boolean; readonly asRemoveCollectionAdmin: { @@ -1784,12 +1784,12 @@ export interface PalletUniqueCall extends Enum { readonly isSetCollectionPermissions: boolean; readonly asSetCollectionPermissions: { readonly collectionId: u32; - readonly newLimit: UpDataStructsCollectionPermissions; + readonly newPermission: UpDataStructsCollectionPermissions; } & Struct; readonly isRepartition: boolean; readonly asRepartition: { readonly collectionId: u32; - readonly token: u32; + readonly tokenId: u32; readonly amount: u128; } & Struct; readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index f58502a4ff..ebb31a07ba 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -1269,7 +1269,7 @@ export default { }, add_collection_admin: { collectionId: 'u32', - newAdminId: 'PalletEvmAccountBasicCrossAccountIdRepr', + newAdmin: 'PalletEvmAccountBasicCrossAccountIdRepr', }, remove_collection_admin: { collectionId: 'u32', @@ -1361,11 +1361,11 @@ export default { }, set_collection_permissions: { collectionId: 'u32', - newLimit: 'UpDataStructsCollectionPermissions', + newPermission: 'UpDataStructsCollectionPermissions', }, repartition: { collectionId: 'u32', - token: 'u32', + tokenId: 'u32', amount: 'u128' } } diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 04ac25a6fe..ed0d410d94 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1385,7 +1385,7 @@ declare module '@polkadot/types/lookup' { readonly isAddCollectionAdmin: boolean; readonly asAddCollectionAdmin: { readonly collectionId: u32; - readonly newAdminId: PalletEvmAccountBasicCrossAccountIdRepr; + readonly newAdmin: PalletEvmAccountBasicCrossAccountIdRepr; } & Struct; readonly isRemoveCollectionAdmin: boolean; readonly asRemoveCollectionAdmin: { @@ -1497,12 +1497,12 @@ declare module '@polkadot/types/lookup' { readonly isSetCollectionPermissions: boolean; readonly asSetCollectionPermissions: { readonly collectionId: u32; - readonly newLimit: UpDataStructsCollectionPermissions; + readonly newPermission: UpDataStructsCollectionPermissions; } & Struct; readonly isRepartition: boolean; readonly asRepartition: { readonly collectionId: u32; - readonly token: u32; + readonly tokenId: u32; readonly amount: u128; } & Struct; readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; From e1f471473559af05ef8563642109f3fe1144bf6b Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Sat, 16 Jul 2022 19:05:14 +0000 Subject: [PATCH 0050/1274] doc: unique pallet complete --- pallets/unique/src/eth/mod.rs | 15 +- pallets/unique/src/lib.rs | 476 ++++++++++++++++++++-------------- 2 files changed, 300 insertions(+), 191 deletions(-) diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index c6276f154f..6e86a71f7b 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! Implementation of CollectionHelpers contract. + use core::marker::PhantomData; use evm_coder::{execution::*, generate_stubgen, solidity_interface, weight, types::*}; use ethereum as _; @@ -33,7 +35,8 @@ use crate::{SelfWeightOf, Config, weights::WeightInfo}; use sp_std::vec::Vec; use alloc::format; -struct EvmCollectionHelpers(SubstrateRecorder); +/// See [`CollectionHelpersCall`] +pub struct EvmCollectionHelpers(SubstrateRecorder); impl WithRecorder for EvmCollectionHelpers { fn recorder(&self) -> &SubstrateRecorder { &self.0 @@ -44,8 +47,14 @@ impl WithRecorder for EvmCollectionHelpers { } } +/// @title Contract, which allows users to operate with collections #[solidity_interface(name = "CollectionHelpers", events(CollectionHelpersEvents))] impl EvmCollectionHelpers { + /// Create an NFT collection + /// @param name Name of the collection + /// @param description Informative description of the collection + /// @param token_prefix Token prefix to represent the collection tokens in UI and user applications + /// @return address Address of the newly created collection #[weight(>::create_collection())] fn create_nonfungible_collection( &mut self, @@ -100,6 +109,9 @@ impl EvmCollectionHelpers { Ok(address) } + /// Check if a collection exists + /// @param collection_address Address of the collection in question + /// @return bool Does the collection exist? fn is_collection_exist(&self, _caller: caller, collection_address: address) -> Result { if let Some(id) = pallet_common::eth::map_eth_to_id(&collection_address) { let collection_id = id; @@ -110,6 +122,7 @@ impl EvmCollectionHelpers { } } +/// Implements [`OnMethodCall`], which delegates call to [`EvmCollectionHelpers`] pub struct CollectionHelpersOnMethodCall(PhantomData<*const T>); impl OnMethodCall for CollectionHelpersOnMethodCall { fn is_reserved(contract: &sp_core::H160) -> bool { diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index c9e0118ae1..a39efb21ee 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -14,6 +14,55 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! # Unique Pallet +//! +//! A pallet governing Unique transactions. +//! +//! - [`Config`] +//! - [`Call`] +//! - [`Pallet`] +//! +//! ## Overview +//! +//! The Unique pallet's purpose is to be the primary interface between +//! external users and the inner structure of the Unique chains. +//! +//! It also contains an implementation of [`CollectionHelpers`](eth), +//! an Ethereum contract dealing with collection operations. +//! +//! ## Interface +//! +//! ### Dispatchables +//! +//! - `create_collection` - Create a collection of tokens. **Deprecated**, use `create_collection_ex`. +//! - `create_collection_ex` - Create a collection of tokens with explicit parameters. +//! - `destroy_collection` - Destroy a collection if no tokens exist within. +//! - `add_to_allow_list` - Add an address to allow list. +//! - `remove_from_allow_list` - Remove an address from allow list. +//! - `change_collection_owner` - Change the owner of the collection. +//! - `add_collection_admin` - Add an admin to a collection. +//! - `remove_collection_admin` - Remove admin of a collection. +//! - `set_collection_sponsor` - Invite a new collection sponsor. +//! - `confirm_sponsorship` - Confirm own sponsorship of a collection, becoming the sponsor. +//! - `remove_collection_sponsor` - Remove a sponsor from a collection. +//! - `create_item` - Create an item within a collection. +//! - `create_multiple_items` - Create multiple items within a collection. +//! - `set_collection_properties` - Add or change collection properties. +//! - `delete_collection_properties` - Delete specified collection properties. +//! - `set_token_properties` - Add or change token properties. +//! - `delete_token_properties` - Delete token properties. +//! - `set_token_property_permissions` - Add or change token property permissions of a collection. +//! - `create_multiple_items_ex` - Create multiple items within a collection with explicitly specified initial parameters. +//! - `set_transfers_enabled_flag` - Completely allow or disallow transfers for a particular collection. +//! - `burn_item` - Destroy an item. +//! - `burn_from` - Destroy an item on behalf of the owner as a non-owner account. +//! - `transfer` - Change ownership of the token. +//! - `transfer_from` - Change ownership of the token on behalf of the owner as a non-owner account. +//! - `approve` - Allow a non-permissioned address to transfer or burn an item. +//! - `set_collection_limits` - Set specific limits of a collection. +//! - `set_collection_permissions` - Set specific permissions of a collection. +//! - `repartition` - Re-partition a refungible token, while owning all of its parts. + #![recursion_limit = "1024"] #![cfg_attr(not(feature = "std"), no_std)] #![allow( @@ -54,28 +103,35 @@ mod benchmarking; pub mod weights; use weights::WeightInfo; -const NESTING_BUDGET: u32 = 5; +/// Maximum number of levels of depth in the token nesting tree. +pub const NESTING_BUDGET: u32 = 5; decl_error! { - /// Error for non-fungible-token module. + /// Errors for the common Unique transactions. pub enum Error for Module { - /// Decimal_points parameter must be lower than MAX_DECIMAL_POINTS constant, currently it is 30. + /// Decimal_points parameter must be lower than [`up_data_structs::MAX_DECIMAL_POINTS`]. CollectionDecimalPointLimitExceeded, /// This address is not set as sponsor, use setCollectionSponsor first. ConfirmUnsetSponsorFail, /// Length of items properties must be greater than 0. EmptyArgument, - /// Repertition is only supported by refungible collection + /// Repertition is only supported by refungible collection. RepartitionCalledOnNonRefungibleCollection, } } +/// Configuration trait of this pallet. pub trait Config: system::Config + pallet_common::Config + Sized + TypeInfo { + /// Overarching event type. type Event: From> + Into<::Event>; /// Weight information for extrinsics in this pallet. type WeightInfo: WeightInfo; + + /// Weight information for common pallet operations. type CommonWeightInfo: CommonWeightInfo; + + /// Weight info information for extra refungible pallet operations. type RefungibleExtensionsWeightInfo: RefungibleExtensionsWeightInfo; } @@ -88,85 +144,68 @@ decl_event! { /// Collection sponsor was removed /// /// # Arguments - /// - /// * collection_id: Globally unique collection identifier. + /// * collection_id: ID of the affected collection. CollectionSponsorRemoved(CollectionId), /// Collection admin was added /// /// # Arguments - /// - /// * collection_id: Globally unique collection identifier. - /// - /// * admin: Admin address. + /// * collection_id: ID of the affected collection. + /// * admin: Admin address. CollectionAdminAdded(CollectionId, CrossAccountId), /// Collection owned was changed /// /// # Arguments - /// - /// * collection_id: Globally unique collection identifier. - /// - /// * owner: New owner address. + /// * collection_id: ID of the affected collection. + /// * owner: New owner address. CollectionOwnedChanged(CollectionId, AccountId), /// Collection sponsor was set /// /// # Arguments - /// - /// * collection_id: Globally unique collection identifier. - /// - /// * owner: New sponsor address. + /// * collection_id: ID of the affected collection. + /// * owner: New sponsor address. CollectionSponsorSet(CollectionId, AccountId), /// New sponsor was confirm /// /// # Arguments - /// - /// * collection_id: Globally unique collection identifier. - /// - /// * sponsor: New sponsor address. + /// * collection_id: ID of the affected collection. + /// * sponsor: New sponsor address. SponsorshipConfirmed(CollectionId, AccountId), /// Collection admin was removed /// /// # Arguments - /// - /// * collection_id: Globally unique collection identifier. - /// - /// * admin: Admin address. + /// * collection_id: ID of the affected collection. + /// * admin: Removed admin address. CollectionAdminRemoved(CollectionId, CrossAccountId), /// Address was removed from the allow list /// /// # Arguments - /// - /// * collection_id: Globally unique collection identifier. - /// - /// * user: Address. + /// * collection_id: ID of the affected collection. + /// * user: Address of the removed account. AllowListAddressRemoved(CollectionId, CrossAccountId), /// Address was added to the allow list /// /// # Arguments - /// - /// * collection_id: Globally unique collection identifier. - /// - /// * user: Address. + /// * collection_id: ID of the affected collection. + /// * user: Address of the added account. AllowListAddressAdded(CollectionId, CrossAccountId), /// Collection limits were set /// /// # Arguments - /// - /// * collection_id: Globally unique collection identifier. + /// * collection_id: ID of the affected collection. CollectionLimitSet(CollectionId), /// Collection permissions were set /// /// # Arguments - /// - /// * collection_id: Globally unique collection identifier. + /// * collection_id: ID of the affected collection. CollectionPermissionSet(CollectionId), } } @@ -232,6 +271,7 @@ decl_storage! { } decl_module! { + /// Type alias to Pallet, to be used by construct_runtime. pub struct Module for enum Call where origin: T::Origin @@ -252,27 +292,37 @@ decl_module! { 0 } - /// This method creates a Collection of NFTs. Each Token may have multiple properties encoded as an array of bytes of certain length. The initial owner of the collection is set to the address that signed the transaction and can be changed later. + /// DEPRECATED - use create_collection_ex. Create a Collection of tokens. + /// + /// Each Token may have multiple properties encoded as an array of bytes + /// of certain length. The initial owner of the collection is set + /// to the address that signed the transaction and can be changed later. + /// + /// Prefer [`create_collection_ex`](Call::create_collection_ex) instead. /// /// # Permissions /// - /// * Anyone. + /// * Anyone - becomes the owner of the new collection. /// /// # Arguments /// - /// * collection_name: UTF-16 string with collection name (limit 64 characters), will be stored as zero-terminated. - /// * collection_description - UTF-16 string with collection description (limit 256 characters), will be stored as zero-terminated. - /// * token_prefix - UTF-8 string with token prefix. - /// * mode - [CollectionMode] collection type and type dependent data. + /// * `collection_name`: UTF-16 string with collection name (limit 64 characters), + /// will be stored as zero-terminated. + /// * `collection_description`: UTF-16 string with collection description (limit 256 characters), + /// will be stored as zero-terminated. + /// * `token_prefix`: UTF-8 string with token prefix. + /// * `mode`: [`CollectionMode`] and type dependent data. // returns collection ID #[weight = >::create_collection()] #[transactional] #[deprecated] - pub fn create_collection(origin, - collection_name: BoundedVec>, - collection_description: BoundedVec>, - token_prefix: BoundedVec>, - mode: CollectionMode) -> DispatchResult { + pub fn create_collection( + origin, + collection_name: BoundedVec>, + collection_description: BoundedVec>, + token_prefix: BoundedVec>, + mode: CollectionMode + ) -> DispatchResult { let data: CreateCollectionData = CreateCollectionData { name: collection_name, description: collection_description, @@ -284,15 +334,15 @@ decl_module! { } /// Create a collection with explicit parameters. - /// Prefer it to the deprecated [`created_collection`] method. + /// Prefer it to the deprecated [`create_collection`](Call::create_collection) method. /// /// # Permissions /// - /// * Anyone. + /// * Anyone - becomes the owner of the new collection. /// /// # Arguments /// - /// * data: explicit create-collection data. + /// * `data`: Explicit data of a collection used for its creation. #[weight = >::create_collection()] #[transactional] pub fn create_collection_ex(origin, data: CreateCollectionData) -> DispatchResult { @@ -305,15 +355,15 @@ decl_module! { Ok(()) } - /// Destroy the collection if no tokens exist within. + /// Destroy a collection if no tokens exist within. /// /// # Permissions /// - /// * Collection Owner + /// * Collection owner /// /// # Arguments /// - /// * collection_id - collection to destroy. + /// * `collection_id`: Collection to destroy. #[weight = >::destroy_collection()] #[transactional] pub fn destroy_collection(origin, collection_id: CollectionId) -> DispatchResult { @@ -340,13 +390,13 @@ decl_module! { /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin + /// * Collection owner + /// * Collection admin /// /// # Arguments /// - /// * collection_id. - /// * address. + /// * `collection_id`: ID of the modified collection. + /// * `address`: ID of the address to be added to the allowlist. #[weight = >::add_to_allow_list()] #[transactional] pub fn add_to_allow_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{ @@ -374,13 +424,13 @@ decl_module! { /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin + /// * Collection owner + /// * Collection admin /// /// # Arguments /// - /// * collection_id. - /// * address. + /// * `collection_id`: ID of the modified collection. + /// * `address`: ID of the address to be removed from the allowlist. #[weight = >::remove_from_allow_list()] #[transactional] pub fn remove_from_allow_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{ @@ -408,12 +458,12 @@ decl_module! { /// /// # Permissions /// - /// * Collection Owner + /// * Collection owner /// /// # Arguments /// - /// * collection_id. - /// * new_owner. + /// * `collection_id`: ID of the modified collection. + /// * `new_owner`: ID of the account that will become the owner. #[weight = >::change_collection_owner()] #[transactional] pub fn change_collection_owner(origin, collection_id: CollectionId, new_owner: T::AccountId) -> DispatchResult { @@ -433,18 +483,22 @@ decl_module! { target_collection.save() } - /// Adds an admin of the collection. - /// NFT Collection can be controlled by multiple admin addresses (some which can also be servers, for example). Admins can issue and burn NFTs, as well as add and remove other admins, but cannot change NFT or Collection ownership. + /// Add an admin to a collection. + /// + /// NFT Collection can be controlled by multiple admin addresses + /// (some which can also be servers, for example). Admins can issue + /// and burn NFTs, as well as add and remove other admins, + /// but cannot change NFT or Collection ownership. /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin + /// * Collection owner + /// * Collection admin /// /// # Arguments /// - /// * collection_id - ID of the Collection to add admin for. - /// * new_admin - Address of new admin to add. + /// * `collection_id`: ID of the Collection to add an admin for. + /// * `new_admin`: Address of new admin to add. #[weight = >::add_collection_admin()] #[transactional] pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin: T::CrossAccountId) -> DispatchResult { @@ -460,17 +514,20 @@ decl_module! { >::toggle_admin(&collection, &sender, &new_admin, true) } - /// Remove admin address of the Collection. An admin address can remove itself. List of admins may become empty, in which case only Collection Owner will be able to add an Admin. + /// Remove admin of a collection. + /// + /// An admin address can remove itself. List of admins may become empty, + /// in which case only Collection Owner will be able to add an Admin. /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin + /// * Collection owner + /// * Collection admin /// /// # Arguments /// - /// * collection_id - ID of the Collection to remove admin for. - /// * account_id - Address of admin to remove. + /// * `collection_id`: ID of the collection to remove the admin for. + /// * `account_id`: Address of the admin to remove. #[weight = >::remove_collection_admin()] #[transactional] pub fn remove_collection_admin(origin, collection_id: CollectionId, account_id: T::CrossAccountId) -> DispatchResult { @@ -486,17 +543,18 @@ decl_module! { >::toggle_admin(&collection, &sender, &account_id, false) } - /// Set (invite) a new collection sponsor. If successful, confirmation from the sponsor-to-be will be pending. + /// Set (invite) a new collection sponsor. + /// If successful, confirmation from the sponsor-to-be will be pending. /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin + /// * Collection owner + /// * Collection admin /// /// # Arguments /// - /// * collection_id. - /// * new_sponsor. + /// * `collection_id`: ID of the modified collection. + /// * `new_sponsor`: ID of the account of the sponsor-to-be. #[weight = >::set_collection_sponsor()] #[transactional] pub fn set_collection_sponsor(origin, collection_id: CollectionId, new_sponsor: T::AccountId) -> DispatchResult { @@ -516,7 +574,11 @@ decl_module! { target_collection.save() } - /// Confirm own sponsorship of a collection. + /// Confirm own sponsorship of a collection, becoming the sponsor. + /// An invitation must be pending, see [`set_collection_sponsor`](Call::set_collection_sponsor). + /// + /// Sponsor can pay the fees of a transaction instead of the sender, + /// but only within specified limits. /// /// # Permissions /// @@ -524,7 +586,7 @@ decl_module! { /// /// # Arguments /// - /// * collection_id. + /// * `collection_id`: ID of the collection with the pending sponsor. #[weight = >::confirm_sponsorship()] #[transactional] pub fn confirm_sponsorship(origin, collection_id: CollectionId) -> DispatchResult { @@ -545,15 +607,15 @@ decl_module! { target_collection.save() } - /// Switch back to pay-per-own-transaction model. + /// Remove a sponsor from a collection, making everyone pay for their own transactions. /// /// # Permissions /// - /// * Collection Owner + /// * Collection owner /// /// # Arguments /// - /// * collection_id. + /// * `collection_id`: ID of the collection with the sponsor to remove. #[weight = >::remove_collection_sponsor()] #[transactional] pub fn remove_collection_sponsor(origin, collection_id: CollectionId) -> DispatchResult { @@ -571,22 +633,24 @@ decl_module! { target_collection.save() } - /// Create a concrete instance of NFT Collection created with CreateCollection method. + /// Mint an item within a collection. + /// + /// A collection must exist first, see [`create_collection_ex`](Call::create_collection_ex). /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin + /// * Collection owner + /// * Collection admin /// * Anyone if /// * Allow List is enabled, and /// * Address is added to allow list, and - /// * MintPermission is enabled (see SetMintPermission method) + /// * MintPermission is enabled (see [`set_collection_permissions`](Call::set_collection_permissions)) /// /// # Arguments /// - /// * collection_id - ID of the collection. - /// * owner - Address, initial owner of the NFT. - /// * data - Token data to store on chain. + /// * `collection_id`: ID of the collection to which an item would belong. + /// * `owner`: Address of the initial owner of the item. + /// * `data`: Token data describing the item to store on chain. #[weight = T::CommonWeightInfo::create_item()] #[transactional] pub fn create_item(origin, collection_id: CollectionId, owner: T::CrossAccountId, data: CreateItemData) -> DispatchResultWithPostInfo { @@ -596,22 +660,24 @@ decl_module! { dispatch_tx::(collection_id, |d| d.create_item(sender, owner, data, &budget)) } - /// Create multiple items in a collection created with CreateCollection method. + /// Create multiple items within a collection. + /// + /// A collection must exist first, see [`create_collection_ex`](Call::create_collection_ex). /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin + /// * Collection owner + /// * Collection admin /// * Anyone if /// * Allow List is enabled, and - /// * Address is added to allow list, and - /// * MintPermission is enabled (see SetMintPermission method) + /// * Address is added to the allow list, and + /// * MintPermission is enabled (see [`set_collection_permissions`](Call::set_collection_permissions)) /// /// # Arguments /// - /// * collection_id - ID of the collection. - /// * owner - Address, initial owner of the NFT. - /// * items_data - Array items properties. Each property is an array of bytes itself, see [`create_item`]. + /// * `collection_id`: ID of the collection to which the tokens would belong. + /// * `owner`: Address of the initial owner of the tokens. + /// * `items_data`: Vector of data describing each item to be created. #[weight = T::CommonWeightInfo::create_multiple_items(&items_data)] #[transactional] pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec) -> DispatchResultWithPostInfo { @@ -626,13 +692,14 @@ decl_module! { /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin + /// * Collection owner + /// * Collection admin /// /// # Arguments /// - /// * collection_id. - /// * properties - Vector of key-value pairs stored as the collection's metadata. Keys support Latin letters, `-`, `_`, and `.` as symbols. + /// * `collection_id`: ID of the modified collection. + /// * `properties`: Vector of key-value pairs stored as the collection's metadata. + /// Keys support Latin letters, `-`, `_`, and `.` as symbols. #[weight = T::CommonWeightInfo::set_collection_properties(properties.len() as u32)] #[transactional] pub fn set_collection_properties( @@ -656,8 +723,9 @@ decl_module! { /// /// # Arguments /// - /// * collection_id. - /// * property_keys - Vector of keys of the properties to be deleted. + /// * `collection_id`: ID of the modified collection. + /// * `property_keys`: Vector of keys of the properties to be deleted. + /// Keys support Latin letters, `-`, `_`, and `.` as symbols. #[weight = T::CommonWeightInfo::delete_collection_properties(property_keys.len() as u32)] #[transactional] pub fn delete_collection_properties( @@ -673,19 +741,23 @@ decl_module! { } /// Add or change token properties according to collection's permissions. + /// Currently properties only work with NFTs. /// /// # Permissions /// /// * Depends on collection's token property permissions and specified property mutability: - /// * Collection Owner - /// * Collection Admin - /// * Token Owner + /// * Collection owner + /// * Collection admin + /// * Token owner + /// + /// See [`set_token_property_permissions`](Call::set_token_property_permissions). /// /// # Arguments /// - /// * collection_id. - /// * token_id. - /// * properties - Vector of key-value pairs stored as the token's metadata. Keys support Latin letters, `-`, `_`, and `.` as symbols. + /// * `collection_id: ID of the collection to which the token belongs. + /// * `token_id`: ID of the modified token. + /// * `properties`: Vector of key-value pairs stored as the token's metadata. + /// Keys support Latin letters, `-`, `_`, and `.` as symbols. #[weight = T::CommonWeightInfo::set_token_properties(properties.len() as u32)] #[transactional] pub fn set_token_properties( @@ -702,20 +774,21 @@ decl_module! { dispatch_tx::(collection_id, |d| d.set_token_properties(sender, token_id, properties, &budget)) } - /// Delete specified token properties. + /// Delete specified token properties. Currently properties only work with NFTs. /// /// # Permissions /// /// * Depends on collection's token property permissions and specified property mutability: - /// * Collection Owner - /// * Collection Admin - /// * Token Owner + /// * Collection owner + /// * Collection admin + /// * Token owner /// /// # Arguments /// - /// * collection_id. - /// * token_id. - /// * property_keys - Vector of keys of the properties to be deleted. + /// * `collection_id`: ID of the collection to which the token belongs. + /// * `token_id`: ID of the modified token. + /// * `property_keys`: Vector of keys of the properties to be deleted. + /// Keys support Latin letters, `-`, `_`, and `.` as symbols. #[weight = T::CommonWeightInfo::delete_token_properties(property_keys.len() as u32)] #[transactional] pub fn delete_token_properties( @@ -734,15 +807,19 @@ decl_module! { /// Add or change token property permissions of a collection. /// + /// Without a permission for a particular key, a property with that key + /// cannot be created in a token. + /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin + /// * Collection owner + /// * Collection admin /// /// # Arguments /// - /// * collection_id. - /// * property_permissions - Vector of permissions for property keys. Keys support Latin letters, `-`, `_`, and `.` as symbols. + /// * `collection_id`: ID of the modified collection. + /// * `property_permissions`: Vector of permissions for property keys. + /// Keys support Latin letters, `-`, `_`, and `.` as symbols. #[weight = T::CommonWeightInfo::set_token_property_permissions(property_permissions.len() as u32)] #[transactional] pub fn set_token_property_permissions( @@ -757,21 +834,21 @@ decl_module! { dispatch_tx::(collection_id, |d| d.set_token_property_permissions(&sender, property_permissions)) } - /// Create multiple items inside a collection with explicitly specified initial parameters. + /// Create multiple items within a collection with explicitly specified initial parameters. /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin + /// * Collection owner + /// * Collection admin /// * Anyone if /// * Allow List is enabled, and /// * Address is added to allow list, and - /// * MintPermission is enabled (see SetMintPermission method) + /// * MintPermission is enabled (see [`set_collection_permissions`](Call::set_collection_permissions)) /// /// # Arguments /// - /// * collection_id - ID of the collection. - /// * data - Explicit item creation data. + /// * `collection_id`: ID of the collection to which the tokens would belong. + /// * `data`: Explicit item creation data. #[weight = T::CommonWeightInfo::create_multiple_items_ex(&data)] #[transactional] pub fn create_multiple_items_ex(origin, collection_id: CollectionId, data: CreateItemExData) -> DispatchResultWithPostInfo { @@ -781,16 +858,16 @@ decl_module! { dispatch_tx::(collection_id, |d| d.create_multiple_items_ex(sender, data, &budget)) } - /// Set transfers_enabled value for particular collection. + /// Completely allow or disallow transfers for a particular collection. /// /// # Permissions /// - /// * Collection Owner + /// * Collection owner /// /// # Arguments /// - /// * collection_id - ID of the collection. - /// * value - New flag value. + /// * `collection_id`: ID of the collection. + /// * `value`: New value of the flag, are transfers allowed? #[weight = >::set_transfers_enabled_flag()] #[transactional] pub fn set_transfers_enabled_flag(origin, collection_id: CollectionId, value: bool) -> DispatchResult { @@ -805,18 +882,22 @@ decl_module! { target_collection.save() } - /// Destroy a concrete instance of NFT. + /// Destroy an item. /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin - /// * Current NFT Owner + /// * Collection owner + /// * Collection admin + /// * Current item owner /// /// # Arguments /// - /// * collection_id - ID of the collection. - /// * item_id - ID of NFT to burn. + /// * `collection_id`: ID of the collection to which the item belongs. + /// * `item_id`: ID of item to burn. + /// * `value`: Number of parts of the item to destroy. + /// * Non-Fungible Mode: There is always 1 NFT. + /// * Fungible Mode: The desired number of parts to burn. + /// * Re-Fungible Mode: The desired number of parts to burn. #[weight = T::CommonWeightInfo::burn_item()] #[transactional] pub fn burn_item(origin, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo { @@ -833,20 +914,28 @@ decl_module! { Ok(post_info) } - /// Destroy a concrete instance of NFT on behalf of the owner. - /// See also: [`approve`] + /// Destroy a token on behalf of the owner as a non-owner account. + /// See also: [`approve`](Call::approve). + /// + /// After this method executes, one approval is removed from the total so that + /// the approved address will not be able to transfer this item again from this owner. /// /// # Permissions /// - /// * Collection Owner. - /// * Collection Admin. - /// * Current NFT Owner. + /// * Collection owner + /// * Collection admin + /// * Current token owner + /// * Address approved by current item owner /// /// # Arguments /// - /// * collection_id - ID of the collection. - /// * item_id - ID of NFT to burn. - /// * from - The owner of the item from whom it is taken away. + /// * `from`: The owner of the burning item. + /// * `collection_id`: ID of the collection to which the item belongs. + /// * `item_id`: ID of item to burn. + /// * `value`: Number of parts to burn. + /// * Non-Fungible Mode: There is always 1 NFT. + /// * Fungible Mode: The desired number of parts to burn. + /// * Re-Fungible Mode: The desired number of parts to burn. #[weight = T::CommonWeightInfo::burn_from()] #[transactional] pub fn burn_from(origin, collection_id: CollectionId, from: T::CrossAccountId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo { @@ -860,25 +949,23 @@ decl_module! { /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin - /// * Current NFT owner + /// * Collection owner + /// * Collection admin + /// * Current token owner /// /// # Arguments /// - /// * recipient - Address of token recipient. - /// - /// * collection_id. - /// - /// * item_id - ID of the item + /// * `recipient`: Address of token recipient. + /// * `collection_id`: ID of the collection the item belongs to. + /// * `item_id`: ID of the item. /// * Non-Fungible Mode: Required. /// * Fungible Mode: Ignored. /// * Re-Fungible Mode: Required. /// - /// * value - Amount to transfer. - /// * Non-Fungible Mode: Ignored - /// * Fungible Mode: Must specify transferred amount - /// * Re-Fungible Mode: Must specify transferred portion (between 0 and 1) + /// * `value`: Amount to transfer. + /// * Non-Fungible Mode: There is always 1 NFT. + /// * Fungible Mode: The desired number of parts to transfer. + /// * Re-Fungible Mode: The desired number of parts to transfer. #[weight = T::CommonWeightInfo::transfer()] #[transactional] pub fn transfer(origin, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo { @@ -888,19 +975,21 @@ decl_module! { dispatch_tx::(collection_id, |d| d.transfer(sender, recipient, item_id, value, &budget)) } - /// Set, change, or remove approved address to transfer the ownership of the NFT. + /// Allow a non-permissioned address to transfer or burn an item. /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin - /// * Current NFT owner + /// * Collection owner + /// * Collection admin + /// * Current item owner /// /// # Arguments /// - /// * approved - Address that is approved to transfer this NFT or zero (if needed to remove approval). - /// * collection_id. - /// * item_id - ID of the item. + /// * `spender`: Account to be approved to make specific transactions on non-owned tokens. + /// * `collection_id`: ID of the collection the item belongs to. + /// * `item_id`: ID of the item transactions on which are now approved. + /// * `amount`: Number of approved transactions overwriting the current number, + /// e.g. set to `0` to remove approval. #[weight = T::CommonWeightInfo::approve()] #[transactional] pub fn approve(origin, spender: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, amount: u128) -> DispatchResultWithPostInfo { @@ -909,22 +998,29 @@ decl_module! { dispatch_tx::(collection_id, |d| d.approve(sender, spender, item_id, amount)) } - /// Change ownership of a NFT on behalf of the owner. See Approve method for additional information. After this method executes, the approval is removed so that the approved address will not be able to transfer this NFT again from this owner. + /// Change ownership of an item on behalf of the owner as a non-owner account. + /// See the [`approve`](Call::approve) method for additional information. + /// + /// After this method executes, one approval is removed from the total so that + /// the approved address will not be able to transfer this item again from this owner. /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin - /// * Current NFT owner - /// * Address approved by current NFT owner + /// * Collection owner + /// * Collection admin + /// * Current item owner + /// * Address approved by current item owner /// /// # Arguments /// - /// * from - Address that currently owns the token. - /// * recipient - Address of the new token-owner-to-be. - /// * collection_id. - /// * item_id - ID of the item to be transferred. - /// * value - Amount to transfer. + /// * `from`: Address that currently owns the token. + /// * `recipient`: Address of the new token-owner-to-be. + /// * `collection_id`: ID of the collection the item. + /// * `item_id`: ID of the item to be transferred. + /// * `value`: Amount of parts to transfer. + /// * Non-Fungible Mode: There is always 1 NFT. + /// * Fungible Mode: The desired number of parts to transfer. + /// * Re-Fungible Mode: The desired number of parts to transfer. #[weight = T::CommonWeightInfo::transfer_from()] #[transactional] pub fn transfer_from(origin, from: T::CrossAccountId, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128 ) -> DispatchResultWithPostInfo { @@ -938,13 +1034,13 @@ decl_module! { /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin + /// * Collection owner + /// * Collection admin /// /// # Arguments /// - /// * collection_id. - /// * new_limit - New limits of the collection. They will overwrite the current ones. + /// * `collection_id`: ID of the modified collection. + /// * `new_limit`: New limits of the collection. They will overwrite the current ones. #[weight = >::set_collection_limits()] #[transactional] pub fn set_collection_limits( @@ -971,13 +1067,13 @@ decl_module! { /// /// # Permissions /// - /// * Collection Owner - /// * Collection Admin + /// * Collection owner + /// * Collection admin /// /// # Arguments /// - /// * collection_id. - /// * new_permission - New permissions of the collection. They will overwrite the current ones. + /// * `collection_id`: ID of the modified collection. + /// * `new_permission`: New permissions of the collection. They will overwrite the current ones. #[weight = >::set_collection_limits()] #[transactional] pub fn set_collection_permissions( @@ -1004,13 +1100,13 @@ decl_module! { /// /// # Permissions /// - /// * Token Owner (must own every part) + /// * Token owner (must own every part) /// /// # Arguments /// - /// * collection_id. - /// * token_id - ID of the RFT. - /// * amount - New number of parts into which the token shall be partitioned. + /// * `collection_id`: ID of the collection the RFT belongs to. + /// * `token_id`: ID of the RFT. + /// * `amount`: New number of parts into which the token shall be partitioned. #[weight = T::RefungibleExtensionsWeightInfo::repartition()] #[transactional] pub fn repartition( From 4fa2a42ac6ac43cdebaab1ad1db3eb10c6c4d06b Mon Sep 17 00:00:00 2001 From: PraetorP Date: Mon, 11 Jul 2022 14:13:49 +0700 Subject: [PATCH 0051/1274] fix: cargo fmt --- pallets/fungible/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index d4aef52a49..e29cdc0ba1 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -120,6 +120,7 @@ pub mod pallet { /// Not Fungible item data used to mint in Fungible collection. NotFungibleDataUsedToMintFungibleCollectionToken, /// Not default id passed as TokenId argument. + /// The default value of TokenId for Fungible collection is 0. FungibleItemsHaveNoId, /// Tried to set data for fungible item. FungibleItemsDontHaveData, From f37009b7df18dc455d9f29838a569e1e37f27520 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 18 Jul 2022 08:08:14 +0000 Subject: [PATCH 0052/1274] doc: Fix docs --- pallets/common/src/erc.rs | 2 +- pallets/common/src/eth.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index b6f84b6ef5..d17e5dcb0c 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -31,7 +31,7 @@ use alloc::format; use crate::{Pallet, CollectionHandle, Config, CollectionProperties}; -/// Events for etherium collection helper. +/// Events for ethereum collection helper. #[derive(ToLog)] pub enum CollectionHelpersEvents { /// The collection has been created. diff --git a/pallets/common/src/eth.rs b/pallets/common/src/eth.rs index c5bfd6ce58..21bc27ae04 100644 --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -25,7 +25,7 @@ const ETH_COLLECTION_PREFIX: [u8; 16] = [ 0x17, 0xc4, 0xe6, 0x45, 0x3c, 0xc4, 0x9a, 0xaa, 0xae, 0xac, 0xa8, 0x94, 0xe6, 0xd9, 0x68, 0x3e, ]; -/// Maps the etherium address of the collection in substrate. +/// Maps the ethereum address of the collection in substrate. pub fn map_eth_to_id(eth: &H160) -> Option { if eth[0..16] != ETH_COLLECTION_PREFIX { return None; @@ -35,7 +35,7 @@ pub fn map_eth_to_id(eth: &H160) -> Option { Some(CollectionId(u32::from_be_bytes(id_bytes))) } -/// Maps the substrate collection id in etherium. +/// Maps the substrate collection id in ethereum. pub fn collection_id_to_address(id: CollectionId) -> H160 { let mut out = [0; 20]; out[0..16].copy_from_slice(Ð_COLLECTION_PREFIX); @@ -43,7 +43,7 @@ pub fn collection_id_to_address(id: CollectionId) -> H160 { H160(out) } -/// Check if the etherium address is a collection. +/// Check if the ethereum address is a collection. pub fn is_collection(address: &H160) -> bool { address[0..16] == ETH_COLLECTION_PREFIX } From 59616c1c2c6f07285c9c55bb693fc57144cbafac Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Mon, 18 Jul 2022 10:54:29 +0000 Subject: [PATCH 0053/1274] chore: fixed code review requests --- pallets/structure/src/lib.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/pallets/structure/src/lib.rs b/pallets/structure/src/lib.rs index f8db5604cf..fccab24eb6 100644 --- a/pallets/structure/src/lib.rs +++ b/pallets/structure/src/lib.rs @@ -42,7 +42,7 @@ //! //! ## Interface //! -//! ### Dispatchable Functions +//! ### Available Functions //! //! - `find_parent` - Find parent of the token. It could be an account or another token. //! - `parent_chain` - Find chain of parents of the token. @@ -50,10 +50,6 @@ //! - `check_nesting` - Check if the token could be nested in the other token //! - `nest_if_sent_to_token` - Nest the token in the other token //! - `unnest_if_nested` - Unnest the token from the other token -//! -//! ## Assumptions -//! -//! * Total issued balanced of all accounts should be less than `Config::Balance::max_value()`. #![cfg_attr(not(feature = "std"), no_std)] @@ -218,8 +214,8 @@ impl Pallet { }) } - /// Find the topmost parent and check that assigning `for_nest` token as a parent for - /// any token in the parents chain wouldn't create a cycle. + /// Find the topmost parent and check that assigning `for_nest` token as a child for + /// `token` wouldn't create a cycle. /// /// - `budget`: Limit for searching parents in depth. pub fn get_checked_topmost_owner( @@ -271,8 +267,7 @@ impl Pallet { /// /// Returns `true` if `user` is `token`'s owner. Or If token is provided as `user` then /// check that `user` and `token` have same owner. - /// Checks that assigning `for_nest` token as a parent for any token in the `token`'s - /// parents chain wouldn't create a cycle. + /// Checks that assigning `for_nest` token as a child for `token` wouldn't create a cycle. /// /// - `budget`: Limit for searching parents in depth. pub fn check_indirectly_owned( From 7563962a61ba5827620133a0ce6e0e8d61a40a67 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Mon, 18 Jul 2022 11:18:54 +0000 Subject: [PATCH 0054/1274] chore: fixed code review request --- pallets/structure/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pallets/structure/src/lib.rs b/pallets/structure/src/lib.rs index fccab24eb6..1d3086608f 100644 --- a/pallets/structure/src/lib.rs +++ b/pallets/structure/src/lib.rs @@ -162,10 +162,11 @@ impl Pallet { }) } - /// Find chain of parents of current token + /// Get the chain of parents of a token in the nesting hierarchy /// - /// Returns the parent of the current token, than the parent of the parent and so on until token without a parent - /// is returned. Returns error if cycle is detected. + /// Returns an iterator of addresses of the owning tokens and the owning account, + /// starting from the immediate parent token, ending with the account. + /// Returns error if cycle is detected. pub fn parent_chain( mut collection: CollectionId, mut token: TokenId, From 14614bd234c34d2da87f1dae4bdb92cd7f9f56c4 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Mon, 18 Jul 2022 20:19:35 +0700 Subject: [PATCH 0055/1274] doc(fungible-pallet): added new details & fix --- pallets/fungible/src/lib.rs | 48 ++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index e29cdc0ba1..dfe34172cc 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -71,7 +71,7 @@ //! //! The Fungible pallet provides implementations for the following traits. //! -//! - [`WithRecorder`](pallet_evm_coder_substrate::WithRecorder): +//! - [`WithRecorder`](pallet_evm_coder_substrate::WithRecorder): Trait for EVM support //! - [`CommonCollectionOperations`](pallet_common::CommonCollectionOperations): Functions for dealing with collections //! - [`CommonWeightInfo`](pallet_common::CommonWeightInfo): Functions for retrieval of transaction weight //! - [`CommonEvmHandler`](pallet_common::erc::CommonEvmHandler): Function for handling EVM runtime calls @@ -169,19 +169,24 @@ pub mod pallet { QueryKind = ValueQuery, >; } -/// Handler for fungible assets. + +/// Wrapper around untyped collection handle, asserting inner collection is of fungible type. +/// Required for interaction with Fungible collections, type safety and implementation [`solidity_interface`][`evm_coder::solidity_interface`]. + pub struct FungibleHandle(pallet_common::CollectionHandle); + +/// Implementation of methods required for dispatching during runtime. impl FungibleHandle { - /// Casts [pallet_common::CollectionHandle] into [FungibleHandle]. + /// Casts [`CollectionHandle`][`pallet_common::CollectionHandle`] into [`FungibleHandle`]. pub fn cast(inner: pallet_common::CollectionHandle) -> Self { Self(inner) } - /// Casts [FungibleHandle] into [pallet_common::CollectionHandle]. + /// Casts [`FungibleHandle`] into [`CollectionHandle`][`pallet_common::CollectionHandle`]. pub fn into_inner(self) -> pallet_common::CollectionHandle { self.0 } - /// Returns a mutable reference to the internal [pallet_common::CollectionHandle]. + /// Returns a mutable reference to the internal [`CollectionHandle`][`pallet_common::CollectionHandle`]. pub fn common_mut(&mut self) -> &mut pallet_common::CollectionHandle { &mut self.0 } @@ -287,6 +292,11 @@ impl Pallet { /// Transfers the specified amount of tokens. Will check that /// the transfer is allowed for the token. + /// + /// - `from`: Owner of tokens to transfer. + /// - `to`: Recepient of transfered tokens. + /// - `amount`: Amount of tokens to transfer. + /// - `collection`: Collection that contains the token pub fn transfer( collection: &FungibleHandle, from: &T::CrossAccountId, @@ -358,6 +368,7 @@ impl Pallet { } /// Minting tokens for multiple IDs. + /// See [`create_item`][`Pallet::create_item`] for more details. pub fn create_multiple_items( collection: &FungibleHandle, sender: &T::CrossAccountId, @@ -459,7 +470,9 @@ impl Pallet { )); } - /// Sets the amount of owner tokens that the spender can manage. + /// Set allowance for the spender to `transfer` or `burn` owner's tokens. + /// + /// - `amount`: Amount of tokens the spender is allowed to `transfer` or `burn`. pub fn set_allowance( collection: &FungibleHandle, owner: &T::CrossAccountId, @@ -484,6 +497,7 @@ impl Pallet { Ok(()) } + /// Returns allowance, which should be set after transaction fn check_allowed( collection: &FungibleHandle, spender: &T::CrossAccountId, @@ -523,7 +537,12 @@ impl Pallet { Ok(allowance) } - /// Transfers of tokens that `from` gave to `spender` to manage, to `to` ID. + /// Transfer FT tokens from one account to another. + /// Same as the [`transfer`] but spender doesn't needs to be an owner of the token pieces. + /// The owner should set allowance for the spender to transfer pieces. + /// See [`set_allowance`][`Pallet::set_allowance`] for more details. + /// + /// [`transfer`]: struct.Pallet.html#method.transfer pub fn transfer_from( collection: &FungibleHandle, spender: &T::CrossAccountId, @@ -543,7 +562,11 @@ impl Pallet { Ok(()) } - /// Burns managed tokens. + /// Burn FT tokens from the account. + /// + /// Same as the [`burn`][`Pallet::burn`] but spender doesn't need to be an owner of the tokens. The `from` should + /// set allowance for the spender to burn tokens. + /// See [`set_allowance`][`Pallet::set_allowance`] for more details. pub fn burn_from( collection: &FungibleHandle, spender: &T::CrossAccountId, @@ -562,7 +585,14 @@ impl Pallet { Ok(()) } - /// Delegated to `create_multiple_items` + + /// Creates FT token. + /// + /// The sender should be the owner/admin of the collection or collection should be configured + /// to allow public minting. + /// + /// - `data`: Contains user who will become the owners of the tokens and amount + /// of tokens he will receive. pub fn create_item( collection: &FungibleHandle, sender: &T::CrossAccountId, From 8b20ab49452f91c6a72d8f60216c7c224eae3c5c Mon Sep 17 00:00:00 2001 From: PraetorP Date: Mon, 18 Jul 2022 20:23:03 +0700 Subject: [PATCH 0056/1274] fix : cargo fmt --- pallets/fungible/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index dfe34172cc..3015dfb0b4 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -585,7 +585,6 @@ impl Pallet { Ok(()) } - /// Creates FT token. /// /// The sender should be the owner/admin of the collection or collection should be configured From 6f21087c7545e8939d337bcee1562f96f825a5e8 Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Mon, 18 Jul 2022 13:56:59 +0000 Subject: [PATCH 0057/1274] doc: fix misinterpretations --- pallets/unique/src/lib.rs | 48 ++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index a39efb21ee..a047a006ce 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -34,7 +34,7 @@ //! //! ### Dispatchables //! -//! - `create_collection` - Create a collection of tokens. **Deprecated**, use `create_collection_ex`. +//! - `create_collection` - Create a collection of tokens. **Deprecated**, use `createCollectionEx`. //! - `create_collection_ex` - Create a collection of tokens with explicit parameters. //! - `destroy_collection` - Destroy a collection if no tokens exist within. //! - `add_to_allow_list` - Add an address to allow list. @@ -292,7 +292,7 @@ decl_module! { 0 } - /// DEPRECATED - use create_collection_ex. Create a Collection of tokens. + /// DEPRECATED - use createCollectionEx. Create a Collection of tokens. /// /// Each Token may have multiple properties encoded as an array of bytes /// of certain length. The initial owner of the collection is set @@ -894,10 +894,10 @@ decl_module! { /// /// * `collection_id`: ID of the collection to which the item belongs. /// * `item_id`: ID of item to burn. - /// * `value`: Number of parts of the item to destroy. - /// * Non-Fungible Mode: There is always 1 NFT. - /// * Fungible Mode: The desired number of parts to burn. - /// * Re-Fungible Mode: The desired number of parts to burn. + /// * `value`: Number of pieces of the item to destroy. + /// * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID. + /// * Fungible Mode: The desired number of pieces to burn. + /// * Re-Fungible Mode: The desired number of pieces to burn. #[weight = T::CommonWeightInfo::burn_item()] #[transactional] pub fn burn_item(origin, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo { @@ -932,10 +932,10 @@ decl_module! { /// * `from`: The owner of the burning item. /// * `collection_id`: ID of the collection to which the item belongs. /// * `item_id`: ID of item to burn. - /// * `value`: Number of parts to burn. - /// * Non-Fungible Mode: There is always 1 NFT. - /// * Fungible Mode: The desired number of parts to burn. - /// * Re-Fungible Mode: The desired number of parts to burn. + /// * `value`: Number of pieces to burn. + /// * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID. + /// * Fungible Mode: The desired number of pieces to burn. + /// * Re-Fungible Mode: The desired number of pieces to burn. #[weight = T::CommonWeightInfo::burn_from()] #[transactional] pub fn burn_from(origin, collection_id: CollectionId, from: T::CrossAccountId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo { @@ -963,9 +963,9 @@ decl_module! { /// * Re-Fungible Mode: Required. /// /// * `value`: Amount to transfer. - /// * Non-Fungible Mode: There is always 1 NFT. - /// * Fungible Mode: The desired number of parts to transfer. - /// * Re-Fungible Mode: The desired number of parts to transfer. + /// * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID. + /// * Fungible Mode: The desired number of pieces to transfer. + /// * Re-Fungible Mode: The desired number of pieces to transfer. #[weight = T::CommonWeightInfo::transfer()] #[transactional] pub fn transfer(origin, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo { @@ -988,8 +988,8 @@ decl_module! { /// * `spender`: Account to be approved to make specific transactions on non-owned tokens. /// * `collection_id`: ID of the collection the item belongs to. /// * `item_id`: ID of the item transactions on which are now approved. - /// * `amount`: Number of approved transactions overwriting the current number, - /// e.g. set to `0` to remove approval. + /// * `amount`: Number of pieces of the item approved for a transaction (maximum of 1 for NFTs). + /// Set to 0 to revoke the approval. #[weight = T::CommonWeightInfo::approve()] #[transactional] pub fn approve(origin, spender: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, amount: u128) -> DispatchResultWithPostInfo { @@ -1017,10 +1017,10 @@ decl_module! { /// * `recipient`: Address of the new token-owner-to-be. /// * `collection_id`: ID of the collection the item. /// * `item_id`: ID of the item to be transferred. - /// * `value`: Amount of parts to transfer. - /// * Non-Fungible Mode: There is always 1 NFT. - /// * Fungible Mode: The desired number of parts to transfer. - /// * Re-Fungible Mode: The desired number of parts to transfer. + /// * `value`: Amount to transfer. + /// * Non-Fungible Mode: An NFT is indivisible, there is always 1 corresponding to an ID. + /// * Fungible Mode: The desired number of pieces to transfer. + /// * Re-Fungible Mode: The desired number of pieces to transfer. #[weight = T::CommonWeightInfo::transfer_from()] #[transactional] pub fn transfer_from(origin, from: T::CrossAccountId, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128 ) -> DispatchResultWithPostInfo { @@ -1040,7 +1040,8 @@ decl_module! { /// # Arguments /// /// * `collection_id`: ID of the modified collection. - /// * `new_limit`: New limits of the collection. They will overwrite the current ones. + /// * `new_limit`: New limits of the collection. Fields that are not set (None) + /// will not overwrite the old ones. #[weight = >::set_collection_limits()] #[transactional] pub fn set_collection_limits( @@ -1073,7 +1074,8 @@ decl_module! { /// # Arguments /// /// * `collection_id`: ID of the modified collection. - /// * `new_permission`: New permissions of the collection. They will overwrite the current ones. + /// * `new_permission`: New permissions of the collection. Fields that are not set (None) + /// will not overwrite the old ones. #[weight = >::set_collection_limits()] #[transactional] pub fn set_collection_permissions( @@ -1096,7 +1098,7 @@ decl_module! { target_collection.save() } - /// Re-partition a refungible token, while owning all of its parts. + /// Re-partition a refungible token, while owning all of its parts/pieces. /// /// # Permissions /// @@ -1106,7 +1108,7 @@ decl_module! { /// /// * `collection_id`: ID of the collection the RFT belongs to. /// * `token_id`: ID of the RFT. - /// * `amount`: New number of parts into which the token shall be partitioned. + /// * `amount`: New number of parts/pieces into which the token shall be partitioned. #[weight = T::RefungibleExtensionsWeightInfo::repartition()] #[transactional] pub fn repartition( From 5b40b46836ce858e9a5a7d45d22dbe842967041f Mon Sep 17 00:00:00 2001 From: PraetorP Date: Mon, 18 Jul 2022 21:08:02 +0700 Subject: [PATCH 0058/1274] fix: FT --- pallets/fungible/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index 3015dfb0b4..7b94ba579a 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -537,7 +537,7 @@ impl Pallet { Ok(allowance) } - /// Transfer FT tokens from one account to another. + /// Transfer fungible tokens from one account to another. /// Same as the [`transfer`] but spender doesn't needs to be an owner of the token pieces. /// The owner should set allowance for the spender to transfer pieces. /// See [`set_allowance`][`Pallet::set_allowance`] for more details. @@ -562,7 +562,7 @@ impl Pallet { Ok(()) } - /// Burn FT tokens from the account. + /// Burn fungible tokens from the account. /// /// Same as the [`burn`][`Pallet::burn`] but spender doesn't need to be an owner of the tokens. The `from` should /// set allowance for the spender to burn tokens. @@ -585,7 +585,7 @@ impl Pallet { Ok(()) } - /// Creates FT token. + /// Creates fungible token. /// /// The sender should be the owner/admin of the collection or collection should be configured /// to allow public minting. From 95d6df7b2c6bedf01615a67bb0f584b1eec47301 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Mon, 18 Jul 2022 22:03:08 +0700 Subject: [PATCH 0059/1274] doc: added more detailed description --- pallets/fungible/src/lib.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index 7b94ba579a..e85e54d8b5 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -472,6 +472,9 @@ impl Pallet { /// Set allowance for the spender to `transfer` or `burn` owner's tokens. /// + /// - `collection`: Collection that contains the token + /// - `owner`: Owner of tokens that sets the allowance. + /// - `spender`: Recipient of the allowance rights. /// - `amount`: Amount of tokens the spender is allowed to `transfer` or `burn`. pub fn set_allowance( collection: &FungibleHandle, @@ -497,7 +500,13 @@ impl Pallet { Ok(()) } - /// Returns allowance, which should be set after transaction + /// Checks if a non-owner has (enough) allowance from the owner to perform operations on the tokens. + /// Returns the expected remaining allowance - it should be set manually if the transaction proceeds. + /// + /// - `collection`: Collection that contains the token. + /// - `spender`: CrossAccountId who has the allowance rights. + /// - `from`: The owner of the tokens who sets the allowance. + /// - `amount`: Amount of tokens by which the allowance sholud be reduced. fn check_allowed( collection: &FungibleHandle, spender: &T::CrossAccountId, @@ -538,11 +547,10 @@ impl Pallet { } /// Transfer fungible tokens from one account to another. - /// Same as the [`transfer`] but spender doesn't needs to be an owner of the token pieces. + /// Same as the [`transfer`][`Pallet::transfer`] but spender doesn't needs to be an owner of the token pieces. /// The owner should set allowance for the spender to transfer pieces. /// See [`set_allowance`][`Pallet::set_allowance`] for more details. - /// - /// [`transfer`]: struct.Pallet.html#method.transfer + pub fn transfer_from( collection: &FungibleHandle, spender: &T::CrossAccountId, From f549b53e866e231a11baacf1ac96d72f47a4b1f2 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 19 Jul 2022 06:52:34 +0000 Subject: [PATCH 0060/1274] doc: fix PR --- pallets/common/src/dispatch.rs | 2 +- pallets/common/src/erc.rs | 1 + pallets/common/src/lib.rs | 69 +++++++++++++++++----------------- 3 files changed, 37 insertions(+), 35 deletions(-) diff --git a/pallets/common/src/dispatch.rs b/pallets/common/src/dispatch.rs index 3f9d204241..73a0955087 100644 --- a/pallets/common/src/dispatch.rs +++ b/pallets/common/src/dispatch.rs @@ -25,7 +25,7 @@ pub fn dispatch_weight() -> Weight { /// Helper function to implement substrate calls for common collection methods. /// /// * `collection` - The collection on which to call the method. -/// * `call` - The function in which to call the corresponding method from [CommonCollectionOperations]. +/// * `call` - The function in which to call the corresponding method from [`CommonCollectionOperations`]. pub fn dispatch_tx< T: Config, C: FnOnce(&dyn CommonCollectionOperations) -> DispatchResultWithPostInfo, diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index d17e5dcb0c..4e6e279b06 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -51,6 +51,7 @@ pub enum CollectionHelpersEvents { pub trait CommonEvmHandler { const CODE: &'static [u8]; + /// Call precompiled handle. fn call(self, handle: &mut impl PrecompileHandle) -> Option; } diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 282892f3da..0fd54da5c2 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -16,7 +16,9 @@ //! # Common pallet //! -//! The Common pallet provides functionality for handling collections. +//! The Common pallet provides an interface for common collection operations for different collection types +//! (see [CommonCollectionOperations], as well as a generic dispatcher for these, see [dispatch] module. +//! It also provides this functionality to EVM, see [erc] and [eth] modules. //! //! ## Overview //! @@ -42,12 +44,9 @@ //! **Collection properties** - Collection properties are simply key-value stores where various //! metadata can be placed. //! -//! **Collection property permissions** - For each property in the collection can be set permission +//! **Permissions on token properties** - For each property in the token can be set permission //! to change, see [PropertyPermission]. //! -//! **Permissions on token properties** - Similar to _permissions on collection properties_, -//! only restrictions apply to token properties. -//! //! **Collection administrator** - For a collection, you can set administrators who have the right //! to most actions on the collection. @@ -132,9 +131,10 @@ pub type SelfWeightOf = ::WeightInfo; /// Collection handle contains information about collection data and id. /// Also provides functionality to count consumed gas. +/// /// CollectionHandle is used as a generic wrapper for collections of all types. /// It allows to perform common operations and queries on any collection type, -/// both completely general for all, as well as their respective implementations of [CommonCollectionOperations]. +/// both completely general for all, as well as their respective implementations of [`CommonCollectionOperations`]. #[must_use = "Should call submit_logs or save, otherwise some data will be lost for evm side"] pub struct CollectionHandle { /// Collection id @@ -163,7 +163,7 @@ impl CollectionHandle { }) } - /// Same as [CollectionHandle::new] but with an existed [SubstrateRecorder]. + /// Same as [CollectionHandle::new] but with an existed [`SubstrateRecorder`]. pub fn new_with_recorder(id: CollectionId, recorder: SubstrateRecorder) -> Option { >::get(id).map(|collection| Self { id, @@ -178,7 +178,7 @@ impl CollectionHandle { Self::new_with_gas_limit(id, u64::MAX) } - /// Same as [CollectionHandle::new] but if collection not found [Error::CollectionNotFound] returned. + /// Same as [`CollectionHandle::new`] but if collection not found [`Error::CollectionNotFound`] returned. pub fn try_get(id: CollectionId) -> Result { Ok(Self::new(id).ok_or(>::CollectionNotFound)?) } @@ -213,7 +213,7 @@ impl CollectionHandle { /// /// Unique collections allows sponsoring for certain actions. /// This method allows you to set the sponsor of the collection. - /// In order for sponsorship to become active, it must be confirmed through [Self::confirm_sponsorship]. + /// In order for sponsorship to become active, it must be confirmed through [`Self::confirm_sponsorship`]. pub fn set_sponsor(&mut self, sponsor: T::AccountId) -> DispatchResult { self.collection.sponsorship = SponsorshipState::Unconfirmed(sponsor); Ok(()) @@ -222,7 +222,7 @@ impl CollectionHandle { /// Confirm sponsorship /// /// In order for the sponsorship to become active, the user set as the sponsor must confirm their participation. - /// Before confirming sponsorship, the user must be specified as the sponsor of the collection via [Self::set_sponsor]. + /// Before confirming sponsorship, the user must be specified as the sponsor of the collection via [`Self::set_sponsor`]. pub fn confirm_sponsorship(&mut self, sender: &T::AccountId) -> Result { if self.collection.sponsorship.pending_sponsor() != Some(sender) { return Ok(false); @@ -233,7 +233,7 @@ impl CollectionHandle { } /// Checks that the collection was created with, and must be operated upon through **Unique API**. - /// Now check only the `external_collection` flag and if it's **true**, then return [Error::CollectionIsExternal] error. + /// Now check only the `external_collection` flag and if it's **true**, then return [`Error::CollectionIsExternal`] error. pub fn check_is_internal(&self) -> DispatchResult { if self.external_collection { return Err(>::CollectionIsExternal)?; @@ -243,7 +243,7 @@ impl CollectionHandle { } /// Checks that the collection was created with, and must be operated upon through an **assimilated API**. - /// Now check only the `external_collection` flag and if it's **false**, then return [Error::CollectionIsInternal] error. + /// Now check only the `external_collection` flag and if it's **false**, then return [`Error::CollectionIsInternal`] error. pub fn check_is_external(&self) -> DispatchResult { if !self.external_collection { return Err(>::CollectionIsInternal)?; @@ -325,10 +325,10 @@ pub mod pallet { + TypeInfo + account::Config { - /// Weight info. + /// Weight information for functions of this pallet. type WeightInfo: WeightInfo; - /// Events compatible with [frame_system::Config::Event]. + /// Events compatible with [`frame_system::Config::Event`]. type Event: IsType<::Event> + From>; /// Currency. @@ -340,19 +340,19 @@ pub mod pallet { <::Currency as Currency>::Balance, >; - /// Collection dispatcher. + /// Dispatcher of operations on collections. type CollectionDispatch: CollectionDispatch; /// Treasury account id getter. type TreasuryAccountId: Get; - /// Contract address getter. + /// Address under which the CollectionHelper contract would be available. type ContractAddress: Get; /// Mapper for tokens to Etherium addresses. type EvmTokenAddressMapping: TokenAddressMapping; - /// Mapper for tokens to [CrossAccountId]. + /// Mapper for tokens to [`CrossAccountId`]. type CrossTokenAddressMapping: TokenAddressMapping; } @@ -378,7 +378,7 @@ pub mod pallet { CollectionCreated( /// Globally unique identifier of newly created collection. CollectionId, - /// [CollectionMode] converted into _u8_. + /// [`CollectionMode`] converted into _u8_. u8, /// Collection owner. T::AccountId, @@ -1469,19 +1469,20 @@ pub trait CommonWeightInfo { fn burn_from() -> Weight; /// Differs from burn_item in case of Fungible and Refungible, as it should burn - /// whole users's balance + /// whole users's balance. /// /// This method shouldn't be used directly, as it doesn't count breadth price, use [burn_recursively](CommonWeightInfo::burn_recursively) instead fn burn_recursively_self_raw() -> Weight; - /// Cost of iterating over `amount` children while burning, without counting child burning itself + /// Cost of iterating over `amount` children while burning, without counting child burning itself. /// /// This method shouldn't be used directly, as it doesn't count depth price, use [burn_recursively](CommonWeightInfo::burn_recursively) instead fn burn_recursively_breadth_raw(amount: u32) -> Weight; /// The price of recursive burning a token. /// - /// `max_selfs` - + /// `max_selfs` - The maximum burning weight of the token itself. + /// `max_breadth` - The maximum number of nested tokens to burn. fn burn_recursively(max_selfs: u32, max_breadth: u32) -> Weight { Self::burn_recursively_self_raw() .saturating_mul(max_selfs.max(1) as u64) @@ -1589,8 +1590,8 @@ pub trait CommonCollectionOperations { /// Set token properties. /// - /// The appropriate [PropertyPermission] for the token property - /// must be set with [Self::set_token_property_permissions]. + /// The appropriate [`PropertyPermission`] for the token property + /// must be set with [`Self::set_token_property_permissions`]. /// /// * `sender` - Must be either the owner of the token or its admin. /// * `token_id` - The token for which the properties are being set. @@ -1606,8 +1607,8 @@ pub trait CommonCollectionOperations { /// Remove token properties. /// - /// The appropriate [PropertyPermission] for the token property - /// must be set with [Self::set_token_property_permissions]. + /// The appropriate [`PropertyPermission`] for the token property + /// must be set with [`Self::set_token_property_permissions`]. /// /// * `sender` - Must be either the owner of the token or its admin. /// * `token_id` - The token for which the properties are being remove. @@ -1665,9 +1666,9 @@ pub trait CommonCollectionOperations { /// Send parts of a token owned by another user. /// - /// Before calling this method, you must grant rights to the calling user via [Self::approve]. + /// Before calling this method, you must grant rights to the calling user via [`Self::approve`]. /// - /// * `sender` - The user who has access to the token. + /// * `sender` - The user who must have access to the token (see [`Self::approve`]). /// * `from` - The user who owns the token. /// * `to` - Recepient user. /// * `token` - The token of which parts are being sent. @@ -1685,9 +1686,9 @@ pub trait CommonCollectionOperations { /// Burn parts of a token owned by another user. /// - /// Before calling this method, you must grant rights to the calling user via [Self::approve]. + /// Before calling this method, you must grant rights to the calling user via [`Self::approve`]. /// - /// * `sender` - The user who has access to the token. + /// * `sender` - The user who must have access to the token (see [`Self::approve`]). /// * `from` - The user who owns the token. /// * `token` - The token of which parts are being sent. /// * `amount` - The number of parts of the token that will be transferred. @@ -1750,14 +1751,14 @@ pub trait CommonCollectionOperations { /// Get the value of the token property by key. /// - /// * `token` - Token property to get. + /// * `token` - Token with the property to get. /// * `key` - Property name. fn token_property(&self, token_id: TokenId, key: &PropertyKey) -> Option; /// Get a set of token properties by key vector. /// - /// * `token` - Token property to get. - /// * `keys` - Vector of keys. If this parameter is [None](sp_std::result::Result), + /// * `token` - Token with the property to get. + /// * `keys` - Vector of property keys. If this parameter is [None](sp_std::result::Result), /// then all properties are returned. fn token_properties(&self, token: TokenId, keys: Option>) -> Vec; @@ -1811,9 +1812,9 @@ where ) -> DispatchResultWithPostInfo; } -/// Merge [DispatchResult] with [Weight] into [DispatchResultWithPostInfo]. +/// Merge [`DispatchResult`] with [`Weight`] into [`DispatchResultWithPostInfo`]. /// -/// Used for [CommonCollectionOperations] implementations and flexible enough to do so. +/// Used for [`CommonCollectionOperations`] implementations and flexible enough to do so. pub fn with_weight(res: DispatchResult, weight: Weight) -> DispatchResultWithPostInfo { let post_info = PostDispatchInfo { actual_weight: Some(weight), From 2c2150662f3d0c3d32bde8ae4c0d17bb954797b2 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 19 Jul 2022 06:54:17 +0000 Subject: [PATCH 0061/1274] fmt: cargo fmt --- pallets/common/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 0fd54da5c2..9574fc76e6 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -16,8 +16,8 @@ //! # Common pallet //! -//! The Common pallet provides an interface for common collection operations for different collection types -//! (see [CommonCollectionOperations], as well as a generic dispatcher for these, see [dispatch] module. +//! The Common pallet provides an interface for common collection operations for different collection types +//! (see [CommonCollectionOperations], as well as a generic dispatcher for these, see [dispatch] module. //! It also provides this functionality to EVM, see [erc] and [eth] modules. //! //! ## Overview @@ -131,7 +131,7 @@ pub type SelfWeightOf = ::WeightInfo; /// Collection handle contains information about collection data and id. /// Also provides functionality to count consumed gas. -/// +/// /// CollectionHandle is used as a generic wrapper for collections of all types. /// It allows to perform common operations and queries on any collection type, /// both completely general for all, as well as their respective implementations of [`CommonCollectionOperations`]. From aed873b1f22793f54a4ed7d363f71ba227a7e530 Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Tue, 19 Jul 2022 07:15:32 +0000 Subject: [PATCH 0062/1274] doc: adjust semantics --- pallets/unique/src/lib.rs | 45 ++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index a047a006ce..0e9b82803e 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -27,7 +27,7 @@ //! The Unique pallet's purpose is to be the primary interface between //! external users and the inner structure of the Unique chains. //! -//! It also contains an implementation of [`CollectionHelpers`](eth), +//! It also contains an implementation of [`CollectionHelpers`][`eth`], //! an Ethereum contract dealing with collection operations. //! //! ## Interface @@ -292,13 +292,13 @@ decl_module! { 0 } - /// DEPRECATED - use createCollectionEx. Create a Collection of tokens. + /// Create a collection of tokens. /// /// Each Token may have multiple properties encoded as an array of bytes /// of certain length. The initial owner of the collection is set /// to the address that signed the transaction and can be changed later. /// - /// Prefer [`create_collection_ex`](Call::create_collection_ex) instead. + /// Deprecated! Prefer [`create_collection_ex`][`Pallet::create_collection_ex`] instead. /// /// # Permissions /// @@ -306,12 +306,13 @@ decl_module! { /// /// # Arguments /// - /// * `collection_name`: UTF-16 string with collection name (limit 64 characters), - /// will be stored as zero-terminated. - /// * `collection_description`: UTF-16 string with collection description (limit 256 characters), - /// will be stored as zero-terminated. - /// * `token_prefix`: UTF-8 string with token prefix. - /// * `mode`: [`CollectionMode`] and type dependent data. + /// * `collection_name`: Wide-character string with collection name + /// (limit [`MAX_COLLECTION_NAME_LENGTH`]). + /// * `collection_description`: Wide-character string with collection description + /// (limit [`MAX_COLLECTION_DESCRIPTION_LENGTH`]). + /// * `token_prefix`: Byte string containing the token prefix to mark a collection + /// to which a token belongs (limit [`MAX_TOKEN_PREFIX_LENGTH`]). + /// * `mode`: Type of items stored in the collection and type dependent data. // returns collection ID #[weight = >::create_collection()] #[transactional] @@ -334,7 +335,8 @@ decl_module! { } /// Create a collection with explicit parameters. - /// Prefer it to the deprecated [`create_collection`](Call::create_collection) method. + /// + /// Prefer it to the deprecated [`create_collection`][`Pallet::create_collection`] method. /// /// # Permissions /// @@ -544,6 +546,7 @@ decl_module! { } /// Set (invite) a new collection sponsor. + /// /// If successful, confirmation from the sponsor-to-be will be pending. /// /// # Permissions @@ -575,8 +578,8 @@ decl_module! { } /// Confirm own sponsorship of a collection, becoming the sponsor. - /// An invitation must be pending, see [`set_collection_sponsor`](Call::set_collection_sponsor). /// + /// An invitation must be pending, see [`set_collection_sponsor`][`Pallet::set_collection_sponsor`]. /// Sponsor can pay the fees of a transaction instead of the sender, /// but only within specified limits. /// @@ -607,7 +610,7 @@ decl_module! { target_collection.save() } - /// Remove a sponsor from a collection, making everyone pay for their own transactions. + /// Remove a collection's a sponsor, making everyone pay for their own transactions. /// /// # Permissions /// @@ -635,7 +638,7 @@ decl_module! { /// Mint an item within a collection. /// - /// A collection must exist first, see [`create_collection_ex`](Call::create_collection_ex). + /// A collection must exist first, see [`create_collection_ex`][`Pallet::create_collection_ex`]. /// /// # Permissions /// @@ -644,7 +647,7 @@ decl_module! { /// * Anyone if /// * Allow List is enabled, and /// * Address is added to allow list, and - /// * MintPermission is enabled (see [`set_collection_permissions`](Call::set_collection_permissions)) + /// * MintPermission is enabled (see [`set_collection_permissions`][`Pallet::set_collection_permissions`]) /// /// # Arguments /// @@ -662,7 +665,7 @@ decl_module! { /// Create multiple items within a collection. /// - /// A collection must exist first, see [`create_collection_ex`](Call::create_collection_ex). + /// A collection must exist first, see [`create_collection_ex`][`Pallet::create_collection_ex`]. /// /// # Permissions /// @@ -671,7 +674,7 @@ decl_module! { /// * Anyone if /// * Allow List is enabled, and /// * Address is added to the allow list, and - /// * MintPermission is enabled (see [`set_collection_permissions`](Call::set_collection_permissions)) + /// * MintPermission is enabled (see [`set_collection_permissions`][`Pallet::set_collection_permissions`]) /// /// # Arguments /// @@ -750,7 +753,7 @@ decl_module! { /// * Collection admin /// * Token owner /// - /// See [`set_token_property_permissions`](Call::set_token_property_permissions). + /// See [`set_token_property_permissions`][`Pallet::set_token_property_permissions`]. /// /// # Arguments /// @@ -843,7 +846,7 @@ decl_module! { /// * Anyone if /// * Allow List is enabled, and /// * Address is added to allow list, and - /// * MintPermission is enabled (see [`set_collection_permissions`](Call::set_collection_permissions)) + /// * MintPermission is enabled (see [`set_collection_permissions`][`Pallet::set_collection_permissions`]) /// /// # Arguments /// @@ -915,7 +918,8 @@ decl_module! { } /// Destroy a token on behalf of the owner as a non-owner account. - /// See also: [`approve`](Call::approve). + /// + /// See also: [`approve`][`Pallet::approve`]. /// /// After this method executes, one approval is removed from the total so that /// the approved address will not be able to transfer this item again from this owner. @@ -999,7 +1003,8 @@ decl_module! { } /// Change ownership of an item on behalf of the owner as a non-owner account. - /// See the [`approve`](Call::approve) method for additional information. + /// + /// See the [`approve`][`Pallet::approve`] method for additional information. /// /// After this method executes, one approval is removed from the total so that /// the approved address will not be able to transfer this item again from this owner. From 5b3cd06dc051e8c9b6a080a0b83ccaf1f692a7e0 Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Tue, 19 Jul 2022 08:11:03 +0000 Subject: [PATCH 0063/1274] doc: adjust create_collection deprecation --- pallets/unique/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index 0e9b82803e..fcda41003a 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -34,7 +34,7 @@ //! //! ### Dispatchables //! -//! - `create_collection` - Create a collection of tokens. **Deprecated**, use `createCollectionEx`. +//! - `create_collection` - Create a collection of tokens. **Deprecated**, use `create_collection_ex`. //! - `create_collection_ex` - Create a collection of tokens with explicit parameters. //! - `destroy_collection` - Destroy a collection if no tokens exist within. //! - `add_to_allow_list` - Add an address to allow list. @@ -298,7 +298,7 @@ decl_module! { /// of certain length. The initial owner of the collection is set /// to the address that signed the transaction and can be changed later. /// - /// Deprecated! Prefer [`create_collection_ex`][`Pallet::create_collection_ex`] instead. + /// Prefer the more advanced [`create_collection_ex`][`Pallet::create_collection_ex`] instead. /// /// # Permissions /// @@ -316,14 +316,14 @@ decl_module! { // returns collection ID #[weight = >::create_collection()] #[transactional] - #[deprecated] + #[deprecated(note = "`create_collection_ex` is more up-to-date and advanced, prefer it instead")] pub fn create_collection( origin, collection_name: BoundedVec>, collection_description: BoundedVec>, token_prefix: BoundedVec>, mode: CollectionMode - ) -> DispatchResult { + ) -> DispatchResult { let data: CreateCollectionData = CreateCollectionData { name: collection_name, description: collection_description, From 6ac860e950dd3d6e5afd1cf09b9f30658e933193 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 19 Jul 2022 11:24:55 +0000 Subject: [PATCH 0064/1274] doc: fix PR --- pallets/common/src/lib.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 9574fc76e6..d74117b854 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -17,23 +17,22 @@ //! # Common pallet //! //! The Common pallet provides an interface for common collection operations for different collection types -//! (see [CommonCollectionOperations], as well as a generic dispatcher for these, see [dispatch] module. +//! (see [CommonCollectionOperations]), as well as a generic dispatcher for these, see [dispatch] module. //! It also provides this functionality to EVM, see [erc] and [eth] modules. //! //! ## Overview +//! +//! The Common pallet provides functionality for handling collections. //! //! The Common pallet provides functions for: //! -//! - Setting and approving collection soponsor. +//! - Setting and approving collection sponsor. //! - Get\set\delete allow list. //! - Get\set\delete collection properties. //! - Get\set\delete collection property permissions. //! - Get\set\delete token property permissions. //! - Get\set\delete collection administrators. //! - Checking access permissions. -//! - Provides an interface for common collection operations for different collection types. -//! - Provides dispatching for implementations of common collection operations, see [dispatch] module. -//! - Provides functionality of collection into evm, see [erc] and [eth] module. //! //! ### Terminology //! **Collection sponsor** - For the collection, you can set a sponsor, at whose expense it will @@ -331,10 +330,10 @@ pub mod pallet { /// Events compatible with [`frame_system::Config::Event`]. type Event: IsType<::Event> + From>; - /// Currency. + /// Handler of accounts and payment. type Currency: Currency; - /// Price getter to create the collection. + /// Set price to create a collection. #[pallet::constant] type CollectionCreationPrice: Get< <::Currency as Currency>::Balance, @@ -343,16 +342,16 @@ pub mod pallet { /// Dispatcher of operations on collections. type CollectionDispatch: CollectionDispatch; - /// Treasury account id getter. + /// Account which holds the chain's treasury. type TreasuryAccountId: Get; /// Address under which the CollectionHelper contract would be available. type ContractAddress: Get; - /// Mapper for tokens to Etherium addresses. + /// Mapper for token addresses to Ethereum addresses. type EvmTokenAddressMapping: TokenAddressMapping; - /// Mapper for tokens to [`CrossAccountId`]. + /// Mapper for token addresses to [`CrossAccountId`]. type CrossTokenAddressMapping: TokenAddressMapping; } From ba8a9dbd563accade86779d765899d64134c30b8 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 19 Jul 2022 11:34:24 +0000 Subject: [PATCH 0065/1274] doc: fix PR --- pallets/common/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index d74117b854..c428801b93 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -21,7 +21,7 @@ //! It also provides this functionality to EVM, see [erc] and [eth] modules. //! //! ## Overview -//! +//! //! The Common pallet provides functionality for handling collections. //! //! The Common pallet provides functions for: @@ -177,7 +177,7 @@ impl CollectionHandle { Self::new_with_gas_limit(id, u64::MAX) } - /// Same as [`CollectionHandle::new`] but if collection not found [`Error::CollectionNotFound`] returned. + /// Same as [`CollectionHandle::new`] but if collection not found [CollectionNotFound](Error::CollectionNotFound) returned. pub fn try_get(id: CollectionId) -> Result { Ok(Self::new(id).ok_or(>::CollectionNotFound)?) } From 6c6ed89d2a5335dedc945602dc053062a93b2784 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 20 Jul 2022 08:01:14 +0000 Subject: [PATCH 0066/1274] doc: fix PR --- pallets/common/src/dispatch.rs | 4 ++-- pallets/common/src/lib.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pallets/common/src/dispatch.rs b/pallets/common/src/dispatch.rs index 73a0955087..c1a9203d82 100644 --- a/pallets/common/src/dispatch.rs +++ b/pallets/common/src/dispatch.rs @@ -71,7 +71,7 @@ pub fn dispatch_tx< /// Interface for working with different collections through the dispatcher. pub trait CollectionDispatch { - /// Create a collection. The collection will be created according to the value of [data.mode](CreateCollectionData::mode). + /// Create a collection. The collection will be created according to the value of [`data.mode`](CreateCollectionData::mode). /// /// * `sender` - The user who will become the owner of the collection. /// * `data` - Description of the created collection. @@ -94,6 +94,6 @@ pub trait CollectionDispatch { /// Get the collection handle for the corresponding implementation. fn into_inner(self) -> CollectionHandle; - /// Get the implementation of [CommonCollectionOperations]. + /// Get the implementation of [`CommonCollectionOperations`]. fn as_dyn(&self) -> &dyn CommonCollectionOperations; } diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index c428801b93..1314202266 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -16,13 +16,13 @@ //! # Common pallet //! -//! The Common pallet provides an interface for common collection operations for different collection types -//! (see [CommonCollectionOperations]), as well as a generic dispatcher for these, see [dispatch] module. -//! It also provides this functionality to EVM, see [erc] and [eth] modules. +//! The Common pallet provides functionality for handling collections. //! //! ## Overview //! -//! The Common pallet provides functionality for handling collections. +//! The Common pallet provides an interface for common collection operations for different collection types +//! (see [CommonCollectionOperations]), as well as a generic dispatcher for these, see [dispatch] module. +//! It also provides this functionality to EVM, see [erc] and [eth] modules. //! //! The Common pallet provides functions for: //! @@ -44,7 +44,7 @@ //! metadata can be placed. //! //! **Permissions on token properties** - For each property in the token can be set permission -//! to change, see [PropertyPermission]. +//! to change, see [`PropertyPermission`]. //! //! **Collection administrator** - For a collection, you can set administrators who have the right //! to most actions on the collection. From 14be6d1233ab0aac01d8a509675e046b7665ae24 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 20 Jul 2022 09:31:31 +0000 Subject: [PATCH 0067/1274] fix: benchmark compile --- pallets/nonfungible/src/benchmarking.rs | 6 +- pallets/nonfungible/src/weights.rs | 94 ++++++++++++------------- pallets/refungible/src/benchmarking.rs | 1 + 3 files changed, 49 insertions(+), 52 deletions(-) diff --git a/pallets/nonfungible/src/benchmarking.rs b/pallets/nonfungible/src/benchmarking.rs index 5e8b51be2b..c28db905e2 100644 --- a/pallets/nonfungible/src/benchmarking.rs +++ b/pallets/nonfungible/src/benchmarking.rs @@ -183,7 +183,7 @@ benchmarks! { value: property_value(), }).collect::>(); let item = create_max_item(&collection, &owner, owner.clone())?; - }: {>::set_token_properties(&collection, &owner, item, props, false, &Unlimited)?} + }: {>::set_token_properties(&collection, &owner, item, props.into_iter(), false, &Unlimited)?} delete_token_properties { let b in 0..MAX_PROPERTIES_PER_ITEM; @@ -205,7 +205,7 @@ benchmarks! { value: property_value(), }).collect::>(); let item = create_max_item(&collection, &owner, owner.clone())?; - >::set_token_properties(&collection, &owner, item, props, false, &Unlimited)?; + >::set_token_properties(&collection, &owner, item, props.into_iter(), false, &Unlimited)?; let to_delete = (0..b).map(|k| property_key(k as usize)).collect::>(); - }: {>::delete_token_properties(&collection, &owner, item, to_delete, &Unlimited)?} + }: {>::delete_token_properties(&collection, &owner, item, to_delete.into_iter(), &Unlimited)?} } diff --git a/pallets/nonfungible/src/weights.rs b/pallets/nonfungible/src/weights.rs index af5de78ee5..e7ae687542 100644 --- a/pallets/nonfungible/src/weights.rs +++ b/pallets/nonfungible/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_nonfungible //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-06-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-07-20, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -56,7 +56,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn create_item() -> Weight { - (24_135_000 as Weight) + (20_328_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -65,9 +65,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (21_952_000 as Weight) - // Standard Error: 5_000 - .saturating_add((4_727_000 as Weight).saturating_mul(b as Weight)) + (10_134_000 as Weight) + // Standard Error: 3_000 + .saturating_add((4_927_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(b as Weight))) @@ -77,9 +77,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items_ex(b: u32, ) -> Weight { - (10_432_000 as Weight) - // Standard Error: 6_000 - .saturating_add((7_383_000 as Weight).saturating_mul(b as Weight)) + (5_710_000 as Weight) + // Standard Error: 4_000 + .saturating_add((7_578_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -93,7 +93,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_item() -> Weight { - (29_798_000 as Weight) + (28_433_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -105,7 +105,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_recursively_self_raw() -> Weight { - (37_955_000 as Weight) + (34_435_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -119,8 +119,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Common CollectionById (r:1 w:0) fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_349_000 - .saturating_add((275_145_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_539_000 + .saturating_add((304_456_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(6 as Weight)) @@ -131,14 +131,14 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Allowance (r:1 w:0) // Storage: Nonfungible Owned (r:0 w:2) fn transfer() -> Weight { - (27_867_000 as Weight) + (24_376_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } // Storage: Nonfungible TokenData (r:1 w:0) // Storage: Nonfungible Allowance (r:1 w:1) fn approve() -> Weight { - (18_824_000 as Weight) + (15_890_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -147,7 +147,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible AccountBalance (r:2 w:2) // Storage: Nonfungible Owned (r:0 w:2) fn transfer_from() -> Weight { - (32_879_000 as Weight) + (28_634_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -159,7 +159,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (37_061_000 as Weight) + (32_201_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -167,28 +167,26 @@ impl WeightInfo for SubstrateWeight { fn set_token_property_permissions(b: u32, ) -> Weight { (0 as Weight) // Standard Error: 57_000 - .saturating_add((15_149_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((15_232_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionPropertyPermissions (r:1 w:0) - // Storage: Nonfungible TokenData (r:1 w:0) // Storage: Nonfungible TokenProperties (r:1 w:1) fn set_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 2_278_000 - .saturating_add((409_613_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) + // Standard Error: 1_648_000 + .saturating_add((288_654_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionPropertyPermissions (r:1 w:0) - // Storage: Nonfungible TokenData (r:1 w:0) // Storage: Nonfungible TokenProperties (r:1 w:1) fn delete_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 2_234_000 - .saturating_add((408_185_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) + // Standard Error: 1_632_000 + .saturating_add((289_190_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } } @@ -200,7 +198,7 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn create_item() -> Weight { - (24_135_000 as Weight) + (20_328_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -209,9 +207,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (21_952_000 as Weight) - // Standard Error: 5_000 - .saturating_add((4_727_000 as Weight).saturating_mul(b as Weight)) + (10_134_000 as Weight) + // Standard Error: 3_000 + .saturating_add((4_927_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(b as Weight))) @@ -221,9 +219,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items_ex(b: u32, ) -> Weight { - (10_432_000 as Weight) - // Standard Error: 6_000 - .saturating_add((7_383_000 as Weight).saturating_mul(b as Weight)) + (5_710_000 as Weight) + // Standard Error: 4_000 + .saturating_add((7_578_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -237,7 +235,7 @@ impl WeightInfo for () { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_item() -> Weight { - (29_798_000 as Weight) + (28_433_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -249,7 +247,7 @@ impl WeightInfo for () { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_recursively_self_raw() -> Weight { - (37_955_000 as Weight) + (34_435_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -263,8 +261,8 @@ impl WeightInfo for () { // Storage: Common CollectionById (r:1 w:0) fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_349_000 - .saturating_add((275_145_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_539_000 + .saturating_add((304_456_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(7 as Weight)) .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) @@ -275,14 +273,14 @@ impl WeightInfo for () { // Storage: Nonfungible Allowance (r:1 w:0) // Storage: Nonfungible Owned (r:0 w:2) fn transfer() -> Weight { - (27_867_000 as Weight) + (24_376_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } // Storage: Nonfungible TokenData (r:1 w:0) // Storage: Nonfungible Allowance (r:1 w:1) fn approve() -> Weight { - (18_824_000 as Weight) + (15_890_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -291,7 +289,7 @@ impl WeightInfo for () { // Storage: Nonfungible AccountBalance (r:2 w:2) // Storage: Nonfungible Owned (r:0 w:2) fn transfer_from() -> Weight { - (32_879_000 as Weight) + (28_634_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } @@ -303,7 +301,7 @@ impl WeightInfo for () { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (37_061_000 as Weight) + (32_201_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } @@ -311,28 +309,26 @@ impl WeightInfo for () { fn set_token_property_permissions(b: u32, ) -> Weight { (0 as Weight) // Standard Error: 57_000 - .saturating_add((15_149_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((15_232_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionPropertyPermissions (r:1 w:0) - // Storage: Nonfungible TokenData (r:1 w:0) // Storage: Nonfungible TokenProperties (r:1 w:1) fn set_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 2_278_000 - .saturating_add((409_613_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + // Standard Error: 1_648_000 + .saturating_add((288_654_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionPropertyPermissions (r:1 w:0) - // Storage: Nonfungible TokenData (r:1 w:0) // Storage: Nonfungible TokenProperties (r:1 w:1) fn delete_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 2_234_000 - .saturating_add((408_185_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + // Standard Error: 1_632_000 + .saturating_add((289_190_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } } diff --git a/pallets/refungible/src/benchmarking.rs b/pallets/refungible/src/benchmarking.rs index cb92910417..dc4ca04684 100644 --- a/pallets/refungible/src/benchmarking.rs +++ b/pallets/refungible/src/benchmarking.rs @@ -38,6 +38,7 @@ fn create_max_item_data( .collect::>() .try_into() .unwrap(), + properties: Default::default(), } } fn create_max_item( From f2f19bf45d08b909bb3c1147b81144ae8399ea27 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 20 Jul 2022 11:04:44 +0000 Subject: [PATCH 0068/1274] minor: add bechmarks for RFT collection & token properties --- pallets/refungible/src/benchmarking.rs | 66 ++++++++++- pallets/refungible/src/common.rs | 27 ++--- pallets/refungible/src/weights.rs | 153 +++++++++++++++++-------- 3 files changed, 181 insertions(+), 65 deletions(-) diff --git a/pallets/refungible/src/benchmarking.rs b/pallets/refungible/src/benchmarking.rs index dc4ca04684..79e5fa249b 100644 --- a/pallets/refungible/src/benchmarking.rs +++ b/pallets/refungible/src/benchmarking.rs @@ -18,9 +18,9 @@ use super::*; use crate::{Pallet, Config, RefungibleHandle}; use sp_std::prelude::*; -use pallet_common::benchmarking::{create_collection_raw, create_data}; +use pallet_common::benchmarking::{create_collection_raw, property_key, property_value, create_data}; use frame_benchmarking::{benchmarks, account}; -use up_data_structs::{CollectionMode, MAX_ITEMS_PER_BATCH, CUSTOM_DATA_LIMIT, budget::Unlimited}; +use up_data_structs::{CollectionMode, MAX_ITEMS_PER_BATCH, MAX_PROPERTIES_PER_ITEM, CUSTOM_DATA_LIMIT, budget::Unlimited}; use pallet_common::bench_init; use core::convert::TryInto; use core::iter::IntoIterator; @@ -205,6 +205,68 @@ benchmarks! { >::set_allowance(&collection, &sender, &burner, item, 200)?; }: {>::burn_from(&collection, &burner, &sender, item, 200, &Unlimited)?} + set_token_property_permissions { + let b in 0..MAX_PROPERTIES_PER_ITEM; + bench_init!{ + owner: sub; collection: collection(owner); + owner: cross_from_sub; + }; + let perms = (0..b).map(|k| PropertyKeyPermission { + key: property_key(k as usize), + permission: PropertyPermission { + mutable: false, + collection_admin: false, + token_owner: false, + }, + }).collect::>(); + }: {>::set_token_property_permissions(&collection, &owner, perms)?} + + set_token_properties { + let b in 0..MAX_PROPERTIES_PER_ITEM; + bench_init!{ + owner: sub; collection: collection(owner); + owner: cross_from_sub; + }; + let perms = (0..b).map(|k| PropertyKeyPermission { + key: property_key(k as usize), + permission: PropertyPermission { + mutable: false, + collection_admin: true, + token_owner: true, + }, + }).collect::>(); + >::set_token_property_permissions(&collection, &owner, perms)?; + let props = (0..b).map(|k| Property { + key: property_key(k as usize), + value: property_value(), + }).collect::>(); + let item = create_max_item(&collection, &owner, [(owner.clone(), 200)])?; + }: {>::set_token_properties(&collection, &owner, item, props.into_iter(), false, &Unlimited)?} + + delete_token_properties { + let b in 0..MAX_PROPERTIES_PER_ITEM; + bench_init!{ + owner: sub; collection: collection(owner); + owner: cross_from_sub; + }; + let perms = (0..b).map(|k| PropertyKeyPermission { + key: property_key(k as usize), + permission: PropertyPermission { + mutable: true, + collection_admin: true, + token_owner: true, + }, + }).collect::>(); + >::set_token_property_permissions(&collection, &owner, perms)?; + let props = (0..b).map(|k| Property { + key: property_key(k as usize), + value: property_value(), + }).collect::>(); + let item = create_max_item(&collection, &owner, [(owner.clone(), 200)])?; + >::set_token_properties(&collection, &owner, item, props.into_iter(), false, &Unlimited)?; + let to_delete = (0..b).map(|k| property_key(k as usize)).collect::>(); + }: {>::delete_token_properties(&collection, &owner, item, to_delete.into_iter(), &Unlimited)?} + repartition_item { bench_init!{ owner: sub; collection: collection(owner); diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index 9296b04f40..68b8f2952e 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -22,7 +22,7 @@ use up_data_structs::{ CollectionId, TokenId, CreateItemExData, CreateRefungibleExData, budget::Budget, Property, PropertyKey, PropertyValue, PropertyKeyPermission, CreateItemData, }; -use pallet_common::{CommonCollectionOperations, CommonWeightInfo, RefungibleExtensions, with_weight}; +use pallet_common::{CommonCollectionOperations, CommonWeightInfo, RefungibleExtensions, with_weight, weights::WeightInfo as _}; use pallet_structure::Error as StructureError; use sp_runtime::{DispatchError}; use sp_std::{vec::Vec, vec}; @@ -67,29 +67,24 @@ impl CommonWeightInfo for CommonWeights { max_weight_of!(burn_item_partial(), burn_item_fully()) } - fn set_collection_properties(_amount: u32) -> Weight { - // Error - 0 + fn set_collection_properties(amount: u32) -> Weight { + >::set_collection_properties(amount) } - fn delete_collection_properties(_amount: u32) -> Weight { - // Error - 0 + fn delete_collection_properties(amount: u32) -> Weight { + >::delete_collection_properties(amount) } - fn set_token_properties(_amount: u32) -> Weight { - // Error - 0 + fn set_token_properties(amount: u32) -> Weight { + >::set_token_properties(amount) } - fn delete_token_properties(_amount: u32) -> Weight { - // Error - 0 + fn delete_token_properties(amount: u32) -> Weight { + >::delete_token_properties(amount) } - fn set_token_property_permissions(_amount: u32) -> Weight { - // Error - 0 + fn set_token_property_permissions(amount: u32) -> Weight { + >::set_token_property_permissions(amount) } fn transfer() -> Weight { diff --git a/pallets/refungible/src/weights.rs b/pallets/refungible/src/weights.rs index b04d9e04f8..234ae4f3c7 100644 --- a/pallets/refungible/src/weights.rs +++ b/pallets/refungible/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_refungible //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-06-27, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-07-20, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -49,6 +49,9 @@ pub trait WeightInfo { fn transfer_from_removing() -> Weight; fn transfer_from_creating_removing() -> Weight; fn burn_from() -> Weight; + fn set_token_property_permissions(b: u32, ) -> Weight; + fn set_token_properties(b: u32, ) -> Weight; + fn delete_token_properties(b: u32, ) -> Weight; fn repartition_item() -> Weight; } @@ -62,7 +65,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) fn create_item() -> Weight { - (17_553_000 as Weight) + (21_310_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -73,9 +76,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TokenData (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (10_654_000 as Weight) - // Standard Error: 1_000 - .saturating_add((5_114_000 as Weight).saturating_mul(b as Weight)) + (9_552_000 as Weight) + // Standard Error: 2_000 + .saturating_add((7_056_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) @@ -87,9 +90,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TokenData (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_items(b: u32, ) -> Weight { - (3_587_000 as Weight) + (4_857_000 as Weight) // Standard Error: 2_000 - .saturating_add((7_931_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((9_838_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -102,9 +105,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible Balance (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight { - (1_980_000 as Weight) + (11_335_000 as Weight) // Standard Error: 2_000 - .saturating_add((6_305_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((6_784_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(3 as Weight)) @@ -115,7 +118,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn burn_item_partial() -> Weight { - (21_010_000 as Weight) + (21_239_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -125,14 +128,15 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TokensBurnt (r:1 w:1) // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) + // Storage: Refungible TokenProperties (r:0 w:1) fn burn_item_fully() -> Weight { - (28_413_000 as Weight) + (29_426_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(7 as Weight)) } // Storage: Refungible Balance (r:2 w:2) fn transfer_normal() -> Weight { - (17_513_000 as Weight) + (17_743_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -140,7 +144,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_creating() -> Weight { - (20_469_000 as Weight) + (20_699_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -148,7 +152,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_removing() -> Weight { - (22_472_000 as Weight) + (22_833_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -156,21 +160,21 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible AccountBalance (r:2 w:2) // Storage: Refungible Owned (r:0 w:2) fn transfer_creating_removing() -> Weight { - (24_866_000 as Weight) + (24_936_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Refungible Balance (r:1 w:0) // Storage: Refungible Allowance (r:0 w:1) fn approve() -> Weight { - (13_475_000 as Weight) + (13_446_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) fn transfer_from_normal() -> Weight { - (24_707_000 as Weight) + (24_777_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -179,7 +183,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_creating() -> Weight { - (27_812_000 as Weight) + (28_483_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -188,7 +192,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_removing() -> Weight { - (29_966_000 as Weight) + (29_896_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -197,7 +201,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible AccountBalance (r:2 w:2) // Storage: Refungible Owned (r:0 w:2) fn transfer_from_creating_removing() -> Weight { - (31_660_000 as Weight) + (32_070_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(7 as Weight)) } @@ -208,15 +212,42 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TokensBurnt (r:1 w:1) // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) + // Storage: Refungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (36_248_000 as Weight) + (36_789_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(8 as Weight)) + } + // Storage: Common CollectionPropertyPermissions (r:1 w:1) + fn set_token_property_permissions(b: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 62_000 + .saturating_add((15_803_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Common CollectionPropertyPermissions (r:1 w:0) + // Storage: Refungible TokenProperties (r:1 w:1) + fn set_token_properties(b: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 1_668_000 + .saturating_add((302_308_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Common CollectionPropertyPermissions (r:1 w:0) + // Storage: Refungible TokenProperties (r:1 w:1) + fn delete_token_properties(b: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 1_619_000 + .saturating_add((294_574_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Refungible TotalSupply (r:1 w:1) // Storage: Refungible Balance (r:1 w:1) fn repartition_item() -> Weight { - (8_226_000 as Weight) + (8_325_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -231,7 +262,7 @@ impl WeightInfo for () { // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) fn create_item() -> Weight { - (17_553_000 as Weight) + (21_310_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } @@ -242,9 +273,9 @@ impl WeightInfo for () { // Storage: Refungible TokenData (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (10_654_000 as Weight) - // Standard Error: 1_000 - .saturating_add((5_114_000 as Weight).saturating_mul(b as Weight)) + (9_552_000 as Weight) + // Standard Error: 2_000 + .saturating_add((7_056_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) @@ -256,9 +287,9 @@ impl WeightInfo for () { // Storage: Refungible TokenData (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_items(b: u32, ) -> Weight { - (3_587_000 as Weight) + (4_857_000 as Weight) // Standard Error: 2_000 - .saturating_add((7_931_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((9_838_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -271,9 +302,9 @@ impl WeightInfo for () { // Storage: Refungible Balance (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight { - (1_980_000 as Weight) + (11_335_000 as Weight) // Standard Error: 2_000 - .saturating_add((6_305_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((6_784_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) @@ -284,7 +315,7 @@ impl WeightInfo for () { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn burn_item_partial() -> Weight { - (21_010_000 as Weight) + (21_239_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -294,14 +325,15 @@ impl WeightInfo for () { // Storage: Refungible TokensBurnt (r:1 w:1) // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) + // Storage: Refungible TokenProperties (r:0 w:1) fn burn_item_fully() -> Weight { - (28_413_000 as Weight) + (29_426_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(6 as Weight)) + .saturating_add(RocksDbWeight::get().writes(7 as Weight)) } // Storage: Refungible Balance (r:2 w:2) fn transfer_normal() -> Weight { - (17_513_000 as Weight) + (17_743_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -309,7 +341,7 @@ impl WeightInfo for () { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_creating() -> Weight { - (20_469_000 as Weight) + (20_699_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -317,7 +349,7 @@ impl WeightInfo for () { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_removing() -> Weight { - (22_472_000 as Weight) + (22_833_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -325,21 +357,21 @@ impl WeightInfo for () { // Storage: Refungible AccountBalance (r:2 w:2) // Storage: Refungible Owned (r:0 w:2) fn transfer_creating_removing() -> Weight { - (24_866_000 as Weight) + (24_936_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Refungible Balance (r:1 w:0) // Storage: Refungible Allowance (r:0 w:1) fn approve() -> Weight { - (13_475_000 as Weight) + (13_446_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) fn transfer_from_normal() -> Weight { - (24_707_000 as Weight) + (24_777_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -348,7 +380,7 @@ impl WeightInfo for () { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_creating() -> Weight { - (27_812_000 as Weight) + (28_483_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -357,7 +389,7 @@ impl WeightInfo for () { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_removing() -> Weight { - (29_966_000 as Weight) + (29_896_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -366,7 +398,7 @@ impl WeightInfo for () { // Storage: Refungible AccountBalance (r:2 w:2) // Storage: Refungible Owned (r:0 w:2) fn transfer_from_creating_removing() -> Weight { - (31_660_000 as Weight) + (32_070_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(7 as Weight)) } @@ -377,15 +409,42 @@ impl WeightInfo for () { // Storage: Refungible TokensBurnt (r:1 w:1) // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) + // Storage: Refungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (36_248_000 as Weight) + (36_789_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(7 as Weight)) + .saturating_add(RocksDbWeight::get().writes(8 as Weight)) + } + // Storage: Common CollectionPropertyPermissions (r:1 w:1) + fn set_token_property_permissions(b: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 62_000 + .saturating_add((15_803_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Common CollectionPropertyPermissions (r:1 w:0) + // Storage: Refungible TokenProperties (r:1 w:1) + fn set_token_properties(b: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 1_668_000 + .saturating_add((302_308_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Common CollectionPropertyPermissions (r:1 w:0) + // Storage: Refungible TokenProperties (r:1 w:1) + fn delete_token_properties(b: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 1_619_000 + .saturating_add((294_574_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Refungible TotalSupply (r:1 w:1) // Storage: Refungible Balance (r:1 w:1) fn repartition_item() -> Weight { - (8_226_000 as Weight) + (8_325_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } From 45f4f7d0be2d13447e2eea874343aebfb2c80caf Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 20 Jul 2022 11:05:25 +0000 Subject: [PATCH 0069/1274] fmt --- pallets/refungible/src/benchmarking.rs | 5 ++++- pallets/refungible/src/common.rs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pallets/refungible/src/benchmarking.rs b/pallets/refungible/src/benchmarking.rs index 79e5fa249b..47e824aa27 100644 --- a/pallets/refungible/src/benchmarking.rs +++ b/pallets/refungible/src/benchmarking.rs @@ -20,7 +20,10 @@ use crate::{Pallet, Config, RefungibleHandle}; use sp_std::prelude::*; use pallet_common::benchmarking::{create_collection_raw, property_key, property_value, create_data}; use frame_benchmarking::{benchmarks, account}; -use up_data_structs::{CollectionMode, MAX_ITEMS_PER_BATCH, MAX_PROPERTIES_PER_ITEM, CUSTOM_DATA_LIMIT, budget::Unlimited}; +use up_data_structs::{ + CollectionMode, MAX_ITEMS_PER_BATCH, MAX_PROPERTIES_PER_ITEM, CUSTOM_DATA_LIMIT, + budget::Unlimited, +}; use pallet_common::bench_init; use core::convert::TryInto; use core::iter::IntoIterator; diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index 68b8f2952e..d0b0dc1906 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -22,7 +22,10 @@ use up_data_structs::{ CollectionId, TokenId, CreateItemExData, CreateRefungibleExData, budget::Budget, Property, PropertyKey, PropertyValue, PropertyKeyPermission, CreateItemData, }; -use pallet_common::{CommonCollectionOperations, CommonWeightInfo, RefungibleExtensions, with_weight, weights::WeightInfo as _}; +use pallet_common::{ + CommonCollectionOperations, CommonWeightInfo, RefungibleExtensions, with_weight, + weights::WeightInfo as _, +}; use pallet_structure::Error as StructureError; use sp_runtime::{DispatchError}; use sp_std::{vec::Vec, vec}; From e1dae1b1f78067f684a3d701d04d66ebd0e25146 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 20 Jul 2022 12:23:47 +0000 Subject: [PATCH 0070/1274] path: add weights for RFT CommonCollectionOperations --- pallets/refungible/src/common.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index d0b0dc1906..d0c2475b0c 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -20,7 +20,7 @@ use sp_std::collections::btree_map::BTreeMap; use frame_support::{dispatch::DispatchResultWithPostInfo, ensure, fail, weights::Weight, traits::Get}; use up_data_structs::{ CollectionId, TokenId, CreateItemExData, CreateRefungibleExData, budget::Budget, Property, - PropertyKey, PropertyValue, PropertyKeyPermission, CreateItemData, + PropertyKey, PropertyValue, PropertyKeyPermission, CreateItemData, CollectionPropertiesVec, }; use pallet_common::{ CommonCollectionOperations, CommonWeightInfo, RefungibleExtensions, with_weight, @@ -44,6 +44,14 @@ macro_rules! max_weight_of { }; } +fn properties_weight(properties: &CollectionPropertiesVec) -> u64 { + if properties.len() > 0 { + >::set_token_properties(properties.len() as u32) + } else { + 0 + } +} + pub struct CommonWeights(PhantomData); impl CommonWeightInfo for CommonWeights { fn create_item() -> Weight { @@ -52,15 +60,28 @@ impl CommonWeightInfo for CommonWeights { fn create_multiple_items(data: &[CreateItemData]) -> Weight { >::create_multiple_items(data.len() as u32) + + data + .iter() + .map(|data| match data { + CreateItemData::ReFungible(rft_data) => { + properties_weight::(&rft_data.properties) + } + _ => 0, + }) + .sum::() } fn create_multiple_items_ex(call: &CreateItemExData) -> Weight { match call { CreateItemExData::RefungibleMultipleOwners(i) => { >::create_multiple_items_ex_multiple_owners(i.users.len() as u32) + + properties_weight::(&i.properties) } CreateItemExData::RefungibleMultipleItems(i) => { >::create_multiple_items_ex_multiple_items(i.len() as u32) + + i.iter() + .map(|d| properties_weight::(&d.properties)) + .sum::() } _ => 0, } From 14bb047eacd375755c3af644b0ffa008618f2f57 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 20 Jul 2022 14:31:16 +0000 Subject: [PATCH 0071/1274] misk: change add -> saturating_add --- pallets/refungible/src/common.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index d0c2475b0c..00babc493a 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -59,29 +59,31 @@ impl CommonWeightInfo for CommonWeights { } fn create_multiple_items(data: &[CreateItemData]) -> Weight { - >::create_multiple_items(data.len() as u32) - + data - .iter() + >::create_multiple_items(data.len() as u32).saturating_add( + data.iter() .map(|data| match data { CreateItemData::ReFungible(rft_data) => { properties_weight::(&rft_data.properties) } _ => 0, }) - .sum::() + .fold(0, |a, b| a.saturating_add(b)), + ) } fn create_multiple_items_ex(call: &CreateItemExData) -> Weight { match call { CreateItemExData::RefungibleMultipleOwners(i) => { >::create_multiple_items_ex_multiple_owners(i.users.len() as u32) - + properties_weight::(&i.properties) + .saturating_add(properties_weight::(&i.properties)) } CreateItemExData::RefungibleMultipleItems(i) => { >::create_multiple_items_ex_multiple_items(i.len() as u32) - + i.iter() - .map(|d| properties_weight::(&d.properties)) - .sum::() + .saturating_add( + i.iter() + .map(|d| properties_weight::(&d.properties)) + .fold(0, |a, b| a.saturating_add(b)), + ) } _ => 0, } From 665fb9fa8027a1bcc38922ef4e636e76a16a4a37 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 21 Jul 2022 09:07:44 +0000 Subject: [PATCH 0072/1274] doc: add documentation for nonfungible palette --- pallets/nonfungible/src/common.rs | 2 + pallets/nonfungible/src/lib.rs | 204 +++++++++++++++++++++++++++++- 2 files changed, 203 insertions(+), 3 deletions(-) diff --git a/pallets/nonfungible/src/common.rs b/pallets/nonfungible/src/common.rs index 32b6cb76c4..acbe103813 100644 --- a/pallets/nonfungible/src/common.rs +++ b/pallets/nonfungible/src/common.rs @@ -133,6 +133,8 @@ fn map_create_data( } } +/// Implementation of `CommonCollectionOperations` for `NonfungibleHandle`. It wraps Nonfungible Pallete +/// methods and adds weight info. impl CommonCollectionOperations for NonfungibleHandle { fn create_item( &self, diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 76f647326c..2d59c4e95b 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -14,6 +14,81 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! # Nonfungible Pallet +//! +//! The Nonfungible pallet provides functionality for handling nonfungible collections and tokens. +//! +//! - [`Config`] +//! - [`NonfungibleHandle`] +//! - [`Pallet`] +//! - [`CommonWeights`] +//! +//! ## Overview +//! +//! The Nonfungible pallet provides functions for: +//! +//! - NFT collection creation and removal +//! - Minting and burning of NFT tokens +//! - Retrieving account balances +//! - Transfering NFT tokens +//! - Setting and checking allowance for NFT tokens +//! - Setting properties and permissions for NFT collections and tokens +//! - Nesting and unnesting tokens +//! +//! ### Terminology +//! +//! - **NFT token:** Non fungible token. +//! +//! - **NFT Collection:** A collection of NFT tokens. All NFT tokens are part of a collection. +//! Each collection can define it's own properties, properties for it's tokens and set of permissions. +//! +//! - **Balance:** Number of NFT tokens owned by an account +//! +//! - **Allowance:** NFT tokens owned by one account that another account is allowed to make operations on +//! +//! - **Burning:** The process of “deleting” a token from a collection and from +//! an account balance of the owner. +//! +//! - **Nesting:** Setting up parent-child relationship between tokens. Nested tokens are inhereting +//! owner from their parent. There could be multiple levels of nesting. Token couldn't be nested in +//! it's child token i.e. parent-child relationship graph shouldn't have cycles. +//! +//! - **Properties:** Key-Values pairs. Token properties are attached to a token. Collection properties are +//! attached to a collection. Set of permissions could be defined for each property. +//! +//! ### Implementations +//! +//! The Nonfungible pallet provides implementations for the following traits. If these traits provide +//! the functionality that you need, then you can avoid coupling with the Nonfungible pallet. +//! +//! - [`CommonWeightInfo`](pallet_common::CommonWeightInfo): Functions for retrieval of transaction weight +//! - [`CommonCollectionOperations`](pallet_common::CommonCollectionOperations): Functions for dealing +//! with collections +//! +//! ## Interface +//! +//! ### Dispatchable Functions +//! +//! - `init_collection` - Create NFT collection. NFT collection can be configured to allow or deny access for +//! some accounts. +//! - `destroy_collection` - Destroy exising NFT collection. There should be no tokens in the collection. +//! - `burn` - Burn NFT token owned by account. +//! - `transfer` - Transfer NFT token. Transfers should be enabled for NFT collection. +//! Nests the NFT token if it is sent to another token. +//! - `create_item` - Mint NFT token in collection. Sender should have permission to mint tokens. +//! - `set_allowance` - Set allowance for another account. +//! - `set_token_property` - Set token property value. +//! - `delete_token_property` - Remove property from the token. +//! - `set_collection_properties` - Set collection properties. +//! - `delete_collection_properties` - Remove properties from the collection. +//! - `set_property_permission` - Set collection property permission. +//! - `set_token_property_permissions` - Set token property permissions. +//! +//! ## Assumptions +//! +//! * Total number of tokens of all types shouldn't be greater than `up_data_structs::MAX_TOKEN_PREFIX_LENGTH`. +//! * Sender should be in collection's allow list to perform operations on tokens. + #![cfg_attr(not(feature = "std"), no_std)] use erc::ERC721Events; @@ -102,13 +177,17 @@ pub mod pallet { #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); + /// Amount of tokens minted for collection. #[pallet::storage] pub type TokensMinted = StorageMap; + + /// Amount of burnt tokens for collection. #[pallet::storage] pub type TokensBurnt = StorageMap; + /// Custom data serialized to bytes for token. #[pallet::storage] pub type TokenData = StorageNMap< Key = (Key, Key), @@ -116,6 +195,7 @@ pub mod pallet { QueryKind = OptionQuery, >; + /// Key-Value map stored for token. #[pallet::storage] #[pallet::getter(fn token_properties)] pub type TokenProperties = StorageNMap< @@ -125,6 +205,7 @@ pub mod pallet { OnEmpty = up_data_structs::TokenProperties, >; + /// Custom data that is serialized to bytes and attached to a token property. #[pallet::storage] #[pallet::getter(fn token_aux_property)] pub type TokenAuxProperties = StorageNMap< @@ -138,7 +219,7 @@ pub mod pallet { QueryKind = OptionQuery, >; - /// Used to enumerate tokens owned by account + /// Used to enumerate tokens owned by account. #[pallet::storage] pub type Owned = StorageNMap< Key = ( @@ -150,7 +231,7 @@ pub mod pallet { QueryKind = ValueQuery, >; - /// Used to enumerate token's children + /// Used to enumerate token's children. #[pallet::storage] #[pallet::getter(fn token_children)] pub type TokenChildren = StorageNMap< @@ -163,6 +244,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// Amount of tokens owned by account. #[pallet::storage] pub type AccountBalance = StorageNMap< Key = ( @@ -173,6 +255,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// Allowance set by an owner for a spender for a token. #[pallet::storage] pub type Allowance = StorageNMap< Key = (Key, Key), @@ -273,13 +356,21 @@ impl Deref for NonfungibleHandle { } impl Pallet { + /// Get number of NFT tokens in collection. pub fn total_supply(collection: &NonfungibleHandle) -> u32 { >::get(collection.id) - >::get(collection.id) } + + /// Check that NFT token exists. + /// + /// - `token`: Token ID. pub fn token_exists(collection: &NonfungibleHandle, token: TokenId) -> bool { >::contains_key((collection.id, token)) } + /// Set the token property with the scope. + /// + /// - `property`: Contains key-value pair. pub fn set_scoped_token_property( collection_id: CollectionId, token_id: TokenId, @@ -294,6 +385,7 @@ impl Pallet { Ok(()) } + /// Batch operation to set multiple properties with the same scope. pub fn set_scoped_token_properties( collection_id: CollectionId, token_id: TokenId, @@ -308,6 +400,9 @@ impl Pallet { Ok(()) } + /// Add or edit auxiliary data for the property. + /// + /// - `f`: function that adds or edits auxiliary data. pub fn try_mutate_token_aux_property( collection_id: CollectionId, token_id: TokenId, @@ -318,6 +413,7 @@ impl Pallet { >::try_mutate((collection_id, token_id, scope, key), f) } + /// Remove auxiliary data for the property. pub fn remove_token_aux_property( collection_id: CollectionId, token_id: TokenId, @@ -327,6 +423,9 @@ impl Pallet { >::remove((collection_id, token_id, scope, key)); } + /// Get all auxiliary data in a given scope. + /// + /// Returns iterator over Property Key - Data pairs. pub fn iterate_token_aux_properties( collection_id: CollectionId, token_id: TokenId, @@ -335,6 +434,7 @@ impl Pallet { >::iter_prefix((collection_id, token_id, scope)) } + /// Get ID of the last minted token pub fn current_token_id(collection_id: CollectionId) -> TokenId { TokenId(>::get(collection_id)) } @@ -342,6 +442,11 @@ impl Pallet { // unchecked calls skips any permission checks impl Pallet { + /// Create ТFT collection + /// + /// `init_collection` will take non-refundable deposit for collection creation. + /// + /// - `data`: Contains settings for collection limits and permissions. pub fn init_collection( owner: T::CrossAccountId, data: CreateCollectionData, @@ -349,6 +454,11 @@ impl Pallet { ) -> Result { >::init_collection(owner, data, is_external) } + + /// Destroy ТFT collection + /// + /// `destroy_collection` will throw error if collection contains any tokens. + /// Only owner can destroy collection. pub fn destroy_collection( collection: NonfungibleHandle, sender: &T::CrossAccountId, @@ -373,6 +483,15 @@ impl Pallet { Ok(()) } + /// Burn NFT token + /// + /// `burn` removes `token` from the `collection`, from it's owner and from the parent token + /// if the token is nested. + /// Only the owner can `burn` the token. The `token` shouldn't have any nested tokens. + /// Also removes all corresponding properties and auxiliary properties. + /// + /// - `token`: Token that should be burned + /// - `collection`: Collection that contains the token pub fn burn( collection: &NonfungibleHandle, sender: &T::CrossAccountId, @@ -442,6 +561,12 @@ impl Pallet { Ok(()) } + /// Same as [`burn`] but burns all the tokens that are nested in the token first + /// + /// - `self_budget`: Limit for searching children in depth. + /// - `breadth_budget`: Limit of breadth of searching children. + /// + /// [`burn`]: struct.Pallet.html#method.burn #[transactional] pub fn burn_recursively( collection: &NonfungibleHandle, @@ -481,6 +606,14 @@ impl Pallet { }) } + /// Batch operation to add, edit or remove properties for the token + /// + /// All affected properties should have mutable permission and sender should have + /// permission to edit those properties. + /// + /// - `nesting_budget`: Limit for searching parents in depth to check ownership. + /// - `is_token_create`: Indicates that method is called during token initialization. + /// Allows to bypass ownership check. #[transactional] fn modify_token_properties( collection: &NonfungibleHandle, @@ -574,6 +707,11 @@ impl Pallet { Ok(()) } + /// Batch operation to add or edit properties for the token + /// + /// Same as [`modify_token_properties`] but doesn't allow to remove properties + /// + /// [`modify_token_properties`]: struct.Pallet.html#method.modify_token_properties pub fn set_token_properties( collection: &NonfungibleHandle, sender: &T::CrossAccountId, @@ -592,6 +730,11 @@ impl Pallet { ) } + /// Add or edit single property for the token + /// + /// Calls [`set_token_properties`] internally + /// + /// [`set_token_properties`]: struct.Pallet.html#method.set_token_properties pub fn set_token_property( collection: &NonfungibleHandle, sender: &T::CrossAccountId, @@ -611,6 +754,11 @@ impl Pallet { ) } + /// Batch operation to remove properties from the token + /// + /// Same as [`modify_token_properties`] but doesn't allow to add or edit properties + /// + /// [`modify_token_properties`]: struct.Pallet.html#method.modify_token_properties pub fn delete_token_properties( collection: &NonfungibleHandle, sender: &T::CrossAccountId, @@ -630,6 +778,11 @@ impl Pallet { ) } + /// Remove single property from the token + /// + /// Calls [`delete_token_properties`] internally + /// + /// [`delete_token_properties`]: struct.Pallet.html#method.delete_token_properties pub fn delete_token_property( collection: &NonfungibleHandle, sender: &T::CrossAccountId, @@ -646,6 +799,7 @@ impl Pallet { ) } + /// Add or edit properties for the collection pub fn set_collection_properties( collection: &NonfungibleHandle, sender: &T::CrossAccountId, @@ -654,6 +808,7 @@ impl Pallet { >::set_collection_properties(collection, sender, properties) } + /// Remove properties from the collection pub fn delete_collection_properties( collection: &CollectionHandle, sender: &T::CrossAccountId, @@ -662,6 +817,9 @@ impl Pallet { >::delete_collection_properties(collection, sender, property_keys) } + /// Set property permissions for the token. + /// + /// Sender should be the owner or admin of token's collection. pub fn set_token_property_permissions( collection: &CollectionHandle, sender: &T::CrossAccountId, @@ -670,6 +828,9 @@ impl Pallet { >::set_token_property_permissions(collection, sender, property_permissions) } + /// Set property permissions for the collection. + /// + /// Sender should be the owner or admin of the collection. pub fn set_property_permission( collection: &CollectionHandle, sender: &T::CrossAccountId, @@ -678,6 +839,14 @@ impl Pallet { >::set_property_permission(collection, sender, permission) } + /// Transfer NFT token from one account to another. + /// + /// `from` account stops being the owner and `to` account becomes the owner of the token. + /// If `to` is token than `to` becomes owner of the token and the token become nested. + /// Unnests token from previous parent if it was nested before. + /// Removes allowance for the token if there was any. + /// + /// - `nesting_budget`: Limit for token nesting depth pub fn transfer( collection: &NonfungibleHandle, from: &T::CrossAccountId, @@ -769,6 +938,13 @@ impl Pallet { Ok(()) } + /// Batch operation to mint multiple NFT tokens. + /// + /// The sender should be the owner/admin of the collection or collection should be configured + /// to allow public minting. + /// + /// - `data`: Contains list of token properties and users who will become the owners of the corresponging tokens. + /// - `nesting_budget`: Limit for token nesting depth pub fn create_multiple_items( collection: &NonfungibleHandle, sender: &T::CrossAccountId, @@ -953,6 +1129,9 @@ impl Pallet { } } + /// Set allowance for the spender to `transfer` or `burn` sender's token. + /// + /// - `token`: Token the spender is allowed to `transfer` or `burn`. pub fn set_allowance( collection: &NonfungibleHandle, sender: &T::CrossAccountId, @@ -985,6 +1164,7 @@ impl Pallet { Ok(()) } + /// Checks allowance for the spender to use the token. fn check_allowed( collection: &NonfungibleHandle, spender: &T::CrossAccountId, @@ -1027,6 +1207,12 @@ impl Pallet { Ok(()) } + /// Transfer NFT token from one account to another. + /// + /// Same as the [`transfer`] but spender doesn't needs to be the owner of the token. + /// The owner should set allowance for the spender to transfer token. + /// + /// [`transfer`]: struct.Pallet.html#method.transfer pub fn transfer_from( collection: &NonfungibleHandle, spender: &T::CrossAccountId, @@ -1043,6 +1229,12 @@ impl Pallet { Self::transfer(collection, from, to, token, nesting_budget) } + /// Burn NFT token for `from` account. + /// + /// Same as the [`burn`] but spender doesn't need to be an owner of the token. The owner should + /// set allowance for the spender to burn token. + /// + /// [`burn`]: struct.Pallet.html#method.burn pub fn burn_from( collection: &NonfungibleHandle, spender: &T::CrossAccountId, @@ -1057,6 +1249,8 @@ impl Pallet { Self::burn(collection, from, token) } + /// Check that `from` token could be nested in `under` token. + /// pub fn check_nesting( handle: &NonfungibleHandle, sender: T::CrossAccountId, @@ -1126,7 +1320,11 @@ impl Pallet { .collect() } - /// Delegated to `create_multiple_items` + /// Mint single NFT token. + /// + /// Delegated to [`create_multiple_items`] + /// + /// [`create_multiple_items`]: struct.Pallet.html#method.create_multiple_items pub fn create_item( collection: &NonfungibleHandle, sender: &T::CrossAccountId, From 069b0ad95761a6abc781e7304745da6874629f9e Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 21 Jul 2022 09:07:44 +0000 Subject: [PATCH 0073/1274] doc: add documentstion for nonfungible EVM API --- pallets/nonfungible/src/erc.rs | 145 ++++++++++++++++++-- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 3975 -> 4116 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 138 +++++++++++++++++-- tests/src/eth/api/UniqueNFT.sol | 138 +++++++++++++++++-- 4 files changed, 382 insertions(+), 39 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 5b32660a63..19bd778e32 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -14,6 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! # Nonfungible Pallet EVM API +//! +//! Provides ERC-721 standart support implementation and EVM API for unique extensions for Nonfungible Pallet. +//! Method implementations are mostly doing parameter conversion and calling Nonfungible Pallet methods. + extern crate alloc; use core::{ char::{REPLACEMENT_CHARACTER, decode_utf16}, @@ -40,8 +45,16 @@ use crate::{ SelfWeightOf, weights::WeightInfo, TokenProperties, }; +/// @title A contract that allows to set and delete token properties and change token property permissions. +/// #[solidity_interface(name = "TokenProperties")] impl NonfungibleHandle { + /// @notice Set permissions for token property. + /// @dev Throws error if `msg.sender` is not admin or owner of the collection. + /// @param key Property key. + /// @param is_mutable Permission to mutate property. + /// @param collection_admin Permission to mutate property by collection admin if property is mutable. + /// @param token_owner Permission to mutate property by token owner if property is mutable. fn set_token_property_permission( &mut self, caller: caller, @@ -68,6 +81,11 @@ impl NonfungibleHandle { .map_err(dispatch_to_evm::) } + /// @notice Set token property value. + /// @dev Throws error if `msg.sender` has no permission to edit the property. + /// @param tokenId ID of the token. + /// @param key Property key. + /// @param value Property value. fn set_property( &mut self, caller: caller, @@ -96,6 +114,10 @@ impl NonfungibleHandle { .map_err(dispatch_to_evm::) } + /// @notice Delete token property value. + /// @dev Throws error if `msg.sender` has no permission to edit the property. + /// @param tokenId ID of the token. + /// @param key Property key. fn delete_property(&mut self, token_id: uint256, caller: caller, key: string) -> Result<()> { let caller = T::CrossAccountId::from_eth(caller); let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?; @@ -111,7 +133,10 @@ impl NonfungibleHandle { .map_err(dispatch_to_evm::) } - /// Throws error if key not found + /// @notice Get token property value. + /// @dev Throws error if key not found + /// @param tokenId ID of the token. + /// @param key Property key. fn property(&self, token_id: uint256, key: string) -> Result { let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?; let key = >::from(key) @@ -127,6 +152,11 @@ impl NonfungibleHandle { #[derive(ToLog)] pub enum ERC721Events { + /// @dev This emits when ownership of any NFT changes by any mechanism. + /// This event emits when NFTs are created (`from` == 0) and destroyed + /// (`to` == 0). Exception: during contract creation, any number of NFTs + /// may be created and assigned without emitting Transfer. At the time of + /// any transfer, the approved address for that NFT (if any) is reset to none. Transfer { #[indexed] from: address, @@ -135,6 +165,10 @@ pub enum ERC721Events { #[indexed] token_id: uint256, }, + /// @dev This emits when the approved address for an NFT is changed or + /// reaffirmed. The zero address indicates there is no approved address. + /// When a Transfer event emits, this also indicates that the approved + /// address for that NFT (if any) is reset to none. Approval { #[indexed] owner: address, @@ -143,6 +177,8 @@ pub enum ERC721Events { #[indexed] token_id: uint256, }, + /// @dev This emits when an operator is enabled or disabled for an owner. + /// The operator can manage all NFTs of the owner. #[allow(dead_code)] ApprovalForAll { #[indexed] @@ -159,19 +195,27 @@ pub enum ERC721MintableEvents { MintingFinished {}, } +/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension +/// @dev See https://eips.ethereum.org/EIPS/eip-721 #[solidity_interface(name = "ERC721Metadata")] impl NonfungibleHandle { + /// @notice A descriptive name for a collection of NFTs in this contract fn name(&self) -> Result { Ok(decode_utf16(self.name.iter().copied()) .map(|r| r.unwrap_or(REPLACEMENT_CHARACTER)) .collect::()) } + /// @notice An abbreviated name for NFTs in this contract fn symbol(&self) -> Result { Ok(string::from_utf8_lossy(&self.token_prefix).into()) } - /// Returns token's const_metadata + /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. + /// @dev Throws if `tokenId` is not a valid NFT. URIs are defined in RFC + /// 3986. The URI may point to a JSON file that conforms to the "ERC721 + /// Metadata JSON Schema". + /// @return token's const_metadata #[solidity(rename_selector = "tokenURI")] fn token_uri(&self, token_id: uint256) -> Result { let key = token_uri_key(); @@ -192,32 +236,53 @@ impl NonfungibleHandle { } } +/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension +/// @dev See https://eips.ethereum.org/EIPS/eip-721 #[solidity_interface(name = "ERC721Enumerable")] impl NonfungibleHandle { + /// @notice Enumerate valid NFTs + /// @param index A counter less than `totalSupply()` + /// @return The token identifier for the `index`th NFT, + /// (sort order not specified) fn token_by_index(&self, index: uint256) -> Result { Ok(index) } - /// Not implemented + /// @dev Not implemented fn token_of_owner_by_index(&self, _owner: address, _index: uint256) -> Result { // TODO: Not implemetable Err("not implemented".into()) } + /// @notice Count NFTs tracked by this contract + /// @return A count of valid NFTs tracked by this contract, where each one of + /// them has an assigned and queryable owner not equal to the zero address fn total_supply(&self) -> Result { self.consume_store_reads(1)?; Ok(>::total_supply(self).into()) } } +/// @title ERC-721 Non-Fungible Token Standard +/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md #[solidity_interface(name = "ERC721", events(ERC721Events))] impl NonfungibleHandle { + /// @notice Count all NFTs assigned to an owner + /// @dev NFTs assigned to the zero address are considered invalid, and this + /// function throws for queries about the zero address. + /// @param owner An address for whom to query the balance + /// @return The number of NFTs owned by `owner`, possibly zero fn balance_of(&self, owner: address) -> Result { self.consume_store_reads(1)?; let owner = T::CrossAccountId::from_eth(owner); let balance = >::get((self.id, owner)); Ok(balance.into()) } + /// @notice Find the owner of an NFT + /// @dev NFTs assigned to zero address are considered invalid, and queries + /// about them do throw. + /// @param tokenId The identifier for an NFT + /// @return The address of the owner of the NFT fn owner_of(&self, token_id: uint256) -> Result
{ self.consume_store_reads(1)?; let token: TokenId = token_id.try_into()?; @@ -226,7 +291,7 @@ impl NonfungibleHandle { .owner .as_eth()) } - /// Not implemented + /// @dev Not implemented fn safe_transfer_from_with_data( &mut self, _from: address, @@ -238,7 +303,7 @@ impl NonfungibleHandle { // TODO: Not implemetable Err("not implemented".into()) } - /// Not implemented + /// @dev Not implemented fn safe_transfer_from( &mut self, _from: address, @@ -250,6 +315,16 @@ impl NonfungibleHandle { Err("not implemented".into()) } + /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE + /// TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + /// THEY MAY BE PERMANENTLY LOST + /// @dev Throws unless `msg.sender` is the current owner or an authorized + /// operator for this NFT. Throws if `from` is not the current owner. Throws + /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT. + /// @param from The current owner of the NFT + /// @param to The new owner + /// @param tokenId The NFT to transfer + /// @param _value Not used for an NFT #[weight(>::transfer_from())] fn transfer_from( &mut self, @@ -272,6 +347,12 @@ impl NonfungibleHandle { Ok(()) } + /// @notice Set or reaffirm the approved address for an NFT + /// @dev The zero address indicates there is no approved address. + /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized + /// operator of the current owner. + /// @param approved The new approved NFT controller + /// @param tokenId The NFT to approve #[weight(>::approve())] fn approve( &mut self, @@ -289,7 +370,7 @@ impl NonfungibleHandle { Ok(()) } - /// Not implemented + /// @dev Not implemented fn set_approval_for_all( &mut self, _caller: caller, @@ -300,21 +381,26 @@ impl NonfungibleHandle { Err("not implemented".into()) } - /// Not implemented + /// @dev Not implemented fn get_approved(&self, _token_id: uint256) -> Result
{ // TODO: Not implemetable Err("not implemented".into()) } - /// Not implemented + /// @dev Not implemented fn is_approved_for_all(&self, _owner: address, _operator: address) -> Result
{ // TODO: Not implemetable Err("not implemented".into()) } } +/// @title ERC721 Token that can be irreversibly burned (destroyed). #[solidity_interface(name = "ERC721Burnable")] impl NonfungibleHandle { + /// @notice Burns a specific ERC721 token. + /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized + /// operator of the current owner. + /// @param tokenId The NFT to approve #[weight(>::burn_item())] fn burn(&mut self, caller: caller, token_id: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -325,14 +411,18 @@ impl NonfungibleHandle { } } +/// @title ERC721 minting logic. #[solidity_interface(name = "ERC721Mintable", events(ERC721MintableEvents))] impl NonfungibleHandle { fn minting_finished(&self) -> Result { Ok(false) } - /// `token_id` should be obtained with `next_token_id` method, - /// unlike standard, you can't specify it manually + /// @notice Function to mint token. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted NFT #[weight(>::create_item())] fn mint(&mut self, caller: caller, to: address, token_id: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -364,8 +454,12 @@ impl NonfungibleHandle { Ok(true) } - /// `token_id` should be obtained with `next_token_id` method, - /// unlike standard, you can't specify it manually + /// @notice Function to mint token with the given tokenUri. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted NFT + /// @param tokenUri Token URI that would be stored in the NFT properties #[solidity(rename_selector = "mintWithTokenURI")] #[weight(>::create_item())] fn mint_with_token_uri( @@ -420,7 +514,7 @@ impl NonfungibleHandle { Ok(true) } - /// Not implemented + /// @dev Not implemented fn finish_minting(&mut self, _caller: caller) -> Result { Err("not implementable".into()) } @@ -449,8 +543,15 @@ fn has_token_permission(collection_id: CollectionId, key: &PropertyKe false } +/// @title Unique extensions for ERC721. #[solidity_interface(name = "ERC721UniqueExtensions")] impl NonfungibleHandle { + /// @notice Transfer ownership of an NFT + /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` + /// is the zero address. Throws if `tokenId` is not a valid NFT. + /// @param to The new owner + /// @param tokenId The NFT to transfer + /// @param _value Not used for an NFT #[weight(>::transfer())] fn transfer( &mut self, @@ -470,6 +571,13 @@ impl NonfungibleHandle { Ok(()) } + /// @notice Burns a specific ERC721 token. + /// @dev Throws unless `msg.sender` is the current owner or an authorized + /// operator for this NFT. Throws if `from` is not the current owner. Throws + /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT. + /// @param from The current owner of the NFT + /// @param tokenId The NFT to transfer + /// @param _value Not used for an NFT #[weight(>::burn_from())] fn burn_from( &mut self, @@ -490,6 +598,7 @@ impl NonfungibleHandle { Ok(()) } + /// @notice Returns next free NFT ID. fn next_token_id(&self) -> Result { self.consume_store_reads(1)?; Ok(>::get(self.id) @@ -498,6 +607,11 @@ impl NonfungibleHandle { .into()) } + /// @notice Function to mint multiple tokens. + /// @dev `tokenIds` should be an array of consecutive numbers and first number + /// should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokenIds IDs of the minted NFTs #[weight(>::create_multiple_items(token_ids.len() as u32))] fn mint_bulk(&mut self, caller: caller, to: address, token_ids: Vec) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -529,6 +643,11 @@ impl NonfungibleHandle { Ok(true) } + /// @notice Function to mint multiple tokens with the given tokenUris. + /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + /// numbers and first number should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokens array of pairs of token ID and token URI for minted tokens #[solidity(rename_selector = "mintBulkWithTokenURI")] #[weight(>::create_multiple_items(tokens.len() as u32))] fn mint_bulk_with_token_uri( diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index b2b4ee8cf06e5d1783894b9cbdfbd9d774b4be52..6314e868ee653553fe67e7f00f6564166cbb7c99 100644 GIT binary patch delta 546 zcmYk2L1+^}6o&Va2K107fo3IaAZrn^Cp{F!Tg6L3l*y9a5$51a;!QzBFGWgrCc9}% z5hf&vc%exM@(fKs>@{o@_b^^Y}a{-@Y=R`4S z-LS@uQQwu^H||I%_Dw|>pbX^yuEosN&uwC4MWncCs#(xS1c8Qq?Q=6FE;cl=KdfYT z2U5f+%vD2Zu63?YrO_c1q2x7)g~(QzPEs4C_jyFh@oAv7b)bP;N#l z!EXy3e$3556|*ehb`>-UqUoX(>3~{_ojMnW)@#&Vrqp_8(h$BWd`|k0x;}JA%H(LY zCO3!FGT|hl30`(YHUTEx24-rOGkSV1H&SZljW?~wGZ(#en2jI=EZQR*Vw%qUWjrjs zdbvdVCGV~5lzt)g55i24)M{Mx3_TN2$3N#6s^6tlHHBG2IKD)I2^!UyD sZ|S{p`^LNNo!;K#!mJm+zWBU0H~n(=(S!TF>&~h2_)hu4U#@bnX8-^I delta 423 zcmX|6ze_?<6uyT-BCssbFe)DnVOxO^AwowOJew4W z6l0?vf`^9ofX-~n=4MO;X_|15i7#%Z7#KEJVv%kOP0FjyH8KkgWQN8FkhWbyNfDGG zO+HCOg%lVG(6r}>1UACiP)CWq{qk$%D3in_=+Wi~QVwVp6109gm{lRq= `totalSupply()`. + // @param index A counter less than `totalSupply()` + // @return The token identifier for the `index`th NFT, + // (sort order not specified) + // // Selector: tokenByIndex(uint256) 4f6ccce7 function tokenByIndex(uint256 index) public view returns (uint256) { require(false, stub_error); @@ -307,7 +384,7 @@ contract ERC721Enumerable is Dummy, ERC165 { return 0; } - // Not implemented + // @dev Not implemented // // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 function tokenOfOwnerByIndex(address owner, uint256 index) @@ -322,6 +399,10 @@ contract ERC721Enumerable is Dummy, ERC165 { return 0; } + // @notice Count NFTs tracked by this contract + // @return A count of valid NFTs tracked by this contract, where each one of + // them has an assigned and queryable owner not equal to the zero address + // // Selector: totalSupply() 18160ddd function totalSupply() public view returns (uint256) { require(false, stub_error); @@ -475,6 +556,15 @@ contract Collection is Dummy, ERC165 { // Selector: d74d154f contract ERC721UniqueExtensions is Dummy, ERC165 { + // @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE + // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + // THEY MAY BE PERMANENTLY LOST + // @dev Throws unless `msg.sender` is the current owner. Throws if `to` + // is the zero address. Throws if `tokenId` is not a valid NFT. + // @param to The new owner + // @param tokenId The NFT to transfer + // @param _value Not used for an NFT + // // Selector: transfer(address,uint256) a9059cbb function transfer(address to, uint256 tokenId) public { require(false, stub_error); @@ -483,6 +573,14 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { dummy = 0; } + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this NFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid NFT. + // @param from The current owner of the NFT + // @param tokenId The NFT to transfer + // @param _value Not used for an NFT + // // Selector: burnFrom(address,uint256) 79cc6790 function burnFrom(address from, uint256 tokenId) public { require(false, stub_error); @@ -491,6 +589,8 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { dummy = 0; } + // @notice Returns next free NFT ID. + // // Selector: nextTokenId() 75794a3c function nextTokenId() public view returns (uint256) { require(false, stub_error); @@ -498,6 +598,12 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { return 0; } + // @notice Function to mint multiple tokens. + // @dev `tokenIds` should be an array of consecutive numbers and first number + // should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokenIds IDs of the minted NFTs + // // Selector: mintBulk(address,uint256[]) 44a9945e function mintBulk(address to, uint256[] memory tokenIds) public @@ -510,6 +616,12 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { return false; } + // @notice Function to mint multiple tokens with the given tokenUris. + // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // numbers and first number should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokens array of pairs of token ID and token URI for minted tokens + // // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) public diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index 924eae2d5d..8a41aab39c 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -44,6 +44,13 @@ interface ERC721MintableEvents { // Selector: 41369377 interface TokenProperties is Dummy, ERC165 { + // @notice Set permissions for token property. + // @dev Throws error if `msg.sender` is not admin or owner of the collection. + // @param key Property key. + // @param is_mutable Permission to mutate property. + // @param collection_admin Permission to mutate property by collection admin if property is mutable. + // @param token_owner Permission to mutate property by token owner if property is mutable. + // // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa function setTokenPropertyPermission( string memory key, @@ -52,6 +59,12 @@ interface TokenProperties is Dummy, ERC165 { bool tokenOwner ) external; + // @notice Set token property value. + // @dev Throws error if `msg.sender` has no permission to edit the property. + // @param token_id ID of the token. + // @param key Property key. + // @param value Property value. + // // Selector: setProperty(uint256,string,bytes) 1752d67b function setProperty( uint256 tokenId, @@ -59,10 +72,18 @@ interface TokenProperties is Dummy, ERC165 { bytes memory value ) external; + // @notice Delete token property value. + // @dev Throws error if `msg.sender` has no permission to edit the property. + // @param token_id ID of the token. + // @param key Property key. + // // Selector: deleteProperty(uint256,string) 066111d1 function deleteProperty(uint256 tokenId, string memory key) external; - // Throws error if key not found + // @notice Get token property value. + // @dev Throws error if key not found + // @param token_id ID of the token. + // @param key Property key. // // Selector: property(uint256,string) 7228c327 function property(uint256 tokenId, string memory key) @@ -73,19 +94,36 @@ interface TokenProperties is Dummy, ERC165 { // Selector: 42966c68 interface ERC721Burnable is Dummy, ERC165 { + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized + // operator of the current owner. + // @param tokenId The NFT to approve + // // Selector: burn(uint256) 42966c68 function burn(uint256 tokenId) external; } // Selector: 58800161 interface ERC721 is Dummy, ERC165, ERC721Events { + // @notice Count all NFTs assigned to an owner + // @dev NFTs assigned to the zero address are considered invalid, and this + // function throws for queries about the zero address. + // @param _owner An address for whom to query the balance + // @return The number of NFTs owned by `_owner`, possibly zero + // // Selector: balanceOf(address) 70a08231 function balanceOf(address owner) external view returns (uint256); + // @notice Find the owner of an NFT + // @dev NFTs assigned to zero address are considered invalid, and queries + // about them do throw. + // @param _tokenId The identifier for an NFT + // @return The address of the owner of the NFT + // // Selector: ownerOf(uint256) 6352211e function ownerOf(uint256 tokenId) external view returns (address); - // Not implemented + // @dev Not implemented // // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672 function safeTransferFromWithData( @@ -95,7 +133,7 @@ interface ERC721 is Dummy, ERC165, ERC721Events { bytes memory data ) external; - // Not implemented + // @dev Not implemented // // Selector: safeTransferFrom(address,address,uint256) 42842e0e function safeTransferFrom( @@ -104,6 +142,17 @@ interface ERC721 is Dummy, ERC165, ERC721Events { uint256 tokenId ) external; + // @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE + // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + // THEY MAY BE PERMANENTLY LOST + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this NFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid NFT. + // @param from The current owner of the NFT + // @param to The new owner + // @param tokenId The NFT to transfer + // @param _value Not used for an NFT + // // Selector: transferFrom(address,address,uint256) 23b872dd function transferFrom( address from, @@ -111,20 +160,27 @@ interface ERC721 is Dummy, ERC165, ERC721Events { uint256 tokenId ) external; + // @notice Set or reaffirm the approved address for an NFT + // @dev The zero address indicates there is no approved address. + // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized + // operator of the current owner. + // @param approved The new approved NFT controller + // @param tokenId The NFT to approve + // // Selector: approve(address,uint256) 095ea7b3 function approve(address approved, uint256 tokenId) external; - // Not implemented + // @dev Not implemented // // Selector: setApprovalForAll(address,bool) a22cb465 function setApprovalForAll(address operator, bool approved) external; - // Not implemented + // @dev Not implemented // // Selector: getApproved(uint256) 081812fc function getApproved(uint256 tokenId) external view returns (address); - // Not implemented + // @dev Not implemented // // Selector: isApprovedForAll(address,address) e985e9c5 function isApprovedForAll(address owner, address operator) @@ -135,13 +191,21 @@ interface ERC721 is Dummy, ERC165, ERC721Events { // Selector: 5b5e139f interface ERC721Metadata is Dummy, ERC165 { + // @notice A descriptive name for a collection of NFTs in this contract + // // Selector: name() 06fdde03 function name() external view returns (string memory); + // @notice An abbreviated name for NFTs in this contract + // // Selector: symbol() 95d89b41 function symbol() external view returns (string memory); - // Returns token's const_metadata + // @notice A distinct Uniform Resource Identifier (URI) for a given asset. + // @dev Throws if `tokenId` is not a valid NFT. URIs are defined in RFC + // 3986. The URI may point to a JSON file that conforms to the "ERC721 + // Metadata JSON Schema". + // @return token's const_metadata // // Selector: tokenURI(uint256) c87b56dd function tokenURI(uint256 tokenId) external view returns (string memory); @@ -152,14 +216,21 @@ interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { // Selector: mintingFinished() 05d2035b function mintingFinished() external view returns (bool); - // `token_id` should be obtained with `next_token_id` method, - // unlike standard, you can't specify it manually + // @notice Function to mint token. + // @dev `tokenId` should be obtained with `nextTokenId` method, + // unlike standard, you can't specify it manually + // @param to The new owner + // @param tokenId ID of the minted NFT // // Selector: mint(address,uint256) 40c10f19 function mint(address to, uint256 tokenId) external returns (bool); - // `token_id` should be obtained with `next_token_id` method, - // unlike standard, you can't specify it manually + // @notice Function to mint token with the given tokenUri. + // @dev `tokenId` should be obtained with `nextTokenId` method, + // unlike standard, you can't specify it manually + // @param to The new owner + // @param tokenId ID of the minted NFT + // @param tokenUri Token URI that would be stored in the NFT properties // // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f function mintWithTokenURI( @@ -168,7 +239,7 @@ interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { string memory tokenUri ) external returns (bool); - // Not implemented + // @dev Not implemented // // Selector: finishMinting() 7d64bcb4 function finishMinting() external returns (bool); @@ -176,10 +247,16 @@ interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { // Selector: 780e9d63 interface ERC721Enumerable is Dummy, ERC165 { + // @notice Enumerate valid NFTs + // @dev Throws if `index` >= `totalSupply()`. + // @param index A counter less than `totalSupply()` + // @return The token identifier for the `index`th NFT, + // (sort order not specified) + // // Selector: tokenByIndex(uint256) 4f6ccce7 function tokenByIndex(uint256 index) external view returns (uint256); - // Not implemented + // @dev Not implemented // // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 function tokenOfOwnerByIndex(address owner, uint256 index) @@ -187,6 +264,10 @@ interface ERC721Enumerable is Dummy, ERC165 { view returns (uint256); + // @notice Count NFTs tracked by this contract + // @return A count of valid NFTs tracked by this contract, where each one of + // them has an assigned and queryable owner not equal to the zero address + // // Selector: totalSupply() 18160ddd function totalSupply() external view returns (uint256); } @@ -257,20 +338,51 @@ interface Collection is Dummy, ERC165 { // Selector: d74d154f interface ERC721UniqueExtensions is Dummy, ERC165 { + // @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE + // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + // THEY MAY BE PERMANENTLY LOST + // @dev Throws unless `msg.sender` is the current owner. Throws if `to` + // is the zero address. Throws if `tokenId` is not a valid NFT. + // @param to The new owner + // @param tokenId The NFT to transfer + // @param _value Not used for an NFT + // // Selector: transfer(address,uint256) a9059cbb function transfer(address to, uint256 tokenId) external; + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this NFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid NFT. + // @param from The current owner of the NFT + // @param tokenId The NFT to transfer + // @param _value Not used for an NFT + // // Selector: burnFrom(address,uint256) 79cc6790 function burnFrom(address from, uint256 tokenId) external; + // @notice Returns next free NFT ID. + // // Selector: nextTokenId() 75794a3c function nextTokenId() external view returns (uint256); + // @notice Function to mint multiple tokens. + // @dev `tokenIds` should be an array of consecutive numbers and first number + // should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokenIds IDs of the minted NFTs + // // Selector: mintBulk(address,uint256[]) 44a9945e function mintBulk(address to, uint256[] memory tokenIds) external returns (bool); + // @notice Function to mint multiple tokens with the given tokenUris. + // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // numbers and first number should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokens array of pairs of token ID and token URI for minted tokens + // // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) external From ce4a2a5245a84cbe26118da1faf83297a2e73545 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 21 Jul 2022 09:07:44 +0000 Subject: [PATCH 0074/1274] chore: fix formatting --- pallets/nonfungible/src/erc.rs | 20 ++++++++-------- pallets/nonfungible/src/lib.rs | 44 +++++++++++++++++----------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 19bd778e32..f6f405f5df 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . //! # Nonfungible Pallet EVM API -//! +//! //! Provides ERC-721 standart support implementation and EVM API for unique extensions for Nonfungible Pallet. //! Method implementations are mostly doing parameter conversion and calling Nonfungible Pallet methods. @@ -46,7 +46,7 @@ use crate::{ }; /// @title A contract that allows to set and delete token properties and change token property permissions. -/// +/// #[solidity_interface(name = "TokenProperties")] impl NonfungibleHandle { /// @notice Set permissions for token property. @@ -212,9 +212,9 @@ impl NonfungibleHandle { } /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. - /// @dev Throws if `tokenId` is not a valid NFT. URIs are defined in RFC - /// 3986. The URI may point to a JSON file that conforms to the "ERC721 - /// Metadata JSON Schema". + /// @dev Throws if `tokenId` is not a valid NFT. URIs are defined in RFC + /// 3986. The URI may point to a JSON file that conforms to the "ERC721 + /// Metadata JSON Schema". /// @return token's const_metadata #[solidity(rename_selector = "tokenURI")] fn token_uri(&self, token_id: uint256) -> Result { @@ -241,9 +241,9 @@ impl NonfungibleHandle { #[solidity_interface(name = "ERC721Enumerable")] impl NonfungibleHandle { /// @notice Enumerate valid NFTs - /// @param index A counter less than `totalSupply()` - /// @return The token identifier for the `index`th NFT, - /// (sort order not specified) + /// @param index A counter less than `totalSupply()` + /// @return The token identifier for the `index`th NFT, + /// (sort order not specified) fn token_by_index(&self, index: uint256) -> Result { Ok(index) } @@ -255,8 +255,8 @@ impl NonfungibleHandle { } /// @notice Count NFTs tracked by this contract - /// @return A count of valid NFTs tracked by this contract, where each one of - /// them has an assigned and queryable owner not equal to the zero address + /// @return A count of valid NFTs tracked by this contract, where each one of + /// them has an assigned and queryable owner not equal to the zero address fn total_supply(&self) -> Result { self.consume_store_reads(1)?; Ok(>::total_supply(self).into()) diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 2d59c4e95b..ef49922c6e 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -48,11 +48,11 @@ //! //! - **Burning:** The process of “deleting” a token from a collection and from //! an account balance of the owner. -//! +//! //! - **Nesting:** Setting up parent-child relationship between tokens. Nested tokens are inhereting //! owner from their parent. There could be multiple levels of nesting. Token couldn't be nested in //! it's child token i.e. parent-child relationship graph shouldn't have cycles. -//! +//! //! - **Properties:** Key-Values pairs. Token properties are attached to a token. Collection properties are //! attached to a collection. Set of permissions could be defined for each property. //! @@ -83,7 +83,7 @@ //! - `delete_collection_properties` - Remove properties from the collection. //! - `set_property_permission` - Set collection property permission. //! - `set_token_property_permissions` - Set token property permissions. -//! +//! //! ## Assumptions //! //! * Total number of tokens of all types shouldn't be greater than `up_data_structs::MAX_TOKEN_PREFIX_LENGTH`. @@ -369,7 +369,7 @@ impl Pallet { } /// Set the token property with the scope. - /// + /// /// - `property`: Contains key-value pair. pub fn set_scoped_token_property( collection_id: CollectionId, @@ -401,7 +401,7 @@ impl Pallet { } /// Add or edit auxiliary data for the property. - /// + /// /// - `f`: function that adds or edits auxiliary data. pub fn try_mutate_token_aux_property( collection_id: CollectionId, @@ -424,7 +424,7 @@ impl Pallet { } /// Get all auxiliary data in a given scope. - /// + /// /// Returns iterator over Property Key - Data pairs. pub fn iterate_token_aux_properties( collection_id: CollectionId, @@ -565,7 +565,7 @@ impl Pallet { /// /// - `self_budget`: Limit for searching children in depth. /// - `breadth_budget`: Limit of breadth of searching children. - /// + /// /// [`burn`]: struct.Pallet.html#method.burn #[transactional] pub fn burn_recursively( @@ -607,10 +607,10 @@ impl Pallet { } /// Batch operation to add, edit or remove properties for the token - /// + /// /// All affected properties should have mutable permission and sender should have - /// permission to edit those properties. - /// + /// permission to edit those properties. + /// /// - `nesting_budget`: Limit for searching parents in depth to check ownership. /// - `is_token_create`: Indicates that method is called during token initialization. /// Allows to bypass ownership check. @@ -708,9 +708,9 @@ impl Pallet { } /// Batch operation to add or edit properties for the token - /// + /// /// Same as [`modify_token_properties`] but doesn't allow to remove properties - /// + /// /// [`modify_token_properties`]: struct.Pallet.html#method.modify_token_properties pub fn set_token_properties( collection: &NonfungibleHandle, @@ -731,9 +731,9 @@ impl Pallet { } /// Add or edit single property for the token - /// + /// /// Calls [`set_token_properties`] internally - /// + /// /// [`set_token_properties`]: struct.Pallet.html#method.set_token_properties pub fn set_token_property( collection: &NonfungibleHandle, @@ -755,9 +755,9 @@ impl Pallet { } /// Batch operation to remove properties from the token - /// + /// /// Same as [`modify_token_properties`] but doesn't allow to add or edit properties - /// + /// /// [`modify_token_properties`]: struct.Pallet.html#method.modify_token_properties pub fn delete_token_properties( collection: &NonfungibleHandle, @@ -779,9 +779,9 @@ impl Pallet { } /// Remove single property from the token - /// + /// /// Calls [`delete_token_properties`] internally - /// + /// /// [`delete_token_properties`]: struct.Pallet.html#method.delete_token_properties pub fn delete_token_property( collection: &NonfungibleHandle, @@ -818,7 +818,7 @@ impl Pallet { } /// Set property permissions for the token. - /// + /// /// Sender should be the owner or admin of token's collection. pub fn set_token_property_permissions( collection: &CollectionHandle, @@ -829,7 +829,7 @@ impl Pallet { } /// Set property permissions for the collection. - /// + /// /// Sender should be the owner or admin of the collection. pub fn set_property_permission( collection: &CollectionHandle, @@ -1250,7 +1250,7 @@ impl Pallet { } /// Check that `from` token could be nested in `under` token. - /// + /// pub fn check_nesting( handle: &NonfungibleHandle, sender: T::CrossAccountId, @@ -1321,7 +1321,7 @@ impl Pallet { } /// Mint single NFT token. - /// + /// /// Delegated to [`create_multiple_items`] /// /// [`create_multiple_items`]: struct.Pallet.html#method.create_multiple_items From d1f105e686c1f9b45b8dbbc05d91ad58d4be3475 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 21 Jul 2022 09:07:44 +0000 Subject: [PATCH 0075/1274] doc: add requested code review changes --- pallets/nonfungible/src/erc.rs | 1 + pallets/nonfungible/src/lib.rs | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index f6f405f5df..5c59d20bb1 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -137,6 +137,7 @@ impl NonfungibleHandle { /// @dev Throws error if key not found /// @param tokenId ID of the token. /// @param key Property key. + /// @return Property value bytes fn property(&self, token_id: uint256, key: string) -> Result { let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?; let key = >::from(key) diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index ef49922c6e..c5fa382e1c 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -86,7 +86,6 @@ //! //! ## Assumptions //! -//! * Total number of tokens of all types shouldn't be greater than `up_data_structs::MAX_TOKEN_PREFIX_LENGTH`. //! * Sender should be in collection's allow list to perform operations on tokens. #![cfg_attr(not(feature = "std"), no_std)] @@ -845,6 +844,7 @@ impl Pallet { /// If `to` is token than `to` becomes owner of the token and the token become nested. /// Unnests token from previous parent if it was nested before. /// Removes allowance for the token if there was any. + /// Throws if transfers aren't allowed for collection or if receiver reached token ownership limit. /// /// - `nesting_budget`: Limit for token nesting depth pub fn transfer( @@ -942,8 +942,11 @@ impl Pallet { /// /// The sender should be the owner/admin of the collection or collection should be configured /// to allow public minting. + /// Throws if amount of tokens reached it's limit for the collection or if caller reached + /// token ownership limit. /// - /// - `data`: Contains list of token properties and users who will become the owners of the corresponging tokens. + /// - `data`: Contains list of token properties and users who will become the owners of the + /// corresponging tokens. /// - `nesting_budget`: Limit for token nesting depth pub fn create_multiple_items( collection: &NonfungibleHandle, From 450376671e24e61b1f5b54b63c112b6ca1e20ab1 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 21 Jul 2022 09:07:44 +0000 Subject: [PATCH 0076/1274] doc: fix documentation about allowlist --- pallets/nonfungible/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index c5fa382e1c..b25803fce4 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -86,7 +86,7 @@ //! //! ## Assumptions //! -//! * Sender should be in collection's allow list to perform operations on tokens. +//! * To perform operations on tokens sender should be in collection's allow list if collection access mode is `AllowList`. #![cfg_attr(not(feature = "std"), no_std)] @@ -441,7 +441,7 @@ impl Pallet { // unchecked calls skips any permission checks impl Pallet { - /// Create ТFT collection + /// Create NFT collection /// /// `init_collection` will take non-refundable deposit for collection creation. /// @@ -454,7 +454,7 @@ impl Pallet { >::init_collection(owner, data, is_external) } - /// Destroy ТFT collection + /// Destroy NFT collection /// /// `destroy_collection` will throw error if collection contains any tokens. /// Only owner can destroy collection. From 395c681b83e78544199c9ca9d8752116f505864e Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 21 Jul 2022 10:04:34 +0000 Subject: [PATCH 0077/1274] doc: added comments about `TokenAuxProperties` --- pallets/nonfungible/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index b25803fce4..397067f14b 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -205,6 +205,7 @@ pub mod pallet { >; /// Custom data that is serialized to bytes and attached to a token property. + /// Currently used to store RMRK data. #[pallet::storage] #[pallet::getter(fn token_aux_property)] pub type TokenAuxProperties = StorageNMap< From 4bd95ca733210ce64efdd452308494fcb6c380ee Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 21 Jul 2022 10:16:23 +0000 Subject: [PATCH 0078/1274] doc: fix code review request --- pallets/nonfungible/src/erc.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 5c59d20bb1..97196e3831 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -46,7 +46,6 @@ use crate::{ }; /// @title A contract that allows to set and delete token properties and change token property permissions. -/// #[solidity_interface(name = "TokenProperties")] impl NonfungibleHandle { /// @notice Set permissions for token property. From ef7fcb6760de9c5e939bebb19020293aa510998a Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 20 Jul 2022 18:56:37 +0700 Subject: [PATCH 0079/1274] fix(pallet-common): invalid erc function modifiers Some methods in `#[solidity_interface]` for `CollectionHandle` had invalid mutability modifiers, causing invalid stub/abi generation --- Cargo.lock | 2 +- pallets/common/CHANGELOG.MD | 10 + pallets/common/Cargo.toml | 2 +- pallets/common/src/erc.rs | 20 +- .../src/stubs/ContractHelpers.raw | Bin 1422 -> 1559 bytes pallets/fungible/src/stubs/UniqueFungible.raw | Bin 2104 -> 2777 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 297 +++++++++++++----- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4116 -> 4116 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 130 ++++++-- .../src/eth/stubs/CollectionHelpers.raw | Bin 1131 -> 1268 bytes tests/src/eth/api/UniqueFungible.sol | 181 +++++++++-- tests/src/eth/api/UniqueNFT.sol | 116 ++++++- tests/src/eth/fungibleAbi.json | 117 ++++++- tests/src/eth/nonFungibleAbi.json | 14 +- tests/src/interfaces/augment-api-errors.ts | 9 +- tests/src/interfaces/augment-api-query.ts | 27 ++ 16 files changed, 748 insertions(+), 177 deletions(-) create mode 100644 pallets/common/CHANGELOG.MD diff --git a/Cargo.lock b/Cargo.lock index b62628298b..1d022ee0c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5731,7 +5731,7 @@ dependencies = [ [[package]] name = "pallet-common" -version = "0.1.0" +version = "0.1.2" dependencies = [ "ethereum", "evm-coder", diff --git a/pallets/common/CHANGELOG.MD b/pallets/common/CHANGELOG.MD new file mode 100644 index 0000000000..ba2f8f1162 --- /dev/null +++ b/pallets/common/CHANGELOG.MD @@ -0,0 +1,10 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +## [0.1.2] - 2022-07-20 + +### Fixed + +- Some methods in `#[solidity_interface]` for `CollectionHandle` had invalid + mutability modifiers, causing invalid stub/abi generation. diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index 28f0e5774a..b5ece3fb34 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-common" -version = "0.1.0" +version = "0.1.2" license = "GPLv3" edition = "2021" diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 4e6e279b06..6d5e7fbcef 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -225,7 +225,11 @@ where /// Add collection admin by substrate address. /// @param new_admin Substrate administrator address. - fn add_collection_admin_substrate(&self, caller: caller, new_admin: uint256) -> Result { + fn add_collection_admin_substrate( + &mut self, + caller: caller, + new_admin: uint256, + ) -> Result { let caller = T::CrossAccountId::from_eth(caller); let mut new_admin_arr: [u8; 32] = Default::default(); new_admin.to_big_endian(&mut new_admin_arr); @@ -237,7 +241,11 @@ where /// Remove collection admin by substrate address. /// @param admin Substrate administrator address. - fn remove_collection_admin_substrate(&self, caller: caller, admin: uint256) -> Result { + fn remove_collection_admin_substrate( + &mut self, + caller: caller, + admin: uint256, + ) -> Result { let caller = T::CrossAccountId::from_eth(caller); let mut admin_arr: [u8; 32] = Default::default(); admin.to_big_endian(&mut admin_arr); @@ -249,7 +257,7 @@ where /// Add collection admin. /// @param new_admin Address of the added administrator. - fn add_collection_admin(&self, caller: caller, new_admin: address) -> Result { + fn add_collection_admin(&mut self, caller: caller, new_admin: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let new_admin = T::CrossAccountId::from_eth(new_admin); >::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::)?; @@ -259,7 +267,7 @@ where /// Remove collection admin. /// /// @param new_admin Address of the removed administrator. - fn remove_collection_admin(&self, caller: caller, admin: address) -> Result { + fn remove_collection_admin(&mut self, caller: caller, admin: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let admin = T::CrossAccountId::from_eth(admin); >::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::)?; @@ -365,7 +373,7 @@ where /// Add the user to the allowed list. /// /// @param user Address of a trusted user. - fn add_to_collection_allow_list(&self, caller: caller, user: address) -> Result { + fn add_to_collection_allow_list(&mut self, caller: caller, user: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let user = T::CrossAccountId::from_eth(user); >::toggle_allowlist(self, &caller, &user, true).map_err(dispatch_to_evm::)?; @@ -375,7 +383,7 @@ where /// Remove the user from the allowed list. /// /// @param user Address of a removed user. - fn remove_from_collection_allow_list(&self, caller: caller, user: address) -> Result { + fn remove_from_collection_allow_list(&mut self, caller: caller, user: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let user = T::CrossAccountId::from_eth(user); >::toggle_allowlist(self, &caller, &user, false).map_err(dispatch_to_evm::)?; diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw index 285ebeb3a6b1c0ed81c20491eac235423e3281c5..74c566d94e921ca663bf24d7ab7bdfe21622e8fc 100644 GIT binary patch delta 510 zcmXw#y=xRv6vgj#c2WGm4P+-Qv$7+IM6l8{NfB1kq>{HoW?u0`?lrPl2vIB*GVf(( z5*5N*60`|ukw&mm>@5|v$R8jCOA9fTL5cB>A3SbzF6W%zed{Nlo*dFH^%FWzxwVPs z<{mwtCiDzF?-+J6qo(pU!$nPy9~i~xGqZSg{{CIsjR+FDLXCvZ5gZsoYrEcsIm0zg z%Pt%#L$PbwfZ@UD+nHtRxiN|QAW_mqv5l!$A~m}fDXv;|Gv>79< z$`u?Kf(`|hkGh?Zu=LSHnM$j;p!^Toslt(QH4fg;YZVS$x>?|+eANhjfsAv4R=Rqh z>(vqme=^s6MEjw{+SE)4wNhfR5&BdP;6{=&K6^cmAA|m9&5cvicqm0KDcWsnMh>5- zzbZVgIebiDs+ys3RNIBZVd6{l50Qhf8{OvF3zO^bw~zn)&esq3j(mD`XLfdJ>c{Zy b%=Ffyt({vhTiZA9E!|$6gJY*RhRw;}IkBgC delta 383 zcmW-c&nrYx6vyu|Gg2su$3)E|iG_uj#q4NOHuUB-@4dy{oD)S-@?&Q)_g;pSxOXN$ zmNv4QmDMEv0~^g&#)48xHWo_Uu{oX2_jAtod(PU9S_@dmDIbSXNa<@zEaOE+#^dO!4jCh8juz%;x7V@W*N8mmVBE(cWcDee zy^vFUP7w56pTm93d5kFDV$c01_Z;Q#D>(J+pezzyolTLZA*n{A^~DU42cLDf zo1v#@O^V(^b;C%xZ2WGzWiBNylPX=4NnfTlTsyG%&YE&wxa@LJi zlt(FX+}I?i0ZJhxIe9zFv(cPpa%)JVx;{&iW<#${dJ)1Lac#oLd|2j~d|g+&9Fi1! zu6JYfN)+1~4cul$0pExbw*ls}aiuyVuTyC*l`dVSI?^LjQ0%9G24)pAas;CUJyoG+ zTI|QpmM{`f^-TBa#!pI^v=#7Z)nFUo3LloTq5;6;jlbPf%H;8Ym-n3912`G*&%rhK zfw0R{;B6zudS>JIuhs$;oXpJvejlix(X^ zQCMir>j_Wcda8XV$E>X#CAW_=;bxGBBh1&h$HT&r2%m}6sYZ2@obfj%Y>D2mDx~Wl7g!(Q7Q~2_2ci`FX=jyw}Gh^gCOgP{!o_-ZYaBm`v_V zYdzhfH9=vXanfTL31}f`rgFIv!tA?w}&Kpd{=a6rFK?ucjme8+Jf7yu)s$&?!Zh)<`i0ElZ2~u z^WXnoAT>$c1j2fQv<&&5QDU0Klge0dqKZEYe8cmX^5b1#S%^b00Y*YFSg?*(+F~mN zfdww4HCHi>lx10jGjT!jgJ_yOAhUV&YzxsVWXZ&xKqj!D?Yku(u&jh|Cm4hN;UES5 zxS5H9DLTK*g75p1!OyZt3=4Lk1{A(SBBywaQyxRHV5UKwi7fcLFB2k;32nGNxHe=E zK@<06p?X3n2XP-K#uQ#?mbZYi8X8kig~W!Q$m_{iqBxPBxQ_gcb|K{F-^k*^&3XX| zZOm^kDlgQpvQWQ>xK4wyoWeqT5l9hl+~heF8_C%QaW~kAN$4w2xW^$qn&se13=Kg3 zoFi()O!0Zw!P_JB9qO}>UyJzu<$Ji?H=my^UR@*75l(n(BhtZ7NO*xS5?@b)I+iWX%$FiJNHaU1Y3+z- imbG`TWSP!5aBJK0rOj>4?VZg{@z(ZuJL_y+)%*|s0oJYn literal 2104 zcmaJ?ZEO@p7~Z+vJ2A0ITYHE7(5{FiCMHPW&?=E4!T5{po$VfE6EefKlqR&aw2~A; zoY}p-)A*yicLkMd(r7~Q0~3)%i9u0O;}<0SGB#i};5WtuzY;C=ncchNDhYSF%QN#n z@Ao@1be49e=`zZNNPBEiBc1BtDW)v*De(~&lH~FDLUVra5!095pY5Yal38U zKa%lnV%ef0z;?>+MhwLFK!Bej!eGkrqL2R*z@BMY+?L$q@FTjxV#+(FMTrn?o}J)K z`7T2rw-df$QQfW=DkHH>cH<*^hv{sqjCcvv(sU_Rkdp5irp01^aYi8OpvvVdl%q63 z-u30YskXYFk=wCK(%Cki9s9h`Ymi~{>`T$--Ub{l!zM}+TxF2xEnu~paF9U9$x#v^BQ-DKL_6oqW6*FZ1lWDA% zK@^)iuL4SEH*T4J15hS)OQKF1AI@08G%(V^$g0&;W0BWU!pNiOKxfK}#|1`$NX&iJ zyKFIHvdCB!;HKr-DyKuMGlyjg3Y59MLO^K ziCX0<{fE#&7;AKWt*L0>yuz%=r0pQ;M(Hl#$OL4RWh0XdjGV?Q@<25Z%r%{ARTqRq z6>N5lCVTD?rO70 z2u#{cxL+z71_mC-CdG4Us#rqQ$Ch~96ulyjJHe5Z#&qPPzy(+&$0FaF77yK{3W0ZZbLc%dY#1Ke>9{glbvWE->K=!w z51G~k)k|K9BunKeIb73RKHxrI;U3Bb+@itMV^nuZu<{MsnIlQhD9W#C)gJeC)#FZ; zzWMTp=VWq!Wbk9^sh|n8-IdvSB0<-Zgdm=6HwdSGahz$lX7CGm0+$0X8Lmj@^LYXr z+UhVc*OmF-D~nZdP%NZStu}5!hcq&cm2-&9I8HK*{VUmxYDF|BWZ228fy%2+n=ET; z(|NRlX{dY2kQS1@5nP7aiI8D9$UzYIW~QB~=$vs=Xm{B}WX29UB?}Y|Yjh|SiL1#5P74*M zrJRlS%3LSpL@W$B`dWqdW;i@}AEFU-l>o*Q@0D&&b1Tu}nAYHW7~ zFIE$a6*4S#6y2C_&L`}2!6pZca6@@Yl0CeyR$d;{*sB@QmBaD$T;e@RSgd4P4td%z zEMwx?XJmnbk9p;Vp8lb2Bb$~q>f&R z>E!ICAA3f2?#QlJ7S$;$N4NKn=-Hivqq|skR0r-K7~0W0&^tKV+oSgn>Vs^we|PVH Dp5x@j diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index 4dda643292..565b100098 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -43,6 +43,233 @@ contract ERC20UniqueExtensions is Dummy, ERC165 { } } +// Selector: 7d9262e6 +contract Collection is Dummy, ERC165 { + // Set collection property. + // + // @param key Property key. + // @param value Propery value. + // + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + public + { + require(false, stub_error); + key; + value; + dummy = 0; + } + + // Delete collection property. + // + // @param key Property key. + // + // Selector: deleteCollectionProperty(string) 7b7debce + function deleteCollectionProperty(string memory key) public { + require(false, stub_error); + key; + dummy = 0; + } + + // Get collection property. + // + // @dev Throws error if key not found. + // + // @param key Property key. + // @return bytes The property corresponding to the key. + // + // Selector: collectionProperty(string) cf24fd6d + function collectionProperty(string memory key) + public + view + returns (bytes memory) + { + require(false, stub_error); + key; + dummy; + return hex""; + } + + // Set the sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) public { + require(false, stub_error); + sponsor; + dummy = 0; + } + + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() public { + require(false, stub_error); + dummy = 0; + } + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) public { + require(false, stub_error); + limit; + value; + dummy = 0; + } + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) public { + require(false, stub_error); + limit; + value; + dummy = 0; + } + + // Get contract address. + // + // Selector: contractAddress() f6b4dfb4 + function contractAddress() public view returns (address) { + require(false, stub_error); + dummy; + return 0x0000000000000000000000000000000000000000; + } + + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. + // + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) public { + require(false, stub_error); + newAdmin; + dummy = 0; + } + + // Remove collection admin by substrate address. + // @param admin Substrate administrator address. + // + // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + function removeCollectionAdminSubstrate(uint256 admin) public { + require(false, stub_error); + admin; + dummy = 0; + } + + // Add collection admin. + // @param new_admin Address of the added administrator. + // + // Selector: addCollectionAdmin(address) 92e462c7 + function addCollectionAdmin(address newAdmin) public { + require(false, stub_error); + newAdmin; + dummy = 0; + } + + // Remove collection admin. + // + // @param new_admin Address of the removed administrator. + // + // Selector: removeCollectionAdmin(address) fafd7b42 + function removeCollectionAdmin(address admin) public { + require(false, stub_error); + admin; + dummy = 0; + } + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // + // Selector: setCollectionNesting(bool) 112d4586 + function setCollectionNesting(bool enable) public { + require(false, stub_error); + enable; + dummy = 0; + } + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + // @param collections Addresses of collections that will be available for nesting. + // + // Selector: setCollectionNesting(bool,address[]) 64872396 + function setCollectionNesting(bool enable, address[] memory collections) + public + { + require(false, stub_error); + enable; + collections; + dummy = 0; + } + + // Set the collection access method. + // @param mode Access mode + // 0 for Normal + // 1 for AllowList + // + // Selector: setCollectionAccess(uint8) 41835d4c + function setCollectionAccess(uint8 mode) public { + require(false, stub_error); + mode; + dummy = 0; + } + + // Add the user to the allowed list. + // + // @param user Address of a trusted user. + // + // Selector: addToCollectionAllowList(address) 67844fe6 + function addToCollectionAllowList(address user) public { + require(false, stub_error); + user; + dummy = 0; + } + + // Remove the user from the allowed list. + // + // @param user Address of a removed user. + // + // Selector: removeFromCollectionAllowList(address) 85c51acb + function removeFromCollectionAllowList(address user) public { + require(false, stub_error); + user; + dummy = 0; + } + + // Switch permission for minting. + // + // @param mode Enable if "true". + // + // Selector: setCollectionMintMode(bool) 00018e84 + function setCollectionMintMode(bool mode) public { + require(false, stub_error); + mode; + dummy = 0; + } +} + // Selector: 942e8b22 contract ERC20 is Dummy, ERC165, ERC20Events { // Selector: name() 06fdde03 @@ -127,76 +354,6 @@ contract ERC20 is Dummy, ERC165, ERC20Events { } } -// Selector: c894dc35 -contract Collection is Dummy, ERC165 { - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - public - { - require(false, stub_error); - key; - value; - dummy = 0; - } - - // Selector: deleteCollectionProperty(string) 7b7debce - function deleteCollectionProperty(string memory key) public { - require(false, stub_error); - key; - dummy = 0; - } - - // Throws error if key not found - // - // Selector: collectionProperty(string) cf24fd6d - function collectionProperty(string memory key) - public - view - returns (bytes memory) - { - require(false, stub_error); - key; - dummy; - return hex""; - } - - // Selector: ethSetSponsor(address) 8f9af356 - function ethSetSponsor(address sponsor) public { - require(false, stub_error); - sponsor; - dummy = 0; - } - - // Selector: ethConfirmSponsorship() a8580d1a - function ethConfirmSponsorship() public { - require(false, stub_error); - dummy = 0; - } - - // Selector: setLimit(string,uint32) 68db30ca - function setLimit(string memory limit, uint32 value) public { - require(false, stub_error); - limit; - value; - dummy = 0; - } - - // Selector: setLimit(string,bool) ea67e4c2 - function setLimit(string memory limit, bool value) public { - require(false, stub_error); - limit; - value; - dummy = 0; - } - - // Selector: contractAddress() f6b4dfb4 - function contractAddress() public view returns (address) { - require(false, stub_error); - dummy; - return 0x0000000000000000000000000000000000000000; - } -} - contract UniqueFungible is Dummy, ERC165, diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 6314e868ee653553fe67e7f00f6564166cbb7c99..13f4c8286d9280b207ce328f0973cee7c259b7c5 100644 GIT binary patch delta 44 zcmV+{0Mq}JAe11m!w(=ka|bihVHk4!86u&=i%!0|^x@?kznx CR27f_ delta 44 zcmV+{0Mq}JAe11m!w(>fjpD-0>V<2QR7=N;pku0Z;=jNAP=b90>6+zv1k>k};}0= `totalSupply()`. // @param index A counter less than `totalSupply()` // @return The token identifier for the `index`th NFT, // (sort order not specified) @@ -413,6 +413,11 @@ contract ERC721Enumerable is Dummy, ERC165 { // Selector: 7d9262e6 contract Collection is Dummy, ERC165 { + // Set collection property. + // + // @param key Property key. + // @param value Propery value. + // // Selector: setCollectionProperty(string,bytes) 2f073f66 function setCollectionProperty(string memory key, bytes memory value) public @@ -423,6 +428,10 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + // Delete collection property. + // + // @param key Property key. + // // Selector: deleteCollectionProperty(string) 7b7debce function deleteCollectionProperty(string memory key) public { require(false, stub_error); @@ -430,7 +439,12 @@ contract Collection is Dummy, ERC165 { dummy = 0; } - // Throws error if key not found + // Get collection property. + // + // @dev Throws error if key not found. + // + // @param key Property key. + // @return bytes The property corresponding to the key. // // Selector: collectionProperty(string) cf24fd6d function collectionProperty(string memory key) @@ -444,6 +458,12 @@ contract Collection is Dummy, ERC165 { return hex""; } + // Set the sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // // Selector: setCollectionSponsor(address) 7623402e function setCollectionSponsor(address sponsor) public { require(false, stub_error); @@ -451,12 +471,27 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // // Selector: confirmCollectionSponsorship() 3c50e97a function confirmCollectionSponsorship() public { require(false, stub_error); dummy = 0; } + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // // Selector: setCollectionLimit(string,uint32) 6a3841db function setCollectionLimit(string memory limit, uint32 value) public { require(false, stub_error); @@ -465,6 +500,14 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. + // // Selector: setCollectionLimit(string,bool) 993b7fba function setCollectionLimit(string memory limit, bool value) public { require(false, stub_error); @@ -473,6 +516,8 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + // Get contract address. + // // Selector: contractAddress() f6b4dfb4 function contractAddress() public view returns (address) { require(false, stub_error); @@ -480,34 +525,51 @@ contract Collection is Dummy, ERC165 { return 0x0000000000000000000000000000000000000000; } + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. + // // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) public view { + function addCollectionAdminSubstrate(uint256 newAdmin) public { require(false, stub_error); newAdmin; - dummy; + dummy = 0; } + // Remove collection admin by substrate address. + // @param admin Substrate administrator address. + // // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 - function removeCollectionAdminSubstrate(uint256 newAdmin) public view { + function removeCollectionAdminSubstrate(uint256 admin) public { require(false, stub_error); - newAdmin; - dummy; + admin; + dummy = 0; } + // Add collection admin. + // @param new_admin Address of the added administrator. + // // Selector: addCollectionAdmin(address) 92e462c7 - function addCollectionAdmin(address newAdmin) public view { + function addCollectionAdmin(address newAdmin) public { require(false, stub_error); newAdmin; - dummy; + dummy = 0; } + // Remove collection admin. + // + // @param new_admin Address of the removed administrator. + // // Selector: removeCollectionAdmin(address) fafd7b42 - function removeCollectionAdmin(address admin) public view { + function removeCollectionAdmin(address admin) public { require(false, stub_error); admin; - dummy; + dummy = 0; } + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // // Selector: setCollectionNesting(bool) 112d4586 function setCollectionNesting(bool enable) public { require(false, stub_error); @@ -515,6 +577,11 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + // @param collections Addresses of collections that will be available for nesting. + // // Selector: setCollectionNesting(bool,address[]) 64872396 function setCollectionNesting(bool enable, address[] memory collections) public @@ -525,6 +592,11 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + // Set the collection access method. + // @param mode Access mode + // 0 for Normal + // 1 for AllowList + // // Selector: setCollectionAccess(uint8) 41835d4c function setCollectionAccess(uint8 mode) public { require(false, stub_error); @@ -532,20 +604,32 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + // Add the user to the allowed list. + // + // @param user Address of a trusted user. + // // Selector: addToCollectionAllowList(address) 67844fe6 - function addToCollectionAllowList(address user) public view { + function addToCollectionAllowList(address user) public { require(false, stub_error); user; - dummy; + dummy = 0; } + // Remove the user from the allowed list. + // + // @param user Address of a removed user. + // // Selector: removeFromCollectionAllowList(address) 85c51acb - function removeFromCollectionAllowList(address user) public view { + function removeFromCollectionAllowList(address user) public { require(false, stub_error); user; - dummy; + dummy = 0; } + // Switch permission for minting. + // + // @param mode Enable if "true". + // // Selector: setCollectionMintMode(bool) 00018e84 function setCollectionMintMode(bool mode) public { require(false, stub_error); @@ -556,9 +640,7 @@ contract Collection is Dummy, ERC165 { // Selector: d74d154f contract ERC721UniqueExtensions is Dummy, ERC165 { - // @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE - // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE - // THEY MAY BE PERMANENTLY LOST + // @notice Transfer ownership of an NFT // @dev Throws unless `msg.sender` is the current owner. Throws if `to` // is the zero address. Throws if `tokenId` is not a valid NFT. // @param to The new owner diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index 549328051aae77ed3bc6f56e12caf98db5f9550f..77aaa2c4428e265277238e44ae010dcbb18c5d22 100644 GIT binary patch delta 491 zcmXw#KWG#|6vp4%&B0lDf!xMpPi}33f*?dK6oi9oEa#5wPBAIoQ^7{C5G+K<%w%_s z2r}md#Y$Uk#YPCWfv8|>l_FTgM!_N}{PWg746pef-}n9Ad})6_vP`=)oX`?k=O%&Y zKG5?Egn?lYJj2JrsB^ZfHUvG2>yY+)31Jn| z#VVIpaY6MTv{xrn;~N~jqBm+B`+T#+P5GB8h7uV^f>!xvZ}q(j$A2<6LP`gT#Jb!p z3bj&Va4Cjd4&eBVWqkH(0bfSLx0<7UY5XNceo}V3)Ji=*R)1A^&~Su|z|;*xw5Q!l z>2VS&4EK?vo!Mc0;#9JA`{K8yWcSc~e!6qL{m^c2t=@U_sI~Xx{rOLEC%Ja(=8dZ( LXdj)8=1%?wok^lk delta 427 zcmXw!JxF6g5XX0tAPR>>!6zCa50N0Y3WwdnA=oIJhj~xgX66(>K+q$_6<1_;HHz5m zi-#YbADxg!D-{DGSXo(Kqm4F}vGrr(aZ@bA&Tr=b|G%_6H<$1MzXg~>ZA{=OHG=!Y zI!_`OBgE*t7#xY=P{|?PL1HjMp24dHHs}LYuY}0o3{lv0kLC%g(~cW#91Zg z_mX=TDy40MJ!2tLV2VU7R0ziOIO}N=PZ5@^7fXe{O`9Y^Q#3t3`uit7WEz%xJxm4I zhk`@JPKJt-1DYUnx(mmN(s@LQM?Ux7wdUDi-NLr~_aQb7$8{W7t(kNOCGI0Lv1%c3 zWpEoniJMTZz>btk{@L4=|0{euoLN|&El&2f`(Nj~iwEr|V^_i7{a;7**&nr}zMibt aUoNJWGK1Y0GsUH*#p&;&xpnI{)&Bu-B9?&w diff --git a/tests/src/eth/api/UniqueFungible.sol b/tests/src/eth/api/UniqueFungible.sol index 0f9d1e7a80..da09eaa64e 100644 --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -28,6 +28,154 @@ interface ERC20UniqueExtensions is Dummy, ERC165 { function burnFrom(address from, uint256 amount) external returns (bool); } +// Selector: 7d9262e6 +interface Collection is Dummy, ERC165 { + // Set collection property. + // + // @param key Property key. + // @param value Propery value. + // + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + external; + + // Delete collection property. + // + // @param key Property key. + // + // Selector: deleteCollectionProperty(string) 7b7debce + function deleteCollectionProperty(string memory key) external; + + // Get collection property. + // + // @dev Throws error if key not found. + // + // @param key Property key. + // @return bytes The property corresponding to the key. + // + // Selector: collectionProperty(string) cf24fd6d + function collectionProperty(string memory key) + external + view + returns (bytes memory); + + // Set the sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) external; + + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) external; + + // Get contract address. + // + // Selector: contractAddress() f6b4dfb4 + function contractAddress() external view returns (address); + + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. + // + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) external; + + // Remove collection admin by substrate address. + // @param admin Substrate administrator address. + // + // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + function removeCollectionAdminSubstrate(uint256 admin) external; + + // Add collection admin. + // @param new_admin Address of the added administrator. + // + // Selector: addCollectionAdmin(address) 92e462c7 + function addCollectionAdmin(address newAdmin) external; + + // Remove collection admin. + // + // @param new_admin Address of the removed administrator. + // + // Selector: removeCollectionAdmin(address) fafd7b42 + function removeCollectionAdmin(address admin) external; + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // + // Selector: setCollectionNesting(bool) 112d4586 + function setCollectionNesting(bool enable) external; + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + // @param collections Addresses of collections that will be available for nesting. + // + // Selector: setCollectionNesting(bool,address[]) 64872396 + function setCollectionNesting(bool enable, address[] memory collections) + external; + + // Set the collection access method. + // @param mode Access mode + // 0 for Normal + // 1 for AllowList + // + // Selector: setCollectionAccess(uint8) 41835d4c + function setCollectionAccess(uint8 mode) external; + + // Add the user to the allowed list. + // + // @param user Address of a trusted user. + // + // Selector: addToCollectionAllowList(address) 67844fe6 + function addToCollectionAllowList(address user) external; + + // Remove the user from the allowed list. + // + // @param user Address of a removed user. + // + // Selector: removeFromCollectionAllowList(address) 85c51acb + function removeFromCollectionAllowList(address user) external; + + // Switch permission for minting. + // + // @param mode Enable if "true". + // + // Selector: setCollectionMintMode(bool) 00018e84 + function setCollectionMintMode(bool mode) external; +} + // Selector: 942e8b22 interface ERC20 is Dummy, ERC165, ERC20Events { // Selector: name() 06fdde03 @@ -65,39 +213,6 @@ interface ERC20 is Dummy, ERC165, ERC20Events { returns (uint256); } -// Selector: c894dc35 -interface Collection is Dummy, ERC165 { - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - external; - - // Selector: deleteCollectionProperty(string) 7b7debce - function deleteCollectionProperty(string memory key) external; - - // Throws error if key not found - // - // Selector: collectionProperty(string) cf24fd6d - function collectionProperty(string memory key) - external - view - returns (bytes memory); - - // Selector: ethSetSponsor(address) 8f9af356 - function ethSetSponsor(address sponsor) external; - - // Selector: ethConfirmSponsorship() a8580d1a - function ethConfirmSponsorship() external; - - // Selector: setLimit(string,uint32) 68db30ca - function setLimit(string memory limit, uint32 value) external; - - // Selector: setLimit(string,bool) ea67e4c2 - function setLimit(string memory limit, bool value) external; - - // Selector: contractAddress() f6b4dfb4 - function contractAddress() external view returns (address); -} - interface UniqueFungible is Dummy, ERC165, diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index 8a41aab39c..bb2628b3bd 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -61,7 +61,7 @@ interface TokenProperties is Dummy, ERC165 { // @notice Set token property value. // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param token_id ID of the token. + // @param tokenId ID of the token. // @param key Property key. // @param value Property value. // @@ -74,7 +74,7 @@ interface TokenProperties is Dummy, ERC165 { // @notice Delete token property value. // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param token_id ID of the token. + // @param tokenId ID of the token. // @param key Property key. // // Selector: deleteProperty(uint256,string) 066111d1 @@ -82,8 +82,9 @@ interface TokenProperties is Dummy, ERC165 { // @notice Get token property value. // @dev Throws error if key not found - // @param token_id ID of the token. + // @param tokenId ID of the token. // @param key Property key. + // @return Property value bytes // // Selector: property(uint256,string) 7228c327 function property(uint256 tokenId, string memory key) @@ -108,8 +109,8 @@ interface ERC721 is Dummy, ERC165, ERC721Events { // @notice Count all NFTs assigned to an owner // @dev NFTs assigned to the zero address are considered invalid, and this // function throws for queries about the zero address. - // @param _owner An address for whom to query the balance - // @return The number of NFTs owned by `_owner`, possibly zero + // @param owner An address for whom to query the balance + // @return The number of NFTs owned by `owner`, possibly zero // // Selector: balanceOf(address) 70a08231 function balanceOf(address owner) external view returns (uint256); @@ -117,7 +118,7 @@ interface ERC721 is Dummy, ERC165, ERC721Events { // @notice Find the owner of an NFT // @dev NFTs assigned to zero address are considered invalid, and queries // about them do throw. - // @param _tokenId The identifier for an NFT + // @param tokenId The identifier for an NFT // @return The address of the owner of the NFT // // Selector: ownerOf(uint256) 6352211e @@ -248,7 +249,6 @@ interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { // Selector: 780e9d63 interface ERC721Enumerable is Dummy, ERC165 { // @notice Enumerate valid NFTs - // @dev Throws if `index` >= `totalSupply()`. // @param index A counter less than `totalSupply()` // @return The token identifier for the `index`th NFT, // (sort order not specified) @@ -274,14 +274,28 @@ interface ERC721Enumerable is Dummy, ERC165 { // Selector: 7d9262e6 interface Collection is Dummy, ERC165 { + // Set collection property. + // + // @param key Property key. + // @param value Propery value. + // // Selector: setCollectionProperty(string,bytes) 2f073f66 function setCollectionProperty(string memory key, bytes memory value) external; + // Delete collection property. + // + // @param key Property key. + // // Selector: deleteCollectionProperty(string) 7b7debce function deleteCollectionProperty(string memory key) external; - // Throws error if key not found + // Get collection property. + // + // @dev Throws error if key not found. + // + // @param key Property key. + // @return bytes The property corresponding to the key. // // Selector: collectionProperty(string) cf24fd6d function collectionProperty(string memory key) @@ -289,58 +303,126 @@ interface Collection is Dummy, ERC165 { view returns (bytes memory); + // Set the sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // // Selector: setCollectionSponsor(address) 7623402e function setCollectionSponsor(address sponsor) external; + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // // Selector: confirmCollectionSponsorship() 3c50e97a function confirmCollectionSponsorship() external; + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // // Selector: setCollectionLimit(string,uint32) 6a3841db function setCollectionLimit(string memory limit, uint32 value) external; + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. + // // Selector: setCollectionLimit(string,bool) 993b7fba function setCollectionLimit(string memory limit, bool value) external; + // Get contract address. + // // Selector: contractAddress() f6b4dfb4 function contractAddress() external view returns (address); + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. + // // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) external view; + function addCollectionAdminSubstrate(uint256 newAdmin) external; + // Remove collection admin by substrate address. + // @param admin Substrate administrator address. + // // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 - function removeCollectionAdminSubstrate(uint256 newAdmin) external view; + function removeCollectionAdminSubstrate(uint256 admin) external; + // Add collection admin. + // @param new_admin Address of the added administrator. + // // Selector: addCollectionAdmin(address) 92e462c7 - function addCollectionAdmin(address newAdmin) external view; + function addCollectionAdmin(address newAdmin) external; + // Remove collection admin. + // + // @param new_admin Address of the removed administrator. + // // Selector: removeCollectionAdmin(address) fafd7b42 - function removeCollectionAdmin(address admin) external view; + function removeCollectionAdmin(address admin) external; + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // // Selector: setCollectionNesting(bool) 112d4586 function setCollectionNesting(bool enable) external; + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + // @param collections Addresses of collections that will be available for nesting. + // // Selector: setCollectionNesting(bool,address[]) 64872396 function setCollectionNesting(bool enable, address[] memory collections) external; + // Set the collection access method. + // @param mode Access mode + // 0 for Normal + // 1 for AllowList + // // Selector: setCollectionAccess(uint8) 41835d4c function setCollectionAccess(uint8 mode) external; + // Add the user to the allowed list. + // + // @param user Address of a trusted user. + // // Selector: addToCollectionAllowList(address) 67844fe6 - function addToCollectionAllowList(address user) external view; + function addToCollectionAllowList(address user) external; + // Remove the user from the allowed list. + // + // @param user Address of a removed user. + // // Selector: removeFromCollectionAllowList(address) 85c51acb - function removeFromCollectionAllowList(address user) external view; + function removeFromCollectionAllowList(address user) external; + // Switch permission for minting. + // + // @param mode Enable if "true". + // // Selector: setCollectionMintMode(bool) 00018e84 function setCollectionMintMode(bool mode) external; } // Selector: d74d154f interface ERC721UniqueExtensions is Dummy, ERC165 { - // @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE - // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE - // THEY MAY BE PERMANENTLY LOST + // @notice Transfer ownership of an NFT // @dev Throws unless `msg.sender` is the current owner. Throws if `to` // is the zero address. Throws if `tokenId` is not a valid NFT. // @param to The new owner diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index 41b42a0f98..1caf6a0ea6 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -49,6 +49,33 @@ "name": "Transfer", "type": "event" }, + { + "inputs": [ + { "internalType": "address", "name": "newAdmin", "type": "address" } + ], + "name": "addCollectionAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "newAdmin", "type": "uint256" } + ], + "name": "addCollectionAdminSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "addToCollectionAllowList", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, @@ -95,6 +122,13 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "confirmCollectionSponsorship", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "contractAddress", @@ -118,33 +152,41 @@ }, { "inputs": [], - "name": "ethConfirmSponsorship", - "outputs": [], - "stateMutability": "nonpayable", + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "sponsor", "type": "address" } + { "internalType": "address", "name": "admin", "type": "address" } ], - "name": "ethSetSponsor", + "name": "removeCollectionAdmin", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [], - "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", + "inputs": [ + { "internalType": "uint256", "name": "admin", "type": "uint256" } + ], + "name": "removeCollectionAdminSubstrate", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "string", "name": "key", "type": "string" }, - { "internalType": "bytes", "name": "value", "type": "bytes" } + { "internalType": "address", "name": "user", "type": "address" } ], - "name": "setCollectionProperty", + "name": "removeFromCollectionAllowList", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint8", "name": "mode", "type": "uint8" }], + "name": "setCollectionAccess", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -154,7 +196,7 @@ { "internalType": "string", "name": "limit", "type": "string" }, { "internalType": "uint32", "name": "value", "type": "uint32" } ], - "name": "setLimit", + "name": "setCollectionLimit", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -164,7 +206,54 @@ { "internalType": "string", "name": "limit", "type": "string" }, { "internalType": "bool", "name": "value", "type": "bool" } ], - "name": "setLimit", + "name": "setCollectionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "mode", "type": "bool" }], + "name": "setCollectionMintMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }], + "name": "setCollectionNesting", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bool", "name": "enable", "type": "bool" }, + { + "internalType": "address[]", + "name": "collections", + "type": "address[]" + } + ], + "name": "setCollectionNesting", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "key", "type": "string" }, + { "internalType": "bytes", "name": "value", "type": "bytes" } + ], + "name": "setCollectionProperty", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "sponsor", "type": "address" } + ], + "name": "setCollectionSponsor", "outputs": [], "stateMutability": "nonpayable", "type": "function" diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index e41e92cc0c..cbd18c77a6 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -86,7 +86,7 @@ ], "name": "addCollectionAdmin", "outputs": [], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { @@ -95,7 +95,7 @@ ], "name": "addCollectionAdminSubstrate", "outputs": [], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { @@ -104,7 +104,7 @@ ], "name": "addToCollectionAllowList", "outputs": [], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { @@ -304,16 +304,16 @@ ], "name": "removeCollectionAdmin", "outputs": [], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "uint256", "name": "newAdmin", "type": "uint256" } + { "internalType": "uint256", "name": "admin", "type": "uint256" } ], "name": "removeCollectionAdminSubstrate", "outputs": [], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { @@ -322,7 +322,7 @@ ], "name": "removeFromCollectionAllowList", "outputs": [], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 19a06cea37..0188f12c63 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -277,15 +277,16 @@ declare module '@polkadot/api-base/types/errors' { }; fungible: { /** - * Fungible token does not support nested + * Fungible token does not support nesting. **/ FungibleDisallowsNesting: AugmentedError; /** - * Tried to set data for fungible item + * Tried to set data for fungible item. **/ FungibleItemsDontHaveData: AugmentedError; /** - * Not default id passed as TokenId argument + * Not default id passed as TokenId argument. + * The default value of TokenId for Fungible collection is 0. **/ FungibleItemsHaveNoId: AugmentedError; /** @@ -293,7 +294,7 @@ declare module '@polkadot/api-base/types/errors' { **/ NotFungibleDataUsedToMintFungibleCollectionToken: AugmentedError; /** - * Setting item properties is not allowed + * Setting item properties is not allowed. **/ SettingPropertiesNotAllowed: AugmentedError; /** diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index a083c0840a..2c2b6f681e 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -187,8 +187,17 @@ declare module '@polkadot/api-base/types/storage' { [key: string]: QueryableStorageEntry; }; fungible: { + /** + * Storage for delegated assets. + **/ allowance: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; + /** + * Amount of tokens owned by an account inside a collection. + **/ balance: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; + /** + * Total amount of fungible tokens inside a collection. + **/ totalSupply: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; /** * Generic query @@ -400,17 +409,35 @@ declare module '@polkadot/api-base/types/storage' { [key: string]: QueryableStorageEntry; }; refungible: { + /** + * Amount of tokens owned by account + **/ accountBalance: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; + /** + * Allowance set by an owner for a spender for a token + **/ allowance: AugmentedQuery Observable, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; + /** + * Amount of token pieces owned by account + **/ balance: AugmentedQuery Observable, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; /** * Used to enumerate tokens owned by account **/ owned: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]> & QueryableStorageEntry; + /** + * Custom data serialized to bytes for token + **/ tokenData: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; tokenProperties: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; tokensBurnt: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; + /** + * Amount of tokens minted for collection + **/ tokensMinted: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; + /** + * Total amount of pieces for token + **/ totalSupply: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; /** * Generic query From da952fd3c8fb1ade16a77475aa38ff105d942687 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Mon, 11 Jul 2022 13:38:48 +0700 Subject: [PATCH 0080/1274] initial commit --- client/rpc/src/lib.rs | 10 +++++ pallets/common/src/lib.rs | 3 ++ pallets/fungible/src/common.rs | 4 ++ pallets/fungible/src/lib.rs | 18 ++++++++- pallets/nonfungible/src/common.rs | 6 ++- pallets/refungible/src/common.rs | 4 ++ pallets/refungible/src/lib.rs | 16 ++++++++ primitives/rpc/src/lib.rs | 1 + runtime/common/src/runtime_apis.rs | 5 +++ tests/package.json | 1 + tests/src/interfaces/augment-api-rpc.ts | 4 ++ tests/src/interfaces/unique/definitions.ts | 1 + tests/src/refungible.test.ts | 42 +++++++++++++++++--- tests/src/rpc.test.ts | 45 +++++++++++++++++++++- 14 files changed, 151 insertions(+), 9 deletions(-) diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index 2b22c1c4b3..25c48085d9 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -70,6 +70,15 @@ pub trait UniqueApi { token: TokenId, at: Option, ) -> Result>; + + #[method(name = "unique_tokenOwners")] + fn token_owners( + &self, + collection: CollectionId, + token: TokenId, + at: Option, + ) -> Result>; + #[method(name = "unique_topmostTokenOwner")] fn topmost_token_owner( &self, @@ -473,6 +482,7 @@ where pass_method!(next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Option, unique_api); pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option, unique_api); pass_method!(total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option, unique_api); + pass_method!(token_owners(collection: CollectionId, token: TokenId) -> Vec, unique_api); } #[allow(deprecated)] diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index e87ff63ae9..3417d7e5d9 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -1748,6 +1748,9 @@ pub trait CommonCollectionOperations { /// * `token` - The token for which you need to find out the owner. fn token_owner(&self, token: TokenId) -> Option; + /// Token owners + fn token_owners(&self, token: TokenId) -> Vec; + /// Get the value of the token property by key. /// /// * `token` - Token with the property to get. diff --git a/pallets/fungible/src/common.rs b/pallets/fungible/src/common.rs index 5262450e4f..95242d4450 100644 --- a/pallets/fungible/src/common.rs +++ b/pallets/fungible/src/common.rs @@ -362,6 +362,10 @@ impl CommonCollectionOperations for FungibleHandle { None } + fn token_owners(&self, token: TokenId) -> Vec { + >::token_owners(self.id, token).unwrap_or_else(|| vec![]) + } + fn token_property(&self, _token_id: TokenId, _key: &PropertyKey) -> Option { None } diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index e85e54d8b5..4afefd0d39 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -95,7 +95,7 @@ use pallet_structure::Pallet as PalletStructure; use pallet_evm_coder_substrate::WithRecorder; use sp_core::H160; use sp_runtime::{ArithmeticError, DispatchError, DispatchResult}; -use sp_std::{collections::btree_map::BTreeMap}; +use sp_std::{collections::btree_map::BTreeMap, vec::Vec}; pub use pallet::*; @@ -613,4 +613,20 @@ impl Pallet { nesting_budget, ) } + + pub fn token_owners( + collection: CollectionId, + _token: TokenId, + ) -> Option> { + let res: Vec = >::iter_prefix((collection,)) + .map(|r| r.0) + .take(10) + .collect(); + + if res.len() == 0 { + None + } else { + Some(res) + } + } } diff --git a/pallets/nonfungible/src/common.rs b/pallets/nonfungible/src/common.rs index acbe103813..213c3e5689 100644 --- a/pallets/nonfungible/src/common.rs +++ b/pallets/nonfungible/src/common.rs @@ -26,7 +26,7 @@ use pallet_common::{ weights::WeightInfo as _, }; use sp_runtime::DispatchError; -use sp_std::vec::Vec; +use sp_std::{vec::Vec, vec}; use crate::{ AccountBalance, Allowance, Config, CreateItemData, Error, NonfungibleHandle, Owned, Pallet, @@ -422,6 +422,10 @@ impl CommonCollectionOperations for NonfungibleHandle { >::get((self.id, token)).map(|t| t.owner) } + fn token_owners(&self, token: TokenId) -> Vec { + self.token_owner(token).map_or_else(|| vec![], |t| vec![t]) + } + fn token_property(&self, token_id: TokenId, key: &PropertyKey) -> Option { >::token_properties((self.id, token_id)) .get(key) diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index 00babc493a..3b8db2a3a5 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -438,6 +438,10 @@ impl CommonCollectionOperations for RefungibleHandle { >::token_owner(self.id, token) } + fn token_owners(&self, token: TokenId) -> Vec { + >::token_owners(self.id, token).unwrap_or_else(|| vec![]) + } + fn token_property(&self, _token_id: TokenId, _key: &PropertyKey) -> Option { None } diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index c8dde50b11..df2e00f70c 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -1134,4 +1134,20 @@ impl Pallet { ) -> DispatchResult { >::set_token_property_permissions(collection, sender, property_permissions) } + + pub fn token_owners( + collection_id: CollectionId, + token: TokenId, + ) -> Option> { + let res: Vec = >::iter_prefix((collection_id, token)) + .map(|r| r.0) + .take(10) + .collect(); + + if res.len() == 0 { + None + } else { + Some(res) + } + } } diff --git a/primitives/rpc/src/lib.rs b/primitives/rpc/src/lib.rs index 14a50f1c8e..1cc3f519cf 100644 --- a/primitives/rpc/src/lib.rs +++ b/primitives/rpc/src/lib.rs @@ -81,5 +81,6 @@ sp_api::decl_runtime_apis! { fn next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result>; fn effective_collection_limits(collection_id: CollectionId) -> Result>; fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Result>; + fn token_owners(collection: CollectionId, token: TokenId) -> Result>; } } diff --git a/runtime/common/src/runtime_apis.rs b/runtime/common/src/runtime_apis.rs index 083c92c988..00d3a10e2b 100644 --- a/runtime/common/src/runtime_apis.rs +++ b/runtime/common/src/runtime_apis.rs @@ -40,6 +40,11 @@ macro_rules! impl_common_runtime_apis { fn token_owner(collection: CollectionId, token: TokenId) -> Result, DispatchError> { dispatch_unique_runtime!(collection.token_owner(token)) } + + fn token_owners(collection: CollectionId, token: TokenId) -> Result, DispatchError> { + dispatch_unique_runtime!(collection.token_owners(token)) + } + fn topmost_token_owner(collection: CollectionId, token: TokenId) -> Result, DispatchError> { let budget = up_data_structs::budget::Value::new(10); diff --git a/tests/package.json b/tests/package.json index 804105848d..1722ba984b 100644 --- a/tests/package.json +++ b/tests/package.json @@ -80,6 +80,7 @@ "testLimits": "mocha --timeout 9999999 -r ts-node/register ./**/limits.test.ts", "testEthCreateCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createCollection.test.ts", "testRFT": "mocha --timeout 9999999 -r ts-node/register ./**/refungible.test.ts", + "testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts", "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", "polkadot-types-from-defs": "ts-node ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .", "polkadot-types-from-chain": "ts-node ./node_modules/.bin/polkadot-types-from-chain --endpoint src/interfaces/metadata.json --output src/interfaces/ --package .", diff --git a/tests/src/interfaces/augment-api-rpc.ts b/tests/src/interfaces/augment-api-rpc.ts index 08d81d5802..9af145e7be 100644 --- a/tests/src/interfaces/augment-api-rpc.ts +++ b/tests/src/interfaces/augment-api-rpc.ts @@ -708,6 +708,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { * Get token owner **/ tokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; + /** + * Get token owners + **/ + tokenOwners: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; /** * Get token properties **/ diff --git a/tests/src/interfaces/unique/definitions.ts b/tests/src/interfaces/unique/definitions.ts index aaa72cc26f..645c154099 100644 --- a/tests/src/interfaces/unique/definitions.ts +++ b/tests/src/interfaces/unique/definitions.ts @@ -49,6 +49,7 @@ export default { balance: fun('Get amount of specific account token', [collectionParam, crossAccountParam(), tokenParam], 'u128'), allowance: fun('Get allowed amount', [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam], 'u128'), tokenOwner: fun('Get token owner', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`), + tokenOwners: fun('Get token owners', [collectionParam, tokenParam], `Vec<${CROSS_ACCOUNT_ID_TYPE}>`), topmostTokenOwner: fun('Get token owner, in case of nested token - find parent recursive', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`), tokenChildren: fun('Get tokens nested directly into the token', [collectionParam, tokenParam], 'Vec'), constMetadata: fun('Get token constant metadata', [collectionParam, tokenParam], 'Vec'), diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index e8eb94a226..5b43f7c000 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -53,14 +53,14 @@ describe('integration test: Refungible functionality:', () => { it('Create refungible collection and token', async () => { await usingApi(async api => { const createCollectionResult = await createCollection(api, alice, {mode: {type: 'ReFungible'}}); - expect(createCollectionResult.success).to.be.true; + expect(createCollectionResult.success).to.be.true; const collectionId = createCollectionResult.collectionId; - + const itemCountBefore = await getLastTokenId(api, collectionId); const result = await createRefungibleToken(api, alice, collectionId, 100n); - + const itemCountAfter = await getLastTokenId(api, collectionId); - + // What to expect // tslint:disable-next-line:no-unused-expression expect(result.success).to.be.true; @@ -69,7 +69,39 @@ describe('integration test: Refungible functionality:', () => { expect(itemCountAfter.toString()).to.be.equal(result.itemId.toString()); }); }); - + + it('RPC method tokenOnewrs for refungible collection and token', async () => { + await usingApi(async (api, privateKeyWrapper) => { + const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; + const facelessCrowd = Array.from(Array(7).keys()).map(i => normalizeAccountId(privateKeyWrapper(i.toString()))); + + const createCollectionResult = await createCollection(api, alice, {mode: {type: 'ReFungible'}}); + const collectionId = createCollectionResult.collectionId; + + const result = await createRefungibleToken(api, alice, collectionId, 10_000n); + const aliceTokenId = result.itemId; + + + await transfer(api, collectionId, aliceTokenId, alice, bob, 1000n); + await transfer(api, collectionId, aliceTokenId, alice, ethAcc, 900n); + + for (let i = 0; i < 7; i++) { + await transfer(api, collectionId, aliceTokenId, alice, facelessCrowd[i], 50*(i+1)); + } + + const owners = await api.rpc.unique.tokenOwners(collectionId, aliceTokenId); + const ids = (owners.toJSON() as CrossAccountId[]).map(s => normalizeAccountId(s)); + + const aliceID = normalizeAccountId(alice); + const bobId = normalizeAccountId(bob); + + // What to expect + // tslint:disable-next-line:no-unused-expression + expect(ids).to.deep.include.members([aliceID, ethAcc, bobId, ...facelessCrowd]); + expect(owners.length == 10).to.be.true; + }); + }); + it('Transfer token pieces', async () => { await usingApi(async api => { const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; diff --git a/tests/src/rpc.test.ts b/tests/src/rpc.test.ts index 423686cfe5..f7ebf5493e 100644 --- a/tests/src/rpc.test.ts +++ b/tests/src/rpc.test.ts @@ -1,12 +1,53 @@ +import {IKeyringPair} from '@polkadot/types/types'; import {expect} from 'chai'; import usingApi from './substrate/substrate-api'; -import {createCollectionExpectSuccess, getTokenOwner} from './util/helpers'; +import {createCollection, createCollectionExpectSuccess, createFungibleItemExpectSuccess, CrossAccountId, getTokenOwner, normalizeAccountId, transfer, U128_MAX} from './util/helpers'; -describe('getTokenOwner', () => { +let alice: IKeyringPair; +let bob: IKeyringPair; + + +describe('integration test: RPC methods', () => { + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + alice = privateKeyWrapper('//Alice'); + bob = privateKeyWrapper('//Bob'); + }); + }); + + it('returns None for fungible collection', async () => { await usingApi(async api => { const collection = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); await expect(getTokenOwner(api, collection, 0)).to.be.rejectedWith(/^owner == null$/); }); }); + + it('RPC method tokenOnewrs for fungible collection and token', async () => { + await usingApi(async (api, privateKeyWrapper) => { + const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; + const facelessCrowd = Array.from(Array(7).keys()).map(i => normalizeAccountId(privateKeyWrapper(i.toString()))); + + const createCollectionResult = await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}}); + const collectionId = createCollectionResult.collectionId; + const aliceTokenId = await createFungibleItemExpectSuccess(alice, collectionId, {Value: U128_MAX}, alice.address); + + await transfer(api, collectionId, aliceTokenId, alice, bob, 1000n); + await transfer(api, collectionId, aliceTokenId, alice, ethAcc, 900n); + + for (let i = 0; i < 7; i++) { + await transfer(api, collectionId, aliceTokenId, alice, facelessCrowd[i], 1); + } + + const owners = await api.rpc.unique.tokenOwners(collectionId, aliceTokenId); + const ids = (owners.toJSON() as CrossAccountId[]).map(s => normalizeAccountId(s)); + const aliceID = normalizeAccountId(alice); + const bobId = normalizeAccountId(bob); + + // What to expect + // tslint:disable-next-line:no-unused-expression + expect(ids).to.deep.include.members([aliceID, ethAcc, bobId, ...facelessCrowd]); + expect(owners.length == 10).to.be.true; + }); + }); }); \ No newline at end of file From d7a4e69fe08d61bb41163d96c3125b1753618db3 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 22 Jul 2022 05:21:08 +0000 Subject: [PATCH 0081/1274] added erc20 api for refungible tokens --- Cargo.lock | 3 + pallets/refungible/Cargo.toml | 35 +++--- pallets/refungible/src/erc.rs | 47 ------- pallets/refungible/src/erc20.rs | 204 +++++++++++++++++++++++++++++++ pallets/refungible/src/erc721.rs | 32 +++++ pallets/refungible/src/lib.rs | 96 ++++++++++++--- runtime/common/src/dispatch.rs | 2 +- 7 files changed, 337 insertions(+), 82 deletions(-) delete mode 100644 pallets/refungible/src/erc.rs create mode 100644 pallets/refungible/src/erc20.rs create mode 100644 pallets/refungible/src/erc721.rs diff --git a/Cargo.lock b/Cargo.lock index 1d022ee0c3..6e3234d2c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6322,11 +6322,14 @@ dependencies = [ name = "pallet-refungible" version = "0.1.1" dependencies = [ + "ethereum", + "evm-coder", "frame-benchmarking", "frame-support", "frame-system", "pallet-common", "pallet-evm", + "pallet-evm-coder-substrate", "pallet-structure", "parity-scale-codec 3.1.5", "scale-info", diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index a8ad85fe7a..c3ad82eed2 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -11,36 +11,43 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +evm-coder = { default-features = false, path = '../../crates/evm-coder' } +pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } +struct-versioning = { path = "../../crates/struct-versioning" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } + +ethereum = { version = "0.12.0", default-features = false } +scale-info = { version = "2.0.1", default-features = false, features = ["derive",] } + frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -scale-info = { version = "2.0.1", default-features = false, features = [ - "derive", -] } -struct-versioning = { path = "../../crates/struct-versioning" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } [features] default = ["std"] std = [ + "ethereum/std", + "evm-coder/std", + 'frame-benchmarking/std', "frame-support/std", "frame-system/std", + "pallet-common/std", + "pallet-evm/std", + "pallet-evm-coder-substrate/std", + "pallet-structure/std", "sp-runtime/std", "sp-std/std", "up-data-structs/std", - "pallet-common/std", - "pallet-structure/std", - 'frame-benchmarking/std', - "pallet-evm/std", ] runtime-benchmarks = [ 'frame-benchmarking', 'frame-support/runtime-benchmarks', 'frame-system/runtime-benchmarks', + 'up-data-structs/runtime-benchmarks', ] diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs deleted file mode 100644 index 022d5c98d7..0000000000 --- a/pallets/refungible/src/erc.rs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -use up_data_structs::TokenId; -use pallet_common::erc::CommonEvmHandler; -use pallet_evm::PrecompileHandle; - -use crate::{Config, RefungibleHandle}; - -impl CommonEvmHandler for RefungibleHandle { - const CODE: &'static [u8] = include_bytes!("./stubs/UniqueRefungible.raw"); - - fn call( - self, - _handle: &mut impl PrecompileHandle, - ) -> Option { - // TODO: Implement RFT variant of ERC721 - None - } -} - -pub struct RefungibleTokenHandle(pub RefungibleHandle, pub TokenId); - -impl CommonEvmHandler for RefungibleTokenHandle { - const CODE: &'static [u8] = include_bytes!("./stubs/UniqueRefungibleToken.raw"); - - fn call( - self, - _handle: &mut impl PrecompileHandle, - ) -> Option { - // TODO: Implement RFT variant of ERC20 - None - } -} diff --git a/pallets/refungible/src/erc20.rs b/pallets/refungible/src/erc20.rs new file mode 100644 index 0000000000..a16fdec1f4 --- /dev/null +++ b/pallets/refungible/src/erc20.rs @@ -0,0 +1,204 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +extern crate alloc; +use core::{ + char::{REPLACEMENT_CHARACTER, decode_utf16}, + convert::TryInto, + ops::Deref, +}; +use evm_coder::{ToLog, execution::*, generate_stubgen, solidity_interface, types::*, weight}; +use pallet_common::{ + CommonWeightInfo, + erc::{CommonEvmHandler, PrecompileResult}, +}; +use pallet_evm::{account::CrossAccountId, PrecompileHandle}; +use pallet_evm_coder_substrate::{call, dispatch_to_evm, WithRecorder}; +use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _}; +use sp_std::vec::Vec; +use up_data_structs::{CollectionMode, TokenId}; + +use crate::{ + Allowance, Balance, common::CommonWeights, Config, erc721::UniqueRFTCall, Pallet, + RefungibleHandle, SelfWeightOf, weights::WeightInfo, TotalSupply, +}; + +pub struct RefungibleTokenHandle(pub RefungibleHandle, pub TokenId); + +#[derive(ToLog)] +pub enum ERC20Events { + Transfer { + #[indexed] + from: address, + #[indexed] + to: address, + value: uint256, + }, + Approval { + #[indexed] + owner: address, + #[indexed] + spender: address, + value: uint256, + }, +} + +#[solidity_interface(name = "ERC20", events(ERC20Events))] +impl RefungibleTokenHandle { + fn name(&self) -> Result { + Ok(decode_utf16(self.name.iter().copied()) + .map(|r| r.unwrap_or(REPLACEMENT_CHARACTER)) + .collect::()) + } + fn symbol(&self) -> Result { + Ok(string::from_utf8_lossy(&self.token_prefix).into()) + } + fn total_supply(&self) -> Result { + self.consume_store_reads(1)?; + Ok(>::get((self.id, self.1)).into()) + } + + fn decimals(&self) -> Result { + Ok(if let CollectionMode::Fungible(decimals) = &self.mode { + *decimals + } else { + unreachable!() + }) + } + fn balance_of(&self, owner: address) -> Result { + self.consume_store_reads(1)?; + let owner = T::CrossAccountId::from_eth(owner); + let balance = >::get((self.id, self.1, owner)); + Ok(balance.into()) + } + #[weight(>::transfer())] + fn transfer(&mut self, caller: caller, to: address, amount: uint256) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let to = T::CrossAccountId::from_eth(to); + let amount = amount.try_into().map_err(|_| "amount overflow")?; + let budget = self + .recorder + .weight_calls_budget(>::find_parent()); + + >::transfer(self, &caller, &to, self.1, amount, &budget) + .map_err(|_| "transfer error")?; + Ok(true) + } + #[weight(>::transfer_from())] + fn transfer_from( + &mut self, + caller: caller, + from: address, + to: address, + amount: uint256, + ) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let from = T::CrossAccountId::from_eth(from); + let to = T::CrossAccountId::from_eth(to); + let amount = amount.try_into().map_err(|_| "amount overflow")?; + let budget = self + .recorder + .weight_calls_budget(>::find_parent()); + + >::transfer_from(self, &caller, &from, &to, self.1, amount, &budget) + .map_err(dispatch_to_evm::)?; + Ok(true) + } + #[weight(>::approve())] + fn approve(&mut self, caller: caller, spender: address, amount: uint256) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let spender = T::CrossAccountId::from_eth(spender); + let amount = amount.try_into().map_err(|_| "amount overflow")?; + + >::set_allowance(self, &caller, &spender, self.1, amount) + .map_err(dispatch_to_evm::)?; + Ok(true) + } + fn allowance(&self, owner: address, spender: address) -> Result { + self.consume_store_reads(1)?; + let owner = T::CrossAccountId::from_eth(owner); + let spender = T::CrossAccountId::from_eth(spender); + + Ok(>::get((self.id, self.1, owner, spender)).into()) + } +} + +#[solidity_interface(name = "ERC20UniqueExtensions")] +impl RefungibleTokenHandle { + #[weight(>::burn_from())] + fn burn_from(&mut self, caller: caller, from: address, amount: uint256) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let from = T::CrossAccountId::from_eth(from); + let amount = amount.try_into().map_err(|_| "amount overflow")?; + let budget = self + .recorder + .weight_calls_budget(>::find_parent()); + + >::burn_from(self, &caller, &from, self.1, amount, &budget) + .map_err(dispatch_to_evm::)?; + Ok(true) + } +} + +impl RefungibleTokenHandle { + pub fn into_inner(self) -> RefungibleHandle { + self.0 + } + pub fn common_mut(&mut self) -> &mut RefungibleHandle { + &mut self.0 + } +} + +impl WithRecorder for RefungibleTokenHandle { + fn recorder(&self) -> &pallet_evm_coder_substrate::SubstrateRecorder { + self.0.recorder() + } + fn into_recorder(self) -> pallet_evm_coder_substrate::SubstrateRecorder { + self.0.into_recorder() + } +} + +impl Deref for RefungibleTokenHandle { + type Target = RefungibleHandle; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +#[solidity_interface( + name = "UniqueRefungibleToken", + is( + ERC20, + ERC20UniqueExtensions, + via("RefungibleHandle", common_mut, UniqueRFT) + ) +)] +impl RefungibleTokenHandle where T::AccountId: From<[u8; 32]> {} + +generate_stubgen!(gen_impl, UniqueRefungibleTokenCall<()>, true); +generate_stubgen!(gen_iface, UniqueRefungibleTokenCall<()>, false); + +impl CommonEvmHandler for RefungibleTokenHandle +where + T::AccountId: From<[u8; 32]>, +{ + const CODE: &'static [u8] = include_bytes!("./stubs/UniqueRefungibleToken.raw"); + + fn call(self, handle: &mut impl PrecompileHandle) -> Option { + call::, _, _>(handle, self) + } +} diff --git a/pallets/refungible/src/erc721.rs b/pallets/refungible/src/erc721.rs new file mode 100644 index 0000000000..b3b87c07b1 --- /dev/null +++ b/pallets/refungible/src/erc721.rs @@ -0,0 +1,32 @@ +extern crate alloc; +use evm_coder::{generate_stubgen, solidity_interface, types::*}; + +use pallet_common::{CollectionHandle, erc::CollectionCall, erc::CommonEvmHandler}; + +use pallet_evm::PrecompileHandle; +use pallet_evm_coder_substrate::call; + +use crate::{Config, RefungibleHandle}; + +#[solidity_interface( + name = "UniqueRFT", + is(via("CollectionHandle", common_mut, Collection),) +)] +impl RefungibleHandle where T::AccountId: From<[u8; 32]> {} + +// Not a tests, but code generators +generate_stubgen!(gen_impl, UniqueRFTCall<()>, true); +generate_stubgen!(gen_iface, UniqueRFTCall<()>, false); + +impl CommonEvmHandler for RefungibleHandle +where + T::AccountId: From<[u8; 32]>, +{ + const CODE: &'static [u8] = include_bytes!("./stubs/UniqueRefungible.raw"); + fn call( + self, + handle: &mut impl PrecompileHandle, + ) -> Option { + call::, _, _>(handle, self) + } +} diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index c8dde50b11..93576923b7 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -87,30 +87,31 @@ #![cfg_attr(not(feature = "std"), no_std)] -use frame_support::{ensure, fail, BoundedVec, transactional, storage::with_transaction}; -use up_data_structs::{ - AccessMode, CollectionId, CustomDataLimit, MAX_REFUNGIBLE_PIECES, TokenId, - CreateCollectionData, CreateRefungibleExData, mapping::TokenAddressMapping, budget::Budget, - Property, PropertyScope, TrySetProperty, PropertyKey, PropertyValue, PropertyPermission, - PropertyKeyPermission, -}; -use pallet_evm::account::CrossAccountId; -use pallet_common::{ - Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, - CommonCollectionOperations as _, -}; +use crate::erc20::ERC20Events; + +use codec::{Encode, Decode, MaxEncodedLen}; +use core::ops::Deref; +use evm_coder::ToLog; +use frame_support::{BoundedVec, ensure, fail, storage::with_transaction, transactional}; +use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; +use pallet_evm_coder_substrate::WithRecorder; +use pallet_common::{CommonCollectionOperations, Error as CommonError, Event as CommonEvent, Pallet as PalletCommon}; use pallet_structure::Pallet as PalletStructure; +use scale_info::TypeInfo; +use sp_core::H160; use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome}; use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap}; -use core::ops::Deref; -use codec::{Encode, Decode, MaxEncodedLen}; -use scale_info::TypeInfo; +use up_data_structs::{ + AccessMode, budget::Budget, CollectionId, CreateCollectionData, CreateRefungibleExData, CustomDataLimit, mapping::TokenAddressMapping, MAX_REFUNGIBLE_PIECES, TokenId, + Property, PropertyKey, PropertyKeyPermission, PropertyPermission, PropertyScope, PropertyValue, TrySetProperty +}; pub use pallet::*; #[cfg(feature = "runtime-benchmarks")] pub mod benchmarking; pub mod common; -pub mod erc; +pub mod erc20; +pub mod erc721; pub mod weights; pub(crate) type SelfWeightOf = ::WeightInfo; @@ -271,7 +272,11 @@ impl RefungibleHandle { pub fn into_inner(self) -> pallet_common::CollectionHandle { self.0 } + pub fn common_mut(&mut self) -> &mut pallet_common::CollectionHandle { + &mut self.0 + } } + impl Deref for RefungibleHandle { type Target = pallet_common::CollectionHandle; @@ -280,6 +285,15 @@ impl Deref for RefungibleHandle { } } +impl WithRecorder for RefungibleHandle { + fn recorder(&self) -> &pallet_evm_coder_substrate::SubstrateRecorder { + self.0.recorder() + } + fn into_recorder(self) -> pallet_evm_coder_substrate::SubstrateRecorder { + self.0.into_recorder() + } +} + impl Pallet { /// Get number of RFT tokens in collection pub fn total_supply(collection: &RefungibleHandle) -> u32 { @@ -460,7 +474,18 @@ impl Pallet { >::insert((collection.id, token, owner), balance); } >::insert((collection.id, token), total_supply); - // TODO: ERC20 transfer event + + >::deposit_log( + ERC20Events::Transfer { + from: *owner.as_eth(), + to: H160::default(), + value: amount.into(), + } + .to_log(T::EvmTokenAddressMapping::token_to_address( + collection.id, + token, + )), + ); >::deposit_event(CommonEvent::ItemDestroyed( collection.id, token, @@ -736,7 +761,17 @@ impl Pallet { } } - // TODO: ERC20 transfer event + >::deposit_log( + ERC20Events::Transfer { + from: *from.as_eth(), + to: *to.as_eth(), + value: amount.into(), + } + .to_log(T::EvmTokenAddressMapping::token_to_address( + collection.id, + token, + )), + ); >::deposit_event(CommonEvent::Transfer( collection.id, token, @@ -889,7 +924,17 @@ impl Pallet { continue; } - // TODO: ERC20 transfer event + >::deposit_log( + ERC20Events::Transfer { + from: H160::default(), + to: *user.as_eth(), + value: amount.into(), + } + .to_log(T::EvmTokenAddressMapping::token_to_address( + collection.id, + TokenId(token_id), + )), + ); >::deposit_event(CommonEvent::ItemCreated( collection.id, TokenId(token_id), @@ -913,7 +958,18 @@ impl Pallet { } else { >::insert((collection.id, token, sender, spender), amount); } - // TODO: ERC20 approval event + + >::deposit_log( + ERC20Events::Approval { + owner: *sender.as_eth(), + spender: *spender.as_eth(), + value: amount.into(), + } + .to_log(T::EvmTokenAddressMapping::token_to_address( + collection.id, + token, + )), + ); >::deposit_event(CommonEvent::Approved( collection.id, token, diff --git a/runtime/common/src/dispatch.rs b/runtime/common/src/dispatch.rs index 8e509b7054..adf85ae10a 100644 --- a/runtime/common/src/dispatch.rs +++ b/runtime/common/src/dispatch.rs @@ -25,7 +25,7 @@ use pallet_common::{ pub use pallet_common::dispatch::CollectionDispatch; use pallet_fungible::{Pallet as PalletFungible, FungibleHandle}; use pallet_nonfungible::{Pallet as PalletNonfungible, NonfungibleHandle}; -use pallet_refungible::{Pallet as PalletRefungible, RefungibleHandle, erc::RefungibleTokenHandle}; +use pallet_refungible::{Pallet as PalletRefungible, RefungibleHandle, erc20::RefungibleTokenHandle}; use up_data_structs::{ CollectionMode, CreateCollectionData, MAX_DECIMAL_POINTS, mapping::TokenAddressMapping, }; From b049e8dff163d5b02a001d4006ccd27d4fd5f462 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 22 Jul 2022 05:21:08 +0000 Subject: [PATCH 0082/1274] added evm-stubs for refungible erc20 token --- Makefile | 16 +- .../src/stubs/UniqueRefungibleToken.raw | Bin 5 -> 2777 bytes .../src/stubs/UniqueRefungibleToken.sol | 281 ++++++++++++++++ tests/src/eth/api/UniqueRefungibleToken.sol | 140 ++++++++ tests/src/eth/reFungibleTokenAbi.json | 305 ++++++++++++++++++ 5 files changed, 740 insertions(+), 2 deletions(-) create mode 100644 pallets/refungible/src/stubs/UniqueRefungibleToken.sol create mode 100644 tests/src/eth/api/UniqueRefungibleToken.sol create mode 100644 tests/src/eth/reFungibleTokenAbi.json diff --git a/Makefile b/Makefile index 6df32def75..bb2c90f239 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,10 @@ FUNGIBLE_EVM_ABI=./tests/src/eth/fungibleAbi.json NONFUNGIBLE_EVM_STUBS=./pallets/nonfungible/src/stubs NONFUNGIBLE_EVM_ABI=./tests/src/eth/nonFungibleAbi.json +REFUNGIBLE_EVM_STUBS=./pallets/refungible/src/stubs +RENFUNGIBLE_EVM_ABI=./tests/src/eth/reFungibleAbi.json +RENFUNGIBLE_TOKEN_EVM_ABI=./tests/src/eth/reFungibleTokenAbi.json + CONTRACT_HELPERS_STUBS=./pallets/evm-contract-helpers/src/stubs/ CONTRACT_HELPERS_ABI=./tests/src/eth/util/contractHelpersAbi.json @@ -21,7 +25,7 @@ COLLECTION_HELPER_ABI=./tests/src/eth/collectionHelpersAbi.json TESTS_API=./tests/src/eth/api/ .PHONY: regenerate_solidity -regenerate_solidity: UniqueFungible.sol UniqueNFT.sol ContractHelpers.sol CollectionHelpers.sol +regenerate_solidity: UniqueFungible.sol UniqueNFT.sol UniqueRefungibleToken.sol ContractHelpers.sol CollectionHelpers.sol UniqueFungible.sol: PACKAGE=pallet-fungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh @@ -30,6 +34,10 @@ UniqueFungible.sol: UniqueNFT.sol: PACKAGE=pallet-nonfungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh PACKAGE=pallet-nonfungible NAME=erc::gen_impl OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh + +UniqueRefungibleToken.sol: + PACKAGE=pallet-refungible NAME=erc20::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh + PACKAGE=pallet-refungible NAME=erc20::gen_impl OUTPUT=$(REFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh ContractHelpers.sol: PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh @@ -47,6 +55,10 @@ UniqueNFT: UniqueNFT.sol INPUT=$(NONFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/UniqueNFT.raw ./.maintain/scripts/compile_stub.sh INPUT=$(NONFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(NONFUNGIBLE_EVM_ABI) ./.maintain/scripts/generate_abi.sh +UniqueRefungibleToken: UniqueRefungibleToken.sol + INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_EVM_STUBS)/UniqueRefungibleToken.raw ./.maintain/scripts/compile_stub.sh + INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(RENFUNGIBLE_TOKEN_EVM_ABI) ./.maintain/scripts/generate_abi.sh + ContractHelpers: ContractHelpers.sol INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_STUBS)/ContractHelpers.raw ./.maintain/scripts/compile_stub.sh INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_ABI) ./.maintain/scripts/generate_abi.sh @@ -55,7 +67,7 @@ CollectionHelpers: CollectionHelpers.sol INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_STUBS)/CollectionHelpers.raw ./.maintain/scripts/compile_stub.sh INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_ABI) ./.maintain/scripts/generate_abi.sh -evm_stubs: UniqueFungible UniqueNFT ContractHelpers CollectionHelpers +evm_stubs: UniqueFungible UniqueNFT UniqueRefungibleToken ContractHelpers CollectionHelpers .PHONY: _bench _bench: diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.raw b/pallets/refungible/src/stubs/UniqueRefungibleToken.raw index 1333ed77b7e1ed056329cae96075dc558158ee69..40aec49035b725c486c079101ccb6f1dfde191a4 100644 GIT binary patch literal 2777 zcmaJ@du$X%9NuB?_6~@#h4yH@nqGM5A3hNADg+{jh}KAS?`&_0i)N-rsU=VzZAcIa z`@DiCy4RKp(L{pAh8Pl+Y6wLAM?sKBd?cD6uLKBSOo$|ak5a#x-Md~<*~=y0%zVH3 zJ?A$=&(Ktc-a`%3%y?|v9=c;TB_5ONJ&Q@-Wp(utqnb(gYg96Zbd?b=tLL6=+^~k8 ziBl;<=hIMzPNmY2PKjyOc~;C|(h`ksvSI~QrwOaVl$rFZRxUHSB%>BQHLKHls}een zKnIMV2{S?KT|&ckCZUOZ1(tScssWmqv27IY^JT5ngv_$o$b!UCt7k+`P1Hc9JLs-<$? zi`Ui0C~>{`B)1t#Atbp)J8Sc?f^KnZNQ<^PPtsO%pF{c(!UFLe!pH(x=30E+(7Iic z7JF{?;`Bxg+nUYXW>p2>j1#XJ=CiR?1|#oMX*QLv-lPW7BT`Tiq=1GRDi}G2QIeji zGjeUta~CQZ328>I=UmIdN+#_DJU(@3CE%I>R(6h`2dn^V`STg{R7Bx(d%v%O0xjU)GzyAPy zCV*gd1J1W!Tm-lkP7z>6R$L#JerDl}9M zP7xy)7&+TOLrne<`Icv8bqSMyF>*~z9_5ouP-dyLS6$63jc{xfWbdlZ#?&x*y;x*p zA_b3yo&dch9O}Sm%$$riIqhOI_wo<?Xe13}2IuDkKkUdi;UAg!%RX8K{J(W%^2VCfIp8`m^PdYmHbv0x?4kEbcspQd7D@yLs*EQ z)$tA&nhp_~u)7J#=qjxzw7xdhE9+ic@q6rsfLb9OJltYr9 z+QWbUdx50VxCw;yCTSZEKC{xYDkfF4@I(!N7W$FrFB8PO#Ig~Ga1xB9V6bo_t#`y$ z2m%XT&g!0OnHk%*31{Mh;s?>Pct9TI(Q|A>uaqSVcLJHf!cO3pe89Go!kus&`bUBk z4&r7dOQsn7G7EnZNQMvRkr)>4L=C8Xhh#zZ8E1TkYQs#ExD#3U_drG=t_5wlJ-9Yx z5J407WT|=-l!LgBleZL}(%>(ktcGu?r&3~-7m9jvwkS@dCt)Bzqg_yf{F`}PxOqPy z%GTocqVkjhjVS{n;sy=J3o29gB9J29xXBABHd1g*;%#vd6XknfxYs4Uy6xghRIWq* zqAO~|%J6y5#oI&q3H8~}uSIxN6$zIs{b;>i;d zhxa!mk6k@lvs-3e2yCz>% diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.sol b/pallets/refungible/src/stubs/UniqueRefungibleToken.sol new file mode 100644 index 0000000000..407510a684 --- /dev/null +++ b/pallets/refungible/src/stubs/UniqueRefungibleToken.sol @@ -0,0 +1,281 @@ +// SPDX-License-Identifier: OTHER +// This code is automatically generated + +pragma solidity >=0.8.0 <0.9.0; + +// Common stubs holder +contract Dummy { + uint8 dummy; + string stub_error = "this contract is implemented in native"; +} + +contract ERC165 is Dummy { + function supportsInterface(bytes4 interfaceID) + external + view + returns (bool) + { + require(false, stub_error); + interfaceID; + return true; + } +} + +// Inline +contract ERC20Events { + event Transfer(address indexed from, address indexed to, uint256 value); + event Approval( + address indexed owner, + address indexed spender, + uint256 value + ); +} + +// Selector: 79cc6790 +contract ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) public returns (bool) { + require(false, stub_error); + from; + amount; + dummy = 0; + return false; + } +} + +// Selector: 7d9262e6 +contract Collection is Dummy, ERC165 { + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + public + { + require(false, stub_error); + key; + value; + dummy = 0; + } + + // Selector: deleteCollectionProperty(string) 7b7debce + function deleteCollectionProperty(string memory key) public { + require(false, stub_error); + key; + dummy = 0; + } + + // Throws error if key not found + // + // Selector: collectionProperty(string) cf24fd6d + function collectionProperty(string memory key) + public + view + returns (bytes memory) + { + require(false, stub_error); + key; + dummy; + return hex""; + } + + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) public { + require(false, stub_error); + sponsor; + dummy = 0; + } + + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() public { + require(false, stub_error); + dummy = 0; + } + + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) public { + require(false, stub_error); + limit; + value; + dummy = 0; + } + + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) public { + require(false, stub_error); + limit; + value; + dummy = 0; + } + + // Selector: contractAddress() f6b4dfb4 + function contractAddress() public view returns (address) { + require(false, stub_error); + dummy; + return 0x0000000000000000000000000000000000000000; + } + + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) public view { + require(false, stub_error); + newAdmin; + dummy; + } + + // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + function removeCollectionAdminSubstrate(uint256 newAdmin) public view { + require(false, stub_error); + newAdmin; + dummy; + } + + // Selector: addCollectionAdmin(address) 92e462c7 + function addCollectionAdmin(address newAdmin) public view { + require(false, stub_error); + newAdmin; + dummy; + } + + // Selector: removeCollectionAdmin(address) fafd7b42 + function removeCollectionAdmin(address admin) public view { + require(false, stub_error); + admin; + dummy; + } + + // Selector: setCollectionNesting(bool) 112d4586 + function setCollectionNesting(bool enable) public { + require(false, stub_error); + enable; + dummy = 0; + } + + // Selector: setCollectionNesting(bool,address[]) 64872396 + function setCollectionNesting(bool enable, address[] memory collections) + public + { + require(false, stub_error); + enable; + collections; + dummy = 0; + } + + // Selector: setCollectionAccess(uint8) 41835d4c + function setCollectionAccess(uint8 mode) public { + require(false, stub_error); + mode; + dummy = 0; + } + + // Selector: addToCollectionAllowList(address) 67844fe6 + function addToCollectionAllowList(address user) public view { + require(false, stub_error); + user; + dummy; + } + + // Selector: removeFromCollectionAllowList(address) 85c51acb + function removeFromCollectionAllowList(address user) public view { + require(false, stub_error); + user; + dummy; + } + + // Selector: setCollectionMintMode(bool) 00018e84 + function setCollectionMintMode(bool mode) public { + require(false, stub_error); + mode; + dummy = 0; + } +} + +// Selector: 942e8b22 +contract ERC20 is Dummy, ERC165, ERC20Events { + // Selector: name() 06fdde03 + function name() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: symbol() 95d89b41 + function symbol() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: decimals() 313ce567 + function decimals() public view returns (uint8) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) public view returns (uint256) { + require(false, stub_error); + owner; + dummy; + return 0; + } + + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 amount) public returns (bool) { + require(false, stub_error); + to; + amount; + dummy = 0; + return false; + } + + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 amount + ) public returns (bool) { + require(false, stub_error); + from; + to; + amount; + dummy = 0; + return false; + } + + // Selector: approve(address,uint256) 095ea7b3 + function approve(address spender, uint256 amount) public returns (bool) { + require(false, stub_error); + spender; + amount; + dummy = 0; + return false; + } + + // Selector: allowance(address,address) dd62ed3e + function allowance(address owner, address spender) + public + view + returns (uint256) + { + require(false, stub_error); + owner; + spender; + dummy; + return 0; + } +} + +contract UniqueRFT is Dummy, ERC165, Collection {} + +contract UniqueRefungibleToken is + Dummy, + ERC165, + ERC20, + ERC20UniqueExtensions, + UniqueRFT +{} diff --git a/tests/src/eth/api/UniqueRefungibleToken.sol b/tests/src/eth/api/UniqueRefungibleToken.sol new file mode 100644 index 0000000000..60b6a60a3f --- /dev/null +++ b/tests/src/eth/api/UniqueRefungibleToken.sol @@ -0,0 +1,140 @@ +// SPDX-License-Identifier: OTHER +// This code is automatically generated + +pragma solidity >=0.8.0 <0.9.0; + +// Common stubs holder +interface Dummy { + +} + +interface ERC165 is Dummy { + function supportsInterface(bytes4 interfaceID) external view returns (bool); +} + +// Inline +interface ERC20Events { + event Transfer(address indexed from, address indexed to, uint256 value); + event Approval( + address indexed owner, + address indexed spender, + uint256 value + ); +} + +// Selector: 79cc6790 +interface ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) external returns (bool); +} + +// Selector: 7d9262e6 +interface Collection is Dummy, ERC165 { + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + external; + + // Selector: deleteCollectionProperty(string) 7b7debce + function deleteCollectionProperty(string memory key) external; + + // Throws error if key not found + // + // Selector: collectionProperty(string) cf24fd6d + function collectionProperty(string memory key) + external + view + returns (bytes memory); + + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) external; + + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() external; + + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) external; + + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) external; + + // Selector: contractAddress() f6b4dfb4 + function contractAddress() external view returns (address); + + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) external view; + + // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + function removeCollectionAdminSubstrate(uint256 newAdmin) external view; + + // Selector: addCollectionAdmin(address) 92e462c7 + function addCollectionAdmin(address newAdmin) external view; + + // Selector: removeCollectionAdmin(address) fafd7b42 + function removeCollectionAdmin(address admin) external view; + + // Selector: setCollectionNesting(bool) 112d4586 + function setCollectionNesting(bool enable) external; + + // Selector: setCollectionNesting(bool,address[]) 64872396 + function setCollectionNesting(bool enable, address[] memory collections) + external; + + // Selector: setCollectionAccess(uint8) 41835d4c + function setCollectionAccess(uint8 mode) external; + + // Selector: addToCollectionAllowList(address) 67844fe6 + function addToCollectionAllowList(address user) external view; + + // Selector: removeFromCollectionAllowList(address) 85c51acb + function removeFromCollectionAllowList(address user) external view; + + // Selector: setCollectionMintMode(bool) 00018e84 + function setCollectionMintMode(bool mode) external; +} + +// Selector: 942e8b22 +interface ERC20 is Dummy, ERC165, ERC20Events { + // Selector: name() 06fdde03 + function name() external view returns (string memory); + + // Selector: symbol() 95d89b41 + function symbol() external view returns (string memory); + + // Selector: totalSupply() 18160ddd + function totalSupply() external view returns (uint256); + + // Selector: decimals() 313ce567 + function decimals() external view returns (uint8); + + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) external view returns (uint256); + + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 amount) external returns (bool); + + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 amount + ) external returns (bool); + + // Selector: approve(address,uint256) 095ea7b3 + function approve(address spender, uint256 amount) external returns (bool); + + // Selector: allowance(address,address) dd62ed3e + function allowance(address owner, address spender) + external + view + returns (uint256); +} + +interface UniqueRFT is Dummy, ERC165, Collection {} + +interface UniqueRefungibleToken is + Dummy, + ERC165, + ERC20, + ERC20UniqueExtensions, + UniqueRFT +{} diff --git a/tests/src/eth/reFungibleTokenAbi.json b/tests/src/eth/reFungibleTokenAbi.json new file mode 100644 index 0000000000..86f473726e --- /dev/null +++ b/tests/src/eth/reFungibleTokenAbi.json @@ -0,0 +1,305 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { "internalType": "address", "name": "newAdmin", "type": "address" } + ], + "name": "addCollectionAdmin", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "newAdmin", "type": "uint256" } + ], + "name": "addCollectionAdminSubstrate", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "addToCollectionAllowList", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "burnFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], + "name": "collectionProperty", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "confirmCollectionSponsorship", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "contractAddress", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], + "name": "deleteCollectionProperty", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "admin", "type": "address" } + ], + "name": "removeCollectionAdmin", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "newAdmin", "type": "uint256" } + ], + "name": "removeCollectionAdminSubstrate", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "removeFromCollectionAllowList", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint8", "name": "mode", "type": "uint8" }], + "name": "setCollectionAccess", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "limit", "type": "string" }, + { "internalType": "uint32", "name": "value", "type": "uint32" } + ], + "name": "setCollectionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "limit", "type": "string" }, + { "internalType": "bool", "name": "value", "type": "bool" } + ], + "name": "setCollectionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "mode", "type": "bool" }], + "name": "setCollectionMintMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }], + "name": "setCollectionNesting", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bool", "name": "enable", "type": "bool" }, + { + "internalType": "address[]", + "name": "collections", + "type": "address[]" + } + ], + "name": "setCollectionNesting", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "key", "type": "string" }, + { "internalType": "bytes", "name": "value", "type": "bytes" } + ], + "name": "setCollectionProperty", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "sponsor", "type": "address" } + ], + "name": "setCollectionSponsor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" } + ], + "name": "supportsInterface", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + } +] From 0f86ef07553fbbd27894e5536af50adebf23942e Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 22 Jul 2022 05:21:08 +0000 Subject: [PATCH 0083/1274] integration tests for erc20 --- tests/src/eth/reFungibleToken.test.ts | 352 ++++++++++++++++++++++++++ 1 file changed, 352 insertions(+) create mode 100644 tests/src/eth/reFungibleToken.test.ts diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts new file mode 100644 index 0000000000..93390f0df8 --- /dev/null +++ b/tests/src/eth/reFungibleToken.test.ts @@ -0,0 +1,352 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import {approve, createCollection, createRefungibleToken, transfer, transferFrom, UNIQUE} from '../util/helpers'; +import {createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth} from './util/helpers'; +import reFungibleTokenAbi from './reFungibleTokenAbi.json'; + +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; +chai.use(chaiAsPromised); +const expect = chai.expect; + +describe('Refungible token: Information getting', () => { + itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; + + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: caller})).itemId; + + const address = tokenIdToAddress(collectionId, tokenId); + const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: caller, ...GAS_ARGS}); + const totalSupply = await contract.methods.totalSupply().call(); + + expect(totalSupply).to.equal('200'); + }); + + itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; + + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: caller})).itemId; + + const address = tokenIdToAddress(collectionId, tokenId); + const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: caller, ...GAS_ARGS}); + const balance = await contract.methods.balanceOf(caller).call(); + + expect(balance).to.equal('200'); + }); +}); + +describe('Refungible: Plain calls', () => { + itWeb3('Can perform approve()', async ({web3, api, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; + + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: owner})).itemId; + + const address = tokenIdToAddress(collectionId, tokenId); + + const spender = createEthAccount(web3); + + const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + + { + const result = await contract.methods.approve(spender, 100).send({from: owner}); + const events = normalizeEvents(result.events); + + expect(events).to.be.deep.equal([ + { + address, + event: 'Approval', + args: { + owner, + spender, + value: '100', + }, + }, + ]); + } + + { + const allowance = await contract.methods.allowance(owner, spender).call(); + expect(+allowance).to.equal(100); + } + }); + + itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; + + const owner = createEthAccount(web3); + await transferBalanceToEth(api, alice, owner); + + const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: owner})).itemId; + + const spender = createEthAccount(web3); + await transferBalanceToEth(api, alice, spender); + + const receiver = createEthAccount(web3); + + const address = tokenIdToAddress(collectionId, tokenId); + const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + + await contract.methods.approve(spender, 100).send(); + + { + const result = await contract.methods.transferFrom(owner, receiver, 49).send({from: spender}); + const events = normalizeEvents(result.events); + expect(events).to.be.deep.equal([ + { + address, + event: 'Transfer', + args: { + from: owner, + to: receiver, + value: '49', + }, + }, + { + address, + event: 'Approval', + args: { + owner, + spender, + value: '51', + }, + }, + ]); + } + + { + const balance = await contract.methods.balanceOf(receiver).call(); + expect(+balance).to.equal(49); + } + + { + const balance = await contract.methods.balanceOf(owner).call(); + expect(+balance).to.equal(151); + } + }); + + itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; + + const owner = createEthAccount(web3); + await transferBalanceToEth(api, alice, owner); + + const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: owner})).itemId; + + const receiver = createEthAccount(web3); + await transferBalanceToEth(api, alice, receiver); + + const address = tokenIdToAddress(collectionId, tokenId); + const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + + { + const result = await contract.methods.transfer(receiver, 50).send({from: owner}); + const events = normalizeEvents(result.events); + expect(events).to.be.deep.equal([ + { + address, + event: 'Transfer', + args: { + from: owner, + to: receiver, + value: '50', + }, + }, + ]); + } + + { + const balance = await contract.methods.balanceOf(owner).call(); + expect(+balance).to.equal(150); + } + + { + const balance = await contract.methods.balanceOf(receiver).call(); + expect(+balance).to.equal(50); + } + }); +}); + +describe('Refungible: Fees', () => { + itWeb3('approve() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; + + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const spender = createEthAccount(web3); + + const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: owner})).itemId; + + const address = tokenIdToAddress(collectionId, tokenId); + const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + + const cost = await recordEthFee(api, owner, () => contract.methods.approve(spender, 100).send({from: owner})); + expect(cost < BigInt(0.2 * Number(UNIQUE))); + }); + + itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; + + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const spender = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: owner})).itemId; + + const address = tokenIdToAddress(collectionId, tokenId); + const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + + await contract.methods.approve(spender, 100).send({from: owner}); + + const cost = await recordEthFee(api, spender, () => contract.methods.transferFrom(owner, spender, 100).send({from: spender})); + expect(cost < BigInt(0.2 * Number(UNIQUE))); + }); + + itWeb3('transfer() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; + + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const receiver = createEthAccount(web3); + + const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: owner})).itemId; + + const address = tokenIdToAddress(collectionId, tokenId); + const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + + const cost = await recordEthFee(api, owner, () => contract.methods.transfer(receiver, 100).send({from: owner})); + expect(cost < BigInt(0.2 * Number(UNIQUE))); + }); +}); + +describe('Refungible: Substrate calls', () => { + itWeb3('Events emitted for approve()', async ({web3, api, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; + + const receiver = createEthAccount(web3); + + const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n)).itemId; + + const address = tokenIdToAddress(collectionId, tokenId); + const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address); + + const events = await recordEvents(contract, async () => { + expect(await approve(api, collectionId, tokenId, alice, {Ethereum: receiver}, 100n)).to.be.true; + }); + + expect(events).to.be.deep.equal([ + { + address, + event: 'Approval', + args: { + owner: subToEth(alice.address), + spender: receiver, + value: '100', + }, + }, + ]); + }); + + itWeb3('Events emitted for transferFrom()', async ({web3, api, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; + const bob = privateKeyWrapper('//Bob'); + + const receiver = createEthAccount(web3); + + const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n)).itemId; + expect(await approve(api, collectionId, tokenId, alice, bob.address, 100n)).to.be.true; + + const address = tokenIdToAddress(collectionId, tokenId); + const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address); + + const events = await recordEvents(contract, async () => { + expect(await transferFrom(api, collectionId, tokenId, bob, alice, {Ethereum: receiver}, 51n)).to.be.true; + }); + + expect(events).to.be.deep.equal([ + { + address, + event: 'Transfer', + args: { + from: subToEth(alice.address), + to: receiver, + value: '51', + }, + }, + { + address, + event: 'Approval', + args: { + owner: subToEth(alice.address), + spender: subToEth(bob.address), + value: '49', + }, + }, + ]); + }); + + itWeb3('Events emitted for transfer()', async ({web3, api, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; + + const receiver = createEthAccount(web3); + + const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n)).itemId; + + const address = tokenIdToAddress(collectionId, tokenId); + const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address); + + const events = await recordEvents(contract, async () => { + expect(await transfer(api, collectionId, tokenId, alice, {Ethereum: receiver}, 51n)).to.be.true; + }); + + expect(events).to.be.deep.equal([ + { + address, + event: 'Transfer', + args: { + from: subToEth(alice.address), + to: receiver, + value: '51', + }, + }, + ]); + }); +}); From 898c743eda2676387fe89bad86e446570c3605d4 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 22 Jul 2022 05:21:08 +0000 Subject: [PATCH 0084/1274] fixed code review issues --- Makefile | 4 ++-- pallets/refungible/src/{erc721.rs => erc.rs} | 0 .../refungible/src/{erc20.rs => erc_token.rs} | 23 ++++++------------- pallets/refungible/src/lib.rs | 6 ++--- runtime/common/src/dispatch.rs | 4 +++- tests/src/eth/reFungibleToken.test.ts | 16 +++++++++++++ 6 files changed, 31 insertions(+), 22 deletions(-) rename pallets/refungible/src/{erc721.rs => erc.rs} (100%) rename pallets/refungible/src/{erc20.rs => erc_token.rs} (92%) diff --git a/Makefile b/Makefile index bb2c90f239..98c5dd31c4 100644 --- a/Makefile +++ b/Makefile @@ -36,8 +36,8 @@ UniqueNFT.sol: PACKAGE=pallet-nonfungible NAME=erc::gen_impl OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh UniqueRefungibleToken.sol: - PACKAGE=pallet-refungible NAME=erc20::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh - PACKAGE=pallet-refungible NAME=erc20::gen_impl OUTPUT=$(REFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh + PACKAGE=pallet-refungible NAME=erc_token::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh + PACKAGE=pallet-refungible NAME=erc_token::gen_impl OUTPUT=$(REFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh ContractHelpers.sol: PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh diff --git a/pallets/refungible/src/erc721.rs b/pallets/refungible/src/erc.rs similarity index 100% rename from pallets/refungible/src/erc721.rs rename to pallets/refungible/src/erc.rs diff --git a/pallets/refungible/src/erc20.rs b/pallets/refungible/src/erc_token.rs similarity index 92% rename from pallets/refungible/src/erc20.rs rename to pallets/refungible/src/erc_token.rs index a16fdec1f4..f10ef76543 100644 --- a/pallets/refungible/src/erc20.rs +++ b/pallets/refungible/src/erc_token.rs @@ -29,11 +29,11 @@ use pallet_evm::{account::CrossAccountId, PrecompileHandle}; use pallet_evm_coder_substrate::{call, dispatch_to_evm, WithRecorder}; use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _}; use sp_std::vec::Vec; -use up_data_structs::{CollectionMode, TokenId}; +use up_data_structs::TokenId; use crate::{ - Allowance, Balance, common::CommonWeights, Config, erc721::UniqueRFTCall, Pallet, - RefungibleHandle, SelfWeightOf, weights::WeightInfo, TotalSupply, + Allowance, Balance, common::CommonWeights, Config, Pallet, RefungibleHandle, SelfWeightOf, + weights::WeightInfo, TotalSupply, }; pub struct RefungibleTokenHandle(pub RefungibleHandle, pub TokenId); @@ -72,12 +72,10 @@ impl RefungibleTokenHandle { } fn decimals(&self) -> Result { - Ok(if let CollectionMode::Fungible(decimals) = &self.mode { - *decimals - } else { - unreachable!() - }) + // Decimals aren't supported for refungible tokens + Ok(0) } + fn balance_of(&self, owner: address) -> Result { self.consume_store_reads(1)?; let owner = T::CrossAccountId::from_eth(owner); @@ -179,14 +177,7 @@ impl Deref for RefungibleTokenHandle { } } -#[solidity_interface( - name = "UniqueRefungibleToken", - is( - ERC20, - ERC20UniqueExtensions, - via("RefungibleHandle", common_mut, UniqueRFT) - ) -)] +#[solidity_interface(name = "UniqueRefungibleToken", is(ERC20, ERC20UniqueExtensions,))] impl RefungibleTokenHandle where T::AccountId: From<[u8; 32]> {} generate_stubgen!(gen_impl, UniqueRefungibleTokenCall<()>, true); diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 93576923b7..5ead440c98 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -87,7 +87,7 @@ #![cfg_attr(not(feature = "std"), no_std)] -use crate::erc20::ERC20Events; +use crate::erc_token::ERC20Events; use codec::{Encode, Decode, MaxEncodedLen}; use core::ops::Deref; @@ -110,8 +110,8 @@ pub use pallet::*; #[cfg(feature = "runtime-benchmarks")] pub mod benchmarking; pub mod common; -pub mod erc20; -pub mod erc721; +pub mod erc; +pub mod erc_token; pub mod weights; pub(crate) type SelfWeightOf = ::WeightInfo; diff --git a/runtime/common/src/dispatch.rs b/runtime/common/src/dispatch.rs index adf85ae10a..6fc98a3380 100644 --- a/runtime/common/src/dispatch.rs +++ b/runtime/common/src/dispatch.rs @@ -25,7 +25,9 @@ use pallet_common::{ pub use pallet_common::dispatch::CollectionDispatch; use pallet_fungible::{Pallet as PalletFungible, FungibleHandle}; use pallet_nonfungible::{Pallet as PalletNonfungible, NonfungibleHandle}; -use pallet_refungible::{Pallet as PalletRefungible, RefungibleHandle, erc20::RefungibleTokenHandle}; +use pallet_refungible::{ + Pallet as PalletRefungible, RefungibleHandle, erc_token::RefungibleTokenHandle, +}; use up_data_structs::{ CollectionMode, CreateCollectionData, MAX_DECIMAL_POINTS, mapping::TokenAddressMapping, }; diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 93390f0df8..9553a420ca 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -55,6 +55,22 @@ describe('Refungible token: Information getting', () => { expect(balance).to.equal('200'); }); + + itWeb3('decimals', async ({api, web3, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; + + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: caller})).itemId; + + const address = tokenIdToAddress(collectionId, tokenId); + const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: caller, ...GAS_ARGS}); + const decimals = await contract.methods.decimals().call(); + + expect(decimals).to.equal('0'); + }); }); describe('Refungible: Plain calls', () => { From 4fbe604fc85f3b8602c409a46e667f24b4cbaefe Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 22 Jul 2022 05:21:08 +0000 Subject: [PATCH 0085/1274] updated evm stubs --- .../src/stubs/UniqueRefungibleToken.raw | Bin 2777 -> 1427 bytes .../src/stubs/UniqueRefungibleToken.sol | 153 +---------------- tests/src/eth/api/UniqueRefungibleToken.sol | 69 +------- tests/src/eth/reFungibleTokenAbi.json | 156 ------------------ 4 files changed, 2 insertions(+), 376 deletions(-) diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.raw b/pallets/refungible/src/stubs/UniqueRefungibleToken.raw index 40aec49035b725c486c079101ccb6f1dfde191a4..c6a08c12f84502bd6b48652c8cb57b1aae99df7f 100644 GIT binary patch delta 883 zcmZ`$O-K}B7@qh0R9Yil#Ti;waWje_2qd;25ZMk!645xx&S65{PY*&6SP`+8c7ApY z32JtygeXF~sF!}|QWR*X2s9!}j93xEE)@iI30mx(AH_?|<@w(4`J4CqB>UTwxQaOq z_o8W8nkVYdKS|oa_*?%LbQPsp9i=R;wwoi}J!_*aLb{+wuuVV*!Lcd3o8V!Bg@sYC zO-SDe-d?_YjNlT%+4_4g;%RmGM=x>v$kMDC<_N66nWn3U#A>Lm@K}%-ntmD!b{3T# zRl1e#4vmh*JiA`8|)2AFfM0ceJboq(MwrQ%f}N6gsO zj6$cgIn)D6PCn$D*TDRKsF>#1?Y)=ILB^=TU>)o3bR58m6$&@#t^WpYQi21_<* zo(tXt2!75VZQPY<+V=i)^XYdT;z94(xu1_N^;DJq!qu;Rmk->Wo4<4Plt0th{SSr5 BEGGZ} literal 2777 zcmaJ@du$X%9NuB?_6~@#h4yH@nqGM5A3hNADg+{jh}KAS?`&_0i)N-rsU=VzZAcIa z`@DiCy4RKp(L{pAh8Pl+Y6wLAM?sKBd?cD6uLKBSOo$|ak5a#x-Md~<*~=y0%zVH3 zJ?A$=&(Ktc-a`%3%y?|v9=c;TB_5ONJ&Q@-Wp(utqnb(gYg96Zbd?b=tLL6=+^~k8 ziBl;<=hIMzPNmY2PKjyOc~;C|(h`ksvSI~QrwOaVl$rFZRxUHSB%>BQHLKHls}een zKnIMV2{S?KT|&ckCZUOZ1(tScssWmqv27IY^JT5ngv_$o$b!UCt7k+`P1Hc9JLs-<$? zi`Ui0C~>{`B)1t#Atbp)J8Sc?f^KnZNQ<^PPtsO%pF{c(!UFLe!pH(x=30E+(7Iic z7JF{?;`Bxg+nUYXW>p2>j1#XJ=CiR?1|#oMX*QLv-lPW7BT`Tiq=1GRDi}G2QIeji zGjeUta~CQZ328>I=UmIdN+#_DJU(@3CE%I>R(6h`2dn^V`STg{R7Bx(d%v%O0xjU)GzyAPy zCV*gd1J1W!Tm-lkP7z>6R$L#JerDl}9M zP7xy)7&+TOLrne<`Icv8bqSMyF>*~z9_5ouP-dyLS6$63jc{xfWbdlZ#?&x*y;x*p zA_b3yo&dch9O}Sm%$$riIqhOI_wo<?Xe13}2IuDkKkUdi;UAg!%RX8K{J(W%^2VCfIp8`m^PdYmHbv0x?4kEbcspQd7D@yLs*EQ z)$tA&nhp_~u)7J#=qjxzw7xdhE9+ic@q6rsfLb9OJltYr9 z+QWbUdx50VxCw;yCTSZEKC{xYDkfF4@I(!N7W$FrFB8PO#Ig~Ga1xB9V6bo_t#`y$ z2m%XT&g!0OnHk%*31{Mh;s?>Pct9TI(Q|A>uaqSVcLJHf!cO3pe89Go!kus&`bUBk z4&r7dOQsn7G7EnZNQMvRkr)>4L=C8Xhh#zZ8E1TkYQs#ExD#3U_drG=t_5wlJ-9Yx z5J407WT|=-l!LgBleZL}(%>(ktcGu?r&3~-7m9jvwkS@dCt)Bzqg_yf{F`}PxOqPy z%GTocqVkjhjVS{n;sy=J3o29gB9J29xXBABHd1g*;%#vd6XknfxYs4Uy6xghRIWq* zqAO~|%J6y5#oI&q3H8~}uSIxN6$zIs{b;>i;d zhxa!mk6k@lvs-3e2yC Date: Fri, 22 Jul 2022 05:21:08 +0000 Subject: [PATCH 0086/1274] added repartition method to refungible erc20 extensions --- pallets/refungible/src/erc.rs | 16 +++++++++ pallets/refungible/src/erc_token.rs | 9 +++++ .../src/stubs/UniqueRefungibleToken.raw | Bin 1427 -> 1477 bytes .../src/stubs/UniqueRefungibleToken.sol | 32 ++++++++++------- tests/src/eth/api/UniqueRefungibleToken.sol | 15 ++++---- tests/src/eth/reFungibleToken.test.ts | 33 ++++++++++++++++++ tests/src/eth/reFungibleTokenAbi.json | 9 +++++ 7 files changed, 96 insertions(+), 18 deletions(-) diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index b3b87c07b1..267290a690 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -1,3 +1,19 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + extern crate alloc; use evm_coder::{generate_stubgen, solidity_interface, types::*}; diff --git a/pallets/refungible/src/erc_token.rs b/pallets/refungible/src/erc_token.rs index f10ef76543..950c163cd2 100644 --- a/pallets/refungible/src/erc_token.rs +++ b/pallets/refungible/src/erc_token.rs @@ -149,6 +149,15 @@ impl RefungibleTokenHandle { .map_err(dispatch_to_evm::)?; Ok(true) } + + #[weight(>::repartition_item())] + fn repartition(&mut self, caller: caller, amount: uint256) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let amount = amount.try_into().map_err(|_| "amount overflow")?; + + >::repartition(self, &caller, self.1, amount).map_err(dispatch_to_evm::)?; + Ok(true) + } } impl RefungibleTokenHandle { diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.raw b/pallets/refungible/src/stubs/UniqueRefungibleToken.raw index c6a08c12f84502bd6b48652c8cb57b1aae99df7f..2f52a9a02ccc256a89f366d3616732931ea058e2 100644 GIT binary patch delta 758 zcmY+APiPZC6vp@M>{g{l5@}LnwQfxj4?P$#f*_LWr3Vk2MY8DHbfy&w{sHx-BFSua z162>3OckXCJsCWS|0_L+2bDs-1cdfbiJ*cM4@K}+3$k!>R$H>d^(u4AtH%)T{-w!CWMKMvi&Q2FILS0hN?7&e#1irn2Xfg6xs zv4v;@fyA*A)oh1sjWc)?dNz(sMAq2fGT&b5JN!LWhBO5Wl; z7H9GWsvx=Co6}(jUv3v{+8m zbjvMAIbmd2yiig@S4;}{UgDXI%;Ki4WF=u6PCQQ49vg0Bh+ma%_`mOIRI(~O8fWCW z$&WiW7@iB>1TZo!`qVxx5W2iU?y|$=eNj{GFYll+YT3Ldl+lUnBK@p17KQKl;OeP{`*=Uf+_`dEi5QOOv>BZ*n zU!xGaA0Y0?Cqy!YoJQ(jUjm!tJweKI?^IhA7EB{h=W4Ej(`-#4=;kD@HC zPPyHT`+@S-`kfOfKcifV-+k4b){4J|&^wHg`j)0oLgU>c9z8-=$JPdE0y`%bpEZF! zVtH2$^*?lEUR*{AU8)w+j9X#c>mxMAV43|t$W1%qcLuSK`A_B z+?wYyc#HOJm_HW4u+4`w8e5)oK?7e5O#50U+HgIw&4_rk34bpNYreh2R*nL$QaqVn zqnl}DVpuheTkt>q{X{w#$k$~8AeKAe24#>WCspM0iG)dxjM~TP7utWj^>OXw;12+Cu05OtF4i4~|K KKjY8Gv;P58VF_#i diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.sol b/pallets/refungible/src/stubs/UniqueRefungibleToken.sol index 8ef75e2e5c..52da25e3fb 100644 --- a/pallets/refungible/src/stubs/UniqueRefungibleToken.sol +++ b/pallets/refungible/src/stubs/UniqueRefungibleToken.sol @@ -31,18 +31,6 @@ contract ERC20Events { ); } -// Selector: 79cc6790 -contract ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) public returns (bool) { - require(false, stub_error); - from; - amount; - dummy = 0; - return false; - } -} - // Selector: 942e8b22 contract ERC20 is Dummy, ERC165, ERC20Events { // Selector: name() 06fdde03 @@ -127,4 +115,24 @@ contract ERC20 is Dummy, ERC165, ERC20Events { } } +// Selector: ab8deb37 +contract ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) public returns (bool) { + require(false, stub_error); + from; + amount; + dummy = 0; + return false; + } + + // Selector: repartition(uint256) d2418ca7 + function repartition(uint256 amount) public returns (bool) { + require(false, stub_error); + amount; + dummy = 0; + return false; + } +} + contract UniqueRefungibleToken is Dummy, ERC165, ERC20, ERC20UniqueExtensions {} diff --git a/tests/src/eth/api/UniqueRefungibleToken.sol b/tests/src/eth/api/UniqueRefungibleToken.sol index de00919f99..3566c06a57 100644 --- a/tests/src/eth/api/UniqueRefungibleToken.sol +++ b/tests/src/eth/api/UniqueRefungibleToken.sol @@ -22,12 +22,6 @@ interface ERC20Events { ); } -// Selector: 79cc6790 -interface ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) external returns (bool); -} - // Selector: 942e8b22 interface ERC20 is Dummy, ERC165, ERC20Events { // Selector: name() 06fdde03 @@ -65,6 +59,15 @@ interface ERC20 is Dummy, ERC165, ERC20Events { returns (uint256); } +// Selector: ab8deb37 +interface ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) external returns (bool); + + // Selector: repartition(uint256) d2418ca7 + function repartition(uint256 amount) external returns (bool); +} + interface UniqueRefungibleToken is Dummy, ERC165, diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 9553a420ca..440cecc7ae 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -210,6 +210,39 @@ describe('Refungible: Plain calls', () => { expect(+balance).to.equal(50); } }); + + itWeb3('Can perform repartition()', async ({web3, api, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; + + const owner = createEthAccount(web3); + await transferBalanceToEth(api, alice, owner); + + const receiver = createEthAccount(web3); + await transferBalanceToEth(api, alice, receiver); + + const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n, {Ethereum: owner})).itemId; + + const address = tokenIdToAddress(collectionId, tokenId); + const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + + await contract.methods.repartition(200).send({from: owner}); + expect(+await contract.methods.balanceOf(owner).call()).to.be.equal(200); + await contract.methods.transfer(receiver, 110).send({from: owner}); + expect(+await contract.methods.balanceOf(owner).call()).to.be.equal(90); + expect(+await contract.methods.balanceOf(receiver).call()).to.be.equal(110); + + await expect(contract.methods.repartition(80).send({from: owner})).to.eventually.be.rejected; + + await contract.methods.transfer(receiver, 90).send({from: owner}); + expect(+await contract.methods.balanceOf(owner).call()).to.be.equal(0); + expect(+await contract.methods.balanceOf(receiver).call()).to.be.equal(200); + + await contract.methods.repartition(150).send({from: receiver}); + await expect(contract.methods.transfer(owner, 160).send({from: receiver})).to.eventually.be.rejected; + expect(+await contract.methods.balanceOf(receiver).call()).to.be.equal(150); + }); }); describe('Refungible: Fees', () => { diff --git a/tests/src/eth/reFungibleTokenAbi.json b/tests/src/eth/reFungibleTokenAbi.json index ca02256a1f..5523e22b86 100644 --- a/tests/src/eth/reFungibleTokenAbi.json +++ b/tests/src/eth/reFungibleTokenAbi.json @@ -102,6 +102,15 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "repartition", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" } From 60243736a5d5fc86aa5bf70de34f820041b6fe02 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 22 Jul 2022 05:21:08 +0000 Subject: [PATCH 0087/1274] doc(refungible-pallet): add documentation for ERC20 EVM API --- Cargo.lock | 2 +- pallets/refungible/CHANGELOG.md | 6 ++++ pallets/refungible/Cargo.toml | 2 +- pallets/refungible/src/erc_token.rs | 53 +++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 pallets/refungible/CHANGELOG.md diff --git a/Cargo.lock b/Cargo.lock index 6e3234d2c2..3b295a0fc0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6320,7 +6320,7 @@ dependencies = [ [[package]] name = "pallet-refungible" -version = "0.1.1" +version = "0.1.2" dependencies = [ "ethereum", "evm-coder", diff --git a/pallets/refungible/CHANGELOG.md b/pallets/refungible/CHANGELOG.md new file mode 100644 index 0000000000..7ea9a210a8 --- /dev/null +++ b/pallets/refungible/CHANGELOG.md @@ -0,0 +1,6 @@ +## v0.1.2 - 2022-07 + +### Refungible Pallet + +feat(refungible-pallet): add ERC-20 EVM API for RFT token pieces ([#413](https://github.com/UniqueNetwork/unique-chain/pull/413)) +test(refungible-pallet): add tests for ERC-20 EVM API for RFT token pieces ([#413](https://github.com/UniqueNetwork/unique-chain/pull/413)) \ No newline at end of file diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index c3ad82eed2..4c5016cb78 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-refungible" -version = "0.1.1" +version = "0.1.2" license = "GPLv3" edition = "2021" diff --git a/pallets/refungible/src/erc_token.rs b/pallets/refungible/src/erc_token.rs index 950c163cd2..924b03c3d9 100644 --- a/pallets/refungible/src/erc_token.rs +++ b/pallets/refungible/src/erc_token.rs @@ -14,6 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! # Refungible Pallet EVM API for token pieces +//! +//! Provides ERC-20 standart support implementation and EVM API for unique extensions for Refungible Pallet. +//! Method implementations are mostly doing parameter conversion and calling Nonfungible Pallet methods. + extern crate alloc; use core::{ char::{REPLACEMENT_CHARACTER, decode_utf16}, @@ -40,6 +45,10 @@ pub struct RefungibleTokenHandle(pub RefungibleHandle, pub TokenId #[derive(ToLog)] pub enum ERC20Events { + /// @dev This event is emitted when the amount of tokens (value) is sent + /// from the from address to the to address. In the case of minting new + /// tokens, the transfer is usually from the 0 address while in the case + /// of burning tokens the transfer is to 0. Transfer { #[indexed] from: address, @@ -47,6 +56,8 @@ pub enum ERC20Events { to: address, value: uint256, }, + /// @dev This event is emitted when the amount of tokens (value) is approved + /// by the owner to be used by the spender. Approval { #[indexed] owner: address, @@ -56,32 +67,49 @@ pub enum ERC20Events { }, } +/// @title Standard ERC20 token +/// +/// @dev Implementation of the basic standard token. +/// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md #[solidity_interface(name = "ERC20", events(ERC20Events))] impl RefungibleTokenHandle { + /// @return the name of the token. fn name(&self) -> Result { Ok(decode_utf16(self.name.iter().copied()) .map(|r| r.unwrap_or(REPLACEMENT_CHARACTER)) .collect::()) } + + /// @return the symbol of the token. fn symbol(&self) -> Result { Ok(string::from_utf8_lossy(&self.token_prefix).into()) } + + /// @dev Total number of tokens in existence fn total_supply(&self) -> Result { self.consume_store_reads(1)?; Ok(>::get((self.id, self.1)).into()) } + /// @dev Not supported fn decimals(&self) -> Result { // Decimals aren't supported for refungible tokens Ok(0) } + /// @dev Gets the balance of the specified address. + /// @param owner The address to query the balance of. + /// @return An uint256 representing the amount owned by the passed address. fn balance_of(&self, owner: address) -> Result { self.consume_store_reads(1)?; let owner = T::CrossAccountId::from_eth(owner); let balance = >::get((self.id, self.1, owner)); Ok(balance.into()) } + + /// @dev Transfer token for a specified address + /// @param to The address to transfer to. + /// @param amount The amount to be transferred. #[weight(>::transfer())] fn transfer(&mut self, caller: caller, to: address, amount: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -95,6 +123,11 @@ impl RefungibleTokenHandle { .map_err(|_| "transfer error")?; Ok(true) } + + /// @dev Transfer tokens from one address to another + /// @param from address The address which you want to send tokens from + /// @param to address The address which you want to transfer to + /// @param amount uint256 the amount of tokens to be transferred #[weight(>::transfer_from())] fn transfer_from( &mut self, @@ -115,6 +148,14 @@ impl RefungibleTokenHandle { .map_err(dispatch_to_evm::)?; Ok(true) } + + /// @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`. + /// Beware that changing an allowance with this method brings the risk that someone may use both the old + /// and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this + /// race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: + /// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + /// @param spender The address which will spend the funds. + /// @param amount The amount of tokens to be spent. #[weight(>::approve())] fn approve(&mut self, caller: caller, spender: address, amount: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -125,6 +166,11 @@ impl RefungibleTokenHandle { .map_err(dispatch_to_evm::)?; Ok(true) } + + /// @dev Function to check the amount of tokens that an owner allowed to a spender. + /// @param owner address The address which owns the funds. + /// @param spender address The address which will spend the funds. + /// @return A uint256 specifying the amount of tokens still available for the spender. fn allowance(&self, owner: address, spender: address) -> Result { self.consume_store_reads(1)?; let owner = T::CrossAccountId::from_eth(owner); @@ -136,6 +182,10 @@ impl RefungibleTokenHandle { #[solidity_interface(name = "ERC20UniqueExtensions")] impl RefungibleTokenHandle { + /// @dev Function that burns an amount of the token of a given account, + /// deducting from the sender's allowance for said account. + /// @param from The account whose tokens will be burnt. + /// @param amount The amount that will be burnt. #[weight(>::burn_from())] fn burn_from(&mut self, caller: caller, from: address, amount: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -150,6 +200,9 @@ impl RefungibleTokenHandle { Ok(true) } + /// @dev Function that changes total amount of the tokens. + /// Throws if `msg.sender` doesn't owns all of the tokens. + /// @param amount New total amount of the tokens. #[weight(>::repartition_item())] fn repartition(&mut self, caller: caller, amount: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); From f779788ead2cf69aca5e11a00dfdb3bc893ea821 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 22 Jul 2022 05:21:08 +0000 Subject: [PATCH 0088/1274] chore: fix cargo fmt --- pallets/refungible/src/erc_token.rs | 4 ++-- pallets/refungible/src/lib.rs | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pallets/refungible/src/erc_token.rs b/pallets/refungible/src/erc_token.rs index 924b03c3d9..e0e67b6363 100644 --- a/pallets/refungible/src/erc_token.rs +++ b/pallets/refungible/src/erc_token.rs @@ -46,7 +46,7 @@ pub struct RefungibleTokenHandle(pub RefungibleHandle, pub TokenId #[derive(ToLog)] pub enum ERC20Events { /// @dev This event is emitted when the amount of tokens (value) is sent - /// from the from address to the to address. In the case of minting new + /// from the from address to the to address. In the case of minting new /// tokens, the transfer is usually from the 0 address while in the case /// of burning tokens the transfer is to 0. Transfer { @@ -68,7 +68,7 @@ pub enum ERC20Events { } /// @title Standard ERC20 token -/// +/// /// @dev Implementation of the basic standard token. /// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md #[solidity_interface(name = "ERC20", events(ERC20Events))] diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 5ead440c98..bb5a4e5d8c 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -95,15 +95,19 @@ use evm_coder::ToLog; use frame_support::{BoundedVec, ensure, fail, storage::with_transaction, transactional}; use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; use pallet_evm_coder_substrate::WithRecorder; -use pallet_common::{CommonCollectionOperations, Error as CommonError, Event as CommonEvent, Pallet as PalletCommon}; +use pallet_common::{ + CommonCollectionOperations, Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, +}; use pallet_structure::Pallet as PalletStructure; use scale_info::TypeInfo; use sp_core::H160; use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome}; use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap}; use up_data_structs::{ - AccessMode, budget::Budget, CollectionId, CreateCollectionData, CreateRefungibleExData, CustomDataLimit, mapping::TokenAddressMapping, MAX_REFUNGIBLE_PIECES, TokenId, - Property, PropertyKey, PropertyKeyPermission, PropertyPermission, PropertyScope, PropertyValue, TrySetProperty + AccessMode, budget::Budget, CollectionId, CreateCollectionData, CreateRefungibleExData, + CustomDataLimit, mapping::TokenAddressMapping, MAX_REFUNGIBLE_PIECES, TokenId, Property, + PropertyKey, PropertyKeyPermission, PropertyPermission, PropertyScope, PropertyValue, + TrySetProperty, }; pub use pallet::*; From d228734b69867e00bbf8c4c419878d7812d0daae Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 22 Jul 2022 05:21:08 +0000 Subject: [PATCH 0089/1274] feat(pallet-refungible): events for repartition method --- pallets/refungible/src/lib.rs | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index bb5a4e5d8c..1131594860 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -1151,6 +1151,47 @@ impl Pallet { >::insert((collection.id, token, owner), amount); >::insert((collection.id, token), amount); + + if amount > total_pieces { + let mint_amount = amount - total_pieces; + >::deposit_log( + ERC20Events::Transfer { + from: H160::default(), + to: *owner.as_eth(), + value: mint_amount.into(), + } + .to_log(T::EvmTokenAddressMapping::token_to_address( + collection.id, + token, + )), + ); + >::deposit_event(CommonEvent::ItemCreated( + collection.id, + token, + owner.clone(), + mint_amount, + )); + } else if total_pieces > amount { + let burn_amount = total_pieces - amount; + >::deposit_log( + ERC20Events::Transfer { + from: *owner.as_eth(), + to: H160::default(), + value: burn_amount.into(), + } + .to_log(T::EvmTokenAddressMapping::token_to_address( + collection.id, + token, + )), + ); + >::deposit_event(CommonEvent::ItemDestroyed( + collection.id, + token, + owner.clone(), + burn_amount, + )); + } + Ok(()) } From 93112f6aa452d6ef091c5cd8e9ee1ef4317a196b Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 22 Jul 2022 05:21:08 +0000 Subject: [PATCH 0090/1274] test(refungible-pallet): add tests for repartition events --- tests/src/eth/reFungibleToken.test.ts | 61 ++++++++++++++++++++++++++- tests/src/refungible.test.ts | 44 ++++++++++++++++++- tests/src/util/helpers.ts | 36 ++++++++++++++++ 3 files changed, 139 insertions(+), 2 deletions(-) diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 440cecc7ae..c2b01407a1 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -239,10 +239,69 @@ describe('Refungible: Plain calls', () => { expect(+await contract.methods.balanceOf(owner).call()).to.be.equal(0); expect(+await contract.methods.balanceOf(receiver).call()).to.be.equal(200); - await contract.methods.repartition(150).send({from: receiver}); + const result = await contract.methods.repartition(150).send({from: receiver}); + console.log(result.events); await expect(contract.methods.transfer(owner, 160).send({from: receiver})).to.eventually.be.rejected; expect(+await contract.methods.balanceOf(receiver).call()).to.be.equal(150); }); + + itWeb3('Can repartition with increased amount', async ({web3, api, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; + + const owner = createEthAccount(web3); + await transferBalanceToEth(api, alice, owner); + + const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n, {Ethereum: owner})).itemId; + + const address = tokenIdToAddress(collectionId, tokenId); + const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + + const result = await contract.methods.repartition(200).send(); + const events = normalizeEvents(result.events); + + expect(events).to.include.deep.members([ + { + address, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: owner, + value: '100', + }, + }, + ]); + }); + + itWeb3('Can repartition with decreased amount', async ({web3, api, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; + + const owner = createEthAccount(web3); + await transferBalanceToEth(api, alice, owner); + + const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n, {Ethereum: owner})).itemId; + + const address = tokenIdToAddress(collectionId, tokenId); + const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + + const result = await contract.methods.repartition(50).send(); + const events = normalizeEvents(result.events); + + expect(events).to.include.deep.members([ + { + address, + event: 'Transfer', + args: { + from: owner, + to: '0x0000000000000000000000000000000000000000', + value: '50', + }, + }, + ]); + }); }); describe('Refungible: Fees', () => { diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index e8eb94a226..dac5d4cfe4 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {default as usingApi, executeTransaction} from './substrate/substrate-api'; +import {default as usingApi, submitTransactionAsync} from './substrate/substrate-api'; import {IKeyringPair} from '@polkadot/types/types'; import { createCollectionExpectSuccess, @@ -32,6 +32,8 @@ import { repartitionRFT, createCollectionWithPropsExpectSuccess, getDetailedCollectionInfo, + getCreateItemsResult, + getDestroyItemsResult, } from './util/helpers'; import chai from 'chai'; @@ -188,6 +190,46 @@ describe('integration test: Refungible functionality:', () => { await expect(transfer(api, collectionId, tokenId, bob, alice, 160n)).to.eventually.be.rejected; }); }); + + it('Repartition with increased amount', async () => { + await usingApi(async api => { + const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; + const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n)).itemId; + + const tx = api.tx.unique.repartition(collectionId, tokenId, 200n); + const events = await submitTransactionAsync(alice, tx); + const substrateEvents = getCreateItemsResult(events); + expect(substrateEvents).to.include.deep.members([ + { + success: true, + collectionId, + itemId: tokenId, + recipient: {Substrate: alice.address}, + amount: 100, + }, + ]); + }); + }); + + it('Repartition with decreased amount', async () => { + await usingApi(async api => { + const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; + const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n)).itemId; + + const tx = api.tx.unique.repartition(collectionId, tokenId, 50n); + const events = await submitTransactionAsync(alice, tx); + const substrateEvents = getDestroyItemsResult(events); + expect(substrateEvents).to.include.deep.members([ + { + success: true, + collectionId, + itemId: tokenId, + owner: {Substrate: alice.address}, + amount: 50, + }, + ]); + }); + }); }); describe('Test Refungible properties:', () => { diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index 8c94c53470..79b4538e10 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -103,6 +103,15 @@ interface CreateItemResult { collectionId: number; itemId: number; recipient?: CrossAccountId; + amount?: number; +} + +interface DestroyItemResult { + success: boolean; + collectionId: number; + itemId: number; + owner: CrossAccountId; + amount: number; } interface TransferResult { @@ -220,12 +229,14 @@ export function getCreateItemsResult(events: EventRecord[]): CreateItemResult[] const collectionId = parseInt(data[0].toString(), 10); const itemId = parseInt(data[1].toString(), 10); const recipient = normalizeAccountId(data[2].toJSON() as any); + const amount = parseInt(data[3].toString(), 10); const itemRes: CreateItemResult = { success: true, collectionId, itemId, recipient, + amount, }; results.push(itemRes); @@ -255,6 +266,31 @@ export function getCreateItemResult(events: EventRecord[]): CreateItemResult { return result; } +export function getDestroyItemsResult(events: EventRecord[]): DestroyItemResult[] { + const results: DestroyItemResult[] = []; + + const genericResult = getGenericResult(events, 'common', 'ItemDestroyed', (data) => { + const collectionId = parseInt(data[0].toString(), 10); + const itemId = parseInt(data[1].toString(), 10); + const owner = normalizeAccountId(data[2].toJSON() as any); + const amount = parseInt(data[3].toString(), 10); + + const itemRes: DestroyItemResult = { + success: true, + collectionId, + itemId, + owner, + amount, + }; + + results.push(itemRes); + return results; + }); + + if (!genericResult.success) return []; + return results; +} + export function getTransferResult(api: ApiPromise, events: EventRecord[]): TransferResult { for (const {event} of events) { if (api.events.common.Transfer.is(event)) { From 94da15aaa928ab67e62919738e4cca46a654d140 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Mon, 11 Jul 2022 14:13:49 +0700 Subject: [PATCH 0091/1274] feat(api): added RPC method, integrations tests for fungibble pallet Added method that returns 10 tokens owners in no particular order. --- Cargo.lock | 10 +- client/rpc/CHANGELOG.md | 11 ++ client/rpc/Cargo.toml | 2 +- client/rpc/src/lib.rs | 1 + pallets/common/CHANGELOG.md | 12 ++ pallets/common/src/lib.rs | 4 +- pallets/fungible/CHANGELOG.md | 13 ++ pallets/fungible/Cargo.toml | 2 +- pallets/fungible/src/common.rs | 1 + pallets/fungible/src/lib.rs | 8 +- pallets/nonfungible/CHANGELOG.md | 11 ++ pallets/nonfungible/Cargo.toml | 2 +- pallets/nonfungible/src/common.rs | 1 + pallets/refungible/CHANGELOG.md | 13 ++ pallets/refungible/src/common.rs | 1 + pallets/refungible/src/lib.rs | 10 +- primitives/rpc/CHANGELOG.md | 10 ++ primitives/rpc/Cargo.toml | 2 +- runtime/common/CHANGELOG.md | 13 ++ runtime/common/Cargo.toml | 2 +- tests/CHANGELOG.md | 11 ++ tests/package.json | 1 + tests/src/fungible.test.ts | 184 +++++++++++++++++++++ tests/src/interfaces/augment-api-consts.ts | 6 + tests/src/interfaces/augment-api-events.ts | 67 ++------ tests/src/interfaces/augment-api-query.ts | 47 +++++- tests/src/interfaces/augment-api-rpc.ts | 2 +- tests/src/interfaces/unique/definitions.ts | 2 +- tests/src/refungible.test.ts | 6 + tests/src/rpc.test.ts | 4 + 30 files changed, 387 insertions(+), 72 deletions(-) create mode 100644 client/rpc/CHANGELOG.md create mode 100644 pallets/common/CHANGELOG.md create mode 100644 pallets/fungible/CHANGELOG.md create mode 100644 pallets/nonfungible/CHANGELOG.md create mode 100644 pallets/refungible/CHANGELOG.md create mode 100644 primitives/rpc/CHANGELOG.md create mode 100644 runtime/common/CHANGELOG.md create mode 100644 tests/CHANGELOG.md create mode 100644 tests/src/fungible.test.ts diff --git a/Cargo.lock b/Cargo.lock index 1d022ee0c3..3f61bdb9dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5953,7 +5953,7 @@ dependencies = [ [[package]] name = "pallet-fungible" -version = "0.1.0" +version = "0.1.1" dependencies = [ "ethereum", "evm-coder", @@ -6198,7 +6198,7 @@ dependencies = [ [[package]] name = "pallet-nonfungible" -version = "0.1.0" +version = "0.1.1" dependencies = [ "ethereum", "evm-coder", @@ -12374,7 +12374,7 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "uc-rpc" -version = "0.1.0" +version = "0.1.1" dependencies = [ "anyhow", "jsonrpsee", @@ -12679,7 +12679,7 @@ dependencies = [ [[package]] name = "unique-runtime-common" -version = "0.9.24" +version = "0.9.25" dependencies = [ "evm-coder", "fp-rpc", @@ -12751,7 +12751,7 @@ dependencies = [ [[package]] name = "up-rpc" -version = "0.1.0" +version = "0.1.1" dependencies = [ "pallet-common", "pallet-evm", diff --git a/client/rpc/CHANGELOG.md b/client/rpc/CHANGELOG.md new file mode 100644 index 0000000000..155e7fe7fb --- /dev/null +++ b/client/rpc/CHANGELOG.md @@ -0,0 +1,11 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +## [0.1.1] - 2022-07-14 + +### Added + + - Implementation of RPC method `token_owners` returning 10 owners in no particular order. + This was an internal request to improve the web interface and support fractionalization event. + \ No newline at end of file diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index 4b61998be4..fff98b91ae 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uc-rpc" -version = "0.1.0" +version = "0.1.1" license = "GPLv3" edition = "2021" diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index 25c48085d9..c07a7d1f3d 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -71,6 +71,7 @@ pub trait UniqueApi { at: Option, ) -> Result>; + /// Returns 10 tokens owners in no particular order. #[method(name = "unique_tokenOwners")] fn token_owners( &self, diff --git a/pallets/common/CHANGELOG.md b/pallets/common/CHANGELOG.md new file mode 100644 index 0000000000..fed1457338 --- /dev/null +++ b/pallets/common/CHANGELOG.md @@ -0,0 +1,12 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +## [0.1.1] - 2022-07-14 + +### Added + + - Implementation of RPC method `token_owners` returning 10 owners in no particular order. + This was an internal request to improve the web interface and support fractionalization event. + + \ No newline at end of file diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 3417d7e5d9..7ddabda7ed 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -1748,7 +1748,9 @@ pub trait CommonCollectionOperations { /// * `token` - The token for which you need to find out the owner. fn token_owner(&self, token: TokenId) -> Option; - /// Token owners + /// Returns 10 tokens owners in no particular order. + /// + /// * `token` - The token for which you need to find out the owners. fn token_owners(&self, token: TokenId) -> Vec; /// Get the value of the token property by key. diff --git a/pallets/fungible/CHANGELOG.md b/pallets/fungible/CHANGELOG.md new file mode 100644 index 0000000000..8b2038f60d --- /dev/null +++ b/pallets/fungible/CHANGELOG.md @@ -0,0 +1,13 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +## [0.1.1] - 2022-07-14 + +### Added + + - Implementation of RPC method `token_owners` returning 10 owners in no particular order. + This was an internal request to improve the web interface and support fractionalization event. + + + \ No newline at end of file diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index 51ea0f108c..a8036f6086 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-fungible" -version = "0.1.0" +version = "0.1.1" license = "GPLv3" edition = "2021" diff --git a/pallets/fungible/src/common.rs b/pallets/fungible/src/common.rs index 95242d4450..c58da0d679 100644 --- a/pallets/fungible/src/common.rs +++ b/pallets/fungible/src/common.rs @@ -362,6 +362,7 @@ impl CommonCollectionOperations for FungibleHandle { None } + /// Returns 10 tokens owners in no particular order. fn token_owners(&self, token: TokenId) -> Vec { >::token_owners(self.id, token).unwrap_or_else(|| vec![]) } diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index 4afefd0d39..7811e3607f 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -614,12 +614,18 @@ impl Pallet { ) } + /// Returns 10 tokens owners in no particular order + /// + /// There is no direct way to get token holders in ascending order, + /// since `iter_prefix` returns values in no particular order. + /// Therefore, getting the 10 largest holders with a large value of holders + /// can lead to impact memory allocation + sorting with `n * log (n)`. pub fn token_owners( collection: CollectionId, _token: TokenId, ) -> Option> { let res: Vec = >::iter_prefix((collection,)) - .map(|r| r.0) + .map(|(owner, _amount)| owner) .take(10) .collect(); diff --git a/pallets/nonfungible/CHANGELOG.md b/pallets/nonfungible/CHANGELOG.md new file mode 100644 index 0000000000..f7c39e9dfe --- /dev/null +++ b/pallets/nonfungible/CHANGELOG.md @@ -0,0 +1,11 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +## [0.1.1] - 2022-07-14 + +### Added + +- Implementation of RPC method `token_owners`. + For reasons of compatibility with this pallet, returns only one owner if token exists. + This was an internal request to improve the web interface and support fractionalization event. \ No newline at end of file diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index 4cbd5cc9f3..e7729960f3 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-nonfungible" -version = "0.1.0" +version = "0.1.1" license = "GPLv3" edition = "2021" diff --git a/pallets/nonfungible/src/common.rs b/pallets/nonfungible/src/common.rs index 213c3e5689..52915345cd 100644 --- a/pallets/nonfungible/src/common.rs +++ b/pallets/nonfungible/src/common.rs @@ -422,6 +422,7 @@ impl CommonCollectionOperations for NonfungibleHandle { >::get((self.id, token)).map(|t| t.owner) } + /// Returns token owners. fn token_owners(&self, token: TokenId) -> Vec { self.token_owner(token).map_or_else(|| vec![], |t| vec![t]) } diff --git a/pallets/refungible/CHANGELOG.md b/pallets/refungible/CHANGELOG.md new file mode 100644 index 0000000000..be700b1854 --- /dev/null +++ b/pallets/refungible/CHANGELOG.md @@ -0,0 +1,13 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +## [0.1.1] - 2022-07-14 + +### Added + + - Implementation of RPC method `token_owners` returning 10 owners in no particular order. + This was an internal request to improve the web interface and support fractionalization event. + + + \ No newline at end of file diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index 3b8db2a3a5..61d4682c6b 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -438,6 +438,7 @@ impl CommonCollectionOperations for RefungibleHandle { >::token_owner(self.id, token) } + /// Returns 10 token in no particular order. fn token_owners(&self, token: TokenId) -> Vec { >::token_owners(self.id, token).unwrap_or_else(|| vec![]) } diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index df2e00f70c..68afbecacd 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -1134,13 +1134,19 @@ impl Pallet { ) -> DispatchResult { >::set_token_property_permissions(collection, sender, property_permissions) } - + + /// Returns 10 token in no particular order. + /// + /// There is no direct way to get token holders in ascending order, + /// since `iter_prefix` returns values in no particular order. + /// Therefore, getting the 10 largest holders with a large value of holders + /// can lead to impact memory allocation + sorting with `n * log (n)`. pub fn token_owners( collection_id: CollectionId, token: TokenId, ) -> Option> { let res: Vec = >::iter_prefix((collection_id, token)) - .map(|r| r.0) + .map(|(owner, _amount)| owner) .take(10) .collect(); diff --git a/primitives/rpc/CHANGELOG.md b/primitives/rpc/CHANGELOG.md new file mode 100644 index 0000000000..a7a01eb6d8 --- /dev/null +++ b/primitives/rpc/CHANGELOG.md @@ -0,0 +1,10 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +## [0.1.1] - 2022-07-14 + +### Added + + - Implementation of RPC method `token_owners` returning 10 owners in no particular order. + This was an internal request to improve the web interface and support fractionalization event. \ No newline at end of file diff --git a/primitives/rpc/Cargo.toml b/primitives/rpc/Cargo.toml index 52dcce4e3e..35e074986b 100644 --- a/primitives/rpc/Cargo.toml +++ b/primitives/rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "up-rpc" -version = "0.1.0" +version = "0.1.1" license = "GPLv3" edition = "2021" diff --git a/runtime/common/CHANGELOG.md b/runtime/common/CHANGELOG.md new file mode 100644 index 0000000000..a9e1ccd854 --- /dev/null +++ b/runtime/common/CHANGELOG.md @@ -0,0 +1,13 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +## [0.9.25] - 2022-07-14 + +### Added + + - Implementation of RPC method `token_owners` returning 10 owners in no particular order. + This was an internal request to improve the web interface and support fractionalization event. + + + \ No newline at end of file diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 2992413835..bb801ffcd7 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -6,7 +6,7 @@ homepage = 'https://unique.network' license = 'All Rights Reserved' name = 'unique-runtime-common' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.9.24' +version = '0.9.25' [features] default = ['std'] diff --git a/tests/CHANGELOG.md b/tests/CHANGELOG.md new file mode 100644 index 0000000000..ac3fec048e --- /dev/null +++ b/tests/CHANGELOG.md @@ -0,0 +1,11 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +## 2022-07-14 + +### Added + - Integrintegration tests of RPC method `token_owners`. + - Integrintegration tests of Fungible Pallet. + + \ No newline at end of file diff --git a/tests/package.json b/tests/package.json index 1722ba984b..15f6b5eba6 100644 --- a/tests/package.json +++ b/tests/package.json @@ -80,6 +80,7 @@ "testLimits": "mocha --timeout 9999999 -r ts-node/register ./**/limits.test.ts", "testEthCreateCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createCollection.test.ts", "testRFT": "mocha --timeout 9999999 -r ts-node/register ./**/refungible.test.ts", + "testFT": "mocha --timeout 9999999 -r ts-node/register ./**/fungible.test.ts", "testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts", "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", "polkadot-types-from-defs": "ts-node ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .", diff --git a/tests/src/fungible.test.ts b/tests/src/fungible.test.ts new file mode 100644 index 0000000000..8fea21f045 --- /dev/null +++ b/tests/src/fungible.test.ts @@ -0,0 +1,184 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import {default as usingApi} from './substrate/substrate-api'; +import {IKeyringPair} from '@polkadot/types/types'; +import { + getBalance, + createMultipleItemsExpectSuccess, + isTokenExists, + getLastTokenId, + getAllowance, + approve, + transferFrom, + createCollection, + transfer, + burnItem, + normalizeAccountId, + CrossAccountId, + createFungibleItemExpectSuccess, + U128_MAX, + burnFromExpectSuccess, +} from './util/helpers'; + +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; +chai.use(chaiAsPromised); +const expect = chai.expect; + +let alice: IKeyringPair; +let bob: IKeyringPair; + +describe('integration test: Fungible functionality:', () => { + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + alice = privateKeyWrapper('//Alice'); + bob = privateKeyWrapper('//Bob'); + }); + }); + + it('Create fungible collection and token', async () => { + await usingApi(async api => { + const createCollectionResult = await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}}); + expect(createCollectionResult.success).to.be.true; + const collectionId = createCollectionResult.collectionId; + const defaultTokenId = await getLastTokenId(api, collectionId); + const aliceTokenId = await createFungibleItemExpectSuccess(alice, collectionId, {Value: U128_MAX}, alice.address); + const aliceBalance = await getBalance(api, collectionId, alice, aliceTokenId); + const itemCountAfter = await getLastTokenId(api, collectionId); + + // What to expect + // tslint:disable-next-line:no-unused-expression + expect(itemCountAfter).to.be.equal(defaultTokenId); + expect(aliceBalance).to.be.equal(U128_MAX); + }); + }); + + it('RPC method tokenOnewrs for fungible collection and token', async () => { + await usingApi(async (api, privateKeyWrapper) => { + const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; + const facelessCrowd = Array.from(Array(7).keys()).map(i => normalizeAccountId(privateKeyWrapper(i.toString()))); + + const createCollectionResult = await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}}); + const collectionId = createCollectionResult.collectionId; + const aliceTokenId = await createFungibleItemExpectSuccess(alice, collectionId, {Value: U128_MAX}, alice.address); + + await transfer(api, collectionId, aliceTokenId, alice, bob, 1000n); + await transfer(api, collectionId, aliceTokenId, alice, ethAcc, 900n); + + for (let i = 0; i < 7; i++) { + await transfer(api, collectionId, aliceTokenId, alice, facelessCrowd[i], 1); + } + + const owners = await api.rpc.unique.tokenOwners(collectionId, aliceTokenId); + const ids = (owners.toJSON() as CrossAccountId[]).map(s => normalizeAccountId(s)); + const aliceID = normalizeAccountId(alice); + const bobId = normalizeAccountId(bob); + + // What to expect + // tslint:disable-next-line:no-unused-expression + expect(ids).to.deep.include.members([aliceID, ethAcc, bobId, ...facelessCrowd]); + expect(owners.length == 10).to.be.true; + + const eleven = privateKeyWrapper('11'); + expect(await transfer(api, collectionId, aliceTokenId, alice, eleven, 10n)).to.be.true; + expect((await api.rpc.unique.tokenOwners(collectionId, aliceTokenId)).length).to.be.equal(10); + }); + }); + + it('Transfer token', async () => { + await usingApi(async api => { + const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; + const collectionId = (await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}})).collectionId; + const tokenId = await createFungibleItemExpectSuccess(alice, collectionId, {Value: 500n}, alice.address); + + expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(500n); + expect(await transfer(api, collectionId, tokenId, alice, bob, 60n)).to.be.true; + expect(await transfer(api, collectionId, tokenId, alice, ethAcc, 140n)).to.be.true; + + expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(300n); + expect(await getBalance(api, collectionId, bob, tokenId)).to.be.equal(60n); + expect(await getBalance(api, collectionId, ethAcc, tokenId)).to.be.equal(140n); + await expect(transfer(api, collectionId, tokenId, alice, bob, 350n)).to.eventually.be.rejected; + }); + }); + + it('Tokens multiple creation', async () => { + await usingApi(async api => { + const collectionId = (await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}})).collectionId; + + const args = [ + {Fungible: {Value: 500n}}, + {Fungible: {Value: 400n}}, + {Fungible: {Value: 300n}}, + ]; + + await createMultipleItemsExpectSuccess(alice, collectionId, args); + expect(await getBalance(api, collectionId, alice, 0)).to.be.equal(1200n); + }); + }); + + it('Burn some tokens ', async () => { + await usingApi(async api => { + const collectionId = (await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}})).collectionId; + const tokenId = (await createFungibleItemExpectSuccess(alice, collectionId, {Value: 500n}, alice.address)); + expect(await isTokenExists(api, collectionId, tokenId)).to.be.true; + expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(500n); + expect(await burnItem(api, alice, collectionId, tokenId, 499n)).to.be.true; + expect(await isTokenExists(api, collectionId, tokenId)).to.be.true; + expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(1n); + }); + }); + + it('Burn all tokens ', async () => { + await usingApi(async api => { + const collectionId = (await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}})).collectionId; + const tokenId = (await createFungibleItemExpectSuccess(alice, collectionId, {Value: 500n}, alice.address)); + expect(await isTokenExists(api, collectionId, tokenId)).to.be.true; + expect(await burnItem(api, alice, collectionId, tokenId, 500n)).to.be.true; + expect(await isTokenExists(api, collectionId, tokenId)).to.be.true; + + expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(0n); + expect((await api.rpc.unique.totalPieces(collectionId, tokenId)).value.toBigInt()).to.be.equal(0n); + }); + }); + + it('Set allowance for token', async () => { + await usingApi(async api => { + const collectionId = (await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}})).collectionId; + const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; + + const tokenId = (await createFungibleItemExpectSuccess(alice, collectionId, {Value: 100n}, alice.address)); + expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(100n); + + expect(await approve(api, collectionId, tokenId, alice, bob, 60n)).to.be.true; + expect(await getAllowance(api, collectionId, alice, bob, tokenId)).to.be.equal(60n); + expect(await getBalance(api, collectionId, bob, tokenId)).to.be.equal(0n); + + expect(await transferFrom(api, collectionId, tokenId, bob, alice, bob, 20n)).to.be.true; + expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(80n); + expect(await getBalance(api, collectionId, bob, tokenId)).to.be.equal(20n); + expect(await getAllowance(api, collectionId, alice, bob, tokenId)).to.be.equal(40n); + + await burnFromExpectSuccess(bob, alice, collectionId, tokenId, 10n); + + expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(70n); + expect(await getAllowance(api, collectionId, alice, bob, tokenId)).to.be.equal(30n); + expect(await transferFrom(api, collectionId, tokenId, bob, alice, ethAcc, 10n)).to.be.true; + expect(await getBalance(api, collectionId, ethAcc, tokenId)).to.be.equal(10n); + }); + }); +}); diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index 902377851a..31cc5bfb6c 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -29,7 +29,13 @@ declare module '@polkadot/api-base/types/consts' { [key: string]: Codec; }; common: { + /** + * Maximum admins per collection. + **/ collectionAdminsLimit: u32 & AugmentedConst; + /** + * Set price to create a collection. + **/ collectionCreationPrice: u128 & AugmentedConst; /** * Generic const diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index 04bbef5200..6137a2e2df 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -59,82 +59,47 @@ declare module '@polkadot/api-base/types/events' { }; common: { /** - * * collection_id - * - * * item_id - * - * * sender - * - * * spender - * - * * amount + * Amount pieces of token owned by `sender` was approved for `spender`. **/ Approved: AugmentedEvent; /** * New collection was created - * - * # Arguments - * - * * collection_id: Globally unique identifier of newly created collection. - * - * * mode: [CollectionMode] converted into u8. - * - * * account_id: Collection owner. **/ CollectionCreated: AugmentedEvent; /** * New collection was destroyed - * - * # Arguments - * - * * collection_id: Globally unique identifier of collection. **/ CollectionDestroyed: AugmentedEvent; + /** + * The property has been deleted. + **/ CollectionPropertyDeleted: AugmentedEvent; + /** + * The colletion property has been set. + **/ CollectionPropertySet: AugmentedEvent; /** * New item was created. - * - * # Arguments - * - * * collection_id: Id of the collection where item was created. - * - * * item_id: Id of an item. Unique within the collection. - * - * * recipient: Owner of newly created item - * - * * amount: Always 1 for NFT **/ ItemCreated: AugmentedEvent; /** * Collection item was burned. - * - * # Arguments - * - * * collection_id. - * - * * item_id: Identifier of burned NFT. - * - * * owner: which user has destroyed its tokens - * - * * amount: Always 1 for NFT **/ ItemDestroyed: AugmentedEvent; + /** + * The colletion property permission has been set. + **/ PropertyPermissionSet: AugmentedEvent; + /** + * The token property has been deleted. + **/ TokenPropertyDeleted: AugmentedEvent; + /** + * The token property has been set. + **/ TokenPropertySet: AugmentedEvent; /** * Item was transferred - * - * * collection_id: Id of collection to which item is belong - * - * * item_id: Id of an item - * - * * sender: Original owner of item - * - * * recipient: New owner of item - * - * * amount: Always 1 for NFT **/ Transfer: AugmentedEvent; /** diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 2c2b6f681e..7876f801f3 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -69,24 +69,36 @@ declare module '@polkadot/api-base/types/storage' { [key: string]: QueryableStorageEntry; }; common: { + /** + * Storage of collection admins count. + **/ adminAmount: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; /** * Allowlisted collection users **/ allowlist: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; /** - * Collection info + * Storage of collection info. **/ collectionById: AugmentedQuery Observable>, [u32]> & QueryableStorageEntry; /** - * Collection properties + * Storage of collection properties. **/ collectionProperties: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; + /** + * Storage of collection properties permissions. + **/ collectionPropertyPermissions: AugmentedQuery Observable>, [u32]> & QueryableStorageEntry; + /** + * Storage of the count of created collections. + **/ createdCollectionCount: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Storage of the count of deleted collections. + **/ destroyedCollectionCount: AugmentedQuery Observable, []> & QueryableStorageEntry; /** - * Not used by code, exists only to provide some types to metadata + * Not used by code, exists only to provide some types to metadata. **/ dummyStorageValue: AugmentedQuery Observable>>, []> & QueryableStorageEntry; /** @@ -231,20 +243,42 @@ declare module '@polkadot/api-base/types/storage' { [key: string]: QueryableStorageEntry; }; nonfungible: { + /** + * Amount of tokens owned by account. + **/ accountBalance: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; + /** + * Allowance set by an owner for a spender for a token. + **/ allowance: AugmentedQuery Observable>, [u32, u32]> & QueryableStorageEntry; /** - * Used to enumerate tokens owned by account + * Used to enumerate tokens owned by account. **/ owned: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]> & QueryableStorageEntry; + /** + * Custom data that is serialized to bytes and attached to a token property. + * Currently used to store RMRK data. + **/ tokenAuxProperties: AugmentedQuery Observable>, [u32, u32, UpDataStructsPropertyScope, Bytes]> & QueryableStorageEntry; /** - * Used to enumerate token's children + * Used to enumerate token's children. **/ tokenChildren: AugmentedQuery | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array]) => Observable, [u32, u32, ITuple<[u32, u32]>]> & QueryableStorageEntry]>; + /** + * Custom data serialized to bytes for token. + **/ tokenData: AugmentedQuery Observable>, [u32, u32]> & QueryableStorageEntry; + /** + * Key-Value map stored for token. + **/ tokenProperties: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; + /** + * Amount of burnt tokens for collection. + **/ tokensBurnt: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; + /** + * Amount of tokens minted for collection. + **/ tokensMinted: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; /** * Generic query @@ -430,6 +464,9 @@ declare module '@polkadot/api-base/types/storage' { **/ tokenData: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; tokenProperties: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; + /** + * Amount of burnt tokens for collection + **/ tokensBurnt: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; /** * Amount of tokens minted for collection diff --git a/tests/src/interfaces/augment-api-rpc.ts b/tests/src/interfaces/augment-api-rpc.ts index 9af145e7be..cc3d3864e3 100644 --- a/tests/src/interfaces/augment-api-rpc.ts +++ b/tests/src/interfaces/augment-api-rpc.ts @@ -709,7 +709,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { **/ tokenOwner: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; /** - * Get token owners + * Returns 10 tokens owners in no particular order **/ tokenOwners: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; /** diff --git a/tests/src/interfaces/unique/definitions.ts b/tests/src/interfaces/unique/definitions.ts index 645c154099..c720875268 100644 --- a/tests/src/interfaces/unique/definitions.ts +++ b/tests/src/interfaces/unique/definitions.ts @@ -49,7 +49,7 @@ export default { balance: fun('Get amount of specific account token', [collectionParam, crossAccountParam(), tokenParam], 'u128'), allowance: fun('Get allowed amount', [collectionParam, crossAccountParam('sender'), crossAccountParam('spender'), tokenParam], 'u128'), tokenOwner: fun('Get token owner', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`), - tokenOwners: fun('Get token owners', [collectionParam, tokenParam], `Vec<${CROSS_ACCOUNT_ID_TYPE}>`), + tokenOwners: fun('Returns 10 tokens owners in no particular order', [collectionParam, tokenParam], `Vec<${CROSS_ACCOUNT_ID_TYPE}>`), topmostTokenOwner: fun('Get token owner, in case of nested token - find parent recursive', [collectionParam, tokenParam], `Option<${CROSS_ACCOUNT_ID_TYPE}>`), tokenChildren: fun('Get tokens nested directly into the token', [collectionParam, tokenParam], 'Vec'), constMetadata: fun('Get token constant metadata', [collectionParam, tokenParam], 'Vec'), diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 5b43f7c000..47e70ad096 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -32,6 +32,8 @@ import { repartitionRFT, createCollectionWithPropsExpectSuccess, getDetailedCollectionInfo, + normalizeAccountId, + CrossAccountId, } from './util/helpers'; import chai from 'chai'; @@ -99,6 +101,10 @@ describe('integration test: Refungible functionality:', () => { // tslint:disable-next-line:no-unused-expression expect(ids).to.deep.include.members([aliceID, ethAcc, bobId, ...facelessCrowd]); expect(owners.length == 10).to.be.true; + + const eleven = privateKeyWrapper('11'); + expect(await transfer(api, collectionId, aliceTokenId, alice, eleven, 10n)).to.be.true; + expect((await api.rpc.unique.tokenOwners(collectionId, aliceTokenId)).length).to.be.equal(10); }); }); diff --git a/tests/src/rpc.test.ts b/tests/src/rpc.test.ts index f7ebf5493e..f9d5aa7cf7 100644 --- a/tests/src/rpc.test.ts +++ b/tests/src/rpc.test.ts @@ -48,6 +48,10 @@ describe('integration test: RPC methods', () => { // tslint:disable-next-line:no-unused-expression expect(ids).to.deep.include.members([aliceID, ethAcc, bobId, ...facelessCrowd]); expect(owners.length == 10).to.be.true; + + const eleven = privateKeyWrapper('11'); + expect(await transfer(api, collectionId, aliceTokenId, alice, eleven, 10n)).to.be.true; + expect((await api.rpc.unique.tokenOwners(collectionId, aliceTokenId)).length).to.be.equal(10); }); }); }); \ No newline at end of file From 1792b24d2828e787190bd155f47b9eddde667d53 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 22 Jul 2022 07:45:21 +0000 Subject: [PATCH 0092/1274] chore: fix repartition tests --- tests/src/eth/reFungibleToken.test.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index c2b01407a1..dbea13dca4 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -239,8 +239,7 @@ describe('Refungible: Plain calls', () => { expect(+await contract.methods.balanceOf(owner).call()).to.be.equal(0); expect(+await contract.methods.balanceOf(receiver).call()).to.be.equal(200); - const result = await contract.methods.repartition(150).send({from: receiver}); - console.log(result.events); + await contract.methods.repartition(150).send({from: receiver}); await expect(contract.methods.transfer(owner, 160).send({from: receiver})).to.eventually.be.rejected; expect(+await contract.methods.balanceOf(receiver).call()).to.be.equal(150); }); @@ -261,7 +260,7 @@ describe('Refungible: Plain calls', () => { const result = await contract.methods.repartition(200).send(); const events = normalizeEvents(result.events); - expect(events).to.include.deep.members([ + expect(events).to.deep.equal([ { address, event: 'Transfer', @@ -289,8 +288,7 @@ describe('Refungible: Plain calls', () => { const result = await contract.methods.repartition(50).send(); const events = normalizeEvents(result.events); - - expect(events).to.include.deep.members([ + expect(events).to.deep.equal([ { address, event: 'Transfer', From dd8998750d8f8113e18139cf92de6d3dd073cf10 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 22 Jul 2022 10:16:14 +0200 Subject: [PATCH 0093/1274] Apply suggestions from code review --- pallets/fungible/src/common.rs | 2 +- pallets/fungible/src/lib.rs | 2 +- pallets/refungible/src/common.rs | 2 +- pallets/refungible/src/lib.rs | 2 +- primitives/rpc/src/lib.rs | 2 +- tests/src/refungible.test.ts | 2 +- tests/src/rpc.test.ts | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pallets/fungible/src/common.rs b/pallets/fungible/src/common.rs index c58da0d679..98dc9237d1 100644 --- a/pallets/fungible/src/common.rs +++ b/pallets/fungible/src/common.rs @@ -364,7 +364,7 @@ impl CommonCollectionOperations for FungibleHandle { /// Returns 10 tokens owners in no particular order. fn token_owners(&self, token: TokenId) -> Vec { - >::token_owners(self.id, token).unwrap_or_else(|| vec![]) + >::token_owners(self.id, token).unwrap_or_default() } fn token_property(&self, _token_id: TokenId, _key: &PropertyKey) -> Option { diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index 7811e3607f..b9e1029a62 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -629,7 +629,7 @@ impl Pallet { .take(10) .collect(); - if res.len() == 0 { + if res.is_empty() { None } else { Some(res) diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index 61d4682c6b..bcedc6d534 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -440,7 +440,7 @@ impl CommonCollectionOperations for RefungibleHandle { /// Returns 10 token in no particular order. fn token_owners(&self, token: TokenId) -> Vec { - >::token_owners(self.id, token).unwrap_or_else(|| vec![]) + >::token_owners(self.id, token).unwrap_or_default() } fn token_property(&self, _token_id: TokenId, _key: &PropertyKey) -> Option { diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 68afbecacd..5a5c6f9eb2 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -1150,7 +1150,7 @@ impl Pallet { .take(10) .collect(); - if res.len() == 0 { + if res.is_empty() { None } else { Some(res) diff --git a/primitives/rpc/src/lib.rs b/primitives/rpc/src/lib.rs index 1cc3f519cf..f8c913667b 100644 --- a/primitives/rpc/src/lib.rs +++ b/primitives/rpc/src/lib.rs @@ -81,6 +81,6 @@ sp_api::decl_runtime_apis! { fn next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result>; fn effective_collection_limits(collection_id: CollectionId) -> Result>; fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Result>; - fn token_owners(collection: CollectionId, token: TokenId) -> Result>; + fn token_owners(collection: CollectionId, token: TokenId) -> Result>; } } diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 47e70ad096..623fed8022 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -100,7 +100,7 @@ describe('integration test: Refungible functionality:', () => { // What to expect // tslint:disable-next-line:no-unused-expression expect(ids).to.deep.include.members([aliceID, ethAcc, bobId, ...facelessCrowd]); - expect(owners.length == 10).to.be.true; + expect(owners.length).to.be.equal(10); const eleven = privateKeyWrapper('11'); expect(await transfer(api, collectionId, aliceTokenId, alice, eleven, 10n)).to.be.true; diff --git a/tests/src/rpc.test.ts b/tests/src/rpc.test.ts index f9d5aa7cf7..d76cc574d7 100644 --- a/tests/src/rpc.test.ts +++ b/tests/src/rpc.test.ts @@ -23,7 +23,7 @@ describe('integration test: RPC methods', () => { }); }); - it('RPC method tokenOnewrs for fungible collection and token', async () => { + it('RPC method tokenOwners for fungible collection and token', async () => { await usingApi(async (api, privateKeyWrapper) => { const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; const facelessCrowd = Array.from(Array(7).keys()).map(i => normalizeAccountId(privateKeyWrapper(i.toString()))); From 789afa1372050f58ec34feee35da90c5966b3296 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 22 Jul 2022 10:17:09 +0200 Subject: [PATCH 0094/1274] Update runtime/common/Cargo.toml --- runtime/common/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index bb801ffcd7..2992413835 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -6,7 +6,7 @@ homepage = 'https://unique.network' license = 'All Rights Reserved' name = 'unique-runtime-common' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.9.25' +version = '0.9.24' [features] default = ['std'] From 055cc66f716b8596aa2d910a9bd4813ee77d7d4e Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 22 Jul 2022 08:36:41 +0000 Subject: [PATCH 0095/1274] test: fix refungible construction Signed-off-by: Yaroslav Bolyukin --- runtime/tests/src/tests.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/tests/src/tests.rs b/runtime/tests/src/tests.rs index 2ff49b9025..3a1a803970 100644 --- a/runtime/tests/src/tests.rs +++ b/runtime/tests/src/tests.rs @@ -64,6 +64,12 @@ fn default_re_fungible_data() -> CreateReFungibleData { CreateReFungibleData { const_data: vec![1, 2, 3].try_into().unwrap(), pieces: 1023, + properties: vec![Property { + key: b"test-prop".to_vec().try_into().unwrap(), + value: b"test-nft-prop".to_vec().try_into().unwrap(), + }] + .try_into() + .unwrap(), } } From 26e74f72e2e008f8d8fb222fb88025f1236c0cb1 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 22 Jul 2022 08:37:05 +0000 Subject: [PATCH 0096/1274] build: regenerate lockfile Signed-off-by: Yaroslav Bolyukin --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index b589d91db1..9825e2d0d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12682,7 +12682,7 @@ dependencies = [ [[package]] name = "unique-runtime-common" -version = "0.9.25" +version = "0.9.24" dependencies = [ "evm-coder", "fp-rpc", From 0e74039449d07de2e2f83c4b561de29bd9091c33 Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Fri, 22 Jul 2022 10:24:49 +0000 Subject: [PATCH 0097/1274] doc(rmrk): adjusted for clarity --- pallets/proxy-rmrk-core/src/lib.rs | 89 +++++++++++++++++--------- pallets/proxy-rmrk-core/src/rpc.rs | 2 +- pallets/proxy-rmrk-equip/src/lib.rs | 67 ++++++++++++++----- primitives/rmrk-traits/src/resource.rs | 8 +-- 4 files changed, 114 insertions(+), 52 deletions(-) diff --git a/pallets/proxy-rmrk-core/src/lib.rs b/pallets/proxy-rmrk-core/src/lib.rs index 3b1f2147e5..f08f684748 100644 --- a/pallets/proxy-rmrk-core/src/lib.rs +++ b/pallets/proxy-rmrk-core/src/lib.rs @@ -48,7 +48,43 @@ //! - Docs: //! - FAQ: //! - Substrate code repository: -//! - RMRK spec repository: +//! - RMRK specification repository: +//! +//! ## Terminology +//! +//! For more information on RMRK, see RMRK's own documentation. +//! +//! ### Intro to RMRK +//! +//! - **Resource:** Additional piece of metadata of an NFT usually serving to add +//! a piece of media on top of the root metadata (NFT's own), be it a different wing +//! on the root template bird or something entirely unrelated. +//! +//! - **Base:** A list of possible "components" - Parts, a combination of which can +//! be appended/equipped to/on an NFT. +//! +//! - **Part:** Something that, together with other Parts, can constitute an NFT. +//! Parts are defined in the Base to which they belong. Parts can be either +//! of the `slot` type or `fixed` type. Slots are intended for equippables. +//! Note that "part of something" and "Part of a Base" can be easily confused, +//! and in this documentation these words are distinguished by the capital letter. +//! +//! - **Theme:** Named objects of variable => value pairs which get interpolated into +//! the Base's `themable` Parts. Themes can hold any value, but are often represented +//! in RMRK's examples as colors applied to visible Parts. +//! +//! ### Peculiarities in Unique +//! +//! - **Scoped properties:** Properties that are normally obscured from users. +//! Their purpose is to contain structured metadata that was not included in the Unique standard +//! for collections and tokens, meant to be operated on by proxies and other outliers. +//! Scoped properties are prefixed with `some-scope:`, where `some-scope` is +//! an arbitrary keyword, like "rmrk", and `:` is an unacceptable symbol in user-defined +//! properties, which, along with other safeguards, makes them impossible to tamper with. +//! +//! - **Auxiliary properties:** A slightly different structure of properties, +//! trading universality of use for more convenient storage, writes and access. +//! Meant to be inaccessible to end users. //! //! ## Proxy Implementation //! @@ -74,17 +110,17 @@ //! //! Many of RMRK's native parameters are stored as scoped properties of a collection //! or an NFT on the chain. Scoped properties are prefixed with `rmrk:`, where `:` -//! is an unacceptable symbol in user-defined proeprties, which, along with other safeguards, +//! is an unacceptable symbol in user-defined properties, which, along with other safeguards, //! makes them impossible to tamper with. //! -//! ### Collection and NFT Types +//! ### Collection and NFT Types, and Base, Parts and Themes Handling //! //! RMRK introduces the concept of a Base, which is a catalgoue of Parts, //! possible components of an NFT. Due to its similarity with the functionality //! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes //! are the collection's NFTs. See [`CollectionType`](pallet_rmrk_core::misc::CollectionType) and //! [`NftType`](pallet_rmrk_core::misc::NftType). -//! +//! //! ## Interface //! //! ### Dispatchables @@ -276,9 +312,9 @@ pub mod pallet { /* RMRK compatible events */ /// Only destroying collections without tokens is allowed. CollectionNotEmpty, - /// Could not find an ID for a collection. It is likely there were too many collections created on the chain. + /// Could not find an ID for a collection. It is likely there were too many collections created on the chain, causing an overflow. NoAvailableCollectionId, - /// Token does not exist, or there is no suitable ID for it, likely too many tokens were created in a collection. + /// Token does not exist, or there is no suitable ID for it, likely too many tokens were created in a collection, causing an overflow. NoAvailableNftId, /// Collection does not exist, has a wrong type, or does not map to a Unique ID. CollectionUnknown, @@ -301,7 +337,7 @@ pub mod pallet { CannotRejectNonPendingNft, /// Resource is not pending for the operation. ResourceNotPending, - /// Could not find an ID for the resource. Is is likely there were too many resources created on an NFT. + /// Could not find an ID for the resource. It is likely there were too many resources created on an NFT, causing an overflow. NoAvailableResourceId, } @@ -587,8 +623,9 @@ pub mod pallet { /// # Arguments: /// - `collection_id`: RMRK ID of the collection in which the NFT to burn belongs to. /// - `nft_id`: ID of the NFT to be destroyed. - /// - `max_burns`: Maximum number of tokens to burn, used for nesting. The transaction + /// - `max_burns`: Maximum number of tokens to burn, assuming nesting. The transaction /// is reverted if there are more tokens to burn in the nesting tree than this number. + /// This is primarily a mechanism of transaction weight control. #[transactional] #[pallet::weight(>::burn_nft(*max_burns))] pub fn burn_nft( @@ -1165,11 +1202,7 @@ pub mod pallet { /// Create and set/propose a basic resource for an NFT. /// - /// A resource is considered a part of an NFT, an additional piece of metadata - /// usually serving to add a piece of media on top of the root metadata, be it - /// a different wing on the root template bird or something entirely unrelated. - /// A basic resource is the simplest, lacking a base or composables. - /// + /// A basic resource is the simplest, lacking a Base and anything that comes with it. /// See RMRK docs for more information and examples. /// /// # Permissions: @@ -1211,11 +1244,7 @@ pub mod pallet { /// Create and set/propose a composable resource for an NFT. /// - /// A resource is considered a part of an NFT, an additional piece of metadata - /// usually serving to add a piece of media on top of the root metadata, be it - /// a different wing on the root template bird or something entirely unrelated. - /// A composable resource links to a base and has a subset of its parts it is composed of. - /// + /// A composable resource links to a Base and has a subset of its Parts it is composed of. /// See RMRK docs for more information and examples. /// /// # Permissions: @@ -1277,11 +1306,7 @@ pub mod pallet { /// Create and set/propose a slot resource for an NFT. /// - /// A resource is considered a part of an NFT, an additional piece of metadata - /// usually serving to add a piece of media on top of the root metadata, be it - /// a different wing on the root template bird or something entirely unrelated. - /// A slot resource links to a base and a slot in it which it now occupies. - /// + /// A slot resource links to a Base and a slot ID in it which it can fit into. /// See RMRK docs for more information and examples. /// /// # Permissions: @@ -1575,6 +1600,8 @@ impl Pallet { /// Get incremented resource ID from within an NFT's properties and store the new latest ID. /// Thus, the returned resource ID should be used. + /// + /// Resource IDs are unique only across an NFT. fn acquire_next_resource_id( collection_id: CollectionId, nft_id: TokenId, @@ -1693,8 +1720,8 @@ impl Pallet { Ok(()) } - /// Remove one usage of a base from an NFT's property of associated bases. The base will stay, however, - /// if the count of resources using the base is still non-zero. + /// Remove a Base ID from an NFT if they are associated. + /// The Base itself is deleted if the number of associated NFTs reaches 0. fn remove_associated_base_id( collection_id: CollectionId, nft_id: TokenId, @@ -1837,9 +1864,9 @@ impl Pallet { Self::decode_property_value(&Self::get_collection_property(collection_id, key)?) } - /// Get the type of a collection stored in it as a scoped property. + /// Get the type of a collection stored as a scoped property. /// - /// RMRK Core proxy differentiates between regular collections as well as RMRK bases as collections. + /// RMRK Core proxy differentiates between regular collections as well as RMRK Bases as collections. pub fn get_collection_type( collection_id: CollectionId, ) -> Result { @@ -1921,9 +1948,9 @@ impl Pallet { >::contains_key((collection_id, nft_id)) } - /// Get the type of an NFT stored in it as a scoped property. + /// Get the type of an NFT stored as a scoped property. /// - /// RMRK Core proxy differentiates between regular NFTs, and RMRK parts and themes. + /// RMRK Core proxy differentiates between regular NFTs, and RMRK Parts and Themes. pub fn get_nft_type( collection_id: CollectionId, token_id: TokenId, @@ -2013,8 +2040,8 @@ impl Pallet { }) } - /// Get all non-scoped properties from a collection or a token, and apply some transformation - /// to each key-value pair. + /// Get all non-scoped properties from a collection or a token, and apply some transformation, + /// supplied by `mapper`, to each key-value pair. pub fn iterate_user_properties( collection_id: CollectionId, token_id: Option, diff --git a/pallets/proxy-rmrk-core/src/rpc.rs b/pallets/proxy-rmrk-core/src/rpc.rs index 77985d4ff6..d82a8acdb1 100644 --- a/pallets/proxy-rmrk-core/src/rpc.rs +++ b/pallets/proxy-rmrk-core/src/rpc.rs @@ -224,7 +224,7 @@ pub fn nft_properties( Ok(properties) } -/// Get data of resources of an NFT. +/// Get full information on each resource of an NFT, including pending. pub fn nft_resources( collection_id: RmrkCollectionId, nft_id: RmrkNftId, diff --git a/pallets/proxy-rmrk-equip/src/lib.rs b/pallets/proxy-rmrk-equip/src/lib.rs index 58d7d06ed1..421f91ca84 100644 --- a/pallets/proxy-rmrk-equip/src/lib.rs +++ b/pallets/proxy-rmrk-equip/src/lib.rs @@ -30,7 +30,7 @@ //! of solutions based on RMRK. //! //! RMRK Equip itself contains functionality to equip NFTs, and work with Bases, -//! Parts, and Themes. +//! Parts, and Themes. See [Proxy Implementation](#proxy-implementation) for details. //! //! Equip Proxy is responsible for a more specific area of RMRK, and heavily relies on the Core. //! For a more foundational description of proxy implementation, please refer to [`pallet_rmrk_core`]. @@ -52,6 +52,42 @@ //! - FAQ: //! - Substrate code repository: //! - RMRK spec repository: +//! +//! ## Terminology +//! +//! For more information on RMRK, see RMRK's own documentation. +//! +//! ### Intro to RMRK +//! +//! - **Resource:** Additional piece of metadata of an NFT usually serving to add +//! a piece of media on top of the root metadata (NFT's own), be it a different wing +//! on the root template bird or something entirely unrelated. +//! +//! - **Base:** A list of possible "components" - Parts, a combination of which can +//! be appended/equipped to/on an NFT. +//! +//! - **Part:** Something that, together with other Parts, can constitute an NFT. +//! Parts are defined in the Base to which they belong. Parts can be either +//! of the `slot` type or `fixed` type. Slots are intended for equippables. +//! Note that "part of something" and "Part of a Base" can be easily confused, +//! and in this documentation these words are distinguished by the capital letter. +//! +//! - **Theme:** Named objects of variable => value pairs which get interpolated into +//! the Base's `themable` Parts. Themes can hold any value, but are often represented +//! in RMRK's examples as colors applied to visible Parts. +//! +//! ### Peculiarities in Unique +//! +//! - **Scoped properties:** Properties that are normally obscured from users. +//! Their purpose is to contain structured metadata that was not included in the Unique standard +//! for collections and tokens, meant to be operated on by proxies and other outliers. +//! Scoped properties are prefixed with `some-scope:`, where `some-scope` is +//! an arbitrary keyword, like "rmrk", and `:` is an unacceptable symbol in user-defined +//! properties, which, along with other safeguards, makes them impossible to tamper with. +//! +//! - **Auxiliary properties:** A slightly different structure of properties, +//! trading universality of use for more convenient storage, writes and access. +//! Meant to be inaccessible to end users. //! //! ## Proxy Implementation //! @@ -77,10 +113,10 @@ //! //! Many of RMRK's native parameters are stored as scoped properties of a collection //! or an NFT on the chain. Scoped properties are prefixed with `rmrk:`, where `:` -//! is an unacceptable symbol in user-defined proeprties, which, along with other safeguards, +//! is an unacceptable symbol in user-defined properties, which, along with other safeguards, //! makes them impossible to tamper with. //! -//! ### Collection and NFT Types +//! ### Collection and NFT Types, and Base, Parts and Themes Handling //! //! RMRK introduces the concept of a Base, which is a catalgoue of Parts, //! possible components of an NFT. Due to its similarity with the functionality @@ -134,13 +170,13 @@ pub mod pallet { type WeightInfo: WeightInfo; } - /// Map of a base ID and a part ID to an NFT in the base collection serving as the part. + /// Map of a Base ID and a Part ID to an NFT in the Base collection serving as the Part. #[pallet::storage] #[pallet::getter(fn internal_part_id)] pub type InernalPartId = StorageDoubleMap<_, Twox64Concat, CollectionId, Twox64Concat, RmrkPartId, TokenId>; - /// Checkmark that a base has a Theme NFT named "default". + /// Checkmark that a Base has a Theme NFT named "default". #[pallet::storage] #[pallet::getter(fn base_has_default_theme)] pub type BaseHasDefaultTheme = @@ -167,17 +203,17 @@ pub mod pallet { pub enum Error { /// No permission to perform action. PermissionError, - /// Could not find an ID for a base collection. It is likely there were too many collections created on the chain. + /// Could not find an ID for a Base collection. It is likely there were too many collections created on the chain, causing an overflow. NoAvailableBaseId, - /// Could not find a suitable ID for a part, likely too many part tokens were created in the base. + /// Could not find a suitable ID for a Part, likely too many Part tokens were created in the Base, causing an overflow NoAvailablePartId, /// Base collection linked to this ID does not exist. BaseDoesntExist, - /// No theme named "default" is associated with the Base. + /// No Theme named "default" is associated with the Base. NeedsDefaultThemeFirst, /// Part linked to this ID does not exist. PartDoesntExist, - /// Cannot assign equippables to a fixed part. + /// Cannot assign equippables to a fixed Part. NoEquippableOnFixedPart, } @@ -185,15 +221,15 @@ pub mod pallet { impl Pallet { /// Create a new Base. /// - /// Modeled after the [base interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/base.md) + /// Modeled after the [Base interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/base.md) /// /// # Permissions - /// - Anyone - will be assigned as the issuer of the base. + /// - Anyone - will be assigned as the issuer of the Base. /// /// # Arguments: /// - `base_type`: Arbitrary media type, e.g. "svg". /// - `symbol`: Arbitrary client-chosen symbol. - /// - `parts`: Array of Fixed and Slot parts composing the base, + /// - `parts`: Array of Fixed and Slot Parts composing the Base, /// confined in length by [`RmrkPartsLimit`](up_data_structs::RmrkPartsLimit). #[transactional] #[pallet::weight(>::create_base(parts.len() as u32))] @@ -254,7 +290,7 @@ pub mod pallet { /// Add a Theme to a Base. /// A Theme named "default" is required prior to adding other Themes. /// - /// Modeled after [themeadd interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/themeadd.md). + /// Modeled after [Themeadd interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/themeadd.md). /// /// # Permissions: /// - Base issuer @@ -379,8 +415,7 @@ pub mod pallet { } impl Pallet { - /// Create or renew an NFT serving as a part, setting its properties - /// to those of the part. + /// Create or renew an NFT serving as a Part. fn create_part( sender: &T::CrossAccountId, collection: &NonfungibleHandle, @@ -444,7 +479,7 @@ impl Pallet { Ok(()) } - /// Ensure that the collection under the base ID is a base collection, + /// Ensure that the collection under the Base ID is a Base collection, /// and fetch it. fn get_base(base_id: CollectionId) -> Result, DispatchError> { let collection = diff --git a/primitives/rmrk-traits/src/resource.rs b/primitives/rmrk-traits/src/resource.rs index 80dae24e0d..79fc49d339 100644 --- a/primitives/rmrk-traits/src/resource.rs +++ b/primitives/rmrk-traits/src/resource.rs @@ -151,13 +151,13 @@ pub enum ResourceTypes { "#) )] pub struct ResourceInfo { - /// id is a 5-character string of reasonable uniqueness. - /// The combination of base ID and resource id should be unique across the entire RMRK - /// ecosystem which + /// ID a unique identifier for a resource across all those of a single NFT. + /// The combination of a collection ID, an NFT ID, and the resource ID must be + /// unique across the entire RMRK ecosystem. //#[cfg_attr(feature = "std", serde(with = "serialize::vec"))] pub id: ResourceId, - /// Resource + /// Resource type and the accordingly structured data stored pub resource: ResourceTypes, /// If resource is sent to non-rootowned NFT, pending will be false and need to be accepted From 01c2c9e3dbbd72634f2dbbdd63d3c8ef1cd0f3e3 Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Fri, 22 Jul 2022 10:45:42 +0000 Subject: [PATCH 0098/1274] doc(rmrk): style + minor revisions --- pallets/proxy-rmrk-core/src/lib.rs | 75 +++++++++++++------------- pallets/proxy-rmrk-equip/src/lib.rs | 55 ++++++++++--------- primitives/rmrk-traits/src/resource.rs | 4 +- 3 files changed, 66 insertions(+), 68 deletions(-) diff --git a/pallets/proxy-rmrk-core/src/lib.rs b/pallets/proxy-rmrk-core/src/lib.rs index f08f684748..df9f08c434 100644 --- a/pallets/proxy-rmrk-core/src/lib.rs +++ b/pallets/proxy-rmrk-core/src/lib.rs @@ -49,41 +49,41 @@ //! - FAQ: //! - Substrate code repository: //! - RMRK specification repository: -//! +//! //! ## Terminology -//! +//! //! For more information on RMRK, see RMRK's own documentation. -//! +//! //! ### Intro to RMRK -//! -//! - **Resource:** Additional piece of metadata of an NFT usually serving to add -//! a piece of media on top of the root metadata (NFT's own), be it a different wing +//! +//! - **Resource:** Additional piece of metadata of an NFT usually serving to add +//! a piece of media on top of the root metadata (NFT's own), be it a different wing //! on the root template bird or something entirely unrelated. -//! -//! - **Base:** A list of possible "components" - Parts, a combination of which can +//! +//! - **Base:** A list of possible "components" - Parts, a combination of which can //! be appended/equipped to/on an NFT. -//! -//! - **Part:** Something that, together with other Parts, can constitute an NFT. -//! Parts are defined in the Base to which they belong. Parts can be either +//! +//! - **Part:** Something that, together with other Parts, can constitute an NFT. +//! Parts are defined in the Base to which they belong. Parts can be either //! of the `slot` type or `fixed` type. Slots are intended for equippables. -//! Note that "part of something" and "Part of a Base" can be easily confused, +//! Note that "part of something" and "Part of a Base" can be easily confused, //! and in this documentation these words are distinguished by the capital letter. -//! -//! - **Theme:** Named objects of variable => value pairs which get interpolated into -//! the Base's `themable` Parts. Themes can hold any value, but are often represented +//! +//! - **Theme:** Named objects of variable => value pairs which get interpolated into +//! the Base's `themable` Parts. Themes can hold any value, but are often represented //! in RMRK's examples as colors applied to visible Parts. -//! +//! //! ### Peculiarities in Unique -//! -//! - **Scoped properties:** Properties that are normally obscured from users. -//! Their purpose is to contain structured metadata that was not included in the Unique standard -//! for collections and tokens, meant to be operated on by proxies and other outliers. -//! Scoped properties are prefixed with `some-scope:`, where `some-scope` is -//! an arbitrary keyword, like "rmrk", and `:` is an unacceptable symbol in user-defined +//! +//! - **Scoped properties:** Properties that are normally obscured from users. +//! Their purpose is to contain structured metadata that was not included in the Unique standard +//! for collections and tokens, meant to be operated on by proxies and other outliers. +//! Scoped properties are prefixed with `some-scope:`, where `some-scope` is +//! an arbitrary keyword, like "rmrk", and `:` is an unacceptable symbol in user-defined //! properties, which, along with other safeguards, makes them impossible to tamper with. -//! -//! - **Auxiliary properties:** A slightly different structure of properties, -//! trading universality of use for more convenient storage, writes and access. +//! +//! - **Auxiliary properties:** A slightly different structure of properties, +//! trading universality of use for more convenient storage, writes and access. //! Meant to be inaccessible to end users. //! //! ## Proxy Implementation @@ -118,9 +118,8 @@ //! RMRK introduces the concept of a Base, which is a catalgoue of Parts, //! possible components of an NFT. Due to its similarity with the functionality //! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes -//! are the collection's NFTs. See [`CollectionType`](pallet_rmrk_core::misc::CollectionType) and -//! [`NftType`](pallet_rmrk_core::misc::NftType). -//! +//! are the collection's NFTs. See [`CollectionType`] and [`NftType`]. +//! //! ## Interface //! //! ### Dispatchables @@ -788,7 +787,7 @@ pub mod pallet { /// Accept an NFT sent from another account to self or an owned NFT. /// - /// The NFT in question must be pending, and, thus, be [sent](`crate::pallet::Call::send`) first. + /// The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first. /// /// # Permissions: /// - Token-owner-to-be @@ -880,7 +879,7 @@ pub mod pallet { /// Reject an NFT sent from another account to self or owned NFT. /// The NFT in question will not be sent back and burnt instead. /// - /// The NFT in question must be pending, and, thus, be [sent](`crate::pallet::Call::send`) first. + /// The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first. /// /// # Permissions: /// - Token-owner-to-be-not @@ -945,7 +944,7 @@ pub mod pallet { /// /// This transaction is needed when a resource is created and assigned to an NFT /// by a non-owner, i.e. the collection issuer, with one of the - /// [`add_...` transactions](crate::pallet::Call::add_basic_resource). + /// [`add_...` transactions](Pallet::add_basic_resource). /// /// # Permissions: /// - Token owner @@ -999,7 +998,7 @@ pub mod pallet { /// Accept the removal of a removal-pending resource from an NFT. /// /// This transaction is needed when a non-owner, i.e. the collection issuer, - /// requests a [removal](`crate::pallet::Call::remove_resource`) of a resource from an NFT. + /// requests a [removal](`Pallet::remove_resource`) of a resource from an NFT. /// /// # Permissions: /// - Token owner @@ -1207,7 +1206,7 @@ pub mod pallet { /// /// # Permissions: /// - Collection issuer - if not the token owner, adding the resource will warrant - /// the owner's [acceptance](crate::pallet::Call::accept_resource). + /// the owner's [acceptance](Pallet::accept_resource). /// /// # Arguments: /// - `rmrk_collection_id`: RMRK collection ID of the NFT. @@ -1249,7 +1248,7 @@ pub mod pallet { /// /// # Permissions: /// - Collection issuer - if not the token owner, adding the resource will warrant - /// the owner's [acceptance](crate::pallet::Call::accept_resource). + /// the owner's [acceptance](Pallet::accept_resource). /// /// # Arguments: /// - `rmrk_collection_id`: RMRK collection ID of the NFT. @@ -1311,7 +1310,7 @@ pub mod pallet { /// /// # Permissions: /// - Collection issuer - if not the token owner, adding the resource will warrant - /// the owner's [acceptance](crate::pallet::Call::accept_resource). + /// the owner's [acceptance](Pallet::accept_resource). /// /// # Arguments: /// - `rmrk_collection_id`: RMRK collection ID of the NFT. @@ -1349,7 +1348,7 @@ pub mod pallet { /// Remove and erase a resource from an NFT. /// /// If the sender does not own the NFT, then it will be pending confirmation, - /// and will have to be [accepted](crate::pallet::Call::accept_resource_removal) by the token owner. + /// and will have to be [accepted](Pallet::accept_resource_removal) by the token owner. /// /// # Permissions /// - Collection issuer @@ -1600,7 +1599,7 @@ impl Pallet { /// Get incremented resource ID from within an NFT's properties and store the new latest ID. /// Thus, the returned resource ID should be used. - /// + /// /// Resource IDs are unique only across an NFT. fn acquire_next_resource_id( collection_id: CollectionId, @@ -1720,7 +1719,7 @@ impl Pallet { Ok(()) } - /// Remove a Base ID from an NFT if they are associated. + /// Remove a Base ID from an NFT if they are associated. /// The Base itself is deleted if the number of associated NFTs reaches 0. fn remove_associated_base_id( collection_id: CollectionId, diff --git a/pallets/proxy-rmrk-equip/src/lib.rs b/pallets/proxy-rmrk-equip/src/lib.rs index 421f91ca84..e98c1609b2 100644 --- a/pallets/proxy-rmrk-equip/src/lib.rs +++ b/pallets/proxy-rmrk-equip/src/lib.rs @@ -52,41 +52,41 @@ //! - FAQ: //! - Substrate code repository: //! - RMRK spec repository: -//! +//! //! ## Terminology -//! +//! //! For more information on RMRK, see RMRK's own documentation. -//! +//! //! ### Intro to RMRK -//! -//! - **Resource:** Additional piece of metadata of an NFT usually serving to add -//! a piece of media on top of the root metadata (NFT's own), be it a different wing +//! +//! - **Resource:** Additional piece of metadata of an NFT usually serving to add +//! a piece of media on top of the root metadata (NFT's own), be it a different wing //! on the root template bird or something entirely unrelated. -//! -//! - **Base:** A list of possible "components" - Parts, a combination of which can +//! +//! - **Base:** A list of possible "components" - Parts, a combination of which can //! be appended/equipped to/on an NFT. -//! -//! - **Part:** Something that, together with other Parts, can constitute an NFT. -//! Parts are defined in the Base to which they belong. Parts can be either +//! +//! - **Part:** Something that, together with other Parts, can constitute an NFT. +//! Parts are defined in the Base to which they belong. Parts can be either //! of the `slot` type or `fixed` type. Slots are intended for equippables. -//! Note that "part of something" and "Part of a Base" can be easily confused, +//! Note that "part of something" and "Part of a Base" can be easily confused, //! and in this documentation these words are distinguished by the capital letter. -//! -//! - **Theme:** Named objects of variable => value pairs which get interpolated into -//! the Base's `themable` Parts. Themes can hold any value, but are often represented +//! +//! - **Theme:** Named objects of variable => value pairs which get interpolated into +//! the Base's `themable` Parts. Themes can hold any value, but are often represented //! in RMRK's examples as colors applied to visible Parts. -//! +//! //! ### Peculiarities in Unique -//! -//! - **Scoped properties:** Properties that are normally obscured from users. -//! Their purpose is to contain structured metadata that was not included in the Unique standard -//! for collections and tokens, meant to be operated on by proxies and other outliers. -//! Scoped properties are prefixed with `some-scope:`, where `some-scope` is -//! an arbitrary keyword, like "rmrk", and `:` is an unacceptable symbol in user-defined +//! +//! - **Scoped properties:** Properties that are normally obscured from users. +//! Their purpose is to contain structured metadata that was not included in the Unique standard +//! for collections and tokens, meant to be operated on by proxies and other outliers. +//! Scoped properties are prefixed with `some-scope:`, where `some-scope` is +//! an arbitrary keyword, like "rmrk", and `:` is an unacceptable symbol in user-defined //! properties, which, along with other safeguards, makes them impossible to tamper with. -//! -//! - **Auxiliary properties:** A slightly different structure of properties, -//! trading universality of use for more convenient storage, writes and access. +//! +//! - **Auxiliary properties:** A slightly different structure of properties, +//! trading universality of use for more convenient storage, writes and access. //! Meant to be inaccessible to end users. //! //! ## Proxy Implementation @@ -121,8 +121,7 @@ //! RMRK introduces the concept of a Base, which is a catalgoue of Parts, //! possible components of an NFT. Due to its similarity with the functionality //! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes -//! are the collection's NFTs. See [`CollectionType`](pallet_rmrk_core::misc::CollectionType) and -//! [`NftType`](pallet_rmrk_core::misc::NftType). +//! are the collection's NFTs. See [`CollectionType`] and [`NftType`]. //! //! ## Interface //! @@ -415,7 +414,7 @@ pub mod pallet { } impl Pallet { - /// Create or renew an NFT serving as a Part. + /// Create or renew an NFT serving as a Part inside a collection serving as a Base. fn create_part( sender: &T::CrossAccountId, collection: &NonfungibleHandle, diff --git a/primitives/rmrk-traits/src/resource.rs b/primitives/rmrk-traits/src/resource.rs index 79fc49d339..bd75ef03c9 100644 --- a/primitives/rmrk-traits/src/resource.rs +++ b/primitives/rmrk-traits/src/resource.rs @@ -151,8 +151,8 @@ pub enum ResourceTypes { "#) )] pub struct ResourceInfo { - /// ID a unique identifier for a resource across all those of a single NFT. - /// The combination of a collection ID, an NFT ID, and the resource ID must be + /// ID is a unique identifier for a resource across all those of a single NFT. + /// The combination of a collection ID, an NFT ID, and the resource ID must be /// unique across the entire RMRK ecosystem. //#[cfg_attr(feature = "std", serde(with = "serialize::vec"))] pub id: ResourceId, From 42b27fc67845cf987ee2f7fc3df409f864304f91 Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Fri, 22 Jul 2022 12:22:10 +0000 Subject: [PATCH 0099/1274] doc: minor style + structure error descriptions refactoring --- pallets/nonfungible/src/lib.rs | 12 ++++++------ pallets/structure/src/lib.rs | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 3a3ed3cd68..42d770e7cf 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -206,14 +206,14 @@ pub mod pallet { OnEmpty = up_data_structs::TokenProperties, >; - /// Custom data of a token that is serialized to bytes, - /// primarily reserved for on-chain operations, + /// Custom data of a token that is serialized to bytes, + /// primarily reserved for on-chain operations, /// normally obscured from the external users. - /// - /// Auxiliary properties are slightly different from - /// usual [`TokenProperties`] due to an unlimited number + /// + /// Auxiliary properties are slightly different from + /// usual [`TokenProperties`] due to an unlimited number /// and separately stored and written-to key-value pairs. - /// + /// /// Currently used to store RMRK data. #[pallet::storage] #[pallet::getter(fn token_aux_property)] diff --git a/pallets/structure/src/lib.rs b/pallets/structure/src/lib.rs index c02bf5c5fb..825e9acb12 100644 --- a/pallets/structure/src/lib.rs +++ b/pallets/structure/src/lib.rs @@ -78,11 +78,11 @@ pub mod pallet { #[pallet::error] pub enum Error { - /// While searching for the owner, encountered an already checked account, detecting a loop. + /// While nesting, encountered an already checked account, detecting a loop. OuroborosDetected, - /// While searching for the owner, reached the depth limit. + /// While nesting, reached the depth limit of nesting, exceeding the provided budget. DepthLimit, - /// While iterating over children, reached the breadth limit. + /// While nesting, reached the breadth limit of nesting, exceeding the provided budget. BreadthLimit, /// Couldn't find the token owner that is itself a token. TokenNotFound, From c8805697b40ac5d30c7f0e165a357ea6ac750047 Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Fri, 22 Jul 2022 12:26:52 +0000 Subject: [PATCH 0100/1274] style(tests): eslint --- tests/src/interfaces/unique/definitions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/interfaces/unique/definitions.ts b/tests/src/interfaces/unique/definitions.ts index ea23e93ef7..29daa4c791 100644 --- a/tests/src/interfaces/unique/definitions.ts +++ b/tests/src/interfaces/unique/definitions.ts @@ -66,7 +66,7 @@ export default { tokenOwners: fun( 'Returns 10 tokens owners in no particular order', [collectionParam, tokenParam], - `Vec<${CROSS_ACCOUNT_ID_TYPE}>` + `Vec<${CROSS_ACCOUNT_ID_TYPE}>`, ), tokenChildren: fun( 'Get tokens nested directly into the token', From 27c50a6bb7ad00add24e540ab28c0bb13f7133bb Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Fri, 22 Jul 2022 12:38:27 +0000 Subject: [PATCH 0101/1274] doc(rmrk): minor edits for clarity --- pallets/proxy-rmrk-core/src/lib.rs | 14 +++++++------- pallets/proxy-rmrk-equip/src/lib.rs | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pallets/proxy-rmrk-core/src/lib.rs b/pallets/proxy-rmrk-core/src/lib.rs index df9f08c434..5a26b57013 100644 --- a/pallets/proxy-rmrk-core/src/lib.rs +++ b/pallets/proxy-rmrk-core/src/lib.rs @@ -67,7 +67,7 @@ //! Parts are defined in the Base to which they belong. Parts can be either //! of the `slot` type or `fixed` type. Slots are intended for equippables. //! Note that "part of something" and "Part of a Base" can be easily confused, -//! and in this documentation these words are distinguished by the capital letter. +//! and so in this documentation these words are distinguished by the capital letter. //! //! - **Theme:** Named objects of variable => value pairs which get interpolated into //! the Base's `themable` Parts. Themes can hold any value, but are often represented @@ -78,9 +78,9 @@ //! - **Scoped properties:** Properties that are normally obscured from users. //! Their purpose is to contain structured metadata that was not included in the Unique standard //! for collections and tokens, meant to be operated on by proxies and other outliers. -//! Scoped properties are prefixed with `some-scope:`, where `some-scope` is -//! an arbitrary keyword, like "rmrk", and `:` is an unacceptable symbol in user-defined -//! properties, which, along with other safeguards, makes them impossible to tamper with. +//! Scoped property keys are prefixed with `some-scope:`, where `some-scope` is +//! an arbitrary keyword, like "rmrk". `:` is considered an unacceptable symbol in user-defined +//! properties, which, along with other safeguards, makes scoped ones impossible to tamper with. //! //! - **Auxiliary properties:** A slightly different structure of properties, //! trading universality of use for more convenient storage, writes and access. @@ -91,7 +91,7 @@ //! An external user is supposed to be able to utilize this proxy as they would //! utilize RMRK, and get exactly the same results. Normally, Unique transactions //! are off-limits to RMRK collections and tokens, and vice versa. However, -//! the information stored on chain can be freely interpreted by storage reads and RPCs. +//! the information stored on chain can be freely interpreted by storage reads and Unique RPCs. //! //! ### ID Mapping //! @@ -115,10 +115,10 @@ //! //! ### Collection and NFT Types, and Base, Parts and Themes Handling //! -//! RMRK introduces the concept of a Base, which is a catalgoue of Parts, +//! RMRK introduces the concept of a Base, which is a catalogue of Parts, //! possible components of an NFT. Due to its similarity with the functionality //! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes -//! are the collection's NFTs. See [`CollectionType`] and [`NftType`]. +//! are this collection's NFTs. See [`CollectionType`] and [`NftType`]. //! //! ## Interface //! diff --git a/pallets/proxy-rmrk-equip/src/lib.rs b/pallets/proxy-rmrk-equip/src/lib.rs index e98c1609b2..61d7b80f01 100644 --- a/pallets/proxy-rmrk-equip/src/lib.rs +++ b/pallets/proxy-rmrk-equip/src/lib.rs @@ -70,7 +70,7 @@ //! Parts are defined in the Base to which they belong. Parts can be either //! of the `slot` type or `fixed` type. Slots are intended for equippables. //! Note that "part of something" and "Part of a Base" can be easily confused, -//! and in this documentation these words are distinguished by the capital letter. +//! and so in this documentation these words are distinguished by the capital letter. //! //! - **Theme:** Named objects of variable => value pairs which get interpolated into //! the Base's `themable` Parts. Themes can hold any value, but are often represented @@ -81,9 +81,9 @@ //! - **Scoped properties:** Properties that are normally obscured from users. //! Their purpose is to contain structured metadata that was not included in the Unique standard //! for collections and tokens, meant to be operated on by proxies and other outliers. -//! Scoped properties are prefixed with `some-scope:`, where `some-scope` is -//! an arbitrary keyword, like "rmrk", and `:` is an unacceptable symbol in user-defined -//! properties, which, along with other safeguards, makes them impossible to tamper with. +//! Scoped property keys are prefixed with `some-scope:`, where `some-scope` is +//! an arbitrary keyword, like "rmrk". `:` is considered an unacceptable symbol in user-defined +//! properties, which, along with other safeguards, makes scoped ones impossible to tamper with. //! //! - **Auxiliary properties:** A slightly different structure of properties, //! trading universality of use for more convenient storage, writes and access. @@ -94,7 +94,7 @@ //! An external user is supposed to be able to utilize this proxy as they would //! utilize RMRK, and get exactly the same results. Normally, Unique transactions //! are off-limits to RMRK collections and tokens, and vice versa. However, -//! the information stored on chain can be freely interpreted by storage reads and RPCs. +//! the information stored on chain can be freely interpreted by storage reads and Unique RPCs. //! //! ### ID Mapping //! @@ -118,10 +118,10 @@ //! //! ### Collection and NFT Types, and Base, Parts and Themes Handling //! -//! RMRK introduces the concept of a Base, which is a catalgoue of Parts, +//! RMRK introduces the concept of a Base, which is a catalogue of Parts, //! possible components of an NFT. Due to its similarity with the functionality //! of a token collection, a Base is stored and handled as one, and the Base's Parts and Themes -//! are the collection's NFTs. See [`CollectionType`] and [`NftType`]. +//! are this collection's NFTs. See [`CollectionType`] and [`NftType`]. //! //! ## Interface //! From 717e109aae0c82ca22e213987a6cc8e487ba590e Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Fri, 22 Jul 2022 13:25:11 +0000 Subject: [PATCH 0102/1274] doc(rmrk): requested clarifications --- pallets/proxy-rmrk-core/src/lib.rs | 2 +- pallets/proxy-rmrk-core/src/misc.rs | 9 +++++---- pallets/proxy-rmrk-equip/src/lib.rs | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pallets/proxy-rmrk-core/src/lib.rs b/pallets/proxy-rmrk-core/src/lib.rs index 5a26b57013..f46d71cae3 100644 --- a/pallets/proxy-rmrk-core/src/lib.rs +++ b/pallets/proxy-rmrk-core/src/lib.rs @@ -113,7 +113,7 @@ //! is an unacceptable symbol in user-defined properties, which, along with other safeguards, //! makes them impossible to tamper with. //! -//! ### Collection and NFT Types, and Base, Parts and Themes Handling +//! ### Collection and NFT Types, or Base, Parts and Themes Handling //! //! RMRK introduces the concept of a Base, which is a catalogue of Parts, //! possible components of an NFT. Due to its similarity with the functionality diff --git a/pallets/proxy-rmrk-core/src/misc.rs b/pallets/proxy-rmrk-core/src/misc.rs index 2df4557e62..46a0e6625a 100644 --- a/pallets/proxy-rmrk-core/src/misc.rs +++ b/pallets/proxy-rmrk-core/src/misc.rs @@ -20,7 +20,7 @@ use super::*; use codec::{Encode, Decode, Error}; /// Match errors from one type to another and return an error -/// if a match is successful. +/// if a match is successful. This macro expects a pattern matcher #[macro_export] macro_rules! map_unique_err_to_proxy { (match $err:ident { $($unique_err_ty:ident :: $unique_err:ident => $proxy_err:ident),+ $(,)? }) => { @@ -34,9 +34,10 @@ macro_rules! map_unique_err_to_proxy { }; } -/// Interface to decode bytes from a bounded vector into an arbitrary type. +/// Interface to decode some serialized bytes into an arbitrary type `T`, +/// preferably if these bytes were originally encoded from `T`. pub trait RmrkDecode { - /// Try to decode bytes from a bounded vector into an arbitrary type. + /// Try to decode self into an arbitrary type `T`. fn decode(&self) -> Result; } @@ -48,7 +49,7 @@ impl RmrkDecode for BoundedVec { } } -/// Interface to "rebind", change the limit of a bounded byte vector. +/// Interface to "rebind" - change the limit of a bounded byte vector. pub trait RmrkRebind { /// Try to change the limit of a bounded byte vector. fn rebind(&self) -> Result, Error>; diff --git a/pallets/proxy-rmrk-equip/src/lib.rs b/pallets/proxy-rmrk-equip/src/lib.rs index 61d7b80f01..748a22a1b9 100644 --- a/pallets/proxy-rmrk-equip/src/lib.rs +++ b/pallets/proxy-rmrk-equip/src/lib.rs @@ -116,7 +116,7 @@ //! is an unacceptable symbol in user-defined properties, which, along with other safeguards, //! makes them impossible to tamper with. //! -//! ### Collection and NFT Types, and Base, Parts and Themes Handling +//! ### Collection and NFT Types, or Base, Parts and Themes Handling //! //! RMRK introduces the concept of a Base, which is a catalogue of Parts, //! possible components of an NFT. Due to its similarity with the functionality @@ -414,7 +414,8 @@ pub mod pallet { } impl Pallet { - /// Create or renew an NFT serving as a Part inside a collection serving as a Base. + /// Create (or overwrite) a Part in a Base. + /// The Part and the Base are represented as an NFT and a Collection. fn create_part( sender: &T::CrossAccountId, collection: &NonfungibleHandle, From 4651d7dc50473ef57df2e66360b0c5950fd4467e Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Fri, 22 Jul 2022 13:29:24 +0000 Subject: [PATCH 0103/1274] doc(rmrk): fix an unfinished line --- pallets/proxy-rmrk-core/src/misc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/proxy-rmrk-core/src/misc.rs b/pallets/proxy-rmrk-core/src/misc.rs index 46a0e6625a..9ff6291dce 100644 --- a/pallets/proxy-rmrk-core/src/misc.rs +++ b/pallets/proxy-rmrk-core/src/misc.rs @@ -19,8 +19,8 @@ use super::*; use codec::{Encode, Decode, Error}; -/// Match errors from one type to another and return an error -/// if a match is successful. This macro expects a pattern matcher +/// Match an error to a provided pattern matcher and get +/// the corresponding error of another type if a match is successful. #[macro_export] macro_rules! map_unique_err_to_proxy { (match $err:ident { $($unique_err_ty:ident :: $unique_err:ident => $proxy_err:ident),+ $(,)? }) => { From 2bb23d86e7a06f859bd2c1f83d15ad8d8147ccfb Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Fri, 22 Jul 2022 15:21:27 +0000 Subject: [PATCH 0104/1274] doc(primitives): fix sponsor transfer timeout --- primitives/data-structs/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index b8a6d365bf..2e0d1e0c78 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -389,7 +389,9 @@ pub struct CollectionLimits { /// Maximum amount of tokens inside the collection. Chain default: [`COLLECTION_TOKEN_LIMIT`] pub token_limit: Option, - /// Timeout for sponsoring a token transfer in passed blocks. Chain default: [`MAX_SPONSOR_TIMEOUT`] + /// Timeout for sponsoring a token transfer in passed blocks. Chain default: + /// either [`NFT_SPONSOR_TRANSFER_TIMEOUT`], [`FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT`], or [`REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT`], + /// depending on the collection type. pub sponsor_transfer_timeout: Option, /// Timeout for sponsoring an approval in passed blocks. Chain default: [`SPONSOR_APPROVE_TIMEOUT`] pub sponsor_approve_timeout: Option, From fd07d81141ac9414a838c603c70f2aa7de2a7942 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 11 Jul 2022 10:10:38 +0300 Subject: [PATCH 0105/1274] CORE-441 Add some properties atcollection creation --- pallets/common/src/erc.rs | 55 ++++++++- pallets/nonfungible/src/erc.rs | 2 +- pallets/unique/src/eth/mod.rs | 178 ++++++++++++++++++++++------- primitives/data-structs/src/lib.rs | 4 + 4 files changed, 191 insertions(+), 48 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 6d5e7fbcef..8f949d073f 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -430,10 +430,53 @@ fn save(collection: &CollectionHandle) -> Result { Ok(()) } -/// Get the "tokenURI" key as [PropertyKey](up_data_structs::PropertyKey). -pub fn token_uri_key() -> up_data_structs::PropertyKey { - b"tokenURI" - .to_vec() - .try_into() - .expect("length < limit; qed") +pub mod static_property_key_value { + use evm_coder::{ + execution::{Result, Error}, + }; + use alloc::format; + + const EXPECT_CONVERT_ERROR: &str = "length < limit"; + /// Get the "tokenURI" key as [PropertyKey](up_data_structs::PropertyKey). + pub fn token_uri_key() -> up_data_structs::PropertyKey { + property_key_from_bytes(b"tokenURI").expect(EXPECT_CONVERT_ERROR) + } + + pub fn schema_name_key() -> up_data_structs::PropertyKey { + property_key_from_bytes(b"schemaName").expect(EXPECT_CONVERT_ERROR) + } + + pub fn base_uri_key() -> up_data_structs::PropertyKey { + property_key_from_bytes(b"baseURI").expect(EXPECT_CONVERT_ERROR) + } + + pub fn u_key() -> up_data_structs::PropertyKey { + property_key_from_bytes(b"u").expect(EXPECT_CONVERT_ERROR) + } + + pub fn s_key() -> up_data_structs::PropertyKey { + property_key_from_bytes(b"s").expect(EXPECT_CONVERT_ERROR) + } + + pub fn erc721_value() -> up_data_structs::PropertyValue { + property_value_from_bytes(b"ERC721").expect(EXPECT_CONVERT_ERROR) + } + + pub fn property_key_from_bytes(bytes: &[u8]) -> Result { + bytes.to_vec().try_into().map_err(|_| { + Error::Revert(format!( + "Property key is too long. Max length is {}.", + up_data_structs::PropertyKey::bound() + )) + }) + } + + pub fn property_value_from_bytes(bytes: &[u8]) -> Result { + bytes.to_vec().try_into().map_err(|_| { + Error::Revert(format!( + "Property key is too long. Max length is {}.", + up_data_structs::PropertyKey::bound() + )) + }) + } } diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 97196e3831..ee0d41100a 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -33,7 +33,7 @@ use up_data_structs::{ use pallet_evm_coder_substrate::dispatch_to_evm; use sp_std::vec::Vec; use pallet_common::{ - erc::{CommonEvmHandler, PrecompileResult, CollectionCall, token_uri_key}, + erc::{CommonEvmHandler, PrecompileResult, CollectionCall, static_property_key_value::*}, CollectionHandle, CollectionPropertyPermissions, }; use pallet_evm::{account::CrossAccountId, PrecompileHandle}; diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 6e86a71f7b..c441ba3287 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -17,18 +17,18 @@ //! Implementation of CollectionHelpers contract. use core::marker::PhantomData; -use evm_coder::{execution::*, generate_stubgen, solidity_interface, weight, types::*}; +use evm_coder::{execution::*, generate_stubgen, solidity_interface, solidity, weight, types::*}; use ethereum as _; use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder}; use pallet_evm::{OnMethodCall, PrecompileResult, account::CrossAccountId, PrecompileHandle}; use up_data_structs::{ - CreateCollectionData, MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH, - MAX_COLLECTION_NAME_LENGTH, + CollectionName, CollectionDescription, CollectionTokenPrefix, CreateCollectionData, + CollectionMode, PropertyValue, }; use frame_support::traits::Get; use pallet_common::{ CollectionById, - erc::{token_uri_key, CollectionHelpersEvents}, + erc::{static_property_key_value::*, CollectionHelpersEvents}, }; use crate::{SelfWeightOf, Config, weights::WeightInfo}; @@ -47,6 +47,116 @@ impl WithRecorder for EvmCollectionHelpers { } } +fn convert_data( + caller: caller, + name: string, + description: string, + token_prefix: string, + base_uri: string, +) -> Result<( + T::CrossAccountId, + CollectionName, + CollectionDescription, + CollectionTokenPrefix, + PropertyValue, +)> { + let caller = T::CrossAccountId::from_eth(caller); + let name = name + .encode_utf16() + .collect::>() + .try_into() + .map_err(|_| error_feild_too_long(stringify!(name), CollectionName::bound()))?; + let description = description + .encode_utf16() + .collect::>() + .try_into() + .map_err(|_| { + error_feild_too_long(stringify!(description), CollectionDescription::bound()) + })?; + let token_prefix = token_prefix.into_bytes().try_into().map_err(|_| { + error_feild_too_long(stringify!(token_prefix), CollectionTokenPrefix::bound()) + })?; + let base_uri_value = base_uri + .into_bytes() + .try_into() + .map_err(|_| error_feild_too_long(stringify!(token_prefix), PropertyValue::bound()))?; + Ok((caller, name, description, token_prefix, base_uri_value)) +} + +fn make_data( + name: CollectionName, + mode: CollectionMode, + description: CollectionDescription, + token_prefix: CollectionTokenPrefix, + base_uri_value: PropertyValue, + add_properties: bool, +) -> Result> { + let mut collection_properties = up_data_structs::CollectionPropertiesVec::default(); + let mut token_property_permissions = + up_data_structs::CollectionPropertiesPermissionsVec::default(); + + if add_properties { + token_property_permissions + .try_push(up_data_structs::PropertyKeyPermission { + key: token_uri_key(), + permission: up_data_structs::PropertyPermission { + mutable: true, + collection_admin: true, + token_owner: false, + }, + }) + .map_err(|e| Error::Revert(format!("{:?}", e)))?; + + token_property_permissions + .try_push(up_data_structs::PropertyKeyPermission { + key: u_key(), + permission: up_data_structs::PropertyPermission { + mutable: false, + collection_admin: true, + token_owner: false, + }, + }) + .map_err(|e| Error::Revert(format!("{:?}", e)))?; + + token_property_permissions + .try_push(up_data_structs::PropertyKeyPermission { + key: s_key(), + permission: up_data_structs::PropertyPermission { + mutable: false, + collection_admin: true, + token_owner: false, + }, + }) + .map_err(|e| Error::Revert(format!("{:?}", e)))?; + + collection_properties + .try_push(up_data_structs::Property { + key: schema_name_key(), + value: erc721_value(), + }) + .map_err(|e| Error::Revert(format!("{:?}", e)))?; + + if !base_uri_value.is_empty() { + collection_properties + .try_push(up_data_structs::Property { + key: base_uri_key(), + value: base_uri_value, + }) + .map_err(|e| Error::Revert(format!("{:?}", e)))?; + } + } + + let data = CreateCollectionData { + name, + mode, + description, + token_prefix, + token_property_permissions, + ..Default::default() + }; + Ok(data) +} + /// @title Contract, which allows users to operate with collections #[solidity_interface(name = "CollectionHelpers", events(CollectionHelpersEvents))] impl EvmCollectionHelpers { @@ -63,44 +173,30 @@ impl EvmCollectionHelpers { description: string, token_prefix: string, ) -> Result
{ - let caller = T::CrossAccountId::from_eth(caller); - let name = name - .encode_utf16() - .collect::>() - .try_into() - .map_err(|_| error_feild_too_long(stringify!(name), MAX_COLLECTION_NAME_LENGTH))?; - let description = description - .encode_utf16() - .collect::>() - .try_into() - .map_err(|_| { - error_feild_too_long(stringify!(description), MAX_COLLECTION_DESCRIPTION_LENGTH) - })?; - let token_prefix = token_prefix - .into_bytes() - .try_into() - .map_err(|_| error_feild_too_long(stringify!(token_prefix), MAX_TOKEN_PREFIX_LENGTH))?; - - let key = token_uri_key(); - let permission = up_data_structs::PropertyPermission { - mutable: true, - collection_admin: true, - token_owner: false, - }; - let mut token_property_permissions = - up_data_structs::CollectionPropertiesPermissionsVec::default(); - token_property_permissions - .try_push(up_data_structs::PropertyKeyPermission { key, permission }) - .map_err(|e| Error::Revert(format!("{:?}", e)))?; + let (caller, name, description, token_prefix, _base_uri_value) = + convert_data::(caller, name, description, token_prefix, "".into())?; + let data = make_data::(name, CollectionMode::NFT, description, token_prefix, Default::default(), false)?; + let collection_id = + >::init_collection(caller.clone(), data, false) + .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; - let data = CreateCollectionData { - name, - description, - token_prefix, - token_property_permissions, - ..Default::default() - }; + let address = pallet_common::eth::collection_id_to_address(collection_id); + Ok(address) + } + #[weight(>::create_collection())] + #[solidity(rename_selector = "createERC721MetadataCompatibleCollection")] + fn create_nonfungible_collection_with_properties( + &mut self, + caller: caller, + name: string, + description: string, + token_prefix: string, + base_uri: string, + ) -> Result
{ + let (caller, name, description, token_prefix, base_uri_value) = + convert_data::(caller, name, description, token_prefix, base_uri)?; + let data = make_data::(name, CollectionMode::NFT, description, token_prefix, base_uri_value, true)?; let collection_id = >::init_collection(caller.clone(), data, false) .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; @@ -152,6 +248,6 @@ impl OnMethodCall for CollectionHelpe generate_stubgen!(collection_helper_impl, CollectionHelpersCall<()>, true); generate_stubgen!(collection_helper_iface, CollectionHelpersCall<()>, false); -fn error_feild_too_long(feild: &str, bound: u32) -> Error { +fn error_feild_too_long(feild: &str, bound: usize) -> Error { Error::Revert(format!("{} is too long. Max length is {}.", feild, bound)) } diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 2e0d1e0c78..8ef743fbd1 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -286,6 +286,10 @@ impl Default for SponsorshipState { } } +pub type CollectionName = BoundedVec>; +pub type CollectionDescription = BoundedVec>; +pub type CollectionTokenPrefix = BoundedVec>; + /// Collection parameters, used in storage (see [`RpcCollection`] for the RPC version). #[struct_versioning::versioned(version = 2, upper)] #[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen)] From 2dd986e349cb4da6b609f0473db082d308127ab8 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 18 Jul 2022 06:48:17 +0000 Subject: [PATCH 0106/1274] minor: Changed tokenURI retrieving logic --- pallets/nonfungible/src/erc.rs | 46 ++++++++++++++++++++++++++-------- pallets/unique/src/eth/mod.rs | 7 +++--- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index ee0d41100a..fd68cc4f76 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -39,6 +39,7 @@ use pallet_common::{ use pallet_evm::{account::CrossAccountId, PrecompileHandle}; use pallet_evm_coder_substrate::call; use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _}; +use alloc::string::ToString; use crate::{ AccountBalance, Config, CreateItemData, NonfungibleHandle, Pallet, TokenData, TokensMinted, @@ -218,21 +219,35 @@ impl NonfungibleHandle { /// @return token's const_metadata #[solidity(rename_selector = "tokenURI")] fn token_uri(&self, token_id: uint256) -> Result { - let key = token_uri_key(); - if !has_token_permission::(self.id, &key) { - return Err("No tokenURI permission".into()); + let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?; + + if let Ok(shema_name) = get_token_property(self, token_id, &schema_name_key()) { + if shema_name != "ERC721" { + return Ok("".into()); + } + } else { + return Ok("".into()); } - self.consume_store_reads(1)?; - let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?; + if let Ok(url) = get_token_property(self, token_id, &u_key()) { + if !url.is_empty() { + return Ok(url); + } + } - let properties = >::try_get((self.id, token_id)) - .map_err(|_| Error::Revert("Token properties not found".into()))?; - if let Some(property) = properties.get(&key) { - return Ok(string::from_utf8_lossy(property).into()); + if let Ok(base_uri) = get_token_property(self, token_id, &base_uri_key()) { + if !base_uri.is_empty() { + if let Ok(suffix) = get_token_property(self, token_id, &s_key()) { + if !suffix.is_empty() { + return Ok(base_uri + suffix.as_str()); + } + } + + return Ok(base_uri + token_id.to_string().as_str()); + } } - Err("Property tokenURI not found".into()) + Ok("".into()) } } @@ -520,6 +535,17 @@ impl NonfungibleHandle { } } +fn get_token_property(collection: &CollectionHandle, token_id: u32, key: &up_data_structs::PropertyKey) -> Result { + collection.consume_store_reads(1)?; + let properties = >::try_get((collection.id, token_id)) + .map_err(|_| Error::Revert("Token properties not found".into()))?; + if let Some(property) = properties.get(key) { + return Ok(string::from_utf8_lossy(property).into()); + } + + Err("Property tokenURI not found".into()) +} + fn get_token_permission( collection_id: CollectionId, key: &PropertyKey, diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index c441ba3287..9d5f7ac2af 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -91,7 +91,7 @@ fn make_data( base_uri_value: PropertyValue, add_properties: bool, ) -> Result> { - let mut collection_properties = up_data_structs::CollectionPropertiesVec::default(); + let mut properties = up_data_structs::CollectionPropertiesVec::default(); let mut token_property_permissions = up_data_structs::CollectionPropertiesPermissionsVec::default(); @@ -129,7 +129,7 @@ fn make_data( }) .map_err(|e| Error::Revert(format!("{:?}", e)))?; - collection_properties + properties .try_push(up_data_structs::Property { key: schema_name_key(), value: erc721_value(), @@ -137,7 +137,7 @@ fn make_data( .map_err(|e| Error::Revert(format!("{:?}", e)))?; if !base_uri_value.is_empty() { - collection_properties + properties .try_push(up_data_structs::Property { key: base_uri_key(), value: base_uri_value, @@ -152,6 +152,7 @@ fn make_data( description, token_prefix, token_property_permissions, + properties, ..Default::default() }; Ok(data) From 4458a1dde4ffbaa67fe7fdd45facb4a65a56f9a3 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 19 Jul 2022 08:18:11 +0000 Subject: [PATCH 0107/1274] minor: Fix tokenURI logic. --- pallets/nonfungible/src/erc.rs | 46 +++++++++++++++++++---------- pallets/unique/src/eth/mod.rs | 53 ++++++++++++++++++---------------- 2 files changed, 59 insertions(+), 40 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index fd68cc4f76..c56fb60448 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -219,25 +219,34 @@ impl NonfungibleHandle { /// @return token's const_metadata #[solidity(rename_selector = "tokenURI")] fn token_uri(&self, token_id: uint256) -> Result { - let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?; - - if let Ok(shema_name) = get_token_property(self, token_id, &schema_name_key()) { - if shema_name != "ERC721" { - return Ok("".into()); + let is_erc721 = || { + if let Some(shema_name) = pallet_common::Pallet::::get_collection_property(self.id, &schema_name_key()) { + let shema_name = shema_name.into_inner(); + shema_name == b"ERC721" + } else { + false } - } else { - return Ok("".into()); - } + }; - if let Ok(url) = get_token_property(self, token_id, &u_key()) { + let token_id_u32: u32 = token_id.try_into().map_err(|_| "token id overflow")?; + + if let Ok(url) = get_token_property(self, token_id_u32, &u_key()) { if !url.is_empty() { return Ok(url); } + } else if !is_erc721() { + return Err("tokenURI not set".into()); } - if let Ok(base_uri) = get_token_property(self, token_id, &base_uri_key()) { + if let Some(base_uri) = pallet_common::Pallet::::get_collection_property(self.id, &base_uri_key()) { if !base_uri.is_empty() { - if let Ok(suffix) = get_token_property(self, token_id, &s_key()) { + let base_uri = string::from_utf8(base_uri.into_inner()).map_err(|e| { + Error::Revert(alloc::format!( + "Can not convert value \"baseURI\" to string with error \"{}\"", + e + )) + })?; + if let Ok(suffix) = get_token_property(self, token_id_u32, &s_key()) { if !suffix.is_empty() { return Ok(base_uri + suffix.as_str()); } @@ -484,7 +493,7 @@ impl NonfungibleHandle { token_id: uint256, token_uri: string, ) -> Result { - let key = token_uri_key(); + let key = u_key(); let permission = get_token_permission::(self.id, &key)?; if !permission.collection_admin { return Err("Operation is not allowed".into()); @@ -535,7 +544,11 @@ impl NonfungibleHandle { } } -fn get_token_property(collection: &CollectionHandle, token_id: u32, key: &up_data_structs::PropertyKey) -> Result { +fn get_token_property( + collection: &CollectionHandle, + token_id: u32, + key: &up_data_structs::PropertyKey, +) -> Result { collection.consume_store_reads(1)?; let properties = >::try_get((collection.id, token_id)) .map_err(|_| Error::Revert("Token properties not found".into()))?; @@ -554,8 +567,11 @@ fn get_token_permission( .map_err(|_| Error::Revert("No permissions for collection".into()))?; let a = token_property_permissions .get(key) - .map(|p| p.clone()) - .ok_or_else(|| Error::Revert("No permission".into()))?; + .map(Clone::clone) + .ok_or_else(|| { + let key = string::from_utf8(key.clone().into_inner()).unwrap_or_default(); + Error::Revert(alloc::format!("No permission for key {}", key)) + })?; Ok(a) } diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 9d5f7ac2af..0c7345baed 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -95,29 +95,18 @@ fn make_data( let mut token_property_permissions = up_data_structs::CollectionPropertiesPermissionsVec::default(); - if add_properties { - token_property_permissions - .try_push(up_data_structs::PropertyKeyPermission { - key: token_uri_key(), - permission: up_data_structs::PropertyPermission { - mutable: true, - collection_admin: true, - token_owner: false, - }, - }) - .map_err(|e| Error::Revert(format!("{:?}", e)))?; - - token_property_permissions - .try_push(up_data_structs::PropertyKeyPermission { - key: u_key(), - permission: up_data_structs::PropertyPermission { - mutable: false, - collection_admin: true, - token_owner: false, - }, - }) - .map_err(|e| Error::Revert(format!("{:?}", e)))?; + token_property_permissions + .try_push(up_data_structs::PropertyKeyPermission { + key: u_key(), + permission: up_data_structs::PropertyPermission { + mutable: false, + collection_admin: true, + token_owner: false, + }, + }) + .map_err(|e| Error::Revert(format!("{:?}", e)))?; + if add_properties { token_property_permissions .try_push(up_data_structs::PropertyKeyPermission { key: s_key(), @@ -176,7 +165,14 @@ impl EvmCollectionHelpers { ) -> Result
{ let (caller, name, description, token_prefix, _base_uri_value) = convert_data::(caller, name, description, token_prefix, "".into())?; - let data = make_data::(name, CollectionMode::NFT, description, token_prefix, Default::default(), false)?; + let data = make_data::( + name, + CollectionMode::NFT, + description, + token_prefix, + Default::default(), + false, + )?; let collection_id = >::init_collection(caller.clone(), data, false) .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; @@ -197,9 +193,16 @@ impl EvmCollectionHelpers { ) -> Result
{ let (caller, name, description, token_prefix, base_uri_value) = convert_data::(caller, name, description, token_prefix, base_uri)?; - let data = make_data::(name, CollectionMode::NFT, description, token_prefix, base_uri_value, true)?; + let data = make_data::( + name, + CollectionMode::NFT, + description, + token_prefix, + base_uri_value, + true, + )?; let collection_id = - >::init_collection(caller.clone(), data, false) + >::init_collection(caller.clone(), data, true) .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; let address = pallet_common::eth::collection_id_to_address(collection_id); From a5d69752a6a5eb43dd4e02d9c8a04692caf41d0c Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 19 Jul 2022 08:18:34 +0000 Subject: [PATCH 0108/1274] tests: add tests for tokenURI --- tests/src/eth/nonFungible.test.ts | 143 +++++++++++++++++++++++++++++- 1 file changed, 142 insertions(+), 1 deletion(-) diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 1eda79af1f..d77e42e37e 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -72,8 +72,149 @@ describe('NFT: Information getting', () => { }); }); +describe.only('Check ERC721 token URI', () => { + itWeb3('Empty tokenURI', async ({web3, api, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, owner); + let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', '').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const receiver = createEthAccount(web3); + const contract = evmCollection(web3, owner, collectionIdAddress); + + const nextTokenId = await contract.methods.nextTokenId().call(); + expect(nextTokenId).to.be.equal('1'); + result = await contract.methods.mint( + receiver, + nextTokenId, + ).send(); + + const events = normalizeEvents(result.events); + const address = collectionIdToAddress(collectionId); + + expect(events).to.be.deep.equal([ + { + address, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver, + tokenId: nextTokenId, + }, + }, + ]); + + expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal(''); + }); + + itWeb3('TokenURI from url', async ({web3, api, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, owner); + let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', 'BaseURI_').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const receiver = createEthAccount(web3); + const contract = evmCollection(web3, owner, collectionIdAddress); + + const nextTokenId = await contract.methods.nextTokenId().call(); + expect(nextTokenId).to.be.equal('1'); + result = await contract.methods.mint( + receiver, + nextTokenId, + ).send(); + + // Set URL + await contract.methods.setProperty(nextTokenId, 'u', Buffer.from('Token URI')).send(); + + const events = normalizeEvents(result.events); + const address = collectionIdToAddress(collectionId); + + expect(events).to.be.deep.equal([ + { + address, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver, + tokenId: nextTokenId, + }, + }, + ]); + + expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Token URI'); + }); + + itWeb3('TokenURI from baseURI + tokenId', async ({web3, api, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, owner); + let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', 'BaseURI_').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const receiver = createEthAccount(web3); + const contract = evmCollection(web3, owner, collectionIdAddress); + + const nextTokenId = await contract.methods.nextTokenId().call(); + expect(nextTokenId).to.be.equal('1'); + result = await contract.methods.mint( + receiver, + nextTokenId, + ).send(); + + const events = normalizeEvents(result.events); + const address = collectionIdToAddress(collectionId); + + expect(events).to.be.deep.equal([ + { + address, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver, + tokenId: nextTokenId, + }, + }, + ]); + + expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('BaseURI_' + nextTokenId); + }); + + itWeb3('TokenURI from baseURI + suffix', async ({web3, api, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, owner); + let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', 'BaseURI_').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const receiver = createEthAccount(web3); + const contract = evmCollection(web3, owner, collectionIdAddress); + + const nextTokenId = await contract.methods.nextTokenId().call(); + expect(nextTokenId).to.be.equal('1'); + result = await contract.methods.mint( + receiver, + nextTokenId, + ).send(); + + // Set suffix + const suffix = '/some/suffix'; + await contract.methods.setProperty(nextTokenId, 's', Buffer.from(suffix)).send(); + + const events = normalizeEvents(result.events); + const address = collectionIdToAddress(collectionId); + + expect(events).to.be.deep.equal([ + { + address, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver, + tokenId: nextTokenId, + }, + }, + ]); + + expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('BaseURI_' + suffix); + }); +}); + describe('NFT: Plain calls', () => { - itWeb3('Can perform mint()', async ({web3, api, privateKeyWrapper}) => { + itWeb3.only('Can perform mint()', async ({web3, api, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, owner); let result = await helper.methods.createNonfungibleCollection('Mint collection', '6', '6').send(); From b40c0a2825eaa6f8715328956cca04304da552a8 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 19 Jul 2022 08:19:22 +0000 Subject: [PATCH 0109/1274] misc: generate apis --- .../src/eth/stubs/CollectionHelpers.raw | Bin 1268 -> 1329 bytes .../src/eth/stubs/CollectionHelpers.sol | 18 +++++++++++++++++- tests/src/eth/api/CollectionHelpers.sol | 10 +++++++++- tests/src/eth/collectionHelpersAbi.json | 12 ++++++++++++ 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index 77aaa2c4428e265277238e44ae010dcbb18c5d22..d153e1d7f9589df0ff899a4fb9ec589155a62d57 100644 GIT binary patch literal 1329 zcmZ9MU1%It6vyw`*@_a8O-!bQ4P+=<`<`w~KybxxDdq04nGxo}bF+!qJ601i@t~t5-Ap+tdN(Art!?o&Ng;ghBNp6&OQHg z&OL+MSatC*N~K&Q4vgUDtgH!kI7W!kF)J4JjnC)gIzI9(D<`m%<5lXfWKV7?&%0irog=WqG3hCr*) z)YdgUM;ahD1W=qF$q?*PFQ(_$WE(FCq)ymN6i3YwCD>&zKu~JRXj=+)-N)Cp9rFMk zT~d~SyZpwn|yQwq}v-+(JpEN%JlZ^2XvZO5y~) zRd9PsHem1ShvS0PeA)Qm=!L(@e3i^^ejV?V`5u|qo<03InOlC47EZ7Q!Ja>cMZtcf zXzVKzTdkRi2}RX|#FnvTc4((N;NXiCL8=jMmMs(8DJs}%;-8;Zm`~nvpTarvVdPM) z%|BWG0e>%(PmyZ#b8Lile|lgNXE&i7-L}T4ggaS^s*;A9dxkJ&l zY+b;O_3#Z4aKsBXcye?l=BehwfdNq%9TI(x)qTW6IWaRN&U3_l#4{PeMZxRp^(+jj z>}|w--b=;i4JfoSbkG3m_5bRhW`)@9BuN!EGd8>;LY&3VB4@4k~>g5=@ddVit0`oh|ChsKhZ z$%`LX`2)NNAqNp6F@o0|WWeYlH_atE?5?kRChNp*YN)PyKfd?A z?+uP|#ls^Q3E?ST`W0^-Lr|R6mE`OPv93h93=!vg@YZqX$;K}SryGp*|n;LkShCd+M=Z7#L^cy ztC^LDQlo*h!Bz%M*%~DSkcm$U6<^I4XQ=( zx%pbe;TvSfkUibSi0COOC{HQC(sG%z6ZF-U$1_YLf^>o(mxo+6!Q!n_ba3~sk%QjVR z6^@*BbT@Rjn`cki5Ajc%&Pzndya6BS!vD4kx3#J7C5}~!u#Cb^og|IU_GG4VQEqs*=>N^X*Gs7HEPlhc+sdJc9?5P5(jjF zNv7+EY5j5Ie}Ja-bJ!ikTO^&g{BY#b1VAHq3&_UeBpo-LeT(ZZuFP00Pb^$+tY&gB z2|^Ht`Yot(qSzyquL%SxY7{u8i8VH8VqGeD7PPgauc)xqO^Di4s BusQ$$ diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.sol b/pallets/unique/src/eth/stubs/CollectionHelpers.sol index e46a36e37e..d40e0ac414 100644 --- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol +++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol @@ -29,7 +29,7 @@ contract CollectionHelpersEvents { ); } -// Selector: 20947cd0 +// Selector: 86a0d929 contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { // Selector: createNonfungibleCollection(string,string,string) e34a6844 function createNonfungibleCollection( @@ -45,6 +45,22 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { return 0x0000000000000000000000000000000000000000; } + // Selector: createERC721MetadataCompatibleCollection(string,string,string,string) a634a5f9 + function createERC721MetadataCompatibleCollection( + string memory name, + string memory description, + string memory tokenPrefix, + string memory baseUri + ) public returns (address) { + require(false, stub_error); + name; + description; + tokenPrefix; + baseUri; + dummy = 0; + return 0x0000000000000000000000000000000000000000; + } + // Selector: isCollectionExist(address) c3de1494 function isCollectionExist(address collectionAddress) public diff --git a/tests/src/eth/api/CollectionHelpers.sol b/tests/src/eth/api/CollectionHelpers.sol index ddd545deb4..85eaf757a6 100644 --- a/tests/src/eth/api/CollectionHelpers.sol +++ b/tests/src/eth/api/CollectionHelpers.sol @@ -20,7 +20,7 @@ interface CollectionHelpersEvents { ); } -// Selector: 20947cd0 +// Selector: 86a0d929 interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { // Selector: createNonfungibleCollection(string,string,string) e34a6844 function createNonfungibleCollection( @@ -29,6 +29,14 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory tokenPrefix ) external returns (address); + // Selector: createERC721MetadataCompatibleCollection(string,string,string,string) a634a5f9 + function createERC721MetadataCompatibleCollection( + string memory name, + string memory description, + string memory tokenPrefix, + string memory baseUri + ) external returns (address); + // Selector: isCollectionExist(address) c3de1494 function isCollectionExist(address collectionAddress) external diff --git a/tests/src/eth/collectionHelpersAbi.json b/tests/src/eth/collectionHelpersAbi.json index 93d388eb22..a2c32f03fa 100644 --- a/tests/src/eth/collectionHelpersAbi.json +++ b/tests/src/eth/collectionHelpersAbi.json @@ -18,6 +18,18 @@ "name": "CollectionCreated", "type": "event" }, + { + "inputs": [ + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "description", "type": "string" }, + { "internalType": "string", "name": "tokenPrefix", "type": "string" }, + { "internalType": "string", "name": "baseUri", "type": "string" } + ], + "name": "createERC721MetadataCompatibleCollection", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "string", "name": "name", "type": "string" }, From ee5bb027e6c4f0a28b12e6cdb946a59d8f93e4a1 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 19 Jul 2022 10:00:49 +0000 Subject: [PATCH 0110/1274] fmt --- pallets/nonfungible/src/erc.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index c56fb60448..ddf095fd8e 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -220,7 +220,9 @@ impl NonfungibleHandle { #[solidity(rename_selector = "tokenURI")] fn token_uri(&self, token_id: uint256) -> Result { let is_erc721 = || { - if let Some(shema_name) = pallet_common::Pallet::::get_collection_property(self.id, &schema_name_key()) { + if let Some(shema_name) = + pallet_common::Pallet::::get_collection_property(self.id, &schema_name_key()) + { let shema_name = shema_name.into_inner(); shema_name == b"ERC721" } else { @@ -238,7 +240,9 @@ impl NonfungibleHandle { return Err("tokenURI not set".into()); } - if let Some(base_uri) = pallet_common::Pallet::::get_collection_property(self.id, &base_uri_key()) { + if let Some(base_uri) = + pallet_common::Pallet::::get_collection_property(self.id, &base_uri_key()) + { if !base_uri.is_empty() { let base_uri = string::from_utf8(base_uri.into_inner()).map_err(|e| { Error::Revert(alloc::format!( From e28d35a2cdabb6e92aff531018a14e6a028f03ba Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 19 Jul 2022 10:02:15 +0000 Subject: [PATCH 0111/1274] misk: remove "only" --- tests/src/eth/nonFungible.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index d77e42e37e..c38d1f97d0 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -72,7 +72,7 @@ describe('NFT: Information getting', () => { }); }); -describe.only('Check ERC721 token URI', () => { +describe('Check ERC721 token URI', () => { itWeb3('Empty tokenURI', async ({web3, api, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, owner); @@ -214,7 +214,7 @@ describe.only('Check ERC721 token URI', () => { }); describe('NFT: Plain calls', () => { - itWeb3.only('Can perform mint()', async ({web3, api, privateKeyWrapper}) => { + itWeb3('Can perform mint()', async ({web3, api, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, owner); let result = await helper.methods.createNonfungibleCollection('Mint collection', '6', '6').send(); From 28af23eb71d385a3156f589e5c402befa2310b6f Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 19 Jul 2022 12:19:11 +0000 Subject: [PATCH 0112/1274] misk: rename property value "ERC721" -> "ERC721Metadata" --- pallets/common/src/erc.rs | 3 ++- pallets/nonfungible/src/erc.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 8f949d073f..707695dba4 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -458,8 +458,9 @@ pub mod static_property_key_value { property_key_from_bytes(b"s").expect(EXPECT_CONVERT_ERROR) } + pub const ERC721_METADATA: &[u8] = b"ERC721Metadata"; pub fn erc721_value() -> up_data_structs::PropertyValue { - property_value_from_bytes(b"ERC721").expect(EXPECT_CONVERT_ERROR) + property_value_from_bytes(ERC721_METADATA).expect(EXPECT_CONVERT_ERROR) } pub fn property_key_from_bytes(bytes: &[u8]) -> Result { diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index ddf095fd8e..65301ebc74 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -224,7 +224,7 @@ impl NonfungibleHandle { pallet_common::Pallet::::get_collection_property(self.id, &schema_name_key()) { let shema_name = shema_name.into_inner(); - shema_name == b"ERC721" + shema_name == ERC721_METADATA } else { false } From 6ef230f131ca7a4541a95e4a85dc63cd09dac8c3 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 19 Jul 2022 13:45:44 +0000 Subject: [PATCH 0113/1274] misk: remove token_uri key const. --- pallets/common/src/erc.rs | 4 ---- pallets/nonfungible/src/erc.rs | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 707695dba4..5ba875f163 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -437,10 +437,6 @@ pub mod static_property_key_value { use alloc::format; const EXPECT_CONVERT_ERROR: &str = "length < limit"; - /// Get the "tokenURI" key as [PropertyKey](up_data_structs::PropertyKey). - pub fn token_uri_key() -> up_data_structs::PropertyKey { - property_key_from_bytes(b"tokenURI").expect(EXPECT_CONVERT_ERROR) - } pub fn schema_name_key() -> up_data_structs::PropertyKey { property_key_from_bytes(b"schemaName").expect(EXPECT_CONVERT_ERROR) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 65301ebc74..a324e5f87a 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -702,7 +702,7 @@ impl NonfungibleHandle { to: address, tokens: Vec<(uint256, string)>, ) -> Result { - let key = token_uri_key(); + let key = u_key(); let caller = T::CrossAccountId::from_eth(caller); let to = T::CrossAccountId::from_eth(to); let mut expected_index = >::get(self.id) From 8a86ddfbe791fe6c31f82d7b5092e60d613ef6b0 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 20 Jul 2022 07:50:24 +0000 Subject: [PATCH 0114/1274] misk: Rename property keys --- pallets/common/src/erc.rs | 8 ++++---- pallets/nonfungible/src/erc.rs | 8 ++++---- pallets/unique/src/eth/mod.rs | 4 ++-- tests/src/eth/nonFungible.test.ts | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 5ba875f163..9b5b6ecdad 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -446,12 +446,12 @@ pub mod static_property_key_value { property_key_from_bytes(b"baseURI").expect(EXPECT_CONVERT_ERROR) } - pub fn u_key() -> up_data_structs::PropertyKey { - property_key_from_bytes(b"u").expect(EXPECT_CONVERT_ERROR) + pub fn url_key() -> up_data_structs::PropertyKey { + property_key_from_bytes(b"url").expect(EXPECT_CONVERT_ERROR) } - pub fn s_key() -> up_data_structs::PropertyKey { - property_key_from_bytes(b"s").expect(EXPECT_CONVERT_ERROR) + pub fn suffix_key() -> up_data_structs::PropertyKey { + property_key_from_bytes(b"suffix").expect(EXPECT_CONVERT_ERROR) } pub const ERC721_METADATA: &[u8] = b"ERC721Metadata"; diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index a324e5f87a..3299208c1d 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -232,7 +232,7 @@ impl NonfungibleHandle { let token_id_u32: u32 = token_id.try_into().map_err(|_| "token id overflow")?; - if let Ok(url) = get_token_property(self, token_id_u32, &u_key()) { + if let Ok(url) = get_token_property(self, token_id_u32, &url_key()) { if !url.is_empty() { return Ok(url); } @@ -250,7 +250,7 @@ impl NonfungibleHandle { e )) })?; - if let Ok(suffix) = get_token_property(self, token_id_u32, &s_key()) { + if let Ok(suffix) = get_token_property(self, token_id_u32, &suffix_key()) { if !suffix.is_empty() { return Ok(base_uri + suffix.as_str()); } @@ -497,7 +497,7 @@ impl NonfungibleHandle { token_id: uint256, token_uri: string, ) -> Result { - let key = u_key(); + let key = url_key(); let permission = get_token_permission::(self.id, &key)?; if !permission.collection_admin { return Err("Operation is not allowed".into()); @@ -702,7 +702,7 @@ impl NonfungibleHandle { to: address, tokens: Vec<(uint256, string)>, ) -> Result { - let key = u_key(); + let key = url_key(); let caller = T::CrossAccountId::from_eth(caller); let to = T::CrossAccountId::from_eth(to); let mut expected_index = >::get(self.id) diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 0c7345baed..503eecdf7e 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -97,7 +97,7 @@ fn make_data( token_property_permissions .try_push(up_data_structs::PropertyKeyPermission { - key: u_key(), + key: url_key(), permission: up_data_structs::PropertyPermission { mutable: false, collection_admin: true, @@ -109,7 +109,7 @@ fn make_data( if add_properties { token_property_permissions .try_push(up_data_structs::PropertyKeyPermission { - key: s_key(), + key: suffix_key(), permission: up_data_structs::PropertyPermission { mutable: false, collection_admin: true, diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index c38d1f97d0..0d2d8c95fc 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -122,7 +122,7 @@ describe('Check ERC721 token URI', () => { ).send(); // Set URL - await contract.methods.setProperty(nextTokenId, 'u', Buffer.from('Token URI')).send(); + await contract.methods.setProperty(nextTokenId, 'url', Buffer.from('Token URI')).send(); const events = normalizeEvents(result.events); const address = collectionIdToAddress(collectionId); @@ -192,7 +192,7 @@ describe('Check ERC721 token URI', () => { // Set suffix const suffix = '/some/suffix'; - await contract.methods.setProperty(nextTokenId, 's', Buffer.from(suffix)).send(); + await contract.methods.setProperty(nextTokenId, 'suffix', Buffer.from(suffix)).send(); const events = normalizeEvents(result.events); const address = collectionIdToAddress(collectionId); From bc7b16cd8b495b94a73ecb39ab50eb772a4db63f Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 18 Jul 2022 06:48:17 +0000 Subject: [PATCH 0115/1274] minor: Changed tokenURI retrieving logic --- pallets/unique/src/eth/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 503eecdf7e..032c623c62 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -83,6 +83,7 @@ fn convert_data( Ok((caller, name, description, token_prefix, base_uri_value)) } +// fn make_data( name: CollectionName, mode: CollectionMode, From e5c8c500e665f0f650ea85fcea81e6ba388db179 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 19 Jul 2022 08:18:11 +0000 Subject: [PATCH 0116/1274] minor: Fix tokenURI logic. --- pallets/nonfungible/src/erc.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 3299208c1d..7672870e88 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -238,6 +238,8 @@ impl NonfungibleHandle { } } else if !is_erc721() { return Err("tokenURI not set".into()); + } else if !is_erc721() { + return Err("tokenURI not set".into()); } if let Some(base_uri) = @@ -497,7 +499,7 @@ impl NonfungibleHandle { token_id: uint256, token_uri: string, ) -> Result { - let key = url_key(); + let key = u_key(); let permission = get_token_permission::(self.id, &key)?; if !permission.collection_admin { return Err("Operation is not allowed".into()); From 4375a2d3ddf0cef3988ebe17a18c32de3eb41c76 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 14 Jun 2022 08:52:52 +0000 Subject: [PATCH 0117/1274] CORE-412 Add create_refungible_collection method --- Cargo.lock | 1 + pallets/unique/Cargo.toml | 1 + pallets/unique/src/eth/mod.rs | 22 ++++++++- primitives/data-structs/src/lib.rs | 12 ++--- tests/src/eth/createCollection.test.ts | 68 +++++++++++++------------- 5 files changed, 63 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9825e2d0d4..7d1af4fb7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6649,6 +6649,7 @@ dependencies = [ "pallet-evm", "pallet-evm-coder-substrate", "pallet-nonfungible", + "pallet-refungible", "parity-scale-codec 3.1.5", "scale-info", "serde", diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index 0ebb7be390..6f8f781f1e 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -103,3 +103,4 @@ pallet-common = { default-features = false, path = "../common" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } pallet-nonfungible = { default-features = false, path = '../../pallets/nonfungible' } +pallet-refungible = { default-features = false, path = '../../pallets/refungible' } diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 032c623c62..14765dee05 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -210,6 +210,24 @@ impl EvmCollectionHelpers { Ok(address) } + #[weight(>::create_collection())] + fn create_refungible_collection( + &self, + caller: caller, + name: string, + description: string, + token_prefix: string, + ) -> Result
{ + let (caller, name, description, token_prefix) = + convert_data::(caller, name, description, token_prefix)?; + let data = make_data::(name, description, token_prefix)?; + let collection_id = >::init_collection(caller.clone(), data) + .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; + + let address = pallet_common::eth::collection_id_to_address(collection_id); + Ok(address) + } + /// Check if a collection exists /// @param collection_address Address of the collection in question /// @return bool Does the collection exist? @@ -225,7 +243,9 @@ impl EvmCollectionHelpers { /// Implements [`OnMethodCall`], which delegates call to [`EvmCollectionHelpers`] pub struct CollectionHelpersOnMethodCall(PhantomData<*const T>); -impl OnMethodCall for CollectionHelpersOnMethodCall { +impl OnMethodCall + for CollectionHelpersOnMethodCall +{ fn is_reserved(contract: &sp_core::H160) -> bool { contract == &T::ContractAddress::get() } diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 8ef743fbd1..504b6a7b9f 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -298,9 +298,9 @@ pub struct Collection { pub mode: CollectionMode, #[version(..2)] pub access: AccessMode, - pub name: BoundedVec>, - pub description: BoundedVec>, - pub token_prefix: BoundedVec>, + pub name: CollectionName, + pub description: CollectionDescription, + pub token_prefix: CollectionTokenPrefix, #[version(..2)] pub mint_mode: bool, @@ -354,9 +354,9 @@ pub struct CreateCollectionData { #[derivative(Default(value = "CollectionMode::NFT"))] pub mode: CollectionMode, pub access: Option, - pub name: BoundedVec>, - pub description: BoundedVec>, - pub token_prefix: BoundedVec>, + pub name: CollectionName, + pub description: CollectionDescription, + pub token_prefix: CollectionTokenPrefix, pub pending_sponsor: Option, pub limits: Option, pub permissions: Option, diff --git a/tests/src/eth/createCollection.test.ts b/tests/src/eth/createCollection.test.ts index 0dfae58537..ea0c3b5159 100644 --- a/tests/src/eth/createCollection.test.ts +++ b/tests/src/eth/createCollection.test.ts @@ -27,46 +27,46 @@ import { getCollectionAddressFromResult, } from './util/helpers'; -describe('Create collection from EVM', () => { - // itWeb3('Create collection', async ({api, web3, privateKeyWrapper}) => { - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const collectionHelper = evmCollectionHelpers(web3, owner); - // const collectionName = 'CollectionEVM'; - // const description = 'Some description'; - // const tokenPrefix = 'token prefix'; +describe.only('Create collection from EVM', () => { + itWeb3('Create collection', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelper = evmCollectionHelpers(web3, owner); + const collectionName = 'CollectionEVM'; + const description = 'Some description'; + const tokenPrefix = 'token prefix'; - // const collectionCountBefore = await getCreatedCollectionCount(api); - // const result = await collectionHelper.methods - // .createNonfungibleCollection(collectionName, description, tokenPrefix) - // .send(); - // const collectionCountAfter = await getCreatedCollectionCount(api); + const collectionCountBefore = await getCreatedCollectionCount(api); + const result = await collectionHelper.methods + .createNonfungibleCollection(collectionName, description, tokenPrefix) + .send(); + const collectionCountAfter = await getCreatedCollectionCount(api); - // const {collectionId, collection} = await getCollectionAddressFromResult(api, result); - // expect(collectionCountAfter - collectionCountBefore).to.be.eq(1); - // expect(collectionId).to.be.eq(collectionCountAfter); - // expect(collection.name.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(collectionName); - // expect(collection.description.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(description); - // expect(collection.tokenPrefix.toHuman()).to.be.eq(tokenPrefix); - // }); + const {collectionId, collection} = await getCollectionAddressFromResult(api, result); + expect(collectionCountAfter - collectionCountBefore).to.be.eq(1); + expect(collectionId).to.be.eq(collectionCountAfter); + expect(collection.name.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(collectionName); + expect(collection.description.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(description); + expect(collection.tokenPrefix.toHuman()).to.be.eq(tokenPrefix); + }); - // itWeb3('Check collection address exist', async ({api, web3, privateKeyWrapper}) => { - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const collectionHelpers = evmCollectionHelpers(web3, owner); + itWeb3('Check collection address exist', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelpers = evmCollectionHelpers(web3, owner); - // const expectedCollectionId = await getCreatedCollectionCount(api) + 1; - // const expectedCollectionAddress = collectionIdToAddress(expectedCollectionId); - // expect(await collectionHelpers.methods - // .isCollectionExist(expectedCollectionAddress) - // .call()).to.be.false; + const expectedCollectionId = await getCreatedCollectionCount(api) + 1; + const expectedCollectionAddress = collectionIdToAddress(expectedCollectionId); + expect(await collectionHelpers.methods + .isCollectionExist(expectedCollectionAddress) + .call()).to.be.false; - // await collectionHelpers.methods - // .createNonfungibleCollection('A', 'A', 'A') - // .send(); + await collectionHelpers.methods + .createNonfungibleCollection('A', 'A', 'A') + .send(); - // expect(await collectionHelpers.methods - // .isCollectionExist(expectedCollectionAddress) - // .call()).to.be.true; - // }); + expect(await collectionHelpers.methods + .isCollectionExist(expectedCollectionAddress) + .call()).to.be.true; + }); itWeb3('Set sponsorship', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); From 5364ca9009653b0582ec584134752b0a10bdb645 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 16 Jun 2022 08:21:58 +0000 Subject: [PATCH 0118/1274] CORE-412 Add tests --- Makefile | 7 + tests/src/eth/collectionHelpersAbi.json | 11 + ...on.test.ts => createNFTCollection.test.ts} | 4 +- tests/src/eth/createRFTCollection.test.ts | 230 ++++++++++++++++++ 4 files changed, 250 insertions(+), 2 deletions(-) rename tests/src/eth/{createCollection.test.ts => createNFTCollection.test.ts} (99%) create mode 100644 tests/src/eth/createRFTCollection.test.ts diff --git a/Makefile b/Makefile index 98c5dd31c4..aa753dc4b7 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,9 @@ _help: FUNGIBLE_EVM_STUBS=./pallets/fungible/src/stubs FUNGIBLE_EVM_ABI=./tests/src/eth/fungibleAbi.json +REFUNGIBLE_EVM_STUBS=./pallets/refungible/src/stubs +REFUNGIBLE_EVM_ABI=./tests/src/eth/refungibleAbi.json + NONFUNGIBLE_EVM_STUBS=./pallets/nonfungible/src/stubs NONFUNGIBLE_EVM_ABI=./tests/src/eth/nonFungibleAbi.json @@ -39,6 +42,10 @@ UniqueRefungibleToken.sol: PACKAGE=pallet-refungible NAME=erc_token::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh PACKAGE=pallet-refungible NAME=erc_token::gen_impl OUTPUT=$(REFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh +UniqueRefungibleToken.sol: + PACKAGE=pallet-refungible NAME=erc_token::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh + PACKAGE=pallet-refungible NAME=erc_token::gen_impl OUTPUT=$(REFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh + ContractHelpers.sol: PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_impl OUTPUT=$(CONTRACT_HELPERS_STUBS)/$@ ./.maintain/scripts/generate_sol.sh diff --git a/tests/src/eth/collectionHelpersAbi.json b/tests/src/eth/collectionHelpersAbi.json index a2c32f03fa..8ed51332de 100644 --- a/tests/src/eth/collectionHelpersAbi.json +++ b/tests/src/eth/collectionHelpersAbi.json @@ -41,6 +41,17 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "description", "type": "string" }, + { "internalType": "string", "name": "tokenPrefix", "type": "string" } + ], + "name": "createRefungibleCollection", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { diff --git a/tests/src/eth/createCollection.test.ts b/tests/src/eth/createNFTCollection.test.ts similarity index 99% rename from tests/src/eth/createCollection.test.ts rename to tests/src/eth/createNFTCollection.test.ts index ea0c3b5159..1b6f82bb7e 100644 --- a/tests/src/eth/createCollection.test.ts +++ b/tests/src/eth/createNFTCollection.test.ts @@ -27,7 +27,7 @@ import { getCollectionAddressFromResult, } from './util/helpers'; -describe.only('Create collection from EVM', () => { +describe('Create NFT collection from EVM', () => { itWeb3('Create collection', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelper = evmCollectionHelpers(web3, owner); @@ -144,7 +144,7 @@ describe.only('Create collection from EVM', () => { }); }); -describe('(!negative tests!) Create collection from EVM', () => { +describe('(!negative tests!) Create NFT collection from EVM', () => { itWeb3('(!negative test!) Create collection (bad lengths)', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, owner); diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts new file mode 100644 index 0000000000..7a9207e4a6 --- /dev/null +++ b/tests/src/eth/createRFTCollection.test.ts @@ -0,0 +1,230 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import {evmToAddress} from '@polkadot/util-crypto'; +import {expect} from 'chai'; +import {getCreatedCollectionCount, getDetailedCollectionInfo} from '../util/helpers'; +import { + evmCollectionHelpers, + collectionIdToAddress, + createEthAccount, + createEthAccountWithBalance, + evmCollection, + itWeb3, + getCollectionAddressFromResult, +} from './util/helpers'; + +describe('Create RFT collection from EVM', () => { + itWeb3('Create collection', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelper = evmCollectionHelpers(web3, owner); + const collectionName = 'CollectionEVM'; + const description = 'Some description'; + const tokenPrefix = 'token prefix'; + + const collectionCountBefore = await getCreatedCollectionCount(api); + const result = await collectionHelper.methods + .createRefungibleCollection(collectionName, description, tokenPrefix) + .send(); + const collectionCountAfter = await getCreatedCollectionCount(api); + + const {collectionId, collection} = await getCollectionAddressFromResult(api, result); + expect(collectionCountAfter - collectionCountBefore).to.be.eq(1); + expect(collectionId).to.be.eq(collectionCountAfter); + expect(collection.name.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(collectionName); + expect(collection.description.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(description); + expect(collection.tokenPrefix.toHuman()).to.be.eq(tokenPrefix); + }); + + itWeb3('Check collection address exist', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelpers = evmCollectionHelpers(web3, owner); + + const expectedCollectionId = await getCreatedCollectionCount(api) + 1; + const expectedCollectionAddress = collectionIdToAddress(expectedCollectionId); + expect(await collectionHelpers.methods + .isCollectionExist(expectedCollectionAddress) + .call()).to.be.false; + + await collectionHelpers.methods + .createRefungibleCollection('A', 'A', 'A') + .send(); + + expect(await collectionHelpers.methods + .isCollectionExist(expectedCollectionAddress) + .call()).to.be.true; + }); + + itWeb3('Set sponsorship', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelpers = evmCollectionHelpers(web3, owner); + let result = await collectionHelpers.methods.createRefungibleCollection('Sponsor collection', '1', '1').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + result = await collectionEvm.methods.setCollectionSponsor(sponsor).send(); + let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; + expect(collectionSub.sponsorship.isUnconfirmed).to.be.true; + const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format; + expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); + const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress); + await sponsorCollection.methods.confirmCollectionSponsorship().send(); + collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; + expect(collectionSub.sponsorship.isConfirmed).to.be.true; + expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + }); + + itWeb3('Set limits', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelpers = evmCollectionHelpers(web3, owner); + const result = await collectionHelpers.methods.createRefungibleCollection('Const collection', '5', '5').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const limits = { + accountTokenOwnershipLimit: 1000, + sponsoredDataSize: 1024, + sponsoredDataRateLimit: 30, + tokenLimit: 1000000, + sponsorTransferTimeout: 6, + sponsorApproveTimeout: 6, + ownerCanTransfer: false, + ownerCanDestroy: false, + transfersEnabled: false, + }; + + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + await collectionEvm.methods['setCollectionLimit(string,uint32)']('accountTokenOwnershipLimit', limits.accountTokenOwnershipLimit).send(); + await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsoredDataSize', limits.sponsoredDataSize).send(); + await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsoredDataRateLimit', limits.sponsoredDataRateLimit).send(); + await collectionEvm.methods['setCollectionLimit(string,uint32)']('tokenLimit', limits.tokenLimit).send(); + await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsorTransferTimeout', limits.sponsorTransferTimeout).send(); + await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsorApproveTimeout', limits.sponsorApproveTimeout).send(); + await collectionEvm.methods['setCollectionLimit(string,bool)']('ownerCanTransfer', limits.ownerCanTransfer).send(); + await collectionEvm.methods['setCollectionLimit(string,bool)']('ownerCanDestroy', limits.ownerCanDestroy).send(); + await collectionEvm.methods['setCollectionLimit(string,bool)']('transfersEnabled', limits.transfersEnabled).send(); + + const collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; + expect(collectionSub.limits.accountTokenOwnershipLimit.unwrap().toNumber()).to.be.eq(limits.accountTokenOwnershipLimit); + expect(collectionSub.limits.sponsoredDataSize.unwrap().toNumber()).to.be.eq(limits.sponsoredDataSize); + expect(collectionSub.limits.sponsoredDataRateLimit.unwrap().asBlocks.toNumber()).to.be.eq(limits.sponsoredDataRateLimit); + expect(collectionSub.limits.tokenLimit.unwrap().toNumber()).to.be.eq(limits.tokenLimit); + expect(collectionSub.limits.sponsorTransferTimeout.unwrap().toNumber()).to.be.eq(limits.sponsorTransferTimeout); + expect(collectionSub.limits.sponsorApproveTimeout.unwrap().toNumber()).to.be.eq(limits.sponsorApproveTimeout); + expect(collectionSub.limits.ownerCanTransfer.toHuman()).to.be.eq(limits.ownerCanTransfer); + expect(collectionSub.limits.ownerCanDestroy.toHuman()).to.be.eq(limits.ownerCanDestroy); + expect(collectionSub.limits.transfersEnabled.toHuman()).to.be.eq(limits.transfersEnabled); + }); + + itWeb3('Collection address exist', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionAddressForNonexistentCollection = '0x17C4E6453CC49AAAAEACA894E6D9683E00112233'; + const collectionHelpers = evmCollectionHelpers(web3, owner); + expect(await collectionHelpers.methods + .isCollectionExist(collectionAddressForNonexistentCollection).call()) + .to.be.false; + + const result = await collectionHelpers.methods.createRefungibleCollection('Collection address exist', '7', '7').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + expect(await collectionHelpers.methods + .isCollectionExist(collectionIdAddress).call()) + .to.be.true; + }); +}); + +describe('(!negative tests!) Create RFT collection from EVM', () => { + itWeb3('(!negative test!) Create collection (bad lengths)', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, owner); + { + const MAX_NAME_LENGHT = 64; + const collectionName = 'A'.repeat(MAX_NAME_LENGHT + 1); + const description = 'A'; + const tokenPrefix = 'A'; + + await expect(helper.methods + .createRefungibleCollection(collectionName, description, tokenPrefix) + .call()).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGHT); + + } + { + const MAX_DESCRIPTION_LENGHT = 256; + const collectionName = 'A'; + const description = 'A'.repeat(MAX_DESCRIPTION_LENGHT + 1); + const tokenPrefix = 'A'; + await expect(helper.methods + .createRefungibleCollection(collectionName, description, tokenPrefix) + .call()).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGHT); + } + { + const MAX_TOKEN_PREFIX_LENGHT = 16; + const collectionName = 'A'; + const description = 'A'; + const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGHT + 1); + await expect(helper.methods + .createRefungibleCollection(collectionName, description, tokenPrefix) + .call()).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGHT); + } + }); + + itWeb3('(!negative test!) Create collection (no funds)', async ({web3}) => { + const owner = await createEthAccount(web3); + const helper = evmCollectionHelpers(web3, owner); + const collectionName = 'A'; + const description = 'A'; + const tokenPrefix = 'A'; + + await expect(helper.methods + .createRefungibleCollection(collectionName, description, tokenPrefix) + .call()).to.be.rejectedWith('NotSufficientFounds'); + }); + + itWeb3('(!negative test!) Check owner', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const notOwner = await createEthAccount(web3); + const collectionHelpers = evmCollectionHelpers(web3, owner); + const result = await collectionHelpers.methods.createRefungibleCollection('A', 'A', 'A').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const contractEvmFromNotOwner = evmCollection(web3, notOwner, collectionIdAddress); + const EXPECTED_ERROR = 'NoPermission'; + { + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + await expect(contractEvmFromNotOwner.methods + .setCollectionSponsor(sponsor) + .call()).to.be.rejectedWith(EXPECTED_ERROR); + + const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress); + await expect(sponsorCollection.methods + .confirmCollectionSponsorship() + .call()).to.be.rejectedWith('caller is not set as sponsor'); + } + { + await expect(contractEvmFromNotOwner.methods + .setCollectionLimit('account_token_ownership_limit', '1000') + .call()).to.be.rejectedWith(EXPECTED_ERROR); + } + }); + + itWeb3('(!negative test!) Set limits', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelpers = evmCollectionHelpers(web3, owner); + const result = await collectionHelpers.methods.createRefungibleCollection('Schema collection', 'A', 'A').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + await expect(collectionEvm.methods + .setCollectionLimit('badLimit', 'true') + .call()).to.be.rejectedWith('unknown boolean limit "badLimit"'); + }); +}); \ No newline at end of file From 9629e4b1b28896befb892e7a8fa7a37223874f82 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 22 Jun 2022 13:19:22 +0000 Subject: [PATCH 0119/1274] CORE-412 Set collection mode. --- pallets/unique/src/eth/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 14765dee05..2dd7a0a741 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -220,7 +220,7 @@ impl EvmCollectionHelpers { ) -> Result
{ let (caller, name, description, token_prefix) = convert_data::(caller, name, description, token_prefix)?; - let data = make_data::(name, description, token_prefix)?; + let data = make_data::(name, CollectionMode::ReFungible, description, token_prefix)?; let collection_id = >::init_collection(caller.clone(), data) .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; From 870ccb839806a9325f4248daa9798022775fc188 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 22 Jun 2022 13:37:42 +0000 Subject: [PATCH 0120/1274] CORE-412 Add collection mode checking into tests. --- tests/src/eth/createNFTCollection.test.ts | 1 + tests/src/eth/createRFTCollection.test.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/src/eth/createNFTCollection.test.ts b/tests/src/eth/createNFTCollection.test.ts index 1b6f82bb7e..5557552fa5 100644 --- a/tests/src/eth/createNFTCollection.test.ts +++ b/tests/src/eth/createNFTCollection.test.ts @@ -47,6 +47,7 @@ describe('Create NFT collection from EVM', () => { expect(collection.name.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(collectionName); expect(collection.description.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(description); expect(collection.tokenPrefix.toHuman()).to.be.eq(tokenPrefix); + expect(collection.mode.isNft).to.be.true; }); itWeb3('Check collection address exist', async ({api, web3, privateKeyWrapper}) => { diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts index 7a9207e4a6..0e3f70b769 100644 --- a/tests/src/eth/createRFTCollection.test.ts +++ b/tests/src/eth/createRFTCollection.test.ts @@ -47,6 +47,7 @@ describe('Create RFT collection from EVM', () => { expect(collection.name.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(collectionName); expect(collection.description.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(description); expect(collection.tokenPrefix.toHuman()).to.be.eq(tokenPrefix); + expect(collection.mode.isReFungible).to.be.true; }); itWeb3('Check collection address exist', async ({api, web3, privateKeyWrapper}) => { From ce8edd2b99b74f4f1f7ca87733bc4adb7d13e3d9 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 22 Jun 2022 13:38:29 +0000 Subject: [PATCH 0121/1274] Cargo fmt --- pallets/unique/src/eth/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 2dd7a0a741..0a03cc8a22 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -23,7 +23,7 @@ use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder}; use pallet_evm::{OnMethodCall, PrecompileResult, account::CrossAccountId, PrecompileHandle}; use up_data_structs::{ CollectionName, CollectionDescription, CollectionTokenPrefix, CreateCollectionData, - CollectionMode, PropertyValue, + CollectionMode, PropertyValue, CollectionTokenPrefix, }; use frame_support::traits::Get; use pallet_common::{ From b5e8dff6d126ba94055832a0df80ca9a7b16ff46 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 22 Jul 2022 09:37:45 +0000 Subject: [PATCH 0122/1274] misc: fix after rebase --- pallets/unique/src/eth/mod.rs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 0a03cc8a22..4229f939f2 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -23,7 +23,7 @@ use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder}; use pallet_evm::{OnMethodCall, PrecompileResult, account::CrossAccountId, PrecompileHandle}; use up_data_structs::{ CollectionName, CollectionDescription, CollectionTokenPrefix, CreateCollectionData, - CollectionMode, PropertyValue, CollectionTokenPrefix, + CollectionMode, PropertyValue, }; use frame_support::traits::Get; use pallet_common::{ @@ -150,7 +150,10 @@ fn make_data( /// @title Contract, which allows users to operate with collections #[solidity_interface(name = "CollectionHelpers", events(CollectionHelpersEvents))] -impl EvmCollectionHelpers { +impl EvmCollectionHelpers +where + T: Config + pallet_nonfungible::Config + pallet_refungible::Config +{ /// Create an NFT collection /// @param name Name of the collection /// @param description Informative description of the collection @@ -218,9 +221,16 @@ impl EvmCollectionHelpers { description: string, token_prefix: string, ) -> Result
{ - let (caller, name, description, token_prefix) = - convert_data::(caller, name, description, token_prefix)?; - let data = make_data::(name, CollectionMode::ReFungible, description, token_prefix)?; + let (caller, name, description, token_prefix, _base_uri) = + convert_data::(caller, name, description, token_prefix, "".into())?; + let data = make_data::( + name, + CollectionMode::ReFungible, + description, + token_prefix, + Default::default(), + false, + )?; let collection_id = >::init_collection(caller.clone(), data) .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; From 5ec07294ed3b7046bde317548eb0abd64ca5ec5a Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 22 Jul 2022 09:38:12 +0000 Subject: [PATCH 0123/1274] misk: fix in progress --- .../src/eth/stubs/CollectionHelpers.raw | Bin 1329 -> 1340 bytes .../src/eth/stubs/CollectionHelpers.sol | 16 ++++++++++- tests/src/eth/api/CollectionHelpers.sol | 9 +++++- tests/src/eth/createRFTCollection.test.ts | 27 ++++++++++-------- 4 files changed, 38 insertions(+), 14 deletions(-) diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index d153e1d7f9589df0ff899a4fb9ec589155a62d57..29e05479222b237aa9a423ca1ff43c396095c95a 100644 GIT binary patch delta 749 zcmYk3O=uHQ5XX1k+oI%RQj#q(wrnZr!H-gEJc+I}hzR0#ku0)m-)j$64|?lC!R$w} z8|`JYuU5TP(29DgAR?kD1S=i{FTF{L6c36b2tAZi9^q2zk=jWlll!fn@_k| zUro<(^CdUePEHqEfI$Rv%b>zlDqKE9L@N9&a&MX4fNUa&WAKjMhrUbK!%RDdPJ~{& z3auA;BLYMjpFE!XM84%Ljfg;nwVF@y08c98W)1sWAtl>o+?%1oU#^_bw(`6VNF#@{ zmSm+VNNf=8hXOl|`nFH#6ecM2vnxpM_qgM6r)XIG8jhv8M6Of;QW**h>?zt?BBbnw zy{k@0u;DpXpfFlA=2RlPkgusN0_}(iloB}x}D5)mpzM_k*B zn$%P^P=mA@gm*B*->i6{5_ExmMN$dPwA55C(b9&`vUP3a(gXUMj=iA~t?5#K` ozrVLxe?y0lI+^;|@8_%g_WVgb{&DQ^=+gZ9hf|{cIp`Vr2bT{8*8l(j delta 816 zcmZ9KPiWIn9LMwCYem;fH`~hCz(`RC>S4?Xf`@{FC_`RDX%0E~d)q)SqKEA;7&I?w zo5?&RP3zTpn2LWGLli-8>cM&RA|9kN5Kk)XGSN|gY0_>iA@KYC-skuI{dsvaur`o} zHWYL?29}h%Cz2^Y-66k&G|5*c4Nx>_k6P2D^WkAeC`H4XesFr_51R96zWthMqInO^ zjmy_Bp!v)&L9wKRA~8Y>90i>{Q_)vZydvm3*NMwv z(`tQZtS=EF==VN>O&4|%|0045cA##%J3V8=ji_VG(Lt$}BoJGU;=Y`mC75PF#mP0e zS#$QKB@;{!W)k`HHw_?oq0BM_dxGhm;d;*2U7Os+0%1T|3V%9J1;wn(bXKqxLzb#G z(Y+e+@M_qdU_Eg}-8x*DN=?o^|M_F}+|jLxE31#!Zy0Njihn=7pG{pHdm5yY { .call()).to.be.true; }); - itWeb3('Set sponsorship', async ({api, web3, privateKeyWrapper}) => { + itWeb3.only('Set sponsorship', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelpers = evmCollectionHelpers(web3, owner); let result = await collectionHelpers.methods.createRefungibleCollection('Sponsor collection', '1', '1').send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - result = await collectionEvm.methods.setCollectionSponsor(sponsor).send(); - let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - expect(collectionSub.sponsorship.isUnconfirmed).to.be.true; - const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format; - expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); - await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); - const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress); - await sponsorCollection.methods.confirmCollectionSponsorship().send(); - collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - expect(collectionSub.sponsorship.isConfirmed).to.be.true; - expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + result = await collectionEvm.methods.setCollectionSponsor(sponsor).call(); + // let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; + // expect(collectionSub.sponsorship.isUnconfirmed).to.be.true; + // const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format; + // expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + // await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); + // const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress); + // await sponsorCollection.methods.confirmCollectionSponsorship().send(); + // collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; + // expect(collectionSub.sponsorship.isConfirmed).to.be.true; + // expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); }); + // fixtest itWeb3('Set limits', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelpers = evmCollectionHelpers(web3, owner); @@ -192,6 +193,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { .call()).to.be.rejectedWith('NotSufficientFounds'); }); + // fixtest itWeb3('(!negative test!) Check owner', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const notOwner = await createEthAccount(web3); @@ -218,6 +220,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { } }); + // fixtest itWeb3('(!negative test!) Set limits', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelpers = evmCollectionHelpers(web3, owner); From 62c5b0c7ca9462f8f630a893e25f689b6465e94e Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 22 Jul 2022 14:15:26 +0000 Subject: [PATCH 0124/1274] misk: fix after rebase --- Makefile | 15 +- pallets/nonfungible/src/erc.rs | 4 +- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4116 -> 3975 bytes pallets/refungible/src/erc.rs | 2 +- pallets/refungible/src/stubs/UniqueRFT.raw | Bin 0 -> 2199 bytes pallets/refungible/src/stubs/UniqueRFT.sol | 251 ++++++++++++++++++ .../refungible/src/stubs/UniqueRefungible.raw | 1 - .../src/stubs/UniqueRefungibleToken.raw | Bin 1477 -> 1340 bytes .../src/stubs/UniqueRefungibleToken.sol | 43 +++ tests/src/eth/api/UniqueRFT.sol | 163 ++++++++++++ tests/src/eth/api/UniqueRefungibleToken.sol | 43 +++ tests/src/eth/createRFTCollection.test.ts | 35 ++- tests/src/eth/refungibleAbi.json | 167 ++++++++++++ tests/src/eth/util/helpers.ts | 27 +- 14 files changed, 717 insertions(+), 34 deletions(-) create mode 100644 pallets/refungible/src/stubs/UniqueRFT.raw create mode 100644 pallets/refungible/src/stubs/UniqueRFT.sol delete mode 100644 pallets/refungible/src/stubs/UniqueRefungible.raw create mode 100644 tests/src/eth/api/UniqueRFT.sol create mode 100644 tests/src/eth/refungibleAbi.json diff --git a/Makefile b/Makefile index aa753dc4b7..f94c0321ce 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,6 @@ REFUNGIBLE_EVM_ABI=./tests/src/eth/refungibleAbi.json NONFUNGIBLE_EVM_STUBS=./pallets/nonfungible/src/stubs NONFUNGIBLE_EVM_ABI=./tests/src/eth/nonFungibleAbi.json -REFUNGIBLE_EVM_STUBS=./pallets/refungible/src/stubs RENFUNGIBLE_EVM_ABI=./tests/src/eth/reFungibleAbi.json RENFUNGIBLE_TOKEN_EVM_ABI=./tests/src/eth/reFungibleTokenAbi.json @@ -28,7 +27,7 @@ COLLECTION_HELPER_ABI=./tests/src/eth/collectionHelpersAbi.json TESTS_API=./tests/src/eth/api/ .PHONY: regenerate_solidity -regenerate_solidity: UniqueFungible.sol UniqueNFT.sol UniqueRefungibleToken.sol ContractHelpers.sol CollectionHelpers.sol +regenerate_solidity: UniqueFungible.sol UniqueNFT.sol UniqueRefungible.sol UniqueRefungibleToken.sol ContractHelpers.sol CollectionHelpers.sol UniqueFungible.sol: PACKAGE=pallet-fungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh @@ -38,9 +37,9 @@ UniqueNFT.sol: PACKAGE=pallet-nonfungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh PACKAGE=pallet-nonfungible NAME=erc::gen_impl OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh -UniqueRefungibleToken.sol: - PACKAGE=pallet-refungible NAME=erc_token::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh - PACKAGE=pallet-refungible NAME=erc_token::gen_impl OUTPUT=$(REFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh +UniqueRFT.sol: + PACKAGE=pallet-refungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh + PACKAGE=pallet-refungible NAME=erc::gen_impl OUTPUT=$(REFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh UniqueRefungibleToken.sol: PACKAGE=pallet-refungible NAME=erc_token::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh @@ -66,6 +65,10 @@ UniqueRefungibleToken: UniqueRefungibleToken.sol INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_EVM_STUBS)/UniqueRefungibleToken.raw ./.maintain/scripts/compile_stub.sh INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(RENFUNGIBLE_TOKEN_EVM_ABI) ./.maintain/scripts/generate_abi.sh +UniqueRefungible: UniqueRFT.sol + INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_EVM_STUBS)/UniqueRFT.raw ./.maintain/scripts/compile_stub.sh + INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_EVM_ABI) ./.maintain/scripts/generate_abi.sh + ContractHelpers: ContractHelpers.sol INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_STUBS)/ContractHelpers.raw ./.maintain/scripts/compile_stub.sh INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_ABI) ./.maintain/scripts/generate_abi.sh @@ -74,7 +77,7 @@ CollectionHelpers: CollectionHelpers.sol INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_STUBS)/CollectionHelpers.raw ./.maintain/scripts/compile_stub.sh INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_ABI) ./.maintain/scripts/generate_abi.sh -evm_stubs: UniqueFungible UniqueNFT UniqueRefungibleToken ContractHelpers CollectionHelpers +evm_stubs: UniqueFungible UniqueNFT UniqueRefungible UniqueRefungibleToken ContractHelpers CollectionHelpers .PHONY: _bench _bench: diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 7672870e88..3299208c1d 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -238,8 +238,6 @@ impl NonfungibleHandle { } } else if !is_erc721() { return Err("tokenURI not set".into()); - } else if !is_erc721() { - return Err("tokenURI not set".into()); } if let Some(base_uri) = @@ -499,7 +497,7 @@ impl NonfungibleHandle { token_id: uint256, token_uri: string, ) -> Result { - let key = u_key(); + let key = url_key(); let permission = get_token_permission::(self.id, &key)?; if !permission.collection_admin { return Err("Operation is not allowed".into()); diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 13f4c8286d9280b207ce328f0973cee7c259b7c5..5b50478e513055544d0d034d0ea76c2577dccd95 100644 GIT binary patch delta 423 zcmX|6O)mpc6n!^DY)UmTQXw4{!VV!~BSK;!B-2SdBi`mtH9|s2%6i^=RgKuZ*NTq? z5q^PmVPR!y!Nwo3Xsr4Nh~k!TH}~V5lXK6JT}*`dg3~Szppeql8P*=)<)lbv7#lJO z25oJC&TPu#&Y0+=X~IV)>fFgNusyCsif#)HO4Z{UnTs|uTVn!9+bp4^2-+r1Ax*;_ zDKHVG>ChKR{ECNGUO?ABCIA5nY1J^g^Nj+oWXJEKk}6IAfYC&0_+8LT)E-Kv(H?2j z9_K>+@E^!grin?=lgAOH?9s{+w7&TmD$6(=Z53^iO%$ZtZ1%PWZ6gH3aODPWBH_Is zL~11bitk&>Eh;#6eh=(WQbtWF`M!*H29Z}^ruG!Lx&ZnBf(U(*hZD!)&e7Sa^H<*I zRd#)QHMi6sv!BP;Zbx_LuXidR=ZjTi_09EV-|hOcTkMeKndVqFx7D(-GRs=q%C+{v EZ>pP&xc~qF delta 546 zcmYk2ziSjh6vyXr2DP}{9pqMzJ-GD{F_nTr5ep+WX$*5qc1M`PcNZH$5R*zQZf9=y zl3+8(9bzTg+4`eUga{V?0ZAc6)sX4G!Q-U&3|GV0`t6$jU$jMl9%hvLsj|c({2PWWFMm*Cr#KEwd z-@Q;WL1Cd?|E`;GApU2&}HPds9W9{*DELHFRdRw vx6?ho_Pf!3`u@T4_M2Z{zBb=I{uaD_)!zSf>+;R@JGWP_iX)Zrjmqi2MuV;3 diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 267290a690..fc5ec5c97f 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -38,7 +38,7 @@ impl CommonEvmHandler for RefungibleHandle where T::AccountId: From<[u8; 32]>, { - const CODE: &'static [u8] = include_bytes!("./stubs/UniqueRefungible.raw"); + const CODE: &'static [u8] = include_bytes!("./stubs/UniqueRFT.raw"); fn call( self, handle: &mut impl PrecompileHandle, diff --git a/pallets/refungible/src/stubs/UniqueRFT.raw b/pallets/refungible/src/stubs/UniqueRFT.raw new file mode 100644 index 0000000000000000000000000000000000000000..a759b1051ce5ce044553cf3526efb0cf4f34c445 GIT binary patch literal 2199 zcmaJ?ZHN_B7@jjTch*ScuDaLOUD`oSh{yuFep72<2x-k7+?iqs&e^-GZs@w^vRD$H zIdkW(OC&RQ#a5zH|0IM|;13NFN}{4vhzk0E{E?DG1t~?+x;IzOMAz_bz z|C4Skh$sBk1dEdBK@230K)^mVgu#?EwHW^&07s7JaUr>9u#evZ7E{hT9wolt8HoaC z$`zOH7lqjJs44Qk#)#pTpWL`_H@(y$BVI&xn=YXWQi>zX@mPz)8G&jwRj%En9HmL} z&S!a3eMO!T6RRS<)XB@+DoM>dK@^h=!e-HRBSR;$Omu1p@Fa2@>@GPX^#|uACq?zqH z>*|XL;W|_jLNx@~z44#F0rvu~51!owSOs(+H15l!eWQyH10G6q}kyVT=UqN-IzJdy>3ms4K7}?Co#zgpz6h4fubeE#G zHXma`B<8UeT?4OftWAK2m9(Fc>iMSCy-llf<0`kfX@w1EyyT8Ft-g_~Um5vX#+T?+ zFNu$lXX1z%OQ2WPde9W(Nso4DQCvuZ2T6_?Qs{lW<2=3G0jW-yT9l?QBz|OWlc>(^ zSoAhZUgW6Me5M{qdy>p1+?k@H&23}qo2i(oCj?XXI^KBAvM{|3j1N+aa z1?liaDsMak>!;5EQledg(607^Pqs~EpWiA(enA`4?sD;C>bEjQI}2%=72p_ZYrt5O zFqpQPc2yEr=r>b;#}#1--wuL+NG40;5Q3TkSt$dr1ccbriQu*f$Xuq4r91>41Vw6w zglVQs6elwXWi7O~Gf&0oP?9S_JC|8%7puW2%w(A?>7f`~DdTd=umXhXlW-o>{>p50 zBNW)JlI|8;R?Vu(>tUwA`l8GjU2j&bO%L#`z%qTk0 zA#0-y@0j0F47_K__Yw!L7S$wi`T(Hw0lZbV_>>606Ehp&Ju_azdlnRGmKO%{IWtaA zKWAb6H47)b(JBd&yUNF-ZG7$GL7dNwD=uqkMfy|i)q=1`1vzY`0_9~%j_`bYRT+HC zovy#7B8V-!K8DEuaJ+!LYFVCj=*WaDV)8jRkM|7>ZQb+qqPgaEmD;nHZ9h22n|R{D zv7wP;pRVgX?Y%KEa>vTC13#RUpL10((a0vMPC`v3p{ literal 0 HcmV?d00001 diff --git a/pallets/refungible/src/stubs/UniqueRFT.sol b/pallets/refungible/src/stubs/UniqueRFT.sol new file mode 100644 index 0000000000..6ea56fbdd2 --- /dev/null +++ b/pallets/refungible/src/stubs/UniqueRFT.sol @@ -0,0 +1,251 @@ +// SPDX-License-Identifier: OTHER +// This code is automatically generated + +pragma solidity >=0.8.0 <0.9.0; + +// Common stubs holder +contract Dummy { + uint8 dummy; + string stub_error = "this contract is implemented in native"; +} + +contract ERC165 is Dummy { + function supportsInterface(bytes4 interfaceID) + external + view + returns (bool) + { + require(false, stub_error); + interfaceID; + return true; + } +} + +// Selector: 7d9262e6 +contract Collection is Dummy, ERC165 { + // Set collection property. + // + // @param key Property key. + // @param value Propery value. + // + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + public + { + require(false, stub_error); + key; + value; + dummy = 0; + } + + // Delete collection property. + // + // @param key Property key. + // + // Selector: deleteCollectionProperty(string) 7b7debce + function deleteCollectionProperty(string memory key) public { + require(false, stub_error); + key; + dummy = 0; + } + + // Get collection property. + // + // @dev Throws error if key not found. + // + // @param key Property key. + // @return bytes The property corresponding to the key. + // + // Selector: collectionProperty(string) cf24fd6d + function collectionProperty(string memory key) + public + view + returns (bytes memory) + { + require(false, stub_error); + key; + dummy; + return hex""; + } + + // Set the sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) public { + require(false, stub_error); + sponsor; + dummy = 0; + } + + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() public { + require(false, stub_error); + dummy = 0; + } + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) public { + require(false, stub_error); + limit; + value; + dummy = 0; + } + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) public { + require(false, stub_error); + limit; + value; + dummy = 0; + } + + // Get contract address. + // + // Selector: contractAddress() f6b4dfb4 + function contractAddress() public view returns (address) { + require(false, stub_error); + dummy; + return 0x0000000000000000000000000000000000000000; + } + + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. + // + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) public { + require(false, stub_error); + newAdmin; + dummy = 0; + } + + // Remove collection admin by substrate address. + // @param admin Substrate administrator address. + // + // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + function removeCollectionAdminSubstrate(uint256 admin) public { + require(false, stub_error); + admin; + dummy = 0; + } + + // Add collection admin. + // @param new_admin Address of the added administrator. + // + // Selector: addCollectionAdmin(address) 92e462c7 + function addCollectionAdmin(address newAdmin) public { + require(false, stub_error); + newAdmin; + dummy = 0; + } + + // Remove collection admin. + // + // @param new_admin Address of the removed administrator. + // + // Selector: removeCollectionAdmin(address) fafd7b42 + function removeCollectionAdmin(address admin) public { + require(false, stub_error); + admin; + dummy = 0; + } + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // + // Selector: setCollectionNesting(bool) 112d4586 + function setCollectionNesting(bool enable) public { + require(false, stub_error); + enable; + dummy = 0; + } + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + // @param collections Addresses of collections that will be available for nesting. + // + // Selector: setCollectionNesting(bool,address[]) 64872396 + function setCollectionNesting(bool enable, address[] memory collections) + public + { + require(false, stub_error); + enable; + collections; + dummy = 0; + } + + // Set the collection access method. + // @param mode Access mode + // 0 for Normal + // 1 for AllowList + // + // Selector: setCollectionAccess(uint8) 41835d4c + function setCollectionAccess(uint8 mode) public { + require(false, stub_error); + mode; + dummy = 0; + } + + // Add the user to the allowed list. + // + // @param user Address of a trusted user. + // + // Selector: addToCollectionAllowList(address) 67844fe6 + function addToCollectionAllowList(address user) public { + require(false, stub_error); + user; + dummy = 0; + } + + // Remove the user from the allowed list. + // + // @param user Address of a removed user. + // + // Selector: removeFromCollectionAllowList(address) 85c51acb + function removeFromCollectionAllowList(address user) public { + require(false, stub_error); + user; + dummy = 0; + } + + // Switch permission for minting. + // + // @param mode Enable if "true". + // + // Selector: setCollectionMintMode(bool) 00018e84 + function setCollectionMintMode(bool mode) public { + require(false, stub_error); + mode; + dummy = 0; + } +} + +contract UniqueRFT is Dummy, ERC165, Collection {} diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw deleted file mode 100644 index 1333ed77b7..0000000000 --- a/pallets/refungible/src/stubs/UniqueRefungible.raw +++ /dev/null @@ -1 +0,0 @@ -TODO diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.raw b/pallets/refungible/src/stubs/UniqueRefungibleToken.raw index 2f52a9a02ccc256a89f366d3616732931ea058e2..b29f6a2418637140c0dfb0fbaf78d231958a8fc7 100644 GIT binary patch delta 398 zcmXAk&nrYx6vyxBnMp`vF;AilX^fp>gN>3{>CI!_TU?8CqHIL6A&a^9GK7WuMt(#h z`zfWA!cN&Ke}Js~18gM5nXx&Y&iS14{eB22v_h zVQ*PT=a?e#5J&{A+pKXFiT4om#*I9QDU;9+K|Gw97++h$x7Lc~P8Vx@>_WkzBI^Z` zoNq}$p7GQD(ue)$&dh6D-CQ7fStf_+VB%)r^8U|7s) z)dmx#DY6~oF|16!A6ccLosy^z5+z*}nTUoJl0Ps=QQeW%(_9t$pJ-A1#x(M~+?tdS z8Fqw6sb(^5VnTVN&@)Z!*Ib6-bfy`88iu`cfnh$=C4%o#DS_-Vo)Lty#~9|S zTEkcq^vSDTIOqq2l?$h|y+@nxTSrf}JJ+tizI4HV^5Wd=k1y?K-yX*I?u;+K ZRWrq6`_t!RS8m_Du{4GQhc~=0.8.0 <0.9.0; + +// Common stubs holder +interface Dummy { + +} + +interface ERC165 is Dummy { + function supportsInterface(bytes4 interfaceID) external view returns (bool); +} + +// Selector: 7d9262e6 +interface Collection is Dummy, ERC165 { + // Set collection property. + // + // @param key Property key. + // @param value Propery value. + // + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + external; + + // Delete collection property. + // + // @param key Property key. + // + // Selector: deleteCollectionProperty(string) 7b7debce + function deleteCollectionProperty(string memory key) external; + + // Get collection property. + // + // @dev Throws error if key not found. + // + // @param key Property key. + // @return bytes The property corresponding to the key. + // + // Selector: collectionProperty(string) cf24fd6d + function collectionProperty(string memory key) + external + view + returns (bytes memory); + + // Set the sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) external; + + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) external; + + // Get contract address. + // + // Selector: contractAddress() f6b4dfb4 + function contractAddress() external view returns (address); + + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. + // + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) external; + + // Remove collection admin by substrate address. + // @param admin Substrate administrator address. + // + // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + function removeCollectionAdminSubstrate(uint256 admin) external; + + // Add collection admin. + // @param new_admin Address of the added administrator. + // + // Selector: addCollectionAdmin(address) 92e462c7 + function addCollectionAdmin(address newAdmin) external; + + // Remove collection admin. + // + // @param new_admin Address of the removed administrator. + // + // Selector: removeCollectionAdmin(address) fafd7b42 + function removeCollectionAdmin(address admin) external; + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // + // Selector: setCollectionNesting(bool) 112d4586 + function setCollectionNesting(bool enable) external; + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + // @param collections Addresses of collections that will be available for nesting. + // + // Selector: setCollectionNesting(bool,address[]) 64872396 + function setCollectionNesting(bool enable, address[] memory collections) + external; + + // Set the collection access method. + // @param mode Access mode + // 0 for Normal + // 1 for AllowList + // + // Selector: setCollectionAccess(uint8) 41835d4c + function setCollectionAccess(uint8 mode) external; + + // Add the user to the allowed list. + // + // @param user Address of a trusted user. + // + // Selector: addToCollectionAllowList(address) 67844fe6 + function addToCollectionAllowList(address user) external; + + // Remove the user from the allowed list. + // + // @param user Address of a removed user. + // + // Selector: removeFromCollectionAllowList(address) 85c51acb + function removeFromCollectionAllowList(address user) external; + + // Switch permission for minting. + // + // @param mode Enable if "true". + // + // Selector: setCollectionMintMode(bool) 00018e84 + function setCollectionMintMode(bool mode) external; +} + +interface UniqueRFT is Dummy, ERC165, Collection {} diff --git a/tests/src/eth/api/UniqueRefungibleToken.sol b/tests/src/eth/api/UniqueRefungibleToken.sol index 3566c06a57..5a35bf4488 100644 --- a/tests/src/eth/api/UniqueRefungibleToken.sol +++ b/tests/src/eth/api/UniqueRefungibleToken.sol @@ -24,24 +24,45 @@ interface ERC20Events { // Selector: 942e8b22 interface ERC20 is Dummy, ERC165, ERC20Events { + // @return the name of the token. + // // Selector: name() 06fdde03 function name() external view returns (string memory); + // @return the symbol of the token. + // // Selector: symbol() 95d89b41 function symbol() external view returns (string memory); + // @dev Total number of tokens in existence + // // Selector: totalSupply() 18160ddd function totalSupply() external view returns (uint256); + // @dev Not supported + // // Selector: decimals() 313ce567 function decimals() external view returns (uint8); + // @dev Gets the balance of the specified address. + // @param owner The address to query the balance of. + // @return An uint256 representing the amount owned by the passed address. + // // Selector: balanceOf(address) 70a08231 function balanceOf(address owner) external view returns (uint256); + // @dev Transfer token for a specified address + // @param to The address to transfer to. + // @param amount The amount to be transferred. + // // Selector: transfer(address,uint256) a9059cbb function transfer(address to, uint256 amount) external returns (bool); + // @dev Transfer tokens from one address to another + // @param from address The address which you want to send tokens from + // @param to address The address which you want to transfer to + // @param amount uint256 the amount of tokens to be transferred + // // Selector: transferFrom(address,address,uint256) 23b872dd function transferFrom( address from, @@ -49,9 +70,22 @@ interface ERC20 is Dummy, ERC165, ERC20Events { uint256 amount ) external returns (bool); + // @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`. + // Beware that changing an allowance with this method brings the risk that someone may use both the old + // and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this + // race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: + // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + // @param spender The address which will spend the funds. + // @param amount The amount of tokens to be spent. + // // Selector: approve(address,uint256) 095ea7b3 function approve(address spender, uint256 amount) external returns (bool); + // @dev Function to check the amount of tokens that an owner allowed to a spender. + // @param owner address The address which owns the funds. + // @param spender address The address which will spend the funds. + // @return A uint256 specifying the amount of tokens still available for the spender. + // // Selector: allowance(address,address) dd62ed3e function allowance(address owner, address spender) external @@ -61,9 +95,18 @@ interface ERC20 is Dummy, ERC165, ERC20Events { // Selector: ab8deb37 interface ERC20UniqueExtensions is Dummy, ERC165 { + // @dev Function that burns an amount of the token of a given account, + // deducting from the sender's allowance for said account. + // @param from The account whose tokens will be burnt. + // @param amount The amount that will be burnt. + // // Selector: burnFrom(address,uint256) 79cc6790 function burnFrom(address from, uint256 amount) external returns (bool); + // @dev Function that changes total amount of the tokens. + // Throws if `msg.sender` doesn't owns all of the tokens. + // @param amount New total amount of the tokens. + // // Selector: repartition(uint256) d2418ca7 function repartition(uint256 amount) external returns (bool); } diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts index 356e736954..47396a1ed7 100644 --- a/tests/src/eth/createRFTCollection.test.ts +++ b/tests/src/eth/createRFTCollection.test.ts @@ -69,27 +69,26 @@ describe('Create RFT collection from EVM', () => { .call()).to.be.true; }); - itWeb3.only('Set sponsorship', async ({api, web3, privateKeyWrapper}) => { + itWeb3('Set sponsorship', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelpers = evmCollectionHelpers(web3, owner); let result = await collectionHelpers.methods.createRefungibleCollection('Sponsor collection', '1', '1').send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - result = await collectionEvm.methods.setCollectionSponsor(sponsor).call(); - // let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - // expect(collectionSub.sponsorship.isUnconfirmed).to.be.true; - // const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format; - // expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); - // await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); - // const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress); - // await sponsorCollection.methods.confirmCollectionSponsorship().send(); - // collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - // expect(collectionSub.sponsorship.isConfirmed).to.be.true; - // expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); + result = await collectionEvm.methods.setCollectionSponsor(sponsor).send(); + let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; + expect(collectionSub.sponsorship.isUnconfirmed).to.be.true; + const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format; + expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); + const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress); + await sponsorCollection.methods.confirmCollectionSponsorship().send(); + collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; + expect(collectionSub.sponsorship.isConfirmed).to.be.true; + expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); }); - // fixtest itWeb3('Set limits', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelpers = evmCollectionHelpers(web3, owner); @@ -107,7 +106,7 @@ describe('Create RFT collection from EVM', () => { transfersEnabled: false, }; - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); await collectionEvm.methods['setCollectionLimit(string,uint32)']('accountTokenOwnershipLimit', limits.accountTokenOwnershipLimit).send(); await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsoredDataSize', limits.sponsoredDataSize).send(); await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsoredDataRateLimit', limits.sponsoredDataRateLimit).send(); @@ -193,14 +192,13 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { .call()).to.be.rejectedWith('NotSufficientFounds'); }); - // fixtest itWeb3('(!negative test!) Check owner', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const notOwner = await createEthAccount(web3); const collectionHelpers = evmCollectionHelpers(web3, owner); const result = await collectionHelpers.methods.createRefungibleCollection('A', 'A', 'A').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const contractEvmFromNotOwner = evmCollection(web3, notOwner, collectionIdAddress); + const contractEvmFromNotOwner = evmCollection(web3, notOwner, collectionIdAddress, {type: 'ReFungible'}); const EXPECTED_ERROR = 'NoPermission'; { const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -220,13 +218,12 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { } }); - // fixtest itWeb3('(!negative test!) Set limits', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelpers = evmCollectionHelpers(web3, owner); const result = await collectionHelpers.methods.createRefungibleCollection('Schema collection', 'A', 'A').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); await expect(collectionEvm.methods .setCollectionLimit('badLimit', 'true') .call()).to.be.rejectedWith('unknown boolean limit "badLimit"'); diff --git a/tests/src/eth/refungibleAbi.json b/tests/src/eth/refungibleAbi.json new file mode 100644 index 0000000000..1b50a797b1 --- /dev/null +++ b/tests/src/eth/refungibleAbi.json @@ -0,0 +1,167 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "newAdmin", "type": "address" } + ], + "name": "addCollectionAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "newAdmin", "type": "uint256" } + ], + "name": "addCollectionAdminSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "addToCollectionAllowList", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], + "name": "collectionProperty", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "confirmCollectionSponsorship", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "contractAddress", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], + "name": "deleteCollectionProperty", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "admin", "type": "address" } + ], + "name": "removeCollectionAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "admin", "type": "uint256" } + ], + "name": "removeCollectionAdminSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "removeFromCollectionAllowList", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint8", "name": "mode", "type": "uint8" }], + "name": "setCollectionAccess", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "limit", "type": "string" }, + { "internalType": "uint32", "name": "value", "type": "uint32" } + ], + "name": "setCollectionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "limit", "type": "string" }, + { "internalType": "bool", "name": "value", "type": "bool" } + ], + "name": "setCollectionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "mode", "type": "bool" }], + "name": "setCollectionMintMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }], + "name": "setCollectionNesting", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bool", "name": "enable", "type": "bool" }, + { + "internalType": "address[]", + "name": "collections", + "type": "address[]" + } + ], + "name": "setCollectionNesting", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "key", "type": "string" }, + { "internalType": "bytes", "name": "value", "type": "bytes" } + ], + "name": "setCollectionProperty", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "sponsor", "type": "address" } + ], + "name": "setCollectionSponsor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" } + ], + "name": "supportsInterface", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + } +] diff --git a/tests/src/eth/util/helpers.ts b/tests/src/eth/util/helpers.ts index ec2c22f529..ddb448c1a9 100644 --- a/tests/src/eth/util/helpers.ts +++ b/tests/src/eth/util/helpers.ts @@ -25,12 +25,13 @@ import * as solc from 'solc'; import Web3 from 'web3'; import config from '../../config'; import getBalance from '../../substrate/get-balance'; -import privateKey from '../../substrate/privateKey'; import usingApi, {submitTransactionAsync} from '../../substrate/substrate-api'; import waitNewBlocks from '../../substrate/wait-new-blocks'; -import {CrossAccountId, getDetailedCollectionInfo, getGenericResult, UNIQUE} from '../../util/helpers'; +import {CollectionMode, CrossAccountId, getDetailedCollectionInfo, getGenericResult, UNIQUE} from '../../util/helpers'; import collectionHelpersAbi from '../collectionHelpersAbi.json'; +import fungibleAbi from '../fungibleAbi.json'; import nonFungibleAbi from '../nonFungibleAbi.json'; +import refungibleAbi from '../refungibleAbi.json'; import contractHelpersAbi from './contractHelpersAbi.json'; export const GAS_ARGS = {gas: 2500000}; @@ -307,8 +308,26 @@ export function evmCollectionHelpers(web3: Web3, caller: string) { * @param caller - eth address * @returns */ -export function evmCollection(web3: Web3, caller: string, collection: string) { - return new web3.eth.Contract(nonFungibleAbi as any, collection, {from: caller, ...GAS_ARGS}); +export function evmCollection(web3: Web3, caller: string, collection: string, mode: CollectionMode = {type: 'NFT'}) { + let abi; + switch (mode.type) { + case 'Fungible': + abi = fungibleAbi; + break; + + case 'NFT': + abi = nonFungibleAbi; + break; + + case 'ReFungible': + abi = refungibleAbi; + break; + + default: + throw 'Bad collection mode'; + } + const contract = new web3.eth.Contract(abi as any, collection, {from: caller, ...GAS_ARGS}); + return contract; } /** From e51699278c066a32287b4836974a032594453923 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 25 Jul 2022 09:33:33 +0000 Subject: [PATCH 0125/1274] misk: docs & changelogs. Some refactor for func & mod names. --- Makefile | 6 +-- pallets/common/CHANGELOG.MD | 5 ++ pallets/common/Cargo.toml | 2 +- pallets/common/src/erc.rs | 50 ++++++++++++------ pallets/nonfungible/CHANGELOG.md | 7 ++- pallets/nonfungible/Cargo.toml | 2 +- pallets/nonfungible/src/erc.rs | 16 +++--- pallets/refungible/CHANGELOG.md | 2 + pallets/refungible/Changelog.md | 3 -- pallets/refungible/src/erc.rs | 10 ++-- .../{UniqueRFT.raw => UniqueRefungible.raw} | Bin 2199 -> 2199 bytes .../{UniqueRFT.sol => UniqueRefungible.sol} | 2 +- pallets/unique/src/eth/mod.rs | 15 +++--- 13 files changed, 73 insertions(+), 47 deletions(-) delete mode 100644 pallets/refungible/Changelog.md rename pallets/refungible/src/stubs/{UniqueRFT.raw => UniqueRefungible.raw} (97%) rename pallets/refungible/src/stubs/{UniqueRFT.sol => UniqueRefungible.sol} (99%) diff --git a/Makefile b/Makefile index f94c0321ce..836e4e5570 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ UniqueNFT.sol: PACKAGE=pallet-nonfungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh PACKAGE=pallet-nonfungible NAME=erc::gen_impl OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh -UniqueRFT.sol: +UniqueRefungible.sol: PACKAGE=pallet-refungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh PACKAGE=pallet-refungible NAME=erc::gen_impl OUTPUT=$(REFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh @@ -65,8 +65,8 @@ UniqueRefungibleToken: UniqueRefungibleToken.sol INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_EVM_STUBS)/UniqueRefungibleToken.raw ./.maintain/scripts/compile_stub.sh INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(RENFUNGIBLE_TOKEN_EVM_ABI) ./.maintain/scripts/generate_abi.sh -UniqueRefungible: UniqueRFT.sol - INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_EVM_STUBS)/UniqueRFT.raw ./.maintain/scripts/compile_stub.sh +UniqueRefungible: UniqueRefungible.sol + INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_EVM_STUBS)/UniqueRefungible.raw ./.maintain/scripts/compile_stub.sh INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_EVM_ABI) ./.maintain/scripts/generate_abi.sh ContractHelpers: ContractHelpers.sol diff --git a/pallets/common/CHANGELOG.MD b/pallets/common/CHANGELOG.MD index ba2f8f1162..88d711f26d 100644 --- a/pallets/common/CHANGELOG.MD +++ b/pallets/common/CHANGELOG.MD @@ -8,3 +8,8 @@ All notable changes to this project will be documented in this file. - Some methods in `#[solidity_interface]` for `CollectionHandle` had invalid mutability modifiers, causing invalid stub/abi generation. + + +## [0.1.3] - 2022-07-25 +### Add +- Some static property keys and values. \ No newline at end of file diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index b5ece3fb34..e7a7389b46 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-common" -version = "0.1.2" +version = "0.1.3" license = "GPLv3" edition = "2021" diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 9b5b6ecdad..dea71fc537 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -430,7 +430,8 @@ fn save(collection: &CollectionHandle) -> Result { Ok(()) } -pub mod static_property_key_value { +/// Contains static property keys and values. +pub mod static_property { use evm_coder::{ execution::{Result, Error}, }; @@ -438,27 +439,45 @@ pub mod static_property_key_value { const EXPECT_CONVERT_ERROR: &str = "length < limit"; - pub fn schema_name_key() -> up_data_structs::PropertyKey { - property_key_from_bytes(b"schemaName").expect(EXPECT_CONVERT_ERROR) - } + /// Keys. + pub mod key { + use super::*; - pub fn base_uri_key() -> up_data_structs::PropertyKey { - property_key_from_bytes(b"baseURI").expect(EXPECT_CONVERT_ERROR) - } + /// Key "schemaName". + pub fn schema_name() -> up_data_structs::PropertyKey { + property_key_from_bytes(b"schemaName").expect(EXPECT_CONVERT_ERROR) + } - pub fn url_key() -> up_data_structs::PropertyKey { - property_key_from_bytes(b"url").expect(EXPECT_CONVERT_ERROR) - } + /// Key "baseURI". + pub fn base_uri() -> up_data_structs::PropertyKey { + property_key_from_bytes(b"baseURI").expect(EXPECT_CONVERT_ERROR) + } - pub fn suffix_key() -> up_data_structs::PropertyKey { - property_key_from_bytes(b"suffix").expect(EXPECT_CONVERT_ERROR) + /// Key "url". + pub fn url() -> up_data_structs::PropertyKey { + property_key_from_bytes(b"url").expect(EXPECT_CONVERT_ERROR) + } + + /// Key "suffix". + pub fn suffix() -> up_data_structs::PropertyKey { + property_key_from_bytes(b"suffix").expect(EXPECT_CONVERT_ERROR) + } } - pub const ERC721_METADATA: &[u8] = b"ERC721Metadata"; - pub fn erc721_value() -> up_data_structs::PropertyValue { - property_value_from_bytes(ERC721_METADATA).expect(EXPECT_CONVERT_ERROR) + /// Values. + pub mod value { + use super::*; + + /// Value "ERC721Metadata". + pub const ERC721_METADATA: &[u8] = b"ERC721Metadata"; + + /// Value for [`ERC721_METADATA`]. + pub fn erc721() -> up_data_structs::PropertyValue { + property_value_from_bytes(ERC721_METADATA).expect(EXPECT_CONVERT_ERROR) + } } + /// Convert `byte` to [`PropertyKey`]. pub fn property_key_from_bytes(bytes: &[u8]) -> Result { bytes.to_vec().try_into().map_err(|_| { Error::Revert(format!( @@ -468,6 +487,7 @@ pub mod static_property_key_value { }) } + /// Convert `bytes` to [`PropertyValue`]. pub fn property_value_from_bytes(bytes: &[u8]) -> Result { bytes.to_vec().try_into().map_err(|_| { Error::Revert(format!( diff --git a/pallets/nonfungible/CHANGELOG.md b/pallets/nonfungible/CHANGELOG.md index f7c39e9dfe..c2a304c0a2 100644 --- a/pallets/nonfungible/CHANGELOG.md +++ b/pallets/nonfungible/CHANGELOG.md @@ -2,10 +2,13 @@ All notable changes to this project will be documented in this file. -## [0.1.1] - 2022-07-14 +## [0.1.2] - 2022-07-25 +### Changed +- New alghoritm for retrieving `token_iri`. +## [0.1.1] - 2022-07-14 ### Added - Implementation of RPC method `token_owners`. For reasons of compatibility with this pallet, returns only one owner if token exists. - This was an internal request to improve the web interface and support fractionalization event. \ No newline at end of file + This was an internal request to improve the web interface and support fractionalization event. diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index e7729960f3..e40fb35d05 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-nonfungible" -version = "0.1.1" +version = "0.1.2" license = "GPLv3" edition = "2021" diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 3299208c1d..b7fc02d5b5 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -33,7 +33,7 @@ use up_data_structs::{ use pallet_evm_coder_substrate::dispatch_to_evm; use sp_std::vec::Vec; use pallet_common::{ - erc::{CommonEvmHandler, PrecompileResult, CollectionCall, static_property_key_value::*}, + erc::{CommonEvmHandler, PrecompileResult, CollectionCall, static_property::{key, value as property_value}}, CollectionHandle, CollectionPropertyPermissions, }; use pallet_evm::{account::CrossAccountId, PrecompileHandle}; @@ -221,10 +221,10 @@ impl NonfungibleHandle { fn token_uri(&self, token_id: uint256) -> Result { let is_erc721 = || { if let Some(shema_name) = - pallet_common::Pallet::::get_collection_property(self.id, &schema_name_key()) + pallet_common::Pallet::::get_collection_property(self.id, &key::schema_name()) { let shema_name = shema_name.into_inner(); - shema_name == ERC721_METADATA + shema_name == property_value::ERC721_METADATA } else { false } @@ -232,7 +232,7 @@ impl NonfungibleHandle { let token_id_u32: u32 = token_id.try_into().map_err(|_| "token id overflow")?; - if let Ok(url) = get_token_property(self, token_id_u32, &url_key()) { + if let Ok(url) = get_token_property(self, token_id_u32, &key::url()) { if !url.is_empty() { return Ok(url); } @@ -241,7 +241,7 @@ impl NonfungibleHandle { } if let Some(base_uri) = - pallet_common::Pallet::::get_collection_property(self.id, &base_uri_key()) + pallet_common::Pallet::::get_collection_property(self.id, &key::base_uri()) { if !base_uri.is_empty() { let base_uri = string::from_utf8(base_uri.into_inner()).map_err(|e| { @@ -250,7 +250,7 @@ impl NonfungibleHandle { e )) })?; - if let Ok(suffix) = get_token_property(self, token_id_u32, &suffix_key()) { + if let Ok(suffix) = get_token_property(self, token_id_u32, &key::suffix()) { if !suffix.is_empty() { return Ok(base_uri + suffix.as_str()); } @@ -497,7 +497,7 @@ impl NonfungibleHandle { token_id: uint256, token_uri: string, ) -> Result { - let key = url_key(); + let key = key::url(); let permission = get_token_permission::(self.id, &key)?; if !permission.collection_admin { return Err("Operation is not allowed".into()); @@ -702,7 +702,7 @@ impl NonfungibleHandle { to: address, tokens: Vec<(uint256, string)>, ) -> Result { - let key = url_key(); + let key = key::url(); let caller = T::CrossAccountId::from_eth(caller); let to = T::CrossAccountId::from_eth(to); let mut expected_index = >::get(self.id) diff --git a/pallets/refungible/CHANGELOG.md b/pallets/refungible/CHANGELOG.md index e870e7ac11..4f5895b878 100644 --- a/pallets/refungible/CHANGELOG.md +++ b/pallets/refungible/CHANGELOG.md @@ -10,6 +10,8 @@ feat(refungible-pallet): add ERC-20 EVM API for RFT token pieces ([#413](https:/ test(refungible-pallet): add tests for ERC-20 EVM API for RFT token pieces ([#413](https://github.com/UniqueNetwork/unique-chain/pull/413)) ## [v0.1.1] - 2022-07-14 +### Added +- Support for properties for RFT collections and tokens. ### Other changes diff --git a/pallets/refungible/Changelog.md b/pallets/refungible/Changelog.md deleted file mode 100644 index 5e47b7d6ed..0000000000 --- a/pallets/refungible/Changelog.md +++ /dev/null @@ -1,3 +0,0 @@ -### 0.1.1 ---- -* Added support for properties for RFT collections and tokens. diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index fc5ec5c97f..f7afffdef5 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -25,24 +25,24 @@ use pallet_evm_coder_substrate::call; use crate::{Config, RefungibleHandle}; #[solidity_interface( - name = "UniqueRFT", + name = "UniqueRefungible", is(via("CollectionHandle", common_mut, Collection),) )] impl RefungibleHandle where T::AccountId: From<[u8; 32]> {} // Not a tests, but code generators -generate_stubgen!(gen_impl, UniqueRFTCall<()>, true); -generate_stubgen!(gen_iface, UniqueRFTCall<()>, false); +generate_stubgen!(gen_impl, UniqueRefungibleCall<()>, true); +generate_stubgen!(gen_iface, UniqueRefungibleCall<()>, false); impl CommonEvmHandler for RefungibleHandle where T::AccountId: From<[u8; 32]>, { - const CODE: &'static [u8] = include_bytes!("./stubs/UniqueRFT.raw"); + const CODE: &'static [u8] = include_bytes!("./stubs/UniqueRefungible.raw"); fn call( self, handle: &mut impl PrecompileHandle, ) -> Option { - call::, _, _>(handle, self) + call::, _, _>(handle, self) } } diff --git a/pallets/refungible/src/stubs/UniqueRFT.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw similarity index 97% rename from pallets/refungible/src/stubs/UniqueRFT.raw rename to pallets/refungible/src/stubs/UniqueRefungible.raw index a759b1051ce5ce044553cf3526efb0cf4f34c445..2f1d678ef5e86e7615feb7375da0608f1a2d484d 100644 GIT binary patch delta 44 zcmV+{0Mq}M5tk9LMhGAs+oLVdi|`@V1WIPBUrs7V9(yt>WpK?Ux&Fn#vJ?B0W(YBp C;u7Bg delta 44 zcmbO(I9+gq8;8Odri36Ky^KD-=o#J}3k%8?p0JVG5j}548K-$?$DOlslhZg10d*!3 AYybcN diff --git a/pallets/refungible/src/stubs/UniqueRFT.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol similarity index 99% rename from pallets/refungible/src/stubs/UniqueRFT.sol rename to pallets/refungible/src/stubs/UniqueRefungible.sol index 6ea56fbdd2..4e49d79589 100644 --- a/pallets/refungible/src/stubs/UniqueRFT.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -248,4 +248,4 @@ contract Collection is Dummy, ERC165 { } } -contract UniqueRFT is Dummy, ERC165, Collection {} +contract UniqueRefungible is Dummy, ERC165, Collection {} diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 4229f939f2..89f67adbef 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -28,7 +28,7 @@ use up_data_structs::{ use frame_support::traits::Get; use pallet_common::{ CollectionById, - erc::{static_property_key_value::*, CollectionHelpersEvents}, + erc::{static_property::{key, value as property_value}, CollectionHelpersEvents}, }; use crate::{SelfWeightOf, Config, weights::WeightInfo}; @@ -83,7 +83,6 @@ fn convert_data( Ok((caller, name, description, token_prefix, base_uri_value)) } -// fn make_data( name: CollectionName, mode: CollectionMode, @@ -98,7 +97,7 @@ fn make_data( token_property_permissions .try_push(up_data_structs::PropertyKeyPermission { - key: url_key(), + key: key::url(), permission: up_data_structs::PropertyPermission { mutable: false, collection_admin: true, @@ -110,7 +109,7 @@ fn make_data( if add_properties { token_property_permissions .try_push(up_data_structs::PropertyKeyPermission { - key: suffix_key(), + key: key::suffix(), permission: up_data_structs::PropertyPermission { mutable: false, collection_admin: true, @@ -121,15 +120,15 @@ fn make_data( properties .try_push(up_data_structs::Property { - key: schema_name_key(), - value: erc721_value(), + key: key::schema_name(), + value: property_value::erc721(), }) .map_err(|e| Error::Revert(format!("{:?}", e)))?; if !base_uri_value.is_empty() { properties .try_push(up_data_structs::Property { - key: base_uri_key(), + key: key::base_uri(), value: base_uri_value, }) .map_err(|e| Error::Revert(format!("{:?}", e)))?; @@ -152,7 +151,7 @@ fn make_data( #[solidity_interface(name = "CollectionHelpers", events(CollectionHelpersEvents))] impl EvmCollectionHelpers where - T: Config + pallet_nonfungible::Config + pallet_refungible::Config + T: Config + pallet_nonfungible::Config + pallet_refungible::Config, { /// Create an NFT collection /// @param name Name of the collection From 118b8d5eaba951d88fa970b304756d5fa3ed1ad2 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 25 Jul 2022 10:18:14 +0000 Subject: [PATCH 0126/1274] feature: add `createERC721MetadataCompatibleRFTCollection` method --- pallets/unique/src/eth/mod.rs | 27 ++++ tests/src/eth/api/UniqueRefungible.sol | 163 +++++++++++++++++++++++++ tests/src/eth/nonFungible.test.ts | 2 +- tests/src/eth/reFungibleToken.test.ts | 144 +++++++++++++++++++++- 4 files changed, 334 insertions(+), 2 deletions(-) create mode 100644 tests/src/eth/api/UniqueRefungible.sol diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 89f67adbef..0fe776b60f 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -237,6 +237,33 @@ where Ok(address) } + #[weight(>::create_collection())] + #[solidity(rename_selector = "createERC721MetadataCompatibleRFTCollection")] + fn create_refungible_collection_with_properties( + &mut self, + caller: caller, + name: string, + description: string, + token_prefix: string, + base_uri: string, + ) -> Result
{ + let (caller, name, description, token_prefix, base_uri_value) = + convert_data::(caller, name, description, token_prefix, base_uri)?; + let data = make_data::( + name, + CollectionMode::NFT, + description, + token_prefix, + base_uri_value, + true, + )?; + let collection_id = >::init_collection(caller.clone(), data) + .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; + + let address = pallet_common::eth::collection_id_to_address(collection_id); + Ok(address) + } + /// Check if a collection exists /// @param collection_address Address of the collection in question /// @return bool Does the collection exist? diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol new file mode 100644 index 0000000000..de2b7c6ff0 --- /dev/null +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -0,0 +1,163 @@ +// SPDX-License-Identifier: OTHER +// This code is automatically generated + +pragma solidity >=0.8.0 <0.9.0; + +// Common stubs holder +interface Dummy { + +} + +interface ERC165 is Dummy { + function supportsInterface(bytes4 interfaceID) external view returns (bool); +} + +// Selector: 7d9262e6 +interface Collection is Dummy, ERC165 { + // Set collection property. + // + // @param key Property key. + // @param value Propery value. + // + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + external; + + // Delete collection property. + // + // @param key Property key. + // + // Selector: deleteCollectionProperty(string) 7b7debce + function deleteCollectionProperty(string memory key) external; + + // Get collection property. + // + // @dev Throws error if key not found. + // + // @param key Property key. + // @return bytes The property corresponding to the key. + // + // Selector: collectionProperty(string) cf24fd6d + function collectionProperty(string memory key) + external + view + returns (bytes memory); + + // Set the sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) external; + + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) external; + + // Get contract address. + // + // Selector: contractAddress() f6b4dfb4 + function contractAddress() external view returns (address); + + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. + // + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) external; + + // Remove collection admin by substrate address. + // @param admin Substrate administrator address. + // + // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + function removeCollectionAdminSubstrate(uint256 admin) external; + + // Add collection admin. + // @param new_admin Address of the added administrator. + // + // Selector: addCollectionAdmin(address) 92e462c7 + function addCollectionAdmin(address newAdmin) external; + + // Remove collection admin. + // + // @param new_admin Address of the removed administrator. + // + // Selector: removeCollectionAdmin(address) fafd7b42 + function removeCollectionAdmin(address admin) external; + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // + // Selector: setCollectionNesting(bool) 112d4586 + function setCollectionNesting(bool enable) external; + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + // @param collections Addresses of collections that will be available for nesting. + // + // Selector: setCollectionNesting(bool,address[]) 64872396 + function setCollectionNesting(bool enable, address[] memory collections) + external; + + // Set the collection access method. + // @param mode Access mode + // 0 for Normal + // 1 for AllowList + // + // Selector: setCollectionAccess(uint8) 41835d4c + function setCollectionAccess(uint8 mode) external; + + // Add the user to the allowed list. + // + // @param user Address of a trusted user. + // + // Selector: addToCollectionAllowList(address) 67844fe6 + function addToCollectionAllowList(address user) external; + + // Remove the user from the allowed list. + // + // @param user Address of a removed user. + // + // Selector: removeFromCollectionAllowList(address) 85c51acb + function removeFromCollectionAllowList(address user) external; + + // Switch permission for minting. + // + // @param mode Enable if "true". + // + // Selector: setCollectionMintMode(bool) 00018e84 + function setCollectionMintMode(bool mode) external; +} + +interface UniqueRefungible is Dummy, ERC165, Collection {} diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 0d2d8c95fc..7cc25c3983 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -72,7 +72,7 @@ describe('NFT: Information getting', () => { }); }); -describe('Check ERC721 token URI', () => { +describe('Check ERC721 token URI for NFT', () => { itWeb3('Empty tokenURI', async ({web3, api, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, owner); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index dbea13dca4..1da8d39186 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {approve, createCollection, createRefungibleToken, transfer, transferFrom, UNIQUE} from '../util/helpers'; -import {createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth} from './util/helpers'; +import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth} from './util/helpers'; import reFungibleTokenAbi from './reFungibleTokenAbi.json'; import chai from 'chai'; @@ -73,6 +73,148 @@ describe('Refungible token: Information getting', () => { }); }); +// FIXME: Need erc721 for ReFubgible. +describe.skip('Check ERC721 token URI for ReFungible', () => { + itWeb3('Empty tokenURI', async ({web3, api, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, owner); + let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', '').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const receiver = createEthAccount(web3); + const contract = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); + + const nextTokenId = await contract.methods.nextTokenId().call(); + expect(nextTokenId).to.be.equal('1'); + result = await contract.methods.mint( + receiver, + nextTokenId, + ).send(); + + const events = normalizeEvents(result.events); + const address = collectionIdToAddress(collectionId); + + expect(events).to.be.deep.equal([ + { + address, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver, + tokenId: nextTokenId, + }, + }, + ]); + + expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal(''); + }); + + itWeb3('TokenURI from url', async ({web3, api, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, owner); + let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', 'BaseURI_').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const receiver = createEthAccount(web3); + const contract = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); + + const nextTokenId = await contract.methods.nextTokenId().call(); + expect(nextTokenId).to.be.equal('1'); + result = await contract.methods.mint( + receiver, + nextTokenId, + ).send(); + + // Set URL + await contract.methods.setProperty(nextTokenId, 'url', Buffer.from('Token URI')).send(); + + const events = normalizeEvents(result.events); + const address = collectionIdToAddress(collectionId); + + expect(events).to.be.deep.equal([ + { + address, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver, + tokenId: nextTokenId, + }, + }, + ]); + + expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Token URI'); + }); + + itWeb3('TokenURI from baseURI + tokenId', async ({web3, api, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, owner); + let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', 'BaseURI_').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const receiver = createEthAccount(web3); + const contract = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); + + const nextTokenId = await contract.methods.nextTokenId().call(); + expect(nextTokenId).to.be.equal('1'); + result = await contract.methods.mint( + receiver, + nextTokenId, + ).send(); + + const events = normalizeEvents(result.events); + const address = collectionIdToAddress(collectionId); + + expect(events).to.be.deep.equal([ + { + address, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver, + tokenId: nextTokenId, + }, + }, + ]); + + expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('BaseURI_' + nextTokenId); + }); + + itWeb3('TokenURI from baseURI + suffix', async ({web3, api, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, owner); + let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', 'BaseURI_').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const receiver = createEthAccount(web3); + const contract = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); + + const nextTokenId = await contract.methods.nextTokenId().call(); + expect(nextTokenId).to.be.equal('1'); + result = await contract.methods.mint( + receiver, + nextTokenId, + ).send(); + + // Set suffix + const suffix = '/some/suffix'; + await contract.methods.setProperty(nextTokenId, 'suffix', Buffer.from(suffix)).send(); + + const events = normalizeEvents(result.events); + const address = collectionIdToAddress(collectionId); + + expect(events).to.be.deep.equal([ + { + address, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver, + tokenId: nextTokenId, + }, + }, + ]); + + expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('BaseURI_' + suffix); + }); +}); + describe('Refungible: Plain calls', () => { itWeb3('Can perform approve()', async ({web3, api, privateKeyWrapper}) => { const alice = privateKeyWrapper('//Alice'); From 00f454067704d119a6a287995235037d8980c603 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 25 Jul 2022 10:20:47 +0000 Subject: [PATCH 0127/1274] misk: Fixing chages --- Cargo.lock | 8 ++++---- pallets/unique/CHANGELOG.md | 9 +++++++++ pallets/unique/Cargo.toml | 2 +- primitives/data-structs/CHANGELOG.md | 11 +++++++++++ primitives/data-structs/Cargo.toml | 2 +- primitives/data-structs/Changelog.md | 3 --- 6 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 pallets/unique/CHANGELOG.md create mode 100644 primitives/data-structs/CHANGELOG.md delete mode 100644 primitives/data-structs/Changelog.md diff --git a/Cargo.lock b/Cargo.lock index 7d1af4fb7f..74848ab2ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5731,7 +5731,7 @@ dependencies = [ [[package]] name = "pallet-common" -version = "0.1.2" +version = "0.1.3" dependencies = [ "ethereum", "evm-coder", @@ -6198,7 +6198,7 @@ dependencies = [ [[package]] name = "pallet-nonfungible" -version = "0.1.1" +version = "0.1.2" dependencies = [ "ethereum", "evm-coder", @@ -6638,7 +6638,7 @@ dependencies = [ [[package]] name = "pallet-unique" -version = "0.1.0" +version = "0.1.1" dependencies = [ "ethereum", "evm-coder", @@ -12737,7 +12737,7 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "up-data-structs" -version = "0.1.1" +version = "0.1.2" dependencies = [ "derivative", "frame-support", diff --git a/pallets/unique/CHANGELOG.md b/pallets/unique/CHANGELOG.md new file mode 100644 index 0000000000..fbe3ebd684 --- /dev/null +++ b/pallets/unique/CHANGELOG.md @@ -0,0 +1,9 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +## [v0.1.1] - 2022-07-25 +### Added +- Method for creating `ERC721Metadata` compatible NFT collection. +- Method for creating `ERC721Metadata` compatible ReFungible collection. +- Method for creating ReFungible collection. diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index 6f8f781f1e..c90580cad3 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -9,7 +9,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'pallet-unique' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.1.0' +version = '0.1.1' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] diff --git a/primitives/data-structs/CHANGELOG.md b/primitives/data-structs/CHANGELOG.md new file mode 100644 index 0000000000..53c458a4f9 --- /dev/null +++ b/primitives/data-structs/CHANGELOG.md @@ -0,0 +1,11 @@ +# Change Log + +All notable changes to this project will be documented in this file. + + +## [v0.1.2] - 2022-07-25 +### Added +- Type aliases `CollectionName`, `CollectionDescription`, `CollectionTokenPrefix` +## [v0.1.1] - 2022-07-22 +### Added +- Аields with properties to `CreateReFungibleData` and `CreateRefungibleExData`. \ No newline at end of file diff --git a/primitives/data-structs/Cargo.toml b/primitives/data-structs/Cargo.toml index 22b9a42ffe..227c86321d 100644 --- a/primitives/data-structs/Cargo.toml +++ b/primitives/data-structs/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = 'GPLv3' homepage = "https://unique.network" repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.1.1' +version = '0.1.2' [dependencies] scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/primitives/data-structs/Changelog.md b/primitives/data-structs/Changelog.md deleted file mode 100644 index 4de0308eda..0000000000 --- a/primitives/data-structs/Changelog.md +++ /dev/null @@ -1,3 +0,0 @@ -### 0.1.1 ---- -* Added fields with properties to `CreateReFungibleData` and `CreateRefungibleExData`. \ No newline at end of file From 6434da338828985a34f9c9cae0e43d8f5f8dc274 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 25 Jul 2022 10:21:13 +0000 Subject: [PATCH 0128/1274] fmt --- pallets/nonfungible/src/erc.rs | 5 ++++- pallets/unique/src/eth/mod.rs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index b7fc02d5b5..99890b6e39 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -33,7 +33,10 @@ use up_data_structs::{ use pallet_evm_coder_substrate::dispatch_to_evm; use sp_std::vec::Vec; use pallet_common::{ - erc::{CommonEvmHandler, PrecompileResult, CollectionCall, static_property::{key, value as property_value}}, + erc::{ + CommonEvmHandler, PrecompileResult, CollectionCall, + static_property::{key, value as property_value}, + }, CollectionHandle, CollectionPropertyPermissions, }; use pallet_evm::{account::CrossAccountId, PrecompileHandle}; diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 0fe776b60f..f6e2f96ba3 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -28,7 +28,10 @@ use up_data_structs::{ use frame_support::traits::Get; use pallet_common::{ CollectionById, - erc::{static_property::{key, value as property_value}, CollectionHelpersEvents}, + erc::{ + static_property::{key, value as property_value}, + CollectionHelpersEvents, + }, }; use crate::{SelfWeightOf, Config, weights::WeightInfo}; From 52730495c578a54c158d7c25f52a3bd2c18c0c67 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 25 Jul 2022 10:57:09 +0000 Subject: [PATCH 0129/1274] patch: Change dispathed call for create item (return collection id). --- pallets/common/src/dispatch.rs | 3 ++- pallets/unique/src/eth/mod.rs | 15 +++++++-------- pallets/unique/src/lib.rs | 2 +- runtime/common/src/dispatch.rs | 8 +++++--- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/pallets/common/src/dispatch.rs b/pallets/common/src/dispatch.rs index c1a9203d82..d38cddfd71 100644 --- a/pallets/common/src/dispatch.rs +++ b/pallets/common/src/dispatch.rs @@ -8,6 +8,7 @@ use frame_support::{ weights::Pays, traits::Get, }; +use sp_runtime::DispatchError; use up_data_structs::{CollectionId, CreateCollectionData}; use crate::{pallet::Config, CommonCollectionOperations, CollectionHandle}; @@ -78,7 +79,7 @@ pub trait CollectionDispatch { fn create( sender: T::CrossAccountId, data: CreateCollectionData, - ) -> DispatchResult; + ) -> Result; /// Delete the collection. /// diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index f6e2f96ba3..75eb76dfe5 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -32,6 +32,7 @@ use pallet_common::{ static_property::{key, value as property_value}, CollectionHelpersEvents, }, + dispatch::CollectionDispatch, }; use crate::{SelfWeightOf, Config, weights::WeightInfo}; @@ -179,9 +180,8 @@ where Default::default(), false, )?; - let collection_id = - >::init_collection(caller.clone(), data, false) - .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; + let collection_id = T::CollectionDispatch::create(caller, data) + .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; let address = pallet_common::eth::collection_id_to_address(collection_id); Ok(address) @@ -207,9 +207,8 @@ where base_uri_value, true, )?; - let collection_id = - >::init_collection(caller.clone(), data, true) - .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; + let collection_id = T::CollectionDispatch::create(caller, data) + .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; let address = pallet_common::eth::collection_id_to_address(collection_id); Ok(address) @@ -233,7 +232,7 @@ where Default::default(), false, )?; - let collection_id = >::init_collection(caller.clone(), data) + let collection_id = T::CollectionDispatch::create(caller, data) .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; let address = pallet_common::eth::collection_id_to_address(collection_id); @@ -260,7 +259,7 @@ where base_uri_value, true, )?; - let collection_id = >::init_collection(caller.clone(), data) + let collection_id = T::CollectionDispatch::create(caller, data) .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; let address = pallet_common::eth::collection_id_to_address(collection_id); diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index fcda41003a..e0479a0808 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -352,7 +352,7 @@ decl_module! { // ========= - T::CollectionDispatch::create(T::CrossAccountId::from_sub(sender), data)?; + let _id = T::CollectionDispatch::create(T::CrossAccountId::from_sub(sender), data)?; Ok(()) } diff --git a/runtime/common/src/dispatch.rs b/runtime/common/src/dispatch.rs index 6fc98a3380..5574d51b70 100644 --- a/runtime/common/src/dispatch.rs +++ b/runtime/common/src/dispatch.rs @@ -17,6 +17,7 @@ use frame_support::{dispatch::DispatchResult, ensure}; use pallet_evm::{PrecompileHandle, PrecompileResult}; use sp_core::H160; +use sp_runtime::DispatchError; use sp_std::{borrow::ToOwned, vec::Vec}; use pallet_common::{ CollectionById, CollectionHandle, CommonCollectionOperations, erc::CommonEvmHandler, @@ -30,6 +31,7 @@ use pallet_refungible::{ }; use up_data_structs::{ CollectionMode, CreateCollectionData, MAX_DECIMAL_POINTS, mapping::TokenAddressMapping, + CollectionId, }; pub enum CollectionDispatchT @@ -51,8 +53,8 @@ where fn create( sender: T::CrossAccountId, data: CreateCollectionData, - ) -> DispatchResult { - let _id = match data.mode { + ) -> Result { + let id = match data.mode { CollectionMode::NFT => >::init_collection(sender, data, false)?, CollectionMode::Fungible(decimal_points) => { // check params @@ -64,7 +66,7 @@ where } CollectionMode::ReFungible => >::init_collection(sender, data)?, }; - Ok(()) + Ok(id) } fn destroy(sender: T::CrossAccountId, collection: CollectionHandle) -> DispatchResult { From ec515115a2dc90090726d0420d876a6a2a15b8cd Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 25 Jul 2022 15:14:55 +0000 Subject: [PATCH 0130/1274] misk: * Add docs. * Detailed changelog. * Move lambd is_erc721 to separate function is_erc721_metadata_compatible. --- pallets/common/CHANGELOG.MD | 9 ++++----- pallets/nonfungible/CHANGELOG.md | 9 ++++++++- pallets/nonfungible/src/erc.rs | 34 ++++++++++++++++++-------------- 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/pallets/common/CHANGELOG.MD b/pallets/common/CHANGELOG.MD index 88d711f26d..5235f6362e 100644 --- a/pallets/common/CHANGELOG.MD +++ b/pallets/common/CHANGELOG.MD @@ -2,14 +2,13 @@ All notable changes to this project will be documented in this file. +## [0.1.3] - 2022-07-25 +### Add +- Some static property keys and values. + ## [0.1.2] - 2022-07-20 ### Fixed - Some methods in `#[solidity_interface]` for `CollectionHandle` had invalid mutability modifiers, causing invalid stub/abi generation. - - -## [0.1.3] - 2022-07-25 -### Add -- Some static property keys and values. \ No newline at end of file diff --git a/pallets/nonfungible/CHANGELOG.md b/pallets/nonfungible/CHANGELOG.md index c2a304c0a2..0548d839e4 100644 --- a/pallets/nonfungible/CHANGELOG.md +++ b/pallets/nonfungible/CHANGELOG.md @@ -4,7 +4,14 @@ All notable changes to this project will be documented in this file. ## [0.1.2] - 2022-07-25 ### Changed -- New alghoritm for retrieving `token_iri`. +- New `token_uri` retrieval logic: + + If the collection has a `url` property and it is not empty, it is returned. + Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + + If the property `baseURI` is empty or absent, return "" (empty string) + otherwise, if property `suffix` present and is non-empty, return concatenation of baseURI and suffix + otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). ## [0.1.1] - 2022-07-14 ### Added diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 99890b6e39..0b2a7d87d3 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -216,30 +216,23 @@ impl NonfungibleHandle { } /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. - /// @dev Throws if `tokenId` is not a valid NFT. URIs are defined in RFC - /// 3986. The URI may point to a JSON file that conforms to the "ERC721 - /// Metadata JSON Schema". + /// + /// @dev If the collection has a `url` property and it is not empty, it is returned. + /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + /// + /// If the property `baseURI` is empty or absent, return "" (empty string) + /// otherwise, if property `suffix` present and is non-empty, return concatenation of baseURI and suffix + /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). /// @return token's const_metadata #[solidity(rename_selector = "tokenURI")] fn token_uri(&self, token_id: uint256) -> Result { - let is_erc721 = || { - if let Some(shema_name) = - pallet_common::Pallet::::get_collection_property(self.id, &key::schema_name()) - { - let shema_name = shema_name.into_inner(); - shema_name == property_value::ERC721_METADATA - } else { - false - } - }; - let token_id_u32: u32 = token_id.try_into().map_err(|_| "token id overflow")?; if let Ok(url) = get_token_property(self, token_id_u32, &key::url()) { if !url.is_empty() { return Ok(url); } - } else if !is_erc721() { + } else if !is_erc721_metadata_compatible::(self.id) { return Err("tokenURI not set".into()); } @@ -566,6 +559,17 @@ fn get_token_property( Err("Property tokenURI not found".into()) } +fn is_erc721_metadata_compatible(collection_id: CollectionId) -> bool { + if let Some(shema_name) = + pallet_common::Pallet::::get_collection_property(collection_id, &key::schema_name()) + { + let shema_name = shema_name.into_inner(); + shema_name == property_value::ERC721_METADATA + } else { + false + } +} + fn get_token_permission( collection_id: CollectionId, key: &PropertyKey, From 0bb0c7679a83846dc941bf46e9c0bb9d60fc693b Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 25 Jul 2022 15:17:22 +0000 Subject: [PATCH 0131/1274] misk: Fix typo. --- pallets/unique/src/eth/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 75eb76dfe5..1707bb9a0b 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -69,21 +69,21 @@ fn convert_data( .encode_utf16() .collect::>() .try_into() - .map_err(|_| error_feild_too_long(stringify!(name), CollectionName::bound()))?; + .map_err(|_| error_field_too_long(stringify!(name), CollectionName::bound()))?; let description = description .encode_utf16() .collect::>() .try_into() .map_err(|_| { - error_feild_too_long(stringify!(description), CollectionDescription::bound()) + error_field_too_long(stringify!(description), CollectionDescription::bound()) })?; let token_prefix = token_prefix.into_bytes().try_into().map_err(|_| { - error_feild_too_long(stringify!(token_prefix), CollectionTokenPrefix::bound()) + error_field_too_long(stringify!(token_prefix), CollectionTokenPrefix::bound()) })?; let base_uri_value = base_uri .into_bytes() .try_into() - .map_err(|_| error_feild_too_long(stringify!(token_prefix), PropertyValue::bound()))?; + .map_err(|_| error_field_too_long(stringify!(token_prefix), PropertyValue::bound()))?; Ok((caller, name, description, token_prefix, base_uri_value)) } @@ -311,6 +311,6 @@ impl OnMetho generate_stubgen!(collection_helper_impl, CollectionHelpersCall<()>, true); generate_stubgen!(collection_helper_iface, CollectionHelpersCall<()>, false); -fn error_feild_too_long(feild: &str, bound: usize) -> Error { +fn error_field_too_long(feild: &str, bound: usize) -> Error { Error::Revert(format!("{} is too long. Max length is {}.", feild, bound)) } From 9aa0a891160dfc960e9d64264de9c31174a6f7bf Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 26 Jul 2022 06:08:59 +0000 Subject: [PATCH 0132/1274] misk: fix pr --- pallets/nonfungible/src/erc.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 0b2a7d87d3..d66389e184 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -218,11 +218,11 @@ impl NonfungibleHandle { /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. /// /// @dev If the collection has a `url` property and it is not empty, it is returned. - /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. - /// - /// If the property `baseURI` is empty or absent, return "" (empty string) - /// otherwise, if property `suffix` present and is non-empty, return concatenation of baseURI and suffix - /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). + /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + /// If the property `baseURI` is empty or absent, return "" (empty string) + /// otherwise, if property `suffix` present and is non-empty, return concatenation of baseURI and suffix + /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). + /// /// @return token's const_metadata #[solidity(rename_selector = "tokenURI")] fn token_uri(&self, token_id: uint256) -> Result { From 090f6fa6005a18798d8feb8176e32387665af788 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 26 Jul 2022 08:14:32 +0000 Subject: [PATCH 0133/1274] misk: fix pr --- pallets/nonfungible/src/erc.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index d66389e184..f9ff590f15 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -217,12 +217,12 @@ impl NonfungibleHandle { /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. /// - /// @dev If the collection has a `url` property and it is not empty, it is returned. + /// @dev If the token has a `url` property and it is not empty, it is returned. /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. - /// If the property `baseURI` is empty or absent, return "" (empty string) - /// otherwise, if property `suffix` present and is non-empty, return concatenation of baseURI and suffix + /// If the collection property `baseURI` is empty or absent, return "" (empty string) + /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). - /// + /// /// @return token's const_metadata #[solidity(rename_selector = "tokenURI")] fn token_uri(&self, token_id: uint256) -> Result { From 7e1b91d41c2f7f579e526561b0dfb51578396c61 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 26 Jul 2022 08:15:39 +0000 Subject: [PATCH 0134/1274] misck: fix pr --- pallets/nonfungible/src/erc.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index f9ff590f15..fb3a01438c 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -218,10 +218,10 @@ impl NonfungibleHandle { /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. /// /// @dev If the token has a `url` property and it is not empty, it is returned. - /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. - /// If the collection property `baseURI` is empty or absent, return "" (empty string) - /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix - /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). + /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + /// If the collection property `baseURI` is empty or absent, return "" (empty string) + /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). /// /// @return token's const_metadata #[solidity(rename_selector = "tokenURI")] From 749341e77d246a000d85bb6b8ad74785b9d6cfc6 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Mon, 25 Jul 2022 07:54:39 +0000 Subject: [PATCH 0135/1274] feat(refungible-pallet): ERC-721 EVM API --- Makefile | 15 +- pallets/refungible/src/erc.rs | 601 +++++++++++++++++- pallets/refungible/src/lib.rs | 20 +- .../refungible/src/stubs/UniqueRefungible.sol | 364 ++++++++++- tests/src/eth/api/UniqueRefungible.sol | 216 ++++++- tests/src/eth/reFungibleAbi.json | 510 +++++++++++++++ tests/src/interfaces/augment-api-errors.ts | 87 ++- tests/src/interfaces/augment-api-query.ts | 12 + tests/src/interfaces/augment-api-tx.ts | 298 +++++++-- tests/src/interfaces/default/types.ts | 3 +- tests/src/interfaces/lookup.ts | 2 +- tests/src/interfaces/types-lookup.ts | 3 +- 12 files changed, 2046 insertions(+), 85 deletions(-) create mode 100644 tests/src/eth/reFungibleAbi.json diff --git a/Makefile b/Makefile index 836e4e5570..401caa5231 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,9 @@ REFUNGIBLE_EVM_ABI=./tests/src/eth/refungibleAbi.json NONFUNGIBLE_EVM_STUBS=./pallets/nonfungible/src/stubs NONFUNGIBLE_EVM_ABI=./tests/src/eth/nonFungibleAbi.json -RENFUNGIBLE_EVM_ABI=./tests/src/eth/reFungibleAbi.json -RENFUNGIBLE_TOKEN_EVM_ABI=./tests/src/eth/reFungibleTokenAbi.json +REFUNGIBLE_EVM_STUBS=./pallets/refungible/src/stubs +REFUNGIBLE_EVM_ABI=./tests/src/eth/reFungibleAbi.json +REFUNGIBLE_TOKEN_EVM_ABI=./tests/src/eth/reFungibleTokenAbi.json CONTRACT_HELPERS_STUBS=./pallets/evm-contract-helpers/src/stubs/ CONTRACT_HELPERS_ABI=./tests/src/eth/util/contractHelpersAbi.json @@ -36,6 +37,10 @@ UniqueFungible.sol: UniqueNFT.sol: PACKAGE=pallet-nonfungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh PACKAGE=pallet-nonfungible NAME=erc::gen_impl OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh + +UniqueRefungible.sol: + PACKAGE=pallet-refungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh + PACKAGE=pallet-refungible NAME=erc::gen_impl OUTPUT=$(REFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh UniqueRefungible.sol: PACKAGE=pallet-refungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh @@ -61,9 +66,13 @@ UniqueNFT: UniqueNFT.sol INPUT=$(NONFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/UniqueNFT.raw ./.maintain/scripts/compile_stub.sh INPUT=$(NONFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(NONFUNGIBLE_EVM_ABI) ./.maintain/scripts/generate_abi.sh +UniqueRefungible: UniqueRefungible.sol + INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_EVM_STUBS)/UniqueRefungible.raw ./.maintain/scripts/compile_stub.sh + INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_EVM_ABI) ./.maintain/scripts/generate_abi.sh + UniqueRefungibleToken: UniqueRefungibleToken.sol INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_EVM_STUBS)/UniqueRefungibleToken.raw ./.maintain/scripts/compile_stub.sh - INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(RENFUNGIBLE_TOKEN_EVM_ABI) ./.maintain/scripts/generate_abi.sh + INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_TOKEN_EVM_ABI) ./.maintain/scripts/generate_abi.sh UniqueRefungible: UniqueRefungible.sol INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_EVM_STUBS)/UniqueRefungible.raw ./.maintain/scripts/compile_stub.sh diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index f7afffdef5..cf7dc5ce7e 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -15,18 +15,607 @@ // along with Unique Network. If not, see . extern crate alloc; -use evm_coder::{generate_stubgen, solidity_interface, types::*}; -use pallet_common::{CollectionHandle, erc::CollectionCall, erc::CommonEvmHandler}; +use alloc::string::ToString; +use core::{ + char::{REPLACEMENT_CHARACTER, decode_utf16}, + convert::TryInto, +}; +use evm_coder::{ToLog, execution::*, generate_stubgen, solidity, solidity_interface, types::*, weight}; +use frame_support::{BoundedBTreeMap, BoundedVec}; +use pallet_common::{ + CollectionHandle, CollectionPropertyPermissions, + erc::{ + CommonEvmHandler, CollectionCall, + static_property::{key, value as property_value}, + }, +}; +use pallet_evm::{account::CrossAccountId, PrecompileHandle}; +use pallet_evm_coder_substrate::{call, dispatch_to_evm}; +use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _}; +use sp_core::H160; +use sp_std::{collections::btree_map::BTreeMap, vec::Vec, vec}; +use up_data_structs::{ + CollectionId, CollectionPropertiesVec, Property, PropertyKey, PropertyKeyPermission, + PropertyPermission, TokenId, +}; -use pallet_evm::PrecompileHandle; -use pallet_evm_coder_substrate::call; +use crate::{ + AccountBalance, Config, CreateItemData, Pallet, RefungibleHandle, SelfWeightOf, + TokenProperties, TokensMinted, weights::WeightInfo, +}; -use crate::{Config, RefungibleHandle}; +#[solidity_interface(name = "TokenProperties")] +impl RefungibleHandle { + fn set_token_property_permission( + &mut self, + caller: caller, + key: string, + is_mutable: bool, + collection_admin: bool, + token_owner: bool, + ) -> Result<()> { + let caller = T::CrossAccountId::from_eth(caller); + >::set_token_property_permissions( + self, + &caller, + vec![PropertyKeyPermission { + key: >::from(key) + .try_into() + .map_err(|_| "too long key")?, + permission: PropertyPermission { + mutable: is_mutable, + collection_admin, + token_owner, + }, + }], + ) + .map_err(dispatch_to_evm::) + } + + fn set_property( + &mut self, + caller: caller, + token_id: uint256, + key: string, + value: bytes, + ) -> Result<()> { + let caller = T::CrossAccountId::from_eth(caller); + let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?; + let key = >::from(key) + .try_into() + .map_err(|_| "key too long")?; + let value = value.try_into().map_err(|_| "value too long")?; + + let nesting_budget = self + .recorder + .weight_calls_budget(>::find_parent()); + + >::set_token_property( + self, + &caller, + TokenId(token_id), + Property { key, value }, + &nesting_budget, + ) + .map_err(dispatch_to_evm::) + } + + fn delete_property(&mut self, token_id: uint256, caller: caller, key: string) -> Result<()> { + let caller = T::CrossAccountId::from_eth(caller); + let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?; + let key = >::from(key) + .try_into() + .map_err(|_| "key too long")?; + + let nesting_budget = self + .recorder + .weight_calls_budget(>::find_parent()); + + >::delete_token_property(self, &caller, TokenId(token_id), key, &nesting_budget) + .map_err(dispatch_to_evm::) + } + + /// Throws error if key not found + fn property(&self, token_id: uint256, key: string) -> Result { + let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?; + let key = >::from(key) + .try_into() + .map_err(|_| "key too long")?; + + let props = >::get((self.id, token_id)); + let prop = props.get(&key).ok_or("key not found")?; + + Ok(prop.to_vec()) + } +} + +#[derive(ToLog)] +pub enum ERC721Events { + Transfer { + #[indexed] + from: address, + #[indexed] + to: address, + #[indexed] + token_id: uint256, + }, + /// @dev Not supported + Approval { + #[indexed] + owner: address, + #[indexed] + approved: address, + #[indexed] + token_id: uint256, + }, + /// @dev Not supported + #[allow(dead_code)] + ApprovalForAll { + #[indexed] + owner: address, + #[indexed] + operator: address, + approved: bool, + }, +} + +#[derive(ToLog)] +pub enum ERC721MintableEvents { + /// @dev Not supported + #[allow(dead_code)] + MintingFinished {}, +} + +#[solidity_interface(name = "ERC721Metadata")] +impl RefungibleHandle { + fn name(&self) -> Result { + Ok(decode_utf16(self.name.iter().copied()) + .map(|r| r.unwrap_or(REPLACEMENT_CHARACTER)) + .collect::()) + } + + fn symbol(&self) -> Result { + Ok(string::from_utf8_lossy(&self.token_prefix).into()) + } + + /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. + /// + /// @dev If the token has a `url` property and it is not empty, it is returned. + /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + /// If the collection property `baseURI` is empty or absent, return "" (empty string) + /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). + /// + /// @return token's const_metadata + #[solidity(rename_selector = "tokenURI")] + fn token_uri(&self, token_id: uint256) -> Result { + let token_id_u32: u32 = token_id.try_into().map_err(|_| "token id overflow")?; + + if let Ok(url) = get_token_property(self, token_id_u32, &key::url()) { + if !url.is_empty() { + return Ok(url); + } + } else if !is_erc721_metadata_compatible::(self.id) { + return Err("tokenURI not set".into()); + } + + if let Some(base_uri) = + pallet_common::Pallet::::get_collection_property(self.id, &key::base_uri()) + { + if !base_uri.is_empty() { + let base_uri = string::from_utf8(base_uri.into_inner()).map_err(|e| { + Error::Revert(alloc::format!( + "Can not convert value \"baseURI\" to string with error \"{}\"", + e + )) + })?; + if let Ok(suffix) = get_token_property(self, token_id_u32, &key::suffix()) { + if !suffix.is_empty() { + return Ok(base_uri + suffix.as_str()); + } + } + + return Ok(base_uri + token_id.to_string().as_str()); + } + } + + Ok("".into()) + } +} + +#[solidity_interface(name = "ERC721Enumerable")] +impl RefungibleHandle { + fn token_by_index(&self, index: uint256) -> Result { + Ok(index) + } + + /// Not implemented + fn token_of_owner_by_index(&self, _owner: address, _index: uint256) -> Result { + // TODO: Not implemetable + Err("not implemented".into()) + } + + fn total_supply(&self) -> Result { + self.consume_store_reads(1)?; + Ok(>::total_supply(self).into()) + } +} + +#[solidity_interface(name = "ERC721", events(ERC721Events))] +impl RefungibleHandle { + fn balance_of(&self, owner: address) -> Result { + self.consume_store_reads(1)?; + let owner = T::CrossAccountId::from_eth(owner); + let balance = >::get((self.id, owner)); + Ok(balance.into()) + } + + fn owner_of(&self, token_id: uint256) -> Result
{ + self.consume_store_reads(2)?; + let token = token_id.try_into()?; + let owner = >::token_owner(self.id, token); + Ok(owner + .map(|address| *address.as_eth()) + .unwrap_or_else(|| H160::default())) + } + + /// @dev Not implemented + fn safe_transfer_from_with_data( + &mut self, + _from: address, + _to: address, + _token_id: uint256, + _data: bytes, + _value: value, + ) -> Result { + // TODO: Not implemetable + Err("not implemented".into()) + } + + /// @dev Not implemented + fn safe_transfer_from( + &mut self, + _from: address, + _to: address, + _token_id: uint256, + _value: value, + ) -> Result { + // TODO: Not implemetable + Err("not implemented".into()) + } + + /// @dev Not implemented + fn transfer_from( + &mut self, + _caller: caller, + _from: address, + _to: address, + _token_id: uint256, + _value: value, + ) -> Result { + Err("not implemented".into()) + } + + /// @dev Not implemented + fn approve( + &mut self, + _caller: caller, + _approved: address, + _token_id: uint256, + _value: value, + ) -> Result { + Err("not implemented".into()) + } + + /// @dev Not implemented + fn set_approval_for_all( + &mut self, + _caller: caller, + _operator: address, + _approved: bool, + ) -> Result { + // TODO: Not implemetable + Err("not implemented".into()) + } + + /// @dev Not implemented + fn get_approved(&self, _token_id: uint256) -> Result
{ + // TODO: Not implemetable + Err("not implemented".into()) + } + + /// @dev Not implemented + fn is_approved_for_all(&self, _owner: address, _operator: address) -> Result
{ + // TODO: Not implemetable + Err("not implemented".into()) + } +} + +#[solidity_interface(name = "ERC721Burnable")] +impl RefungibleHandle { + /// @dev Not implemented + fn burn(&mut self, _caller: caller, _token_id: uint256, _value: value) -> Result { + Err("not implemented".into()) + } +} + +#[solidity_interface(name = "ERC721Mintable", events(ERC721MintableEvents))] +impl RefungibleHandle { + fn minting_finished(&self) -> Result { + Ok(false) + } + + /// `token_id` should be obtained with `next_token_id` method, + /// unlike standard, you can't specify it manually + #[weight(>::create_item())] + fn mint(&mut self, caller: caller, to: address, token_id: uint256) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let to = T::CrossAccountId::from_eth(to); + let token_id: u32 = token_id.try_into()?; + let budget = self + .recorder + .weight_calls_budget(>::find_parent()); + + if >::get(self.id) + .checked_add(1) + .ok_or("item id overflow")? + != token_id + { + return Err("item id should be next".into()); + } + + let const_data = BoundedVec::default(); + let users = [(to.clone(), 1)] + .into_iter() + .collect::>() + .try_into() + .unwrap(); + >::create_item( + self, + &caller, + CreateItemData:: { + const_data, + users, + properties: CollectionPropertiesVec::default(), + }, + &budget, + ) + .map_err(dispatch_to_evm::)?; + + Ok(true) + } + + /// `token_id` should be obtained with `next_token_id` method, + /// unlike standard, you can't specify it manually + #[solidity(rename_selector = "mintWithTokenURI")] + #[weight(>::create_item())] + fn mint_with_token_uri( + &mut self, + caller: caller, + to: address, + token_id: uint256, + token_uri: string, + ) -> Result { + let key = key::url(); + let permission = get_token_permission::(self.id, &key)?; + if !permission.collection_admin { + return Err("Operation is not allowed".into()); + } + + let caller = T::CrossAccountId::from_eth(caller); + let to = T::CrossAccountId::from_eth(to); + let token_id: u32 = token_id.try_into().map_err(|_| "amount overflow")?; + let budget = self + .recorder + .weight_calls_budget(>::find_parent()); + + if >::get(self.id) + .checked_add(1) + .ok_or("item id overflow")? + != token_id + { + return Err("item id should be next".into()); + } + + let mut properties = CollectionPropertiesVec::default(); + properties + .try_push(Property { + key, + value: token_uri + .into_bytes() + .try_into() + .map_err(|_| "token uri is too long")?, + }) + .map_err(|e| Error::Revert(alloc::format!("Can't add property: {:?}", e)))?; + + let const_data = BoundedVec::default(); + let users = [(to.clone(), 1)] + .into_iter() + .collect::>() + .try_into() + .unwrap(); + >::create_item( + self, + &caller, + CreateItemData:: { + const_data, + users, + properties, + }, + &budget, + ) + .map_err(dispatch_to_evm::)?; + Ok(true) + } + + /// @dev Not implemented + fn finish_minting(&mut self, _caller: caller) -> Result { + Err("not implementable".into()) + } +} + +fn get_token_property( + collection: &CollectionHandle, + token_id: u32, + key: &up_data_structs::PropertyKey, +) -> Result { + collection.consume_store_reads(1)?; + let properties = >::try_get((collection.id, token_id)) + .map_err(|_| Error::Revert("Token properties not found".into()))?; + if let Some(property) = properties.get(key) { + return Ok(string::from_utf8_lossy(property).into()); + } + + Err("Property tokenURI not found".into()) +} + +fn is_erc721_metadata_compatible(collection_id: CollectionId) -> bool { + if let Some(shema_name) = + pallet_common::Pallet::::get_collection_property(collection_id, &key::schema_name()) + { + let shema_name = shema_name.into_inner(); + shema_name == property_value::ERC721_METADATA + } else { + false + } +} + +fn get_token_permission( + collection_id: CollectionId, + key: &PropertyKey, +) -> Result { + let token_property_permissions = CollectionPropertyPermissions::::try_get(collection_id) + .map_err(|_| Error::Revert("No permissions for collection".into()))?; + let a = token_property_permissions + .get(key) + .map(Clone::clone) + .ok_or_else(|| { + let key = string::from_utf8(key.clone().into_inner()).unwrap_or_default(); + Error::Revert(alloc::format!("No permission for key {}", key)) + })?; + Ok(a) +} + +#[solidity_interface(name = "ERC721UniqueExtensions")] +impl RefungibleHandle { + /// @notice Returns next free RFT ID. + fn next_token_id(&self) -> Result { + self.consume_store_reads(1)?; + Ok(>::get(self.id) + .checked_add(1) + .ok_or("item id overflow")? + .into()) + } + + #[weight(>::create_multiple_items(token_ids.len() as u32))] + fn mint_bulk(&mut self, caller: caller, to: address, token_ids: Vec) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let to = T::CrossAccountId::from_eth(to); + let mut expected_index = >::get(self.id) + .checked_add(1) + .ok_or("item id overflow")?; + let budget = self + .recorder + .weight_calls_budget(>::find_parent()); + + let total_tokens = token_ids.len(); + for id in token_ids.into_iter() { + let id: u32 = id.try_into().map_err(|_| "token id overflow")?; + if id != expected_index { + return Err("item id should be next".into()); + } + expected_index = expected_index.checked_add(1).ok_or("item id overflow")?; + } + let const_data = BoundedVec::default(); + let users = [(to.clone(), 1)] + .into_iter() + .collect::>() + .try_into() + .unwrap(); + let create_item_data = CreateItemData:: { + const_data, + users, + properties: CollectionPropertiesVec::default(), + }; + let data = (0..total_tokens) + .map(|_| create_item_data.clone()) + .collect(); + + >::create_multiple_items(self, &caller, data, &budget) + .map_err(dispatch_to_evm::)?; + Ok(true) + } + + #[solidity(rename_selector = "mintBulkWithTokenURI")] + #[weight(>::create_multiple_items(tokens.len() as u32))] + fn mint_bulk_with_token_uri( + &mut self, + caller: caller, + to: address, + tokens: Vec<(uint256, string)>, + ) -> Result { + let key = key::url(); + let caller = T::CrossAccountId::from_eth(caller); + let to = T::CrossAccountId::from_eth(to); + let mut expected_index = >::get(self.id) + .checked_add(1) + .ok_or("item id overflow")?; + let budget = self + .recorder + .weight_calls_budget(>::find_parent()); + + let mut data = Vec::with_capacity(tokens.len()); + let const_data = BoundedVec::default(); + let users: BoundedBTreeMap<_, _, _> = [(to.clone(), 1)] + .into_iter() + .collect::>() + .try_into() + .unwrap(); + for (id, token_uri) in tokens { + let id: u32 = id.try_into().map_err(|_| "token id overflow")?; + if id != expected_index { + return Err("item id should be next".into()); + } + expected_index = expected_index.checked_add(1).ok_or("item id overflow")?; + + let mut properties = CollectionPropertiesVec::default(); + properties + .try_push(Property { + key: key.clone(), + value: token_uri + .into_bytes() + .try_into() + .map_err(|_| "token uri is too long")?, + }) + .map_err(|e| Error::Revert(alloc::format!("Can't add property: {:?}", e)))?; + + let create_item_data = CreateItemData:: { + const_data: const_data.clone(), + users: users.clone(), + properties, + }; + data.push(create_item_data); + } + + >::create_multiple_items(self, &caller, data, &budget) + .map_err(dispatch_to_evm::)?; + Ok(true) + } +} #[solidity_interface( name = "UniqueRefungible", - is(via("CollectionHandle", common_mut, Collection),) + is( + ERC721, + ERC721Metadata, + ERC721Enumerable, + ERC721UniqueExtensions, + ERC721Mintable, + ERC721Burnable, + via("CollectionHandle", common_mut, Collection), + TokenProperties, + ) )] impl RefungibleHandle where T::AccountId: From<[u8; 32]> {} diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 8d4ded78ae..a4ecba9ef6 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -88,6 +88,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use crate::erc_token::ERC20Events; +use crate::erc::ERC721Events; use codec::{Encode, Decode, MaxEncodedLen}; use core::ops::Deref; @@ -96,7 +97,8 @@ use frame_support::{BoundedVec, ensure, fail, storage::with_transaction, transac use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; use pallet_evm_coder_substrate::WithRecorder; use pallet_common::{ - CommonCollectionOperations, Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, + CommonCollectionOperations, Error as CommonError, Event as CommonEvent, + eth::collection_id_to_address, Pallet as PalletCommon, }; use pallet_structure::Pallet as PalletStructure; use scale_info::TypeInfo; @@ -117,6 +119,9 @@ pub mod common; pub mod erc; pub mod erc_token; pub mod weights; + +pub type CreateItemData = + CreateRefungibleExData<::CrossAccountId>; pub(crate) type SelfWeightOf = ::WeightInfo; /// Token data, stored independently from other data used to describe it @@ -779,6 +784,7 @@ impl Pallet { token, )), ); + >::deposit_event(CommonEvent::Transfer( collection.id, token, @@ -797,7 +803,7 @@ impl Pallet { pub fn create_multiple_items( collection: &RefungibleHandle, sender: &T::CrossAccountId, - data: Vec>, + data: Vec>, nesting_budget: &dyn Budget, ) -> DispatchResult { if !collection.is_owner_or_admin(sender) { @@ -942,6 +948,14 @@ impl Pallet { TokenId(token_id), )), ); + >::deposit_log( + ERC721Events::Transfer { + from: H160::default(), + to: *user.as_eth(), + token_id: token_id.into(), + } + .to_log(collection_id_to_address(collection.id)), + ); >::deposit_event(CommonEvent::ItemCreated( collection.id, TokenId(token_id), @@ -1120,7 +1134,7 @@ impl Pallet { pub fn create_item( collection: &RefungibleHandle, sender: &T::CrossAccountId, - data: CreateRefungibleExData, + data: CreateItemData, nesting_budget: &dyn Budget, ) -> DispatchResult { Self::create_multiple_items(collection, sender, vec![data], nesting_budget) diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index 4e49d79589..3f1232b2df 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -3,6 +3,12 @@ pragma solidity >=0.8.0 <0.9.0; +// Anonymous struct +struct Tuple0 { + uint256 field_0; + string field_1; +} + // Common stubs holder contract Dummy { uint8 dummy; @@ -21,6 +27,351 @@ contract ERC165 is Dummy { } } +// Inline +contract ERC721Events { + event Transfer( + address indexed from, + address indexed to, + uint256 indexed tokenId + ); + event Approval( + address indexed owner, + address indexed approved, + uint256 indexed tokenId + ); + event ApprovalForAll( + address indexed owner, + address indexed operator, + bool approved + ); +} + +// Inline +contract ERC721MintableEvents { + event MintingFinished(); +} + +// Selector: 0784ee64 +contract ERC721UniqueExtensions is Dummy, ERC165 { + // @notice Returns next free RFT ID. + // + // Selector: nextTokenId() 75794a3c + function nextTokenId() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: mintBulk(address,uint256[]) 44a9945e + function mintBulk(address to, uint256[] memory tokenIds) + public + returns (bool) + { + require(false, stub_error); + to; + tokenIds; + dummy = 0; + return false; + } + + // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 + function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + public + returns (bool) + { + require(false, stub_error); + to; + tokens; + dummy = 0; + return false; + } +} + +// Selector: 41369377 +contract TokenProperties is Dummy, ERC165 { + // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa + function setTokenPropertyPermission( + string memory key, + bool isMutable, + bool collectionAdmin, + bool tokenOwner + ) public { + require(false, stub_error); + key; + isMutable; + collectionAdmin; + tokenOwner; + dummy = 0; + } + + // Selector: setProperty(uint256,string,bytes) 1752d67b + function setProperty( + uint256 tokenId, + string memory key, + bytes memory value + ) public { + require(false, stub_error); + tokenId; + key; + value; + dummy = 0; + } + + // Selector: deleteProperty(uint256,string) 066111d1 + function deleteProperty(uint256 tokenId, string memory key) public { + require(false, stub_error); + tokenId; + key; + dummy = 0; + } + + // Throws error if key not found + // + // Selector: property(uint256,string) 7228c327 + function property(uint256 tokenId, string memory key) + public + view + returns (bytes memory) + { + require(false, stub_error); + tokenId; + key; + dummy; + return hex""; + } +} + +// Selector: 42966c68 +contract ERC721Burnable is Dummy, ERC165 { + // @dev Not implemented + // + // Selector: burn(uint256) 42966c68 + function burn(uint256 tokenId) public { + require(false, stub_error); + tokenId; + dummy = 0; + } +} + +// Selector: 58800161 +contract ERC721 is Dummy, ERC165, ERC721Events { + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) public view returns (uint256) { + require(false, stub_error); + owner; + dummy; + return 0; + } + + // Selector: ownerOf(uint256) 6352211e + function ownerOf(uint256 tokenId) public view returns (address) { + require(false, stub_error); + tokenId; + dummy; + return 0x0000000000000000000000000000000000000000; + } + + // @dev Not implemented + // + // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672 + function safeTransferFromWithData( + address from, + address to, + uint256 tokenId, + bytes memory data + ) public { + require(false, stub_error); + from; + to; + tokenId; + data; + dummy = 0; + } + + // @dev Not implemented + // + // Selector: safeTransferFrom(address,address,uint256) 42842e0e + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) public { + require(false, stub_error); + from; + to; + tokenId; + dummy = 0; + } + + // @dev Not implemented + // + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 tokenId + ) public { + require(false, stub_error); + from; + to; + tokenId; + dummy = 0; + } + + // @dev Not implemented + // + // Selector: approve(address,uint256) 095ea7b3 + function approve(address approved, uint256 tokenId) public { + require(false, stub_error); + approved; + tokenId; + dummy = 0; + } + + // @dev Not implemented + // + // Selector: setApprovalForAll(address,bool) a22cb465 + function setApprovalForAll(address operator, bool approved) public { + require(false, stub_error); + operator; + approved; + dummy = 0; + } + + // @dev Not implemented + // + // Selector: getApproved(uint256) 081812fc + function getApproved(uint256 tokenId) public view returns (address) { + require(false, stub_error); + tokenId; + dummy; + return 0x0000000000000000000000000000000000000000; + } + + // @dev Not implemented + // + // Selector: isApprovedForAll(address,address) e985e9c5 + function isApprovedForAll(address owner, address operator) + public + view + returns (address) + { + require(false, stub_error); + owner; + operator; + dummy; + return 0x0000000000000000000000000000000000000000; + } +} + +// Selector: 5b5e139f +contract ERC721Metadata is Dummy, ERC165 { + // Selector: name() 06fdde03 + function name() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: symbol() 95d89b41 + function symbol() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Returns token's const_metadata + // + // Selector: tokenURI(uint256) c87b56dd + function tokenURI(uint256 tokenId) public view returns (string memory) { + require(false, stub_error); + tokenId; + dummy; + return ""; + } +} + +// Selector: 68ccfe89 +contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { + // Selector: mintingFinished() 05d2035b + function mintingFinished() public view returns (bool) { + require(false, stub_error); + dummy; + return false; + } + + // `token_id` should be obtained with `next_token_id` method, + // unlike standard, you can't specify it manually + // + // Selector: mint(address,uint256) 40c10f19 + function mint(address to, uint256 tokenId) public returns (bool) { + require(false, stub_error); + to; + tokenId; + dummy = 0; + return false; + } + + // `token_id` should be obtained with `next_token_id` method, + // unlike standard, you can't specify it manually + // + // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f + function mintWithTokenURI( + address to, + uint256 tokenId, + string memory tokenUri + ) public returns (bool) { + require(false, stub_error); + to; + tokenId; + tokenUri; + dummy = 0; + return false; + } + + // @dev Not implemented + // + // Selector: finishMinting() 7d64bcb4 + function finishMinting() public returns (bool) { + require(false, stub_error); + dummy = 0; + return false; + } +} + +// Selector: 780e9d63 +contract ERC721Enumerable is Dummy, ERC165 { + // Selector: tokenByIndex(uint256) 4f6ccce7 + function tokenByIndex(uint256 index) public view returns (uint256) { + require(false, stub_error); + index; + dummy; + return 0; + } + + // Not implemented + // + // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 + function tokenOfOwnerByIndex(address owner, uint256 index) + public + view + returns (uint256) + { + require(false, stub_error); + owner; + index; + dummy; + return 0; + } + + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } +} + // Selector: 7d9262e6 contract Collection is Dummy, ERC165 { // Set collection property. @@ -248,4 +599,15 @@ contract Collection is Dummy, ERC165 { } } -contract UniqueRefungible is Dummy, ERC165, Collection {} +contract UniqueRefungible is + Dummy, + ERC165, + ERC721, + ERC721Metadata, + ERC721Enumerable, + ERC721UniqueExtensions, + ERC721Mintable, + ERC721Burnable, + Collection, + TokenProperties +{} diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index de2b7c6ff0..99c03629cc 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -3,6 +3,12 @@ pragma solidity >=0.8.0 <0.9.0; +// Anonymous struct +struct Tuple0 { + uint256 field_0; + string field_1; +} + // Common stubs holder interface Dummy { @@ -12,6 +18,203 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } +// Inline +interface ERC721Events { + event Transfer( + address indexed from, + address indexed to, + uint256 indexed tokenId + ); + event Approval( + address indexed owner, + address indexed approved, + uint256 indexed tokenId + ); + event ApprovalForAll( + address indexed owner, + address indexed operator, + bool approved + ); +} + +// Inline +interface ERC721MintableEvents { + event MintingFinished(); +} + +// Selector: 0784ee64 +interface ERC721UniqueExtensions is Dummy, ERC165 { + // @notice Returns next free RFT ID. + // + // Selector: nextTokenId() 75794a3c + function nextTokenId() external view returns (uint256); + + // Selector: mintBulk(address,uint256[]) 44a9945e + function mintBulk(address to, uint256[] memory tokenIds) + external + returns (bool); + + // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 + function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + external + returns (bool); +} + +// Selector: 41369377 +interface TokenProperties is Dummy, ERC165 { + // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa + function setTokenPropertyPermission( + string memory key, + bool isMutable, + bool collectionAdmin, + bool tokenOwner + ) external; + + // Selector: setProperty(uint256,string,bytes) 1752d67b + function setProperty( + uint256 tokenId, + string memory key, + bytes memory value + ) external; + + // Selector: deleteProperty(uint256,string) 066111d1 + function deleteProperty(uint256 tokenId, string memory key) external; + + // Throws error if key not found + // + // Selector: property(uint256,string) 7228c327 + function property(uint256 tokenId, string memory key) + external + view + returns (bytes memory); +} + +// Selector: 42966c68 +interface ERC721Burnable is Dummy, ERC165 { + // @dev Not implemented + // + // Selector: burn(uint256) 42966c68 + function burn(uint256 tokenId) external; +} + +// Selector: 58800161 +interface ERC721 is Dummy, ERC165, ERC721Events { + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) external view returns (uint256); + + // Selector: ownerOf(uint256) 6352211e + function ownerOf(uint256 tokenId) external view returns (address); + + // @dev Not implemented + // + // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672 + function safeTransferFromWithData( + address from, + address to, + uint256 tokenId, + bytes memory data + ) external; + + // @dev Not implemented + // + // Selector: safeTransferFrom(address,address,uint256) 42842e0e + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) external; + + // @dev Not implemented + // + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 tokenId + ) external; + + // @dev Not implemented + // + // Selector: approve(address,uint256) 095ea7b3 + function approve(address approved, uint256 tokenId) external; + + // @dev Not implemented + // + // Selector: setApprovalForAll(address,bool) a22cb465 + function setApprovalForAll(address operator, bool approved) external; + + // @dev Not implemented + // + // Selector: getApproved(uint256) 081812fc + function getApproved(uint256 tokenId) external view returns (address); + + // @dev Not implemented + // + // Selector: isApprovedForAll(address,address) e985e9c5 + function isApprovedForAll(address owner, address operator) + external + view + returns (address); +} + +// Selector: 5b5e139f +interface ERC721Metadata is Dummy, ERC165 { + // Selector: name() 06fdde03 + function name() external view returns (string memory); + + // Selector: symbol() 95d89b41 + function symbol() external view returns (string memory); + + // Returns token's const_metadata + // + // Selector: tokenURI(uint256) c87b56dd + function tokenURI(uint256 tokenId) external view returns (string memory); +} + +// Selector: 68ccfe89 +interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { + // Selector: mintingFinished() 05d2035b + function mintingFinished() external view returns (bool); + + // `token_id` should be obtained with `next_token_id` method, + // unlike standard, you can't specify it manually + // + // Selector: mint(address,uint256) 40c10f19 + function mint(address to, uint256 tokenId) external returns (bool); + + // `token_id` should be obtained with `next_token_id` method, + // unlike standard, you can't specify it manually + // + // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f + function mintWithTokenURI( + address to, + uint256 tokenId, + string memory tokenUri + ) external returns (bool); + + // @dev Not implemented + // + // Selector: finishMinting() 7d64bcb4 + function finishMinting() external returns (bool); +} + +// Selector: 780e9d63 +interface ERC721Enumerable is Dummy, ERC165 { + // Selector: tokenByIndex(uint256) 4f6ccce7 + function tokenByIndex(uint256 index) external view returns (uint256); + + // Not implemented + // + // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 + function tokenOfOwnerByIndex(address owner, uint256 index) + external + view + returns (uint256); + + // Selector: totalSupply() 18160ddd + function totalSupply() external view returns (uint256); +} + // Selector: 7d9262e6 interface Collection is Dummy, ERC165 { // Set collection property. @@ -160,4 +363,15 @@ interface Collection is Dummy, ERC165 { function setCollectionMintMode(bool mode) external; } -interface UniqueRefungible is Dummy, ERC165, Collection {} +interface UniqueRefungible is + Dummy, + ERC165, + ERC721, + ERC721Metadata, + ERC721Enumerable, + ERC721UniqueExtensions, + ERC721Mintable, + ERC721Burnable, + Collection, + TokenProperties +{} diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json new file mode 100644 index 0000000000..f15ff11ab8 --- /dev/null +++ b/tests/src/eth/reFungibleAbi.json @@ -0,0 +1,510 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "MintingFinished", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { "internalType": "address", "name": "newAdmin", "type": "address" } + ], + "name": "addCollectionAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "newAdmin", "type": "uint256" } + ], + "name": "addCollectionAdminSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "addToCollectionAllowList", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "approved", "type": "address" }, + { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], + "name": "collectionProperty", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "confirmCollectionSponsorship", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "contractAddress", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], + "name": "deleteCollectionProperty", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, + { "internalType": "string", "name": "key", "type": "string" } + ], + "name": "deleteProperty", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "finishMinting", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + ], + "name": "getApproved", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "operator", "type": "address" } + ], + "name": "isApprovedForAll", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + ], + "name": "mint", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256[]", "name": "tokenIds", "type": "uint256[]" } + ], + "name": "mintBulk", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { + "components": [ + { "internalType": "uint256", "name": "field_0", "type": "uint256" }, + { "internalType": "string", "name": "field_1", "type": "string" } + ], + "internalType": "struct Tuple0[]", + "name": "tokens", + "type": "tuple[]" + } + ], + "name": "mintBulkWithTokenURI", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, + { "internalType": "string", "name": "tokenUri", "type": "string" } + ], + "name": "mintWithTokenURI", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "mintingFinished", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nextTokenId", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + ], + "name": "ownerOf", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, + { "internalType": "string", "name": "key", "type": "string" } + ], + "name": "property", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "admin", "type": "address" } + ], + "name": "removeCollectionAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "admin", "type": "uint256" } + ], + "name": "removeCollectionAdminSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "removeFromCollectionAllowList", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, + { "internalType": "bytes", "name": "data", "type": "bytes" } + ], + "name": "safeTransferFromWithData", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "operator", "type": "address" }, + { "internalType": "bool", "name": "approved", "type": "bool" } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint8", "name": "mode", "type": "uint8" }], + "name": "setCollectionAccess", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "limit", "type": "string" }, + { "internalType": "uint32", "name": "value", "type": "uint32" } + ], + "name": "setCollectionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "limit", "type": "string" }, + { "internalType": "bool", "name": "value", "type": "bool" } + ], + "name": "setCollectionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "mode", "type": "bool" }], + "name": "setCollectionMintMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }], + "name": "setCollectionNesting", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bool", "name": "enable", "type": "bool" }, + { + "internalType": "address[]", + "name": "collections", + "type": "address[]" + } + ], + "name": "setCollectionNesting", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "key", "type": "string" }, + { "internalType": "bytes", "name": "value", "type": "bytes" } + ], + "name": "setCollectionProperty", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "sponsor", "type": "address" } + ], + "name": "setCollectionSponsor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, + { "internalType": "string", "name": "key", "type": "string" }, + { "internalType": "bytes", "name": "value", "type": "bytes" } + ], + "name": "setProperty", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "key", "type": "string" }, + { "internalType": "bool", "name": "isMutable", "type": "bool" }, + { "internalType": "bool", "name": "collectionAdmin", "type": "bool" }, + { "internalType": "bool", "name": "tokenOwner", "type": "bool" } + ], + "name": "setTokenPropertyPermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" } + ], + "name": "supportsInterface", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "tokenByIndex", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "tokenOfOwnerByIndex", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + ], + "name": "tokenURI", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 4f0fcec5ec..028623bb33 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -446,25 +446,83 @@ declare module '@polkadot/api-base/types/errors' { [key: string]: AugmentedError; }; rmrkCore: { + /** + * Not the target owner of the sent NFT. + **/ CannotAcceptNonOwnedNft: AugmentedError; + /** + * Not the target owner of the sent NFT. + **/ CannotRejectNonOwnedNft: AugmentedError; + /** + * NFT was not sent and is not pending. + **/ CannotRejectNonPendingNft: AugmentedError; + /** + * If an NFT is sent to a descendant, that would form a nesting loop, an ouroboros. + * Sending to self is redundant. + **/ CannotSendToDescendentOrSelf: AugmentedError; + /** + * Too many tokens created in the collection, no new ones are allowed. + **/ CollectionFullOrLocked: AugmentedError; + /** + * Only destroying collections without tokens is allowed. + **/ CollectionNotEmpty: AugmentedError; + /** + * Collection does not exist, has a wrong type, or does not map to a Unique ID. + **/ CollectionUnknown: AugmentedError; + /** + * Property of the type of RMRK collection could not be read successfully. + **/ CorruptedCollectionType: AugmentedError; - NftTypeEncodeError: AugmentedError; + /** + * Could not find an ID for a collection. It is likely there were too many collections created on the chain, causing an overflow. + **/ NoAvailableCollectionId: AugmentedError; + /** + * Token does not exist, or there is no suitable ID for it, likely too many tokens were created in a collection, causing an overflow. + **/ NoAvailableNftId: AugmentedError; + /** + * Could not find an ID for the resource. It is likely there were too many resources created on an NFT, causing an overflow. + **/ NoAvailableResourceId: AugmentedError; + /** + * Token is marked as non-transferable, and thus cannot be transferred. + **/ NonTransferable: AugmentedError; + /** + * No permission to perform action. + **/ NoPermission: AugmentedError; + /** + * No such resource found. + **/ ResourceDoesntExist: AugmentedError; + /** + * Resource is not pending for the operation. + **/ ResourceNotPending: AugmentedError; + /** + * Could not find a property by the supplied key. + **/ RmrkPropertyIsNotFound: AugmentedError; + /** + * Too many symbols supplied as the property key. The maximum is [256](up_data_structs::MAX_PROPERTY_KEY_LENGTH). + **/ RmrkPropertyKeyIsTooLong: AugmentedError; + /** + * Too many bytes supplied as the property value. The maximum is [32768](up_data_structs::MAX_PROPERTY_VALUE_LENGTH). + **/ RmrkPropertyValueIsTooLong: AugmentedError; + /** + * Something went wrong when decoding encoded data from the storage. + * Perhaps, there was a wrong key supplied for the type, or the data was improperly stored. + **/ UnableToDecodeRmrkData: AugmentedError; /** * Generic error @@ -472,12 +530,33 @@ declare module '@polkadot/api-base/types/errors' { [key: string]: AugmentedError; }; rmrkEquip: { + /** + * Base collection linked to this ID does not exist. + **/ BaseDoesntExist: AugmentedError; + /** + * No Theme named "default" is associated with the Base. + **/ NeedsDefaultThemeFirst: AugmentedError; + /** + * Could not find an ID for a Base collection. It is likely there were too many collections created on the chain, causing an overflow. + **/ NoAvailableBaseId: AugmentedError; + /** + * Could not find a suitable ID for a Part, likely too many Part tokens were created in the Base, causing an overflow + **/ NoAvailablePartId: AugmentedError; + /** + * Cannot assign equippables to a fixed Part. + **/ NoEquippableOnFixedPart: AugmentedError; + /** + * Part linked to this ID does not exist. + **/ PartDoesntExist: AugmentedError; + /** + * No permission to perform action. + **/ PermissionError: AugmentedError; /** * Generic error @@ -508,15 +587,15 @@ declare module '@polkadot/api-base/types/errors' { }; structure: { /** - * While iterating over children, reached the breadth limit. + * While nesting, reached the breadth limit of nesting, exceeding the provided budget. **/ BreadthLimit: AugmentedError; /** - * While searching for the owner, reached the depth limit. + * While nesting, reached the depth limit of nesting, exceeding the provided budget. **/ DepthLimit: AugmentedError; /** - * While searching for the owner, encountered an already checked account, detecting a loop. + * While nesting, encountered an already checked account, detecting a loop. **/ OuroborosDetected: AugmentedError; /** diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 5694c763f8..2d3ee520f0 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -492,7 +492,13 @@ declare module '@polkadot/api-base/types/storage' { [key: string]: QueryableStorageEntry; }; rmrkCore: { + /** + * Latest yet-unused collection ID. + **/ collectionIndex: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Mapping from RMRK collection ID to Unique's. + **/ uniqueCollectionId: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; /** * Generic query @@ -500,7 +506,13 @@ declare module '@polkadot/api-base/types/storage' { [key: string]: QueryableStorageEntry; }; rmrkEquip: { + /** + * Checkmark that a Base has a Theme NFT named "default". + **/ baseHasDefaultTheme: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; + /** + * Map of a Base ID and a Part ID to an NFT in the Base collection serving as the Part. + **/ inernalPartId: AugmentedQuery Observable>, [u32, u32]> & QueryableStorageEntry; /** * Generic query diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index 9abad5124b..89010386b8 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -348,103 +348,259 @@ declare module '@polkadot/api-base/types/submittable' { }; rmrkCore: { /** - * Accepts an NFT sent from another account to self or owned NFT + * Accept an NFT sent from another account to self or an owned NFT. * - * Parameters: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: collection id of the nft to be accepted - * - `rmrk_nft_id`: nft id of the nft to be accepted - * - `new_owner`: either origin's account ID or origin-owned NFT, whichever the NFT was - * sent to + * The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first. + * + * # Permissions: + * - Token-owner-to-be + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID of the NFT to be accepted. + * - `rmrk_nft_id`: ID of the NFT to be accepted. + * - `new_owner`: Either the sender's account ID or a sender-owned NFT, + * whichever the accepted NFT was sent to. **/ acceptNft: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple | { AccountId: any } | { CollectionAndNftTuple: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsNftAccountIdOrCollectionNftTuple]>; /** - * accept the addition of a new resource to an existing NFT + * Accept the addition of a newly created pending resource to an existing NFT. + * + * This transaction is needed when a resource is created and assigned to an NFT + * by a non-owner, i.e. the collection issuer, with one of the + * [`add_...` transactions](Pallet::add_basic_resource). + * + * # Permissions: + * - Token owner + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `rmrk_nft_id`: ID of the NFT with a pending resource to be accepted. + * - `resource_id`: ID of the newly created pending resource. **/ acceptResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, resourceId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; /** - * accept the removal of a resource of an existing NFT + * Accept the removal of a removal-pending resource from an NFT. + * + * This transaction is needed when a non-owner, i.e. the collection issuer, + * requests a [removal](`Pallet::remove_resource`) of a resource from an NFT. + * + * # Permissions: + * - Token owner + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `rmrk_nft_id`: ID of the NFT with a resource to be removed. + * - `resource_id`: ID of the removal-pending resource. **/ acceptResourceRemoval: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, resourceId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; /** - * Create basic resource + * Create and set/propose a basic resource for an NFT. + * + * A basic resource is the simplest, lacking a Base and anything that comes with it. + * See RMRK docs for more information and examples. + * + * # Permissions: + * - Collection issuer - if not the token owner, adding the resource will warrant + * the owner's [acceptance](Pallet::accept_resource). + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `nft_id`: ID of the NFT to assign a resource to. + * - `resource`: Data of the resource to be created. **/ addBasicResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resource: RmrkTraitsResourceBasicResource | { src?: any; metadata?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsResourceBasicResource]>; /** - * Create composable resource + * Create and set/propose a composable resource for an NFT. + * + * A composable resource links to a Base and has a subset of its Parts it is composed of. + * See RMRK docs for more information and examples. + * + * # Permissions: + * - Collection issuer - if not the token owner, adding the resource will warrant + * the owner's [acceptance](Pallet::accept_resource). + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `nft_id`: ID of the NFT to assign a resource to. + * - `resource`: Data of the resource to be created. **/ addComposableResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resource: RmrkTraitsResourceComposableResource | { parts?: any; base?: any; src?: any; metadata?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsResourceComposableResource]>; /** - * Create slot resource + * Create and set/propose a slot resource for an NFT. + * + * A slot resource links to a Base and a slot ID in it which it can fit into. + * See RMRK docs for more information and examples. + * + * # Permissions: + * - Collection issuer - if not the token owner, adding the resource will warrant + * the owner's [acceptance](Pallet::accept_resource). + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `nft_id`: ID of the NFT to assign a resource to. + * - `resource`: Data of the resource to be created. **/ addSlotResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resource: RmrkTraitsResourceSlotResource | { base?: any; src?: any; metadata?: any; slot?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsResourceSlotResource]>; /** - * burn nft + * Burn an NFT, destroying it and its nested tokens up to the specified limit. + * If the burning budget is exceeded, the transaction is reverted. + * + * This is the way to burn a nested token as well. + * + * For more information, see [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively). + * + * # Permissions: + * * Token owner + * + * # Arguments: + * - `collection_id`: RMRK ID of the collection in which the NFT to burn belongs to. + * - `nft_id`: ID of the NFT to be destroyed. + * - `max_burns`: Maximum number of tokens to burn, assuming nesting. The transaction + * is reverted if there are more tokens to burn in the nesting tree than this number. + * This is primarily a mechanism of transaction weight control. **/ burnNft: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, maxBurns: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; /** - * Change the issuer of a collection + * Change the issuer of a collection. Analogous to Unique's collection's [`owner`](up_data_structs::Collection). + * + * # Permissions: + * * Collection issuer * - * Parameters: - * - `origin`: sender of the transaction - * - `collection_id`: collection id of the nft to change issuer of - * - `new_issuer`: Collection's new issuer + * # Arguments: + * - `collection_id`: RMRK collection ID to change the issuer of. + * - `new_issuer`: Collection's new issuer. **/ changeCollectionIssuer: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newIssuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, MultiAddress]>; /** - * Create a collection + * Create a new collection of NFTs. + * + * # Permissions: + * * Anyone - will be assigned as the issuer of the collection. + * + * # Arguments: + * - `metadata`: Metadata describing the collection, e.g. IPFS hash. Cannot be changed. + * - `max`: Optional maximum number of tokens. + * - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs. + * Analogous to Unique's [`token_prefix`](up_data_structs::Collection). Cannot be changed. **/ createCollection: AugmentedSubmittable<(metadata: Bytes | string | Uint8Array, max: Option | null | object | string | Uint8Array, symbol: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes, Option, Bytes]>; /** - * destroy collection + * Destroy a collection. + * + * Only empty collections can be destroyed. If it has any tokens, they must be burned first. + * + * # Permissions: + * * Collection issuer + * + * # Arguments: + * - `collection_id`: RMRK ID of the collection to destroy. **/ destroyCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; /** - * lock collection + * "Lock" the collection and prevent new token creation. Cannot be undone. + * + * # Permissions: + * * Collection issuer + * + * # Arguments: + * - `collection_id`: RMRK ID of the collection to lock. **/ lockCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; /** - * Mints an NFT in the specified collection - * Sets metadata and the royalty attribute + * Mint an NFT in a specified collection. * - * Parameters: - * - `collection_id`: The class of the asset to be minted. - * - `nft_id`: The nft value of the asset to be minted. - * - `recipient`: Receiver of the royalty - * - `royalty`: Permillage reward from each trade for the Recipient - * - `metadata`: Arbitrary data about an nft, e.g. IPFS hash - * - `transferable`: Ability to transfer this NFT + * # Permissions: + * * Collection issuer + * + * # Arguments: + * - `owner`: Owner account of the NFT. If set to None, defaults to the sender (collection issuer). + * - `collection_id`: RMRK collection ID for the NFT to be minted within. Cannot be changed. + * - `recipient`: Receiver account of the royalty. Has no effect if the `royalty_amount` is not set. Cannot be changed. + * - `royalty_amount`: Optional permillage reward from each trade for the `recipient`. Cannot be changed. + * - `metadata`: Arbitrary data about an NFT, e.g. IPFS hash. Cannot be changed. + * - `transferable`: Can this NFT be transferred? Cannot be changed. + * - `resources`: Resource data to be added to the NFT immediately after minting. **/ mintNft: AugmentedSubmittable<(owner: Option | null | object | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, recipient: Option | null | object | string | Uint8Array, royaltyAmount: Option | null | object | string | Uint8Array, metadata: Bytes | string | Uint8Array, transferable: bool | boolean | Uint8Array, resources: Option> | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option, u32, Option, Option, Bytes, bool, Option>]>; /** - * Rejects an NFT sent from another account to self or owned NFT + * Reject an NFT sent from another account to self or owned NFT. + * The NFT in question will not be sent back and burnt instead. + * + * The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first. * - * Parameters: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: collection id of the nft to be accepted - * - `rmrk_nft_id`: nft id of the nft to be accepted + * # Permissions: + * - Token-owner-to-be-not + * + * # Arguments: + * - `rmrk_collection_id`: RMRK ID of the NFT to be rejected. + * - `rmrk_nft_id`: ID of the NFT to be rejected. **/ rejectNft: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32]>; /** - * remove resource + * Remove and erase a resource from an NFT. + * + * If the sender does not own the NFT, then it will be pending confirmation, + * and will have to be [accepted](Pallet::accept_resource_removal) by the token owner. + * + * # Permissions + * - Collection issuer + * + * # Arguments + * - `collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to. + * - `nft_id`: ID of the NFT with a resource to be removed. + * - `resource_id`: ID of the resource to be removed. **/ removeResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resourceId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; /** - * Transfers a NFT from an Account or NFT A to another Account or NFT B + * Transfer an NFT from an account/NFT A to another account/NFT B. + * The token must be transferable. Nesting cannot occur deeper than the [`NESTING_BUDGET`]. + * + * If the target owner is an NFT owned by another account, then the NFT will enter + * the pending state and will have to be accepted by the other account. * - * Parameters: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: collection id of the nft to be transferred - * - `rmrk_nft_id`: nft id of the nft to be transferred - * - `new_owner`: new owner of the nft which can be either an account or a NFT + * # Permissions: + * - Token owner + * + * # Arguments: + * - `collection_id`: RMRK ID of the collection of the NFT to be transferred. + * - `nft_id`: ID of the NFT to be transferred. + * - `new_owner`: New owner of the nft which can be either an account or a NFT. **/ send: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple | { AccountId: any } | { CollectionAndNftTuple: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsNftAccountIdOrCollectionNftTuple]>; /** - * set a different order of resource priority + * Set a different order of resource priorities for an NFT. Priorities can be used, + * for example, for order of rendering. + * + * Note that the priorities are not updated automatically, and are an empty vector + * by default. There is no pre-set definition for the order to be particular, + * it can be interpreted arbitrarily use-case by use-case. + * + * # Permissions: + * - Token owner + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `rmrk_nft_id`: ID of the NFT to rearrange resource priorities for. + * - `priorities`: Ordered vector of resource IDs. **/ setPriority: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, priorities: Vec | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic, [u32, u32, Vec]>; /** - * set a custom value on an NFT + * Add or edit a custom user property, a key-value pair, describing the metadata + * of a token or a collection, on either one of these. + * + * Note that in this proxy implementation many details regarding RMRK are stored + * as scoped properties prefixed with "rmrk:", normally inaccessible + * to external transactions and RPCs. + * + * # Permissions: + * - Collection issuer - in case of collection property + * - Token owner - in case of NFT property + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID. + * - `maybe_nft_id`: Optional ID of the NFT. If left empty, then the property is set for the collection. + * - `key`: Key of the custom property to be referenced by. + * - `value`: Value of the custom property to be stored. **/ setProperty: AugmentedSubmittable<(rmrkCollectionId: Compact | AnyNumber | Uint8Array, maybeNftId: Option | null | object | string | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Option, Bytes, Bytes]>; /** @@ -454,32 +610,50 @@ declare module '@polkadot/api-base/types/submittable' { }; rmrkEquip: { /** - * Creates a new Base. - * Modeled after [base interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/base.md) + * Create a new Base. + * + * Modeled after the [Base interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/base.md) + * + * # Permissions + * - Anyone - will be assigned as the issuer of the Base. * - * Parameters: - * - origin: Caller, will be assigned as the issuer of the Base - * - base_type: media type, e.g. "svg" - * - symbol: arbitrary client-chosen symbol - * - parts: array of Fixed and Slot parts composing the base, confined in length by - * RmrkPartsLimit + * # Arguments: + * - `base_type`: Arbitrary media type, e.g. "svg". + * - `symbol`: Arbitrary client-chosen symbol. + * - `parts`: Array of Fixed and Slot Parts composing the Base, + * confined in length by [`RmrkPartsLimit`](up_data_structs::RmrkPartsLimit). **/ createBase: AugmentedSubmittable<(baseType: Bytes | string | Uint8Array, symbol: Bytes | string | Uint8Array, parts: Vec | (RmrkTraitsPartPartType | { FixedPart: any } | { SlotPart: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Bytes, Bytes, Vec]>; + /** + * Update the array of Collections allowed to be equipped to a Base's specified Slot Part. + * + * Modeled after [equippable interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/equippable.md). + * + * # Permissions: + * - Base issuer + * + * # Arguments: + * - `base_id`: Base containing the Slot Part to be updated. + * - `part_id`: Slot Part whose Equippable List is being updated. + * - `equippables`: List of equippables that will override the current Equippables list. + **/ equippable: AugmentedSubmittable<(baseId: u32 | AnyNumber | Uint8Array, slotId: u32 | AnyNumber | Uint8Array, equippables: RmrkTraitsPartEquippableList | { All: any } | { Empty: any } | { Custom: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsPartEquippableList]>; /** - * Adds a Theme to a Base. - * Modeled after [themeadd interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/themeadd.md) - * Themes are stored in the Themes storage + * Add a Theme to a Base. * A Theme named "default" is required prior to adding other Themes. * - * Parameters: - * - origin: The caller of the function, must be issuer of the base - * - base_id: The Base containing the Theme to be updated - * - theme: The Theme to add to the Base. A Theme has a name and properties, which are an + * Modeled after [Themeadd interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/themeadd.md). + * + * # Permissions: + * - Base issuer + * + * # Arguments: + * - `base_id`: Base ID containing the Theme to be updated. + * - `theme`: Theme to add to the Base. A Theme has a name and properties, which are an * array of [key, value, inherit]. - * - key: arbitrary BoundedString, defined by client - * - value: arbitrary BoundedString, defined by client - * - inherit: optional bool + * - `key`: Arbitrary BoundedString, defined by client. + * - `value`: Arbitrary BoundedString, defined by client. + * - `inherit`: Optional bool. **/ themeAdd: AugmentedSubmittable<(baseId: u32 | AnyNumber | Uint8Array, theme: RmrkTraitsTheme | { name?: any; properties?: any; inherit?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, RmrkTraitsTheme]>; /** diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index b257a4c215..34608dd235 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -1314,7 +1314,6 @@ export interface PalletRmrkCoreCall extends Enum { /** @name PalletRmrkCoreError */ export interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; - readonly isNftTypeEncodeError: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; readonly isRmrkPropertyValueIsTooLong: boolean; readonly isRmrkPropertyIsNotFound: boolean; @@ -1333,7 +1332,7 @@ export interface PalletRmrkCoreError extends Enum { readonly isCannotRejectNonPendingNft: boolean; readonly isResourceNotPending: boolean; readonly isNoAvailableResourceId: boolean; - readonly type: 'CorruptedCollectionType' | 'NftTypeEncodeError' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; + readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } /** @name PalletRmrkCoreEvent */ diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index d29a1ef234..fce5c283e5 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -2990,7 +2990,7 @@ export default { * Lookup400: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { - _enum: ['CorruptedCollectionType', 'NftTypeEncodeError', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] + _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** * Lookup402: pallet_rmrk_equip::pallet::Error diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 3163dd8ae5..e99daa10b6 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -3144,7 +3144,6 @@ declare module '@polkadot/types/lookup' { /** @name PalletRmrkCoreError (400) */ export interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; - readonly isNftTypeEncodeError: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; readonly isRmrkPropertyValueIsTooLong: boolean; readonly isRmrkPropertyIsNotFound: boolean; @@ -3163,7 +3162,7 @@ declare module '@polkadot/types/lookup' { readonly isCannotRejectNonPendingNft: boolean; readonly isResourceNotPending: boolean; readonly isNoAvailableResourceId: boolean; - readonly type: 'CorruptedCollectionType' | 'NftTypeEncodeError' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; + readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } /** @name PalletRmrkEquipError (402) */ From 62ad43e933f26b55cf51a62d031d7e4e4aec21d1 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Wed, 27 Jul 2022 07:44:44 +0000 Subject: [PATCH 0136/1274] test(refungible-pallet): add tests for ERC-721 EVM API --- tests/src/eth/reFungible.test.ts | 222 ++++++++++++++++++++++++++ tests/src/eth/reFungibleToken.test.ts | 2 +- tests/src/eth/util/helpers.ts | 2 +- 3 files changed, 224 insertions(+), 2 deletions(-) create mode 100644 tests/src/eth/reFungible.test.ts diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts new file mode 100644 index 0000000000..07941fbb54 --- /dev/null +++ b/tests/src/eth/reFungible.test.ts @@ -0,0 +1,222 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import {createCollectionExpectSuccess} from '../util/helpers'; +import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, tokenIdToAddress} from './util/helpers'; +import reFungibleAbi from './reFungibleAbi.json'; +import reFungibleTokenAbi from './reFungibleTokenAbi.json'; +import {expect} from 'chai'; + +describe('Refungible: Information getting', () => { + itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, caller); + const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const contract = new web3.eth.Contract(reFungibleAbi as any, collectionIdAddress, {from: caller, ...GAS_ARGS}); + const nextTokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint(caller, nextTokenId).send(); + const totalSupply = await contract.methods.totalSupply().call(); + expect(totalSupply).to.equal('1'); + }); + + itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, caller); + const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const contract = new web3.eth.Contract(reFungibleAbi as any, collectionIdAddress, {from: caller, ...GAS_ARGS}); + + { + const nextTokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint(caller, nextTokenId).send(); + } + { + const nextTokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint(caller, nextTokenId).send(); + } + { + const nextTokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint(caller, nextTokenId).send(); + } + + const balance = await contract.methods.balanceOf(caller).call(); + + expect(balance).to.equal('3'); + }); + + itWeb3('ownerOf', async ({api, web3, privateKeyWrapper}) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, caller); + const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const contract = new web3.eth.Contract(reFungibleAbi as any, collectionIdAddress, {from: caller, ...GAS_ARGS}); + + const tokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint(caller, tokenId).send(); + + const owner = await contract.methods.ownerOf(tokenId).call(); + + expect(owner).to.equal(caller); + }); + + itWeb3('ownerOf after burn', async ({api, web3, privateKeyWrapper}) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const receiver = createEthAccount(web3); + const helper = evmCollectionHelpers(web3, caller); + const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const contract = new web3.eth.Contract(reFungibleAbi as any, collectionIdAddress, {from: caller, ...GAS_ARGS}); + + const tokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint(caller, tokenId).send(); + + const tokenAddress = tokenIdToAddress(collectionId, tokenId); + const tokenContract = new web3.eth.Contract(reFungibleTokenAbi as any, tokenAddress, {from: caller, ...GAS_ARGS}); + + await tokenContract.methods.repartition(2).send(); + await tokenContract.methods.transfer(receiver, 1).send(); + + await tokenContract.methods.burnFrom(caller, 1).send(); + + const owner = await contract.methods.ownerOf(tokenId).call(); + + expect(owner).to.equal(receiver); + }); +}); + +describe('Refungible: Plain calls', () => { + itWeb3('Can perform mint()', async ({web3, api, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, owner); + let result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const receiver = createEthAccount(web3); + const contract = evmCollection(web3, owner, collectionIdAddress); + const nextTokenId = await contract.methods.nextTokenId().call(); + + expect(nextTokenId).to.be.equal('1'); + result = await contract.methods.mintWithTokenURI( + receiver, + nextTokenId, + 'Test URI', + ).send(); + + const events = normalizeEvents(result.events); + + expect(events).to.include.deep.members([ + { + address: collectionIdAddress, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver, + tokenId: nextTokenId, + }, + }, + ]); + + expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); + }); + + itWeb3('Can perform mintBulk()', async ({web3, api, privateKeyWrapper}) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, caller); + const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const contract = new web3.eth.Contract(reFungibleAbi as any, collectionIdAddress, {from: caller, ...GAS_ARGS}); + + const receiver = createEthAccount(web3); + + { + const nextTokenId = await contract.methods.nextTokenId().call(); + expect(nextTokenId).to.be.equal('1'); + const result = await contract.methods.mintBulkWithTokenURI( + receiver, + [ + [nextTokenId, 'Test URI 0'], + [+nextTokenId + 1, 'Test URI 1'], + [+nextTokenId + 2, 'Test URI 2'], + ], + ).send(); + const events = normalizeEvents(result.events); + + expect(events).to.include.deep.members([ + { + address: collectionIdAddress, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver, + tokenId: nextTokenId, + }, + }, + { + address: collectionIdAddress, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver, + tokenId: String(+nextTokenId + 1), + }, + }, + { + address: collectionIdAddress, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver, + tokenId: String(+nextTokenId + 2), + }, + }, + ]); + + expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI 0'); + expect(await contract.methods.tokenURI(+nextTokenId + 1).call()).to.be.equal('Test URI 1'); + expect(await contract.methods.tokenURI(+nextTokenId + 2).call()).to.be.equal('Test URI 2'); + } + }); +}); + +describe('Common metadata', () => { + itWeb3('Returns collection name', async ({api, web3, privateKeyWrapper}) => { + const collection = await createCollectionExpectSuccess({ + name: 'token name', + mode: {type: 'ReFungible'}, + }); + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const address = collectionIdToAddress(collection); + const contract = new web3.eth.Contract(reFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const name = await contract.methods.name().call(); + + expect(name).to.equal('token name'); + }); + + itWeb3('Returns symbol name', async ({api, web3, privateKeyWrapper}) => { + const collection = await createCollectionExpectSuccess({ + tokenPrefix: 'TOK', + mode: {type: 'ReFungible'}, + }); + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const address = collectionIdToAddress(collection); + const contract = new web3.eth.Contract(reFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const symbol = await contract.methods.symbol().call(); + + expect(symbol).to.equal('TOK'); + }); +}); \ No newline at end of file diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 1da8d39186..669dd9a1fb 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -74,7 +74,7 @@ describe('Refungible token: Information getting', () => { }); // FIXME: Need erc721 for ReFubgible. -describe.skip('Check ERC721 token URI for ReFungible', () => { +describe('Check ERC721 token URI for ReFungible', () => { itWeb3('Empty tokenURI', async ({web3, api, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, owner); diff --git a/tests/src/eth/util/helpers.ts b/tests/src/eth/util/helpers.ts index ddb448c1a9..bfd4101bec 100644 --- a/tests/src/eth/util/helpers.ts +++ b/tests/src/eth/util/helpers.ts @@ -31,7 +31,7 @@ import {CollectionMode, CrossAccountId, getDetailedCollectionInfo, getGenericRes import collectionHelpersAbi from '../collectionHelpersAbi.json'; import fungibleAbi from '../fungibleAbi.json'; import nonFungibleAbi from '../nonFungibleAbi.json'; -import refungibleAbi from '../refungibleAbi.json'; +import refungibleAbi from '../reFungibleAbi.json'; import contractHelpersAbi from './contractHelpersAbi.json'; export const GAS_ARGS = {gas: 2500000}; From 30c8dcd3e73abe6b154c2339a6db3ae179ac7537 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Wed, 27 Jul 2022 08:27:54 +0000 Subject: [PATCH 0137/1274] doc(refungible-pallet): add documentation for ERC-721 implementation --- pallets/refungible/src/erc.rs | 76 ++++++++++++++++++++++++++++++++--- 1 file changed, 71 insertions(+), 5 deletions(-) diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index cf7dc5ce7e..0ec2a4e5e9 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -14,6 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! # Refungible Pallet EVM API for tokens +//! +//! Provides ERC-721 standart support implementation and EVM API for unique extensions for Refungible Pallet. +//! Method implementations are mostly doing parameter conversion and calling Refungible Pallet methods. + extern crate alloc; use alloc::string::ToString; @@ -45,8 +50,15 @@ use crate::{ TokenProperties, TokensMinted, weights::WeightInfo, }; +/// @title A contract that allows to set and delete token properties and change token property permissions. #[solidity_interface(name = "TokenProperties")] impl RefungibleHandle { + /// @notice Set permissions for token property. + /// @dev Throws error if `msg.sender` is not admin or owner of the collection. + /// @param key Property key. + /// @param is_mutable Permission to mutate property. + /// @param collection_admin Permission to mutate property by collection admin if property is mutable. + /// @param token_owner Permission to mutate property by token owner if property is mutable. fn set_token_property_permission( &mut self, caller: caller, @@ -73,6 +85,11 @@ impl RefungibleHandle { .map_err(dispatch_to_evm::) } + /// @notice Set token property value. + /// @dev Throws error if `msg.sender` has no permission to edit the property. + /// @param tokenId ID of the token. + /// @param key Property key. + /// @param value Property value. fn set_property( &mut self, caller: caller, @@ -101,6 +118,10 @@ impl RefungibleHandle { .map_err(dispatch_to_evm::) } + /// @notice Delete token property value. + /// @dev Throws error if `msg.sender` has no permission to edit the property. + /// @param tokenId ID of the token. + /// @param key Property key. fn delete_property(&mut self, token_id: uint256, caller: caller, key: string) -> Result<()> { let caller = T::CrossAccountId::from_eth(caller); let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?; @@ -116,7 +137,11 @@ impl RefungibleHandle { .map_err(dispatch_to_evm::) } - /// Throws error if key not found + /// @notice Get token property value. + /// @dev Throws error if key not found + /// @param tokenId ID of the token. + /// @param key Property key. + /// @return Property value bytes fn property(&self, token_id: uint256, key: string) -> Result { let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?; let key = >::from(key) @@ -132,6 +157,9 @@ impl RefungibleHandle { #[derive(ToLog)] pub enum ERC721Events { + /// @dev This event emits when NFTs are created (`from` == 0) and destroyed + /// (`to` == 0). Exception: during contract creation, any number of RFTs + /// may be created and assigned without emitting Transfer. Transfer { #[indexed] from: address, @@ -169,12 +197,14 @@ pub enum ERC721MintableEvents { #[solidity_interface(name = "ERC721Metadata")] impl RefungibleHandle { + /// @notice A descriptive name for a collection of RFTs in this contract fn name(&self) -> Result { Ok(decode_utf16(self.name.iter().copied()) .map(|r| r.unwrap_or(REPLACEMENT_CHARACTER)) .collect::()) } + /// @notice An abbreviated name for RFTs in this contract fn symbol(&self) -> Result { Ok(string::from_utf8_lossy(&self.token_prefix).into()) } @@ -224,8 +254,14 @@ impl RefungibleHandle { } } +/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension +/// @dev See https://eips.ethereum.org/EIPS/eip-721 #[solidity_interface(name = "ERC721Enumerable")] impl RefungibleHandle { + /// @notice Enumerate valid RFTs + /// @param index A counter less than `totalSupply()` + /// @return The token identifier for the `index`th NFT, + /// (sort order not specified) fn token_by_index(&self, index: uint256) -> Result { Ok(index) } @@ -236,14 +272,24 @@ impl RefungibleHandle { Err("not implemented".into()) } + /// @notice Count RFTs tracked by this contract + /// @return A count of valid RFTs tracked by this contract, where each one of + /// them has an assigned and queryable owner not equal to the zero address fn total_supply(&self) -> Result { self.consume_store_reads(1)?; Ok(>::total_supply(self).into()) } } +/// @title ERC-721 Non-Fungible Token Standard +/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md #[solidity_interface(name = "ERC721", events(ERC721Events))] impl RefungibleHandle { + /// @notice Count all RFTs assigned to an owner + /// @dev RFTs assigned to the zero address are considered invalid, and this + /// function throws for queries about the zero address. + /// @param owner An address for whom to query the balance + /// @return The number of RFTs owned by `owner`, possibly zero fn balance_of(&self, owner: address) -> Result { self.consume_store_reads(1)?; let owner = T::CrossAccountId::from_eth(owner); @@ -332,6 +378,7 @@ impl RefungibleHandle { } } +/// @title ERC721 Token that can be irreversibly burned (destroyed). #[solidity_interface(name = "ERC721Burnable")] impl RefungibleHandle { /// @dev Not implemented @@ -340,14 +387,18 @@ impl RefungibleHandle { } } +/// @title ERC721 minting logic. #[solidity_interface(name = "ERC721Mintable", events(ERC721MintableEvents))] impl RefungibleHandle { fn minting_finished(&self) -> Result { Ok(false) } - /// `token_id` should be obtained with `next_token_id` method, - /// unlike standard, you can't specify it manually + /// @notice Function to mint token. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted RFT #[weight(>::create_item())] fn mint(&mut self, caller: caller, to: address, token_id: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -386,8 +437,12 @@ impl RefungibleHandle { Ok(true) } - /// `token_id` should be obtained with `next_token_id` method, - /// unlike standard, you can't specify it manually + /// @notice Function to mint token with the given tokenUri. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted RFT + /// @param tokenUri Token URI that would be stored in the RFT properties #[solidity(rename_selector = "mintWithTokenURI")] #[weight(>::create_item())] fn mint_with_token_uri( @@ -497,6 +552,7 @@ fn get_token_permission( Ok(a) } +/// @title Unique extensions for ERC721. #[solidity_interface(name = "ERC721UniqueExtensions")] impl RefungibleHandle { /// @notice Returns next free RFT ID. @@ -508,6 +564,11 @@ impl RefungibleHandle { .into()) } + /// @notice Function to mint multiple tokens. + /// @dev `tokenIds` should be an array of consecutive numbers and first number + /// should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokenIds IDs of the minted RFTs #[weight(>::create_multiple_items(token_ids.len() as u32))] fn mint_bulk(&mut self, caller: caller, to: address, token_ids: Vec) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -547,6 +608,11 @@ impl RefungibleHandle { Ok(true) } + /// @notice Function to mint multiple tokens with the given tokenUris. + /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + /// numbers and first number should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokens array of pairs of token ID and token URI for minted tokens #[solidity(rename_selector = "mintBulkWithTokenURI")] #[weight(>::create_multiple_items(tokens.len() as u32))] fn mint_bulk_with_token_uri( From 7d1859c1e151dcd0e26ffaa889ce529c90b7da01 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Wed, 27 Jul 2022 08:02:22 +0000 Subject: [PATCH 0138/1274] chore: update version --- Cargo.lock | 2 +- pallets/refungible/CHANGELOG.md | 6 ++++++ pallets/refungible/Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 74848ab2ca..8728d5c13b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6320,7 +6320,7 @@ dependencies = [ [[package]] name = "pallet-refungible" -version = "0.1.2" +version = "0.1.3" dependencies = [ "ethereum", "evm-coder", diff --git a/pallets/refungible/CHANGELOG.md b/pallets/refungible/CHANGELOG.md index 4f5895b878..8ac91bda64 100644 --- a/pallets/refungible/CHANGELOG.md +++ b/pallets/refungible/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [v0.1.3] - 2022-07-27 + +### Other changes + +feat(refungible-pallet): ERC-721 EVM API ([#452](https://github.com/UniqueNetwork/unique-chain/pull/452)) + ## [v0.1.2] - 2022-07-14 ### Other changes diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index 4c5016cb78..3b54650ade 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-refungible" -version = "0.1.2" +version = "0.1.3" license = "GPLv3" edition = "2021" From abc6b050b3adfeabdea0e9d82687f1587006c4f4 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 28 Jul 2022 06:35:40 +0000 Subject: [PATCH 0139/1274] chore: implement transfer and burn for ERC-721 --- Makefile | 8 - pallets/refungible/src/erc.rs | 163 ++++++++++++-- pallets/refungible/src/lib.rs | 8 + .../refungible/src/stubs/UniqueRefungible.raw | Bin 2199 -> 4116 bytes .../refungible/src/stubs/UniqueRefungible.sol | 202 ++++++++++++++---- .../src/stubs/UniqueRefungibleToken.raw | Bin 1340 -> 1477 bytes tests/src/eth/api/UniqueRefungible.sol | 156 +++++++++++--- tests/src/eth/reFungible.test.ts | 160 +++++++++++++- tests/src/eth/reFungibleAbi.json | 20 ++ 9 files changed, 617 insertions(+), 100 deletions(-) diff --git a/Makefile b/Makefile index 401caa5231..f468a410aa 100644 --- a/Makefile +++ b/Makefile @@ -38,10 +38,6 @@ UniqueNFT.sol: PACKAGE=pallet-nonfungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh PACKAGE=pallet-nonfungible NAME=erc::gen_impl OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh -UniqueRefungible.sol: - PACKAGE=pallet-refungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh - PACKAGE=pallet-refungible NAME=erc::gen_impl OUTPUT=$(REFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh - UniqueRefungible.sol: PACKAGE=pallet-refungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh PACKAGE=pallet-refungible NAME=erc::gen_impl OUTPUT=$(REFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh @@ -74,10 +70,6 @@ UniqueRefungibleToken: UniqueRefungibleToken.sol INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_EVM_STUBS)/UniqueRefungibleToken.raw ./.maintain/scripts/compile_stub.sh INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_TOKEN_EVM_ABI) ./.maintain/scripts/generate_abi.sh -UniqueRefungible: UniqueRefungible.sol - INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_EVM_STUBS)/UniqueRefungible.raw ./.maintain/scripts/compile_stub.sh - INPUT=$(REFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(REFUNGIBLE_EVM_ABI) ./.maintain/scripts/generate_abi.sh - ContractHelpers: ContractHelpers.sol INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_STUBS)/ContractHelpers.raw ./.maintain/scripts/compile_stub.sh INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_ABI) ./.maintain/scripts/generate_abi.sh diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 0ec2a4e5e9..9aa6f100f1 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -34,8 +34,9 @@ use pallet_common::{ CommonEvmHandler, CollectionCall, static_property::{key, value as property_value}, }, + eth::collection_id_to_address, }; -use pallet_evm::{account::CrossAccountId, PrecompileHandle}; +use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm, PrecompileHandle}; use pallet_evm_coder_substrate::{call, dispatch_to_evm}; use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _}; use sp_core::H160; @@ -46,8 +47,8 @@ use up_data_structs::{ }; use crate::{ - AccountBalance, Config, CreateItemData, Pallet, RefungibleHandle, SelfWeightOf, - TokenProperties, TokensMinted, weights::WeightInfo, + AccountBalance, Balance, Config, CreateItemData, Pallet, RefungibleHandle, SelfWeightOf, + TokenProperties, TokensMinted, TotalSupply, weights::WeightInfo, }; /// @title A contract that allows to set and delete token properties and change token property permissions. @@ -331,16 +332,49 @@ impl RefungibleHandle { Err("not implemented".into()) } - /// @dev Not implemented + /// @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE + /// TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + /// THEY MAY BE PERMANENTLY LOST + /// @dev Throws unless `msg.sender` is the current owner or an authorized + /// operator for this RFT. Throws if `from` is not the current owner. Throws + /// if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + /// Throws if RFT pieces have multiple owners. + /// @param from The current owner of the NFT + /// @param to The new owner + /// @param tokenId The NFT to transfer + /// @param _value Not used for an NFT + #[weight(>::transfer_from_creating_removing())] fn transfer_from( &mut self, - _caller: caller, - _from: address, - _to: address, - _token_id: uint256, + caller: caller, + from: address, + to: address, + token_id: uint256, _value: value, ) -> Result { - Err("not implemented".into()) + let caller = T::CrossAccountId::from_eth(caller); + let from = T::CrossAccountId::from_eth(from); + let to = T::CrossAccountId::from_eth(to); + let token = token_id.try_into()?; + let budget = self + .recorder + .weight_calls_budget(>::find_parent()); + + let balance = balance(&self, token, &from)?; + ensure_single_owner(&self, token, balance)?; + + >::transfer_from(self, &caller, &from, &to, token, balance, &budget) + .map_err(dispatch_to_evm::)?; + + >::deposit_log( + ERC721Events::Transfer { + from: *from.as_eth(), + to: *to.as_eth(), + token_id: token_id.into(), + } + .to_log(collection_id_to_address(self.id)), + ); + Ok(()) } /// @dev Not implemented @@ -378,12 +412,48 @@ impl RefungibleHandle { } } +/// Returns amount of pieces of `token` that `owner` have +fn balance( + collection: &RefungibleHandle, + token: TokenId, + owner: &T::CrossAccountId, +) -> Result { + collection.consume_store_reads(1)?; + let balance = >::get((collection.id, token, &owner)); + Ok(balance) +} + +/// Throws if `owner_balance` is lower than total amount of `token` pieces +fn ensure_single_owner( + collection: &RefungibleHandle, + token: TokenId, + owner_balance: u128, +) -> Result<()> { + collection.consume_store_reads(1)?; + let total_supply = >::get((collection.id, token)); + if total_supply != owner_balance { + return Err("token has multiple owners".into()); + } + Ok(()) +} + /// @title ERC721 Token that can be irreversibly burned (destroyed). #[solidity_interface(name = "ERC721Burnable")] impl RefungibleHandle { - /// @dev Not implemented - fn burn(&mut self, _caller: caller, _token_id: uint256, _value: value) -> Result { - Err("not implemented".into()) + /// @notice Burns a specific ERC721 token. + /// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized + /// operator of the current owner. + /// @param tokenId The RFT to approve + #[weight(>::burn_item_fully())] + fn burn(&mut self, caller: caller, token_id: uint256) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let token = token_id.try_into()?; + + let balance = balance(&self, token, &caller)?; + ensure_single_owner(&self, token, balance)?; + + >::burn(self, &caller, token, balance).map_err(dispatch_to_evm::)?; + Ok(()) } } @@ -555,6 +625,75 @@ fn get_token_permission( /// @title Unique extensions for ERC721. #[solidity_interface(name = "ERC721UniqueExtensions")] impl RefungibleHandle { + /// @notice Transfer ownership of an RFT + /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` + /// is the zero address. Throws if `tokenId` is not a valid RFT. + /// Throws if RFT pieces have multiple owners. + /// @param to The new owner + /// @param tokenId The RFT to transfer + /// @param _value Not used for an RFT + #[weight(>::transfer_creating_removing())] + fn transfer( + &mut self, + caller: caller, + to: address, + token_id: uint256, + _value: value, + ) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let to = T::CrossAccountId::from_eth(to); + let token = token_id.try_into()?; + let budget = self + .recorder + .weight_calls_budget(>::find_parent()); + + let balance = balance(&self, token, &caller)?; + ensure_single_owner(&self, token, balance)?; + + >::transfer(self, &caller, &to, token, balance, &budget) + .map_err(dispatch_to_evm::)?; + >::deposit_log( + ERC721Events::Transfer { + from: *caller.as_eth(), + to: *to.as_eth(), + token_id: token_id.into(), + } + .to_log(collection_id_to_address(self.id)), + ); + Ok(()) + } + + /// @notice Burns a specific ERC721 token. + /// @dev Throws unless `msg.sender` is the current owner or an authorized + /// operator for this RFT. Throws if `from` is not the current owner. Throws + /// if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + /// Throws if RFT pieces have multiple owners. + /// @param from The current owner of the RFT + /// @param tokenId The RFT to transfer + /// @param _value Not used for an RFT + #[weight(>::burn_from())] + fn burn_from( + &mut self, + caller: caller, + from: address, + token_id: uint256, + _value: value, + ) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let from = T::CrossAccountId::from_eth(from); + let token = token_id.try_into()?; + let budget = self + .recorder + .weight_calls_budget(>::find_parent()); + + let balance = balance(&self, token, &caller)?; + ensure_single_owner(&self, token, balance)?; + + >::burn_from(self, &caller, &from, token, balance, &budget) + .map_err(dispatch_to_evm::)?; + Ok(()) + } + /// @notice Returns next free RFT ID. fn next_token_id(&self) -> Result { self.consume_store_reads(1)?; diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index a4ecba9ef6..21e1a3e00c 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -454,6 +454,14 @@ impl Pallet { >::unnest_if_nested(owner, collection.id, token); >::insert((collection.id, owner), account_balance); Self::burn_token_unchecked(collection, token)?; + >::deposit_log( + ERC721Events::Transfer { + from: *owner.as_eth(), + to: H160::default(), + token_id: token.into(), + } + .to_log(collection_id_to_address(collection.id)), + ); >::deposit_event(CommonEvent::ItemDestroyed( collection.id, token, diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index 2f1d678ef5e86e7615feb7375da0608f1a2d484d..9ea97c681d113ef1f8d0b07f630eaf05b2b3d909 100644 GIT binary patch literal 4116 zcmai14RBOf6@E9H{ogGKBnx3vvj(ic0ouA?wdztW1Dy&lJFr{(q~4o^LMl)U5eG6I z-tR6cTHkI0w9`6bYX|Gkj04OF;&gPdAS2chrnQc=M8}`f&fqAHP$b3g-uvF>h5D0a zm+zi??z!iF=bU@qqZ71Hq_Y=^CC%ui1fN1SWC+t&%22q1?~;;+W3(9fiQB6o_)JN&@!u%i$mz7pYQ;&~FuNSi z*w~pYEUS)1dNrza&``zAc6MYaaop@|XARb!#X80Do$jb)YMLoLBiqZnDx}w3Gj5Y{ z@LD6T4KK-k@X|54@8t1v)gisY?k+b=uVi4_Si=vXs#sxUiMs}8VK*%XtK-~=m{P=JyQ(gpoF8tInz^Vt^ zSm-vupO2JYZDY-&fWMkQxe0I|;05Qx3xLl8{`2tp!+?hXuTGBK1=uaOmB!mx)9*3m zyfF6{VoL9?|FQ3+2lu@4BX7P4>F0fmoB&K6gcki~W(ZRe z!2aU9-vwz3aG*MGFQjdN>+My4_AEa1k)^)_^wM4LUl{%5gRQJ739Y5p+I!*S&pZe- zoYK4O1vdc>akzKm25-wxKR5mW;5kTFZ9M%Kz&8NZV=H$8Uh#e8#xd40wQ%@zp9Opj zaPjIz5x}Pa?^G}B0Q?SMVfnSU0Qq?eKb_G5_!Hku{DA|9;Nx0Mafm4%)z+T7DayZ{;8e5|A?5T0gDCxwuwb@O@D zPNCOrZ|CJhIM!<+_ma@#lT$__Wj?yjny-l^tm&1S%OY<;7@F&uj7*9tQTF?@A-9$h zR-qa+6z!Qd;$}mohA01V#qr>Z*saq>o8)?VC~4b2V(fy{7TM7yP2@&ml4VIY7sjgeRL9qU)=vqi~f&E zJ+C8|+F1DgGM8m@QP73#(9CugE=Vy8uP|A-qoj@1MX$hyz6LrM&t4-h(r6+Z>M%0g z;0h@ZHnBkKE9kv0Iu-wjhGUv7v$5U5GQKRlgP*PF%Ixei3GKoy|4!`*Xixasp64d| z5t+%tZ%uPc?9t95Gt2mj6)f@|^iW|Lg~Y-~&;X61O>uO!}a>eM??IKk~ zgJzNAWwdjL7^Jsi5t9@NiyYwIaj#y2A(*ccQq)x1CH$|ub?#Rk7Qt8!Nuq#$?u5-E zUx%m>tmq8shng2`>C(yl==dUJUJf9h{;8sV{G%%@7R{8jahe-*$4Gw6O9LIosa@d= zL^n#~R=y4f>?sCxJgTthqaFp(y;W?g$e;-QsaA`b1ZtaVpfAJsdat|?4?uP zsfx{hE0yhOJV*cPZ}P9I>1{Husw|ekGZ73Tf$JE};oFK)4WnBq^+v8*-%}e$SiIf* zlf{;KW@D>t!2&n3mM4Z7A>aiZ7pwV4uJy7arpuLP!%cD2*goIjGZn;A43C{I0}`9`c8N!PxADA&J$x&|m-sxXWmNHq zSe4ZiU*gH~EPfA*-)*wk3EW6tkadr}3{nu?$*GwDqB%Uo>d9%m`c*b>E z;wvRh-*dw$0>za$;wc ztI1cT@-$Xi@{%MdKyLC6yfFNnNVR#M@t(%d8_0!}_aHk}ul(34zy4Fj#`TRpD6aYb z>-ZC?mGbUCJ$SP>HXW6lA`u%s4~D(-v($HO6SoQP3*-E1^==@K%hUA@Gfg*>Z;~gc$H=8vBsOMQ>5}m)|u3*6=I2pM+5I=X~Z4xkSu+o%+h~DNUr0x z&@9^R?YP-YvR9Q-Wj9~p=FloD{E|t(SvFSNXpyc%+)={PXG)qya2;ss_!E!IYT{(R z{q(@#mIt@q*F7_L`I7b07k1w4w6`98ZO5YRJr|=3zkl}R{@aFbpY`_#+ON(T*!u9s x{!b~f8OrU$8wR)L`XAmrJjD8kbHIa}wrpItY2D`GbpyG<&AH8NcyQage*=?RQpNxP literal 2199 zcmaJ?ZHN_B7@l)y?yQi+U3IUmYwhG0WLS}1^CN04ED5!_gF90U(K&l}T{m=Ha}jF^ z&z!k)H<4uKu9!UFGN%TQRk+p8mnVGwLuZaWq@|^d5 z-uJv;=Nx*0c35-~<(_ASY}$5uXaz4aWl=;)M2#>aAyZb^uK56OVaig6Dtz2E8JTXo zf^THX8mPar-H<94HK<~Qw4K0A^GH=Nr5F65lPSl*rtLYVaEBM^L~GvXWOhx#2_+=x z6!3q{i3D+l*BoO}6rG5HL?H;+r;0F`GFFZ7{}FI#yDk@!JBEF{POzAA!geX~yt$#s zbEaH!=x&jZOqUuW=c$b7PHDs1q3!fSn~ZoK)hxPzDo7~`P1|KnHfIE?6;!!$jdGMG z&O4XpO|@k?MhvV9^ukMcKYsab~2OVuB`J_FpI!dZ+Q1{__r`$NDl0naWN-wOC0 z;Gf68KMr^m@ap)`qcJxwY~nFq^V0LnSDy!b7p$H0JMKxPLofey2Ji%=!Kpc4#M0FE zA@lM}2;mQ?B!p@Juw(7Ne*^9UTW9{}8+5)x?%gAy@mM)_j%e;yTX6D$g;xe+Hk+re#9VvVmUFj%> zEiE3#ghAwUqT~gRO3h-KSCXE@vk7;GD62DCSmw<{%rZv=%j~kBT?mF< zZT0ff;gLjMe+E`ho&lsp+XbQRt$C01PNbjLEJSX03sY}%@MD>8Wr|iB(j?2rF;rKA zu`*^bbvsDfQw7%MrN-!bqheK}K;cl&W$ zBgD(gWowWCAyL$5O)J{71#f{)J+lKp6`x^C)+kk66@=2LQWsih= z%98y{VmuO%5!VlLEi60JVOcF;+B)3ZmXwD9E@177?eYT{HTnIoB-uh5zMM*FS(jS2 znCQe*E;7#S=F}uR7>G*JB#g40i9$(^UtFr}zJ$eZ)QD`_fA2capVmB|DGNC@X#f5Z z8Fyn`mv0!CuB6ub^!m7%-WCsqJaS=u0l07ZMUH(es<@tq3hG5C@Q6=}0nSqgu>@gy z!G;c5>m_){{0?K_T~of7IB?alDv6T^0G;>Yt-R5rM0j&Cvp(K4{dK%&e!gnDfiIsk z{e#KpEU3L^!MHnIA%1*Ud3dz-ZyY>`vzUI#VNK0Qf1yy_^(>3>x9+X9lKl|F@?!JLdJD#35!?^wYTT9OF{q4?k z+LN1(KDS}<6L$>Vzqn`M^un=gr#^mv=0Dv#wrwdrrcAq4Svt76Z--IZ)<5_HD-9aJ ZeOm{%^la_vAMEKi`udH2HrThb=RbIh25tZV diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index 3f1232b2df..dd031b934a 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -51,44 +51,15 @@ contract ERC721MintableEvents { event MintingFinished(); } -// Selector: 0784ee64 -contract ERC721UniqueExtensions is Dummy, ERC165 { - // @notice Returns next free RFT ID. - // - // Selector: nextTokenId() 75794a3c - function nextTokenId() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: mintBulk(address,uint256[]) 44a9945e - function mintBulk(address to, uint256[] memory tokenIds) - public - returns (bool) - { - require(false, stub_error); - to; - tokenIds; - dummy = 0; - return false; - } - - // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 - function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) - public - returns (bool) - { - require(false, stub_error); - to; - tokens; - dummy = 0; - return false; - } -} - // Selector: 41369377 contract TokenProperties is Dummy, ERC165 { + // @notice Set permissions for token property. + // @dev Throws error if `msg.sender` is not admin or owner of the collection. + // @param key Property key. + // @param is_mutable Permission to mutate property. + // @param collection_admin Permission to mutate property by collection admin if property is mutable. + // @param token_owner Permission to mutate property by token owner if property is mutable. + // // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa function setTokenPropertyPermission( string memory key, @@ -104,6 +75,12 @@ contract TokenProperties is Dummy, ERC165 { dummy = 0; } + // @notice Set token property value. + // @dev Throws error if `msg.sender` has no permission to edit the property. + // @param tokenId ID of the token. + // @param key Property key. + // @param value Property value. + // // Selector: setProperty(uint256,string,bytes) 1752d67b function setProperty( uint256 tokenId, @@ -117,6 +94,11 @@ contract TokenProperties is Dummy, ERC165 { dummy = 0; } + // @notice Delete token property value. + // @dev Throws error if `msg.sender` has no permission to edit the property. + // @param tokenId ID of the token. + // @param key Property key. + // // Selector: deleteProperty(uint256,string) 066111d1 function deleteProperty(uint256 tokenId, string memory key) public { require(false, stub_error); @@ -125,7 +107,11 @@ contract TokenProperties is Dummy, ERC165 { dummy = 0; } - // Throws error if key not found + // @notice Get token property value. + // @dev Throws error if key not found + // @param tokenId ID of the token. + // @param key Property key. + // @return Property value bytes // // Selector: property(uint256,string) 7228c327 function property(uint256 tokenId, string memory key) @@ -143,7 +129,10 @@ contract TokenProperties is Dummy, ERC165 { // Selector: 42966c68 contract ERC721Burnable is Dummy, ERC165 { - // @dev Not implemented + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current RFT owner, or an authorized + // operator of the current owner. + // @param tokenId The RFT to approve // // Selector: burn(uint256) 42966c68 function burn(uint256 tokenId) public { @@ -155,6 +144,12 @@ contract ERC721Burnable is Dummy, ERC165 { // Selector: 58800161 contract ERC721 is Dummy, ERC165, ERC721Events { + // @notice Count all RFTs assigned to an owner + // @dev RFTs assigned to the zero address are considered invalid, and this + // function throws for queries about the zero address. + // @param owner An address for whom to query the balance + // @return The number of RFTs owned by `owner`, possibly zero + // // Selector: balanceOf(address) 70a08231 function balanceOf(address owner) public view returns (uint256) { require(false, stub_error); @@ -203,7 +198,17 @@ contract ERC721 is Dummy, ERC165, ERC721Events { dummy = 0; } - // @dev Not implemented + // @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE + // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + // THEY MAY BE PERMANENTLY LOST + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this RFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param from The current owner of the NFT + // @param to The new owner + // @param tokenId The NFT to transfer + // @param _value Not used for an NFT // // Selector: transferFrom(address,address,uint256) 23b872dd function transferFrom( @@ -266,6 +271,8 @@ contract ERC721 is Dummy, ERC165, ERC721Events { // Selector: 5b5e139f contract ERC721Metadata is Dummy, ERC165 { + // @notice A descriptive name for a collection of RFTs in this contract + // // Selector: name() 06fdde03 function name() public view returns (string memory) { require(false, stub_error); @@ -273,6 +280,8 @@ contract ERC721Metadata is Dummy, ERC165 { return ""; } + // @notice An abbreviated name for RFTs in this contract + // // Selector: symbol() 95d89b41 function symbol() public view returns (string memory) { require(false, stub_error); @@ -280,7 +289,15 @@ contract ERC721Metadata is Dummy, ERC165 { return ""; } - // Returns token's const_metadata + // @notice A distinct Uniform Resource Identifier (URI) for a given asset. + // + // @dev If the token has a `url` property and it is not empty, it is returned. + // Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + // If the collection property `baseURI` is empty or absent, return "" (empty string) + // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). + // + // @return token's const_metadata // // Selector: tokenURI(uint256) c87b56dd function tokenURI(uint256 tokenId) public view returns (string memory) { @@ -300,8 +317,11 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { return false; } - // `token_id` should be obtained with `next_token_id` method, - // unlike standard, you can't specify it manually + // @notice Function to mint token. + // @dev `tokenId` should be obtained with `nextTokenId` method, + // unlike standard, you can't specify it manually + // @param to The new owner + // @param tokenId ID of the minted RFT // // Selector: mint(address,uint256) 40c10f19 function mint(address to, uint256 tokenId) public returns (bool) { @@ -312,8 +332,12 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { return false; } - // `token_id` should be obtained with `next_token_id` method, - // unlike standard, you can't specify it manually + // @notice Function to mint token with the given tokenUri. + // @dev `tokenId` should be obtained with `nextTokenId` method, + // unlike standard, you can't specify it manually + // @param to The new owner + // @param tokenId ID of the minted RFT + // @param tokenUri Token URI that would be stored in the RFT properties // // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f function mintWithTokenURI( @@ -341,6 +365,11 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { // Selector: 780e9d63 contract ERC721Enumerable is Dummy, ERC165 { + // @notice Enumerate valid RFTs + // @param index A counter less than `totalSupply()` + // @return The token identifier for the `index`th NFT, + // (sort order not specified) + // // Selector: tokenByIndex(uint256) 4f6ccce7 function tokenByIndex(uint256 index) public view returns (uint256) { require(false, stub_error); @@ -364,6 +393,10 @@ contract ERC721Enumerable is Dummy, ERC165 { return 0; } + // @notice Count RFTs tracked by this contract + // @return A count of valid RFTs tracked by this contract, where each one of + // them has an assigned and queryable owner not equal to the zero address + // // Selector: totalSupply() 18160ddd function totalSupply() public view returns (uint256) { require(false, stub_error); @@ -599,6 +632,87 @@ contract Collection is Dummy, ERC165 { } } +// Selector: d74d154f +contract ERC721UniqueExtensions is Dummy, ERC165 { + // @notice Transfer ownership of an RFT + // @dev Throws unless `msg.sender` is the current owner. Throws if `to` + // is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param to The new owner + // @param tokenId The RFT to transfer + // @param _value Not used for an RFT + // + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 tokenId) public { + require(false, stub_error); + to; + tokenId; + dummy = 0; + } + + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this RFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param from The current owner of the RFT + // @param tokenId The RFT to transfer + // @param _value Not used for an RFT + // + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 tokenId) public { + require(false, stub_error); + from; + tokenId; + dummy = 0; + } + + // @notice Returns next free RFT ID. + // + // Selector: nextTokenId() 75794a3c + function nextTokenId() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } + + // @notice Function to mint multiple tokens. + // @dev `tokenIds` should be an array of consecutive numbers and first number + // should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokenIds IDs of the minted RFTs + // + // Selector: mintBulk(address,uint256[]) 44a9945e + function mintBulk(address to, uint256[] memory tokenIds) + public + returns (bool) + { + require(false, stub_error); + to; + tokenIds; + dummy = 0; + return false; + } + + // @notice Function to mint multiple tokens with the given tokenUris. + // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // numbers and first number should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokens array of pairs of token ID and token URI for minted tokens + // + // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 + function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + public + returns (bool) + { + require(false, stub_error); + to; + tokens; + dummy = 0; + return false; + } +} + contract UniqueRefungible is Dummy, ERC165, diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.raw b/pallets/refungible/src/stubs/UniqueRefungibleToken.raw index b29f6a2418637140c0dfb0fbaf78d231958a8fc7..c63df6b90c8d202a81b7a1a89b9eba3846101dfc 100644 GIT binary patch delta 510 zcmXw#KWG$D5XNWNJCsF=Ip!L+3fhSvB7$wIbfT4IKw_Nr507cS;rqVdytfnY58b348YFa*a%&UM z&2`$CA@mG=?-;&hMos4(hBKNV-!qEQXJ+B*+|nZLL<9+4qDDd|2=)x2wLR~`oZ*_L zkqgJlQ0yjc!0>SV-6NG|=$ErDz^o)d(k!x(8* zF5}P;bSbEO)a!QsSP0f^0DgN>3{>CI!_TU?8CqHIL6A&a^9GK7WuMt(#h z`zfWA!cN&Ke}Js~18gM5nXx&Y&iS14{eB22v_h zVQ*PT=a?e#5J&{A+pKXFiT4om#*I9QDU;9+K|Gw97++h$x7Lc~P8Vx@>_WkzBI^Z` zoNq. -import {createCollectionExpectSuccess} from '../util/helpers'; -import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, tokenIdToAddress} from './util/helpers'; +import {createCollectionExpectSuccess, UNIQUE} from '../util/helpers'; +import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, tokenIdToAddress} from './util/helpers'; import reFungibleAbi from './reFungibleAbi.json'; import reFungibleTokenAbi from './reFungibleTokenAbi.json'; import {expect} from 'chai'; @@ -26,7 +26,7 @@ describe('Refungible: Information getting', () => { const helper = evmCollectionHelpers(web3, caller); const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const contract = new web3.eth.Contract(reFungibleAbi as any, collectionIdAddress, {from: caller, ...GAS_ARGS}); + const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); const nextTokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, nextTokenId).send(); const totalSupply = await contract.methods.totalSupply().call(); @@ -38,7 +38,7 @@ describe('Refungible: Information getting', () => { const helper = evmCollectionHelpers(web3, caller); const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const contract = new web3.eth.Contract(reFungibleAbi as any, collectionIdAddress, {from: caller, ...GAS_ARGS}); + const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); { const nextTokenId = await contract.methods.nextTokenId().call(); @@ -63,7 +63,7 @@ describe('Refungible: Information getting', () => { const helper = evmCollectionHelpers(web3, caller); const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const contract = new web3.eth.Contract(reFungibleAbi as any, collectionIdAddress, {from: caller, ...GAS_ARGS}); + const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); const tokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, tokenId).send(); @@ -79,7 +79,7 @@ describe('Refungible: Information getting', () => { const helper = evmCollectionHelpers(web3, caller); const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const contract = new web3.eth.Contract(reFungibleAbi as any, collectionIdAddress, {from: caller, ...GAS_ARGS}); + const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); const tokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, tokenId).send(); @@ -105,7 +105,7 @@ describe('Refungible: Plain calls', () => { let result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const receiver = createEthAccount(web3); - const contract = evmCollection(web3, owner, collectionIdAddress); + const contract = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); const nextTokenId = await contract.methods.nextTokenId().call(); expect(nextTokenId).to.be.equal('1'); @@ -137,7 +137,7 @@ describe('Refungible: Plain calls', () => { const helper = evmCollectionHelpers(web3, caller); const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const contract = new web3.eth.Contract(reFungibleAbi as any, collectionIdAddress, {from: caller, ...GAS_ARGS}); + const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); const receiver = createEthAccount(web3); @@ -189,6 +189,146 @@ describe('Refungible: Plain calls', () => { expect(await contract.methods.tokenURI(+nextTokenId + 2).call()).to.be.equal('Test URI 2'); } }); + + itWeb3('Can perform burn()', async ({web3, api, privateKeyWrapper}) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, caller); + const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + + const tokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint(caller, tokenId).send(); + { + const result = await contract.methods.burn(tokenId).send(); + const events = normalizeEvents(result.events); + + expect(events).to.be.deep.equal([ + { + address: collectionIdAddress, + event: 'Transfer', + args: { + from: caller, + to: '0x0000000000000000000000000000000000000000', + tokenId: tokenId.toString(), + }, + }, + ]); + } + }); + + itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, caller); + const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + + const receiver = createEthAccount(web3); + + const tokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint(caller, tokenId).send(); + { + const result = await contract.methods.transferFrom(caller, receiver, tokenId).send(); + const events = normalizeEvents(result.events); + expect(events).to.include.deep.members([ + { + address: collectionIdAddress, + event: 'Transfer', + args: { + from: caller, + to: receiver, + tokenId: tokenId.toString(), + }, + }, + ]); + } + + { + const balance = await contract.methods.balanceOf(receiver).call(); + expect(+balance).to.equal(1); + } + + { + const balance = await contract.methods.balanceOf(caller).call(); + expect(+balance).to.equal(0); + } + }); + + itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, caller); + const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + + const receiver = createEthAccount(web3); + + const tokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint(caller, tokenId).send(); + + { + const result = await contract.methods.transfer(receiver, tokenId).send(); + const events = normalizeEvents(result.events); + expect(events).to.include.deep.members([ + { + address: collectionIdAddress, + event: 'Transfer', + args: { + from: caller, + to: receiver, + tokenId: tokenId.toString(), + }, + }, + ]); + } + + { + const balance = await contract.methods.balanceOf(caller).call(); + expect(+balance).to.equal(0); + } + + { + const balance = await contract.methods.balanceOf(receiver).call(); + expect(+balance).to.equal(1); + } + }); +}); + +describe('RFT: Fees', () => { + itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, caller); + const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + + const receiver = createEthAccount(web3); + + const tokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint(caller, tokenId).send(); + + const cost = await recordEthFee(api, caller, () => contract.methods.transferFrom(caller, receiver, tokenId).send()); + expect(cost < BigInt(0.2 * Number(UNIQUE))); + expect(cost > 0n); + }); + + itWeb3('transfer() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, caller); + const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + + const receiver = createEthAccount(web3); + + const tokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint(caller, tokenId).send(); + + const cost = await recordEthFee(api, caller, () => contract.methods.transfer(receiver, tokenId).send()); + expect(cost < BigInt(0.2 * Number(UNIQUE))); + expect(cost > 0n); + }); }); describe('Common metadata', () => { @@ -200,7 +340,7 @@ describe('Common metadata', () => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(reFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const contract = evmCollection(web3, caller, address, {type: 'ReFungible'}); const name = await contract.methods.name().call(); expect(name).to.equal('token name'); @@ -214,7 +354,7 @@ describe('Common metadata', () => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(reFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const contract = evmCollection(web3, caller, address, {type: 'ReFungible'}); const symbol = await contract.methods.symbol().call(); expect(symbol).to.equal('TOK'); diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index f15ff11ab8..cbd18c77a6 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -135,6 +135,16 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], "name": "collectionProperty", @@ -496,6 +506,16 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "tokenId", "type": "uint256" } + ], + "name": "transfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, From 26c4de6147e804796e5d1c7db6a74ff768ba4448 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 22 Jul 2022 06:38:30 +0000 Subject: [PATCH 0140/1274] doc: Add general documentation. --- primitives/data-structs/src/lib.rs | 126 ++++++++++++++++++++++++++--- 1 file changed, 115 insertions(+), 11 deletions(-) diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 504b6a7b9f..f24fe4991d 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -55,20 +55,28 @@ pub mod budget; pub mod mapping; mod migration; +/// Maximum of decimal points. pub const MAX_DECIMAL_POINTS: DecimalPoints = 30; + +/// Maximum pieces for refungible token. pub const MAX_REFUNGIBLE_PIECES: u128 = 1_000_000_000_000_000_000_000; pub const MAX_SPONSOR_TIMEOUT: u32 = 10_368_000; +/// Maximum tokens for user. pub const MAX_TOKEN_OWNERSHIP: u32 = if cfg!(not(feature = "limit-testing")) { 100_000 } else { 10 }; + +/// Maximum for collections can be created. pub const COLLECTION_NUMBER_LIMIT: u32 = if cfg!(not(feature = "limit-testing")) { 100_000 } else { 10 }; + +/// Maximum for various custom data of token. pub const CUSTOM_DATA_LIMIT: u32 = if cfg!(not(feature = "limit-testing")) { 2048 } else { @@ -113,8 +121,10 @@ pub const MAX_TOKEN_PROPERTIES_SIZE: u32 = 32768; /// create_many call pub const MAX_ITEMS_PER_BATCH: u32 = 200; +/// Used for limit bounded types of token custom data. pub type CustomDataLimit = ConstU32; +/// Collection id. #[derive( Encode, Decode, @@ -134,6 +144,7 @@ pub struct CollectionId(pub u32); impl EncodeLike for CollectionId {} impl EncodeLike for u32 {} +/// Token id #[derive( Encode, Decode, @@ -154,6 +165,9 @@ impl EncodeLike for TokenId {} impl EncodeLike for u32 {} impl TokenId { + /// Try to get next token id. + /// + /// If next id cause overflow, then [`ArithmeticError::Overflow`] returned. pub fn try_next(self) -> Result { self.0 .checked_add(1) @@ -184,6 +198,7 @@ pub struct TokenData { pub pieces: u128, } +// TODO: unused type pub struct OverflowError; impl From for &'static str { fn from(_: OverflowError) -> Self { @@ -191,17 +206,27 @@ impl From for &'static str { } } +/// Alias for decimal points type. pub type DecimalPoints = u8; +/// Collection mode. +/// +/// Collection can represent various types of tokens. +/// Each collection can contain only one type of tokens at a time. +/// This type helps to understand which tokens the collection contains. #[derive(Encode, Decode, Eq, Debug, Clone, PartialEq, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub enum CollectionMode { + /// Non fungible tokens. NFT, + /// Fungible tokens. Fungible(DecimalPoints), + /// Refungible tokens. ReFungible, } impl CollectionMode { + /// Get collection mod as number. pub fn id(&self) -> u8 { match self { CollectionMode::NFT => 1, @@ -211,14 +236,18 @@ impl CollectionMode { } } +// TODO: unused trait pub trait SponsoringResolve { fn resolve(who: &AccountId, call: &Call) -> Option; } +/// Access mode for token. #[derive(Encode, Decode, Eq, Debug, Clone, Copy, PartialEq, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub enum AccessMode { + /// Access grant for owner and admins. Used as default. Normal, + /// Like a [`Normal`](AccessMode::Normal) but also users in allow list. AllowList, } impl Default for AccessMode { @@ -227,6 +256,7 @@ impl Default for AccessMode { } } +// TODO: remove in future. #[derive(Encode, Decode, Eq, Debug, Clone, PartialEq, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub enum SchemaVersion { @@ -239,6 +269,7 @@ impl Default for SchemaVersion { } } +// TODO: unused type #[derive(Encode, Decode, Default, Debug, Clone, PartialEq, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct Ownership { @@ -246,19 +277,21 @@ pub struct Ownership { pub fraction: u128, } +/// The state of collection sponsorship. #[derive(Encode, Decode, Debug, Clone, PartialEq, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub enum SponsorshipState { - /// The fees are applied to the transaction sender + /// The fees are applied to the transaction sender. Disabled, - /// Pending confirmation from a sponsor-to-be + /// The sponsor is under consideration. Until the sponsor gives his consent, + /// the fee will still be charged to sender. Unconfirmed(AccountId), - /// Transactions are sponsored by specified account + /// Transactions are sponsored by specified account. Confirmed(AccountId), } impl SponsorshipState { - /// Get the acting sponsor account, if present + /// Get a sponsor of the collection who has confirmed his status. pub fn sponsor(&self) -> Option<&AccountId> { match self { Self::Confirmed(sponsor) => Some(sponsor), @@ -266,7 +299,7 @@ impl SponsorshipState { } } - /// Get the sponsor account currently pending confirmation, if present + /// Get a sponsor of the collection who has pending or confirmed status. pub fn pending_sponsor(&self) -> Option<&AccountId> { match self { Self::Unconfirmed(sponsor) | Self::Confirmed(sponsor) => Some(sponsor), @@ -274,7 +307,7 @@ impl SponsorshipState { } } - /// Is sponsorship set and acting + /// Whether the sponsorship is confirmed. pub fn confirmed(&self) -> bool { matches!(self, Self::Confirmed(_)) } @@ -290,16 +323,32 @@ pub type CollectionName = BoundedVec>; pub type CollectionDescription = BoundedVec>; pub type CollectionTokenPrefix = BoundedVec>; +/// Base structure for represent collection. +/// +/// Used to provide basic functionality for all types of collections. +/// +/// #### Note /// Collection parameters, used in storage (see [`RpcCollection`] for the RPC version). #[struct_versioning::versioned(version = 2, upper)] #[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen)] pub struct Collection { + /// Collection owner account. pub owner: AccountId, + + /// Collection mode. pub mode: CollectionMode, + + /// Access mode. #[version(..2)] pub access: AccessMode, + + /// Collection name. pub name: CollectionName, + + /// Collection description. pub description: CollectionDescription, + + /// Token prefix. pub token_prefix: CollectionTokenPrefix, #[version(..2)] @@ -310,10 +359,14 @@ pub struct Collection { #[version(..2)] pub schema_version: SchemaVersion, + + /// The state of sponsorship of the collection. pub sponsorship: SponsorshipState, + /// Collection limits. pub limits: CollectionLimits, + /// Collection permissions. #[version(2.., upper(Default::default()))] pub permissions: CollectionPermissions, @@ -335,52 +388,103 @@ pub struct Collection { #[derive(Encode, Decode, Clone, PartialEq, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct RpcCollection { + /// Collection owner account. pub owner: AccountId, + + /// Collection mode. pub mode: CollectionMode, + + /// Collection name. pub name: Vec, + + /// Collection description. pub description: Vec, + + /// Token prefix. pub token_prefix: Vec, + + /// The state of sponsorship of the collection. pub sponsorship: SponsorshipState, + + /// Collection limits. pub limits: CollectionLimits, + + /// Collection permissions. pub permissions: CollectionPermissions, + + /// Token property permissions. pub token_property_permissions: Vec, + + /// Collection properties. pub properties: Vec, + + /// Is collection read only. pub read_only: bool, } +/// Data used for create collection. +/// +/// All fields are wrapped in [`Option`], where `None` means chain default. #[derive(Encode, Decode, Clone, PartialEq, TypeInfo, Derivative, MaxEncodedLen)] #[derivative(Debug, Default(bound = ""))] pub struct CreateCollectionData { + /// Collection mode. #[derivative(Default(value = "CollectionMode::NFT"))] pub mode: CollectionMode, + + /// Access mode. pub access: Option, + + /// Collection name. pub name: CollectionName, + + /// Collection description. pub description: CollectionDescription, + + /// Token prefix. pub token_prefix: CollectionTokenPrefix, + + /// Pending collection sponsor. pub pending_sponsor: Option, + + /// Collection limits. pub limits: Option, + + /// Collection permissions. pub permissions: Option, + + /// Token property permissions. pub token_property_permissions: CollectionPropertiesPermissionsVec, + + /// Collection properties. pub properties: CollectionPropertiesVec, } +/// Bounded vector of properties permissions. Max length is [`MAX_PROPERTIES_PER_ITEM`]. +// TODO: maybe rename to PropertiesPermissionsVec pub type CollectionPropertiesPermissionsVec = BoundedVec>; +/// Bounded vector of properties. Max length is [`MAX_PROPERTIES_PER_ITEM`]. pub type CollectionPropertiesVec = BoundedVec>; /// Limits and restrictions of a collection. -/// All fields are wrapped in `Option`s, where None means chain default. /// -/// todo:doc links to chain defaults +/// All fields are wrapped in [`Option`], where `None` means chain default. +/// +/// Update with `pallet_common::Pallet::clamp_limits`. // IMPORTANT: When adding/removing fields from this struct - don't forget to also -// update clamp_limits() in pallet-common. +// TODO: move `pallet_common::Pallet::clamp_limits() in pallet-common.` into `impl CollectionLimits`. #[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct CollectionLimits { - /// Maximum number of owned tokens per account. Chain default: [`ACCOUNT_TOKEN_OWNERSHIP_LIMIT`] + /// How many tokens can a user have on one account. + /// * Default - [`ACCOUNT_TOKEN_OWNERSHIP_LIMIT`]. + /// * Limit - [`MAX_TOKEN_OWNERSHIP`]. pub account_token_ownership_limit: Option, - /// Maximum size of data in bytes of a sponsored transaction. Chain default: [`CUSTOM_DATA_LIMIT`] + + /// Maximum size of data in bytes of a sponsored transaction. + /// * Default - [`CUSTOM_DATA_LIMIT`]. pub sponsored_data_size: Option, /// FIXME should we delete this or repurpose it? From 06c6a41ee25260475a78e255fa54560eb1b7e5b5 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 28 Jul 2022 11:47:55 +0000 Subject: [PATCH 0141/1274] doc --- primitives/data-structs/src/bounded.rs | 25 ++- primitives/data-structs/src/lib.rs | 266 ++++++++++++++++++++++--- primitives/data-structs/src/mapping.rs | 26 +++ primitives/rpc/src/lib.rs | 39 ++++ 4 files changed, 322 insertions(+), 34 deletions(-) diff --git a/primitives/data-structs/src/bounded.rs b/primitives/data-structs/src/bounded.rs index 244b383854..344f814361 100644 --- a/primitives/data-structs/src/bounded.rs +++ b/primitives/data-structs/src/bounded.rs @@ -1,3 +1,21 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +//! This module contins implementations for support bounded structures in [`serde`]. + use core::fmt; use sp_std::collections::{btree_map::BTreeMap, btree_set::BTreeSet}; use sp_std::vec::Vec; @@ -7,7 +25,7 @@ use frame_support::{ storage::{bounded_btree_map::BoundedBTreeMap, bounded_btree_set::BoundedBTreeSet}, }; -/// BoundedVec doesn't supports serde +/// [`serde`] implementations for [`BoundedVec`]. #[cfg(feature = "serde1")] pub mod vec_serde { use core::convert::TryFrom; @@ -39,6 +57,7 @@ pub mod vec_serde { } } +/// Format [`BoundedVec`] for debug output. pub fn vec_debug(v: &BoundedVec, f: &mut fmt::Formatter) -> Result<(), fmt::Error> where V: fmt::Debug, @@ -49,6 +68,7 @@ where #[cfg(feature = "serde1")] #[allow(dead_code)] +/// [`serde`] implementations for [`BoundedBTreeMap`]. pub mod map_serde { use core::convert::TryFrom; use sp_std::collections::btree_map::BTreeMap; @@ -84,6 +104,7 @@ pub mod map_serde { } } +/// Format [`BoundedBTreeMap`] for debug output. pub fn map_debug( v: &BoundedBTreeMap, f: &mut fmt::Formatter, @@ -98,6 +119,7 @@ where #[cfg(feature = "serde1")] #[allow(dead_code)] +/// [`serde`] implementations for [`BoundedBTreeSet`]. pub mod set_serde { use core::convert::TryFrom; use sp_std::collections::btree_set::BTreeSet; @@ -129,6 +151,7 @@ pub mod set_serde { } } +/// Format [`BoundedBTreeSet`] for debug output. pub fn set_debug(v: &BoundedBTreeSet, f: &mut fmt::Formatter) -> Result<(), fmt::Error> where K: fmt::Debug + Ord, diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index f24fe4991d..7a8c6c5530 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -14,6 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! # Primitives crate. +//! +//! This crate contains amount of types, traits and constants. + #![cfg_attr(not(feature = "std"), no_std)] use core::{ @@ -82,19 +86,28 @@ pub const CUSTOM_DATA_LIMIT: u32 = if cfg!(not(feature = "limit-testing")) { } else { 10 }; + +/// Maximum admins per collection. pub const COLLECTION_ADMINS_LIMIT: u32 = 5; + +/// Maximum tokens per collection. pub const COLLECTION_TOKEN_LIMIT: u32 = u32::MAX; + +/// Maximum tokens per account. pub const ACCOUNT_TOKEN_OWNERSHIP_LIMIT: u32 = if cfg!(not(feature = "limit-testing")) { 1_000_000 } else { 10 }; -// Timeouts for item types in passed blocks +/// Default timeout for transfer sponsoring NFT item. pub const NFT_SPONSOR_TRANSFER_TIMEOUT: u32 = 5; +/// Default timeout for transfer sponsoring fungible item. pub const FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT: u32 = 5; +/// Default timeout for transfer sponsoring refungible item. pub const REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT: u32 = 5; +/// Default timeout for sponsored approving. pub const SPONSOR_APPROVE_TIMEOUT: u32 = 5; // Schema limits @@ -102,23 +115,38 @@ pub const OFFCHAIN_SCHEMA_LIMIT: u32 = 8192; pub const VARIABLE_ON_CHAIN_SCHEMA_LIMIT: u32 = 8192; pub const CONST_ON_CHAIN_SCHEMA_LIMIT: u32 = 32768; +// TODO: not used. Delete? pub const COLLECTION_FIELD_LIMIT: u32 = CONST_ON_CHAIN_SCHEMA_LIMIT; +/// Maximum length for collection name. pub const MAX_COLLECTION_NAME_LENGTH: u32 = 64; + +/// Maximum length for collection description. pub const MAX_COLLECTION_DESCRIPTION_LENGTH: u32 = 256; + +/// Maximal token prefix length. pub const MAX_TOKEN_PREFIX_LENGTH: u32 = 16; +/// Maximal lenght of property key. pub const MAX_PROPERTY_KEY_LENGTH: u32 = 256; + +/// Maximal lenght of property value. pub const MAX_PROPERTY_VALUE_LENGTH: u32 = 32768; + +/// Maximum properties that can be assigned to token. pub const MAX_PROPERTIES_PER_ITEM: u32 = 64; +/// Maximal lenght of extended property value. pub const MAX_AUX_PROPERTY_VALUE_LENGTH: u32 = 2048; +/// Maximum size for all collection properties. pub const MAX_COLLECTION_PROPERTIES_SIZE: u32 = 40960; + +/// Maximum size for all token properties. pub const MAX_TOKEN_PROPERTIES_SIZE: u32 = 32768; /// How much items can be created per single -/// create_many call +/// create_many call. pub const MAX_ITEMS_PER_BATCH: u32 = 200; /// Used for limit bounded types of token custom data. @@ -144,7 +172,7 @@ pub struct CollectionId(pub u32); impl EncodeLike for CollectionId {} impl EncodeLike for u32 {} -/// Token id +/// Token id. #[derive( Encode, Decode, @@ -190,11 +218,17 @@ impl TryFrom for TokenId { } } +/// Token data. #[derive(Encode, Decode, Clone, PartialEq, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct TokenData { + /// Properties of token. pub properties: Vec, + + /// Token owner. pub owner: Option, + + /// Token pieces. pub pieces: u128, } @@ -241,7 +275,7 @@ pub trait SponsoringResolve { fn resolve(who: &AccountId, call: &Call) -> Option; } -/// Access mode for token. +/// Access mode for some token operations. #[derive(Encode, Decode, Eq, Debug, Clone, Copy, PartialEq, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub enum AccessMode { @@ -474,81 +508,129 @@ pub type CollectionPropertiesVec = BoundedVec, - /// Maximum size of data in bytes of a sponsored transaction. + /// How many bytes of data are available for sponsorship. /// * Default - [`CUSTOM_DATA_LIMIT`]. + /// * Limit - [`CUSTOM_DATA_LIMIT`]. pub sponsored_data_size: Option, - /// FIXME should we delete this or repurpose it? - /// None - setVariableMetadata is not sponsored - /// Some(v) - setVariableMetadata is sponsored - /// if there is v block between txs + // FIXME should we delete this or repurpose it? + /// Times in how many blocks we sponsor data. + /// + /// If is `Some(v)` then **setVariableMetadata** is sponsored if there is `v` block between transactions. + /// + /// * Default - [`SponsoringDisabled`](SponsoringRateLimit::SponsoringDisabled). + /// * Limit - [`MAX_SPONSOR_TIMEOUT`]. /// /// In any case, chain default: [`SponsoringRateLimit::SponsoringDisabled`] pub sponsored_data_rate_limit: Option, /// Maximum amount of tokens inside the collection. Chain default: [`COLLECTION_TOKEN_LIMIT`] + + /// How many tokens can be mined into this collection. + /// + /// * Default - [`COLLECTION_TOKEN_LIMIT`]. + /// * Limit - [`COLLECTION_TOKEN_LIMIT`]. pub token_limit: Option, - /// Timeout for sponsoring a token transfer in passed blocks. Chain default: - /// either [`NFT_SPONSOR_TRANSFER_TIMEOUT`], [`FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT`], or [`REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT`], - /// depending on the collection type. + /// Timeouts for transfer sponsoring. + /// + /// * Default + /// - **Fungible** - [`FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT`] + /// - **NFT** - [`NFT_SPONSOR_TRANSFER_TIMEOUT`] + /// - **Refungible** - [`REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT`] + /// * Limit - [`MAX_SPONSOR_TIMEOUT`]. pub sponsor_transfer_timeout: Option, - /// Timeout for sponsoring an approval in passed blocks. Chain default: [`SPONSOR_APPROVE_TIMEOUT`] + + /// Timeout for sponsoring an approval in passed blocks. + /// + /// * Default - [`SPONSOR_APPROVE_TIMEOUT`]. + /// * Limit - [`MAX_SPONSOR_TIMEOUT`]. pub sponsor_approve_timeout: Option, - /// Can a token be transferred by the owner. Chain default: `false` + + /// Whether the collection owner of the collection can send tokens (which belong to other users). + /// + /// * Default - **false**. pub owner_can_transfer: Option, - /// Can a token be burned by the owner. Chain default: `true` + + /// Can the collection owner burn other people's tokens. + /// + /// * Default - **true**. pub owner_can_destroy: Option, - /// Can a token be transferred at all. Chain default: `true` + + /// Is it possible to send tokens from this collection between users. + /// + /// * Default - **true**. pub transfers_enabled: Option, } impl CollectionLimits { + /// Get effective value for [`account_token_ownership_limit`](self.account_token_ownership_limit). pub fn account_token_ownership_limit(&self) -> u32 { self.account_token_ownership_limit .unwrap_or(ACCOUNT_TOKEN_OWNERSHIP_LIMIT) .min(MAX_TOKEN_OWNERSHIP) } + + /// Get effective value for [`sponsored_data_size`](self.sponsored_data_size). pub fn sponsored_data_size(&self) -> u32 { self.sponsored_data_size .unwrap_or(CUSTOM_DATA_LIMIT) .min(CUSTOM_DATA_LIMIT) } + + /// Get effective value for [`token_limit`](self.token_limit). pub fn token_limit(&self) -> u32 { self.token_limit .unwrap_or(COLLECTION_TOKEN_LIMIT) .min(COLLECTION_TOKEN_LIMIT) } + + // TODO: may be replace u32 to mode? + /// Get effective value for [`sponsor_transfer_timeout`](self.sponsor_transfer_timeout). pub fn sponsor_transfer_timeout(&self, default: u32) -> u32 { self.sponsor_transfer_timeout .unwrap_or(default) .min(MAX_SPONSOR_TIMEOUT) } + + /// Get effective value for [`sponsor_approve_timeout`](self.sponsor_approve_timeout). pub fn sponsor_approve_timeout(&self) -> u32 { self.sponsor_approve_timeout .unwrap_or(SPONSOR_APPROVE_TIMEOUT) .min(MAX_SPONSOR_TIMEOUT) } + + /// Get effective value for [`owner_can_transfer`](self.owner_can_transfer). pub fn owner_can_transfer(&self) -> bool { self.owner_can_transfer.unwrap_or(false) } + + /// Get effective value for [`owner_can_transfer_instaled`](self.owner_can_transfer_instaled). pub fn owner_can_transfer_instaled(&self) -> bool { self.owner_can_transfer.is_some() } + + /// Get effective value for [`owner_can_destroy`](self.owner_can_destroy). pub fn owner_can_destroy(&self) -> bool { self.owner_can_destroy.unwrap_or(true) } + + /// Get effective value for [`transfers_enabled`](self.transfers_enabled). pub fn transfers_enabled(&self) -> bool { self.transfers_enabled.unwrap_or(true) } + + /// Get effective value for [`sponsored_data_rate_limit`](self.sponsored_data_rate_limit). pub fn sponsored_data_rate_limit(&self) -> Option { match self .sponsored_data_rate_limit @@ -561,24 +643,46 @@ impl CollectionLimits { } /// Permissions on certain operations within a collection. -/// All fields are wrapped in `Option`s, where None means chain default. -// IMPORTANT: When adding/removing fields from this struct - don't forget to also -// update clamp_limits() in pallet-common. +/// +/// Some fields are wrapped in [`Option`], where `None` means chain default. +/// +/// Update with `pallet_common::Pallet::clamp_permissions`. #[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] +// When adding/removing fields from this struct - don't forget to also update `pallet_common::Pallet::clamp_permissions`. +// TODO: move `pallet_common::Pallet::clamp_permissions` into `impl CollectionPermissions`. pub struct CollectionPermissions { + /// Access mode. + /// + /// * Default - [`AccessMode::Normal`]. pub access: Option, + + /// Minting allowance. + /// + /// * Default - **false**. pub mint_mode: Option, + + /// Permissions for nesting. + /// + /// * Default + /// - `token_owner` - **false** + /// - `collection_admin` - **false** + /// - `restricted` - **None** pub nesting: Option, } impl CollectionPermissions { + /// Get effective value for [`access`](self.access). pub fn access(&self) -> AccessMode { self.access.unwrap_or(AccessMode::Normal) } + + /// Get effective value for [`mint_mode`](self.mint_mode). pub fn mint_mode(&self) -> bool { self.mint_mode.unwrap_or(false) } + + /// Get effective value for [`nesting`](self.nesting). pub fn nesting(&self) -> &NestingPermissions { static DEFAULT: NestingPermissions = NestingPermissions { token_owner: false, @@ -591,8 +695,10 @@ impl CollectionPermissions { } } +/// Inner set for collections allowed to nest. type OwnerRestrictedSetInner = BoundedBTreeSet>; +/// Wraper for collections set allowing nest. #[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen, Derivative)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] #[derivative(Debug)] @@ -601,7 +707,9 @@ pub struct OwnerRestrictedSet( #[derivative(Debug(format_with = "bounded::set_debug"))] pub OwnerRestrictedSetInner, ); + impl OwnerRestrictedSet { + /// Create new set. pub fn new() -> Self { Self(Default::default()) } @@ -623,19 +731,21 @@ impl core::ops::DerefMut for OwnerRestrictedSet { #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] #[derivative(Debug)] pub struct NestingPermissions { - /// Owner of token can nest tokens under it + /// Owner of token can nest tokens under it. pub token_owner: bool, - /// Admin of token collection can nest tokens under token + /// Admin of token collection can nest tokens under token. pub collection_admin: bool, - /// If set - only tokens from specified collections can be nested + /// If set - only tokens from specified collections can be nested. pub restricted: Option, #[cfg(feature = "runtime-benchmarks")] - /// Anyone can nest tokens, mutually exclusive with `token_owner`, `admin` + /// Anyone can nest tokens, mutually exclusive with `token_owner`, `admin`. pub permissive: bool, } /// Enum denominating how often can sponsoring occur if it is enabled. +/// +/// Used for [`collection limits`](CollectionLimits). #[derive(Encode, Decode, Debug, Clone, Copy, PartialEq, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub enum SponsoringRateLimit { @@ -653,6 +763,7 @@ pub struct CreateNftData { /// Key-value pairs used to describe the token as metadata #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))] #[derivative(Debug(format_with = "bounded::vec_debug"))] + /// Properties that wil be assignet to created item. pub properties: CollectionPropertiesVec, } @@ -674,7 +785,7 @@ pub struct CreateReFungibleData { #[derivative(Debug(format_with = "bounded::vec_debug"))] pub const_data: BoundedVec, - /// Number of pieces the RFT is split into + /// Pieces of created token. pub pieces: u128, /// Key-value pairs used to describe the token as metadata @@ -683,6 +794,7 @@ pub struct CreateReFungibleData { pub properties: CollectionPropertiesVec, } +// TODO: remove this. #[derive(Encode, Decode, Debug, Clone, PartialEq, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub enum MetaUpdatePermission { @@ -692,57 +804,75 @@ pub enum MetaUpdatePermission { } /// Enum holding data used for creation of all three item types. +/// Unified data for create item. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub enum CreateItemData { + /// Data for create NFT. NFT(CreateNftData), + /// Data for create Fungible item. Fungible(CreateFungibleData), + /// Data for create ReFungible item. ReFungible(CreateReFungibleData), } -/// Explicit NFT creation data with meta parameters. +/// Extended data for create NFT. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] #[derivative(Debug)] pub struct CreateNftExData { + /// Properties that wil be assignet to created item. #[derivative(Debug(format_with = "bounded::vec_debug"))] pub properties: CollectionPropertiesVec, + + /// Owner of creating item. pub owner: CrossAccountId, } -/// Explicit RFT creation data with meta parameters. +/// Extended data for create ReFungible item. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] #[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))] pub struct CreateRefungibleExData { + /// Custom data stored in token. #[derivative(Debug(format_with = "bounded::vec_debug"))] pub const_data: BoundedVec, + + /// Users who will be assigned the specified number of token parts. #[derivative(Debug(format_with = "bounded::map_debug"))] pub users: BoundedBTreeMap>, #[derivative(Debug(format_with = "bounded::vec_debug"))] pub properties: CollectionPropertiesVec, } -/// Explicit item creation data with meta parameters, namely the owner. +/// Unified extended data for creating item. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] #[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))] pub enum CreateItemExData { + /// Extended data for create NFT. NFT( #[derivative(Debug(format_with = "bounded::vec_debug"))] BoundedVec, ConstU32>, ), + + /// Extended data for create Fungible item. Fungible( #[derivative(Debug(format_with = "bounded::map_debug"))] BoundedBTreeMap>, ), - /// Many tokens, each may have only one owner + + /// Extended data for create ReFungible item in case of + /// many tokens, each may have only one owner RefungibleMultipleItems( #[derivative(Debug(format_with = "bounded::vec_debug"))] BoundedVec, ConstU32>, ), - /// Single token, which may have many owners + + /// Extended data for create ReFungible item in case of + /// single token, which may have many owners RefungibleMultipleOwners(CreateRefungibleExData), } impl CreateItemData { + /// Get size of custom data. pub fn data_size(&self) -> usize { match self { CreateItemData::ReFungible(data) => data.const_data.len(), @@ -774,18 +904,28 @@ impl From for CreateItemData { #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] // todo possibly rename to be used generally as an address pair pub struct TokenChild { + /// Token id. pub token: TokenId, + + /// Collection id. pub collection: CollectionId, } +/// Collection statistics. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, Debug, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct CollectionStats { + /// Number of created items. pub created: u32, + + /// Number of burned items. pub destroyed: u32, + + /// Number of current items. pub alive: u32, } +/// This type works like [`PhantomData`] but supports generating _scale-info_ descriptions to generate node metadata. #[derive(Encode, Decode, Clone, Debug)] #[cfg_attr(feature = "std", derive(PartialEq))] pub struct PhantomType(core::marker::PhantomData); @@ -811,22 +951,36 @@ impl MaxEncodedLen for PhantomType { } } +/// Bounded vector of bytes. pub type BoundedBytes = BoundedVec; +/// Extra properties for external collections. pub type AuxPropertyValue = BoundedBytes>; +/// Property key. pub type PropertyKey = BoundedBytes>; + +/// Property value. pub type PropertyValue = BoundedBytes>; +/// Property permission. #[derive(Encode, Decode, TypeInfo, Debug, MaxEncodedLen, PartialEq, Clone)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct PropertyPermission { + /// Permission to change the property and property permission. + /// + /// If it **false** then you can not change corresponding property even if [`collection_admin`] and [`token_owner`] are **true**. pub mutable: bool, + + /// Change permission for the collection administrator. pub collection_admin: bool, + + /// Permission to change the property for the owner of the token. pub token_owner: bool, } impl PropertyPermission { + /// Creates mutable property permission but changes restricted for collection admin and token owner. pub fn none() -> Self { Self { mutable: true, @@ -836,12 +990,15 @@ impl PropertyPermission { } } +/// Property is simpl key-value record. #[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq, MaxEncodedLen)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct Property { + /// Property key. #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))] pub key: PropertyKey, + /// Property value. #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))] pub value: PropertyValue, } @@ -852,12 +1009,15 @@ impl Into<(PropertyKey, PropertyValue)> for Property { } } +/// Record for proprty key permission. #[derive(Encode, Decode, TypeInfo, Debug, MaxEncodedLen, PartialEq, Clone)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct PropertyKeyPermission { + /// Key. #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))] pub key: PropertyKey, + /// Permission. pub permission: PropertyPermission, } @@ -867,15 +1027,35 @@ impl Into<(PropertyKey, PropertyPermission)> for PropertyKeyPermission { } } +/// Errors for properties actions. #[derive(Debug)] pub enum PropertiesError { + /// The space allocated for properties has run out. + /// + /// * Limit for colection - [`MAX_COLLECTION_PROPERTIES_SIZE`]. + /// * Limit for token - [`MAX_TOKEN_PROPERTIES_SIZE`]. NoSpaceForProperty, + + /// The property limit has been reached. + /// + /// * Limit - [`MAX_PROPERTIES_PER_ITEM`]. PropertyLimitReached, + + /// Property key contains not allowed character. InvalidCharacterInPropertyKey, + + /// Property key length is too long. + /// + /// * Limit - [`MAX_PROPERTY_KEY_LENGTH`]. PropertyKeyIsTooLong, + + /// Property key is empty. EmptyPropertyKey, } +/// Marker for scope of property. +/// +/// Scoped property can't be changed by user. Used for external collections. #[derive(Encode, Decode, MaxEncodedLen, TypeInfo, PartialEq, Clone, Copy)] pub enum PropertyScope { None, @@ -883,6 +1063,7 @@ pub enum PropertyScope { } impl PropertyScope { + /// Apply scope to property key. pub fn apply(self, key: PropertyKey) -> Result { let scope_str: &[u8] = match self { Self::None => return Ok(key), @@ -896,16 +1077,20 @@ impl PropertyScope { } } +/// Trait for operate with properties. pub trait TrySetProperty: Sized { type Value; + /// Try to set property with scope. fn try_scoped_set( &mut self, scope: PropertyScope, key: PropertyKey, value: Self::Value, ) -> Result<(), PropertiesError>; - + + + /// Try to set property with scope from iterator. fn try_scoped_set_from_iter( &mut self, scope: PropertyScope, @@ -923,10 +1108,12 @@ pub trait TrySetProperty: Sized { Ok(()) } + /// Try to set property. fn try_set(&mut self, key: PropertyKey, value: Self::Value) -> Result<(), PropertiesError> { self.try_scoped_set(PropertyScope::None, key, value) } - + + /// Try to set property from iterator. fn try_set_from_iter(&mut self, iter: I) -> Result<(), PropertiesError> where I: Iterator, @@ -936,6 +1123,7 @@ pub trait TrySetProperty: Sized { } } +/// Wrapped map for storing properties. #[derive(Encode, Decode, TypeInfo, Derivative, Clone, PartialEq, MaxEncodedLen)] #[derivative(Default(bound = ""))] pub struct PropertiesMap( @@ -943,24 +1131,29 @@ pub struct PropertiesMap( ); impl PropertiesMap { + /// Create new property map. pub fn new() -> Self { Self(BoundedBTreeMap::new()) } + /// Remove property from map. pub fn remove(&mut self, key: &PropertyKey) -> Result, PropertiesError> { Self::check_property_key(key)?; Ok(self.0.remove(key)) } + /// Get property with appropriate key from map. pub fn get(&self, key: &PropertyKey) -> Option<&Value> { self.0.get(key) } + /// Check if map contains key. pub fn contains_key(&self, key: &PropertyKey) -> bool { self.0.contains_key(key) } - + + /// Check if map contains key with key validation. fn check_property_key(key: &PropertyKey) -> Result<(), PropertiesError> { if key.is_empty() { return Err(PropertiesError::EmptyPropertyKey); @@ -1013,8 +1206,10 @@ impl TrySetProperty for PropertiesMap { } } +/// Alias for property permissions map. pub type PropertiesPermissionMap = PropertiesMap; +/// Wrapper for properties map with consumed space control. #[derive(Encode, Decode, TypeInfo, Clone, PartialEq, MaxEncodedLen)] pub struct Properties { map: PropertiesMap, @@ -1023,6 +1218,7 @@ pub struct Properties { } impl Properties { + /// Create new properies container. pub fn new(space_limit: u32) -> Self { Self { map: PropertiesMap::new(), @@ -1031,6 +1227,7 @@ impl Properties { } } + /// Remove propery with appropiate key. pub fn remove(&mut self, key: &PropertyKey) -> Result, PropertiesError> { let value = self.map.remove(key)?; @@ -1042,6 +1239,7 @@ impl Properties { Ok(value) } + /// Get property with appropriate key. pub fn get(&self, key: &PropertyKey) -> Option<&PropertyValue> { self.map.get(key) } @@ -1081,6 +1279,7 @@ impl TrySetProperty for Properties { } } +/// Utility struct for using in `StorageMap`. pub struct CollectionProperties; impl Get for CollectionProperties { @@ -1089,6 +1288,7 @@ impl Get for CollectionProperties { } } +/// Utility struct for using in `StorageMap`. pub struct TokenProperties; impl Get for TokenProperties { diff --git a/primitives/data-structs/src/mapping.rs b/primitives/data-structs/src/mapping.rs index 857eec4c70..23d95a3dd2 100644 --- a/primitives/data-structs/src/mapping.rs +++ b/primitives/data-structs/src/mapping.rs @@ -1,3 +1,21 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +//! This module contains mapping between different addresses. + use core::marker::PhantomData; use sp_core::H160; @@ -5,12 +23,19 @@ use sp_core::H160; use crate::{CollectionId, TokenId}; use pallet_evm::account::CrossAccountId; +/// Trait for mapping between token id and some `Address`. pub trait TokenAddressMapping
{ + /// Map token id to `Address`. fn token_to_address(collection: CollectionId, token: TokenId) -> Address; + + /// Map `Address` to token id. fn address_to_token(address: &Address) -> Option<(CollectionId, TokenId)>; + + /// Check is address for token. fn is_token_address(address: &Address) -> bool; } +/// Unit struct for mapping token id to/from *Evm address* represented by [`H160`]. pub struct EvmTokenAddressMapping; /// 0xf8238ccfff8ed887463fd5e00000000100000002 - collection 1, token 2 @@ -46,6 +71,7 @@ impl TokenAddressMapping for EvmTokenAddressMapping { } } +/// Unit struct for mapping token id to/from [`CrossAccountId`]. pub struct CrossTokenAddressMapping(PhantomData); impl> TokenAddressMapping for CrossTokenAddressMapping { diff --git a/primitives/rpc/src/lib.rs b/primitives/rpc/src/lib.rs index f8c913667b..44090914e6 100644 --- a/primitives/rpc/src/lib.rs +++ b/primitives/rpc/src/lib.rs @@ -28,6 +28,7 @@ type Result = core::result::Result; sp_api::decl_runtime_apis! { #[api_version(2)] + /// Trait for generate rpc. pub trait UniqueApi where AccountId: Decode, CrossAccountId: pallet_evm::account::CrossAccountId, @@ -35,36 +36,57 @@ sp_api::decl_runtime_apis! { #[changed_in(2)] fn token_owner(collection: CollectionId, token: TokenId) -> Result; + /// Get number of tokens in collection owned by account. fn account_tokens(collection: CollectionId, account: CrossAccountId) -> Result>; + + /// Number of existing tokens in collection. fn collection_tokens(collection: CollectionId) -> Result>; + + /// Check token exist. fn token_exists(collection: CollectionId, token: TokenId) -> Result; + /// Get token owner. fn token_owner(collection: CollectionId, token: TokenId) -> Result>; + + /// Get real owner of nested token. fn topmost_token_owner(collection: CollectionId, token: TokenId) -> Result>; + + /// Get nested tokens for the specified item. fn token_children(collection: CollectionId, token: TokenId) -> Result>; + /// Get collection properties. fn collection_properties(collection: CollectionId, properties: Option>>) -> Result>; + /// Get token properties. fn token_properties( collection: CollectionId, token_id: TokenId, properties: Option>> ) -> Result>; + /// Get permissions for token properties. fn property_permissions( collection: CollectionId, properties: Option>> ) -> Result>; + /// Get token data. fn token_data( collection: CollectionId, token_id: TokenId, keys: Option>> ) -> Result>; + /// Total number of tokens in collection. fn total_supply(collection: CollectionId) -> Result; + + /// Get account balance for collection (sum of tokens pieces). fn account_balance(collection: CollectionId, account: CrossAccountId) -> Result; + + /// Get account balance for specified token. fn balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result; + + /// Amount of token pieces allowed to spend from granded account. fn allowance( collection: CollectionId, sender: CrossAccountId, @@ -72,14 +94,31 @@ sp_api::decl_runtime_apis! { token: TokenId, ) -> Result; + /// Get list of collection admins. fn adminlist(collection: CollectionId) -> Result>; + + /// Get list of users that allowet to mint tikens in collection. fn allowlist(collection: CollectionId) -> Result>; + + /// Check that user is in allowed list (see [`allowlist`]). fn allowed(collection: CollectionId, user: CrossAccountId) -> Result; + + /// Last minted token id. fn last_token_id(collection: CollectionId) -> Result; + + /// Get collection by id. fn collection_by_id(collection: CollectionId) -> Result>>; + + /// Get collection stats. fn collection_stats() -> Result; + + /// Get the number of blocks through which sponsorship will be available. fn next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result>; + + /// Get effective colletion limits. fn effective_collection_limits(collection_id: CollectionId) -> Result>; + + /// Get total pieces of token. fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Result>; fn token_owners(collection: CollectionId, token: TokenId) -> Result>; } From 70cdec4919d9406cc074d48a2190b7b48c2c1bda Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 28 Jul 2022 12:08:41 +0000 Subject: [PATCH 0142/1274] fmt --- primitives/data-structs/src/lib.rs | 63 +++++++++++++++--------------- primitives/rpc/src/lib.rs | 2 +- 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 7a8c6c5530..181fa05352 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . //! # Primitives crate. -//! +//! //! This crate contains amount of types, traits and constants. #![cfg_attr(not(feature = "std"), no_std)] @@ -194,7 +194,7 @@ impl EncodeLike for u32 {} impl TokenId { /// Try to get next token id. - /// + /// /// If next id cause overflow, then [`ArithmeticError::Overflow`] returned. pub fn try_next(self) -> Result { self.0 @@ -244,7 +244,7 @@ impl From for &'static str { pub type DecimalPoints = u8; /// Collection mode. -/// +/// /// Collection can represent various types of tokens. /// Each collection can contain only one type of tokens at a time. /// This type helps to understand which tokens the collection contains. @@ -358,9 +358,9 @@ pub type CollectionDescription = BoundedVec>; /// Base structure for represent collection. -/// +/// /// Used to provide basic functionality for all types of collections. -/// +/// /// #### Note /// Collection parameters, used in storage (see [`RpcCollection`] for the RPC version). #[struct_versioning::versioned(version = 2, upper)] @@ -457,7 +457,7 @@ pub struct RpcCollection { } /// Data used for create collection. -/// +/// /// All fields are wrapped in [`Option`], where `None` means chain default. #[derive(Encode, Decode, Clone, PartialEq, TypeInfo, Derivative, MaxEncodedLen)] #[derivative(Debug, Default(bound = ""))] @@ -505,7 +505,7 @@ pub type CollectionPropertiesVec = BoundedVec, /// Timeouts for transfer sponsoring. - /// + /// /// * Default /// - **Fungible** - [`FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT`] /// - **NFT** - [`NFT_SPONSOR_TRANSFER_TIMEOUT`] /// - **Refungible** - [`REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT`] /// * Limit - [`MAX_SPONSOR_TIMEOUT`]. pub sponsor_transfer_timeout: Option, - + /// Timeout for sponsoring an approval in passed blocks. - /// + /// /// * Default - [`SPONSOR_APPROVE_TIMEOUT`]. /// * Limit - [`MAX_SPONSOR_TIMEOUT`]. pub sponsor_approve_timeout: Option, /// Whether the collection owner of the collection can send tokens (which belong to other users). - /// + /// /// * Default - **false**. pub owner_can_transfer: Option, /// Can the collection owner burn other people's tokens. - /// + /// /// * Default - **true**. pub owner_can_destroy: Option, - + /// Is it possible to send tokens from this collection between users. - /// + /// /// * Default - **true**. pub transfers_enabled: Option, } @@ -643,9 +643,9 @@ impl CollectionLimits { } /// Permissions on certain operations within a collection. -/// +/// /// Some fields are wrapped in [`Option`], where `None` means chain default. -/// +/// /// Update with `pallet_common::Pallet::clamp_permissions`. #[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] @@ -653,17 +653,17 @@ impl CollectionLimits { // TODO: move `pallet_common::Pallet::clamp_permissions` into `impl CollectionPermissions`. pub struct CollectionPermissions { /// Access mode. - /// + /// /// * Default - [`AccessMode::Normal`]. pub access: Option, /// Minting allowance. - /// + /// /// * Default - **false**. pub mint_mode: Option, /// Permissions for nesting. - /// + /// /// * Default /// - `token_owner` - **false** /// - `collection_admin` - **false** @@ -744,7 +744,7 @@ pub struct NestingPermissions { } /// Enum denominating how often can sponsoring occur if it is enabled. -/// +/// /// Used for [`collection limits`](CollectionLimits). #[derive(Encode, Decode, Debug, Clone, Copy, PartialEq, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] @@ -968,7 +968,7 @@ pub type PropertyValue = BoundedBytes>; #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct PropertyPermission { /// Permission to change the property and property permission. - /// + /// /// If it **false** then you can not change corresponding property even if [`collection_admin`] and [`token_owner`] are **true**. pub mutable: bool, @@ -1031,13 +1031,13 @@ impl Into<(PropertyKey, PropertyPermission)> for PropertyKeyPermission { #[derive(Debug)] pub enum PropertiesError { /// The space allocated for properties has run out. - /// + /// /// * Limit for colection - [`MAX_COLLECTION_PROPERTIES_SIZE`]. /// * Limit for token - [`MAX_TOKEN_PROPERTIES_SIZE`]. NoSpaceForProperty, /// The property limit has been reached. - /// + /// /// * Limit - [`MAX_PROPERTIES_PER_ITEM`]. PropertyLimitReached, @@ -1045,7 +1045,7 @@ pub enum PropertiesError { InvalidCharacterInPropertyKey, /// Property key length is too long. - /// + /// /// * Limit - [`MAX_PROPERTY_KEY_LENGTH`]. PropertyKeyIsTooLong, @@ -1054,7 +1054,7 @@ pub enum PropertiesError { } /// Marker for scope of property. -/// +/// /// Scoped property can't be changed by user. Used for external collections. #[derive(Encode, Decode, MaxEncodedLen, TypeInfo, PartialEq, Clone, Copy)] pub enum PropertyScope { @@ -1088,8 +1088,7 @@ pub trait TrySetProperty: Sized { key: PropertyKey, value: Self::Value, ) -> Result<(), PropertiesError>; - - + /// Try to set property with scope from iterator. fn try_scoped_set_from_iter( &mut self, @@ -1112,7 +1111,7 @@ pub trait TrySetProperty: Sized { fn try_set(&mut self, key: PropertyKey, value: Self::Value) -> Result<(), PropertiesError> { self.try_scoped_set(PropertyScope::None, key, value) } - + /// Try to set property from iterator. fn try_set_from_iter(&mut self, iter: I) -> Result<(), PropertiesError> where @@ -1152,7 +1151,7 @@ impl PropertiesMap { pub fn contains_key(&self, key: &PropertyKey) -> bool { self.0.contains_key(key) } - + /// Check if map contains key with key validation. fn check_property_key(key: &PropertyKey) -> Result<(), PropertiesError> { if key.is_empty() { diff --git a/primitives/rpc/src/lib.rs b/primitives/rpc/src/lib.rs index 44090914e6..2039dc81b1 100644 --- a/primitives/rpc/src/lib.rs +++ b/primitives/rpc/src/lib.rs @@ -82,7 +82,7 @@ sp_api::decl_runtime_apis! { /// Get account balance for collection (sum of tokens pieces). fn account_balance(collection: CollectionId, account: CrossAccountId) -> Result; - + /// Get account balance for specified token. fn balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result; From 2f869bf11ca506c220292ef4274f574436a4fc36 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 29 Jul 2022 06:36:58 +0000 Subject: [PATCH 0143/1274] doc: fix PR --- primitives/data-structs/src/bounded.rs | 2 +- primitives/data-structs/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/primitives/data-structs/src/bounded.rs b/primitives/data-structs/src/bounded.rs index 344f814361..2049dea618 100644 --- a/primitives/data-structs/src/bounded.rs +++ b/primitives/data-structs/src/bounded.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -//! This module contins implementations for support bounded structures in [`serde`]. +//! This module contins implementations for support bounded structures ([`BoundedVec`], [`BoundedBTreeMap`], [`BoundedBTreeSet`]) in [`serde`]. use core::fmt; use sp_std::collections::{btree_map::BTreeMap, btree_set::BTreeSet}; diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 181fa05352..56fe930126 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -16,7 +16,7 @@ //! # Primitives crate. //! -//! This crate contains amount of types, traits and constants. +//! This crate contains types, traits and constants. #![cfg_attr(not(feature = "std"), no_std)] From d944b144122b70e5e48979d52744d1d086ff81d4 Mon Sep 17 00:00:00 2001 From: Andrey Date: Sun, 31 Jul 2022 16:08:48 +0000 Subject: [PATCH 0144/1274] unique-playgrounds to tests fungible, refungible and removeCollectionAdmin tests rewrited for example --- tests/src/fungible.test.ts | 207 ++- tests/src/refungible.test.ts | 351 ++--- tests/src/removeCollectionAdmin.test.ts | 125 +- tests/src/util/playgrounds/index.ts | 90 ++ tests/src/util/playgrounds/unique.ts | 1855 +++++++++++++++++++++++ 5 files changed, 2260 insertions(+), 368 deletions(-) create mode 100644 tests/src/util/playgrounds/index.ts create mode 100644 tests/src/util/playgrounds/unique.ts diff --git a/tests/src/fungible.test.ts b/tests/src/fungible.test.ts index 8fea21f045..d117469731 100644 --- a/tests/src/fungible.test.ts +++ b/tests/src/fungible.test.ts @@ -14,25 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {default as usingApi} from './substrate/substrate-api'; import {IKeyringPair} from '@polkadot/types/types'; -import { - getBalance, - createMultipleItemsExpectSuccess, - isTokenExists, - getLastTokenId, - getAllowance, - approve, - transferFrom, - createCollection, - transfer, - burnItem, - normalizeAccountId, - CrossAccountId, - createFungibleItemExpectSuccess, - U128_MAX, - burnFromExpectSuccess, -} from './util/helpers'; +import { U128_MAX } from './util/helpers'; + +import { usingPlaygrounds } from './util/playgrounds'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; @@ -44,141 +29,137 @@ let bob: IKeyringPair; describe('integration test: Fungible functionality:', () => { before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + alice = privateKey('//Alice'); + bob = privateKey('//Bob'); }); }); it('Create fungible collection and token', async () => { - await usingApi(async api => { - const createCollectionResult = await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}}); - expect(createCollectionResult.success).to.be.true; - const collectionId = createCollectionResult.collectionId; - const defaultTokenId = await getLastTokenId(api, collectionId); - const aliceTokenId = await createFungibleItemExpectSuccess(alice, collectionId, {Value: U128_MAX}, alice.address); - const aliceBalance = await getBalance(api, collectionId, alice, aliceTokenId); - const itemCountAfter = await getLastTokenId(api, collectionId); - - // What to expect - // tslint:disable-next-line:no-unused-expression - expect(itemCountAfter).to.be.equal(defaultTokenId); - expect(aliceBalance).to.be.equal(U128_MAX); + await usingPlaygrounds(async helper => { + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'trest'}); + const defaultTokenId = await collection.getLastTokenId(); + expect(defaultTokenId).to.be.equal(0); + + await collection.mint(alice, {Substrate: alice.address}, U128_MAX); + const aliceBalance = await collection.getBalance({Substrate: alice.address}); + const itemCountAfter = await collection.getLastTokenId(); + + expect(itemCountAfter).to.be.equal(defaultTokenId); + expect(aliceBalance).to.be.equal(U128_MAX); }); }); it('RPC method tokenOnewrs for fungible collection and token', async () => { - await usingApi(async (api, privateKeyWrapper) => { + await usingPlaygrounds(async (helper, privateKey) => { const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; - const facelessCrowd = Array.from(Array(7).keys()).map(i => normalizeAccountId(privateKeyWrapper(i.toString()))); + const facelessCrowd = Array(7).fill(0).map((_, i) => ({Substrate: privateKey(`//Alice+${i}`).address})); + + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + + await collection.mint(alice, {Substrate: alice.address}, U128_MAX); + + await collection.transfer(alice, {Substrate: bob.address}, 1000n); + await collection.transfer(alice, ethAcc, 900n); - const createCollectionResult = await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}}); - const collectionId = createCollectionResult.collectionId; - const aliceTokenId = await createFungibleItemExpectSuccess(alice, collectionId, {Value: U128_MAX}, alice.address); - - await transfer(api, collectionId, aliceTokenId, alice, bob, 1000n); - await transfer(api, collectionId, aliceTokenId, alice, ethAcc, 900n); - for (let i = 0; i < 7; i++) { - await transfer(api, collectionId, aliceTokenId, alice, facelessCrowd[i], 1); + await collection.transfer(alice, facelessCrowd[i], 1n); } - - const owners = await api.rpc.unique.tokenOwners(collectionId, aliceTokenId); - const ids = (owners.toJSON() as CrossAccountId[]).map(s => normalizeAccountId(s)); - const aliceID = normalizeAccountId(alice); - const bobId = normalizeAccountId(bob); + + const owners = await collection.getTop10Owners(); // What to expect - // tslint:disable-next-line:no-unused-expression - expect(ids).to.deep.include.members([aliceID, ethAcc, bobId, ...facelessCrowd]); - expect(owners.length == 10).to.be.true; + expect(owners).to.deep.include.members([{Substrate: alice.address}, ethAcc, {Substrate: bob.address}, ...facelessCrowd]); + expect(owners.length).to.be.equal(10); - const eleven = privateKeyWrapper('11'); - expect(await transfer(api, collectionId, aliceTokenId, alice, eleven, 10n)).to.be.true; - expect((await api.rpc.unique.tokenOwners(collectionId, aliceTokenId)).length).to.be.equal(10); + const eleven = privateKey('//ALice+11'); + expect(await collection.transfer(alice, {Substrate: eleven.address}, 10n)).to.be.true; + expect((await collection.getTop10Owners()).length).to.be.equal(10); }); }); it('Transfer token', async () => { - await usingApi(async api => { + await usingPlaygrounds(async helper => { const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; - const collectionId = (await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}})).collectionId; - const tokenId = await createFungibleItemExpectSuccess(alice, collectionId, {Value: 500n}, alice.address); + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + await collection.mint(alice, {Substrate: alice.address}, 500n); - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(500n); - expect(await transfer(api, collectionId, tokenId, alice, bob, 60n)).to.be.true; - expect(await transfer(api, collectionId, tokenId, alice, ethAcc, 140n)).to.be.true; + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(500n); + expect(await collection.transfer(alice, {Substrate: bob.address}, 60n)).to.be.true; + expect(await collection.transfer(alice, ethAcc, 140n)).to.be.true; - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(300n); - expect(await getBalance(api, collectionId, bob, tokenId)).to.be.equal(60n); - expect(await getBalance(api, collectionId, ethAcc, tokenId)).to.be.equal(140n); - await expect(transfer(api, collectionId, tokenId, alice, bob, 350n)).to.eventually.be.rejected; + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(300n); + expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(60n); + expect(await collection.getBalance(ethAcc)).to.be.equal(140n); + + await expect(collection.transfer(alice, {Substrate: bob.address}, 350n)).to.eventually.be.rejected; }); }); it('Tokens multiple creation', async () => { - await usingApi(async api => { - const collectionId = (await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}})).collectionId; - - const args = [ - {Fungible: {Value: 500n}}, - {Fungible: {Value: 400n}}, - {Fungible: {Value: 300n}}, - ]; - - await createMultipleItemsExpectSuccess(alice, collectionId, args); - expect(await getBalance(api, collectionId, alice, 0)).to.be.equal(1200n); - }); + await usingPlaygrounds(async helper => { + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + + await collection.mintWithOneOwner(alice, {Substrate: alice.address}, [ + {value: 500n}, + {value: 400n}, + {value: 300n} + ]); + + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(1200n); + }); }); it('Burn some tokens ', async () => { - await usingApi(async api => { - const collectionId = (await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}})).collectionId; - const tokenId = (await createFungibleItemExpectSuccess(alice, collectionId, {Value: 500n}, alice.address)); - expect(await isTokenExists(api, collectionId, tokenId)).to.be.true; - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(500n); - expect(await burnItem(api, alice, collectionId, tokenId, 499n)).to.be.true; - expect(await isTokenExists(api, collectionId, tokenId)).to.be.true; - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(1n); + await usingPlaygrounds(async helper => { + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + await collection.mint(alice, {Substrate: alice.address}, 500n); + + expect(await collection.isTokenExists(0)).to.be.true; + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(500n); + expect(await collection.burnTokens(alice, 499n)).to.be.true; + expect(await collection.isTokenExists(0)).to.be.true; + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(1n); }); }); it('Burn all tokens ', async () => { - await usingApi(async api => { - const collectionId = (await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}})).collectionId; - const tokenId = (await createFungibleItemExpectSuccess(alice, collectionId, {Value: 500n}, alice.address)); - expect(await isTokenExists(api, collectionId, tokenId)).to.be.true; - expect(await burnItem(api, alice, collectionId, tokenId, 500n)).to.be.true; - expect(await isTokenExists(api, collectionId, tokenId)).to.be.true; - - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(0n); - expect((await api.rpc.unique.totalPieces(collectionId, tokenId)).value.toBigInt()).to.be.equal(0n); + await usingPlaygrounds(async helper => { + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + await collection.mint(alice, {Substrate: alice.address}, 500n); + + expect(await collection.isTokenExists(0)).to.be.true; + expect(await collection.burnTokens(alice, 500n)).to.be.true; + expect(await collection.isTokenExists(0)).to.be.true; + + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(0n); + expect(await collection.getTotalPieces()).to.be.equal(0n); }); }); it('Set allowance for token', async () => { - await usingApi(async api => { - const collectionId = (await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}})).collectionId; + await usingPlaygrounds(async helper => { + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; - - const tokenId = (await createFungibleItemExpectSuccess(alice, collectionId, {Value: 100n}, alice.address)); - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(100n); + await collection.mint(alice, {Substrate: alice.address}, 100n); - expect(await approve(api, collectionId, tokenId, alice, bob, 60n)).to.be.true; - expect(await getAllowance(api, collectionId, alice, bob, tokenId)).to.be.equal(60n); - expect(await getBalance(api, collectionId, bob, tokenId)).to.be.equal(0n); - - expect(await transferFrom(api, collectionId, tokenId, bob, alice, bob, 20n)).to.be.true; - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(80n); - expect(await getBalance(api, collectionId, bob, tokenId)).to.be.equal(20n); - expect(await getAllowance(api, collectionId, alice, bob, tokenId)).to.be.equal(40n); + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(100n); - await burnFromExpectSuccess(bob, alice, collectionId, tokenId, 10n); - - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(70n); - expect(await getAllowance(api, collectionId, alice, bob, tokenId)).to.be.equal(30n); - expect(await transferFrom(api, collectionId, tokenId, bob, alice, ethAcc, 10n)).to.be.true; - expect(await getBalance(api, collectionId, ethAcc, tokenId)).to.be.equal(10n); + expect(await collection.approveTokens(alice, {Substrate: bob.address}, 60n)).to.be.true; + expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(60n); + expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(0n); + + expect(await collection.transferFrom(bob, {Substrate: alice.address}, {Substrate: bob.address}, 20n)).to.be.true; + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(80n); + expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(20n); + expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(40n); + + await collection.burnTokensFrom(bob, {Substrate: alice.address}, 10n); + + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(70n); + expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(30n); + expect(await collection.transferFrom(bob, {Substrate: alice.address}, ethAcc, 10n)).to.be.true; + expect(await collection.getBalance(ethAcc)).to.be.equal(10n); }); }); }); diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 527baf7f36..3aca5424b5 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -14,29 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {default as usingApi, submitTransactionAsync} from './substrate/substrate-api'; import {IKeyringPair} from '@polkadot/types/types'; -import { - createCollectionExpectSuccess, - getBalance, - createMultipleItemsExpectSuccess, - isTokenExists, - getLastTokenId, - getAllowance, - approve, - transferFrom, - createCollection, - createRefungibleToken, - transfer, - burnItem, - repartitionRFT, - createCollectionWithPropsExpectSuccess, - getDetailedCollectionInfo, - normalizeAccountId, - CrossAccountId, - getCreateItemsResult, - getDestroyItemsResult, -} from './util/helpers'; + +import { usingPlaygrounds } from './util/playgrounds'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; @@ -48,247 +28,244 @@ let bob: IKeyringPair; describe('integration test: Refungible functionality:', () => { before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + alice = privateKey('//Alice'); + bob = privateKey('//Bob'); }); }); it('Create refungible collection and token', async () => { - await usingApi(async api => { - const createCollectionResult = await createCollection(api, alice, {mode: {type: 'ReFungible'}}); - expect(createCollectionResult.success).to.be.true; - const collectionId = createCollectionResult.collectionId; - - const itemCountBefore = await getLastTokenId(api, collectionId); - const result = await createRefungibleToken(api, alice, collectionId, 100n); + await usingPlaygrounds(async helper => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + + const itemCountBefore = await collection.getLastTokenId(); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); - const itemCountAfter = await getLastTokenId(api, collectionId); + const itemCountAfter = await collection.getLastTokenId(); // What to expect - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.true; + expect(token?.tokenId).to.be.gte(itemCountBefore); expect(itemCountAfter).to.be.equal(itemCountBefore + 1); - expect(collectionId).to.be.equal(result.collectionId); - expect(itemCountAfter.toString()).to.be.equal(result.itemId.toString()); + expect(itemCountAfter.toString()).to.be.equal(token?.tokenId.toString()); }); }); it('RPC method tokenOnewrs for refungible collection and token', async () => { - await usingApi(async (api, privateKeyWrapper) => { + await usingPlaygrounds(async (helper, privateKey) => { const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; - const facelessCrowd = Array.from(Array(7).keys()).map(i => normalizeAccountId(privateKeyWrapper(i.toString()))); - - const createCollectionResult = await createCollection(api, alice, {mode: {type: 'ReFungible'}}); - const collectionId = createCollectionResult.collectionId; - - const result = await createRefungibleToken(api, alice, collectionId, 10_000n); - const aliceTokenId = result.itemId; - - - await transfer(api, collectionId, aliceTokenId, alice, bob, 1000n); - await transfer(api, collectionId, aliceTokenId, alice, ethAcc, 900n); + const facelessCrowd = Array(7).fill(0).map((_, i) => ({Substrate: privateKey(`//Alice+${i}`).address})); + + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + + const token = await collection.mintToken(alice, {Substrate: alice.address}, 10_000n); + + await token.transfer(alice, {Substrate: bob.address}, 1000n); + await token.transfer(alice, ethAcc, 900n); for (let i = 0; i < 7; i++) { - await transfer(api, collectionId, aliceTokenId, alice, facelessCrowd[i], 50*(i+1)); + await token.transfer(alice, facelessCrowd[i], 50n * BigInt(i + 1)); } - - const owners = await api.rpc.unique.tokenOwners(collectionId, aliceTokenId); - const ids = (owners.toJSON() as CrossAccountId[]).map(s => normalizeAccountId(s)); - - const aliceID = normalizeAccountId(alice); - const bobId = normalizeAccountId(bob); - + + const owners = await token.getTop10Owners(); + // What to expect - // tslint:disable-next-line:no-unused-expression - expect(ids).to.deep.include.members([aliceID, ethAcc, bobId, ...facelessCrowd]); + expect(owners).to.deep.include.members([{Substrate: alice.address}, ethAcc, {Substrate: bob.address}, ...facelessCrowd]); expect(owners.length).to.be.equal(10); - const eleven = privateKeyWrapper('11'); - expect(await transfer(api, collectionId, aliceTokenId, alice, eleven, 10n)).to.be.true; - expect((await api.rpc.unique.tokenOwners(collectionId, aliceTokenId)).length).to.be.equal(10); + const eleven = privateKey('//ALice+11'); + expect(await token.transfer(alice, {Substrate: eleven.address}, 10n)).to.be.true; + expect((await token.getTop10Owners()).length).to.be.equal(10); }); }); it('Transfer token pieces', async () => { - await usingApi(async api => { - const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; - const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n)).itemId; + await usingPlaygrounds(async helper => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(100n); - expect(await transfer(api, collectionId, tokenId, alice, bob, 60n)).to.be.true; - - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(40n); - expect(await getBalance(api, collectionId, bob, tokenId)).to.be.equal(60n); - await expect(transfer(api, collectionId, tokenId, alice, bob, 41n)).to.eventually.be.rejected; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); + expect(await token.transfer(alice, {Substrate: bob.address}, 60n)).to.be.true; + + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(40n); + expect(await token.getBalance({Substrate: bob.address})).to.be.equal(60n); + + await expect(token.transfer(alice, {Substrate: bob.address}, 41n)).to.eventually.be.rejected; }); }); it('Create multiple tokens', async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const args = [ - {ReFungible: {pieces: 1}}, - {ReFungible: {pieces: 2}}, - {ReFungible: {pieces: 100}}, - ]; - await createMultipleItemsExpectSuccess(alice, collectionId, args); - - await usingApi(async api => { - const tokenId = await getLastTokenId(api, collectionId); - expect(tokenId).to.be.equal(3); - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(100n); + await usingPlaygrounds(async helper => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + // TODO: fix mintMultipleTokens + // await collection.mintMultipleTokens(alice, [ + // {owner: {Substrate: alice.address}, pieces: 1n}, + // {owner: {Substrate: alice.address}, pieces: 2n}, + // {owner: {Substrate: alice.address}, pieces: 100n}, + // ]); + await helper.rft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, [ + {pieces: 1n}, + {pieces: 2n}, + {pieces: 100n} + ]); + const lastTokenId = await collection.getLastTokenId(); + expect(lastTokenId).to.be.equal(3); + expect(await collection.getTokenBalance(lastTokenId, {Substrate: alice.address})).to.be.equal(100n); }); }); it('Burn some pieces', async () => { - await usingApi(async api => { - const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; - const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n)).itemId; - expect(await isTokenExists(api, collectionId, tokenId)).to.be.true; - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(100n); - expect(await burnItem(api, alice, collectionId, tokenId, 99n)).to.be.true; - expect(await isTokenExists(api, collectionId, tokenId)).to.be.true; - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(1n); + await usingPlaygrounds(async helper => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + expect(await collection.isTokenExists(token.tokenId)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); + expect((await token.burn(alice, 99n)).success).to.be.true; + expect(await collection.isTokenExists(token.tokenId)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(1n); }); }); it('Burn all pieces', async () => { - await usingApi(async api => { - const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; - const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n)).itemId; - expect(await isTokenExists(api, collectionId, tokenId)).to.be.true; - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(100n); - expect(await burnItem(api, alice, collectionId, tokenId, 100n)).to.be.true; - expect(await isTokenExists(api, collectionId, tokenId)).to.be.false; + await usingPlaygrounds(async helper => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + + expect(await collection.isTokenExists(token.tokenId)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); + + expect((await token.burn(alice, 100n)).success).to.be.true; + expect(await collection.isTokenExists(token.tokenId)).to.be.false; }); }); it('Burn some pieces for multiple users', async () => { - await usingApi(async api => { - const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; - const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n)).itemId; - expect(await isTokenExists(api, collectionId, tokenId)).to.be.true; - - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(100n); - expect(await transfer(api, collectionId, tokenId, alice, bob, 60n)).to.be.true; + await usingPlaygrounds(async helper => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + expect(await collection.isTokenExists(token.tokenId)).to.be.true; - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(40n); - expect(await getBalance(api, collectionId, bob, tokenId)).to.be.equal(60n); - expect(await burnItem(api, alice, collectionId, tokenId, 40n)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); + expect(await token.transfer(alice, {Substrate: bob.address}, 60n)).to.be.true; - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(0n); - expect(await isTokenExists(api, collectionId, tokenId)).to.be.true; - expect(await burnItem(api, bob, collectionId, tokenId, 59n)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(40n); + expect(await token.getBalance({Substrate: bob.address})).to.be.equal(60n); - expect(await getBalance(api, collectionId, bob, tokenId)).to.be.equal(1n); - expect(await isTokenExists(api, collectionId, tokenId)).to.be.true; - expect(await burnItem(api, bob, collectionId, tokenId, 1n)).to.be.true; - - expect(await isTokenExists(api, collectionId, tokenId)).to.be.false; + expect((await token.burn(alice, 40n)).success).to.be.true; + + expect(await collection.isTokenExists(token.tokenId)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(0n); + + expect((await token.burn(bob, 59n)).success).to.be.true; + + expect(await token.getBalance({Substrate: bob.address})).to.be.equal(1n); + expect(await collection.isTokenExists(token.tokenId)).to.be.true; + + expect((await token.burn(bob, 1n)).success).to.be.true; + + expect(await collection.isTokenExists(token.tokenId)).to.be.false; }); }); it('Set allowance for token', async () => { - await usingApi(async api => { - const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; - const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n)).itemId; - - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(100n); + await usingPlaygrounds(async helper => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); - expect(await approve(api, collectionId, tokenId, alice, bob, 60n)).to.be.true; - expect(await getAllowance(api, collectionId, alice, bob, tokenId)).to.be.equal(60n); + expect(await token.approve(alice, {Substrate: bob.address}, 60n)).to.be.true; + expect(await token.getApprovedPieces({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(60n); - expect(await transferFrom(api, collectionId, tokenId, bob, alice, bob, 20n)).to.be.true; - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(80n); - expect(await getBalance(api, collectionId, bob, tokenId)).to.be.equal(20n); - expect(await getAllowance(api, collectionId, alice, bob, tokenId)).to.be.equal(40n); + expect(await token.transferFrom(bob, {Substrate: alice.address}, {Substrate: bob.address}, 20n)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(80n); + expect(await token.getBalance({Substrate: bob.address})).to.be.equal(20n); + expect(await token.getApprovedPieces({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(40n); }); }); it('Repartition', async () => { - await usingApi(async api => { - const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; - const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n)).itemId; - - expect(await repartitionRFT(api, collectionId, alice, tokenId, 200n)).to.be.true; - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(200n); + await usingPlaygrounds(async helper => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); - expect(await transfer(api, collectionId, tokenId, alice, bob, 110n)).to.be.true; - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(90n); - expect(await getBalance(api, collectionId, bob, tokenId)).to.be.equal(110n); - - await expect(repartitionRFT(api, collectionId, alice, tokenId, 80n)).to.eventually.be.rejected; + expect(await token.repartition(alice, 200n)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(200n); + expect(await token.getTotalPieces()).to.be.equal(200n); + + expect(await token.transfer(alice, {Substrate: bob.address}, 110n)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(90n); + expect(await token.getBalance({Substrate: bob.address})).to.be.equal(110n); + + await expect(token.repartition(alice, 80n)).to.eventually.be.rejected; + + expect(await token.transfer(alice, {Substrate: bob.address}, 90n)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(0n); + expect(await token.getBalance({Substrate: bob.address})).to.be.equal(200n); - expect(await transfer(api, collectionId, tokenId, alice, bob, 90n)).to.be.true; - expect(await getBalance(api, collectionId, alice, tokenId)).to.be.equal(0n); - expect(await getBalance(api, collectionId, bob, tokenId)).to.be.equal(200n); + expect(await token.repartition(bob, 150n)).to.be.true; + await expect(token.transfer(bob, {Substrate: alice.address}, 160n)).to.eventually.be.rejected; - expect(await repartitionRFT(api, collectionId, bob, tokenId, 150n)).to.be.true; - await expect(transfer(api, collectionId, tokenId, bob, alice, 160n)).to.eventually.be.rejected; }); }); it('Repartition with increased amount', async () => { - await usingApi(async api => { - const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; - const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n)).itemId; - - const tx = api.tx.unique.repartition(collectionId, tokenId, 200n); - const events = await submitTransactionAsync(alice, tx); - const substrateEvents = getCreateItemsResult(events); - expect(substrateEvents).to.include.deep.members([ - { - success: true, - collectionId, - itemId: tokenId, - recipient: {Substrate: alice.address}, - amount: 100, - }, - ]); + await usingPlaygrounds(async helper => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + await token.repartition(alice, 200n); + const chainEvents = helper.chainLog.slice(-1)[0].events.map((x: any) => x.event); + expect(chainEvents).to.include.deep.members([{ + method: 'ItemCreated', + section: 'common', + index: '0x4202', + data: [ + collection.collectionId.toString(), + token.tokenId.toString(), + {Substrate: alice.address}, + '100' + ] + }]) }); }); it('Repartition with decreased amount', async () => { - await usingApi(async api => { - const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; - const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n)).itemId; - - const tx = api.tx.unique.repartition(collectionId, tokenId, 50n); - const events = await submitTransactionAsync(alice, tx); - const substrateEvents = getDestroyItemsResult(events); - expect(substrateEvents).to.include.deep.members([ - { - success: true, - collectionId, - itemId: tokenId, - owner: {Substrate: alice.address}, - amount: 50, - }, - ]); + await usingPlaygrounds(async helper => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + await token.repartition(alice, 50n); + const chainEvents = helper.chainLog.slice(-1)[0].events.map((x: any) => x.event); + expect(chainEvents).to.include.deep.members([{ + method: 'ItemDestroyed', + section: 'common', + index: '0x4203', + data: [ + collection.collectionId.toString(), + token.tokenId.toString(), + {Substrate: alice.address}, + '50' + ] + }]) }); }); }); describe('Test Refungible properties:', () => { before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + alice = privateKey('//Alice'); + bob = privateKey('//Bob'); }); }); it('Сreate new collection with properties', async () => { - await usingApi(async api => { + await usingPlaygrounds(async helper => { const properties = [{key: 'key1', value: 'val1'}]; - const propertyPermissions = [{key: 'key1', permission: {tokenOwner: true, mutable: false, collectionAdmin: true}}]; - const collectionId = await createCollectionWithPropsExpectSuccess({name: 'A', description: 'B', tokenPrefix: 'C', mode: {type: 'ReFungible'}, - properties: properties, - propPerm: propertyPermissions, - }); - const collection = (await getDetailedCollectionInfo(api, collectionId))!; - expect(collection.properties.toHuman()).to.be.deep.equal(properties); - expect(collection.tokenPropertyPermissions.toHuman()).to.be.deep.equal(propertyPermissions); + const tokenPropertyPermissions = [{key: 'key1', permission: {tokenOwner: true, mutable: false, collectionAdmin: true}}]; + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test', properties, tokenPropertyPermissions}); + const info = await collection.getData(); + expect(info?.raw.properties).to.be.deep.equal(properties); + expect(info?.raw.tokenPropertyPermissions).to.be.deep.equal(tokenPropertyPermissions); }); }); }); diff --git a/tests/src/removeCollectionAdmin.test.ts b/tests/src/removeCollectionAdmin.test.ts index 03bf7ed04f..5d0eb85d85 100644 --- a/tests/src/removeCollectionAdmin.test.ts +++ b/tests/src/removeCollectionAdmin.test.ts @@ -16,123 +16,112 @@ import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api'; -import {createCollectionExpectSuccess, destroyCollectionExpectSuccess, getAdminList, normalizeAccountId, queryCollectionExpectSuccess} from './util/helpers'; +import { usingPlaygrounds } from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; describe('Integration Test removeCollectionAdmin(collection_id, account_id):', () => { it('Remove collection admin.', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess(); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const collection = await queryCollectionExpectSuccess(api, collectionId); - expect(collection.owner.toString()).to.be.deep.eq(alice.address); + await usingPlaygrounds(async (helper, privateKey) => { + const alice = privateKey('//Alice'); + const bob = privateKey('//Bob'); + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const collectionInfo = await collection.getData(); + expect(collectionInfo?.raw.owner.toString()).to.be.deep.eq(alice.address); // first - add collection admin Bob - const addAdminTx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(bob.address)); - await submitTransactionAsync(alice, addAdminTx); + await collection.addAdmin(alice, {Substrate: bob.address}); - const adminListAfterAddAdmin = await getAdminList(api, collectionId); - expect(adminListAfterAddAdmin).to.be.deep.contains(normalizeAccountId(bob.address)); + const adminListAfterAddAdmin = await collection.getAdmins(); + expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: helper.address.normalizeSubstrate(bob.address)}); // then remove bob from admins of collection - const removeAdminTx = api.tx.unique.removeCollectionAdmin(collectionId, normalizeAccountId(bob.address)); - await submitTransactionAsync(alice, removeAdminTx); + await collection.removeAdmin(alice, {Substrate: bob.address}); - const adminListAfterRemoveAdmin = await getAdminList(api, collectionId); - expect(adminListAfterRemoveAdmin).not.to.be.deep.contains(normalizeAccountId(bob.address)); + const adminListAfterRemoveAdmin = await collection.getAdmins(); + expect(adminListAfterRemoveAdmin).not.to.be.deep.contains({Substrate: helper.address.normalizeSubstrate(bob.address)}); }); }); it('Remove admin from collection that has no admins', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const collectionId = await createCollectionExpectSuccess(); + await usingPlaygrounds(async (helper, privateKey) => { + const alice = privateKey('//Alice'); + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const adminListBeforeAddAdmin = await getAdminList(api, collectionId); + const adminListBeforeAddAdmin = await collection.getAdmins(); expect(adminListBeforeAddAdmin).to.have.lengthOf(0); - const tx = api.tx.unique.removeCollectionAdmin(collectionId, normalizeAccountId(alice.address)); - await submitTransactionAsync(alice, tx); + // await expect(collection.removeAdmin(alice, {Substrate: alice.address})).to.be.rejectedWith('Unable to remove collection admin'); + await collection.removeAdmin(alice, {Substrate: alice.address}); }); }); }); describe('Negative Integration Test removeCollectionAdmin(collection_id, account_id):', () => { it('Can\'t remove collection admin from not existing collection', async () => { - await usingApi(async (api, privateKeyWrapper) => { + await usingPlaygrounds(async (helper, privateKey) => { // tslint:disable-next-line: no-bitwise const collectionId = (1 << 32) - 1; - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); + const alice = privateKey('//Alice'); + const bob = privateKey('//Bob'); - const changeOwnerTx = api.tx.unique.removeCollectionAdmin(collectionId, normalizeAccountId(bob.address)); - await expect(submitTransactionExpectFailAsync(alice, changeOwnerTx)).to.be.rejected; + await expect(helper.collection.removeAdmin(alice, collectionId, {Substrate: bob.address})).to.be.rejected; // Verifying that nothing bad happened (network is live, new collections can be created, etc.) - await createCollectionExpectSuccess(); + await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); }); }); it('Can\'t remove collection admin from deleted collection', async () => { - await usingApi(async (api, privateKeyWrapper) => { - // tslint:disable-next-line: no-bitwise - const collectionId = await createCollectionExpectSuccess(); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const alice = privateKey('//Alice'); + const bob = privateKey('//Bob'); + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - await destroyCollectionExpectSuccess(collectionId); + expect(await collection.burn(alice)).to.be.true; - const changeOwnerTx = api.tx.unique.removeCollectionAdmin(collectionId, normalizeAccountId(bob.address)); - await expect(submitTransactionExpectFailAsync(alice, changeOwnerTx)).to.be.rejected; + await expect(helper.collection.removeAdmin(alice, collection.collectionId, {Substrate: bob.address})).to.be.rejected; // Verifying that nothing bad happened (network is live, new collections can be created, etc.) - await createCollectionExpectSuccess(); + await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); }); }); it('Regular user can\'t remove collection admin', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess(); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper, privateKey) => { + const alice = privateKey('//Alice'); + const bob = privateKey('//Bob'); + const charlie = privateKey('//Charlie'); + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const addAdminTx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(bob.address)); - await submitTransactionAsync(alice, addAdminTx); + await collection.addAdmin(alice, {Substrate: bob.address}); - const changeOwnerTx = api.tx.unique.removeCollectionAdmin(collectionId, normalizeAccountId(bob.address)); - await expect(submitTransactionExpectFailAsync(charlie, changeOwnerTx)).to.be.rejected; + await expect(collection.removeAdmin(charlie, {Substrate: bob.address})).to.be.rejected; // Verifying that nothing bad happened (network is live, new collections can be created, etc.) - await createCollectionExpectSuccess(); + await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); }); }); it('Admin can\'t remove collection admin.', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess(); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - - const addBobAdminTx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(bob.address)); - await submitTransactionAsync(alice, addBobAdminTx); - const addCharlieAdminTx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(charlie.address)); - await submitTransactionAsync(alice, addCharlieAdminTx); - - const adminListAfterAddAdmin = await getAdminList(api, collectionId); - expect(adminListAfterAddAdmin).to.be.deep.contains(normalizeAccountId(bob.address)); - expect(adminListAfterAddAdmin).to.be.deep.contains(normalizeAccountId(charlie.address)); - - const removeAdminTx = api.tx.unique.removeCollectionAdmin(collectionId, normalizeAccountId(bob.address)); - await expect(submitTransactionExpectFailAsync(charlie, removeAdminTx)).to.be.rejected; - - const adminListAfterRemoveAdmin = await getAdminList(api, collectionId); - expect(adminListAfterRemoveAdmin).to.be.deep.contains(normalizeAccountId(bob.address)); - expect(adminListAfterRemoveAdmin).to.be.deep.contains(normalizeAccountId(charlie.address)); + await usingPlaygrounds(async (helper, privateKey) => { + const alice = privateKey('//Alice'); + const bob = privateKey('//Bob'); + const charlie = privateKey('//Charlie'); + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + + await collection.addAdmin(alice, {Substrate: bob.address}); + await collection.addAdmin(alice, {Substrate: charlie.address}); + + const adminListAfterAddAdmin = await collection.getAdmins(); + expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: helper.address.normalizeSubstrate(bob.address)}); + expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: helper.address.normalizeSubstrate(charlie.address)}); + + await expect(collection.removeAdmin(charlie, {Substrate: bob.address})).to.be.rejected; + + const adminListAfterRemoveAdmin = await collection.getAdmins(); + expect(adminListAfterRemoveAdmin).to.be.deep.contains({Substrate: helper.address.normalizeSubstrate(bob.address)}); + expect(adminListAfterRemoveAdmin).to.be.deep.contains({Substrate: helper.address.normalizeSubstrate(charlie.address)}); }); }); }); diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts new file mode 100644 index 0000000000..5e93b902da --- /dev/null +++ b/tests/src/util/playgrounds/index.ts @@ -0,0 +1,90 @@ +import { IKeyringPair } from '@polkadot/types/types'; +import { UniqueHelper } from './unique'; +import config from '../../config'; +import '../../interfaces/augment-api-events'; +import * as defs from '../../interfaces/definitions'; +import { ApiPromise, WsProvider } from '@polkadot/api'; + + +class SilentLogger { + log(msg: any, level: any): void {} + level = { + ERROR: 'ERROR' as 'ERROR', + WARNING: 'WARNING' as 'WARNING', + INFO: 'INFO' as 'INFO' + } +} + + +class DevUniqueHelper extends UniqueHelper { + async connect(wsEndpoint: string, listeners?: any): Promise { + const wsProvider = new WsProvider(wsEndpoint); + this.api = new ApiPromise({ + provider: wsProvider, + signedExtensions: { + ContractHelpers: { + extrinsic: {}, + payload: {}, + }, + FakeTransactionFinalizer: { + extrinsic: {}, + payload: {}, + }, + }, + rpc: { + unique: defs.unique.rpc, + rmrk: defs.rmrk.rpc, + eth: { + feeHistory: { + description: 'Dummy', + params: [], + type: 'u8', + }, + maxPriorityFeePerGas: { + description: 'Dummy', + params: [], + type: 'u8', + }, + }, + }, + }); + await this.api.isReadyOrError; + this.network = await UniqueHelper.detectNetwork(this.api); + } +} + +export const usingPlaygrounds = async (code: (helper: UniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { + // TODO: Remove, this is temporary: Filter unneeded API output + // (Jaco promised it will be removed in the next version) + const consoleErr = console.error; + const consoleLog = console.log; + const consoleWarn = console.warn; + + const outFn = (printer: any) => (...args: any[]) => { + for (const arg of args) { + if (typeof arg !== 'string') + continue; + if (arg.includes('1000:: Normal connection closure' || arg === 'Normal connection closure')) + return; + } + printer(...args); + }; + + console.error = outFn(consoleErr.bind(console)); + console.log = outFn(consoleLog.bind(console)); + console.warn = outFn(consoleWarn.bind(console)); + const helper = new DevUniqueHelper(new SilentLogger()); + + try { + await helper.connect(config.substrateUrl); + const ss58Format = helper.chain.getChainProperties().ss58Format; + const privateKey = (seed: string) => helper.util.fromSeed(seed, ss58Format); + await code(helper, privateKey); + } + finally { + await helper.disconnect(); + console.error = consoleErr; + console.log = consoleLog; + console.warn = consoleWarn; + } +} \ No newline at end of file diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts new file mode 100644 index 0000000000..71bdccca79 --- /dev/null +++ b/tests/src/util/playgrounds/unique.ts @@ -0,0 +1,1855 @@ + +import { ApiPromise, WsProvider, Keyring } from '@polkadot/api'; +import { ApiInterfaceEvents } from '@polkadot/api/types'; +import { IKeyringPair } from '@polkadot/types/types'; +import { encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm } from '@polkadot/util-crypto'; + + +const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => { + let address = {} as ICrossAccountId; + if(lowerAddress.substrate) address.Substrate = lowerAddress.substrate; + if(lowerAddress.ethereum) address.Ethereum = lowerAddress.ethereum; + return address; +} + + +const nesting = { + toChecksumAddress(address: string): string { + if (typeof address === 'undefined') return ''; + + if(!/^(0x)?[0-9a-f]{40}$/i.test(address)) throw new Error(`Given address "${address}" is not a valid Ethereum address.`); + + address = address.toLowerCase().replace(/^0x/i,''); + const addressHash = keccakAsHex(address).replace(/^0x/i,''); + let checksumAddress = ['0x']; + + for (let i = 0; i < address.length; i++ ) { + // If ith character is 8 to f then make it uppercase + if (parseInt(addressHash[i], 16) > 7) { + checksumAddress.push(address[i].toUpperCase()); + } else { + checksumAddress.push(address[i]); + } + } + return checksumAddress.join(''); + }, + tokenIdToAddress(collectionId: number, tokenId: number) { + return this.toChecksumAddress( + `0xf8238ccfff8ed887463fd5e0${collectionId.toString(16).padStart(8, '0')}${tokenId.toString(16).padStart(8, '0')}` + ); + } +}; + + +interface IChainEvent { + data: any; + method: string; + section: string; +} + +interface ITransactionResult { + status: 'Fail' | 'Success'; + result: { + events: { + event: IChainEvent + }[]; + }, + moduleError?: string; +} + +interface ILogger { + log: (msg: any, level?: string) => void; + level: { + ERROR: 'ERROR'; + WARNING: 'WARNING'; + INFO: 'INFO'; + [key: string]: string; + } +} + +interface IUniqueHelperLog { + executedAt: number; + executionTime: number; + type: 'extrinsic' | 'rpc'; + status: 'Fail' | 'Success'; + call: string; + params: any[]; + moduleError?: string; + events?: any; +} + +interface IApiListeners { + connected?: (...args: any[]) => any; + disconnected?: (...args: any[]) => any; + error?: (...args: any[]) => any; + ready?: (...args: any[]) => any; + decorated?: (...args: any[]) => any; +} + +interface ICrossAccountId { + Substrate?: TSubstrateAccount; + Ethereum?: TEthereumAccount; +} + +interface ICrossAccountIdLower { + substrate?: TSubstrateAccount; + ethereum?: TEthereumAccount; +} + +interface ICollectionLimits { + accountTokenOwnershipLimit?: number | null; + sponsoredDataSize?: number | null; + sponsoredDataRateLimit?: {blocks: number} | {sponsoringDisabled: null} | null; + tokenLimit?: number | null; + sponsorTransferTimeout?: number | null; + sponsorApproveTimeout?: number | null; + ownerCanTransfer?: boolean | null; + ownerCanDestroy?: boolean | null; + transfersEnabled?: boolean | null; +} + +interface INestingPermissions { + tokenOwner?: boolean; + collectionAdmin?: boolean; + restricted?: number[] | null; +} + +interface ICollectionPermissions { + access?: 'Normal' | 'AllowList'; + mintMode?: boolean; + nesting?: INestingPermissions; +} + +interface IProperty { + key: string; + value: string; +} + +interface ITokenPropertyPermission { + key: string; + permission: { + mutable: boolean; + tokenOwner: boolean; + collectionAdmin: boolean; + } +} + +interface IToken { + collectionId: number; + tokenId: number; +} + +interface ICollectionCreationOptions { + name: string | number[]; + description: string | number[]; + tokenPrefix: string | number[]; + mode?: { + nft?: null; + refungible?: null; + fungible?: number; + } + permissions?: ICollectionPermissions; + properties?: IProperty[]; + tokenPropertyPermissions?: ITokenPropertyPermission[]; + limits?: ICollectionLimits; + pendingSponsor?: TSubstrateAccount; +} + +interface IChainProperties { + ss58Format: number; + tokenDecimals: number[]; + tokenSymbol: string[] +} + +type TSubstrateAccount = string; +type TEthereumAccount = string; +type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated'; +type TUniqueNetworks = 'opal' | 'quartz' | 'unique'; +type TSigner = IKeyringPair; // | 'string' + +class UniqueUtil { + static transactionStatus = { + NOT_READY: 'NotReady', + FAIL: 'Fail', + SUCCESS: 'Success' + } + + static chainLogType = { + EXTRINSIC: 'extrinsic', + RPC: 'rpc' + } + + static getNestingTokenAddress(collectionId: number, tokenId: number) { + return nesting.tokenIdToAddress(collectionId, tokenId); + } + + static getDefaultLogger(): ILogger { + return { + log(msg: any, level = 'INFO') { + console[level.toLocaleLowerCase() === 'error' ? 'error' : 'log'](...(Array.isArray(msg) ? msg : [msg])); + }, + level: { + ERROR: 'ERROR', + WARNING: 'WARNING', + INFO: 'INFO' + } + }; + } + + static vec2str(arr: string[] | number[]) { + return arr.map(x => String.fromCharCode(parseInt(x.toString()))).join(''); + } + + static str2vec(string: string) { + if (typeof string !== 'string') return string; + return Array.from(string).map(x => x.charCodeAt(0)); + } + + static fromSeed(seed: string, ss58Format = 42) { + const keyring = new Keyring({type: 'sr25519', ss58Format}); + return keyring.addFromUri(seed); + } + + static normalizeSubstrateAddress(address: string, ss58Format = 42) { + return encodeAddress(decodeAddress(address), ss58Format); + } + + static extractCollectionIdFromCreationResult(creationResult: ITransactionResult, label = 'new collection') { + if (creationResult.status !== this.transactionStatus.SUCCESS) { + throw Error(`Unable to create collection for ${label}`); + } + + let collectionId = null; + creationResult.result.events.forEach(({event: {data, method, section}}) => { + if ((section === 'common') && (method === 'CollectionCreated')) { + collectionId = parseInt(data[0].toString(), 10); + } + }); + + if (collectionId === null) { + throw Error(`No CollectionCreated event for ${label}`) + } + + return collectionId; + } + + static extractTokensFromCreationResult(creationResult: ITransactionResult, label = 'new tokens') { + if (creationResult.status !== this.transactionStatus.SUCCESS) { + throw Error(`Unable to create tokens for ${label}`); + } + let success = false, tokens = [] as any; + creationResult.result.events.forEach(({event: {data, method, section}}) => { + if (method === 'ExtrinsicSuccess') { + success = true; + } else if ((section === 'common') && (method === 'ItemCreated')) { + tokens.push({ + collectionId: parseInt(data[0].toString(), 10), + tokenId: parseInt(data[1].toString(), 10), + owner: data[2].toJSON() + }); + } + }); + return {success, tokens}; + } + + static extractTokensFromBurnResult(burnResult: ITransactionResult, label = 'burned tokens') { + if (burnResult.status !== this.transactionStatus.SUCCESS) { + throw Error(`Unable to burn tokens for ${label}`); + } + let success = false, tokens = [] as any; + burnResult.result.events.forEach(({event: {data, method, section}}) => { + if (method === 'ExtrinsicSuccess') { + success = true; + } else if ((section === 'common') && (method === 'ItemDestroyed')) { + tokens.push({ + collectionId: parseInt(data[0].toString(), 10), + tokenId: parseInt(data[1].toString(), 10), + owner: data[2].toJSON() + }); + } + }); + return {success, tokens}; + } + + static findCollectionInEvents(events: {event: IChainEvent}[], collectionId: number, expectedSection: string, expectedMethod: string, label?: string) { + let eventId = null; + events.forEach(({event: {data, method, section}}) => { + if ((section === expectedSection) && (method === expectedMethod)) { + eventId = parseInt(data[0].toString(), 10); + } + }); + + if (eventId === null) { + throw Error(`No ${expectedMethod} event for ${label}`); + } + return eventId === collectionId; + } + + static isTokenTransferSuccess(events: {event: IChainEvent}[], collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) { + const normalizeAddress = (address: string | ICrossAccountId) => { + if(typeof address === 'string') return address; + let obj = {} as any; + Object.keys(address).forEach(k => { + obj[k.toLocaleLowerCase()] = address[k as 'Substrate' | 'Ethereum']; + }); + if(obj.substrate) return {Substrate: this.normalizeSubstrateAddress(obj.substrate)}; + if(obj.ethereum) return {Ethereum: obj.ethereum.toLocaleLowerCase()}; + return address; + } + let transfer = {collectionId: null, tokenId: null, from: null, to: null, amount: 1} as any; + events.forEach(({event: {data, method, section}}) => { + if ((section === 'common') && (method === 'Transfer')) { + let hData = (data as any).toJSON(); + transfer = { + collectionId: hData[0], + tokenId: hData[1], + from: normalizeAddress(hData[2]), + to: normalizeAddress(hData[3]), + amount: BigInt(hData[4]) + }; + } + }); + let isSuccess = parseInt(collectionId.toString()) === transfer.collectionId && parseInt(tokenId.toString()) === transfer.tokenId; + isSuccess = isSuccess && JSON.stringify(normalizeAddress(fromAddressObj)) === JSON.stringify(transfer.from); + isSuccess = isSuccess && JSON.stringify(normalizeAddress(toAddressObj)) === JSON.stringify(transfer.to); + isSuccess = isSuccess && amount === transfer.amount; + return isSuccess; + } +} + + +class ChainHelperBase { + transactionStatus = UniqueUtil.transactionStatus; + chainLogType = UniqueUtil.chainLogType; + util: typeof UniqueUtil; + logger: ILogger; + api: ApiPromise | null; + forcedNetwork: TUniqueNetworks | null; + network: TUniqueNetworks | null; + chainLog: IUniqueHelperLog[]; + + constructor(logger?: ILogger) { + this.util = UniqueUtil; + if (typeof logger == 'undefined') logger = this.util.getDefaultLogger(); + this.logger = logger; + this.api = null; + this.forcedNetwork = null; + this.network = null; + this.chainLog = []; + } + + clearChainLog(): void { + this.chainLog = []; + } + + forceNetwork(value: TUniqueNetworks): void { + this.forcedNetwork = value; + } + + async connect(wsEndpoint: string, listeners?: IApiListeners) { + if (this.api !== null) throw Error('Already connected'); + const { api, network } = await ChainHelperBase.createConnection(wsEndpoint, listeners, this.forcedNetwork); + this.api = api; + this.network = network; + } + + async disconnect() { + if (this.api === null) return; + await this.api.disconnect(); + this.api = null; + this.network = null; + } + + static async detectNetwork(api: ApiPromise): Promise { + let spec = (await api.query.system.lastRuntimeUpgrade()).toJSON() as any; + if(['quartz', 'unique'].indexOf(spec.specName) > -1) return spec.specName; + return 'opal'; + } + + static async detectNetworkByWsEndpoint(wsEndpoint: string): Promise { + let api = new ApiPromise({provider: new WsProvider(wsEndpoint)}); + await api.isReady; + + const network = await this.detectNetwork(api); + + await api.disconnect(); + + return network; + } + + static async createConnection(wsEndpoint: string, listeners?: IApiListeners, network?: TUniqueNetworks | null): Promise<{ + api: ApiPromise; + network: TUniqueNetworks; + }> { + if(typeof network === 'undefined' || network === null) network = 'opal'; + const supportedRPC = { + opal: { + unique: require('@unique-nft/opal-testnet-types/definitions').unique.rpc + }, + quartz: { + unique: require('@unique-nft/quartz-mainnet-types/definitions').unique.rpc + }, + unique: { + unique: require('@unique-nft/unique-mainnet-types/definitions').unique.rpc + } + } + if(!supportedRPC.hasOwnProperty(network)) network = await this.detectNetworkByWsEndpoint(wsEndpoint); + const rpc = supportedRPC[network]; + + // TODO: investigate how to replace rpc in runtime + // api._rpcCore.addUserInterfaces(rpc); + + const api = new ApiPromise({provider: new WsProvider(wsEndpoint), rpc}); + + await api.isReadyOrError; + + if (typeof listeners === 'undefined') listeners = {}; + for (let event of ['connected', 'disconnected', 'error', 'ready', 'decorated']) { + if (!listeners.hasOwnProperty(event) || typeof listeners[event as TApiAllowedListeners] === 'undefined') continue; + api.on(event as ApiInterfaceEvents, listeners[event as TApiAllowedListeners] as (...args: any[]) => any); + } + + return {api, network}; + } + + getTransactionStatus(data: {events: {event: IChainEvent}[], status: any}) { + const {events, status} = data; + if (status.isReady) { + return this.transactionStatus.NOT_READY; + } + if (status.isBroadcast) { + return this.transactionStatus.NOT_READY; + } + if (status.isInBlock || status.isFinalized) { + const errors = events.filter(e => e.event.data.method === 'ExtrinsicFailed'); + if (errors.length > 0) { + return this.transactionStatus.FAIL; + } + if (events.filter(e => e.event.data.method === 'ExtrinsicSuccess').length > 0) { + return this.transactionStatus.SUCCESS; + } + } + + return this.transactionStatus.FAIL; + } + + signTransaction(sender: TSigner, transaction: any, label = 'transaction', options = null) { + const sign = (callback: any) => { + if(options !== null) return transaction.signAndSend(sender, options, callback); + return transaction.signAndSend(sender, callback); + } + return new Promise(async (resolve, reject) => { + try { + let unsub = await sign((result: any) => { + const status = this.getTransactionStatus(result); + + if (status === this.transactionStatus.SUCCESS) { + this.logger.log(`${label} successful`); + unsub(); + resolve({result, status}); + } else if (status === this.transactionStatus.FAIL) { + let moduleError = null; + + if (result.hasOwnProperty('dispatchError')) { + const dispatchError = result['dispatchError']; + + if (dispatchError && dispatchError.isModule) { + const modErr = dispatchError.asModule; + const errorMeta = dispatchError.registry.findMetaError(modErr); + + moduleError = `${errorMeta.section}.${errorMeta.name}`; + } + else { + this.logger.log(result, this.logger.level.ERROR); + } + } + + this.logger.log(`Something went wrong with ${label}. Status: ${status}`, this.logger.level.ERROR); + unsub(); + reject({status, moduleError, result}); + } + }); + } catch (e) { + this.logger.log(e, this.logger.level.ERROR); + reject(e); + } + }); + } + + constructApiCall(apiCall: string, params: any[]) { + if(!apiCall.startsWith('api.')) throw Error(`Invalid api call: ${apiCall}`); + let call = this.api as any; + for(let part of apiCall.slice(4).split('.')) { + call = call[part]; + } + return call(...params); + } + + async executeExtrinsic(sender: TSigner, extrinsic: string, params: any[], expectSuccess=false, failureMessage='expected success') { + if(this.api === null) throw Error('API not initialized'); + if(!extrinsic.startsWith('api.tx.')) throw Error(`${extrinsic} is not transaction`); + + const startTime = (new Date()).getTime(); + let result: ITransactionResult; + let events = []; + try { + result = await this.signTransaction(sender, this.constructApiCall(extrinsic, params), extrinsic) as ITransactionResult; + events = result.result.events.map((x: any) => x.toHuman()); + } + catch(e) { + if(!(e as object).hasOwnProperty('status')) throw e; + result = e as ITransactionResult; + } + + const endTime = (new Date()).getTime(); + + let log = { + executedAt: endTime, + executionTime: endTime - startTime, + type: this.chainLogType.EXTRINSIC, + status: result.status, + call: extrinsic, + params + } as IUniqueHelperLog; + + if(result.status !== this.transactionStatus.SUCCESS && result.moduleError) log.moduleError = result.moduleError; + if(events.length > 0) log.events = events; + + this.chainLog.push(log); + + if(expectSuccess && result.status !== this.transactionStatus.SUCCESS) throw Error(failureMessage); + return result; + } + + async callRpc(rpc: string, params?: any[]) { + if(typeof params === 'undefined') params = []; + if(this.api === null) throw Error('API not initialized'); + if(!rpc.startsWith('api.rpc.') && !rpc.startsWith('api.query.')) throw Error(`${rpc} is not RPC call`); + + const startTime = (new Date()).getTime(); + let result, log = { + type: this.chainLogType.RPC, + call: rpc, + params + } as IUniqueHelperLog, error = null; + + try { + result = await this.constructApiCall(rpc, params); + } + catch(e) { + error = e; + } + + const endTime = (new Date()).getTime(); + + log.executedAt = endTime; + log.status = (error === null ? this.transactionStatus.SUCCESS : this.transactionStatus.FAIL) as 'Fail' | 'Success'; + log.executionTime = endTime - startTime; + + this.chainLog.push(log); + + if(error !== null) throw error; + + return result; + } + + getSignerAddress(signer: IKeyringPair | string): string { + if(typeof signer === 'string') return signer; + return signer.address; + } +} + + +class HelperGroup { + helper: UniqueHelper; + + constructor(uniqueHelper: UniqueHelper) { + this.helper = uniqueHelper; + } +} + + +class CollectionGroup extends HelperGroup { + /** + * Get number of blocks when sponsored transaction is available. + * + * @param collectionId ID of collection + * @param tokenId ID of token + * @param addressObj + * @returns number of blocks or null if sponsorship hasn't been set + */ + async getTokenNextSponsored(collectionId: number, tokenId: number, addressObj: ICrossAccountId): Promise { + return (await this.helper.callRpc('api.rpc.unique.nextSponsored', [collectionId, addressObj, tokenId])).toJSON(); + } + + /** + * Get number of collection created on current chain. + * + * @returns number of created collections + */ + async getTotalCount(): Promise { + return (await this.helper.callRpc('api.rpc.unique.collectionStats')).created.toNumber(); + } + + /** + * Get information about the collection with additional data, including the number of tokens it contains, its administrators, the normalized address of the collection's owner, and decoded name and description. + * + * @param collectionId ID of collection + * @returns collection information object + */ + async getData(collectionId: number): Promise<{ + id: number; + name: string; + description: string; + tokensCount: number; + admins: ICrossAccountId[]; + normalizedOwner: TSubstrateAccount; + raw: any + } | null> { + const collection = await this.helper.callRpc('api.rpc.unique.collectionById', [collectionId]); + let humanCollection = collection.toHuman(), collectionData = { + id: collectionId, name: null, description: null, tokensCount: 0, admins: [], + raw: humanCollection + } as any, jsonCollection = collection.toJSON(); + if (humanCollection === null) return null; + collectionData.raw.limits = jsonCollection.limits; + collectionData.raw.permissions = jsonCollection.permissions; + collectionData.normalizedOwner = this.helper.address.normalizeSubstrate(collectionData.raw.owner); + for (let key of ['name', 'description']) { + collectionData[key] = this.helper.util.vec2str(humanCollection[key]); + } + + collectionData.tokensCount = (['RFT', 'NFT'].includes(humanCollection.mode)) ? await this.helper[humanCollection.mode.toLocaleLowerCase() as 'nft' | 'rft'].getLastTokenId(collectionId) : 0; + collectionData.admins = await this.getAdmins(collectionId); + + return collectionData; + } + + /** + * Get the normalized addresses of the collection's administrators. + * + * @param collectionId ID of collection + * @returns array of administrators + */ + async getAdmins(collectionId: number): Promise { + let normalized = []; + for(let admin of (await this.helper.callRpc('api.rpc.unique.adminlist', [collectionId])).toHuman()) { + if(admin.Substrate) normalized.push({Substrate: this.helper.address.normalizeSubstrate(admin.Substrate)}); + else normalized.push(admin); + } + return normalized; + } + + /** + * Get the effective limits of the collection instead of null for default values + * + * @param collectionId ID of collection + * @returns object of collection limits + */ + async getEffectiveLimits(collectionId: number): Promise { + return (await this.helper.callRpc('api.rpc.unique.effectiveCollectionLimits', [collectionId])).toJSON(); + } + + /** + * Burns the collection if the signer has sufficient permissions and collection is empty. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param label extra label for log + * @returns bool true on success + */ + async burn(signer: TSigner, collectionId: number, label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.destroyCollection', [collectionId], + true, `Unable to burn collection for ${label}` + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionDestroyed', label); + } + + /** + * Sets the sponsor for the collection (Requires the Substrate address). + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param sponsorAddress Sponsor substrate address + * @param label extra label for log + * @returns bool true on success + */ + async setSponsor(signer: TSigner, collectionId: number, sponsorAddress: TSubstrateAccount, label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.setCollectionSponsor', [collectionId, sponsorAddress], + true, `Unable to set collection sponsor for ${label}` + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionSponsorSet', label); + } + + /** + * Confirms consent to sponsor the collection on behalf of the signer. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param label extra label for log + * @returns bool true on success + */ + async confirmSponsorship(signer: TSigner, collectionId: number, label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.confirmSponsorship', [collectionId], + true, `Unable to confirm collection sponsorship for ${label}` + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'SponsorshipConfirmed', label); + } + + /** + * Sets the limits of the collection. At least one limit must be specified for a correct call. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param limits collection limits object + * @param label extra label for log + * @returns bool true on success + */ + async setLimits(signer: TSigner, collectionId: number, limits: ICollectionLimits, label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.setCollectionLimits', [collectionId, limits], + true, `Unable to set collection limits for ${label}` + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionLimitSet', label); + } + + /** + * Changes the owner of the collection to the new Substrate address. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param ownerAddress substrate address of new owner + * @param label extra label for log + * @returns bool true on success + */ + async changeOwner(signer: TSigner, collectionId: number, ownerAddress: TSubstrateAccount, label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.changeCollectionOwner', [collectionId, ownerAddress], + true, `Unable to change collection owner for ${label}` + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionOwnedChanged', label); + } + + /** + * Adds a collection administrator. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param adminAddressObj Administrator address (substrate or ethereum) + * @param label extra label for log + * @returns bool true on success + */ + async addAdmin(signer: TSigner, collectionId: number, adminAddressObj: ICrossAccountId, label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.addCollectionAdmin', [collectionId, adminAddressObj], + true, `Unable to add collection admin for ${label}` + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionAdminAdded', label); + } + + /** + * Removes a collection administrator. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param adminAddressObj Administrator address (substrate or ethereum) + * @param label extra label for log + * @returns bool true on success + */ + async removeAdmin(signer: TSigner, collectionId: number, adminAddressObj: ICrossAccountId, label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.removeCollectionAdmin', [collectionId, adminAddressObj], + true, `Unable to remove collection admin for ${label}` + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionAdminRemoved', label); + } + + /** + * Sets onchain permissions for selected collection. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param permissions collection permissions object + * @param label extra label for log + * @returns bool true on success + */ + async setPermissions(signer: TSigner, collectionId: number, permissions: ICollectionPermissions, label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.setCollectionPermissions', [collectionId, permissions], + true, `Unable to set collection permissions for ${label}` + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionPermissionSet', label); + } + + /** + * Enables nesting for selected collection. If `restricted` set, you can nest only tokens from specified collections. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param permissions nesting permissions object + * @param label extra label for log + * @returns bool true on success + */ + async enableNesting(signer: TSigner, collectionId: number, permissions: INestingPermissions, label?: string): Promise { + return await this.setPermissions(signer, collectionId, {nesting: permissions}, label); + } + + /** + * Disables nesting for selected collection. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param label extra label for log + * @returns bool true on success + */ + async disableNesting(signer: TSigner, collectionId: number, label?: string): Promise { + return await this.setPermissions(signer, collectionId, {nesting: {tokenOwner: false, collectionAdmin: false}}, label); + } + + /** + * Sets onchain properties to the collection. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param properties array of property objects + * @param label extra label for log + * @returns bool true on success + */ + async setProperties(signer: TSigner, collectionId: number, properties: IProperty[], label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.setCollectionProperties', [collectionId, properties], + true, `Unable to set collection properties for ${label}` + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionPropertySet', label); + } + + /** + * Deletes onchain properties from the collection. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param propertyKeys array of property keys to delete + * @param label + * @returns + */ + async deleteProperties(signer: TSigner, collectionId: number, propertyKeys: string[], label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.deleteCollectionProperties', [collectionId, propertyKeys], + true, `Unable to delete collection properties for ${label}` + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionPropertyDeleted', label); + } + + async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId, amount=1n): Promise { + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.transfer', [addressObj, collectionId, tokenId, amount], + true, `Unable to transfer token #${tokenId} from collection #${collectionId}` + ); + + return this.helper.util.isTokenTransferSuccess(result.result.events, collectionId, tokenId, {Substrate: typeof signer === 'string' ? signer : signer.address}, addressObj, amount); + } + + async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n): Promise { + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.transferFrom', [fromAddressObj, toAddressObj, collectionId, tokenId, amount], + true, `Unable to transfer token #${tokenId} from collection #${collectionId}` + ); + return this.helper.util.isTokenTransferSuccess(result.result.events, collectionId, tokenId, fromAddressObj, toAddressObj, amount); + } + + async burnToken(signer: TSigner, collectionId: number, tokenId: number, label?: string, amount=1n): Promise<{ + success: boolean, + token: number | null + }> { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const burnResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.burnItem', [collectionId, tokenId, amount], + true, `Unable to burn token for ${label}` + ); + const burnedTokens = this.helper.util.extractTokensFromBurnResult(burnResult, label); + if (burnedTokens.tokens.length > 1) throw Error('Burned multiple tokens'); + return {success: burnedTokens.success, token: burnedTokens.tokens.length > 0 ? burnedTokens.tokens[0] : null}; + } + + async burnTokenFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, tokenId: number, label?: string, amount=1n): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const burnResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.burnFrom', [collectionId, fromAddressObj, tokenId, amount], + true, `Unable to burn token from for ${label}` + ); + const burnedTokens = this.helper.util.extractTokensFromBurnResult(burnResult, label); + return burnedTokens.success && burnedTokens.tokens.length > 0; + } + + async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string, amount=1n) { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const approveResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.approve', [toAddressObj, collectionId, tokenId, amount], + true, `Unable to approve token for ${label}` + ); + + return this.helper.util.findCollectionInEvents(approveResult.result.events, collectionId, 'common', 'Approved', label); + } + + async getTokenApprovedPieces(collectionId: number, tokenId: number, toAccountObj: ICrossAccountId, fromAccountObj: ICrossAccountId): Promise { + return (await this.helper.callRpc('api.rpc.unique.allowance', [collectionId, fromAccountObj, toAccountObj, tokenId])).toBigInt(); + } + + async getLastTokenId(collectionId: number): Promise { + return (await this.helper.callRpc('api.rpc.unique.lastTokenId', [collectionId])).toNumber(); + } + + async isTokenExists(collectionId: number, tokenId: number): Promise { + return (await this.helper.callRpc('api.rpc.unique.tokenExists', [collectionId, tokenId])).toJSON() + } +} + +class NFTnRFT extends CollectionGroup { + async getTokensByAddress(collectionId: number, addressObj: ICrossAccountId): Promise { + return (await this.helper.callRpc('api.rpc.unique.accountTokens', [collectionId, addressObj])).toJSON() + } + + async getToken(collectionId: number, tokenId: number, blockHashAt?: string, propertyKeys?: string[]): Promise<{ + properties: IProperty[]; + owner: ICrossAccountId; + normalizedOwner: ICrossAccountId; + }| null> { + let tokenData; + if(typeof blockHashAt === 'undefined') { + tokenData = await this.helper.callRpc('api.rpc.unique.tokenData', [collectionId, tokenId]); + } + else { + if(typeof propertyKeys === 'undefined') { + let collection = (await this.helper.callRpc('api.rpc.unique.collectionById', [collectionId])).toHuman(); + if(!collection) return null; + propertyKeys = collection.tokenPropertyPermissions.map((x: ITokenPropertyPermission) => x.key); + } + tokenData = await this.helper.callRpc('api.rpc.unique.tokenData', [collectionId, tokenId, propertyKeys, blockHashAt]); + } + tokenData = tokenData.toHuman(); + if (tokenData === null || tokenData.owner === null) return null; + let owner = {} as any; + for (let key of Object.keys(tokenData.owner)) { + owner[key.toLocaleLowerCase()] = key.toLocaleLowerCase() === 'substrate' ? this.helper.address.normalizeSubstrate(tokenData.owner[key]) : tokenData.owner[key]; + } + tokenData.normalizedOwner = crossAccountIdFromLower(owner); + return tokenData; + } + + async setTokenPropertyPermissions(signer: TSigner, collectionId: number, permissions: ITokenPropertyPermission[], label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.setTokenPropertyPermissions', [collectionId, permissions], + true, `Unable to set token property permissions for ${label}` + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'PropertyPermissionSet', label); + } + + async setTokenProperties(signer: TSigner, collectionId: number, tokenId: number, properties: IProperty[], label?: string): Promise { + if(typeof label === 'undefined') label = `token #${tokenId} from collection #${collectionId}`; + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.setTokenProperties', [collectionId, tokenId, properties], + true, `Unable to set token properties for ${label}` + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'TokenPropertySet', label); + } + + async deleteTokenProperties(signer: TSigner, collectionId: number, tokenId: number, propertyKeys: string[], label?: string): Promise { + if(typeof label === 'undefined') label = `token #${tokenId} from collection #${collectionId}`; + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.deleteTokenProperties', [collectionId, tokenId, propertyKeys], + true, `Unable to delete token properties for ${label}` + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'TokenPropertyDeleted', label); + } + + async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, mode: 'NFT' | 'RFT', errorLabel = 'Unable to mint collection'): Promise { + collectionOptions = JSON.parse(JSON.stringify(collectionOptions)) as ICollectionCreationOptions; // Clone object + collectionOptions.mode = (mode === 'NFT') ? {nft: null} : {refungible: null}; + for (let key of ['name', 'description', 'tokenPrefix']) { + if (typeof collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] === 'string') collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] = this.helper.util.str2vec(collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] as string); + } + const creationResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.createCollectionEx', [collectionOptions], + true, errorLabel + ); + return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult, errorLabel)); + } + + getCollectionObject(collectionId: number): any { + return null; + } + + getTokenObject(collectionId: number, tokenId: number): any { + return null; + } +} + + +class NFTGroup extends NFTnRFT { + getCollectionObject(collectionId: number): UniqueNFTCollection { + return new UniqueNFTCollection(collectionId, this.helper); + } + + getTokenObject(collectionId: number, tokenId: number): UniqueNFTToken { + return new UniqueNFTToken(tokenId, this.getCollectionObject(collectionId)); + } + + async getTokenOwner(collectionId: number, tokenId: number, blockHashAt?: string): Promise { + let owner; + if (typeof blockHashAt === 'undefined') { + owner = await this.helper.callRpc('api.rpc.unique.tokenOwner', [collectionId, tokenId]); + } else { + owner = await this.helper.callRpc('api.rpc.unique.tokenOwner', [collectionId, tokenId, blockHashAt]); + } + return crossAccountIdFromLower(owner.toJSON()); + } + + async isTokenApproved(collectionId: number, tokenId: number, toAccountObj: ICrossAccountId): Promise { + return (await this.getTokenApprovedPieces(collectionId, tokenId, toAccountObj, await this.getTokenOwner(collectionId, tokenId))) === 1n; + } + + async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId): Promise { + return await super.transferToken(signer, collectionId, tokenId, addressObj, 1n); + } + + async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId): Promise { + return await super.transferTokenFrom(signer, collectionId, tokenId, fromAddressObj, toAddressObj, 1n); + } + + async getTokenTopmostOwner(collectionId: number, tokenId: number, blockHashAt?: string): Promise { + let owner; + if (typeof blockHashAt === 'undefined') { + owner = await this.helper.callRpc('api.rpc.unique.topmostTokenOwner', [collectionId, tokenId]); + } else { + owner = await this.helper.callRpc('api.rpc.unique.topmostTokenOwner', [collectionId, tokenId, blockHashAt]); + } + + if (owner === null) return null; + + owner = owner.toHuman(); + + return owner.Substrate ? {Substrate: this.helper.address.normalizeSubstrate(owner.Substrate)} : owner; + } + + async getTokenChildren(collectionId: number, tokenId: number, blockHashAt?: string): Promise { + let children; + if(typeof blockHashAt === 'undefined') { + children = await this.helper.callRpc('api.rpc.unique.tokenChildren', [collectionId, tokenId]); + } else { + children = await this.helper.callRpc('api.rpc.unique.tokenChildren', [collectionId, tokenId, blockHashAt]); + } + + return children.toJSON().map((x: any) => { + return {collectionId: x.collection, tokenId: x.token}; + }); + } + + async nestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, label='nest token'): Promise { + const rootTokenAddress = {Ethereum: this.helper.util.getNestingTokenAddress(rootTokenObj.collectionId, rootTokenObj.tokenId)}; + const result = await this.transferToken(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress); + if(!result) { + throw Error(`Unable to nest token for ${label}`); + } + return result; + } + + async unnestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, toAddressObj: ICrossAccountId, label='unnest token'): Promise { + const rootTokenAddress = {Ethereum: this.helper.util.getNestingTokenAddress(rootTokenObj.collectionId, rootTokenObj.tokenId)}; + const result = await this.transferTokenFrom(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress, toAddressObj); + if(!result) { + throw Error(`Unable to unnest token for ${label}`); + } + return result; + } + + async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, label = 'new collection'): Promise { + return await super.mintCollection(signer, collectionOptions, 'NFT', `Unable to mint NFT collection for ${label}`) as UniqueNFTCollection; + } + + async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; properties?: IProperty[]; }, label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${data.collectionId}`; + const creationResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.createItem', [data.collectionId, (typeof data.owner === 'string') ? {Substrate: data.owner} : data.owner, { + nft: { + properties: data.properties + } + }], + true, `Unable to mint NFT token for ${label}` + ); + const createdTokens = this.helper.util.extractTokensFromCreationResult(creationResult, label); + if (createdTokens.tokens.length > 1) throw Error('Minted multiple tokens'); + if (createdTokens.tokens.length < 1) throw Error('No tokens minted'); + return this.getTokenObject(data.collectionId, createdTokens.tokens[0].tokenId); + } + + async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[], label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const creationResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.createMultipleItemsEx', [collectionId, {NFT: tokens}], + true, `Unable to mint NFT tokens for ${label}` + ); + const collection = this.getCollectionObject(collectionId); + return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); + } + + async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {properties?: IProperty[]}[], label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + let rawTokens = []; + for (let token of tokens) { + let raw = {NFT: {properties: token.properties}}; + rawTokens.push(raw); + } + const creationResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.createMultipleItems', [collectionId, owner, rawTokens], + true, `Unable to mint NFT tokens for ${label}` + ); + const collection = this.getCollectionObject(collectionId); + return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); + } + + async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number, label?: string): Promise<{ success: boolean; token: number | null; }> { + return await super.burnToken(signer, collectionId, tokenId, label, 1n); + } + + async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string) { + return super.approveToken(signer, collectionId, tokenId, toAddressObj, label, 1n); + } +} + + +class RFTGroup extends NFTnRFT { + getCollectionObject(collectionId: number): UniqueRFTCollection { + return new UniqueRFTCollection(collectionId, this.helper); + } + + getTokenObject(collectionId: number, tokenId: number): UniqueRFTToken { + return new UniqueRFTToken(tokenId, this.getCollectionObject(collectionId)); + } + + async getTokenTop10Owners(collectionId: number, tokenId: number): Promise { + return (await this.helper.callRpc('api.rpc.unique.tokenOwners', [collectionId, tokenId])).toJSON().map(crossAccountIdFromLower); + } + + async getTokenBalance(collectionId: number, tokenId: number, addressObj: ICrossAccountId): Promise { + return (await this.helper.callRpc('api.rpc.unique.balance', [collectionId, addressObj, tokenId])).toBigInt(); + } + + async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId, amount=100n): Promise { + return await super.transferToken(signer, collectionId, tokenId, addressObj, amount); + } + + async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=100n): Promise { + return await super.transferTokenFrom(signer, collectionId, tokenId, fromAddressObj, toAddressObj, amount); + } + + async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, label = 'new collection'): Promise { + return await super.mintCollection(signer, collectionOptions, 'RFT', `Unable to mint RFT collection for ${label}`) as UniqueRFTCollection; + } + + async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; pieces: bigint; properties?: IProperty[]; }, label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${data.collectionId}`; + const creationResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.createItem', [data.collectionId, (typeof data.owner === 'string') ? {Substrate: data.owner} : data.owner, { + refungible: { + pieces: data.pieces, + properties: data.properties + } + }], + true, `Unable to mint RFT token for ${label}` + ); + const createdTokens = this.helper.util.extractTokensFromCreationResult(creationResult, label); + if (createdTokens.tokens.length > 1) throw Error('Minted multiple tokens'); + if (createdTokens.tokens.length < 1) throw Error('No tokens minted'); + return this.getTokenObject(data.collectionId, createdTokens.tokens[0].tokenId); + } + + async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, pieces: bigint, properties?: IProperty[]}[], label?: string): Promise { + throw Error('Not implemented'); + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const creationResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.createMultipleItemsEx', [collectionId, {RefungibleMultipleOwners: tokens}], + true, `Unable to mint RFT tokens for ${label}` + ); + const collection = this.getCollectionObject(collectionId); + return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); + } + + async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {pieces: bigint, properties?: IProperty[]}[], label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + let rawTokens = []; + for (let token of tokens) { + let raw = {ReFungible: {pieces: token.pieces, properties: token.properties}}; + rawTokens.push(raw); + } + const creationResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.createMultipleItems', [collectionId, owner, rawTokens], + true, `Unable to mint RFT tokens for ${label}` + ); + const collection = this.getCollectionObject(collectionId); + return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); + } + + async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number, label?: string, amount=100n): Promise<{ success: boolean; token: number | null; }> { + return await super.burnToken(signer, collectionId, tokenId, label, amount); + } + + async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string, amount=100n) { + return super.approveToken(signer, collectionId, tokenId, toAddressObj, label, amount); + } + + async getTokenTotalPieces(collectionId: number, tokenId: number): Promise { + return (await this.helper.callRpc('api.rpc.unique.totalPieces', [collectionId, tokenId])).unwrap().toBigInt(); + } + + async repartitionToken(signer: TSigner, collectionId: number, tokenId: number, amount: bigint, label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const currentAmount = await this.getTokenTotalPieces(collectionId, tokenId); + const repartitionResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.repartition', [collectionId, tokenId, amount], + true, `Unable to repartition RFT token for ${label}` + ); + if(currentAmount < amount) return this.helper.util.findCollectionInEvents(repartitionResult.result.events, collectionId, 'common', 'ItemCreated', label); + return this.helper.util.findCollectionInEvents(repartitionResult.result.events, collectionId, 'common', 'ItemDestroyed', label); + } +} + + +class FTGroup extends CollectionGroup { + getCollectionObject(collectionId: number): UniqueFTCollection { + return new UniqueFTCollection(collectionId, this.helper); + } + + async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, decimalPoints: number = 0, errorLabel = 'Unable to mint collection'): Promise { + collectionOptions = JSON.parse(JSON.stringify(collectionOptions)) as ICollectionCreationOptions; // Clone object + if(collectionOptions.tokenPropertyPermissions) throw Error('Fungible collections has no tokenPropertyPermissions'); + collectionOptions.mode = {fungible: decimalPoints}; + for (let key of ['name', 'description', 'tokenPrefix']) { + if (typeof collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] === 'string') collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] = this.helper.util.str2vec(collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] as string); + } + const creationResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.createCollectionEx', [collectionOptions], + true, errorLabel + ); + return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult, errorLabel)); + } + + async mintTokens(signer: TSigner, collectionId: number, owner: ICrossAccountId | string, amount: bigint, label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const creationResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.createItem', [collectionId, (typeof owner === 'string') ? {Substrate: owner} : owner, { + fungible: { + value: amount + } + }], + true, `Unable to mint fungible tokens for ${label}` + ); + return this.helper.util.findCollectionInEvents(creationResult.result.events, collectionId, 'common', 'ItemCreated', label); + } + + async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {value: bigint}[], label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + let rawTokens = []; + for (let token of tokens) { + let raw = {Fungible: {Value: token.value}}; + rawTokens.push(raw); + } + const creationResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.createMultipleItems', [collectionId, owner, rawTokens], + true, `Unable to mint RFT tokens for ${label}` + ); + return this.helper.util.findCollectionInEvents(creationResult.result.events, collectionId, 'common', 'ItemCreated', label); + } + + async getTop10Owners(collectionId: number): Promise { + return (await this.helper.callRpc('api.rpc.unique.tokenOwners', [collectionId, 0])).toJSON().map(crossAccountIdFromLower); + } + + async getBalance(collectionId: number, addressObj: ICrossAccountId): Promise { + return (await this.helper.callRpc('api.rpc.unique.balance', [collectionId, addressObj, 0])).toBigInt(); + } + + async transfer(signer: TSigner, collectionId: number, toAddressObj: ICrossAccountId, amount: bigint) { + return await super.transferToken(signer, collectionId, 0, toAddressObj, amount); + } + + async transferFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount: bigint) { + return await super.transferTokenFrom(signer, collectionId, 0, fromAddressObj, toAddressObj, amount); + } + + async burnTokens(signer: IKeyringPair, collectionId: number, amount=100n, label?: string): Promise { + return (await super.burnToken(signer, collectionId, 0, label, amount)).success; + } + + async burnTokensFrom(signer: IKeyringPair, collectionId: number, fromAddressObj: ICrossAccountId, amount=100n, label?: string): Promise { + return await super.burnTokenFrom(signer, collectionId, fromAddressObj, 0, label, amount); + } + + async getTotalPieces(collectionId: number): Promise { + return (await this.helper.callRpc('api.rpc.unique.totalPieces', [collectionId, 0])).unwrap().toBigInt(); + } + + async approveTokens(signer: IKeyringPair, collectionId: number, toAddressObj: ICrossAccountId, amount=100n, label?: string) { + return super.approveToken(signer, collectionId, 0, toAddressObj, label, amount); + } + + async getApprovedTokens(collectionId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) { + return super.getTokenApprovedPieces(collectionId, 0, toAddressObj, fromAddressObj); + } +} + + +class ChainGroup extends HelperGroup { + getChainProperties(): IChainProperties { + const properties = (this.helper.api as any).registry.getChainProperties().toJSON(); + return { + ss58Format: properties.ss58Format.toJSON(), + tokenDecimals: properties.tokenDecimals.toJSON(), + tokenSymbol: properties.tokenSymbol.toJSON() + }; + } + + async getLatestBlockNumber(): Promise { + return (await this.helper.callRpc('api.rpc.chain.getHeader')).number.toNumber(); + } + + async getBlockHashByNumber(blockNumber: number): Promise { + const blockHash = (await this.helper.callRpc('api.rpc.chain.getBlockHash', [blockNumber])).toJSON(); + if(blockHash === '0x0000000000000000000000000000000000000000000000000000000000000000') return null; + return blockHash; + } + + async getNonce(address: TSubstrateAccount): Promise { + return (await (this.helper.api as any).query.system.account(address)).nonce.toNumber(); + } +} + + +class BalanceGroup extends HelperGroup { + getOneTokenNominal(): bigint { + const chainProperties = this.helper.chain.getChainProperties(); + return 10n ** BigInt((chainProperties.tokenDecimals || [18])[0]); + } + + async getSubstrate(address: TSubstrateAccount): Promise { + return (await this.helper.callRpc('api.query.system.account', [address])).data.free.toBigInt(); + } + + async getEthereum(address: TEthereumAccount): Promise { + return (await this.helper.callRpc('api.rpc.eth.getBalance', [address])).toBigInt(); + } + + async transferToSubstrate(signer: TSigner, address: TSubstrateAccount, amount: bigint | string): Promise { + const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.transfer', [address, amount], true, `Unable to transfer balance from ${this.helper.getSignerAddress(signer)} to ${address}`); + + let transfer = {from: null, to: null, amount: 0n} as any; + result.result.events.forEach(({event: {data, method, section}}) => { + if ((section === 'balances') && (method === 'Transfer')) { + transfer = { + from: this.helper.address.normalizeSubstrate(data[0]), + to: this.helper.address.normalizeSubstrate(data[1]), + amount: BigInt(data[2]) + }; + } + }); + let isSuccess = this.helper.address.normalizeSubstrate(typeof signer === 'string' ? signer : signer.address) === transfer.from; + isSuccess = isSuccess && this.helper.address.normalizeSubstrate(address) === transfer.to; + isSuccess = isSuccess && BigInt(amount) === transfer.amount; + return isSuccess; + } +} + + +class AddressGroup extends HelperGroup { + normalizeSubstrate(address: TSubstrateAccount, ss58Format = 42): TSubstrateAccount { + return this.helper.util.normalizeSubstrateAddress(address, ss58Format); + } + + async normalizeSubstrateToChainFormat(address: TSubstrateAccount): Promise { + let info = this.helper.chain.getChainProperties(); + return encodeAddress(decodeAddress(address), info.ss58Format); + } + + async ethToSubstrate(ethAddress: TEthereumAccount, toChainFormat=false): Promise { + if(!toChainFormat) return evmToAddress(ethAddress); + let info = this.helper.chain.getChainProperties(); + return evmToAddress(ethAddress, info.ss58Format); + } + + substrateToEth(subAddress: TSubstrateAccount): TEthereumAccount { + return nesting.toChecksumAddress('0x' + Array.from(addressToEvm(subAddress), i => i.toString(16).padStart(2, '0')).join('')); + } +} + + +export class UniqueHelper extends ChainHelperBase { + chain: ChainGroup; + balance: BalanceGroup; + address: AddressGroup; + collection: CollectionGroup; + nft: NFTGroup; + rft: RFTGroup; + ft: FTGroup; + + constructor(logger?: ILogger) { + super(logger); + this.chain = new ChainGroup(this); + this.balance = new BalanceGroup(this); + this.address = new AddressGroup(this); + this.collection = new CollectionGroup(this); + this.nft = new NFTGroup(this); + this.rft = new RFTGroup(this); + this.ft = new FTGroup(this); + } +} + + +class UniqueCollectionBase { + helper: UniqueHelper; + collectionId: number; + + constructor(collectionId: number, uniqueHelper: UniqueHelper) { + this.collectionId = collectionId; + this.helper = uniqueHelper; + } + + async getData() { + return await this.helper.collection.getData(this.collectionId); + } + + async getLastTokenId() { + return await this.helper.collection.getLastTokenId(this.collectionId); + } + + async isTokenExists(tokenId: number) { + return await this.helper.collection.isTokenExists(this.collectionId, tokenId); + } + + async getAdmins() { + return await this.helper.collection.getAdmins(this.collectionId); + } + + async getEffectiveLimits() { + return await this.helper.collection.getEffectiveLimits(this.collectionId); + } + + async setSponsor(signer: TSigner, sponsorAddress: TSubstrateAccount, label?: string) { + return await this.helper.collection.setSponsor(signer, this.collectionId, sponsorAddress, label); + } + + async confirmSponsorship(signer: TSigner, label?: string) { + return await this.helper.collection.confirmSponsorship(signer, this.collectionId, label); + } + + async setLimits(signer: TSigner, limits: ICollectionLimits, label?: string) { + return await this.helper.collection.setLimits(signer, this.collectionId, limits, label); + } + + async changeOwner(signer: TSigner, ownerAddress: TSubstrateAccount, label?: string) { + return await this.helper.collection.changeOwner(signer, this.collectionId, ownerAddress, label); + } + + async addAdmin(signer: TSigner, adminAddressObj: ICrossAccountId, label?: string) { + return await this.helper.collection.addAdmin(signer, this.collectionId, adminAddressObj, label); + } + + async removeAdmin(signer: TSigner, adminAddressObj: ICrossAccountId, label?: string) { + return await this.helper.collection.removeAdmin(signer, this.collectionId, adminAddressObj, label); + } + + async setProperties(signer: TSigner, properties: IProperty[], label?: string) { + return await this.helper.collection.setProperties(signer, this.collectionId, properties, label); + } + + async deleteProperties(signer: TSigner, propertyKeys: string[], label?: string) { + return await this.helper.collection.deleteProperties(signer, this.collectionId, propertyKeys, label); + } + + async getTokenNextSponsored(tokenId: number, addressObj: ICrossAccountId) { + return await this.helper.collection.getTokenNextSponsored(this.collectionId, tokenId, addressObj); + } + + async setPermissions(signer: TSigner, permissions: ICollectionPermissions, label?: string) { + return await this.helper.collection.setPermissions(signer, this.collectionId, permissions, label); + } + + async enableNesting(signer: TSigner, permissions: INestingPermissions, label?: string) { + return await this.helper.collection.enableNesting(signer, this.collectionId, permissions, label); + } + + async disableNesting(signer: TSigner, label?: string) { + return await this.helper.collection.disableNesting(signer, this.collectionId, label); + } + + async burn(signer: TSigner, label?: string) { + return await this.helper.collection.burn(signer, this.collectionId, label); + } +} + + +class UniqueNFTCollection extends UniqueCollectionBase { + getTokenObject(tokenId: number) { + return new UniqueNFTToken(tokenId, this); + } + + async getTokensByAddress(addressObj: ICrossAccountId) { + return await this.helper.nft.getTokensByAddress(this.collectionId, addressObj); + } + + async getToken(tokenId: number, blockHashAt?: string) { + return await this.helper.nft.getToken(this.collectionId, tokenId, blockHashAt); + } + + async getTokenOwner(tokenId: number, blockHashAt?: string) { + return await this.helper.nft.getTokenOwner(this.collectionId, tokenId, blockHashAt); + } + + async getTokenTopmostOwner(tokenId: number, blockHashAt?: string) { + return await this.helper.nft.getTokenTopmostOwner(this.collectionId, tokenId, blockHashAt); + } + + async getTokenChildren(tokenId: number, blockHashAt?: string) { + return await this.helper.nft.getTokenChildren(this.collectionId, tokenId, blockHashAt); + } + + async transferToken(signer: TSigner, tokenId: number, addressObj: ICrossAccountId) { + return await this.helper.nft.transferToken(signer, this.collectionId, tokenId, addressObj); + } + + async transferTokenFrom(signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) { + return await this.helper.nft.transferTokenFrom(signer, this.collectionId, tokenId, fromAddressObj, toAddressObj); + } + + async approveToken(signer: TSigner, tokenId: number, toAddressObj: ICrossAccountId, label?: string) { + return await this.helper.nft.approveToken(signer, this.collectionId, tokenId, toAddressObj, label); + } + + async isTokenApproved(tokenId: number, toAddressObj: ICrossAccountId) { + return await this.helper.nft.isTokenApproved(this.collectionId, tokenId, toAddressObj); + } + + async mintToken(signer: TSigner, owner: ICrossAccountId, properties?: IProperty[], label?: string) { + return await this.helper.nft.mintToken(signer, {collectionId: this.collectionId, owner, properties}, label); + } + + async mintMultipleTokens(signer: TSigner, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[], label?: string) { + return await this.helper.nft.mintMultipleTokens(signer, this.collectionId, tokens, label); + } + + async burnToken(signer: TSigner, tokenId: number, label?: string) { + return await this.helper.nft.burnToken(signer, this.collectionId, tokenId, label); + } + + async setTokenProperties(signer: TSigner, tokenId: number, properties: IProperty[], label?: string) { + return await this.helper.nft.setTokenProperties(signer, this.collectionId, tokenId, properties, label); + } + + async deleteTokenProperties(signer: TSigner, tokenId: number, propertyKeys: string[], label?: string) { + return await this.helper.nft.deleteTokenProperties(signer, this.collectionId, tokenId, propertyKeys, label); + } + + async setTokenPropertyPermissions(signer: TSigner, permissions: ITokenPropertyPermission[], label?: string) { + return await this.helper.nft.setTokenPropertyPermissions(signer, this.collectionId, permissions, label); + } + + async nestToken(signer: TSigner, tokenId: number, toTokenObj: IToken, label?: string) { + return await this.helper.nft.nestToken(signer, {collectionId: this.collectionId, tokenId}, toTokenObj, label); + } + + async unnestToken(signer: TSigner, tokenId: number, fromTokenObj: IToken, toAddressObj: ICrossAccountId, label?: string) { + return await this.helper.nft.unnestToken(signer, {collectionId: this.collectionId, tokenId}, fromTokenObj, toAddressObj, label); + } +} + + +class UniqueRFTCollection extends UniqueCollectionBase { + getTokenObject(tokenId: number) { + return new UniqueRFTToken(tokenId, this); + } + + async getTokensByAddress(addressObj: ICrossAccountId) { + return await this.helper.rft.getTokensByAddress(this.collectionId, addressObj); + } + + async getTop10TokenOwners(tokenId: number) { + return await this.helper.rft.getTokenTop10Owners(this.collectionId, tokenId); + } + + async getTokenBalance(tokenId: number, addressObj: ICrossAccountId) { + return await this.helper.rft.getTokenBalance(this.collectionId, tokenId, addressObj); + } + + async getTokenTotalPieces(tokenId: number) { + return await this.helper.rft.getTokenTotalPieces(this.collectionId, tokenId); + } + + async transferToken(signer: TSigner, tokenId: number, addressObj: ICrossAccountId, amount=100n) { + return await this.helper.rft.transferToken(signer, this.collectionId, tokenId, addressObj, amount); + } + + async transferTokenFrom(signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=100n) { + return await this.helper.rft.transferTokenFrom(signer, this.collectionId, tokenId, fromAddressObj, toAddressObj, amount); + } + + async approveToken(signer: TSigner, tokenId: number, toAddressObj: ICrossAccountId, amount=100n, label?: string) { + return await this.helper.rft.approveToken(signer, this.collectionId, tokenId, toAddressObj, label, amount); + } + + async getTokenApprovedPieces(tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) { + return await this.helper.rft.getTokenApprovedPieces(this.collectionId, tokenId, toAddressObj, fromAddressObj); + } + + async repartitionToken(signer: TSigner, tokenId: number, amount: bigint, label?: string) { + return await this.helper.rft.repartitionToken(signer, this.collectionId, tokenId, amount, label); + } + + async mintToken(signer: TSigner, owner: ICrossAccountId, pieces=100n, properties?: IProperty[], label?: string) { + return await this.helper.rft.mintToken(signer, {collectionId: this.collectionId, owner, pieces, properties}, label); + } + + async mintMultipleTokens(signer: TSigner, tokens: {owner: ICrossAccountId, pieces: bigint, properties?: IProperty[]}[], label?: string) { + return await this.helper.rft.mintMultipleTokens(signer, this.collectionId, tokens, label); + } + + async burnToken(signer: TSigner, tokenId: number, amount=100n, label?: string) { + return await this.helper.rft.burnToken(signer, this.collectionId, tokenId, label, amount); + } + + async setTokenProperties(signer: TSigner, tokenId: number, properties: IProperty[], label?: string) { + return await this.helper.rft.setTokenProperties(signer, this.collectionId, tokenId, properties, label); + } + + async deleteTokenProperties(signer: TSigner, tokenId: number, propertyKeys: string[], label?: string) { + return await this.helper.rft.deleteTokenProperties(signer, this.collectionId, tokenId, propertyKeys, label); + } + + async setTokenPropertyPermissions(signer: TSigner, permissions: ITokenPropertyPermission[], label?: string) { + return await this.helper.rft.setTokenPropertyPermissions(signer, this.collectionId, permissions, label); + } +} + + +class UniqueFTCollection extends UniqueCollectionBase { + async mint(signer: TSigner, owner: ICrossAccountId, amount: bigint, label?: string) { + return await this.helper.ft.mintTokens(signer, this.collectionId, owner, amount, label); + } + + async mintWithOneOwner(signer: TSigner, owner: ICrossAccountId, tokens: {value: bigint}[], label?: string) { + return await this.helper.ft.mintMultipleTokensWithOneOwner(signer, this.collectionId, owner, tokens, label); + } + + async getBalance(addressObj: ICrossAccountId) { + return await this.helper.ft.getBalance(this.collectionId, addressObj); + } + + async getTop10Owners() { + return await this.helper.ft.getTop10Owners(this.collectionId); + } + + async transfer(signer: TSigner, toAddressObj: ICrossAccountId, amount: bigint) { + return await this.helper.ft.transfer(signer, this.collectionId, toAddressObj, amount); + } + + async transferFrom(signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount: bigint) { + return await this.helper.ft.transferFrom(signer, this.collectionId, fromAddressObj, toAddressObj, amount); + } + + async burnTokens(signer: TSigner, amount: bigint, label?: string) { + return await this.helper.ft.burnTokens(signer, this.collectionId, amount, label); + } + + async burnTokensFrom(signer: TSigner, fromAddressObj: ICrossAccountId, amount: bigint, label?: string) { + return await this.helper.ft.burnTokensFrom(signer, this.collectionId, fromAddressObj, amount, label); + } + + async getTotalPieces() { + return await this.helper.ft.getTotalPieces(this.collectionId); + } + + async approveTokens(signer: TSigner, toAddressObj: ICrossAccountId, amount=100n, label?: string) { + return await this.helper.ft.approveTokens(signer, this.collectionId, toAddressObj, amount, label); + } + + async getApprovedTokens(fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) { + return await this.helper.ft.getApprovedTokens(this.collectionId, fromAddressObj, toAddressObj); + } +} + + +class UniqueTokenBase implements IToken { + collection: UniqueNFTCollection | UniqueRFTCollection; + collectionId: number; + tokenId: number; + + constructor(tokenId: number, collection: UniqueNFTCollection | UniqueRFTCollection) { + this.collection = collection; + this.collectionId = collection.collectionId; + this.tokenId = tokenId; + } + + async getNextSponsored(addressObj: ICrossAccountId) { + return await this.collection.getTokenNextSponsored(this.tokenId, addressObj); + } + + async setProperties(signer: TSigner, properties: IProperty[], label?: string) { + return await this.collection.setTokenProperties(signer, this.tokenId, properties, label); + } + + async deleteProperties(signer: TSigner, propertyKeys: string[], label?: string) { + return await this.collection.deleteTokenProperties(signer, this.tokenId, propertyKeys, label); + } +} + + +class UniqueNFTToken extends UniqueTokenBase { + collection: UniqueNFTCollection; + + constructor(tokenId: number, collection: UniqueNFTCollection) { + super(tokenId, collection); + this.collection = collection; + } + + async getData(blockHashAt?: string) { + return await this.collection.getToken(this.tokenId, blockHashAt); + } + + async getOwner(blockHashAt?: string) { + return await this.collection.getTokenOwner(this.tokenId, blockHashAt); + } + + async getTopmostOwner(blockHashAt?: string) { + return await this.collection.getTokenTopmostOwner(this.tokenId, blockHashAt); + } + + async getChildren(blockHashAt?: string) { + return await this.collection.getTokenChildren(this.tokenId, blockHashAt); + } + + async nest(signer: TSigner, toTokenObj: IToken, label?: string) { + return await this.collection.nestToken(signer, this.tokenId, toTokenObj, label); + } + + async unnest(signer: TSigner, fromTokenObj: IToken, toAddressObj: ICrossAccountId, label?: string) { + return await this.collection.unnestToken(signer, this.tokenId, fromTokenObj, toAddressObj, label); + } + + async transfer(signer: TSigner, addressObj: ICrossAccountId) { + return await this.collection.transferToken(signer, this.tokenId, addressObj); + } + + async transferFrom(signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) { + return await this.collection.transferTokenFrom(signer, this.tokenId, fromAddressObj, toAddressObj); + } + + async approve(signer: TSigner, toAddressObj: ICrossAccountId, label?: string) { + return await this.collection.approveToken(signer, this.tokenId, toAddressObj, label); + } + + async isApproved(toAddressObj: ICrossAccountId) { + return await this.collection.isTokenApproved(this.tokenId, toAddressObj); + } + + async burn(signer: TSigner, label?: string) { + return await this.collection.burnToken(signer, this.tokenId, label); + } +} + +class UniqueRFTToken extends UniqueTokenBase { + collection: UniqueRFTCollection; + + constructor(tokenId: number, collection: UniqueRFTCollection) { + super(tokenId, collection); + this.collection = collection; + } + + async getTop10Owners() { + return await this.collection.getTop10TokenOwners(this.tokenId); + } + + async getBalance(addressObj: ICrossAccountId) { + return await this.collection.getTokenBalance(this.tokenId, addressObj); + } + + async getTotalPieces() { + return await this.collection.getTokenTotalPieces(this.tokenId); + } + + async transfer(signer: TSigner, addressObj: ICrossAccountId, amount=100n) { + return await this.collection.transferToken(signer, this.tokenId, addressObj, amount); + } + + async transferFrom(signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=100n) { + return await this.collection.transferTokenFrom(signer, this.tokenId, fromAddressObj, toAddressObj, amount); + } + + async approve(signer: TSigner, toAddressObj: ICrossAccountId, amount=100n, label?: string) { + return await this.collection.approveToken(signer, this.tokenId, toAddressObj, amount, label); + } + + async getApprovedPieces(fromAddressObj: ICrossAccountId, toAccountObj: ICrossAccountId) { + return await this.collection.getTokenApprovedPieces(this.tokenId, fromAddressObj, toAccountObj); + } + + async repartition(signer: TSigner, amount: bigint, label?: string) { + return await this.collection.repartitionToken(signer, this.tokenId, amount, label); + } + + async burn(signer: TSigner, amount=100n, label?: string) { + return await this.collection.burnToken(signer, this.tokenId, amount, label); + } +} \ No newline at end of file From 8126093139584300004e2388149c3694481e36a9 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 1 Aug 2022 10:17:27 +0300 Subject: [PATCH 0145/1274] Re-created branch with changes related to STEP1 task. --- .docker/Dockerfile-chain-dev | 35 ++++++ .docker/Dockerfile-parachain | 114 +++++++++++++++++ .docker/Dockerfile-parachain-v2 | 96 ++++++++++++++ .docker/docker-compose-dev.yaml | 19 +++ .docker/docker-compose-tests-parachain.yml | 28 +++++ .docker/docker-compose.tmp.j2 | 13 ++ .github/workflows/codestyle.yml | 8 +- .github/workflows/node_build_test.yml | 138 +++++++++++++++++---- .github/workflows/notify.yml | 16 ++- .github/workflows/tests_codestyle.yml | 11 +- 10 files changed, 441 insertions(+), 37 deletions(-) create mode 100644 .docker/Dockerfile-chain-dev create mode 100644 .docker/Dockerfile-parachain create mode 100644 .docker/Dockerfile-parachain-v2 create mode 100644 .docker/docker-compose-dev.yaml create mode 100644 .docker/docker-compose-tests-parachain.yml create mode 100644 .docker/docker-compose.tmp.j2 diff --git a/.docker/Dockerfile-chain-dev b/.docker/Dockerfile-chain-dev new file mode 100644 index 0000000000..6bbca85bfe --- /dev/null +++ b/.docker/Dockerfile-chain-dev @@ -0,0 +1,35 @@ +FROM ubuntu:20.04 + +ENV DEBIAN_FRONTEND=noninteractive +ENV TZ=Etc/UTC + +RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +ARG RUST_TOOLCHAIN=nightly-2022-04-07 +ARG BRANCH=develop +ARG REPO_URL=https://github.com/UniqueNetwork/unique-chain.git +ARG FEATURE= + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install $RUST_TOOLCHAIN && \ + rustup default $RUST_TOOLCHAIN && \ + rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN + +RUN mkdir /dev_chain && git clone $REPO_URL /dev_chain && cd /dev_chain && git checkout $BRANCH +WORKDIR /dev_chain + +RUN cargo build --release + +EXPOSE 9844 +EXPOSE 9944 +EXPOSE 9933 +EXPOSE 9833 +EXPOSE 40333 +EXPOSE 30333 + +CMD cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain new file mode 100644 index 0000000000..3616b16b76 --- /dev/null +++ b/.docker/Dockerfile-parachain @@ -0,0 +1,114 @@ +# ===== Rust builder ===== +FROM phusion/baseimage:focal-1.1.0 as rust-builder +LABEL maintainer="Unique.Network" + +ARG RUST_TOOLCHAIN=nightly-2022-05-11 +#ARG RUST_C=1.62.0-nightly +ARG POLKA_VERSION=release-v0.9.24 +ARG UNIQUE_BRANCH=develop + +#ARG USER=*** +#ARG PASS=*** + + +ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN +#ENV RUST_C $RUST_C +ENV POLKA_VERSION $POLKA_VERSION +ENV UNIQUE_BRANCH $UNIQUE_BRANCH + + +#RUN echo $RUST_TOOLCHAIN +#RUN echo $RUST_C +#RUN echo $POLKA_VERSION +#RUN echo $UNIQUE_BRANCH + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN apt-get update && \ + apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \ + apt-get install -y cmake pkg-config libssl-dev git clang + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install $RUST_TOOLCHAIN && \ + rustup default $RUST_TOOLCHAIN && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN + +RUN cargo install cargo-chef + +RUN mkdir unique_parachain +WORKDIR /unique_parachain + +# ===== Chef ===== +FROM rust-builder as chef + +COPY . . +RUN cargo chef prepare --recipe-path recipe.json + +# ===== BUILD ====== +FROM rust-builder as builder + +RUN mkdir unique_parachain +WORKDIR /unique_parachain + +COPY --from=chef /unique_parachain/recipe.json recipe.json +ARG PROFILE=release +RUN cargo chef cook "--$PROFILE" --recipe-path recipe.json + +COPY . . +RUN cargo build "--$PROFILE" + # && \ + # cargo test + +# ===== BUILD POLKADOT ===== +FROM rust-builder as builder-polkadot + +RUN mkdir unique_parachain +WORKDIR /unique_parachain + +RUN git clone -b $POLKA_VERSION --depth 1 https://github.com/paritytech/polkadot.git && \ + cd polkadot && \ + git tag -n && \ + cargo build --release + +# ===== RUN ====== + +FROM phusion/baseimage:focal-1.1.0 + +ARG PROFILE=release + +RUN apt-get -y update && \ + apt-get -y upgrade && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v15.5.0 && \ + nvm use v15.5.0 + +RUN git clone https://github.com/paritytech/polkadot-launch + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn + +COPY --from=builder /unique_parachain/target/$PROFILE/unique-collator /unique-chain/target/$PROFILE/ +COPY --from=builder-polkadot /unique_parachain/polkadot/target/$PROFILE/polkadot /polkadot/target/$PROFILE/ + +EXPOSE 9844 +EXPOSE 9944 +EXPOSE 9933 +EXPOSE 9833 +EXPOSE 40333 +EXPOSE 30333 + +CMD export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start launch-config.json diff --git a/.docker/Dockerfile-parachain-v2 b/.docker/Dockerfile-parachain-v2 new file mode 100644 index 0000000000..efe86335ac --- /dev/null +++ b/.docker/Dockerfile-parachain-v2 @@ -0,0 +1,96 @@ +# ===== Rust builder ===== +FROM phusion/baseimage:focal-1.1.0 as rust-builder +LABEL maintainer="Unique.Network" + +ARG RUST_TOOLCHAIN={{ actual_toolchain }} +ARG POLKA_VERSION=release-v0.9.24 + + +ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN +ENV POLKA_VERSION $POLKA_VERSION + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN apt-get update && \ + apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \ + apt-get install -y cmake pkg-config libssl-dev git clang + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install $RUST_TOOLCHAIN && \ + rustup default $RUST_TOOLCHAIN && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN + +####works inside repo folder### + + +# ===== BUILD ====== +FROM rust-builder as builder-unique + +RUN mkdir unique_parachain +WORKDIR /unique_parachain + +ARG PROFILE='features=quartz-runtime --release' + +COPY . . +RUN cargo build --features=quartz-runtime --release + # && \ + # cargo test + +# ===== BUILD POLKADOT ===== +FROM rust-builder as builder-polkadot + +RUN mkdir unique_parachain +WORKDIR /unique_parachain + +RUN git clone -b $POLKA_VERSION --depth 1 https://github.com/paritytech/polkadot.git && \ + cd polkadot && \ + git tag -n && \ + cargo build --release + +# ===== RUN ====== + +FROM phusion/baseimage:focal-1.1.0 + +#ARG PROFILE='--features=quartz-runtime --release' + +RUN apt-get -y update && \ + apt-get -y upgrade && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v15.5.0 && \ + nvm use v15.5.0 + +RUN git clone https://github.com/UniqueNetwork/polkadot-launch.git && \ + cd ./polkadot-launch && \ + git checkout feature/runtime-upgrade-testing + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn + +COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ + +COPY ["./launch-config.json", "/polkadot-launch/launch-config.json"] + + +EXPOSE 9844 +EXPOSE 9944 +EXPOSE 9933 +EXPOSE 9833 +EXPOSE 40333 +EXPOSE 30333 + +CMD export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start launch-config.json diff --git a/.docker/docker-compose-dev.yaml b/.docker/docker-compose-dev.yaml new file mode 100644 index 0000000000..2ca4cdf630 --- /dev/null +++ b/.docker/docker-compose-dev.yaml @@ -0,0 +1,19 @@ +version: "3.5" + +services: + node-o: + build: + context: . + dockerfile: Dockerfile-chain-dev + image: node-o + container_name: node-o + expose: + - 9944 + - 9933 + ports: + - 127.0.0.1:9944:9944 + - 127.0.0.1:9933:9933 + logging: + options: + max-size: "1m" + max-file: "3" diff --git a/.docker/docker-compose-tests-parachain.yml b/.docker/docker-compose-tests-parachain.yml new file mode 100644 index 0000000000..ad91a80b5c --- /dev/null +++ b/.docker/docker-compose-tests-parachain.yml @@ -0,0 +1,28 @@ +version: "3.5" + +services: + blockchain_nodes: + build: + context: ./ + dockerfile: Dockerfile-parachain + args: + - RUST_TOOLCHAIN=${RUST_TOOLCHAIN:?err} + - RUST_C=${RUST_C:?err} + - POLKA_VERSION=${POLKA_VERSION:?err} + - UNIQUE_BRANCH=${UNIQUE_BRANCH:?err} + volumes: + - ./launch-config.json:/polkadot-launch/launch-config.json + env_file: + - ./.env + + integration_tests: + build: + context: tests/ + dockerfile: Dockerfile-tests + environment: + RPC_URL: http://blockchain_nodes:9933/ + volumes: + - ./tests/src/config_docker.ts:/unique_parachain/src/config.ts + - /home/ubuntu/mochawesome-report:/unique_parachain/mochawesome-report + depends_on: + - blockchain_nodes diff --git a/.docker/docker-compose.tmp.j2 b/.docker/docker-compose.tmp.j2 new file mode 100644 index 0000000000..a706a2824f --- /dev/null +++ b/.docker/docker-compose.tmp.j2 @@ -0,0 +1,13 @@ +version: "3.5" + +services: + node-o: + build: + args: + - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" + - "BRANCH={{ BRANCH }}" + - "REPO_URL={{ REPO_URL }}" + - "FEATURE={{ FEATURE }}" + + command: cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external + diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 3f8d9136de..10174e1b77 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -1,6 +1,12 @@ name: Code style -on: [push] +on: + pull_request: + branches: + - develop + types: + - opened + - edited jobs: rustfmt: diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 8aeea95240..ea6d1c9e7e 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -1,44 +1,128 @@ name: Build & test -# Controls when the action will run. +# Controls when the action will run. on: # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ develop ] - # pull_request: + #push: + # branches: [ develop ] + pull_request: + branches: + - develop + types: + - opened + - edited + - reopened + # pull_request: # branches: [ develop ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +#Define Workflow variables +env: + ubuntu_version: focal + chains_release_dir: /opt/runner/chains_release + opal_chain_workdir: ./src_opal_chain + quartz_chain_workdir: ./src_quartz_chain + unique_chain_workdir: ./src_unique_chain + src_repo_url: https://github.com/lzadjsf/unique-chain.git + RUST_TOOLCHAIN: nightly-2022-05-11 + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: + pre-requisites: + # The type of runner that the job will run on + runs-on: ci-01 + + steps: + #runs ssh connection + - name: Install dependencies + run: | + sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang make cmake + sudo apt autoremove + curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + . $HOME/.cargo/env && cargo install --locked --git https://github.com/chevdor/subwasm + rustup toolchain install ${{ env.RUST_TOOLCHAIN }} + rustup default ${{ env.RUST_TOOLCHAIN }} + rustup target add wasm32-unknown-unknown --toolchain ${{ env.RUST_TOOLCHAIN }} + + build: # The type of runner that the job will run on - runs-on: ubuntu-20.04 + runs-on: ci-01 + + needs: pre-requisites + name: Build Container, Spin it Up an test + + continue-on-error: true #Do not stop testing of matrix runs failed. - # if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true + strategy: + matrix: + include: + - network: "Opal" + features: " " + - network: "Quartz" + features: "--features=quartz-runtime" + - network: "Unique" + features: "--features=unique-runtime" - # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - #runs ssh connection - - name: Go to server - uses: appleboy/ssh-action@master + - uses: actions/checkout@v3 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp.j2 + output_file: .docker/docker-compose.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + FEATURE=${{ matrix.features }} + BRANCH=${{ github.head_ref }} + + - name: Show temporary file + run: cat .docker/docker-compose.${{ matrix.network }}.yml + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build + +# - name: "Build the Docker image with Feature: ${{ env.features }}" +# run: docker build -t build-${{ github.head_ref }} --file .docker/Dockerfile-chain-dev --build-arg REPO_URL=${{ github.server_url }}/${{ github.repository }}.git --build-arg RUST_TOOLCHAIN=${{ env.actual_toolchain }} --build-arg FEATURE="${{ env.features }}" --build-arg BRANCH=${{ github.head_ref }} --no-cache . + + - name: Wait + run: sleep 420s + + - name: Install node + uses: actions/setup-node@v1 with: - host: ${{ secrets.SERVER_IP }} - username: ${{ secrets.SERVER_USERNAME }} - key: ${{ secrets.KEY }} - port: ${{ secrets.SERVER_PORT }} - command_timeout: 300m - script: | - eval $(ssh-agent -s) - ssh-add /home/devops/.ssh/git_hub - git clone git@github.com:UniqueNetwork/unique-chain.git - cd unique-chain - git checkout develop - # git pull --all - chmod +x ci_node.sh - ./ci_node.sh - rm -rf /home/polkadot/unique-chain + node-version: 14.x + + - name: Install dependencies + run: | + cd tests + yarn install + yarn add mochawesome + yarn --pure-lockfile + + - name: Run tests + run: | + cd tests + ./scripts/ci-check-docker-state.sh + NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Test Report + uses: phoenix-actions/test-reporting@v8 + id: test-report # Set ID reference for step + if: success() || failure() # run this step even if previous step failed + with: + name: Tests ${{ matrix.network }} # Name of the check run which will be created + path: tests/mochawesome-report/test-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index d99788de9a..2db6731fca 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -1,13 +1,17 @@ name: telegram message on: - push: - branches: [ develop ] + pull_request: + branches: + - develop + types: + - opened + - edited jobs: - build: - runs-on: ubuntu-latest - steps: + build: + runs-on: ubuntu-latest + steps: - uses: avkviring/telegram-github-action@v0.0.13 env: - telegram_to: ${{ secrets.TELEGRAM_TO }} + telegram_to: ${{ secrets.TELEGRAM_TO }} telegram_token: ${{ secrets.TELEGRAM_TOKEN }} event: ${{ toJson(github.event) }} diff --git a/.github/workflows/tests_codestyle.yml b/.github/workflows/tests_codestyle.yml index b9a5e84731..9fc626899d 100644 --- a/.github/workflows/tests_codestyle.yml +++ b/.github/workflows/tests_codestyle.yml @@ -1,7 +1,12 @@ name: Tests code style -on: [push] - +on: + pull_request: + branches: + - develop + types: + - opened + - edited jobs: build: runs-on: ubuntu-20.04 @@ -11,4 +16,4 @@ jobs: - name: Install modules run: cd tests && yarn - name: Run ESLint - run: cd tests && yarn eslint --ext .ts,.js src/ \ No newline at end of file + run: cd tests && yarn eslint --ext .ts,.js src/ From cd04afb21a1ace9c7c0219a33d28889ca72ed462 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Mon, 1 Aug 2022 10:20:42 +0300 Subject: [PATCH 0146/1274] Update codestyle.yml --- .github/workflows/codestyle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 10174e1b77..7992326677 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -10,7 +10,7 @@ on: jobs: rustfmt: - runs-on: ubuntu-20.04 + runs-on: self-hosted steps: - uses: actions/checkout@v1 From a6de879cf020b1773a2ff441027cbdeb056db76b Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Mon, 1 Aug 2022 10:20:51 +0300 Subject: [PATCH 0147/1274] Update codestyle.yml --- .github/workflows/codestyle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 7992326677..8b4952ed26 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -26,7 +26,7 @@ jobs: clippy: if: ${{ false }} - runs-on: ubuntu-20.04 + runs-on: self-hosted steps: - uses: actions/checkout@v1 From 3cb806b48ceb5d5543cf276cb2378432c1fe7f49 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Mon, 1 Aug 2022 10:21:21 +0300 Subject: [PATCH 0148/1274] Update node_build_test.yml --- .github/workflows/node_build_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index ea6d1c9e7e..a5cc5b0453 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -32,7 +32,7 @@ env: jobs: pre-requisites: # The type of runner that the job will run on - runs-on: ci-01 + runs-on: self-hosted steps: #runs ssh connection @@ -49,7 +49,7 @@ jobs: build: # The type of runner that the job will run on - runs-on: ci-01 + runs-on: self-hosted needs: pre-requisites name: Build Container, Spin it Up an test From afb78c0d0b1c84dae51e7a97ec235d27ac579282 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Mon, 1 Aug 2022 10:21:33 +0300 Subject: [PATCH 0149/1274] Update notify.yml --- .github/workflows/notify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 2db6731fca..aadbf52c84 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -8,7 +8,7 @@ on: - edited jobs: build: - runs-on: ubuntu-latest + runs-on: self-hosted steps: - uses: avkviring/telegram-github-action@v0.0.13 env: From 138125d99723305edb364572598e7ba75a70f5e9 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Mon, 1 Aug 2022 10:21:52 +0300 Subject: [PATCH 0150/1274] Update tests_codestyle.yml --- .github/workflows/tests_codestyle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_codestyle.yml b/.github/workflows/tests_codestyle.yml index 9fc626899d..f58a169ce7 100644 --- a/.github/workflows/tests_codestyle.yml +++ b/.github/workflows/tests_codestyle.yml @@ -9,7 +9,7 @@ on: - edited jobs: build: - runs-on: ubuntu-20.04 + runs-on: self-hosted steps: - uses: actions/checkout@v2 From 816cd47b0664d22c2157795818981e0e9bb0fae0 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Mon, 1 Aug 2022 10:46:32 +0300 Subject: [PATCH 0151/1274] Update node_build_test.yml --- .github/workflows/node_build_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index a5cc5b0453..11f040450b 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -32,7 +32,7 @@ env: jobs: pre-requisites: # The type of runner that the job will run on - runs-on: self-hosted + runs-on: self-hosted-ci steps: #runs ssh connection @@ -49,7 +49,7 @@ jobs: build: # The type of runner that the job will run on - runs-on: self-hosted + runs-on: self-hosted-ci needs: pre-requisites name: Build Container, Spin it Up an test From b387f276c10ceda6e78bfc90de475f922af49ca4 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Mon, 1 Aug 2022 10:46:46 +0300 Subject: [PATCH 0152/1274] Update codestyle.yml --- .github/workflows/codestyle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 8b4952ed26..83bcabe390 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -10,7 +10,7 @@ on: jobs: rustfmt: - runs-on: self-hosted + runs-on: self-hosted-ci steps: - uses: actions/checkout@v1 @@ -26,7 +26,7 @@ jobs: clippy: if: ${{ false }} - runs-on: self-hosted + runs-on: self-hosted-ci steps: - uses: actions/checkout@v1 From 374cade836445943e98dd9f5bcd7d8f4d3ed91d7 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Mon, 1 Aug 2022 10:46:56 +0300 Subject: [PATCH 0153/1274] Update notify.yml --- .github/workflows/notify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index aadbf52c84..76508e79af 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -8,7 +8,7 @@ on: - edited jobs: build: - runs-on: self-hosted + runs-on: self-hosted-ci steps: - uses: avkviring/telegram-github-action@v0.0.13 env: From 80975a995d3c1e262b73d9ee378856371a2430d6 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Mon, 1 Aug 2022 10:47:07 +0300 Subject: [PATCH 0154/1274] Update tests_codestyle.yml --- .github/workflows/tests_codestyle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_codestyle.yml b/.github/workflows/tests_codestyle.yml index f58a169ce7..6f2514864a 100644 --- a/.github/workflows/tests_codestyle.yml +++ b/.github/workflows/tests_codestyle.yml @@ -9,7 +9,7 @@ on: - edited jobs: build: - runs-on: self-hosted + runs-on: self-hosted-ci steps: - uses: actions/checkout@v2 From ca21272ac6468fa37497fc2b6fa38aee8b34b393 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Mon, 1 Aug 2022 11:49:57 +0300 Subject: [PATCH 0155/1274] Update node_build_test.yml --- .github/workflows/node_build_test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 11f040450b..cbe657b9b3 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -108,7 +108,6 @@ jobs: - name: Run tests run: | cd tests - ./scripts/ci-check-docker-state.sh NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ From b5dea1d2972b48befe21c009414fedcf79097259 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Mon, 1 Aug 2022 13:04:51 +0300 Subject: [PATCH 0156/1274] Update node_build_test.yml Removed src_repo_url variable which one not used in ci/cd pipeline. --- .github/workflows/node_build_test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index cbe657b9b3..0bc9a742c6 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -24,7 +24,6 @@ env: opal_chain_workdir: ./src_opal_chain quartz_chain_workdir: ./src_quartz_chain unique_chain_workdir: ./src_unique_chain - src_repo_url: https://github.com/lzadjsf/unique-chain.git RUST_TOOLCHAIN: nightly-2022-05-11 REPO_URL: ${{ github.server_url }}/${{ github.repository }} From 3a3be8f24ac950c2be665cd32e6009335465f53c Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 1 Aug 2022 13:36:50 +0000 Subject: [PATCH 0157/1274] major: move RFT const data to depricated. --- Cargo.lock | 4 ++-- pallets/refungible/CHANGELOG.md | 5 +++++ pallets/refungible/Cargo.toml | 2 +- pallets/refungible/src/common.rs | 5 ++--- pallets/refungible/src/lib.rs | 19 ++++++++----------- primitives/data-structs/CHANGELOG.md | 3 +++ primitives/data-structs/Cargo.toml | 2 +- primitives/data-structs/src/lib.rs | 17 ++--------------- runtime/tests/src/tests.rs | 4 ---- 9 files changed, 24 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 74848ab2ca..f32bfcb5ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6320,7 +6320,7 @@ dependencies = [ [[package]] name = "pallet-refungible" -version = "0.1.2" +version = "0.2.0" dependencies = [ "ethereum", "evm-coder", @@ -12737,7 +12737,7 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "up-data-structs" -version = "0.1.2" +version = "0.2.0" dependencies = [ "derivative", "frame-support", diff --git a/pallets/refungible/CHANGELOG.md b/pallets/refungible/CHANGELOG.md index 4f5895b878..9cbdb415d7 100644 --- a/pallets/refungible/CHANGELOG.md +++ b/pallets/refungible/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## [v0.2.0] - 2022-08-01 +### Deprecated +- `ItemData` +- `TokenData` + ## [v0.1.2] - 2022-07-14 ### Other changes diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index 4c5016cb78..3c53dafb0a 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-refungible" -version = "0.1.2" +version = "0.2.0" license = "GPLv3" edition = "2021" diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index bcedc6d534..beab0f12ad 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -32,7 +32,7 @@ use sp_std::{vec::Vec, vec}; use crate::{ AccountBalance, Allowance, Balance, Config, Error, Owned, Pallet, RefungibleHandle, - SelfWeightOf, TokenData, weights::WeightInfo, TokensMinted, + SelfWeightOf, TokenData, weights::WeightInfo, TokensMinted, TotalSupply, }; macro_rules! max_weight_of { @@ -155,7 +155,6 @@ fn map_create_data( ) -> Result, DispatchError> { match data { up_data_structs::CreateItemData::ReFungible(data) => Ok(CreateRefungibleExData { - const_data: data.const_data, users: { let mut out = BTreeMap::new(); out.insert(to.clone(), data.pieces); @@ -421,7 +420,7 @@ impl CommonCollectionOperations for RefungibleHandle { } fn collection_tokens(&self) -> Vec { - >::iter_prefix((self.id,)) + >::iter_prefix((self.id,)) .map(|(id, _)| id) .collect() } diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 8d4ded78ae..ded6eb3d20 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -123,6 +123,7 @@ pub(crate) type SelfWeightOf = ::WeightInfo; /// for the convenience of database access. Notably contains the token metadata. #[struct_versioning::versioned(version = 2, upper)] #[derive(Encode, Decode, Default, TypeInfo, MaxEncodedLen)] +#[deprecated(since = "0.2.0", note = "ItemData is no more contains usefull data")] pub struct ItemData { pub const_data: BoundedVec, @@ -180,7 +181,9 @@ pub mod pallet { StorageMap; /// Token data, used to partially describe a token. + // TODO: remove #[pallet::storage] + #[deprecated(since = "0.2.0", note = "ItemData is no more contains usefull data")] pub type TokenData = StorageNMap< Key = (Key, Key), Value = ItemData, @@ -260,10 +263,13 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { fn on_runtime_upgrade() -> Weight { - if StorageVersion::get::>() < StorageVersion::new(1) { + let storage_version = StorageVersion::get::>(); + if storage_version < StorageVersion::new(1) { >::translate_values::(|v| { Some(::from(v)) }) + } else if storage_version < StorageVersion::new(2) { + >::remove_all(None); } 0 @@ -377,7 +383,6 @@ impl Pallet { >::remove(id); >::remove(id); - >::remove_prefix((id,), None); >::remove_prefix((id,), None); >::remove_prefix((id,), None); >::remove_prefix((id,), None); @@ -387,7 +392,7 @@ impl Pallet { } fn collection_has_tokens(collection_id: CollectionId) -> bool { - >::iter_prefix((collection_id,)) + >::iter_prefix((collection_id,)) .next() .is_some() } @@ -401,7 +406,6 @@ impl Pallet { .ok_or(ArithmeticError::Overflow)?; >::insert(collection.id, burnt); - >::remove((collection.id, token_id)); >::remove((collection.id, token_id)); >::remove((collection.id, token_id)); >::remove_prefix((collection.id, token_id), None); @@ -883,13 +887,6 @@ impl Pallet { let token_id = first_token_id + i as u32 + 1; >::insert((collection.id, token_id), totals[i]); - >::insert( - (collection.id, token_id), - ItemData { - const_data: data.const_data.clone(), - }, - ); - for (user, amount) in data.users.iter() { if *amount == 0 { continue; diff --git a/primitives/data-structs/CHANGELOG.md b/primitives/data-structs/CHANGELOG.md index 53c458a4f9..75e8ffd40e 100644 --- a/primitives/data-structs/CHANGELOG.md +++ b/primitives/data-structs/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. +## [v0.2.0] - 2022-08-01 +### Deprecated +- `CreateReFungibleData::const_data` ## [v0.1.2] - 2022-07-25 ### Added diff --git a/primitives/data-structs/Cargo.toml b/primitives/data-structs/Cargo.toml index 227c86321d..57c156214e 100644 --- a/primitives/data-structs/Cargo.toml +++ b/primitives/data-structs/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = 'GPLv3' homepage = "https://unique.network" repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.1.2' +version = '0.2.0' [dependencies] scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 56fe930126..511bd58b96 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -780,12 +780,7 @@ pub struct CreateFungibleData { #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] #[derivative(Debug)] pub struct CreateReFungibleData { - /// Immutable metadata of the token - #[cfg_attr(feature = "serde1", serde(with = "bounded::vec_serde"))] - #[derivative(Debug(format_with = "bounded::vec_debug"))] - pub const_data: BoundedVec, - - /// Pieces of created token. + /// Number of pieces the RFT is split into pub pieces: u128, /// Key-value pairs used to describe the token as metadata @@ -832,11 +827,6 @@ pub struct CreateNftExData { #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] #[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))] pub struct CreateRefungibleExData { - /// Custom data stored in token. - #[derivative(Debug(format_with = "bounded::vec_debug"))] - pub const_data: BoundedVec, - - /// Users who will be assigned the specified number of token parts. #[derivative(Debug(format_with = "bounded::map_debug"))] pub users: BoundedBTreeMap>, #[derivative(Debug(format_with = "bounded::vec_debug"))] @@ -874,10 +864,7 @@ pub enum CreateItemExData { impl CreateItemData { /// Get size of custom data. pub fn data_size(&self) -> usize { - match self { - CreateItemData::ReFungible(data) => data.const_data.len(), - _ => 0, - } + 0 } } diff --git a/runtime/tests/src/tests.rs b/runtime/tests/src/tests.rs index 3a1a803970..f57546c2d0 100644 --- a/runtime/tests/src/tests.rs +++ b/runtime/tests/src/tests.rs @@ -62,7 +62,6 @@ fn default_fungible_data() -> CreateFungibleData { fn default_re_fungible_data() -> CreateReFungibleData { CreateReFungibleData { - const_data: vec![1, 2, 3].try_into().unwrap(), pieces: 1023, properties: vec![Property { key: b"test-prop".to_vec().try_into().unwrap(), @@ -298,7 +297,6 @@ fn create_refungible_item() { let item = >::get((collection_id, TokenId(1))); let balance = >::get((collection_id, TokenId(1), account(1))); - assert_eq!(item.const_data, data.const_data.into_inner()); assert_eq!(balance, 1023); }); } @@ -333,7 +331,6 @@ fn create_multiple_refungible_items() { )); let balance = >::get((CollectionId(1), TokenId(1), account(1))); - assert_eq!(item.const_data.to_vec(), data.const_data.into_inner()); assert_eq!(balance, 1023); } }); @@ -446,7 +443,6 @@ fn transfer_refungible_item() { let data = default_re_fungible_data(); create_test_item(collection_id, &data.clone().into()); let item = >::get((collection_id, TokenId(1))); - assert_eq!(item.const_data, data.const_data.into_inner()); assert_eq!( >::get((collection_id, account(1))), 1 From 9e39d67c9d24e6d047dc11366feb6a3512566f0b Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 2 Aug 2022 08:55:21 +0000 Subject: [PATCH 0158/1274] path: remove data_size --- primitives/data-structs/src/lib.rs | 7 ------- runtime/common/src/sponsoring.rs | 8 ++------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 511bd58b96..6a89531bfe 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -861,13 +861,6 @@ pub enum CreateItemExData { RefungibleMultipleOwners(CreateRefungibleExData), } -impl CreateItemData { - /// Get size of custom data. - pub fn data_size(&self) -> usize { - 0 - } -} - impl From for CreateItemData { fn from(item: CreateNftData) -> Self { CreateItemData::NFT(item) diff --git a/runtime/common/src/sponsoring.rs b/runtime/common/src/sponsoring.rs index 2b7375bd47..62452a9d29 100644 --- a/runtime/common/src/sponsoring.rs +++ b/runtime/common/src/sponsoring.rs @@ -156,17 +156,13 @@ pub fn withdraw_transfer( pub fn withdraw_create_item( collection: &CollectionHandle, who: &T::CrossAccountId, - _properties: &CreateItemData, + properties: &CreateItemData, ) -> Option<()> { - if _properties.data_size() as u32 > collection.limits.sponsored_data_size() { - return None; - } - // sponsor timeout let block_number = >::block_number() as T::BlockNumber; let limit = collection .limits - .sponsor_transfer_timeout(match _properties { + .sponsor_transfer_timeout(match properties { CreateItemData::NFT(_) => NFT_SPONSOR_TRANSFER_TIMEOUT, CreateItemData::Fungible(_) => FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT, CreateItemData::ReFungible(_) => REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT, From de851a4e4799afac69eb1670810b23e56f584651 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 2 Aug 2022 16:47:18 +0300 Subject: [PATCH 0159/1274] Added draft pipeline for master branch. --- .github/workflows/node_build_test.yml | 128 ++++++++++++++++++++++++++ pallets/common/CHANGELOG.md | 12 ++- 2 files changed, 135 insertions(+), 5 deletions(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 0bc9a742c6..433f037213 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -124,3 +124,131 @@ jobs: - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + + +name: Build & test Master + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + #push: + # branches: [ develop ] + pull_request: + branches: + - master + types: + - opened + - edited + - reopened + # pull_request: + # branches: [ develop ] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +#Define Workflow variables +env: + ubuntu_version: focal + chains_release_dir: /opt/runner/chains_release + opal_chain_workdir: ./src_opal_chain + quartz_chain_workdir: ./src_quartz_chain + unique_chain_workdir: ./src_unique_chain + RUST_TOOLCHAIN: nightly-2022-05-11 + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + pre-requisites: + # The type of runner that the job will run on + runs-on: self-hosted-ci + + steps: + #runs ssh connection + - name: Install dependencies + run: | + sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang make cmake + sudo apt autoremove + curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + . $HOME/.cargo/env && cargo install --locked --git https://github.com/chevdor/subwasm + rustup toolchain install ${{ env.RUST_TOOLCHAIN }} + rustup default ${{ env.RUST_TOOLCHAIN }} + rustup target add wasm32-unknown-unknown --toolchain ${{ env.RUST_TOOLCHAIN }} + + + build: + # The type of runner that the job will run on + runs-on: self-hosted-ci + + needs: pre-requisites + name: Build Container, Spin it Up an test + + continue-on-error: true #Do not stop testing of matrix runs failed. + + strategy: + matrix: + include: + - network: "Opal" + features: " " + - network: "Quartz" + features: "--features=quartz-runtime" + - network: "Unique" + features: "--features=unique-runtime" + + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp.j2 + output_file: .docker/docker-compose.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + FEATURE=${{ matrix.features }} + BRANCH=${{ github.head_ref }} + + - name: Show temporary file + run: cat .docker/docker-compose.${{ matrix.network }}.yml + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build + +# - name: "Build the Docker image with Feature: ${{ env.features }}" +# run: docker build -t build-${{ github.head_ref }} --file .docker/Dockerfile-chain-dev --build-arg REPO_URL=${{ github.server_url }}/${{ github.repository }}.git --build-arg RUST_TOOLCHAIN=${{ env.actual_toolchain }} --build-arg FEATURE="${{ env.features }}" --build-arg BRANCH=${{ github.head_ref }} --no-cache . + + - name: Wait + run: sleep 420s + + - name: Install node + uses: actions/setup-node@v1 + with: + node-version: 14.x + + - name: Install dependencies + run: | + cd tests + yarn install + yarn add mochawesome + yarn --pure-lockfile + + - name: Run tests + run: | + cd tests + NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Test Report + uses: phoenix-actions/test-reporting@v8 + id: test-report # Set ID reference for step + if: success() || failure() # run this step even if previous step failed + with: + name: Tests ${{ matrix.network }} # Name of the check run which will be created + path: tests/mochawesome-report/test-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down diff --git a/pallets/common/CHANGELOG.md b/pallets/common/CHANGELOG.md index fed1457338..5235f6362e 100644 --- a/pallets/common/CHANGELOG.md +++ b/pallets/common/CHANGELOG.md @@ -2,11 +2,13 @@ All notable changes to this project will be documented in this file. -## [0.1.1] - 2022-07-14 +## [0.1.3] - 2022-07-25 +### Add +- Some static property keys and values. -### Added +## [0.1.2] - 2022-07-20 - - Implementation of RPC method `token_owners` returning 10 owners in no particular order. - This was an internal request to improve the web interface and support fractionalization event. +### Fixed - \ No newline at end of file +- Some methods in `#[solidity_interface]` for `CollectionHandle` had invalid + mutability modifiers, causing invalid stub/abi generation. From 5b4393fae7508b7126738d56768cffdd5cf689dd Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 2 Aug 2022 16:58:19 +0300 Subject: [PATCH 0160/1274] Splited single file into two files targeted to specified branch. --- .github/workflows/build-test-master.yml | 126 +++++++++++++++++++++++ .github/workflows/node_build_test.yml | 128 ------------------------ 2 files changed, 126 insertions(+), 128 deletions(-) create mode 100644 .github/workflows/build-test-master.yml diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml new file mode 100644 index 0000000000..a766d15250 --- /dev/null +++ b/.github/workflows/build-test-master.yml @@ -0,0 +1,126 @@ +name: Build & Test Master + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + #push: + # branches: [ develop ] + pull_request: + branches: + - master + types: + - opened + - edited + - reopened + # pull_request: + # branches: [ develop ] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +#Define Workflow variables +env: + ubuntu_version: focal + chains_release_dir: /opt/runner/chains_release + opal_chain_workdir: ./src_opal_chain + quartz_chain_workdir: ./src_quartz_chain + unique_chain_workdir: ./src_unique_chain + RUST_TOOLCHAIN: nightly-2022-05-11 + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + pre-requisites: + # The type of runner that the job will run on + runs-on: self-hosted-ci + + steps: + #runs ssh connection + - name: Install dependencies + run: | + sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang make cmake + sudo apt autoremove + curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + . $HOME/.cargo/env && cargo install --locked --git https://github.com/chevdor/subwasm + rustup toolchain install ${{ env.RUST_TOOLCHAIN }} + rustup default ${{ env.RUST_TOOLCHAIN }} + rustup target add wasm32-unknown-unknown --toolchain ${{ env.RUST_TOOLCHAIN }} + + + build: + # The type of runner that the job will run on + runs-on: self-hosted-ci + + needs: pre-requisites + name: Build Container, Spin it Up an test + + continue-on-error: true #Do not stop testing of matrix runs failed. + + strategy: + matrix: + include: + - network: "Opal" + features: " " + - network: "Quartz" + features: "--features=quartz-runtime" + - network: "Unique" + features: "--features=unique-runtime" + + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp.j2 + output_file: .docker/docker-compose.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + FEATURE=${{ matrix.features }} + BRANCH=${{ github.head_ref }} + + - name: Show temporary file + run: cat .docker/docker-compose.${{ matrix.network }}.yml + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build + +# - name: "Build the Docker image with Feature: ${{ env.features }}" +# run: docker build -t build-${{ github.head_ref }} --file .docker/Dockerfile-chain-dev --build-arg REPO_URL=${{ github.server_url }}/${{ github.repository }}.git --build-arg RUST_TOOLCHAIN=${{ env.actual_toolchain }} --build-arg FEATURE="${{ env.features }}" --build-arg BRANCH=${{ github.head_ref }} --no-cache . + + - name: Wait + run: sleep 420s + + - name: Install node + uses: actions/setup-node@v1 + with: + node-version: 14.x + + - name: Install dependencies + run: | + cd tests + yarn install + yarn add mochawesome + yarn --pure-lockfile + + - name: Run tests + run: | + cd tests + NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Test Report + uses: phoenix-actions/test-reporting@v8 + id: test-report # Set ID reference for step + if: success() || failure() # run this step even if previous step failed + with: + name: Tests ${{ matrix.network }} # Name of the check run which will be created + path: tests/mochawesome-report/test-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 433f037213..0bc9a742c6 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -124,131 +124,3 @@ jobs: - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down - - -name: Build & test Master - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - #push: - # branches: [ develop ] - pull_request: - branches: - - master - types: - - opened - - edited - - reopened - # pull_request: - # branches: [ develop ] - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -#Define Workflow variables -env: - ubuntu_version: focal - chains_release_dir: /opt/runner/chains_release - opal_chain_workdir: ./src_opal_chain - quartz_chain_workdir: ./src_quartz_chain - unique_chain_workdir: ./src_unique_chain - RUST_TOOLCHAIN: nightly-2022-05-11 - REPO_URL: ${{ github.server_url }}/${{ github.repository }} - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - pre-requisites: - # The type of runner that the job will run on - runs-on: self-hosted-ci - - steps: - #runs ssh connection - - name: Install dependencies - run: | - sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang make cmake - sudo apt autoremove - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - . $HOME/.cargo/env && cargo install --locked --git https://github.com/chevdor/subwasm - rustup toolchain install ${{ env.RUST_TOOLCHAIN }} - rustup default ${{ env.RUST_TOOLCHAIN }} - rustup target add wasm32-unknown-unknown --toolchain ${{ env.RUST_TOOLCHAIN }} - - - build: - # The type of runner that the job will run on - runs-on: self-hosted-ci - - needs: pre-requisites - name: Build Container, Spin it Up an test - - continue-on-error: true #Do not stop testing of matrix runs failed. - - strategy: - matrix: - include: - - network: "Opal" - features: " " - - network: "Quartz" - features: "--features=quartz-runtime" - - network: "Unique" - features: "--features=unique-runtime" - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - - - name: Generate ENV related extend file for docker-compose - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/docker-compose.tmp.j2 - output_file: .docker/docker-compose.${{ matrix.network }}.yml - variables: | - REPO_URL=${{ github.server_url }}/${{ github.repository }}.git - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - FEATURE=${{ matrix.features }} - BRANCH=${{ github.head_ref }} - - - name: Show temporary file - run: cat .docker/docker-compose.${{ matrix.network }}.yml - - - name: Build the stack - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build - -# - name: "Build the Docker image with Feature: ${{ env.features }}" -# run: docker build -t build-${{ github.head_ref }} --file .docker/Dockerfile-chain-dev --build-arg REPO_URL=${{ github.server_url }}/${{ github.repository }}.git --build-arg RUST_TOOLCHAIN=${{ env.actual_toolchain }} --build-arg FEATURE="${{ env.features }}" --build-arg BRANCH=${{ github.head_ref }} --no-cache . - - - name: Wait - run: sleep 420s - - - name: Install node - uses: actions/setup-node@v1 - with: - node-version: 14.x - - - name: Install dependencies - run: | - cd tests - yarn install - yarn add mochawesome - yarn --pure-lockfile - - - name: Run tests - run: | - cd tests - NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} - env: - RPC_URL: http://127.0.0.1:9933/ - - - name: Test Report - uses: phoenix-actions/test-reporting@v8 - id: test-report # Set ID reference for step - if: success() || failure() # run this step even if previous step failed - with: - name: Tests ${{ matrix.network }} # Name of the check run which will be created - path: tests/mochawesome-report/test-*.json # Path to test results - reporter: mochawesome-json - fail-on-error: 'false' - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From 2f394b098789794e12c863fe4639d1169455aeb1 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 2 Aug 2022 22:13:06 +0300 Subject: [PATCH 0161/1274] Integration test for pull_request on master branch --- .docker/.env | 7 ++++ .docker/Dockerfile-parachain | 44 ++++++---------------- .docker/Dockerfile-parachain-v2 | 7 ++-- .docker/docker-compose-tests-parachain.yml | 28 +++++++------- .docker/docker-compose.tmp.j2 | 5 +-- 5 files changed, 38 insertions(+), 53 deletions(-) create mode 100644 .docker/.env diff --git a/.docker/.env b/.docker/.env new file mode 100644 index 0000000000..87fcb08dba --- /dev/null +++ b/.docker/.env @@ -0,0 +1,7 @@ +RUST_TOOLCHAIN=nightly-2022-05-11 +RUST_C=1.62.0-nightly +POLKA_VERSION=release-v0.9.24 +UNIQUE_BRANCH=develop +FEATURE='--features=quartz-runtime --release' +USER=*** +PASS=*** diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index 3616b16b76..70cc3ab812 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -3,24 +3,11 @@ FROM phusion/baseimage:focal-1.1.0 as rust-builder LABEL maintainer="Unique.Network" ARG RUST_TOOLCHAIN=nightly-2022-05-11 -#ARG RUST_C=1.62.0-nightly ARG POLKA_VERSION=release-v0.9.24 -ARG UNIQUE_BRANCH=develop - -#ARG USER=*** -#ARG PASS=*** ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN -#ENV RUST_C $RUST_C ENV POLKA_VERSION $POLKA_VERSION -ENV UNIQUE_BRANCH $UNIQUE_BRANCH - - -#RUN echo $RUST_TOOLCHAIN -#RUN echo $RUST_C -#RUN echo $POLKA_VERSION -#RUN echo $UNIQUE_BRANCH ENV CARGO_HOME="/cargo-home" ENV PATH="/cargo-home/bin:$PATH" @@ -38,29 +25,19 @@ RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup show RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN -RUN cargo install cargo-chef - -RUN mkdir unique_parachain -WORKDIR /unique_parachain - -# ===== Chef ===== -FROM rust-builder as chef +####works inside repo folder### -COPY . . -RUN cargo chef prepare --recipe-path recipe.json # ===== BUILD ====== -FROM rust-builder as builder +FROM rust-builder as builder-unique RUN mkdir unique_parachain WORKDIR /unique_parachain -COPY --from=chef /unique_parachain/recipe.json recipe.json -ARG PROFILE=release -RUN cargo chef cook "--$PROFILE" --recipe-path recipe.json +ARG FEATURE='--release' COPY . . -RUN cargo build "--$PROFILE" +RUN cargo build $FEATURE # && \ # cargo test @@ -79,8 +56,6 @@ RUN git clone -b $POLKA_VERSION --depth 1 https://github.com/paritytech/polkadot FROM phusion/baseimage:focal-1.1.0 -ARG PROFILE=release - RUN apt-get -y update && \ apt-get -y upgrade && \ apt-get -y install curl git && \ @@ -90,7 +65,9 @@ RUN apt-get -y update && \ nvm install v15.5.0 && \ nvm use v15.5.0 -RUN git clone https://github.com/paritytech/polkadot-launch +RUN git clone https://github.com/UniqueNetwork/polkadot-launch.git && \ + cd /polkadot-launch && \ + git checkout feature/runtime-upgrade-testing RUN export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ @@ -98,8 +75,11 @@ RUN export NVM_DIR="$HOME/.nvm" && \ npm install --global yarn && \ yarn -COPY --from=builder /unique_parachain/target/$PROFILE/unique-collator /unique-chain/target/$PROFILE/ -COPY --from=builder-polkadot /unique_parachain/polkadot/target/$PROFILE/polkadot /polkadot/target/$PROFILE/ +COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ + +COPY ["./launch-config.json", "/polkadot-launch/launch-config.json"] + EXPOSE 9844 EXPOSE 9944 diff --git a/.docker/Dockerfile-parachain-v2 b/.docker/Dockerfile-parachain-v2 index efe86335ac..07876d49fa 100644 --- a/.docker/Dockerfile-parachain-v2 +++ b/.docker/Dockerfile-parachain-v2 @@ -34,10 +34,12 @@ FROM rust-builder as builder-unique RUN mkdir unique_parachain WORKDIR /unique_parachain -ARG PROFILE='features=quartz-runtime --release' +ARG PROFILE='features=quartz-runtime' + +ENV PROFILE $PROFILE COPY . . -RUN cargo build --features=quartz-runtime --release +RUN cargo build --$PROFILE # && \ # cargo test @@ -56,7 +58,6 @@ RUN git clone -b $POLKA_VERSION --depth 1 https://github.com/paritytech/polkadot FROM phusion/baseimage:focal-1.1.0 -#ARG PROFILE='--features=quartz-runtime --release' RUN apt-get -y update && \ apt-get -y upgrade && \ diff --git a/.docker/docker-compose-tests-parachain.yml b/.docker/docker-compose-tests-parachain.yml index ad91a80b5c..fd5f866606 100644 --- a/.docker/docker-compose-tests-parachain.yml +++ b/.docker/docker-compose-tests-parachain.yml @@ -3,26 +3,26 @@ version: "3.5" services: blockchain_nodes: build: - context: ./ - dockerfile: Dockerfile-parachain + context: ../ + dockerfile: .docker/Dockerfile-parachain args: - RUST_TOOLCHAIN=${RUST_TOOLCHAIN:?err} - RUST_C=${RUST_C:?err} - POLKA_VERSION=${POLKA_VERSION:?err} - - UNIQUE_BRANCH=${UNIQUE_BRANCH:?err} + - FEATURE=${FEATURE:?err} volumes: - ./launch-config.json:/polkadot-launch/launch-config.json env_file: - ./.env - integration_tests: - build: - context: tests/ - dockerfile: Dockerfile-tests - environment: - RPC_URL: http://blockchain_nodes:9933/ - volumes: - - ./tests/src/config_docker.ts:/unique_parachain/src/config.ts - - /home/ubuntu/mochawesome-report:/unique_parachain/mochawesome-report - depends_on: - - blockchain_nodes +# integration_tests: +# build: +# context: tests/ +# dockerfile: Dockerfile-tests +# environment: +# RPC_URL: http://blockchain_nodes:9933/ +# volumes: +# - ./tests/src/config_docker.ts:/unique_parachain/src/config.ts +# - /home/ubuntu/mochawesome-report:/unique_parachain/mochawesome-report +# depends_on: +# - blockchain_nodes diff --git a/.docker/docker-compose.tmp.j2 b/.docker/docker-compose.tmp.j2 index a706a2824f..8701fad29c 100644 --- a/.docker/docker-compose.tmp.j2 +++ b/.docker/docker-compose.tmp.j2 @@ -1,13 +1,10 @@ version: "3.5" services: - node-o: + blockchain_nodes: build: args: - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - "BRANCH={{ BRANCH }}" - "REPO_URL={{ REPO_URL }}" - "FEATURE={{ FEATURE }}" - - command: cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external - From d5ca153d830182119d8ae1e5c40a5205038444dd Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 2 Aug 2022 22:20:01 +0300 Subject: [PATCH 0162/1274] FIX: Added additional Jinja2 template. --- .docker/docker-compose.tmp-master.j2 | 10 ++++++++++ .docker/docker-compose.tmp.j2 | 2 ++ .github/workflows/build-test-master.yml | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .docker/docker-compose.tmp-master.j2 diff --git a/.docker/docker-compose.tmp-master.j2 b/.docker/docker-compose.tmp-master.j2 new file mode 100644 index 0000000000..8701fad29c --- /dev/null +++ b/.docker/docker-compose.tmp-master.j2 @@ -0,0 +1,10 @@ +version: "3.5" + +services: + blockchain_nodes: + build: + args: + - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" + - "BRANCH={{ BRANCH }}" + - "REPO_URL={{ REPO_URL }}" + - "FEATURE={{ FEATURE }}" diff --git a/.docker/docker-compose.tmp.j2 b/.docker/docker-compose.tmp.j2 index 8701fad29c..bb24644e7a 100644 --- a/.docker/docker-compose.tmp.j2 +++ b/.docker/docker-compose.tmp.j2 @@ -8,3 +8,5 @@ services: - "BRANCH={{ BRANCH }}" - "REPO_URL={{ REPO_URL }}" - "FEATURE={{ FEATURE }}" + + command: cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml index a766d15250..3c5027ae9e 100644 --- a/.github/workflows/build-test-master.yml +++ b/.github/workflows/build-test-master.yml @@ -72,7 +72,7 @@ jobs: - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 with: - template: .docker/docker-compose.tmp.j2 + template: .docker/docker-compose.tmp-master.j2 output_file: .docker/docker-compose.${{ matrix.network }}.yml variables: | REPO_URL=${{ github.server_url }}/${{ github.repository }}.git @@ -84,7 +84,7 @@ jobs: run: cat .docker/docker-compose.${{ matrix.network }}.yml - name: Build the stack - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build + run: docker-compose -f ".docker/docker-compose-tests-parachain.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build # - name: "Build the Docker image with Feature: ${{ env.features }}" # run: docker build -t build-${{ github.head_ref }} --file .docker/Dockerfile-chain-dev --build-arg REPO_URL=${{ github.server_url }}/${{ github.repository }}.git --build-arg RUST_TOOLCHAIN=${{ env.actual_toolchain }} --build-arg FEATURE="${{ env.features }}" --build-arg BRANCH=${{ github.head_ref }} --no-cache . From fe364df3ac549d379dac8e849bcc8e7573c216c3 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 2 Aug 2022 22:22:22 +0300 Subject: [PATCH 0163/1274] FIX: Added missed space for proper YAM Syntax. --- .docker/docker-compose.tmp.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.docker/docker-compose.tmp.j2 b/.docker/docker-compose.tmp.j2 index bb24644e7a..6c1036de0f 100644 --- a/.docker/docker-compose.tmp.j2 +++ b/.docker/docker-compose.tmp.j2 @@ -8,5 +8,5 @@ services: - "BRANCH={{ BRANCH }}" - "REPO_URL={{ REPO_URL }}" - "FEATURE={{ FEATURE }}" - - command: cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external + + command: cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external From 9e906519a991b856d444161514953cf4d128e9d1 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 2 Aug 2022 22:38:45 +0300 Subject: [PATCH 0164/1274] Ammended build command: added "--release" annotation. --- .docker/Dockerfile-parachain | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index 70cc3ab812..516705177d 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -34,10 +34,10 @@ FROM rust-builder as builder-unique RUN mkdir unique_parachain WORKDIR /unique_parachain -ARG FEATURE='--release' +ARG FEATURE=' ' COPY . . -RUN cargo build $FEATURE +RUN cargo build $FEATURE --release # && \ # cargo test From fa35d148884fda6f4e88b4e2a4b87115c5af2c5e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 2 Aug 2022 22:45:02 +0300 Subject: [PATCH 0165/1274] Hanged path to Dockerfile-chain-dev and service name in Jinja2 template. --- .docker/docker-compose-dev.yaml | 4 ++-- .docker/docker-compose.tmp.j2 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.docker/docker-compose-dev.yaml b/.docker/docker-compose-dev.yaml index 2ca4cdf630..39d6f81cfc 100644 --- a/.docker/docker-compose-dev.yaml +++ b/.docker/docker-compose-dev.yaml @@ -3,8 +3,8 @@ version: "3.5" services: node-o: build: - context: . - dockerfile: Dockerfile-chain-dev + context: ../ + dockerfile: .docker/Dockerfile-chain-dev image: node-o container_name: node-o expose: diff --git a/.docker/docker-compose.tmp.j2 b/.docker/docker-compose.tmp.j2 index 6c1036de0f..181943d80a 100644 --- a/.docker/docker-compose.tmp.j2 +++ b/.docker/docker-compose.tmp.j2 @@ -1,7 +1,7 @@ version: "3.5" services: - blockchain_nodes: + node-o: build: args: - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" From ba2b5f3c9ea82ccd6104f3ece937565087a098dc Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 2 Aug 2022 23:04:00 +0300 Subject: [PATCH 0166/1274] Removed to get rid duplication --release arg during container run --- .docker/docker-compose.tmp.j2 | 2 -- 1 file changed, 2 deletions(-) diff --git a/.docker/docker-compose.tmp.j2 b/.docker/docker-compose.tmp.j2 index 181943d80a..8d8e8e8c62 100644 --- a/.docker/docker-compose.tmp.j2 +++ b/.docker/docker-compose.tmp.j2 @@ -8,5 +8,3 @@ services: - "BRANCH={{ BRANCH }}" - "REPO_URL={{ REPO_URL }}" - "FEATURE={{ FEATURE }}" - - command: cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external From 384f4d9ee69ad08e1f87997626ec375914f7867d Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 3 Aug 2022 00:29:38 +0300 Subject: [PATCH 0167/1274] Changed path to launch-config.json and remove "--release" annotation --- .docker/.env | 2 +- .docker/docker-compose-tests-parachain.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.docker/.env b/.docker/.env index 87fcb08dba..e3e3073e5a 100644 --- a/.docker/.env +++ b/.docker/.env @@ -2,6 +2,6 @@ RUST_TOOLCHAIN=nightly-2022-05-11 RUST_C=1.62.0-nightly POLKA_VERSION=release-v0.9.24 UNIQUE_BRANCH=develop -FEATURE='--features=quartz-runtime --release' +FEATURE='--features=quartz-runtime' USER=*** PASS=*** diff --git a/.docker/docker-compose-tests-parachain.yml b/.docker/docker-compose-tests-parachain.yml index fd5f866606..82c11f605a 100644 --- a/.docker/docker-compose-tests-parachain.yml +++ b/.docker/docker-compose-tests-parachain.yml @@ -11,7 +11,7 @@ services: - POLKA_VERSION=${POLKA_VERSION:?err} - FEATURE=${FEATURE:?err} volumes: - - ./launch-config.json:/polkadot-launch/launch-config.json + - ../launch-config.json:/polkadot-launch/launch-config.json env_file: - ./.env From 3830b308c2d950d41ee03605df8533b16f61bebb Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 3 Aug 2022 08:31:54 +0300 Subject: [PATCH 0168/1274] Enable dockerised integration tests --- .docker/docker-compose-tests-parachain.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.docker/docker-compose-tests-parachain.yml b/.docker/docker-compose-tests-parachain.yml index 82c11f605a..2c8acec5b3 100644 --- a/.docker/docker-compose-tests-parachain.yml +++ b/.docker/docker-compose-tests-parachain.yml @@ -15,14 +15,14 @@ services: env_file: - ./.env -# integration_tests: -# build: -# context: tests/ -# dockerfile: Dockerfile-tests -# environment: -# RPC_URL: http://blockchain_nodes:9933/ -# volumes: -# - ./tests/src/config_docker.ts:/unique_parachain/src/config.ts -# - /home/ubuntu/mochawesome-report:/unique_parachain/mochawesome-report -# depends_on: -# - blockchain_nodes + integration_tests: + build: + context: ../tests/ + dockerfile: Dockerfile-tests + environment: + RPC_URL: http://blockchain_nodes:9933/ + volumes: + - ./tests/src/config_docker.ts:/unique_parachain/src/config.ts + - /home/ubuntu/mochawesome-report:/unique_parachain/mochawesome-report + depends_on: + - blockchain_nodes From be7dde517c67cc4490a2e121701e1766ea6218ec Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 3 Aug 2022 09:00:55 +0300 Subject: [PATCH 0169/1274] Context path has been changed --- .docker/docker-compose-tests-parachain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/docker-compose-tests-parachain.yml b/.docker/docker-compose-tests-parachain.yml index 2c8acec5b3..82843b6fbd 100644 --- a/.docker/docker-compose-tests-parachain.yml +++ b/.docker/docker-compose-tests-parachain.yml @@ -18,7 +18,7 @@ services: integration_tests: build: context: ../tests/ - dockerfile: Dockerfile-tests + dockerfile: .docker/Dockerfile-tests environment: RPC_URL: http://blockchain_nodes:9933/ volumes: From e2d9909ea360a5c422436d25e392cdf0e77993ee Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 3 Aug 2022 09:05:35 +0300 Subject: [PATCH 0170/1274] Changed path to DOckerfile --- .docker/docker-compose-tests-parachain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/docker-compose-tests-parachain.yml b/.docker/docker-compose-tests-parachain.yml index 82843b6fbd..2c8acec5b3 100644 --- a/.docker/docker-compose-tests-parachain.yml +++ b/.docker/docker-compose-tests-parachain.yml @@ -18,7 +18,7 @@ services: integration_tests: build: context: ../tests/ - dockerfile: .docker/Dockerfile-tests + dockerfile: Dockerfile-tests environment: RPC_URL: http://blockchain_nodes:9933/ volumes: From bb6d71bbdc4d5eaa6f6f22b79de3b125297f1712 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Wed, 3 Aug 2022 06:36:39 +0000 Subject: [PATCH 0171/1274] chore: add transfer events for transfering from and to partial ownership --- pallets/refungible/src/erc.rs | 30 ++++------- pallets/refungible/src/lib.rs | 55 ++++++++++++++++--- tests/src/eth/reFungible.test.ts | 92 +++++++++++++++++++++++++++++++- 3 files changed, 150 insertions(+), 27 deletions(-) diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 9aa6f100f1..4f3e25c57c 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -34,9 +34,8 @@ use pallet_common::{ CommonEvmHandler, CollectionCall, static_property::{key, value as property_value}, }, - eth::collection_id_to_address, }; -use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm, PrecompileHandle}; +use pallet_evm::{account::CrossAccountId, PrecompileHandle}; use pallet_evm_coder_substrate::{call, dispatch_to_evm}; use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _}; use sp_core::H160; @@ -51,6 +50,8 @@ use crate::{ TokenProperties, TokensMinted, TotalSupply, weights::WeightInfo, }; +pub const ADDRESS_FOR_PARTIALLY_OWNED_TOKENS: H160 = H160::repeat_byte(0xff); + /// @title A contract that allows to set and delete token properties and change token property permissions. #[solidity_interface(name = "TokenProperties")] impl RefungibleHandle { @@ -298,13 +299,20 @@ impl RefungibleHandle { Ok(balance.into()) } + /// @notice Find the owner of an RFT + /// @dev RFTs assigned to zero address are considered invalid, and queries + /// about them do throw. + /// Returns special 0xffffffffffffffffffffffffffffffffffffffff address for + /// the tokens that are partially owned. + /// @param tokenId The identifier for an RFT + /// @return The address of the owner of the RFT fn owner_of(&self, token_id: uint256) -> Result
{ self.consume_store_reads(2)?; let token = token_id.try_into()?; let owner = >::token_owner(self.id, token); Ok(owner .map(|address| *address.as_eth()) - .unwrap_or_else(|| H160::default())) + .unwrap_or_else(|| ADDRESS_FOR_PARTIALLY_OWNED_TOKENS)) } /// @dev Not implemented @@ -366,14 +374,6 @@ impl RefungibleHandle { >::transfer_from(self, &caller, &from, &to, token, balance, &budget) .map_err(dispatch_to_evm::)?; - >::deposit_log( - ERC721Events::Transfer { - from: *from.as_eth(), - to: *to.as_eth(), - token_id: token_id.into(), - } - .to_log(collection_id_to_address(self.id)), - ); Ok(()) } @@ -652,14 +652,6 @@ impl RefungibleHandle { >::transfer(self, &caller, &to, token, balance, &budget) .map_err(dispatch_to_evm::)?; - >::deposit_log( - ERC721Events::Transfer { - from: *caller.as_eth(), - to: *to.as_eth(), - token_id: token_id.into(), - } - .to_log(collection_id_to_address(self.id)), - ); Ok(()) } diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 21e1a3e00c..65fa5c5ff9 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -707,12 +707,13 @@ impl Pallet { } >::ensure_correct_receiver(to)?; - let balance_from = >::get((collection.id, token, from)) + let initial_balance_from = >::get((collection.id, token, from)); + let updated_balance_from = initial_balance_from .checked_sub(amount) .ok_or(>::TokenValueTooLow)?; let mut create_target = false; let from_to_differ = from != to; - let balance_to = if from != to { + let updated_balance_to = if from != to { let old_balance = >::get((collection.id, token, to)); if old_balance == 0 { create_target = true; @@ -726,7 +727,7 @@ impl Pallet { None }; - let account_balance_from = if balance_from == 0 { + let account_balance_from = if updated_balance_from == 0 { Some( >::get((collection.id, from)) .checked_sub(1) @@ -762,15 +763,15 @@ impl Pallet { nesting_budget, )?; - if let Some(balance_to) = balance_to { + if let Some(updated_balance_to) = updated_balance_to { // from != to - if balance_from == 0 { + if updated_balance_from == 0 { >::remove((collection.id, token, from)); >::unnest_if_nested(from, collection.id, token); } else { - >::insert((collection.id, token, from), balance_from); + >::insert((collection.id, token, from), updated_balance_from); } - >::insert((collection.id, token, to), balance_to); + >::insert((collection.id, token, to), updated_balance_to); if let Some(account_balance_from) = account_balance_from { >::insert((collection.id, from), account_balance_from); >::remove((collection.id, from, token)); @@ -800,6 +801,46 @@ impl Pallet { to.clone(), amount, )); + + let total_supply = >::get((collection.id, token)); + + if amount == total_supply { + // if token was fully owned by `from` and will be fully owned by `to` after transfer + >::deposit_log( + ERC721Events::Transfer { + from: *from.as_eth(), + to: *to.as_eth(), + token_id: token.into(), + } + .to_log(collection_id_to_address(collection.id)), + ); + } else if let Some(updated_balance_to) = updated_balance_to { + // if `from` not equals `to`. This condition is needed to avoid sending event + // when `from` fully owns token and sends part of token pieces to itself. + if initial_balance_from == total_supply { + // if token was fully owned by `from` and will be only partially owned by `to` + // and `from` after transfer + >::deposit_log( + ERC721Events::Transfer { + from: *from.as_eth(), + to: erc::ADDRESS_FOR_PARTIALLY_OWNED_TOKENS, + token_id: token.into(), + } + .to_log(collection_id_to_address(collection.id)), + ); + } else if updated_balance_to == total_supply { + // if token was partially owned by `from` and will be fully owned by `to` after transfer + >::deposit_log( + ERC721Events::Transfer { + from: erc::ADDRESS_FOR_PARTIALLY_OWNED_TOKENS, + to: *to.as_eth(), + token_id: token.into(), + } + .to_log(collection_id_to_address(collection.id)), + ); + } + } + Ok(()) } diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 55b5c2b1cf..7291951806 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {createCollectionExpectSuccess, UNIQUE} from '../util/helpers'; +import {createCollectionExpectSuccess, transfer, UNIQUE} from '../util/helpers'; import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, tokenIdToAddress} from './util/helpers'; import reFungibleAbi from './reFungibleAbi.json'; import reFungibleTokenAbi from './reFungibleTokenAbi.json'; @@ -96,6 +96,28 @@ describe('Refungible: Information getting', () => { expect(owner).to.equal(receiver); }); + + itWeb3('ownerOf for partial ownership', async ({api, web3, privateKeyWrapper}) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const receiver = createEthAccount(web3); + const helper = evmCollectionHelpers(web3, caller); + const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + + const tokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint(caller, tokenId).send(); + + const tokenAddress = tokenIdToAddress(collectionId, tokenId); + const tokenContract = new web3.eth.Contract(reFungibleTokenAbi as any, tokenAddress, {from: caller, ...GAS_ARGS}); + + await tokenContract.methods.repartition(2).send(); + await tokenContract.methods.transfer(receiver, 1).send(); + + const owner = await contract.methods.ownerOf(tokenId).call(); + + expect(owner).to.equal('0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF'); + }); }); describe('Refungible: Plain calls', () => { @@ -293,6 +315,74 @@ describe('Refungible: Plain calls', () => { expect(+balance).to.equal(1); } }); + + itWeb3('transfer event on transfer from partial ownership to full ownership', async ({api, web3, privateKeyWrapper}) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const receiver = createEthAccount(web3); + const helper = evmCollectionHelpers(web3, caller); + const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + + const tokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint(caller, tokenId).send(); + + const tokenAddress = tokenIdToAddress(collectionId, tokenId); + const tokenContract = new web3.eth.Contract(reFungibleTokenAbi as any, tokenAddress, {from: caller, ...GAS_ARGS}); + + await tokenContract.methods.repartition(2).send(); + await tokenContract.methods.transfer(receiver, 1).send(); + + let transfer; + contract.events.Transfer({}, function(_error: any, event: any){ transfer = event;}); + await tokenContract.methods.transfer(receiver, 1).send(); + const events = normalizeEvents([transfer]); + expect(events).to.deep.equal([ + { + address: collectionIdAddress, + event: 'Transfer', + args: { + from: '0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF', + to: receiver, + tokenId: tokenId.toString(), + }, + }, + ]); + }); + + itWeb3('transfer event on transfer from full ownership to partial ownership', async ({api, web3, privateKeyWrapper}) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const receiver = createEthAccount(web3); + const helper = evmCollectionHelpers(web3, caller); + const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + + const tokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint(caller, tokenId).send(); + + const tokenAddress = tokenIdToAddress(collectionId, tokenId); + const tokenContract = new web3.eth.Contract(reFungibleTokenAbi as any, tokenAddress, {from: caller, ...GAS_ARGS}); + + await tokenContract.methods.repartition(2).send(); + + let transfer; + contract.events.Transfer({}, function(_error: any, event: any){ transfer = event;}); + await tokenContract.methods.transfer(receiver, 1).send(); + + const events = normalizeEvents([transfer]); + expect(events).to.deep.equal([ + { + address: collectionIdAddress, + event: 'Transfer', + args: { + from: caller, + to: '0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF', + tokenId: tokenId.toString(), + }, + }, + ]); + }); }); describe('RFT: Fees', () => { From 826ecefab3c1b1e7247ccd6c92b574f6c58e103f Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 3 Aug 2022 09:46:32 +0300 Subject: [PATCH 0172/1274] Changed filenames for docker-compose. Temporary disabled demolition of stack. --- .github/workflows/build-test-master.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml index 3c5027ae9e..4f7c7c2c0d 100644 --- a/.github/workflows/build-test-master.yml +++ b/.github/workflows/build-test-master.yml @@ -121,6 +121,6 @@ jobs: reporter: mochawesome-json fail-on-error: 'false' - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + # - name: Stop running containers + # if: always() # run this step always + # run: docker-compose -f ".docker/docker-compose-tests-parachain.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From dab0d12891586edb6bc5c420edaffa52b112e524 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 3 Aug 2022 09:51:12 +0300 Subject: [PATCH 0173/1274] Switched back to tests without docker container. --- .docker/docker-compose-tests-parachain.yml | 28 +++++++++++++--------- .github/workflows/build-test-master.yml | 6 ++--- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.docker/docker-compose-tests-parachain.yml b/.docker/docker-compose-tests-parachain.yml index 2c8acec5b3..c2578b80a0 100644 --- a/.docker/docker-compose-tests-parachain.yml +++ b/.docker/docker-compose-tests-parachain.yml @@ -14,15 +14,21 @@ services: - ../launch-config.json:/polkadot-launch/launch-config.json env_file: - ./.env + expose: + - 9944 + - 9933 + ports: + - 127.0.0.1:9944:9944 + - 127.0.0.1:9933:9933 - integration_tests: - build: - context: ../tests/ - dockerfile: Dockerfile-tests - environment: - RPC_URL: http://blockchain_nodes:9933/ - volumes: - - ./tests/src/config_docker.ts:/unique_parachain/src/config.ts - - /home/ubuntu/mochawesome-report:/unique_parachain/mochawesome-report - depends_on: - - blockchain_nodes +# integration_tests: +# build: +# context: ../tests/ +# dockerfile: Dockerfile-tests +# environment: +# RPC_URL: http://blockchain_nodes:9933/ +# volumes: +# - ./tests/src/config_docker.ts:/unique_parachain/src/config.ts +# - /home/ubuntu/mochawesome-report:/unique_parachain/mochawesome-report +# depends_on: +# - blockchain_nodes diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml index 4f7c7c2c0d..a5e0891d40 100644 --- a/.github/workflows/build-test-master.yml +++ b/.github/workflows/build-test-master.yml @@ -121,6 +121,6 @@ jobs: reporter: mochawesome-json fail-on-error: 'false' - # - name: Stop running containers - # if: always() # run this step always - # run: docker-compose -f ".docker/docker-compose-tests-parachain.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-tests-parachain.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From b8cfc48b8ec6bec02351223cae9c395cef67d668 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 3 Aug 2022 18:03:55 +0300 Subject: [PATCH 0174/1274] SpeedUp build by adding cargo-chef into Dockerfile. --- .docker/Dockerfile-parachain | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index 516705177d..3f87510dd9 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -16,7 +16,9 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none RUN apt-get update && \ apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \ - apt-get install -y cmake pkg-config libssl-dev git clang + apt-get install -y cmake pkg-config libssl-dev git clang && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup toolchain install $RUST_TOOLCHAIN && \ @@ -25,6 +27,18 @@ RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup show RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN + +RUN cargo install cargo-chef + +RUN mkdir unique_parachain +WORKDIR /unique_parachain + +# ===== Chef ===== +FROM rust-builder as chef + +COPY . . +RUN cargo chef prepare --recipe-path recipe.json + ####works inside repo folder### @@ -34,6 +48,10 @@ FROM rust-builder as builder-unique RUN mkdir unique_parachain WORKDIR /unique_parachain +COPY --from=chef /unique_parachain/recipe.json recipe.json + +RUN cargo chef cook --release --recipe-path recipe.json + ARG FEATURE=' ' COPY . . From 9d3564ef2b56e9a05cb7f3bcd3a34c3d6962f942 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Wed, 3 Aug 2022 15:29:22 +0000 Subject: [PATCH 0175/1274] chore: add transfer event for `burn` and `create_multiple_items` --- pallets/refungible/src/lib.rs | 66 +++++++++++++++++++++------ tests/src/eth/reFungible.test.ts | 19 +++----- tests/src/eth/reFungibleToken.test.ts | 36 ++++++++++++++- 3 files changed, 92 insertions(+), 29 deletions(-) diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 65fa5c5ff9..4e6ad523d5 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -399,6 +399,7 @@ impl Pallet { pub fn burn_token_unchecked( collection: &RefungibleHandle, + owner: &T::CrossAccountId, token_id: TokenId, ) -> DispatchResult { let burnt = >::get(collection.id) @@ -411,7 +412,15 @@ impl Pallet { >::remove((collection.id, token_id)); >::remove_prefix((collection.id, token_id), None); >::remove_prefix((collection.id, token_id), None); - // TODO: ERC721 transfer event + + >::deposit_log( + ERC721Events::Transfer { + from: *owner.as_eth(), + to: H160::default(), + token_id: token_id.into(), + } + .to_log(collection_id_to_address(collection.id)), + ); Ok(()) } @@ -453,12 +462,12 @@ impl Pallet { >::remove((collection.id, owner, token)); >::unnest_if_nested(owner, collection.id, token); >::insert((collection.id, owner), account_balance); - Self::burn_token_unchecked(collection, token)?; + Self::burn_token_unchecked(collection, owner, token)?; >::deposit_log( - ERC721Events::Transfer { + ERC20Events::Transfer { from: *owner.as_eth(), to: H160::default(), - token_id: token.into(), + value: amount.into(), } .to_log(collection_id_to_address(collection.id)), ); @@ -490,6 +499,17 @@ impl Pallet { >::unnest_if_nested(owner, collection.id, token); >::remove((collection.id, token, owner)); >::insert((collection.id, owner), account_balance); + + if let Some(user) = Self::token_owner(collection.id, token) { + >::deposit_log( + ERC721Events::Transfer { + from: erc::ADDRESS_FOR_PARTIALLY_OWNED_TOKENS, + to: *user.as_eth(), + token_id: token.into(), + } + .to_log(collection_id_to_address(collection.id)), + ); + } } else { >::insert((collection.id, token, owner), balance); } @@ -981,30 +1001,46 @@ impl Pallet { for (i, token) in data.into_iter().enumerate() { let token_id = first_token_id + i as u32 + 1; - for (user, amount) in token.users.into_iter() { - if amount == 0 { - continue; - } + let receivers = token + .users + .into_iter() + .filter(|(_, amount)| *amount > 0) + .collect::>(); + if let [(user, _)] = receivers.as_slice() { + // if there is exactly one receiver >::deposit_log( - ERC20Events::Transfer { + ERC721Events::Transfer { from: H160::default(), to: *user.as_eth(), - value: amount.into(), + token_id: token_id.into(), } - .to_log(T::EvmTokenAddressMapping::token_to_address( - collection.id, - TokenId(token_id), - )), + .to_log(collection_id_to_address(collection.id)), ); + } else if let [_, ..] = receivers.as_slice() { + // if there is more than one receiver >::deposit_log( ERC721Events::Transfer { from: H160::default(), - to: *user.as_eth(), + to: erc::ADDRESS_FOR_PARTIALLY_OWNED_TOKENS, token_id: token_id.into(), } .to_log(collection_id_to_address(collection.id)), ); + } + + for (user, amount) in receivers.into_iter() { + >::deposit_log( + ERC20Events::Transfer { + from: H160::default(), + to: *user.as_eth(), + value: amount.into(), + } + .to_log(T::EvmTokenAddressMapping::token_to_address( + collection.id, + TokenId(token_id), + )), + ); >::deposit_event(CommonEvent::ItemCreated( collection.id, TokenId(token_id), diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 7291951806..3e1ecec6da 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {createCollectionExpectSuccess, transfer, UNIQUE} from '../util/helpers'; -import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, tokenIdToAddress} from './util/helpers'; +import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, tokenIdToAddress} from './util/helpers'; import reFungibleAbi from './reFungibleAbi.json'; import reFungibleTokenAbi from './reFungibleTokenAbi.json'; import {expect} from 'chai'; @@ -224,8 +224,7 @@ describe('Refungible: Plain calls', () => { { const result = await contract.methods.burn(tokenId).send(); const events = normalizeEvents(result.events); - - expect(events).to.be.deep.equal([ + expect(events).to.include.deep.members([ { address: collectionIdAddress, event: 'Transfer', @@ -333,10 +332,8 @@ describe('Refungible: Plain calls', () => { await tokenContract.methods.repartition(2).send(); await tokenContract.methods.transfer(receiver, 1).send(); - let transfer; - contract.events.Transfer({}, function(_error: any, event: any){ transfer = event;}); - await tokenContract.methods.transfer(receiver, 1).send(); - const events = normalizeEvents([transfer]); + const events = await recordEvents(contract, async () => + await tokenContract.methods.transfer(receiver, 1).send()); expect(events).to.deep.equal([ { address: collectionIdAddress, @@ -366,11 +363,9 @@ describe('Refungible: Plain calls', () => { await tokenContract.methods.repartition(2).send(); - let transfer; - contract.events.Transfer({}, function(_error: any, event: any){ transfer = event;}); - await tokenContract.methods.transfer(receiver, 1).send(); - - const events = normalizeEvents([transfer]); + const events = await recordEvents(contract, async () => + await tokenContract.methods.transfer(receiver, 1).send()); + expect(events).to.deep.equal([ { address: collectionIdAddress, diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 669dd9a1fb..16d959bb56 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -277,7 +277,7 @@ describe('Refungible: Plain calls', () => { { const result = await contract.methods.transferFrom(owner, receiver, 49).send({from: spender}); const events = normalizeEvents(result.events); - expect(events).to.be.deep.equal([ + expect(events).to.include.deep.members([ { address, event: 'Transfer', @@ -329,7 +329,7 @@ describe('Refungible: Plain calls', () => { { const result = await contract.methods.transfer(receiver, 50).send({from: owner}); const events = normalizeEvents(result.events); - expect(events).to.be.deep.equal([ + expect(events).to.include.deep.members([ { address, event: 'Transfer', @@ -442,6 +442,38 @@ describe('Refungible: Plain calls', () => { }, ]); }); + + itWeb3('Receiving Transfer event on burning into full ownership', async ({web3, api, privateKeyWrapper}) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const receiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const helper = evmCollectionHelpers(web3, caller); + const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + + const tokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint(caller, tokenId).send(); + + const address = tokenIdToAddress(collectionId, tokenId); + + const tokenContract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: caller, ...GAS_ARGS}); + await tokenContract.methods.repartition(2).send(); + await tokenContract.methods.transfer(receiver, 1).send(); + + const events = await recordEvents(contract, async () => + await tokenContract.methods.burnFrom(caller, 1).send()); + expect(events).to.deep.equal([ + { + address: collectionIdAddress, + event: 'Transfer', + args: { + from: '0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF', + to: receiver, + tokenId, + }, + }, + ]); + }); }); describe('Refungible: Fees', () => { From a7dc6fb04f611ecac4395d3cdfa38ccb8a944ed8 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 3 Aug 2022 19:30:27 +0200 Subject: [PATCH 0176/1274] fix: upgrade pallet storage to v2 --- pallets/refungible/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index fdd31ad795..3ba012d58c 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -267,7 +267,7 @@ pub mod pallet { if storage_version < StorageVersion::new(2) { >::remove_all(None); } - StorageVersion::new(1).put::>(); + StorageVersion::new(2).put::>(); 0 } From 6fca5f33938a5f7da138e5d1c70ebe36487ce166 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 3 Aug 2022 18:05:46 +0000 Subject: [PATCH 0177/1274] chore: regenerate evm-coder files --- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 3975 -> 4116 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 10 +++++-- .../refungible/src/stubs/UniqueRefungible.raw | Bin 2199 -> 2336 bytes .../src/stubs/UniqueRefungibleToken.raw | Bin 1340 -> 1477 bytes .../src/eth/stubs/CollectionHelpers.raw | Bin 1340 -> 1488 bytes .../src/eth/stubs/CollectionHelpers.sol | 28 +++++++++++++++++- tests/src/eth/api/CollectionHelpers.sol | 20 ++++++++++++- tests/src/eth/api/UniqueNFT.sol | 10 +++++-- tests/src/eth/collectionHelpersAbi.json | 12 ++++++++ 9 files changed, 72 insertions(+), 8 deletions(-) diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 5b50478e513055544d0d034d0ea76c2577dccd95..c4699d86ccce797dc6b314d998723ecba30d0fb4 100644 GIT binary patch delta 546 zcmYk2KWN)P6vpq>32mT`>|m=H8LWg*lBpd+OSY6OURqAV(gkkFv(u#z5=xea4APw? zCnn1oyMM-vnF?)|Oc^_MYKB57)MKGg+NoYb^CTz~ai`2zNpi?1Z_FgOk6)|2MJa~wO!e0+pcJ}x4=k_bxG zjkaT|?+A>vJ>U{uT~Y;7y5fJ=LgtEc8y^@RN^IzI7WA2dhz4EdVj~5dt}8&dSIX|* z3m#Kpu4O6B^c&?-OxD!CwH&a)Ltrhwo_4{L$ZA;V8K+*e5mMvaNdxj-l8>eTsB1lYAa#xg z`{Jkvo(@I{jOb+tU=qTF4Z=+IN=6TF#9<0v-uTEkII*d>3bGM6CyR2x1T;;1_5nRC zoS!YjyQ1?!w2Qwf^)H2KKdDx6+R^ZelREr0TPgn#s+DN)O$w$D?c%3l)tX=aGxydz se)jS9xAnQ!ifFgNusyCsif#)HO4Z{UnTs|uTVn!9+bp4^2-+r1Ax*;_ zDKHVG>ChKR{ECNGUO?ABCIA5nY1J^g^Nj+oWXJEKk}6IAfYC&0_+8LT)E-Kv(H?2j z9_K>+@E^!grin?=lgAOH?9s{+w7&TmD$6(=Z53^iO%$ZtZ1%PWZ6gH3aODPWBH_Is zL~11bitk&>Eh;#6eh=(WQbtWF`M!*H29Z}^ruG!Lx&ZnBf(U(*hZD!)&e7Sa^H<*I zRd#)QHMi6sv!BP;Zbx_LuXidR=ZjTi_09EV-|hOcTkMeKndVqFx7D(-GRs=q%C+{v EZ>pP&xc~qF diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index cb4c83466a..bef56e99f7 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -300,9 +300,13 @@ contract ERC721Metadata is Dummy, ERC165 { } // @notice A distinct Uniform Resource Identifier (URI) for a given asset. - // @dev Throws if `tokenId` is not a valid NFT. URIs are defined in RFC - // 3986. The URI may point to a JSON file that conforms to the "ERC721 - // Metadata JSON Schema". + // + // @dev If the token has a `url` property and it is not empty, it is returned. + // Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + // If the collection property `baseURI` is empty or absent, return "" (empty string) + // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). + // // @return token's const_metadata // // Selector: tokenURI(uint256) c87b56dd diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index 2f1d678ef5e86e7615feb7375da0608f1a2d484d..542521e4b647b56c222782002b44cce4f7bab279 100644 GIT binary patch delta 494 zcmXw#F=!M)6o%j9OtRQ`CwCi;Ik^*56a+zS(nVqsEM#uU?jU3Ey+o{pQ%t9joyqQb zc5@~~vCy>EYM)9h1hKKc#zqlrfwm*`MJCkPHKp>v(!-dR zwWXe~yBfoT@%Llv)b$OCdM{DZMLpM}ZizJ2aY(&kT~;rR&h0D@6)XUx8$qF7z$)u5VX=)``kP% zvHv%76cp{p66;bsE7V$x!6^)>9KbU+XMFLhiJzv`SHm;0H2#(%pA@YYO(~DtTGYo; zvr#v0sqmPD62l|p=^vXXqvL08eAqj@Vs@Wze_npQe0eh3i?0mMeOsH`z4ml%^!CoP RoA(B{R~H~UvN?!O{{fcEqQ3wD delta 398 zcmXAkKP*F06vpp~rfou`C7y_XB?uA=mc}9xA%^DlMc*6l;GEQ-MS>U&z4y|JSnjI? zqr@mRFm)gnqeu)Ei^(h|iBP93Cnx9p&iTIYtmPzGz*n61a0r#wo~8H}o~2cm#88M3 zV#;*oHXeb*JYs?pOBq~f} zZ-RshR2FL;&aQ&?zeS<`2N0l`Gb~UELIcw1;HCdVcqv<$FNnSGF`mP4*L+*@Bt zW$J8|g>;T761ToY(7MYSN0E37uwb0fm6$RK-9Qix@|pRaEqv{)Tkdx-;^6=a4i#G0 zmlX3ALFe@;JV&SA0*WR1U9F?!7;oRevHL#|hnnMB4lGML(MGYxKrikY@N5z60Z{bg z=rZ0n(*1Hi_IUW-_Z(SRy;#bO&h_k!kFIP!3|4>c@2*F=Ip!L+3fhSvB7$wIbfT4IKw_Nr507cS;rqVdytfnY58b348YFa*a%&UM z&2`$CA@mG=?-;&hMos4(hBKNV-!qEQXJ+B*+|nZLL<9+4qDDd|2=)x2wLR~`oZ*_L zkqgJlQ0yjc!0>SV-6NG|=$ErDz^o)d(k!x(8* zF5}P;bSbEO)a!QsSP0f^0DgN>3{>CI!_TU?8CqHIL6A&a^9GK7WuMt(#h z`zfWA!cN&Ke}Js~18gM5nXx&Y&iS14{eB22v_h zVQ*PT=a?e#5J&{A+pKXFiT4om#*I9QDU;9+K|Gw97++h$x7Lc~P8Vx@>_WkzBI^Z` zoNq3)RbMJS~`R+O2 zJvhLMjXTg2!j^pMV?4PRL2_1-K4+KeuC?3Cb9R@5%-e7+4zlhxp4k7&^Efb&+4wMK zZM*~7hKnFXQTn>a*)tBl=IgQLqUq;^#@VaRq|f%Tj}=R+?qbQGrX1f=4kCf3FtHQ? zP89{9+0N0{S;z7SmMr=}frU`ZUpl_1ApmFRiKu0%x9*B60zDN&6DsWQ4!xY+S9dwv z6r8Px^PKIkyCG*jR4?l$=;J z;#p|xvFj@~u;6stQ1xs55c*WY7-R?>_7StlSNopRiJ+Rq>`DXIbqXtLinC=AUKk*2 zM4xAG@Hl*cY%j7ao9Iz{k{0BKEx_!a9A^vkRmMTlYrxi5XJ$D&=y;8}({KDp=G$bR zdb-gi^E{cScc1!aXkPqzwom3oTK)C0<+%h)r=iYr_A+NL?!hc)S5>8`^H{0Md|n+C zllbnspeD{9x=Yd-wg7}Qvd#p zCD(Q)0aYGS6C>?}+6>k0`t;zUoTM5UT0!WlTeqd_$9hTECj~YkO6F60VTQw#qbLWr zhCffK4xV%9<#1PR5$HkwfvK*jhZjUAxb zA;ku8zhX}c0^92+?d`=%m{e%mz_6VhYcO;wUqfg;UFVr>C+L!Z9;~~4i|zrGV=JMY zxn+ddF-9D-urh&oAVpX_^Jv@eq(O*6Pd!5(9(qwn5y>=DaCi-oj2NYPs~fzY#yCzy zI{y**XoUD|j3BC&3B>0k#HBHUsNw|Ta*80Te|7xfc@@>;ai7>KvLhjAGbwZ^1k&99 zbfAD<}M%v>vjRL)Axly2ok+wV@Mv;x_EQ&VVP8+DHq;)~_PK%sm zB4}$4*S;VUTXfHTJIv>C%JAVGD_v!8Di3KQbK7bJXcrtYANpX+2qcwEJ5zT9cvlUk z{`>DGN>G3G%?}rwN1t7NYWs{?UW2(G?k=7%Z~yz;tzX~sY4hBHpRV5gN8`pde))Uz z-d`41j~r_3W7plpcD0t9t7hZKO6vvQXqjX;4<9|Wba-i{wX|q9SIiaOYQD7eFOI7K AWB>pF literal 1340 zcmZ9MU1%It6vyw`S*;I6Hz7MEY&1iW`XWe4QwfxIOH(O=GCL$Q!l*shO>9@%q%}() z+K1kIXJ;qcmpj|-*IN*+C=~i2VucnVSn;7CLf@nWN(DtJwDh5rB%YbsS<~*qaOU3M zIro3gJ!fzQs}62MA*G}Fb0#iLh#F_xVuTni9fRgEUT* z#Ug4(q>uJ;d4jo~Tb={`@wXEiy0f`06p4-;%j}XQ)f&4`kkb`|xB6_-PF} zo9FD4omk}TA3B)bB;D1TE|(=05)xa)hJHvpogN22r3g~FaH(SG*i2E*P9^?1RXC8m z<*^Ho$cK?bwf50lm0NhPLOw+*)7@BeC}iwcarQ5nU2z+tec@kqS*4*lH(f z!R?;Y_%nk3&DJ?Qj)FztFy{JQ8?82s$95{Y@KTQ`RQkkO8><_L?HOV7!tS<;vLGa( zll*%+1d1?9gcLr^;MOxj3McYo)MD^i7ULWViT)RIF(T36{%jniPUp(m((U=^F}Z>WoWMvsOO&Qg9H?TgRC_r5tJOEas@PWMwNyxFgvy% z2Fc7BAM|G~%ttO<^`kb>rBbg;`mz`&J(}7fZk+MB@jZ!HA8wnf-vjui0fi-<& z{I)ES$5l^GwG=oy1Wna4F1UUG7i` Date: Wed, 3 Aug 2022 18:08:24 +0000 Subject: [PATCH 0178/1274] test: regenerate types --- tests/src/interfaces/augment-api-errors.ts | 87 +++++- tests/src/interfaces/augment-api-query.ts | 12 + tests/src/interfaces/augment-api-tx.ts | 298 ++++++++++++++++----- tests/src/interfaces/default/types.ts | 5 +- tests/src/interfaces/lookup.ts | 242 +++++++++-------- tests/src/interfaces/types-lookup.ts | 243 +++++++++-------- 6 files changed, 572 insertions(+), 315 deletions(-) diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 4f0fcec5ec..028623bb33 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -446,25 +446,83 @@ declare module '@polkadot/api-base/types/errors' { [key: string]: AugmentedError; }; rmrkCore: { + /** + * Not the target owner of the sent NFT. + **/ CannotAcceptNonOwnedNft: AugmentedError; + /** + * Not the target owner of the sent NFT. + **/ CannotRejectNonOwnedNft: AugmentedError; + /** + * NFT was not sent and is not pending. + **/ CannotRejectNonPendingNft: AugmentedError; + /** + * If an NFT is sent to a descendant, that would form a nesting loop, an ouroboros. + * Sending to self is redundant. + **/ CannotSendToDescendentOrSelf: AugmentedError; + /** + * Too many tokens created in the collection, no new ones are allowed. + **/ CollectionFullOrLocked: AugmentedError; + /** + * Only destroying collections without tokens is allowed. + **/ CollectionNotEmpty: AugmentedError; + /** + * Collection does not exist, has a wrong type, or does not map to a Unique ID. + **/ CollectionUnknown: AugmentedError; + /** + * Property of the type of RMRK collection could not be read successfully. + **/ CorruptedCollectionType: AugmentedError; - NftTypeEncodeError: AugmentedError; + /** + * Could not find an ID for a collection. It is likely there were too many collections created on the chain, causing an overflow. + **/ NoAvailableCollectionId: AugmentedError; + /** + * Token does not exist, or there is no suitable ID for it, likely too many tokens were created in a collection, causing an overflow. + **/ NoAvailableNftId: AugmentedError; + /** + * Could not find an ID for the resource. It is likely there were too many resources created on an NFT, causing an overflow. + **/ NoAvailableResourceId: AugmentedError; + /** + * Token is marked as non-transferable, and thus cannot be transferred. + **/ NonTransferable: AugmentedError; + /** + * No permission to perform action. + **/ NoPermission: AugmentedError; + /** + * No such resource found. + **/ ResourceDoesntExist: AugmentedError; + /** + * Resource is not pending for the operation. + **/ ResourceNotPending: AugmentedError; + /** + * Could not find a property by the supplied key. + **/ RmrkPropertyIsNotFound: AugmentedError; + /** + * Too many symbols supplied as the property key. The maximum is [256](up_data_structs::MAX_PROPERTY_KEY_LENGTH). + **/ RmrkPropertyKeyIsTooLong: AugmentedError; + /** + * Too many bytes supplied as the property value. The maximum is [32768](up_data_structs::MAX_PROPERTY_VALUE_LENGTH). + **/ RmrkPropertyValueIsTooLong: AugmentedError; + /** + * Something went wrong when decoding encoded data from the storage. + * Perhaps, there was a wrong key supplied for the type, or the data was improperly stored. + **/ UnableToDecodeRmrkData: AugmentedError; /** * Generic error @@ -472,12 +530,33 @@ declare module '@polkadot/api-base/types/errors' { [key: string]: AugmentedError; }; rmrkEquip: { + /** + * Base collection linked to this ID does not exist. + **/ BaseDoesntExist: AugmentedError; + /** + * No Theme named "default" is associated with the Base. + **/ NeedsDefaultThemeFirst: AugmentedError; + /** + * Could not find an ID for a Base collection. It is likely there were too many collections created on the chain, causing an overflow. + **/ NoAvailableBaseId: AugmentedError; + /** + * Could not find a suitable ID for a Part, likely too many Part tokens were created in the Base, causing an overflow + **/ NoAvailablePartId: AugmentedError; + /** + * Cannot assign equippables to a fixed Part. + **/ NoEquippableOnFixedPart: AugmentedError; + /** + * Part linked to this ID does not exist. + **/ PartDoesntExist: AugmentedError; + /** + * No permission to perform action. + **/ PermissionError: AugmentedError; /** * Generic error @@ -508,15 +587,15 @@ declare module '@polkadot/api-base/types/errors' { }; structure: { /** - * While iterating over children, reached the breadth limit. + * While nesting, reached the breadth limit of nesting, exceeding the provided budget. **/ BreadthLimit: AugmentedError; /** - * While searching for the owner, reached the depth limit. + * While nesting, reached the depth limit of nesting, exceeding the provided budget. **/ DepthLimit: AugmentedError; /** - * While searching for the owner, encountered an already checked account, detecting a loop. + * While nesting, encountered an already checked account, detecting a loop. **/ OuroborosDetected: AugmentedError; /** diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 5694c763f8..2d3ee520f0 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -492,7 +492,13 @@ declare module '@polkadot/api-base/types/storage' { [key: string]: QueryableStorageEntry; }; rmrkCore: { + /** + * Latest yet-unused collection ID. + **/ collectionIndex: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Mapping from RMRK collection ID to Unique's. + **/ uniqueCollectionId: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; /** * Generic query @@ -500,7 +506,13 @@ declare module '@polkadot/api-base/types/storage' { [key: string]: QueryableStorageEntry; }; rmrkEquip: { + /** + * Checkmark that a Base has a Theme NFT named "default". + **/ baseHasDefaultTheme: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; + /** + * Map of a Base ID and a Part ID to an NFT in the Base collection serving as the Part. + **/ inernalPartId: AugmentedQuery Observable>, [u32, u32]> & QueryableStorageEntry; /** * Generic query diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index 9abad5124b..89010386b8 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -348,103 +348,259 @@ declare module '@polkadot/api-base/types/submittable' { }; rmrkCore: { /** - * Accepts an NFT sent from another account to self or owned NFT + * Accept an NFT sent from another account to self or an owned NFT. * - * Parameters: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: collection id of the nft to be accepted - * - `rmrk_nft_id`: nft id of the nft to be accepted - * - `new_owner`: either origin's account ID or origin-owned NFT, whichever the NFT was - * sent to + * The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first. + * + * # Permissions: + * - Token-owner-to-be + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID of the NFT to be accepted. + * - `rmrk_nft_id`: ID of the NFT to be accepted. + * - `new_owner`: Either the sender's account ID or a sender-owned NFT, + * whichever the accepted NFT was sent to. **/ acceptNft: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple | { AccountId: any } | { CollectionAndNftTuple: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsNftAccountIdOrCollectionNftTuple]>; /** - * accept the addition of a new resource to an existing NFT + * Accept the addition of a newly created pending resource to an existing NFT. + * + * This transaction is needed when a resource is created and assigned to an NFT + * by a non-owner, i.e. the collection issuer, with one of the + * [`add_...` transactions](Pallet::add_basic_resource). + * + * # Permissions: + * - Token owner + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `rmrk_nft_id`: ID of the NFT with a pending resource to be accepted. + * - `resource_id`: ID of the newly created pending resource. **/ acceptResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, resourceId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; /** - * accept the removal of a resource of an existing NFT + * Accept the removal of a removal-pending resource from an NFT. + * + * This transaction is needed when a non-owner, i.e. the collection issuer, + * requests a [removal](`Pallet::remove_resource`) of a resource from an NFT. + * + * # Permissions: + * - Token owner + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `rmrk_nft_id`: ID of the NFT with a resource to be removed. + * - `resource_id`: ID of the removal-pending resource. **/ acceptResourceRemoval: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, resourceId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; /** - * Create basic resource + * Create and set/propose a basic resource for an NFT. + * + * A basic resource is the simplest, lacking a Base and anything that comes with it. + * See RMRK docs for more information and examples. + * + * # Permissions: + * - Collection issuer - if not the token owner, adding the resource will warrant + * the owner's [acceptance](Pallet::accept_resource). + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `nft_id`: ID of the NFT to assign a resource to. + * - `resource`: Data of the resource to be created. **/ addBasicResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resource: RmrkTraitsResourceBasicResource | { src?: any; metadata?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsResourceBasicResource]>; /** - * Create composable resource + * Create and set/propose a composable resource for an NFT. + * + * A composable resource links to a Base and has a subset of its Parts it is composed of. + * See RMRK docs for more information and examples. + * + * # Permissions: + * - Collection issuer - if not the token owner, adding the resource will warrant + * the owner's [acceptance](Pallet::accept_resource). + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `nft_id`: ID of the NFT to assign a resource to. + * - `resource`: Data of the resource to be created. **/ addComposableResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resource: RmrkTraitsResourceComposableResource | { parts?: any; base?: any; src?: any; metadata?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsResourceComposableResource]>; /** - * Create slot resource + * Create and set/propose a slot resource for an NFT. + * + * A slot resource links to a Base and a slot ID in it which it can fit into. + * See RMRK docs for more information and examples. + * + * # Permissions: + * - Collection issuer - if not the token owner, adding the resource will warrant + * the owner's [acceptance](Pallet::accept_resource). + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `nft_id`: ID of the NFT to assign a resource to. + * - `resource`: Data of the resource to be created. **/ addSlotResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resource: RmrkTraitsResourceSlotResource | { base?: any; src?: any; metadata?: any; slot?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsResourceSlotResource]>; /** - * burn nft + * Burn an NFT, destroying it and its nested tokens up to the specified limit. + * If the burning budget is exceeded, the transaction is reverted. + * + * This is the way to burn a nested token as well. + * + * For more information, see [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively). + * + * # Permissions: + * * Token owner + * + * # Arguments: + * - `collection_id`: RMRK ID of the collection in which the NFT to burn belongs to. + * - `nft_id`: ID of the NFT to be destroyed. + * - `max_burns`: Maximum number of tokens to burn, assuming nesting. The transaction + * is reverted if there are more tokens to burn in the nesting tree than this number. + * This is primarily a mechanism of transaction weight control. **/ burnNft: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, maxBurns: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; /** - * Change the issuer of a collection + * Change the issuer of a collection. Analogous to Unique's collection's [`owner`](up_data_structs::Collection). + * + * # Permissions: + * * Collection issuer * - * Parameters: - * - `origin`: sender of the transaction - * - `collection_id`: collection id of the nft to change issuer of - * - `new_issuer`: Collection's new issuer + * # Arguments: + * - `collection_id`: RMRK collection ID to change the issuer of. + * - `new_issuer`: Collection's new issuer. **/ changeCollectionIssuer: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newIssuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, MultiAddress]>; /** - * Create a collection + * Create a new collection of NFTs. + * + * # Permissions: + * * Anyone - will be assigned as the issuer of the collection. + * + * # Arguments: + * - `metadata`: Metadata describing the collection, e.g. IPFS hash. Cannot be changed. + * - `max`: Optional maximum number of tokens. + * - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs. + * Analogous to Unique's [`token_prefix`](up_data_structs::Collection). Cannot be changed. **/ createCollection: AugmentedSubmittable<(metadata: Bytes | string | Uint8Array, max: Option | null | object | string | Uint8Array, symbol: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes, Option, Bytes]>; /** - * destroy collection + * Destroy a collection. + * + * Only empty collections can be destroyed. If it has any tokens, they must be burned first. + * + * # Permissions: + * * Collection issuer + * + * # Arguments: + * - `collection_id`: RMRK ID of the collection to destroy. **/ destroyCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; /** - * lock collection + * "Lock" the collection and prevent new token creation. Cannot be undone. + * + * # Permissions: + * * Collection issuer + * + * # Arguments: + * - `collection_id`: RMRK ID of the collection to lock. **/ lockCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; /** - * Mints an NFT in the specified collection - * Sets metadata and the royalty attribute + * Mint an NFT in a specified collection. * - * Parameters: - * - `collection_id`: The class of the asset to be minted. - * - `nft_id`: The nft value of the asset to be minted. - * - `recipient`: Receiver of the royalty - * - `royalty`: Permillage reward from each trade for the Recipient - * - `metadata`: Arbitrary data about an nft, e.g. IPFS hash - * - `transferable`: Ability to transfer this NFT + * # Permissions: + * * Collection issuer + * + * # Arguments: + * - `owner`: Owner account of the NFT. If set to None, defaults to the sender (collection issuer). + * - `collection_id`: RMRK collection ID for the NFT to be minted within. Cannot be changed. + * - `recipient`: Receiver account of the royalty. Has no effect if the `royalty_amount` is not set. Cannot be changed. + * - `royalty_amount`: Optional permillage reward from each trade for the `recipient`. Cannot be changed. + * - `metadata`: Arbitrary data about an NFT, e.g. IPFS hash. Cannot be changed. + * - `transferable`: Can this NFT be transferred? Cannot be changed. + * - `resources`: Resource data to be added to the NFT immediately after minting. **/ mintNft: AugmentedSubmittable<(owner: Option | null | object | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, recipient: Option | null | object | string | Uint8Array, royaltyAmount: Option | null | object | string | Uint8Array, metadata: Bytes | string | Uint8Array, transferable: bool | boolean | Uint8Array, resources: Option> | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option, u32, Option, Option, Bytes, bool, Option>]>; /** - * Rejects an NFT sent from another account to self or owned NFT + * Reject an NFT sent from another account to self or owned NFT. + * The NFT in question will not be sent back and burnt instead. + * + * The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first. * - * Parameters: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: collection id of the nft to be accepted - * - `rmrk_nft_id`: nft id of the nft to be accepted + * # Permissions: + * - Token-owner-to-be-not + * + * # Arguments: + * - `rmrk_collection_id`: RMRK ID of the NFT to be rejected. + * - `rmrk_nft_id`: ID of the NFT to be rejected. **/ rejectNft: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32]>; /** - * remove resource + * Remove and erase a resource from an NFT. + * + * If the sender does not own the NFT, then it will be pending confirmation, + * and will have to be [accepted](Pallet::accept_resource_removal) by the token owner. + * + * # Permissions + * - Collection issuer + * + * # Arguments + * - `collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to. + * - `nft_id`: ID of the NFT with a resource to be removed. + * - `resource_id`: ID of the resource to be removed. **/ removeResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resourceId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; /** - * Transfers a NFT from an Account or NFT A to another Account or NFT B + * Transfer an NFT from an account/NFT A to another account/NFT B. + * The token must be transferable. Nesting cannot occur deeper than the [`NESTING_BUDGET`]. + * + * If the target owner is an NFT owned by another account, then the NFT will enter + * the pending state and will have to be accepted by the other account. * - * Parameters: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: collection id of the nft to be transferred - * - `rmrk_nft_id`: nft id of the nft to be transferred - * - `new_owner`: new owner of the nft which can be either an account or a NFT + * # Permissions: + * - Token owner + * + * # Arguments: + * - `collection_id`: RMRK ID of the collection of the NFT to be transferred. + * - `nft_id`: ID of the NFT to be transferred. + * - `new_owner`: New owner of the nft which can be either an account or a NFT. **/ send: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple | { AccountId: any } | { CollectionAndNftTuple: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsNftAccountIdOrCollectionNftTuple]>; /** - * set a different order of resource priority + * Set a different order of resource priorities for an NFT. Priorities can be used, + * for example, for order of rendering. + * + * Note that the priorities are not updated automatically, and are an empty vector + * by default. There is no pre-set definition for the order to be particular, + * it can be interpreted arbitrarily use-case by use-case. + * + * # Permissions: + * - Token owner + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `rmrk_nft_id`: ID of the NFT to rearrange resource priorities for. + * - `priorities`: Ordered vector of resource IDs. **/ setPriority: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, priorities: Vec | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic, [u32, u32, Vec]>; /** - * set a custom value on an NFT + * Add or edit a custom user property, a key-value pair, describing the metadata + * of a token or a collection, on either one of these. + * + * Note that in this proxy implementation many details regarding RMRK are stored + * as scoped properties prefixed with "rmrk:", normally inaccessible + * to external transactions and RPCs. + * + * # Permissions: + * - Collection issuer - in case of collection property + * - Token owner - in case of NFT property + * + * # Arguments: + * - `rmrk_collection_id`: RMRK collection ID. + * - `maybe_nft_id`: Optional ID of the NFT. If left empty, then the property is set for the collection. + * - `key`: Key of the custom property to be referenced by. + * - `value`: Value of the custom property to be stored. **/ setProperty: AugmentedSubmittable<(rmrkCollectionId: Compact | AnyNumber | Uint8Array, maybeNftId: Option | null | object | string | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Option, Bytes, Bytes]>; /** @@ -454,32 +610,50 @@ declare module '@polkadot/api-base/types/submittable' { }; rmrkEquip: { /** - * Creates a new Base. - * Modeled after [base interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/base.md) + * Create a new Base. + * + * Modeled after the [Base interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/base.md) + * + * # Permissions + * - Anyone - will be assigned as the issuer of the Base. * - * Parameters: - * - origin: Caller, will be assigned as the issuer of the Base - * - base_type: media type, e.g. "svg" - * - symbol: arbitrary client-chosen symbol - * - parts: array of Fixed and Slot parts composing the base, confined in length by - * RmrkPartsLimit + * # Arguments: + * - `base_type`: Arbitrary media type, e.g. "svg". + * - `symbol`: Arbitrary client-chosen symbol. + * - `parts`: Array of Fixed and Slot Parts composing the Base, + * confined in length by [`RmrkPartsLimit`](up_data_structs::RmrkPartsLimit). **/ createBase: AugmentedSubmittable<(baseType: Bytes | string | Uint8Array, symbol: Bytes | string | Uint8Array, parts: Vec | (RmrkTraitsPartPartType | { FixedPart: any } | { SlotPart: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Bytes, Bytes, Vec]>; + /** + * Update the array of Collections allowed to be equipped to a Base's specified Slot Part. + * + * Modeled after [equippable interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/equippable.md). + * + * # Permissions: + * - Base issuer + * + * # Arguments: + * - `base_id`: Base containing the Slot Part to be updated. + * - `part_id`: Slot Part whose Equippable List is being updated. + * - `equippables`: List of equippables that will override the current Equippables list. + **/ equippable: AugmentedSubmittable<(baseId: u32 | AnyNumber | Uint8Array, slotId: u32 | AnyNumber | Uint8Array, equippables: RmrkTraitsPartEquippableList | { All: any } | { Empty: any } | { Custom: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsPartEquippableList]>; /** - * Adds a Theme to a Base. - * Modeled after [themeadd interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/themeadd.md) - * Themes are stored in the Themes storage + * Add a Theme to a Base. * A Theme named "default" is required prior to adding other Themes. * - * Parameters: - * - origin: The caller of the function, must be issuer of the base - * - base_id: The Base containing the Theme to be updated - * - theme: The Theme to add to the Base. A Theme has a name and properties, which are an + * Modeled after [Themeadd interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/themeadd.md). + * + * # Permissions: + * - Base issuer + * + * # Arguments: + * - `base_id`: Base ID containing the Theme to be updated. + * - `theme`: Theme to add to the Base. A Theme has a name and properties, which are an * array of [key, value, inherit]. - * - key: arbitrary BoundedString, defined by client - * - value: arbitrary BoundedString, defined by client - * - inherit: optional bool + * - `key`: Arbitrary BoundedString, defined by client. + * - `value`: Arbitrary BoundedString, defined by client. + * - `inherit`: Optional bool. **/ themeAdd: AugmentedSubmittable<(baseId: u32 | AnyNumber | Uint8Array, theme: RmrkTraitsTheme | { name?: any; properties?: any; inherit?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, RmrkTraitsTheme]>; /** diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index b257a4c215..af3dabfc7f 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -1314,7 +1314,6 @@ export interface PalletRmrkCoreCall extends Enum { /** @name PalletRmrkCoreError */ export interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; - readonly isNftTypeEncodeError: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; readonly isRmrkPropertyValueIsTooLong: boolean; readonly isRmrkPropertyIsNotFound: boolean; @@ -1333,7 +1332,7 @@ export interface PalletRmrkCoreError extends Enum { readonly isCannotRejectNonPendingNft: boolean; readonly isResourceNotPending: boolean; readonly isNoAvailableResourceId: boolean; - readonly type: 'CorruptedCollectionType' | 'NftTypeEncodeError' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; + readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } /** @name PalletRmrkCoreEvent */ @@ -2459,14 +2458,12 @@ export interface UpDataStructsCreateNftExData extends Struct { /** @name UpDataStructsCreateReFungibleData */ export interface UpDataStructsCreateReFungibleData extends Struct { - readonly constData: Bytes; readonly pieces: u128; readonly properties: Vec; } /** @name UpDataStructsCreateRefungibleExData */ export interface UpDataStructsCreateRefungibleExData extends Struct { - readonly constData: Bytes; readonly users: BTreeMap; readonly properties: Vec; } diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index d29a1ef234..dbece8b120 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -1501,12 +1501,11 @@ export default { * Lookup188: up_data_structs::CreateReFungibleData **/ UpDataStructsCreateReFungibleData: { - constData: 'Bytes', pieces: 'u128', properties: 'Vec' }, /** - * Lookup193: up_data_structs::CreateItemExData> + * Lookup192: up_data_structs::CreateItemExData> **/ UpDataStructsCreateItemExData: { _enum: { @@ -1517,22 +1516,21 @@ export default { } }, /** - * Lookup195: up_data_structs::CreateNftExData> + * Lookup194: up_data_structs::CreateNftExData> **/ UpDataStructsCreateNftExData: { properties: 'Vec', owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup202: up_data_structs::CreateRefungibleExData> + * Lookup201: up_data_structs::CreateRefungibleExData> **/ UpDataStructsCreateRefungibleExData: { - constData: 'Bytes', users: 'BTreeMap', properties: 'Vec' }, /** - * Lookup204: pallet_unique_scheduler::pallet::Call + * Lookup203: pallet_unique_scheduler::pallet::Call **/ PalletUniqueSchedulerCall: { _enum: { @@ -1556,7 +1554,7 @@ export default { } }, /** - * Lookup206: frame_support::traits::schedule::MaybeHashed + * Lookup205: frame_support::traits::schedule::MaybeHashed **/ FrameSupportScheduleMaybeHashed: { _enum: { @@ -1565,15 +1563,15 @@ export default { } }, /** - * Lookup207: pallet_template_transaction_payment::Call + * Lookup206: pallet_template_transaction_payment::Call **/ PalletTemplateTransactionPaymentCall: 'Null', /** - * Lookup208: pallet_structure::pallet::Call + * Lookup207: pallet_structure::pallet::Call **/ PalletStructureCall: 'Null', /** - * Lookup209: pallet_rmrk_core::pallet::Call + * Lookup208: pallet_rmrk_core::pallet::Call **/ PalletRmrkCoreCall: { _enum: { @@ -1664,7 +1662,7 @@ export default { } }, /** - * Lookup215: rmrk_traits::resource::ResourceTypes, frame_support::storage::bounded_vec::BoundedVec> + * Lookup214: rmrk_traits::resource::ResourceTypes, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceTypes: { _enum: { @@ -1674,7 +1672,7 @@ export default { } }, /** - * Lookup217: rmrk_traits::resource::BasicResource> + * Lookup216: rmrk_traits::resource::BasicResource> **/ RmrkTraitsResourceBasicResource: { src: 'Option', @@ -1683,7 +1681,7 @@ export default { thumb: 'Option' }, /** - * Lookup219: rmrk_traits::resource::ComposableResource, frame_support::storage::bounded_vec::BoundedVec> + * Lookup218: rmrk_traits::resource::ComposableResource, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsResourceComposableResource: { parts: 'Vec', @@ -1694,7 +1692,7 @@ export default { thumb: 'Option' }, /** - * Lookup220: rmrk_traits::resource::SlotResource> + * Lookup219: rmrk_traits::resource::SlotResource> **/ RmrkTraitsResourceSlotResource: { base: 'u32', @@ -1705,7 +1703,7 @@ export default { thumb: 'Option' }, /** - * Lookup222: rmrk_traits::nft::AccountIdOrCollectionNftTuple + * Lookup221: rmrk_traits::nft::AccountIdOrCollectionNftTuple **/ RmrkTraitsNftAccountIdOrCollectionNftTuple: { _enum: { @@ -1714,7 +1712,7 @@ export default { } }, /** - * Lookup226: pallet_rmrk_equip::pallet::Call + * Lookup225: pallet_rmrk_equip::pallet::Call **/ PalletRmrkEquipCall: { _enum: { @@ -1735,7 +1733,7 @@ export default { } }, /** - * Lookup229: rmrk_traits::part::PartType, frame_support::storage::bounded_vec::BoundedVec> + * Lookup228: rmrk_traits::part::PartType, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsPartPartType: { _enum: { @@ -1744,7 +1742,7 @@ export default { } }, /** - * Lookup231: rmrk_traits::part::FixedPart> + * Lookup230: rmrk_traits::part::FixedPart> **/ RmrkTraitsPartFixedPart: { id: 'u32', @@ -1752,7 +1750,7 @@ export default { src: 'Bytes' }, /** - * Lookup232: rmrk_traits::part::SlotPart, frame_support::storage::bounded_vec::BoundedVec> + * Lookup231: rmrk_traits::part::SlotPart, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsPartSlotPart: { id: 'u32', @@ -1761,7 +1759,7 @@ export default { z: 'u32' }, /** - * Lookup233: rmrk_traits::part::EquippableList> + * Lookup232: rmrk_traits::part::EquippableList> **/ RmrkTraitsPartEquippableList: { _enum: { @@ -1771,7 +1769,7 @@ export default { } }, /** - * Lookup235: rmrk_traits::theme::Theme, frame_support::storage::bounded_vec::BoundedVec>, S>> + * Lookup234: rmrk_traits::theme::Theme, frame_support::storage::bounded_vec::BoundedVec>, S>> **/ RmrkTraitsTheme: { name: 'Bytes', @@ -1779,14 +1777,14 @@ export default { inherit: 'bool' }, /** - * Lookup237: rmrk_traits::theme::ThemeProperty> + * Lookup236: rmrk_traits::theme::ThemeProperty> **/ RmrkTraitsThemeThemeProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup239: pallet_evm::pallet::Call + * Lookup238: pallet_evm::pallet::Call **/ PalletEvmCall: { _enum: { @@ -1829,7 +1827,7 @@ export default { } }, /** - * Lookup245: pallet_ethereum::pallet::Call + * Lookup244: pallet_ethereum::pallet::Call **/ PalletEthereumCall: { _enum: { @@ -1839,7 +1837,7 @@ export default { } }, /** - * Lookup246: ethereum::transaction::TransactionV2 + * Lookup245: ethereum::transaction::TransactionV2 **/ EthereumTransactionTransactionV2: { _enum: { @@ -1849,7 +1847,7 @@ export default { } }, /** - * Lookup247: ethereum::transaction::LegacyTransaction + * Lookup246: ethereum::transaction::LegacyTransaction **/ EthereumTransactionLegacyTransaction: { nonce: 'U256', @@ -1861,7 +1859,7 @@ export default { signature: 'EthereumTransactionTransactionSignature' }, /** - * Lookup248: ethereum::transaction::TransactionAction + * Lookup247: ethereum::transaction::TransactionAction **/ EthereumTransactionTransactionAction: { _enum: { @@ -1870,7 +1868,7 @@ export default { } }, /** - * Lookup249: ethereum::transaction::TransactionSignature + * Lookup248: ethereum::transaction::TransactionSignature **/ EthereumTransactionTransactionSignature: { v: 'u64', @@ -1878,7 +1876,7 @@ export default { s: 'H256' }, /** - * Lookup251: ethereum::transaction::EIP2930Transaction + * Lookup250: ethereum::transaction::EIP2930Transaction **/ EthereumTransactionEip2930Transaction: { chainId: 'u64', @@ -1894,14 +1892,14 @@ export default { s: 'H256' }, /** - * Lookup253: ethereum::transaction::AccessListItem + * Lookup252: ethereum::transaction::AccessListItem **/ EthereumTransactionAccessListItem: { address: 'H160', storageKeys: 'Vec' }, /** - * Lookup254: ethereum::transaction::EIP1559Transaction + * Lookup253: ethereum::transaction::EIP1559Transaction **/ EthereumTransactionEip1559Transaction: { chainId: 'u64', @@ -1918,7 +1916,7 @@ export default { s: 'H256' }, /** - * Lookup255: pallet_evm_migration::pallet::Call + * Lookup254: pallet_evm_migration::pallet::Call **/ PalletEvmMigrationCall: { _enum: { @@ -1936,7 +1934,7 @@ export default { } }, /** - * Lookup258: pallet_sudo::pallet::Event + * Lookup257: pallet_sudo::pallet::Event **/ PalletSudoEvent: { _enum: { @@ -1952,7 +1950,7 @@ export default { } }, /** - * Lookup260: sp_runtime::DispatchError + * Lookup259: sp_runtime::DispatchError **/ SpRuntimeDispatchError: { _enum: { @@ -1969,38 +1967,38 @@ export default { } }, /** - * Lookup261: sp_runtime::ModuleError + * Lookup260: sp_runtime::ModuleError **/ SpRuntimeModuleError: { index: 'u8', error: '[u8;4]' }, /** - * Lookup262: sp_runtime::TokenError + * Lookup261: sp_runtime::TokenError **/ SpRuntimeTokenError: { _enum: ['NoFunds', 'WouldDie', 'BelowMinimum', 'CannotCreate', 'UnknownAsset', 'Frozen', 'Unsupported'] }, /** - * Lookup263: sp_runtime::ArithmeticError + * Lookup262: sp_runtime::ArithmeticError **/ SpRuntimeArithmeticError: { _enum: ['Underflow', 'Overflow', 'DivisionByZero'] }, /** - * Lookup264: sp_runtime::TransactionalError + * Lookup263: sp_runtime::TransactionalError **/ SpRuntimeTransactionalError: { _enum: ['LimitReached', 'NoLayer'] }, /** - * Lookup265: pallet_sudo::pallet::Error + * Lookup264: pallet_sudo::pallet::Error **/ PalletSudoError: { _enum: ['RequireSudo'] }, /** - * Lookup266: frame_system::AccountInfo> + * Lookup265: frame_system::AccountInfo> **/ FrameSystemAccountInfo: { nonce: 'u32', @@ -2010,7 +2008,7 @@ export default { data: 'PalletBalancesAccountData' }, /** - * Lookup267: frame_support::weights::PerDispatchClass + * Lookup266: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassU64: { normal: 'u64', @@ -2018,13 +2016,13 @@ export default { mandatory: 'u64' }, /** - * Lookup268: sp_runtime::generic::digest::Digest + * Lookup267: sp_runtime::generic::digest::Digest **/ SpRuntimeDigest: { logs: 'Vec' }, /** - * Lookup270: sp_runtime::generic::digest::DigestItem + * Lookup269: sp_runtime::generic::digest::DigestItem **/ SpRuntimeDigestDigestItem: { _enum: { @@ -2040,7 +2038,7 @@ export default { } }, /** - * Lookup272: frame_system::EventRecord + * Lookup271: frame_system::EventRecord **/ FrameSystemEventRecord: { phase: 'FrameSystemPhase', @@ -2048,7 +2046,7 @@ export default { topics: 'Vec' }, /** - * Lookup274: frame_system::pallet::Event + * Lookup273: frame_system::pallet::Event **/ FrameSystemEvent: { _enum: { @@ -2076,7 +2074,7 @@ export default { } }, /** - * Lookup275: frame_support::weights::DispatchInfo + * Lookup274: frame_support::weights::DispatchInfo **/ FrameSupportWeightsDispatchInfo: { weight: 'u64', @@ -2084,19 +2082,19 @@ export default { paysFee: 'FrameSupportWeightsPays' }, /** - * Lookup276: frame_support::weights::DispatchClass + * Lookup275: frame_support::weights::DispatchClass **/ FrameSupportWeightsDispatchClass: { _enum: ['Normal', 'Operational', 'Mandatory'] }, /** - * Lookup277: frame_support::weights::Pays + * Lookup276: frame_support::weights::Pays **/ FrameSupportWeightsPays: { _enum: ['Yes', 'No'] }, /** - * Lookup278: orml_vesting::module::Event + * Lookup277: orml_vesting::module::Event **/ OrmlVestingModuleEvent: { _enum: { @@ -2115,7 +2113,7 @@ export default { } }, /** - * Lookup279: cumulus_pallet_xcmp_queue::pallet::Event + * Lookup278: cumulus_pallet_xcmp_queue::pallet::Event **/ CumulusPalletXcmpQueueEvent: { _enum: { @@ -2130,7 +2128,7 @@ export default { } }, /** - * Lookup280: pallet_xcm::pallet::Event + * Lookup279: pallet_xcm::pallet::Event **/ PalletXcmEvent: { _enum: { @@ -2153,7 +2151,7 @@ export default { } }, /** - * Lookup281: xcm::v2::traits::Outcome + * Lookup280: xcm::v2::traits::Outcome **/ XcmV2TraitsOutcome: { _enum: { @@ -2163,7 +2161,7 @@ export default { } }, /** - * Lookup283: cumulus_pallet_xcm::pallet::Event + * Lookup282: cumulus_pallet_xcm::pallet::Event **/ CumulusPalletXcmEvent: { _enum: { @@ -2173,7 +2171,7 @@ export default { } }, /** - * Lookup284: cumulus_pallet_dmp_queue::pallet::Event + * Lookup283: cumulus_pallet_dmp_queue::pallet::Event **/ CumulusPalletDmpQueueEvent: { _enum: { @@ -2204,7 +2202,7 @@ export default { } }, /** - * Lookup285: pallet_unique::RawEvent> + * Lookup284: pallet_unique::RawEvent> **/ PalletUniqueRawEvent: { _enum: { @@ -2221,7 +2219,7 @@ export default { } }, /** - * Lookup286: pallet_unique_scheduler::pallet::Event + * Lookup285: pallet_unique_scheduler::pallet::Event **/ PalletUniqueSchedulerEvent: { _enum: { @@ -2246,13 +2244,13 @@ export default { } }, /** - * Lookup288: frame_support::traits::schedule::LookupError + * Lookup287: frame_support::traits::schedule::LookupError **/ FrameSupportScheduleLookupError: { _enum: ['Unknown', 'BadFormat'] }, /** - * Lookup289: pallet_common::pallet::Event + * Lookup288: pallet_common::pallet::Event **/ PalletCommonEvent: { _enum: { @@ -2270,7 +2268,7 @@ export default { } }, /** - * Lookup290: pallet_structure::pallet::Event + * Lookup289: pallet_structure::pallet::Event **/ PalletStructureEvent: { _enum: { @@ -2278,7 +2276,7 @@ export default { } }, /** - * Lookup291: pallet_rmrk_core::pallet::Event + * Lookup290: pallet_rmrk_core::pallet::Event **/ PalletRmrkCoreEvent: { _enum: { @@ -2355,7 +2353,7 @@ export default { } }, /** - * Lookup292: pallet_rmrk_equip::pallet::Event + * Lookup291: pallet_rmrk_equip::pallet::Event **/ PalletRmrkEquipEvent: { _enum: { @@ -2370,7 +2368,7 @@ export default { } }, /** - * Lookup293: pallet_evm::pallet::Event + * Lookup292: pallet_evm::pallet::Event **/ PalletEvmEvent: { _enum: { @@ -2384,7 +2382,7 @@ export default { } }, /** - * Lookup294: ethereum::log::Log + * Lookup293: ethereum::log::Log **/ EthereumLog: { address: 'H160', @@ -2392,7 +2390,7 @@ export default { data: 'Bytes' }, /** - * Lookup295: pallet_ethereum::pallet::Event + * Lookup294: pallet_ethereum::pallet::Event **/ PalletEthereumEvent: { _enum: { @@ -2400,7 +2398,7 @@ export default { } }, /** - * Lookup296: evm_core::error::ExitReason + * Lookup295: evm_core::error::ExitReason **/ EvmCoreErrorExitReason: { _enum: { @@ -2411,13 +2409,13 @@ export default { } }, /** - * Lookup297: evm_core::error::ExitSucceed + * Lookup296: evm_core::error::ExitSucceed **/ EvmCoreErrorExitSucceed: { _enum: ['Stopped', 'Returned', 'Suicided'] }, /** - * Lookup298: evm_core::error::ExitError + * Lookup297: evm_core::error::ExitError **/ EvmCoreErrorExitError: { _enum: { @@ -2439,13 +2437,13 @@ export default { } }, /** - * Lookup301: evm_core::error::ExitRevert + * Lookup300: evm_core::error::ExitRevert **/ EvmCoreErrorExitRevert: { _enum: ['Reverted'] }, /** - * Lookup302: evm_core::error::ExitFatal + * Lookup301: evm_core::error::ExitFatal **/ EvmCoreErrorExitFatal: { _enum: { @@ -2456,7 +2454,7 @@ export default { } }, /** - * Lookup303: frame_system::Phase + * Lookup302: frame_system::Phase **/ FrameSystemPhase: { _enum: { @@ -2466,14 +2464,14 @@ export default { } }, /** - * Lookup305: frame_system::LastRuntimeUpgradeInfo + * Lookup304: frame_system::LastRuntimeUpgradeInfo **/ FrameSystemLastRuntimeUpgradeInfo: { specVersion: 'Compact', specName: 'Text' }, /** - * Lookup306: frame_system::limits::BlockWeights + * Lookup305: frame_system::limits::BlockWeights **/ FrameSystemLimitsBlockWeights: { baseBlock: 'u64', @@ -2481,7 +2479,7 @@ export default { perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass' }, /** - * Lookup307: frame_support::weights::PerDispatchClass + * Lookup306: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassWeightsPerClass: { normal: 'FrameSystemLimitsWeightsPerClass', @@ -2489,7 +2487,7 @@ export default { mandatory: 'FrameSystemLimitsWeightsPerClass' }, /** - * Lookup308: frame_system::limits::WeightsPerClass + * Lookup307: frame_system::limits::WeightsPerClass **/ FrameSystemLimitsWeightsPerClass: { baseExtrinsic: 'u64', @@ -2498,13 +2496,13 @@ export default { reserved: 'Option' }, /** - * Lookup310: frame_system::limits::BlockLength + * Lookup309: frame_system::limits::BlockLength **/ FrameSystemLimitsBlockLength: { max: 'FrameSupportWeightsPerDispatchClassU32' }, /** - * Lookup311: frame_support::weights::PerDispatchClass + * Lookup310: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassU32: { normal: 'u32', @@ -2512,14 +2510,14 @@ export default { mandatory: 'u32' }, /** - * Lookup312: frame_support::weights::RuntimeDbWeight + * Lookup311: frame_support::weights::RuntimeDbWeight **/ FrameSupportWeightsRuntimeDbWeight: { read: 'u64', write: 'u64' }, /** - * Lookup313: sp_version::RuntimeVersion + * Lookup312: sp_version::RuntimeVersion **/ SpVersionRuntimeVersion: { specName: 'Text', @@ -2532,19 +2530,19 @@ export default { stateVersion: 'u8' }, /** - * Lookup317: frame_system::pallet::Error + * Lookup316: frame_system::pallet::Error **/ FrameSystemError: { _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] }, /** - * Lookup319: orml_vesting::module::Error + * Lookup318: orml_vesting::module::Error **/ OrmlVestingModuleError: { _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded'] }, /** - * Lookup321: cumulus_pallet_xcmp_queue::InboundChannelDetails + * Lookup320: cumulus_pallet_xcmp_queue::InboundChannelDetails **/ CumulusPalletXcmpQueueInboundChannelDetails: { sender: 'u32', @@ -2552,19 +2550,19 @@ export default { messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>' }, /** - * Lookup322: cumulus_pallet_xcmp_queue::InboundState + * Lookup321: cumulus_pallet_xcmp_queue::InboundState **/ CumulusPalletXcmpQueueInboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup325: polkadot_parachain::primitives::XcmpMessageFormat + * Lookup324: polkadot_parachain::primitives::XcmpMessageFormat **/ PolkadotParachainPrimitivesXcmpMessageFormat: { _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals'] }, /** - * Lookup328: cumulus_pallet_xcmp_queue::OutboundChannelDetails + * Lookup327: cumulus_pallet_xcmp_queue::OutboundChannelDetails **/ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: 'u32', @@ -2574,13 +2572,13 @@ export default { lastIndex: 'u16' }, /** - * Lookup329: cumulus_pallet_xcmp_queue::OutboundState + * Lookup328: cumulus_pallet_xcmp_queue::OutboundState **/ CumulusPalletXcmpQueueOutboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup331: cumulus_pallet_xcmp_queue::QueueConfigData + * Lookup330: cumulus_pallet_xcmp_queue::QueueConfigData **/ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: 'u32', @@ -2591,29 +2589,29 @@ export default { xcmpMaxIndividualWeight: 'u64' }, /** - * Lookup333: cumulus_pallet_xcmp_queue::pallet::Error + * Lookup332: cumulus_pallet_xcmp_queue::pallet::Error **/ CumulusPalletXcmpQueueError: { _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit'] }, /** - * Lookup334: pallet_xcm::pallet::Error + * Lookup333: pallet_xcm::pallet::Error **/ PalletXcmError: { _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed'] }, /** - * Lookup335: cumulus_pallet_xcm::pallet::Error + * Lookup334: cumulus_pallet_xcm::pallet::Error **/ CumulusPalletXcmError: 'Null', /** - * Lookup336: cumulus_pallet_dmp_queue::ConfigData + * Lookup335: cumulus_pallet_dmp_queue::ConfigData **/ CumulusPalletDmpQueueConfigData: { maxIndividual: 'u64' }, /** - * Lookup337: cumulus_pallet_dmp_queue::PageIndexData + * Lookup336: cumulus_pallet_dmp_queue::PageIndexData **/ CumulusPalletDmpQueuePageIndexData: { beginUsed: 'u32', @@ -2621,19 +2619,19 @@ export default { overweightCount: 'u64' }, /** - * Lookup340: cumulus_pallet_dmp_queue::pallet::Error + * Lookup339: cumulus_pallet_dmp_queue::pallet::Error **/ CumulusPalletDmpQueueError: { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup344: pallet_unique::Error + * Lookup343: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup347: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> + * Lookup346: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> **/ PalletUniqueSchedulerScheduledV3: { maybeId: 'Option<[u8;16]>', @@ -2643,7 +2641,7 @@ export default { origin: 'OpalRuntimeOriginCaller' }, /** - * Lookup348: opal_runtime::OriginCaller + * Lookup347: opal_runtime::OriginCaller **/ OpalRuntimeOriginCaller: { _enum: { @@ -2752,7 +2750,7 @@ export default { } }, /** - * Lookup349: frame_support::dispatch::RawOrigin + * Lookup348: frame_support::dispatch::RawOrigin **/ FrameSupportDispatchRawOrigin: { _enum: { @@ -2762,7 +2760,7 @@ export default { } }, /** - * Lookup350: pallet_xcm::pallet::Origin + * Lookup349: pallet_xcm::pallet::Origin **/ PalletXcmOrigin: { _enum: { @@ -2771,7 +2769,7 @@ export default { } }, /** - * Lookup351: cumulus_pallet_xcm::pallet::Origin + * Lookup350: cumulus_pallet_xcm::pallet::Origin **/ CumulusPalletXcmOrigin: { _enum: { @@ -2780,7 +2778,7 @@ export default { } }, /** - * Lookup352: pallet_ethereum::RawOrigin + * Lookup351: pallet_ethereum::RawOrigin **/ PalletEthereumRawOrigin: { _enum: { @@ -2788,17 +2786,17 @@ export default { } }, /** - * Lookup353: sp_core::Void + * Lookup352: sp_core::Void **/ SpCoreVoid: 'Null', /** - * Lookup354: pallet_unique_scheduler::pallet::Error + * Lookup353: pallet_unique_scheduler::pallet::Error **/ PalletUniqueSchedulerError: { _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] }, /** - * Lookup355: up_data_structs::Collection + * Lookup354: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -2812,7 +2810,7 @@ export default { externalCollection: 'bool' }, /** - * Lookup356: up_data_structs::SponsorshipState + * Lookup355: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipState: { _enum: { @@ -2822,7 +2820,7 @@ export default { } }, /** - * Lookup357: up_data_structs::Properties + * Lookup356: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -2830,15 +2828,15 @@ export default { spaceLimit: 'u32' }, /** - * Lookup358: up_data_structs::PropertiesMap> + * Lookup357: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** - * Lookup363: up_data_structs::PropertiesMap + * Lookup362: up_data_structs::PropertiesMap **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup370: up_data_structs::CollectionStats + * Lookup369: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -2846,18 +2844,18 @@ export default { alive: 'u32' }, /** - * Lookup371: up_data_structs::TokenChild + * Lookup370: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup372: PhantomType::up_data_structs + * Lookup371: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup374: up_data_structs::TokenData> + * Lookup373: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -2865,7 +2863,7 @@ export default { pieces: 'u128' }, /** - * Lookup376: up_data_structs::RpcCollection + * Lookup375: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -2881,7 +2879,7 @@ export default { readOnly: 'bool' }, /** - * Lookup377: rmrk_traits::collection::CollectionInfo, frame_support::storage::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup376: rmrk_traits::collection::CollectionInfo, frame_support::storage::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -2891,7 +2889,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup378: rmrk_traits::nft::NftInfo> + * Lookup377: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -2901,14 +2899,14 @@ export default { pending: 'bool' }, /** - * Lookup380: rmrk_traits::nft::RoyaltyInfo + * Lookup379: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup381: rmrk_traits::resource::ResourceInfo, frame_support::storage::bounded_vec::BoundedVec> + * Lookup380: rmrk_traits::resource::ResourceInfo, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -2917,14 +2915,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup382: rmrk_traits::property::PropertyInfo, frame_support::storage::bounded_vec::BoundedVec> + * Lookup381: rmrk_traits::property::PropertyInfo, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup383: rmrk_traits::base::BaseInfo> + * Lookup382: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -2932,26 +2930,26 @@ export default { symbol: 'Bytes' }, /** - * Lookup384: rmrk_traits::nft::NftChild + * Lookup383: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup386: pallet_common::pallet::Error + * Lookup385: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup388: pallet_fungible::pallet::Error + * Lookup387: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup389: pallet_refungible::ItemData + * Lookup388: pallet_refungible::ItemData **/ PalletRefungibleItemData: { constData: 'Bytes' @@ -2990,7 +2988,7 @@ export default { * Lookup400: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { - _enum: ['CorruptedCollectionType', 'NftTypeEncodeError', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] + _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** * Lookup402: pallet_rmrk_equip::pallet::Error diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 3163dd8ae5..df1b3ed90b 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1627,12 +1627,11 @@ declare module '@polkadot/types/lookup' { /** @name UpDataStructsCreateReFungibleData (188) */ export interface UpDataStructsCreateReFungibleData extends Struct { - readonly constData: Bytes; readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateItemExData (193) */ + /** @name UpDataStructsCreateItemExData (192) */ export interface UpDataStructsCreateItemExData extends Enum { readonly isNft: boolean; readonly asNft: Vec; @@ -1645,20 +1644,19 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; } - /** @name UpDataStructsCreateNftExData (195) */ + /** @name UpDataStructsCreateNftExData (194) */ export interface UpDataStructsCreateNftExData extends Struct { readonly properties: Vec; readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsCreateRefungibleExData (202) */ + /** @name UpDataStructsCreateRefungibleExData (201) */ export interface UpDataStructsCreateRefungibleExData extends Struct { - readonly constData: Bytes; readonly users: BTreeMap; readonly properties: Vec; } - /** @name PalletUniqueSchedulerCall (204) */ + /** @name PalletUniqueSchedulerCall (203) */ export interface PalletUniqueSchedulerCall extends Enum { readonly isScheduleNamed: boolean; readonly asScheduleNamed: { @@ -1683,7 +1681,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; } - /** @name FrameSupportScheduleMaybeHashed (206) */ + /** @name FrameSupportScheduleMaybeHashed (205) */ export interface FrameSupportScheduleMaybeHashed extends Enum { readonly isValue: boolean; readonly asValue: Call; @@ -1692,13 +1690,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Value' | 'Hash'; } - /** @name PalletTemplateTransactionPaymentCall (207) */ + /** @name PalletTemplateTransactionPaymentCall (206) */ export type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletStructureCall (208) */ + /** @name PalletStructureCall (207) */ export type PalletStructureCall = Null; - /** @name PalletRmrkCoreCall (209) */ + /** @name PalletRmrkCoreCall (208) */ export interface PalletRmrkCoreCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -1804,7 +1802,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; } - /** @name RmrkTraitsResourceResourceTypes (215) */ + /** @name RmrkTraitsResourceResourceTypes (214) */ export interface RmrkTraitsResourceResourceTypes extends Enum { readonly isBasic: boolean; readonly asBasic: RmrkTraitsResourceBasicResource; @@ -1815,7 +1813,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Basic' | 'Composable' | 'Slot'; } - /** @name RmrkTraitsResourceBasicResource (217) */ + /** @name RmrkTraitsResourceBasicResource (216) */ export interface RmrkTraitsResourceBasicResource extends Struct { readonly src: Option; readonly metadata: Option; @@ -1823,7 +1821,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceComposableResource (219) */ + /** @name RmrkTraitsResourceComposableResource (218) */ export interface RmrkTraitsResourceComposableResource extends Struct { readonly parts: Vec; readonly base: u32; @@ -1833,7 +1831,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceSlotResource (220) */ + /** @name RmrkTraitsResourceSlotResource (219) */ export interface RmrkTraitsResourceSlotResource extends Struct { readonly base: u32; readonly src: Option; @@ -1843,7 +1841,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (222) */ + /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (221) */ export interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { readonly isAccountId: boolean; readonly asAccountId: AccountId32; @@ -1852,7 +1850,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'AccountId' | 'CollectionAndNftTuple'; } - /** @name PalletRmrkEquipCall (226) */ + /** @name PalletRmrkEquipCall (225) */ export interface PalletRmrkEquipCall extends Enum { readonly isCreateBase: boolean; readonly asCreateBase: { @@ -1874,7 +1872,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; } - /** @name RmrkTraitsPartPartType (229) */ + /** @name RmrkTraitsPartPartType (228) */ export interface RmrkTraitsPartPartType extends Enum { readonly isFixedPart: boolean; readonly asFixedPart: RmrkTraitsPartFixedPart; @@ -1883,14 +1881,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'FixedPart' | 'SlotPart'; } - /** @name RmrkTraitsPartFixedPart (231) */ + /** @name RmrkTraitsPartFixedPart (230) */ export interface RmrkTraitsPartFixedPart extends Struct { readonly id: u32; readonly z: u32; readonly src: Bytes; } - /** @name RmrkTraitsPartSlotPart (232) */ + /** @name RmrkTraitsPartSlotPart (231) */ export interface RmrkTraitsPartSlotPart extends Struct { readonly id: u32; readonly equippable: RmrkTraitsPartEquippableList; @@ -1898,7 +1896,7 @@ declare module '@polkadot/types/lookup' { readonly z: u32; } - /** @name RmrkTraitsPartEquippableList (233) */ + /** @name RmrkTraitsPartEquippableList (232) */ export interface RmrkTraitsPartEquippableList extends Enum { readonly isAll: boolean; readonly isEmpty: boolean; @@ -1907,20 +1905,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'All' | 'Empty' | 'Custom'; } - /** @name RmrkTraitsTheme (235) */ + /** @name RmrkTraitsTheme (234) */ export interface RmrkTraitsTheme extends Struct { readonly name: Bytes; readonly properties: Vec; readonly inherit: bool; } - /** @name RmrkTraitsThemeThemeProperty (237) */ + /** @name RmrkTraitsThemeThemeProperty (236) */ export interface RmrkTraitsThemeThemeProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name PalletEvmCall (239) */ + /** @name PalletEvmCall (238) */ export interface PalletEvmCall extends Enum { readonly isWithdraw: boolean; readonly asWithdraw: { @@ -1965,7 +1963,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name PalletEthereumCall (245) */ + /** @name PalletEthereumCall (244) */ export interface PalletEthereumCall extends Enum { readonly isTransact: boolean; readonly asTransact: { @@ -1974,7 +1972,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transact'; } - /** @name EthereumTransactionTransactionV2 (246) */ + /** @name EthereumTransactionTransactionV2 (245) */ export interface EthereumTransactionTransactionV2 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumTransactionLegacyTransaction; @@ -1985,7 +1983,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumTransactionLegacyTransaction (247) */ + /** @name EthereumTransactionLegacyTransaction (246) */ export interface EthereumTransactionLegacyTransaction extends Struct { readonly nonce: U256; readonly gasPrice: U256; @@ -1996,7 +1994,7 @@ declare module '@polkadot/types/lookup' { readonly signature: EthereumTransactionTransactionSignature; } - /** @name EthereumTransactionTransactionAction (248) */ + /** @name EthereumTransactionTransactionAction (247) */ export interface EthereumTransactionTransactionAction extends Enum { readonly isCall: boolean; readonly asCall: H160; @@ -2004,14 +2002,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Call' | 'Create'; } - /** @name EthereumTransactionTransactionSignature (249) */ + /** @name EthereumTransactionTransactionSignature (248) */ export interface EthereumTransactionTransactionSignature extends Struct { readonly v: u64; readonly r: H256; readonly s: H256; } - /** @name EthereumTransactionEip2930Transaction (251) */ + /** @name EthereumTransactionEip2930Transaction (250) */ export interface EthereumTransactionEip2930Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -2026,13 +2024,13 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name EthereumTransactionAccessListItem (253) */ + /** @name EthereumTransactionAccessListItem (252) */ export interface EthereumTransactionAccessListItem extends Struct { readonly address: H160; readonly storageKeys: Vec; } - /** @name EthereumTransactionEip1559Transaction (254) */ + /** @name EthereumTransactionEip1559Transaction (253) */ export interface EthereumTransactionEip1559Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -2048,7 +2046,7 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name PalletEvmMigrationCall (255) */ + /** @name PalletEvmMigrationCall (254) */ export interface PalletEvmMigrationCall extends Enum { readonly isBegin: boolean; readonly asBegin: { @@ -2067,7 +2065,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Begin' | 'SetData' | 'Finish'; } - /** @name PalletSudoEvent (258) */ + /** @name PalletSudoEvent (257) */ export interface PalletSudoEvent extends Enum { readonly isSudid: boolean; readonly asSudid: { @@ -2084,7 +2082,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone'; } - /** @name SpRuntimeDispatchError (260) */ + /** @name SpRuntimeDispatchError (259) */ export interface SpRuntimeDispatchError extends Enum { readonly isOther: boolean; readonly isCannotLookup: boolean; @@ -2103,13 +2101,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional'; } - /** @name SpRuntimeModuleError (261) */ + /** @name SpRuntimeModuleError (260) */ export interface SpRuntimeModuleError extends Struct { readonly index: u8; readonly error: U8aFixed; } - /** @name SpRuntimeTokenError (262) */ + /** @name SpRuntimeTokenError (261) */ export interface SpRuntimeTokenError extends Enum { readonly isNoFunds: boolean; readonly isWouldDie: boolean; @@ -2121,7 +2119,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported'; } - /** @name SpRuntimeArithmeticError (263) */ + /** @name SpRuntimeArithmeticError (262) */ export interface SpRuntimeArithmeticError extends Enum { readonly isUnderflow: boolean; readonly isOverflow: boolean; @@ -2129,20 +2127,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero'; } - /** @name SpRuntimeTransactionalError (264) */ + /** @name SpRuntimeTransactionalError (263) */ export interface SpRuntimeTransactionalError extends Enum { readonly isLimitReached: boolean; readonly isNoLayer: boolean; readonly type: 'LimitReached' | 'NoLayer'; } - /** @name PalletSudoError (265) */ + /** @name PalletSudoError (264) */ export interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: 'RequireSudo'; } - /** @name FrameSystemAccountInfo (266) */ + /** @name FrameSystemAccountInfo (265) */ export interface FrameSystemAccountInfo extends Struct { readonly nonce: u32; readonly consumers: u32; @@ -2151,19 +2149,19 @@ declare module '@polkadot/types/lookup' { readonly data: PalletBalancesAccountData; } - /** @name FrameSupportWeightsPerDispatchClassU64 (267) */ + /** @name FrameSupportWeightsPerDispatchClassU64 (266) */ export interface FrameSupportWeightsPerDispatchClassU64 extends Struct { readonly normal: u64; readonly operational: u64; readonly mandatory: u64; } - /** @name SpRuntimeDigest (268) */ + /** @name SpRuntimeDigest (267) */ export interface SpRuntimeDigest extends Struct { readonly logs: Vec; } - /** @name SpRuntimeDigestDigestItem (270) */ + /** @name SpRuntimeDigestDigestItem (269) */ export interface SpRuntimeDigestDigestItem extends Enum { readonly isOther: boolean; readonly asOther: Bytes; @@ -2177,14 +2175,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated'; } - /** @name FrameSystemEventRecord (272) */ + /** @name FrameSystemEventRecord (271) */ export interface FrameSystemEventRecord extends Struct { readonly phase: FrameSystemPhase; readonly event: Event; readonly topics: Vec; } - /** @name FrameSystemEvent (274) */ + /** @name FrameSystemEvent (273) */ export interface FrameSystemEvent extends Enum { readonly isExtrinsicSuccess: boolean; readonly asExtrinsicSuccess: { @@ -2212,14 +2210,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked'; } - /** @name FrameSupportWeightsDispatchInfo (275) */ + /** @name FrameSupportWeightsDispatchInfo (274) */ export interface FrameSupportWeightsDispatchInfo extends Struct { readonly weight: u64; readonly class: FrameSupportWeightsDispatchClass; readonly paysFee: FrameSupportWeightsPays; } - /** @name FrameSupportWeightsDispatchClass (276) */ + /** @name FrameSupportWeightsDispatchClass (275) */ export interface FrameSupportWeightsDispatchClass extends Enum { readonly isNormal: boolean; readonly isOperational: boolean; @@ -2227,14 +2225,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Normal' | 'Operational' | 'Mandatory'; } - /** @name FrameSupportWeightsPays (277) */ + /** @name FrameSupportWeightsPays (276) */ export interface FrameSupportWeightsPays extends Enum { readonly isYes: boolean; readonly isNo: boolean; readonly type: 'Yes' | 'No'; } - /** @name OrmlVestingModuleEvent (278) */ + /** @name OrmlVestingModuleEvent (277) */ export interface OrmlVestingModuleEvent extends Enum { readonly isVestingScheduleAdded: boolean; readonly asVestingScheduleAdded: { @@ -2254,7 +2252,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated'; } - /** @name CumulusPalletXcmpQueueEvent (279) */ + /** @name CumulusPalletXcmpQueueEvent (278) */ export interface CumulusPalletXcmpQueueEvent extends Enum { readonly isSuccess: boolean; readonly asSuccess: Option; @@ -2275,7 +2273,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name PalletXcmEvent (280) */ + /** @name PalletXcmEvent (279) */ export interface PalletXcmEvent extends Enum { readonly isAttempted: boolean; readonly asAttempted: XcmV2TraitsOutcome; @@ -2312,7 +2310,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail'; } - /** @name XcmV2TraitsOutcome (281) */ + /** @name XcmV2TraitsOutcome (280) */ export interface XcmV2TraitsOutcome extends Enum { readonly isComplete: boolean; readonly asComplete: u64; @@ -2323,7 +2321,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Complete' | 'Incomplete' | 'Error'; } - /** @name CumulusPalletXcmEvent (283) */ + /** @name CumulusPalletXcmEvent (282) */ export interface CumulusPalletXcmEvent extends Enum { readonly isInvalidFormat: boolean; readonly asInvalidFormat: U8aFixed; @@ -2334,7 +2332,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; } - /** @name CumulusPalletDmpQueueEvent (284) */ + /** @name CumulusPalletDmpQueueEvent (283) */ export interface CumulusPalletDmpQueueEvent extends Enum { readonly isInvalidFormat: boolean; readonly asInvalidFormat: { @@ -2369,7 +2367,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name PalletUniqueRawEvent (285) */ + /** @name PalletUniqueRawEvent (284) */ export interface PalletUniqueRawEvent extends Enum { readonly isCollectionSponsorRemoved: boolean; readonly asCollectionSponsorRemoved: u32; @@ -2394,7 +2392,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet'; } - /** @name PalletUniqueSchedulerEvent (286) */ + /** @name PalletUniqueSchedulerEvent (285) */ export interface PalletUniqueSchedulerEvent extends Enum { readonly isScheduled: boolean; readonly asScheduled: { @@ -2421,14 +2419,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; } - /** @name FrameSupportScheduleLookupError (288) */ + /** @name FrameSupportScheduleLookupError (287) */ export interface FrameSupportScheduleLookupError extends Enum { readonly isUnknown: boolean; readonly isBadFormat: boolean; readonly type: 'Unknown' | 'BadFormat'; } - /** @name PalletCommonEvent (289) */ + /** @name PalletCommonEvent (288) */ export interface PalletCommonEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; @@ -2455,14 +2453,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; } - /** @name PalletStructureEvent (290) */ + /** @name PalletStructureEvent (289) */ export interface PalletStructureEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: Result; readonly type: 'Executed'; } - /** @name PalletRmrkCoreEvent (291) */ + /** @name PalletRmrkCoreEvent (290) */ export interface PalletRmrkCoreEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: { @@ -2552,7 +2550,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; } - /** @name PalletRmrkEquipEvent (292) */ + /** @name PalletRmrkEquipEvent (291) */ export interface PalletRmrkEquipEvent extends Enum { readonly isBaseCreated: boolean; readonly asBaseCreated: { @@ -2567,7 +2565,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BaseCreated' | 'EquippablesUpdated'; } - /** @name PalletEvmEvent (293) */ + /** @name PalletEvmEvent (292) */ export interface PalletEvmEvent extends Enum { readonly isLog: boolean; readonly asLog: EthereumLog; @@ -2586,21 +2584,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; } - /** @name EthereumLog (294) */ + /** @name EthereumLog (293) */ export interface EthereumLog extends Struct { readonly address: H160; readonly topics: Vec; readonly data: Bytes; } - /** @name PalletEthereumEvent (295) */ + /** @name PalletEthereumEvent (294) */ export interface PalletEthereumEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; readonly type: 'Executed'; } - /** @name EvmCoreErrorExitReason (296) */ + /** @name EvmCoreErrorExitReason (295) */ export interface EvmCoreErrorExitReason extends Enum { readonly isSucceed: boolean; readonly asSucceed: EvmCoreErrorExitSucceed; @@ -2613,7 +2611,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; } - /** @name EvmCoreErrorExitSucceed (297) */ + /** @name EvmCoreErrorExitSucceed (296) */ export interface EvmCoreErrorExitSucceed extends Enum { readonly isStopped: boolean; readonly isReturned: boolean; @@ -2621,7 +2619,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Stopped' | 'Returned' | 'Suicided'; } - /** @name EvmCoreErrorExitError (298) */ + /** @name EvmCoreErrorExitError (297) */ export interface EvmCoreErrorExitError extends Enum { readonly isStackUnderflow: boolean; readonly isStackOverflow: boolean; @@ -2642,13 +2640,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; } - /** @name EvmCoreErrorExitRevert (301) */ + /** @name EvmCoreErrorExitRevert (300) */ export interface EvmCoreErrorExitRevert extends Enum { readonly isReverted: boolean; readonly type: 'Reverted'; } - /** @name EvmCoreErrorExitFatal (302) */ + /** @name EvmCoreErrorExitFatal (301) */ export interface EvmCoreErrorExitFatal extends Enum { readonly isNotSupported: boolean; readonly isUnhandledInterrupt: boolean; @@ -2659,7 +2657,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; } - /** @name FrameSystemPhase (303) */ + /** @name FrameSystemPhase (302) */ export interface FrameSystemPhase extends Enum { readonly isApplyExtrinsic: boolean; readonly asApplyExtrinsic: u32; @@ -2668,27 +2666,27 @@ declare module '@polkadot/types/lookup' { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } - /** @name FrameSystemLastRuntimeUpgradeInfo (305) */ + /** @name FrameSystemLastRuntimeUpgradeInfo (304) */ export interface FrameSystemLastRuntimeUpgradeInfo extends Struct { readonly specVersion: Compact; readonly specName: Text; } - /** @name FrameSystemLimitsBlockWeights (306) */ + /** @name FrameSystemLimitsBlockWeights (305) */ export interface FrameSystemLimitsBlockWeights extends Struct { readonly baseBlock: u64; readonly maxBlock: u64; readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; } - /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (307) */ + /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (306) */ export interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { readonly normal: FrameSystemLimitsWeightsPerClass; readonly operational: FrameSystemLimitsWeightsPerClass; readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name FrameSystemLimitsWeightsPerClass (308) */ + /** @name FrameSystemLimitsWeightsPerClass (307) */ export interface FrameSystemLimitsWeightsPerClass extends Struct { readonly baseExtrinsic: u64; readonly maxExtrinsic: Option; @@ -2696,25 +2694,25 @@ declare module '@polkadot/types/lookup' { readonly reserved: Option; } - /** @name FrameSystemLimitsBlockLength (310) */ + /** @name FrameSystemLimitsBlockLength (309) */ export interface FrameSystemLimitsBlockLength extends Struct { readonly max: FrameSupportWeightsPerDispatchClassU32; } - /** @name FrameSupportWeightsPerDispatchClassU32 (311) */ + /** @name FrameSupportWeightsPerDispatchClassU32 (310) */ export interface FrameSupportWeightsPerDispatchClassU32 extends Struct { readonly normal: u32; readonly operational: u32; readonly mandatory: u32; } - /** @name FrameSupportWeightsRuntimeDbWeight (312) */ + /** @name FrameSupportWeightsRuntimeDbWeight (311) */ export interface FrameSupportWeightsRuntimeDbWeight extends Struct { readonly read: u64; readonly write: u64; } - /** @name SpVersionRuntimeVersion (313) */ + /** @name SpVersionRuntimeVersion (312) */ export interface SpVersionRuntimeVersion extends Struct { readonly specName: Text; readonly implName: Text; @@ -2726,7 +2724,7 @@ declare module '@polkadot/types/lookup' { readonly stateVersion: u8; } - /** @name FrameSystemError (317) */ + /** @name FrameSystemError (316) */ export interface FrameSystemError extends Enum { readonly isInvalidSpecName: boolean; readonly isSpecVersionNeedsToIncrease: boolean; @@ -2737,7 +2735,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name OrmlVestingModuleError (319) */ + /** @name OrmlVestingModuleError (318) */ export interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; @@ -2748,21 +2746,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (321) */ + /** @name CumulusPalletXcmpQueueInboundChannelDetails (320) */ export interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (322) */ + /** @name CumulusPalletXcmpQueueInboundState (321) */ export interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (325) */ + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (324) */ export interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; @@ -2770,7 +2768,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (328) */ + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (327) */ export interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; @@ -2779,14 +2777,14 @@ declare module '@polkadot/types/lookup' { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (329) */ + /** @name CumulusPalletXcmpQueueOutboundState (328) */ export interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (331) */ + /** @name CumulusPalletXcmpQueueQueueConfigData (330) */ export interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; @@ -2796,7 +2794,7 @@ declare module '@polkadot/types/lookup' { readonly xcmpMaxIndividualWeight: u64; } - /** @name CumulusPalletXcmpQueueError (333) */ + /** @name CumulusPalletXcmpQueueError (332) */ export interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; @@ -2806,7 +2804,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (334) */ + /** @name PalletXcmError (333) */ export interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; @@ -2824,29 +2822,29 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (335) */ + /** @name CumulusPalletXcmError (334) */ export type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (336) */ + /** @name CumulusPalletDmpQueueConfigData (335) */ export interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: u64; } - /** @name CumulusPalletDmpQueuePageIndexData (337) */ + /** @name CumulusPalletDmpQueuePageIndexData (336) */ export interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (340) */ + /** @name CumulusPalletDmpQueueError (339) */ export interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (344) */ + /** @name PalletUniqueError (343) */ export interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; @@ -2855,7 +2853,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name PalletUniqueSchedulerScheduledV3 (347) */ + /** @name PalletUniqueSchedulerScheduledV3 (346) */ export interface PalletUniqueSchedulerScheduledV3 extends Struct { readonly maybeId: Option; readonly priority: u8; @@ -2864,7 +2862,7 @@ declare module '@polkadot/types/lookup' { readonly origin: OpalRuntimeOriginCaller; } - /** @name OpalRuntimeOriginCaller (348) */ + /** @name OpalRuntimeOriginCaller (347) */ export interface OpalRuntimeOriginCaller extends Enum { readonly isVoid: boolean; readonly isSystem: boolean; @@ -2878,7 +2876,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Void' | 'System' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; } - /** @name FrameSupportDispatchRawOrigin (349) */ + /** @name FrameSupportDispatchRawOrigin (348) */ export interface FrameSupportDispatchRawOrigin extends Enum { readonly isRoot: boolean; readonly isSigned: boolean; @@ -2887,7 +2885,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Root' | 'Signed' | 'None'; } - /** @name PalletXcmOrigin (350) */ + /** @name PalletXcmOrigin (349) */ export interface PalletXcmOrigin extends Enum { readonly isXcm: boolean; readonly asXcm: XcmV1MultiLocation; @@ -2896,7 +2894,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Xcm' | 'Response'; } - /** @name CumulusPalletXcmOrigin (351) */ + /** @name CumulusPalletXcmOrigin (350) */ export interface CumulusPalletXcmOrigin extends Enum { readonly isRelay: boolean; readonly isSiblingParachain: boolean; @@ -2904,17 +2902,17 @@ declare module '@polkadot/types/lookup' { readonly type: 'Relay' | 'SiblingParachain'; } - /** @name PalletEthereumRawOrigin (352) */ + /** @name PalletEthereumRawOrigin (351) */ export interface PalletEthereumRawOrigin extends Enum { readonly isEthereumTransaction: boolean; readonly asEthereumTransaction: H160; readonly type: 'EthereumTransaction'; } - /** @name SpCoreVoid (353) */ + /** @name SpCoreVoid (352) */ export type SpCoreVoid = Null; - /** @name PalletUniqueSchedulerError (354) */ + /** @name PalletUniqueSchedulerError (353) */ export interface PalletUniqueSchedulerError extends Enum { readonly isFailedToSchedule: boolean; readonly isNotFound: boolean; @@ -2923,7 +2921,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; } - /** @name UpDataStructsCollection (355) */ + /** @name UpDataStructsCollection (354) */ export interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -2936,7 +2934,7 @@ declare module '@polkadot/types/lookup' { readonly externalCollection: bool; } - /** @name UpDataStructsSponsorshipState (356) */ + /** @name UpDataStructsSponsorshipState (355) */ export interface UpDataStructsSponsorshipState extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -2946,43 +2944,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (357) */ + /** @name UpDataStructsProperties (356) */ export interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (358) */ + /** @name UpDataStructsPropertiesMapBoundedVec (357) */ export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (363) */ + /** @name UpDataStructsPropertiesMapPropertyPermission (362) */ export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (370) */ + /** @name UpDataStructsCollectionStats (369) */ export interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (371) */ + /** @name UpDataStructsTokenChild (370) */ export interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (372) */ + /** @name PhantomTypeUpDataStructs (371) */ export interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (374) */ + /** @name UpDataStructsTokenData (373) */ export interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (376) */ + /** @name UpDataStructsRpcCollection (375) */ export interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -2997,7 +2995,7 @@ declare module '@polkadot/types/lookup' { readonly readOnly: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (377) */ + /** @name RmrkTraitsCollectionCollectionInfo (376) */ export interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; @@ -3006,7 +3004,7 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (378) */ + /** @name RmrkTraitsNftNftInfo (377) */ export interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; @@ -3015,13 +3013,13 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (380) */ + /** @name RmrkTraitsNftRoyaltyInfo (379) */ export interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (381) */ + /** @name RmrkTraitsResourceResourceInfo (380) */ export interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; @@ -3029,26 +3027,26 @@ declare module '@polkadot/types/lookup' { readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (382) */ + /** @name RmrkTraitsPropertyPropertyInfo (381) */ export interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (383) */ + /** @name RmrkTraitsBaseBaseInfo (382) */ export interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (384) */ + /** @name RmrkTraitsNftNftChild (383) */ export interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (386) */ + /** @name PalletCommonError (385) */ export interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; @@ -3087,7 +3085,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (388) */ + /** @name PalletFungibleError (387) */ export interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; @@ -3097,7 +3095,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (389) */ + /** @name PalletRefungibleItemData (388) */ export interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } @@ -3144,7 +3142,6 @@ declare module '@polkadot/types/lookup' { /** @name PalletRmrkCoreError (400) */ export interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; - readonly isNftTypeEncodeError: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; readonly isRmrkPropertyValueIsTooLong: boolean; readonly isRmrkPropertyIsNotFound: boolean; @@ -3163,7 +3160,7 @@ declare module '@polkadot/types/lookup' { readonly isCannotRejectNonPendingNft: boolean; readonly isResourceNotPending: boolean; readonly isNoAvailableResourceId: boolean; - readonly type: 'CorruptedCollectionType' | 'NftTypeEncodeError' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; + readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } /** @name PalletRmrkEquipError (402) */ From 708f63eacf8a1614f103e80dea77a8fa88ac3862 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 4 Aug 2022 07:02:03 +0000 Subject: [PATCH 0179/1274] chore: add check for ERC-20 transfer event on ERC-721 transfer method call --- tests/src/eth/reFungible.test.ts | 34 ++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 3e1ecec6da..551a3b3fda 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -14,9 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {createCollectionExpectSuccess, transfer, UNIQUE} from '../util/helpers'; +import {createCollectionExpectSuccess, UNIQUE} from '../util/helpers'; import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, tokenIdToAddress} from './util/helpers'; -import reFungibleAbi from './reFungibleAbi.json'; import reFungibleTokenAbi from './reFungibleTokenAbi.json'; import {expect} from 'chai'; @@ -242,24 +241,43 @@ describe('Refungible: Plain calls', () => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, caller); const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); const receiver = createEthAccount(web3); const tokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, tokenId).send(); + + const address = tokenIdToAddress(collectionId, tokenId); + const tokenContract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: caller, ...GAS_ARGS}); + await tokenContract.methods.repartition(15).send(); + { - const result = await contract.methods.transferFrom(caller, receiver, tokenId).send(); - const events = normalizeEvents(result.events); - expect(events).to.include.deep.members([ + const erc20Events = await recordEvents(tokenContract, async () => { + const result = await contract.methods.transferFrom(caller, receiver, tokenId).send(); + const events = normalizeEvents(result.events); + expect(events).to.include.deep.members([ + { + address: collectionIdAddress, + event: 'Transfer', + args: { + from: caller, + to: receiver, + tokenId: tokenId.toString(), + }, + }, + ]); + }); + + expect(erc20Events).to.include.deep.members([ { - address: collectionIdAddress, + address, event: 'Transfer', args: { from: caller, to: receiver, - tokenId: tokenId.toString(), + value: '15', }, }, ]); From 0643ad58bc6c4e3d7e559ad784431a1241747149 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 12:48:19 +0300 Subject: [PATCH 0180/1274] Removed un-needed artefacts. Added additional build ARGS. --- .docker/Dockerfile-chain-dev | 14 +-- .docker/Dockerfile-parachain | 59 +++--------- .docker/Dockerfile-parachain-v2 | 96 ------------------ .docker/docker-compose-dev.yaml | 6 +- .docker/docker-compose-tests-parachain.yml | 28 ------ .docker/docker-compose.tmp.j2 | 12 +-- .dockerignore | 1 + .github/workflows/codestyle.yml | 5 +- .github/workflows/node_build_test.yml | 46 +++------ .github/workflows/notify.yml | 17 ---- .github/workflows/tests_codestyle.yml | 5 +- Dockerfile-parachain | 107 --------------------- docker-compose-tests-parachain.yml | 28 ------ 13 files changed, 46 insertions(+), 378 deletions(-) delete mode 100644 .docker/Dockerfile-parachain-v2 delete mode 100644 .docker/docker-compose-tests-parachain.yml delete mode 100644 .github/workflows/notify.yml delete mode 100644 Dockerfile-parachain delete mode 100644 docker-compose-tests-parachain.yml diff --git a/.docker/Dockerfile-chain-dev b/.docker/Dockerfile-chain-dev index 6bbca85bfe..5b1dc890f2 100644 --- a/.docker/Dockerfile-chain-dev +++ b/.docker/Dockerfile-chain-dev @@ -10,9 +10,10 @@ ENV PATH="/cargo-home/bin:$PATH" RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none -ARG RUST_TOOLCHAIN=nightly-2022-04-07 -ARG BRANCH=develop -ARG REPO_URL=https://github.com/UniqueNetwork/unique-chain.git +ARG RUST_TOOLCHAIN=nightly-2022-05-11 +ARG POLKA_VERSION=release-v0.9.24 +ARG BRANCH= +ARG REPO_URL= ARG FEATURE= RUN rustup toolchain uninstall $(rustup toolchain list) && \ @@ -25,11 +26,4 @@ WORKDIR /dev_chain RUN cargo build --release -EXPOSE 9844 -EXPOSE 9944 -EXPOSE 9933 -EXPOSE 9833 -EXPOSE 40333 -EXPOSE 30333 - CMD cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index 3616b16b76..e9dd266681 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -1,27 +1,10 @@ # ===== Rust builder ===== -FROM phusion/baseimage:focal-1.1.0 as rust-builder +FROM ubuntu:20.04 as rust-builder LABEL maintainer="Unique.Network" ARG RUST_TOOLCHAIN=nightly-2022-05-11 -#ARG RUST_C=1.62.0-nightly -ARG POLKA_VERSION=release-v0.9.24 -ARG UNIQUE_BRANCH=develop - -#ARG USER=*** -#ARG PASS=*** - ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN -#ENV RUST_C $RUST_C -ENV POLKA_VERSION $POLKA_VERSION -ENV UNIQUE_BRANCH $UNIQUE_BRANCH - - -#RUN echo $RUST_TOOLCHAIN -#RUN echo $RUST_C -#RUN echo $POLKA_VERSION -#RUN echo $UNIQUE_BRANCH - ENV CARGO_HOME="/cargo-home" ENV PATH="/cargo-home/bin:$PATH" @@ -38,46 +21,41 @@ RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup show RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN -RUN cargo install cargo-chef +RUN pwd && ls -la RUN mkdir unique_parachain WORKDIR /unique_parachain -# ===== Chef ===== -FROM rust-builder as chef - -COPY . . -RUN cargo chef prepare --recipe-path recipe.json - # ===== BUILD ====== FROM rust-builder as builder +ARG PROFILE=release + RUN mkdir unique_parachain WORKDIR /unique_parachain -COPY --from=chef /unique_parachain/recipe.json recipe.json -ARG PROFILE=release -RUN cargo chef cook "--$PROFILE" --recipe-path recipe.json - +RUN pwd && ls -la COPY . . -RUN cargo build "--$PROFILE" +RUN cargo build --$PROFILE # && \ # cargo test # ===== BUILD POLKADOT ===== FROM rust-builder as builder-polkadot +ARG POLKA_VERSION=release-v0.9.24 +ENV POLKA_VERSION $POLKA_VERSION + RUN mkdir unique_parachain WORKDIR /unique_parachain RUN git clone -b $POLKA_VERSION --depth 1 https://github.com/paritytech/polkadot.git && \ cd polkadot && \ - git tag -n && \ - cargo build --release + cargo build --release # ===== RUN ====== -FROM phusion/baseimage:focal-1.1.0 +FROM ubuntu:20.04 ARG PROFILE=release @@ -87,27 +65,20 @@ RUN apt-get -y update && \ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v15.5.0 && \ - nvm use v15.5.0 + nvm install v16.16.0 && \ + nvm use v16.16.0 -RUN git clone https://github.com/paritytech/polkadot-launch +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/parachain-forking RUN export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ npm install --global yarn && \ - yarn + yarn install COPY --from=builder /unique_parachain/target/$PROFILE/unique-collator /unique-chain/target/$PROFILE/ COPY --from=builder-polkadot /unique_parachain/polkadot/target/$PROFILE/polkadot /polkadot/target/$PROFILE/ -EXPOSE 9844 -EXPOSE 9944 -EXPOSE 9933 -EXPOSE 9833 -EXPOSE 40333 -EXPOSE 30333 - CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ diff --git a/.docker/Dockerfile-parachain-v2 b/.docker/Dockerfile-parachain-v2 deleted file mode 100644 index efe86335ac..0000000000 --- a/.docker/Dockerfile-parachain-v2 +++ /dev/null @@ -1,96 +0,0 @@ -# ===== Rust builder ===== -FROM phusion/baseimage:focal-1.1.0 as rust-builder -LABEL maintainer="Unique.Network" - -ARG RUST_TOOLCHAIN={{ actual_toolchain }} -ARG POLKA_VERSION=release-v0.9.24 - - -ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN -ENV POLKA_VERSION $POLKA_VERSION - -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - -RUN apt-get update && \ - apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \ - apt-get install -y cmake pkg-config libssl-dev git clang - -RUN rustup toolchain uninstall $(rustup toolchain list) && \ - rustup toolchain install $RUST_TOOLCHAIN && \ - rustup default $RUST_TOOLCHAIN && \ - rustup target list --installed && \ - rustup show -RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN - -####works inside repo folder### - - -# ===== BUILD ====== -FROM rust-builder as builder-unique - -RUN mkdir unique_parachain -WORKDIR /unique_parachain - -ARG PROFILE='features=quartz-runtime --release' - -COPY . . -RUN cargo build --features=quartz-runtime --release - # && \ - # cargo test - -# ===== BUILD POLKADOT ===== -FROM rust-builder as builder-polkadot - -RUN mkdir unique_parachain -WORKDIR /unique_parachain - -RUN git clone -b $POLKA_VERSION --depth 1 https://github.com/paritytech/polkadot.git && \ - cd polkadot && \ - git tag -n && \ - cargo build --release - -# ===== RUN ====== - -FROM phusion/baseimage:focal-1.1.0 - -#ARG PROFILE='--features=quartz-runtime --release' - -RUN apt-get -y update && \ - apt-get -y upgrade && \ - apt-get -y install curl git && \ - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v15.5.0 && \ - nvm use v15.5.0 - -RUN git clone https://github.com/UniqueNetwork/polkadot-launch.git && \ - cd ./polkadot-launch && \ - git checkout feature/runtime-upgrade-testing - -RUN export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - npm install --global yarn && \ - yarn - -COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ - -COPY ["./launch-config.json", "/polkadot-launch/launch-config.json"] - - -EXPOSE 9844 -EXPOSE 9944 -EXPOSE 9933 -EXPOSE 9833 -EXPOSE 40333 -EXPOSE 30333 - -CMD export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - yarn start launch-config.json diff --git a/.docker/docker-compose-dev.yaml b/.docker/docker-compose-dev.yaml index 2ca4cdf630..2a33de8660 100644 --- a/.docker/docker-compose-dev.yaml +++ b/.docker/docker-compose-dev.yaml @@ -1,12 +1,12 @@ version: "3.5" services: - node-o: + node-dev: build: context: . dockerfile: Dockerfile-chain-dev - image: node-o - container_name: node-o + image: node-dev + container_name: node-dev expose: - 9944 - 9933 diff --git a/.docker/docker-compose-tests-parachain.yml b/.docker/docker-compose-tests-parachain.yml deleted file mode 100644 index ad91a80b5c..0000000000 --- a/.docker/docker-compose-tests-parachain.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: "3.5" - -services: - blockchain_nodes: - build: - context: ./ - dockerfile: Dockerfile-parachain - args: - - RUST_TOOLCHAIN=${RUST_TOOLCHAIN:?err} - - RUST_C=${RUST_C:?err} - - POLKA_VERSION=${POLKA_VERSION:?err} - - UNIQUE_BRANCH=${UNIQUE_BRANCH:?err} - volumes: - - ./launch-config.json:/polkadot-launch/launch-config.json - env_file: - - ./.env - - integration_tests: - build: - context: tests/ - dockerfile: Dockerfile-tests - environment: - RPC_URL: http://blockchain_nodes:9933/ - volumes: - - ./tests/src/config_docker.ts:/unique_parachain/src/config.ts - - /home/ubuntu/mochawesome-report:/unique_parachain/mochawesome-report - depends_on: - - blockchain_nodes diff --git a/.docker/docker-compose.tmp.j2 b/.docker/docker-compose.tmp.j2 index a706a2824f..ee6501061e 100644 --- a/.docker/docker-compose.tmp.j2 +++ b/.docker/docker-compose.tmp.j2 @@ -1,13 +1,13 @@ version: "3.5" services: - node-o: + node-dev: build: args: - - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - - "BRANCH={{ BRANCH }}" - - "REPO_URL={{ REPO_URL }}" - - "FEATURE={{ FEATURE }}" + - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN:?err }}" + - "BRANCH={{ BRANCH:?err }}" + - "REPO_URL={{ REPO_URL:?err }}" + - "FEATURE={{ FEATURE:?err }}" + - "POLKA_VERSION={{ POLKA_VERSION:?err }}" command: cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external - diff --git a/.dockerignore b/.dockerignore index e1d1cd10e1..84fb7b39ab 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,6 @@ .git/ .github/ +.docker/ doc/ target/ tests/ diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 83bcabe390..59b32097e2 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -6,7 +6,8 @@ on: - develop types: - opened - - edited + - reopened + - synchronize jobs: rustfmt: @@ -29,7 +30,7 @@ jobs: runs-on: self-hosted-ci steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Install substrate dependencies run: sudo apt-get install libssl-dev pkg-config libclang-dev clang - name: Install latest nightly diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 0bc9a742c6..33582962d4 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -1,51 +1,27 @@ -name: Build & test +name: Develop - Build & test # Controls when the action will run. on: # Triggers the workflow on push or pull request events but only for the master branch - #push: - # branches: [ develop ] pull_request: branches: - develop types: - opened - - edited - reopened - # pull_request: - # branches: [ develop ] + - synchronize #commit(s) pushed to the pull request + # Allows you to run this workflow manually from the Actions tab workflow_dispatch: #Define Workflow variables env: - ubuntu_version: focal - chains_release_dir: /opt/runner/chains_release - opal_chain_workdir: ./src_opal_chain - quartz_chain_workdir: ./src_quartz_chain - unique_chain_workdir: ./src_unique_chain RUST_TOOLCHAIN: nightly-2022-05-11 REPO_URL: ${{ github.server_url }}/${{ github.repository }} + POLKA_VERSION: release-v0.9.24 # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - pre-requisites: - # The type of runner that the job will run on - runs-on: self-hosted-ci - - steps: - #runs ssh connection - - name: Install dependencies - run: | - sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang make cmake - sudo apt autoremove - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - . $HOME/.cargo/env && cargo install --locked --git https://github.com/chevdor/subwasm - rustup toolchain install ${{ env.RUST_TOOLCHAIN }} - rustup default ${{ env.RUST_TOOLCHAIN }} - rustup target add wasm32-unknown-unknown --toolchain ${{ env.RUST_TOOLCHAIN }} - - build: # The type of runner that the job will run on runs-on: self-hosted-ci @@ -53,13 +29,13 @@ jobs: needs: pre-requisites name: Build Container, Spin it Up an test - continue-on-error: true #Do not stop testing of matrix runs failed. + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: include: - network: "Opal" - features: " " + features: "--features=opal-runtime" - network: "Quartz" features: "--features=quartz-runtime" - network: "Unique" @@ -68,6 +44,8 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} #Checking out head commit - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 @@ -77,25 +55,23 @@ jobs: variables: | REPO_URL=${{ github.server_url }}/${{ github.repository }}.git RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKA_VERSION=${{ env.POLKA_VERSION }} FEATURE=${{ matrix.features }} BRANCH=${{ github.head_ref }} - - name: Show temporary file + - name: Show build configuration run: cat .docker/docker-compose.${{ matrix.network }}.yml - name: Build the stack run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build -# - name: "Build the Docker image with Feature: ${{ env.features }}" -# run: docker build -t build-${{ github.head_ref }} --file .docker/Dockerfile-chain-dev --build-arg REPO_URL=${{ github.server_url }}/${{ github.repository }}.git --build-arg RUST_TOOLCHAIN=${{ env.actual_toolchain }} --build-arg FEATURE="${{ env.features }}" --build-arg BRANCH=${{ github.head_ref }} --no-cache . - - name: Wait run: sleep 420s - name: Install node uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 16.x - name: Install dependencies run: | diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml deleted file mode 100644 index 76508e79af..0000000000 --- a/.github/workflows/notify.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: telegram message -on: - pull_request: - branches: - - develop - types: - - opened - - edited -jobs: - build: - runs-on: self-hosted-ci - steps: - - uses: avkviring/telegram-github-action@v0.0.13 - env: - telegram_to: ${{ secrets.TELEGRAM_TO }} - telegram_token: ${{ secrets.TELEGRAM_TOKEN }} - event: ${{ toJson(github.event) }} diff --git a/.github/workflows/tests_codestyle.yml b/.github/workflows/tests_codestyle.yml index 6f2514864a..8524348e69 100644 --- a/.github/workflows/tests_codestyle.yml +++ b/.github/workflows/tests_codestyle.yml @@ -6,13 +6,14 @@ on: - develop types: - opened - - edited + - reopened + - synchronize jobs: build: runs-on: self-hosted-ci steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install modules run: cd tests && yarn - name: Run ESLint diff --git a/Dockerfile-parachain b/Dockerfile-parachain deleted file mode 100644 index bc687b5f19..0000000000 --- a/Dockerfile-parachain +++ /dev/null @@ -1,107 +0,0 @@ -# ===== Rust builder ===== -FROM phusion/baseimage:focal-1.1.0 as rust-builder -LABEL maintainer="Unique.Network" - -ARG RUST_TOOLCHAIN=nightly-2022-05-11 -#ARG RUST_C=1.62.0-nightly -ARG POLKA_VERSION=release-v0.9.24 -ARG UNIQUE_BRANCH=develop - -#ARG USER=*** -#ARG PASS=*** - - -ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN -#ENV RUST_C $RUST_C -ENV POLKA_VERSION $POLKA_VERSION -ENV UNIQUE_BRANCH $UNIQUE_BRANCH - - -#RUN echo $RUST_TOOLCHAIN -#RUN echo $RUST_C -#RUN echo $POLKA_VERSION -#RUN echo $UNIQUE_BRANCH - -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - -RUN apt-get update && \ - apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \ - apt-get install -y cmake pkg-config libssl-dev git clang - -RUN rustup toolchain uninstall $(rustup toolchain list) && \ - rustup toolchain install $RUST_TOOLCHAIN && \ - rustup default $RUST_TOOLCHAIN && \ - rustup target list --installed && \ - rustup show -RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN - -RUN cargo install cargo-chef - -RUN mkdir unique_parachain -WORKDIR /unique_parachain - -# ===== Chef ===== -FROM rust-builder as chef - -COPY . . -RUN cargo chef prepare --recipe-path recipe.json - -# ===== BUILD ====== -FROM rust-builder as builder - -RUN mkdir unique_parachain -WORKDIR /unique_parachain - -COPY --from=chef /unique_parachain/recipe.json recipe.json -ARG PROFILE=release -RUN cargo chef cook "--$PROFILE" --recipe-path recipe.json - -COPY . . -RUN cargo build "--$PROFILE" - # && \ - # cargo test - -# ===== BUILD POLKADOT ===== -FROM rust-builder as builder-polkadot - -RUN mkdir unique_parachain -WORKDIR /unique_parachain - -RUN git clone -b $POLKA_VERSION --depth 1 https://github.com/paritytech/polkadot.git && \ - cd polkadot && \ - git tag -n && \ - cargo build --release - -# ===== RUN ====== - -FROM phusion/baseimage:focal-1.1.0 - -ARG PROFILE=release - -RUN apt-get -y update && \ - apt-get -y upgrade && \ - apt-get -y install curl git && \ - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v15.5.0 && \ - nvm use v15.5.0 - -RUN git clone https://github.com/paritytech/polkadot-launch - -RUN export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - npm install --global yarn && \ - yarn - -COPY --from=builder /unique_parachain/target/$PROFILE/unique-collator /unique-chain/target/$PROFILE/ -COPY --from=builder-polkadot /unique_parachain/polkadot/target/$PROFILE/polkadot /polkadot/target/$PROFILE/ - -CMD export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - yarn start launch-config.json diff --git a/docker-compose-tests-parachain.yml b/docker-compose-tests-parachain.yml deleted file mode 100644 index ad91a80b5c..0000000000 --- a/docker-compose-tests-parachain.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: "3.5" - -services: - blockchain_nodes: - build: - context: ./ - dockerfile: Dockerfile-parachain - args: - - RUST_TOOLCHAIN=${RUST_TOOLCHAIN:?err} - - RUST_C=${RUST_C:?err} - - POLKA_VERSION=${POLKA_VERSION:?err} - - UNIQUE_BRANCH=${UNIQUE_BRANCH:?err} - volumes: - - ./launch-config.json:/polkadot-launch/launch-config.json - env_file: - - ./.env - - integration_tests: - build: - context: tests/ - dockerfile: Dockerfile-tests - environment: - RPC_URL: http://blockchain_nodes:9933/ - volumes: - - ./tests/src/config_docker.ts:/unique_parachain/src/config.ts - - /home/ubuntu/mochawesome-report:/unique_parachain/mochawesome-report - depends_on: - - blockchain_nodes From c7eab883451821b9c17f7e6e979dddaa460637d0 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 12:59:56 +0300 Subject: [PATCH 0181/1274] Removed stale files. --- .docker/Dockerfile-parachain | 1 - .docker/Dockerfile-parachain-v2 | 97 ---------------------- .docker/docker-compose-tests-parachain.yml | 34 -------- .docker/docker-compose.tmp-master.j2 | 10 --- .docker/docker-compose.tmp.j2 | 7 -- 5 files changed, 149 deletions(-) delete mode 100644 .docker/Dockerfile-parachain-v2 delete mode 100644 .docker/docker-compose-tests-parachain.yml delete mode 100644 .docker/docker-compose.tmp-master.j2 diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index d1d3ae5864..7be3ac7512 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -11,7 +11,6 @@ ENV PATH="/cargo-home/bin:$PATH" RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none RUN apt-get update && \ - apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \ apt-get install -y cmake pkg-config libssl-dev git clang && \ apt-get clean && \ rm -r /var/lib/apt/lists/* diff --git a/.docker/Dockerfile-parachain-v2 b/.docker/Dockerfile-parachain-v2 deleted file mode 100644 index 07876d49fa..0000000000 --- a/.docker/Dockerfile-parachain-v2 +++ /dev/null @@ -1,97 +0,0 @@ -# ===== Rust builder ===== -FROM phusion/baseimage:focal-1.1.0 as rust-builder -LABEL maintainer="Unique.Network" - -ARG RUST_TOOLCHAIN={{ actual_toolchain }} -ARG POLKA_VERSION=release-v0.9.24 - - -ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN -ENV POLKA_VERSION $POLKA_VERSION - -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - -RUN apt-get update && \ - apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \ - apt-get install -y cmake pkg-config libssl-dev git clang - -RUN rustup toolchain uninstall $(rustup toolchain list) && \ - rustup toolchain install $RUST_TOOLCHAIN && \ - rustup default $RUST_TOOLCHAIN && \ - rustup target list --installed && \ - rustup show -RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN - -####works inside repo folder### - - -# ===== BUILD ====== -FROM rust-builder as builder-unique - -RUN mkdir unique_parachain -WORKDIR /unique_parachain - -ARG PROFILE='features=quartz-runtime' - -ENV PROFILE $PROFILE - -COPY . . -RUN cargo build --$PROFILE - # && \ - # cargo test - -# ===== BUILD POLKADOT ===== -FROM rust-builder as builder-polkadot - -RUN mkdir unique_parachain -WORKDIR /unique_parachain - -RUN git clone -b $POLKA_VERSION --depth 1 https://github.com/paritytech/polkadot.git && \ - cd polkadot && \ - git tag -n && \ - cargo build --release - -# ===== RUN ====== - -FROM phusion/baseimage:focal-1.1.0 - - -RUN apt-get -y update && \ - apt-get -y upgrade && \ - apt-get -y install curl git && \ - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v15.5.0 && \ - nvm use v15.5.0 - -RUN git clone https://github.com/UniqueNetwork/polkadot-launch.git && \ - cd ./polkadot-launch && \ - git checkout feature/runtime-upgrade-testing - -RUN export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - npm install --global yarn && \ - yarn - -COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ - -COPY ["./launch-config.json", "/polkadot-launch/launch-config.json"] - - -EXPOSE 9844 -EXPOSE 9944 -EXPOSE 9933 -EXPOSE 9833 -EXPOSE 40333 -EXPOSE 30333 - -CMD export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - yarn start launch-config.json diff --git a/.docker/docker-compose-tests-parachain.yml b/.docker/docker-compose-tests-parachain.yml deleted file mode 100644 index c2578b80a0..0000000000 --- a/.docker/docker-compose-tests-parachain.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: "3.5" - -services: - blockchain_nodes: - build: - context: ../ - dockerfile: .docker/Dockerfile-parachain - args: - - RUST_TOOLCHAIN=${RUST_TOOLCHAIN:?err} - - RUST_C=${RUST_C:?err} - - POLKA_VERSION=${POLKA_VERSION:?err} - - FEATURE=${FEATURE:?err} - volumes: - - ../launch-config.json:/polkadot-launch/launch-config.json - env_file: - - ./.env - expose: - - 9944 - - 9933 - ports: - - 127.0.0.1:9944:9944 - - 127.0.0.1:9933:9933 - -# integration_tests: -# build: -# context: ../tests/ -# dockerfile: Dockerfile-tests -# environment: -# RPC_URL: http://blockchain_nodes:9933/ -# volumes: -# - ./tests/src/config_docker.ts:/unique_parachain/src/config.ts -# - /home/ubuntu/mochawesome-report:/unique_parachain/mochawesome-report -# depends_on: -# - blockchain_nodes diff --git a/.docker/docker-compose.tmp-master.j2 b/.docker/docker-compose.tmp-master.j2 deleted file mode 100644 index 8701fad29c..0000000000 --- a/.docker/docker-compose.tmp-master.j2 +++ /dev/null @@ -1,10 +0,0 @@ -version: "3.5" - -services: - blockchain_nodes: - build: - args: - - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - - "BRANCH={{ BRANCH }}" - - "REPO_URL={{ REPO_URL }}" - - "FEATURE={{ FEATURE }}" diff --git a/.docker/docker-compose.tmp.j2 b/.docker/docker-compose.tmp.j2 index ff6a2f6ebb..ee6501061e 100644 --- a/.docker/docker-compose.tmp.j2 +++ b/.docker/docker-compose.tmp.j2 @@ -4,7 +4,6 @@ services: node-dev: build: args: -<<<<<<< HEAD - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN:?err }}" - "BRANCH={{ BRANCH:?err }}" - "REPO_URL={{ REPO_URL:?err }}" @@ -12,9 +11,3 @@ services: - "POLKA_VERSION={{ POLKA_VERSION:?err }}" command: cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external -======= - - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - - "BRANCH={{ BRANCH }}" - - "REPO_URL={{ REPO_URL }}" - - "FEATURE={{ FEATURE }}" ->>>>>>> develop From 8522be9745b8d445a50e7640b2b7e7f97f85dd6f Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 13:02:01 +0300 Subject: [PATCH 0182/1274] Removed job dependencie. --- .github/workflows/node_build_test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 33582962d4..2d3fe16097 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -26,7 +26,6 @@ jobs: # The type of runner that the job will run on runs-on: self-hosted-ci - needs: pre-requisites name: Build Container, Spin it Up an test continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. From b9780a1177260d02cd93dbabb191519d747eda3a Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 13:05:01 +0300 Subject: [PATCH 0183/1274] Removed semicolomn. --- .docker/docker-compose.tmp.j2 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.docker/docker-compose.tmp.j2 b/.docker/docker-compose.tmp.j2 index ee6501061e..17f877c9fd 100644 --- a/.docker/docker-compose.tmp.j2 +++ b/.docker/docker-compose.tmp.j2 @@ -4,10 +4,10 @@ services: node-dev: build: args: - - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN:?err }}" - - "BRANCH={{ BRANCH:?err }}" - - "REPO_URL={{ REPO_URL:?err }}" - - "FEATURE={{ FEATURE:?err }}" - - "POLKA_VERSION={{ POLKA_VERSION:?err }}" + - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" + - "BRANCH={{ BRANCH }}" + - "REPO_URL={{ REPO_URL }}" + - "FEATURE={{ FEATURE }}" + - "POLKA_VERSION={{ POLKA_VERSION }}" command: cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external From 587c12521303563fa8050d365b5b5670522dd8cc Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 14:03:45 +0300 Subject: [PATCH 0184/1274] Added script for readyness check. --- .docker/readyness.js | 19 +++++++++++++++++++ .github/workflows/node_build_test.yml | 23 +++++++++++++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 .docker/readyness.js diff --git a/.docker/readyness.js b/.docker/readyness.js new file mode 100644 index 0000000000..a31c5c0192 --- /dev/null +++ b/.docker/readyness.js @@ -0,0 +1,19 @@ +#!/usr/bin/env node + +const { ApiPromise, WsProvider } = require('@polkadot/api'); + +const main = async () => { + const wsEndpoint = 'ws://127.0.0.1:9944' + const api = new ApiPromise({provider: new WsProvider(wsEndpoint)}); + await api.isReady; + + const head = (await api.rpc.chain.getHeader()).number.toNumber(); + if(head < 1) throw Error('No block #1'); + + await api.disconnect(); +} + +main().then(() => process.exit(0)).catch(e => { + console.error(e); + process.exit(1); +}); diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 2d3fe16097..1450a89d38 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -41,6 +41,24 @@ jobs: features: "--features=unique-runtime" steps: + - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) + if: github.event.pull_request.draft == true + run: exit 1 + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 with: @@ -64,8 +82,8 @@ jobs: - name: Build the stack run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build - - name: Wait - run: sleep 420s + # - name: Wait + # run: sleep 420s - name: Install node uses: actions/setup-node@v1 @@ -81,6 +99,7 @@ jobs: - name: Run tests run: | + chmod u+x .docker/readyness.js && .docker/readyness.js cd tests NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: From 586d3e075338f30ceef100df22fa3b945799a9d6 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 14:57:42 +0300 Subject: [PATCH 0185/1274] dded installation of @polkadot/api before tests. --- .github/workflows/node_build_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 1450a89d38..cbd78fe8c2 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -95,6 +95,7 @@ jobs: cd tests yarn install yarn add mochawesome + yarn add @polkadot/api yarn --pure-lockfile - name: Run tests From 4f557b269d6a5aea5b097a6a8029a9bdb26600b4 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 15:13:18 +0300 Subject: [PATCH 0186/1274] Temporary disabled some steps in workflow to debug connectivity test. --- .github/workflows/node_build_test.yml | 29 +++++++++++++-------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index cbd78fe8c2..3f1975825f 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -94,8 +94,7 @@ jobs: run: | cd tests yarn install - yarn add mochawesome - yarn add @polkadot/api + yarn add @polkadot/api @polkadot/util@9.4.1 mochawesome yarn --pure-lockfile - name: Run tests @@ -106,16 +105,16 @@ jobs: env: RPC_URL: http://127.0.0.1:9933/ - - name: Test Report - uses: phoenix-actions/test-reporting@v8 - id: test-report # Set ID reference for step - if: success() || failure() # run this step even if previous step failed - with: - name: Tests ${{ matrix.network }} # Name of the check run which will be created - path: tests/mochawesome-report/test-*.json # Path to test results - reporter: mochawesome-json - fail-on-error: 'false' - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down +# - name: Test Report +# uses: phoenix-actions/test-reporting@v8 +# id: test-report # Set ID reference for step +# if: success() || failure() # run this step even if previous step failed +# with: +# name: Tests ${{ matrix.network }} # Name of the check run which will be created +# path: tests/mochawesome-report/test-*.json # Path to test results +# reporter: mochawesome-json +# fail-on-error: 'false' + +# - name: Stop running containers +# if: always() # run this step always +# run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From b7c1009944e804abbf3b322c4fd70a854817db55 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 4 Aug 2022 12:28:57 +0000 Subject: [PATCH 0187/1274] style: format code Signed-off-by: Yaroslav Bolyukin --- pallets/refungible/src/erc.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 11a9fee9de..374d386114 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -560,10 +560,7 @@ impl RefungibleHandle { >::create_item( self, &caller, - CreateItemData:: { - users, - properties, - }, + CreateItemData:: { users, properties }, &budget, ) .map_err(dispatch_to_evm::)?; From d82d09e3c9529878a411088db11d5c19c45c6421 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 4 Aug 2022 12:42:32 +0000 Subject: [PATCH 0188/1274] fix(refungible-pallet): fixed wrong amount in ItemCreated event --- pallets/fungible/src/lib.rs | 16 +++++-------- pallets/refungible/src/erc.rs | 5 +---- tests/src/createItem.test.ts | 31 +++++++++++++++++++++++++- tests/src/util/helpers.ts | 42 ++++++++++++++++++++++------------- 4 files changed, 64 insertions(+), 30 deletions(-) diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index 5c21a59eac..eeb3d03cd6 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -393,14 +393,7 @@ impl Pallet { }) .ok_or(ArithmeticError::Overflow)?; - let mut balances = data; - for (k, v) in balances.iter_mut() { - *v = >::get((collection.id, &k)) - .checked_add(*v) - .ok_or(ArithmeticError::Overflow)?; - } - - for (to, _) in balances.iter() { + for (to, _) in data.iter() { >::check_nesting( sender.clone(), to, @@ -413,8 +406,11 @@ impl Pallet { // ========= >::insert(collection.id, total_supply); - for (user, amount) in balances { - >::insert((collection.id, &user), amount); + for (user, amount) in data { + let updated_balance = >::get((collection.id, &user)) + .checked_add(amount) + .ok_or(ArithmeticError::Overflow)?; + >::insert((collection.id, &user), updated_balance); >::nest_if_sent_to_token_unchecked( &user, collection.id, diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 11a9fee9de..374d386114 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -560,10 +560,7 @@ impl RefungibleHandle { >::create_item( self, &caller, - CreateItemData:: { - users, - properties, - }, + CreateItemData:: { users, properties }, &budget, ) .map_err(dispatch_to_evm::)?; diff --git a/tests/src/createItem.test.ts b/tests/src/createItem.test.ts index 97c754e87d..b4d461df6b 100644 --- a/tests/src/createItem.test.ts +++ b/tests/src/createItem.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {default as usingApi} from './substrate/substrate-api'; +import {default as usingApi, executeTransaction} from './substrate/substrate-api'; import chai from 'chai'; import {IKeyringPair} from '@polkadot/types/types'; import { @@ -26,6 +26,9 @@ import { createItemWithPropsExpectFailure, createCollection, transferExpectSuccess, + itApi, + normalizeAccountId, + getCreateItemResult, } from './util/helpers'; const expect = chai.expect; @@ -50,6 +53,32 @@ describe('integration test: ext. ():', () => { const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}}); await createItemExpectSuccess(alice, newCollectionID, createMode); }); + itApi('Check events on create new item in Fungible collection', async ({api}) => { + const createMode = 'Fungible'; + + const newCollectionID = (await createCollection(api, alice, {mode: {type: createMode, decimalPoints: 0}})).collectionId; + + const to = normalizeAccountId(alice); + { + const createData = {fungible: {value: 100}}; + const tx = api.tx.unique.createItem(newCollectionID, to, createData as any); + const events = await executeTransaction(api, alice, tx); + const result = getCreateItemResult(events); + expect(result.amount).to.be.equal(100); + expect(result.collectionId).to.be.equal(newCollectionID); + expect(result.recipient).to.be.deep.equal(to); + } + { + const createData = {fungible: {value: 50}}; + const tx = api.tx.unique.createItem(newCollectionID, to, createData as any); + const events = await executeTransaction(api, alice, tx); + const result = getCreateItemResult(events); + expect(result.amount).to.be.equal(50); + expect(result.collectionId).to.be.equal(newCollectionID); + expect(result.recipient).to.be.deep.equal(to); + } + + }); it('Create new item in ReFungible collection', async () => { const createMode = 'ReFungible'; const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}}); diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index 79b4538e10..ec18da8027 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -248,22 +248,23 @@ export function getCreateItemsResult(events: EventRecord[]): CreateItemResult[] } export function getCreateItemResult(events: EventRecord[]): CreateItemResult { - const genericResult = getGenericResult<[number, number, CrossAccountId?]>(events, 'common', 'ItemCreated', (data) => [ - parseInt(data[0].toString(), 10), - parseInt(data[1].toString(), 10), - normalizeAccountId(data[2].toJSON() as any), - ]); - - if (genericResult.data == null) genericResult.data = [0, 0]; - - const result: CreateItemResult = { - success: genericResult.success, - collectionId: genericResult.data[0], - itemId: genericResult.data[1], - recipient: genericResult.data![2], - }; + const genericResult = getGenericResult(events, 'common', 'ItemCreated', (data) => data.map(function(value) { return value.toJSON(); })); - return result; + if (genericResult.data == null) + return { + success: genericResult.success, + collectionId: 0, + itemId: 0, + amount: 0, + }; + else + return { + success: genericResult.success, + collectionId: genericResult.data[0] as number, + itemId: genericResult.data[1] as number, + recipient: normalizeAccountId(genericResult.data![2] as any), + amount: genericResult.data[3] as number, + }; } export function getDestroyItemsResult(events: EventRecord[]): DestroyItemResult[] { @@ -1699,3 +1700,14 @@ export async function repartitionRFT( return result.success; } + +export async function itApi(name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean } = {}) { + let i: any = it; + if (opts.only) i = i.only; + else if (opts.skip) i = i.skip; + i(name, async () => { + await usingApi(async (api, privateKeyWrapper) => { + await cb({api, privateKeyWrapper}); + }); + }); +} From b24c77c3dfe4491a34d9049c40167a09c31502d0 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 4 Aug 2022 12:29:44 +0000 Subject: [PATCH 0189/1274] chore: changelog and version --- Cargo.lock | 2 +- pallets/fungible/CHANGELOG.md | 6 ++++++ pallets/fungible/Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1b4aecd6d4..8b9b275663 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5944,7 +5944,7 @@ dependencies = [ [[package]] name = "pallet-fungible" -version = "0.1.1" +version = "0.1.2" dependencies = [ "ethereum", "evm-coder", diff --git a/pallets/fungible/CHANGELOG.md b/pallets/fungible/CHANGELOG.md index 8b2038f60d..9967b4f69d 100644 --- a/pallets/fungible/CHANGELOG.md +++ b/pallets/fungible/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.1.2] - 2022-08-04 + +### Fixed + + - Issue with ItemCreated event containing total supply of tokens instead minted amount + ## [0.1.1] - 2022-07-14 ### Added diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index a8036f6086..dc6d9c327f 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-fungible" -version = "0.1.1" +version = "0.1.2" license = "GPLv3" edition = "2021" From 555373d45fbd5a4fd1d436103cec8d99341bbcd0 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 15:55:01 +0300 Subject: [PATCH 0190/1274] re-enabled steps in workflow. --- .github/workflows/node_build_test.yml | 31 +++++++++++++-------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 3f1975825f..23833d301d 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -82,8 +82,8 @@ jobs: - name: Build the stack run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build - # - name: Wait - # run: sleep 420s + - name: Wait + run: sleep 420s - name: Install node uses: actions/setup-node@v1 @@ -99,22 +99,21 @@ jobs: - name: Run tests run: | - chmod u+x .docker/readyness.js && .docker/readyness.js cd tests NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ -# - name: Test Report -# uses: phoenix-actions/test-reporting@v8 -# id: test-report # Set ID reference for step -# if: success() || failure() # run this step even if previous step failed -# with: -# name: Tests ${{ matrix.network }} # Name of the check run which will be created -# path: tests/mochawesome-report/test-*.json # Path to test results -# reporter: mochawesome-json -# fail-on-error: 'false' - -# - name: Stop running containers -# if: always() # run this step always -# run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + - name: Test Report + uses: phoenix-actions/test-reporting@v8 + id: test-report # Set ID reference for step + if: success() || failure() # run this step even if previous step failed + with: + name: Tests ${{ matrix.network }} # Name of the check run which will be created + path: tests/mochawesome-report/test-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From 69b908e261ea1cfc3e40f177c14646a37edb2b96 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 15:57:25 +0300 Subject: [PATCH 0191/1274] Yet another test. --- .github/workflows/node_build_test.yml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 23833d301d..48eed66f8c 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -99,21 +99,22 @@ jobs: - name: Run tests run: | + node .docker/readyness.js cd tests NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ - - name: Test Report - uses: phoenix-actions/test-reporting@v8 - id: test-report # Set ID reference for step - if: success() || failure() # run this step even if previous step failed - with: - name: Tests ${{ matrix.network }} # Name of the check run which will be created - path: tests/mochawesome-report/test-*.json # Path to test results - reporter: mochawesome-json - fail-on-error: 'false' - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down +# - name: Test Report +# uses: phoenix-actions/test-reporting@v8 +# id: test-report # Set ID reference for step +# if: success() || failure() # run this step even if previous step failed +# with: +# name: Tests ${{ matrix.network }} # Name of the check run which will be created +# path: tests/mochawesome-report/test-*.json # Path to test results +# reporter: mochawesome-json +# fail-on-error: 'false' + +# - name: Stop running containers +# if: always() # run this step always +# run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From 17276cf3fcc47a1d9d02407649a8bc672fdf1308 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 4 Aug 2022 13:21:02 +0000 Subject: [PATCH 0192/1274] chore: fix code review requests --- pallets/fungible/src/lib.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index eeb3d03cd6..458c2dd305 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -403,13 +403,20 @@ impl Pallet { )?; } + let updated_balances = data + .into_iter() + .map(|(user, amount)| { + let updated_balance = >::get((collection.id, &user)) + .checked_add(amount) + .ok_or(ArithmeticError::Overflow)?; + Ok((user, amount, updated_balance)) + }) + .collect::, DispatchError>>()?; + // ========= >::insert(collection.id, total_supply); - for (user, amount) in data { - let updated_balance = >::get((collection.id, &user)) - .checked_add(amount) - .ok_or(ArithmeticError::Overflow)?; + for (user, amount, updated_balance) in updated_balances { >::insert((collection.id, &user), updated_balance); >::nest_if_sent_to_token_unchecked( &user, From 0f1fcf0690b14ded5d90ff4fe03a289e0cef5430 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 16:27:32 +0300 Subject: [PATCH 0193/1274] Changed steps related to testing. --- .github/workflows/node_build_test.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 48eed66f8c..e2a76061f0 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -90,17 +90,21 @@ jobs: with: node-version: 16.x - - name: Install dependencies +# - name: Install dependencies +# run: | +# cd tests +# yarn install +# yarn add @polkadot/api @polkadot/util@9.4.1 mochawesome +# yarn --pure-lockfile + + - name: Run tests run: | cd tests + echi "Installing required packages" yarn install yarn add @polkadot/api @polkadot/util@9.4.1 mochawesome - yarn --pure-lockfile - - - name: Run tests - run: | + echo "Ready to start tests" node .docker/readyness.js - cd tests NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ From bf66909ac26ca3dd54e0c52dc2acb850f2c2e186 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 16:36:43 +0300 Subject: [PATCH 0194/1274] FIX: typo in command name. --- .github/workflows/node_build_test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index e2a76061f0..2837d00f37 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -82,8 +82,8 @@ jobs: - name: Build the stack run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build - - name: Wait - run: sleep 420s +# - name: Wait +# run: sleep 420s - name: Install node uses: actions/setup-node@v1 @@ -100,7 +100,7 @@ jobs: - name: Run tests run: | cd tests - echi "Installing required packages" + echo "Installing required packages" yarn install yarn add @polkadot/api @polkadot/util@9.4.1 mochawesome echo "Ready to start tests" From 07ac38794028433c47d6e5b466ff2ba6a85f6408 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 16:45:28 +0300 Subject: [PATCH 0195/1274] Changed step related to Node JS installation --- .github/workflows/node_build_test.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 2837d00f37..2a6e882ee9 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -85,10 +85,11 @@ jobs: # - name: Wait # run: sleep 420s - - name: Install node - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 16 + cache: 'yarn' + cache-dependency-path: tests/package.json # - name: Install dependencies # run: | @@ -100,9 +101,9 @@ jobs: - name: Run tests run: | cd tests - echo "Installing required packages" - yarn install - yarn add @polkadot/api @polkadot/util@9.4.1 mochawesome + # echo "Installing required packages" + # yarn install + # yarn add polkadot/api polkadot/util mochawesome echo "Ready to start tests" node .docker/readyness.js NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} From 516c65431b799b046f9dac3b920f887de1619b9f Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 16:48:11 +0300 Subject: [PATCH 0196/1274] FIX: removed commented strings from existing step. Not allowed in worflow file. --- .github/workflows/node_build_test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 2a6e882ee9..d3d340a48f 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -101,9 +101,6 @@ jobs: - name: Run tests run: | cd tests - # echo "Installing required packages" - # yarn install - # yarn add polkadot/api polkadot/util mochawesome echo "Ready to start tests" node .docker/readyness.js NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} From 7f5fa2e0f14701b8e994d5ca4ffba0d38d6f06ae Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 17:07:02 +0300 Subject: [PATCH 0197/1274] FIX: removed cache config from Setup-node step. --- .github/workflows/node_build_test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index d3d340a48f..9a4be5258f 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -88,7 +88,6 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16 - cache: 'yarn' cache-dependency-path: tests/package.json # - name: Install dependencies From 3d0d9bf1d3073fbf8e363d4473bdf0158ecaeac2 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 17:10:02 +0300 Subject: [PATCH 0198/1274] Re-vert back node modules installation. --- .github/workflows/node_build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 9a4be5258f..9ff2b3cb90 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -88,7 +88,6 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16 - cache-dependency-path: tests/package.json # - name: Install dependencies # run: | @@ -100,6 +99,7 @@ jobs: - name: Run tests run: | cd tests + yarn add polkadot/api polkadot/util mochawesome echo "Ready to start tests" node .docker/readyness.js NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} From 7c6613d16d0088ac93de4cf230534752eea19a2c Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 17:11:59 +0300 Subject: [PATCH 0199/1274] FIX: change node modules version. --- .github/workflows/node_build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 9ff2b3cb90..4d92c2ce87 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -99,7 +99,7 @@ jobs: - name: Run tests run: | cd tests - yarn add polkadot/api polkadot/util mochawesome + yarn add @polkadot/api @polkadot/util mochawesome echo "Ready to start tests" node .docker/readyness.js NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} From e67e67c16ff0d539d8a428beb169c43b3b4e0686 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 17:18:27 +0300 Subject: [PATCH 0200/1274] Added output of node version. --- .docker/readyness.js | 2 -- .github/workflows/node_build_test.yml | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.docker/readyness.js b/.docker/readyness.js index a31c5c0192..69ee983ca9 100644 --- a/.docker/readyness.js +++ b/.docker/readyness.js @@ -1,5 +1,3 @@ -#!/usr/bin/env node - const { ApiPromise, WsProvider } = require('@polkadot/api'); const main = async () => { diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 4d92c2ce87..fd3df0564c 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -100,6 +100,7 @@ jobs: run: | cd tests yarn add @polkadot/api @polkadot/util mochawesome + node -v echo "Ready to start tests" node .docker/readyness.js NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} From a764b45f251cd75c9b53b52aec60bcdf4d109491 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 17:22:04 +0300 Subject: [PATCH 0201/1274] Re-ordered sequence inside test step. --- .docker/Dockerfile-chain-dev | 2 +- .github/workflows/node_build_test.yml | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/.docker/Dockerfile-chain-dev b/.docker/Dockerfile-chain-dev index 5b1dc890f2..06a50729f8 100644 --- a/.docker/Dockerfile-chain-dev +++ b/.docker/Dockerfile-chain-dev @@ -21,7 +21,7 @@ RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup default $RUST_TOOLCHAIN && \ rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN -RUN mkdir /dev_chain && git clone $REPO_URL /dev_chain && cd /dev_chain && git checkout $BRANCH +RUN mkdir /dev_chain && git clone $REPO_URL -b $BRANCH /dev_chain WORKDIR /dev_chain RUN cargo build --release diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index fd3df0564c..cdbcb40fa0 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -87,22 +87,15 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 16 - -# - name: Install dependencies -# run: | -# cd tests -# yarn install -# yarn add @polkadot/api @polkadot/util@9.4.1 mochawesome -# yarn --pure-lockfile + node-version: 14 - name: Run tests run: | - cd tests yarn add @polkadot/api @polkadot/util mochawesome node -v echo "Ready to start tests" node .docker/readyness.js + cd tests NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ From 0be66a6524422dd874c16713c876981703c941d0 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 17:37:15 +0300 Subject: [PATCH 0202/1274] Changed Node JS version 14 -> 16 --- .github/workflows/node_build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index cdbcb40fa0..dacb4395b1 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -87,7 +87,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 16 - name: Run tests run: | From 8fcfaf37f8d357a683250638b29410592988126a Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 17:50:30 +0300 Subject: [PATCH 0203/1274] Readyness script update. --- .docker/readyness.js | 2 +- .github/workflows/node_build_test.yml | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.docker/readyness.js b/.docker/readyness.js index 69ee983ca9..1f957ed038 100644 --- a/.docker/readyness.js +++ b/.docker/readyness.js @@ -3,7 +3,7 @@ const { ApiPromise, WsProvider } = require('@polkadot/api'); const main = async () => { const wsEndpoint = 'ws://127.0.0.1:9944' const api = new ApiPromise({provider: new WsProvider(wsEndpoint)}); - await api.isReady; + await api.isReadyOrError; const head = (await api.rpc.chain.getHeader()).number.toNumber(); if(head < 1) throw Error('No block #1'); diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index dacb4395b1..873345ad96 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -100,16 +100,16 @@ jobs: env: RPC_URL: http://127.0.0.1:9933/ -# - name: Test Report -# uses: phoenix-actions/test-reporting@v8 -# id: test-report # Set ID reference for step -# if: success() || failure() # run this step even if previous step failed -# with: -# name: Tests ${{ matrix.network }} # Name of the check run which will be created -# path: tests/mochawesome-report/test-*.json # Path to test results -# reporter: mochawesome-json -# fail-on-error: 'false' - -# - name: Stop running containers -# if: always() # run this step always -# run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + - name: Test Report + uses: phoenix-actions/test-reporting@v8 + id: test-report # Set ID reference for step + if: success() || failure() # run this step even if previous step failed + with: + name: Tests ${{ matrix.network }} # Name of the check run which will be created + path: tests/mochawesome-report/test-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From 3c6191db673258b2ed6d140538431fdeb9334c07 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 17:55:31 +0300 Subject: [PATCH 0204/1274] Installing node modules by yarn. --- .github/workflows/node_build_test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 873345ad96..879d388bee 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -82,15 +82,13 @@ jobs: - name: Build the stack run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build -# - name: Wait -# run: sleep 420s - - uses: actions/setup-node@v3 with: node-version: 16 - name: Run tests run: | + yarn install yarn add @polkadot/api @polkadot/util mochawesome node -v echo "Ready to start tests" From fa62c9b90e81d2beae4f00109a583429f00539fc Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 18:09:23 +0300 Subject: [PATCH 0205/1274] Switching back to v14. --- .github/workflows/node_build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 879d388bee..6e95c82c0d 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -84,7 +84,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 14 - name: Run tests run: | From 976c728cb71b05eca5a0525166bdd5ab7df3b31a Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 18:13:40 +0300 Subject: [PATCH 0206/1274] Readyness script has been updated. --- .docker/readyness.js | 20 +++++++++++++++++++- .github/workflows/node_build_test.yml | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.docker/readyness.js b/.docker/readyness.js index 1f957ed038..aed97bdc09 100644 --- a/.docker/readyness.js +++ b/.docker/readyness.js @@ -1,6 +1,6 @@ const { ApiPromise, WsProvider } = require('@polkadot/api'); -const main = async () => { +const connect = async () => { const wsEndpoint = 'ws://127.0.0.1:9944' const api = new ApiPromise({provider: new WsProvider(wsEndpoint)}); await api.isReadyOrError; @@ -11,6 +11,24 @@ const main = async () => { await api.disconnect(); } +const sleep = time => { + return new Promise(resolve => { + setTimeout(() => resolve(), time); + }); +} + +const main = async () { + while(true) { + try { + await connect(); + break; + } + catch(e) { + await sleep(1000); + } + } +} + main().then(() => process.exit(0)).catch(e => { console.error(e); process.exit(1); diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 6e95c82c0d..879d388bee 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -84,7 +84,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 16 - name: Run tests run: | From 5caf7c35f6bfaf80b012c4a80c58f55b76691dbe Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 18:16:39 +0300 Subject: [PATCH 0207/1274] FIX: added missed symbols. --- .docker/readyness.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/readyness.js b/.docker/readyness.js index aed97bdc09..c01da8c6e9 100644 --- a/.docker/readyness.js +++ b/.docker/readyness.js @@ -17,7 +17,7 @@ const sleep = time => { }); } -const main = async () { +const main = async () => { while(true) { try { await connect(); From 6c4b42e7495812882cf7c485b5fa93761db735ec Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 18:23:42 +0300 Subject: [PATCH 0208/1274] Chaned wait timeout 1s -> 15s --- .docker/readyness.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/readyness.js b/.docker/readyness.js index c01da8c6e9..4698f09afe 100644 --- a/.docker/readyness.js +++ b/.docker/readyness.js @@ -24,7 +24,7 @@ const main = async () => { break; } catch(e) { - await sleep(1000); + await sleep(15000); } } } From 97d69906aae8797eacf78bd23374aa7e7b7fb1e0 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 18:33:23 +0300 Subject: [PATCH 0209/1274] Changed timeout 15s ->30s. Added installation node_modules mocha --- .docker/readyness.js | 2 +- .github/workflows/node_build_test.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.docker/readyness.js b/.docker/readyness.js index 4698f09afe..fe5f5cf380 100644 --- a/.docker/readyness.js +++ b/.docker/readyness.js @@ -24,7 +24,7 @@ const main = async () => { break; } catch(e) { - await sleep(15000); + await sleep(30000); } } } diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 879d388bee..165e15e12e 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -89,7 +89,8 @@ jobs: - name: Run tests run: | yarn install - yarn add @polkadot/api @polkadot/util mochawesome + yarn add @polkadot/api @polkadot/util mocha mochawesome + node -v echo "Ready to start tests" node .docker/readyness.js From d71661f9416376691167b66016b982e63cbcfb0e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 18:45:46 +0300 Subject: [PATCH 0210/1274] Increased timeout. --- .docker/readyness.js | 2 +- .github/workflows/node_build_test.yml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.docker/readyness.js b/.docker/readyness.js index fe5f5cf380..a36b6104e3 100644 --- a/.docker/readyness.js +++ b/.docker/readyness.js @@ -24,7 +24,7 @@ const main = async () => { break; } catch(e) { - await sleep(30000); + await sleep(60000); } } } diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 165e15e12e..b8c221ae01 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -89,9 +89,8 @@ jobs: - name: Run tests run: | yarn install - yarn add @polkadot/api @polkadot/util mocha mochawesome - - node -v + yarn add @polkadot/api @polkadot/util@9.4.1 mochawesome + yarn --pure-lockfile echo "Ready to start tests" node .docker/readyness.js cd tests From 46f00bd2135bee5b84c69af72bf4b0b95ecb70f0 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 18:54:48 +0300 Subject: [PATCH 0211/1274] dded node package mocha@>=7 --- .github/workflows/node_build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index b8c221ae01..77b417aa47 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -89,7 +89,7 @@ jobs: - name: Run tests run: | yarn install - yarn add @polkadot/api @polkadot/util@9.4.1 mochawesome + yarn add @polkadot/api @polkadot/util@9.4.1 mochawesome mocha@>=7 yarn --pure-lockfile echo "Ready to start tests" node .docker/readyness.js From 3defb533db02e957e2093cff366ba2311df93da1 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 19:31:16 +0300 Subject: [PATCH 0212/1274] Readyness check script moved to tests sub-directory --- .github/workflows/node_build_test.yml | 6 +++--- {.docker => tests/scripts}/readyness.js | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename {.docker => tests/scripts}/readyness.js (100%) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 77b417aa47..64d7c266d0 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -88,12 +88,12 @@ jobs: - name: Run tests run: | + cd tests yarn install - yarn add @polkadot/api @polkadot/util@9.4.1 mochawesome mocha@>=7 + yarn add @polkadot/api mochawesome yarn --pure-lockfile echo "Ready to start tests" - node .docker/readyness.js - cd tests + node scripts/readyness.js NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ diff --git a/.docker/readyness.js b/tests/scripts/readyness.js similarity index 100% rename from .docker/readyness.js rename to tests/scripts/readyness.js From 5870d1072200b681d750322b7f5997457817ba95 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 19:49:49 +0300 Subject: [PATCH 0213/1274] Node JS version changed 16 -> 14 --- .github/workflows/node_build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 64d7c266d0..76445f60c7 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -84,7 +84,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 14 - name: Run tests run: | From 7be38fd475290fdf6f85e1371f08f9320b24b302 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 20:24:22 +0300 Subject: [PATCH 0214/1274] Node JS 16 --- .github/workflows/node_build_test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 76445f60c7..cfb657f507 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -84,13 +84,12 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 16 - name: Run tests run: | cd tests yarn install - yarn add @polkadot/api mochawesome yarn --pure-lockfile echo "Ready to start tests" node scripts/readyness.js From e03c80d2f43d719c594dd6596b785a3c244bbcef Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 21:30:18 +0300 Subject: [PATCH 0215/1274] Order changed. --- .github/workflows/node_build_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index cfb657f507..5a5ec3bd6b 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -90,6 +90,7 @@ jobs: run: | cd tests yarn install + yarn add mochawesome yarn --pure-lockfile echo "Ready to start tests" node scripts/readyness.js From 809f0d002966d9a949eaf4e0a9745212cd98c532 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 22:23:50 +0300 Subject: [PATCH 0216/1274] Try remove ID from test step. --- .github/workflows/node_build_test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 5a5ec3bd6b..8e189045f1 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -100,7 +100,6 @@ jobs: - name: Test Report uses: phoenix-actions/test-reporting@v8 - id: test-report # Set ID reference for step if: success() || failure() # run this step even if previous step failed with: name: Tests ${{ matrix.network }} # Name of the check run which will be created @@ -108,6 +107,10 @@ jobs: reporter: mochawesome-json fail-on-error: 'false' + - name: Read output variables + run: | + echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}" + - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From a0c3d00b1541abc15950bf95dc05a1e324010ced Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 22:40:56 +0300 Subject: [PATCH 0217/1274] Removed workflow for master. too early. --- .github/workflows/build-test-master.yml | 126 ------------------------ .github/workflows/tests_codestyle.yml | 5 + 2 files changed, 5 insertions(+), 126 deletions(-) delete mode 100644 .github/workflows/build-test-master.yml diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml deleted file mode 100644 index a5e0891d40..0000000000 --- a/.github/workflows/build-test-master.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: Build & Test Master - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - #push: - # branches: [ develop ] - pull_request: - branches: - - master - types: - - opened - - edited - - reopened - # pull_request: - # branches: [ develop ] - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -#Define Workflow variables -env: - ubuntu_version: focal - chains_release_dir: /opt/runner/chains_release - opal_chain_workdir: ./src_opal_chain - quartz_chain_workdir: ./src_quartz_chain - unique_chain_workdir: ./src_unique_chain - RUST_TOOLCHAIN: nightly-2022-05-11 - REPO_URL: ${{ github.server_url }}/${{ github.repository }} - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - pre-requisites: - # The type of runner that the job will run on - runs-on: self-hosted-ci - - steps: - #runs ssh connection - - name: Install dependencies - run: | - sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang make cmake - sudo apt autoremove - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - . $HOME/.cargo/env && cargo install --locked --git https://github.com/chevdor/subwasm - rustup toolchain install ${{ env.RUST_TOOLCHAIN }} - rustup default ${{ env.RUST_TOOLCHAIN }} - rustup target add wasm32-unknown-unknown --toolchain ${{ env.RUST_TOOLCHAIN }} - - - build: - # The type of runner that the job will run on - runs-on: self-hosted-ci - - needs: pre-requisites - name: Build Container, Spin it Up an test - - continue-on-error: true #Do not stop testing of matrix runs failed. - - strategy: - matrix: - include: - - network: "Opal" - features: " " - - network: "Quartz" - features: "--features=quartz-runtime" - - network: "Unique" - features: "--features=unique-runtime" - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - - - name: Generate ENV related extend file for docker-compose - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/docker-compose.tmp-master.j2 - output_file: .docker/docker-compose.${{ matrix.network }}.yml - variables: | - REPO_URL=${{ github.server_url }}/${{ github.repository }}.git - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - FEATURE=${{ matrix.features }} - BRANCH=${{ github.head_ref }} - - - name: Show temporary file - run: cat .docker/docker-compose.${{ matrix.network }}.yml - - - name: Build the stack - run: docker-compose -f ".docker/docker-compose-tests-parachain.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build - -# - name: "Build the Docker image with Feature: ${{ env.features }}" -# run: docker build -t build-${{ github.head_ref }} --file .docker/Dockerfile-chain-dev --build-arg REPO_URL=${{ github.server_url }}/${{ github.repository }}.git --build-arg RUST_TOOLCHAIN=${{ env.actual_toolchain }} --build-arg FEATURE="${{ env.features }}" --build-arg BRANCH=${{ github.head_ref }} --no-cache . - - - name: Wait - run: sleep 420s - - - name: Install node - uses: actions/setup-node@v1 - with: - node-version: 14.x - - - name: Install dependencies - run: | - cd tests - yarn install - yarn add mochawesome - yarn --pure-lockfile - - - name: Run tests - run: | - cd tests - NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} - env: - RPC_URL: http://127.0.0.1:9933/ - - - name: Test Report - uses: phoenix-actions/test-reporting@v8 - id: test-report # Set ID reference for step - if: success() || failure() # run this step even if previous step failed - with: - name: Tests ${{ matrix.network }} # Name of the check run which will be created - path: tests/mochawesome-report/test-*.json # Path to test results - reporter: mochawesome-json - fail-on-error: 'false' - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-tests-parachain.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down diff --git a/.github/workflows/tests_codestyle.yml b/.github/workflows/tests_codestyle.yml index 8524348e69..bc0886b110 100644 --- a/.github/workflows/tests_codestyle.yml +++ b/.github/workflows/tests_codestyle.yml @@ -14,6 +14,11 @@ jobs: steps: - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Install modules run: cd tests && yarn - name: Run ESLint From f9465867a0f03aa1bf29cc8d22bc46fa931e9742 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 4 Aug 2022 22:59:07 +0300 Subject: [PATCH 0218/1274] final cleanup --- .docker/.env | 7 ------- .docker/Dockerfile-parachain | 7 +++---- 2 files changed, 3 insertions(+), 11 deletions(-) delete mode 100644 .docker/.env diff --git a/.docker/.env b/.docker/.env deleted file mode 100644 index e3e3073e5a..0000000000 --- a/.docker/.env +++ /dev/null @@ -1,7 +0,0 @@ -RUST_TOOLCHAIN=nightly-2022-05-11 -RUST_C=1.62.0-nightly -POLKA_VERSION=release-v0.9.24 -UNIQUE_BRANCH=develop -FEATURE='--features=quartz-runtime' -USER=*** -PASS=*** diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index 7be3ac7512..6e1f5e6d3b 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -22,7 +22,6 @@ RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup show RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN -RUN pwd && ls -la RUN mkdir unique_parachain WORKDIR /unique_parachain @@ -31,13 +30,13 @@ WORKDIR /unique_parachain FROM rust-builder as builder-unique ARG PROFILE=release +ARG FEATURE= RUN mkdir unique_parachain WORKDIR /unique_parachain -RUN pwd && ls -la -COPY . . -RUN cargo build --$PROFILE +RUN git clone $REPO_URL -b $BRANCH +RUN cargo build $FEATURE --$PROFILE # && \ # cargo test From 246a7cb4abd75e07d906462125d7de424272ccbc Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 5 Aug 2022 11:39:00 +0300 Subject: [PATCH 0219/1274] Fixing spoted items. --- .docker/Dockerfile-parachain | 10 +++----- .github/workflows/codestyle.yml | 36 +++++++++++++++++++++++++++ .github/workflows/node_build_test.yml | 3 +-- .github/workflows/tests_codestyle.yml | 36 ++++++++++++++++++++------- tests/scripts/readyness.js | 2 +- 5 files changed, 69 insertions(+), 18 deletions(-) diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index 6e1f5e6d3b..ae67e2fa53 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -23,7 +23,7 @@ RUN rustup toolchain uninstall $(rustup toolchain list) && \ RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN -RUN mkdir unique_parachain +RUN mkdir /unique_parachain WORKDIR /unique_parachain # ===== BUILD ====== @@ -32,13 +32,11 @@ FROM rust-builder as builder-unique ARG PROFILE=release ARG FEATURE= -RUN mkdir unique_parachain +RUN mkdir /unique_parachain WORKDIR /unique_parachain RUN git clone $REPO_URL -b $BRANCH RUN cargo build $FEATURE --$PROFILE - # && \ - # cargo test # ===== BUILD POLKADOT ===== FROM rust-builder as builder-polkadot @@ -46,7 +44,7 @@ FROM rust-builder as builder-polkadot ARG POLKA_VERSION=release-v0.9.24 ENV POLKA_VERSION $POLKA_VERSION -RUN mkdir unique_parachain +RUN mkdir /unique_parachain WORKDIR /unique_parachain RUN git clone -b $POLKA_VERSION --depth 1 https://github.com/paritytech/polkadot.git && \ @@ -77,7 +75,7 @@ RUN export NVM_DIR="$HOME/.nvm" && \ COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY ["./launch-config.json", "/polkadot-launch/launch-config.json"] +COPY --from=builder-unique /unique_parachain/launch-config.json /polkadot-launch/launch-config.json CMD export NVM_DIR="$HOME/.nvm" && \ diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 59b32097e2..d590dbb7f2 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -14,6 +14,24 @@ jobs: runs-on: self-hosted-ci steps: + - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) + if: github.event.pull_request.draft == true + run: exit 1 + - uses: actions/checkout@v1 - name: Install latest nightly uses: actions-rs/toolchain@v1 @@ -30,6 +48,24 @@ jobs: runs-on: self-hosted-ci steps: + - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) + if: github.event.pull_request.draft == true + run: exit 1 + - uses: actions/checkout@v3 - name: Install substrate dependencies run: sudo apt-get install libssl-dev pkg-config libclang-dev clang diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 8e189045f1..7c131af76a 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -74,7 +74,7 @@ jobs: RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} POLKA_VERSION=${{ env.POLKA_VERSION }} FEATURE=${{ matrix.features }} - BRANCH=${{ github.head_ref }} + BRANCH=${{ github.event.pull_request.head.sha }} - name: Show build configuration run: cat .docker/docker-compose.${{ matrix.network }}.yml @@ -91,7 +91,6 @@ jobs: cd tests yarn install yarn add mochawesome - yarn --pure-lockfile echo "Ready to start tests" node scripts/readyness.js NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} diff --git a/.github/workflows/tests_codestyle.yml b/.github/workflows/tests_codestyle.yml index bc0886b110..3b5db2133c 100644 --- a/.github/workflows/tests_codestyle.yml +++ b/.github/workflows/tests_codestyle.yml @@ -13,13 +13,31 @@ jobs: runs-on: self-hosted-ci steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - node-version: 16 + - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) + if: github.event.pull_request.draft == true + run: exit 1 - - name: Install modules - run: cd tests && yarn - - name: Run ESLint - run: cd tests && yarn eslint --ext .ts,.js src/ + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Install modules + run: cd tests && yarn + - name: Run ESLint + run: cd tests && yarn eslint --ext .ts,.js src/ diff --git a/tests/scripts/readyness.js b/tests/scripts/readyness.js index a36b6104e3..6543bfc7d2 100644 --- a/tests/scripts/readyness.js +++ b/tests/scripts/readyness.js @@ -24,7 +24,7 @@ const main = async () => { break; } catch(e) { - await sleep(60000); + await sleep(10000); } } } From 4a5e049a3b40ba8c0dfa061a437fcf22b91bb175 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 5 Aug 2022 12:56:15 +0300 Subject: [PATCH 0220/1274] Revert back file --- pallets/common/CHANGELOG.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pallets/common/CHANGELOG.md b/pallets/common/CHANGELOG.md index 5235f6362e..fed1457338 100644 --- a/pallets/common/CHANGELOG.md +++ b/pallets/common/CHANGELOG.md @@ -2,13 +2,11 @@ All notable changes to this project will be documented in this file. -## [0.1.3] - 2022-07-25 -### Add -- Some static property keys and values. +## [0.1.1] - 2022-07-14 -## [0.1.2] - 2022-07-20 +### Added -### Fixed + - Implementation of RPC method `token_owners` returning 10 owners in no particular order. + This was an internal request to improve the web interface and support fractionalization event. -- Some methods in `#[solidity_interface]` for `CollectionHandle` had invalid - mutability modifiers, causing invalid stub/abi generation. + \ No newline at end of file From 85bb1d2a058658c073fb7e42dbd8a68ee62f8136 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 5 Aug 2022 13:19:01 +0300 Subject: [PATCH 0221/1274] Switch back to github.base_ref. --- .github/workflows/node_build_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 7c131af76a..20c2c9d10b 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -62,7 +62,7 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 with: - ref: ${{ github.event.pull_request.head.sha }} #Checking out head commit + ref: ${{ github.head_ref }} #Checking out head commit - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 @@ -74,7 +74,7 @@ jobs: RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} POLKA_VERSION=${{ env.POLKA_VERSION }} FEATURE=${{ matrix.features }} - BRANCH=${{ github.event.pull_request.head.sha }} + BRANCH=${{ github.base_ref }} - name: Show build configuration run: cat .docker/docker-compose.${{ matrix.network }}.yml From a5940c7bd7095dd62edda58517cebb0b18ef9db4 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 5 Aug 2022 13:45:10 +0300 Subject: [PATCH 0222/1274] FIX: typo - ggithub.base_ref -> github.head_ref --- .github/workflows/node_build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 20c2c9d10b..af29985b42 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -74,7 +74,7 @@ jobs: RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} POLKA_VERSION=${{ env.POLKA_VERSION }} FEATURE=${{ matrix.features }} - BRANCH=${{ github.base_ref }} + BRANCH=${{ github.head_ref }} - name: Show build configuration run: cat .docker/docker-compose.${{ matrix.network }}.yml From 9f15e9c99690bcc6c453b14f5bdd0d6a82618c90 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 5 Aug 2022 14:05:35 +0300 Subject: [PATCH 0223/1274] Escaping feature build ARG due to equal sign inside. --- .github/workflows/node_build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index af29985b42..7f0413efde 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -73,7 +73,7 @@ jobs: REPO_URL=${{ github.server_url }}/${{ github.repository }}.git RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} POLKA_VERSION=${{ env.POLKA_VERSION }} - FEATURE=${{ matrix.features }} + FEATURE='${{ matrix.features }}' BRANCH=${{ github.head_ref }} - name: Show build configuration From 26386c57998e1dfecf10fde223d7c2c31966ef4e Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 5 Aug 2022 12:59:22 +0000 Subject: [PATCH 0224/1274] chore: add `only` and `skip` to `itApi` function --- tests/src/util/helpers.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index ec18da8027..46cf666f87 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -1711,3 +1711,6 @@ export async function itApi(name: string, cb: (apis: { api: ApiPromise, privateK }); }); } + +itApi.only = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {only: true}); +itApi.skip = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {skip: true}); From ec332a0b04f62f7c330bf60d1aa17f0ca6b11b16 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 4 Aug 2022 14:01:05 +0000 Subject: [PATCH 0225/1274] refactor(pallet-refungible): disallow invalid bulk mints `create_multiple_items_ex` was allowing invalid (that will be always rejected at runtime level) refungible mint extrinsics, by passing multiple users into `RefungibleMultipleItems` call. PRODUCT: Now RefungibleMultipleItems may only receive single user on type level. Signed-off-by: Yaroslav Bolyukin --- pallets/refungible/Cargo.toml | 1 + pallets/refungible/src/common.rs | 41 ++++++++++++++++++++---------- pallets/refungible/src/erc.rs | 8 +++--- pallets/refungible/src/lib.rs | 25 ++++++++++++------ primitives/data-structs/src/lib.rs | 16 +++++++++--- 5 files changed, 63 insertions(+), 28 deletions(-) diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index e99ca89401..b40018e411 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -28,6 +28,7 @@ pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +derivative = { version = "2.2.0", features = ["use_core"] } [features] default = ["std"] diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index beab0f12ad..5f6c8af9a4 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -19,8 +19,9 @@ use core::marker::PhantomData; use sp_std::collections::btree_map::BTreeMap; use frame_support::{dispatch::DispatchResultWithPostInfo, ensure, fail, weights::Weight, traits::Get}; use up_data_structs::{ - CollectionId, TokenId, CreateItemExData, CreateRefungibleExData, budget::Budget, Property, - PropertyKey, PropertyValue, PropertyKeyPermission, CreateItemData, CollectionPropertiesVec, + CollectionId, TokenId, CreateItemExData, budget::Budget, Property, PropertyKey, PropertyValue, + PropertyKeyPermission, CollectionPropertiesVec, CreateRefungibleExMultipleOwners, + CreateRefungibleExSingleOwner, }; use pallet_common::{ CommonCollectionOperations, CommonWeightInfo, RefungibleExtensions, with_weight, @@ -32,7 +33,7 @@ use sp_std::{vec::Vec, vec}; use crate::{ AccountBalance, Allowance, Balance, Config, Error, Owned, Pallet, RefungibleHandle, - SelfWeightOf, TokenData, weights::WeightInfo, TokensMinted, TotalSupply, + SelfWeightOf, TokenData, weights::WeightInfo, TokensMinted, TotalSupply, CreateItemData, }; macro_rules! max_weight_of { @@ -58,11 +59,11 @@ impl CommonWeightInfo for CommonWeights { >::create_item() } - fn create_multiple_items(data: &[CreateItemData]) -> Weight { + fn create_multiple_items(data: &[up_data_structs::CreateItemData]) -> Weight { >::create_multiple_items(data.len() as u32).saturating_add( data.iter() .map(|data| match data { - CreateItemData::ReFungible(rft_data) => { + up_data_structs::CreateItemData::ReFungible(rft_data) => { properties_weight::(&rft_data.properties) } _ => 0, @@ -152,9 +153,9 @@ impl CommonWeightInfo for CommonWeights { fn map_create_data( data: up_data_structs::CreateItemData, to: &T::CrossAccountId, -) -> Result, DispatchError> { +) -> Result, DispatchError> { match data { - up_data_structs::CreateItemData::ReFungible(data) => Ok(CreateRefungibleExData { + up_data_structs::CreateItemData::ReFungible(data) => Ok(CreateItemData { users: { let mut out = BTreeMap::new(); out.insert(to.clone(), data.pieces); @@ -214,12 +215,26 @@ impl CommonCollectionOperations for RefungibleHandle { ) -> DispatchResultWithPostInfo { let weight = >::create_multiple_items_ex(&data); let data = match data { - CreateItemExData::RefungibleMultipleOwners(r) => vec![r], - CreateItemExData::RefungibleMultipleItems(r) - if r.iter().all(|i| i.users.len() == 1) => - { - r.into_inner() - } + CreateItemExData::RefungibleMultipleOwners(CreateRefungibleExMultipleOwners { + users, + properties, + }) => vec![CreateItemData { users, properties }], + CreateItemExData::RefungibleMultipleItems(r) => r + .into_inner() + .into_iter() + .map( + |CreateRefungibleExSingleOwner { + user, + pieces, + properties, + }| CreateItemData { + users: BTreeMap::from([(user, pieces)]) + .try_into() + .expect("limit >= 1"), + properties, + }, + ) + .collect(), _ => fail!(>::NotRefungibleDataUsedToMintFungibleCollectionToken), }; diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 374d386114..4b77e5c311 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -494,7 +494,7 @@ impl RefungibleHandle { >::create_item( self, &caller, - CreateItemData:: { + CreateItemData:: { users, properties: CollectionPropertiesVec::default(), }, @@ -560,7 +560,7 @@ impl RefungibleHandle { >::create_item( self, &caller, - CreateItemData:: { users, properties }, + CreateItemData:: { users, properties }, &budget, ) .map_err(dispatch_to_evm::)?; @@ -717,7 +717,7 @@ impl RefungibleHandle { .collect::>() .try_into() .unwrap(); - let create_item_data = CreateItemData:: { + let create_item_data = CreateItemData:: { users, properties: CollectionPropertiesVec::default(), }; @@ -777,7 +777,7 @@ impl RefungibleHandle { }) .map_err(|e| Error::Revert(alloc::format!("Can't add property: {:?}", e)))?; - let create_item_data = CreateItemData:: { + let create_item_data = CreateItemData:: { users: users.clone(), properties, }; diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 734fd9df84..7912ff7467 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -93,7 +93,9 @@ use crate::erc::ERC721Events; use codec::{Encode, Decode, MaxEncodedLen}; use core::ops::Deref; use evm_coder::ToLog; -use frame_support::{BoundedVec, ensure, fail, storage::with_transaction, transactional}; +use frame_support::{ + BoundedVec, ensure, fail, storage::with_transaction, transactional, pallet_prelude::ConstU32, +}; use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; use pallet_evm_coder_substrate::WithRecorder; use pallet_common::{ @@ -106,11 +108,13 @@ use sp_core::H160; use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome}; use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap}; use up_data_structs::{ - AccessMode, budget::Budget, CollectionId, CreateCollectionData, CreateRefungibleExData, - CustomDataLimit, mapping::TokenAddressMapping, MAX_REFUNGIBLE_PIECES, TokenId, Property, + AccessMode, budget::Budget, CollectionId, CreateCollectionData, CustomDataLimit, + mapping::TokenAddressMapping, MAX_REFUNGIBLE_PIECES, MAX_ITEMS_PER_BATCH, TokenId, Property, PropertyKey, PropertyKeyPermission, PropertyPermission, PropertyScope, PropertyValue, - TrySetProperty, + TrySetProperty, CollectionPropertiesVec, }; +use frame_support::BoundedBTreeMap; +use derivative::Derivative; pub use pallet::*; #[cfg(feature = "runtime-benchmarks")] @@ -120,8 +124,13 @@ pub mod erc; pub mod erc_token; pub mod weights; -pub type CreateItemData = - CreateRefungibleExData<::CrossAccountId>; +#[derive(Derivative, Clone)] +pub struct CreateItemData { + #[derivative(Debug(format_with = "bounded::map_debug"))] + pub users: BoundedBTreeMap>, + #[derivative(Debug(format_with = "bounded::vec_debug"))] + pub properties: CollectionPropertiesVec, +} pub(crate) type SelfWeightOf = ::WeightInfo; /// Token data, stored independently from other data used to describe it @@ -873,7 +882,7 @@ impl Pallet { pub fn create_multiple_items( collection: &RefungibleHandle, sender: &T::CrossAccountId, - data: Vec>, + data: Vec>, nesting_budget: &dyn Budget, ) -> DispatchResult { if !collection.is_owner_or_admin(sender) { @@ -1213,7 +1222,7 @@ impl Pallet { pub fn create_item( collection: &RefungibleHandle, sender: &T::CrossAccountId, - data: CreateItemData, + data: CreateItemData, nesting_budget: &dyn Budget, ) -> DispatchResult { Self::create_multiple_items(collection, sender, vec![data], nesting_budget) diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 6a89531bfe..9180f3d050 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -826,13 +826,23 @@ pub struct CreateNftExData { /// Extended data for create ReFungible item. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] #[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))] -pub struct CreateRefungibleExData { +pub struct CreateRefungibleExMultipleOwners { #[derivative(Debug(format_with = "bounded::map_debug"))] pub users: BoundedBTreeMap>, #[derivative(Debug(format_with = "bounded::vec_debug"))] pub properties: CollectionPropertiesVec, } +/// Extended data for create ReFungible item. +#[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] +#[derivative(Debug(bound = "CrossAccountId: fmt::Debug"))] +pub struct CreateRefungibleExSingleOwner { + pub user: CrossAccountId, + pub pieces: u128, + #[derivative(Debug(format_with = "bounded::vec_debug"))] + pub properties: CollectionPropertiesVec, +} + /// Unified extended data for creating item. #[derive(Encode, Decode, MaxEncodedLen, PartialEq, Clone, TypeInfo, Derivative)] #[derivative(Debug(bound = "CrossAccountId: fmt::Debug + Ord"))] @@ -853,12 +863,12 @@ pub enum CreateItemExData { /// many tokens, each may have only one owner RefungibleMultipleItems( #[derivative(Debug(format_with = "bounded::vec_debug"))] - BoundedVec, ConstU32>, + BoundedVec, ConstU32>, ), /// Extended data for create ReFungible item in case of /// single token, which may have many owners - RefungibleMultipleOwners(CreateRefungibleExData), + RefungibleMultipleOwners(CreateRefungibleExMultipleOwners), } impl From for CreateItemData { From d22deefd17936ba9f0a8297378cf3ea4be153a0f Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 4 Aug 2022 14:23:00 +0000 Subject: [PATCH 0226/1274] test: regenerate types Signed-off-by: Yaroslav Bolyukin --- tests/src/interfaces/augment-types.ts | 5 +- tests/src/interfaces/default/types.ts | 15 +- tests/src/interfaces/lookup.ts | 310 +++++++++++++------------- tests/src/interfaces/registry.ts | 5 +- tests/src/interfaces/types-lookup.ts | 309 ++++++++++++------------- 5 files changed, 334 insertions(+), 310 deletions(-) diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index e0d8942652..5a0f6ea569 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExData, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; @@ -1216,7 +1216,8 @@ declare module '@polkadot/types/types/registry' { UpDataStructsCreateNftData: UpDataStructsCreateNftData; UpDataStructsCreateNftExData: UpDataStructsCreateNftExData; UpDataStructsCreateReFungibleData: UpDataStructsCreateReFungibleData; - UpDataStructsCreateRefungibleExData: UpDataStructsCreateRefungibleExData; + UpDataStructsCreateRefungibleExMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners; + UpDataStructsCreateRefungibleExSingleOwner: UpDataStructsCreateRefungibleExSingleOwner; UpDataStructsNestingPermissions: UpDataStructsNestingPermissions; UpDataStructsOwnerRestrictedSet: UpDataStructsOwnerRestrictedSet; UpDataStructsProperties: UpDataStructsProperties; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index af3dabfc7f..531999e156 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -2439,9 +2439,9 @@ export interface UpDataStructsCreateItemExData extends Enum { readonly isFungible: boolean; readonly asFungible: BTreeMap; readonly isRefungibleMultipleItems: boolean; - readonly asRefungibleMultipleItems: Vec; + readonly asRefungibleMultipleItems: Vec; readonly isRefungibleMultipleOwners: boolean; - readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExData; + readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners; readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; } @@ -2462,12 +2462,19 @@ export interface UpDataStructsCreateReFungibleData extends Struct { readonly properties: Vec; } -/** @name UpDataStructsCreateRefungibleExData */ -export interface UpDataStructsCreateRefungibleExData extends Struct { +/** @name UpDataStructsCreateRefungibleExMultipleOwners */ +export interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { readonly users: BTreeMap; readonly properties: Vec; } +/** @name UpDataStructsCreateRefungibleExSingleOwner */ +export interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { + readonly user: PalletEvmAccountBasicCrossAccountIdRepr; + readonly pieces: u128; + readonly properties: Vec; +} + /** @name UpDataStructsNestingPermissions */ export interface UpDataStructsNestingPermissions extends Struct { readonly tokenOwner: bool; diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index dbece8b120..0238bd7d0b 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -1511,8 +1511,8 @@ export default { _enum: { NFT: 'Vec', Fungible: 'BTreeMap', - RefungibleMultipleItems: 'Vec', - RefungibleMultipleOwners: 'UpDataStructsCreateRefungibleExData' + RefungibleMultipleItems: 'Vec', + RefungibleMultipleOwners: 'UpDataStructsCreateRefungibleExMultipleOwners' } }, /** @@ -1523,14 +1523,22 @@ export default { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup201: up_data_structs::CreateRefungibleExData> + * Lookup201: up_data_structs::CreateRefungibleExSingleOwner> **/ - UpDataStructsCreateRefungibleExData: { + UpDataStructsCreateRefungibleExSingleOwner: { + user: 'PalletEvmAccountBasicCrossAccountIdRepr', + pieces: 'u128', + properties: 'Vec' + }, + /** + * Lookup203: up_data_structs::CreateRefungibleExMultipleOwners> + **/ + UpDataStructsCreateRefungibleExMultipleOwners: { users: 'BTreeMap', properties: 'Vec' }, /** - * Lookup203: pallet_unique_scheduler::pallet::Call + * Lookup204: pallet_unique_scheduler::pallet::Call **/ PalletUniqueSchedulerCall: { _enum: { @@ -1554,7 +1562,7 @@ export default { } }, /** - * Lookup205: frame_support::traits::schedule::MaybeHashed + * Lookup206: frame_support::traits::schedule::MaybeHashed **/ FrameSupportScheduleMaybeHashed: { _enum: { @@ -1563,15 +1571,15 @@ export default { } }, /** - * Lookup206: pallet_template_transaction_payment::Call + * Lookup207: pallet_template_transaction_payment::Call **/ PalletTemplateTransactionPaymentCall: 'Null', /** - * Lookup207: pallet_structure::pallet::Call + * Lookup208: pallet_structure::pallet::Call **/ PalletStructureCall: 'Null', /** - * Lookup208: pallet_rmrk_core::pallet::Call + * Lookup209: pallet_rmrk_core::pallet::Call **/ PalletRmrkCoreCall: { _enum: { @@ -1662,7 +1670,7 @@ export default { } }, /** - * Lookup214: rmrk_traits::resource::ResourceTypes, frame_support::storage::bounded_vec::BoundedVec> + * Lookup215: rmrk_traits::resource::ResourceTypes, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceTypes: { _enum: { @@ -1672,7 +1680,7 @@ export default { } }, /** - * Lookup216: rmrk_traits::resource::BasicResource> + * Lookup217: rmrk_traits::resource::BasicResource> **/ RmrkTraitsResourceBasicResource: { src: 'Option', @@ -1681,7 +1689,7 @@ export default { thumb: 'Option' }, /** - * Lookup218: rmrk_traits::resource::ComposableResource, frame_support::storage::bounded_vec::BoundedVec> + * Lookup219: rmrk_traits::resource::ComposableResource, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsResourceComposableResource: { parts: 'Vec', @@ -1692,7 +1700,7 @@ export default { thumb: 'Option' }, /** - * Lookup219: rmrk_traits::resource::SlotResource> + * Lookup220: rmrk_traits::resource::SlotResource> **/ RmrkTraitsResourceSlotResource: { base: 'u32', @@ -1703,7 +1711,7 @@ export default { thumb: 'Option' }, /** - * Lookup221: rmrk_traits::nft::AccountIdOrCollectionNftTuple + * Lookup222: rmrk_traits::nft::AccountIdOrCollectionNftTuple **/ RmrkTraitsNftAccountIdOrCollectionNftTuple: { _enum: { @@ -1712,7 +1720,7 @@ export default { } }, /** - * Lookup225: pallet_rmrk_equip::pallet::Call + * Lookup226: pallet_rmrk_equip::pallet::Call **/ PalletRmrkEquipCall: { _enum: { @@ -1733,7 +1741,7 @@ export default { } }, /** - * Lookup228: rmrk_traits::part::PartType, frame_support::storage::bounded_vec::BoundedVec> + * Lookup229: rmrk_traits::part::PartType, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsPartPartType: { _enum: { @@ -1742,7 +1750,7 @@ export default { } }, /** - * Lookup230: rmrk_traits::part::FixedPart> + * Lookup231: rmrk_traits::part::FixedPart> **/ RmrkTraitsPartFixedPart: { id: 'u32', @@ -1750,7 +1758,7 @@ export default { src: 'Bytes' }, /** - * Lookup231: rmrk_traits::part::SlotPart, frame_support::storage::bounded_vec::BoundedVec> + * Lookup232: rmrk_traits::part::SlotPart, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsPartSlotPart: { id: 'u32', @@ -1759,7 +1767,7 @@ export default { z: 'u32' }, /** - * Lookup232: rmrk_traits::part::EquippableList> + * Lookup233: rmrk_traits::part::EquippableList> **/ RmrkTraitsPartEquippableList: { _enum: { @@ -1769,7 +1777,7 @@ export default { } }, /** - * Lookup234: rmrk_traits::theme::Theme, frame_support::storage::bounded_vec::BoundedVec>, S>> + * Lookup235: rmrk_traits::theme::Theme, frame_support::storage::bounded_vec::BoundedVec>, S>> **/ RmrkTraitsTheme: { name: 'Bytes', @@ -1777,14 +1785,14 @@ export default { inherit: 'bool' }, /** - * Lookup236: rmrk_traits::theme::ThemeProperty> + * Lookup237: rmrk_traits::theme::ThemeProperty> **/ RmrkTraitsThemeThemeProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup238: pallet_evm::pallet::Call + * Lookup239: pallet_evm::pallet::Call **/ PalletEvmCall: { _enum: { @@ -1827,7 +1835,7 @@ export default { } }, /** - * Lookup244: pallet_ethereum::pallet::Call + * Lookup245: pallet_ethereum::pallet::Call **/ PalletEthereumCall: { _enum: { @@ -1837,7 +1845,7 @@ export default { } }, /** - * Lookup245: ethereum::transaction::TransactionV2 + * Lookup246: ethereum::transaction::TransactionV2 **/ EthereumTransactionTransactionV2: { _enum: { @@ -1847,7 +1855,7 @@ export default { } }, /** - * Lookup246: ethereum::transaction::LegacyTransaction + * Lookup247: ethereum::transaction::LegacyTransaction **/ EthereumTransactionLegacyTransaction: { nonce: 'U256', @@ -1859,7 +1867,7 @@ export default { signature: 'EthereumTransactionTransactionSignature' }, /** - * Lookup247: ethereum::transaction::TransactionAction + * Lookup248: ethereum::transaction::TransactionAction **/ EthereumTransactionTransactionAction: { _enum: { @@ -1868,7 +1876,7 @@ export default { } }, /** - * Lookup248: ethereum::transaction::TransactionSignature + * Lookup249: ethereum::transaction::TransactionSignature **/ EthereumTransactionTransactionSignature: { v: 'u64', @@ -1876,7 +1884,7 @@ export default { s: 'H256' }, /** - * Lookup250: ethereum::transaction::EIP2930Transaction + * Lookup251: ethereum::transaction::EIP2930Transaction **/ EthereumTransactionEip2930Transaction: { chainId: 'u64', @@ -1892,14 +1900,14 @@ export default { s: 'H256' }, /** - * Lookup252: ethereum::transaction::AccessListItem + * Lookup253: ethereum::transaction::AccessListItem **/ EthereumTransactionAccessListItem: { address: 'H160', storageKeys: 'Vec' }, /** - * Lookup253: ethereum::transaction::EIP1559Transaction + * Lookup254: ethereum::transaction::EIP1559Transaction **/ EthereumTransactionEip1559Transaction: { chainId: 'u64', @@ -1916,7 +1924,7 @@ export default { s: 'H256' }, /** - * Lookup254: pallet_evm_migration::pallet::Call + * Lookup255: pallet_evm_migration::pallet::Call **/ PalletEvmMigrationCall: { _enum: { @@ -1934,7 +1942,7 @@ export default { } }, /** - * Lookup257: pallet_sudo::pallet::Event + * Lookup258: pallet_sudo::pallet::Event **/ PalletSudoEvent: { _enum: { @@ -1950,7 +1958,7 @@ export default { } }, /** - * Lookup259: sp_runtime::DispatchError + * Lookup260: sp_runtime::DispatchError **/ SpRuntimeDispatchError: { _enum: { @@ -1967,38 +1975,38 @@ export default { } }, /** - * Lookup260: sp_runtime::ModuleError + * Lookup261: sp_runtime::ModuleError **/ SpRuntimeModuleError: { index: 'u8', error: '[u8;4]' }, /** - * Lookup261: sp_runtime::TokenError + * Lookup262: sp_runtime::TokenError **/ SpRuntimeTokenError: { _enum: ['NoFunds', 'WouldDie', 'BelowMinimum', 'CannotCreate', 'UnknownAsset', 'Frozen', 'Unsupported'] }, /** - * Lookup262: sp_runtime::ArithmeticError + * Lookup263: sp_runtime::ArithmeticError **/ SpRuntimeArithmeticError: { _enum: ['Underflow', 'Overflow', 'DivisionByZero'] }, /** - * Lookup263: sp_runtime::TransactionalError + * Lookup264: sp_runtime::TransactionalError **/ SpRuntimeTransactionalError: { _enum: ['LimitReached', 'NoLayer'] }, /** - * Lookup264: pallet_sudo::pallet::Error + * Lookup265: pallet_sudo::pallet::Error **/ PalletSudoError: { _enum: ['RequireSudo'] }, /** - * Lookup265: frame_system::AccountInfo> + * Lookup266: frame_system::AccountInfo> **/ FrameSystemAccountInfo: { nonce: 'u32', @@ -2008,7 +2016,7 @@ export default { data: 'PalletBalancesAccountData' }, /** - * Lookup266: frame_support::weights::PerDispatchClass + * Lookup267: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassU64: { normal: 'u64', @@ -2016,13 +2024,13 @@ export default { mandatory: 'u64' }, /** - * Lookup267: sp_runtime::generic::digest::Digest + * Lookup268: sp_runtime::generic::digest::Digest **/ SpRuntimeDigest: { logs: 'Vec' }, /** - * Lookup269: sp_runtime::generic::digest::DigestItem + * Lookup270: sp_runtime::generic::digest::DigestItem **/ SpRuntimeDigestDigestItem: { _enum: { @@ -2038,7 +2046,7 @@ export default { } }, /** - * Lookup271: frame_system::EventRecord + * Lookup272: frame_system::EventRecord **/ FrameSystemEventRecord: { phase: 'FrameSystemPhase', @@ -2046,7 +2054,7 @@ export default { topics: 'Vec' }, /** - * Lookup273: frame_system::pallet::Event + * Lookup274: frame_system::pallet::Event **/ FrameSystemEvent: { _enum: { @@ -2074,7 +2082,7 @@ export default { } }, /** - * Lookup274: frame_support::weights::DispatchInfo + * Lookup275: frame_support::weights::DispatchInfo **/ FrameSupportWeightsDispatchInfo: { weight: 'u64', @@ -2082,19 +2090,19 @@ export default { paysFee: 'FrameSupportWeightsPays' }, /** - * Lookup275: frame_support::weights::DispatchClass + * Lookup276: frame_support::weights::DispatchClass **/ FrameSupportWeightsDispatchClass: { _enum: ['Normal', 'Operational', 'Mandatory'] }, /** - * Lookup276: frame_support::weights::Pays + * Lookup277: frame_support::weights::Pays **/ FrameSupportWeightsPays: { _enum: ['Yes', 'No'] }, /** - * Lookup277: orml_vesting::module::Event + * Lookup278: orml_vesting::module::Event **/ OrmlVestingModuleEvent: { _enum: { @@ -2113,7 +2121,7 @@ export default { } }, /** - * Lookup278: cumulus_pallet_xcmp_queue::pallet::Event + * Lookup279: cumulus_pallet_xcmp_queue::pallet::Event **/ CumulusPalletXcmpQueueEvent: { _enum: { @@ -2128,7 +2136,7 @@ export default { } }, /** - * Lookup279: pallet_xcm::pallet::Event + * Lookup280: pallet_xcm::pallet::Event **/ PalletXcmEvent: { _enum: { @@ -2151,7 +2159,7 @@ export default { } }, /** - * Lookup280: xcm::v2::traits::Outcome + * Lookup281: xcm::v2::traits::Outcome **/ XcmV2TraitsOutcome: { _enum: { @@ -2161,7 +2169,7 @@ export default { } }, /** - * Lookup282: cumulus_pallet_xcm::pallet::Event + * Lookup283: cumulus_pallet_xcm::pallet::Event **/ CumulusPalletXcmEvent: { _enum: { @@ -2171,7 +2179,7 @@ export default { } }, /** - * Lookup283: cumulus_pallet_dmp_queue::pallet::Event + * Lookup284: cumulus_pallet_dmp_queue::pallet::Event **/ CumulusPalletDmpQueueEvent: { _enum: { @@ -2202,7 +2210,7 @@ export default { } }, /** - * Lookup284: pallet_unique::RawEvent> + * Lookup285: pallet_unique::RawEvent> **/ PalletUniqueRawEvent: { _enum: { @@ -2219,7 +2227,7 @@ export default { } }, /** - * Lookup285: pallet_unique_scheduler::pallet::Event + * Lookup286: pallet_unique_scheduler::pallet::Event **/ PalletUniqueSchedulerEvent: { _enum: { @@ -2244,13 +2252,13 @@ export default { } }, /** - * Lookup287: frame_support::traits::schedule::LookupError + * Lookup288: frame_support::traits::schedule::LookupError **/ FrameSupportScheduleLookupError: { _enum: ['Unknown', 'BadFormat'] }, /** - * Lookup288: pallet_common::pallet::Event + * Lookup289: pallet_common::pallet::Event **/ PalletCommonEvent: { _enum: { @@ -2268,7 +2276,7 @@ export default { } }, /** - * Lookup289: pallet_structure::pallet::Event + * Lookup290: pallet_structure::pallet::Event **/ PalletStructureEvent: { _enum: { @@ -2276,7 +2284,7 @@ export default { } }, /** - * Lookup290: pallet_rmrk_core::pallet::Event + * Lookup291: pallet_rmrk_core::pallet::Event **/ PalletRmrkCoreEvent: { _enum: { @@ -2353,7 +2361,7 @@ export default { } }, /** - * Lookup291: pallet_rmrk_equip::pallet::Event + * Lookup292: pallet_rmrk_equip::pallet::Event **/ PalletRmrkEquipEvent: { _enum: { @@ -2368,7 +2376,7 @@ export default { } }, /** - * Lookup292: pallet_evm::pallet::Event + * Lookup293: pallet_evm::pallet::Event **/ PalletEvmEvent: { _enum: { @@ -2382,7 +2390,7 @@ export default { } }, /** - * Lookup293: ethereum::log::Log + * Lookup294: ethereum::log::Log **/ EthereumLog: { address: 'H160', @@ -2390,7 +2398,7 @@ export default { data: 'Bytes' }, /** - * Lookup294: pallet_ethereum::pallet::Event + * Lookup295: pallet_ethereum::pallet::Event **/ PalletEthereumEvent: { _enum: { @@ -2398,7 +2406,7 @@ export default { } }, /** - * Lookup295: evm_core::error::ExitReason + * Lookup296: evm_core::error::ExitReason **/ EvmCoreErrorExitReason: { _enum: { @@ -2409,13 +2417,13 @@ export default { } }, /** - * Lookup296: evm_core::error::ExitSucceed + * Lookup297: evm_core::error::ExitSucceed **/ EvmCoreErrorExitSucceed: { _enum: ['Stopped', 'Returned', 'Suicided'] }, /** - * Lookup297: evm_core::error::ExitError + * Lookup298: evm_core::error::ExitError **/ EvmCoreErrorExitError: { _enum: { @@ -2437,13 +2445,13 @@ export default { } }, /** - * Lookup300: evm_core::error::ExitRevert + * Lookup301: evm_core::error::ExitRevert **/ EvmCoreErrorExitRevert: { _enum: ['Reverted'] }, /** - * Lookup301: evm_core::error::ExitFatal + * Lookup302: evm_core::error::ExitFatal **/ EvmCoreErrorExitFatal: { _enum: { @@ -2454,7 +2462,7 @@ export default { } }, /** - * Lookup302: frame_system::Phase + * Lookup303: frame_system::Phase **/ FrameSystemPhase: { _enum: { @@ -2464,14 +2472,14 @@ export default { } }, /** - * Lookup304: frame_system::LastRuntimeUpgradeInfo + * Lookup305: frame_system::LastRuntimeUpgradeInfo **/ FrameSystemLastRuntimeUpgradeInfo: { specVersion: 'Compact', specName: 'Text' }, /** - * Lookup305: frame_system::limits::BlockWeights + * Lookup306: frame_system::limits::BlockWeights **/ FrameSystemLimitsBlockWeights: { baseBlock: 'u64', @@ -2479,7 +2487,7 @@ export default { perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass' }, /** - * Lookup306: frame_support::weights::PerDispatchClass + * Lookup307: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassWeightsPerClass: { normal: 'FrameSystemLimitsWeightsPerClass', @@ -2487,7 +2495,7 @@ export default { mandatory: 'FrameSystemLimitsWeightsPerClass' }, /** - * Lookup307: frame_system::limits::WeightsPerClass + * Lookup308: frame_system::limits::WeightsPerClass **/ FrameSystemLimitsWeightsPerClass: { baseExtrinsic: 'u64', @@ -2496,13 +2504,13 @@ export default { reserved: 'Option' }, /** - * Lookup309: frame_system::limits::BlockLength + * Lookup310: frame_system::limits::BlockLength **/ FrameSystemLimitsBlockLength: { max: 'FrameSupportWeightsPerDispatchClassU32' }, /** - * Lookup310: frame_support::weights::PerDispatchClass + * Lookup311: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassU32: { normal: 'u32', @@ -2510,14 +2518,14 @@ export default { mandatory: 'u32' }, /** - * Lookup311: frame_support::weights::RuntimeDbWeight + * Lookup312: frame_support::weights::RuntimeDbWeight **/ FrameSupportWeightsRuntimeDbWeight: { read: 'u64', write: 'u64' }, /** - * Lookup312: sp_version::RuntimeVersion + * Lookup313: sp_version::RuntimeVersion **/ SpVersionRuntimeVersion: { specName: 'Text', @@ -2530,19 +2538,19 @@ export default { stateVersion: 'u8' }, /** - * Lookup316: frame_system::pallet::Error + * Lookup317: frame_system::pallet::Error **/ FrameSystemError: { _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] }, /** - * Lookup318: orml_vesting::module::Error + * Lookup319: orml_vesting::module::Error **/ OrmlVestingModuleError: { _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded'] }, /** - * Lookup320: cumulus_pallet_xcmp_queue::InboundChannelDetails + * Lookup321: cumulus_pallet_xcmp_queue::InboundChannelDetails **/ CumulusPalletXcmpQueueInboundChannelDetails: { sender: 'u32', @@ -2550,19 +2558,19 @@ export default { messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>' }, /** - * Lookup321: cumulus_pallet_xcmp_queue::InboundState + * Lookup322: cumulus_pallet_xcmp_queue::InboundState **/ CumulusPalletXcmpQueueInboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup324: polkadot_parachain::primitives::XcmpMessageFormat + * Lookup325: polkadot_parachain::primitives::XcmpMessageFormat **/ PolkadotParachainPrimitivesXcmpMessageFormat: { _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals'] }, /** - * Lookup327: cumulus_pallet_xcmp_queue::OutboundChannelDetails + * Lookup328: cumulus_pallet_xcmp_queue::OutboundChannelDetails **/ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: 'u32', @@ -2572,13 +2580,13 @@ export default { lastIndex: 'u16' }, /** - * Lookup328: cumulus_pallet_xcmp_queue::OutboundState + * Lookup329: cumulus_pallet_xcmp_queue::OutboundState **/ CumulusPalletXcmpQueueOutboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup330: cumulus_pallet_xcmp_queue::QueueConfigData + * Lookup331: cumulus_pallet_xcmp_queue::QueueConfigData **/ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: 'u32', @@ -2589,29 +2597,29 @@ export default { xcmpMaxIndividualWeight: 'u64' }, /** - * Lookup332: cumulus_pallet_xcmp_queue::pallet::Error + * Lookup333: cumulus_pallet_xcmp_queue::pallet::Error **/ CumulusPalletXcmpQueueError: { _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit'] }, /** - * Lookup333: pallet_xcm::pallet::Error + * Lookup334: pallet_xcm::pallet::Error **/ PalletXcmError: { _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed'] }, /** - * Lookup334: cumulus_pallet_xcm::pallet::Error + * Lookup335: cumulus_pallet_xcm::pallet::Error **/ CumulusPalletXcmError: 'Null', /** - * Lookup335: cumulus_pallet_dmp_queue::ConfigData + * Lookup336: cumulus_pallet_dmp_queue::ConfigData **/ CumulusPalletDmpQueueConfigData: { maxIndividual: 'u64' }, /** - * Lookup336: cumulus_pallet_dmp_queue::PageIndexData + * Lookup337: cumulus_pallet_dmp_queue::PageIndexData **/ CumulusPalletDmpQueuePageIndexData: { beginUsed: 'u32', @@ -2619,19 +2627,19 @@ export default { overweightCount: 'u64' }, /** - * Lookup339: cumulus_pallet_dmp_queue::pallet::Error + * Lookup340: cumulus_pallet_dmp_queue::pallet::Error **/ CumulusPalletDmpQueueError: { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup343: pallet_unique::Error + * Lookup344: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup346: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> + * Lookup347: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> **/ PalletUniqueSchedulerScheduledV3: { maybeId: 'Option<[u8;16]>', @@ -2641,7 +2649,7 @@ export default { origin: 'OpalRuntimeOriginCaller' }, /** - * Lookup347: opal_runtime::OriginCaller + * Lookup348: opal_runtime::OriginCaller **/ OpalRuntimeOriginCaller: { _enum: { @@ -2750,7 +2758,7 @@ export default { } }, /** - * Lookup348: frame_support::dispatch::RawOrigin + * Lookup349: frame_support::dispatch::RawOrigin **/ FrameSupportDispatchRawOrigin: { _enum: { @@ -2760,7 +2768,7 @@ export default { } }, /** - * Lookup349: pallet_xcm::pallet::Origin + * Lookup350: pallet_xcm::pallet::Origin **/ PalletXcmOrigin: { _enum: { @@ -2769,7 +2777,7 @@ export default { } }, /** - * Lookup350: cumulus_pallet_xcm::pallet::Origin + * Lookup351: cumulus_pallet_xcm::pallet::Origin **/ CumulusPalletXcmOrigin: { _enum: { @@ -2778,7 +2786,7 @@ export default { } }, /** - * Lookup351: pallet_ethereum::RawOrigin + * Lookup352: pallet_ethereum::RawOrigin **/ PalletEthereumRawOrigin: { _enum: { @@ -2786,17 +2794,17 @@ export default { } }, /** - * Lookup352: sp_core::Void + * Lookup353: sp_core::Void **/ SpCoreVoid: 'Null', /** - * Lookup353: pallet_unique_scheduler::pallet::Error + * Lookup354: pallet_unique_scheduler::pallet::Error **/ PalletUniqueSchedulerError: { _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] }, /** - * Lookup354: up_data_structs::Collection + * Lookup355: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -2810,7 +2818,7 @@ export default { externalCollection: 'bool' }, /** - * Lookup355: up_data_structs::SponsorshipState + * Lookup356: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipState: { _enum: { @@ -2820,7 +2828,7 @@ export default { } }, /** - * Lookup356: up_data_structs::Properties + * Lookup357: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -2828,15 +2836,15 @@ export default { spaceLimit: 'u32' }, /** - * Lookup357: up_data_structs::PropertiesMap> + * Lookup358: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** - * Lookup362: up_data_structs::PropertiesMap + * Lookup363: up_data_structs::PropertiesMap **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup369: up_data_structs::CollectionStats + * Lookup370: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -2844,18 +2852,18 @@ export default { alive: 'u32' }, /** - * Lookup370: up_data_structs::TokenChild + * Lookup371: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup371: PhantomType::up_data_structs + * Lookup372: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup373: up_data_structs::TokenData> + * Lookup374: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -2863,7 +2871,7 @@ export default { pieces: 'u128' }, /** - * Lookup375: up_data_structs::RpcCollection + * Lookup376: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -2879,7 +2887,7 @@ export default { readOnly: 'bool' }, /** - * Lookup376: rmrk_traits::collection::CollectionInfo, frame_support::storage::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup377: rmrk_traits::collection::CollectionInfo, frame_support::storage::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -2889,7 +2897,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup377: rmrk_traits::nft::NftInfo> + * Lookup378: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -2899,14 +2907,14 @@ export default { pending: 'bool' }, /** - * Lookup379: rmrk_traits::nft::RoyaltyInfo + * Lookup380: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup380: rmrk_traits::resource::ResourceInfo, frame_support::storage::bounded_vec::BoundedVec> + * Lookup381: rmrk_traits::resource::ResourceInfo, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -2915,14 +2923,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup381: rmrk_traits::property::PropertyInfo, frame_support::storage::bounded_vec::BoundedVec> + * Lookup382: rmrk_traits::property::PropertyInfo, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup382: rmrk_traits::base::BaseInfo> + * Lookup383: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -2930,80 +2938,80 @@ export default { symbol: 'Bytes' }, /** - * Lookup383: rmrk_traits::nft::NftChild + * Lookup384: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup385: pallet_common::pallet::Error + * Lookup386: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup387: pallet_fungible::pallet::Error + * Lookup388: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup388: pallet_refungible::ItemData + * Lookup389: pallet_refungible::ItemData **/ PalletRefungibleItemData: { constData: 'Bytes' }, /** - * Lookup393: pallet_refungible::pallet::Error + * Lookup394: pallet_refungible::pallet::Error **/ PalletRefungibleError: { _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup394: pallet_nonfungible::ItemData> + * Lookup395: pallet_nonfungible::ItemData> **/ PalletNonfungibleItemData: { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup396: up_data_structs::PropertyScope + * Lookup397: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { _enum: ['None', 'Rmrk'] }, /** - * Lookup398: pallet_nonfungible::pallet::Error + * Lookup399: pallet_nonfungible::pallet::Error **/ PalletNonfungibleError: { _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup399: pallet_structure::pallet::Error + * Lookup400: pallet_structure::pallet::Error **/ PalletStructureError: { _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup400: pallet_rmrk_core::pallet::Error + * Lookup401: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** - * Lookup402: pallet_rmrk_equip::pallet::Error + * Lookup403: pallet_rmrk_equip::pallet::Error **/ PalletRmrkEquipError: { _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] }, /** - * Lookup405: pallet_evm::pallet::Error + * Lookup406: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup408: fp_rpc::TransactionStatus + * Lookup409: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -3015,11 +3023,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup410: ethbloom::Bloom + * Lookup411: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup412: ethereum::receipt::ReceiptV3 + * Lookup413: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -3029,7 +3037,7 @@ export default { } }, /** - * Lookup413: ethereum::receipt::EIP658ReceiptData + * Lookup414: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -3038,7 +3046,7 @@ export default { logs: 'Vec' }, /** - * Lookup414: ethereum::block::Block + * Lookup415: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -3046,7 +3054,7 @@ export default { ommers: 'Vec' }, /** - * Lookup415: ethereum::header::Header + * Lookup416: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -3066,41 +3074,41 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup416: ethereum_types::hash::H64 + * Lookup417: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup421: pallet_ethereum::pallet::Error + * Lookup422: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup422: pallet_evm_coder_substrate::pallet::Error + * Lookup423: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup423: pallet_evm_contract_helpers::SponsoringModeT + * Lookup424: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup425: pallet_evm_contract_helpers::pallet::Error + * Lookup426: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission'] }, /** - * Lookup426: pallet_evm_migration::pallet::Error + * Lookup427: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup428: sp_runtime::MultiSignature + * Lookup429: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3110,43 +3118,43 @@ export default { } }, /** - * Lookup429: sp_core::ed25519::Signature + * Lookup430: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup431: sp_core::sr25519::Signature + * Lookup432: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup432: sp_core::ecdsa::Signature + * Lookup433: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup435: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup436: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup436: frame_system::extensions::check_genesis::CheckGenesis + * Lookup437: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup439: frame_system::extensions::check_nonce::CheckNonce + * Lookup440: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup440: frame_system::extensions::check_weight::CheckWeight + * Lookup441: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup441: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup442: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup442: opal_runtime::Runtime + * Lookup443: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup443: pallet_ethereum::FakeTransactionFinalizer + * Lookup444: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index 18e938ce8f..b6412bdcc2 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExData, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { export interface InterfaceTypes { @@ -194,7 +194,8 @@ declare module '@polkadot/types/types/registry' { UpDataStructsCreateNftData: UpDataStructsCreateNftData; UpDataStructsCreateNftExData: UpDataStructsCreateNftExData; UpDataStructsCreateReFungibleData: UpDataStructsCreateReFungibleData; - UpDataStructsCreateRefungibleExData: UpDataStructsCreateRefungibleExData; + UpDataStructsCreateRefungibleExMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners; + UpDataStructsCreateRefungibleExSingleOwner: UpDataStructsCreateRefungibleExSingleOwner; UpDataStructsNestingPermissions: UpDataStructsNestingPermissions; UpDataStructsOwnerRestrictedSet: UpDataStructsOwnerRestrictedSet; UpDataStructsProperties: UpDataStructsProperties; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index df1b3ed90b..f6cbfaadd7 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1638,9 +1638,9 @@ declare module '@polkadot/types/lookup' { readonly isFungible: boolean; readonly asFungible: BTreeMap; readonly isRefungibleMultipleItems: boolean; - readonly asRefungibleMultipleItems: Vec; + readonly asRefungibleMultipleItems: Vec; readonly isRefungibleMultipleOwners: boolean; - readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExData; + readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners; readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; } @@ -1650,13 +1650,20 @@ declare module '@polkadot/types/lookup' { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsCreateRefungibleExData (201) */ - export interface UpDataStructsCreateRefungibleExData extends Struct { + /** @name UpDataStructsCreateRefungibleExSingleOwner (201) */ + export interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { + readonly user: PalletEvmAccountBasicCrossAccountIdRepr; + readonly pieces: u128; + readonly properties: Vec; + } + + /** @name UpDataStructsCreateRefungibleExMultipleOwners (203) */ + export interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { readonly users: BTreeMap; readonly properties: Vec; } - /** @name PalletUniqueSchedulerCall (203) */ + /** @name PalletUniqueSchedulerCall (204) */ export interface PalletUniqueSchedulerCall extends Enum { readonly isScheduleNamed: boolean; readonly asScheduleNamed: { @@ -1681,7 +1688,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; } - /** @name FrameSupportScheduleMaybeHashed (205) */ + /** @name FrameSupportScheduleMaybeHashed (206) */ export interface FrameSupportScheduleMaybeHashed extends Enum { readonly isValue: boolean; readonly asValue: Call; @@ -1690,13 +1697,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Value' | 'Hash'; } - /** @name PalletTemplateTransactionPaymentCall (206) */ + /** @name PalletTemplateTransactionPaymentCall (207) */ export type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletStructureCall (207) */ + /** @name PalletStructureCall (208) */ export type PalletStructureCall = Null; - /** @name PalletRmrkCoreCall (208) */ + /** @name PalletRmrkCoreCall (209) */ export interface PalletRmrkCoreCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -1802,7 +1809,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; } - /** @name RmrkTraitsResourceResourceTypes (214) */ + /** @name RmrkTraitsResourceResourceTypes (215) */ export interface RmrkTraitsResourceResourceTypes extends Enum { readonly isBasic: boolean; readonly asBasic: RmrkTraitsResourceBasicResource; @@ -1813,7 +1820,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Basic' | 'Composable' | 'Slot'; } - /** @name RmrkTraitsResourceBasicResource (216) */ + /** @name RmrkTraitsResourceBasicResource (217) */ export interface RmrkTraitsResourceBasicResource extends Struct { readonly src: Option; readonly metadata: Option; @@ -1821,7 +1828,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceComposableResource (218) */ + /** @name RmrkTraitsResourceComposableResource (219) */ export interface RmrkTraitsResourceComposableResource extends Struct { readonly parts: Vec; readonly base: u32; @@ -1831,7 +1838,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceSlotResource (219) */ + /** @name RmrkTraitsResourceSlotResource (220) */ export interface RmrkTraitsResourceSlotResource extends Struct { readonly base: u32; readonly src: Option; @@ -1841,7 +1848,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (221) */ + /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (222) */ export interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { readonly isAccountId: boolean; readonly asAccountId: AccountId32; @@ -1850,7 +1857,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'AccountId' | 'CollectionAndNftTuple'; } - /** @name PalletRmrkEquipCall (225) */ + /** @name PalletRmrkEquipCall (226) */ export interface PalletRmrkEquipCall extends Enum { readonly isCreateBase: boolean; readonly asCreateBase: { @@ -1872,7 +1879,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; } - /** @name RmrkTraitsPartPartType (228) */ + /** @name RmrkTraitsPartPartType (229) */ export interface RmrkTraitsPartPartType extends Enum { readonly isFixedPart: boolean; readonly asFixedPart: RmrkTraitsPartFixedPart; @@ -1881,14 +1888,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'FixedPart' | 'SlotPart'; } - /** @name RmrkTraitsPartFixedPart (230) */ + /** @name RmrkTraitsPartFixedPart (231) */ export interface RmrkTraitsPartFixedPart extends Struct { readonly id: u32; readonly z: u32; readonly src: Bytes; } - /** @name RmrkTraitsPartSlotPart (231) */ + /** @name RmrkTraitsPartSlotPart (232) */ export interface RmrkTraitsPartSlotPart extends Struct { readonly id: u32; readonly equippable: RmrkTraitsPartEquippableList; @@ -1896,7 +1903,7 @@ declare module '@polkadot/types/lookup' { readonly z: u32; } - /** @name RmrkTraitsPartEquippableList (232) */ + /** @name RmrkTraitsPartEquippableList (233) */ export interface RmrkTraitsPartEquippableList extends Enum { readonly isAll: boolean; readonly isEmpty: boolean; @@ -1905,20 +1912,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'All' | 'Empty' | 'Custom'; } - /** @name RmrkTraitsTheme (234) */ + /** @name RmrkTraitsTheme (235) */ export interface RmrkTraitsTheme extends Struct { readonly name: Bytes; readonly properties: Vec; readonly inherit: bool; } - /** @name RmrkTraitsThemeThemeProperty (236) */ + /** @name RmrkTraitsThemeThemeProperty (237) */ export interface RmrkTraitsThemeThemeProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name PalletEvmCall (238) */ + /** @name PalletEvmCall (239) */ export interface PalletEvmCall extends Enum { readonly isWithdraw: boolean; readonly asWithdraw: { @@ -1963,7 +1970,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name PalletEthereumCall (244) */ + /** @name PalletEthereumCall (245) */ export interface PalletEthereumCall extends Enum { readonly isTransact: boolean; readonly asTransact: { @@ -1972,7 +1979,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transact'; } - /** @name EthereumTransactionTransactionV2 (245) */ + /** @name EthereumTransactionTransactionV2 (246) */ export interface EthereumTransactionTransactionV2 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumTransactionLegacyTransaction; @@ -1983,7 +1990,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumTransactionLegacyTransaction (246) */ + /** @name EthereumTransactionLegacyTransaction (247) */ export interface EthereumTransactionLegacyTransaction extends Struct { readonly nonce: U256; readonly gasPrice: U256; @@ -1994,7 +2001,7 @@ declare module '@polkadot/types/lookup' { readonly signature: EthereumTransactionTransactionSignature; } - /** @name EthereumTransactionTransactionAction (247) */ + /** @name EthereumTransactionTransactionAction (248) */ export interface EthereumTransactionTransactionAction extends Enum { readonly isCall: boolean; readonly asCall: H160; @@ -2002,14 +2009,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Call' | 'Create'; } - /** @name EthereumTransactionTransactionSignature (248) */ + /** @name EthereumTransactionTransactionSignature (249) */ export interface EthereumTransactionTransactionSignature extends Struct { readonly v: u64; readonly r: H256; readonly s: H256; } - /** @name EthereumTransactionEip2930Transaction (250) */ + /** @name EthereumTransactionEip2930Transaction (251) */ export interface EthereumTransactionEip2930Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -2024,13 +2031,13 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name EthereumTransactionAccessListItem (252) */ + /** @name EthereumTransactionAccessListItem (253) */ export interface EthereumTransactionAccessListItem extends Struct { readonly address: H160; readonly storageKeys: Vec; } - /** @name EthereumTransactionEip1559Transaction (253) */ + /** @name EthereumTransactionEip1559Transaction (254) */ export interface EthereumTransactionEip1559Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -2046,7 +2053,7 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name PalletEvmMigrationCall (254) */ + /** @name PalletEvmMigrationCall (255) */ export interface PalletEvmMigrationCall extends Enum { readonly isBegin: boolean; readonly asBegin: { @@ -2065,7 +2072,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Begin' | 'SetData' | 'Finish'; } - /** @name PalletSudoEvent (257) */ + /** @name PalletSudoEvent (258) */ export interface PalletSudoEvent extends Enum { readonly isSudid: boolean; readonly asSudid: { @@ -2082,7 +2089,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone'; } - /** @name SpRuntimeDispatchError (259) */ + /** @name SpRuntimeDispatchError (260) */ export interface SpRuntimeDispatchError extends Enum { readonly isOther: boolean; readonly isCannotLookup: boolean; @@ -2101,13 +2108,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional'; } - /** @name SpRuntimeModuleError (260) */ + /** @name SpRuntimeModuleError (261) */ export interface SpRuntimeModuleError extends Struct { readonly index: u8; readonly error: U8aFixed; } - /** @name SpRuntimeTokenError (261) */ + /** @name SpRuntimeTokenError (262) */ export interface SpRuntimeTokenError extends Enum { readonly isNoFunds: boolean; readonly isWouldDie: boolean; @@ -2119,7 +2126,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported'; } - /** @name SpRuntimeArithmeticError (262) */ + /** @name SpRuntimeArithmeticError (263) */ export interface SpRuntimeArithmeticError extends Enum { readonly isUnderflow: boolean; readonly isOverflow: boolean; @@ -2127,20 +2134,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero'; } - /** @name SpRuntimeTransactionalError (263) */ + /** @name SpRuntimeTransactionalError (264) */ export interface SpRuntimeTransactionalError extends Enum { readonly isLimitReached: boolean; readonly isNoLayer: boolean; readonly type: 'LimitReached' | 'NoLayer'; } - /** @name PalletSudoError (264) */ + /** @name PalletSudoError (265) */ export interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: 'RequireSudo'; } - /** @name FrameSystemAccountInfo (265) */ + /** @name FrameSystemAccountInfo (266) */ export interface FrameSystemAccountInfo extends Struct { readonly nonce: u32; readonly consumers: u32; @@ -2149,19 +2156,19 @@ declare module '@polkadot/types/lookup' { readonly data: PalletBalancesAccountData; } - /** @name FrameSupportWeightsPerDispatchClassU64 (266) */ + /** @name FrameSupportWeightsPerDispatchClassU64 (267) */ export interface FrameSupportWeightsPerDispatchClassU64 extends Struct { readonly normal: u64; readonly operational: u64; readonly mandatory: u64; } - /** @name SpRuntimeDigest (267) */ + /** @name SpRuntimeDigest (268) */ export interface SpRuntimeDigest extends Struct { readonly logs: Vec; } - /** @name SpRuntimeDigestDigestItem (269) */ + /** @name SpRuntimeDigestDigestItem (270) */ export interface SpRuntimeDigestDigestItem extends Enum { readonly isOther: boolean; readonly asOther: Bytes; @@ -2175,14 +2182,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated'; } - /** @name FrameSystemEventRecord (271) */ + /** @name FrameSystemEventRecord (272) */ export interface FrameSystemEventRecord extends Struct { readonly phase: FrameSystemPhase; readonly event: Event; readonly topics: Vec; } - /** @name FrameSystemEvent (273) */ + /** @name FrameSystemEvent (274) */ export interface FrameSystemEvent extends Enum { readonly isExtrinsicSuccess: boolean; readonly asExtrinsicSuccess: { @@ -2210,14 +2217,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked'; } - /** @name FrameSupportWeightsDispatchInfo (274) */ + /** @name FrameSupportWeightsDispatchInfo (275) */ export interface FrameSupportWeightsDispatchInfo extends Struct { readonly weight: u64; readonly class: FrameSupportWeightsDispatchClass; readonly paysFee: FrameSupportWeightsPays; } - /** @name FrameSupportWeightsDispatchClass (275) */ + /** @name FrameSupportWeightsDispatchClass (276) */ export interface FrameSupportWeightsDispatchClass extends Enum { readonly isNormal: boolean; readonly isOperational: boolean; @@ -2225,14 +2232,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Normal' | 'Operational' | 'Mandatory'; } - /** @name FrameSupportWeightsPays (276) */ + /** @name FrameSupportWeightsPays (277) */ export interface FrameSupportWeightsPays extends Enum { readonly isYes: boolean; readonly isNo: boolean; readonly type: 'Yes' | 'No'; } - /** @name OrmlVestingModuleEvent (277) */ + /** @name OrmlVestingModuleEvent (278) */ export interface OrmlVestingModuleEvent extends Enum { readonly isVestingScheduleAdded: boolean; readonly asVestingScheduleAdded: { @@ -2252,7 +2259,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated'; } - /** @name CumulusPalletXcmpQueueEvent (278) */ + /** @name CumulusPalletXcmpQueueEvent (279) */ export interface CumulusPalletXcmpQueueEvent extends Enum { readonly isSuccess: boolean; readonly asSuccess: Option; @@ -2273,7 +2280,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name PalletXcmEvent (279) */ + /** @name PalletXcmEvent (280) */ export interface PalletXcmEvent extends Enum { readonly isAttempted: boolean; readonly asAttempted: XcmV2TraitsOutcome; @@ -2310,7 +2317,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail'; } - /** @name XcmV2TraitsOutcome (280) */ + /** @name XcmV2TraitsOutcome (281) */ export interface XcmV2TraitsOutcome extends Enum { readonly isComplete: boolean; readonly asComplete: u64; @@ -2321,7 +2328,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Complete' | 'Incomplete' | 'Error'; } - /** @name CumulusPalletXcmEvent (282) */ + /** @name CumulusPalletXcmEvent (283) */ export interface CumulusPalletXcmEvent extends Enum { readonly isInvalidFormat: boolean; readonly asInvalidFormat: U8aFixed; @@ -2332,7 +2339,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; } - /** @name CumulusPalletDmpQueueEvent (283) */ + /** @name CumulusPalletDmpQueueEvent (284) */ export interface CumulusPalletDmpQueueEvent extends Enum { readonly isInvalidFormat: boolean; readonly asInvalidFormat: { @@ -2367,7 +2374,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name PalletUniqueRawEvent (284) */ + /** @name PalletUniqueRawEvent (285) */ export interface PalletUniqueRawEvent extends Enum { readonly isCollectionSponsorRemoved: boolean; readonly asCollectionSponsorRemoved: u32; @@ -2392,7 +2399,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet'; } - /** @name PalletUniqueSchedulerEvent (285) */ + /** @name PalletUniqueSchedulerEvent (286) */ export interface PalletUniqueSchedulerEvent extends Enum { readonly isScheduled: boolean; readonly asScheduled: { @@ -2419,14 +2426,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; } - /** @name FrameSupportScheduleLookupError (287) */ + /** @name FrameSupportScheduleLookupError (288) */ export interface FrameSupportScheduleLookupError extends Enum { readonly isUnknown: boolean; readonly isBadFormat: boolean; readonly type: 'Unknown' | 'BadFormat'; } - /** @name PalletCommonEvent (288) */ + /** @name PalletCommonEvent (289) */ export interface PalletCommonEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; @@ -2453,14 +2460,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; } - /** @name PalletStructureEvent (289) */ + /** @name PalletStructureEvent (290) */ export interface PalletStructureEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: Result; readonly type: 'Executed'; } - /** @name PalletRmrkCoreEvent (290) */ + /** @name PalletRmrkCoreEvent (291) */ export interface PalletRmrkCoreEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: { @@ -2550,7 +2557,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; } - /** @name PalletRmrkEquipEvent (291) */ + /** @name PalletRmrkEquipEvent (292) */ export interface PalletRmrkEquipEvent extends Enum { readonly isBaseCreated: boolean; readonly asBaseCreated: { @@ -2565,7 +2572,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BaseCreated' | 'EquippablesUpdated'; } - /** @name PalletEvmEvent (292) */ + /** @name PalletEvmEvent (293) */ export interface PalletEvmEvent extends Enum { readonly isLog: boolean; readonly asLog: EthereumLog; @@ -2584,21 +2591,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; } - /** @name EthereumLog (293) */ + /** @name EthereumLog (294) */ export interface EthereumLog extends Struct { readonly address: H160; readonly topics: Vec; readonly data: Bytes; } - /** @name PalletEthereumEvent (294) */ + /** @name PalletEthereumEvent (295) */ export interface PalletEthereumEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; readonly type: 'Executed'; } - /** @name EvmCoreErrorExitReason (295) */ + /** @name EvmCoreErrorExitReason (296) */ export interface EvmCoreErrorExitReason extends Enum { readonly isSucceed: boolean; readonly asSucceed: EvmCoreErrorExitSucceed; @@ -2611,7 +2618,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; } - /** @name EvmCoreErrorExitSucceed (296) */ + /** @name EvmCoreErrorExitSucceed (297) */ export interface EvmCoreErrorExitSucceed extends Enum { readonly isStopped: boolean; readonly isReturned: boolean; @@ -2619,7 +2626,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Stopped' | 'Returned' | 'Suicided'; } - /** @name EvmCoreErrorExitError (297) */ + /** @name EvmCoreErrorExitError (298) */ export interface EvmCoreErrorExitError extends Enum { readonly isStackUnderflow: boolean; readonly isStackOverflow: boolean; @@ -2640,13 +2647,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; } - /** @name EvmCoreErrorExitRevert (300) */ + /** @name EvmCoreErrorExitRevert (301) */ export interface EvmCoreErrorExitRevert extends Enum { readonly isReverted: boolean; readonly type: 'Reverted'; } - /** @name EvmCoreErrorExitFatal (301) */ + /** @name EvmCoreErrorExitFatal (302) */ export interface EvmCoreErrorExitFatal extends Enum { readonly isNotSupported: boolean; readonly isUnhandledInterrupt: boolean; @@ -2657,7 +2664,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; } - /** @name FrameSystemPhase (302) */ + /** @name FrameSystemPhase (303) */ export interface FrameSystemPhase extends Enum { readonly isApplyExtrinsic: boolean; readonly asApplyExtrinsic: u32; @@ -2666,27 +2673,27 @@ declare module '@polkadot/types/lookup' { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } - /** @name FrameSystemLastRuntimeUpgradeInfo (304) */ + /** @name FrameSystemLastRuntimeUpgradeInfo (305) */ export interface FrameSystemLastRuntimeUpgradeInfo extends Struct { readonly specVersion: Compact; readonly specName: Text; } - /** @name FrameSystemLimitsBlockWeights (305) */ + /** @name FrameSystemLimitsBlockWeights (306) */ export interface FrameSystemLimitsBlockWeights extends Struct { readonly baseBlock: u64; readonly maxBlock: u64; readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; } - /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (306) */ + /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (307) */ export interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { readonly normal: FrameSystemLimitsWeightsPerClass; readonly operational: FrameSystemLimitsWeightsPerClass; readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name FrameSystemLimitsWeightsPerClass (307) */ + /** @name FrameSystemLimitsWeightsPerClass (308) */ export interface FrameSystemLimitsWeightsPerClass extends Struct { readonly baseExtrinsic: u64; readonly maxExtrinsic: Option; @@ -2694,25 +2701,25 @@ declare module '@polkadot/types/lookup' { readonly reserved: Option; } - /** @name FrameSystemLimitsBlockLength (309) */ + /** @name FrameSystemLimitsBlockLength (310) */ export interface FrameSystemLimitsBlockLength extends Struct { readonly max: FrameSupportWeightsPerDispatchClassU32; } - /** @name FrameSupportWeightsPerDispatchClassU32 (310) */ + /** @name FrameSupportWeightsPerDispatchClassU32 (311) */ export interface FrameSupportWeightsPerDispatchClassU32 extends Struct { readonly normal: u32; readonly operational: u32; readonly mandatory: u32; } - /** @name FrameSupportWeightsRuntimeDbWeight (311) */ + /** @name FrameSupportWeightsRuntimeDbWeight (312) */ export interface FrameSupportWeightsRuntimeDbWeight extends Struct { readonly read: u64; readonly write: u64; } - /** @name SpVersionRuntimeVersion (312) */ + /** @name SpVersionRuntimeVersion (313) */ export interface SpVersionRuntimeVersion extends Struct { readonly specName: Text; readonly implName: Text; @@ -2724,7 +2731,7 @@ declare module '@polkadot/types/lookup' { readonly stateVersion: u8; } - /** @name FrameSystemError (316) */ + /** @name FrameSystemError (317) */ export interface FrameSystemError extends Enum { readonly isInvalidSpecName: boolean; readonly isSpecVersionNeedsToIncrease: boolean; @@ -2735,7 +2742,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name OrmlVestingModuleError (318) */ + /** @name OrmlVestingModuleError (319) */ export interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; @@ -2746,21 +2753,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (320) */ + /** @name CumulusPalletXcmpQueueInboundChannelDetails (321) */ export interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (321) */ + /** @name CumulusPalletXcmpQueueInboundState (322) */ export interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (324) */ + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (325) */ export interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; @@ -2768,7 +2775,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (327) */ + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (328) */ export interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; @@ -2777,14 +2784,14 @@ declare module '@polkadot/types/lookup' { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (328) */ + /** @name CumulusPalletXcmpQueueOutboundState (329) */ export interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (330) */ + /** @name CumulusPalletXcmpQueueQueueConfigData (331) */ export interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; @@ -2794,7 +2801,7 @@ declare module '@polkadot/types/lookup' { readonly xcmpMaxIndividualWeight: u64; } - /** @name CumulusPalletXcmpQueueError (332) */ + /** @name CumulusPalletXcmpQueueError (333) */ export interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; @@ -2804,7 +2811,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (333) */ + /** @name PalletXcmError (334) */ export interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; @@ -2822,29 +2829,29 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (334) */ + /** @name CumulusPalletXcmError (335) */ export type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (335) */ + /** @name CumulusPalletDmpQueueConfigData (336) */ export interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: u64; } - /** @name CumulusPalletDmpQueuePageIndexData (336) */ + /** @name CumulusPalletDmpQueuePageIndexData (337) */ export interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (339) */ + /** @name CumulusPalletDmpQueueError (340) */ export interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (343) */ + /** @name PalletUniqueError (344) */ export interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; @@ -2853,7 +2860,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name PalletUniqueSchedulerScheduledV3 (346) */ + /** @name PalletUniqueSchedulerScheduledV3 (347) */ export interface PalletUniqueSchedulerScheduledV3 extends Struct { readonly maybeId: Option; readonly priority: u8; @@ -2862,7 +2869,7 @@ declare module '@polkadot/types/lookup' { readonly origin: OpalRuntimeOriginCaller; } - /** @name OpalRuntimeOriginCaller (347) */ + /** @name OpalRuntimeOriginCaller (348) */ export interface OpalRuntimeOriginCaller extends Enum { readonly isVoid: boolean; readonly isSystem: boolean; @@ -2876,7 +2883,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Void' | 'System' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; } - /** @name FrameSupportDispatchRawOrigin (348) */ + /** @name FrameSupportDispatchRawOrigin (349) */ export interface FrameSupportDispatchRawOrigin extends Enum { readonly isRoot: boolean; readonly isSigned: boolean; @@ -2885,7 +2892,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Root' | 'Signed' | 'None'; } - /** @name PalletXcmOrigin (349) */ + /** @name PalletXcmOrigin (350) */ export interface PalletXcmOrigin extends Enum { readonly isXcm: boolean; readonly asXcm: XcmV1MultiLocation; @@ -2894,7 +2901,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Xcm' | 'Response'; } - /** @name CumulusPalletXcmOrigin (350) */ + /** @name CumulusPalletXcmOrigin (351) */ export interface CumulusPalletXcmOrigin extends Enum { readonly isRelay: boolean; readonly isSiblingParachain: boolean; @@ -2902,17 +2909,17 @@ declare module '@polkadot/types/lookup' { readonly type: 'Relay' | 'SiblingParachain'; } - /** @name PalletEthereumRawOrigin (351) */ + /** @name PalletEthereumRawOrigin (352) */ export interface PalletEthereumRawOrigin extends Enum { readonly isEthereumTransaction: boolean; readonly asEthereumTransaction: H160; readonly type: 'EthereumTransaction'; } - /** @name SpCoreVoid (352) */ + /** @name SpCoreVoid (353) */ export type SpCoreVoid = Null; - /** @name PalletUniqueSchedulerError (353) */ + /** @name PalletUniqueSchedulerError (354) */ export interface PalletUniqueSchedulerError extends Enum { readonly isFailedToSchedule: boolean; readonly isNotFound: boolean; @@ -2921,7 +2928,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; } - /** @name UpDataStructsCollection (354) */ + /** @name UpDataStructsCollection (355) */ export interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -2934,7 +2941,7 @@ declare module '@polkadot/types/lookup' { readonly externalCollection: bool; } - /** @name UpDataStructsSponsorshipState (355) */ + /** @name UpDataStructsSponsorshipState (356) */ export interface UpDataStructsSponsorshipState extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -2944,43 +2951,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (356) */ + /** @name UpDataStructsProperties (357) */ export interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (357) */ + /** @name UpDataStructsPropertiesMapBoundedVec (358) */ export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (362) */ + /** @name UpDataStructsPropertiesMapPropertyPermission (363) */ export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (369) */ + /** @name UpDataStructsCollectionStats (370) */ export interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (370) */ + /** @name UpDataStructsTokenChild (371) */ export interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (371) */ + /** @name PhantomTypeUpDataStructs (372) */ export interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (373) */ + /** @name UpDataStructsTokenData (374) */ export interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (375) */ + /** @name UpDataStructsRpcCollection (376) */ export interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -2995,7 +3002,7 @@ declare module '@polkadot/types/lookup' { readonly readOnly: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (376) */ + /** @name RmrkTraitsCollectionCollectionInfo (377) */ export interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; @@ -3004,7 +3011,7 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (377) */ + /** @name RmrkTraitsNftNftInfo (378) */ export interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; @@ -3013,13 +3020,13 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (379) */ + /** @name RmrkTraitsNftRoyaltyInfo (380) */ export interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (380) */ + /** @name RmrkTraitsResourceResourceInfo (381) */ export interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; @@ -3027,26 +3034,26 @@ declare module '@polkadot/types/lookup' { readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (381) */ + /** @name RmrkTraitsPropertyPropertyInfo (382) */ export interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (382) */ + /** @name RmrkTraitsBaseBaseInfo (383) */ export interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (383) */ + /** @name RmrkTraitsNftNftChild (384) */ export interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (385) */ + /** @name PalletCommonError (386) */ export interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; @@ -3085,7 +3092,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (387) */ + /** @name PalletFungibleError (388) */ export interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; @@ -3095,12 +3102,12 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (388) */ + /** @name PalletRefungibleItemData (389) */ export interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } - /** @name PalletRefungibleError (393) */ + /** @name PalletRefungibleError (394) */ export interface PalletRefungibleError extends Enum { readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isWrongRefungiblePieces: boolean; @@ -3110,19 +3117,19 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletNonfungibleItemData (394) */ + /** @name PalletNonfungibleItemData (395) */ export interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (396) */ + /** @name UpDataStructsPropertyScope (397) */ export interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; readonly type: 'None' | 'Rmrk'; } - /** @name PalletNonfungibleError (398) */ + /** @name PalletNonfungibleError (399) */ export interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; @@ -3130,7 +3137,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (399) */ + /** @name PalletStructureError (400) */ export interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; @@ -3139,7 +3146,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletRmrkCoreError (400) */ + /** @name PalletRmrkCoreError (401) */ export interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; @@ -3163,7 +3170,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } - /** @name PalletRmrkEquipError (402) */ + /** @name PalletRmrkEquipError (403) */ export interface PalletRmrkEquipError extends Enum { readonly isPermissionError: boolean; readonly isNoAvailableBaseId: boolean; @@ -3175,7 +3182,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; } - /** @name PalletEvmError (405) */ + /** @name PalletEvmError (406) */ export interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; @@ -3186,7 +3193,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (408) */ + /** @name FpRpcTransactionStatus (409) */ export interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; @@ -3197,10 +3204,10 @@ declare module '@polkadot/types/lookup' { readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (410) */ + /** @name EthbloomBloom (411) */ export interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (412) */ + /** @name EthereumReceiptReceiptV3 (413) */ export interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; @@ -3211,7 +3218,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (413) */ + /** @name EthereumReceiptEip658ReceiptData (414) */ export interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; @@ -3219,14 +3226,14 @@ declare module '@polkadot/types/lookup' { readonly logs: Vec; } - /** @name EthereumBlock (414) */ + /** @name EthereumBlock (415) */ export interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (415) */ + /** @name EthereumHeader (416) */ export interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; @@ -3245,24 +3252,24 @@ declare module '@polkadot/types/lookup' { readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (416) */ + /** @name EthereumTypesHashH64 (417) */ export interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (421) */ + /** @name PalletEthereumError (422) */ export interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (422) */ + /** @name PalletEvmCoderSubstrateError (423) */ export interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name PalletEvmContractHelpersSponsoringModeT (423) */ + /** @name PalletEvmContractHelpersSponsoringModeT (424) */ export interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; @@ -3270,20 +3277,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (425) */ + /** @name PalletEvmContractHelpersError (426) */ export interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly type: 'NoPermission'; } - /** @name PalletEvmMigrationError (426) */ + /** @name PalletEvmMigrationError (427) */ export interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (428) */ + /** @name SpRuntimeMultiSignature (429) */ export interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; @@ -3294,34 +3301,34 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (429) */ + /** @name SpCoreEd25519Signature (430) */ export interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (431) */ + /** @name SpCoreSr25519Signature (432) */ export interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (432) */ + /** @name SpCoreEcdsaSignature (433) */ export interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (435) */ + /** @name FrameSystemExtensionsCheckSpecVersion (436) */ export type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (436) */ + /** @name FrameSystemExtensionsCheckGenesis (437) */ export type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (439) */ + /** @name FrameSystemExtensionsCheckNonce (440) */ export interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (440) */ + /** @name FrameSystemExtensionsCheckWeight (441) */ export type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (441) */ + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (442) */ export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (442) */ + /** @name OpalRuntimeRuntime (443) */ export type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (443) */ + /** @name PalletEthereumFakeTransactionFinalizer (444) */ export type PalletEthereumFakeTransactionFinalizer = Null; } // declare module From 40acebaf25f7726e60caf765cd81f036f8ba473e Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 4 Aug 2022 14:23:41 +0000 Subject: [PATCH 0227/1274] test(refungible): switch to upgraded bulk mint signature Signed-off-by: Yaroslav Bolyukin --- tests/src/createMultipleItemsEx.test.ts | 34 ++++++++++--------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/tests/src/createMultipleItemsEx.test.ts b/tests/src/createMultipleItemsEx.test.ts index 18250fa0ce..f0e6bafd98 100644 --- a/tests/src/createMultipleItemsEx.test.ts +++ b/tests/src/createMultipleItemsEx.test.ts @@ -134,12 +134,11 @@ describe('Integration Test: createMultipleItemsEx', () => { const alice = privateKeyWrapper('//Alice'); const bob = privateKeyWrapper('//Bob'); - const users = new Map(); - users.set(JSON.stringify({Substrate: alice.address}), 50); - users.set(JSON.stringify({Substrate: bob.address}), 100); - await executeTransaction(api, alice, api.tx.unique.createMultipleItemsEx(collection, { - Fungible: users, + Fungible: new Map([ + [JSON.stringify({Substrate: alice.address}), 50], + [JSON.stringify({Substrate: bob.address}), 100], + ]), })); expect(await getBalance(api, collection, alice.address, 0)).to.equal(50n); @@ -153,16 +152,15 @@ describe('Integration Test: createMultipleItemsEx', () => { const alice = privateKeyWrapper('//Alice'); const bob = privateKeyWrapper('//Bob'); - const users = new Map(); - users.set(JSON.stringify({Substrate: alice.address}), 1); - users.set(JSON.stringify({Substrate: bob.address}), 2); - await executeTransaction(api, alice, api.tx.unique.createMultipleItemsEx(collection, { RefungibleMultipleOwners: { - users: users, + users: new Map([ + [JSON.stringify({Substrate: alice.address}), 1], + [JSON.stringify({Substrate: bob.address}), 2], + ]), }, })); - + const itemsListIndexAfter = await getLastTokenId(api, collection); expect(itemsListIndexAfter).to.be.equal(1); @@ -176,19 +174,13 @@ describe('Integration Test: createMultipleItemsEx', () => { await usingApi(async (api, privateKeyWrapper) => { const alice = privateKeyWrapper('//Alice'); - const item1User = new Map(); - item1User.set(JSON.stringify({Substrate: alice.address}), 1); - - const item2User = new Map(); - item2User.set(JSON.stringify({Substrate: alice.address}), 3); - await executeTransaction(api, alice, api.tx.unique.createMultipleItemsEx(collection, { RefungibleMultipleItems: [ - {users: item1User}, - {users: item2User}, + {user: {Substrate: alice.address}, pieces: 1}, + {user: {Substrate: alice.address}, pieces: 3}, ], })); - + const itemsListIndexAfter = await getLastTokenId(api, collection); expect(itemsListIndexAfter).to.be.equal(2); @@ -373,7 +365,7 @@ describe('Negative test: createMultipleItemsEx', () => { it('fails when trying to set multiple owners when creating multiple refungibles', async () => { const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - + await usingApi(async (api, privateKeyWrapper) => { const alice = privateKeyWrapper('//Alice'); const bob = privateKeyWrapper('//Bob'); From d4149b5fdc00975d73f7a666222b98bf10a4a316 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 8 Aug 2022 08:26:11 +0000 Subject: [PATCH 0228/1274] feat(pallet-refungible): implement property RPC Signed-off-by: Yaroslav Bolyukin --- pallets/refungible/src/common.rs | 33 +++++++++++++++++++++++--------- pallets/refungible/src/erc.rs | 2 +- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index 5f6c8af9a4..c921e8f7f4 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -33,7 +33,7 @@ use sp_std::{vec::Vec, vec}; use crate::{ AccountBalance, Allowance, Balance, Config, Error, Owned, Pallet, RefungibleHandle, - SelfWeightOf, TokenData, weights::WeightInfo, TokensMinted, TotalSupply, CreateItemData, + SelfWeightOf, weights::WeightInfo, TokensMinted, TotalSupply, CreateItemData, }; macro_rules! max_weight_of { @@ -457,16 +457,31 @@ impl CommonCollectionOperations for RefungibleHandle { >::token_owners(self.id, token).unwrap_or_default() } - fn token_property(&self, _token_id: TokenId, _key: &PropertyKey) -> Option { - None + fn token_property(&self, token_id: TokenId, key: &PropertyKey) -> Option { + >::token_properties((self.id, token_id)) + .get(key) + .cloned() } - fn token_properties( - &self, - _token_id: TokenId, - _keys: Option>, - ) -> Vec { - Vec::new() + fn token_properties(&self, token_id: TokenId, keys: Option>) -> Vec { + let properties = >::token_properties((self.id, token_id)); + + keys.map(|keys| { + keys.into_iter() + .filter_map(|key| { + properties.get(&key).map(|value| Property { + key, + value: value.clone(), + }) + }) + .collect() + }) + .unwrap_or_else(|| { + properties + .into_iter() + .map(|(key, value)| Property { key, value }) + .collect() + }) } fn total_supply(&self) -> u32 { diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 4b77e5c311..420667d2ce 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -27,7 +27,7 @@ use core::{ convert::TryInto, }; use evm_coder::{ToLog, execution::*, generate_stubgen, solidity, solidity_interface, types::*, weight}; -use frame_support::{BoundedBTreeMap, BoundedVec}; +use frame_support::BoundedBTreeMap; use pallet_common::{ CollectionHandle, CollectionPropertyPermissions, erc::{ From 2efa82474035933ea2281a2b840fee905ea50cd1 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 8 Aug 2022 08:28:36 +0000 Subject: [PATCH 0229/1274] test(refungible): check createMultipleItemsEx accepts properties for RFT Signed-off-by: Yaroslav Bolyukin --- tests/src/createMultipleItemsEx.test.ts | 38 +++++++++++++++++++++---- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/tests/src/createMultipleItemsEx.test.ts b/tests/src/createMultipleItemsEx.test.ts index f0e6bafd98..e5a695ac9f 100644 --- a/tests/src/createMultipleItemsEx.test.ts +++ b/tests/src/createMultipleItemsEx.test.ts @@ -16,9 +16,9 @@ import {expect} from 'chai'; import usingApi, {executeTransaction} from './substrate/substrate-api'; -import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, createCollectionWithPropsExpectSuccess, getBalance, getLastTokenId} from './util/helpers'; +import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, createCollectionWithPropsExpectSuccess, getBalance, getLastTokenId, getTokenProperties} from './util/helpers'; -describe('Integration Test: createMultipleItemsEx', () => { +describe.only('Integration Test: createMultipleItemsEx', () => { it('can initialize multiple NFT with different owners', async () => { const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); await usingApi(async (api, privateKeyWrapper) => { @@ -147,10 +147,15 @@ describe('Integration Test: createMultipleItemsEx', () => { }); it('can initialize an RFT with multiple owners', async () => { - const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); await usingApi(async (api, privateKeyWrapper) => { const alice = privateKeyWrapper('//Alice'); const bob = privateKeyWrapper('//Bob'); + const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); + await executeTransaction( + api, + alice, + api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'data', permission: {tokenOwner: true}}]), + ); await executeTransaction(api, alice, api.tx.unique.createMultipleItemsEx(collection, { RefungibleMultipleOwners: { @@ -158,6 +163,9 @@ describe('Integration Test: createMultipleItemsEx', () => { [JSON.stringify({Substrate: alice.address}), 1], [JSON.stringify({Substrate: bob.address}), 2], ]), + properties: [ + {key: 'data', value: 'testValue'}, + ], }, })); @@ -166,18 +174,34 @@ describe('Integration Test: createMultipleItemsEx', () => { expect(await getBalance(api, collection, alice.address, 1)).to.be.equal(1n); expect(await getBalance(api, collection, bob.address, 1)).to.be.equal(2n); + expect((await getTokenProperties(api, collection, 1, ['data']))[0].value).to.be.equal('testValue'); }); }); it('can initialize multiple RFTs with the same owner', async () => { - const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); await usingApi(async (api, privateKeyWrapper) => { const alice = privateKeyWrapper('//Alice'); + const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); + await executeTransaction( + api, + alice, + api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'data', permission: {tokenOwner: true}}]), + ); await executeTransaction(api, alice, api.tx.unique.createMultipleItemsEx(collection, { RefungibleMultipleItems: [ - {user: {Substrate: alice.address}, pieces: 1}, - {user: {Substrate: alice.address}, pieces: 3}, + { + user: {Substrate: alice.address}, pieces: 1, + properties: [ + {key: 'data', value: 'testValue1'}, + ], + }, + { + user: {Substrate: alice.address}, pieces: 3, + properties: [ + {key: 'data', value: 'testValue2'}, + ], + }, ], })); @@ -186,6 +210,8 @@ describe('Integration Test: createMultipleItemsEx', () => { expect(await getBalance(api, collection, alice.address, 1)).to.be.equal(1n); expect(await getBalance(api, collection, alice.address, 2)).to.be.equal(3n); + expect((await getTokenProperties(api, collection, 1, ['data']))[0].value).to.be.equal('testValue1'); + expect((await getTokenProperties(api, collection, 2, ['data']))[0].value).to.be.equal('testValue2'); }); }); }); From 16c0f797c576d6c3a6ea2d80b10dd02838582a41 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 4 Aug 2022 14:31:52 +0000 Subject: [PATCH 0230/1274] chore(bureaucrate): bump versions Signed-off-by: Yaroslav Bolyukin --- Cargo.lock | 25 +++++++++++++------------ pallets/common/Cargo.toml | 2 +- pallets/evm-coder-substrate/Cargo.toml | 2 +- pallets/evm-contract-helpers/Cargo.toml | 2 +- pallets/fungible/Cargo.toml | 2 +- pallets/inflation/Cargo.toml | 2 +- pallets/nonfungible/Cargo.toml | 2 +- pallets/proxy-rmrk-core/Cargo.toml | 2 +- pallets/proxy-rmrk-equip/Cargo.toml | 2 +- pallets/refungible/CHANGELOG.md | 19 +++++++++++++++++++ pallets/refungible/Cargo.toml | 2 +- pallets/structure/Cargo.toml | 2 +- pallets/unique/Cargo.toml | 2 +- primitives/data-structs/CHANGELOG.md | 17 ++++++++++++++++- primitives/data-structs/Cargo.toml | 2 +- primitives/rmrk-traits/Cargo.toml | 2 +- primitives/rpc/Cargo.toml | 2 +- 17 files changed, 62 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1b4aecd6d4..792d7ec649 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5722,7 +5722,7 @@ dependencies = [ [[package]] name = "pallet-common" -version = "0.1.3" +version = "0.1.4" dependencies = [ "ethereum", "evm-coder", @@ -5869,7 +5869,7 @@ dependencies = [ [[package]] name = "pallet-evm-coder-substrate" -version = "0.1.0" +version = "0.1.1" dependencies = [ "ethereum", "evm-coder", @@ -5887,7 +5887,7 @@ dependencies = [ [[package]] name = "pallet-evm-contract-helpers" -version = "0.1.0" +version = "0.1.1" dependencies = [ "evm-coder", "fp-evm-mapping", @@ -5944,7 +5944,7 @@ dependencies = [ [[package]] name = "pallet-fungible" -version = "0.1.1" +version = "0.1.2" dependencies = [ "ethereum", "evm-coder", @@ -6189,7 +6189,7 @@ dependencies = [ [[package]] name = "pallet-nonfungible" -version = "0.1.2" +version = "0.1.3" dependencies = [ "ethereum", "evm-coder", @@ -6311,8 +6311,9 @@ dependencies = [ [[package]] name = "pallet-refungible" -version = "0.2.1" +version = "0.2.2" dependencies = [ + "derivative", "ethereum", "evm-coder", "frame-benchmarking", @@ -6333,7 +6334,7 @@ dependencies = [ [[package]] name = "pallet-rmrk-core" -version = "0.1.0" +version = "0.1.1" dependencies = [ "derivative", "frame-benchmarking", @@ -6354,7 +6355,7 @@ dependencies = [ [[package]] name = "pallet-rmrk-equip" -version = "0.1.0" +version = "0.1.1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6484,7 +6485,7 @@ dependencies = [ [[package]] name = "pallet-structure" -version = "0.1.0" +version = "0.1.1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6629,7 +6630,7 @@ dependencies = [ [[package]] name = "pallet-unique" -version = "0.1.1" +version = "0.1.2" dependencies = [ "ethereum", "evm-coder", @@ -12732,7 +12733,7 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "up-data-structs" -version = "0.2.0" +version = "0.2.1" dependencies = [ "derivative", "frame-support", @@ -12750,7 +12751,7 @@ dependencies = [ [[package]] name = "up-rpc" -version = "0.1.1" +version = "0.1.2" dependencies = [ "pallet-common", "pallet-evm", diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index e7a7389b46..2752953f99 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-common" -version = "0.1.3" +version = "0.1.4" license = "GPLv3" edition = "2021" diff --git a/pallets/evm-coder-substrate/Cargo.toml b/pallets/evm-coder-substrate/Cargo.toml index a5df5cf917..4d899c67ba 100644 --- a/pallets/evm-coder-substrate/Cargo.toml +++ b/pallets/evm-coder-substrate/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-evm-coder-substrate" -version = "0.1.0" +version = "0.1.1" license = "GPLv3" edition = "2021" diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index ce3b25e880..4d42469e1b 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-evm-contract-helpers" -version = "0.1.0" +version = "0.1.1" license = "GPLv3" edition = "2021" diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index a8036f6086..dc6d9c327f 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-fungible" -version = "0.1.1" +version = "0.1.2" license = "GPLv3" edition = "2021" diff --git a/pallets/inflation/Cargo.toml b/pallets/inflation/Cargo.toml index dcb94ff2e2..34dfbdd54c 100644 --- a/pallets/inflation/Cargo.toml +++ b/pallets/inflation/Cargo.toml @@ -9,7 +9,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'pallet-inflation' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.1.0' +version = "0.1.0" [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index e40fb35d05..9a97825688 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-nonfungible" -version = "0.1.2" +version = "0.1.3" license = "GPLv3" edition = "2021" diff --git a/pallets/proxy-rmrk-core/Cargo.toml b/pallets/proxy-rmrk-core/Cargo.toml index 57cc4b4373..7444799964 100644 --- a/pallets/proxy-rmrk-core/Cargo.toml +++ b/pallets/proxy-rmrk-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-rmrk-core" -version = "0.1.0" +version = "0.1.1" license = "GPLv3" edition = "2021" diff --git a/pallets/proxy-rmrk-equip/Cargo.toml b/pallets/proxy-rmrk-equip/Cargo.toml index 6dfa39f223..9330330938 100644 --- a/pallets/proxy-rmrk-equip/Cargo.toml +++ b/pallets/proxy-rmrk-equip/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-rmrk-equip" -version = "0.1.0" +version = "0.1.1" license = "GPLv3" edition = "2021" diff --git a/pallets/refungible/CHANGELOG.md b/pallets/refungible/CHANGELOG.md index 85b6890a8f..73ef9fbbc4 100644 --- a/pallets/refungible/CHANGELOG.md +++ b/pallets/refungible/CHANGELOG.md @@ -2,6 +2,25 @@ All notable changes to this project will be documented in this file. + +## [v0.2.2] 2022-08-04 + +### Product changes + +- Now RefungibleMultipleItems may only receive single user on type level. + +### Added features + +- Implement property RPC 7bf45b532e32daa91f03c157b58874d21b42ae1f + +### Other changes + +- refactor: Disallow invalid bulk mints 53fec71cf728dddd012257b407ea30441e699f88 + +`create_multiple_items_ex` was allowing invalid (that will be always +rejected at runtime level) refungible mint extrinsics, by passing +multiple users into `RefungibleMultipleItems` call. + ## [v0.2.1] - 2022-07-27 ### New features diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index b40018e411..22079b8ac5 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-refungible" -version = "0.2.1" +version = "0.2.2" license = "GPLv3" edition = "2021" diff --git a/pallets/structure/Cargo.toml b/pallets/structure/Cargo.toml index c7b5902527..28d36fa4a6 100644 --- a/pallets/structure/Cargo.toml +++ b/pallets/structure/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-structure" -version = "0.1.0" +version = "0.1.1" edition = "2021" [dependencies] diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index c90580cad3..e6e07441d2 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -9,7 +9,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'pallet-unique' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.1.1' +version = "0.1.2" [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] diff --git a/primitives/data-structs/CHANGELOG.md b/primitives/data-structs/CHANGELOG.md index 75e8ffd40e..9671afb6fa 100644 --- a/primitives/data-structs/CHANGELOG.md +++ b/primitives/data-structs/CHANGELOG.md @@ -2,6 +2,21 @@ All notable changes to this project will be documented in this file. + +## [v0.2.1] 2022-08-04 + +### Product changes + +- Now RefungibleMultipleItems may only receive single user on type level. + +### Other changes + +- refactor: Disallow invalid bulk mints 53fec71cf728dddd012257b407ea30441e699f88 + +`create_multiple_items_ex` was allowing invalid (that will be always +rejected at runtime level) refungible mint extrinsics, by passing +multiple users into `RefungibleMultipleItems` call. + ## [v0.2.0] - 2022-08-01 ### Deprecated - `CreateReFungibleData::const_data` @@ -11,4 +26,4 @@ All notable changes to this project will be documented in this file. - Type aliases `CollectionName`, `CollectionDescription`, `CollectionTokenPrefix` ## [v0.1.1] - 2022-07-22 ### Added -- Аields with properties to `CreateReFungibleData` and `CreateRefungibleExData`. \ No newline at end of file +- Аields with properties to `CreateReFungibleData` and `CreateRefungibleExData`. diff --git a/primitives/data-structs/Cargo.toml b/primitives/data-structs/Cargo.toml index 57c156214e..da08bec8d5 100644 --- a/primitives/data-structs/Cargo.toml +++ b/primitives/data-structs/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = 'GPLv3' homepage = "https://unique.network" repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.2.0' +version = "0.2.1" [dependencies] scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/primitives/rmrk-traits/Cargo.toml b/primitives/rmrk-traits/Cargo.toml index bce6d5fee5..6ce88878d9 100644 --- a/primitives/rmrk-traits/Cargo.toml +++ b/primitives/rmrk-traits/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = 'GPLv3' homepage = "https://unique.network" repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.1.0' +version = "0.1.0" [dependencies] scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } diff --git a/primitives/rpc/Cargo.toml b/primitives/rpc/Cargo.toml index 35e074986b..4c9f236e62 100644 --- a/primitives/rpc/Cargo.toml +++ b/primitives/rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "up-rpc" -version = "0.1.1" +version = "0.1.2" license = "GPLv3" edition = "2021" From 3fe34615ddf6243a0eb326034416fe0cd74b0278 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Mon, 8 Aug 2022 10:30:44 +0000 Subject: [PATCH 0231/1274] test: fix test for createMultipleItems method --- tests/src/createMultipleItems.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/src/createMultipleItems.test.ts b/tests/src/createMultipleItems.test.ts index 5de1ae5b35..10eeae9709 100644 --- a/tests/src/createMultipleItems.test.ts +++ b/tests/src/createMultipleItems.test.ts @@ -378,9 +378,9 @@ describe('Negative Integration Test createMultipleItems(collection_id, owner, it await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); { const argsReFungible = [ - {ReFungible: ['1'.repeat(2049), 10, []]}, - {ReFungible: ['2'.repeat(2049), 10, []]}, - {ReFungible: ['3'.repeat(2049), 10, []]}, + {ReFungible: [10, [['key', 'A'.repeat(32769)]]]}, + {ReFungible: [10, [['key', 'B'.repeat(32769)]]]}, + {ReFungible: [10, [['key', 'C'.repeat(32769)]]]}, ]; const createMultipleItemsTxFungible = api.tx.unique .createMultipleItems(collectionIdReFungible, normalizeAccountId(alice.address), argsReFungible); From 47f1fe8177c45a5de469a52be6d1eefc1eb481ba Mon Sep 17 00:00:00 2001 From: Maksandre Date: Mon, 8 Aug 2022 16:10:01 +0500 Subject: [PATCH 0232/1274] fix eslint errors in playgrounds --- tests/src/util/playgrounds/index.ts | 16 +- tests/src/util/playgrounds/unique.ts | 215 ++++++++++++++------------- 2 files changed, 118 insertions(+), 113 deletions(-) diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index 5e93b902da..dbaa217414 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -1,18 +1,18 @@ -import { IKeyringPair } from '@polkadot/types/types'; -import { UniqueHelper } from './unique'; +import {IKeyringPair} from '@polkadot/types/types'; +import {UniqueHelper} from './unique'; import config from '../../config'; import '../../interfaces/augment-api-events'; import * as defs from '../../interfaces/definitions'; -import { ApiPromise, WsProvider } from '@polkadot/api'; +import {ApiPromise, WsProvider} from '@polkadot/api'; class SilentLogger { log(msg: any, level: any): void {} level = { - ERROR: 'ERROR' as 'ERROR', - WARNING: 'WARNING' as 'WARNING', - INFO: 'INFO' as 'INFO' - } + ERROR: 'ERROR' as const, + WARNING: 'WARNING' as const, + INFO: 'INFO' as const, + }; } @@ -87,4 +87,4 @@ export const usingPlaygrounds = async (code: (helper: UniqueHelper, privateKey: console.log = consoleLog; console.warn = consoleWarn; } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 71bdccca79..3accd55892 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -1,16 +1,19 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +/* eslint-disable function-call-argument-newline */ +/* eslint-disable no-prototype-builtins */ -import { ApiPromise, WsProvider, Keyring } from '@polkadot/api'; -import { ApiInterfaceEvents } from '@polkadot/api/types'; -import { IKeyringPair } from '@polkadot/types/types'; -import { encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm } from '@polkadot/util-crypto'; +import {ApiPromise, WsProvider, Keyring} from '@polkadot/api'; +import {ApiInterfaceEvents} from '@polkadot/api/types'; +import {IKeyringPair} from '@polkadot/types/types'; +import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto'; const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => { - let address = {} as ICrossAccountId; + const address = {} as ICrossAccountId; if(lowerAddress.substrate) address.Substrate = lowerAddress.substrate; if(lowerAddress.ethereum) address.Ethereum = lowerAddress.ethereum; return address; -} +}; const nesting = { @@ -21,9 +24,9 @@ const nesting = { address = address.toLowerCase().replace(/^0x/i,''); const addressHash = keccakAsHex(address).replace(/^0x/i,''); - let checksumAddress = ['0x']; + const checksumAddress = ['0x']; - for (let i = 0; i < address.length; i++ ) { + for (let i = 0; i < address.length; i++) { // If ith character is 8 to f then make it uppercase if (parseInt(addressHash[i], 16) > 7) { checksumAddress.push(address[i].toUpperCase()); @@ -34,10 +37,8 @@ const nesting = { return checksumAddress.join(''); }, tokenIdToAddress(collectionId: number, tokenId: number) { - return this.toChecksumAddress( - `0xf8238ccfff8ed887463fd5e0${collectionId.toString(16).padStart(8, '0')}${tokenId.toString(16).padStart(8, '0')}` - ); - } + return this.toChecksumAddress(`0xf8238ccfff8ed887463fd5e0${collectionId.toString(16).padStart(8, '0')}${tokenId.toString(16).padStart(8, '0')}`); + }, }; @@ -171,13 +172,13 @@ class UniqueUtil { static transactionStatus = { NOT_READY: 'NotReady', FAIL: 'Fail', - SUCCESS: 'Success' - } + SUCCESS: 'Success', + }; static chainLogType = { EXTRINSIC: 'extrinsic', - RPC: 'rpc' - } + RPC: 'rpc', + }; static getNestingTokenAddress(collectionId: number, tokenId: number) { return nesting.tokenIdToAddress(collectionId, tokenId); @@ -191,8 +192,8 @@ class UniqueUtil { level: { ERROR: 'ERROR', WARNING: 'WARNING', - INFO: 'INFO' - } + INFO: 'INFO', + }, }; } @@ -227,7 +228,7 @@ class UniqueUtil { }); if (collectionId === null) { - throw Error(`No CollectionCreated event for ${label}`) + throw Error(`No CollectionCreated event for ${label}`); } return collectionId; @@ -237,7 +238,8 @@ class UniqueUtil { if (creationResult.status !== this.transactionStatus.SUCCESS) { throw Error(`Unable to create tokens for ${label}`); } - let success = false, tokens = [] as any; + let success = false; + const tokens = [] as any; creationResult.result.events.forEach(({event: {data, method, section}}) => { if (method === 'ExtrinsicSuccess') { success = true; @@ -245,7 +247,7 @@ class UniqueUtil { tokens.push({ collectionId: parseInt(data[0].toString(), 10), tokenId: parseInt(data[1].toString(), 10), - owner: data[2].toJSON() + owner: data[2].toJSON(), }); } }); @@ -256,7 +258,8 @@ class UniqueUtil { if (burnResult.status !== this.transactionStatus.SUCCESS) { throw Error(`Unable to burn tokens for ${label}`); } - let success = false, tokens = [] as any; + let success = false; + const tokens = [] as any; burnResult.result.events.forEach(({event: {data, method, section}}) => { if (method === 'ExtrinsicSuccess') { success = true; @@ -264,7 +267,7 @@ class UniqueUtil { tokens.push({ collectionId: parseInt(data[0].toString(), 10), tokenId: parseInt(data[1].toString(), 10), - owner: data[2].toJSON() + owner: data[2].toJSON(), }); } }); @@ -288,24 +291,24 @@ class UniqueUtil { static isTokenTransferSuccess(events: {event: IChainEvent}[], collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) { const normalizeAddress = (address: string | ICrossAccountId) => { if(typeof address === 'string') return address; - let obj = {} as any; + const obj = {} as any; Object.keys(address).forEach(k => { obj[k.toLocaleLowerCase()] = address[k as 'Substrate' | 'Ethereum']; }); if(obj.substrate) return {Substrate: this.normalizeSubstrateAddress(obj.substrate)}; if(obj.ethereum) return {Ethereum: obj.ethereum.toLocaleLowerCase()}; return address; - } + }; let transfer = {collectionId: null, tokenId: null, from: null, to: null, amount: 1} as any; events.forEach(({event: {data, method, section}}) => { if ((section === 'common') && (method === 'Transfer')) { - let hData = (data as any).toJSON(); + const hData = (data as any).toJSON(); transfer = { collectionId: hData[0], tokenId: hData[1], from: normalizeAddress(hData[2]), to: normalizeAddress(hData[3]), - amount: BigInt(hData[4]) + amount: BigInt(hData[4]), }; } }); @@ -348,7 +351,7 @@ class ChainHelperBase { async connect(wsEndpoint: string, listeners?: IApiListeners) { if (this.api !== null) throw Error('Already connected'); - const { api, network } = await ChainHelperBase.createConnection(wsEndpoint, listeners, this.forcedNetwork); + const {api, network} = await ChainHelperBase.createConnection(wsEndpoint, listeners, this.forcedNetwork); this.api = api; this.network = network; } @@ -361,13 +364,13 @@ class ChainHelperBase { } static async detectNetwork(api: ApiPromise): Promise { - let spec = (await api.query.system.lastRuntimeUpgrade()).toJSON() as any; + const spec = (await api.query.system.lastRuntimeUpgrade()).toJSON() as any; if(['quartz', 'unique'].indexOf(spec.specName) > -1) return spec.specName; return 'opal'; } static async detectNetworkByWsEndpoint(wsEndpoint: string): Promise { - let api = new ApiPromise({provider: new WsProvider(wsEndpoint)}); + const api = new ApiPromise({provider: new WsProvider(wsEndpoint)}); await api.isReady; const network = await this.detectNetwork(api); @@ -384,15 +387,15 @@ class ChainHelperBase { if(typeof network === 'undefined' || network === null) network = 'opal'; const supportedRPC = { opal: { - unique: require('@unique-nft/opal-testnet-types/definitions').unique.rpc + unique: require('@unique-nft/opal-testnet-types/definitions').unique.rpc, }, quartz: { - unique: require('@unique-nft/quartz-mainnet-types/definitions').unique.rpc + unique: require('@unique-nft/quartz-mainnet-types/definitions').unique.rpc, }, unique: { - unique: require('@unique-nft/unique-mainnet-types/definitions').unique.rpc - } - } + unique: require('@unique-nft/unique-mainnet-types/definitions').unique.rpc, + }, + }; if(!supportedRPC.hasOwnProperty(network)) network = await this.detectNetworkByWsEndpoint(wsEndpoint); const rpc = supportedRPC[network]; @@ -404,7 +407,7 @@ class ChainHelperBase { await api.isReadyOrError; if (typeof listeners === 'undefined') listeners = {}; - for (let event of ['connected', 'disconnected', 'error', 'ready', 'decorated']) { + for (const event of ['connected', 'disconnected', 'error', 'ready', 'decorated']) { if (!listeners.hasOwnProperty(event) || typeof listeners[event as TApiAllowedListeners] === 'undefined') continue; api.on(event as ApiInterfaceEvents, listeners[event as TApiAllowedListeners] as (...args: any[]) => any); } @@ -437,10 +440,10 @@ class ChainHelperBase { const sign = (callback: any) => { if(options !== null) return transaction.signAndSend(sender, options, callback); return transaction.signAndSend(sender, callback); - } + }; return new Promise(async (resolve, reject) => { try { - let unsub = await sign((result: any) => { + const unsub = await sign((result: any) => { const status = this.getTransactionStatus(result); if (status === this.transactionStatus.SUCCESS) { @@ -479,7 +482,7 @@ class ChainHelperBase { constructApiCall(apiCall: string, params: any[]) { if(!apiCall.startsWith('api.')) throw Error(`Invalid api call: ${apiCall}`); let call = this.api as any; - for(let part of apiCall.slice(4).split('.')) { + for(const part of apiCall.slice(4).split('.')) { call = call[part]; } return call(...params); @@ -503,13 +506,13 @@ class ChainHelperBase { const endTime = (new Date()).getTime(); - let log = { + const log = { executedAt: endTime, executionTime: endTime - startTime, type: this.chainLogType.EXTRINSIC, status: result.status, call: extrinsic, - params + params, } as IUniqueHelperLog; if(result.status !== this.transactionStatus.SUCCESS && result.moduleError) log.moduleError = result.moduleError; @@ -527,11 +530,13 @@ class ChainHelperBase { if(!rpc.startsWith('api.rpc.') && !rpc.startsWith('api.query.')) throw Error(`${rpc} is not RPC call`); const startTime = (new Date()).getTime(); - let result, log = { + let result; + let error = null; + const log = { type: this.chainLogType.RPC, call: rpc, - params - } as IUniqueHelperLog, error = null; + params, + } as IUniqueHelperLog; try { result = await this.constructApiCall(rpc, params); @@ -607,15 +612,15 @@ class CollectionGroup extends HelperGroup { raw: any } | null> { const collection = await this.helper.callRpc('api.rpc.unique.collectionById', [collectionId]); - let humanCollection = collection.toHuman(), collectionData = { + const humanCollection = collection.toHuman(), collectionData = { id: collectionId, name: null, description: null, tokensCount: 0, admins: [], - raw: humanCollection + raw: humanCollection, } as any, jsonCollection = collection.toJSON(); if (humanCollection === null) return null; collectionData.raw.limits = jsonCollection.limits; collectionData.raw.permissions = jsonCollection.permissions; collectionData.normalizedOwner = this.helper.address.normalizeSubstrate(collectionData.raw.owner); - for (let key of ['name', 'description']) { + for (const key of ['name', 'description']) { collectionData[key] = this.helper.util.vec2str(humanCollection[key]); } @@ -632,8 +637,8 @@ class CollectionGroup extends HelperGroup { * @returns array of administrators */ async getAdmins(collectionId: number): Promise { - let normalized = []; - for(let admin of (await this.helper.callRpc('api.rpc.unique.adminlist', [collectionId])).toHuman()) { + const normalized = []; + for(const admin of (await this.helper.callRpc('api.rpc.unique.adminlist', [collectionId])).toHuman()) { if(admin.Substrate) normalized.push({Substrate: this.helper.address.normalizeSubstrate(admin.Substrate)}); else normalized.push(admin); } @@ -663,7 +668,7 @@ class CollectionGroup extends HelperGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.destroyCollection', [collectionId], - true, `Unable to burn collection for ${label}` + true, `Unable to burn collection for ${label}`, ); return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionDestroyed', label); @@ -683,7 +688,7 @@ class CollectionGroup extends HelperGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.setCollectionSponsor', [collectionId, sponsorAddress], - true, `Unable to set collection sponsor for ${label}` + true, `Unable to set collection sponsor for ${label}`, ); return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionSponsorSet', label); @@ -702,7 +707,7 @@ class CollectionGroup extends HelperGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.confirmSponsorship', [collectionId], - true, `Unable to confirm collection sponsorship for ${label}` + true, `Unable to confirm collection sponsorship for ${label}`, ); return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'SponsorshipConfirmed', label); @@ -722,7 +727,7 @@ class CollectionGroup extends HelperGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.setCollectionLimits', [collectionId, limits], - true, `Unable to set collection limits for ${label}` + true, `Unable to set collection limits for ${label}`, ); return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionLimitSet', label); @@ -742,7 +747,7 @@ class CollectionGroup extends HelperGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.changeCollectionOwner', [collectionId, ownerAddress], - true, `Unable to change collection owner for ${label}` + true, `Unable to change collection owner for ${label}`, ); return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionOwnedChanged', label); @@ -762,7 +767,7 @@ class CollectionGroup extends HelperGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.addCollectionAdmin', [collectionId, adminAddressObj], - true, `Unable to add collection admin for ${label}` + true, `Unable to add collection admin for ${label}`, ); return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionAdminAdded', label); @@ -782,7 +787,7 @@ class CollectionGroup extends HelperGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.removeCollectionAdmin', [collectionId, adminAddressObj], - true, `Unable to remove collection admin for ${label}` + true, `Unable to remove collection admin for ${label}`, ); return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionAdminRemoved', label); @@ -802,7 +807,7 @@ class CollectionGroup extends HelperGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.setCollectionPermissions', [collectionId, permissions], - true, `Unable to set collection permissions for ${label}` + true, `Unable to set collection permissions for ${label}`, ); return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionPermissionSet', label); @@ -847,7 +852,7 @@ class CollectionGroup extends HelperGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.setCollectionProperties', [collectionId, properties], - true, `Unable to set collection properties for ${label}` + true, `Unable to set collection properties for ${label}`, ); return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionPropertySet', label); @@ -867,7 +872,7 @@ class CollectionGroup extends HelperGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.deleteCollectionProperties', [collectionId, propertyKeys], - true, `Unable to delete collection properties for ${label}` + true, `Unable to delete collection properties for ${label}`, ); return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionPropertyDeleted', label); @@ -877,7 +882,7 @@ class CollectionGroup extends HelperGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.transfer', [addressObj, collectionId, tokenId, amount], - true, `Unable to transfer token #${tokenId} from collection #${collectionId}` + true, `Unable to transfer token #${tokenId} from collection #${collectionId}`, ); return this.helper.util.isTokenTransferSuccess(result.result.events, collectionId, tokenId, {Substrate: typeof signer === 'string' ? signer : signer.address}, addressObj, amount); @@ -887,7 +892,7 @@ class CollectionGroup extends HelperGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.transferFrom', [fromAddressObj, toAddressObj, collectionId, tokenId, amount], - true, `Unable to transfer token #${tokenId} from collection #${collectionId}` + true, `Unable to transfer token #${tokenId} from collection #${collectionId}`, ); return this.helper.util.isTokenTransferSuccess(result.result.events, collectionId, tokenId, fromAddressObj, toAddressObj, amount); } @@ -900,7 +905,7 @@ class CollectionGroup extends HelperGroup { const burnResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.burnItem', [collectionId, tokenId, amount], - true, `Unable to burn token for ${label}` + true, `Unable to burn token for ${label}`, ); const burnedTokens = this.helper.util.extractTokensFromBurnResult(burnResult, label); if (burnedTokens.tokens.length > 1) throw Error('Burned multiple tokens'); @@ -912,7 +917,7 @@ class CollectionGroup extends HelperGroup { const burnResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.burnFrom', [collectionId, fromAddressObj, tokenId, amount], - true, `Unable to burn token from for ${label}` + true, `Unable to burn token from for ${label}`, ); const burnedTokens = this.helper.util.extractTokensFromBurnResult(burnResult, label); return burnedTokens.success && burnedTokens.tokens.length > 0; @@ -923,7 +928,7 @@ class CollectionGroup extends HelperGroup { const approveResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.approve', [toAddressObj, collectionId, tokenId, amount], - true, `Unable to approve token for ${label}` + true, `Unable to approve token for ${label}`, ); return this.helper.util.findCollectionInEvents(approveResult.result.events, collectionId, 'common', 'Approved', label); @@ -938,13 +943,13 @@ class CollectionGroup extends HelperGroup { } async isTokenExists(collectionId: number, tokenId: number): Promise { - return (await this.helper.callRpc('api.rpc.unique.tokenExists', [collectionId, tokenId])).toJSON() + return (await this.helper.callRpc('api.rpc.unique.tokenExists', [collectionId, tokenId])).toJSON(); } } class NFTnRFT extends CollectionGroup { async getTokensByAddress(collectionId: number, addressObj: ICrossAccountId): Promise { - return (await this.helper.callRpc('api.rpc.unique.accountTokens', [collectionId, addressObj])).toJSON() + return (await this.helper.callRpc('api.rpc.unique.accountTokens', [collectionId, addressObj])).toJSON(); } async getToken(collectionId: number, tokenId: number, blockHashAt?: string, propertyKeys?: string[]): Promise<{ @@ -958,7 +963,7 @@ class NFTnRFT extends CollectionGroup { } else { if(typeof propertyKeys === 'undefined') { - let collection = (await this.helper.callRpc('api.rpc.unique.collectionById', [collectionId])).toHuman(); + const collection = (await this.helper.callRpc('api.rpc.unique.collectionById', [collectionId])).toHuman(); if(!collection) return null; propertyKeys = collection.tokenPropertyPermissions.map((x: ITokenPropertyPermission) => x.key); } @@ -966,8 +971,8 @@ class NFTnRFT extends CollectionGroup { } tokenData = tokenData.toHuman(); if (tokenData === null || tokenData.owner === null) return null; - let owner = {} as any; - for (let key of Object.keys(tokenData.owner)) { + const owner = {} as any; + for (const key of Object.keys(tokenData.owner)) { owner[key.toLocaleLowerCase()] = key.toLocaleLowerCase() === 'substrate' ? this.helper.address.normalizeSubstrate(tokenData.owner[key]) : tokenData.owner[key]; } tokenData.normalizedOwner = crossAccountIdFromLower(owner); @@ -979,7 +984,7 @@ class NFTnRFT extends CollectionGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.setTokenPropertyPermissions', [collectionId, permissions], - true, `Unable to set token property permissions for ${label}` + true, `Unable to set token property permissions for ${label}`, ); return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'PropertyPermissionSet', label); @@ -990,7 +995,7 @@ class NFTnRFT extends CollectionGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.setTokenProperties', [collectionId, tokenId, properties], - true, `Unable to set token properties for ${label}` + true, `Unable to set token properties for ${label}`, ); return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'TokenPropertySet', label); @@ -1001,7 +1006,7 @@ class NFTnRFT extends CollectionGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.deleteTokenProperties', [collectionId, tokenId, propertyKeys], - true, `Unable to delete token properties for ${label}` + true, `Unable to delete token properties for ${label}`, ); return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'TokenPropertyDeleted', label); @@ -1010,13 +1015,13 @@ class NFTnRFT extends CollectionGroup { async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, mode: 'NFT' | 'RFT', errorLabel = 'Unable to mint collection'): Promise { collectionOptions = JSON.parse(JSON.stringify(collectionOptions)) as ICollectionCreationOptions; // Clone object collectionOptions.mode = (mode === 'NFT') ? {nft: null} : {refungible: null}; - for (let key of ['name', 'description', 'tokenPrefix']) { + for (const key of ['name', 'description', 'tokenPrefix']) { if (typeof collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] === 'string') collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] = this.helper.util.str2vec(collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] as string); } const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createCollectionEx', [collectionOptions], - true, errorLabel + true, errorLabel, ); return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult, errorLabel)); } @@ -1118,10 +1123,10 @@ class NFTGroup extends NFTnRFT { signer, 'api.tx.unique.createItem', [data.collectionId, (typeof data.owner === 'string') ? {Substrate: data.owner} : data.owner, { nft: { - properties: data.properties - } + properties: data.properties, + }, }], - true, `Unable to mint NFT token for ${label}` + true, `Unable to mint NFT token for ${label}`, ); const createdTokens = this.helper.util.extractTokensFromCreationResult(creationResult, label); if (createdTokens.tokens.length > 1) throw Error('Minted multiple tokens'); @@ -1134,7 +1139,7 @@ class NFTGroup extends NFTnRFT { const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createMultipleItemsEx', [collectionId, {NFT: tokens}], - true, `Unable to mint NFT tokens for ${label}` + true, `Unable to mint NFT tokens for ${label}`, ); const collection = this.getCollectionObject(collectionId); return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); @@ -1142,15 +1147,15 @@ class NFTGroup extends NFTnRFT { async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {properties?: IProperty[]}[], label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; - let rawTokens = []; - for (let token of tokens) { - let raw = {NFT: {properties: token.properties}}; + const rawTokens = []; + for (const token of tokens) { + const raw = {NFT: {properties: token.properties}}; rawTokens.push(raw); } const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createMultipleItems', [collectionId, owner, rawTokens], - true, `Unable to mint NFT tokens for ${label}` + true, `Unable to mint NFT tokens for ${label}`, ); const collection = this.getCollectionObject(collectionId); return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); @@ -1202,10 +1207,10 @@ class RFTGroup extends NFTnRFT { 'api.tx.unique.createItem', [data.collectionId, (typeof data.owner === 'string') ? {Substrate: data.owner} : data.owner, { refungible: { pieces: data.pieces, - properties: data.properties - } + properties: data.properties, + }, }], - true, `Unable to mint RFT token for ${label}` + true, `Unable to mint RFT token for ${label}`, ); const createdTokens = this.helper.util.extractTokensFromCreationResult(creationResult, label); if (createdTokens.tokens.length > 1) throw Error('Minted multiple tokens'); @@ -1219,7 +1224,7 @@ class RFTGroup extends NFTnRFT { const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createMultipleItemsEx', [collectionId, {RefungibleMultipleOwners: tokens}], - true, `Unable to mint RFT tokens for ${label}` + true, `Unable to mint RFT tokens for ${label}`, ); const collection = this.getCollectionObject(collectionId); return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); @@ -1227,15 +1232,15 @@ class RFTGroup extends NFTnRFT { async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {pieces: bigint, properties?: IProperty[]}[], label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; - let rawTokens = []; - for (let token of tokens) { - let raw = {ReFungible: {pieces: token.pieces, properties: token.properties}}; + const rawTokens = []; + for (const token of tokens) { + const raw = {ReFungible: {pieces: token.pieces, properties: token.properties}}; rawTokens.push(raw); } const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createMultipleItems', [collectionId, owner, rawTokens], - true, `Unable to mint RFT tokens for ${label}` + true, `Unable to mint RFT tokens for ${label}`, ); const collection = this.getCollectionObject(collectionId); return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); @@ -1259,7 +1264,7 @@ class RFTGroup extends NFTnRFT { const repartitionResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.repartition', [collectionId, tokenId, amount], - true, `Unable to repartition RFT token for ${label}` + true, `Unable to repartition RFT token for ${label}`, ); if(currentAmount < amount) return this.helper.util.findCollectionInEvents(repartitionResult.result.events, collectionId, 'common', 'ItemCreated', label); return this.helper.util.findCollectionInEvents(repartitionResult.result.events, collectionId, 'common', 'ItemDestroyed', label); @@ -1272,17 +1277,17 @@ class FTGroup extends CollectionGroup { return new UniqueFTCollection(collectionId, this.helper); } - async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, decimalPoints: number = 0, errorLabel = 'Unable to mint collection'): Promise { + async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, decimalPoints = 0, errorLabel = 'Unable to mint collection'): Promise { collectionOptions = JSON.parse(JSON.stringify(collectionOptions)) as ICollectionCreationOptions; // Clone object if(collectionOptions.tokenPropertyPermissions) throw Error('Fungible collections has no tokenPropertyPermissions'); collectionOptions.mode = {fungible: decimalPoints}; - for (let key of ['name', 'description', 'tokenPrefix']) { + for (const key of ['name', 'description', 'tokenPrefix']) { if (typeof collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] === 'string') collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] = this.helper.util.str2vec(collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] as string); } const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createCollectionEx', [collectionOptions], - true, errorLabel + true, errorLabel, ); return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult, errorLabel)); } @@ -1293,25 +1298,25 @@ class FTGroup extends CollectionGroup { signer, 'api.tx.unique.createItem', [collectionId, (typeof owner === 'string') ? {Substrate: owner} : owner, { fungible: { - value: amount - } + value: amount, + }, }], - true, `Unable to mint fungible tokens for ${label}` + true, `Unable to mint fungible tokens for ${label}`, ); return this.helper.util.findCollectionInEvents(creationResult.result.events, collectionId, 'common', 'ItemCreated', label); } async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {value: bigint}[], label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; - let rawTokens = []; - for (let token of tokens) { - let raw = {Fungible: {Value: token.value}}; + const rawTokens = []; + for (const token of tokens) { + const raw = {Fungible: {Value: token.value}}; rawTokens.push(raw); } const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createMultipleItems', [collectionId, owner, rawTokens], - true, `Unable to mint RFT tokens for ${label}` + true, `Unable to mint RFT tokens for ${label}`, ); return this.helper.util.findCollectionInEvents(creationResult.result.events, collectionId, 'common', 'ItemCreated', label); } @@ -1360,7 +1365,7 @@ class ChainGroup extends HelperGroup { return { ss58Format: properties.ss58Format.toJSON(), tokenDecimals: properties.tokenDecimals.toJSON(), - tokenSymbol: properties.tokenSymbol.toJSON() + tokenSymbol: properties.tokenSymbol.toJSON(), }; } @@ -1403,7 +1408,7 @@ class BalanceGroup extends HelperGroup { transfer = { from: this.helper.address.normalizeSubstrate(data[0]), to: this.helper.address.normalizeSubstrate(data[1]), - amount: BigInt(data[2]) + amount: BigInt(data[2]), }; } }); @@ -1421,13 +1426,13 @@ class AddressGroup extends HelperGroup { } async normalizeSubstrateToChainFormat(address: TSubstrateAccount): Promise { - let info = this.helper.chain.getChainProperties(); + const info = this.helper.chain.getChainProperties(); return encodeAddress(decodeAddress(address), info.ss58Format); } async ethToSubstrate(ethAddress: TEthereumAccount, toChainFormat=false): Promise { if(!toChainFormat) return evmToAddress(ethAddress); - let info = this.helper.chain.getChainProperties(); + const info = this.helper.chain.getChainProperties(); return evmToAddress(ethAddress, info.ss58Format); } From d98cdf749517281cc886873f37c5b4255efe0706 Mon Sep 17 00:00:00 2001 From: Igor Kozyrev Date: Mon, 8 Aug 2022 13:13:45 +0000 Subject: [PATCH 0233/1274] ci forkless config --- .env | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.env b/.env index b988f9e491..5c6a03a0df 100644 --- a/.env +++ b/.env @@ -1,6 +1,8 @@ RUST_TOOLCHAIN=nightly-2022-05-11 -RUST_C=1.62.0-nightly -POLKA_VERSION=release-v0.9.24 -UNIQUE_BRANCH=develop -USER=*** -PASS=*** +POLKADOT_BUILD_BRANCH=release-v0.9.24 + +POLKADOT_MAINNET_BRANCH=release-v0.9.25 +UNIQUE_MAINNET_TAG=v924010 + +KUSAMA_MAINNET_BRANCH=release-v0.9.26 +QUARTZ_MAINNET_TAG=v924012 \ No newline at end of file From 302167317ed5401066806616a057d62a7c1bdf87 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 8 Aug 2022 18:00:51 +0300 Subject: [PATCH 0234/1274] Added workflow configuration for forkless testing. --- .docker/Dockerfile-parachain-upgrade | 100 +++++++++++++++ .docker/docker-compose-forkless.yaml | 19 +++ .docker/docker-compose.tmp-forkless.j2 | 13 ++ .docker/launch-config.json | 125 +++++++++++++++++++ .github/workflows/forkless-update-nodata.yml | 115 +++++++++++++++++ 5 files changed, 372 insertions(+) create mode 100644 .docker/Dockerfile-parachain-upgrade create mode 100644 .docker/docker-compose-forkless.yaml create mode 100644 .docker/docker-compose.tmp-forkless.j2 create mode 100644 .docker/launch-config.json create mode 100644 .github/workflows/forkless-update-nodata.yml diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade new file mode 100644 index 0000000000..dabe1b186c --- /dev/null +++ b/.docker/Dockerfile-parachain-upgrade @@ -0,0 +1,100 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ARG RUST_TOOLCHAIN=nightly-2022-05-11 + +ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN apt-get update && \ + apt-get install -y cmake pkg-config libssl-dev git clang && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install $RUST_TOOLCHAIN && \ + rustup default $RUST_TOOLCHAIN && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN + + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD current version ====== +FROM rust-builder as builder-unique-current + +ARG PROFILE=release +ARG FEATURE= + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +RUN git clone $REPO_URL -b $BRANCH +RUN cargo build $FEATURE --$PROFILE + + +# ===== BUILD target version ====== +FROM rust-builder as builder-unique-target + +ARG PROFILE=release +ARG FEATURE= + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +RUN git clone $REPO_URL -b $MAINNET_BRANCH +RUN cargo build $FEATURE --$PROFILE + + + +# ===== BUILD POLKADOT ===== +FROM rust-builder as builder-polkadot + +ARG POLKADOT_BUILD_BRANCH=release-v0.9.24 +ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ + cd polkadot && \ + cargo build --release + +# ===== RUN ====== + +FROM ubuntu:20.04 + +RUN apt-get -y update && \ + apt-get -y upgrade && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/runtime-upgrade-testing + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn install + +COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ +COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ + +COPY --from=builder-unique /.docker/launch-config.json /polkadot-launch/launch-config.json + + +CMD export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start launch-config.json --test-upgrade diff --git a/.docker/docker-compose-forkless.yaml b/.docker/docker-compose-forkless.yaml new file mode 100644 index 0000000000..e91b49e249 --- /dev/null +++ b/.docker/docker-compose-forkless.yaml @@ -0,0 +1,19 @@ +version: "3.5" + +services: + node-parachain: + build: + context: ../ + dockerfile: .docker/Dockerfile-parachain-upgrade + image: node-parachain + container_name: node-parachain + expose: + - 9944 + - 9933 + ports: + - 127.0.0.1:9944:9944 + - 127.0.0.1:9933:9933 + logging: + options: + max-size: "1m" + max-file: "3" diff --git a/.docker/docker-compose.tmp-forkless.j2 b/.docker/docker-compose.tmp-forkless.j2 new file mode 100644 index 0000000000..fe0b8653d2 --- /dev/null +++ b/.docker/docker-compose.tmp-forkless.j2 @@ -0,0 +1,13 @@ +version: "3.5" + +services: + node-parachain: + build: + args: + - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" + - "BRANCH={{ BRANCH }}" + - "REPO_URL={{ REPO_URL }}" + - "FEATURE={{ FEATURE }}" + - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" + - "MAINNET_TAG={{ MAINNET_TAG }}" + - "MAINNET_BRANCH={{ MAINNET_BRANCH }}" diff --git a/.docker/launch-config.json b/.docker/launch-config.json new file mode 100644 index 0000000000..e9db0632d1 --- /dev/null +++ b/.docker/launch-config.json @@ -0,0 +1,125 @@ +{ + "relaychain": { + "bin": "../alts/polkadot/target/release/polkadot", + "upgradeBin": "../polkadot/target/release/polkadot", + "upgradeWasm": "../polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm", + "chain": "westend-local", + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "../unique-chain/current/release/unique-collator", + "upgradeBin": "../unique-chain/target/release/unique-collator", + "upgradeWasm": "../unique-chain/target/release/wbuild/opal-runtime/opal_runtime.compact.compressed.wasm", + "id": "1000", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace" + ] + }, + { + "port": 31201, + "wsPort": 9945, + "rpcPort": 9934, + "name": "bob", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [], + "finalization": false +} diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml new file mode 100644 index 0000000000..7a3bfd8004 --- /dev/null +++ b/.github/workflows/forkless-update-nodata.yml @@ -0,0 +1,115 @@ +name: Develop - Build & test + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: + - develop + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +#Define Workflow variables +env: + RUST_TOOLCHAIN: nightly-2022-05-11 + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + POLKADOT_BUILD_BRANCH: release-v0.9.24 + POLKADOT_MAINNET_BRANCH: release-v0.9.25 # for unique-runtime + UNIQUE_MAINNET_TAG: v924010 + KUSAMA_MAINNET_BRANCH: release-v0.9.26 # for для quartz-runtime + QUARTZ_MAINNET_TAG: v924012 + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + build: + # The type of runner that the job will run on + runs-on: self-hosted-ci + + name: Build Container, Spin it Up an test + + continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: + # - network: "Opal" + # features: "--features=opal-runtime" + # binary_version: + - network: "Quartz" # KUSAMA_MAINNET_BRANCH для quartz-runtime + features: "--features=quartz-runtime" + mainnet_branch: ${{ env.KUSAMA_MAINNET_BRANCH }} + mainnet_tag: ${{ env.QUARTZ_MAINNET_TAG }} + - network: "Unique" # POLKADOT_MAINNET_BRANCH для unique-runtime + features: "--features=unique-runtime" + mainnet_branch: ${{ env.POLKADOT_MAINNET_BRANCH }} + mainnet_tag: ${{ env.UNIQUE_MAINNET_TAG }} + + + + steps: + - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) + if: github.event.pull_request.draft == true + run: exit 1 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-forkless.j2 + output_file: .docker/docker-compose.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }} + MAINNET_TAG=${{ env.mainnet_tag }} + MAINNET_BRANCH=${{ env.mainnet_branch }} + FEATURE=${{ matrix.features }} + BRANCH=${{ github.head_ref }} + + - name: Show build configuration + run: cat .docker/docker-compose.${{ matrix.network }}.yml + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build + + +# - name: Test Report +# uses: phoenix-actions/test-reporting@v8 +# if: success() || failure() # run this step even if previous step failed +# with: +# name: Tests ${{ matrix.network }} # Name of the check run which will be created +# path: tests/mochawesome-report/test-*.json # Path to test results +# reporter: mochawesome-json +# fail-on-error: 'false' +# +# - name: Read output variables +# run: | +# echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}" + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From f5508e30dd3ccd824f53b6456520321548822b35 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 8 Aug 2022 18:05:09 +0300 Subject: [PATCH 0235/1274] FIX: Added missed build ARG --- .docker/Dockerfile-parachain-upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index dabe1b186c..2005e80706 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -44,6 +44,7 @@ FROM rust-builder as builder-unique-target ARG PROFILE=release ARG FEATURE= +ARG MAINNET_BRANCH= RUN mkdir /unique_parachain WORKDIR /unique_parachain From 4814ce3a06314c95ce12b0dd79e7ccf3eca02a57 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 8 Aug 2022 18:08:30 +0300 Subject: [PATCH 0236/1274] FIX: changed name of docker-compose file --- .github/workflows/forkless-update-nodata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 7a3bfd8004..c9c573899b 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -112,4 +112,4 @@ jobs: - name: Stop running containers if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From 15f4cf3db81bb8ccf21e404617dd77fd52a528c5 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 8 Aug 2022 18:11:38 +0300 Subject: [PATCH 0237/1274] Enabled running all test even errors exists. --- .github/workflows/node_build_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 7f0413efde..95ba9cace0 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -28,7 +28,7 @@ jobs: name: Build Container, Spin it Up an test - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: From 76975d1a4b93cd91361878ca7fd8c3af1bbe25fd Mon Sep 17 00:00:00 2001 From: Maksandre Date: Tue, 9 Aug 2022 00:02:28 +0500 Subject: [PATCH 0238/1274] add jsdoc --- tests/src/util/playgrounds/unique.ts | 633 ++++++++++++++++++++++++++- 1 file changed, 630 insertions(+), 3 deletions(-) diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 3accd55892..165fb60ba3 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -580,7 +580,8 @@ class CollectionGroup extends HelperGroup { * * @param collectionId ID of collection * @param tokenId ID of token - * @param addressObj + * @param addressObj address for which the sponsorship is checked + * @example await getTokenNextSponsored(1, 2, {Substrate: '5DfhbVfww7ThF8q6f3...'}); * @returns number of blocks or null if sponsorship hasn't been set */ async getTokenNextSponsored(collectionId: number, tokenId: number, addressObj: ICrossAccountId): Promise { @@ -588,7 +589,7 @@ class CollectionGroup extends HelperGroup { } /** - * Get number of collection created on current chain. + * Get the number of created collections. * * @returns number of created collections */ @@ -600,6 +601,7 @@ class CollectionGroup extends HelperGroup { * Get information about the collection with additional data, including the number of tokens it contains, its administrators, the normalized address of the collection's owner, and decoded name and description. * * @param collectionId ID of collection + * @example await getData(2) * @returns collection information object */ async getData(collectionId: number): Promise<{ @@ -634,6 +636,7 @@ class CollectionGroup extends HelperGroup { * Get the normalized addresses of the collection's administrators. * * @param collectionId ID of collection + * @example await getAdmins(1) * @returns array of administrators */ async getAdmins(collectionId: number): Promise { @@ -649,6 +652,7 @@ class CollectionGroup extends HelperGroup { * Get the effective limits of the collection instead of null for default values * * @param collectionId ID of collection + * @example await getEffectiveLimits(2) * @returns object of collection limits */ async getEffectiveLimits(collectionId: number): Promise { @@ -661,6 +665,7 @@ class CollectionGroup extends HelperGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param label extra label for log + * @example await helper.collection.burn(aliceKeyring, 3); * @returns bool true on success */ async burn(signer: TSigner, collectionId: number, label?: string): Promise { @@ -681,6 +686,7 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param sponsorAddress Sponsor substrate address * @param label extra label for log + * @example setSponsor(aliceKeyring, 10, "5DyN4Y92vZCjv38fg...") * @returns bool true on success */ async setSponsor(signer: TSigner, collectionId: number, sponsorAddress: TSubstrateAccount, label?: string): Promise { @@ -700,6 +706,7 @@ class CollectionGroup extends HelperGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param label extra label for log + * @example confirmSponsorship(aliceKeyring, 10) * @returns bool true on success */ async confirmSponsorship(signer: TSigner, collectionId: number, label?: string): Promise { @@ -720,6 +727,15 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param limits collection limits object * @param label extra label for log + * @example + * await setLimits( + * aliceKeyring, + * 10, + * { + * sponsorTransferTimeout: 0, + * ownerCanDestroy: false + * } + * ) * @returns bool true on success */ async setLimits(signer: TSigner, collectionId: number, limits: ICollectionLimits, label?: string): Promise { @@ -740,6 +756,7 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param ownerAddress substrate address of new owner * @param label extra label for log + * @example changeOwner(aliceKeyring, 10, "5DyN4Y92vZCjv38fg...") * @returns bool true on success */ async changeOwner(signer: TSigner, collectionId: number, ownerAddress: TSubstrateAccount, label?: string): Promise { @@ -760,6 +777,7 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param adminAddressObj Administrator address (substrate or ethereum) * @param label extra label for log + * @example addAdmin(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."}) * @returns bool true on success */ async addAdmin(signer: TSigner, collectionId: number, adminAddressObj: ICrossAccountId, label?: string): Promise { @@ -780,6 +798,7 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param adminAddressObj Administrator address (substrate or ethereum) * @param label extra label for log + * @example removeAdmin(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."}) * @returns bool true on success */ async removeAdmin(signer: TSigner, collectionId: number, adminAddressObj: ICrossAccountId, label?: string): Promise { @@ -800,6 +819,7 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param permissions collection permissions object * @param label extra label for log + * @example setPermissions(aliceKeyring, 10, TODO); * @returns bool true on success */ async setPermissions(signer: TSigner, collectionId: number, permissions: ICollectionPermissions, label?: string): Promise { @@ -820,6 +840,7 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param permissions nesting permissions object * @param label extra label for log + * @example enableNesting(aliceKeyring, 10, TODO); * @returns bool true on success */ async enableNesting(signer: TSigner, collectionId: number, permissions: INestingPermissions, label?: string): Promise { @@ -832,6 +853,7 @@ class CollectionGroup extends HelperGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param label extra label for log + * @example disableNesting(aliceKeyring, 10); * @returns bool true on success */ async disableNesting(signer: TSigner, collectionId: number, label?: string): Promise { @@ -845,6 +867,8 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param properties array of property objects * @param label extra label for log + * @example + * setProperties(aliceKeyring, 10, TODO) * @returns bool true on success */ async setProperties(signer: TSigner, collectionId: number, properties: IProperty[], label?: string): Promise { @@ -864,7 +888,8 @@ class CollectionGroup extends HelperGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param propertyKeys array of property keys to delete - * @param label + * @param label + * @example deleteProperties(aliceKeyring, 10, TODO) * @returns */ async deleteProperties(signer: TSigner, collectionId: number, propertyKeys: string[], label?: string): Promise { @@ -878,6 +903,17 @@ class CollectionGroup extends HelperGroup { return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionPropertyDeleted', label); } + /** + * Changes the owner of the token. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param addressObj address of a new owner + * @param amount amount of tokens to be transfered. For NFT must be set to 1n + * @example transferToken(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}) + * @returns true if the token success, otherwise false + */ async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId, amount=1n): Promise { const result = await this.helper.executeExtrinsic( signer, @@ -888,6 +924,19 @@ class CollectionGroup extends HelperGroup { return this.helper.util.isTokenTransferSuccess(result.result.events, collectionId, tokenId, {Substrate: typeof signer === 'string' ? signer : signer.address}, addressObj, amount); } + /** + * + * Change ownership of a NFT on behalf of the owner. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param fromAddressObj address on behalf of which the token will be sent + * @param toAddressObj new token owner + * @param amount amount of tokens to be transfered. For NFT must be set to 1n + * @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg"}, {Ethereum: "0x9F0583DbB85..."}) + * @returns true if the token success, otherwise false + */ async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n): Promise { const result = await this.helper.executeExtrinsic( signer, @@ -897,6 +946,18 @@ class CollectionGroup extends HelperGroup { return this.helper.util.isTokenTransferSuccess(result.result.events, collectionId, tokenId, fromAddressObj, toAddressObj, amount); } + /** + * + * Destroys a concrete instance of NFT. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param label + * @param amount amount of tokens to be burned. For NFT must be set to 1n + * @example burnToken(aliceKeyring, 10, 5); + * @returns ```true``` and burnt token number is extrinsic success. Otherwise ```false``` and ```null``` + */ async burnToken(signer: TSigner, collectionId: number, tokenId: number, label?: string, amount=1n): Promise<{ success: boolean, token: number | null @@ -912,6 +973,18 @@ class CollectionGroup extends HelperGroup { return {success: burnedTokens.success, token: burnedTokens.tokens.length > 0 ? burnedTokens.tokens[0] : null}; } + /** + * Destroys a concrete instance of NFT on behalf of the owner + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param fromAddressObj address on behalf of which the token will be burnt + * @param tokenId ID of token + * @param label + * @param amount amount of tokens to be burned. For NFT must be set to 1n + * @example burnTokenFrom(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."}, 5, {Ethereum: "0x9F0583DbB85..."}) + * @returns ```true``` if extrinsic success. Otherwise ```false``` + */ async burnTokenFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, tokenId: number, label?: string, amount=1n): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; const burnResult = await this.helper.executeExtrinsic( @@ -923,6 +996,17 @@ class CollectionGroup extends HelperGroup { return burnedTokens.success && burnedTokens.tokens.length > 0; } + /** + * Set, change, or remove approved address to transfer the ownership of the NFT. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param toAddressObj + * @param label + * @param amount amount of token to be approved. For NFT must be set to 1n + * @returns ```true``` if extrinsic success. Otherwise ```false``` + */ async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string, amount=1n) { if(typeof label === 'undefined') label = `collection #${collectionId}`; const approveResult = await this.helper.executeExtrinsic( @@ -934,24 +1018,63 @@ class CollectionGroup extends HelperGroup { return this.helper.util.findCollectionInEvents(approveResult.result.events, collectionId, 'common', 'Approved', label); } + /** + * TODO + * @param collectionId ID of collection + * @param tokenId ID of token + * @param toAccountObj + * @param fromAccountObj + * @example getTokenApprovedPieces(10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, {Substrate: "5ERZNF88Mm7UGfPP3mdG..."}) + * @returns number of approved to transfer pieces + */ async getTokenApprovedPieces(collectionId: number, tokenId: number, toAccountObj: ICrossAccountId, fromAccountObj: ICrossAccountId): Promise { return (await this.helper.callRpc('api.rpc.unique.allowance', [collectionId, fromAccountObj, toAccountObj, tokenId])).toBigInt(); } + /** + * Get the last created token id + * @param collectionId ID of collection + * @example getLastTokenId(10); + * @returns id of the last created token + */ async getLastTokenId(collectionId: number): Promise { return (await this.helper.callRpc('api.rpc.unique.lastTokenId', [collectionId])).toNumber(); } + /** + * Check if token exists + * @param collectionId ID of collection + * @param tokenId ID of token + * @example isTokenExists(10, 20); + * @returns true if the token exists, otherwise false + */ async isTokenExists(collectionId: number, tokenId: number): Promise { return (await this.helper.callRpc('api.rpc.unique.tokenExists', [collectionId, tokenId])).toJSON(); } } class NFTnRFT extends CollectionGroup { + /** + * Get tokens owned by account + * + * @param collectionId ID of collection + * @param addressObj tokens owner + * @example getTokensByAddress(10, {Substrate: "5DyN4Y92vZCjv38fg..."}) + * @returns array of token ids owned by account TODO for RFT? + */ async getTokensByAddress(collectionId: number, addressObj: ICrossAccountId): Promise { return (await this.helper.callRpc('api.rpc.unique.accountTokens', [collectionId, addressObj])).toJSON(); } + /** + * Get token data + * @param collectionId ID of collection + * @param tokenId ID of token + * @param blockHashAt + * @param propertyKeys TODO + * @example getToken(10, 5); + * @returns human readable token data + */ async getToken(collectionId: number, tokenId: number, blockHashAt?: string, propertyKeys?: string[]): Promise<{ properties: IProperty[]; owner: ICrossAccountId; @@ -979,6 +1102,17 @@ class NFTnRFT extends CollectionGroup { return tokenData; } + /** + * Set permissions to change token properties + * @param signer keyring of signer + * @param collectionId ID of collection + * @param permissions permissions to change a property by the collection owner or admin + * @param label + * @example setTokenPropertyPermissions( + * aliceKeyring, 10, [{key: "gender", permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}] + * ) + * @returns true if extrinsic success otherwise false + */ async setTokenPropertyPermissions(signer: TSigner, collectionId: number, permissions: ITokenPropertyPermission[], label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; const result = await this.helper.executeExtrinsic( @@ -990,6 +1124,16 @@ class NFTnRFT extends CollectionGroup { return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'PropertyPermissionSet', label); } + /** + * Set token properties + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param properties + * @param label + * @example setTokenProperties(aliceKeyring, 10, 5, [{key: "gender", value: "female"}, {key: "age", value: "23"}]) + * @returns true if extrinsic success, otherwise false + */ async setTokenProperties(signer: TSigner, collectionId: number, tokenId: number, properties: IProperty[], label?: string): Promise { if(typeof label === 'undefined') label = `token #${tokenId} from collection #${collectionId}`; const result = await this.helper.executeExtrinsic( @@ -1001,6 +1145,16 @@ class NFTnRFT extends CollectionGroup { return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'TokenPropertySet', label); } + /** + * Delete the provided properties of a token + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param propertyKeys property keys to be deleted + * @param label + * @example deleteTokenProperties(aliceKeyring, 10, 5, ["gender", "age"]) + * @returns true if extrinsic success, otherwise false + */ async deleteTokenProperties(signer: TSigner, collectionId: number, tokenId: number, propertyKeys: string[], label?: string): Promise { if(typeof label === 'undefined') label = `token #${tokenId} from collection #${collectionId}`; const result = await this.helper.executeExtrinsic( @@ -1012,6 +1166,15 @@ class NFTnRFT extends CollectionGroup { return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'TokenPropertyDeleted', label); } + /** + * Mint new collection + * @param signer keyring of signer + * @param collectionOptions TODO + * @param mode NFT or RFT type of a collection + * @param errorLabel + * @example mintCollection(aliceKeyring, TODO, "NFT") + * @returns object of the created collection + */ async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, mode: 'NFT' | 'RFT', errorLabel = 'Unable to mint collection'): Promise { collectionOptions = JSON.parse(JSON.stringify(collectionOptions)) as ICollectionCreationOptions; // Clone object collectionOptions.mode = (mode === 'NFT') ? {nft: null} : {refungible: null}; @@ -1037,14 +1200,35 @@ class NFTnRFT extends CollectionGroup { class NFTGroup extends NFTnRFT { + /** + * Get collection object + * @param collectionId ID of collection + * @example getCollectionObject(2); + * @returns instance of UniqueNFTCollection + */ getCollectionObject(collectionId: number): UniqueNFTCollection { return new UniqueNFTCollection(collectionId, this.helper); } + /** + * Get token object + * @param collectionId ID of collection + * @param tokenId ID of token + * @example getTokenObject(10, 5); + * @returns instance of UniqueNFTToken + */ getTokenObject(collectionId: number, tokenId: number): UniqueNFTToken { return new UniqueNFTToken(tokenId, this.getCollectionObject(collectionId)); } + /** + * Get token's owner + * @param collectionId ID of collection + * @param tokenId ID of token + * @param blockHashAt + * @example getTokenOwner(10, 5); + * @returns Address in CrossAccountId format, e.g. {Substrate: "5DnSF6RRjwteE3BrCj..."} + */ async getTokenOwner(collectionId: number, tokenId: number, blockHashAt?: string): Promise { let owner; if (typeof blockHashAt === 'undefined') { @@ -1055,18 +1239,55 @@ class NFTGroup extends NFTnRFT { return crossAccountIdFromLower(owner.toJSON()); } + /** + * Is token approved to transfer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param toAccountObj TODO + * @returns TODO + */ async isTokenApproved(collectionId: number, tokenId: number, toAccountObj: ICrossAccountId): Promise { return (await this.getTokenApprovedPieces(collectionId, tokenId, toAccountObj, await this.getTokenOwner(collectionId, tokenId))) === 1n; } + /** + * Changes the owner of the token. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param addressObj address of a new owner + * @example transferToken(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}) + * @returns true if extrinsic success, otherwise false + */ async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId): Promise { return await super.transferToken(signer, collectionId, tokenId, addressObj, 1n); } + /** + * + * Change ownership of a NFT on behalf of the owner. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param fromAddressObj address on behalf of which the token will be sent + * @param toAddressObj new token owner + * @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, {Ethereum: "0x9F0583DbB85..."}) + * @returns true if extrinsic success, otherwise false + */ async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId): Promise { return await super.transferTokenFrom(signer, collectionId, tokenId, fromAddressObj, toAddressObj, 1n); } + /** + * Recursively find the address that owns the token + * @param collectionId ID of collection + * @param tokenId ID of token + * @param blockHashAt + * @example getTokenTopmostOwner(10, 5); + * @returns address in CrossAccountId format, e.g. {Substrate: "5DyN4Y92vZCjv38fg..."} + */ async getTokenTopmostOwner(collectionId: number, tokenId: number, blockHashAt?: string): Promise { let owner; if (typeof blockHashAt === 'undefined') { @@ -1082,6 +1303,14 @@ class NFTGroup extends NFTnRFT { return owner.Substrate ? {Substrate: this.helper.address.normalizeSubstrate(owner.Substrate)} : owner; } + /** + * Get tokens nested in the provided token + * @param collectionId ID of collection + * @param tokenId ID of token + * @param blockHashAt + * @example getTokenChildren(10, 5); + * @returns tokens whose depth of nesting is <= 5 + */ async getTokenChildren(collectionId: number, tokenId: number, blockHashAt?: string): Promise { let children; if(typeof blockHashAt === 'undefined') { @@ -1095,6 +1324,15 @@ class NFTGroup extends NFTnRFT { }); } + /** + * Nest one token into another + * @param signer keyring of signer + * @param tokenObj token to be nested + * @param rootTokenObj token to be parent + * @param label + * @example nestToken(aliceKeyring, {collectionId: 10, tokenId: 5}, {collectionId: 10, tokenId: 4}); + * @returns true if extrinsic success, otherwise false + */ async nestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, label='nest token'): Promise { const rootTokenAddress = {Ethereum: this.helper.util.getNestingTokenAddress(rootTokenObj.collectionId, rootTokenObj.tokenId)}; const result = await this.transferToken(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress); @@ -1104,6 +1342,16 @@ class NFTGroup extends NFTnRFT { return result; } + /** + * Remove token from nested state + * @param signer keyring of signer + * @param tokenObj token to unnest + * @param rootTokenObj parent of a token + * @param toAddressObj address of a new token owner + * @param label + * @example unnestToken(aliceKeyring, {collectionId: 10, tokenId: 5}, {collectionId: 10, tokenId: 4}, {Substrate: "5DyN4Y92vZCjv38fg..."}); + * @returns true if extrinsic success, otherwise false + */ async unnestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, toAddressObj: ICrossAccountId, label='unnest token'): Promise { const rootTokenAddress = {Ethereum: this.helper.util.getNestingTokenAddress(rootTokenObj.collectionId, rootTokenObj.tokenId)}; const result = await this.transferTokenFrom(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress, toAddressObj); @@ -1113,10 +1361,30 @@ class NFTGroup extends NFTnRFT { return result; } + /** + * Mint new collection + * @param signer keyring of signer + * @param collectionOptions Collection options + * @param label + * @example + * mintCollection(aliceKeyring, { + * name: 'New', + * description: 'New collection', + * tokenPrefix: 'NEW', + * }) + * @returns object of the created collection + */ async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, label = 'new collection'): Promise { return await super.mintCollection(signer, collectionOptions, 'NFT', `Unable to mint NFT collection for ${label}`) as UniqueNFTCollection; } + /** + * Mint new token + * @param signer keyring of signer + * @param data token data + * @param label + * @returns created token object + */ async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; properties?: IProperty[]; }, label?: string): Promise { if(typeof label === 'undefined') label = `collection #${data.collectionId}`; const creationResult = await this.helper.executeExtrinsic( @@ -1134,6 +1402,22 @@ class NFTGroup extends NFTnRFT { return this.getTokenObject(data.collectionId, createdTokens.tokens[0].tokenId); } + /** + * Mint multiple NFT tokens + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokens array of tokens with owner and properties + * @param label + * @example + * mintMultipleTokens(aliceKeyring, 10, [{ + * owner: {Substrate: "5DyN4Y92vZCjv38fg..."}, + * properties: [{key: "gender", value: "male"},{key: "age", value: "45"}], + * },{ + * owner: {Ethereum: "0x9F0583DbB855d..."}, + * properties: [{key: "gender", value: "female"},{key: "age", value: "22"}], + * }]); + * @returns true if extrinsic success, otherwise false + */ async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[], label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; const creationResult = await this.helper.executeExtrinsic( @@ -1145,6 +1429,25 @@ class NFTGroup extends NFTnRFT { return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); } + /** + * Mint multiple NFT tokens with one owner + * @param signer keyring of signer + * @param collectionId ID of collection + * @param owner tokens owner + * @param tokens array of tokens with owner and properties + * @param label + * @example + * mintMultipleTokensWithOneOwner(aliceKeyring, 10, "5DyN4Y92vZCjv38fg...", [{ + * properties: [{ + * key: "gender", + * value: "female", + * },{ + * key: "age", + * value: "33", + * }], + * }]); + * @returns array of newly created tokens + */ async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {properties?: IProperty[]}[], label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; const rawTokens = []; @@ -1161,10 +1464,30 @@ class NFTGroup extends NFTnRFT { return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); } + /** + * Destroys a concrete instance of NFT. + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param label + * @example burnToken(aliceKeyring, 10, 5); + * @returns ```true``` and burnt token number is extrinsic success. Otherwise ```false``` and ```null``` + */ async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number, label?: string): Promise<{ success: boolean; token: number | null; }> { return await super.burnToken(signer, collectionId, tokenId, label, 1n); } + /** + * Set, change, or remove approved address to transfer the ownership of the NFT. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param toAddressObj address to approve + * @param label + * @example approveToken(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}) + * @returns ```true``` if extrinsic success. Otherwise ```false``` + */ async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string) { return super.approveToken(signer, collectionId, tokenId, toAddressObj, label, 1n); } @@ -1172,34 +1495,104 @@ class NFTGroup extends NFTnRFT { class RFTGroup extends NFTnRFT { + /** + * Get collection object + * @param collectionId ID of collection + * @example getCollectionObject(2); + * @returns instance of UniqueNFTCollection + */ getCollectionObject(collectionId: number): UniqueRFTCollection { return new UniqueRFTCollection(collectionId, this.helper); } + /** + * Get token object + * @param collectionId ID of collection + * @param tokenId ID of token + * @example getTokenObject(10, 5); + * @returns instance of UniqueNFTToken + */ getTokenObject(collectionId: number, tokenId: number): UniqueRFTToken { return new UniqueRFTToken(tokenId, this.getCollectionObject(collectionId)); } + /** + * Get top 10 token owners with the largest number of pieces + * @param collectionId ID of collection + * @param tokenId ID of token + * @example getTokenTop10Owners(10, 5); + * @returns array of top 10 owners + */ async getTokenTop10Owners(collectionId: number, tokenId: number): Promise { return (await this.helper.callRpc('api.rpc.unique.tokenOwners', [collectionId, tokenId])).toJSON().map(crossAccountIdFromLower); } + /** + * Get number of pieces owned by address + * @param collectionId ID of collection + * @param tokenId ID of token + * @param addressObj address token owner + * @example getTokenBalance(10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}); + * @returns number of pieces ownerd by address + */ async getTokenBalance(collectionId: number, tokenId: number, addressObj: ICrossAccountId): Promise { return (await this.helper.callRpc('api.rpc.unique.balance', [collectionId, addressObj, tokenId])).toBigInt(); } + /** + * Transfer pieces of token to another address + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param addressObj address of a new owner + * @param amount number of pieces to be transfered + * @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, 2000n) + * @returns true if extrinsic success, otherwise false + */ async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId, amount=100n): Promise { return await super.transferToken(signer, collectionId, tokenId, addressObj, amount); } + /** + * Change ownership of some pieces of RFT on behalf of the owner. + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param fromAddressObj address on behalf of which the token will be sent + * @param toAddressObj new token owner + * @param amount number of pieces to be transfered + * @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, {Substrate: "5DfhbVfww7ThF8q6f3i..."}, 2000n) + * @returns true if extrinsic success, otherwise false + */ async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=100n): Promise { return await super.transferTokenFrom(signer, collectionId, tokenId, fromAddressObj, toAddressObj, amount); } + /** + * Mint new collection + * @param signer keyring of signer + * @param collectionOptions Collection options + * @param label + * @example + * mintCollection(aliceKeyring, { + * name: 'New', + * description: 'New collection', + * tokenPrefix: 'NEW', + * }) + * @returns object of the created collection + */ async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, label = 'new collection'): Promise { return await super.mintCollection(signer, collectionOptions, 'RFT', `Unable to mint RFT collection for ${label}`) as UniqueRFTCollection; } + /** + * Mint new token + * @param signer keyring of signer + * @param data token data + * @param label + * @example mintToken(aliceKeyring, {collectionId: 10, owner: {Substrate: '5GHoZe9c73RYbVzq...'}, pieces: 10000n}); + * @returns created token object + */ async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; pieces: bigint; properties?: IProperty[]; }, label?: string): Promise { if(typeof label === 'undefined') label = `collection #${data.collectionId}`; const creationResult = await this.helper.executeExtrinsic( @@ -1230,6 +1623,16 @@ class RFTGroup extends NFTnRFT { return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); } + /** + * Mint multiple RFT tokens with one owner + * @param signer keyring of signer + * @param collectionId ID of collection + * @param owner tokens owner + * @param tokens array of tokens with properties and pieces + * @param label + * @example mintMultipleTokensWithOneOwner(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, [{pieces: 100000n, properties: [{key: "gender", value: "male"}]}]); + * @returns array of newly created RFT tokens + */ async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {pieces: bigint, properties?: IProperty[]}[], label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; const rawTokens = []; @@ -1246,18 +1649,57 @@ class RFTGroup extends NFTnRFT { return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); } + /** + * Destroys a concrete instance of RFT. + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param label + * @param amount number of pieces to be burnt + * @example burnToken(aliceKeyring, 10, 5); + * @returns ```true``` and burnt token number is extrinsic success. Otherwise ```false``` and ```null``` + */ async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number, label?: string, amount=100n): Promise<{ success: boolean; token: number | null; }> { return await super.burnToken(signer, collectionId, tokenId, label, amount); } + /** + * Set, change, or remove approved address to transfer the ownership of the RFT. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param toAddressObj address to approve + * @param label + * @param amount number of pieces to be approved + * @example approveToken(aliceKeyring, 10, 5, {Substrate: "5GHoZe9c73RYbVzq..."}, "", 10000n); + * @returns true if the token success, otherwise false + */ async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string, amount=100n) { return super.approveToken(signer, collectionId, tokenId, toAddressObj, label, amount); } + /** + * Get total number of pieces + * @param collectionId ID of collection + * @param tokenId ID of token + * @example getTokenTotalPieces(10, 5); + * @returns number of pieces + */ async getTokenTotalPieces(collectionId: number, tokenId: number): Promise { return (await this.helper.callRpc('api.rpc.unique.totalPieces', [collectionId, tokenId])).unwrap().toBigInt(); } + /** + * Change number of token pieces. Signer must be the owner of all token pieces. + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param amount new number of pieces + * @param label + * @example repartitionToken(aliceKeyring, 10, 5, 12345n); + * @returns true if the repartion was success, otherwise false + */ async repartitionToken(signer: TSigner, collectionId: number, tokenId: number, amount: bigint, label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; const currentAmount = await this.getTokenTotalPieces(collectionId, tokenId); @@ -1273,10 +1715,30 @@ class RFTGroup extends NFTnRFT { class FTGroup extends CollectionGroup { + /** + * Get collection object + * @param collectionId ID of collection + * @example getCollectionObject(2); + * @returns instance of UniqueNFTCollection + */ getCollectionObject(collectionId: number): UniqueFTCollection { return new UniqueFTCollection(collectionId, this.helper); } + /** + * Mint new fungible collection + * @param signer keyring of signer + * @param collectionOptions Collection options + * @param decimalPoints number of token decimals + * @param errorLabel + * @example + * mintCollection(aliceKeyring, { + * name: 'New', + * description: 'New collection', + * tokenPrefix: 'NEW', + * }, 18) + * @returns newly created fungible collection + */ async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, decimalPoints = 0, errorLabel = 'Unable to mint collection'): Promise { collectionOptions = JSON.parse(JSON.stringify(collectionOptions)) as ICollectionCreationOptions; // Clone object if(collectionOptions.tokenPropertyPermissions) throw Error('Fungible collections has no tokenPropertyPermissions'); @@ -1292,6 +1754,16 @@ class FTGroup extends CollectionGroup { return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult, errorLabel)); } + /** + * Mint tokens + * @param signer keyring of signer + * @param collectionId ID of collection + * @param owner address owner of new tokens + * @param amount amount of tokens to be meanted + * @param label + * @example mintTokens(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq"}, 1000n); + * @returns ```true``` if extrinsic success. Otherwise ```false``` + */ async mintTokens(signer: TSigner, collectionId: number, owner: ICrossAccountId | string, amount: bigint, label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; const creationResult = await this.helper.executeExtrinsic( @@ -1306,6 +1778,26 @@ class FTGroup extends CollectionGroup { return this.helper.util.findCollectionInEvents(creationResult.result.events, collectionId, 'common', 'ItemCreated', label); } + /** + * Mint multiple RFT tokens with one owner + * @param signer keyring of signer + * @param collectionId ID of collection + * @param owner tokens owner + * @param tokens array of tokens with properties and pieces + * @param label + * @example mintMultipleTokensWithOneOwner(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, [{pieces: 100000n, properties: [{key: "gender", value: "male"}]}]); + * @returns array of newly created RFT tokens + */ + + /** + * Mint multiple Fungible tokens with one owner TODO For what?? + * @param signer keyring of signer + * @param collectionId ID of collection + * @param owner tokens owner + * @param tokens array of tokens with properties and pieces + * @param label + * @returns + */ async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {value: bigint}[], label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; const rawTokens = []; @@ -1321,38 +1813,112 @@ class FTGroup extends CollectionGroup { return this.helper.util.findCollectionInEvents(creationResult.result.events, collectionId, 'common', 'ItemCreated', label); } + /** + * Get top 10 token owners + * @param collectionId ID of collection + * @example getTop10Owners(10); + * @returns array of ```ICrossAccountId``` + */ async getTop10Owners(collectionId: number): Promise { return (await this.helper.callRpc('api.rpc.unique.tokenOwners', [collectionId, 0])).toJSON().map(crossAccountIdFromLower); } + /** + * Get account balance + * @param collectionId ID of collection + * @param addressObj address of owner + * @example getBalance(10, {Substrate: "5GHoZe9c73RYbVzq..."}) + * @returns amount of fungible tokens owned by address + */ async getBalance(collectionId: number, addressObj: ICrossAccountId): Promise { return (await this.helper.callRpc('api.rpc.unique.balance', [collectionId, addressObj, 0])).toBigInt(); } + /** + * Transfer tokens to address + * @param signer keyring of signer + * @param collectionId ID of collection + * @param toAddressObj address recepient + * @param amount amount of tokens to be sent + * @example transfer(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n); + * @returns ```true``` if extrinsic success. Otherwise ```false``` + */ async transfer(signer: TSigner, collectionId: number, toAddressObj: ICrossAccountId, amount: bigint) { return await super.transferToken(signer, collectionId, 0, toAddressObj, amount); } + /** + * Transfer some tokens on behalf of the owner. + * @param signer keyring of signer + * @param collectionId ID of collection + * @param fromAddressObj address on behalf of which tokens will be sent + * @param toAddressObj address where token to be sent + * @param amount number of tokens to be sent + * @example transferFrom(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, {Substrate: "5DfhbVfww7ThF8q6f3ij..."}, 10000n); + * @returns ```true``` if extrinsic success. Otherwise ```false``` + */ async transferFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount: bigint) { return await super.transferTokenFrom(signer, collectionId, 0, fromAddressObj, toAddressObj, amount); } + /** + * Destroy some amount of tokens + * @param signer keyring of signer + * @param collectionId ID of collection + * @param amount amount of tokens to be destroyed + * @param label + * @example burnTokens(aliceKeyring, 10, 1000n); + * @returns ```true``` if extrinsic success. Otherwise ```false``` + */ async burnTokens(signer: IKeyringPair, collectionId: number, amount=100n, label?: string): Promise { return (await super.burnToken(signer, collectionId, 0, label, amount)).success; } + /** + * Burn some tokens on behalf of the owner. + * @param signer keyring of signer + * @param collectionId ID of collection + * @param fromAddressObj address on behalf of which tokens will be burnt + * @param amount amount of tokens to be burnt + * @param label + * @example burnTokensFrom(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n); + * @returns ```true``` if extrinsic success. Otherwise ```false``` + */ async burnTokensFrom(signer: IKeyringPair, collectionId: number, fromAddressObj: ICrossAccountId, amount=100n, label?: string): Promise { return await super.burnTokenFrom(signer, collectionId, fromAddressObj, 0, label, amount); } + /** + * TODO for what? + * @param collectionId + * @returns + */ async getTotalPieces(collectionId: number): Promise { return (await this.helper.callRpc('api.rpc.unique.totalPieces', [collectionId, 0])).unwrap().toBigInt(); } + /** + * Set, change, or remove approved address to transfer tokens. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param toAddressObj address to be approved + * @param amount amount of tokens to be approved + * @param label + * @example approveTokens(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n) + * @returns ```true``` if extrinsic success. Otherwise ```false``` + */ async approveTokens(signer: IKeyringPair, collectionId: number, toAddressObj: ICrossAccountId, amount=100n, label?: string) { return super.approveToken(signer, collectionId, 0, toAddressObj, label, amount); } + /** + * TODO why pieces?? + * @param collectionId + * @param fromAddressObj + * @param toAddressObj + * @returns + */ async getApprovedTokens(collectionId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) { return super.getTokenApprovedPieces(collectionId, 0, toAddressObj, fromAddressObj); } @@ -1360,6 +1926,11 @@ class FTGroup extends CollectionGroup { class ChainGroup extends HelperGroup { + /** + * Get system properties of a chain + * @example getChainProperties(); + * @returns ss58Format, token decimals, and token symbol + */ getChainProperties(): IChainProperties { const properties = (this.helper.api as any).registry.getChainProperties().toJSON(); return { @@ -1369,16 +1940,33 @@ class ChainGroup extends HelperGroup { }; } + /** + * Get chain header + * @example getLatestBlockNumber(); + * @returns the number of the last block + */ async getLatestBlockNumber(): Promise { return (await this.helper.callRpc('api.rpc.chain.getHeader')).number.toNumber(); } + /** + * Get block hash by block number + * @param blockNumber number of block + * @example getBlockHashByNumber(12345); + * @returns hash of a block + */ async getBlockHashByNumber(blockNumber: number): Promise { const blockHash = (await this.helper.callRpc('api.rpc.chain.getBlockHash', [blockNumber])).toJSON(); if(blockHash === '0x0000000000000000000000000000000000000000000000000000000000000000') return null; return blockHash; } + /** + * Get account nonce + * @param address substrate address + * @example getNonce("5GrwvaEF5zXb26Fz..."); + * @returns number, account's nonce + */ async getNonce(address: TSubstrateAccount): Promise { return (await (this.helper.api as any).query.system.account(address)).nonce.toNumber(); } @@ -1391,14 +1979,34 @@ class BalanceGroup extends HelperGroup { return 10n ** BigInt((chainProperties.tokenDecimals || [18])[0]); } + /** + * Get substrate address balance + * @param address substrate address + * @example getSubstrate("5GrwvaEF5zXb26Fz...") + * @returns amount of tokens on address + */ async getSubstrate(address: TSubstrateAccount): Promise { return (await this.helper.callRpc('api.query.system.account', [address])).data.free.toBigInt(); } + /** + * Get ethereum address balance + * @param address ethereum address + * @example getEthereum("0x9F0583DbB855d...") + * @returns amount of tokens on address + */ async getEthereum(address: TEthereumAccount): Promise { return (await this.helper.callRpc('api.rpc.eth.getBalance', [address])).toBigInt(); } + /** + * Transfer tokens to substrate address + * @param signer keyring of signer + * @param address substrate address of a recepient + * @param amount amount of tokens to be transfered + * @example transferToSubstrate(aliceKeyring, "5GrwvaEF5zXb26Fz...", 100_000_000_000n); + * @returns true if extrinsic success, otherwise false + */ async transferToSubstrate(signer: TSigner, address: TSubstrateAccount, amount: bigint | string): Promise { const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.transfer', [address, amount], true, `Unable to transfer balance from ${this.helper.getSignerAddress(signer)} to ${address}`); @@ -1425,17 +2033,36 @@ class AddressGroup extends HelperGroup { return this.helper.util.normalizeSubstrateAddress(address, ss58Format); } + /** + * Get address in the connected chain format + * @param address substrate address + * @example normalizeSubstrateToChainFormat("5GrwvaEF5zXb26Fz...") // returns unjKJQJrRd238pkUZZ... for Unique Network + * @returns address in chain format + */ async normalizeSubstrateToChainFormat(address: TSubstrateAccount): Promise { const info = this.helper.chain.getChainProperties(); return encodeAddress(decodeAddress(address), info.ss58Format); } + /** + * Get substrate mirror of an ethereum address + * @param ethAddress ethereum address + * @param toChainFormat false for normalized account + * @example ethToSubstrate('0x9F0583DbB855d...') + * @returns substrate mirror of a provided ethereum address + */ async ethToSubstrate(ethAddress: TEthereumAccount, toChainFormat=false): Promise { if(!toChainFormat) return evmToAddress(ethAddress); const info = this.helper.chain.getChainProperties(); return evmToAddress(ethAddress, info.ss58Format); } + /** + * Get ethereum mirror of a substrate address + * @param subAddress substrate account + * @example substrateToEth("5DnSF6RRjwteE3BrC...") + * @returns ethereum mirror of a provided substrate address + */ substrateToEth(subAddress: TSubstrateAccount): TEthereumAccount { return nesting.toChecksumAddress('0x' + Array.from(addressToEvm(subAddress), i => i.toString(16).padStart(2, '0')).join('')); } From c2a11471a3b7a7065ee2817134628750f088dd01 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Tue, 9 Aug 2022 09:56:03 +0500 Subject: [PATCH 0239/1274] fix documents TODOs --- tests/src/util/playgrounds/unique.ts | 101 +++++++++++++-------------- 1 file changed, 50 insertions(+), 51 deletions(-) diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 165fb60ba3..d8ac7df528 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -666,7 +666,7 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param label extra label for log * @example await helper.collection.burn(aliceKeyring, 3); - * @returns bool true on success + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async burn(signer: TSigner, collectionId: number, label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -687,7 +687,7 @@ class CollectionGroup extends HelperGroup { * @param sponsorAddress Sponsor substrate address * @param label extra label for log * @example setSponsor(aliceKeyring, 10, "5DyN4Y92vZCjv38fg...") - * @returns bool true on success + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async setSponsor(signer: TSigner, collectionId: number, sponsorAddress: TSubstrateAccount, label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -707,7 +707,7 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param label extra label for log * @example confirmSponsorship(aliceKeyring, 10) - * @returns bool true on success + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async confirmSponsorship(signer: TSigner, collectionId: number, label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -736,7 +736,7 @@ class CollectionGroup extends HelperGroup { * ownerCanDestroy: false * } * ) - * @returns bool true on success + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async setLimits(signer: TSigner, collectionId: number, limits: ICollectionLimits, label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -757,7 +757,7 @@ class CollectionGroup extends HelperGroup { * @param ownerAddress substrate address of new owner * @param label extra label for log * @example changeOwner(aliceKeyring, 10, "5DyN4Y92vZCjv38fg...") - * @returns bool true on success + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async changeOwner(signer: TSigner, collectionId: number, ownerAddress: TSubstrateAccount, label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -778,7 +778,7 @@ class CollectionGroup extends HelperGroup { * @param adminAddressObj Administrator address (substrate or ethereum) * @param label extra label for log * @example addAdmin(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."}) - * @returns bool true on success + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async addAdmin(signer: TSigner, collectionId: number, adminAddressObj: ICrossAccountId, label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -799,7 +799,7 @@ class CollectionGroup extends HelperGroup { * @param adminAddressObj Administrator address (substrate or ethereum) * @param label extra label for log * @example removeAdmin(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."}) - * @returns bool true on success + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async removeAdmin(signer: TSigner, collectionId: number, adminAddressObj: ICrossAccountId, label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -819,8 +819,8 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param permissions collection permissions object * @param label extra label for log - * @example setPermissions(aliceKeyring, 10, TODO); - * @returns bool true on success + * @example setPermissions(aliceKeyring, 10, {access:'AllowList', mintMode: true, nesting: {collectionAdmin: true, tokenOwner: true}}); + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async setPermissions(signer: TSigner, collectionId: number, permissions: ICollectionPermissions, label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -840,8 +840,8 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param permissions nesting permissions object * @param label extra label for log - * @example enableNesting(aliceKeyring, 10, TODO); - * @returns bool true on success + * @example enableNesting(aliceKeyring, 10, {collectionAdmin: true, tokenOwner: true}); + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async enableNesting(signer: TSigner, collectionId: number, permissions: INestingPermissions, label?: string): Promise { return await this.setPermissions(signer, collectionId, {nesting: permissions}, label); @@ -854,7 +854,7 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param label extra label for log * @example disableNesting(aliceKeyring, 10); - * @returns bool true on success + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async disableNesting(signer: TSigner, collectionId: number, label?: string): Promise { return await this.setPermissions(signer, collectionId, {nesting: {tokenOwner: false, collectionAdmin: false}}, label); @@ -867,9 +867,8 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param properties array of property objects * @param label extra label for log - * @example - * setProperties(aliceKeyring, 10, TODO) - * @returns bool true on success + * @example setProperties(aliceKeyring, 10, [{key: "gender", value: "male"}]); + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async setProperties(signer: TSigner, collectionId: number, properties: IProperty[], label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -889,8 +888,8 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param propertyKeys array of property keys to delete * @param label - * @example deleteProperties(aliceKeyring, 10, TODO) - * @returns + * @example deleteProperties(aliceKeyring, 10, ["gender", "age"]); + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async deleteProperties(signer: TSigner, collectionId: number, propertyKeys: string[], label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -983,7 +982,7 @@ class CollectionGroup extends HelperGroup { * @param label * @param amount amount of tokens to be burned. For NFT must be set to 1n * @example burnTokenFrom(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."}, 5, {Ethereum: "0x9F0583DbB85..."}) - * @returns ```true``` if extrinsic success. Otherwise ```false``` + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async burnTokenFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, tokenId: number, label?: string, amount=1n): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -1005,7 +1004,7 @@ class CollectionGroup extends HelperGroup { * @param toAddressObj * @param label * @param amount amount of token to be approved. For NFT must be set to 1n - * @returns ```true``` if extrinsic success. Otherwise ```false``` + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string, amount=1n) { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -1019,7 +1018,7 @@ class CollectionGroup extends HelperGroup { } /** - * TODO + * Get amount of RFT pieces approved to transfer * @param collectionId ID of collection * @param tokenId ID of token * @param toAccountObj @@ -1060,7 +1059,7 @@ class NFTnRFT extends CollectionGroup { * @param collectionId ID of collection * @param addressObj tokens owner * @example getTokensByAddress(10, {Substrate: "5DyN4Y92vZCjv38fg..."}) - * @returns array of token ids owned by account TODO for RFT? + * @returns array of token ids owned by account */ async getTokensByAddress(collectionId: number, addressObj: ICrossAccountId): Promise { return (await this.helper.callRpc('api.rpc.unique.accountTokens', [collectionId, addressObj])).toJSON(); @@ -1071,7 +1070,7 @@ class NFTnRFT extends CollectionGroup { * @param collectionId ID of collection * @param tokenId ID of token * @param blockHashAt - * @param propertyKeys TODO + * @param propertyKeys * @example getToken(10, 5); * @returns human readable token data */ @@ -1132,7 +1131,7 @@ class NFTnRFT extends CollectionGroup { * @param properties * @param label * @example setTokenProperties(aliceKeyring, 10, 5, [{key: "gender", value: "female"}, {key: "age", value: "23"}]) - * @returns true if extrinsic success, otherwise false + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async setTokenProperties(signer: TSigner, collectionId: number, tokenId: number, properties: IProperty[], label?: string): Promise { if(typeof label === 'undefined') label = `token #${tokenId} from collection #${collectionId}`; @@ -1153,7 +1152,7 @@ class NFTnRFT extends CollectionGroup { * @param propertyKeys property keys to be deleted * @param label * @example deleteTokenProperties(aliceKeyring, 10, 5, ["gender", "age"]) - * @returns true if extrinsic success, otherwise false + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async deleteTokenProperties(signer: TSigner, collectionId: number, tokenId: number, propertyKeys: string[], label?: string): Promise { if(typeof label === 'undefined') label = `token #${tokenId} from collection #${collectionId}`; @@ -1169,10 +1168,10 @@ class NFTnRFT extends CollectionGroup { /** * Mint new collection * @param signer keyring of signer - * @param collectionOptions TODO + * @param collectionOptions basic collection options and properties * @param mode NFT or RFT type of a collection * @param errorLabel - * @example mintCollection(aliceKeyring, TODO, "NFT") + * @example mintCollection(aliceKeyring, {name: 'New', description: "New collection", tokenPrefix: "NEW"}, "NFT") * @returns object of the created collection */ async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, mode: 'NFT' | 'RFT', errorLabel = 'Unable to mint collection'): Promise { @@ -1243,8 +1242,8 @@ class NFTGroup extends NFTnRFT { * Is token approved to transfer * @param collectionId ID of collection * @param tokenId ID of token - * @param toAccountObj TODO - * @returns TODO + * @param toAccountObj address to be approved + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async isTokenApproved(collectionId: number, tokenId: number, toAccountObj: ICrossAccountId): Promise { return (await this.getTokenApprovedPieces(collectionId, tokenId, toAccountObj, await this.getTokenOwner(collectionId, tokenId))) === 1n; @@ -1258,7 +1257,7 @@ class NFTGroup extends NFTnRFT { * @param tokenId ID of token * @param addressObj address of a new owner * @example transferToken(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}) - * @returns true if extrinsic success, otherwise false + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId): Promise { return await super.transferToken(signer, collectionId, tokenId, addressObj, 1n); @@ -1274,7 +1273,7 @@ class NFTGroup extends NFTnRFT { * @param fromAddressObj address on behalf of which the token will be sent * @param toAddressObj new token owner * @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, {Ethereum: "0x9F0583DbB85..."}) - * @returns true if extrinsic success, otherwise false + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId): Promise { return await super.transferTokenFrom(signer, collectionId, tokenId, fromAddressObj, toAddressObj, 1n); @@ -1331,7 +1330,7 @@ class NFTGroup extends NFTnRFT { * @param rootTokenObj token to be parent * @param label * @example nestToken(aliceKeyring, {collectionId: 10, tokenId: 5}, {collectionId: 10, tokenId: 4}); - * @returns true if extrinsic success, otherwise false + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async nestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, label='nest token'): Promise { const rootTokenAddress = {Ethereum: this.helper.util.getNestingTokenAddress(rootTokenObj.collectionId, rootTokenObj.tokenId)}; @@ -1350,7 +1349,7 @@ class NFTGroup extends NFTnRFT { * @param toAddressObj address of a new token owner * @param label * @example unnestToken(aliceKeyring, {collectionId: 10, tokenId: 5}, {collectionId: 10, tokenId: 4}, {Substrate: "5DyN4Y92vZCjv38fg..."}); - * @returns true if extrinsic success, otherwise false + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async unnestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, toAddressObj: ICrossAccountId, label='unnest token'): Promise { const rootTokenAddress = {Ethereum: this.helper.util.getNestingTokenAddress(rootTokenObj.collectionId, rootTokenObj.tokenId)}; @@ -1416,7 +1415,7 @@ class NFTGroup extends NFTnRFT { * owner: {Ethereum: "0x9F0583DbB855d..."}, * properties: [{key: "gender", value: "female"},{key: "age", value: "22"}], * }]); - * @returns true if extrinsic success, otherwise false + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[], label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -1486,7 +1485,7 @@ class NFTGroup extends NFTnRFT { * @param toAddressObj address to approve * @param label * @example approveToken(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}) - * @returns ```true``` if extrinsic success. Otherwise ```false``` + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string) { return super.approveToken(signer, collectionId, tokenId, toAddressObj, label, 1n); @@ -1547,7 +1546,7 @@ class RFTGroup extends NFTnRFT { * @param addressObj address of a new owner * @param amount number of pieces to be transfered * @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, 2000n) - * @returns true if extrinsic success, otherwise false + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId, amount=100n): Promise { return await super.transferToken(signer, collectionId, tokenId, addressObj, amount); @@ -1562,7 +1561,7 @@ class RFTGroup extends NFTnRFT { * @param toAddressObj new token owner * @param amount number of pieces to be transfered * @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, {Substrate: "5DfhbVfww7ThF8q6f3i..."}, 2000n) - * @returns true if extrinsic success, otherwise false + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=100n): Promise { return await super.transferTokenFrom(signer, collectionId, tokenId, fromAddressObj, toAddressObj, amount); @@ -1762,7 +1761,7 @@ class FTGroup extends CollectionGroup { * @param amount amount of tokens to be meanted * @param label * @example mintTokens(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq"}, 1000n); - * @returns ```true``` if extrinsic success. Otherwise ```false``` + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async mintTokens(signer: TSigner, collectionId: number, owner: ICrossAccountId | string, amount: bigint, label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -1790,13 +1789,13 @@ class FTGroup extends CollectionGroup { */ /** - * Mint multiple Fungible tokens with one owner TODO For what?? + * Mint multiple Fungible tokens with one owner * @param signer keyring of signer * @param collectionId ID of collection * @param owner tokens owner * @param tokens array of tokens with properties and pieces * @param label - * @returns + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {value: bigint}[], label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -1841,7 +1840,7 @@ class FTGroup extends CollectionGroup { * @param toAddressObj address recepient * @param amount amount of tokens to be sent * @example transfer(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n); - * @returns ```true``` if extrinsic success. Otherwise ```false``` + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async transfer(signer: TSigner, collectionId: number, toAddressObj: ICrossAccountId, amount: bigint) { return await super.transferToken(signer, collectionId, 0, toAddressObj, amount); @@ -1855,7 +1854,7 @@ class FTGroup extends CollectionGroup { * @param toAddressObj address where token to be sent * @param amount number of tokens to be sent * @example transferFrom(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, {Substrate: "5DfhbVfww7ThF8q6f3ij..."}, 10000n); - * @returns ```true``` if extrinsic success. Otherwise ```false``` + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async transferFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount: bigint) { return await super.transferTokenFrom(signer, collectionId, 0, fromAddressObj, toAddressObj, amount); @@ -1868,7 +1867,7 @@ class FTGroup extends CollectionGroup { * @param amount amount of tokens to be destroyed * @param label * @example burnTokens(aliceKeyring, 10, 1000n); - * @returns ```true``` if extrinsic success. Otherwise ```false``` + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async burnTokens(signer: IKeyringPair, collectionId: number, amount=100n, label?: string): Promise { return (await super.burnToken(signer, collectionId, 0, label, amount)).success; @@ -1882,14 +1881,14 @@ class FTGroup extends CollectionGroup { * @param amount amount of tokens to be burnt * @param label * @example burnTokensFrom(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n); - * @returns ```true``` if extrinsic success. Otherwise ```false``` + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async burnTokensFrom(signer: IKeyringPair, collectionId: number, fromAddressObj: ICrossAccountId, amount=100n, label?: string): Promise { return await super.burnTokenFrom(signer, collectionId, fromAddressObj, 0, label, amount); } /** - * TODO for what? + * * @param collectionId * @returns */ @@ -1906,18 +1905,18 @@ class FTGroup extends CollectionGroup { * @param amount amount of tokens to be approved * @param label * @example approveTokens(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n) - * @returns ```true``` if extrinsic success. Otherwise ```false``` + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async approveTokens(signer: IKeyringPair, collectionId: number, toAddressObj: ICrossAccountId, amount=100n, label?: string) { return super.approveToken(signer, collectionId, 0, toAddressObj, label, amount); } /** - * TODO why pieces?? - * @param collectionId - * @param fromAddressObj - * @param toAddressObj - * @returns + * Get amount of fungible tokens approved to transfer + * @param collectionId ID of collection + * @param fromAddressObj owner of tokens + * @param toAddressObj the address approved for the transfer of tokens on behalf of the owner + * @returns number of tokens approved for the transfer */ async getApprovedTokens(collectionId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) { return super.getTokenApprovedPieces(collectionId, 0, toAddressObj, fromAddressObj); @@ -2005,7 +2004,7 @@ class BalanceGroup extends HelperGroup { * @param address substrate address of a recepient * @param amount amount of tokens to be transfered * @example transferToSubstrate(aliceKeyring, "5GrwvaEF5zXb26Fz...", 100_000_000_000n); - * @returns true if extrinsic success, otherwise false + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async transferToSubstrate(signer: TSigner, address: TSubstrateAccount, amount: bigint | string): Promise { const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.transfer', [address, amount], true, `Unable to transfer balance from ${this.helper.getSignerAddress(signer)} to ${address}`); From 18fdfc15a81a7648a65785be6bc7a080e94aa80e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 09:13:18 +0300 Subject: [PATCH 0240/1274] Workflow renamed, wipeout excplicit ARG definitions --- .docker/Dockerfile-parachain-upgrade | 4 ++-- .docker/launch-config.json | 4 +--- .github/workflows/forkless-update-nodata.yml | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index 2005e80706..80eab382bb 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -2,7 +2,7 @@ FROM ubuntu:20.04 as rust-builder LABEL maintainer="Unique.Network" -ARG RUST_TOOLCHAIN=nightly-2022-05-11 +ARG RUST_TOOLCHAIN= ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN ENV CARGO_HOME="/cargo-home" @@ -57,7 +57,7 @@ RUN cargo build $FEATURE --$PROFILE # ===== BUILD POLKADOT ===== FROM rust-builder as builder-polkadot -ARG POLKADOT_BUILD_BRANCH=release-v0.9.24 +ARG POLKADOT_BUILD_BRANCH= ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH RUN mkdir /unique_parachain diff --git a/.docker/launch-config.json b/.docker/launch-config.json index e9db0632d1..eed275808c 100644 --- a/.docker/launch-config.json +++ b/.docker/launch-config.json @@ -1,8 +1,6 @@ { "relaychain": { - "bin": "../alts/polkadot/target/release/polkadot", - "upgradeBin": "../polkadot/target/release/polkadot", - "upgradeWasm": "../polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm", + "bin": "../polkadot/target/release/polkadot", "chain": "westend-local", "nodes": [ { diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index c9c573899b..f44d812517 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -1,4 +1,4 @@ -name: Develop - Build & test +name: Forkless Parachain update with no data # Controls when the action will run. on: From 8fa8d9d5ce6e70148a95c1fdf8b9344b5b27101f Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 09:17:29 +0300 Subject: [PATCH 0241/1274] Escaped variables in matrix definition. --- .github/workflows/forkless-update-nodata.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index f44d812517..9cc7538b28 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -1,4 +1,4 @@ -name: Forkless Parachain update with no data +name: Forkless Parachain update with no data # Controls when the action will run. on: @@ -42,12 +42,12 @@ jobs: # binary_version: - network: "Quartz" # KUSAMA_MAINNET_BRANCH для quartz-runtime features: "--features=quartz-runtime" - mainnet_branch: ${{ env.KUSAMA_MAINNET_BRANCH }} - mainnet_tag: ${{ env.QUARTZ_MAINNET_TAG }} + mainnet_branch: "${{ env.KUSAMA_MAINNET_BRANCH }}" + mainnet_tag: "${{ env.QUARTZ_MAINNET_TAG }}" - network: "Unique" # POLKADOT_MAINNET_BRANCH для unique-runtime features: "--features=unique-runtime" - mainnet_branch: ${{ env.POLKADOT_MAINNET_BRANCH }} - mainnet_tag: ${{ env.UNIQUE_MAINNET_TAG }} + mainnet_branch: "${{ env.POLKADOT_MAINNET_BRANCH }}" + mainnet_tag: "${{ env.UNIQUE_MAINNET_TAG }}" From 5d2c90ad24467a634eb866d928553b7c6452f725 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 09:34:02 +0300 Subject: [PATCH 0242/1274] dded square brackets for variables --- .github/workflows/forkless-update-nodata.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 9cc7538b28..87e6ed562e 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -42,12 +42,12 @@ jobs: # binary_version: - network: "Quartz" # KUSAMA_MAINNET_BRANCH для quartz-runtime features: "--features=quartz-runtime" - mainnet_branch: "${{ env.KUSAMA_MAINNET_BRANCH }}" - mainnet_tag: "${{ env.QUARTZ_MAINNET_TAG }}" + mainnet_branch: [${{ env.KUSAMA_MAINNET_BRANCH }}] + mainnet_tag: [${{ env.QUARTZ_MAINNET_TAG }}] - network: "Unique" # POLKADOT_MAINNET_BRANCH для unique-runtime features: "--features=unique-runtime" - mainnet_branch: "${{ env.POLKADOT_MAINNET_BRANCH }}" - mainnet_tag: "${{ env.UNIQUE_MAINNET_TAG }}" + mainnet_branch: [${{ env.POLKADOT_MAINNET_BRANCH }}] + mainnet_tag: [${{ env.UNIQUE_MAINNET_TAG }}] From 26dac9dbd8a3608308ae4473717c79dc99cbb14e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 09:42:33 +0300 Subject: [PATCH 0243/1274] Varable substitution has been replaced by excplicitly defined values --- .github/workflows/forkless-update-nodata.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 87e6ed562e..aebc49cb2c 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -42,12 +42,12 @@ jobs: # binary_version: - network: "Quartz" # KUSAMA_MAINNET_BRANCH для quartz-runtime features: "--features=quartz-runtime" - mainnet_branch: [${{ env.KUSAMA_MAINNET_BRANCH }}] - mainnet_tag: [${{ env.QUARTZ_MAINNET_TAG }}] + mainnet_branch: release-v0.9.26 + mainnet_tag: v924012 - network: "Unique" # POLKADOT_MAINNET_BRANCH для unique-runtime features: "--features=unique-runtime" - mainnet_branch: [${{ env.POLKADOT_MAINNET_BRANCH }}] - mainnet_tag: [${{ env.UNIQUE_MAINNET_TAG }}] + mainnet_branch: release-v0.9.25 + mainnet_tag: v924010 From 1ac9fd6106b64e767cb3370abb77a73bfa343d6d Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 09:50:59 +0300 Subject: [PATCH 0244/1274] env. replaced by matrix. --- .github/workflows/forkless-update-nodata.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index aebc49cb2c..5c9e9ad599 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -85,8 +85,8 @@ jobs: RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }} - MAINNET_TAG=${{ env.mainnet_tag }} - MAINNET_BRANCH=${{ env.mainnet_branch }} + MAINNET_TAG=${{ matrix.mainnet_tag }} + MAINNET_BRANCH=${{ matrix.mainnet_branch }} FEATURE=${{ matrix.features }} BRANCH=${{ github.head_ref }} From 267b004f6058908e8afdb0e1f5bb5de346fefc63 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 10:39:00 +0300 Subject: [PATCH 0245/1274] FIX: Name of temporary docker image. --- .docker/Dockerfile-parachain-upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index 80eab382bb..e0f6b7e381 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -92,7 +92,7 @@ COPY --from=builder-unique-current /unique_parachain/target/release/unique-colla COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=builder-unique /.docker/launch-config.json /polkadot-launch/launch-config.json +COPY --from=builder-unique-current /.docker/launch-config.json /polkadot-launch/launch-config.json CMD export NVM_DIR="$HOME/.nvm" && \ From 0d279a15763e0e59d60dd7013b647e2153dd26e6 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 10:41:07 +0300 Subject: [PATCH 0246/1274] Temporary enable running tests ub a DRAFT mode --- .github/workflows/forkless-update-nodata.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 5c9e9ad599..be9dc012f6 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -52,7 +52,7 @@ jobs: steps: - - name: Skip if pull request is in Draft +# - name: Skip if pull request is in Draft # `if: github.event.pull_request.draft == true` should be kept here, at # the step level, rather than at the job level. The latter is not # recommended because when the PR is moved from "Draft" to "Ready to @@ -67,8 +67,8 @@ jobs: # 4. Move it to "Ready for review"; now the workflow is passing (it was # skipped) and "Check reviews" is also passing (it won't be updated # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 +# if: github.event.pull_request.draft == true +# run: exit 1 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 From 3789326a7cf7df8fe769549adcb67284dbc16bd1 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 10:50:15 +0300 Subject: [PATCH 0247/1274] Added timezone configuration(UTC) --- .docker/Dockerfile-parachain-upgrade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index e0f6b7e381..0d4f813989 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -7,6 +7,8 @@ ARG RUST_TOOLCHAIN= ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN ENV CARGO_HOME="/cargo-home" ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none @@ -72,7 +74,6 @@ RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/ FROM ubuntu:20.04 RUN apt-get -y update && \ - apt-get -y upgrade && \ apt-get -y install curl git && \ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ export NVM_DIR="$HOME/.nvm" && \ From e0fb1d340def15757e77a9fe34e06e14d66d3b50 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 11:00:12 +0300 Subject: [PATCH 0248/1274] FIX: Added curl installation. --- .docker/Dockerfile-parachain-upgrade | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index 0d4f813989..097b10cec5 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -10,13 +10,13 @@ ENV PATH="/cargo-home/bin:$PATH" ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - RUN apt-get update && \ - apt-get install -y cmake pkg-config libssl-dev git clang && \ + apt-get install -y cmake curl pkg-config libssl-dev git clang && \ apt-get clean && \ rm -r /var/lib/apt/lists/* +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup toolchain install $RUST_TOOLCHAIN && \ rustup default $RUST_TOOLCHAIN && \ @@ -25,8 +25,8 @@ RUN rustup toolchain uninstall $(rustup toolchain list) && \ RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN -RUN mkdir /unique_parachain -WORKDIR /unique_parachain +#RUN mkdir /unique_parachain +#WORKDIR /unique_parachain # ===== BUILD current version ====== FROM rust-builder as builder-unique-current From eec79200160e00ab79cb57fe4faab1187aaa3b92 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 11:06:43 +0300 Subject: [PATCH 0249/1274] Added build arg into Dockerfile --- .docker/Dockerfile-parachain-upgrade | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index 097b10cec5..e9a2c97aa5 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -33,10 +33,12 @@ FROM rust-builder as builder-unique-current ARG PROFILE=release ARG FEATURE= +ARG BRANCH= RUN mkdir /unique_parachain WORKDIR /unique_parachain +RUN echo "$BRANCH" && echo "$REPO_URL" RUN git clone $REPO_URL -b $BRANCH RUN cargo build $FEATURE --$PROFILE @@ -51,6 +53,7 @@ ARG MAINNET_BRANCH= RUN mkdir /unique_parachain WORKDIR /unique_parachain +RUN echo "$MAINNET_BRANCH" && echo "$REPO_URL" RUN git clone $REPO_URL -b $MAINNET_BRANCH RUN cargo build $FEATURE --$PROFILE From 02103120d101646aa1d47811bb725e70f4d59c27 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Tue, 9 Aug 2022 13:12:13 +0500 Subject: [PATCH 0250/1274] fix eslint errors and warnings in tests --- tests/src/fungible.test.ts | 22 +++++++++++----------- tests/src/refungible.test.ts | 16 ++++++++-------- tests/src/removeCollectionAdmin.test.ts | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/src/fungible.test.ts b/tests/src/fungible.test.ts index d117469731..13bd850017 100644 --- a/tests/src/fungible.test.ts +++ b/tests/src/fungible.test.ts @@ -15,9 +15,9 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import { U128_MAX } from './util/helpers'; +import {U128_MAX} from './util/helpers'; -import { usingPlaygrounds } from './util/playgrounds'; +import {usingPlaygrounds} from './util/playgrounds'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; @@ -37,16 +37,16 @@ describe('integration test: Fungible functionality:', () => { it('Create fungible collection and token', async () => { await usingPlaygrounds(async helper => { - const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'trest'}); - const defaultTokenId = await collection.getLastTokenId(); - expect(defaultTokenId).to.be.equal(0); + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'trest'}); + const defaultTokenId = await collection.getLastTokenId(); + expect(defaultTokenId).to.be.equal(0); - await collection.mint(alice, {Substrate: alice.address}, U128_MAX); - const aliceBalance = await collection.getBalance({Substrate: alice.address}); - const itemCountAfter = await collection.getLastTokenId(); + await collection.mint(alice, {Substrate: alice.address}, U128_MAX); + const aliceBalance = await collection.getBalance({Substrate: alice.address}); + const itemCountAfter = await collection.getLastTokenId(); - expect(itemCountAfter).to.be.equal(defaultTokenId); - expect(aliceBalance).to.be.equal(U128_MAX); + expect(itemCountAfter).to.be.equal(defaultTokenId); + expect(aliceBalance).to.be.equal(U128_MAX); }); }); @@ -103,7 +103,7 @@ describe('integration test: Fungible functionality:', () => { await collection.mintWithOneOwner(alice, {Substrate: alice.address}, [ {value: 500n}, {value: 400n}, - {value: 300n} + {value: 300n}, ]); expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(1200n); diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 3aca5424b5..ed8bae3a4a 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -16,7 +16,7 @@ import {IKeyringPair} from '@polkadot/types/types'; -import { usingPlaygrounds } from './util/playgrounds'; +import {usingPlaygrounds} from './util/playgrounds'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; @@ -105,7 +105,7 @@ describe('integration test: Refungible functionality:', () => { await helper.rft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, [ {pieces: 1n}, {pieces: 2n}, - {pieces: 100n} + {pieces: 100n}, ]); const lastTokenId = await collection.getLastTokenId(); expect(lastTokenId).to.be.equal(3); @@ -223,9 +223,9 @@ describe('integration test: Refungible functionality:', () => { collection.collectionId.toString(), token.tokenId.toString(), {Substrate: alice.address}, - '100' - ] - }]) + '100', + ], + }]); }); }); @@ -243,9 +243,9 @@ describe('integration test: Refungible functionality:', () => { collection.collectionId.toString(), token.tokenId.toString(), {Substrate: alice.address}, - '50' - ] - }]) + '50', + ], + }]); }); }); }); diff --git a/tests/src/removeCollectionAdmin.test.ts b/tests/src/removeCollectionAdmin.test.ts index 5d0eb85d85..6841434400 100644 --- a/tests/src/removeCollectionAdmin.test.ts +++ b/tests/src/removeCollectionAdmin.test.ts @@ -16,7 +16,7 @@ import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import { usingPlaygrounds } from './util/playgrounds'; +import {usingPlaygrounds} from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; From 7fec977043c401e4aa979adc8115fc64702a373c Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 11:30:22 +0300 Subject: [PATCH 0251/1274] FIX: Mentioned destination directory for git clone --- .docker/Dockerfile-parachain-upgrade | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index e9a2c97aa5..9a7e7cf9a8 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -34,12 +34,12 @@ FROM rust-builder as builder-unique-current ARG PROFILE=release ARG FEATURE= ARG BRANCH= +ARG REPO_URL= RUN mkdir /unique_parachain WORKDIR /unique_parachain -RUN echo "$BRANCH" && echo "$REPO_URL" -RUN git clone $REPO_URL -b $BRANCH +RUN git clone $REPO_URL -b $BRANCH . RUN cargo build $FEATURE --$PROFILE @@ -49,12 +49,13 @@ FROM rust-builder as builder-unique-target ARG PROFILE=release ARG FEATURE= ARG MAINNET_BRANCH= +ARG REPO_URL= RUN mkdir /unique_parachain WORKDIR /unique_parachain RUN echo "$MAINNET_BRANCH" && echo "$REPO_URL" -RUN git clone $REPO_URL -b $MAINNET_BRANCH +RUN git clone $REPO_URL -b $MAINNET_BRANCH . RUN cargo build $FEATURE --$PROFILE From bf656b07fdbb9704941c9f80ed5ccd7c1b4903a8 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 9 Aug 2022 08:53:10 +0000 Subject: [PATCH 0252/1274] Merge duplicated changelogs into one file --- pallets/common/CHANGELOG.MD | 14 -------------- pallets/common/CHANGELOG.md | 11 +++++++++++ 2 files changed, 11 insertions(+), 14 deletions(-) delete mode 100644 pallets/common/CHANGELOG.MD diff --git a/pallets/common/CHANGELOG.MD b/pallets/common/CHANGELOG.MD deleted file mode 100644 index 5235f6362e..0000000000 --- a/pallets/common/CHANGELOG.MD +++ /dev/null @@ -1,14 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. - -## [0.1.3] - 2022-07-25 -### Add -- Some static property keys and values. - -## [0.1.2] - 2022-07-20 - -### Fixed - -- Some methods in `#[solidity_interface]` for `CollectionHandle` had invalid - mutability modifiers, causing invalid stub/abi generation. diff --git a/pallets/common/CHANGELOG.md b/pallets/common/CHANGELOG.md index fed1457338..8662e22e61 100644 --- a/pallets/common/CHANGELOG.md +++ b/pallets/common/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. +## [0.1.3] - 2022-07-25 +### Add +- Some static property keys and values. + +## [0.1.2] - 2022-07-20 + +### Fixed + +- Some methods in `#[solidity_interface]` for `CollectionHandle` had invalid + mutability modifiers, causing invalid stub/abi generation. + ## [0.1.1] - 2022-07-14 ### Added From c3dc8ec92b3cfd27b8ca8d18db70b6872d3089bc Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 12:13:38 +0300 Subject: [PATCH 0253/1274] hanged unique mainnet release. --- .github/workflows/forkless-update-nodata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index be9dc012f6..c3d06766d0 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -46,7 +46,7 @@ jobs: mainnet_tag: v924012 - network: "Unique" # POLKADOT_MAINNET_BRANCH для unique-runtime features: "--features=unique-runtime" - mainnet_branch: release-v0.9.25 + mainnet_branch: v924010 mainnet_tag: v924010 From 552469882f04d98beaa8c8d1e0a531ea437a9adb Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 12:39:19 +0300 Subject: [PATCH 0254/1274] Quartz mainnet branch has been changed. --- .github/workflows/forkless-update-nodata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index c3d06766d0..9ff8fd629d 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -42,7 +42,7 @@ jobs: # binary_version: - network: "Quartz" # KUSAMA_MAINNET_BRANCH для quartz-runtime features: "--features=quartz-runtime" - mainnet_branch: release-v0.9.26 + mainnet_branch: quartz-v924012-2 mainnet_tag: v924012 - network: "Unique" # POLKADOT_MAINNET_BRANCH для unique-runtime features: "--features=unique-runtime" From 42419f35e258a5adad0e2f397f688e5358b23026 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 13:03:34 +0300 Subject: [PATCH 0255/1274] Swapped branches beetween two stages of build --- .docker/Dockerfile-parachain-upgrade | 11 ++++++----- .docker/launch-config.json | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index 9a7e7cf9a8..b873dc6084 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -28,18 +28,20 @@ RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN #RUN mkdir /unique_parachain #WORKDIR /unique_parachain + # ===== BUILD current version ====== FROM rust-builder as builder-unique-current ARG PROFILE=release ARG FEATURE= -ARG BRANCH= +ARG MAINNET_BRANCH= ARG REPO_URL= RUN mkdir /unique_parachain WORKDIR /unique_parachain -RUN git clone $REPO_URL -b $BRANCH . +RUN echo "$MAINNET_BRANCH" && echo "$REPO_URL" +RUN git clone $REPO_URL -b $MAINNET_BRANCH . RUN cargo build $FEATURE --$PROFILE @@ -48,14 +50,13 @@ FROM rust-builder as builder-unique-target ARG PROFILE=release ARG FEATURE= -ARG MAINNET_BRANCH= +ARG BRANCH= ARG REPO_URL= RUN mkdir /unique_parachain WORKDIR /unique_parachain -RUN echo "$MAINNET_BRANCH" && echo "$REPO_URL" -RUN git clone $REPO_URL -b $MAINNET_BRANCH . +RUN git clone $REPO_URL -b $BRANCH . RUN cargo build $FEATURE --$PROFILE diff --git a/.docker/launch-config.json b/.docker/launch-config.json index eed275808c..e0bf122dc4 100644 --- a/.docker/launch-config.json +++ b/.docker/launch-config.json @@ -84,8 +84,8 @@ }, "parachains": [ { - "bin": "../unique-chain/current/release/unique-collator", - "upgradeBin": "../unique-chain/target/release/unique-collator", + "bin": "../unique-chain/current/release/unique-collator", #Mainnet TAG + "upgradeBin": "../unique-chain/target/release/unique-collator", # version in PR develop to master "upgradeWasm": "../unique-chain/target/release/wbuild/opal-runtime/opal_runtime.compact.compressed.wasm", "id": "1000", "balance": "1000000000000000000000000", From 9418fc90c2c3eda868711e36b95c912d2298829b Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 13:48:09 +0300 Subject: [PATCH 0256/1274] FIX: Path to launch-config.json --- .docker/Dockerfile-parachain-upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index b873dc6084..7c8e4422f4 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -98,7 +98,7 @@ COPY --from=builder-unique-current /unique_parachain/target/release/unique-colla COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=builder-unique-current /.docker/launch-config.json /polkadot-launch/launch-config.json +COPY --from=builder-unique-current /unique_parachain/.docker/launch-config.json /polkadot-launch/launch-config.json CMD export NVM_DIR="$HOME/.nvm" && \ From f91998ca2e79ce2ddee233c7e751a1874082c7a8 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 14:04:13 +0300 Subject: [PATCH 0257/1274] Temporary removed .docker from .dockerignore --- .dockerignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 84fb7b39ab..e1d1cd10e1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,5 @@ .git/ .github/ -.docker/ doc/ target/ tests/ From b315a45e58ad92719ec2bb8d2ecabc54a724e844 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 14:18:31 +0300 Subject: [PATCH 0258/1274] Added lanch-config-forkless.json into repo root. --- .docker/Dockerfile-parachain-upgrade | 4 +- launch-config-forkless.json | 123 +++++++++++++++++++++++++++ 2 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 launch-config-forkless.json diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index 7c8e4422f4..e1669be422 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -44,6 +44,8 @@ RUN echo "$MAINNET_BRANCH" && echo "$REPO_URL" RUN git clone $REPO_URL -b $MAINNET_BRANCH . RUN cargo build $FEATURE --$PROFILE +COPY /unique_parachain/.docker/launch-config.json /polkadot-launch/launch-config.json + # ===== BUILD target version ====== FROM rust-builder as builder-unique-target @@ -98,7 +100,7 @@ COPY --from=builder-unique-current /unique_parachain/target/release/unique-colla COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=builder-unique-current /unique_parachain/.docker/launch-config.json /polkadot-launch/launch-config.json +COPY --from=builder-unique-current /unique_parachain/launch-config-forkless.json /polkadot-launch/launch-config.json CMD export NVM_DIR="$HOME/.nvm" && \ diff --git a/launch-config-forkless.json b/launch-config-forkless.json new file mode 100644 index 0000000000..e0bf122dc4 --- /dev/null +++ b/launch-config-forkless.json @@ -0,0 +1,123 @@ +{ + "relaychain": { + "bin": "../polkadot/target/release/polkadot", + "chain": "westend-local", + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "../unique-chain/current/release/unique-collator", #Mainnet TAG + "upgradeBin": "../unique-chain/target/release/unique-collator", # version in PR develop to master + "upgradeWasm": "../unique-chain/target/release/wbuild/opal-runtime/opal_runtime.compact.compressed.wasm", + "id": "1000", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace" + ] + }, + { + "port": 31201, + "wsPort": 9945, + "rpcPort": 9934, + "name": "bob", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [], + "finalization": false +} From 86c90691b4dd79d163b1ef521cfe80f159d1cbdb Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 14:28:33 +0300 Subject: [PATCH 0259/1274] Changed name ond path to launch-config --- .docker/Dockerfile-parachain-upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index e1669be422..597890ac1d 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -44,7 +44,7 @@ RUN echo "$MAINNET_BRANCH" && echo "$REPO_URL" RUN git clone $REPO_URL -b $MAINNET_BRANCH . RUN cargo build $FEATURE --$PROFILE -COPY /unique_parachain/.docker/launch-config.json /polkadot-launch/launch-config.json +COPY /unique_parachain/launch-config-forkless.json /polkadot-launch/launch-config.json # ===== BUILD target version ====== From 5fb6f2354f2d9bef1ba2c4108065b00135ce352e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 9 Aug 2022 14:32:51 +0300 Subject: [PATCH 0260/1274] Copy lanch-config-forkless.json has been moved to another step of build. --- .docker/Dockerfile-parachain-upgrade | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index 597890ac1d..4ad243a6b6 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -44,8 +44,6 @@ RUN echo "$MAINNET_BRANCH" && echo "$REPO_URL" RUN git clone $REPO_URL -b $MAINNET_BRANCH . RUN cargo build $FEATURE --$PROFILE -COPY /unique_parachain/launch-config-forkless.json /polkadot-launch/launch-config.json - # ===== BUILD target version ====== FROM rust-builder as builder-unique-target @@ -61,6 +59,7 @@ WORKDIR /unique_parachain RUN git clone $REPO_URL -b $BRANCH . RUN cargo build $FEATURE --$PROFILE +COPY /unique_parachain/launch-config-forkless.json /polkadot-launch/launch-config.json # ===== BUILD POLKADOT ===== @@ -100,7 +99,7 @@ COPY --from=builder-unique-current /unique_parachain/target/release/unique-colla COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=builder-unique-current /unique_parachain/launch-config-forkless.json /polkadot-launch/launch-config.json +COPY --from=builder-unique-target /unique_parachain/launch-config-forkless.json /polkadot-launch/launch-config.json CMD export NVM_DIR="$HOME/.nvm" && \ From 405963f1d11ce11ffdf179cc7b1b2aa333ea31b7 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 10 Aug 2022 00:36:29 +0300 Subject: [PATCH 0261/1274] Fixing state by the end if day. --- .docker/Dockerfile-parachain-upgrade | 14 +-- .docker/docker-compose-forkless.yaml | 2 + .docker/launch-config.j2 | 40 ++++++ .docker/launch-config.json | 123 ------------------- .env | 12 +- .github/workflows/forkless-update-nodata.yml | 42 +++++-- 6 files changed, 83 insertions(+), 150 deletions(-) create mode 100644 .docker/launch-config.j2 delete mode 100644 .docker/launch-config.json diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index 4ad243a6b6..b8c0ee774a 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -11,7 +11,7 @@ ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ - apt-get install -y cmake curl pkg-config libssl-dev git clang && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang && \ apt-get clean && \ rm -r /var/lib/apt/lists/* @@ -40,9 +40,8 @@ ARG REPO_URL= RUN mkdir /unique_parachain WORKDIR /unique_parachain -RUN echo "$MAINNET_BRANCH" && echo "$REPO_URL" RUN git clone $REPO_URL -b $MAINNET_BRANCH . -RUN cargo build $FEATURE --$PROFILE +RUN cargo build --features=$FEATURE --$PROFILE # ===== BUILD target version ====== @@ -57,9 +56,7 @@ RUN mkdir /unique_parachain WORKDIR /unique_parachain RUN git clone $REPO_URL -b $BRANCH . -RUN cargo build $FEATURE --$PROFILE - -COPY /unique_parachain/launch-config-forkless.json /polkadot-launch/launch-config.json +RUN cargo build --features=$FEATURE --$PROFILE # ===== BUILD POLKADOT ===== @@ -99,10 +96,7 @@ COPY --from=builder-unique-current /unique_parachain/target/release/unique-colla COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=builder-unique-target /unique_parachain/launch-config-forkless.json /polkadot-launch/launch-config.json - - CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ - yarn start launch-config.json --test-upgrade + yarn start launch-config.json diff --git a/.docker/docker-compose-forkless.yaml b/.docker/docker-compose-forkless.yaml index e91b49e249..446b69e109 100644 --- a/.docker/docker-compose-forkless.yaml +++ b/.docker/docker-compose-forkless.yaml @@ -7,6 +7,8 @@ services: dockerfile: .docker/Dockerfile-parachain-upgrade image: node-parachain container_name: node-parachain + volumes: + - .docker/launch-config-forkless.json:/polkadot-launch/launch-config.json expose: - 9944 - 9933 diff --git a/.docker/launch-config.j2 b/.docker/launch-config.j2 new file mode 100644 index 0000000000..41e58db511 --- /dev/null +++ b/.docker/launch-config.j2 @@ -0,0 +1,40 @@ +{ + "parachains": [ + { + "bin": "../unique-chain/current/release/unique-collator", + "upgradeBin": "../unique-chain/target/release/unique-collator", + "upgradeWasm": "../unique-chain/target/release/wbuild/{{ FEATURE }}/{{ RUNTIME }}_runtime.compact.compressed.wasm", + "id": "1000", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace" + ] + }, + { + "port": 31201, + "wsPort": 9945, + "rpcPort": 9934, + "name": "bob", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [], + "finalization": false +} diff --git a/.docker/launch-config.json b/.docker/launch-config.json deleted file mode 100644 index e0bf122dc4..0000000000 --- a/.docker/launch-config.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "relaychain": { - "bin": "../polkadot/target/release/polkadot", - "chain": "westend-local", - "nodes": [ - { - "name": "alice", - "wsPort": 9844, - "rpcPort": 9843, - "port": 30444, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "bob", - "wsPort": 9855, - "rpcPort": 9854, - "port": 30555, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "charlie", - "wsPort": 9866, - "rpcPort": 9865, - "port": 30666, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "dave", - "wsPort": 9877, - "rpcPort": 9876, - "port": 30777, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "eve", - "wsPort": 9888, - "rpcPort": 9887, - "port": 30888, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - } - ], - "genesis": { - "runtime": { - "runtime_genesis_config": { - "parachainsConfiguration": { - "config": { - "validation_upgrade_frequency": 1, - "validation_upgrade_delay": 1 - } - } - } - } - } - }, - "parachains": [ - { - "bin": "../unique-chain/current/release/unique-collator", #Mainnet TAG - "upgradeBin": "../unique-chain/target/release/unique-collator", # version in PR develop to master - "upgradeWasm": "../unique-chain/target/release/wbuild/opal-runtime/opal_runtime.compact.compressed.wasm", - "id": "1000", - "balance": "1000000000000000000000000", - "nodes": [ - { - "port": 31200, - "wsPort": 9944, - "rpcPort": 9933, - "name": "alice", - "flags": [ - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external", - "-lxcm=trace" - ] - }, - { - "port": 31201, - "wsPort": 9945, - "rpcPort": 9934, - "name": "bob", - "flags": [ - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external", - "-lxcm=trace" - ] - } - ] - } - ], - "simpleParachains": [], - "hrmpChannels": [], - "finalization": false -} diff --git a/.env b/.env index b988f9e491..5c6a03a0df 100644 --- a/.env +++ b/.env @@ -1,6 +1,8 @@ RUST_TOOLCHAIN=nightly-2022-05-11 -RUST_C=1.62.0-nightly -POLKA_VERSION=release-v0.9.24 -UNIQUE_BRANCH=develop -USER=*** -PASS=*** +POLKADOT_BUILD_BRANCH=release-v0.9.24 + +POLKADOT_MAINNET_BRANCH=release-v0.9.25 +UNIQUE_MAINNET_TAG=v924010 + +KUSAMA_MAINNET_BRANCH=release-v0.9.26 +QUARTZ_MAINNET_TAG=v924012 \ No newline at end of file diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 9ff8fd629d..a67f15a5dd 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -16,13 +16,7 @@ on: #Define Workflow variables env: - RUST_TOOLCHAIN: nightly-2022-05-11 REPO_URL: ${{ github.server_url }}/${{ github.repository }} - POLKADOT_BUILD_BRANCH: release-v0.9.24 - POLKADOT_MAINNET_BRANCH: release-v0.9.25 # for unique-runtime - UNIQUE_MAINNET_TAG: v924010 - KUSAMA_MAINNET_BRANCH: release-v0.9.26 # for для quartz-runtime - QUARTZ_MAINNET_TAG: v924012 # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -41,11 +35,13 @@ jobs: # features: "--features=opal-runtime" # binary_version: - network: "Quartz" # KUSAMA_MAINNET_BRANCH для quartz-runtime - features: "--features=quartz-runtime" + features: "quartz-runtime" + runtime: "quartz" mainnet_branch: quartz-v924012-2 mainnet_tag: v924012 - network: "Unique" # POLKADOT_MAINNET_BRANCH для unique-runtime - features: "--features=unique-runtime" + features: "unique-runtime" + runtime: "unique" mainnet_branch: v924010 mainnet_tag: v924010 @@ -70,11 +66,17 @@ jobs: # if: github.event.pull_request.draft == true # run: exit 1 + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 with: ref: ${{ github.head_ref }} #Checking out head commit + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 with: @@ -93,8 +95,24 @@ jobs: - name: Show build configuration run: cat .docker/docker-compose.${{ matrix.network }}.yml + - name: Generate launch-config.json + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/launch-config.j2 + output_file: .docker/launch-config-forkless.json + variables: | + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + + - name: Show launch-config-forkless configuration + run: cat .docker/launch-config-forkless.json + + - name: Show files in directory + run: ls -la + + - name: Build the stack - run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build + run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --remove-orphans # - name: Test Report @@ -110,6 +128,6 @@ jobs: # run: | # echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}" - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down +# - name: Stop running containers +# if: always() # run this step always +# run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From 9961e3b96312a01366ef9986b8a0fe9427ae7e8c Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 10 Aug 2022 08:27:57 +0300 Subject: [PATCH 0262/1274] File has been deleted due to it have to be generated each workflow run --- launch-config-forkless.json | 123 ------------------------------------ 1 file changed, 123 deletions(-) delete mode 100644 launch-config-forkless.json diff --git a/launch-config-forkless.json b/launch-config-forkless.json deleted file mode 100644 index e0bf122dc4..0000000000 --- a/launch-config-forkless.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "relaychain": { - "bin": "../polkadot/target/release/polkadot", - "chain": "westend-local", - "nodes": [ - { - "name": "alice", - "wsPort": 9844, - "rpcPort": 9843, - "port": 30444, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "bob", - "wsPort": 9855, - "rpcPort": 9854, - "port": 30555, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "charlie", - "wsPort": 9866, - "rpcPort": 9865, - "port": 30666, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "dave", - "wsPort": 9877, - "rpcPort": 9876, - "port": 30777, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "eve", - "wsPort": 9888, - "rpcPort": 9887, - "port": 30888, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - } - ], - "genesis": { - "runtime": { - "runtime_genesis_config": { - "parachainsConfiguration": { - "config": { - "validation_upgrade_frequency": 1, - "validation_upgrade_delay": 1 - } - } - } - } - } - }, - "parachains": [ - { - "bin": "../unique-chain/current/release/unique-collator", #Mainnet TAG - "upgradeBin": "../unique-chain/target/release/unique-collator", # version in PR develop to master - "upgradeWasm": "../unique-chain/target/release/wbuild/opal-runtime/opal_runtime.compact.compressed.wasm", - "id": "1000", - "balance": "1000000000000000000000000", - "nodes": [ - { - "port": 31200, - "wsPort": 9944, - "rpcPort": 9933, - "name": "alice", - "flags": [ - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external", - "-lxcm=trace" - ] - }, - { - "port": 31201, - "wsPort": 9945, - "rpcPort": 9934, - "name": "bob", - "flags": [ - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external", - "-lxcm=trace" - ] - } - ] - } - ], - "simpleParachains": [], - "hrmpChannels": [], - "finalization": false -} From afc5a29e93991562f78e69fdb2214e9d9f668910 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 10 Aug 2022 11:28:06 +0300 Subject: [PATCH 0263/1274] Re-created branch --- .docker/Dockerfile-chain-dev | 3 +- .docker/Dockerfile-parachain | 19 ++-- .docker/docker-compose-master.yaml | 19 ++++ .docker/docker-compose.tmp-master.j2 | 11 +++ .docker/docker-compose.tmp.j2 | 4 +- .github/workflows/build-test-master.yml | 121 ++++++++++++++++++++++++ .github/workflows/node_build_test.yml | 13 ++- 7 files changed, 174 insertions(+), 16 deletions(-) create mode 100644 .docker/docker-compose-master.yaml create mode 100644 .docker/docker-compose.tmp-master.j2 create mode 100644 .github/workflows/build-test-master.yml diff --git a/.docker/Dockerfile-chain-dev b/.docker/Dockerfile-chain-dev index 06a50729f8..6cc17def15 100644 --- a/.docker/Dockerfile-chain-dev +++ b/.docker/Dockerfile-chain-dev @@ -10,8 +10,7 @@ ENV PATH="/cargo-home/bin:$PATH" RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none -ARG RUST_TOOLCHAIN=nightly-2022-05-11 -ARG POLKA_VERSION=release-v0.9.24 +ARG RUST_TOOLCHAIN= ARG BRANCH= ARG REPO_URL= ARG FEATURE= diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index ae67e2fa53..53564a9248 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -2,19 +2,20 @@ FROM ubuntu:20.04 as rust-builder LABEL maintainer="Unique.Network" -ARG RUST_TOOLCHAIN=nightly-2022-05-11 +ARG RUST_TOOLCHAIN= ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN ENV CARGO_HOME="/cargo-home" ENV PATH="/cargo-home/bin:$PATH" -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none RUN apt-get update && \ - apt-get install -y cmake pkg-config libssl-dev git clang && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang && \ apt-get clean && \ rm -r /var/lib/apt/lists/* +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup toolchain install $RUST_TOOLCHAIN && \ rustup default $RUST_TOOLCHAIN && \ @@ -22,15 +23,17 @@ RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup show RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN - RUN mkdir /unique_parachain WORKDIR /unique_parachain + # ===== BUILD ====== FROM rust-builder as builder-unique ARG PROFILE=release ARG FEATURE= +ARG REPO_URL= +ARG BRANCH= RUN mkdir /unique_parachain WORKDIR /unique_parachain @@ -38,16 +41,17 @@ WORKDIR /unique_parachain RUN git clone $REPO_URL -b $BRANCH RUN cargo build $FEATURE --$PROFILE + # ===== BUILD POLKADOT ===== FROM rust-builder as builder-polkadot -ARG POLKA_VERSION=release-v0.9.24 -ENV POLKA_VERSION $POLKA_VERSION +ARG POLKADOT_BUILD_BRANCH= +ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH RUN mkdir /unique_parachain WORKDIR /unique_parachain -RUN git clone -b $POLKA_VERSION --depth 1 https://github.com/paritytech/polkadot.git && \ +RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ cd polkadot && \ cargo build --release @@ -56,7 +60,6 @@ RUN git clone -b $POLKA_VERSION --depth 1 https://github.com/paritytech/polkadot FROM ubuntu:20.04 RUN apt-get -y update && \ - apt-get -y upgrade && \ apt-get -y install curl git && \ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ export NVM_DIR="$HOME/.nvm" && \ diff --git a/.docker/docker-compose-master.yaml b/.docker/docker-compose-master.yaml new file mode 100644 index 0000000000..13acfa1b60 --- /dev/null +++ b/.docker/docker-compose-master.yaml @@ -0,0 +1,19 @@ +version: "3.5" + +services: + blockchain_nodes: + build: + context: ../ + dockerfile: .docker/Dockerfile-parachain + image: blockchain_nodes + container_name: blockchain_nodes + expose: + - 9944 + - 9933 + ports: + - 127.0.0.1:9944:9944 + - 127.0.0.1:9933:9933 + logging: + options: + max-size: "1m" + max-file: "3" diff --git a/.docker/docker-compose.tmp-master.j2 b/.docker/docker-compose.tmp-master.j2 new file mode 100644 index 0000000000..79fa55b184 --- /dev/null +++ b/.docker/docker-compose.tmp-master.j2 @@ -0,0 +1,11 @@ +version: "3.5" + +services: + blockchain_nodes: + build: + args: + - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" + - "BRANCH={{ BRANCH }}" + - "REPO_URL={{ REPO_URL }}" + - "FEATURE={{ FEATURE }}" + - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" diff --git a/.docker/docker-compose.tmp.j2 b/.docker/docker-compose.tmp.j2 index 17f877c9fd..35264e4870 100644 --- a/.docker/docker-compose.tmp.j2 +++ b/.docker/docker-compose.tmp.j2 @@ -8,6 +8,6 @@ services: - "BRANCH={{ BRANCH }}" - "REPO_URL={{ REPO_URL }}" - "FEATURE={{ FEATURE }}" - - "POLKA_VERSION={{ POLKA_VERSION }}" + - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - command: cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external + command: cargo run --release {{ FEATURE }} -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml new file mode 100644 index 0000000000..35c096b044 --- /dev/null +++ b/.github/workflows/build-test-master.yml @@ -0,0 +1,121 @@ +name: MASTER - Build & Test + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: + - master + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +#Define Workflow variables +env: + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + build: + # The type of runner that the job will run on + runs-on: self-hosted-ci + + + name: Build Container, Spin it Up an test + + continue-on-error: true #Do not stop testing of matrix runs failed. + + strategy: + matrix: + include: + - network: "Opal" + features: "--features=opal-runtime" + - network: "Quartz" + features: "--features=quartz-runtime" + - network: "Unique" + features: "--features=unique-runtime" + + steps: + - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-master.j2 + output_file: .docker/docker-compose.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + FEATURE=${{ matrix.features }} + BRANCH=${{ github.head_ref }} + + - name: Show build configuration + run: cat .docker/docker-compose.${{ matrix.network }}.yml + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-master.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Run tests + run: | + cd tests + yarn install + yarn add mochawesome + echo "Ready to start tests" + node scripts/readyness.js + NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Test Report + uses: phoenix-actions/test-reporting@v8 + if: success() || failure() # run this step even if previous step failed + with: + name: Tests ${{ matrix.network }} # Name of the check run which will be created + path: tests/mochawesome-report/test-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' + + - name: Read output variables + run: | + echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}" + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-master.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 95ba9cace0..8f5ed34efc 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -16,9 +16,8 @@ on: #Define Workflow variables env: - RUST_TOOLCHAIN: nightly-2022-05-11 REPO_URL: ${{ github.server_url }}/${{ github.repository }} - POLKA_VERSION: release-v0.9.24 + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -59,11 +58,17 @@ jobs: if: github.event.pull_request.draft == true run: exit 1 + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 with: ref: ${{ github.head_ref }} #Checking out head commit + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 with: @@ -72,8 +77,8 @@ jobs: variables: | REPO_URL=${{ github.server_url }}/${{ github.repository }}.git RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKA_VERSION=${{ env.POLKA_VERSION }} - FEATURE='${{ matrix.features }}' + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + FEATURE=${{ matrix.features }} BRANCH=${{ github.head_ref }} - name: Show build configuration From 3784fb49189c5fbbc2cdb0abb85ed851df13bb5e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 10 Aug 2022 12:01:12 +0300 Subject: [PATCH 0264/1274] Feature opal-runtime is default feature. --- .github/workflows/build-test-master.yml | 2 +- .github/workflows/node_build_test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml index 35c096b044..dd2ae3ef19 100644 --- a/.github/workflows/build-test-master.yml +++ b/.github/workflows/build-test-master.yml @@ -34,7 +34,7 @@ jobs: matrix: include: - network: "Opal" - features: "--features=opal-runtime" + features: " " - network: "Quartz" features: "--features=quartz-runtime" - network: "Unique" diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 8f5ed34efc..992980d16e 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -33,7 +33,7 @@ jobs: matrix: include: - network: "Opal" - features: "--features=opal-runtime" + features: " " - network: "Quartz" features: "--features=quartz-runtime" - network: "Unique" From 5403a31c4f6d26be2bedc5bb039ca030089d1fa4 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 10 Aug 2022 12:48:57 +0300 Subject: [PATCH 0265/1274] Added id: test-report into step related to test reports upload. --- .github/workflows/build-test-master.yml | 1 + .github/workflows/node_build_test.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml index dd2ae3ef19..6520dbaacc 100644 --- a/.github/workflows/build-test-master.yml +++ b/.github/workflows/build-test-master.yml @@ -105,6 +105,7 @@ jobs: - name: Test Report uses: phoenix-actions/test-reporting@v8 + id: test-report if: success() || failure() # run this step even if previous step failed with: name: Tests ${{ matrix.network }} # Name of the check run which will be created diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 992980d16e..9c435616e4 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -104,6 +104,7 @@ jobs: - name: Test Report uses: phoenix-actions/test-reporting@v8 + id: test-report if: success() || failure() # run this step even if previous step failed with: name: Tests ${{ matrix.network }} # Name of the check run which will be created From 7a2dbeac9ec6646b42d606fe3f34b2bc475031b7 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Mon, 1 Aug 2022 16:53:32 +0700 Subject: [PATCH 0266/1274] fix: disbaled pallets Rmrk, RFT, Scheduler for Quartz RFT, Scheduler for Unique Added the logic of checking the availability of pallets necessary for their execution in tests --- runtime/common/Cargo.toml | 2 + runtime/common/src/dispatch.rs | 5 + runtime/common/src/weights.rs | 95 +++++ runtime/quartz/src/lib.rs | 331 ++++++++++-------- runtime/unique/src/lib.rs | 208 +++++------ tests/src/refungible.test.ts | 22 +- tests/src/rmrk/acceptNft.test.ts | 11 +- tests/src/rmrk/addResource.test.ts | 4 +- tests/src/rmrk/addTheme.test.ts | 6 +- tests/src/rmrk/burnNft.test.ts | 5 +- tests/src/rmrk/changeCollectionIssuer.test.ts | 6 +- tests/src/rmrk/createBase.test.ts | 6 +- tests/src/rmrk/createCollection.test.ts | 8 +- tests/src/rmrk/deleteCollection.test.ts | 4 +- tests/src/rmrk/equipNft.test.ts | 5 +- tests/src/rmrk/getOwnedNfts.test.ts | 8 +- tests/src/rmrk/lockCollection.test.ts | 4 +- tests/src/rmrk/mintNft.test.ts | 8 +- tests/src/rmrk/rejectNft.test.ts | 8 +- tests/src/rmrk/removeResource.test.ts | 4 +- tests/src/rmrk/rmrkIsolation.test.ts | 7 +- tests/src/rmrk/sendNft.test.ts | 6 +- tests/src/rmrk/setCollectionProperty.test.ts | 4 +- tests/src/rmrk/setEquippableList.test.ts | 6 +- tests/src/rmrk/setNftProperty.test.ts | 6 +- tests/src/rmrk/setResourcePriorities.test.ts | 6 +- tests/src/util/helpers.ts | 32 ++ 27 files changed, 540 insertions(+), 277 deletions(-) diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 2992413835..6acc1b5965 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -32,6 +32,8 @@ runtime-benchmarks = [ 'frame-support/runtime-benchmarks', 'frame-system/runtime-benchmarks', ] +unique-runtime = ['std'] +quartz-runtime = ['std'] [dependencies.sp-core] default-features = false diff --git a/runtime/common/src/dispatch.rs b/runtime/common/src/dispatch.rs index 5574d51b70..c241db6a1f 100644 --- a/runtime/common/src/dispatch.rs +++ b/runtime/common/src/dispatch.rs @@ -64,7 +64,12 @@ where ); >::init_collection(sender, data)? } + #[cfg(all(not(feature = "unique-runtime"), not(feature = "quartz-runtime")))] CollectionMode::ReFungible => >::init_collection(sender, data)?, + + CollectionMode::ReFungible => { + return Err(DispatchError::Other("Refunginle pallet is not supported")) + } }; Ok(id) } diff --git a/runtime/common/src/weights.rs b/runtime/common/src/weights.rs index f926c8d5ab..2e2127f5e1 100644 --- a/runtime/common/src/weights.rs +++ b/runtime/common/src/weights.rs @@ -25,6 +25,7 @@ use pallet_refungible::{ }; use up_data_structs::{CreateItemExData, CreateItemData}; +#[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] macro_rules! max_weight_of { ($method:ident ( $($args:tt)* )) => { >::$method($($args)*) @@ -33,9 +34,21 @@ macro_rules! max_weight_of { }; } +#[cfg(any(feature = "unique-runtime", feature = "quartz-runtime"))] +macro_rules! max_weight_of { + ($method:ident ( $($args:tt)* )) => { + >::$method($($args)*) + .max(>::$method($($args)*)) + + }; +} + +#[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] pub struct CommonWeights(PhantomData) where T: FungibleConfig + NonfungibleConfig + RefungibleConfig; + +#[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] impl CommonWeightInfo for CommonWeights where T: FungibleConfig + NonfungibleConfig + RefungibleConfig, @@ -101,6 +114,7 @@ where } } +#[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] impl RefungibleExtensionsWeightInfo for CommonWeights where T: FungibleConfig + NonfungibleConfig + RefungibleConfig, @@ -109,3 +123,84 @@ where dispatch_weight::() + <::WeightInfo>::repartition_item() } } + +#[cfg(any(feature = "unique-runtime", feature = "quartz-runtime"))] +pub struct CommonWeights(PhantomData) +where + T: FungibleConfig + NonfungibleConfig; + +#[cfg(any(feature = "unique-runtime", feature = "quartz-runtime"))] +impl CommonWeightInfo for CommonWeights +where + T: FungibleConfig + NonfungibleConfig, +{ + fn create_item() -> Weight { + dispatch_weight::() + max_weight_of!(create_item()) + } + + fn create_multiple_items(data: &[CreateItemData]) -> Weight { + dispatch_weight::() + max_weight_of!(create_multiple_items(data)) + } + + fn create_multiple_items_ex(data: &CreateItemExData) -> Weight { + dispatch_weight::() + max_weight_of!(create_multiple_items_ex(data)) + } + + fn burn_item() -> Weight { + dispatch_weight::() + max_weight_of!(burn_item()) + } + + fn set_collection_properties(amount: u32) -> Weight { + dispatch_weight::() + max_weight_of!(set_collection_properties(amount)) + } + + fn delete_collection_properties(amount: u32) -> Weight { + dispatch_weight::() + max_weight_of!(delete_collection_properties(amount)) + } + + fn set_token_properties(amount: u32) -> Weight { + dispatch_weight::() + max_weight_of!(set_token_properties(amount)) + } + + fn delete_token_properties(amount: u32) -> Weight { + dispatch_weight::() + max_weight_of!(delete_token_properties(amount)) + } + + fn set_token_property_permissions(amount: u32) -> Weight { + dispatch_weight::() + max_weight_of!(set_token_property_permissions(amount)) + } + + fn transfer() -> Weight { + dispatch_weight::() + max_weight_of!(transfer()) + } + + fn approve() -> Weight { + dispatch_weight::() + max_weight_of!(approve()) + } + + fn transfer_from() -> Weight { + dispatch_weight::() + max_weight_of!(transfer_from()) + } + + fn burn_from() -> Weight { + dispatch_weight::() + max_weight_of!(burn_from()) + } + + fn burn_recursively_self_raw() -> Weight { + max_weight_of!(burn_recursively_self_raw()) + } + + fn burn_recursively_breadth_raw(amount: u32) -> Weight { + max_weight_of!(burn_recursively_breadth_raw(amount)) + } +} + +#[cfg(any(feature = "unique-runtime", feature = "quartz-runtime"))] +impl RefungibleExtensionsWeightInfo for CommonWeights +where + T: FungibleConfig + NonfungibleConfig, +{ + fn repartition() -> Weight { + dispatch_weight::() + } +} diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index 3b1dfe8944..4cc350fc88 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -909,15 +909,15 @@ impl pallet_nonfungible::Config for Runtime { type WeightInfo = pallet_nonfungible::weights::SubstrateWeight; } -impl pallet_proxy_rmrk_core::Config for Runtime { - type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight; - type Event = Event; -} +// impl pallet_proxy_rmrk_core::Config for Runtime { +// type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight; +// type Event = Event; +// } -impl pallet_proxy_rmrk_equip::Config for Runtime { - type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight; - type Event = Event; -} +// impl pallet_proxy_rmrk_equip::Config for Runtime { +// type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight; +// type Event = Event; +// } impl pallet_unique::Config for Runtime { type Event = Event; @@ -961,92 +961,92 @@ fn get_signed_extras(from: ::AccountId) -> Sign ) } -pub struct SchedulerPaymentExecutor; -impl - DispatchCall for SchedulerPaymentExecutor -where - ::Call: Member - + Dispatchable - + SelfContainedCall - + GetDispatchInfo - + From>, - SelfContainedSignedInfo: Send + Sync + 'static, - Call: From<::Call> - + From<::Call> - + SelfContainedCall, - sp_runtime::AccountId32: From<::AccountId>, -{ - fn dispatch_call( - signer: ::AccountId, - call: ::Call, - ) -> Result< - Result>, - TransactionValidityError, - > { - let dispatch_info = call.get_dispatch_info(); - let extrinsic = fp_self_contained::CheckedExtrinsic::< - AccountId, - Call, - SignedExtraScheduler, - SelfContainedSignedInfo, - > { - signed: - CheckedSignature::::Signed( - signer.clone().into(), - get_signed_extras(signer.into()), - ), - function: call.into(), - }; - - extrinsic.apply::(&dispatch_info, 0) - } - - fn reserve_balance( - id: [u8; 16], - sponsor: ::AccountId, - call: ::Call, - count: u32, - ) -> Result<(), DispatchError> { - let dispatch_info = call.get_dispatch_info(); - let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0) - .saturating_mul(count.into()); - - >::reserve_named( - &id, - &(sponsor.into()), - weight.into(), - ) - } - - fn pay_for_call( - id: [u8; 16], - sponsor: ::AccountId, - call: ::Call, - ) -> Result { - let dispatch_info = call.get_dispatch_info(); - let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0); - Ok( - >::unreserve_named( - &id, - &(sponsor.into()), - weight.into(), - ), - ) - } - - fn cancel_reserve( - id: [u8; 16], - sponsor: ::AccountId, - ) -> Result { - Ok( - >::unreserve_named( - &id, - &(sponsor.into()), - u128::MAX, - ), - ) - } -} +// pub struct SchedulerPaymentExecutor; +// impl +// DispatchCall for SchedulerPaymentExecutor +// where +// ::Call: Member +// + Dispatchable +// + SelfContainedCall +// + GetDispatchInfo +// + From>, +// SelfContainedSignedInfo: Send + Sync + 'static, +// Call: From<::Call> +// + From<::Call> +// + SelfContainedCall, +// sp_runtime::AccountId32: From<::AccountId>, +// { +// fn dispatch_call( +// signer: ::AccountId, +// call: ::Call, +// ) -> Result< +// Result>, +// TransactionValidityError, +// > { +// let dispatch_info = call.get_dispatch_info(); +// let extrinsic = fp_self_contained::CheckedExtrinsic::< +// AccountId, +// Call, +// SignedExtraScheduler, +// SelfContainedSignedInfo, +// > { +// signed: +// CheckedSignature::::Signed( +// signer.clone().into(), +// get_signed_extras(signer.into()), +// ), +// function: call.into(), +// }; + +// extrinsic.apply::(&dispatch_info, 0) +// } + +// fn reserve_balance( +// id: [u8; 16], +// sponsor: ::AccountId, +// call: ::Call, +// count: u32, +// ) -> Result<(), DispatchError> { +// let dispatch_info = call.get_dispatch_info(); +// let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0) +// .saturating_mul(count.into()); + +// >::reserve_named( +// &id, +// &(sponsor.into()), +// weight.into(), +// ) +// } + +// fn pay_for_call( +// id: [u8; 16], +// sponsor: ::AccountId, +// call: ::Call, +// ) -> Result { +// let dispatch_info = call.get_dispatch_info(); +// let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0); +// Ok( +// >::unreserve_named( +// &id, +// &(sponsor.into()), +// weight.into(), +// ), +// ) +// } + +// fn cancel_reserve( +// id: [u8; 16], +// sponsor: ::AccountId, +// ) -> Result { +// Ok( +// >::unreserve_named( +// &id, +// &(sponsor.into()), +// u128::MAX, +// ), +// ) +// } +// } parameter_types! { pub const NoPreimagePostponement: Option = Some(10); @@ -1062,21 +1062,21 @@ impl PrivilegeCmp for OriginPrivilegeCmp { } } -impl pallet_unique_scheduler::Config for Runtime { - type Event = Event; - type Origin = Origin; - type Currency = Balances; - type PalletsOrigin = OriginCaller; - type Call = Call; - type MaximumWeight = MaximumSchedulerWeight; - type ScheduleOrigin = EnsureSigned; - type MaxScheduledPerBlock = MaxScheduledPerBlock; - type WeightInfo = (); - type CallExecutor = SchedulerPaymentExecutor; - type OriginPrivilegeCmp = OriginPrivilegeCmp; - type PreimageProvider = (); - type NoPreimagePostponement = NoPreimagePostponement; -} +// impl pallet_unique_scheduler::Config for Runtime { +// type Event = Event; +// type Origin = Origin; +// type Currency = Balances; +// type PalletsOrigin = OriginCaller; +// type Call = Call; +// type MaximumWeight = MaximumSchedulerWeight; +// type ScheduleOrigin = EnsureSigned; +// type MaxScheduledPerBlock = MaxScheduledPerBlock; +// type WeightInfo = (); +// type CallExecutor = SchedulerPaymentExecutor; +// type OriginPrivilegeCmp = OriginPrivilegeCmp; +// type PreimageProvider = (); +// type NoPreimagePostponement = NoPreimagePostponement; +// } type EvmSponsorshipHandler = ( UniqueEthSponsorshipHandler, @@ -1150,17 +1150,17 @@ construct_runtime!( // Unique Pallets Inflation: pallet_inflation::{Pallet, Call, Storage} = 60, Unique: pallet_unique::{Pallet, Call, Storage, Event} = 61, - Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event} = 62, + // Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event} = 62, // free = 63 Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64, // ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65, Common: pallet_common::{Pallet, Storage, Event} = 66, Fungible: pallet_fungible::{Pallet, Storage} = 67, - Refungible: pallet_refungible::{Pallet, Storage} = 68, + // Refungible: pallet_refungible::{Pallet, Storage} = 68, Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69, Structure: pallet_structure::{Pallet, Call, Storage, Event} = 70, - RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event} = 71, - RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event} = 72, + // RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event} = 71, + // RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event} = 72, // Frontier EVM: pallet_evm::{Pallet, Config, Call, Storage, Event} = 100, @@ -1323,57 +1323,112 @@ impl_common_runtime_apis! { RmrkPartType, RmrkTheme > for Runtime { + + // fn last_collection_idx() -> Result { + // pallet_proxy_rmrk_core::rpc::last_collection_idx::() + // } + + // fn collection_by_id(collection_id: RmrkCollectionId) -> Result>, DispatchError> { + // pallet_proxy_rmrk_core::rpc::collection_by_id::(collection_id) + // } + + // fn nft_by_id(collection_id: RmrkCollectionId, nft_by_id: RmrkNftId) -> Result>, DispatchError> { + // pallet_proxy_rmrk_core::rpc::nft_by_id::(collection_id, nft_by_id) + // } + + // fn account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Result, DispatchError> { + // pallet_proxy_rmrk_core::rpc::account_tokens::(account_id, collection_id) + // } + + // fn nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result, DispatchError> { + // pallet_proxy_rmrk_core::rpc::nft_children::(collection_id, nft_id) + // } + + // fn collection_properties(collection_id: RmrkCollectionId, filter_keys: Option>) -> Result, DispatchError> { + // pallet_proxy_rmrk_core::rpc::collection_properties::(collection_id, filter_keys) + // } + + // fn nft_properties(collection_id: RmrkCollectionId, nft_id: RmrkNftId, filter_keys: Option>) -> Result, DispatchError> { + // pallet_proxy_rmrk_core::rpc::nft_properties::(collection_id, nft_id, filter_keys) + // } + + // fn nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result, DispatchError> { + // pallet_proxy_rmrk_core::rpc::nft_resources::(collection_id, nft_id) + // } + + // fn nft_resource_priority(collection_id: RmrkCollectionId, nft_id: RmrkNftId, resource_id: RmrkResourceId) -> Result, DispatchError> { + // pallet_proxy_rmrk_core::rpc::nft_resource_priority::(collection_id, nft_id, resource_id) + // } + + // fn base(base_id: RmrkBaseId) -> Result>, DispatchError> { + // pallet_proxy_rmrk_equip::rpc::base::(base_id) + // } + + // fn base_parts(base_id: RmrkBaseId) -> Result, DispatchError> { + // pallet_proxy_rmrk_equip::rpc::base_parts::(base_id) + // } + + // fn theme_names(base_id: RmrkBaseId) -> Result, DispatchError> { + // pallet_proxy_rmrk_equip::rpc::theme_names::(base_id) + // } + + // fn theme(base_id: RmrkBaseId, theme_name: RmrkThemeName, filter_keys: Option>) -> Result, DispatchError> { + // pallet_proxy_rmrk_equip::rpc::theme::(base_id, theme_name, filter_keys) + // } + fn last_collection_idx() -> Result { - pallet_proxy_rmrk_core::rpc::last_collection_idx::() + Ok(Default::default()) } - fn collection_by_id(collection_id: RmrkCollectionId) -> Result>, DispatchError> { - pallet_proxy_rmrk_core::rpc::collection_by_id::(collection_id) + fn collection_by_id(_collection_id: RmrkCollectionId) -> Result>, DispatchError> { + Ok(Default::default()) } - fn nft_by_id(collection_id: RmrkCollectionId, nft_by_id: RmrkNftId) -> Result>, DispatchError> { - pallet_proxy_rmrk_core::rpc::nft_by_id::(collection_id, nft_by_id) + fn nft_by_id(_collection_id: RmrkCollectionId, _nft_by_id: RmrkNftId) -> Result>, DispatchError> { + Ok(Default::default()) } - fn account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Result, DispatchError> { - pallet_proxy_rmrk_core::rpc::account_tokens::(account_id, collection_id) + fn account_tokens(_account_id: AccountId, _collection_id: RmrkCollectionId) -> Result, DispatchError> { + Ok(Default::default()) } - fn nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result, DispatchError> { - pallet_proxy_rmrk_core::rpc::nft_children::(collection_id, nft_id) + fn nft_children(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result, DispatchError> { + Ok(Default::default()) } - fn collection_properties(collection_id: RmrkCollectionId, filter_keys: Option>) -> Result, DispatchError> { - pallet_proxy_rmrk_core::rpc::collection_properties::(collection_id, filter_keys) + fn collection_properties(_collection_id: RmrkCollectionId, _filter_keys: Option>) -> Result, DispatchError> { + Ok(Default::default()) } - fn nft_properties(collection_id: RmrkCollectionId, nft_id: RmrkNftId, filter_keys: Option>) -> Result, DispatchError> { - pallet_proxy_rmrk_core::rpc::nft_properties::(collection_id, nft_id, filter_keys) + fn nft_properties(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _filter_keys: Option>) -> Result, DispatchError> { + Ok(Default::default()) } - fn nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result, DispatchError> { - pallet_proxy_rmrk_core::rpc::nft_resources::(collection_id, nft_id) + fn nft_resources(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result, DispatchError> { + Ok(Default::default()) } - fn nft_resource_priority(collection_id: RmrkCollectionId, nft_id: RmrkNftId, resource_id: RmrkResourceId) -> Result, DispatchError> { - pallet_proxy_rmrk_core::rpc::nft_resource_priority::(collection_id, nft_id, resource_id) + fn nft_resource_priority(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _resource_id: RmrkResourceId) -> Result, DispatchError> { + Ok(Default::default()) } - fn base(base_id: RmrkBaseId) -> Result>, DispatchError> { - pallet_proxy_rmrk_equip::rpc::base::(base_id) + fn base(_base_id: RmrkBaseId) -> Result>, DispatchError> { + Ok(Default::default()) } - fn base_parts(base_id: RmrkBaseId) -> Result, DispatchError> { - pallet_proxy_rmrk_equip::rpc::base_parts::(base_id) + fn base_parts(_base_id: RmrkBaseId) -> Result, DispatchError> { + Ok(Default::default()) } - fn theme_names(base_id: RmrkBaseId) -> Result, DispatchError> { - pallet_proxy_rmrk_equip::rpc::theme_names::(base_id) + fn theme_names(_base_id: RmrkBaseId) -> Result, DispatchError> { + Ok(Default::default()) } - fn theme(base_id: RmrkBaseId, theme_name: RmrkThemeName, filter_keys: Option>) -> Result, DispatchError> { - pallet_proxy_rmrk_equip::rpc::theme::(base_id, theme_name, filter_keys) + fn theme(_base_id: RmrkBaseId, _theme_name: RmrkThemeName, _filter_keys: Option>) -> Result, DispatchError> { + Ok(Default::default()) } + + } } diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index a75c541c3a..3c7a4e5b73 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -901,9 +901,11 @@ impl pallet_structure::Config for Runtime { impl pallet_fungible::Config for Runtime { type WeightInfo = pallet_fungible::weights::SubstrateWeight; } + impl pallet_refungible::Config for Runtime { type WeightInfo = pallet_refungible::weights::SubstrateWeight; } + impl pallet_nonfungible::Config for Runtime { type WeightInfo = pallet_nonfungible::weights::SubstrateWeight; } @@ -950,92 +952,92 @@ fn get_signed_extras(from: ::AccountId) -> Sign ) } -pub struct SchedulerPaymentExecutor; -impl - DispatchCall for SchedulerPaymentExecutor -where - ::Call: Member - + Dispatchable - + SelfContainedCall - + GetDispatchInfo - + From>, - SelfContainedSignedInfo: Send + Sync + 'static, - Call: From<::Call> - + From<::Call> - + SelfContainedCall, - sp_runtime::AccountId32: From<::AccountId>, -{ - fn dispatch_call( - signer: ::AccountId, - call: ::Call, - ) -> Result< - Result>, - TransactionValidityError, - > { - let dispatch_info = call.get_dispatch_info(); - let extrinsic = fp_self_contained::CheckedExtrinsic::< - AccountId, - Call, - SignedExtraScheduler, - SelfContainedSignedInfo, - > { - signed: - CheckedSignature::::Signed( - signer.clone().into(), - get_signed_extras(signer.into()), - ), - function: call.into(), - }; - - extrinsic.apply::(&dispatch_info, 0) - } - - fn reserve_balance( - id: [u8; 16], - sponsor: ::AccountId, - call: ::Call, - count: u32, - ) -> Result<(), DispatchError> { - let dispatch_info = call.get_dispatch_info(); - let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0) - .saturating_mul(count.into()); - - >::reserve_named( - &id, - &(sponsor.into()), - weight, - ) - } - - fn pay_for_call( - id: [u8; 16], - sponsor: ::AccountId, - call: ::Call, - ) -> Result { - let dispatch_info = call.get_dispatch_info(); - let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0); - Ok( - >::unreserve_named( - &id, - &(sponsor.into()), - weight, - ), - ) - } - - fn cancel_reserve( - id: [u8; 16], - sponsor: ::AccountId, - ) -> Result { - Ok( - >::unreserve_named( - &id, - &(sponsor.into()), - u128::MAX, - ), - ) - } -} +// pub struct SchedulerPaymentExecutor; +// impl +// DispatchCall for SchedulerPaymentExecutor +// where +// ::Call: Member +// + Dispatchable +// + SelfContainedCall +// + GetDispatchInfo +// + From>, +// SelfContainedSignedInfo: Send + Sync + 'static, +// Call: From<::Call> +// + From<::Call> +// + SelfContainedCall, +// sp_runtime::AccountId32: From<::AccountId>, +// { +// fn dispatch_call( +// signer: ::AccountId, +// call: ::Call, +// ) -> Result< +// Result>, +// TransactionValidityError, +// > { +// let dispatch_info = call.get_dispatch_info(); +// let extrinsic = fp_self_contained::CheckedExtrinsic::< +// AccountId, +// Call, +// SignedExtraScheduler, +// SelfContainedSignedInfo, +// > { +// signed: +// CheckedSignature::::Signed( +// signer.clone().into(), +// get_signed_extras(signer.into()), +// ), +// function: call.into(), +// }; + +// extrinsic.apply::(&dispatch_info, 0) +// } + +// fn reserve_balance( +// id: [u8; 16], +// sponsor: ::AccountId, +// call: ::Call, +// count: u32, +// ) -> Result<(), DispatchError> { +// let dispatch_info = call.get_dispatch_info(); +// let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0) +// .saturating_mul(count.into()); + +// >::reserve_named( +// &id, +// &(sponsor.into()), +// weight, +// ) +// } + +// fn pay_for_call( +// id: [u8; 16], +// sponsor: ::AccountId, +// call: ::Call, +// ) -> Result { +// let dispatch_info = call.get_dispatch_info(); +// let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0); +// Ok( +// >::unreserve_named( +// &id, +// &(sponsor.into()), +// weight, +// ), +// ) +// } + +// fn cancel_reserve( +// id: [u8; 16], +// sponsor: ::AccountId, +// ) -> Result { +// Ok( +// >::unreserve_named( +// &id, +// &(sponsor.into()), +// u128::MAX, +// ), +// ) +// } +// } parameter_types! { pub const NoPreimagePostponement: Option = Some(10); @@ -1051,21 +1053,21 @@ impl PrivilegeCmp for OriginPrivilegeCmp { } } -impl pallet_unique_scheduler::Config for Runtime { - type Event = Event; - type Origin = Origin; - type Currency = Balances; - type PalletsOrigin = OriginCaller; - type Call = Call; - type MaximumWeight = MaximumSchedulerWeight; - type ScheduleOrigin = EnsureSigned; - type MaxScheduledPerBlock = MaxScheduledPerBlock; - type WeightInfo = (); - type CallExecutor = SchedulerPaymentExecutor; - type OriginPrivilegeCmp = OriginPrivilegeCmp; - type PreimageProvider = (); - type NoPreimagePostponement = NoPreimagePostponement; -} +// impl pallet_unique_scheduler::Config for Runtime { +// type Event = Event; +// type Origin = Origin; +// type Currency = Balances; +// type PalletsOrigin = OriginCaller; +// type Call = Call; +// type MaximumWeight = MaximumSchedulerWeight; +// type ScheduleOrigin = EnsureSigned; +// type MaxScheduledPerBlock = MaxScheduledPerBlock; +// type WeightInfo = (); +// type CallExecutor = SchedulerPaymentExecutor; +// type OriginPrivilegeCmp = OriginPrivilegeCmp; +// type PreimageProvider = (); +// type NoPreimagePostponement = NoPreimagePostponement; +// } type EvmSponsorshipHandler = ( UniqueEthSponsorshipHandler, @@ -1139,13 +1141,13 @@ construct_runtime!( // Unique Pallets Inflation: pallet_inflation::{Pallet, Call, Storage} = 60, Unique: pallet_unique::{Pallet, Call, Storage, Event} = 61, - Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event} = 62, + // Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event} = 62, // free = 63 Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64, // ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65, Common: pallet_common::{Pallet, Storage, Event} = 66, Fungible: pallet_fungible::{Pallet, Storage} = 67, - Refungible: pallet_refungible::{Pallet, Storage} = 68, + // Refungible: pallet_refungible::{Pallet, Storage} = 68, Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69, Structure: pallet_structure::{Pallet, Call, Storage, Event} = 70, diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 527baf7f36..bdf79a3a4a 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -36,6 +36,8 @@ import { CrossAccountId, getCreateItemsResult, getDestroyItemsResult, + getModuleNames, + Pallets, } from './util/helpers'; import chai from 'chai'; @@ -46,14 +48,18 @@ const expect = chai.expect; let alice: IKeyringPair; let bob: IKeyringPair; -describe('integration test: Refungible functionality:', () => { - before(async () => { + + +describe('integration test: Refungible functionality:', async () => { + before(async function() { await usingApi(async (api, privateKeyWrapper) => { alice = privateKeyWrapper('//Alice'); bob = privateKeyWrapper('//Bob'); + if (!getModuleNames(api).includes(Pallets.ReFungible)) this.skip(); }); + }); - + it('Create refungible collection and token', async () => { await usingApi(async api => { const createCollectionResult = await createCollection(api, alice, {mode: {type: 'ReFungible'}}); @@ -268,15 +274,6 @@ describe('integration test: Refungible functionality:', () => { ]); }); }); -}); - -describe('Test Refungible properties:', () => { - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - }); - }); it('Сreate new collection with properties', async () => { await usingApi(async api => { @@ -292,3 +289,4 @@ describe('Test Refungible properties:', () => { }); }); }); + diff --git a/tests/src/rmrk/acceptNft.test.ts b/tests/src/rmrk/acceptNft.test.ts index f3e50f65e7..69e88aeb45 100644 --- a/tests/src/rmrk/acceptNft.test.ts +++ b/tests/src/rmrk/acceptNft.test.ts @@ -8,14 +8,19 @@ import { } from './util/tx'; import {NftIdTuple} from './util/fetch'; import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; +import { getModuleNames, Pallets } from '../util/helpers'; describe('integration test: accept NFT', () => { let api: any; - before(async () => { api = await getApiConnection(); }); - + before(async function() { + api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + }); + + const alice = '//Alice'; const bob = '//Bob'; - + const createTestCollection = async (issuerUri: string) => { return await createCollection( api, diff --git a/tests/src/rmrk/addResource.test.ts b/tests/src/rmrk/addResource.test.ts index 9798152053..ffc91f22c0 100644 --- a/tests/src/rmrk/addResource.test.ts +++ b/tests/src/rmrk/addResource.test.ts @@ -12,6 +12,7 @@ import { addNftComposableResource, } from './util/tx'; import {RmrkTraitsResourceResourceInfo as ResourceInfo} from '@polkadot/types/lookup'; +import { getModuleNames, Pallets } from '../util/helpers'; describe('integration test: add NFT resource', () => { const Alice = '//Alice'; @@ -24,8 +25,9 @@ describe('integration test: add NFT resource', () => { const nonexistentId = 99999; let api: any; - before(async () => { + before(async function() { api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); }); it('add resource', async () => { diff --git a/tests/src/rmrk/addTheme.test.ts b/tests/src/rmrk/addTheme.test.ts index b2bb56e0ff..3151f4a714 100644 --- a/tests/src/rmrk/addTheme.test.ts +++ b/tests/src/rmrk/addTheme.test.ts @@ -3,10 +3,14 @@ import {getApiConnection} from '../substrate/substrate-api'; import {createBase, addTheme} from './util/tx'; import {expectTxFailure} from './util/helpers'; import {getThemeNames} from './util/fetch'; +import { getModuleNames, Pallets } from '../util/helpers'; describe('integration test: add Theme to Base', () => { let api: any; - before(async () => { api = await getApiConnection(); }); + before(async function() { + api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + }); const alice = '//Alice'; const bob = '//Bob'; diff --git a/tests/src/rmrk/burnNft.test.ts b/tests/src/rmrk/burnNft.test.ts index c640e625a6..92f6299e29 100644 --- a/tests/src/rmrk/burnNft.test.ts +++ b/tests/src/rmrk/burnNft.test.ts @@ -5,6 +5,7 @@ import {burnNft, createCollection, sendNft, mintNft} from './util/tx'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; +import { getModuleNames, Pallets } from '../util/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -14,10 +15,12 @@ describe('integration test: burn nft', () => { const Bob = '//Bob'; let api: any; - before(async () => { + before(async function() { api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); }); + it('burn nft', async () => { await createCollection( api, diff --git a/tests/src/rmrk/changeCollectionIssuer.test.ts b/tests/src/rmrk/changeCollectionIssuer.test.ts index 6d1afec7b0..ca311dc60f 100644 --- a/tests/src/rmrk/changeCollectionIssuer.test.ts +++ b/tests/src/rmrk/changeCollectionIssuer.test.ts @@ -1,4 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; +import { getModuleNames, Pallets } from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import { changeIssuer, @@ -10,10 +11,13 @@ describe('integration test: collection issuer', () => { const Bob = '//Bob'; let api: any; - before(async () => { + before(async function() { api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); }); + + it('change collection issuer', async () => { await createCollection( api, diff --git a/tests/src/rmrk/createBase.test.ts b/tests/src/rmrk/createBase.test.ts index 5d07489aa9..0ef8399fd0 100644 --- a/tests/src/rmrk/createBase.test.ts +++ b/tests/src/rmrk/createBase.test.ts @@ -1,9 +1,13 @@ import {getApiConnection} from '../substrate/substrate-api'; +import { getModuleNames, Pallets } from '../util/helpers'; import {createCollection, createBase} from './util/tx'; describe('integration test: create new Base', () => { let api: any; - before(async () => { api = await getApiConnection(); }); + before(async function() { + api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + }); const alice = '//Alice'; diff --git a/tests/src/rmrk/createCollection.test.ts b/tests/src/rmrk/createCollection.test.ts index 22c879b2b2..ffcae90a95 100644 --- a/tests/src/rmrk/createCollection.test.ts +++ b/tests/src/rmrk/createCollection.test.ts @@ -1,9 +1,15 @@ import {getApiConnection} from '../substrate/substrate-api'; +import {getModuleNames, Pallets} from '../util/helpers'; import {createCollection} from './util/tx'; describe('Integration test: create new collection', () => { let api: any; - before(async () => { api = await getApiConnection(); }); + before(async function () { + api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + }); + + const alice = '//Alice'; diff --git a/tests/src/rmrk/deleteCollection.test.ts b/tests/src/rmrk/deleteCollection.test.ts index a6925c2c5b..92d79b1b17 100644 --- a/tests/src/rmrk/deleteCollection.test.ts +++ b/tests/src/rmrk/deleteCollection.test.ts @@ -1,11 +1,13 @@ import {getApiConnection} from '../substrate/substrate-api'; +import { getModuleNames, Pallets } from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, deleteCollection} from './util/tx'; describe('integration test: delete collection', () => { let api: any; - before(async () => { + before(async function () { api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); }); const Alice = '//Alice'; diff --git a/tests/src/rmrk/equipNft.test.ts b/tests/src/rmrk/equipNft.test.ts index 76a8a988dd..d050ea43d3 100644 --- a/tests/src/rmrk/equipNft.test.ts +++ b/tests/src/rmrk/equipNft.test.ts @@ -1,6 +1,7 @@ import {ApiPromise} from '@polkadot/api'; import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; +import {getModuleNames, Pallets} from '../util/helpers'; import {getNft, getParts, NftIdTuple} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import { @@ -122,8 +123,10 @@ async function checkEquipStatus( describe.skip('integration test: Equip NFT', () => { let api: any; - before(async () => { + + before(async function () { api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); }); it('equip nft', async () => { diff --git a/tests/src/rmrk/getOwnedNfts.test.ts b/tests/src/rmrk/getOwnedNfts.test.ts index 6fbf5499d1..c279197e7a 100644 --- a/tests/src/rmrk/getOwnedNfts.test.ts +++ b/tests/src/rmrk/getOwnedNfts.test.ts @@ -1,11 +1,17 @@ import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; +import { getModuleNames, Pallets } from '../util/helpers'; import {getOwnedNfts} from './util/fetch'; import {mintNft, createCollection} from './util/tx'; describe('integration test: get owned NFTs', () => { let api: any; - before(async () => { api = await getApiConnection(); }); + + before(async function () { + api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + }); + const alice = '//Alice'; diff --git a/tests/src/rmrk/lockCollection.test.ts b/tests/src/rmrk/lockCollection.test.ts index f23294a7e5..d881ab1197 100644 --- a/tests/src/rmrk/lockCollection.test.ts +++ b/tests/src/rmrk/lockCollection.test.ts @@ -1,4 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; +import { getModuleNames, Pallets } from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, lockCollection, mintNft} from './util/tx'; @@ -8,8 +9,9 @@ describe('integration test: lock collection', () => { const Max = 5; let api: any; - before(async () => { + before(async function () { api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); }); it('lock collection', async () => { diff --git a/tests/src/rmrk/mintNft.test.ts b/tests/src/rmrk/mintNft.test.ts index 6f77b4ea7f..53d10356db 100644 --- a/tests/src/rmrk/mintNft.test.ts +++ b/tests/src/rmrk/mintNft.test.ts @@ -1,12 +1,18 @@ import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; +import { getModuleNames, Pallets } from '../util/helpers'; import {getNft} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import {createCollection, mintNft} from './util/tx'; describe('integration test: mint new NFT', () => { let api: any; - before(async () => { api = await getApiConnection(); }); + + before(async function () { + api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + }); + const alice = '//Alice'; const bob = '//Bob'; diff --git a/tests/src/rmrk/rejectNft.test.ts b/tests/src/rmrk/rejectNft.test.ts index 893866c8b3..475c961d9b 100644 --- a/tests/src/rmrk/rejectNft.test.ts +++ b/tests/src/rmrk/rejectNft.test.ts @@ -8,10 +8,16 @@ import { } from './util/tx'; import {getChildren, NftIdTuple} from './util/fetch'; import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; +import { getModuleNames, Pallets } from '../util/helpers'; describe('integration test: reject NFT', () => { let api: any; - before(async () => { api = await getApiConnection(); }); + before(async function () { + api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + }); + + const alice = '//Alice'; const bob = '//Bob'; diff --git a/tests/src/rmrk/removeResource.test.ts b/tests/src/rmrk/removeResource.test.ts index a76c5da796..cdde0616a4 100644 --- a/tests/src/rmrk/removeResource.test.ts +++ b/tests/src/rmrk/removeResource.test.ts @@ -1,6 +1,7 @@ import {expect} from 'chai'; import privateKey from '../substrate/privateKey'; import {executeTransaction, getApiConnection} from '../substrate/substrate-api'; +import { getModuleNames, Pallets } from '../util/helpers'; import {getNft, NftIdTuple} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import { @@ -16,9 +17,10 @@ import { describe('Integration test: remove nft resource', () => { let api: any; let ss58Format: string; - before(async () => { + before(async function() { api = await getApiConnection(); ss58Format = api.registry.getChainProperties()!.toJSON().ss58Format; + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); }); const Alice = '//Alice'; diff --git a/tests/src/rmrk/rmrkIsolation.test.ts b/tests/src/rmrk/rmrkIsolation.test.ts index 6ea368e20a..8ac77b6006 100644 --- a/tests/src/rmrk/rmrkIsolation.test.ts +++ b/tests/src/rmrk/rmrkIsolation.test.ts @@ -6,7 +6,9 @@ import { getCreateCollectionResult, getDetailedCollectionInfo, getGenericResult, + getModuleNames, normalizeAccountId, + Pallets, } from '../util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; import {ApiPromise} from '@polkadot/api'; @@ -59,11 +61,10 @@ async function isUnique(): Promise { describe('RMRK External Integration Test', async () => { const it_rmrk = (await isUnique() ? it : it.skip); - before(async () => { + before(async function() { await usingApi(async (api, privateKeyWrapper) => { alice = privateKeyWrapper('//Alice'); - - + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); }); }); diff --git a/tests/src/rmrk/sendNft.test.ts b/tests/src/rmrk/sendNft.test.ts index 178b1bccad..5f1b03d22c 100644 --- a/tests/src/rmrk/sendNft.test.ts +++ b/tests/src/rmrk/sendNft.test.ts @@ -3,10 +3,14 @@ import {getApiConnection} from '../substrate/substrate-api'; import {createCollection, mintNft, sendNft} from './util/tx'; import {NftIdTuple} from './util/fetch'; import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; +import { getModuleNames, Pallets } from '../util/helpers'; describe('integration test: send NFT', () => { let api: any; - before(async () => { api = await getApiConnection(); }); + before(async function () { + api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + }); const maxNftId = 0xFFFFFFFF; diff --git a/tests/src/rmrk/setCollectionProperty.test.ts b/tests/src/rmrk/setCollectionProperty.test.ts index 39bafa12fc..f2cca758ea 100644 --- a/tests/src/rmrk/setCollectionProperty.test.ts +++ b/tests/src/rmrk/setCollectionProperty.test.ts @@ -1,4 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; +import { getModuleNames, Pallets } from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, setPropertyCollection} from './util/tx'; @@ -7,8 +8,9 @@ describe('integration test: set collection property', () => { const Bob = '//Bob'; let api: any; - before(async () => { + before(async function () { api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); }); it('set collection property', async () => { diff --git a/tests/src/rmrk/setEquippableList.test.ts b/tests/src/rmrk/setEquippableList.test.ts index d36ce98a33..a350908446 100644 --- a/tests/src/rmrk/setEquippableList.test.ts +++ b/tests/src/rmrk/setEquippableList.test.ts @@ -1,10 +1,14 @@ import {getApiConnection} from '../substrate/substrate-api'; +import { getModuleNames, Pallets } from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, createBase, setEquippableList} from './util/tx'; describe("integration test: set slot's Equippable List", () => { let api: any; - before(async () => { api = await getApiConnection(); }); + before(async function () { + api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + }); const alice = '//Alice'; const bob = '//Bob'; diff --git a/tests/src/rmrk/setNftProperty.test.ts b/tests/src/rmrk/setNftProperty.test.ts index b1c8c69b0e..37a426f31c 100644 --- a/tests/src/rmrk/setNftProperty.test.ts +++ b/tests/src/rmrk/setNftProperty.test.ts @@ -1,11 +1,15 @@ import {getApiConnection} from '../substrate/substrate-api'; +import { getModuleNames, Pallets } from '../util/helpers'; import {NftIdTuple} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import {createCollection, mintNft, sendNft, setNftProperty} from './util/tx'; describe('integration test: set NFT property', () => { let api: any; - before(async () => { api = await getApiConnection(); }); + before(async function () { + api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + }); const alice = '//Alice'; const bob = '//Bob'; diff --git a/tests/src/rmrk/setResourcePriorities.test.ts b/tests/src/rmrk/setResourcePriorities.test.ts index 6f7f1503c7..b469fa3135 100644 --- a/tests/src/rmrk/setResourcePriorities.test.ts +++ b/tests/src/rmrk/setResourcePriorities.test.ts @@ -1,10 +1,14 @@ import {getApiConnection} from '../substrate/substrate-api'; +import { getModuleNames, Pallets } from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import {mintNft, createCollection, setResourcePriorities} from './util/tx'; describe('integration test: set NFT resource priorities', () => { let api: any; - before(async () => { api = await getApiConnection(); }); + before(async function () { + api = await getApiConnection(); + if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + }); const alice = '//Alice'; const bob = '//Bob'; diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index 46cf666f87..180a3157ab 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -38,6 +38,38 @@ export type CrossAccountId = { Ethereum: string, }; + +export enum Pallets { + Inflation = 'inflation', + RmrkCore = 'rmrkcore', + ReFungible = 'refungible', + Fungible = 'fungible', + NFT = 'nonfungible', +} + +export async function isUnique(): Promise { + return usingApi(async api => { + const chain = await api.rpc.system.chain(); + + return chain.eq('UNIQUE'); + }); +} + +export async function isQuartz(): Promise { + return usingApi(async api => { + const chain = await api.rpc.system.chain(); + + return chain.eq('QUARTZ'); + }); +} + +let modulesNames: any; +export function getModuleNames(api: ApiPromise): string[] { + if (typeof modulesNames === 'undefined') + modulesNames = api.runtimeMetadata.asLatest.pallets.map(m => m.name.toString().toLowerCase()); + return modulesNames; +} + export function normalizeAccountId(input: string | AccountId | CrossAccountId | IKeyringPair): CrossAccountId { if (typeof input === 'string') { if (input.length >= 47) { From 67532f473fe2406b768c80a7a11cea83f23a5a48 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 1 Aug 2022 13:03:46 +0000 Subject: [PATCH 0267/1274] feat: add refungible and new-functionality feature --- runtime/common/Cargo.toml | 6 +- runtime/common/src/weights.rs | 116 +++++++--------------------------- runtime/opal/Cargo.toml | 5 +- runtime/quartz/Cargo.toml | 3 +- runtime/unique/Cargo.toml | 4 +- 5 files changed, 36 insertions(+), 98 deletions(-) diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 6acc1b5965..b5751a6f3a 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -32,8 +32,10 @@ runtime-benchmarks = [ 'frame-support/runtime-benchmarks', 'frame-system/runtime-benchmarks', ] -unique-runtime = ['std'] -quartz-runtime = ['std'] +unique-runtime = [] +quartz-runtime = [] + +refungible = [] [dependencies.sp-core] default-features = false diff --git a/runtime/common/src/weights.rs b/runtime/common/src/weights.rs index 2e2127f5e1..a7dfd3fab2 100644 --- a/runtime/common/src/weights.rs +++ b/runtime/common/src/weights.rs @@ -25,33 +25,36 @@ use pallet_refungible::{ }; use up_data_structs::{CreateItemExData, CreateItemData}; -#[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] macro_rules! max_weight_of { - ($method:ident ( $($args:tt)* )) => { - >::$method($($args)*) - .max(>::$method($($args)*)) - .max(>::$method($($args)*)) - }; -} + ($method:ident ( $($args:tt)* )) => {{ + let max_weight = >::$method($($args)*) + .max(>::$method($($args)*)); -#[cfg(any(feature = "unique-runtime", feature = "quartz-runtime"))] -macro_rules! max_weight_of { - ($method:ident ( $($args:tt)* )) => { - >::$method($($args)*) - .max(>::$method($($args)*)) + #[cfg(feature = "refungible")] + let max_weight = max_weight.max(>::$method($($args)*)); - }; + max_weight + }}; } -#[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] -pub struct CommonWeights(PhantomData) -where - T: FungibleConfig + NonfungibleConfig + RefungibleConfig; +#[cfg(not(feature = "refungible"))] +pub trait CommonWeightConfigs: FungibleConfig + NonfungibleConfig {} + +#[cfg(not(feature = "refungible"))] +impl CommonWeightConfigs for T {} + +#[cfg(feature = "refungible")] +pub trait CommonWeightConfigs: FungibleConfig + NonfungibleConfig + RefungibleConfig {} + +#[cfg(feature = "refungible")] +impl CommonWeightConfigs for T {} + + +pub struct CommonWeights(PhantomData); -#[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] impl CommonWeightInfo for CommonWeights where - T: FungibleConfig + NonfungibleConfig + RefungibleConfig, + T: CommonWeightConfigs, { fn create_item() -> Weight { dispatch_weight::() + max_weight_of!(create_item()) @@ -114,7 +117,7 @@ where } } -#[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] +#[cfg(feature = "refungible")] impl RefungibleExtensionsWeightInfo for CommonWeights where T: FungibleConfig + NonfungibleConfig + RefungibleConfig, @@ -124,78 +127,7 @@ where } } -#[cfg(any(feature = "unique-runtime", feature = "quartz-runtime"))] -pub struct CommonWeights(PhantomData) -where - T: FungibleConfig + NonfungibleConfig; - -#[cfg(any(feature = "unique-runtime", feature = "quartz-runtime"))] -impl CommonWeightInfo for CommonWeights -where - T: FungibleConfig + NonfungibleConfig, -{ - fn create_item() -> Weight { - dispatch_weight::() + max_weight_of!(create_item()) - } - - fn create_multiple_items(data: &[CreateItemData]) -> Weight { - dispatch_weight::() + max_weight_of!(create_multiple_items(data)) - } - - fn create_multiple_items_ex(data: &CreateItemExData) -> Weight { - dispatch_weight::() + max_weight_of!(create_multiple_items_ex(data)) - } - - fn burn_item() -> Weight { - dispatch_weight::() + max_weight_of!(burn_item()) - } - - fn set_collection_properties(amount: u32) -> Weight { - dispatch_weight::() + max_weight_of!(set_collection_properties(amount)) - } - - fn delete_collection_properties(amount: u32) -> Weight { - dispatch_weight::() + max_weight_of!(delete_collection_properties(amount)) - } - - fn set_token_properties(amount: u32) -> Weight { - dispatch_weight::() + max_weight_of!(set_token_properties(amount)) - } - - fn delete_token_properties(amount: u32) -> Weight { - dispatch_weight::() + max_weight_of!(delete_token_properties(amount)) - } - - fn set_token_property_permissions(amount: u32) -> Weight { - dispatch_weight::() + max_weight_of!(set_token_property_permissions(amount)) - } - - fn transfer() -> Weight { - dispatch_weight::() + max_weight_of!(transfer()) - } - - fn approve() -> Weight { - dispatch_weight::() + max_weight_of!(approve()) - } - - fn transfer_from() -> Weight { - dispatch_weight::() + max_weight_of!(transfer_from()) - } - - fn burn_from() -> Weight { - dispatch_weight::() + max_weight_of!(burn_from()) - } - - fn burn_recursively_self_raw() -> Weight { - max_weight_of!(burn_recursively_self_raw()) - } - - fn burn_recursively_breadth_raw(amount: u32) -> Weight { - max_weight_of!(burn_recursively_breadth_raw(amount)) - } -} - -#[cfg(any(feature = "unique-runtime", feature = "quartz-runtime"))] +#[cfg(not(feature = "refungible"))] impl RefungibleExtensionsWeightInfo for CommonWeights where T: FungibleConfig + NonfungibleConfig, diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 678dfc3d61..0ab8810f79 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -16,7 +16,7 @@ version = '0.9.24' targets = ['x86_64-unknown-linux-gnu'] [features] -default = ['std'] +default = ['std', 'new-functionality'] runtime-benchmarks = [ 'hex-literal', 'frame-benchmarking', @@ -119,6 +119,9 @@ std = [ "orml-vesting/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] +new-functionality = [ + 'unique-runtime-common/refungible', +] ################################################################################ # Substrate Dependencies diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 4c9425a5bd..31b7aa53f6 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -16,7 +16,7 @@ version = '0.9.24' targets = ['x86_64-unknown-linux-gnu'] [features] -default = ['std'] +default = ['std', 'new-functionality'] runtime-benchmarks = [ 'hex-literal', 'frame-benchmarking', @@ -118,6 +118,7 @@ std = [ "orml-vesting/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] +new-functionality = [] ################################################################################ # Substrate Dependencies diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 631a1a120b..b371a0e12b 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -16,7 +16,7 @@ version = '0.9.24' targets = ['x86_64-unknown-linux-gnu'] [features] -default = ['std', 'unique-runtime'] +default = ['std', 'new-functionality'] runtime-benchmarks = [ 'hex-literal', 'frame-benchmarking', @@ -119,7 +119,7 @@ std = [ "orml-vesting/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] -unique-runtime = [] +new-functionality = [] ################################################################################ # Substrate Dependencies From 8f925da4d48d2b63f5319bf39e4d1981060d0482 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 1 Aug 2022 13:47:04 +0000 Subject: [PATCH 0268/1274] fix: use rft imports only when needed --- runtime/common/src/weights.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtime/common/src/weights.rs b/runtime/common/src/weights.rs index a7dfd3fab2..af3199b8cf 100644 --- a/runtime/common/src/weights.rs +++ b/runtime/common/src/weights.rs @@ -20,6 +20,8 @@ use pallet_common::{CommonWeightInfo, dispatch::dispatch_weight, RefungibleExten use pallet_fungible::{Config as FungibleConfig, common::CommonWeights as FungibleWeights}; use pallet_nonfungible::{Config as NonfungibleConfig, common::CommonWeights as NonfungibleWeights}; + +#[cfg(feature = "refungible")] use pallet_refungible::{ Config as RefungibleConfig, weights::WeightInfo, common::CommonWeights as RefungibleWeights, }; From 061bbd839dd986b59f62174238b484b198a81b1e Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 1 Aug 2022 13:53:29 +0000 Subject: [PATCH 0269/1274] fix: use rft feature in dispatch --- runtime/common/src/dispatch.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/common/src/dispatch.rs b/runtime/common/src/dispatch.rs index c241db6a1f..6cea499cdd 100644 --- a/runtime/common/src/dispatch.rs +++ b/runtime/common/src/dispatch.rs @@ -64,9 +64,10 @@ where ); >::init_collection(sender, data)? } - #[cfg(all(not(feature = "unique-runtime"), not(feature = "quartz-runtime")))] + #[cfg(feature = "refungible")] CollectionMode::ReFungible => >::init_collection(sender, data)?, + #[cfg(not(feature = "refungible"))] CollectionMode::ReFungible => { return Err(DispatchError::Other("Refunginle pallet is not supported")) } From ba782483735fea9f76050199dabfd5d2dab6c285 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 1 Aug 2022 22:55:57 +0000 Subject: [PATCH 0270/1274] feat: common construct_runtime, rmrk feature --- runtime/common/Cargo.toml | 4 +- runtime/common/src/lib.rs | 1 + runtime/common/src/runtime_apis.rs | 185 +++++++++++++++++++++++++++ runtime/opal/Cargo.toml | 10 +- runtime/opal/src/lib.rs | 128 +------------------ runtime/quartz/Cargo.toml | 6 +- runtime/quartz/src/lib.rs | 199 ++--------------------------- runtime/unique/Cargo.toml | 4 +- runtime/unique/src/lib.rs | 136 +++----------------- 9 files changed, 236 insertions(+), 437 deletions(-) diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index b5751a6f3a..cae1129f7b 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -32,8 +32,10 @@ runtime-benchmarks = [ 'frame-support/runtime-benchmarks', 'frame-system/runtime-benchmarks', ] -unique-runtime = [] + +opal-runtime = [] quartz-runtime = [] +unique-runtime = [] refungible = [] diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index dfdc9f5562..01725d3d10 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -23,3 +23,4 @@ pub mod runtime_apis; pub mod sponsoring; pub mod types; pub mod weights; +pub mod construct_runtime; diff --git a/runtime/common/src/runtime_apis.rs b/runtime/common/src/runtime_apis.rs index 00d3a10e2b..1ca2f86dd7 100644 --- a/runtime/common/src/runtime_apis.rs +++ b/runtime/common/src/runtime_apis.rs @@ -154,6 +154,191 @@ macro_rules! impl_common_runtime_apis { } } + impl rmrk_rpc::RmrkApi< + Block, + AccountId, + RmrkCollectionInfo, + RmrkInstanceInfo, + RmrkResourceInfo, + RmrkPropertyInfo, + RmrkBaseInfo, + RmrkPartType, + RmrkTheme + > for Runtime { + fn last_collection_idx() -> Result { + #[cfg(feature = "rmrk")] + return pallet_proxy_rmrk_core::rpc::last_collection_idx::(); + + #[cfg(not(feature = "rmrk"))] + return Ok(Default::default()); + } + + fn collection_by_id( + #[allow(unused_variables)] + collection_id: RmrkCollectionId + ) -> Result>, DispatchError> { + #[cfg(feature = "rmrk")] + return pallet_proxy_rmrk_core::rpc::collection_by_id::(collection_id); + + #[cfg(not(feature = "rmrk"))] + return Ok(Default::default()) + } + + fn nft_by_id( + #[allow(unused_variables)] + collection_id: RmrkCollectionId, + + #[allow(unused_variables)] + nft_by_id: RmrkNftId + ) -> Result>, DispatchError> { + #[cfg(feature = "rmrk")] + return pallet_proxy_rmrk_core::rpc::nft_by_id::(collection_id, nft_by_id); + + #[cfg(not(feature = "rmrk"))] + return Ok(Default::default()) + } + + fn account_tokens( + #[allow(unused_variables)] + account_id: AccountId, + + #[allow(unused_variables)] + collection_id: RmrkCollectionId + ) -> Result, DispatchError> { + #[cfg(feature = "rmrk")] + return pallet_proxy_rmrk_core::rpc::account_tokens::(account_id, collection_id); + + #[cfg(not(feature = "rmrk"))] + return Ok(Default::default()) + } + + fn nft_children( + #[allow(unused_variables)] + collection_id: RmrkCollectionId, + + #[allow(unused_variables)] + nft_id: RmrkNftId + ) -> Result, DispatchError> { + #[cfg(feature = "rmrk")] + return pallet_proxy_rmrk_core::rpc::nft_children::(collection_id, nft_id); + + #[cfg(not(feature = "rmrk"))] + return Ok(Default::default()) + } + + fn collection_properties( + #[allow(unused_variables)] + collection_id: RmrkCollectionId, + + #[allow(unused_variables)] + filter_keys: Option> + ) -> Result, DispatchError> { + #[cfg(feature = "rmrk")] + return pallet_proxy_rmrk_core::rpc::collection_properties::(collection_id, filter_keys); + + #[cfg(not(feature = "rmrk"))] + return Ok(Default::default()) + } + + fn nft_properties( + #[allow(unused_variables)] + collection_id: RmrkCollectionId, + + #[allow(unused_variables)] + nft_id: RmrkNftId, + + #[allow(unused_variables)] + filter_keys: Option> + ) -> Result, DispatchError> { + #[cfg(feature = "rmrk")] + return pallet_proxy_rmrk_core::rpc::nft_properties::(collection_id, nft_id, filter_keys); + + #[cfg(not(feature = "rmrk"))] + return Ok(Default::default()) + } + + fn nft_resources( + #[allow(unused_variables)] + collection_id: RmrkCollectionId, + + #[allow(unused_variables)] + nft_id: RmrkNftId + ) -> Result, DispatchError> { + #[cfg(feature = "rmrk")] + return pallet_proxy_rmrk_core::rpc::nft_resources::(collection_id, nft_id); + + #[cfg(not(feature = "rmrk"))] + return Ok(Default::default()) + } + + fn nft_resource_priority( + #[allow(unused_variables)] + collection_id: RmrkCollectionId, + + #[allow(unused_variables)] + nft_id: RmrkNftId, + + #[allow(unused_variables)] + resource_id: RmrkResourceId + ) -> Result, DispatchError> { + #[cfg(feature = "rmrk")] + return pallet_proxy_rmrk_core::rpc::nft_resource_priority::(collection_id, nft_id, resource_id); + + #[cfg(not(feature = "rmrk"))] + return Ok(Default::default()) + } + + fn base( + #[allow(unused_variables)] + base_id: RmrkBaseId + ) -> Result>, DispatchError> { + #[cfg(feature = "rmrk")] + return pallet_proxy_rmrk_equip::rpc::base::(base_id); + + #[cfg(not(feature = "rmrk"))] + return Ok(Default::default()) + } + + fn base_parts( + #[allow(unused_variables)] + base_id: RmrkBaseId + ) -> Result, DispatchError> { + #[cfg(feature = "rmrk")] + return pallet_proxy_rmrk_equip::rpc::base_parts::(base_id); + + #[cfg(not(feature = "rmrk"))] + return Ok(Default::default()) + } + + fn theme_names( + #[allow(unused_variables)] + base_id: RmrkBaseId + ) -> Result, DispatchError> { + #[cfg(feature = "rmrk")] + return pallet_proxy_rmrk_equip::rpc::theme_names::(base_id); + + #[cfg(not(feature = "rmrk"))] + Ok(Default::default()) + } + + fn theme( + #[allow(unused_variables)] + base_id: RmrkBaseId, + + #[allow(unused_variables)] + theme_name: RmrkThemeName, + + #[allow(unused_variables)] + filter_keys: Option> + ) -> Result, DispatchError> { + #[cfg(feature = "rmrk")] + return pallet_proxy_rmrk_equip::rpc::theme::(base_id, theme_name, filter_keys); + + #[cfg(not(feature = "rmrk"))] + return Ok(Default::default()) + } + } + impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { VERSION diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 0ab8810f79..3b474c238a 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -16,7 +16,7 @@ version = '0.9.24' targets = ['x86_64-unknown-linux-gnu'] [features] -default = ['std', 'new-functionality'] +default = ['std', 'opal-runtime'] runtime-benchmarks = [ 'hex-literal', 'frame-benchmarking', @@ -119,9 +119,9 @@ std = [ "orml-vesting/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] -new-functionality = [ - 'unique-runtime-common/refungible', -] +opal-runtime = ['rmrk'] + +rmrk = [] ################################################################################ # Substrate Dependencies @@ -399,7 +399,7 @@ default-features = false [dependencies] log = { version = "0.4.16", default-features = false } -unique-runtime-common = { path = "../common", default-features = false } +unique-runtime-common = { path = "../common", default-features = false, features = ['refungible'] } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 94ced970a2..c181af1ccc 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -54,7 +54,7 @@ pub use pallet_evm::{ OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping, }; pub use frame_support::{ - construct_runtime, match_types, + match_types, dispatch::DispatchResult, PalletId, parameter_types, StorageValue, ConsensusEngineId, traits::{ @@ -130,6 +130,7 @@ use xcm_executor::traits::{MatchesFungible, WeightTrader}; //use xcm_executor::traits::MatchesFungible; use unique_runtime_common::{ + construct_runtime, impl_common_runtime_apis, types::*, constants::*, @@ -910,11 +911,13 @@ impl pallet_nonfungible::Config for Runtime { type WeightInfo = pallet_nonfungible::weights::SubstrateWeight; } +#[cfg(feature = "rmrk")] impl pallet_proxy_rmrk_core::Config for Runtime { type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight; type Event = Event; } +#[cfg(feature = "rmrk")] impl pallet_proxy_rmrk_equip::Config for Runtime { type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight; type Event = Event; @@ -1120,60 +1123,7 @@ impl pallet_evm_contract_helpers::Config for Runtime { type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; } -construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = opaque::Block, - UncheckedExtrinsic = UncheckedExtrinsic - { - ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned} = 20, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21, - - Aura: pallet_aura::{Pallet, Config} = 22, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23, - - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 30, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33, - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 34, - Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event} = 35, - System: frame_system::{Pallet, Call, Storage, Config, Event} = 36, - Vesting: orml_vesting::{Pallet, Storage, Call, Event, Config} = 37, - // Vesting: pallet_vesting::{Pallet, Call, Config, Storage, Event} = 37, - // Contracts: pallet_contracts::{Pallet, Call, Storage, Event} = 38, - - // XCM helpers. - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 50, - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin} = 51, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event, Origin} = 52, - DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 53, - - // Unique Pallets - Inflation: pallet_inflation::{Pallet, Call, Storage} = 60, - Unique: pallet_unique::{Pallet, Call, Storage, Event} = 61, - Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event} = 62, - // free = 63 - Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64, - // ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65, - Common: pallet_common::{Pallet, Storage, Event} = 66, - Fungible: pallet_fungible::{Pallet, Storage} = 67, - Refungible: pallet_refungible::{Pallet, Storage} = 68, - Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69, - Structure: pallet_structure::{Pallet, Call, Storage, Event} = 70, - RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event} = 71, - RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event} = 72, - - // Frontier - EVM: pallet_evm::{Pallet, Config, Call, Storage, Event} = 100, - Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101, - - EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150, - EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151, - EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152, - EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153, - } -); +construct_runtime!(); pub struct TransactionConverter; @@ -1309,73 +1259,7 @@ macro_rules! dispatch_unique_runtime { }}; } -impl_common_runtime_apis! { - #![custom_apis] - - impl rmrk_rpc::RmrkApi< - Block, - AccountId, - RmrkCollectionInfo, - RmrkInstanceInfo, - RmrkResourceInfo, - RmrkPropertyInfo, - RmrkBaseInfo, - RmrkPartType, - RmrkTheme - > for Runtime { - fn last_collection_idx() -> Result { - pallet_proxy_rmrk_core::rpc::last_collection_idx::() - } - - fn collection_by_id(collection_id: RmrkCollectionId) -> Result>, DispatchError> { - pallet_proxy_rmrk_core::rpc::collection_by_id::(collection_id) - } - - fn nft_by_id(collection_id: RmrkCollectionId, nft_by_id: RmrkNftId) -> Result>, DispatchError> { - pallet_proxy_rmrk_core::rpc::nft_by_id::(collection_id, nft_by_id) - } - - fn account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Result, DispatchError> { - pallet_proxy_rmrk_core::rpc::account_tokens::(account_id, collection_id) - } - - fn nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result, DispatchError> { - pallet_proxy_rmrk_core::rpc::nft_children::(collection_id, nft_id) - } - - fn collection_properties(collection_id: RmrkCollectionId, filter_keys: Option>) -> Result, DispatchError> { - pallet_proxy_rmrk_core::rpc::collection_properties::(collection_id, filter_keys) - } - - fn nft_properties(collection_id: RmrkCollectionId, nft_id: RmrkNftId, filter_keys: Option>) -> Result, DispatchError> { - pallet_proxy_rmrk_core::rpc::nft_properties::(collection_id, nft_id, filter_keys) - } - - fn nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result, DispatchError> { - pallet_proxy_rmrk_core::rpc::nft_resources::(collection_id, nft_id) - } - - fn nft_resource_priority(collection_id: RmrkCollectionId, nft_id: RmrkNftId, resource_id: RmrkResourceId) -> Result, DispatchError> { - pallet_proxy_rmrk_core::rpc::nft_resource_priority::(collection_id, nft_id, resource_id) - } - - fn base(base_id: RmrkBaseId) -> Result>, DispatchError> { - pallet_proxy_rmrk_equip::rpc::base::(base_id) - } - - fn base_parts(base_id: RmrkBaseId) -> Result, DispatchError> { - pallet_proxy_rmrk_equip::rpc::base_parts::(base_id) - } - - fn theme_names(base_id: RmrkBaseId) -> Result, DispatchError> { - pallet_proxy_rmrk_equip::rpc::theme_names::(base_id) - } - - fn theme(base_id: RmrkBaseId, theme_name: RmrkThemeName, filter_keys: Option>) -> Result, DispatchError> { - pallet_proxy_rmrk_equip::rpc::theme::(base_id, theme_name, filter_keys) - } - } -} +impl_common_runtime_apis!(); struct CheckInherents; diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 31b7aa53f6..4a98b90f58 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -16,7 +16,7 @@ version = '0.9.24' targets = ['x86_64-unknown-linux-gnu'] [features] -default = ['std', 'new-functionality'] +default = ['std', 'quartz-runtime'] runtime-benchmarks = [ 'hex-literal', 'frame-benchmarking', @@ -118,7 +118,9 @@ std = [ "orml-vesting/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] -new-functionality = [] +quartz-runtime = [] + +rmrk = [] ################################################################################ # Substrate Dependencies diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index 4cc350fc88..6d19494ad9 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -54,7 +54,7 @@ pub use pallet_evm::{ OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping, }; pub use frame_support::{ - construct_runtime, match_types, + match_types, dispatch::DispatchResult, PalletId, parameter_types, StorageValue, ConsensusEngineId, traits::{ @@ -128,6 +128,7 @@ use xcm::latest::{ use xcm_executor::traits::{MatchesFungible, WeightTrader}; use unique_runtime_common::{ + construct_runtime, impl_common_runtime_apis, types::*, constants::*, @@ -909,15 +910,17 @@ impl pallet_nonfungible::Config for Runtime { type WeightInfo = pallet_nonfungible::weights::SubstrateWeight; } -// impl pallet_proxy_rmrk_core::Config for Runtime { -// type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight; -// type Event = Event; -// } +#[cfg(feature = "rmrk")] +impl pallet_proxy_rmrk_core::Config for Runtime { + type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight; + type Event = Event; +} -// impl pallet_proxy_rmrk_equip::Config for Runtime { -// type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight; -// type Event = Event; -// } +#[cfg(feature = "rmrk")] +impl pallet_proxy_rmrk_equip::Config for Runtime { + type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight; + type Event = Event; +} impl pallet_unique::Config for Runtime { type Event = Event; @@ -1118,60 +1121,7 @@ impl pallet_evm_contract_helpers::Config for Runtime { type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; } -construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = opaque::Block, - UncheckedExtrinsic = UncheckedExtrinsic - { - ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned} = 20, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21, - - Aura: pallet_aura::{Pallet, Config} = 22, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23, - - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 30, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33, - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 34, - Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event} = 35, - System: frame_system::{Pallet, Call, Storage, Config, Event} = 36, - Vesting: orml_vesting::{Pallet, Storage, Call, Event, Config} = 37, - // Vesting: pallet_vesting::{Pallet, Call, Config, Storage, Event} = 37, - // Contracts: pallet_contracts::{Pallet, Call, Storage, Event} = 38, - - // XCM helpers. - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 50, - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin} = 51, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event, Origin} = 52, - DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 53, - - // Unique Pallets - Inflation: pallet_inflation::{Pallet, Call, Storage} = 60, - Unique: pallet_unique::{Pallet, Call, Storage, Event} = 61, - // Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event} = 62, - // free = 63 - Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64, - // ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65, - Common: pallet_common::{Pallet, Storage, Event} = 66, - Fungible: pallet_fungible::{Pallet, Storage} = 67, - // Refungible: pallet_refungible::{Pallet, Storage} = 68, - Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69, - Structure: pallet_structure::{Pallet, Call, Storage, Event} = 70, - // RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event} = 71, - // RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event} = 72, - - // Frontier - EVM: pallet_evm::{Pallet, Config, Call, Storage, Event} = 100, - Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101, - - EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150, - EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151, - EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152, - EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153, - } -); +construct_runtime!(); pub struct TransactionConverter; @@ -1309,128 +1259,7 @@ macro_rules! dispatch_unique_runtime { }}; } -impl_common_runtime_apis! { - #![custom_apis] - - impl rmrk_rpc::RmrkApi< - Block, - AccountId, - RmrkCollectionInfo, - RmrkInstanceInfo, - RmrkResourceInfo, - RmrkPropertyInfo, - RmrkBaseInfo, - RmrkPartType, - RmrkTheme - > for Runtime { - - // fn last_collection_idx() -> Result { - // pallet_proxy_rmrk_core::rpc::last_collection_idx::() - // } - - // fn collection_by_id(collection_id: RmrkCollectionId) -> Result>, DispatchError> { - // pallet_proxy_rmrk_core::rpc::collection_by_id::(collection_id) - // } - - // fn nft_by_id(collection_id: RmrkCollectionId, nft_by_id: RmrkNftId) -> Result>, DispatchError> { - // pallet_proxy_rmrk_core::rpc::nft_by_id::(collection_id, nft_by_id) - // } - - // fn account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Result, DispatchError> { - // pallet_proxy_rmrk_core::rpc::account_tokens::(account_id, collection_id) - // } - - // fn nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result, DispatchError> { - // pallet_proxy_rmrk_core::rpc::nft_children::(collection_id, nft_id) - // } - - // fn collection_properties(collection_id: RmrkCollectionId, filter_keys: Option>) -> Result, DispatchError> { - // pallet_proxy_rmrk_core::rpc::collection_properties::(collection_id, filter_keys) - // } - - // fn nft_properties(collection_id: RmrkCollectionId, nft_id: RmrkNftId, filter_keys: Option>) -> Result, DispatchError> { - // pallet_proxy_rmrk_core::rpc::nft_properties::(collection_id, nft_id, filter_keys) - // } - - // fn nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result, DispatchError> { - // pallet_proxy_rmrk_core::rpc::nft_resources::(collection_id, nft_id) - // } - - // fn nft_resource_priority(collection_id: RmrkCollectionId, nft_id: RmrkNftId, resource_id: RmrkResourceId) -> Result, DispatchError> { - // pallet_proxy_rmrk_core::rpc::nft_resource_priority::(collection_id, nft_id, resource_id) - // } - - // fn base(base_id: RmrkBaseId) -> Result>, DispatchError> { - // pallet_proxy_rmrk_equip::rpc::base::(base_id) - // } - - // fn base_parts(base_id: RmrkBaseId) -> Result, DispatchError> { - // pallet_proxy_rmrk_equip::rpc::base_parts::(base_id) - // } - - // fn theme_names(base_id: RmrkBaseId) -> Result, DispatchError> { - // pallet_proxy_rmrk_equip::rpc::theme_names::(base_id) - // } - - // fn theme(base_id: RmrkBaseId, theme_name: RmrkThemeName, filter_keys: Option>) -> Result, DispatchError> { - // pallet_proxy_rmrk_equip::rpc::theme::(base_id, theme_name, filter_keys) - // } - - fn last_collection_idx() -> Result { - Ok(Default::default()) - } - - fn collection_by_id(_collection_id: RmrkCollectionId) -> Result>, DispatchError> { - Ok(Default::default()) - } - - fn nft_by_id(_collection_id: RmrkCollectionId, _nft_by_id: RmrkNftId) -> Result>, DispatchError> { - Ok(Default::default()) - } - - fn account_tokens(_account_id: AccountId, _collection_id: RmrkCollectionId) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn nft_children(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn collection_properties(_collection_id: RmrkCollectionId, _filter_keys: Option>) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn nft_properties(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _filter_keys: Option>) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn nft_resources(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn nft_resource_priority(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _resource_id: RmrkResourceId) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn base(_base_id: RmrkBaseId) -> Result>, DispatchError> { - Ok(Default::default()) - } - - fn base_parts(_base_id: RmrkBaseId) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn theme_names(_base_id: RmrkBaseId) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn theme(_base_id: RmrkBaseId, _theme_name: RmrkThemeName, _filter_keys: Option>) -> Result, DispatchError> { - Ok(Default::default()) - } - - - } -} +impl_common_runtime_apis!(); struct CheckInherents; diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index b371a0e12b..631a1a120b 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -16,7 +16,7 @@ version = '0.9.24' targets = ['x86_64-unknown-linux-gnu'] [features] -default = ['std', 'new-functionality'] +default = ['std', 'unique-runtime'] runtime-benchmarks = [ 'hex-literal', 'frame-benchmarking', @@ -119,7 +119,7 @@ std = [ "orml-vesting/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] -new-functionality = [] +unique-runtime = [] ################################################################################ # Substrate Dependencies diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index 3c7a4e5b73..ff419cd9c8 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -54,7 +54,7 @@ pub use pallet_evm::{ OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping, }; pub use frame_support::{ - construct_runtime, match_types, + match_types, dispatch::DispatchResult, PalletId, parameter_types, StorageValue, ConsensusEngineId, traits::{ @@ -128,6 +128,7 @@ use xcm::latest::{ use xcm_executor::traits::{MatchesFungible, WeightTrader}; use unique_runtime_common::{ + construct_runtime, impl_common_runtime_apis, types::*, constants::*, @@ -910,6 +911,18 @@ impl pallet_nonfungible::Config for Runtime { type WeightInfo = pallet_nonfungible::weights::SubstrateWeight; } +#[cfg(feature = "rmrk")] +impl pallet_proxy_rmrk_core::Config for Runtime { + type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight; + type Event = Event; +} + +#[cfg(feature = "rmrk")] +impl pallet_proxy_rmrk_equip::Config for Runtime { + type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight; + type Event = Event; +} + impl pallet_unique::Config for Runtime { type Event = Event; type WeightInfo = pallet_unique::weights::SubstrateWeight; @@ -1109,58 +1122,7 @@ impl pallet_evm_contract_helpers::Config for Runtime { type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; } -construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = opaque::Block, - UncheckedExtrinsic = UncheckedExtrinsic - { - ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned} = 20, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21, - - Aura: pallet_aura::{Pallet, Config} = 22, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23, - - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 30, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33, - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 34, - Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event} = 35, - System: frame_system::{Pallet, Call, Storage, Config, Event} = 36, - Vesting: orml_vesting::{Pallet, Storage, Call, Event, Config} = 37, - // Vesting: pallet_vesting::{Pallet, Call, Config, Storage, Event} = 37, - // Contracts: pallet_contracts::{Pallet, Call, Storage, Event} = 38, - - // XCM helpers. - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 50, - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin} = 51, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event, Origin} = 52, - DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 53, - - // Unique Pallets - Inflation: pallet_inflation::{Pallet, Call, Storage} = 60, - Unique: pallet_unique::{Pallet, Call, Storage, Event} = 61, - // Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event} = 62, - // free = 63 - Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64, - // ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65, - Common: pallet_common::{Pallet, Storage, Event} = 66, - Fungible: pallet_fungible::{Pallet, Storage} = 67, - // Refungible: pallet_refungible::{Pallet, Storage} = 68, - Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69, - Structure: pallet_structure::{Pallet, Call, Storage, Event} = 70, - - // Frontier - EVM: pallet_evm::{Pallet, Config, Call, Storage, Event} = 100, - Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101, - - EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150, - EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151, - EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152, - EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153, - } -); +construct_runtime!(); pub struct TransactionConverter; @@ -1297,73 +1259,7 @@ macro_rules! dispatch_unique_runtime { }}; } -impl_common_runtime_apis! { - #![custom_apis] - - impl rmrk_rpc::RmrkApi< - Block, - AccountId, - RmrkCollectionInfo, - RmrkInstanceInfo, - RmrkResourceInfo, - RmrkPropertyInfo, - RmrkBaseInfo, - RmrkPartType, - RmrkTheme - > for Runtime { - fn last_collection_idx() -> Result { - Ok(Default::default()) - } - - fn collection_by_id(_collection_id: RmrkCollectionId) -> Result>, DispatchError> { - Ok(Default::default()) - } - - fn nft_by_id(_collection_id: RmrkCollectionId, _nft_by_id: RmrkNftId) -> Result>, DispatchError> { - Ok(Default::default()) - } - - fn account_tokens(_account_id: AccountId, _collection_id: RmrkCollectionId) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn nft_children(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn collection_properties(_collection_id: RmrkCollectionId, _filter_keys: Option>) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn nft_properties(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _filter_keys: Option>) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn nft_resources(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn nft_resource_priority(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _resource_id: RmrkResourceId) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn base(_base_id: RmrkBaseId) -> Result>, DispatchError> { - Ok(Default::default()) - } - - fn base_parts(_base_id: RmrkBaseId) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn theme_names(_base_id: RmrkBaseId) -> Result, DispatchError> { - Ok(Default::default()) - } - - fn theme(_base_id: RmrkBaseId, _theme_name: RmrkThemeName, _filter_keys: Option>) -> Result, DispatchError> { - Ok(Default::default()) - } - } -} +impl_common_runtime_apis!(); struct CheckInherents; From 3f04e2d67df0f6e3cf08bb80a86a91793b87d002 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 1 Aug 2022 23:17:05 +0000 Subject: [PATCH 0271/1274] feat: scheduler feature --- runtime/opal/Cargo.toml | 3 +- runtime/opal/src/lib.rs | 5 +- runtime/quartz/Cargo.toml | 1 + runtime/quartz/src/lib.rs | 230 ++++++++++++++++++++----------------- runtime/unique/Cargo.toml | 3 + runtime/unique/src/lib.rs | 233 ++++++++++++++++++++------------------ 6 files changed, 258 insertions(+), 217 deletions(-) diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 3b474c238a..6a88eab0e3 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -119,8 +119,9 @@ std = [ "orml-vesting/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] -opal-runtime = ['rmrk'] +opal-runtime = ['scheduler', 'rmrk'] +scheduler = [] rmrk = [] ################################################################################ diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index c181af1ccc..40421bafb4 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -110,7 +110,7 @@ use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*}; use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, @@ -966,6 +966,8 @@ fn get_signed_extras(from: ::AccountId) -> Sign } pub struct SchedulerPaymentExecutor; + +#[cfg(feature = "scheduler")] impl DispatchCall for SchedulerPaymentExecutor where @@ -1066,6 +1068,7 @@ impl PrivilegeCmp for OriginPrivilegeCmp { } } +#[cfg(feature = "scheduler")] impl pallet_unique_scheduler::Config for Runtime { type Event = Event; type Origin = Origin; diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 4a98b90f58..e7e6d8008a 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -120,6 +120,7 @@ std = [ limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] quartz-runtime = [] +scheduler = [] rmrk = [] ################################################################################ diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index 6d19494ad9..aedea05437 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -28,13 +28,21 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160}; use sp_runtime::DispatchError; +#[cfg(feature = "scheduler")] use fp_self_contained::*; + +#[cfg(feature = "scheduler")] +use sp_runtime::{ + traits::Member, + generic::Era, + DispatchErrorWithPostInfo +}; // #[cfg(any(feature = "std", test))] // pub use sp_runtime::BuildStorage; use sp_runtime::{ Permill, Perbill, Percent, create_runtime_str, generic, impl_opaque_keys, - traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion, Zero, Member}, + traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion, Zero}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, RuntimeAppPublic, }; @@ -69,7 +77,10 @@ pub use frame_support::{ WeightToFee, }, }; + +#[cfg(feature = "scheduler")] use pallet_unique_scheduler::DispatchCall; + use up_data_structs::{ CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits, CollectionStats, RpcCollection, @@ -93,12 +104,10 @@ use codec::{Encode, Decode}; use fp_rpc::TransactionStatus; use sp_runtime::{ traits::{ - Applyable, BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, + BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, Saturating, CheckedConversion, }, - generic::Era, - transaction_validity::TransactionValidityError, - DispatchErrorWithPostInfo, SaturatedConversion, + transaction_validity::TransactionValidityError, SaturatedConversion, }; // pub use pallet_timestamp::Call as TimestampCall; @@ -109,7 +118,7 @@ use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*}; use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, @@ -948,8 +957,11 @@ parameter_types! { } type ChargeTransactionPayment = pallet_charge_transaction::ChargeTransactionPayment; + +#[cfg(feature = "scheduler")] use frame_support::traits::NamedReservableCurrency; +#[cfg(feature = "scheduler")] fn get_signed_extras(from: ::AccountId) -> SignedExtraScheduler { ( frame_system::CheckSpecVersion::::new(), @@ -964,92 +976,95 @@ fn get_signed_extras(from: ::AccountId) -> Sign ) } -// pub struct SchedulerPaymentExecutor; -// impl -// DispatchCall for SchedulerPaymentExecutor -// where -// ::Call: Member -// + Dispatchable -// + SelfContainedCall -// + GetDispatchInfo -// + From>, -// SelfContainedSignedInfo: Send + Sync + 'static, -// Call: From<::Call> -// + From<::Call> -// + SelfContainedCall, -// sp_runtime::AccountId32: From<::AccountId>, -// { -// fn dispatch_call( -// signer: ::AccountId, -// call: ::Call, -// ) -> Result< -// Result>, -// TransactionValidityError, -// > { -// let dispatch_info = call.get_dispatch_info(); -// let extrinsic = fp_self_contained::CheckedExtrinsic::< -// AccountId, -// Call, -// SignedExtraScheduler, -// SelfContainedSignedInfo, -// > { -// signed: -// CheckedSignature::::Signed( -// signer.clone().into(), -// get_signed_extras(signer.into()), -// ), -// function: call.into(), -// }; - -// extrinsic.apply::(&dispatch_info, 0) -// } - -// fn reserve_balance( -// id: [u8; 16], -// sponsor: ::AccountId, -// call: ::Call, -// count: u32, -// ) -> Result<(), DispatchError> { -// let dispatch_info = call.get_dispatch_info(); -// let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0) -// .saturating_mul(count.into()); - -// >::reserve_named( -// &id, -// &(sponsor.into()), -// weight.into(), -// ) -// } - -// fn pay_for_call( -// id: [u8; 16], -// sponsor: ::AccountId, -// call: ::Call, -// ) -> Result { -// let dispatch_info = call.get_dispatch_info(); -// let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0); -// Ok( -// >::unreserve_named( -// &id, -// &(sponsor.into()), -// weight.into(), -// ), -// ) -// } - -// fn cancel_reserve( -// id: [u8; 16], -// sponsor: ::AccountId, -// ) -> Result { -// Ok( -// >::unreserve_named( -// &id, -// &(sponsor.into()), -// u128::MAX, -// ), -// ) -// } -// } +#[cfg(feature = "scheduler")] +pub struct SchedulerPaymentExecutor; + +#[cfg(feature = "scheduler")] +impl + DispatchCall for SchedulerPaymentExecutor +where + ::Call: Member + + Dispatchable + + SelfContainedCall + + GetDispatchInfo + + From>, + SelfContainedSignedInfo: Send + Sync + 'static, + Call: From<::Call> + + From<::Call> + + SelfContainedCall, + sp_runtime::AccountId32: From<::AccountId>, +{ + fn dispatch_call( + signer: ::AccountId, + call: ::Call, + ) -> Result< + Result>, + TransactionValidityError, + > { + let dispatch_info = call.get_dispatch_info(); + let extrinsic = fp_self_contained::CheckedExtrinsic::< + AccountId, + Call, + SignedExtraScheduler, + SelfContainedSignedInfo, + > { + signed: + CheckedSignature::::Signed( + signer.clone().into(), + get_signed_extras(signer.into()), + ), + function: call.into(), + }; + + extrinsic.apply::(&dispatch_info, 0) + } + + fn reserve_balance( + id: [u8; 16], + sponsor: ::AccountId, + call: ::Call, + count: u32, + ) -> Result<(), DispatchError> { + let dispatch_info = call.get_dispatch_info(); + let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0) + .saturating_mul(count.into()); + + >::reserve_named( + &id, + &(sponsor.into()), + weight.into(), + ) + } + + fn pay_for_call( + id: [u8; 16], + sponsor: ::AccountId, + call: ::Call, + ) -> Result { + let dispatch_info = call.get_dispatch_info(); + let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0); + Ok( + >::unreserve_named( + &id, + &(sponsor.into()), + weight.into(), + ), + ) + } + + fn cancel_reserve( + id: [u8; 16], + sponsor: ::AccountId, + ) -> Result { + Ok( + >::unreserve_named( + &id, + &(sponsor.into()), + u128::MAX, + ), + ) + } +} parameter_types! { pub const NoPreimagePostponement: Option = Some(10); @@ -1065,21 +1080,22 @@ impl PrivilegeCmp for OriginPrivilegeCmp { } } -// impl pallet_unique_scheduler::Config for Runtime { -// type Event = Event; -// type Origin = Origin; -// type Currency = Balances; -// type PalletsOrigin = OriginCaller; -// type Call = Call; -// type MaximumWeight = MaximumSchedulerWeight; -// type ScheduleOrigin = EnsureSigned; -// type MaxScheduledPerBlock = MaxScheduledPerBlock; -// type WeightInfo = (); -// type CallExecutor = SchedulerPaymentExecutor; -// type OriginPrivilegeCmp = OriginPrivilegeCmp; -// type PreimageProvider = (); -// type NoPreimagePostponement = NoPreimagePostponement; -// } +#[cfg(feature = "scheduler")] +impl pallet_unique_scheduler::Config for Runtime { + type Event = Event; + type Origin = Origin; + type Currency = Balances; + type PalletsOrigin = OriginCaller; + type Call = Call; + type MaximumWeight = MaximumSchedulerWeight; + type ScheduleOrigin = EnsureSigned; + type MaxScheduledPerBlock = MaxScheduledPerBlock; + type WeightInfo = (); + type CallExecutor = SchedulerPaymentExecutor; + type OriginPrivilegeCmp = OriginPrivilegeCmp; + type PreimageProvider = (); + type NoPreimagePostponement = NoPreimagePostponement; +} type EvmSponsorshipHandler = ( UniqueEthSponsorshipHandler, diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 631a1a120b..5969e306a2 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -121,6 +121,9 @@ std = [ limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] unique-runtime = [] +scheduler = [] +rmrk = [] + ################################################################################ # Substrate Dependencies diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index ff419cd9c8..84f7a3bd21 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -28,13 +28,22 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160}; use sp_runtime::DispatchError; + +#[cfg(feature = "scheduler")] use fp_self_contained::*; + +#[cfg(feature = "scheduler")] +use sp_runtime::{ + traits::Member, + generic::Era, + DispatchErrorWithPostInfo +}; // #[cfg(any(feature = "std", test))] // pub use sp_runtime::BuildStorage; use sp_runtime::{ Permill, Perbill, Percent, create_runtime_str, generic, impl_opaque_keys, - traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion, Zero, Member}, + traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion, Zero}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, RuntimeAppPublic, }; @@ -69,7 +78,10 @@ pub use frame_support::{ WeightToFee, }, }; + +#[cfg(feature = "scheduler")] use pallet_unique_scheduler::DispatchCall; + use up_data_structs::{ CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits, CollectionStats, RpcCollection, @@ -93,12 +105,10 @@ use codec::{Encode, Decode}; use fp_rpc::TransactionStatus; use sp_runtime::{ traits::{ - Applyable, BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, + BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, Saturating, CheckedConversion, }, - generic::Era, - transaction_validity::TransactionValidityError, - DispatchErrorWithPostInfo, SaturatedConversion, + transaction_validity::TransactionValidityError, SaturatedConversion, }; // pub use pallet_timestamp::Call as TimestampCall; @@ -109,7 +119,7 @@ use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*}; use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, @@ -949,8 +959,11 @@ parameter_types! { } type ChargeTransactionPayment = pallet_charge_transaction::ChargeTransactionPayment; + +#[cfg(feature = "scheduler")] use frame_support::traits::NamedReservableCurrency; +#[cfg(feature = "scheduler")] fn get_signed_extras(from: ::AccountId) -> SignedExtraScheduler { ( frame_system::CheckSpecVersion::::new(), @@ -965,92 +978,95 @@ fn get_signed_extras(from: ::AccountId) -> Sign ) } -// pub struct SchedulerPaymentExecutor; -// impl -// DispatchCall for SchedulerPaymentExecutor -// where -// ::Call: Member -// + Dispatchable -// + SelfContainedCall -// + GetDispatchInfo -// + From>, -// SelfContainedSignedInfo: Send + Sync + 'static, -// Call: From<::Call> -// + From<::Call> -// + SelfContainedCall, -// sp_runtime::AccountId32: From<::AccountId>, -// { -// fn dispatch_call( -// signer: ::AccountId, -// call: ::Call, -// ) -> Result< -// Result>, -// TransactionValidityError, -// > { -// let dispatch_info = call.get_dispatch_info(); -// let extrinsic = fp_self_contained::CheckedExtrinsic::< -// AccountId, -// Call, -// SignedExtraScheduler, -// SelfContainedSignedInfo, -// > { -// signed: -// CheckedSignature::::Signed( -// signer.clone().into(), -// get_signed_extras(signer.into()), -// ), -// function: call.into(), -// }; - -// extrinsic.apply::(&dispatch_info, 0) -// } - -// fn reserve_balance( -// id: [u8; 16], -// sponsor: ::AccountId, -// call: ::Call, -// count: u32, -// ) -> Result<(), DispatchError> { -// let dispatch_info = call.get_dispatch_info(); -// let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0) -// .saturating_mul(count.into()); - -// >::reserve_named( -// &id, -// &(sponsor.into()), -// weight, -// ) -// } - -// fn pay_for_call( -// id: [u8; 16], -// sponsor: ::AccountId, -// call: ::Call, -// ) -> Result { -// let dispatch_info = call.get_dispatch_info(); -// let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0); -// Ok( -// >::unreserve_named( -// &id, -// &(sponsor.into()), -// weight, -// ), -// ) -// } - -// fn cancel_reserve( -// id: [u8; 16], -// sponsor: ::AccountId, -// ) -> Result { -// Ok( -// >::unreserve_named( -// &id, -// &(sponsor.into()), -// u128::MAX, -// ), -// ) -// } -// } +#[cfg(feature = "scheduler")] +pub struct SchedulerPaymentExecutor; + +#[cfg(feature = "scheduler")] +impl + DispatchCall for SchedulerPaymentExecutor +where + ::Call: Member + + Dispatchable + + SelfContainedCall + + GetDispatchInfo + + From>, + SelfContainedSignedInfo: Send + Sync + 'static, + Call: From<::Call> + + From<::Call> + + SelfContainedCall, + sp_runtime::AccountId32: From<::AccountId>, +{ + fn dispatch_call( + signer: ::AccountId, + call: ::Call, + ) -> Result< + Result>, + TransactionValidityError, + > { + let dispatch_info = call.get_dispatch_info(); + let extrinsic = fp_self_contained::CheckedExtrinsic::< + AccountId, + Call, + SignedExtraScheduler, + SelfContainedSignedInfo, + > { + signed: + CheckedSignature::::Signed( + signer.clone().into(), + get_signed_extras(signer.into()), + ), + function: call.into(), + }; + + extrinsic.apply::(&dispatch_info, 0) + } + + fn reserve_balance( + id: [u8; 16], + sponsor: ::AccountId, + call: ::Call, + count: u32, + ) -> Result<(), DispatchError> { + let dispatch_info = call.get_dispatch_info(); + let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0) + .saturating_mul(count.into()); + + >::reserve_named( + &id, + &(sponsor.into()), + weight, + ) + } + + fn pay_for_call( + id: [u8; 16], + sponsor: ::AccountId, + call: ::Call, + ) -> Result { + let dispatch_info = call.get_dispatch_info(); + let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0); + Ok( + >::unreserve_named( + &id, + &(sponsor.into()), + weight, + ), + ) + } + + fn cancel_reserve( + id: [u8; 16], + sponsor: ::AccountId, + ) -> Result { + Ok( + >::unreserve_named( + &id, + &(sponsor.into()), + u128::MAX, + ), + ) + } +} parameter_types! { pub const NoPreimagePostponement: Option = Some(10); @@ -1066,21 +1082,22 @@ impl PrivilegeCmp for OriginPrivilegeCmp { } } -// impl pallet_unique_scheduler::Config for Runtime { -// type Event = Event; -// type Origin = Origin; -// type Currency = Balances; -// type PalletsOrigin = OriginCaller; -// type Call = Call; -// type MaximumWeight = MaximumSchedulerWeight; -// type ScheduleOrigin = EnsureSigned; -// type MaxScheduledPerBlock = MaxScheduledPerBlock; -// type WeightInfo = (); -// type CallExecutor = SchedulerPaymentExecutor; -// type OriginPrivilegeCmp = OriginPrivilegeCmp; -// type PreimageProvider = (); -// type NoPreimagePostponement = NoPreimagePostponement; -// } +#[cfg(feature = "scheduler")] +impl pallet_unique_scheduler::Config for Runtime { + type Event = Event; + type Origin = Origin; + type Currency = Balances; + type PalletsOrigin = OriginCaller; + type Call = Call; + type MaximumWeight = MaximumSchedulerWeight; + type ScheduleOrigin = EnsureSigned; + type MaxScheduledPerBlock = MaxScheduledPerBlock; + type WeightInfo = (); + type CallExecutor = SchedulerPaymentExecutor; + type OriginPrivilegeCmp = OriginPrivilegeCmp; + type PreimageProvider = (); + type NoPreimagePostponement = NoPreimagePostponement; +} type EvmSponsorshipHandler = ( UniqueEthSponsorshipHandler, @@ -1166,7 +1183,7 @@ pub type SignedExtra = ( frame_system::CheckEra, frame_system::CheckNonce, frame_system::CheckWeight, - pallet_charge_transaction::ChargeTransactionPayment, + ChargeTransactionPayment, //pallet_contract_helpers::ContractHelpersExtension, pallet_ethereum::FakeTransactionFinalizer, ); From a18bd7d9e3fa636b4c41f449ab0f43127557f038 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 2 Aug 2022 08:46:05 +0000 Subject: [PATCH 0272/1274] feat: common construct_runtime --- runtime/common/src/construct_runtime/mod.rs | 72 +++++ runtime/common/src/construct_runtime/util.rs | 273 +++++++++++++++++++ 2 files changed, 345 insertions(+) create mode 100644 runtime/common/src/construct_runtime/mod.rs create mode 100644 runtime/common/src/construct_runtime/util.rs diff --git a/runtime/common/src/construct_runtime/mod.rs b/runtime/common/src/construct_runtime/mod.rs new file mode 100644 index 0000000000..c74fff851f --- /dev/null +++ b/runtime/common/src/construct_runtime/mod.rs @@ -0,0 +1,72 @@ +mod util; + +#[macro_export] +macro_rules! construct_runtime { + () => { + $crate::construct_runtime_impl! { + pub enum Runtime where + Block = Block, + NodeBlock = opaque::Block, + UncheckedExtrinsic = UncheckedExtrinsic + { + ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned} = 20, + ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21, + + Aura: pallet_aura::{Pallet, Config} = 22, + AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23, + + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 30, + RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31, + Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32, + TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33, + Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 34, + Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event} = 35, + System: frame_system::{Pallet, Call, Storage, Config, Event} = 36, + Vesting: orml_vesting::{Pallet, Storage, Call, Event, Config} = 37, + // Vesting: pallet_vesting::{Pallet, Call, Config, Storage, Event} = 37, + // Contracts: pallet_contracts::{Pallet, Call, Storage, Event} = 38, + + // XCM helpers. + XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 50, + PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin} = 51, + CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event, Origin} = 52, + DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 53, + + // Unique Pallets + Inflation: pallet_inflation::{Pallet, Call, Storage} = 60, + Unique: pallet_unique::{Pallet, Call, Storage, Event} = 61, + + #[runtimes(opal)] + Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event} = 62, + + // free = 63 + + Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64, + // ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65, + Common: pallet_common::{Pallet, Storage, Event} = 66, + Fungible: pallet_fungible::{Pallet, Storage} = 67, + + #[runtimes(opal)] + Refungible: pallet_refungible::{Pallet, Storage} = 68, + + Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69, + Structure: pallet_structure::{Pallet, Call, Storage, Event} = 70, + + #[runtimes(opal)] + RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event} = 71, + + #[runtimes(opal)] + RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event} = 72, + + // Frontier + EVM: pallet_evm::{Pallet, Config, Call, Storage, Event} = 100, + Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101, + + EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150, + EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151, + EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152, + EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153, + } + } + } +} diff --git a/runtime/common/src/construct_runtime/util.rs b/runtime/common/src/construct_runtime/util.rs new file mode 100644 index 0000000000..7a49c17d47 --- /dev/null +++ b/runtime/common/src/construct_runtime/util.rs @@ -0,0 +1,273 @@ +#[macro_export] +macro_rules! construct_runtime_impl { + ( + pub enum $runtime:ident where + $($where_ident:ident = $where_ty:ty),* $(,)? + { + $( + $(#[runtimes($($pallet_runtimes:ident),+ $(,)?)])? + $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal + ),* + $(,)? + } + ) => { + $crate::construct_runtime_helper! { + runtime($runtime), + where_clause($($where_ident = $where_ty),*), + pallets( + $( + $(#[runtimes($($pallet_runtimes),+)])? + $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index + ),*, + ), + + opal_pallets(), + quartz_pallets(), + unique_pallets(), + } + } +} + +#[macro_export] +macro_rules! construct_runtime_helper { + ( + runtime($runtime:ident), + where_clause($($where_clause:tt)*), + pallets( + #[runtimes($($pallet_runtimes:ident),+)] + $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal, + + $($pallets_tl:tt)* + ), + + opal_pallets($($opal_pallets:tt)*), + quartz_pallets($($quartz_pallets:tt)*), + unique_pallets($($unique_pallets:tt)*), + ) => { + $crate::add_runtime_specific_pallets! { + runtime($runtime), + where_clause($($where_clause)*), + pallets( + $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + $($pallets_tl)* + ), + + runtimes($($pallet_runtimes),+,), + + opal_pallets($($opal_pallets)*), + quartz_pallets($($quartz_pallets)*), + unique_pallets($($unique_pallets)*), + } + }; + + ( + runtime($runtime:ident), + where_clause($($where_clause:tt)*), + pallets( + $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal, + + $($pallets_tl:tt)* + ), + + opal_pallets($($opal_pallets:tt)*), + quartz_pallets($($quartz_pallets:tt)*), + unique_pallets($($unique_pallets:tt)*), + ) => { + $crate::construct_runtime_helper! { + runtime($runtime), + where_clause($($where_clause)*), + pallets($($pallets_tl)*), + + opal_pallets( + $($opal_pallets)* + $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + ), + + quartz_pallets( + $($quartz_pallets)* + $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + ), + + unique_pallets( + $($unique_pallets)* + $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + ), + } + }; + + ( + runtime($runtime:ident), + where_clause($($where_clause:tt)*), + pallets(), + + opal_pallets($($opal_pallets:tt)*), + quartz_pallets($($quartz_pallets:tt)*), + unique_pallets($($unique_pallets:tt)*), + ) => { + #[cfg(feature = "opal-runtime")] + frame_support::construct_runtime! { + pub enum $runtime where + $($where_clause)* + { + $($opal_pallets)* + } + } + + #[cfg(feature = "quartz-runtime")] + frame_support::construct_runtime! { + pub enum $runtime where + $($where_clause)* + { + $($quartz_pallets)* + } + } + + #[cfg(feature = "unique-runtime")] + frame_support::construct_runtime! { + pub enum $runtime where + $($where_clause)* + { + $($unique_pallets)* + } + } + }; +} + +#[macro_export] +macro_rules! add_runtime_specific_pallets { + ( + runtime($runtime:ident), + where_clause($($where_clause:tt)*), + pallets( + $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal, + $($pallets_tl:tt)* + ), + + runtimes( + opal, + + $($runtime_tl:tt)* + ), + + opal_pallets($($opal_pallets:tt)*), + quartz_pallets($($quartz_pallets:tt)*), + unique_pallets($($unique_pallets:tt)*), + ) => { + $crate::add_runtime_specific_pallets! { + runtime($runtime), + where_clause($($where_clause)*), + pallets( + $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + $($pallets_tl)* + ), + + runtimes($($runtime_tl)*), + + opal_pallets( + $($opal_pallets)* + $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + ), + quartz_pallets($($quartz_pallets)*), + unique_pallets($($unique_pallets)*), + } + }; + + ( + runtime($runtime:ident), + where_clause($($where_clause:tt)*), + pallets( + $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal, + $($pallets_tl:tt)* + ), + + runtimes( + quartz, + + $($runtime_tl:tt)* + ), + + opal_pallets($($opal_pallets:tt)*), + quartz_pallets($($quartz_pallets:tt)*), + unique_pallets($($unique_pallets:tt)*), + ) => { + $crate::add_runtime_specific_pallets! { + runtime($runtime), + where_clause($($where_clause)*), + pallets( + $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + $($pallets_tl)* + ), + + runtimes($($runtime_tl)*), + + opal_pallets($($opal_pallets)*), + quartz_pallets( + $($quartz_pallets)* + $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + ), + unique_pallets($($unique_pallets)*), + } + }; + + ( + runtime($runtime:ident), + where_clause($($where_clause:tt)*), + pallets( + $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal, + $($pallets_tl:tt)* + ), + + runtimes( + unique, + + $($runtime_tl:tt)* + ), + + opal_pallets($($opal_pallets:tt)*), + quartz_pallets($($quartz_pallets:tt)*), + unique_pallets($($unique_pallets:tt)*), + ) => { + $crate::add_runtime_specific_pallets! { + runtime($runtime), + where_clause($($where_clause)*), + pallets( + $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + $($pallets_tl)* + ), + + runtimes($($runtime_tl)*), + + opal_pallets($($opal_pallets)*), + quartz_pallets($($quartz_pallets)*), + unique_pallets( + $($unique_pallets)* + $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + ), + } + }; + + ( + runtime($runtime:ident), + where_clause($($where_clause:tt)*), + pallets( + $_pallet_name:ident: $_pallet_mod:ident::{$($_pallet_parts:ty),*} = $_index:literal, + $($pallets_tl:tt)* + ), + + runtimes(), + + opal_pallets($($opal_pallets:tt)*), + quartz_pallets($($quartz_pallets:tt)*), + unique_pallets($($unique_pallets:tt)*), + ) => { + $crate::construct_runtime_helper! { + runtime($runtime), + where_clause($($where_clause)*), + pallets($($pallets_tl)*), + + opal_pallets($($opal_pallets)*), + quartz_pallets($($quartz_pallets)*), + unique_pallets($($unique_pallets)*), + } + }; +} From 8699eabfbbae0add19114200acd8b2628abe8e91 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 2 Aug 2022 10:22:48 +0000 Subject: [PATCH 0273/1274] refactor: simplify common construct_runtime --- runtime/common/src/construct_runtime/mod.rs | 4 +- runtime/common/src/construct_runtime/util.rs | 243 +++++++------------ runtime/opal/src/lib.rs | 2 +- runtime/quartz/src/lib.rs | 4 +- runtime/unique/src/lib.rs | 4 +- 5 files changed, 96 insertions(+), 161 deletions(-) diff --git a/runtime/common/src/construct_runtime/mod.rs b/runtime/common/src/construct_runtime/mod.rs index c74fff851f..221e8dbb17 100644 --- a/runtime/common/src/construct_runtime/mod.rs +++ b/runtime/common/src/construct_runtime/mod.rs @@ -2,8 +2,10 @@ mod util; #[macro_export] macro_rules! construct_runtime { - () => { + ($select_runtime:ident) => { $crate::construct_runtime_impl! { + select_runtime($select_runtime); + pub enum Runtime where Block = Block, NodeBlock = opaque::Block, diff --git a/runtime/common/src/construct_runtime/util.rs b/runtime/common/src/construct_runtime/util.rs index 7a49c17d47..7cc1a35d04 100644 --- a/runtime/common/src/construct_runtime/util.rs +++ b/runtime/common/src/construct_runtime/util.rs @@ -1,7 +1,9 @@ #[macro_export] macro_rules! construct_runtime_impl { ( - pub enum $runtime:ident where + select_runtime($select_runtime:ident); + + pub enum Runtime where $($where_ident:ident = $where_ty:ty),* $(,)? { $( @@ -12,18 +14,16 @@ macro_rules! construct_runtime_impl { } ) => { $crate::construct_runtime_helper! { - runtime($runtime), + select_runtime($select_runtime), + selected_pallets(), + where_clause($($where_ident = $where_ty),*), pallets( $( $(#[runtimes($($pallet_runtimes),+)])? $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index ),*, - ), - - opal_pallets(), - quartz_pallets(), - unique_pallets(), + ) } } } @@ -31,103 +31,65 @@ macro_rules! construct_runtime_impl { #[macro_export] macro_rules! construct_runtime_helper { ( - runtime($runtime:ident), + select_runtime($select_runtime:ident), + selected_pallets($($selected_pallets:tt)*), + where_clause($($where_clause:tt)*), pallets( #[runtimes($($pallet_runtimes:ident),+)] $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal, $($pallets_tl:tt)* - ), - - opal_pallets($($opal_pallets:tt)*), - quartz_pallets($($quartz_pallets:tt)*), - unique_pallets($($unique_pallets:tt)*), + ) ) => { $crate::add_runtime_specific_pallets! { - runtime($runtime), + select_runtime($select_runtime), + runtimes($($pallet_runtimes),+,), + selected_pallets($($selected_pallets)*), + where_clause($($where_clause)*), pallets( $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, $($pallets_tl)* - ), - - runtimes($($pallet_runtimes),+,), - - opal_pallets($($opal_pallets)*), - quartz_pallets($($quartz_pallets)*), - unique_pallets($($unique_pallets)*), + ) } }; ( - runtime($runtime:ident), + select_runtime($select_runtime:ident), + selected_pallets($($selected_pallets:tt)*), + where_clause($($where_clause:tt)*), pallets( $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal, $($pallets_tl:tt)* - ), - - opal_pallets($($opal_pallets:tt)*), - quartz_pallets($($quartz_pallets:tt)*), - unique_pallets($($unique_pallets:tt)*), + ) ) => { $crate::construct_runtime_helper! { - runtime($runtime), - where_clause($($where_clause)*), - pallets($($pallets_tl)*), - - opal_pallets( - $($opal_pallets)* + select_runtime($select_runtime), + selected_pallets( + $($selected_pallets)* $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, ), - quartz_pallets( - $($quartz_pallets)* - $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, - ), - - unique_pallets( - $($unique_pallets)* - $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, - ), + where_clause($($where_clause)*), + pallets($($pallets_tl)*) } }; ( - runtime($runtime:ident), - where_clause($($where_clause:tt)*), - pallets(), + select_runtime($select_runtime:ident), + selected_pallets($($selected_pallets:tt)*), - opal_pallets($($opal_pallets:tt)*), - quartz_pallets($($quartz_pallets:tt)*), - unique_pallets($($unique_pallets:tt)*), + where_clause($($where_clause:tt)*), + pallets() ) => { - #[cfg(feature = "opal-runtime")] - frame_support::construct_runtime! { - pub enum $runtime where - $($where_clause)* - { - $($opal_pallets)* - } - } - - #[cfg(feature = "quartz-runtime")] - frame_support::construct_runtime! { - pub enum $runtime where - $($where_clause)* - { - $($quartz_pallets)* - } - } - - #[cfg(feature = "unique-runtime")] frame_support::construct_runtime! { - pub enum $runtime where + pub enum Runtime where $($where_clause)* { - $($unique_pallets)* + $($selected_pallets)* } } }; @@ -136,138 +98,109 @@ macro_rules! construct_runtime_helper { #[macro_export] macro_rules! add_runtime_specific_pallets { ( - runtime($runtime:ident), + select_runtime(opal), + runtimes(opal, $($_runtime_tl:tt)*), + selected_pallets($($selected_pallets:tt)*), + where_clause($($where_clause:tt)*), pallets( $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal, $($pallets_tl:tt)* - ), - - runtimes( - opal, - - $($runtime_tl:tt)* - ), - - opal_pallets($($opal_pallets:tt)*), - quartz_pallets($($quartz_pallets:tt)*), - unique_pallets($($unique_pallets:tt)*), + ) ) => { - $crate::add_runtime_specific_pallets! { - runtime($runtime), - where_clause($($where_clause)*), - pallets( + $crate::construct_runtime_helper! { + select_runtime(opal), + selected_pallets( + $($selected_pallets)* $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, - $($pallets_tl)* ), - runtimes($($runtime_tl)*), - - opal_pallets( - $($opal_pallets)* - $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, - ), - quartz_pallets($($quartz_pallets)*), - unique_pallets($($unique_pallets)*), + where_clause($($where_clause)*), + pallets($($pallets_tl)*) } }; ( - runtime($runtime:ident), + select_runtime(quartz), + runtimes(quartz, $($_runtime_tl:tt)*), + selected_pallets($($selected_pallets:tt)*), + where_clause($($where_clause:tt)*), pallets( $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal, $($pallets_tl:tt)* - ), - - runtimes( - quartz, - - $($runtime_tl:tt)* - ), - - opal_pallets($($opal_pallets:tt)*), - quartz_pallets($($quartz_pallets:tt)*), - unique_pallets($($unique_pallets:tt)*), + ) ) => { - $crate::add_runtime_specific_pallets! { - runtime($runtime), - where_clause($($where_clause)*), - pallets( + $crate::construct_runtime_helper! { + select_runtime(quartz), + selected_pallets( + $($selected_pallets)* $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, - $($pallets_tl)* ), - runtimes($($runtime_tl)*), - - opal_pallets($($opal_pallets)*), - quartz_pallets( - $($quartz_pallets)* - $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, - ), - unique_pallets($($unique_pallets)*), + where_clause($($where_clause)*), + pallets($($pallets_tl)*) } }; ( - runtime($runtime:ident), + select_runtime(unique), + runtimes(unique, $($_runtime_tl:tt)*), + selected_pallets($($selected_pallets:tt)*), + where_clause($($where_clause:tt)*), pallets( $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal, $($pallets_tl:tt)* - ), + ) + ) => { + $crate::construct_runtime_helper! { + select_runtime(unique), + selected_pallets( + $($selected_pallets)* + $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + ), - runtimes( - unique, + where_clause($($where_clause)*), + pallets($($pallets_tl)*) + } + }; - $($runtime_tl:tt)* - ), + ( + select_runtime($select_runtime:ident), + runtimes($_current_runtime:ident, $($runtime_tl:tt)*), + selected_pallets($($selected_pallets:tt)*), - opal_pallets($($opal_pallets:tt)*), - quartz_pallets($($quartz_pallets:tt)*), - unique_pallets($($unique_pallets:tt)*), + where_clause($($where_clause:tt)*), + pallets($($pallets:tt)*) ) => { $crate::add_runtime_specific_pallets! { - runtime($runtime), - where_clause($($where_clause)*), - pallets( - $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, - $($pallets_tl)* - ), - + select_runtime($select_runtime), runtimes($($runtime_tl)*), + selected_pallets($($selected_pallets)*), - opal_pallets($($opal_pallets)*), - quartz_pallets($($quartz_pallets)*), - unique_pallets( - $($unique_pallets)* - $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, - ), + where_clause($($where_clause)*), + pallets($($pallets)*) } }; ( - runtime($runtime:ident), + select_runtime($select_runtime:ident), + runtimes(), + selected_pallets($($selected_pallets:tt)*), + where_clause($($where_clause:tt)*), pallets( $_pallet_name:ident: $_pallet_mod:ident::{$($_pallet_parts:ty),*} = $_index:literal, $($pallets_tl:tt)* - ), - - runtimes(), - - opal_pallets($($opal_pallets:tt)*), - quartz_pallets($($quartz_pallets:tt)*), - unique_pallets($($unique_pallets:tt)*), + ) ) => { $crate::construct_runtime_helper! { - runtime($runtime), - where_clause($($where_clause)*), - pallets($($pallets_tl)*), + select_runtime($select_runtime), + selected_pallets($($selected_pallets)*), - opal_pallets($($opal_pallets)*), - quartz_pallets($($quartz_pallets)*), - unique_pallets($($unique_pallets)*), + where_clause($($where_clause)*), + pallets($($pallets_tl)*) } }; } diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 40421bafb4..6b1d076782 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -1126,7 +1126,7 @@ impl pallet_evm_contract_helpers::Config for Runtime { type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; } -construct_runtime!(); +construct_runtime!(opal); pub struct TransactionConverter; diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index aedea05437..31a12e4e86 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -33,7 +33,7 @@ use fp_self_contained::*; #[cfg(feature = "scheduler")] use sp_runtime::{ - traits::Member, + traits::{Applyable, Member}, generic::Era, DispatchErrorWithPostInfo }; @@ -1137,7 +1137,7 @@ impl pallet_evm_contract_helpers::Config for Runtime { type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; } -construct_runtime!(); +construct_runtime!(quartz); pub struct TransactionConverter; diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index 84f7a3bd21..42fb99aad8 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -34,7 +34,7 @@ use fp_self_contained::*; #[cfg(feature = "scheduler")] use sp_runtime::{ - traits::Member, + traits::{Applyable, Member}, generic::Era, DispatchErrorWithPostInfo }; @@ -1139,7 +1139,7 @@ impl pallet_evm_contract_helpers::Config for Runtime { type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; } -construct_runtime!(); +construct_runtime!(unique); pub struct TransactionConverter; From fe18d26b2253badf5ae016b6c5cf298ae8133f11 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 2 Aug 2022 10:37:27 +0000 Subject: [PATCH 0274/1274] fix: unify opal with other runtimes --- runtime/opal/src/lib.rs | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 6b1d076782..2c4ecfa41c 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -28,13 +28,21 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160}; use sp_runtime::DispatchError; +#[cfg(feature = "scheduler")] use fp_self_contained::*; + +#[cfg(feature = "scheduler")] +use sp_runtime::{ + traits::{Applyable, Member}, + generic::Era, + DispatchErrorWithPostInfo +}; // #[cfg(any(feature = "std", test))] // pub use sp_runtime::BuildStorage; use sp_runtime::{ Permill, Perbill, Percent, create_runtime_str, generic, impl_opaque_keys, - traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion, Zero, Member}, + traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion, Zero}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, RuntimeAppPublic, }; @@ -69,7 +77,10 @@ pub use frame_support::{ WeightToFee, }, }; + +#[cfg(feature = "scheduler")] use pallet_unique_scheduler::DispatchCall; + use up_data_structs::{ CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits, CollectionStats, RpcCollection, @@ -89,17 +100,14 @@ use sp_arithmetic::{ traits::{BaseArithmetic, Unsigned}, }; use smallvec::smallvec; -// use scale_info::TypeInfo; use codec::{Encode, Decode}; use fp_rpc::TransactionStatus; use sp_runtime::{ traits::{ - Applyable, BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, + BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, Saturating, CheckedConversion, }, - generic::Era, - transaction_validity::TransactionValidityError, - DispatchErrorWithPostInfo, SaturatedConversion, + transaction_validity::TransactionValidityError, SaturatedConversion, }; // pub use pallet_timestamp::Call as TimestampCall; @@ -127,7 +135,6 @@ use xcm::latest::{ Error as XcmError, }; use xcm_executor::traits::{MatchesFungible, WeightTrader}; -//use xcm_executor::traits::MatchesFungible; use unique_runtime_common::{ construct_runtime, @@ -949,8 +956,11 @@ parameter_types! { } type ChargeTransactionPayment = pallet_charge_transaction::ChargeTransactionPayment; + +#[cfg(feature = "scheduler")] use frame_support::traits::NamedReservableCurrency; +#[cfg(feature = "scheduler")] fn get_signed_extras(from: ::AccountId) -> SignedExtraScheduler { ( frame_system::CheckSpecVersion::::new(), @@ -965,6 +975,7 @@ fn get_signed_extras(from: ::AccountId) -> Sign ) } +#[cfg(feature = "scheduler")] pub struct SchedulerPaymentExecutor; #[cfg(feature = "scheduler")] @@ -1089,7 +1100,6 @@ type EvmSponsorshipHandler = ( UniqueEthSponsorshipHandler, pallet_evm_contract_helpers::HelpersContractSponsoring, ); - type SponsorshipHandler = ( UniqueSponsorshipHandler, //pallet_contract_helpers::ContractSponsorshipHandler, From b544464f4ffd7aec03f96b140223b7881a54d962 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 3 Aug 2022 07:25:32 +0000 Subject: [PATCH 0275/1274] feat: tests requirePallets --- tests/src/rmrk/acceptNft.test.ts | 4 ++-- tests/src/rmrk/addResource.test.ts | 4 ++-- tests/src/rmrk/addTheme.test.ts | 4 ++-- tests/src/rmrk/burnNft.test.ts | 4 ++-- tests/src/rmrk/changeCollectionIssuer.test.ts | 4 ++-- tests/src/rmrk/createBase.test.ts | 4 ++-- tests/src/rmrk/createCollection.test.ts | 4 ++-- tests/src/rmrk/deleteCollection.test.ts | 4 ++-- tests/src/rmrk/equipNft.test.ts | 4 ++-- tests/src/rmrk/getOwnedNfts.test.ts | 4 ++-- tests/src/rmrk/lockCollection.test.ts | 4 ++-- tests/src/rmrk/mintNft.test.ts | 4 ++-- tests/src/rmrk/rejectNft.test.ts | 4 ++-- tests/src/rmrk/removeResource.test.ts | 4 ++-- tests/src/rmrk/rmrkIsolation.test.ts | 4 ++-- tests/src/rmrk/sendNft.test.ts | 4 ++-- tests/src/rmrk/setCollectionProperty.test.ts | 4 ++-- tests/src/rmrk/setEquippableList.test.ts | 4 ++-- tests/src/rmrk/setNftProperty.test.ts | 4 ++-- tests/src/rmrk/setResourcePriorities.test.ts | 4 ++-- tests/src/util/helpers.ts | 12 ++++++++++++ 21 files changed, 52 insertions(+), 40 deletions(-) diff --git a/tests/src/rmrk/acceptNft.test.ts b/tests/src/rmrk/acceptNft.test.ts index 69e88aeb45..1f4accbde6 100644 --- a/tests/src/rmrk/acceptNft.test.ts +++ b/tests/src/rmrk/acceptNft.test.ts @@ -8,13 +8,13 @@ import { } from './util/tx'; import {NftIdTuple} from './util/fetch'; import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; describe('integration test: accept NFT', () => { let api: any; before(async function() { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); diff --git a/tests/src/rmrk/addResource.test.ts b/tests/src/rmrk/addResource.test.ts index ffc91f22c0..c07286a149 100644 --- a/tests/src/rmrk/addResource.test.ts +++ b/tests/src/rmrk/addResource.test.ts @@ -12,7 +12,7 @@ import { addNftComposableResource, } from './util/tx'; import {RmrkTraitsResourceResourceInfo as ResourceInfo} from '@polkadot/types/lookup'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; describe('integration test: add NFT resource', () => { const Alice = '//Alice'; @@ -27,7 +27,7 @@ describe('integration test: add NFT resource', () => { let api: any; before(async function() { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); it('add resource', async () => { diff --git a/tests/src/rmrk/addTheme.test.ts b/tests/src/rmrk/addTheme.test.ts index 3151f4a714..1c8f40bae9 100644 --- a/tests/src/rmrk/addTheme.test.ts +++ b/tests/src/rmrk/addTheme.test.ts @@ -3,13 +3,13 @@ import {getApiConnection} from '../substrate/substrate-api'; import {createBase, addTheme} from './util/tx'; import {expectTxFailure} from './util/helpers'; import {getThemeNames} from './util/fetch'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; describe('integration test: add Theme to Base', () => { let api: any; before(async function() { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkEquip]); }); const alice = '//Alice'; diff --git a/tests/src/rmrk/burnNft.test.ts b/tests/src/rmrk/burnNft.test.ts index 92f6299e29..72ede614db 100644 --- a/tests/src/rmrk/burnNft.test.ts +++ b/tests/src/rmrk/burnNft.test.ts @@ -5,7 +5,7 @@ import {burnNft, createCollection, sendNft, mintNft} from './util/tx'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -17,7 +17,7 @@ describe('integration test: burn nft', () => { let api: any; before(async function() { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); diff --git a/tests/src/rmrk/changeCollectionIssuer.test.ts b/tests/src/rmrk/changeCollectionIssuer.test.ts index ca311dc60f..d2abcb8e08 100644 --- a/tests/src/rmrk/changeCollectionIssuer.test.ts +++ b/tests/src/rmrk/changeCollectionIssuer.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import { changeIssuer, @@ -13,7 +13,7 @@ describe('integration test: collection issuer', () => { let api: any; before(async function() { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); diff --git a/tests/src/rmrk/createBase.test.ts b/tests/src/rmrk/createBase.test.ts index 0ef8399fd0..bc9126336d 100644 --- a/tests/src/rmrk/createBase.test.ts +++ b/tests/src/rmrk/createBase.test.ts @@ -1,12 +1,12 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; import {createCollection, createBase} from './util/tx'; describe('integration test: create new Base', () => { let api: any; before(async function() { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore, Pallets.RmrkEquip]); }); const alice = '//Alice'; diff --git a/tests/src/rmrk/createCollection.test.ts b/tests/src/rmrk/createCollection.test.ts index ffcae90a95..f8ee29492b 100644 --- a/tests/src/rmrk/createCollection.test.ts +++ b/tests/src/rmrk/createCollection.test.ts @@ -1,12 +1,12 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {getModuleNames, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; import {createCollection} from './util/tx'; describe('Integration test: create new collection', () => { let api: any; before(async function () { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); diff --git a/tests/src/rmrk/deleteCollection.test.ts b/tests/src/rmrk/deleteCollection.test.ts index 92d79b1b17..8c8d7bbf44 100644 --- a/tests/src/rmrk/deleteCollection.test.ts +++ b/tests/src/rmrk/deleteCollection.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, deleteCollection} from './util/tx'; @@ -7,7 +7,7 @@ describe('integration test: delete collection', () => { let api: any; before(async function () { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); const Alice = '//Alice'; diff --git a/tests/src/rmrk/equipNft.test.ts b/tests/src/rmrk/equipNft.test.ts index d050ea43d3..0134bec58d 100644 --- a/tests/src/rmrk/equipNft.test.ts +++ b/tests/src/rmrk/equipNft.test.ts @@ -1,7 +1,7 @@ import {ApiPromise} from '@polkadot/api'; import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; -import {getModuleNames, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; import {getNft, getParts, NftIdTuple} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import { @@ -126,7 +126,7 @@ describe.skip('integration test: Equip NFT', () => { before(async function () { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore, Pallets.RmrkEquip]); }); it('equip nft', async () => { diff --git a/tests/src/rmrk/getOwnedNfts.test.ts b/tests/src/rmrk/getOwnedNfts.test.ts index c279197e7a..d352ddb3c0 100644 --- a/tests/src/rmrk/getOwnedNfts.test.ts +++ b/tests/src/rmrk/getOwnedNfts.test.ts @@ -1,6 +1,6 @@ import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; import {getOwnedNfts} from './util/fetch'; import {mintNft, createCollection} from './util/tx'; @@ -9,7 +9,7 @@ describe('integration test: get owned NFTs', () => { before(async function () { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); diff --git a/tests/src/rmrk/lockCollection.test.ts b/tests/src/rmrk/lockCollection.test.ts index d881ab1197..a24745a31d 100644 --- a/tests/src/rmrk/lockCollection.test.ts +++ b/tests/src/rmrk/lockCollection.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, lockCollection, mintNft} from './util/tx'; @@ -11,7 +11,7 @@ describe('integration test: lock collection', () => { let api: any; before(async function () { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); it('lock collection', async () => { diff --git a/tests/src/rmrk/mintNft.test.ts b/tests/src/rmrk/mintNft.test.ts index 53d10356db..2c900b31a7 100644 --- a/tests/src/rmrk/mintNft.test.ts +++ b/tests/src/rmrk/mintNft.test.ts @@ -1,6 +1,6 @@ import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; import {getNft} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import {createCollection, mintNft} from './util/tx'; @@ -10,7 +10,7 @@ describe('integration test: mint new NFT', () => { before(async function () { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); diff --git a/tests/src/rmrk/rejectNft.test.ts b/tests/src/rmrk/rejectNft.test.ts index 475c961d9b..34c61d1154 100644 --- a/tests/src/rmrk/rejectNft.test.ts +++ b/tests/src/rmrk/rejectNft.test.ts @@ -8,13 +8,13 @@ import { } from './util/tx'; import {getChildren, NftIdTuple} from './util/fetch'; import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; describe('integration test: reject NFT', () => { let api: any; before(async function () { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); diff --git a/tests/src/rmrk/removeResource.test.ts b/tests/src/rmrk/removeResource.test.ts index cdde0616a4..d0e4617b06 100644 --- a/tests/src/rmrk/removeResource.test.ts +++ b/tests/src/rmrk/removeResource.test.ts @@ -1,7 +1,7 @@ import {expect} from 'chai'; import privateKey from '../substrate/privateKey'; import {executeTransaction, getApiConnection} from '../substrate/substrate-api'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; import {getNft, NftIdTuple} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import { @@ -20,7 +20,7 @@ describe('Integration test: remove nft resource', () => { before(async function() { api = await getApiConnection(); ss58Format = api.registry.getChainProperties()!.toJSON().ss58Format; - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); const Alice = '//Alice'; diff --git a/tests/src/rmrk/rmrkIsolation.test.ts b/tests/src/rmrk/rmrkIsolation.test.ts index 8ac77b6006..c22838734c 100644 --- a/tests/src/rmrk/rmrkIsolation.test.ts +++ b/tests/src/rmrk/rmrkIsolation.test.ts @@ -6,7 +6,7 @@ import { getCreateCollectionResult, getDetailedCollectionInfo, getGenericResult, - getModuleNames, + requirePallets, normalizeAccountId, Pallets, } from '../util/helpers'; @@ -64,7 +64,7 @@ describe('RMRK External Integration Test', async () => { before(async function() { await usingApi(async (api, privateKeyWrapper) => { alice = privateKeyWrapper('//Alice'); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); }); diff --git a/tests/src/rmrk/sendNft.test.ts b/tests/src/rmrk/sendNft.test.ts index 5f1b03d22c..cc0b48633f 100644 --- a/tests/src/rmrk/sendNft.test.ts +++ b/tests/src/rmrk/sendNft.test.ts @@ -3,13 +3,13 @@ import {getApiConnection} from '../substrate/substrate-api'; import {createCollection, mintNft, sendNft} from './util/tx'; import {NftIdTuple} from './util/fetch'; import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; describe('integration test: send NFT', () => { let api: any; before(async function () { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); const maxNftId = 0xFFFFFFFF; diff --git a/tests/src/rmrk/setCollectionProperty.test.ts b/tests/src/rmrk/setCollectionProperty.test.ts index f2cca758ea..80969105a2 100644 --- a/tests/src/rmrk/setCollectionProperty.test.ts +++ b/tests/src/rmrk/setCollectionProperty.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, setPropertyCollection} from './util/tx'; @@ -10,7 +10,7 @@ describe('integration test: set collection property', () => { let api: any; before(async function () { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); it('set collection property', async () => { diff --git a/tests/src/rmrk/setEquippableList.test.ts b/tests/src/rmrk/setEquippableList.test.ts index a350908446..1c8ac045f0 100644 --- a/tests/src/rmrk/setEquippableList.test.ts +++ b/tests/src/rmrk/setEquippableList.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, createBase, setEquippableList} from './util/tx'; @@ -7,7 +7,7 @@ describe("integration test: set slot's Equippable List", () => { let api: any; before(async function () { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); const alice = '//Alice'; diff --git a/tests/src/rmrk/setNftProperty.test.ts b/tests/src/rmrk/setNftProperty.test.ts index 37a426f31c..cd1f28a1e8 100644 --- a/tests/src/rmrk/setNftProperty.test.ts +++ b/tests/src/rmrk/setNftProperty.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; import {NftIdTuple} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import {createCollection, mintNft, sendNft, setNftProperty} from './util/tx'; @@ -8,7 +8,7 @@ describe('integration test: set NFT property', () => { let api: any; before(async function () { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); const alice = '//Alice'; diff --git a/tests/src/rmrk/setResourcePriorities.test.ts b/tests/src/rmrk/setResourcePriorities.test.ts index b469fa3135..3809a7b893 100644 --- a/tests/src/rmrk/setResourcePriorities.test.ts +++ b/tests/src/rmrk/setResourcePriorities.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { getModuleNames, Pallets } from '../util/helpers'; +import { requirePallets, Pallets } from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import {mintNft, createCollection, setResourcePriorities} from './util/tx'; @@ -7,7 +7,7 @@ describe('integration test: set NFT resource priorities', () => { let api: any; before(async function () { api = await getApiConnection(); - if (!getModuleNames(api).includes(Pallets.RmrkCore)) this.skip(); + requirePallets(this, api, [Pallets.RmrkCore]); }); const alice = '//Alice'; diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index 180a3157ab..335e626d80 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -28,6 +28,7 @@ import {default as usingApi, executeTransaction, submitTransactionAsync, submitT import {hexToStr, strToUTF16, utf16ToStr} from './util'; import {UpDataStructsRpcCollection, UpDataStructsCreateItemData, UpDataStructsProperty} from '@polkadot/types/lookup'; import {UpDataStructsTokenChild} from '../interfaces'; +import { Context } from 'mocha'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -42,6 +43,7 @@ export type CrossAccountId = { export enum Pallets { Inflation = 'inflation', RmrkCore = 'rmrkcore', + RmrkEquip = 'rmrkequip', ReFungible = 'refungible', Fungible = 'fungible', NFT = 'nonfungible', @@ -70,6 +72,16 @@ export function getModuleNames(api: ApiPromise): string[] { return modulesNames; } +export function requirePallets(mocha: Context, api: ApiPromise, requiredPallets: string[]) { + const pallets = getModuleNames(api); + + const isAllPalletsPresent = requiredPallets.every(p => pallets.includes(p)); + + if (!isAllPalletsPresent) { + mocha.skip(); + } +} + export function normalizeAccountId(input: string | AccountId | CrossAccountId | IKeyringPair): CrossAccountId { if (typeof input === 'string') { if (input.length >= 47) { From 3b2d7676c4819ea0243441f05e3909ec565eec67 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 3 Aug 2022 07:27:51 +0000 Subject: [PATCH 0276/1274] cargo fmt --- runtime/common/src/lib.rs | 2 +- runtime/common/src/weights.rs | 1 - runtime/opal/src/lib.rs | 25 ++++++++++++------------- runtime/quartz/src/lib.rs | 25 ++++++++++++------------- runtime/unique/src/lib.rs | 21 ++++++++++----------- 5 files changed, 35 insertions(+), 39 deletions(-) diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 01725d3d10..06b50309bf 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -17,10 +17,10 @@ #![cfg_attr(not(feature = "std"), no_std)] pub mod constants; +pub mod construct_runtime; pub mod dispatch; pub mod eth_sponsoring; pub mod runtime_apis; pub mod sponsoring; pub mod types; pub mod weights; -pub mod construct_runtime; diff --git a/runtime/common/src/weights.rs b/runtime/common/src/weights.rs index af3199b8cf..730a54104d 100644 --- a/runtime/common/src/weights.rs +++ b/runtime/common/src/weights.rs @@ -51,7 +51,6 @@ pub trait CommonWeightConfigs: FungibleConfig + NonfungibleConfig + RefungibleCo #[cfg(feature = "refungible")] impl CommonWeightConfigs for T {} - pub struct CommonWeights(PhantomData); impl CommonWeightInfo for CommonWeights diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 2c4ecfa41c..7949cb2683 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -33,9 +33,9 @@ use fp_self_contained::*; #[cfg(feature = "scheduler")] use sp_runtime::{ - traits::{Applyable, Member}, - generic::Era, - DispatchErrorWithPostInfo + traits::{Applyable, Member}, + generic::Era, + DispatchErrorWithPostInfo, }; // #[cfg(any(feature = "std", test))] // pub use sp_runtime::BuildStorage; @@ -104,10 +104,11 @@ use codec::{Encode, Decode}; use fp_rpc::TransactionStatus; use sp_runtime::{ traits::{ - BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, - Saturating, CheckedConversion, + BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, Saturating, + CheckedConversion, }, - transaction_validity::TransactionValidityError, SaturatedConversion, + transaction_validity::TransactionValidityError, + SaturatedConversion, }; // pub use pallet_timestamp::Call as TimestampCall; @@ -118,11 +119,10 @@ use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*}; use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, - EnsureXcmOrigin, FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - ParentIsPreset, + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, + FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative, + SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ParentIsPreset, }; use xcm_executor::{Config, XcmExecutor, Assets}; use sp_std::{cmp::Ordering, marker::PhantomData}; @@ -137,8 +137,7 @@ use xcm::latest::{ use xcm_executor::traits::{MatchesFungible, WeightTrader}; use unique_runtime_common::{ - construct_runtime, - impl_common_runtime_apis, + construct_runtime, impl_common_runtime_apis, types::*, constants::*, dispatch::{CollectionDispatchT, CollectionDispatch}, diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index 31a12e4e86..f6f4430d99 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -33,9 +33,9 @@ use fp_self_contained::*; #[cfg(feature = "scheduler")] use sp_runtime::{ - traits::{Applyable, Member}, - generic::Era, - DispatchErrorWithPostInfo + traits::{Applyable, Member}, + generic::Era, + DispatchErrorWithPostInfo, }; // #[cfg(any(feature = "std", test))] // pub use sp_runtime::BuildStorage; @@ -104,10 +104,11 @@ use codec::{Encode, Decode}; use fp_rpc::TransactionStatus; use sp_runtime::{ traits::{ - BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, - Saturating, CheckedConversion, + BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, Saturating, + CheckedConversion, }, - transaction_validity::TransactionValidityError, SaturatedConversion, + transaction_validity::TransactionValidityError, + SaturatedConversion, }; // pub use pallet_timestamp::Call as TimestampCall; @@ -118,11 +119,10 @@ use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*}; use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, - EnsureXcmOrigin, FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - ParentIsPreset, + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, + FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative, + SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ParentIsPreset, }; use xcm_executor::{Config, XcmExecutor, Assets}; use sp_std::{cmp::Ordering, marker::PhantomData}; @@ -137,8 +137,7 @@ use xcm::latest::{ use xcm_executor::traits::{MatchesFungible, WeightTrader}; use unique_runtime_common::{ - construct_runtime, - impl_common_runtime_apis, + construct_runtime, impl_common_runtime_apis, types::*, constants::*, dispatch::{CollectionDispatchT, CollectionDispatch}, diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index 42fb99aad8..6e04cefb2d 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -36,7 +36,7 @@ use fp_self_contained::*; use sp_runtime::{ traits::{Applyable, Member}, generic::Era, - DispatchErrorWithPostInfo + DispatchErrorWithPostInfo, }; // #[cfg(any(feature = "std", test))] // pub use sp_runtime::BuildStorage; @@ -105,10 +105,11 @@ use codec::{Encode, Decode}; use fp_rpc::TransactionStatus; use sp_runtime::{ traits::{ - BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, - Saturating, CheckedConversion, + BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, Saturating, + CheckedConversion, }, - transaction_validity::TransactionValidityError, SaturatedConversion, + transaction_validity::TransactionValidityError, + SaturatedConversion, }; // pub use pallet_timestamp::Call as TimestampCall; @@ -119,11 +120,10 @@ use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*}; use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, - EnsureXcmOrigin, FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - ParentIsPreset, + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, + FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative, + SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ParentIsPreset, }; use xcm_executor::{Config, XcmExecutor, Assets}; use sp_std::{cmp::Ordering, marker::PhantomData}; @@ -138,8 +138,7 @@ use xcm::latest::{ use xcm_executor::traits::{MatchesFungible, WeightTrader}; use unique_runtime_common::{ - construct_runtime, - impl_common_runtime_apis, + construct_runtime, impl_common_runtime_apis, types::*, constants::*, dispatch::{CollectionDispatchT, CollectionDispatch}, From 20083dc5fef2b238b46546c0798b5e3003ba797e Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 3 Aug 2022 07:55:49 +0000 Subject: [PATCH 0277/1274] fix: use allow on whole impl --- runtime/common/src/runtime_apis.rs | 71 ++++-------------------------- 1 file changed, 9 insertions(+), 62 deletions(-) diff --git a/runtime/common/src/runtime_apis.rs b/runtime/common/src/runtime_apis.rs index 1ca2f86dd7..dfe295d9b0 100644 --- a/runtime/common/src/runtime_apis.rs +++ b/runtime/common/src/runtime_apis.rs @@ -154,6 +154,7 @@ macro_rules! impl_common_runtime_apis { } } + #[allow(unused_variables)] impl rmrk_rpc::RmrkApi< Block, AccountId, @@ -173,10 +174,7 @@ macro_rules! impl_common_runtime_apis { return Ok(Default::default()); } - fn collection_by_id( - #[allow(unused_variables)] - collection_id: RmrkCollectionId - ) -> Result>, DispatchError> { + fn collection_by_id(collection_id: RmrkCollectionId) -> Result>, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_core::rpc::collection_by_id::(collection_id); @@ -184,13 +182,7 @@ macro_rules! impl_common_runtime_apis { return Ok(Default::default()) } - fn nft_by_id( - #[allow(unused_variables)] - collection_id: RmrkCollectionId, - - #[allow(unused_variables)] - nft_by_id: RmrkNftId - ) -> Result>, DispatchError> { + fn nft_by_id(collection_id: RmrkCollectionId, nft_by_id: RmrkNftId) -> Result>, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_core::rpc::nft_by_id::(collection_id, nft_by_id); @@ -198,13 +190,7 @@ macro_rules! impl_common_runtime_apis { return Ok(Default::default()) } - fn account_tokens( - #[allow(unused_variables)] - account_id: AccountId, - - #[allow(unused_variables)] - collection_id: RmrkCollectionId - ) -> Result, DispatchError> { + fn account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Result, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_core::rpc::account_tokens::(account_id, collection_id); @@ -212,13 +198,7 @@ macro_rules! impl_common_runtime_apis { return Ok(Default::default()) } - fn nft_children( - #[allow(unused_variables)] - collection_id: RmrkCollectionId, - - #[allow(unused_variables)] - nft_id: RmrkNftId - ) -> Result, DispatchError> { + fn nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_core::rpc::nft_children::(collection_id, nft_id); @@ -227,10 +207,7 @@ macro_rules! impl_common_runtime_apis { } fn collection_properties( - #[allow(unused_variables)] collection_id: RmrkCollectionId, - - #[allow(unused_variables)] filter_keys: Option> ) -> Result, DispatchError> { #[cfg(feature = "rmrk")] @@ -241,13 +218,8 @@ macro_rules! impl_common_runtime_apis { } fn nft_properties( - #[allow(unused_variables)] collection_id: RmrkCollectionId, - - #[allow(unused_variables)] nft_id: RmrkNftId, - - #[allow(unused_variables)] filter_keys: Option> ) -> Result, DispatchError> { #[cfg(feature = "rmrk")] @@ -257,13 +229,7 @@ macro_rules! impl_common_runtime_apis { return Ok(Default::default()) } - fn nft_resources( - #[allow(unused_variables)] - collection_id: RmrkCollectionId, - - #[allow(unused_variables)] - nft_id: RmrkNftId - ) -> Result, DispatchError> { + fn nft_resources(collection_id: RmrkCollectionId,nft_id: RmrkNftId) -> Result, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_core::rpc::nft_resources::(collection_id, nft_id); @@ -272,13 +238,8 @@ macro_rules! impl_common_runtime_apis { } fn nft_resource_priority( - #[allow(unused_variables)] collection_id: RmrkCollectionId, - - #[allow(unused_variables)] nft_id: RmrkNftId, - - #[allow(unused_variables)] resource_id: RmrkResourceId ) -> Result, DispatchError> { #[cfg(feature = "rmrk")] @@ -288,10 +249,7 @@ macro_rules! impl_common_runtime_apis { return Ok(Default::default()) } - fn base( - #[allow(unused_variables)] - base_id: RmrkBaseId - ) -> Result>, DispatchError> { + fn base(base_id: RmrkBaseId) -> Result>, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_equip::rpc::base::(base_id); @@ -299,10 +257,7 @@ macro_rules! impl_common_runtime_apis { return Ok(Default::default()) } - fn base_parts( - #[allow(unused_variables)] - base_id: RmrkBaseId - ) -> Result, DispatchError> { + fn base_parts(base_id: RmrkBaseId) -> Result, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_equip::rpc::base_parts::(base_id); @@ -310,10 +265,7 @@ macro_rules! impl_common_runtime_apis { return Ok(Default::default()) } - fn theme_names( - #[allow(unused_variables)] - base_id: RmrkBaseId - ) -> Result, DispatchError> { + fn theme_names(base_id: RmrkBaseId) -> Result, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_equip::rpc::theme_names::(base_id); @@ -322,13 +274,8 @@ macro_rules! impl_common_runtime_apis { } fn theme( - #[allow(unused_variables)] base_id: RmrkBaseId, - - #[allow(unused_variables)] theme_name: RmrkThemeName, - - #[allow(unused_variables)] filter_keys: Option> ) -> Result, DispatchError> { #[cfg(feature = "rmrk")] From 5900bfd2d2db020034463899a2effe7adc8cefd0 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 8 Aug 2022 15:24:33 +0000 Subject: [PATCH 0278/1274] refactor: imporve runtime separation --- client/rpc/Cargo.toml | 1 - common-types/Cargo.toml | 50 + .../src/types.rs => common-types/src/lib.rs | 60 +- node/cli/Cargo.toml | 5 +- node/cli/src/chain_spec.rs | 2 +- node/cli/src/command.rs | 2 +- node/cli/src/service.rs | 2 +- node/rpc/Cargo.toml | 2 +- node/rpc/src/lib.rs | 3 +- runtime/common/Cargo.toml | 121 -- runtime/common/config/ethereum.rs | 140 ++ runtime/common/config/mod.rs | 33 + runtime/common/config/orml.rs | 38 + runtime/common/config/pallets/mod.rs | 100 ++ runtime/common/config/pallets/rmrk.rs | 27 + runtime/common/config/pallets/scheduler.rs | 66 + runtime/common/config/parachain.rs | 52 + runtime/common/config/sponsoring.rs | 38 + runtime/common/config/substrate.rs | 250 ++++ runtime/common/config/xcm.rs | 308 ++++ runtime/common/{src => }/constants.rs | 4 +- .../common/{src => }/construct_runtime/mod.rs | 16 + .../{src => }/construct_runtime/util.rs | 16 + runtime/common/{src => }/dispatch.rs | 0 .../common/{src/lib.rs => ethereum/mod.rs} | 17 +- .../common/ethereum/self_contained_call.rs | 74 + .../sponsoring.rs} | 10 +- .../common/ethereum/transaction_converter.rs | 46 + runtime/common/instance.rs | 17 + runtime/common/mod.rs | 171 +++ runtime/common/{src => }/runtime_apis.rs | 36 +- runtime/common/scheduler.rs | 144 ++ runtime/common/{src => }/sponsoring.rs | 0 runtime/common/{src => }/weights.rs | 0 runtime/opal/Cargo.toml | 10 +- runtime/opal/src/lib.rs | 1246 +---------------- runtime/tests/Cargo.toml | 5 +- runtime/tests/src/lib.rs | 11 +- 38 files changed, 1709 insertions(+), 1414 deletions(-) create mode 100644 common-types/Cargo.toml rename runtime/common/src/types.rs => common-types/src/lib.rs (57%) delete mode 100644 runtime/common/Cargo.toml create mode 100644 runtime/common/config/ethereum.rs create mode 100644 runtime/common/config/mod.rs create mode 100644 runtime/common/config/orml.rs create mode 100644 runtime/common/config/pallets/mod.rs create mode 100644 runtime/common/config/pallets/rmrk.rs create mode 100644 runtime/common/config/pallets/scheduler.rs create mode 100644 runtime/common/config/parachain.rs create mode 100644 runtime/common/config/sponsoring.rs create mode 100644 runtime/common/config/substrate.rs create mode 100644 runtime/common/config/xcm.rs rename runtime/common/{src => }/constants.rs (95%) rename runtime/common/{src => }/construct_runtime/mod.rs (83%) rename runtime/common/{src => }/construct_runtime/util.rs (88%) rename runtime/common/{src => }/dispatch.rs (100%) rename runtime/common/{src/lib.rs => ethereum/mod.rs} (80%) create mode 100644 runtime/common/ethereum/self_contained_call.rs rename runtime/common/{src/eth_sponsoring.rs => ethereum/sponsoring.rs} (95%) create mode 100644 runtime/common/ethereum/transaction_converter.rs create mode 100644 runtime/common/instance.rs create mode 100644 runtime/common/mod.rs rename runtime/common/{src => }/runtime_apis.rs (96%) create mode 100644 runtime/common/scheduler.rs rename runtime/common/{src => }/sponsoring.rs (100%) rename runtime/common/{src => }/weights.rs (100%) diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index fff98b91ae..9cefa070fd 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -5,7 +5,6 @@ license = "GPLv3" edition = "2021" [dependencies] -unique-runtime-common = { default-features = false, path = "../../runtime/common" } pallet-common = { default-features = false, path = '../../pallets/common' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } up-rpc = { path = "../../primitives/rpc" } diff --git a/common-types/Cargo.toml b/common-types/Cargo.toml new file mode 100644 index 0000000000..3c473b542d --- /dev/null +++ b/common-types/Cargo.toml @@ -0,0 +1,50 @@ +[package] +authors = ['Unique Network '] +description = 'Unique Runtime Common' +edition = '2021' +homepage = 'https://unique.network' +license = 'All Rights Reserved' +name = 'common-types' +repository = 'https://github.com/UniqueNetwork/unique-chain' +version = '0.9.24' + +[features] +default = ['std'] +std = [ + 'sp-std/std', + 'sp-runtime/std', + 'sp-core/std', + 'sp-consensus-aura/std', + 'fp-rpc/std', + 'pallet-evm/std', +] + +[dependencies.sp-std] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.sp-runtime] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.sp-core] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.sp-consensus-aura] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.fp-rpc] +default-features = false +git = "https://github.com/uniquenetwork/frontier" +branch = "unique-polkadot-v0.9.24" + +[dependencies.pallet-evm] +default-features = false +git = "https://github.com/uniquenetwork/frontier" +branch = "unique-polkadot-v0.9.24" diff --git a/runtime/common/src/types.rs b/common-types/src/lib.rs similarity index 57% rename from runtime/common/src/types.rs rename to common-types/src/lib.rs index f3241515ac..25e515144c 100644 --- a/runtime/common/src/types.rs +++ b/common-types/src/lib.rs @@ -14,18 +14,46 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +#![cfg_attr(not(feature = "std"), no_std)] + use sp_runtime::{ - traits::{Verify, IdentifyAccount, BlakeTwo256}, - generic, MultiSignature, + generic, + traits::{Verify, IdentifyAccount}, MultiSignature, }; -pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; - -/// Opaque block header type. -pub type Header = generic::Header; - -/// Opaque block type. -pub type Block = generic::Block; +/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know +/// the specifics of the runtime. They can then be made to be agnostic over specific formats +/// of data like extrinsics, allowing for them to continue syncing the network through upgrades +/// to even the core data structures. +pub mod opaque { + pub use sp_runtime::{ + generic, + traits::BlakeTwo256, + OpaqueExtrinsic as UncheckedExtrinsic + }; + + pub use super::{BlockNumber, Signature, AccountId, Balance, Index, Hash, AuraId}; + + /// Opaque block header type. + pub type Header = generic::Header; + + /// Opaque block type. + pub type Block = generic::Block; + + pub trait RuntimeInstance { + type CrossAccountId: pallet_evm::account::CrossAccountId + + Send + + Sync + + 'static; + + type TransactionConverter: fp_rpc::ConvertTransaction + + Send + + Sync + + 'static; + + fn get_transaction_converter() -> Self::TransactionConverter; + } +} pub type SessionHandlers = (); @@ -56,17 +84,3 @@ pub type Hash = sp_core::H256; pub type DigestItem = generic::DigestItem; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; - -pub trait RuntimeInstance { - type CrossAccountId: pallet_evm::account::CrossAccountId - + Send - + Sync - + 'static; - - type TransactionConverter: fp_rpc::ConvertTransaction - + Send - + Sync - + 'static; - - fn get_transaction_converter() -> Self::TransactionConverter; -} diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 5ce0c10616..17b0de635a 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -253,9 +253,8 @@ branch = "release-v0.9.24" ################################################################################ # Local dependencies -[dependencies.unique-runtime-common] -default-features = false -path = "../../runtime/common" +[dependencies.common-types] +path = "../../common-types" [dependencies.unique-runtime] path = '../../runtime/unique' diff --git a/node/cli/src/chain_spec.rs b/node/cli/src/chain_spec.rs index a4bb925fe2..23b4602af8 100644 --- a/node/cli/src/chain_spec.rs +++ b/node/cli/src/chain_spec.rs @@ -23,7 +23,7 @@ use std::collections::BTreeMap; use serde::{Deserialize, Serialize}; use serde_json::map::Map; -use unique_runtime_common::types::*; +use common_types::opaque::*; #[cfg(feature = "unique-runtime")] pub use unique_runtime as default_runtime; diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index 3b494ef4e0..fa68eb1df5 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -64,7 +64,7 @@ use sp_core::hexdisplay::HexDisplay; use sp_runtime::traits::{AccountIdConversion, Block as BlockT}; use std::{io::Write, net::SocketAddr, time::Duration}; -use unique_runtime_common::types::Block; +use common_types::opaque::Block; macro_rules! no_runtime_err { ($chain_name:expr) => { diff --git a/node/cli/src/service.rs b/node/cli/src/service.rs index 708e749fe5..c9ab806bbe 100644 --- a/node/cli/src/service.rs +++ b/node/cli/src/service.rs @@ -63,7 +63,7 @@ use polkadot_service::CollatorPair; use fc_rpc_core::types::FilterPool; use fc_mapping_sync::{MappingSyncWorker, SyncStrategy}; -use unique_runtime_common::types::{AuraId, RuntimeInstance, AccountId, Balance, Index, Hash, Block}; +use common_types::opaque::{AuraId, RuntimeInstance, AccountId, Balance, Index, Hash, Block}; // RMRK use up_data_structs::{ diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index f567c6b070..76f161c6ba 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -49,7 +49,7 @@ fc-db = { default-features = false, git = "https://github.com/uniquenetwork/fron fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } pallet-common = { default-features = false, path = "../../pallets/common" } -unique-runtime-common = { default-features = false, path = "../../runtime/common" } +common-types = { path = "../../common-types" } pallet-unique = { path = "../../pallets/unique" } uc-rpc = { path = "../../client/rpc" } up-rpc = { path = "../../primitives/rpc" } diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index 50ec266198..a3126b2451 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -40,9 +40,10 @@ use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; use sc_service::TransactionPool; use std::{collections::BTreeMap, sync::Arc}; -use unique_runtime_common::types::{ +use common_types::opaque::{ Hash, AccountId, RuntimeInstance, Index, Block, BlockNumber, Balance, }; + // RMRK use up_data_structs::{ RmrkCollectionInfo, RmrkInstanceInfo, RmrkResourceInfo, RmrkPropertyInfo, RmrkBaseInfo, diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml deleted file mode 100644 index cae1129f7b..0000000000 --- a/runtime/common/Cargo.toml +++ /dev/null @@ -1,121 +0,0 @@ -[package] -authors = ['Unique Network '] -description = 'Unique Runtime Common' -edition = '2021' -homepage = 'https://unique.network' -license = 'All Rights Reserved' -name = 'unique-runtime-common' -repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.9.24' - -[features] -default = ['std'] -std = [ - 'sp-core/std', - 'sp-std/std', - 'sp-runtime/std', - 'codec/std', - 'frame-support/std', - 'frame-system/std', - 'sp-consensus-aura/std', - 'pallet-common/std', - 'pallet-unique/std', - 'pallet-fungible/std', - 'pallet-nonfungible/std', - 'pallet-refungible/std', - 'up-data-structs/std', - 'pallet-evm/std', - 'fp-rpc/std', -] -runtime-benchmarks = [ - 'sp-runtime/runtime-benchmarks', - 'frame-support/runtime-benchmarks', - 'frame-system/runtime-benchmarks', -] - -opal-runtime = [] -quartz-runtime = [] -unique-runtime = [] - -refungible = [] - -[dependencies.sp-core] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" - -[dependencies.sp-std] -default-features = false -git = 'https://github.com/paritytech/substrate' -branch = 'polkadot-v0.9.24' - -[dependencies.sp-runtime] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" - -[dependencies.codec] -default-features = false -features = ['derive'] -package = 'parity-scale-codec' -version = '3.1.2' - -[dependencies.scale-info] -default-features = false -features = ["derive"] -version = "2.0.1" - -[dependencies.frame-support] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" - -[dependencies.frame-system] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" - -[dependencies.pallet-common] -default-features = false -path = "../../pallets/common" - -[dependencies.pallet-unique] -default-features = false -path = "../../pallets/unique" - -[dependencies.pallet-fungible] -default-features = false -path = "../../pallets/fungible" - -[dependencies.pallet-nonfungible] -default-features = false -path = "../../pallets/nonfungible" - -[dependencies.pallet-refungible] -default-features = false -path = "../../pallets/refungible" - -[dependencies.pallet-unique-scheduler] -default-features = false -path = "../../pallets/scheduler" - -[dependencies.up-data-structs] -default-features = false -path = "../../primitives/data-structs" - -[dependencies.sp-consensus-aura] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" - -[dependencies.fp-rpc] -default-features = false -git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.24" - -[dependencies] -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/UniqueNetwork/pallet-sponsoring", branch = 'polkadot-v0.9.24' } - -rmrk-rpc = { default-features = false, path = "../../primitives/rmrk-rpc" } diff --git a/runtime/common/config/ethereum.rs b/runtime/common/config/ethereum.rs new file mode 100644 index 0000000000..52692b959d --- /dev/null +++ b/runtime/common/config/ethereum.rs @@ -0,0 +1,140 @@ +use sp_core::{U256, H160}; +use frame_support::{ + weights::{Weight, constants::WEIGHT_PER_SECOND}, + traits::{FindAuthor}, + parameter_types, ConsensusEngineId, +}; +use sp_runtime::{RuntimeAppPublic, Perbill}; +use crate::{ + runtime_common::{ + constants::*, + dispatch::CollectionDispatchT, + ethereum::{EvmSponsorshipHandler}, + config::sponsoring::DefaultSponsoringRateLimit, + DealWithFees, + }, + Runtime, + Aura, + Balances, + Event, + ChainId, +}; +use pallet_evm::{ + EnsureAddressTruncated, + HashedAddressMapping, +}; + +pub type CrossAccountId = pallet_evm::account::BasicCrossAccountId; + +impl pallet_evm::account::Config for Runtime { + type CrossAccountId = CrossAccountId; + type EvmAddressMapping = pallet_evm::HashedAddressMapping; + type EvmBackwardsAddressMapping = fp_evm_mapping::MapBackwardsAddressTruncated; +} + +// Assuming slowest ethereum opcode is SSTORE, with gas price of 20000 as our worst case +// (contract, which only writes a lot of data), +// approximating on top of our real store write weight +parameter_types! { + pub const WritesPerSecond: u64 = WEIGHT_PER_SECOND / ::DbWeight::get().write; + pub const GasPerSecond: u64 = WritesPerSecond::get() * 20000; + pub const WeightPerGas: u64 = WEIGHT_PER_SECOND / GasPerSecond::get(); +} + +/// Limiting EVM execution to 50% of block for substrate users and management tasks +/// EVM transaction consumes more weight than substrate's, so we can't rely on them being +/// scheduled fairly +const EVM_DISPATCH_RATIO: Perbill = Perbill::from_percent(50); +parameter_types! { + pub BlockGasLimit: U256 = U256::from(NORMAL_DISPATCH_RATIO * EVM_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT / WeightPerGas::get()); +} + +pub enum FixedGasWeightMapping {} +impl pallet_evm::GasWeightMapping for FixedGasWeightMapping { + fn gas_to_weight(gas: u64) -> Weight { + gas.saturating_mul(WeightPerGas::get()) + } + fn weight_to_gas(weight: Weight) -> u64 { + weight / WeightPerGas::get() + } +} + +pub struct FixedFee; +impl pallet_evm::FeeCalculator for FixedFee { + fn min_gas_price() -> (U256, u64) { + (MIN_GAS_PRICE.into(), 0) + } +} + +pub struct EthereumFindAuthor(core::marker::PhantomData); +impl> FindAuthor for EthereumFindAuthor { + fn find_author<'a, I>(digests: I) -> Option + where + I: 'a + IntoIterator, + { + if let Some(author_index) = F::find_author(digests) { + let authority_id = Aura::authorities()[author_index as usize].clone(); + return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24])); + } + None + } +} + +impl pallet_evm::Config for Runtime { + type BlockGasLimit = BlockGasLimit; + type FeeCalculator = FixedFee; + type GasWeightMapping = FixedGasWeightMapping; + type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping; + type CallOrigin = EnsureAddressTruncated; + type WithdrawOrigin = EnsureAddressTruncated; + type AddressMapping = HashedAddressMapping; + type PrecompilesType = (); + type PrecompilesValue = (); + type Currency = Balances; + type Event = Event; + type OnMethodCall = ( + pallet_evm_migration::OnMethodCall, + pallet_evm_contract_helpers::HelpersOnMethodCall, + CollectionDispatchT, + pallet_unique::eth::CollectionHelpersOnMethodCall, + ); + type OnCreate = pallet_evm_contract_helpers::HelpersOnCreate; + type ChainId = ChainId; + type Runner = pallet_evm::runner::stack::Runner; + type OnChargeTransaction = pallet_evm::EVMCurrencyAdapter; + type TransactionValidityHack = pallet_evm_transaction_payment::TransactionValidityHack; + type FindAuthor = EthereumFindAuthor; +} + +impl pallet_evm_migration::Config for Runtime { + type WeightInfo = pallet_evm_migration::weights::SubstrateWeight; +} + +impl pallet_ethereum::Config for Runtime { + type Event = Event; + type StateRoot = pallet_ethereum::IntermediateStateRoot; +} + +parameter_types! { + // 0x842899ECF380553E8a4de75bF534cdf6fBF64049 + pub const HelpersContractAddress: H160 = H160([ + 0x84, 0x28, 0x99, 0xec, 0xf3, 0x80, 0x55, 0x3e, 0x8a, 0x4d, 0xe7, 0x5b, 0xf5, 0x34, 0xcd, 0xf6, 0xfb, 0xf6, 0x40, 0x49, + ]); + + // 0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f + pub const EvmCollectionHelpersAddress: H160 = H160([ + 0x6c, 0x4e, 0x9f, 0xe1, 0xae, 0x37, 0xa4, 0x1e, 0x93, 0xce, 0xe4, 0x29, 0xe8, 0xe1, 0x88, 0x1a, 0xbd, 0xcb, 0xb5, 0x4f, + ]); +} + +impl pallet_evm_contract_helpers::Config for Runtime { + type ContractAddress = HelpersContractAddress; + type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; +} + +impl pallet_evm_coder_substrate::Config for Runtime {} + +impl pallet_evm_transaction_payment::Config for Runtime { + type EvmSponsorshipHandler = EvmSponsorshipHandler; + type Currency = Balances; +} diff --git a/runtime/common/config/mod.rs b/runtime/common/config/mod.rs new file mode 100644 index 0000000000..b03b85bdaa --- /dev/null +++ b/runtime/common/config/mod.rs @@ -0,0 +1,33 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +pub mod substrate; +pub mod ethereum; +pub mod sponsoring; +pub mod pallets; +pub mod parachain; +pub mod xcm; +pub mod orml; + +pub use { + substrate::*, + ethereum::*, + sponsoring::*, + pallets::*, + parachain::*, + self::xcm::*, + orml::*, +}; diff --git a/runtime/common/config/orml.rs b/runtime/common/config/orml.rs new file mode 100644 index 0000000000..f8e951de71 --- /dev/null +++ b/runtime/common/config/orml.rs @@ -0,0 +1,38 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use frame_support::parameter_types; +use frame_system::EnsureSigned; +use crate::{ + runtime_common::constants::*, + Runtime, Event, RelayChainBlockNumberProvider, +}; +use common_types::{AccountId, Balance}; + +parameter_types! { + pub const MinVestedTransfer: Balance = 10 * UNIQUE; + pub const MaxVestingSchedules: u32 = 28; +} + +impl orml_vesting::Config for Runtime { + type Event = Event; + type Currency = pallet_balances::Pallet; + type MinVestedTransfer = MinVestedTransfer; + type VestedTransferOrigin = EnsureSigned; + type WeightInfo = (); + type MaxVestingSchedules = MaxVestingSchedules; + type BlockNumberProvider = RelayChainBlockNumberProvider; +} diff --git a/runtime/common/config/pallets/mod.rs b/runtime/common/config/pallets/mod.rs new file mode 100644 index 0000000000..76421b72c5 --- /dev/null +++ b/runtime/common/config/pallets/mod.rs @@ -0,0 +1,100 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use frame_support::{ + // weights::{Weight, constants::WEIGHT_PER_SECOND}, + parameter_types, +}; +use sp_runtime::traits::AccountIdConversion; +use crate::{ + runtime_common::{ + constants::*, + dispatch::CollectionDispatchT, + config::{ + substrate::TreasuryModuleId, + ethereum::EvmCollectionHelpersAddress, + }, + weights::CommonWeights, + RelayChainBlockNumberProvider, + }, + Runtime, + Event, + Call, + Balances, +}; +use common_types::{AccountId, Balance, BlockNumber}; +use up_data_structs::{ + mapping::{EvmTokenAddressMapping, CrossTokenAddressMapping}, +}; + +#[cfg(feature = "rmrk")] +pub mod rmrk; + +#[cfg(feature = "scheduler")] +pub mod scheduler; + +parameter_types! { + pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account_truncating(); + pub const CollectionCreationPrice: Balance = 2 * UNIQUE; +} + +impl pallet_common::Config for Runtime { + type WeightInfo = pallet_common::weights::SubstrateWeight; + type Event = Event; + type Currency = Balances; + type CollectionCreationPrice = CollectionCreationPrice; + type TreasuryAccountId = TreasuryAccountId; + type CollectionDispatch = CollectionDispatchT; + + type EvmTokenAddressMapping = EvmTokenAddressMapping; + type CrossTokenAddressMapping = CrossTokenAddressMapping; + type ContractAddress = EvmCollectionHelpersAddress; +} + +impl pallet_structure::Config for Runtime { + type Event = Event; + type Call = Call; + type WeightInfo = pallet_structure::weights::SubstrateWeight; +} + +impl pallet_fungible::Config for Runtime { + type WeightInfo = pallet_fungible::weights::SubstrateWeight; +} +impl pallet_refungible::Config for Runtime { + type WeightInfo = pallet_refungible::weights::SubstrateWeight; +} +impl pallet_nonfungible::Config for Runtime { + type WeightInfo = pallet_nonfungible::weights::SubstrateWeight; +} + +parameter_types! { + pub const InflationBlockInterval: BlockNumber = 100; // every time per how many blocks inflation is applied +} + +/// Used for the pallet inflation +impl pallet_inflation::Config for Runtime { + type Currency = Balances; + type TreasuryAccountId = TreasuryAccountId; + type InflationBlockInterval = InflationBlockInterval; + type BlockNumberProvider = RelayChainBlockNumberProvider; +} + +impl pallet_unique::Config for Runtime { + type Event = Event; + type WeightInfo = pallet_unique::weights::SubstrateWeight; + type CommonWeightInfo = CommonWeights; + type RefungibleExtensionsWeightInfo = CommonWeights; +} diff --git a/runtime/common/config/pallets/rmrk.rs b/runtime/common/config/pallets/rmrk.rs new file mode 100644 index 0000000000..4fe0740cf6 --- /dev/null +++ b/runtime/common/config/pallets/rmrk.rs @@ -0,0 +1,27 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use crate::{Runtime, Event}; + +impl pallet_proxy_rmrk_core::Config for Runtime { + type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight; + type Event = Event; +} + +impl pallet_proxy_rmrk_equip::Config for Runtime { + type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight; + type Event = Event; +} diff --git a/runtime/common/config/pallets/scheduler.rs b/runtime/common/config/pallets/scheduler.rs new file mode 100644 index 0000000000..f49c51d5c7 --- /dev/null +++ b/runtime/common/config/pallets/scheduler.rs @@ -0,0 +1,66 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use frame_support::{ + traits::PrivilegeCmp, + weights::Weight, + parameter_types +}; +use frame_system::EnsureSigned; +use sp_runtime::Perbill; +use sp_std::cmp::Ordering; +use crate::{ + runtime_common::{ + scheduler::SchedulerPaymentExecutor, + config::substrate::RuntimeBlockWeights, + }, + Runtime, Call, Event, Origin, OriginCaller, Balances +}; +use common_types::AccountId; + +parameter_types! { + pub MaximumSchedulerWeight: Weight = Perbill::from_percent(50) * + RuntimeBlockWeights::get().max_block; + pub const MaxScheduledPerBlock: u32 = 50; + + pub const NoPreimagePostponement: Option = Some(10); + pub const Preimage: Option = Some(10); +} + +/// Used the compare the privilege of an origin inside the scheduler. +pub struct OriginPrivilegeCmp; + +impl PrivilegeCmp for OriginPrivilegeCmp { + fn cmp_privilege(_left: &OriginCaller, _right: &OriginCaller) -> Option { + Some(Ordering::Equal) + } +} + +impl pallet_unique_scheduler::Config for Runtime { + type Event = Event; + type Origin = Origin; + type Currency = Balances; + type PalletsOrigin = OriginCaller; + type Call = Call; + type MaximumWeight = MaximumSchedulerWeight; + type ScheduleOrigin = EnsureSigned; + type MaxScheduledPerBlock = MaxScheduledPerBlock; + type WeightInfo = (); + type CallExecutor = SchedulerPaymentExecutor; + type OriginPrivilegeCmp = OriginPrivilegeCmp; + type PreimageProvider = (); + type NoPreimagePostponement = NoPreimagePostponement; +} diff --git a/runtime/common/config/parachain.rs b/runtime/common/config/parachain.rs new file mode 100644 index 0000000000..28a33dce4e --- /dev/null +++ b/runtime/common/config/parachain.rs @@ -0,0 +1,52 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use frame_support::{ + weights::Weight, + parameter_types, +}; +use crate::{ + runtime_common::constants::*, + Runtime, + Event, + XcmpQueue, + DmpQueue, +}; + +parameter_types! { + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; +} + +impl cumulus_pallet_parachain_system::Config for Runtime { + type Event = Event; + type SelfParaId = parachain_info::Pallet; + type OnSystemEvent = (); + // type DownwardMessageHandlers = cumulus_primitives_utility::UnqueuedDmpAsParent< + // MaxDownwardMessageWeight, + // XcmExecutor, + // Call, + // >; + type OutboundXcmpMessageSource = XcmpQueue; + type DmpMessageHandler = DmpQueue; + type ReservedDmpWeight = ReservedDmpWeight; + type ReservedXcmpWeight = ReservedXcmpWeight; + type XcmpMessageHandler = XcmpQueue; +} + +impl parachain_info::Config for Runtime {} + +impl cumulus_pallet_aura_ext::Config for Runtime {} diff --git a/runtime/common/config/sponsoring.rs b/runtime/common/config/sponsoring.rs new file mode 100644 index 0000000000..416fe31d6b --- /dev/null +++ b/runtime/common/config/sponsoring.rs @@ -0,0 +1,38 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use frame_support::parameter_types; +use crate::{ + runtime_common::{ + constants::*, + sponsoring::UniqueSponsorshipHandler, + }, + Runtime, +}; +use common_types::BlockNumber; + +parameter_types! { + pub const DefaultSponsoringRateLimit: BlockNumber = 1 * DAYS; +} + +type SponsorshipHandler = ( + UniqueSponsorshipHandler, + pallet_evm_transaction_payment::BridgeSponsorshipHandler, +); + +impl pallet_charge_transaction::Config for Runtime { + type SponsorshipHandler = SponsorshipHandler; +} diff --git a/runtime/common/config/substrate.rs b/runtime/common/config/substrate.rs new file mode 100644 index 0000000000..9fc8871d03 --- /dev/null +++ b/runtime/common/config/substrate.rs @@ -0,0 +1,250 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use frame_support::{ + traits::{Everything, ConstU32}, + weights::{ + constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}, + DispatchClass, WeightToFeePolynomial, WeightToFeeCoefficients, + ConstantMultiplier, WeightToFeeCoefficient, + }, + parameter_types, + PalletId, +}; +use sp_runtime::{ + generic, + traits::{BlakeTwo256, AccountIdLookup}, + Perbill, Permill, Percent, +}; +use frame_system::{ + limits::{BlockLength, BlockWeights}, + EnsureRoot, +}; +use sp_arithmetic::traits::{BaseArithmetic, Unsigned}; +use smallvec::smallvec; +use crate::{ + runtime_common::{ + DealWithFees, + constants::*, + }, + Runtime, + Event, + Call, + Origin, + PalletInfo, + System, + Balances, + Treasury, + SS58Prefix, + Version, +}; +use common_types::*; + +parameter_types! { + pub const BlockHashCount: BlockNumber = 2400; + pub RuntimeBlockLength: BlockLength = + BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); + pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); + pub const MaximumBlockLength: u32 = 5 * 1024 * 1024; + pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() + .base_block(BlockExecutionWeight::get()) + .for_class(DispatchClass::all(), |weights| { + weights.base_extrinsic = ExtrinsicBaseWeight::get(); + }) + .for_class(DispatchClass::Normal, |weights| { + weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); + }) + .for_class(DispatchClass::Operational, |weights| { + weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); + // Operational transactions have some extra reserved space, so that they + // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. + weights.reserved = Some( + MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT + ); + }) + .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) + .build_or_panic(); +} + +impl frame_system::Config for Runtime { + /// The data to be stored in an account. + type AccountData = pallet_balances::AccountData; + /// The identifier used to distinguish between accounts. + type AccountId = AccountId; + /// The basic call filter to use in dispatchable. + type BaseCallFilter = Everything; + /// Maximum number of block number to block hash mappings to keep (oldest pruned first). + type BlockHashCount = BlockHashCount; + /// The maximum length of a block (in bytes). + type BlockLength = RuntimeBlockLength; + /// The index type for blocks. + type BlockNumber = BlockNumber; + /// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block. + type BlockWeights = RuntimeBlockWeights; + /// The aggregated dispatch type that is available for extrinsics. + type Call = Call; + /// The weight of database operations that the runtime can invoke. + type DbWeight = RocksDbWeight; + /// The ubiquitous event type. + type Event = Event; + /// The type for hashing blocks and tries. + type Hash = Hash; + /// The hashing algorithm used. + type Hashing = BlakeTwo256; + /// The header type. + type Header = generic::Header; + /// The index type for storing how many extrinsics an account has signed. + type Index = Index; + /// The lookup mechanism to get account ID from whatever is passed in dispatchers. + type Lookup = AccountIdLookup; + /// What to do if an account is fully reaped from the system. + type OnKilledAccount = (); + /// What to do if a new account is created. + type OnNewAccount = (); + type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; + /// The ubiquitous origin type. + type Origin = Origin; + /// This type is being generated by `construct_runtime!`. + type PalletInfo = PalletInfo; + /// This is used as an identifier of the chain. 42 is the generic substrate prefix. + type SS58Prefix = SS58Prefix; + /// Weight information for the extrinsics of this pallet. + type SystemWeightInfo = frame_system::weights::SubstrateWeight; + /// Version of the runtime. + type Version = Version; + type MaxConsumers = ConstU32<16>; +} + +impl pallet_randomness_collective_flip::Config for Runtime {} + +parameter_types! { + pub const MinimumPeriod: u64 = SLOT_DURATION / 2; +} + +impl pallet_timestamp::Config for Runtime { + /// A timestamp: milliseconds since the unix epoch. + type Moment = u64; + type OnTimestampSet = (); + type MinimumPeriod = MinimumPeriod; + type WeightInfo = (); +} + +parameter_types! { + // pub const ExistentialDeposit: u128 = 500; + pub const ExistentialDeposit: u128 = 0; + pub const MaxLocks: u32 = 50; + pub const MaxReserves: u32 = 50; +} + +impl pallet_balances::Config for Runtime { + type MaxLocks = MaxLocks; + type MaxReserves = MaxReserves; + type ReserveIdentifier = [u8; 16]; + /// The type for recording an account's balance. + type Balance = Balance; + /// The ubiquitous event type. + type Event = Event; + type DustRemoval = Treasury; + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = pallet_balances::weights::SubstrateWeight; +} + +parameter_types! { + /// This value increases the priority of `Operational` transactions by adding + /// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`. + pub const OperationalFeeMultiplier: u8 = 5; +} + +/// Linear implementor of `WeightToFeePolynomial` +pub struct LinearFee(sp_std::marker::PhantomData); + +impl WeightToFeePolynomial for LinearFee +where + T: BaseArithmetic + From + Copy + Unsigned, +{ + type Balance = T; + + fn polynomial() -> WeightToFeeCoefficients { + smallvec!(WeightToFeeCoefficient { + coeff_integer: WEIGHT_TO_FEE_COEFF.into(), + coeff_frac: Perbill::zero(), + negative: false, + degree: 1, + }) + } +} + +impl pallet_transaction_payment::Config for Runtime { + type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; + type LengthToFee = ConstantMultiplier; + type OperationalFeeMultiplier = OperationalFeeMultiplier; + type WeightToFee = LinearFee; + type FeeMultiplierUpdate = (); +} + +parameter_types! { + pub const ProposalBond: Permill = Permill::from_percent(5); + pub const ProposalBondMinimum: Balance = 1 * UNIQUE; + pub const ProposalBondMaximum: Balance = 1000 * UNIQUE; + pub const SpendPeriod: BlockNumber = 5 * MINUTES; + pub const Burn: Permill = Permill::from_percent(0); + pub const TipCountdown: BlockNumber = 1 * DAYS; + pub const TipFindersFee: Percent = Percent::from_percent(20); + pub const TipReportDepositBase: Balance = 1 * UNIQUE; + pub const DataDepositPerByte: Balance = 1 * CENTIUNIQUE; + pub const BountyDepositBase: Balance = 1 * UNIQUE; + pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS; + pub const TreasuryModuleId: PalletId = PalletId(*b"py/trsry"); + pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS; + pub const MaximumReasonLength: u32 = 16384; + pub const BountyCuratorDeposit: Permill = Permill::from_percent(50); + pub const BountyValueMinimum: Balance = 5 * UNIQUE; + pub const MaxApprovals: u32 = 100; +} + +impl pallet_treasury::Config for Runtime { + type PalletId = TreasuryModuleId; + type Currency = Balances; + type ApproveOrigin = EnsureRoot; + type RejectOrigin = EnsureRoot; + type Event = Event; + type OnSlash = (); + type ProposalBond = ProposalBond; + type ProposalBondMinimum = ProposalBondMinimum; + type ProposalBondMaximum = ProposalBondMaximum; + type SpendPeriod = SpendPeriod; + type Burn = Burn; + type BurnDestination = (); + type SpendFunds = (); + type WeightInfo = pallet_treasury::weights::SubstrateWeight; + type MaxApprovals = MaxApprovals; +} + +impl pallet_sudo::Config for Runtime { + type Event = Event; + type Call = Call; +} + +parameter_types! { + pub const MaxAuthorities: u32 = 100_000; +} + +impl pallet_aura::Config for Runtime { + type AuthorityId = AuraId; + type DisabledValidators = (); + type MaxAuthorities = MaxAuthorities; +} diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs new file mode 100644 index 0000000000..2a8655fa5b --- /dev/null +++ b/runtime/common/config/xcm.rs @@ -0,0 +1,308 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use frame_support::{ + traits::{ + tokens::currency::Currency as CurrencyT, + OnUnbalanced as OnUnbalancedT, + Get, Everything + }, + weights::{Weight, WeightToFeePolynomial, WeightToFee}, + parameter_types, match_types, +}; +use frame_system::EnsureRoot; +use sp_runtime::{ + traits::{ + Saturating, CheckedConversion, Zero, + }, + SaturatedConversion, +}; +use pallet_xcm::XcmPassthrough; +use polkadot_parachain::primitives::Sibling; +use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*}; +use xcm::latest::{ + AssetId::{Concrete}, + Fungibility::Fungible as XcmFungible, + MultiAsset, + Error as XcmError, +}; +use xcm_executor::traits::{MatchesFungible, WeightTrader}; +use xcm_builder::{ + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, + FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative, + SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ParentIsPreset, +}; +use xcm_executor::{Config, XcmExecutor, Assets}; +use sp_std::marker::PhantomData; +use crate::{ + runtime_common::{ + constants::*, + config::substrate::LinearFee + }, + Runtime, + Call, + Event, + Origin, + Balances, + ParachainInfo, + ParachainSystem, + PolkadotXcm, + XcmpQueue, +}; +use common_types::{AccountId, Balance}; + +parameter_types! { + pub const RelayLocation: MultiLocation = MultiLocation::parent(); + pub const RelayNetwork: NetworkId = NetworkId::Polkadot; + pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); +} + +/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// when determining ownership of accounts for asset transacting and when attempting to use XCM +/// `Transact` in order to determine the dispatch Origin. +pub type LocationToAccountId = ( + // The parent (Relay-chain) origin converts to the default `AccountId`. + ParentIsPreset, + // Sibling parachain origins convert to AccountId via the `ParaId::into`. + SiblingParachainConvertsVia, + // Straight up local `AccountId32` origins just alias directly to `AccountId`. + AccountId32Aliases, +); + +pub struct OnlySelfCurrency; +impl> MatchesFungible for OnlySelfCurrency { + fn matches_fungible(a: &MultiAsset) -> Option { + match (&a.id, &a.fun) { + (Concrete(_), XcmFungible(ref amount)) => CheckedConversion::checked_from(*amount), + _ => None, + } + } +} + +/// Means for transacting assets on this chain. +pub type LocalAssetTransactor = CurrencyAdapter< + // Use this currency: + Balances, + // Use this currency when it is a fungible asset matching the given location or name: + OnlySelfCurrency, + // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID: + LocationToAccountId, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // We don't track any teleports. + (), +>; + +/// No local origins on this chain are allowed to dispatch XCM sends/executions. +pub type LocalOriginToLocation = (SignedToAccountId32,); + +/// The means for routing XCM messages which are not for local execution into the right message +/// queues. +pub type XcmRouter = ( + // Two routers - use UMP to communicate with the relay chain: + cumulus_primitives_utility::ParentAsUmp, + // ..and XCMP to communicate with the sibling chains. + XcmpQueue, +); + +/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, +/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can +/// biases the kind of local `Origin` it will become. +pub type XcmOriginToTransactDispatchOrigin = ( + // Sovereign account converter; this attempts to derive an `AccountId` from the origin location + // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for + // foreign chains who want to have a local sovereign account on this chain which they control. + SovereignSignedViaLocation, + // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when + // recognised. + RelayChainAsNative, + // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when + // recognised. + SiblingParachainAsNative, + // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a + // transaction from the Root origin. + ParentAsSuperuser, + // Native signed account converter; this just converts an `AccountId32` origin into a normal + // `Origin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, + // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. + XcmPassthrough, +); + +parameter_types! { + // One XCM operation is 1_000_000 weight - almost certainly a conservative estimate. + pub UnitWeightCost: Weight = 1_000_000; + // 1200 UNIQUEs buy 1 second of weight. + pub const WeightPrice: (MultiLocation, u128) = (MultiLocation::parent(), 1_200 * UNIQUE); + pub const MaxInstructions: u32 = 100; +} + +match_types! { + pub type ParentOrParentsUnitPlurality: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) } + }; +} + +pub type Barrier = ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + // ^^^ Parent & its unit plurality gets free execution +); + +pub struct UsingOnlySelfCurrencyComponents< + WeightToFee: WeightToFeePolynomial, + AssetId: Get, + AccountId, + Currency: CurrencyT, + OnUnbalanced: OnUnbalancedT, +>( + Weight, + Currency::Balance, + PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>, +); +impl< + WeightToFee: WeightToFeePolynomial, + AssetId: Get, + AccountId, + Currency: CurrencyT, + OnUnbalanced: OnUnbalancedT, + > WeightTrader + for UsingOnlySelfCurrencyComponents +{ + fn new() -> Self { + Self(0, Zero::zero(), PhantomData) + } + + fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { + let amount = WeightToFee::weight_to_fee(&weight); + let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?; + + // location to this parachain through relay chain + let option1: xcm::v1::AssetId = Concrete(MultiLocation { + parents: 1, + interior: X1(Parachain(ParachainInfo::parachain_id().into())), + }); + // direct location + let option2: xcm::v1::AssetId = Concrete(MultiLocation { + parents: 0, + interior: Here, + }); + + let required = if payment.fungible.contains_key(&option1) { + (option1, u128_amount).into() + } else if payment.fungible.contains_key(&option2) { + (option2, u128_amount).into() + } else { + (Concrete(MultiLocation::default()), u128_amount).into() + }; + + let unused = payment + .checked_sub(required) + .map_err(|_| XcmError::TooExpensive)?; + self.0 = self.0.saturating_add(weight); + self.1 = self.1.saturating_add(amount); + Ok(unused) + } + + fn refund_weight(&mut self, weight: Weight) -> Option { + let weight = weight.min(self.0); + let amount = WeightToFee::weight_to_fee(&weight); + self.0 -= weight; + self.1 = self.1.saturating_sub(amount); + let amount: u128 = amount.saturated_into(); + if amount > 0 { + Some((AssetId::get(), amount).into()) + } else { + None + } + } +} +impl< + WeightToFee: WeightToFeePolynomial, + AssetId: Get, + AccountId, + Currency: CurrencyT, + OnUnbalanced: OnUnbalancedT, + > Drop + for UsingOnlySelfCurrencyComponents +{ + fn drop(&mut self) { + OnUnbalanced::on_unbalanced(Currency::issue(self.1)); + } +} + +pub struct XcmConfig; +impl Config for XcmConfig { + type Call = Call; + type XcmSender = XcmRouter; + // How to withdraw and deposit an asset. + type AssetTransactor = LocalAssetTransactor; + type OriginConverter = XcmOriginToTransactDispatchOrigin; + type IsReserve = NativeAsset; + type IsTeleporter = (); // Teleportation is disabled + type LocationInverter = LocationInverter; + type Barrier = Barrier; + type Weigher = FixedWeightBounds; + type Trader = + UsingOnlySelfCurrencyComponents, RelayLocation, AccountId, Balances, ()>; + type ResponseHandler = (); // Don't handle responses for now. + type SubscriptionService = PolkadotXcm; + + type AssetTrap = PolkadotXcm; + type AssetClaims = PolkadotXcm; +} + +impl pallet_xcm::Config for Runtime { + type Event = Event; + type SendXcmOrigin = EnsureXcmOrigin; + type XcmRouter = XcmRouter; + type ExecuteXcmOrigin = EnsureXcmOrigin; + type XcmExecuteFilter = Everything; + type XcmExecutor = XcmExecutor; + type XcmTeleportFilter = Everything; + type XcmReserveTransferFilter = Everything; + type Weigher = FixedWeightBounds; + type LocationInverter = LocationInverter; + type Origin = Origin; + type Call = Call; + const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; + type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; +} + +impl cumulus_pallet_xcm::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor; +} + +impl cumulus_pallet_xcmp_queue::Config for Runtime { + type WeightInfo = (); + type Event = Event; + type XcmExecutor = XcmExecutor; + type ChannelInfo = ParachainSystem; + type VersionWrapper = (); + type ExecuteOverweightOrigin = frame_system::EnsureRoot; + type ControllerOrigin = EnsureRoot; + type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; +} + +impl cumulus_pallet_dmp_queue::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor; + type ExecuteOverweightOrigin = frame_system::EnsureRoot; +} diff --git a/runtime/common/src/constants.rs b/runtime/common/constants.rs similarity index 95% rename from runtime/common/src/constants.rs rename to runtime/common/constants.rs index e1241c5dc4..972042a7f4 100644 --- a/runtime/common/src/constants.rs +++ b/runtime/common/constants.rs @@ -19,7 +19,7 @@ use frame_support::{ parameter_types, weights::{Weight, constants::WEIGHT_PER_SECOND}, }; -use crate::types::{BlockNumber, Balance}; +use common_types::{BlockNumber, Balance}; pub const MILLISECS_PER_BLOCK: u64 = 12000; @@ -51,7 +51,5 @@ pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; parameter_types! { - pub const DefaultSponsoringRateLimit: BlockNumber = 1 * DAYS; - pub const TransactionByteFee: Balance = 501 * MICROUNIQUE; } diff --git a/runtime/common/src/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs similarity index 83% rename from runtime/common/src/construct_runtime/mod.rs rename to runtime/common/construct_runtime/mod.rs index 221e8dbb17..1036840fc6 100644 --- a/runtime/common/src/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -1,3 +1,19 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + mod util; #[macro_export] diff --git a/runtime/common/src/construct_runtime/util.rs b/runtime/common/construct_runtime/util.rs similarity index 88% rename from runtime/common/src/construct_runtime/util.rs rename to runtime/common/construct_runtime/util.rs index 7cc1a35d04..f6942e4bd3 100644 --- a/runtime/common/src/construct_runtime/util.rs +++ b/runtime/common/construct_runtime/util.rs @@ -1,3 +1,19 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + #[macro_export] macro_rules! construct_runtime_impl { ( diff --git a/runtime/common/src/dispatch.rs b/runtime/common/dispatch.rs similarity index 100% rename from runtime/common/src/dispatch.rs rename to runtime/common/dispatch.rs diff --git a/runtime/common/src/lib.rs b/runtime/common/ethereum/mod.rs similarity index 80% rename from runtime/common/src/lib.rs rename to runtime/common/ethereum/mod.rs index 06b50309bf..212f00d35d 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/ethereum/mod.rs @@ -14,13 +14,12 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -#![cfg_attr(not(feature = "std"), no_std)] - -pub mod constants; -pub mod construct_runtime; -pub mod dispatch; -pub mod eth_sponsoring; -pub mod runtime_apis; pub mod sponsoring; -pub mod types; -pub mod weights; +pub mod transaction_converter; +pub mod self_contained_call; + +pub use { + sponsoring::*, + transaction_converter::*, + self_contained_call::*, +}; diff --git a/runtime/common/ethereum/self_contained_call.rs b/runtime/common/ethereum/self_contained_call.rs new file mode 100644 index 0000000000..5128cea279 --- /dev/null +++ b/runtime/common/ethereum/self_contained_call.rs @@ -0,0 +1,74 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use sp_core::H160; +use sp_runtime::{ + traits::{Dispatchable, DispatchInfoOf, PostDispatchInfoOf}, + transaction_validity::{TransactionValidityError, TransactionValidity}, +}; +use crate::{Origin, Call}; + +impl fp_self_contained::SelfContainedCall for Call { + type SignedInfo = H160; + + fn is_self_contained(&self) -> bool { + match self { + Call::Ethereum(call) => call.is_self_contained(), + _ => false, + } + } + + fn check_self_contained(&self) -> Option> { + match self { + Call::Ethereum(call) => call.check_self_contained(), + _ => None, + } + } + + fn validate_self_contained( + &self, + info: &Self::SignedInfo, + dispatch_info: &DispatchInfoOf, + len: usize, + ) -> Option { + match self { + Call::Ethereum(call) => call.validate_self_contained(info, dispatch_info, len), + _ => None, + } + } + + fn pre_dispatch_self_contained( + &self, + info: &Self::SignedInfo, + ) -> Option> { + match self { + Call::Ethereum(call) => call.pre_dispatch_self_contained(info), + _ => None, + } + } + + fn apply_self_contained( + self, + info: Self::SignedInfo, + ) -> Option>> { + match self { + call @ Call::Ethereum(pallet_ethereum::Call::transact { .. }) => Some(call.dispatch( + Origin::from(pallet_ethereum::RawOrigin::EthereumTransaction(info)), + )), + _ => None, + } + } +} diff --git a/runtime/common/src/eth_sponsoring.rs b/runtime/common/ethereum/sponsoring.rs similarity index 95% rename from runtime/common/src/eth_sponsoring.rs rename to runtime/common/ethereum/sponsoring.rs index 92e3aa8bd9..796e9b0207 100644 --- a/runtime/common/src/eth_sponsoring.rs +++ b/runtime/common/ethereum/sponsoring.rs @@ -27,7 +27,10 @@ use pallet_evm::account::CrossAccountId; use up_data_structs::{TokenId, CreateItemData, CreateNftData, CollectionMode}; use pallet_unique::Config as UniqueConfig; -use crate::sponsoring::*; +use crate::{ + Runtime, + runtime_common::sponsoring::* +}; use pallet_nonfungible::erc::{ UniqueNFTCall, ERC721UniqueExtensionsCall, ERC721MintableCall, ERC721Call, TokenPropertiesCall, @@ -37,6 +40,11 @@ use pallet_fungible::Config as FungibleConfig; use pallet_nonfungible::Config as NonfungibleConfig; use pallet_refungible::Config as RefungibleConfig; +pub type EvmSponsorshipHandler = ( + UniqueEthSponsorshipHandler, + pallet_evm_contract_helpers::HelpersContractSponsoring, +); + pub struct UniqueEthSponsorshipHandler(PhantomData<*const T>); impl SponsorshipHandler)> for UniqueEthSponsorshipHandler diff --git a/runtime/common/ethereum/transaction_converter.rs b/runtime/common/ethereum/transaction_converter.rs new file mode 100644 index 0000000000..0fe2be459b --- /dev/null +++ b/runtime/common/ethereum/transaction_converter.rs @@ -0,0 +1,46 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use codec::{Encode, Decode}; +use crate::{ + opaque, + Runtime, + UncheckedExtrinsic, +}; + +pub struct TransactionConverter; + +impl fp_rpc::ConvertTransaction for TransactionConverter { + fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic { + UncheckedExtrinsic::new_unsigned( + pallet_ethereum::Call::::transact { transaction }.into(), + ) + } +} + +impl fp_rpc::ConvertTransaction for TransactionConverter { + fn convert_transaction( + &self, + transaction: pallet_ethereum::Transaction, + ) -> opaque::UncheckedExtrinsic { + let extrinsic = UncheckedExtrinsic::new_unsigned( + pallet_ethereum::Call::::transact { transaction }.into(), + ); + let encoded = extrinsic.encode(); + opaque::UncheckedExtrinsic::decode(&mut &encoded[..]) + .expect("Encoded extrinsic is always valid") + } +} diff --git a/runtime/common/instance.rs b/runtime/common/instance.rs new file mode 100644 index 0000000000..900a466356 --- /dev/null +++ b/runtime/common/instance.rs @@ -0,0 +1,17 @@ +use crate::{ + runtime_common::{ + config::ethereum::CrossAccountId, + ethereum::TransactionConverter + }, + Runtime, +}; +use common_types::opaque::RuntimeInstance; + +impl RuntimeInstance for Runtime { + type CrossAccountId = CrossAccountId; + type TransactionConverter = TransactionConverter; + + fn get_transaction_converter() -> TransactionConverter { + TransactionConverter + } +} diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs new file mode 100644 index 0000000000..0ddf57c0d1 --- /dev/null +++ b/runtime/common/mod.rs @@ -0,0 +1,171 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +mod constants; +mod construct_runtime; +mod dispatch; +mod runtime_apis; +mod sponsoring; +mod weights; +mod config; +mod instance; +mod ethereum; +mod scheduler; + +pub use { + constants::*, + dispatch::*, + sponsoring::*, + weights::*, + config::*, + instance::*, + ethereum::*, +}; + +use sp_core::H160; +use frame_support::traits::{Currency, OnUnbalanced, Imbalance}; +use sp_runtime::{ + generic, + traits::{BlakeTwo256, BlockNumberProvider}, + impl_opaque_keys, +}; +use sp_std::vec::Vec; + +#[cfg(feature = "std")] +use sp_version::NativeVersion; + +use crate::{ + Runtime, Call, Balances, Treasury, Aura, Signature, AllPalletsReversedWithSystemFirst, + InherentDataExt, +}; +use common_types::{AccountId, BlockNumber}; + +/// The address format for describing accounts. +pub type Address = sp_runtime::MultiAddress; +/// Block header type as expected by this runtime. +pub type Header = generic::Header; +/// Block type as expected by this runtime. +pub type Block = generic::Block; +/// A Block signed with a Justification +pub type SignedBlock = generic::SignedBlock; +/// BlockId type as expected by this runtime. +pub type BlockId = generic::BlockId; + +impl_opaque_keys! { + pub struct SessionKeys { + pub aura: Aura, + } +} + +/// The version information used to identify this runtime when compiled natively. +#[cfg(feature = "std")] +pub fn native_version() -> NativeVersion { + NativeVersion { + runtime_version: crate::VERSION, + can_author_with: Default::default(), + } +} + +pub type ChargeTransactionPayment = pallet_charge_transaction::ChargeTransactionPayment; + +pub type SignedExtra = ( + frame_system::CheckSpecVersion, + // system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckEra, + frame_system::CheckNonce, + frame_system::CheckWeight, + ChargeTransactionPayment, + //pallet_contract_helpers::ContractHelpersExtension, + pallet_ethereum::FakeTransactionFinalizer, +); + +/// Unchecked extrinsic type as expected by this runtime. +pub type UncheckedExtrinsic = + fp_self_contained::UncheckedExtrinsic; + +/// Extrinsic type that has already been checked. +pub type CheckedExtrinsic = fp_self_contained::CheckedExtrinsic; + +/// Executive: handles dispatch to the various modules. +pub type Executive = frame_executive::Executive< + Runtime, + Block, + frame_system::ChainContext, + Runtime, + AllPalletsReversedWithSystemFirst, +>; + +type NegativeImbalance = >::NegativeImbalance; + +pub struct DealWithFees; +impl OnUnbalanced for DealWithFees { + fn on_unbalanceds(mut fees_then_tips: impl Iterator) { + if let Some(fees) = fees_then_tips.next() { + // for fees, 100% to treasury + let mut split = fees.ration(100, 0); + if let Some(tips) = fees_then_tips.next() { + // for tips, if any, 100% to treasury + tips.ration_merge_into(100, 0, &mut split); + } + Treasury::on_unbalanced(split.0); + // Author::on_unbalanced(split.1); + } + } +} + +pub struct RelayChainBlockNumberProvider(sp_std::marker::PhantomData); + +impl BlockNumberProvider + for RelayChainBlockNumberProvider +{ + type BlockNumber = BlockNumber; + + fn current_block_number() -> Self::BlockNumber { + cumulus_pallet_parachain_system::Pallet::::validation_data() + .map(|d| d.relay_parent_number) + .unwrap_or_default() + } +} + +pub(crate) struct CheckInherents; + +impl cumulus_pallet_parachain_system::CheckInherents for CheckInherents { + fn check_inherents( + block: &Block, + relay_state_proof: &cumulus_pallet_parachain_system::RelayChainStateProof, + ) -> sp_inherents::CheckInherentsResult { + let relay_chain_slot = relay_state_proof + .read_slot() + .expect("Could not read the relay chain slot from the proof"); + + let inherent_data = + cumulus_primitives_timestamp::InherentDataProvider::from_relay_chain_slot_and_duration( + relay_chain_slot, + sp_std::time::Duration::from_secs(6), + ) + .create_inherent_data() + .expect("Could not create the timestamp inherent data"); + + inherent_data.check_extrinsics(block) + } +} + +#[derive(codec::Encode, codec::Decode)] +pub enum XCMPMessage { + /// Transfer tokens to the given account from the Parachain account. + TransferToken(XAccountId, XBalance), +} diff --git a/runtime/common/src/runtime_apis.rs b/runtime/common/runtime_apis.rs similarity index 96% rename from runtime/common/src/runtime_apis.rs rename to runtime/common/runtime_apis.rs index dfe295d9b0..8dc3dce1c5 100644 --- a/runtime/common/src/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -14,6 +14,16 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +#[macro_export] +macro_rules! dispatch_unique_runtime { + ($collection:ident.$method:ident($($name:ident),*)) => {{ + let collection = ::CollectionDispatch::dispatch(>::try_get($collection)?); + let dispatch = collection.as_dyn(); + + Ok::<_, DispatchError>(dispatch.$method($($name),*)) + }}; +} + #[macro_export] macro_rules! impl_common_runtime_apis { ( @@ -23,6 +33,26 @@ macro_rules! impl_common_runtime_apis { $($custom_apis:tt)+ )? ) => { + use sp_std::prelude::*; + use sp_api::impl_runtime_apis; + use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160}; + use sp_runtime::{ + Permill, + traits::Block as BlockT, + transaction_validity::{TransactionSource, TransactionValidity}, + ApplyExtrinsicResult, DispatchError, + }; + use fp_rpc::TransactionStatus; + use pallet_transaction_payment::{ + FeeDetails, RuntimeDispatchInfo, + }; + use pallet_evm::{ + Runner, account::CrossAccountId as _, + Account as EVMAccount, FeeCalculator, + }; + use up_data_structs::*; + + impl_runtime_apis! { $($($custom_apis)+)? @@ -138,11 +168,11 @@ macro_rules! impl_common_runtime_apis { Ok(>::collection_stats()) } fn next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result, DispatchError> { - Ok(<$crate::sponsoring::UniqueSponsorshipPredict as - $crate::sponsoring::SponsorshipPredict>::predict( + Ok( as SponsorshipPredict>::predict( collection, account, - token)) + token + )) } fn effective_collection_limits(collection: CollectionId) -> Result, DispatchError> { diff --git a/runtime/common/scheduler.rs b/runtime/common/scheduler.rs new file mode 100644 index 0000000000..b0b936ba72 --- /dev/null +++ b/runtime/common/scheduler.rs @@ -0,0 +1,144 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use frame_support::{ + traits::NamedReservableCurrency, + weights::{GetDispatchInfo, PostDispatchInfo, DispatchInfo}, +}; +use sp_runtime::{ + traits::{Dispatchable, Applyable, Member}, + generic::Era, + transaction_validity::TransactionValidityError, + DispatchErrorWithPostInfo, DispatchError, +}; +use crate::{ + Runtime, Call, Origin, Balances, + ChargeTransactionPayment, +}; +use common_types::{AccountId, Balance}; +use fp_self_contained::SelfContainedCall; +use pallet_unique_scheduler::DispatchCall; + +/// The SignedExtension to the basic transaction logic. +pub type SignedExtraScheduler = ( + frame_system::CheckSpecVersion, + frame_system::CheckGenesis, + frame_system::CheckEra, + frame_system::CheckNonce, + frame_system::CheckWeight, +); + +fn get_signed_extras(from: ::AccountId) -> SignedExtraScheduler { + ( + frame_system::CheckSpecVersion::::new(), + frame_system::CheckGenesis::::new(), + frame_system::CheckEra::::from(Era::Immortal), + frame_system::CheckNonce::::from(frame_system::Pallet::::account_nonce( + from, + )), + frame_system::CheckWeight::::new(), + // sponsoring transaction logic + // pallet_charge_transaction::ChargeTransactionPayment::::new(0), + ) +} + +pub struct SchedulerPaymentExecutor; + +impl + DispatchCall for SchedulerPaymentExecutor +where + ::Call: Member + + Dispatchable + + SelfContainedCall + + GetDispatchInfo + + From>, + SelfContainedSignedInfo: Send + Sync + 'static, + Call: From<::Call> + + From<::Call> + + SelfContainedCall, + sp_runtime::AccountId32: From<::AccountId>, +{ + fn dispatch_call( + signer: ::AccountId, + call: ::Call, + ) -> Result< + Result>, + TransactionValidityError, + > { + let dispatch_info = call.get_dispatch_info(); + let extrinsic = fp_self_contained::CheckedExtrinsic::< + AccountId, + Call, + SignedExtraScheduler, + SelfContainedSignedInfo, + > { + signed: + fp_self_contained::CheckedSignature::::Signed( + signer.clone().into(), + get_signed_extras(signer.into()), + ), + function: call.into(), + }; + + extrinsic.apply::(&dispatch_info, 0) + } + + fn reserve_balance( + id: [u8; 16], + sponsor: ::AccountId, + call: ::Call, + count: u32, + ) -> Result<(), DispatchError> { + let dispatch_info = call.get_dispatch_info(); + let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0) + .saturating_mul(count.into()); + + >::reserve_named( + &id, + &(sponsor.into()), + weight, + ) + } + + fn pay_for_call( + id: [u8; 16], + sponsor: ::AccountId, + call: ::Call, + ) -> Result { + let dispatch_info = call.get_dispatch_info(); + let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0); + Ok( + >::unreserve_named( + &id, + &(sponsor.into()), + weight, + ), + ) + } + + fn cancel_reserve( + id: [u8; 16], + sponsor: ::AccountId, + ) -> Result { + Ok( + >::unreserve_named( + &id, + &(sponsor.into()), + u128::MAX, + ), + ) + } +} diff --git a/runtime/common/src/sponsoring.rs b/runtime/common/sponsoring.rs similarity index 100% rename from runtime/common/src/sponsoring.rs rename to runtime/common/sponsoring.rs diff --git a/runtime/common/src/weights.rs b/runtime/common/weights.rs similarity index 100% rename from runtime/common/src/weights.rs rename to runtime/common/weights.rs diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 6a88eab0e3..adbd02e8fc 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -113,13 +113,15 @@ std = [ 'xcm/std', 'xcm-builder/std', 'xcm-executor/std', - 'unique-runtime-common/std', + 'common-types/std', 'rmrk-rpc/std', + 'evm-coder/std', + 'up-sponsorship/std', "orml-vesting/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] -opal-runtime = ['scheduler', 'rmrk'] +opal-runtime = ['rmrk', 'scheduler'] scheduler = [] rmrk = [] @@ -400,7 +402,7 @@ default-features = false [dependencies] log = { version = "0.4.16", default-features = false } -unique-runtime-common = { path = "../common", default-features = false, features = ['refungible'] } +common-types = { path = "../../common-types", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } @@ -430,6 +432,8 @@ pallet-ethereum = { default-features = false, git = "https://github.com/uniquene pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +evm-coder = { default-features = false, path = '../../crates/evm-coder' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.24' } ################################################################################ # Build Dependencies diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 7949cb2683..7a62d25600 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -25,175 +25,21 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); -use sp_api::impl_runtime_apis; -use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160}; -use sp_runtime::DispatchError; -#[cfg(feature = "scheduler")] -use fp_self_contained::*; +use frame_support::parameter_types; -#[cfg(feature = "scheduler")] -use sp_runtime::{ - traits::{Applyable, Member}, - generic::Era, - DispatchErrorWithPostInfo, -}; -// #[cfg(any(feature = "std", test))] -// pub use sp_runtime::BuildStorage; - -use sp_runtime::{ - Permill, Perbill, Percent, create_runtime_str, generic, impl_opaque_keys, - traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion, Zero}, - transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, RuntimeAppPublic, -}; - -use sp_std::prelude::*; - -#[cfg(feature = "std")] -use sp_version::NativeVersion; use sp_version::RuntimeVersion; -pub use pallet_transaction_payment::{ - Multiplier, TargetedFeeAdjustment, FeeDetails, RuntimeDispatchInfo, -}; -// A few exports that help ease life for downstream crates. -pub use pallet_balances::Call as BalancesCall; -pub use pallet_evm::{ - EnsureAddressTruncated, HashedAddressMapping, Runner, account::CrossAccountId as _, - OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping, -}; -pub use frame_support::{ - match_types, - dispatch::DispatchResult, - PalletId, parameter_types, StorageValue, ConsensusEngineId, - traits::{ - tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Everything, - Currency, ExistenceRequirement, Get, IsInVec, KeyOwnerProofSystem, LockIdentifier, - OnUnbalanced, Randomness, FindAuthor, ConstU32, Imbalance, PrivilegeCmp, - }, - weights::{ - constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, - DispatchClass, DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight, - WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, ConstantMultiplier, - WeightToFee, - }, -}; - -#[cfg(feature = "scheduler")] -use pallet_unique_scheduler::DispatchCall; - -use up_data_structs::{ - CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits, - CollectionStats, RpcCollection, - mapping::{EvmTokenAddressMapping, CrossTokenAddressMapping}, - TokenChild, RmrkCollectionInfo, RmrkInstanceInfo, RmrkResourceInfo, RmrkPropertyInfo, - RmrkBaseInfo, RmrkPartType, RmrkTheme, RmrkThemeName, RmrkCollectionId, RmrkNftId, - RmrkNftChild, RmrkPropertyKey, RmrkResourceId, RmrkBaseId, -}; +use sp_runtime::create_runtime_str; -// use pallet_contracts::weights::WeightInfo; -// #[cfg(any(feature = "std", test))] -use frame_system::{ - self as frame_system, EnsureRoot, EnsureSigned, - limits::{BlockWeights, BlockLength}, -}; -use sp_arithmetic::{ - traits::{BaseArithmetic, Unsigned}, -}; -use smallvec::smallvec; -use codec::{Encode, Decode}; -use fp_rpc::TransactionStatus; -use sp_runtime::{ - traits::{ - BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, Saturating, - CheckedConversion, - }, - transaction_validity::TransactionValidityError, - SaturatedConversion, -}; +use common_types::*; -// pub use pallet_timestamp::Call as TimestampCall; -pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; +#[path = "../../common/mod.rs"] +mod runtime_common; -// Polkadot imports -use pallet_xcm::XcmPassthrough; -use polkadot_parachain::primitives::Sibling; -use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*}; -use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative, - SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ParentIsPreset, -}; -use xcm_executor::{Config, XcmExecutor, Assets}; -use sp_std::{cmp::Ordering, marker::PhantomData}; - -use xcm::latest::{ - // Xcm, - AssetId::{Concrete}, - Fungibility::Fungible as XcmFungible, - MultiAsset, - Error as XcmError, -}; -use xcm_executor::traits::{MatchesFungible, WeightTrader}; - -use unique_runtime_common::{ - construct_runtime, impl_common_runtime_apis, - types::*, - constants::*, - dispatch::{CollectionDispatchT, CollectionDispatch}, - sponsoring::UniqueSponsorshipHandler, - eth_sponsoring::UniqueEthSponsorshipHandler, - weights::CommonWeights, -}; +pub use runtime_common::*; pub const RUNTIME_NAME: &str = "opal"; pub const TOKEN_SYMBOL: &str = "OPL"; -type CrossAccountId = pallet_evm::account::BasicCrossAccountId; - -impl RuntimeInstance for Runtime { - type CrossAccountId = self::CrossAccountId; - type TransactionConverter = self::TransactionConverter; - - fn get_transaction_converter() -> TransactionConverter { - TransactionConverter - } -} - -/// The type for looking up accounts. We don't expect more than 4 billion of them, but you -/// never know... -pub type AccountIndex = u32; - -/// Balance of an account. -pub type Balance = u128; - -/// Index of a transaction in the chain. -pub type Index = u32; - -/// A hash of some data used by the chain. -pub type Hash = sp_core::H256; - -/// Digest item type. -pub type DigestItem = generic::DigestItem; - -/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know -/// the specifics of the runtime. They can then be made to be agnostic over specific formats -/// of data like extrinsics, allowing for them to continue syncing the network through upgrades -/// to even the core data structures. -pub mod opaque { - use sp_std::prelude::*; - use sp_runtime::impl_opaque_keys; - use super::Aura; - - pub use unique_runtime_common::types::*; - - impl_opaque_keys! { - pub struct SessionKeys { - pub aura: Aura, - } - } -} - /// This runtime version. pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), @@ -206,1096 +52,16 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { state_version: 0, }; -#[derive(codec::Encode, codec::Decode)] -pub enum XCMPMessage { - /// Transfer tokens to the given account from the Parachain account. - TransferToken(XAccountId, XBalance), -} - -/// The version information used to identify this runtime when compiled natively. -#[cfg(feature = "std")] -pub fn native_version() -> NativeVersion { - NativeVersion { - runtime_version: VERSION, - can_author_with: Default::default(), - } -} - -type NegativeImbalance = >::NegativeImbalance; - -pub struct DealWithFees; -impl OnUnbalanced for DealWithFees { - fn on_unbalanceds(mut fees_then_tips: impl Iterator) { - if let Some(fees) = fees_then_tips.next() { - // for fees, 100% to treasury - let mut split = fees.ration(100, 0); - if let Some(tips) = fees_then_tips.next() { - // for tips, if any, 100% to treasury - tips.ration_merge_into(100, 0, &mut split); - } - Treasury::on_unbalanced(split.0); - // Author::on_unbalanced(split.1); - } - } -} - parameter_types! { - pub const BlockHashCount: BlockNumber = 2400; - pub RuntimeBlockLength: BlockLength = - BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); - pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); - pub const MaximumBlockLength: u32 = 5 * 1024 * 1024; - pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() - .base_block(BlockExecutionWeight::get()) - .for_class(DispatchClass::all(), |weights| { - weights.base_extrinsic = ExtrinsicBaseWeight::get(); - }) - .for_class(DispatchClass::Normal, |weights| { - weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); - }) - .for_class(DispatchClass::Operational, |weights| { - weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); - // Operational transactions have some extra reserved space, so that they - // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. - weights.reserved = Some( - MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT - ); - }) - .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) - .build_or_panic(); pub const Version: RuntimeVersion = VERSION; pub const SS58Prefix: u8 = 42; -} - -parameter_types! { pub const ChainId: u64 = 8882; } -pub struct FixedFee; -impl FeeCalculator for FixedFee { - fn min_gas_price() -> (U256, u64) { - (MIN_GAS_PRICE.into(), 0) - } -} - -// Assuming slowest ethereum opcode is SSTORE, with gas price of 20000 as our worst case -// (contract, which only writes a lot of data), -// approximating on top of our real store write weight -parameter_types! { - pub const WritesPerSecond: u64 = WEIGHT_PER_SECOND / ::DbWeight::get().write; - pub const GasPerSecond: u64 = WritesPerSecond::get() * 20000; - pub const WeightPerGas: u64 = WEIGHT_PER_SECOND / GasPerSecond::get(); -} - -/// Limiting EVM execution to 50% of block for substrate users and management tasks -/// EVM transaction consumes more weight than substrate's, so we can't rely on them being -/// scheduled fairly -const EVM_DISPATCH_RATIO: Perbill = Perbill::from_percent(50); -parameter_types! { - pub BlockGasLimit: U256 = U256::from(NORMAL_DISPATCH_RATIO * EVM_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT / WeightPerGas::get()); -} - -pub enum FixedGasWeightMapping {} -impl GasWeightMapping for FixedGasWeightMapping { - fn gas_to_weight(gas: u64) -> Weight { - gas.saturating_mul(WeightPerGas::get()) - } - fn weight_to_gas(weight: Weight) -> u64 { - weight / WeightPerGas::get() - } -} - -impl pallet_evm::account::Config for Runtime { - type CrossAccountId = pallet_evm::account::BasicCrossAccountId; - type EvmAddressMapping = pallet_evm::HashedAddressMapping; - type EvmBackwardsAddressMapping = fp_evm_mapping::MapBackwardsAddressTruncated; -} - -impl pallet_evm::Config for Runtime { - type BlockGasLimit = BlockGasLimit; - type FeeCalculator = FixedFee; - type GasWeightMapping = FixedGasWeightMapping; - type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping; - type CallOrigin = EnsureAddressTruncated; - type WithdrawOrigin = EnsureAddressTruncated; - type AddressMapping = HashedAddressMapping; - type PrecompilesType = (); - type PrecompilesValue = (); - type Currency = Balances; - type Event = Event; - type OnMethodCall = ( - pallet_evm_migration::OnMethodCall, - pallet_evm_contract_helpers::HelpersOnMethodCall, - CollectionDispatchT, - pallet_unique::eth::CollectionHelpersOnMethodCall, - ); - type OnCreate = pallet_evm_contract_helpers::HelpersOnCreate; - type ChainId = ChainId; - type Runner = pallet_evm::runner::stack::Runner; - type OnChargeTransaction = pallet_evm::EVMCurrencyAdapter; - type TransactionValidityHack = pallet_evm_transaction_payment::TransactionValidityHack; - type FindAuthor = EthereumFindAuthor; -} - -impl pallet_evm_migration::Config for Runtime { - type WeightInfo = pallet_evm_migration::weights::SubstrateWeight; -} - -pub struct EthereumFindAuthor(core::marker::PhantomData); -impl> FindAuthor for EthereumFindAuthor { - fn find_author<'a, I>(digests: I) -> Option - where - I: 'a + IntoIterator, - { - if let Some(author_index) = F::find_author(digests) { - let authority_id = Aura::authorities()[author_index as usize].clone(); - return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24])); - } - None - } -} - -impl pallet_ethereum::Config for Runtime { - type Event = Event; - type StateRoot = pallet_ethereum::IntermediateStateRoot; -} - -impl pallet_randomness_collective_flip::Config for Runtime {} - -impl frame_system::Config for Runtime { - /// The data to be stored in an account. - type AccountData = pallet_balances::AccountData; - /// The identifier used to distinguish between accounts. - type AccountId = AccountId; - /// The basic call filter to use in dispatchable. - type BaseCallFilter = Everything; - /// Maximum number of block number to block hash mappings to keep (oldest pruned first). - type BlockHashCount = BlockHashCount; - /// The maximum length of a block (in bytes). - type BlockLength = RuntimeBlockLength; - /// The index type for blocks. - type BlockNumber = BlockNumber; - /// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block. - type BlockWeights = RuntimeBlockWeights; - /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; - /// The weight of database operations that the runtime can invoke. - type DbWeight = RocksDbWeight; - /// The ubiquitous event type. - type Event = Event; - /// The type for hashing blocks and tries. - type Hash = Hash; - /// The hashing algorithm used. - type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; - /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The lookup mechanism to get account ID from whatever is passed in dispatchers. - type Lookup = AccountIdLookup; - /// What to do if an account is fully reaped from the system. - type OnKilledAccount = (); - /// What to do if a new account is created. - type OnNewAccount = (); - type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; - /// The ubiquitous origin type. - type Origin = Origin; - /// This type is being generated by `construct_runtime!`. - type PalletInfo = PalletInfo; - /// This is used as an identifier of the chain. 42 is the generic substrate prefix. - type SS58Prefix = SS58Prefix; - /// Weight information for the extrinsics of this pallet. - type SystemWeightInfo = frame_system::weights::SubstrateWeight; - /// Version of the runtime. - type Version = Version; - type MaxConsumers = ConstU32<16>; -} - -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; -} - -impl pallet_timestamp::Config for Runtime { - /// A timestamp: milliseconds since the unix epoch. - type Moment = u64; - type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; - type WeightInfo = (); -} - -parameter_types! { - // pub const ExistentialDeposit: u128 = 500; - pub const ExistentialDeposit: u128 = 0; - pub const MaxLocks: u32 = 50; - pub const MaxReserves: u32 = 50; -} - -impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; - type MaxReserves = MaxReserves; - type ReserveIdentifier = [u8; 16]; - /// The type for recording an account's balance. - type Balance = Balance; - /// The ubiquitous event type. - type Event = Event; - type DustRemoval = Treasury; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = pallet_balances::weights::SubstrateWeight; -} - -pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 15 * CENTIUNIQUE + (bytes as Balance) * 6 * CENTIUNIQUE -} - -/* -parameter_types! { - pub TombstoneDeposit: Balance = deposit( - 1, - sp_std::mem::size_of::> as u32, - ); - pub DepositPerContract: Balance = TombstoneDeposit::get(); - pub const DepositPerStorageByte: Balance = deposit(0, 1); - pub const DepositPerStorageItem: Balance = deposit(1, 0); - pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * DAYS); - pub const SurchargeReward: Balance = 150 * MILLIUNIQUE; - pub const SignedClaimHandicap: u32 = 2; - pub const MaxDepth: u32 = 32; - pub const MaxValueSize: u32 = 16 * 1024; - pub const MaxCodeSize: u32 = 1024 * 1024 * 25; // 25 Mb - // The lazy deletion runs inside on_initialize. - pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO * - RuntimeBlockWeights::get().max_block; - // The weight needed for decoding the queue should be less or equal than a fifth - // of the overall weight dedicated to the lazy deletion. - pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / ( - ::WeightInfo::on_initialize_per_queue_item(1) - - ::WeightInfo::on_initialize_per_queue_item(0) - )) / 5) as u32; - pub Schedule: pallet_contracts::Schedule = Default::default(); -} - -impl pallet_contracts::Config for Runtime { - type Time = Timestamp; - type Randomness = RandomnessCollectiveFlip; - type Currency = Balances; - type Event = Event; - type RentPayment = (); - type SignedClaimHandicap = SignedClaimHandicap; - type TombstoneDeposit = TombstoneDeposit; - type DepositPerContract = DepositPerContract; - type DepositPerStorageByte = DepositPerStorageByte; - type DepositPerStorageItem = DepositPerStorageItem; - type RentFraction = RentFraction; - type SurchargeReward = SurchargeReward; - type WeightPrice = pallet_transaction_payment::Pallet; - type WeightInfo = pallet_contracts::weights::SubstrateWeight; - type ChainExtension = NFTExtension; - type DeletionQueueDepth = DeletionQueueDepth; - type DeletionWeightLimit = DeletionWeightLimit; - type Schedule = Schedule; - type CallStack = [pallet_contracts::Frame; 31]; -} -*/ - -parameter_types! { - /// This value increases the priority of `Operational` transactions by adding - /// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`. - pub const OperationalFeeMultiplier: u8 = 5; -} - -/// Linear implementor of `WeightToFeePolynomial` -pub struct LinearFee(sp_std::marker::PhantomData); - -impl WeightToFeePolynomial for LinearFee -where - T: BaseArithmetic + From + Copy + Unsigned, -{ - type Balance = T; - - fn polynomial() -> WeightToFeeCoefficients { - smallvec!(WeightToFeeCoefficient { - coeff_integer: WEIGHT_TO_FEE_COEFF.into(), - coeff_frac: Perbill::zero(), - negative: false, - degree: 1, - }) - } -} - -impl pallet_transaction_payment::Config for Runtime { - type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; - type LengthToFee = ConstantMultiplier; - type OperationalFeeMultiplier = OperationalFeeMultiplier; - type WeightToFee = LinearFee; - type FeeMultiplierUpdate = (); -} - -parameter_types! { - pub const ProposalBond: Permill = Permill::from_percent(5); - pub const ProposalBondMinimum: Balance = 1 * UNIQUE; - pub const ProposalBondMaximum: Balance = 1000 * UNIQUE; - pub const SpendPeriod: BlockNumber = 5 * MINUTES; - pub const Burn: Permill = Permill::from_percent(0); - pub const TipCountdown: BlockNumber = 1 * DAYS; - pub const TipFindersFee: Percent = Percent::from_percent(20); - pub const TipReportDepositBase: Balance = 1 * UNIQUE; - pub const DataDepositPerByte: Balance = 1 * CENTIUNIQUE; - pub const BountyDepositBase: Balance = 1 * UNIQUE; - pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS; - pub const TreasuryModuleId: PalletId = PalletId(*b"py/trsry"); - pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS; - pub const MaximumReasonLength: u32 = 16384; - pub const BountyCuratorDeposit: Permill = Permill::from_percent(50); - pub const BountyValueMinimum: Balance = 5 * UNIQUE; - pub const MaxApprovals: u32 = 100; -} - -impl pallet_treasury::Config for Runtime { - type PalletId = TreasuryModuleId; - type Currency = Balances; - type ApproveOrigin = EnsureRoot; - type RejectOrigin = EnsureRoot; - type Event = Event; - type OnSlash = (); - type ProposalBond = ProposalBond; - type ProposalBondMinimum = ProposalBondMinimum; - type ProposalBondMaximum = ProposalBondMaximum; - type SpendPeriod = SpendPeriod; - type Burn = Burn; - type BurnDestination = (); - type SpendFunds = (); - type WeightInfo = pallet_treasury::weights::SubstrateWeight; - type MaxApprovals = MaxApprovals; -} - -impl pallet_sudo::Config for Runtime { - type Event = Event; - type Call = Call; -} - -pub struct RelayChainBlockNumberProvider(sp_std::marker::PhantomData); - -impl BlockNumberProvider - for RelayChainBlockNumberProvider -{ - type BlockNumber = BlockNumber; - - fn current_block_number() -> Self::BlockNumber { - cumulus_pallet_parachain_system::Pallet::::validation_data() - .map(|d| d.relay_parent_number) - .unwrap_or_default() - } -} - -parameter_types! { - pub const MinVestedTransfer: Balance = 10 * UNIQUE; - pub const MaxVestingSchedules: u32 = 28; -} - -impl orml_vesting::Config for Runtime { - type Event = Event; - type Currency = pallet_balances::Pallet; - type MinVestedTransfer = MinVestedTransfer; - type VestedTransferOrigin = EnsureSigned; - type WeightInfo = (); - type MaxVestingSchedules = MaxVestingSchedules; - type BlockNumberProvider = RelayChainBlockNumberProvider; -} - -parameter_types! { - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; -} - -impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; - type SelfParaId = parachain_info::Pallet; - type OnSystemEvent = (); - // type DownwardMessageHandlers = cumulus_primitives_utility::UnqueuedDmpAsParent< - // MaxDownwardMessageWeight, - // XcmExecutor, - // Call, - // >; - type OutboundXcmpMessageSource = XcmpQueue; - type DmpMessageHandler = DmpQueue; - type ReservedDmpWeight = ReservedDmpWeight; - type ReservedXcmpWeight = ReservedXcmpWeight; - type XcmpMessageHandler = XcmpQueue; -} - -impl parachain_info::Config for Runtime {} - -impl cumulus_pallet_aura_ext::Config for Runtime {} - -parameter_types! { - pub const RelayLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); - pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); -} - -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. -pub type LocationToAccountId = ( - // The parent (Relay-chain) origin converts to the default `AccountId`. - ParentIsPreset, - // Sibling parachain origins convert to AccountId via the `ParaId::into`. - SiblingParachainConvertsVia, - // Straight up local `AccountId32` origins just alias directly to `AccountId`. - AccountId32Aliases, -); - -pub struct OnlySelfCurrency; -impl> MatchesFungible for OnlySelfCurrency { - fn matches_fungible(a: &MultiAsset) -> Option { - match (&a.id, &a.fun) { - (Concrete(_), XcmFungible(ref amount)) => CheckedConversion::checked_from(*amount), - _ => None, - } - } -} - -/// Means for transacting assets on this chain. -pub type LocalAssetTransactor = CurrencyAdapter< - // Use this currency: - Balances, - // Use this currency when it is a fungible asset matching the given location or name: - OnlySelfCurrency, - // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We don't track any teleports. - (), ->; - -/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. -pub type XcmOriginToTransactDispatchOrigin = ( - // Sovereign account converter; this attempts to derive an `AccountId` from the origin location - // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for - // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, - // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when - // recognised. - RelayChainAsNative, - // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when - // recognised. - SiblingParachainAsNative, - // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a - // transaction from the Root origin. - ParentAsSuperuser, - // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, - // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, -); - -parameter_types! { - // One XCM operation is 1_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000; - // 1200 UNIQUEs buy 1 second of weight. - pub const WeightPrice: (MultiLocation, u128) = (MultiLocation::parent(), 1_200 * UNIQUE); - pub const MaxInstructions: u32 = 100; - pub const MaxAuthorities: u32 = 100_000; -} - -match_types! { - pub type ParentOrParentsUnitPlurality: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) } - }; -} - -pub type Barrier = ( - TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, - // ^^^ Parent & its unit plurality gets free execution -); - -pub struct UsingOnlySelfCurrencyComponents< - WeightToFee: WeightToFeePolynomial, - AssetId: Get, - AccountId, - Currency: CurrencyT, - OnUnbalanced: OnUnbalancedT, ->( - Weight, - Currency::Balance, - PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>, -); -impl< - WeightToFee: WeightToFeePolynomial, - AssetId: Get, - AccountId, - Currency: CurrencyT, - OnUnbalanced: OnUnbalancedT, - > WeightTrader - for UsingOnlySelfCurrencyComponents -{ - fn new() -> Self { - Self(0, Zero::zero(), PhantomData) - } - - fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { - let amount = WeightToFee::weight_to_fee(&weight); - let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?; - - // location to this parachain through relay chain - let option1: xcm::v1::AssetId = Concrete(MultiLocation { - parents: 1, - interior: X1(Parachain(ParachainInfo::parachain_id().into())), - }); - // direct location - let option2: xcm::v1::AssetId = Concrete(MultiLocation { - parents: 0, - interior: Here, - }); - - let required = if payment.fungible.contains_key(&option1) { - (option1, u128_amount).into() - } else if payment.fungible.contains_key(&option2) { - (option2, u128_amount).into() - } else { - (Concrete(MultiLocation::default()), u128_amount).into() - }; - - let unused = payment - .checked_sub(required) - .map_err(|_| XcmError::TooExpensive)?; - self.0 = self.0.saturating_add(weight); - self.1 = self.1.saturating_add(amount); - Ok(unused) - } - - fn refund_weight(&mut self, weight: Weight) -> Option { - let weight = weight.min(self.0); - let amount = WeightToFee::weight_to_fee(&weight); - self.0 -= weight; - self.1 = self.1.saturating_sub(amount); - let amount: u128 = amount.saturated_into(); - if amount > 0 { - Some((AssetId::get(), amount).into()) - } else { - None - } - } -} -impl< - WeightToFee: WeightToFeePolynomial, - AssetId: Get, - AccountId, - Currency: CurrencyT, - OnUnbalanced: OnUnbalancedT, - > Drop - for UsingOnlySelfCurrencyComponents -{ - fn drop(&mut self) { - OnUnbalanced::on_unbalanced(Currency::issue(self.1)); - } -} - -pub struct XcmConfig; -impl Config for XcmConfig { - type Call = Call; - type XcmSender = XcmRouter; - // How to withdraw and deposit an asset. - type AssetTransactor = LocalAssetTransactor; - type OriginConverter = XcmOriginToTransactDispatchOrigin; - type IsReserve = NativeAsset; - type IsTeleporter = (); // Teleportation is disabled - type LocationInverter = LocationInverter; - type Barrier = Barrier; - type Weigher = FixedWeightBounds; - type Trader = - UsingOnlySelfCurrencyComponents, RelayLocation, AccountId, Balances, ()>; - type ResponseHandler = (); // Don't handle responses for now. - type SubscriptionService = PolkadotXcm; - - type AssetTrap = PolkadotXcm; - type AssetClaims = PolkadotXcm; -} - -// parameter_types! { -// pub const MaxDownwardMessageWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 10; -// } - -/// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = (SignedToAccountId32,); - -/// The means for routing XCM messages which are not for local execution into the right message -/// queues. -pub type XcmRouter = ( - // Two routers - use UMP to communicate with the relay chain: - cumulus_primitives_utility::ParentAsUmp, - // ..and XCMP to communicate with the sibling chains. - XcmpQueue, -); - -impl pallet_evm_coder_substrate::Config for Runtime {} - -impl pallet_xcm::Config for Runtime { - type Event = Event; - type SendXcmOrigin = EnsureXcmOrigin; - type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; - type XcmExecuteFilter = Everything; - type XcmExecutor = XcmExecutor; - type XcmTeleportFilter = Everything; - type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; - type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; - const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; - type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; -} - -impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor; -} - -impl cumulus_pallet_xcmp_queue::Config for Runtime { - type WeightInfo = (); - type Event = Event; - type XcmExecutor = XcmExecutor; - type ChannelInfo = ParachainSystem; - type VersionWrapper = (); - type ExecuteOverweightOrigin = frame_system::EnsureRoot; - type ControllerOrigin = EnsureRoot; - type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; -} - -impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor; - type ExecuteOverweightOrigin = frame_system::EnsureRoot; -} - -impl pallet_aura::Config for Runtime { - type AuthorityId = AuraId; - type DisabledValidators = (); - type MaxAuthorities = MaxAuthorities; -} - -parameter_types! { - pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account_truncating(); - pub const CollectionCreationPrice: Balance = 2 * UNIQUE; -} - -impl pallet_common::Config for Runtime { - type WeightInfo = pallet_common::weights::SubstrateWeight; - type Event = Event; - type Currency = Balances; - type CollectionCreationPrice = CollectionCreationPrice; - type TreasuryAccountId = TreasuryAccountId; - type CollectionDispatch = CollectionDispatchT; - - type EvmTokenAddressMapping = EvmTokenAddressMapping; - type CrossTokenAddressMapping = CrossTokenAddressMapping; - type ContractAddress = EvmCollectionHelpersAddress; -} - -impl pallet_structure::Config for Runtime { - type Event = Event; - type Call = Call; - type WeightInfo = pallet_structure::weights::SubstrateWeight; -} - -impl pallet_fungible::Config for Runtime { - type WeightInfo = pallet_fungible::weights::SubstrateWeight; -} -impl pallet_refungible::Config for Runtime { - type WeightInfo = pallet_refungible::weights::SubstrateWeight; -} -impl pallet_nonfungible::Config for Runtime { - type WeightInfo = pallet_nonfungible::weights::SubstrateWeight; -} - -#[cfg(feature = "rmrk")] -impl pallet_proxy_rmrk_core::Config for Runtime { - type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight; - type Event = Event; -} - -#[cfg(feature = "rmrk")] -impl pallet_proxy_rmrk_equip::Config for Runtime { - type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight; - type Event = Event; -} - -impl pallet_unique::Config for Runtime { - type Event = Event; - type WeightInfo = pallet_unique::weights::SubstrateWeight; - type CommonWeightInfo = CommonWeights; - type RefungibleExtensionsWeightInfo = CommonWeights; -} - -parameter_types! { - pub const InflationBlockInterval: BlockNumber = 100; // every time per how many blocks inflation is applied -} - -/// Used for the pallet inflation -impl pallet_inflation::Config for Runtime { - type Currency = Balances; - type TreasuryAccountId = TreasuryAccountId; - type InflationBlockInterval = InflationBlockInterval; - type BlockNumberProvider = RelayChainBlockNumberProvider; -} - -parameter_types! { - pub MaximumSchedulerWeight: Weight = Perbill::from_percent(50) * - RuntimeBlockWeights::get().max_block; - pub const MaxScheduledPerBlock: u32 = 50; -} - -type ChargeTransactionPayment = pallet_charge_transaction::ChargeTransactionPayment; - -#[cfg(feature = "scheduler")] -use frame_support::traits::NamedReservableCurrency; - -#[cfg(feature = "scheduler")] -fn get_signed_extras(from: ::AccountId) -> SignedExtraScheduler { - ( - frame_system::CheckSpecVersion::::new(), - frame_system::CheckGenesis::::new(), - frame_system::CheckEra::::from(Era::Immortal), - frame_system::CheckNonce::::from(frame_system::Pallet::::account_nonce( - from, - )), - frame_system::CheckWeight::::new(), - // sponsoring transaction logic - // pallet_charge_transaction::ChargeTransactionPayment::::new(0), - ) -} - -#[cfg(feature = "scheduler")] -pub struct SchedulerPaymentExecutor; - -#[cfg(feature = "scheduler")] -impl - DispatchCall for SchedulerPaymentExecutor -where - ::Call: Member - + Dispatchable - + SelfContainedCall - + GetDispatchInfo - + From>, - SelfContainedSignedInfo: Send + Sync + 'static, - Call: From<::Call> - + From<::Call> - + SelfContainedCall, - sp_runtime::AccountId32: From<::AccountId>, -{ - fn dispatch_call( - signer: ::AccountId, - call: ::Call, - ) -> Result< - Result>, - TransactionValidityError, - > { - let dispatch_info = call.get_dispatch_info(); - let extrinsic = fp_self_contained::CheckedExtrinsic::< - AccountId, - Call, - SignedExtraScheduler, - SelfContainedSignedInfo, - > { - signed: - CheckedSignature::::Signed( - signer.clone().into(), - get_signed_extras(signer.into()), - ), - function: call.into(), - }; - - extrinsic.apply::(&dispatch_info, 0) - } - - fn reserve_balance( - id: [u8; 16], - sponsor: ::AccountId, - call: ::Call, - count: u32, - ) -> Result<(), DispatchError> { - let dispatch_info = call.get_dispatch_info(); - let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0) - .saturating_mul(count.into()); - - >::reserve_named( - &id, - &(sponsor.into()), - weight, - ) - } - - fn pay_for_call( - id: [u8; 16], - sponsor: ::AccountId, - call: ::Call, - ) -> Result { - let dispatch_info = call.get_dispatch_info(); - let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0); - Ok( - >::unreserve_named( - &id, - &(sponsor.into()), - weight, - ), - ) - } - - fn cancel_reserve( - id: [u8; 16], - sponsor: ::AccountId, - ) -> Result { - Ok( - >::unreserve_named( - &id, - &(sponsor.into()), - u128::MAX, - ), - ) - } -} - -parameter_types! { - pub const NoPreimagePostponement: Option = Some(10); - pub const Preimage: Option = Some(10); -} - -/// Used the compare the privilege of an origin inside the scheduler. -pub struct OriginPrivilegeCmp; - -impl PrivilegeCmp for OriginPrivilegeCmp { - fn cmp_privilege(_left: &OriginCaller, _right: &OriginCaller) -> Option { - Some(Ordering::Equal) - } -} - -#[cfg(feature = "scheduler")] -impl pallet_unique_scheduler::Config for Runtime { - type Event = Event; - type Origin = Origin; - type Currency = Balances; - type PalletsOrigin = OriginCaller; - type Call = Call; - type MaximumWeight = MaximumSchedulerWeight; - type ScheduleOrigin = EnsureSigned; - type MaxScheduledPerBlock = MaxScheduledPerBlock; - type WeightInfo = (); - type CallExecutor = SchedulerPaymentExecutor; - type OriginPrivilegeCmp = OriginPrivilegeCmp; - type PreimageProvider = (); - type NoPreimagePostponement = NoPreimagePostponement; -} - -type EvmSponsorshipHandler = ( - UniqueEthSponsorshipHandler, - pallet_evm_contract_helpers::HelpersContractSponsoring, -); -type SponsorshipHandler = ( - UniqueSponsorshipHandler, - //pallet_contract_helpers::ContractSponsorshipHandler, - pallet_evm_transaction_payment::BridgeSponsorshipHandler, -); - -impl pallet_evm_transaction_payment::Config for Runtime { - type EvmSponsorshipHandler = EvmSponsorshipHandler; - type Currency = Balances; -} - -impl pallet_charge_transaction::Config for Runtime { - type SponsorshipHandler = SponsorshipHandler; -} - -// impl pallet_contract_helpers::Config for Runtime { -// type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; -// } - -parameter_types! { - // 0x842899ECF380553E8a4de75bF534cdf6fBF64049 - pub const HelpersContractAddress: H160 = H160([ - 0x84, 0x28, 0x99, 0xec, 0xf3, 0x80, 0x55, 0x3e, 0x8a, 0x4d, 0xe7, 0x5b, 0xf5, 0x34, 0xcd, 0xf6, 0xfb, 0xf6, 0x40, 0x49, - ]); - - // 0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f - pub const EvmCollectionHelpersAddress: H160 = H160([ - 0x6c, 0x4e, 0x9f, 0xe1, 0xae, 0x37, 0xa4, 0x1e, 0x93, 0xce, 0xe4, 0x29, 0xe8, 0xe1, 0x88, 0x1a, 0xbd, 0xcb, 0xb5, 0x4f, - ]); -} - -impl pallet_evm_contract_helpers::Config for Runtime { - type ContractAddress = HelpersContractAddress; - type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; -} - construct_runtime!(opal); -pub struct TransactionConverter; - -impl fp_rpc::ConvertTransaction for TransactionConverter { - fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic { - UncheckedExtrinsic::new_unsigned( - pallet_ethereum::Call::::transact { transaction }.into(), - ) - } -} - -impl fp_rpc::ConvertTransaction for TransactionConverter { - fn convert_transaction( - &self, - transaction: pallet_ethereum::Transaction, - ) -> opaque::UncheckedExtrinsic { - let extrinsic = UncheckedExtrinsic::new_unsigned( - pallet_ethereum::Call::::transact { transaction }.into(), - ); - let encoded = extrinsic.encode(); - opaque::UncheckedExtrinsic::decode(&mut &encoded[..]) - .expect("Encoded extrinsic is always valid") - } -} - -/// The address format for describing accounts. -pub type Address = sp_runtime::MultiAddress; -/// Block header type as expected by this runtime. -pub type Header = generic::Header; -/// Block type as expected by this runtime. -pub type Block = generic::Block; -/// A Block signed with a Justification -pub type SignedBlock = generic::SignedBlock; -/// BlockId type as expected by this runtime. -pub type BlockId = generic::BlockId; -/// The SignedExtension to the basic transaction logic. -pub type SignedExtra = ( - frame_system::CheckSpecVersion, - // system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - ChargeTransactionPayment, - //pallet_contract_helpers::ContractHelpersExtension, - pallet_ethereum::FakeTransactionFinalizer, -); -pub type SignedExtraScheduler = ( - frame_system::CheckSpecVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, -); -/// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = - fp_self_contained::UncheckedExtrinsic; -/// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = fp_self_contained::CheckedExtrinsic; -/// Executive: handles dispatch to the various modules. -pub type Executive = frame_executive::Executive< - Runtime, - Block, - frame_system::ChainContext, - Runtime, - AllPalletsReversedWithSystemFirst, ->; - -impl_opaque_keys! { - pub struct SessionKeys { - pub aura: Aura, - } -} - -impl fp_self_contained::SelfContainedCall for Call { - type SignedInfo = H160; - - fn is_self_contained(&self) -> bool { - match self { - Call::Ethereum(call) => call.is_self_contained(), - _ => false, - } - } - - fn check_self_contained(&self) -> Option> { - match self { - Call::Ethereum(call) => call.check_self_contained(), - _ => None, - } - } - - fn validate_self_contained( - &self, - info: &Self::SignedInfo, - dispatch_info: &DispatchInfoOf, - len: usize, - ) -> Option { - match self { - Call::Ethereum(call) => call.validate_self_contained(info, dispatch_info, len), - _ => None, - } - } - - fn pre_dispatch_self_contained( - &self, - info: &Self::SignedInfo, - ) -> Option> { - match self { - Call::Ethereum(call) => call.pre_dispatch_self_contained(info), - _ => None, - } - } - - fn apply_self_contained( - self, - info: Self::SignedInfo, - ) -> Option>> { - match self { - call @ Call::Ethereum(pallet_ethereum::Call::transact { .. }) => Some(call.dispatch( - Origin::from(pallet_ethereum::RawOrigin::EthereumTransaction(info)), - )), - _ => None, - } - } -} - -macro_rules! dispatch_unique_runtime { - ($collection:ident.$method:ident($($name:ident),*)) => {{ - let collection = ::CollectionDispatch::dispatch(>::try_get($collection)?); - let dispatch = collection.as_dyn(); - - Ok::<_, DispatchError>(dispatch.$method($($name),*)) - }}; -} - impl_common_runtime_apis!(); -struct CheckInherents; - -impl cumulus_pallet_parachain_system::CheckInherents for CheckInherents { - fn check_inherents( - block: &Block, - relay_state_proof: &cumulus_pallet_parachain_system::RelayChainStateProof, - ) -> sp_inherents::CheckInherentsResult { - let relay_chain_slot = relay_state_proof - .read_slot() - .expect("Could not read the relay chain slot from the proof"); - - let inherent_data = - cumulus_primitives_timestamp::InherentDataProvider::from_relay_chain_slot_and_duration( - relay_chain_slot, - sp_std::time::Duration::from_secs(6), - ) - .create_inherent_data() - .expect("Could not create the timestamp inherent data"); - - inherent_data.check_extrinsics(block) - } -} - cumulus_pallet_parachain_system::register_validate_block!( Runtime = Runtime, BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index 6a70aabe1f..bf70d7d4d3 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -4,7 +4,6 @@ version = "0.1.0" edition = "2021" [dependencies] -unique-runtime-common = { path = '../common' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } sp-core = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } @@ -37,3 +36,7 @@ parity-scale-codec = { version = "3.1.2", default-features = false, features = [ "derive", ] } scale-info = "*" + +common-types = { path = "../../common-types", default-features = false } +evm-coder = { default-features = false, path = '../../crates/evm-coder' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.24' } diff --git a/runtime/tests/src/lib.rs b/runtime/tests/src/lib.rs index 2a993e88c0..ce97c46911 100644 --- a/runtime/tests/src/lib.rs +++ b/runtime/tests/src/lib.rs @@ -35,9 +35,18 @@ use fp_evm_mapping::EvmBackwardsAddressMapping; use parity_scale_codec::{Encode, Decode, MaxEncodedLen}; use scale_info::TypeInfo; -use unique_runtime_common::{dispatch::CollectionDispatchT, weights::CommonWeights}; use up_data_structs::mapping::{CrossTokenAddressMapping, EvmTokenAddressMapping}; +#[path = "../../common/dispatch.rs"] +mod dispatch; + +use dispatch::CollectionDispatchT; + +#[path = "../../common/weights.rs"] +mod weights; + +use weights::CommonWeights; + type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; From e04c397d4e378183e67d2f20c3e59b1bedffdd59 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 8 Aug 2022 15:31:53 +0000 Subject: [PATCH 0279/1274] refactor: minimize quartz/unique runtime --- runtime/quartz/src/lib.rs | 1249 +----------------------------------- runtime/unique/src/lib.rs | 1250 +------------------------------------ 2 files changed, 12 insertions(+), 2487 deletions(-) diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index f6f4430d99..469580944c 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -25,176 +25,21 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); -use sp_api::impl_runtime_apis; -use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160}; -use sp_runtime::DispatchError; -#[cfg(feature = "scheduler")] -use fp_self_contained::*; +use frame_support::parameter_types; -#[cfg(feature = "scheduler")] -use sp_runtime::{ - traits::{Applyable, Member}, - generic::Era, - DispatchErrorWithPostInfo, -}; -// #[cfg(any(feature = "std", test))] -// pub use sp_runtime::BuildStorage; - -use sp_runtime::{ - Permill, Perbill, Percent, create_runtime_str, generic, impl_opaque_keys, - traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion, Zero}, - transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, RuntimeAppPublic, -}; - -use sp_std::prelude::*; - -#[cfg(feature = "std")] -use sp_version::NativeVersion; use sp_version::RuntimeVersion; -pub use pallet_transaction_payment::{ - Multiplier, TargetedFeeAdjustment, FeeDetails, RuntimeDispatchInfo, -}; -// A few exports that help ease life for downstream crates. -pub use pallet_balances::Call as BalancesCall; -pub use pallet_evm::{ - EnsureAddressTruncated, HashedAddressMapping, Runner, account::CrossAccountId as _, - OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping, -}; -pub use frame_support::{ - match_types, - dispatch::DispatchResult, - PalletId, parameter_types, StorageValue, ConsensusEngineId, - traits::{ - tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Everything, - Currency, ExistenceRequirement, Get, IsInVec, KeyOwnerProofSystem, LockIdentifier, - OnUnbalanced, Randomness, FindAuthor, ConstU32, Imbalance, PrivilegeCmp, - }, - weights::{ - constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, - DispatchClass, DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight, - WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, ConstantMultiplier, - WeightToFee, - }, -}; - -#[cfg(feature = "scheduler")] -use pallet_unique_scheduler::DispatchCall; - -use up_data_structs::{ - CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits, - CollectionStats, RpcCollection, - mapping::{EvmTokenAddressMapping, CrossTokenAddressMapping}, - TokenChild, RmrkCollectionInfo, RmrkInstanceInfo, RmrkResourceInfo, RmrkPropertyInfo, - RmrkBaseInfo, RmrkPartType, RmrkTheme, RmrkThemeName, RmrkCollectionId, RmrkNftId, - RmrkNftChild, RmrkPropertyKey, RmrkResourceId, RmrkBaseId, -}; +use sp_runtime::create_runtime_str; -// use pallet_contracts::weights::WeightInfo; -// #[cfg(any(feature = "std", test))] -use frame_system::{ - self as frame_system, EnsureRoot, EnsureSigned, - limits::{BlockWeights, BlockLength}, -}; -use sp_arithmetic::{ - traits::{BaseArithmetic, Unsigned}, -}; -use smallvec::smallvec; -use codec::{Encode, Decode}; -use fp_rpc::TransactionStatus; -use sp_runtime::{ - traits::{ - BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, Saturating, - CheckedConversion, - }, - transaction_validity::TransactionValidityError, - SaturatedConversion, -}; +use common_types::*; -// pub use pallet_timestamp::Call as TimestampCall; -pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; +#[path = "../../common/mod.rs"] +mod runtime_common; -// Polkadot imports -use pallet_xcm::XcmPassthrough; -use polkadot_parachain::primitives::Sibling; -use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*}; -use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative, - SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ParentIsPreset, -}; -use xcm_executor::{Config, XcmExecutor, Assets}; -use sp_std::{cmp::Ordering, marker::PhantomData}; - -use xcm::latest::{ - // Xcm, - AssetId::{Concrete}, - Fungibility::Fungible as XcmFungible, - MultiAsset, - Error as XcmError, -}; -use xcm_executor::traits::{MatchesFungible, WeightTrader}; - -use unique_runtime_common::{ - construct_runtime, impl_common_runtime_apis, - types::*, - constants::*, - dispatch::{CollectionDispatchT, CollectionDispatch}, - sponsoring::UniqueSponsorshipHandler, - eth_sponsoring::UniqueEthSponsorshipHandler, - weights::CommonWeights, -}; +pub use runtime_common::*; pub const RUNTIME_NAME: &str = "quartz"; pub const TOKEN_SYMBOL: &str = "QTZ"; -type CrossAccountId = pallet_evm::account::BasicCrossAccountId; - -impl RuntimeInstance for Runtime { - type CrossAccountId = self::CrossAccountId; - - type TransactionConverter = self::TransactionConverter; - - fn get_transaction_converter() -> TransactionConverter { - TransactionConverter - } -} - -/// The type for looking up accounts. We don't expect more than 4 billion of them, but you -/// never know... -pub type AccountIndex = u32; - -/// Balance of an account. -pub type Balance = u128; - -/// Index of a transaction in the chain. -pub type Index = u32; - -/// A hash of some data used by the chain. -pub type Hash = sp_core::H256; - -/// Digest item type. -pub type DigestItem = generic::DigestItem; - -/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know -/// the specifics of the runtime. They can then be made to be agnostic over specific formats -/// of data like extrinsics, allowing for them to continue syncing the network through upgrades -/// to even the core data structures. -pub mod opaque { - use sp_std::prelude::*; - use sp_runtime::impl_opaque_keys; - use super::Aura; - - pub use unique_runtime_common::types::*; - - impl_opaque_keys! { - pub struct SessionKeys { - pub aura: Aura, - } - } -} - /// This runtime version. pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), @@ -207,1098 +52,16 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { state_version: 0, }; -#[derive(codec::Encode, codec::Decode)] -pub enum XCMPMessage { - /// Transfer tokens to the given account from the Parachain account. - TransferToken(XAccountId, XBalance), -} - -/// The version information used to identify this runtime when compiled natively. -#[cfg(feature = "std")] -pub fn native_version() -> NativeVersion { - NativeVersion { - runtime_version: VERSION, - can_author_with: Default::default(), - } -} - -type NegativeImbalance = >::NegativeImbalance; - -pub struct DealWithFees; -impl OnUnbalanced for DealWithFees { - fn on_unbalanceds(mut fees_then_tips: impl Iterator) { - if let Some(fees) = fees_then_tips.next() { - // for fees, 100% to treasury - let mut split = fees.ration(100, 0); - if let Some(tips) = fees_then_tips.next() { - // for tips, if any, 100% to treasury - tips.ration_merge_into(100, 0, &mut split); - } - Treasury::on_unbalanced(split.0); - // Author::on_unbalanced(split.1); - } - } -} - parameter_types! { - pub const BlockHashCount: BlockNumber = 2400; - pub RuntimeBlockLength: BlockLength = - BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); - pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); - pub const MaximumBlockLength: u32 = 5 * 1024 * 1024; - pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() - .base_block(BlockExecutionWeight::get()) - .for_class(DispatchClass::all(), |weights| { - weights.base_extrinsic = ExtrinsicBaseWeight::get(); - }) - .for_class(DispatchClass::Normal, |weights| { - weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); - }) - .for_class(DispatchClass::Operational, |weights| { - weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); - // Operational transactions have some extra reserved space, so that they - // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. - weights.reserved = Some( - MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT - ); - }) - .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) - .build_or_panic(); pub const Version: RuntimeVersion = VERSION; pub const SS58Prefix: u8 = 255; -} - -parameter_types! { pub const ChainId: u64 = 8881; } -pub struct FixedFee; -impl FeeCalculator for FixedFee { - fn min_gas_price() -> (U256, u64) { - (MIN_GAS_PRICE.into(), 0) - } -} - -// Assuming slowest ethereum opcode is SSTORE, with gas price of 20000 as our worst case -// (contract, which only writes a lot of data), -// approximating on top of our real store write weight -parameter_types! { - pub const WritesPerSecond: u64 = WEIGHT_PER_SECOND / ::DbWeight::get().write; - pub const GasPerSecond: u64 = WritesPerSecond::get() * 20000; - pub const WeightPerGas: u64 = WEIGHT_PER_SECOND / GasPerSecond::get(); -} - -/// Limiting EVM execution to 50% of block for substrate users and management tasks -/// EVM transaction consumes more weight than substrate's, so we can't rely on them being -/// scheduled fairly -const EVM_DISPATCH_RATIO: Perbill = Perbill::from_percent(50); -parameter_types! { - pub BlockGasLimit: U256 = U256::from(NORMAL_DISPATCH_RATIO * EVM_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT / WeightPerGas::get()); -} - -pub enum FixedGasWeightMapping {} -impl GasWeightMapping for FixedGasWeightMapping { - fn gas_to_weight(gas: u64) -> Weight { - gas.saturating_mul(WeightPerGas::get()) - } - fn weight_to_gas(weight: Weight) -> u64 { - weight / WeightPerGas::get() - } -} - -impl pallet_evm::account::Config for Runtime { - type CrossAccountId = pallet_evm::account::BasicCrossAccountId; - type EvmAddressMapping = HashedAddressMapping; - type EvmBackwardsAddressMapping = fp_evm_mapping::MapBackwardsAddressTruncated; -} - -impl pallet_evm::Config for Runtime { - type BlockGasLimit = BlockGasLimit; - type FeeCalculator = FixedFee; - type GasWeightMapping = FixedGasWeightMapping; - type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping; - type CallOrigin = EnsureAddressTruncated; - type WithdrawOrigin = EnsureAddressTruncated; - type AddressMapping = HashedAddressMapping; - type PrecompilesType = (); - type PrecompilesValue = (); - type Currency = Balances; - type Event = Event; - type OnMethodCall = ( - pallet_evm_migration::OnMethodCall, - pallet_evm_contract_helpers::HelpersOnMethodCall, - CollectionDispatchT, - pallet_unique::eth::CollectionHelpersOnMethodCall, - ); - type OnCreate = pallet_evm_contract_helpers::HelpersOnCreate; - type ChainId = ChainId; - type Runner = pallet_evm::runner::stack::Runner; - type OnChargeTransaction = pallet_evm::EVMCurrencyAdapter; - type TransactionValidityHack = pallet_evm_transaction_payment::TransactionValidityHack; - type FindAuthor = EthereumFindAuthor; -} - -impl pallet_evm_migration::Config for Runtime { - type WeightInfo = pallet_evm_migration::weights::SubstrateWeight; -} - -pub struct EthereumFindAuthor(core::marker::PhantomData); -impl> FindAuthor for EthereumFindAuthor { - fn find_author<'a, I>(digests: I) -> Option - where - I: 'a + IntoIterator, - { - if let Some(author_index) = F::find_author(digests) { - let authority_id = Aura::authorities()[author_index as usize].clone(); - return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24])); - } - None - } -} - -impl pallet_ethereum::Config for Runtime { - type Event = Event; - type StateRoot = pallet_ethereum::IntermediateStateRoot; -} - -impl pallet_randomness_collective_flip::Config for Runtime {} - -impl frame_system::Config for Runtime { - /// The data to be stored in an account. - type AccountData = pallet_balances::AccountData; - /// The identifier used to distinguish between accounts. - type AccountId = AccountId; - /// The basic call filter to use in dispatchable. - type BaseCallFilter = Everything; - /// Maximum number of block number to block hash mappings to keep (oldest pruned first). - type BlockHashCount = BlockHashCount; - /// The maximum length of a block (in bytes). - type BlockLength = RuntimeBlockLength; - /// The index type for blocks. - type BlockNumber = BlockNumber; - /// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block. - type BlockWeights = RuntimeBlockWeights; - /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; - /// The weight of database operations that the runtime can invoke. - type DbWeight = RocksDbWeight; - /// The ubiquitous event type. - type Event = Event; - /// The type for hashing blocks and tries. - type Hash = Hash; - /// The hashing algorithm used. - type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; - /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The lookup mechanism to get account ID from whatever is passed in dispatchers. - type Lookup = AccountIdLookup; - /// What to do if an account is fully reaped from the system. - type OnKilledAccount = (); - /// What to do if a new account is created. - type OnNewAccount = (); - type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; - /// The ubiquitous origin type. - type Origin = Origin; - /// This type is being generated by `construct_runtime!`. - type PalletInfo = PalletInfo; - /// This is used as an identifier of the chain. 42 is the generic substrate prefix. - type SS58Prefix = SS58Prefix; - /// Weight information for the extrinsics of this pallet. - type SystemWeightInfo = frame_system::weights::SubstrateWeight; - /// Version of the runtime. - type Version = Version; - type MaxConsumers = ConstU32<16>; -} - -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; -} - -impl pallet_timestamp::Config for Runtime { - /// A timestamp: milliseconds since the unix epoch. - type Moment = u64; - type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; - type WeightInfo = (); -} - -parameter_types! { - // pub const ExistentialDeposit: u128 = 500; - pub const ExistentialDeposit: u128 = 0; - pub const MaxLocks: u32 = 50; - pub const MaxReserves: u32 = 50; -} - -impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; - type MaxReserves = MaxReserves; - type ReserveIdentifier = [u8; 16]; - /// The type for recording an account's balance. - type Balance = Balance; - /// The ubiquitous event type. - type Event = Event; - type DustRemoval = Treasury; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = pallet_balances::weights::SubstrateWeight; -} - -pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 15 * CENTIUNIQUE + (bytes as Balance) * 6 * CENTIUNIQUE -} - -/* -parameter_types! { - pub TombstoneDeposit: Balance = deposit( - 1, - sp_std::mem::size_of::> as u32, - ); - pub DepositPerContract: Balance = TombstoneDeposit::get(); - pub const DepositPerStorageByte: Balance = deposit(0, 1); - pub const DepositPerStorageItem: Balance = deposit(1, 0); - pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * DAYS); - pub const SurchargeReward: Balance = 150 * MILLIUNIQUE; - pub const SignedClaimHandicap: u32 = 2; - pub const MaxDepth: u32 = 32; - pub const MaxValueSize: u32 = 16 * 1024; - pub const MaxCodeSize: u32 = 1024 * 1024 * 25; // 25 Mb - // The lazy deletion runs inside on_initialize. - pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO * - RuntimeBlockWeights::get().max_block; - // The weight needed for decoding the queue should be less or equal than a fifth - // of the overall weight dedicated to the lazy deletion. - pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / ( - ::WeightInfo::on_initialize_per_queue_item(1) - - ::WeightInfo::on_initialize_per_queue_item(0) - )) / 5) as u32; - pub Schedule: pallet_contracts::Schedule = Default::default(); -} - -impl pallet_contracts::Config for Runtime { - type Time = Timestamp; - type Randomness = RandomnessCollectiveFlip; - type Currency = Balances; - type Event = Event; - type RentPayment = (); - type SignedClaimHandicap = SignedClaimHandicap; - type TombstoneDeposit = TombstoneDeposit; - type DepositPerContract = DepositPerContract; - type DepositPerStorageByte = DepositPerStorageByte; - type DepositPerStorageItem = DepositPerStorageItem; - type RentFraction = RentFraction; - type SurchargeReward = SurchargeReward; - type WeightPrice = pallet_transaction_payment::Pallet; - type WeightInfo = pallet_contracts::weights::SubstrateWeight; - type ChainExtension = NFTExtension; - type DeletionQueueDepth = DeletionQueueDepth; - type DeletionWeightLimit = DeletionWeightLimit; - type Schedule = Schedule; - type CallStack = [pallet_contracts::Frame; 31]; -} -*/ - -parameter_types! { - /// This value increases the priority of `Operational` transactions by adding - /// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`. - pub const OperationalFeeMultiplier: u8 = 5; -} - -/// Linear implementor of `WeightToFeePolynomial` -pub struct LinearFee(sp_std::marker::PhantomData); - -impl WeightToFeePolynomial for LinearFee -where - T: BaseArithmetic + From + Copy + Unsigned, -{ - type Balance = T; - - fn polynomial() -> WeightToFeeCoefficients { - smallvec!(WeightToFeeCoefficient { - coeff_integer: WEIGHT_TO_FEE_COEFF.into(), - coeff_frac: Perbill::zero(), - negative: false, - degree: 1, - }) - } -} - -impl pallet_transaction_payment::Config for Runtime { - type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; - type LengthToFee = ConstantMultiplier; - type OperationalFeeMultiplier = OperationalFeeMultiplier; - type WeightToFee = LinearFee; - type FeeMultiplierUpdate = (); -} - -parameter_types! { - pub const ProposalBond: Permill = Permill::from_percent(5); - pub const ProposalBondMinimum: Balance = 1 * UNIQUE; - pub const ProposalBondMaximum: Balance = 1000 * UNIQUE; - pub const SpendPeriod: BlockNumber = 5 * MINUTES; - pub const Burn: Permill = Permill::from_percent(0); - pub const TipCountdown: BlockNumber = 1 * DAYS; - pub const TipFindersFee: Percent = Percent::from_percent(20); - pub const TipReportDepositBase: Balance = 1 * UNIQUE; - pub const DataDepositPerByte: Balance = 1 * CENTIUNIQUE; - pub const BountyDepositBase: Balance = 1 * UNIQUE; - pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS; - pub const TreasuryModuleId: PalletId = PalletId(*b"py/trsry"); - pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS; - pub const MaximumReasonLength: u32 = 16384; - pub const BountyCuratorDeposit: Permill = Permill::from_percent(50); - pub const BountyValueMinimum: Balance = 5 * UNIQUE; - pub const MaxApprovals: u32 = 100; -} - -impl pallet_treasury::Config for Runtime { - type PalletId = TreasuryModuleId; - type Currency = Balances; - type ApproveOrigin = EnsureRoot; - type RejectOrigin = EnsureRoot; - type Event = Event; - type OnSlash = (); - type ProposalBond = ProposalBond; - type ProposalBondMinimum = ProposalBondMinimum; - type ProposalBondMaximum = ProposalBondMaximum; - type SpendPeriod = SpendPeriod; - type Burn = Burn; - type BurnDestination = (); - type SpendFunds = (); - type WeightInfo = pallet_treasury::weights::SubstrateWeight; - type MaxApprovals = MaxApprovals; -} - -impl pallet_sudo::Config for Runtime { - type Event = Event; - type Call = Call; -} - -pub struct RelayChainBlockNumberProvider(sp_std::marker::PhantomData); - -impl BlockNumberProvider - for RelayChainBlockNumberProvider -{ - type BlockNumber = BlockNumber; - - fn current_block_number() -> Self::BlockNumber { - cumulus_pallet_parachain_system::Pallet::::validation_data() - .map(|d| d.relay_parent_number) - .unwrap_or_default() - } -} - -parameter_types! { - pub const MinVestedTransfer: Balance = 10 * UNIQUE; - pub const MaxVestingSchedules: u32 = 28; -} - -impl orml_vesting::Config for Runtime { - type Event = Event; - type Currency = pallet_balances::Pallet; - type MinVestedTransfer = MinVestedTransfer; - type VestedTransferOrigin = EnsureSigned; - type WeightInfo = (); - type MaxVestingSchedules = MaxVestingSchedules; - type BlockNumberProvider = RelayChainBlockNumberProvider; -} - -parameter_types! { - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; -} - -impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; - type SelfParaId = parachain_info::Pallet; - type OnSystemEvent = (); - // type DownwardMessageHandlers = cumulus_primitives_utility::UnqueuedDmpAsParent< - // MaxDownwardMessageWeight, - // XcmExecutor, - // Call, - // >; - type OutboundXcmpMessageSource = XcmpQueue; - type DmpMessageHandler = DmpQueue; - type ReservedDmpWeight = ReservedDmpWeight; - type ReservedXcmpWeight = ReservedXcmpWeight; - type XcmpMessageHandler = XcmpQueue; -} - -impl parachain_info::Config for Runtime {} - -impl cumulus_pallet_aura_ext::Config for Runtime {} - -parameter_types! { - pub const RelayLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); - pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); -} - -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. -pub type LocationToAccountId = ( - // The parent (Relay-chain) origin converts to the default `AccountId`. - ParentIsPreset, - // Sibling parachain origins convert to AccountId via the `ParaId::into`. - SiblingParachainConvertsVia, - // Straight up local `AccountId32` origins just alias directly to `AccountId`. - AccountId32Aliases, -); - -pub struct OnlySelfCurrency; -impl> MatchesFungible for OnlySelfCurrency { - fn matches_fungible(a: &MultiAsset) -> Option { - match (&a.id, &a.fun) { - (Concrete(_), XcmFungible(ref amount)) => CheckedConversion::checked_from(*amount), - _ => None, - } - } -} - -/// Means for transacting assets on this chain. -pub type LocalAssetTransactor = CurrencyAdapter< - // Use this currency: - Balances, - // Use this currency when it is a fungible asset matching the given location or name: - OnlySelfCurrency, - // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We don't track any teleports. - (), ->; - -/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. -pub type XcmOriginToTransactDispatchOrigin = ( - // Sovereign account converter; this attempts to derive an `AccountId` from the origin location - // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for - // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, - // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when - // recognised. - RelayChainAsNative, - // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when - // recognised. - SiblingParachainAsNative, - // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a - // transaction from the Root origin. - ParentAsSuperuser, - // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, - // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, -); - -parameter_types! { - // One XCM operation is 1_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000; - // 1200 UNIQUEs buy 1 second of weight. - pub const WeightPrice: (MultiLocation, u128) = (MultiLocation::parent(), 1_200 * UNIQUE); - pub const MaxInstructions: u32 = 100; - pub const MaxAuthorities: u32 = 100_000; -} - -match_types! { - pub type ParentOrParentsUnitPlurality: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) } - }; -} - -pub type Barrier = ( - TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, - // ^^^ Parent & its unit plurality gets free execution -); - -pub struct UsingOnlySelfCurrencyComponents< - WeightToFee: WeightToFeePolynomial, - AssetId: Get, - AccountId, - Currency: CurrencyT, - OnUnbalanced: OnUnbalancedT, ->( - Weight, - Currency::Balance, - PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>, -); -impl< - WeightToFee: WeightToFeePolynomial, - AssetId: Get, - AccountId, - Currency: CurrencyT, - OnUnbalanced: OnUnbalancedT, - > WeightTrader - for UsingOnlySelfCurrencyComponents -{ - fn new() -> Self { - Self(0, Zero::zero(), PhantomData) - } - - fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { - let amount = WeightToFee::weight_to_fee(&weight); - let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?; - - // location to this parachain through relay chain - let option1: xcm::v1::AssetId = Concrete(MultiLocation { - parents: 1, - interior: X1(Parachain(ParachainInfo::parachain_id().into())), - }); - // direct location - let option2: xcm::v1::AssetId = Concrete(MultiLocation { - parents: 0, - interior: Here, - }); - - let required = if payment.fungible.contains_key(&option1) { - (option1, u128_amount).into() - } else if payment.fungible.contains_key(&option2) { - (option2, u128_amount).into() - } else { - (Concrete(MultiLocation::default()), u128_amount).into() - }; - - let unused = payment - .checked_sub(required) - .map_err(|_| XcmError::TooExpensive)?; - self.0 = self.0.saturating_add(weight); - self.1 = self.1.saturating_add(amount); - Ok(unused) - } - - fn refund_weight(&mut self, weight: Weight) -> Option { - let weight = weight.min(self.0); - let amount = WeightToFee::weight_to_fee(&weight); - self.0 -= weight; - self.1 = self.1.saturating_sub(amount); - let amount: u128 = amount.saturated_into(); - if amount > 0 { - Some((AssetId::get(), amount).into()) - } else { - None - } - } -} -impl< - WeightToFee: WeightToFeePolynomial, - AssetId: Get, - AccountId, - Currency: CurrencyT, - OnUnbalanced: OnUnbalancedT, - > Drop - for UsingOnlySelfCurrencyComponents -{ - fn drop(&mut self) { - OnUnbalanced::on_unbalanced(Currency::issue(self.1)); - } -} - -pub struct XcmConfig; -impl Config for XcmConfig { - type Call = Call; - type XcmSender = XcmRouter; - // How to withdraw and deposit an asset. - type AssetTransactor = LocalAssetTransactor; - type OriginConverter = XcmOriginToTransactDispatchOrigin; - type IsReserve = NativeAsset; - type IsTeleporter = (); // Teleportation is disabled - type LocationInverter = LocationInverter; - type Barrier = Barrier; - type Weigher = FixedWeightBounds; - type Trader = - UsingOnlySelfCurrencyComponents, RelayLocation, AccountId, Balances, ()>; - type ResponseHandler = (); // Don't handle responses for now. - type SubscriptionService = PolkadotXcm; - - type AssetTrap = PolkadotXcm; - type AssetClaims = PolkadotXcm; -} - -// parameter_types! { -// pub const MaxDownwardMessageWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 10; -// } - -/// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = (SignedToAccountId32,); - -/// The means for routing XCM messages which are not for local execution into the right message -/// queues. -pub type XcmRouter = ( - // Two routers - use UMP to communicate with the relay chain: - cumulus_primitives_utility::ParentAsUmp, - // ..and XCMP to communicate with the sibling chains. - XcmpQueue, -); - -impl pallet_evm_coder_substrate::Config for Runtime {} - -impl pallet_xcm::Config for Runtime { - type Event = Event; - type SendXcmOrigin = EnsureXcmOrigin; - type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; - type XcmExecuteFilter = Everything; - type XcmExecutor = XcmExecutor; - type XcmTeleportFilter = Everything; - type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; - type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; - const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; - type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; -} - -impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor; -} - -impl cumulus_pallet_xcmp_queue::Config for Runtime { - type WeightInfo = (); - type Event = Event; - type XcmExecutor = XcmExecutor; - type ChannelInfo = ParachainSystem; - type VersionWrapper = (); - type ExecuteOverweightOrigin = frame_system::EnsureRoot; - type ControllerOrigin = EnsureRoot; - type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; -} - -impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor; - type ExecuteOverweightOrigin = frame_system::EnsureRoot; -} - -impl pallet_aura::Config for Runtime { - type AuthorityId = AuraId; - type DisabledValidators = (); - type MaxAuthorities = MaxAuthorities; -} - -parameter_types! { - pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account_truncating(); - pub const CollectionCreationPrice: Balance = 2 * UNIQUE; -} - -impl pallet_common::Config for Runtime { - type WeightInfo = pallet_common::weights::SubstrateWeight; - type Event = Event; - type Currency = Balances; - type CollectionCreationPrice = CollectionCreationPrice; - type TreasuryAccountId = TreasuryAccountId; - type CollectionDispatch = CollectionDispatchT; - - type EvmTokenAddressMapping = EvmTokenAddressMapping; - type CrossTokenAddressMapping = CrossTokenAddressMapping; - type ContractAddress = EvmCollectionHelpersAddress; -} - -impl pallet_structure::Config for Runtime { - type Event = Event; - type Call = Call; - type WeightInfo = pallet_structure::weights::SubstrateWeight; -} - -impl pallet_fungible::Config for Runtime { - type WeightInfo = pallet_fungible::weights::SubstrateWeight; -} -impl pallet_refungible::Config for Runtime { - type WeightInfo = pallet_refungible::weights::SubstrateWeight; -} -impl pallet_nonfungible::Config for Runtime { - type WeightInfo = pallet_nonfungible::weights::SubstrateWeight; -} - -#[cfg(feature = "rmrk")] -impl pallet_proxy_rmrk_core::Config for Runtime { - type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight; - type Event = Event; -} - -#[cfg(feature = "rmrk")] -impl pallet_proxy_rmrk_equip::Config for Runtime { - type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight; - type Event = Event; -} - -impl pallet_unique::Config for Runtime { - type Event = Event; - type WeightInfo = pallet_unique::weights::SubstrateWeight; - type CommonWeightInfo = CommonWeights; - type RefungibleExtensionsWeightInfo = CommonWeights; -} - -parameter_types! { - pub const InflationBlockInterval: BlockNumber = 100; // every time per how many blocks inflation is applied -} - -/// Used for the pallet inflation -impl pallet_inflation::Config for Runtime { - type Currency = Balances; - type TreasuryAccountId = TreasuryAccountId; - type InflationBlockInterval = InflationBlockInterval; - type BlockNumberProvider = RelayChainBlockNumberProvider; -} - -parameter_types! { - pub MaximumSchedulerWeight: Weight = Perbill::from_percent(50) * - RuntimeBlockWeights::get().max_block; - pub const MaxScheduledPerBlock: u32 = 50; -} - -type ChargeTransactionPayment = pallet_charge_transaction::ChargeTransactionPayment; - -#[cfg(feature = "scheduler")] -use frame_support::traits::NamedReservableCurrency; - -#[cfg(feature = "scheduler")] -fn get_signed_extras(from: ::AccountId) -> SignedExtraScheduler { - ( - frame_system::CheckSpecVersion::::new(), - frame_system::CheckGenesis::::new(), - frame_system::CheckEra::::from(Era::Immortal), - frame_system::CheckNonce::::from(frame_system::Pallet::::account_nonce( - from, - )), - frame_system::CheckWeight::::new(), - // sponsoring transaction logic - // pallet_charge_transaction::ChargeTransactionPayment::::new(0), - ) -} - -#[cfg(feature = "scheduler")] -pub struct SchedulerPaymentExecutor; - -#[cfg(feature = "scheduler")] -impl - DispatchCall for SchedulerPaymentExecutor -where - ::Call: Member - + Dispatchable - + SelfContainedCall - + GetDispatchInfo - + From>, - SelfContainedSignedInfo: Send + Sync + 'static, - Call: From<::Call> - + From<::Call> - + SelfContainedCall, - sp_runtime::AccountId32: From<::AccountId>, -{ - fn dispatch_call( - signer: ::AccountId, - call: ::Call, - ) -> Result< - Result>, - TransactionValidityError, - > { - let dispatch_info = call.get_dispatch_info(); - let extrinsic = fp_self_contained::CheckedExtrinsic::< - AccountId, - Call, - SignedExtraScheduler, - SelfContainedSignedInfo, - > { - signed: - CheckedSignature::::Signed( - signer.clone().into(), - get_signed_extras(signer.into()), - ), - function: call.into(), - }; - - extrinsic.apply::(&dispatch_info, 0) - } - - fn reserve_balance( - id: [u8; 16], - sponsor: ::AccountId, - call: ::Call, - count: u32, - ) -> Result<(), DispatchError> { - let dispatch_info = call.get_dispatch_info(); - let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0) - .saturating_mul(count.into()); - - >::reserve_named( - &id, - &(sponsor.into()), - weight.into(), - ) - } - - fn pay_for_call( - id: [u8; 16], - sponsor: ::AccountId, - call: ::Call, - ) -> Result { - let dispatch_info = call.get_dispatch_info(); - let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0); - Ok( - >::unreserve_named( - &id, - &(sponsor.into()), - weight.into(), - ), - ) - } - - fn cancel_reserve( - id: [u8; 16], - sponsor: ::AccountId, - ) -> Result { - Ok( - >::unreserve_named( - &id, - &(sponsor.into()), - u128::MAX, - ), - ) - } -} - -parameter_types! { - pub const NoPreimagePostponement: Option = Some(10); - pub const Preimage: Option = Some(10); -} - -/// Used the compare the privilege of an origin inside the scheduler. -pub struct OriginPrivilegeCmp; - -impl PrivilegeCmp for OriginPrivilegeCmp { - fn cmp_privilege(_left: &OriginCaller, _right: &OriginCaller) -> Option { - Some(Ordering::Equal) - } -} - -#[cfg(feature = "scheduler")] -impl pallet_unique_scheduler::Config for Runtime { - type Event = Event; - type Origin = Origin; - type Currency = Balances; - type PalletsOrigin = OriginCaller; - type Call = Call; - type MaximumWeight = MaximumSchedulerWeight; - type ScheduleOrigin = EnsureSigned; - type MaxScheduledPerBlock = MaxScheduledPerBlock; - type WeightInfo = (); - type CallExecutor = SchedulerPaymentExecutor; - type OriginPrivilegeCmp = OriginPrivilegeCmp; - type PreimageProvider = (); - type NoPreimagePostponement = NoPreimagePostponement; -} - -type EvmSponsorshipHandler = ( - UniqueEthSponsorshipHandler, - pallet_evm_contract_helpers::HelpersContractSponsoring, -); -type SponsorshipHandler = ( - UniqueSponsorshipHandler, - //pallet_contract_helpers::ContractSponsorshipHandler, - pallet_evm_transaction_payment::BridgeSponsorshipHandler, -); - -impl pallet_evm_transaction_payment::Config for Runtime { - type EvmSponsorshipHandler = EvmSponsorshipHandler; - type Currency = Balances; -} - -impl pallet_charge_transaction::Config for Runtime { - type SponsorshipHandler = SponsorshipHandler; -} - -// impl pallet_contract_helpers::Config for Runtime { -// type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; -// } - -parameter_types! { - // 0x842899ECF380553E8a4de75bF534cdf6fBF64049 - pub const HelpersContractAddress: H160 = H160([ - 0x84, 0x28, 0x99, 0xec, 0xf3, 0x80, 0x55, 0x3e, 0x8a, 0x4d, 0xe7, 0x5b, 0xf5, 0x34, 0xcd, 0xf6, 0xfb, 0xf6, 0x40, 0x49, - ]); - - // 0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f - pub const EvmCollectionHelpersAddress: H160 = H160([ - 0x6c, 0x4e, 0x9f, 0xe1, 0xae, 0x37, 0xa4, 0x1e, 0x93, 0xce, 0xe4, 0x29, 0xe8, 0xe1, 0x88, 0x1a, 0xbd, 0xcb, 0xb5, 0x4f, - ]); -} - -impl pallet_evm_contract_helpers::Config for Runtime { - type ContractAddress = HelpersContractAddress; - type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; -} - construct_runtime!(quartz); -pub struct TransactionConverter; - -impl fp_rpc::ConvertTransaction for TransactionConverter { - fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic { - UncheckedExtrinsic::new_unsigned( - pallet_ethereum::Call::::transact { transaction }.into(), - ) - } -} - -impl fp_rpc::ConvertTransaction for TransactionConverter { - fn convert_transaction( - &self, - transaction: pallet_ethereum::Transaction, - ) -> opaque::UncheckedExtrinsic { - let extrinsic = UncheckedExtrinsic::new_unsigned( - pallet_ethereum::Call::::transact { transaction }.into(), - ); - let encoded = extrinsic.encode(); - opaque::UncheckedExtrinsic::decode(&mut &encoded[..]) - .expect("Encoded extrinsic is always valid") - } -} - -/// The address format for describing accounts. -pub type Address = sp_runtime::MultiAddress; -/// Block header type as expected by this runtime. -pub type Header = generic::Header; -/// Block type as expected by this runtime. -pub type Block = generic::Block; -/// A Block signed with a Justification -pub type SignedBlock = generic::SignedBlock; -/// BlockId type as expected by this runtime. -pub type BlockId = generic::BlockId; -/// The SignedExtension to the basic transaction logic. -pub type SignedExtra = ( - frame_system::CheckSpecVersion, - // system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - ChargeTransactionPayment, - //pallet_contract_helpers::ContractHelpersExtension, - pallet_ethereum::FakeTransactionFinalizer, -); - -pub type SignedExtraScheduler = ( - frame_system::CheckSpecVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - // pallet_charge_transaction::ChargeTransactionPayment, -); -/// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = - fp_self_contained::UncheckedExtrinsic; -/// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = fp_self_contained::CheckedExtrinsic; -/// Executive: handles dispatch to the various modules. -pub type Executive = frame_executive::Executive< - Runtime, - Block, - frame_system::ChainContext, - Runtime, - AllPalletsReversedWithSystemFirst, ->; - -impl_opaque_keys! { - pub struct SessionKeys { - pub aura: Aura, - } -} - -impl fp_self_contained::SelfContainedCall for Call { - type SignedInfo = H160; - - fn is_self_contained(&self) -> bool { - match self { - Call::Ethereum(call) => call.is_self_contained(), - _ => false, - } - } - - fn check_self_contained(&self) -> Option> { - match self { - Call::Ethereum(call) => call.check_self_contained(), - _ => None, - } - } - - fn validate_self_contained( - &self, - info: &Self::SignedInfo, - dispatch_info: &DispatchInfoOf, - len: usize, - ) -> Option { - match self { - Call::Ethereum(call) => call.validate_self_contained(info, dispatch_info, len), - _ => None, - } - } - - fn pre_dispatch_self_contained( - &self, - info: &Self::SignedInfo, - ) -> Option> { - match self { - Call::Ethereum(call) => call.pre_dispatch_self_contained(info), - _ => None, - } - } - - fn apply_self_contained( - self, - info: Self::SignedInfo, - ) -> Option>> { - match self { - call @ Call::Ethereum(pallet_ethereum::Call::transact { .. }) => Some(call.dispatch( - Origin::from(pallet_ethereum::RawOrigin::EthereumTransaction(info)), - )), - _ => None, - } - } -} - -macro_rules! dispatch_unique_runtime { - ($collection:ident.$method:ident($($name:ident),*)) => {{ - let collection = ::CollectionDispatch::dispatch(>::try_get($collection)?); - let dispatch = collection.as_dyn(); - - Ok::<_, DispatchError>(dispatch.$method($($name),*)) - }}; -} - impl_common_runtime_apis!(); -struct CheckInherents; - -impl cumulus_pallet_parachain_system::CheckInherents for CheckInherents { - fn check_inherents( - block: &Block, - relay_state_proof: &cumulus_pallet_parachain_system::RelayChainStateProof, - ) -> sp_inherents::CheckInherentsResult { - let relay_chain_slot = relay_state_proof - .read_slot() - .expect("Could not read the relay chain slot from the proof"); - - let inherent_data = - cumulus_primitives_timestamp::InherentDataProvider::from_relay_chain_slot_and_duration( - relay_chain_slot, - sp_std::time::Duration::from_secs(6), - ) - .create_inherent_data() - .expect("Could not create the timestamp inherent data"); - - inherent_data.check_extrinsics(block) - } -} - cumulus_pallet_parachain_system::register_validate_block!( Runtime = Runtime, BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index 6e04cefb2d..81f79558f4 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -25,176 +25,21 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); -use sp_api::impl_runtime_apis; -use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160}; -use sp_runtime::DispatchError; +use frame_support::parameter_types; -#[cfg(feature = "scheduler")] -use fp_self_contained::*; - -#[cfg(feature = "scheduler")] -use sp_runtime::{ - traits::{Applyable, Member}, - generic::Era, - DispatchErrorWithPostInfo, -}; -// #[cfg(any(feature = "std", test))] -// pub use sp_runtime::BuildStorage; - -use sp_runtime::{ - Permill, Perbill, Percent, create_runtime_str, generic, impl_opaque_keys, - traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion, Zero}, - transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, RuntimeAppPublic, -}; - -use sp_std::prelude::*; - -#[cfg(feature = "std")] -use sp_version::NativeVersion; use sp_version::RuntimeVersion; -pub use pallet_transaction_payment::{ - Multiplier, TargetedFeeAdjustment, FeeDetails, RuntimeDispatchInfo, -}; -// A few exports that help ease life for downstream crates. -pub use pallet_balances::Call as BalancesCall; -pub use pallet_evm::{ - EnsureAddressTruncated, HashedAddressMapping, Runner, account::CrossAccountId as _, - OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping, -}; -pub use frame_support::{ - match_types, - dispatch::DispatchResult, - PalletId, parameter_types, StorageValue, ConsensusEngineId, - traits::{ - tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Everything, - Currency, ExistenceRequirement, Get, IsInVec, KeyOwnerProofSystem, LockIdentifier, - OnUnbalanced, Randomness, FindAuthor, ConstU32, Imbalance, PrivilegeCmp, - }, - weights::{ - constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, - DispatchClass, DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight, - WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, ConstantMultiplier, - WeightToFee, - }, -}; +use sp_runtime::create_runtime_str; -#[cfg(feature = "scheduler")] -use pallet_unique_scheduler::DispatchCall; - -use up_data_structs::{ - CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits, - CollectionStats, RpcCollection, - mapping::{EvmTokenAddressMapping, CrossTokenAddressMapping}, - TokenChild, RmrkCollectionInfo, RmrkInstanceInfo, RmrkResourceInfo, RmrkPropertyInfo, - RmrkBaseInfo, RmrkPartType, RmrkTheme, RmrkThemeName, RmrkCollectionId, RmrkNftId, - RmrkNftChild, RmrkPropertyKey, RmrkResourceId, RmrkBaseId, -}; +use common_types::*; -// use pallet_contracts::weights::WeightInfo; -// #[cfg(any(feature = "std", test))] -use frame_system::{ - self as frame_system, EnsureRoot, EnsureSigned, - limits::{BlockWeights, BlockLength}, -}; -use sp_arithmetic::{ - traits::{BaseArithmetic, Unsigned}, -}; -use smallvec::smallvec; -use codec::{Encode, Decode}; -use fp_rpc::TransactionStatus; -use sp_runtime::{ - traits::{ - BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf, Saturating, - CheckedConversion, - }, - transaction_validity::TransactionValidityError, - SaturatedConversion, -}; +#[path = "../../common/mod.rs"] +mod runtime_common; -// pub use pallet_timestamp::Call as TimestampCall; -pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; - -// Polkadot imports -use pallet_xcm::XcmPassthrough; -use polkadot_parachain::primitives::Sibling; -use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*}; -use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative, - SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ParentIsPreset, -}; -use xcm_executor::{Config, XcmExecutor, Assets}; -use sp_std::{cmp::Ordering, marker::PhantomData}; - -use xcm::latest::{ - // Xcm, - AssetId::{Concrete}, - Fungibility::Fungible as XcmFungible, - MultiAsset, - Error as XcmError, -}; -use xcm_executor::traits::{MatchesFungible, WeightTrader}; - -use unique_runtime_common::{ - construct_runtime, impl_common_runtime_apis, - types::*, - constants::*, - dispatch::{CollectionDispatchT, CollectionDispatch}, - sponsoring::UniqueSponsorshipHandler, - eth_sponsoring::UniqueEthSponsorshipHandler, - weights::CommonWeights, -}; +pub use runtime_common::*; pub const RUNTIME_NAME: &str = "unique"; pub const TOKEN_SYMBOL: &str = "UNQ"; -type CrossAccountId = pallet_evm::account::BasicCrossAccountId; - -impl RuntimeInstance for Runtime { - type CrossAccountId = self::CrossAccountId; - type TransactionConverter = self::TransactionConverter; - - fn get_transaction_converter() -> TransactionConverter { - TransactionConverter - } -} - -/// The type for looking up accounts. We don't expect more than 4 billion of them, but you -/// never know... -pub type AccountIndex = u32; - -/// Balance of an account. -pub type Balance = u128; - -/// Index of a transaction in the chain. -pub type Index = u32; - -/// A hash of some data used by the chain. -pub type Hash = sp_core::H256; - -/// Digest item type. -pub type DigestItem = generic::DigestItem; - -/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know -/// the specifics of the runtime. They can then be made to be agnostic over specific formats -/// of data like extrinsics, allowing for them to continue syncing the network through upgrades -/// to even the core data structures. -pub mod opaque { - use sp_std::prelude::*; - use sp_runtime::impl_opaque_keys; - use super::Aura; - - pub use unique_runtime_common::types::*; - - impl_opaque_keys! { - pub struct SessionKeys { - pub aura: Aura, - } - } -} - /// This runtime version. pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), @@ -207,1099 +52,16 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { state_version: 0, }; -#[derive(codec::Encode, codec::Decode)] -pub enum XCMPMessage { - /// Transfer tokens to the given account from the Parachain account. - TransferToken(XAccountId, XBalance), -} - -/// The version information used to identify this runtime when compiled natively. -#[cfg(feature = "std")] -pub fn native_version() -> NativeVersion { - NativeVersion { - runtime_version: VERSION, - can_author_with: Default::default(), - } -} - -type NegativeImbalance = >::NegativeImbalance; - -pub struct DealWithFees; -impl OnUnbalanced for DealWithFees { - fn on_unbalanceds(mut fees_then_tips: impl Iterator) { - if let Some(fees) = fees_then_tips.next() { - // for fees, 100% to treasury - let mut split = fees.ration(100, 0); - if let Some(tips) = fees_then_tips.next() { - // for tips, if any, 100% to treasury - tips.ration_merge_into(100, 0, &mut split); - } - Treasury::on_unbalanced(split.0); - // Author::on_unbalanced(split.1); - } - } -} - parameter_types! { - pub const BlockHashCount: BlockNumber = 2400; - pub RuntimeBlockLength: BlockLength = - BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); - pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); - pub const MaximumBlockLength: u32 = 5 * 1024 * 1024; - pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() - .base_block(BlockExecutionWeight::get()) - .for_class(DispatchClass::all(), |weights| { - weights.base_extrinsic = ExtrinsicBaseWeight::get(); - }) - .for_class(DispatchClass::Normal, |weights| { - weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); - }) - .for_class(DispatchClass::Operational, |weights| { - weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); - // Operational transactions have some extra reserved space, so that they - // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. - weights.reserved = Some( - MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT - ); - }) - .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) - .build_or_panic(); pub const Version: RuntimeVersion = VERSION; pub const SS58Prefix: u16 = 7391; -} - -parameter_types! { pub const ChainId: u64 = 8880; } -pub struct FixedFee; -impl FeeCalculator for FixedFee { - fn min_gas_price() -> (U256, u64) { - (MIN_GAS_PRICE.into(), 0) - } -} - -// Assuming slowest ethereum opcode is SSTORE, with gas price of 20000 as our worst case -// (contract, which only writes a lot of data), -// approximating on top of our real store write weight -parameter_types! { - pub const WritesPerSecond: u64 = WEIGHT_PER_SECOND / ::DbWeight::get().write; - pub const GasPerSecond: u64 = WritesPerSecond::get() * 20000; - pub const WeightPerGas: u64 = WEIGHT_PER_SECOND / GasPerSecond::get(); -} - -/// Limiting EVM execution to 50% of block for substrate users and management tasks -/// EVM transaction consumes more weight than substrate's, so we can't rely on them being -/// scheduled fairly -const EVM_DISPATCH_RATIO: Perbill = Perbill::from_percent(50); -parameter_types! { - pub BlockGasLimit: U256 = U256::from(NORMAL_DISPATCH_RATIO * EVM_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT / WeightPerGas::get()); -} - -pub enum FixedGasWeightMapping {} -impl GasWeightMapping for FixedGasWeightMapping { - fn gas_to_weight(gas: u64) -> Weight { - gas.saturating_mul(WeightPerGas::get()) - } - fn weight_to_gas(weight: Weight) -> u64 { - weight / WeightPerGas::get() - } -} - -impl pallet_evm::account::Config for Runtime { - type CrossAccountId = pallet_evm::account::BasicCrossAccountId; - type EvmAddressMapping = pallet_evm::HashedAddressMapping; - type EvmBackwardsAddressMapping = fp_evm_mapping::MapBackwardsAddressTruncated; -} - -impl pallet_evm::Config for Runtime { - type BlockGasLimit = BlockGasLimit; - type FeeCalculator = FixedFee; - type GasWeightMapping = FixedGasWeightMapping; - type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping; - type CallOrigin = EnsureAddressTruncated; - type WithdrawOrigin = EnsureAddressTruncated; - type AddressMapping = HashedAddressMapping; - type PrecompilesType = (); - type PrecompilesValue = (); - type Currency = Balances; - type Event = Event; - type OnMethodCall = ( - pallet_evm_migration::OnMethodCall, - pallet_evm_contract_helpers::HelpersOnMethodCall, - CollectionDispatchT, - pallet_unique::eth::CollectionHelpersOnMethodCall, - ); - type OnCreate = pallet_evm_contract_helpers::HelpersOnCreate; - type ChainId = ChainId; - type Runner = pallet_evm::runner::stack::Runner; - type OnChargeTransaction = pallet_evm::EVMCurrencyAdapter; - type TransactionValidityHack = pallet_evm_transaction_payment::TransactionValidityHack; - type FindAuthor = EthereumFindAuthor; -} - -impl pallet_evm_migration::Config for Runtime { - type WeightInfo = pallet_evm_migration::weights::SubstrateWeight; -} - -pub struct EthereumFindAuthor(core::marker::PhantomData); -impl> FindAuthor for EthereumFindAuthor { - fn find_author<'a, I>(digests: I) -> Option - where - I: 'a + IntoIterator, - { - if let Some(author_index) = F::find_author(digests) { - let authority_id = Aura::authorities()[author_index as usize].clone(); - return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24])); - } - None - } -} - -impl pallet_ethereum::Config for Runtime { - type Event = Event; - type StateRoot = pallet_ethereum::IntermediateStateRoot; -} - -impl pallet_randomness_collective_flip::Config for Runtime {} - -impl frame_system::Config for Runtime { - /// The data to be stored in an account. - type AccountData = pallet_balances::AccountData; - /// The identifier used to distinguish between accounts. - type AccountId = AccountId; - /// The basic call filter to use in dispatchable. - type BaseCallFilter = Everything; - /// Maximum number of block number to block hash mappings to keep (oldest pruned first). - type BlockHashCount = BlockHashCount; - /// The maximum length of a block (in bytes). - type BlockLength = RuntimeBlockLength; - /// The index type for blocks. - type BlockNumber = BlockNumber; - /// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block. - type BlockWeights = RuntimeBlockWeights; - /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; - /// The weight of database operations that the runtime can invoke. - type DbWeight = RocksDbWeight; - /// The ubiquitous event type. - type Event = Event; - /// The type for hashing blocks and tries. - type Hash = Hash; - /// The hashing algorithm used. - type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; - /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The lookup mechanism to get account ID from whatever is passed in dispatchers. - type Lookup = AccountIdLookup; - /// What to do if an account is fully reaped from the system. - type OnKilledAccount = (); - /// What to do if a new account is created. - type OnNewAccount = (); - type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; - /// The ubiquitous origin type. - type Origin = Origin; - /// This type is being generated by `construct_runtime!`. - type PalletInfo = PalletInfo; - /// This is used as an identifier of the chain. 42 is the generic substrate prefix. - type SS58Prefix = SS58Prefix; - /// Weight information for the extrinsics of this pallet. - type SystemWeightInfo = frame_system::weights::SubstrateWeight; - /// Version of the runtime. - type Version = Version; - type MaxConsumers = ConstU32<16>; -} - -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; -} - -impl pallet_timestamp::Config for Runtime { - /// A timestamp: milliseconds since the unix epoch. - type Moment = u64; - type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; - type WeightInfo = (); -} - -parameter_types! { - // pub const ExistentialDeposit: u128 = 500; - pub const ExistentialDeposit: u128 = 0; - pub const MaxLocks: u32 = 50; - pub const MaxReserves: u32 = 50; -} - -impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; - type MaxReserves = MaxReserves; - type ReserveIdentifier = [u8; 16]; - /// The type for recording an account's balance. - type Balance = Balance; - /// The ubiquitous event type. - type Event = Event; - type DustRemoval = Treasury; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = pallet_balances::weights::SubstrateWeight; -} - -pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 15 * CENTIUNIQUE + (bytes as Balance) * 6 * CENTIUNIQUE -} - -/* -parameter_types! { - pub TombstoneDeposit: Balance = deposit( - 1, - sp_std::mem::size_of::> as u32, - ); - pub DepositPerContract: Balance = TombstoneDeposit::get(); - pub const DepositPerStorageByte: Balance = deposit(0, 1); - pub const DepositPerStorageItem: Balance = deposit(1, 0); - pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * DAYS); - pub const SurchargeReward: Balance = 150 * MILLIUNIQUE; - pub const SignedClaimHandicap: u32 = 2; - pub const MaxDepth: u32 = 32; - pub const MaxValueSize: u32 = 16 * 1024; - pub const MaxCodeSize: u32 = 1024 * 1024 * 25; // 25 Mb - // The lazy deletion runs inside on_initialize. - pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO * - RuntimeBlockWeights::get().max_block; - // The weight needed for decoding the queue should be less or equal than a fifth - // of the overall weight dedicated to the lazy deletion. - pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / ( - ::WeightInfo::on_initialize_per_queue_item(1) - - ::WeightInfo::on_initialize_per_queue_item(0) - )) / 5) as u32; - pub Schedule: pallet_contracts::Schedule = Default::default(); -} - -impl pallet_contracts::Config for Runtime { - type Time = Timestamp; - type Randomness = RandomnessCollectiveFlip; - type Currency = Balances; - type Event = Event; - type RentPayment = (); - type SignedClaimHandicap = SignedClaimHandicap; - type TombstoneDeposit = TombstoneDeposit; - type DepositPerContract = DepositPerContract; - type DepositPerStorageByte = DepositPerStorageByte; - type DepositPerStorageItem = DepositPerStorageItem; - type RentFraction = RentFraction; - type SurchargeReward = SurchargeReward; - type WeightPrice = pallet_transaction_payment::Pallet; - type WeightInfo = pallet_contracts::weights::SubstrateWeight; - type ChainExtension = NFTExtension; - type DeletionQueueDepth = DeletionQueueDepth; - type DeletionWeightLimit = DeletionWeightLimit; - type Schedule = Schedule; - type CallStack = [pallet_contracts::Frame; 31]; -} -*/ - -parameter_types! { - /// This value increases the priority of `Operational` transactions by adding - /// a "virtual tip" that's equal to the `OperationalFeeMultiplier * final_fee`. - pub const OperationalFeeMultiplier: u8 = 5; -} - -/// Linear implementor of `WeightToFeePolynomial` -pub struct LinearFee(sp_std::marker::PhantomData); - -impl WeightToFeePolynomial for LinearFee -where - T: BaseArithmetic + From + Copy + Unsigned, -{ - type Balance = T; - - fn polynomial() -> WeightToFeeCoefficients { - smallvec!(WeightToFeeCoefficient { - coeff_integer: WEIGHT_TO_FEE_COEFF.into(), - coeff_frac: Perbill::zero(), - negative: false, - degree: 1, - }) - } -} - -impl pallet_transaction_payment::Config for Runtime { - type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; - type LengthToFee = ConstantMultiplier; - type OperationalFeeMultiplier = OperationalFeeMultiplier; - type WeightToFee = LinearFee; - type FeeMultiplierUpdate = (); -} - -parameter_types! { - pub const ProposalBond: Permill = Permill::from_percent(5); - pub const ProposalBondMinimum: Balance = 1 * UNIQUE; - pub const ProposalBondMaximum: Balance = 1000 * UNIQUE; - pub const SpendPeriod: BlockNumber = 5 * MINUTES; - pub const Burn: Permill = Permill::from_percent(0); - pub const TipCountdown: BlockNumber = 1 * DAYS; - pub const TipFindersFee: Percent = Percent::from_percent(20); - pub const TipReportDepositBase: Balance = 1 * UNIQUE; - pub const DataDepositPerByte: Balance = 1 * CENTIUNIQUE; - pub const BountyDepositBase: Balance = 1 * UNIQUE; - pub const BountyDepositPayoutDelay: BlockNumber = 1 * DAYS; - pub const TreasuryModuleId: PalletId = PalletId(*b"py/trsry"); - pub const BountyUpdatePeriod: BlockNumber = 14 * DAYS; - pub const MaximumReasonLength: u32 = 16384; - pub const BountyCuratorDeposit: Permill = Permill::from_percent(50); - pub const BountyValueMinimum: Balance = 5 * UNIQUE; - pub const MaxApprovals: u32 = 100; -} - -impl pallet_treasury::Config for Runtime { - type PalletId = TreasuryModuleId; - type Currency = Balances; - type ApproveOrigin = EnsureRoot; - type RejectOrigin = EnsureRoot; - type Event = Event; - type OnSlash = (); - type ProposalBond = ProposalBond; - type ProposalBondMinimum = ProposalBondMinimum; - type ProposalBondMaximum = ProposalBondMaximum; - type SpendPeriod = SpendPeriod; - type Burn = Burn; - type BurnDestination = (); - type SpendFunds = (); - type WeightInfo = pallet_treasury::weights::SubstrateWeight; - type MaxApprovals = MaxApprovals; -} - -impl pallet_sudo::Config for Runtime { - type Event = Event; - type Call = Call; -} - -pub struct RelayChainBlockNumberProvider(sp_std::marker::PhantomData); - -impl BlockNumberProvider - for RelayChainBlockNumberProvider -{ - type BlockNumber = BlockNumber; - - fn current_block_number() -> Self::BlockNumber { - cumulus_pallet_parachain_system::Pallet::::validation_data() - .map(|d| d.relay_parent_number) - .unwrap_or_default() - } -} - -parameter_types! { - pub const MinVestedTransfer: Balance = 10 * UNIQUE; - pub const MaxVestingSchedules: u32 = 28; -} - -impl orml_vesting::Config for Runtime { - type Event = Event; - type Currency = pallet_balances::Pallet; - type MinVestedTransfer = MinVestedTransfer; - type VestedTransferOrigin = EnsureSigned; - type WeightInfo = (); - type MaxVestingSchedules = MaxVestingSchedules; - type BlockNumberProvider = RelayChainBlockNumberProvider; -} - -parameter_types! { - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; -} - -impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; - type SelfParaId = parachain_info::Pallet; - type OnSystemEvent = (); - // type DownwardMessageHandlers = cumulus_primitives_utility::UnqueuedDmpAsParent< - // MaxDownwardMessageWeight, - // XcmExecutor, - // Call, - // >; - type OutboundXcmpMessageSource = XcmpQueue; - type DmpMessageHandler = DmpQueue; - type ReservedDmpWeight = ReservedDmpWeight; - type ReservedXcmpWeight = ReservedXcmpWeight; - type XcmpMessageHandler = XcmpQueue; -} - -impl parachain_info::Config for Runtime {} - -impl cumulus_pallet_aura_ext::Config for Runtime {} - -parameter_types! { - pub const RelayLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); - pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); -} - -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. -pub type LocationToAccountId = ( - // The parent (Relay-chain) origin converts to the default `AccountId`. - ParentIsPreset, - // Sibling parachain origins convert to AccountId via the `ParaId::into`. - SiblingParachainConvertsVia, - // Straight up local `AccountId32` origins just alias directly to `AccountId`. - AccountId32Aliases, -); - -pub struct OnlySelfCurrency; -impl> MatchesFungible for OnlySelfCurrency { - fn matches_fungible(a: &MultiAsset) -> Option { - match (&a.id, &a.fun) { - (Concrete(_), XcmFungible(ref amount)) => CheckedConversion::checked_from(*amount), - _ => None, - } - } -} - -/// Means for transacting assets on this chain. -pub type LocalAssetTransactor = CurrencyAdapter< - // Use this currency: - Balances, - // Use this currency when it is a fungible asset matching the given location or name: - OnlySelfCurrency, - // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We don't track any teleports. - (), ->; - -/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. -pub type XcmOriginToTransactDispatchOrigin = ( - // Sovereign account converter; this attempts to derive an `AccountId` from the origin location - // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for - // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, - // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when - // recognised. - RelayChainAsNative, - // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when - // recognised. - SiblingParachainAsNative, - // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a - // transaction from the Root origin. - ParentAsSuperuser, - // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, - // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, -); - -parameter_types! { - // One XCM operation is 1_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000; - // 1200 UNIQUEs buy 1 second of weight. - pub const WeightPrice: (MultiLocation, u128) = (MultiLocation::parent(), 1_200 * UNIQUE); - pub const MaxInstructions: u32 = 100; - pub const MaxAuthorities: u32 = 100_000; -} - -match_types! { - pub type ParentOrParentsUnitPlurality: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) } - }; -} - -pub type Barrier = ( - TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, - // ^^^ Parent & its unit plurality gets free execution -); - -pub struct UsingOnlySelfCurrencyComponents< - WeightToFee: WeightToFeePolynomial, - AssetId: Get, - AccountId, - Currency: CurrencyT, - OnUnbalanced: OnUnbalancedT, ->( - Weight, - Currency::Balance, - PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>, -); -impl< - WeightToFee: WeightToFeePolynomial, - AssetId: Get, - AccountId, - Currency: CurrencyT, - OnUnbalanced: OnUnbalancedT, - > WeightTrader - for UsingOnlySelfCurrencyComponents -{ - fn new() -> Self { - Self(0, Zero::zero(), PhantomData) - } - - fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { - let amount = WeightToFee::weight_to_fee(&weight); - let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?; - - // location to this parachain through relay chain - let option1: xcm::v1::AssetId = Concrete(MultiLocation { - parents: 1, - interior: X1(Parachain(ParachainInfo::parachain_id().into())), - }); - // direct location - let option2: xcm::v1::AssetId = Concrete(MultiLocation { - parents: 0, - interior: Here, - }); - - let required = if payment.fungible.contains_key(&option1) { - (option1, u128_amount).into() - } else if payment.fungible.contains_key(&option2) { - (option2, u128_amount).into() - } else { - (Concrete(MultiLocation::default()), u128_amount).into() - }; - - let unused = payment - .checked_sub(required) - .map_err(|_| XcmError::TooExpensive)?; - self.0 = self.0.saturating_add(weight); - self.1 = self.1.saturating_add(amount); - Ok(unused) - } - - fn refund_weight(&mut self, weight: Weight) -> Option { - let weight = weight.min(self.0); - let amount = WeightToFee::weight_to_fee(&weight); - self.0 -= weight; - self.1 = self.1.saturating_sub(amount); - let amount: u128 = amount.saturated_into(); - if amount > 0 { - Some((AssetId::get(), amount).into()) - } else { - None - } - } -} -impl< - WeightToFee: WeightToFeePolynomial, - AssetId: Get, - AccountId, - Currency: CurrencyT, - OnUnbalanced: OnUnbalancedT, - > Drop - for UsingOnlySelfCurrencyComponents -{ - fn drop(&mut self) { - OnUnbalanced::on_unbalanced(Currency::issue(self.1)); - } -} - -pub struct XcmConfig; -impl Config for XcmConfig { - type Call = Call; - type XcmSender = XcmRouter; - // How to withdraw and deposit an asset. - type AssetTransactor = LocalAssetTransactor; - type OriginConverter = XcmOriginToTransactDispatchOrigin; - type IsReserve = NativeAsset; - type IsTeleporter = (); // Teleportation is disabled - type LocationInverter = LocationInverter; - type Barrier = Barrier; - type Weigher = FixedWeightBounds; - type Trader = - UsingOnlySelfCurrencyComponents, RelayLocation, AccountId, Balances, ()>; - type ResponseHandler = (); // Don't handle responses for now. - type SubscriptionService = PolkadotXcm; - - type AssetTrap = PolkadotXcm; - type AssetClaims = PolkadotXcm; -} - -// parameter_types! { -// pub const MaxDownwardMessageWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 10; -// } - -/// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = (SignedToAccountId32,); - -/// The means for routing XCM messages which are not for local execution into the right message -/// queues. -pub type XcmRouter = ( - // Two routers - use UMP to communicate with the relay chain: - cumulus_primitives_utility::ParentAsUmp, - // ..and XCMP to communicate with the sibling chains. - XcmpQueue, -); - -impl pallet_evm_coder_substrate::Config for Runtime {} - -impl pallet_xcm::Config for Runtime { - type Event = Event; - type SendXcmOrigin = EnsureXcmOrigin; - type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; - type XcmExecuteFilter = Everything; - type XcmExecutor = XcmExecutor; - type XcmTeleportFilter = Everything; - type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; - type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; - const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; - type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; -} - -impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor; -} - -impl cumulus_pallet_xcmp_queue::Config for Runtime { - type WeightInfo = (); - type Event = Event; - type XcmExecutor = XcmExecutor; - type ChannelInfo = ParachainSystem; - type VersionWrapper = (); - type ExecuteOverweightOrigin = frame_system::EnsureRoot; - type ControllerOrigin = EnsureRoot; - type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; -} - -impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor; - type ExecuteOverweightOrigin = frame_system::EnsureRoot; -} - -impl pallet_aura::Config for Runtime { - type AuthorityId = AuraId; - type DisabledValidators = (); - type MaxAuthorities = MaxAuthorities; -} - -parameter_types! { - pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account_truncating(); - pub const CollectionCreationPrice: Balance = 2 * UNIQUE; -} - -impl pallet_common::Config for Runtime { - type WeightInfo = pallet_common::weights::SubstrateWeight; - type Event = Event; - type Currency = Balances; - type CollectionCreationPrice = CollectionCreationPrice; - type TreasuryAccountId = TreasuryAccountId; - type CollectionDispatch = CollectionDispatchT; - - type EvmTokenAddressMapping = EvmTokenAddressMapping; - type CrossTokenAddressMapping = CrossTokenAddressMapping; - type ContractAddress = EvmCollectionHelpersAddress; -} - -impl pallet_structure::Config for Runtime { - type Event = Event; - type Call = Call; - type WeightInfo = pallet_structure::weights::SubstrateWeight; -} - -impl pallet_fungible::Config for Runtime { - type WeightInfo = pallet_fungible::weights::SubstrateWeight; -} - -impl pallet_refungible::Config for Runtime { - type WeightInfo = pallet_refungible::weights::SubstrateWeight; -} - -impl pallet_nonfungible::Config for Runtime { - type WeightInfo = pallet_nonfungible::weights::SubstrateWeight; -} - -#[cfg(feature = "rmrk")] -impl pallet_proxy_rmrk_core::Config for Runtime { - type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight; - type Event = Event; -} - -#[cfg(feature = "rmrk")] -impl pallet_proxy_rmrk_equip::Config for Runtime { - type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight; - type Event = Event; -} - -impl pallet_unique::Config for Runtime { - type Event = Event; - type WeightInfo = pallet_unique::weights::SubstrateWeight; - type CommonWeightInfo = CommonWeights; - type RefungibleExtensionsWeightInfo = CommonWeights; -} - -parameter_types! { - pub const InflationBlockInterval: BlockNumber = 100; // every time per how many blocks inflation is applied -} - -/// Used for the pallet inflation -impl pallet_inflation::Config for Runtime { - type Currency = Balances; - type TreasuryAccountId = TreasuryAccountId; - type InflationBlockInterval = InflationBlockInterval; - type BlockNumberProvider = RelayChainBlockNumberProvider; -} - -parameter_types! { - pub MaximumSchedulerWeight: Weight = Perbill::from_percent(50) * - RuntimeBlockWeights::get().max_block; - pub const MaxScheduledPerBlock: u32 = 50; -} - -type ChargeTransactionPayment = pallet_charge_transaction::ChargeTransactionPayment; - -#[cfg(feature = "scheduler")] -use frame_support::traits::NamedReservableCurrency; - -#[cfg(feature = "scheduler")] -fn get_signed_extras(from: ::AccountId) -> SignedExtraScheduler { - ( - frame_system::CheckSpecVersion::::new(), - frame_system::CheckGenesis::::new(), - frame_system::CheckEra::::from(Era::Immortal), - frame_system::CheckNonce::::from(frame_system::Pallet::::account_nonce( - from, - )), - frame_system::CheckWeight::::new(), - // sponsoring transaction logic - // pallet_charge_transaction::ChargeTransactionPayment::::new(0), - ) -} - -#[cfg(feature = "scheduler")] -pub struct SchedulerPaymentExecutor; - -#[cfg(feature = "scheduler")] -impl - DispatchCall for SchedulerPaymentExecutor -where - ::Call: Member - + Dispatchable - + SelfContainedCall - + GetDispatchInfo - + From>, - SelfContainedSignedInfo: Send + Sync + 'static, - Call: From<::Call> - + From<::Call> - + SelfContainedCall, - sp_runtime::AccountId32: From<::AccountId>, -{ - fn dispatch_call( - signer: ::AccountId, - call: ::Call, - ) -> Result< - Result>, - TransactionValidityError, - > { - let dispatch_info = call.get_dispatch_info(); - let extrinsic = fp_self_contained::CheckedExtrinsic::< - AccountId, - Call, - SignedExtraScheduler, - SelfContainedSignedInfo, - > { - signed: - CheckedSignature::::Signed( - signer.clone().into(), - get_signed_extras(signer.into()), - ), - function: call.into(), - }; - - extrinsic.apply::(&dispatch_info, 0) - } - - fn reserve_balance( - id: [u8; 16], - sponsor: ::AccountId, - call: ::Call, - count: u32, - ) -> Result<(), DispatchError> { - let dispatch_info = call.get_dispatch_info(); - let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0) - .saturating_mul(count.into()); - - >::reserve_named( - &id, - &(sponsor.into()), - weight, - ) - } - - fn pay_for_call( - id: [u8; 16], - sponsor: ::AccountId, - call: ::Call, - ) -> Result { - let dispatch_info = call.get_dispatch_info(); - let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0); - Ok( - >::unreserve_named( - &id, - &(sponsor.into()), - weight, - ), - ) - } - - fn cancel_reserve( - id: [u8; 16], - sponsor: ::AccountId, - ) -> Result { - Ok( - >::unreserve_named( - &id, - &(sponsor.into()), - u128::MAX, - ), - ) - } -} - -parameter_types! { - pub const NoPreimagePostponement: Option = Some(10); - pub const Preimage: Option = Some(10); -} - -/// Used the compare the privilege of an origin inside the scheduler. -pub struct OriginPrivilegeCmp; - -impl PrivilegeCmp for OriginPrivilegeCmp { - fn cmp_privilege(_left: &OriginCaller, _right: &OriginCaller) -> Option { - Some(Ordering::Equal) - } -} - -#[cfg(feature = "scheduler")] -impl pallet_unique_scheduler::Config for Runtime { - type Event = Event; - type Origin = Origin; - type Currency = Balances; - type PalletsOrigin = OriginCaller; - type Call = Call; - type MaximumWeight = MaximumSchedulerWeight; - type ScheduleOrigin = EnsureSigned; - type MaxScheduledPerBlock = MaxScheduledPerBlock; - type WeightInfo = (); - type CallExecutor = SchedulerPaymentExecutor; - type OriginPrivilegeCmp = OriginPrivilegeCmp; - type PreimageProvider = (); - type NoPreimagePostponement = NoPreimagePostponement; -} - -type EvmSponsorshipHandler = ( - UniqueEthSponsorshipHandler, - pallet_evm_contract_helpers::HelpersContractSponsoring, -); -type SponsorshipHandler = ( - UniqueSponsorshipHandler, - //pallet_contract_helpers::ContractSponsorshipHandler, - pallet_evm_transaction_payment::BridgeSponsorshipHandler, -); - -impl pallet_evm_transaction_payment::Config for Runtime { - type EvmSponsorshipHandler = EvmSponsorshipHandler; - type Currency = Balances; -} - -impl pallet_charge_transaction::Config for Runtime { - type SponsorshipHandler = SponsorshipHandler; -} - -// impl pallet_contract_helpers::Config for Runtime { -// type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; -// } - -parameter_types! { - // 0x842899ECF380553E8a4de75bF534cdf6fBF64049 - pub const HelpersContractAddress: H160 = H160([ - 0x84, 0x28, 0x99, 0xec, 0xf3, 0x80, 0x55, 0x3e, 0x8a, 0x4d, 0xe7, 0x5b, 0xf5, 0x34, 0xcd, 0xf6, 0xfb, 0xf6, 0x40, 0x49, - ]); - - // 0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f - pub const EvmCollectionHelpersAddress: H160 = H160([ - 0x6c, 0x4e, 0x9f, 0xe1, 0xae, 0x37, 0xa4, 0x1e, 0x93, 0xce, 0xe4, 0x29, 0xe8, 0xe1, 0x88, 0x1a, 0xbd, 0xcb, 0xb5, 0x4f, - ]); -} - -impl pallet_evm_contract_helpers::Config for Runtime { - type ContractAddress = HelpersContractAddress; - type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; -} - construct_runtime!(unique); -pub struct TransactionConverter; - -impl fp_rpc::ConvertTransaction for TransactionConverter { - fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic { - UncheckedExtrinsic::new_unsigned( - pallet_ethereum::Call::::transact { transaction }.into(), - ) - } -} - -impl fp_rpc::ConvertTransaction for TransactionConverter { - fn convert_transaction( - &self, - transaction: pallet_ethereum::Transaction, - ) -> opaque::UncheckedExtrinsic { - let extrinsic = UncheckedExtrinsic::new_unsigned( - pallet_ethereum::Call::::transact { transaction }.into(), - ); - let encoded = extrinsic.encode(); - opaque::UncheckedExtrinsic::decode(&mut &encoded[..]) - .expect("Encoded extrinsic is always valid") - } -} - -/// The address format for describing accounts. -pub type Address = sp_runtime::MultiAddress; -/// Block header type as expected by this runtime. -pub type Header = generic::Header; -/// Block type as expected by this runtime. -pub type Block = generic::Block; -/// A Block signed with a Justification -pub type SignedBlock = generic::SignedBlock; -/// BlockId type as expected by this runtime. -pub type BlockId = generic::BlockId; -/// The SignedExtension to the basic transaction logic. -pub type SignedExtra = ( - frame_system::CheckSpecVersion, - // system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - ChargeTransactionPayment, - //pallet_contract_helpers::ContractHelpersExtension, - pallet_ethereum::FakeTransactionFinalizer, -); -pub type SignedExtraScheduler = ( - frame_system::CheckSpecVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - // pallet_charge_transaction::ChargeTransactionPayment, -); -/// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = - fp_self_contained::UncheckedExtrinsic; -/// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = fp_self_contained::CheckedExtrinsic; -/// Executive: handles dispatch to the various modules. -pub type Executive = frame_executive::Executive< - Runtime, - Block, - frame_system::ChainContext, - Runtime, - AllPalletsReversedWithSystemFirst, ->; - -impl_opaque_keys! { - pub struct SessionKeys { - pub aura: Aura, - } -} - -impl fp_self_contained::SelfContainedCall for Call { - type SignedInfo = H160; - - fn is_self_contained(&self) -> bool { - match self { - Call::Ethereum(call) => call.is_self_contained(), - _ => false, - } - } - - fn check_self_contained(&self) -> Option> { - match self { - Call::Ethereum(call) => call.check_self_contained(), - _ => None, - } - } - - fn validate_self_contained( - &self, - info: &Self::SignedInfo, - dispatch_info: &DispatchInfoOf, - len: usize, - ) -> Option { - match self { - Call::Ethereum(call) => call.validate_self_contained(info, dispatch_info, len), - _ => None, - } - } - - fn pre_dispatch_self_contained( - &self, - info: &Self::SignedInfo, - ) -> Option> { - match self { - Call::Ethereum(call) => call.pre_dispatch_self_contained(info), - _ => None, - } - } - - fn apply_self_contained( - self, - info: Self::SignedInfo, - ) -> Option>> { - match self { - call @ Call::Ethereum(pallet_ethereum::Call::transact { .. }) => Some(call.dispatch( - Origin::from(pallet_ethereum::RawOrigin::EthereumTransaction(info)), - )), - _ => None, - } - } -} - -macro_rules! dispatch_unique_runtime { - ($collection:ident.$method:ident($($name:ident),*)) => {{ - let collection = ::CollectionDispatch::dispatch(>::try_get($collection)?); - let dispatch = collection.as_dyn(); - - Ok::<_, DispatchError>(dispatch.$method($($name),*)) - }}; -} - impl_common_runtime_apis!(); -struct CheckInherents; - -impl cumulus_pallet_parachain_system::CheckInherents for CheckInherents { - fn check_inherents( - block: &Block, - relay_state_proof: &cumulus_pallet_parachain_system::RelayChainStateProof, - ) -> sp_inherents::CheckInherentsResult { - let relay_chain_slot = relay_state_proof - .read_slot() - .expect("Could not read the relay chain slot from the proof"); - - let inherent_data = - cumulus_primitives_timestamp::InherentDataProvider::from_relay_chain_slot_and_duration( - relay_chain_slot, - sp_std::time::Duration::from_secs(6), - ) - .create_inherent_data() - .expect("Could not create the timestamp inherent data"); - - inherent_data.check_extrinsics(block) - } -} - cumulus_pallet_parachain_system::register_validate_block!( Runtime = Runtime, BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, From 8a2ef94dc1422c0ce2194e579d9e2f700014dbe5 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 8 Aug 2022 15:32:48 +0000 Subject: [PATCH 0280/1274] fix: quartz/unique runtime Cargo.toml --- Cargo.lock | 59 +++++++++++++++++---------------------- runtime/quartz/Cargo.toml | 6 ++-- runtime/unique/Cargo.toml | 6 ++-- 3 files changed, 34 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 792d7ec649..b0e0f27883 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1127,6 +1127,18 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "common-types" +version = "0.9.24" +dependencies = [ + "fp-rpc", + "pallet-evm", + "sp-consensus-aura", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "concurrent-queue" version = "1.2.2" @@ -5282,6 +5294,7 @@ checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" name = "opal-runtime" version = "0.9.24" dependencies = [ + "common-types", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -5291,6 +5304,7 @@ dependencies = [ "cumulus-primitives-timestamp", "cumulus-primitives-utility", "derivative", + "evm-coder", "fp-evm-mapping", "fp-rpc", "fp-self-contained", @@ -5352,9 +5366,9 @@ dependencies = [ "sp-transaction-pool", "sp-version", "substrate-wasm-builder", - "unique-runtime-common", "up-data-structs", "up-rpc", + "up-sponsorship", "xcm", "xcm-builder", "xcm-executor", @@ -8596,6 +8610,7 @@ dependencies = [ name = "quartz-runtime" version = "0.9.24" dependencies = [ + "common-types", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -8605,6 +8620,7 @@ dependencies = [ "cumulus-primitives-timestamp", "cumulus-primitives-utility", "derivative", + "evm-coder", "fp-evm-mapping", "fp-rpc", "fp-self-contained", @@ -8666,9 +8682,9 @@ dependencies = [ "sp-transaction-pool", "sp-version", "substrate-wasm-builder", - "unique-runtime-common", "up-data-structs", "up-rpc", + "up-sponsorship", "xcm", "xcm-builder", "xcm-executor", @@ -11881,6 +11897,8 @@ dependencies = [ name = "tests" version = "0.1.0" dependencies = [ + "common-types", + "evm-coder", "fp-evm-mapping", "frame-support", "frame-system", @@ -11902,8 +11920,8 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "unique-runtime-common", "up-data-structs", + "up-sponsorship", ] [[package]] @@ -12387,7 +12405,6 @@ dependencies = [ "sp-core", "sp-rpc", "sp-runtime", - "unique-runtime-common", "up-data-structs", "up-rpc", ] @@ -12463,6 +12480,7 @@ name = "unique-node" version = "0.9.24" dependencies = [ "clap", + "common-types", "cumulus-client-cli", "cumulus-client-collator", "cumulus-client-consensus-aura", @@ -12541,7 +12559,6 @@ dependencies = [ "try-runtime-cli", "unique-rpc", "unique-runtime", - "unique-runtime-common", "up-data-structs", "up-rpc", ] @@ -12550,6 +12567,7 @@ dependencies = [ name = "unique-rpc" version = "0.1.0" dependencies = [ + "common-types", "fc-db", "fc-mapping-sync", "fc-rpc", @@ -12590,7 +12608,6 @@ dependencies = [ "substrate-frame-rpc-system", "tokio 0.2.25", "uc-rpc", - "unique-runtime-common", "up-data-structs", "up-rpc", ] @@ -12599,6 +12616,7 @@ dependencies = [ name = "unique-runtime" version = "0.9.24" dependencies = [ + "common-types", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -12608,6 +12626,7 @@ dependencies = [ "cumulus-primitives-timestamp", "cumulus-primitives-utility", "derivative", + "evm-coder", "fp-evm-mapping", "fp-rpc", "fp-self-contained", @@ -12669,40 +12688,14 @@ dependencies = [ "sp-transaction-pool", "sp-version", "substrate-wasm-builder", - "unique-runtime-common", "up-data-structs", "up-rpc", + "up-sponsorship", "xcm", "xcm-builder", "xcm-executor", ] -[[package]] -name = "unique-runtime-common" -version = "0.9.24" -dependencies = [ - "evm-coder", - "fp-rpc", - "frame-support", - "frame-system", - "pallet-common", - "pallet-evm", - "pallet-fungible", - "pallet-nonfungible", - "pallet-refungible", - "pallet-unique", - "pallet-unique-scheduler", - "parity-scale-codec 3.1.5", - "rmrk-rpc", - "scale-info", - "sp-consensus-aura", - "sp-core", - "sp-runtime", - "sp-std", - "up-data-structs", - "up-sponsorship", -] - [[package]] name = "universal-hash" version = "0.4.1" diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index e7e6d8008a..8799cb982f 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -113,7 +113,7 @@ std = [ 'xcm/std', 'xcm-builder/std', 'xcm-executor/std', - 'unique-runtime-common/std', + 'common-types/std', "orml-vesting/std", ] @@ -407,7 +407,7 @@ path = "../../primitives/rmrk-rpc" [dependencies] log = { version = "0.4.16", default-features = false } -unique-runtime-common = { path = "../common", default-features = false } +common-types = { path = "../../common-types", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } @@ -436,6 +436,8 @@ pallet-ethereum = { default-features = false, git = "https://github.com/uniquene pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +evm-coder = { default-features = false, path = '../../crates/evm-coder' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.24' } ################################################################################ # Build Dependencies diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 5969e306a2..30a1ff6dc0 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -114,7 +114,7 @@ std = [ 'xcm/std', 'xcm-builder/std', 'xcm-executor/std', - 'unique-runtime-common/std', + 'common-types/std', "orml-vesting/std", ] @@ -400,7 +400,7 @@ default-features = false [dependencies] log = { version = "0.4.16", default-features = false } -unique-runtime-common = { path = "../common", default-features = false } +common-types = { path = "../../common-types", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } @@ -430,6 +430,8 @@ pallet-base-fee = { default-features = false, git = "https://github.com/uniquene fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +evm-coder = { default-features = false, path = '../../crates/evm-coder' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.24' } ################################################################################ # Build Dependencies From 07fe7b5a5c872cf86e6671cc8f1755d571b580f2 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 8 Aug 2022 15:50:00 +0000 Subject: [PATCH 0281/1274] refactor: optimize common runtime imports --- runtime/common/config/ethereum.rs | 2 +- runtime/common/config/mod.rs | 10 ---------- runtime/common/config/pallets/mod.rs | 5 +---- runtime/common/ethereum/mod.rs | 6 ------ runtime/common/instance.rs | 2 +- runtime/common/mod.rs | 30 ++++++++++------------------ runtime/common/runtime_apis.rs | 5 +++++ 7 files changed, 18 insertions(+), 42 deletions(-) diff --git a/runtime/common/config/ethereum.rs b/runtime/common/config/ethereum.rs index 52692b959d..b78d55a914 100644 --- a/runtime/common/config/ethereum.rs +++ b/runtime/common/config/ethereum.rs @@ -9,7 +9,7 @@ use crate::{ runtime_common::{ constants::*, dispatch::CollectionDispatchT, - ethereum::{EvmSponsorshipHandler}, + ethereum::sponsoring::EvmSponsorshipHandler, config::sponsoring::DefaultSponsoringRateLimit, DealWithFees, }, diff --git a/runtime/common/config/mod.rs b/runtime/common/config/mod.rs index b03b85bdaa..4643460202 100644 --- a/runtime/common/config/mod.rs +++ b/runtime/common/config/mod.rs @@ -21,13 +21,3 @@ pub mod pallets; pub mod parachain; pub mod xcm; pub mod orml; - -pub use { - substrate::*, - ethereum::*, - sponsoring::*, - pallets::*, - parachain::*, - self::xcm::*, - orml::*, -}; diff --git a/runtime/common/config/pallets/mod.rs b/runtime/common/config/pallets/mod.rs index 76421b72c5..fe6875c979 100644 --- a/runtime/common/config/pallets/mod.rs +++ b/runtime/common/config/pallets/mod.rs @@ -14,10 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use frame_support::{ - // weights::{Weight, constants::WEIGHT_PER_SECOND}, - parameter_types, -}; +use frame_support::parameter_types; use sp_runtime::traits::AccountIdConversion; use crate::{ runtime_common::{ diff --git a/runtime/common/ethereum/mod.rs b/runtime/common/ethereum/mod.rs index 212f00d35d..ce229bc667 100644 --- a/runtime/common/ethereum/mod.rs +++ b/runtime/common/ethereum/mod.rs @@ -17,9 +17,3 @@ pub mod sponsoring; pub mod transaction_converter; pub mod self_contained_call; - -pub use { - sponsoring::*, - transaction_converter::*, - self_contained_call::*, -}; diff --git a/runtime/common/instance.rs b/runtime/common/instance.rs index 900a466356..5c33b99321 100644 --- a/runtime/common/instance.rs +++ b/runtime/common/instance.rs @@ -1,7 +1,7 @@ use crate::{ runtime_common::{ config::ethereum::CrossAccountId, - ethereum::TransactionConverter + ethereum::transaction_converter::TransactionConverter }, Runtime, }; diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index 0ddf57c0d1..b1b5e0d14b 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -14,26 +14,16 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -mod constants; -mod construct_runtime; -mod dispatch; -mod runtime_apis; -mod sponsoring; -mod weights; -mod config; -mod instance; -mod ethereum; -mod scheduler; - -pub use { - constants::*, - dispatch::*, - sponsoring::*, - weights::*, - config::*, - instance::*, - ethereum::*, -}; +pub mod constants; +pub mod construct_runtime; +pub mod dispatch; +pub mod runtime_apis; +pub mod sponsoring; +pub mod weights; +pub mod config; +pub mod instance; +pub mod ethereum; +pub mod scheduler; use sp_core::H160; use frame_support::traits::{Currency, OnUnbalanced, Imbalance}; diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index 8dc3dce1c5..c298bfeb60 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -50,6 +50,11 @@ macro_rules! impl_common_runtime_apis { Runner, account::CrossAccountId as _, Account as EVMAccount, FeeCalculator, }; + use runtime_common::{ + sponsoring::{SponsorshipPredict, UniqueSponsorshipPredict}, + dispatch::CollectionDispatch, + config::ethereum::CrossAccountId, + }; use up_data_structs::*; From 2a76b29e0532d8715acab550c71e90b59c067103 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 8 Aug 2022 16:04:58 +0000 Subject: [PATCH 0282/1274] fix: use errors in unsupported runtime APIs --- pallets/common/src/lib.rs | 3 +++ runtime/common/mod.rs | 2 ++ runtime/common/runtime_apis.rs | 39 ++++++++++++++++++++++------------ 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 204c48f5a8..6e92fa7ae5 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -569,6 +569,9 @@ pub mod pallet { /// Tried to access an internal collection with an external API CollectionIsInternal, + + /// A method of an unsupported API was called + UnsupportedRuntimeApi, } /// Storage of the count of created collections. Essentially contains the last collection ID. diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index b1b5e0d14b..905078f1be 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -43,6 +43,8 @@ use crate::{ }; use common_types::{AccountId, BlockNumber}; +pub type CommonError = pallet_common::Error; + /// The address format for describing accounts. pub type Address = sp_runtime::MultiAddress; /// Block header type as expected by this runtime. diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index c298bfeb60..1488055d8d 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -189,7 +189,6 @@ macro_rules! impl_common_runtime_apis { } } - #[allow(unused_variables)] impl rmrk_rpc::RmrkApi< Block, AccountId, @@ -206,41 +205,46 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_core::rpc::last_collection_idx::(); #[cfg(not(feature = "rmrk"))] - return Ok(Default::default()); + return Err(CommonError::UnsupportedRuntimeApi.into()); } + #[allow(unused_variables)] fn collection_by_id(collection_id: RmrkCollectionId) -> Result>, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_core::rpc::collection_by_id::(collection_id); #[cfg(not(feature = "rmrk"))] - return Ok(Default::default()) + return Err(CommonError::UnsupportedRuntimeApi.into()); } + #[allow(unused_variables)] fn nft_by_id(collection_id: RmrkCollectionId, nft_by_id: RmrkNftId) -> Result>, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_core::rpc::nft_by_id::(collection_id, nft_by_id); #[cfg(not(feature = "rmrk"))] - return Ok(Default::default()) + return Err(CommonError::UnsupportedRuntimeApi.into()); } + #[allow(unused_variables)] fn account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Result, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_core::rpc::account_tokens::(account_id, collection_id); #[cfg(not(feature = "rmrk"))] - return Ok(Default::default()) + return Err(CommonError::UnsupportedRuntimeApi.into()); } + #[allow(unused_variables)] fn nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_core::rpc::nft_children::(collection_id, nft_id); #[cfg(not(feature = "rmrk"))] - return Ok(Default::default()) + return Err(CommonError::UnsupportedRuntimeApi.into()); } + #[allow(unused_variables)] fn collection_properties( collection_id: RmrkCollectionId, filter_keys: Option> @@ -249,9 +253,10 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_core::rpc::collection_properties::(collection_id, filter_keys); #[cfg(not(feature = "rmrk"))] - return Ok(Default::default()) + return Err(CommonError::UnsupportedRuntimeApi.into()); } + #[allow(unused_variables)] fn nft_properties( collection_id: RmrkCollectionId, nft_id: RmrkNftId, @@ -261,17 +266,19 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_core::rpc::nft_properties::(collection_id, nft_id, filter_keys); #[cfg(not(feature = "rmrk"))] - return Ok(Default::default()) + return Err(CommonError::UnsupportedRuntimeApi.into()); } + #[allow(unused_variables)] fn nft_resources(collection_id: RmrkCollectionId,nft_id: RmrkNftId) -> Result, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_core::rpc::nft_resources::(collection_id, nft_id); #[cfg(not(feature = "rmrk"))] - return Ok(Default::default()) + return Err(CommonError::UnsupportedRuntimeApi.into()); } + #[allow(unused_variables)] fn nft_resource_priority( collection_id: RmrkCollectionId, nft_id: RmrkNftId, @@ -281,33 +288,37 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_core::rpc::nft_resource_priority::(collection_id, nft_id, resource_id); #[cfg(not(feature = "rmrk"))] - return Ok(Default::default()) + return Err(CommonError::UnsupportedRuntimeApi.into()); } + #[allow(unused_variables)] fn base(base_id: RmrkBaseId) -> Result>, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_equip::rpc::base::(base_id); #[cfg(not(feature = "rmrk"))] - return Ok(Default::default()) + return Err(CommonError::UnsupportedRuntimeApi.into()); } + #[allow(unused_variables)] fn base_parts(base_id: RmrkBaseId) -> Result, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_equip::rpc::base_parts::(base_id); #[cfg(not(feature = "rmrk"))] - return Ok(Default::default()) + return Err(CommonError::UnsupportedRuntimeApi.into()); } + #[allow(unused_variables)] fn theme_names(base_id: RmrkBaseId) -> Result, DispatchError> { #[cfg(feature = "rmrk")] return pallet_proxy_rmrk_equip::rpc::theme_names::(base_id); #[cfg(not(feature = "rmrk"))] - Ok(Default::default()) + return Err(CommonError::UnsupportedRuntimeApi.into()); } + #[allow(unused_variables)] fn theme( base_id: RmrkBaseId, theme_name: RmrkThemeName, @@ -317,7 +328,7 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_equip::rpc::theme::(base_id, theme_name, filter_keys); #[cfg(not(feature = "rmrk"))] - return Ok(Default::default()) + return Err(CommonError::UnsupportedRuntimeApi.into()); } } From 23712510829aec335dcffb01d98002c866c75634 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 9 Aug 2022 08:07:50 +0000 Subject: [PATCH 0283/1274] cargo fmt --- common-types/src/lib.rs | 41 +++++++++---------- node/rpc/src/lib.rs | 4 +- runtime/common/config/ethereum.rs | 30 +++++--------- runtime/common/config/mod.rs | 6 +-- runtime/common/config/orml.rs | 5 +-- runtime/common/config/pallets/mod.rs | 24 ++++------- runtime/common/config/pallets/scheduler.rs | 15 ++----- runtime/common/config/parachain.rs | 13 +----- runtime/common/config/sponsoring.rs | 9 ++-- runtime/common/config/substrate.rs | 23 +++-------- runtime/common/config/xcm.rs | 34 ++++----------- runtime/common/ethereum/mod.rs | 2 +- .../common/ethereum/self_contained_call.rs | 4 +- runtime/common/ethereum/sponsoring.rs | 5 +-- .../common/ethereum/transaction_converter.rs | 6 +-- runtime/common/instance.rs | 9 ++-- runtime/common/mod.rs | 16 ++++---- runtime/common/scheduler.rs | 23 +++++------ 18 files changed, 93 insertions(+), 176 deletions(-) diff --git a/common-types/src/lib.rs b/common-types/src/lib.rs index 25e515144c..fb314a8ed6 100644 --- a/common-types/src/lib.rs +++ b/common-types/src/lib.rs @@ -17,8 +17,9 @@ #![cfg_attr(not(feature = "std"), no_std)] use sp_runtime::{ - generic, - traits::{Verify, IdentifyAccount}, MultiSignature, + generic, + traits::{Verify, IdentifyAccount}, + MultiSignature, }; /// Opaque types. These are used by the CLI to instantiate machinery that don't need to know @@ -26,33 +27,29 @@ use sp_runtime::{ /// of data like extrinsics, allowing for them to continue syncing the network through upgrades /// to even the core data structures. pub mod opaque { - pub use sp_runtime::{ - generic, - traits::BlakeTwo256, - OpaqueExtrinsic as UncheckedExtrinsic - }; + pub use sp_runtime::{generic, traits::BlakeTwo256, OpaqueExtrinsic as UncheckedExtrinsic}; pub use super::{BlockNumber, Signature, AccountId, Balance, Index, Hash, AuraId}; - /// Opaque block header type. - pub type Header = generic::Header; + /// Opaque block header type. + pub type Header = generic::Header; - /// Opaque block type. - pub type Block = generic::Block; + /// Opaque block type. + pub type Block = generic::Block; - pub trait RuntimeInstance { - type CrossAccountId: pallet_evm::account::CrossAccountId - + Send - + Sync - + 'static; + pub trait RuntimeInstance { + type CrossAccountId: pallet_evm::account::CrossAccountId + + Send + + Sync + + 'static; - type TransactionConverter: fp_rpc::ConvertTransaction - + Send - + Sync - + 'static; + type TransactionConverter: fp_rpc::ConvertTransaction + + Send + + Sync + + 'static; - fn get_transaction_converter() -> Self::TransactionConverter; - } + fn get_transaction_converter() -> Self::TransactionConverter; + } } pub type SessionHandlers = (); diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index a3126b2451..a7ceff0401 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -40,9 +40,7 @@ use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; use sc_service::TransactionPool; use std::{collections::BTreeMap, sync::Arc}; -use common_types::opaque::{ - Hash, AccountId, RuntimeInstance, Index, Block, BlockNumber, Balance, -}; +use common_types::opaque::{Hash, AccountId, RuntimeInstance, Index, Block, BlockNumber, Balance}; // RMRK use up_data_structs::{ diff --git a/runtime/common/config/ethereum.rs b/runtime/common/config/ethereum.rs index b78d55a914..b9d6be51aa 100644 --- a/runtime/common/config/ethereum.rs +++ b/runtime/common/config/ethereum.rs @@ -1,28 +1,18 @@ use sp_core::{U256, H160}; use frame_support::{ - weights::{Weight, constants::WEIGHT_PER_SECOND}, - traits::{FindAuthor}, - parameter_types, ConsensusEngineId, + weights::{Weight, constants::WEIGHT_PER_SECOND}, + traits::{FindAuthor}, + parameter_types, ConsensusEngineId, }; use sp_runtime::{RuntimeAppPublic, Perbill}; use crate::{ - runtime_common::{ - constants::*, - dispatch::CollectionDispatchT, - ethereum::sponsoring::EvmSponsorshipHandler, - config::sponsoring::DefaultSponsoringRateLimit, - DealWithFees, - }, - Runtime, - Aura, - Balances, - Event, - ChainId, -}; -use pallet_evm::{ - EnsureAddressTruncated, - HashedAddressMapping, + runtime_common::{ + constants::*, dispatch::CollectionDispatchT, ethereum::sponsoring::EvmSponsorshipHandler, + config::sponsoring::DefaultSponsoringRateLimit, DealWithFees, + }, + Runtime, Aura, Balances, Event, ChainId, }; +use pallet_evm::{EnsureAddressTruncated, HashedAddressMapping}; pub type CrossAccountId = pallet_evm::account::BasicCrossAccountId; @@ -116,7 +106,7 @@ impl pallet_ethereum::Config for Runtime { } parameter_types! { - // 0x842899ECF380553E8a4de75bF534cdf6fBF64049 + // 0x842899ECF380553E8a4de75bF534cdf6fBF64049 pub const HelpersContractAddress: H160 = H160([ 0x84, 0x28, 0x99, 0xec, 0xf3, 0x80, 0x55, 0x3e, 0x8a, 0x4d, 0xe7, 0x5b, 0xf5, 0x34, 0xcd, 0xf6, 0xfb, 0xf6, 0x40, 0x49, ]); diff --git a/runtime/common/config/mod.rs b/runtime/common/config/mod.rs index 4643460202..ebebc43c32 100644 --- a/runtime/common/config/mod.rs +++ b/runtime/common/config/mod.rs @@ -14,10 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -pub mod substrate; pub mod ethereum; -pub mod sponsoring; +pub mod orml; pub mod pallets; pub mod parachain; +pub mod sponsoring; +pub mod substrate; pub mod xcm; -pub mod orml; diff --git a/runtime/common/config/orml.rs b/runtime/common/config/orml.rs index f8e951de71..64ca90786d 100644 --- a/runtime/common/config/orml.rs +++ b/runtime/common/config/orml.rs @@ -16,10 +16,7 @@ use frame_support::parameter_types; use frame_system::EnsureSigned; -use crate::{ - runtime_common::constants::*, - Runtime, Event, RelayChainBlockNumberProvider, -}; +use crate::{runtime_common::constants::*, Runtime, Event, RelayChainBlockNumberProvider}; use common_types::{AccountId, Balance}; parameter_types! { diff --git a/runtime/common/config/pallets/mod.rs b/runtime/common/config/pallets/mod.rs index fe6875c979..3c434290bc 100644 --- a/runtime/common/config/pallets/mod.rs +++ b/runtime/common/config/pallets/mod.rs @@ -17,24 +17,18 @@ use frame_support::parameter_types; use sp_runtime::traits::AccountIdConversion; use crate::{ - runtime_common::{ - constants::*, - dispatch::CollectionDispatchT, - config::{ - substrate::TreasuryModuleId, - ethereum::EvmCollectionHelpersAddress, - }, - weights::CommonWeights, - RelayChainBlockNumberProvider, - }, - Runtime, - Event, - Call, - Balances, + runtime_common::{ + constants::*, + dispatch::CollectionDispatchT, + config::{substrate::TreasuryModuleId, ethereum::EvmCollectionHelpersAddress}, + weights::CommonWeights, + RelayChainBlockNumberProvider, + }, + Runtime, Event, Call, Balances, }; use common_types::{AccountId, Balance, BlockNumber}; use up_data_structs::{ - mapping::{EvmTokenAddressMapping, CrossTokenAddressMapping}, + mapping::{EvmTokenAddressMapping, CrossTokenAddressMapping}, }; #[cfg(feature = "rmrk")] diff --git a/runtime/common/config/pallets/scheduler.rs b/runtime/common/config/pallets/scheduler.rs index f49c51d5c7..e0dbb91eb0 100644 --- a/runtime/common/config/pallets/scheduler.rs +++ b/runtime/common/config/pallets/scheduler.rs @@ -14,20 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use frame_support::{ - traits::PrivilegeCmp, - weights::Weight, - parameter_types -}; +use frame_support::{traits::PrivilegeCmp, weights::Weight, parameter_types}; use frame_system::EnsureSigned; use sp_runtime::Perbill; use sp_std::cmp::Ordering; use crate::{ - runtime_common::{ - scheduler::SchedulerPaymentExecutor, - config::substrate::RuntimeBlockWeights, - }, - Runtime, Call, Event, Origin, OriginCaller, Balances + runtime_common::{scheduler::SchedulerPaymentExecutor, config::substrate::RuntimeBlockWeights}, + Runtime, Call, Event, Origin, OriginCaller, Balances, }; use common_types::AccountId; @@ -36,7 +29,7 @@ parameter_types! { RuntimeBlockWeights::get().max_block; pub const MaxScheduledPerBlock: u32 = 50; - pub const NoPreimagePostponement: Option = Some(10); + pub const NoPreimagePostponement: Option = Some(10); pub const Preimage: Option = Some(10); } diff --git a/runtime/common/config/parachain.rs b/runtime/common/config/parachain.rs index 28a33dce4e..0a716b9f59 100644 --- a/runtime/common/config/parachain.rs +++ b/runtime/common/config/parachain.rs @@ -14,17 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use frame_support::{ - weights::Weight, - parameter_types, -}; -use crate::{ - runtime_common::constants::*, - Runtime, - Event, - XcmpQueue, - DmpQueue, -}; +use frame_support::{weights::Weight, parameter_types}; +use crate::{runtime_common::constants::*, Runtime, Event, XcmpQueue, DmpQueue}; parameter_types! { pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; diff --git a/runtime/common/config/sponsoring.rs b/runtime/common/config/sponsoring.rs index 416fe31d6b..840214aa8a 100644 --- a/runtime/common/config/sponsoring.rs +++ b/runtime/common/config/sponsoring.rs @@ -16,16 +16,13 @@ use frame_support::parameter_types; use crate::{ - runtime_common::{ - constants::*, - sponsoring::UniqueSponsorshipHandler, - }, - Runtime, + runtime_common::{constants::*, sponsoring::UniqueSponsorshipHandler}, + Runtime, }; use common_types::BlockNumber; parameter_types! { - pub const DefaultSponsoringRateLimit: BlockNumber = 1 * DAYS; + pub const DefaultSponsoringRateLimit: BlockNumber = 1 * DAYS; } type SponsorshipHandler = ( diff --git a/runtime/common/config/substrate.rs b/runtime/common/config/substrate.rs index 9fc8871d03..f0daa66b09 100644 --- a/runtime/common/config/substrate.rs +++ b/runtime/common/config/substrate.rs @@ -18,11 +18,10 @@ use frame_support::{ traits::{Everything, ConstU32}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}, - DispatchClass, WeightToFeePolynomial, WeightToFeeCoefficients, - ConstantMultiplier, WeightToFeeCoefficient, + DispatchClass, WeightToFeePolynomial, WeightToFeeCoefficients, ConstantMultiplier, + WeightToFeeCoefficient, }, - parameter_types, - PalletId, + parameter_types, PalletId, }; use sp_runtime::{ generic, @@ -36,20 +35,8 @@ use frame_system::{ use sp_arithmetic::traits::{BaseArithmetic, Unsigned}; use smallvec::smallvec; use crate::{ - runtime_common::{ - DealWithFees, - constants::*, - }, - Runtime, - Event, - Call, - Origin, - PalletInfo, - System, - Balances, - Treasury, - SS58Prefix, - Version, + runtime_common::{DealWithFees, constants::*}, + Runtime, Event, Call, Origin, PalletInfo, System, Balances, Treasury, SS58Prefix, Version, }; use common_types::*; diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs index 2a8655fa5b..2eb2611b1d 100644 --- a/runtime/common/config/xcm.rs +++ b/runtime/common/config/xcm.rs @@ -15,19 +15,15 @@ // along with Unique Network. If not, see . use frame_support::{ - traits::{ - tokens::currency::Currency as CurrencyT, - OnUnbalanced as OnUnbalancedT, - Get, Everything - }, - weights::{Weight, WeightToFeePolynomial, WeightToFee}, - parameter_types, match_types, + traits::{ + tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Get, Everything, + }, + weights::{Weight, WeightToFeePolynomial, WeightToFee}, + parameter_types, match_types, }; use frame_system::EnsureRoot; use sp_runtime::{ - traits::{ - Saturating, CheckedConversion, Zero, - }, + traits::{Saturating, CheckedConversion, Zero}, SaturatedConversion, }; use pallet_xcm::XcmPassthrough; @@ -36,8 +32,7 @@ use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*}; use xcm::latest::{ AssetId::{Concrete}, Fungibility::Fungible as XcmFungible, - MultiAsset, - Error as XcmError, + MultiAsset, Error as XcmError, }; use xcm_executor::traits::{MatchesFungible, WeightTrader}; use xcm_builder::{ @@ -49,19 +44,8 @@ use xcm_builder::{ use xcm_executor::{Config, XcmExecutor, Assets}; use sp_std::marker::PhantomData; use crate::{ - runtime_common::{ - constants::*, - config::substrate::LinearFee - }, - Runtime, - Call, - Event, - Origin, - Balances, - ParachainInfo, - ParachainSystem, - PolkadotXcm, - XcmpQueue, + runtime_common::{constants::*, config::substrate::LinearFee}, + Runtime, Call, Event, Origin, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue, }; use common_types::{AccountId, Balance}; diff --git a/runtime/common/ethereum/mod.rs b/runtime/common/ethereum/mod.rs index ce229bc667..3aed7d9b72 100644 --- a/runtime/common/ethereum/mod.rs +++ b/runtime/common/ethereum/mod.rs @@ -14,6 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +pub mod self_contained_call; pub mod sponsoring; pub mod transaction_converter; -pub mod self_contained_call; diff --git a/runtime/common/ethereum/self_contained_call.rs b/runtime/common/ethereum/self_contained_call.rs index 5128cea279..b2bea68fc3 100644 --- a/runtime/common/ethereum/self_contained_call.rs +++ b/runtime/common/ethereum/self_contained_call.rs @@ -16,8 +16,8 @@ use sp_core::H160; use sp_runtime::{ - traits::{Dispatchable, DispatchInfoOf, PostDispatchInfoOf}, - transaction_validity::{TransactionValidityError, TransactionValidity}, + traits::{Dispatchable, DispatchInfoOf, PostDispatchInfoOf}, + transaction_validity::{TransactionValidityError, TransactionValidity}, }; use crate::{Origin, Call}; diff --git a/runtime/common/ethereum/sponsoring.rs b/runtime/common/ethereum/sponsoring.rs index 796e9b0207..b7d0d89fad 100644 --- a/runtime/common/ethereum/sponsoring.rs +++ b/runtime/common/ethereum/sponsoring.rs @@ -27,10 +27,7 @@ use pallet_evm::account::CrossAccountId; use up_data_structs::{TokenId, CreateItemData, CreateNftData, CollectionMode}; use pallet_unique::Config as UniqueConfig; -use crate::{ - Runtime, - runtime_common::sponsoring::* -}; +use crate::{Runtime, runtime_common::sponsoring::*}; use pallet_nonfungible::erc::{ UniqueNFTCall, ERC721UniqueExtensionsCall, ERC721MintableCall, ERC721Call, TokenPropertiesCall, diff --git a/runtime/common/ethereum/transaction_converter.rs b/runtime/common/ethereum/transaction_converter.rs index 0fe2be459b..9a7e945f85 100644 --- a/runtime/common/ethereum/transaction_converter.rs +++ b/runtime/common/ethereum/transaction_converter.rs @@ -15,11 +15,7 @@ // along with Unique Network. If not, see . use codec::{Encode, Decode}; -use crate::{ - opaque, - Runtime, - UncheckedExtrinsic, -}; +use crate::{opaque, Runtime, UncheckedExtrinsic}; pub struct TransactionConverter; diff --git a/runtime/common/instance.rs b/runtime/common/instance.rs index 5c33b99321..cc99ebe629 100644 --- a/runtime/common/instance.rs +++ b/runtime/common/instance.rs @@ -1,9 +1,8 @@ use crate::{ - runtime_common::{ - config::ethereum::CrossAccountId, - ethereum::transaction_converter::TransactionConverter - }, - Runtime, + runtime_common::{ + config::ethereum::CrossAccountId, ethereum::transaction_converter::TransactionConverter, + }, + Runtime, }; use common_types::opaque::RuntimeInstance; diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index 905078f1be..3428cc5dd9 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -14,23 +14,23 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +pub mod config; pub mod constants; pub mod construct_runtime; pub mod dispatch; +pub mod ethereum; +pub mod instance; pub mod runtime_apis; +pub mod scheduler; pub mod sponsoring; pub mod weights; -pub mod config; -pub mod instance; -pub mod ethereum; -pub mod scheduler; use sp_core::H160; use frame_support::traits::{Currency, OnUnbalanced, Imbalance}; use sp_runtime::{ - generic, - traits::{BlakeTwo256, BlockNumberProvider}, - impl_opaque_keys, + generic, + traits::{BlakeTwo256, BlockNumberProvider}, + impl_opaque_keys, }; use sp_std::vec::Vec; @@ -38,7 +38,7 @@ use sp_std::vec::Vec; use sp_version::NativeVersion; use crate::{ - Runtime, Call, Balances, Treasury, Aura, Signature, AllPalletsReversedWithSystemFirst, + Runtime, Call, Balances, Treasury, Aura, Signature, AllPalletsReversedWithSystemFirst, InherentDataExt, }; use common_types::{AccountId, BlockNumber}; diff --git a/runtime/common/scheduler.rs b/runtime/common/scheduler.rs index b0b936ba72..75cb3d3488 100644 --- a/runtime/common/scheduler.rs +++ b/runtime/common/scheduler.rs @@ -15,19 +15,16 @@ // along with Unique Network. If not, see . use frame_support::{ - traits::NamedReservableCurrency, - weights::{GetDispatchInfo, PostDispatchInfo, DispatchInfo}, + traits::NamedReservableCurrency, + weights::{GetDispatchInfo, PostDispatchInfo, DispatchInfo}, }; use sp_runtime::{ - traits::{Dispatchable, Applyable, Member}, + traits::{Dispatchable, Applyable, Member}, generic::Era, - transaction_validity::TransactionValidityError, + transaction_validity::TransactionValidityError, DispatchErrorWithPostInfo, DispatchError, }; -use crate::{ - Runtime, Call, Origin, Balances, - ChargeTransactionPayment, -}; +use crate::{Runtime, Call, Origin, Balances, ChargeTransactionPayment}; use common_types::{AccountId, Balance}; use fp_self_contained::SelfContainedCall; use pallet_unique_scheduler::DispatchCall; @@ -85,11 +82,11 @@ where SignedExtraScheduler, SelfContainedSignedInfo, > { - signed: - fp_self_contained::CheckedSignature::::Signed( - signer.clone().into(), - get_signed_extras(signer.into()), - ), + signed: fp_self_contained::CheckedSignature::< + AccountId, + SignedExtraScheduler, + SelfContainedSignedInfo, + >::Signed(signer.clone().into(), get_signed_extras(signer.into())), function: call.into(), }; From 24b248d5b1290440162d80b5ce6e277e6b5697cf Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 9 Aug 2022 11:10:32 +0000 Subject: [PATCH 0284/1274] fix: add refungible feature --- runtime/opal/Cargo.toml | 3 ++- runtime/quartz/Cargo.toml | 1 + runtime/unique/Cargo.toml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index adbd02e8fc..ba1d7f2209 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -121,8 +121,9 @@ std = [ "orml-vesting/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] -opal-runtime = ['rmrk', 'scheduler'] +opal-runtime = ['refungible', 'scheduler', 'rmrk'] +refungible = [] scheduler = [] rmrk = [] diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 8799cb982f..8a45b0acad 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -120,6 +120,7 @@ std = [ limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] quartz-runtime = [] +refungible = [] scheduler = [] rmrk = [] diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 30a1ff6dc0..8158a7b78e 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -121,6 +121,7 @@ std = [ limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] unique-runtime = [] +refungible = [] scheduler = [] rmrk = [] From 5eadf5f526c32bb7decd26f15e363104171d3445 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 9 Aug 2022 11:11:16 +0000 Subject: [PATCH 0285/1274] refactor: unsupported! macro --- pallets/common/src/lib.rs | 10 ++++------ runtime/common/dispatch.rs | 8 +++++--- runtime/common/mod.rs | 7 ++++++- runtime/common/runtime_apis.rs | 26 +++++++++++++------------- 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 6e92fa7ae5..f83d7ee832 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -535,7 +535,8 @@ pub mod pallet { /// Can't transfer tokens to ethereum zero address AddressIsZero, - /// Target collection doesn't support this operation + + /// The oprtation is not supported UnsupportedOperation, /// Insufficient funds to perform an action @@ -569,9 +570,6 @@ pub mod pallet { /// Tried to access an internal collection with an external API CollectionIsInternal, - - /// A method of an unsupported API was called - UnsupportedRuntimeApi, } /// Storage of the count of created collections. Essentially contains the last collection ID. @@ -1356,8 +1354,8 @@ impl Pallet { /// Indicates unsupported methods by returning [Error::UnsupportedOperation]. #[macro_export] macro_rules! unsupported { - () => { - Err(>::UnsupportedOperation.into()) + ($runtime:path) => { + Err($crate::Error::<$runtime>::UnsupportedOperation.into()) }; } diff --git a/runtime/common/dispatch.rs b/runtime/common/dispatch.rs index 6cea499cdd..f752505fac 100644 --- a/runtime/common/dispatch.rs +++ b/runtime/common/dispatch.rs @@ -34,6 +34,9 @@ use up_data_structs::{ CollectionId, }; +#[cfg(not(feature = "refungible"))] +use pallet_common::unsupported; + pub enum CollectionDispatchT where T: pallet_fungible::Config + pallet_nonfungible::Config + pallet_refungible::Config, @@ -64,13 +67,12 @@ where ); >::init_collection(sender, data)? } + #[cfg(feature = "refungible")] CollectionMode::ReFungible => >::init_collection(sender, data)?, #[cfg(not(feature = "refungible"))] - CollectionMode::ReFungible => { - return Err(DispatchError::Other("Refunginle pallet is not supported")) - } + CollectionMode::ReFungible => return unsupported!(T) }; Ok(id) } diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index 3428cc5dd9..63f137c2fc 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -43,7 +43,12 @@ use crate::{ }; use common_types::{AccountId, BlockNumber}; -pub type CommonError = pallet_common::Error; +#[macro_export] +macro_rules! unsupported { + () => { + pallet_common::unsupported!($crate::Runtime) + } +} /// The address format for describing accounts. pub type Address = sp_runtime::MultiAddress; diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index 1488055d8d..3054ba025f 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -205,7 +205,7 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_core::rpc::last_collection_idx::(); #[cfg(not(feature = "rmrk"))] - return Err(CommonError::UnsupportedRuntimeApi.into()); + return unsupported!(); } #[allow(unused_variables)] @@ -214,7 +214,7 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_core::rpc::collection_by_id::(collection_id); #[cfg(not(feature = "rmrk"))] - return Err(CommonError::UnsupportedRuntimeApi.into()); + return unsupported!(); } #[allow(unused_variables)] @@ -223,7 +223,7 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_core::rpc::nft_by_id::(collection_id, nft_by_id); #[cfg(not(feature = "rmrk"))] - return Err(CommonError::UnsupportedRuntimeApi.into()); + return unsupported!(); } #[allow(unused_variables)] @@ -232,7 +232,7 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_core::rpc::account_tokens::(account_id, collection_id); #[cfg(not(feature = "rmrk"))] - return Err(CommonError::UnsupportedRuntimeApi.into()); + return unsupported!(); } #[allow(unused_variables)] @@ -241,7 +241,7 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_core::rpc::nft_children::(collection_id, nft_id); #[cfg(not(feature = "rmrk"))] - return Err(CommonError::UnsupportedRuntimeApi.into()); + return unsupported!(); } #[allow(unused_variables)] @@ -253,7 +253,7 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_core::rpc::collection_properties::(collection_id, filter_keys); #[cfg(not(feature = "rmrk"))] - return Err(CommonError::UnsupportedRuntimeApi.into()); + return unsupported!(); } #[allow(unused_variables)] @@ -266,7 +266,7 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_core::rpc::nft_properties::(collection_id, nft_id, filter_keys); #[cfg(not(feature = "rmrk"))] - return Err(CommonError::UnsupportedRuntimeApi.into()); + return unsupported!(); } #[allow(unused_variables)] @@ -275,7 +275,7 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_core::rpc::nft_resources::(collection_id, nft_id); #[cfg(not(feature = "rmrk"))] - return Err(CommonError::UnsupportedRuntimeApi.into()); + return unsupported!(); } #[allow(unused_variables)] @@ -288,7 +288,7 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_core::rpc::nft_resource_priority::(collection_id, nft_id, resource_id); #[cfg(not(feature = "rmrk"))] - return Err(CommonError::UnsupportedRuntimeApi.into()); + return unsupported!(); } #[allow(unused_variables)] @@ -297,7 +297,7 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_equip::rpc::base::(base_id); #[cfg(not(feature = "rmrk"))] - return Err(CommonError::UnsupportedRuntimeApi.into()); + return unsupported!(); } #[allow(unused_variables)] @@ -306,7 +306,7 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_equip::rpc::base_parts::(base_id); #[cfg(not(feature = "rmrk"))] - return Err(CommonError::UnsupportedRuntimeApi.into()); + return unsupported!(); } #[allow(unused_variables)] @@ -315,7 +315,7 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_equip::rpc::theme_names::(base_id); #[cfg(not(feature = "rmrk"))] - return Err(CommonError::UnsupportedRuntimeApi.into()); + return unsupported!(); } #[allow(unused_variables)] @@ -328,7 +328,7 @@ macro_rules! impl_common_runtime_apis { return pallet_proxy_rmrk_equip::rpc::theme::(base_id, theme_name, filter_keys); #[cfg(not(feature = "rmrk"))] - return Err(CommonError::UnsupportedRuntimeApi.into()); + return unsupported!(); } } From 3d7ffe75f2a8c951ed2f13e7fdeb27975e196b0d Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 9 Aug 2022 16:45:25 +0000 Subject: [PATCH 0286/1274] fix: skip refungible and scheduler tests on qtz/unq --- tests/src/approve.test.ts | 108 +++++++--- tests/src/burnItem.test.ts | 14 +- tests/src/confirmSponsorship.test.ts | 10 +- tests/src/createCollection.test.ts | 6 +- tests/src/createItem.test.ts | 22 +- tests/src/createMultipleItems.test.ts | 34 ++- tests/src/createMultipleItemsEx.test.ts | 14 +- tests/src/destroyCollection.test.ts | 6 +- tests/src/eth/createRFTCollection.test.ts | 12 +- tests/src/eth/reFungible.test.ts | 20 +- tests/src/eth/reFungibleToken.test.ts | 22 +- tests/src/eth/scheduling.test.ts | 8 +- tests/src/limits.test.ts | 10 +- tests/src/nesting/nest.test.ts | 26 ++- tests/src/nesting/properties.test.ts | 98 ++++++--- tests/src/nesting/rules-smoke.test.ts | 6 +- tests/src/nesting/unnest.test.ts | 6 +- tests/src/nextSponsoring.test.ts | 6 +- tests/src/pallet-presence.test.ts | 14 +- tests/src/refungible.test.ts | 3 + tests/src/rmrk/acceptNft.test.ts | 2 +- tests/src/rmrk/addResource.test.ts | 2 +- tests/src/rmrk/addTheme.test.ts | 2 +- tests/src/rmrk/burnNft.test.ts | 2 +- tests/src/rmrk/changeCollectionIssuer.test.ts | 2 +- tests/src/rmrk/createBase.test.ts | 2 +- tests/src/rmrk/createCollection.test.ts | 2 +- tests/src/rmrk/deleteCollection.test.ts | 2 +- tests/src/rmrk/equipNft.test.ts | 2 +- tests/src/rmrk/getOwnedNfts.test.ts | 2 +- tests/src/rmrk/lockCollection.test.ts | 2 +- tests/src/rmrk/mintNft.test.ts | 2 +- tests/src/rmrk/rejectNft.test.ts | 2 +- tests/src/rmrk/removeResource.test.ts | 2 +- tests/src/rmrk/rmrkIsolation.test.ts | 2 +- tests/src/rmrk/sendNft.test.ts | 2 +- tests/src/rmrk/setCollectionProperty.test.ts | 2 +- tests/src/rmrk/setEquippableList.test.ts | 2 +- tests/src/rmrk/setNftProperty.test.ts | 2 +- tests/src/rmrk/setResourcePriorities.test.ts | 2 +- tests/src/setCollectionSponsor.test.ts | 6 +- tests/src/transfer.test.ts | 188 +++++++++------- tests/src/transferFrom.test.ts | 201 ++++++++++-------- 43 files changed, 599 insertions(+), 281 deletions(-) diff --git a/tests/src/approve.test.ts b/tests/src/approve.test.ts index 8b0732f1c6..47921b657f 100644 --- a/tests/src/approve.test.ts +++ b/tests/src/approve.test.ts @@ -32,6 +32,8 @@ import { getCreatedCollectionCount, transferFromExpectSuccess, transferFromExpectFail, + requirePallets, + Pallets } from './util/helpers'; chai.use(chaiAsPromised); @@ -49,34 +51,44 @@ describe('Integration Test approve(spender, collection_id, item_id, amount):', ( }); }); - it('Execute the extrinsic and check approvedList', async () => { + it('[nft] Execute the extrinsic and check approvedList', async () => { const nftCollectionId = await createCollectionExpectSuccess(); - // nft const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address); - // fungible + }); + + it('[fungible] Execute the extrinsic and check approvedList', async () => { const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address); - // reFungible + }); + + it('[refungible] Execute the extrinsic and check approvedList', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address); }); - it('Remove approval by using 0 amount', async () => { + it('[nft] Remove approval by using 0 amount', async () => { const nftCollectionId = await createCollectionExpectSuccess(); - // nft const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address, 1); await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address, 0); - // fungible + }); + + it('[fungible] Remove approval by using 0 amount', async () => { const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address, 1); await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address, 0); - // reFungible + }); + + it('[refungible] Remove approval by using 0 amount', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); @@ -117,7 +129,9 @@ describe('Normal user can approve other users to transfer:', () => { await approveExpectSuccess(collectionId, itemId, bob, charlie.address); }); - it('ReFungible up to an approved amount', async () => { + it('ReFungible up to an approved amount', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}}); const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', bob.address); await approveExpectSuccess(collectionId, itemId, bob, charlie.address); @@ -151,7 +165,9 @@ describe('Approved users can transferFrom up to approved amount:', () => { await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'Fungible'); }); - it('ReFungible up to an approved amount', async () => { + it('ReFungible up to an approved amount', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}}); const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', bob.address); await approveExpectSuccess(collectionId, itemId, bob, charlie.address); @@ -188,7 +204,9 @@ describe('Approved users cannot use transferFrom to repeat transfers if approved await transferFromExpectFail(collectionId, itemId, charlie, bob, alice, 1); }); - it('ReFungible up to an approved amount', async () => { + it('ReFungible up to an approved amount', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}}); const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', bob.address); await approveExpectSuccess(collectionId, itemId, bob, charlie.address); @@ -250,7 +268,9 @@ describe('User may clear the approvals to approving for 0 amount:', () => { await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, bob, charlie, 1); }); - it('ReFungible', async () => { + it('ReFungible', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); @@ -285,7 +305,9 @@ describe('User cannot approve for the amount greater than they own:', () => { await approveExpectFail(fungibleCollectionId, newFungibleTokenId, bob, charlie, 11); }); - it('ReFungible', async () => { + it('ReFungible', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); await approveExpectFail(reFungibleCollectionId, newReFungibleTokenId, bob, charlie, 101); @@ -325,7 +347,9 @@ describe('Administrator and collection owner do not need approval in order to ex await transferFromExpectSuccess(collectionId, itemId, bob, dave, alice, 1, 'Fungible'); }); - it('ReFungible up to an approved amount', async () => { + it('ReFungible up to an approved amount', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}}); await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true}); const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', charlie.address); @@ -422,63 +446,87 @@ describe('Negative Integration Test approve(spender, collection_id, item_id, amo }); }); - it('Approve for a collection that does not exist', async () => { + it('[nft] Approve for a collection that does not exist', async () => { await usingApi(async (api: ApiPromise) => { - // nft const nftCollectionCount = await getCreatedCollectionCount(api); await approveExpectFail(nftCollectionCount + 1, 1, alice, bob); - // fungible + }); + }); + + it('[fungible] Approve for a collection that does not exist', async () => { + await usingApi(async (api: ApiPromise) => { const fungibleCollectionCount = await getCreatedCollectionCount(api); await approveExpectFail(fungibleCollectionCount + 1, 0, alice, bob); - // reFungible + }); + }); + + it('[refungible] Approve for a collection that does not exist', async function() { + await requirePallets(this, [Pallets.ReFungible]); + + await usingApi(async (api: ApiPromise) => { const reFungibleCollectionCount = await getCreatedCollectionCount(api); await approveExpectFail(reFungibleCollectionCount + 1, 1, alice, bob); }); }); - it('Approve for a collection that was destroyed', async () => { - // nft + it('[nft] Approve for a collection that was destroyed', async () => { const nftCollectionId = await createCollectionExpectSuccess(); await destroyCollectionExpectSuccess(nftCollectionId); await approveExpectFail(nftCollectionId, 1, alice, bob); - // fungible + }); + + it('Approve for a collection that was destroyed', async () => { const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); await destroyCollectionExpectSuccess(fungibleCollectionId); await approveExpectFail(fungibleCollectionId, 0, alice, bob); - // reFungible + }); + + it('[refungible] Approve for a collection that was destroyed', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); await destroyCollectionExpectSuccess(reFungibleCollectionId); await approveExpectFail(reFungibleCollectionId, 1, alice, bob); }); - it('Approve transfer of a token that does not exist', async () => { - // nft + it('[nft] Approve transfer of a token that does not exist', async () => { const nftCollectionId = await createCollectionExpectSuccess(); await approveExpectFail(nftCollectionId, 2, alice, bob); - // reFungible + }); + + it('[refungible] Approve transfer of a token that does not exist', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); await approveExpectFail(reFungibleCollectionId, 2, alice, bob); }); - it('Approve using the address that does not own the approved token', async () => { + it('[nft] Approve using the address that does not own the approved token', async () => { const nftCollectionId = await createCollectionExpectSuccess(); - // nft const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); await approveExpectFail(nftCollectionId, newNftTokenId, bob, alice); - // fungible + }); + + it('[fungible] Approve using the address that does not own the approved token', async () => { const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); await approveExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice); - // reFungible + }); + + it('[refungible] Approve using the address that does not own the approved token', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); await approveExpectFail(reFungibleCollectionId, newReFungibleTokenId, bob, alice); }); - it('should fail if approved more ReFungibles than owned', async () => { + it('should fail if approved more ReFungibles than owned', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const nftCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'ReFungible'); await transferExpectSuccess(nftCollectionId, newNftTokenId, alice, bob, 100, 'ReFungible'); diff --git a/tests/src/burnItem.test.ts b/tests/src/burnItem.test.ts index 7e686d186e..a422a992d7 100644 --- a/tests/src/burnItem.test.ts +++ b/tests/src/burnItem.test.ts @@ -25,6 +25,8 @@ import { getBalance, setCollectionLimitsExpectSuccess, isTokenExists, + requirePallets, + Pallets } from './util/helpers'; import chai from 'chai'; @@ -80,7 +82,9 @@ describe('integration test: ext. burnItem():', () => { }); }); - it('Burn item in ReFungible collection', async () => { + it('Burn item in ReFungible collection', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const createMode = 'ReFungible'; const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}}); const tokenId = await createItemExpectSuccess(alice, collectionId, createMode); @@ -99,7 +103,9 @@ describe('integration test: ext. burnItem():', () => { }); }); - it('Burn owned portion of item in ReFungible collection', async () => { + it('Burn owned portion of item in ReFungible collection', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const createMode = 'ReFungible'; const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}}); const tokenId = await createItemExpectSuccess(alice, collectionId, createMode); @@ -189,7 +195,9 @@ describe('integration test: ext. burnItem() with admin permissions:', () => { }); // TODO: burnFrom - it('Burn item in ReFungible collection', async () => { + it('Burn item in ReFungible collection', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const createMode = 'ReFungible'; const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}}); await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true}); diff --git a/tests/src/confirmSponsorship.test.ts b/tests/src/confirmSponsorship.test.ts index c934f26308..6c6af489ff 100644 --- a/tests/src/confirmSponsorship.test.ts +++ b/tests/src/confirmSponsorship.test.ts @@ -33,6 +33,8 @@ import { addCollectionAdminExpectSuccess, getCreatedCollectionCount, UNIQUE, + requirePallets, + Pallets } from './util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; @@ -124,7 +126,9 @@ describe('integration test: ext. confirmSponsorship():', () => { }); }); - it('ReFungible: Transfer fees are paid by the sponsor after confirmation', async () => { + it('ReFungible: Transfer fees are paid by the sponsor after confirmation', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); await setCollectionSponsorExpectSuccess(collectionId, bob.address); await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); @@ -252,7 +256,9 @@ describe('integration test: ext. confirmSponsorship():', () => { }); }); - it('ReFungible: Sponsoring is rate limited', async () => { + it('ReFungible: Sponsoring is rate limited', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); await setCollectionSponsorExpectSuccess(collectionId, bob.address); await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); diff --git a/tests/src/createCollection.test.ts b/tests/src/createCollection.test.ts index 4102f18527..0cddcd7c61 100644 --- a/tests/src/createCollection.test.ts +++ b/tests/src/createCollection.test.ts @@ -16,7 +16,7 @@ import {expect} from 'chai'; import usingApi, {executeTransaction, submitTransactionAsync} from './substrate/substrate-api'; -import {createCollectionWithPropsExpectFailure, createCollectionExpectFailure, createCollectionExpectSuccess, getCreateCollectionResult, getDetailedCollectionInfo, createCollectionWithPropsExpectSuccess} from './util/helpers'; +import {createCollectionWithPropsExpectFailure, createCollectionExpectFailure, createCollectionExpectSuccess, getCreateCollectionResult, getDetailedCollectionInfo, createCollectionWithPropsExpectSuccess, requirePallets, Pallets} from './util/helpers'; describe('integration test: ext. createCollection():', () => { it('Create new NFT collection', async () => { @@ -34,7 +34,9 @@ describe('integration test: ext. createCollection():', () => { it('Create new Fungible collection', async () => { await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); }); - it('Create new ReFungible collection', async () => { + it('Create new ReFungible collection', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); }); diff --git a/tests/src/createItem.test.ts b/tests/src/createItem.test.ts index b4d461df6b..e06de8b964 100644 --- a/tests/src/createItem.test.ts +++ b/tests/src/createItem.test.ts @@ -29,6 +29,8 @@ import { itApi, normalizeAccountId, getCreateItemResult, + requirePallets, + Pallets } from './util/helpers'; const expect = chai.expect; @@ -79,7 +81,9 @@ describe('integration test: ext. ():', () => { } }); - it('Create new item in ReFungible collection', async () => { + it('Create new item in ReFungible collection', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const createMode = 'ReFungible'; const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}}); await createItemExpectSuccess(alice, newCollectionID, createMode); @@ -96,7 +100,9 @@ describe('integration test: ext. ():', () => { await addCollectionAdminExpectSuccess(alice, newCollectionID, bob.address); await createItemExpectSuccess(bob, newCollectionID, createMode); }); - it('Create new item in ReFungible collection with collection admin permissions', async () => { + it('Create new item in ReFungible collection with collection admin permissions', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const createMode = 'ReFungible'; const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}}); await addCollectionAdminExpectSuccess(alice, newCollectionID, bob.address); @@ -175,7 +181,9 @@ describe('integration test: ext. ():', () => { }); }); - it('Check total pieces of ReFungible token', async () => { + it('Check total pieces of ReFungible token', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async api => { const createMode = 'ReFungible'; const createCollectionResult = await createCollection(api, alice, {mode: {type: createMode}}); @@ -219,7 +227,9 @@ describe('Negative integration test: ext. createItem():', () => { const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}}); await expect(createItemExpectSuccess(bob, newCollectionID, createMode)).to.be.rejected; }); - it('Regular user cannot create new item in ReFungible collection', async () => { + it('Regular user cannot create new item in ReFungible collection', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const createMode = 'ReFungible'; const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}}); await expect(createItemExpectSuccess(bob, newCollectionID, createMode)).to.be.rejected; @@ -296,7 +306,9 @@ describe('Negative integration test: ext. createItem():', () => { }); }); - it('Check total pieces for invalid Refungible token', async () => { + it('Check total pieces for invalid Refungible token', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async api => { const createCollectionResult = await createCollection(api, alice, {mode: {type: 'ReFungible'}}); const collectionId = createCollectionResult.collectionId; diff --git a/tests/src/createMultipleItems.test.ts b/tests/src/createMultipleItems.test.ts index 10eeae9709..2d10c91e95 100644 --- a/tests/src/createMultipleItems.test.ts +++ b/tests/src/createMultipleItems.test.ts @@ -33,6 +33,9 @@ import { createCollectionWithPropsExpectSuccess, createMultipleItemsWithPropsExpectSuccess, getTokenProperties, + requirePallets, + Pallets, + checkPalletsPresence } from './util/helpers'; chai.use(chaiAsPromised); @@ -91,7 +94,9 @@ describe('Integration Test createMultipleItems(collection_id, owner, items_data) }); }); - it('Create 0x31, 0x32, 0x33 items in active ReFungible collection and verify tokens data in chain', async () => { + it('Create 0x31, 0x32, 0x33 items in active ReFungible collection and verify tokens data in chain', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async (api, privateKeyWrapper) => { const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); const itemsListIndexBefore = await getLastTokenId(api, collectionId); @@ -272,7 +277,9 @@ describe('Integration Test createMultipleItems(collection_id, owner, items_data) }); }); - it('Create 0x31, 0x32, 0x33 items in active ReFungible collection and verify tokens data in chain', async () => { + it('Create 0x31, 0x32, 0x33 items in active ReFungible collection and verify tokens data in chain', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async (api: ApiPromise) => { const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); const itemsListIndexBefore = await getLastTokenId(api, collectionId); @@ -335,7 +342,9 @@ describe('Negative Integration Test createMultipleItems(collection_id, owner, it }); }); - it('Regular user cannot create items in active ReFungible collection', async () => { + it('Regular user cannot create items in active ReFungible collection', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async (api: ApiPromise) => { const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); const itemsListIndexBefore = await getLastTokenId(api, collectionId); @@ -358,9 +367,8 @@ describe('Negative Integration Test createMultipleItems(collection_id, owner, it }); }); - it('Create NFT and Re-fungible tokens that has reached the maximum data limit', async () => { + it('Create NFTs that has reached the maximum data limit', async function() { await usingApi(async (api, privateKeyWrapper) => { - // NFT const collectionId = await createCollectionWithPropsExpectSuccess({ propPerm: [{key: 'key', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}], }); @@ -372,8 +380,13 @@ describe('Negative Integration Test createMultipleItems(collection_id, owner, it ]; const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args); await expect(submitTransactionExpectFailAsync(alice, createMultipleItemsTx)).to.be.rejected; + }); + }); - // ReFungible + it('Create Refungible tokens that has reached the maximum data limit', async function() { + await requirePallets(this, [Pallets.ReFungible]); + + await usingApi(async api => { const collectionIdReFungible = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); { @@ -402,8 +415,15 @@ describe('Negative Integration Test createMultipleItems(collection_id, owner, it it('Create tokens with different types', async () => { await usingApi(async (api: ApiPromise) => { const collectionId = await createCollectionExpectSuccess(); + + let types = ['NFT', 'Fungible']; + + if (await checkPalletsPresence([Pallets.ReFungible])) { + types.push('ReFungible'); + } + const createMultipleItemsTx = api.tx.unique - .createMultipleItems(collectionId, normalizeAccountId(alice.address), ['NFT', 'Fungible', 'ReFungible']); + .createMultipleItems(collectionId, normalizeAccountId(alice.address), types); await expect(executeTransaction(api, alice, createMultipleItemsTx)).to.be.rejectedWith(/nonfungible\.NotNonfungibleDataUsedToMintFungibleCollectionToken/); // garbage collection :-D // lol await destroyCollectionExpectSuccess(collectionId); diff --git a/tests/src/createMultipleItemsEx.test.ts b/tests/src/createMultipleItemsEx.test.ts index e5a695ac9f..ac5e10efa8 100644 --- a/tests/src/createMultipleItemsEx.test.ts +++ b/tests/src/createMultipleItemsEx.test.ts @@ -16,7 +16,7 @@ import {expect} from 'chai'; import usingApi, {executeTransaction} from './substrate/substrate-api'; -import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, createCollectionWithPropsExpectSuccess, getBalance, getLastTokenId, getTokenProperties} from './util/helpers'; +import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, createCollectionWithPropsExpectSuccess, getBalance, getLastTokenId, getTokenProperties, requirePallets, Pallets} from './util/helpers'; describe.only('Integration Test: createMultipleItemsEx', () => { it('can initialize multiple NFT with different owners', async () => { @@ -146,7 +146,9 @@ describe.only('Integration Test: createMultipleItemsEx', () => { }); }); - it('can initialize an RFT with multiple owners', async () => { + it('can initialize an RFT with multiple owners', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async (api, privateKeyWrapper) => { const alice = privateKeyWrapper('//Alice'); const bob = privateKeyWrapper('//Bob'); @@ -178,7 +180,9 @@ describe.only('Integration Test: createMultipleItemsEx', () => { }); }); - it('can initialize multiple RFTs with the same owner', async () => { + it('can initialize multiple RFTs with the same owner', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async (api, privateKeyWrapper) => { const alice = privateKeyWrapper('//Alice'); const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); @@ -389,7 +393,9 @@ describe('Negative test: createMultipleItemsEx', () => { }); }); - it('fails when trying to set multiple owners when creating multiple refungibles', async () => { + it('fails when trying to set multiple owners when creating multiple refungibles', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); await usingApi(async (api, privateKeyWrapper) => { diff --git a/tests/src/destroyCollection.test.ts b/tests/src/destroyCollection.test.ts index 9f3cfdbcfe..1182dbfd58 100644 --- a/tests/src/destroyCollection.test.ts +++ b/tests/src/destroyCollection.test.ts @@ -25,6 +25,8 @@ import {createCollectionExpectSuccess, addCollectionAdminExpectSuccess, getCreatedCollectionCount, createItemExpectSuccess, + requirePallets, + Pallets } from './util/helpers'; chai.use(chaiAsPromised); @@ -38,7 +40,9 @@ describe('integration test: ext. destroyCollection():', () => { const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); await destroyCollectionExpectSuccess(collectionId); }); - it('ReFungible collection can be destroyed', async () => { + it('ReFungible collection can be destroyed', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); await destroyCollectionExpectSuccess(collectionId); }); diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts index 47396a1ed7..77a7b6dbbb 100644 --- a/tests/src/eth/createRFTCollection.test.ts +++ b/tests/src/eth/createRFTCollection.test.ts @@ -16,7 +16,7 @@ import {evmToAddress} from '@polkadot/util-crypto'; import {expect} from 'chai'; -import {getCreatedCollectionCount, getDetailedCollectionInfo} from '../util/helpers'; +import {getCreatedCollectionCount, getDetailedCollectionInfo, requirePallets, Pallets} from '../util/helpers'; import { evmCollectionHelpers, collectionIdToAddress, @@ -28,6 +28,10 @@ import { } from './util/helpers'; describe('Create RFT collection from EVM', () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + }); + itWeb3('Create collection', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelper = evmCollectionHelpers(web3, owner); @@ -146,6 +150,10 @@ describe('Create RFT collection from EVM', () => { }); describe('(!negative tests!) Create RFT collection from EVM', () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + }); + itWeb3('(!negative test!) Create collection (bad lengths)', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, owner); @@ -228,4 +236,4 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { .setCollectionLimit('badLimit', 'true') .call()).to.be.rejectedWith('unknown boolean limit "badLimit"'); }); -}); \ No newline at end of file +}); diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 551a3b3fda..598ea37262 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -14,12 +14,16 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {createCollectionExpectSuccess, UNIQUE} from '../util/helpers'; +import {createCollectionExpectSuccess, UNIQUE, requirePallets, Pallets} from '../util/helpers'; import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, tokenIdToAddress} from './util/helpers'; import reFungibleTokenAbi from './reFungibleTokenAbi.json'; import {expect} from 'chai'; describe('Refungible: Information getting', () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + }); + itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, caller); @@ -120,6 +124,10 @@ describe('Refungible: Information getting', () => { }); describe('Refungible: Plain calls', () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + }); + itWeb3('Can perform mint()', async ({web3, api, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, owner); @@ -399,6 +407,10 @@ describe('Refungible: Plain calls', () => { }); describe('RFT: Fees', () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + }); + itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, caller); @@ -435,6 +447,10 @@ describe('RFT: Fees', () => { }); describe('Common metadata', () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + }); + itWeb3('Returns collection name', async ({api, web3, privateKeyWrapper}) => { const collection = await createCollectionExpectSuccess({ name: 'token name', @@ -462,4 +478,4 @@ describe('Common metadata', () => { expect(symbol).to.equal('TOK'); }); -}); \ No newline at end of file +}); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 16d959bb56..2d130d8c84 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {approve, createCollection, createRefungibleToken, transfer, transferFrom, UNIQUE} from '../util/helpers'; +import {approve, createCollection, createRefungibleToken, transfer, transferFrom, UNIQUE, requirePallets, Pallets} from '../util/helpers'; import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth} from './util/helpers'; import reFungibleTokenAbi from './reFungibleTokenAbi.json'; @@ -24,6 +24,10 @@ chai.use(chaiAsPromised); const expect = chai.expect; describe('Refungible token: Information getting', () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + }); + itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => { const alice = privateKeyWrapper('//Alice'); @@ -75,6 +79,10 @@ describe('Refungible token: Information getting', () => { // FIXME: Need erc721 for ReFubgible. describe('Check ERC721 token URI for ReFungible', () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + }); + itWeb3('Empty tokenURI', async ({web3, api, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, owner); @@ -216,6 +224,10 @@ describe('Check ERC721 token URI for ReFungible', () => { }); describe('Refungible: Plain calls', () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + }); + itWeb3('Can perform approve()', async ({web3, api, privateKeyWrapper}) => { const alice = privateKeyWrapper('//Alice'); @@ -477,6 +489,10 @@ describe('Refungible: Plain calls', () => { }); describe('Refungible: Fees', () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + }); + itWeb3('approve() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { const alice = privateKeyWrapper('//Alice'); @@ -532,6 +548,10 @@ describe('Refungible: Fees', () => { }); describe('Refungible: Substrate calls', () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + }); + itWeb3('Events emitted for approve()', async ({web3, api, privateKeyWrapper}) => { const alice = privateKeyWrapper('//Alice'); diff --git a/tests/src/eth/scheduling.test.ts b/tests/src/eth/scheduling.test.ts index 1fc0ff0f84..2d7fc7e887 100644 --- a/tests/src/eth/scheduling.test.ts +++ b/tests/src/eth/scheduling.test.ts @@ -16,9 +16,13 @@ import {expect} from 'chai'; import {createEthAccountWithBalance, deployFlipper, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from './util/helpers'; -import {scheduleExpectSuccess, waitNewBlocks} from '../util/helpers'; +import {scheduleExpectSuccess, waitNewBlocks, requirePallets, Pallets} from '../util/helpers'; describe('Scheduing EVM smart contracts', () => { + before(async function() { + await requirePallets(this, [Pallets.Scheduler]); + }); + itWeb3('Successfully schedules and periodically executes an EVM contract', async ({api, web3, privateKeyWrapper}) => { const deployer = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const flipper = await deployFlipper(web3, deployer); @@ -51,4 +55,4 @@ describe('Scheduing EVM smart contracts', () => { expect(await flipper.methods.getValue().call()).to.be.equal(initialValue); } }); -}); \ No newline at end of file +}); diff --git a/tests/src/limits.test.ts b/tests/src/limits.test.ts index 5df99145db..ae1c83ada4 100644 --- a/tests/src/limits.test.ts +++ b/tests/src/limits.test.ts @@ -27,6 +27,8 @@ import { transferExpectSuccess, getFreeBalance, waitNewBlocks, burnItemExpectSuccess, + requirePallets, + Pallets } from './util/helpers'; import {expect} from 'chai'; @@ -67,7 +69,9 @@ describe('Number of tokens per address (NFT)', () => { describe('Number of tokens per address (ReFungible)', () => { let alice: IKeyringPair; - before(async () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async (api, privateKeyWrapper) => { alice = privateKeyWrapper('//Alice'); }); @@ -367,7 +371,9 @@ describe('Collection zero limits (ReFungible)', () => { let bob: IKeyringPair; let charlie: IKeyringPair; - before(async () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async (api, privateKeyWrapper) => { alice = privateKeyWrapper('//Alice'); bob = privateKeyWrapper('//Bob'); diff --git a/tests/src/nesting/nest.test.ts b/tests/src/nesting/nest.test.ts index 6db38e950c..b77bb09126 100644 --- a/tests/src/nesting/nest.test.ts +++ b/tests/src/nesting/nest.test.ts @@ -17,6 +17,8 @@ import { transferExpectSuccess, transferFromExpectSuccess, setCollectionLimitsExpectSuccess, + requirePallets, + Pallets } from '../util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; @@ -311,7 +313,9 @@ describe('Integration Test: Various token type nesting', async () => { // ---------- Re-Fungible ---------- - it('ReFungible: allows an Owner to nest/unnest their token', async () => { + it('ReFungible: allows an Owner to nest/unnest their token', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async api => { const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}}); @@ -333,7 +337,9 @@ describe('Integration Test: Various token type nesting', async () => { }); }); - it('ReFungible: allows an Owner to nest/unnest their token (Restricted nesting)', async () => { + it('ReFungible: allows an Owner to nest/unnest their token (Restricted nesting)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async api => { const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address}); @@ -715,7 +721,9 @@ describe('Negative Test: Nesting', async() => { // ---------- Re-Fungible ---------- - it('ReFungible: disallows to nest token if nesting is disabled', async () => { + it('ReFungible: disallows to nest token if nesting is disabled', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async api => { const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {}}); @@ -745,7 +753,9 @@ describe('Negative Test: Nesting', async() => { }); }); - it('ReFungible: disallows a non-Owner to nest someone else\'s token', async () => { + it('ReFungible: disallows a non-Owner to nest someone else\'s token', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async api => { const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}}); @@ -773,7 +783,9 @@ describe('Negative Test: Nesting', async() => { }); }); - it('ReFungible: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async () => { + it('ReFungible: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async api => { const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); await addToAllowListExpectSuccess(alice, collectionNFT, bob.address); @@ -800,7 +812,9 @@ describe('Negative Test: Nesting', async() => { }); }); - it('ReFungible: disallows to nest token to an unlisted collection', async () => { + it('ReFungible: disallows to nest token to an unlisted collection', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async api => { const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[]}}); diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index 4d9abd323c..84c91a60c6 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -8,6 +8,8 @@ import { createItemExpectSuccess, getCreateCollectionResult, transferExpectSuccess, + requirePallets, + Pallets } from '../util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; import {tokenIdToAddress} from '../eth/util/helpers'; @@ -64,7 +66,9 @@ describe('Composite Properties Test', () => { await testMakeSureSuppliesRequired({type: 'NFT'}); }); - it('Makes sure collectionById supplies required fields for ReFungible', async () => { + it('Makes sure collectionById supplies required fields for ReFungible', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testMakeSureSuppliesRequired({type: 'ReFungible'}); }); }); @@ -120,7 +124,9 @@ describe('Integration Test: Collection Properties', () => { it('Sets properties for a NFT collection', async () => { await testSetsPropertiesForCollection('NFT'); }); - it('Sets properties for a ReFungible collection', async () => { + it('Sets properties for a ReFungible collection', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testSetsPropertiesForCollection('ReFungible'); }); @@ -178,7 +184,9 @@ describe('Integration Test: Collection Properties', () => { it('Check valid names for NFT collection properties keys', async () => { await testCheckValidNames('NFT'); }); - it('Check valid names for ReFungible collection properties keys', async () => { + it('Check valid names for ReFungible collection properties keys', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testCheckValidNames('ReFungible'); }); @@ -209,7 +217,9 @@ describe('Integration Test: Collection Properties', () => { it('Changes properties of a NFT collection', async () => { await testChangesProperties({type: 'NFT'}); }); - it('Changes properties of a ReFungible collection', async () => { + it('Changes properties of a ReFungible collection', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testChangesProperties({type: 'ReFungible'}); }); @@ -238,7 +248,9 @@ describe('Integration Test: Collection Properties', () => { it('Deletes properties of a NFT collection', async () => { await testDeleteProperties({type: 'NFT'}); }); - it('Deletes properties of a ReFungible collection', async () => { + it('Deletes properties of a ReFungible collection', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testDeleteProperties({type: 'ReFungible'}); }); }); @@ -269,7 +281,9 @@ describe('Negative Integration Test: Collection Properties', () => { it('Fails to set properties in a NFT collection if not its onwer/administrator', async () => { await testFailsSetPropertiesIfNotOwnerOrAdmin({type: 'NFT'}); }); - it('Fails to set properties in a ReFungible collection if not its onwer/administrator', async () => { + it('Fails to set properties in a ReFungible collection if not its onwer/administrator', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testFailsSetPropertiesIfNotOwnerOrAdmin({type: 'ReFungible'}); }); @@ -307,7 +321,9 @@ describe('Negative Integration Test: Collection Properties', () => { it('Fails to set properties that exceed the limits (NFT)', async () => { await testFailsSetPropertiesThatExeedLimits({type: 'NFT'}); }); - it('Fails to set properties that exceed the limits (ReFungible)', async () => { + it('Fails to set properties that exceed the limits (ReFungible)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testFailsSetPropertiesThatExeedLimits({type: 'ReFungible'}); }); @@ -337,7 +353,9 @@ describe('Negative Integration Test: Collection Properties', () => { it('Fails to set more properties than it is allowed (NFT)', async () => { await testFailsSetMorePropertiesThanAllowed({type: 'NFT'}); }); - it('Fails to set more properties than it is allowed (ReFungible)', async () => { + it('Fails to set more properties than it is allowed (ReFungible)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testFailsSetMorePropertiesThanAllowed({type: 'ReFungible'}); }); @@ -392,7 +410,9 @@ describe('Negative Integration Test: Collection Properties', () => { it('Fails to set properties with invalid names (NFT)', async () => { await testFailsSetPropertiesWithInvalidNames({type: 'NFT'}); }); - it('Fails to set properties with invalid names (ReFungible)', async () => { + it('Fails to set properties with invalid names (ReFungible)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testFailsSetPropertiesWithInvalidNames({type: 'ReFungible'}); }); }); @@ -443,7 +463,9 @@ describe('Integration Test: Access Rights to Token Properties', () => { it('Sets access rights to properties of a collection (NFT)', async () => { await testSetsAccessRightsToProperties({type: 'NFT'}); }); - it('Sets access rights to properties of a collection (ReFungible)', async () => { + it('Sets access rights to properties of a collection (ReFungible)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testSetsAccessRightsToProperties({type: 'ReFungible'}); }); @@ -472,7 +494,9 @@ describe('Integration Test: Access Rights to Token Properties', () => { it('Changes access rights to properties of a NFT collection', async () => { await testChangesAccessRightsToProperty({type: 'NFT'}); }); - it('Changes access rights to properties of a ReFungible collection', async () => { + it('Changes access rights to properties of a ReFungible collection', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testChangesAccessRightsToProperty({type: 'ReFungible'}); }); }); @@ -502,7 +526,9 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { it('Prevents from setting access rights to properties of a NFT collection if not an onwer/admin', async () => { await testPreventsFromSettingAccessRightsNotAdminOrOwner({type: 'NFT'}); }); - it('Prevents from setting access rights to properties of a ReFungible collection if not an onwer/admin', async () => { + it('Prevents from setting access rights to properties of a ReFungible collection if not an onwer/admin', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testPreventsFromSettingAccessRightsNotAdminOrOwner({type: 'ReFungible'}); }); @@ -531,7 +557,9 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { it('Prevents from adding too many possible properties (NFT)', async () => { await testPreventFromAddingTooManyPossibleProperties({type: 'NFT'}); }); - it('Prevents from adding too many possible properties (ReFungible)', async () => { + it('Prevents from adding too many possible properties (ReFungible)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testPreventFromAddingTooManyPossibleProperties({type: 'ReFungible'}); }); @@ -560,7 +588,9 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { it('Prevents access rights to be modified if constant (NFT)', async () => { await testPreventAccessRightsModifiedIfConstant({type: 'NFT'}); }); - it('Prevents access rights to be modified if constant (ReFungible)', async () => { + it('Prevents access rights to be modified if constant (ReFungible)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testPreventAccessRightsModifiedIfConstant({type: 'ReFungible'}); }); @@ -608,7 +638,9 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { it('Prevents adding properties with invalid names (NFT)', async () => { await testPreventsAddingPropertiesWithInvalidNames({type: 'NFT'}); }); - it('Prevents adding properties with invalid names (ReFungible)', async () => { + it('Prevents adding properties with invalid names (ReFungible)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testPreventsAddingPropertiesWithInvalidNames({type: 'ReFungible'}); }); }); @@ -651,7 +683,9 @@ describe('Integration Test: Token Properties', () => { it('Reads yet empty properties of a token (NFT)', async () => { await testReadsYetEmptyProperties({type: 'NFT'}); }); - it('Reads yet empty properties of a token (ReFungible)', async () => { + it('Reads yet empty properties of a token (ReFungible)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testReadsYetEmptyProperties({type: 'ReFungible'}); }); @@ -696,7 +730,9 @@ describe('Integration Test: Token Properties', () => { it('Assigns properties to a token according to permissions (NFT)', async () => { await testAssignPropertiesAccordingToPermissions({type: 'NFT'}, 1); }); - it('Assigns properties to a token according to permissions (ReFungible)', async () => { + it('Assigns properties to a token according to permissions (ReFungible)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testAssignPropertiesAccordingToPermissions({type: 'ReFungible'}, 100); }); @@ -749,7 +785,9 @@ describe('Integration Test: Token Properties', () => { it('Changes properties of a token according to permissions (NFT)', async () => { await testChangesPropertiesAccordingPermission({type: 'NFT'}, 1); }); - it('Changes properties of a token according to permissions (ReFungible)', async () => { + it('Changes properties of a token according to permissions (ReFungible)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testChangesPropertiesAccordingPermission({type: 'ReFungible'}, 100); }); @@ -802,7 +840,9 @@ describe('Integration Test: Token Properties', () => { it('Deletes properties of a token according to permissions (NFT)', async () => { await testDeletePropertiesAccordingPermission({type: 'NFT'}, 1); }); - it('Deletes properties of a token according to permissions (ReFungible)', async () => { + it('Deletes properties of a token according to permissions (ReFungible)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testDeletePropertiesAccordingPermission({type: 'ReFungible'}, 100); }); @@ -1029,7 +1069,9 @@ describe('Negative Integration Test: Token Properties', () => { it('Forbids changing/deleting properties of a token if the user is outside of permissions (NFT)', async () => { await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions({type: 'NFT'}, 1); }); - it('Forbids changing/deleting properties of a token if the user is outside of permissions (ReFungible)', async () => { + it('Forbids changing/deleting properties of a token if the user is outside of permissions (ReFungible)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions({type: 'ReFungible'}, 100); }); @@ -1062,7 +1104,9 @@ describe('Negative Integration Test: Token Properties', () => { it('Forbids changing/deleting properties of a token if the property is permanent (immutable) (NFT)', async () => { await testForbidsChangingDeletingPropertiesIfPropertyImmutable({type: 'NFT'}, 1); }); - it('Forbids changing/deleting properties of a token if the property is permanent (immutable) (ReFungible)', async () => { + it('Forbids changing/deleting properties of a token if the property is permanent (immutable) (ReFungible)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testForbidsChangingDeletingPropertiesIfPropertyImmutable({type: 'ReFungible'}, 100); }); @@ -1096,7 +1140,9 @@ describe('Negative Integration Test: Token Properties', () => { it('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (NFT)', async () => { await testForbidsAddingPropertiesIfPropertyNotDeclared({type: 'NFT'}, 1); }); - it('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (ReFungible)', async () => { + it('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (ReFungible)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testForbidsAddingPropertiesIfPropertyNotDeclared({type: 'ReFungible'}, 100); }); @@ -1140,7 +1186,9 @@ describe('Negative Integration Test: Token Properties', () => { it('Forbids adding too many properties to a token (NFT)', async () => { await testForbidsAddingTooManyProperties({type: 'NFT'}, 1); }); - it('Forbids adding too many properties to a token (ReFungible)', async () => { + it('Forbids adding too many properties to a token (ReFungible)', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await testForbidsAddingTooManyProperties({type: 'ReFungible'}, 100); }); }); @@ -1149,7 +1197,9 @@ describe('ReFungible token properties permissions tests', () => { let collection: number; let token: number; - before(async () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async (api, privateKeyWrapper) => { alice = privateKeyWrapper('//Alice'); bob = privateKeyWrapper('//Bob'); diff --git a/tests/src/nesting/rules-smoke.test.ts b/tests/src/nesting/rules-smoke.test.ts index 2ca6d7af09..1b58a78f80 100644 --- a/tests/src/nesting/rules-smoke.test.ts +++ b/tests/src/nesting/rules-smoke.test.ts @@ -1,7 +1,7 @@ import {expect} from 'chai'; import {tokenIdToAddress} from '../eth/util/helpers'; import usingApi, {executeTransaction} from '../substrate/substrate-api'; -import {createCollectionExpectSuccess, createFungibleItemExpectSuccess, createItemExpectSuccess, CrossAccountId, getCreateCollectionResult} from '../util/helpers'; +import {createCollectionExpectSuccess, createFungibleItemExpectSuccess, createItemExpectSuccess, CrossAccountId, getCreateCollectionResult, requirePallets, Pallets} from '../util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; describe('nesting check', () => { @@ -47,7 +47,9 @@ describe('nesting check', () => { }); }); - it('called for refungible', async () => { + it('called for refungible', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async api => { const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {ReFungible: {}}))) diff --git a/tests/src/nesting/unnest.test.ts b/tests/src/nesting/unnest.test.ts index 419b1bd5dd..623da8972f 100644 --- a/tests/src/nesting/unnest.test.ts +++ b/tests/src/nesting/unnest.test.ts @@ -10,6 +10,8 @@ import { setCollectionPermissionsExpectSuccess, transferExpectSuccess, transferFromExpectSuccess, + requirePallets, + Pallets } from '../util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; @@ -80,7 +82,9 @@ describe('Integration Test: Unnesting', () => { }); }); - it('ReFungible: allows the owner to successfully unnest a token', async () => { + it('ReFungible: allows the owner to successfully unnest a token', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async api => { const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); diff --git a/tests/src/nextSponsoring.test.ts b/tests/src/nextSponsoring.test.ts index 7d66901e7f..8f8007466b 100644 --- a/tests/src/nextSponsoring.test.ts +++ b/tests/src/nextSponsoring.test.ts @@ -27,6 +27,8 @@ import { transferExpectSuccess, normalizeAccountId, getNextSponsored, + requirePallets, + Pallets } from './util/helpers'; chai.use(chaiAsPromised); @@ -89,7 +91,9 @@ describe('Integration Test getNextSponsored(collection_id, owner, item_id):', () }); }); - it('ReFungible', async () => { + it('ReFungible', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async (api: ApiPromise) => { const createMode = 'ReFungible'; diff --git a/tests/src/pallet-presence.test.ts b/tests/src/pallet-presence.test.ts index 1b43421d55..96dcd65c64 100644 --- a/tests/src/pallet-presence.test.ts +++ b/tests/src/pallet-presence.test.ts @@ -49,8 +49,6 @@ const requiredPallets = [ 'inflation', 'unique', 'nonfungible', - 'refungible', - 'scheduler', 'charging', ]; @@ -66,8 +64,16 @@ describe('Pallet presence', () => { await usingApi(async api => { const chain = await api.rpc.system.chain(); - if (!chain.eq('UNIQUE')) { - requiredPallets.push(...['rmrkcore', 'rmrkequip']); + const refungible = 'refungible'; + const scheduler = 'scheduler'; + const rmrkPallets = ['rmrkcore', 'rmrkequip']; + + if (chain.eq('OPAL by UNIQUE')) { + requiredPallets.push(refungible, scheduler, ...rmrkPallets); + } else if (chain.eq('QUARTZ by UNIQUE')) { + // Insert Quartz additional pallets here + } else if (chain.eq('UNIQUE')) { + // Insert Unique additional pallets here } }); }); diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index bdf79a3a4a..b1a27607f8 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -38,6 +38,7 @@ import { getDestroyItemsResult, getModuleNames, Pallets, + requirePallets } from './util/helpers'; import chai from 'chai'; @@ -52,6 +53,8 @@ let bob: IKeyringPair; describe('integration test: Refungible functionality:', async () => { before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async (api, privateKeyWrapper) => { alice = privateKeyWrapper('//Alice'); bob = privateKeyWrapper('//Bob'); diff --git a/tests/src/rmrk/acceptNft.test.ts b/tests/src/rmrk/acceptNft.test.ts index 1f4accbde6..f0a8164d3d 100644 --- a/tests/src/rmrk/acceptNft.test.ts +++ b/tests/src/rmrk/acceptNft.test.ts @@ -14,7 +14,7 @@ describe('integration test: accept NFT', () => { let api: any; before(async function() { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); diff --git a/tests/src/rmrk/addResource.test.ts b/tests/src/rmrk/addResource.test.ts index c07286a149..8d9e42306b 100644 --- a/tests/src/rmrk/addResource.test.ts +++ b/tests/src/rmrk/addResource.test.ts @@ -27,7 +27,7 @@ describe('integration test: add NFT resource', () => { let api: any; before(async function() { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); it('add resource', async () => { diff --git a/tests/src/rmrk/addTheme.test.ts b/tests/src/rmrk/addTheme.test.ts index 1c8f40bae9..399af4b16e 100644 --- a/tests/src/rmrk/addTheme.test.ts +++ b/tests/src/rmrk/addTheme.test.ts @@ -9,7 +9,7 @@ describe('integration test: add Theme to Base', () => { let api: any; before(async function() { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkEquip]); + await requirePallets(this, [Pallets.RmrkEquip]); }); const alice = '//Alice'; diff --git a/tests/src/rmrk/burnNft.test.ts b/tests/src/rmrk/burnNft.test.ts index 72ede614db..b996b42610 100644 --- a/tests/src/rmrk/burnNft.test.ts +++ b/tests/src/rmrk/burnNft.test.ts @@ -17,7 +17,7 @@ describe('integration test: burn nft', () => { let api: any; before(async function() { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); diff --git a/tests/src/rmrk/changeCollectionIssuer.test.ts b/tests/src/rmrk/changeCollectionIssuer.test.ts index d2abcb8e08..5cca12e1b7 100644 --- a/tests/src/rmrk/changeCollectionIssuer.test.ts +++ b/tests/src/rmrk/changeCollectionIssuer.test.ts @@ -13,7 +13,7 @@ describe('integration test: collection issuer', () => { let api: any; before(async function() { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); diff --git a/tests/src/rmrk/createBase.test.ts b/tests/src/rmrk/createBase.test.ts index bc9126336d..eb52dc1dfc 100644 --- a/tests/src/rmrk/createBase.test.ts +++ b/tests/src/rmrk/createBase.test.ts @@ -6,7 +6,7 @@ describe('integration test: create new Base', () => { let api: any; before(async function() { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore, Pallets.RmrkEquip]); + await requirePallets(this, [Pallets.RmrkCore, Pallets.RmrkEquip]); }); const alice = '//Alice'; diff --git a/tests/src/rmrk/createCollection.test.ts b/tests/src/rmrk/createCollection.test.ts index f8ee29492b..da8f557459 100644 --- a/tests/src/rmrk/createCollection.test.ts +++ b/tests/src/rmrk/createCollection.test.ts @@ -6,7 +6,7 @@ describe('Integration test: create new collection', () => { let api: any; before(async function () { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); diff --git a/tests/src/rmrk/deleteCollection.test.ts b/tests/src/rmrk/deleteCollection.test.ts index 8c8d7bbf44..81bb990b40 100644 --- a/tests/src/rmrk/deleteCollection.test.ts +++ b/tests/src/rmrk/deleteCollection.test.ts @@ -7,7 +7,7 @@ describe('integration test: delete collection', () => { let api: any; before(async function () { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); const Alice = '//Alice'; diff --git a/tests/src/rmrk/equipNft.test.ts b/tests/src/rmrk/equipNft.test.ts index 0134bec58d..892856e8cb 100644 --- a/tests/src/rmrk/equipNft.test.ts +++ b/tests/src/rmrk/equipNft.test.ts @@ -126,7 +126,7 @@ describe.skip('integration test: Equip NFT', () => { before(async function () { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore, Pallets.RmrkEquip]); + await requirePallets(this, [Pallets.RmrkCore, Pallets.RmrkEquip]); }); it('equip nft', async () => { diff --git a/tests/src/rmrk/getOwnedNfts.test.ts b/tests/src/rmrk/getOwnedNfts.test.ts index d352ddb3c0..961ed6b910 100644 --- a/tests/src/rmrk/getOwnedNfts.test.ts +++ b/tests/src/rmrk/getOwnedNfts.test.ts @@ -9,7 +9,7 @@ describe('integration test: get owned NFTs', () => { before(async function () { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); diff --git a/tests/src/rmrk/lockCollection.test.ts b/tests/src/rmrk/lockCollection.test.ts index a24745a31d..1b824db45f 100644 --- a/tests/src/rmrk/lockCollection.test.ts +++ b/tests/src/rmrk/lockCollection.test.ts @@ -11,7 +11,7 @@ describe('integration test: lock collection', () => { let api: any; before(async function () { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); it('lock collection', async () => { diff --git a/tests/src/rmrk/mintNft.test.ts b/tests/src/rmrk/mintNft.test.ts index 2c900b31a7..a1ea008962 100644 --- a/tests/src/rmrk/mintNft.test.ts +++ b/tests/src/rmrk/mintNft.test.ts @@ -10,7 +10,7 @@ describe('integration test: mint new NFT', () => { before(async function () { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); diff --git a/tests/src/rmrk/rejectNft.test.ts b/tests/src/rmrk/rejectNft.test.ts index 34c61d1154..9df00d52d2 100644 --- a/tests/src/rmrk/rejectNft.test.ts +++ b/tests/src/rmrk/rejectNft.test.ts @@ -14,7 +14,7 @@ describe('integration test: reject NFT', () => { let api: any; before(async function () { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); diff --git a/tests/src/rmrk/removeResource.test.ts b/tests/src/rmrk/removeResource.test.ts index d0e4617b06..42ed3e0a0a 100644 --- a/tests/src/rmrk/removeResource.test.ts +++ b/tests/src/rmrk/removeResource.test.ts @@ -20,7 +20,7 @@ describe('Integration test: remove nft resource', () => { before(async function() { api = await getApiConnection(); ss58Format = api.registry.getChainProperties()!.toJSON().ss58Format; - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); const Alice = '//Alice'; diff --git a/tests/src/rmrk/rmrkIsolation.test.ts b/tests/src/rmrk/rmrkIsolation.test.ts index c22838734c..cb62607d94 100644 --- a/tests/src/rmrk/rmrkIsolation.test.ts +++ b/tests/src/rmrk/rmrkIsolation.test.ts @@ -64,7 +64,7 @@ describe('RMRK External Integration Test', async () => { before(async function() { await usingApi(async (api, privateKeyWrapper) => { alice = privateKeyWrapper('//Alice'); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); }); diff --git a/tests/src/rmrk/sendNft.test.ts b/tests/src/rmrk/sendNft.test.ts index cc0b48633f..3a1f6f49b4 100644 --- a/tests/src/rmrk/sendNft.test.ts +++ b/tests/src/rmrk/sendNft.test.ts @@ -9,7 +9,7 @@ describe('integration test: send NFT', () => { let api: any; before(async function () { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); const maxNftId = 0xFFFFFFFF; diff --git a/tests/src/rmrk/setCollectionProperty.test.ts b/tests/src/rmrk/setCollectionProperty.test.ts index 80969105a2..a076fc64d3 100644 --- a/tests/src/rmrk/setCollectionProperty.test.ts +++ b/tests/src/rmrk/setCollectionProperty.test.ts @@ -10,7 +10,7 @@ describe('integration test: set collection property', () => { let api: any; before(async function () { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); it('set collection property', async () => { diff --git a/tests/src/rmrk/setEquippableList.test.ts b/tests/src/rmrk/setEquippableList.test.ts index 1c8ac045f0..2f20edb2dd 100644 --- a/tests/src/rmrk/setEquippableList.test.ts +++ b/tests/src/rmrk/setEquippableList.test.ts @@ -7,7 +7,7 @@ describe("integration test: set slot's Equippable List", () => { let api: any; before(async function () { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); const alice = '//Alice'; diff --git a/tests/src/rmrk/setNftProperty.test.ts b/tests/src/rmrk/setNftProperty.test.ts index cd1f28a1e8..704fb9885b 100644 --- a/tests/src/rmrk/setNftProperty.test.ts +++ b/tests/src/rmrk/setNftProperty.test.ts @@ -8,7 +8,7 @@ describe('integration test: set NFT property', () => { let api: any; before(async function () { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); const alice = '//Alice'; diff --git a/tests/src/rmrk/setResourcePriorities.test.ts b/tests/src/rmrk/setResourcePriorities.test.ts index 3809a7b893..e656569d8a 100644 --- a/tests/src/rmrk/setResourcePriorities.test.ts +++ b/tests/src/rmrk/setResourcePriorities.test.ts @@ -7,7 +7,7 @@ describe('integration test: set NFT resource priorities', () => { let api: any; before(async function () { api = await getApiConnection(); - requirePallets(this, api, [Pallets.RmrkCore]); + await requirePallets(this, [Pallets.RmrkCore]); }); const alice = '//Alice'; diff --git a/tests/src/setCollectionSponsor.test.ts b/tests/src/setCollectionSponsor.test.ts index 5606c91977..1c3a4551f0 100644 --- a/tests/src/setCollectionSponsor.test.ts +++ b/tests/src/setCollectionSponsor.test.ts @@ -23,6 +23,8 @@ import {createCollectionExpectSuccess, setCollectionSponsorExpectFailure, addCollectionAdminExpectSuccess, getCreatedCollectionCount, + requirePallets, + Pallets } from './util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; @@ -50,7 +52,9 @@ describe('integration test: ext. setCollectionSponsor():', () => { const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); await setCollectionSponsorExpectSuccess(collectionId, bob.address); }); - it('Set ReFungible collection sponsor', async () => { + it('Set ReFungible collection sponsor', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); await setCollectionSponsorExpectSuccess(collectionId, bob.address); }); diff --git a/tests/src/transfer.test.ts b/tests/src/transfer.test.ts index 2011e5c445..991420e668 100644 --- a/tests/src/transfer.test.ts +++ b/tests/src/transfer.test.ts @@ -35,11 +35,14 @@ import { getBalance as getTokenBalance, transferFromExpectSuccess, transferFromExpectFail, + requirePallets, + Pallets, } from './util/helpers'; import { subToEth, itWeb3, } from './eth/util/helpers'; +import { request } from 'https'; let alice: IKeyringPair; let bob: IKeyringPair; @@ -89,56 +92,61 @@ describe('Integration Test Transfer(recipient, collection_id, item_id, value)', }); }); - it('User can transfer owned token', async () => { - await usingApi(async (api, privateKeyWrapper) => { - // nft - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - await transferExpectSuccess(nftCollectionId, newNftTokenId, alice, bob, 1, 'NFT'); - // fungible - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await transferExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob, 1, 'Fungible'); - // reFungible - const reFungibleCollectionId = await - createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await transferExpectSuccess( - reFungibleCollectionId, - newReFungibleTokenId, - alice, - bob, - 100, - 'ReFungible', - ); - }); + it('[nft] User can transfer owned token', async () => { + const nftCollectionId = await createCollectionExpectSuccess(); + const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); + await transferExpectSuccess(nftCollectionId, newNftTokenId, alice, bob, 1, 'NFT'); }); - it('Collection admin can transfer owned token', async () => { - await usingApi(async (api, privateKeyWrapper) => { - // nft - const nftCollectionId = await createCollectionExpectSuccess(); - await addCollectionAdminExpectSuccess(alice, nftCollectionId, bob.address); - const newNftTokenId = await createItemExpectSuccess(bob, nftCollectionId, 'NFT', bob.address); - await transferExpectSuccess(nftCollectionId, newNftTokenId, bob, alice, 1, 'NFT'); - // fungible - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - await addCollectionAdminExpectSuccess(alice, fungibleCollectionId, bob.address); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible', bob.address); - await transferExpectSuccess(fungibleCollectionId, newFungibleTokenId, bob, alice, 1, 'Fungible'); - // reFungible - const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await addCollectionAdminExpectSuccess(alice, reFungibleCollectionId, bob.address); - const newReFungibleTokenId = await createItemExpectSuccess(bob, reFungibleCollectionId, 'ReFungible', bob.address); - await transferExpectSuccess( - reFungibleCollectionId, - newReFungibleTokenId, - bob, - alice, - 100, - 'ReFungible', - ); - }); + it('[fungible] User can transfer owned token', async () => { + const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); + const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); + await transferExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob, 1, 'Fungible'); + }); + + it('[refungible] User can transfer owned token', async function() { + await requirePallets(this, [Pallets.ReFungible]); + + const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); + const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); + await transferExpectSuccess( + reFungibleCollectionId, + newReFungibleTokenId, + alice, + bob, + 100, + 'ReFungible', + ); + }); + + it('[nft] Collection admin can transfer owned token', async () => { + const nftCollectionId = await createCollectionExpectSuccess(); + await addCollectionAdminExpectSuccess(alice, nftCollectionId, bob.address); + const newNftTokenId = await createItemExpectSuccess(bob, nftCollectionId, 'NFT', bob.address); + await transferExpectSuccess(nftCollectionId, newNftTokenId, bob, alice, 1, 'NFT'); + }); + + it('[fungible] Collection admin can transfer owned token', async () => { + const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); + await addCollectionAdminExpectSuccess(alice, fungibleCollectionId, bob.address); + const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible', bob.address); + await transferExpectSuccess(fungibleCollectionId, newFungibleTokenId, bob, alice, 1, 'Fungible'); + }); + + it('[refungible] Collection admin can transfer owned token', async function() { + await requirePallets(this, [Pallets.ReFungible]); + + const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); + await addCollectionAdminExpectSuccess(alice, reFungibleCollectionId, bob.address); + const newReFungibleTokenId = await createItemExpectSuccess(bob, reFungibleCollectionId, 'ReFungible', bob.address); + await transferExpectSuccess( + reFungibleCollectionId, + newReFungibleTokenId, + bob, + alice, + 100, + 'ReFungible', + ); }); }); @@ -150,33 +158,49 @@ describe('Negative Integration Test Transfer(recipient, collection_id, item_id, charlie = privateKeyWrapper('//Charlie'); }); }); - it('Transfer with not existed collection_id', async () => { + + it('[nft] Transfer with not existed collection_id', async () => { await usingApi(async (api) => { - // nft const nftCollectionCount = await getCreatedCollectionCount(api); await transferExpectFailure(nftCollectionCount + 1, 1, alice, bob, 1); - // fungible + }); + }); + + it('[fungible] Transfer with not existed collection_id', async () => { + await usingApi(async (api) => { const fungibleCollectionCount = await getCreatedCollectionCount(api); await transferExpectFailure(fungibleCollectionCount + 1, 0, alice, bob, 1); - // reFungible + }); + }); + + it('[refungible] Transfer with not existed collection_id', async function() { + await requirePallets(this, [Pallets.ReFungible]); + + await usingApi(async (api) => { const reFungibleCollectionCount = await getCreatedCollectionCount(api); await transferExpectFailure(reFungibleCollectionCount + 1, 1, alice, bob, 1); }); }); - it('Transfer with deleted collection_id', async () => { - // nft + + it('[nft] Transfer with deleted collection_id', async () => { const nftCollectionId = await createCollectionExpectSuccess(); const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); await burnItemExpectSuccess(alice, nftCollectionId, newNftTokenId); await destroyCollectionExpectSuccess(nftCollectionId); await transferExpectFailure(nftCollectionId, newNftTokenId, alice, bob, 1); - // fungible + }); + + it('[fungible] Transfer with deleted collection_id', async () => { const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); await burnItemExpectSuccess(alice, fungibleCollectionId, newFungibleTokenId, 10); await destroyCollectionExpectSuccess(fungibleCollectionId); await transferExpectFailure(fungibleCollectionId, newFungibleTokenId, alice, bob, 1); - // reFungible + }); + + it('[refungible] Transfer with deleted collection_id', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); @@ -190,16 +214,21 @@ describe('Negative Integration Test Transfer(recipient, collection_id, item_id, 1, ); }); - it('Transfer with not existed item_id', async () => { - // nft + + it('[nft] Transfer with not existed item_id', async () => { const nftCollectionId = await createCollectionExpectSuccess(); await transferExpectFailure(nftCollectionId, 2, alice, bob, 1); - // fungible + }); + + it('[fungible] Transfer with not existed item_id', async () => { const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); await transferExpectFailure(fungibleCollectionId, 2, alice, bob, 1); - // reFungible - const reFungibleCollectionId = await - createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); + }); + + it('[refungible] Transfer with not existed item_id', async function() { + await requirePallets(this, [Pallets.ReFungible]); + + const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); await transferExpectFailure( reFungibleCollectionId, 2, @@ -208,18 +237,24 @@ describe('Negative Integration Test Transfer(recipient, collection_id, item_id, 1, ); }); - it('Transfer with deleted item_id', async () => { - // nft + + it('[nft] Transfer with deleted item_id', async () => { const nftCollectionId = await createCollectionExpectSuccess(); const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); await burnItemExpectSuccess(alice, nftCollectionId, newNftTokenId, 1); await transferExpectFailure(nftCollectionId, newNftTokenId, alice, bob, 1); - // fungible + }); + + it('[fungible] Transfer with deleted item_id', async () => { const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); await burnItemExpectSuccess(alice, fungibleCollectionId, newFungibleTokenId, 10); await transferExpectFailure(fungibleCollectionId, newFungibleTokenId, alice, bob, 1); - // reFungible + }); + + it('[refungible] Transfer with deleted item_id', async function() { + await requirePallets(this, [Pallets.ReFungible]); + const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); @@ -232,18 +267,23 @@ describe('Negative Integration Test Transfer(recipient, collection_id, item_id, 1, ); }); - it('Transfer with recipient that is not owner', async () => { - // nft + + it('[nft] Transfer with recipient that is not owner', async () => { const nftCollectionId = await createCollectionExpectSuccess(); const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); await transferExpectFailure(nftCollectionId, newNftTokenId, charlie, bob, 1); - // fungible + }); + + it('[fungible] Transfer with recipient that is not owner', async () => { const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); await transferExpectFailure(fungibleCollectionId, newFungibleTokenId, charlie, bob, 1); - // reFungible - const reFungibleCollectionId = await - createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); + }); + + it('[refungible] Transfer with recipient that is not owner', async function() { + await requirePallets(this, [Pallets.ReFungible]); + + const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); await transferExpectFailure( reFungibleCollectionId, @@ -276,7 +316,9 @@ describe('Zero value transfer(From)', () => { }); }); - it('RFT', async () => { + it('RFT', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async (api: ApiPromise) => { const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); diff --git a/tests/src/transferFrom.test.ts b/tests/src/transferFrom.test.ts index 3c2dfbba22..872d3f39e0 100644 --- a/tests/src/transferFrom.test.ts +++ b/tests/src/transferFrom.test.ts @@ -31,6 +31,8 @@ import { burnItemExpectSuccess, setCollectionLimitsExpectSuccess, getCreatedCollectionCount, + requirePallets, + Pallets } from './util/helpers'; chai.use(chaiAsPromised); @@ -49,36 +51,36 @@ describe('Integration Test transferFrom(from, recipient, collection_id, item_id, }); }); - it('Execute the extrinsic and check nftItemList - owner of token', async () => { - await usingApi(async () => { - // nft - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address); + it('[nft] Execute the extrinsic and check nftItemList - owner of token', async () => { + const nftCollectionId = await createCollectionExpectSuccess(); + const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); + await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address); - await transferFromExpectSuccess(nftCollectionId, newNftTokenId, bob, alice, charlie, 1, 'NFT'); + await transferFromExpectSuccess(nftCollectionId, newNftTokenId, bob, alice, charlie, 1, 'NFT'); + }); - // fungible - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address); - await transferFromExpectSuccess(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 1, 'Fungible'); + it('[fungible] Execute the extrinsic and check nftItemList - owner of token', async () => { + const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); + const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); + await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address); + await transferFromExpectSuccess(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 1, 'Fungible'); + }); - // reFungible - const reFungibleCollectionId = await - createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 100); - await transferFromExpectSuccess( - reFungibleCollectionId, - newReFungibleTokenId, - bob, - alice, - charlie, - 100, - 'ReFungible', - ); - }); + it('[refungible] Execute the extrinsic and check nftItemList - owner of token', async function() { + await requirePallets(this, [Pallets.ReFungible]); + + const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); + const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); + await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 100); + await transferFromExpectSuccess( + reFungibleCollectionId, + newReFungibleTokenId, + bob, + alice, + charlie, + 100, + 'ReFungible', + ); }); it('Should reduce allowance if value is big', async () => { @@ -119,20 +121,28 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, }); }); - it('transferFrom for a collection that does not exist', async () => { + it('[nft] transferFrom for a collection that does not exist', async () => { await usingApi(async (api: ApiPromise) => { - // nft const nftCollectionCount = await getCreatedCollectionCount(api); await approveExpectFail(nftCollectionCount + 1, 1, alice, bob); await transferFromExpectFail(nftCollectionCount + 1, 1, bob, alice, charlie, 1); + }); + }); - // fungible + it('[fungible] transferFrom for a collection that does not exist', async () => { + await usingApi(async (api: ApiPromise) => { const fungibleCollectionCount = await getCreatedCollectionCount(api); await approveExpectFail(fungibleCollectionCount + 1, 0, alice, bob); await transferFromExpectFail(fungibleCollectionCount + 1, 0, bob, alice, charlie, 1); - // reFungible + }); + }); + + it('[refungible] transferFrom for a collection that does not exist', async function() { + await requirePallets(this, [Pallets.ReFungible]); + + await usingApi(async (api: ApiPromise) => { const reFungibleCollectionCount = await getCreatedCollectionCount(api); await approveExpectFail(reFungibleCollectionCount + 1, 1, alice, bob); @@ -158,67 +168,70 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, }); }); */ - it('transferFrom for not approved address', async () => { - await usingApi(async () => { - // nft - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); + it('[nft] transferFrom for not approved address', async () => { + const nftCollectionId = await createCollectionExpectSuccess(); + const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - await transferFromExpectFail(nftCollectionId, newNftTokenId, bob, alice, charlie, 1); + await transferFromExpectFail(nftCollectionId, newNftTokenId, bob, alice, charlie, 1); + }); - // fungible - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 1); - // reFungible - const reFungibleCollectionId = await - createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await transferFromExpectFail( - reFungibleCollectionId, - newReFungibleTokenId, - bob, - alice, - charlie, - 1, - ); - }); + it('[fungible] transferFrom for not approved address', async () => { + const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); + const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); + await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 1); }); - it('transferFrom incorrect token count', async () => { - await usingApi(async () => { - // nft - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address); + it('[refungible] transferFrom for not approved address', async function() { + await requirePallets(this, [Pallets.ReFungible]); + + const reFungibleCollectionId = await + createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); + const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); + await transferFromExpectFail( + reFungibleCollectionId, + newReFungibleTokenId, + bob, + alice, + charlie, + 1, + ); + }); - await transferFromExpectFail(nftCollectionId, newNftTokenId, bob, alice, charlie, 2); + it('[nft] transferFrom incorrect token count', async () => { + const nftCollectionId = await createCollectionExpectSuccess(); + const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); + await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address); - // fungible - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address); - await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 2); - // reFungible - const reFungibleCollectionId = await - createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address); - await transferFromExpectFail( - reFungibleCollectionId, - newReFungibleTokenId, - bob, - alice, - charlie, - 2, - ); - }); + await transferFromExpectFail(nftCollectionId, newNftTokenId, bob, alice, charlie, 2); + }); + + it('[fungible] transferFrom incorrect token count', async () => { + const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); + const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); + await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address); + await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 2); + }); + + it('[refungible] transferFrom incorrect token count', async function() { + await requirePallets(this, [Pallets.ReFungible]); + + const reFungibleCollectionId = await + createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); + const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); + await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address); + await transferFromExpectFail( + reFungibleCollectionId, + newReFungibleTokenId, + bob, + alice, + charlie, + 2, + ); }); - it('execute transferFrom from account that is not owner of collection', async () => { + it('[nft] execute transferFrom from account that is not owner of collection', async () => { await usingApi(async (api, privateKeyWrapper) => { const dave = privateKeyWrapper('//Dave'); - // nft const nftCollectionId = await createCollectionExpectSuccess(); const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); try { @@ -230,8 +243,13 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, } // await transferFromExpectFail(nftCollectionId, newNftTokenId, Dave, Alice, Charlie, 1); + }); + }); + + it('[fungible] execute transferFrom from account that is not owner of collection', async () => { + await usingApi(async (api, privateKeyWrapper) => { + const dave = privateKeyWrapper('//Dave'); - // fungible const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); try { @@ -241,7 +259,14 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, // tslint:disable-next-line:no-unused-expression expect(e).to.be.exist; } - // reFungible + }); + }); + + it('[refungible] execute transferFrom from account that is not owner of collection', async function() { + await requirePallets(this, [Pallets.ReFungible]); + + await usingApi(async (api, privateKeyWrapper) => { + const dave = privateKeyWrapper('//Dave'); const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); @@ -276,7 +301,9 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, }); }); - it('transferFrom burnt token before approve ReFungible', async () => { + it('transferFrom burnt token before approve ReFungible', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async () => { const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); await setCollectionLimitsExpectSuccess(alice, reFungibleCollectionId, {ownerCanTransfer: true}); @@ -308,7 +335,9 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, }); }); - it('transferFrom burnt token after approve ReFungible', async () => { + it('transferFrom burnt token after approve ReFungible', async function() { + await requirePallets(this, [Pallets.ReFungible]); + await usingApi(async () => { const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); From b1da5059f1c6799438ae6eff76c035c50b6b2fac Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 9 Aug 2022 16:46:03 +0000 Subject: [PATCH 0287/1274] fix: warn about skipped tests --- tests/src/util/helpers.ts | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index 335e626d80..27d1fc4203 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -47,6 +47,7 @@ export enum Pallets { ReFungible = 'refungible', Fungible = 'fungible', NFT = 'nonfungible', + Scheduler = 'scheduler', } export async function isUnique(): Promise { @@ -72,12 +73,28 @@ export function getModuleNames(api: ApiPromise): string[] { return modulesNames; } -export function requirePallets(mocha: Context, api: ApiPromise, requiredPallets: string[]) { - const pallets = getModuleNames(api); +export async function missingRequiredPallets(requiredPallets: string[]): Promise { + return await usingApi(async api => { + const pallets = getModuleNames(api); - const isAllPalletsPresent = requiredPallets.every(p => pallets.includes(p)); + return requiredPallets.filter(p => !pallets.includes(p)); + }); +} + +export async function checkPalletsPresence(requiredPallets: string[]): Promise { + return (await missingRequiredPallets(requiredPallets)).length == 0; +} + +export async function requirePallets(mocha: Context, requiredPallets: string[]) { + const missingPallets = await missingRequiredPallets(requiredPallets); + + if (missingPallets.length > 0) { + const skippingTestMsg = `\tSkipping test "${mocha.test?.title}".`; + const missingPalletsMsg = `\tThe following pallets are missing:\n\t- ${missingPallets.join('\n\t- ')}`; + const skipMsg = `${skippingTestMsg}\n${missingPalletsMsg}`; + + console.log('\x1b[38:5:208m%s\x1b[0m', skipMsg); - if (!isAllPalletsPresent) { mocha.skip(); } } From 12727caaca7d4b428201acf7aabb839f207441ff Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 10 Aug 2022 10:36:41 +0000 Subject: [PATCH 0288/1274] fix: remove .only from createMultipleItemsEx.test --- tests/src/createMultipleItemsEx.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/createMultipleItemsEx.test.ts b/tests/src/createMultipleItemsEx.test.ts index ac5e10efa8..b1c8aea045 100644 --- a/tests/src/createMultipleItemsEx.test.ts +++ b/tests/src/createMultipleItemsEx.test.ts @@ -18,7 +18,7 @@ import {expect} from 'chai'; import usingApi, {executeTransaction} from './substrate/substrate-api'; import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, createCollectionWithPropsExpectSuccess, getBalance, getLastTokenId, getTokenProperties, requirePallets, Pallets} from './util/helpers'; -describe.only('Integration Test: createMultipleItemsEx', () => { +describe('Integration Test: createMultipleItemsEx', () => { it('can initialize multiple NFT with different owners', async () => { const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); await usingApi(async (api, privateKeyWrapper) => { From 18d8c65aec34f1356598046f14037b8f86040f00 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 10 Aug 2022 10:37:18 +0000 Subject: [PATCH 0289/1274] cargo fmt --- runtime/common/dispatch.rs | 2 +- runtime/common/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/common/dispatch.rs b/runtime/common/dispatch.rs index f752505fac..24e4c484be 100644 --- a/runtime/common/dispatch.rs +++ b/runtime/common/dispatch.rs @@ -72,7 +72,7 @@ where CollectionMode::ReFungible => >::init_collection(sender, data)?, #[cfg(not(feature = "refungible"))] - CollectionMode::ReFungible => return unsupported!(T) + CollectionMode::ReFungible => return unsupported!(T), }; Ok(id) } diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index 63f137c2fc..af5a8c93f5 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -47,7 +47,7 @@ use common_types::{AccountId, BlockNumber}; macro_rules! unsupported { () => { pallet_common::unsupported!($crate::Runtime) - } + }; } /// The address format for describing accounts. From d02d6e85f5fa189832215aa9e839398e91fa2bb7 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 10 Aug 2022 11:11:09 +0000 Subject: [PATCH 0290/1274] fix: unit tests --- runtime/tests/Cargo.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index bf70d7d4d3..53b9c7298e 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -3,6 +3,11 @@ name = "tests" version = "0.1.0" edition = "2021" +[features] +default = ['refungible'] + +refungible = [] + [dependencies] up-data-structs = { default-features = false, path = '../../primitives/data-structs' } From f16741ce847b54bb5b74bb26df15bad6460e180b Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 10 Aug 2022 11:15:15 +0000 Subject: [PATCH 0291/1274] fix: eslint --- tests/src/approve.test.ts | 2 +- tests/src/burnItem.test.ts | 2 +- tests/src/confirmSponsorship.test.ts | 2 +- tests/src/createItem.test.ts | 2 +- tests/src/createMultipleItems.test.ts | 4 ++-- tests/src/destroyCollection.test.ts | 2 +- tests/src/limits.test.ts | 2 +- tests/src/nesting/nest.test.ts | 2 +- tests/src/nesting/properties.test.ts | 2 +- tests/src/nesting/unnest.test.ts | 2 +- tests/src/nextSponsoring.test.ts | 2 +- tests/src/refungible.test.ts | 2 +- tests/src/rmrk/acceptNft.test.ts | 2 +- tests/src/rmrk/addResource.test.ts | 2 +- tests/src/rmrk/addTheme.test.ts | 2 +- tests/src/rmrk/burnNft.test.ts | 2 +- tests/src/rmrk/changeCollectionIssuer.test.ts | 2 +- tests/src/rmrk/createBase.test.ts | 2 +- tests/src/rmrk/deleteCollection.test.ts | 2 +- tests/src/rmrk/getOwnedNfts.test.ts | 2 +- tests/src/rmrk/lockCollection.test.ts | 2 +- tests/src/rmrk/mintNft.test.ts | 2 +- tests/src/rmrk/rejectNft.test.ts | 2 +- tests/src/rmrk/removeResource.test.ts | 2 +- tests/src/rmrk/sendNft.test.ts | 2 +- tests/src/rmrk/setCollectionProperty.test.ts | 2 +- tests/src/rmrk/setEquippableList.test.ts | 2 +- tests/src/rmrk/setNftProperty.test.ts | 2 +- tests/src/rmrk/setResourcePriorities.test.ts | 2 +- tests/src/setCollectionSponsor.test.ts | 2 +- tests/src/transfer.test.ts | 2 +- tests/src/transferFrom.test.ts | 2 +- tests/src/util/helpers.ts | 2 +- 33 files changed, 34 insertions(+), 34 deletions(-) diff --git a/tests/src/approve.test.ts b/tests/src/approve.test.ts index 47921b657f..12af29d023 100644 --- a/tests/src/approve.test.ts +++ b/tests/src/approve.test.ts @@ -33,7 +33,7 @@ import { transferFromExpectSuccess, transferFromExpectFail, requirePallets, - Pallets + Pallets, } from './util/helpers'; chai.use(chaiAsPromised); diff --git a/tests/src/burnItem.test.ts b/tests/src/burnItem.test.ts index a422a992d7..7115d5d612 100644 --- a/tests/src/burnItem.test.ts +++ b/tests/src/burnItem.test.ts @@ -26,7 +26,7 @@ import { setCollectionLimitsExpectSuccess, isTokenExists, requirePallets, - Pallets + Pallets, } from './util/helpers'; import chai from 'chai'; diff --git a/tests/src/confirmSponsorship.test.ts b/tests/src/confirmSponsorship.test.ts index 6c6af489ff..65e666d2de 100644 --- a/tests/src/confirmSponsorship.test.ts +++ b/tests/src/confirmSponsorship.test.ts @@ -34,7 +34,7 @@ import { getCreatedCollectionCount, UNIQUE, requirePallets, - Pallets + Pallets, } from './util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; diff --git a/tests/src/createItem.test.ts b/tests/src/createItem.test.ts index e06de8b964..720b72a53b 100644 --- a/tests/src/createItem.test.ts +++ b/tests/src/createItem.test.ts @@ -30,7 +30,7 @@ import { normalizeAccountId, getCreateItemResult, requirePallets, - Pallets + Pallets, } from './util/helpers'; const expect = chai.expect; diff --git a/tests/src/createMultipleItems.test.ts b/tests/src/createMultipleItems.test.ts index 2d10c91e95..8c1236e313 100644 --- a/tests/src/createMultipleItems.test.ts +++ b/tests/src/createMultipleItems.test.ts @@ -35,7 +35,7 @@ import { getTokenProperties, requirePallets, Pallets, - checkPalletsPresence + checkPalletsPresence, } from './util/helpers'; chai.use(chaiAsPromised); @@ -416,7 +416,7 @@ describe('Negative Integration Test createMultipleItems(collection_id, owner, it await usingApi(async (api: ApiPromise) => { const collectionId = await createCollectionExpectSuccess(); - let types = ['NFT', 'Fungible']; + const types = ['NFT', 'Fungible']; if (await checkPalletsPresence([Pallets.ReFungible])) { types.push('ReFungible'); diff --git a/tests/src/destroyCollection.test.ts b/tests/src/destroyCollection.test.ts index 1182dbfd58..ccf134cc7d 100644 --- a/tests/src/destroyCollection.test.ts +++ b/tests/src/destroyCollection.test.ts @@ -26,7 +26,7 @@ import {createCollectionExpectSuccess, getCreatedCollectionCount, createItemExpectSuccess, requirePallets, - Pallets + Pallets, } from './util/helpers'; chai.use(chaiAsPromised); diff --git a/tests/src/limits.test.ts b/tests/src/limits.test.ts index ae1c83ada4..1909785482 100644 --- a/tests/src/limits.test.ts +++ b/tests/src/limits.test.ts @@ -28,7 +28,7 @@ import { getFreeBalance, waitNewBlocks, burnItemExpectSuccess, requirePallets, - Pallets + Pallets, } from './util/helpers'; import {expect} from 'chai'; diff --git a/tests/src/nesting/nest.test.ts b/tests/src/nesting/nest.test.ts index b77bb09126..4e0c6b6a74 100644 --- a/tests/src/nesting/nest.test.ts +++ b/tests/src/nesting/nest.test.ts @@ -18,7 +18,7 @@ import { transferFromExpectSuccess, setCollectionLimitsExpectSuccess, requirePallets, - Pallets + Pallets, } from '../util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index 84c91a60c6..39979f44b3 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -9,7 +9,7 @@ import { getCreateCollectionResult, transferExpectSuccess, requirePallets, - Pallets + Pallets, } from '../util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; import {tokenIdToAddress} from '../eth/util/helpers'; diff --git a/tests/src/nesting/unnest.test.ts b/tests/src/nesting/unnest.test.ts index 623da8972f..3a214cf559 100644 --- a/tests/src/nesting/unnest.test.ts +++ b/tests/src/nesting/unnest.test.ts @@ -11,7 +11,7 @@ import { transferExpectSuccess, transferFromExpectSuccess, requirePallets, - Pallets + Pallets, } from '../util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; diff --git a/tests/src/nextSponsoring.test.ts b/tests/src/nextSponsoring.test.ts index 8f8007466b..9ac234eff6 100644 --- a/tests/src/nextSponsoring.test.ts +++ b/tests/src/nextSponsoring.test.ts @@ -28,7 +28,7 @@ import { normalizeAccountId, getNextSponsored, requirePallets, - Pallets + Pallets, } from './util/helpers'; chai.use(chaiAsPromised); diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index b1a27607f8..3491e1df7d 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -38,7 +38,7 @@ import { getDestroyItemsResult, getModuleNames, Pallets, - requirePallets + requirePallets, } from './util/helpers'; import chai from 'chai'; diff --git a/tests/src/rmrk/acceptNft.test.ts b/tests/src/rmrk/acceptNft.test.ts index f0a8164d3d..b1dce6bf18 100644 --- a/tests/src/rmrk/acceptNft.test.ts +++ b/tests/src/rmrk/acceptNft.test.ts @@ -8,7 +8,7 @@ import { } from './util/tx'; import {NftIdTuple} from './util/fetch'; import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; describe('integration test: accept NFT', () => { let api: any; diff --git a/tests/src/rmrk/addResource.test.ts b/tests/src/rmrk/addResource.test.ts index 8d9e42306b..2129005be2 100644 --- a/tests/src/rmrk/addResource.test.ts +++ b/tests/src/rmrk/addResource.test.ts @@ -12,7 +12,7 @@ import { addNftComposableResource, } from './util/tx'; import {RmrkTraitsResourceResourceInfo as ResourceInfo} from '@polkadot/types/lookup'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; describe('integration test: add NFT resource', () => { const Alice = '//Alice'; diff --git a/tests/src/rmrk/addTheme.test.ts b/tests/src/rmrk/addTheme.test.ts index 399af4b16e..a28353a4d2 100644 --- a/tests/src/rmrk/addTheme.test.ts +++ b/tests/src/rmrk/addTheme.test.ts @@ -3,7 +3,7 @@ import {getApiConnection} from '../substrate/substrate-api'; import {createBase, addTheme} from './util/tx'; import {expectTxFailure} from './util/helpers'; import {getThemeNames} from './util/fetch'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; describe('integration test: add Theme to Base', () => { let api: any; diff --git a/tests/src/rmrk/burnNft.test.ts b/tests/src/rmrk/burnNft.test.ts index b996b42610..c533628f42 100644 --- a/tests/src/rmrk/burnNft.test.ts +++ b/tests/src/rmrk/burnNft.test.ts @@ -5,7 +5,7 @@ import {burnNft, createCollection, sendNft, mintNft} from './util/tx'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; diff --git a/tests/src/rmrk/changeCollectionIssuer.test.ts b/tests/src/rmrk/changeCollectionIssuer.test.ts index 5cca12e1b7..7bbb08f18e 100644 --- a/tests/src/rmrk/changeCollectionIssuer.test.ts +++ b/tests/src/rmrk/changeCollectionIssuer.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import { changeIssuer, diff --git a/tests/src/rmrk/createBase.test.ts b/tests/src/rmrk/createBase.test.ts index eb52dc1dfc..089ac1ef0d 100644 --- a/tests/src/rmrk/createBase.test.ts +++ b/tests/src/rmrk/createBase.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; import {createCollection, createBase} from './util/tx'; describe('integration test: create new Base', () => { diff --git a/tests/src/rmrk/deleteCollection.test.ts b/tests/src/rmrk/deleteCollection.test.ts index 81bb990b40..f0cd5bbd35 100644 --- a/tests/src/rmrk/deleteCollection.test.ts +++ b/tests/src/rmrk/deleteCollection.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, deleteCollection} from './util/tx'; diff --git a/tests/src/rmrk/getOwnedNfts.test.ts b/tests/src/rmrk/getOwnedNfts.test.ts index 961ed6b910..83f9acfb0a 100644 --- a/tests/src/rmrk/getOwnedNfts.test.ts +++ b/tests/src/rmrk/getOwnedNfts.test.ts @@ -1,6 +1,6 @@ import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; import {getOwnedNfts} from './util/fetch'; import {mintNft, createCollection} from './util/tx'; diff --git a/tests/src/rmrk/lockCollection.test.ts b/tests/src/rmrk/lockCollection.test.ts index 1b824db45f..c48a112b98 100644 --- a/tests/src/rmrk/lockCollection.test.ts +++ b/tests/src/rmrk/lockCollection.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, lockCollection, mintNft} from './util/tx'; diff --git a/tests/src/rmrk/mintNft.test.ts b/tests/src/rmrk/mintNft.test.ts index a1ea008962..391e00e137 100644 --- a/tests/src/rmrk/mintNft.test.ts +++ b/tests/src/rmrk/mintNft.test.ts @@ -1,6 +1,6 @@ import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; import {getNft} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import {createCollection, mintNft} from './util/tx'; diff --git a/tests/src/rmrk/rejectNft.test.ts b/tests/src/rmrk/rejectNft.test.ts index 9df00d52d2..345ecbb2eb 100644 --- a/tests/src/rmrk/rejectNft.test.ts +++ b/tests/src/rmrk/rejectNft.test.ts @@ -8,7 +8,7 @@ import { } from './util/tx'; import {getChildren, NftIdTuple} from './util/fetch'; import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; describe('integration test: reject NFT', () => { let api: any; diff --git a/tests/src/rmrk/removeResource.test.ts b/tests/src/rmrk/removeResource.test.ts index 42ed3e0a0a..bcfd948aa1 100644 --- a/tests/src/rmrk/removeResource.test.ts +++ b/tests/src/rmrk/removeResource.test.ts @@ -1,7 +1,7 @@ import {expect} from 'chai'; import privateKey from '../substrate/privateKey'; import {executeTransaction, getApiConnection} from '../substrate/substrate-api'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; import {getNft, NftIdTuple} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import { diff --git a/tests/src/rmrk/sendNft.test.ts b/tests/src/rmrk/sendNft.test.ts index 3a1f6f49b4..3db58c0708 100644 --- a/tests/src/rmrk/sendNft.test.ts +++ b/tests/src/rmrk/sendNft.test.ts @@ -3,7 +3,7 @@ import {getApiConnection} from '../substrate/substrate-api'; import {createCollection, mintNft, sendNft} from './util/tx'; import {NftIdTuple} from './util/fetch'; import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; describe('integration test: send NFT', () => { let api: any; diff --git a/tests/src/rmrk/setCollectionProperty.test.ts b/tests/src/rmrk/setCollectionProperty.test.ts index a076fc64d3..9bc0ecb57f 100644 --- a/tests/src/rmrk/setCollectionProperty.test.ts +++ b/tests/src/rmrk/setCollectionProperty.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, setPropertyCollection} from './util/tx'; diff --git a/tests/src/rmrk/setEquippableList.test.ts b/tests/src/rmrk/setEquippableList.test.ts index 2f20edb2dd..95176c8828 100644 --- a/tests/src/rmrk/setEquippableList.test.ts +++ b/tests/src/rmrk/setEquippableList.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, createBase, setEquippableList} from './util/tx'; diff --git a/tests/src/rmrk/setNftProperty.test.ts b/tests/src/rmrk/setNftProperty.test.ts index 704fb9885b..5451283315 100644 --- a/tests/src/rmrk/setNftProperty.test.ts +++ b/tests/src/rmrk/setNftProperty.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; import {NftIdTuple} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import {createCollection, mintNft, sendNft, setNftProperty} from './util/tx'; diff --git a/tests/src/rmrk/setResourcePriorities.test.ts b/tests/src/rmrk/setResourcePriorities.test.ts index e656569d8a..53eac860b2 100644 --- a/tests/src/rmrk/setResourcePriorities.test.ts +++ b/tests/src/rmrk/setResourcePriorities.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import { requirePallets, Pallets } from '../util/helpers'; +import {requirePallets, Pallets} from '../util/helpers'; import {expectTxFailure} from './util/helpers'; import {mintNft, createCollection, setResourcePriorities} from './util/tx'; diff --git a/tests/src/setCollectionSponsor.test.ts b/tests/src/setCollectionSponsor.test.ts index 1c3a4551f0..ec4b27b002 100644 --- a/tests/src/setCollectionSponsor.test.ts +++ b/tests/src/setCollectionSponsor.test.ts @@ -24,7 +24,7 @@ import {createCollectionExpectSuccess, addCollectionAdminExpectSuccess, getCreatedCollectionCount, requirePallets, - Pallets + Pallets, } from './util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; diff --git a/tests/src/transfer.test.ts b/tests/src/transfer.test.ts index 991420e668..d698053086 100644 --- a/tests/src/transfer.test.ts +++ b/tests/src/transfer.test.ts @@ -42,7 +42,7 @@ import { subToEth, itWeb3, } from './eth/util/helpers'; -import { request } from 'https'; +import {request} from 'https'; let alice: IKeyringPair; let bob: IKeyringPair; diff --git a/tests/src/transferFrom.test.ts b/tests/src/transferFrom.test.ts index 872d3f39e0..6fb6bbce6d 100644 --- a/tests/src/transferFrom.test.ts +++ b/tests/src/transferFrom.test.ts @@ -32,7 +32,7 @@ import { setCollectionLimitsExpectSuccess, getCreatedCollectionCount, requirePallets, - Pallets + Pallets, } from './util/helpers'; chai.use(chaiAsPromised); diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index 27d1fc4203..b19a14096d 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -28,7 +28,7 @@ import {default as usingApi, executeTransaction, submitTransactionAsync, submitT import {hexToStr, strToUTF16, utf16ToStr} from './util'; import {UpDataStructsRpcCollection, UpDataStructsCreateItemData, UpDataStructsProperty} from '@polkadot/types/lookup'; import {UpDataStructsTokenChild} from '../interfaces'; -import { Context } from 'mocha'; +import {Context} from 'mocha'; chai.use(chaiAsPromised); const expect = chai.expect; From c27ef304dac4db073452c4646cac91f9f00972f6 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 10 Aug 2022 15:39:47 +0300 Subject: [PATCH 0292/1274] Location to generated launch-config-forkless.json has been amended in dockerfile. --- .docker/Dockerfile-parachain-upgrade | 3 +- .docker/docker-compose-forkless.yaml | 5 +- .docker/launch-config.j2 | 83 ++++++++++++++++++++ .github/workflows/forkless-update-nodata.yml | 2 +- 4 files changed, 90 insertions(+), 3 deletions(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index b8c0ee774a..9ffb59e70b 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -99,4 +99,5 @@ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ - yarn start launch-config.json + yarn start launch-config.json --test-upgrade + diff --git a/.docker/docker-compose-forkless.yaml b/.docker/docker-compose-forkless.yaml index 446b69e109..dc1598a949 100644 --- a/.docker/docker-compose-forkless.yaml +++ b/.docker/docker-compose-forkless.yaml @@ -8,7 +8,10 @@ services: image: node-parachain container_name: node-parachain volumes: - - .docker/launch-config-forkless.json:/polkadot-launch/launch-config.json + - type: bind + source: ./launch-config-forkless.json + target: /polkadot-launch/launch-config.json + read_only: true expose: - 9944 - 9933 diff --git a/.docker/launch-config.j2 b/.docker/launch-config.j2 index 41e58db511..607bee90d0 100644 --- a/.docker/launch-config.j2 +++ b/.docker/launch-config.j2 @@ -1,4 +1,87 @@ { + "relaychain": { + "bin": "../alts/polkadot/target/release/polkadot", + "chain": "westend-local", + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, "parachains": [ { "bin": "../unique-chain/current/release/unique-collator", diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index a67f15a5dd..49a653603b 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -112,7 +112,7 @@ jobs: - name: Build the stack - run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --remove-orphans + run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build # - name: Test Report From 962e19c7ae746ff76735836e1cd12b88f4037cd7 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 10 Aug 2022 15:51:18 +0300 Subject: [PATCH 0293/1274] FIX: Specified full path to polkadot --- .docker/launch-config.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/launch-config.j2 b/.docker/launch-config.j2 index 607bee90d0..2e5062aadd 100644 --- a/.docker/launch-config.j2 +++ b/.docker/launch-config.j2 @@ -1,6 +1,6 @@ { "relaychain": { - "bin": "../alts/polkadot/target/release/polkadot", + "bin": "/polkadot/target/release/polkadot", "chain": "westend-local", "nodes": [ { From 52cdaad76863e81dd8424be4366cad09bb7485fd Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 10 Aug 2022 16:09:57 +0300 Subject: [PATCH 0294/1274] Added upgradeBin path to ralaychain configuration --- .docker/launch-config.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.docker/launch-config.j2 b/.docker/launch-config.j2 index 2e5062aadd..f39a96e83a 100644 --- a/.docker/launch-config.j2 +++ b/.docker/launch-config.j2 @@ -1,6 +1,8 @@ { "relaychain": { "bin": "/polkadot/target/release/polkadot", + "upgradeBin": "/polkadot/target/release/polkadot", + "upgradeWasm": "/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm", "chain": "westend-local", "nodes": [ { From 0098859a55887df2b776696d81a2bf7f7832d587 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 10 Aug 2022 16:11:50 +0300 Subject: [PATCH 0295/1274] Remove extra space before string. --- .docker/launch-config.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/launch-config.j2 b/.docker/launch-config.j2 index f39a96e83a..5855546456 100644 --- a/.docker/launch-config.j2 +++ b/.docker/launch-config.j2 @@ -2,7 +2,7 @@ "relaychain": { "bin": "/polkadot/target/release/polkadot", "upgradeBin": "/polkadot/target/release/polkadot", - "upgradeWasm": "/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm", + "upgradeWasm": "/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm", "chain": "westend-local", "nodes": [ { From 04959868b343d649de4ad4c330d4a1b33cdaa11d Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 10 Aug 2022 17:40:53 +0300 Subject: [PATCH 0296/1274] Update due to found polkadot-launch requirements for upgrade. --- .docker/Dockerfile-parachain-upgrade | 11 +++++++++++ .docker/docker-compose.tmp-forkless.j2 | 1 + .docker/launch-config.j2 | 6 +++--- .github/workflows/forkless-update-nodata.yml | 1 + 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index 9ffb59e70b..7860332b97 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -58,6 +58,8 @@ WORKDIR /unique_parachain RUN git clone $REPO_URL -b $BRANCH . RUN cargo build --features=$FEATURE --$PROFILE +RUN ls -la /unique_parachain +RUN ls -la /unique_parachain/target/release/wbuild # ===== BUILD POLKADOT ===== FROM rust-builder as builder-polkadot @@ -76,6 +78,9 @@ RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/ FROM ubuntu:20.04 +ARG RUNTIME= +ENV RUNTIME $RUNTIME + RUN apt-get -y update && \ apt-get -y install curl git && \ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ @@ -92,9 +97,15 @@ RUN export NVM_DIR="$HOME/.nvm" && \ npm install --global yarn && \ yarn install +RUN echo "$RUNTIME" + COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm + COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm + CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ diff --git a/.docker/docker-compose.tmp-forkless.j2 b/.docker/docker-compose.tmp-forkless.j2 index fe0b8653d2..ab2ec92803 100644 --- a/.docker/docker-compose.tmp-forkless.j2 +++ b/.docker/docker-compose.tmp-forkless.j2 @@ -8,6 +8,7 @@ services: - "BRANCH={{ BRANCH }}" - "REPO_URL={{ REPO_URL }}" - "FEATURE={{ FEATURE }}" + - "RUNTIME={{ RUNTIME }}" - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - "MAINNET_TAG={{ MAINNET_TAG }}" - "MAINNET_BRANCH={{ MAINNET_BRANCH }}" diff --git a/.docker/launch-config.j2 b/.docker/launch-config.j2 index 5855546456..94f121b0fa 100644 --- a/.docker/launch-config.j2 +++ b/.docker/launch-config.j2 @@ -86,9 +86,9 @@ }, "parachains": [ { - "bin": "../unique-chain/current/release/unique-collator", - "upgradeBin": "../unique-chain/target/release/unique-collator", - "upgradeWasm": "../unique-chain/target/release/wbuild/{{ FEATURE }}/{{ RUNTIME }}_runtime.compact.compressed.wasm", + "bin": "/unique-chain/current/release/unique-collator", + "upgradeBin": "/unique-chain/target/release/unique-collator", + "upgradeWasm": "/unique-chain/target/release/wbuild/{{ FEATURE }}/{{ RUNTIME }}_runtime.compact.compressed.wasm", "id": "1000", "balance": "1000000000000000000000000", "nodes": [ diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 49a653603b..729a295380 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -90,6 +90,7 @@ jobs: MAINNET_TAG=${{ matrix.mainnet_tag }} MAINNET_BRANCH=${{ matrix.mainnet_branch }} FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} BRANCH=${{ github.head_ref }} - name: Show build configuration From b1ac0b6faf216dd198cac2dc50215c8c03681263 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 10 Aug 2022 18:47:30 +0300 Subject: [PATCH 0297/1274] Added log extraction and upload. --- .docker/Dockerfile-parachain-upgrade | 2 +- .github/workflows/forkless-update-nodata.yml | 25 +++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index 7860332b97..eff80d5044 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -110,5 +110,5 @@ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/wbuild/we CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ - yarn start launch-config.json --test-upgrade + yarn start launch-config.json --test-upgrade-parachain diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 729a295380..f01f10f88e 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -31,9 +31,9 @@ jobs: strategy: matrix: include: - # - network: "Opal" - # features: "--features=opal-runtime" - # binary_version: +# - network: "Opal" +# features: " " +# binary_version: - network: "Quartz" # KUSAMA_MAINNET_BRANCH для quartz-runtime features: "quartz-runtime" runtime: "quartz" @@ -108,13 +108,26 @@ jobs: - name: Show launch-config-forkless configuration run: cat .docker/launch-config-forkless.json - - name: Show files in directory - run: ls -la - - name: Build the stack run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build + - name: Collect docker logs on failure + if: success() || failure() + uses: jwalton/gh-docker-logs@v1 + with: + dest: './fpu-logs' + images: 'node-parachain' + - name: Tar logs + if: success() || failure() + run: tar cvzf ./fpu-logs.tgz ./fpu-logs + - name: Upload logs to GitHub + if: success() || failure() + uses: actions/upload-artifact@master + with: + name: forkless-parachain-upgrade-logs.tgz + path: ./fpu-logs.tgz + # - name: Test Report # uses: phoenix-actions/test-reporting@v8 From 84e7c355c2f47ab85e7b97f76905e22e3015c9ac Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 10 Aug 2022 18:52:19 +0300 Subject: [PATCH 0298/1274] Github Action version update --- .github/workflows/forkless-update-nodata.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index f01f10f88e..36c32906a0 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -112,9 +112,9 @@ jobs: - name: Build the stack run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build - - name: Collect docker logs on failure + - name: Collect Docker Logs if: success() || failure() - uses: jwalton/gh-docker-logs@v1 + uses: jwalton/gh-docker-logs@v2.2.0 with: dest: './fpu-logs' images: 'node-parachain' From d1c812999114cc45a39f9b410834dd40af897675 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 10 Aug 2022 19:15:29 +0300 Subject: [PATCH 0299/1274] Un-Commented docker-compose down. --- .github/workflows/forkless-update-nodata.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 36c32906a0..a985903bc1 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -142,6 +142,6 @@ jobs: # run: | # echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}" -# - name: Stop running containers -# if: always() # run this step always -# run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From 72ff5ea79ac169cb929e27c476cdaa3d8f955b20 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 11 Aug 2022 08:18:58 +0300 Subject: [PATCH 0300/1274] FIX: added missed s symbol. --- .docker/Dockerfile-parachain-upgrade | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index eff80d5044..94c1865573 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -110,5 +110,4 @@ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/wbuild/we CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ - yarn start launch-config.json --test-upgrade-parachain - + yarn start launch-config.json --test-upgrade-parachains From 29c5d884a0ed4b235be51a1ec1d902e991cba805 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 11 Aug 2022 08:35:16 +0300 Subject: [PATCH 0301/1274] Debug: Added timeouts. --- .github/workflows/forkless-update-nodata.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index a985903bc1..d4d83d19fa 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -110,7 +110,10 @@ jobs: - name: Build the stack - run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build + run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate + + - name: Wait for 15m + run: sleep 900s - name: Collect Docker Logs if: success() || failure() @@ -142,6 +145,9 @@ jobs: # run: | # echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}" + - name: Wait for 15m + run: sleep 900s + - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From 06b1d59c0aab9cceef5b950b754060e7d59d56c1 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 11 Aug 2022 09:45:09 +0300 Subject: [PATCH 0302/1274] Added matrix variables into naming logs. To prevent logs overwriting. --- .github/workflows/forkless-update-nodata.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index d4d83d19fa..e38dd71953 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -113,23 +113,25 @@ jobs: run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate - name: Wait for 15m - run: sleep 900s + run: sleep 600s - name: Collect Docker Logs if: success() || failure() uses: jwalton/gh-docker-logs@v2.2.0 with: - dest: './fpu-logs' + dest: './fpu-logs.${{ matrix.feature }}' images: 'node-parachain' + - name: Tar logs if: success() || failure() - run: tar cvzf ./fpu-logs.tgz ./fpu-logs + run: tar cvzf ./fpu-logs.${{ matrix.feature }}.tgz ./fpu-logs.${{ matrix.feature }} + - name: Upload logs to GitHub if: success() || failure() uses: actions/upload-artifact@master with: - name: forkless-parachain-upgrade-logs.tgz - path: ./fpu-logs.tgz + name: fpu-logs.${{ matrix.feature }}.tgz + path: ./fpu-logs.${{ matrix.feature }}.tgz # - name: Test Report @@ -145,8 +147,6 @@ jobs: # run: | # echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}" - - name: Wait for 15m - run: sleep 900s - name: Stop running containers if: always() # run this step always From 7a36e4c3fb6537198f3cd9a9b8a80d2e5d1855aa Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 11 Aug 2022 07:52:41 +0000 Subject: [PATCH 0303/1274] fix: use console.error in requirePallets --- tests/src/util/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index b19a14096d..564934b08e 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -93,7 +93,7 @@ export async function requirePallets(mocha: Context, requiredPallets: string[]) const missingPalletsMsg = `\tThe following pallets are missing:\n\t- ${missingPallets.join('\n\t- ')}`; const skipMsg = `${skippingTestMsg}\n${missingPalletsMsg}`; - console.log('\x1b[38:5:208m%s\x1b[0m', skipMsg); + console.error('\x1b[38:5:208m%s\x1b[0m', skipMsg); mocha.skip(); } From ac8475bfded965a845124871e59bab0aab180892 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 11 Aug 2022 11:52:17 +0300 Subject: [PATCH 0304/1274] test: remove only Signed-off-by: Yaroslav Bolyukin --- tests/src/createMultipleItemsEx.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/createMultipleItemsEx.test.ts b/tests/src/createMultipleItemsEx.test.ts index e5a695ac9f..85c646f816 100644 --- a/tests/src/createMultipleItemsEx.test.ts +++ b/tests/src/createMultipleItemsEx.test.ts @@ -18,7 +18,7 @@ import {expect} from 'chai'; import usingApi, {executeTransaction} from './substrate/substrate-api'; import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, createCollectionWithPropsExpectSuccess, getBalance, getLastTokenId, getTokenProperties} from './util/helpers'; -describe.only('Integration Test: createMultipleItemsEx', () => { +describe('Integration Test: createMultipleItemsEx', () => { it('can initialize multiple NFT with different owners', async () => { const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); await usingApi(async (api, privateKeyWrapper) => { From eb176303d30bb9affedc447bf8f57e2da604bbf1 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0305/1274] feat(refungible-pallet): ERC 1633 implementation and `set_parent_nft` method --- pallets/common/src/erc.rs | 29 ++- pallets/common/src/lib.rs | 54 +++++- pallets/fungible/src/common.rs | 4 + pallets/fungible/src/stubs/UniqueFungible.sol | 170 +++++++++-------- pallets/nonfungible/src/benchmarking.rs | 18 +- pallets/nonfungible/src/common.rs | 4 + pallets/nonfungible/src/lib.rs | 17 ++ pallets/nonfungible/src/stubs/UniqueNFT.sol | 20 +- pallets/nonfungible/src/weights.rs | 97 +++++----- pallets/refungible/src/benchmarking.rs | 34 +++- pallets/refungible/src/common.rs | 4 + pallets/refungible/src/erc.rs | 18 +- pallets/refungible/src/erc_token.rs | 73 +++++++- pallets/refungible/src/lib.rs | 92 ++++++++- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4116 -> 4197 bytes .../refungible/src/stubs/UniqueRefungible.sol | 174 +++++++++++------- .../src/stubs/UniqueRefungibleToken.sol | 41 ++++- pallets/refungible/src/weights.rs | 134 ++++++++------ pallets/unique/src/eth/mod.rs | 105 +++++++---- .../src/eth/stubs/CollectionHelpers.sol | 6 +- primitives/data-structs/src/lib.rs | 2 + runtime/common/src/weights.rs | 4 + tests/src/eth/api/CollectionHelpers.sol | 4 +- tests/src/eth/api/UniqueFungible.sol | 82 +++++---- tests/src/eth/api/UniqueNFT.sol | 12 +- tests/src/eth/api/UniqueRefungible.sol | 120 +++++++----- tests/src/eth/api/UniqueRefungibleToken.sol | 21 ++- tests/src/eth/reFungibleAbi.json | 23 +++ tests/src/eth/reFungibleToken.test.ts | 30 ++- tests/src/eth/reFungibleTokenAbi.json | 24 +++ 30 files changed, 1019 insertions(+), 397 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index dea71fc537..ac007645cf 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -25,7 +25,8 @@ pub use pallet_evm::{PrecompileOutput, PrecompileResult, PrecompileHandle, accou use pallet_evm_coder_substrate::dispatch_to_evm; use sp_std::vec::Vec; use up_data_structs::{ - Property, SponsoringRateLimit, OwnerRestrictedSet, AccessMode, CollectionPermissions, + AccessMode, CollectionMode, CollectionPermissions, OwnerRestrictedSet, Property, + SponsoringRateLimit, }; use alloc::format; @@ -408,6 +409,27 @@ where save(self) } + + /// Check that account is the owner or admin of the collection + /// + /// @return "true" if account is the owner or admin + fn verify_owner_or_admin(&mut self, caller: caller) -> Result { + Ok(check_is_owner_or_admin(caller, self) + .map(|_| true) + .unwrap_or(false)) + } + + /// Returns collection type + /// + /// @return `Fungible` or `NFT` or `ReFungible` + fn unique_collection_type(&mut self) -> Result { + let mode = match self.collection.mode { + CollectionMode::Fungible(_) => "Fungible", + CollectionMode::NFT => "NFT", + CollectionMode::ReFungible => "ReFungible", + }; + Ok(mode.into()) + } } fn check_is_owner_or_admin( @@ -462,6 +484,11 @@ pub mod static_property { pub fn suffix() -> up_data_structs::PropertyKey { property_key_from_bytes(b"suffix").expect(EXPECT_CONVERT_ERROR) } + + /// Key "parentNft". + pub fn parent_nft() -> up_data_structs::PropertyKey { + property_key_from_bytes(b"parentNft").expect(EXPECT_CONVERT_ERROR) + } } /// Values. diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 204c48f5a8..08ffb00156 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -1111,6 +1111,26 @@ impl Pallet { collection: &CollectionHandle, sender: &T::CrossAccountId, property_permission: PropertyKeyPermission, + ) -> DispatchResult { + Self::set_scoped_property_permission( + collection, + sender, + PropertyScope::None, + property_permission, + ) + } + + /// Set collection property permission with scope. + /// + /// * `collection` - Collection handler. + /// * `sender` - The owner or administrator of the collection. + /// * `scope` - Property scope. + /// * `property_permission` - Property permission. + pub fn set_scoped_property_permission( + collection: &CollectionHandle, + sender: &T::CrossAccountId, + scope: PropertyScope, + property_permission: PropertyKeyPermission, ) -> DispatchResult { collection.check_is_owner_or_admin(sender)?; @@ -1125,7 +1145,11 @@ impl Pallet { CollectionPropertyPermissions::::try_mutate(collection.id, |permissions| { let property_permission = property_permission.clone(); - permissions.try_set(property_permission.key, property_permission.permission) + permissions.try_scoped_set( + scope, + property_permission.key, + property_permission.permission, + ) }) .map_err(>::from)?; @@ -1147,9 +1171,30 @@ impl Pallet { collection: &CollectionHandle, sender: &T::CrossAccountId, property_permissions: Vec, + ) -> DispatchResult { + Self::set_scoped_token_property_permissions( + collection, + sender, + PropertyScope::None, + property_permissions, + ) + } + + /// Set token property permission with scope. + /// + /// * `collection` - Collection handler. + /// * `sender` - The owner or administrator of the collection. + /// * `scope` - Property scope. + /// * `property_permissions` - Property permissions. + #[transactional] + pub fn set_scoped_token_property_permissions( + collection: &CollectionHandle, + sender: &T::CrossAccountId, + scope: PropertyScope, + property_permissions: Vec, ) -> DispatchResult { for prop_pemission in property_permissions { - Self::set_property_permission(collection, sender, prop_pemission)?; + Self::set_scoped_property_permission(collection, sender, scope, prop_pemission)?; } Ok(()) @@ -1429,6 +1474,9 @@ pub trait CommonWeightInfo { .saturating_mul(max_selfs.max(1) as u64) .saturating_add(Self::burn_recursively_breadth_raw(max_breadth)) } + + /// The price of retrieving token owner + fn token_owner() -> Weight; } /// Weight info extension trait for refungible pallet. @@ -1567,7 +1615,7 @@ pub trait CommonCollectionOperations { /// /// * `sender` - Must be either the owner of the token or its admin. /// * `token_id` - The token for which the properties are being set. - /// * `properties` - Properties to be set. + /// * `property_permissions` - Property permissions to be set. /// * `budget` - Budget for setting properties. fn set_token_property_permissions( &self, diff --git a/pallets/fungible/src/common.rs b/pallets/fungible/src/common.rs index 98dc9237d1..3a4ee265ce 100644 --- a/pallets/fungible/src/common.rs +++ b/pallets/fungible/src/common.rs @@ -103,6 +103,10 @@ impl CommonWeightInfo for CommonWeights { // Fungible tokens can't have children 0 } + + fn token_owner() -> Weight { + 0 + } } /// Implementation of `CommonCollectionOperations` for `FungibleHandle`. It wraps FungibleHandle Pallete diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index 565b100098..b7b7974ddd 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -43,7 +43,91 @@ contract ERC20UniqueExtensions is Dummy, ERC165 { } } -// Selector: 7d9262e6 +// Selector: 942e8b22 +contract ERC20 is Dummy, ERC165, ERC20Events { + // Selector: name() 06fdde03 + function name() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: symbol() 95d89b41 + function symbol() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: decimals() 313ce567 + function decimals() public view returns (uint8) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) public view returns (uint256) { + require(false, stub_error); + owner; + dummy; + return 0; + } + + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 amount) public returns (bool) { + require(false, stub_error); + to; + amount; + dummy = 0; + return false; + } + + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 amount + ) public returns (bool) { + require(false, stub_error); + from; + to; + amount; + dummy = 0; + return false; + } + + // Selector: approve(address,uint256) 095ea7b3 + function approve(address spender, uint256 amount) public returns (bool) { + require(false, stub_error); + spender; + amount; + dummy = 0; + return false; + } + + // Selector: allowance(address,address) dd62ed3e + function allowance(address owner, address spender) + public + view + returns (uint256) + { + require(false, stub_error); + owner; + spender; + dummy; + return 0; + } +} + +// Selector: aa7d570d contract Collection is Dummy, ERC165 { // Set collection property. // @@ -268,89 +352,23 @@ contract Collection is Dummy, ERC165 { mode; dummy = 0; } -} -// Selector: 942e8b22 -contract ERC20 is Dummy, ERC165, ERC20Events { - // Selector: name() 06fdde03 - function name() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: symbol() 95d89b41 - function symbol() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: decimals() 313ce567 - function decimals() public view returns (uint8) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) public view returns (uint256) { - require(false, stub_error); - owner; - dummy; - return 0; - } - - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 amount) public returns (bool) { - require(false, stub_error); - to; - amount; - dummy = 0; - return false; - } - - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 amount - ) public returns (bool) { + // Check that account is the owner or admin of the collection + // + // @return "true" if account is the owner or admin + // + // Selector: verifyOwnerOrAdmin() 04a46053 + function verifyOwnerOrAdmin() public returns (bool) { require(false, stub_error); - from; - to; - amount; dummy = 0; return false; } - // Selector: approve(address,uint256) 095ea7b3 - function approve(address spender, uint256 amount) public returns (bool) { + // Selector: uniqueCollectionType() d34b55b8 + function uniqueCollectionType() public returns (string memory) { require(false, stub_error); - spender; - amount; dummy = 0; - return false; - } - - // Selector: allowance(address,address) dd62ed3e - function allowance(address owner, address spender) - public - view - returns (uint256) - { - require(false, stub_error); - owner; - spender; - dummy; - return 0; + return ""; } } diff --git a/pallets/nonfungible/src/benchmarking.rs b/pallets/nonfungible/src/benchmarking.rs index c28db905e2..5444cbc3a8 100644 --- a/pallets/nonfungible/src/benchmarking.rs +++ b/pallets/nonfungible/src/benchmarking.rs @@ -17,11 +17,14 @@ use super::*; use crate::{Pallet, Config, NonfungibleHandle}; -use sp_std::prelude::*; -use pallet_common::benchmarking::{create_collection_raw, property_key, property_value}; use frame_benchmarking::{benchmarks, account}; +use pallet_common::{ + bench_init, + benchmarking::{create_collection_raw, property_key, property_value}, + CommonCollectionOperations, +}; +use sp_std::prelude::*; use up_data_structs::{CollectionMode, MAX_ITEMS_PER_BATCH, MAX_PROPERTIES_PER_ITEM, budget::Unlimited}; -use pallet_common::bench_init; const SEED: u32 = 1; @@ -208,4 +211,13 @@ benchmarks! { >::set_token_properties(&collection, &owner, item, props.into_iter(), false, &Unlimited)?; let to_delete = (0..b).map(|k| property_key(k as usize)).collect::>(); }: {>::delete_token_properties(&collection, &owner, item, to_delete.into_iter(), &Unlimited)?} + + token_owner { + bench_init!{ + owner: sub; collection: collection(owner); + owner: cross_from_sub; + }; + let item = create_max_item(&collection, &owner, owner.clone())?; + + }: {collection.token_owner(item)} } diff --git a/pallets/nonfungible/src/common.rs b/pallets/nonfungible/src/common.rs index 52915345cd..16cd09c53b 100644 --- a/pallets/nonfungible/src/common.rs +++ b/pallets/nonfungible/src/common.rs @@ -118,6 +118,10 @@ impl CommonWeightInfo for CommonWeights { >::burn_recursively_breadth_plus_self_plus_self_per_each_raw(amount) .saturating_sub(Self::burn_recursively_self_raw().saturating_mul(amount as u64 + 1)) } + + fn token_owner() -> Weight { + 0 //>::token_owner() + } } fn map_create_data( diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 34acf853ef..ba87344324 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -784,6 +784,23 @@ impl Pallet { >::set_token_property_permissions(collection, sender, property_permissions) } + /// Set property permissions for the token with scope. + /// + /// Sender should be the owner or admin of token's collection. + pub fn set_scoped_token_property_permissions( + collection: &CollectionHandle, + sender: &T::CrossAccountId, + scope: PropertyScope, + property_permissions: Vec, + ) -> DispatchResult { + >::set_scoped_token_property_permissions( + collection, + sender, + scope, + property_permissions, + ) + } + /// Set property permissions for the collection. /// /// Sender should be the owner or admin of the collection. diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index bef56e99f7..5677cf9699 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -415,7 +415,7 @@ contract ERC721Enumerable is Dummy, ERC165 { } } -// Selector: 7d9262e6 +// Selector: aa7d570d contract Collection is Dummy, ERC165 { // Set collection property. // @@ -640,6 +640,24 @@ contract Collection is Dummy, ERC165 { mode; dummy = 0; } + + // Check that account is the owner or admin of the collection + // + // @return "true" if account is the owner or admin + // + // Selector: verifyOwnerOrAdmin() 04a46053 + function verifyOwnerOrAdmin() public returns (bool) { + require(false, stub_error); + dummy = 0; + return false; + } + + // Selector: uniqueCollectionType() d34b55b8 + function uniqueCollectionType() public returns (string memory) { + require(false, stub_error); + dummy = 0; + return ""; + } } // Selector: d74d154f diff --git a/pallets/nonfungible/src/weights.rs b/pallets/nonfungible/src/weights.rs index e7ae687542..1d093aac9d 100644 --- a/pallets/nonfungible/src/weights.rs +++ b/pallets/nonfungible/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_nonfungible //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-07-20, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-08-01, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -46,6 +46,7 @@ pub trait WeightInfo { fn set_token_property_permissions(b: u32, ) -> Weight; fn set_token_properties(b: u32, ) -> Weight; fn delete_token_properties(b: u32, ) -> Weight; + fn token_owner() -> Weight; } /// Weights for pallet_nonfungible using the Substrate node and recommended hardware. @@ -56,7 +57,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn create_item() -> Weight { - (20_328_000 as Weight) + (20_909_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -65,9 +66,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (10_134_000 as Weight) - // Standard Error: 3_000 - .saturating_add((4_927_000 as Weight).saturating_mul(b as Weight)) + (12_601_000 as Weight) + // Standard Error: 1_000 + .saturating_add((4_920_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(b as Weight))) @@ -77,9 +78,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items_ex(b: u32, ) -> Weight { - (5_710_000 as Weight) - // Standard Error: 4_000 - .saturating_add((7_578_000 as Weight).saturating_mul(b as Weight)) + (0 as Weight) + // Standard Error: 3_000 + .saturating_add((7_734_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -93,7 +94,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_item() -> Weight { - (28_433_000 as Weight) + (29_746_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -105,7 +106,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_recursively_self_raw() -> Weight { - (34_435_000 as Weight) + (36_077_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -119,8 +120,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Common CollectionById (r:1 w:0) fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_539_000 - .saturating_add((304_456_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_605_000 + .saturating_add((312_391_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(6 as Weight)) @@ -131,14 +132,14 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Allowance (r:1 w:0) // Storage: Nonfungible Owned (r:0 w:2) fn transfer() -> Weight { - (24_376_000 as Weight) + (25_248_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } // Storage: Nonfungible TokenData (r:1 w:0) // Storage: Nonfungible Allowance (r:1 w:1) fn approve() -> Weight { - (15_890_000 as Weight) + (16_321_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -147,7 +148,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible AccountBalance (r:2 w:2) // Storage: Nonfungible Owned (r:0 w:2) fn transfer_from() -> Weight { - (28_634_000 as Weight) + (29_325_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -159,15 +160,15 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (32_201_000 as Weight) + (33_323_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Common CollectionPropertyPermissions (r:1 w:1) fn set_token_property_permissions(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 57_000 - .saturating_add((15_232_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 62_000 + .saturating_add((16_222_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -175,8 +176,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:1 w:1) fn set_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_648_000 - .saturating_add((288_654_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_750_000 + .saturating_add((304_476_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -184,11 +185,16 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:1 w:1) fn delete_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_632_000 - .saturating_add((289_190_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_638_000 + .saturating_add((294_096_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } + // Storage: Nonfungible TokenData (r:1 w:0) + fn token_owner() -> Weight { + (2_986_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + } } // For backwards compatibility and tests @@ -198,7 +204,7 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn create_item() -> Weight { - (20_328_000 as Weight) + (20_909_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -207,9 +213,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (10_134_000 as Weight) - // Standard Error: 3_000 - .saturating_add((4_927_000 as Weight).saturating_mul(b as Weight)) + (12_601_000 as Weight) + // Standard Error: 1_000 + .saturating_add((4_920_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(b as Weight))) @@ -219,9 +225,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items_ex(b: u32, ) -> Weight { - (5_710_000 as Weight) - // Standard Error: 4_000 - .saturating_add((7_578_000 as Weight).saturating_mul(b as Weight)) + (0 as Weight) + // Standard Error: 3_000 + .saturating_add((7_734_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -235,7 +241,7 @@ impl WeightInfo for () { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_item() -> Weight { - (28_433_000 as Weight) + (29_746_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -247,7 +253,7 @@ impl WeightInfo for () { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_recursively_self_raw() -> Weight { - (34_435_000 as Weight) + (36_077_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -261,8 +267,8 @@ impl WeightInfo for () { // Storage: Common CollectionById (r:1 w:0) fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_539_000 - .saturating_add((304_456_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_605_000 + .saturating_add((312_391_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(7 as Weight)) .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) @@ -273,14 +279,14 @@ impl WeightInfo for () { // Storage: Nonfungible Allowance (r:1 w:0) // Storage: Nonfungible Owned (r:0 w:2) fn transfer() -> Weight { - (24_376_000 as Weight) + (25_248_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } // Storage: Nonfungible TokenData (r:1 w:0) // Storage: Nonfungible Allowance (r:1 w:1) fn approve() -> Weight { - (15_890_000 as Weight) + (16_321_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -289,7 +295,7 @@ impl WeightInfo for () { // Storage: Nonfungible AccountBalance (r:2 w:2) // Storage: Nonfungible Owned (r:0 w:2) fn transfer_from() -> Weight { - (28_634_000 as Weight) + (29_325_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } @@ -301,15 +307,15 @@ impl WeightInfo for () { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (32_201_000 as Weight) + (33_323_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Common CollectionPropertyPermissions (r:1 w:1) fn set_token_property_permissions(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 57_000 - .saturating_add((15_232_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 62_000 + .saturating_add((16_222_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -317,8 +323,8 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:1 w:1) fn set_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_648_000 - .saturating_add((288_654_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_750_000 + .saturating_add((304_476_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -326,9 +332,14 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:1 w:1) fn delete_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_632_000 - .saturating_add((289_190_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_638_000 + .saturating_add((294_096_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } + // Storage: Nonfungible TokenData (r:1 w:0) + fn token_owner() -> Weight { + (2_986_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + } } diff --git a/pallets/refungible/src/benchmarking.rs b/pallets/refungible/src/benchmarking.rs index 47e824aa27..436af7a3a7 100644 --- a/pallets/refungible/src/benchmarking.rs +++ b/pallets/refungible/src/benchmarking.rs @@ -17,16 +17,19 @@ use super::*; use crate::{Pallet, Config, RefungibleHandle}; -use sp_std::prelude::*; -use pallet_common::benchmarking::{create_collection_raw, property_key, property_value, create_data}; +use core::convert::TryInto; +use core::iter::IntoIterator; use frame_benchmarking::{benchmarks, account}; +use pallet_common::{ + bench_init, + benchmarking::{create_collection_raw, property_key, property_value, create_data}, +}; +use sp_core::H160; +use sp_std::prelude::*; use up_data_structs::{ CollectionMode, MAX_ITEMS_PER_BATCH, MAX_PROPERTIES_PER_ITEM, CUSTOM_DATA_LIMIT, budget::Unlimited, }; -use pallet_common::bench_init; -use core::convert::TryInto; -use core::iter::IntoIterator; const SEED: u32 = 1; @@ -44,6 +47,7 @@ fn create_max_item_data( properties: Default::default(), } } + fn create_max_item( collection: &RefungibleHandle, sender: &T::CrossAccountId, @@ -59,11 +63,12 @@ fn create_collection( ) -> Result, DispatchError> { create_collection_raw( owner, - CollectionMode::NFT, + CollectionMode::ReFungible, >::init_collection, RefungibleHandle::cast, ) } + benchmarks! { create_item { bench_init!{ @@ -277,4 +282,21 @@ benchmarks! { }; let item = create_max_item(&collection, &sender, [(owner.clone(), 100)])?; }: {>::repartition(&collection, &owner, item, 200)?} + + set_parent_nft_unchecked { + bench_init!{ + owner: sub; collection: collection(owner); + sender: cross_from_sub(owner); owner: cross_sub; + }; + let item = create_max_item(&collection, &sender, [(owner.clone(), 100)])?; + + }: {>::set_parent_nft_unchecked(&collection, item, owner, T::CrossAccountId::from_eth(H160::default()))?} + + token_owner { + bench_init!{ + owner: sub; collection: collection(owner); + sender: cross_from_sub(owner); owner: cross_sub; + }; + let item = create_max_item(&collection, &sender, [(owner.clone(), 100)])?; + }: {>::token_owner(collection.id, item)} } diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index c921e8f7f4..8c46a61308 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -148,6 +148,10 @@ impl CommonWeightInfo for CommonWeights { // Refungible token can't have children 0 } + + fn token_owner() -> Weight { + 0 //>::token_owner() + } } fn map_create_data( diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 420667d2ce..5f1a7914e7 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -41,8 +41,8 @@ use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _ use sp_core::H160; use sp_std::{collections::btree_map::BTreeMap, vec::Vec, vec}; use up_data_structs::{ - CollectionId, CollectionPropertiesVec, Property, PropertyKey, PropertyKeyPermission, - PropertyPermission, TokenId, + CollectionId, CollectionPropertiesVec, mapping::TokenAddressMapping, Property, PropertyKey, + PropertyKeyPermission, PropertyPermission, TokenId, }; use crate::{ @@ -413,7 +413,7 @@ impl RefungibleHandle { } /// Returns amount of pieces of `token` that `owner` have -fn balance( +pub fn balance( collection: &RefungibleHandle, token: TokenId, owner: &T::CrossAccountId, @@ -424,7 +424,7 @@ fn balance( } /// Throws if `owner_balance` is lower than total amount of `token` pieces -fn ensure_single_owner( +pub fn ensure_single_owner( collection: &RefungibleHandle, token: TokenId, owner_balance: u128, @@ -788,6 +788,16 @@ impl RefungibleHandle { .map_err(dispatch_to_evm::)?; Ok(true) } + + /// Returns EVM address for refungible token + /// + /// @param token ID of the token + fn token_contract_address(&self, token: uint256) -> Result
{ + Ok(T::EvmTokenAddressMapping::token_to_address( + self.id, + token.try_into().map_err(|_| "token id overflow")?, + )) + } } #[solidity_interface( diff --git a/pallets/refungible/src/erc_token.rs b/pallets/refungible/src/erc_token.rs index e0e67b6363..41fc9e0669 100644 --- a/pallets/refungible/src/erc_token.rs +++ b/pallets/refungible/src/erc_token.rs @@ -20,29 +20,89 @@ //! Method implementations are mostly doing parameter conversion and calling Nonfungible Pallet methods. extern crate alloc; + +#[cfg(not(feature = "std"))] +use alloc::format; + use core::{ char::{REPLACEMENT_CHARACTER, decode_utf16}, convert::TryInto, ops::Deref, }; -use evm_coder::{ToLog, execution::*, generate_stubgen, solidity_interface, types::*, weight}; +use evm_coder::{ToLog, execution::*, generate_stubgen, solidity, solidity_interface, types::*, weight}; use pallet_common::{ CommonWeightInfo, - erc::{CommonEvmHandler, PrecompileResult}, + erc::{CommonEvmHandler, PrecompileResult, static_property::key}, + eth::map_eth_to_id, }; use pallet_evm::{account::CrossAccountId, PrecompileHandle}; use pallet_evm_coder_substrate::{call, dispatch_to_evm, WithRecorder}; use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _}; +use sp_core::H160; use sp_std::vec::Vec; -use up_data_structs::TokenId; +use up_data_structs::{mapping::TokenAddressMapping, PropertyScope, TokenId}; use crate::{ Allowance, Balance, common::CommonWeights, Config, Pallet, RefungibleHandle, SelfWeightOf, - weights::WeightInfo, TotalSupply, + TokenProperties, TotalSupply, weights::WeightInfo, }; pub struct RefungibleTokenHandle(pub RefungibleHandle, pub TokenId); +#[solidity_interface(name = "ERC1633")] +impl RefungibleTokenHandle { + fn parent_token(&self) -> Result
{ + self.consume_store_reads(2)?; + let props = >::get((self.id, self.1)); + let key = key::parent_nft(); + + let key_scoped = PropertyScope::Eth + .apply(key) + .expect("property key shouldn't exceed length limit"); + let value = props.get(&key_scoped).ok_or("key not found")?; + Ok(H160::from_slice(value.as_slice())) + } + + fn parent_token_id(&self) -> Result { + self.consume_store_reads(2)?; + let props = >::get((self.id, self.1)); + let key = key::parent_nft(); + + let key_scoped = PropertyScope::Eth + .apply(key) + .expect("property key shouldn't exceed length limit"); + let value = props.get(&key_scoped).ok_or("key not found")?; + let nft_token_address = H160::from_slice(value.as_slice()); + let nft_token_account = T::CrossAccountId::from_eth(nft_token_address); + let (_, token_id) = T::CrossTokenAddressMapping::address_to_token(&nft_token_account) + .ok_or("parent NFT should contain NFT token address")?; + + Ok(token_id.into()) + } +} + +#[solidity_interface(name = "ERC1633UniqueExtensions")] +impl RefungibleTokenHandle { + #[solidity(rename_selector = "setParentNFT")] + #[weight(>::token_owner() + >::set_parent_nft_unchecked())] + fn set_parent_nft( + &mut self, + caller: caller, + collection: address, + nft_id: uint256, + ) -> Result { + self.consume_store_reads(1)?; + let caller = T::CrossAccountId::from_eth(caller); + let nft_collection = map_eth_to_id(&collection).ok_or("collection not found")?; + let nft_token = nft_id.try_into()?; + + >::set_parent_nft(&self.0, self.1, caller, nft_collection, nft_token) + .map_err(dispatch_to_evm::)?; + + Ok(true) + } +} + #[derive(ToLog)] pub enum ERC20Events { /// @dev This event is emitted when the amount of tokens (value) is sent @@ -239,7 +299,10 @@ impl Deref for RefungibleTokenHandle { } } -#[solidity_interface(name = "UniqueRefungibleToken", is(ERC20, ERC20UniqueExtensions,))] +#[solidity_interface( + name = "UniqueRefungibleToken", + is(ERC20, ERC20UniqueExtensions, ERC1633, ERC1633UniqueExtensions) +)] impl RefungibleTokenHandle where T::AccountId: From<[u8; 32]> {} generate_stubgen!(gen_impl, UniqueRefungibleTokenCall<()>, true); diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 7912ff7467..2dd2d3e263 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -99,8 +99,12 @@ use frame_support::{ use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; use pallet_evm_coder_substrate::WithRecorder; use pallet_common::{ - CommonCollectionOperations, Error as CommonError, Event as CommonEvent, - eth::collection_id_to_address, Pallet as PalletCommon, + CollectionHandle, CommonCollectionOperations, + dispatch::CollectionDispatch, + erc::static_property::{key, property_value_from_bytes}, + Error as CommonError, + eth::collection_id_to_address, + Event as CommonEvent, Pallet as PalletCommon, }; use pallet_structure::Pallet as PalletStructure; use scale_info::TypeInfo; @@ -108,10 +112,10 @@ use sp_core::H160; use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome}; use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap}; use up_data_structs::{ - AccessMode, budget::Budget, CollectionId, CreateCollectionData, CustomDataLimit, - mapping::TokenAddressMapping, MAX_REFUNGIBLE_PIECES, MAX_ITEMS_PER_BATCH, TokenId, Property, + AccessMode, budget::Budget, CollectionId, CollectionMode, CollectionPropertiesVec, CreateCollectionData, CustomDataLimit, + mapping::TokenAddressMapping, MAX_ITEMS_PER_BATCH, MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission, PropertyPermission, PropertyScope, PropertyValue, - TrySetProperty, CollectionPropertiesVec, + TokenId, TrySetProperty, }; use frame_support::BoundedBTreeMap; use derivative::Derivative; @@ -1341,6 +1345,20 @@ impl Pallet { >::set_token_property_permissions(collection, sender, property_permissions) } + pub fn set_scoped_token_property_permissions( + collection: &RefungibleHandle, + sender: &T::CrossAccountId, + scope: PropertyScope, + property_permissions: Vec, + ) -> DispatchResult { + >::set_scoped_token_property_permissions( + collection, + sender, + scope, + property_permissions, + ) + } + /// Returns 10 token in no particular order. /// /// There is no direct way to get token holders in ascending order, @@ -1362,4 +1380,68 @@ impl Pallet { Some(res) } } + + /// Sets the NFT token as a parent for the RFT token + /// + /// Throws if `sender` is not the owner of the NFT token. + /// Throws if `sender` is not the owner of all of the RFT token pieces. + pub fn set_parent_nft( + collection: &RefungibleHandle, + rft_token_id: TokenId, + sender: T::CrossAccountId, + nft_collection: CollectionId, + nft_token: TokenId, + ) -> DispatchResult { + let handle = >::try_get(nft_collection)?; + if handle.mode != CollectionMode::NFT { + return Err("Only NFT token could be parent to RFT".into()); + } + let dispatch = T::CollectionDispatch::dispatch(handle); + let dispatch = dispatch.as_dyn(); + + let owner = dispatch.token_owner(nft_token).ok_or("owner not found")?; + if owner != sender { + return Err("Only owned token could be set as parent".into()); + } + + let nft_token_address = + T::CrossTokenAddressMapping::token_to_address(nft_collection, nft_token); + + Self::set_parent_nft_unchecked(collection, rft_token_id, sender, nft_token_address) + } + + /// Sets the NFT token as a parent for the RFT token + /// + /// `sender` should be the owner of the NFT token. + /// Throws if `sender` is not the owner of all of the RFT token pieces. + pub fn set_parent_nft_unchecked( + collection: &RefungibleHandle, + rft_token_id: TokenId, + sender: T::CrossAccountId, + nft_token_address: T::CrossAccountId, + ) -> DispatchResult { + let owner_balance = >::get((collection.id, rft_token_id, &sender)); + let total_supply = >::get((collection.id, rft_token_id)); + if total_supply != owner_balance { + return Err("token has multiple owners".into()); + } + + let parent_nft_property_key = key::parent_nft(); + + let parent_nft_property_value = + property_value_from_bytes(&nft_token_address.as_eth().to_fixed_bytes()) + .expect("address should fit in value length limit"); + + >::set_scoped_token_property( + collection.id, + rft_token_id, + PropertyScope::Eth, + Property { + key: parent_nft_property_key, + value: parent_nft_property_value, + }, + )?; + + Ok(()) + } } diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index 1b5e5623abd886b143cea4a64b9dd1ba884edde8..fd3e97a576419147171bba121a9fc78dee6c52d7 100644 GIT binary patch literal 4197 zcmai13vg7`8Q$Z~KC>GVOg6yAW($t?1qAJ45vD9uJE^sJcO|=at~%#r6EO-%A=1HA zxUby}GS$1A0E+Dx>4Q3SoVL&zDy=ge$43XWL+MyYOQkckmg&o>mQqTj-#O>r&0Xyy zVZ(RM`Tzg?=R5!7EIm!Ld3qJq4I}Ri2HIEBsb!P^1?D>@{{Fh4sh`xlfclCwpigV+ zV1Rt5pq1A2k9~=rPSHS~uA(h@dL<1^Ym^v9k7Fiv$PX6j4l`L(HJUct4Fxk+(XTbX zp{3RwwV=^nvxD#RE9?VjXxd2A-ZG)V9)r+yrJb++ps4B)6tgCQZNm`rCyS;rKna1! zvv62d`KO>6IZE)GO(}*jeZB~R^Y~m>&~S`)1An6ST1JQr+bN=$(XKpzJw4x00-BrtpkxD~?x4&K#Ju z$s~BK5yys?DMolcML7Fl`L*1E?xAj1+MOa2D291*_x;4J@O9 zciy8q?hO~i0`2a-(3Yj`?6S8p%Fxq2da2kK`gjK;UoYyV^7HeKb+Eu$z=K;aya2c# z@Z{$QjsSkeg`G_42RvIo`+O&BIR|*|@SBG_S+E80!t~f`%x;l;Ni$Hm14}QB6;5I4 zb-&xqsVDD@Sabt zdIQk#%q%#v`BVqH>~<_=e>!U}U>D%(J?rm=`+s#I6!<E9@T{YB&#iVssFOi`B778cxrlnBNPS^$$*FlCOIe3DQ0AsMqdr>l$SBjH%D zDb71WjxWv_389cNMP)&xKg5{w(VD};%lYKJuF3Eku_WrqR7!DbNnsVDena8yO(S9U zK*N*&q!H=#YedYZ5o#Dy4tO32+ujkQ*Gox$^qGTjFK1|I_9nK{zZM(hqlWD!z1E=L zW^1l#bi_Z3-`X_V$VZ+{xu&v~gZxSa#hl+6XX7vVM~RlEk=WEzmdEl&QqQ}X#2DAR zSCWhxpBwya>Sg-76v%ENEO<3;GVv{Ocl`FzngYBN{5L83KNj_jj#xq=d_cys>{bD^ zHCvh8#ey|C&4T+(7QCmRP1Hs6!G@m1At_;GL>Qe;DRYe^H@HvE`@5pAmuB^xgVx7? zMF%s@_U44}i*8okUBd0BL9SziYvnDmCmT%C2PGyxjQ=y|$ z-ptfgE-vZt_I*t*ve22bS;2103R+E7>uOy*4gy9_xAQb0Iz9_`7V$nP6NBU`7BNX4 z^5?mC@G5*248eSrki4eSUg3Y;sdK;Tun5M|2$BHk=T6ux^cPGuE-Or>A8JOhrAsHL z@PrUo=EeZ3k$0-FcmLsi77MQ{Xp=NO;Y^Usgc}Arj8nV983_MG8n-faFksIxpyTbs z!f&_~gx{)KuwUc zxoWzbOsXo2fELis1GtXS2;WwWY8ZW)Qg`I2_1(2eT#LJ#ce2P{&+L>fSl~vU=7Awb zxbQ5F3vK=@b=|0loRFGk!%cD2i2I6Qk#{S&OA!ws0|q@ZqA{tc`a=d>y9vV?jrJAs z5y7m|Ugg=B&!>iH^H-85VtS#N7O^+oZ0UHmB!Y(aM;4K7mKG!(yijn!fver|>0L>pa)V z)&(PsVj+?nKQUFR9wR2C6Dp|aNPB1L$PBYm?X5-Ifsi!eRq zDSo$+U%Za_v&N15)?=RNFD*CKKFDe-f6?RV(_l4Dl9yJu0=Zl!x}|cnSBZu0ITFkKUa>?!ufBqFQIcef zX_WNDkf*l63wOVYkBr2_p5)&5OG?^sp%$8rz1E<_G6D4Hld!f01U3}{t)%$7_rAB;P(QNl z^1J7rd+xcvbIv{Q(J`9K)7znesY4cqb)5O1Ep`_fkPqKd!d}Ehth&AJ^1g zg?y)=l~yhr`Vt*WQzcIq)8;&#O_gzt62s_p&6E!P-Xh&?rmCt&GiHksfW#^`uIjF@ zQmd|7&}f(0%J=y#_JK1rV`ONTLujzmAT(2M;d6(Jst!dVH3@7RhLFEhG>tWs5U8Al z!>Y=^1?7{+)0&d z?@%3aLtvQF;>CqFFKl5=-^3_O$2#>=aY5+At&D6a>ZOPKetfi*DK7#(7kugjV8w%N zEbvjlpAQvYX=Ba9fWMkOz6J0A;1%b}8Ng=&|9SNCQNSaBZ;uZx0qmCBO5<&;>5rIl z&dmIUn9@tNKli@i!F?}3xflv>Lg9%|?fwy@TL7Q_$kFwHL%x}92hBU+ZU$2vV(K%1 z10Og&2k>6NFYjD&7u;P5xMNms9;DrXJI`-$y+aH={Mw6aT8pi<_rk}Yc@Sne zrAzF2w*d}txPS9TZ_B%%8(jx@3DQ-Y&;JeZDxi8|8xV|Tsq)c>?M!d-coY&+#$f@PzqiMXn;J_A=dh9 zz$+Y%{~-X#;~SYV^#-gYiYN!%6|Cub)^vCwZDzrF$l&G^1x`nCb#<^H4 zM(|DA=BJxj7dy&FKErWk(r82DDA6=&^d5}rHsu^heSn8VP|W$AFr4_xq|uSaQBrJL zUo717M`B$)Fv$<`O=n7yaV7WkE=~WE{v{2vn+a>ah)5<^i`en#qmwB7;{I=1^nXn1 zSsl65#)2P|xh$KDf-YnSrna+SPKsG@xygbZ1#P4zdIdK0HPE?u_8M7{Mq}wfhmqn2 zmrHqL6KiOFIlae4r{W*ca7?phI<`Ap#Fqtk@w4S!nVnrGpp3c?J-~5^V~!~ zB2!uLtx0Z)J=$4lY7t+tf`#6X9x5!OkXY~-8laK4X~rrO(hAj2dIo3)4K!nsMO3Ns z-b$)&HD9Lzjm2^}Q=v^#-^^B3t}f~D_pQiD78-HPGIo2lpjB11rq)C+SBxIr&QnD+ zXcjtML_2qgL3+v-F-e}V&>`*}_v$w=1oIU_@|sG!g#R_S#{H_nA{fgcNfgk}ov>Nx z8xYll6`msfP_u$9T{?LX9bbgZ%K^mGKULU|e|WjY!l{BbN;4zw2+59kX`sV6wac7= z@MdY;%GSVuJ;8vEM->)+#G@d*zhdo?6pW}eS0*4#YJA^wj)jkx%}OInYK@-)d+Ahn zDq^$WNo9Ky&*8uOoBXR{dYg=@DvQMMOay~S;2K6V__ktH#prfQy^*Wd_Ekp_7H>EI zWRazw*~lteu)vM1<%uCi2zU<1#cKYMYrU+9=yIi5cT*fSa=l`{fG9A)1AUITl4P&pJG3 zqYj@k#htFw+slhmuw?EfdDYIV z)iS|97DYEv^#lCrkN?#R%DteNKmJmb17 z_O*hh@4Mv`4aF5Z=R0{}B9`#c%RN7$!qtCxstsktk2_I3@sy_#?{Y*2kEkp@SCj~^ zag=XPWFn;v$-+&?SNRLIdVTSGtg&jm%#ZK#RV~XawRf``=MUg$9(7jZKac{j8bA5} zSdG6Tl_#;v;@2cW4dllE#0$gEiA0;{8SiQQybZaK@E&9*>Xjcm;n#m6U%$T52gNmC zx`{uLS_$v|(;IL0`liEjQzT-&=fSXdewO&2ZQ?fJePNVet=xTdl58>cD?K^QTbAtf)4g#?0~yIr`&tO4U@&vG6L(k|XsuStn2Bi>x!QRm#K?503`k%aVvY-XU4?Y>_43KuB)l zwb0Dl?d`bPOtN2A)k{1e^MQ|Nx>gW@X%WC3e zzVmcn|F#FW-`71g)3)g+Zv;nv`258)D^6YQ-hXP=im$F)d;jdxoO#aGlS}5D?%V#* x=F;bs$Q0#cgB$y|XG#xk9UNe#!3=Q!mTjBYZ&|-}aD88e){@<4lQs@8x diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index b845478293..7f96dde220 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -413,7 +413,100 @@ contract ERC721Enumerable is Dummy, ERC165 { } } -// Selector: 7d9262e6 +// Selector: 7c3bef89 +contract ERC721UniqueExtensions is Dummy, ERC165 { + // @notice Transfer ownership of an RFT + // @dev Throws unless `msg.sender` is the current owner. Throws if `to` + // is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param to The new owner + // @param tokenId The RFT to transfer + // @param _value Not used for an RFT + // + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 tokenId) public { + require(false, stub_error); + to; + tokenId; + dummy = 0; + } + + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this RFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param from The current owner of the RFT + // @param tokenId The RFT to transfer + // @param _value Not used for an RFT + // + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 tokenId) public { + require(false, stub_error); + from; + tokenId; + dummy = 0; + } + + // @notice Returns next free RFT ID. + // + // Selector: nextTokenId() 75794a3c + function nextTokenId() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } + + // @notice Function to mint multiple tokens. + // @dev `tokenIds` should be an array of consecutive numbers and first number + // should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokenIds IDs of the minted RFTs + // + // Selector: mintBulk(address,uint256[]) 44a9945e + function mintBulk(address to, uint256[] memory tokenIds) + public + returns (bool) + { + require(false, stub_error); + to; + tokenIds; + dummy = 0; + return false; + } + + // @notice Function to mint multiple tokens with the given tokenUris. + // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // numbers and first number should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokens array of pairs of token ID and token URI for minted tokens + // + // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 + function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + public + returns (bool) + { + require(false, stub_error); + to; + tokens; + dummy = 0; + return false; + } + + // Returns EVM address for refungible token + // + // @param token ID of the token + // + // Selector: tokenContractAddress(uint256) ab76fac6 + function tokenContractAddress(uint256 token) public view returns (address) { + require(false, stub_error); + token; + dummy; + return 0x0000000000000000000000000000000000000000; + } +} + +// Selector: aa7d570d contract Collection is Dummy, ERC165 { // Set collection property. // @@ -638,86 +731,27 @@ contract Collection is Dummy, ERC165 { mode; dummy = 0; } -} - -// Selector: d74d154f -contract ERC721UniqueExtensions is Dummy, ERC165 { - // @notice Transfer ownership of an RFT - // @dev Throws unless `msg.sender` is the current owner. Throws if `to` - // is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param to The new owner - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT - // - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 tokenId) public { - require(false, stub_error); - to; - tokenId; - dummy = 0; - } - - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this RFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param from The current owner of the RFT - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT - // - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 tokenId) public { - require(false, stub_error); - from; - tokenId; - dummy = 0; - } - // @notice Returns next free RFT ID. + // Check that account is the owner or admin of the collection // - // Selector: nextTokenId() 75794a3c - function nextTokenId() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } - - // @notice Function to mint multiple tokens. - // @dev `tokenIds` should be an array of consecutive numbers and first number - // should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokenIds IDs of the minted RFTs + // @return "true" if account is the owner or admin // - // Selector: mintBulk(address,uint256[]) 44a9945e - function mintBulk(address to, uint256[] memory tokenIds) - public - returns (bool) - { + // Selector: verifyOwnerOrAdmin() 04a46053 + function verifyOwnerOrAdmin() public returns (bool) { require(false, stub_error); - to; - tokenIds; dummy = 0; return false; } - // @notice Function to mint multiple tokens with the given tokenUris. - // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // numbers and first number should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokens array of pairs of token ID and token URI for minted tokens + // Returns collection type // - // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 - function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) - public - returns (bool) - { + // @return `Fungible` or `NFT` or `ReFungible` + // + // Selector: uniqueCollectionType() d34b55b8 + function uniqueCollectionType() public returns (string memory) { require(false, stub_error); - to; - tokens; dummy = 0; - return false; + return ""; } } diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.sol b/pallets/refungible/src/stubs/UniqueRefungibleToken.sol index 81266cc206..395be601c9 100644 --- a/pallets/refungible/src/stubs/UniqueRefungibleToken.sol +++ b/pallets/refungible/src/stubs/UniqueRefungibleToken.sol @@ -31,6 +31,38 @@ contract ERC20Events { ); } +// Selector: 042f1106 +contract ERC1633UniqueExtensions is Dummy, ERC165 { + // Selector: setParentNFT(address,uint256) 042f1106 + function setParentNFT(address collection, uint256 nftId) + public + returns (bool) + { + require(false, stub_error); + collection; + nftId; + dummy = 0; + return false; + } +} + +// Selector: 5755c3f2 +contract ERC1633 is Dummy, ERC165 { + // Selector: parentToken() 80a54001 + function parentToken() public view returns (address) { + require(false, stub_error); + dummy; + return 0x0000000000000000000000000000000000000000; + } + + // Selector: parentTokenId() d7f083f3 + function parentTokenId() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } +} + // Selector: 942e8b22 contract ERC20 is Dummy, ERC165, ERC20Events { // @return the name of the token. @@ -178,4 +210,11 @@ contract ERC20UniqueExtensions is Dummy, ERC165 { } } -contract UniqueRefungibleToken is Dummy, ERC165, ERC20, ERC20UniqueExtensions {} +contract UniqueRefungibleToken is + Dummy, + ERC165, + ERC20, + ERC20UniqueExtensions, + ERC1633, + ERC1633UniqueExtensions +{} diff --git a/pallets/refungible/src/weights.rs b/pallets/refungible/src/weights.rs index 234ae4f3c7..afbdaf3d52 100644 --- a/pallets/refungible/src/weights.rs +++ b/pallets/refungible/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_refungible //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-07-20, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-08-01, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -53,6 +53,8 @@ pub trait WeightInfo { fn set_token_properties(b: u32, ) -> Weight; fn delete_token_properties(b: u32, ) -> Weight; fn repartition_item() -> Weight; + fn set_parent_nft_unchecked() -> Weight; + fn token_owner() -> Weight; } /// Weights for pallet_refungible using the Substrate node and recommended hardware. @@ -65,7 +67,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) fn create_item() -> Weight { - (21_310_000 as Weight) + (25_197_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -76,9 +78,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TokenData (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (9_552_000 as Weight) + (10_852_000 as Weight) // Standard Error: 2_000 - .saturating_add((7_056_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((8_087_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) @@ -90,9 +92,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TokenData (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_items(b: u32, ) -> Weight { - (4_857_000 as Weight) + (9_978_000 as Weight) // Standard Error: 2_000 - .saturating_add((9_838_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((10_848_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -105,9 +107,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible Balance (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight { - (11_335_000 as Weight) + (15_419_000 as Weight) // Standard Error: 2_000 - .saturating_add((6_784_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((7_813_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(3 as Weight)) @@ -118,7 +120,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn burn_item_partial() -> Weight { - (21_239_000 as Weight) + (25_578_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -130,13 +132,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible Owned (r:0 w:1) // Storage: Refungible TokenProperties (r:0 w:1) fn burn_item_fully() -> Weight { - (29_426_000 as Weight) + (33_593_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(7 as Weight)) } // Storage: Refungible Balance (r:2 w:2) fn transfer_normal() -> Weight { - (17_743_000 as Weight) + (21_049_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -144,7 +146,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_creating() -> Weight { - (20_699_000 as Weight) + (24_646_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -152,7 +154,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_removing() -> Weight { - (22_833_000 as Weight) + (26_570_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -160,21 +162,21 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible AccountBalance (r:2 w:2) // Storage: Refungible Owned (r:0 w:2) fn transfer_creating_removing() -> Weight { - (24_936_000 as Weight) + (28_906_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Refungible Balance (r:1 w:0) // Storage: Refungible Allowance (r:0 w:1) fn approve() -> Weight { - (13_446_000 as Weight) + (16_451_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) fn transfer_from_normal() -> Weight { - (24_777_000 as Weight) + (29_545_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -183,7 +185,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_creating() -> Weight { - (28_483_000 as Weight) + (33_392_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -192,7 +194,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_removing() -> Weight { - (29_896_000 as Weight) + (35_446_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -201,7 +203,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible AccountBalance (r:2 w:2) // Storage: Refungible Owned (r:0 w:2) fn transfer_from_creating_removing() -> Weight { - (32_070_000 as Weight) + (37_762_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(7 as Weight)) } @@ -214,15 +216,15 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible Owned (r:0 w:1) // Storage: Refungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (36_789_000 as Weight) + (42_620_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } // Storage: Common CollectionPropertyPermissions (r:1 w:1) fn set_token_property_permissions(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 62_000 - .saturating_add((15_803_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 65_000 + .saturating_add((16_513_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -230,8 +232,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TokenProperties (r:1 w:1) fn set_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_668_000 - .saturating_add((302_308_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_583_000 + .saturating_add((291_392_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -239,18 +241,31 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TokenProperties (r:1 w:1) fn delete_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_619_000 - .saturating_add((294_574_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_699_000 + .saturating_add((293_270_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Refungible TotalSupply (r:1 w:1) // Storage: Refungible Balance (r:1 w:1) fn repartition_item() -> Weight { - (8_325_000 as Weight) + (19_206_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } + // Storage: Refungible Balance (r:1 w:0) + // Storage: Refungible TotalSupply (r:1 w:0) + // Storage: Refungible TokenProperties (r:1 w:1) + fn set_parent_nft_unchecked() -> Weight { + (10_189_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Refungible Balance (r:2 w:0) + fn token_owner() -> Weight { + (8_205_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + } } // For backwards compatibility and tests @@ -262,7 +277,7 @@ impl WeightInfo for () { // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) fn create_item() -> Weight { - (21_310_000 as Weight) + (25_197_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } @@ -273,9 +288,9 @@ impl WeightInfo for () { // Storage: Refungible TokenData (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (9_552_000 as Weight) + (10_852_000 as Weight) // Standard Error: 2_000 - .saturating_add((7_056_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((8_087_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) @@ -287,9 +302,9 @@ impl WeightInfo for () { // Storage: Refungible TokenData (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_items(b: u32, ) -> Weight { - (4_857_000 as Weight) + (9_978_000 as Weight) // Standard Error: 2_000 - .saturating_add((9_838_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((10_848_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -302,9 +317,9 @@ impl WeightInfo for () { // Storage: Refungible Balance (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight { - (11_335_000 as Weight) + (15_419_000 as Weight) // Standard Error: 2_000 - .saturating_add((6_784_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((7_813_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) @@ -315,7 +330,7 @@ impl WeightInfo for () { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn burn_item_partial() -> Weight { - (21_239_000 as Weight) + (25_578_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -327,13 +342,13 @@ impl WeightInfo for () { // Storage: Refungible Owned (r:0 w:1) // Storage: Refungible TokenProperties (r:0 w:1) fn burn_item_fully() -> Weight { - (29_426_000 as Weight) + (33_593_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(7 as Weight)) } // Storage: Refungible Balance (r:2 w:2) fn transfer_normal() -> Weight { - (17_743_000 as Weight) + (21_049_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -341,7 +356,7 @@ impl WeightInfo for () { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_creating() -> Weight { - (20_699_000 as Weight) + (24_646_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -349,7 +364,7 @@ impl WeightInfo for () { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_removing() -> Weight { - (22_833_000 as Weight) + (26_570_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -357,21 +372,21 @@ impl WeightInfo for () { // Storage: Refungible AccountBalance (r:2 w:2) // Storage: Refungible Owned (r:0 w:2) fn transfer_creating_removing() -> Weight { - (24_936_000 as Weight) + (28_906_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Refungible Balance (r:1 w:0) // Storage: Refungible Allowance (r:0 w:1) fn approve() -> Weight { - (13_446_000 as Weight) + (16_451_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) fn transfer_from_normal() -> Weight { - (24_777_000 as Weight) + (29_545_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -380,7 +395,7 @@ impl WeightInfo for () { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_creating() -> Weight { - (28_483_000 as Weight) + (33_392_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -389,7 +404,7 @@ impl WeightInfo for () { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_removing() -> Weight { - (29_896_000 as Weight) + (35_446_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -398,7 +413,7 @@ impl WeightInfo for () { // Storage: Refungible AccountBalance (r:2 w:2) // Storage: Refungible Owned (r:0 w:2) fn transfer_from_creating_removing() -> Weight { - (32_070_000 as Weight) + (37_762_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(7 as Weight)) } @@ -411,15 +426,15 @@ impl WeightInfo for () { // Storage: Refungible Owned (r:0 w:1) // Storage: Refungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (36_789_000 as Weight) + (42_620_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) } // Storage: Common CollectionPropertyPermissions (r:1 w:1) fn set_token_property_permissions(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 62_000 - .saturating_add((15_803_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 65_000 + .saturating_add((16_513_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -427,8 +442,8 @@ impl WeightInfo for () { // Storage: Refungible TokenProperties (r:1 w:1) fn set_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_668_000 - .saturating_add((302_308_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_583_000 + .saturating_add((291_392_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -436,16 +451,29 @@ impl WeightInfo for () { // Storage: Refungible TokenProperties (r:1 w:1) fn delete_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_619_000 - .saturating_add((294_574_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_699_000 + .saturating_add((293_270_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Refungible TotalSupply (r:1 w:1) // Storage: Refungible Balance (r:1 w:1) fn repartition_item() -> Weight { - (8_325_000 as Weight) + (19_206_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } + // Storage: Refungible Balance (r:1 w:0) + // Storage: Refungible TotalSupply (r:1 w:0) + // Storage: Refungible TokenProperties (r:1 w:1) + fn set_parent_nft_unchecked() -> Weight { + (10_189_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Refungible Balance (r:2 w:0) + fn token_owner() -> Weight { + (8_205_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + } } diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 1707bb9a0b..7bde2ee4d4 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -17,26 +17,29 @@ //! Implementation of CollectionHelpers contract. use core::marker::PhantomData; -use evm_coder::{execution::*, generate_stubgen, solidity_interface, solidity, weight, types::*}; use ethereum as _; -use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder}; -use pallet_evm::{OnMethodCall, PrecompileResult, account::CrossAccountId, PrecompileHandle}; -use up_data_structs::{ - CollectionName, CollectionDescription, CollectionTokenPrefix, CreateCollectionData, - CollectionMode, PropertyValue, -}; +use evm_coder::{execution::*, generate_stubgen, solidity_interface, solidity, weight, types::*}; use frame_support::traits::Get; use pallet_common::{ - CollectionById, + CollectionById, CollectionHandle, + dispatch::CollectionDispatch, erc::{ - static_property::{key, value as property_value}, CollectionHelpersEvents, + static_property::{key, value as property_value}, }, - dispatch::CollectionDispatch, + Pallet as PalletCommon, }; -use crate::{SelfWeightOf, Config, weights::WeightInfo}; +use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder}; +use pallet_evm::{account::CrossAccountId, OnMethodCall, PrecompileHandle, PrecompileResult}; +use pallet_evm_coder_substrate::dispatch_to_evm; +use up_data_structs::{ + CollectionName, CollectionDescription, CollectionTokenPrefix, CreateCollectionData, + CollectionMode, PropertyKeyPermission, PropertyPermission, PropertyScope, PropertyValue, +}; + +use crate::{Config, SelfWeightOf, weights::WeightInfo}; -use sp_std::vec::Vec; +use sp_std::{vec, vec::Vec}; use alloc::format; /// See [`CollectionHelpersCall`] @@ -151,6 +154,54 @@ fn make_data( Ok(data) } +fn parent_nft_property_permissions() -> PropertyKeyPermission { + PropertyKeyPermission { + key: key::parent_nft(), + permission: PropertyPermission { + mutable: false, + collection_admin: false, + token_owner: true, + }, + } +} + +fn create_refungible_collection_internal< + T: Config + pallet_nonfungible::Config + pallet_refungible::Config, +>( + caller: caller, + name: string, + description: string, + token_prefix: string, + base_uri: string, + add_properties: bool, +) -> Result
{ + let (caller, name, description, token_prefix, base_uri_value) = + convert_data::(caller, name, description, token_prefix, base_uri)?; + let data = make_data::( + name, + CollectionMode::ReFungible, + description, + token_prefix, + base_uri_value, + add_properties, + )?; + + let collection_id = T::CollectionDispatch::create(caller.clone(), data) + .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; + + let handle = >::try_get(collection_id).map_err(dispatch_to_evm::)?; + >::set_scoped_token_property_permissions( + &handle, + &caller, + PropertyScope::Eth, + vec![parent_nft_property_permissions()], + ) + .map_err(dispatch_to_evm::)?; + + let address = pallet_common::eth::collection_id_to_address(collection_id); + Ok(address) +} + /// @title Contract, which allows users to operate with collections #[solidity_interface(name = "CollectionHelpers", events(CollectionHelpersEvents))] impl EvmCollectionHelpers @@ -216,27 +267,20 @@ where #[weight(>::create_collection())] fn create_refungible_collection( - &self, + &mut self, caller: caller, name: string, description: string, token_prefix: string, ) -> Result
{ - let (caller, name, description, token_prefix, _base_uri) = - convert_data::(caller, name, description, token_prefix, "".into())?; - let data = make_data::( + create_refungible_collection_internal::( + caller, name, - CollectionMode::ReFungible, description, token_prefix, Default::default(), false, - )?; - let collection_id = T::CollectionDispatch::create(caller, data) - .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; - - let address = pallet_common::eth::collection_id_to_address(collection_id); - Ok(address) + ) } #[weight(>::create_collection())] @@ -249,21 +293,14 @@ where token_prefix: string, base_uri: string, ) -> Result
{ - let (caller, name, description, token_prefix, base_uri_value) = - convert_data::(caller, name, description, token_prefix, base_uri)?; - let data = make_data::( + create_refungible_collection_internal::( + caller, name, - CollectionMode::NFT, description, token_prefix, - base_uri_value, + base_uri, true, - )?; - let collection_id = T::CollectionDispatch::create(caller, data) - .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; - - let address = pallet_common::eth::collection_id_to_address(collection_id); - Ok(address) + ) } /// Check if a collection exists diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.sol b/pallets/unique/src/eth/stubs/CollectionHelpers.sol index aedb610b7d..a5cd0598bf 100644 --- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol +++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol @@ -72,12 +72,12 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory name, string memory description, string memory tokenPrefix - ) public view returns (address) { + ) public returns (address) { require(false, stub_error); name; description; tokenPrefix; - dummy; + dummy = 0; return 0x0000000000000000000000000000000000000000; } @@ -96,7 +96,7 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { dummy = 0; return 0x0000000000000000000000000000000000000000; } - + // Check if a collection exists // @param collection_address Address of the collection in question // @return bool Does the collection exist? diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 9180f3d050..9f0cceae9e 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -1050,6 +1050,7 @@ pub enum PropertiesError { pub enum PropertyScope { None, Rmrk, + Eth, } impl PropertyScope { @@ -1058,6 +1059,7 @@ impl PropertyScope { let scope_str: &[u8] = match self { Self::None => return Ok(key), Self::Rmrk => b"rmrk", + Self::Eth => b"eth", }; [scope_str, b":", key.as_slice()] diff --git a/runtime/common/src/weights.rs b/runtime/common/src/weights.rs index f926c8d5ab..a777cd6c6e 100644 --- a/runtime/common/src/weights.rs +++ b/runtime/common/src/weights.rs @@ -99,6 +99,10 @@ where fn burn_recursively_breadth_raw(amount: u32) -> Weight { max_weight_of!(burn_recursively_breadth_raw(amount)) } + + fn token_owner() -> Weight { + max_weight_of!(token_owner()) + } } impl RefungibleExtensionsWeightInfo for CommonWeights diff --git a/tests/src/eth/api/CollectionHelpers.sol b/tests/src/eth/api/CollectionHelpers.sol index a469cac25f..ad3c31a69f 100644 --- a/tests/src/eth/api/CollectionHelpers.sol +++ b/tests/src/eth/api/CollectionHelpers.sol @@ -48,7 +48,7 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory name, string memory description, string memory tokenPrefix - ) external view returns (address); + ) external returns (address); // Selector: createERC721MetadataCompatibleRFTCollection(string,string,string,string) a5596388 function createERC721MetadataCompatibleRFTCollection( @@ -57,7 +57,7 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory tokenPrefix, string memory baseUri ) external returns (address); - + // Check if a collection exists // @param collection_address Address of the collection in question // @return bool Does the collection exist? diff --git a/tests/src/eth/api/UniqueFungible.sol b/tests/src/eth/api/UniqueFungible.sol index da09eaa64e..30d0c224b1 100644 --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -28,7 +28,44 @@ interface ERC20UniqueExtensions is Dummy, ERC165 { function burnFrom(address from, uint256 amount) external returns (bool); } -// Selector: 7d9262e6 +// Selector: 942e8b22 +interface ERC20 is Dummy, ERC165, ERC20Events { + // Selector: name() 06fdde03 + function name() external view returns (string memory); + + // Selector: symbol() 95d89b41 + function symbol() external view returns (string memory); + + // Selector: totalSupply() 18160ddd + function totalSupply() external view returns (uint256); + + // Selector: decimals() 313ce567 + function decimals() external view returns (uint8); + + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) external view returns (uint256); + + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 amount) external returns (bool); + + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 amount + ) external returns (bool); + + // Selector: approve(address,uint256) 095ea7b3 + function approve(address spender, uint256 amount) external returns (bool); + + // Selector: allowance(address,address) dd62ed3e + function allowance(address owner, address spender) + external + view + returns (uint256); +} + +// Selector: aa7d570d interface Collection is Dummy, ERC165 { // Set collection property. // @@ -174,43 +211,16 @@ interface Collection is Dummy, ERC165 { // // Selector: setCollectionMintMode(bool) 00018e84 function setCollectionMintMode(bool mode) external; -} - -// Selector: 942e8b22 -interface ERC20 is Dummy, ERC165, ERC20Events { - // Selector: name() 06fdde03 - function name() external view returns (string memory); - // Selector: symbol() 95d89b41 - function symbol() external view returns (string memory); - - // Selector: totalSupply() 18160ddd - function totalSupply() external view returns (uint256); - - // Selector: decimals() 313ce567 - function decimals() external view returns (uint8); - - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) external view returns (uint256); - - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 amount) external returns (bool); - - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 amount - ) external returns (bool); - - // Selector: approve(address,uint256) 095ea7b3 - function approve(address spender, uint256 amount) external returns (bool); + // Check that account is the owner or admin of the collection + // + // @return "true" if account is the owner or admin + // + // Selector: verifyOwnerOrAdmin() 04a46053 + function verifyOwnerOrAdmin() external returns (bool); - // Selector: allowance(address,address) dd62ed3e - function allowance(address owner, address spender) - external - view - returns (uint256); + // Selector: uniqueCollectionType() d34b55b8 + function uniqueCollectionType() external returns (string memory); } interface UniqueFungible is diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index 5d45e501b7..5a77225805 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -276,7 +276,7 @@ interface ERC721Enumerable is Dummy, ERC165 { function totalSupply() external view returns (uint256); } -// Selector: 7d9262e6 +// Selector: aa7d570d interface Collection is Dummy, ERC165 { // Set collection property. // @@ -422,6 +422,16 @@ interface Collection is Dummy, ERC165 { // // Selector: setCollectionMintMode(bool) 00018e84 function setCollectionMintMode(bool mode) external; + + // Check that account is the owner or admin of the collection + // + // @return "true" if account is the owner or admin + // + // Selector: verifyOwnerOrAdmin() 04a46053 + function verifyOwnerOrAdmin() external returns (bool); + + // Selector: uniqueCollectionType() d34b55b8 + function uniqueCollectionType() external returns (string memory); } // Selector: d74d154f diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index 75d5615a0c..b9e292eaf0 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -274,7 +274,70 @@ interface ERC721Enumerable is Dummy, ERC165 { function totalSupply() external view returns (uint256); } -// Selector: 7d9262e6 +// Selector: 7c3bef89 +interface ERC721UniqueExtensions is Dummy, ERC165 { + // @notice Transfer ownership of an RFT + // @dev Throws unless `msg.sender` is the current owner. Throws if `to` + // is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param to The new owner + // @param tokenId The RFT to transfer + // @param _value Not used for an RFT + // + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 tokenId) external; + + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this RFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param from The current owner of the RFT + // @param tokenId The RFT to transfer + // @param _value Not used for an RFT + // + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 tokenId) external; + + // @notice Returns next free RFT ID. + // + // Selector: nextTokenId() 75794a3c + function nextTokenId() external view returns (uint256); + + // @notice Function to mint multiple tokens. + // @dev `tokenIds` should be an array of consecutive numbers and first number + // should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokenIds IDs of the minted RFTs + // + // Selector: mintBulk(address,uint256[]) 44a9945e + function mintBulk(address to, uint256[] memory tokenIds) + external + returns (bool); + + // @notice Function to mint multiple tokens with the given tokenUris. + // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // numbers and first number should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokens array of pairs of token ID and token URI for minted tokens + // + // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 + function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + external + returns (bool); + + // Returns EVM address for refungible token + // + // @param token ID of the token + // + // Selector: tokenContractAddress(uint256) ab76fac6 + function tokenContractAddress(uint256 token) + external + view + returns (address); +} + +// Selector: aa7d570d interface Collection is Dummy, ERC165 { // Set collection property. // @@ -420,59 +483,20 @@ interface Collection is Dummy, ERC165 { // // Selector: setCollectionMintMode(bool) 00018e84 function setCollectionMintMode(bool mode) external; -} - -// Selector: d74d154f -interface ERC721UniqueExtensions is Dummy, ERC165 { - // @notice Transfer ownership of an RFT - // @dev Throws unless `msg.sender` is the current owner. Throws if `to` - // is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param to The new owner - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT - // - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 tokenId) external; - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this RFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param from The current owner of the RFT - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT + // Check that account is the owner or admin of the collection // - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 tokenId) external; - - // @notice Returns next free RFT ID. + // @return "true" if account is the owner or admin // - // Selector: nextTokenId() 75794a3c - function nextTokenId() external view returns (uint256); + // Selector: verifyOwnerOrAdmin() 04a46053 + function verifyOwnerOrAdmin() external returns (bool); - // @notice Function to mint multiple tokens. - // @dev `tokenIds` should be an array of consecutive numbers and first number - // should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokenIds IDs of the minted RFTs + // Returns collection type // - // Selector: mintBulk(address,uint256[]) 44a9945e - function mintBulk(address to, uint256[] memory tokenIds) - external - returns (bool); - - // @notice Function to mint multiple tokens with the given tokenUris. - // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // numbers and first number should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokens array of pairs of token ID and token URI for minted tokens + // @return `Fungible` or `NFT` or `ReFungible` // - // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 - function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) - external - returns (bool); + // Selector: uniqueCollectionType() d34b55b8 + function uniqueCollectionType() external returns (string memory); } interface UniqueRefungible is diff --git a/tests/src/eth/api/UniqueRefungibleToken.sol b/tests/src/eth/api/UniqueRefungibleToken.sol index 5a35bf4488..13373419e2 100644 --- a/tests/src/eth/api/UniqueRefungibleToken.sol +++ b/tests/src/eth/api/UniqueRefungibleToken.sol @@ -22,6 +22,23 @@ interface ERC20Events { ); } +// Selector: 042f1106 +interface ERC1633UniqueExtensions is Dummy, ERC165 { + // Selector: setParentNFT(address,uint256) 042f1106 + function setParentNFT(address collection, uint256 nftId) + external + returns (bool); +} + +// Selector: 5755c3f2 +interface ERC1633 is Dummy, ERC165 { + // Selector: parentToken() 80a54001 + function parentToken() external view returns (address); + + // Selector: parentTokenId() d7f083f3 + function parentTokenId() external view returns (uint256); +} + // Selector: 942e8b22 interface ERC20 is Dummy, ERC165, ERC20Events { // @return the name of the token. @@ -115,5 +132,7 @@ interface UniqueRefungibleToken is Dummy, ERC165, ERC20, - ERC20UniqueExtensions + ERC20UniqueExtensions, + ERC1633, + ERC1633UniqueExtensions {} diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index cbd18c77a6..4b4126a78c 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -480,6 +480,15 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "token", "type": "uint256" } + ], + "name": "tokenContractAddress", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, @@ -526,5 +535,19 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [], + "name": "uniqueCollectionType", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "verifyOwnerOrAdmin", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" } ] diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 16d959bb56..aeeda5ef3e 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {approve, createCollection, createRefungibleToken, transfer, transferFrom, UNIQUE} from '../util/helpers'; -import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth} from './util/helpers'; +import {collectionIdFromAddress, collectionIdToAddress, createEthAccount, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from './util/helpers'; import reFungibleTokenAbi from './reFungibleTokenAbi.json'; import chai from 'chai'; @@ -630,3 +630,31 @@ describe('Refungible: Substrate calls', () => { ]); }); }); + +describe('ERC 1633 implementation', () => { + itWeb3('Parent NFT token address and id', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); + const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); + const nftTokenId = await nftContract.methods.nextTokenId().call(); + await nftContract.methods.mint(owner, nftTokenId).send(); + const nftCollectionId = collectionIdFromAddress(nftCollectionAddress); + + const {collectionIdAddress, collectionId} = await createRefungibleCollection(api, web3, owner); + const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner); + const refungibleTokenId = await refungibleContract.methods.nextTokenId().call(); + await refungibleContract.methods.mint(owner, refungibleTokenId).send(); + + const rftTokenAddress = tokenIdToAddress(collectionId, refungibleTokenId); + const refungibleTokenContract = uniqueRefungibleToken(web3, rftTokenAddress, owner); + await refungibleTokenContract.methods.setParentNFT(nftCollectionAddress, nftTokenId).send(); + + const tokenAddress = await refungibleTokenContract.methods.parentToken().call(); + const tokenId = await refungibleTokenContract.methods.parentTokenId().call(); + const nftTokenAddress = tokenIdToAddress(nftCollectionId, nftTokenId); + expect(tokenAddress).to.be.equal(nftTokenAddress); + expect(tokenId).to.be.equal(nftTokenId); + }); +}); + diff --git a/tests/src/eth/reFungibleTokenAbi.json b/tests/src/eth/reFungibleTokenAbi.json index 5523e22b86..9e89d3919f 100644 --- a/tests/src/eth/reFungibleTokenAbi.json +++ b/tests/src/eth/reFungibleTokenAbi.json @@ -102,6 +102,20 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "parentToken", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "parentTokenId", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "uint256", "name": "amount", "type": "uint256" } @@ -111,6 +125,16 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "uint256", "name": "nftId", "type": "uint256" } + ], + "name": "setParentNFT", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" } From 42f7f34eac79a3e8c6f1c354bf7f62db2e1e2dcf Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0306/1274] feat(refungible-pallet): fractionalizer contract --- tests/package.json | 2 + .../src/eth/fractionalizer/Fractionalizer.bin | 1 + .../src/eth/fractionalizer/Fractionalizer.sol | 144 ++++++++++++++ .../eth/fractionalizer/FractionalizerAbi.json | 1 + .../eth/fractionalizer/fractionalizer.test.ts | 176 ++++++++++++++++++ tests/src/eth/util/helpers.ts | 51 +++++ tests/yarn.lock | 24 +++ 7 files changed, 399 insertions(+) create mode 100644 tests/src/eth/fractionalizer/Fractionalizer.bin create mode 100644 tests/src/eth/fractionalizer/Fractionalizer.sol create mode 100644 tests/src/eth/fractionalizer/FractionalizerAbi.json create mode 100644 tests/src/eth/fractionalizer/fractionalizer.test.ts diff --git a/tests/package.json b/tests/package.json index 15f6b5eba6..8ff66fedeb 100644 --- a/tests/package.json +++ b/tests/package.json @@ -8,6 +8,7 @@ "@polkadot/typegen": "8.7.2-15", "@types/chai": "^4.3.1", "@types/chai-as-promised": "^7.1.5", + "@types/chai-like": "^1.1.1", "@types/mocha": "^9.1.1", "@types/node": "^17.0.35", "@typescript-eslint/eslint-plugin": "^5.26.0", @@ -96,6 +97,7 @@ "@polkadot/util-crypto": "9.4.1", "bignumber.js": "^9.0.2", "chai-as-promised": "^7.1.1", + "chai-like": "^1.1.1", "find-process": "^1.4.7", "solc": "0.8.14-fixed", "web3": "^1.7.3" diff --git a/tests/src/eth/fractionalizer/Fractionalizer.bin b/tests/src/eth/fractionalizer/Fractionalizer.bin new file mode 100644 index 0000000000..2886900858 --- /dev/null +++ b/tests/src/eth/fractionalizer/Fractionalizer.bin @@ -0,0 +1 @@ +60c0604052600a60805269526546756e6769626c6560b01b60a0527fcdb72fd4e1d0d6d4eebd7ab142113ec2b4b06ddb24324db5c287ef01ab484d6b60055534801561004a57600080fd5b50600480546001600160a01b031916331790556113cd8061006c6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063115091401461005c578063b12527f814610071578063d470e60f14610084578063dbc38ad214610097578063f0d4cf5f146100aa575b600080fd5b61006f61006a366004610f34565b6100bd565b005b61006f61007f366004610f66565b6102b8565b61006f610092366004610f9f565b610345565b61006f6100a5366004610fcb565b610722565b61006f6100b8366004611062565b610dc4565b6004546001600160a01b031633146100f05760405162461bcd60e51b81526004016100e7906110fc565b60405180910390fd5b6000546001600160a01b0316156101495760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b60008190506000816001600160a01b031663d34b55b86040518163ffffffff1660e01b81526004016000604051808303816000875af1158015610190573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101b8919081019061113a565b90506005548180519060200120146101e25760405162461bcd60e51b81526004016100e79061120a565b816001600160a01b03166304a460536040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610222573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102469190611267565b6102625760405162461bcd60e51b81526004016100e79061120a565b600080546001600160a01b0319166001600160a01b0385169081179091556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef9060200160405180910390a1505050565b6004546001600160a01b031633146102e25760405162461bcd60e51b81526004016100e7906110fc565b6001600160a01b038216600081815260016020908152604091829020805460ff19168515159081179091558251938452908301527f6dad0aed33f4b7f07095619b668698e17943fd9f4c83e7cfcc7f6dd880a11588910160405180910390a15050565b6000546001600160a01b03166103995760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546001600160a01b038381169116146103ed5760405162461bcd60e51b81526020600482015260146024820152732bb937b7339029232a1031b7b63632b1ba34b7b760611b60448201526064016100e7565b600080546040516355bb7d6360e11b8152600481018490526001600160a01b039091169190829063ab76fac690602401602060405180830381865afa15801561043a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045e9190611284565b6001600160a01b0380821660009081526003602090815260409182902082518084019093528054909316808352600190930154908201529192506104e45760405162461bcd60e51b815260206004820181905260248201527f4e6f20636f72726573706f6e64696e67204e465420746f6b656e20666f756e6460448201526064016100e7565b6000829050806001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610527573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054b91906112a1565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a0823190602401602060405180830381865afa15801561058f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b391906112a1565b1461060f5760405162461bcd60e51b815260206004820152602660248201527f4e6f7420616c6c2070696563657320617265206f776e6564206279207468652060448201526531b0b63632b960d11b60648201526084016100e7565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd9061063f90339030908a906004016112ba565b600060405180830381600087803b15801561065957600080fd5b505af115801561066d573d6000803e3d6000fd5b5050835160208501516040516323b872dd60e01b81526001600160a01b0390921693506323b872dd92506106a791309133916004016112ba565b600060405180830381600087803b1580156106c157600080fd5b505af11580156106d5573d6000803e3d6000fd5b5050835160208501516040517fd2628c68a4330ea5ba2e16305b03a4e974e760e86f302d43e6bc00c28918cb2294506107129350879291906112ba565b60405180910390a1505050505050565b6000546001600160a01b03166107765760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546040516331a9108f60e11b8152600481018490526001600160a01b0391821691339190861690636352211e90602401602060405180830381865afa1580156107c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e99190611284565b6001600160a01b03161461080f5760405162461bcd60e51b81526004016100e7906112de565b6001600160a01b03841660009081526001602081905260409091205460ff161515146108a35760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a6174696f6e206f66207468697320636f6c6c656360448201527f74696f6e206973206e6f7420616c6c6f7765642062792061646d696e0000000060648201526084016100e7565b6040516331a9108f60e11b81526004810184905233906001600160a01b03861690636352211e90602401602060405180830381865afa1580156108ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090e9190611284565b6001600160a01b0316146109345760405162461bcd60e51b81526004016100e7906112de565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd90610964903390309088906004016112ba565b600060405180830381600087803b15801561097e57600080fd5b505af1158015610992573d6000803e3d6000fd5b505050506001600160a01b0384166000908152600260209081526040808320868452909152812054819081908103610bde57836001600160a01b03166375794a3c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2691906112a1565b6040516340c10f1960e01b8152306004820152602481018290529093506001600160a01b038516906340c10f19906044016020604051808303816000875af1158015610a76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9a9190611267565b506040516355bb7d6360e11b8152600481018490526001600160a01b0385169063ab76fac690602401602060405180830381865afa158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b049190611284565b6001600160a01b0388811660008181526002602090815260408083208c84528252808320899055805180820182528481528083018d8152878716808652600390945293829020905181546001600160a01b0319169616959095178555915160019094019390935551630217888360e11b81526004810191909152602481018990529193508392509063042f1106906044016020604051808303816000875af1158015610bb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd89190611267565b50610c6f565b6001600160a01b0387811660009081526002602090815260408083208a8452909152908190205490516355bb7d6360e11b8152600481018290529094509085169063ab76fac690602401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c699190611284565b91508190505b60405163d2418ca760e01b81526001600160801b03861660048201526001600160a01b0382169063d2418ca7906024016020604051808303816000875af1158015610cbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce29190611267565b5060405163a9059cbb60e01b81523360048201526001600160801b03861660248201526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610d38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5c9190611267565b50604080516001600160a01b03808a168252602082018990528416918101919091526001600160801b03861660608201527f29f372538523984f33874da1b50e596ce0f180a6eb04d7ff22bb2ce80e1576b6906080015b60405180910390a150505050505050565b6004546001600160a01b03163314610dee5760405162461bcd60e51b81526004016100e7906110fc565b6000546001600160a01b031615610e475760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b6040516344a68ad560e01b8152736c4e9fe1ae37a41e93cee429e8e1881abdcbb54f9081906344a68ad590610e8a908a908a908a908a908a908a9060040161134e565b6020604051808303816000875af1158015610ea9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecd9190611284565b600080546001600160a01b0319166001600160a01b039290921691821790556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef90602001610db3565b6001600160a01b0381168114610f3157600080fd5b50565b600060208284031215610f4657600080fd5b8135610f5181610f1c565b9392505050565b8015158114610f3157600080fd5b60008060408385031215610f7957600080fd5b8235610f8481610f1c565b91506020830135610f9481610f58565b809150509250929050565b60008060408385031215610fb257600080fd5b8235610fbd81610f1c565b946020939093013593505050565b600080600060608486031215610fe057600080fd5b8335610feb81610f1c565b92506020840135915060408401356001600160801b038116811461100e57600080fd5b809150509250925092565b60008083601f84011261102b57600080fd5b50813567ffffffffffffffff81111561104357600080fd5b60208301915083602082850101111561105b57600080fd5b9250929050565b6000806000806000806060878903121561107b57600080fd5b863567ffffffffffffffff8082111561109357600080fd5b61109f8a838b01611019565b909850965060208901359150808211156110b857600080fd5b6110c48a838b01611019565b909650945060408901359150808211156110dd57600080fd5b506110ea89828a01611019565b979a9699509497509295939492505050565b6020808252600e908201526d27b7363c9037bbb732b91031b0b760911b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561114d57600080fd5b825167ffffffffffffffff8082111561116557600080fd5b818501915085601f83011261117957600080fd5b81518181111561118b5761118b611124565b604051601f8201601f19908116603f011681019083821181831017156111b3576111b3611124565b8160405282815288868487010111156111cb57600080fd5b600093505b828410156111ed57848401860151818501870152928501926111d0565b828411156111fe5760008684830101525b98975050505050505050565b6020808252603c908201527f4672616374696f6e616c697a657220636f6e74726163742073686f756c64206260408201527f6520616e2061646d696e206f662074686520636f6c6c656374696f6e00000000606082015260800190565b60006020828403121561127957600080fd5b8151610f5181610f58565b60006020828403121561129657600080fd5b8151610f5181610f1c565b6000602082840312156112b357600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526027908201527f4f6e6c7920746f6b656e206f776e657220636f756c64206672616374696f6e616040820152661b1a5e99481a5d60ca1b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061136260608301888a611325565b8281036020840152611375818789611325565b9050828103604084015261138a818587611325565b999850505050505050505056fea264697066735822122090a1bec1bb2c2216359e5312618175ac644676d83b7b03f8f2c378700aedd5fe64736f6c634300080f0033 \ No newline at end of file diff --git a/tests/src/eth/fractionalizer/Fractionalizer.sol b/tests/src/eth/fractionalizer/Fractionalizer.sol new file mode 100644 index 0000000000..e5f035022b --- /dev/null +++ b/tests/src/eth/fractionalizer/Fractionalizer.sol @@ -0,0 +1,144 @@ +// SPDX-License-Identifier: Apache License +pragma solidity >=0.8.0; +import {CollectionHelpers} from "../api/CollectionHelpers.sol"; +import {ContractHelpers} from "../api/ContractHelpers.sol"; +import {UniqueRefungibleToken} from "../api/UniqueRefungibleToken.sol"; +import {UniqueRefungible} from "../api/UniqueRefungible.sol"; +import {UniqueNFT} from "../api/UniqueNFT.sol"; + +contract Fractionalizer { + struct Token { + address _collection; + uint256 _tokenId; + } + address rftCollection; + mapping(address => bool) nftCollectionAllowList; + mapping(address => mapping(uint256 => uint256)) nft2rftMapping; + mapping(address => Token) rft2nftMapping; + address owner; + bytes32 refungibleCollectionType = keccak256(bytes("ReFungible")); + + constructor() { + owner = msg.sender; + } + + modifier onlyOwner() { + require(msg.sender == owner, "Only owner can"); + _; + } + + event RFTCollectionSet(address _collection); + event AllowListSet(address _collection, bool _status); + event Fractionalized(address _collection, uint256 _tokenId, address _rftToken, uint128 _amount); + event DeFractionalized(address _rftToken, address _nftCollection, uint256 _nftTokenId); + + function setRFTCollection(address _collection) public onlyOwner { + require( + rftCollection == address(0), + "RFT collection is already set" + ); + UniqueRefungible refungibleContract = UniqueRefungible(_collection); + string memory collectionType = refungibleContract.uniqueCollectionType(); + + require( + keccak256(bytes(collectionType)) == refungibleCollectionType, + "Fractionalizer contract should be an admin of the collection" + ); + require( + refungibleContract.verifyOwnerOrAdmin(), + "Fractionalizer contract should be an admin of the collection" + ); + rftCollection = _collection; + emit RFTCollectionSet(rftCollection); + } + + function mintRFTCollection(string calldata _name, string calldata _description, string calldata _tokenPrefix) public onlyOwner { + require( + rftCollection == address(0), + "RFT collection is already set" + ); + address collectionHelpers = 0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F; + rftCollection = CollectionHelpers(collectionHelpers).createRefungibleCollection(_name, _description, _tokenPrefix); + emit RFTCollectionSet(rftCollection); + } + + function setAllowlist(address collection, bool status) public onlyOwner { + nftCollectionAllowList[collection] = status; + emit AllowListSet(collection, status); + } + + function nft2rft(address _collection, uint256 _token, uint128 _pieces) public { + require( + rftCollection != address(0), + "RFT collection is not set" + ); + UniqueRefungible rftCollectionContract = UniqueRefungible(rftCollection); + require( + UniqueNFT(_collection).ownerOf(_token) == msg.sender, + "Only token owner could fractionalize it" + ); + require( + nftCollectionAllowList[_collection] == true, + "Fractionalization of this collection is not allowed by admin" + ); + require( + UniqueNFT(_collection).ownerOf(_token) == msg.sender, + "Only token owner could fractionalize it" + ); + UniqueNFT(_collection).transferFrom( + msg.sender, + address(this), + _token + ); + uint256 rftTokenId; + address rftTokenAddress; + UniqueRefungibleToken rftTokenContract; + if (nft2rftMapping[_collection][_token] == 0) { + rftTokenId = rftCollectionContract.nextTokenId(); + rftCollectionContract.mint(address(this), rftTokenId); + rftTokenAddress = rftCollectionContract.tokenContractAddress(rftTokenId); + nft2rftMapping[_collection][_token] = rftTokenId; + rft2nftMapping[rftTokenAddress] = Token(_collection, _token); + + rftTokenContract = UniqueRefungibleToken(rftTokenAddress); + rftTokenContract.setParentNFT(_collection, _token); + } else { + rftTokenId = nft2rftMapping[_collection][_token]; + rftTokenAddress = rftCollectionContract.tokenContractAddress(rftTokenId); + rftTokenContract = UniqueRefungibleToken(rftTokenAddress); + } + rftTokenContract.repartition(_pieces); + rftTokenContract.transfer(msg.sender, _pieces); + emit Fractionalized(_collection, _token, rftTokenAddress, _pieces); + } + + function rft2nft(address _collection, uint256 _token) public { + require( + rftCollection != address(0), + "RFT collection is not set" + ); + require( + rftCollection == _collection, + "Wrong RFT collection" + ); + UniqueRefungible rftCollectionContract = UniqueRefungible(rftCollection); + address rftTokenAddress = rftCollectionContract.tokenContractAddress(_token); + Token memory nftToken = rft2nftMapping[rftTokenAddress]; + require( + nftToken._collection != address(0), + "No corresponding NFT token found" + ); + UniqueRefungibleToken rftTokenContract = UniqueRefungibleToken(rftTokenAddress); + require( + rftTokenContract.balanceOf(msg.sender) == rftTokenContract.totalSupply(), + "Not all pieces are owned by the caller" + ); + rftCollectionContract.transferFrom(msg.sender, address(this), _token); + UniqueNFT(nftToken._collection).transferFrom( + address(this), + msg.sender, + nftToken._tokenId + ); + emit DeFractionalized(rftTokenAddress, nftToken._collection, nftToken._tokenId); + } +} \ No newline at end of file diff --git a/tests/src/eth/fractionalizer/FractionalizerAbi.json b/tests/src/eth/fractionalizer/FractionalizerAbi.json new file mode 100644 index 0000000000..ed7cf8f607 --- /dev/null +++ b/tests/src/eth/fractionalizer/FractionalizerAbi.json @@ -0,0 +1 @@ +[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_collection","type":"address"},{"indexed":false,"internalType":"bool","name":"_status","type":"bool"}],"name":"AllowListSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_rftToken","type":"address"},{"indexed":false,"internalType":"address","name":"_nftCollection","type":"address"},{"indexed":false,"internalType":"uint256","name":"_nftTokenId","type":"uint256"}],"name":"DeFractionalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_collection","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"_rftToken","type":"address"},{"indexed":false,"internalType":"uint128","name":"_amount","type":"uint128"}],"name":"Fractionalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_collection","type":"address"}],"name":"RFTCollectionSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"msg","type":"string"}],"name":"Test","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"msg","type":"bytes"}],"name":"TestB","type":"event"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_description","type":"string"},{"internalType":"string","name":"_tokenPrefix","type":"string"}],"name":"mintRFTCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"uint256","name":"_token","type":"uint256"},{"internalType":"uint128","name":"_pieces","type":"uint128"}],"name":"nft2rft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"uint256","name":"_token","type":"uint256"}],"name":"rft2nft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setAllowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"}],"name":"setRFTCollection","outputs":[],"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts new file mode 100644 index 0000000000..81b4aa6eff --- /dev/null +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -0,0 +1,176 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + + +import Web3 from 'web3'; +import {ApiPromise} from '@polkadot/api'; +import {evmToAddress} from '@polkadot/util-crypto'; +import {readFile} from 'fs/promises'; +import fractionalizerAbi from './FractionalizerAbi.json'; +import {submitTransactionAsync} from '../../substrate/substrate-api'; +import {UNIQUE} from '../../util/helpers'; +import {collectionIdToAddress, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers'; +import {Contract} from 'web3-eth-contract'; + +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; +import chaiLike from 'chai-like'; +import {IKeyringPair} from '@polkadot/types/types'; +chai.use(chaiAsPromised); +chai.use(chaiLike); +const expect = chai.expect; + +async function deployFractionalizer(api: ApiPromise, web3: Web3, owner: string) { + const fractionalizerContract = new web3.eth.Contract(fractionalizerAbi as any, undefined, { + from: owner, + ...GAS_ARGS, + }); + return await fractionalizerContract.deploy({data: (await readFile(`${__dirname}/Fractionalizer.bin`)).toString()}).send({from: owner}); +} + +async function initFractionalizer(api: ApiPromise, web3: Web3, privateKeyWrapper: (account: string) => IKeyringPair, owner: string) { + const fractionalizer = await deployFractionalizer(api, web3, owner); + const tx = api.tx.balances.transfer(evmToAddress(fractionalizer.options.address), 10n * UNIQUE); + const alice = privateKeyWrapper('//Alice'); + await submitTransactionAsync(alice, tx); + const result = await fractionalizer.methods.mintRFTCollection('A', 'B', 'C').send(); + const rftCollectionAddress = result.events.RFTCollectionSet.returnValues._collection; + return {fractionalizer, rftCollectionAddress}; +} + +async function createRFTToken(api: ApiPromise, web3: Web3, owner: string, fractionalizer: Contract, amount: bigint) { + const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); + const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); + const nftTokenId = await nftContract.methods.nextTokenId().call(); + await nftContract.methods.mint(owner, nftTokenId).send(); + + await fractionalizer.methods.setAllowlist(nftCollectionAddress, true).send(); + await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send(); + const result = await fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, amount).send(); + const {_collection, _tokenId, _rftToken} = result.events.Fractionalized.returnValues; + return { + nftCollectionAddress: _collection, + nftTokenId: _tokenId, + rftTokenAddress: _rftToken, + }; +} + +describe('Fractionalizer contract usage', () => { + itWeb3('Set RFT collection', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const fractionalizer = await deployFractionalizer(api, web3, owner); + const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner); + const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner); + await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send(); + const result = await fractionalizer.methods.setRFTCollection(collectionIdAddress).send(); + expect(result.events).to.be.like({ + RFTCollectionSet: { + returnValues: { + _collection: collectionIdAddress, + }, + }, + }); + }); + + itWeb3('Mint RFT collection', async ({api, web3, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const fractionalizer = await deployFractionalizer(api, web3, owner); + const tx = api.tx.balances.transfer(evmToAddress(fractionalizer.options.address), 10n * UNIQUE); + await submitTransactionAsync(alice, tx); + + const result = await fractionalizer.methods.mintRFTCollection('A', 'B', 'C').send({from: owner}); + expect(result.events).to.be.like({ + RFTCollectionSet: {}, + }); + expect(result.events.RFTCollectionSet.returnValues._collection).to.be.ok; + }); + + itWeb3('Set Allowlist', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); + + const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); + const result1 = await fractionalizer.methods.setAllowlist(nftCollectionAddress, true).send({from: owner}); + expect(result1.events).to.be.like({ + AllowListSet: { + returnValues: { + _collection: nftCollectionAddress, + _status: true, + }, + }, + }); + const result2 = await fractionalizer.methods.setAllowlist(nftCollectionAddress, false).send({from: owner}); + expect(result2.events).to.be.like({ + AllowListSet: { + returnValues: { + _collection: nftCollectionAddress, + _status: false, + }, + }, + }); + }); + + itWeb3('NFT to RFT', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); + const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); + const nftTokenId = await nftContract.methods.nextTokenId().call(); + await nftContract.methods.mint(owner, nftTokenId).send(); + + const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); + + await fractionalizer.methods.setAllowlist(nftCollectionAddress, true).send(); + await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send(); + const result = await fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).send(); + expect(result.events).to.be.like({ + Fractionalized: { + returnValues: { + _collection: nftCollectionAddress, + _tokenId: nftTokenId, + _amount: '100', + }, + }, + }); + const rftTokenAddress = result.events.Fractionalized.returnValues._rftToken; + const rftTokenContract = uniqueRefungibleToken(web3, rftTokenAddress, owner); + expect(await rftTokenContract.methods.balanceOf(owner).call()).to.equal('100'); + }); + + itWeb3('RFT to NFT', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const {fractionalizer, rftCollectionAddress} = await initFractionalizer(api, web3, privateKeyWrapper, owner); + const {rftTokenAddress, nftCollectionAddress, nftTokenId} = await createRFTToken(api, web3, owner, fractionalizer, 100n); + + const {collectionId, tokenId} = tokenIdFromAddress(rftTokenAddress); + const refungibleAddress = collectionIdToAddress(collectionId); + expect(rftCollectionAddress).to.be.equal(refungibleAddress); + const refungibleTokenContract = uniqueRefungibleToken(web3, rftTokenAddress, owner); + await refungibleTokenContract.methods.approve(fractionalizer.options.address, 100).send(); + const result = await fractionalizer.methods.rft2nft(refungibleAddress, tokenId).send(); + expect(result.events).to.be.like({ + DeFractionalized: { + returnValues: { + _rftToken: rftTokenAddress, + _nftCollection: nftCollectionAddress, + _nftTokenId: nftTokenId, + }, + }, + }); + }); +}); \ No newline at end of file diff --git a/tests/src/eth/util/helpers.ts b/tests/src/eth/util/helpers.ts index bfd4101bec..cb0cead3e3 100644 --- a/tests/src/eth/util/helpers.ts +++ b/tests/src/eth/util/helpers.ts @@ -32,6 +32,7 @@ import collectionHelpersAbi from '../collectionHelpersAbi.json'; import fungibleAbi from '../fungibleAbi.json'; import nonFungibleAbi from '../nonFungibleAbi.json'; import refungibleAbi from '../reFungibleAbi.json'; +import refungibleTokenAbi from '../reFungibleTokenAbi.json'; import contractHelpersAbi from './contractHelpersAbi.json'; export const GAS_ARGS = {gas: 2500000}; @@ -101,6 +102,18 @@ export function tokenIdToAddress(collection: number, token: number): string { ]); return Web3.utils.toChecksumAddress('0x' + buf.toString('hex')); } + +export function tokenIdFromAddress(address: string) { + if (!address.startsWith('0x')) + throw 'address not starts with "0x"'; + if (address.length > 42) + throw 'address length is more than 20 bytes'; + return { + collectionId: Number('0x' + address.substring(address.length - 16, address.length - 8)), + tokenId: Number('0x' + address.substring(address.length - 8)), + }; +} + export function tokenIdToCross(collection: number, token: number): CrossAccountId { return { Ethereum: tokenIdToAddress(collection, token), @@ -128,6 +141,44 @@ export async function transferBalanceToEth(api: ApiPromise, source: IKeyringPair expect(result.success).to.be.true; } +export async function createRefungibleCollection(api: ApiPromise, web3: Web3, owner: string) { + const collectionHelper = evmCollectionHelpers(web3, owner); + const result = await collectionHelper.methods + .createRefungibleCollection('A', 'B', 'C') + .send(); + return await getCollectionAddressFromResult(api, result); +} + + +export async function createNonfungibleCollection(api: ApiPromise, web3: Web3, owner: string) { + const collectionHelper = evmCollectionHelpers(web3, owner); + const result = await collectionHelper.methods + .createNonfungibleCollection('A', 'B', 'C') + .send(); + return await getCollectionAddressFromResult(api, result); +} + +export function uniqueNFT(web3: Web3, address: string, owner: string) { + return new web3.eth.Contract(nonFungibleAbi as any, address, { + from: owner, + ...GAS_ARGS, + }); +} + +export function uniqueRefungible(web3: Web3, collectionAddress: string, owner: string) { + return new web3.eth.Contract(refungibleAbi as any, collectionAddress, { + from: owner, + ...GAS_ARGS, + }); +} + +export function uniqueRefungibleToken(web3: Web3, tokenAddress: string, owner: string) { + return new web3.eth.Contract(refungibleTokenAbi as any, tokenAddress, { + from: owner, + ...GAS_ARGS, + }); +} + export async function itWeb3(name: string, cb: (apis: { web3: Web3, api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean } = {}) { let i: any = it; if (opts.only) i = i.only; diff --git a/tests/yarn.lock b/tests/yarn.lock index 558263f676..f28b0c2cef 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -963,6 +963,20 @@ dependencies: "@types/chai" "*" +"@types/chai-like@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/chai-like/-/chai-like-1.1.1.tgz#c454039b0a2f92664fb5b7b7a2a66c3358783ae7" + integrity sha512-s46EZsupBuVhLn66DbRee5B0SELLmL4nFXVrBiV29BxLGm9Sh7Bful623j3AfiQRu2zAP4cnlZ3ETWB3eWc4bA== + dependencies: + "@types/chai" "*" + +"@types/chai-things@^0.0.35": + version "0.0.35" + resolved "https://registry.yarnpkg.com/@types/chai-things/-/chai-things-0.0.35.tgz#4b5d9ec032067faa62b3bf7bb40dc0bec941945f" + integrity sha512-BC8FwMf9FHj87XT4dgTwbdb8dNRilGqYWGmwLPdJ54YNk6K2PlcFTt68NGHjgPDnms8zIYcOtmPePd0mPNTo/Q== + dependencies: + "@types/chai" "*" + "@types/chai@*", "@types/chai@^4.3.1": version "4.3.1" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.1.tgz#e2c6e73e0bdeb2521d00756d099218e9f5d90a04" @@ -1545,6 +1559,16 @@ chai-as-promised@^7.1.1: dependencies: check-error "^1.0.2" +chai-like@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/chai-like/-/chai-like-1.1.1.tgz#8c558a414c34514e814d497c772547ceb7958f64" + integrity sha512-VKa9z/SnhXhkT1zIjtPACFWSoWsqVoaz1Vg+ecrKo5DCKVlgL30F/pEyEvXPBOVwCgLZcWUleCM/C1okaKdTTA== + +chai-things@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/chai-things/-/chai-things-0.2.0.tgz#c55128378f9bb399e994f00052151984ed6ebe70" + integrity sha512-6ns0SU21xdRCoEXVKH3HGbwnsgfVMXQ+sU5V8PI9rfxaITos8lss1vUxbF1FAcJKjfqmmmLVlr/z3sLes00w+A== + chai@^4.3.6: version "4.3.6" resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.6.tgz#ffe4ba2d9fa9d6680cc0b370adae709ec9011e9c" From 34ddd365a1f768a10e96d11dad47973ae18ec066 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0307/1274] feat(refungible-pallet): fractionalizer compilation script --- .maintain/scripts/compile_fractionalizer.sh | 18 ++++++++++++++++++ Makefile | 5 ++++- .../src/eth/fractionalizer/Fractionalizer.bin | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100755 .maintain/scripts/compile_fractionalizer.sh diff --git a/.maintain/scripts/compile_fractionalizer.sh b/.maintain/scripts/compile_fractionalizer.sh new file mode 100755 index 0000000000..1cb393ff34 --- /dev/null +++ b/.maintain/scripts/compile_fractionalizer.sh @@ -0,0 +1,18 @@ +#!/bin/sh +set -eu + +dir=$PWD + +tmp=$(mktemp -d) +cd $tmp +mkdir refungible +mkdir api +cp $dir/tests/src/eth/fractionalizer/Fractionalizer.sol refungible/input.sol +cp $dir/tests/src/eth/api/CollectionHelpers.sol api/CollectionHelpers.sol +cp $dir/tests/src/eth/api/ContractHelpers.sol api/ContractHelpers.sol +cp $dir/tests/src/eth/api/UniqueRefungibleToken.sol api/UniqueRefungibleToken.sol +cp $dir/tests/src/eth/api/UniqueRefungible.sol api/UniqueRefungible.sol +cp $dir/tests/src/eth/api/UniqueNFT.sol api/UniqueNFT.sol +solcjs --optimize --bin refungible/input.sol -o $PWD + +mv refungible_input_sol_Fractionalizer.bin $dir/tests/src/eth/fractionalizer/Fractionalizer.bin diff --git a/Makefile b/Makefile index f468a410aa..669c2437f0 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,10 @@ CollectionHelpers: CollectionHelpers.sol INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_STUBS)/CollectionHelpers.raw ./.maintain/scripts/compile_stub.sh INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_ABI) ./.maintain/scripts/generate_abi.sh -evm_stubs: UniqueFungible UniqueNFT UniqueRefungible UniqueRefungibleToken ContractHelpers CollectionHelpers +Fractionalizer: + ./.maintain/scripts/compile_fractionalizer.sh + +evm_stubs: UniqueFungible UniqueNFT UniqueRefungible UniqueRefungibleToken ContractHelpers CollectionHelpers Fractionalizer .PHONY: _bench _bench: diff --git a/tests/src/eth/fractionalizer/Fractionalizer.bin b/tests/src/eth/fractionalizer/Fractionalizer.bin index 2886900858..d7812a1047 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.bin +++ b/tests/src/eth/fractionalizer/Fractionalizer.bin @@ -1 +1 @@ -60c0604052600a60805269526546756e6769626c6560b01b60a0527fcdb72fd4e1d0d6d4eebd7ab142113ec2b4b06ddb24324db5c287ef01ab484d6b60055534801561004a57600080fd5b50600480546001600160a01b031916331790556113cd8061006c6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063115091401461005c578063b12527f814610071578063d470e60f14610084578063dbc38ad214610097578063f0d4cf5f146100aa575b600080fd5b61006f61006a366004610f34565b6100bd565b005b61006f61007f366004610f66565b6102b8565b61006f610092366004610f9f565b610345565b61006f6100a5366004610fcb565b610722565b61006f6100b8366004611062565b610dc4565b6004546001600160a01b031633146100f05760405162461bcd60e51b81526004016100e7906110fc565b60405180910390fd5b6000546001600160a01b0316156101495760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b60008190506000816001600160a01b031663d34b55b86040518163ffffffff1660e01b81526004016000604051808303816000875af1158015610190573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101b8919081019061113a565b90506005548180519060200120146101e25760405162461bcd60e51b81526004016100e79061120a565b816001600160a01b03166304a460536040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610222573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102469190611267565b6102625760405162461bcd60e51b81526004016100e79061120a565b600080546001600160a01b0319166001600160a01b0385169081179091556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef9060200160405180910390a1505050565b6004546001600160a01b031633146102e25760405162461bcd60e51b81526004016100e7906110fc565b6001600160a01b038216600081815260016020908152604091829020805460ff19168515159081179091558251938452908301527f6dad0aed33f4b7f07095619b668698e17943fd9f4c83e7cfcc7f6dd880a11588910160405180910390a15050565b6000546001600160a01b03166103995760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546001600160a01b038381169116146103ed5760405162461bcd60e51b81526020600482015260146024820152732bb937b7339029232a1031b7b63632b1ba34b7b760611b60448201526064016100e7565b600080546040516355bb7d6360e11b8152600481018490526001600160a01b039091169190829063ab76fac690602401602060405180830381865afa15801561043a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045e9190611284565b6001600160a01b0380821660009081526003602090815260409182902082518084019093528054909316808352600190930154908201529192506104e45760405162461bcd60e51b815260206004820181905260248201527f4e6f20636f72726573706f6e64696e67204e465420746f6b656e20666f756e6460448201526064016100e7565b6000829050806001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610527573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054b91906112a1565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a0823190602401602060405180830381865afa15801561058f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b391906112a1565b1461060f5760405162461bcd60e51b815260206004820152602660248201527f4e6f7420616c6c2070696563657320617265206f776e6564206279207468652060448201526531b0b63632b960d11b60648201526084016100e7565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd9061063f90339030908a906004016112ba565b600060405180830381600087803b15801561065957600080fd5b505af115801561066d573d6000803e3d6000fd5b5050835160208501516040516323b872dd60e01b81526001600160a01b0390921693506323b872dd92506106a791309133916004016112ba565b600060405180830381600087803b1580156106c157600080fd5b505af11580156106d5573d6000803e3d6000fd5b5050835160208501516040517fd2628c68a4330ea5ba2e16305b03a4e974e760e86f302d43e6bc00c28918cb2294506107129350879291906112ba565b60405180910390a1505050505050565b6000546001600160a01b03166107765760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546040516331a9108f60e11b8152600481018490526001600160a01b0391821691339190861690636352211e90602401602060405180830381865afa1580156107c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e99190611284565b6001600160a01b03161461080f5760405162461bcd60e51b81526004016100e7906112de565b6001600160a01b03841660009081526001602081905260409091205460ff161515146108a35760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a6174696f6e206f66207468697320636f6c6c656360448201527f74696f6e206973206e6f7420616c6c6f7765642062792061646d696e0000000060648201526084016100e7565b6040516331a9108f60e11b81526004810184905233906001600160a01b03861690636352211e90602401602060405180830381865afa1580156108ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090e9190611284565b6001600160a01b0316146109345760405162461bcd60e51b81526004016100e7906112de565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd90610964903390309088906004016112ba565b600060405180830381600087803b15801561097e57600080fd5b505af1158015610992573d6000803e3d6000fd5b505050506001600160a01b0384166000908152600260209081526040808320868452909152812054819081908103610bde57836001600160a01b03166375794a3c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2691906112a1565b6040516340c10f1960e01b8152306004820152602481018290529093506001600160a01b038516906340c10f19906044016020604051808303816000875af1158015610a76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9a9190611267565b506040516355bb7d6360e11b8152600481018490526001600160a01b0385169063ab76fac690602401602060405180830381865afa158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b049190611284565b6001600160a01b0388811660008181526002602090815260408083208c84528252808320899055805180820182528481528083018d8152878716808652600390945293829020905181546001600160a01b0319169616959095178555915160019094019390935551630217888360e11b81526004810191909152602481018990529193508392509063042f1106906044016020604051808303816000875af1158015610bb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd89190611267565b50610c6f565b6001600160a01b0387811660009081526002602090815260408083208a8452909152908190205490516355bb7d6360e11b8152600481018290529094509085169063ab76fac690602401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c699190611284565b91508190505b60405163d2418ca760e01b81526001600160801b03861660048201526001600160a01b0382169063d2418ca7906024016020604051808303816000875af1158015610cbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce29190611267565b5060405163a9059cbb60e01b81523360048201526001600160801b03861660248201526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610d38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5c9190611267565b50604080516001600160a01b03808a168252602082018990528416918101919091526001600160801b03861660608201527f29f372538523984f33874da1b50e596ce0f180a6eb04d7ff22bb2ce80e1576b6906080015b60405180910390a150505050505050565b6004546001600160a01b03163314610dee5760405162461bcd60e51b81526004016100e7906110fc565b6000546001600160a01b031615610e475760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b6040516344a68ad560e01b8152736c4e9fe1ae37a41e93cee429e8e1881abdcbb54f9081906344a68ad590610e8a908a908a908a908a908a908a9060040161134e565b6020604051808303816000875af1158015610ea9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecd9190611284565b600080546001600160a01b0319166001600160a01b039290921691821790556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef90602001610db3565b6001600160a01b0381168114610f3157600080fd5b50565b600060208284031215610f4657600080fd5b8135610f5181610f1c565b9392505050565b8015158114610f3157600080fd5b60008060408385031215610f7957600080fd5b8235610f8481610f1c565b91506020830135610f9481610f58565b809150509250929050565b60008060408385031215610fb257600080fd5b8235610fbd81610f1c565b946020939093013593505050565b600080600060608486031215610fe057600080fd5b8335610feb81610f1c565b92506020840135915060408401356001600160801b038116811461100e57600080fd5b809150509250925092565b60008083601f84011261102b57600080fd5b50813567ffffffffffffffff81111561104357600080fd5b60208301915083602082850101111561105b57600080fd5b9250929050565b6000806000806000806060878903121561107b57600080fd5b863567ffffffffffffffff8082111561109357600080fd5b61109f8a838b01611019565b909850965060208901359150808211156110b857600080fd5b6110c48a838b01611019565b909650945060408901359150808211156110dd57600080fd5b506110ea89828a01611019565b979a9699509497509295939492505050565b6020808252600e908201526d27b7363c9037bbb732b91031b0b760911b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561114d57600080fd5b825167ffffffffffffffff8082111561116557600080fd5b818501915085601f83011261117957600080fd5b81518181111561118b5761118b611124565b604051601f8201601f19908116603f011681019083821181831017156111b3576111b3611124565b8160405282815288868487010111156111cb57600080fd5b600093505b828410156111ed57848401860151818501870152928501926111d0565b828411156111fe5760008684830101525b98975050505050505050565b6020808252603c908201527f4672616374696f6e616c697a657220636f6e74726163742073686f756c64206260408201527f6520616e2061646d696e206f662074686520636f6c6c656374696f6e00000000606082015260800190565b60006020828403121561127957600080fd5b8151610f5181610f58565b60006020828403121561129657600080fd5b8151610f5181610f1c565b6000602082840312156112b357600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526027908201527f4f6e6c7920746f6b656e206f776e657220636f756c64206672616374696f6e616040820152661b1a5e99481a5d60ca1b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061136260608301888a611325565b8281036020840152611375818789611325565b9050828103604084015261138a818587611325565b999850505050505050505056fea264697066735822122090a1bec1bb2c2216359e5312618175ac644676d83b7b03f8f2c378700aedd5fe64736f6c634300080f0033 \ No newline at end of file +60c0604052600a60805269526546756e6769626c6560b01b60a0527fcdb72fd4e1d0d6d4eebd7ab142113ec2b4b06ddb24324db5c287ef01ab484d6b60055534801561004a57600080fd5b50600480546001600160a01b031916331790556113cd8061006c6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063115091401461005c578063b12527f814610071578063d470e60f14610084578063dbc38ad214610097578063f0d4cf5f146100aa575b600080fd5b61006f61006a366004610f34565b6100bd565b005b61006f61007f366004610f66565b6102b8565b61006f610092366004610f9f565b610345565b61006f6100a5366004610fcb565b610722565b61006f6100b8366004611062565b610dc4565b6004546001600160a01b031633146100f05760405162461bcd60e51b81526004016100e7906110fc565b60405180910390fd5b6000546001600160a01b0316156101495760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b60008190506000816001600160a01b031663d34b55b86040518163ffffffff1660e01b81526004016000604051808303816000875af1158015610190573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101b8919081019061113a565b90506005548180519060200120146101e25760405162461bcd60e51b81526004016100e79061120a565b816001600160a01b03166304a460536040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610222573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102469190611267565b6102625760405162461bcd60e51b81526004016100e79061120a565b600080546001600160a01b0319166001600160a01b0385169081179091556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef9060200160405180910390a1505050565b6004546001600160a01b031633146102e25760405162461bcd60e51b81526004016100e7906110fc565b6001600160a01b038216600081815260016020908152604091829020805460ff19168515159081179091558251938452908301527f6dad0aed33f4b7f07095619b668698e17943fd9f4c83e7cfcc7f6dd880a11588910160405180910390a15050565b6000546001600160a01b03166103995760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546001600160a01b038381169116146103ed5760405162461bcd60e51b81526020600482015260146024820152732bb937b7339029232a1031b7b63632b1ba34b7b760611b60448201526064016100e7565b600080546040516355bb7d6360e11b8152600481018490526001600160a01b039091169190829063ab76fac690602401602060405180830381865afa15801561043a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045e9190611284565b6001600160a01b0380821660009081526003602090815260409182902082518084019093528054909316808352600190930154908201529192506104e45760405162461bcd60e51b815260206004820181905260248201527f4e6f20636f72726573706f6e64696e67204e465420746f6b656e20666f756e6460448201526064016100e7565b6000829050806001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610527573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054b91906112a1565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a0823190602401602060405180830381865afa15801561058f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b391906112a1565b1461060f5760405162461bcd60e51b815260206004820152602660248201527f4e6f7420616c6c2070696563657320617265206f776e6564206279207468652060448201526531b0b63632b960d11b60648201526084016100e7565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd9061063f90339030908a906004016112ba565b600060405180830381600087803b15801561065957600080fd5b505af115801561066d573d6000803e3d6000fd5b5050835160208501516040516323b872dd60e01b81526001600160a01b0390921693506323b872dd92506106a791309133916004016112ba565b600060405180830381600087803b1580156106c157600080fd5b505af11580156106d5573d6000803e3d6000fd5b5050835160208501516040517fd2628c68a4330ea5ba2e16305b03a4e974e760e86f302d43e6bc00c28918cb2294506107129350879291906112ba565b60405180910390a1505050505050565b6000546001600160a01b03166107765760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546040516331a9108f60e11b8152600481018490526001600160a01b0391821691339190861690636352211e90602401602060405180830381865afa1580156107c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e99190611284565b6001600160a01b03161461080f5760405162461bcd60e51b81526004016100e7906112de565b6001600160a01b03841660009081526001602081905260409091205460ff161515146108a35760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a6174696f6e206f66207468697320636f6c6c656360448201527f74696f6e206973206e6f7420616c6c6f7765642062792061646d696e0000000060648201526084016100e7565b6040516331a9108f60e11b81526004810184905233906001600160a01b03861690636352211e90602401602060405180830381865afa1580156108ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090e9190611284565b6001600160a01b0316146109345760405162461bcd60e51b81526004016100e7906112de565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd90610964903390309088906004016112ba565b600060405180830381600087803b15801561097e57600080fd5b505af1158015610992573d6000803e3d6000fd5b505050506001600160a01b0384166000908152600260209081526040808320868452909152812054819081908103610bde57836001600160a01b03166375794a3c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2691906112a1565b6040516340c10f1960e01b8152306004820152602481018290529093506001600160a01b038516906340c10f19906044016020604051808303816000875af1158015610a76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9a9190611267565b506040516355bb7d6360e11b8152600481018490526001600160a01b0385169063ab76fac690602401602060405180830381865afa158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b049190611284565b6001600160a01b0388811660008181526002602090815260408083208c84528252808320899055805180820182528481528083018d8152878716808652600390945293829020905181546001600160a01b0319169616959095178555915160019094019390935551630217888360e11b81526004810191909152602481018990529193508392509063042f1106906044016020604051808303816000875af1158015610bb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd89190611267565b50610c6f565b6001600160a01b0387811660009081526002602090815260408083208a8452909152908190205490516355bb7d6360e11b8152600481018290529094509085169063ab76fac690602401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c699190611284565b91508190505b60405163d2418ca760e01b81526001600160801b03861660048201526001600160a01b0382169063d2418ca7906024016020604051808303816000875af1158015610cbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce29190611267565b5060405163a9059cbb60e01b81523360048201526001600160801b03861660248201526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610d38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5c9190611267565b50604080516001600160a01b03808a168252602082018990528416918101919091526001600160801b03861660608201527f29f372538523984f33874da1b50e596ce0f180a6eb04d7ff22bb2ce80e1576b6906080015b60405180910390a150505050505050565b6004546001600160a01b03163314610dee5760405162461bcd60e51b81526004016100e7906110fc565b6000546001600160a01b031615610e475760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b6040516344a68ad560e01b8152736c4e9fe1ae37a41e93cee429e8e1881abdcbb54f9081906344a68ad590610e8a908a908a908a908a908a908a9060040161134e565b6020604051808303816000875af1158015610ea9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecd9190611284565b600080546001600160a01b0319166001600160a01b039290921691821790556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef90602001610db3565b6001600160a01b0381168114610f3157600080fd5b50565b600060208284031215610f4657600080fd5b8135610f5181610f1c565b9392505050565b8015158114610f3157600080fd5b60008060408385031215610f7957600080fd5b8235610f8481610f1c565b91506020830135610f9481610f58565b809150509250929050565b60008060408385031215610fb257600080fd5b8235610fbd81610f1c565b946020939093013593505050565b600080600060608486031215610fe057600080fd5b8335610feb81610f1c565b92506020840135915060408401356001600160801b038116811461100e57600080fd5b809150509250925092565b60008083601f84011261102b57600080fd5b50813567ffffffffffffffff81111561104357600080fd5b60208301915083602082850101111561105b57600080fd5b9250929050565b6000806000806000806060878903121561107b57600080fd5b863567ffffffffffffffff8082111561109357600080fd5b61109f8a838b01611019565b909850965060208901359150808211156110b857600080fd5b6110c48a838b01611019565b909650945060408901359150808211156110dd57600080fd5b506110ea89828a01611019565b979a9699509497509295939492505050565b6020808252600e908201526d27b7363c9037bbb732b91031b0b760911b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561114d57600080fd5b825167ffffffffffffffff8082111561116557600080fd5b818501915085601f83011261117957600080fd5b81518181111561118b5761118b611124565b604051601f8201601f19908116603f011681019083821181831017156111b3576111b3611124565b8160405282815288868487010111156111cb57600080fd5b600093505b828410156111ed57848401860151818501870152928501926111d0565b828411156111fe5760008684830101525b98975050505050505050565b6020808252603c908201527f4672616374696f6e616c697a657220636f6e74726163742073686f756c64206260408201527f6520616e2061646d696e206f662074686520636f6c6c656374696f6e00000000606082015260800190565b60006020828403121561127957600080fd5b8151610f5181610f58565b60006020828403121561129657600080fd5b8151610f5181610f1c565b6000602082840312156112b357600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526027908201527f4f6e6c7920746f6b656e206f776e657220636f756c64206672616374696f6e616040820152661b1a5e99481a5d60ca1b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061136260608301888a611325565b8281036020840152611375818789611325565b9050828103604084015261138a818587611325565b999850505050505050505056fea2646970667358221220851819fa818f0a972e13485d65873363a68504b99a7e320b6067ac22db64ae8364736f6c634300080f0033 \ No newline at end of file From e256f7e1e4e2f0175dfa979d0d0d7275c8c467c4 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0308/1274] tests(refungible-pallet): add negative tests for fractionalizer contract --- .../eth/fractionalizer/fractionalizer.test.ts | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index 81b4aa6eff..74eb34e676 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -173,4 +173,143 @@ describe('Fractionalizer contract usage', () => { }, }); }); +}); + + + +describe('Negative Integration Tests for fractionalizer', () => { + itWeb3('call setRFTCollection twice', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const fractionalizer = await deployFractionalizer(api, web3, owner); + const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner); + const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner); + await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send(); + await fractionalizer.methods.setRFTCollection(collectionIdAddress).send(); + + await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).send()).to.be.eventually.rejected; + }); + + itWeb3('call setRFTCollection with NFT collection', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const fractionalizer = await deployFractionalizer(api, web3, owner); + const {collectionIdAddress} = await createNonfungibleCollection(api, web3, owner); + + await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).send()).to.be.eventually.rejected; + }); + + itWeb3('call setRFTCollection while not collection admin', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const fractionalizer = await deployFractionalizer(api, web3, owner); + const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner); + + await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).send()).to.be.eventually.rejected; + }); + + itWeb3('call setRFTCollection after mintRFTCollection', async ({api, web3, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const fractionalizer = await deployFractionalizer(api, web3, owner); + const tx = api.tx.balances.transfer(evmToAddress(fractionalizer.options.address), 10n * UNIQUE); + await submitTransactionAsync(alice, tx); + + const result = await fractionalizer.methods.mintRFTCollection('A', 'B', 'C').send({from: owner}); + const collectionIdAddress = result.events.RFTCollectionSet.returnValues._collection; + + await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).send()).to.be.eventually.rejected; + }); + + itWeb3('call nft2rft without setting RFT collection for contract', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); + const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); + const nftTokenId = await nftContract.methods.nextTokenId().call(); + await nftContract.methods.mint(owner, nftTokenId).send(); + + const fractionalizer = await deployFractionalizer(api, web3, owner); + + await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).send()).to.be.eventually.rejected; + }); + + itWeb3('call nft2rft while not owner of NFT token', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const nftOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); + const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); + const nftTokenId = await nftContract.methods.nextTokenId().call(); + await nftContract.methods.mint(owner, nftTokenId).send(); + await nftContract.methods.transfer(nftOwner, 1).send(); + + + const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); + + await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).send()).to.be.eventually.rejected; + }); + + itWeb3('call nft2rft while not in list of allowed accounts', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); + const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); + const nftTokenId = await nftContract.methods.nextTokenId().call(); + await nftContract.methods.mint(owner, nftTokenId).send(); + + const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); + + await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send(); + await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).send()).to.be.eventually.rejected; + }); + + itWeb3('call nft2rft while fractionalizer doesnt have approval for nft token', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); + const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); + const nftTokenId = await nftContract.methods.nextTokenId().call(); + await nftContract.methods.mint(owner, nftTokenId).send(); + + const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); + + await fractionalizer.methods.setAllowlist(nftCollectionAddress, true).send(); + await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).send()).to.be.eventually.rejected; + }); + + itWeb3('call rft2nft without setting RFT collection for contract', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const fractionalizer = await deployFractionalizer(api, web3, owner); + const {collectionIdAddress: rftCollectionAddress} = await createRefungibleCollection(api, web3, owner); + const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner); + const rftTokenId = await refungibleContract.methods.nextTokenId().call(); + await refungibleContract.methods.mint(owner, rftTokenId).send(); + + await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).send()).to.be.eventually.rejected; + }); + + itWeb3('call rft2nft for RFT token that is not from configured RFT collection', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); + const {collectionIdAddress: rftCollectionAddress} = await createRefungibleCollection(api, web3, owner); + const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner); + const rftTokenId = await refungibleContract.methods.nextTokenId().call(); + await refungibleContract.methods.mint(owner, rftTokenId).send(); + + await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).send()).to.be.eventually.rejected; + }); + + itWeb3('call rft2nft without owning all RFT pieces', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const receiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const {fractionalizer, rftCollectionAddress} = await initFractionalizer(api, web3, privateKeyWrapper, owner); + const {rftTokenAddress} = await createRFTToken(api, web3, owner, fractionalizer, 100n); + + const {tokenId} = tokenIdFromAddress(rftTokenAddress); + const refungibleTokenContract = uniqueRefungibleToken(web3, rftTokenAddress, owner); + await refungibleTokenContract.methods.transfer(receiver, 50).send(); + await refungibleTokenContract.methods.approve(fractionalizer.options.address, 50).send(); + await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, tokenId).send()).to.be.eventually.rejected; + }); }); \ No newline at end of file From 15c21abe7df6027bfa1f7c82b4bfb1e6ecfb1771 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0309/1274] chore: refactor RFT token tests --- tests/src/eth/reFungible.test.ts | 13 +++++----- tests/src/eth/reFungibleToken.test.ts | 35 +++++++++++++-------------- tests/src/eth/util/helpers.ts | 2 +- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 551a3b3fda..804f02bb26 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -15,8 +15,7 @@ // along with Unique Network. If not, see . import {createCollectionExpectSuccess, UNIQUE} from '../util/helpers'; -import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, tokenIdToAddress} from './util/helpers'; -import reFungibleTokenAbi from './reFungibleTokenAbi.json'; +import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, tokenIdToAddress, uniqueRefungibleToken} from './util/helpers'; import {expect} from 'chai'; describe('Refungible: Information getting', () => { @@ -84,7 +83,7 @@ describe('Refungible: Information getting', () => { await contract.methods.mint(caller, tokenId).send(); const tokenAddress = tokenIdToAddress(collectionId, tokenId); - const tokenContract = new web3.eth.Contract(reFungibleTokenAbi as any, tokenAddress, {from: caller, ...GAS_ARGS}); + const tokenContract = uniqueRefungibleToken(web3, tokenAddress, caller); await tokenContract.methods.repartition(2).send(); await tokenContract.methods.transfer(receiver, 1).send(); @@ -108,7 +107,7 @@ describe('Refungible: Information getting', () => { await contract.methods.mint(caller, tokenId).send(); const tokenAddress = tokenIdToAddress(collectionId, tokenId); - const tokenContract = new web3.eth.Contract(reFungibleTokenAbi as any, tokenAddress, {from: caller, ...GAS_ARGS}); + const tokenContract = uniqueRefungibleToken(web3, tokenAddress, caller); await tokenContract.methods.repartition(2).send(); await tokenContract.methods.transfer(receiver, 1).send(); @@ -250,7 +249,7 @@ describe('Refungible: Plain calls', () => { await contract.methods.mint(caller, tokenId).send(); const address = tokenIdToAddress(collectionId, tokenId); - const tokenContract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: caller, ...GAS_ARGS}); + const tokenContract = uniqueRefungibleToken(web3, address, caller); await tokenContract.methods.repartition(15).send(); { @@ -345,7 +344,7 @@ describe('Refungible: Plain calls', () => { await contract.methods.mint(caller, tokenId).send(); const tokenAddress = tokenIdToAddress(collectionId, tokenId); - const tokenContract = new web3.eth.Contract(reFungibleTokenAbi as any, tokenAddress, {from: caller, ...GAS_ARGS}); + const tokenContract = uniqueRefungibleToken(web3, tokenAddress, caller); await tokenContract.methods.repartition(2).send(); await tokenContract.methods.transfer(receiver, 1).send(); @@ -377,7 +376,7 @@ describe('Refungible: Plain calls', () => { await contract.methods.mint(caller, tokenId).send(); const tokenAddress = tokenIdToAddress(collectionId, tokenId); - const tokenContract = new web3.eth.Contract(reFungibleTokenAbi as any, tokenAddress, {from: caller, ...GAS_ARGS}); + const tokenContract = uniqueRefungibleToken(web3, tokenAddress, caller); await tokenContract.methods.repartition(2).send(); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index aeeda5ef3e..5b135387a2 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -15,8 +15,7 @@ // along with Unique Network. If not, see . import {approve, createCollection, createRefungibleToken, transfer, transferFrom, UNIQUE} from '../util/helpers'; -import {collectionIdFromAddress, collectionIdToAddress, createEthAccount, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from './util/helpers'; -import reFungibleTokenAbi from './reFungibleTokenAbi.json'; +import {collectionIdFromAddress, collectionIdToAddress, createEthAccount, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, evmCollection, evmCollectionHelpers, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from './util/helpers'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; @@ -34,7 +33,7 @@ describe('Refungible token: Information getting', () => { const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: caller})).itemId; const address = tokenIdToAddress(collectionId, tokenId); - const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: caller, ...GAS_ARGS}); + const contract = uniqueRefungibleToken(web3, address, caller); const totalSupply = await contract.methods.totalSupply().call(); expect(totalSupply).to.equal('200'); @@ -50,7 +49,7 @@ describe('Refungible token: Information getting', () => { const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: caller})).itemId; const address = tokenIdToAddress(collectionId, tokenId); - const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: caller, ...GAS_ARGS}); + const contract = uniqueRefungibleToken(web3, address, caller); const balance = await contract.methods.balanceOf(caller).call(); expect(balance).to.equal('200'); @@ -66,7 +65,7 @@ describe('Refungible token: Information getting', () => { const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: caller})).itemId; const address = tokenIdToAddress(collectionId, tokenId); - const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: caller, ...GAS_ARGS}); + const contract = uniqueRefungibleToken(web3, address, caller); const decimals = await contract.methods.decimals().call(); expect(decimals).to.equal('0'); @@ -229,7 +228,7 @@ describe('Refungible: Plain calls', () => { const spender = createEthAccount(web3); - const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + const contract = uniqueRefungibleToken(web3, address, owner); { const result = await contract.methods.approve(spender, 100).send({from: owner}); @@ -270,7 +269,7 @@ describe('Refungible: Plain calls', () => { const receiver = createEthAccount(web3); const address = tokenIdToAddress(collectionId, tokenId); - const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + const contract = uniqueRefungibleToken(web3, address, owner); await contract.methods.approve(spender, 100).send(); @@ -324,7 +323,7 @@ describe('Refungible: Plain calls', () => { await transferBalanceToEth(api, alice, receiver); const address = tokenIdToAddress(collectionId, tokenId); - const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + const contract = uniqueRefungibleToken(web3, address, owner); { const result = await contract.methods.transfer(receiver, 50).send({from: owner}); @@ -367,7 +366,7 @@ describe('Refungible: Plain calls', () => { const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n, {Ethereum: owner})).itemId; const address = tokenIdToAddress(collectionId, tokenId); - const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + const contract = uniqueRefungibleToken(web3, address, owner); await contract.methods.repartition(200).send({from: owner}); expect(+await contract.methods.balanceOf(owner).call()).to.be.equal(200); @@ -397,7 +396,7 @@ describe('Refungible: Plain calls', () => { const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n, {Ethereum: owner})).itemId; const address = tokenIdToAddress(collectionId, tokenId); - const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + const contract = uniqueRefungibleToken(web3, address, owner); const result = await contract.methods.repartition(200).send(); const events = normalizeEvents(result.events); @@ -426,7 +425,7 @@ describe('Refungible: Plain calls', () => { const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n, {Ethereum: owner})).itemId; const address = tokenIdToAddress(collectionId, tokenId); - const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + const contract = uniqueRefungibleToken(web3, address, owner); const result = await contract.methods.repartition(50).send(); const events = normalizeEvents(result.events); @@ -456,7 +455,7 @@ describe('Refungible: Plain calls', () => { const address = tokenIdToAddress(collectionId, tokenId); - const tokenContract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: caller, ...GAS_ARGS}); + const tokenContract = uniqueRefungibleToken(web3, address, caller); await tokenContract.methods.repartition(2).send(); await tokenContract.methods.transfer(receiver, 1).send(); @@ -488,7 +487,7 @@ describe('Refungible: Fees', () => { const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: owner})).itemId; const address = tokenIdToAddress(collectionId, tokenId); - const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + const contract = uniqueRefungibleToken(web3, address, owner); const cost = await recordEthFee(api, owner, () => contract.methods.approve(spender, 100).send({from: owner})); expect(cost < BigInt(0.2 * Number(UNIQUE))); @@ -505,7 +504,7 @@ describe('Refungible: Fees', () => { const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: owner})).itemId; const address = tokenIdToAddress(collectionId, tokenId); - const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + const contract = uniqueRefungibleToken(web3, address, owner); await contract.methods.approve(spender, 100).send({from: owner}); @@ -524,7 +523,7 @@ describe('Refungible: Fees', () => { const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: owner})).itemId; const address = tokenIdToAddress(collectionId, tokenId); - const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address, {from: owner, ...GAS_ARGS}); + const contract = uniqueRefungibleToken(web3, address, owner); const cost = await recordEthFee(api, owner, () => contract.methods.transfer(receiver, 100).send({from: owner})); expect(cost < BigInt(0.2 * Number(UNIQUE))); @@ -542,7 +541,7 @@ describe('Refungible: Substrate calls', () => { const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n)).itemId; const address = tokenIdToAddress(collectionId, tokenId); - const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address); + const contract = uniqueRefungibleToken(web3, address); const events = await recordEvents(contract, async () => { expect(await approve(api, collectionId, tokenId, alice, {Ethereum: receiver}, 100n)).to.be.true; @@ -573,7 +572,7 @@ describe('Refungible: Substrate calls', () => { expect(await approve(api, collectionId, tokenId, alice, bob.address, 100n)).to.be.true; const address = tokenIdToAddress(collectionId, tokenId); - const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address); + const contract = uniqueRefungibleToken(web3, address); const events = await recordEvents(contract, async () => { expect(await transferFrom(api, collectionId, tokenId, bob, alice, {Ethereum: receiver}, 51n)).to.be.true; @@ -611,7 +610,7 @@ describe('Refungible: Substrate calls', () => { const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n)).itemId; const address = tokenIdToAddress(collectionId, tokenId); - const contract = new web3.eth.Contract(reFungibleTokenAbi as any, address); + const contract = uniqueRefungibleToken(web3, address); const events = await recordEvents(contract, async () => { expect(await transfer(api, collectionId, tokenId, alice, {Ethereum: receiver}, 51n)).to.be.true; diff --git a/tests/src/eth/util/helpers.ts b/tests/src/eth/util/helpers.ts index cb0cead3e3..e6a7a90830 100644 --- a/tests/src/eth/util/helpers.ts +++ b/tests/src/eth/util/helpers.ts @@ -172,7 +172,7 @@ export function uniqueRefungible(web3: Web3, collectionAddress: string, owner: s }); } -export function uniqueRefungibleToken(web3: Web3, tokenAddress: string, owner: string) { +export function uniqueRefungibleToken(web3: Web3, tokenAddress: string, owner: string | undefined = undefined) { return new web3.eth.Contract(refungibleTokenAbi as any, tokenAddress, { from: owner, ...GAS_ARGS, From 5da8c4494563ad3e70b0622b294418b829c3c4b9 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0310/1274] chore: update stubs and polkadot types --- pallets/fungible/src/stubs/UniqueFungible.raw | Bin 2777 -> 2807 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 4 ++++ pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4116 -> 4170 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 4 ++++ .../src/stubs/UniqueRefungibleToken.raw | Bin 1477 -> 1574 bytes .../src/eth/stubs/CollectionHelpers.raw | Bin 1488 -> 1488 bytes .../src/eth/stubs/CollectionHelpers.sol | 2 +- tests/src/eth/api/CollectionHelpers.sol | 2 +- tests/src/eth/api/UniqueFungible.sol | 4 ++++ tests/src/eth/api/UniqueNFT.sol | 4 ++++ tests/src/eth/collectionHelpersAbi.json | 2 +- .../src/eth/fractionalizer/Fractionalizer.bin | 2 +- tests/src/eth/fungibleAbi.json | 14 ++++++++++++++ tests/src/eth/nonFungibleAbi.json | 14 ++++++++++++++ tests/src/interfaces/augment-api-query.ts | 2 +- tests/src/interfaces/default/types.ts | 3 ++- tests/src/interfaces/lookup.ts | 2 +- tests/src/interfaces/types-lookup.ts | 3 ++- 18 files changed, 54 insertions(+), 8 deletions(-) diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index 296db91415af690165fa8fdf96d6ac62dbcf6327..b5326c563fe1c562e3991b562ce2935361805e82 100644 GIT binary patch literal 2807 zcmaJ@ZEO@p7~bjL?Hxv?MeeX($z3QCjfxgHuz}zKQJeU+ceJ;dMKjY6Y6+AAr4i7u zpH~P*_pTKrC=jAS68&L7CE_1HPzgvO8bg90F-1i}G!hjIZGC2U@7f}=mrI_RdESqC z-*?^_dX}a#bPCmUJ>#&OPS9PolsHU?I|dU@WL0^F7Gc7@3Kg^gRc6G=s!dPUtzSvc z#;A~?^JpMLCsScSr9{`O93!eRVX;Ct7}30}(u7g2i%fVy87VWVBqQe?IjhpRQ2`rA zVFOOkgr1;ro6umDPG}-mj-|bdtbyiE8U%`Uolk$I7k7r~$Jg_2+#1z>!Nm`{sB^7f{ ztg13fiS5KD*bOiWA;B*CS(%IGRfBs&8kLPXk~SK8Ez*k+=80nwMi#&`+u-Y((ruHp zt8=3hqnD#lt2c0;Wf^=uMw|w?&&EvC7}-gMS}I%`q#DxWrl8zU0S(M7XQUsaBt2WD zHMLq#{ZzroSVe1k_2l+>6-?L-_|0Pt2LM<4a6BuU3V6El;@t5}ybJKJ{XgsnoC)~P z!20M*&99rD+Jcw;Ohr5y8y6n^1yP;Mv4M!kG486b_Pov`mFUYUN{DL z1+(^{JB|SM0T%ijzjUEnP@en#($WX#odP@!R>v-*2Jix4S9NOYNP+4Dt4?FT-B?Q1 zUA+RB^&wbq0nRg@c^q&bpz?rpk3ZYoUA+bHlcLXD4aTit-5+{r3E&#QnmOlM0ZqU; z^7(auZxjWjfiohEeTF3tvBV=f=Gi^_0C`j@?t3_gB03Lvd-N8rJnhRil9w%ig$y0u z12_m$;7z&^q$vvO31^FutBm|TlLnZ07*!x81RZkn z(GgPMaYu*w(%qv*^GA(ZMvg*vjvA#ff@j`luUXqZig}VVvCV28mJna#J02DePvKK@ zOD^+fuq!5xa-8>vbmJqjuj#oMwi6&sT#0Cfc{lQ6iiRfKh(&L(s3kRI2q)xouK>I* zC!iZz;^GRWKdbf>+{OiiMaF=~(37x2&}zj>J<1jGV~<)vqfBd7h6-LI z49r&0HEp7kbj~CO$q*KZqY?7{7kC09G+}lVl2K(ECp2CeEjR_VR#M3GehE=%f^M*g z#R8G6s(E%1HP5WS57?$D)8=~!?DY2#c-v%wHCeTnCVHG6lI-!fqQNS)axV8sk^3#w zgIkbU;76LU;U-3TnWij~bmRj6{qOaXO5>hzz1Kp4#924=j3;V-C3i@#~k|kF(e$@rP_a%eBBbxPd>+L{@|I4V zO%`Gz{q70(*rZ1_ZCse4h{8gW?be8q;q#7-mx=Tz>T?UfH1Yjs@1a?~`}}P2>Kc)b z&_Zu*L^}8h2`%+SLS43z^Rj^h$&;UK;&tYRD&%-9?RpUpz3VON!%=cI`}t>~iaMvH9M~MBsf9FCIvz zi34xd>y#LJ6)Mieqb@ueZ>qcs@4~7Cx3$O|q50 z-+H&b#>3-&*}>h-Z5>NiFPbziv3K$Dy5GL2`EZt=pZoESwf!@yI%e$Xdvr$Etp{_5 z#TAR1SFc#sv_J@t6{dGS*S0#*w4%Lp6>I8D0JkmgSk|(mT`m6t DUen)~ literal 2777 zcmaJ@d2Ccg9DdWc7Z_s;?LysZH&Fb?0}+=aCEAKdji7JWb|3Mf&U9O94J}6-5=6o~ zx1fo>ZA*n{A^~DU42cLDf zo1v#@O^V(^b;C%xZ2WGzWiBNylPX=4NnfTlTsyG%&YE&wxa@LJi zlt(FX+}I?i0ZJhxIe9zFv(cPpa%)JVx;{&iW<#${dJ)1Lac#oLd|2j~d|g+&9Fi1! zu6JYfN)+1~4cul$0pExbw*ls}aiuyVuTyC*l`dVSI?^LjQ0%9G24)pAas;CUJyoG+ zTI|QpmM{`f^-TBa#!pI^v=#7Z)nFUo3LloTq5;6;jlbPf%H;8Ym-n3912`G*&%rhK zfw0R{;B6zudS>JIuhs$;oXpJvejlix(X^ zQCMir>j_Wcda8XV$E>X#CAW_=;bxGBBh1&h$HT&r2%m}6sYZ2@obfj%Y>D2mDx~Wl7g!(Q7Q~2_2ci`FX=jyw}Gh^gCOgP{!o_-ZYaBm`v_V zYdzhfH9=vXanfTL31}f`rgFIv!tA?w}&Kpd{=a6rFK?ucjme8+Jf7yu)s$&?!Zh)<`i0ElZ2~u z^WXnoAT>$c1j2fQv<&&5QDU0Klge0dqKZEYe8cmX^5b1#S%^b00Y*YFSg?*(+F~mN zfdww4HCHi>lx10jGjT!jgJ_yOAhUV&YzxsVWXZ&xKqj!D?Yku(u&jh|Cm4hN;UES5 zxS5H9DLTK*g75p1!OyZt3=4Lk1{A(SBBywaQyxRHV5UKwi7fcLFB2k;32nGNxHe=E zK@<06p?X3n2XP-K#uQ#?mbZYi8X8kig~W!Q$m_{iqBxPBxQ_gcb|K{F-^k*^&3XX| zZOm^kDlgQpvQWQ>xK4wyoWeqT5l9hl+~heF8_C%QaW~kAN$4w2xW^$qn&se13=Kg3 zoFi()O!0Zw!P_JB9qO}>UyJzu<$Ji?H=my^UR@*75l(n(BhtZ7NO*xS5?@b)I+iWX%$FiJNHaU1Y3+z- imbG`TWSP!5aBJK0rOj>4?VZg{@z(ZuJL_y+)%*|s0oJYn diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index b7b7974ddd..bf47f1615a 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -364,6 +364,10 @@ contract Collection is Dummy, ERC165 { return false; } + // Returns collection type + // + // @return `Fungible` or `NFT` or `ReFungible` + // // Selector: uniqueCollectionType() d34b55b8 function uniqueCollectionType() public returns (string memory) { require(false, stub_error); diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index c4699d86ccce797dc6b314d998723ecba30d0fb4..3c4ce0169dd13d037b63d471f1e150c3e2e32660 100644 GIT binary patch literal 4170 zcmai13vg6d8NMf*eP%Z#fh^!MWD970@u+lZJ22xyts)}aY{@S5)_P7hyd0nikr6}9 zeQrW&>)lPDRI5gCrtPRRZN(0XS|6>7(mE|#Z4r%*R`A7i>U4l1jo&%<+|AwAN5Y2h z{OAAw^Z)<(A7|+}%@^p~sBRbqw^wOfK*w&P1W1|Zn)v(MqNZN2cLFUbQAMB7)Lw-= zT-3_zRu6oFj%TP+pet!}fi9rRghq*B%yG@M4*uQ}9W>KbRijz6%?N>Fm4Z_9>QZXe zRf`(!GTZq%zs5N*hGvZ{?Q#eW&oKziR@(U9<0VxGqoA4ux(!3n&y-A~hY|vo@4;YI z<)5NvbW?)gd?sWF)t5?OxP;FQMGbDW8Tb>oH-PZrqGsd2127}2(=MwWp3K1RY8YeV zWU{!VIu_~Hs4|;|DsE=Z>@+2go0;kKK<*6W6vsDub|qcaOko+>R~oL6ZnJ09CZmXJ zmAE#nBpYF+V{+Tck2DQ)szX!Ei**7Pf^a&&x-UM?+(ysMoNv!s{r>if>|cBWhad?ftfNx-9kXFk+( z0&u^CGgxRL;05Qx(=%A}S-{th|Nb~27rQbsunKUacb2CH0$Z{5(}ChSY&{A1iv<%q z0H5)>__^Ski7n^pxBOfv(95+y_5MV{L%;d_N_p-B%Ll&=>M`&hefRNAfRFiVc8!_W z!IS0K;t*T?fVLFhvj}5lY zgNuGSy&GFA0Lz7I=7PEkuy1JoVNllqZn4+DEH!@o#+7FQH~VVlpV)n_oi(ilSN;dn zX2ZrSfU6E~-wOCk3FSHOdt~$u$aa9be*5Xa0A>Nzlj{Zn7x@~w8VJ0Gt(DeC*J7)g ztFafgg8Hz}#m^OMy}UU3-pzndfNOF8?Y99w1-NX(k_h1QfGgAsp9UNU%&)$B8SuQX zCN`_%D$F0j7Khm4uE+0q=o^6iYTFmyQklV;UILt1cwqq4y@0dQDSkSS_PmAnUjh7_ z)Ywbzvn4;7JoOOZMKCpgh29D#o(19OLz;vU*8Ut|7pRem--Q4dmQY0KFs$hxtm*tR z+RVaz$ouA3ikhOaP!nsK5X1_I;Z9UszT55W+SDPxmgZ&+Oju2THay0GV#uS&?(FD6Afr|Jb6jl8?}{h4RzpEC${GhyK* zZZdVZxI2FPm_G_{_y3KH{*O&Prz4kUu<*ycT=qtig4tz-tA((@n12fOtWn!jyqq%hlL;Iz7ziyO=mXLPd2YDlaW5-h?euh5J_V&Q*cY#Ifd zW~~Y#?O@#{70@ikZq_0|QwhbHD3tvdAgN ztPmENThywmT2pJ{1)vz+x?P}(80#!@xr9f6Lk!Ygv4}|u;6KN$gH_QMD1!PSLJFEn zyM+BUx5n+NK_eoTMUp58KR3c=kuxCGFDrVBXNQ^-(b7F5$M8-NS0-}+-N^SU>fe8K z&|=ZGMQxO3N8AyT8%p2LmlQ4; z30%W!9Y0pAs#x7lsa&~g?ND_T*CJ2zJ&W!4)jGC_0#`D^6GN2-76}cb1Tx4j zJn9VM-feMXzT`DaZ#3HVR z=nV7dBxL>9Y*N!qn}_FY$;z1pPQc69Wr-gaHT}>Vya*ImVp1B}5}Ue9*eG+)zfo># z%R41&pp3Y?Q^nJ=)>qc!hzuT4SxZ@z2(NLJZ(d{~rGaD-svTdjTCXqO$AVQOGr#3g zpY>aoEVVaBwS_<1@${)jwdG}xfT*_o>;FYHIo)G!h$>6I!wXO#xXD?(F#McIu924U zna2GM_Qe$yg?@dcuuXr8=Y^skuR`SZX2fz9QzLC3z#J-qKSa^u-E(x(7u9 z!AR}#IrqPj(+e9e)WWc_HyD(d#vJrS~F#UW+T4#Ft64V0U(+vzg?u>QR-0T*A#_R91MCX}zXo zY_KsRU5B^_2y2ZMHH)AfXzJ(#N4#p{!F>H_-?m+w_iUWkkzM!q`0}Q~&wTY~=kwp( zbKlqt&pvkS!RvGTpZZi}i}ljE$Cvi)xpRB@W+gUFS=zsK+n#Ls&Yk_cS-C$8yluy> Y?VEON+S$LUFS~7Lb|>rKws+IN0btW%)&Kwi literal 4116 zcmai14RBOf6@E9H{ogG~NEX6Ivkh2(`Kh{Kwc4e%40I~I?1WwHlX`Cw3h4mF5K+i< zc)z=(Xnng0&`#SCTRXJsI1Vr)h||%*QW>$1bgWgWM8_X!XX-dOLMthL_ult5FVvqb zyL|WDbI(2ZJLlZ<9-X9xBE5;~hEa6;m054lgSSuur1ZEZe$SOO^`m+R(2_D$^eIj4 zSI9FZZD94v(J#=+ELDnhIc+Y|1yq^RC^3vK*Uae9?=REcW~QcUG-tLLAxNxpa8*xZ zm0EMvl197DR=&@#u@9V~IU`5A9YVuh2BEo13!gh&R&^)}sYzhlFogW2vT3ZPgh1sv zIIODtThfePO7JOULxwPYr3{5D_%17HI7W+spSaxz!DmXEjsM2rMoy>QRx3`@j@gxP z#>UQMaanaN(yLLWlZGm8wyQHkiQ{JHIBT))C9G2%-|5aurly&~GqSV1r$TzowG%d( z0IxOT+VGOBgO`rUeJ78Us}AWEcK5hhdL;wX##(*=RmBP;OWd_M3%g+{SS81(atl>1 zy-jt*4S``wix(H#ytIWieI27bo$S&F%1a_2Y-MC)Ss!?C@P|iRnermwv*E{209HNN z&O#ps{OM@v)ppiA2Kb8wQ(FKJ0A6%1J`eab;6IO^KMHsR@U5xQ+W~vzw$gYzYx)DG zoag8LOibwm^*{B$;K6;bJhmJPm!a_JCwBh;(k*~be(2~1z)|1Kwu9!)a5sl34l(s9 zz~T3ud@tbLfM48s*R61OHQ;1%CTZX9DBQ;SDF_gTP) z0hjhIi2yzhc&mDG7vQ%53oEa_3CPb=`0=bxz#sW$;`bgp0w337ibG8CsJ1S=vjXD3 z2{@H2;_xzDq*9c7d1ANnYl4M-Tz5Oe)Kc|1rg6w9(nqNjF(|sa#Jo@M)3ctAjn-={a zlX_l9F154p`(-Z6=Axhr*`c-$7A{CJ3$HR+xU-~<*F~?uhQ0qwt>nrHJE;<$eh=yaDEpxEl;WEA~yo;Z$=*sNuHVN&-%aG2#dFy zf3nyL&unasEm+`2*7L*=BLuvF<6<@c$hBTp#B{mRY`7_o8av<{e5!(2ihKYWFzAyJ zJ1#ZUV9J1NuV6T%vGZkoMKY^2oJ9ukg5j~#Wk6z6-Y)To?>3&-u!nC&_!6HlwTvnr z5v#I#;>$c)p2hEC@jFcxJB1s`D-s$;31pF7csw(R`;Y}^;zM$U;}Ffl!yJpFm**Xx zvvG${8B5u<43d+Bo5{h&Sx6`#5*OK5#R&HW})M1H*GRJuV>w)~`?j*eH z%tpl-q%xZ&?vbnXJWFh9P{bd_1v@6Oh--nJJ)E6{SO0aJ)HTxvJ&C8wR^BXf0iJPP zmiS6Z)AwC>ia>ECPWw)tosK1Z^m5OSsBrZko@$_s_;II;CzQh5feEO|*16d*VGM_w3yPNdpB&v;Mc=MCgS%6pKVu2+8Slwbd;V&nQo9~9U8 zz%~4d)Jl2xpB}u~8=H>FO_7L=o(IF;`C01Qwu#$>_k{_5wR$&@$7Sl2Tzs8Z=e%>I zE(E<|smuKK6`YGJNw%2Am7bpMElYR#=^k7XAS3-rUvtIvnvymI)Izhd`wU7Gbeb&6EJ$U0M6wL&cM@Mz$@ERDG19g?L_m09}l2+1|P z7Mex7qXRdaN%pH!s_f+}+#FhEgTFPuytg^U~Xt@ZYvuZ+Ogr^C`eH_ diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index 5677cf9699..d858b1ed48 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -652,6 +652,10 @@ contract Collection is Dummy, ERC165 { return false; } + // Returns collection type + // + // @return `Fungible` or `NFT` or `ReFungible` + // // Selector: uniqueCollectionType() d34b55b8 function uniqueCollectionType() public returns (string memory) { require(false, stub_error); diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.raw b/pallets/refungible/src/stubs/UniqueRefungibleToken.raw index c63df6b90c8d202a81b7a1a89b9eba3846101dfc..998445ec1d4178220745b9aeba3b46606e114c42 100644 GIT binary patch delta 921 zcmZ9JUq}>D6vpSwon4d^cEjCVR$X&3XtVXy@Oq zlo2zI{i7c2p`=IAhajk@fN{Pf$}LhMCc9r|?=@ipe?J6aHfXA4_n3&Rc~_v%kGfaoILU3t`v*y$Sz=%~Li zGl$cbvB$CEXpT3oBJvR(FRpUb5K|{Mh7m7Ur$PB0?j&quOFA44SG?h!HG{K8LHsv25$-1u%Cy8TT^GuJ)ruL*$yolcVf^fO) z)oI2m`rgr?&crc`iQPGEiprkjLE7`Kla|(bwP=6^eMJ*@0>uO-KFDc?5yh!*y?N4> z=UD=!cF9lMtfp<-e%fS~kvb|D(TCY?mS${7JK0J8?Y;szR5f;)z7#VnwCY+!d<(LvGN}bemJ_A8 zso1d?4JA#umkp}I1pk+gOa-lEL}E;et46uhCLgFFm6p^9fDI!9!4xUu7Hb_FELquJ|ws(G9lDRzdzR%yh^Q7_Z)-05;&i$9`!R$)Xlbn(Rv*-6aV5OM)uy$NB++i}nRt2^puxK5%qUd~3un1}MXi8!@EH6L3iyKmS*pn%1C zPv+j!l^i;xfWZ)UB5hH@u<@EfX)r=|nDx0p6~`mnWd^U~8`^oa0b0$GRy%9sO%~&M zP*GJiN>MCVbBmVagGL3zw$m~bn{?j>7mB`v9YAw1`bPrKF@xx-`g?P@y0hfvSk}*t`fCrEdl0p{RQ*SWh@^$V5 zFXC2ICQeYrhv==W(t-zhu2%3l5dOFN=Zmw65*D3^``_wI@F~@@Tl||aNJHGCtTG}~ z#S6WIW@&Gxpi|S$R#d}x(>7t`d~jOoICV>>fOjNZXJiH=YpsJ>NAqNvN;wDaqe(aw z?uP%ID|pet@S^0UZlCiU(6|qL2pAa+CZ#>f(x36n_=mRXqh`yY{F|{G*N?!Nud5F) R)=qRyHEg-O6#SAp{{aZkG06Y` diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index cdef56ce68e65d9bee03d46e305d482c1964c6c1..caca24e337c48bd30100df1fb6a3f05232c0393d 100644 GIT binary patch delta 44 zcmV+{0Mq}_3(yO&e+3{J<2PG+7p}$9ibUc^oK=hC07{`_Ut~)A`+^$hDA^yAp9L|$ CuM{Bw delta 44 zcmV+{0Mq}_3(yO&e+3{ln*l`AEgYR7BlfTz$}g^Iuv6Ff80=#Xn_=hBATZ*Sp9L|Y Cm=l5k diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.sol b/pallets/unique/src/eth/stubs/CollectionHelpers.sol index a5cd0598bf..2db0c73d43 100644 --- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol +++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol @@ -96,7 +96,7 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { dummy = 0; return 0x0000000000000000000000000000000000000000; } - + // Check if a collection exists // @param collection_address Address of the collection in question // @return bool Does the collection exist? diff --git a/tests/src/eth/api/CollectionHelpers.sol b/tests/src/eth/api/CollectionHelpers.sol index ad3c31a69f..de8ffc6338 100644 --- a/tests/src/eth/api/CollectionHelpers.sol +++ b/tests/src/eth/api/CollectionHelpers.sol @@ -57,7 +57,7 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory tokenPrefix, string memory baseUri ) external returns (address); - + // Check if a collection exists // @param collection_address Address of the collection in question // @return bool Does the collection exist? diff --git a/tests/src/eth/api/UniqueFungible.sol b/tests/src/eth/api/UniqueFungible.sol index 30d0c224b1..166d806d66 100644 --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -219,6 +219,10 @@ interface Collection is Dummy, ERC165 { // Selector: verifyOwnerOrAdmin() 04a46053 function verifyOwnerOrAdmin() external returns (bool); + // Returns collection type + // + // @return `Fungible` or `NFT` or `ReFungible` + // // Selector: uniqueCollectionType() d34b55b8 function uniqueCollectionType() external returns (string memory); } diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index 5a77225805..b9d12515d2 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -430,6 +430,10 @@ interface Collection is Dummy, ERC165 { // Selector: verifyOwnerOrAdmin() 04a46053 function verifyOwnerOrAdmin() external returns (bool); + // Returns collection type + // + // @return `Fungible` or `NFT` or `ReFungible` + // // Selector: uniqueCollectionType() d34b55b8 function uniqueCollectionType() external returns (string memory); } diff --git a/tests/src/eth/collectionHelpersAbi.json b/tests/src/eth/collectionHelpersAbi.json index e5c0f399cd..6bc7199af6 100644 --- a/tests/src/eth/collectionHelpersAbi.json +++ b/tests/src/eth/collectionHelpersAbi.json @@ -61,7 +61,7 @@ ], "name": "createRefungibleCollection", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { diff --git a/tests/src/eth/fractionalizer/Fractionalizer.bin b/tests/src/eth/fractionalizer/Fractionalizer.bin index d7812a1047..9bf578ae81 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.bin +++ b/tests/src/eth/fractionalizer/Fractionalizer.bin @@ -1 +1 @@ -60c0604052600a60805269526546756e6769626c6560b01b60a0527fcdb72fd4e1d0d6d4eebd7ab142113ec2b4b06ddb24324db5c287ef01ab484d6b60055534801561004a57600080fd5b50600480546001600160a01b031916331790556113cd8061006c6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063115091401461005c578063b12527f814610071578063d470e60f14610084578063dbc38ad214610097578063f0d4cf5f146100aa575b600080fd5b61006f61006a366004610f34565b6100bd565b005b61006f61007f366004610f66565b6102b8565b61006f610092366004610f9f565b610345565b61006f6100a5366004610fcb565b610722565b61006f6100b8366004611062565b610dc4565b6004546001600160a01b031633146100f05760405162461bcd60e51b81526004016100e7906110fc565b60405180910390fd5b6000546001600160a01b0316156101495760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b60008190506000816001600160a01b031663d34b55b86040518163ffffffff1660e01b81526004016000604051808303816000875af1158015610190573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101b8919081019061113a565b90506005548180519060200120146101e25760405162461bcd60e51b81526004016100e79061120a565b816001600160a01b03166304a460536040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610222573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102469190611267565b6102625760405162461bcd60e51b81526004016100e79061120a565b600080546001600160a01b0319166001600160a01b0385169081179091556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef9060200160405180910390a1505050565b6004546001600160a01b031633146102e25760405162461bcd60e51b81526004016100e7906110fc565b6001600160a01b038216600081815260016020908152604091829020805460ff19168515159081179091558251938452908301527f6dad0aed33f4b7f07095619b668698e17943fd9f4c83e7cfcc7f6dd880a11588910160405180910390a15050565b6000546001600160a01b03166103995760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546001600160a01b038381169116146103ed5760405162461bcd60e51b81526020600482015260146024820152732bb937b7339029232a1031b7b63632b1ba34b7b760611b60448201526064016100e7565b600080546040516355bb7d6360e11b8152600481018490526001600160a01b039091169190829063ab76fac690602401602060405180830381865afa15801561043a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045e9190611284565b6001600160a01b0380821660009081526003602090815260409182902082518084019093528054909316808352600190930154908201529192506104e45760405162461bcd60e51b815260206004820181905260248201527f4e6f20636f72726573706f6e64696e67204e465420746f6b656e20666f756e6460448201526064016100e7565b6000829050806001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610527573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054b91906112a1565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a0823190602401602060405180830381865afa15801561058f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b391906112a1565b1461060f5760405162461bcd60e51b815260206004820152602660248201527f4e6f7420616c6c2070696563657320617265206f776e6564206279207468652060448201526531b0b63632b960d11b60648201526084016100e7565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd9061063f90339030908a906004016112ba565b600060405180830381600087803b15801561065957600080fd5b505af115801561066d573d6000803e3d6000fd5b5050835160208501516040516323b872dd60e01b81526001600160a01b0390921693506323b872dd92506106a791309133916004016112ba565b600060405180830381600087803b1580156106c157600080fd5b505af11580156106d5573d6000803e3d6000fd5b5050835160208501516040517fd2628c68a4330ea5ba2e16305b03a4e974e760e86f302d43e6bc00c28918cb2294506107129350879291906112ba565b60405180910390a1505050505050565b6000546001600160a01b03166107765760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546040516331a9108f60e11b8152600481018490526001600160a01b0391821691339190861690636352211e90602401602060405180830381865afa1580156107c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e99190611284565b6001600160a01b03161461080f5760405162461bcd60e51b81526004016100e7906112de565b6001600160a01b03841660009081526001602081905260409091205460ff161515146108a35760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a6174696f6e206f66207468697320636f6c6c656360448201527f74696f6e206973206e6f7420616c6c6f7765642062792061646d696e0000000060648201526084016100e7565b6040516331a9108f60e11b81526004810184905233906001600160a01b03861690636352211e90602401602060405180830381865afa1580156108ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090e9190611284565b6001600160a01b0316146109345760405162461bcd60e51b81526004016100e7906112de565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd90610964903390309088906004016112ba565b600060405180830381600087803b15801561097e57600080fd5b505af1158015610992573d6000803e3d6000fd5b505050506001600160a01b0384166000908152600260209081526040808320868452909152812054819081908103610bde57836001600160a01b03166375794a3c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2691906112a1565b6040516340c10f1960e01b8152306004820152602481018290529093506001600160a01b038516906340c10f19906044016020604051808303816000875af1158015610a76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9a9190611267565b506040516355bb7d6360e11b8152600481018490526001600160a01b0385169063ab76fac690602401602060405180830381865afa158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b049190611284565b6001600160a01b0388811660008181526002602090815260408083208c84528252808320899055805180820182528481528083018d8152878716808652600390945293829020905181546001600160a01b0319169616959095178555915160019094019390935551630217888360e11b81526004810191909152602481018990529193508392509063042f1106906044016020604051808303816000875af1158015610bb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd89190611267565b50610c6f565b6001600160a01b0387811660009081526002602090815260408083208a8452909152908190205490516355bb7d6360e11b8152600481018290529094509085169063ab76fac690602401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c699190611284565b91508190505b60405163d2418ca760e01b81526001600160801b03861660048201526001600160a01b0382169063d2418ca7906024016020604051808303816000875af1158015610cbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce29190611267565b5060405163a9059cbb60e01b81523360048201526001600160801b03861660248201526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610d38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5c9190611267565b50604080516001600160a01b03808a168252602082018990528416918101919091526001600160801b03861660608201527f29f372538523984f33874da1b50e596ce0f180a6eb04d7ff22bb2ce80e1576b6906080015b60405180910390a150505050505050565b6004546001600160a01b03163314610dee5760405162461bcd60e51b81526004016100e7906110fc565b6000546001600160a01b031615610e475760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b6040516344a68ad560e01b8152736c4e9fe1ae37a41e93cee429e8e1881abdcbb54f9081906344a68ad590610e8a908a908a908a908a908a908a9060040161134e565b6020604051808303816000875af1158015610ea9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecd9190611284565b600080546001600160a01b0319166001600160a01b039290921691821790556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef90602001610db3565b6001600160a01b0381168114610f3157600080fd5b50565b600060208284031215610f4657600080fd5b8135610f5181610f1c565b9392505050565b8015158114610f3157600080fd5b60008060408385031215610f7957600080fd5b8235610f8481610f1c565b91506020830135610f9481610f58565b809150509250929050565b60008060408385031215610fb257600080fd5b8235610fbd81610f1c565b946020939093013593505050565b600080600060608486031215610fe057600080fd5b8335610feb81610f1c565b92506020840135915060408401356001600160801b038116811461100e57600080fd5b809150509250925092565b60008083601f84011261102b57600080fd5b50813567ffffffffffffffff81111561104357600080fd5b60208301915083602082850101111561105b57600080fd5b9250929050565b6000806000806000806060878903121561107b57600080fd5b863567ffffffffffffffff8082111561109357600080fd5b61109f8a838b01611019565b909850965060208901359150808211156110b857600080fd5b6110c48a838b01611019565b909650945060408901359150808211156110dd57600080fd5b506110ea89828a01611019565b979a9699509497509295939492505050565b6020808252600e908201526d27b7363c9037bbb732b91031b0b760911b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561114d57600080fd5b825167ffffffffffffffff8082111561116557600080fd5b818501915085601f83011261117957600080fd5b81518181111561118b5761118b611124565b604051601f8201601f19908116603f011681019083821181831017156111b3576111b3611124565b8160405282815288868487010111156111cb57600080fd5b600093505b828410156111ed57848401860151818501870152928501926111d0565b828411156111fe5760008684830101525b98975050505050505050565b6020808252603c908201527f4672616374696f6e616c697a657220636f6e74726163742073686f756c64206260408201527f6520616e2061646d696e206f662074686520636f6c6c656374696f6e00000000606082015260800190565b60006020828403121561127957600080fd5b8151610f5181610f58565b60006020828403121561129657600080fd5b8151610f5181610f1c565b6000602082840312156112b357600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526027908201527f4f6e6c7920746f6b656e206f776e657220636f756c64206672616374696f6e616040820152661b1a5e99481a5d60ca1b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061136260608301888a611325565b8281036020840152611375818789611325565b9050828103604084015261138a818587611325565b999850505050505050505056fea2646970667358221220851819fa818f0a972e13485d65873363a68504b99a7e320b6067ac22db64ae8364736f6c634300080f0033 \ No newline at end of file +60c0604052600a60805269526546756e6769626c6560b01b60a0527fcdb72fd4e1d0d6d4eebd7ab142113ec2b4b06ddb24324db5c287ef01ab484d6b60055534801561004a57600080fd5b50600480546001600160a01b031916331790556113cd8061006c6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063115091401461005c578063b12527f814610071578063d470e60f14610084578063dbc38ad214610097578063f0d4cf5f146100aa575b600080fd5b61006f61006a366004610f34565b6100bd565b005b61006f61007f366004610f66565b6102b8565b61006f610092366004610f9f565b610345565b61006f6100a5366004610fcb565b610722565b61006f6100b8366004611062565b610dc4565b6004546001600160a01b031633146100f05760405162461bcd60e51b81526004016100e7906110fc565b60405180910390fd5b6000546001600160a01b0316156101495760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b60008190506000816001600160a01b031663d34b55b86040518163ffffffff1660e01b81526004016000604051808303816000875af1158015610190573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101b8919081019061113a565b90506005548180519060200120146101e25760405162461bcd60e51b81526004016100e79061120a565b816001600160a01b03166304a460536040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610222573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102469190611267565b6102625760405162461bcd60e51b81526004016100e79061120a565b600080546001600160a01b0319166001600160a01b0385169081179091556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef9060200160405180910390a1505050565b6004546001600160a01b031633146102e25760405162461bcd60e51b81526004016100e7906110fc565b6001600160a01b038216600081815260016020908152604091829020805460ff19168515159081179091558251938452908301527f6dad0aed33f4b7f07095619b668698e17943fd9f4c83e7cfcc7f6dd880a11588910160405180910390a15050565b6000546001600160a01b03166103995760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546001600160a01b038381169116146103ed5760405162461bcd60e51b81526020600482015260146024820152732bb937b7339029232a1031b7b63632b1ba34b7b760611b60448201526064016100e7565b600080546040516355bb7d6360e11b8152600481018490526001600160a01b039091169190829063ab76fac690602401602060405180830381865afa15801561043a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045e9190611284565b6001600160a01b0380821660009081526003602090815260409182902082518084019093528054909316808352600190930154908201529192506104e45760405162461bcd60e51b815260206004820181905260248201527f4e6f20636f72726573706f6e64696e67204e465420746f6b656e20666f756e6460448201526064016100e7565b6000829050806001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610527573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054b91906112a1565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a0823190602401602060405180830381865afa15801561058f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b391906112a1565b1461060f5760405162461bcd60e51b815260206004820152602660248201527f4e6f7420616c6c2070696563657320617265206f776e6564206279207468652060448201526531b0b63632b960d11b60648201526084016100e7565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd9061063f90339030908a906004016112ba565b600060405180830381600087803b15801561065957600080fd5b505af115801561066d573d6000803e3d6000fd5b5050835160208501516040516323b872dd60e01b81526001600160a01b0390921693506323b872dd92506106a791309133916004016112ba565b600060405180830381600087803b1580156106c157600080fd5b505af11580156106d5573d6000803e3d6000fd5b5050835160208501516040517fd2628c68a4330ea5ba2e16305b03a4e974e760e86f302d43e6bc00c28918cb2294506107129350879291906112ba565b60405180910390a1505050505050565b6000546001600160a01b03166107765760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546040516331a9108f60e11b8152600481018490526001600160a01b0391821691339190861690636352211e90602401602060405180830381865afa1580156107c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e99190611284565b6001600160a01b03161461080f5760405162461bcd60e51b81526004016100e7906112de565b6001600160a01b03841660009081526001602081905260409091205460ff161515146108a35760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a6174696f6e206f66207468697320636f6c6c656360448201527f74696f6e206973206e6f7420616c6c6f7765642062792061646d696e0000000060648201526084016100e7565b6040516331a9108f60e11b81526004810184905233906001600160a01b03861690636352211e90602401602060405180830381865afa1580156108ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090e9190611284565b6001600160a01b0316146109345760405162461bcd60e51b81526004016100e7906112de565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd90610964903390309088906004016112ba565b600060405180830381600087803b15801561097e57600080fd5b505af1158015610992573d6000803e3d6000fd5b505050506001600160a01b0384166000908152600260209081526040808320868452909152812054819081908103610bde57836001600160a01b03166375794a3c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2691906112a1565b6040516340c10f1960e01b8152306004820152602481018290529093506001600160a01b038516906340c10f19906044016020604051808303816000875af1158015610a76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9a9190611267565b506040516355bb7d6360e11b8152600481018490526001600160a01b0385169063ab76fac690602401602060405180830381865afa158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b049190611284565b6001600160a01b0388811660008181526002602090815260408083208c84528252808320899055805180820182528481528083018d8152878716808652600390945293829020905181546001600160a01b0319169616959095178555915160019094019390935551630217888360e11b81526004810191909152602481018990529193508392509063042f1106906044016020604051808303816000875af1158015610bb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd89190611267565b50610c6f565b6001600160a01b0387811660009081526002602090815260408083208a8452909152908190205490516355bb7d6360e11b8152600481018290529094509085169063ab76fac690602401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c699190611284565b91508190505b60405163d2418ca760e01b81526001600160801b03861660048201526001600160a01b0382169063d2418ca7906024016020604051808303816000875af1158015610cbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce29190611267565b5060405163a9059cbb60e01b81523360048201526001600160801b03861660248201526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610d38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5c9190611267565b50604080516001600160a01b03808a168252602082018990528416918101919091526001600160801b03861660608201527f29f372538523984f33874da1b50e596ce0f180a6eb04d7ff22bb2ce80e1576b6906080015b60405180910390a150505050505050565b6004546001600160a01b03163314610dee5760405162461bcd60e51b81526004016100e7906110fc565b6000546001600160a01b031615610e475760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b6040516344a68ad560e01b8152736c4e9fe1ae37a41e93cee429e8e1881abdcbb54f9081906344a68ad590610e8a908a908a908a908a908a908a9060040161134e565b6020604051808303816000875af1158015610ea9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecd9190611284565b600080546001600160a01b0319166001600160a01b039290921691821790556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef90602001610db3565b6001600160a01b0381168114610f3157600080fd5b50565b600060208284031215610f4657600080fd5b8135610f5181610f1c565b9392505050565b8015158114610f3157600080fd5b60008060408385031215610f7957600080fd5b8235610f8481610f1c565b91506020830135610f9481610f58565b809150509250929050565b60008060408385031215610fb257600080fd5b8235610fbd81610f1c565b946020939093013593505050565b600080600060608486031215610fe057600080fd5b8335610feb81610f1c565b92506020840135915060408401356001600160801b038116811461100e57600080fd5b809150509250925092565b60008083601f84011261102b57600080fd5b50813567ffffffffffffffff81111561104357600080fd5b60208301915083602082850101111561105b57600080fd5b9250929050565b6000806000806000806060878903121561107b57600080fd5b863567ffffffffffffffff8082111561109357600080fd5b61109f8a838b01611019565b909850965060208901359150808211156110b857600080fd5b6110c48a838b01611019565b909650945060408901359150808211156110dd57600080fd5b506110ea89828a01611019565b979a9699509497509295939492505050565b6020808252600e908201526d27b7363c9037bbb732b91031b0b760911b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561114d57600080fd5b825167ffffffffffffffff8082111561116557600080fd5b818501915085601f83011261117957600080fd5b81518181111561118b5761118b611124565b604051601f8201601f19908116603f011681019083821181831017156111b3576111b3611124565b8160405282815288868487010111156111cb57600080fd5b600093505b828410156111ed57848401860151818501870152928501926111d0565b828411156111fe5760008684830101525b98975050505050505050565b6020808252603c908201527f4672616374696f6e616c697a657220636f6e74726163742073686f756c64206260408201527f6520616e2061646d696e206f662074686520636f6c6c656374696f6e00000000606082015260800190565b60006020828403121561127957600080fd5b8151610f5181610f58565b60006020828403121561129657600080fd5b8151610f5181610f1c565b6000602082840312156112b357600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526027908201527f4f6e6c7920746f6b656e206f776e657220636f756c64206672616374696f6e616040820152661b1a5e99481a5d60ca1b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061136260608301888a611325565b8281036020840152611375818789611325565b9050828103604084015261138a818587611325565b999850505050505050505056fea2646970667358221220381fff79375dd0c60013c52b1abbe3b17b3f741fdced44aff45e10975d1d906f64736f6c634300080f0033 \ No newline at end of file diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index 1caf6a0ea6..60f914e70f 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -301,5 +301,19 @@ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [], + "name": "uniqueCollectionType", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "verifyOwnerOrAdmin", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" } ] diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index cbd18c77a6..8b5fc87518 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -526,5 +526,19 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [], + "name": "uniqueCollectionType", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "verifyOwnerOrAdmin", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" } ] diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 2d3ee520f0..f3b47f95a3 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -266,7 +266,7 @@ declare module '@polkadot/api-base/types/storage' { * * Currently used to store RMRK data. **/ - tokenAuxProperties: AugmentedQuery Observable>, [u32, u32, UpDataStructsPropertyScope, Bytes]> & QueryableStorageEntry; + tokenAuxProperties: AugmentedQuery Observable>, [u32, u32, UpDataStructsPropertyScope, Bytes]> & QueryableStorageEntry; /** * Used to enumerate token's children. **/ diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 531999e156..f96805d5e0 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -2521,7 +2521,8 @@ export interface UpDataStructsPropertyPermission extends Struct { export interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; - readonly type: 'None' | 'Rmrk'; + readonly isEth: boolean; + readonly type: 'None' | 'Rmrk' | 'Eth'; } /** @name UpDataStructsRpcCollection */ diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 0238bd7d0b..ede50e0ccc 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -2978,7 +2978,7 @@ export default { * Lookup397: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { - _enum: ['None', 'Rmrk'] + _enum: ['None', 'Rmrk', 'Eth'] }, /** * Lookup399: pallet_nonfungible::pallet::Error diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index f6cbfaadd7..368e2f8f94 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -3126,7 +3126,8 @@ declare module '@polkadot/types/lookup' { export interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; - readonly type: 'None' | 'Rmrk'; + readonly isEth: boolean; + readonly type: 'None' | 'Rmrk' | 'Eth'; } /** @name PalletNonfungibleError (399) */ From 59980bb8b798d9a371bb2fdfe9a3aed6cbf4966d Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0311/1274] chore: fix fractionalizer error message --- tests/src/eth/fractionalizer/Fractionalizer.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/eth/fractionalizer/Fractionalizer.sol b/tests/src/eth/fractionalizer/Fractionalizer.sol index e5f035022b..37013330f0 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.sol +++ b/tests/src/eth/fractionalizer/Fractionalizer.sol @@ -42,7 +42,7 @@ contract Fractionalizer { require( keccak256(bytes(collectionType)) == refungibleCollectionType, - "Fractionalizer contract should be an admin of the collection" + "Wrong collection type. Collection is not refungible." ); require( refungibleContract.verifyOwnerOrAdmin(), From f5f52d9f9e3f2e6e778e9138b1110414e1c274c8 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0312/1274] chore: add test for rft2nft --- .../eth/fractionalizer/fractionalizer.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index 74eb34e676..11277e2a2a 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -299,6 +299,22 @@ describe('Negative Integration Tests for fractionalizer', () => { await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).send()).to.be.eventually.rejected; }); + itWeb3('call rft2nft for RFT token that was not minted by fractionalizer contract', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const {collectionIdAddress: rftCollectionAddress} = await createRefungibleCollection(api, web3, owner); + + const fractionalizer = await deployFractionalizer(api, web3, owner); + const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner); + + await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send(); + await fractionalizer.methods.setRFTCollection(rftCollectionAddress).send(); + + const rftTokenId = await refungibleContract.methods.nextTokenId().call(); + await refungibleContract.methods.mint(owner, rftTokenId).send(); + + await expect(await fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).send()).to.be.eventually.rejected; + }); + itWeb3('call rft2nft without owning all RFT pieces', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const receiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); From 0648dd7149c1500664ba9edd03d082c4f3044e84 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0313/1274] chore: add check for fractionalizer error messages --- .../src/eth/fractionalizer/Fractionalizer.bin | 2 +- .../eth/fractionalizer/fractionalizer.test.ts | 44 +++++++++++++------ 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/tests/src/eth/fractionalizer/Fractionalizer.bin b/tests/src/eth/fractionalizer/Fractionalizer.bin index 9bf578ae81..835f24d7bd 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.bin +++ b/tests/src/eth/fractionalizer/Fractionalizer.bin @@ -1 +1 @@ -60c0604052600a60805269526546756e6769626c6560b01b60a0527fcdb72fd4e1d0d6d4eebd7ab142113ec2b4b06ddb24324db5c287ef01ab484d6b60055534801561004a57600080fd5b50600480546001600160a01b031916331790556113cd8061006c6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063115091401461005c578063b12527f814610071578063d470e60f14610084578063dbc38ad214610097578063f0d4cf5f146100aa575b600080fd5b61006f61006a366004610f34565b6100bd565b005b61006f61007f366004610f66565b6102b8565b61006f610092366004610f9f565b610345565b61006f6100a5366004610fcb565b610722565b61006f6100b8366004611062565b610dc4565b6004546001600160a01b031633146100f05760405162461bcd60e51b81526004016100e7906110fc565b60405180910390fd5b6000546001600160a01b0316156101495760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b60008190506000816001600160a01b031663d34b55b86040518163ffffffff1660e01b81526004016000604051808303816000875af1158015610190573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101b8919081019061113a565b90506005548180519060200120146101e25760405162461bcd60e51b81526004016100e79061120a565b816001600160a01b03166304a460536040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610222573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102469190611267565b6102625760405162461bcd60e51b81526004016100e79061120a565b600080546001600160a01b0319166001600160a01b0385169081179091556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef9060200160405180910390a1505050565b6004546001600160a01b031633146102e25760405162461bcd60e51b81526004016100e7906110fc565b6001600160a01b038216600081815260016020908152604091829020805460ff19168515159081179091558251938452908301527f6dad0aed33f4b7f07095619b668698e17943fd9f4c83e7cfcc7f6dd880a11588910160405180910390a15050565b6000546001600160a01b03166103995760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546001600160a01b038381169116146103ed5760405162461bcd60e51b81526020600482015260146024820152732bb937b7339029232a1031b7b63632b1ba34b7b760611b60448201526064016100e7565b600080546040516355bb7d6360e11b8152600481018490526001600160a01b039091169190829063ab76fac690602401602060405180830381865afa15801561043a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045e9190611284565b6001600160a01b0380821660009081526003602090815260409182902082518084019093528054909316808352600190930154908201529192506104e45760405162461bcd60e51b815260206004820181905260248201527f4e6f20636f72726573706f6e64696e67204e465420746f6b656e20666f756e6460448201526064016100e7565b6000829050806001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610527573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054b91906112a1565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a0823190602401602060405180830381865afa15801561058f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b391906112a1565b1461060f5760405162461bcd60e51b815260206004820152602660248201527f4e6f7420616c6c2070696563657320617265206f776e6564206279207468652060448201526531b0b63632b960d11b60648201526084016100e7565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd9061063f90339030908a906004016112ba565b600060405180830381600087803b15801561065957600080fd5b505af115801561066d573d6000803e3d6000fd5b5050835160208501516040516323b872dd60e01b81526001600160a01b0390921693506323b872dd92506106a791309133916004016112ba565b600060405180830381600087803b1580156106c157600080fd5b505af11580156106d5573d6000803e3d6000fd5b5050835160208501516040517fd2628c68a4330ea5ba2e16305b03a4e974e760e86f302d43e6bc00c28918cb2294506107129350879291906112ba565b60405180910390a1505050505050565b6000546001600160a01b03166107765760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546040516331a9108f60e11b8152600481018490526001600160a01b0391821691339190861690636352211e90602401602060405180830381865afa1580156107c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e99190611284565b6001600160a01b03161461080f5760405162461bcd60e51b81526004016100e7906112de565b6001600160a01b03841660009081526001602081905260409091205460ff161515146108a35760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a6174696f6e206f66207468697320636f6c6c656360448201527f74696f6e206973206e6f7420616c6c6f7765642062792061646d696e0000000060648201526084016100e7565b6040516331a9108f60e11b81526004810184905233906001600160a01b03861690636352211e90602401602060405180830381865afa1580156108ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090e9190611284565b6001600160a01b0316146109345760405162461bcd60e51b81526004016100e7906112de565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd90610964903390309088906004016112ba565b600060405180830381600087803b15801561097e57600080fd5b505af1158015610992573d6000803e3d6000fd5b505050506001600160a01b0384166000908152600260209081526040808320868452909152812054819081908103610bde57836001600160a01b03166375794a3c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2691906112a1565b6040516340c10f1960e01b8152306004820152602481018290529093506001600160a01b038516906340c10f19906044016020604051808303816000875af1158015610a76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9a9190611267565b506040516355bb7d6360e11b8152600481018490526001600160a01b0385169063ab76fac690602401602060405180830381865afa158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b049190611284565b6001600160a01b0388811660008181526002602090815260408083208c84528252808320899055805180820182528481528083018d8152878716808652600390945293829020905181546001600160a01b0319169616959095178555915160019094019390935551630217888360e11b81526004810191909152602481018990529193508392509063042f1106906044016020604051808303816000875af1158015610bb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd89190611267565b50610c6f565b6001600160a01b0387811660009081526002602090815260408083208a8452909152908190205490516355bb7d6360e11b8152600481018290529094509085169063ab76fac690602401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c699190611284565b91508190505b60405163d2418ca760e01b81526001600160801b03861660048201526001600160a01b0382169063d2418ca7906024016020604051808303816000875af1158015610cbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce29190611267565b5060405163a9059cbb60e01b81523360048201526001600160801b03861660248201526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610d38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5c9190611267565b50604080516001600160a01b03808a168252602082018990528416918101919091526001600160801b03861660608201527f29f372538523984f33874da1b50e596ce0f180a6eb04d7ff22bb2ce80e1576b6906080015b60405180910390a150505050505050565b6004546001600160a01b03163314610dee5760405162461bcd60e51b81526004016100e7906110fc565b6000546001600160a01b031615610e475760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b6040516344a68ad560e01b8152736c4e9fe1ae37a41e93cee429e8e1881abdcbb54f9081906344a68ad590610e8a908a908a908a908a908a908a9060040161134e565b6020604051808303816000875af1158015610ea9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecd9190611284565b600080546001600160a01b0319166001600160a01b039290921691821790556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef90602001610db3565b6001600160a01b0381168114610f3157600080fd5b50565b600060208284031215610f4657600080fd5b8135610f5181610f1c565b9392505050565b8015158114610f3157600080fd5b60008060408385031215610f7957600080fd5b8235610f8481610f1c565b91506020830135610f9481610f58565b809150509250929050565b60008060408385031215610fb257600080fd5b8235610fbd81610f1c565b946020939093013593505050565b600080600060608486031215610fe057600080fd5b8335610feb81610f1c565b92506020840135915060408401356001600160801b038116811461100e57600080fd5b809150509250925092565b60008083601f84011261102b57600080fd5b50813567ffffffffffffffff81111561104357600080fd5b60208301915083602082850101111561105b57600080fd5b9250929050565b6000806000806000806060878903121561107b57600080fd5b863567ffffffffffffffff8082111561109357600080fd5b61109f8a838b01611019565b909850965060208901359150808211156110b857600080fd5b6110c48a838b01611019565b909650945060408901359150808211156110dd57600080fd5b506110ea89828a01611019565b979a9699509497509295939492505050565b6020808252600e908201526d27b7363c9037bbb732b91031b0b760911b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561114d57600080fd5b825167ffffffffffffffff8082111561116557600080fd5b818501915085601f83011261117957600080fd5b81518181111561118b5761118b611124565b604051601f8201601f19908116603f011681019083821181831017156111b3576111b3611124565b8160405282815288868487010111156111cb57600080fd5b600093505b828410156111ed57848401860151818501870152928501926111d0565b828411156111fe5760008684830101525b98975050505050505050565b6020808252603c908201527f4672616374696f6e616c697a657220636f6e74726163742073686f756c64206260408201527f6520616e2061646d696e206f662074686520636f6c6c656374696f6e00000000606082015260800190565b60006020828403121561127957600080fd5b8151610f5181610f58565b60006020828403121561129657600080fd5b8151610f5181610f1c565b6000602082840312156112b357600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526027908201527f4f6e6c7920746f6b656e206f776e657220636f756c64206672616374696f6e616040820152661b1a5e99481a5d60ca1b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061136260608301888a611325565b8281036020840152611375818789611325565b9050828103604084015261138a818587611325565b999850505050505050505056fea2646970667358221220381fff79375dd0c60013c52b1abbe3b17b3f741fdced44aff45e10975d1d906f64736f6c634300080f0033 \ No newline at end of file +60c0604052600a60805269526546756e6769626c6560b01b60a0527fcdb72fd4e1d0d6d4eebd7ab142113ec2b4b06ddb24324db5c287ef01ab484d6b60055534801561004a57600080fd5b50600480546001600160a01b031916331790556114138061006c6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063115091401461005c578063b12527f814610071578063d470e60f14610084578063dbc38ad214610097578063f0d4cf5f146100aa575b600080fd5b61006f61006a366004610fd7565b6100bd565b005b61006f61007f366004611009565b61035b565b61006f610092366004611042565b6103e8565b61006f6100a536600461106e565b6107c5565b61006f6100b8366004611105565b610e67565b6004546001600160a01b031633146100f05760405162461bcd60e51b81526004016100e79061119f565b60405180910390fd5b6000546001600160a01b0316156101495760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b60008190506000816001600160a01b031663d34b55b86040518163ffffffff1660e01b81526004016000604051808303816000875af1158015610190573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101b891908101906111dd565b905060055481805190602001201461022f5760405162461bcd60e51b815260206004820152603460248201527f57726f6e6720636f6c6c656374696f6e20747970652e20436f6c6c656374696f604482015273371034b9903737ba103932b33ab733b4b136329760611b60648201526084016100e7565b816001600160a01b03166304a460536040518163ffffffff1660e01b81526004016020604051808303816000875af115801561026f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029391906112ad565b6103055760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a657220636f6e74726163742073686f756c64206260448201527f6520616e2061646d696e206f662074686520636f6c6c656374696f6e0000000060648201526084016100e7565b600080546001600160a01b0319166001600160a01b0385169081179091556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef9060200160405180910390a1505050565b6004546001600160a01b031633146103855760405162461bcd60e51b81526004016100e79061119f565b6001600160a01b038216600081815260016020908152604091829020805460ff19168515159081179091558251938452908301527f6dad0aed33f4b7f07095619b668698e17943fd9f4c83e7cfcc7f6dd880a11588910160405180910390a15050565b6000546001600160a01b031661043c5760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546001600160a01b038381169116146104905760405162461bcd60e51b81526020600482015260146024820152732bb937b7339029232a1031b7b63632b1ba34b7b760611b60448201526064016100e7565b600080546040516355bb7d6360e11b8152600481018490526001600160a01b039091169190829063ab76fac690602401602060405180830381865afa1580156104dd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050191906112ca565b6001600160a01b0380821660009081526003602090815260409182902082518084019093528054909316808352600190930154908201529192506105875760405162461bcd60e51b815260206004820181905260248201527f4e6f20636f72726573706f6e64696e67204e465420746f6b656e20666f756e6460448201526064016100e7565b6000829050806001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ee91906112e7565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610632573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065691906112e7565b146106b25760405162461bcd60e51b815260206004820152602660248201527f4e6f7420616c6c2070696563657320617265206f776e6564206279207468652060448201526531b0b63632b960d11b60648201526084016100e7565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd906106e290339030908a90600401611300565b600060405180830381600087803b1580156106fc57600080fd5b505af1158015610710573d6000803e3d6000fd5b5050835160208501516040516323b872dd60e01b81526001600160a01b0390921693506323b872dd925061074a9130913391600401611300565b600060405180830381600087803b15801561076457600080fd5b505af1158015610778573d6000803e3d6000fd5b5050835160208501516040517fd2628c68a4330ea5ba2e16305b03a4e974e760e86f302d43e6bc00c28918cb2294506107b5935087929190611300565b60405180910390a1505050505050565b6000546001600160a01b03166108195760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546040516331a9108f60e11b8152600481018490526001600160a01b0391821691339190861690636352211e90602401602060405180830381865afa158015610868573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088c91906112ca565b6001600160a01b0316146108b25760405162461bcd60e51b81526004016100e790611324565b6001600160a01b03841660009081526001602081905260409091205460ff161515146109465760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a6174696f6e206f66207468697320636f6c6c656360448201527f74696f6e206973206e6f7420616c6c6f7765642062792061646d696e0000000060648201526084016100e7565b6040516331a9108f60e11b81526004810184905233906001600160a01b03861690636352211e90602401602060405180830381865afa15801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b191906112ca565b6001600160a01b0316146109d75760405162461bcd60e51b81526004016100e790611324565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd90610a0790339030908890600401611300565b600060405180830381600087803b158015610a2157600080fd5b505af1158015610a35573d6000803e3d6000fd5b505050506001600160a01b0384166000908152600260209081526040808320868452909152812054819081908103610c8157836001600160a01b03166375794a3c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac991906112e7565b6040516340c10f1960e01b8152306004820152602481018290529093506001600160a01b038516906340c10f19906044016020604051808303816000875af1158015610b19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3d91906112ad565b506040516355bb7d6360e11b8152600481018490526001600160a01b0385169063ab76fac690602401602060405180830381865afa158015610b83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba791906112ca565b6001600160a01b0388811660008181526002602090815260408083208c84528252808320899055805180820182528481528083018d8152878716808652600390945293829020905181546001600160a01b0319169616959095178555915160019094019390935551630217888360e11b81526004810191909152602481018990529193508392509063042f1106906044016020604051808303816000875af1158015610c57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7b91906112ad565b50610d12565b6001600160a01b0387811660009081526002602090815260408083208a8452909152908190205490516355bb7d6360e11b8152600481018290529094509085169063ab76fac690602401602060405180830381865afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c91906112ca565b91508190505b60405163d2418ca760e01b81526001600160801b03861660048201526001600160a01b0382169063d2418ca7906024016020604051808303816000875af1158015610d61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8591906112ad565b5060405163a9059cbb60e01b81523360048201526001600160801b03861660248201526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610ddb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dff91906112ad565b50604080516001600160a01b03808a168252602082018990528416918101919091526001600160801b03861660608201527f29f372538523984f33874da1b50e596ce0f180a6eb04d7ff22bb2ce80e1576b6906080015b60405180910390a150505050505050565b6004546001600160a01b03163314610e915760405162461bcd60e51b81526004016100e79061119f565b6000546001600160a01b031615610eea5760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b6040516344a68ad560e01b8152736c4e9fe1ae37a41e93cee429e8e1881abdcbb54f9081906344a68ad590610f2d908a908a908a908a908a908a90600401611394565b6020604051808303816000875af1158015610f4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7091906112ca565b600080546001600160a01b0319166001600160a01b039290921691821790556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef90602001610e56565b6001600160a01b0381168114610fd457600080fd5b50565b600060208284031215610fe957600080fd5b8135610ff481610fbf565b9392505050565b8015158114610fd457600080fd5b6000806040838503121561101c57600080fd5b823561102781610fbf565b9150602083013561103781610ffb565b809150509250929050565b6000806040838503121561105557600080fd5b823561106081610fbf565b946020939093013593505050565b60008060006060848603121561108357600080fd5b833561108e81610fbf565b92506020840135915060408401356001600160801b03811681146110b157600080fd5b809150509250925092565b60008083601f8401126110ce57600080fd5b50813567ffffffffffffffff8111156110e657600080fd5b6020830191508360208285010111156110fe57600080fd5b9250929050565b6000806000806000806060878903121561111e57600080fd5b863567ffffffffffffffff8082111561113657600080fd5b6111428a838b016110bc565b9098509650602089013591508082111561115b57600080fd5b6111678a838b016110bc565b9096509450604089013591508082111561118057600080fd5b5061118d89828a016110bc565b979a9699509497509295939492505050565b6020808252600e908201526d27b7363c9037bbb732b91031b0b760911b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156111f057600080fd5b825167ffffffffffffffff8082111561120857600080fd5b818501915085601f83011261121c57600080fd5b81518181111561122e5761122e6111c7565b604051601f8201601f19908116603f01168101908382118183101715611256576112566111c7565b81604052828152888684870101111561126e57600080fd5b600093505b828410156112905784840186015181850187015292850192611273565b828411156112a15760008684830101525b98975050505050505050565b6000602082840312156112bf57600080fd5b8151610ff481610ffb565b6000602082840312156112dc57600080fd5b8151610ff481610fbf565b6000602082840312156112f957600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526027908201527f4f6e6c7920746f6b656e206f776e657220636f756c64206672616374696f6e616040820152661b1a5e99481a5d60ca1b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006113a860608301888a61136b565b82810360208401526113bb81878961136b565b905082810360408401526113d081858761136b565b999850505050505050505056fea264697066735822122076db6351e378a745dfecb1c0576ec9ca58040462c9a47115687f3fe3235761ef64736f6c634300080f0033 \ No newline at end of file diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index 11277e2a2a..55c6d1afe7 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -180,21 +180,27 @@ describe('Fractionalizer contract usage', () => { describe('Negative Integration Tests for fractionalizer', () => { itWeb3('call setRFTCollection twice', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const fractionalizer = await deployFractionalizer(api, web3, owner); const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner); const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner); + + const fractionalizer = await deployFractionalizer(api, web3, owner); await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send(); await fractionalizer.methods.setRFTCollection(collectionIdAddress).send(); - await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).send()).to.be.eventually.rejected; + await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) + .to.eventually.be.rejectedWith(/RFT collection is already set$/g); }); itWeb3('call setRFTCollection with NFT collection', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const fractionalizer = await deployFractionalizer(api, web3, owner); const {collectionIdAddress} = await createNonfungibleCollection(api, web3, owner); + const nftContract = uniqueNFT(web3, collectionIdAddress, owner); + + const fractionalizer = await deployFractionalizer(api, web3, owner); + await nftContract.methods.addCollectionAdmin(fractionalizer.options.address).send(); - await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).send()).to.be.eventually.rejected; + await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) + .to.eventually.be.rejectedWith(/Wrong collection type. Collection is not refungible.$/g); }); itWeb3('call setRFTCollection while not collection admin', async ({api, web3, privateKeyWrapper}) => { @@ -202,7 +208,8 @@ describe('Negative Integration Tests for fractionalizer', () => { const fractionalizer = await deployFractionalizer(api, web3, owner); const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner); - await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).send()).to.be.eventually.rejected; + await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) + .to.eventually.be.rejectedWith(/Fractionalizer contract should be an admin of the collection$/g); }); itWeb3('call setRFTCollection after mintRFTCollection', async ({api, web3, privateKeyWrapper}) => { @@ -215,7 +222,8 @@ describe('Negative Integration Tests for fractionalizer', () => { const result = await fractionalizer.methods.mintRFTCollection('A', 'B', 'C').send({from: owner}); const collectionIdAddress = result.events.RFTCollectionSet.returnValues._collection; - await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).send()).to.be.eventually.rejected; + await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) + .to.eventually.be.rejectedWith(/RFT collection is already set$/g); }); itWeb3('call nft2rft without setting RFT collection for contract', async ({api, web3, privateKeyWrapper}) => { @@ -228,7 +236,8 @@ describe('Negative Integration Tests for fractionalizer', () => { const fractionalizer = await deployFractionalizer(api, web3, owner); - await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).send()).to.be.eventually.rejected; + await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) + .to.eventually.be.rejectedWith(/RFT collection is not set$/g); }); itWeb3('call nft2rft while not owner of NFT token', async ({api, web3, privateKeyWrapper}) => { @@ -244,7 +253,8 @@ describe('Negative Integration Tests for fractionalizer', () => { const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); - await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).send()).to.be.eventually.rejected; + await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) + .to.eventually.be.rejectedWith(/Only token owner could fractionalize it$/g); }); itWeb3('call nft2rft while not in list of allowed accounts', async ({api, web3, privateKeyWrapper}) => { @@ -258,7 +268,8 @@ describe('Negative Integration Tests for fractionalizer', () => { const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send(); - await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).send()).to.be.eventually.rejected; + await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) + .to.eventually.be.rejectedWith(/Fractionalization of this collection is not allowed by admin$/g); }); itWeb3('call nft2rft while fractionalizer doesnt have approval for nft token', async ({api, web3, privateKeyWrapper}) => { @@ -272,7 +283,8 @@ describe('Negative Integration Tests for fractionalizer', () => { const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); await fractionalizer.methods.setAllowlist(nftCollectionAddress, true).send(); - await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).send()).to.be.eventually.rejected; + await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) + .to.eventually.be.rejectedWith(/ApprovedValueTooLow$/g); }); itWeb3('call rft2nft without setting RFT collection for contract', async ({api, web3, privateKeyWrapper}) => { @@ -284,7 +296,8 @@ describe('Negative Integration Tests for fractionalizer', () => { const rftTokenId = await refungibleContract.methods.nextTokenId().call(); await refungibleContract.methods.mint(owner, rftTokenId).send(); - await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).send()).to.be.eventually.rejected; + await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).call()) + .to.eventually.be.rejectedWith(/RFT collection is not set$/g); }); itWeb3('call rft2nft for RFT token that is not from configured RFT collection', async ({api, web3, privateKeyWrapper}) => { @@ -296,7 +309,8 @@ describe('Negative Integration Tests for fractionalizer', () => { const rftTokenId = await refungibleContract.methods.nextTokenId().call(); await refungibleContract.methods.mint(owner, rftTokenId).send(); - await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).send()).to.be.eventually.rejected; + await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).call()) + .to.eventually.be.rejectedWith(/Wrong RFT collection$/g); }); itWeb3('call rft2nft for RFT token that was not minted by fractionalizer contract', async ({api, web3, privateKeyWrapper}) => { @@ -312,7 +326,8 @@ describe('Negative Integration Tests for fractionalizer', () => { const rftTokenId = await refungibleContract.methods.nextTokenId().call(); await refungibleContract.methods.mint(owner, rftTokenId).send(); - await expect(await fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).send()).to.be.eventually.rejected; + await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).call()) + .to.eventually.be.rejectedWith(/No corresponding NFT token found$/g); }); itWeb3('call rft2nft without owning all RFT pieces', async ({api, web3, privateKeyWrapper}) => { @@ -326,6 +341,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const refungibleTokenContract = uniqueRefungibleToken(web3, rftTokenAddress, owner); await refungibleTokenContract.methods.transfer(receiver, 50).send(); await refungibleTokenContract.methods.approve(fractionalizer.options.address, 50).send(); - await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, tokenId).send()).to.be.eventually.rejected; + await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, tokenId).call()) + .to.eventually.be.rejectedWith(/Not all pieces are owned by the caller$/g); }); }); \ No newline at end of file From c7669db53ab5faf5e5970b2ca20c5ad3c086c89b Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0314/1274] chore: make rft token default if parent token is not set --- pallets/refungible/src/erc_token.rs | 24 +++++++++++++++--------- tests/src/eth/reFungibleToken.test.ts | 17 +++++++++++++++++ 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/pallets/refungible/src/erc_token.rs b/pallets/refungible/src/erc_token.rs index 41fc9e0669..e47066b76e 100644 --- a/pallets/refungible/src/erc_token.rs +++ b/pallets/refungible/src/erc_token.rs @@ -59,8 +59,11 @@ impl RefungibleTokenHandle { let key_scoped = PropertyScope::Eth .apply(key) .expect("property key shouldn't exceed length limit"); - let value = props.get(&key_scoped).ok_or("key not found")?; - Ok(H160::from_slice(value.as_slice())) + if let Some(value) = props.get(&key_scoped) { + Ok(H160::from_slice(value.as_slice())) + } else { + Ok(*T::CrossTokenAddressMapping::token_to_address(self.id, self.1).as_eth()) + } } fn parent_token_id(&self) -> Result { @@ -71,13 +74,16 @@ impl RefungibleTokenHandle { let key_scoped = PropertyScope::Eth .apply(key) .expect("property key shouldn't exceed length limit"); - let value = props.get(&key_scoped).ok_or("key not found")?; - let nft_token_address = H160::from_slice(value.as_slice()); - let nft_token_account = T::CrossAccountId::from_eth(nft_token_address); - let (_, token_id) = T::CrossTokenAddressMapping::address_to_token(&nft_token_account) - .ok_or("parent NFT should contain NFT token address")?; - - Ok(token_id.into()) + if let Some(value) = props.get(&key_scoped) { + let nft_token_address = H160::from_slice(value.as_slice()); + let nft_token_account = T::CrossAccountId::from_eth(nft_token_address); + let (_, token_id) = T::CrossTokenAddressMapping::address_to_token(&nft_token_account) + .ok_or("parent NFT should contain NFT token address")?; + + Ok(token_id.into()) + } else { + Ok(self.1.into()) + } } } diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 5b135387a2..db8da82010 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -655,5 +655,22 @@ describe('ERC 1633 implementation', () => { expect(tokenAddress).to.be.equal(nftTokenAddress); expect(tokenId).to.be.equal(nftTokenId); }); + + itWeb3('Default parent token address and id', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const {collectionIdAddress, collectionId} = await createRefungibleCollection(api, web3, owner); + const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner); + const refungibleTokenId = await refungibleContract.methods.nextTokenId().call(); + await refungibleContract.methods.mint(owner, refungibleTokenId).send(); + + const rftTokenAddress = tokenIdToAddress(collectionId, refungibleTokenId); + const refungibleTokenContract = uniqueRefungibleToken(web3, rftTokenAddress, owner); + + const tokenAddress = await refungibleTokenContract.methods.parentToken().call(); + const tokenId = await refungibleTokenContract.methods.parentTokenId().call(); + expect(tokenAddress).to.be.equal(rftTokenAddress); + expect(tokenId).to.be.equal(refungibleTokenId); + }); }); From 2d2eac8ef8b2c4ec2a5fe091558f2b6d4cfb3b5d Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0315/1274] chore: fix `token_owner` weight --- pallets/nonfungible/src/common.rs | 2 +- pallets/refungible/src/benchmarking.rs | 2 -- pallets/refungible/src/common.rs | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pallets/nonfungible/src/common.rs b/pallets/nonfungible/src/common.rs index 16cd09c53b..d8da653dd8 100644 --- a/pallets/nonfungible/src/common.rs +++ b/pallets/nonfungible/src/common.rs @@ -120,7 +120,7 @@ impl CommonWeightInfo for CommonWeights { } fn token_owner() -> Weight { - 0 //>::token_owner() + >::token_owner() } } diff --git a/pallets/refungible/src/benchmarking.rs b/pallets/refungible/src/benchmarking.rs index 436af7a3a7..d39f876201 100644 --- a/pallets/refungible/src/benchmarking.rs +++ b/pallets/refungible/src/benchmarking.rs @@ -36,9 +36,7 @@ const SEED: u32 = 1; fn create_max_item_data( users: impl IntoIterator, ) -> CreateRefungibleExData { - let const_data = create_data::(); CreateRefungibleExData { - const_data, users: users .into_iter() .collect::>() diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index 8c46a61308..5bc0d42f19 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -150,7 +150,7 @@ impl CommonWeightInfo for CommonWeights { } fn token_owner() -> Weight { - 0 //>::token_owner() + >::token_owner() } } From 281718a050f1179e0053b046d84d2e3358a22828 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0316/1274] chore: update for contract method names and fix for contract compilation script --- .maintain/scripts/compile_fractionalizer.sh | 3 + .../src/eth/fractionalizer/Fractionalizer.bin | 2 +- .../src/eth/fractionalizer/Fractionalizer.sol | 8 +- .../eth/fractionalizer/FractionalizerAbi.json | 143 +++++++++++++++++- .../eth/fractionalizer/fractionalizer.test.ts | 20 +-- 5 files changed, 160 insertions(+), 16 deletions(-) diff --git a/.maintain/scripts/compile_fractionalizer.sh b/.maintain/scripts/compile_fractionalizer.sh index 1cb393ff34..178d5c47bf 100755 --- a/.maintain/scripts/compile_fractionalizer.sh +++ b/.maintain/scripts/compile_fractionalizer.sh @@ -14,5 +14,8 @@ cp $dir/tests/src/eth/api/UniqueRefungibleToken.sol api/UniqueRefungibleToken.so cp $dir/tests/src/eth/api/UniqueRefungible.sol api/UniqueRefungible.sol cp $dir/tests/src/eth/api/UniqueNFT.sol api/UniqueNFT.sol solcjs --optimize --bin refungible/input.sol -o $PWD +solcjs --abi -p refungible/input.sol mv refungible_input_sol_Fractionalizer.bin $dir/tests/src/eth/fractionalizer/Fractionalizer.bin +mv refungible_input_sol_Fractionalizer.abi refungible_input_sol_Fractionalizer.json +prettier refungible_input_sol_Fractionalizer.json > $dir/tests/src/eth/fractionalizer/FractionalizerAbi.json diff --git a/tests/src/eth/fractionalizer/Fractionalizer.bin b/tests/src/eth/fractionalizer/Fractionalizer.bin index 835f24d7bd..594ff259ae 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.bin +++ b/tests/src/eth/fractionalizer/Fractionalizer.bin @@ -1 +1 @@ -60c0604052600a60805269526546756e6769626c6560b01b60a0527fcdb72fd4e1d0d6d4eebd7ab142113ec2b4b06ddb24324db5c287ef01ab484d6b60055534801561004a57600080fd5b50600480546001600160a01b031916331790556114138061006c6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063115091401461005c578063b12527f814610071578063d470e60f14610084578063dbc38ad214610097578063f0d4cf5f146100aa575b600080fd5b61006f61006a366004610fd7565b6100bd565b005b61006f61007f366004611009565b61035b565b61006f610092366004611042565b6103e8565b61006f6100a536600461106e565b6107c5565b61006f6100b8366004611105565b610e67565b6004546001600160a01b031633146100f05760405162461bcd60e51b81526004016100e79061119f565b60405180910390fd5b6000546001600160a01b0316156101495760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b60008190506000816001600160a01b031663d34b55b86040518163ffffffff1660e01b81526004016000604051808303816000875af1158015610190573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101b891908101906111dd565b905060055481805190602001201461022f5760405162461bcd60e51b815260206004820152603460248201527f57726f6e6720636f6c6c656374696f6e20747970652e20436f6c6c656374696f604482015273371034b9903737ba103932b33ab733b4b136329760611b60648201526084016100e7565b816001600160a01b03166304a460536040518163ffffffff1660e01b81526004016020604051808303816000875af115801561026f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029391906112ad565b6103055760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a657220636f6e74726163742073686f756c64206260448201527f6520616e2061646d696e206f662074686520636f6c6c656374696f6e0000000060648201526084016100e7565b600080546001600160a01b0319166001600160a01b0385169081179091556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef9060200160405180910390a1505050565b6004546001600160a01b031633146103855760405162461bcd60e51b81526004016100e79061119f565b6001600160a01b038216600081815260016020908152604091829020805460ff19168515159081179091558251938452908301527f6dad0aed33f4b7f07095619b668698e17943fd9f4c83e7cfcc7f6dd880a11588910160405180910390a15050565b6000546001600160a01b031661043c5760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546001600160a01b038381169116146104905760405162461bcd60e51b81526020600482015260146024820152732bb937b7339029232a1031b7b63632b1ba34b7b760611b60448201526064016100e7565b600080546040516355bb7d6360e11b8152600481018490526001600160a01b039091169190829063ab76fac690602401602060405180830381865afa1580156104dd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050191906112ca565b6001600160a01b0380821660009081526003602090815260409182902082518084019093528054909316808352600190930154908201529192506105875760405162461bcd60e51b815260206004820181905260248201527f4e6f20636f72726573706f6e64696e67204e465420746f6b656e20666f756e6460448201526064016100e7565b6000829050806001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ee91906112e7565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610632573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065691906112e7565b146106b25760405162461bcd60e51b815260206004820152602660248201527f4e6f7420616c6c2070696563657320617265206f776e6564206279207468652060448201526531b0b63632b960d11b60648201526084016100e7565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd906106e290339030908a90600401611300565b600060405180830381600087803b1580156106fc57600080fd5b505af1158015610710573d6000803e3d6000fd5b5050835160208501516040516323b872dd60e01b81526001600160a01b0390921693506323b872dd925061074a9130913391600401611300565b600060405180830381600087803b15801561076457600080fd5b505af1158015610778573d6000803e3d6000fd5b5050835160208501516040517fd2628c68a4330ea5ba2e16305b03a4e974e760e86f302d43e6bc00c28918cb2294506107b5935087929190611300565b60405180910390a1505050505050565b6000546001600160a01b03166108195760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546040516331a9108f60e11b8152600481018490526001600160a01b0391821691339190861690636352211e90602401602060405180830381865afa158015610868573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088c91906112ca565b6001600160a01b0316146108b25760405162461bcd60e51b81526004016100e790611324565b6001600160a01b03841660009081526001602081905260409091205460ff161515146109465760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a6174696f6e206f66207468697320636f6c6c656360448201527f74696f6e206973206e6f7420616c6c6f7765642062792061646d696e0000000060648201526084016100e7565b6040516331a9108f60e11b81526004810184905233906001600160a01b03861690636352211e90602401602060405180830381865afa15801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b191906112ca565b6001600160a01b0316146109d75760405162461bcd60e51b81526004016100e790611324565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd90610a0790339030908890600401611300565b600060405180830381600087803b158015610a2157600080fd5b505af1158015610a35573d6000803e3d6000fd5b505050506001600160a01b0384166000908152600260209081526040808320868452909152812054819081908103610c8157836001600160a01b03166375794a3c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac991906112e7565b6040516340c10f1960e01b8152306004820152602481018290529093506001600160a01b038516906340c10f19906044016020604051808303816000875af1158015610b19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3d91906112ad565b506040516355bb7d6360e11b8152600481018490526001600160a01b0385169063ab76fac690602401602060405180830381865afa158015610b83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba791906112ca565b6001600160a01b0388811660008181526002602090815260408083208c84528252808320899055805180820182528481528083018d8152878716808652600390945293829020905181546001600160a01b0319169616959095178555915160019094019390935551630217888360e11b81526004810191909152602481018990529193508392509063042f1106906044016020604051808303816000875af1158015610c57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7b91906112ad565b50610d12565b6001600160a01b0387811660009081526002602090815260408083208a8452909152908190205490516355bb7d6360e11b8152600481018290529094509085169063ab76fac690602401602060405180830381865afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c91906112ca565b91508190505b60405163d2418ca760e01b81526001600160801b03861660048201526001600160a01b0382169063d2418ca7906024016020604051808303816000875af1158015610d61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8591906112ad565b5060405163a9059cbb60e01b81523360048201526001600160801b03861660248201526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610ddb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dff91906112ad565b50604080516001600160a01b03808a168252602082018990528416918101919091526001600160801b03861660608201527f29f372538523984f33874da1b50e596ce0f180a6eb04d7ff22bb2ce80e1576b6906080015b60405180910390a150505050505050565b6004546001600160a01b03163314610e915760405162461bcd60e51b81526004016100e79061119f565b6000546001600160a01b031615610eea5760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b6040516344a68ad560e01b8152736c4e9fe1ae37a41e93cee429e8e1881abdcbb54f9081906344a68ad590610f2d908a908a908a908a908a908a90600401611394565b6020604051808303816000875af1158015610f4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7091906112ca565b600080546001600160a01b0319166001600160a01b039290921691821790556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef90602001610e56565b6001600160a01b0381168114610fd457600080fd5b50565b600060208284031215610fe957600080fd5b8135610ff481610fbf565b9392505050565b8015158114610fd457600080fd5b6000806040838503121561101c57600080fd5b823561102781610fbf565b9150602083013561103781610ffb565b809150509250929050565b6000806040838503121561105557600080fd5b823561106081610fbf565b946020939093013593505050565b60008060006060848603121561108357600080fd5b833561108e81610fbf565b92506020840135915060408401356001600160801b03811681146110b157600080fd5b809150509250925092565b60008083601f8401126110ce57600080fd5b50813567ffffffffffffffff8111156110e657600080fd5b6020830191508360208285010111156110fe57600080fd5b9250929050565b6000806000806000806060878903121561111e57600080fd5b863567ffffffffffffffff8082111561113657600080fd5b6111428a838b016110bc565b9098509650602089013591508082111561115b57600080fd5b6111678a838b016110bc565b9096509450604089013591508082111561118057600080fd5b5061118d89828a016110bc565b979a9699509497509295939492505050565b6020808252600e908201526d27b7363c9037bbb732b91031b0b760911b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156111f057600080fd5b825167ffffffffffffffff8082111561120857600080fd5b818501915085601f83011261121c57600080fd5b81518181111561122e5761122e6111c7565b604051601f8201601f19908116603f01168101908382118183101715611256576112566111c7565b81604052828152888684870101111561126e57600080fd5b600093505b828410156112905784840186015181850187015292850192611273565b828411156112a15760008684830101525b98975050505050505050565b6000602082840312156112bf57600080fd5b8151610ff481610ffb565b6000602082840312156112dc57600080fd5b8151610ff481610fbf565b6000602082840312156112f957600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526027908201527f4f6e6c7920746f6b656e206f776e657220636f756c64206672616374696f6e616040820152661b1a5e99481a5d60ca1b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006113a860608301888a61136b565b82810360208401526113bb81878961136b565b905082810360408401526113d081858761136b565b999850505050505050505056fea264697066735822122076db6351e378a745dfecb1c0576ec9ca58040462c9a47115687f3fe3235761ef64736f6c634300080f0033 \ No newline at end of file +60c0604052600a60805269526546756e6769626c6560b01b60a0527fcdb72fd4e1d0d6d4eebd7ab142113ec2b4b06ddb24324db5c287ef01ab484d6b60055534801561004a57600080fd5b50600480546001600160a01b031916331790556114138061006c6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063115091401461005c5780631b191ea214610071578063d470e60f14610084578063dbc38ad214610097578063eb292412146100aa575b600080fd5b61006f61006a366004610fd7565b6100bd565b005b61006f61007f366004611044565b61035b565b61006f6100923660046110de565b6104c0565b61006f6100a536600461110a565b61089d565b61006f6100b8366004611166565b610f32565b6004546001600160a01b031633146100f05760405162461bcd60e51b81526004016100e79061119f565b60405180910390fd5b6000546001600160a01b0316156101495760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b60008190506000816001600160a01b031663d34b55b86040518163ffffffff1660e01b81526004016000604051808303816000875af1158015610190573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101b891908101906111dd565b905060055481805190602001201461022f5760405162461bcd60e51b815260206004820152603460248201527f57726f6e6720636f6c6c656374696f6e20747970652e20436f6c6c656374696f604482015273371034b9903737ba103932b33ab733b4b136329760611b60648201526084016100e7565b816001600160a01b03166304a460536040518163ffffffff1660e01b81526004016020604051808303816000875af115801561026f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029391906112ad565b6103055760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a657220636f6e74726163742073686f756c64206260448201527f6520616e2061646d696e206f662074686520636f6c6c656374696f6e0000000060648201526084016100e7565b600080546001600160a01b0319166001600160a01b0385169081179091556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef9060200160405180910390a1505050565b6004546001600160a01b031633146103855760405162461bcd60e51b81526004016100e79061119f565b6000546001600160a01b0316156103de5760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b6040516344a68ad560e01b8152736c4e9fe1ae37a41e93cee429e8e1881abdcbb54f9081906344a68ad590610421908a908a908a908a908a908a906004016112f3565b6020604051808303816000875af1158015610440573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610464919061133c565b600080546001600160a01b0319166001600160a01b039290921691821790556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef906020015b60405180910390a150505050505050565b6000546001600160a01b03166105145760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546001600160a01b038381169116146105685760405162461bcd60e51b81526020600482015260146024820152732bb937b7339029232a1031b7b63632b1ba34b7b760611b60448201526064016100e7565b600080546040516355bb7d6360e11b8152600481018490526001600160a01b039091169190829063ab76fac690602401602060405180830381865afa1580156105b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d9919061133c565b6001600160a01b03808216600090815260036020908152604091829020825180840190935280549093168083526001909301549082015291925061065f5760405162461bcd60e51b815260206004820181905260248201527f4e6f20636f72726573706f6e64696e67204e465420746f6b656e20666f756e6460448201526064016100e7565b6000829050806001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c69190611359565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a0823190602401602060405180830381865afa15801561070a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072e9190611359565b1461078a5760405162461bcd60e51b815260206004820152602660248201527f4e6f7420616c6c2070696563657320617265206f776e6564206279207468652060448201526531b0b63632b960d11b60648201526084016100e7565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd906107ba90339030908a90600401611372565b600060405180830381600087803b1580156107d457600080fd5b505af11580156107e8573d6000803e3d6000fd5b5050835160208501516040516323b872dd60e01b81526001600160a01b0390921693506323b872dd92506108229130913391600401611372565b600060405180830381600087803b15801561083c57600080fd5b505af1158015610850573d6000803e3d6000fd5b5050835160208501516040517fe9e9808d24ff79ccc3b1ecf48be7b2d11591adccc452150d0d7947cb48eb0d53945061088d935087929190611372565b60405180910390a1505050505050565b6000546001600160a01b03166108f15760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546040516331a9108f60e11b8152600481018490526001600160a01b0391821691339190861690636352211e90602401602060405180830381865afa158015610940573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610964919061133c565b6001600160a01b03161461098a5760405162461bcd60e51b81526004016100e790611396565b6001600160a01b03841660009081526001602081905260409091205460ff16151514610a1e5760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a6174696f6e206f66207468697320636f6c6c656360448201527f74696f6e206973206e6f7420616c6c6f7765642062792061646d696e0000000060648201526084016100e7565b6040516331a9108f60e11b81526004810184905233906001600160a01b03861690636352211e90602401602060405180830381865afa158015610a65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a89919061133c565b6001600160a01b031614610aaf5760405162461bcd60e51b81526004016100e790611396565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd90610adf90339030908890600401611372565b600060405180830381600087803b158015610af957600080fd5b505af1158015610b0d573d6000803e3d6000fd5b505050506001600160a01b0384166000908152600260209081526040808320868452909152812054819081908103610d5957836001600160a01b03166375794a3c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba19190611359565b6040516340c10f1960e01b8152306004820152602481018290529093506001600160a01b038516906340c10f19906044016020604051808303816000875af1158015610bf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1591906112ad565b506040516355bb7d6360e11b8152600481018490526001600160a01b0385169063ab76fac690602401602060405180830381865afa158015610c5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7f919061133c565b6001600160a01b0388811660008181526002602090815260408083208c84528252808320899055805180820182528481528083018d8152878716808652600390945293829020905181546001600160a01b0319169616959095178555915160019094019390935551630217888360e11b81526004810191909152602481018990529193508392509063042f1106906044016020604051808303816000875af1158015610d2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5391906112ad565b50610dea565b6001600160a01b0387811660009081526002602090815260408083208a8452909152908190205490516355bb7d6360e11b8152600481018290529094509085169063ab76fac690602401602060405180830381865afa158015610dc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de4919061133c565b91508190505b60405163d2418ca760e01b81526001600160801b03861660048201526001600160a01b0382169063d2418ca7906024016020604051808303816000875af1158015610e39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5d91906112ad565b5060405163a9059cbb60e01b81523360048201526001600160801b03861660248201526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610eb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed791906112ad565b50604080516001600160a01b03808a168252602082018990528416918101919091526001600160801b03861660608201527f29f372538523984f33874da1b50e596ce0f180a6eb04d7ff22bb2ce80e1576b6906080016104af565b6004546001600160a01b03163314610f5c5760405162461bcd60e51b81526004016100e79061119f565b6001600160a01b038216600081815260016020908152604091829020805460ff19168515159081179091558251938452908301527f6dad0aed33f4b7f07095619b668698e17943fd9f4c83e7cfcc7f6dd880a11588910160405180910390a15050565b6001600160a01b0381168114610fd457600080fd5b50565b600060208284031215610fe957600080fd5b8135610ff481610fbf565b9392505050565b60008083601f84011261100d57600080fd5b50813567ffffffffffffffff81111561102557600080fd5b60208301915083602082850101111561103d57600080fd5b9250929050565b6000806000806000806060878903121561105d57600080fd5b863567ffffffffffffffff8082111561107557600080fd5b6110818a838b01610ffb565b9098509650602089013591508082111561109a57600080fd5b6110a68a838b01610ffb565b909650945060408901359150808211156110bf57600080fd5b506110cc89828a01610ffb565b979a9699509497509295939492505050565b600080604083850312156110f157600080fd5b82356110fc81610fbf565b946020939093013593505050565b60008060006060848603121561111f57600080fd5b833561112a81610fbf565b92506020840135915060408401356001600160801b038116811461114d57600080fd5b809150509250925092565b8015158114610fd457600080fd5b6000806040838503121561117957600080fd5b823561118481610fbf565b9150602083013561119481611158565b809150509250929050565b6020808252600e908201526d27b7363c9037bbb732b91031b0b760911b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156111f057600080fd5b825167ffffffffffffffff8082111561120857600080fd5b818501915085601f83011261121c57600080fd5b81518181111561122e5761122e6111c7565b604051601f8201601f19908116603f01168101908382118183101715611256576112566111c7565b81604052828152888684870101111561126e57600080fd5b600093505b828410156112905784840186015181850187015292850192611273565b828411156112a15760008684830101525b98975050505050505050565b6000602082840312156112bf57600080fd5b8151610ff481611158565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061130760608301888a6112ca565b828103602084015261131a8187896112ca565b9050828103604084015261132f8185876112ca565b9998505050505050505050565b60006020828403121561134e57600080fd5b8151610ff481610fbf565b60006020828403121561136b57600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526027908201527f4f6e6c7920746f6b656e206f776e657220636f756c64206672616374696f6e616040820152661b1a5e99481a5d60ca1b60608201526080019056fea2646970667358221220f0c80476760f4be8497504758c3f192eb67e71e7fec57d1c010829bb7ea7807464736f6c634300080f0033 \ No newline at end of file diff --git a/tests/src/eth/fractionalizer/Fractionalizer.sol b/tests/src/eth/fractionalizer/Fractionalizer.sol index 37013330f0..1371815465 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.sol +++ b/tests/src/eth/fractionalizer/Fractionalizer.sol @@ -30,7 +30,7 @@ contract Fractionalizer { event RFTCollectionSet(address _collection); event AllowListSet(address _collection, bool _status); event Fractionalized(address _collection, uint256 _tokenId, address _rftToken, uint128 _amount); - event DeFractionalized(address _rftToken, address _nftCollection, uint256 _nftTokenId); + event Defractionalized(address _rftToken, address _nftCollection, uint256 _nftTokenId); function setRFTCollection(address _collection) public onlyOwner { require( @@ -52,7 +52,7 @@ contract Fractionalizer { emit RFTCollectionSet(rftCollection); } - function mintRFTCollection(string calldata _name, string calldata _description, string calldata _tokenPrefix) public onlyOwner { + function createAndSetRFTCollection(string calldata _name, string calldata _description, string calldata _tokenPrefix) public onlyOwner { require( rftCollection == address(0), "RFT collection is already set" @@ -62,7 +62,7 @@ contract Fractionalizer { emit RFTCollectionSet(rftCollection); } - function setAllowlist(address collection, bool status) public onlyOwner { + function setNftCollectionIsAllowed(address collection, bool status) public onlyOwner { nftCollectionAllowList[collection] = status; emit AllowListSet(collection, status); } @@ -139,6 +139,6 @@ contract Fractionalizer { msg.sender, nftToken._tokenId ); - emit DeFractionalized(rftTokenAddress, nftToken._collection, nftToken._tokenId); + emit Defractionalized(rftTokenAddress, nftToken._collection, nftToken._tokenId); } } \ No newline at end of file diff --git a/tests/src/eth/fractionalizer/FractionalizerAbi.json b/tests/src/eth/fractionalizer/FractionalizerAbi.json index ed7cf8f607..295d68ecc1 100644 --- a/tests/src/eth/fractionalizer/FractionalizerAbi.json +++ b/tests/src/eth/fractionalizer/FractionalizerAbi.json @@ -1 +1,142 @@ -[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_collection","type":"address"},{"indexed":false,"internalType":"bool","name":"_status","type":"bool"}],"name":"AllowListSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_rftToken","type":"address"},{"indexed":false,"internalType":"address","name":"_nftCollection","type":"address"},{"indexed":false,"internalType":"uint256","name":"_nftTokenId","type":"uint256"}],"name":"DeFractionalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_collection","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"_rftToken","type":"address"},{"indexed":false,"internalType":"uint128","name":"_amount","type":"uint128"}],"name":"Fractionalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_collection","type":"address"}],"name":"RFTCollectionSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"msg","type":"string"}],"name":"Test","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"msg","type":"bytes"}],"name":"TestB","type":"event"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_description","type":"string"},{"internalType":"string","name":"_tokenPrefix","type":"string"}],"name":"mintRFTCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"uint256","name":"_token","type":"uint256"},{"internalType":"uint128","name":"_pieces","type":"uint128"}],"name":"nft2rft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"uint256","name":"_token","type":"uint256"}],"name":"rft2nft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setAllowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"}],"name":"setRFTCollection","outputs":[],"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file +[ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_collection", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_status", + "type": "bool" + } + ], + "name": "AllowListSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_rftToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "_nftCollection", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_nftTokenId", + "type": "uint256" + } + ], + "name": "Defractionalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_collection", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_tokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "_rftToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "_amount", + "type": "uint128" + } + ], + "name": "Fractionalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_collection", + "type": "address" + } + ], + "name": "RFTCollectionSet", + "type": "event" + }, + { + "inputs": [ + { "internalType": "string", "name": "_name", "type": "string" }, + { "internalType": "string", "name": "_description", "type": "string" }, + { "internalType": "string", "name": "_tokenPrefix", "type": "string" } + ], + "name": "createAndSetRFTCollection", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_collection", "type": "address" }, + { "internalType": "uint256", "name": "_token", "type": "uint256" }, + { "internalType": "uint128", "name": "_pieces", "type": "uint128" } + ], + "name": "nft2rft", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_collection", "type": "address" }, + { "internalType": "uint256", "name": "_token", "type": "uint256" } + ], + "name": "rft2nft", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "bool", "name": "status", "type": "bool" } + ], + "name": "setNftCollectionIsAllowed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_collection", "type": "address" } + ], + "name": "setRFTCollection", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index 55c6d1afe7..65903e5e1d 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -46,7 +46,7 @@ async function initFractionalizer(api: ApiPromise, web3: Web3, privateKeyWrapper const tx = api.tx.balances.transfer(evmToAddress(fractionalizer.options.address), 10n * UNIQUE); const alice = privateKeyWrapper('//Alice'); await submitTransactionAsync(alice, tx); - const result = await fractionalizer.methods.mintRFTCollection('A', 'B', 'C').send(); + const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send(); const rftCollectionAddress = result.events.RFTCollectionSet.returnValues._collection; return {fractionalizer, rftCollectionAddress}; } @@ -57,7 +57,7 @@ async function createRFTToken(api: ApiPromise, web3: Web3, owner: string, fracti const nftTokenId = await nftContract.methods.nextTokenId().call(); await nftContract.methods.mint(owner, nftTokenId).send(); - await fractionalizer.methods.setAllowlist(nftCollectionAddress, true).send(); + await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send(); await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send(); const result = await fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, amount).send(); const {_collection, _tokenId, _rftToken} = result.events.Fractionalized.returnValues; @@ -92,7 +92,7 @@ describe('Fractionalizer contract usage', () => { const tx = api.tx.balances.transfer(evmToAddress(fractionalizer.options.address), 10n * UNIQUE); await submitTransactionAsync(alice, tx); - const result = await fractionalizer.methods.mintRFTCollection('A', 'B', 'C').send({from: owner}); + const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({from: owner}); expect(result.events).to.be.like({ RFTCollectionSet: {}, }); @@ -104,7 +104,7 @@ describe('Fractionalizer contract usage', () => { const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); - const result1 = await fractionalizer.methods.setAllowlist(nftCollectionAddress, true).send({from: owner}); + const result1 = await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send({from: owner}); expect(result1.events).to.be.like({ AllowListSet: { returnValues: { @@ -113,7 +113,7 @@ describe('Fractionalizer contract usage', () => { }, }, }); - const result2 = await fractionalizer.methods.setAllowlist(nftCollectionAddress, false).send({from: owner}); + const result2 = await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, false).send({from: owner}); expect(result2.events).to.be.like({ AllowListSet: { returnValues: { @@ -134,7 +134,7 @@ describe('Fractionalizer contract usage', () => { const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); - await fractionalizer.methods.setAllowlist(nftCollectionAddress, true).send(); + await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send(); await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send(); const result = await fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).send(); expect(result.events).to.be.like({ @@ -164,7 +164,7 @@ describe('Fractionalizer contract usage', () => { await refungibleTokenContract.methods.approve(fractionalizer.options.address, 100).send(); const result = await fractionalizer.methods.rft2nft(refungibleAddress, tokenId).send(); expect(result.events).to.be.like({ - DeFractionalized: { + Defractionalized: { returnValues: { _rftToken: rftTokenAddress, _nftCollection: nftCollectionAddress, @@ -212,14 +212,14 @@ describe('Negative Integration Tests for fractionalizer', () => { .to.eventually.be.rejectedWith(/Fractionalizer contract should be an admin of the collection$/g); }); - itWeb3('call setRFTCollection after mintRFTCollection', async ({api, web3, privateKeyWrapper}) => { + itWeb3('call setRFTCollection after createAndSetRFTCollection', async ({api, web3, privateKeyWrapper}) => { const alice = privateKeyWrapper('//Alice'); const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const fractionalizer = await deployFractionalizer(api, web3, owner); const tx = api.tx.balances.transfer(evmToAddress(fractionalizer.options.address), 10n * UNIQUE); await submitTransactionAsync(alice, tx); - const result = await fractionalizer.methods.mintRFTCollection('A', 'B', 'C').send({from: owner}); + const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({from: owner}); const collectionIdAddress = result.events.RFTCollectionSet.returnValues._collection; await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) @@ -282,7 +282,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); - await fractionalizer.methods.setAllowlist(nftCollectionAddress, true).send(); + await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send(); await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) .to.eventually.be.rejectedWith(/ApprovedValueTooLow$/g); }); From 817fef63882f0bb3de23dc85c087d6cee6113336 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0317/1274] chore: remove duplicated check in fractionalizer contract --- tests/src/eth/fractionalizer/Fractionalizer.bin | 2 +- tests/src/eth/fractionalizer/Fractionalizer.sol | 4 ---- tests/src/eth/fractionalizer/fractionalizer.test.ts | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/src/eth/fractionalizer/Fractionalizer.bin b/tests/src/eth/fractionalizer/Fractionalizer.bin index 594ff259ae..7cfd83958f 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.bin +++ b/tests/src/eth/fractionalizer/Fractionalizer.bin @@ -1 +1 @@ -60c0604052600a60805269526546756e6769626c6560b01b60a0527fcdb72fd4e1d0d6d4eebd7ab142113ec2b4b06ddb24324db5c287ef01ab484d6b60055534801561004a57600080fd5b50600480546001600160a01b031916331790556114138061006c6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063115091401461005c5780631b191ea214610071578063d470e60f14610084578063dbc38ad214610097578063eb292412146100aa575b600080fd5b61006f61006a366004610fd7565b6100bd565b005b61006f61007f366004611044565b61035b565b61006f6100923660046110de565b6104c0565b61006f6100a536600461110a565b61089d565b61006f6100b8366004611166565b610f32565b6004546001600160a01b031633146100f05760405162461bcd60e51b81526004016100e79061119f565b60405180910390fd5b6000546001600160a01b0316156101495760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b60008190506000816001600160a01b031663d34b55b86040518163ffffffff1660e01b81526004016000604051808303816000875af1158015610190573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101b891908101906111dd565b905060055481805190602001201461022f5760405162461bcd60e51b815260206004820152603460248201527f57726f6e6720636f6c6c656374696f6e20747970652e20436f6c6c656374696f604482015273371034b9903737ba103932b33ab733b4b136329760611b60648201526084016100e7565b816001600160a01b03166304a460536040518163ffffffff1660e01b81526004016020604051808303816000875af115801561026f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029391906112ad565b6103055760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a657220636f6e74726163742073686f756c64206260448201527f6520616e2061646d696e206f662074686520636f6c6c656374696f6e0000000060648201526084016100e7565b600080546001600160a01b0319166001600160a01b0385169081179091556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef9060200160405180910390a1505050565b6004546001600160a01b031633146103855760405162461bcd60e51b81526004016100e79061119f565b6000546001600160a01b0316156103de5760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b6040516344a68ad560e01b8152736c4e9fe1ae37a41e93cee429e8e1881abdcbb54f9081906344a68ad590610421908a908a908a908a908a908a906004016112f3565b6020604051808303816000875af1158015610440573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610464919061133c565b600080546001600160a01b0319166001600160a01b039290921691821790556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef906020015b60405180910390a150505050505050565b6000546001600160a01b03166105145760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546001600160a01b038381169116146105685760405162461bcd60e51b81526020600482015260146024820152732bb937b7339029232a1031b7b63632b1ba34b7b760611b60448201526064016100e7565b600080546040516355bb7d6360e11b8152600481018490526001600160a01b039091169190829063ab76fac690602401602060405180830381865afa1580156105b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d9919061133c565b6001600160a01b03808216600090815260036020908152604091829020825180840190935280549093168083526001909301549082015291925061065f5760405162461bcd60e51b815260206004820181905260248201527f4e6f20636f72726573706f6e64696e67204e465420746f6b656e20666f756e6460448201526064016100e7565b6000829050806001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c69190611359565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a0823190602401602060405180830381865afa15801561070a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072e9190611359565b1461078a5760405162461bcd60e51b815260206004820152602660248201527f4e6f7420616c6c2070696563657320617265206f776e6564206279207468652060448201526531b0b63632b960d11b60648201526084016100e7565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd906107ba90339030908a90600401611372565b600060405180830381600087803b1580156107d457600080fd5b505af11580156107e8573d6000803e3d6000fd5b5050835160208501516040516323b872dd60e01b81526001600160a01b0390921693506323b872dd92506108229130913391600401611372565b600060405180830381600087803b15801561083c57600080fd5b505af1158015610850573d6000803e3d6000fd5b5050835160208501516040517fe9e9808d24ff79ccc3b1ecf48be7b2d11591adccc452150d0d7947cb48eb0d53945061088d935087929190611372565b60405180910390a1505050505050565b6000546001600160a01b03166108f15760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546040516331a9108f60e11b8152600481018490526001600160a01b0391821691339190861690636352211e90602401602060405180830381865afa158015610940573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610964919061133c565b6001600160a01b03161461098a5760405162461bcd60e51b81526004016100e790611396565b6001600160a01b03841660009081526001602081905260409091205460ff16151514610a1e5760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a6174696f6e206f66207468697320636f6c6c656360448201527f74696f6e206973206e6f7420616c6c6f7765642062792061646d696e0000000060648201526084016100e7565b6040516331a9108f60e11b81526004810184905233906001600160a01b03861690636352211e90602401602060405180830381865afa158015610a65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a89919061133c565b6001600160a01b031614610aaf5760405162461bcd60e51b81526004016100e790611396565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd90610adf90339030908890600401611372565b600060405180830381600087803b158015610af957600080fd5b505af1158015610b0d573d6000803e3d6000fd5b505050506001600160a01b0384166000908152600260209081526040808320868452909152812054819081908103610d5957836001600160a01b03166375794a3c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba19190611359565b6040516340c10f1960e01b8152306004820152602481018290529093506001600160a01b038516906340c10f19906044016020604051808303816000875af1158015610bf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1591906112ad565b506040516355bb7d6360e11b8152600481018490526001600160a01b0385169063ab76fac690602401602060405180830381865afa158015610c5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7f919061133c565b6001600160a01b0388811660008181526002602090815260408083208c84528252808320899055805180820182528481528083018d8152878716808652600390945293829020905181546001600160a01b0319169616959095178555915160019094019390935551630217888360e11b81526004810191909152602481018990529193508392509063042f1106906044016020604051808303816000875af1158015610d2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5391906112ad565b50610dea565b6001600160a01b0387811660009081526002602090815260408083208a8452909152908190205490516355bb7d6360e11b8152600481018290529094509085169063ab76fac690602401602060405180830381865afa158015610dc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de4919061133c565b91508190505b60405163d2418ca760e01b81526001600160801b03861660048201526001600160a01b0382169063d2418ca7906024016020604051808303816000875af1158015610e39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5d91906112ad565b5060405163a9059cbb60e01b81523360048201526001600160801b03861660248201526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610eb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed791906112ad565b50604080516001600160a01b03808a168252602082018990528416918101919091526001600160801b03861660608201527f29f372538523984f33874da1b50e596ce0f180a6eb04d7ff22bb2ce80e1576b6906080016104af565b6004546001600160a01b03163314610f5c5760405162461bcd60e51b81526004016100e79061119f565b6001600160a01b038216600081815260016020908152604091829020805460ff19168515159081179091558251938452908301527f6dad0aed33f4b7f07095619b668698e17943fd9f4c83e7cfcc7f6dd880a11588910160405180910390a15050565b6001600160a01b0381168114610fd457600080fd5b50565b600060208284031215610fe957600080fd5b8135610ff481610fbf565b9392505050565b60008083601f84011261100d57600080fd5b50813567ffffffffffffffff81111561102557600080fd5b60208301915083602082850101111561103d57600080fd5b9250929050565b6000806000806000806060878903121561105d57600080fd5b863567ffffffffffffffff8082111561107557600080fd5b6110818a838b01610ffb565b9098509650602089013591508082111561109a57600080fd5b6110a68a838b01610ffb565b909650945060408901359150808211156110bf57600080fd5b506110cc89828a01610ffb565b979a9699509497509295939492505050565b600080604083850312156110f157600080fd5b82356110fc81610fbf565b946020939093013593505050565b60008060006060848603121561111f57600080fd5b833561112a81610fbf565b92506020840135915060408401356001600160801b038116811461114d57600080fd5b809150509250925092565b8015158114610fd457600080fd5b6000806040838503121561117957600080fd5b823561118481610fbf565b9150602083013561119481611158565b809150509250929050565b6020808252600e908201526d27b7363c9037bbb732b91031b0b760911b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156111f057600080fd5b825167ffffffffffffffff8082111561120857600080fd5b818501915085601f83011261121c57600080fd5b81518181111561122e5761122e6111c7565b604051601f8201601f19908116603f01168101908382118183101715611256576112566111c7565b81604052828152888684870101111561126e57600080fd5b600093505b828410156112905784840186015181850187015292850192611273565b828411156112a15760008684830101525b98975050505050505050565b6000602082840312156112bf57600080fd5b8151610ff481611158565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061130760608301888a6112ca565b828103602084015261131a8187896112ca565b9050828103604084015261132f8185876112ca565b9998505050505050505050565b60006020828403121561134e57600080fd5b8151610ff481610fbf565b60006020828403121561136b57600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526027908201527f4f6e6c7920746f6b656e206f776e657220636f756c64206672616374696f6e616040820152661b1a5e99481a5d60ca1b60608201526080019056fea2646970667358221220f0c80476760f4be8497504758c3f192eb67e71e7fec57d1c010829bb7ea7807464736f6c634300080f0033 \ No newline at end of file +60c0604052600a60805269526546756e6769626c6560b01b60a0527fcdb72fd4e1d0d6d4eebd7ab142113ec2b4b06ddb24324db5c287ef01ab484d6b60055534801561004a57600080fd5b50600480546001600160a01b0319163317905561137a8061006c6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063115091401461005c5780631b191ea214610071578063d470e60f14610084578063dbc38ad214610097578063eb292412146100aa575b600080fd5b61006f61006a366004610f85565b6100bd565b005b61006f61007f366004610ff2565b61035b565b61006f61009236600461108c565b6104c0565b61006f6100a53660046110b8565b61089d565b61006f6100b8366004611114565b610ee0565b6004546001600160a01b031633146100f05760405162461bcd60e51b81526004016100e79061114d565b60405180910390fd5b6000546001600160a01b0316156101495760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b60008190506000816001600160a01b031663d34b55b86040518163ffffffff1660e01b81526004016000604051808303816000875af1158015610190573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101b8919081019061118b565b905060055481805190602001201461022f5760405162461bcd60e51b815260206004820152603460248201527f57726f6e6720636f6c6c656374696f6e20747970652e20436f6c6c656374696f604482015273371034b9903737ba103932b33ab733b4b136329760611b60648201526084016100e7565b816001600160a01b03166304a460536040518163ffffffff1660e01b81526004016020604051808303816000875af115801561026f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610293919061125b565b6103055760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a657220636f6e74726163742073686f756c64206260448201527f6520616e2061646d696e206f662074686520636f6c6c656374696f6e0000000060648201526084016100e7565b600080546001600160a01b0319166001600160a01b0385169081179091556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef9060200160405180910390a1505050565b6004546001600160a01b031633146103855760405162461bcd60e51b81526004016100e79061114d565b6000546001600160a01b0316156103de5760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b6040516344a68ad560e01b8152736c4e9fe1ae37a41e93cee429e8e1881abdcbb54f9081906344a68ad590610421908a908a908a908a908a908a906004016112a1565b6020604051808303816000875af1158015610440573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046491906112ea565b600080546001600160a01b0319166001600160a01b039290921691821790556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef906020015b60405180910390a150505050505050565b6000546001600160a01b03166105145760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546001600160a01b038381169116146105685760405162461bcd60e51b81526020600482015260146024820152732bb937b7339029232a1031b7b63632b1ba34b7b760611b60448201526064016100e7565b600080546040516355bb7d6360e11b8152600481018490526001600160a01b039091169190829063ab76fac690602401602060405180830381865afa1580156105b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d991906112ea565b6001600160a01b03808216600090815260036020908152604091829020825180840190935280549093168083526001909301549082015291925061065f5760405162461bcd60e51b815260206004820181905260248201527f4e6f20636f72726573706f6e64696e67204e465420746f6b656e20666f756e6460448201526064016100e7565b6000829050806001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c69190611307565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a0823190602401602060405180830381865afa15801561070a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072e9190611307565b1461078a5760405162461bcd60e51b815260206004820152602660248201527f4e6f7420616c6c2070696563657320617265206f776e6564206279207468652060448201526531b0b63632b960d11b60648201526084016100e7565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd906107ba90339030908a90600401611320565b600060405180830381600087803b1580156107d457600080fd5b505af11580156107e8573d6000803e3d6000fd5b5050835160208501516040516323b872dd60e01b81526001600160a01b0390921693506323b872dd92506108229130913391600401611320565b600060405180830381600087803b15801561083c57600080fd5b505af1158015610850573d6000803e3d6000fd5b5050835160208501516040517fe9e9808d24ff79ccc3b1ecf48be7b2d11591adccc452150d0d7947cb48eb0d53945061088d935087929190611320565b60405180910390a1505050505050565b6000546001600160a01b03166108f15760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b600080546001600160a01b0385811683526001602081905260409093205491169160ff90911615151461098c5760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a6174696f6e206f66207468697320636f6c6c656360448201527f74696f6e206973206e6f7420616c6c6f7765642062792061646d696e0000000060648201526084016100e7565b6040516331a9108f60e11b81526004810184905233906001600160a01b03861690636352211e90602401602060405180830381865afa1580156109d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f791906112ea565b6001600160a01b031614610a5d5760405162461bcd60e51b815260206004820152602760248201527f4f6e6c7920746f6b656e206f776e657220636f756c64206672616374696f6e616044820152661b1a5e99481a5d60ca1b60648201526084016100e7565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd90610a8d90339030908890600401611320565b600060405180830381600087803b158015610aa757600080fd5b505af1158015610abb573d6000803e3d6000fd5b505050506001600160a01b0384166000908152600260209081526040808320868452909152812054819081908103610d0757836001600160a01b03166375794a3c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4f9190611307565b6040516340c10f1960e01b8152306004820152602481018290529093506001600160a01b038516906340c10f19906044016020604051808303816000875af1158015610b9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc3919061125b565b506040516355bb7d6360e11b8152600481018490526001600160a01b0385169063ab76fac690602401602060405180830381865afa158015610c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2d91906112ea565b6001600160a01b0388811660008181526002602090815260408083208c84528252808320899055805180820182528481528083018d8152878716808652600390945293829020905181546001600160a01b0319169616959095178555915160019094019390935551630217888360e11b81526004810191909152602481018990529193508392509063042f1106906044016020604051808303816000875af1158015610cdd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d01919061125b565b50610d98565b6001600160a01b0387811660009081526002602090815260408083208a8452909152908190205490516355bb7d6360e11b8152600481018290529094509085169063ab76fac690602401602060405180830381865afa158015610d6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9291906112ea565b91508190505b60405163d2418ca760e01b81526001600160801b03861660048201526001600160a01b0382169063d2418ca7906024016020604051808303816000875af1158015610de7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0b919061125b565b5060405163a9059cbb60e01b81523360048201526001600160801b03861660248201526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610e61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e85919061125b565b50604080516001600160a01b03808a168252602082018990528416918101919091526001600160801b03861660608201527f29f372538523984f33874da1b50e596ce0f180a6eb04d7ff22bb2ce80e1576b6906080016104af565b6004546001600160a01b03163314610f0a5760405162461bcd60e51b81526004016100e79061114d565b6001600160a01b038216600081815260016020908152604091829020805460ff19168515159081179091558251938452908301527f6dad0aed33f4b7f07095619b668698e17943fd9f4c83e7cfcc7f6dd880a11588910160405180910390a15050565b6001600160a01b0381168114610f8257600080fd5b50565b600060208284031215610f9757600080fd5b8135610fa281610f6d565b9392505050565b60008083601f840112610fbb57600080fd5b50813567ffffffffffffffff811115610fd357600080fd5b602083019150836020828501011115610feb57600080fd5b9250929050565b6000806000806000806060878903121561100b57600080fd5b863567ffffffffffffffff8082111561102357600080fd5b61102f8a838b01610fa9565b9098509650602089013591508082111561104857600080fd5b6110548a838b01610fa9565b9096509450604089013591508082111561106d57600080fd5b5061107a89828a01610fa9565b979a9699509497509295939492505050565b6000806040838503121561109f57600080fd5b82356110aa81610f6d565b946020939093013593505050565b6000806000606084860312156110cd57600080fd5b83356110d881610f6d565b92506020840135915060408401356001600160801b03811681146110fb57600080fd5b809150509250925092565b8015158114610f8257600080fd5b6000806040838503121561112757600080fd5b823561113281610f6d565b9150602083013561114281611106565b809150509250929050565b6020808252600e908201526d27b7363c9037bbb732b91031b0b760911b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561119e57600080fd5b825167ffffffffffffffff808211156111b657600080fd5b818501915085601f8301126111ca57600080fd5b8151818111156111dc576111dc611175565b604051601f8201601f19908116603f0116810190838211818310171561120457611204611175565b81604052828152888684870101111561121c57600080fd5b600093505b8284101561123e5784840186015181850187015292850192611221565b8284111561124f5760008684830101525b98975050505050505050565b60006020828403121561126d57600080fd5b8151610fa281611106565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006112b560608301888a611278565b82810360208401526112c8818789611278565b905082810360408401526112dd818587611278565b9998505050505050505050565b6000602082840312156112fc57600080fd5b8151610fa281610f6d565b60006020828403121561131957600080fd5b5051919050565b6001600160a01b03938416815291909216602082015260408101919091526060019056fea2646970667358221220a118fe8c3b83b3933baa7bfe084ed165a014ec509367252e5c99e1a3332d000364736f6c634300080f0033 \ No newline at end of file diff --git a/tests/src/eth/fractionalizer/Fractionalizer.sol b/tests/src/eth/fractionalizer/Fractionalizer.sol index 1371815465..46f62d46d9 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.sol +++ b/tests/src/eth/fractionalizer/Fractionalizer.sol @@ -73,10 +73,6 @@ contract Fractionalizer { "RFT collection is not set" ); UniqueRefungible rftCollectionContract = UniqueRefungible(rftCollection); - require( - UniqueNFT(_collection).ownerOf(_token) == msg.sender, - "Only token owner could fractionalize it" - ); require( nftCollectionAllowList[_collection] == true, "Fractionalization of this collection is not allowed by admin" diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index 65903e5e1d..0a5df3aba7 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -252,6 +252,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); + await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send(); await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) .to.eventually.be.rejectedWith(/Only token owner could fractionalize it$/g); From 7e5f90964b480ca5b2bd80e729e93a966ab3d61c Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0318/1274] chore: compile fractionalizer in typescript --- .maintain/scripts/compile_fractionalizer.sh | 21 ----- Makefile | 5 +- .../eth/fractionalizer/fractionalizer.test.ts | 80 +++++++++++++++---- tests/src/eth/util/helpers.ts | 7 +- 4 files changed, 72 insertions(+), 41 deletions(-) delete mode 100755 .maintain/scripts/compile_fractionalizer.sh diff --git a/.maintain/scripts/compile_fractionalizer.sh b/.maintain/scripts/compile_fractionalizer.sh deleted file mode 100755 index 178d5c47bf..0000000000 --- a/.maintain/scripts/compile_fractionalizer.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -set -eu - -dir=$PWD - -tmp=$(mktemp -d) -cd $tmp -mkdir refungible -mkdir api -cp $dir/tests/src/eth/fractionalizer/Fractionalizer.sol refungible/input.sol -cp $dir/tests/src/eth/api/CollectionHelpers.sol api/CollectionHelpers.sol -cp $dir/tests/src/eth/api/ContractHelpers.sol api/ContractHelpers.sol -cp $dir/tests/src/eth/api/UniqueRefungibleToken.sol api/UniqueRefungibleToken.sol -cp $dir/tests/src/eth/api/UniqueRefungible.sol api/UniqueRefungible.sol -cp $dir/tests/src/eth/api/UniqueNFT.sol api/UniqueNFT.sol -solcjs --optimize --bin refungible/input.sol -o $PWD -solcjs --abi -p refungible/input.sol - -mv refungible_input_sol_Fractionalizer.bin $dir/tests/src/eth/fractionalizer/Fractionalizer.bin -mv refungible_input_sol_Fractionalizer.abi refungible_input_sol_Fractionalizer.json -prettier refungible_input_sol_Fractionalizer.json > $dir/tests/src/eth/fractionalizer/FractionalizerAbi.json diff --git a/Makefile b/Makefile index 669c2437f0..f468a410aa 100644 --- a/Makefile +++ b/Makefile @@ -78,10 +78,7 @@ CollectionHelpers: CollectionHelpers.sol INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_STUBS)/CollectionHelpers.raw ./.maintain/scripts/compile_stub.sh INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_ABI) ./.maintain/scripts/generate_abi.sh -Fractionalizer: - ./.maintain/scripts/compile_fractionalizer.sh - -evm_stubs: UniqueFungible UniqueNFT UniqueRefungible UniqueRefungibleToken ContractHelpers CollectionHelpers Fractionalizer +evm_stubs: UniqueFungible UniqueNFT UniqueRefungible UniqueRefungibleToken ContractHelpers CollectionHelpers .PHONY: _bench _bench: diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index 0a5df3aba7..d2ccf60c2b 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -19,11 +19,11 @@ import Web3 from 'web3'; import {ApiPromise} from '@polkadot/api'; import {evmToAddress} from '@polkadot/util-crypto'; import {readFile} from 'fs/promises'; -import fractionalizerAbi from './FractionalizerAbi.json'; import {submitTransactionAsync} from '../../substrate/substrate-api'; import {UNIQUE} from '../../util/helpers'; -import {collectionIdToAddress, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers'; +import {collectionIdToAddress, CompiledContract, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers'; import {Contract} from 'web3-eth-contract'; +import * as solc from 'solc'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; @@ -32,17 +32,67 @@ import {IKeyringPair} from '@polkadot/types/types'; chai.use(chaiAsPromised); chai.use(chaiLike); const expect = chai.expect; +let fractionalizer: CompiledContract; + +async function compileFractionalizer() { + if (!fractionalizer) { + const input = { + language: 'Solidity', + sources: { + ['Fractionalizer.sol']: { + content: (await readFile(`${__dirname}/Fractionalizer.sol`)).toString(), + }, + }, + settings: { + outputSelection: { + '*': { + '*': ['*'], + }, + }, + }, + }; + const json = JSON.parse(solc.compile(JSON.stringify(input), {import: await findImports()})); + const out = json.contracts['Fractionalizer.sol']['Fractionalizer']; + + fractionalizer = { + abi: out.abi, + object: '0x' + out.evm.bytecode.object, + }; + } + return fractionalizer; +} + +async function findImports() { + const collectionHelpers = (await readFile(`${__dirname}/../api/CollectionHelpers.sol`)).toString(); + const contractHelpers = (await readFile(`${__dirname}/../api/ContractHelpers.sol`)).toString(); + const uniqueRefungibleToken = (await readFile(`${__dirname}/../api/UniqueRefungibleToken.sol`)).toString(); + const uniqueRefungible = (await readFile(`${__dirname}/../api/UniqueRefungible.sol`)).toString(); + const uniqueNFT = (await readFile(`${__dirname}/../api/UniqueNFT.sol`)).toString(); + + return function(path: string) { + switch (path) { + case 'api/CollectionHelpers.sol': return {contents: `${collectionHelpers}`}; + case 'api/ContractHelpers.sol': return {contents: `${contractHelpers}`}; + case 'api/UniqueRefungibleToken.sol': return {contents: `${uniqueRefungibleToken}`}; + case 'api/UniqueRefungible.sol': return {contents: `${uniqueRefungible}`}; + case 'api/UniqueNFT.sol': return {contents: `${uniqueNFT}`}; + default: return {error: 'File not found'}; + } + }; +} -async function deployFractionalizer(api: ApiPromise, web3: Web3, owner: string) { - const fractionalizerContract = new web3.eth.Contract(fractionalizerAbi as any, undefined, { +async function deployFractionalizer(web3: Web3, owner: string) { + const compiled = await compileFractionalizer(); + const fractionalizerContract = new web3.eth.Contract(compiled.abi, undefined, { + data: compiled.object, from: owner, ...GAS_ARGS, }); - return await fractionalizerContract.deploy({data: (await readFile(`${__dirname}/Fractionalizer.bin`)).toString()}).send({from: owner}); + return await fractionalizerContract.deploy({data: compiled.object}).send({from: owner}); } async function initFractionalizer(api: ApiPromise, web3: Web3, privateKeyWrapper: (account: string) => IKeyringPair, owner: string) { - const fractionalizer = await deployFractionalizer(api, web3, owner); + const fractionalizer = await deployFractionalizer(web3, owner); const tx = api.tx.balances.transfer(evmToAddress(fractionalizer.options.address), 10n * UNIQUE); const alice = privateKeyWrapper('//Alice'); await submitTransactionAsync(alice, tx); @@ -71,7 +121,7 @@ async function createRFTToken(api: ApiPromise, web3: Web3, owner: string, fracti describe('Fractionalizer contract usage', () => { itWeb3('Set RFT collection', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const fractionalizer = await deployFractionalizer(api, web3, owner); + const fractionalizer = await deployFractionalizer(web3, owner); const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner); const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner); await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send(); @@ -88,7 +138,7 @@ describe('Fractionalizer contract usage', () => { itWeb3('Mint RFT collection', async ({api, web3, privateKeyWrapper}) => { const alice = privateKeyWrapper('//Alice'); const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const fractionalizer = await deployFractionalizer(api, web3, owner); + const fractionalizer = await deployFractionalizer(web3, owner); const tx = api.tx.balances.transfer(evmToAddress(fractionalizer.options.address), 10n * UNIQUE); await submitTransactionAsync(alice, tx); @@ -183,7 +233,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner); const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner); - const fractionalizer = await deployFractionalizer(api, web3, owner); + const fractionalizer = await deployFractionalizer(web3, owner); await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send(); await fractionalizer.methods.setRFTCollection(collectionIdAddress).send(); @@ -196,7 +246,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const {collectionIdAddress} = await createNonfungibleCollection(api, web3, owner); const nftContract = uniqueNFT(web3, collectionIdAddress, owner); - const fractionalizer = await deployFractionalizer(api, web3, owner); + const fractionalizer = await deployFractionalizer(web3, owner); await nftContract.methods.addCollectionAdmin(fractionalizer.options.address).send(); await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) @@ -205,7 +255,7 @@ describe('Negative Integration Tests for fractionalizer', () => { itWeb3('call setRFTCollection while not collection admin', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const fractionalizer = await deployFractionalizer(api, web3, owner); + const fractionalizer = await deployFractionalizer(web3, owner); const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner); await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) @@ -215,7 +265,7 @@ describe('Negative Integration Tests for fractionalizer', () => { itWeb3('call setRFTCollection after createAndSetRFTCollection', async ({api, web3, privateKeyWrapper}) => { const alice = privateKeyWrapper('//Alice'); const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const fractionalizer = await deployFractionalizer(api, web3, owner); + const fractionalizer = await deployFractionalizer(web3, owner); const tx = api.tx.balances.transfer(evmToAddress(fractionalizer.options.address), 10n * UNIQUE); await submitTransactionAsync(alice, tx); @@ -234,7 +284,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const nftTokenId = await nftContract.methods.nextTokenId().call(); await nftContract.methods.mint(owner, nftTokenId).send(); - const fractionalizer = await deployFractionalizer(api, web3, owner); + const fractionalizer = await deployFractionalizer(web3, owner); await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) .to.eventually.be.rejectedWith(/RFT collection is not set$/g); @@ -291,7 +341,7 @@ describe('Negative Integration Tests for fractionalizer', () => { itWeb3('call rft2nft without setting RFT collection for contract', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const fractionalizer = await deployFractionalizer(api, web3, owner); + const fractionalizer = await deployFractionalizer(web3, owner); const {collectionIdAddress: rftCollectionAddress} = await createRefungibleCollection(api, web3, owner); const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner); const rftTokenId = await refungibleContract.methods.nextTokenId().call(); @@ -318,7 +368,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const {collectionIdAddress: rftCollectionAddress} = await createRefungibleCollection(api, web3, owner); - const fractionalizer = await deployFractionalizer(api, web3, owner); + const fractionalizer = await deployFractionalizer(web3, owner); const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner); await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send(); diff --git a/tests/src/eth/util/helpers.ts b/tests/src/eth/util/helpers.ts index e6a7a90830..401a329613 100644 --- a/tests/src/eth/util/helpers.ts +++ b/tests/src/eth/util/helpers.ts @@ -250,7 +250,12 @@ export function subToEth(eth: string): string { return Web3.utils.toChecksumAddress(subToEthLowercase(eth)); } -export function compileContract(name: string, src: string) { +export interface CompiledContract { + abi: any, + object: string, +} + +export function compileContract(name: string, src: string) : CompiledContract { const out = JSON.parse(solc.compile(JSON.stringify({ language: 'Solidity', sources: { From 6d585f930166fb9d44ec1f7f3f799ddfec8eb138 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0319/1274] chore: use contractOwner method in contract --- tests/src/eth/fractionalizer/Fractionalizer.sol | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/src/eth/fractionalizer/Fractionalizer.sol b/tests/src/eth/fractionalizer/Fractionalizer.sol index 46f62d46d9..8698f728c9 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.sol +++ b/tests/src/eth/fractionalizer/Fractionalizer.sol @@ -15,15 +15,16 @@ contract Fractionalizer { mapping(address => bool) nftCollectionAllowList; mapping(address => mapping(uint256 => uint256)) nft2rftMapping; mapping(address => Token) rft2nftMapping; - address owner; bytes32 refungibleCollectionType = keccak256(bytes("ReFungible")); constructor() { - owner = msg.sender; } modifier onlyOwner() { - require(msg.sender == owner, "Only owner can"); + address contracthelpersAddress = 0x842899ECF380553E8a4de75bF534cdf6fBF64049; + ContractHelpers contractHelpers = ContractHelpers(contracthelpersAddress); + address contractOwner = contractHelpers.contractOwner(address(this)); + require(msg.sender == contractOwner, "Only owner can"); _; } From e38fb0c231d7a1798ab5f5cbec9797ff95e8da42 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0320/1274] chore: add Fractionalizer contract documentation, prevent QTZ/UNQ transfers from nonowners, tests for TransfersNotAllowed --- pallets/refungible/src/erc_token.rs | 2 +- .../src/eth/fractionalizer/Fractionalizer.sol | 53 +++++++- .../eth/fractionalizer/fractionalizer.test.ts | 114 ++++++++++++++---- 3 files changed, 145 insertions(+), 24 deletions(-) diff --git a/pallets/refungible/src/erc_token.rs b/pallets/refungible/src/erc_token.rs index e47066b76e..2b2accbb0e 100644 --- a/pallets/refungible/src/erc_token.rs +++ b/pallets/refungible/src/erc_token.rs @@ -186,7 +186,7 @@ impl RefungibleTokenHandle { .weight_calls_budget(>::find_parent()); >::transfer(self, &caller, &to, self.1, amount, &budget) - .map_err(|_| "transfer error")?; + .map_err(dispatch_to_evm::)?; Ok(true) } diff --git a/tests/src/eth/fractionalizer/Fractionalizer.sol b/tests/src/eth/fractionalizer/Fractionalizer.sol index 8698f728c9..d855ffbddf 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.sol +++ b/tests/src/eth/fractionalizer/Fractionalizer.sol @@ -6,6 +6,9 @@ import {UniqueRefungibleToken} from "../api/UniqueRefungibleToken.sol"; import {UniqueRefungible} from "../api/UniqueRefungible.sol"; import {UniqueNFT} from "../api/UniqueNFT.sol"; +/// @dev Fractionalization contract. It stores mappings between NFT and RFT tokens, +/// stores allowlist of NFT tokens available for fractionalization, has methods +/// for fractionalization and defractionalization of NFT tokens. contract Fractionalizer { struct Token { address _collection; @@ -17,9 +20,10 @@ contract Fractionalizer { mapping(address => Token) rft2nftMapping; bytes32 refungibleCollectionType = keccak256(bytes("ReFungible")); - constructor() { - } + //TODO: add nonPayable modifier after Solidity updates to 0.9. + receive() external payable onlyOwner {} + /// @dev Method modifier to only allow contract owner to call it. modifier onlyOwner() { address contracthelpersAddress = 0x842899ECF380553E8a4de75bF534cdf6fBF64049; ContractHelpers contractHelpers = ContractHelpers(contracthelpersAddress); @@ -28,11 +32,26 @@ contract Fractionalizer { _; } + /// @dev This emits when RFT collection setting is changed. event RFTCollectionSet(address _collection); + + /// @dev This emits when NFT collection is allowed or disallowed. event AllowListSet(address _collection, bool _status); + + /// @dev This emits when NFT token is fractionalized by contract. event Fractionalized(address _collection, uint256 _tokenId, address _rftToken, uint128 _amount); + + /// @dev This emits when NFT token is defractionalized by contract. event Defractionalized(address _rftToken, address _nftCollection, uint256 _nftTokenId); + /// Set RFT collection that contract will work with. RFT tokens for fractionalized NFT tokens + /// would be created in this collection. + /// @dev Throws if RFT collection is already configured for this contract. + /// Throws if collection of wrong type (NFT, Fungible) is provided instead + /// of RFT collection. + /// Throws if `msg.sender` is not owner or admin of provided RFT collection. + /// Can only be called by contract owner. + /// @param _collection address of RFT collection. function setRFTCollection(address _collection) public onlyOwner { require( rftCollection == address(0), @@ -53,6 +72,13 @@ contract Fractionalizer { emit RFTCollectionSet(rftCollection); } + /// Creates and sets RFT collection that contract will work with. RFT tokens for fractionalized NFT tokens + /// would be created in this collection. + /// @dev Throws if RFT collection is already configured for this contract. + /// Can only be called by contract owner. + /// @param _name name for created RFT collection. + /// @param _description description for created RFT collection. + /// @param _tokenPrefix token prefix for created RFT collection. function createAndSetRFTCollection(string calldata _name, string calldata _description, string calldata _tokenPrefix) public onlyOwner { require( rftCollection == address(0), @@ -63,11 +89,25 @@ contract Fractionalizer { emit RFTCollectionSet(rftCollection); } + /// Allow or disallow NFT collection tokens from being fractionalized by this contract. + /// @dev Can only be called by contract owner. + /// @param collection NFT token address. + /// @param status `true` to allow and `false` to disallow NFT token. function setNftCollectionIsAllowed(address collection, bool status) public onlyOwner { nftCollectionAllowList[collection] = status; emit AllowListSet(collection, status); } + /// Fractionilize NFT token. + /// @dev Takes NFT token from `msg.sender` and transfers RFT token to `msg.sender` + /// instead. Creates new RFT token if provided NFT token never was fractionalized + /// by this contract or existing RFT token if it was. + /// Throws if RFT collection isn't configured for this contract. + /// Throws if fractionalization of provided NFT token is not allowed + /// Throws if `msg.sender` is not owner of provided NFT token + /// @param _collection NFT collection address + /// @param _token id of NFT token to be fractionalized + /// @param _pieces number of pieces new RFT token would have function nft2rft(address _collection, uint256 _token, uint128 _pieces) public { require( rftCollection != address(0), @@ -109,6 +149,15 @@ contract Fractionalizer { emit Fractionalized(_collection, _token, rftTokenAddress, _pieces); } + /// Defrationalize NFT token. + /// @dev Takes RFT token from `msg.sender` and transfers corresponding NFT token + /// to `msg.sender` instead. + /// Throws if RFT collection isn't configured for this contract. + /// Throws if provided RFT token is no from configured RFT collection. + /// Throws if RFT token was not created by this contract. + /// Throws if `msg.sender` isn't owner of all RFT token pieces. + /// @param _collection RFT collection address + /// @param _token id of RFT token function rft2nft(address _collection, uint256 _token) public { require( rftCollection != address(0), diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index d2ccf60c2b..1d3e013a64 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -19,17 +19,15 @@ import Web3 from 'web3'; import {ApiPromise} from '@polkadot/api'; import {evmToAddress} from '@polkadot/util-crypto'; import {readFile} from 'fs/promises'; -import {submitTransactionAsync} from '../../substrate/substrate-api'; -import {UNIQUE} from '../../util/helpers'; +import {executeTransaction, submitTransactionAsync} from '../../substrate/substrate-api'; +import {getCreateCollectionResult, getCreateItemResult, UNIQUE} from '../../util/helpers'; import {collectionIdToAddress, CompiledContract, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers'; import {Contract} from 'web3-eth-contract'; import * as solc from 'solc'; import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; import chaiLike from 'chai-like'; import {IKeyringPair} from '@polkadot/types/types'; -chai.use(chaiAsPromised); chai.use(chaiLike); const expect = chai.expect; let fractionalizer: CompiledContract; @@ -93,9 +91,8 @@ async function deployFractionalizer(web3: Web3, owner: string) { async function initFractionalizer(api: ApiPromise, web3: Web3, privateKeyWrapper: (account: string) => IKeyringPair, owner: string) { const fractionalizer = await deployFractionalizer(web3, owner); - const tx = api.tx.balances.transfer(evmToAddress(fractionalizer.options.address), 10n * UNIQUE); - const alice = privateKeyWrapper('//Alice'); - await submitTransactionAsync(alice, tx); + const amount = 10n * UNIQUE; + await web3.eth.sendTransaction({from: owner, to: fractionalizer.options.address, value: `${amount}`, ...GAS_ARGS}); const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send(); const rftCollectionAddress = result.events.RFTCollectionSet.returnValues._collection; return {fractionalizer, rftCollectionAddress}; @@ -151,8 +148,7 @@ describe('Fractionalizer contract usage', () => { itWeb3('Set Allowlist', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); - + const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); const result1 = await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send({from: owner}); expect(result1.events).to.be.like({ @@ -238,7 +234,7 @@ describe('Negative Integration Tests for fractionalizer', () => { await fractionalizer.methods.setRFTCollection(collectionIdAddress).send(); await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) - .to.eventually.be.rejectedWith(/RFT collection is already set$/g); + .to.be.rejectedWith(/RFT collection is already set$/g); }); itWeb3('call setRFTCollection with NFT collection', async ({api, web3, privateKeyWrapper}) => { @@ -250,7 +246,7 @@ describe('Negative Integration Tests for fractionalizer', () => { await nftContract.methods.addCollectionAdmin(fractionalizer.options.address).send(); await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) - .to.eventually.be.rejectedWith(/Wrong collection type. Collection is not refungible.$/g); + .to.be.rejectedWith(/Wrong collection type. Collection is not refungible.$/g); }); itWeb3('call setRFTCollection while not collection admin', async ({api, web3, privateKeyWrapper}) => { @@ -259,7 +255,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner); await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) - .to.eventually.be.rejectedWith(/Fractionalizer contract should be an admin of the collection$/g); + .to.be.rejectedWith(/Fractionalizer contract should be an admin of the collection$/g); }); itWeb3('call setRFTCollection after createAndSetRFTCollection', async ({api, web3, privateKeyWrapper}) => { @@ -273,7 +269,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const collectionIdAddress = result.events.RFTCollectionSet.returnValues._collection; await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) - .to.eventually.be.rejectedWith(/RFT collection is already set$/g); + .to.be.rejectedWith(/RFT collection is already set$/g); }); itWeb3('call nft2rft without setting RFT collection for contract', async ({api, web3, privateKeyWrapper}) => { @@ -287,7 +283,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const fractionalizer = await deployFractionalizer(web3, owner); await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) - .to.eventually.be.rejectedWith(/RFT collection is not set$/g); + .to.be.rejectedWith(/RFT collection is not set$/g); }); itWeb3('call nft2rft while not owner of NFT token', async ({api, web3, privateKeyWrapper}) => { @@ -305,7 +301,7 @@ describe('Negative Integration Tests for fractionalizer', () => { await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send(); await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) - .to.eventually.be.rejectedWith(/Only token owner could fractionalize it$/g); + .to.be.rejectedWith(/Only token owner could fractionalize it$/g); }); itWeb3('call nft2rft while not in list of allowed accounts', async ({api, web3, privateKeyWrapper}) => { @@ -320,7 +316,7 @@ describe('Negative Integration Tests for fractionalizer', () => { await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send(); await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) - .to.eventually.be.rejectedWith(/Fractionalization of this collection is not allowed by admin$/g); + .to.be.rejectedWith(/Fractionalization of this collection is not allowed by admin$/g); }); itWeb3('call nft2rft while fractionalizer doesnt have approval for nft token', async ({api, web3, privateKeyWrapper}) => { @@ -335,7 +331,7 @@ describe('Negative Integration Tests for fractionalizer', () => { await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send(); await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) - .to.eventually.be.rejectedWith(/ApprovedValueTooLow$/g); + .to.be.rejectedWith(/ApprovedValueTooLow$/g); }); itWeb3('call rft2nft without setting RFT collection for contract', async ({api, web3, privateKeyWrapper}) => { @@ -348,7 +344,7 @@ describe('Negative Integration Tests for fractionalizer', () => { await refungibleContract.methods.mint(owner, rftTokenId).send(); await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).call()) - .to.eventually.be.rejectedWith(/RFT collection is not set$/g); + .to.be.rejectedWith(/RFT collection is not set$/g); }); itWeb3('call rft2nft for RFT token that is not from configured RFT collection', async ({api, web3, privateKeyWrapper}) => { @@ -361,7 +357,7 @@ describe('Negative Integration Tests for fractionalizer', () => { await refungibleContract.methods.mint(owner, rftTokenId).send(); await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).call()) - .to.eventually.be.rejectedWith(/Wrong RFT collection$/g); + .to.be.rejectedWith(/Wrong RFT collection$/g); }); itWeb3('call rft2nft for RFT token that was not minted by fractionalizer contract', async ({api, web3, privateKeyWrapper}) => { @@ -378,7 +374,7 @@ describe('Negative Integration Tests for fractionalizer', () => { await refungibleContract.methods.mint(owner, rftTokenId).send(); await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).call()) - .to.eventually.be.rejectedWith(/No corresponding NFT token found$/g); + .to.be.rejectedWith(/No corresponding NFT token found$/g); }); itWeb3('call rft2nft without owning all RFT pieces', async ({api, web3, privateKeyWrapper}) => { @@ -393,6 +389,82 @@ describe('Negative Integration Tests for fractionalizer', () => { await refungibleTokenContract.methods.transfer(receiver, 50).send(); await refungibleTokenContract.methods.approve(fractionalizer.options.address, 50).send(); await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, tokenId).call()) - .to.eventually.be.rejectedWith(/Not all pieces are owned by the caller$/g); + .to.be.rejectedWith(/Not all pieces are owned by the caller$/g); + }); + + itWeb3('send QTZ/UNQ to contract from non owner', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const payer = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const fractionalizer = await deployFractionalizer(web3, owner); + const amount = 10n * UNIQUE; + await expect(web3.eth.sendTransaction({from: payer, to: fractionalizer.options.address, value: `${amount}`, ...GAS_ARGS})).to.be.rejected; + }); + + itWeb3('fractionalize NFT with NFT transfers disallowed', async ({api, web3, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + let collectionId; + { + const tx = api.tx.unique.createCollectionEx({name: 'A', description: 'B', tokenPrefix: 'C', mode: 'NFT'}); + const events = await submitTransactionAsync(alice, tx); + const result = getCreateCollectionResult(events); + collectionId = result.collectionId; + } + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + let nftTokenId; + { + const createData = {nft: {}}; + const tx = api.tx.unique.createItem(collectionId, {Ethereum: owner}, createData as any); + const events = await executeTransaction(api, alice, tx); + const result = getCreateItemResult(events); + nftTokenId = result.itemId; + } + { + const tx = api.tx.unique.setTransfersEnabledFlag(collectionId, false); + await executeTransaction(api, alice, tx); + } + const nftCollectionAddress = collectionIdToAddress(collectionId); + const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); + await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send(); + + const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); + await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send(); + await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) + .to.be.rejectedWith(/TransferNotAllowed$/g); + }); + + itWeb3('fractionalize NFT with RFT transfers disallowed', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const alice = privateKeyWrapper('//Alice'); + + let collectionId; + { + const tx = api.tx.unique.createCollectionEx({name: 'A', description: 'B', tokenPrefix: 'C', mode: 'ReFungible'}); + const events = await submitTransactionAsync(alice, tx); + const result = getCreateCollectionResult(events); + collectionId = result.collectionId; + } + const rftCollectionAddress = collectionIdToAddress(collectionId); + const fractionalizer = await deployFractionalizer(web3, owner); + { + const changeAdminTx = api.tx.unique.addCollectionAdmin(collectionId, {Ethereum: fractionalizer.options.address}); + await submitTransactionAsync(alice, changeAdminTx); + } + await fractionalizer.methods.setRFTCollection(rftCollectionAddress).send(); + { + const tx = api.tx.unique.setTransfersEnabledFlag(collectionId, false); + await executeTransaction(api, alice, tx); + } + + const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); + const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); + const nftTokenId = await nftContract.methods.nextTokenId().call(); + await nftContract.methods.mint(owner, nftTokenId).send(); + + await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send(); + await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send(); + + await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100n).call()) + .to.be.rejectedWith(/TransferNotAllowed$/g); }); }); \ No newline at end of file From 67ae0d74e34293f51c0c7842bc674c00c05d0cca Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0321/1274] chore: fix cargo fmt --- pallets/refungible/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 2dd2d3e263..7ebe3dc9ae 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -112,10 +112,10 @@ use sp_core::H160; use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome}; use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap}; use up_data_structs::{ - AccessMode, budget::Budget, CollectionId, CollectionMode, CollectionPropertiesVec, CreateCollectionData, CustomDataLimit, - mapping::TokenAddressMapping, MAX_ITEMS_PER_BATCH, MAX_REFUNGIBLE_PIECES, Property, - PropertyKey, PropertyKeyPermission, PropertyPermission, PropertyScope, PropertyValue, - TokenId, TrySetProperty, + AccessMode, budget::Budget, CollectionId, CollectionMode, CollectionPropertiesVec, + CreateCollectionData, CustomDataLimit, mapping::TokenAddressMapping, MAX_ITEMS_PER_BATCH, + MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission, PropertyPermission, + PropertyScope, PropertyValue, TokenId, TrySetProperty, }; use frame_support::BoundedBTreeMap; use derivative::Derivative; From b96130553757a9d4602c26befbef9611ec8ea37f Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:00 +0000 Subject: [PATCH 0322/1274] chore: remove comment --- tests/src/eth/fractionalizer/Fractionalizer.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/src/eth/fractionalizer/Fractionalizer.sol b/tests/src/eth/fractionalizer/Fractionalizer.sol index d855ffbddf..8877e7c5e5 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.sol +++ b/tests/src/eth/fractionalizer/Fractionalizer.sol @@ -20,7 +20,6 @@ contract Fractionalizer { mapping(address => Token) rft2nftMapping; bytes32 refungibleCollectionType = keccak256(bytes("ReFungible")); - //TODO: add nonPayable modifier after Solidity updates to 0.9. receive() external payable onlyOwner {} /// @dev Method modifier to only allow contract owner to call it. From 1cbdff92adea135495c14db4b8fed0e149076861 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 11 Aug 2022 09:53:25 +0000 Subject: [PATCH 0323/1274] refactor: add up-common --- Cargo.lock | 36 +++++----- common-types/Cargo.toml | 50 ------------- common-types/src/lib.rs | 83 ---------------------- node/cli/Cargo.toml | 4 +- node/cli/src/chain_spec.rs | 2 +- node/cli/src/command.rs | 2 +- node/cli/src/service.rs | 2 +- node/rpc/Cargo.toml | 2 +- node/rpc/src/lib.rs | 2 +- runtime/common/config/ethereum.rs | 3 +- runtime/common/config/orml.rs | 7 +- runtime/common/config/pallets/mod.rs | 6 +- runtime/common/config/pallets/scheduler.rs | 2 +- runtime/common/config/parachain.rs | 3 +- runtime/common/config/sponsoring.rs | 4 +- runtime/common/config/substrate.rs | 6 +- runtime/common/config/xcm.rs | 9 ++- runtime/common/constants.rs | 2 +- runtime/common/instance.rs | 2 +- runtime/common/mod.rs | 2 +- runtime/common/scheduler.rs | 2 +- runtime/opal/Cargo.toml | 4 +- runtime/opal/src/lib.rs | 2 +- runtime/quartz/Cargo.toml | 4 +- runtime/quartz/src/lib.rs | 2 +- runtime/tests/Cargo.toml | 1 - runtime/unique/Cargo.toml | 4 +- runtime/unique/src/lib.rs | 2 +- 28 files changed, 63 insertions(+), 187 deletions(-) delete mode 100644 common-types/Cargo.toml delete mode 100644 common-types/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index b0e0f27883..db7c30725d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1127,18 +1127,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "common-types" -version = "0.9.24" -dependencies = [ - "fp-rpc", - "pallet-evm", - "sp-consensus-aura", - "sp-core", - "sp-runtime", - "sp-std", -] - [[package]] name = "concurrent-queue" version = "1.2.2" @@ -5294,7 +5282,6 @@ checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" name = "opal-runtime" version = "0.9.24" dependencies = [ - "common-types", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -5366,6 +5353,7 @@ dependencies = [ "sp-transaction-pool", "sp-version", "substrate-wasm-builder", + "up-common", "up-data-structs", "up-rpc", "up-sponsorship", @@ -8610,7 +8598,6 @@ dependencies = [ name = "quartz-runtime" version = "0.9.24" dependencies = [ - "common-types", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -8682,6 +8669,7 @@ dependencies = [ "sp-transaction-pool", "sp-version", "substrate-wasm-builder", + "up-common", "up-data-structs", "up-rpc", "up-sponsorship", @@ -11897,7 +11885,6 @@ dependencies = [ name = "tests" version = "0.1.0" dependencies = [ - "common-types", "evm-coder", "fp-evm-mapping", "frame-support", @@ -12480,7 +12467,6 @@ name = "unique-node" version = "0.9.24" dependencies = [ "clap", - "common-types", "cumulus-client-cli", "cumulus-client-collator", "cumulus-client-consensus-aura", @@ -12559,6 +12545,7 @@ dependencies = [ "try-runtime-cli", "unique-rpc", "unique-runtime", + "up-common", "up-data-structs", "up-rpc", ] @@ -12567,7 +12554,6 @@ dependencies = [ name = "unique-rpc" version = "0.1.0" dependencies = [ - "common-types", "fc-db", "fc-mapping-sync", "fc-rpc", @@ -12608,6 +12594,7 @@ dependencies = [ "substrate-frame-rpc-system", "tokio 0.2.25", "uc-rpc", + "up-common", "up-data-structs", "up-rpc", ] @@ -12616,7 +12603,6 @@ dependencies = [ name = "unique-runtime" version = "0.9.24" dependencies = [ - "common-types", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -12688,6 +12674,7 @@ dependencies = [ "sp-transaction-pool", "sp-version", "substrate-wasm-builder", + "up-common", "up-data-structs", "up-rpc", "up-sponsorship", @@ -12724,6 +12711,19 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "up-common" +version = "0.9.24" +dependencies = [ + "fp-rpc", + "frame-support", + "pallet-evm", + "sp-consensus-aura", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "up-data-structs" version = "0.2.1" diff --git a/common-types/Cargo.toml b/common-types/Cargo.toml deleted file mode 100644 index 3c473b542d..0000000000 --- a/common-types/Cargo.toml +++ /dev/null @@ -1,50 +0,0 @@ -[package] -authors = ['Unique Network '] -description = 'Unique Runtime Common' -edition = '2021' -homepage = 'https://unique.network' -license = 'All Rights Reserved' -name = 'common-types' -repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.9.24' - -[features] -default = ['std'] -std = [ - 'sp-std/std', - 'sp-runtime/std', - 'sp-core/std', - 'sp-consensus-aura/std', - 'fp-rpc/std', - 'pallet-evm/std', -] - -[dependencies.sp-std] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" - -[dependencies.sp-runtime] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" - -[dependencies.sp-core] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" - -[dependencies.sp-consensus-aura] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" - -[dependencies.fp-rpc] -default-features = false -git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.24" - -[dependencies.pallet-evm] -default-features = false -git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.24" diff --git a/common-types/src/lib.rs b/common-types/src/lib.rs deleted file mode 100644 index fb314a8ed6..0000000000 --- a/common-types/src/lib.rs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -#![cfg_attr(not(feature = "std"), no_std)] - -use sp_runtime::{ - generic, - traits::{Verify, IdentifyAccount}, - MultiSignature, -}; - -/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know -/// the specifics of the runtime. They can then be made to be agnostic over specific formats -/// of data like extrinsics, allowing for them to continue syncing the network through upgrades -/// to even the core data structures. -pub mod opaque { - pub use sp_runtime::{generic, traits::BlakeTwo256, OpaqueExtrinsic as UncheckedExtrinsic}; - - pub use super::{BlockNumber, Signature, AccountId, Balance, Index, Hash, AuraId}; - - /// Opaque block header type. - pub type Header = generic::Header; - - /// Opaque block type. - pub type Block = generic::Block; - - pub trait RuntimeInstance { - type CrossAccountId: pallet_evm::account::CrossAccountId - + Send - + Sync - + 'static; - - type TransactionConverter: fp_rpc::ConvertTransaction - + Send - + Sync - + 'static; - - fn get_transaction_converter() -> Self::TransactionConverter; - } -} - -pub type SessionHandlers = (); - -/// An index to a block. -pub type BlockNumber = u32; - -/// Alias to 512-bit hash when used in the context of a transaction signature on the chain. -pub type Signature = MultiSignature; - -/// Some way of identifying an account on the chain. We intentionally make it equivalent -/// to the public key of our transaction signing scheme. -pub type AccountId = <::Signer as IdentifyAccount>::AccountId; - -/// The type for looking up accounts. We don't expect more than 4 billion of them, but you -/// never know... -pub type AccountIndex = u32; - -/// Balance of an account. -pub type Balance = u128; - -/// Index of a transaction in the chain. -pub type Index = u32; - -/// A hash of some data used by the chain. -pub type Hash = sp_core::H256; - -/// Digest item type. -pub type DigestItem = generic::DigestItem; - -pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 17b0de635a..aeb8f55d95 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -253,8 +253,8 @@ branch = "release-v0.9.24" ################################################################################ # Local dependencies -[dependencies.common-types] -path = "../../common-types" +[dependencies.up-common] +path = "../../primitives/common" [dependencies.unique-runtime] path = '../../runtime/unique' diff --git a/node/cli/src/chain_spec.rs b/node/cli/src/chain_spec.rs index 23b4602af8..3790f71d0c 100644 --- a/node/cli/src/chain_spec.rs +++ b/node/cli/src/chain_spec.rs @@ -23,7 +23,7 @@ use std::collections::BTreeMap; use serde::{Deserialize, Serialize}; use serde_json::map::Map; -use common_types::opaque::*; +use up_common::types::opaque::*; #[cfg(feature = "unique-runtime")] pub use unique_runtime as default_runtime; diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index fa68eb1df5..33451a9442 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -64,7 +64,7 @@ use sp_core::hexdisplay::HexDisplay; use sp_runtime::traits::{AccountIdConversion, Block as BlockT}; use std::{io::Write, net::SocketAddr, time::Duration}; -use common_types::opaque::Block; +use up_common::types::opaque::Block; macro_rules! no_runtime_err { ($chain_name:expr) => { diff --git a/node/cli/src/service.rs b/node/cli/src/service.rs index c9ab806bbe..3569acff1f 100644 --- a/node/cli/src/service.rs +++ b/node/cli/src/service.rs @@ -63,7 +63,7 @@ use polkadot_service::CollatorPair; use fc_rpc_core::types::FilterPool; use fc_mapping_sync::{MappingSyncWorker, SyncStrategy}; -use common_types::opaque::{AuraId, RuntimeInstance, AccountId, Balance, Index, Hash, Block}; +use up_common::types::opaque::{AuraId, RuntimeInstance, AccountId, Balance, Index, Hash, Block}; // RMRK use up_data_structs::{ diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index 76f161c6ba..423ab9cd1a 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -49,7 +49,7 @@ fc-db = { default-features = false, git = "https://github.com/uniquenetwork/fron fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } pallet-common = { default-features = false, path = "../../pallets/common" } -common-types = { path = "../../common-types" } +up-common = { path = "../../primitives/common" } pallet-unique = { path = "../../pallets/unique" } uc-rpc = { path = "../../client/rpc" } up-rpc = { path = "../../primitives/rpc" } diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index a7ceff0401..bb585a47c1 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -40,7 +40,7 @@ use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; use sc_service::TransactionPool; use std::{collections::BTreeMap, sync::Arc}; -use common_types::opaque::{Hash, AccountId, RuntimeInstance, Index, Block, BlockNumber, Balance}; +use up_common::types::opaque::{Hash, AccountId, RuntimeInstance, Index, Block, BlockNumber, Balance}; // RMRK use up_data_structs::{ diff --git a/runtime/common/config/ethereum.rs b/runtime/common/config/ethereum.rs index b9d6be51aa..e2a88999dd 100644 --- a/runtime/common/config/ethereum.rs +++ b/runtime/common/config/ethereum.rs @@ -7,12 +7,13 @@ use frame_support::{ use sp_runtime::{RuntimeAppPublic, Perbill}; use crate::{ runtime_common::{ - constants::*, dispatch::CollectionDispatchT, ethereum::sponsoring::EvmSponsorshipHandler, + dispatch::CollectionDispatchT, ethereum::sponsoring::EvmSponsorshipHandler, config::sponsoring::DefaultSponsoringRateLimit, DealWithFees, }, Runtime, Aura, Balances, Event, ChainId, }; use pallet_evm::{EnsureAddressTruncated, HashedAddressMapping}; +use up_common::constants::*; pub type CrossAccountId = pallet_evm::account::BasicCrossAccountId; diff --git a/runtime/common/config/orml.rs b/runtime/common/config/orml.rs index 64ca90786d..e8babbd39f 100644 --- a/runtime/common/config/orml.rs +++ b/runtime/common/config/orml.rs @@ -16,8 +16,11 @@ use frame_support::parameter_types; use frame_system::EnsureSigned; -use crate::{runtime_common::constants::*, Runtime, Event, RelayChainBlockNumberProvider}; -use common_types::{AccountId, Balance}; +use crate::{Runtime, Event, RelayChainBlockNumberProvider}; +use up_common::{ + types::{AccountId, Balance}, + constants::*, +}; parameter_types! { pub const MinVestedTransfer: Balance = 10 * UNIQUE; diff --git a/runtime/common/config/pallets/mod.rs b/runtime/common/config/pallets/mod.rs index 3c434290bc..a7185f532e 100644 --- a/runtime/common/config/pallets/mod.rs +++ b/runtime/common/config/pallets/mod.rs @@ -18,7 +18,6 @@ use frame_support::parameter_types; use sp_runtime::traits::AccountIdConversion; use crate::{ runtime_common::{ - constants::*, dispatch::CollectionDispatchT, config::{substrate::TreasuryModuleId, ethereum::EvmCollectionHelpersAddress}, weights::CommonWeights, @@ -26,7 +25,10 @@ use crate::{ }, Runtime, Event, Call, Balances, }; -use common_types::{AccountId, Balance, BlockNumber}; +use up_common::{ + types::{AccountId, Balance, BlockNumber}, + constants::*, +}; use up_data_structs::{ mapping::{EvmTokenAddressMapping, CrossTokenAddressMapping}, }; diff --git a/runtime/common/config/pallets/scheduler.rs b/runtime/common/config/pallets/scheduler.rs index e0dbb91eb0..effcb78d3b 100644 --- a/runtime/common/config/pallets/scheduler.rs +++ b/runtime/common/config/pallets/scheduler.rs @@ -22,7 +22,7 @@ use crate::{ runtime_common::{scheduler::SchedulerPaymentExecutor, config::substrate::RuntimeBlockWeights}, Runtime, Call, Event, Origin, OriginCaller, Balances, }; -use common_types::AccountId; +use up_common::types::AccountId; parameter_types! { pub MaximumSchedulerWeight: Weight = Perbill::from_percent(50) * diff --git a/runtime/common/config/parachain.rs b/runtime/common/config/parachain.rs index 0a716b9f59..934d66c399 100644 --- a/runtime/common/config/parachain.rs +++ b/runtime/common/config/parachain.rs @@ -15,7 +15,8 @@ // along with Unique Network. If not, see . use frame_support::{weights::Weight, parameter_types}; -use crate::{runtime_common::constants::*, Runtime, Event, XcmpQueue, DmpQueue}; +use crate::{Runtime, Event, XcmpQueue, DmpQueue}; +use up_common::constants::*; parameter_types! { pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; diff --git a/runtime/common/config/sponsoring.rs b/runtime/common/config/sponsoring.rs index 840214aa8a..709633ac5a 100644 --- a/runtime/common/config/sponsoring.rs +++ b/runtime/common/config/sponsoring.rs @@ -16,10 +16,10 @@ use frame_support::parameter_types; use crate::{ - runtime_common::{constants::*, sponsoring::UniqueSponsorshipHandler}, + runtime_common::{sponsoring::UniqueSponsorshipHandler}, Runtime, }; -use common_types::BlockNumber; +use up_common::{types::BlockNumber, constants::*}; parameter_types! { pub const DefaultSponsoringRateLimit: BlockNumber = 1 * DAYS; diff --git a/runtime/common/config/substrate.rs b/runtime/common/config/substrate.rs index f0daa66b09..e38842329c 100644 --- a/runtime/common/config/substrate.rs +++ b/runtime/common/config/substrate.rs @@ -35,10 +35,10 @@ use frame_system::{ use sp_arithmetic::traits::{BaseArithmetic, Unsigned}; use smallvec::smallvec; use crate::{ - runtime_common::{DealWithFees, constants::*}, - Runtime, Event, Call, Origin, PalletInfo, System, Balances, Treasury, SS58Prefix, Version, + runtime_common::DealWithFees, Runtime, Event, Call, Origin, PalletInfo, System, Balances, + Treasury, SS58Prefix, Version, }; -use common_types::*; +use up_common::{types::*, constants::*}; parameter_types! { pub const BlockHashCount: BlockNumber = 2400; diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs index 2eb2611b1d..c9df66f5f3 100644 --- a/runtime/common/config/xcm.rs +++ b/runtime/common/config/xcm.rs @@ -44,10 +44,13 @@ use xcm_builder::{ use xcm_executor::{Config, XcmExecutor, Assets}; use sp_std::marker::PhantomData; use crate::{ - runtime_common::{constants::*, config::substrate::LinearFee}, - Runtime, Call, Event, Origin, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue, + runtime_common::config::substrate::LinearFee, Runtime, Call, Event, Origin, Balances, + ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue, +}; +use up_common::{ + types::{AccountId, Balance}, + constants::*, }; -use common_types::{AccountId, Balance}; parameter_types! { pub const RelayLocation: MultiLocation = MultiLocation::parent(); diff --git a/runtime/common/constants.rs b/runtime/common/constants.rs index 972042a7f4..2ef27435ca 100644 --- a/runtime/common/constants.rs +++ b/runtime/common/constants.rs @@ -19,7 +19,7 @@ use frame_support::{ parameter_types, weights::{Weight, constants::WEIGHT_PER_SECOND}, }; -use common_types::{BlockNumber, Balance}; +use up_common::types::{BlockNumber, Balance}; pub const MILLISECS_PER_BLOCK: u64 = 12000; diff --git a/runtime/common/instance.rs b/runtime/common/instance.rs index cc99ebe629..dd28de5790 100644 --- a/runtime/common/instance.rs +++ b/runtime/common/instance.rs @@ -4,7 +4,7 @@ use crate::{ }, Runtime, }; -use common_types::opaque::RuntimeInstance; +use up_common::types::opaque::RuntimeInstance; impl RuntimeInstance for Runtime { type CrossAccountId = CrossAccountId; diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index af5a8c93f5..9274a9e533 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -41,7 +41,7 @@ use crate::{ Runtime, Call, Balances, Treasury, Aura, Signature, AllPalletsReversedWithSystemFirst, InherentDataExt, }; -use common_types::{AccountId, BlockNumber}; +use up_common::types::{AccountId, BlockNumber}; #[macro_export] macro_rules! unsupported { diff --git a/runtime/common/scheduler.rs b/runtime/common/scheduler.rs index 75cb3d3488..6a6d341ed4 100644 --- a/runtime/common/scheduler.rs +++ b/runtime/common/scheduler.rs @@ -25,7 +25,7 @@ use sp_runtime::{ DispatchErrorWithPostInfo, DispatchError, }; use crate::{Runtime, Call, Origin, Balances, ChargeTransactionPayment}; -use common_types::{AccountId, Balance}; +use up_common::types::{AccountId, Balance}; use fp_self_contained::SelfContainedCall; use pallet_unique_scheduler::DispatchCall; diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index ba1d7f2209..3482a04a5f 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -113,7 +113,7 @@ std = [ 'xcm/std', 'xcm-builder/std', 'xcm-executor/std', - 'common-types/std', + 'up-common/std', 'rmrk-rpc/std', 'evm-coder/std', 'up-sponsorship/std', @@ -403,7 +403,7 @@ default-features = false [dependencies] log = { version = "0.4.16", default-features = false } -common-types = { path = "../../common-types", default-features = false } +up-common = { path = "../../primitives/common", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 7a62d25600..710fffb60b 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -30,7 +30,7 @@ use frame_support::parameter_types; use sp_version::RuntimeVersion; use sp_runtime::create_runtime_str; -use common_types::*; +use up_common::types::*; #[path = "../../common/mod.rs"] mod runtime_common; diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 8a45b0acad..d67afdc17e 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -113,7 +113,7 @@ std = [ 'xcm/std', 'xcm-builder/std', 'xcm-executor/std', - 'common-types/std', + 'up-common/std', "orml-vesting/std", ] @@ -408,7 +408,7 @@ path = "../../primitives/rmrk-rpc" [dependencies] log = { version = "0.4.16", default-features = false } -common-types = { path = "../../common-types", default-features = false } +up-common = { path = "../../primitives/common", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index 469580944c..155e62b641 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -30,7 +30,7 @@ use frame_support::parameter_types; use sp_version::RuntimeVersion; use sp_runtime::create_runtime_str; -use common_types::*; +use up_common::types::*; #[path = "../../common/mod.rs"] mod runtime_common; diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index 53b9c7298e..0f3fa07091 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -42,6 +42,5 @@ parity-scale-codec = { version = "3.1.2", default-features = false, features = [ ] } scale-info = "*" -common-types = { path = "../../common-types", default-features = false } evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.24' } diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 8158a7b78e..9778ed1d1c 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -114,7 +114,7 @@ std = [ 'xcm/std', 'xcm-builder/std', 'xcm-executor/std', - 'common-types/std', + 'up-common/std', "orml-vesting/std", ] @@ -401,7 +401,7 @@ default-features = false [dependencies] log = { version = "0.4.16", default-features = false } -common-types = { path = "../../common-types", default-features = false } +up-common = { path = "../../primitives/common", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index 81f79558f4..928eb15aa5 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -30,7 +30,7 @@ use frame_support::parameter_types; use sp_version::RuntimeVersion; use sp_runtime::create_runtime_str; -use common_types::*; +use up_common::types::*; #[path = "../../common/mod.rs"] mod runtime_common; From fcb85ee0a6a831d9b27895c83b9968ec8fd18ebe Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 11 Aug 2022 10:17:00 +0000 Subject: [PATCH 0324/1274] fix: add up-common --- primitives/common/Cargo.toml | 56 +++++++++++++++++++++ primitives/common/src/constants.rs | 55 ++++++++++++++++++++ primitives/common/src/lib.rs | 20 ++++++++ primitives/common/src/types.rs | 81 ++++++++++++++++++++++++++++++ 4 files changed, 212 insertions(+) create mode 100644 primitives/common/Cargo.toml create mode 100644 primitives/common/src/constants.rs create mode 100644 primitives/common/src/lib.rs create mode 100644 primitives/common/src/types.rs diff --git a/primitives/common/Cargo.toml b/primitives/common/Cargo.toml new file mode 100644 index 0000000000..c3b5a59152 --- /dev/null +++ b/primitives/common/Cargo.toml @@ -0,0 +1,56 @@ +[package] +authors = ['Unique Network '] +description = 'Unique Runtime Common Primitives' +edition = '2021' +homepage = 'https://unique.network' +license = 'All Rights Reserved' +name = 'up-common' +repository = 'https://github.com/UniqueNetwork/unique-chain' +version = '0.9.24' + +[features] +default = ['std'] +std = [ + 'sp-std/std', + 'frame-support/std', + 'sp-runtime/std', + 'sp-core/std', + 'sp-consensus-aura/std', + 'fp-rpc/std', + 'pallet-evm/std', +] + +[dependencies.sp-std] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.frame-support] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.sp-runtime] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.sp-core] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.sp-consensus-aura] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.fp-rpc] +default-features = false +git = "https://github.com/uniquenetwork/frontier" +branch = "unique-polkadot-v0.9.24" + +[dependencies.pallet-evm] +default-features = false +git = "https://github.com/uniquenetwork/frontier" +branch = "unique-polkadot-v0.9.24" diff --git a/primitives/common/src/constants.rs b/primitives/common/src/constants.rs new file mode 100644 index 0000000000..bda19d3b6d --- /dev/null +++ b/primitives/common/src/constants.rs @@ -0,0 +1,55 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use sp_runtime::Perbill; +use frame_support::{ + parameter_types, + weights::{Weight, constants::WEIGHT_PER_SECOND}, +}; +use crate::types::{BlockNumber, Balance}; + +pub const MILLISECS_PER_BLOCK: u64 = 12000; + +pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; + +// These time units are defined in number of blocks. +pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); +pub const HOURS: BlockNumber = MINUTES * 60; +pub const DAYS: BlockNumber = HOURS * 24; + +pub const MICROUNIQUE: Balance = 1_000_000_000_000; +pub const MILLIUNIQUE: Balance = 1_000 * MICROUNIQUE; +pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE; +pub const UNIQUE: Balance = 100 * CENTIUNIQUE; + +// Targeting 0.1 UNQ per transfer +pub const WEIGHT_TO_FEE_COEFF: u32 = 207_890_902; + +// Targeting 0.15 UNQ per transfer via ETH +pub const MIN_GAS_PRICE: u64 = 1_019_493_469_850; + +/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers. +/// This is used to limit the maximal weight of a single extrinsic. +pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); +/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used +/// by Operational extrinsics. +pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); +/// We allow for 2 seconds of compute with a 6 second average block time. +pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; + +parameter_types! { + pub const TransactionByteFee: Balance = 501 * MICROUNIQUE; +} diff --git a/primitives/common/src/lib.rs b/primitives/common/src/lib.rs new file mode 100644 index 0000000000..0ddacf9643 --- /dev/null +++ b/primitives/common/src/lib.rs @@ -0,0 +1,20 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +#![cfg_attr(not(feature = "std"), no_std)] + +pub mod constants; +pub mod types; diff --git a/primitives/common/src/types.rs b/primitives/common/src/types.rs new file mode 100644 index 0000000000..93bfebed0a --- /dev/null +++ b/primitives/common/src/types.rs @@ -0,0 +1,81 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use sp_runtime::{ + generic, + traits::{Verify, IdentifyAccount}, + MultiSignature, +}; + +/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know +/// the specifics of the runtime. They can then be made to be agnostic over specific formats +/// of data like extrinsics, allowing for them to continue syncing the network through upgrades +/// to even the core data structures. +pub mod opaque { + pub use sp_runtime::{generic, traits::BlakeTwo256, OpaqueExtrinsic as UncheckedExtrinsic}; + + pub use super::{BlockNumber, Signature, AccountId, Balance, Index, Hash, AuraId}; + + /// Opaque block header type. + pub type Header = generic::Header; + + /// Opaque block type. + pub type Block = generic::Block; + + pub trait RuntimeInstance { + type CrossAccountId: pallet_evm::account::CrossAccountId + + Send + + Sync + + 'static; + + type TransactionConverter: fp_rpc::ConvertTransaction + + Send + + Sync + + 'static; + + fn get_transaction_converter() -> Self::TransactionConverter; + } +} + +pub type SessionHandlers = (); + +/// An index to a block. +pub type BlockNumber = u32; + +/// Alias to 512-bit hash when used in the context of a transaction signature on the chain. +pub type Signature = MultiSignature; + +/// Some way of identifying an account on the chain. We intentionally make it equivalent +/// to the public key of our transaction signing scheme. +pub type AccountId = <::Signer as IdentifyAccount>::AccountId; + +/// The type for looking up accounts. We don't expect more than 4 billion of them, but you +/// never know... +pub type AccountIndex = u32; + +/// Balance of an account. +pub type Balance = u128; + +/// Index of a transaction in the chain. +pub type Index = u32; + +/// A hash of some data used by the chain. +pub type Hash = sp_core::H256; + +/// Digest item type. +pub type DigestItem = generic::DigestItem; + +pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; From 3fa58894bbf0a63bdd5b8f8c8a9fac960b024ed4 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 11 Aug 2022 13:53:23 +0300 Subject: [PATCH 0325/1274] FIX: matrix varibale name has been changed. --- .github/workflows/forkless-update-nodata.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index e38dd71953..845cc2abd4 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -119,19 +119,19 @@ jobs: if: success() || failure() uses: jwalton/gh-docker-logs@v2.2.0 with: - dest: './fpu-logs.${{ matrix.feature }}' + dest: './fpu-logs.${{ matrix.features }}' images: 'node-parachain' - name: Tar logs if: success() || failure() - run: tar cvzf ./fpu-logs.${{ matrix.feature }}.tgz ./fpu-logs.${{ matrix.feature }} + run: tar cvzf ./fpu-logs.${{ matrix.features }}.tgz ./fpu-logs.${{ matrix.features }} - name: Upload logs to GitHub if: success() || failure() uses: actions/upload-artifact@master with: - name: fpu-logs.${{ matrix.feature }}.tgz - path: ./fpu-logs.${{ matrix.feature }}.tgz + name: fpu-logs.${{ matrix.features }}.tgz + path: ./fpu-logs.${{ matrix.features }}.tgz # - name: Test Report From a1640c1bec7458d72481f5f385a01aaa4dbaee1d Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 11 Aug 2022 11:02:14 +0000 Subject: [PATCH 0326/1274] Cosmetic changes: updated links in readme, disable .ts tests for github linguist --- .gitattributes | 1 + README.md | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index efdba87644..a22d53f542 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ * text=auto *.sh text eol=lf +*.ts linguist-detectable=false \ No newline at end of file diff --git a/README.md b/README.md index b29f00fea0..8aa078fdee 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,8 @@ The Unique Chain also provides: Wider Unique Ecosystem (most of it was developed during Hackusama): -- [SubstraPunks Game hosted on IPFS](https://github.com/usetech-llc/substrapunks) -- [Unique Wallet and UI](https://uniqueapps.usetech.com/#/nft) +- [SubstraPunks Game hosted on IPFS](https://github.com/UniqueNetwork/substrapunks) +- [Unique Wallet and UI](https://wallet.unique.network) - [NFT Asset for Unity Framework](https://github.com/usetech-llc/nft_unity) Please see our [walk-through instructions](doc/hackusama_walk_through.md) to try everything out! From acb5c04224a9d459e8498bc0d4a8b1e0588fcc46 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 11 Aug 2022 15:42:40 +0300 Subject: [PATCH 0327/1274] Jobs renamed. --- .github/workflows/forkless-update-nodata.yml | 2 +- .github/workflows/tests_codestyle.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 845cc2abd4..9769eeb490 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -20,7 +20,7 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - build: + forkless-upgrade-nodata: # The type of runner that the job will run on runs-on: self-hosted-ci diff --git a/.github/workflows/tests_codestyle.yml b/.github/workflows/tests_codestyle.yml index 3b5db2133c..3dece3b354 100644 --- a/.github/workflows/tests_codestyle.yml +++ b/.github/workflows/tests_codestyle.yml @@ -9,7 +9,7 @@ on: - reopened - synchronize jobs: - build: + code_style: runs-on: self-hosted-ci steps: From bc60087b6e1f0d0aa6a3fffa03cd44f95d4e3597 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 11 Aug 2022 17:19:38 +0300 Subject: [PATCH 0328/1274] test: remove outdated createMultipleItemsEx check `RefungibleMultipleItems` no longer allows to provide multiple users for single token --- tests/src/createMultipleItemsEx.test.ts | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/tests/src/createMultipleItemsEx.test.ts b/tests/src/createMultipleItemsEx.test.ts index b1c8aea045..e76d2f0497 100644 --- a/tests/src/createMultipleItemsEx.test.ts +++ b/tests/src/createMultipleItemsEx.test.ts @@ -392,27 +392,4 @@ describe('Negative test: createMultipleItemsEx', () => { expect(json).to.be.deep.equal(data); }); }); - - it('fails when trying to set multiple owners when creating multiple refungibles', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - // Polkadot requires map, and yet requires keys to be JSON encoded - const users = new Map(); - users.set(JSON.stringify({substrate: alice.address}), 1); - users.set(JSON.stringify({substrate: bob.address}), 1); - - // TODO: better error message? - await expect(executeTransaction(api, alice, api.tx.unique.createMultipleItemsEx(collection, { - RefungibleMultipleItems: [ - {users}, - {users}, - ], - }))).to.be.rejectedWith(/^refungible\.NotRefungibleDataUsedToMintFungibleCollectionToken$/); - }); - }); }); From 631b82d7f34ea5c72c0a45bf12cfeb3326918b96 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 11 Aug 2022 17:49:31 +0300 Subject: [PATCH 0329/1274] Bash script inside workflow --- .github/workflows/forkless-update-nodata.yml | 30 ++++++++++++++------ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 9769eeb490..7a0c9be225 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -110,28 +110,42 @@ jobs: - name: Build the stack - run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate - - - name: Wait for 15m - run: sleep 600s + run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 --exit-code-from + + - name: Wait for 5m before starting tests docker logs for " RUNTIME UPGRADE TESTING " criteria + if: success() + run: sleep 300s + + - name: Check if docker logs consist logs related to Runtime Upgrade testing. + if: success() + shell: bash + run: | + function do_docker_logs { DOCKER_LOGS=$(docker logs container node-parachain --details 2>&1)} + function is_started { if [[ ${DOCKER_LOGS} != *"RUNTIME UPGRADE TESTING"* ]];then return 0 fi return 1} + while ! is_started; do + echo "Waiting for "RUNTIME UPGRADE TESTING" in container logs" + sleep 15s + done + echo "Test completed." + exit 0 - name: Collect Docker Logs if: success() || failure() uses: jwalton/gh-docker-logs@v2.2.0 with: - dest: './fpu-logs.${{ matrix.features }}' + dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}' images: 'node-parachain' - name: Tar logs if: success() || failure() - run: tar cvzf ./fpu-logs.${{ matrix.features }}.tgz ./fpu-logs.${{ matrix.features }} + run: tar cvzf ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }} - name: Upload logs to GitHub if: success() || failure() uses: actions/upload-artifact@master with: - name: fpu-logs.${{ matrix.features }}.tgz - path: ./fpu-logs.${{ matrix.features }}.tgz + name: forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz + path: ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz # - name: Test Report From a6d261c759c3fec0cccb8287c3dc17b2a168b31f Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 11 Aug 2022 17:53:51 +0300 Subject: [PATCH 0330/1274] Specified service name for --exit-code-from option --- .github/workflows/forkless-update-nodata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 7a0c9be225..5e7c252986 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -110,7 +110,7 @@ jobs: - name: Build the stack - run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 --exit-code-from + run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 --exit-code-from node-parachain - name: Wait for 5m before starting tests docker logs for " RUNTIME UPGRADE TESTING " criteria if: success() From 68ebb3e31038883610e74c1ee71f70f11938ee5f Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 11 Aug 2022 17:56:36 +0300 Subject: [PATCH 0331/1274] Remove --exit-code-from due to not compatible with --detached option. --- .github/workflows/forkless-update-nodata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 5e7c252986..eed7bf4e1b 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -110,7 +110,7 @@ jobs: - name: Build the stack - run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 --exit-code-from node-parachain + run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 - name: Wait for 5m before starting tests docker logs for " RUNTIME UPGRADE TESTING " criteria if: success() From 1122e0d7b3e0cec16c4b760300e5a35ebaacbad4 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 11 Aug 2022 18:11:18 +0300 Subject: [PATCH 0332/1274] Workflow built-in Bash script has been updated. --- .github/workflows/forkless-update-nodata.yml | 26 +++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index eed7bf4e1b..63f9a69727 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -118,16 +118,24 @@ jobs: - name: Check if docker logs consist logs related to Runtime Upgrade testing. if: success() - shell: bash run: | - function do_docker_logs { DOCKER_LOGS=$(docker logs container node-parachain --details 2>&1)} - function is_started { if [[ ${DOCKER_LOGS} != *"RUNTIME UPGRADE TESTING"* ]];then return 0 fi return 1} - while ! is_started; do - echo "Waiting for "RUNTIME UPGRADE TESTING" in container logs" - sleep 15s - done - echo "Test completed." - exit 0 + function do_docker_logs { + DOCKER_LOGS=$(docker logs --details node-parachain 2>&1) + } + function is_started { + if [[ ${DOCKER_LOGS} != *"PARACHAINS' RUNTIME UPGRADE TESTING"* ]];then + return 0 + fi + return 1 + } + while ! is_started; do + echo "Waiting for "PARACHAINS' RUNTIME UPGRADE TESTING" in container logs" + sleep 15s + done + echo "Test completed." + exit 0 + shell: bash + - name: Collect Docker Logs if: success() || failure() From f67fe0eabae5ad042bcabb28aebaa84d7de69b1d Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 11 Aug 2022 18:23:59 +0300 Subject: [PATCH 0333/1274] TMP disabled for debug for bash script. --- .github/workflows/forkless-update-nodata.yml | 50 ++++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 63f9a69727..2ce051b70f 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -112,9 +112,9 @@ jobs: - name: Build the stack run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 - - name: Wait for 5m before starting tests docker logs for " RUNTIME UPGRADE TESTING " criteria - if: success() - run: sleep 300s +# - name: Wait for 5m before starting tests docker logs for " RUNTIME UPGRADE TESTING " criteria +# if: success() +# run: sleep 300s - name: Check if docker logs consist logs related to Runtime Upgrade testing. if: success() @@ -123,13 +123,13 @@ jobs: DOCKER_LOGS=$(docker logs --details node-parachain 2>&1) } function is_started { - if [[ ${DOCKER_LOGS} != *"PARACHAINS' RUNTIME UPGRADE TESTING"* ]];then + if [[ ${DOCKER_LOGS} != *"RUNTIME UPGRADE TESTING"* ]];then return 0 fi return 1 } while ! is_started; do - echo "Waiting for "PARACHAINS' RUNTIME UPGRADE TESTING" in container logs" + echo "Waiting for "RUNTIME UPGRADE TESTING" in container logs" sleep 15s done echo "Test completed." @@ -137,23 +137,23 @@ jobs: shell: bash - - name: Collect Docker Logs - if: success() || failure() - uses: jwalton/gh-docker-logs@v2.2.0 - with: - dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}' - images: 'node-parachain' - - - name: Tar logs - if: success() || failure() - run: tar cvzf ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }} - - - name: Upload logs to GitHub - if: success() || failure() - uses: actions/upload-artifact@master - with: - name: forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz - path: ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz +# - name: Collect Docker Logs +# if: success() || failure() +# uses: jwalton/gh-docker-logs@v2.2.0 +# with: +# dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}' +# images: 'node-parachain' +# +# - name: Tar logs +# if: success() || failure() +# run: tar cvzf ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }} +# +# - name: Upload logs to GitHub +# if: success() || failure() +# uses: actions/upload-artifact@master +# with: +# name: forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz +# path: ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz # - name: Test Report @@ -170,6 +170,6 @@ jobs: # echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}" - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down +# - name: Stop running containers +# if: always() # run this step always +# run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From b5366b98d4f5d6af917bda4447f0b1905f943463 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 11 Aug 2022 18:38:31 +0300 Subject: [PATCH 0334/1274] Added echo for debug --- .github/workflows/forkless-update-nodata.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 2ce051b70f..8a72b9bf94 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -124,8 +124,10 @@ jobs: } function is_started { if [[ ${DOCKER_LOGS} != *"RUNTIME UPGRADE TESTING"* ]];then + echo "Function is_started: Return 0" return 0 fi + echo "Function is_started: Return 1" return 1 } while ! is_started; do From b719e6a1e1b5054c87ff1debb731d845727feacc Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 11 Aug 2022 18:49:46 +0300 Subject: [PATCH 0335/1274] Seems final. Let's test it. --- .github/workflows/forkless-update-nodata.yml | 58 +++++++------------- 1 file changed, 21 insertions(+), 37 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 8a72b9bf94..1b2a2f951c 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -123,7 +123,7 @@ jobs: DOCKER_LOGS=$(docker logs --details node-parachain 2>&1) } function is_started { - if [[ ${DOCKER_LOGS} != *"RUNTIME UPGRADE TESTING"* ]];then + if [[ ${DOCKER_LOGS} = *"RUNTIME UPGRADE TESTING"* ]];then echo "Function is_started: Return 0" return 0 fi @@ -138,40 +138,24 @@ jobs: exit 0 shell: bash + - name: Collect Docker Logs + if: success() || failure() + uses: jwalton/gh-docker-logs@v2.2.0 + with: + dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}' + images: 'node-parachain' + + - name: Tar logs + if: success() || failure() + run: tar cvzf ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }} + + - name: Upload logs to GitHub + if: success() || failure() + uses: actions/upload-artifact@master + with: + name: forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz + path: ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz -# - name: Collect Docker Logs -# if: success() || failure() -# uses: jwalton/gh-docker-logs@v2.2.0 -# with: -# dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}' -# images: 'node-parachain' -# -# - name: Tar logs -# if: success() || failure() -# run: tar cvzf ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }} -# -# - name: Upload logs to GitHub -# if: success() || failure() -# uses: actions/upload-artifact@master -# with: -# name: forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz -# path: ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz - - -# - name: Test Report -# uses: phoenix-actions/test-reporting@v8 -# if: success() || failure() # run this step even if previous step failed -# with: -# name: Tests ${{ matrix.network }} # Name of the check run which will be created -# path: tests/mochawesome-report/test-*.json # Path to test results -# reporter: mochawesome-json -# fail-on-error: 'false' -# -# - name: Read output variables -# run: | -# echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}" - - -# - name: Stop running containers -# if: always() # run this step always -# run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From 02657310a3946c27da0289b9d1ba132c39701cad Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 13:06:36 +0000 Subject: [PATCH 0336/1274] chore: change verifyOwnerOrAdmin method --- pallets/common/src/erc.rs | 5 +- pallets/fungible/src/stubs/UniqueFungible.raw | Bin 2807 -> 2813 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 202 ++++++------- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4170 -> 4184 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 94 +++--- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4197 -> 4211 bytes .../refungible/src/stubs/UniqueRefungible.sol | 280 +++++++++--------- tests/src/eth/api/UniqueFungible.sol | 93 +++--- tests/src/eth/api/UniqueNFT.sol | 59 ++-- tests/src/eth/api/UniqueRefungible.sol | 185 ++++++------ tests/src/eth/collectionAdmin.test.ts | 16 + .../src/eth/fractionalizer/Fractionalizer.sol | 2 +- tests/src/eth/fungibleAbi.json | 6 +- tests/src/eth/nonFungibleAbi.json | 6 +- tests/src/eth/reFungibleAbi.json | 6 +- 15 files changed, 493 insertions(+), 461 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index ac007645cf..be4e5db414 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -412,9 +412,10 @@ where /// Check that account is the owner or admin of the collection /// + /// @param user account to verify /// @return "true" if account is the owner or admin - fn verify_owner_or_admin(&mut self, caller: caller) -> Result { - Ok(check_is_owner_or_admin(caller, self) + fn verify_owner_or_admin(&self, user: address) -> Result { + Ok(check_is_owner_or_admin(user, self) .map(|_| true) .unwrap_or(false)) } diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index b5326c563fe1c562e3991b562ce2935361805e82..c88943a4d07f8636e9ca1e4af3becd2c74c2fd30 100644 GIT binary patch literal 2813 zcmaJ@du$X%9NuB~9vB`ia)JTh~{LK#*GqPWWp+?r_9izjGS}iv`Q z@MprUX_X0=bS7M|W-*~Aty)YlpgXS73bPc(4`yT>EU+Ss#1z>!Nm8Xk85Ofmth_8r ziS5LO*tJj!A;B)#S(c6FRD)YX>Xc`)Bx%&PS)>gi%n`>Tj7)=Nw!zmmrNt&mch6^> z7`+h1wt6kMS(d@qW5lV2`K<3mjgeQVFo_Bsm#BvHxG5;{Q$VHhC5#-$C_#^vYnewU zR{vPa$UsHQY?!=ycPSG#1AcW+?M}d@J{-*Yi~u}RclwUOOdJh(ZpY6%0H*-{-PwF6 z2zxvQ-ZmI_VQE|7r4Iln1ActtuvQ542Rt~ea}i*yAkh5OsV|}ID3&;cz*#{1v+MV} z+iIEo@wz=eT>Jft)qo=kvfO-(zk$G#O~zQj-vC!sR*m)ro;Wby0i0YA7!#U05B|1* zRc$_WFJRh-V7&>b+!7oKxDjw}OXWJiU4Zkg`+f&3I?1=ecoCMyPB}3juo-ZQeDX=a zwSZMM7ykm>SkT+|;jP=D>=P_;h$SAC(wpzfqH<0GUKj0u1haPoR_$63U(e9K^mc;o^ZApxyZ=*@l;~sK~#Y_C#?!9>r=}5^m8ZA@<|QFSCw=k z5ng|UV=X5-9pH^-;zoCo^|>MEFlhnkMPVt=N6DhRD-B{V&W9KkZ3w*2*UW+h?Q(L_ z9#Y_O1H1XbF}+4OUp>|y>p2RI>@}K!5iIkZylm~&Ud*GMSqO*A8Rkwse*uEwHQS=165@`Q7; z&npA3*9qu}mN+QF#9zE=Cbk<)+?`fi^KScsLZ2at9z#z+3qivb%k(JUu-%(SyG&|U ziV9vkl&Tf zguTHc7L#IWRrB;BYMxr(4^%6yGHvdIw8i&9dfQ}Db6Rbq@m8mmBwBq}G-#z(*5w{5 zaDTw|;O1o}{Xye4%)}@s(<+N3968T_|9i<)C2?E0*6U<`m;dRdhEXyk!U7W%{F!ut z=P%{QyT~#ThrnzwX1fd)SV$`@cPj*e1qP&5M>h17X_|yHHP2kb-~pMyqi30jUNK7s z?hP`C1>W%865CBP;kpx;3jN(d3ixp|5=B!qe&Gdv^(6ymvPcXItVa#Ve1}9%b{Rp* zW5_1V)QNp93r2mJ;Bec3Hry~=8#0KXxp!%?dV(ki_s&jSR(Qb&y#&y*RXr0H>t`zamc5hMdj*`2x zpMMtm)-q7-JkM?Xfbdh-T_&NkSF|e}_U#G}?r9ebSGw8fxpB{om;7P^!&3`lHQvcY z;C&G<9!RH&18>dJDKYeNRGf*YTljH2-OOlSR&A5N+`?;%FE=|yy@#9KskUT^>D~r9 z9*5y~6!-ZQ-m9>12Yl+nqsT~EkqGi_kabYZXN70EgcC=*%JTP8__U(Wve2e@KGzTy z{yMFiWIcbywQYEThsXWWmp0FBSTb+<149SJ$2>n>{qqcY?XANdTiRYeANllf|BnWo zD%&^xy#X^{AGOk+yL|D&%rqf9P#D*=pkaADv$(No8Ot=qfg2VrSy;cQzOku(ZoHu} L-pHC7R@DCs%Ie@r literal 2807 zcmaJ@ZEO@p7~bjL?Hxv?MeeX($z3QCjfxgHuz}zKQJeU+ceJ;dMKjY6Y6+AAr4i7u zpH~P*_pTKrC=jAS68&L7CE_1HPzgvO8bg90F-1i}G!hjIZGC2U@7f}=mrI_RdESqC z-*?^_dX}a#bPCmUJ>#&OPS9PolsHU?I|dU@WL0^F7Gc7@3Kg^gRc6G=s!dPUtzSvc z#;A~?^JpMLCsScSr9{`O93!eRVX;Ct7}30}(u7g2i%fVy87VWVBqQe?IjhpRQ2`rA zVFOOkgr1;ro6umDPG}-mj-|bdtbyiE8U%`Uolk$I7k7r~$Jg_2+#1z>!Nm`{sB^7f{ ztg13fiS5KD*bOiWA;B*CS(%IGRfBs&8kLPXk~SK8Ez*k+=80nwMi#&`+u-Y((ruHp zt8=3hqnD#lt2c0;Wf^=uMw|w?&&EvC7}-gMS}I%`q#DxWrl8zU0S(M7XQUsaBt2WD zHMLq#{ZzroSVe1k_2l+>6-?L-_|0Pt2LM<4a6BuU3V6El;@t5}ybJKJ{XgsnoC)~P z!20M*&99rD+Jcw;Ohr5y8y6n^1yP;Mv4M!kG486b_Pov`mFUYUN{DL z1+(^{JB|SM0T%ijzjUEnP@en#($WX#odP@!R>v-*2Jix4S9NOYNP+4Dt4?FT-B?Q1 zUA+RB^&wbq0nRg@c^q&bpz?rpk3ZYoUA+bHlcLXD4aTit-5+{r3E&#QnmOlM0ZqU; z^7(auZxjWjfiohEeTF3tvBV=f=Gi^_0C`j@?t3_gB03Lvd-N8rJnhRil9w%ig$y0u z12_m$;7z&^q$vvO31^FutBm|TlLnZ07*!x81RZkn z(GgPMaYu*w(%qv*^GA(ZMvg*vjvA#ff@j`luUXqZig}VVvCV28mJna#J02DePvKK@ zOD^+fuq!5xa-8>vbmJqjuj#oMwi6&sT#0Cfc{lQ6iiRfKh(&L(s3kRI2q)xouK>I* zC!iZz;^GRWKdbf>+{OiiMaF=~(37x2&}zj>J<1jGV~<)vqfBd7h6-LI z49r&0HEp7kbj~CO$q*KZqY?7{7kC09G+}lVl2K(ECp2CeEjR_VR#M3GehE=%f^M*g z#R8G6s(E%1HP5WS57?$D)8=~!?DY2#c-v%wHCeTnCVHG6lI-!fqQNS)axV8sk^3#w zgIkbU;76LU;U-3TnWij~bmRj6{qOaXO5>hzz1Kp4#924=j3;V-C3i@#~k|kF(e$@rP_a%eBBbxPd>+L{@|I4V zO%`Gz{q70(*rZ1_ZCse4h{8gW?be8q;q#7-mx=Tz>T?UfH1Yjs@1a?~`}}P2>Kc)b z&_Zu*L^}8h2`%+SLS43z^Rj^h$&;UK;&tYRD&%-9?RpUpz3VON!%=cI`}t>~iaMvH9M~MBsf9FCIvz zi34xd>y#LJ6)Mieqb@ueZ>qcs@4~7Cx3$O|q50 z-+H&b#>3-&*}>h-Z5>NiFPbziv3K$Dy5GL2`EZt=pZoESwf!@yI%e$Xdvr$Etp{_5 z#TAR1SFc#sv_J@t6{dGS*S0#*w4%Lp6>I8D0JkmgSk|(mT`m6t DUen)~ diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index bf47f1615a..0665fc0743 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -31,103 +31,7 @@ contract ERC20Events { ); } -// Selector: 79cc6790 -contract ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) public returns (bool) { - require(false, stub_error); - from; - amount; - dummy = 0; - return false; - } -} - -// Selector: 942e8b22 -contract ERC20 is Dummy, ERC165, ERC20Events { - // Selector: name() 06fdde03 - function name() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: symbol() 95d89b41 - function symbol() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: decimals() 313ce567 - function decimals() public view returns (uint8) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) public view returns (uint256) { - require(false, stub_error); - owner; - dummy; - return 0; - } - - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 amount) public returns (bool) { - require(false, stub_error); - to; - amount; - dummy = 0; - return false; - } - - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 amount - ) public returns (bool) { - require(false, stub_error); - from; - to; - amount; - dummy = 0; - return false; - } - - // Selector: approve(address,uint256) 095ea7b3 - function approve(address spender, uint256 amount) public returns (bool) { - require(false, stub_error); - spender; - amount; - dummy = 0; - return false; - } - - // Selector: allowance(address,address) dd62ed3e - function allowance(address owner, address spender) - public - view - returns (uint256) - { - require(false, stub_error); - owner; - spender; - dummy; - return 0; - } -} - -// Selector: aa7d570d +// Selector: 6cf113cd contract Collection is Dummy, ERC165 { // Set collection property. // @@ -355,12 +259,14 @@ contract Collection is Dummy, ERC165 { // Check that account is the owner or admin of the collection // + // @param user account to verify // @return "true" if account is the owner or admin // - // Selector: verifyOwnerOrAdmin() 04a46053 - function verifyOwnerOrAdmin() public returns (bool) { + // Selector: verifyOwnerOrAdmin(address) c2282493 + function verifyOwnerOrAdmin(address user) public view returns (bool) { require(false, stub_error); - dummy = 0; + user; + dummy; return false; } @@ -376,6 +282,102 @@ contract Collection is Dummy, ERC165 { } } +// Selector: 79cc6790 +contract ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) public returns (bool) { + require(false, stub_error); + from; + amount; + dummy = 0; + return false; + } +} + +// Selector: 942e8b22 +contract ERC20 is Dummy, ERC165, ERC20Events { + // Selector: name() 06fdde03 + function name() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: symbol() 95d89b41 + function symbol() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: decimals() 313ce567 + function decimals() public view returns (uint8) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) public view returns (uint256) { + require(false, stub_error); + owner; + dummy; + return 0; + } + + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 amount) public returns (bool) { + require(false, stub_error); + to; + amount; + dummy = 0; + return false; + } + + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 amount + ) public returns (bool) { + require(false, stub_error); + from; + to; + amount; + dummy = 0; + return false; + } + + // Selector: approve(address,uint256) 095ea7b3 + function approve(address spender, uint256 amount) public returns (bool) { + require(false, stub_error); + spender; + amount; + dummy = 0; + return false; + } + + // Selector: allowance(address,address) dd62ed3e + function allowance(address owner, address spender) + public + view + returns (uint256) + { + require(false, stub_error); + owner; + spender; + dummy; + return 0; + } +} + contract UniqueFungible is Dummy, ERC165, diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 3c4ce0169dd13d037b63d471f1e150c3e2e32660..3c681ec4814b29cf2770ad4ae3a41f6d75b93a7c 100644 GIT binary patch literal 4184 zcmai13yf6N8NO#{=eaZMF0!+(L%SmoYf@fn2Q*;ZrAR1k@$QtJp@gtF{zl=rnaOZ(%6^A8pXC?rO~$1ClJ$6V}q2iZohNRy|Z_;k6mW@ z&VT;b`Op72L(kHlJiU?XhLLv%l(t*w;oB(zQl`5m{{F6@sh`n1faVpcqK|9pfI^NI zw9<-Y!`tZD3{~>9mp13=Osb4)lo-Y|*G%i+A1Km?&2&}OXx3~qLZDd1pw#rblv;Jw zf=0W|c5dek?7$hCHL|qZAv8SAAT(QU<9pvPsyY}2)g;hu7=nJfXd3;L5U{)ehgFq- z3YyVJ34VJrAw#IXTm-{qd=?Zm9HY&^pSZmegfA8}8~^Qw8(E!pTkSZ>RO~K;Gd3)f zxkc5nNS{WPE*dJknQ2{VN*p)S>GVVHG~^V=ce<;bu4<<6jO;3olu4i2KW39L#I;IX z8(xxC@X|54@8nRi;*dU}cf`%m%W0@K`uPD=6%s~wr-+vtN zD;}K6LbCxcI2T@;%9=UvrDN|L1N;E+%J}eNz*W+gRD<=8vGt4L!tVi30{(L5_$I)& zeJ*ZSNa>~8Uj|(VLQvWWKd*^gZT{2Hh;j&JAGqn^eA zvfuVZ$;2y916~AE_*6&(Qzu}Awf`Eho5S%xgaCQU#jcxj6>xD8MT8E+n*Pq3&d;aK zEW90g-#k&!6pe+NSkt&5j)54Sfr{(tb2~bC(GiaIYRG+G@bS$_C6Onv3guY1M~JXc zYt?1ZIh?3^DxN%`JkN6&N z-Ss2JXG>0g^vQ#8FDH2#y-C~>+)MQHRb6+3T;g(2XUmd?)whGIX=R>>;Sl zF252HVjkZ~XOkxyRv!dcDQ>iW*hW?IkiKG}rG8DR&0J2EAxB&98(5k-N&lKb=$i=( zUyplD9TGRma{<#x;m!ZQanb*=spoWL)>IbWBr{tMCPIT0;gI(Znc261Ix4xl&rr;7Ub zAKhoM=sg8(jAlpOQIZ?=(m;oDYL|HgqTiFsty~QeuqPv+E$&)-W#0nSQgX2P)|4Lae zD`GE7Nwe;zIBLv$II!5cGVW631A+mCelTL=Qcw-13}WpS43B7hMiC#8%qk6MkO914 z_}%I9LgKxi+wtYT+j#TAhOb5V5??2|j0&Ea6j6+ zAiMCyGl;v#;?6uPB^-xn79NBwf%%_vc+SRO;akSIRwnws5K5Wsz82JXJSvNyW8pUn z+K5SVMt(Q`R)o}qzn@4wx|bKFh?2RNc3`_nr7NOJQs>q&dhTH-pMXY{Hmbo2R?F&KykICq&e1-p1e!==;fY& zqukY&+dS4l8S&#z7EjAPzOs@dGI&&FE!#wi@ES+?_J~ZRG>|Mp^{6lS&3b+DJ{GJR zFY{Yo@L6BByi)skR9pTmnd(t(`KKfxs>!DR7uDnqlDQ$OEV)1iC=lG_jl3}YoJe|a zdok1ac>}qS^j^G^^~#T(^y@!)u-?8g2SuANP2fkQR?_Q#da$$Cjh>XgA`$B|4~o6> zv*bnFL^t7cVT`v{uLF6pOeLgnqgSb{q_WhkpjRxlkau4ZbJ3FIh^e>qRM8ise!2%m z0>MZbKIfi~a>}sbLM;p%d!<2%X-q>Ox6(RGJ&*6hR=TEYj)kwoEOn;-ZP>|E`DNG{ z*D7UViKnE2?{+ENJHCgq)g;gSZlhVSp@AsQ^y`ZB&&%B^TQ*n2e+=>v1)lPDRI5gCrtPRRZN(0XS|6>7(mE|#Z4r%*R`A7i>U4l1jo&%<+|AwAN5Y2h z{OAAw^Z)<(A7|+}%@^p~sBRbqw^wOfK*w&P1W1|Zn)v(MqNZN2cLFUbQAMB7)Lw-= zT-3_zRu6oFj%TP+pet!}fi9rRghq*B%yG@M4*uQ}9W>KbRijz6%?N>Fm4Z_9>QZXe zRf`(!GTZq%zs5N*hGvZ{?Q#eW&oKziR@(U9<0VxGqoA4ux(!3n&y-A~hY|vo@4;YI z<)5NvbW?)gd?sWF)t5?OxP;FQMGbDW8Tb>oH-PZrqGsd2127}2(=MwWp3K1RY8YeV zWU{!VIu_~Hs4|;|DsE=Z>@+2go0;kKK<*6W6vsDub|qcaOko+>R~oL6ZnJ09CZmXJ zmAE#nBpYF+V{+Tck2DQ)szX!Ei**7Pf^a&&x-UM?+(ysMoNv!s{r>if>|cBWhad?ftfNx-9kXFk+( z0&u^CGgxRL;05Qx(=%A}S-{th|Nb~27rQbsunKUacb2CH0$Z{5(}ChSY&{A1iv<%q z0H5)>__^Ski7n^pxBOfv(95+y_5MV{L%;d_N_p-B%Ll&=>M`&hefRNAfRFiVc8!_W z!IS0K;t*T?fVLFhvj}5lY zgNuGSy&GFA0Lz7I=7PEkuy1JoVNllqZn4+DEH!@o#+7FQH~VVlpV)n_oi(ilSN;dn zX2ZrSfU6E~-wOCk3FSHOdt~$u$aa9be*5Xa0A>Nzlj{Zn7x@~w8VJ0Gt(DeC*J7)g ztFafgg8Hz}#m^OMy}UU3-pzndfNOF8?Y99w1-NX(k_h1QfGgAsp9UNU%&)$B8SuQX zCN`_%D$F0j7Khm4uE+0q=o^6iYTFmyQklV;UILt1cwqq4y@0dQDSkSS_PmAnUjh7_ z)Ywbzvn4;7JoOOZMKCpgh29D#o(19OLz;vU*8Ut|7pRem--Q4dmQY0KFs$hxtm*tR z+RVaz$ouA3ikhOaP!nsK5X1_I;Z9UszT55W+SDPxmgZ&+Oju2THay0GV#uS&?(FD6Afr|Jb6jl8?}{h4RzpEC${GhyK* zZZdVZxI2FPm_G_{_y3KH{*O&Prz4kUu<*ycT=qtig4tz-tA((@n12fOtWn!jyqq%hlL;Iz7ziyO=mXLPd2YDlaW5-h?euh5J_V&Q*cY#Ifd zW~~Y#?O@#{70@ikZq_0|QwhbHD3tvdAgN ztPmENThywmT2pJ{1)vz+x?P}(80#!@xr9f6Lk!Ygv4}|u;6KN$gH_QMD1!PSLJFEn zyM+BUx5n+NK_eoTMUp58KR3c=kuxCGFDrVBXNQ^-(b7F5$M8-NS0-}+-N^SU>fe8K z&|=ZGMQxO3N8AyT8%p2LmlQ4; z30%W!9Y0pAs#x7lsa&~g?ND_T*CJ2zJ&W!4)jGC_0#`D^6GN2-76}cb1Tx4j zJn9VM-feMXzT`DaZ#3HVR z=nV7dBxL>9Y*N!qn}_FY$;z1pPQc69Wr-gaHT}>Vya*ImVp1B}5}Ue9*eG+)zfo># z%R41&pp3Y?Q^nJ=)>qc!hzuT4SxZ@z2(NLJZ(d{~rGaD-svTdjTCXqO$AVQOGr#3g zpY>aoEVVaBwS_<1@${)jwdG}xfT*_o>;FYHIo)G!h$>6I!wXO#xXD?(F#McIu924U zna2GM_Qe$yg?@dcuuXr8=Y^skuR`SZX2fz9QzLC3z#J-qKSa^u-E(x(7u9 z!AR}#IrqPj(+e9e)WWc_HyD(d#vJrS~F#UW+T4#Ft64V0U(+vzg?u>QR-0T*A#_R91MCX}zXo zY_KsRU5B^_2y2ZMHH)AfXzJ(#N4#p{!F>H_-?m+w_iUWkkzM!q`0}Q~&wTY~=kwp( zbKlqt&pvkS!RvGTpZZi}i}ljE$Cvi)xpRB@W+gUFS=zsK+n#Ls&Yk_cS-C$8yluy> Y?VEON+S$LUFS~7Lb|>rKws+IN0btW%)&Kwi diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index d858b1ed48..e60fbedb21 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -373,49 +373,7 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { } } -// Selector: 780e9d63 -contract ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid NFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) - // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) public view returns (uint256) { - require(false, stub_error); - index; - dummy; - return 0; - } - - // @dev Not implemented - // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - public - view - returns (uint256) - { - require(false, stub_error); - owner; - index; - dummy; - return 0; - } - - // @notice Count NFTs tracked by this contract - // @return A count of valid NFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address - // - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } -} - -// Selector: aa7d570d +// Selector: 6cf113cd contract Collection is Dummy, ERC165 { // Set collection property. // @@ -643,12 +601,14 @@ contract Collection is Dummy, ERC165 { // Check that account is the owner or admin of the collection // + // @param user account to verify // @return "true" if account is the owner or admin // - // Selector: verifyOwnerOrAdmin() 04a46053 - function verifyOwnerOrAdmin() public returns (bool) { + // Selector: verifyOwnerOrAdmin(address) c2282493 + function verifyOwnerOrAdmin(address user) public view returns (bool) { require(false, stub_error); - dummy = 0; + user; + dummy; return false; } @@ -664,6 +624,48 @@ contract Collection is Dummy, ERC165 { } } +// Selector: 780e9d63 +contract ERC721Enumerable is Dummy, ERC165 { + // @notice Enumerate valid NFTs + // @param index A counter less than `totalSupply()` + // @return The token identifier for the `index`th NFT, + // (sort order not specified) + // + // Selector: tokenByIndex(uint256) 4f6ccce7 + function tokenByIndex(uint256 index) public view returns (uint256) { + require(false, stub_error); + index; + dummy; + return 0; + } + + // @dev Not implemented + // + // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 + function tokenOfOwnerByIndex(address owner, uint256 index) + public + view + returns (uint256) + { + require(false, stub_error); + owner; + index; + dummy; + return 0; + } + + // @notice Count NFTs tracked by this contract + // @return A count of valid NFTs tracked by this contract, where each one of + // them has an assigned and queryable owner not equal to the zero address + // + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } +} + // Selector: d74d154f contract ERC721UniqueExtensions is Dummy, ERC165 { // @notice Transfer ownership of an NFT diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index fd3e97a576419147171bba121a9fc78dee6c52d7..a081d77ea3be45a005f050f7e1a13ce86331282e 100644 GIT binary patch literal 4211 zcmai13viTI72eBcpV?lmG=f90Pyks&`R>-_CSU7pl(}z;GU)Yw{}GXx8y3W~~6>mb_}=za20mqtSM=1)faA?ot?I z;bbzWpx7qqQfXic4VIkrv?(b{Y$rX*?uOh6$OUZA=qaUCMKy$FWP4$-M7oUbVT%kS zt`*`~u#&8VmA1icCl3|MHt7<22c0xMpMq+=n>(N=kkHe_>4qK{wf*=V4&YoDx&j0Dp7|xz{1DW8*FFQAgP#JlpP%}wI9=qeR^)21<^kEd z{pN+>dK7Tm^v z8S?-i@NAwFS#)~~8@CEui_O(v1Z)HR?4jY?VE$PbLSQ!F@^#1m3b+7Jd3xD>fHwga z=7v8381yu9HCVS}>jvwpCKz^%!#(Tn^mFlZvGp3Z=Jc<+74RhB{1tP9O>&ZiA5bU#WWG&QdVK)iwlCkx^aIPrQEV`rDs*2e3RaI95= z&N;!yH^-EOf67-13#mec1+T0)EOHYke$`bOStYhaAK8}aB^Rw~g(^H}X|Ycb#101i#M4 zHFc{O{Hp}3TiwG~o=&-^u!hI^m531Y_>LKyc-_BBw$`o0p`Nq#s-%;iVyVTurX)Hy zzcg|A==fbdpHKgS{w0mjHxL%e;$D+ah@0fOfI$`DbK$>n(f_fjWi@0L+Tx(hY&p9E z7;;vywT*=ym1Gt=Xt2=N^XgDlj3ON9aXcqE^sGp#Q|aIoJ;fCslyv`$^i9@It;@k6 zurmURh_BI0O1O zL1L4TU}4MCjIv_kNtmyC&Y~H!L`Vx*_qqyb2J<;%l51$7!bdl$IF(#2447M{%_9|l zS@Ij%io)4tIJ|S;lAA32j%}21+LF9lQIx7u6;FkL-lbVN8W8iJMLG(2E!adST_uwk zBu7{z%&mh}k*lEy>dS=WRE4&S$W)ywx2p<`h*$;xtXmZ0@hdr zG`xgZWW)_Y!o#X>wy;k`lH}R1sXs+Nd$ ze-Ncic1!^Ef=gxbaV&H;uMQd{tLJv$Z<$NQr`GmoJ+PA(rHGQTljIaDr&LM=|5yyO zMbRGQk4yejD=4o!#n(u)(48*VwIvZJS-Ejj^04?Wnd7{GHDCS;bKG`jq2hE>n!w^u zN+~VN;xE=h#9#U%ItDR`VtdZjcJfR&HKZA1I{Q)n0 z#nm{=HL`Ku*j>U#H}||7<)$`%$z}DG5qEd2cpA5Q%D!QX3?5Qg<1SGmyv9+!ogxz{ z^(Bi?eb^Ixs#agTkNK;{&HTnUJk~#(ZmE4Zs*RTnI+$;eNnb^RDMskN7ZtPnBpm^<7;0N?j2uIS<}n{YvRsd#`S51O;pen~#ZKiKSW&`W*+t&MU&w@{L literal 4197 zcmai13vg7`8Q$Z~KC>GVOg6yAW($t?1qAJ45vD9uJE^sJcO|=at~%#r6EO-%A=1HA zxUby}GS$1A0E+Dx>4Q3SoVL&zDy=ge$43XWL+MyYOQkckmg&o>mQqTj-#O>r&0Xyy zVZ(RM`Tzg?=R5!7EIm!Ld3qJq4I}Ri2HIEBsb!P^1?D>@{{Fh4sh`xlfclCwpigV+ zV1Rt5pq1A2k9~=rPSHS~uA(h@dL<1^Ym^v9k7Fiv$PX6j4l`L(HJUct4Fxk+(XTbX zp{3RwwV=^nvxD#RE9?VjXxd2A-ZG)V9)r+yrJb++ps4B)6tgCQZNm`rCyS;rKna1! zvv62d`KO>6IZE)GO(}*jeZB~R^Y~m>&~S`)1An6ST1JQr+bN=$(XKpzJw4x00-BrtpkxD~?x4&K#Ju z$s~BK5yys?DMolcML7Fl`L*1E?xAj1+MOa2D291*_x;4J@O9 zciy8q?hO~i0`2a-(3Yj`?6S8p%Fxq2da2kK`gjK;UoYyV^7HeKb+Eu$z=K;aya2c# z@Z{$QjsSkeg`G_42RvIo`+O&BIR|*|@SBG_S+E80!t~f`%x;l;Ni$Hm14}QB6;5I4 zb-&xqsVDD@Sabt zdIQk#%q%#v`BVqH>~<_=e>!U}U>D%(J?rm=`+s#I6!<E9@T{YB&#iVssFOi`B778cxrlnBNPS^$$*FlCOIe3DQ0AsMqdr>l$SBjH%D zDb71WjxWv_389cNMP)&xKg5{w(VD};%lYKJuF3Eku_WrqR7!DbNnsVDena8yO(S9U zK*N*&q!H=#YedYZ5o#Dy4tO32+ujkQ*Gox$^qGTjFK1|I_9nK{zZM(hqlWD!z1E=L zW^1l#bi_Z3-`X_V$VZ+{xu&v~gZxSa#hl+6XX7vVM~RlEk=WEzmdEl&QqQ}X#2DAR zSCWhxpBwya>Sg-76v%ENEO<3;GVv{Ocl`FzngYBN{5L83KNj_jj#xq=d_cys>{bD^ zHCvh8#ey|C&4T+(7QCmRP1Hs6!G@m1At_;GL>Qe;DRYe^H@HvE`@5pAmuB^xgVx7? zMF%s@_U44}i*8okUBd0BL9SziYvnDmCmT%C2PGyxjQ=y|$ z-ptfgE-vZt_I*t*ve22bS;2103R+E7>uOy*4gy9_xAQb0Iz9_`7V$nP6NBU`7BNX4 z^5?mC@G5*248eSrki4eSUg3Y;sdK;Tun5M|2$BHk=T6ux^cPGuE-Or>A8JOhrAsHL z@PrUo=EeZ3k$0-FcmLsi77MQ{Xp=NO;Y^Usgc}Arj8nV983_MG8n-faFksIxpyTbs z!f&_~gx{)KuwUc zxoWzbOsXo2fELis1GtXS2;WwWY8ZW)Qg`I2_1(2eT#LJ#ce2P{&+L>fSl~vU=7Awb zxbQ5F3vK=@b=|0loRFGk!%cD2i2I6Qk#{S&OA!ws0|q@ZqA{tc`a=d>y9vV?jrJAs z5y7m|Ugg=B&!>iH^H-85VtS#N7O^+oZ0UHmB!Y(aM;4K7mKG!(yijn!fver|>0L>pa)V z)&(PsVj+?nKQUFR9wR2C6Dp|aNPB1L$PBYm?X5-Ifsi!eRq zDSo$+U%Za_v&N15)?=RNFD*CKKFDe-f6?RV(_l4Dl9yJu0=Zl!x}|cnSBZu0ITFkKUa>?!ufBqFQIcef zX_WNDkf*l63wOVYkBr2_p5)&5OG?^sp%$8rz1E<_G6D4Hld!f01 { expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) .to.be.eq(newAdmin.address.toLocaleLowerCase()); }); + + itWeb3('Verify owner or admin', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelper = evmCollectionHelpers(web3, owner); + + const result = await collectionHelper.methods + .createNonfungibleCollection('A', 'B', 'C') + .send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + + const newAdmin = createEthAccount(web3); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + expect(await collectionEvm.methods.verifyOwnerOrAdmin(newAdmin).call()).to.be.false; + await collectionEvm.methods.addCollectionAdmin(newAdmin).send(); + expect(await collectionEvm.methods.verifyOwnerOrAdmin(newAdmin).call()).to.be.true; + }); itWeb3('(!negative tests!) Add admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); diff --git a/tests/src/eth/fractionalizer/Fractionalizer.sol b/tests/src/eth/fractionalizer/Fractionalizer.sol index 8877e7c5e5..c27ddf22fe 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.sol +++ b/tests/src/eth/fractionalizer/Fractionalizer.sol @@ -64,7 +64,7 @@ contract Fractionalizer { "Wrong collection type. Collection is not refungible." ); require( - refungibleContract.verifyOwnerOrAdmin(), + refungibleContract.verifyOwnerOrAdmin(address(this)), "Fractionalizer contract should be an admin of the collection" ); rftCollection = _collection; diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index 60f914e70f..e7d10deb9d 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -310,10 +310,12 @@ "type": "function" }, { - "inputs": [], + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], "name": "verifyOwnerOrAdmin", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" } ] diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index 8b5fc87518..f27f758406 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -535,10 +535,12 @@ "type": "function" }, { - "inputs": [], + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], "name": "verifyOwnerOrAdmin", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" } ] diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index 4b4126a78c..1c952893aa 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -544,10 +544,12 @@ "type": "function" }, { - "inputs": [], + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], "name": "verifyOwnerOrAdmin", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" } ] From 00b2c1c1cc688ae0f0ea9827e78e3f2196486528 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Thu, 11 Aug 2022 17:10:48 +0000 Subject: [PATCH 0337/1274] fix review remarks --- tests/src/util/playgrounds/unique.ts | 37 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index d8ac7df528..f9811b0ff6 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -925,7 +925,7 @@ class CollectionGroup extends HelperGroup { /** * - * Change ownership of a NFT on behalf of the owner. + * Change ownership of a token(s) on behalf of the owner. * * @param signer keyring of signer * @param collectionId ID of collection @@ -947,7 +947,7 @@ class CollectionGroup extends HelperGroup { /** * - * Destroys a concrete instance of NFT. + * Destroys a concrete instance of NFT/RFT or burns a specified amount of fungible tokens. * * @param signer keyring of signer * @param collectionId ID of collection @@ -1018,7 +1018,7 @@ class CollectionGroup extends HelperGroup { } /** - * Get amount of RFT pieces approved to transfer + * Get the amount of token pieces approved to transfer * @param collectionId ID of collection * @param tokenId ID of token * @param toAccountObj @@ -1498,7 +1498,7 @@ class RFTGroup extends NFTnRFT { * Get collection object * @param collectionId ID of collection * @example getCollectionObject(2); - * @returns instance of UniqueNFTCollection + * @returns instance of UniqueRFTCollection */ getCollectionObject(collectionId: number): UniqueRFTCollection { return new UniqueRFTCollection(collectionId, this.helper); @@ -1718,7 +1718,7 @@ class FTGroup extends CollectionGroup { * Get collection object * @param collectionId ID of collection * @example getCollectionObject(2); - * @returns instance of UniqueNFTCollection + * @returns instance of UniqueFTCollection */ getCollectionObject(collectionId: number): UniqueFTCollection { return new UniqueFTCollection(collectionId, this.helper); @@ -1777,17 +1777,6 @@ class FTGroup extends CollectionGroup { return this.helper.util.findCollectionInEvents(creationResult.result.events, collectionId, 'common', 'ItemCreated', label); } - /** - * Mint multiple RFT tokens with one owner - * @param signer keyring of signer - * @param collectionId ID of collection - * @param owner tokens owner - * @param tokens array of tokens with properties and pieces - * @param label - * @example mintMultipleTokensWithOneOwner(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, [{pieces: 100000n, properties: [{key: "gender", value: "male"}]}]); - * @returns array of newly created RFT tokens - */ - /** * Mint multiple Fungible tokens with one owner * @param signer keyring of signer @@ -1813,7 +1802,7 @@ class FTGroup extends CollectionGroup { } /** - * Get top 10 token owners + * Get the top 10 owners with the largest balance for the Fungible collection * @param collectionId ID of collection * @example getTop10Owners(10); * @returns array of ```ICrossAccountId``` @@ -1888,7 +1877,7 @@ class FTGroup extends CollectionGroup { } /** - * + * Get total collection supply * @param collectionId * @returns */ @@ -1973,6 +1962,11 @@ class ChainGroup extends HelperGroup { class BalanceGroup extends HelperGroup { + /** + * Representation of the native token in the smallest unit + * @example getOneTokenNominal() + * @returns ```BigInt``` representation of the native token in the smallest unit, e.g. ```1_000_000_000_000_000_000n``` for QTZ. + */ getOneTokenNominal(): bigint { const chainProperties = this.helper.chain.getChainProperties(); return 10n ** BigInt((chainProperties.tokenDecimals || [18])[0]); @@ -2028,6 +2022,13 @@ class BalanceGroup extends HelperGroup { class AddressGroup extends HelperGroup { + /** + * Normalizes the address to the specified ss58 format, by default ```42```. + * @param address substrate address + * @param ss58Format format for address conversion, by default ```42``` + * @example normalizeSubstrate("unjKJQJrRd238pkUZZvzDQrfKuM39zBSnQ5zjAGAGcdRhaJTx") // returns 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + * @returns substrate address converted to normalized (i.e., starting with 5) or specified explicitly representation + */ normalizeSubstrate(address: TSubstrateAccount, ss58Format = 42): TSubstrateAccount { return this.helper.util.normalizeSubstrateAddress(address, ss58Format); } From dcc6bc09512b46db65f6ea5da523db5da6cc9c64 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 11 Aug 2022 21:44:41 +0300 Subject: [PATCH 0338/1274] test: regenerate yarn lock Signed-off-by: Yaroslav Bolyukin --- tests/yarn.lock | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tests/yarn.lock b/tests/yarn.lock index f28b0c2cef..3b1e1ecb22 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -970,13 +970,6 @@ dependencies: "@types/chai" "*" -"@types/chai-things@^0.0.35": - version "0.0.35" - resolved "https://registry.yarnpkg.com/@types/chai-things/-/chai-things-0.0.35.tgz#4b5d9ec032067faa62b3bf7bb40dc0bec941945f" - integrity sha512-BC8FwMf9FHj87XT4dgTwbdb8dNRilGqYWGmwLPdJ54YNk6K2PlcFTt68NGHjgPDnms8zIYcOtmPePd0mPNTo/Q== - dependencies: - "@types/chai" "*" - "@types/chai@*", "@types/chai@^4.3.1": version "4.3.1" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.1.tgz#e2c6e73e0bdeb2521d00756d099218e9f5d90a04" @@ -1564,11 +1557,6 @@ chai-like@^1.1.1: resolved "https://registry.yarnpkg.com/chai-like/-/chai-like-1.1.1.tgz#8c558a414c34514e814d497c772547ceb7958f64" integrity sha512-VKa9z/SnhXhkT1zIjtPACFWSoWsqVoaz1Vg+ecrKo5DCKVlgL30F/pEyEvXPBOVwCgLZcWUleCM/C1okaKdTTA== -chai-things@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/chai-things/-/chai-things-0.2.0.tgz#c55128378f9bb399e994f00052151984ed6ebe70" - integrity sha512-6ns0SU21xdRCoEXVKH3HGbwnsgfVMXQ+sU5V8PI9rfxaITos8lss1vUxbF1FAcJKjfqmmmLVlr/z3sLes00w+A== - chai@^4.3.6: version "4.3.6" resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.6.tgz#ffe4ba2d9fa9d6680cc0b370adae709ec9011e9c" From df2a95f5a75330e8203f5895c7a704f2f10128c1 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 11 Aug 2022 23:51:22 +0300 Subject: [PATCH 0339/1274] Bash script has been updated. --- .github/workflows/forkless-update-nodata.yml | 51 ++++++++++++-------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 1b2a2f951c..57c68ef362 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -20,7 +20,7 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - forkless-upgrade-nodata: + forkless-update-nodata: # The type of runner that the job will run on runs-on: self-hosted-ci @@ -31,9 +31,11 @@ jobs: strategy: matrix: include: -# - network: "Opal" -# features: " " -# binary_version: + - network: "Opal" + features: "opal-runtime" + runtime: "opal" + mainnet_branch: v924010 + mainnet_tag: v924010 - network: "Quartz" # KUSAMA_MAINNET_BRANCH для quartz-runtime features: "quartz-runtime" runtime: "quartz" @@ -112,49 +114,56 @@ jobs: - name: Build the stack run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 -# - name: Wait for 5m before starting tests docker logs for " RUNTIME UPGRADE TESTING " criteria -# if: success() -# run: sleep 300s - name: Check if docker logs consist logs related to Runtime Upgrade testing. if: success() run: | + counter=160 function do_docker_logs { - DOCKER_LOGS=$(docker logs --details node-parachain 2>&1) + docker logs --details node-parachain 2>&1 } function is_started { - if [[ ${DOCKER_LOGS} = *"RUNTIME UPGRADE TESTING"* ]];then - echo "Function is_started: Return 0" - return 0 - fi - echo "Function is_started: Return 1" - return 1 + echo "Check Docker logs" + DOCKER_LOGS=$(do_docker_logs) + if [[ ${DOCKER_LOGS} = *"RUNTIME UPGRADE TESTING"* ]];then + echo "Function is_started: Return 0" + return 0 + fi + echo "Function is_started: Return 1" + return 1 } while ! is_started; do - echo "Waiting for "RUNTIME UPGRADE TESTING" in container logs" - sleep 15s + echo "Waiting for "RUNTIME UPGRADE TESTING" in container logs" + sleep 15s + counter=$(( $counter - 1 )) + echo "Counter: $counter" + if [ "$counter" -gt "0" ]; then + continue + else + break + fi done echo "Test completed." - exit 0 + exit 1 shell: bash - name: Collect Docker Logs if: success() || failure() uses: jwalton/gh-docker-logs@v2.2.0 with: - dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}' + dest: './forkless-parachain-update-nodata-logs.${{ matrix.features }}' images: 'node-parachain' - name: Tar logs if: success() || failure() - run: tar cvzf ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }} + run: tar cvzf ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz ./forkless-parachain-update-nodata-logs.${{ matrix.features }} - name: Upload logs to GitHub if: success() || failure() uses: actions/upload-artifact@master with: - name: forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz - path: ./forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.tgz + name: forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz + path: ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz - name: Stop running containers if: always() # run this step always From a85410a0f413054911c398c9df6178ccfdba7c12 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 11 Aug 2022 23:54:49 +0300 Subject: [PATCH 0340/1274] Enable continue-on-errors. --- .github/workflows/forkless-update-nodata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 57c68ef362..83d891b150 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -26,7 +26,7 @@ jobs: name: Build Container, Spin it Up an test - continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: From 9ce5f25bdda0a72a9e24bfee8e88c45d8551c599 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 12 Aug 2022 00:46:06 +0300 Subject: [PATCH 0341/1274] Timings tunning. --- .github/workflows/forkless-update-nodata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 83d891b150..d6edd4f2e5 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -134,7 +134,7 @@ jobs: } while ! is_started; do echo "Waiting for "RUNTIME UPGRADE TESTING" in container logs" - sleep 15s + sleep 30s counter=$(( $counter - 1 )) echo "Counter: $counter" if [ "$counter" -gt "0" ]; then From 9f934867f3c4b0bc66ec5a3d9f7b4da67f66557a Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Fri, 12 Aug 2022 05:53:04 +0000 Subject: [PATCH 0342/1274] add Apache-2.0 license identifier --- tests/src/util/playgrounds/index.ts | 3 +++ tests/src/util/playgrounds/unique.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index dbaa217414..621d1c1800 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -1,3 +1,6 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// SPDX-License-Identifier: Apache-2.0 + import {IKeyringPair} from '@polkadot/types/types'; import {UniqueHelper} from './unique'; import config from '../../config'; diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index f9811b0ff6..24981c7a28 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -1,3 +1,6 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// SPDX-License-Identifier: Apache-2.0 + /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable function-call-argument-newline */ /* eslint-disable no-prototype-builtins */ From 4972f378018419d53acb3504ea729ae56f160c91 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 12 Aug 2022 09:41:14 +0300 Subject: [PATCH 0343/1274] Additional log collection on docker build failure has been added. --- .github/workflows/forkless-update-nodata.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index d6edd4f2e5..c577ca967b 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -114,6 +114,12 @@ jobs: - name: Build the stack run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 + - name: Collect Docker Logs + if: failure() + uses: jwalton/gh-docker-logs@v2.2.0 + with: + dest: './forkless-parachain-update-nodata-logs.${{ matrix.features }}' + - name: Check if docker logs consist logs related to Runtime Upgrade testing. if: success() @@ -144,7 +150,7 @@ jobs: fi done echo "Test completed." - exit 1 + exit 0 shell: bash - name: Collect Docker Logs From 94bc7f52561d67865f1aaf7cc257c7c1c9bacaca Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 12 Aug 2022 13:36:34 +0300 Subject: [PATCH 0344/1274] Check script fix. --- .github/workflows/forkless-update-nodata.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index c577ca967b..2fb7803a16 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -114,13 +114,6 @@ jobs: - name: Build the stack run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 - - name: Collect Docker Logs - if: failure() - uses: jwalton/gh-docker-logs@v2.2.0 - with: - dest: './forkless-parachain-update-nodata-logs.${{ matrix.features }}' - - - name: Check if docker logs consist logs related to Runtime Upgrade testing. if: success() run: | @@ -131,7 +124,7 @@ jobs: function is_started { echo "Check Docker logs" DOCKER_LOGS=$(do_docker_logs) - if [[ ${DOCKER_LOGS} = *"RUNTIME UPGRADE TESTING"* ]];then + if [[ ${DOCKER_LOGS} = *"RUNTIME UPGRADE TESTING COMPLETE"* ]];then echo "Function is_started: Return 0" return 0 fi @@ -150,7 +143,7 @@ jobs: fi done echo "Test completed." - exit 0 + exit 1 shell: bash - name: Collect Docker Logs From b1ec0e65b01212a43061496a1f87787b51f85647 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 12 Aug 2022 14:03:56 +0300 Subject: [PATCH 0345/1274] Build Args definition has been changed. Docker linting notices has been fixed. --- .docker/Dockerfile-chain-dev | 6 +++--- .docker/Dockerfile-parachain | 20 ++++++++++++-------- .docker/Dockerfile-parachain-upgrade | 11 ++++------- .docker/docker-compose.tmp.j2 | 4 ++-- .github/workflows/node_build_test.yml | 9 +++++---- 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/.docker/Dockerfile-chain-dev b/.docker/Dockerfile-chain-dev index 06a50729f8..007ece91be 100644 --- a/.docker/Dockerfile-chain-dev +++ b/.docker/Dockerfile-chain-dev @@ -10,8 +10,8 @@ ENV PATH="/cargo-home/bin:$PATH" RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none -ARG RUST_TOOLCHAIN=nightly-2022-05-11 -ARG POLKA_VERSION=release-v0.9.24 +ARG RUST_TOOLCHAIN= +ARG POLKADOT_BUILD_BRANCH= ARG BRANCH= ARG REPO_URL= ARG FEATURE= @@ -26,4 +26,4 @@ WORKDIR /dev_chain RUN cargo build --release -CMD cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external +CMD cargo run --release --features=$FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index ae67e2fa53..964d424a17 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -2,19 +2,21 @@ FROM ubuntu:20.04 as rust-builder LABEL maintainer="Unique.Network" -ARG RUST_TOOLCHAIN=nightly-2022-05-11 +ARG RUST_TOOLCHAIN= ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN ENV CARGO_HOME="/cargo-home" ENV PATH="/cargo-home/bin:$PATH" -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + RUN apt-get update && \ - apt-get install -y cmake pkg-config libssl-dev git clang && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang && \ apt-get clean && \ rm -r /var/lib/apt/lists/* +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup toolchain install $RUST_TOOLCHAIN && \ rustup default $RUST_TOOLCHAIN && \ @@ -31,23 +33,25 @@ FROM rust-builder as builder-unique ARG PROFILE=release ARG FEATURE= +ARG REPO_URL= +ARG BRANCH= RUN mkdir /unique_parachain WORKDIR /unique_parachain -RUN git clone $REPO_URL -b $BRANCH -RUN cargo build $FEATURE --$PROFILE +RUN git clone $REPO_URL -b $BRANCH && \ + cargo build --features=$FEATURE --$PROFILE # ===== BUILD POLKADOT ===== FROM rust-builder as builder-polkadot -ARG POLKA_VERSION=release-v0.9.24 -ENV POLKA_VERSION $POLKA_VERSION +ARG POLKADOT_BUILD_BRANCH= +ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH RUN mkdir /unique_parachain WORKDIR /unique_parachain -RUN git clone -b $POLKA_VERSION --depth 1 https://github.com/paritytech/polkadot.git && \ +RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ cd polkadot && \ cargo build --release diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index 94c1865573..f8a222a4a6 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -40,8 +40,8 @@ ARG REPO_URL= RUN mkdir /unique_parachain WORKDIR /unique_parachain -RUN git clone $REPO_URL -b $MAINNET_BRANCH . -RUN cargo build --features=$FEATURE --$PROFILE +RUN git clone $REPO_URL -b $MAINNET_BRANCH . && \ + cargo build --features=$FEATURE --$PROFILE # ===== BUILD target version ====== @@ -55,11 +55,8 @@ ARG REPO_URL= RUN mkdir /unique_parachain WORKDIR /unique_parachain -RUN git clone $REPO_URL -b $BRANCH . -RUN cargo build --features=$FEATURE --$PROFILE - -RUN ls -la /unique_parachain -RUN ls -la /unique_parachain/target/release/wbuild +RUN git clone $REPO_URL -b $BRANCH . && \ + cargo build --features=$FEATURE --$PROFILE # ===== BUILD POLKADOT ===== FROM rust-builder as builder-polkadot diff --git a/.docker/docker-compose.tmp.j2 b/.docker/docker-compose.tmp.j2 index 17f877c9fd..12d4775478 100644 --- a/.docker/docker-compose.tmp.j2 +++ b/.docker/docker-compose.tmp.j2 @@ -8,6 +8,6 @@ services: - "BRANCH={{ BRANCH }}" - "REPO_URL={{ REPO_URL }}" - "FEATURE={{ FEATURE }}" - - "POLKA_VERSION={{ POLKA_VERSION }}" + - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - command: cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external + command: cargo run --release --features=$FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 95ba9cace0..3060a454c5 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -16,13 +16,11 @@ on: #Define Workflow variables env: - RUST_TOOLCHAIN: nightly-2022-05-11 REPO_URL: ${{ github.server_url }}/${{ github.repository }} - POLKA_VERSION: release-v0.9.24 # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - build: + dev_build_test: # The type of runner that the job will run on runs-on: self-hosted-ci @@ -64,6 +62,9 @@ jobs: with: ref: ${{ github.head_ref }} #Checking out head commit + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 with: @@ -72,7 +73,7 @@ jobs: variables: | REPO_URL=${{ github.server_url }}/${{ github.repository }}.git RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKA_VERSION=${{ env.POLKA_VERSION }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} FEATURE='${{ matrix.features }}' BRANCH=${{ github.head_ref }} From 909792523ad1700e2e03f823165ff90c1cb43fb2 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 12 Aug 2022 11:46:03 +0000 Subject: [PATCH 0346/1274] fix(evm-coder-substrate-pallet): add error when non existing function is called on collection contract --- Cargo.lock | 2 +- pallets/evm-coder-substrate/CHANGELOG.md | 12 +++ pallets/evm-coder-substrate/Cargo.toml | 2 +- pallets/evm-coder-substrate/src/lib.rs | 2 +- tests/src/evmCoder.test.ts | 110 +++++++++++++++++++++++ 5 files changed, 125 insertions(+), 3 deletions(-) create mode 100644 pallets/evm-coder-substrate/CHANGELOG.md create mode 100644 tests/src/evmCoder.test.ts diff --git a/Cargo.lock b/Cargo.lock index db7c30725d..d133ea5857 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5871,7 +5871,7 @@ dependencies = [ [[package]] name = "pallet-evm-coder-substrate" -version = "0.1.1" +version = "0.1.2" dependencies = [ "ethereum", "evm-coder", diff --git a/pallets/evm-coder-substrate/CHANGELOG.md b/pallets/evm-coder-substrate/CHANGELOG.md new file mode 100644 index 0000000000..ec2a0a96ef --- /dev/null +++ b/pallets/evm-coder-substrate/CHANGELOG.md @@ -0,0 +1,12 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +## [0.1.2] - 2022-08-12 + +### Fixed + + - Issue with error not being thrown when non existing function is called on collection contract + + + \ No newline at end of file diff --git a/pallets/evm-coder-substrate/Cargo.toml b/pallets/evm-coder-substrate/Cargo.toml index 4d899c67ba..bd8976da6a 100644 --- a/pallets/evm-coder-substrate/Cargo.toml +++ b/pallets/evm-coder-substrate/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-evm-coder-substrate" -version = "0.1.1" +version = "0.1.2" license = "GPLv3" edition = "2021" diff --git a/pallets/evm-coder-substrate/src/lib.rs b/pallets/evm-coder-substrate/src/lib.rs index ca4cec60f5..edb86af38b 100644 --- a/pallets/evm-coder-substrate/src/lib.rs +++ b/pallets/evm-coder-substrate/src/lib.rs @@ -261,7 +261,7 @@ fn call_internal< let (selector, mut reader) = AbiReader::new_call(input)?; let call = C::parse(selector, &mut reader)?; if call.is_none() { - return Ok(None); + return Err("Function not found".into()); } let call = call.unwrap(); diff --git a/tests/src/evmCoder.test.ts b/tests/src/evmCoder.test.ts new file mode 100644 index 0000000000..69f03054ab --- /dev/null +++ b/tests/src/evmCoder.test.ts @@ -0,0 +1,110 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import Web3 from 'web3'; +import {createEthAccountWithBalance, createRefungibleCollection, GAS_ARGS, itWeb3} from './eth/util/helpers'; +import * as solc from 'solc'; + +import chai from 'chai'; +const expect = chai.expect; + +async function compileTestContract(collectionAddress: string, contractAddress: string) { + const input = { + language: 'Solidity', + sources: { + ['Test.sol']: { + content: + ` + // SPDX-License-Identifier: MIT + pragma solidity ^0.8.0; + interface ITest { + function ztestzzzzzzz() external returns (uint256 n); + } + contract Test { + event Result(bool, uint256); + function test1() public { + try + ITest(${collectionAddress}).ztestzzzzzzz() + returns (uint256 n) { + // enters + emit Result(true, n); // => [true, BigNumber { value: "43648854190028290368124427828690944273759144372138548774646036134290060795932" }] + } catch { + emit Result(false, 0); + } + } + function test2() public { + try + ITest(${contractAddress}).ztestzzzzzzz() + returns (uint256 n) { + emit Result(true, n); + } catch { + // enters + emit Result(false, 0); // => [ false, BigNumber { value: "0" } ] + } + } + } + `, + }, + }, + settings: { + outputSelection: { + '*': { + '*': ['*'], + }, + }, + }, + }; + const json = JSON.parse(solc.compile(JSON.stringify(input))); + const out = json.contracts['Test.sol']['Test']; + + return { + abi: out.abi, + object: '0x' + out.evm.bytecode.object, + }; +} + +async function deployTestContract(web3: Web3, owner: string, collectionAddress: string, contractAddress: string) { + const compiled = await compileTestContract(collectionAddress, contractAddress); + const fractionalizerContract = new web3.eth.Contract(compiled.abi, undefined, { + data: compiled.object, + from: owner, + ...GAS_ARGS, + }); + return await fractionalizerContract.deploy({data: compiled.object}).send({from: owner}); +} + +describe('Evm Coder tests', () => { + itWeb3('Call non-existing function', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner); + const contract = await deployTestContract(web3, owner, collectionIdAddress, '0x1bfed5D614b886b9Ab2eA4CBAc22A96B7EC29c9c'); + const testContract = await deployTestContract(web3, owner, collectionIdAddress, contract.options.address); + { + const result = await testContract.methods.test1().send(); + expect(result.events.Result.returnValues).to.deep.equal({ + '0': false, + '1': '0', + }); + } + { + const result = await testContract.methods.test2().send(); + expect(result.events.Result.returnValues).to.deep.equal({ + '0': false, + '1': '0', + }); + } + }); +}); \ No newline at end of file From e6258963f0533c702a35ab205ca494f54876162a Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 12 Aug 2022 12:21:20 +0000 Subject: [PATCH 0347/1274] chore: add selector to error message --- pallets/evm-coder-substrate/src/lib.rs | 3 +- tests/src/evmCoder.test.ts | 51 +++++++++++++++----------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/pallets/evm-coder-substrate/src/lib.rs b/pallets/evm-coder-substrate/src/lib.rs index edb86af38b..1c57d85ea2 100644 --- a/pallets/evm-coder-substrate/src/lib.rs +++ b/pallets/evm-coder-substrate/src/lib.rs @@ -261,7 +261,8 @@ fn call_internal< let (selector, mut reader) = AbiReader::new_call(input)?; let call = C::parse(selector, &mut reader)?; if call.is_none() { - return Err("Function not found".into()); + let selector = u32::from_be_bytes(selector); + return Err(format!("unrecognized selector: 0x{selector:0<8x}").into()); } let call = call.unwrap(); diff --git a/tests/src/evmCoder.test.ts b/tests/src/evmCoder.test.ts index 69f03054ab..d34748363e 100644 --- a/tests/src/evmCoder.test.ts +++ b/tests/src/evmCoder.test.ts @@ -31,30 +31,33 @@ async function compileTestContract(collectionAddress: string, contractAddress: s // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface ITest { - function ztestzzzzzzz() external returns (uint256 n); + function ztestzzzzzzz() external returns (uint256 n); } contract Test { - event Result(bool, uint256); - function test1() public { - try - ITest(${collectionAddress}).ztestzzzzzzz() - returns (uint256 n) { - // enters - emit Result(true, n); // => [true, BigNumber { value: "43648854190028290368124427828690944273759144372138548774646036134290060795932" }] - } catch { - emit Result(false, 0); - } - } - function test2() public { - try - ITest(${contractAddress}).ztestzzzzzzz() - returns (uint256 n) { - emit Result(true, n); - } catch { - // enters - emit Result(false, 0); // => [ false, BigNumber { value: "0" } ] - } - } + event Result(bool, uint256); + function test1() public { + try + ITest(${collectionAddress}).ztestzzzzzzz() + returns (uint256 n) { + // enters + emit Result(true, n); // => [true, BigNumber { value: "43648854190028290368124427828690944273759144372138548774646036134290060795932" }] + } catch { + emit Result(false, 0); + } + } + function test2() public { + try + ITest(${contractAddress}).ztestzzzzzzz() + returns (uint256 n) { + emit Result(true, n); + } catch { + // enters + emit Result(false, 0); // => [ false, BigNumber { value: "0" } ] + } + } + function test3() public { + ITest(${collectionAddress}).ztestzzzzzzz(); + } } `, }, @@ -106,5 +109,9 @@ describe('Evm Coder tests', () => { '1': '0', }); } + { + await expect(testContract.methods.test3().call()) + .to.be.rejectedWith(/unrecognized selector: 0xd9f02b36$/g); + } }); }); \ No newline at end of file From 79a270aa7ee99bc4a85a0ca24f82b14d7c1cb330 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Fri, 12 Aug 2022 19:25:02 +0700 Subject: [PATCH 0348/1274] fix: serde rpc Fixed method signature `total_pieces`. Before that the number of pieces greater than 2^53 -1 caused an error when calling this method. --- Cargo.lock | 2 +- client/rpc/CHANGELOG.md | 11 ++++++++--- client/rpc/Cargo.toml | 2 +- client/rpc/src/lib.rs | 4 ++-- pallets/common/src/lib.rs | 2 +- tests/CHANGELOG.md | 13 +++++++++---- tests/src/refungible.test.ts | 19 ++++++++++++++++++- 7 files changed, 40 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index db7c30725d..a838764134 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12379,7 +12379,7 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "uc-rpc" -version = "0.1.1" +version = "0.1.2" dependencies = [ "anyhow", "jsonrpsee", diff --git a/client/rpc/CHANGELOG.md b/client/rpc/CHANGELOG.md index 155e7fe7fb..b423fc0e6a 100644 --- a/client/rpc/CHANGELOG.md +++ b/client/rpc/CHANGELOG.md @@ -2,10 +2,15 @@ All notable changes to this project will be documented in this file. +## [0.1.2] - 2022-08-12 + +### Fixed + +- Method signature `total_pieces`. Before that the number of pieces greater than 2^53 -1 caused an error when calling this method. + ## [0.1.1] - 2022-07-14 ### Added - - Implementation of RPC method `token_owners` returning 10 owners in no particular order. - This was an internal request to improve the web interface and support fractionalization event. - \ No newline at end of file +- Implementation of RPC method `token_owners` returning 10 owners in no particular order. + This was an internal request to improve the web interface and support fractionalization event. diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index 9cefa070fd..069b73bc2e 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uc-rpc" -version = "0.1.1" +version = "0.1.2" license = "GPLv3" edition = "2021" diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index fbe52d7bc6..9d91bdd528 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -242,7 +242,7 @@ pub trait UniqueApi { collection_id: CollectionId, token_id: TokenId, at: Option, - ) -> Result>; + ) -> Result>; } mod rmrk_unique_rpc { @@ -518,7 +518,7 @@ where pass_method!(collection_stats() -> CollectionStats, unique_api); pass_method!(next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Option, unique_api); pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option, unique_api); - pass_method!(total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option, unique_api); + pass_method!(total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option => |o| o.map(|number| number.to_string()) , unique_api); pass_method!(token_owners(collection: CollectionId, token: TokenId) -> Vec, unique_api); } diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 728760aa46..e8851a59c4 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -536,7 +536,7 @@ pub mod pallet { /// Can't transfer tokens to ethereum zero address AddressIsZero, - /// The oprtation is not supported + /// The operation is not supported UnsupportedOperation, /// Insufficient funds to perform an action diff --git a/tests/CHANGELOG.md b/tests/CHANGELOG.md index ac3fec048e..650629cdec 100644 --- a/tests/CHANGELOG.md +++ b/tests/CHANGELOG.md @@ -2,10 +2,15 @@ All notable changes to this project will be documented in this file. +## 2022-08-12 + +### Added + +- In integration tests for `RFT` added check of work with the maximum allowable number of pieces (MAX_REFUNGIBLE_PIECES). + ## 2022-07-14 ### Added - - Integrintegration tests of RPC method `token_owners`. - - Integrintegration tests of Fungible Pallet. - - \ No newline at end of file + +- Integrintegration tests of RPC method `token_owners`. +- Integrintegration tests of Fungible Pallet. diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 9f36d0432f..0a79499bd9 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -16,7 +16,7 @@ import {IKeyringPair} from '@polkadot/types/types'; -import { usingPlaygrounds } from './util/playgrounds'; +import {usingPlaygrounds} from './util/playgrounds'; import { getModuleNames, Pallets, @@ -30,6 +30,7 @@ const expect = chai.expect; let alice: IKeyringPair; let bob: IKeyringPair; +const MAX_REFUNGIBLE_PIECES = 1_000_000_000_000_000_000_000n; describe('integration test: Refungible functionality:', async () => { before(async function() { @@ -58,6 +59,22 @@ describe('integration test: Refungible functionality:', async () => { }); }); + it('Checking RPC methods when interacting with maximum allowed values (MAX_REFUNGIBLE_PIECES)', async () => { + await usingPlaygrounds(async helper => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + + const token = await collection.mintToken(alice, {Substrate: alice.address}, MAX_REFUNGIBLE_PIECES); + + expect(await collection.getTokenBalance(token.tokenId, {Substrate: alice.address})).to.be.equal(MAX_REFUNGIBLE_PIECES); + + await collection.transferToken(alice, token.tokenId, {Substrate: bob.address}, MAX_REFUNGIBLE_PIECES); + expect(await collection.getTokenBalance(token.tokenId, {Substrate: bob.address})).to.be.equal(MAX_REFUNGIBLE_PIECES); + expect(await token.getTotalPieces()).to.be.equal(MAX_REFUNGIBLE_PIECES); + + await expect(collection.mintToken(alice, {Substrate: alice.address}, MAX_REFUNGIBLE_PIECES + 1n)).to.eventually.be.rejected; + }); + }); + it('RPC method tokenOnewrs for refungible collection and token', async () => { await usingPlaygrounds(async (helper, privateKey) => { const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; From 593e55c0dc5228dab0cfdb5c5217aec1beb32013 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 12 Aug 2022 15:29:35 +0300 Subject: [PATCH 0349/1274] Prepare execution matrix as pre-requisite. --- .github/workflows/forkless-update-nodata.yml | 67 +++++++++++++++----- 1 file changed, 51 insertions(+), 16 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 2fb7803a16..57ce6880b5 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -20,7 +20,41 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: + + prepare-execution-marix: + + name: Prepare execution matrix + + runs-on: self-hosted-ci + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: fabiocaccamo/create-matrix-action@v2 + id: create_matrix + uses: ./ + with: + matrix: | + network {Opal}, runtime {opal}, feature {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {Quartz}, runtime {quartz}, feature {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {Unique}, runtime {unique}, feature {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} + + + forkless-update-nodata: + needs: prepare-execution-marix # The type of runner that the job will run on runs-on: self-hosted-ci @@ -30,22 +64,23 @@ jobs: strategy: matrix: - include: - - network: "Opal" - features: "opal-runtime" - runtime: "opal" - mainnet_branch: v924010 - mainnet_tag: v924010 - - network: "Quartz" # KUSAMA_MAINNET_BRANCH для quartz-runtime - features: "quartz-runtime" - runtime: "quartz" - mainnet_branch: quartz-v924012-2 - mainnet_tag: v924012 - - network: "Unique" # POLKADOT_MAINNET_BRANCH для unique-runtime - features: "unique-runtime" - runtime: "unique" - mainnet_branch: v924010 - mainnet_tag: v924010 + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} +# include: +# - network: "Opal" +# features: "opal-runtime" +# runtime: "opal" +# mainnet_branch: v924010 +# mainnet_tag: v924010 +# - network: "Quartz" # KUSAMA_MAINNET_BRANCH для quartz-runtime +# features: "quartz-runtime" +# runtime: "quartz" +# mainnet_branch: quartz-v924012-2 +# mainnet_tag: v924012 +# - network: "Unique" # POLKADOT_MAINNET_BRANCH для unique-runtime +# features: "unique-runtime" +# runtime: "unique" +# mainnet_branch: v924010 +# mainnet_tag: v924010 From 36d67b09bd287a1a0fa54d1ad3ef23da27b63ebc Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 12 Aug 2022 16:14:05 +0300 Subject: [PATCH 0350/1274] fix: remove duplicated "uses" --- .github/workflows/forkless-update-nodata.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 57ce6880b5..2ea388842c 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -44,7 +44,6 @@ jobs: - name: Create Execution matrix uses: fabiocaccamo/create-matrix-action@v2 id: create_matrix - uses: ./ with: matrix: | network {Opal}, runtime {opal}, feature {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} From b8e6595a4e84e1d25c7a5aca202194e98ad43faf Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Sun, 14 Aug 2022 16:01:10 +0300 Subject: [PATCH 0351/1274] fix typo. --- .github/workflows/forkless-update-nodata.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 2ea388842c..259fb5a42e 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -46,9 +46,9 @@ jobs: id: create_matrix with: matrix: | - network {Opal}, runtime {opal}, feature {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} - network {Quartz}, runtime {quartz}, feature {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} - network {Unique}, runtime {unique}, feature {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} + network {Opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {Quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {Unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} From 874e5a304c5094e5c72e3932cd648e8079e048d0 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Sun, 14 Aug 2022 16:16:26 +0300 Subject: [PATCH 0352/1274] Specified correct tag name --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 5c6a03a0df..b7d82b4e36 100644 --- a/.env +++ b/.env @@ -5,4 +5,4 @@ POLKADOT_MAINNET_BRANCH=release-v0.9.25 UNIQUE_MAINNET_TAG=v924010 KUSAMA_MAINNET_BRANCH=release-v0.9.26 -QUARTZ_MAINNET_TAG=v924012 \ No newline at end of file +QUARTZ_MAINNET_TAG=quartz-v924012-2 From 117e5fa94e89656d7f08f0e5a5f7625e0e6260ec Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Sun, 14 Aug 2022 20:07:06 +0300 Subject: [PATCH 0353/1274] Test script has been updated. --- .github/workflows/forkless-update-nodata.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 259fb5a42e..ade47d1b6f 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -158,15 +158,16 @@ jobs: function is_started { echo "Check Docker logs" DOCKER_LOGS=$(do_docker_logs) - if [[ ${DOCKER_LOGS} = *"RUNTIME UPGRADE TESTING COMPLETE"* ]];then - echo "Function is_started: Return 0" + if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then + echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" return 0 + exit 0 fi echo "Function is_started: Return 1" return 1 } while ! is_started; do - echo "Waiting for "RUNTIME UPGRADE TESTING" in container logs" + echo "Waiting for message "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" in container logs" sleep 30s counter=$(( $counter - 1 )) echo "Counter: $counter" @@ -176,7 +177,6 @@ jobs: break fi done - echo "Test completed." exit 1 shell: bash @@ -198,6 +198,6 @@ jobs: name: forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz path: ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down +# - name: Stop running containers +# if: always() # run this step always +# run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From 5b56475ba5291ac2fd5c1386b1b5738820d8c9d0 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Sun, 14 Aug 2022 20:13:54 +0300 Subject: [PATCH 0354/1274] Changed message --- .github/workflows/forkless-update-nodata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index ade47d1b6f..ae29a8e383 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -167,7 +167,7 @@ jobs: return 1 } while ! is_started; do - echo "Waiting for message "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" in container logs" + echo "Waiting for special message in log files " sleep 30s counter=$(( $counter - 1 )) echo "Counter: $counter" From c6aaa88ca965a88bd71fdc0bd61ac0cf9c4e8e47 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 15 Aug 2022 04:01:00 +0700 Subject: [PATCH 0355/1274] add CI for update parachain & relay with forking data --- .../forking/Dockerfile-parachain-live-fork | 126 +++++++++++ .docker/forking/docker-compose-fork.yaml | 28 +++ .docker/forking/docker-compose.tmp-fork.j2 | 14 ++ .docker/forking/fork.jsonnet | 59 +++++ .docker/forking/launch-config-fork.j2 | 132 ++++++++++++ .dockerignore | 1 - .env | 2 +- .github/workflows/fork-update-withdata.yml | 203 ++++++++++++++++++ 8 files changed, 563 insertions(+), 2 deletions(-) create mode 100644 .docker/forking/Dockerfile-parachain-live-fork create mode 100644 .docker/forking/docker-compose-fork.yaml create mode 100644 .docker/forking/docker-compose.tmp-fork.j2 create mode 100644 .docker/forking/fork.jsonnet create mode 100644 .docker/forking/launch-config-fork.j2 create mode 100644 .github/workflows/fork-update-withdata.yml diff --git a/.docker/forking/Dockerfile-parachain-live-fork b/.docker/forking/Dockerfile-parachain-live-fork new file mode 100644 index 0000000000..b1fedd8807 --- /dev/null +++ b/.docker/forking/Dockerfile-parachain-live-fork @@ -0,0 +1,126 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ARG RUST_TOOLCHAIN= + +ARG UNIQUE_BRANCH=develop + +ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN +ENV UNIQUE_BRANCH $UNIQUE_BRANCH + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install $RUST_TOOLCHAIN && \ + rustup default $RUST_TOOLCHAIN && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN + +# ===== BUILD current version ====== +FROM rust-builder as builder-unique-current + +ARG PROFILE=release +ARG FEATURE= +ARG MAINNET_BRANCH= +ARG REPO_URL= + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +RUN git clone $REPO_URL -b $MAINNET_BRANCH . && \ + cargo build --features=$FEATURE --$PROFILE + + +# ===== BUILD target version ====== +FROM rust-builder as builder-unique-target + +ARG PROFILE=release +ARG FEATURE= +ARG BRANCH= +ARG REPO_URL= + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +RUN git clone $REPO_URL -b $BRANCH . && \ + cargo build --features=$FEATURE --$PROFILE + +# ===== BUILD POLKADOT ===== +FROM rust-builder as builder-polkadot + +ARG POLKADOT_BUILD_BRANCH= +ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ + cd polkadot && \ + cargo build --release + +# ===== BUILD CHAINQL ===== +FROM rust-builder as builder-chainql + +RUN mkdir chainql +WORKDIR /chainql + +RUN git clone --depth 1 https://github.com/CertainLach/chainql.git . && \ + cargo build --release + +# ===== RUN ====== + +FROM ubuntu:20.04 + +ARG RUNTIME= +ENV RUNTIME $RUNTIME + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/parachain-forking + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn + +RUN echo "$RUNTIME" + +COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ +COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm + +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm + +COPY --from=builder-chainql /chainql/target/release/chainql /chainql/target/release/ + +ARG FORK_FROM=wss://eu-ws-quartz.unique.network:443 +ENV FORK_FROM=$FORK_FROM +CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" FORK_FROM && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start launch-config.json --test-upgrade-parachains + + + + + diff --git a/.docker/forking/docker-compose-fork.yaml b/.docker/forking/docker-compose-fork.yaml new file mode 100644 index 0000000000..c3d9414146 --- /dev/null +++ b/.docker/forking/docker-compose-fork.yaml @@ -0,0 +1,28 @@ +version: "3.5" + +services: + parachain-fork: + build: + context: ../ + dockerfile: .docker/forking/Dockerfile-parachain-live-fork + image: parachain-fork + container_name: parachain-fork + volumes: + - type: bind + source: ./launch-config-fork.json + target: /polkadot-launch/launch-config.json + read_only: true + - type: bind + source: ./fork.jsonnet + target: /polkadot-launch/fork.jsonnet + read_only: true + expose: + - 9944 + - 9933 + ports: + - 127.0.0.1:9944:9944 + - 127.0.0.1:9933:9933 + logging: + options: + max-size: "1m" + max-file: "3" diff --git a/.docker/forking/docker-compose.tmp-fork.j2 b/.docker/forking/docker-compose.tmp-fork.j2 new file mode 100644 index 0000000000..02a2b0cc77 --- /dev/null +++ b/.docker/forking/docker-compose.tmp-fork.j2 @@ -0,0 +1,14 @@ +version: "3.5" + +services: + parachain-fork: + build: + args: + - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" + - "BRANCH={{ BRANCH }}" + - "REPO_URL={{ REPO_URL }}" + - "FEATURE={{ FEATURE }}" + - "RUNTIME={{ RUNTIME }}" + - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" + - "MAINNET_TAG={{ MAINNET_TAG }}" + - "MAINNET_BRANCH={{ MAINNET_BRANCH }}" diff --git a/.docker/forking/fork.jsonnet b/.docker/forking/fork.jsonnet new file mode 100644 index 0000000000..affdc16067 --- /dev/null +++ b/.docker/forking/fork.jsonnet @@ -0,0 +1,59 @@ + +function(rawSpec, forkFrom) +local sourceChain = cql.chain(forkFrom).latest; + +local raw = local sourceRaw = sourceChain._raw._preloadKeys; { + [key]: cql.toHex(sourceRaw[key]) + for key in std.objectFields(sourceRaw) + if sourceRaw[key] != null +}; + +local +auraKeys = [ + // AuraExt.Authorities, we don't have aura pallet enabled for some reason, to refer using cql api + '0x3c311d57d4daf52904616cf69648081e5e0621c4869aa60c02be9adcc98a0d1d', + // Aura.Authorities + '0x57f8dc2f5ab09467896f47300f0424385e0621c4869aa60c02be9adcc98a0d1d', +], + +// Keys, which should be migrated from passed spec, rather than from forked chain +wantedKeys = [ + sourceChain.ParachainInfo._key.ParachainId, + sourceChain.Sudo._key.Key, + sourceChain.System.BlockHash._key['0'], + sourceChain.System._key.ParentHash, +] + auraKeys, + +// Keys to remove from original chain +unwantedPrefixes = [ + // Aura.CurrentSlot + '0x57f8dc2f5ab09467896f47300f04243806155b3cd9a8c9e5e9a23fd5dc13a5ed', + // Ensure there will be no panics caused by unexpected kept state + sourceChain.ParachainSystem._key.ValidationData, + sourceChain.ParachainSystem._key.RelayStateProof, + sourceChain.ParachainSystem._key.HostConfiguration, + sourceChain.ParachainSystem._key.LastDmqMqcHead, + // Part of head + sourceChain.System._key.BlockHash, + sourceChain.System._key.Number, + sourceChain.System._key.Digest, +] + auraKeys, + +cleanupRaw(raw) = { + [key]: raw[key] + for key in std.objectFields(raw) + if std.all(std.map(function(prefix) !std.startsWith(key, prefix), unwantedPrefixes)) +}; + +local originalRaw = rawSpec.genesis.raw.top; +local outSpec = rawSpec { + genesis+: { + raw+: { + top: cleanupRaw(raw) { + [key]: originalRaw[key] + for key in wantedKeys + }, + }, + }, +}; +outSpec diff --git a/.docker/forking/launch-config-fork.j2 b/.docker/forking/launch-config-fork.j2 new file mode 100644 index 0000000000..25c6ff81bc --- /dev/null +++ b/.docker/forking/launch-config-fork.j2 @@ -0,0 +1,132 @@ +{ + "relaychain": { + "bin": "/polkadot/target/release/polkadot", + "upgradeBin": "/polkadot/target/release/polkadot", + "upgradeWasm": "/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm", + "chain": "westend-local", + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "/unique-chain/current/release/unique-collator", + "upgradeBin": "/unique-chain/target/release/unique-collator", + "upgradeWasm": "/unique-chain/target/release/wbuild/{{ FEATURE }}/{{ RUNTIME }}_runtime.compact.compressed.wasm", + "id": "1000", + "balance": "1000000000000000000000000", + "chainRawInitializer": [ + "chainql", + "--ext-str=FORK_FROM", + "--tla-code=rawSpec=import '${rawSpec}'", + "--tla-code=forkFrom=std.extVar('FORK_FROM')", + "fork.jsonnet" + ], + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace" + ] + }, + { + "port": 31201, + "wsPort": 9945, + "rpcPort": 9934, + "name": "bob", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [], + "finalization": false +} diff --git a/.dockerignore b/.dockerignore index 84fb7b39ab..e1d1cd10e1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,5 @@ .git/ .github/ -.docker/ doc/ target/ tests/ diff --git a/.env b/.env index 5c6a03a0df..b7d82b4e36 100644 --- a/.env +++ b/.env @@ -5,4 +5,4 @@ POLKADOT_MAINNET_BRANCH=release-v0.9.25 UNIQUE_MAINNET_TAG=v924010 KUSAMA_MAINNET_BRANCH=release-v0.9.26 -QUARTZ_MAINNET_TAG=v924012 \ No newline at end of file +QUARTZ_MAINNET_TAG=quartz-v924012-2 diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/fork-update-withdata.yml new file mode 100644 index 0000000000..0e67c70e3c --- /dev/null +++ b/.github/workflows/fork-update-withdata.yml @@ -0,0 +1,203 @@ +name: Forkless Parachain update with no data + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: + - develop + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +#Define Workflow variables +env: + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + prepare-execution-marix-fork: + + name: Prepare execution matrix for fork + + runs-on: self-hosted-ci + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: fabiocaccamo/create-matrix-action@v2 + id: create_matrix + with: + matrix: | + network {Opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}} + network {Quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {Unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} + + + + fork-update-withdata: + needs: prepare-execution-marix-fork + # The type of runner that the job will run on + runs-on: ci-tests + + name: Build Container, Spin it Up an test + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.prepare-execution-marix-fork.outputs.matrix)}} +# include: +# - network: "Opal" +# features: "opal-runtime" +# runtime: "opal" +# mainnet_branch: v924010 +# mainnet_tag: v924010 +# - network: "Quartz" # KUSAMA_MAINNET_BRANCH для quartz-runtime +# features: "quartz-runtime" +# runtime: "quartz" +# mainnet_branch: quartz-v924012-2 +# mainnet_tag: v924012 +# - network: "Unique" # POLKADOT_MAINNET_BRANCH для unique-runtime +# features: "unique-runtime" +# runtime: "unique" +# mainnet_branch: v924010 +# mainnet_tag: v924010 + + + + steps: +# - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) +# if: github.event.pull_request.draft == true +# run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/forking/docker-compose.tmp-fork.j2 + output_file: .docker/forking/docker-compose.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }} + MAINNET_TAG=${{ matrix.mainnet_tag }} + MAINNET_BRANCH=${{ matrix.mainnet_branch }} + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + BRANCH=${{ github.head_ref }} + + - name: Show build configuration + run: cat .docker/forking/docker-compose.${{ matrix.network }}.yml + + - name: Generate launch-config-fork.json + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/forking/launch-config-fork.j2 + output_file: .docker/forking/launch-config-fork.json + variables: | + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + + - name: Show launch-config-fork configuration + run: cat .docker/forking/launch-config-fork.json + + + - name: Build the stack + run: docker-compose -f ".docker/forking/docker-compose-fork.yaml" -f ".docker/forking/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 + + - name: Check if docker logs consist logs related to Runtime Upgrade testing. + if: success() + run: | + counter=160 + function do_docker_logs { + docker logs --details parachain-fork 2>&1 + } + function is_started { + echo "Check Docker logs" + DOCKER_LOGS=$(do_docker_logs) + if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then + echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" + return 0 + exit 0 + fi + echo "Function is_started: Return 1" + return 1 + } + while ! is_started; do + echo "Waiting for special message in log files " + sleep 30s + counter=$(( $counter - 1 )) + echo "Counter: $counter" + if [ "$counter" -gt "0" ]; then + continue + else + break + fi + done + exit 1 + shell: bash + + - name: Collect Docker Logs + if: success() || failure() + uses: jwalton/gh-docker-logs@v2.2.0 + with: + dest: './fork-parachain-update-withdata-logs.${{ matrix.features }}' + images: 'parachain-fork' + + - name: Tar logs + if: success() || failure() + run: tar cvzf ./fork-parachain-update-withdata-logs.${{ matrix.features }}.tgz ./fork-parachain-update-withdata-logs.${{ matrix.features }} + + - name: Upload logs to GitHub + if: success() || failure() + uses: actions/upload-artifact@master + with: + name: fork-parachain-update-withdata-logs.${{ matrix.features }}.tgz + path: ./fork-parachain-update-withdata-logs.${{ matrix.features }}.tgz + +# - name: Stop running containers +# if: always() # run this step always +# run: docker-compose -f ".docker/forking/docker-compose-fork.yaml" -f ".docker/forking/docker-compose.${{ matrix.network }}.yml" down From 267f556b0964e9cb06b00113896d75321594833a Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 00:06:16 +0300 Subject: [PATCH 0356/1274] Added docker container state verification --- .github/workflows/forkless-update-nodata.yml | 48 ++++++++------------ 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index ae29a8e383..4bf0067a36 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -64,23 +64,6 @@ jobs: strategy: matrix: include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} -# include: -# - network: "Opal" -# features: "opal-runtime" -# runtime: "opal" -# mainnet_branch: v924010 -# mainnet_tag: v924010 -# - network: "Quartz" # KUSAMA_MAINNET_BRANCH для quartz-runtime -# features: "quartz-runtime" -# runtime: "quartz" -# mainnet_branch: quartz-v924012-2 -# mainnet_tag: v924012 -# - network: "Unique" # POLKADOT_MAINNET_BRANCH для unique-runtime -# features: "unique-runtime" -# runtime: "unique" -# mainnet_branch: v924010 -# mainnet_tag: v924010 - steps: @@ -151,21 +134,28 @@ jobs: - name: Check if docker logs consist logs related to Runtime Upgrade testing. if: success() run: | - counter=160 + counter=180 + function check_container_status { + docker inspect -f {{.State.Running}} node-parachain + } function do_docker_logs { docker logs --details node-parachain 2>&1 } function is_started { - echo "Check Docker logs" - DOCKER_LOGS=$(do_docker_logs) - if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then - echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" - return 0 - exit 0 + if [ "$(check_container_status)" == "true" ]; then + echo "Container: node-parachain RUNNING"; + echo "Check Docker logs" + DOCKER_LOGS=$(do_docker_logs) + if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then + echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" + exit 0 + fi + else + echo "Container node-parachain not RUNNING"; + exit 1 fi - echo "Function is_started: Return 1" - return 1 } + while ! is_started; do echo "Waiting for special message in log files " sleep 30s @@ -198,6 +188,6 @@ jobs: name: forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz path: ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz -# - name: Stop running containers -# if: always() # run this step always -# run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From 72d7128c59f759861d64e247d6a8f7407494072d Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 00:48:21 +0300 Subject: [PATCH 0357/1274] Verification script has been modified. --- .github/workflows/forkless-update-nodata.yml | 41 +++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 4bf0067a36..99d33b559a 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -134,7 +134,7 @@ jobs: - name: Check if docker logs consist logs related to Runtime Upgrade testing. if: success() run: | - counter=180 + counter=160 function check_container_status { docker inspect -f {{.State.Running}} node-parachain } @@ -143,31 +143,34 @@ jobs: } function is_started { if [ "$(check_container_status)" == "true" ]; then - echo "Container: node-parachain RUNNING"; - echo "Check Docker logs" - DOCKER_LOGS=$(do_docker_logs) - if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then - echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" - exit 0 - fi + echo "Container: node-parachain RUNNING"; + echo "Check Docker logs" + DOCKER_LOGS=$(do_docker_logs) + if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then + echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" + return 0 + exit 1 + fi else - echo "Container node-parachain not RUNNING"; - exit 1 + echo "Container node-parachain not RUNNING" + echo "Halting all future checks" + exit 1 fi + exit 0 } - while ! is_started; do - echo "Waiting for special message in log files " + echo "Waiting for special message in log files " sleep 30s counter=$(( $counter - 1 )) echo "Counter: $counter" if [ "$counter" -gt "0" ]; then - continue + continue else - break + break fi - done - exit 1 + done + echo "Halting script" + exit 1 shell: bash - name: Collect Docker Logs @@ -188,6 +191,6 @@ jobs: name: forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz path: ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down +# - name: Stop running containers +# if: always() # run this step always +# run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From b760e7aef2bdce0ff3c1ff185d59b2174a248a6d Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 00:56:33 +0300 Subject: [PATCH 0358/1274] Formating has been amended. --- .github/workflows/forkless-update-nodata.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 99d33b559a..d0b31dca30 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -134,14 +134,14 @@ jobs: - name: Check if docker logs consist logs related to Runtime Upgrade testing. if: success() run: | - counter=160 - function check_container_status { + counter=160 + function check_container_status { docker inspect -f {{.State.Running}} node-parachain - } - function do_docker_logs { + } + function do_docker_logs { docker logs --details node-parachain 2>&1 - } - function is_started { + } + function is_started { if [ "$(check_container_status)" == "true" ]; then echo "Container: node-parachain RUNNING"; echo "Check Docker logs" @@ -157,9 +157,9 @@ jobs: exit 1 fi exit 0 - } - while ! is_started; do - echo "Waiting for special message in log files " + } + while ! is_started; do + echo "Waiting for special message in log files " sleep 30s counter=$(( $counter - 1 )) echo "Counter: $counter" From 0d647850112d6e4e53d633a53a583243e9515952 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 01:06:03 +0300 Subject: [PATCH 0359/1274] Added else condition --- .github/workflows/forkless-update-nodata.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index d0b31dca30..3aa9c1b535 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -150,6 +150,10 @@ jobs: echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" return 0 exit 1 + else + echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸 - Not found in logs output." + return 1 + exit 1 fi else echo "Container node-parachain not RUNNING" From 6600168be99c6ebe99c2e3c363ed2bce6653385c Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 01:14:49 +0300 Subject: [PATCH 0360/1274] Enabled back cleanup after run. --- .github/workflows/forkless-update-nodata.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 3aa9c1b535..ef29a4c158 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -195,6 +195,6 @@ jobs: name: forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz path: ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz -# - name: Stop running containers -# if: always() # run this step always -# run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From 11e27ce730a8631d9c719b7b47d1031bca1230c2 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 08:28:06 +0300 Subject: [PATCH 0361/1274] Draft verification has been enabled. --- .github/workflows/forkless-update-nodata.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index ef29a4c158..2033cd31f9 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -67,7 +67,7 @@ jobs: steps: -# - name: Skip if pull request is in Draft + - name: Skip if pull request is in Draft # `if: github.event.pull_request.draft == true` should be kept here, at # the step level, rather than at the job level. The latter is not # recommended because when the PR is moved from "Draft" to "Ready to @@ -82,8 +82,8 @@ jobs: # 4. Move it to "Ready for review"; now the workflow is passing (it was # skipped) and "Check reviews" is also passing (it won't be updated # until the workflow is finished) -# if: github.event.pull_request.draft == true -# run: exit 1 + if: github.event.pull_request.draft == true + run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 From edec42acc11c077d9f62a312a11606c8c7ece2d3 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 15 Aug 2022 13:43:44 +0700 Subject: [PATCH 0362/1274] changes for fork --- .../forking/Dockerfile-parachain-live-fork | 30 ++---------------- .docker/forking/docker-compose.tmp-fork.j2 | 1 + .docker/forking/launch-config-fork.j2 | 4 --- .github/workflows/fork-update-withdata.yml | 31 +++++-------------- 4 files changed, 11 insertions(+), 55 deletions(-) diff --git a/.docker/forking/Dockerfile-parachain-live-fork b/.docker/forking/Dockerfile-parachain-live-fork index b1fedd8807..22eb081908 100644 --- a/.docker/forking/Dockerfile-parachain-live-fork +++ b/.docker/forking/Dockerfile-parachain-live-fork @@ -4,10 +4,7 @@ LABEL maintainer="Unique.Network" ARG RUST_TOOLCHAIN= -ARG UNIQUE_BRANCH=develop - ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN -ENV UNIQUE_BRANCH $UNIQUE_BRANCH ENV CARGO_HOME="/cargo-home" ENV PATH="/cargo-home/bin:$PATH" @@ -28,21 +25,6 @@ RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup show RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN -# ===== BUILD current version ====== -FROM rust-builder as builder-unique-current - -ARG PROFILE=release -ARG FEATURE= -ARG MAINNET_BRANCH= -ARG REPO_URL= - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - -RUN git clone $REPO_URL -b $MAINNET_BRANCH . && \ - cargo build --features=$FEATURE --$PROFILE - - # ===== BUILD target version ====== FROM rust-builder as builder-unique-target @@ -100,27 +82,21 @@ RUN export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ npm install --global yarn && \ - yarn + yarn install RUN echo "$RUNTIME" -COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm COPY --from=builder-chainql /chainql/target/release/chainql /chainql/target/release/ -ARG FORK_FROM=wss://eu-ws-quartz.unique.network:443 +ARG FORK_FROM= ENV FORK_FROM=$FORK_FROM CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" FORK_FROM && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ - yarn start launch-config.json --test-upgrade-parachains - - - + yarn start launch-config.json diff --git a/.docker/forking/docker-compose.tmp-fork.j2 b/.docker/forking/docker-compose.tmp-fork.j2 index 02a2b0cc77..aaa39d8537 100644 --- a/.docker/forking/docker-compose.tmp-fork.j2 +++ b/.docker/forking/docker-compose.tmp-fork.j2 @@ -12,3 +12,4 @@ services: - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - "MAINNET_TAG={{ MAINNET_TAG }}" - "MAINNET_BRANCH={{ MAINNET_BRANCH }}" + - "FORK_FROM={{ FORK_FROM }}" diff --git a/.docker/forking/launch-config-fork.j2 b/.docker/forking/launch-config-fork.j2 index 25c6ff81bc..3ea27e3a90 100644 --- a/.docker/forking/launch-config-fork.j2 +++ b/.docker/forking/launch-config-fork.j2 @@ -1,8 +1,6 @@ { "relaychain": { "bin": "/polkadot/target/release/polkadot", - "upgradeBin": "/polkadot/target/release/polkadot", - "upgradeWasm": "/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm", "chain": "westend-local", "nodes": [ { @@ -87,8 +85,6 @@ "parachains": [ { "bin": "/unique-chain/current/release/unique-collator", - "upgradeBin": "/unique-chain/target/release/unique-collator", - "upgradeWasm": "/unique-chain/target/release/wbuild/{{ FEATURE }}/{{ RUNTIME }}_runtime.compact.compressed.wasm", "id": "1000", "balance": "1000000000000000000000000", "chainRawInitializer": [ diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/fork-update-withdata.yml index 0e67c70e3c..180bd0c922 100644 --- a/.github/workflows/fork-update-withdata.yml +++ b/.github/workflows/fork-update-withdata.yml @@ -46,9 +46,9 @@ jobs: id: create_matrix with: matrix: | - network {Opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}} - network {Quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} - network {Unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} + network {Opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}, fork_from_address {wss://eu-ws-quartz.unique.network:443} + network {Quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, fork_from_address {wss://eu-ws-quartz.unique.network:443} + network {Unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, fork_from_address {wss://eu-ws-quartz.unique.network:443} @@ -64,27 +64,9 @@ jobs: strategy: matrix: include: ${{fromJson(needs.prepare-execution-marix-fork.outputs.matrix)}} -# include: -# - network: "Opal" -# features: "opal-runtime" -# runtime: "opal" -# mainnet_branch: v924010 -# mainnet_tag: v924010 -# - network: "Quartz" # KUSAMA_MAINNET_BRANCH для quartz-runtime -# features: "quartz-runtime" -# runtime: "quartz" -# mainnet_branch: quartz-v924012-2 -# mainnet_tag: v924012 -# - network: "Unique" # POLKADOT_MAINNET_BRANCH для unique-runtime -# features: "unique-runtime" -# runtime: "unique" -# mainnet_branch: v924010 -# mainnet_tag: v924010 - - steps: -# - name: Skip if pull request is in Draft + - name: Skip if pull request is in Draft # `if: github.event.pull_request.draft == true` should be kept here, at # the step level, rather than at the job level. The latter is not # recommended because when the PR is moved from "Draft" to "Ready to @@ -99,8 +81,8 @@ jobs: # 4. Move it to "Ready for review"; now the workflow is passing (it was # skipped) and "Check reviews" is also passing (it won't be updated # until the workflow is finished) -# if: github.event.pull_request.draft == true -# run: exit 1 + if: github.event.pull_request.draft == true + run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 @@ -128,6 +110,7 @@ jobs: FEATURE=${{ matrix.features }} RUNTIME=${{ matrix.runtime }} BRANCH=${{ github.head_ref }} + FORK_FROM=${{ matrix.fork_from_address }} - name: Show build configuration run: cat .docker/forking/docker-compose.${{ matrix.network }}.yml From a9fae34e20b807f790e4dff4ec7a8a9dd88e9edb Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 15 Aug 2022 13:50:26 +0700 Subject: [PATCH 0363/1274] changes for fork --- .github/workflows/fork-update-withdata.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/fork-update-withdata.yml index 180bd0c922..f790aaab96 100644 --- a/.github/workflows/fork-update-withdata.yml +++ b/.github/workflows/fork-update-withdata.yml @@ -1,4 +1,4 @@ -name: Forkless Parachain update with no data +name: Fork Parachain update with data # Controls when the action will run. on: @@ -46,9 +46,9 @@ jobs: id: create_matrix with: matrix: | - network {Opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}, fork_from_address {wss://eu-ws-quartz.unique.network:443} + network {Opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}, fork_from_address {} network {Quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, fork_from_address {wss://eu-ws-quartz.unique.network:443} - network {Unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, fork_from_address {wss://eu-ws-quartz.unique.network:443} + network {Unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, fork_from_address {wss://eu-ws.unique.network:443} From 9fe4c05e564bbc17c9ef44ccba4fe4152c4d7049 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 15 Aug 2022 14:09:06 +0700 Subject: [PATCH 0364/1274] add address for opal for fork update --- .github/workflows/fork-update-withdata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/fork-update-withdata.yml index f790aaab96..4a77bb6c0e 100644 --- a/.github/workflows/fork-update-withdata.yml +++ b/.github/workflows/fork-update-withdata.yml @@ -46,7 +46,7 @@ jobs: id: create_matrix with: matrix: | - network {Opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}, fork_from_address {} + network {Opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}, fork_from_address {wss://eu-ws-opal.unique.network:443} network {Quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, fork_from_address {wss://eu-ws-quartz.unique.network:443} network {Unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, fork_from_address {wss://eu-ws.unique.network:443} From 0ad3c9f7b9b608d98b20a876a300da402be8ebd0 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 15 Aug 2022 14:36:24 +0700 Subject: [PATCH 0365/1274] change trigger branch to master --- .github/workflows/fork-update-withdata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/fork-update-withdata.yml index 4a77bb6c0e..29f30dd1b9 100644 --- a/.github/workflows/fork-update-withdata.yml +++ b/.github/workflows/fork-update-withdata.yml @@ -5,7 +5,7 @@ on: # Triggers the workflow on push or pull request events but only for the master branch pull_request: branches: - - develop + - master types: - opened - reopened From 2cc1632188bbf19ff003509639123253cd246834 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:53:18 +0300 Subject: [PATCH 0366/1274] Update forkless-update-nodata.yml --- .github/workflows/forkless-update-nodata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 2033cd31f9..a18f223453 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -5,7 +5,7 @@ on: # Triggers the workflow on push or pull request events but only for the master branch pull_request: branches: - - develop + - master types: - opened - reopened From d68e1f7100334221de06ec19d3e5e9282220bae7 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 15:40:25 +0300 Subject: [PATCH 0367/1274] Changed tag of runners. Uncommented docker-compose down. --- .github/workflows/fork-update-withdata.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/fork-update-withdata.yml index 29f30dd1b9..584935d407 100644 --- a/.github/workflows/fork-update-withdata.yml +++ b/.github/workflows/fork-update-withdata.yml @@ -55,7 +55,7 @@ jobs: fork-update-withdata: needs: prepare-execution-marix-fork # The type of runner that the job will run on - runs-on: ci-tests + runs-on: self-hosted-ci name: Build Container, Spin it Up an test @@ -181,6 +181,6 @@ jobs: name: fork-parachain-update-withdata-logs.${{ matrix.features }}.tgz path: ./fork-parachain-update-withdata-logs.${{ matrix.features }}.tgz -# - name: Stop running containers -# if: always() # run this step always -# run: docker-compose -f ".docker/forking/docker-compose-fork.yaml" -f ".docker/forking/docker-compose.${{ matrix.network }}.yml" down + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/forking/docker-compose-fork.yaml" -f ".docker/forking/docker-compose.${{ matrix.network }}.yml" down From de5b42b8cb689c84332a9eeb317f822d43d5166c Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 15 Aug 2022 13:23:10 +0000 Subject: [PATCH 0368/1274] fix: remove move constants to primitives --- runtime/common/constants.rs | 55 ------------------------------------- runtime/common/mod.rs | 1 - 2 files changed, 56 deletions(-) delete mode 100644 runtime/common/constants.rs diff --git a/runtime/common/constants.rs b/runtime/common/constants.rs deleted file mode 100644 index 2ef27435ca..0000000000 --- a/runtime/common/constants.rs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -use sp_runtime::Perbill; -use frame_support::{ - parameter_types, - weights::{Weight, constants::WEIGHT_PER_SECOND}, -}; -use up_common::types::{BlockNumber, Balance}; - -pub const MILLISECS_PER_BLOCK: u64 = 12000; - -pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; - -// These time units are defined in number of blocks. -pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); -pub const HOURS: BlockNumber = MINUTES * 60; -pub const DAYS: BlockNumber = HOURS * 24; - -pub const MICROUNIQUE: Balance = 1_000_000_000_000; -pub const MILLIUNIQUE: Balance = 1_000 * MICROUNIQUE; -pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE; -pub const UNIQUE: Balance = 100 * CENTIUNIQUE; - -// Targeting 0.1 UNQ per transfer -pub const WEIGHT_TO_FEE_COEFF: u32 = 207_890_902; - -// Targeting 0.15 UNQ per transfer via ETH -pub const MIN_GAS_PRICE: u64 = 1_019_493_469_850; - -/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers. -/// This is used to limit the maximal weight of a single extrinsic. -pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); -/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used -/// by Operational extrinsics. -pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); -/// We allow for 2 seconds of compute with a 6 second average block time. -pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; - -parameter_types! { - pub const TransactionByteFee: Balance = 501 * MICROUNIQUE; -} diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index 9274a9e533..ac2aca2b33 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -15,7 +15,6 @@ // along with Unique Network. If not, see . pub mod config; -pub mod constants; pub mod construct_runtime; pub mod dispatch; pub mod ethereum; From c98669693465547c226bde6d688ace6552898040 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 15 Aug 2022 13:28:11 +0000 Subject: [PATCH 0369/1274] fix: remove common runtime mod CHANGELOG.md --- runtime/common/CHANGELOG.md | 13 ------------- runtime/opal/CHANGELOG.md | 3 +++ runtime/quartz/CHANGELOG.md | 3 +++ runtime/unique/CHANGELOG.md | 3 +++ 4 files changed, 9 insertions(+), 13 deletions(-) delete mode 100644 runtime/common/CHANGELOG.md create mode 100644 runtime/opal/CHANGELOG.md create mode 100644 runtime/quartz/CHANGELOG.md create mode 100644 runtime/unique/CHANGELOG.md diff --git a/runtime/common/CHANGELOG.md b/runtime/common/CHANGELOG.md deleted file mode 100644 index a9e1ccd854..0000000000 --- a/runtime/common/CHANGELOG.md +++ /dev/null @@ -1,13 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. - -## [0.9.25] - 2022-07-14 - -### Added - - - Implementation of RPC method `token_owners` returning 10 owners in no particular order. - This was an internal request to improve the web interface and support fractionalization event. - - - \ No newline at end of file diff --git a/runtime/opal/CHANGELOG.md b/runtime/opal/CHANGELOG.md new file mode 100644 index 0000000000..57df883e23 --- /dev/null +++ b/runtime/opal/CHANGELOG.md @@ -0,0 +1,3 @@ +# Change Log + +All notable changes to this project will be documented in this file. diff --git a/runtime/quartz/CHANGELOG.md b/runtime/quartz/CHANGELOG.md new file mode 100644 index 0000000000..57df883e23 --- /dev/null +++ b/runtime/quartz/CHANGELOG.md @@ -0,0 +1,3 @@ +# Change Log + +All notable changes to this project will be documented in this file. diff --git a/runtime/unique/CHANGELOG.md b/runtime/unique/CHANGELOG.md new file mode 100644 index 0000000000..57df883e23 --- /dev/null +++ b/runtime/unique/CHANGELOG.md @@ -0,0 +1,3 @@ +# Change Log + +All notable changes to this project will be documented in this file. From 18360df532d368776be6670fb85662a6326064da Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 17:05:08 +0300 Subject: [PATCH 0370/1274] Introduced try-runtime tests. --- .docker/Dockerfile-try-runtime | 74 ++++++++++ .docker/docker-compose-try-runtime.yaml | 19 +++ .docker/docker-compose.try-runtime.j2 | 15 ++ .github/workflows/build-test-master.yml | 1 + .github/workflows/codestyle.yml | 1 + .github/workflows/fork-update-withdata.yml | 1 + .github/workflows/forkless-update-nodata.yml | 1 + .github/workflows/node_build_test.yml | 1 + .github/workflows/tests_codestyle.yml | 2 + .github/workflows/try-runtime.yml | 140 +++++++++++++++++++ 10 files changed, 255 insertions(+) create mode 100644 .docker/Dockerfile-try-runtime create mode 100644 .docker/docker-compose-try-runtime.yaml create mode 100644 .docker/docker-compose.try-runtime.j2 create mode 100644 .github/workflows/try-runtime.yml diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime new file mode 100644 index 0000000000..92fd6b28c2 --- /dev/null +++ b/.docker/Dockerfile-try-runtime @@ -0,0 +1,74 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ARG RUST_TOOLCHAIN= + +ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" + + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install $RUST_TOOLCHAIN && \ + rustup default $RUST_TOOLCHAIN && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + + +# ===== BUILD ====== +FROM rust-builder as builder-unique + +ARG PROFILE=release +ARG FEATURE= +ARG REPO_URL= +ARG BRANCH= + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +RUN git clone $REPO_URL -b $BRANCH && \ + cargo build --features=$FEATURE --$PROFILE + + +# ===== BUILD POLKADOT ===== +FROM rust-builder as builder-polkadot + +ARG POLKADOT_BUILD_BRANCH= +ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ + cd polkadot && \ + cargo build --release + +# ===== RUN ====== + +FROM ubuntu:20.04 + +ARG FORM_FROM= +ARG FEATURE= + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ \ No newline at end of file diff --git a/.docker/docker-compose-try-runtime.yaml b/.docker/docker-compose-try-runtime.yaml new file mode 100644 index 0000000000..b14543d4ba --- /dev/null +++ b/.docker/docker-compose-try-runtime.yaml @@ -0,0 +1,19 @@ +version: "3.5" + +services: + try-runtime: + build: + context: ../ + dockerfile: .docker/Dockerfile-try-runtime + image: try-runtime + container_name: try-runtime + expose: + - 9944 + - 9933 + ports: + - 127.0.0.1:9944:9944 + - 127.0.0.1:9933:9933 + logging: + options: + max-size: "1m" + max-file: "3" diff --git a/.docker/docker-compose.try-runtime.j2 b/.docker/docker-compose.try-runtime.j2 new file mode 100644 index 0000000000..0ee0299570 --- /dev/null +++ b/.docker/docker-compose.try-runtime.j2 @@ -0,0 +1,15 @@ +version: "3.5" + +services: + try-runtime: + build: + args: + - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" + - "BRANCH={{ BRANCH }}" + - "REPO_URL={{ REPO_URL }}" + - "FEATURE={{ FEATURE }}" + - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" + - "FORK_FROM={{ FORK_FROM }}" + + command: cargo run --features=$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $FORK_FROM + diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml index 6520dbaacc..5f696c9564 100644 --- a/.github/workflows/build-test-master.yml +++ b/.github/workflows/build-test-master.yml @@ -10,6 +10,7 @@ on: - opened - reopened - synchronize #commit(s) pushed to the pull request + - ready_for_review # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index d590dbb7f2..7cb19d5e2f 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -8,6 +8,7 @@ on: - opened - reopened - synchronize + - ready_for_review jobs: rustfmt: diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/fork-update-withdata.yml index 584935d407..f084a50792 100644 --- a/.github/workflows/fork-update-withdata.yml +++ b/.github/workflows/fork-update-withdata.yml @@ -10,6 +10,7 @@ on: - opened - reopened - synchronize #commit(s) pushed to the pull request + - ready_for_review # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index a18f223453..734f0a9945 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -10,6 +10,7 @@ on: - opened - reopened - synchronize #commit(s) pushed to the pull request + - ready_for_review # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 9b0c5f68e7..462357c667 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -10,6 +10,7 @@ on: - opened - reopened - synchronize #commit(s) pushed to the pull request + - ready_for_review # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/tests_codestyle.yml b/.github/workflows/tests_codestyle.yml index 3dece3b354..13ed3805e8 100644 --- a/.github/workflows/tests_codestyle.yml +++ b/.github/workflows/tests_codestyle.yml @@ -8,6 +8,8 @@ on: - opened - reopened - synchronize + - ready_for_review + jobs: code_style: runs-on: self-hosted-ci diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml new file mode 100644 index 0000000000..9931802195 --- /dev/null +++ b/.github/workflows/try-runtime.yml @@ -0,0 +1,140 @@ +name: Try Runtime + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: + - develop + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + - ready_for_review + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +#Define Workflow variables +env: + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + prepare-execution-marix-try-runtime: + + name: Prepare execution matrix for fork + + runs-on: self-hosted-ci + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + steps: + - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: fabiocaccamo/create-matrix-action@v2 + id: create_matrix + with: + matrix: | + network {Opal}, features {opal-runtime}, fork_from_address {wss://eu-ws-opal.unique.network:443} + network {Quartz}, features {quartz-runtime}, fork_from_address {wss://eu-ws-quartz.unique.network:443} + network {Unique}, features {unique-runtime}, fork_from_address {wss://eu-ws.unique.network:443} + + + + fork-update-withdata: + needs: prepare-execution-marix-try-runtime + # The type of runner that the job will run on + runs-on: self-hosted-ci + + name: Build Container, Spin it Up an test + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.prepare-execution-marix-try-runtime.outputs.matrix)}} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/forking/docker-compose.try-runtime.j2 + output_file: .docker/forking/docker-compose.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + FEATURE=${{ matrix.features }} + BRANCH=${{ github.head_ref }} + FORK_FROM=${{ matrix.fork_from_address }} + + - name: Show build configuration + run: cat .docker/docker-compose.try-runtime.${{ matrix.network }}.yml + + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-try-runtime.yaml" -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 + + + - name: Collect Docker Logs + if: success() || failure() + uses: jwalton/gh-docker-logs@v2.2.0 + with: + dest: './try-runtime-logs.${{ matrix.features }}' + images: 'try-runtime' + + - name: Tar logs + if: success() || failure() + run: tar cvzf ./try-runtime-logs.${{ matrix.features }}.tgz ./try-runtime-logs.${{ matrix.features }} + + - name: Upload logs to GitHub + if: success() || failure() + uses: actions/upload-artifact@master + with: + name: try-runtime-logs.${{ matrix.features }}.tgz + path: ./try-runtime-logs.${{ matrix.features }}.tgz + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/forking/docker-compose-try-runtime.yaml" -f ".docker/forking/docker-compose.try-runtime.${{ matrix.network }}.yml" down From 6a7d5b108992b998dcafe2b869fa70f807e79a2c Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 17:14:55 +0300 Subject: [PATCH 0371/1274] escaping for values in execution matrix --- .github/workflows/fork-update-withdata.yml | 6 +++--- .github/workflows/try-runtime.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/fork-update-withdata.yml index f084a50792..dd051cfb8d 100644 --- a/.github/workflows/fork-update-withdata.yml +++ b/.github/workflows/fork-update-withdata.yml @@ -47,9 +47,9 @@ jobs: id: create_matrix with: matrix: | - network {Opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}, fork_from_address {wss://eu-ws-opal.unique.network:443} - network {Quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, fork_from_address {wss://eu-ws-quartz.unique.network:443} - network {Unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, fork_from_address {wss://eu-ws.unique.network:443} + network {Opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}, fork_from_address {'wss://eu-ws-opal.unique.network:443'} + network {Quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, fork_from_address {'wss://eu-ws-quartz.unique.network:443'} + network {Unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, fork_from_address {'wss://eu-ws.unique.network:443'} diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 9931802195..6ee78971b3 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -64,9 +64,9 @@ jobs: id: create_matrix with: matrix: | - network {Opal}, features {opal-runtime}, fork_from_address {wss://eu-ws-opal.unique.network:443} - network {Quartz}, features {quartz-runtime}, fork_from_address {wss://eu-ws-quartz.unique.network:443} - network {Unique}, features {unique-runtime}, fork_from_address {wss://eu-ws.unique.network:443} + network {Opal}, features {opal-runtime}, fork_from_address {'wss://eu-ws-opal.unique.network:443'} + network {Quartz}, features {quartz-runtime}, fork_from_address {'wss://eu-ws-quartz.unique.network:443'} + network {Unique}, features {unique-runtime}, fork_from_address {'wss://eu-ws.unique.network:443'} From 4c8938fe21d9bd8b9124ed68292ce76c73221e61 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 17:59:47 +0300 Subject: [PATCH 0372/1274] matrix generation was replaced by static matrix. --- .github/workflows/try-runtime.yml | 69 +++++++++++-------------------- 1 file changed, 23 insertions(+), 46 deletions(-) diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 6ee78971b3..a3c4ecf078 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -21,16 +21,29 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - - prepare-execution-marix-try-runtime: - - name: Prepare execution matrix for fork - + fork-update-withdata: + # The type of runner that the job will run on runs-on: self-hosted-ci - outputs: - matrix: ${{ steps.create_matrix.outputs.matrix }} + + name: Build Container, Spin it Up an test + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: + - network: Opal + features: try-runtime,opal-runtime + fork_from_address: wss://eu-ws-opal.unique.network:443 + - network: Quartz + features: try-runtime,quartz-runtime + fork_from_address: wss://eu-ws-quartz.unique.network:443 + - network: Unique + features: try-runtime,unique-runtime + fork_from_address: wss://eu-ws.unique.network:443 + steps: - - name: Skip if pull request is in Draft +# - name: Skip if pull request is in Draft # `if: github.event.pull_request.draft == true` should be kept here, at # the step level, rather than at the job level. The latter is not # recommended because when the PR is moved from "Draft" to "Ready to @@ -45,45 +58,9 @@ jobs: # 4. Move it to "Ready for review"; now the workflow is passing (it was # skipped) and "Check reviews" is also passing (it won't be updated # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} #Checking out head commit +# if: github.event.pull_request.draft == true +# run: exit 1 - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Create Execution matrix - uses: fabiocaccamo/create-matrix-action@v2 - id: create_matrix - with: - matrix: | - network {Opal}, features {opal-runtime}, fork_from_address {'wss://eu-ws-opal.unique.network:443'} - network {Quartz}, features {quartz-runtime}, fork_from_address {'wss://eu-ws-quartz.unique.network:443'} - network {Unique}, features {unique-runtime}, fork_from_address {'wss://eu-ws.unique.network:443'} - - - - fork-update-withdata: - needs: prepare-execution-marix-try-runtime - # The type of runner that the job will run on - runs-on: self-hosted-ci - - name: Build Container, Spin it Up an test - - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - - strategy: - matrix: - include: ${{fromJson(needs.prepare-execution-marix-try-runtime.outputs.matrix)}} - - steps: - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 From 98e6903a6840c9ea8e7eb2792c3936887e3371c0 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 18:04:20 +0300 Subject: [PATCH 0373/1274] fix path to jinja template --- .github/workflows/try-runtime.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index a3c4ecf078..bc916b4290 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -76,8 +76,8 @@ jobs: - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 with: - template: .docker/forking/docker-compose.try-runtime.j2 - output_file: .docker/forking/docker-compose.${{ matrix.network }}.yml + template: .docker/docker-compose.try-runtime.j2 + output_file: .docker/docker-compose.try-runtime.${{ matrix.network }}.yml variables: | REPO_URL=${{ github.server_url }}/${{ github.repository }}.git RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} From 2e30414480d43ec3616e83d41e8b8b6fdf84b106 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 15 Aug 2022 22:17:08 +0700 Subject: [PATCH 0374/1274] uncomment clean containers --- .github/workflows/fork-update-withdata.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/fork-update-withdata.yml index 29f30dd1b9..da904e0af2 100644 --- a/.github/workflows/fork-update-withdata.yml +++ b/.github/workflows/fork-update-withdata.yml @@ -181,6 +181,6 @@ jobs: name: fork-parachain-update-withdata-logs.${{ matrix.features }}.tgz path: ./fork-parachain-update-withdata-logs.${{ matrix.features }}.tgz -# - name: Stop running containers -# if: always() # run this step always -# run: docker-compose -f ".docker/forking/docker-compose-fork.yaml" -f ".docker/forking/docker-compose.${{ matrix.network }}.yml" down + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/forking/docker-compose-fork.yaml" -f ".docker/forking/docker-compose.${{ matrix.network }}.yml" down From a7efb3ed579ede68e3c2bb89a5926f24d1214631 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 15 Aug 2022 17:23:54 +0300 Subject: [PATCH 0375/1274] fix: disable pallets for quartz runtime benchmarking Signed-off-by: Yaroslav Bolyukin --- runtime/common/runtime_apis.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index 3054ba025f..268e1d93e2 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -639,14 +639,18 @@ macro_rules! impl_common_runtime_apis { list_benchmark!(list, extra, pallet_structure, Structure); list_benchmark!(list, extra, pallet_inflation, Inflation); list_benchmark!(list, extra, pallet_fungible, Fungible); - list_benchmark!(list, extra, pallet_refungible, Refungible); list_benchmark!(list, extra, pallet_nonfungible, Nonfungible); + + #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] + list_benchmark!(list, extra, pallet_refungible, Refungible); + + #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] list_benchmark!(list, extra, pallet_unique_scheduler, Scheduler); - #[cfg(not(feature = "unique-runtime"))] + #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] list_benchmark!(list, extra, pallet_proxy_rmrk_core, RmrkCore); - #[cfg(not(feature = "unique-runtime"))] + #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] list_benchmark!(list, extra, pallet_proxy_rmrk_equip, RmrkEquip); // list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate); @@ -690,14 +694,18 @@ macro_rules! impl_common_runtime_apis { add_benchmark!(params, batches, pallet_structure, Structure); add_benchmark!(params, batches, pallet_inflation, Inflation); add_benchmark!(params, batches, pallet_fungible, Fungible); - add_benchmark!(params, batches, pallet_refungible, Refungible); add_benchmark!(params, batches, pallet_nonfungible, Nonfungible); + + #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] + add_benchmark!(params, batches, pallet_refungible, Refungible); + + #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] add_benchmark!(params, batches, pallet_unique_scheduler, Scheduler); - #[cfg(not(feature = "unique-runtime"))] + #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] add_benchmark!(params, batches, pallet_proxy_rmrk_core, RmrkCore); - #[cfg(not(feature = "unique-runtime"))] + #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] add_benchmark!(params, batches, pallet_proxy_rmrk_equip, RmrkEquip); // add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate); From aa49f021671bd8f85baeac2ddfc4969e62e7fbfd Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 15 Aug 2022 17:24:51 +0300 Subject: [PATCH 0376/1274] feat: use pallet-configuration Signed-off-by: Yaroslav Bolyukin --- pallets/configuration/Cargo.toml | 33 +++++++ pallets/configuration/src/lib.rs | 124 ++++++++++++++++++++++++ primitives/common/src/constants.rs | 4 +- runtime/common/config/ethereum.rs | 9 +- runtime/common/config/pallets/mod.rs | 6 ++ runtime/common/config/substrate.rs | 26 +---- runtime/common/config/xcm.rs | 27 ++++-- runtime/common/construct_runtime/mod.rs | 2 +- runtime/opal/Cargo.toml | 2 + runtime/quartz/Cargo.toml | 2 + runtime/unique/Cargo.toml | 2 + 11 files changed, 192 insertions(+), 45 deletions(-) create mode 100644 pallets/configuration/Cargo.toml create mode 100644 pallets/configuration/src/lib.rs diff --git a/pallets/configuration/Cargo.toml b/pallets/configuration/Cargo.toml new file mode 100644 index 0000000000..f5bd63357b --- /dev/null +++ b/pallets/configuration/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "pallet-configuration" +version = "0.1.0" +edition = "2021" + +[dependencies] +parity-scale-codec = { version = "3.1.5", features = [ + "derive", +], default-features = false } +scale-info = { version = "2.0.1", default-features = false, features = [ + "derive", +] } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +smallvec = "1.6.1" + +[features] +default = ["std"] +std = [ + "parity-scale-codec/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-std/std", + "sp-core/std", + "sp-arithmetic/std", + "fp-evm/std", +] diff --git a/pallets/configuration/src/lib.rs b/pallets/configuration/src/lib.rs new file mode 100644 index 0000000000..0385cfe16d --- /dev/null +++ b/pallets/configuration/src/lib.rs @@ -0,0 +1,124 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +#![cfg_attr(not(feature = "std"), no_std)] + +use core::marker::PhantomData; + +use frame_support::{ + pallet, + weights::{WeightToFeePolynomial, WeightToFeeCoefficients, WeightToFeeCoefficient}, + traits::Get, +}; +use sp_arithmetic::traits::{BaseArithmetic, Unsigned}; +use smallvec::smallvec; + +pub use pallet::*; +use sp_core::U256; +use sp_runtime::Perbill; + +#[pallet] +mod pallet { + use super::*; + use frame_support::{ + traits::Get, + pallet_prelude::{StorageValue, ValueQuery, DispatchResult}, + }; + use frame_system::{pallet_prelude::OriginFor, ensure_root}; + + #[pallet::config] + pub trait Config: frame_system::Config { + #[pallet::constant] + type DefaultWeightToFeeCoefficient: Get; + #[pallet::constant] + type DefaultMinGasPrice: Get; + } + + #[pallet::storage] + pub type WeightToFeeCoefficientOverride = StorageValue< + Value = u32, + QueryKind = ValueQuery, + OnEmpty = T::DefaultWeightToFeeCoefficient, + >; + + #[pallet::storage] + pub type MinGasPriceOverride = + StorageValue; + + #[pallet::call] + impl Pallet { + #[pallet::weight(T::DbWeight::get().writes(1))] + pub fn set_weight_to_fee_coefficient_override( + origin: OriginFor, + coeff: Option, + ) -> DispatchResult { + let _sender = ensure_root(origin)?; + if let Some(coeff) = coeff { + >::set(coeff); + } else { + >::kill(); + } + Ok(()) + } + + #[pallet::weight(T::DbWeight::get().writes(1))] + pub fn set_min_gas_price_override( + origin: OriginFor, + coeff: Option, + ) -> DispatchResult { + let _sender = ensure_root(origin)?; + if let Some(coeff) = coeff { + >::set(coeff); + } else { + >::kill(); + } + Ok(()) + } + } + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); +} + +pub struct WeightToFee(PhantomData<(T, B)>); + +impl WeightToFeePolynomial for WeightToFee +where + T: Config, + B: BaseArithmetic + From + Copy + Unsigned, +{ + type Balance = B; + + fn polynomial() -> WeightToFeeCoefficients { + smallvec!(WeightToFeeCoefficient { + coeff_integer: >::get().into(), + coeff_frac: Perbill::zero(), + negative: false, + degree: 1, + }) + } +} + +pub struct FeeCalculator(PhantomData); +impl fp_evm::FeeCalculator for FeeCalculator { + fn min_gas_price() -> (U256, u64) { + ( + >::get().into(), + T::DbWeight::get().reads(1), + ) + } +} diff --git a/primitives/common/src/constants.rs b/primitives/common/src/constants.rs index bda19d3b6d..edbf3ebb76 100644 --- a/primitives/common/src/constants.rs +++ b/primitives/common/src/constants.rs @@ -36,10 +36,10 @@ pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE; pub const UNIQUE: Balance = 100 * CENTIUNIQUE; // Targeting 0.1 UNQ per transfer -pub const WEIGHT_TO_FEE_COEFF: u32 = 207_890_902; +pub const WEIGHT_TO_FEE_COEFF: u32 = /**/207_890_902/**/; // Targeting 0.15 UNQ per transfer via ETH -pub const MIN_GAS_PRICE: u64 = 1_019_493_469_850; +pub const MIN_GAS_PRICE: u64 = /**/1_019_493_469_850/**/; /// We assume that ~10% of the block weight is consumed by `on_initalize` handlers. /// This is used to limit the maximal weight of a single extrinsic. diff --git a/runtime/common/config/ethereum.rs b/runtime/common/config/ethereum.rs index e2a88999dd..c70883df36 100644 --- a/runtime/common/config/ethereum.rs +++ b/runtime/common/config/ethereum.rs @@ -50,13 +50,6 @@ impl pallet_evm::GasWeightMapping for FixedGasWeightMapping { } } -pub struct FixedFee; -impl pallet_evm::FeeCalculator for FixedFee { - fn min_gas_price() -> (U256, u64) { - (MIN_GAS_PRICE.into(), 0) - } -} - pub struct EthereumFindAuthor(core::marker::PhantomData); impl> FindAuthor for EthereumFindAuthor { fn find_author<'a, I>(digests: I) -> Option @@ -73,7 +66,7 @@ impl> FindAuthor for EthereumFindAuthor { impl pallet_evm::Config for Runtime { type BlockGasLimit = BlockGasLimit; - type FeeCalculator = FixedFee; + type FeeCalculator = pallet_configuration::FeeCalculator; type GasWeightMapping = FixedGasWeightMapping; type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping; type CallOrigin = EnsureAddressTruncated; diff --git a/runtime/common/config/pallets/mod.rs b/runtime/common/config/pallets/mod.rs index a7185f532e..d2d7a2f9e7 100644 --- a/runtime/common/config/pallets/mod.rs +++ b/runtime/common/config/pallets/mod.rs @@ -25,6 +25,7 @@ use crate::{ }, Runtime, Event, Call, Balances, }; +use frame_support::traits::{ConstU32, ConstU64}; use up_common::{ types::{AccountId, Balance, BlockNumber}, constants::*, @@ -91,3 +92,8 @@ impl pallet_unique::Config for Runtime { type CommonWeightInfo = CommonWeights; type RefungibleExtensionsWeightInfo = CommonWeights; } + +impl pallet_configuration::Config for Runtime { + type DefaultWeightToFeeCoefficient = ConstU32<{ up_common::constants::WEIGHT_TO_FEE_COEFF }>; + type DefaultMinGasPrice = ConstU64<{ up_common::constants::MIN_GAS_PRICE }>; +} diff --git a/runtime/common/config/substrate.rs b/runtime/common/config/substrate.rs index e38842329c..f306393e9b 100644 --- a/runtime/common/config/substrate.rs +++ b/runtime/common/config/substrate.rs @@ -18,8 +18,7 @@ use frame_support::{ traits::{Everything, ConstU32}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}, - DispatchClass, WeightToFeePolynomial, WeightToFeeCoefficients, ConstantMultiplier, - WeightToFeeCoefficient, + DispatchClass, ConstantMultiplier, }, parameter_types, PalletId, }; @@ -32,8 +31,6 @@ use frame_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; -use sp_arithmetic::traits::{BaseArithmetic, Unsigned}; -use smallvec::smallvec; use crate::{ runtime_common::DealWithFees, Runtime, Event, Call, Origin, PalletInfo, System, Balances, Treasury, SS58Prefix, Version, @@ -156,30 +153,11 @@ parameter_types! { pub const OperationalFeeMultiplier: u8 = 5; } -/// Linear implementor of `WeightToFeePolynomial` -pub struct LinearFee(sp_std::marker::PhantomData); - -impl WeightToFeePolynomial for LinearFee -where - T: BaseArithmetic + From + Copy + Unsigned, -{ - type Balance = T; - - fn polynomial() -> WeightToFeeCoefficients { - smallvec!(WeightToFeeCoefficient { - coeff_integer: WEIGHT_TO_FEE_COEFF.into(), - coeff_frac: Perbill::zero(), - negative: false, - degree: 1, - }) - } -} - impl pallet_transaction_payment::Config for Runtime { type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type LengthToFee = ConstantMultiplier; type OperationalFeeMultiplier = OperationalFeeMultiplier; - type WeightToFee = LinearFee; + type WeightToFee = pallet_configuration::WeightToFee; type FeeMultiplierUpdate = (); } diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs index c9df66f5f3..33d3515443 100644 --- a/runtime/common/config/xcm.rs +++ b/runtime/common/config/xcm.rs @@ -44,8 +44,7 @@ use xcm_builder::{ use xcm_executor::{Config, XcmExecutor, Assets}; use sp_std::marker::PhantomData; use crate::{ - runtime_common::config::substrate::LinearFee, Runtime, Call, Event, Origin, Balances, - ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue, + Runtime, Call, Event, Origin, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue, }; use up_common::{ types::{AccountId, Balance}, @@ -234,8 +233,11 @@ impl< } } -pub struct XcmConfig; -impl Config for XcmConfig { +pub struct XcmConfig(PhantomData); +impl Config for XcmConfig +where + T: pallet_configuration::Config, +{ type Call = Call; type XcmSender = XcmRouter; // How to withdraw and deposit an asset. @@ -246,8 +248,13 @@ impl Config for XcmConfig { type LocationInverter = LocationInverter; type Barrier = Barrier; type Weigher = FixedWeightBounds; - type Trader = - UsingOnlySelfCurrencyComponents, RelayLocation, AccountId, Balances, ()>; + type Trader = UsingOnlySelfCurrencyComponents< + pallet_configuration::WeightToFee, + RelayLocation, + AccountId, + Balances, + (), + >; type ResponseHandler = (); // Don't handle responses for now. type SubscriptionService = PolkadotXcm; @@ -261,7 +268,7 @@ impl pallet_xcm::Config for Runtime { type XcmRouter = XcmRouter; type ExecuteXcmOrigin = EnsureXcmOrigin; type XcmExecuteFilter = Everything; - type XcmExecutor = XcmExecutor; + type XcmExecutor = XcmExecutor>; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; type Weigher = FixedWeightBounds; @@ -274,13 +281,13 @@ impl pallet_xcm::Config for Runtime { impl cumulus_pallet_xcm::Config for Runtime { type Event = Event; - type XcmExecutor = XcmExecutor; + type XcmExecutor = XcmExecutor>; } impl cumulus_pallet_xcmp_queue::Config for Runtime { type WeightInfo = (); type Event = Event; - type XcmExecutor = XcmExecutor; + type XcmExecutor = XcmExecutor>; type ChannelInfo = ParachainSystem; type VersionWrapper = (); type ExecuteOverweightOrigin = frame_system::EnsureRoot; @@ -290,6 +297,6 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { impl cumulus_pallet_dmp_queue::Config for Runtime { type Event = Event; - type XcmExecutor = XcmExecutor; + type XcmExecutor = XcmExecutor>; type ExecuteOverweightOrigin = frame_system::EnsureRoot; } diff --git a/runtime/common/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs index 1036840fc6..562affa57a 100644 --- a/runtime/common/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -57,7 +57,7 @@ macro_rules! construct_runtime { #[runtimes(opal)] Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event} = 62, - // free = 63 + Configuration: pallet_configuration::{Pallet, Call, Storage} = 63, Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64, // ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65, diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 3482a04a5f..e1eb75fee7 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -87,6 +87,7 @@ std = [ 'parachain-info/std', 'serde', 'pallet-inflation/std', + 'pallet-configuration/std', 'pallet-common/std', 'pallet-structure/std', 'pallet-fungible/std', @@ -414,6 +415,7 @@ rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false } fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } +pallet-configuration = { default-features = false, path = "../../pallets/configuration" } pallet-common = { default-features = false, path = "../../pallets/common" } pallet-structure = { default-features = false, path = "../../pallets/structure" } pallet-fungible = { default-features = false, path = "../../pallets/fungible" } diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index d67afdc17e..92b192d55f 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -87,6 +87,7 @@ std = [ 'parachain-info/std', 'serde', 'pallet-inflation/std', + 'pallet-configuration/std', 'pallet-common/std', 'pallet-structure/std', 'pallet-fungible/std', @@ -418,6 +419,7 @@ up-rpc = { path = "../../primitives/rpc", default-features = false } fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } +pallet-configuration = { default-features = false, path = "../../pallets/configuration" } pallet-common = { default-features = false, path = "../../pallets/common" } pallet-structure = { default-features = false, path = "../../pallets/structure" } pallet-fungible = { default-features = false, path = "../../pallets/fungible" } diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 9778ed1d1c..694e971659 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -88,6 +88,7 @@ std = [ 'parachain-info/std', 'serde', 'pallet-inflation/std', + 'pallet-configuration/std', 'pallet-common/std', 'pallet-structure/std', 'pallet-fungible/std', @@ -411,6 +412,7 @@ up-rpc = { path = "../../primitives/rpc", default-features = false } rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false } pallet-inflation = { path = '../../pallets/inflation', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } +pallet-configuration = { default-features = false, path = "../../pallets/configuration" } pallet-common = { default-features = false, path = "../../pallets/common" } pallet-structure = { default-features = false, path = "../../pallets/structure" } pallet-fungible = { default-features = false, path = "../../pallets/fungible" } From 55956a906c5358d33594ace72482178baf6e9102 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 15 Aug 2022 11:05:08 +0300 Subject: [PATCH 0377/1274] test: regenerate types Signed-off-by: Yaroslav Bolyukin --- tests/src/interfaces/augment-api-consts.ts | 8 + tests/src/interfaces/augment-api-errors.ts | 2 +- tests/src/interfaces/augment-api-query.ts | 8 + tests/src/interfaces/augment-api-tx.ts | 8 + tests/src/interfaces/augment-types.ts | 3 +- tests/src/interfaces/default/types.ts | 13 + tests/src/interfaces/lookup.ts | 303 +++++++++++---------- tests/src/interfaces/registry.ts | 3 +- tests/src/interfaces/types-lookup.ts | 303 +++++++++++---------- 9 files changed, 358 insertions(+), 293 deletions(-) diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index 31cc5bfb6c..1f9b07e013 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -42,6 +42,14 @@ declare module '@polkadot/api-base/types/consts' { **/ [key: string]: Codec; }; + configuration: { + defaultMinGasPrice: u64 & AugmentedConst; + defaultWeightToFeeCoefficient: u32 & AugmentedConst; + /** + * Generic const + **/ + [key: string]: Codec; + }; inflation: { /** * Number of blocks that pass between treasury balance updates due to inflation diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 028623bb33..56b0adab44 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -173,7 +173,7 @@ declare module '@polkadot/api-base/types/errors' { **/ TransferNotAllowed: AugmentedError; /** - * Target collection doesn't support this operation + * The operation is not supported **/ UnsupportedOperation: AugmentedError; /** diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index f3b47f95a3..57fc0efdf2 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -110,6 +110,14 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; + configuration: { + minGasPriceOverride: AugmentedQuery Observable, []> & QueryableStorageEntry; + weightToFeeCoefficientOverride: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; dmpQueue: { /** * The configuration. diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index 89010386b8..fe69a0ff5b 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -104,6 +104,14 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; + configuration: { + setMinGasPriceOverride: AugmentedSubmittable<(coeff: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + setWeightToFeeCoefficientOverride: AugmentedSubmittable<(coeff: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; cumulusXcm: { /** * Generic tx diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index 5a0f6ea569..55e03234af 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; @@ -763,6 +763,7 @@ declare module '@polkadot/types/types/registry' { PalletCallMetadataV14: PalletCallMetadataV14; PalletCommonError: PalletCommonError; PalletCommonEvent: PalletCommonEvent; + PalletConfigurationCall: PalletConfigurationCall; PalletConstantMetadataLatest: PalletConstantMetadataLatest; PalletConstantMetadataV14: PalletConstantMetadataV14; PalletErrorMetadataLatest: PalletErrorMetadataLatest; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index f96805d5e0..b1f41337a0 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -994,6 +994,19 @@ export interface PalletCommonEvent extends Enum { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; } +/** @name PalletConfigurationCall */ +export interface PalletConfigurationCall extends Enum { + readonly isSetWeightToFeeCoefficientOverride: boolean; + readonly asSetWeightToFeeCoefficientOverride: { + readonly coeff: Option; + } & Struct; + readonly isSetMinGasPriceOverride: boolean; + readonly asSetMinGasPriceOverride: { + readonly coeff: Option; + } & Struct; + readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride'; +} + /** @name PalletEthereumCall */ export interface PalletEthereumCall extends Enum { readonly isTransact: boolean; diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index ede50e0ccc..8a14949f6e 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -1571,15 +1571,28 @@ export default { } }, /** - * Lookup207: pallet_template_transaction_payment::Call + * Lookup207: pallet_configuration::pallet::Call + **/ + PalletConfigurationCall: { + _enum: { + set_weight_to_fee_coefficient_override: { + coeff: 'Option', + }, + set_min_gas_price_override: { + coeff: 'Option' + } + } + }, + /** + * Lookup209: pallet_template_transaction_payment::Call **/ PalletTemplateTransactionPaymentCall: 'Null', /** - * Lookup208: pallet_structure::pallet::Call + * Lookup210: pallet_structure::pallet::Call **/ PalletStructureCall: 'Null', /** - * Lookup209: pallet_rmrk_core::pallet::Call + * Lookup211: pallet_rmrk_core::pallet::Call **/ PalletRmrkCoreCall: { _enum: { @@ -1670,7 +1683,7 @@ export default { } }, /** - * Lookup215: rmrk_traits::resource::ResourceTypes, frame_support::storage::bounded_vec::BoundedVec> + * Lookup217: rmrk_traits::resource::ResourceTypes, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceTypes: { _enum: { @@ -1680,7 +1693,7 @@ export default { } }, /** - * Lookup217: rmrk_traits::resource::BasicResource> + * Lookup219: rmrk_traits::resource::BasicResource> **/ RmrkTraitsResourceBasicResource: { src: 'Option', @@ -1689,7 +1702,7 @@ export default { thumb: 'Option' }, /** - * Lookup219: rmrk_traits::resource::ComposableResource, frame_support::storage::bounded_vec::BoundedVec> + * Lookup221: rmrk_traits::resource::ComposableResource, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsResourceComposableResource: { parts: 'Vec', @@ -1700,7 +1713,7 @@ export default { thumb: 'Option' }, /** - * Lookup220: rmrk_traits::resource::SlotResource> + * Lookup222: rmrk_traits::resource::SlotResource> **/ RmrkTraitsResourceSlotResource: { base: 'u32', @@ -1711,7 +1724,7 @@ export default { thumb: 'Option' }, /** - * Lookup222: rmrk_traits::nft::AccountIdOrCollectionNftTuple + * Lookup224: rmrk_traits::nft::AccountIdOrCollectionNftTuple **/ RmrkTraitsNftAccountIdOrCollectionNftTuple: { _enum: { @@ -1720,7 +1733,7 @@ export default { } }, /** - * Lookup226: pallet_rmrk_equip::pallet::Call + * Lookup228: pallet_rmrk_equip::pallet::Call **/ PalletRmrkEquipCall: { _enum: { @@ -1741,7 +1754,7 @@ export default { } }, /** - * Lookup229: rmrk_traits::part::PartType, frame_support::storage::bounded_vec::BoundedVec> + * Lookup231: rmrk_traits::part::PartType, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsPartPartType: { _enum: { @@ -1750,7 +1763,7 @@ export default { } }, /** - * Lookup231: rmrk_traits::part::FixedPart> + * Lookup233: rmrk_traits::part::FixedPart> **/ RmrkTraitsPartFixedPart: { id: 'u32', @@ -1758,7 +1771,7 @@ export default { src: 'Bytes' }, /** - * Lookup232: rmrk_traits::part::SlotPart, frame_support::storage::bounded_vec::BoundedVec> + * Lookup234: rmrk_traits::part::SlotPart, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsPartSlotPart: { id: 'u32', @@ -1767,7 +1780,7 @@ export default { z: 'u32' }, /** - * Lookup233: rmrk_traits::part::EquippableList> + * Lookup235: rmrk_traits::part::EquippableList> **/ RmrkTraitsPartEquippableList: { _enum: { @@ -1777,7 +1790,7 @@ export default { } }, /** - * Lookup235: rmrk_traits::theme::Theme, frame_support::storage::bounded_vec::BoundedVec>, S>> + * Lookup237: rmrk_traits::theme::Theme, frame_support::storage::bounded_vec::BoundedVec>, S>> **/ RmrkTraitsTheme: { name: 'Bytes', @@ -1785,14 +1798,14 @@ export default { inherit: 'bool' }, /** - * Lookup237: rmrk_traits::theme::ThemeProperty> + * Lookup239: rmrk_traits::theme::ThemeProperty> **/ RmrkTraitsThemeThemeProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup239: pallet_evm::pallet::Call + * Lookup241: pallet_evm::pallet::Call **/ PalletEvmCall: { _enum: { @@ -1835,7 +1848,7 @@ export default { } }, /** - * Lookup245: pallet_ethereum::pallet::Call + * Lookup247: pallet_ethereum::pallet::Call **/ PalletEthereumCall: { _enum: { @@ -1845,7 +1858,7 @@ export default { } }, /** - * Lookup246: ethereum::transaction::TransactionV2 + * Lookup248: ethereum::transaction::TransactionV2 **/ EthereumTransactionTransactionV2: { _enum: { @@ -1855,7 +1868,7 @@ export default { } }, /** - * Lookup247: ethereum::transaction::LegacyTransaction + * Lookup249: ethereum::transaction::LegacyTransaction **/ EthereumTransactionLegacyTransaction: { nonce: 'U256', @@ -1867,7 +1880,7 @@ export default { signature: 'EthereumTransactionTransactionSignature' }, /** - * Lookup248: ethereum::transaction::TransactionAction + * Lookup250: ethereum::transaction::TransactionAction **/ EthereumTransactionTransactionAction: { _enum: { @@ -1876,7 +1889,7 @@ export default { } }, /** - * Lookup249: ethereum::transaction::TransactionSignature + * Lookup251: ethereum::transaction::TransactionSignature **/ EthereumTransactionTransactionSignature: { v: 'u64', @@ -1884,7 +1897,7 @@ export default { s: 'H256' }, /** - * Lookup251: ethereum::transaction::EIP2930Transaction + * Lookup253: ethereum::transaction::EIP2930Transaction **/ EthereumTransactionEip2930Transaction: { chainId: 'u64', @@ -1900,14 +1913,14 @@ export default { s: 'H256' }, /** - * Lookup253: ethereum::transaction::AccessListItem + * Lookup255: ethereum::transaction::AccessListItem **/ EthereumTransactionAccessListItem: { address: 'H160', storageKeys: 'Vec' }, /** - * Lookup254: ethereum::transaction::EIP1559Transaction + * Lookup256: ethereum::transaction::EIP1559Transaction **/ EthereumTransactionEip1559Transaction: { chainId: 'u64', @@ -1924,7 +1937,7 @@ export default { s: 'H256' }, /** - * Lookup255: pallet_evm_migration::pallet::Call + * Lookup257: pallet_evm_migration::pallet::Call **/ PalletEvmMigrationCall: { _enum: { @@ -1942,7 +1955,7 @@ export default { } }, /** - * Lookup258: pallet_sudo::pallet::Event + * Lookup260: pallet_sudo::pallet::Event **/ PalletSudoEvent: { _enum: { @@ -1958,7 +1971,7 @@ export default { } }, /** - * Lookup260: sp_runtime::DispatchError + * Lookup262: sp_runtime::DispatchError **/ SpRuntimeDispatchError: { _enum: { @@ -1975,38 +1988,38 @@ export default { } }, /** - * Lookup261: sp_runtime::ModuleError + * Lookup263: sp_runtime::ModuleError **/ SpRuntimeModuleError: { index: 'u8', error: '[u8;4]' }, /** - * Lookup262: sp_runtime::TokenError + * Lookup264: sp_runtime::TokenError **/ SpRuntimeTokenError: { _enum: ['NoFunds', 'WouldDie', 'BelowMinimum', 'CannotCreate', 'UnknownAsset', 'Frozen', 'Unsupported'] }, /** - * Lookup263: sp_runtime::ArithmeticError + * Lookup265: sp_runtime::ArithmeticError **/ SpRuntimeArithmeticError: { _enum: ['Underflow', 'Overflow', 'DivisionByZero'] }, /** - * Lookup264: sp_runtime::TransactionalError + * Lookup266: sp_runtime::TransactionalError **/ SpRuntimeTransactionalError: { _enum: ['LimitReached', 'NoLayer'] }, /** - * Lookup265: pallet_sudo::pallet::Error + * Lookup267: pallet_sudo::pallet::Error **/ PalletSudoError: { _enum: ['RequireSudo'] }, /** - * Lookup266: frame_system::AccountInfo> + * Lookup268: frame_system::AccountInfo> **/ FrameSystemAccountInfo: { nonce: 'u32', @@ -2016,7 +2029,7 @@ export default { data: 'PalletBalancesAccountData' }, /** - * Lookup267: frame_support::weights::PerDispatchClass + * Lookup269: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassU64: { normal: 'u64', @@ -2024,13 +2037,13 @@ export default { mandatory: 'u64' }, /** - * Lookup268: sp_runtime::generic::digest::Digest + * Lookup270: sp_runtime::generic::digest::Digest **/ SpRuntimeDigest: { logs: 'Vec' }, /** - * Lookup270: sp_runtime::generic::digest::DigestItem + * Lookup272: sp_runtime::generic::digest::DigestItem **/ SpRuntimeDigestDigestItem: { _enum: { @@ -2046,7 +2059,7 @@ export default { } }, /** - * Lookup272: frame_system::EventRecord + * Lookup274: frame_system::EventRecord **/ FrameSystemEventRecord: { phase: 'FrameSystemPhase', @@ -2054,7 +2067,7 @@ export default { topics: 'Vec' }, /** - * Lookup274: frame_system::pallet::Event + * Lookup276: frame_system::pallet::Event **/ FrameSystemEvent: { _enum: { @@ -2082,7 +2095,7 @@ export default { } }, /** - * Lookup275: frame_support::weights::DispatchInfo + * Lookup277: frame_support::weights::DispatchInfo **/ FrameSupportWeightsDispatchInfo: { weight: 'u64', @@ -2090,19 +2103,19 @@ export default { paysFee: 'FrameSupportWeightsPays' }, /** - * Lookup276: frame_support::weights::DispatchClass + * Lookup278: frame_support::weights::DispatchClass **/ FrameSupportWeightsDispatchClass: { _enum: ['Normal', 'Operational', 'Mandatory'] }, /** - * Lookup277: frame_support::weights::Pays + * Lookup279: frame_support::weights::Pays **/ FrameSupportWeightsPays: { _enum: ['Yes', 'No'] }, /** - * Lookup278: orml_vesting::module::Event + * Lookup280: orml_vesting::module::Event **/ OrmlVestingModuleEvent: { _enum: { @@ -2121,7 +2134,7 @@ export default { } }, /** - * Lookup279: cumulus_pallet_xcmp_queue::pallet::Event + * Lookup281: cumulus_pallet_xcmp_queue::pallet::Event **/ CumulusPalletXcmpQueueEvent: { _enum: { @@ -2136,7 +2149,7 @@ export default { } }, /** - * Lookup280: pallet_xcm::pallet::Event + * Lookup282: pallet_xcm::pallet::Event **/ PalletXcmEvent: { _enum: { @@ -2159,7 +2172,7 @@ export default { } }, /** - * Lookup281: xcm::v2::traits::Outcome + * Lookup283: xcm::v2::traits::Outcome **/ XcmV2TraitsOutcome: { _enum: { @@ -2169,7 +2182,7 @@ export default { } }, /** - * Lookup283: cumulus_pallet_xcm::pallet::Event + * Lookup285: cumulus_pallet_xcm::pallet::Event **/ CumulusPalletXcmEvent: { _enum: { @@ -2179,7 +2192,7 @@ export default { } }, /** - * Lookup284: cumulus_pallet_dmp_queue::pallet::Event + * Lookup286: cumulus_pallet_dmp_queue::pallet::Event **/ CumulusPalletDmpQueueEvent: { _enum: { @@ -2210,7 +2223,7 @@ export default { } }, /** - * Lookup285: pallet_unique::RawEvent> + * Lookup287: pallet_unique::RawEvent> **/ PalletUniqueRawEvent: { _enum: { @@ -2227,7 +2240,7 @@ export default { } }, /** - * Lookup286: pallet_unique_scheduler::pallet::Event + * Lookup288: pallet_unique_scheduler::pallet::Event **/ PalletUniqueSchedulerEvent: { _enum: { @@ -2252,13 +2265,13 @@ export default { } }, /** - * Lookup288: frame_support::traits::schedule::LookupError + * Lookup290: frame_support::traits::schedule::LookupError **/ FrameSupportScheduleLookupError: { _enum: ['Unknown', 'BadFormat'] }, /** - * Lookup289: pallet_common::pallet::Event + * Lookup291: pallet_common::pallet::Event **/ PalletCommonEvent: { _enum: { @@ -2276,7 +2289,7 @@ export default { } }, /** - * Lookup290: pallet_structure::pallet::Event + * Lookup292: pallet_structure::pallet::Event **/ PalletStructureEvent: { _enum: { @@ -2284,7 +2297,7 @@ export default { } }, /** - * Lookup291: pallet_rmrk_core::pallet::Event + * Lookup293: pallet_rmrk_core::pallet::Event **/ PalletRmrkCoreEvent: { _enum: { @@ -2361,7 +2374,7 @@ export default { } }, /** - * Lookup292: pallet_rmrk_equip::pallet::Event + * Lookup294: pallet_rmrk_equip::pallet::Event **/ PalletRmrkEquipEvent: { _enum: { @@ -2376,7 +2389,7 @@ export default { } }, /** - * Lookup293: pallet_evm::pallet::Event + * Lookup295: pallet_evm::pallet::Event **/ PalletEvmEvent: { _enum: { @@ -2390,7 +2403,7 @@ export default { } }, /** - * Lookup294: ethereum::log::Log + * Lookup296: ethereum::log::Log **/ EthereumLog: { address: 'H160', @@ -2398,7 +2411,7 @@ export default { data: 'Bytes' }, /** - * Lookup295: pallet_ethereum::pallet::Event + * Lookup297: pallet_ethereum::pallet::Event **/ PalletEthereumEvent: { _enum: { @@ -2406,7 +2419,7 @@ export default { } }, /** - * Lookup296: evm_core::error::ExitReason + * Lookup298: evm_core::error::ExitReason **/ EvmCoreErrorExitReason: { _enum: { @@ -2417,13 +2430,13 @@ export default { } }, /** - * Lookup297: evm_core::error::ExitSucceed + * Lookup299: evm_core::error::ExitSucceed **/ EvmCoreErrorExitSucceed: { _enum: ['Stopped', 'Returned', 'Suicided'] }, /** - * Lookup298: evm_core::error::ExitError + * Lookup300: evm_core::error::ExitError **/ EvmCoreErrorExitError: { _enum: { @@ -2445,13 +2458,13 @@ export default { } }, /** - * Lookup301: evm_core::error::ExitRevert + * Lookup303: evm_core::error::ExitRevert **/ EvmCoreErrorExitRevert: { _enum: ['Reverted'] }, /** - * Lookup302: evm_core::error::ExitFatal + * Lookup304: evm_core::error::ExitFatal **/ EvmCoreErrorExitFatal: { _enum: { @@ -2462,7 +2475,7 @@ export default { } }, /** - * Lookup303: frame_system::Phase + * Lookup305: frame_system::Phase **/ FrameSystemPhase: { _enum: { @@ -2472,14 +2485,14 @@ export default { } }, /** - * Lookup305: frame_system::LastRuntimeUpgradeInfo + * Lookup307: frame_system::LastRuntimeUpgradeInfo **/ FrameSystemLastRuntimeUpgradeInfo: { specVersion: 'Compact', specName: 'Text' }, /** - * Lookup306: frame_system::limits::BlockWeights + * Lookup308: frame_system::limits::BlockWeights **/ FrameSystemLimitsBlockWeights: { baseBlock: 'u64', @@ -2487,7 +2500,7 @@ export default { perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass' }, /** - * Lookup307: frame_support::weights::PerDispatchClass + * Lookup309: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassWeightsPerClass: { normal: 'FrameSystemLimitsWeightsPerClass', @@ -2495,7 +2508,7 @@ export default { mandatory: 'FrameSystemLimitsWeightsPerClass' }, /** - * Lookup308: frame_system::limits::WeightsPerClass + * Lookup310: frame_system::limits::WeightsPerClass **/ FrameSystemLimitsWeightsPerClass: { baseExtrinsic: 'u64', @@ -2504,13 +2517,13 @@ export default { reserved: 'Option' }, /** - * Lookup310: frame_system::limits::BlockLength + * Lookup311: frame_system::limits::BlockLength **/ FrameSystemLimitsBlockLength: { max: 'FrameSupportWeightsPerDispatchClassU32' }, /** - * Lookup311: frame_support::weights::PerDispatchClass + * Lookup312: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassU32: { normal: 'u32', @@ -2518,14 +2531,14 @@ export default { mandatory: 'u32' }, /** - * Lookup312: frame_support::weights::RuntimeDbWeight + * Lookup313: frame_support::weights::RuntimeDbWeight **/ FrameSupportWeightsRuntimeDbWeight: { read: 'u64', write: 'u64' }, /** - * Lookup313: sp_version::RuntimeVersion + * Lookup314: sp_version::RuntimeVersion **/ SpVersionRuntimeVersion: { specName: 'Text', @@ -2538,19 +2551,19 @@ export default { stateVersion: 'u8' }, /** - * Lookup317: frame_system::pallet::Error + * Lookup318: frame_system::pallet::Error **/ FrameSystemError: { _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] }, /** - * Lookup319: orml_vesting::module::Error + * Lookup320: orml_vesting::module::Error **/ OrmlVestingModuleError: { _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded'] }, /** - * Lookup321: cumulus_pallet_xcmp_queue::InboundChannelDetails + * Lookup322: cumulus_pallet_xcmp_queue::InboundChannelDetails **/ CumulusPalletXcmpQueueInboundChannelDetails: { sender: 'u32', @@ -2558,19 +2571,19 @@ export default { messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>' }, /** - * Lookup322: cumulus_pallet_xcmp_queue::InboundState + * Lookup323: cumulus_pallet_xcmp_queue::InboundState **/ CumulusPalletXcmpQueueInboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup325: polkadot_parachain::primitives::XcmpMessageFormat + * Lookup326: polkadot_parachain::primitives::XcmpMessageFormat **/ PolkadotParachainPrimitivesXcmpMessageFormat: { _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals'] }, /** - * Lookup328: cumulus_pallet_xcmp_queue::OutboundChannelDetails + * Lookup329: cumulus_pallet_xcmp_queue::OutboundChannelDetails **/ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: 'u32', @@ -2580,13 +2593,13 @@ export default { lastIndex: 'u16' }, /** - * Lookup329: cumulus_pallet_xcmp_queue::OutboundState + * Lookup330: cumulus_pallet_xcmp_queue::OutboundState **/ CumulusPalletXcmpQueueOutboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup331: cumulus_pallet_xcmp_queue::QueueConfigData + * Lookup332: cumulus_pallet_xcmp_queue::QueueConfigData **/ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: 'u32', @@ -2597,29 +2610,29 @@ export default { xcmpMaxIndividualWeight: 'u64' }, /** - * Lookup333: cumulus_pallet_xcmp_queue::pallet::Error + * Lookup334: cumulus_pallet_xcmp_queue::pallet::Error **/ CumulusPalletXcmpQueueError: { _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit'] }, /** - * Lookup334: pallet_xcm::pallet::Error + * Lookup335: pallet_xcm::pallet::Error **/ PalletXcmError: { _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed'] }, /** - * Lookup335: cumulus_pallet_xcm::pallet::Error + * Lookup336: cumulus_pallet_xcm::pallet::Error **/ CumulusPalletXcmError: 'Null', /** - * Lookup336: cumulus_pallet_dmp_queue::ConfigData + * Lookup337: cumulus_pallet_dmp_queue::ConfigData **/ CumulusPalletDmpQueueConfigData: { maxIndividual: 'u64' }, /** - * Lookup337: cumulus_pallet_dmp_queue::PageIndexData + * Lookup338: cumulus_pallet_dmp_queue::PageIndexData **/ CumulusPalletDmpQueuePageIndexData: { beginUsed: 'u32', @@ -2627,19 +2640,19 @@ export default { overweightCount: 'u64' }, /** - * Lookup340: cumulus_pallet_dmp_queue::pallet::Error + * Lookup341: cumulus_pallet_dmp_queue::pallet::Error **/ CumulusPalletDmpQueueError: { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup344: pallet_unique::Error + * Lookup345: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup347: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> + * Lookup348: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> **/ PalletUniqueSchedulerScheduledV3: { maybeId: 'Option<[u8;16]>', @@ -2649,7 +2662,7 @@ export default { origin: 'OpalRuntimeOriginCaller' }, /** - * Lookup348: opal_runtime::OriginCaller + * Lookup349: opal_runtime::OriginCaller **/ OpalRuntimeOriginCaller: { _enum: { @@ -2758,7 +2771,7 @@ export default { } }, /** - * Lookup349: frame_support::dispatch::RawOrigin + * Lookup350: frame_support::dispatch::RawOrigin **/ FrameSupportDispatchRawOrigin: { _enum: { @@ -2768,7 +2781,7 @@ export default { } }, /** - * Lookup350: pallet_xcm::pallet::Origin + * Lookup351: pallet_xcm::pallet::Origin **/ PalletXcmOrigin: { _enum: { @@ -2777,7 +2790,7 @@ export default { } }, /** - * Lookup351: cumulus_pallet_xcm::pallet::Origin + * Lookup352: cumulus_pallet_xcm::pallet::Origin **/ CumulusPalletXcmOrigin: { _enum: { @@ -2786,7 +2799,7 @@ export default { } }, /** - * Lookup352: pallet_ethereum::RawOrigin + * Lookup353: pallet_ethereum::RawOrigin **/ PalletEthereumRawOrigin: { _enum: { @@ -2794,17 +2807,17 @@ export default { } }, /** - * Lookup353: sp_core::Void + * Lookup354: sp_core::Void **/ SpCoreVoid: 'Null', /** - * Lookup354: pallet_unique_scheduler::pallet::Error + * Lookup355: pallet_unique_scheduler::pallet::Error **/ PalletUniqueSchedulerError: { _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] }, /** - * Lookup355: up_data_structs::Collection + * Lookup356: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -2818,7 +2831,7 @@ export default { externalCollection: 'bool' }, /** - * Lookup356: up_data_structs::SponsorshipState + * Lookup357: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipState: { _enum: { @@ -2828,7 +2841,7 @@ export default { } }, /** - * Lookup357: up_data_structs::Properties + * Lookup358: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -2836,15 +2849,15 @@ export default { spaceLimit: 'u32' }, /** - * Lookup358: up_data_structs::PropertiesMap> + * Lookup359: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** - * Lookup363: up_data_structs::PropertiesMap + * Lookup364: up_data_structs::PropertiesMap **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup370: up_data_structs::CollectionStats + * Lookup371: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -2852,18 +2865,18 @@ export default { alive: 'u32' }, /** - * Lookup371: up_data_structs::TokenChild + * Lookup372: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup372: PhantomType::up_data_structs + * Lookup373: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup374: up_data_structs::TokenData> + * Lookup375: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -2871,7 +2884,7 @@ export default { pieces: 'u128' }, /** - * Lookup376: up_data_structs::RpcCollection + * Lookup377: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -2887,7 +2900,7 @@ export default { readOnly: 'bool' }, /** - * Lookup377: rmrk_traits::collection::CollectionInfo, frame_support::storage::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup378: rmrk_traits::collection::CollectionInfo, frame_support::storage::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -2897,7 +2910,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup378: rmrk_traits::nft::NftInfo> + * Lookup379: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -2907,14 +2920,14 @@ export default { pending: 'bool' }, /** - * Lookup380: rmrk_traits::nft::RoyaltyInfo + * Lookup381: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup381: rmrk_traits::resource::ResourceInfo, frame_support::storage::bounded_vec::BoundedVec> + * Lookup382: rmrk_traits::resource::ResourceInfo, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -2923,14 +2936,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup382: rmrk_traits::property::PropertyInfo, frame_support::storage::bounded_vec::BoundedVec> + * Lookup383: rmrk_traits::property::PropertyInfo, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup383: rmrk_traits::base::BaseInfo> + * Lookup384: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -2938,80 +2951,80 @@ export default { symbol: 'Bytes' }, /** - * Lookup384: rmrk_traits::nft::NftChild + * Lookup385: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup386: pallet_common::pallet::Error + * Lookup387: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup388: pallet_fungible::pallet::Error + * Lookup389: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup389: pallet_refungible::ItemData + * Lookup390: pallet_refungible::ItemData **/ PalletRefungibleItemData: { constData: 'Bytes' }, /** - * Lookup394: pallet_refungible::pallet::Error + * Lookup395: pallet_refungible::pallet::Error **/ PalletRefungibleError: { _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup395: pallet_nonfungible::ItemData> + * Lookup396: pallet_nonfungible::ItemData> **/ PalletNonfungibleItemData: { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup397: up_data_structs::PropertyScope + * Lookup398: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { _enum: ['None', 'Rmrk', 'Eth'] }, /** - * Lookup399: pallet_nonfungible::pallet::Error + * Lookup400: pallet_nonfungible::pallet::Error **/ PalletNonfungibleError: { _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup400: pallet_structure::pallet::Error + * Lookup401: pallet_structure::pallet::Error **/ PalletStructureError: { _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup401: pallet_rmrk_core::pallet::Error + * Lookup402: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** - * Lookup403: pallet_rmrk_equip::pallet::Error + * Lookup404: pallet_rmrk_equip::pallet::Error **/ PalletRmrkEquipError: { _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] }, /** - * Lookup406: pallet_evm::pallet::Error + * Lookup407: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup409: fp_rpc::TransactionStatus + * Lookup410: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -3023,11 +3036,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup411: ethbloom::Bloom + * Lookup412: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup413: ethereum::receipt::ReceiptV3 + * Lookup414: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -3037,7 +3050,7 @@ export default { } }, /** - * Lookup414: ethereum::receipt::EIP658ReceiptData + * Lookup415: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -3046,7 +3059,7 @@ export default { logs: 'Vec' }, /** - * Lookup415: ethereum::block::Block + * Lookup416: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -3054,7 +3067,7 @@ export default { ommers: 'Vec' }, /** - * Lookup416: ethereum::header::Header + * Lookup417: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -3074,41 +3087,41 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup417: ethereum_types::hash::H64 + * Lookup418: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup422: pallet_ethereum::pallet::Error + * Lookup423: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup423: pallet_evm_coder_substrate::pallet::Error + * Lookup424: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup424: pallet_evm_contract_helpers::SponsoringModeT + * Lookup425: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup426: pallet_evm_contract_helpers::pallet::Error + * Lookup427: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission'] }, /** - * Lookup427: pallet_evm_migration::pallet::Error + * Lookup428: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup429: sp_runtime::MultiSignature + * Lookup430: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3118,43 +3131,43 @@ export default { } }, /** - * Lookup430: sp_core::ed25519::Signature + * Lookup431: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup432: sp_core::sr25519::Signature + * Lookup433: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup433: sp_core::ecdsa::Signature + * Lookup434: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup436: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup437: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup437: frame_system::extensions::check_genesis::CheckGenesis + * Lookup438: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup440: frame_system::extensions::check_nonce::CheckNonce + * Lookup441: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup441: frame_system::extensions::check_weight::CheckWeight + * Lookup442: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup442: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup443: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup443: opal_runtime::Runtime + * Lookup444: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup444: pallet_ethereum::FakeTransactionFinalizer + * Lookup445: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index b6412bdcc2..43f43b59b8 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { export interface InterfaceTypes { @@ -89,6 +89,7 @@ declare module '@polkadot/types/types/registry' { PalletBalancesReserveData: PalletBalancesReserveData; PalletCommonError: PalletCommonError; PalletCommonEvent: PalletCommonEvent; + PalletConfigurationCall: PalletConfigurationCall; PalletEthereumCall: PalletEthereumCall; PalletEthereumError: PalletEthereumError; PalletEthereumEvent: PalletEthereumEvent; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 368e2f8f94..4c0da06805 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1697,13 +1697,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'Value' | 'Hash'; } - /** @name PalletTemplateTransactionPaymentCall (207) */ + /** @name PalletConfigurationCall (207) */ + export interface PalletConfigurationCall extends Enum { + readonly isSetWeightToFeeCoefficientOverride: boolean; + readonly asSetWeightToFeeCoefficientOverride: { + readonly coeff: Option; + } & Struct; + readonly isSetMinGasPriceOverride: boolean; + readonly asSetMinGasPriceOverride: { + readonly coeff: Option; + } & Struct; + readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride'; + } + + /** @name PalletTemplateTransactionPaymentCall (209) */ export type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletStructureCall (208) */ + /** @name PalletStructureCall (210) */ export type PalletStructureCall = Null; - /** @name PalletRmrkCoreCall (209) */ + /** @name PalletRmrkCoreCall (211) */ export interface PalletRmrkCoreCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -1809,7 +1822,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; } - /** @name RmrkTraitsResourceResourceTypes (215) */ + /** @name RmrkTraitsResourceResourceTypes (217) */ export interface RmrkTraitsResourceResourceTypes extends Enum { readonly isBasic: boolean; readonly asBasic: RmrkTraitsResourceBasicResource; @@ -1820,7 +1833,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Basic' | 'Composable' | 'Slot'; } - /** @name RmrkTraitsResourceBasicResource (217) */ + /** @name RmrkTraitsResourceBasicResource (219) */ export interface RmrkTraitsResourceBasicResource extends Struct { readonly src: Option; readonly metadata: Option; @@ -1828,7 +1841,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceComposableResource (219) */ + /** @name RmrkTraitsResourceComposableResource (221) */ export interface RmrkTraitsResourceComposableResource extends Struct { readonly parts: Vec; readonly base: u32; @@ -1838,7 +1851,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceSlotResource (220) */ + /** @name RmrkTraitsResourceSlotResource (222) */ export interface RmrkTraitsResourceSlotResource extends Struct { readonly base: u32; readonly src: Option; @@ -1848,7 +1861,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (222) */ + /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (224) */ export interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { readonly isAccountId: boolean; readonly asAccountId: AccountId32; @@ -1857,7 +1870,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'AccountId' | 'CollectionAndNftTuple'; } - /** @name PalletRmrkEquipCall (226) */ + /** @name PalletRmrkEquipCall (228) */ export interface PalletRmrkEquipCall extends Enum { readonly isCreateBase: boolean; readonly asCreateBase: { @@ -1879,7 +1892,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; } - /** @name RmrkTraitsPartPartType (229) */ + /** @name RmrkTraitsPartPartType (231) */ export interface RmrkTraitsPartPartType extends Enum { readonly isFixedPart: boolean; readonly asFixedPart: RmrkTraitsPartFixedPart; @@ -1888,14 +1901,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'FixedPart' | 'SlotPart'; } - /** @name RmrkTraitsPartFixedPart (231) */ + /** @name RmrkTraitsPartFixedPart (233) */ export interface RmrkTraitsPartFixedPart extends Struct { readonly id: u32; readonly z: u32; readonly src: Bytes; } - /** @name RmrkTraitsPartSlotPart (232) */ + /** @name RmrkTraitsPartSlotPart (234) */ export interface RmrkTraitsPartSlotPart extends Struct { readonly id: u32; readonly equippable: RmrkTraitsPartEquippableList; @@ -1903,7 +1916,7 @@ declare module '@polkadot/types/lookup' { readonly z: u32; } - /** @name RmrkTraitsPartEquippableList (233) */ + /** @name RmrkTraitsPartEquippableList (235) */ export interface RmrkTraitsPartEquippableList extends Enum { readonly isAll: boolean; readonly isEmpty: boolean; @@ -1912,20 +1925,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'All' | 'Empty' | 'Custom'; } - /** @name RmrkTraitsTheme (235) */ + /** @name RmrkTraitsTheme (237) */ export interface RmrkTraitsTheme extends Struct { readonly name: Bytes; readonly properties: Vec; readonly inherit: bool; } - /** @name RmrkTraitsThemeThemeProperty (237) */ + /** @name RmrkTraitsThemeThemeProperty (239) */ export interface RmrkTraitsThemeThemeProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name PalletEvmCall (239) */ + /** @name PalletEvmCall (241) */ export interface PalletEvmCall extends Enum { readonly isWithdraw: boolean; readonly asWithdraw: { @@ -1970,7 +1983,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name PalletEthereumCall (245) */ + /** @name PalletEthereumCall (247) */ export interface PalletEthereumCall extends Enum { readonly isTransact: boolean; readonly asTransact: { @@ -1979,7 +1992,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transact'; } - /** @name EthereumTransactionTransactionV2 (246) */ + /** @name EthereumTransactionTransactionV2 (248) */ export interface EthereumTransactionTransactionV2 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumTransactionLegacyTransaction; @@ -1990,7 +2003,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumTransactionLegacyTransaction (247) */ + /** @name EthereumTransactionLegacyTransaction (249) */ export interface EthereumTransactionLegacyTransaction extends Struct { readonly nonce: U256; readonly gasPrice: U256; @@ -2001,7 +2014,7 @@ declare module '@polkadot/types/lookup' { readonly signature: EthereumTransactionTransactionSignature; } - /** @name EthereumTransactionTransactionAction (248) */ + /** @name EthereumTransactionTransactionAction (250) */ export interface EthereumTransactionTransactionAction extends Enum { readonly isCall: boolean; readonly asCall: H160; @@ -2009,14 +2022,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Call' | 'Create'; } - /** @name EthereumTransactionTransactionSignature (249) */ + /** @name EthereumTransactionTransactionSignature (251) */ export interface EthereumTransactionTransactionSignature extends Struct { readonly v: u64; readonly r: H256; readonly s: H256; } - /** @name EthereumTransactionEip2930Transaction (251) */ + /** @name EthereumTransactionEip2930Transaction (253) */ export interface EthereumTransactionEip2930Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -2031,13 +2044,13 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name EthereumTransactionAccessListItem (253) */ + /** @name EthereumTransactionAccessListItem (255) */ export interface EthereumTransactionAccessListItem extends Struct { readonly address: H160; readonly storageKeys: Vec; } - /** @name EthereumTransactionEip1559Transaction (254) */ + /** @name EthereumTransactionEip1559Transaction (256) */ export interface EthereumTransactionEip1559Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -2053,7 +2066,7 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name PalletEvmMigrationCall (255) */ + /** @name PalletEvmMigrationCall (257) */ export interface PalletEvmMigrationCall extends Enum { readonly isBegin: boolean; readonly asBegin: { @@ -2072,7 +2085,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Begin' | 'SetData' | 'Finish'; } - /** @name PalletSudoEvent (258) */ + /** @name PalletSudoEvent (260) */ export interface PalletSudoEvent extends Enum { readonly isSudid: boolean; readonly asSudid: { @@ -2089,7 +2102,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone'; } - /** @name SpRuntimeDispatchError (260) */ + /** @name SpRuntimeDispatchError (262) */ export interface SpRuntimeDispatchError extends Enum { readonly isOther: boolean; readonly isCannotLookup: boolean; @@ -2108,13 +2121,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional'; } - /** @name SpRuntimeModuleError (261) */ + /** @name SpRuntimeModuleError (263) */ export interface SpRuntimeModuleError extends Struct { readonly index: u8; readonly error: U8aFixed; } - /** @name SpRuntimeTokenError (262) */ + /** @name SpRuntimeTokenError (264) */ export interface SpRuntimeTokenError extends Enum { readonly isNoFunds: boolean; readonly isWouldDie: boolean; @@ -2126,7 +2139,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported'; } - /** @name SpRuntimeArithmeticError (263) */ + /** @name SpRuntimeArithmeticError (265) */ export interface SpRuntimeArithmeticError extends Enum { readonly isUnderflow: boolean; readonly isOverflow: boolean; @@ -2134,20 +2147,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero'; } - /** @name SpRuntimeTransactionalError (264) */ + /** @name SpRuntimeTransactionalError (266) */ export interface SpRuntimeTransactionalError extends Enum { readonly isLimitReached: boolean; readonly isNoLayer: boolean; readonly type: 'LimitReached' | 'NoLayer'; } - /** @name PalletSudoError (265) */ + /** @name PalletSudoError (267) */ export interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: 'RequireSudo'; } - /** @name FrameSystemAccountInfo (266) */ + /** @name FrameSystemAccountInfo (268) */ export interface FrameSystemAccountInfo extends Struct { readonly nonce: u32; readonly consumers: u32; @@ -2156,19 +2169,19 @@ declare module '@polkadot/types/lookup' { readonly data: PalletBalancesAccountData; } - /** @name FrameSupportWeightsPerDispatchClassU64 (267) */ + /** @name FrameSupportWeightsPerDispatchClassU64 (269) */ export interface FrameSupportWeightsPerDispatchClassU64 extends Struct { readonly normal: u64; readonly operational: u64; readonly mandatory: u64; } - /** @name SpRuntimeDigest (268) */ + /** @name SpRuntimeDigest (270) */ export interface SpRuntimeDigest extends Struct { readonly logs: Vec; } - /** @name SpRuntimeDigestDigestItem (270) */ + /** @name SpRuntimeDigestDigestItem (272) */ export interface SpRuntimeDigestDigestItem extends Enum { readonly isOther: boolean; readonly asOther: Bytes; @@ -2182,14 +2195,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated'; } - /** @name FrameSystemEventRecord (272) */ + /** @name FrameSystemEventRecord (274) */ export interface FrameSystemEventRecord extends Struct { readonly phase: FrameSystemPhase; readonly event: Event; readonly topics: Vec; } - /** @name FrameSystemEvent (274) */ + /** @name FrameSystemEvent (276) */ export interface FrameSystemEvent extends Enum { readonly isExtrinsicSuccess: boolean; readonly asExtrinsicSuccess: { @@ -2217,14 +2230,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked'; } - /** @name FrameSupportWeightsDispatchInfo (275) */ + /** @name FrameSupportWeightsDispatchInfo (277) */ export interface FrameSupportWeightsDispatchInfo extends Struct { readonly weight: u64; readonly class: FrameSupportWeightsDispatchClass; readonly paysFee: FrameSupportWeightsPays; } - /** @name FrameSupportWeightsDispatchClass (276) */ + /** @name FrameSupportWeightsDispatchClass (278) */ export interface FrameSupportWeightsDispatchClass extends Enum { readonly isNormal: boolean; readonly isOperational: boolean; @@ -2232,14 +2245,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Normal' | 'Operational' | 'Mandatory'; } - /** @name FrameSupportWeightsPays (277) */ + /** @name FrameSupportWeightsPays (279) */ export interface FrameSupportWeightsPays extends Enum { readonly isYes: boolean; readonly isNo: boolean; readonly type: 'Yes' | 'No'; } - /** @name OrmlVestingModuleEvent (278) */ + /** @name OrmlVestingModuleEvent (280) */ export interface OrmlVestingModuleEvent extends Enum { readonly isVestingScheduleAdded: boolean; readonly asVestingScheduleAdded: { @@ -2259,7 +2272,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated'; } - /** @name CumulusPalletXcmpQueueEvent (279) */ + /** @name CumulusPalletXcmpQueueEvent (281) */ export interface CumulusPalletXcmpQueueEvent extends Enum { readonly isSuccess: boolean; readonly asSuccess: Option; @@ -2280,7 +2293,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name PalletXcmEvent (280) */ + /** @name PalletXcmEvent (282) */ export interface PalletXcmEvent extends Enum { readonly isAttempted: boolean; readonly asAttempted: XcmV2TraitsOutcome; @@ -2317,7 +2330,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail'; } - /** @name XcmV2TraitsOutcome (281) */ + /** @name XcmV2TraitsOutcome (283) */ export interface XcmV2TraitsOutcome extends Enum { readonly isComplete: boolean; readonly asComplete: u64; @@ -2328,7 +2341,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Complete' | 'Incomplete' | 'Error'; } - /** @name CumulusPalletXcmEvent (283) */ + /** @name CumulusPalletXcmEvent (285) */ export interface CumulusPalletXcmEvent extends Enum { readonly isInvalidFormat: boolean; readonly asInvalidFormat: U8aFixed; @@ -2339,7 +2352,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; } - /** @name CumulusPalletDmpQueueEvent (284) */ + /** @name CumulusPalletDmpQueueEvent (286) */ export interface CumulusPalletDmpQueueEvent extends Enum { readonly isInvalidFormat: boolean; readonly asInvalidFormat: { @@ -2374,7 +2387,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name PalletUniqueRawEvent (285) */ + /** @name PalletUniqueRawEvent (287) */ export interface PalletUniqueRawEvent extends Enum { readonly isCollectionSponsorRemoved: boolean; readonly asCollectionSponsorRemoved: u32; @@ -2399,7 +2412,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet'; } - /** @name PalletUniqueSchedulerEvent (286) */ + /** @name PalletUniqueSchedulerEvent (288) */ export interface PalletUniqueSchedulerEvent extends Enum { readonly isScheduled: boolean; readonly asScheduled: { @@ -2426,14 +2439,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; } - /** @name FrameSupportScheduleLookupError (288) */ + /** @name FrameSupportScheduleLookupError (290) */ export interface FrameSupportScheduleLookupError extends Enum { readonly isUnknown: boolean; readonly isBadFormat: boolean; readonly type: 'Unknown' | 'BadFormat'; } - /** @name PalletCommonEvent (289) */ + /** @name PalletCommonEvent (291) */ export interface PalletCommonEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; @@ -2460,14 +2473,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; } - /** @name PalletStructureEvent (290) */ + /** @name PalletStructureEvent (292) */ export interface PalletStructureEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: Result; readonly type: 'Executed'; } - /** @name PalletRmrkCoreEvent (291) */ + /** @name PalletRmrkCoreEvent (293) */ export interface PalletRmrkCoreEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: { @@ -2557,7 +2570,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; } - /** @name PalletRmrkEquipEvent (292) */ + /** @name PalletRmrkEquipEvent (294) */ export interface PalletRmrkEquipEvent extends Enum { readonly isBaseCreated: boolean; readonly asBaseCreated: { @@ -2572,7 +2585,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BaseCreated' | 'EquippablesUpdated'; } - /** @name PalletEvmEvent (293) */ + /** @name PalletEvmEvent (295) */ export interface PalletEvmEvent extends Enum { readonly isLog: boolean; readonly asLog: EthereumLog; @@ -2591,21 +2604,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; } - /** @name EthereumLog (294) */ + /** @name EthereumLog (296) */ export interface EthereumLog extends Struct { readonly address: H160; readonly topics: Vec; readonly data: Bytes; } - /** @name PalletEthereumEvent (295) */ + /** @name PalletEthereumEvent (297) */ export interface PalletEthereumEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; readonly type: 'Executed'; } - /** @name EvmCoreErrorExitReason (296) */ + /** @name EvmCoreErrorExitReason (298) */ export interface EvmCoreErrorExitReason extends Enum { readonly isSucceed: boolean; readonly asSucceed: EvmCoreErrorExitSucceed; @@ -2618,7 +2631,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; } - /** @name EvmCoreErrorExitSucceed (297) */ + /** @name EvmCoreErrorExitSucceed (299) */ export interface EvmCoreErrorExitSucceed extends Enum { readonly isStopped: boolean; readonly isReturned: boolean; @@ -2626,7 +2639,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Stopped' | 'Returned' | 'Suicided'; } - /** @name EvmCoreErrorExitError (298) */ + /** @name EvmCoreErrorExitError (300) */ export interface EvmCoreErrorExitError extends Enum { readonly isStackUnderflow: boolean; readonly isStackOverflow: boolean; @@ -2647,13 +2660,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; } - /** @name EvmCoreErrorExitRevert (301) */ + /** @name EvmCoreErrorExitRevert (303) */ export interface EvmCoreErrorExitRevert extends Enum { readonly isReverted: boolean; readonly type: 'Reverted'; } - /** @name EvmCoreErrorExitFatal (302) */ + /** @name EvmCoreErrorExitFatal (304) */ export interface EvmCoreErrorExitFatal extends Enum { readonly isNotSupported: boolean; readonly isUnhandledInterrupt: boolean; @@ -2664,7 +2677,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; } - /** @name FrameSystemPhase (303) */ + /** @name FrameSystemPhase (305) */ export interface FrameSystemPhase extends Enum { readonly isApplyExtrinsic: boolean; readonly asApplyExtrinsic: u32; @@ -2673,27 +2686,27 @@ declare module '@polkadot/types/lookup' { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } - /** @name FrameSystemLastRuntimeUpgradeInfo (305) */ + /** @name FrameSystemLastRuntimeUpgradeInfo (307) */ export interface FrameSystemLastRuntimeUpgradeInfo extends Struct { readonly specVersion: Compact; readonly specName: Text; } - /** @name FrameSystemLimitsBlockWeights (306) */ + /** @name FrameSystemLimitsBlockWeights (308) */ export interface FrameSystemLimitsBlockWeights extends Struct { readonly baseBlock: u64; readonly maxBlock: u64; readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; } - /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (307) */ + /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (309) */ export interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { readonly normal: FrameSystemLimitsWeightsPerClass; readonly operational: FrameSystemLimitsWeightsPerClass; readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name FrameSystemLimitsWeightsPerClass (308) */ + /** @name FrameSystemLimitsWeightsPerClass (310) */ export interface FrameSystemLimitsWeightsPerClass extends Struct { readonly baseExtrinsic: u64; readonly maxExtrinsic: Option; @@ -2701,25 +2714,25 @@ declare module '@polkadot/types/lookup' { readonly reserved: Option; } - /** @name FrameSystemLimitsBlockLength (310) */ + /** @name FrameSystemLimitsBlockLength (311) */ export interface FrameSystemLimitsBlockLength extends Struct { readonly max: FrameSupportWeightsPerDispatchClassU32; } - /** @name FrameSupportWeightsPerDispatchClassU32 (311) */ + /** @name FrameSupportWeightsPerDispatchClassU32 (312) */ export interface FrameSupportWeightsPerDispatchClassU32 extends Struct { readonly normal: u32; readonly operational: u32; readonly mandatory: u32; } - /** @name FrameSupportWeightsRuntimeDbWeight (312) */ + /** @name FrameSupportWeightsRuntimeDbWeight (313) */ export interface FrameSupportWeightsRuntimeDbWeight extends Struct { readonly read: u64; readonly write: u64; } - /** @name SpVersionRuntimeVersion (313) */ + /** @name SpVersionRuntimeVersion (314) */ export interface SpVersionRuntimeVersion extends Struct { readonly specName: Text; readonly implName: Text; @@ -2731,7 +2744,7 @@ declare module '@polkadot/types/lookup' { readonly stateVersion: u8; } - /** @name FrameSystemError (317) */ + /** @name FrameSystemError (318) */ export interface FrameSystemError extends Enum { readonly isInvalidSpecName: boolean; readonly isSpecVersionNeedsToIncrease: boolean; @@ -2742,7 +2755,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name OrmlVestingModuleError (319) */ + /** @name OrmlVestingModuleError (320) */ export interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; @@ -2753,21 +2766,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (321) */ + /** @name CumulusPalletXcmpQueueInboundChannelDetails (322) */ export interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (322) */ + /** @name CumulusPalletXcmpQueueInboundState (323) */ export interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (325) */ + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (326) */ export interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; @@ -2775,7 +2788,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (328) */ + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (329) */ export interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; @@ -2784,14 +2797,14 @@ declare module '@polkadot/types/lookup' { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (329) */ + /** @name CumulusPalletXcmpQueueOutboundState (330) */ export interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (331) */ + /** @name CumulusPalletXcmpQueueQueueConfigData (332) */ export interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; @@ -2801,7 +2814,7 @@ declare module '@polkadot/types/lookup' { readonly xcmpMaxIndividualWeight: u64; } - /** @name CumulusPalletXcmpQueueError (333) */ + /** @name CumulusPalletXcmpQueueError (334) */ export interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; @@ -2811,7 +2824,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (334) */ + /** @name PalletXcmError (335) */ export interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; @@ -2829,29 +2842,29 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (335) */ + /** @name CumulusPalletXcmError (336) */ export type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (336) */ + /** @name CumulusPalletDmpQueueConfigData (337) */ export interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: u64; } - /** @name CumulusPalletDmpQueuePageIndexData (337) */ + /** @name CumulusPalletDmpQueuePageIndexData (338) */ export interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (340) */ + /** @name CumulusPalletDmpQueueError (341) */ export interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (344) */ + /** @name PalletUniqueError (345) */ export interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; @@ -2860,7 +2873,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name PalletUniqueSchedulerScheduledV3 (347) */ + /** @name PalletUniqueSchedulerScheduledV3 (348) */ export interface PalletUniqueSchedulerScheduledV3 extends Struct { readonly maybeId: Option; readonly priority: u8; @@ -2869,7 +2882,7 @@ declare module '@polkadot/types/lookup' { readonly origin: OpalRuntimeOriginCaller; } - /** @name OpalRuntimeOriginCaller (348) */ + /** @name OpalRuntimeOriginCaller (349) */ export interface OpalRuntimeOriginCaller extends Enum { readonly isVoid: boolean; readonly isSystem: boolean; @@ -2883,7 +2896,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Void' | 'System' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; } - /** @name FrameSupportDispatchRawOrigin (349) */ + /** @name FrameSupportDispatchRawOrigin (350) */ export interface FrameSupportDispatchRawOrigin extends Enum { readonly isRoot: boolean; readonly isSigned: boolean; @@ -2892,7 +2905,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Root' | 'Signed' | 'None'; } - /** @name PalletXcmOrigin (350) */ + /** @name PalletXcmOrigin (351) */ export interface PalletXcmOrigin extends Enum { readonly isXcm: boolean; readonly asXcm: XcmV1MultiLocation; @@ -2901,7 +2914,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Xcm' | 'Response'; } - /** @name CumulusPalletXcmOrigin (351) */ + /** @name CumulusPalletXcmOrigin (352) */ export interface CumulusPalletXcmOrigin extends Enum { readonly isRelay: boolean; readonly isSiblingParachain: boolean; @@ -2909,17 +2922,17 @@ declare module '@polkadot/types/lookup' { readonly type: 'Relay' | 'SiblingParachain'; } - /** @name PalletEthereumRawOrigin (352) */ + /** @name PalletEthereumRawOrigin (353) */ export interface PalletEthereumRawOrigin extends Enum { readonly isEthereumTransaction: boolean; readonly asEthereumTransaction: H160; readonly type: 'EthereumTransaction'; } - /** @name SpCoreVoid (353) */ + /** @name SpCoreVoid (354) */ export type SpCoreVoid = Null; - /** @name PalletUniqueSchedulerError (354) */ + /** @name PalletUniqueSchedulerError (355) */ export interface PalletUniqueSchedulerError extends Enum { readonly isFailedToSchedule: boolean; readonly isNotFound: boolean; @@ -2928,7 +2941,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; } - /** @name UpDataStructsCollection (355) */ + /** @name UpDataStructsCollection (356) */ export interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -2941,7 +2954,7 @@ declare module '@polkadot/types/lookup' { readonly externalCollection: bool; } - /** @name UpDataStructsSponsorshipState (356) */ + /** @name UpDataStructsSponsorshipState (357) */ export interface UpDataStructsSponsorshipState extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -2951,43 +2964,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (357) */ + /** @name UpDataStructsProperties (358) */ export interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (358) */ + /** @name UpDataStructsPropertiesMapBoundedVec (359) */ export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (363) */ + /** @name UpDataStructsPropertiesMapPropertyPermission (364) */ export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (370) */ + /** @name UpDataStructsCollectionStats (371) */ export interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (371) */ + /** @name UpDataStructsTokenChild (372) */ export interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (372) */ + /** @name PhantomTypeUpDataStructs (373) */ export interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (374) */ + /** @name UpDataStructsTokenData (375) */ export interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (376) */ + /** @name UpDataStructsRpcCollection (377) */ export interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3002,7 +3015,7 @@ declare module '@polkadot/types/lookup' { readonly readOnly: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (377) */ + /** @name RmrkTraitsCollectionCollectionInfo (378) */ export interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; @@ -3011,7 +3024,7 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (378) */ + /** @name RmrkTraitsNftNftInfo (379) */ export interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; @@ -3020,13 +3033,13 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (380) */ + /** @name RmrkTraitsNftRoyaltyInfo (381) */ export interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (381) */ + /** @name RmrkTraitsResourceResourceInfo (382) */ export interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; @@ -3034,26 +3047,26 @@ declare module '@polkadot/types/lookup' { readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (382) */ + /** @name RmrkTraitsPropertyPropertyInfo (383) */ export interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (383) */ + /** @name RmrkTraitsBaseBaseInfo (384) */ export interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (384) */ + /** @name RmrkTraitsNftNftChild (385) */ export interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (386) */ + /** @name PalletCommonError (387) */ export interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; @@ -3092,7 +3105,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (388) */ + /** @name PalletFungibleError (389) */ export interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; @@ -3102,12 +3115,12 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (389) */ + /** @name PalletRefungibleItemData (390) */ export interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } - /** @name PalletRefungibleError (394) */ + /** @name PalletRefungibleError (395) */ export interface PalletRefungibleError extends Enum { readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isWrongRefungiblePieces: boolean; @@ -3117,12 +3130,12 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletNonfungibleItemData (395) */ + /** @name PalletNonfungibleItemData (396) */ export interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (397) */ + /** @name UpDataStructsPropertyScope (398) */ export interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; @@ -3130,7 +3143,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'None' | 'Rmrk' | 'Eth'; } - /** @name PalletNonfungibleError (399) */ + /** @name PalletNonfungibleError (400) */ export interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; @@ -3138,7 +3151,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (400) */ + /** @name PalletStructureError (401) */ export interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; @@ -3147,7 +3160,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletRmrkCoreError (401) */ + /** @name PalletRmrkCoreError (402) */ export interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; @@ -3171,7 +3184,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } - /** @name PalletRmrkEquipError (403) */ + /** @name PalletRmrkEquipError (404) */ export interface PalletRmrkEquipError extends Enum { readonly isPermissionError: boolean; readonly isNoAvailableBaseId: boolean; @@ -3183,7 +3196,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; } - /** @name PalletEvmError (406) */ + /** @name PalletEvmError (407) */ export interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; @@ -3194,7 +3207,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (409) */ + /** @name FpRpcTransactionStatus (410) */ export interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; @@ -3205,10 +3218,10 @@ declare module '@polkadot/types/lookup' { readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (411) */ + /** @name EthbloomBloom (412) */ export interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (413) */ + /** @name EthereumReceiptReceiptV3 (414) */ export interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; @@ -3219,7 +3232,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (414) */ + /** @name EthereumReceiptEip658ReceiptData (415) */ export interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; @@ -3227,14 +3240,14 @@ declare module '@polkadot/types/lookup' { readonly logs: Vec; } - /** @name EthereumBlock (415) */ + /** @name EthereumBlock (416) */ export interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (416) */ + /** @name EthereumHeader (417) */ export interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; @@ -3253,24 +3266,24 @@ declare module '@polkadot/types/lookup' { readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (417) */ + /** @name EthereumTypesHashH64 (418) */ export interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (422) */ + /** @name PalletEthereumError (423) */ export interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (423) */ + /** @name PalletEvmCoderSubstrateError (424) */ export interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name PalletEvmContractHelpersSponsoringModeT (424) */ + /** @name PalletEvmContractHelpersSponsoringModeT (425) */ export interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; @@ -3278,20 +3291,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (426) */ + /** @name PalletEvmContractHelpersError (427) */ export interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly type: 'NoPermission'; } - /** @name PalletEvmMigrationError (427) */ + /** @name PalletEvmMigrationError (428) */ export interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (429) */ + /** @name SpRuntimeMultiSignature (430) */ export interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; @@ -3302,34 +3315,34 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (430) */ + /** @name SpCoreEd25519Signature (431) */ export interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (432) */ + /** @name SpCoreSr25519Signature (433) */ export interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (433) */ + /** @name SpCoreEcdsaSignature (434) */ export interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (436) */ + /** @name FrameSystemExtensionsCheckSpecVersion (437) */ export type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (437) */ + /** @name FrameSystemExtensionsCheckGenesis (438) */ export type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (440) */ + /** @name FrameSystemExtensionsCheckNonce (441) */ export interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (441) */ + /** @name FrameSystemExtensionsCheckWeight (442) */ export type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (442) */ + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (443) */ export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (443) */ + /** @name OpalRuntimeRuntime (444) */ export type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (444) */ + /** @name PalletEthereumFakeTransactionFinalizer (445) */ export type PalletEthereumFakeTransactionFinalizer = Null; } // declare module From dc26a3336f1b52fe11fb5646e2cd7173355e4cdb Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 15 Aug 2022 11:05:55 +0300 Subject: [PATCH 0378/1274] test: price calibration script Signed-off-by: Yaroslav Bolyukin --- tests/.eslintrc.json | 8 +- tests/src/calibrate.ts | 182 ++++++++++++++++++++++++++++++++++++ tests/src/calibrateApply.ts | 38 ++++++++ 3 files changed, 227 insertions(+), 1 deletion(-) create mode 100644 tests/src/calibrate.ts create mode 100644 tests/src/calibrateApply.ts diff --git a/tests/.eslintrc.json b/tests/.eslintrc.json index b7177976ae..cd5befb885 100644 --- a/tests/.eslintrc.json +++ b/tests/.eslintrc.json @@ -55,7 +55,13 @@ "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-unused-vars": "warn", + "@typescript-eslint/no-unused-vars": [ + "warn", + { + "varsIgnorePattern": "_.+", + "argsIgnorePattern": "_.+" + } + ], "no-async-promise-executor": "warn", "@typescript-eslint/no-empty-interface": "off", "prefer-const": [ diff --git a/tests/src/calibrate.ts b/tests/src/calibrate.ts new file mode 100644 index 0000000000..b2e85039e6 --- /dev/null +++ b/tests/src/calibrate.ts @@ -0,0 +1,182 @@ +import {ApiPromise} from '@polkadot/api'; +import {IKeyringPair} from '@polkadot/types/types'; +import Web3 from 'web3'; +import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, recordEthFee, usingWeb3} from './eth/util/helpers'; +import usingApi, {executeTransaction} from './substrate/substrate-api'; +import {createCollectionExpectSuccess, createItemExpectSuccess, transferExpectSuccess, UNIQUE, waitNewBlocks} from './util/helpers'; +import nonFungibleAbi from './eth/nonFungibleAbi.json'; + +function linearRegression(points: { x: bigint, y: bigint }[]) { + let sumxy = 0n; + let sumx = 0n; + let sumy = 0n; + let sumx2 = 0n; + const n = points.length; + for (let i = 0; i < n; i++) { + const p = points[i]; + sumxy += p.x * p.y; + sumx += p.x; + sumy += p.y; + sumx2 += p.x * p.x; + } + + const nb = BigInt(n); + + const a = (nb * sumxy - sumx * sumy) / (nb * sumx2 - sumx * sumx); + const b = (sumy - a * sumx) / nb; + + return {a, b}; +} + +// JS has no builtin function to calculate sqrt of bigint +// https://stackoverflow.com/a/53684036/6190169 +function sqrt(value: bigint) { + if (value < 0n) { + throw 'square root of negative numbers is not supported'; + } + + if (value < 2n) { + return value; + } + + function newtonIteration(n: bigint, x0: bigint): bigint { + const x1 = ((n / x0) + x0) >> 1n; + if (x0 === x1 || x0 === (x1 - 1n)) { + return x0; + } + return newtonIteration(n, x1); + } + + return newtonIteration(value, 1n); +} + +function _error(points: { x: bigint, y: bigint }[], hypothesis: (a: bigint) => bigint) { + return sqrt(points.map(p => { + const v = hypothesis(p.x); + const vv = p.y; + + return (v - vv) ** 2n; + }).reduce((a, b) => a + b, 0n) / BigInt(points.length)); +} + +async function calibrateWeightToFee(api: ApiPromise, privateKey: (account: string) => IKeyringPair) { + const alice = privateKey('//Alice'); + const bob = privateKey('//Bob'); + const dataPoints = []; + + { + const collectionId = await createCollectionExpectSuccess(); + const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT'); + const aliceBalanceBefore = (await api.query.system.account(alice.address)).data.free.toBigInt(); + await transferExpectSuccess(collectionId, tokenId, alice, bob, 1, 'NFT'); + const aliceBalanceAfter = (await api.query.system.account(alice.address)).data.free.toBigInt(); + + console.log(`Original price: ${Number(aliceBalanceBefore - aliceBalanceAfter) / Number(UNIQUE)} UNQ`); + } + + const defaultCoeff = (api.consts.configuration.defaultWeightToFeeCoefficient as any).toBigInt(); + for (let i = -5; i < 5; i++) { + await executeTransaction(api, alice, api.tx.sudo.sudo(api.tx.configuration.setWeightToFeeCoefficientOverride(defaultCoeff + defaultCoeff / 1000n * BigInt(i)))); + + const coefficient = (await api.query.configuration.weightToFeeCoefficientOverride() as any).toBigInt(); + const collectionId = await createCollectionExpectSuccess(); + const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT'); + + const aliceBalanceBefore = (await api.query.system.account(alice.address)).data.free.toBigInt(); + await transferExpectSuccess(collectionId, tokenId, alice, bob, 1, 'NFT'); + const aliceBalanceAfter = (await api.query.system.account(alice.address)).data.free.toBigInt(); + + const transferPrice = aliceBalanceBefore - aliceBalanceAfter; + + dataPoints.push({x: transferPrice, y: coefficient}); + } + const {a, b} = linearRegression(dataPoints); + + // console.log(`Error: ${error(dataPoints, x => a*x+b)}`); + + const perfectValue = a * UNIQUE / 10n + b; + await executeTransaction(api, alice, api.tx.sudo.sudo(api.tx.configuration.setWeightToFeeCoefficientOverride(perfectValue.toString()))); + + { + const collectionId = await createCollectionExpectSuccess(); + const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT'); + const aliceBalanceBefore = (await api.query.system.account(alice.address)).data.free.toBigInt(); + await transferExpectSuccess(collectionId, tokenId, alice, bob, 1, 'NFT'); + const aliceBalanceAfter = (await api.query.system.account(alice.address)).data.free.toBigInt(); + + console.log(`Calibrated price: ${Number(aliceBalanceBefore - aliceBalanceAfter) / Number(UNIQUE)} UNQ`); + } +} + +async function calibrateMinGasPrice(api: ApiPromise, web3: Web3, privateKey: (account: string) => IKeyringPair) { + const alice = privateKey('//Alice'); + const caller = await createEthAccountWithBalance(api, web3, privateKey); + const receiver = createEthAccount(web3); + const dataPoints = []; + + { + const collectionId = await createCollectionExpectSuccess(); + const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', {Ethereum: caller}); + + const address = collectionIdToAddress(collectionId); + const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + + const cost = await recordEthFee(api, caller, () => contract.methods.transfer(receiver, tokenId).send(caller)); + + console.log(`Original price: ${Number(cost) / Number(UNIQUE)} UNQ`); + } + + const defaultCoeff = (api.consts.configuration.defaultMinGasPrice as any).toBigInt(); + for (let i = -8; i < 8; i++) { + const gasPrice = defaultCoeff + defaultCoeff / 100000n * BigInt(i); + const gasPriceStr = '0x' + gasPrice.toString(16); + await executeTransaction(api, alice, api.tx.sudo.sudo(api.tx.configuration.setMinGasPriceOverride(gasPrice))); + + const coefficient = (await api.query.configuration.minGasPriceOverride() as any).toBigInt(); + const collectionId = await createCollectionExpectSuccess(); + const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', {Ethereum: caller}); + + const address = collectionIdToAddress(collectionId); + const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, gasPrice: gasPriceStr, ...GAS_ARGS}); + + const transferPrice = await recordEthFee(api, caller, () => contract.methods.transfer(receiver, tokenId).send(caller)); + + dataPoints.push({x: transferPrice, y: coefficient}); + } + + const {a, b} = linearRegression(dataPoints); + + // console.log(`Error: ${error(dataPoints, x => a*x+b)}`); + + // * 0.15 = * 10000 / 66666 + const perfectValue = a * UNIQUE * 1000000n / 6666666n + b; + await executeTransaction(api, alice, api.tx.sudo.sudo(api.tx.configuration.setMinGasPriceOverride(perfectValue.toString()))); + + { + const collectionId = await createCollectionExpectSuccess(); + const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', {Ethereum: caller}); + + const address = collectionIdToAddress(collectionId); + const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + + const cost = await recordEthFee(api, caller, () => contract.methods.transfer(receiver, tokenId).send(caller)); + + console.log(`Calibrated price: ${Number(cost) / Number(UNIQUE)} UNQ`); + } +} + +(async () => { + await usingApi(async (api, privateKey) => { + // Second run slightly reduces error sometimes, as price line is not actually straight, this is a curve + + await calibrateWeightToFee(api, privateKey); + await calibrateWeightToFee(api, privateKey); + + await usingWeb3(async web3 => { + await calibrateMinGasPrice(api, web3, privateKey); + await calibrateMinGasPrice(api, web3, privateKey); + }); + + await api.disconnect(); + }); +})(); diff --git a/tests/src/calibrateApply.ts b/tests/src/calibrateApply.ts new file mode 100644 index 0000000000..b6566ad7db --- /dev/null +++ b/tests/src/calibrateApply.ts @@ -0,0 +1,38 @@ +import {readFile, writeFile} from 'fs/promises'; +import path from 'path'; +import usingApi from './substrate/substrate-api'; + +const formatNumber = (num: string): string => num.split('').reverse().join('').replace(/([0-9]{3})/g, '$1_').split('').reverse().join('').replace(/^_/, ''); + +(async () => { + let weightToFeeCoefficientOverride: string; + let minGasPriceOverride: string; + await usingApi(async (api, _privateKey) => { + weightToFeeCoefficientOverride = (await api.query.configuration.weightToFeeCoefficientOverride() as any).toBigInt().toString(); + minGasPriceOverride = (await api.query.configuration.minGasPriceOverride() as any).toBigInt().toString(); + }); + const constantsFile = path.resolve(__dirname, '../../primitives/common/src/constants.rs'); + let constants = (await readFile(constantsFile)).toString(); + + let weight2feeFound = false; + constants = constants.replace(/(\/\*\*\/)[0-9_]+(\/\*<\/weight2fee>\*\/)/, (_f, p, s) => { + weight2feeFound = true; + return p+formatNumber(weightToFeeCoefficientOverride)+s; + }); + if (!weight2feeFound) { + throw new Error('failed to find weight2fee marker in source code'); + } + + let minGasPriceFound = false; + constants = constants.replace(/(\/\*\*\/)[0-9_]+(\/\*<\/mingasprice>\*\/)/, (_f, p, s) => { + minGasPriceFound = true; + return p+formatNumber(minGasPriceOverride)+s; + }); + if (!minGasPriceFound) { + throw new Error('failed to find mingasprice marker in source code'); + } + + await writeFile(constantsFile, constants); +})().catch(e => { + console.log(e.stack); +}); From 996c95ef8a6632cb7b2b763e770fbd4d5e46a44c Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 15 Aug 2022 11:06:17 +0300 Subject: [PATCH 0379/1274] chore: run price calibration Signed-off-by: Yaroslav Bolyukin --- Cargo.lock | 19 +++++++++++++++++-- primitives/common/src/constants.rs | 4 ++-- tests/src/eth/base.test.ts | 18 +++++++++--------- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a30d45a75..e284cfa709 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5309,6 +5309,7 @@ dependencies = [ "pallet-balances", "pallet-base-fee", "pallet-common", + "pallet-configuration", "pallet-ethereum", "pallet-evm", "pallet-evm-coder-substrate", @@ -5338,9 +5339,7 @@ dependencies = [ "rmrk-rpc", "scale-info", "serde", - "smallvec", "sp-api", - "sp-arithmetic", "sp-block-builder", "sp-consensus-aura", "sp-core", @@ -5743,6 +5742,22 @@ dependencies = [ "up-data-structs", ] +[[package]] +name = "pallet-configuration" +version = "0.1.0" +dependencies = [ + "fp-evm", + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "smallvec", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-democracy" version = "4.0.0-dev" diff --git a/primitives/common/src/constants.rs b/primitives/common/src/constants.rs index edbf3ebb76..1a8575f670 100644 --- a/primitives/common/src/constants.rs +++ b/primitives/common/src/constants.rs @@ -36,10 +36,10 @@ pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE; pub const UNIQUE: Balance = 100 * CENTIUNIQUE; // Targeting 0.1 UNQ per transfer -pub const WEIGHT_TO_FEE_COEFF: u32 = /**/207_890_902/**/; +pub const WEIGHT_TO_FEE_COEFF: u32 = /**/207_267_232/**/; // Targeting 0.15 UNQ per transfer via ETH -pub const MIN_GAS_PRICE: u64 = /**/1_019_493_469_850/**/; +pub const MIN_GAS_PRICE: u64 = /**/1_019_488_372_383/**/; /// We assume that ~10% of the block weight is consumed by `on_initalize` handlers. /// This is used to limit the maximal weight of a single extrinsic. diff --git a/tests/src/eth/base.test.ts b/tests/src/eth/base.test.ts index 3fff286af8..d7a4a96f26 100644 --- a/tests/src/eth/base.test.ts +++ b/tests/src/eth/base.test.ts @@ -15,14 +15,14 @@ // along with Unique Network. If not, see . import { - collectionIdToAddress, - createEthAccount, - createEthAccountWithBalance, - deployFlipper, - ethBalanceViaSub, - GAS_ARGS, - itWeb3, - recordEthFee, + collectionIdToAddress, + createEthAccount, + createEthAccountWithBalance, + deployFlipper, + ethBalanceViaSub, + GAS_ARGS, + itWeb3, + recordEthFee, usingWeb3, } from './util/helpers'; import {expect} from 'chai'; @@ -66,7 +66,7 @@ describe('Contract calls', () => { const fee = Number(cost) / Number(UNIQUE); const expectedFee = 0.15; - const tolerance = 0.00002; + const tolerance = 0.001; expect(Math.abs(fee - expectedFee)).to.be.lessThan(tolerance); }); From dfb31491c2fc76efbeee69530cb08f99294a61d6 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 15 Aug 2022 17:25:05 +0300 Subject: [PATCH 0380/1274] build: regenerate lockfile Signed-off-by: Yaroslav Bolyukin --- Cargo.lock | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index e284cfa709..ed3bc9c0df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5339,7 +5339,9 @@ dependencies = [ "rmrk-rpc", "scale-info", "serde", + "smallvec", "sp-api", + "sp-arithmetic", "sp-block-builder", "sp-consensus-aura", "sp-core", @@ -8640,6 +8642,7 @@ dependencies = [ "pallet-balances", "pallet-base-fee", "pallet-common", + "pallet-configuration", "pallet-ethereum", "pallet-evm", "pallet-evm-coder-substrate", @@ -12645,6 +12648,7 @@ dependencies = [ "pallet-balances", "pallet-base-fee", "pallet-common", + "pallet-configuration", "pallet-ethereum", "pallet-evm", "pallet-evm-coder-substrate", From cddd1b2a4dac2a11f1be1e9bbc25eba7acc176cb Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 15 Aug 2022 17:24:09 +0300 Subject: [PATCH 0381/1274] fix(pallet-refungible): rename benchmark type Signed-off-by: Yaroslav Bolyukin --- pallets/refungible/src/benchmarking.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pallets/refungible/src/benchmarking.rs b/pallets/refungible/src/benchmarking.rs index d39f876201..5abae3b05c 100644 --- a/pallets/refungible/src/benchmarking.rs +++ b/pallets/refungible/src/benchmarking.rs @@ -35,8 +35,8 @@ const SEED: u32 = 1; fn create_max_item_data( users: impl IntoIterator, -) -> CreateRefungibleExData { - CreateRefungibleExData { +) -> CreateItemData { + CreateItemData { users: users .into_iter() .collect::>() @@ -51,7 +51,7 @@ fn create_max_item( sender: &T::CrossAccountId, users: impl IntoIterator, ) -> Result { - let data: CreateRefungibleExData = create_max_item_data(users); + let data: CreateItemData = create_max_item_data(users); >::create_item(&collection, sender, data, &Unlimited)?; Ok(TokenId(>::get(&collection.id))) } From dbe806ce26255db44e58bd1e264c6319afc9ecae Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 15 Aug 2022 19:22:34 +0300 Subject: [PATCH 0382/1274] test: add configuration to pallet-presence Signed-off-by: Yaroslav Bolyukin --- tests/src/pallet-presence.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/src/pallet-presence.test.ts b/tests/src/pallet-presence.test.ts index 96dcd65c64..7421c0d0ad 100644 --- a/tests/src/pallet-presence.test.ts +++ b/tests/src/pallet-presence.test.ts @@ -50,6 +50,7 @@ const requiredPallets = [ 'unique', 'nonfungible', 'charging', + 'configuration', ]; // Pallets that depend on consensus and governance configuration From 7b729071f9aa856c019d8223897bf3b86d598d39 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 21:47:26 +0300 Subject: [PATCH 0383/1274] Added timezone definition. --- .docker/Dockerfile-try-runtime | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index 92fd6b28c2..a4975a62ec 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -7,6 +7,8 @@ ARG RUST_TOOLCHAIN= ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN ENV CARGO_HOME="/cargo-home" ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ From 91697b986b21c8e4f8bb5fa400271607d93772ce Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 16 Aug 2022 01:51:08 +0700 Subject: [PATCH 0384/1274] delete mistake --- .docker/forking/docker-compose-fork.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.docker/forking/docker-compose-fork.yaml b/.docker/forking/docker-compose-fork.yaml index c3d9414146..e4fcff2504 100644 --- a/.docker/forking/docker-compose-fork.yaml +++ b/.docker/forking/docker-compose-fork.yaml @@ -3,8 +3,8 @@ version: "3.5" services: parachain-fork: build: - context: ../ - dockerfile: .docker/forking/Dockerfile-parachain-live-fork + context: ./ + dockerfile: ./Dockerfile-parachain-live-fork image: parachain-fork container_name: parachain-fork volumes: From 60de661423fc81a34382c95695f3a99a42cf00bf Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 21:52:00 +0300 Subject: [PATCH 0385/1274] directory exists --- .docker/Dockerfile-try-runtime | 3 --- 1 file changed, 3 deletions(-) diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index a4975a62ec..0aae9a3e17 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -37,9 +37,6 @@ ARG FEATURE= ARG REPO_URL= ARG BRANCH= -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - RUN git clone $REPO_URL -b $BRANCH && \ cargo build --features=$FEATURE --$PROFILE From 89c7def5ab7ed6c6825585556068042a18ad83e3 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 22:17:27 +0300 Subject: [PATCH 0386/1274] fix: dynamic creation execution matrix has been replaced by static definition due to issue with escaping symbols --- .docker/forking/docker-compose.tmp-fork.j2 | 2 - .github/workflows/fork-update-withdata.yml | 48 ++++++---------------- 2 files changed, 13 insertions(+), 37 deletions(-) diff --git a/.docker/forking/docker-compose.tmp-fork.j2 b/.docker/forking/docker-compose.tmp-fork.j2 index aaa39d8537..9a34999c98 100644 --- a/.docker/forking/docker-compose.tmp-fork.j2 +++ b/.docker/forking/docker-compose.tmp-fork.j2 @@ -10,6 +10,4 @@ services: - "FEATURE={{ FEATURE }}" - "RUNTIME={{ RUNTIME }}" - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - - "MAINNET_TAG={{ MAINNET_TAG }}" - - "MAINNET_BRANCH={{ MAINNET_BRANCH }}" - "FORK_FROM={{ FORK_FROM }}" diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/fork-update-withdata.yml index 584935d407..671e464adb 100644 --- a/.github/workflows/fork-update-withdata.yml +++ b/.github/workflows/fork-update-withdata.yml @@ -21,39 +21,7 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - prepare-execution-marix-fork: - - name: Prepare execution matrix for fork - - runs-on: self-hosted-ci - outputs: - matrix: ${{ steps.create_matrix.outputs.matrix }} - steps: - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Create Execution matrix - uses: fabiocaccamo/create-matrix-action@v2 - id: create_matrix - with: - matrix: | - network {Opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}, fork_from_address {wss://eu-ws-opal.unique.network:443} - network {Quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, fork_from_address {wss://eu-ws-quartz.unique.network:443} - network {Unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, fork_from_address {wss://eu-ws.unique.network:443} - - - fork-update-withdata: - needs: prepare-execution-marix-fork # The type of runner that the job will run on runs-on: self-hosted-ci @@ -63,7 +31,19 @@ jobs: strategy: matrix: - include: ${{fromJson(needs.prepare-execution-marix-fork.outputs.matrix)}} + include: + - network: Opal + features: opal-runtime + runtime: opal + fork_from_address: wss://eu-ws-opal.unique.network:443 + - network: Quartz + features: quartz-runtime + runtime: quartz + fork_from_address: wss://eu-ws-quartz.unique.network:443 + - network: Unique + features: unique-runtime + runtime: unique + fork_from_address: wss://eu-ws.unique.network:443 steps: - name: Skip if pull request is in Draft @@ -105,8 +85,6 @@ jobs: RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }} - MAINNET_TAG=${{ matrix.mainnet_tag }} - MAINNET_BRANCH=${{ matrix.mainnet_branch }} FEATURE=${{ matrix.features }} RUNTIME=${{ matrix.runtime }} BRANCH=${{ github.head_ref }} From ec658efca6bd4fc1edb2867fcb5141ca9d2ce0a0 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 22:39:03 +0300 Subject: [PATCH 0387/1274] fix: docker-compose file renamed. opal-runtime excplicitly defined. --- ...cker-compose-master.yaml => docker-compose-master.yml} | 0 .github/workflows/build-test-master.yml | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) rename .docker/{docker-compose-master.yaml => docker-compose-master.yml} (100%) diff --git a/.docker/docker-compose-master.yaml b/.docker/docker-compose-master.yml similarity index 100% rename from .docker/docker-compose-master.yaml rename to .docker/docker-compose-master.yml diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml index 6520dbaacc..489f0e5f0d 100644 --- a/.github/workflows/build-test-master.yml +++ b/.github/workflows/build-test-master.yml @@ -21,7 +21,7 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - build: + master-build-and-test: # The type of runner that the job will run on runs-on: self-hosted-ci @@ -34,11 +34,11 @@ jobs: matrix: include: - network: "Opal" - features: " " + features: "opal-runtime" - network: "Quartz" - features: "--features=quartz-runtime" + features: "quartz-runtime" - network: "Unique" - features: "--features=unique-runtime" + features: "unique-runtime" steps: - name: Skip if pull request is in Draft From d41cda7482d4a83478b4777585ca1f6b0168fcb2 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 15 Aug 2022 22:43:58 +0300 Subject: [PATCH 0388/1274] option added --- .docker/Dockerfile-parachain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index 53564a9248..e75eb3e8b4 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -39,7 +39,7 @@ RUN mkdir /unique_parachain WORKDIR /unique_parachain RUN git clone $REPO_URL -b $BRANCH -RUN cargo build $FEATURE --$PROFILE +RUN cargo build --features=$FEATURE --$PROFILE # ===== BUILD POLKADOT ===== From 2be843eb2a5492e5d3a68e49136c8f921359a790 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 16 Aug 2022 09:20:38 +0300 Subject: [PATCH 0389/1274] Added timezone configuration step. --- .docker/Dockerfile-parachain | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index cae9d17a13..8c9be46809 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -7,7 +7,8 @@ ARG RUST_TOOLCHAIN= ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN ENV CARGO_HOME="/cargo-home" ENV PATH="/cargo-home/bin:$PATH" - +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ apt-get install -y curl cmake pkg-config libssl-dev git clang && \ From 6bc9f6eef3466e895cfb05475e79bf3ba45cd63a Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 16 Aug 2022 09:37:45 +0300 Subject: [PATCH 0390/1274] Excplicitly set feature for Opal network --- .github/workflows/node_build_test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 9b0c5f68e7..6915b9e6fa 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -32,11 +32,11 @@ jobs: matrix: include: - network: "Opal" - features: " " + features: "opal-runtime" - network: "Quartz" - features: "--features=quartz-runtime" + features: "quartz-runtime" - network: "Unique" - features: "--features=unique-runtime" + features: "unique-runtime" steps: - name: Skip if pull request is in Draft From 74fc14d352eb0e8071cdb1b60d1cba4b3d5bd595 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 16 Aug 2022 14:30:10 +0700 Subject: [PATCH 0391/1274] correct launch-config-fork --- .docker/forking/launch-config-fork.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/forking/launch-config-fork.j2 b/.docker/forking/launch-config-fork.j2 index 3ea27e3a90..df94ff7f7b 100644 --- a/.docker/forking/launch-config-fork.j2 +++ b/.docker/forking/launch-config-fork.j2 @@ -84,7 +84,7 @@ }, "parachains": [ { - "bin": "/unique-chain/current/release/unique-collator", + "bin": "/unique-chain/target/release/unique-collator", "id": "1000", "balance": "1000000000000000000000000", "chainRawInitializer": [ From c5d75d752f0d9222d4e7a713bc43bf6819643999 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 16 Aug 2022 10:34:44 +0300 Subject: [PATCH 0392/1274] Changed script exit code --- .github/workflows/forkless-update-nodata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index a18f223453..56356d9c7f 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -174,7 +174,7 @@ jobs: fi done echo "Halting script" - exit 1 + exit 0 shell: bash - name: Collect Docker Logs From 840b5743e31e9817eb5f2d98b534cefd82b1a8e0 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 16 Aug 2022 10:45:07 +0300 Subject: [PATCH 0393/1274] remove directory creation --- .docker/Dockerfile-parachain | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index 8c9be46809..d0237493bf 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -36,7 +36,7 @@ ARG FEATURE= ARG REPO_URL= ARG BRANCH= -RUN mkdir /unique_parachain + WORKDIR /unique_parachain RUN git clone $REPO_URL -b $BRANCH && \ @@ -48,7 +48,7 @@ FROM rust-builder as builder-polkadot ARG POLKADOT_BUILD_BRANCH= ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH -RUN mkdir /unique_parachain + WORKDIR /unique_parachain RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ From ef0cfd23027e3d763f5a74355073ef8cee4b775d Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 16 Aug 2022 13:37:54 +0300 Subject: [PATCH 0394/1274] git clone path specified. define variable into a job name --- .docker/Dockerfile-parachain | 2 +- .github/workflows/build-test-master.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index d0237493bf..a8b1cf7009 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -39,7 +39,7 @@ ARG BRANCH= WORKDIR /unique_parachain -RUN git clone $REPO_URL -b $BRANCH && \ +RUN git clone $REPO_URL -b $BRANCH . && \ cargo build --features=$FEATURE --$PROFILE # ===== BUILD POLKADOT ===== diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml index 489f0e5f0d..e564200395 100644 --- a/.github/workflows/build-test-master.yml +++ b/.github/workflows/build-test-master.yml @@ -26,7 +26,7 @@ jobs: runs-on: self-hosted-ci - name: Build Container, Spin it Up an test + name: ${{ matrix.network }} - Build and Test continue-on-error: true #Do not stop testing of matrix runs failed. From b1e29067ed0f0dd18d1446719f2d59f4d2648d06 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 16 Aug 2022 13:58:00 +0300 Subject: [PATCH 0395/1274] Specify variable in job name --- .github/workflows/fork-update-withdata.yml | 2 +- .github/workflows/forkless-update-nodata.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/fork-update-withdata.yml index 671e464adb..26f11f8949 100644 --- a/.github/workflows/fork-update-withdata.yml +++ b/.github/workflows/fork-update-withdata.yml @@ -25,7 +25,7 @@ jobs: # The type of runner that the job will run on runs-on: self-hosted-ci - name: Build Container, Spin it Up an test + name: ${{ matrix.network }} Fork Parachain with data continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 56356d9c7f..79dd7eedd8 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -57,7 +57,7 @@ jobs: # The type of runner that the job will run on runs-on: self-hosted-ci - name: Build Container, Spin it Up an test + name: ${{ matrix.network }} - Forkless Parachain Upgrade NO data continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. From af9745c0f31d1c9001d34a7abb707078bc090300 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 12 Jul 2022 23:49:01 +0300 Subject: [PATCH 0396/1274] Documentation for struct-versioning --- crates/struct-versioning/src/lib.rs | 48 ++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/crates/struct-versioning/src/lib.rs b/crates/struct-versioning/src/lib.rs index 5a55e04c47..f1cd425e3e 100644 --- a/crates/struct-versioning/src/lib.rs +++ b/crates/struct-versioning/src/lib.rs @@ -1,3 +1,49 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +//! struct-versioning +//! The crate contains procedural macros for versioning data structures. +//! Macros `versioned` generate versioned variants of a struct. +//! +//! Example: +//! #[struct_versioning::versioned(version = 2, upper)] +//! ... +//! pub struct ItemData { +//! pub const_data: BoundedVec, +//! +//! #[version(..2)] +//! pub variable_data: BoundedVec, +//! } +//! ... +//! `#[version(..2)]` that means that any version before 2 will be upgraded to 2 via the `upper` function +//! *upper* - generate From impls, which converts old version of structs to new +//! In this case, the upgrade is described in `on_runtime_upgrade` using the `translate_values` substrate feature +//! +//! #[pallet::hooks] +//! impl Hooks> for Pallet { +//! fn on_runtime_upgrade() -> Weight { +//! if StorageVersion::get::>() < StorageVersion::new(1) { +//! >::translate_values::(|v| { +//! Some(::from(v)) +//! }) +//! } +//! 0 +//! } +//! } + use proc_macro::TokenStream; use quote::format_ident; use syn::{ @@ -158,7 +204,7 @@ impl Default for VersionAttr { /// - *versions* - generate enum, which contains all possible versions of struct /// /// Each field may have version attribute -/// `#[version([1]..[2][, upper(old)])]` +/// `#[[1]..[2][, upper(old)])]` /// - *1* - version, on which this field is appeared /// - *2* - version, in which this field was removed /// (i.e if set to 2, this field was exist on version 1, and no longer exist on version 2) From 573a06755e55ac2f0886f2c4e29583b8a74a9cb1 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 12 Jul 2022 23:58:06 +0300 Subject: [PATCH 0397/1274] Typos removed --- crates/struct-versioning/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/struct-versioning/src/lib.rs b/crates/struct-versioning/src/lib.rs index f1cd425e3e..077207fad1 100644 --- a/crates/struct-versioning/src/lib.rs +++ b/crates/struct-versioning/src/lib.rs @@ -204,7 +204,7 @@ impl Default for VersionAttr { /// - *versions* - generate enum, which contains all possible versions of struct /// /// Each field may have version attribute -/// `#[[1]..[2][, upper(old)])]` +/// `#[version([1]..[2][, upper(old)])]` /// - *1* - version, on which this field is appeared /// - *2* - version, in which this field was removed /// (i.e if set to 2, this field was exist on version 1, and no longer exist on version 2) From ec76b9ccb1e6989cba2daf190207fb318d98c3e0 Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 13 Jul 2022 13:13:55 +0300 Subject: [PATCH 0398/1274] Documentation extended --- crates/struct-versioning/src/lib.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/struct-versioning/src/lib.rs b/crates/struct-versioning/src/lib.rs index 077207fad1..32dbfa9a0f 100644 --- a/crates/struct-versioning/src/lib.rs +++ b/crates/struct-versioning/src/lib.rs @@ -28,7 +28,8 @@ //! pub variable_data: BoundedVec, //! } //! ... -//! `#[version(..2)]` that means that any version before 2 will be upgraded to 2 via the `upper` function +//! `#[version(..2)]` that means that any version before 2 will be upgraded to 2 via the `upper` function. +//! When version become 3 `#[struct_versioning::versioned(version = 3, upper)]` this field will be removed. //! *upper* - generate From impls, which converts old version of structs to new //! In this case, the upgrade is described in `on_runtime_upgrade` using the `translate_values` substrate feature //! @@ -43,7 +44,12 @@ //! 0 //! } //! } - +//! +//! Another functionality +/// +/// `#[versioned(version = 1[, first_version = 1][, upper][, versions])]` +/// - *first_version* - allows to skip generation of structs, which predates first supported version +/// - *versions* - generate enum, which contains all possible versions of struct use proc_macro::TokenStream; use quote::format_ident; use syn::{ From 03866db9b34b08a9808fc8f4ac87ba0de9cfec6f Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 16 Aug 2022 15:18:25 +0300 Subject: [PATCH 0399/1274] doc(struct-versioning): explain semantics by example Signed-off-by: Yaroslav Bolyukin --- crates/struct-versioning/README.md | 62 +++++++++++++++++++++++++++++ crates/struct-versioning/src/lib.rs | 38 +----------------- 2 files changed, 64 insertions(+), 36 deletions(-) create mode 100644 crates/struct-versioning/README.md diff --git a/crates/struct-versioning/README.md b/crates/struct-versioning/README.md new file mode 100644 index 0000000000..4ea12d3c18 --- /dev/null +++ b/crates/struct-versioning/README.md @@ -0,0 +1,62 @@ +# struct-versioning + +The crate contains procedural macros for versioning data structures. +Macros [`versioned`] generate versioned variants of a struct. + +Example: +``` +# use struct_versioning::versioned; +#[versioned(version = 5, first_version = 2)] +struct Example {} + +// versioned macro will generate suffixed versions of example struct, +// starting from `Version{first_version or 1}` to `Version{version}` inclusive +let _ver2 = ExampleVersion2 {}; +let _ver3 = ExampleVersion3 {}; +let _ver4 = ExampleVersion4 {}; +let _ver5 = ExampleVersion5 {}; + +// last version will also be aliased with original struct name +let _orig: Example = ExampleVersion5 {}; + +#[versioned(version = 2, upper)] +#[derive(PartialEq, Debug)] +struct Upper { + #[version(..2)] + removed: u32, + #[version(2.., upper(10))] + added: u32, + + #[version(..2)] + retyped: u32, + #[version(2.., upper(retyped as u64))] + retyped: u64, +} + +// #[version] attribute on field allows to specify, in which versions of structs this field should present +// versions here works as standard rust ranges, start is inclusive, end is exclusive +let _up1 = UpperVersion1 {removed: 1, retyped: 0}; +let _up2 = UpperVersion2 {added: 1, retyped: 0}; + +// and upper() allows to specify, which value should be assigned to this field in `From` impl +assert_eq!( + UpperVersion2::from(UpperVersion1 {removed: 0, retyped: 6}), + UpperVersion2 {added: 10, retyped: 6}, +); +``` + +In this case, the upgrade is described in `on_runtime_upgrade` using the `translate_values` substrate feature + +```ignore +#[pallet::hooks] +impl Hooks> for Pallet { + fn on_runtime_upgrade() -> Weight { + if StorageVersion::get::>() < StorageVersion::new(1) { + >::translate_values::(|v| { + Some(::from(v)) + }) + } + 0 + } +} +``` diff --git a/crates/struct-versioning/src/lib.rs b/crates/struct-versioning/src/lib.rs index 32dbfa9a0f..a3767827f1 100644 --- a/crates/struct-versioning/src/lib.rs +++ b/crates/struct-versioning/src/lib.rs @@ -14,42 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -//! struct-versioning -//! The crate contains procedural macros for versioning data structures. -//! Macros `versioned` generate versioned variants of a struct. -//! -//! Example: -//! #[struct_versioning::versioned(version = 2, upper)] -//! ... -//! pub struct ItemData { -//! pub const_data: BoundedVec, -//! -//! #[version(..2)] -//! pub variable_data: BoundedVec, -//! } -//! ... -//! `#[version(..2)]` that means that any version before 2 will be upgraded to 2 via the `upper` function. -//! When version become 3 `#[struct_versioning::versioned(version = 3, upper)]` this field will be removed. -//! *upper* - generate From impls, which converts old version of structs to new -//! In this case, the upgrade is described in `on_runtime_upgrade` using the `translate_values` substrate feature -//! -//! #[pallet::hooks] -//! impl Hooks> for Pallet { -//! fn on_runtime_upgrade() -> Weight { -//! if StorageVersion::get::>() < StorageVersion::new(1) { -//! >::translate_values::(|v| { -//! Some(::from(v)) -//! }) -//! } -//! 0 -//! } -//! } -//! -//! Another functionality -/// -/// `#[versioned(version = 1[, first_version = 1][, upper][, versions])]` -/// - *first_version* - allows to skip generation of structs, which predates first supported version -/// - *versions* - generate enum, which contains all possible versions of struct +#![doc = include_str!("../README.md")] + use proc_macro::TokenStream; use quote::format_ident; use syn::{ From 5b68c20d6e2cd1d4dd675e8629c623a4c4638887 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 16 Aug 2022 12:44:15 +0000 Subject: [PATCH 0400/1274] fix(rft): fractionalizer tests run only when rft pallet is on --- tests/src/eth/fractionalizer/fractionalizer.test.ts | 12 ++++++++++-- tests/src/eth/reFungibleToken.test.ts | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index 1d3e013a64..4d3de33cb3 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -20,7 +20,7 @@ import {ApiPromise} from '@polkadot/api'; import {evmToAddress} from '@polkadot/util-crypto'; import {readFile} from 'fs/promises'; import {executeTransaction, submitTransactionAsync} from '../../substrate/substrate-api'; -import {getCreateCollectionResult, getCreateItemResult, UNIQUE} from '../../util/helpers'; +import {getCreateCollectionResult, getCreateItemResult, UNIQUE, requirePallets, Pallets} from '../../util/helpers'; import {collectionIdToAddress, CompiledContract, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers'; import {Contract} from 'web3-eth-contract'; import * as solc from 'solc'; @@ -116,6 +116,10 @@ async function createRFTToken(api: ApiPromise, web3: Web3, owner: string, fracti } describe('Fractionalizer contract usage', () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + }); + itWeb3('Set RFT collection', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const fractionalizer = await deployFractionalizer(web3, owner); @@ -224,6 +228,10 @@ describe('Fractionalizer contract usage', () => { describe('Negative Integration Tests for fractionalizer', () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + }); + itWeb3('call setRFTCollection twice', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner); @@ -467,4 +475,4 @@ describe('Negative Integration Tests for fractionalizer', () => { await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100n).call()) .to.be.rejectedWith(/TransferNotAllowed$/g); }); -}); \ No newline at end of file +}); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 75f10f9b44..3f67177ed9 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -651,6 +651,10 @@ describe('Refungible: Substrate calls', () => { }); describe('ERC 1633 implementation', () => { + before(async function() { + await requirePallets(this, [Pallets.ReFungible]); + }); + itWeb3('Parent NFT token address and id', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); From a993a5bf6636e4df58a1529b03fbcd5f900bcd2d Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 16 Aug 2022 12:45:09 +0000 Subject: [PATCH 0401/1274] fix(rft): replace rft by nft in non-existing fn test --- tests/src/evmCoder.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/src/evmCoder.test.ts b/tests/src/evmCoder.test.ts index d34748363e..dd492504fe 100644 --- a/tests/src/evmCoder.test.ts +++ b/tests/src/evmCoder.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import Web3 from 'web3'; -import {createEthAccountWithBalance, createRefungibleCollection, GAS_ARGS, itWeb3} from './eth/util/helpers'; +import {createEthAccountWithBalance, createNonfungibleCollection, GAS_ARGS, itWeb3} from './eth/util/helpers'; import * as solc from 'solc'; import chai from 'chai'; @@ -92,7 +92,7 @@ async function deployTestContract(web3: Web3, owner: string, collectionAddress: describe('Evm Coder tests', () => { itWeb3('Call non-existing function', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner); + const {collectionIdAddress} = await createNonfungibleCollection(api, web3, owner); const contract = await deployTestContract(web3, owner, collectionIdAddress, '0x1bfed5D614b886b9Ab2eA4CBAc22A96B7EC29c9c'); const testContract = await deployTestContract(web3, owner, collectionIdAddress, contract.options.address); { @@ -114,4 +114,4 @@ describe('Evm Coder tests', () => { .to.be.rejectedWith(/unrecognized selector: 0xd9f02b36$/g); } }); -}); \ No newline at end of file +}); From cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 21 Jul 2022 09:44:32 +0200 Subject: [PATCH 0402/1274] build(dep): upgrade polkadot to v0.9.25 Signed-off-by: Yaroslav Bolyukin --- README.md | 2 +- client/rpc/Cargo.toml | 14 +-- crates/evm-coder/Cargo.toml | 2 +- node/cli/Cargo.toml | 138 ++++++++++----------- node/rpc/Cargo.toml | 68 +++++----- pallets/common/Cargo.toml | 16 +-- pallets/evm-coder-substrate/Cargo.toml | 14 +-- pallets/evm-contract-helpers/Cargo.toml | 16 +-- pallets/evm-migration/Cargo.toml | 18 +-- pallets/evm-transaction-payment/Cargo.toml | 22 ++-- pallets/fungible/Cargo.toml | 14 +-- pallets/inflation/Cargo.toml | 20 +-- pallets/nonfungible/Cargo.toml | 14 +-- pallets/proxy-rmrk-core/Cargo.toml | 14 +-- pallets/proxy-rmrk-equip/Cargo.toml | 14 +-- pallets/refungible/Cargo.toml | 15 +-- pallets/scheduler/Cargo.toml | 20 +-- pallets/structure/Cargo.toml | 10 +- pallets/unique/Cargo.toml | 16 +-- primitives/data-structs/Cargo.toml | 12 +- primitives/rmrk-rpc/Cargo.toml | 8 +- primitives/rpc/Cargo.toml | 10 +- runtime/opal/Cargo.toml | 106 ++++++++-------- runtime/quartz/Cargo.toml | 106 ++++++++-------- runtime/tests/Cargo.toml | 24 ++-- runtime/unique/Cargo.toml | 106 ++++++++-------- 26 files changed, 408 insertions(+), 411 deletions(-) diff --git a/README.md b/README.md index 8aa078fdee..26e1c09c10 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ git checkout feature/runtime-upgrade-testing ``` git clone https://github.com/paritytech/polkadot.git cd polkadot -git checkout release-v0.9.24 +git checkout release-v0.9.25 cargo build --release ``` diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index 069b73bc2e..6b15da7a77 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -10,12 +10,12 @@ up-data-structs = { default-features = false, path = '../../primitives/data-stru up-rpc = { path = "../../primitives/rpc" } rmrk-rpc = { path = "../../primitives/rmrk-rpc" } codec = { package = "parity-scale-codec", version = "3.1.2" } -jsonrpsee = { version = "0.13.0", features = ["server", "macros"] } +jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } anyhow = "1.0.57" -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } diff --git a/crates/evm-coder/Cargo.toml b/crates/evm-coder/Cargo.toml index aee1c37e18..8749869d74 100644 --- a/crates/evm-coder/Cargo.toml +++ b/crates/evm-coder/Cargo.toml @@ -9,7 +9,7 @@ evm-coder-macros = { path = "../evm-coder-macros" } primitive-types = { version = "0.11.1", default-features = false } hex-literal = "0.3.3" ethereum = { version = "0.12.0", default-features = false } -evm-core = { default-features = false , git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.24" } +evm-core = { default-features = false , git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.25" } impl-trait-for-tuples = "0.2.1" [dev-dependencies] diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index aeb8f55d95..8fba3d024b 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -3,7 +3,7 @@ [build-dependencies.substrate-build-script-utils] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" ################################################################################ # Substrate Dependecies @@ -16,158 +16,158 @@ version = '3.1.2' [dependencies.frame-benchmarking] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-benchmarking-cli] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.try-runtime-cli] git = 'https://github.com/paritytech/substrate' -branch = 'polkadot-v0.9.24' +branch = 'polkadot-v0.9.25' [dependencies.pallet-transaction-payment-rpc] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.substrate-prometheus-endpoint] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-basic-authorship] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-chain-spec] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-cli] features = ['wasmtime'] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-client-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-consensus] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-consensus-aura] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-executor] features = ['wasmtime'] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-finality-grandpa] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-keystore] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-rpc] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-rpc-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-service] features = ['wasmtime'] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-telemetry] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-transaction-pool] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-tracing] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-sysinfo] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-block-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-blockchain] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-consensus] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-consensus-aura] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-core] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-finality-grandpa] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-inherents] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-keystore] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-offchain] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-runtime] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-session] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-timestamp] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-transaction-pool] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-trie] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.substrate-frame-rpc-system] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sc-network] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.serde] features = ['derive'] @@ -178,76 +178,76 @@ version = '1.0.68' [dependencies.sc-consensus-manual-seal] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" ################################################################################ # Cumulus dependencies [dependencies.cumulus-client-consensus-aura] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.cumulus-client-consensus-common] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.cumulus-client-collator] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.cumulus-client-cli] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.cumulus-client-network] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.cumulus-primitives-parachain-inherent] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.cumulus-client-service] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.cumulus-relay-chain-interface] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.cumulus-relay-chain-inprocess-interface] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.cumulus-relay-chain-rpc-interface] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" ################################################################################ # Polkadot dependencies [dependencies.polkadot-primitives] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" [dependencies.polkadot-service] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" [dependencies.polkadot-cli] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" [dependencies.polkadot-test-service] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" ################################################################################ @@ -276,7 +276,7 @@ path = "../../primitives/rpc" [dependencies.pallet-transaction-payment-rpc-runtime-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" ################################################################################ # Package @@ -302,19 +302,19 @@ targets = ['x86_64-unknown-linux-gnu'] [dependencies] futures = '0.3.17' log = '0.4.14' -flexi_logger = "0.15.7" -parking_lot = '0.11.2' +flexi_logger = "0.22.5" +parking_lot = '0.12.1' clap = "3.1.2" -jsonrpsee = { version = "0.13.0", features = ["server", "macros"] } -tokio = { version = "1.17.0", features = ["time"] } - -fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } +tokio = { version = "1.19.2", features = ["time"] } + +fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } unique-rpc = { default-features = false, path = "../rpc" } rmrk-rpc = { path = "../../primitives/rmrk-rpc" } diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index 423ab9cd1a..816f5c8642 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -11,42 +11,42 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] futures = { version = "0.3.17", features = ["compat"] } -jsonrpsee = { version = "0.13.0", features = ["server", "macros"] } +jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } # pallet-contracts-rpc = { git = 'https://github.com/paritytech/substrate', branch = 'master' } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -tokio = { version = "0.2.25", features = ["macros", "sync"] } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +tokio = { version = "1.19.2", features = ["macros", "sync"] } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } pallet-common = { default-features = false, path = "../../pallets/common" } up-common = { path = "../../primitives/common" } diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index 2752953f99..b2b65ed9dc 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -11,18 +11,18 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } ethereum = { version = "0.12.0", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } serde = { version = "1.0.130", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/evm-coder-substrate/Cargo.toml b/pallets/evm-coder-substrate/Cargo.toml index bd8976da6a..0d9eb30246 100644 --- a/pallets/evm-coder-substrate/Cargo.toml +++ b/pallets/evm-coder-substrate/Cargo.toml @@ -8,15 +8,15 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } ethereum = { version = "0.12.0", default-features = false } evm-coder = { default-features = false, path = "../../crates/evm-coder" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } up-data-structs = { default-features = false, path = "../../primitives/data-structs" } [dependencies.codec] diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index 4d42469e1b..c7f3ab3032 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -11,16 +11,16 @@ scale-info = { version = "2.0.1", default-features = false, features = [ log = { default-features = false, version = "0.4.14" } # Substrate -frame-support = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -frame-system = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } +frame-support = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +frame-system = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } # Unique -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.24" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.25" } # Locals evm-coder = { default-features = false, path = '../../crates/evm-coder' } diff --git a/pallets/evm-migration/Cargo.toml b/pallets/evm-migration/Cargo.toml index 7fc998e3bd..b9d117a782 100644 --- a/pallets/evm-migration/Cargo.toml +++ b/pallets/evm-migration/Cargo.toml @@ -8,15 +8,15 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } [dependencies.codec] default-features = false diff --git a/pallets/evm-transaction-payment/Cargo.toml b/pallets/evm-transaction-payment/Cargo.toml index 7f352bb20e..8ef82acc81 100644 --- a/pallets/evm-transaction-payment/Cargo.toml +++ b/pallets/evm-transaction-payment/Cargo.toml @@ -8,17 +8,17 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.24" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.25" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } [dependencies.codec] default-features = false diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index dc6d9c327f..34184cf6e2 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -11,19 +11,19 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' } ethereum = { version = "0.12.0", default-features = false } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } diff --git a/pallets/inflation/Cargo.toml b/pallets/inflation/Cargo.toml index 34dfbdd54c..7e249a521b 100644 --- a/pallets/inflation/Cargo.toml +++ b/pallets/inflation/Cargo.toml @@ -43,37 +43,37 @@ version = '3.1.2' default-features = false optional = true git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.serde] default-features = false @@ -83,17 +83,17 @@ version = '1.0.130' [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies] scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index 9a97825688..9c7249f848 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -11,19 +11,19 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' } ethereum = { version = "0.12.0", default-features = false } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } diff --git a/pallets/proxy-rmrk-core/Cargo.toml b/pallets/proxy-rmrk-core/Cargo.toml index 7444799964..2640c2cfd5 100644 --- a/pallets/proxy-rmrk-core/Cargo.toml +++ b/pallets/proxy-rmrk-core/Cargo.toml @@ -11,17 +11,17 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } pallet-structure = { default-features = false, path = "../../pallets/structure" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } derivative = { version = "2.2.0", features = ["use_core"] } diff --git a/pallets/proxy-rmrk-equip/Cargo.toml b/pallets/proxy-rmrk-equip/Cargo.toml index 9330330938..ae202ff44a 100644 --- a/pallets/proxy-rmrk-equip/Cargo.toml +++ b/pallets/proxy-rmrk-equip/Cargo.toml @@ -11,16 +11,16 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } pallet-rmrk-core = { default-features = false, path = "../proxy-rmrk-core" } diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index 22079b8ac5..e61e68963e 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -11,23 +11,20 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } struct-versioning = { path = "../../crates/struct-versioning" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } - ethereum = { version = "0.12.0", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = ["derive",] } - -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } derivative = { version = "2.2.0", features = ["use_core"] } [features] diff --git a/pallets/scheduler/Cargo.toml b/pallets/scheduler/Cargo.toml index dc4b651590..b968f878f1 100644 --- a/pallets/scheduler/Cargo.toml +++ b/pallets/scheduler/Cargo.toml @@ -16,20 +16,20 @@ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.24' } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.25' } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.24" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.25" } log = { version = "0.4.14", default-features = false } [dev-dependencies] -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } [features] default = ["std"] diff --git a/pallets/structure/Cargo.toml b/pallets/structure/Cargo.toml index 28d36fa4a6..123a1f2ab5 100644 --- a/pallets/structure/Cargo.toml +++ b/pallets/structure/Cargo.toml @@ -4,10 +4,10 @@ version = "0.1.1" edition = "2021" [dependencies] -frame-support = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -frame-system = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -frame-benchmarking = { default-features = false, optional = true, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } +frame-support = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +frame-system = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +frame-benchmarking = { default-features = false, optional = true, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } pallet-common = { path = "../common", default-features = false } parity-scale-codec = { version = "3.1.2", default-features = false, features = [ "derive", @@ -16,7 +16,7 @@ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } up-data-structs = { path = "../../primitives/data-structs", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } [features] default = ["std"] diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index e6e07441d2..90bdf32129 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -59,37 +59,37 @@ version = '3.1.2' default-features = false optional = true git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" ################################################################################ # Local Dependencies @@ -98,7 +98,7 @@ up-data-structs = { default-features = false, path = "../../primitives/data-stru scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } pallet-common = { default-features = false, path = "../common" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } diff --git a/primitives/data-structs/Cargo.toml b/primitives/data-structs/Cargo.toml index da08bec8d5..fe1b960fb5 100644 --- a/primitives/data-structs/Cargo.toml +++ b/primitives/data-structs/Cargo.toml @@ -18,14 +18,14 @@ codec = { package = "parity-scale-codec", version = "3.1.2", default-features = serde = { version = "1.0.130", features = [ 'derive', ], default-features = false, optional = true } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } derivative = { version = "2.2.0", features = ["use_core"] } struct-versioning = { path = "../../crates/struct-versioning" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } rmrk-traits = { default-features = false, path = "../rmrk-traits" } [features] diff --git a/primitives/rmrk-rpc/Cargo.toml b/primitives/rmrk-rpc/Cargo.toml index 0aeac55339..49278d5c97 100644 --- a/primitives/rmrk-rpc/Cargo.toml +++ b/primitives/rmrk-rpc/Cargo.toml @@ -6,10 +6,10 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } -sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -sp-api = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } +sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +sp-api = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } serde = { version = "1.0.130", default-features = false, features = ["derive"] } rmrk-traits = { default-features = false, path = "../rmrk-traits" } diff --git a/primitives/rpc/Cargo.toml b/primitives/rpc/Cargo.toml index 4c9f236e62..1b5c17803b 100644 --- a/primitives/rpc/Cargo.toml +++ b/primitives/rpc/Cargo.toml @@ -10,11 +10,11 @@ up-data-structs = { default-features = false, path = '../data-structs' } codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [ "derive", ] } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } [features] default = ["std"] diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index e1eb75fee7..62d97f13b5 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -141,39 +141,39 @@ version = '3.1.2' default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-try-runtime] default-features = false git = 'https://github.com/paritytech/substrate' optional = true -branch = 'polkadot-v0.9.24' +branch = 'polkadot-v0.9.25' [dependencies.frame-executive] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-system-benchmarking] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-system-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.hex-literal] optional = true @@ -188,12 +188,12 @@ version = '1.0.130' [dependencies.pallet-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" # Contracts specific packages # [dependencies.pallet-contracts] @@ -217,32 +217,32 @@ branch = "polkadot-v0.9.24" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-sudo] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-transaction-payment] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-treasury] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" # [dependencies.pallet-vesting] # default-features = false @@ -252,67 +252,67 @@ branch = "polkadot-v0.9.24" [dependencies.sp-arithmetic] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-block-builder] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-inherents] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-offchain] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-session] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-transaction-pool] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-version] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.smallvec] version = '1.6.1' @@ -323,46 +323,46 @@ version = '1.6.1' [dependencies.parachain-info] default-features = false git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.cumulus-pallet-aura-ext] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-pallet-parachain-system] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-pallet-xcm] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-pallet-dmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-pallet-xcmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-primitives-utility] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-primitives-timestamp] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false ################################################################################ @@ -370,32 +370,32 @@ default-features = false [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" default-features = false [dependencies.xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" default-features = false [dependencies.xcm-builder] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" default-features = false [dependencies.xcm-executor] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" default-features = false [dependencies.pallet-xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" default-features = false [dependencies.orml-vesting] -git = "https://github.com/uniquenetwork/open-runtime-module-library" -branch = "unique-polkadot-v0.9.24" +git = "https://github.com/open-web3-stack/open-runtime-module-library" +branch = "polkadot-v0.9.25" version = "0.4.1-dev" default-features = false @@ -412,7 +412,7 @@ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } pallet-configuration = { default-features = false, path = "../../pallets/configuration" } @@ -425,22 +425,22 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.24", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.25", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.24' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.25' } ################################################################################ # Build Dependencies [build-dependencies.substrate-wasm-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 92b192d55f..5c0a828054 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -138,39 +138,39 @@ version = '3.1.2' default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-try-runtime] default-features = false git = 'https://github.com/paritytech/substrate' optional = true -branch = 'polkadot-v0.9.24' +branch = 'polkadot-v0.9.25' [dependencies.frame-executive] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-system-benchmarking] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-system-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.hex-literal] optional = true @@ -185,12 +185,12 @@ version = '1.0.130' [dependencies.pallet-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" # Contracts specific packages # [dependencies.pallet-contracts] @@ -214,32 +214,32 @@ branch = "polkadot-v0.9.24" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-sudo] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-transaction-payment] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-treasury] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" # [dependencies.pallet-vesting] # default-features = false @@ -249,67 +249,67 @@ branch = "polkadot-v0.9.24" [dependencies.sp-arithmetic] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-block-builder] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-inherents] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-offchain] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-session] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-transaction-pool] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-version] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.smallvec] version = '1.6.1' @@ -320,46 +320,46 @@ version = '1.6.1' [dependencies.parachain-info] default-features = false git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.cumulus-pallet-aura-ext] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-pallet-parachain-system] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-pallet-xcm] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-pallet-dmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-pallet-xcmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-primitives-utility] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-primitives-timestamp] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false ################################################################################ @@ -367,32 +367,32 @@ default-features = false [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" default-features = false [dependencies.xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" default-features = false [dependencies.xcm-builder] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" default-features = false [dependencies.xcm-executor] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" default-features = false [dependencies.pallet-xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" default-features = false [dependencies.orml-vesting] -git = "https://github.com/uniquenetwork/open-runtime-module-library" -branch = "unique-polkadot-v0.9.24" +git = "https://github.com/open-web3-stack/open-runtime-module-library" +branch = "polkadot-v0.9.25" version = "0.4.1-dev" default-features = false @@ -416,7 +416,7 @@ scale-info = { version = "2.0.1", default-features = false, features = [ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } pallet-configuration = { default-features = false, path = "../../pallets/configuration" } @@ -429,22 +429,22 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.24", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.25", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.24' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.25' } ################################################################################ # Build Dependencies [build-dependencies.substrate-wasm-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index 0f3fa07091..4b3645d13d 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -11,22 +11,22 @@ refungible = [] [dependencies] up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -sp-core = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -sp-std = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -sp-io = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -sp-runtime = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } +sp-core = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +sp-std = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +sp-io = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +sp-runtime = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -frame-support = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -frame-system = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } +frame-support = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +frame-system = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -pallet-balances = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } -pallet-timestamp = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' } +pallet-balances = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +pallet-timestamp = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } pallet-common = { path = '../../pallets/common' } pallet-structure = { path = '../../pallets/structure' } diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 694e971659..80b0f548cf 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -139,39 +139,39 @@ version = '3.1.2' default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-try-runtime] default-features = false git = 'https://github.com/paritytech/substrate' optional = true -branch = 'polkadot-v0.9.24' +branch = 'polkadot-v0.9.25' [dependencies.frame-executive] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-system-benchmarking] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.frame-system-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.hex-literal] optional = true @@ -186,12 +186,12 @@ version = '1.0.130' [dependencies.pallet-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" # Contracts specific packages # [dependencies.pallet-contracts] @@ -215,32 +215,32 @@ branch = "polkadot-v0.9.24" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-sudo] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-transaction-payment] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.pallet-treasury] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" # [dependencies.pallet-vesting] # default-features = false @@ -250,67 +250,67 @@ branch = "polkadot-v0.9.24" [dependencies.sp-arithmetic] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-block-builder] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-inherents] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-offchain] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-session] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-transaction-pool] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.sp-version] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.smallvec] version = '1.6.1' @@ -321,46 +321,46 @@ version = '1.6.1' [dependencies.parachain-info] default-features = false git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" [dependencies.cumulus-pallet-aura-ext] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-pallet-parachain-system] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-pallet-xcm] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-pallet-dmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-pallet-xcmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-primitives-utility] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false [dependencies.cumulus-primitives-timestamp] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" default-features = false ################################################################################ @@ -368,32 +368,32 @@ default-features = false [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" default-features = false [dependencies.xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" default-features = false [dependencies.xcm-builder] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" default-features = false [dependencies.xcm-executor] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" default-features = false [dependencies.pallet-xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.24" +branch = "release-v0.9.25" default-features = false [dependencies.orml-vesting] -git = "https://github.com/uniquenetwork/open-runtime-module-library" -branch = "unique-polkadot-v0.9.24" +git = "https://github.com/open-web3-stack/open-runtime-module-library" +branch = "polkadot-v0.9.25" version = "0.4.1-dev" default-features = false @@ -422,23 +422,23 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.24", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.25", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.24' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.25' } ################################################################################ # Build Dependencies [build-dependencies.substrate-wasm-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.25" From 26734e9567589d75cdd99e404eabf11d5a97d975 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 21 Jul 2022 09:47:51 +0200 Subject: [PATCH 0403/1274] refactor: switch to new prefix removal methods New methods allows to call `remove_prefix` with limit multiple times in the same block However, we don't use prefix removal limits, so upgrade is straightforward Upstream-Change: https://github.com/paritytech/substrate/pull/11490 Signed-off-by: Yaroslav Bolyukin --- pallets/common/src/lib.rs | 4 ++-- pallets/fungible/src/lib.rs | 4 ++-- pallets/nonfungible/src/lib.rs | 12 ++++++------ pallets/refungible/src/lib.rs | 16 +++++++++++----- pallets/unique/src/lib.rs | 15 +++++++++------ 5 files changed, 30 insertions(+), 21 deletions(-) diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index e8851a59c4..df538bbf29 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -958,8 +958,8 @@ impl Pallet { >::put(destroyed_collections); >::remove(collection.id); >::remove(collection.id); - >::remove_prefix((collection.id,), None); - >::remove_prefix((collection.id,), None); + let _ = >::clear_prefix((collection.id,), u32::MAX, None); + let _ = >::clear_prefix((collection.id,), u32::MAX, None); >::remove(collection.id); >::deposit_event(Event::CollectionDestroyed(collection.id)); diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index 458c2dd305..777e71d0d2 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -231,8 +231,8 @@ impl Pallet { PalletCommon::destroy_collection(collection.0, sender)?; >::remove(id); - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); Ok(()) } diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index ba87344324..23041d44cd 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -429,13 +429,13 @@ impl Pallet { PalletCommon::destroy_collection(collection.0, sender)?; - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); >::remove(id); >::remove(id); - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); Ok(()) } @@ -487,7 +487,7 @@ impl Pallet { >::insert(collection.id, burnt); >::remove((collection.id, token)); >::remove((collection.id, token)); - >::remove_prefix((collection.id, token), None); + let _ = >::clear_prefix((collection.id, token), u32::MAX, None); let old_spender = >::take((collection.id, token)); if let Some(old_spender) = old_spender { diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 7ebe3dc9ae..9ba65a5d50 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -398,11 +398,11 @@ impl Pallet { >::remove(id); >::remove(id); - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); - >::remove_prefix((id,), None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); + let _ = >::clear_prefix((id,), u32::MAX, None); Ok(()) } @@ -424,6 +424,7 @@ impl Pallet { >::insert(collection.id, burnt); >::remove((collection.id, token_id)); >::remove((collection.id, token_id)); +<<<<<<< HEAD >::remove_prefix((collection.id, token_id), None); >::remove_prefix((collection.id, token_id), None); @@ -435,6 +436,11 @@ impl Pallet { } .to_log(collection_id_to_address(collection.id)), ); +======= + let _ = >::clear_prefix((collection.id, token_id), u32::MAX, None); + let _ = >::clear_prefix((collection.id, token_id), u32::MAX, None); + // TODO: ERC721 transfer event +>>>>>>> 5d9665e0... refactor: switch to new prefix removal methods Ok(()) } diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index 93f6c47620..1ad2a12e1c 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -373,13 +373,16 @@ decl_module! { T::CollectionDispatch::destroy(sender, collection)?; - >::remove_prefix(collection_id, None); - >::remove_prefix(collection_id, None); - >::remove_prefix((collection_id,), None); + // TODO: basket cleanup should be moved elsewhere + // Maybe runtime dispatch.rs should perform it? - >::remove_prefix(collection_id, None); - >::remove_prefix(collection_id, None); - >::remove_prefix((collection_id,), None); + let _ = >::clear_prefix(collection_id, u32::MAX, None); + let _ = >::clear_prefix(collection_id, u32::MAX, None); + let _ = >::clear_prefix((collection_id,), u32::MAX, None); + + let _ = >::clear_prefix(collection_id, u32::MAX, None); + let _ = >::clear_prefix(collection_id, u32::MAX, None); + let _ = >::clear_prefix((collection_id,), u32::MAX, None); Ok(()) } From e1980179e647db8b299cca32cdc9e2b3bf5e51b2 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 21 Jul 2022 09:52:51 +0200 Subject: [PATCH 0404/1274] refactor(node): use export-genesis state from cumulus We had our implementation for some reason, however it is now broken, and I see no reason to keep it, as upstream implements exact same options Signed-off-by: Yaroslav Bolyukin --- node/cli/src/cli.rs | 44 +--------------- node/cli/src/command.rs | 108 ++++++++++++++++++++-------------------- 2 files changed, 55 insertions(+), 97 deletions(-) diff --git a/node/cli/src/cli.rs b/node/cli/src/cli.rs index e1080c1e7c..8133de2f34 100644 --- a/node/cli/src/cli.rs +++ b/node/cli/src/cli.rs @@ -24,12 +24,10 @@ const NODE_NAME_ENV: &str = "UNIQUE_NODE_NAME"; #[derive(Debug, Parser)] pub enum Subcommand { /// Export the genesis state of the parachain. - #[clap(name = "export-genesis-state")] - ExportGenesisState(ExportGenesisStateCommand), + ExportGenesisState(cumulus_client_cli::ExportGenesisStateCommand), /// Export the genesis wasm of the parachain. - #[clap(name = "export-genesis-wasm")] - ExportGenesisWasm(ExportGenesisWasmCommand), + ExportGenesisWasm(cumulus_client_cli::ExportGenesisWasmCommand), /// Build a chain specification. BuildSpec(sc_cli::BuildSpecCmd), @@ -60,44 +58,6 @@ pub enum Subcommand { TryRuntime(try_runtime_cli::TryRuntimeCmd), } -/// Command for exporting the genesis state of the parachain -#[derive(Debug, Parser)] -pub struct ExportGenesisStateCommand { - /// Output file name or stdout if unspecified. - #[clap(parse(from_os_str))] - pub output: Option, - - /// Id of the parachain this state is for. - /// - /// Default: 100 - #[clap(long, conflicts_with = "chain")] - pub parachain_id: Option, - - /// Write output in binary. Default is to write in hex. - #[clap(short, long)] - pub raw: bool, - - /// The name of the chain for that the genesis state should be exported. - #[clap(long, conflicts_with = "parachain-id")] - pub chain: Option, -} - -/// Command for exporting the genesis wasm file. -#[derive(Debug, Parser)] -pub struct ExportGenesisWasmCommand { - /// Output file name or stdout if unspecified. - #[clap(parse(from_os_str))] - pub output: Option, - - /// Write output in binary. Default is to write in hex. - #[clap(short, long)] - pub raw: bool, - - /// The name of the chain for that the genesis wasm file should be exported. - #[clap(long)] - pub chain: Option, -} - #[derive(Debug, Parser)] #[clap(args_conflicts_with_subcommands = true, subcommand_negates_reqs = true)] pub struct Cli { diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index 33451a9442..614277535c 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -50,7 +50,7 @@ use crate::service::{OpalRuntimeExecutor, DefaultRuntimeExecutor}; use codec::Encode; use cumulus_primitives_core::ParaId; -use cumulus_client_service::genesis::generate_genesis_block; +use cumulus_client_cli::generate_genesis_block; use std::{future::Future, pin::Pin}; use log::info; use sc_cli::{ @@ -62,7 +62,7 @@ use sc_service::{ }; use sp_core::hexdisplay::HexDisplay; use sp_runtime::traits::{AccountIdConversion, Block as BlockT}; -use std::{io::Write, net::SocketAddr, time::Duration}; +use std::{net::SocketAddr, time::Duration}; use up_common::types::opaque::Block; @@ -191,16 +191,6 @@ impl SubstrateCli for RelayChainCli { } } -#[allow(clippy::borrowed_box)] -fn extract_genesis_wasm(chain_spec: &Box) -> Result> { - let mut storage = chain_spec.build_storage()?; - - storage - .top - .remove(sp_core::storage::well_known_keys::CODE) - .ok_or_else(|| "Could not find wasm file in genesis state!".into()) -} - macro_rules! async_run_with_runtime { ( $runtime_api:path, $executor:path, @@ -248,6 +238,45 @@ macro_rules! construct_async_run { }} } +macro_rules! sync_run_with_runtime { + ( + $runtime_api:path, $executor:path, + $runner:ident, $components:ident, $cli:ident, $cmd:ident, $config:ident, + $( $code:tt )* + ) => { + $runner.sync_run(|$config| { + $( $code )* + }) + }; +} + +macro_rules! construct_sync_run { + (|$components:ident, $cli:ident, $cmd:ident, $config:ident| $( $code:tt )* ) => {{ + let runner = $cli.create_runner($cmd)?; + + match runner.config().chain_spec.runtime_id() { + #[cfg(feature = "unique-runtime")] + RuntimeId::Unique => sync_run_with_runtime!( + unique_runtime::RuntimeApi, UniqueRuntimeExecutor, + runner, $components, $cli, $cmd, $config, $( $code )* + ), + + #[cfg(feature = "quartz-runtime")] + RuntimeId::Quartz => sync_run_with_runtime!( + quartz_runtime::RuntimeApi, QuartzRuntimeExecutor, + runner, $components, $cli, $cmd, $config, $( $code )* + ), + + RuntimeId::Opal => sync_run_with_runtime!( + opal_runtime::RuntimeApi, OpalRuntimeExecutor, + runner, $components, $cli, $cmd, $config, $( $code )* + ), + + RuntimeId::Unknown(chain) => Err(no_runtime_err!(chain).into()) + } + }} +} + macro_rules! start_node_using_chain_runtime { ($start_node_fn:ident($config:expr $(, $($args:expr),+)?) $($code:tt)*) => { match $config.chain_spec.runtime_id() { @@ -329,49 +358,18 @@ pub fn run() -> Result<()> { Some(Subcommand::Revert(cmd)) => construct_async_run!(|components, cli, cmd, config| { Ok(cmd.run(components.client, components.backend, None)) }), - Some(Subcommand::ExportGenesisState(params)) => { - let mut builder = sc_cli::LoggerBuilder::new(""); - builder.with_profiling(sc_tracing::TracingReceiver::Log, ""); - let _ = builder.init(); - - let spec = load_spec(¶ms.chain.clone().unwrap_or_default())?; - let state_version = Cli::native_runtime_version(&spec).state_version(); - let block: Block = generate_genesis_block(&spec, state_version)?; - let raw_header = block.header().encode(); - let output_buf = if params.raw { - raw_header - } else { - format!("0x{:?}", HexDisplay::from(&block.header().encode())).into_bytes() - }; - - if let Some(output) = ¶ms.output { - std::fs::write(output, output_buf)?; - } else { - std::io::stdout().write_all(&output_buf)?; - } - - Ok(()) + Some(Subcommand::ExportGenesisState(cmd)) => { + construct_sync_run!(|components, cli, cmd, _config| { + let spec = cli.load_spec(&cmd.shared_params.chain.clone().unwrap_or_default())?; + let state_version = Cli::native_runtime_version(&spec).state_version(); + cmd.run::(&*spec, state_version) + }) } - Some(Subcommand::ExportGenesisWasm(params)) => { - let mut builder = sc_cli::LoggerBuilder::new(""); - builder.with_profiling(sc_tracing::TracingReceiver::Log, ""); - let _ = builder.init(); - - let raw_wasm_blob = - extract_genesis_wasm(&cli.load_spec(¶ms.chain.clone().unwrap_or_default())?)?; - let output_buf = if params.raw { - raw_wasm_blob - } else { - format!("0x{:?}", HexDisplay::from(&raw_wasm_blob)).into_bytes() - }; - - if let Some(output) = ¶ms.output { - std::fs::write(output, output_buf)?; - } else { - std::io::stdout().write_all(&output_buf)?; - } - - Ok(()) + Some(Subcommand::ExportGenesisWasm(cmd)) => { + construct_sync_run!(|components, cli, cmd, _config| { + let spec = cli.load_spec(&cmd.shared_params.chain.clone().unwrap_or_default())?; + cmd.run(&*spec) + }) } Some(Subcommand::Benchmark(cmd)) => { use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE}; @@ -500,7 +498,7 @@ pub fn run() -> Result<()> { let state_version = RelayChainCli::native_runtime_version(&config.chain_spec).state_version(); - let block: Block = generate_genesis_block(&config.chain_spec, state_version) + let block: Block = generate_genesis_block(&*config.chain_spec, state_version) .map_err(|e| format!("{:?}", e))?; let genesis_state = format!("0x{:?}", HexDisplay::from(&block.header().encode())); let genesis_hash = format!("0x{:?}", HexDisplay::from(&block.header().hash().0)); From 7fd36cea2f6e00c02c67ccc1de9649ae404efd31 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 21 Jul 2022 09:55:18 +0200 Subject: [PATCH 0405/1274] refactor: remove `#[transactional]` from extrinsics Every extrinsic now runs in transaction implicitly, and `#[transactional]` on pallet dispatchable is now meaningless Upstream-Change: https://github.com/paritytech/substrate/issues/10806 Signed-off-by: Yaroslav Bolyukin --- pallets/evm-migration/src/lib.rs | 3 +- pallets/proxy-rmrk-core/src/lib.rs | 43 +++++++++++++++-------------- pallets/proxy-rmrk-equip/src/lib.rs | 10 +++---- pallets/unique/src/lib.rs | 31 +-------------------- 4 files changed, 29 insertions(+), 58 deletions(-) diff --git a/pallets/evm-migration/src/lib.rs b/pallets/evm-migration/src/lib.rs index e453a91dbd..598cc921a4 100644 --- a/pallets/evm-migration/src/lib.rs +++ b/pallets/evm-migration/src/lib.rs @@ -23,7 +23,7 @@ pub mod weights; #[frame_support::pallet] pub mod pallet { - use frame_support::{pallet_prelude::*, transactional}; + use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; use sp_core::{H160, H256}; use sp_std::vec::Vec; @@ -84,7 +84,6 @@ pub mod pallet { } #[pallet::weight(>::finish(code.len() as u32))] - #[transactional] pub fn finish(origin: OriginFor, address: H160, code: Vec) -> DispatchResult { ensure_root(origin)?; ensure!( diff --git a/pallets/proxy-rmrk-core/src/lib.rs b/pallets/proxy-rmrk-core/src/lib.rs index f46d71cae3..79a52f3bd2 100644 --- a/pallets/proxy-rmrk-core/src/lib.rs +++ b/pallets/proxy-rmrk-core/src/lib.rs @@ -145,7 +145,7 @@ #![cfg_attr(not(feature = "std"), no_std)] -use frame_support::{pallet_prelude::*, transactional, BoundedVec, dispatch::DispatchResult}; +use frame_support::{pallet_prelude::*, BoundedVec, dispatch::DispatchResult}; use frame_system::{pallet_prelude::*, ensure_signed}; use sp_runtime::{DispatchError, Permill, traits::StaticLookup}; use sp_std::{ @@ -350,11 +350,11 @@ pub mod pallet { /// * Anyone - will be assigned as the issuer of the collection. /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `metadata`: Metadata describing the collection, e.g. IPFS hash. Cannot be changed. /// - `max`: Optional maximum number of tokens. /// - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs. /// Analogous to Unique's [`token_prefix`](up_data_structs::Collection). Cannot be changed. - #[transactional] #[pallet::weight(>::create_collection())] pub fn create_collection( origin: OriginFor, @@ -426,8 +426,8 @@ pub mod pallet { /// * Collection issuer /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `collection_id`: RMRK ID of the collection to destroy. - #[transactional] #[pallet::weight(>::destroy_collection())] pub fn destroy_collection( origin: OriginFor, @@ -459,9 +459,9 @@ pub mod pallet { /// * Collection issuer /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `collection_id`: RMRK collection ID to change the issuer of. /// - `new_issuer`: Collection's new issuer. - #[transactional] #[pallet::weight(>::change_collection_issuer())] pub fn change_collection_issuer( origin: OriginFor, @@ -497,8 +497,8 @@ pub mod pallet { /// * Collection issuer /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `collection_id`: RMRK ID of the collection to lock. - #[transactional] #[pallet::weight(>::lock_collection())] pub fn lock_collection( origin: OriginFor, @@ -535,6 +535,7 @@ pub mod pallet { /// * Collection issuer /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `owner`: Owner account of the NFT. If set to None, defaults to the sender (collection issuer). /// - `collection_id`: RMRK collection ID for the NFT to be minted within. Cannot be changed. /// - `recipient`: Receiver account of the royalty. Has no effect if the `royalty_amount` is not set. Cannot be changed. @@ -542,7 +543,6 @@ pub mod pallet { /// - `metadata`: Arbitrary data about an NFT, e.g. IPFS hash. Cannot be changed. /// - `transferable`: Can this NFT be transferred? Cannot be changed. /// - `resources`: Resource data to be added to the NFT immediately after minting. - #[transactional] #[pallet::weight(>::mint_nft(resources.as_ref().map(|r| r.len() as u32).unwrap_or(0)))] pub fn mint_nft( origin: OriginFor, @@ -620,12 +620,12 @@ pub mod pallet { /// * Token owner /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `collection_id`: RMRK ID of the collection in which the NFT to burn belongs to. /// - `nft_id`: ID of the NFT to be destroyed. /// - `max_burns`: Maximum number of tokens to burn, assuming nesting. The transaction /// is reverted if there are more tokens to burn in the nesting tree than this number. /// This is primarily a mechanism of transaction weight control. - #[transactional] #[pallet::weight(>::burn_nft(*max_burns))] pub fn burn_nft( origin: OriginFor, @@ -669,10 +669,10 @@ pub mod pallet { /// - Token owner /// /// # Arguments: - /// - `collection_id`: RMRK ID of the collection of the NFT to be transferred. - /// - `nft_id`: ID of the NFT to be transferred. + /// - `origin`: sender of the transaction + /// - `rmrk_collection_id`: RMRK ID of the collection of the NFT to be transferred. + /// - `rmrk_nft_id`: ID of the NFT to be transferred. /// - `new_owner`: New owner of the nft which can be either an account or a NFT. - #[transactional] #[pallet::weight(>::send())] pub fn send( origin: OriginFor, @@ -793,11 +793,11 @@ pub mod pallet { /// - Token-owner-to-be /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `rmrk_collection_id`: RMRK collection ID of the NFT to be accepted. /// - `rmrk_nft_id`: ID of the NFT to be accepted. /// - `new_owner`: Either the sender's account ID or a sender-owned NFT, /// whichever the accepted NFT was sent to. - #[transactional] #[pallet::weight(>::accept_nft())] pub fn accept_nft( origin: OriginFor, @@ -885,9 +885,9 @@ pub mod pallet { /// - Token-owner-to-be-not /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `rmrk_collection_id`: RMRK ID of the NFT to be rejected. /// - `rmrk_nft_id`: ID of the NFT to be rejected. - #[transactional] #[pallet::weight(>::reject_nft())] pub fn reject_nft( origin: OriginFor, @@ -950,10 +950,11 @@ pub mod pallet { /// - Token owner /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `rmrk_collection_id`: RMRK collection ID of the NFT. /// - `rmrk_nft_id`: ID of the NFT with a pending resource to be accepted. /// - `resource_id`: ID of the newly created pending resource. - #[transactional] + /// accept the addition of a new resource to an existing NFT #[pallet::weight(>::accept_resource())] pub fn accept_resource( origin: OriginFor, @@ -1004,10 +1005,10 @@ pub mod pallet { /// - Token owner /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `rmrk_collection_id`: RMRK collection ID of the NFT. /// - `rmrk_nft_id`: ID of the NFT with a resource to be removed. /// - `resource_id`: ID of the removal-pending resource. - #[transactional] #[pallet::weight(>::accept_resource_removal())] pub fn accept_resource_removal( origin: OriginFor, @@ -1084,11 +1085,11 @@ pub mod pallet { /// - Token owner - in case of NFT property /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `rmrk_collection_id`: RMRK collection ID. /// - `maybe_nft_id`: Optional ID of the NFT. If left empty, then the property is set for the collection. /// - `key`: Key of the custom property to be referenced by. /// - `value`: Value of the custom property to be stored. - #[transactional] #[pallet::weight(>::set_property())] pub fn set_property( origin: OriginFor, @@ -1158,10 +1159,10 @@ pub mod pallet { /// - Token owner /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `rmrk_collection_id`: RMRK collection ID of the NFT. /// - `rmrk_nft_id`: ID of the NFT to rearrange resource priorities for. /// - `priorities`: Ordered vector of resource IDs. - #[transactional] #[pallet::weight(>::set_priority())] pub fn set_priority( origin: OriginFor, @@ -1209,10 +1210,10 @@ pub mod pallet { /// the owner's [acceptance](Pallet::accept_resource). /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `rmrk_collection_id`: RMRK collection ID of the NFT. /// - `nft_id`: ID of the NFT to assign a resource to. /// - `resource`: Data of the resource to be created. - #[transactional] #[pallet::weight(>::add_basic_resource())] pub fn add_basic_resource( origin: OriginFor, @@ -1251,10 +1252,10 @@ pub mod pallet { /// the owner's [acceptance](Pallet::accept_resource). /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `rmrk_collection_id`: RMRK collection ID of the NFT. /// - `nft_id`: ID of the NFT to assign a resource to. /// - `resource`: Data of the resource to be created. - #[transactional] #[pallet::weight(>::add_composable_resource())] pub fn add_composable_resource( origin: OriginFor, @@ -1313,10 +1314,10 @@ pub mod pallet { /// the owner's [acceptance](Pallet::accept_resource). /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `rmrk_collection_id`: RMRK collection ID of the NFT. /// - `nft_id`: ID of the NFT to assign a resource to. /// - `resource`: Data of the resource to be created. - #[transactional] #[pallet::weight(>::add_slot_resource())] pub fn add_slot_resource( origin: OriginFor, @@ -1354,10 +1355,10 @@ pub mod pallet { /// - Collection issuer /// /// # Arguments - /// - `collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to. + /// - `origin`: sender of the transaction + /// - `rmrk_collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to. /// - `nft_id`: ID of the NFT with a resource to be removed. /// - `resource_id`: ID of the resource to be removed. - #[transactional] #[pallet::weight(>::remove_resource())] pub fn remove_resource( origin: OriginFor, diff --git a/pallets/proxy-rmrk-equip/src/lib.rs b/pallets/proxy-rmrk-equip/src/lib.rs index 748a22a1b9..e1e36e349e 100644 --- a/pallets/proxy-rmrk-equip/src/lib.rs +++ b/pallets/proxy-rmrk-equip/src/lib.rs @@ -133,7 +133,7 @@ #![cfg_attr(not(feature = "std"), no_std)] -use frame_support::{pallet_prelude::*, transactional, BoundedVec, dispatch::DispatchResult}; +use frame_support::{pallet_prelude::*, BoundedVec, dispatch::DispatchResult}; use frame_system::{pallet_prelude::*, ensure_signed}; use sp_runtime::DispatchError; use up_data_structs::*; @@ -226,11 +226,11 @@ pub mod pallet { /// - Anyone - will be assigned as the issuer of the Base. /// /// # Arguments: + /// - `origin`: Caller, will be assigned as the issuer of the Base /// - `base_type`: Arbitrary media type, e.g. "svg". /// - `symbol`: Arbitrary client-chosen symbol. /// - `parts`: Array of Fixed and Slot Parts composing the Base, /// confined in length by [`RmrkPartsLimit`](up_data_structs::RmrkPartsLimit). - #[transactional] #[pallet::weight(>::create_base(parts.len() as u32))] pub fn create_base( origin: OriginFor, @@ -295,13 +295,13 @@ pub mod pallet { /// - Base issuer /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `base_id`: Base ID containing the Theme to be updated. /// - `theme`: Theme to add to the Base. A Theme has a name and properties, which are an /// array of [key, value, inherit]. /// - `key`: Arbitrary BoundedString, defined by client. /// - `value`: Arbitrary BoundedString, defined by client. /// - `inherit`: Optional bool. - #[transactional] #[pallet::weight(>::theme_add(theme.properties.len() as u32))] pub fn theme_add( origin: OriginFor, @@ -359,10 +359,10 @@ pub mod pallet { /// - Base issuer /// /// # Arguments: + /// - `origin`: sender of the transaction /// - `base_id`: Base containing the Slot Part to be updated. - /// - `part_id`: Slot Part whose Equippable List is being updated. + /// - `slot_id`: Slot Part whose Equippable List is being updated . /// - `equippables`: List of equippables that will override the current Equippables list. - #[transactional] #[pallet::weight(>::equippable())] pub fn equippable( origin: OriginFor, diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index 1ad2a12e1c..1837191c26 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -78,7 +78,6 @@ use frame_support::{ dispatch::DispatchResult, ensure, fail, weights::{Weight}, - transactional, pallet_prelude::{DispatchResultWithPostInfo, ConstU32}, BoundedVec, }; @@ -311,7 +310,6 @@ decl_module! { /// * `mode`: Type of items stored in the collection and type dependent data. // returns collection ID #[weight = >::create_collection()] - #[transactional] #[deprecated(note = "`create_collection_ex` is more up-to-date and advanced, prefer it instead")] pub fn create_collection( origin, @@ -342,7 +340,6 @@ decl_module! { /// /// * `data`: Explicit data of a collection used for its creation. #[weight = >::create_collection()] - #[transactional] pub fn create_collection_ex(origin, data: CreateCollectionData) -> DispatchResult { let sender = ensure_signed(origin)?; @@ -363,7 +360,6 @@ decl_module! { /// /// * `collection_id`: Collection to destroy. #[weight = >::destroy_collection()] - #[transactional] pub fn destroy_collection(origin, collection_id: CollectionId) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let collection = >::try_get(collection_id)?; @@ -399,7 +395,6 @@ decl_module! { /// * `collection_id`: ID of the modified collection. /// * `address`: ID of the address to be added to the allowlist. #[weight = >::add_to_allow_list()] - #[transactional] pub fn add_to_allow_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); @@ -433,7 +428,6 @@ decl_module! { /// * `collection_id`: ID of the modified collection. /// * `address`: ID of the address to be removed from the allowlist. #[weight = >::remove_from_allow_list()] - #[transactional] pub fn remove_from_allow_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); @@ -466,7 +460,6 @@ decl_module! { /// * `collection_id`: ID of the modified collection. /// * `new_owner`: ID of the account that will become the owner. #[weight = >::change_collection_owner()] - #[transactional] pub fn change_collection_owner(origin, collection_id: CollectionId, new_owner: T::AccountId) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); @@ -501,8 +494,7 @@ decl_module! { /// * `collection_id`: ID of the Collection to add an admin for. /// * `new_admin`: Address of new admin to add. #[weight = >::add_collection_admin()] - #[transactional] - pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin: T::CrossAccountId) -> DispatchResult { + pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin_id: T::CrossAccountId) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let collection = >::try_get(collection_id)?; collection.check_is_internal()?; @@ -530,7 +522,6 @@ decl_module! { /// * `collection_id`: ID of the collection to remove the admin for. /// * `account_id`: Address of the admin to remove. #[weight = >::remove_collection_admin()] - #[transactional] pub fn remove_collection_admin(origin, collection_id: CollectionId, account_id: T::CrossAccountId) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let collection = >::try_get(collection_id)?; @@ -558,7 +549,6 @@ decl_module! { /// * `collection_id`: ID of the modified collection. /// * `new_sponsor`: ID of the account of the sponsor-to-be. #[weight = >::set_collection_sponsor()] - #[transactional] pub fn set_collection_sponsor(origin, collection_id: CollectionId, new_sponsor: T::AccountId) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); @@ -590,7 +580,6 @@ decl_module! { /// /// * `collection_id`: ID of the collection with the pending sponsor. #[weight = >::confirm_sponsorship()] - #[transactional] pub fn confirm_sponsorship(origin, collection_id: CollectionId) -> DispatchResult { let sender = ensure_signed(origin)?; @@ -619,7 +608,6 @@ decl_module! { /// /// * `collection_id`: ID of the collection with the sponsor to remove. #[weight = >::remove_collection_sponsor()] - #[transactional] pub fn remove_collection_sponsor(origin, collection_id: CollectionId) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); @@ -654,7 +642,6 @@ decl_module! { /// * `owner`: Address of the initial owner of the item. /// * `data`: Token data describing the item to store on chain. #[weight = T::CommonWeightInfo::create_item()] - #[transactional] pub fn create_item(origin, collection_id: CollectionId, owner: T::CrossAccountId, data: CreateItemData) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let budget = budget::Value::new(NESTING_BUDGET); @@ -681,7 +668,6 @@ decl_module! { /// * `owner`: Address of the initial owner of the tokens. /// * `items_data`: Vector of data describing each item to be created. #[weight = T::CommonWeightInfo::create_multiple_items(&items_data)] - #[transactional] pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec) -> DispatchResultWithPostInfo { ensure!(!items_data.is_empty(), Error::::EmptyArgument); let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); @@ -703,7 +689,6 @@ decl_module! { /// * `properties`: Vector of key-value pairs stored as the collection's metadata. /// Keys support Latin letters, `-`, `_`, and `.` as symbols. #[weight = T::CommonWeightInfo::set_collection_properties(properties.len() as u32)] - #[transactional] pub fn set_collection_properties( origin, collection_id: CollectionId, @@ -729,7 +714,6 @@ decl_module! { /// * `property_keys`: Vector of keys of the properties to be deleted. /// Keys support Latin letters, `-`, `_`, and `.` as symbols. #[weight = T::CommonWeightInfo::delete_collection_properties(property_keys.len() as u32)] - #[transactional] pub fn delete_collection_properties( origin, collection_id: CollectionId, @@ -761,7 +745,6 @@ decl_module! { /// * `properties`: Vector of key-value pairs stored as the token's metadata. /// Keys support Latin letters, `-`, `_`, and `.` as symbols. #[weight = T::CommonWeightInfo::set_token_properties(properties.len() as u32)] - #[transactional] pub fn set_token_properties( origin, collection_id: CollectionId, @@ -792,7 +775,6 @@ decl_module! { /// * `property_keys`: Vector of keys of the properties to be deleted. /// Keys support Latin letters, `-`, `_`, and `.` as symbols. #[weight = T::CommonWeightInfo::delete_token_properties(property_keys.len() as u32)] - #[transactional] pub fn delete_token_properties( origin, collection_id: CollectionId, @@ -823,7 +805,6 @@ decl_module! { /// * `property_permissions`: Vector of permissions for property keys. /// Keys support Latin letters, `-`, `_`, and `.` as symbols. #[weight = T::CommonWeightInfo::set_token_property_permissions(property_permissions.len() as u32)] - #[transactional] pub fn set_token_property_permissions( origin, collection_id: CollectionId, @@ -852,7 +833,6 @@ decl_module! { /// * `collection_id`: ID of the collection to which the tokens would belong. /// * `data`: Explicit item creation data. #[weight = T::CommonWeightInfo::create_multiple_items_ex(&data)] - #[transactional] pub fn create_multiple_items_ex(origin, collection_id: CollectionId, data: CreateItemExData) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let budget = budget::Value::new(NESTING_BUDGET); @@ -871,7 +851,6 @@ decl_module! { /// * `collection_id`: ID of the collection. /// * `value`: New value of the flag, are transfers allowed? #[weight = >::set_transfers_enabled_flag()] - #[transactional] pub fn set_transfers_enabled_flag(origin, collection_id: CollectionId, value: bool) -> DispatchResult { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let mut target_collection = >::try_get(collection_id)?; @@ -901,7 +880,6 @@ decl_module! { /// * Fungible Mode: The desired number of pieces to burn. /// * Re-Fungible Mode: The desired number of pieces to burn. #[weight = T::CommonWeightInfo::burn_item()] - #[transactional] pub fn burn_item(origin, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); @@ -940,7 +918,6 @@ decl_module! { /// * Fungible Mode: The desired number of pieces to burn. /// * Re-Fungible Mode: The desired number of pieces to burn. #[weight = T::CommonWeightInfo::burn_from()] - #[transactional] pub fn burn_from(origin, collection_id: CollectionId, from: T::CrossAccountId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let budget = budget::Value::new(NESTING_BUDGET); @@ -970,7 +947,6 @@ decl_module! { /// * Fungible Mode: The desired number of pieces to transfer. /// * Re-Fungible Mode: The desired number of pieces to transfer. #[weight = T::CommonWeightInfo::transfer()] - #[transactional] pub fn transfer(origin, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let budget = budget::Value::new(NESTING_BUDGET); @@ -994,7 +970,6 @@ decl_module! { /// * `amount`: Number of pieces of the item approved for a transaction (maximum of 1 for NFTs). /// Set to 0 to revoke the approval. #[weight = T::CommonWeightInfo::approve()] - #[transactional] pub fn approve(origin, spender: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, amount: u128) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); @@ -1026,7 +1001,6 @@ decl_module! { /// * Fungible Mode: The desired number of pieces to transfer. /// * Re-Fungible Mode: The desired number of pieces to transfer. #[weight = T::CommonWeightInfo::transfer_from()] - #[transactional] pub fn transfer_from(origin, from: T::CrossAccountId, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128 ) -> DispatchResultWithPostInfo { let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?); let budget = budget::Value::new(NESTING_BUDGET); @@ -1047,7 +1021,6 @@ decl_module! { /// * `new_limit`: New limits of the collection. Fields that are not set (None) /// will not overwrite the old ones. #[weight = >::set_collection_limits()] - #[transactional] pub fn set_collection_limits( origin, collection_id: CollectionId, @@ -1081,7 +1054,6 @@ decl_module! { /// * `new_permission`: New permissions of the collection. Fields that are not set (None) /// will not overwrite the old ones. #[weight = >::set_collection_limits()] - #[transactional] pub fn set_collection_permissions( origin, collection_id: CollectionId, @@ -1114,7 +1086,6 @@ decl_module! { /// * `token_id`: ID of the RFT. /// * `amount`: New number of parts/pieces into which the token shall be partitioned. #[weight = T::RefungibleExtensionsWeightInfo::repartition()] - #[transactional] pub fn repartition( origin, collection_id: CollectionId, From a28a7b02b65c6d7d6f5304e77607b01da518b61d Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 12 Aug 2022 12:47:49 +0000 Subject: [PATCH 0406/1274] fix: restore frame-benchmarking in rft --- pallets/refungible/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index e61e68963e..5323bdeb3b 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -11,6 +11,7 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } From d9258db7c69002cb7860d9e69f28a19b7799d0a0 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 12 Aug 2022 12:48:18 +0000 Subject: [PATCH 0407/1274] fix(config): add missing config keys --- runtime/common/config/substrate.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/common/config/substrate.rs b/runtime/common/config/substrate.rs index f306393e9b..58e3f5db84 100644 --- a/runtime/common/config/substrate.rs +++ b/runtime/common/config/substrate.rs @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . use frame_support::{ - traits::{Everything, ConstU32}, + traits::{Everything, ConstU32, NeverEnsureOrigin}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}, DispatchClass, ConstantMultiplier, @@ -186,6 +186,7 @@ impl pallet_treasury::Config for Runtime { type Currency = Balances; type ApproveOrigin = EnsureRoot; type RejectOrigin = EnsureRoot; + type SpendOrigin = NeverEnsureOrigin; type Event = Event; type OnSlash = (); type ProposalBond = ProposalBond; @@ -197,6 +198,7 @@ impl pallet_treasury::Config for Runtime { type SpendFunds = (); type WeightInfo = pallet_treasury::weights::SubstrateWeight; type MaxApprovals = MaxApprovals; + type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; } impl pallet_sudo::Config for Runtime { From 38e6a9238999ae5417751cc9e8cb6c86661422f9 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 21 Jul 2022 10:03:46 +0200 Subject: [PATCH 0408/1274] test: upgrade dependencies Old polkadot.js is no longer able to generate types for upgraded node Signed-off-by: Yaroslav Bolyukin --- tests/README.md | 2 +- tests/package.json | 8 +- tests/src/rmrk/util/tx.ts | 2 +- tests/src/util/helpers.ts | 2 +- tests/yarn.lock | 1113 +++++++++++++++++++------------------ 5 files changed, 571 insertions(+), 556 deletions(-) diff --git a/tests/README.md b/tests/README.md index 3ecf35c785..fdb398ec4a 100644 --- a/tests/README.md +++ b/tests/README.md @@ -5,7 +5,7 @@ 1. Checkout polkadot in sibling folder with this project ```bash git clone https://github.com/paritytech/polkadot.git && cd polkadot -git checkout release-v0.9.24 +git checkout release-v0.9.25 ``` 2. Build with nightly-2022-05-11 diff --git a/tests/package.json b/tests/package.json index 8ff66fedeb..a667be32b2 100644 --- a/tests/package.json +++ b/tests/package.json @@ -5,7 +5,7 @@ "main": "", "devDependencies": { "@polkadot/ts": "0.4.22", - "@polkadot/typegen": "8.7.2-15", + "@polkadot/typegen": "8.12.2", "@types/chai": "^4.3.1", "@types/chai-as-promised": "^7.1.5", "@types/chai-like": "^1.1.1", @@ -92,9 +92,9 @@ "license": "SEE LICENSE IN ../LICENSE", "homepage": "", "dependencies": { - "@polkadot/api": "8.7.2-15", - "@polkadot/api-contract": "8.7.2-15", - "@polkadot/util-crypto": "9.4.1", + "@polkadot/api": "8.12.2", + "@polkadot/api-contract": "8.12.2", + "@polkadot/util-crypto": "10.0.2", "bignumber.js": "^9.0.2", "chai-as-promised": "^7.1.1", "chai-like": "^1.1.1", diff --git a/tests/src/rmrk/util/tx.ts b/tests/src/rmrk/util/tx.ts index fe18443a10..b218784baa 100644 --- a/tests/src/rmrk/util/tx.ts +++ b/tests/src/rmrk/util/tx.ts @@ -230,7 +230,7 @@ export async function mintNft( royaltyOptional, metadata, transferable, - resources, + resources as any, ); const events = await executeTransaction(api, issuer, tx); diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index 564934b08e..91c41f7da6 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -439,7 +439,7 @@ createCollection( tokenPrefix: strToUTF16(tokenPrefix), mode: modeprm as any, }); - const events = await submitTransactionAsync(sender, tx); + const events = await executeTransaction(api, sender, tx); return getCreateCollectionResult(events); } diff --git a/tests/yarn.lock b/tests/yarn.lock index 3b1e1ecb22..0fb4c81efb 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -10,150 +10,150 @@ "@jridgewell/gen-mapping" "^0.1.0" "@jridgewell/trace-mapping" "^0.3.9" -"@babel/code-frame@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" - integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== +"@babel/code-frame@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" + integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== dependencies: - "@babel/highlight" "^7.16.7" + "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.10.tgz#711dc726a492dfc8be8220028b1b92482362baab" - integrity sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw== +"@babel/compat-data@^7.18.6": + version "7.18.8" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.18.8.tgz#2483f565faca607b8535590e84e7de323f27764d" + integrity sha512-HSmX4WZPPK3FUxYp7g2T6EyO8j96HlZJlxmKPSh6KAcqwyDrfx7hKjXpAW/0FhFfTJsR0Yt4lAjLI2coMptIHQ== -"@babel/core@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.2.tgz#87b2fcd7cce9becaa7f5acebdc4f09f3dd19d876" - integrity sha512-A8pri1YJiC5UnkdrWcmfZTJTV85b4UXTAfImGmCfYmax4TR9Cw8sDS0MOk++Gp2mE/BefVJ5nwy5yzqNJbP/DQ== +"@babel/core@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.6.tgz#54a107a3c298aee3fe5e1947a6464b9b6faca03d" + integrity sha512-cQbWBpxcbbs/IUredIPkHiAGULLV8iwgNRMFzvbhEXISp4f3rUUXE5+TIw6KwUWUR3DwyI6gmBRnmAtYaWehwQ== dependencies: "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.18.2" - "@babel/helper-compilation-targets" "^7.18.2" - "@babel/helper-module-transforms" "^7.18.0" - "@babel/helpers" "^7.18.2" - "@babel/parser" "^7.18.0" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.18.2" - "@babel/types" "^7.18.2" + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.18.6" + "@babel/helper-compilation-targets" "^7.18.6" + "@babel/helper-module-transforms" "^7.18.6" + "@babel/helpers" "^7.18.6" + "@babel/parser" "^7.18.6" + "@babel/template" "^7.18.6" + "@babel/traverse" "^7.18.6" + "@babel/types" "^7.18.6" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.1" semver "^6.3.0" -"@babel/generator@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.2.tgz#33873d6f89b21efe2da63fe554460f3df1c5880d" - integrity sha512-W1lG5vUwFvfMd8HVXqdfbuG7RuaSrTCCD8cl8fP8wOivdbtbIg2Db3IWUcgvfxKbbn6ZBGYRW/Zk1MIwK49mgw== +"@babel/generator@^7.18.6", "@babel/generator@^7.18.7": + version "7.18.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.7.tgz#2aa78da3c05aadfc82dbac16c99552fc802284bd" + integrity sha512-shck+7VLlY72a2w9c3zYWuE1pwOKEiQHV7GTUbSnhyl5eu3i04t30tBY82ZRWrDfo3gkakCFtevExnxbkf2a3A== dependencies: - "@babel/types" "^7.18.2" - "@jridgewell/gen-mapping" "^0.3.0" + "@babel/types" "^7.18.7" + "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" -"@babel/helper-compilation-targets@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.2.tgz#67a85a10cbd5fc7f1457fec2e7f45441dc6c754b" - integrity sha512-s1jnPotJS9uQnzFtiZVBUxe67CuBa679oWFHpxYYnTpRL/1ffhyX44R9uYiXoa/pLXcY9H2moJta0iaanlk/rQ== +"@babel/helper-compilation-targets@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.6.tgz#18d35bfb9f83b1293c22c55b3d576c1315b6ed96" + integrity sha512-vFjbfhNCzqdeAtZflUFrG5YIFqGTqsctrtkZ1D/NB0mDW9TwW3GmmUepYY4G9wCET5rY5ugz4OGTcLd614IzQg== dependencies: - "@babel/compat-data" "^7.17.10" - "@babel/helper-validator-option" "^7.16.7" + "@babel/compat-data" "^7.18.6" + "@babel/helper-validator-option" "^7.18.6" browserslist "^4.20.2" semver "^6.3.0" -"@babel/helper-environment-visitor@^7.16.7", "@babel/helper-environment-visitor@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.2.tgz#8a6d2dedb53f6bf248e31b4baf38739ee4a637bd" - integrity sha512-14GQKWkX9oJzPiQQ7/J36FTXcD4kSp8egKjO9nINlSKiHITRA9q/R74qu8S9xlc/b/yjsJItQUeeh3xnGN0voQ== - -"@babel/helper-function-name@^7.17.9": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz#136fcd54bc1da82fcb47565cf16fd8e444b1ff12" - integrity sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg== - dependencies: - "@babel/template" "^7.16.7" - "@babel/types" "^7.17.0" - -"@babel/helper-hoist-variables@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" - integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-module-imports@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz#25612a8091a999704461c8a222d0efec5d091437" - integrity sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-module-transforms@^7.18.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.18.0.tgz#baf05dec7a5875fb9235bd34ca18bad4e21221cd" - integrity sha512-kclUYSUBIjlvnzN2++K9f2qzYKFgjmnmjwL4zlmU5f8ZtzgWe8s0rUPSTGy2HmK4P8T52MQsS+HTQAgZd3dMEA== - dependencies: - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-simple-access" "^7.17.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/helper-validator-identifier" "^7.16.7" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.18.0" - "@babel/types" "^7.18.0" - -"@babel/helper-simple-access@^7.17.7": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.18.2.tgz#4dc473c2169ac3a1c9f4a51cfcd091d1c36fcff9" - integrity sha512-7LIrjYzndorDY88MycupkpQLKS1AFfsVRm2k/9PtKScSy5tZq0McZTj+DiMRynboZfIqOKvo03pmhTaUgiD6fQ== - dependencies: - "@babel/types" "^7.18.2" - -"@babel/helper-split-export-declaration@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz#0b648c0c42da9d3920d85ad585f2778620b8726b" - integrity sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-validator-identifier@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" - integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== - -"@babel/helper-validator-option@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" - integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== - -"@babel/helpers@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.18.2.tgz#970d74f0deadc3f5a938bfa250738eb4ac889384" - integrity sha512-j+d+u5xT5utcQSzrh9p+PaJX94h++KN+ng9b9WEJq7pkUPAd61FGqhjuUEdfknb3E/uDBb7ruwEeKkIxNJPIrg== - dependencies: - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.18.2" - "@babel/types" "^7.18.2" - -"@babel/highlight@^7.16.7": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.17.12.tgz#257de56ee5afbd20451ac0a75686b6b404257351" - integrity sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg== - dependencies: - "@babel/helper-validator-identifier" "^7.16.7" +"@babel/helper-environment-visitor@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.6.tgz#b7eee2b5b9d70602e59d1a6cad7dd24de7ca6cd7" + integrity sha512-8n6gSfn2baOY+qlp+VSzsosjCVGFqWKmDF0cCWOybh52Dw3SEyoWR1KrhMJASjLwIEkkAufZ0xvr+SxLHSpy2Q== + +"@babel/helper-function-name@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.18.6.tgz#8334fecb0afba66e6d87a7e8c6bb7fed79926b83" + integrity sha512-0mWMxV1aC97dhjCah5U5Ua7668r5ZmSC2DLfH2EZnf9c3/dHZKiFa5pRLMH5tjSl471tY6496ZWk/kjNONBxhw== + dependencies: + "@babel/template" "^7.18.6" + "@babel/types" "^7.18.6" + +"@babel/helper-hoist-variables@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" + integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-module-imports@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" + integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-module-transforms@^7.18.6": + version "7.18.8" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.18.8.tgz#4f8408afead0188cfa48672f9d0e5787b61778c8" + integrity sha512-che3jvZwIcZxrwh63VfnFTUzcAM9v/lznYkkRxIBGMPt1SudOKHAEec0SIRCfiuIzTcF7VGj/CaTT6gY4eWxvA== + dependencies: + "@babel/helper-environment-visitor" "^7.18.6" + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-simple-access" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/helper-validator-identifier" "^7.18.6" + "@babel/template" "^7.18.6" + "@babel/traverse" "^7.18.8" + "@babel/types" "^7.18.8" + +"@babel/helper-simple-access@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz#d6d8f51f4ac2978068df934b569f08f29788c7ea" + integrity sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-split-export-declaration@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" + integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-validator-identifier@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz#9c97e30d31b2b8c72a1d08984f2ca9b574d7a076" + integrity sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g== + +"@babel/helper-validator-option@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" + integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== + +"@babel/helpers@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.18.6.tgz#4c966140eaa1fcaa3d5a8c09d7db61077d4debfd" + integrity sha512-vzSiiqbQOghPngUYt/zWGvK3LAsPhz55vc9XNN0xAl2gV4ieShI2OQli5duxWHD+72PZPTKAcfcZDE1Cwc5zsQ== + dependencies: + "@babel/template" "^7.18.6" + "@babel/traverse" "^7.18.6" + "@babel/types" "^7.18.6" + +"@babel/highlight@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" + integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== + dependencies: + "@babel/helper-validator-identifier" "^7.18.6" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.16.7", "@babel/parser@^7.18.0": - version "7.18.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.4.tgz#6774231779dd700e0af29f6ad8d479582d7ce5ef" - integrity sha512-FDge0dFazETFcxGw/EXzOkN8uJp0PC7Qbm+Pe9T+av2zlBpOgunFHkQPPn+eRuClU73JF+98D531UgayY89tow== +"@babel/parser@^7.18.6", "@babel/parser@^7.18.8": + version "7.18.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.8.tgz#822146080ac9c62dac0823bb3489622e0bc1cbdf" + integrity sha512-RSKRfYX20dyH+elbJK2uqAkVyucL+xXzhqlMD5/ZXx+dAAwpyB7HsvnHe/ZUGOF+xLr5Wx9/JoXVTj6BQE2/oA== -"@babel/register@^7.17.7": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.17.7.tgz#5eef3e0f4afc07e25e847720e7b987ae33f08d0b" - integrity sha512-fg56SwvXRifootQEDQAu1mKdjh5uthPzdO0N6t358FktfL4XjAVXuH58ULoiW8mesxiOgNIrxiImqEwv0+hRRA== +"@babel/register@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.18.6.tgz#48a4520f1b2a7d7ac861e8148caeb0cefe6c59db" + integrity sha512-tkYtONzaO8rQubZzpBnvZPFcHgh8D9F55IjOsYton4X2IBoyRn2ZSWQqySTZnUn2guZbxbQiAB27hJEbvXamhQ== dependencies: clone-deep "^4.0.1" find-cache-dir "^2.0.0" @@ -161,44 +161,44 @@ pirates "^4.0.5" source-map-support "^0.5.16" -"@babel/runtime@^7.17.9", "@babel/runtime@^7.18.3": - version "7.18.3" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.3.tgz#c7b654b57f6f63cf7f8b418ac9ca04408c4579f4" - integrity sha512-38Y8f7YUhce/K7RMwTp7m0uCumpv9hZkitCbBClqQIow1qSbCvGkcegKOXpEWCQLfWmevgRiWokZ1GkpfhbZug== +"@babel/runtime@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.6.tgz#6a1ef59f838debd670421f8c7f2cbb8da9751580" + integrity sha512-t9wi7/AW6XtKahAe20Yw0/mMljKq0B1r2fPdvaAdV/KPDZewFXdaaa6K7lxmZBZ8FBNpCiAT6iHPmd6QO9bKfQ== dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" - integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/parser" "^7.16.7" - "@babel/types" "^7.16.7" - -"@babel/traverse@^7.18.0", "@babel/traverse@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.2.tgz#b77a52604b5cc836a9e1e08dca01cba67a12d2e8" - integrity sha512-9eNwoeovJ6KH9zcCNnENY7DMFwTU9JdGCFtqNLfUAqtUHRCOsTOqWoffosP8vKmNYeSBUv3yVJXjfd8ucwOjUA== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.18.2" - "@babel/helper-environment-visitor" "^7.18.2" - "@babel/helper-function-name" "^7.17.9" - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.18.0" - "@babel/types" "^7.18.2" +"@babel/template@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.6.tgz#1283f4993e00b929d6e2d3c72fdc9168a2977a31" + integrity sha512-JoDWzPe+wgBsTTgdnIma3iHNFC7YVJoPssVBDjiHfNlyt4YcunDtcDOUmfVDfCK5MfdsaIoX9PkijPhjH3nYUw== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/parser" "^7.18.6" + "@babel/types" "^7.18.6" + +"@babel/traverse@^7.18.6", "@babel/traverse@^7.18.8": + version "7.18.8" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.8.tgz#f095e62ab46abf1da35e5a2011f43aee72d8d5b0" + integrity sha512-UNg/AcSySJYR/+mIcJQDCv00T+AqRO7j/ZEJLzpaYtgM48rMg5MnkJgyNqkzo88+p4tfRvZJCEiwwfG6h4jkRg== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.18.7" + "@babel/helper-environment-visitor" "^7.18.6" + "@babel/helper-function-name" "^7.18.6" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/parser" "^7.18.8" + "@babel/types" "^7.18.8" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.16.7", "@babel/types@^7.17.0", "@babel/types@^7.18.0", "@babel/types@^7.18.2": - version "7.18.4" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.4.tgz#27eae9b9fd18e9dccc3f9d6ad051336f307be354" - integrity sha512-ThN1mBcMq5pG/Vm2IcBmPPfyPXbd8S02rS+OBIDENdufvqC7Z/jHPCv9IcP01277aKtDI8g/2XysBN4hA8niiw== +"@babel/types@^7.18.6", "@babel/types@^7.18.7", "@babel/types@^7.18.8": + version "7.18.8" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.8.tgz#c5af199951bf41ba4a6a9a6d0d8ad722b30cd42f" + integrity sha512-qwpdsmraq0aJ3osLJRApsc2ouSJCdnMeZwB0DhbtHAtRpZNZCdlbRnHIgcRKzdE1g0iOGg644fzjOBcdOz9cPw== dependencies: - "@babel/helper-validator-identifier" "^7.16.7" + "@babel/helper-validator-identifier" "^7.18.6" to-fast-properties "^2.0.0" "@cspotcode/source-map-support@^0.8.0": @@ -437,12 +437,12 @@ "@jridgewell/set-array" "^1.0.0" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/gen-mapping@^0.3.0": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.1.tgz#cf92a983c83466b8c0ce9124fadeaf09f7c66ea9" - integrity sha512-GcHwniMlA2z+WFPWuY8lp3fsza0I8xPFMWL5+n8LYyP6PSvPrXf4+n8stDHZY2DM0zy9sVkRDy1jDI4XGzYVqg== +"@jridgewell/gen-mapping@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" + integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== dependencies: - "@jridgewell/set-array" "^1.0.0" + "@jridgewell/set-array" "^1.0.1" "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" @@ -456,6 +456,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.1.tgz#36a6acc93987adcf0ba50c66908bd0b70de8afea" integrity sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ== +"@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.13" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz#b6461fb0c2964356c469e115f504c95ad97ab88c" @@ -477,15 +482,15 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@noble/hashes@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.0.0.tgz#d5e38bfbdaba174805a4e649f13be9a9ed3351ae" - integrity sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg== +"@noble/hashes@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183" + integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA== -"@noble/secp256k1@1.5.5": - version "1.5.5" - resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.5.5.tgz#315ab5745509d1a8c8e90d0bdf59823ccf9bcfc3" - integrity sha512-sZ1W6gQzYnu45wPrWx8D3kwI2/U29VYTx9OjbDAd7jwRItJ0cSTMPRL/C8AWZFn9kWFLQGqEXVEE86w4Z8LpIQ== +"@noble/secp256k1@1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.6.0.tgz#602afbbfcfb7e169210469b697365ef740d7e930" + integrity sha512-DWSsg8zMHOYMYBqIQi96BQuthZrp98LCeMNcUOaffCIVYQ5yxDbNikLF+H7jEnmNNmXbtVic46iCuVWzar+MgA== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -508,142 +513,142 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@polkadot/api-augment@8.7.2-15": - version "8.7.2-15" - resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-8.7.2-15.tgz#a141d3cd595a39e7e2965330268b5eb92bdd5849" - integrity sha512-QGXosX6p0RFYNhWepZCIaRiyCvHnVt5Pb6U7/77UxIszgGRHfHFDsYr4v5bGiaRTOj/E8moc2Ufi/+VgOiG9sw== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/api-base" "8.7.2-15" - "@polkadot/rpc-augment" "8.7.2-15" - "@polkadot/types" "8.7.2-15" - "@polkadot/types-augment" "8.7.2-15" - "@polkadot/types-codec" "8.7.2-15" - "@polkadot/util" "^9.4.1" - -"@polkadot/api-base@8.7.2-15": - version "8.7.2-15" - resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-8.7.2-15.tgz#c909d3bf0fbfb3cc46ca7067199e36e72b959bdb" - integrity sha512-HXdtaqbpnfFbOazjI9CPSYM37S4mzhxUs8hLMKrWqpHL//at4tiMa5dRyev9VSKeE6gqeqCT9JTBvEAZ9eNR6Q== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/rpc-core" "8.7.2-15" - "@polkadot/types" "8.7.2-15" - "@polkadot/util" "^9.4.1" +"@polkadot/api-augment@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-8.12.2.tgz#413ae9c99df0a4fb2135fee3f7b9e0caa913fcfd" + integrity sha512-HbvNOu6ntago8nYqLkq/HZ+gsMhbKe/sD4hPIFPruhP6OAnW6TWNIlqc2ruFx2KrT0rfzXUZ4Gmk4WgyRFuz4Q== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/api-base" "8.12.2" + "@polkadot/rpc-augment" "8.12.2" + "@polkadot/types" "8.12.2" + "@polkadot/types-augment" "8.12.2" + "@polkadot/types-codec" "8.12.2" + "@polkadot/util" "^10.0.2" + +"@polkadot/api-base@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-8.12.2.tgz#15fbf89b14d6918027b7bf7f87b218a675ae82d6" + integrity sha512-5rLOCulXNU/g0rUVoW6ArQjOBq/07S6oKR9nOJls6W4PUhYcBIClCTlXx2uoDszMdwhEhYyHQ67bnoTcRrYcLA== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/rpc-core" "8.12.2" + "@polkadot/types" "8.12.2" + "@polkadot/util" "^10.0.2" rxjs "^7.5.5" -"@polkadot/api-contract@8.7.2-15": - version "8.7.2-15" - resolved "https://registry.yarnpkg.com/@polkadot/api-contract/-/api-contract-8.7.2-15.tgz#687706fb4bd33c4a88187db3a269292f6e559892" - integrity sha512-Pr1Nm5zBpW9foCKm/Q6hIT5KHCeFVE8EFSfHBgjbitYpFOGnz19kduEpa0vxIcfq2WVXcVPTQ2eqjGtHoThNqA== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/api" "8.7.2-15" - "@polkadot/types" "8.7.2-15" - "@polkadot/types-codec" "8.7.2-15" - "@polkadot/types-create" "8.7.2-15" - "@polkadot/util" "^9.4.1" - "@polkadot/util-crypto" "^9.4.1" +"@polkadot/api-contract@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@polkadot/api-contract/-/api-contract-8.12.2.tgz#9dddd83eb0ae40fce806fe2e32d319134a28ae4c" + integrity sha512-YuyVamnp9q5VAWN9WOYsaWKnH1/MERtCzsG5/saopgGrEjfYRqyuLA+VVFaAoxEAdPfJew0AQDHjbR2H2+C9nQ== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/api" "8.12.2" + "@polkadot/types" "8.12.2" + "@polkadot/types-codec" "8.12.2" + "@polkadot/types-create" "8.12.2" + "@polkadot/util" "^10.0.2" + "@polkadot/util-crypto" "^10.0.2" rxjs "^7.5.5" -"@polkadot/api-derive@8.7.2-15": - version "8.7.2-15" - resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-8.7.2-15.tgz#b29f24d435c036c9bf5624d18a9d93196cf2c4f4" - integrity sha512-0R3M9LFKoQ0d7elIDQjPKuV5EAHTtkU/72Lgxw2GYStsOqcnfFNomfLoLMuk8Xy4ETUAp/Kq1eMJpvsY6hSTtA== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/api" "8.7.2-15" - "@polkadot/api-augment" "8.7.2-15" - "@polkadot/api-base" "8.7.2-15" - "@polkadot/rpc-core" "8.7.2-15" - "@polkadot/types" "8.7.2-15" - "@polkadot/types-codec" "8.7.2-15" - "@polkadot/util" "^9.4.1" - "@polkadot/util-crypto" "^9.4.1" +"@polkadot/api-derive@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-8.12.2.tgz#eec954f6421356caf52584fe5c15e7d96c6c3d29" + integrity sha512-F7HCAVNXLQphv7OYVcq7GM5CP6RzGvYfTqutmc5GZFCDVMDY9RQA+a/3T5BIjJXrtepPa0pcYvt9fcovsazhZw== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/api" "8.12.2" + "@polkadot/api-augment" "8.12.2" + "@polkadot/api-base" "8.12.2" + "@polkadot/rpc-core" "8.12.2" + "@polkadot/types" "8.12.2" + "@polkadot/types-codec" "8.12.2" + "@polkadot/util" "^10.0.2" + "@polkadot/util-crypto" "^10.0.2" rxjs "^7.5.5" -"@polkadot/api@8.7.2-15": - version "8.7.2-15" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-8.7.2-15.tgz#c7ede416e4d277c227fc93fdfdc4d27634935d08" - integrity sha512-tzEUWsXIPzPbnpn/3LTGtJ7SXzMgCJ/da5d9q0UH3vsx1gDEjuZEWXOeSYLHgbqQSgwPukvMVuGtRjcC+A/WZQ== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/api-augment" "8.7.2-15" - "@polkadot/api-base" "8.7.2-15" - "@polkadot/api-derive" "8.7.2-15" - "@polkadot/keyring" "^9.4.1" - "@polkadot/rpc-augment" "8.7.2-15" - "@polkadot/rpc-core" "8.7.2-15" - "@polkadot/rpc-provider" "8.7.2-15" - "@polkadot/types" "8.7.2-15" - "@polkadot/types-augment" "8.7.2-15" - "@polkadot/types-codec" "8.7.2-15" - "@polkadot/types-create" "8.7.2-15" - "@polkadot/types-known" "8.7.2-15" - "@polkadot/util" "^9.4.1" - "@polkadot/util-crypto" "^9.4.1" +"@polkadot/api@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-8.12.2.tgz#5ade99fd595b712f647cf4d63ce5a6daa6d0fff7" + integrity sha512-bK3bhCFqCYTx/K/89QF88jYqE3Dc1LmCwMnwpof6adlAj5DoEjRfSmKarqrZqox516Xph1+84ACNkyem0KnIWA== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/api-augment" "8.12.2" + "@polkadot/api-base" "8.12.2" + "@polkadot/api-derive" "8.12.2" + "@polkadot/keyring" "^10.0.2" + "@polkadot/rpc-augment" "8.12.2" + "@polkadot/rpc-core" "8.12.2" + "@polkadot/rpc-provider" "8.12.2" + "@polkadot/types" "8.12.2" + "@polkadot/types-augment" "8.12.2" + "@polkadot/types-codec" "8.12.2" + "@polkadot/types-create" "8.12.2" + "@polkadot/types-known" "8.12.2" + "@polkadot/util" "^10.0.2" + "@polkadot/util-crypto" "^10.0.2" eventemitter3 "^4.0.7" rxjs "^7.5.5" -"@polkadot/keyring@^9.4.1": - version "9.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-9.4.1.tgz#4bc8d1c1962756841742abac0d7e4ef233d9c2a9" - integrity sha512-op6Tj8E9GHeZYvEss38FRUrX+GlBj6qiwF4BlFrAvPqjPnRn8TT9NhRLroiCwvxeNg3uMtEF/5xB+vvdI0I6qw== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/util" "9.4.1" - "@polkadot/util-crypto" "9.4.1" - -"@polkadot/networks@9.4.1", "@polkadot/networks@^9.4.1": - version "9.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-9.4.1.tgz#acdf3d64421ce0e3d3ba68797fc29a28ee40c185" - integrity sha512-ibH8bZ2/XMXv0XEsP1fGOqNnm2mg1rHo5kHXSJ3QBcZJFh1+xkI4Ovl2xrFfZ+SYATA3Wsl5R6knqimk2EqyJQ== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/util" "9.4.1" - "@substrate/ss58-registry" "^1.22.0" - -"@polkadot/rpc-augment@8.7.2-15": - version "8.7.2-15" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-8.7.2-15.tgz#6175126968dfb79ba5549b03cac8c3860666e72b" - integrity sha512-IgfkR9CHT8jDuGYkb75DBFu+yJNW32+vOt3oS0sf57VqkHketSq9rD3mtZD37V/21Q4a17yrqKQOte7mMl9kcg== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/rpc-core" "8.7.2-15" - "@polkadot/types" "8.7.2-15" - "@polkadot/types-codec" "8.7.2-15" - "@polkadot/util" "^9.4.1" - -"@polkadot/rpc-core@8.7.2-15": - version "8.7.2-15" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-8.7.2-15.tgz#827a31adf833fb866cb5f39dbd86c5f0b44d63a4" - integrity sha512-yGmpESOmGyzY7+D3yUxbKToz/eP/q8vDyOGajLnHn12TcnjgbAfMdc4xdU6cQex+mSsPwS0YQFuPrPXGloCOHA== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/rpc-augment" "8.7.2-15" - "@polkadot/rpc-provider" "8.7.2-15" - "@polkadot/types" "8.7.2-15" - "@polkadot/util" "^9.4.1" +"@polkadot/keyring@^10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-10.0.2.tgz#4e6cc008a16cf7bb1b95694857c16295ca2135ae" + integrity sha512-N/lx/e9alR/lUREap4hQ/YKa+CKCFIa4QOKLz8eFhpqhbA5M5nQcjrppitO+sX/XlpmbOBpbnO168cU2dA09Iw== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/util" "10.0.2" + "@polkadot/util-crypto" "10.0.2" + +"@polkadot/networks@10.0.2", "@polkadot/networks@^10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.0.2.tgz#864f08cdbd4cf7c65a82721f3008169222a53148" + integrity sha512-K7hUFmErTrBtkobhvFwT/oPEQrI1oVr7WfngquM+zN0oHiHzRspecxifGKsQ1kw78F7zrZKOBScW/hoJbdI8fA== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/util" "10.0.2" + "@substrate/ss58-registry" "^1.23.0" + +"@polkadot/rpc-augment@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-8.12.2.tgz#7afe41a6230a117485991ce108f6ffe341e72bb3" + integrity sha512-FKVMmkYhWJNcuXpRN9t7xTX5agSgcgniP8gNPMhL6GV8lV3Xoxs8gLgVy32xeAh7gxArN/my6LnYPtXVkdFALQ== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/rpc-core" "8.12.2" + "@polkadot/types" "8.12.2" + "@polkadot/types-codec" "8.12.2" + "@polkadot/util" "^10.0.2" + +"@polkadot/rpc-core@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-8.12.2.tgz#d8d53240276f0e2df3f4e6540acbb35949a2c56e" + integrity sha512-RLhzNYJonfsQXYhZuyVBSsOwSgCf+8ijS3aUcv06yrFf26k7nXw2Uc4P0Io3jY/wq5LnvkKzL+HSj6j7XZ+/Sg== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/rpc-augment" "8.12.2" + "@polkadot/rpc-provider" "8.12.2" + "@polkadot/types" "8.12.2" + "@polkadot/util" "^10.0.2" rxjs "^7.5.5" -"@polkadot/rpc-provider@8.7.2-15": - version "8.7.2-15" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-8.7.2-15.tgz#99dd30085284442265225e0f12aef3849b7bfe44" - integrity sha512-EwgBnUIpGhEfSanDXVviQQ784HYD3DWUPdv9pIvn9qnCZPk7o+MGPvKW73A+XbQpPV9j8tAGnVsSnbDuoSVp1g== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/keyring" "^9.4.1" - "@polkadot/types" "8.7.2-15" - "@polkadot/types-support" "8.7.2-15" - "@polkadot/util" "^9.4.1" - "@polkadot/util-crypto" "^9.4.1" - "@polkadot/x-fetch" "^9.4.1" - "@polkadot/x-global" "^9.4.1" - "@polkadot/x-ws" "^9.4.1" - "@substrate/connect" "0.7.5" +"@polkadot/rpc-provider@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-8.12.2.tgz#e3f6ddf98955bb4a8431342f5f9d39dc01c3555b" + integrity sha512-fgXKAYDmc1kGmOPa2Nuh+LsUBFvUzgzP/tOEbS5UJpoc0+azZfTLWh2AXpo/gVHblR6zZBDWrB3wmGzu6wF17A== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/keyring" "^10.0.2" + "@polkadot/types" "8.12.2" + "@polkadot/types-support" "8.12.2" + "@polkadot/util" "^10.0.2" + "@polkadot/util-crypto" "^10.0.2" + "@polkadot/x-fetch" "^10.0.2" + "@polkadot/x-global" "^10.0.2" + "@polkadot/x-ws" "^10.0.2" + "@substrate/connect" "0.7.7" eventemitter3 "^4.0.7" mock-socket "^9.1.5" - nock "^13.2.6" + nock "^13.2.8" "@polkadot/ts@0.4.22": version "0.4.22" @@ -652,235 +657,236 @@ dependencies: "@types/chrome" "^0.0.171" -"@polkadot/typegen@8.7.2-15": - version "8.7.2-15" - resolved "https://registry.yarnpkg.com/@polkadot/typegen/-/typegen-8.7.2-15.tgz#06e9d054db1c63d9862186429a8017b2b80bce2a" - integrity sha512-NC8Ticirh20k1Co17D8cqQawIJ8W9HWDuq6oDyEMT4XkeBbZ1hQRO9JBO14neWDJmYJBhlUotP65jgjs8D5bMw== - dependencies: - "@babel/core" "^7.18.2" - "@babel/register" "^7.17.7" - "@babel/runtime" "^7.18.3" - "@polkadot/api" "8.7.2-15" - "@polkadot/api-augment" "8.7.2-15" - "@polkadot/rpc-augment" "8.7.2-15" - "@polkadot/rpc-provider" "8.7.2-15" - "@polkadot/types" "8.7.2-15" - "@polkadot/types-augment" "8.7.2-15" - "@polkadot/types-codec" "8.7.2-15" - "@polkadot/types-create" "8.7.2-15" - "@polkadot/types-support" "8.7.2-15" - "@polkadot/util" "^9.4.1" - "@polkadot/x-ws" "^9.4.1" +"@polkadot/typegen@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@polkadot/typegen/-/typegen-8.12.2.tgz#b8d4fa567b187a2987804d51c85d66e2c899748a" + integrity sha512-hI33NtlsrMbF22iwT/i3kZ8ZsgScR8GnYztafKVau+8lVbSiA0BCKSHtKhUA8j/G2NsI62pWezsk7pbGJCcwTQ== + dependencies: + "@babel/core" "^7.18.6" + "@babel/register" "^7.18.6" + "@babel/runtime" "^7.18.6" + "@polkadot/api" "8.12.2" + "@polkadot/api-augment" "8.12.2" + "@polkadot/rpc-augment" "8.12.2" + "@polkadot/rpc-provider" "8.12.2" + "@polkadot/types" "8.12.2" + "@polkadot/types-augment" "8.12.2" + "@polkadot/types-codec" "8.12.2" + "@polkadot/types-create" "8.12.2" + "@polkadot/types-support" "8.12.2" + "@polkadot/util" "^10.0.2" + "@polkadot/util-crypto" "^10.0.2" + "@polkadot/x-ws" "^10.0.2" handlebars "^4.7.7" websocket "^1.0.34" yargs "^17.5.1" -"@polkadot/types-augment@8.7.2-15": - version "8.7.2-15" - resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-8.7.2-15.tgz#7ab077a1a31190ad17183196efb1da065c0d0bcd" - integrity sha512-th1jVBDqpyQVB2gCNzo/HV0dIeNinjyPla01BFdhQ5mDKYXJ8fugsLCk5oKUPpItBrj+5NWCgynVvCwm0YJw3g== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/types" "8.7.2-15" - "@polkadot/types-codec" "8.7.2-15" - "@polkadot/util" "^9.4.1" - -"@polkadot/types-codec@8.7.2-15": - version "8.7.2-15" - resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-8.7.2-15.tgz#6afa4ff45dc7afb9250f283f70a40be641367941" - integrity sha512-k8t7/Ern7sY4ZKQc5cYY3h1bg7/GAEaTPmKz094DhPJmEhi3NNgeJ4uyeB/JYCo5GbxXQG6W2M021s582urjMw== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/util" "^9.4.1" - -"@polkadot/types-create@8.7.2-15": - version "8.7.2-15" - resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-8.7.2-15.tgz#106a11eb71dc2743b140d8640a3b3e7fc5ccf10e" - integrity sha512-xB9jAJ3XQh/U05b+X77m5TPh4N9oBwwpePkAmLhovTSOSeobj7qeUKrZqccs0BSxJnJPlLwrwuusjeTtTfZCHw== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/types-codec" "8.7.2-15" - "@polkadot/util" "^9.4.1" - -"@polkadot/types-known@8.7.2-15": - version "8.7.2-15" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-8.7.2-15.tgz#171b8d3963a5c38d46f98a7c14be59033f9a4da8" - integrity sha512-c5YuuauPCu70chDnV7Fphh7SbAQl8JWj+PoY37I5BACCNFxtUx5KnP93BChiD0QxcHs2QqD6RdjW6O7cVRUKfA== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/networks" "^9.4.1" - "@polkadot/types" "8.7.2-15" - "@polkadot/types-codec" "8.7.2-15" - "@polkadot/types-create" "8.7.2-15" - "@polkadot/util" "^9.4.1" - -"@polkadot/types-support@8.7.2-15": - version "8.7.2-15" - resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-8.7.2-15.tgz#2d726e3d5615383ca97db3f32ee21e2aad077fcb" - integrity sha512-Tl6xm9r/uqrKQK1OUdi5X9MaTgplBYPj3tY9677ZPV7QGYWt0Uz912u9fC2v0PGNReDXtzvrlgvk0aoErwzF5Q== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/util" "^9.4.1" - -"@polkadot/types@8.7.2-15": - version "8.7.2-15" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-8.7.2-15.tgz#5b25b6b76c916637a1d15133b5880a73079e65bc" - integrity sha512-KfJKzk6/Ta8vZVJH8+xYYPvd9SD+4fdl4coGgKuPGYZFsjDGnYvAX4ls6/WKby51JK5s24sqaUP3vZisIgh4wA== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/keyring" "^9.4.1" - "@polkadot/types-augment" "8.7.2-15" - "@polkadot/types-codec" "8.7.2-15" - "@polkadot/types-create" "8.7.2-15" - "@polkadot/util" "^9.4.1" - "@polkadot/util-crypto" "^9.4.1" +"@polkadot/types-augment@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-8.12.2.tgz#b43d21a993d7cf8c7cd4721a2327e19dd924d255" + integrity sha512-47+T12u7HV+g22KryirG7fik5lU1tHgu39wLv8YZ/6jD1hVvgE632fvaCp4qje1F3M82aXobfekO+WOPLCZVsg== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/types" "8.12.2" + "@polkadot/types-codec" "8.12.2" + "@polkadot/util" "^10.0.2" + +"@polkadot/types-codec@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-8.12.2.tgz#7bec61d0ba751bb2cd72f93b5b81d058fa4affc5" + integrity sha512-NDa2ZJpJMWC9Un3PtvkyJF86M80gLqSmPyjIR8xxp0DzcD5EsCL8EV79xcOWUGm2lws1C66a4t4He/8ZwPNUqg== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/util" "^10.0.2" + "@polkadot/x-bigint" "^10.0.2" + +"@polkadot/types-create@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-8.12.2.tgz#f5fa6e1b1eb2b60372cd61950b1ab1c4482bcfd6" + integrity sha512-D+Sfj+TwvipO+wl4XbsVkw5AgFdpy5O2JY88CV6L26EGU2OqCcTuenwSGdrsiLWW65m97q9lP7SUphUh39vBhA== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/types-codec" "8.12.2" + "@polkadot/util" "^10.0.2" + +"@polkadot/types-known@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-8.12.2.tgz#1b8a18be24b4ee624b90831870d9db227f3cb769" + integrity sha512-8HCZ3AkczBrCl+TUZD0+2ubLr0BQx+0f/Nnl9yuz1pWygmSEpHrYspmFtDdpMJnNTGZo8vHNOa7smdlijJqlhw== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/networks" "^10.0.2" + "@polkadot/types" "8.12.2" + "@polkadot/types-codec" "8.12.2" + "@polkadot/types-create" "8.12.2" + "@polkadot/util" "^10.0.2" + +"@polkadot/types-support@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-8.12.2.tgz#b4f999cc63da21d8b73de621035c9d3e75386d8b" + integrity sha512-tTksJ4COcVonu/beWQKkF/6fKaArmTwM6iCuxn2PuJziS2Cm1+7D8Rh3ODwwZOseFvHPEco6jnb4DWNclXbZiA== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/util" "^10.0.2" + +"@polkadot/types@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-8.12.2.tgz#c5fd35e1d5cfc52b64b6968b16950d7ab19bb8f7" + integrity sha512-hOqLunz4YH51B6AvuemX1cXKf+O8pehEoP3lH+FRKfJ7wyVhqa3WA+aUXhoTQBIuSiOjjC/FEJrRO5AoNO2iCg== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/keyring" "^10.0.2" + "@polkadot/types-augment" "8.12.2" + "@polkadot/types-codec" "8.12.2" + "@polkadot/types-create" "8.12.2" + "@polkadot/util" "^10.0.2" + "@polkadot/util-crypto" "^10.0.2" rxjs "^7.5.5" -"@polkadot/util-crypto@9.4.1", "@polkadot/util-crypto@^9.4.1": - version "9.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-9.4.1.tgz#af50d9b3e3fcf9760ee8eb262b1cc61614c21d98" - integrity sha512-V6xMOjdd8Kt/QmXlcDYM4WJDAmKuH4vWSlIcMmkFHnwH/NtYVdYIDZswLQHKL8gjLijPfVTHpWaJqNFhGpZJEg== - dependencies: - "@babel/runtime" "^7.18.3" - "@noble/hashes" "1.0.0" - "@noble/secp256k1" "1.5.5" - "@polkadot/networks" "9.4.1" - "@polkadot/util" "9.4.1" - "@polkadot/wasm-crypto" "^6.1.1" - "@polkadot/x-bigint" "9.4.1" - "@polkadot/x-randomvalues" "9.4.1" - "@scure/base" "1.0.0" +"@polkadot/util-crypto@10.0.2", "@polkadot/util-crypto@^10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.0.2.tgz#4fd78ebe8d8d95089c8bbff1e4e416fd03f9df4f" + integrity sha512-0uJFvu5cpRBep0/AcpA8vnXH3gnoe+ADiMKD93AekjxrOVqlrjVHKIf+FbiGv1paRKISxoO5Q2j7nCvDsi1q5w== + dependencies: + "@babel/runtime" "^7.18.6" + "@noble/hashes" "1.1.2" + "@noble/secp256k1" "1.6.0" + "@polkadot/networks" "10.0.2" + "@polkadot/util" "10.0.2" + "@polkadot/wasm-crypto" "^6.2.3" + "@polkadot/x-bigint" "10.0.2" + "@polkadot/x-randomvalues" "10.0.2" + "@scure/base" "1.1.1" ed2curve "^0.3.0" tweetnacl "^1.0.3" -"@polkadot/util@9.4.1", "@polkadot/util@^9.4.1": - version "9.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-9.4.1.tgz#49446e88b1231b0716bf6b4eb4818145f08a1294" - integrity sha512-z0HcnIe3zMWyK1s09wQIwc1M8gDKygSF9tDAbC8H9KDeIRZB2ldhwWEFx/1DJGOgFFrmRfkxeC6dcDpfzQhFow== +"@polkadot/util@10.0.2", "@polkadot/util@^10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.0.2.tgz#0ef2b7f5c4e884147c2fd58c4d55f2ee0c437a9a" + integrity sha512-jE1b6Zzltsb/GJV5sFmTSQOlYLd3fipY+DeLS9J+BbsWZW6uUc5x+FNm4pLrYxF1IqiZxwBv1Vi89L14uWZ1rw== dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/x-bigint" "9.4.1" - "@polkadot/x-global" "9.4.1" - "@polkadot/x-textdecoder" "9.4.1" - "@polkadot/x-textencoder" "9.4.1" + "@babel/runtime" "^7.18.6" + "@polkadot/x-bigint" "10.0.2" + "@polkadot/x-global" "10.0.2" + "@polkadot/x-textdecoder" "10.0.2" + "@polkadot/x-textencoder" "10.0.2" "@types/bn.js" "^5.1.0" bn.js "^5.2.1" - ip-regex "^4.3.0" -"@polkadot/wasm-bridge@6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-6.1.1.tgz#9342f2b3c139df72fa45c8491b348f8ebbfa57fa" - integrity sha512-Cy0k00VCu+HWxie+nn9GWPlSPdiZl8Id8ulSGA2FKET0jIbffmOo4e1E2FXNucfR1UPEpqov5BCF9T5YxEXZDg== +"@polkadot/wasm-bridge@6.2.3": + version "6.2.3" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-6.2.3.tgz#44430710b6f0e7393a69b15decc9123ef5f7ff45" + integrity sha512-kDPcUF5uCZJeJUlWtjk6u4KRy+RTObZbIMgZKiuCcQn9n3EYWadONvStfIyKaiFCc3VFVivzH1cUwTFxxTNHHQ== dependencies: - "@babel/runtime" "^7.17.9" - -"@polkadot/wasm-crypto-asmjs@6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-6.1.1.tgz#6d09045679120b43fbfa435b29c3690d1f788ebb" - integrity sha512-gG4FStVumkyRNH7WcTB+hn3EEwCssJhQyi4B1BOUt+eYYmw9xJdzIhqjzSd9b/yF2e5sRaAzfnMj2srGufsE6A== - dependencies: - "@babel/runtime" "^7.17.9" - -"@polkadot/wasm-crypto-init@6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-init/-/wasm-crypto-init-6.1.1.tgz#73731071bea9b4e22b380d75099da9dc683fadf5" - integrity sha512-rbBm/9FOOUjISL4gGNokjcKy2X+Af6Chaet4zlabatpImtPIAK26B2UUBGoaRUnvl/w6K3+GwBL4LuBC+CvzFw== - dependencies: - "@babel/runtime" "^7.17.9" - "@polkadot/wasm-bridge" "6.1.1" - "@polkadot/wasm-crypto-asmjs" "6.1.1" - "@polkadot/wasm-crypto-wasm" "6.1.1" - -"@polkadot/wasm-crypto-wasm@6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-6.1.1.tgz#3fdc8f1280710e4d68112544b2473e811c389a2a" - integrity sha512-zkz5Ct4KfTBT+YNEA5qbsHhTV58/FAxDave8wYIOaW4TrBnFPPs+J0WBWlGFertgIhPkvjFnQC/xzRyhet9prg== - dependencies: - "@babel/runtime" "^7.17.9" - "@polkadot/wasm-util" "6.1.1" - -"@polkadot/wasm-crypto@^6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-6.1.1.tgz#8e2c2d64d24eeaa78eb0b74ea1c438b7bc704176" - integrity sha512-hv9RCbMYtgjCy7+FKZFnO2Afu/whax9sk6udnZqGRBRiwaNagtyliWZGrKNGvaXMIO0VyaY4jWUwSzUgPrLu1A== - dependencies: - "@babel/runtime" "^7.17.9" - "@polkadot/wasm-bridge" "6.1.1" - "@polkadot/wasm-crypto-asmjs" "6.1.1" - "@polkadot/wasm-crypto-init" "6.1.1" - "@polkadot/wasm-crypto-wasm" "6.1.1" - "@polkadot/wasm-util" "6.1.1" - -"@polkadot/wasm-util@6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-util/-/wasm-util-6.1.1.tgz#58a566aba68f90d2a701c78ad49a1a9521b17f5b" - integrity sha512-DgpLoFXMT53UKcfZ8eT2GkJlJAOh89AWO+TP6a6qeZQpvXVe5f1yR45WQpkZlgZyUP+/19+kY56GK0pQxfslqg== - dependencies: - "@babel/runtime" "^7.17.9" - -"@polkadot/x-bigint@9.4.1": - version "9.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-9.4.1.tgz#0a7c6b5743a6fb81ab6a1c3a48a584e774c37910" - integrity sha512-KlbXboegENoyrpjj+eXfY13vsqrXgk4620zCAUhKNH622ogdvAepHbY/DpV6w0FLEC6MwN9zd5cRuDBEXVeWiw== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/x-global" "9.4.1" - -"@polkadot/x-fetch@^9.4.1": - version "9.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-9.4.1.tgz#92802d3880db826a90bf1be90174a9fc73fc044a" - integrity sha512-CZFPZKgy09TOF5pOFRVVhGrAaAPdSMyrUSKwdO2I8DzdIE1tmjnol50dlnZja5t8zTD0n1uIY1H4CEWwc5NF/g== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/x-global" "9.4.1" - "@types/node-fetch" "^2.6.1" - node-fetch "^2.6.7" - -"@polkadot/x-global@9.4.1", "@polkadot/x-global@^9.4.1": - version "9.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-9.4.1.tgz#3bd44862ea2b7e0fb2de766dfa4d56bb46d19e17" - integrity sha512-eN4oZeRdIKQeUPNN7OtH5XeYp349d8V9+gW6W0BmCfB2lTg8TDlG1Nj+Cyxpjl9DNF5CiKudTq72zr0dDSRbwA== - dependencies: - "@babel/runtime" "^7.18.3" - -"@polkadot/x-randomvalues@9.4.1": - version "9.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-9.4.1.tgz#ab995b3a22aee6bffc18490e636e1a7409f36a15" - integrity sha512-TLOQw3JNPgCrcq9WO2ipdeG8scsSreu3m9hwj3n7nX/QKlVzSf4G5bxJo5TW1dwcUdHwBuVox+3zgCmo+NPh+Q== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/x-global" "9.4.1" - -"@polkadot/x-textdecoder@9.4.1": - version "9.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-9.4.1.tgz#1d891b82f4192d92dd373d14ea4b5654d0130484" - integrity sha512-yLulcgVASFUBJqrvS6Ssy0ko9teAfbu1ajH0r3Jjnqkpmmz2DJ1CS7tAktVa7THd4GHPGeKAVfxl+BbV/LZl+w== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/x-global" "9.4.1" - -"@polkadot/x-textencoder@9.4.1": - version "9.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-9.4.1.tgz#09c47727d7713884cf82fd773e478487fe39d479" - integrity sha512-/47wa31jBa43ULqMO60vzcJigTG+ZAGNcyT5r6hFLrQzRzc8nIBjIOD8YWtnKM92r9NvlNv2wJhdamqyU0mntg== - dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/x-global" "9.4.1" - -"@polkadot/x-ws@^9.4.1": - version "9.4.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-9.4.1.tgz#c48f2ef3e80532f4b366b57b6661429b46a16155" - integrity sha512-zQjVxXgHsBVn27u4bjY01cFO6XWxgv2b3MMOpNHTKTAs8SLEmFf0LcT7fBShimyyudyTeJld5pHApJ4qp1OXxA== + "@babel/runtime" "^7.18.6" + +"@polkadot/wasm-crypto-asmjs@6.2.3": + version "6.2.3" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-6.2.3.tgz#f2e3076bb6013431045d48a56b5ae107cb210e20" + integrity sha512-d/eH02d/XB/vIGIQwyoFB4zNRb3h5PlWoXolGeVSuoa8476ouEdaWhy64mFwXBmjfluaeCOFXRs+QbxetwrDZg== + dependencies: + "@babel/runtime" "^7.18.6" + +"@polkadot/wasm-crypto-init@6.2.3": + version "6.2.3" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-init/-/wasm-crypto-init-6.2.3.tgz#0cf3b59e6492cc63bb8dfb0e238fc599697af5a7" + integrity sha512-jDFD4ITWbvFgsGiRI61lrzI/eobG8VrI9nVCiDBqQZK7mNnGkyIdnFD1prW36uiv6/tkqSiGGvdb7dEKtmsB+Q== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/wasm-bridge" "6.2.3" + "@polkadot/wasm-crypto-asmjs" "6.2.3" + "@polkadot/wasm-crypto-wasm" "6.2.3" + +"@polkadot/wasm-crypto-wasm@6.2.3": + version "6.2.3" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-6.2.3.tgz#3b47346779881c714e1130374b2f325db9c4fdbf" + integrity sha512-bYRhYPcR4MBLAZz8liozr8E11r7j6RLkNHu80z65lZ5AWgjDu2MgYfKxZFWZxg8rB6+V1uYFmb7czUiSWOn4Rg== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/wasm-util" "6.2.3" + +"@polkadot/wasm-crypto@^6.2.3": + version "6.2.3" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-6.2.3.tgz#1b52c834a1f609d6820035d61cdfda962990ec57" + integrity sha512-Jq08uX16YYySanwN/37n/ZzOFv8T2H4NzLaQNjSGNbFdmKzkrlpw369XRNIVhrKGtK4v09O5ZaF5P9qc0EHgsg== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/wasm-bridge" "6.2.3" + "@polkadot/wasm-crypto-asmjs" "6.2.3" + "@polkadot/wasm-crypto-init" "6.2.3" + "@polkadot/wasm-crypto-wasm" "6.2.3" + "@polkadot/wasm-util" "6.2.3" + +"@polkadot/wasm-util@6.2.3": + version "6.2.3" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-util/-/wasm-util-6.2.3.tgz#ffccbda4023810ac0e19327830c9bc0d4a5023bc" + integrity sha512-8BQ9gVSrjdc0MPWN9qtNWlMiK+J8dICu1gZJ+cy/hqKjer2MzwX4SeW2wyL5MkYYHjih3ajMRSoSA+/eY2iEwg== + dependencies: + "@babel/runtime" "^7.18.6" + +"@polkadot/x-bigint@10.0.2", "@polkadot/x-bigint@^10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.0.2.tgz#8b69e1adf59444a6fb4397f9869ec1a9a0de1b1a" + integrity sha512-LtfPi+AyZDNe8jQGVmyDfxGyQDdM6ISZEwJD1ieGd4eUbOkfPmn+1t+0rjtxjISZcyP40fSFcLxtL191jDV8Bw== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/x-global" "10.0.2" + +"@polkadot/x-fetch@^10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-10.0.2.tgz#d9e2f2115a3c684fdaa8b9496540f0f421ee3719" + integrity sha512-vsizrcBNeRWWJhE4ZoCUJ0c68wvy3PiR9jH//B1PTV6OaqpdalpwXG6Xtpli8yc0hOOUH/87u8b/x2f/2vhZcQ== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/x-global" "10.0.2" + "@types/node-fetch" "^2.6.2" + node-fetch "^3.2.6" + +"@polkadot/x-global@10.0.2", "@polkadot/x-global@^10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.0.2.tgz#c60b279a34f8a589d076a03978331e9e6a26d283" + integrity sha512-IlxSH36RjcQTImufaJCtvommMmkNWbwOy+/Z7FEOKUOcoiPaUhHU3CzWser+EtClckx7qPLY5lZ59Pxf7HWupQ== + dependencies: + "@babel/runtime" "^7.18.6" + +"@polkadot/x-randomvalues@10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.0.2.tgz#b51d58d235e4fae5201f4ef633ee71d8bf23c125" + integrity sha512-kYbNeeOaDEnNqVhIgh8ds9YC79Tji5/HDqQymx7Xb3YmTagdOAe2klrTRJzVfsUKljzhlVOuF3Zcf/PRNbt/2w== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/x-global" "10.0.2" + +"@polkadot/x-textdecoder@10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.0.2.tgz#082ee7d5c2e71985e584a858c7b6069dd59475bd" + integrity sha512-EI1+Osrfadtm4XFfdcjYgV/1yYoPoFaIJfZiPphPSy/4Ceeblmz9T2hWPdJ3uWtPpk6FkhxudB44Y1JuCwXBjg== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/x-global" "10.0.2" + +"@polkadot/x-textencoder@10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.0.2.tgz#f3e632ca6d852d3284e6aeef3806bf4450490bf0" + integrity sha512-iTLC700ExtRFsP+fE+dA5CO0xjQ46XeQqbJxa7wJK3aKrzpogyTLZXc0O5ISE1xltOmsQSA9QOELMP113kZkvA== + dependencies: + "@babel/runtime" "^7.18.6" + "@polkadot/x-global" "10.0.2" + +"@polkadot/x-ws@^10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-10.0.2.tgz#505f33911e301fb1aa07cf0807de738ef52414a5" + integrity sha512-eH8WJ6jKobfUGLRAGj65wKUB2pwbT7RflebQbbcG8Khx9INRjuwLGc+jAiuf0StOZiqVVJsMUayVgsddO8hIvQ== dependencies: - "@babel/runtime" "^7.18.3" - "@polkadot/x-global" "9.4.1" + "@babel/runtime" "^7.18.6" + "@polkadot/x-global" "10.0.2" "@types/websocket" "^1.0.5" websocket "^1.0.34" -"@scure/base@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.0.0.tgz#109fb595021de285f05a7db6806f2f48296fcee7" - integrity sha512-gIVaYhUsy+9s58m/ETjSJVKHhKTBMmcRb9cEV5/5dwvfDlfORjKrFsDeDHWRrm6RjcPvCLZFwGJjAjLj1gg4HA== +"@scure/base@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" + integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA== "@sindresorhus/is@^0.14.0": version "0.14.0" @@ -892,28 +898,28 @@ resolved "https://registry.yarnpkg.com/@substrate/connect-extension-protocol/-/connect-extension-protocol-1.0.0.tgz#d452beda84b3ebfcf0e88592a4695e729a91e858" integrity sha512-nFVuKdp71hMd/MGlllAOh+a2hAqt8m6J2G0aSsS/RcALZexxF9jodbFc62ni8RDtJboeOfXAHhenYOANvJKPIg== -"@substrate/connect@0.7.5": - version "0.7.5" - resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.7.5.tgz#8d868ed905df25c87ff9bad9fa8db6d4137012c9" - integrity sha512-sdAZ6IGuTNxRGlH/O+6IaXvkYzZFwMK03VbQMgxUzry9dz1+JzyaNf8iOTVHxhMIUZc0h0E90JQz/hNiUYPlUw== +"@substrate/connect@0.7.7": + version "0.7.7" + resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.7.7.tgz#6d162fcec2f5cfb78c137a82dbb35692655fbe2c" + integrity sha512-uFRF06lC42ZZixxwkzRB61K1uYvR1cTZ7rI98RW7T+eWbCFrafyVk0pk6J+4oN05gZkhou+VK3hrRCU6Doy2xQ== dependencies: "@substrate/connect-extension-protocol" "^1.0.0" - "@substrate/smoldot-light" "0.6.16" + "@substrate/smoldot-light" "0.6.19" eventemitter3 "^4.0.7" -"@substrate/smoldot-light@0.6.16": - version "0.6.16" - resolved "https://registry.yarnpkg.com/@substrate/smoldot-light/-/smoldot-light-0.6.16.tgz#04ec70cf1df285431309fe5704d3b2dd701faa0b" - integrity sha512-Ej0ZdNPTW0EXbp45gv/5Kt/JV+c9cmRZRYAXg+EALxXPm0hW9h2QdVLm61A2PAskOGptW4wnJ1WzzruaenwAXQ== +"@substrate/smoldot-light@0.6.19": + version "0.6.19" + resolved "https://registry.yarnpkg.com/@substrate/smoldot-light/-/smoldot-light-0.6.19.tgz#13e897ca9839aecb0dac4ce079ff1cca1dc54cc0" + integrity sha512-Xi+v1cdURhTwx7NH+9fa1U9m7VGP61GvB6qwev9HrZXlGbQiUIvySxPlH/LMsq3mwgiRYkokPhcaZEHufY7Urg== dependencies: buffer "^6.0.1" pako "^2.0.4" websocket "^1.0.32" -"@substrate/ss58-registry@^1.22.0": - version "1.22.0" - resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.22.0.tgz#d115bc5dcab8c0f5800e05e4ef265949042b13ec" - integrity sha512-IKqrPY0B3AeIXEc5/JGgEhPZLy+SmVyQf+k0SIGcNSTqt1GLI3gQFEOFwSScJdem+iYZQUrn6YPPxC3TpdSC3A== +"@substrate/ss58-registry@^1.23.0": + version "1.23.0" + resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.23.0.tgz#6212bf871a882da98799f8dc51de0944d4152b88" + integrity sha512-LuQje7n48GXSsp1aGI6UEmNVtlh7OzQ6CN1Hd9VGUrshADwMB0lRZ5bxnffmqDR4vVugI7h0NN0AONhIW1eHGg== "@szmarczak/http-timer@^1.1.2": version "1.1.2" @@ -1010,10 +1016,10 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== -"@types/node-fetch@^2.6.1": - version "2.6.1" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.1.tgz#8f127c50481db65886800ef496f20bbf15518975" - integrity sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA== +"@types/node-fetch@^2.6.2": + version "2.6.2" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.2.tgz#d1a9c5fd049d9415dce61571557104dec3ec81da" + integrity sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A== dependencies: "@types/node" "*" form-data "^3.0.0" @@ -1855,6 +1861,11 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" +data-uri-to-buffer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz#b5db46aea50f6176428ac05b73be39a57701a64b" + integrity sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA== + debug@2.6.9, debug@^2.2.0: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -2426,6 +2437,14 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" +fetch-blob@^3.1.2, fetch-blob@^3.1.4: + version "3.2.0" + resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" + integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== + dependencies: + node-domexception "^1.0.0" + web-streams-polyfill "^3.0.3" + file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -2539,6 +2558,13 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" +formdata-polyfill@^4.0.10: + version "4.0.10" + resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" + integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== + dependencies: + fetch-blob "^3.1.2" + forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -2968,11 +2994,6 @@ internal-slot@^1.0.3: has "^1.0.3" side-channel "^1.0.4" -ip-regex@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-4.3.0.tgz#687275ab0f57fa76978ff8f4dddc8a23d5990db5" - integrity sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q== - ipaddr.js@1.9.1: version "1.9.1" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" @@ -3631,10 +3652,10 @@ next-tick@^1.1.0: resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== -nock@^13.2.6: - version "13.2.6" - resolved "https://registry.yarnpkg.com/nock/-/nock-13.2.6.tgz#35e419cd9d385ffa67e59523d9699e41b29e1a03" - integrity sha512-GbyeSwSEP0FYouzETZ0l/XNm5tNcDNcXJKw3LCAb+mx8bZSwg1wEEvdL0FAyg5TkBJYiWSCtw6ag4XfmBy60FA== +nock@^13.2.8: + version "13.2.8" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.2.8.tgz#e2043ccaa8e285508274575e090a7fe1e46b90f1" + integrity sha512-JT42FrXfQRpfyL4cnbBEJdf4nmBpVP0yoCcSBr+xkT8Q1y3pgtaCKHGAAOIFcEJ3O3t0QbVAmid0S0f2bj3Wpg== dependencies: debug "^4.1.0" json-stringify-safe "^5.0.1" @@ -3646,12 +3667,19 @@ node-addon-api@^2.0.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== -node-fetch@^2.6.7: - version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== +node-domexception@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" + integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== + +node-fetch@^3.2.6: + version "3.2.6" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.2.6.tgz#6d4627181697a9d9674aae0d61548e0d629b31b9" + integrity sha512-LAy/HZnLADOVkVPubaxHDft29booGglPFDr2Hw0J1AercRh01UiVFm++KMDnJeH9sHgNB4hsXPii7Sgym/sTbw== dependencies: - whatwg-url "^5.0.0" + data-uri-to-buffer "^4.0.0" + fetch-blob "^3.1.4" + formdata-polyfill "^4.0.10" node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: version "4.4.0" @@ -4518,11 +4546,6 @@ tough-cookie@~2.5.0: psl "^1.1.28" punycode "^2.1.1" -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= - ts-node@^10.8.0: version "10.8.1" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.8.1.tgz#ea2bd3459011b52699d7e88daa55a45a1af4f066" @@ -4757,6 +4780,11 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" +web-streams-polyfill@^3.0.3: + version "3.2.1" + resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" + integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== + web3-bzz@1.7.3: version "1.7.3" resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.7.3.tgz#6860a584f748838af5e3932b6798e024ab8ae951" @@ -4985,11 +5013,6 @@ web3@^1.7.3: web3-shh "1.7.3" web3-utils "1.7.3" -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= - websocket@^1.0.32, websocket@^1.0.34: version "1.0.34" resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.34.tgz#2bdc2602c08bf2c82253b730655c0ef7dcab3111" @@ -5002,14 +5025,6 @@ websocket@^1.0.32, websocket@^1.0.34: utf-8-validate "^5.0.2" yaeti "^0.0.6" -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" From 85515e54c4ca1b82a2630034e55dcc804c643bf8 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 21 Jul 2022 10:19:43 +0200 Subject: [PATCH 0409/1274] build(dep): upgrade polkadot to v0.9.26 Signed-off-by: Yaroslav Bolyukin --- README.md | 2 +- client/rpc/Cargo.toml | 12 +- crates/evm-coder/Cargo.toml | 2 +- node/cli/Cargo.toml | 128 ++++++++++----------- node/rpc/Cargo.toml | 64 +++++------ pallets/common/Cargo.toml | 20 ++-- pallets/evm-coder-substrate/Cargo.toml | 14 +-- pallets/evm-contract-helpers/Cargo.toml | 20 ++-- pallets/evm-migration/Cargo.toml | 18 +-- pallets/evm-transaction-payment/Cargo.toml | 22 ++-- pallets/fungible/Cargo.toml | 16 +-- pallets/inflation/Cargo.toml | 20 ++-- pallets/nonfungible/Cargo.toml | 16 +-- pallets/proxy-rmrk-core/Cargo.toml | 18 +-- pallets/proxy-rmrk-equip/Cargo.toml | 18 +-- pallets/refungible/Cargo.toml | 15 +-- pallets/scheduler/Cargo.toml | 20 ++-- pallets/structure/Cargo.toml | 10 +- pallets/unique/Cargo.toml | 16 +-- primitives/data-structs/Cargo.toml | 12 +- primitives/rmrk-rpc/Cargo.toml | 12 +- primitives/rpc/Cargo.toml | 10 +- runtime/opal/Cargo.toml | 104 ++++++++--------- runtime/quartz/Cargo.toml | 104 ++++++++--------- runtime/tests/Cargo.toml | 24 ++-- runtime/unique/Cargo.toml | 104 ++++++++--------- tests/README.md | 2 +- 27 files changed, 415 insertions(+), 408 deletions(-) diff --git a/README.md b/README.md index 26e1c09c10..f176c0a6a2 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ git checkout feature/runtime-upgrade-testing ``` git clone https://github.com/paritytech/polkadot.git cd polkadot -git checkout release-v0.9.25 +git checkout release-v0.9.26 cargo build --release ``` diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index 6b15da7a77..ee41bbdc59 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -13,9 +13,9 @@ codec = { package = "parity-scale-codec", version = "3.1.2" } jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } anyhow = "1.0.57" -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } diff --git a/crates/evm-coder/Cargo.toml b/crates/evm-coder/Cargo.toml index 8749869d74..8ad7087453 100644 --- a/crates/evm-coder/Cargo.toml +++ b/crates/evm-coder/Cargo.toml @@ -9,7 +9,7 @@ evm-coder-macros = { path = "../evm-coder-macros" } primitive-types = { version = "0.11.1", default-features = false } hex-literal = "0.3.3" ethereum = { version = "0.12.0", default-features = false } -evm-core = { default-features = false , git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.25" } +evm-core = { default-features = false, git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.26" } impl-trait-for-tuples = "0.2.1" [dev-dependencies] diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 8fba3d024b..3f35ee0566 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -3,7 +3,7 @@ [build-dependencies.substrate-build-script-utils] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" ################################################################################ # Substrate Dependecies @@ -16,158 +16,158 @@ version = '3.1.2' [dependencies.frame-benchmarking] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-benchmarking-cli] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.try-runtime-cli] git = 'https://github.com/paritytech/substrate' -branch = 'polkadot-v0.9.25' +branch = 'polkadot-v0.9.26' [dependencies.pallet-transaction-payment-rpc] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.substrate-prometheus-endpoint] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-basic-authorship] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-chain-spec] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-cli] features = ['wasmtime'] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-client-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-consensus] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-consensus-aura] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-executor] features = ['wasmtime'] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-finality-grandpa] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-keystore] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-rpc] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-rpc-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-service] features = ['wasmtime'] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-telemetry] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-transaction-pool] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-tracing] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-sysinfo] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-block-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-blockchain] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-consensus] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-consensus-aura] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-core] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-finality-grandpa] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-inherents] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-keystore] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-offchain] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-runtime] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-session] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-timestamp] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-transaction-pool] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-trie] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.substrate-frame-rpc-system] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sc-network] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.serde] features = ['derive'] @@ -178,76 +178,76 @@ version = '1.0.68' [dependencies.sc-consensus-manual-seal] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" ################################################################################ # Cumulus dependencies [dependencies.cumulus-client-consensus-aura] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.cumulus-client-consensus-common] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.cumulus-client-collator] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.cumulus-client-cli] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.cumulus-client-network] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.cumulus-primitives-parachain-inherent] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.cumulus-client-service] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.cumulus-relay-chain-interface] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.cumulus-relay-chain-inprocess-interface] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.cumulus-relay-chain-rpc-interface] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" ################################################################################ # Polkadot dependencies [dependencies.polkadot-primitives] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" [dependencies.polkadot-service] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" [dependencies.polkadot-cli] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" [dependencies.polkadot-test-service] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" ################################################################################ @@ -276,7 +276,7 @@ path = "../../primitives/rpc" [dependencies.pallet-transaction-payment-rpc-runtime-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" ################################################################################ # Package @@ -308,13 +308,13 @@ clap = "3.1.2" jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } tokio = { version = "1.19.2", features = ["time"] } -fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } unique-rpc = { default-features = false, path = "../rpc" } rmrk-rpc = { path = "../../primitives/rmrk-rpc" } diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index 816f5c8642..72df43ab69 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -13,40 +13,40 @@ targets = ["x86_64-unknown-linux-gnu"] futures = { version = "0.3.17", features = ["compat"] } jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } # pallet-contracts-rpc = { git = 'https://github.com/paritytech/substrate', branch = 'master' } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } tokio = { version = "1.19.2", features = ["macros", "sync"] } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } pallet-common = { default-features = false, path = "../../pallets/common" } up-common = { path = "../../primitives/common" } diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index b2b65ed9dc..b63924c599 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -11,18 +11,18 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } ethereum = { version = "0.12.0", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } serde = { version = "1.0.130", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ @@ -40,6 +40,4 @@ std = [ "up-data-structs/std", "pallet-evm/std", ] -runtime-benchmarks = [ - "frame-benchmarking" -] +runtime-benchmarks = ["frame-benchmarking"] diff --git a/pallets/evm-coder-substrate/Cargo.toml b/pallets/evm-coder-substrate/Cargo.toml index 0d9eb30246..2389cc6d72 100644 --- a/pallets/evm-coder-substrate/Cargo.toml +++ b/pallets/evm-coder-substrate/Cargo.toml @@ -8,15 +8,15 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } ethereum = { version = "0.12.0", default-features = false } evm-coder = { default-features = false, path = "../../crates/evm-coder" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } up-data-structs = { default-features = false, path = "../../primitives/data-structs" } [dependencies.codec] diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index c7f3ab3032..f10bfb1161 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -11,22 +11,24 @@ scale-info = { version = "2.0.1", default-features = false, features = [ log = { default-features = false, version = "0.4.14" } # Substrate -frame-support = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -frame-system = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +frame-support = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +frame-system = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } # Unique -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.26" } # Locals evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-common = { default-features = false, path = '../../pallets/common' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } -up-data-structs = { default-features = false, path = '../../primitives/data-structs', features = ['serde1'] } +up-data-structs = { default-features = false, path = '../../primitives/data-structs', features = [ + 'serde1', +] } [dependencies.codec] default-features = false diff --git a/pallets/evm-migration/Cargo.toml b/pallets/evm-migration/Cargo.toml index b9d117a782..79d22bad88 100644 --- a/pallets/evm-migration/Cargo.toml +++ b/pallets/evm-migration/Cargo.toml @@ -8,15 +8,15 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } [dependencies.codec] default-features = false diff --git a/pallets/evm-transaction-payment/Cargo.toml b/pallets/evm-transaction-payment/Cargo.toml index 8ef82acc81..7b8aae8698 100644 --- a/pallets/evm-transaction-payment/Cargo.toml +++ b/pallets/evm-transaction-payment/Cargo.toml @@ -8,17 +8,17 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.25" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.26" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } [dependencies.codec] default-features = false diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index 34184cf6e2..d5cf925db0 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -11,19 +11,19 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' } ethereum = { version = "0.12.0", default-features = false } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } @@ -42,6 +42,6 @@ std = [ "ethereum/std", "pallet-evm-coder-substrate/std", 'frame-benchmarking/std', - "pallet-evm/std" + "pallet-evm/std", ] runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks'] diff --git a/pallets/inflation/Cargo.toml b/pallets/inflation/Cargo.toml index 7e249a521b..cff7e533d8 100644 --- a/pallets/inflation/Cargo.toml +++ b/pallets/inflation/Cargo.toml @@ -43,37 +43,37 @@ version = '3.1.2' default-features = false optional = true git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.serde] default-features = false @@ -83,17 +83,17 @@ version = '1.0.130' [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies] scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index 9c7249f848..0af6e5b923 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -11,19 +11,19 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' } ethereum = { version = "0.12.0", default-features = false } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } @@ -43,7 +43,7 @@ std = [ "ethereum/std", "pallet-evm-coder-substrate/std", 'frame-benchmarking/std', - "pallet-evm/std" + "pallet-evm/std", ] runtime-benchmarks = [ 'frame-benchmarking', diff --git a/pallets/proxy-rmrk-core/Cargo.toml b/pallets/proxy-rmrk-core/Cargo.toml index 2640c2cfd5..61c5b37942 100644 --- a/pallets/proxy-rmrk-core/Cargo.toml +++ b/pallets/proxy-rmrk-core/Cargo.toml @@ -11,19 +11,21 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } pallet-structure = { default-features = false, path = "../../pallets/structure" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } -scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.0.1", default-features = false, features = [ + "derive", +] } derivative = { version = "2.2.0", features = ["use_core"] } [features] diff --git a/pallets/proxy-rmrk-equip/Cargo.toml b/pallets/proxy-rmrk-equip/Cargo.toml index ae202ff44a..70ca5ef53f 100644 --- a/pallets/proxy-rmrk-equip/Cargo.toml +++ b/pallets/proxy-rmrk-equip/Cargo.toml @@ -11,18 +11,20 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } -scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.0.1", default-features = false, features = [ + "derive", +] } pallet-rmrk-core = { default-features = false, path = "../proxy-rmrk-core" } [features] diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index 5323bdeb3b..050e265481 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -11,17 +11,18 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } + struct-versioning = { path = "../../crates/struct-versioning" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } ethereum = { version = "0.12.0", default-features = false } diff --git a/pallets/scheduler/Cargo.toml b/pallets/scheduler/Cargo.toml index b968f878f1..7466de8b2a 100644 --- a/pallets/scheduler/Cargo.toml +++ b/pallets/scheduler/Cargo.toml @@ -16,20 +16,20 @@ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.25' } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.26' } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.25" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.26" } log = { version = "0.4.14", default-features = false } [dev-dependencies] -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } [features] default = ["std"] diff --git a/pallets/structure/Cargo.toml b/pallets/structure/Cargo.toml index 123a1f2ab5..118acef5ae 100644 --- a/pallets/structure/Cargo.toml +++ b/pallets/structure/Cargo.toml @@ -4,10 +4,10 @@ version = "0.1.1" edition = "2021" [dependencies] -frame-support = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -frame-system = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -frame-benchmarking = { default-features = false, optional = true, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +frame-support = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +frame-system = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +frame-benchmarking = { default-features = false, optional = true, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } pallet-common = { path = "../common", default-features = false } parity-scale-codec = { version = "3.1.2", default-features = false, features = [ "derive", @@ -16,7 +16,7 @@ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } up-data-structs = { path = "../../primitives/data-structs", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } [features] default = ["std"] diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index 90bdf32129..399dc54f17 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -59,37 +59,37 @@ version = '3.1.2' default-features = false optional = true git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" ################################################################################ # Local Dependencies @@ -98,7 +98,7 @@ up-data-structs = { default-features = false, path = "../../primitives/data-stru scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } pallet-common = { default-features = false, path = "../common" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } diff --git a/primitives/data-structs/Cargo.toml b/primitives/data-structs/Cargo.toml index fe1b960fb5..ceecdae74f 100644 --- a/primitives/data-structs/Cargo.toml +++ b/primitives/data-structs/Cargo.toml @@ -18,14 +18,14 @@ codec = { package = "parity-scale-codec", version = "3.1.2", default-features = serde = { version = "1.0.130", features = [ 'derive', ], default-features = false, optional = true } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } derivative = { version = "2.2.0", features = ["use_core"] } struct-versioning = { path = "../../crates/struct-versioning" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } rmrk-traits = { default-features = false, path = "../rmrk-traits" } [features] diff --git a/primitives/rmrk-rpc/Cargo.toml b/primitives/rmrk-rpc/Cargo.toml index 49278d5c97..1204dc91c3 100644 --- a/primitives/rmrk-rpc/Cargo.toml +++ b/primitives/rmrk-rpc/Cargo.toml @@ -5,11 +5,13 @@ license = "" edition = "2021" [dependencies] -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } -sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -sp-api = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ + "derive", +] } +sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +sp-api = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } serde = { version = "1.0.130", default-features = false, features = ["derive"] } rmrk-traits = { default-features = false, path = "../rmrk-traits" } diff --git a/primitives/rpc/Cargo.toml b/primitives/rpc/Cargo.toml index 1b5c17803b..8ee9383a52 100644 --- a/primitives/rpc/Cargo.toml +++ b/primitives/rpc/Cargo.toml @@ -10,11 +10,11 @@ up-data-structs = { default-features = false, path = '../data-structs' } codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [ "derive", ] } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } [features] default = ["std"] diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 62d97f13b5..e229ba4f38 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -141,39 +141,39 @@ version = '3.1.2' default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-try-runtime] default-features = false git = 'https://github.com/paritytech/substrate' optional = true -branch = 'polkadot-v0.9.25' +branch = 'polkadot-v0.9.26' [dependencies.frame-executive] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-system-benchmarking] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-system-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.hex-literal] optional = true @@ -188,12 +188,12 @@ version = '1.0.130' [dependencies.pallet-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" # Contracts specific packages # [dependencies.pallet-contracts] @@ -217,32 +217,32 @@ branch = "polkadot-v0.9.25" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-sudo] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-transaction-payment] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-treasury] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" # [dependencies.pallet-vesting] # default-features = false @@ -252,67 +252,67 @@ branch = "polkadot-v0.9.25" [dependencies.sp-arithmetic] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-block-builder] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-inherents] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-offchain] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-session] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-transaction-pool] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-version] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.smallvec] version = '1.6.1' @@ -323,46 +323,46 @@ version = '1.6.1' [dependencies.parachain-info] default-features = false git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.cumulus-pallet-aura-ext] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-pallet-parachain-system] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-pallet-xcm] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-pallet-dmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-pallet-xcmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-primitives-utility] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-primitives-timestamp] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false ################################################################################ @@ -370,32 +370,32 @@ default-features = false [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" default-features = false [dependencies.xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" default-features = false [dependencies.xcm-builder] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" default-features = false [dependencies.xcm-executor] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" default-features = false [dependencies.pallet-xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" default-features = false [dependencies.orml-vesting] git = "https://github.com/open-web3-stack/open-runtime-module-library" -branch = "polkadot-v0.9.25" +rev = "8c625a5ab43c1c56cdeed5f8d814a891566d4cf8" version = "0.4.1-dev" default-features = false @@ -412,7 +412,7 @@ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } pallet-configuration = { default-features = false, path = "../../pallets/configuration" } @@ -425,22 +425,22 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.25", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.26", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.25' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.26' } ################################################################################ # Build Dependencies [build-dependencies.substrate-wasm-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 5c0a828054..13202e8053 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -138,39 +138,39 @@ version = '3.1.2' default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-try-runtime] default-features = false git = 'https://github.com/paritytech/substrate' optional = true -branch = 'polkadot-v0.9.25' +branch = 'polkadot-v0.9.26' [dependencies.frame-executive] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-system-benchmarking] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-system-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.hex-literal] optional = true @@ -185,12 +185,12 @@ version = '1.0.130' [dependencies.pallet-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" # Contracts specific packages # [dependencies.pallet-contracts] @@ -214,32 +214,32 @@ branch = "polkadot-v0.9.25" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-sudo] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-transaction-payment] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-treasury] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" # [dependencies.pallet-vesting] # default-features = false @@ -249,67 +249,67 @@ branch = "polkadot-v0.9.25" [dependencies.sp-arithmetic] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-block-builder] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-inherents] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-offchain] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-session] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-transaction-pool] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-version] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.smallvec] version = '1.6.1' @@ -320,46 +320,46 @@ version = '1.6.1' [dependencies.parachain-info] default-features = false git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.cumulus-pallet-aura-ext] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-pallet-parachain-system] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-pallet-xcm] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-pallet-dmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-pallet-xcmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-primitives-utility] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-primitives-timestamp] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false ################################################################################ @@ -367,32 +367,32 @@ default-features = false [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" default-features = false [dependencies.xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" default-features = false [dependencies.xcm-builder] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" default-features = false [dependencies.xcm-executor] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" default-features = false [dependencies.pallet-xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" default-features = false [dependencies.orml-vesting] git = "https://github.com/open-web3-stack/open-runtime-module-library" -branch = "polkadot-v0.9.25" +rev = "8c625a5ab43c1c56cdeed5f8d814a891566d4cf8" version = "0.4.1-dev" default-features = false @@ -416,7 +416,7 @@ scale-info = { version = "2.0.1", default-features = false, features = [ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } pallet-configuration = { default-features = false, path = "../../pallets/configuration" } @@ -429,22 +429,22 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.25", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.26", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.25' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.26' } ################################################################################ # Build Dependencies [build-dependencies.substrate-wasm-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index 4b3645d13d..e8ac672a97 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -11,22 +11,22 @@ refungible = [] [dependencies] up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -sp-core = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -sp-std = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -sp-io = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -sp-runtime = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +sp-core = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +sp-std = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +sp-io = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +sp-runtime = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -frame-support = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -frame-system = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +frame-support = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +frame-system = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -pallet-balances = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } -pallet-timestamp = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.25' } +pallet-balances = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +pallet-timestamp = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } pallet-common = { path = '../../pallets/common' } pallet-structure = { path = '../../pallets/structure' } diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 80b0f548cf..a1288db11b 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -139,39 +139,39 @@ version = '3.1.2' default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-try-runtime] default-features = false git = 'https://github.com/paritytech/substrate' optional = true -branch = 'polkadot-v0.9.25' +branch = 'polkadot-v0.9.26' [dependencies.frame-executive] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-system-benchmarking] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.frame-system-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.hex-literal] optional = true @@ -186,12 +186,12 @@ version = '1.0.130' [dependencies.pallet-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" # Contracts specific packages # [dependencies.pallet-contracts] @@ -215,32 +215,32 @@ branch = "polkadot-v0.9.25" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-sudo] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-transaction-payment] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.pallet-treasury] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" # [dependencies.pallet-vesting] # default-features = false @@ -250,67 +250,67 @@ branch = "polkadot-v0.9.25" [dependencies.sp-arithmetic] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-block-builder] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-inherents] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-offchain] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-session] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-transaction-pool] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.sp-version] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.smallvec] version = '1.6.1' @@ -321,46 +321,46 @@ version = '1.6.1' [dependencies.parachain-info] default-features = false git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" [dependencies.cumulus-pallet-aura-ext] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-pallet-parachain-system] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-pallet-xcm] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-pallet-dmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-pallet-xcmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-primitives-utility] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false [dependencies.cumulus-primitives-timestamp] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" default-features = false ################################################################################ @@ -368,32 +368,32 @@ default-features = false [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" default-features = false [dependencies.xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" default-features = false [dependencies.xcm-builder] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" default-features = false [dependencies.xcm-executor] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" default-features = false [dependencies.pallet-xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.25" +branch = "release-v0.9.26" default-features = false [dependencies.orml-vesting] git = "https://github.com/open-web3-stack/open-runtime-module-library" -branch = "polkadot-v0.9.25" +rev = "8c625a5ab43c1c56cdeed5f8d814a891566d4cf8" version = "0.4.1-dev" default-features = false @@ -422,23 +422,23 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.25", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.26", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.25" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.25' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.26' } ################################################################################ # Build Dependencies [build-dependencies.substrate-wasm-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.25" +branch = "polkadot-v0.9.26" diff --git a/tests/README.md b/tests/README.md index fdb398ec4a..e02dde35e0 100644 --- a/tests/README.md +++ b/tests/README.md @@ -5,7 +5,7 @@ 1. Checkout polkadot in sibling folder with this project ```bash git clone https://github.com/paritytech/polkadot.git && cd polkadot -git checkout release-v0.9.25 +git checkout release-v0.9.26 ``` 2. Build with nightly-2022-05-11 From 74f532ac28dce15c15e7d576c074a58eba658c08 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 12 Aug 2022 13:04:20 +0000 Subject: [PATCH 0410/1274] fix(runtime): add missing config keys --- runtime/common/config/substrate.rs | 1 + runtime/common/construct_runtime/mod.rs | 5 +++-- runtime/opal/src/lib.rs | 2 +- runtime/quartz/src/lib.rs | 2 +- runtime/tests/src/lib.rs | 25 +++++++++++++++++-------- runtime/unique/src/lib.rs | 2 +- 6 files changed, 24 insertions(+), 13 deletions(-) diff --git a/runtime/common/config/substrate.rs b/runtime/common/config/substrate.rs index 58e3f5db84..936e03947b 100644 --- a/runtime/common/config/substrate.rs +++ b/runtime/common/config/substrate.rs @@ -154,6 +154,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { + type Event = Event; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type LengthToFee = ConstantMultiplier; type OperationalFeeMultiplier = OperationalFeeMultiplier; diff --git a/runtime/common/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs index 562affa57a..86dc0e24e1 100644 --- a/runtime/common/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -27,6 +27,8 @@ macro_rules! construct_runtime { NodeBlock = opaque::Block, UncheckedExtrinsic = UncheckedExtrinsic { + System: frame_system = 0, + ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned} = 20, ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21, @@ -36,10 +38,9 @@ macro_rules! construct_runtime { Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 30, RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33, + TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 33, Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 34, Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event} = 35, - System: frame_system::{Pallet, Call, Storage, Config, Event} = 36, Vesting: orml_vesting::{Pallet, Storage, Call, Event, Config} = 37, // Vesting: pallet_vesting::{Pallet, Call, Config, Storage, Event} = 37, // Contracts: pallet_contracts::{Pallet, Call, Storage, Event} = 38, diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 710fffb60b..ae6d411c21 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -48,7 +48,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_version: 924012, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 1, + transaction_version: 2, state_version: 0, }; diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index 155e62b641..3ba5598965 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -48,7 +48,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_version: 924012, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 1, + transaction_version: 2, state_version: 0, }; diff --git a/runtime/tests/src/lib.rs b/runtime/tests/src/lib.rs index ce97c46911..54319e0100 100644 --- a/runtime/tests/src/lib.rs +++ b/runtime/tests/src/lib.rs @@ -60,13 +60,16 @@ frame_support::construct_runtime!( NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Unique: pallet_unique::{Pallet, Call, Storage}, - Balances: pallet_balances::{Pallet, Call, Storage}, + System: frame_system, + Unique: pallet_unique::{Pallet, Call, Storage, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Event}, Common: pallet_common::{Pallet, Storage, Event}, Fungible: pallet_fungible::{Pallet, Storage}, Refungible: pallet_refungible::{Pallet, Storage}, Nonfungible: pallet_nonfungible::{Pallet, Storage}, + Structure: pallet_structure::{Pallet, Storage, Event}, + TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, + Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin}, EVM: pallet_evm::{Pallet, Config, Call, Storage, Event}, } ); @@ -77,6 +80,7 @@ parameter_types! { } impl system::Config for Test { + type Event = Event; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); @@ -90,7 +94,6 @@ impl system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = (); type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -109,10 +112,10 @@ parameter_types! { } //frame_system::Module; impl pallet_balances::Config for Test { + type Event = Event; type AccountStore = System; type Balance = u64; type DustRemoval = (); - type Event = (); type ExistentialDeposit = ExistentialDeposit; type WeightInfo = (); type MaxLocks = MaxLocks; @@ -125,6 +128,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Test { + type Event = Event; type OnChargeTransaction = CurrencyAdapter, ()>; type LengthToFee = IdentityFee; type WeightToFee = IdentityFee; @@ -197,8 +201,13 @@ parameter_types! { pub BlockGasLimit: U256 = 0u32.into(); } +impl pallet_ethereum::Config for Test { + type Event = Event; + type StateRoot = pallet_ethereum::IntermediateStateRoot; +} + impl pallet_evm::Config for Test { - type Event = (); + type Event = Event; type FeeCalculator = (); type GasWeightMapping = (); type CallOrigin = EnsureAddressNever; @@ -221,7 +230,7 @@ impl pallet_evm_coder_substrate::Config for Test {} impl pallet_common::Config for Test { type WeightInfo = (); - type Event = (); + type Event = Event; type Currency = Balances; type CollectionCreationPrice = CollectionCreationPrice; type TreasuryAccountId = TreasuryAccountId; @@ -240,7 +249,7 @@ impl pallet_evm::account::Config for Test { impl pallet_structure::Config for Test { type WeightInfo = (); - type Event = (); + type Event = Event; type Call = Call; } impl pallet_fungible::Config for Test { diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index 928eb15aa5..81a20928c0 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -48,7 +48,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_version: 924012, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 1, + transaction_version: 2, state_version: 0, }; From cd49ae6ff7094f8e47853fac08db32b2e11e2af6 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 19 Jul 2022 18:22:53 +0200 Subject: [PATCH 0411/1274] fix(node): use jsonrpsee with unknown fields patch Signed-off-by: Yaroslav Bolyukin --- Cargo.toml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6a520f4b83..2d7f3b2b21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,17 +8,14 @@ members = [ 'crates/*', 'runtime/tests', ] -exclude = [ - "runtime/unique", - "runtime/quartz" -] +exclude = ["runtime/unique", "runtime/quartz"] [profile.release] panic = 'unwind' [patch.crates-io] -jsonrpsee = {git = "https://github.com/uniquenetwork/jsonrpsee", branch = "unique-v0.13.1-fix-unknown-fields"} -jsonrpsee-types = {git = "https://github.com/uniquenetwork/jsonrpsee", branch = "unique-v0.13.1-fix-unknown-fields"} -jsonrpsee-core = {git = "https://github.com/uniquenetwork/jsonrpsee", branch = "unique-v0.13.1-fix-unknown-fields"} +jsonrpsee = { git = "https://github.com/uniquenetwork/jsonrpsee", branch = "unique-v0.14.0-fix-unknown-fields" } +jsonrpsee-types = { git = "https://github.com/uniquenetwork/jsonrpsee", branch = "unique-v0.14.0-fix-unknown-fields" } +jsonrpsee-core = { git = "https://github.com/uniquenetwork/jsonrpsee", branch = "unique-v0.14.0-fix-unknown-fields" } [patch."https://github.com/paritytech/substrate"] beefy-gadget = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} @@ -193,4 +190,3 @@ substrate-test-utils = {git = "https://github.com/uniquenetwork/substrate", bran substrate-test-utils-derive = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} substrate-wasm-builder = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} try-runtime-cli = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} - From 4bd96c3c536117c086198fd992491684511ae187 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 12 Aug 2022 13:10:55 +0000 Subject: [PATCH 0412/1274] fix(rft): conflicts --- pallets/refungible/src/lib.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 9ba65a5d50..a3eb6bdf98 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -424,10 +424,8 @@ impl Pallet { >::insert(collection.id, burnt); >::remove((collection.id, token_id)); >::remove((collection.id, token_id)); -<<<<<<< HEAD - >::remove_prefix((collection.id, token_id), None); - >::remove_prefix((collection.id, token_id), None); - + let _ = >::clear_prefix((collection.id, token_id), u32::MAX, None); + let _ = >::clear_prefix((collection.id, token_id), u32::MAX, None); >::deposit_log( ERC721Events::Transfer { from: *owner.as_eth(), @@ -436,11 +434,6 @@ impl Pallet { } .to_log(collection_id_to_address(collection.id)), ); -======= - let _ = >::clear_prefix((collection.id, token_id), u32::MAX, None); - let _ = >::clear_prefix((collection.id, token_id), u32::MAX, None); - // TODO: ERC721 transfer event ->>>>>>> 5d9665e0... refactor: switch to new prefix removal methods Ok(()) } From 1a3045190c656361ca1131c63eca8807124544bc Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 12 Aug 2022 13:17:14 +0000 Subject: [PATCH 0413/1274] fix after conflict --- pallets/unique/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index 1837191c26..acd6c0dc62 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -501,10 +501,10 @@ decl_module! { >::deposit_event(Event::::CollectionAdminAdded( collection_id, - new_admin.clone() + new_admin_id.clone() )); - >::toggle_admin(&collection, &sender, &new_admin, true) + >::toggle_admin(&collection, &sender, &new_admin_id, true) } /// Remove admin of a collection. From 3df3531cadd6d2ed23afe838d3a71321b0f12c2e Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 12 Aug 2022 13:17:48 +0000 Subject: [PATCH 0414/1274] build(dep): upgrade up-common to polkadot-v0.9.26 --- primitives/common/Cargo.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/primitives/common/Cargo.toml b/primitives/common/Cargo.toml index c3b5a59152..cf404b0a59 100644 --- a/primitives/common/Cargo.toml +++ b/primitives/common/Cargo.toml @@ -23,34 +23,34 @@ std = [ [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.26" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.26" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.26" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.26" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.26" [dependencies.fp-rpc] default-features = false git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.24" +branch = "unique-polkadot-v0.9.26" [dependencies.pallet-evm] default-features = false git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.24" +branch = "unique-polkadot-v0.9.26" From b66d0b01b670bbbdf05431c6636a0300907f0ec8 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 12 Aug 2022 13:19:23 +0000 Subject: [PATCH 0415/1274] fix(config): after conflicts --- runtime/common/config/parachain.rs | 1 + runtime/common/config/substrate.rs | 1 - runtime/tests/src/lib.rs | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/common/config/parachain.rs b/runtime/common/config/parachain.rs index 934d66c399..2d51f9e374 100644 --- a/runtime/common/config/parachain.rs +++ b/runtime/common/config/parachain.rs @@ -37,6 +37,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type ReservedDmpWeight = ReservedDmpWeight; type ReservedXcmpWeight = ReservedXcmpWeight; type XcmpMessageHandler = XcmpQueue; + type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; } impl parachain_info::Config for Runtime {} diff --git a/runtime/common/config/substrate.rs b/runtime/common/config/substrate.rs index 936e03947b..268990cbbf 100644 --- a/runtime/common/config/substrate.rs +++ b/runtime/common/config/substrate.rs @@ -199,7 +199,6 @@ impl pallet_treasury::Config for Runtime { type SpendFunds = (); type WeightInfo = pallet_treasury::weights::SubstrateWeight; type MaxApprovals = MaxApprovals; - type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; } impl pallet_sudo::Config for Runtime { diff --git a/runtime/tests/src/lib.rs b/runtime/tests/src/lib.rs index 54319e0100..3fc12a004b 100644 --- a/runtime/tests/src/lib.rs +++ b/runtime/tests/src/lib.rs @@ -270,7 +270,7 @@ parameter_types! { } impl pallet_unique::Config for Test { - type Event = (); + type Event = Event; type WeightInfo = (); type CommonWeightInfo = CommonWeights; type RefungibleExtensionsWeightInfo = CommonWeights; From bdd7247a3eaa6f6d458f4320a8bbee98770da2b3 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 12 Aug 2022 13:19:43 +0000 Subject: [PATCH 0416/1274] build(dep): upgrade test runtime --- runtime/tests/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index e8ac672a97..500dadbbac 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -43,4 +43,4 @@ parity-scale-codec = { version = "3.1.2", default-features = false, features = [ scale-info = "*" evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.24' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.26' } From 6b6d7361ee8d43b1a765078f6b9429ada5170918 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 12 Aug 2022 13:20:08 +0000 Subject: [PATCH 0417/1274] fix: common construct_runtime --- runtime/common/construct_runtime/util.rs | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/runtime/common/construct_runtime/util.rs b/runtime/common/construct_runtime/util.rs index f6942e4bd3..3f0cae4410 100644 --- a/runtime/common/construct_runtime/util.rs +++ b/runtime/common/construct_runtime/util.rs @@ -24,7 +24,7 @@ macro_rules! construct_runtime_impl { { $( $(#[runtimes($($pallet_runtimes:ident),+ $(,)?)])? - $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal + $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal ),* $(,)? } @@ -37,7 +37,7 @@ macro_rules! construct_runtime_impl { pallets( $( $(#[runtimes($($pallet_runtimes),+)])? - $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index + $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index ),*, ) } @@ -53,7 +53,7 @@ macro_rules! construct_runtime_helper { where_clause($($where_clause:tt)*), pallets( #[runtimes($($pallet_runtimes:ident),+)] - $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal, + $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal, $($pallets_tl:tt)* ) @@ -65,7 +65,7 @@ macro_rules! construct_runtime_helper { where_clause($($where_clause)*), pallets( - $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index, $($pallets_tl)* ) } @@ -77,7 +77,7 @@ macro_rules! construct_runtime_helper { where_clause($($where_clause:tt)*), pallets( - $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal, + $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal, $($pallets_tl:tt)* ) @@ -86,7 +86,7 @@ macro_rules! construct_runtime_helper { select_runtime($select_runtime), selected_pallets( $($selected_pallets)* - $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index, ), where_clause($($where_clause)*), @@ -120,7 +120,7 @@ macro_rules! add_runtime_specific_pallets { where_clause($($where_clause:tt)*), pallets( - $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal, + $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal, $($pallets_tl:tt)* ) ) => { @@ -128,7 +128,7 @@ macro_rules! add_runtime_specific_pallets { select_runtime(opal), selected_pallets( $($selected_pallets)* - $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index, ), where_clause($($where_clause)*), @@ -143,7 +143,7 @@ macro_rules! add_runtime_specific_pallets { where_clause($($where_clause:tt)*), pallets( - $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal, + $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal, $($pallets_tl:tt)* ) ) => { @@ -151,7 +151,7 @@ macro_rules! add_runtime_specific_pallets { select_runtime(quartz), selected_pallets( $($selected_pallets)* - $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index, ), where_clause($($where_clause)*), @@ -166,7 +166,7 @@ macro_rules! add_runtime_specific_pallets { where_clause($($where_clause:tt)*), pallets( - $pallet_name:ident: $pallet_mod:ident::{$($pallet_parts:ty),*} = $index:literal, + $pallet_name:ident: $pallet_mod:ident$(::{$($pallet_parts:ty),*})? = $index:literal, $($pallets_tl:tt)* ) ) => { @@ -174,7 +174,7 @@ macro_rules! add_runtime_specific_pallets { select_runtime(unique), selected_pallets( $($selected_pallets)* - $pallet_name: $pallet_mod::{$($pallet_parts),*} = $index, + $pallet_name: $pallet_mod$(::{$($pallet_parts),*})? = $index, ), where_clause($($where_clause)*), @@ -207,7 +207,7 @@ macro_rules! add_runtime_specific_pallets { where_clause($($where_clause:tt)*), pallets( - $_pallet_name:ident: $_pallet_mod:ident::{$($_pallet_parts:ty),*} = $_index:literal, + $_pallet_name:ident: $_pallet_mod:ident$(::{$($_pallet_parts:ty),*})? = $_index:literal, $($pallets_tl:tt)* ) ) => { From 479665798928dc957013f5c793364b2a1f926413 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 12 Aug 2022 13:20:30 +0000 Subject: [PATCH 0418/1274] remove: polkadot hack substitute --- Cargo.toml | 174 ----------------------------------------------------- 1 file changed, 174 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2d7f3b2b21..7ad47bb458 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,177 +16,3 @@ panic = 'unwind' jsonrpsee = { git = "https://github.com/uniquenetwork/jsonrpsee", branch = "unique-v0.14.0-fix-unknown-fields" } jsonrpsee-types = { git = "https://github.com/uniquenetwork/jsonrpsee", branch = "unique-v0.14.0-fix-unknown-fields" } jsonrpsee-core = { git = "https://github.com/uniquenetwork/jsonrpsee", branch = "unique-v0.14.0-fix-unknown-fields" } - -[patch."https://github.com/paritytech/substrate"] -beefy-gadget = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -beefy-gadget-rpc = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -beefy-merkle-tree = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -beefy-primitives = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -fork-tree = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -frame-benchmarking = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -frame-benchmarking-cli = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -frame-election-provider-solution-type = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -frame-election-provider-support = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -frame-executive = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -frame-support = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -frame-support-procedural = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -frame-support-procedural-tools = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -frame-support-procedural-tools-derive = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -frame-system = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -frame-system-benchmarking = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -frame-system-rpc-runtime-api = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -frame-try-runtime = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-aura = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-authority-discovery = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-authorship = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-babe = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-bags-list = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-balances = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-beefy = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-beefy-mmr = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-bounties = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-child-bounties = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-collective = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-democracy = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-election-provider-multi-phase = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-election-provider-support-benchmarking = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-elections-phragmen = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-gilt = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-grandpa = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-identity = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-im-online = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-indices = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-membership = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-mmr = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-mmr-rpc = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-multisig = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-nicks = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-nomination-pools = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-nomination-pools-benchmarking = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-offences = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-offences-benchmarking = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-preimage = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-proxy = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-randomness-collective-flip = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-recovery = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-scheduler = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-session = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-session-benchmarking = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-society = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-staking = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-staking-reward-curve = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-staking-reward-fn = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-sudo = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-timestamp = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-tips = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-transaction-payment = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-transaction-payment-rpc = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-transaction-payment-rpc-runtime-api = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-treasury = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-utility = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -pallet-vesting = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -remote-externalities = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-allocator = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-authority-discovery = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-basic-authorship = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-block-builder = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-chain-spec = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-chain-spec-derive = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-cli = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-client-api = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-client-db = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-consensus = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-consensus-aura = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-consensus-babe = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-consensus-babe-rpc = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-consensus-epochs = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-consensus-manual-seal = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-consensus-slots = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-consensus-uncles = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-executor = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-executor-common = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-executor-wasmi = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-executor-wasmtime = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-finality-grandpa = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-finality-grandpa-rpc = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-informant = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-keystore = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-network = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-network-common = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-network-gossip = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-network-light = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-network-sync = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-offchain = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-peerset = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-proposer-metrics = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-rpc = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-rpc-api = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-rpc-server = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-service = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-state-db = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-sync-state-rpc = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-sysinfo = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-telemetry = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-tracing = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-tracing-proc-macro = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-transaction-pool = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-transaction-pool-api = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sc-utils = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-api = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-api-proc-macro = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-application-crypto = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-arithmetic = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-authority-discovery = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-authorship = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-block-builder = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-blockchain = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-consensus = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-consensus-aura = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-consensus-babe = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-consensus-slots = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-consensus-vrf = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-core = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-core-hashing = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-core-hashing-proc-macro = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-database = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-debug-derive = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-externalities = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-finality-grandpa = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-inherents = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-io = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-keyring = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-keystore = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-maybe-compressed-blob = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-mmr-primitives = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-npos-elections = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-offchain = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-panic-handler = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-rpc = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-runtime = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-runtime-interface = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-runtime-interface-proc-macro = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-sandbox = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-serializer = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-session = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-staking = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-state-machine = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-std = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-storage = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-tasks = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-timestamp = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-tracing = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-transaction-pool = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-transaction-storage-proof = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-trie = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-version = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-version-proc-macro = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -sp-wasm-interface = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -substrate-build-script-utils = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -substrate-frame-rpc-system = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -substrate-prometheus-endpoint = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -substrate-state-trie-migration-rpc = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -substrate-test-client = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -substrate-test-utils = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -substrate-test-utils-derive = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -substrate-wasm-builder = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} -try-runtime-cli = {git = "https://github.com/uniquenetwork/substrate", branch = "polkadot-v0.9.24-hack-substitute"} From a70d6a8b567139b7bc808f3d0b81f092db5b92bd Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 12 Aug 2022 13:20:44 +0000 Subject: [PATCH 0419/1274] fix: update Cargo.lock --- Cargo.lock | 1740 ++++++++++++++++++++++------------------------------ 1 file changed, 737 insertions(+), 1003 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed3bc9c0df..d70b2309f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -313,7 +313,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0de5164e5edbf51c45fb8c2d9664ae1c095cce1b265ecf7569093c0d66ef690" dependencies = [ - "bytes 1.2.0", + "bytes", "futures-sink", "futures-util", "memchr", @@ -366,7 +366,7 @@ dependencies = [ "instant", "pin-project-lite 0.2.9", "rand 0.8.5", - "tokio 1.20.1", + "tokio", ] [[package]] @@ -420,7 +420,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "beefy-primitives", "fnv", @@ -454,7 +454,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -474,12 +474,16 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +dependencies = [ + "beefy-primitives", + "sp-api", +] [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -678,160 +682,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "bp-header-chain" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" -dependencies = [ - "bp-runtime", - "finality-grandpa", - "frame-support", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-finality-grandpa", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "bp-message-dispatch" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" -dependencies = [ - "bp-runtime", - "frame-support", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-std", -] - -[[package]] -name = "bp-messages" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" -dependencies = [ - "bitvec 1.0.1", - "bp-runtime", - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-std", -] - -[[package]] -name = "bp-polkadot-core" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" -dependencies = [ - "bp-messages", - "bp-runtime", - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std", - "sp-version", -] - -[[package]] -name = "bp-rococo" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" -dependencies = [ - "bp-messages", - "bp-polkadot-core", - "bp-runtime", - "frame-support", - "parity-scale-codec 3.1.5", - "smallvec", - "sp-api", - "sp-runtime", - "sp-std", - "sp-version", -] - -[[package]] -name = "bp-runtime" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" -dependencies = [ - "frame-support", - "hash-db", - "num-traits", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-trie", -] - -[[package]] -name = "bp-test-utils" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" -dependencies = [ - "bp-header-chain", - "ed25519-dalek", - "finality-grandpa", - "parity-scale-codec 3.1.5", - "sp-application-crypto", - "sp-finality-grandpa", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "bp-wococo" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" -dependencies = [ - "bp-messages", - "bp-polkadot-core", - "bp-rococo", - "bp-runtime", - "parity-scale-codec 3.1.5", - "sp-api", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "bridge-runtime-common" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" -dependencies = [ - "bp-message-dispatch", - "bp-messages", - "bp-runtime", - "frame-support", - "frame-system", - "hash-db", - "pallet-bridge-dispatch", - "pallet-bridge-grandpa", - "pallet-bridge-messages", - "pallet-transaction-payment", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-api", - "sp-core", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-trie", -] - [[package]] name = "bs58" version = "0.4.0" @@ -880,12 +730,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "bytes" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" - [[package]] name = "bytes" version = "1.2.0" @@ -1010,7 +854,7 @@ dependencies = [ "libc", "num-integer", "num-traits", - "time", + "time 0.1.44", "winapi", ] @@ -1199,59 +1043,60 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.82.3" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38faa2a16616c8e78a18d37b4726b98bfd2de192f2fdc8a39ddf568a408a0f75" +checksum = "749d0d6022c9038dccf480bdde2a38d435937335bf2bb0f14e815d94517cdce8" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.82.3" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f192472a3ba23860afd07d2b0217dc628f21fcc72617aa1336d98e1671f33b" +checksum = "e94370cc7b37bf652ccd8bb8f09bd900997f7ccf97520edfc75554bb5c4abbea" dependencies = [ "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", + "cranelift-isle", "gimli", "log", - "regalloc", + "regalloc2", "smallvec", "target-lexicon", ] [[package]] name = "cranelift-codegen-meta" -version = "0.82.3" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32ddb89e9b89d3d9b36a5b7d7ea3261c98235a76ac95ba46826b8ec40b1a24" +checksum = "e0a3cea8fdab90e44018c5b9a1dfd460d8ee265ac354337150222a354628bdb6" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.82.3" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fd0d9f288cc1b42d9333b7a776b17e278fc888c28e6a0f09b5573d45a150bc" +checksum = "5ac72f76f2698598951ab26d8c96eaa854810e693e7dd52523958b5909fde6b2" [[package]] name = "cranelift-entity" -version = "0.82.3" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3bfe172b83167604601faf9dc60453e0d0a93415b57a9c4d1a7ae6849185cf" +checksum = "09eaeacfcd2356fe0e66b295e8f9d59fdd1ac3ace53ba50de14d628ec902f72d" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.82.3" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a006e3e32d80ce0e4ba7f1f9ddf66066d052a8c884a110b91d05404d6ce26dce" +checksum = "dba69c9980d5ffd62c18a2bde927855fcd7c8dc92f29feaf8636052662cbd99c" dependencies = [ "cranelift-codegen", "log", @@ -1259,11 +1104,17 @@ dependencies = [ "target-lexicon", ] +[[package]] +name = "cranelift-isle" +version = "0.85.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2920dc1e05cac40304456ed3301fde2c09bd6a9b0210bcfa2f101398d628d5b" + [[package]] name = "cranelift-native" -version = "0.82.3" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501241b0cdf903412ec9075385ac9f2b1eb18a89044d1538e97fab603231f70c" +checksum = "f04dfa45f9b2a6f587c564d6b63388e00cd6589d2df6ea2758cf79e1a13285e6" dependencies = [ "cranelift-codegen", "libc", @@ -1272,9 +1123,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.82.3" +version = "0.85.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d9e4211bbc3268042a96dd4de5bd979cda22434991d035f5f8eacba987fad2" +checksum = "31a46513ae6f26f3f267d8d75b5373d555fbbd1e68681f348d99df43f747ec54" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1431,18 +1282,22 @@ dependencies = [ [[package]] name = "cumulus-client-cli" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "clap", + "parity-scale-codec 3.1.5", + "sc-chain-spec", "sc-cli", "sc-service", + "sp-core", + "sp-runtime", "url", ] [[package]] name = "cumulus-client-collator" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -1466,7 +1321,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -1495,7 +1350,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -1516,7 +1371,7 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -1541,7 +1396,7 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", @@ -1565,7 +1420,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -1573,11 +1428,9 @@ dependencies = [ "cumulus-client-pov-recovery", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "parity-scale-codec 3.1.5", "parking_lot 0.12.1", "polkadot-overseer", "polkadot-primitives", - "sc-chain-spec", "sc-client-api", "sc-consensus", "sc-consensus-babe", @@ -1595,7 +1448,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "frame-executive", "frame-support", @@ -1613,7 +1466,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-dmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1631,7 +1484,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "cumulus-pallet-parachain-system-proc-macro", "cumulus-primitives-core", @@ -1661,7 +1514,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1672,7 +1525,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1689,7 +1542,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1707,7 +1560,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "frame-support", "parity-scale-codec 3.1.5", @@ -1723,7 +1576,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1746,7 +1599,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "cumulus-primitives-core", "futures 0.3.21", @@ -1759,7 +1612,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1776,7 +1629,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1791,7 +1644,6 @@ dependencies = [ "sc-client-api", "sc-consensus-babe", "sc-network", - "sc-service", "sc-sysinfo", "sc-telemetry", "sc-tracing", @@ -1807,7 +1659,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1819,7 +1671,6 @@ dependencies = [ "polkadot-overseer", "polkadot-service", "sc-client-api", - "sc-service", "sp-api", "sp-blockchain", "sp-core", @@ -1831,7 +1682,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "async-trait", "backoff", @@ -1857,7 +1708,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "cumulus-primitives-core", "parity-scale-codec 3.1.5", @@ -2282,7 +2133,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23750149fe8834c0e24bb9adcbacbe06c45b9861f15df53e09f26cb7c4ab91ef" dependencies = [ - "bytes 1.2.0", + "bytes", "ethereum-types", "hash-db", "hash256-std-hasher", @@ -2320,7 +2171,7 @@ checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" [[package]] name = "evm" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.26#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "auto_impl", "environmental", @@ -2366,7 +2217,7 @@ dependencies = [ [[package]] name = "evm-core" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.26#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "parity-scale-codec 3.1.5", "primitive-types", @@ -2377,7 +2228,7 @@ dependencies = [ [[package]] name = "evm-gasometer" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.26#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "environmental", "evm-core", @@ -2388,7 +2239,7 @@ dependencies = [ [[package]] name = "evm-runtime" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.26#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "auto_impl", "environmental", @@ -2480,7 +2331,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" dependencies = [ "async-trait", "fc-db", @@ -2499,7 +2350,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -2515,7 +2366,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" dependencies = [ "fc-db", "fp-consensus", @@ -2532,7 +2383,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" dependencies = [ "ethereum", "ethereum-types", @@ -2566,13 +2417,13 @@ dependencies = [ "sp-runtime", "sp-storage", "substrate-prometheus-endpoint", - "tokio 1.20.1", + "tokio", ] [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" dependencies = [ "ethereum", "ethereum-types", @@ -2612,11 +2463,23 @@ dependencies = [ "log", ] +[[package]] +name = "filetime" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "windows-sys", +] + [[package]] name = "finality-grandpa" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9def033d8505edf199f6a5d07aa7e6d2d6185b164293b77f0efd108f4f3e11d" +checksum = "b22349c6a11563a202d95772a68e0fcf56119e74ea8a2a19cf2301460fcd0df5" dependencies = [ "either", "futures 0.3.21", @@ -2624,7 +2487,7 @@ dependencies = [ "log", "num-traits", "parity-scale-codec 3.1.5", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "scale-info", ] @@ -2659,18 +2522,19 @@ dependencies = [ [[package]] name = "flexi_logger" -version = "0.15.12" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaab3caedb4149800f91e8e4899f29cd9ddf3b569b04c365ca9334f92f7542bf" +checksum = "0c76a80dd14a27fc3d8bc696502132cb52b3f227256fd8601166c3a35e45f409" dependencies = [ + "ansi_term", "atty", - "chrono", "glob", "lazy_static", "log", "regex", + "rustversion", "thiserror", - "yansi", + "time 0.3.9", ] [[package]] @@ -2682,7 +2546,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "parity-scale-codec 3.1.5", ] @@ -2700,7 +2564,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" dependencies = [ "ethereum", "parity-scale-codec 3.1.5", @@ -2712,7 +2576,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" dependencies = [ "evm", "frame-support", @@ -2726,7 +2590,7 @@ dependencies = [ [[package]] name = "fp-evm-mapping" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" dependencies = [ "frame-support", "sp-core", @@ -2735,7 +2599,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" dependencies = [ "ethereum", "ethereum-types", @@ -2752,7 +2616,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" dependencies = [ "ethereum", "frame-support", @@ -2768,7 +2632,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" dependencies = [ "parity-scale-codec 3.1.5", ] @@ -2776,7 +2640,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-support", "frame-system", @@ -2798,7 +2662,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "Inflector", "chrono", @@ -2807,6 +2671,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "gethostname", "handlebars", "hash-db", "hex", @@ -2848,7 +2713,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2859,7 +2724,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2875,7 +2740,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-support", "frame-system", @@ -2903,7 +2768,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "bitflags", "frame-metadata", @@ -2933,7 +2798,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2945,7 +2810,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2957,7 +2822,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "proc-macro2", "quote", @@ -2967,7 +2832,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-support", "log", @@ -2984,7 +2849,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -2999,7 +2864,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "parity-scale-codec 3.1.5", "sp-api", @@ -3008,7 +2873,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-support", "sp-api", @@ -3191,6 +3056,15 @@ dependencies = [ "slab", ] +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + [[package]] name = "generic-array" version = "0.12.4" @@ -3210,6 +3084,16 @@ dependencies = [ "version_check", ] +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "getrandom" version = "0.1.16" @@ -3303,7 +3187,7 @@ version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" dependencies = [ - "bytes 1.2.0", + "bytes", "fnv", "futures-core", "futures-sink", @@ -3311,7 +3195,7 @@ dependencies = [ "http", "indexmap", "slab", - "tokio 1.20.1", + "tokio", "tokio-util", "tracing", ] @@ -3453,7 +3337,7 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ - "bytes 1.2.0", + "bytes", "fnv", "itoa 1.0.2", ] @@ -3464,7 +3348,7 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ - "bytes 1.2.0", + "bytes", "http", "pin-project-lite 0.2.9", ] @@ -3493,7 +3377,7 @@ version = "0.14.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" dependencies = [ - "bytes 1.2.0", + "bytes", "futures-channel", "futures-core", "futures-util", @@ -3505,7 +3389,7 @@ dependencies = [ "itoa 1.0.2", "pin-project-lite 0.2.9", "socket2", - "tokio 1.20.1", + "tokio", "tower-service", "tracing", "want", @@ -3522,7 +3406,7 @@ dependencies = [ "log", "rustls", "rustls-native-certs", - "tokio 1.20.1", + "tokio", "tokio-rustls", ] @@ -3650,6 +3534,12 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec58677acfea8a15352d42fc87d11d63596ade9239e0a7c9352914417515dbe6" +[[package]] +name = "io-lifetimes" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24c3f4eff5495aee4c0399d7b6a0dc2b6e81be84242ffbfcf253ebacccc1d0cb" + [[package]] name = "ip_network" version = "0.4.1" @@ -3715,8 +3605,8 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.13.1" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.13.1-fix-unknown-fields#ffcb6ffda701192cdb6ca66594345e6e454cac16" +version = "0.14.0" +source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" dependencies = [ "jsonrpsee-core", "jsonrpsee-http-server", @@ -3729,18 +3619,18 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.13.1" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.13.1-fix-unknown-fields#ffcb6ffda701192cdb6ca66594345e6e454cac16" +version = "0.14.0" +source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" dependencies = [ "futures-util", "http", "jsonrpsee-core", "jsonrpsee-types", - "pin-project 1.0.11", + "pin-project", "rustls-native-certs", "soketto", "thiserror", - "tokio 1.20.1", + "tokio", "tokio-rustls", "tokio-util", "tracing", @@ -3749,8 +3639,8 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.13.1" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.13.1-fix-unknown-fields#ffcb6ffda701192cdb6ca66594345e6e454cac16" +version = "0.14.0" +source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" dependencies = [ "anyhow", "arrayvec 0.7.2", @@ -3760,8 +3650,10 @@ dependencies = [ "futures-channel", "futures-timer", "futures-util", + "globset", "hyper", "jsonrpsee-types", + "lazy_static", "parking_lot 0.12.1", "rand 0.8.5", "rustc-hash", @@ -3769,32 +3661,31 @@ dependencies = [ "serde_json", "soketto", "thiserror", - "tokio 1.20.1", + "tokio", "tracing", + "unicase", ] [[package]] name = "jsonrpsee-http-server" -version = "0.13.1" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.13.1-fix-unknown-fields#ffcb6ffda701192cdb6ca66594345e6e454cac16" +version = "0.14.0" +source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" dependencies = [ "futures-channel", "futures-util", - "globset", "hyper", "jsonrpsee-core", "jsonrpsee-types", - "lazy_static", + "serde", "serde_json", - "tokio 1.20.1", + "tokio", "tracing", - "unicase", ] [[package]] name = "jsonrpsee-proc-macros" -version = "0.13.1" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.13.1-fix-unknown-fields#ffcb6ffda701192cdb6ca66594345e6e454cac16" +version = "0.14.0" +source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3804,8 +3695,8 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.13.1" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.13.1-fix-unknown-fields#ffcb6ffda701192cdb6ca66594345e6e454cac16" +version = "0.14.0" +source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" dependencies = [ "anyhow", "beef", @@ -3817,8 +3708,8 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.13.1" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.13.1-fix-unknown-fields#ffcb6ffda701192cdb6ca66594345e6e454cac16" +version = "0.14.0" +source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -3827,8 +3718,8 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-server" -version = "0.13.1" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.13.1-fix-unknown-fields#ffcb6ffda701192cdb6ca66594345e6e454cac16" +version = "0.14.0" +source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" dependencies = [ "futures-channel", "futures-util", @@ -3836,7 +3727,8 @@ dependencies = [ "jsonrpsee-types", "serde_json", "soketto", - "tokio 1.20.1", + "tokio", + "tokio-stream", "tokio-util", "tracing", ] @@ -3861,8 +3753,8 @@ checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" [[package]] name = "kusama-runtime" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -3896,7 +3788,6 @@ dependencies = [ "pallet-indices", "pallet-membership", "pallet-multisig", - "pallet-nicks", "pallet-nomination-pools", "pallet-nomination-pools-benchmarking", "pallet-offences", @@ -3954,8 +3845,8 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "frame-support", "polkadot-primitives", @@ -4058,18 +3949,18 @@ checksum = "33a33a362ce288760ec6a508b94caaec573ae7d3bbbd91b87aa0bad4456839db" [[package]] name = "libp2p" -version = "0.45.1" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41726ee8f662563fafba2d2d484b14037cc8ecb8c953fbfc8439d4ce3a0a9029" +checksum = "81327106887e42d004fbdab1fef93675be2e2e07c1b95fce45e2cc813485611d" dependencies = [ - "bytes 1.2.0", + "bytes", "futures 0.3.21", "futures-timer", "getrandom 0.2.7", "instant", "lazy_static", "libp2p-autonat", - "libp2p-core 0.33.0", + "libp2p-core", "libp2p-deflate", "libp2p-dns", "libp2p-floodsub", @@ -4095,69 +3986,35 @@ dependencies = [ "libp2p-yamux", "multiaddr", "parking_lot 0.12.1", - "pin-project 1.0.11", + "pin-project", "rand 0.7.3", "smallvec", ] [[package]] name = "libp2p-autonat" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d45945fd2f96c4b133c23d5c28a8b7fc8d7138e6dd8d5a8cd492dd384f888e3" +checksum = "4decc51f3573653a9f4ecacb31b1b922dd20c25a6322bb15318ec04287ec46f9" dependencies = [ "async-trait", "futures 0.3.21", "futures-timer", "instant", - "libp2p-core 0.33.0", + "libp2p-core", "libp2p-request-response", "libp2p-swarm", "log", - "prost 0.10.4", - "prost-build 0.10.4", + "prost", + "prost-build", "rand 0.8.5", ] [[package]] name = "libp2p-core" -version = "0.32.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db5b02602099fb75cb2d16f9ea860a320d6eb82ce41e95ab680912c454805cd5" -dependencies = [ - "asn1_der", - "bs58", - "ed25519-dalek", - "either", - "fnv", - "futures 0.3.21", - "futures-timer", - "instant", - "lazy_static", - "log", - "multiaddr", - "multihash", - "multistream-select", - "parking_lot 0.12.1", - "pin-project 1.0.11", - "prost 0.9.0", - "prost-build 0.9.0", - "rand 0.8.5", - "ring", - "rw-stream-sink 0.2.1", - "sha2 0.10.2", - "smallvec", - "thiserror", - "unsigned-varint", - "void", - "zeroize", -] - -[[package]] -name = "libp2p-core" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42d46fca305dee6757022e2f5a4f6c023315084d0ed7441c3ab244e76666d979" +checksum = "fbf9b94cefab7599b2d3dff2f93bee218c6621d68590b23ede4485813cbcece6" dependencies = [ "asn1_der", "bs58", @@ -4174,12 +4031,12 @@ dependencies = [ "multihash", "multistream-select", "parking_lot 0.12.1", - "pin-project 1.0.11", - "prost 0.10.4", - "prost-build 0.10.4", + "pin-project", + "prost", + "prost-build", "rand 0.8.5", "ring", - "rw-stream-sink 0.3.0", + "rw-stream-sink", "sha2 0.10.2", "smallvec", "thiserror", @@ -4190,24 +4047,24 @@ dependencies = [ [[package]] name = "libp2p-deflate" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86adefc55ea4ed8201149f052fb441210727481dff1fb0b8318460206a79f5fb" +checksum = "d0183dc2a3da1fbbf85e5b6cf51217f55b14f5daea0c455a9536eef646bfec71" dependencies = [ "flate2", "futures 0.3.21", - "libp2p-core 0.33.0", + "libp2p-core", ] [[package]] name = "libp2p-dns" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb462ec3a51fab457b4b44ac295e8b0a4b04dc175127e615cf996b1f0f1a268" +checksum = "6cbf54723250fa5d521383be789bf60efdabe6bacfb443f87da261019a49b4b5" dependencies = [ "async-std-resolver", "futures 0.3.21", - "libp2p-core 0.33.0", + "libp2p-core", "log", "parking_lot 0.12.1", "smallvec", @@ -4216,42 +4073,42 @@ dependencies = [ [[package]] name = "libp2p-floodsub" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a505d0c6f851cbf2919535150198e530825def8bd3757477f13dc3a57f46cbcc" +checksum = "98a4b6ffd53e355775d24b76f583fdda54b3284806f678499b57913adb94f231" dependencies = [ "cuckoofilter", "fnv", "futures 0.3.21", - "libp2p-core 0.33.0", + "libp2p-core", "libp2p-swarm", "log", - "prost 0.10.4", - "prost-build 0.10.4", + "prost", + "prost-build", "rand 0.7.3", "smallvec", ] [[package]] name = "libp2p-gossipsub" -version = "0.38.1" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43e064ba4d7832e01c738626c6b274ae100baba05f5ffcc7b265c2a3ed398108" +checksum = "74b4b888cfbeb1f5551acd3aa1366e01bf88ede26cc3c4645d0d2d004d5ca7b0" dependencies = [ "asynchronous-codec", "base64", "byteorder", - "bytes 1.2.0", + "bytes", "fnv", "futures 0.3.21", "hex_fmt", "instant", - "libp2p-core 0.33.0", + "libp2p-core", "libp2p-swarm", "log", "prometheus-client", - "prost 0.10.4", - "prost-build 0.10.4", + "prost", + "prost-build", "rand 0.7.3", "regex", "sha2 0.10.2", @@ -4262,19 +4119,19 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.36.1" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84b53490442d086db1fa5375670c9666e79143dccadef3f7c74a4346899a984" +checksum = "c50b585518f8efd06f93ac2f976bd672e17cdac794644b3117edd078e96bda06" dependencies = [ "asynchronous-codec", "futures 0.3.21", "futures-timer", - "libp2p-core 0.33.0", + "libp2p-core", "libp2p-swarm", "log", "lru 0.7.8", - "prost 0.10.4", - "prost-build 0.10.4", + "prost", + "prost-build", "prost-codec", "smallvec", "thiserror", @@ -4283,23 +4140,23 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.37.1" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6b5d4de90fcd35feb65ea6223fd78f3b747a64ca4b65e0813fbe66a27d56aa" +checksum = "740862893bb5f06ac24acc9d49bdeadc3a5e52e51818a30a25c1f3519da2c851" dependencies = [ "arrayvec 0.7.2", "asynchronous-codec", - "bytes 1.2.0", + "bytes", "either", "fnv", "futures 0.3.21", "futures-timer", "instant", - "libp2p-core 0.33.0", + "libp2p-core", "libp2p-swarm", "log", - "prost 0.10.4", - "prost-build 0.10.4", + "prost", + "prost-build", "rand 0.7.3", "sha2 0.10.2", "smallvec", @@ -4311,9 +4168,9 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4783f8cf00c7b6c1ff0f1870b4fcf50b042b45533d2e13b6fb464caf447a6951" +checksum = "66e5e5919509603281033fd16306c61df7a4428ce274b67af5e14b07de5cdcb2" dependencies = [ "async-io", "data-encoding", @@ -4321,7 +4178,7 @@ dependencies = [ "futures 0.3.21", "if-watch", "lazy_static", - "libp2p-core 0.33.0", + "libp2p-core", "libp2p-swarm", "log", "rand 0.8.5", @@ -4332,11 +4189,11 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "564a7e5284d7d9b3140fdfc3cb6567bc32555e86a21de5604c2ec85da05cf384" +checksum = "ef8aff4a1abef42328fbb30b17c853fff9be986dc39af17ee39f9c5f755c5e0c" dependencies = [ - "libp2p-core 0.33.0", + "libp2p-core", "libp2p-gossipsub", "libp2p-identify", "libp2p-kad", @@ -4348,14 +4205,14 @@ dependencies = [ [[package]] name = "libp2p-mplex" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ff9c893f2367631a711301d703c47432af898c9bb8253bea0e2c051a13f7640" +checksum = "61fd1b20638ec209c5075dfb2e8ce6a7ea4ec3cd3ad7b77f7a477c06d53322e2" dependencies = [ "asynchronous-codec", - "bytes 1.2.0", + "bytes", "futures 0.3.21", - "libp2p-core 0.33.0", + "libp2p-core", "log", "nohash-hasher", "parking_lot 0.12.1", @@ -4366,18 +4223,18 @@ dependencies = [ [[package]] name = "libp2p-noise" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2cee1dad1c83325bbd182a8e94555778699cec8a9da00086efb7522c4c15ad" +checksum = "762408cb5d84b49a600422d7f9a42c18012d8da6ebcd570f9a4a4290ba41fb6f" dependencies = [ - "bytes 1.2.0", + "bytes", "curve25519-dalek 3.2.0", "futures 0.3.21", "lazy_static", - "libp2p-core 0.33.0", + "libp2p-core", "log", - "prost 0.10.4", - "prost-build 0.10.4", + "prost", + "prost-build", "rand 0.8.5", "sha2 0.10.2", "snow", @@ -4388,14 +4245,14 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d41516c82fe8dd148ec925eead0c5ec08a0628f7913597e93e126e4dfb4e0787" +checksum = "100a6934ae1dbf8a693a4e7dd1d730fd60b774dafc45688ed63b554497c6c925" dependencies = [ "futures 0.3.21", "futures-timer", "instant", - "libp2p-core 0.33.0", + "libp2p-core", "libp2p-swarm", "log", "rand 0.7.3", @@ -4404,17 +4261,17 @@ dependencies = [ [[package]] name = "libp2p-plaintext" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db007e737adc5d28b2e03223b0210164928ad742591127130796a72aa8eaf54f" +checksum = "be27bf0820a6238a4e06365b096d428271cce85a129cf16f2fe9eb1610c4df86" dependencies = [ "asynchronous-codec", - "bytes 1.2.0", + "bytes", "futures 0.3.21", - "libp2p-core 0.33.0", + "libp2p-core", "log", - "prost 0.10.4", - "prost-build 0.10.4", + "prost", + "prost-build", "unsigned-varint", "void", ] @@ -4427,7 +4284,7 @@ checksum = "0f1a458bbda880107b5b36fcb9b5a1ef0c329685da0e203ed692a8ebe64cc92c" dependencies = [ "futures 0.3.21", "log", - "pin-project 1.0.11", + "pin-project", "rand 0.7.3", "salsa20", "sha3 0.9.1", @@ -4435,22 +4292,22 @@ dependencies = [ [[package]] name = "libp2p-relay" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624ead3406f64437a0d4567c31bd128a9a0b8226d5f16c074038f5d0fc32f650" +checksum = "4931547ee0cce03971ccc1733ff05bb0c4349fd89120a39e9861e2bbe18843c3" dependencies = [ "asynchronous-codec", - "bytes 1.2.0", + "bytes", "either", "futures 0.3.21", "futures-timer", "instant", - "libp2p-core 0.33.0", + "libp2p-core", "libp2p-swarm", "log", - "pin-project 1.0.11", - "prost 0.10.4", - "prost-build 0.10.4", + "pin-project", + "prost", + "prost-build", "prost-codec", "rand 0.8.5", "smallvec", @@ -4461,20 +4318,20 @@ dependencies = [ [[package]] name = "libp2p-rendezvous" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59967ea2db2c7560f641aa58ac05982d42131863fcd3dd6dcf0dd1daf81c60c" +checksum = "9511c9672ba33284838e349623319c8cad2d18cfad243ae46c6b7e8a2982ea4e" dependencies = [ "asynchronous-codec", "bimap", "futures 0.3.21", "futures-timer", "instant", - "libp2p-core 0.33.0", + "libp2p-core", "libp2p-swarm", "log", - "prost 0.10.4", - "prost-build 0.10.4", + "prost", + "prost-build", "rand 0.8.5", "sha2 0.10.2", "thiserror", @@ -4484,15 +4341,15 @@ dependencies = [ [[package]] name = "libp2p-request-response" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b02e0acb725e5a757d77c96b95298fd73a7394fe82ba7b8bbeea510719cbe441" +checksum = "508a189e2795d892c8f5c1fa1e9e0b1845d32d7b0b249dbf7b05b18811361843" dependencies = [ "async-trait", - "bytes 1.2.0", + "bytes", "futures 0.3.21", "instant", - "libp2p-core 0.33.0", + "libp2p-core", "libp2p-swarm", "log", "rand 0.7.3", @@ -4502,18 +4359,18 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.36.1" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4bb21c5abadbf00360c734f16bf87f1712ed4f23cd46148f625d2ddb867346" +checksum = "95ac5be6c2de2d1ff3f7693fda6faf8a827b1f3e808202277783fea9f527d114" dependencies = [ "either", "fnv", "futures 0.3.21", "futures-timer", "instant", - "libp2p-core 0.33.0", + "libp2p-core", "log", - "pin-project 1.0.11", + "pin-project", "rand 0.7.3", "smallvec", "thiserror", @@ -4522,9 +4379,9 @@ dependencies = [ [[package]] name = "libp2p-swarm-derive" -version = "0.27.2" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f693c8c68213034d472cbb93a379c63f4f307d97c06f1c41e4985de481687a5" +checksum = "9f54a64b6957249e0ce782f8abf41d97f69330d02bf229f0672d864f0650cc76" dependencies = [ "quote", "syn", @@ -4532,9 +4389,9 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4933e38ef21b50698aefc87799c24f2a365c9d3f6cf50471f3f6a0bc410892" +checksum = "8a6771dc19aa3c65d6af9a8c65222bfc8fcd446630ddca487acd161fa6096f3b" dependencies = [ "async-io", "futures 0.3.21", @@ -4542,32 +4399,32 @@ dependencies = [ "if-watch", "ipnet", "libc", - "libp2p-core 0.33.0", + "libp2p-core", "log", "socket2", ] [[package]] name = "libp2p-uds" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24bdab114f7f2701757d6541266e1131b429bbae382008f207f2114ee4222dcb" +checksum = "d125e3e5f0d58f3c6ac21815b20cf4b6a88b8db9dc26368ea821838f4161fd4d" dependencies = [ "async-std", "futures 0.3.21", - "libp2p-core 0.32.1", + "libp2p-core", "log", ] [[package]] name = "libp2p-wasm-ext" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f066f2b8b1a1d64793f05da2256e6842ecd0293d6735ca2e9bda89831a1bdc06" +checksum = "ec894790eec3c1608f8d1a8a0bdf0dbeb79ed4de2dce964222011c2896dfa05a" dependencies = [ "futures 0.3.21", "js-sys", - "libp2p-core 0.33.0", + "libp2p-core", "parity-send-wrapper", "wasm-bindgen", "wasm-bindgen-futures", @@ -4575,18 +4432,18 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39d398fbb29f432c4128fabdaac2ed155c3bcaf1b9bd40eeeb10a471eefacbf5" +checksum = "9808e57e81be76ff841c106b4c5974fb4d41a233a7bdd2afbf1687ac6def3818" dependencies = [ "either", "futures 0.3.21", "futures-rustls", - "libp2p-core 0.33.0", + "libp2p-core", "log", "parking_lot 0.12.1", "quicksink", - "rw-stream-sink 0.3.0", + "rw-stream-sink", "soketto", "url", "webpki-roots", @@ -4594,12 +4451,12 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fe653639ad74877c759720febb0cbcbf4caa221adde4eed2d3126ce5c6f381f" +checksum = "c6dea686217a06072033dc025631932810e2f6ad784e4fafa42e27d311c7a81c" dependencies = [ "futures 0.3.21", - "libp2p-core 0.33.0", + "libp2p-core", "parking_lot 0.12.1", "thiserror", "yamux", @@ -4710,6 +4567,12 @@ version = "0.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5284f00d480e1c39af34e72f8ad60b94f47007e3481cd3b731c1d67190ddc7b7" +[[package]] +name = "linux-raw-sys" +version = "0.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" + [[package]] name = "lock_api" version = "0.4.7" @@ -5018,10 +4881,10 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "363a84be6453a70e63513660f4894ef815daf88e3356bffcda9ca27d810ce83b" dependencies = [ - "bytes 1.2.0", + "bytes", "futures 0.3.21", "log", - "pin-project 1.0.11", + "pin-project", "smallvec", "unsigned-varint", ] @@ -5114,13 +4977,13 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ - "bytes 1.2.0", + "bytes", "futures 0.3.21", "log", "netlink-packet-core", "netlink-sys", "thiserror", - "tokio 1.20.1", + "tokio", ] [[package]] @@ -5130,7 +4993,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92b654097027250401127914afb37cb1f311df6610a9891ff07a757e94199027" dependencies = [ "async-io", - "bytes 1.2.0", + "bytes", "futures 0.3.21", "libc", "log", @@ -5252,13 +5115,23 @@ dependencies = [ "libc", ] +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + [[package]] name = "object" -version = "0.27.1" +version = "0.28.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" dependencies = [ "crc32fast", + "hashbrown 0.11.2", "indexmap", "memchr", ] @@ -5384,14 +5257,14 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "orchestra" version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "async-trait", "dyn-clonable", "futures 0.3.21", "futures-timer", "orchestra-proc-macro", - "pin-project 1.0.11", + "pin-project", "prioritized-metered-channel", "thiserror", "tracing", @@ -5400,9 +5273,10 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "expander 0.0.6", + "itertools", "petgraph", "proc-macro-crate", "proc-macro2", @@ -5422,7 +5296,7 @@ dependencies = [ [[package]] name = "orml-vesting" version = "0.4.1-dev" -source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=unique-polkadot-v0.9.24#e69cabf5dc293e54a3ce60e3db4bf2f381bd20eb" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=8c625a5ab43c1c56cdeed5f8d814a891566d4cf8#8c625a5ab43c1c56cdeed5f8d814a891566d4cf8" dependencies = [ "frame-support", "frame-system", @@ -5452,7 +5326,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-support", "frame-system", @@ -5468,7 +5342,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-support", "frame-system", @@ -5484,7 +5358,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-support", "frame-system", @@ -5499,7 +5373,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -5523,7 +5397,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5543,7 +5417,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -5558,7 +5432,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" dependencies = [ "fp-evm", "frame-support", @@ -5573,7 +5447,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "beefy-primitives", "frame-support", @@ -5589,7 +5463,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -5612,7 +5486,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -5627,70 +5501,10 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-bridge-dispatch" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" -dependencies = [ - "bp-message-dispatch", - "bp-runtime", - "frame-support", - "frame-system", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-bridge-grandpa" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" -dependencies = [ - "bp-header-chain", - "bp-runtime", - "bp-test-utils", - "finality-grandpa", - "frame-support", - "frame-system", - "log", - "num-traits", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-finality-grandpa", - "sp-runtime", - "sp-std", - "sp-trie", -] - -[[package]] -name = "pallet-bridge-messages" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" -dependencies = [ - "bitvec 1.0.1", - "bp-message-dispatch", - "bp-messages", - "bp-runtime", - "frame-support", - "frame-system", - "log", - "num-traits", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-runtime", - "sp-std", -] - [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -5709,7 +5523,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -5763,7 +5577,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -5779,7 +5593,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5802,7 +5616,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5815,7 +5629,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -5833,7 +5647,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" dependencies = [ "ethereum", "ethereum-types", @@ -5862,7 +5676,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" dependencies = [ "evm", "fp-evm", @@ -5985,7 +5799,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6000,7 +5814,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6023,7 +5837,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6039,7 +5853,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6059,7 +5873,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6095,7 +5909,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6112,7 +5926,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -6130,7 +5944,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "jsonrpsee", "parity-scale-codec 3.1.5", @@ -6145,7 +5959,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6157,24 +5971,10 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-nicks" -version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-io", - "sp-runtime", - "sp-std", -] - [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-support", "frame-system", @@ -6182,6 +5982,7 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "sp-core", + "sp-io", "sp-runtime", "sp-staking", "sp-std", @@ -6190,7 +5991,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6231,7 +6032,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-support", "frame-system", @@ -6248,7 +6049,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6271,7 +6072,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6287,7 +6088,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6302,7 +6103,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-support", "frame-system", @@ -6316,7 +6117,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6395,7 +6196,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6411,7 +6212,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-support", "frame-system", @@ -6432,7 +6233,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6448,7 +6249,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-support", "frame-system", @@ -6462,7 +6263,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6485,7 +6286,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6496,7 +6297,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "log", "sp-arithmetic", @@ -6520,7 +6321,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-support", "frame-system", @@ -6534,7 +6335,7 @@ dependencies = [ [[package]] name = "pallet-template-transaction-payment" version = "3.0.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.24#05cb0f02abecad915d32455df7a7724b3e2869aa" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.26#711367a0ba6c495438f6e05e5c28690fc90bfdec" dependencies = [ "frame-benchmarking", "frame-support", @@ -6554,7 +6355,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6572,7 +6373,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6591,7 +6392,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-support", "frame-system", @@ -6607,7 +6408,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6622,7 +6423,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "pallet-transaction-payment", "parity-scale-codec 3.1.5", @@ -6633,7 +6434,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6693,7 +6494,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6709,7 +6510,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6723,8 +6524,8 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "frame-support", "frame-system", @@ -6741,8 +6542,8 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "frame-benchmarking", "frame-support", @@ -6759,7 +6560,7 @@ dependencies = [ [[package]] name = "parachain-info" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.24#95ca5a085727c1494ddeeae4a2b2e69c4ee1933b" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -7033,33 +6834,13 @@ dependencies = [ "indexmap", ] -[[package]] -name = "pin-project" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef0f924a5ee7ea9cbcea77529dba45f8a9ba9f622419fe3386ca581a3ae9d5a" -dependencies = [ - "pin-project-internal 0.4.30", -] - [[package]] name = "pin-project" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" dependencies = [ - "pin-project-internal 1.0.11", -] - -[[package]] -name = "pin-project-internal" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "851c8d0ce9bebe43790dedfc86614c23494ac9f423dd618d3a61fc693eafe61e" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "pin-project-internal", ] [[package]] @@ -7105,8 +6886,8 @@ checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" [[package]] name = "polkadot-approval-distribution" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "futures 0.3.21", "polkadot-node-network-protocol", @@ -7120,8 +6901,8 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "futures 0.3.21", "polkadot-node-network-protocol", @@ -7134,8 +6915,8 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "derive_more", "fatality", @@ -7157,8 +6938,8 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "fatality", "futures 0.3.21", @@ -7178,8 +6959,8 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "clap", "frame-benchmarking-cli", @@ -7203,8 +6984,8 @@ dependencies = [ [[package]] name = "polkadot-client" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "beefy-primitives", "frame-benchmarking", @@ -7243,8 +7024,8 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "always-assert", "fatality", @@ -7264,8 +7045,8 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "parity-scale-codec 3.1.5", "parity-util-mem", @@ -7277,8 +7058,8 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "derive_more", "fatality", @@ -7300,8 +7081,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "parity-scale-codec 3.1.5", "polkadot-node-primitives", @@ -7314,8 +7095,8 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "futures 0.3.21", "futures-timer", @@ -7334,12 +7115,12 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "always-assert", "async-trait", - "bytes 1.2.0", + "bytes", "futures 0.3.21", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", @@ -7355,8 +7136,8 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "futures 0.3.21", "parity-scale-codec 3.1.5", @@ -7373,8 +7154,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "bitvec 1.0.1", "derive_more", @@ -7402,8 +7183,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "bitvec 1.0.1", "futures 0.3.21", @@ -7422,8 +7203,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "bitvec 1.0.1", "fatality", @@ -7441,8 +7222,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "futures 0.3.21", "polkadot-node-subsystem", @@ -7456,8 +7237,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "async-trait", "futures 0.3.21", @@ -7474,8 +7255,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "futures 0.3.21", "polkadot-node-subsystem", @@ -7489,8 +7270,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "futures 0.3.21", "futures-timer", @@ -7506,8 +7287,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "fatality", "futures 0.3.21", @@ -7525,8 +7306,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "async-trait", "futures 0.3.21", @@ -7542,8 +7323,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "bitvec 1.0.1", "fatality", @@ -7560,8 +7341,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "always-assert", "assert_matches", @@ -7570,11 +7351,12 @@ dependencies = [ "futures 0.3.21", "futures-timer", "parity-scale-codec 3.1.5", - "pin-project 1.0.11", + "pin-project", "polkadot-core-primitives", "polkadot-node-subsystem-util", "polkadot-parachain", "rand 0.8.5", + "rayon", "sc-executor", "sc-executor-common", "sc-executor-wasmtime", @@ -7591,8 +7373,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "futures 0.3.21", "polkadot-node-primitives", @@ -7607,8 +7389,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "futures 0.3.21", "memory-lru", @@ -7624,8 +7406,8 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "async-std", "lazy_static", @@ -7642,8 +7424,8 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "bs58", "futures 0.3.21", @@ -7661,8 +7443,8 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "async-trait", "derive_more", @@ -7682,8 +7464,8 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "bounded-vec", "futures 0.3.21", @@ -7704,8 +7486,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -7714,8 +7496,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "derive_more", "futures 0.3.21", @@ -7733,8 +7515,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "async-trait", "derive_more", @@ -7747,7 +7529,7 @@ dependencies = [ "parity-scale-codec 3.1.5", "parity-util-mem", "parking_lot 0.11.2", - "pin-project 1.0.11", + "pin-project", "polkadot-node-jaeger", "polkadot-node-metrics", "polkadot-node-network-protocol", @@ -7766,8 +7548,8 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "futures 0.3.21", "futures-timer", @@ -7788,8 +7570,8 @@ dependencies = [ [[package]] name = "polkadot-parachain" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "derive_more", "frame-support", @@ -7805,8 +7587,8 @@ dependencies = [ [[package]] name = "polkadot-performance-test" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "env_logger", "kusama-runtime", @@ -7820,8 +7602,8 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "bitvec 1.0.1", "frame-system", @@ -7850,8 +7632,8 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "beefy-gadget", "beefy-gadget-rpc", @@ -7882,8 +7664,8 @@ dependencies = [ [[package]] name = "polkadot-runtime" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -7915,7 +7697,6 @@ dependencies = [ "pallet-indices", "pallet-membership", "pallet-multisig", - "pallet-nicks", "pallet-offences", "pallet-offences-benchmarking", "pallet-preimage", @@ -7968,8 +7749,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -8015,8 +7796,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "frame-support", "polkadot-primitives", @@ -8027,8 +7808,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "bs58", "parity-scale-codec 3.1.5", @@ -8039,8 +7820,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "bitflags", "bitvec 1.0.1", @@ -8082,8 +7863,8 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "async-trait", "beefy-gadget", @@ -8185,8 +7966,8 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "arrayvec 0.5.2", "fatality", @@ -8206,8 +7987,8 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "parity-scale-codec 3.1.5", "polkadot-primitives", @@ -8216,8 +7997,8 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -8233,7 +8014,6 @@ dependencies = [ "pallet-balances", "pallet-grandpa", "pallet-indices", - "pallet-nicks", "pallet-offences", "pallet-session", "pallet-staking", @@ -8278,12 +8058,11 @@ dependencies = [ [[package]] name = "polkadot-test-service" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "frame-benchmarking", "frame-system", - "futures 0.1.31", "futures 0.3.21", "hex", "pallet-balances", @@ -8326,7 +8105,7 @@ dependencies = [ "substrate-test-client", "tempfile", "test-runtime-constants", - "tokio 1.20.1", + "tokio", "tracing-gum", ] @@ -8389,7 +8168,7 @@ dependencies = [ [[package]] name = "prioritized-metered-channel" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "coarsetime", "crossbeam-queue", @@ -8481,44 +8260,14 @@ dependencies = [ "syn", ] -[[package]] -name = "prost" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" -dependencies = [ - "bytes 1.2.0", - "prost-derive 0.9.0", -] - [[package]] name = "prost" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" dependencies = [ - "bytes 1.2.0", - "prost-derive 0.10.1", -] - -[[package]] -name = "prost-build" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" -dependencies = [ - "bytes 1.2.0", - "heck 0.3.3", - "itertools", - "lazy_static", - "log", - "multimap", - "petgraph", - "prost 0.9.0", - "prost-types 0.9.0", - "regex", - "tempfile", - "which", + "bytes", + "prost-derive", ] [[package]] @@ -8527,7 +8276,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab" dependencies = [ - "bytes 1.2.0", + "bytes", "cfg-if 1.0.0", "cmake", "heck 0.4.0", @@ -8536,8 +8285,8 @@ dependencies = [ "log", "multimap", "petgraph", - "prost 0.10.4", - "prost-types 0.10.1", + "prost", + "prost-types", "regex", "tempfile", "which", @@ -8550,25 +8299,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00af1e92c33b4813cc79fda3f2dbf56af5169709be0202df730e9ebc3e4cd007" dependencies = [ "asynchronous-codec", - "bytes 1.2.0", - "prost 0.10.4", + "bytes", + "prost", "thiserror", "unsigned-varint", ] -[[package]] -name = "prost-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "prost-derive" version = "0.10.1" @@ -8582,24 +8318,14 @@ dependencies = [ "syn", ] -[[package]] -name = "prost-types" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" -dependencies = [ - "bytes 1.2.0", - "prost 0.9.0", -] - [[package]] name = "prost-types" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" dependencies = [ - "bytes 1.2.0", - "prost 0.10.4", + "bytes", + "prost", ] [[package]] @@ -8918,13 +8644,14 @@ dependencies = [ ] [[package]] -name = "regalloc" -version = "0.0.34" +name = "regalloc2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62446b1d3ebf980bdc68837700af1d77b37bc430e524bf95319c6eada2a4cc02" +checksum = "4a8d23b35d7177df3b9d31ed8a9ab4bf625c668be77a319d4f5efd4a5257701c" dependencies = [ + "fxhash", "log", - "rustc-hash", + "slice-group-by", "smallvec", ] @@ -8969,7 +8696,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "env_logger", "jsonrpsee", @@ -9040,7 +8767,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "999508abb0ae792aabed2460c45b89106d97fe4adac593bdaef433c2605847b5" dependencies = [ - "bytes 1.2.0", + "bytes", "rustc-hex", ] @@ -9089,16 +8816,11 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "beefy-merkle-tree", "beefy-primitives", - "bp-messages", - "bp-rococo", - "bp-runtime", - "bp-wococo", - "bridge-runtime-common", "frame-benchmarking", "frame-executive", "frame-support", @@ -9113,9 +8835,6 @@ dependencies = [ "pallet-balances", "pallet-beefy", "pallet-beefy-mmr", - "pallet-bridge-dispatch", - "pallet-bridge-grandpa", - "pallet-bridge-messages", "pallet-collective", "pallet-grandpa", "pallet-im-online", @@ -9166,8 +8885,8 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "frame-support", "polkadot-primitives", @@ -9245,12 +8964,26 @@ checksum = "938a344304321a9da4973b9ff4f9f8db9caf4597dfd9dda6a60b523340a0fff0" dependencies = [ "bitflags", "errno", - "io-lifetimes", + "io-lifetimes 0.5.3", "libc", - "linux-raw-sys", + "linux-raw-sys 0.0.42", "winapi", ] +[[package]] +name = "rustix" +version = "0.35.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51cc38aa10f6bbb377ed28197aa052aa4e2b762c22be9d3153d01822587e787" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes 0.7.2", + "libc", + "linux-raw-sys 0.0.46", + "windows-sys", +] + [[package]] name = "rustls" version = "0.20.6" @@ -9290,17 +9023,6 @@ version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8" -[[package]] -name = "rw-stream-sink" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" -dependencies = [ - "futures 0.3.21", - "pin-project 0.4.30", - "static_assertions", -] - [[package]] name = "rw-stream-sink" version = "0.3.0" @@ -9308,7 +9030,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" dependencies = [ "futures 0.3.21", - "pin-project 1.0.11", + "pin-project", "static_assertions", ] @@ -9348,7 +9070,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "log", "sp-core", @@ -9359,7 +9081,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "futures 0.3.21", @@ -9368,8 +9090,8 @@ dependencies = [ "libp2p", "log", "parity-scale-codec 3.1.5", - "prost 0.10.4", - "prost-build 0.9.0", + "prost", + "prost-build", "rand 0.7.3", "sc-client-api", "sc-network", @@ -9386,7 +9108,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures 0.3.21", "futures-timer", @@ -9409,7 +9131,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "parity-scale-codec 3.1.5", "sc-client-api", @@ -9425,7 +9147,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.5", @@ -9442,7 +9164,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9453,7 +9175,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "chrono", "clap", @@ -9486,13 +9208,13 @@ dependencies = [ "sp-version", "thiserror", "tiny-bip39", - "tokio 1.20.1", + "tokio", ] [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "fnv", "futures 0.3.21", @@ -9520,7 +9242,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "hash-db", "kvdb", @@ -9545,7 +9267,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "futures 0.3.21", @@ -9569,7 +9291,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "futures 0.3.21", @@ -9598,7 +9320,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "fork-tree", @@ -9641,7 +9363,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures 0.3.21", "jsonrpsee", @@ -9663,7 +9385,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "fork-tree", "parity-scale-codec 3.1.5", @@ -9676,7 +9398,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "assert_matches", "async-trait", @@ -9710,7 +9432,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "futures 0.3.21", @@ -9735,7 +9457,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "sc-client-api", "sp-authorship", @@ -9746,7 +9468,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "lazy_static", "lru 0.7.8", @@ -9773,7 +9495,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "environmental", "parity-scale-codec 3.1.5", @@ -9790,7 +9512,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "log", "parity-scale-codec 3.1.5", @@ -9805,13 +9527,15 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "cfg-if 1.0.0", "libc", "log", + "once_cell", "parity-scale-codec 3.1.5", "parity-wasm 0.42.2", + "rustix 0.35.7", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -9823,7 +9547,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "ahash", "async-trait", @@ -9863,7 +9587,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "finality-grandpa", "futures 0.3.21", @@ -9884,7 +9608,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "ansi_term", "futures 0.3.21", @@ -9901,7 +9625,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "hex", @@ -9916,12 +9640,12 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "asynchronous-codec", "bitflags", - "bytes 1.2.0", + "bytes", "cid", "either", "fnv", @@ -9937,9 +9661,9 @@ dependencies = [ "lru 0.7.8", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", - "pin-project 1.0.11", - "prost 0.10.4", - "prost-build 0.9.0", + "pin-project", + "prost", + "prost-build", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -9968,12 +9692,12 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures 0.3.21", "libp2p", "parity-scale-codec 3.1.5", - "prost-build 0.9.0", + "prost-build", "sc-peerset", "smallvec", ] @@ -9981,7 +9705,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "ahash", "futures 0.3.21", @@ -9998,14 +9722,14 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures 0.3.21", "libp2p", "log", "parity-scale-codec 3.1.5", - "prost 0.10.4", - "prost-build 0.9.0", + "prost", + "prost-build", "sc-client-api", "sc-network-common", "sc-peerset", @@ -10018,7 +9742,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "bitflags", "either", @@ -10028,8 +9752,8 @@ dependencies = [ "log", "lru 0.7.8", "parity-scale-codec 3.1.5", - "prost 0.10.4", - "prost-build 0.9.0", + "prost", + "prost-build", "sc-client-api", "sc-consensus", "sc-network-common", @@ -10047,9 +9771,9 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ - "bytes 1.2.0", + "bytes", "fnv", "futures 0.3.21", "futures-timer", @@ -10075,7 +9799,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures 0.3.21", "libp2p", @@ -10088,7 +9812,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -10097,7 +9821,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures 0.3.21", "hash-db", @@ -10127,7 +9851,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures 0.3.21", "jsonrpsee", @@ -10150,20 +9874,20 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures 0.3.21", "jsonrpsee", "log", "serde_json", "substrate-prometheus-endpoint", - "tokio 1.20.1", + "tokio", ] [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "directories", @@ -10176,7 +9900,7 @@ dependencies = [ "parity-scale-codec 3.1.5", "parity-util-mem", "parking_lot 0.12.1", - "pin-project 1.0.11", + "pin-project", "rand 0.7.3", "sc-block-builder", "sc-chain-spec", @@ -10220,7 +9944,7 @@ dependencies = [ "substrate-prometheus-endpoint", "tempfile", "thiserror", - "tokio 1.20.1", + "tokio", "tracing", "tracing-futures", ] @@ -10228,7 +9952,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "log", "parity-scale-codec 3.1.5", @@ -10242,7 +9966,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "jsonrpsee", "parity-scale-codec 3.1.5", @@ -10261,7 +9985,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures 0.3.21", "libc", @@ -10280,14 +10004,14 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "chrono", "futures 0.3.21", "libp2p", "log", "parking_lot 0.12.1", - "pin-project 1.0.11", + "pin-project", "rand 0.7.3", "serde", "serde_json", @@ -10298,7 +10022,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "ansi_term", "atty", @@ -10329,7 +10053,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10340,7 +10064,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures 0.3.21", "futures-timer", @@ -10367,7 +10091,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures 0.3.21", "log", @@ -10380,7 +10104,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures 0.3.21", "futures-timer", @@ -10743,10 +10467,16 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slice-group-by" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" + [[package]] name = "slot-range-helper" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "enumn", "parity-scale-codec 3.1.5", @@ -10810,7 +10540,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ "base64", - "bytes 1.2.0", + "bytes", "flate2", "futures 0.3.21", "httparse", @@ -10822,7 +10552,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "hash-db", "log", @@ -10839,7 +10569,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "blake2", "proc-macro-crate", @@ -10851,7 +10581,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -10864,7 +10594,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "integer-sqrt", "num-traits", @@ -10879,7 +10609,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -10892,7 +10622,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "parity-scale-codec 3.1.5", @@ -10904,7 +10634,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "parity-scale-codec 3.1.5", "sp-api", @@ -10916,7 +10646,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures 0.3.21", "log", @@ -10934,7 +10664,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "futures 0.3.21", @@ -10953,7 +10683,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "parity-scale-codec 3.1.5", @@ -10971,7 +10701,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "merlin", @@ -10994,7 +10724,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -11008,7 +10738,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -11021,7 +10751,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "base58", "bitflags", @@ -11067,7 +10797,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "blake2", "byteorder", @@ -11081,7 +10811,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "proc-macro2", "quote", @@ -11092,7 +10822,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -11101,7 +10831,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "proc-macro2", "quote", @@ -11111,7 +10841,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "environmental", "parity-scale-codec 3.1.5", @@ -11122,7 +10852,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "finality-grandpa", "log", @@ -11140,7 +10870,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -11154,7 +10884,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures 0.3.21", "hash-db", @@ -11179,7 +10909,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "lazy_static", "sp-core", @@ -11190,7 +10920,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "futures 0.3.21", @@ -11207,7 +10937,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "thiserror", "zstd", @@ -11216,7 +10946,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "log", "parity-scale-codec 3.1.5", @@ -11231,7 +10961,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -11245,7 +10975,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "sp-api", "sp-core", @@ -11255,7 +10985,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "backtrace", "lazy_static", @@ -11265,7 +10995,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "rustc-hash", "serde", @@ -11275,7 +11005,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "either", "hash256-std-hasher", @@ -11297,7 +11027,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec 3.1.5", @@ -11314,7 +11044,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "Inflector", "proc-macro-crate", @@ -11326,7 +11056,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "log", "parity-scale-codec 3.1.5", @@ -11340,7 +11070,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "serde", "serde_json", @@ -11349,7 +11079,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -11363,7 +11093,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -11374,7 +11104,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "hash-db", "log", @@ -11396,12 +11126,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "impl-serde", "parity-scale-codec 3.1.5", @@ -11414,7 +11144,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "log", "sp-core", @@ -11427,7 +11157,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "futures-timer", @@ -11443,7 +11173,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "parity-scale-codec 3.1.5", "sp-std", @@ -11455,7 +11185,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "sp-api", "sp-runtime", @@ -11464,7 +11194,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "log", @@ -11480,7 +11210,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "hash-db", "memory-db", @@ -11496,7 +11226,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "impl-serde", "parity-scale-codec 3.1.5", @@ -11513,7 +11243,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "parity-scale-codec 3.1.5", "proc-macro2", @@ -11524,7 +11254,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "impl-trait-for-tuples", "log", @@ -11679,7 +11409,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "platforms", ] @@ -11687,7 +11417,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.21", @@ -11708,20 +11438,20 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures-util", "hyper", "log", "prometheus", "thiserror", - "tokio 1.20.1", + "tokio", ] [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "jsonrpsee", "log", @@ -11742,7 +11472,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "async-trait", "futures 0.3.21", @@ -11768,17 +11498,17 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "futures 0.3.21", "substrate-test-utils-derive", - "tokio 1.20.1", + "tokio", ] [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11789,11 +11519,12 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "ansi_term", "build-helper", "cargo_metadata", + "filetime", "sp-maybe-compressed-blob", "strum 0.23.0", "tempfile", @@ -11889,8 +11620,8 @@ dependencies = [ [[package]] name = "test-runtime-constants" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "frame-support", "polkadot-primitives", @@ -12014,6 +11745,24 @@ dependencies = [ "winapi", ] +[[package]] +name = "time" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" +dependencies = [ + "itoa 1.0.2", + "libc", + "num_threads", + "time-macros", +] + +[[package]] +name = "time-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" + [[package]] name = "tiny-bip39" version = "0.8.2" @@ -12057,18 +11806,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" -[[package]] -name = "tokio" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" -dependencies = [ - "bytes 0.5.6", - "fnv", - "pin-project-lite 0.1.12", - "tokio-macros 0.2.6", -] - [[package]] name = "tokio" version = "1.20.1" @@ -12076,7 +11813,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581" dependencies = [ "autocfg", - "bytes 1.2.0", + "bytes", "libc", "memchr", "mio", @@ -12086,21 +11823,10 @@ dependencies = [ "pin-project-lite 0.2.9", "signal-hook-registry", "socket2", - "tokio-macros 1.8.0", + "tokio-macros", "winapi", ] -[[package]] -name = "tokio-macros" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "tokio-macros" version = "1.8.0" @@ -12119,22 +11845,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ "rustls", - "tokio 1.20.1", + "tokio", "webpki", ] +[[package]] +name = "tokio-stream" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" +dependencies = [ + "futures-core", + "pin-project-lite 0.2.9", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" dependencies = [ - "bytes 1.2.0", + "bytes", "futures-core", "futures-io", "futures-sink", "pin-project-lite 0.2.9", - "tokio 1.20.1", + "tokio", "tracing", ] @@ -12192,14 +11929,14 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 1.0.11", + "pin-project", "tracing", ] [[package]] name = "tracing-gum" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -12209,8 +11946,8 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "expander 0.0.6", "proc-macro-crate", @@ -12349,7 +12086,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/uniquenetwork/substrate?branch=polkadot-v0.9.24-hack-substitute#1fa76b0665d32b1e28c36da67e54da1816db3fa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" dependencies = [ "clap", "jsonrpsee", @@ -12513,7 +12250,7 @@ dependencies = [ "pallet-transaction-payment-rpc", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec 3.1.5", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "polkadot-cli", "polkadot-parachain", "polkadot-primitives", @@ -12559,7 +12296,7 @@ dependencies = [ "substrate-build-script-utils", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", - "tokio 1.20.1", + "tokio", "try-runtime-cli", "unique-rpc", "unique-runtime", @@ -12610,7 +12347,7 @@ dependencies = [ "sp-storage", "sp-transaction-pool", "substrate-frame-rpc-system", - "tokio 0.2.25", + "tokio", "uc-rpc", "up-common", "up-data-structs", @@ -12719,7 +12456,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" dependencies = [ "asynchronous-codec", - "bytes 1.2.0", + "bytes", "futures-io", "futures-util", ] @@ -12778,7 +12515,7 @@ dependencies = [ [[package]] name = "up-sponsorship" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.24#05cb0f02abecad915d32455df7a7724b3e2869aa" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.26#711367a0ba6c495438f6e05e5c28690fc90bfdec" dependencies = [ "impl-trait-for-tuples", ] @@ -13002,15 +12739,18 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.83.0" +version = "0.85.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" +checksum = "570460c58b21e9150d2df0eaaedbb7816c34bcec009ae0dcc976e40ba81463e7" +dependencies = [ + "indexmap", +] [[package]] name = "wasmtime" -version = "0.35.3" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21ffb4705016d5ca91e18a72ed6822dab50e6d5ddd7045461b17ef19071cdef1" +checksum = "1f50eadf868ab6a04b7b511460233377d0bfbb92e417b2f6a98b98fef2e098f5" dependencies = [ "anyhow", "backtrace", @@ -13020,7 +12760,7 @@ dependencies = [ "lazy_static", "libc", "log", - "object 0.27.1", + "object 0.28.4", "once_cell", "paste", "psm", @@ -13039,9 +12779,9 @@ dependencies = [ [[package]] name = "wasmtime-cache" -version = "0.35.3" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c6ab24291fa7cb3a181f5669f6c72599b7ef781669759b45c7828c5999d0c0" +checksum = "d1df23c642e1376892f3b72f311596976979cbf8b85469680cdd3a8a063d12a2" dependencies = [ "anyhow", "base64", @@ -13049,7 +12789,7 @@ dependencies = [ "directories-next", "file-per-thread-logger", "log", - "rustix", + "rustix 0.33.7", "serde", "sha2 0.9.9", "toml", @@ -13059,9 +12799,9 @@ dependencies = [ [[package]] name = "wasmtime-cranelift" -version = "0.35.3" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04c810078a491b7bc4866ebe045f714d2b95e6b539e1f64009a4a7606be11de" +checksum = "f264ff6b4df247d15584f2f53d009fbc90032cfdc2605b52b961bffc71b6eccd" dependencies = [ "anyhow", "cranelift-codegen", @@ -13072,7 +12812,7 @@ dependencies = [ "gimli", "log", "more-asserts", - "object 0.27.1", + "object 0.28.4", "target-lexicon", "thiserror", "wasmparser", @@ -13081,9 +12821,9 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "0.35.3" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61448266ea164b1ac406363cdcfac81c7c44db4d94c7a81c8620ac6c5c6cdf59" +checksum = "839d2820e4b830f4b9e7aa08d4c0acabf4a5036105d639f6dfa1c6891c73bdc6" dependencies = [ "anyhow", "cranelift-entity", @@ -13091,7 +12831,7 @@ dependencies = [ "indexmap", "log", "more-asserts", - "object 0.27.1", + "object 0.28.4", "serde", "target-lexicon", "thiserror", @@ -13101,9 +12841,9 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "0.35.3" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "156b4623c6b0d4b8c24afb846c20525922f538ef464cc024abab7ea8de2109a2" +checksum = "ef0a0bcbfa18b946d890078ba0e1bc76bcc53eccfb40806c0020ec29dcd1bd49" dependencies = [ "addr2line", "anyhow", @@ -13112,10 +12852,10 @@ dependencies = [ "cpp_demangle", "gimli", "log", - "object 0.27.1", + "object 0.28.4", "region", "rustc-demangle", - "rustix", + "rustix 0.33.7", "serde", "target-lexicon", "thiserror", @@ -13127,20 +12867,20 @@ dependencies = [ [[package]] name = "wasmtime-jit-debug" -version = "0.35.3" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5dc31f811760a6c76b2672c404866fd19b75e5fb3b0075a3e377a6846490654" +checksum = "4f4779d976206c458edd643d1ac622b6c37e4a0800a8b1d25dfbf245ac2f2cac" dependencies = [ "lazy_static", - "object 0.27.1", - "rustix", + "object 0.28.4", + "rustix 0.33.7", ] [[package]] name = "wasmtime-runtime" -version = "0.35.3" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f907beaff69d4d920fa4688411ee4cc75c0f01859e424677f9e426e2ef749864" +checksum = "b7eb6ffa169eb5dcd18ac9473c817358cd57bc62c244622210566d473397954a" dependencies = [ "anyhow", "backtrace", @@ -13155,7 +12895,7 @@ dependencies = [ "more-asserts", "rand 0.8.5", "region", - "rustix", + "rustix 0.33.7", "thiserror", "wasmtime-environ", "wasmtime-jit-debug", @@ -13164,9 +12904,9 @@ dependencies = [ [[package]] name = "wasmtime-types" -version = "0.35.3" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514ef0e5fd197b9609dc9eb74beba0c84d5a12b2417cbae55534633329ba4852" +checksum = "8d932b0ac5336f7308d869703dd225610a6a3aeaa8e968c52b43eed96cefb1c2" dependencies = [ "cranelift-entity", "serde", @@ -13214,8 +12954,8 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -13245,7 +12985,6 @@ dependencies = [ "pallet-indices", "pallet-membership", "pallet-multisig", - "pallet-nicks", "pallet-nomination-pools", "pallet-nomination-pools-benchmarking", "pallet-offences", @@ -13303,8 +13042,8 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "frame-support", "polkadot-primitives", @@ -13484,21 +13223,22 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "derivative", "impl-trait-for-tuples", "log", "parity-scale-codec 3.1.5", "scale-info", + "sp-runtime", "xcm-procedural", ] [[package]] name = "xcm-builder" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "frame-support", "frame-system", @@ -13517,8 +13257,8 @@ dependencies = [ [[package]] name = "xcm-executor" -version = "0.9.24" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +version = "0.9.26" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "frame-benchmarking", "frame-support", @@ -13536,7 +13276,7 @@ dependencies = [ [[package]] name = "xcm-procedural" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.24#22836e55d41eef24ed5917fd654ee82a683a7cfe" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" dependencies = [ "Inflector", "proc-macro2", @@ -13558,12 +13298,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" - [[package]] name = "zeroize" version = "1.5.7" @@ -13587,18 +13321,18 @@ dependencies = [ [[package]] name = "zstd" -version = "0.10.2+zstd.1.5.2" +version = "0.11.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4a6bd64f22b5e3e94b4e238669ff9f10815c27a5180108b849d24174a83847" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "4.1.6+zstd.1.5.2" +version = "5.0.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b61c51bb270702d6167b8ce67340d2754b088d0c091b06e593aa772c3ee9bb" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" dependencies = [ "libc", "zstd-sys", @@ -13606,9 +13340,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "1.6.3+zstd.1.5.2" +version = "2.0.1+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc49afa5c8d634e75761feda8c592051e7eeb4683ba827211eb0d731d3402ea8" +checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" dependencies = [ "cc", "libc", From 2c498572636f2b34d53b1c51b7283a761a7dc90a Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 15 Aug 2022 15:03:04 +0000 Subject: [PATCH 0420/1274] build(dep): upgrade polkadot to v0.9.27 --- Cargo.lock | 1405 ++++++++++---------- README.md | 2 +- client/rpc/Cargo.toml | 12 +- crates/evm-coder/Cargo.toml | 2 +- node/cli/Cargo.toml | 130 +- node/cli/src/command.rs | 6 +- node/cli/src/service.rs | 6 +- node/rpc/Cargo.toml | 64 +- pallets/common/Cargo.toml | 16 +- pallets/configuration/Cargo.toml | 14 +- pallets/evm-coder-substrate/Cargo.toml | 14 +- pallets/evm-contract-helpers/Cargo.toml | 16 +- pallets/evm-migration/Cargo.toml | 18 +- pallets/evm-transaction-payment/Cargo.toml | 22 +- pallets/fungible/Cargo.toml | 14 +- pallets/inflation/Cargo.toml | 20 +- pallets/nonfungible/Cargo.toml | 14 +- pallets/proxy-rmrk-core/Cargo.toml | 14 +- pallets/proxy-rmrk-equip/Cargo.toml | 14 +- pallets/refungible/Cargo.toml | 14 +- pallets/scheduler/Cargo.toml | 20 +- pallets/structure/Cargo.toml | 10 +- pallets/unique/Cargo.toml | 16 +- primitives/common/Cargo.toml | 14 +- primitives/data-structs/Cargo.toml | 12 +- primitives/rmrk-rpc/Cargo.toml | 8 +- primitives/rpc/Cargo.toml | 10 +- runtime/opal/Cargo.toml | 106 +- runtime/quartz/Cargo.toml | 106 +- runtime/tests/Cargo.toml | 26 +- runtime/unique/Cargo.toml | 106 +- tests/README.md | 2 +- 32 files changed, 1127 insertions(+), 1126 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d70b2309f8..2f8ecab7c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -33,7 +33,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -88,6 +88,15 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf688625d06217d5b1bb0ea9d9c44a1635fd0ee3534466388d18203174f4d11" +[[package]] +name = "android_system_properties" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7ed72e1635e121ca3e79420540282af22da58be50de153d36f81ddc6b83aa9e" +dependencies = [ + "libc", +] + [[package]] name = "ansi_term" version = "0.12.1" @@ -99,9 +108,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.58" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704" +checksum = "508b352bb5c066aac251f6daf6b36eccd03e8a88e8081cd44959ea277a3af9a8" [[package]] name = "approx" @@ -163,9 +172,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" dependencies = [ "concurrent-queue", "event-listener", @@ -298,9 +307,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "async-trait" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" +checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" dependencies = [ "proc-macro2", "quote", @@ -420,11 +429,11 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "beefy-primitives", "fnv", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "hex", "log", @@ -454,11 +463,11 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "beefy-gadget", "beefy-primitives", - "futures 0.3.21", + "futures 0.3.23", "jsonrpsee", "log", "parity-scale-codec 3.1.5", @@ -474,7 +483,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "beefy-primitives", "sp-api", @@ -483,7 +492,7 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -632,7 +641,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ "block-padding 0.2.1", - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -641,7 +650,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -732,9 +741,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "bzip2-sys" @@ -755,9 +764,9 @@ checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" [[package]] name = "camino" -version = "1.0.9" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "869119e97797867fd90f5e22af7d0bd274bd4635ebb9eb68c04f3f513ae6c412" +checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e" dependencies = [ "serde", ] @@ -779,7 +788,7 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver 1.0.12", + "semver 1.0.13", "serde", "serde_json", ] @@ -847,22 +856,24 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" dependencies = [ - "libc", + "iana-time-zone", + "js-sys", "num-integer", "num-traits", "time 0.1.44", + "wasm-bindgen", "winapi", ] [[package]] name = "cid" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc949bff6704880faf064c42a4854032ab07bfcf3a4fcb82a57470acededb69c" +checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" dependencies = [ "core2", "multibase", @@ -877,7 +888,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -902,9 +913,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.15" +version = "3.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bbe24bbd31a185bc2c4f7c2abe80bea13a20d57ee4e55be70ac512bdc76417" +checksum = "29e724a68d9319343bb3328c9cc2dfde263f4b3142ee1059a9980580171c954b" dependencies = [ "atty", "bitflags", @@ -919,11 +930,11 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.2.15" +version = "3.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba52acd3b0a5c33aeada5cdaa3267cdc7c594a98731d4268cdc1532f4264cb4" +checksum = "13547f7012c01ab4a0e8f8967730ada8f9fdf419e8b6c792788f39cf4e46eefa" dependencies = [ - "heck 0.4.0", + "heck", "proc-macro-error", "proc-macro2", "quote", @@ -962,20 +973,20 @@ dependencies = [ [[package]] name = "comfy-table" -version = "5.0.1" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b103d85ca6e209388771bfb7aa6b68a7aeec4afbf6f0a0264bfbf50360e5212e" +checksum = "121d8a5b0346092c18a4b2fd6f620d7a06f0eb7ac0a45860939a0884bc579c56" dependencies = [ - "strum 0.23.0", - "strum_macros 0.23.1", + "strum", + "strum_macros", "unicode-width", ] [[package]] name = "concurrent-queue" -version = "1.2.2" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" dependencies = [ "cache-padded", ] @@ -1213,7 +1224,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "rand_core 0.6.3", "subtle", "zeroize", @@ -1225,7 +1236,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "typenum", ] @@ -1235,7 +1246,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "subtle", ] @@ -1245,15 +1256,15 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "subtle", ] [[package]] name = "ctor" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" +checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb" dependencies = [ "quote", "syn", @@ -1282,7 +1293,7 @@ dependencies = [ [[package]] name = "cumulus-client-cli" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "clap", "parity-scale-codec 3.1.5", @@ -1297,13 +1308,13 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.21", + "futures 0.3.23", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", "polkadot-node-primitives", @@ -1321,12 +1332,12 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "async-trait", "cumulus-client-consensus-common", "cumulus-primitives-core", - "futures 0.3.21", + "futures 0.3.23", "parity-scale-codec 3.1.5", "sc-client-api", "sc-consensus", @@ -1350,12 +1361,12 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "async-trait", "cumulus-relay-chain-interface", "dyn-clone", - "futures 0.3.21", + "futures 0.3.23", "parity-scale-codec 3.1.5", "polkadot-primitives", "sc-client-api", @@ -1371,12 +1382,12 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "async-trait", "cumulus-relay-chain-interface", "derive_more", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", @@ -1396,11 +1407,11 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "parity-scale-codec 3.1.5", "polkadot-node-primitives", @@ -1420,7 +1431,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -1448,7 +1459,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "frame-executive", "frame-support", @@ -1466,7 +1477,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-dmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1484,7 +1495,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-pallet-parachain-system-proc-macro", "cumulus-primitives-core", @@ -1514,7 +1525,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1525,7 +1536,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1542,7 +1553,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1560,7 +1571,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "frame-support", "parity-scale-codec 3.1.5", @@ -1576,7 +1587,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1599,10 +1610,10 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", - "futures 0.3.21", + "futures 0.3.23", "parity-scale-codec 3.1.5", "sp-inherents", "sp-std", @@ -1612,7 +1623,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1624,17 +1635,19 @@ dependencies = [ "sp-std", "sp-trie", "xcm", + "xcm-builder", + "xcm-executor", ] [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "parking_lot 0.12.1", "polkadot-cli", @@ -1659,12 +1672,12 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "async-trait", "cumulus-primitives-core", "derive_more", - "futures 0.3.21", + "futures 0.3.23", "jsonrpsee-core", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", @@ -1682,13 +1695,13 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "async-trait", "backoff", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "jsonrpsee", "parity-scale-codec 3.1.5", @@ -1701,6 +1714,7 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-storage", + "tokio", "tracing", "url", ] @@ -1708,7 +1722,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", "parity-scale-codec 3.1.5", @@ -1866,7 +1880,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -1939,9 +1953,9 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "dtoa" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5caaa75cbd2b960ff1e5392d2cfb1f44717fffe12fc1f32b7b5d1267f99732a6" +checksum = "c6053ff46b5639ceb91756a85a4c8914668393a03170efd79c8884a529d80656" [[package]] name = "dyn-clonable" @@ -1966,9 +1980,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d07a982d1fb29db01e5a59b1918e03da4df7297eaeee7686ac45542fd4e59c8" +checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2" [[package]] name = "ecdsa" @@ -2021,7 +2035,7 @@ dependencies = [ "crypto-bigint", "der", "ff", - "generic-array 0.14.5", + "generic-array 0.14.6", "group", "rand_core 0.6.3", "sec1", @@ -2035,7 +2049,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" dependencies = [ - "heck 0.4.0", + "heck", "proc-macro2", "quote", "syn", @@ -2063,9 +2077,9 @@ dependencies = [ [[package]] name = "enumn" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052bc8773a98bd051ff37db74a8a25f00e6bfa2cbd03373390c72e9f7afbf344" +checksum = "038b1afa59052df211f9efd58f8b1d84c242935ede1c3dbaed26b018a9e06ae2" dependencies = [ "proc-macro2", "quote", @@ -2142,7 +2156,7 @@ dependencies = [ "rlp-derive", "scale-info", "serde", - "sha3 0.10.1", + "sha3 0.10.2", "triehash", ] @@ -2164,14 +2178,14 @@ dependencies = [ [[package]] name = "event-listener" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "evm" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.26#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "auto_impl", "environmental", @@ -2185,7 +2199,7 @@ dependencies = [ "rlp", "scale-info", "serde", - "sha3 0.10.1", + "sha3 0.10.2", ] [[package]] @@ -2217,7 +2231,7 @@ dependencies = [ [[package]] name = "evm-core" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.26#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "parity-scale-codec 3.1.5", "primitive-types", @@ -2228,7 +2242,7 @@ dependencies = [ [[package]] name = "evm-gasometer" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.26#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "environmental", "evm-core", @@ -2239,13 +2253,13 @@ dependencies = [ [[package]] name = "evm-runtime" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.26#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "auto_impl", "environmental", "evm-core", "primitive-types", - "sha3 0.10.1", + "sha3 0.10.2", ] [[package]] @@ -2254,7 +2268,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", ] [[package]] @@ -2331,7 +2345,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" dependencies = [ "async-trait", "fc-db", @@ -2350,7 +2364,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -2366,12 +2380,12 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" dependencies = [ "fc-db", "fp-consensus", "fp-rpc", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "log", "sc-client-api", @@ -2383,7 +2397,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" dependencies = [ "ethereum", "ethereum-types", @@ -2392,7 +2406,7 @@ dependencies = [ "fc-rpc-core", "fp-rpc", "fp-storage", - "futures 0.3.21", + "futures 0.3.23", "hex", "jsonrpsee", "libsecp256k1", @@ -2423,7 +2437,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" dependencies = [ "ethereum", "ethereum-types", @@ -2482,7 +2496,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b22349c6a11563a202d95772a68e0fcf56119e74ea8a2a19cf2301460fcd0df5" dependencies = [ "either", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "log", "num-traits", @@ -2546,7 +2560,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", ] @@ -2564,7 +2578,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" dependencies = [ "ethereum", "parity-scale-codec 3.1.5", @@ -2576,7 +2590,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" dependencies = [ "evm", "frame-support", @@ -2590,7 +2604,7 @@ dependencies = [ [[package]] name = "fp-evm-mapping" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" dependencies = [ "frame-support", "sp-core", @@ -2599,7 +2613,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" dependencies = [ "ethereum", "ethereum-types", @@ -2616,7 +2630,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" dependencies = [ "ethereum", "frame-support", @@ -2632,7 +2646,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" dependencies = [ "parity-scale-codec 3.1.5", ] @@ -2640,7 +2654,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-support", "frame-system", @@ -2662,7 +2676,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "Inflector", "chrono", @@ -2713,7 +2727,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2724,7 +2738,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2740,7 +2754,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-support", "frame-system", @@ -2768,7 +2782,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "bitflags", "frame-metadata", @@ -2798,7 +2812,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2810,7 +2824,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2822,7 +2836,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "proc-macro2", "quote", @@ -2832,7 +2846,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-support", "log", @@ -2849,7 +2863,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -2864,7 +2878,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", "sp-api", @@ -2873,7 +2887,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-support", "sp-api", @@ -2935,9 +2949,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +checksum = "ab30e97ab6aacfe635fad58f22c2bb06c8b685f7421eb1e064a729e2a5f481fa" dependencies = [ "futures-channel", "futures-core", @@ -2950,9 +2964,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "2bfc52cbddcfd745bf1740338492bb0bd83d76c67b445f91c5fb29fae29ecaa1" dependencies = [ "futures-core", "futures-sink", @@ -2960,15 +2974,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "d2acedae88d38235936c3922476b10fced7b2b68136f5e3c03c2d5be348a1115" [[package]] name = "futures-executor" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +checksum = "1d11aa21b5b587a64682c0094c2bdd4df0076c5324961a40cc3abd7f37930528" dependencies = [ "futures-core", "futures-task", @@ -2978,9 +2992,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +checksum = "93a66fc6d035a26a3ae255a6d2bca35eda63ae4c5512bef54449113f7a1228e5" [[package]] name = "futures-lite" @@ -2999,9 +3013,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +checksum = "0db9cce532b0eae2ccf2766ab246f114b56b9cf6d445e00c2549fbc100ca045d" dependencies = [ "proc-macro2", "quote", @@ -3010,9 +3024,9 @@ dependencies = [ [[package]] name = "futures-rustls" -version = "0.22.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01fe9932a224b72b45336d96040aa86386d674a31d0af27d800ea7bc8ca97fe" +checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", "rustls", @@ -3021,15 +3035,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "ca0bae1fe9752cf7fd9b0064c674ae63f97b37bc714d745cbde0afb7ec4e6765" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "842fc63b931f4056a24d59de13fb1272134ce261816e063e634ad0c15cdc5306" [[package]] name = "futures-timer" @@ -3039,9 +3053,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "f0828a5471e340229c11c77ca80017937ce3c58cb788a17e5f1c2d5c485a9577" dependencies = [ "futures 0.1.31", "futures-channel", @@ -3076,9 +3090,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", "version_check", @@ -3247,15 +3261,6 @@ dependencies = [ "ahash", ] -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.4.0" @@ -3316,7 +3321,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.5", + "generic-array 0.14.6", "hmac 0.8.1", ] @@ -3339,7 +3344,7 @@ checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", - "itoa 1.0.2", + "itoa 1.0.3", ] [[package]] @@ -3386,7 +3391,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.2", + "itoa 1.0.3", "pin-project-lite 0.2.9", "socket2", "tokio", @@ -3410,6 +3415,19 @@ dependencies = [ "tokio-rustls", ] +[[package]] +name = "iana-time-zone" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef5528d9c2817db4e10cc78f8d4c8228906e5854f389ff6b076cee3572a09d35" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "js-sys", + "wasm-bindgen", + "winapi", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -3446,7 +3464,7 @@ dependencies = [ "async-io", "core-foundation", "fnv", - "futures 0.3.21", + "futures 0.3.23", "if-addrs", "ipnet", "log", @@ -3581,9 +3599,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" +checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" [[package]] name = "jobserver" @@ -3753,8 +3771,8 @@ checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" [[package]] name = "kusama-runtime" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -3790,6 +3808,7 @@ dependencies = [ "pallet-multisig", "pallet-nomination-pools", "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", "pallet-offences", "pallet-offences-benchmarking", "pallet-preimage", @@ -3845,8 +3864,8 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "frame-support", "polkadot-primitives", @@ -3917,9 +3936,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.126" +version = "0.2.131" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "04c3b4822ccebfa39c02fc03d1534441b22ead323fa0f48bb7ddd8e6ba076a40" [[package]] name = "libloading" @@ -3943,9 +3962,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33a33a362ce288760ec6a508b94caaec573ae7d3bbbd91b87aa0bad4456839db" +checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565" [[package]] name = "libp2p" @@ -3954,7 +3973,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81327106887e42d004fbdab1fef93675be2e2e07c1b95fce45e2cc813485611d" dependencies = [ "bytes", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "getrandom 0.2.7", "instant", @@ -3998,7 +4017,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4decc51f3573653a9f4ecacb31b1b922dd20c25a6322bb15318ec04287ec46f9" dependencies = [ "async-trait", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "instant", "libp2p-core", @@ -4021,7 +4040,7 @@ dependencies = [ "ed25519-dalek", "either", "fnv", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "instant", "lazy_static", @@ -4052,7 +4071,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0183dc2a3da1fbbf85e5b6cf51217f55b14f5daea0c455a9536eef646bfec71" dependencies = [ "flate2", - "futures 0.3.21", + "futures 0.3.23", "libp2p-core", ] @@ -4063,7 +4082,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6cbf54723250fa5d521383be789bf60efdabe6bacfb443f87da261019a49b4b5" dependencies = [ "async-std-resolver", - "futures 0.3.21", + "futures 0.3.23", "libp2p-core", "log", "parking_lot 0.12.1", @@ -4079,7 +4098,7 @@ checksum = "98a4b6ffd53e355775d24b76f583fdda54b3284806f678499b57913adb94f231" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.21", + "futures 0.3.23", "libp2p-core", "libp2p-swarm", "log", @@ -4100,7 +4119,7 @@ dependencies = [ "byteorder", "bytes", "fnv", - "futures 0.3.21", + "futures 0.3.23", "hex_fmt", "instant", "libp2p-core", @@ -4124,7 +4143,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c50b585518f8efd06f93ac2f976bd672e17cdac794644b3117edd078e96bda06" dependencies = [ "asynchronous-codec", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "libp2p-core", "libp2p-swarm", @@ -4149,7 +4168,7 @@ dependencies = [ "bytes", "either", "fnv", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "instant", "libp2p-core", @@ -4175,7 +4194,7 @@ dependencies = [ "async-io", "data-encoding", "dns-parser", - "futures 0.3.21", + "futures 0.3.23", "if-watch", "lazy_static", "libp2p-core", @@ -4211,7 +4230,7 @@ checksum = "61fd1b20638ec209c5075dfb2e8ce6a7ea4ec3cd3ad7b77f7a477c06d53322e2" dependencies = [ "asynchronous-codec", "bytes", - "futures 0.3.21", + "futures 0.3.23", "libp2p-core", "log", "nohash-hasher", @@ -4229,7 +4248,7 @@ checksum = "762408cb5d84b49a600422d7f9a42c18012d8da6ebcd570f9a4a4290ba41fb6f" dependencies = [ "bytes", "curve25519-dalek 3.2.0", - "futures 0.3.21", + "futures 0.3.23", "lazy_static", "libp2p-core", "log", @@ -4249,7 +4268,7 @@ version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "100a6934ae1dbf8a693a4e7dd1d730fd60b774dafc45688ed63b554497c6c925" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "instant", "libp2p-core", @@ -4267,7 +4286,7 @@ checksum = "be27bf0820a6238a4e06365b096d428271cce85a129cf16f2fe9eb1610c4df86" dependencies = [ "asynchronous-codec", "bytes", - "futures 0.3.21", + "futures 0.3.23", "libp2p-core", "log", "prost", @@ -4282,7 +4301,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f1a458bbda880107b5b36fcb9b5a1ef0c329685da0e203ed692a8ebe64cc92c" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "log", "pin-project", "rand 0.7.3", @@ -4299,7 +4318,7 @@ dependencies = [ "asynchronous-codec", "bytes", "either", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "instant", "libp2p-core", @@ -4324,7 +4343,7 @@ checksum = "9511c9672ba33284838e349623319c8cad2d18cfad243ae46c6b7e8a2982ea4e" dependencies = [ "asynchronous-codec", "bimap", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "instant", "libp2p-core", @@ -4347,7 +4366,7 @@ checksum = "508a189e2795d892c8f5c1fa1e9e0b1845d32d7b0b249dbf7b05b18811361843" dependencies = [ "async-trait", "bytes", - "futures 0.3.21", + "futures 0.3.23", "instant", "libp2p-core", "libp2p-swarm", @@ -4365,7 +4384,7 @@ checksum = "95ac5be6c2de2d1ff3f7693fda6faf8a827b1f3e808202277783fea9f527d114" dependencies = [ "either", "fnv", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "instant", "libp2p-core", @@ -4394,7 +4413,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a6771dc19aa3c65d6af9a8c65222bfc8fcd446630ddca487acd161fa6096f3b" dependencies = [ "async-io", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "if-watch", "ipnet", @@ -4411,7 +4430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d125e3e5f0d58f3c6ac21815b20cf4b6a88b8db9dc26368ea821838f4161fd4d" dependencies = [ "async-std", - "futures 0.3.21", + "futures 0.3.23", "libp2p-core", "log", ] @@ -4422,7 +4441,7 @@ version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec894790eec3c1608f8d1a8a0bdf0dbeb79ed4de2dce964222011c2896dfa05a" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -4437,7 +4456,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9808e57e81be76ff841c106b4c5974fb4d41a233a7bdd2afbf1687ac6def3818" dependencies = [ "either", - "futures 0.3.21", + "futures 0.3.23", "futures-rustls", "libp2p-core", "log", @@ -4455,7 +4474,7 @@ version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6dea686217a06072033dc025631932810e2f6ad784e4fafa42e27d311c7a81c" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "libp2p-core", "parking_lot 0.12.1", "thiserror", @@ -4649,12 +4668,6 @@ dependencies = [ "libc", ] -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - [[package]] name = "match_cfg" version = "0.1.0" @@ -4711,9 +4724,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a79b39c93a7a5a27eeaf9a23b5ff43f1b9e0ad6b1cdd441140ae53c35613fc7" +checksum = "95af15f345b17af2efc8ead6080fb8bc376f8cec1b35277b935637595fe77498" dependencies = [ "libc", ] @@ -4771,7 +4784,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "rand 0.8.5", "thrift", ] @@ -4840,9 +4853,9 @@ dependencies = [ [[package]] name = "multihash" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3db354f401db558759dfc1e568d010a5d4146f4d3f637be1275ec4a3cf09689" +checksum = "1c346cf9999c631f002d8f977c4eaeaa0e6386f16007202308d0b3757522c2cc" dependencies = [ "blake2b_simd", "blake2s_simd", @@ -4851,7 +4864,7 @@ dependencies = [ "digest 0.10.3", "multihash-derive", "sha2 0.10.2", - "sha3 0.10.1", + "sha3 0.10.2", "unsigned-varint", ] @@ -4882,7 +4895,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "363a84be6453a70e63513660f4894ef815daf88e3356bffcda9ca27d810ce83b" dependencies = [ "bytes", - "futures 0.3.21", + "futures 0.3.23", "log", "pin-project", "smallvec", @@ -4978,7 +4991,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ "bytes", - "futures 0.3.21", + "futures 0.3.23", "log", "netlink-packet-core", "netlink-sys", @@ -4994,7 +5007,7 @@ checksum = "92b654097027250401127914afb37cb1f311df6610a9891ff07a757e94199027" dependencies = [ "async-io", "bytes", - "futures 0.3.21", + "futures 0.3.23", "libc", "log", ] @@ -5257,11 +5270,11 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "orchestra" version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "async-trait", "dyn-clonable", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "orchestra-proc-macro", "pin-project", @@ -5273,7 +5286,7 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "expander 0.0.6", "itertools", @@ -5296,7 +5309,7 @@ dependencies = [ [[package]] name = "orml-vesting" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=8c625a5ab43c1c56cdeed5f8d814a891566d4cf8#8c625a5ab43c1c56cdeed5f8d814a891566d4cf8" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" dependencies = [ "frame-support", "frame-system", @@ -5310,9 +5323,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.2.0" +version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "648001efe5d5c0102d8cea768e348da85d90af8ba91f0bea908f157951493cd4" +checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" [[package]] name = "owning_ref" @@ -5326,7 +5339,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-support", "frame-system", @@ -5342,7 +5355,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-support", "frame-system", @@ -5358,7 +5371,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-support", "frame-system", @@ -5373,7 +5386,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -5397,7 +5410,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5417,7 +5430,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -5432,7 +5445,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" dependencies = [ "fp-evm", "frame-support", @@ -5447,7 +5460,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "beefy-primitives", "frame-support", @@ -5463,7 +5476,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -5486,7 +5499,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -5504,7 +5517,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -5523,7 +5536,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -5577,7 +5590,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -5593,7 +5606,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5610,13 +5623,13 @@ dependencies = [ "sp-runtime", "sp-std", "static_assertions", - "strum 0.23.0", + "strum", ] [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5629,7 +5642,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -5647,7 +5660,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" dependencies = [ "ethereum", "ethereum-types", @@ -5667,7 +5680,7 @@ dependencies = [ "rlp", "scale-info", "serde", - "sha3 0.10.1", + "sha3 0.10.2", "sp-io", "sp-runtime", "sp-std", @@ -5676,7 +5689,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.26#58869eede7bc4483d3461702ed92bb1d3d1bc04f" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" dependencies = [ "evm", "fp-evm", @@ -5693,7 +5706,7 @@ dependencies = [ "rlp", "scale-info", "serde", - "sha3 0.10.1", + "sha3 0.10.2", "sp-core", "sp-io", "sp-runtime", @@ -5799,7 +5812,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -5814,7 +5827,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -5837,7 +5850,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5853,7 +5866,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -5873,7 +5886,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -5909,7 +5922,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -5926,7 +5939,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5944,7 +5957,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "jsonrpsee", "parity-scale-codec 3.1.5", @@ -5959,7 +5972,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -5974,7 +5987,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-support", "frame-system", @@ -5991,7 +6004,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6007,6 +6020,16 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-nomination-pools-runtime-api" +version = "1.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "parity-scale-codec 3.1.5", + "sp-api", + "sp-std", +] + [[package]] name = "pallet-nonfungible" version = "0.1.3" @@ -6032,7 +6055,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-support", "frame-system", @@ -6049,7 +6072,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6072,7 +6095,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -6088,7 +6111,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -6103,7 +6126,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-support", "frame-system", @@ -6117,7 +6140,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -6196,7 +6219,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -6212,7 +6235,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-support", "frame-system", @@ -6233,7 +6256,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -6249,7 +6272,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-support", "frame-system", @@ -6263,7 +6286,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6286,7 +6309,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6297,7 +6320,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "log", "sp-arithmetic", @@ -6321,7 +6344,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-support", "frame-system", @@ -6335,7 +6358,7 @@ dependencies = [ [[package]] name = "pallet-template-transaction-payment" version = "3.0.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.26#711367a0ba6c495438f6e05e5c28690fc90bfdec" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04" dependencies = [ "frame-benchmarking", "frame-support", @@ -6355,7 +6378,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -6373,7 +6396,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -6392,7 +6415,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-support", "frame-system", @@ -6408,7 +6431,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6423,7 +6446,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "pallet-transaction-payment", "parity-scale-codec 3.1.5", @@ -6434,7 +6457,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -6494,7 +6517,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -6510,7 +6533,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-benchmarking", "frame-support", @@ -6524,8 +6547,8 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "frame-support", "frame-system", @@ -6542,8 +6565,8 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "frame-benchmarking", "frame-support", @@ -6560,7 +6583,7 @@ dependencies = [ [[package]] name = "parachain-info" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#e43b8b878a6fd0ca8b5e88d19822c4d777d3c677" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -6747,9 +6770,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" +checksum = "9423e2b32f7a043629287a536f21951e8c6a82482d0acb1eeebfc90bc2225b22" [[package]] name = "pbkdf2" @@ -6783,18 +6806,19 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pest" -version = "2.1.3" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +checksum = "69486e2b8c2d2aeb9762db7b4e00b0331156393555cff467f4163ff06821eef8" dependencies = [ + "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.1.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" +checksum = "b13570633aff33c6d22ce47dd566b10a3b9122c2fe9d8e7501895905be532b91" dependencies = [ "pest", "pest_generator", @@ -6802,9 +6826,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.1.3" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" +checksum = "b3c567e5702efdc79fb18859ea74c3eb36e14c43da7b8c1f098a4ed6514ec7a0" dependencies = [ "pest", "pest_meta", @@ -6815,13 +6839,13 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.1.3" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" +checksum = "5eb32be5ee3bbdafa8c7a18b0a8a8d962b66cfa2ceee4037f49267a50ee821fe" dependencies = [ - "maplit", + "once_cell", "pest", - "sha-1 0.8.2", + "sha-1 0.10.0", ] [[package]] @@ -6836,18 +6860,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", @@ -6886,10 +6910,10 @@ checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" [[package]] name = "polkadot-approval-distribution" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -6901,10 +6925,10 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -6915,12 +6939,12 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "derive_more", "fatality", - "futures 0.3.21", + "futures 0.3.23", "lru 0.7.8", "parity-scale-codec 3.1.5", "polkadot-erasure-coding", @@ -6938,11 +6962,11 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "fatality", - "futures 0.3.21", + "futures 0.3.23", "lru 0.7.8", "parity-scale-codec 3.1.5", "polkadot-erasure-coding", @@ -6959,12 +6983,12 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "clap", "frame-benchmarking-cli", - "futures 0.3.21", + "futures 0.3.23", "log", "polkadot-client", "polkadot-node-core-pvf", @@ -6976,6 +7000,7 @@ dependencies = [ "sc-sysinfo", "sc-tracing", "sp-core", + "sp-keyring", "sp-trie", "substrate-build-script-utils", "thiserror", @@ -6984,8 +7009,8 @@ dependencies = [ [[package]] name = "polkadot-client" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "beefy-primitives", "frame-benchmarking", @@ -7024,12 +7049,12 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "always-assert", "fatality", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -7045,8 +7070,8 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "parity-scale-codec 3.1.5", "parity-util-mem", @@ -7058,12 +7083,12 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "derive_more", "fatality", - "futures 0.3.21", + "futures 0.3.23", "lru 0.7.8", "parity-scale-codec 3.1.5", "polkadot-erasure-coding", @@ -7081,8 +7106,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "parity-scale-codec 3.1.5", "polkadot-node-primitives", @@ -7095,10 +7120,10 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-subsystem", @@ -7115,13 +7140,14 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "always-assert", "async-trait", "bytes", - "futures 0.3.21", + "fatality", + "futures 0.3.23", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", "polkadot-node-network-protocol", @@ -7131,15 +7157,16 @@ dependencies = [ "polkadot-primitives", "sc-network", "sp-consensus", + "thiserror", "tracing-gum", ] [[package]] name = "polkadot-node-collation-generation" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "parity-scale-codec 3.1.5", "polkadot-erasure-coding", "polkadot-node-primitives", @@ -7154,12 +7181,12 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "bitvec 1.0.1", "derive_more", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "kvdb", "lru 0.7.8", @@ -7183,11 +7210,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "bitvec 1.0.1", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "kvdb", "parity-scale-codec 3.1.5", @@ -7203,12 +7230,12 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "bitvec 1.0.1", "fatality", - "futures 0.3.21", + "futures 0.3.23", "polkadot-erasure-coding", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7222,10 +7249,10 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", @@ -7237,11 +7264,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "async-trait", - "futures 0.3.21", + "futures 0.3.23", "parity-scale-codec 3.1.5", "polkadot-node-core-pvf", "polkadot-node-primitives", @@ -7255,10 +7282,10 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", @@ -7270,10 +7297,10 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "kvdb", "parity-scale-codec 3.1.5", @@ -7287,11 +7314,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "fatality", - "futures 0.3.21", + "futures 0.3.23", "kvdb", "lru 0.7.8", "parity-scale-codec 3.1.5", @@ -7306,11 +7333,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "async-trait", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "polkadot-node-subsystem", "polkadot-primitives", @@ -7323,12 +7350,12 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "bitvec 1.0.1", "fatality", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7341,14 +7368,14 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "always-assert", "assert_matches", "async-process", "async-std", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "parity-scale-codec 3.1.5", "pin-project", @@ -7373,10 +7400,10 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7389,25 +7416,24 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "memory-lru", "parity-util-mem", "polkadot-node-subsystem", + "polkadot-node-subsystem-types", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-api", - "sp-authority-discovery", "sp-consensus-babe", "tracing-gum", ] [[package]] name = "polkadot-node-jaeger" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "async-std", "lazy_static", @@ -7424,11 +7450,11 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "bs58", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "log", "parity-scale-codec 3.1.5", @@ -7443,13 +7469,13 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "async-trait", "derive_more", "fatality", - "futures 0.3.21", + "futures 0.3.23", "parity-scale-codec 3.1.5", "polkadot-node-jaeger", "polkadot-node-primitives", @@ -7457,18 +7483,18 @@ dependencies = [ "rand 0.8.5", "sc-authority-discovery", "sc-network", - "strum 0.24.1", + "strum", "thiserror", "tracing-gum", ] [[package]] name = "polkadot-node-primitives" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "bounded-vec", - "futures 0.3.21", + "futures 0.3.23", "parity-scale-codec 3.1.5", "polkadot-parachain", "polkadot-primitives", @@ -7486,8 +7512,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -7496,11 +7522,12 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ + "async-trait", "derive_more", - "futures 0.3.21", + "futures 0.3.23", "orchestra", "polkadot-node-jaeger", "polkadot-node-network-protocol", @@ -7509,19 +7536,22 @@ dependencies = [ "polkadot-statement-table", "sc-network", "smallvec", + "sp-api", + "sp-authority-discovery", + "sp-consensus-babe", "substrate-prometheus-endpoint", "thiserror", ] [[package]] name = "polkadot-node-subsystem-util" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "async-trait", "derive_more", "fatality", - "futures 0.3.21", + "futures 0.3.23", "itertools", "kvdb", "lru 0.7.8", @@ -7548,10 +7578,11 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "futures 0.3.21", + "async-trait", + "futures 0.3.23", "futures-timer", "lru 0.7.8", "orchestra", @@ -7570,8 +7601,8 @@ dependencies = [ [[package]] name = "polkadot-parachain" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "derive_more", "frame-support", @@ -7587,8 +7618,8 @@ dependencies = [ [[package]] name = "polkadot-performance-test" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "env_logger", "kusama-runtime", @@ -7602,8 +7633,8 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "bitvec 1.0.1", "frame-system", @@ -7632,8 +7663,8 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "beefy-gadget", "beefy-gadget-rpc", @@ -7664,8 +7695,8 @@ dependencies = [ [[package]] name = "polkadot-runtime" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -7749,8 +7780,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -7796,8 +7827,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "frame-support", "polkadot-primitives", @@ -7808,8 +7839,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "bs58", "parity-scale-codec 3.1.5", @@ -7820,8 +7851,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "bitflags", "bitvec 1.0.1", @@ -7863,14 +7894,14 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "async-trait", "beefy-gadget", "beefy-primitives", "frame-system-rpc-runtime-api", - "futures 0.3.21", + "futures 0.3.23", "hex-literal", "kusama-runtime", "kvdb", @@ -7966,12 +7997,12 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "arrayvec 0.5.2", "fatality", - "futures 0.3.21", + "futures 0.3.23", "indexmap", "parity-scale-codec 3.1.5", "polkadot-node-network-protocol", @@ -7987,8 +8018,8 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "parity-scale-codec 3.1.5", "polkadot-primitives", @@ -7997,8 +8028,8 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -8058,12 +8089,12 @@ dependencies = [ [[package]] name = "polkadot-test-service" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "frame-benchmarking", "frame-system", - "futures 0.3.21", + "futures 0.3.23", "hex", "pallet-balances", "pallet-staking", @@ -8168,12 +8199,12 @@ dependencies = [ [[package]] name = "prioritized-metered-channel" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "coarsetime", "crossbeam-queue", "derive_more", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "nanorand", "thiserror", @@ -8182,10 +8213,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.3" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" dependencies = [ + "once_cell", "thiserror", "toml", ] @@ -8216,9 +8248,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.42" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c278e965f1d8cf32d6e0e96de3d3e79712178ae67986d9cf9151f51e95aac89b" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" dependencies = [ "unicode-ident", ] @@ -8244,7 +8276,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1abe0255c04d15f571427a2d1e00099016506cf3297b53853acd2b7eb87825" dependencies = [ "dtoa", - "itoa 1.0.2", + "itoa 1.0.3", "owning_ref", "prometheus-client-derive-text-encode", ] @@ -8279,7 +8311,7 @@ dependencies = [ "bytes", "cfg-if 1.0.0", "cmake", - "heck 0.4.0", + "heck", "itertools", "lazy_static", "log", @@ -8441,9 +8473,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] @@ -8592,9 +8624,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534cfe58d6a18cc17120fbf4635d53d14691c1fe4d951064df9bd326178d7d5a" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags", ] @@ -8625,18 +8657,18 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "776c8940430cf563f66a93f9111d1cd39306dc6c68149ecc6b934742a44a828a" +checksum = "ed13bcd201494ab44900a96490291651d200730904221832b9547d24a87d332b" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f26c4704460286103bff62ea1fb78d137febc86aaf76952e6c5a2249af01f54" +checksum = "5234cd6063258a5e32903b53b1b6ac043a0541c8adc1f610f67b0326c7a578fa" dependencies = [ "proc-macro2", "quote", @@ -8696,7 +8728,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "env_logger", "jsonrpsee", @@ -8816,8 +8848,8 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -8885,8 +8917,8 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "frame-support", "polkadot-primitives", @@ -8912,7 +8944,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" dependencies = [ "async-global-executor", - "futures 0.3.21", + "futures 0.3.23", "log", "netlink-packet-route", "netlink-proto", @@ -8953,7 +8985,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.12", + "semver 1.0.13", ] [[package]] @@ -9010,18 +9042,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" +checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" dependencies = [ "base64", ] [[package]] name = "rustversion" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" [[package]] name = "rw-stream-sink" @@ -9029,16 +9061,16 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "pin-project", "static_assertions", ] [[package]] name = "ryu" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "safe-mix" @@ -9070,7 +9102,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "log", "sp-core", @@ -9081,10 +9113,10 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "ip_network", "libp2p", @@ -9108,9 +9140,9 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "log", "parity-scale-codec 3.1.5", @@ -9131,7 +9163,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", "sc-client-api", @@ -9147,10 +9179,10 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "impl-trait-for-tuples", - "memmap2 0.5.5", + "memmap2 0.5.7", "parity-scale-codec 3.1.5", "sc-chain-spec-derive", "sc-network", @@ -9164,7 +9196,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9175,12 +9207,12 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "chrono", "clap", "fdlimit", - "futures 0.3.21", + "futures 0.3.23", "hex", "libp2p", "log", @@ -9214,10 +9246,10 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "fnv", - "futures 0.3.21", + "futures 0.3.23", "hash-db", "log", "parity-scale-codec 3.1.5", @@ -9242,7 +9274,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "hash-db", "kvdb", @@ -9267,10 +9299,10 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "libp2p", "log", @@ -9291,10 +9323,10 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", - "futures 0.3.21", + "futures 0.3.23", "log", "parity-scale-codec 3.1.5", "sc-block-builder", @@ -9320,11 +9352,11 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", "fork-tree", - "futures 0.3.21", + "futures 0.3.23", "log", "merlin", "num-bigint", @@ -9363,9 +9395,9 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "jsonrpsee", "sc-consensus-babe", "sc-consensus-epochs", @@ -9385,7 +9417,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "fork-tree", "parity-scale-codec 3.1.5", @@ -9398,11 +9430,11 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "assert_matches", "async-trait", - "futures 0.3.21", + "futures 0.3.23", "jsonrpsee", "log", "parity-scale-codec 3.1.5", @@ -9432,10 +9464,10 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "log", "parity-scale-codec 3.1.5", @@ -9457,7 +9489,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "sc-client-api", "sp-authorship", @@ -9468,7 +9500,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "lazy_static", "lru 0.7.8", @@ -9495,7 +9527,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "environmental", "parity-scale-codec 3.1.5", @@ -9512,7 +9544,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "log", "parity-scale-codec 3.1.5", @@ -9527,7 +9559,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "cfg-if 1.0.0", "libc", @@ -9547,14 +9579,14 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "ahash", "async-trait", "dyn-clone", "finality-grandpa", "fork-tree", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "hex", "log", @@ -9567,6 +9599,7 @@ dependencies = [ "sc-consensus", "sc-keystore", "sc-network", + "sc-network-common", "sc-network-gossip", "sc-telemetry", "sc-utils", @@ -9587,10 +9620,10 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "finality-grandpa", - "futures 0.3.21", + "futures 0.3.23", "jsonrpsee", "log", "parity-scale-codec 3.1.5", @@ -9608,10 +9641,10 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "ansi_term", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "log", "parity-util-mem", @@ -9625,7 +9658,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", "hex", @@ -9640,7 +9673,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", "asynchronous-codec", @@ -9650,7 +9683,7 @@ dependencies = [ "either", "fnv", "fork-tree", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "hex", "ip_network", @@ -9669,8 +9702,6 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-network-common", - "sc-network-light", - "sc-network-sync", "sc-peerset", "sc-utils", "serde", @@ -9680,7 +9711,6 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-core", - "sp-finality-grandpa", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", @@ -9692,23 +9722,28 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "futures 0.3.21", + "bitflags", + "futures 0.3.23", "libp2p", "parity-scale-codec 3.1.5", "prost-build", + "sc-consensus", "sc-peerset", "smallvec", + "sp-consensus", + "sp-finality-grandpa", + "sp-runtime", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "ahash", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "libp2p", "log", @@ -9722,9 +9757,9 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "libp2p", "log", "parity-scale-codec 3.1.5", @@ -9742,12 +9777,10 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "bitflags", - "either", "fork-tree", - "futures 0.3.21", + "futures 0.3.23", "libp2p", "log", "lru 0.7.8", @@ -9771,11 +9804,11 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "bytes", "fnv", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "hex", "hyper", @@ -9799,9 +9832,9 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "libp2p", "log", "sc-utils", @@ -9812,7 +9845,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9821,9 +9854,9 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "hash-db", "jsonrpsee", "log", @@ -9851,9 +9884,9 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "jsonrpsee", "log", "parity-scale-codec 3.1.5", @@ -9874,9 +9907,9 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "jsonrpsee", "log", "serde_json", @@ -9887,12 +9920,12 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", "directories", "exit-future", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "hash-db", "jsonrpsee", @@ -9912,6 +9945,8 @@ dependencies = [ "sc-keystore", "sc-network", "sc-network-common", + "sc-network-light", + "sc-network-sync", "sc-offchain", "sc-rpc", "sc-rpc-server", @@ -9952,7 +9987,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "log", "parity-scale-codec 3.1.5", @@ -9966,7 +10001,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "jsonrpsee", "parity-scale-codec 3.1.5", @@ -9985,9 +10020,9 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "libc", "log", "rand 0.7.3", @@ -10004,10 +10039,10 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "chrono", - "futures 0.3.21", + "futures 0.3.23", "libp2p", "log", "parking_lot 0.12.1", @@ -10022,7 +10057,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "ansi_term", "atty", @@ -10053,7 +10088,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10064,9 +10099,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "linked-hash-map", "log", @@ -10091,9 +10126,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "log", "serde", "sp-blockchain", @@ -10104,9 +10139,9 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "lazy_static", "log", @@ -10191,25 +10226,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" dependencies = [ "der", - "generic-array 0.14.5", + "generic-array 0.14.6", "subtle", "zeroize", ] [[package]] name = "secp256k1" -version = "0.21.3" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c42e6f1735c5f00f51e43e28d6634141f2bcad10931b2609ddd74a86d751260" +checksum = "b7649a0b3ffb32636e60c7ce0d70511eda9c52c658cd0634e194d5a19943aeff" dependencies = [ "secp256k1-sys", ] [[package]] name = "secp256k1-sys" -version = "0.4.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957da2573cde917463ece3570eab4a0b3f19de6f1646cde62e6fd3868f566036" +checksum = "7058dc8eaf3f2810d7828680320acda0b25a288f6d288e19278e249bbf74226b" dependencies = [ "cc", ] @@ -10266,9 +10301,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" +checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" dependencies = [ "serde", ] @@ -10281,18 +10316,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.140" +version = "1.0.143" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" +checksum = "53e8e5d5b70924f74ff5c6d64d9a5acd91422117c60f48c4e07855238a254553" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.140" +version = "1.0.143" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" +checksum = "d3d8e8de557aee63c26b85b947f5e59b690d0454c753f3adeb5cd7835ab88391" dependencies = [ "proc-macro2", "quote", @@ -10301,11 +10336,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" +checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7" dependencies = [ - "itoa 1.0.2", + "itoa 1.0.3", "ryu", "serde", ] @@ -10321,27 +10356,26 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.8.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", ] [[package]] name = "sha-1" -version = "0.9.8" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" dependencies = [ - "block-buffer 0.9.0", "cfg-if 1.0.0", "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", + "digest 0.10.3", ] [[package]] @@ -10394,9 +10428,9 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881bf8156c87b6301fc5ca6b27f11eeb2761224c7081e69b409d5a1951a70c86" +checksum = "0a31480366ec990f395a61b7c08122d99bd40544fdb5abcfc1b06bb29994312c" dependencies = [ "digest 0.10.3", "keccak", @@ -10475,8 +10509,8 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "enumn", "parity-scale-codec 3.1.5", @@ -10542,7 +10576,7 @@ dependencies = [ "base64", "bytes", "flate2", - "futures 0.3.21", + "futures 0.3.23", "httparse", "log", "rand 0.8.5", @@ -10552,7 +10586,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "hash-db", "log", @@ -10569,7 +10603,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "blake2", "proc-macro-crate", @@ -10581,7 +10615,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -10594,7 +10628,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "integer-sqrt", "num-traits", @@ -10609,7 +10643,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -10622,7 +10656,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", "parity-scale-codec 3.1.5", @@ -10634,7 +10668,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", "sp-api", @@ -10646,9 +10680,9 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "log", "lru 0.7.8", "parity-scale-codec 3.1.5", @@ -10664,10 +10698,10 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", - "futures 0.3.21", + "futures 0.3.23", "futures-timer", "log", "parity-scale-codec 3.1.5", @@ -10683,7 +10717,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", "parity-scale-codec 3.1.5", @@ -10701,7 +10735,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", "merlin", @@ -10724,7 +10758,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -10738,7 +10772,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -10751,7 +10785,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "base58", "bitflags", @@ -10759,7 +10793,7 @@ dependencies = [ "byteorder", "dyn-clonable", "ed25519-dalek", - "futures 0.3.21", + "futures 0.3.23", "hash-db", "hash256-std-hasher", "hex", @@ -10797,13 +10831,13 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "blake2", "byteorder", "digest 0.10.3", "sha2 0.10.2", - "sha3 0.10.1", + "sha3 0.10.2", "sp-std", "twox-hash", ] @@ -10811,7 +10845,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "proc-macro2", "quote", @@ -10822,7 +10856,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -10831,7 +10865,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "proc-macro2", "quote", @@ -10841,7 +10875,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "environmental", "parity-scale-codec 3.1.5", @@ -10852,7 +10886,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "finality-grandpa", "log", @@ -10870,7 +10904,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10884,9 +10918,9 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "hash-db", "libsecp256k1", "log", @@ -10909,21 +10943,21 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "lazy_static", "sp-core", "sp-runtime", - "strum 0.23.0", + "strum", ] [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", - "futures 0.3.21", + "futures 0.3.23", "merlin", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", @@ -10937,7 +10971,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "thiserror", "zstd", @@ -10946,7 +10980,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "log", "parity-scale-codec 3.1.5", @@ -10961,7 +10995,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -10975,7 +11009,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "sp-api", "sp-core", @@ -10985,7 +11019,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "backtrace", "lazy_static", @@ -10995,7 +11029,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "rustc-hash", "serde", @@ -11005,7 +11039,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "either", "hash256-std-hasher", @@ -11027,7 +11061,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec 3.1.5", @@ -11044,7 +11078,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "Inflector", "proc-macro-crate", @@ -11056,7 +11090,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "log", "parity-scale-codec 3.1.5", @@ -11070,7 +11104,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "serde", "serde_json", @@ -11079,7 +11113,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -11093,7 +11127,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -11104,7 +11138,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "hash-db", "log", @@ -11126,12 +11160,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "impl-serde", "parity-scale-codec 3.1.5", @@ -11144,7 +11178,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "log", "sp-core", @@ -11157,7 +11191,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", "futures-timer", @@ -11173,7 +11207,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", "sp-std", @@ -11185,7 +11219,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "sp-api", "sp-runtime", @@ -11194,7 +11228,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", "log", @@ -11210,7 +11244,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "hash-db", "memory-db", @@ -11226,7 +11260,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "impl-serde", "parity-scale-codec 3.1.5", @@ -11243,7 +11277,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", "proc-macro2", @@ -11254,7 +11288,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "impl-trait-for-tuples", "log", @@ -11349,44 +11383,22 @@ dependencies = [ "syn", ] -[[package]] -name = "strum" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb" -dependencies = [ - "strum_macros 0.23.1", -] - [[package]] name = "strum" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" dependencies = [ - "strum_macros 0.24.2", -] - -[[package]] -name = "strum_macros" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38" -dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "rustversion", - "syn", + "strum_macros", ] [[package]] name = "strum_macros" -version = "0.24.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4faebde00e8ff94316c01800f9054fd2ba77d30d9e922541913051d1d978918b" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck 0.4.0", + "heck", "proc-macro2", "quote", "rustversion", @@ -11409,7 +11421,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "platforms", ] @@ -11417,10 +11429,10 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.21", + "futures 0.3.23", "jsonrpsee", "log", "parity-scale-codec 3.1.5", @@ -11438,7 +11450,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "futures-util", "hyper", @@ -11451,7 +11463,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "jsonrpsee", "log", @@ -11472,10 +11484,10 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "async-trait", - "futures 0.3.21", + "futures 0.3.23", "hex", "parity-scale-codec 3.1.5", "sc-client-api", @@ -11498,9 +11510,9 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "substrate-test-utils-derive", "tokio", ] @@ -11508,7 +11520,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11519,14 +11531,14 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "ansi_term", "build-helper", "cargo_metadata", "filetime", "sp-maybe-compressed-blob", - "strum 0.23.0", + "strum", "tempfile", "toml", "walkdir", @@ -11541,9 +11553,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.98" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" dependencies = [ "proc-macro2", "quote", @@ -11620,8 +11632,8 @@ dependencies = [ [[package]] name = "test-runtime-constants" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "frame-support", "polkadot-primitives", @@ -11668,18 +11680,18 @@ checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" dependencies = [ "proc-macro2", "quote", @@ -11751,7 +11763,7 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" dependencies = [ - "itoa 1.0.2", + "itoa 1.0.3", "libc", "num_threads", "time-macros", @@ -11892,9 +11904,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.35" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" dependencies = [ "cfg-if 1.0.0", "pin-project-lite 0.2.9", @@ -11915,9 +11927,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" +checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" dependencies = [ "once_cell", "valuable", @@ -11935,8 +11947,8 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -11946,8 +11958,8 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "expander 0.0.6", "proc-macro-crate", @@ -11962,10 +11974,8 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" dependencies = [ - "ahash", "lazy_static", "log", - "lru 0.7.8", "tracing-core", ] @@ -12086,7 +12096,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#e8a7d161f39db70cb27fdad6c6e215cf493ebc3b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "clap", "jsonrpsee", @@ -12186,9 +12196,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" [[package]] name = "unicode-normalization" @@ -12199,12 +12209,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" - [[package]] name = "unicode-width" version = "0.1.9" @@ -12242,7 +12246,7 @@ dependencies = [ "fp-rpc", "frame-benchmarking", "frame-benchmarking-cli", - "futures 0.3.21", + "futures 0.3.23", "jsonrpsee", "log", "opal-runtime", @@ -12315,7 +12319,7 @@ dependencies = [ "fc-rpc-core", "fp-rpc", "fp-storage", - "futures 0.3.21", + "futures 0.3.23", "jsonrpsee", "pallet-common", "pallet-ethereum", @@ -12445,7 +12449,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "subtle", ] @@ -12515,7 +12519,7 @@ dependencies = [ [[package]] name = "up-sponsorship" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.26#711367a0ba6c495438f6e05e5c28690fc90bfdec" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04" dependencies = [ "impl-trait-for-tuples", ] @@ -12703,7 +12707,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "js-sys", "parking_lot 0.11.2", "pin-utils", @@ -12954,8 +12958,8 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -12987,6 +12991,7 @@ dependencies = [ "pallet-multisig", "pallet-nomination-pools", "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", "pallet-offences", "pallet-offences-benchmarking", "pallet-preimage", @@ -13042,8 +13047,8 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "frame-support", "polkadot-primitives", @@ -13223,8 +13228,8 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "derivative", "impl-trait-for-tuples", @@ -13237,8 +13242,8 @@ dependencies = [ [[package]] name = "xcm-builder" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "frame-support", "frame-system", @@ -13257,8 +13262,8 @@ dependencies = [ [[package]] name = "xcm-executor" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "frame-benchmarking", "frame-support", @@ -13275,8 +13280,8 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "Inflector", "proc-macro2", @@ -13286,11 +13291,11 @@ dependencies = [ [[package]] name = "yamux" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0608f53c1dc0bad505d03a34bbd49fbf2ad7b51eb036123e896365532745a1" +checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" dependencies = [ - "futures 0.3.21", + "futures 0.3.23", "log", "nohash-hasher", "parking_lot 0.12.1", diff --git a/README.md b/README.md index f176c0a6a2..ce0f5216fb 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ git checkout feature/runtime-upgrade-testing ``` git clone https://github.com/paritytech/polkadot.git cd polkadot -git checkout release-v0.9.26 +git checkout release-v0.9.27 cargo build --release ``` diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index ee41bbdc59..e69679e775 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -13,9 +13,9 @@ codec = { package = "parity-scale-codec", version = "3.1.2" } jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } anyhow = "1.0.57" -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } diff --git a/crates/evm-coder/Cargo.toml b/crates/evm-coder/Cargo.toml index 8ad7087453..4f18ccd8aa 100644 --- a/crates/evm-coder/Cargo.toml +++ b/crates/evm-coder/Cargo.toml @@ -9,7 +9,7 @@ evm-coder-macros = { path = "../evm-coder-macros" } primitive-types = { version = "0.11.1", default-features = false } hex-literal = "0.3.3" ethereum = { version = "0.12.0", default-features = false } -evm-core = { default-features = false, git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.26" } +evm-core = { default-features = false, git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.27" } impl-trait-for-tuples = "0.2.1" [dev-dependencies] diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 3f35ee0566..3919e90c58 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -3,7 +3,7 @@ [build-dependencies.substrate-build-script-utils] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" ################################################################################ # Substrate Dependecies @@ -16,158 +16,158 @@ version = '3.1.2' [dependencies.frame-benchmarking] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-benchmarking-cli] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.try-runtime-cli] -git = 'https://github.com/paritytech/substrate' -branch = 'polkadot-v0.9.26' +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.27" [dependencies.pallet-transaction-payment-rpc] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.substrate-prometheus-endpoint] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-basic-authorship] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-chain-spec] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-cli] features = ['wasmtime'] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-client-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-consensus] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-consensus-aura] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-executor] features = ['wasmtime'] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-finality-grandpa] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-keystore] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-rpc] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-rpc-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-service] features = ['wasmtime'] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-telemetry] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-transaction-pool] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-tracing] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-sysinfo] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-block-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-blockchain] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-consensus] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-consensus-aura] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-core] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-finality-grandpa] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-inherents] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-keystore] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-offchain] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-runtime] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-session] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-timestamp] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-transaction-pool] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-trie] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.substrate-frame-rpc-system] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sc-network] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.serde] features = ['derive'] @@ -178,76 +178,76 @@ version = '1.0.68' [dependencies.sc-consensus-manual-seal] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" ################################################################################ # Cumulus dependencies [dependencies.cumulus-client-consensus-aura] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.cumulus-client-consensus-common] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.cumulus-client-collator] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.cumulus-client-cli] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.cumulus-client-network] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.cumulus-primitives-parachain-inherent] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.cumulus-client-service] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.cumulus-relay-chain-interface] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.cumulus-relay-chain-inprocess-interface] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.cumulus-relay-chain-rpc-interface] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" ################################################################################ # Polkadot dependencies [dependencies.polkadot-primitives] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" [dependencies.polkadot-service] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" [dependencies.polkadot-cli] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" [dependencies.polkadot-test-service] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" ################################################################################ @@ -276,7 +276,7 @@ path = "../../primitives/rpc" [dependencies.pallet-transaction-payment-rpc-runtime-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" ################################################################################ # Package @@ -308,13 +308,13 @@ clap = "3.1.2" jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } tokio = { version = "1.19.2", features = ["time"] } -fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } unique-rpc = { default-features = false, path = "../rpc" } rmrk-rpc = { path = "../../primitives/rmrk-rpc" } diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index 614277535c..e8cff1ffaf 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -407,7 +407,7 @@ pub fn run() -> Result<()> { BenchmarkCmd::Machine(cmd) => { runner.sync_run(|config| cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone())) } - BenchmarkCmd::Overhead(_) => Err("Unsupported benchmarking command".into()), + BenchmarkCmd::Overhead(_) | BenchmarkCmd::Extrinsic(_) => Err("Unsupported benchmarking command".into()), } } Some(Subcommand::TryRuntime(cmd)) => { @@ -622,8 +622,8 @@ impl CliConfiguration for RelayChainCli { self.base.base.role(is_dev) } - fn transaction_pool(&self) -> Result { - self.base.base.transaction_pool() + fn transaction_pool(&self, is_dev: bool) -> Result { + self.base.base.transaction_pool(is_dev) } fn state_cache_child_ratio(&self) -> Result> { diff --git a/node/cli/src/service.rs b/node/cli/src/service.rs index 3569acff1f..2dc7e467f0 100644 --- a/node/cli/src/service.rs +++ b/node/cli/src/service.rs @@ -50,7 +50,7 @@ use sc_client_api::ExecutorProvider; use sc_executor::NativeElseWasmExecutor; use sc_executor::NativeExecutionDispatch; use sc_network::NetworkService; -use sc_service::{BasePath, Configuration, PartialComponents, Role, TaskManager}; +use sc_service::{BasePath, Configuration, PartialComponents, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; use sp_keystore::SyncCryptoStorePtr; use sp_runtime::traits::BlakeTwo256; @@ -398,10 +398,6 @@ where bool, ) -> Result>, sc_service::Error>, { - if matches!(parachain_config.role, Role::Light) { - return Err("Light client not supported!".into()); - } - let parachain_config = prepare_node_config(parachain_config); let params = diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index 72df43ab69..6a684ba9a1 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -13,40 +13,40 @@ targets = ["x86_64-unknown-linux-gnu"] futures = { version = "0.3.17", features = ["compat"] } jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } # pallet-contracts-rpc = { git = 'https://github.com/paritytech/substrate', branch = 'master' } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } tokio = { version = "1.19.2", features = ["macros", "sync"] } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } pallet-common = { default-features = false, path = "../../pallets/common" } up-common = { path = "../../primitives/common" } diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index b63924c599..7980f772d9 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -11,18 +11,18 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } ethereum = { version = "0.12.0", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } serde = { version = "1.0.130", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/configuration/Cargo.toml b/pallets/configuration/Cargo.toml index f5bd63357b..844e109a38 100644 --- a/pallets/configuration/Cargo.toml +++ b/pallets/configuration/Cargo.toml @@ -10,13 +10,13 @@ parity-scale-codec = { version = "3.1.5", features = [ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.24" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } smallvec = "1.6.1" [features] diff --git a/pallets/evm-coder-substrate/Cargo.toml b/pallets/evm-coder-substrate/Cargo.toml index 2389cc6d72..bbc54a0194 100644 --- a/pallets/evm-coder-substrate/Cargo.toml +++ b/pallets/evm-coder-substrate/Cargo.toml @@ -8,15 +8,15 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } ethereum = { version = "0.12.0", default-features = false } evm-coder = { default-features = false, path = "../../crates/evm-coder" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } up-data-structs = { default-features = false, path = "../../primitives/data-structs" } [dependencies.codec] diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index f10bfb1161..e6908dfea0 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -11,16 +11,16 @@ scale-info = { version = "2.0.1", default-features = false, features = [ log = { default-features = false, version = "0.4.14" } # Substrate -frame-support = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -frame-system = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } # Unique -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } # Locals evm-coder = { default-features = false, path = '../../crates/evm-coder' } diff --git a/pallets/evm-migration/Cargo.toml b/pallets/evm-migration/Cargo.toml index 79d22bad88..3ef78a066a 100644 --- a/pallets/evm-migration/Cargo.toml +++ b/pallets/evm-migration/Cargo.toml @@ -8,15 +8,15 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } [dependencies.codec] default-features = false diff --git a/pallets/evm-transaction-payment/Cargo.toml b/pallets/evm-transaction-payment/Cargo.toml index 7b8aae8698..2d21b6836a 100644 --- a/pallets/evm-transaction-payment/Cargo.toml +++ b/pallets/evm-transaction-payment/Cargo.toml @@ -8,17 +8,17 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.26" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } [dependencies.codec] default-features = false diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index d5cf925db0..e28812a75c 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -11,19 +11,19 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' } ethereum = { version = "0.12.0", default-features = false } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } diff --git a/pallets/inflation/Cargo.toml b/pallets/inflation/Cargo.toml index cff7e533d8..f5fbe8130a 100644 --- a/pallets/inflation/Cargo.toml +++ b/pallets/inflation/Cargo.toml @@ -43,37 +43,37 @@ version = '3.1.2' default-features = false optional = true git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.serde] default-features = false @@ -83,17 +83,17 @@ version = '1.0.130' [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies] scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index 0af6e5b923..283559eb51 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -11,19 +11,19 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' } ethereum = { version = "0.12.0", default-features = false } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } diff --git a/pallets/proxy-rmrk-core/Cargo.toml b/pallets/proxy-rmrk-core/Cargo.toml index 61c5b37942..e5d7d16002 100644 --- a/pallets/proxy-rmrk-core/Cargo.toml +++ b/pallets/proxy-rmrk-core/Cargo.toml @@ -11,17 +11,17 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } pallet-structure = { default-features = false, path = "../../pallets/structure" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", diff --git a/pallets/proxy-rmrk-equip/Cargo.toml b/pallets/proxy-rmrk-equip/Cargo.toml index 70ca5ef53f..638e74593e 100644 --- a/pallets/proxy-rmrk-equip/Cargo.toml +++ b/pallets/proxy-rmrk-equip/Cargo.toml @@ -11,16 +11,16 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index 050e265481..84414c233f 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -11,17 +11,17 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } struct-versioning = { path = "../../crates/struct-versioning" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } diff --git a/pallets/scheduler/Cargo.toml b/pallets/scheduler/Cargo.toml index 7466de8b2a..31f272ae8f 100644 --- a/pallets/scheduler/Cargo.toml +++ b/pallets/scheduler/Cargo.toml @@ -16,20 +16,20 @@ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.26' } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.27' } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.26" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } log = { version = "0.4.14", default-features = false } [dev-dependencies] -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } [features] default = ["std"] diff --git a/pallets/structure/Cargo.toml b/pallets/structure/Cargo.toml index 118acef5ae..20759a82b8 100644 --- a/pallets/structure/Cargo.toml +++ b/pallets/structure/Cargo.toml @@ -4,10 +4,10 @@ version = "0.1.1" edition = "2021" [dependencies] -frame-support = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -frame-system = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -frame-benchmarking = { default-features = false, optional = true, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } pallet-common = { path = "../common", default-features = false } parity-scale-codec = { version = "3.1.2", default-features = false, features = [ "derive", @@ -16,7 +16,7 @@ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } up-data-structs = { path = "../../primitives/data-structs", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } [features] default = ["std"] diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index 399dc54f17..6ef57c677f 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -59,37 +59,37 @@ version = '3.1.2' default-features = false optional = true git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" ################################################################################ # Local Dependencies @@ -98,7 +98,7 @@ up-data-structs = { default-features = false, path = "../../primitives/data-stru scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } pallet-common = { default-features = false, path = "../common" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } diff --git a/primitives/common/Cargo.toml b/primitives/common/Cargo.toml index cf404b0a59..6a5fac2265 100644 --- a/primitives/common/Cargo.toml +++ b/primitives/common/Cargo.toml @@ -23,34 +23,34 @@ std = [ [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.fp-rpc] default-features = false git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.26" +branch = "unique-polkadot-v0.9.27" [dependencies.pallet-evm] default-features = false git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.26" +branch = "unique-polkadot-v0.9.27" diff --git a/primitives/data-structs/Cargo.toml b/primitives/data-structs/Cargo.toml index ceecdae74f..71da24e08b 100644 --- a/primitives/data-structs/Cargo.toml +++ b/primitives/data-structs/Cargo.toml @@ -18,14 +18,14 @@ codec = { package = "parity-scale-codec", version = "3.1.2", default-features = serde = { version = "1.0.130", features = [ 'derive', ], default-features = false, optional = true } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } derivative = { version = "2.2.0", features = ["use_core"] } struct-versioning = { path = "../../crates/struct-versioning" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } rmrk-traits = { default-features = false, path = "../rmrk-traits" } [features] diff --git a/primitives/rmrk-rpc/Cargo.toml b/primitives/rmrk-rpc/Cargo.toml index 1204dc91c3..2b151b91f3 100644 --- a/primitives/rmrk-rpc/Cargo.toml +++ b/primitives/rmrk-rpc/Cargo.toml @@ -8,10 +8,10 @@ edition = "2021" codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ "derive", ] } -sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -sp-api = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } serde = { version = "1.0.130", default-features = false, features = ["derive"] } rmrk-traits = { default-features = false, path = "../rmrk-traits" } diff --git a/primitives/rpc/Cargo.toml b/primitives/rpc/Cargo.toml index 8ee9383a52..0b59d29166 100644 --- a/primitives/rpc/Cargo.toml +++ b/primitives/rpc/Cargo.toml @@ -10,11 +10,11 @@ up-data-structs = { default-features = false, path = '../data-structs' } codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [ "derive", ] } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } [features] default = ["std"] diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index e229ba4f38..40dde27f7f 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -141,39 +141,39 @@ version = '3.1.2' default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-try-runtime] default-features = false -git = 'https://github.com/paritytech/substrate' +git = "https://github.com/paritytech/substrate" optional = true -branch = 'polkadot-v0.9.26' +branch = "polkadot-v0.9.27" [dependencies.frame-executive] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-system-benchmarking] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-system-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.hex-literal] optional = true @@ -188,12 +188,12 @@ version = '1.0.130' [dependencies.pallet-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" # Contracts specific packages # [dependencies.pallet-contracts] @@ -217,32 +217,32 @@ branch = "polkadot-v0.9.26" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-sudo] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-transaction-payment] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-treasury] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" # [dependencies.pallet-vesting] # default-features = false @@ -252,67 +252,67 @@ branch = "polkadot-v0.9.26" [dependencies.sp-arithmetic] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-block-builder] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-inherents] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-offchain] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-session] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-transaction-pool] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-version] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.smallvec] version = '1.6.1' @@ -323,46 +323,46 @@ version = '1.6.1' [dependencies.parachain-info] default-features = false git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.cumulus-pallet-aura-ext] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-pallet-parachain-system] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-pallet-xcm] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-pallet-dmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-pallet-xcmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-primitives-utility] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-primitives-timestamp] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false ################################################################################ @@ -370,32 +370,32 @@ default-features = false [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" default-features = false [dependencies.xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" default-features = false [dependencies.xcm-builder] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" default-features = false [dependencies.xcm-executor] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" default-features = false [dependencies.pallet-xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" default-features = false [dependencies.orml-vesting] git = "https://github.com/open-web3-stack/open-runtime-module-library" -rev = "8c625a5ab43c1c56cdeed5f8d814a891566d4cf8" +branch = "polkadot-v0.9.27" version = "0.4.1-dev" default-features = false @@ -412,7 +412,7 @@ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } pallet-configuration = { default-features = false, path = "../../pallets/configuration" } @@ -425,22 +425,22 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.26", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.26' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } ################################################################################ # Build Dependencies [build-dependencies.substrate-wasm-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 13202e8053..c116c17c9a 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -138,39 +138,39 @@ version = '3.1.2' default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-try-runtime] default-features = false -git = 'https://github.com/paritytech/substrate' +git = "https://github.com/paritytech/substrate" optional = true -branch = 'polkadot-v0.9.26' +branch = "polkadot-v0.9.27" [dependencies.frame-executive] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-system-benchmarking] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-system-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.hex-literal] optional = true @@ -185,12 +185,12 @@ version = '1.0.130' [dependencies.pallet-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" # Contracts specific packages # [dependencies.pallet-contracts] @@ -214,32 +214,32 @@ branch = "polkadot-v0.9.26" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-sudo] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-transaction-payment] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-treasury] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" # [dependencies.pallet-vesting] # default-features = false @@ -249,67 +249,67 @@ branch = "polkadot-v0.9.26" [dependencies.sp-arithmetic] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-block-builder] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-inherents] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-offchain] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-session] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-transaction-pool] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-version] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.smallvec] version = '1.6.1' @@ -320,46 +320,46 @@ version = '1.6.1' [dependencies.parachain-info] default-features = false git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.cumulus-pallet-aura-ext] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-pallet-parachain-system] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-pallet-xcm] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-pallet-dmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-pallet-xcmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-primitives-utility] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-primitives-timestamp] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false ################################################################################ @@ -367,32 +367,32 @@ default-features = false [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" default-features = false [dependencies.xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" default-features = false [dependencies.xcm-builder] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" default-features = false [dependencies.xcm-executor] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" default-features = false [dependencies.pallet-xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" default-features = false [dependencies.orml-vesting] git = "https://github.com/open-web3-stack/open-runtime-module-library" -rev = "8c625a5ab43c1c56cdeed5f8d814a891566d4cf8" +branch = "polkadot-v0.9.27" version = "0.4.1-dev" default-features = false @@ -416,7 +416,7 @@ scale-info = { version = "2.0.1", default-features = false, features = [ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } pallet-configuration = { default-features = false, path = "../../pallets/configuration" } @@ -429,22 +429,22 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.26", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.26' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } ################################################################################ # Build Dependencies [build-dependencies.substrate-wasm-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index 500dadbbac..7101752af8 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -11,22 +11,22 @@ refungible = [] [dependencies] up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -sp-core = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -sp-std = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -sp-io = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -sp-runtime = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -frame-support = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -frame-system = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-balances = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -pallet-transaction-payment = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } -pallet-timestamp = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } pallet-common = { path = '../../pallets/common' } pallet-structure = { path = '../../pallets/structure' } @@ -43,4 +43,4 @@ parity-scale-codec = { version = "3.1.2", default-features = false, features = [ scale-info = "*" evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.26' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index a1288db11b..61bcac99c5 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -139,39 +139,39 @@ version = '3.1.2' default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-try-runtime] default-features = false -git = 'https://github.com/paritytech/substrate' +git = "https://github.com/paritytech/substrate" optional = true -branch = 'polkadot-v0.9.26' +branch = "polkadot-v0.9.27" [dependencies.frame-executive] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-system-benchmarking] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.frame-system-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.hex-literal] optional = true @@ -186,12 +186,12 @@ version = '1.0.130' [dependencies.pallet-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" # Contracts specific packages # [dependencies.pallet-contracts] @@ -215,32 +215,32 @@ branch = "polkadot-v0.9.26" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-sudo] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-transaction-payment] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.pallet-treasury] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" # [dependencies.pallet-vesting] # default-features = false @@ -250,67 +250,67 @@ branch = "polkadot-v0.9.26" [dependencies.sp-arithmetic] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-block-builder] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-inherents] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-offchain] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-session] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-transaction-pool] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.sp-version] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.smallvec] version = '1.6.1' @@ -321,46 +321,46 @@ version = '1.6.1' [dependencies.parachain-info] default-features = false git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" [dependencies.cumulus-pallet-aura-ext] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-pallet-parachain-system] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-pallet-xcm] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-pallet-dmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-pallet-xcmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-primitives-utility] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false [dependencies.cumulus-primitives-timestamp] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" default-features = false ################################################################################ @@ -368,32 +368,32 @@ default-features = false [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" default-features = false [dependencies.xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" default-features = false [dependencies.xcm-builder] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" default-features = false [dependencies.xcm-executor] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" default-features = false [dependencies.pallet-xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.26" +branch = "release-v0.9.27" default-features = false [dependencies.orml-vesting] git = "https://github.com/open-web3-stack/open-runtime-module-library" -rev = "8c625a5ab43c1c56cdeed5f8d814a891566d4cf8" +branch = "polkadot-v0.9.27" version = "0.4.1-dev" default-features = false @@ -422,23 +422,23 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.26", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.26" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.26' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } ################################################################################ # Build Dependencies [build-dependencies.substrate-wasm-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.26" +branch = "polkadot-v0.9.27" diff --git a/tests/README.md b/tests/README.md index e02dde35e0..2adf063f4e 100644 --- a/tests/README.md +++ b/tests/README.md @@ -5,7 +5,7 @@ 1. Checkout polkadot in sibling folder with this project ```bash git clone https://github.com/paritytech/polkadot.git && cd polkadot -git checkout release-v0.9.26 +git checkout release-v0.9.27 ``` 2. Build with nightly-2022-05-11 From f9bb7266e5a46761ec97ee56da1b7d6654945f5e Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 16 Aug 2022 13:32:51 +0000 Subject: [PATCH 0421/1274] build(dep): test upgrade --- tests/package.json | 8 +- tests/src/contracts.test.ts | 16 +- tests/src/toggleContractAllowList.test.ts | 12 +- tests/src/util/contracthelpers.ts | 6 +- tests/yarn.lock | 2024 +++++++++++---------- 5 files changed, 1123 insertions(+), 943 deletions(-) diff --git a/tests/package.json b/tests/package.json index a667be32b2..804a2f9813 100644 --- a/tests/package.json +++ b/tests/package.json @@ -5,7 +5,7 @@ "main": "", "devDependencies": { "@polkadot/ts": "0.4.22", - "@polkadot/typegen": "8.12.2", + "@polkadot/typegen": "9.2.2", "@types/chai": "^4.3.1", "@types/chai-as-promised": "^7.1.5", "@types/chai-like": "^1.1.1", @@ -92,9 +92,9 @@ "license": "SEE LICENSE IN ../LICENSE", "homepage": "", "dependencies": { - "@polkadot/api": "8.12.2", - "@polkadot/api-contract": "8.12.2", - "@polkadot/util-crypto": "10.0.2", + "@polkadot/api": "9.2.2", + "@polkadot/api-contract": "9.2.2", + "@polkadot/util-crypto": "10.1.1", "bignumber.js": "^9.0.2", "chai-as-promised": "^7.1.1", "chai-like": "^1.1.1", diff --git a/tests/src/contracts.test.ts b/tests/src/contracts.test.ts index d3f398d327..63fcd7a671 100644 --- a/tests/src/contracts.test.ts +++ b/tests/src/contracts.test.ts @@ -54,7 +54,7 @@ describe.skip('Contracts', () => { const initialGetResponse = await getFlipValue(contract, deployer); const bob = privateKeyWrapper('//Bob'); - const flip = contract.tx.flip(value, gasLimit); + const flip = contract.tx.flip({value, gasLimit}); await submitTransactionAsync(bob, flip); const afterFlipGetResponse = await getFlipValue(contract, deployer); @@ -89,7 +89,7 @@ describe.skip('Chain extensions', () => { expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal(normalizeAccountId(alice.address)); // Transfer - const transferTx = contract.tx.transfer(value, gasLimit, bob.address, collectionId, tokenId, 1); + const transferTx = contract.tx.transfer({value, gasLimit}, bob.address, collectionId, tokenId, 1); const events = await submitTransactionAsync(alice, transferTx); const result = getGenericResult(events); expect(result.success).to.be.true; @@ -110,7 +110,7 @@ describe.skip('Chain extensions', () => { await addToAllowListExpectSuccess(alice, collectionId, contract.address); await addToAllowListExpectSuccess(alice, collectionId, bob.address); - const transferTx = contract.tx.createItem(value, gasLimit, bob.address, collectionId, {Nft: {const_data: '0x010203'}}); + const transferTx = contract.tx.createItem({value, gasLimit}, bob.address, collectionId, {Nft: {const_data: '0x010203'}}); const events = await submitTransactionAsync(alice, transferTx); const result = getGenericResult(events); expect(result.success).to.be.true; @@ -137,7 +137,7 @@ describe.skip('Chain extensions', () => { await addToAllowListExpectSuccess(alice, collectionId, contract.address); await addToAllowListExpectSuccess(alice, collectionId, bob.address); - const transferTx = contract.tx.createMultipleItems(value, gasLimit, bob.address, collectionId, [ + const transferTx = contract.tx.createMultipleItems({value, gasLimit}, bob.address, collectionId, [ {NFT: {/*const_data: '0x010203'*/}}, {NFT: {/*const_data: '0x010204'*/}}, {NFT: {/*const_data: '0x010205'*/}}, @@ -176,7 +176,7 @@ describe.skip('Chain extensions', () => { const [contract] = await deployTransferContract(api, privateKeyWrapper); const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', contract.address.toString()); - const transferTx = contract.tx.approve(value, gasLimit, bob.address, collectionId, tokenId, 1); + const transferTx = contract.tx.approve({value, gasLimit}, bob.address, collectionId, tokenId, 1); const events = await submitTransactionAsync(alice, transferTx); const result = getGenericResult(events); expect(result.success).to.be.true; @@ -196,7 +196,7 @@ describe.skip('Chain extensions', () => { const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address); await approveExpectSuccess(collectionId, tokenId, bob, contract.address.toString(), 1); - const transferTx = contract.tx.transferFrom(value, gasLimit, bob.address, charlie.address, collectionId, tokenId, 1); + const transferTx = contract.tx.transferFrom({value, gasLimit}, bob.address, charlie.address, collectionId, tokenId, 1); const events = await submitTransactionAsync(alice, transferTx); const result = getGenericResult(events); expect(result.success).to.be.true; @@ -219,7 +219,7 @@ describe.skip('Chain extensions', () => { expect(await isAllowlisted(api, collectionId, bob.address)).to.be.false; { - const transferTx = contract.tx.toggleAllowList(value, gasLimit, collectionId, bob.address, true); + const transferTx = contract.tx.toggleAllowList({value, gasLimit}, collectionId, bob.address, true); const events = await submitTransactionAsync(alice, transferTx); const result = getGenericResult(events); expect(result.success).to.be.true; @@ -227,7 +227,7 @@ describe.skip('Chain extensions', () => { expect(await isAllowlisted(api, collectionId, bob.address)).to.be.true; } { - const transferTx = contract.tx.toggleAllowList(value, gasLimit, collectionId, bob.address, false); + const transferTx = contract.tx.toggleAllowList({value, gasLimit}, collectionId, bob.address, false); const events = await submitTransactionAsync(alice, transferTx); const result = getGenericResult(events); expect(result.success).to.be.true; diff --git a/tests/src/toggleContractAllowList.test.ts b/tests/src/toggleContractAllowList.test.ts index af500467f4..379144fc45 100644 --- a/tests/src/toggleContractAllowList.test.ts +++ b/tests/src/toggleContractAllowList.test.ts @@ -55,14 +55,14 @@ describe.skip('Integration Test toggleContractAllowList', () => { const [contract, deployer] = await deployFlipper(api, privateKeyWrapper); let flipValueBefore = await getFlipValue(contract, deployer); - const flip = contract.tx.flip(value, gasLimit); + const flip = contract.tx.flip({value, gasLimit}); await submitTransactionAsync(bob, flip); const flipValueAfter = await getFlipValue(contract,deployer); expect(flipValueAfter).to.be.eq(!flipValueBefore, 'Anyone can call new contract.'); const deployerCanFlip = async () => { const flipValueBefore = await getFlipValue(contract, deployer); - const deployerFlip = contract.tx.flip(value, gasLimit); + const deployerFlip = contract.tx.flip({value, gasLimit}); await submitTransactionAsync(deployer, deployerFlip); const aliceFlip1Response = await getFlipValue(contract, deployer); expect(aliceFlip1Response).to.be.eq(!flipValueBefore, 'Deployer always can flip.'); @@ -72,7 +72,7 @@ describe.skip('Integration Test toggleContractAllowList', () => { flipValueBefore = await getFlipValue(contract, deployer); const enableAllowListTx = api.tx.unique.toggleContractAllowList(contract.address, true); await submitTransactionAsync(deployer, enableAllowListTx); - const flipWithEnabledAllowList = contract.tx.flip(value, gasLimit); + const flipWithEnabledAllowList = contract.tx.flip({value, gasLimit}); await expect(submitTransactionExpectFailAsync(bob, flipWithEnabledAllowList)).to.be.rejected; const flipValueAfterEnableAllowList = await getFlipValue(contract, deployer); expect(flipValueAfterEnableAllowList).to.be.eq(flipValueBefore, 'Enabling allowlist doesn\'t make it possible to call contract for everyone.'); @@ -82,7 +82,7 @@ describe.skip('Integration Test toggleContractAllowList', () => { flipValueBefore = await getFlipValue(contract, deployer); const addBobToAllowListTx = api.tx.unique.addToContractAllowList(contract.address, bob.address); await submitTransactionAsync(deployer, addBobToAllowListTx); - const flipWithAllowlistedBob = contract.tx.flip(value, gasLimit); + const flipWithAllowlistedBob = contract.tx.flip({value, gasLimit}); await submitTransactionAsync(bob, flipWithAllowlistedBob); const flipAfterAllowListed = await getFlipValue(contract,deployer); expect(flipAfterAllowListed).to.be.eq(!flipValueBefore, 'Bob was allowlisted, now he can flip.'); @@ -92,7 +92,7 @@ describe.skip('Integration Test toggleContractAllowList', () => { flipValueBefore = await getFlipValue(contract, deployer); const removeBobFromAllowListTx = api.tx.unique.removeFromContractAllowList(contract.address, bob.address); await submitTransactionAsync(deployer, removeBobFromAllowListTx); - const bobRemoved = contract.tx.flip(value, gasLimit); + const bobRemoved = contract.tx.flip({value, gasLimit}); await expect(submitTransactionExpectFailAsync(bob, bobRemoved)).to.be.rejected; const afterBobRemoved = await getFlipValue(contract, deployer); expect(afterBobRemoved).to.be.eq(flipValueBefore, 'Bob can\'t call contract, now when he is removeed from allow list.'); @@ -102,7 +102,7 @@ describe.skip('Integration Test toggleContractAllowList', () => { flipValueBefore = await getFlipValue(contract, deployer); const disableAllowListTx = api.tx.unique.toggleContractAllowList(contract.address, false); await submitTransactionAsync(deployer, disableAllowListTx); - const allowListDisabledFlip = contract.tx.flip(value, gasLimit); + const allowListDisabledFlip = contract.tx.flip({value, gasLimit}); await submitTransactionAsync(bob, allowListDisabledFlip); const afterAllowListDisabled = await getFlipValue(contract,deployer); expect(afterAllowListDisabled).to.be.eq(!flipValueBefore, 'Anyone can call contract with disabled allowlist.'); diff --git a/tests/src/util/contracthelpers.ts b/tests/src/util/contracthelpers.ts index a32d8961d7..b9ef52845c 100644 --- a/tests/src/util/contracthelpers.ts +++ b/tests/src/util/contracthelpers.ts @@ -77,7 +77,7 @@ export async function deployFlipper(api: ApiPromise, privateKeyWrapper: (account } export async function getFlipValue(contract: Contract, deployer: IKeyringPair) { - const result = await contract.query.get(deployer.address, value, gasLimit); + const result = await contract.query.get(deployer.address, {value, gasLimit}); if(!result.result.isOk) { throw 'Failed to get flipper value'; @@ -86,7 +86,7 @@ export async function getFlipValue(contract: Contract, deployer: IKeyringPair) { } export async function toggleFlipValueExpectSuccess(sender: IKeyringPair, contract: Contract) { - const tx = contract.tx.flip(value, gasLimit); + const tx = contract.tx.flip({value, gasLimit}); const events = await submitTransactionAsync(sender, tx); const result = getGenericResult(events); @@ -94,7 +94,7 @@ export async function toggleFlipValueExpectSuccess(sender: IKeyringPair, contrac } export async function toggleFlipValueExpectFailure(sender: IKeyringPair, contract: Contract) { - const tx = contract.tx.flip(value, gasLimit); + const tx = contract.tx.flip({value, gasLimit}); await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; } diff --git a/tests/yarn.lock b/tests/yarn.lock index 0fb4c81efb..29f45253d8 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -17,63 +17,63 @@ dependencies: "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.18.6": +"@babel/compat-data@^7.18.8": version "7.18.8" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.18.8.tgz#2483f565faca607b8535590e84e7de323f27764d" integrity sha512-HSmX4WZPPK3FUxYp7g2T6EyO8j96HlZJlxmKPSh6KAcqwyDrfx7hKjXpAW/0FhFfTJsR0Yt4lAjLI2coMptIHQ== -"@babel/core@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.6.tgz#54a107a3c298aee3fe5e1947a6464b9b6faca03d" - integrity sha512-cQbWBpxcbbs/IUredIPkHiAGULLV8iwgNRMFzvbhEXISp4f3rUUXE5+TIw6KwUWUR3DwyI6gmBRnmAtYaWehwQ== +"@babel/core@^7.18.10": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.10.tgz#39ad504991d77f1f3da91be0b8b949a5bc466fb8" + integrity sha512-JQM6k6ENcBFKVtWvLavlvi/mPcpYZ3+R+2EySDEMSMbp7Mn4FexlbbJVrx2R7Ijhr01T8gyqrOaABWIOgxeUyw== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.18.6" - "@babel/helper-compilation-targets" "^7.18.6" - "@babel/helper-module-transforms" "^7.18.6" - "@babel/helpers" "^7.18.6" - "@babel/parser" "^7.18.6" - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.6" - "@babel/types" "^7.18.6" + "@babel/generator" "^7.18.10" + "@babel/helper-compilation-targets" "^7.18.9" + "@babel/helper-module-transforms" "^7.18.9" + "@babel/helpers" "^7.18.9" + "@babel/parser" "^7.18.10" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.18.10" + "@babel/types" "^7.18.10" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.1" semver "^6.3.0" -"@babel/generator@^7.18.6", "@babel/generator@^7.18.7": - version "7.18.7" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.7.tgz#2aa78da3c05aadfc82dbac16c99552fc802284bd" - integrity sha512-shck+7VLlY72a2w9c3zYWuE1pwOKEiQHV7GTUbSnhyl5eu3i04t30tBY82ZRWrDfo3gkakCFtevExnxbkf2a3A== +"@babel/generator@^7.18.10": + version "7.18.12" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.12.tgz#fa58daa303757bd6f5e4bbca91b342040463d9f4" + integrity sha512-dfQ8ebCN98SvyL7IxNMCUtZQSq5R7kxgN+r8qYTGDmmSion1hX2C0zq2yo1bsCDhXixokv1SAWTZUMYbO/V5zg== dependencies: - "@babel/types" "^7.18.7" + "@babel/types" "^7.18.10" "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" -"@babel/helper-compilation-targets@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.6.tgz#18d35bfb9f83b1293c22c55b3d576c1315b6ed96" - integrity sha512-vFjbfhNCzqdeAtZflUFrG5YIFqGTqsctrtkZ1D/NB0mDW9TwW3GmmUepYY4G9wCET5rY5ugz4OGTcLd614IzQg== +"@babel/helper-compilation-targets@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.9.tgz#69e64f57b524cde3e5ff6cc5a9f4a387ee5563bf" + integrity sha512-tzLCyVmqUiFlcFoAPLA/gL9TeYrF61VLNtb+hvkuVaB5SUjW7jcfrglBIX1vUIoT7CLP3bBlIMeyEsIl2eFQNg== dependencies: - "@babel/compat-data" "^7.18.6" + "@babel/compat-data" "^7.18.8" "@babel/helper-validator-option" "^7.18.6" browserslist "^4.20.2" semver "^6.3.0" -"@babel/helper-environment-visitor@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.6.tgz#b7eee2b5b9d70602e59d1a6cad7dd24de7ca6cd7" - integrity sha512-8n6gSfn2baOY+qlp+VSzsosjCVGFqWKmDF0cCWOybh52Dw3SEyoWR1KrhMJASjLwIEkkAufZ0xvr+SxLHSpy2Q== +"@babel/helper-environment-visitor@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" + integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== -"@babel/helper-function-name@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.18.6.tgz#8334fecb0afba66e6d87a7e8c6bb7fed79926b83" - integrity sha512-0mWMxV1aC97dhjCah5U5Ua7668r5ZmSC2DLfH2EZnf9c3/dHZKiFa5pRLMH5tjSl471tY6496ZWk/kjNONBxhw== +"@babel/helper-function-name@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.18.9.tgz#940e6084a55dee867d33b4e487da2676365e86b0" + integrity sha512-fJgWlZt7nxGksJS9a0XdSaI4XvpExnNIgRP+rVefWh5U7BL8pPuir6SJUmFKRfjWQ51OtWSzwOxhaH/EBWWc0A== dependencies: "@babel/template" "^7.18.6" - "@babel/types" "^7.18.6" + "@babel/types" "^7.18.9" "@babel/helper-hoist-variables@^7.18.6": version "7.18.6" @@ -89,19 +89,19 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.18.6": - version "7.18.8" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.18.8.tgz#4f8408afead0188cfa48672f9d0e5787b61778c8" - integrity sha512-che3jvZwIcZxrwh63VfnFTUzcAM9v/lznYkkRxIBGMPt1SudOKHAEec0SIRCfiuIzTcF7VGj/CaTT6gY4eWxvA== +"@babel/helper-module-transforms@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.18.9.tgz#5a1079c005135ed627442df31a42887e80fcb712" + integrity sha512-KYNqY0ICwfv19b31XzvmI/mfcylOzbLtowkw+mfvGPAQ3kfCnMLYbED3YecL5tPd8nAYFQFAd6JHp2LxZk/J1g== dependencies: - "@babel/helper-environment-visitor" "^7.18.6" + "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-module-imports" "^7.18.6" "@babel/helper-simple-access" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" "@babel/helper-validator-identifier" "^7.18.6" "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.8" - "@babel/types" "^7.18.8" + "@babel/traverse" "^7.18.9" + "@babel/types" "^7.18.9" "@babel/helper-simple-access@^7.18.6": version "7.18.6" @@ -117,6 +117,11 @@ dependencies: "@babel/types" "^7.18.6" +"@babel/helper-string-parser@^7.18.10": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz#181f22d28ebe1b3857fa575f5c290b1aaf659b56" + integrity sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw== + "@babel/helper-validator-identifier@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz#9c97e30d31b2b8c72a1d08984f2ca9b574d7a076" @@ -127,14 +132,14 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== -"@babel/helpers@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.18.6.tgz#4c966140eaa1fcaa3d5a8c09d7db61077d4debfd" - integrity sha512-vzSiiqbQOghPngUYt/zWGvK3LAsPhz55vc9XNN0xAl2gV4ieShI2OQli5duxWHD+72PZPTKAcfcZDE1Cwc5zsQ== +"@babel/helpers@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.18.9.tgz#4bef3b893f253a1eced04516824ede94dcfe7ff9" + integrity sha512-Jf5a+rbrLoR4eNdUmnFu8cN5eNJT6qdTdOg5IHIzq87WwyRw9PwguLFOWYgktN/60IP4fgDUawJvs7PjQIzELQ== dependencies: "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.6" - "@babel/types" "^7.18.6" + "@babel/traverse" "^7.18.9" + "@babel/types" "^7.18.9" "@babel/highlight@^7.18.6": version "7.18.6" @@ -145,15 +150,15 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.18.6", "@babel/parser@^7.18.8": - version "7.18.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.8.tgz#822146080ac9c62dac0823bb3489622e0bc1cbdf" - integrity sha512-RSKRfYX20dyH+elbJK2uqAkVyucL+xXzhqlMD5/ZXx+dAAwpyB7HsvnHe/ZUGOF+xLr5Wx9/JoXVTj6BQE2/oA== +"@babel/parser@^7.18.10", "@babel/parser@^7.18.11": + version "7.18.11" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.11.tgz#68bb07ab3d380affa9a3f96728df07969645d2d9" + integrity sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ== -"@babel/register@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.18.6.tgz#48a4520f1b2a7d7ac861e8148caeb0cefe6c59db" - integrity sha512-tkYtONzaO8rQubZzpBnvZPFcHgh8D9F55IjOsYton4X2IBoyRn2ZSWQqySTZnUn2guZbxbQiAB27hJEbvXamhQ== +"@babel/register@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.18.9.tgz#1888b24bc28d5cc41c412feb015e9ff6b96e439c" + integrity sha512-ZlbnXDcNYHMR25ITwwNKT88JiaukkdVj/nG7r3wnuXkOTHc60Uy05PwMCPre0hSkY68E6zK3xz+vUJSP2jWmcw== dependencies: clone-deep "^4.0.1" find-cache-dir "^2.0.0" @@ -161,43 +166,44 @@ pirates "^4.0.5" source-map-support "^0.5.16" -"@babel/runtime@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.6.tgz#6a1ef59f838debd670421f8c7f2cbb8da9751580" - integrity sha512-t9wi7/AW6XtKahAe20Yw0/mMljKq0B1r2fPdvaAdV/KPDZewFXdaaa6K7lxmZBZ8FBNpCiAT6iHPmd6QO9bKfQ== +"@babel/runtime@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" + integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.6.tgz#1283f4993e00b929d6e2d3c72fdc9168a2977a31" - integrity sha512-JoDWzPe+wgBsTTgdnIma3iHNFC7YVJoPssVBDjiHfNlyt4YcunDtcDOUmfVDfCK5MfdsaIoX9PkijPhjH3nYUw== +"@babel/template@^7.18.10", "@babel/template@^7.18.6": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71" + integrity sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA== dependencies: "@babel/code-frame" "^7.18.6" - "@babel/parser" "^7.18.6" - "@babel/types" "^7.18.6" + "@babel/parser" "^7.18.10" + "@babel/types" "^7.18.10" -"@babel/traverse@^7.18.6", "@babel/traverse@^7.18.8": - version "7.18.8" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.8.tgz#f095e62ab46abf1da35e5a2011f43aee72d8d5b0" - integrity sha512-UNg/AcSySJYR/+mIcJQDCv00T+AqRO7j/ZEJLzpaYtgM48rMg5MnkJgyNqkzo88+p4tfRvZJCEiwwfG6h4jkRg== +"@babel/traverse@^7.18.10", "@babel/traverse@^7.18.9": + version "7.18.11" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.11.tgz#3d51f2afbd83ecf9912bcbb5c4d94e3d2ddaa16f" + integrity sha512-TG9PiM2R/cWCAy6BPJKeHzNbu4lPzOSZpeMfeNErskGpTJx6trEvFaVCbDvpcxwy49BKWmEPwiW8mrysNiDvIQ== dependencies: "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.18.7" - "@babel/helper-environment-visitor" "^7.18.6" - "@babel/helper-function-name" "^7.18.6" + "@babel/generator" "^7.18.10" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.18.9" "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.18.8" - "@babel/types" "^7.18.8" + "@babel/parser" "^7.18.11" + "@babel/types" "^7.18.10" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.18.6", "@babel/types@^7.18.7", "@babel/types@^7.18.8": - version "7.18.8" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.8.tgz#c5af199951bf41ba4a6a9a6d0d8ad722b30cd42f" - integrity sha512-qwpdsmraq0aJ3osLJRApsc2ouSJCdnMeZwB0DhbtHAtRpZNZCdlbRnHIgcRKzdE1g0iOGg644fzjOBcdOz9cPw== +"@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.10.tgz#4908e81b6b339ca7c6b7a555a5fc29446f26dde6" + integrity sha512-MJvnbEiiNkpjo+LknnmRrqbY1GPUUggjv+wQVjetM/AONoupqRALB7I6jGqNUAZsKcRIEu2J6FRFvsczljjsaQ== dependencies: + "@babel/helper-string-parser" "^7.18.10" "@babel/helper-validator-identifier" "^7.18.6" to-fast-properties "^2.0.0" @@ -224,12 +230,12 @@ strip-json-comments "^3.1.1" "@ethereumjs/common@^2.5.0", "@ethereumjs/common@^2.6.4": - version "2.6.4" - resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.6.4.tgz#1b3cdd3aa4ee3b0ca366756fc35e4a03022a01cc" - integrity sha512-RDJh/R/EAr+B7ZRg5LfJ0BIpf/1LydFgYdvZEuTraojCbVypO2sQ+QnpP5u2wJf9DASyooKqu8O4FJEWUV6NXw== + version "2.6.5" + resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.6.5.tgz#0a75a22a046272579d91919cb12d84f2756e8d30" + integrity sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA== dependencies: crc-32 "^1.2.0" - ethereumjs-util "^7.1.4" + ethereumjs-util "^7.1.5" "@ethereumjs/tx@^3.3.2": version "3.5.2" @@ -239,20 +245,20 @@ "@ethereumjs/common" "^2.6.4" ethereumjs-util "^7.1.5" -"@ethersproject/abi@5.0.7": - version "5.0.7" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.7.tgz#79e52452bd3ca2956d0e1c964207a58ad1a0ee7b" - integrity sha512-Cqktk+hSIckwP/W8O47Eef60VwmoSC/L3lY0+dIBhQPCNn9E4V7rwmm2aFrNRRDJfFlGuZ1khkQUOc3oBX+niw== - dependencies: - "@ethersproject/address" "^5.0.4" - "@ethersproject/bignumber" "^5.0.7" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/constants" "^5.0.4" - "@ethersproject/hash" "^5.0.4" - "@ethersproject/keccak256" "^5.0.3" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/properties" "^5.0.3" - "@ethersproject/strings" "^5.0.4" +"@ethersproject/abi@^5.6.3": + version "5.6.4" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.4.tgz#f6e01b6ed391a505932698ecc0d9e7a99ee60362" + integrity sha512-TTeZUlCeIHG6527/2goZA6gW5F8Emoc7MrZDC7hhP84aRGvW3TEdTnZR08Ls88YXM1m2SuK42Osw/jSi3uO8gg== + dependencies: + "@ethersproject/address" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/constants" "^5.6.1" + "@ethersproject/hash" "^5.6.1" + "@ethersproject/keccak256" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.1" "@ethersproject/abstract-provider@^5.6.1": version "5.6.1" @@ -278,7 +284,7 @@ "@ethersproject/logger" "^5.6.0" "@ethersproject/properties" "^5.6.0" -"@ethersproject/address@^5.0.4", "@ethersproject/address@^5.6.1": +"@ethersproject/address@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.6.1.tgz#ab57818d9aefee919c5721d28cd31fd95eff413d" integrity sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q== @@ -296,7 +302,7 @@ dependencies: "@ethersproject/bytes" "^5.6.1" -"@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.6.2": +"@ethersproject/bignumber@^5.6.2": version "5.6.2" resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.6.2.tgz#72a0717d6163fab44c47bcc82e0c550ac0315d66" integrity sha512-v7+EEUbhGqT3XJ9LMPsKvXYHFc8eHxTowFCG/HgJErmq4XHJ2WR7aeyICg3uTOAQ7Icn0GFHAohXEhxQHq4Ubw== @@ -305,21 +311,21 @@ "@ethersproject/logger" "^5.6.0" bn.js "^5.2.1" -"@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.6.1": +"@ethersproject/bytes@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.6.1.tgz#24f916e411f82a8a60412344bf4a813b917eefe7" integrity sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g== dependencies: "@ethersproject/logger" "^5.6.0" -"@ethersproject/constants@^5.0.4", "@ethersproject/constants@^5.6.1": +"@ethersproject/constants@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.6.1.tgz#e2e974cac160dd101cf79fdf879d7d18e8cb1370" integrity sha512-QSq9WVnZbxXYFftrjSjZDUshp6/eKp6qrtdBtUCm0QxCV5z1fG/w3kdlcsjMCQuQHUnAclKoK7XpXMezhRDOLg== dependencies: "@ethersproject/bignumber" "^5.6.2" -"@ethersproject/hash@^5.0.4": +"@ethersproject/hash@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.6.1.tgz#224572ea4de257f05b4abf8ae58b03a67e99b0f4" integrity sha512-L1xAHurbaxG8VVul4ankNX5HgQ8PNCTrnVXEiFnE9xoRnaUcgfD12tZINtDinSllxPLCtGwguQxJ5E6keE84pA== @@ -333,7 +339,7 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.1" -"@ethersproject/keccak256@^5.0.3", "@ethersproject/keccak256@^5.6.1": +"@ethersproject/keccak256@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.6.1.tgz#b867167c9b50ba1b1a92bccdd4f2d6bd168a91cc" integrity sha512-bB7DQHCTRDooZZdL3lk9wpL0+XuG3XLGHLh3cePnybsO3V0rdCAOQGpn/0R3aODmnTOOkCATJiD2hnL+5bwthA== @@ -341,19 +347,19 @@ "@ethersproject/bytes" "^5.6.1" js-sha3 "0.8.0" -"@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.6.0": +"@ethersproject/logger@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.6.0.tgz#d7db1bfcc22fd2e4ab574cba0bb6ad779a9a3e7a" integrity sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg== "@ethersproject/networks@^5.6.3": - version "5.6.3" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.3.tgz#3ee3ab08f315b433b50c99702eb32e0cf31f899f" - integrity sha512-QZxRH7cA5Ut9TbXwZFiCyuPchdWi87ZtVNHWZd0R6YFgYtes2jQ3+bsslJ0WdyDe0i6QumqtoYqvY3rrQFRZOQ== + version "5.6.4" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.4.tgz#51296d8fec59e9627554f5a8a9c7791248c8dc07" + integrity sha512-KShHeHPahHI2UlWdtDMn2lJETcbtaJge4k7XSjDR9h79QTd6yQJmv6Cp2ZA4JdqWnhszAOLSuJEd9C0PRw7hSQ== dependencies: "@ethersproject/logger" "^5.6.0" -"@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.6.0": +"@ethersproject/properties@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.6.0.tgz#38904651713bc6bdd5bdd1b0a4287ecda920fa04" integrity sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg== @@ -380,7 +386,7 @@ elliptic "6.5.4" hash.js "1.1.7" -"@ethersproject/strings@^5.0.4", "@ethersproject/strings@^5.6.1": +"@ethersproject/strings@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.6.1.tgz#dbc1b7f901db822b5cafd4ebf01ca93c373f8952" integrity sha512-2X1Lgk6Jyfg26MUnsHiT456U9ijxKUybz8IM1Vih+NJxYtXhmvKBcHOmvGqpFSVJ0nQ4ZCoIViR8XlRw1v/+Cw== @@ -389,7 +395,7 @@ "@ethersproject/constants" "^5.6.1" "@ethersproject/logger" "^5.6.0" -"@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.6.2": +"@ethersproject/transactions@^5.6.2": version "5.6.2" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.6.2.tgz#793a774c01ced9fe7073985bb95a4b4e57a6370b" integrity sha512-BuV63IRPHmJvthNkkt9G70Ullx6AcM+SDc+a8Aw/8Yew6YwT51TcBKEp1P4oOQ/bP25I18JJr7rcFRgFtU9B2Q== @@ -415,15 +421,20 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.1" -"@humanwhocodes/config-array@^0.9.2": - version "0.9.5" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7" - integrity sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw== +"@humanwhocodes/config-array@^0.10.4": + version "0.10.4" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.4.tgz#01e7366e57d2ad104feea63e72248f22015c520c" + integrity sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" minimatch "^3.0.4" +"@humanwhocodes/gitignore-to-minimatch@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz#316b0a63b91c10e53f242efb4ace5c3b34e8728d" + integrity sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA== + "@humanwhocodes/object-schema@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" @@ -447,24 +458,19 @@ "@jridgewell/trace-mapping" "^0.3.9" "@jridgewell/resolve-uri@^3.0.3": - version "3.0.7" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz#30cd49820a962aff48c8fffc5cd760151fca61fe" - integrity sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA== - -"@jridgewell/set-array@^1.0.0": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.1.tgz#36a6acc93987adcf0ba50c66908bd0b70de8afea" - integrity sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ== + version "3.1.0" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== -"@jridgewell/set-array@^1.0.1": +"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== "@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.13" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz#b6461fb0c2964356c469e115f504c95ad97ab88c" - integrity sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w== + version "1.4.14" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== "@jridgewell/trace-mapping@0.3.9": version "0.3.9" @@ -475,9 +481,9 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping@^0.3.9": - version "0.3.13" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz#dcfe3e95f224c8fe97a87a5235defec999aa92ea" - integrity sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w== + version "0.3.15" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774" + integrity sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g== dependencies: "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" @@ -487,10 +493,10 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183" integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA== -"@noble/secp256k1@1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.6.0.tgz#602afbbfcfb7e169210469b697365ef740d7e930" - integrity sha512-DWSsg8zMHOYMYBqIQi96BQuthZrp98LCeMNcUOaffCIVYQ5yxDbNikLF+H7jEnmNNmXbtVic46iCuVWzar+MgA== +"@noble/secp256k1@1.6.3": + version "1.6.3" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.6.3.tgz#7eed12d9f4404b416999d0c87686836c4c5c9b94" + integrity sha512-T04e4iTurVy7I8Sw4+c5OSN9/RkPlo1uKxAomtxQNLq8j1uPAqnsqG1bqvY3Jv7c13gyr6dui0zmh/I3+f/JaQ== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -513,142 +519,151 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@polkadot/api-augment@8.12.2": - version "8.12.2" - resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-8.12.2.tgz#413ae9c99df0a4fb2135fee3f7b9e0caa913fcfd" - integrity sha512-HbvNOu6ntago8nYqLkq/HZ+gsMhbKe/sD4hPIFPruhP6OAnW6TWNIlqc2ruFx2KrT0rfzXUZ4Gmk4WgyRFuz4Q== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/api-base" "8.12.2" - "@polkadot/rpc-augment" "8.12.2" - "@polkadot/types" "8.12.2" - "@polkadot/types-augment" "8.12.2" - "@polkadot/types-codec" "8.12.2" - "@polkadot/util" "^10.0.2" - -"@polkadot/api-base@8.12.2": - version "8.12.2" - resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-8.12.2.tgz#15fbf89b14d6918027b7bf7f87b218a675ae82d6" - integrity sha512-5rLOCulXNU/g0rUVoW6ArQjOBq/07S6oKR9nOJls6W4PUhYcBIClCTlXx2uoDszMdwhEhYyHQ67bnoTcRrYcLA== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/rpc-core" "8.12.2" - "@polkadot/types" "8.12.2" - "@polkadot/util" "^10.0.2" - rxjs "^7.5.5" - -"@polkadot/api-contract@8.12.2": - version "8.12.2" - resolved "https://registry.yarnpkg.com/@polkadot/api-contract/-/api-contract-8.12.2.tgz#9dddd83eb0ae40fce806fe2e32d319134a28ae4c" - integrity sha512-YuyVamnp9q5VAWN9WOYsaWKnH1/MERtCzsG5/saopgGrEjfYRqyuLA+VVFaAoxEAdPfJew0AQDHjbR2H2+C9nQ== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/api" "8.12.2" - "@polkadot/types" "8.12.2" - "@polkadot/types-codec" "8.12.2" - "@polkadot/types-create" "8.12.2" - "@polkadot/util" "^10.0.2" - "@polkadot/util-crypto" "^10.0.2" - rxjs "^7.5.5" - -"@polkadot/api-derive@8.12.2": - version "8.12.2" - resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-8.12.2.tgz#eec954f6421356caf52584fe5c15e7d96c6c3d29" - integrity sha512-F7HCAVNXLQphv7OYVcq7GM5CP6RzGvYfTqutmc5GZFCDVMDY9RQA+a/3T5BIjJXrtepPa0pcYvt9fcovsazhZw== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/api" "8.12.2" - "@polkadot/api-augment" "8.12.2" - "@polkadot/api-base" "8.12.2" - "@polkadot/rpc-core" "8.12.2" - "@polkadot/types" "8.12.2" - "@polkadot/types-codec" "8.12.2" - "@polkadot/util" "^10.0.2" - "@polkadot/util-crypto" "^10.0.2" - rxjs "^7.5.5" - -"@polkadot/api@8.12.2": - version "8.12.2" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-8.12.2.tgz#5ade99fd595b712f647cf4d63ce5a6daa6d0fff7" - integrity sha512-bK3bhCFqCYTx/K/89QF88jYqE3Dc1LmCwMnwpof6adlAj5DoEjRfSmKarqrZqox516Xph1+84ACNkyem0KnIWA== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/api-augment" "8.12.2" - "@polkadot/api-base" "8.12.2" - "@polkadot/api-derive" "8.12.2" - "@polkadot/keyring" "^10.0.2" - "@polkadot/rpc-augment" "8.12.2" - "@polkadot/rpc-core" "8.12.2" - "@polkadot/rpc-provider" "8.12.2" - "@polkadot/types" "8.12.2" - "@polkadot/types-augment" "8.12.2" - "@polkadot/types-codec" "8.12.2" - "@polkadot/types-create" "8.12.2" - "@polkadot/types-known" "8.12.2" - "@polkadot/util" "^10.0.2" - "@polkadot/util-crypto" "^10.0.2" +"@polkadot/api-augment@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-9.2.2.tgz#fab9dd96f9322ae658245cd8711fd2d8db5c2412" + integrity sha512-yDtp1ecRWMCFXTjmKOvqXI6VHTYvHormRwJwE85VGQbMsZFDWFVbQXZOxsqkfx2rJye/25seVRWxQS+7oKzqkA== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/api-base" "9.2.2" + "@polkadot/rpc-augment" "9.2.2" + "@polkadot/types" "9.2.2" + "@polkadot/types-augment" "9.2.2" + "@polkadot/types-codec" "9.2.2" + "@polkadot/util" "^10.1.4" + +"@polkadot/api-base@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-9.2.2.tgz#f84cbf1eb1893e9c8eb538369c8b349f3d64d5fd" + integrity sha512-Dqbh0MQo/ByAqOC56ga1VkVCpEjfWtxPHz3ni8oXJp0YvjA/4qKkZRM2ejoN07XKOMFNBZC4hnmNplyaCnVHfw== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/rpc-core" "9.2.2" + "@polkadot/types" "9.2.2" + "@polkadot/util" "^10.1.4" + rxjs "^7.5.6" + +"@polkadot/api-contract@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@polkadot/api-contract/-/api-contract-9.2.2.tgz#1b8c1c6a4fb2f5e21d0c9549062c8242453a15b5" + integrity sha512-NE2QbBtX7e/lXdOG5wFqArjnbujcVWppoksvX1SrG2GKdhM2Y/shHLNV7uCYMq3tqmmCKOcp0RKE85Owu/7LQA== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/api" "9.2.2" + "@polkadot/types" "9.2.2" + "@polkadot/types-codec" "9.2.2" + "@polkadot/types-create" "9.2.2" + "@polkadot/util" "^10.1.4" + "@polkadot/util-crypto" "^10.1.4" + rxjs "^7.5.6" + +"@polkadot/api-derive@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-9.2.2.tgz#70b510d8140f081ef145b9bdf4f8a03108183192" + integrity sha512-8Du6Wxro5yhAgwJ7R8xWCrDFnAWGv6aDWVnpckUZWs9LRw5wGNN4GJD4WB/715H9ZZXzQ/sDW5lXo3ux19SE7w== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/api" "9.2.2" + "@polkadot/api-augment" "9.2.2" + "@polkadot/api-base" "9.2.2" + "@polkadot/rpc-core" "9.2.2" + "@polkadot/types" "9.2.2" + "@polkadot/types-codec" "9.2.2" + "@polkadot/util" "^10.1.4" + "@polkadot/util-crypto" "^10.1.4" + rxjs "^7.5.6" + +"@polkadot/api@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-9.2.2.tgz#3ecd80110acf5e479ce510d301e3a7ce2c1b8f17" + integrity sha512-dRXfdGhV3XWRtsYt+OskAwSAimTRC1k/oh3yO1vYc7C9cmqssw0LMEib9mlVh7qHprD30db7NleTOSFU6Bt2ag== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/api-augment" "9.2.2" + "@polkadot/api-base" "9.2.2" + "@polkadot/api-derive" "9.2.2" + "@polkadot/keyring" "^10.1.4" + "@polkadot/rpc-augment" "9.2.2" + "@polkadot/rpc-core" "9.2.2" + "@polkadot/rpc-provider" "9.2.2" + "@polkadot/types" "9.2.2" + "@polkadot/types-augment" "9.2.2" + "@polkadot/types-codec" "9.2.2" + "@polkadot/types-create" "9.2.2" + "@polkadot/types-known" "9.2.2" + "@polkadot/util" "^10.1.4" + "@polkadot/util-crypto" "^10.1.4" eventemitter3 "^4.0.7" - rxjs "^7.5.5" - -"@polkadot/keyring@^10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-10.0.2.tgz#4e6cc008a16cf7bb1b95694857c16295ca2135ae" - integrity sha512-N/lx/e9alR/lUREap4hQ/YKa+CKCFIa4QOKLz8eFhpqhbA5M5nQcjrppitO+sX/XlpmbOBpbnO168cU2dA09Iw== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/util" "10.0.2" - "@polkadot/util-crypto" "10.0.2" - -"@polkadot/networks@10.0.2", "@polkadot/networks@^10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.0.2.tgz#864f08cdbd4cf7c65a82721f3008169222a53148" - integrity sha512-K7hUFmErTrBtkobhvFwT/oPEQrI1oVr7WfngquM+zN0oHiHzRspecxifGKsQ1kw78F7zrZKOBScW/hoJbdI8fA== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/util" "10.0.2" - "@substrate/ss58-registry" "^1.23.0" - -"@polkadot/rpc-augment@8.12.2": - version "8.12.2" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-8.12.2.tgz#7afe41a6230a117485991ce108f6ffe341e72bb3" - integrity sha512-FKVMmkYhWJNcuXpRN9t7xTX5agSgcgniP8gNPMhL6GV8lV3Xoxs8gLgVy32xeAh7gxArN/my6LnYPtXVkdFALQ== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/rpc-core" "8.12.2" - "@polkadot/types" "8.12.2" - "@polkadot/types-codec" "8.12.2" - "@polkadot/util" "^10.0.2" - -"@polkadot/rpc-core@8.12.2": - version "8.12.2" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-8.12.2.tgz#d8d53240276f0e2df3f4e6540acbb35949a2c56e" - integrity sha512-RLhzNYJonfsQXYhZuyVBSsOwSgCf+8ijS3aUcv06yrFf26k7nXw2Uc4P0Io3jY/wq5LnvkKzL+HSj6j7XZ+/Sg== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/rpc-augment" "8.12.2" - "@polkadot/rpc-provider" "8.12.2" - "@polkadot/types" "8.12.2" - "@polkadot/util" "^10.0.2" - rxjs "^7.5.5" - -"@polkadot/rpc-provider@8.12.2": - version "8.12.2" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-8.12.2.tgz#e3f6ddf98955bb4a8431342f5f9d39dc01c3555b" - integrity sha512-fgXKAYDmc1kGmOPa2Nuh+LsUBFvUzgzP/tOEbS5UJpoc0+azZfTLWh2AXpo/gVHblR6zZBDWrB3wmGzu6wF17A== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/keyring" "^10.0.2" - "@polkadot/types" "8.12.2" - "@polkadot/types-support" "8.12.2" - "@polkadot/util" "^10.0.2" - "@polkadot/util-crypto" "^10.0.2" - "@polkadot/x-fetch" "^10.0.2" - "@polkadot/x-global" "^10.0.2" - "@polkadot/x-ws" "^10.0.2" - "@substrate/connect" "0.7.7" + rxjs "^7.5.6" + +"@polkadot/keyring@^10.1.4": + version "10.1.4" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-10.1.4.tgz#7c60002cb442d2a160ee215b21c1319e85d97eaf" + integrity sha512-dCMejp5heZwKSFeO+1vCHFoo1h1KgNvu4AaKQdNxpyr/3eCINrCFI74/qT9XGypblxd61caOpJcMl8B1R/UWFA== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/util" "10.1.4" + "@polkadot/util-crypto" "10.1.4" + +"@polkadot/networks@10.1.1": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.1.1.tgz#d3deeff5c4cfad8c1eec85732351d80d1b2d0934" + integrity sha512-upM8r0mrsCVA+vPVbJUjtnkAfdleBMHB+Fbxvy3xtbK1IFpzQTUhSOQb6lBnBAPBFGyxMtQ3TytnInckAdYZeg== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/util" "10.1.1" + "@substrate/ss58-registry" "^1.24.0" + +"@polkadot/networks@10.1.4", "@polkadot/networks@^10.1.4": + version "10.1.4" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.1.4.tgz#d8b375aad8f858f611165d8288eb5eab7275ca24" + integrity sha512-5wMwqD+DeVMh29OZZBVkA4DQE9EBsUj5FjmUS2CloA8RzE6SV0qL34zhTwOdq95KJV1OoDbp9aGjCBqhEuozKw== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/util" "10.1.4" + "@substrate/ss58-registry" "^1.25.0" + +"@polkadot/rpc-augment@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-9.2.2.tgz#7246e6a43536296ad19be8460a81e434d718ff4c" + integrity sha512-LbluIgoFtFtN/PTLk0kPErPgMPwj1+ySLn1bNlWjshoE00NeYAIltin9j11iT9g4Zpb+ppSWpsrhO/5crGqERQ== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/rpc-core" "9.2.2" + "@polkadot/types" "9.2.2" + "@polkadot/types-codec" "9.2.2" + "@polkadot/util" "^10.1.4" + +"@polkadot/rpc-core@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-9.2.2.tgz#96b9fd033ecf0d4edf5f2f48c958a1991776b332" + integrity sha512-D+rmC7etJVvlDb7debjF1HDvjqvRnx/b3j7zKpJ3IjjVKWiYyCgQvcyyLyX4lH1f3PHOfEJZP6Q8FNA8B2U7XA== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/rpc-augment" "9.2.2" + "@polkadot/rpc-provider" "9.2.2" + "@polkadot/types" "9.2.2" + "@polkadot/util" "^10.1.4" + rxjs "^7.5.6" + +"@polkadot/rpc-provider@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-9.2.2.tgz#14453b8e80d4f0826dbcbf4e749d5a9397cb6905" + integrity sha512-QnUql17q9ByP+7IyouXJDUPjkvOB1ciCGTwzf98WlOQxr/OEwcaWx0axHSVtMQyhX06ciVIbyI9hIjV5cfT78A== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/keyring" "^10.1.4" + "@polkadot/types" "9.2.2" + "@polkadot/types-support" "9.2.2" + "@polkadot/util" "^10.1.4" + "@polkadot/util-crypto" "^10.1.4" + "@polkadot/x-fetch" "^10.1.4" + "@polkadot/x-global" "^10.1.4" + "@polkadot/x-ws" "^10.1.4" + "@substrate/connect" "0.7.10" eventemitter3 "^4.0.7" mock-socket "^9.1.5" - nock "^13.2.8" + nock "^13.2.9" "@polkadot/ts@0.4.22": version "0.4.22" @@ -657,229 +672,298 @@ dependencies: "@types/chrome" "^0.0.171" -"@polkadot/typegen@8.12.2": - version "8.12.2" - resolved "https://registry.yarnpkg.com/@polkadot/typegen/-/typegen-8.12.2.tgz#b8d4fa567b187a2987804d51c85d66e2c899748a" - integrity sha512-hI33NtlsrMbF22iwT/i3kZ8ZsgScR8GnYztafKVau+8lVbSiA0BCKSHtKhUA8j/G2NsI62pWezsk7pbGJCcwTQ== - dependencies: - "@babel/core" "^7.18.6" - "@babel/register" "^7.18.6" - "@babel/runtime" "^7.18.6" - "@polkadot/api" "8.12.2" - "@polkadot/api-augment" "8.12.2" - "@polkadot/rpc-augment" "8.12.2" - "@polkadot/rpc-provider" "8.12.2" - "@polkadot/types" "8.12.2" - "@polkadot/types-augment" "8.12.2" - "@polkadot/types-codec" "8.12.2" - "@polkadot/types-create" "8.12.2" - "@polkadot/types-support" "8.12.2" - "@polkadot/util" "^10.0.2" - "@polkadot/util-crypto" "^10.0.2" - "@polkadot/x-ws" "^10.0.2" +"@polkadot/typegen@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@polkadot/typegen/-/typegen-9.2.2.tgz#e99ec0c8b6a73e302ab6015008c16a969908a794" + integrity sha512-Bh7cvvT45Vw0A5yJDb4Pp+gIsMaqDg1x/p7QpBFf/RbPL6bORC3hBOxwa36m+RyWhYggNycoxfnKz5eAsdjCFQ== + dependencies: + "@babel/core" "^7.18.10" + "@babel/register" "^7.18.9" + "@babel/runtime" "^7.18.9" + "@polkadot/api" "9.2.2" + "@polkadot/api-augment" "9.2.2" + "@polkadot/rpc-augment" "9.2.2" + "@polkadot/rpc-provider" "9.2.2" + "@polkadot/types" "9.2.2" + "@polkadot/types-augment" "9.2.2" + "@polkadot/types-codec" "9.2.2" + "@polkadot/types-create" "9.2.2" + "@polkadot/types-support" "9.2.2" + "@polkadot/util" "^10.1.4" + "@polkadot/util-crypto" "^10.1.4" + "@polkadot/x-ws" "^10.1.4" handlebars "^4.7.7" websocket "^1.0.34" yargs "^17.5.1" -"@polkadot/types-augment@8.12.2": - version "8.12.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-8.12.2.tgz#b43d21a993d7cf8c7cd4721a2327e19dd924d255" - integrity sha512-47+T12u7HV+g22KryirG7fik5lU1tHgu39wLv8YZ/6jD1hVvgE632fvaCp4qje1F3M82aXobfekO+WOPLCZVsg== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/types" "8.12.2" - "@polkadot/types-codec" "8.12.2" - "@polkadot/util" "^10.0.2" - -"@polkadot/types-codec@8.12.2": - version "8.12.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-8.12.2.tgz#7bec61d0ba751bb2cd72f93b5b81d058fa4affc5" - integrity sha512-NDa2ZJpJMWC9Un3PtvkyJF86M80gLqSmPyjIR8xxp0DzcD5EsCL8EV79xcOWUGm2lws1C66a4t4He/8ZwPNUqg== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/util" "^10.0.2" - "@polkadot/x-bigint" "^10.0.2" - -"@polkadot/types-create@8.12.2": - version "8.12.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-8.12.2.tgz#f5fa6e1b1eb2b60372cd61950b1ab1c4482bcfd6" - integrity sha512-D+Sfj+TwvipO+wl4XbsVkw5AgFdpy5O2JY88CV6L26EGU2OqCcTuenwSGdrsiLWW65m97q9lP7SUphUh39vBhA== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/types-codec" "8.12.2" - "@polkadot/util" "^10.0.2" - -"@polkadot/types-known@8.12.2": - version "8.12.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-8.12.2.tgz#1b8a18be24b4ee624b90831870d9db227f3cb769" - integrity sha512-8HCZ3AkczBrCl+TUZD0+2ubLr0BQx+0f/Nnl9yuz1pWygmSEpHrYspmFtDdpMJnNTGZo8vHNOa7smdlijJqlhw== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/networks" "^10.0.2" - "@polkadot/types" "8.12.2" - "@polkadot/types-codec" "8.12.2" - "@polkadot/types-create" "8.12.2" - "@polkadot/util" "^10.0.2" - -"@polkadot/types-support@8.12.2": - version "8.12.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-8.12.2.tgz#b4f999cc63da21d8b73de621035c9d3e75386d8b" - integrity sha512-tTksJ4COcVonu/beWQKkF/6fKaArmTwM6iCuxn2PuJziS2Cm1+7D8Rh3ODwwZOseFvHPEco6jnb4DWNclXbZiA== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/util" "^10.0.2" - -"@polkadot/types@8.12.2": - version "8.12.2" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-8.12.2.tgz#c5fd35e1d5cfc52b64b6968b16950d7ab19bb8f7" - integrity sha512-hOqLunz4YH51B6AvuemX1cXKf+O8pehEoP3lH+FRKfJ7wyVhqa3WA+aUXhoTQBIuSiOjjC/FEJrRO5AoNO2iCg== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/keyring" "^10.0.2" - "@polkadot/types-augment" "8.12.2" - "@polkadot/types-codec" "8.12.2" - "@polkadot/types-create" "8.12.2" - "@polkadot/util" "^10.0.2" - "@polkadot/util-crypto" "^10.0.2" - rxjs "^7.5.5" - -"@polkadot/util-crypto@10.0.2", "@polkadot/util-crypto@^10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.0.2.tgz#4fd78ebe8d8d95089c8bbff1e4e416fd03f9df4f" - integrity sha512-0uJFvu5cpRBep0/AcpA8vnXH3gnoe+ADiMKD93AekjxrOVqlrjVHKIf+FbiGv1paRKISxoO5Q2j7nCvDsi1q5w== - dependencies: - "@babel/runtime" "^7.18.6" +"@polkadot/types-augment@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-9.2.2.tgz#3ec2aff0a86287f9f9f4ddb0aa5430450d4a684f" + integrity sha512-OyAC/WxNYrJjVp8NXklAeg/380BnFCBo4YgEOT4EhXK8fWzKzanvFAFROKAg78JQBI4LRJKkRyAEWIEzMNGR1Q== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/types" "9.2.2" + "@polkadot/types-codec" "9.2.2" + "@polkadot/util" "^10.1.4" + +"@polkadot/types-codec@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-9.2.2.tgz#8ab24d6208cce7e6abf3c352742045062b7ff588" + integrity sha512-p6E31UQ9Hq0KwKXz5wBXvzrus3v7fY3yHR9EkR8eZvG7rBIHST42JPlfXIxKmnkkXkMxIX1LNSHQy0A8EikVxQ== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/util" "^10.1.4" + "@polkadot/x-bigint" "^10.1.4" + +"@polkadot/types-create@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-9.2.2.tgz#d1e3cf945a0c95b31999673add738c4d585543d8" + integrity sha512-byGoFbkwpMHuqRwZXoD3lrTRkgIB89GlZlXJIfBuNeGE84nWktPCuZw3hBm5LO/qIgp5RFjdfeOCmBvxQ0fzQg== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/types-codec" "9.2.2" + "@polkadot/util" "^10.1.4" + +"@polkadot/types-known@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-9.2.2.tgz#0d3d70eb37796aac06c874cd2b2bc97464f00e6a" + integrity sha512-WHkgoMJg0ZzxOainMjvGhaIa8/m/zwmhH1P+0UqLoZf+oE9EUkjPJaG5oETz4YUa3Nb8uuHfdMl6c5xN3DMIaQ== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/networks" "^10.1.4" + "@polkadot/types" "9.2.2" + "@polkadot/types-codec" "9.2.2" + "@polkadot/types-create" "9.2.2" + "@polkadot/util" "^10.1.4" + +"@polkadot/types-support@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-9.2.2.tgz#d695b54b466bb47c0b376d07e9853d1ae3b17d5e" + integrity sha512-JNcdTyMKGETV7pjE4eZ8eBs82c4ZSY7n1R1/xT/tNZNA6uNdukBxOOkyRHdu5ugEehwCMSpOgruMCNH9e77zLg== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/util" "^10.1.4" + +"@polkadot/types@9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-9.2.2.tgz#b74d098ed8c725f961c3d95b610c49bde1cf5334" + integrity sha512-sDpS/m9oeihkYAYljZzp7xfMkJDLP5nLHSKkLdrh6H9XDVQnKgzJ19/kuAHsU8FCa9E37Al3aSQf/+NR+kCfZw== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/keyring" "^10.1.4" + "@polkadot/types-augment" "9.2.2" + "@polkadot/types-codec" "9.2.2" + "@polkadot/types-create" "9.2.2" + "@polkadot/util" "^10.1.4" + "@polkadot/util-crypto" "^10.1.4" + rxjs "^7.5.6" + +"@polkadot/util-crypto@10.1.1": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.1.1.tgz#c6e16e626e55402fdb44c8bb20ce4a9d7c50b9db" + integrity sha512-R0V++xXbL2pvnCFIuXnKc/TlNhBkyxcno1u8rmjYNuH9S5GOmi2jY/8cNhbrwk6wafBsi+xMPHrEbUnduk82Ag== + dependencies: + "@babel/runtime" "^7.18.9" + "@noble/hashes" "1.1.2" + "@noble/secp256k1" "1.6.3" + "@polkadot/networks" "10.1.1" + "@polkadot/util" "10.1.1" + "@polkadot/wasm-crypto" "^6.3.1" + "@polkadot/x-bigint" "10.1.1" + "@polkadot/x-randomvalues" "10.1.1" + "@scure/base" "1.1.1" + ed2curve "^0.3.0" + tweetnacl "^1.0.3" + +"@polkadot/util-crypto@10.1.4", "@polkadot/util-crypto@^10.1.4": + version "10.1.4" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.1.4.tgz#1d65a9b3d979f1cb078636a413cdf664db760a8b" + integrity sha512-6rdUwCdbwmQ0PBWBNYh55RsXAcFjhco/TGLuM7GJ7YufrN9qqv1sr40HlneLbtpiZnfukZ3q/qOpj0h7Hrw2JQ== + dependencies: + "@babel/runtime" "^7.18.9" "@noble/hashes" "1.1.2" - "@noble/secp256k1" "1.6.0" - "@polkadot/networks" "10.0.2" - "@polkadot/util" "10.0.2" - "@polkadot/wasm-crypto" "^6.2.3" - "@polkadot/x-bigint" "10.0.2" - "@polkadot/x-randomvalues" "10.0.2" + "@noble/secp256k1" "1.6.3" + "@polkadot/networks" "10.1.4" + "@polkadot/util" "10.1.4" + "@polkadot/wasm-crypto" "^6.3.1" + "@polkadot/x-bigint" "10.1.4" + "@polkadot/x-randomvalues" "10.1.4" "@scure/base" "1.1.1" ed2curve "^0.3.0" tweetnacl "^1.0.3" -"@polkadot/util@10.0.2", "@polkadot/util@^10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.0.2.tgz#0ef2b7f5c4e884147c2fd58c4d55f2ee0c437a9a" - integrity sha512-jE1b6Zzltsb/GJV5sFmTSQOlYLd3fipY+DeLS9J+BbsWZW6uUc5x+FNm4pLrYxF1IqiZxwBv1Vi89L14uWZ1rw== +"@polkadot/util@10.1.1": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.1.1.tgz#5aa20eac03806e70dc21e618a7f8cd767dac0fd0" + integrity sha512-/g0sEqOOXfiNmQnWcFK3H1+wKBjbJEfGj6lTmbQ0xnL4TS5mFFQ7ZZEvxD60EkoXVMuCmSSh9E54goNLzh+Zyg== dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/x-bigint" "10.0.2" - "@polkadot/x-global" "10.0.2" - "@polkadot/x-textdecoder" "10.0.2" - "@polkadot/x-textencoder" "10.0.2" + "@babel/runtime" "^7.18.9" + "@polkadot/x-bigint" "10.1.1" + "@polkadot/x-global" "10.1.1" + "@polkadot/x-textdecoder" "10.1.1" + "@polkadot/x-textencoder" "10.1.1" "@types/bn.js" "^5.1.0" bn.js "^5.2.1" -"@polkadot/wasm-bridge@6.2.3": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-6.2.3.tgz#44430710b6f0e7393a69b15decc9123ef5f7ff45" - integrity sha512-kDPcUF5uCZJeJUlWtjk6u4KRy+RTObZbIMgZKiuCcQn9n3EYWadONvStfIyKaiFCc3VFVivzH1cUwTFxxTNHHQ== +"@polkadot/util@10.1.4", "@polkadot/util@^10.1.4": + version "10.1.4" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.1.4.tgz#29654dd52d5028fd9ca175e9cebad605fa79396c" + integrity sha512-MHz1UxYXuV+XxPl+GR++yOUE0OCiVd+eJBqLgpjpVJNRkudbAmfGAbB2TNR0+76M0fevIeHj4DGEd0gY6vqKLw== dependencies: - "@babel/runtime" "^7.18.6" + "@babel/runtime" "^7.18.9" + "@polkadot/x-bigint" "10.1.4" + "@polkadot/x-global" "10.1.4" + "@polkadot/x-textdecoder" "10.1.4" + "@polkadot/x-textencoder" "10.1.4" + "@types/bn.js" "^5.1.0" + bn.js "^5.2.1" + +"@polkadot/wasm-bridge@6.3.1": + version "6.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-6.3.1.tgz#439fa78e80947a7cb695443e1f64b25c30bb1487" + integrity sha512-1TYkHsb9AEFhU9uZj3biEnN2yKQNzdrwSjiTvfCYnt97pnEkKsZI6cku+YPZQv5w/x9CQa5Yua9e2DVVZSivGA== + dependencies: + "@babel/runtime" "^7.18.9" -"@polkadot/wasm-crypto-asmjs@6.2.3": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-6.2.3.tgz#f2e3076bb6013431045d48a56b5ae107cb210e20" - integrity sha512-d/eH02d/XB/vIGIQwyoFB4zNRb3h5PlWoXolGeVSuoa8476ouEdaWhy64mFwXBmjfluaeCOFXRs+QbxetwrDZg== +"@polkadot/wasm-crypto-asmjs@6.3.1": + version "6.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-6.3.1.tgz#e8f469c9cf4a7709c8131a96f857291953f3e30a" + integrity sha512-zbombRfA5v/mUWQQhgg2YwaxhRmxRIrvskw65x+lruax3b6xPBFDs7yplopiJU3r8h2pTgQvX/DUksvqz2TCRQ== dependencies: - "@babel/runtime" "^7.18.6" + "@babel/runtime" "^7.18.9" -"@polkadot/wasm-crypto-init@6.2.3": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-init/-/wasm-crypto-init-6.2.3.tgz#0cf3b59e6492cc63bb8dfb0e238fc599697af5a7" - integrity sha512-jDFD4ITWbvFgsGiRI61lrzI/eobG8VrI9nVCiDBqQZK7mNnGkyIdnFD1prW36uiv6/tkqSiGGvdb7dEKtmsB+Q== +"@polkadot/wasm-crypto-init@6.3.1": + version "6.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-init/-/wasm-crypto-init-6.3.1.tgz#b590220c53c94b9a54d5dc236d0cbe943db76706" + integrity sha512-9yaUBcu+snwjJLmPPGl3cyGRQ1afyFGm16qzTM0sgG/ZCfUlK4uk8KWZe+sBUKgoxb2oXY7Y4WklKgQI1YBdfw== dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/wasm-bridge" "6.2.3" - "@polkadot/wasm-crypto-asmjs" "6.2.3" - "@polkadot/wasm-crypto-wasm" "6.2.3" + "@babel/runtime" "^7.18.9" + "@polkadot/wasm-bridge" "6.3.1" + "@polkadot/wasm-crypto-asmjs" "6.3.1" + "@polkadot/wasm-crypto-wasm" "6.3.1" -"@polkadot/wasm-crypto-wasm@6.2.3": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-6.2.3.tgz#3b47346779881c714e1130374b2f325db9c4fdbf" - integrity sha512-bYRhYPcR4MBLAZz8liozr8E11r7j6RLkNHu80z65lZ5AWgjDu2MgYfKxZFWZxg8rB6+V1uYFmb7czUiSWOn4Rg== +"@polkadot/wasm-crypto-wasm@6.3.1": + version "6.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-6.3.1.tgz#67f720e7f9694fef096abe9d60abbac02e032383" + integrity sha512-idSlzKGVzCfeCMRHsacRvqwojSaTadFxL/Dbls4z1thvfa3U9Ku0d2qVtlwg7Hj+tYWDiuP8Kygs+6bQwfs0XA== dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/wasm-util" "6.2.3" + "@babel/runtime" "^7.18.9" + "@polkadot/wasm-util" "6.3.1" -"@polkadot/wasm-crypto@^6.2.3": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-6.2.3.tgz#1b52c834a1f609d6820035d61cdfda962990ec57" - integrity sha512-Jq08uX16YYySanwN/37n/ZzOFv8T2H4NzLaQNjSGNbFdmKzkrlpw369XRNIVhrKGtK4v09O5ZaF5P9qc0EHgsg== +"@polkadot/wasm-crypto@^6.3.1": + version "6.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-6.3.1.tgz#63f5798aca2b2ff0696f190e6862d9781d8f280c" + integrity sha512-OO8h0qeVkqp4xYZaRVl4iuWOEtq282pNBHDKb6SOJuI2g59eWGcKh4EQU9Me2VP6qzojIqptrkrVt7KQXC68gA== dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/wasm-bridge" "6.2.3" - "@polkadot/wasm-crypto-asmjs" "6.2.3" - "@polkadot/wasm-crypto-init" "6.2.3" - "@polkadot/wasm-crypto-wasm" "6.2.3" - "@polkadot/wasm-util" "6.2.3" + "@babel/runtime" "^7.18.9" + "@polkadot/wasm-bridge" "6.3.1" + "@polkadot/wasm-crypto-asmjs" "6.3.1" + "@polkadot/wasm-crypto-init" "6.3.1" + "@polkadot/wasm-crypto-wasm" "6.3.1" + "@polkadot/wasm-util" "6.3.1" -"@polkadot/wasm-util@6.2.3": - version "6.2.3" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-util/-/wasm-util-6.2.3.tgz#ffccbda4023810ac0e19327830c9bc0d4a5023bc" - integrity sha512-8BQ9gVSrjdc0MPWN9qtNWlMiK+J8dICu1gZJ+cy/hqKjer2MzwX4SeW2wyL5MkYYHjih3ajMRSoSA+/eY2iEwg== +"@polkadot/wasm-util@6.3.1": + version "6.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-util/-/wasm-util-6.3.1.tgz#439ebb68a436317af388ed6438b8f879df3afcda" + integrity sha512-12oAv5J7Yoc9m6jixrSaQCxpOkWOyzHx3DMC8qmLjRiwdBWxqLmImOVRVnFsbaxqSbhBIHRuJphVxWE+GZETDg== dependencies: - "@babel/runtime" "^7.18.6" + "@babel/runtime" "^7.18.9" -"@polkadot/x-bigint@10.0.2", "@polkadot/x-bigint@^10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.0.2.tgz#8b69e1adf59444a6fb4397f9869ec1a9a0de1b1a" - integrity sha512-LtfPi+AyZDNe8jQGVmyDfxGyQDdM6ISZEwJD1ieGd4eUbOkfPmn+1t+0rjtxjISZcyP40fSFcLxtL191jDV8Bw== +"@polkadot/x-bigint@10.1.1": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.1.1.tgz#c084cfdfe48633da07423f4d9916563882947563" + integrity sha512-YNYN64N4icKyqiDIw0tcGyWwz3g/282Kk0ozfcA5TM0wGRe2BwmoB4gYrZ7pJDxvsHnRPR6Dw0r9Xxh8DNIzHQ== dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/x-global" "10.0.2" + "@babel/runtime" "^7.18.9" + "@polkadot/x-global" "10.1.1" -"@polkadot/x-fetch@^10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-10.0.2.tgz#d9e2f2115a3c684fdaa8b9496540f0f421ee3719" - integrity sha512-vsizrcBNeRWWJhE4ZoCUJ0c68wvy3PiR9jH//B1PTV6OaqpdalpwXG6Xtpli8yc0hOOUH/87u8b/x2f/2vhZcQ== +"@polkadot/x-bigint@10.1.4", "@polkadot/x-bigint@^10.1.4": + version "10.1.4" + resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.1.4.tgz#a084a9d2f80f25ffd529faafdf95cd6c3044ef74" + integrity sha512-qgLetTukFhkxNxNcUWMmnrfE9bp4TNbrqNoVBVH7wqSuEVpDPITBXsQ/78LbaaZGWD80Ew0wGxcZ/rqX+dLVUA== dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/x-global" "10.0.2" + "@babel/runtime" "^7.18.9" + "@polkadot/x-global" "10.1.4" + +"@polkadot/x-fetch@^10.1.4": + version "10.1.4" + resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-10.1.4.tgz#72db88007c74f3aee47f72091a33d553f7ca241a" + integrity sha512-hVhLpOvx+ys6klkqWJnINi9FU/JcDnc+6cyU9fa+Dum3mqO1XnngOYDO9mpf5HODIwrFNFmohll9diRP+TW0yQ== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/x-global" "10.1.4" "@types/node-fetch" "^2.6.2" - node-fetch "^3.2.6" + node-fetch "^3.2.10" + +"@polkadot/x-global@10.1.1": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.1.1.tgz#d0d90ef71fd94f59605e8c73dcd1aa3e3dd4fc37" + integrity sha512-wB3rZTTNN14umLSfR2GLL0dJrlGM1YRUNw7XvbA+3B8jxGCIOmjSyAkdZBeiCxg2XIbJD3EkB0hBhga2mNuS6g== + dependencies: + "@babel/runtime" "^7.18.9" + +"@polkadot/x-global@10.1.4", "@polkadot/x-global@^10.1.4": + version "10.1.4" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.1.4.tgz#657f7054fe07a7c027b4d18fcfa3438d2ffaef07" + integrity sha512-67f53H872wHvmjmL96DvhC3dG7gKRG1ghEbHXeFIGwkix+9zGEMV9krYW1+OAvGAuCQZqUIUGiJ7lad4Zjb7wQ== + dependencies: + "@babel/runtime" "^7.18.9" + +"@polkadot/x-randomvalues@10.1.1": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.1.1.tgz#3b1f590e6641e322e3a28bb4f17f0a53005d9ada" + integrity sha512-opVFNEnzCir7cWsFfyDqNlrGazkpjnL+JpkxE/b9WmSco6y0IUzn/Q7rL3EaBzBEvxY0/J8KeSGGs3W+mf6tBQ== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/x-global" "10.1.1" + +"@polkadot/x-randomvalues@10.1.4": + version "10.1.4" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.1.4.tgz#de337a046826223081697e6fc1991c547f685787" + integrity sha512-sfYz3GmyG739anj07Y+8PUX+95upO1zlsADAEfK1w1mMpTw97xEoMZf66CduAQOe43gEwQXc/JuKq794C/Hr7Q== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/x-global" "10.1.4" -"@polkadot/x-global@10.0.2", "@polkadot/x-global@^10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.0.2.tgz#c60b279a34f8a589d076a03978331e9e6a26d283" - integrity sha512-IlxSH36RjcQTImufaJCtvommMmkNWbwOy+/Z7FEOKUOcoiPaUhHU3CzWser+EtClckx7qPLY5lZ59Pxf7HWupQ== +"@polkadot/x-textdecoder@10.1.1": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.1.1.tgz#536d0093749fcc14a60d4ae29c35f699dea7e651" + integrity sha512-a52ah/sUS+aGZcCCL7BhrytAeV/7kiqu1zbuCoZtIzxP6x34a2vcic3bLPoyynLcX2ruzvLKFhJDGOJ4Bq5lcA== dependencies: - "@babel/runtime" "^7.18.6" + "@babel/runtime" "^7.18.9" + "@polkadot/x-global" "10.1.1" -"@polkadot/x-randomvalues@10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.0.2.tgz#b51d58d235e4fae5201f4ef633ee71d8bf23c125" - integrity sha512-kYbNeeOaDEnNqVhIgh8ds9YC79Tji5/HDqQymx7Xb3YmTagdOAe2klrTRJzVfsUKljzhlVOuF3Zcf/PRNbt/2w== +"@polkadot/x-textdecoder@10.1.4": + version "10.1.4" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.1.4.tgz#d85028f6fcd00adc1e3581ab97668a61299270f9" + integrity sha512-B8XcAmJLnuppSr4RUNPevh5MH3tWZBwBR0wUsSdIyiGXuncgnkj9jmpbGLgV1tSn+BGxX3SNsRho3/4CNmndWQ== dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/x-global" "10.0.2" + "@babel/runtime" "^7.18.9" + "@polkadot/x-global" "10.1.4" -"@polkadot/x-textdecoder@10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.0.2.tgz#082ee7d5c2e71985e584a858c7b6069dd59475bd" - integrity sha512-EI1+Osrfadtm4XFfdcjYgV/1yYoPoFaIJfZiPphPSy/4Ceeblmz9T2hWPdJ3uWtPpk6FkhxudB44Y1JuCwXBjg== +"@polkadot/x-textencoder@10.1.1": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.1.1.tgz#c1a86b3d0fe0ca65d30c8ce5c6f75c4035e95847" + integrity sha512-prTzUXXW9OxFyf17EwGSBxe2GvVFG60cmKV8goC50nghhNMl1y0GdGpvKNQTFG6hIk5fIon9/pBpWsas4iAf+Q== dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/x-global" "10.0.2" + "@babel/runtime" "^7.18.9" + "@polkadot/x-global" "10.1.1" -"@polkadot/x-textencoder@10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.0.2.tgz#f3e632ca6d852d3284e6aeef3806bf4450490bf0" - integrity sha512-iTLC700ExtRFsP+fE+dA5CO0xjQ46XeQqbJxa7wJK3aKrzpogyTLZXc0O5ISE1xltOmsQSA9QOELMP113kZkvA== +"@polkadot/x-textencoder@10.1.4": + version "10.1.4" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.1.4.tgz#253e828bb571eb2a92a8377acd57d9bfcbe52fe8" + integrity sha512-vDpo0rVV4jBmr0L2tCZPZzxmzV2vZhpH1Dw9H7MpmZSPePz4ZF+o4RBJz/ocwQh3+1qV1SKQm7+fj4lPwUZdEw== dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/x-global" "10.0.2" + "@babel/runtime" "^7.18.9" + "@polkadot/x-global" "10.1.4" -"@polkadot/x-ws@^10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-10.0.2.tgz#505f33911e301fb1aa07cf0807de738ef52414a5" - integrity sha512-eH8WJ6jKobfUGLRAGj65wKUB2pwbT7RflebQbbcG8Khx9INRjuwLGc+jAiuf0StOZiqVVJsMUayVgsddO8hIvQ== +"@polkadot/x-ws@^10.1.4": + version "10.1.4" + resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-10.1.4.tgz#b3fa515598bc6f8e85d92754d5f1c4be19ca44a1" + integrity sha512-hi7hBRRCLlHgqVW2p5TkoJuTxV7sVprl+aAnmcIpPU4J8Ai6PKQvXR+fLK01T8moBYmH5ztHrBWvY/XRzmQ8Vg== dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/x-global" "10.0.2" + "@babel/runtime" "^7.18.9" + "@polkadot/x-global" "10.1.4" "@types/websocket" "^1.0.5" websocket "^1.0.34" @@ -888,72 +972,64 @@ resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA== -"@sindresorhus/is@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" - integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== +"@sindresorhus/is@^4.6.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" + integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== -"@substrate/connect-extension-protocol@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@substrate/connect-extension-protocol/-/connect-extension-protocol-1.0.0.tgz#d452beda84b3ebfcf0e88592a4695e729a91e858" - integrity sha512-nFVuKdp71hMd/MGlllAOh+a2hAqt8m6J2G0aSsS/RcALZexxF9jodbFc62ni8RDtJboeOfXAHhenYOANvJKPIg== +"@substrate/connect-extension-protocol@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@substrate/connect-extension-protocol/-/connect-extension-protocol-1.0.1.tgz#fa5738039586c648013caa6a0c95c43265dbe77d" + integrity sha512-161JhCC1csjH3GE5mPLEd7HbWtwNSPJBg3p1Ksz9SFlTzj/bgEwudiRN2y5i0MoLGCIJRYKyKGMxVnd29PzNjg== -"@substrate/connect@0.7.7": - version "0.7.7" - resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.7.7.tgz#6d162fcec2f5cfb78c137a82dbb35692655fbe2c" - integrity sha512-uFRF06lC42ZZixxwkzRB61K1uYvR1cTZ7rI98RW7T+eWbCFrafyVk0pk6J+4oN05gZkhou+VK3hrRCU6Doy2xQ== +"@substrate/connect@0.7.10": + version "0.7.10" + resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.7.10.tgz#db49a62188cd830a8dc8848240e635da21f333ff" + integrity sha512-WNdW18e0I696/AQjrAXdMD9W8YaKLTcPr2Cu8scSwiUT40in84KEzi+g+P367cE2etAc+Dvu8vNDEQTbUPNqEg== dependencies: - "@substrate/connect-extension-protocol" "^1.0.0" - "@substrate/smoldot-light" "0.6.19" + "@substrate/connect-extension-protocol" "^1.0.1" + "@substrate/smoldot-light" "0.6.27" eventemitter3 "^4.0.7" -"@substrate/smoldot-light@0.6.19": - version "0.6.19" - resolved "https://registry.yarnpkg.com/@substrate/smoldot-light/-/smoldot-light-0.6.19.tgz#13e897ca9839aecb0dac4ce079ff1cca1dc54cc0" - integrity sha512-Xi+v1cdURhTwx7NH+9fa1U9m7VGP61GvB6qwev9HrZXlGbQiUIvySxPlH/LMsq3mwgiRYkokPhcaZEHufY7Urg== +"@substrate/smoldot-light@0.6.27": + version "0.6.27" + resolved "https://registry.yarnpkg.com/@substrate/smoldot-light/-/smoldot-light-0.6.27.tgz#7e66ad4bfddce4168a6008f6be8c771c881ae585" + integrity sha512-Wy3fbyfZqR3HLynuxeBkUunZsrbqpsmFN+D0/8cVIHZbO7WDwJsmCUc32yO5r+v6s/T97L7FOJHEyMWmRfnKAQ== dependencies: - buffer "^6.0.1" pako "^2.0.4" websocket "^1.0.32" -"@substrate/ss58-registry@^1.23.0": - version "1.23.0" - resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.23.0.tgz#6212bf871a882da98799f8dc51de0944d4152b88" - integrity sha512-LuQje7n48GXSsp1aGI6UEmNVtlh7OzQ6CN1Hd9VGUrshADwMB0lRZ5bxnffmqDR4vVugI7h0NN0AONhIW1eHGg== +"@substrate/ss58-registry@^1.24.0", "@substrate/ss58-registry@^1.25.0": + version "1.25.0" + resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.25.0.tgz#0fcd8c9c0e53963a88fbed41f2cbd8a1a5c74cde" + integrity sha512-LmCH4QJRdHaeLsLTPSgJaXguMoIW+Ig9fA9LRPpeya9HefVAJ7gZuUYinldv+QmX7evNm5CL0rspNUS8l1DvXg== -"@szmarczak/http-timer@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" - integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== +"@szmarczak/http-timer@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-5.0.1.tgz#c7c1bf1141cdd4751b0399c8fc7b8b664cd5be3a" + integrity sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw== dependencies: - defer-to-connect "^1.0.1" + defer-to-connect "^2.0.1" "@tsconfig/node10@^1.0.7": - version "1.0.8" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" - integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg== + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== "@tsconfig/node12@^1.0.7": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c" - integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw== + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== "@tsconfig/node14@^1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2" - integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg== + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== "@tsconfig/node16@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e" - integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA== - -"@types/bn.js@^4.11.5": - version "4.11.6" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" - integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== - dependencies: - "@types/node" "*" + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" + integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== "@types/bn.js@^5.1.0": version "5.1.0" @@ -962,6 +1038,16 @@ dependencies: "@types/node" "*" +"@types/cacheable-request@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.2.tgz#c324da0197de0a98a2312156536ae262429ff6b9" + integrity sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA== + dependencies: + "@types/http-cache-semantics" "*" + "@types/keyv" "*" + "@types/node" "*" + "@types/responselike" "*" + "@types/chai-as-promised@^7.1.5": version "7.1.5" resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-7.1.5.tgz#6e016811f6c7a64f2eed823191c3a6955094e255" @@ -977,9 +1063,9 @@ "@types/chai" "*" "@types/chai@*", "@types/chai@^4.3.1": - version "4.3.1" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.1.tgz#e2c6e73e0bdeb2521d00756d099218e9f5d90a04" - integrity sha512-/zPMqDkzSZ8t3VtxOa4KPq7uzzW978M9Tvh+j7GHKuo6k6GTLxPJ4J5gE5cjfJ26pnXst0N5Hax8Sr0T2Mi9zQ== + version "4.3.3" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.3.tgz#3c90752792660c4b562ad73b3fbd68bf3bc7ae07" + integrity sha512-hC7OMnszpxhZPduX+m+nrx+uFoLkWOMiR4oa/AZF3MuSETYTZmFfJAHqZEM8MVlvfG7BEUcgvtwoCTxBp6hm3g== "@types/chrome@^0.0.171": version "0.0.171" @@ -1006,11 +1092,28 @@ resolved "https://registry.yarnpkg.com/@types/har-format/-/har-format-1.2.8.tgz#e6908b76d4c88be3db642846bb8b455f0bfb1c4e" integrity sha512-OP6L9VuZNdskgNN3zFQQ54ceYD8OLq5IbqO4VK91ORLfOm7WdT/CiT/pHEBSQEqCInJ2y3O6iCm/zGtPElpgJQ== +"@types/http-cache-semantics@*": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" + integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== + +"@types/json-buffer@~3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/json-buffer/-/json-buffer-3.0.0.tgz#85c1ff0f0948fc159810d4b5be35bf8c20875f64" + integrity sha512-3YP80IxxFJB4b5tYC2SUPwkg0XQLiu0nWvhRgEatgjf+29IcWO9X1k8xRv5DGssJ/lCrjYTjQPcobJr2yWIVuQ== + "@types/json-schema@^7.0.9": version "7.0.11" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== +"@types/keyv@*": + version "3.1.4" + resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6" + integrity sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg== + dependencies: + "@types/node" "*" + "@types/mocha@^9.1.1": version "9.1.1" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" @@ -1024,16 +1127,21 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@^17.0.35": - version "17.0.41" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.41.tgz#1607b2fd3da014ae5d4d1b31bc792a39348dfb9b" - integrity sha512-xA6drNNeqb5YyV5fO3OAEsnXLfO7uF0whiOfPTz5AeDo8KeZFmODKnvwPymMNO8qE/an8pVY/O50tig2SQCrGw== +"@types/node@*": + version "18.7.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.5.tgz#f1c1d4b7d8231c0278962347163656f9c36f3e83" + integrity sha512-NcKK6Ts+9LqdHJaW6HQmgr7dT/i3GOHG+pt6BiWv++5SnjtRd4NXeiuN2kA153SjhXPR/AhHIPHPbrsbpUVOww== "@types/node@^12.12.6": version "12.20.55" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== +"@types/node@^17.0.35": + version "17.0.45" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.45.tgz#2c0fafd78705e7a18b7906b5201a522719dc5190" + integrity sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw== + "@types/pbkdf2@^3.0.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" @@ -1041,6 +1149,13 @@ dependencies: "@types/node" "*" +"@types/responselike@*", "@types/responselike@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" + integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== + dependencies: + "@types/node" "*" + "@types/secp256k1@^4.0.1": version "4.0.3" resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" @@ -1056,13 +1171,13 @@ "@types/node" "*" "@typescript-eslint/eslint-plugin@^5.26.0": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.27.1.tgz#fdf59c905354139046b41b3ed95d1609913d0758" - integrity sha512-6dM5NKT57ZduNnJfpY81Phe9nc9wolnMCnknb1im6brWi1RYv84nbMS3olJa27B6+irUVV1X/Wb+Am0FjJdGFw== + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.33.1.tgz#c0a480d05211660221eda963cc844732fe9b1714" + integrity sha512-S1iZIxrTvKkU3+m63YUOxYPKaP+yWDQrdhxTglVDVEVBf+aCSw85+BmJnyUaQQsk5TXFG/LpBu9fa+LrAQ91fQ== dependencies: - "@typescript-eslint/scope-manager" "5.27.1" - "@typescript-eslint/type-utils" "5.27.1" - "@typescript-eslint/utils" "5.27.1" + "@typescript-eslint/scope-manager" "5.33.1" + "@typescript-eslint/type-utils" "5.33.1" + "@typescript-eslint/utils" "5.33.1" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -1071,68 +1186,68 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.26.0": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.27.1.tgz#3a4dcaa67e45e0427b6ca7bb7165122c8b569639" - integrity sha512-7Va2ZOkHi5NP+AZwb5ReLgNF6nWLGTeUJfxdkVUAPPSaAdbWNnFZzLZ4EGGmmiCTg+AwlbE1KyUYTBglosSLHQ== + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.33.1.tgz#e4b253105b4d2a4362cfaa4e184e2d226c440ff3" + integrity sha512-IgLLtW7FOzoDlmaMoXdxG8HOCByTBXrB1V2ZQYSEV1ggMmJfAkMWTwUjjzagS6OkfpySyhKFkBw7A9jYmcHpZA== dependencies: - "@typescript-eslint/scope-manager" "5.27.1" - "@typescript-eslint/types" "5.27.1" - "@typescript-eslint/typescript-estree" "5.27.1" + "@typescript-eslint/scope-manager" "5.33.1" + "@typescript-eslint/types" "5.33.1" + "@typescript-eslint/typescript-estree" "5.33.1" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.27.1.tgz#4d1504392d01fe5f76f4a5825991ec78b7b7894d" - integrity sha512-fQEOSa/QroWE6fAEg+bJxtRZJTH8NTskggybogHt4H9Da8zd4cJji76gA5SBlR0MgtwF7rebxTbDKB49YUCpAg== +"@typescript-eslint/scope-manager@5.33.1": + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.33.1.tgz#8d31553e1b874210018ca069b3d192c6d23bc493" + integrity sha512-8ibcZSqy4c5m69QpzJn8XQq9NnqAToC8OdH/W6IXPXv83vRyEDPYLdjAlUx8h/rbusq6MkW4YdQzURGOqsn3CA== dependencies: - "@typescript-eslint/types" "5.27.1" - "@typescript-eslint/visitor-keys" "5.27.1" + "@typescript-eslint/types" "5.33.1" + "@typescript-eslint/visitor-keys" "5.33.1" -"@typescript-eslint/type-utils@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.27.1.tgz#369f695199f74c1876e395ebea202582eb1d4166" - integrity sha512-+UC1vVUWaDHRnC2cQrCJ4QtVjpjjCgjNFpg8b03nERmkHv9JV9X5M19D7UFMd+/G7T/sgFwX2pGmWK38rqyvXw== +"@typescript-eslint/type-utils@5.33.1": + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.33.1.tgz#1a14e94650a0ae39f6e3b77478baff002cec4367" + integrity sha512-X3pGsJsD8OiqhNa5fim41YtlnyiWMF/eKsEZGsHID2HcDqeSC5yr/uLOeph8rNF2/utwuI0IQoAK3fpoxcLl2g== dependencies: - "@typescript-eslint/utils" "5.27.1" + "@typescript-eslint/utils" "5.33.1" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.27.1.tgz#34e3e629501349d38be6ae97841298c03a6ffbf1" - integrity sha512-LgogNVkBhCTZU/m8XgEYIWICD6m4dmEDbKXESCbqOXfKZxRKeqpiJXQIErv66sdopRKZPo5l32ymNqibYEH/xg== +"@typescript-eslint/types@5.33.1": + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.33.1.tgz#3faef41793d527a519e19ab2747c12d6f3741ff7" + integrity sha512-7K6MoQPQh6WVEkMrMW5QOA5FO+BOwzHSNd0j3+BlBwd6vtzfZceJ8xJ7Um2XDi/O3umS8/qDX6jdy2i7CijkwQ== -"@typescript-eslint/typescript-estree@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.1.tgz#7621ee78607331821c16fffc21fc7a452d7bc808" - integrity sha512-DnZvvq3TAJ5ke+hk0LklvxwYsnXpRdqUY5gaVS0D4raKtbznPz71UJGnPTHEFo0GDxqLOLdMkkmVZjSpET1hFw== +"@typescript-eslint/typescript-estree@5.33.1": + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.1.tgz#a573bd360790afdcba80844e962d8b2031984f34" + integrity sha512-JOAzJ4pJ+tHzA2pgsWQi4804XisPHOtbvwUyqsuuq8+y5B5GMZs7lI1xDWs6V2d7gE/Ez5bTGojSK12+IIPtXA== dependencies: - "@typescript-eslint/types" "5.27.1" - "@typescript-eslint/visitor-keys" "5.27.1" + "@typescript-eslint/types" "5.33.1" + "@typescript-eslint/visitor-keys" "5.33.1" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.27.1.tgz#b4678b68a94bc3b85bf08f243812a6868ac5128f" - integrity sha512-mZ9WEn1ZLDaVrhRaYgzbkXBkTPghPFsup8zDbbsYTxC5OmqrFE7skkKS/sraVsLP3TcT3Ki5CSyEFBRkLH/H/w== +"@typescript-eslint/utils@5.33.1": + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.33.1.tgz#171725f924fe1fe82bb776522bb85bc034e88575" + integrity sha512-uphZjkMaZ4fE8CR4dU7BquOV6u0doeQAr8n6cQenl/poMaIyJtBu8eys5uk6u5HiDH01Mj5lzbJ5SfeDz7oqMQ== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.27.1" - "@typescript-eslint/types" "5.27.1" - "@typescript-eslint/typescript-estree" "5.27.1" + "@typescript-eslint/scope-manager" "5.33.1" + "@typescript-eslint/types" "5.33.1" + "@typescript-eslint/typescript-estree" "5.33.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.27.1": - version "5.27.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.1.tgz#05a62666f2a89769dac2e6baa48f74e8472983af" - integrity sha512-xYs6ffo01nhdJgPieyk7HAOpjhTsx7r/oB9LWEhwAXgwn33tkr+W8DI2ChboqhZlC4q3TC6geDYPoiX8ROqyOQ== +"@typescript-eslint/visitor-keys@5.33.1": + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.1.tgz#0155c7571c8cd08956580b880aea327d5c34a18b" + integrity sha512-nwIxOK8Z2MPWltLKMLOEZwmfBZReqUdbEoHQXeCpa+sRVARe5twpJGHCB4dk9903Yaf0nMAlGbQfaAH92F60eg== dependencies: - "@typescript-eslint/types" "5.27.1" + "@typescript-eslint/types" "5.33.1" eslint-visitor-keys "^3.3.0" "@ungap/promise-all-settled@1.1.2": @@ -1140,6 +1255,11 @@ resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== +abortcontroller-polyfill@^1.7.3: + version "1.7.3" + resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.3.tgz#1b5b487bd6436b5b764fd52a612509702c3144b5" + integrity sha512-zetDJxd89y3X99Kvo4qFx8GKlt6GsvN3UcRZHwU6iFA/0KiOmhkTVhe8oRoTBiTVPZu09x3vCra47+w8Yz1+2Q== + accepts@~1.3.8: version "1.3.8" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" @@ -1158,10 +1278,10 @@ acorn-walk@^8.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== -acorn@^8.4.1, acorn@^8.7.1: - version "8.7.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" - integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== +acorn@^8.4.1, acorn@^8.8.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" + integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: version "6.12.6" @@ -1302,9 +1422,9 @@ bcrypt-pbkdf@^1.0.0: tweetnacl "^0.14.3" bignumber.js@^9.0.0, bignumber.js@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.2.tgz#71c6c6bed38de64e24a65ebe16cfcf23ae693673" - integrity sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw== + version "9.1.0" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.0.tgz#8d340146107fe3a6cb8d40699643c302e8773b62" + integrity sha512-4LwHK4nfDOraBCtst+wOWIHbu1vhvAPJK8g8nROd4iuc3PSEjWif/qwbkh8jwCJz6yDBvtU4KPynETgrfh7y3A== binary-extensions@^2.0.0: version "2.2.0" @@ -1441,15 +1561,14 @@ browserify-sign@^4.0.0: safe-buffer "^5.2.0" browserslist@^4.20.2: - version "4.20.4" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.4.tgz#98096c9042af689ee1e0271333dbc564b8ce4477" - integrity sha512-ok1d+1WpnU24XYN7oC3QWgTyMhY/avPJ/r9T00xxvUOIparA/gc+UPUMaod3i+G6s+nI2nUb9xZ5k794uIwShw== + version "4.21.3" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.3.tgz#5df277694eb3c48bc5c4b05af3e8b7e09c5a6d1a" + integrity sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ== dependencies: - caniuse-lite "^1.0.30001349" - electron-to-chromium "^1.4.147" - escalade "^3.1.1" - node-releases "^2.0.5" - picocolors "^1.0.0" + caniuse-lite "^1.0.30001370" + electron-to-chromium "^1.4.202" + node-releases "^2.0.6" + update-browserslist-db "^1.0.5" bs58@^4.0.0: version "4.0.1" @@ -1490,14 +1609,6 @@ buffer@^5.0.5, buffer@^5.5.0, buffer@^5.6.0: base64-js "^1.3.1" ieee754 "^1.1.13" -buffer@^6.0.1: - version "6.0.3" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" - integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.2.1" - bufferutil@^4.0.1: version "4.0.6" resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.6.tgz#ebd6c67c7922a0e902f053e5d8be5ec850e48433" @@ -1510,18 +1621,23 @@ bytes@3.1.2: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== -cacheable-request@^6.0.0: +cacheable-lookup@^6.0.4: version "6.1.0" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" - integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-6.1.0.tgz#0330a543471c61faa4e9035db583aad753b36385" + integrity sha512-KJ/Dmo1lDDhmW2XDPMo+9oiy/CeqosPguPCrgcVzKyZrL6pM1gU2GmPY/xo6OQPTUaA/c0kwHuywB4E6nmT9ww== + +cacheable-request@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.2.tgz#ea0d0b889364a25854757301ca12b2da77f91d27" + integrity sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew== dependencies: clone-response "^1.0.2" get-stream "^5.1.0" http-cache-semantics "^4.0.0" - keyv "^3.0.0" + keyv "^4.0.0" lowercase-keys "^2.0.0" - normalize-url "^4.1.0" - responselike "^1.0.2" + normalize-url "^6.0.1" + responselike "^2.0.0" call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" @@ -1541,10 +1657,10 @@ camelcase@^6.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001349: - version "1.0.30001352" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001352.tgz#cc6f5da3f983979ad1e2cdbae0505dccaa7c6a12" - integrity sha512-GUgH8w6YergqPQDGWhJGt8GDRnY0L/iJVQcU3eJ46GYf52R8tk0Wxp0PymuFVZboJYXGiCqwozAYZNRjVj6IcA== +caniuse-lite@^1.0.30001370: + version "1.0.30001377" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001377.tgz#fa446cef27f25decb0c7420759c9ea17a2221a70" + integrity sha512-I5XeHI1x/mRSGl96LFOaSk528LA/yZG3m3iQgImGujjO8gotd/DL8QaI1R1h1dg5ATeI2jqPblMpKq4Tr5iKfQ== caseless@~0.12.0: version "0.12.0" @@ -1661,9 +1777,9 @@ clone-deep@^4.0.1: shallow-clone "^3.0.0" clone-response@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - integrity sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q== + version "1.0.3" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.3.tgz#af2032aa47816399cf5f0a1d0db902f517abb8c3" + integrity sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA== dependencies: mimic-response "^1.0.0" @@ -1718,6 +1834,14 @@ commondir@^1.0.1: resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== +compress-brotli@^1.3.8: + version "1.3.8" + resolved "https://registry.yarnpkg.com/compress-brotli/-/compress-brotli-1.3.8.tgz#0c0a60c97a989145314ec381e84e26682e7b38db" + integrity sha512-lVcQsjhxhIXsuupfy9fmZUFtAIdBmXA7EGY6GBdgZ++qkM9zG4YFT8iU7FoBxzryNDMOpD1HIFHUSX4D87oqhQ== + dependencies: + "@types/json-buffer" "~3.0.0" + json-buffer "~3.0.1" + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -1761,11 +1885,6 @@ cookie@0.5.0: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== -cookiejar@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.3.tgz#fc7a6216e408e74414b90230050842dacda75acc" - integrity sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ== - core-util-is@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -1820,6 +1939,13 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== +cross-fetch@^3.1.4: + version "3.1.5" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" + integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== + dependencies: + node-fetch "2.6.7" + cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -1890,7 +2016,7 @@ decode-uri-component@^0.2.0: resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og== -decompress-response@^3.2.0, decompress-response@^3.3.0: +decompress-response@^3.2.0: version "3.3.0" resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" integrity sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA== @@ -1916,10 +2042,10 @@ deep-is@^0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== -defer-to-connect@^1.0.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" - integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== +defer-to-connect@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" + integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== define-properties@^1.1.3, define-properties@^1.1.4: version "1.1.4" @@ -1991,9 +2117,9 @@ dom-walk@^0.1.0: integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - integrity sha512-CEj8FwwNA4cVH2uFCoHUrmojhYh1vmCdOaneKJXwkeY1i9jnlslVo9dx+hQ5Hl9GnH/Bwy/IjxAyOePyPKYnzA== + version "0.1.5" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.5.tgz#0b5e4d7bad5de8901ea4440624c8e1d20099217e" + integrity sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA== ecc-jsbn@~0.1.1: version "0.1.2" @@ -2015,10 +2141,10 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== -electron-to-chromium@^1.4.147: - version "1.4.150" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.150.tgz#89f0e12505462d5df7e56c5b91aff7e1dfdd33ec" - integrity sha512-MP3oBer0X7ZeS9GJ0H6lmkn561UxiwOIY9TTkdxVY7lI9G6GVCKfgJaHaDcakwdKxBXA4T3ybeswH/WBIN/KTA== +electron-to-chromium@^1.4.202: + version "1.4.221" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.221.tgz#1ff8425d257a8bfc8269d552a426993c5b525471" + integrity sha512-aWg2mYhpxZ6Q6Xvyk7B2ziBca4YqrCDlXzmcD7wuRs65pVEVkMT1u2ifdjpAQais2O2o0rW964ZWWWYRlAL/kw== elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.3, elliptic@^6.5.4: version "6.5.4" @@ -2089,9 +2215,9 @@ es-to-primitive@^1.2.1: is-symbol "^1.0.2" es5-ext@^0.10.35, es5-ext@^0.10.50: - version "0.10.61" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.61.tgz#311de37949ef86b6b0dcea894d1ffedb909d3269" - integrity sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA== + version "0.10.62" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.62.tgz#5e6adc19a6da524bf3d1e02bbc8960e5eb49a9a5" + integrity sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA== dependencies: es6-iterator "^2.0.3" es6-symbol "^3.1.3" @@ -2106,6 +2232,11 @@ es6-iterator@^2.0.3: es5-ext "^0.10.35" es6-symbol "^3.1.1" +es6-promise@^4.2.8: + version "4.2.8" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" + integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== + es6-symbol@^3.1.1, es6-symbol@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" @@ -2168,12 +2299,13 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.16.0: - version "8.17.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.17.0.tgz#1cfc4b6b6912f77d24b874ca1506b0fe09328c21" - integrity sha512-gq0m0BTJfci60Fz4nczYxNAlED+sMcihltndR8t9t1evnU/azx53x3t2UHXC/uRjcbvRw/XctpaNygSTcQD+Iw== + version "8.22.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.22.0.tgz#78fcb044196dfa7eef30a9d65944f6f980402c48" + integrity sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA== dependencies: "@eslint/eslintrc" "^1.3.0" - "@humanwhocodes/config-array" "^0.9.2" + "@humanwhocodes/config-array" "^0.10.4" + "@humanwhocodes/gitignore-to-minimatch" "^1.0.2" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -2183,14 +2315,17 @@ eslint@^8.16.0: eslint-scope "^7.1.1" eslint-utils "^3.0.0" eslint-visitor-keys "^3.3.0" - espree "^9.3.2" + espree "^9.3.3" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" + find-up "^5.0.0" functional-red-black-tree "^1.0.1" glob-parent "^6.0.1" globals "^13.15.0" + globby "^11.1.0" + grapheme-splitter "^1.0.4" ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" @@ -2208,12 +2343,12 @@ eslint@^8.16.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^9.3.2: - version "9.3.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.2.tgz#f58f77bd334731182801ced3380a8cc859091596" - integrity sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA== +espree@^9.3.2, espree@^9.3.3: + version "9.3.3" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.3.tgz#2dd37c4162bb05f433ad3c1a52ddf8a49dc08e9d" + integrity sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng== dependencies: - acorn "^8.7.1" + acorn "^8.8.0" acorn-jsx "^5.3.2" eslint-visitor-keys "^3.3.0" @@ -2308,7 +2443,7 @@ ethereum-cryptography@^0.1.3: secp256k1 "^4.0.1" setimmediate "^1.0.5" -ethereumjs-util@^7.0.10, ethereumjs-util@^7.1.0, ethereumjs-util@^7.1.4, ethereumjs-util@^7.1.5: +ethereumjs-util@^7.0.10, ethereumjs-util@^7.1.0, ethereumjs-util@^7.1.5: version "7.1.5" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz#9ecf04861e4fbbeed7465ece5f23317ad1129181" integrity sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg== @@ -2490,7 +2625,7 @@ find-process@^1.4.7: commander "^5.1.0" debug "^4.1.1" -find-up@5.0.0: +find-up@5.0.0, find-up@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== @@ -2519,9 +2654,9 @@ flat@^5.0.2: integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== flatted@^3.1.0: - version "3.2.5" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" - integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== + version "3.2.6" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.6.tgz#022e9218c637f9f3fc9c35ab9c9193f05add60b2" + integrity sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ== follow-redirects@^1.12.1: version "1.15.1" @@ -2540,6 +2675,11 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== +form-data-encoder@1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.1.tgz#ac80660e4f87ee0d3d3c3638b7da8278ddb8ec96" + integrity sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg== + form-data@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" @@ -2655,13 +2795,6 @@ get-stream@^3.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" integrity sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ== -get-stream@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - get-stream@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" @@ -2669,6 +2802,11 @@ get-stream@^5.1.0: dependencies: pump "^3.0.0" +get-stream@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + get-symbol-description@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" @@ -2736,9 +2874,9 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.15.0: - version "13.15.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.15.0.tgz#38113218c907d2f7e98658af246cef8b77e90bac" - integrity sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog== + version "13.17.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.17.0.tgz#902eb1e680a41da93945adbdcb5a9f361ba69bd4" + integrity sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw== dependencies: type-fest "^0.20.2" @@ -2754,22 +2892,24 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" -got@9.6.0: - version "9.6.0" - resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" - integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== - dependencies: - "@sindresorhus/is" "^0.14.0" - "@szmarczak/http-timer" "^1.1.2" - cacheable-request "^6.0.0" - decompress-response "^3.3.0" - duplexer3 "^0.1.4" - get-stream "^4.1.0" - lowercase-keys "^1.0.1" - mimic-response "^1.0.1" - p-cancelable "^1.0.0" - to-readable-stream "^1.0.0" - url-parse-lax "^3.0.0" +got@12.1.0: + version "12.1.0" + resolved "https://registry.yarnpkg.com/got/-/got-12.1.0.tgz#099f3815305c682be4fd6b0ee0726d8e4c6b0af4" + integrity sha512-hBv2ty9QN2RdbJJMK3hesmSkFTjVIHyIDDbssCKnSmq62edGgImJWD10Eb1k77TiV1bxloxqcFAVK8+9pkhOig== + dependencies: + "@sindresorhus/is" "^4.6.0" + "@szmarczak/http-timer" "^5.0.1" + "@types/cacheable-request" "^6.0.2" + "@types/responselike" "^1.0.0" + cacheable-lookup "^6.0.4" + cacheable-request "^7.0.2" + decompress-response "^6.0.0" + form-data-encoder "1.7.1" + get-stream "^6.0.1" + http2-wrapper "^2.1.10" + lowercase-keys "^3.0.0" + p-cancelable "^3.0.0" + responselike "^2.0.0" got@^7.1.0: version "7.1.0" @@ -2796,6 +2936,11 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + handlebars@^4.7.7: version "4.7.7" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" @@ -2848,7 +2993,7 @@ has-symbol-support-x@^1.4.1: resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== -has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: +has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== @@ -2935,6 +3080,14 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" +http2-wrapper@^2.1.10: + version "2.1.11" + resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-2.1.11.tgz#d7c980c7ffb85be3859b6a96c800b2951ae257ef" + integrity sha512-aNAk5JzLturWEUiuhAN73Jcbq96R7rTitAoXV54FYMatvihnpD2+6PUgU4ce3D/m5VDbw+F5CsyKSF176ptitQ== + dependencies: + quick-lru "^5.1.1" + resolve-alpn "^1.2.0" + iconv-lite@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -2949,7 +3102,7 @@ idna-uts46-hx@^2.3.1: dependencies: punycode "2.1.0" -ieee754@^1.1.13, ieee754@^1.2.1: +ieee754@^1.1.13: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -3236,10 +3389,10 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -json-buffer@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" - integrity sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ== +json-buffer@3.0.1, json-buffer@~3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== json-schema-traverse@^0.4.1: version "0.4.1" @@ -3292,12 +3445,13 @@ keccak@^3.0.0: node-gyp-build "^4.2.0" readable-stream "^3.6.0" -keyv@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" - integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== +keyv@^4.0.0: + version "4.3.3" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.3.3.tgz#6c1bcda6353a9e96fc1b4e1aeb803a6e35090ba9" + integrity sha512-AcysI17RvakTh8ir03+a3zJr5r0ovnAH/XTXei/4HIv3bL2K/jzvgivLK9UuI/JbU1aJjM3NSAnVvVVd3n+4DQ== dependencies: - json-buffer "3.0.0" + compress-brotli "^1.3.8" + json-buffer "3.0.1" kind-of@^6.0.2: version "6.0.3" @@ -3352,7 +3506,7 @@ loupe@^2.3.1: dependencies: get-func-name "^2.0.0" -lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: +lowercase-keys@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== @@ -3362,6 +3516,11 @@ lowercase-keys@^2.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== +lowercase-keys@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-3.0.0.tgz#c5e7d442e37ead247ae9db117a9d0a467c89d4f2" + integrity sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ== + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -3449,7 +3608,7 @@ mime@1.6.0: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -mimic-response@^1.0.0, mimic-response@^1.0.1: +mimic-response@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== @@ -3652,10 +3811,10 @@ next-tick@^1.1.0: resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== -nock@^13.2.8: - version "13.2.8" - resolved "https://registry.yarnpkg.com/nock/-/nock-13.2.8.tgz#e2043ccaa8e285508274575e090a7fe1e46b90f1" - integrity sha512-JT42FrXfQRpfyL4cnbBEJdf4nmBpVP0yoCcSBr+xkT8Q1y3pgtaCKHGAAOIFcEJ3O3t0QbVAmid0S0f2bj3Wpg== +nock@^13.2.9: + version "13.2.9" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.2.9.tgz#4faf6c28175d36044da4cfa68e33e5a15086ad4c" + integrity sha512-1+XfJNYF1cjGB+TKMWi29eZ0b82QOvQs2YoLNzbpWGqFMtRQHTa57osqdGj4FrFPgkO4D4AZinzUJR9VvW3QUA== dependencies: debug "^4.1.0" json-stringify-safe "^5.0.1" @@ -3672,34 +3831,41 @@ node-domexception@^1.0.0: resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== -node-fetch@^3.2.6: - version "3.2.6" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.2.6.tgz#6d4627181697a9d9674aae0d61548e0d629b31b9" - integrity sha512-LAy/HZnLADOVkVPubaxHDft29booGglPFDr2Hw0J1AercRh01UiVFm++KMDnJeH9sHgNB4hsXPii7Sgym/sTbw== +node-fetch@2.6.7: + version "2.6.7" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + dependencies: + whatwg-url "^5.0.0" + +node-fetch@^3.2.10: + version "3.2.10" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.2.10.tgz#e8347f94b54ae18b57c9c049ef641cef398a85c8" + integrity sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA== dependencies: data-uri-to-buffer "^4.0.0" fetch-blob "^3.1.4" formdata-polyfill "^4.0.10" node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.4.0.tgz#42e99687ce87ddeaf3a10b99dc06abc11021f3f4" - integrity sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ== + version "4.5.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.5.0.tgz#7a64eefa0b21112f89f58379da128ac177f20e40" + integrity sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg== -node-releases@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.5.tgz#280ed5bc3eba0d96ce44897d8aee478bfb3d9666" - integrity sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q== +node-releases@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" + integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -normalize-url@^4.1.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" - integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== +normalize-url@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" + integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== number-to-bn@1.7.0: version "1.7.0" @@ -3730,13 +3896,13 @@ object-keys@^1.1.1: integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== object.assign@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" - integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== + version "4.1.3" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.3.tgz#d36b7700ddf0019abb6b1df1bb13f6445f79051f" + integrity sha512-ZFJnX3zltyjcYJL0RoCJuzb+11zWGyaDbjgxZbdV7rFEcHQuYxrZqhow67aA7xpes6LhojyFDaBKAFfogQrikA== dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - has-symbols "^1.0.1" + call-bind "^1.0.2" + define-properties "^1.1.4" + has-symbols "^1.0.3" object-keys "^1.1.1" oboe@2.1.5: @@ -3782,10 +3948,10 @@ p-cancelable@^0.3.0: resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" integrity sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw== -p-cancelable@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" - integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== +p-cancelable@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-3.0.0.tgz#63826694b54d61ca1c20ebcb6d3ecf5e14cd8050" + integrity sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw== p-finally@^1.0.0: version "1.0.0" @@ -3953,11 +4119,6 @@ prepend-http@^1.0.1: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" integrity sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg== -prepend-http@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" - integrity sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA== - process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" @@ -3977,9 +4138,9 @@ proxy-addr@~2.0.7: ipaddr.js "1.9.1" psl@^1.1.28: - version "1.8.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== + version "1.9.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" + integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== public-encrypt@^4.0.0: version "4.0.3" @@ -4037,6 +4198,11 @@ queue-microtask@^1.2.2: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== +quick-lru@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" + integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== + randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -4133,17 +4299,22 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== +resolve-alpn@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" + integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== + resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -responselike@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" - integrity sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ== +responselike@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.1.tgz#9a0bc8fdc252f3fb1cca68b016591059ba1422bc" + integrity sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw== dependencies: - lowercase-keys "^1.0.0" + lowercase-keys "^2.0.0" reusify@^1.0.4: version "1.0.4" @@ -4179,10 +4350,10 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^7.5.5: - version "7.5.5" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.5.tgz#2ebad89af0f560f460ad5cc4213219e1f7dd4e9f" - integrity sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw== +rxjs@^7.5.6: + version "7.5.6" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.6.tgz#0446577557862afd6903517ce7cae79ecb9662bc" + integrity sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw== dependencies: tslib "^2.1.0" @@ -4502,12 +4673,12 @@ tar@^4.0.2: text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== timed-out@^4.0.0, timed-out@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" - integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= + integrity sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA== tmp@0.0.33: version "0.0.33" @@ -4519,12 +4690,7 @@ tmp@0.0.33: to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= - -to-readable-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" - integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== to-regex-range@^5.0.1: version "5.0.1" @@ -4546,10 +4712,15 @@ tough-cookie@~2.5.0: psl "^1.1.28" punycode "^2.1.1" +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + ts-node@^10.8.0: - version "10.8.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.8.1.tgz#ea2bd3459011b52699d7e88daa55a45a1af4f066" - integrity sha512-Wwsnao4DQoJsN034wePSg5nZiw4YKXf56mPIAeD6wVmiv+RytNSWqc2f3fKvcUoV+Yn2+yocD71VOfQHbmVX4g== + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== dependencies: "@cspotcode/source-map-support" "^0.8.0" "@tsconfig/node10" "^1.0.7" @@ -4585,7 +4756,7 @@ tsutils@^3.21.0: tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== dependencies: safe-buffer "^5.0.1" @@ -4597,7 +4768,7 @@ tweetnacl@1.x.x, tweetnacl@^1.0.3: tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" @@ -4630,9 +4801,9 @@ type@^1.0.1: integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== type@^2.5.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/type/-/type-2.6.0.tgz#3ca6099af5981d36ca86b78442973694278a219f" - integrity sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ== + version "2.7.2" + resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" + integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== typedarray-to-buffer@^3.1.5: version "3.1.5" @@ -4642,14 +4813,14 @@ typedarray-to-buffer@^3.1.5: is-typedarray "^1.0.0" typescript@^4.7.2: - version "4.7.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" - integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== + version "4.7.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" + integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== uglify-js@^3.1.4: - version "3.16.0" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.16.0.tgz#b778ba0831ca102c1d8ecbdec2d2bdfcc7353190" - integrity sha512-FEikl6bR30n0T3amyBh3LoiBdqHRy/f4H80+My34HOesOKyHfOsxAPAxOoqC0JUnC1amnO0IwkYC3sko51caSw== + version "3.16.3" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.16.3.tgz#94c7a63337ee31227a18d03b8a3041c210fd1f1d" + integrity sha512-uVbFqx9vvLhQg0iBaau9Z75AxWJ8tqM9AV890dIZCLApF4rTcyHwmAvLeEdYRs+BzYWu8Iw81F79ah0EfTXbaw== ultron@~1.1.0: version "1.1.1" @@ -4674,7 +4845,15 @@ universalify@^0.1.0: unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== + +update-browserslist-db@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.5.tgz#be06a5eedd62f107b7c19eb5bcefb194411abf38" + integrity sha512-dteFFpCyvuDdr9S/ff1ISkKt/9YZxKjI9WlRR99c180GaztJtRa/fn18FdxGVKVsnPY7/a/FDN68mcvUmP4U7Q== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" uri-js@^4.2.2: version "4.4.1" @@ -4686,26 +4865,19 @@ uri-js@^4.2.2: url-parse-lax@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" - integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= + integrity sha512-BVA4lR5PIviy2PMseNd2jbFQ+jwSwQGdJejf5ctd1rEXt0Ypd7yanUK9+lYechVlN5VaTJGsu2U/3MDDu6KgBA== dependencies: prepend-http "^1.0.1" -url-parse-lax@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" - integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= - dependencies: - prepend-http "^2.0.0" - url-set-query@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339" - integrity sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk= + integrity sha512-3AChu4NiXquPfeckE5R5cGdiHCMWJx1dwCWOmWIL4KHAziJNOFIYJlpGFeKDvwLPHovZRCxK3cYlwzqI9Vp+Gg== url-to-options@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" - integrity sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k= + integrity sha512-0kQLIzG4fdk/G5NONku64rSH/x32NOA39LVQqlK8Le6lvTF6GGRJpqaQFGgU+CLwySIqBSMdwYM0sYcW9f6P4A== utf-8-validate@^5.0.2: version "5.0.9" @@ -4722,7 +4894,7 @@ utf8@3.0.0: util-deprecate@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== util@^0.12.0: version "0.12.4" @@ -4739,7 +4911,7 @@ util@^0.12.0: utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== uuid@3.3.2: version "3.3.2" @@ -4769,12 +4941,12 @@ varint@^5.0.0: vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== dependencies: assert-plus "^1.0.0" core-util-is "1.0.2" @@ -4785,85 +4957,85 @@ web-streams-polyfill@^3.0.3: resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== -web3-bzz@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.7.3.tgz#6860a584f748838af5e3932b6798e024ab8ae951" - integrity sha512-y2i2IW0MfSqFc1JBhBSQ59Ts9xE30hhxSmLS13jLKWzie24/An5dnoGarp2rFAy20tevJu1zJVPYrEl14jiL5w== +web3-bzz@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.7.5.tgz#edeb262c3a6619109763077a94172513cf07cdde" + integrity sha512-Z53sY0YK/losqjJncmL4vP0zZI9r6tiXg6o7R6e1JD2Iy7FH3serQvU+qXmPjqEBzsnhf8wTG+YcBPB3RHpr0Q== dependencies: "@types/node" "^12.12.6" - got "9.6.0" + got "12.1.0" swarm-js "^0.1.40" -web3-core-helpers@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.7.3.tgz#9a8d7830737d0e9c48694b244f4ce0f769ba67b9" - integrity sha512-qS2t6UKLhRV/6C7OFHtMeoHphkcA+CKUr2vfpxy4hubs3+Nj28K9pgiqFuvZiXmtEEwIAE2A28GBOC3RdcSuFg== +web3-core-helpers@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.7.5.tgz#e97b3ecac787ade4b9390807a86aca78ed97872b" + integrity sha512-lDDjTks6Q6aNUO87RYrY2xub3UWTKr/RIWxpHJODEqkLxZS1dWdyliJ6aIx3031VQwsNT5HE7NvABe/t0p3iDQ== dependencies: - web3-eth-iban "1.7.3" - web3-utils "1.7.3" + web3-eth-iban "1.7.5" + web3-utils "1.7.5" -web3-core-method@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.7.3.tgz#eb2a4f140448445c939518c0fa6216b3d265c5e9" - integrity sha512-SeF8YL/NVFbj/ddwLhJeS0io8y7wXaPYA2AVT0h2C2ESYkpvOtQmyw2Bc3aXxBmBErKcbOJjE2ABOKdUmLSmMA== +web3-core-method@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.7.5.tgz#ffe8883c169468f0e4d13509377f2d8876d9b7be" + integrity sha512-ApTvq1Llzlbxmy0n4L7QaE6NodIsR80VJqk8qN4kLg30SGznt/pNJFebryLI2kpyDmxSgj1TjEWzmHJBp6FhYg== dependencies: - "@ethersproject/transactions" "^5.0.0-beta.135" - web3-core-helpers "1.7.3" - web3-core-promievent "1.7.3" - web3-core-subscriptions "1.7.3" - web3-utils "1.7.3" + "@ethersproject/transactions" "^5.6.2" + web3-core-helpers "1.7.5" + web3-core-promievent "1.7.5" + web3-core-subscriptions "1.7.5" + web3-utils "1.7.5" -web3-core-promievent@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.7.3.tgz#2d0eeef694569b61355054c721578f67df925b80" - integrity sha512-+mcfNJLP8h2JqcL/UdMGdRVfTdm+bsoLzAFtLpazE4u9kU7yJUgMMAqnK59fKD3Zpke3DjaUJKwz1TyiGM5wig== +web3-core-promievent@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.7.5.tgz#56a9b06a20e20a0a89d2ab7f88d44c8ae01d5b62" + integrity sha512-uZ1VRErVuhiLtHlyt3oEH/JSvAf6bWPndChHR9PG7i1Zfqm6ZVCeM91ICTPmiL8ddsGQOxASpnJk4vhApcTIww== dependencies: eventemitter3 "4.0.4" -web3-core-requestmanager@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.7.3.tgz#226f79d16e546c9157d00908de215e984cae84e9" - integrity sha512-bC+jeOjPbagZi2IuL1J5d44f3zfPcgX+GWYUpE9vicNkPUxFBWRG+olhMo7L+BIcD57cTmukDlnz+1xBULAjFg== +web3-core-requestmanager@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.7.5.tgz#be18fc99642689aeb2e016fa43fb47bb9e8c94ce" + integrity sha512-3KpfxW/wVH4mgwWEsSJGHKrtRVoijWlDxtUrm17xgtqRNZ2mFolifKnHAUKa0fY48C9CrxmcCiMIi3W4G6WYRw== dependencies: util "^0.12.0" - web3-core-helpers "1.7.3" - web3-providers-http "1.7.3" - web3-providers-ipc "1.7.3" - web3-providers-ws "1.7.3" + web3-core-helpers "1.7.5" + web3-providers-http "1.7.5" + web3-providers-ipc "1.7.5" + web3-providers-ws "1.7.5" -web3-core-subscriptions@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.7.3.tgz#ca456dfe2c219a0696c5cf34c13b03c3599ec5d5" - integrity sha512-/i1ZCLW3SDxEs5mu7HW8KL4Vq7x4/fDXY+yf/vPoDljlpvcLEOnI8y9r7om+0kYwvuTlM6DUHHafvW0221TyRQ== +web3-core-subscriptions@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.7.5.tgz#c0e25610768ea9d9f9107b4ac74b6b6573125e00" + integrity sha512-YK6utQ7Wwjbe4XZOIA8quWGBPi1lFDS1A+jQYwxKKrCvm6BloBNc3FhvrcSYlDhLe/kOy8+2Je8i9amndgT4ww== dependencies: eventemitter3 "4.0.4" - web3-core-helpers "1.7.3" + web3-core-helpers "1.7.5" -web3-core@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.7.3.tgz#2ef25c4cc023997f43af9f31a03b571729ff3cda" - integrity sha512-4RNxueGyevD1XSjdHE57vz/YWRHybpcd3wfQS33fgMyHZBVLFDNwhn+4dX4BeofVlK/9/cmPAokLfBUStZMLdw== +web3-core@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.7.5.tgz#8ee2ca490230a30ca970cb9f308eb65b76405e1d" + integrity sha512-UgOWXZr1fR/3cUQJKWbfMwRxj1/N7o6RSd/dHqdXBlOD+62EjNZItFmLRg5veq5kp9YfXzrNw9bnDkXfsL+nKQ== dependencies: - "@types/bn.js" "^4.11.5" + "@types/bn.js" "^5.1.0" "@types/node" "^12.12.6" bignumber.js "^9.0.0" - web3-core-helpers "1.7.3" - web3-core-method "1.7.3" - web3-core-requestmanager "1.7.3" - web3-utils "1.7.3" + web3-core-helpers "1.7.5" + web3-core-method "1.7.5" + web3-core-requestmanager "1.7.5" + web3-utils "1.7.5" -web3-eth-abi@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.7.3.tgz#2a1123c7252c37100eecd0b1fb2fb2c51366071f" - integrity sha512-ZlD8DrJro0ocnbZViZpAoMX44x5aYAb73u2tMq557rMmpiluZNnhcCYF/NnVMy6UIkn7SF/qEA45GXA1ne6Tnw== +web3-eth-abi@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.7.5.tgz#db9d6dbcc043a6e922252f3228686e9bbd50d7c9" + integrity sha512-qWHvF7sayxql9BD1yqK9sZRLBQ66eJzGeaU53Y1PRq2iFPrhY6NUWxQ3c3ps0rg+dyObvRbloviWpKXcS4RE/A== dependencies: - "@ethersproject/abi" "5.0.7" - web3-utils "1.7.3" + "@ethersproject/abi" "^5.6.3" + web3-utils "1.7.5" -web3-eth-accounts@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.7.3.tgz#cd1789000f13ed3c438e96b3e80ee7be8d3f1a9b" - integrity sha512-aDaWjW1oJeh0LeSGRVyEBiTe/UD2/cMY4dD6pQYa8dOhwgMtNQjxIQ7kacBBXe7ZKhjbIFZDhvXN4mjXZ82R2Q== +web3-eth-accounts@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.7.5.tgz#b37ee3aeebcc6bce3337636aeb272cbba0ece547" + integrity sha512-AzMLoTj3RGwKpyp3x3TtHrEeU4VpR99iMOD6NKrWSDumS6QEi0lCo+y7QZhdTlINw3iIA3SFIdvbAOO4NCHSDg== dependencies: "@ethereumjs/common" "^2.5.0" "@ethereumjs/tx" "^3.3.2" @@ -4872,127 +5044,129 @@ web3-eth-accounts@1.7.3: ethereumjs-util "^7.0.10" scrypt-js "^3.0.1" uuid "3.3.2" - web3-core "1.7.3" - web3-core-helpers "1.7.3" - web3-core-method "1.7.3" - web3-utils "1.7.3" + web3-core "1.7.5" + web3-core-helpers "1.7.5" + web3-core-method "1.7.5" + web3-utils "1.7.5" -web3-eth-contract@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.7.3.tgz#c4efc118ed7adafbc1270b633f33e696a39c7fc7" - integrity sha512-7mjkLxCNMWlQrlfM/MmNnlKRHwFk5XrZcbndoMt3KejcqDP6dPHi2PZLutEcw07n/Sk8OMpSamyF3QiGfmyRxw== - dependencies: - "@types/bn.js" "^4.11.5" - web3-core "1.7.3" - web3-core-helpers "1.7.3" - web3-core-method "1.7.3" - web3-core-promievent "1.7.3" - web3-core-subscriptions "1.7.3" - web3-eth-abi "1.7.3" - web3-utils "1.7.3" - -web3-eth-ens@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.7.3.tgz#ebc56a4dc7007f4f899259bbae1237d3095e2f3f" - integrity sha512-q7+hFGHIc0mBI3LwgRVcLCQmp6GItsWgUtEZ5bjwdjOnJdbjYddm7PO9RDcTDQ6LIr7hqYaY4WTRnDHZ6BEt5Q== +web3-eth-contract@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.7.5.tgz#a032419579bcec062513a3d089ad0e89ac63d731" + integrity sha512-qab7NPJRKRlTs58ozsqK8YIEwWpxIm3vD/okSIKBGkFx5gIHWW+vGmMh5PDSfefLJM9rCd+T+Lc0LYvtME7uqg== + dependencies: + "@types/bn.js" "^5.1.0" + web3-core "1.7.5" + web3-core-helpers "1.7.5" + web3-core-method "1.7.5" + web3-core-promievent "1.7.5" + web3-core-subscriptions "1.7.5" + web3-eth-abi "1.7.5" + web3-utils "1.7.5" + +web3-eth-ens@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.7.5.tgz#fa0e287f5e6fae20531117b7467e21b482d58cab" + integrity sha512-k1Q0msdRv/wac2egpZBIwG3n/sa/KdrVmVJvFm471gLTL4xfUizV5qJjkDVf+ikf9JyDvWJTs5eWNUUbOFIw/A== dependencies: content-hash "^2.5.2" eth-ens-namehash "2.0.8" - web3-core "1.7.3" - web3-core-helpers "1.7.3" - web3-core-promievent "1.7.3" - web3-eth-abi "1.7.3" - web3-eth-contract "1.7.3" - web3-utils "1.7.3" - -web3-eth-iban@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.7.3.tgz#47433a73380322bba04e17b91fccd4a0e63a390a" - integrity sha512-1GPVWgajwhh7g53mmYDD1YxcftQniIixMiRfOqlnA1w0mFGrTbCoPeVaSQ3XtSf+rYehNJIZAUeDBnONVjXXmg== + web3-core "1.7.5" + web3-core-helpers "1.7.5" + web3-core-promievent "1.7.5" + web3-eth-abi "1.7.5" + web3-eth-contract "1.7.5" + web3-utils "1.7.5" + +web3-eth-iban@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.7.5.tgz#1a50efa42cabf1b731396d38bef6a8bf92b5ee1f" + integrity sha512-mn2W5t/1IpL8OZvzAabLKT4kvwRnZSJ9K0tctndl9sDNWkfITYQibEEhUaNNA50Q5fJKgVudHI/m0gwIVTyG8Q== dependencies: - bn.js "^4.11.9" - web3-utils "1.7.3" + bn.js "^5.2.1" + web3-utils "1.7.5" -web3-eth-personal@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.7.3.tgz#ca2464dca356d4335aa8141cf75a6947f10f45a6" - integrity sha512-iTLz2OYzEsJj2qGE4iXC1Gw+KZN924fTAl0ESBFs2VmRhvVaM7GFqZz/wx7/XESl3GVxGxlRje3gNK0oGIoYYQ== +web3-eth-personal@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.7.5.tgz#615a3ddcf97aeea93e2a4569753c033fd7a495c5" + integrity sha512-txh2P/eN8I4AOUKFi9++KKddoD0tWfCuu9Y1Kc41jSRbk6smO88Fum0KWNmYFYhSCX2qiknS1DfqsONl3igoKQ== dependencies: "@types/node" "^12.12.6" - web3-core "1.7.3" - web3-core-helpers "1.7.3" - web3-core-method "1.7.3" - web3-net "1.7.3" - web3-utils "1.7.3" - -web3-eth@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.7.3.tgz#9e92785ea18d682548b6044551abe7f2918fc0b5" - integrity sha512-BCIRMPwaMlTCbswXyGT6jj9chCh9RirbDFkPtvqozfQ73HGW7kP78TXXf9+Xdo1GjutQfxi/fQ9yPdxtDJEpDA== - dependencies: - web3-core "1.7.3" - web3-core-helpers "1.7.3" - web3-core-method "1.7.3" - web3-core-subscriptions "1.7.3" - web3-eth-abi "1.7.3" - web3-eth-accounts "1.7.3" - web3-eth-contract "1.7.3" - web3-eth-ens "1.7.3" - web3-eth-iban "1.7.3" - web3-eth-personal "1.7.3" - web3-net "1.7.3" - web3-utils "1.7.3" - -web3-net@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.7.3.tgz#54e35bcc829fdc40cf5001a3870b885d95069810" - integrity sha512-zAByK0Qrr71k9XW0Adtn+EOuhS9bt77vhBO6epAeQ2/VKl8rCGLAwrl3GbeEl7kWa8s/su72cjI5OetG7cYR0g== - dependencies: - web3-core "1.7.3" - web3-core-method "1.7.3" - web3-utils "1.7.3" - -web3-providers-http@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.7.3.tgz#8ea5e39f6ceee0b5bc4e45403fae75cad8ff4cf7" - integrity sha512-TQJfMsDQ5Uq9zGMYlu7azx1L7EvxW+Llks3MaWn3cazzr5tnrDbGh6V17x6LN4t8tFDHWx0rYKr3mDPqyTjOZw== - dependencies: - web3-core-helpers "1.7.3" - xhr2-cookies "1.1.0" - -web3-providers-ipc@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.7.3.tgz#a34872103a8d37a03795fa2f9b259e869287dcaa" - integrity sha512-Z4EGdLKzz6I1Bw+VcSyqVN4EJiT2uAro48Am1eRvxUi4vktGoZtge1ixiyfrRIVb6nPe7KnTFl30eQBtMqS0zA== + web3-core "1.7.5" + web3-core-helpers "1.7.5" + web3-core-method "1.7.5" + web3-net "1.7.5" + web3-utils "1.7.5" + +web3-eth@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.7.5.tgz#36906f50a6c35570cbc08871a33caa83dc131c9c" + integrity sha512-BucjvqZyDWYkGlsFX+OnOBub0YutlC1KZiNGibdmvtNX0NQK+8iw1uzAoL9yTTwCSszL7lnkFe8N+HCOl9B4Dw== + dependencies: + web3-core "1.7.5" + web3-core-helpers "1.7.5" + web3-core-method "1.7.5" + web3-core-subscriptions "1.7.5" + web3-eth-abi "1.7.5" + web3-eth-accounts "1.7.5" + web3-eth-contract "1.7.5" + web3-eth-ens "1.7.5" + web3-eth-iban "1.7.5" + web3-eth-personal "1.7.5" + web3-net "1.7.5" + web3-utils "1.7.5" + +web3-net@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.7.5.tgz#87fbc00a9ca40515bf60c847c0092498887cfdc8" + integrity sha512-xwuCb2YWw49PmW81AJQ/G+Xi2ikRsYyZXSgyPt4LmZuKjiqg/6kSdK8lZvUi3Pi3wM+QDBXbpr73M/WEkW0KvA== + dependencies: + web3-core "1.7.5" + web3-core-method "1.7.5" + web3-utils "1.7.5" + +web3-providers-http@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.7.5.tgz#144bb0c29007d1b766bafb0e20f80be050c7aa80" + integrity sha512-vPgr4Kzy0M3CHtoP/Bh7qwK/D9h2fhjpoqctdMWVJseOfeTgfOphCKN0uwV8w2VpZgDPXA8aeTdBx5OjmDdStA== + dependencies: + abortcontroller-polyfill "^1.7.3" + cross-fetch "^3.1.4" + es6-promise "^4.2.8" + web3-core-helpers "1.7.5" + +web3-providers-ipc@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.7.5.tgz#5b0f9b4f7340416953b8816d2e42e3f548d47372" + integrity sha512-aNHx+RAROzO+apDEzy8Zncj78iqWBadIXtpmFDg7uiTn8i+oO+IcP1Yni7jyzkltsysVJHgHWG4kPx50ANCK3Q== dependencies: oboe "2.1.5" - web3-core-helpers "1.7.3" + web3-core-helpers "1.7.5" -web3-providers-ws@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.7.3.tgz#87564facc47387c9004a043a6686e4881ed6acfe" - integrity sha512-PpykGbkkkKtxPgv7U4ny4UhnkqSZDfLgBEvFTXuXLAngbX/qdgfYkhIuz3MiGplfL7Yh93SQw3xDjImXmn2Rgw== +web3-providers-ws@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.7.5.tgz#196b9e56a4a48f9bee54def56875ea53dec7c711" + integrity sha512-9uJNVVkIGC8PmM9kNbgPth56HDMSSsxZh3ZEENdwO3LNWemaADiQYUDCsD/dMVkn0xsGLHP5dgAy4Q5msqySLg== dependencies: eventemitter3 "4.0.4" - web3-core-helpers "1.7.3" + web3-core-helpers "1.7.5" websocket "^1.0.32" -web3-shh@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.7.3.tgz#84e10adf628556798244b58f73cda1447bb7075e" - integrity sha512-bQTSKkyG7GkuULdZInJ0osHjnmkHij9tAySibpev1XjYdjLiQnd0J9YGF4HjvxoG3glNROpuCyTaRLrsLwaZuw== +web3-shh@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.7.5.tgz#742e27f5c44bea6d7adef3a49b085e0fcd6aa621" + integrity sha512-aCIWJyLMH5H76OybU4ZpUCJ93yNOPATGhJ+KboRPU8QZDzS2CcVhtEzyl27bbvw+rSnVroMLqBgTXBB4mmKI7A== dependencies: - web3-core "1.7.3" - web3-core-method "1.7.3" - web3-core-subscriptions "1.7.3" - web3-net "1.7.3" + web3-core "1.7.5" + web3-core-method "1.7.5" + web3-core-subscriptions "1.7.5" + web3-net "1.7.5" -web3-utils@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.7.3.tgz#b214d05f124530d8694ad364509ac454d05f207c" - integrity sha512-g6nQgvb/bUpVUIxJE+ezVN+rYwYmlFyMvMIRSuqpi1dk6ApDD00YNArrk7sPcZnjvxOJ76813Xs2vIN2rgh4lg== +web3-utils@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.7.5.tgz#081a952ac6e0322e25ac97b37358a43c7372ef6a" + integrity sha512-9AqNOziQky4wNQadEwEfHiBdOZqopIHzQQVzmvvv6fJwDSMhP+khqmAZC7YTiGjs0MboyZ8tWNivqSO1699XQw== dependencies: - bn.js "^4.11.9" + bn.js "^5.2.1" ethereum-bloom-filters "^1.0.6" ethereumjs-util "^7.1.0" ethjs-unit "0.1.6" @@ -5001,17 +5175,22 @@ web3-utils@1.7.3: utf8 "3.0.0" web3@^1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.7.3.tgz#30fe786338b2cc775881cb28c056ee5da4be65b8" - integrity sha512-UgBvQnKIXncGYzsiGacaiHtm0xzQ/JtGqcSO/ddzQHYxnNuwI72j1Pb4gskztLYihizV9qPNQYHMSCiBlStI9A== - dependencies: - web3-bzz "1.7.3" - web3-core "1.7.3" - web3-eth "1.7.3" - web3-eth-personal "1.7.3" - web3-net "1.7.3" - web3-shh "1.7.3" - web3-utils "1.7.3" + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3/-/web3-1.7.5.tgz#4e185d2058195b5775109b3f27cdea65a34a036e" + integrity sha512-3jHZTWyXt975AOXgnZKayiSWDLpoSKk9fZtLk1hURQtt7AdSbXPT8AK9ooBCm0Dt3GYaOeNcHGaiHC3gtyqhLg== + dependencies: + web3-bzz "1.7.5" + web3-core "1.7.5" + web3-eth "1.7.5" + web3-eth-personal "1.7.5" + web3-net "1.7.5" + web3-shh "1.7.5" + web3-utils "1.7.5" + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== websocket@^1.0.32, websocket@^1.0.34: version "1.0.34" @@ -5025,6 +5204,14 @@ websocket@^1.0.32, websocket@^1.0.34: utf-8-validate "^5.0.2" yaeti "^0.0.6" +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" @@ -5063,7 +5250,7 @@ word-wrap@^1.2.3: wordwrap@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== workerpool@6.2.1: version "6.2.1" @@ -5082,7 +5269,7 @@ wrap-ansi@^7.0.0: wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== ws@^3.0.0: version "3.3.3" @@ -5113,13 +5300,6 @@ xhr-request@^1.0.1, xhr-request@^1.1.0: url-set-query "^1.0.0" xhr "^2.0.4" -xhr2-cookies@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz#7d77449d0999197f155cb73b23df72505ed89d48" - integrity sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg= - dependencies: - cookiejar "^2.1.1" - xhr@^2.0.4, xhr@^2.3.3: version "2.6.0" resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.6.0.tgz#b69d4395e792b4173d6b7df077f0fc5e4e2b249d" @@ -5143,7 +5323,7 @@ y18n@^5.0.5: yaeti@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" - integrity sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc= + integrity sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug== yallist@^3.0.0, yallist@^3.1.1: version "3.1.1" @@ -5166,9 +5346,9 @@ yargs-parser@^20.2.2: integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== yargs-parser@^21.0.0: - version "21.0.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35" - integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== yargs-unparser@2.0.0: version "2.0.0" From a5762ef0b03cf85aa5f61c2e307b1ded03edb1e8 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 16 Aug 2022 13:33:54 +0000 Subject: [PATCH 0422/1274] upgrade: test types --- tests/src/interfaces/augment-api-consts.ts | 10 +- tests/src/interfaces/augment-api-errors.ts | 15 +- tests/src/interfaces/augment-api-events.ts | 41 +- tests/src/interfaces/augment-api-query.ts | 15 +- tests/src/interfaces/augment-api-rpc.ts | 28 +- tests/src/interfaces/augment-api-runtime.ts | 248 + tests/src/interfaces/augment-api-tx.ts | 76 +- tests/src/interfaces/augment-api.ts | 1 + tests/src/interfaces/augment-types.ts | 95 +- tests/src/interfaces/default/types.ts | 76 +- tests/src/interfaces/lookup.ts | 3712 +++++++-------- tests/src/interfaces/registry.ts | 9 +- tests/src/interfaces/types-lookup.ts | 4554 ++++++++++--------- 13 files changed, 4722 insertions(+), 4158 deletions(-) create mode 100644 tests/src/interfaces/augment-api-runtime.ts diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index 1f9b07e013..fbcdedd375 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -1,14 +1,20 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { ApiTypes } from '@polkadot/api-base/types'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/api-base/types/consts'; + +import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types'; import type { Option, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { Codec } from '@polkadot/types-codec/types'; import type { Permill } from '@polkadot/types/interfaces/runtime'; import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup'; +export type __AugmentedConst = AugmentedConst; + declare module '@polkadot/api-base/types/consts' { - export interface AugmentedConsts { + interface AugmentedConsts { balances: { /** * The minimum amount required to keep an account open. diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 56b0adab44..4148088679 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -1,10 +1,16 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { ApiTypes } from '@polkadot/api-base/types'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/api-base/types/errors'; + +import type { ApiTypes, AugmentedError } from '@polkadot/api-base/types'; + +export type __AugmentedError = AugmentedError; declare module '@polkadot/api-base/types/errors' { - export interface AugmentedErrors { + interface AugmentedErrors { balances: { /** * Beneficiary account must pre-exist @@ -652,6 +658,11 @@ declare module '@polkadot/api-base/types/errors' { [key: string]: AugmentedError; }; treasury: { + /** + * The spend origin is valid but the amount it is allowed to spend is lower than the + * amount to be spent. + **/ + InsufficientPermission: AugmentedError; /** * Proposer's balance is too low. **/ diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index 26901e1e2e..c812cba6f9 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -1,14 +1,20 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { ApiTypes } from '@polkadot/api-base/types'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/api-base/types/events'; + +import type { ApiTypes, AugmentedEvent } from '@polkadot/api-base/types'; import type { Bytes, Null, Option, Result, U256, U8aFixed, bool, u128, u32, u64, u8 } from '@polkadot/types-codec'; import type { ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime'; import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; +export type __AugmentedEvent = AugmentedEvent; + declare module '@polkadot/api-base/types/events' { - export interface AugmentedEvents { + interface AugmentedEvents { balances: { /** * A balance was set by root. @@ -463,6 +469,17 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; + transactionPayment: { + /** + * A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee, + * has been paid by `who`. + **/ + TransactionFeePaid: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; treasury: { /** * Some funds have been allocated. @@ -488,6 +505,10 @@ declare module '@polkadot/api-base/types/events' { * Spending has finished; this is the amount that rolls over until next spend. **/ Rollover: AugmentedEvent; + /** + * A new spend proposal has been approved. + **/ + SpendApproved: AugmentedEvent; /** * We have ended a spend period and will now allocate funds. **/ @@ -602,35 +623,35 @@ declare module '@polkadot/api-base/types/events' { /** * Bad XCM format used. **/ - BadFormat: AugmentedEvent]>; + BadFormat: AugmentedEvent], { messageHash: Option }>; /** * Bad XCM version used. **/ - BadVersion: AugmentedEvent]>; + BadVersion: AugmentedEvent], { messageHash: Option }>; /** * Some XCM failed. **/ - Fail: AugmentedEvent, XcmV2TraitsError]>; + Fail: AugmentedEvent, error: XcmV2TraitsError, weight: u64], { messageHash: Option, error: XcmV2TraitsError, weight: u64 }>; /** * An XCM exceeded the individual message weight budget. **/ - OverweightEnqueued: AugmentedEvent; + OverweightEnqueued: AugmentedEvent; /** * An XCM from the overweight queue was executed with the given actual weight used. **/ - OverweightServiced: AugmentedEvent; + OverweightServiced: AugmentedEvent; /** * Some XCM was executed ok. **/ - Success: AugmentedEvent]>; + Success: AugmentedEvent, weight: u64], { messageHash: Option, weight: u64 }>; /** * An upward message was sent to the relay chain. **/ - UpwardMessageSent: AugmentedEvent]>; + UpwardMessageSent: AugmentedEvent], { messageHash: Option }>; /** * An HRMP message was sent to a sibling parachain. **/ - XcmpMessageSent: AugmentedEvent]>; + XcmpMessageSent: AugmentedEvent], { messageHash: Option }>; /** * Generic event **/ diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 57fc0efdf2..852f6e22f1 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -1,15 +1,22 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { ApiTypes } from '@polkadot/api-base/types'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/api-base/types/storage'; + +import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types'; import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime'; import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsTokenChild } from '@polkadot/types/lookup'; import type { Observable } from '@polkadot/types/types'; +export type __AugmentedQuery = AugmentedQuery unknown>; +export type __QueryableStorageEntry = QueryableStorageEntry; + declare module '@polkadot/api-base/types/storage' { - export interface AugmentedQueries { + interface AugmentedQueries { balances: { /** * The Balances pallet example of storing the balance of an account. @@ -362,6 +369,10 @@ declare module '@polkadot/api-base/types/storage' { * by the system inherent. **/ lastHrmpMqcHeads: AugmentedQuery Observable>, []> & QueryableStorageEntry; + /** + * The relay chain block number associated with the last parachain block. + **/ + lastRelayChainBlockNumber: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Validation code that is set by the parachain and is to be communicated to collator and * consequently the relay-chain. diff --git a/tests/src/interfaces/augment-api-rpc.ts b/tests/src/interfaces/augment-api-rpc.ts index f462d50d15..7e220fca8e 100644 --- a/tests/src/interfaces/augment-api-rpc.ts +++ b/tests/src/interfaces/augment-api-rpc.ts @@ -1,10 +1,14 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/rpc-core/types/jsonrpc'; + import type { PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsPartPartType, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionStats, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsRpcCollection, UpDataStructsTokenChild, UpDataStructsTokenData } from './default'; import type { AugmentedRpc } from '@polkadot/rpc-core/types'; import type { Metadata, StorageKey } from '@polkadot/types'; -import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, u128, u32, u64 } from '@polkadot/types-codec'; +import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, f64, u128, u32, u64 } from '@polkadot/types-codec'; import type { AnyNumber, Codec } from '@polkadot/types-codec/types'; import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; import type { EpochAuthorship } from '@polkadot/types/interfaces/babe'; @@ -15,7 +19,7 @@ import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; import type { CodeUploadRequest, CodeUploadResult, ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts'; import type { BlockStats } from '@polkadot/types/interfaces/dev'; import type { CreatedBlock } from '@polkadot/types/interfaces/engine'; -import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth'; +import type { EthAccount, EthCallRequest, EthFeeHistory, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth'; import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics'; import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa'; import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr'; @@ -27,8 +31,10 @@ import type { MigrationStatusResult, ReadProof, RuntimeVersion, TraceBlockRespon import type { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system'; import type { IExtrinsic, Observable } from '@polkadot/types/types'; +export type __AugmentedRpc = AugmentedRpc<() => unknown>; + declare module '@polkadot/rpc-core/types/jsonrpc' { - export interface RpcInterface { + interface RpcInterface { author: { /** * Returns true if the keystore has private keys for the given public key and key type. @@ -57,11 +63,11 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Submit and subscribe to watch an extrinsic until unsubscribed **/ - submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable>; + submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable>; /** * Submit a fully formatted extrinsic for block inclusion **/ - submitExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable>; + submitExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable>; }; babe: { /** @@ -198,6 +204,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { * Estimate gas needed for execution of given contract. **/ estimateGas: AugmentedRpc<(request: EthCallRequest | { from?: any; to?: any; gasPrice?: any; gas?: any; value?: any; data?: any; nonce?: any } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable>; + /** + * Returns fee history for given block count & reward percentiles + **/ + feeHistory: AugmentedRpc<(blockCount: U256 | AnyNumber | Uint8Array, newestBlock: BlockNumber | AnyNumber | Uint8Array, rewardPercentiles: Option> | null | Uint8Array | Vec | (f64)[]) => Observable>; /** * Returns current gas price. **/ @@ -290,6 +300,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { * Returns the number of hashes per second that the node is mining with. **/ hashrate: AugmentedRpc<() => Observable>; + /** + * Returns max priority fee per gas + **/ + maxPriorityFeePerGas: AugmentedRpc<() => Observable>; /** * Returns true if client is actively mining new blocks. **/ @@ -449,7 +463,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Get Theme's keys values **/ - themes: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, themeName: Text | string, keys: Option> | null | object | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; + themes: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, themeName: Text | string, keys: Option> | null | Uint8Array | Vec | (Text | string)[], at?: Hash | string | Uint8Array) => Observable>>; }; rpc: { /** @@ -537,7 +551,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Provides a way to trace the re-execution of a single block **/ - traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option | null | object | string | Uint8Array, storageKeys: Option | null | object | string | Uint8Array, methods: Option | null | object | string | Uint8Array) => Observable>; + traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option | null | Uint8Array | Text | string, storageKeys: Option | null | Uint8Array | Text | string, methods: Option | null | Uint8Array | Text | string) => Observable>; /** * Check current migration state **/ diff --git a/tests/src/interfaces/augment-api-runtime.ts b/tests/src/interfaces/augment-api-runtime.ts new file mode 100644 index 0000000000..7eb79bd3b4 --- /dev/null +++ b/tests/src/interfaces/augment-api-runtime.ts @@ -0,0 +1,248 @@ +// Auto-generated via `yarn polkadot-types-from-chain`, do not edit +/* eslint-disable */ + +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/api-base/types/calls'; + +import type { ApiTypes, AugmentedCall, DecoratedCallBase } from '@polkadot/api-base/types'; +import type { Bytes, Null, Option, Result, U256, Vec, bool, u256, u32, u64 } from '@polkadot/types-codec'; +import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; +import type { CheckInherentsResult, InherentData } from '@polkadot/types/interfaces/blockbuilder'; +import type { BlockHash } from '@polkadot/types/interfaces/chain'; +import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; +import type { CollationInfo } from '@polkadot/types/interfaces/cumulus'; +import type { BlockV2, EthReceiptV3, EthTransactionStatus, TransactionV2 } from '@polkadot/types/interfaces/eth'; +import type { EvmAccount, EvmCallInfo, EvmCreateInfo } from '@polkadot/types/interfaces/evm'; +import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics'; +import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata'; +import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; +import type { AccountId, Block, H160, H256, Header, Index, KeyTypeId, Permill, SlotDuration } from '@polkadot/types/interfaces/runtime'; +import type { RuntimeVersion } from '@polkadot/types/interfaces/state'; +import type { ApplyExtrinsicResult, DispatchError } from '@polkadot/types/interfaces/system'; +import type { TransactionSource, TransactionValidity } from '@polkadot/types/interfaces/txqueue'; +import type { IExtrinsic, Observable } from '@polkadot/types/types'; + +export type __AugmentedCall = AugmentedCall; +export type __DecoratedCallBase = DecoratedCallBase; + +declare module '@polkadot/api-base/types/calls' { + interface AugmentedCalls { + /** 0xbc9d89904f5b923f/1 */ + accountNonceApi: { + /** + * The API to query account nonce (aka transaction index) + **/ + accountNonce: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + /** 0xdd718d5cc53262d4/1 */ + auraApi: { + /** + * Return the current set of authorities. + **/ + authorities: AugmentedCall Observable>>; + /** + * Returns the slot duration for Aura. + **/ + slotDuration: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + /** 0x40fe3ad401f8959a/6 */ + blockBuilder: { + /** + * Apply the given extrinsic. + **/ + applyExtrinsic: AugmentedCall Observable>; + /** + * Check that the inherents are valid. + **/ + checkInherents: AugmentedCall Observable>; + /** + * Finish the current block. + **/ + finalizeBlock: AugmentedCall Observable
>; + /** + * Generate inherent extrinsics. + **/ + inherentExtrinsics: AugmentedCall Observable>>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + /** 0xea93e3f16f3d6962/2 */ + collectCollationInfo: { + /** + * Collect information about a collation. + **/ + collectCollationInfo: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + /** 0xe65b00e46cedd0aa/2 */ + convertTransactionRuntimeApi: { + /** + * Converts an Ethereum-style transaction to Extrinsic + **/ + convertTransaction: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + /** 0xdf6acb689907609b/4 */ + core: { + /** + * Execute the given block. + **/ + executeBlock: AugmentedCall Observable>; + /** + * Initialize a block with the given header. + **/ + initializeBlock: AugmentedCall Observable>; + /** + * Returns the version of the runtime. + **/ + version: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + /** 0x582211f65bb14b89/4 */ + ethereumRuntimeRPCApi: { + /** + * Returns pallet_evm::Accounts by address. + **/ + accountBasic: AugmentedCall Observable>; + /** + * For a given account address, returns pallet_evm::AccountCodes. + **/ + accountCodeAt: AugmentedCall Observable>; + /** + * Returns the converted FindAuthor::find_author authority id. + **/ + author: AugmentedCall Observable>; + /** + * Returns a frame_ethereum::call response. If `estimate` is true, + **/ + call: AugmentedCall | null | Uint8Array | U256 | AnyNumber, maxPriorityFeePerGas: Option | null | Uint8Array | U256 | AnyNumber, nonce: Option | null | Uint8Array | U256 | AnyNumber, estimate: bool | boolean | Uint8Array, accessList: Option]>>> | null | Uint8Array | Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => Observable>>; + /** + * Returns runtime defined pallet_evm::ChainId. + **/ + chainId: AugmentedCall Observable>; + /** + * Returns a frame_ethereum::call response. If `estimate` is true, + **/ + create: AugmentedCall | null | Uint8Array | U256 | AnyNumber, maxPriorityFeePerGas: Option | null | Uint8Array | U256 | AnyNumber, nonce: Option | null | Uint8Array | U256 | AnyNumber, estimate: bool | boolean | Uint8Array, accessList: Option]>>> | null | Uint8Array | Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => Observable>>; + /** + * Return all the current data for a block in a single runtime call. + **/ + currentAll: AugmentedCall Observable, Option>, Option>]>>>; + /** + * Return the current block. + **/ + currentBlock: AugmentedCall Observable>; + /** + * Return the current receipt. + **/ + currentReceipts: AugmentedCall Observable>>>; + /** + * Return the current transaction status. + **/ + currentTransactionStatuses: AugmentedCall Observable>>>; + /** + * Return the elasticity multiplier. + **/ + elasticity: AugmentedCall Observable>>; + /** + * Receives a `Vec` and filters all the ethereum transactions. + **/ + extrinsicFilter: AugmentedCall | (Extrinsic | IExtrinsic | string | Uint8Array)[]) => Observable>>; + /** + * Returns FixedGasPrice::min_gas_price + **/ + gasPrice: AugmentedCall Observable>; + /** + * For a given account address and index, returns pallet_evm::AccountStorages. + **/ + storageAt: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + /** 0x37e397fc7c91f5e4/1 */ + metadata: { + /** + * Returns the metadata of a runtime + **/ + metadata: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + /** 0xf78b278be53f454c/2 */ + offchainWorkerApi: { + /** + * Starts the off-chain task for given block header. + **/ + offchainWorker: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + /** 0xab3c0572291feb8b/1 */ + sessionKeys: { + /** + * Decode the given public session keys. + **/ + decodeSessionKeys: AugmentedCall Observable>>>>; + /** + * Generate a set of session keys with optionally using the given seed. + **/ + generateSessionKeys: AugmentedCall | null | Uint8Array | Bytes | string) => Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + /** 0xd2bc9897eed08f15/3 */ + taggedTransactionQueue: { + /** + * Validate the transaction. + **/ + validateTransaction: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + /** 0x37c8bb1350a9a2a8/1 */ + transactionPaymentApi: { + /** + * The transaction fee details + **/ + queryFeeDetails: AugmentedCall Observable>; + /** + * The transaction info + **/ + queryInfo: AugmentedCall Observable>; + /** + * Generic call + **/ + [key: string]: DecoratedCallBase; + }; + } // AugmentedCalls +} // declare module diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index fe69a0ff5b..97d8627705 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -1,14 +1,22 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { ApiTypes } from '@polkadot/api-base/types'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/api-base/types/submittable'; + +import type { ApiTypes, AugmentedSubmittable, SubmittableExtrinsic, SubmittableExtrinsicFunction } from '@polkadot/api-base/types'; import type { Bytes, Compact, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, FrameSupportScheduleMaybeHashed, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartEquippableList, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +export type __AugmentedSubmittable = AugmentedSubmittable<() => unknown>; +export type __SubmittableExtrinsic = SubmittableExtrinsic; +export type __SubmittableExtrinsicFunction = SubmittableExtrinsicFunction; + declare module '@polkadot/api-base/types/submittable' { - export interface AugmentedSubmittables { + interface AugmentedSubmittables { balances: { /** * Exactly as `transfer`, except the origin must be root and the source account may be @@ -105,8 +113,8 @@ declare module '@polkadot/api-base/types/submittable' { [key: string]: SubmittableExtrinsicFunction; }; configuration: { - setMinGasPriceOverride: AugmentedSubmittable<(coeff: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; - setWeightToFeeCoefficientOverride: AugmentedSubmittable<(coeff: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + setMinGasPriceOverride: AugmentedSubmittable<(coeff: Option | null | Uint8Array | u64 | AnyNumber) => SubmittableExtrinsic, [Option]>; + setWeightToFeeCoefficientOverride: AugmentedSubmittable<(coeff: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; /** * Generic tx **/ @@ -153,16 +161,16 @@ declare module '@polkadot/api-base/types/submittable' { /** * Issue an EVM call operation. This is similar to a message call transaction in Ethereum. **/ - call: AugmentedSubmittable<(source: H160 | string | Uint8Array, target: H160 | string | Uint8Array, input: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | object | string | Uint8Array, nonce: Option | null | object | string | Uint8Array, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, H160, Bytes, U256, u64, U256, Option, Option, Vec]>>]>; + call: AugmentedSubmittable<(source: H160 | string | Uint8Array, target: H160 | string | Uint8Array, input: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | Uint8Array | U256 | AnyNumber, nonce: Option | null | Uint8Array | U256 | AnyNumber, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, H160, Bytes, U256, u64, U256, Option, Option, Vec]>>]>; /** * Issue an EVM create operation. This is similar to a contract creation transaction in * Ethereum. **/ - create: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | object | string | Uint8Array, nonce: Option | null | object | string | Uint8Array, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, Bytes, U256, u64, U256, Option, Option, Vec]>>]>; + create: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | Uint8Array | U256 | AnyNumber, nonce: Option | null | Uint8Array | U256 | AnyNumber, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, Bytes, U256, u64, U256, Option, Option, Vec]>>]>; /** * Issue an EVM create2 operation. **/ - create2: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, salt: H256 | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | object | string | Uint8Array, nonce: Option | null | object | string | Uint8Array, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, Bytes, H256, U256, u64, U256, Option, Option, Vec]>>]>; + create2: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, salt: H256 | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | Uint8Array | U256 | AnyNumber, nonce: Option | null | Uint8Array | U256 | AnyNumber, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, Bytes, H256, U256, u64, U256, Option, Option, Vec]>>]>; /** * Withdraw balance from EVM into currency/balances pallet. **/ @@ -244,7 +252,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `origin`: Must be Root. * - `maybe_xcm_version`: The default XCM encoding version, or `None` to disable. **/ - forceDefaultXcmVersion: AugmentedSubmittable<(maybeXcmVersion: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + forceDefaultXcmVersion: AugmentedSubmittable<(maybeXcmVersion: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; /** * Ask a location to notify us regarding their XCM version and any changes to it. * @@ -364,6 +372,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Token-owner-to-be * * # Arguments: + * - `origin`: sender of the transaction * - `rmrk_collection_id`: RMRK collection ID of the NFT to be accepted. * - `rmrk_nft_id`: ID of the NFT to be accepted. * - `new_owner`: Either the sender's account ID or a sender-owned NFT, @@ -381,9 +390,11 @@ declare module '@polkadot/api-base/types/submittable' { * - Token owner * * # Arguments: + * - `origin`: sender of the transaction * - `rmrk_collection_id`: RMRK collection ID of the NFT. * - `rmrk_nft_id`: ID of the NFT with a pending resource to be accepted. * - `resource_id`: ID of the newly created pending resource. + * accept the addition of a new resource to an existing NFT **/ acceptResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, resourceId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; /** @@ -396,6 +407,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Token owner * * # Arguments: + * - `origin`: sender of the transaction * - `rmrk_collection_id`: RMRK collection ID of the NFT. * - `rmrk_nft_id`: ID of the NFT with a resource to be removed. * - `resource_id`: ID of the removal-pending resource. @@ -412,6 +424,7 @@ declare module '@polkadot/api-base/types/submittable' { * the owner's [acceptance](Pallet::accept_resource). * * # Arguments: + * - `origin`: sender of the transaction * - `rmrk_collection_id`: RMRK collection ID of the NFT. * - `nft_id`: ID of the NFT to assign a resource to. * - `resource`: Data of the resource to be created. @@ -428,6 +441,7 @@ declare module '@polkadot/api-base/types/submittable' { * the owner's [acceptance](Pallet::accept_resource). * * # Arguments: + * - `origin`: sender of the transaction * - `rmrk_collection_id`: RMRK collection ID of the NFT. * - `nft_id`: ID of the NFT to assign a resource to. * - `resource`: Data of the resource to be created. @@ -444,6 +458,7 @@ declare module '@polkadot/api-base/types/submittable' { * the owner's [acceptance](Pallet::accept_resource). * * # Arguments: + * - `origin`: sender of the transaction * - `rmrk_collection_id`: RMRK collection ID of the NFT. * - `nft_id`: ID of the NFT to assign a resource to. * - `resource`: Data of the resource to be created. @@ -461,6 +476,7 @@ declare module '@polkadot/api-base/types/submittable' { * * Token owner * * # Arguments: + * - `origin`: sender of the transaction * - `collection_id`: RMRK ID of the collection in which the NFT to burn belongs to. * - `nft_id`: ID of the NFT to be destroyed. * - `max_burns`: Maximum number of tokens to burn, assuming nesting. The transaction @@ -475,6 +491,7 @@ declare module '@polkadot/api-base/types/submittable' { * * Collection issuer * * # Arguments: + * - `origin`: sender of the transaction * - `collection_id`: RMRK collection ID to change the issuer of. * - `new_issuer`: Collection's new issuer. **/ @@ -486,12 +503,13 @@ declare module '@polkadot/api-base/types/submittable' { * * Anyone - will be assigned as the issuer of the collection. * * # Arguments: + * - `origin`: sender of the transaction * - `metadata`: Metadata describing the collection, e.g. IPFS hash. Cannot be changed. * - `max`: Optional maximum number of tokens. * - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs. * Analogous to Unique's [`token_prefix`](up_data_structs::Collection). Cannot be changed. **/ - createCollection: AugmentedSubmittable<(metadata: Bytes | string | Uint8Array, max: Option | null | object | string | Uint8Array, symbol: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes, Option, Bytes]>; + createCollection: AugmentedSubmittable<(metadata: Bytes | string | Uint8Array, max: Option | null | Uint8Array | u32 | AnyNumber, symbol: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes, Option, Bytes]>; /** * Destroy a collection. * @@ -501,6 +519,7 @@ declare module '@polkadot/api-base/types/submittable' { * * Collection issuer * * # Arguments: + * - `origin`: sender of the transaction * - `collection_id`: RMRK ID of the collection to destroy. **/ destroyCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; @@ -511,6 +530,7 @@ declare module '@polkadot/api-base/types/submittable' { * * Collection issuer * * # Arguments: + * - `origin`: sender of the transaction * - `collection_id`: RMRK ID of the collection to lock. **/ lockCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; @@ -521,6 +541,7 @@ declare module '@polkadot/api-base/types/submittable' { * * Collection issuer * * # Arguments: + * - `origin`: sender of the transaction * - `owner`: Owner account of the NFT. If set to None, defaults to the sender (collection issuer). * - `collection_id`: RMRK collection ID for the NFT to be minted within. Cannot be changed. * - `recipient`: Receiver account of the royalty. Has no effect if the `royalty_amount` is not set. Cannot be changed. @@ -529,7 +550,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `transferable`: Can this NFT be transferred? Cannot be changed. * - `resources`: Resource data to be added to the NFT immediately after minting. **/ - mintNft: AugmentedSubmittable<(owner: Option | null | object | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, recipient: Option | null | object | string | Uint8Array, royaltyAmount: Option | null | object | string | Uint8Array, metadata: Bytes | string | Uint8Array, transferable: bool | boolean | Uint8Array, resources: Option> | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option, u32, Option, Option, Bytes, bool, Option>]>; + mintNft: AugmentedSubmittable<(owner: Option | null | Uint8Array | AccountId32 | string, collectionId: u32 | AnyNumber | Uint8Array, recipient: Option | null | Uint8Array | AccountId32 | string, royaltyAmount: Option | null | Uint8Array | Permill | AnyNumber, metadata: Bytes | string | Uint8Array, transferable: bool | boolean | Uint8Array, resources: Option> | null | Uint8Array | Vec | (RmrkTraitsResourceResourceTypes | { Basic: any } | { Composable: any } | { Slot: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Option, u32, Option, Option, Bytes, bool, Option>]>; /** * Reject an NFT sent from another account to self or owned NFT. * The NFT in question will not be sent back and burnt instead. @@ -540,6 +561,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Token-owner-to-be-not * * # Arguments: + * - `origin`: sender of the transaction * - `rmrk_collection_id`: RMRK ID of the NFT to be rejected. * - `rmrk_nft_id`: ID of the NFT to be rejected. **/ @@ -554,7 +576,8 @@ declare module '@polkadot/api-base/types/submittable' { * - Collection issuer * * # Arguments - * - `collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to. + * - `origin`: sender of the transaction + * - `rmrk_collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to. * - `nft_id`: ID of the NFT with a resource to be removed. * - `resource_id`: ID of the resource to be removed. **/ @@ -570,8 +593,9 @@ declare module '@polkadot/api-base/types/submittable' { * - Token owner * * # Arguments: - * - `collection_id`: RMRK ID of the collection of the NFT to be transferred. - * - `nft_id`: ID of the NFT to be transferred. + * - `origin`: sender of the transaction + * - `rmrk_collection_id`: RMRK ID of the collection of the NFT to be transferred. + * - `rmrk_nft_id`: ID of the NFT to be transferred. * - `new_owner`: New owner of the nft which can be either an account or a NFT. **/ send: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple | { AccountId: any } | { CollectionAndNftTuple: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsNftAccountIdOrCollectionNftTuple]>; @@ -587,6 +611,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Token owner * * # Arguments: + * - `origin`: sender of the transaction * - `rmrk_collection_id`: RMRK collection ID of the NFT. * - `rmrk_nft_id`: ID of the NFT to rearrange resource priorities for. * - `priorities`: Ordered vector of resource IDs. @@ -605,12 +630,13 @@ declare module '@polkadot/api-base/types/submittable' { * - Token owner - in case of NFT property * * # Arguments: + * - `origin`: sender of the transaction * - `rmrk_collection_id`: RMRK collection ID. * - `maybe_nft_id`: Optional ID of the NFT. If left empty, then the property is set for the collection. * - `key`: Key of the custom property to be referenced by. * - `value`: Value of the custom property to be stored. **/ - setProperty: AugmentedSubmittable<(rmrkCollectionId: Compact | AnyNumber | Uint8Array, maybeNftId: Option | null | object | string | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Option, Bytes, Bytes]>; + setProperty: AugmentedSubmittable<(rmrkCollectionId: Compact | AnyNumber | Uint8Array, maybeNftId: Option | null | Uint8Array | u32 | AnyNumber, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Option, Bytes, Bytes]>; /** * Generic tx **/ @@ -626,6 +652,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Anyone - will be assigned as the issuer of the Base. * * # Arguments: + * - `origin`: Caller, will be assigned as the issuer of the Base * - `base_type`: Arbitrary media type, e.g. "svg". * - `symbol`: Arbitrary client-chosen symbol. * - `parts`: Array of Fixed and Slot Parts composing the Base, @@ -641,8 +668,9 @@ declare module '@polkadot/api-base/types/submittable' { * - Base issuer * * # Arguments: + * - `origin`: sender of the transaction * - `base_id`: Base containing the Slot Part to be updated. - * - `part_id`: Slot Part whose Equippable List is being updated. + * - `slot_id`: Slot Part whose Equippable List is being updated . * - `equippables`: List of equippables that will override the current Equippables list. **/ equippable: AugmentedSubmittable<(baseId: u32 | AnyNumber | Uint8Array, slotId: u32 | AnyNumber | Uint8Array, equippables: RmrkTraitsPartEquippableList | { All: any } | { Empty: any } | { Custom: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsPartEquippableList]>; @@ -656,6 +684,7 @@ declare module '@polkadot/api-base/types/submittable' { * - Base issuer * * # Arguments: + * - `origin`: sender of the transaction * - `base_id`: Base ID containing the Theme to be updated. * - `theme`: Theme to add to the Base. A Theme has a name and properties, which are an * array of [key, value, inherit]. @@ -677,7 +706,7 @@ declare module '@polkadot/api-base/types/submittable' { /** * Schedule a named task. **/ - scheduleNamed: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + scheduleNamed: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Schedule a named task after a delay. * @@ -685,7 +714,7 @@ declare module '@polkadot/api-base/types/submittable' { * Same as [`schedule_named`](Self::schedule_named). * # **/ - scheduleNamedAfter: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + scheduleNamedAfter: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Generic tx **/ @@ -905,6 +934,17 @@ declare module '@polkadot/api-base/types/submittable' { * exist altogether, thus there is no way it would have been approved in the first place. **/ removeApproval: AugmentedSubmittable<(proposalId: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact]>; + /** + * Propose and approve a spend of treasury funds. + * + * - `origin`: Must be `SpendOrigin` with the `Success` value being at least `amount`. + * - `amount`: The amount to be transferred from the treasury to the `beneficiary`. + * - `beneficiary`: The destination account for the transfer. + * + * NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the + * beneficiary. + **/ + spend: AugmentedSubmittable<(amount: Compact | AnyNumber | Uint8Array, beneficiary: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [Compact, MultiAddress]>; /** * Generic tx **/ @@ -929,7 +969,7 @@ declare module '@polkadot/api-base/types/submittable' { * * `collection_id`: ID of the Collection to add an admin for. * * `new_admin`: Address of new admin to add. **/ - addCollectionAdmin: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newAdmin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>; + addCollectionAdmin: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newAdminId: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, PalletEvmAccountBasicCrossAccountIdRepr]>; /** * Add an address to allow list. * diff --git a/tests/src/interfaces/augment-api.ts b/tests/src/interfaces/augment-api.ts index 921d2f824d..7cafd228bd 100644 --- a/tests/src/interfaces/augment-api.ts +++ b/tests/src/interfaces/augment-api.ts @@ -7,3 +7,4 @@ import './augment-api-events'; import './augment-api-query'; import './augment-api-tx'; import './augment-api-rpc'; +import './augment-api-runtime'; diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index 55e03234af..4e44fb898c 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -1,17 +1,23 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/types/types/registry'; + +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; -import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; +import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations'; import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura'; import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; -import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe'; +import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeGenesisConfiguration, BabeGenesisConfigurationV1, BabeWeight, Epoch, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, OpaqueKeyOwnershipProof, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe'; import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, ReserveData, ReserveIdentifier, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances'; -import type { BeefyCommitment, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefySignedCommitment, MmrRootHash, ValidatorSetId } from '@polkadot/types/interfaces/beefy'; +import type { BeefyAuthoritySet, BeefyCommitment, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefyPayloadId, BeefySignedCommitment, MmrRootHash, ValidatorSet, ValidatorSetId } from '@polkadot/types/interfaces/beefy'; +import type { BenchmarkBatch, BenchmarkConfig, BenchmarkList, BenchmarkMetadata, BenchmarkParameter, BenchmarkResult } from '@polkadot/types/interfaces/benchmark'; +import type { CheckInherentsResult, InherentData, InherentIdentifier } from '@polkadot/types/interfaces/blockbuilder'; import type { BridgeMessageId, BridgedBlockHash, BridgedBlockNumber, BridgedHeader, CallOrigin, ChainId, DeliveredMessages, DispatchFeePayment, InboundLaneData, InboundRelayer, InitializationData, LaneId, MessageData, MessageKey, MessageNonce, MessagesDeliveryProofOf, MessagesProofOf, OperatingMode, OutboundLaneData, OutboundMessageFee, OutboundPayload, Parameter, RelayerId, UnrewardedRelayer, UnrewardedRelayersState } from '@polkadot/types/interfaces/bridges'; import type { BlockHash } from '@polkadot/types/interfaces/chain'; import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; @@ -21,13 +27,13 @@ import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/conse import type { AliveContractInfo, CodeHash, CodeSource, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractInstantiateResultTo299, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateRequestV1, InstantiateRequestV2, InstantiateReturnValue, InstantiateReturnValueOk, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts'; import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, ContractConstructorSpecV1, ContractConstructorSpecV2, ContractConstructorSpecV3, ContractContractSpecV0, ContractContractSpecV1, ContractContractSpecV2, ContractContractSpecV3, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpecLatest, ContractEventParamSpecV0, ContractEventParamSpecV2, ContractEventSpecLatest, ContractEventSpecV0, ContractEventSpecV1, ContractEventSpecV2, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpecLatest, ContractMessageParamSpecV0, ContractMessageParamSpecV2, ContractMessageSpecLatest, ContractMessageSpecV0, ContractMessageSpecV1, ContractMessageSpecV2, ContractMetadata, ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1, ContractMetadataV2, ContractMetadataV3, ContractProject, ContractProjectContract, ContractProjectInfo, ContractProjectSource, ContractProjectV0, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi'; import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan'; -import type { ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus'; +import type { CollationInfo, CollationInfoV1, ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus'; import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy'; import type { BlockStats } from '@polkadot/types/interfaces/dev'; import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections'; import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine'; -import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth'; -import type { EvmAccount, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm'; +import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFeeHistory, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthReceiptV0, EthReceiptV3, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth'; +import type { EvmAccount, EvmCallInfo, EvmCreateInfo, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm'; import type { AnySignature, EcdsaSignature, Ed25519Signature, Era, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics'; import type { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset'; import type { ActiveGilt, ActiveGiltsTotal, ActiveIndex, GiltBid } from '@polkadot/types/interfaces/gilt'; @@ -35,35 +41,37 @@ import type { AuthorityIndex, AuthorityList, AuthoritySet, AuthoritySetChange, A import type { IdentityFields, IdentityInfo, IdentityInfoAdditional, IdentityInfoTo198, IdentityJudgement, RegistrarIndex, RegistrarInfo, Registration, RegistrationJudgement, RegistrationTo198 } from '@polkadot/types/interfaces/identity'; import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline'; import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery'; -import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; -import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr'; +import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, OpaqueMetadata, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; +import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafBatchProof, MmrLeafIndex, MmrLeafProof, MmrNodeIndex, MmrProof } from '@polkadot/types/interfaces/mmr'; +import type { NpApiError } from '@polkadot/types/interfaces/nompools'; import type { StorageKind } from '@polkadot/types/interfaces/offchain'; import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences'; -import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, Scheduling, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; +import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateEvent, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, CoreState, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, GroupRotationInfo, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OccupiedCore, OccupiedCoreAssumption, OldV1SessionInfo, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, PvfCheckStatement, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, ScheduledCore, Scheduling, ScrapedOnChainVotes, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; import type { FeeDetails, InclusionFee, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; import type { Approvals } from '@polkadot/types/interfaces/poll'; import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy'; import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase'; import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery'; import type { RpcMethods } from '@polkadot/types/interfaces/rpc'; -import type { AccountId, AccountId20, AccountId32, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, StorageData, StorageProof, TransactionInfo, TransactionPriority, TransactionStorageProof, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; +import type { AccountId, AccountId20, AccountId32, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, SlotDuration, StorageData, StorageInfo, StorageProof, TransactionInfo, TransactionLongevity, TransactionPriority, TransactionStorageProof, TransactionTag, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; import type { Si0Field, Si0LookupTypeId, Si0Path, Si0Type, Si0TypeDef, Si0TypeDefArray, Si0TypeDefBitSequence, Si0TypeDefCompact, Si0TypeDefComposite, Si0TypeDefPhantom, Si0TypeDefPrimitive, Si0TypeDefSequence, Si0TypeDefTuple, Si0TypeDefVariant, Si0TypeParameter, Si0Variant, Si1Field, Si1LookupTypeId, Si1Path, Si1Type, Si1TypeDef, Si1TypeDefArray, Si1TypeDefBitSequence, Si1TypeDefCompact, Si1TypeDefComposite, Si1TypeDefPrimitive, Si1TypeDefSequence, Si1TypeDefTuple, Si1TypeDefVariant, Si1TypeParameter, Si1Variant, SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefBitSequence, SiTypeDefCompact, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiTypeParameter, SiVariant } from '@polkadot/types/interfaces/scaleInfo'; import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler'; import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session'; import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society'; import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactAssignmentsTo265, CompactAssignmentsWith16, CompactAssignmentsWith24, CompactScore, CompactScoreCompact, ElectionCompute, ElectionPhase, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, RawSolutionTo265, RawSolutionWith16, RawSolutionWith24, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SignedSubmission, SignedSubmissionOf, SignedSubmissionTo276, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, SubmissionIndicesOf, Supports, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking'; -import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, MigrationStatusResult, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state'; +import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, MigrationStatusResult, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, RuntimeVersionPre3, RuntimeVersionPre4, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state'; import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support'; -import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, TransactionalError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system'; +import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ApplyExtrinsicResultPre6, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorModulePre6, DispatchErrorModuleU8, DispatchErrorModuleU8a, DispatchErrorPre6, DispatchErrorPre6First, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchOutcomePre6, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, TransactionalError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system'; import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury'; import type { Multiplier } from '@polkadot/types/interfaces/txpayment'; +import type { TransactionSource, TransactionValidity, ValidTransaction } from '@polkadot/types/interfaces/txqueue'; import type { ClassDetails, ClassId, ClassMetadata, DepositBalance, DepositBalanceOf, DestroyWitness, InstanceDetails, InstanceId, InstanceMetadata } from '@polkadot/types/interfaces/uniques'; import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility'; import type { VestingInfo } from '@polkadot/types/interfaces/vesting'; import type { AssetInstance, AssetInstanceV0, AssetInstanceV1, AssetInstanceV2, BodyId, BodyPart, DoubleEncodedCall, Fungibility, FungibilityV0, FungibilityV1, FungibilityV2, InboundStatus, InstructionV2, InteriorMultiLocation, Junction, JunctionV0, JunctionV1, JunctionV2, Junctions, JunctionsV1, JunctionsV2, MultiAsset, MultiAssetFilter, MultiAssetFilterV1, MultiAssetFilterV2, MultiAssetV0, MultiAssetV1, MultiAssetV2, MultiAssets, MultiAssetsV1, MultiAssetsV2, MultiLocation, MultiLocationV0, MultiLocationV1, MultiLocationV2, NetworkId, OriginKindV0, OriginKindV1, OriginKindV2, OutboundStatus, Outcome, QueryId, QueryStatus, QueueConfigData, Response, ResponseV0, ResponseV1, ResponseV2, ResponseV2Error, ResponseV2Result, VersionMigrationStage, VersionedMultiAsset, VersionedMultiAssets, VersionedMultiLocation, VersionedResponse, VersionedXcm, WeightLimitV2, WildFungibility, WildFungibilityV0, WildFungibilityV1, WildFungibilityV2, WildMultiAsset, WildMultiAssetV1, WildMultiAssetV2, Xcm, XcmAssetId, XcmError, XcmErrorV0, XcmErrorV1, XcmErrorV2, XcmOrder, XcmOrderV0, XcmOrderV1, XcmOrderV2, XcmOrigin, XcmOriginKind, XcmV0, XcmV1, XcmV2, XcmVersion, XcmpMessageFormat } from '@polkadot/types/interfaces/xcm'; declare module '@polkadot/types/types/registry' { - export interface InterfaceTypes { + interface InterfaceTypes { AbridgedCandidateReceipt: AbridgedCandidateReceipt; AbridgedHostConfiguration: AbridgedHostConfiguration; AbridgedHrmpChannel: AbridgedHrmpChannel; @@ -95,6 +103,7 @@ declare module '@polkadot/types/types/registry' { AnySignature: AnySignature; ApiId: ApiId; ApplyExtrinsicResult: ApplyExtrinsicResult; + ApplyExtrinsicResultPre6: ApplyExtrinsicResultPre6; ApprovalFlag: ApprovalFlag; Approvals: Approvals; ArithmeticError: ArithmeticError; @@ -130,6 +139,8 @@ declare module '@polkadot/types/types/registry' { BabeBlockWeight: BabeBlockWeight; BabeEpochConfiguration: BabeEpochConfiguration; BabeEquivocationProof: BabeEquivocationProof; + BabeGenesisConfiguration: BabeGenesisConfiguration; + BabeGenesisConfigurationV1: BabeGenesisConfigurationV1; BabeWeight: BabeWeight; BackedCandidate: BackedCandidate; Balance: Balance; @@ -137,12 +148,20 @@ declare module '@polkadot/types/types/registry' { BalanceLockTo212: BalanceLockTo212; BalanceOf: BalanceOf; BalanceStatus: BalanceStatus; + BeefyAuthoritySet: BeefyAuthoritySet; BeefyCommitment: BeefyCommitment; BeefyId: BeefyId; BeefyKey: BeefyKey; BeefyNextAuthoritySet: BeefyNextAuthoritySet; BeefyPayload: BeefyPayload; + BeefyPayloadId: BeefyPayloadId; BeefySignedCommitment: BeefySignedCommitment; + BenchmarkBatch: BenchmarkBatch; + BenchmarkConfig: BenchmarkConfig; + BenchmarkList: BenchmarkList; + BenchmarkMetadata: BenchmarkMetadata; + BenchmarkParameter: BenchmarkParameter; + BenchmarkResult: BenchmarkResult; Bid: Bid; Bidder: Bidder; BidKind: BidKind; @@ -186,6 +205,7 @@ declare module '@polkadot/types/types/registry' { CallOrigin: CallOrigin; CandidateCommitments: CandidateCommitments; CandidateDescriptor: CandidateDescriptor; + CandidateEvent: CandidateEvent; CandidateHash: CandidateHash; CandidateInfo: CandidateInfo; CandidatePendingAvailability: CandidatePendingAvailability; @@ -195,6 +215,7 @@ declare module '@polkadot/types/types/registry' { ChainType: ChainType; ChangesTrieConfiguration: ChangesTrieConfiguration; ChangesTrieSignal: ChangesTrieSignal; + CheckInherentsResult: CheckInherentsResult; ClassDetails: ClassDetails; ClassId: ClassId; ClassMetadata: ClassMetadata; @@ -204,6 +225,8 @@ declare module '@polkadot/types/types/registry' { CodeUploadRequest: CodeUploadRequest; CodeUploadResult: CodeUploadResult; CodeUploadResultValue: CodeUploadResultValue; + CollationInfo: CollationInfo; + CollationInfoV1: CollationInfoV1; CollatorId: CollatorId; CollatorSignature: CollatorSignature; CollectiveOrigin: CollectiveOrigin; @@ -287,6 +310,7 @@ declare module '@polkadot/types/types/registry' { CoreAssignment: CoreAssignment; CoreIndex: CoreIndex; CoreOccupied: CoreOccupied; + CoreState: CoreState; CrateVersion: CrateVersion; CreatedBlock: CreatedBlock; CumulusPalletDmpQueueCall: CumulusPalletDmpQueueCall; @@ -328,14 +352,18 @@ declare module '@polkadot/types/types/registry' { DispatchClass: DispatchClass; DispatchError: DispatchError; DispatchErrorModule: DispatchErrorModule; + DispatchErrorModulePre6: DispatchErrorModulePre6; DispatchErrorModuleU8: DispatchErrorModuleU8; DispatchErrorModuleU8a: DispatchErrorModuleU8a; + DispatchErrorPre6: DispatchErrorPre6; + DispatchErrorPre6First: DispatchErrorPre6First; DispatchErrorTo198: DispatchErrorTo198; DispatchFeePayment: DispatchFeePayment; DispatchInfo: DispatchInfo; DispatchInfoTo190: DispatchInfoTo190; DispatchInfoTo244: DispatchInfoTo244; DispatchOutcome: DispatchOutcome; + DispatchOutcomePre6: DispatchOutcomePre6; DispatchResult: DispatchResult; DispatchResultOf: DispatchResultOf; DispatchResultTo198: DispatchResultTo198; @@ -359,6 +387,7 @@ declare module '@polkadot/types/types/registry' { ElectionStatus: ElectionStatus; EncodedFinalityProofs: EncodedFinalityProofs; EncodedJustification: EncodedJustification; + Epoch: Epoch; EpochAuthorship: EpochAuthorship; Era: Era; EraIndex: EraIndex; @@ -397,6 +426,7 @@ declare module '@polkadot/types/types/registry' { EthereumTransactionTransactionSignature: EthereumTransactionTransactionSignature; EthereumTransactionTransactionV2: EthereumTransactionTransactionV2; EthereumTypesHashH64: EthereumTypesHashH64; + EthFeeHistory: EthFeeHistory; EthFilter: EthFilter; EthFilterAddress: EthFilterAddress; EthFilterChanges: EthFilterChanges; @@ -406,6 +436,8 @@ declare module '@polkadot/types/types/registry' { EthHeader: EthHeader; EthLog: EthLog; EthReceipt: EthReceipt; + EthReceiptV0: EthReceiptV0; + EthReceiptV3: EthReceiptV3; EthRichBlock: EthRichBlock; EthRichHeader: EthRichHeader; EthStorageProof: EthStorageProof; @@ -433,11 +465,13 @@ declare module '@polkadot/types/types/registry' { EventMetadataV9: EventMetadataV9; EventRecord: EventRecord; EvmAccount: EvmAccount; + EvmCallInfo: EvmCallInfo; EvmCoreErrorExitError: EvmCoreErrorExitError; EvmCoreErrorExitFatal: EvmCoreErrorExitFatal; EvmCoreErrorExitReason: EvmCoreErrorExitReason; EvmCoreErrorExitRevert: EvmCoreErrorExitRevert; EvmCoreErrorExitSucceed: EvmCoreErrorExitSucceed; + EvmCreateInfo: EvmCreateInfo; EvmLog: EvmLog; EvmVicinity: EvmVicinity; ExecReturnValue: ExecReturnValue; @@ -466,6 +500,10 @@ declare module '@polkadot/types/types/registry' { ExtrinsicsWeight: ExtrinsicsWeight; ExtrinsicUnknown: ExtrinsicUnknown; ExtrinsicV4: ExtrinsicV4; + f32: f32; + F32: F32; + f64: f64; + F64: F64; FeeDetails: FeeDetails; Fixed128: Fixed128; Fixed64: Fixed64; @@ -537,6 +575,7 @@ declare module '@polkadot/types/types/registry' { GrandpaPrevote: GrandpaPrevote; GrandpaSignedPrecommit: GrandpaSignedPrecommit; GroupIndex: GroupIndex; + GroupRotationInfo: GroupRotationInfo; H1024: H1024; H128: H128; H160: H160; @@ -593,6 +632,8 @@ declare module '@polkadot/types/types/registry' { Index: Index; IndicesLookupSource: IndicesLookupSource; IndividualExposure: IndividualExposure; + InherentData: InherentData; + InherentIdentifier: InherentIdentifier; InitializationData: InitializationData; InstanceDetails: InstanceDetails; InstanceId: InstanceId; @@ -663,8 +704,14 @@ declare module '@polkadot/types/types/registry' { MetadataV14: MetadataV14; MetadataV9: MetadataV9; MigrationStatusResult: MigrationStatusResult; + MmrBatchProof: MmrBatchProof; + MmrEncodableOpaqueLeaf: MmrEncodableOpaqueLeaf; + MmrError: MmrError; MmrLeafBatchProof: MmrLeafBatchProof; + MmrLeafIndex: MmrLeafIndex; MmrLeafProof: MmrLeafProof; + MmrNodeIndex: MmrNodeIndex; + MmrProof: MmrProof; MmrRootHash: MmrRootHash; ModuleConstantMetadataV10: ModuleConstantMetadataV10; ModuleConstantMetadataV11: ModuleConstantMetadataV11; @@ -714,14 +761,20 @@ declare module '@polkadot/types/types/registry' { NominatorIndex: NominatorIndex; NominatorIndexCompact: NominatorIndexCompact; NotConnectedPeer: NotConnectedPeer; + NpApiError: NpApiError; Null: Null; + OccupiedCore: OccupiedCore; + OccupiedCoreAssumption: OccupiedCoreAssumption; OffchainAccuracy: OffchainAccuracy; OffchainAccuracyCompact: OffchainAccuracyCompact; OffenceDetails: OffenceDetails; Offender: Offender; + OldV1SessionInfo: OldV1SessionInfo; OpalRuntimeOriginCaller: OpalRuntimeOriginCaller; OpalRuntimeRuntime: OpalRuntimeRuntime; OpaqueCall: OpaqueCall; + OpaqueKeyOwnershipProof: OpaqueKeyOwnershipProof; + OpaqueMetadata: OpaqueMetadata; OpaqueMultiaddr: OpaqueMultiaddr; OpaqueNetworkState: OpaqueNetworkState; OpaquePeerId: OpaquePeerId; @@ -811,6 +864,7 @@ declare module '@polkadot/types/types/registry' { PalletTemplateTransactionPaymentCall: PalletTemplateTransactionPaymentCall; PalletTemplateTransactionPaymentChargeTransactionPayment: PalletTemplateTransactionPaymentChargeTransactionPayment; PalletTimestampCall: PalletTimestampCall; + PalletTransactionPaymentEvent: PalletTransactionPaymentEvent; PalletTransactionPaymentReleases: PalletTransactionPaymentReleases; PalletTreasuryCall: PalletTreasuryCall; PalletTreasuryError: PalletTreasuryError; @@ -897,6 +951,7 @@ declare module '@polkadot/types/types/registry' { ProxyDefinition: ProxyDefinition; ProxyState: ProxyState; ProxyType: ProxyType; + PvfCheckStatement: PvfCheckStatement; QueryId: QueryId; QueryStatus: QueryStatus; QueueConfigData: QueueConfigData; @@ -985,8 +1040,11 @@ declare module '@polkadot/types/types/registry' { RuntimeVersion: RuntimeVersion; RuntimeVersionApi: RuntimeVersionApi; RuntimeVersionPartial: RuntimeVersionPartial; + RuntimeVersionPre3: RuntimeVersionPre3; + RuntimeVersionPre4: RuntimeVersionPre4; Schedule: Schedule; Scheduled: Scheduled; + ScheduledCore: ScheduledCore; ScheduledTo254: ScheduledTo254; SchedulePeriod: SchedulePeriod; SchedulePriority: SchedulePriority; @@ -994,6 +1052,7 @@ declare module '@polkadot/types/types/registry' { ScheduleTo258: ScheduleTo258; ScheduleTo264: ScheduleTo264; Scheduling: Scheduling; + ScrapedOnChainVotes: ScrapedOnChainVotes; Seal: Seal; SealV0: SealV0; SeatHolder: SeatHolder; @@ -1082,6 +1141,7 @@ declare module '@polkadot/types/types/registry' { SlashingSpansTo204: SlashingSpansTo204; SlashJournalEntry: SlashJournalEntry; Slot: Slot; + SlotDuration: SlotDuration; SlotNumber: SlotNumber; SlotRange: SlotRange; SlotRange10: SlotRange10; @@ -1144,6 +1204,7 @@ declare module '@polkadot/types/types/registry' { StorageHasherV13: StorageHasherV13; StorageHasherV14: StorageHasherV14; StorageHasherV9: StorageHasherV9; + StorageInfo: StorageInfo; StorageKey: StorageKey; StorageKind: StorageKind; StorageMetadataV10: StorageMetadataV10; @@ -1173,11 +1234,15 @@ declare module '@polkadot/types/types/registry' { TraceError: TraceError; TransactionalError: TransactionalError; TransactionInfo: TransactionInfo; + TransactionLongevity: TransactionLongevity; TransactionPriority: TransactionPriority; + TransactionSource: TransactionSource; TransactionStorageProof: TransactionStorageProof; + TransactionTag: TransactionTag; TransactionV0: TransactionV0; TransactionV1: TransactionV1; TransactionV2: TransactionV2; + TransactionValidity: TransactionValidity; TransactionValidityError: TransactionValidityError; TransientValidationData: TransientValidationData; TreasuryProposal: TreasuryProposal; @@ -1253,10 +1318,12 @@ declare module '@polkadot/types/types/registry' { ValidatorPrefsTo196: ValidatorPrefsTo196; ValidatorPrefsWithBlocked: ValidatorPrefsWithBlocked; ValidatorPrefsWithCommission: ValidatorPrefsWithCommission; + ValidatorSet: ValidatorSet; ValidatorSetId: ValidatorSetId; ValidatorSignature: ValidatorSignature; ValidDisputeStatementKind: ValidDisputeStatementKind; ValidityAttestation: ValidityAttestation; + ValidTransaction: ValidTransaction; VecInboundHrmpMessage: VecInboundHrmpMessage; VersionedMultiAsset: VersionedMultiAsset; VersionedMultiAssets: VersionedMultiAssets; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index b1f41337a0..731bbfa904 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -210,21 +210,44 @@ export interface CumulusPalletXcmpQueueError extends Enum { /** @name CumulusPalletXcmpQueueEvent */ export interface CumulusPalletXcmpQueueEvent extends Enum { readonly isSuccess: boolean; - readonly asSuccess: Option; + readonly asSuccess: { + readonly messageHash: Option; + readonly weight: u64; + } & Struct; readonly isFail: boolean; - readonly asFail: ITuple<[Option, XcmV2TraitsError]>; + readonly asFail: { + readonly messageHash: Option; + readonly error: XcmV2TraitsError; + readonly weight: u64; + } & Struct; readonly isBadVersion: boolean; - readonly asBadVersion: Option; + readonly asBadVersion: { + readonly messageHash: Option; + } & Struct; readonly isBadFormat: boolean; - readonly asBadFormat: Option; + readonly asBadFormat: { + readonly messageHash: Option; + } & Struct; readonly isUpwardMessageSent: boolean; - readonly asUpwardMessageSent: Option; + readonly asUpwardMessageSent: { + readonly messageHash: Option; + } & Struct; readonly isXcmpMessageSent: boolean; - readonly asXcmpMessageSent: Option; + readonly asXcmpMessageSent: { + readonly messageHash: Option; + } & Struct; readonly isOverweightEnqueued: boolean; - readonly asOverweightEnqueued: ITuple<[u32, u32, u64, u64]>; + readonly asOverweightEnqueued: { + readonly sender: u32; + readonly sentAt: u32; + readonly index: u64; + readonly required: u64; + } & Struct; readonly isOverweightServiced: boolean; - readonly asOverweightServiced: ITuple<[u64, u64]>; + readonly asOverweightServiced: { + readonly index: u64; + readonly used: u64; + } & Struct; readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced'; } @@ -708,17 +731,17 @@ export interface FrameSystemPhase extends Enum { /** @name OpalRuntimeOriginCaller */ export interface OpalRuntimeOriginCaller extends Enum { - readonly isVoid: boolean; - readonly asVoid: SpCoreVoid; readonly isSystem: boolean; readonly asSystem: FrameSupportDispatchRawOrigin; + readonly isVoid: boolean; + readonly asVoid: SpCoreVoid; readonly isPolkadotXcm: boolean; readonly asPolkadotXcm: PalletXcmOrigin; readonly isCumulusXcm: boolean; readonly asCumulusXcm: CumulusPalletXcmOrigin; readonly isEthereum: boolean; readonly asEthereum: PalletEthereumRawOrigin; - readonly type: 'Void' | 'System' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; + readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; } /** @name OpalRuntimeRuntime */ @@ -1567,6 +1590,17 @@ export interface PalletTimestampCall extends Enum { readonly type: 'Set'; } +/** @name PalletTransactionPaymentEvent */ +export interface PalletTransactionPaymentEvent extends Enum { + readonly isTransactionFeePaid: boolean; + readonly asTransactionFeePaid: { + readonly who: AccountId32; + readonly actualFee: u128; + readonly tip: u128; + } & Struct; + readonly type: 'TransactionFeePaid'; +} + /** @name PalletTransactionPaymentReleases */ export interface PalletTransactionPaymentReleases extends Enum { readonly isV1Ancient: boolean; @@ -1589,11 +1623,16 @@ export interface PalletTreasuryCall extends Enum { readonly asApproveProposal: { readonly proposalId: Compact; } & Struct; + readonly isSpend: boolean; + readonly asSpend: { + readonly amount: Compact; + readonly beneficiary: MultiAddress; + } & Struct; readonly isRemoveApproval: boolean; readonly asRemoveApproval: { readonly proposalId: Compact; } & Struct; - readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'RemoveApproval'; + readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval'; } /** @name PalletTreasuryError */ @@ -1601,8 +1640,9 @@ export interface PalletTreasuryError extends Enum { readonly isInsufficientProposersBalance: boolean; readonly isInvalidIndex: boolean; readonly isTooManyApprovals: boolean; + readonly isInsufficientPermission: boolean; readonly isProposalNotApproved: boolean; - readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'ProposalNotApproved'; + readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved'; } /** @name PalletTreasuryEvent */ @@ -1638,7 +1678,13 @@ export interface PalletTreasuryEvent extends Enum { readonly asDeposit: { readonly value: u128; } & Struct; - readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit'; + readonly isSpendApproved: boolean; + readonly asSpendApproved: { + readonly proposalIndex: u32; + readonly amount: u128; + readonly beneficiary: AccountId32; + } & Struct; + readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit' | 'SpendApproved'; } /** @name PalletTreasuryProposal */ @@ -1684,7 +1730,7 @@ export interface PalletUniqueCall extends Enum { readonly isAddCollectionAdmin: boolean; readonly asAddCollectionAdmin: { readonly collectionId: u32; - readonly newAdmin: PalletEvmAccountBasicCrossAccountIdRepr; + readonly newAdminId: PalletEvmAccountBasicCrossAccountIdRepr; } & Struct; readonly isRemoveCollectionAdmin: boolean; readonly asRemoveCollectionAdmin: { diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 8a14949f6e..303d76a552 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -5,208 +5,176 @@ export default { /** - * Lookup2: polkadot_primitives::v2::PersistedValidationData + * Lookup3: frame_system::AccountInfo> **/ - PolkadotPrimitivesV2PersistedValidationData: { - parentHead: 'Bytes', - relayParentNumber: 'u32', - relayParentStorageRoot: 'H256', - maxPovSize: 'u32' - }, - /** - * Lookup9: polkadot_primitives::v2::UpgradeRestriction - **/ - PolkadotPrimitivesV2UpgradeRestriction: { - _enum: ['Present'] + FrameSystemAccountInfo: { + nonce: 'u32', + consumers: 'u32', + providers: 'u32', + sufficients: 'u32', + data: 'PalletBalancesAccountData' }, /** - * Lookup10: sp_trie::storage_proof::StorageProof + * Lookup5: pallet_balances::AccountData **/ - SpTrieStorageProof: { - trieNodes: 'BTreeSet' + PalletBalancesAccountData: { + free: 'u128', + reserved: 'u128', + miscFrozen: 'u128', + feeFrozen: 'u128' }, /** - * Lookup13: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot + * Lookup7: frame_support::weights::PerDispatchClass **/ - CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: { - dmqMqcHead: 'H256', - relayDispatchQueueSize: '(u32,u32)', - ingressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>', - egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>' + FrameSupportWeightsPerDispatchClassU64: { + normal: 'u64', + operational: 'u64', + mandatory: 'u64' }, /** - * Lookup18: polkadot_primitives::v2::AbridgedHrmpChannel + * Lookup11: sp_runtime::generic::digest::Digest **/ - PolkadotPrimitivesV2AbridgedHrmpChannel: { - maxCapacity: 'u32', - maxTotalSize: 'u32', - maxMessageSize: 'u32', - msgCount: 'u32', - totalSize: 'u32', - mqcHead: 'Option' + SpRuntimeDigest: { + logs: 'Vec' }, /** - * Lookup20: polkadot_primitives::v2::AbridgedHostConfiguration + * Lookup13: sp_runtime::generic::digest::DigestItem **/ - PolkadotPrimitivesV2AbridgedHostConfiguration: { - maxCodeSize: 'u32', - maxHeadDataSize: 'u32', - maxUpwardQueueCount: 'u32', - maxUpwardQueueSize: 'u32', - maxUpwardMessageSize: 'u32', - maxUpwardMessageNumPerCandidate: 'u32', - hrmpMaxMessageNumPerCandidate: 'u32', - validationUpgradeCooldown: 'u32', - validationUpgradeDelay: 'u32' + SpRuntimeDigestDigestItem: { + _enum: { + Other: 'Bytes', + __Unused1: 'Null', + __Unused2: 'Null', + __Unused3: 'Null', + Consensus: '([u8;4],Bytes)', + Seal: '([u8;4],Bytes)', + PreRuntime: '([u8;4],Bytes)', + __Unused7: 'Null', + RuntimeEnvironmentUpdated: 'Null' + } }, /** - * Lookup26: polkadot_core_primitives::OutboundHrmpMessage + * Lookup16: frame_system::EventRecord **/ - PolkadotCorePrimitivesOutboundHrmpMessage: { - recipient: 'u32', - data: 'Bytes' + FrameSystemEventRecord: { + phase: 'FrameSystemPhase', + event: 'Event', + topics: 'Vec' }, /** - * Lookup28: cumulus_pallet_parachain_system::pallet::Call + * Lookup18: frame_system::pallet::Event **/ - CumulusPalletParachainSystemCall: { + FrameSystemEvent: { _enum: { - set_validation_data: { - data: 'CumulusPrimitivesParachainInherentParachainInherentData', + ExtrinsicSuccess: { + dispatchInfo: 'FrameSupportWeightsDispatchInfo', }, - sudo_send_upward_message: { - message: 'Bytes', + ExtrinsicFailed: { + dispatchError: 'SpRuntimeDispatchError', + dispatchInfo: 'FrameSupportWeightsDispatchInfo', }, - authorize_upgrade: { - codeHash: 'H256', + CodeUpdated: 'Null', + NewAccount: { + account: 'AccountId32', }, - enact_authorized_upgrade: { - code: 'Bytes' + KilledAccount: { + account: 'AccountId32', + }, + Remarked: { + _alias: { + hash_: 'hash', + }, + sender: 'AccountId32', + hash_: 'H256' } } }, /** - * Lookup29: cumulus_primitives_parachain_inherent::ParachainInherentData + * Lookup19: frame_support::weights::DispatchInfo **/ - CumulusPrimitivesParachainInherentParachainInherentData: { - validationData: 'PolkadotPrimitivesV2PersistedValidationData', - relayChainState: 'SpTrieStorageProof', - downwardMessages: 'Vec', - horizontalMessages: 'BTreeMap>' + FrameSupportWeightsDispatchInfo: { + weight: 'u64', + class: 'FrameSupportWeightsDispatchClass', + paysFee: 'FrameSupportWeightsPays' }, /** - * Lookup31: polkadot_core_primitives::InboundDownwardMessage + * Lookup20: frame_support::weights::DispatchClass **/ - PolkadotCorePrimitivesInboundDownwardMessage: { - sentAt: 'u32', - msg: 'Bytes' + FrameSupportWeightsDispatchClass: { + _enum: ['Normal', 'Operational', 'Mandatory'] }, /** - * Lookup34: polkadot_core_primitives::InboundHrmpMessage + * Lookup21: frame_support::weights::Pays **/ - PolkadotCorePrimitivesInboundHrmpMessage: { - sentAt: 'u32', - data: 'Bytes' + FrameSupportWeightsPays: { + _enum: ['Yes', 'No'] }, /** - * Lookup37: cumulus_pallet_parachain_system::pallet::Event + * Lookup22: sp_runtime::DispatchError **/ - CumulusPalletParachainSystemEvent: { + SpRuntimeDispatchError: { _enum: { - ValidationFunctionStored: 'Null', - ValidationFunctionApplied: { - relayChainBlockNum: 'u32', - }, - ValidationFunctionDiscarded: 'Null', - UpgradeAuthorized: { - codeHash: 'H256', - }, - DownwardMessagesReceived: { - count: 'u32', - }, - DownwardMessagesProcessed: { - weightUsed: 'u64', - dmqHead: 'H256' - } + Other: 'Null', + CannotLookup: 'Null', + BadOrigin: 'Null', + Module: 'SpRuntimeModuleError', + ConsumerRemaining: 'Null', + NoProviders: 'Null', + TooManyConsumers: 'Null', + Token: 'SpRuntimeTokenError', + Arithmetic: 'SpRuntimeArithmeticError', + Transactional: 'SpRuntimeTransactionalError' } }, /** - * Lookup38: cumulus_pallet_parachain_system::pallet::Error - **/ - CumulusPalletParachainSystemError: { - _enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized'] - }, - /** - * Lookup41: pallet_balances::AccountData - **/ - PalletBalancesAccountData: { - free: 'u128', - reserved: 'u128', - miscFrozen: 'u128', - feeFrozen: 'u128' - }, - /** - * Lookup43: pallet_balances::BalanceLock + * Lookup23: sp_runtime::ModuleError **/ - PalletBalancesBalanceLock: { - id: '[u8;8]', - amount: 'u128', - reasons: 'PalletBalancesReasons' + SpRuntimeModuleError: { + index: 'u8', + error: '[u8;4]' }, /** - * Lookup45: pallet_balances::Reasons + * Lookup24: sp_runtime::TokenError **/ - PalletBalancesReasons: { - _enum: ['Fee', 'Misc', 'All'] + SpRuntimeTokenError: { + _enum: ['NoFunds', 'WouldDie', 'BelowMinimum', 'CannotCreate', 'UnknownAsset', 'Frozen', 'Unsupported'] }, /** - * Lookup48: pallet_balances::ReserveData + * Lookup25: sp_runtime::ArithmeticError **/ - PalletBalancesReserveData: { - id: '[u8;16]', - amount: 'u128' + SpRuntimeArithmeticError: { + _enum: ['Underflow', 'Overflow', 'DivisionByZero'] }, /** - * Lookup51: pallet_balances::Releases + * Lookup26: sp_runtime::TransactionalError **/ - PalletBalancesReleases: { - _enum: ['V1_0_0', 'V2_0_0'] + SpRuntimeTransactionalError: { + _enum: ['LimitReached', 'NoLayer'] }, /** - * Lookup52: pallet_balances::pallet::Call + * Lookup27: cumulus_pallet_parachain_system::pallet::Event **/ - PalletBalancesCall: { + CumulusPalletParachainSystemEvent: { _enum: { - transfer: { - dest: 'MultiAddress', - value: 'Compact', - }, - set_balance: { - who: 'MultiAddress', - newFree: 'Compact', - newReserved: 'Compact', - }, - force_transfer: { - source: 'MultiAddress', - dest: 'MultiAddress', - value: 'Compact', + ValidationFunctionStored: 'Null', + ValidationFunctionApplied: { + relayChainBlockNum: 'u32', }, - transfer_keep_alive: { - dest: 'MultiAddress', - value: 'Compact', + ValidationFunctionDiscarded: 'Null', + UpgradeAuthorized: { + codeHash: 'H256', }, - transfer_all: { - dest: 'MultiAddress', - keepAlive: 'bool', + DownwardMessagesReceived: { + count: 'u32', }, - force_unreserve: { - who: 'MultiAddress', - amount: 'u128' + DownwardMessagesProcessed: { + weightUsed: 'u64', + dmqHead: 'H256' } } }, /** - * Lookup58: pallet_balances::pallet::Event + * Lookup28: pallet_balances::pallet::Event **/ PalletBalancesEvent: { _enum: { @@ -257,64 +225,25 @@ export default { } }, /** - * Lookup59: frame_support::traits::tokens::misc::BalanceStatus + * Lookup29: frame_support::traits::tokens::misc::BalanceStatus **/ FrameSupportTokensMiscBalanceStatus: { _enum: ['Free', 'Reserved'] }, /** - * Lookup60: pallet_balances::pallet::Error - **/ - PalletBalancesError: { - _enum: ['VestingBalance', 'LiquidityRestrictions', 'InsufficientBalance', 'ExistentialDeposit', 'KeepAlive', 'ExistingVestingSchedule', 'DeadAccount', 'TooManyReserves'] - }, - /** - * Lookup63: pallet_timestamp::pallet::Call - **/ - PalletTimestampCall: { - _enum: { - set: { - now: 'Compact' - } - } - }, - /** - * Lookup66: pallet_transaction_payment::Releases - **/ - PalletTransactionPaymentReleases: { - _enum: ['V1Ancient', 'V2'] - }, - /** - * Lookup67: pallet_treasury::Proposal - **/ - PalletTreasuryProposal: { - proposer: 'AccountId32', - value: 'u128', - beneficiary: 'AccountId32', - bond: 'u128' - }, - /** - * Lookup70: pallet_treasury::pallet::Call + * Lookup30: pallet_transaction_payment::pallet::Event **/ - PalletTreasuryCall: { + PalletTransactionPaymentEvent: { _enum: { - propose_spend: { - value: 'Compact', - beneficiary: 'MultiAddress', - }, - reject_proposal: { - proposalId: 'Compact', - }, - approve_proposal: { - proposalId: 'Compact', - }, - remove_approval: { - proposalId: 'Compact' + TransactionFeePaid: { + who: 'AccountId32', + actualFee: 'u128', + tip: 'u128' } } }, /** - * Lookup72: pallet_treasury::pallet::Event + * Lookup31: pallet_treasury::pallet::Event **/ PalletTreasuryEvent: { _enum: { @@ -340,103 +269,52 @@ export default { rolloverBalance: 'u128', }, Deposit: { - value: 'u128' + value: 'u128', + }, + SpendApproved: { + proposalIndex: 'u32', + amount: 'u128', + beneficiary: 'AccountId32' } } }, /** - * Lookup75: frame_support::PalletId + * Lookup32: pallet_sudo::pallet::Event **/ - FrameSupportPalletId: '[u8;8]', - /** - * Lookup76: pallet_treasury::pallet::Error - **/ - PalletTreasuryError: { - _enum: ['InsufficientProposersBalance', 'InvalidIndex', 'TooManyApprovals', 'ProposalNotApproved'] - }, - /** - * Lookup77: pallet_sudo::pallet::Call - **/ - PalletSudoCall: { - _enum: { - sudo: { - call: 'Call', - }, - sudo_unchecked_weight: { - call: 'Call', - weight: 'u64', - }, - set_key: { - _alias: { - new_: 'new', - }, - new_: 'MultiAddress', - }, - sudo_as: { - who: 'MultiAddress', - call: 'Call' - } - } - }, - /** - * Lookup79: frame_system::pallet::Call - **/ - FrameSystemCall: { + PalletSudoEvent: { _enum: { - fill_block: { - ratio: 'Perbill', - }, - remark: { - remark: 'Bytes', - }, - set_heap_pages: { - pages: 'u64', - }, - set_code: { - code: 'Bytes', - }, - set_code_without_checks: { - code: 'Bytes', - }, - set_storage: { - items: 'Vec<(Bytes,Bytes)>', - }, - kill_storage: { - _alias: { - keys_: 'keys', - }, - keys_: 'Vec', + Sudid: { + sudoResult: 'Result', }, - kill_prefix: { - prefix: 'Bytes', - subkeys: 'u32', + KeyChanged: { + oldSudoer: 'Option', }, - remark_with_event: { - remark: 'Bytes' + SudoAsDone: { + sudoResult: 'Result' } } }, /** - * Lookup83: orml_vesting::module::Call + * Lookup36: orml_vesting::module::Event **/ - OrmlVestingModuleCall: { + OrmlVestingModuleEvent: { _enum: { - claim: 'Null', - vested_transfer: { - dest: 'MultiAddress', - schedule: 'OrmlVestingVestingSchedule', + VestingScheduleAdded: { + from: 'AccountId32', + to: 'AccountId32', + vestingSchedule: 'OrmlVestingVestingSchedule', }, - update_vesting_schedules: { - who: 'MultiAddress', - vestingSchedules: 'Vec', + Claimed: { + who: 'AccountId32', + amount: 'u128', }, - claim_for: { - dest: 'MultiAddress' + VestingSchedulesUpdated: { + who: 'AccountId32' } } }, /** - * Lookup84: orml_vesting::VestingSchedule + * Lookup37: orml_vesting::VestingSchedule **/ OrmlVestingVestingSchedule: { start: 'u32', @@ -445,147 +323,145 @@ export default { perPeriod: 'Compact' }, /** - * Lookup86: cumulus_pallet_xcmp_queue::pallet::Call + * Lookup39: cumulus_pallet_xcmp_queue::pallet::Event **/ - CumulusPalletXcmpQueueCall: { + CumulusPalletXcmpQueueEvent: { _enum: { - service_overweight: { - index: 'u64', - weightLimit: 'u64', + Success: { + messageHash: 'Option', + weight: 'u64', }, - suspend_xcm_execution: 'Null', - resume_xcm_execution: 'Null', - update_suspend_threshold: { - _alias: { - new_: 'new', - }, - new_: 'u32', + Fail: { + messageHash: 'Option', + error: 'XcmV2TraitsError', + weight: 'u64', }, - update_drop_threshold: { - _alias: { - new_: 'new', - }, - new_: 'u32', + BadVersion: { + messageHash: 'Option', }, - update_resume_threshold: { - _alias: { - new_: 'new', - }, - new_: 'u32', + BadFormat: { + messageHash: 'Option', }, - update_threshold_weight: { - _alias: { - new_: 'new', - }, - new_: 'u64', + UpwardMessageSent: { + messageHash: 'Option', }, - update_weight_restrict_decay: { - _alias: { - new_: 'new', - }, - new_: 'u64', + XcmpMessageSent: { + messageHash: 'Option', }, - update_xcmp_max_individual_weight: { - _alias: { - new_: 'new', - }, - new_: 'u64' + OverweightEnqueued: { + sender: 'u32', + sentAt: 'u32', + index: 'u64', + required: 'u64', + }, + OverweightServiced: { + index: 'u64', + used: 'u64' } } }, /** - * Lookup87: pallet_xcm::pallet::Call + * Lookup41: xcm::v2::traits::Error **/ - PalletXcmCall: { + XcmV2TraitsError: { _enum: { - send: { - dest: 'XcmVersionedMultiLocation', - message: 'XcmVersionedXcm', - }, - teleport_assets: { - dest: 'XcmVersionedMultiLocation', - beneficiary: 'XcmVersionedMultiLocation', - assets: 'XcmVersionedMultiAssets', - feeAssetItem: 'u32', - }, - reserve_transfer_assets: { - dest: 'XcmVersionedMultiLocation', - beneficiary: 'XcmVersionedMultiLocation', - assets: 'XcmVersionedMultiAssets', - feeAssetItem: 'u32', - }, - execute: { - message: 'XcmVersionedXcm', - maxWeight: 'u64', - }, - force_xcm_version: { - location: 'XcmV1MultiLocation', - xcmVersion: 'u32', - }, - force_default_xcm_version: { - maybeXcmVersion: 'Option', - }, - force_subscribe_version_notify: { - location: 'XcmVersionedMultiLocation', - }, - force_unsubscribe_version_notify: { - location: 'XcmVersionedMultiLocation', - }, - limited_reserve_transfer_assets: { - dest: 'XcmVersionedMultiLocation', - beneficiary: 'XcmVersionedMultiLocation', - assets: 'XcmVersionedMultiAssets', - feeAssetItem: 'u32', - weightLimit: 'XcmV2WeightLimit', - }, - limited_teleport_assets: { - dest: 'XcmVersionedMultiLocation', - beneficiary: 'XcmVersionedMultiLocation', - assets: 'XcmVersionedMultiAssets', - feeAssetItem: 'u32', - weightLimit: 'XcmV2WeightLimit' - } + Overflow: 'Null', + Unimplemented: 'Null', + UntrustedReserveLocation: 'Null', + UntrustedTeleportLocation: 'Null', + MultiLocationFull: 'Null', + MultiLocationNotInvertible: 'Null', + BadOrigin: 'Null', + InvalidLocation: 'Null', + AssetNotFound: 'Null', + FailedToTransactAsset: 'Null', + NotWithdrawable: 'Null', + LocationCannotHold: 'Null', + ExceedsMaxMessageSize: 'Null', + DestinationUnsupported: 'Null', + Transport: 'Null', + Unroutable: 'Null', + UnknownClaim: 'Null', + FailedToDecode: 'Null', + MaxWeightInvalid: 'Null', + NotHoldingFees: 'Null', + TooExpensive: 'Null', + Trap: 'u64', + UnhandledXcmVersion: 'Null', + WeightLimitReached: 'u64', + Barrier: 'Null', + WeightNotComputable: 'Null' } }, /** - * Lookup88: xcm::VersionedMultiLocation + * Lookup43: pallet_xcm::pallet::Event **/ - XcmVersionedMultiLocation: { + PalletXcmEvent: { _enum: { - V0: 'XcmV0MultiLocation', - V1: 'XcmV1MultiLocation' + Attempted: 'XcmV2TraitsOutcome', + Sent: '(XcmV1MultiLocation,XcmV1MultiLocation,XcmV2Xcm)', + UnexpectedResponse: '(XcmV1MultiLocation,u64)', + ResponseReady: '(u64,XcmV2Response)', + Notified: '(u64,u8,u8)', + NotifyOverweight: '(u64,u8,u8,u64,u64)', + NotifyDispatchError: '(u64,u8,u8)', + NotifyDecodeFailed: '(u64,u8,u8)', + InvalidResponder: '(XcmV1MultiLocation,u64,Option)', + InvalidResponderVersion: '(XcmV1MultiLocation,u64)', + ResponseTaken: 'u64', + AssetsTrapped: '(H256,XcmV1MultiLocation,XcmVersionedMultiAssets)', + VersionChangeNotified: '(XcmV1MultiLocation,u32)', + SupportedVersionChanged: '(XcmV1MultiLocation,u32)', + NotifyTargetSendFail: '(XcmV1MultiLocation,u64,XcmV2TraitsError)', + NotifyTargetMigrationFail: '(XcmVersionedMultiLocation,u64)' } }, /** - * Lookup89: xcm::v0::multi_location::MultiLocation + * Lookup44: xcm::v2::traits::Outcome **/ - XcmV0MultiLocation: { + XcmV2TraitsOutcome: { _enum: { - Null: 'Null', - X1: 'XcmV0Junction', - X2: '(XcmV0Junction,XcmV0Junction)', - X3: '(XcmV0Junction,XcmV0Junction,XcmV0Junction)', - X4: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', - X5: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', - X6: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', - X7: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', - X8: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)' + Complete: 'u64', + Incomplete: '(u64,XcmV2TraitsError)', + Error: 'XcmV2TraitsError' } }, /** - * Lookup90: xcm::v0::junction::Junction + * Lookup45: xcm::v1::multilocation::MultiLocation **/ - XcmV0Junction: { + XcmV1MultiLocation: { + parents: 'u8', + interior: 'XcmV1MultilocationJunctions' + }, + /** + * Lookup46: xcm::v1::multilocation::Junctions + **/ + XcmV1MultilocationJunctions: { _enum: { - Parent: 'Null', - Parachain: 'Compact', - AccountId32: { - network: 'XcmV0JunctionNetworkId', - id: '[u8;32]', - }, - AccountIndex64: { - network: 'XcmV0JunctionNetworkId', - index: 'Compact', + Here: 'Null', + X1: 'XcmV1Junction', + X2: '(XcmV1Junction,XcmV1Junction)', + X3: '(XcmV1Junction,XcmV1Junction,XcmV1Junction)', + X4: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', + X5: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', + X6: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', + X7: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', + X8: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)' + } + }, + /** + * Lookup47: xcm::v1::junction::Junction + **/ + XcmV1Junction: { + _enum: { + Parachain: 'Compact', + AccountId32: { + network: 'XcmV0JunctionNetworkId', + id: '[u8;32]', + }, + AccountIndex64: { + network: 'XcmV0JunctionNetworkId', + index: 'Compact', }, AccountKey20: { network: 'XcmV0JunctionNetworkId', @@ -602,7 +478,7 @@ export default { } }, /** - * Lookup91: xcm::v0::junction::NetworkId + * Lookup49: xcm::v0::junction::NetworkId **/ XcmV0JunctionNetworkId: { _enum: { @@ -613,7 +489,7 @@ export default { } }, /** - * Lookup92: xcm::v0::junction::BodyId + * Lookup53: xcm::v0::junction::BodyId **/ XcmV0JunctionBodyId: { _enum: { @@ -627,7 +503,7 @@ export default { } }, /** - * Lookup93: xcm::v0::junction::BodyPart + * Lookup54: xcm::v0::junction::BodyPart **/ XcmV0JunctionBodyPart: { _enum: { @@ -650,99 +526,34 @@ export default { } }, /** - * Lookup94: xcm::v1::multilocation::MultiLocation - **/ - XcmV1MultiLocation: { - parents: 'u8', - interior: 'XcmV1MultilocationJunctions' - }, - /** - * Lookup95: xcm::v1::multilocation::Junctions - **/ - XcmV1MultilocationJunctions: { - _enum: { - Here: 'Null', - X1: 'XcmV1Junction', - X2: '(XcmV1Junction,XcmV1Junction)', - X3: '(XcmV1Junction,XcmV1Junction,XcmV1Junction)', - X4: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', - X5: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', - X6: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', - X7: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', - X8: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)' - } - }, - /** - * Lookup96: xcm::v1::junction::Junction - **/ - XcmV1Junction: { - _enum: { - Parachain: 'Compact', - AccountId32: { - network: 'XcmV0JunctionNetworkId', - id: '[u8;32]', - }, - AccountIndex64: { - network: 'XcmV0JunctionNetworkId', - index: 'Compact', - }, - AccountKey20: { - network: 'XcmV0JunctionNetworkId', - key: '[u8;20]', - }, - PalletInstance: 'u8', - GeneralIndex: 'Compact', - GeneralKey: 'Bytes', - OnlyChild: 'Null', - Plurality: { - id: 'XcmV0JunctionBodyId', - part: 'XcmV0JunctionBodyPart' - } - } - }, - /** - * Lookup97: xcm::VersionedXcm + * Lookup55: xcm::v2::Xcm **/ - XcmVersionedXcm: { - _enum: { - V0: 'XcmV0Xcm', - V1: 'XcmV1Xcm', - V2: 'XcmV2Xcm' - } - }, + XcmV2Xcm: 'Vec', /** - * Lookup98: xcm::v0::Xcm + * Lookup57: xcm::v2::Instruction **/ - XcmV0Xcm: { + XcmV2Instruction: { _enum: { - WithdrawAsset: { - assets: 'Vec', - effects: 'Vec', - }, - ReserveAssetDeposit: { - assets: 'Vec', - effects: 'Vec', - }, - TeleportAsset: { - assets: 'Vec', - effects: 'Vec', - }, + WithdrawAsset: 'XcmV1MultiassetMultiAssets', + ReserveAssetDeposited: 'XcmV1MultiassetMultiAssets', + ReceiveTeleportedAsset: 'XcmV1MultiassetMultiAssets', QueryResponse: { queryId: 'Compact', - response: 'XcmV0Response', + response: 'XcmV2Response', + maxWeight: 'Compact', }, TransferAsset: { - assets: 'Vec', - dest: 'XcmV0MultiLocation', + assets: 'XcmV1MultiassetMultiAssets', + beneficiary: 'XcmV1MultiLocation', }, TransferReserveAsset: { - assets: 'Vec', - dest: 'XcmV0MultiLocation', - effects: 'Vec', + assets: 'XcmV1MultiassetMultiAssets', + dest: 'XcmV1MultiLocation', + xcm: 'XcmV2Xcm', }, Transact: { originType: 'XcmV0OriginKind', - requireWeightAtMost: 'u64', + requireWeightAtMost: 'Compact', call: 'XcmDoubleEncoded', }, HrmpNewChannelOpenRequest: { @@ -758,263 +569,132 @@ export default { sender: 'Compact', recipient: 'Compact', }, - RelayedFrom: { - who: 'XcmV0MultiLocation', - message: 'XcmV0Xcm' - } - } - }, - /** - * Lookup100: xcm::v0::multi_asset::MultiAsset - **/ - XcmV0MultiAsset: { - _enum: { - None: 'Null', - All: 'Null', - AllFungible: 'Null', - AllNonFungible: 'Null', - AllAbstractFungible: { - id: 'Bytes', - }, - AllAbstractNonFungible: { - class: 'Bytes', - }, - AllConcreteFungible: { - id: 'XcmV0MultiLocation', - }, - AllConcreteNonFungible: { - class: 'XcmV0MultiLocation', - }, - AbstractFungible: { - id: 'Bytes', - amount: 'Compact', - }, - AbstractNonFungible: { - class: 'Bytes', - instance: 'XcmV1MultiassetAssetInstance', - }, - ConcreteFungible: { - id: 'XcmV0MultiLocation', - amount: 'Compact', + ClearOrigin: 'Null', + DescendOrigin: 'XcmV1MultilocationJunctions', + ReportError: { + queryId: 'Compact', + dest: 'XcmV1MultiLocation', + maxResponseWeight: 'Compact', }, - ConcreteNonFungible: { - class: 'XcmV0MultiLocation', - instance: 'XcmV1MultiassetAssetInstance' - } - } - }, - /** - * Lookup101: xcm::v1::multiasset::AssetInstance - **/ - XcmV1MultiassetAssetInstance: { - _enum: { - Undefined: 'Null', - Index: 'Compact', - Array4: '[u8;4]', - Array8: '[u8;8]', - Array16: '[u8;16]', - Array32: '[u8;32]', - Blob: 'Bytes' - } - }, - /** - * Lookup104: xcm::v0::order::Order - **/ - XcmV0Order: { - _enum: { - Null: 'Null', DepositAsset: { - assets: 'Vec', - dest: 'XcmV0MultiLocation', + assets: 'XcmV1MultiassetMultiAssetFilter', + maxAssets: 'Compact', + beneficiary: 'XcmV1MultiLocation', }, DepositReserveAsset: { - assets: 'Vec', - dest: 'XcmV0MultiLocation', - effects: 'Vec', + assets: 'XcmV1MultiassetMultiAssetFilter', + maxAssets: 'Compact', + dest: 'XcmV1MultiLocation', + xcm: 'XcmV2Xcm', }, ExchangeAsset: { - give: 'Vec', - receive: 'Vec', + give: 'XcmV1MultiassetMultiAssetFilter', + receive: 'XcmV1MultiassetMultiAssets', }, InitiateReserveWithdraw: { - assets: 'Vec', - reserve: 'XcmV0MultiLocation', - effects: 'Vec', + assets: 'XcmV1MultiassetMultiAssetFilter', + reserve: 'XcmV1MultiLocation', + xcm: 'XcmV2Xcm', }, InitiateTeleport: { - assets: 'Vec', - dest: 'XcmV0MultiLocation', - effects: 'Vec', + assets: 'XcmV1MultiassetMultiAssetFilter', + dest: 'XcmV1MultiLocation', + xcm: 'XcmV2Xcm', }, QueryHolding: { queryId: 'Compact', - dest: 'XcmV0MultiLocation', - assets: 'Vec', + dest: 'XcmV1MultiLocation', + assets: 'XcmV1MultiassetMultiAssetFilter', + maxResponseWeight: 'Compact', }, BuyExecution: { - fees: 'XcmV0MultiAsset', - weight: 'u64', - debt: 'u64', - haltOnError: 'bool', - xcm: 'Vec' - } + fees: 'XcmV1MultiAsset', + weightLimit: 'XcmV2WeightLimit', + }, + RefundSurplus: 'Null', + SetErrorHandler: 'XcmV2Xcm', + SetAppendix: 'XcmV2Xcm', + ClearError: 'Null', + ClaimAsset: { + assets: 'XcmV1MultiassetMultiAssets', + ticket: 'XcmV1MultiLocation', + }, + Trap: 'Compact', + SubscribeVersion: { + queryId: 'Compact', + maxResponseWeight: 'Compact', + }, + UnsubscribeVersion: 'Null' } }, /** - * Lookup106: xcm::v0::Response + * Lookup58: xcm::v1::multiasset::MultiAssets **/ - XcmV0Response: { - _enum: { - Assets: 'Vec' - } - }, + XcmV1MultiassetMultiAssets: 'Vec', /** - * Lookup107: xcm::v0::OriginKind + * Lookup60: xcm::v1::multiasset::MultiAsset **/ - XcmV0OriginKind: { - _enum: ['Native', 'SovereignAccount', 'Superuser', 'Xcm'] + XcmV1MultiAsset: { + id: 'XcmV1MultiassetAssetId', + fun: 'XcmV1MultiassetFungibility' }, /** - * Lookup108: xcm::double_encoded::DoubleEncoded + * Lookup61: xcm::v1::multiasset::AssetId **/ - XcmDoubleEncoded: { - encoded: 'Bytes' + XcmV1MultiassetAssetId: { + _enum: { + Concrete: 'XcmV1MultiLocation', + Abstract: 'Bytes' + } }, /** - * Lookup109: xcm::v1::Xcm + * Lookup62: xcm::v1::multiasset::Fungibility **/ - XcmV1Xcm: { + XcmV1MultiassetFungibility: { _enum: { - WithdrawAsset: { - assets: 'XcmV1MultiassetMultiAssets', - effects: 'Vec', - }, - ReserveAssetDeposited: { - assets: 'XcmV1MultiassetMultiAssets', - effects: 'Vec', - }, - ReceiveTeleportedAsset: { - assets: 'XcmV1MultiassetMultiAssets', - effects: 'Vec', - }, - QueryResponse: { - queryId: 'Compact', - response: 'XcmV1Response', - }, - TransferAsset: { - assets: 'XcmV1MultiassetMultiAssets', - beneficiary: 'XcmV1MultiLocation', - }, - TransferReserveAsset: { - assets: 'XcmV1MultiassetMultiAssets', - dest: 'XcmV1MultiLocation', - effects: 'Vec', - }, - Transact: { - originType: 'XcmV0OriginKind', - requireWeightAtMost: 'u64', - call: 'XcmDoubleEncoded', - }, - HrmpNewChannelOpenRequest: { - sender: 'Compact', - maxMessageSize: 'Compact', - maxCapacity: 'Compact', - }, - HrmpChannelAccepted: { - recipient: 'Compact', - }, - HrmpChannelClosing: { - initiator: 'Compact', - sender: 'Compact', - recipient: 'Compact', - }, - RelayedFrom: { - who: 'XcmV1MultilocationJunctions', - message: 'XcmV1Xcm', - }, - SubscribeVersion: { - queryId: 'Compact', - maxResponseWeight: 'Compact', - }, - UnsubscribeVersion: 'Null' + Fungible: 'Compact', + NonFungible: 'XcmV1MultiassetAssetInstance' } }, /** - * Lookup110: xcm::v1::multiasset::MultiAssets + * Lookup63: xcm::v1::multiasset::AssetInstance **/ - XcmV1MultiassetMultiAssets: 'Vec', - /** - * Lookup112: xcm::v1::multiasset::MultiAsset - **/ - XcmV1MultiAsset: { - id: 'XcmV1MultiassetAssetId', - fun: 'XcmV1MultiassetFungibility' + XcmV1MultiassetAssetInstance: { + _enum: { + Undefined: 'Null', + Index: 'Compact', + Array4: '[u8;4]', + Array8: '[u8;8]', + Array16: '[u8;16]', + Array32: '[u8;32]', + Blob: 'Bytes' + } }, /** - * Lookup113: xcm::v1::multiasset::AssetId + * Lookup66: xcm::v2::Response **/ - XcmV1MultiassetAssetId: { + XcmV2Response: { _enum: { - Concrete: 'XcmV1MultiLocation', - Abstract: 'Bytes' + Null: 'Null', + Assets: 'XcmV1MultiassetMultiAssets', + ExecutionResult: 'Option<(u32,XcmV2TraitsError)>', + Version: 'u32' } }, /** - * Lookup114: xcm::v1::multiasset::Fungibility + * Lookup69: xcm::v0::OriginKind **/ - XcmV1MultiassetFungibility: { - _enum: { - Fungible: 'Compact', - NonFungible: 'XcmV1MultiassetAssetInstance' - } + XcmV0OriginKind: { + _enum: ['Native', 'SovereignAccount', 'Superuser', 'Xcm'] }, /** - * Lookup116: xcm::v1::order::Order + * Lookup70: xcm::double_encoded::DoubleEncoded **/ - XcmV1Order: { - _enum: { - Noop: 'Null', - DepositAsset: { - assets: 'XcmV1MultiassetMultiAssetFilter', - maxAssets: 'u32', - beneficiary: 'XcmV1MultiLocation', - }, - DepositReserveAsset: { - assets: 'XcmV1MultiassetMultiAssetFilter', - maxAssets: 'u32', - dest: 'XcmV1MultiLocation', - effects: 'Vec', - }, - ExchangeAsset: { - give: 'XcmV1MultiassetMultiAssetFilter', - receive: 'XcmV1MultiassetMultiAssets', - }, - InitiateReserveWithdraw: { - assets: 'XcmV1MultiassetMultiAssetFilter', - reserve: 'XcmV1MultiLocation', - effects: 'Vec', - }, - InitiateTeleport: { - assets: 'XcmV1MultiassetMultiAssetFilter', - dest: 'XcmV1MultiLocation', - effects: 'Vec', - }, - QueryHolding: { - queryId: 'Compact', - dest: 'XcmV1MultiLocation', - assets: 'XcmV1MultiassetMultiAssetFilter', - }, - BuyExecution: { - fees: 'XcmV1MultiAsset', - weight: 'u64', - debt: 'u64', - haltOnError: 'bool', - instructions: 'Vec' - } - } + XcmDoubleEncoded: { + encoded: 'Bytes' }, /** - * Lookup117: xcm::v1::multiasset::MultiAssetFilter + * Lookup71: xcm::v1::multiasset::MultiAssetFilter **/ XcmV1MultiassetMultiAssetFilter: { _enum: { @@ -1023,7 +703,7 @@ export default { } }, /** - * Lookup118: xcm::v1::multiasset::WildMultiAsset + * Lookup72: xcm::v1::multiasset::WildMultiAsset **/ XcmV1MultiassetWildMultiAsset: { _enum: { @@ -1035,1535 +715,1899 @@ export default { } }, /** - * Lookup119: xcm::v1::multiasset::WildFungibility + * Lookup73: xcm::v1::multiasset::WildFungibility **/ XcmV1MultiassetWildFungibility: { _enum: ['Fungible', 'NonFungible'] }, /** - * Lookup121: xcm::v1::Response + * Lookup74: xcm::v2::WeightLimit **/ - XcmV1Response: { + XcmV2WeightLimit: { _enum: { - Assets: 'XcmV1MultiassetMultiAssets', - Version: 'u32' + Unlimited: 'Null', + Limited: 'Compact' } }, /** - * Lookup122: xcm::v2::Xcm + * Lookup76: xcm::VersionedMultiAssets **/ - XcmV2Xcm: 'Vec', + XcmVersionedMultiAssets: { + _enum: { + V0: 'Vec', + V1: 'XcmV1MultiassetMultiAssets' + } + }, /** - * Lookup124: xcm::v2::Instruction + * Lookup78: xcm::v0::multi_asset::MultiAsset **/ - XcmV2Instruction: { + XcmV0MultiAsset: { _enum: { - WithdrawAsset: 'XcmV1MultiassetMultiAssets', - ReserveAssetDeposited: 'XcmV1MultiassetMultiAssets', - ReceiveTeleportedAsset: 'XcmV1MultiassetMultiAssets', - QueryResponse: { - queryId: 'Compact', - response: 'XcmV2Response', - maxWeight: 'Compact', - }, - TransferAsset: { - assets: 'XcmV1MultiassetMultiAssets', - beneficiary: 'XcmV1MultiLocation', - }, - TransferReserveAsset: { - assets: 'XcmV1MultiassetMultiAssets', - dest: 'XcmV1MultiLocation', - xcm: 'XcmV2Xcm', - }, - Transact: { - originType: 'XcmV0OriginKind', - requireWeightAtMost: 'Compact', - call: 'XcmDoubleEncoded', - }, - HrmpNewChannelOpenRequest: { - sender: 'Compact', - maxMessageSize: 'Compact', - maxCapacity: 'Compact', - }, - HrmpChannelAccepted: { - recipient: 'Compact', - }, - HrmpChannelClosing: { - initiator: 'Compact', - sender: 'Compact', - recipient: 'Compact', - }, - ClearOrigin: 'Null', - DescendOrigin: 'XcmV1MultilocationJunctions', - ReportError: { - queryId: 'Compact', - dest: 'XcmV1MultiLocation', - maxResponseWeight: 'Compact', - }, - DepositAsset: { - assets: 'XcmV1MultiassetMultiAssetFilter', - maxAssets: 'Compact', - beneficiary: 'XcmV1MultiLocation', - }, - DepositReserveAsset: { - assets: 'XcmV1MultiassetMultiAssetFilter', - maxAssets: 'Compact', - dest: 'XcmV1MultiLocation', - xcm: 'XcmV2Xcm', - }, - ExchangeAsset: { - give: 'XcmV1MultiassetMultiAssetFilter', - receive: 'XcmV1MultiassetMultiAssets', + None: 'Null', + All: 'Null', + AllFungible: 'Null', + AllNonFungible: 'Null', + AllAbstractFungible: { + id: 'Bytes', }, - InitiateReserveWithdraw: { - assets: 'XcmV1MultiassetMultiAssetFilter', - reserve: 'XcmV1MultiLocation', - xcm: 'XcmV2Xcm', + AllAbstractNonFungible: { + class: 'Bytes', }, - InitiateTeleport: { - assets: 'XcmV1MultiassetMultiAssetFilter', - dest: 'XcmV1MultiLocation', - xcm: 'XcmV2Xcm', + AllConcreteFungible: { + id: 'XcmV0MultiLocation', }, - QueryHolding: { - queryId: 'Compact', - dest: 'XcmV1MultiLocation', - assets: 'XcmV1MultiassetMultiAssetFilter', - maxResponseWeight: 'Compact', + AllConcreteNonFungible: { + class: 'XcmV0MultiLocation', }, - BuyExecution: { - fees: 'XcmV1MultiAsset', - weightLimit: 'XcmV2WeightLimit', + AbstractFungible: { + id: 'Bytes', + amount: 'Compact', }, - RefundSurplus: 'Null', - SetErrorHandler: 'XcmV2Xcm', - SetAppendix: 'XcmV2Xcm', - ClearError: 'Null', - ClaimAsset: { - assets: 'XcmV1MultiassetMultiAssets', - ticket: 'XcmV1MultiLocation', + AbstractNonFungible: { + class: 'Bytes', + instance: 'XcmV1MultiassetAssetInstance', }, - Trap: 'Compact', - SubscribeVersion: { - queryId: 'Compact', - maxResponseWeight: 'Compact', + ConcreteFungible: { + id: 'XcmV0MultiLocation', + amount: 'Compact', }, - UnsubscribeVersion: 'Null' + ConcreteNonFungible: { + class: 'XcmV0MultiLocation', + instance: 'XcmV1MultiassetAssetInstance' + } } }, /** - * Lookup125: xcm::v2::Response + * Lookup79: xcm::v0::multi_location::MultiLocation **/ - XcmV2Response: { + XcmV0MultiLocation: { _enum: { Null: 'Null', - Assets: 'XcmV1MultiassetMultiAssets', - ExecutionResult: 'Option<(u32,XcmV2TraitsError)>', - Version: 'u32' - } + X1: 'XcmV0Junction', + X2: '(XcmV0Junction,XcmV0Junction)', + X3: '(XcmV0Junction,XcmV0Junction,XcmV0Junction)', + X4: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', + X5: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', + X6: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', + X7: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', + X8: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)' + } }, /** - * Lookup128: xcm::v2::traits::Error + * Lookup80: xcm::v0::junction::Junction **/ - XcmV2TraitsError: { + XcmV0Junction: { _enum: { - Overflow: 'Null', - Unimplemented: 'Null', - UntrustedReserveLocation: 'Null', - UntrustedTeleportLocation: 'Null', - MultiLocationFull: 'Null', - MultiLocationNotInvertible: 'Null', - BadOrigin: 'Null', - InvalidLocation: 'Null', - AssetNotFound: 'Null', - FailedToTransactAsset: 'Null', - NotWithdrawable: 'Null', - LocationCannotHold: 'Null', - ExceedsMaxMessageSize: 'Null', - DestinationUnsupported: 'Null', - Transport: 'Null', - Unroutable: 'Null', - UnknownClaim: 'Null', - FailedToDecode: 'Null', - MaxWeightInvalid: 'Null', - NotHoldingFees: 'Null', - TooExpensive: 'Null', - Trap: 'u64', - UnhandledXcmVersion: 'Null', - WeightLimitReached: 'u64', - Barrier: 'Null', - WeightNotComputable: 'Null' + Parent: 'Null', + Parachain: 'Compact', + AccountId32: { + network: 'XcmV0JunctionNetworkId', + id: '[u8;32]', + }, + AccountIndex64: { + network: 'XcmV0JunctionNetworkId', + index: 'Compact', + }, + AccountKey20: { + network: 'XcmV0JunctionNetworkId', + key: '[u8;20]', + }, + PalletInstance: 'u8', + GeneralIndex: 'Compact', + GeneralKey: 'Bytes', + OnlyChild: 'Null', + Plurality: { + id: 'XcmV0JunctionBodyId', + part: 'XcmV0JunctionBodyPart' + } } }, /** - * Lookup129: xcm::v2::WeightLimit + * Lookup81: xcm::VersionedMultiLocation **/ - XcmV2WeightLimit: { + XcmVersionedMultiLocation: { _enum: { - Unlimited: 'Null', - Limited: 'Compact' + V0: 'XcmV0MultiLocation', + V1: 'XcmV1MultiLocation' } }, /** - * Lookup130: xcm::VersionedMultiAssets + * Lookup82: cumulus_pallet_xcm::pallet::Event **/ - XcmVersionedMultiAssets: { + CumulusPalletXcmEvent: { _enum: { - V0: 'Vec', - V1: 'XcmV1MultiassetMultiAssets' + InvalidFormat: '[u8;8]', + UnsupportedVersion: '[u8;8]', + ExecutedDownward: '([u8;8],XcmV2TraitsOutcome)' } }, /** - * Lookup145: cumulus_pallet_xcm::pallet::Call + * Lookup83: cumulus_pallet_dmp_queue::pallet::Event **/ - CumulusPalletXcmCall: 'Null', + CumulusPalletDmpQueueEvent: { + _enum: { + InvalidFormat: { + messageId: '[u8;32]', + }, + UnsupportedVersion: { + messageId: '[u8;32]', + }, + ExecutedDownward: { + messageId: '[u8;32]', + outcome: 'XcmV2TraitsOutcome', + }, + WeightExhausted: { + messageId: '[u8;32]', + remainingWeight: 'u64', + requiredWeight: 'u64', + }, + OverweightEnqueued: { + messageId: '[u8;32]', + overweightIndex: 'u64', + requiredWeight: 'u64', + }, + OverweightServiced: { + overweightIndex: 'u64', + weightUsed: 'u64' + } + } + }, /** - * Lookup146: cumulus_pallet_dmp_queue::pallet::Call + * Lookup84: pallet_unique::RawEvent> **/ - CumulusPalletDmpQueueCall: { + PalletUniqueRawEvent: { _enum: { - service_overweight: { - index: 'u64', - weightLimit: 'u64' - } + CollectionSponsorRemoved: 'u32', + CollectionAdminAdded: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', + CollectionOwnedChanged: '(u32,AccountId32)', + CollectionSponsorSet: '(u32,AccountId32)', + SponsorshipConfirmed: '(u32,AccountId32)', + CollectionAdminRemoved: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', + AllowListAddressRemoved: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', + AllowListAddressAdded: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', + CollectionLimitSet: 'u32', + CollectionPermissionSet: 'u32' } }, /** - * Lookup147: pallet_inflation::pallet::Call + * Lookup85: pallet_evm::account::BasicCrossAccountIdRepr **/ - PalletInflationCall: { + PalletEvmAccountBasicCrossAccountIdRepr: { _enum: { - start_inflation: { - inflationStartRelayBlock: 'u32' - } + Substrate: 'AccountId32', + Ethereum: 'H160' } }, /** - * Lookup148: pallet_unique::Call + * Lookup88: pallet_unique_scheduler::pallet::Event **/ - PalletUniqueCall: { + PalletUniqueSchedulerEvent: { _enum: { - create_collection: { - collectionName: 'Vec', - collectionDescription: 'Vec', - tokenPrefix: 'Bytes', - mode: 'UpDataStructsCollectionMode', + Scheduled: { + when: 'u32', + index: 'u32', }, - create_collection_ex: { - data: 'UpDataStructsCreateCollectionData', + Canceled: { + when: 'u32', + index: 'u32', }, - destroy_collection: { - collectionId: 'u32', + Dispatched: { + task: '(u32,u32)', + id: 'Option<[u8;16]>', + result: 'Result', }, - add_to_allow_list: { + CallLookupFailed: { + task: '(u32,u32)', + id: 'Option<[u8;16]>', + error: 'FrameSupportScheduleLookupError' + } + } + }, + /** + * Lookup91: frame_support::traits::schedule::LookupError + **/ + FrameSupportScheduleLookupError: { + _enum: ['Unknown', 'BadFormat'] + }, + /** + * Lookup92: pallet_common::pallet::Event + **/ + PalletCommonEvent: { + _enum: { + CollectionCreated: '(u32,u8,AccountId32)', + CollectionDestroyed: 'u32', + ItemCreated: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,u128)', + ItemDestroyed: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,u128)', + Transfer: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,PalletEvmAccountBasicCrossAccountIdRepr,u128)', + Approved: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,PalletEvmAccountBasicCrossAccountIdRepr,u128)', + CollectionPropertySet: '(u32,Bytes)', + CollectionPropertyDeleted: '(u32,Bytes)', + TokenPropertySet: '(u32,u32,Bytes)', + TokenPropertyDeleted: '(u32,u32,Bytes)', + PropertyPermissionSet: '(u32,Bytes)' + } + }, + /** + * Lookup95: pallet_structure::pallet::Event + **/ + PalletStructureEvent: { + _enum: { + Executed: 'Result' + } + }, + /** + * Lookup96: pallet_rmrk_core::pallet::Event + **/ + PalletRmrkCoreEvent: { + _enum: { + CollectionCreated: { + issuer: 'AccountId32', collectionId: 'u32', - address: 'PalletEvmAccountBasicCrossAccountIdRepr', }, - remove_from_allow_list: { + CollectionDestroyed: { + issuer: 'AccountId32', collectionId: 'u32', - address: 'PalletEvmAccountBasicCrossAccountIdRepr', }, - change_collection_owner: { + IssuerChanged: { + oldIssuer: 'AccountId32', + newIssuer: 'AccountId32', collectionId: 'u32', - newOwner: 'AccountId32', }, - add_collection_admin: { + CollectionLocked: { + issuer: 'AccountId32', collectionId: 'u32', - newAdmin: 'PalletEvmAccountBasicCrossAccountIdRepr', }, - remove_collection_admin: { + NftMinted: { + owner: 'AccountId32', collectionId: 'u32', - accountId: 'PalletEvmAccountBasicCrossAccountIdRepr', + nftId: 'u32', }, - set_collection_sponsor: { - collectionId: 'u32', - newSponsor: 'AccountId32', + NFTBurned: { + owner: 'AccountId32', + nftId: 'u32', }, - confirm_sponsorship: { + NFTSent: { + sender: 'AccountId32', + recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', collectionId: 'u32', + nftId: 'u32', + approvalRequired: 'bool', }, - remove_collection_sponsor: { + NFTAccepted: { + sender: 'AccountId32', + recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', collectionId: 'u32', + nftId: 'u32', }, - create_item: { + NFTRejected: { + sender: 'AccountId32', collectionId: 'u32', - owner: 'PalletEvmAccountBasicCrossAccountIdRepr', - data: 'UpDataStructsCreateItemData', + nftId: 'u32', }, - create_multiple_items: { + PropertySet: { collectionId: 'u32', - owner: 'PalletEvmAccountBasicCrossAccountIdRepr', - itemsData: 'Vec', + maybeNftId: 'Option', + key: 'Bytes', + value: 'Bytes', }, - set_collection_properties: { - collectionId: 'u32', - properties: 'Vec', + ResourceAdded: { + nftId: 'u32', + resourceId: 'u32', }, - delete_collection_properties: { - collectionId: 'u32', - propertyKeys: 'Vec', + ResourceRemoval: { + nftId: 'u32', + resourceId: 'u32', }, - set_token_properties: { - collectionId: 'u32', - tokenId: 'u32', - properties: 'Vec', + ResourceAccepted: { + nftId: 'u32', + resourceId: 'u32', }, - delete_token_properties: { - collectionId: 'u32', - tokenId: 'u32', - propertyKeys: 'Vec', - }, - set_token_property_permissions: { - collectionId: 'u32', - propertyPermissions: 'Vec', - }, - create_multiple_items_ex: { - collectionId: 'u32', - data: 'UpDataStructsCreateItemExData', - }, - set_transfers_enabled_flag: { - collectionId: 'u32', - value: 'bool', - }, - burn_item: { - collectionId: 'u32', - itemId: 'u32', - value: 'u128', - }, - burn_from: { - collectionId: 'u32', - from: 'PalletEvmAccountBasicCrossAccountIdRepr', - itemId: 'u32', - value: 'u128', - }, - transfer: { - recipient: 'PalletEvmAccountBasicCrossAccountIdRepr', - collectionId: 'u32', - itemId: 'u32', - value: 'u128', - }, - approve: { - spender: 'PalletEvmAccountBasicCrossAccountIdRepr', - collectionId: 'u32', - itemId: 'u32', - amount: 'u128', - }, - transfer_from: { - from: 'PalletEvmAccountBasicCrossAccountIdRepr', - recipient: 'PalletEvmAccountBasicCrossAccountIdRepr', - collectionId: 'u32', - itemId: 'u32', - value: 'u128', - }, - set_collection_limits: { - collectionId: 'u32', - newLimit: 'UpDataStructsCollectionLimits', - }, - set_collection_permissions: { - collectionId: 'u32', - newPermission: 'UpDataStructsCollectionPermissions', + ResourceRemovalAccepted: { + nftId: 'u32', + resourceId: 'u32', }, - repartition: { + PrioritySet: { collectionId: 'u32', - tokenId: 'u32', - amount: 'u128' + nftId: 'u32' } } }, /** - * Lookup154: up_data_structs::CollectionMode + * Lookup97: rmrk_traits::nft::AccountIdOrCollectionNftTuple **/ - UpDataStructsCollectionMode: { + RmrkTraitsNftAccountIdOrCollectionNftTuple: { _enum: { - NFT: 'Null', - Fungible: 'u8', - ReFungible: 'Null' + AccountId: 'AccountId32', + CollectionAndNftTuple: '(u32,u32)' } }, /** - * Lookup155: up_data_structs::CreateCollectionData + * Lookup102: pallet_rmrk_equip::pallet::Event **/ - UpDataStructsCreateCollectionData: { - mode: 'UpDataStructsCollectionMode', - access: 'Option', - name: 'Vec', - description: 'Vec', - tokenPrefix: 'Bytes', - pendingSponsor: 'Option', - limits: 'Option', - permissions: 'Option', - tokenPropertyPermissions: 'Vec', - properties: 'Vec' + PalletRmrkEquipEvent: { + _enum: { + BaseCreated: { + issuer: 'AccountId32', + baseId: 'u32', + }, + EquippablesUpdated: { + baseId: 'u32', + slotId: 'u32' + } + } }, /** - * Lookup157: up_data_structs::AccessMode + * Lookup103: pallet_evm::pallet::Event **/ - UpDataStructsAccessMode: { - _enum: ['Normal', 'AllowList'] + PalletEvmEvent: { + _enum: { + Log: 'EthereumLog', + Created: 'H160', + CreatedFailed: 'H160', + Executed: 'H160', + ExecutedFailed: 'H160', + BalanceDeposit: '(AccountId32,H160,U256)', + BalanceWithdraw: '(AccountId32,H160,U256)' + } }, /** - * Lookup160: up_data_structs::CollectionLimits + * Lookup104: ethereum::log::Log **/ - UpDataStructsCollectionLimits: { - accountTokenOwnershipLimit: 'Option', - sponsoredDataSize: 'Option', - sponsoredDataRateLimit: 'Option', - tokenLimit: 'Option', - sponsorTransferTimeout: 'Option', - sponsorApproveTimeout: 'Option', - ownerCanTransfer: 'Option', - ownerCanDestroy: 'Option', - transfersEnabled: 'Option' + EthereumLog: { + address: 'H160', + topics: 'Vec', + data: 'Bytes' }, /** - * Lookup162: up_data_structs::SponsoringRateLimit + * Lookup108: pallet_ethereum::pallet::Event **/ - UpDataStructsSponsoringRateLimit: { + PalletEthereumEvent: { _enum: { - SponsoringDisabled: 'Null', - Blocks: 'u32' + Executed: '(H160,H160,H256,EvmCoreErrorExitReason)' } }, /** - * Lookup165: up_data_structs::CollectionPermissions + * Lookup109: evm_core::error::ExitReason **/ - UpDataStructsCollectionPermissions: { - access: 'Option', - mintMode: 'Option', - nesting: 'Option' + EvmCoreErrorExitReason: { + _enum: { + Succeed: 'EvmCoreErrorExitSucceed', + Error: 'EvmCoreErrorExitError', + Revert: 'EvmCoreErrorExitRevert', + Fatal: 'EvmCoreErrorExitFatal' + } }, /** - * Lookup167: up_data_structs::NestingPermissions + * Lookup110: evm_core::error::ExitSucceed **/ - UpDataStructsNestingPermissions: { - tokenOwner: 'bool', - collectionAdmin: 'bool', - restricted: 'Option' + EvmCoreErrorExitSucceed: { + _enum: ['Stopped', 'Returned', 'Suicided'] }, /** - * Lookup169: up_data_structs::OwnerRestrictedSet - **/ - UpDataStructsOwnerRestrictedSet: 'BTreeSet', - /** - * Lookup175: up_data_structs::PropertyKeyPermission + * Lookup111: evm_core::error::ExitError **/ - UpDataStructsPropertyKeyPermission: { - key: 'Bytes', - permission: 'UpDataStructsPropertyPermission' + EvmCoreErrorExitError: { + _enum: { + StackUnderflow: 'Null', + StackOverflow: 'Null', + InvalidJump: 'Null', + InvalidRange: 'Null', + DesignatedInvalid: 'Null', + CallTooDeep: 'Null', + CreateCollision: 'Null', + CreateContractLimit: 'Null', + OutOfOffset: 'Null', + OutOfGas: 'Null', + OutOfFund: 'Null', + PCUnderflow: 'Null', + CreateEmpty: 'Null', + Other: 'Text', + InvalidCode: 'Null' + } }, /** - * Lookup177: up_data_structs::PropertyPermission + * Lookup114: evm_core::error::ExitRevert **/ - UpDataStructsPropertyPermission: { - mutable: 'bool', - collectionAdmin: 'bool', - tokenOwner: 'bool' + EvmCoreErrorExitRevert: { + _enum: ['Reverted'] }, /** - * Lookup180: up_data_structs::Property + * Lookup115: evm_core::error::ExitFatal **/ - UpDataStructsProperty: { - key: 'Bytes', - value: 'Bytes' + EvmCoreErrorExitFatal: { + _enum: { + NotSupported: 'Null', + UnhandledInterrupt: 'Null', + CallErrorAsFatal: 'EvmCoreErrorExitError', + Other: 'Text' + } }, /** - * Lookup183: pallet_evm::account::BasicCrossAccountIdRepr + * Lookup116: frame_system::Phase **/ - PalletEvmAccountBasicCrossAccountIdRepr: { + FrameSystemPhase: { _enum: { - Substrate: 'AccountId32', - Ethereum: 'H160' + ApplyExtrinsic: 'u32', + Finalization: 'Null', + Initialization: 'Null' } }, /** - * Lookup185: up_data_structs::CreateItemData + * Lookup118: frame_system::LastRuntimeUpgradeInfo **/ - UpDataStructsCreateItemData: { + FrameSystemLastRuntimeUpgradeInfo: { + specVersion: 'Compact', + specName: 'Text' + }, + /** + * Lookup119: frame_system::pallet::Call + **/ + FrameSystemCall: { _enum: { - NFT: 'UpDataStructsCreateNftData', - Fungible: 'UpDataStructsCreateFungibleData', - ReFungible: 'UpDataStructsCreateReFungibleData' + fill_block: { + ratio: 'Perbill', + }, + remark: { + remark: 'Bytes', + }, + set_heap_pages: { + pages: 'u64', + }, + set_code: { + code: 'Bytes', + }, + set_code_without_checks: { + code: 'Bytes', + }, + set_storage: { + items: 'Vec<(Bytes,Bytes)>', + }, + kill_storage: { + _alias: { + keys_: 'keys', + }, + keys_: 'Vec', + }, + kill_prefix: { + prefix: 'Bytes', + subkeys: 'u32', + }, + remark_with_event: { + remark: 'Bytes' + } } }, /** - * Lookup186: up_data_structs::CreateNftData + * Lookup124: frame_system::limits::BlockWeights **/ - UpDataStructsCreateNftData: { - properties: 'Vec' + FrameSystemLimitsBlockWeights: { + baseBlock: 'u64', + maxBlock: 'u64', + perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass' }, /** - * Lookup187: up_data_structs::CreateFungibleData + * Lookup125: frame_support::weights::PerDispatchClass **/ - UpDataStructsCreateFungibleData: { - value: 'u128' + FrameSupportWeightsPerDispatchClassWeightsPerClass: { + normal: 'FrameSystemLimitsWeightsPerClass', + operational: 'FrameSystemLimitsWeightsPerClass', + mandatory: 'FrameSystemLimitsWeightsPerClass' }, /** - * Lookup188: up_data_structs::CreateReFungibleData + * Lookup126: frame_system::limits::WeightsPerClass **/ - UpDataStructsCreateReFungibleData: { - pieces: 'u128', - properties: 'Vec' + FrameSystemLimitsWeightsPerClass: { + baseExtrinsic: 'u64', + maxExtrinsic: 'Option', + maxTotal: 'Option', + reserved: 'Option' }, /** - * Lookup192: up_data_structs::CreateItemExData> + * Lookup128: frame_system::limits::BlockLength **/ - UpDataStructsCreateItemExData: { - _enum: { - NFT: 'Vec', - Fungible: 'BTreeMap', - RefungibleMultipleItems: 'Vec', - RefungibleMultipleOwners: 'UpDataStructsCreateRefungibleExMultipleOwners' - } + FrameSystemLimitsBlockLength: { + max: 'FrameSupportWeightsPerDispatchClassU32' }, /** - * Lookup194: up_data_structs::CreateNftExData> + * Lookup129: frame_support::weights::PerDispatchClass **/ - UpDataStructsCreateNftExData: { - properties: 'Vec', - owner: 'PalletEvmAccountBasicCrossAccountIdRepr' + FrameSupportWeightsPerDispatchClassU32: { + normal: 'u32', + operational: 'u32', + mandatory: 'u32' }, /** - * Lookup201: up_data_structs::CreateRefungibleExSingleOwner> + * Lookup130: frame_support::weights::RuntimeDbWeight **/ - UpDataStructsCreateRefungibleExSingleOwner: { - user: 'PalletEvmAccountBasicCrossAccountIdRepr', - pieces: 'u128', - properties: 'Vec' + FrameSupportWeightsRuntimeDbWeight: { + read: 'u64', + write: 'u64' }, /** - * Lookup203: up_data_structs::CreateRefungibleExMultipleOwners> + * Lookup131: sp_version::RuntimeVersion **/ - UpDataStructsCreateRefungibleExMultipleOwners: { - users: 'BTreeMap', - properties: 'Vec' + SpVersionRuntimeVersion: { + specName: 'Text', + implName: 'Text', + authoringVersion: 'u32', + specVersion: 'u32', + implVersion: 'u32', + apis: 'Vec<([u8;8],u32)>', + transactionVersion: 'u32', + stateVersion: 'u8' }, /** - * Lookup204: pallet_unique_scheduler::pallet::Call + * Lookup136: frame_system::pallet::Error **/ - PalletUniqueSchedulerCall: { - _enum: { - schedule_named: { - id: '[u8;16]', - when: 'u32', - maybePeriodic: 'Option<(u32,u32)>', - priority: 'u8', - call: 'FrameSupportScheduleMaybeHashed', - }, - cancel_named: { - id: '[u8;16]', - }, - schedule_named_after: { - id: '[u8;16]', - after: 'u32', - maybePeriodic: 'Option<(u32,u32)>', - priority: 'u8', - call: 'FrameSupportScheduleMaybeHashed' - } - } + FrameSystemError: { + _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] }, /** - * Lookup206: frame_support::traits::schedule::MaybeHashed + * Lookup137: polkadot_primitives::v2::PersistedValidationData **/ - FrameSupportScheduleMaybeHashed: { - _enum: { - Value: 'Call', - Hash: 'H256' - } + PolkadotPrimitivesV2PersistedValidationData: { + parentHead: 'Bytes', + relayParentNumber: 'u32', + relayParentStorageRoot: 'H256', + maxPovSize: 'u32' }, /** - * Lookup207: pallet_configuration::pallet::Call + * Lookup140: polkadot_primitives::v2::UpgradeRestriction **/ - PalletConfigurationCall: { - _enum: { - set_weight_to_fee_coefficient_override: { - coeff: 'Option', - }, - set_min_gas_price_override: { - coeff: 'Option' - } - } + PolkadotPrimitivesV2UpgradeRestriction: { + _enum: ['Present'] }, /** - * Lookup209: pallet_template_transaction_payment::Call + * Lookup141: sp_trie::storage_proof::StorageProof **/ - PalletTemplateTransactionPaymentCall: 'Null', + SpTrieStorageProof: { + trieNodes: 'BTreeSet' + }, /** - * Lookup210: pallet_structure::pallet::Call + * Lookup143: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot **/ - PalletStructureCall: 'Null', + CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: { + dmqMqcHead: 'H256', + relayDispatchQueueSize: '(u32,u32)', + ingressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>', + egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>' + }, /** - * Lookup211: pallet_rmrk_core::pallet::Call + * Lookup146: polkadot_primitives::v2::AbridgedHrmpChannel **/ - PalletRmrkCoreCall: { + PolkadotPrimitivesV2AbridgedHrmpChannel: { + maxCapacity: 'u32', + maxTotalSize: 'u32', + maxMessageSize: 'u32', + msgCount: 'u32', + totalSize: 'u32', + mqcHead: 'Option' + }, + /** + * Lookup147: polkadot_primitives::v2::AbridgedHostConfiguration + **/ + PolkadotPrimitivesV2AbridgedHostConfiguration: { + maxCodeSize: 'u32', + maxHeadDataSize: 'u32', + maxUpwardQueueCount: 'u32', + maxUpwardQueueSize: 'u32', + maxUpwardMessageSize: 'u32', + maxUpwardMessageNumPerCandidate: 'u32', + hrmpMaxMessageNumPerCandidate: 'u32', + validationUpgradeCooldown: 'u32', + validationUpgradeDelay: 'u32' + }, + /** + * Lookup153: polkadot_core_primitives::OutboundHrmpMessage + **/ + PolkadotCorePrimitivesOutboundHrmpMessage: { + recipient: 'u32', + data: 'Bytes' + }, + /** + * Lookup154: cumulus_pallet_parachain_system::pallet::Call + **/ + CumulusPalletParachainSystemCall: { _enum: { - create_collection: { - metadata: 'Bytes', - max: 'Option', - symbol: 'Bytes', - }, - destroy_collection: { - collectionId: 'u32', - }, - change_collection_issuer: { - collectionId: 'u32', - newIssuer: 'MultiAddress', - }, - lock_collection: { - collectionId: 'u32', - }, - mint_nft: { - owner: 'Option', - collectionId: 'u32', - recipient: 'Option', - royaltyAmount: 'Option', - metadata: 'Bytes', - transferable: 'bool', - resources: 'Option>', - }, - burn_nft: { - collectionId: 'u32', - nftId: 'u32', - maxBurns: 'u32', - }, - send: { - rmrkCollectionId: 'u32', - rmrkNftId: 'u32', - newOwner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', - }, - accept_nft: { - rmrkCollectionId: 'u32', - rmrkNftId: 'u32', - newOwner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', - }, - reject_nft: { - rmrkCollectionId: 'u32', - rmrkNftId: 'u32', - }, - accept_resource: { - rmrkCollectionId: 'u32', - rmrkNftId: 'u32', - resourceId: 'u32', - }, - accept_resource_removal: { - rmrkCollectionId: 'u32', - rmrkNftId: 'u32', - resourceId: 'u32', - }, - set_property: { - rmrkCollectionId: 'Compact', - maybeNftId: 'Option', - key: 'Bytes', - value: 'Bytes', - }, - set_priority: { - rmrkCollectionId: 'u32', - rmrkNftId: 'u32', - priorities: 'Vec', - }, - add_basic_resource: { - rmrkCollectionId: 'u32', - nftId: 'u32', - resource: 'RmrkTraitsResourceBasicResource', + set_validation_data: { + data: 'CumulusPrimitivesParachainInherentParachainInherentData', }, - add_composable_resource: { - rmrkCollectionId: 'u32', - nftId: 'u32', - resource: 'RmrkTraitsResourceComposableResource', + sudo_send_upward_message: { + message: 'Bytes', }, - add_slot_resource: { - rmrkCollectionId: 'u32', - nftId: 'u32', - resource: 'RmrkTraitsResourceSlotResource', + authorize_upgrade: { + codeHash: 'H256', }, - remove_resource: { - rmrkCollectionId: 'u32', - nftId: 'u32', - resourceId: 'u32' + enact_authorized_upgrade: { + code: 'Bytes' } } }, /** - * Lookup217: rmrk_traits::resource::ResourceTypes, frame_support::storage::bounded_vec::BoundedVec> + * Lookup155: cumulus_primitives_parachain_inherent::ParachainInherentData **/ - RmrkTraitsResourceResourceTypes: { - _enum: { - Basic: 'RmrkTraitsResourceBasicResource', - Composable: 'RmrkTraitsResourceComposableResource', - Slot: 'RmrkTraitsResourceSlotResource' - } + CumulusPrimitivesParachainInherentParachainInherentData: { + validationData: 'PolkadotPrimitivesV2PersistedValidationData', + relayChainState: 'SpTrieStorageProof', + downwardMessages: 'Vec', + horizontalMessages: 'BTreeMap>' }, /** - * Lookup219: rmrk_traits::resource::BasicResource> + * Lookup157: polkadot_core_primitives::InboundDownwardMessage **/ - RmrkTraitsResourceBasicResource: { - src: 'Option', - metadata: 'Option', - license: 'Option', - thumb: 'Option' + PolkadotCorePrimitivesInboundDownwardMessage: { + sentAt: 'u32', + msg: 'Bytes' }, /** - * Lookup221: rmrk_traits::resource::ComposableResource, frame_support::storage::bounded_vec::BoundedVec> + * Lookup160: polkadot_core_primitives::InboundHrmpMessage **/ - RmrkTraitsResourceComposableResource: { - parts: 'Vec', - base: 'u32', - src: 'Option', - metadata: 'Option', - license: 'Option', - thumb: 'Option' + PolkadotCorePrimitivesInboundHrmpMessage: { + sentAt: 'u32', + data: 'Bytes' }, /** - * Lookup222: rmrk_traits::resource::SlotResource> + * Lookup163: cumulus_pallet_parachain_system::pallet::Error **/ - RmrkTraitsResourceSlotResource: { - base: 'u32', - src: 'Option', - metadata: 'Option', - slot: 'u32', - license: 'Option', - thumb: 'Option' + CumulusPalletParachainSystemError: { + _enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized'] }, /** - * Lookup224: rmrk_traits::nft::AccountIdOrCollectionNftTuple + * Lookup165: pallet_balances::BalanceLock **/ - RmrkTraitsNftAccountIdOrCollectionNftTuple: { - _enum: { - AccountId: 'AccountId32', - CollectionAndNftTuple: '(u32,u32)' - } + PalletBalancesBalanceLock: { + id: '[u8;8]', + amount: 'u128', + reasons: 'PalletBalancesReasons' }, /** - * Lookup228: pallet_rmrk_equip::pallet::Call + * Lookup166: pallet_balances::Reasons **/ - PalletRmrkEquipCall: { - _enum: { - create_base: { - baseType: 'Bytes', - symbol: 'Bytes', - parts: 'Vec', - }, - theme_add: { - baseId: 'u32', - theme: 'RmrkTraitsTheme', - }, - equippable: { - baseId: 'u32', - slotId: 'u32', - equippables: 'RmrkTraitsPartEquippableList' - } - } + PalletBalancesReasons: { + _enum: ['Fee', 'Misc', 'All'] }, /** - * Lookup231: rmrk_traits::part::PartType, frame_support::storage::bounded_vec::BoundedVec> + * Lookup169: pallet_balances::ReserveData **/ - RmrkTraitsPartPartType: { - _enum: { - FixedPart: 'RmrkTraitsPartFixedPart', - SlotPart: 'RmrkTraitsPartSlotPart' - } + PalletBalancesReserveData: { + id: '[u8;16]', + amount: 'u128' }, /** - * Lookup233: rmrk_traits::part::FixedPart> + * Lookup171: pallet_balances::Releases **/ - RmrkTraitsPartFixedPart: { - id: 'u32', - z: 'u32', - src: 'Bytes' + PalletBalancesReleases: { + _enum: ['V1_0_0', 'V2_0_0'] }, /** - * Lookup234: rmrk_traits::part::SlotPart, frame_support::storage::bounded_vec::BoundedVec> + * Lookup172: pallet_balances::pallet::Call **/ - RmrkTraitsPartSlotPart: { - id: 'u32', - equippable: 'RmrkTraitsPartEquippableList', - src: 'Bytes', - z: 'u32' + PalletBalancesCall: { + _enum: { + transfer: { + dest: 'MultiAddress', + value: 'Compact', + }, + set_balance: { + who: 'MultiAddress', + newFree: 'Compact', + newReserved: 'Compact', + }, + force_transfer: { + source: 'MultiAddress', + dest: 'MultiAddress', + value: 'Compact', + }, + transfer_keep_alive: { + dest: 'MultiAddress', + value: 'Compact', + }, + transfer_all: { + dest: 'MultiAddress', + keepAlive: 'bool', + }, + force_unreserve: { + who: 'MultiAddress', + amount: 'u128' + } + } }, /** - * Lookup235: rmrk_traits::part::EquippableList> + * Lookup175: pallet_balances::pallet::Error **/ - RmrkTraitsPartEquippableList: { + PalletBalancesError: { + _enum: ['VestingBalance', 'LiquidityRestrictions', 'InsufficientBalance', 'ExistentialDeposit', 'KeepAlive', 'ExistingVestingSchedule', 'DeadAccount', 'TooManyReserves'] + }, + /** + * Lookup177: pallet_timestamp::pallet::Call + **/ + PalletTimestampCall: { _enum: { - All: 'Null', - Empty: 'Null', - Custom: 'Vec' + set: { + now: 'Compact' + } } }, /** - * Lookup237: rmrk_traits::theme::Theme, frame_support::storage::bounded_vec::BoundedVec>, S>> + * Lookup179: pallet_transaction_payment::Releases **/ - RmrkTraitsTheme: { - name: 'Bytes', - properties: 'Vec', - inherit: 'bool' + PalletTransactionPaymentReleases: { + _enum: ['V1Ancient', 'V2'] }, /** - * Lookup239: rmrk_traits::theme::ThemeProperty> + * Lookup180: pallet_treasury::Proposal **/ - RmrkTraitsThemeThemeProperty: { - key: 'Bytes', - value: 'Bytes' + PalletTreasuryProposal: { + proposer: 'AccountId32', + value: 'u128', + beneficiary: 'AccountId32', + bond: 'u128' }, /** - * Lookup241: pallet_evm::pallet::Call + * Lookup183: pallet_treasury::pallet::Call **/ - PalletEvmCall: { + PalletTreasuryCall: { _enum: { - withdraw: { - address: 'H160', - value: 'u128', + propose_spend: { + value: 'Compact', + beneficiary: 'MultiAddress', }, - call: { - source: 'H160', - target: 'H160', - input: 'Bytes', - value: 'U256', - gasLimit: 'u64', - maxFeePerGas: 'U256', - maxPriorityFeePerGas: 'Option', - nonce: 'Option', - accessList: 'Vec<(H160,Vec)>', + reject_proposal: { + proposalId: 'Compact', }, - create: { - source: 'H160', - init: 'Bytes', - value: 'U256', - gasLimit: 'u64', - maxFeePerGas: 'U256', - maxPriorityFeePerGas: 'Option', - nonce: 'Option', - accessList: 'Vec<(H160,Vec)>', + approve_proposal: { + proposalId: 'Compact', }, - create2: { - source: 'H160', - init: 'Bytes', - salt: 'H256', - value: 'U256', - gasLimit: 'u64', - maxFeePerGas: 'U256', - maxPriorityFeePerGas: 'Option', - nonce: 'Option', - accessList: 'Vec<(H160,Vec)>' - } - } - }, - /** - * Lookup247: pallet_ethereum::pallet::Call - **/ - PalletEthereumCall: { - _enum: { - transact: { - transaction: 'EthereumTransactionTransactionV2' + spend: { + amount: 'Compact', + beneficiary: 'MultiAddress', + }, + remove_approval: { + proposalId: 'Compact' } } }, /** - * Lookup248: ethereum::transaction::TransactionV2 + * Lookup186: frame_support::PalletId **/ - EthereumTransactionTransactionV2: { - _enum: { - Legacy: 'EthereumTransactionLegacyTransaction', - EIP2930: 'EthereumTransactionEip2930Transaction', - EIP1559: 'EthereumTransactionEip1559Transaction' - } - }, + FrameSupportPalletId: '[u8;8]', /** - * Lookup249: ethereum::transaction::LegacyTransaction + * Lookup187: pallet_treasury::pallet::Error **/ - EthereumTransactionLegacyTransaction: { - nonce: 'U256', - gasPrice: 'U256', - gasLimit: 'U256', - action: 'EthereumTransactionTransactionAction', - value: 'U256', - input: 'Bytes', - signature: 'EthereumTransactionTransactionSignature' + PalletTreasuryError: { + _enum: ['InsufficientProposersBalance', 'InvalidIndex', 'TooManyApprovals', 'InsufficientPermission', 'ProposalNotApproved'] }, /** - * Lookup250: ethereum::transaction::TransactionAction + * Lookup188: pallet_sudo::pallet::Call **/ - EthereumTransactionTransactionAction: { + PalletSudoCall: { _enum: { - Call: 'H160', - Create: 'Null' + sudo: { + call: 'Call', + }, + sudo_unchecked_weight: { + call: 'Call', + weight: 'u64', + }, + set_key: { + _alias: { + new_: 'new', + }, + new_: 'MultiAddress', + }, + sudo_as: { + who: 'MultiAddress', + call: 'Call' + } } }, /** - * Lookup251: ethereum::transaction::TransactionSignature + * Lookup190: orml_vesting::module::Call **/ - EthereumTransactionTransactionSignature: { - v: 'u64', - r: 'H256', - s: 'H256' + OrmlVestingModuleCall: { + _enum: { + claim: 'Null', + vested_transfer: { + dest: 'MultiAddress', + schedule: 'OrmlVestingVestingSchedule', + }, + update_vesting_schedules: { + who: 'MultiAddress', + vestingSchedules: 'Vec', + }, + claim_for: { + dest: 'MultiAddress' + } + } }, /** - * Lookup253: ethereum::transaction::EIP2930Transaction + * Lookup192: cumulus_pallet_xcmp_queue::pallet::Call **/ - EthereumTransactionEip2930Transaction: { - chainId: 'u64', - nonce: 'U256', - gasPrice: 'U256', - gasLimit: 'U256', - action: 'EthereumTransactionTransactionAction', - value: 'U256', - input: 'Bytes', - accessList: 'Vec', - oddYParity: 'bool', - r: 'H256', - s: 'H256' + CumulusPalletXcmpQueueCall: { + _enum: { + service_overweight: { + index: 'u64', + weightLimit: 'u64', + }, + suspend_xcm_execution: 'Null', + resume_xcm_execution: 'Null', + update_suspend_threshold: { + _alias: { + new_: 'new', + }, + new_: 'u32', + }, + update_drop_threshold: { + _alias: { + new_: 'new', + }, + new_: 'u32', + }, + update_resume_threshold: { + _alias: { + new_: 'new', + }, + new_: 'u32', + }, + update_threshold_weight: { + _alias: { + new_: 'new', + }, + new_: 'u64', + }, + update_weight_restrict_decay: { + _alias: { + new_: 'new', + }, + new_: 'u64', + }, + update_xcmp_max_individual_weight: { + _alias: { + new_: 'new', + }, + new_: 'u64' + } + } }, /** - * Lookup255: ethereum::transaction::AccessListItem + * Lookup193: pallet_xcm::pallet::Call **/ - EthereumTransactionAccessListItem: { - address: 'H160', - storageKeys: 'Vec' + PalletXcmCall: { + _enum: { + send: { + dest: 'XcmVersionedMultiLocation', + message: 'XcmVersionedXcm', + }, + teleport_assets: { + dest: 'XcmVersionedMultiLocation', + beneficiary: 'XcmVersionedMultiLocation', + assets: 'XcmVersionedMultiAssets', + feeAssetItem: 'u32', + }, + reserve_transfer_assets: { + dest: 'XcmVersionedMultiLocation', + beneficiary: 'XcmVersionedMultiLocation', + assets: 'XcmVersionedMultiAssets', + feeAssetItem: 'u32', + }, + execute: { + message: 'XcmVersionedXcm', + maxWeight: 'u64', + }, + force_xcm_version: { + location: 'XcmV1MultiLocation', + xcmVersion: 'u32', + }, + force_default_xcm_version: { + maybeXcmVersion: 'Option', + }, + force_subscribe_version_notify: { + location: 'XcmVersionedMultiLocation', + }, + force_unsubscribe_version_notify: { + location: 'XcmVersionedMultiLocation', + }, + limited_reserve_transfer_assets: { + dest: 'XcmVersionedMultiLocation', + beneficiary: 'XcmVersionedMultiLocation', + assets: 'XcmVersionedMultiAssets', + feeAssetItem: 'u32', + weightLimit: 'XcmV2WeightLimit', + }, + limited_teleport_assets: { + dest: 'XcmVersionedMultiLocation', + beneficiary: 'XcmVersionedMultiLocation', + assets: 'XcmVersionedMultiAssets', + feeAssetItem: 'u32', + weightLimit: 'XcmV2WeightLimit' + } + } }, /** - * Lookup256: ethereum::transaction::EIP1559Transaction + * Lookup194: xcm::VersionedXcm **/ - EthereumTransactionEip1559Transaction: { - chainId: 'u64', - nonce: 'U256', - maxPriorityFeePerGas: 'U256', - maxFeePerGas: 'U256', - gasLimit: 'U256', - action: 'EthereumTransactionTransactionAction', - value: 'U256', - input: 'Bytes', - accessList: 'Vec', - oddYParity: 'bool', - r: 'H256', - s: 'H256' + XcmVersionedXcm: { + _enum: { + V0: 'XcmV0Xcm', + V1: 'XcmV1Xcm', + V2: 'XcmV2Xcm' + } }, /** - * Lookup257: pallet_evm_migration::pallet::Call + * Lookup195: xcm::v0::Xcm **/ - PalletEvmMigrationCall: { + XcmV0Xcm: { _enum: { - begin: { - address: 'H160', + WithdrawAsset: { + assets: 'Vec', + effects: 'Vec', + }, + ReserveAssetDeposit: { + assets: 'Vec', + effects: 'Vec', + }, + TeleportAsset: { + assets: 'Vec', + effects: 'Vec', + }, + QueryResponse: { + queryId: 'Compact', + response: 'XcmV0Response', + }, + TransferAsset: { + assets: 'Vec', + dest: 'XcmV0MultiLocation', + }, + TransferReserveAsset: { + assets: 'Vec', + dest: 'XcmV0MultiLocation', + effects: 'Vec', + }, + Transact: { + originType: 'XcmV0OriginKind', + requireWeightAtMost: 'u64', + call: 'XcmDoubleEncoded', + }, + HrmpNewChannelOpenRequest: { + sender: 'Compact', + maxMessageSize: 'Compact', + maxCapacity: 'Compact', + }, + HrmpChannelAccepted: { + recipient: 'Compact', + }, + HrmpChannelClosing: { + initiator: 'Compact', + sender: 'Compact', + recipient: 'Compact', + }, + RelayedFrom: { + who: 'XcmV0MultiLocation', + message: 'XcmV0Xcm' + } + } + }, + /** + * Lookup197: xcm::v0::order::Order + **/ + XcmV0Order: { + _enum: { + Null: 'Null', + DepositAsset: { + assets: 'Vec', + dest: 'XcmV0MultiLocation', + }, + DepositReserveAsset: { + assets: 'Vec', + dest: 'XcmV0MultiLocation', + effects: 'Vec', + }, + ExchangeAsset: { + give: 'Vec', + receive: 'Vec', + }, + InitiateReserveWithdraw: { + assets: 'Vec', + reserve: 'XcmV0MultiLocation', + effects: 'Vec', + }, + InitiateTeleport: { + assets: 'Vec', + dest: 'XcmV0MultiLocation', + effects: 'Vec', + }, + QueryHolding: { + queryId: 'Compact', + dest: 'XcmV0MultiLocation', + assets: 'Vec', + }, + BuyExecution: { + fees: 'XcmV0MultiAsset', + weight: 'u64', + debt: 'u64', + haltOnError: 'bool', + xcm: 'Vec' + } + } + }, + /** + * Lookup199: xcm::v0::Response + **/ + XcmV0Response: { + _enum: { + Assets: 'Vec' + } + }, + /** + * Lookup200: xcm::v1::Xcm + **/ + XcmV1Xcm: { + _enum: { + WithdrawAsset: { + assets: 'XcmV1MultiassetMultiAssets', + effects: 'Vec', + }, + ReserveAssetDeposited: { + assets: 'XcmV1MultiassetMultiAssets', + effects: 'Vec', + }, + ReceiveTeleportedAsset: { + assets: 'XcmV1MultiassetMultiAssets', + effects: 'Vec', + }, + QueryResponse: { + queryId: 'Compact', + response: 'XcmV1Response', + }, + TransferAsset: { + assets: 'XcmV1MultiassetMultiAssets', + beneficiary: 'XcmV1MultiLocation', + }, + TransferReserveAsset: { + assets: 'XcmV1MultiassetMultiAssets', + dest: 'XcmV1MultiLocation', + effects: 'Vec', + }, + Transact: { + originType: 'XcmV0OriginKind', + requireWeightAtMost: 'u64', + call: 'XcmDoubleEncoded', + }, + HrmpNewChannelOpenRequest: { + sender: 'Compact', + maxMessageSize: 'Compact', + maxCapacity: 'Compact', + }, + HrmpChannelAccepted: { + recipient: 'Compact', + }, + HrmpChannelClosing: { + initiator: 'Compact', + sender: 'Compact', + recipient: 'Compact', + }, + RelayedFrom: { + who: 'XcmV1MultilocationJunctions', + message: 'XcmV1Xcm', + }, + SubscribeVersion: { + queryId: 'Compact', + maxResponseWeight: 'Compact', + }, + UnsubscribeVersion: 'Null' + } + }, + /** + * Lookup202: xcm::v1::order::Order + **/ + XcmV1Order: { + _enum: { + Noop: 'Null', + DepositAsset: { + assets: 'XcmV1MultiassetMultiAssetFilter', + maxAssets: 'u32', + beneficiary: 'XcmV1MultiLocation', + }, + DepositReserveAsset: { + assets: 'XcmV1MultiassetMultiAssetFilter', + maxAssets: 'u32', + dest: 'XcmV1MultiLocation', + effects: 'Vec', + }, + ExchangeAsset: { + give: 'XcmV1MultiassetMultiAssetFilter', + receive: 'XcmV1MultiassetMultiAssets', + }, + InitiateReserveWithdraw: { + assets: 'XcmV1MultiassetMultiAssetFilter', + reserve: 'XcmV1MultiLocation', + effects: 'Vec', + }, + InitiateTeleport: { + assets: 'XcmV1MultiassetMultiAssetFilter', + dest: 'XcmV1MultiLocation', + effects: 'Vec', + }, + QueryHolding: { + queryId: 'Compact', + dest: 'XcmV1MultiLocation', + assets: 'XcmV1MultiassetMultiAssetFilter', + }, + BuyExecution: { + fees: 'XcmV1MultiAsset', + weight: 'u64', + debt: 'u64', + haltOnError: 'bool', + instructions: 'Vec' + } + } + }, + /** + * Lookup204: xcm::v1::Response + **/ + XcmV1Response: { + _enum: { + Assets: 'XcmV1MultiassetMultiAssets', + Version: 'u32' + } + }, + /** + * Lookup218: cumulus_pallet_xcm::pallet::Call + **/ + CumulusPalletXcmCall: 'Null', + /** + * Lookup219: cumulus_pallet_dmp_queue::pallet::Call + **/ + CumulusPalletDmpQueueCall: { + _enum: { + service_overweight: { + index: 'u64', + weightLimit: 'u64' + } + } + }, + /** + * Lookup220: pallet_inflation::pallet::Call + **/ + PalletInflationCall: { + _enum: { + start_inflation: { + inflationStartRelayBlock: 'u32' + } + } + }, + /** + * Lookup221: pallet_unique::Call + **/ + PalletUniqueCall: { + _enum: { + create_collection: { + collectionName: 'Vec', + collectionDescription: 'Vec', + tokenPrefix: 'Bytes', + mode: 'UpDataStructsCollectionMode', + }, + create_collection_ex: { + data: 'UpDataStructsCreateCollectionData', + }, + destroy_collection: { + collectionId: 'u32', + }, + add_to_allow_list: { + collectionId: 'u32', + address: 'PalletEvmAccountBasicCrossAccountIdRepr', + }, + remove_from_allow_list: { + collectionId: 'u32', + address: 'PalletEvmAccountBasicCrossAccountIdRepr', + }, + change_collection_owner: { + collectionId: 'u32', + newOwner: 'AccountId32', + }, + add_collection_admin: { + collectionId: 'u32', + newAdminId: 'PalletEvmAccountBasicCrossAccountIdRepr', + }, + remove_collection_admin: { + collectionId: 'u32', + accountId: 'PalletEvmAccountBasicCrossAccountIdRepr', + }, + set_collection_sponsor: { + collectionId: 'u32', + newSponsor: 'AccountId32', + }, + confirm_sponsorship: { + collectionId: 'u32', + }, + remove_collection_sponsor: { + collectionId: 'u32', + }, + create_item: { + collectionId: 'u32', + owner: 'PalletEvmAccountBasicCrossAccountIdRepr', + data: 'UpDataStructsCreateItemData', + }, + create_multiple_items: { + collectionId: 'u32', + owner: 'PalletEvmAccountBasicCrossAccountIdRepr', + itemsData: 'Vec', + }, + set_collection_properties: { + collectionId: 'u32', + properties: 'Vec', + }, + delete_collection_properties: { + collectionId: 'u32', + propertyKeys: 'Vec', + }, + set_token_properties: { + collectionId: 'u32', + tokenId: 'u32', + properties: 'Vec', + }, + delete_token_properties: { + collectionId: 'u32', + tokenId: 'u32', + propertyKeys: 'Vec', + }, + set_token_property_permissions: { + collectionId: 'u32', + propertyPermissions: 'Vec', }, - set_data: { - address: 'H160', - data: 'Vec<(H256,H256)>', + create_multiple_items_ex: { + collectionId: 'u32', + data: 'UpDataStructsCreateItemExData', }, - finish: { - address: 'H160', - code: 'Bytes' - } - } - }, - /** - * Lookup260: pallet_sudo::pallet::Event - **/ - PalletSudoEvent: { - _enum: { - Sudid: { - sudoResult: 'Result', + set_transfers_enabled_flag: { + collectionId: 'u32', + value: 'bool', }, - KeyChanged: { - oldSudoer: 'Option', + burn_item: { + collectionId: 'u32', + itemId: 'u32', + value: 'u128', }, - SudoAsDone: { - sudoResult: 'Result' + burn_from: { + collectionId: 'u32', + from: 'PalletEvmAccountBasicCrossAccountIdRepr', + itemId: 'u32', + value: 'u128', + }, + transfer: { + recipient: 'PalletEvmAccountBasicCrossAccountIdRepr', + collectionId: 'u32', + itemId: 'u32', + value: 'u128', + }, + approve: { + spender: 'PalletEvmAccountBasicCrossAccountIdRepr', + collectionId: 'u32', + itemId: 'u32', + amount: 'u128', + }, + transfer_from: { + from: 'PalletEvmAccountBasicCrossAccountIdRepr', + recipient: 'PalletEvmAccountBasicCrossAccountIdRepr', + collectionId: 'u32', + itemId: 'u32', + value: 'u128', + }, + set_collection_limits: { + collectionId: 'u32', + newLimit: 'UpDataStructsCollectionLimits', + }, + set_collection_permissions: { + collectionId: 'u32', + newPermission: 'UpDataStructsCollectionPermissions', + }, + repartition: { + collectionId: 'u32', + tokenId: 'u32', + amount: 'u128' } } }, /** - * Lookup262: sp_runtime::DispatchError + * Lookup226: up_data_structs::CollectionMode **/ - SpRuntimeDispatchError: { + UpDataStructsCollectionMode: { _enum: { - Other: 'Null', - CannotLookup: 'Null', - BadOrigin: 'Null', - Module: 'SpRuntimeModuleError', - ConsumerRemaining: 'Null', - NoProviders: 'Null', - TooManyConsumers: 'Null', - Token: 'SpRuntimeTokenError', - Arithmetic: 'SpRuntimeArithmeticError', - Transactional: 'SpRuntimeTransactionalError' + NFT: 'Null', + Fungible: 'u8', + ReFungible: 'Null' } }, /** - * Lookup263: sp_runtime::ModuleError + * Lookup227: up_data_structs::CreateCollectionData **/ - SpRuntimeModuleError: { - index: 'u8', - error: '[u8;4]' + UpDataStructsCreateCollectionData: { + mode: 'UpDataStructsCollectionMode', + access: 'Option', + name: 'Vec', + description: 'Vec', + tokenPrefix: 'Bytes', + pendingSponsor: 'Option', + limits: 'Option', + permissions: 'Option', + tokenPropertyPermissions: 'Vec', + properties: 'Vec' }, /** - * Lookup264: sp_runtime::TokenError + * Lookup229: up_data_structs::AccessMode **/ - SpRuntimeTokenError: { - _enum: ['NoFunds', 'WouldDie', 'BelowMinimum', 'CannotCreate', 'UnknownAsset', 'Frozen', 'Unsupported'] + UpDataStructsAccessMode: { + _enum: ['Normal', 'AllowList'] }, /** - * Lookup265: sp_runtime::ArithmeticError + * Lookup231: up_data_structs::CollectionLimits **/ - SpRuntimeArithmeticError: { - _enum: ['Underflow', 'Overflow', 'DivisionByZero'] + UpDataStructsCollectionLimits: { + accountTokenOwnershipLimit: 'Option', + sponsoredDataSize: 'Option', + sponsoredDataRateLimit: 'Option', + tokenLimit: 'Option', + sponsorTransferTimeout: 'Option', + sponsorApproveTimeout: 'Option', + ownerCanTransfer: 'Option', + ownerCanDestroy: 'Option', + transfersEnabled: 'Option' }, /** - * Lookup266: sp_runtime::TransactionalError + * Lookup233: up_data_structs::SponsoringRateLimit **/ - SpRuntimeTransactionalError: { - _enum: ['LimitReached', 'NoLayer'] + UpDataStructsSponsoringRateLimit: { + _enum: { + SponsoringDisabled: 'Null', + Blocks: 'u32' + } }, /** - * Lookup267: pallet_sudo::pallet::Error + * Lookup236: up_data_structs::CollectionPermissions **/ - PalletSudoError: { - _enum: ['RequireSudo'] + UpDataStructsCollectionPermissions: { + access: 'Option', + mintMode: 'Option', + nesting: 'Option' }, /** - * Lookup268: frame_system::AccountInfo> + * Lookup238: up_data_structs::NestingPermissions **/ - FrameSystemAccountInfo: { - nonce: 'u32', - consumers: 'u32', - providers: 'u32', - sufficients: 'u32', - data: 'PalletBalancesAccountData' + UpDataStructsNestingPermissions: { + tokenOwner: 'bool', + collectionAdmin: 'bool', + restricted: 'Option' }, /** - * Lookup269: frame_support::weights::PerDispatchClass + * Lookup240: up_data_structs::OwnerRestrictedSet **/ - FrameSupportWeightsPerDispatchClassU64: { - normal: 'u64', - operational: 'u64', - mandatory: 'u64' - }, + UpDataStructsOwnerRestrictedSet: 'BTreeSet', /** - * Lookup270: sp_runtime::generic::digest::Digest + * Lookup245: up_data_structs::PropertyKeyPermission **/ - SpRuntimeDigest: { - logs: 'Vec' + UpDataStructsPropertyKeyPermission: { + key: 'Bytes', + permission: 'UpDataStructsPropertyPermission' }, /** - * Lookup272: sp_runtime::generic::digest::DigestItem + * Lookup246: up_data_structs::PropertyPermission **/ - SpRuntimeDigestDigestItem: { - _enum: { - Other: 'Bytes', - __Unused1: 'Null', - __Unused2: 'Null', - __Unused3: 'Null', - Consensus: '([u8;4],Bytes)', - Seal: '([u8;4],Bytes)', - PreRuntime: '([u8;4],Bytes)', - __Unused7: 'Null', - RuntimeEnvironmentUpdated: 'Null' - } + UpDataStructsPropertyPermission: { + mutable: 'bool', + collectionAdmin: 'bool', + tokenOwner: 'bool' }, /** - * Lookup274: frame_system::EventRecord + * Lookup249: up_data_structs::Property **/ - FrameSystemEventRecord: { - phase: 'FrameSystemPhase', - event: 'Event', - topics: 'Vec' + UpDataStructsProperty: { + key: 'Bytes', + value: 'Bytes' }, /** - * Lookup276: frame_system::pallet::Event + * Lookup252: up_data_structs::CreateItemData **/ - FrameSystemEvent: { + UpDataStructsCreateItemData: { _enum: { - ExtrinsicSuccess: { - dispatchInfo: 'FrameSupportWeightsDispatchInfo', - }, - ExtrinsicFailed: { - dispatchError: 'SpRuntimeDispatchError', - dispatchInfo: 'FrameSupportWeightsDispatchInfo', - }, - CodeUpdated: 'Null', - NewAccount: { - account: 'AccountId32', - }, - KilledAccount: { - account: 'AccountId32', - }, - Remarked: { - _alias: { - hash_: 'hash', - }, - sender: 'AccountId32', - hash_: 'H256' - } + NFT: 'UpDataStructsCreateNftData', + Fungible: 'UpDataStructsCreateFungibleData', + ReFungible: 'UpDataStructsCreateReFungibleData' } }, /** - * Lookup277: frame_support::weights::DispatchInfo - **/ - FrameSupportWeightsDispatchInfo: { - weight: 'u64', - class: 'FrameSupportWeightsDispatchClass', - paysFee: 'FrameSupportWeightsPays' - }, - /** - * Lookup278: frame_support::weights::DispatchClass - **/ - FrameSupportWeightsDispatchClass: { - _enum: ['Normal', 'Operational', 'Mandatory'] - }, - /** - * Lookup279: frame_support::weights::Pays - **/ - FrameSupportWeightsPays: { - _enum: ['Yes', 'No'] - }, - /** - * Lookup280: orml_vesting::module::Event + * Lookup253: up_data_structs::CreateNftData **/ - OrmlVestingModuleEvent: { - _enum: { - VestingScheduleAdded: { - from: 'AccountId32', - to: 'AccountId32', - vestingSchedule: 'OrmlVestingVestingSchedule', - }, - Claimed: { - who: 'AccountId32', - amount: 'u128', - }, - VestingSchedulesUpdated: { - who: 'AccountId32' - } - } + UpDataStructsCreateNftData: { + properties: 'Vec' }, /** - * Lookup281: cumulus_pallet_xcmp_queue::pallet::Event + * Lookup254: up_data_structs::CreateFungibleData **/ - CumulusPalletXcmpQueueEvent: { - _enum: { - Success: 'Option', - Fail: '(Option,XcmV2TraitsError)', - BadVersion: 'Option', - BadFormat: 'Option', - UpwardMessageSent: 'Option', - XcmpMessageSent: 'Option', - OverweightEnqueued: '(u32,u32,u64,u64)', - OverweightServiced: '(u64,u64)' - } + UpDataStructsCreateFungibleData: { + value: 'u128' }, /** - * Lookup282: pallet_xcm::pallet::Event - **/ - PalletXcmEvent: { - _enum: { - Attempted: 'XcmV2TraitsOutcome', - Sent: '(XcmV1MultiLocation,XcmV1MultiLocation,XcmV2Xcm)', - UnexpectedResponse: '(XcmV1MultiLocation,u64)', - ResponseReady: '(u64,XcmV2Response)', - Notified: '(u64,u8,u8)', - NotifyOverweight: '(u64,u8,u8,u64,u64)', - NotifyDispatchError: '(u64,u8,u8)', - NotifyDecodeFailed: '(u64,u8,u8)', - InvalidResponder: '(XcmV1MultiLocation,u64,Option)', - InvalidResponderVersion: '(XcmV1MultiLocation,u64)', - ResponseTaken: 'u64', - AssetsTrapped: '(H256,XcmV1MultiLocation,XcmVersionedMultiAssets)', - VersionChangeNotified: '(XcmV1MultiLocation,u32)', - SupportedVersionChanged: '(XcmV1MultiLocation,u32)', - NotifyTargetSendFail: '(XcmV1MultiLocation,u64,XcmV2TraitsError)', - NotifyTargetMigrationFail: '(XcmVersionedMultiLocation,u64)' - } + * Lookup255: up_data_structs::CreateReFungibleData + **/ + UpDataStructsCreateReFungibleData: { + pieces: 'u128', + properties: 'Vec' }, /** - * Lookup283: xcm::v2::traits::Outcome + * Lookup258: up_data_structs::CreateItemExData> **/ - XcmV2TraitsOutcome: { + UpDataStructsCreateItemExData: { _enum: { - Complete: 'u64', - Incomplete: '(u64,XcmV2TraitsError)', - Error: 'XcmV2TraitsError' + NFT: 'Vec', + Fungible: 'BTreeMap', + RefungibleMultipleItems: 'Vec', + RefungibleMultipleOwners: 'UpDataStructsCreateRefungibleExMultipleOwners' } }, /** - * Lookup285: cumulus_pallet_xcm::pallet::Event + * Lookup260: up_data_structs::CreateNftExData> **/ - CumulusPalletXcmEvent: { - _enum: { - InvalidFormat: '[u8;8]', - UnsupportedVersion: '[u8;8]', - ExecutedDownward: '([u8;8],XcmV2TraitsOutcome)' - } + UpDataStructsCreateNftExData: { + properties: 'Vec', + owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup286: cumulus_pallet_dmp_queue::pallet::Event + * Lookup267: up_data_structs::CreateRefungibleExSingleOwner> **/ - CumulusPalletDmpQueueEvent: { - _enum: { - InvalidFormat: { - messageId: '[u8;32]', - }, - UnsupportedVersion: { - messageId: '[u8;32]', - }, - ExecutedDownward: { - messageId: '[u8;32]', - outcome: 'XcmV2TraitsOutcome', - }, - WeightExhausted: { - messageId: '[u8;32]', - remainingWeight: 'u64', - requiredWeight: 'u64', - }, - OverweightEnqueued: { - messageId: '[u8;32]', - overweightIndex: 'u64', - requiredWeight: 'u64', - }, - OverweightServiced: { - overweightIndex: 'u64', - weightUsed: 'u64' - } - } + UpDataStructsCreateRefungibleExSingleOwner: { + user: 'PalletEvmAccountBasicCrossAccountIdRepr', + pieces: 'u128', + properties: 'Vec' }, /** - * Lookup287: pallet_unique::RawEvent> + * Lookup269: up_data_structs::CreateRefungibleExMultipleOwners> **/ - PalletUniqueRawEvent: { - _enum: { - CollectionSponsorRemoved: 'u32', - CollectionAdminAdded: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', - CollectionOwnedChanged: '(u32,AccountId32)', - CollectionSponsorSet: '(u32,AccountId32)', - SponsorshipConfirmed: '(u32,AccountId32)', - CollectionAdminRemoved: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', - AllowListAddressRemoved: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', - AllowListAddressAdded: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', - CollectionLimitSet: 'u32', - CollectionPermissionSet: 'u32' - } + UpDataStructsCreateRefungibleExMultipleOwners: { + users: 'BTreeMap', + properties: 'Vec' }, /** - * Lookup288: pallet_unique_scheduler::pallet::Event + * Lookup270: pallet_unique_scheduler::pallet::Call **/ - PalletUniqueSchedulerEvent: { + PalletUniqueSchedulerCall: { _enum: { - Scheduled: { - when: 'u32', - index: 'u32', - }, - Canceled: { + schedule_named: { + id: '[u8;16]', when: 'u32', - index: 'u32', + maybePeriodic: 'Option<(u32,u32)>', + priority: 'u8', + call: 'FrameSupportScheduleMaybeHashed', }, - Dispatched: { - task: '(u32,u32)', - id: 'Option<[u8;16]>', - result: 'Result', + cancel_named: { + id: '[u8;16]', }, - CallLookupFailed: { - task: '(u32,u32)', - id: 'Option<[u8;16]>', - error: 'FrameSupportScheduleLookupError' + schedule_named_after: { + id: '[u8;16]', + after: 'u32', + maybePeriodic: 'Option<(u32,u32)>', + priority: 'u8', + call: 'FrameSupportScheduleMaybeHashed' } } }, /** - * Lookup290: frame_support::traits::schedule::LookupError - **/ - FrameSupportScheduleLookupError: { - _enum: ['Unknown', 'BadFormat'] - }, - /** - * Lookup291: pallet_common::pallet::Event + * Lookup272: frame_support::traits::schedule::MaybeHashed **/ - PalletCommonEvent: { + FrameSupportScheduleMaybeHashed: { _enum: { - CollectionCreated: '(u32,u8,AccountId32)', - CollectionDestroyed: 'u32', - ItemCreated: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,u128)', - ItemDestroyed: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,u128)', - Transfer: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,PalletEvmAccountBasicCrossAccountIdRepr,u128)', - Approved: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,PalletEvmAccountBasicCrossAccountIdRepr,u128)', - CollectionPropertySet: '(u32,Bytes)', - CollectionPropertyDeleted: '(u32,Bytes)', - TokenPropertySet: '(u32,u32,Bytes)', - TokenPropertyDeleted: '(u32,u32,Bytes)', - PropertyPermissionSet: '(u32,Bytes)' + Value: 'Call', + Hash: 'H256' } }, /** - * Lookup292: pallet_structure::pallet::Event + * Lookup273: pallet_configuration::pallet::Call **/ - PalletStructureEvent: { + PalletConfigurationCall: { _enum: { - Executed: 'Result' + set_weight_to_fee_coefficient_override: { + coeff: 'Option', + }, + set_min_gas_price_override: { + coeff: 'Option' + } } }, /** - * Lookup293: pallet_rmrk_core::pallet::Event + * Lookup274: pallet_template_transaction_payment::Call **/ - PalletRmrkCoreEvent: { + PalletTemplateTransactionPaymentCall: 'Null', + /** + * Lookup275: pallet_structure::pallet::Call + **/ + PalletStructureCall: 'Null', + /** + * Lookup276: pallet_rmrk_core::pallet::Call + **/ + PalletRmrkCoreCall: { _enum: { - CollectionCreated: { - issuer: 'AccountId32', + create_collection: { + metadata: 'Bytes', + max: 'Option', + symbol: 'Bytes', + }, + destroy_collection: { collectionId: 'u32', }, - CollectionDestroyed: { - issuer: 'AccountId32', + change_collection_issuer: { collectionId: 'u32', + newIssuer: 'MultiAddress', }, - IssuerChanged: { - oldIssuer: 'AccountId32', - newIssuer: 'AccountId32', + lock_collection: { collectionId: 'u32', }, - CollectionLocked: { - issuer: 'AccountId32', + mint_nft: { + owner: 'Option', collectionId: 'u32', + recipient: 'Option', + royaltyAmount: 'Option', + metadata: 'Bytes', + transferable: 'bool', + resources: 'Option>', }, - NftMinted: { - owner: 'AccountId32', + burn_nft: { collectionId: 'u32', nftId: 'u32', + maxBurns: 'u32', }, - NFTBurned: { - owner: 'AccountId32', - nftId: 'u32', + send: { + rmrkCollectionId: 'u32', + rmrkNftId: 'u32', + newOwner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', }, - NFTSent: { - sender: 'AccountId32', - recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', - collectionId: 'u32', - nftId: 'u32', - approvalRequired: 'bool', + accept_nft: { + rmrkCollectionId: 'u32', + rmrkNftId: 'u32', + newOwner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', }, - NFTAccepted: { - sender: 'AccountId32', - recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', - collectionId: 'u32', - nftId: 'u32', + reject_nft: { + rmrkCollectionId: 'u32', + rmrkNftId: 'u32', }, - NFTRejected: { - sender: 'AccountId32', - collectionId: 'u32', - nftId: 'u32', + accept_resource: { + rmrkCollectionId: 'u32', + rmrkNftId: 'u32', + resourceId: 'u32', }, - PropertySet: { - collectionId: 'u32', + accept_resource_removal: { + rmrkCollectionId: 'u32', + rmrkNftId: 'u32', + resourceId: 'u32', + }, + set_property: { + rmrkCollectionId: 'Compact', maybeNftId: 'Option', key: 'Bytes', value: 'Bytes', }, - ResourceAdded: { - nftId: 'u32', - resourceId: 'u32', + set_priority: { + rmrkCollectionId: 'u32', + rmrkNftId: 'u32', + priorities: 'Vec', }, - ResourceRemoval: { + add_basic_resource: { + rmrkCollectionId: 'u32', nftId: 'u32', - resourceId: 'u32', + resource: 'RmrkTraitsResourceBasicResource', }, - ResourceAccepted: { + add_composable_resource: { + rmrkCollectionId: 'u32', nftId: 'u32', - resourceId: 'u32', + resource: 'RmrkTraitsResourceComposableResource', }, - ResourceRemovalAccepted: { + add_slot_resource: { + rmrkCollectionId: 'u32', nftId: 'u32', - resourceId: 'u32', + resource: 'RmrkTraitsResourceSlotResource', }, - PrioritySet: { - collectionId: 'u32', - nftId: 'u32' + remove_resource: { + rmrkCollectionId: 'u32', + nftId: 'u32', + resourceId: 'u32' } } }, /** - * Lookup294: pallet_rmrk_equip::pallet::Event + * Lookup282: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> + **/ + RmrkTraitsResourceResourceTypes: { + _enum: { + Basic: 'RmrkTraitsResourceBasicResource', + Composable: 'RmrkTraitsResourceComposableResource', + Slot: 'RmrkTraitsResourceSlotResource' + } + }, + /** + * Lookup284: rmrk_traits::resource::BasicResource> + **/ + RmrkTraitsResourceBasicResource: { + src: 'Option', + metadata: 'Option', + license: 'Option', + thumb: 'Option' + }, + /** + * Lookup286: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> + **/ + RmrkTraitsResourceComposableResource: { + parts: 'Vec', + base: 'u32', + src: 'Option', + metadata: 'Option', + license: 'Option', + thumb: 'Option' + }, + /** + * Lookup287: rmrk_traits::resource::SlotResource> **/ - PalletRmrkEquipEvent: { + RmrkTraitsResourceSlotResource: { + base: 'u32', + src: 'Option', + metadata: 'Option', + slot: 'u32', + license: 'Option', + thumb: 'Option' + }, + /** + * Lookup290: pallet_rmrk_equip::pallet::Call + **/ + PalletRmrkEquipCall: { _enum: { - BaseCreated: { - issuer: 'AccountId32', + create_base: { + baseType: 'Bytes', + symbol: 'Bytes', + parts: 'Vec', + }, + theme_add: { baseId: 'u32', + theme: 'RmrkTraitsTheme', }, - EquippablesUpdated: { + equippable: { baseId: 'u32', - slotId: 'u32' + slotId: 'u32', + equippables: 'RmrkTraitsPartEquippableList' } } }, /** - * Lookup295: pallet_evm::pallet::Event + * Lookup293: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> **/ - PalletEvmEvent: { + RmrkTraitsPartPartType: { _enum: { - Log: 'EthereumLog', - Created: 'H160', - CreatedFailed: 'H160', - Executed: 'H160', - ExecutedFailed: 'H160', - BalanceDeposit: '(AccountId32,H160,U256)', - BalanceWithdraw: '(AccountId32,H160,U256)' + FixedPart: 'RmrkTraitsPartFixedPart', + SlotPart: 'RmrkTraitsPartSlotPart' } }, /** - * Lookup296: ethereum::log::Log + * Lookup295: rmrk_traits::part::FixedPart> **/ - EthereumLog: { - address: 'H160', - topics: 'Vec', - data: 'Bytes' + RmrkTraitsPartFixedPart: { + id: 'u32', + z: 'u32', + src: 'Bytes' }, /** - * Lookup297: pallet_ethereum::pallet::Event + * Lookup296: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> **/ - PalletEthereumEvent: { - _enum: { - Executed: '(H160,H160,H256,EvmCoreErrorExitReason)' - } + RmrkTraitsPartSlotPart: { + id: 'u32', + equippable: 'RmrkTraitsPartEquippableList', + src: 'Bytes', + z: 'u32' }, /** - * Lookup298: evm_core::error::ExitReason + * Lookup297: rmrk_traits::part::EquippableList> **/ - EvmCoreErrorExitReason: { + RmrkTraitsPartEquippableList: { _enum: { - Succeed: 'EvmCoreErrorExitSucceed', - Error: 'EvmCoreErrorExitError', - Revert: 'EvmCoreErrorExitRevert', - Fatal: 'EvmCoreErrorExitFatal' + All: 'Null', + Empty: 'Null', + Custom: 'Vec' } }, /** - * Lookup299: evm_core::error::ExitSucceed - **/ - EvmCoreErrorExitSucceed: { - _enum: ['Stopped', 'Returned', 'Suicided'] - }, - /** - * Lookup300: evm_core::error::ExitError + * Lookup299: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> **/ - EvmCoreErrorExitError: { - _enum: { - StackUnderflow: 'Null', - StackOverflow: 'Null', - InvalidJump: 'Null', - InvalidRange: 'Null', - DesignatedInvalid: 'Null', - CallTooDeep: 'Null', - CreateCollision: 'Null', - CreateContractLimit: 'Null', - OutOfOffset: 'Null', - OutOfGas: 'Null', - OutOfFund: 'Null', - PCUnderflow: 'Null', - CreateEmpty: 'Null', - Other: 'Text', - InvalidCode: 'Null' - } + RmrkTraitsTheme: { + name: 'Bytes', + properties: 'Vec', + inherit: 'bool' }, /** - * Lookup303: evm_core::error::ExitRevert + * Lookup301: rmrk_traits::theme::ThemeProperty> **/ - EvmCoreErrorExitRevert: { - _enum: ['Reverted'] + RmrkTraitsThemeThemeProperty: { + key: 'Bytes', + value: 'Bytes' }, /** - * Lookup304: evm_core::error::ExitFatal + * Lookup303: pallet_evm::pallet::Call **/ - EvmCoreErrorExitFatal: { + PalletEvmCall: { _enum: { - NotSupported: 'Null', - UnhandledInterrupt: 'Null', - CallErrorAsFatal: 'EvmCoreErrorExitError', - Other: 'Text' + withdraw: { + address: 'H160', + value: 'u128', + }, + call: { + source: 'H160', + target: 'H160', + input: 'Bytes', + value: 'U256', + gasLimit: 'u64', + maxFeePerGas: 'U256', + maxPriorityFeePerGas: 'Option', + nonce: 'Option', + accessList: 'Vec<(H160,Vec)>', + }, + create: { + source: 'H160', + init: 'Bytes', + value: 'U256', + gasLimit: 'u64', + maxFeePerGas: 'U256', + maxPriorityFeePerGas: 'Option', + nonce: 'Option', + accessList: 'Vec<(H160,Vec)>', + }, + create2: { + source: 'H160', + init: 'Bytes', + salt: 'H256', + value: 'U256', + gasLimit: 'u64', + maxFeePerGas: 'U256', + maxPriorityFeePerGas: 'Option', + nonce: 'Option', + accessList: 'Vec<(H160,Vec)>' + } } }, /** - * Lookup305: frame_system::Phase + * Lookup307: pallet_ethereum::pallet::Call **/ - FrameSystemPhase: { + PalletEthereumCall: { _enum: { - ApplyExtrinsic: 'u32', - Finalization: 'Null', - Initialization: 'Null' + transact: { + transaction: 'EthereumTransactionTransactionV2' + } } }, /** - * Lookup307: frame_system::LastRuntimeUpgradeInfo + * Lookup308: ethereum::transaction::TransactionV2 **/ - FrameSystemLastRuntimeUpgradeInfo: { - specVersion: 'Compact', - specName: 'Text' + EthereumTransactionTransactionV2: { + _enum: { + Legacy: 'EthereumTransactionLegacyTransaction', + EIP2930: 'EthereumTransactionEip2930Transaction', + EIP1559: 'EthereumTransactionEip1559Transaction' + } }, /** - * Lookup308: frame_system::limits::BlockWeights + * Lookup309: ethereum::transaction::LegacyTransaction **/ - FrameSystemLimitsBlockWeights: { - baseBlock: 'u64', - maxBlock: 'u64', - perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass' + EthereumTransactionLegacyTransaction: { + nonce: 'U256', + gasPrice: 'U256', + gasLimit: 'U256', + action: 'EthereumTransactionTransactionAction', + value: 'U256', + input: 'Bytes', + signature: 'EthereumTransactionTransactionSignature' }, /** - * Lookup309: frame_support::weights::PerDispatchClass + * Lookup310: ethereum::transaction::TransactionAction **/ - FrameSupportWeightsPerDispatchClassWeightsPerClass: { - normal: 'FrameSystemLimitsWeightsPerClass', - operational: 'FrameSystemLimitsWeightsPerClass', - mandatory: 'FrameSystemLimitsWeightsPerClass' + EthereumTransactionTransactionAction: { + _enum: { + Call: 'H160', + Create: 'Null' + } }, /** - * Lookup310: frame_system::limits::WeightsPerClass + * Lookup311: ethereum::transaction::TransactionSignature **/ - FrameSystemLimitsWeightsPerClass: { - baseExtrinsic: 'u64', - maxExtrinsic: 'Option', - maxTotal: 'Option', - reserved: 'Option' + EthereumTransactionTransactionSignature: { + v: 'u64', + r: 'H256', + s: 'H256' }, /** - * Lookup311: frame_system::limits::BlockLength + * Lookup313: ethereum::transaction::EIP2930Transaction **/ - FrameSystemLimitsBlockLength: { - max: 'FrameSupportWeightsPerDispatchClassU32' + EthereumTransactionEip2930Transaction: { + chainId: 'u64', + nonce: 'U256', + gasPrice: 'U256', + gasLimit: 'U256', + action: 'EthereumTransactionTransactionAction', + value: 'U256', + input: 'Bytes', + accessList: 'Vec', + oddYParity: 'bool', + r: 'H256', + s: 'H256' }, /** - * Lookup312: frame_support::weights::PerDispatchClass + * Lookup315: ethereum::transaction::AccessListItem **/ - FrameSupportWeightsPerDispatchClassU32: { - normal: 'u32', - operational: 'u32', - mandatory: 'u32' + EthereumTransactionAccessListItem: { + address: 'H160', + storageKeys: 'Vec' }, /** - * Lookup313: frame_support::weights::RuntimeDbWeight + * Lookup316: ethereum::transaction::EIP1559Transaction **/ - FrameSupportWeightsRuntimeDbWeight: { - read: 'u64', - write: 'u64' + EthereumTransactionEip1559Transaction: { + chainId: 'u64', + nonce: 'U256', + maxPriorityFeePerGas: 'U256', + maxFeePerGas: 'U256', + gasLimit: 'U256', + action: 'EthereumTransactionTransactionAction', + value: 'U256', + input: 'Bytes', + accessList: 'Vec', + oddYParity: 'bool', + r: 'H256', + s: 'H256' }, /** - * Lookup314: sp_version::RuntimeVersion + * Lookup317: pallet_evm_migration::pallet::Call **/ - SpVersionRuntimeVersion: { - specName: 'Text', - implName: 'Text', - authoringVersion: 'u32', - specVersion: 'u32', - implVersion: 'u32', - apis: 'Vec<([u8;8],u32)>', - transactionVersion: 'u32', - stateVersion: 'u8' + PalletEvmMigrationCall: { + _enum: { + begin: { + address: 'H160', + }, + set_data: { + address: 'H160', + data: 'Vec<(H256,H256)>', + }, + finish: { + address: 'H160', + code: 'Bytes' + } + } }, /** - * Lookup318: frame_system::pallet::Error + * Lookup320: pallet_sudo::pallet::Error **/ - FrameSystemError: { - _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] + PalletSudoError: { + _enum: ['RequireSudo'] }, /** - * Lookup320: orml_vesting::module::Error + * Lookup322: orml_vesting::module::Error **/ OrmlVestingModuleError: { _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded'] }, /** - * Lookup322: cumulus_pallet_xcmp_queue::InboundChannelDetails + * Lookup324: cumulus_pallet_xcmp_queue::InboundChannelDetails **/ CumulusPalletXcmpQueueInboundChannelDetails: { sender: 'u32', @@ -2571,19 +2615,19 @@ export default { messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>' }, /** - * Lookup323: cumulus_pallet_xcmp_queue::InboundState + * Lookup325: cumulus_pallet_xcmp_queue::InboundState **/ CumulusPalletXcmpQueueInboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup326: polkadot_parachain::primitives::XcmpMessageFormat + * Lookup328: polkadot_parachain::primitives::XcmpMessageFormat **/ PolkadotParachainPrimitivesXcmpMessageFormat: { _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals'] }, /** - * Lookup329: cumulus_pallet_xcmp_queue::OutboundChannelDetails + * Lookup331: cumulus_pallet_xcmp_queue::OutboundChannelDetails **/ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: 'u32', @@ -2593,13 +2637,13 @@ export default { lastIndex: 'u16' }, /** - * Lookup330: cumulus_pallet_xcmp_queue::OutboundState + * Lookup332: cumulus_pallet_xcmp_queue::OutboundState **/ CumulusPalletXcmpQueueOutboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup332: cumulus_pallet_xcmp_queue::QueueConfigData + * Lookup334: cumulus_pallet_xcmp_queue::QueueConfigData **/ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: 'u32', @@ -2610,29 +2654,29 @@ export default { xcmpMaxIndividualWeight: 'u64' }, /** - * Lookup334: cumulus_pallet_xcmp_queue::pallet::Error + * Lookup336: cumulus_pallet_xcmp_queue::pallet::Error **/ CumulusPalletXcmpQueueError: { _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit'] }, /** - * Lookup335: pallet_xcm::pallet::Error + * Lookup337: pallet_xcm::pallet::Error **/ PalletXcmError: { _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed'] }, /** - * Lookup336: cumulus_pallet_xcm::pallet::Error + * Lookup338: cumulus_pallet_xcm::pallet::Error **/ CumulusPalletXcmError: 'Null', /** - * Lookup337: cumulus_pallet_dmp_queue::ConfigData + * Lookup339: cumulus_pallet_dmp_queue::ConfigData **/ CumulusPalletDmpQueueConfigData: { maxIndividual: 'u64' }, /** - * Lookup338: cumulus_pallet_dmp_queue::PageIndexData + * Lookup340: cumulus_pallet_dmp_queue::PageIndexData **/ CumulusPalletDmpQueuePageIndexData: { beginUsed: 'u32', @@ -2640,19 +2684,19 @@ export default { overweightCount: 'u64' }, /** - * Lookup341: cumulus_pallet_dmp_queue::pallet::Error + * Lookup343: cumulus_pallet_dmp_queue::pallet::Error **/ CumulusPalletDmpQueueError: { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup345: pallet_unique::Error + * Lookup347: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup348: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> + * Lookup350: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> **/ PalletUniqueSchedulerScheduledV3: { maybeId: 'Option<[u8;16]>', @@ -2662,11 +2706,11 @@ export default { origin: 'OpalRuntimeOriginCaller' }, /** - * Lookup349: opal_runtime::OriginCaller + * Lookup351: opal_runtime::OriginCaller **/ OpalRuntimeOriginCaller: { _enum: { - __Unused0: 'Null', + system: 'FrameSupportDispatchRawOrigin', __Unused1: 'Null', __Unused2: 'Null', __Unused3: 'Null', @@ -2702,7 +2746,7 @@ export default { __Unused33: 'Null', __Unused34: 'Null', __Unused35: 'Null', - system: 'FrameSupportDispatchRawOrigin', + __Unused36: 'Null', __Unused37: 'Null', __Unused38: 'Null', __Unused39: 'Null', @@ -2771,7 +2815,7 @@ export default { } }, /** - * Lookup350: frame_support::dispatch::RawOrigin + * Lookup352: frame_support::dispatch::RawOrigin **/ FrameSupportDispatchRawOrigin: { _enum: { @@ -2781,7 +2825,7 @@ export default { } }, /** - * Lookup351: pallet_xcm::pallet::Origin + * Lookup353: pallet_xcm::pallet::Origin **/ PalletXcmOrigin: { _enum: { @@ -2790,7 +2834,7 @@ export default { } }, /** - * Lookup352: cumulus_pallet_xcm::pallet::Origin + * Lookup354: cumulus_pallet_xcm::pallet::Origin **/ CumulusPalletXcmOrigin: { _enum: { @@ -2799,7 +2843,7 @@ export default { } }, /** - * Lookup353: pallet_ethereum::RawOrigin + * Lookup355: pallet_ethereum::RawOrigin **/ PalletEthereumRawOrigin: { _enum: { @@ -2807,17 +2851,17 @@ export default { } }, /** - * Lookup354: sp_core::Void + * Lookup356: sp_core::Void **/ SpCoreVoid: 'Null', /** - * Lookup355: pallet_unique_scheduler::pallet::Error + * Lookup357: pallet_unique_scheduler::pallet::Error **/ PalletUniqueSchedulerError: { _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] }, /** - * Lookup356: up_data_structs::Collection + * Lookup358: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -2831,7 +2875,7 @@ export default { externalCollection: 'bool' }, /** - * Lookup357: up_data_structs::SponsorshipState + * Lookup359: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipState: { _enum: { @@ -2841,7 +2885,7 @@ export default { } }, /** - * Lookup358: up_data_structs::Properties + * Lookup360: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -2849,15 +2893,15 @@ export default { spaceLimit: 'u32' }, /** - * Lookup359: up_data_structs::PropertiesMap> + * Lookup361: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** - * Lookup364: up_data_structs::PropertiesMap + * Lookup366: up_data_structs::PropertiesMap **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup371: up_data_structs::CollectionStats + * Lookup373: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -2865,18 +2909,18 @@ export default { alive: 'u32' }, /** - * Lookup372: up_data_structs::TokenChild + * Lookup374: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup373: PhantomType::up_data_structs + * Lookup375: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup375: up_data_structs::TokenData> + * Lookup377: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -2884,7 +2928,7 @@ export default { pieces: 'u128' }, /** - * Lookup377: up_data_structs::RpcCollection + * Lookup379: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -2900,7 +2944,7 @@ export default { readOnly: 'bool' }, /** - * Lookup378: rmrk_traits::collection::CollectionInfo, frame_support::storage::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup380: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -2910,7 +2954,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup379: rmrk_traits::nft::NftInfo> + * Lookup381: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -2920,14 +2964,14 @@ export default { pending: 'bool' }, /** - * Lookup381: rmrk_traits::nft::RoyaltyInfo + * Lookup383: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup382: rmrk_traits::resource::ResourceInfo, frame_support::storage::bounded_vec::BoundedVec> + * Lookup384: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -2936,14 +2980,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup383: rmrk_traits::property::PropertyInfo, frame_support::storage::bounded_vec::BoundedVec> + * Lookup385: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup384: rmrk_traits::base::BaseInfo> + * Lookup386: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -2951,80 +2995,80 @@ export default { symbol: 'Bytes' }, /** - * Lookup385: rmrk_traits::nft::NftChild + * Lookup387: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup387: pallet_common::pallet::Error + * Lookup389: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup389: pallet_fungible::pallet::Error + * Lookup391: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup390: pallet_refungible::ItemData + * Lookup392: pallet_refungible::ItemData **/ PalletRefungibleItemData: { constData: 'Bytes' }, /** - * Lookup395: pallet_refungible::pallet::Error + * Lookup397: pallet_refungible::pallet::Error **/ PalletRefungibleError: { _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup396: pallet_nonfungible::ItemData> + * Lookup398: pallet_nonfungible::ItemData> **/ PalletNonfungibleItemData: { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup398: up_data_structs::PropertyScope + * Lookup400: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { _enum: ['None', 'Rmrk', 'Eth'] }, /** - * Lookup400: pallet_nonfungible::pallet::Error + * Lookup402: pallet_nonfungible::pallet::Error **/ PalletNonfungibleError: { _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup401: pallet_structure::pallet::Error + * Lookup403: pallet_structure::pallet::Error **/ PalletStructureError: { _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup402: pallet_rmrk_core::pallet::Error + * Lookup404: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** - * Lookup404: pallet_rmrk_equip::pallet::Error + * Lookup406: pallet_rmrk_equip::pallet::Error **/ PalletRmrkEquipError: { _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] }, /** - * Lookup407: pallet_evm::pallet::Error + * Lookup409: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup410: fp_rpc::TransactionStatus + * Lookup412: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -3036,11 +3080,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup412: ethbloom::Bloom + * Lookup414: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup414: ethereum::receipt::ReceiptV3 + * Lookup416: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -3050,7 +3094,7 @@ export default { } }, /** - * Lookup415: ethereum::receipt::EIP658ReceiptData + * Lookup417: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -3059,7 +3103,7 @@ export default { logs: 'Vec' }, /** - * Lookup416: ethereum::block::Block + * Lookup418: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -3067,7 +3111,7 @@ export default { ommers: 'Vec' }, /** - * Lookup417: ethereum::header::Header + * Lookup419: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -3087,41 +3131,41 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup418: ethereum_types::hash::H64 + * Lookup420: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup423: pallet_ethereum::pallet::Error + * Lookup425: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup424: pallet_evm_coder_substrate::pallet::Error + * Lookup426: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup425: pallet_evm_contract_helpers::SponsoringModeT + * Lookup427: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup427: pallet_evm_contract_helpers::pallet::Error + * Lookup429: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission'] }, /** - * Lookup428: pallet_evm_migration::pallet::Error + * Lookup430: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup430: sp_runtime::MultiSignature + * Lookup432: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3131,43 +3175,43 @@ export default { } }, /** - * Lookup431: sp_core::ed25519::Signature + * Lookup433: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup433: sp_core::sr25519::Signature + * Lookup435: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup434: sp_core::ecdsa::Signature + * Lookup436: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup437: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup439: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup438: frame_system::extensions::check_genesis::CheckGenesis + * Lookup440: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup441: frame_system::extensions::check_nonce::CheckNonce + * Lookup443: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup442: frame_system::extensions::check_weight::CheckWeight + * Lookup444: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup443: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup445: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup444: opal_runtime::Runtime + * Lookup446: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup445: pallet_ethereum::FakeTransactionFinalizer + * Lookup447: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index 43f43b59b8..7890b69b36 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -1,10 +1,14 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/types/types/registry'; + +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { - export interface InterfaceTypes { + interface InterfaceTypes { CumulusPalletDmpQueueCall: CumulusPalletDmpQueueCall; CumulusPalletDmpQueueConfigData: CumulusPalletDmpQueueConfigData; CumulusPalletDmpQueueError: CumulusPalletDmpQueueError; @@ -125,6 +129,7 @@ declare module '@polkadot/types/types/registry' { PalletTemplateTransactionPaymentCall: PalletTemplateTransactionPaymentCall; PalletTemplateTransactionPaymentChargeTransactionPayment: PalletTemplateTransactionPaymentChargeTransactionPayment; PalletTimestampCall: PalletTimestampCall; + PalletTransactionPaymentEvent: PalletTransactionPaymentEvent; PalletTransactionPaymentReleases: PalletTransactionPaymentReleases; PalletTreasuryCall: PalletTreasuryCall; PalletTreasuryError: PalletTreasuryError; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 4c0da06805..323fc2c01e 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1,111 +1,170 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -declare module '@polkadot/types/lookup' { - import type { BTreeMap, BTreeSet, Bytes, Compact, Enum, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; - import type { ITuple } from '@polkadot/types-codec/types'; - import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; - import type { Event } from '@polkadot/types/interfaces/system'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/types/lookup'; - /** @name PolkadotPrimitivesV2PersistedValidationData (2) */ - export interface PolkadotPrimitivesV2PersistedValidationData extends Struct { - readonly parentHead: Bytes; - readonly relayParentNumber: u32; - readonly relayParentStorageRoot: H256; - readonly maxPovSize: u32; - } +import type { BTreeMap, BTreeSet, Bytes, Compact, Enum, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; +import type { ITuple } from '@polkadot/types-codec/types'; +import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; +import type { Event } from '@polkadot/types/interfaces/system'; - /** @name PolkadotPrimitivesV2UpgradeRestriction (9) */ - export interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { - readonly isPresent: boolean; - readonly type: 'Present'; +declare module '@polkadot/types/lookup' { + /** @name FrameSystemAccountInfo (3) */ + interface FrameSystemAccountInfo extends Struct { + readonly nonce: u32; + readonly consumers: u32; + readonly providers: u32; + readonly sufficients: u32; + readonly data: PalletBalancesAccountData; } - /** @name SpTrieStorageProof (10) */ - export interface SpTrieStorageProof extends Struct { - readonly trieNodes: BTreeSet; + /** @name PalletBalancesAccountData (5) */ + interface PalletBalancesAccountData extends Struct { + readonly free: u128; + readonly reserved: u128; + readonly miscFrozen: u128; + readonly feeFrozen: u128; } - /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (13) */ - export interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { - readonly dmqMqcHead: H256; - readonly relayDispatchQueueSize: ITuple<[u32, u32]>; - readonly ingressChannels: Vec>; - readonly egressChannels: Vec>; + /** @name FrameSupportWeightsPerDispatchClassU64 (7) */ + interface FrameSupportWeightsPerDispatchClassU64 extends Struct { + readonly normal: u64; + readonly operational: u64; + readonly mandatory: u64; } - /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (18) */ - export interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { - readonly maxCapacity: u32; - readonly maxTotalSize: u32; - readonly maxMessageSize: u32; - readonly msgCount: u32; - readonly totalSize: u32; - readonly mqcHead: Option; + /** @name SpRuntimeDigest (11) */ + interface SpRuntimeDigest extends Struct { + readonly logs: Vec; } - /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (20) */ - export interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { - readonly maxCodeSize: u32; - readonly maxHeadDataSize: u32; - readonly maxUpwardQueueCount: u32; - readonly maxUpwardQueueSize: u32; - readonly maxUpwardMessageSize: u32; - readonly maxUpwardMessageNumPerCandidate: u32; - readonly hrmpMaxMessageNumPerCandidate: u32; - readonly validationUpgradeCooldown: u32; - readonly validationUpgradeDelay: u32; + /** @name SpRuntimeDigestDigestItem (13) */ + interface SpRuntimeDigestDigestItem extends Enum { + readonly isOther: boolean; + readonly asOther: Bytes; + readonly isConsensus: boolean; + readonly asConsensus: ITuple<[U8aFixed, Bytes]>; + readonly isSeal: boolean; + readonly asSeal: ITuple<[U8aFixed, Bytes]>; + readonly isPreRuntime: boolean; + readonly asPreRuntime: ITuple<[U8aFixed, Bytes]>; + readonly isRuntimeEnvironmentUpdated: boolean; + readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated'; } - /** @name PolkadotCorePrimitivesOutboundHrmpMessage (26) */ - export interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { - readonly recipient: u32; - readonly data: Bytes; + /** @name FrameSystemEventRecord (16) */ + interface FrameSystemEventRecord extends Struct { + readonly phase: FrameSystemPhase; + readonly event: Event; + readonly topics: Vec; } - /** @name CumulusPalletParachainSystemCall (28) */ - export interface CumulusPalletParachainSystemCall extends Enum { - readonly isSetValidationData: boolean; - readonly asSetValidationData: { - readonly data: CumulusPrimitivesParachainInherentParachainInherentData; + /** @name FrameSystemEvent (18) */ + interface FrameSystemEvent extends Enum { + readonly isExtrinsicSuccess: boolean; + readonly asExtrinsicSuccess: { + readonly dispatchInfo: FrameSupportWeightsDispatchInfo; } & Struct; - readonly isSudoSendUpwardMessage: boolean; - readonly asSudoSendUpwardMessage: { - readonly message: Bytes; + readonly isExtrinsicFailed: boolean; + readonly asExtrinsicFailed: { + readonly dispatchError: SpRuntimeDispatchError; + readonly dispatchInfo: FrameSupportWeightsDispatchInfo; } & Struct; - readonly isAuthorizeUpgrade: boolean; - readonly asAuthorizeUpgrade: { - readonly codeHash: H256; + readonly isCodeUpdated: boolean; + readonly isNewAccount: boolean; + readonly asNewAccount: { + readonly account: AccountId32; } & Struct; - readonly isEnactAuthorizedUpgrade: boolean; - readonly asEnactAuthorizedUpgrade: { - readonly code: Bytes; + readonly isKilledAccount: boolean; + readonly asKilledAccount: { + readonly account: AccountId32; } & Struct; - readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade'; + readonly isRemarked: boolean; + readonly asRemarked: { + readonly sender: AccountId32; + readonly hash_: H256; + } & Struct; + readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked'; } - /** @name CumulusPrimitivesParachainInherentParachainInherentData (29) */ - export interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { - readonly validationData: PolkadotPrimitivesV2PersistedValidationData; - readonly relayChainState: SpTrieStorageProof; - readonly downwardMessages: Vec; - readonly horizontalMessages: BTreeMap>; + /** @name FrameSupportWeightsDispatchInfo (19) */ + interface FrameSupportWeightsDispatchInfo extends Struct { + readonly weight: u64; + readonly class: FrameSupportWeightsDispatchClass; + readonly paysFee: FrameSupportWeightsPays; } - /** @name PolkadotCorePrimitivesInboundDownwardMessage (31) */ - export interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { - readonly sentAt: u32; - readonly msg: Bytes; + /** @name FrameSupportWeightsDispatchClass (20) */ + interface FrameSupportWeightsDispatchClass extends Enum { + readonly isNormal: boolean; + readonly isOperational: boolean; + readonly isMandatory: boolean; + readonly type: 'Normal' | 'Operational' | 'Mandatory'; } - /** @name PolkadotCorePrimitivesInboundHrmpMessage (34) */ - export interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { - readonly sentAt: u32; - readonly data: Bytes; + /** @name FrameSupportWeightsPays (21) */ + interface FrameSupportWeightsPays extends Enum { + readonly isYes: boolean; + readonly isNo: boolean; + readonly type: 'Yes' | 'No'; + } + + /** @name SpRuntimeDispatchError (22) */ + interface SpRuntimeDispatchError extends Enum { + readonly isOther: boolean; + readonly isCannotLookup: boolean; + readonly isBadOrigin: boolean; + readonly isModule: boolean; + readonly asModule: SpRuntimeModuleError; + readonly isConsumerRemaining: boolean; + readonly isNoProviders: boolean; + readonly isTooManyConsumers: boolean; + readonly isToken: boolean; + readonly asToken: SpRuntimeTokenError; + readonly isArithmetic: boolean; + readonly asArithmetic: SpRuntimeArithmeticError; + readonly isTransactional: boolean; + readonly asTransactional: SpRuntimeTransactionalError; + readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional'; + } + + /** @name SpRuntimeModuleError (23) */ + interface SpRuntimeModuleError extends Struct { + readonly index: u8; + readonly error: U8aFixed; + } + + /** @name SpRuntimeTokenError (24) */ + interface SpRuntimeTokenError extends Enum { + readonly isNoFunds: boolean; + readonly isWouldDie: boolean; + readonly isBelowMinimum: boolean; + readonly isCannotCreate: boolean; + readonly isUnknownAsset: boolean; + readonly isFrozen: boolean; + readonly isUnsupported: boolean; + readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported'; + } + + /** @name SpRuntimeArithmeticError (25) */ + interface SpRuntimeArithmeticError extends Enum { + readonly isUnderflow: boolean; + readonly isOverflow: boolean; + readonly isDivisionByZero: boolean; + readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero'; + } + + /** @name SpRuntimeTransactionalError (26) */ + interface SpRuntimeTransactionalError extends Enum { + readonly isLimitReached: boolean; + readonly isNoLayer: boolean; + readonly type: 'LimitReached' | 'NoLayer'; } - /** @name CumulusPalletParachainSystemEvent (37) */ - export interface CumulusPalletParachainSystemEvent extends Enum { + /** @name CumulusPalletParachainSystemEvent (27) */ + interface CumulusPalletParachainSystemEvent extends Enum { readonly isValidationFunctionStored: boolean; readonly isValidationFunctionApplied: boolean; readonly asValidationFunctionApplied: { @@ -128,94 +187,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'ValidationFunctionStored' | 'ValidationFunctionApplied' | 'ValidationFunctionDiscarded' | 'UpgradeAuthorized' | 'DownwardMessagesReceived' | 'DownwardMessagesProcessed'; } - /** @name CumulusPalletParachainSystemError (38) */ - export interface CumulusPalletParachainSystemError extends Enum { - readonly isOverlappingUpgrades: boolean; - readonly isProhibitedByPolkadot: boolean; - readonly isTooBig: boolean; - readonly isValidationDataNotAvailable: boolean; - readonly isHostConfigurationNotAvailable: boolean; - readonly isNotScheduled: boolean; - readonly isNothingAuthorized: boolean; - readonly isUnauthorized: boolean; - readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized'; - } - - /** @name PalletBalancesAccountData (41) */ - export interface PalletBalancesAccountData extends Struct { - readonly free: u128; - readonly reserved: u128; - readonly miscFrozen: u128; - readonly feeFrozen: u128; - } - - /** @name PalletBalancesBalanceLock (43) */ - export interface PalletBalancesBalanceLock extends Struct { - readonly id: U8aFixed; - readonly amount: u128; - readonly reasons: PalletBalancesReasons; - } - - /** @name PalletBalancesReasons (45) */ - export interface PalletBalancesReasons extends Enum { - readonly isFee: boolean; - readonly isMisc: boolean; - readonly isAll: boolean; - readonly type: 'Fee' | 'Misc' | 'All'; - } - - /** @name PalletBalancesReserveData (48) */ - export interface PalletBalancesReserveData extends Struct { - readonly id: U8aFixed; - readonly amount: u128; - } - - /** @name PalletBalancesReleases (51) */ - export interface PalletBalancesReleases extends Enum { - readonly isV100: boolean; - readonly isV200: boolean; - readonly type: 'V100' | 'V200'; - } - - /** @name PalletBalancesCall (52) */ - export interface PalletBalancesCall extends Enum { - readonly isTransfer: boolean; - readonly asTransfer: { - readonly dest: MultiAddress; - readonly value: Compact; - } & Struct; - readonly isSetBalance: boolean; - readonly asSetBalance: { - readonly who: MultiAddress; - readonly newFree: Compact; - readonly newReserved: Compact; - } & Struct; - readonly isForceTransfer: boolean; - readonly asForceTransfer: { - readonly source: MultiAddress; - readonly dest: MultiAddress; - readonly value: Compact; - } & Struct; - readonly isTransferKeepAlive: boolean; - readonly asTransferKeepAlive: { - readonly dest: MultiAddress; - readonly value: Compact; - } & Struct; - readonly isTransferAll: boolean; - readonly asTransferAll: { - readonly dest: MultiAddress; - readonly keepAlive: bool; - } & Struct; - readonly isForceUnreserve: boolean; - readonly asForceUnreserve: { - readonly who: MultiAddress; - readonly amount: u128; - } & Struct; - readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; - } - - /** @name PalletBalancesEvent (58) */ - export interface PalletBalancesEvent extends Enum { + /** @name PalletBalancesEvent (28) */ + interface PalletBalancesEvent extends Enum { readonly isEndowed: boolean; readonly asEndowed: { readonly account: AccountId32; @@ -273,77 +246,29 @@ declare module '@polkadot/types/lookup' { readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'BalanceSet' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'Deposit' | 'Withdraw' | 'Slashed'; } - /** @name FrameSupportTokensMiscBalanceStatus (59) */ - export interface FrameSupportTokensMiscBalanceStatus extends Enum { + /** @name FrameSupportTokensMiscBalanceStatus (29) */ + interface FrameSupportTokensMiscBalanceStatus extends Enum { readonly isFree: boolean; readonly isReserved: boolean; readonly type: 'Free' | 'Reserved'; } - /** @name PalletBalancesError (60) */ - export interface PalletBalancesError extends Enum { - readonly isVestingBalance: boolean; - readonly isLiquidityRestrictions: boolean; - readonly isInsufficientBalance: boolean; - readonly isExistentialDeposit: boolean; - readonly isKeepAlive: boolean; - readonly isExistingVestingSchedule: boolean; - readonly isDeadAccount: boolean; - readonly isTooManyReserves: boolean; - readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves'; - } - - /** @name PalletTimestampCall (63) */ - export interface PalletTimestampCall extends Enum { - readonly isSet: boolean; - readonly asSet: { - readonly now: Compact; + /** @name PalletTransactionPaymentEvent (30) */ + interface PalletTransactionPaymentEvent extends Enum { + readonly isTransactionFeePaid: boolean; + readonly asTransactionFeePaid: { + readonly who: AccountId32; + readonly actualFee: u128; + readonly tip: u128; } & Struct; - readonly type: 'Set'; - } - - /** @name PalletTransactionPaymentReleases (66) */ - export interface PalletTransactionPaymentReleases extends Enum { - readonly isV1Ancient: boolean; - readonly isV2: boolean; - readonly type: 'V1Ancient' | 'V2'; - } - - /** @name PalletTreasuryProposal (67) */ - export interface PalletTreasuryProposal extends Struct { - readonly proposer: AccountId32; - readonly value: u128; - readonly beneficiary: AccountId32; - readonly bond: u128; + readonly type: 'TransactionFeePaid'; } - /** @name PalletTreasuryCall (70) */ - export interface PalletTreasuryCall extends Enum { - readonly isProposeSpend: boolean; - readonly asProposeSpend: { - readonly value: Compact; - readonly beneficiary: MultiAddress; - } & Struct; - readonly isRejectProposal: boolean; - readonly asRejectProposal: { - readonly proposalId: Compact; - } & Struct; - readonly isApproveProposal: boolean; - readonly asApproveProposal: { - readonly proposalId: Compact; - } & Struct; - readonly isRemoveApproval: boolean; - readonly asRemoveApproval: { - readonly proposalId: Compact; - } & Struct; - readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'RemoveApproval'; - } - - /** @name PalletTreasuryEvent (72) */ - export interface PalletTreasuryEvent extends Enum { - readonly isProposed: boolean; - readonly asProposed: { - readonly proposalIndex: u32; + /** @name PalletTreasuryEvent (31) */ + interface PalletTreasuryEvent extends Enum { + readonly isProposed: boolean; + readonly asProposed: { + readonly proposalIndex: u32; } & Struct; readonly isSpending: boolean; readonly asSpending: { @@ -372,246 +297,215 @@ declare module '@polkadot/types/lookup' { readonly asDeposit: { readonly value: u128; } & Struct; - readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit'; - } - - /** @name FrameSupportPalletId (75) */ - export interface FrameSupportPalletId extends U8aFixed {} - - /** @name PalletTreasuryError (76) */ - export interface PalletTreasuryError extends Enum { - readonly isInsufficientProposersBalance: boolean; - readonly isInvalidIndex: boolean; - readonly isTooManyApprovals: boolean; - readonly isProposalNotApproved: boolean; - readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'ProposalNotApproved'; - } - - /** @name PalletSudoCall (77) */ - export interface PalletSudoCall extends Enum { - readonly isSudo: boolean; - readonly asSudo: { - readonly call: Call; - } & Struct; - readonly isSudoUncheckedWeight: boolean; - readonly asSudoUncheckedWeight: { - readonly call: Call; - readonly weight: u64; - } & Struct; - readonly isSetKey: boolean; - readonly asSetKey: { - readonly new_: MultiAddress; - } & Struct; - readonly isSudoAs: boolean; - readonly asSudoAs: { - readonly who: MultiAddress; - readonly call: Call; + readonly isSpendApproved: boolean; + readonly asSpendApproved: { + readonly proposalIndex: u32; + readonly amount: u128; + readonly beneficiary: AccountId32; } & Struct; - readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs'; + readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit' | 'SpendApproved'; } - /** @name FrameSystemCall (79) */ - export interface FrameSystemCall extends Enum { - readonly isFillBlock: boolean; - readonly asFillBlock: { - readonly ratio: Perbill; - } & Struct; - readonly isRemark: boolean; - readonly asRemark: { - readonly remark: Bytes; - } & Struct; - readonly isSetHeapPages: boolean; - readonly asSetHeapPages: { - readonly pages: u64; - } & Struct; - readonly isSetCode: boolean; - readonly asSetCode: { - readonly code: Bytes; - } & Struct; - readonly isSetCodeWithoutChecks: boolean; - readonly asSetCodeWithoutChecks: { - readonly code: Bytes; - } & Struct; - readonly isSetStorage: boolean; - readonly asSetStorage: { - readonly items: Vec>; - } & Struct; - readonly isKillStorage: boolean; - readonly asKillStorage: { - readonly keys_: Vec; + /** @name PalletSudoEvent (32) */ + interface PalletSudoEvent extends Enum { + readonly isSudid: boolean; + readonly asSudid: { + readonly sudoResult: Result; } & Struct; - readonly isKillPrefix: boolean; - readonly asKillPrefix: { - readonly prefix: Bytes; - readonly subkeys: u32; + readonly isKeyChanged: boolean; + readonly asKeyChanged: { + readonly oldSudoer: Option; } & Struct; - readonly isRemarkWithEvent: boolean; - readonly asRemarkWithEvent: { - readonly remark: Bytes; + readonly isSudoAsDone: boolean; + readonly asSudoAsDone: { + readonly sudoResult: Result; } & Struct; - readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent'; + readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone'; } - /** @name OrmlVestingModuleCall (83) */ - export interface OrmlVestingModuleCall extends Enum { - readonly isClaim: boolean; - readonly isVestedTransfer: boolean; - readonly asVestedTransfer: { - readonly dest: MultiAddress; - readonly schedule: OrmlVestingVestingSchedule; + /** @name OrmlVestingModuleEvent (36) */ + interface OrmlVestingModuleEvent extends Enum { + readonly isVestingScheduleAdded: boolean; + readonly asVestingScheduleAdded: { + readonly from: AccountId32; + readonly to: AccountId32; + readonly vestingSchedule: OrmlVestingVestingSchedule; } & Struct; - readonly isUpdateVestingSchedules: boolean; - readonly asUpdateVestingSchedules: { - readonly who: MultiAddress; - readonly vestingSchedules: Vec; + readonly isClaimed: boolean; + readonly asClaimed: { + readonly who: AccountId32; + readonly amount: u128; } & Struct; - readonly isClaimFor: boolean; - readonly asClaimFor: { - readonly dest: MultiAddress; + readonly isVestingSchedulesUpdated: boolean; + readonly asVestingSchedulesUpdated: { + readonly who: AccountId32; } & Struct; - readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor'; + readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated'; } - /** @name OrmlVestingVestingSchedule (84) */ - export interface OrmlVestingVestingSchedule extends Struct { + /** @name OrmlVestingVestingSchedule (37) */ + interface OrmlVestingVestingSchedule extends Struct { readonly start: u32; readonly period: u32; readonly periodCount: u32; readonly perPeriod: Compact; } - /** @name CumulusPalletXcmpQueueCall (86) */ - export interface CumulusPalletXcmpQueueCall extends Enum { - readonly isServiceOverweight: boolean; - readonly asServiceOverweight: { - readonly index: u64; - readonly weightLimit: u64; - } & Struct; - readonly isSuspendXcmExecution: boolean; - readonly isResumeXcmExecution: boolean; - readonly isUpdateSuspendThreshold: boolean; - readonly asUpdateSuspendThreshold: { - readonly new_: u32; - } & Struct; - readonly isUpdateDropThreshold: boolean; - readonly asUpdateDropThreshold: { - readonly new_: u32; - } & Struct; - readonly isUpdateResumeThreshold: boolean; - readonly asUpdateResumeThreshold: { - readonly new_: u32; - } & Struct; - readonly isUpdateThresholdWeight: boolean; - readonly asUpdateThresholdWeight: { - readonly new_: u64; - } & Struct; - readonly isUpdateWeightRestrictDecay: boolean; - readonly asUpdateWeightRestrictDecay: { - readonly new_: u64; - } & Struct; - readonly isUpdateXcmpMaxIndividualWeight: boolean; - readonly asUpdateXcmpMaxIndividualWeight: { - readonly new_: u64; - } & Struct; - readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight'; - } - - /** @name PalletXcmCall (87) */ - export interface PalletXcmCall extends Enum { - readonly isSend: boolean; - readonly asSend: { - readonly dest: XcmVersionedMultiLocation; - readonly message: XcmVersionedXcm; - } & Struct; - readonly isTeleportAssets: boolean; - readonly asTeleportAssets: { - readonly dest: XcmVersionedMultiLocation; - readonly beneficiary: XcmVersionedMultiLocation; - readonly assets: XcmVersionedMultiAssets; - readonly feeAssetItem: u32; - } & Struct; - readonly isReserveTransferAssets: boolean; - readonly asReserveTransferAssets: { - readonly dest: XcmVersionedMultiLocation; - readonly beneficiary: XcmVersionedMultiLocation; - readonly assets: XcmVersionedMultiAssets; - readonly feeAssetItem: u32; + /** @name CumulusPalletXcmpQueueEvent (39) */ + interface CumulusPalletXcmpQueueEvent extends Enum { + readonly isSuccess: boolean; + readonly asSuccess: { + readonly messageHash: Option; + readonly weight: u64; } & Struct; - readonly isExecute: boolean; - readonly asExecute: { - readonly message: XcmVersionedXcm; - readonly maxWeight: u64; + readonly isFail: boolean; + readonly asFail: { + readonly messageHash: Option; + readonly error: XcmV2TraitsError; + readonly weight: u64; } & Struct; - readonly isForceXcmVersion: boolean; - readonly asForceXcmVersion: { - readonly location: XcmV1MultiLocation; - readonly xcmVersion: u32; + readonly isBadVersion: boolean; + readonly asBadVersion: { + readonly messageHash: Option; } & Struct; - readonly isForceDefaultXcmVersion: boolean; - readonly asForceDefaultXcmVersion: { - readonly maybeXcmVersion: Option; + readonly isBadFormat: boolean; + readonly asBadFormat: { + readonly messageHash: Option; } & Struct; - readonly isForceSubscribeVersionNotify: boolean; - readonly asForceSubscribeVersionNotify: { - readonly location: XcmVersionedMultiLocation; + readonly isUpwardMessageSent: boolean; + readonly asUpwardMessageSent: { + readonly messageHash: Option; } & Struct; - readonly isForceUnsubscribeVersionNotify: boolean; - readonly asForceUnsubscribeVersionNotify: { - readonly location: XcmVersionedMultiLocation; + readonly isXcmpMessageSent: boolean; + readonly asXcmpMessageSent: { + readonly messageHash: Option; } & Struct; - readonly isLimitedReserveTransferAssets: boolean; - readonly asLimitedReserveTransferAssets: { - readonly dest: XcmVersionedMultiLocation; - readonly beneficiary: XcmVersionedMultiLocation; - readonly assets: XcmVersionedMultiAssets; - readonly feeAssetItem: u32; - readonly weightLimit: XcmV2WeightLimit; + readonly isOverweightEnqueued: boolean; + readonly asOverweightEnqueued: { + readonly sender: u32; + readonly sentAt: u32; + readonly index: u64; + readonly required: u64; } & Struct; - readonly isLimitedTeleportAssets: boolean; - readonly asLimitedTeleportAssets: { - readonly dest: XcmVersionedMultiLocation; - readonly beneficiary: XcmVersionedMultiLocation; - readonly assets: XcmVersionedMultiAssets; - readonly feeAssetItem: u32; - readonly weightLimit: XcmV2WeightLimit; + readonly isOverweightServiced: boolean; + readonly asOverweightServiced: { + readonly index: u64; + readonly used: u64; } & Struct; - readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets'; + readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name XcmVersionedMultiLocation (88) */ - export interface XcmVersionedMultiLocation extends Enum { - readonly isV0: boolean; - readonly asV0: XcmV0MultiLocation; - readonly isV1: boolean; - readonly asV1: XcmV1MultiLocation; - readonly type: 'V0' | 'V1'; + /** @name XcmV2TraitsError (41) */ + interface XcmV2TraitsError extends Enum { + readonly isOverflow: boolean; + readonly isUnimplemented: boolean; + readonly isUntrustedReserveLocation: boolean; + readonly isUntrustedTeleportLocation: boolean; + readonly isMultiLocationFull: boolean; + readonly isMultiLocationNotInvertible: boolean; + readonly isBadOrigin: boolean; + readonly isInvalidLocation: boolean; + readonly isAssetNotFound: boolean; + readonly isFailedToTransactAsset: boolean; + readonly isNotWithdrawable: boolean; + readonly isLocationCannotHold: boolean; + readonly isExceedsMaxMessageSize: boolean; + readonly isDestinationUnsupported: boolean; + readonly isTransport: boolean; + readonly isUnroutable: boolean; + readonly isUnknownClaim: boolean; + readonly isFailedToDecode: boolean; + readonly isMaxWeightInvalid: boolean; + readonly isNotHoldingFees: boolean; + readonly isTooExpensive: boolean; + readonly isTrap: boolean; + readonly asTrap: u64; + readonly isUnhandledXcmVersion: boolean; + readonly isWeightLimitReached: boolean; + readonly asWeightLimitReached: u64; + readonly isBarrier: boolean; + readonly isWeightNotComputable: boolean; + readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable'; } - /** @name XcmV0MultiLocation (89) */ - export interface XcmV0MultiLocation extends Enum { - readonly isNull: boolean; - readonly isX1: boolean; - readonly asX1: XcmV0Junction; - readonly isX2: boolean; - readonly asX2: ITuple<[XcmV0Junction, XcmV0Junction]>; + /** @name PalletXcmEvent (43) */ + interface PalletXcmEvent extends Enum { + readonly isAttempted: boolean; + readonly asAttempted: XcmV2TraitsOutcome; + readonly isSent: boolean; + readonly asSent: ITuple<[XcmV1MultiLocation, XcmV1MultiLocation, XcmV2Xcm]>; + readonly isUnexpectedResponse: boolean; + readonly asUnexpectedResponse: ITuple<[XcmV1MultiLocation, u64]>; + readonly isResponseReady: boolean; + readonly asResponseReady: ITuple<[u64, XcmV2Response]>; + readonly isNotified: boolean; + readonly asNotified: ITuple<[u64, u8, u8]>; + readonly isNotifyOverweight: boolean; + readonly asNotifyOverweight: ITuple<[u64, u8, u8, u64, u64]>; + readonly isNotifyDispatchError: boolean; + readonly asNotifyDispatchError: ITuple<[u64, u8, u8]>; + readonly isNotifyDecodeFailed: boolean; + readonly asNotifyDecodeFailed: ITuple<[u64, u8, u8]>; + readonly isInvalidResponder: boolean; + readonly asInvalidResponder: ITuple<[XcmV1MultiLocation, u64, Option]>; + readonly isInvalidResponderVersion: boolean; + readonly asInvalidResponderVersion: ITuple<[XcmV1MultiLocation, u64]>; + readonly isResponseTaken: boolean; + readonly asResponseTaken: u64; + readonly isAssetsTrapped: boolean; + readonly asAssetsTrapped: ITuple<[H256, XcmV1MultiLocation, XcmVersionedMultiAssets]>; + readonly isVersionChangeNotified: boolean; + readonly asVersionChangeNotified: ITuple<[XcmV1MultiLocation, u32]>; + readonly isSupportedVersionChanged: boolean; + readonly asSupportedVersionChanged: ITuple<[XcmV1MultiLocation, u32]>; + readonly isNotifyTargetSendFail: boolean; + readonly asNotifyTargetSendFail: ITuple<[XcmV1MultiLocation, u64, XcmV2TraitsError]>; + readonly isNotifyTargetMigrationFail: boolean; + readonly asNotifyTargetMigrationFail: ITuple<[XcmVersionedMultiLocation, u64]>; + readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail'; + } + + /** @name XcmV2TraitsOutcome (44) */ + interface XcmV2TraitsOutcome extends Enum { + readonly isComplete: boolean; + readonly asComplete: u64; + readonly isIncomplete: boolean; + readonly asIncomplete: ITuple<[u64, XcmV2TraitsError]>; + readonly isError: boolean; + readonly asError: XcmV2TraitsError; + readonly type: 'Complete' | 'Incomplete' | 'Error'; + } + + /** @name XcmV1MultiLocation (45) */ + interface XcmV1MultiLocation extends Struct { + readonly parents: u8; + readonly interior: XcmV1MultilocationJunctions; + } + + /** @name XcmV1MultilocationJunctions (46) */ + interface XcmV1MultilocationJunctions extends Enum { + readonly isHere: boolean; + readonly isX1: boolean; + readonly asX1: XcmV1Junction; + readonly isX2: boolean; + readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>; readonly isX3: boolean; - readonly asX3: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>; readonly isX4: boolean; - readonly asX4: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; readonly isX5: boolean; - readonly asX5: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; readonly isX6: boolean; - readonly asX6: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; readonly isX7: boolean; - readonly asX7: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; readonly isX8: boolean; - readonly asX8: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; - readonly type: 'Null' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; + readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; } - /** @name XcmV0Junction (90) */ - export interface XcmV0Junction extends Enum { - readonly isParent: boolean; + /** @name XcmV1Junction (47) */ + interface XcmV1Junction extends Enum { readonly isParachain: boolean; readonly asParachain: Compact; readonly isAccountId32: boolean; @@ -641,11 +535,11 @@ declare module '@polkadot/types/lookup' { readonly id: XcmV0JunctionBodyId; readonly part: XcmV0JunctionBodyPart; } & Struct; - readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; + readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; } - /** @name XcmV0JunctionNetworkId (91) */ - export interface XcmV0JunctionNetworkId extends Enum { + /** @name XcmV0JunctionNetworkId (49) */ + interface XcmV0JunctionNetworkId extends Enum { readonly isAny: boolean; readonly isNamed: boolean; readonly asNamed: Bytes; @@ -654,8 +548,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama'; } - /** @name XcmV0JunctionBodyId (92) */ - export interface XcmV0JunctionBodyId extends Enum { + /** @name XcmV0JunctionBodyId (53) */ + interface XcmV0JunctionBodyId extends Enum { readonly isUnit: boolean; readonly isNamed: boolean; readonly asNamed: Bytes; @@ -668,8 +562,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial'; } - /** @name XcmV0JunctionBodyPart (93) */ - export interface XcmV0JunctionBodyPart extends Enum { + /** @name XcmV0JunctionBodyPart (54) */ + interface XcmV0JunctionBodyPart extends Enum { readonly isVoice: boolean; readonly isMembers: boolean; readonly asMembers: { @@ -693,116 +587,38 @@ declare module '@polkadot/types/lookup' { readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion'; } - /** @name XcmV1MultiLocation (94) */ - export interface XcmV1MultiLocation extends Struct { - readonly parents: u8; - readonly interior: XcmV1MultilocationJunctions; - } - - /** @name XcmV1MultilocationJunctions (95) */ - export interface XcmV1MultilocationJunctions extends Enum { - readonly isHere: boolean; - readonly isX1: boolean; - readonly asX1: XcmV1Junction; - readonly isX2: boolean; - readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>; - readonly isX3: boolean; - readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly isX4: boolean; - readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly isX5: boolean; - readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly isX6: boolean; - readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly isX7: boolean; - readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly isX8: boolean; - readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; - } - - /** @name XcmV1Junction (96) */ - export interface XcmV1Junction extends Enum { - readonly isParachain: boolean; - readonly asParachain: Compact; - readonly isAccountId32: boolean; - readonly asAccountId32: { - readonly network: XcmV0JunctionNetworkId; - readonly id: U8aFixed; - } & Struct; - readonly isAccountIndex64: boolean; - readonly asAccountIndex64: { - readonly network: XcmV0JunctionNetworkId; - readonly index: Compact; - } & Struct; - readonly isAccountKey20: boolean; - readonly asAccountKey20: { - readonly network: XcmV0JunctionNetworkId; - readonly key: U8aFixed; - } & Struct; - readonly isPalletInstance: boolean; - readonly asPalletInstance: u8; - readonly isGeneralIndex: boolean; - readonly asGeneralIndex: Compact; - readonly isGeneralKey: boolean; - readonly asGeneralKey: Bytes; - readonly isOnlyChild: boolean; - readonly isPlurality: boolean; - readonly asPlurality: { - readonly id: XcmV0JunctionBodyId; - readonly part: XcmV0JunctionBodyPart; - } & Struct; - readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; - } - - /** @name XcmVersionedXcm (97) */ - export interface XcmVersionedXcm extends Enum { - readonly isV0: boolean; - readonly asV0: XcmV0Xcm; - readonly isV1: boolean; - readonly asV1: XcmV1Xcm; - readonly isV2: boolean; - readonly asV2: XcmV2Xcm; - readonly type: 'V0' | 'V1' | 'V2'; - } + /** @name XcmV2Xcm (55) */ + interface XcmV2Xcm extends Vec {} - /** @name XcmV0Xcm (98) */ - export interface XcmV0Xcm extends Enum { + /** @name XcmV2Instruction (57) */ + interface XcmV2Instruction extends Enum { readonly isWithdrawAsset: boolean; - readonly asWithdrawAsset: { - readonly assets: Vec; - readonly effects: Vec; - } & Struct; - readonly isReserveAssetDeposit: boolean; - readonly asReserveAssetDeposit: { - readonly assets: Vec; - readonly effects: Vec; - } & Struct; - readonly isTeleportAsset: boolean; - readonly asTeleportAsset: { - readonly assets: Vec; - readonly effects: Vec; - } & Struct; + readonly asWithdrawAsset: XcmV1MultiassetMultiAssets; + readonly isReserveAssetDeposited: boolean; + readonly asReserveAssetDeposited: XcmV1MultiassetMultiAssets; + readonly isReceiveTeleportedAsset: boolean; + readonly asReceiveTeleportedAsset: XcmV1MultiassetMultiAssets; readonly isQueryResponse: boolean; readonly asQueryResponse: { readonly queryId: Compact; - readonly response: XcmV0Response; + readonly response: XcmV2Response; + readonly maxWeight: Compact; } & Struct; readonly isTransferAsset: boolean; readonly asTransferAsset: { - readonly assets: Vec; - readonly dest: XcmV0MultiLocation; + readonly assets: XcmV1MultiassetMultiAssets; + readonly beneficiary: XcmV1MultiLocation; } & Struct; readonly isTransferReserveAsset: boolean; readonly asTransferReserveAsset: { - readonly assets: Vec; - readonly dest: XcmV0MultiLocation; - readonly effects: Vec; + readonly assets: XcmV1MultiassetMultiAssets; + readonly dest: XcmV1MultiLocation; + readonly xcm: XcmV2Xcm; } & Struct; readonly isTransact: boolean; readonly asTransact: { readonly originType: XcmV0OriginKind; - readonly requireWeightAtMost: u64; + readonly requireWeightAtMost: Compact; readonly call: XcmDoubleEncoded; } & Struct; readonly isHrmpNewChannelOpenRequest: boolean; @@ -821,226 +637,90 @@ declare module '@polkadot/types/lookup' { readonly sender: Compact; readonly recipient: Compact; } & Struct; - readonly isRelayedFrom: boolean; - readonly asRelayedFrom: { - readonly who: XcmV0MultiLocation; - readonly message: XcmV0Xcm; - } & Struct; - readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom'; - } - - /** @name XcmV0MultiAsset (100) */ - export interface XcmV0MultiAsset extends Enum { - readonly isNone: boolean; - readonly isAll: boolean; - readonly isAllFungible: boolean; - readonly isAllNonFungible: boolean; - readonly isAllAbstractFungible: boolean; - readonly asAllAbstractFungible: { - readonly id: Bytes; - } & Struct; - readonly isAllAbstractNonFungible: boolean; - readonly asAllAbstractNonFungible: { - readonly class: Bytes; - } & Struct; - readonly isAllConcreteFungible: boolean; - readonly asAllConcreteFungible: { - readonly id: XcmV0MultiLocation; - } & Struct; - readonly isAllConcreteNonFungible: boolean; - readonly asAllConcreteNonFungible: { - readonly class: XcmV0MultiLocation; - } & Struct; - readonly isAbstractFungible: boolean; - readonly asAbstractFungible: { - readonly id: Bytes; - readonly amount: Compact; - } & Struct; - readonly isAbstractNonFungible: boolean; - readonly asAbstractNonFungible: { - readonly class: Bytes; - readonly instance: XcmV1MultiassetAssetInstance; - } & Struct; - readonly isConcreteFungible: boolean; - readonly asConcreteFungible: { - readonly id: XcmV0MultiLocation; - readonly amount: Compact; - } & Struct; - readonly isConcreteNonFungible: boolean; - readonly asConcreteNonFungible: { - readonly class: XcmV0MultiLocation; - readonly instance: XcmV1MultiassetAssetInstance; + readonly isClearOrigin: boolean; + readonly isDescendOrigin: boolean; + readonly asDescendOrigin: XcmV1MultilocationJunctions; + readonly isReportError: boolean; + readonly asReportError: { + readonly queryId: Compact; + readonly dest: XcmV1MultiLocation; + readonly maxResponseWeight: Compact; } & Struct; - readonly type: 'None' | 'All' | 'AllFungible' | 'AllNonFungible' | 'AllAbstractFungible' | 'AllAbstractNonFungible' | 'AllConcreteFungible' | 'AllConcreteNonFungible' | 'AbstractFungible' | 'AbstractNonFungible' | 'ConcreteFungible' | 'ConcreteNonFungible'; - } - - /** @name XcmV1MultiassetAssetInstance (101) */ - export interface XcmV1MultiassetAssetInstance extends Enum { - readonly isUndefined: boolean; - readonly isIndex: boolean; - readonly asIndex: Compact; - readonly isArray4: boolean; - readonly asArray4: U8aFixed; - readonly isArray8: boolean; - readonly asArray8: U8aFixed; - readonly isArray16: boolean; - readonly asArray16: U8aFixed; - readonly isArray32: boolean; - readonly asArray32: U8aFixed; - readonly isBlob: boolean; - readonly asBlob: Bytes; - readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob'; - } - - /** @name XcmV0Order (104) */ - export interface XcmV0Order extends Enum { - readonly isNull: boolean; readonly isDepositAsset: boolean; readonly asDepositAsset: { - readonly assets: Vec; - readonly dest: XcmV0MultiLocation; + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly maxAssets: Compact; + readonly beneficiary: XcmV1MultiLocation; } & Struct; readonly isDepositReserveAsset: boolean; readonly asDepositReserveAsset: { - readonly assets: Vec; - readonly dest: XcmV0MultiLocation; - readonly effects: Vec; + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly maxAssets: Compact; + readonly dest: XcmV1MultiLocation; + readonly xcm: XcmV2Xcm; } & Struct; readonly isExchangeAsset: boolean; readonly asExchangeAsset: { - readonly give: Vec; - readonly receive: Vec; + readonly give: XcmV1MultiassetMultiAssetFilter; + readonly receive: XcmV1MultiassetMultiAssets; } & Struct; readonly isInitiateReserveWithdraw: boolean; readonly asInitiateReserveWithdraw: { - readonly assets: Vec; - readonly reserve: XcmV0MultiLocation; - readonly effects: Vec; + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly reserve: XcmV1MultiLocation; + readonly xcm: XcmV2Xcm; } & Struct; readonly isInitiateTeleport: boolean; readonly asInitiateTeleport: { - readonly assets: Vec; - readonly dest: XcmV0MultiLocation; - readonly effects: Vec; + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly dest: XcmV1MultiLocation; + readonly xcm: XcmV2Xcm; } & Struct; readonly isQueryHolding: boolean; readonly asQueryHolding: { readonly queryId: Compact; - readonly dest: XcmV0MultiLocation; - readonly assets: Vec; + readonly dest: XcmV1MultiLocation; + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly maxResponseWeight: Compact; } & Struct; readonly isBuyExecution: boolean; readonly asBuyExecution: { - readonly fees: XcmV0MultiAsset; - readonly weight: u64; - readonly debt: u64; - readonly haltOnError: bool; - readonly xcm: Vec; - } & Struct; - readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; - } - - /** @name XcmV0Response (106) */ - export interface XcmV0Response extends Enum { - readonly isAssets: boolean; - readonly asAssets: Vec; - readonly type: 'Assets'; - } - - /** @name XcmV0OriginKind (107) */ - export interface XcmV0OriginKind extends Enum { - readonly isNative: boolean; - readonly isSovereignAccount: boolean; - readonly isSuperuser: boolean; - readonly isXcm: boolean; - readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm'; - } - - /** @name XcmDoubleEncoded (108) */ - export interface XcmDoubleEncoded extends Struct { - readonly encoded: Bytes; - } - - /** @name XcmV1Xcm (109) */ - export interface XcmV1Xcm extends Enum { - readonly isWithdrawAsset: boolean; - readonly asWithdrawAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly effects: Vec; - } & Struct; - readonly isReserveAssetDeposited: boolean; - readonly asReserveAssetDeposited: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly effects: Vec; - } & Struct; - readonly isReceiveTeleportedAsset: boolean; - readonly asReceiveTeleportedAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly effects: Vec; - } & Struct; - readonly isQueryResponse: boolean; - readonly asQueryResponse: { - readonly queryId: Compact; - readonly response: XcmV1Response; - } & Struct; - readonly isTransferAsset: boolean; - readonly asTransferAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly beneficiary: XcmV1MultiLocation; + readonly fees: XcmV1MultiAsset; + readonly weightLimit: XcmV2WeightLimit; } & Struct; - readonly isTransferReserveAsset: boolean; - readonly asTransferReserveAsset: { + readonly isRefundSurplus: boolean; + readonly isSetErrorHandler: boolean; + readonly asSetErrorHandler: XcmV2Xcm; + readonly isSetAppendix: boolean; + readonly asSetAppendix: XcmV2Xcm; + readonly isClearError: boolean; + readonly isClaimAsset: boolean; + readonly asClaimAsset: { readonly assets: XcmV1MultiassetMultiAssets; - readonly dest: XcmV1MultiLocation; - readonly effects: Vec; - } & Struct; - readonly isTransact: boolean; - readonly asTransact: { - readonly originType: XcmV0OriginKind; - readonly requireWeightAtMost: u64; - readonly call: XcmDoubleEncoded; - } & Struct; - readonly isHrmpNewChannelOpenRequest: boolean; - readonly asHrmpNewChannelOpenRequest: { - readonly sender: Compact; - readonly maxMessageSize: Compact; - readonly maxCapacity: Compact; - } & Struct; - readonly isHrmpChannelAccepted: boolean; - readonly asHrmpChannelAccepted: { - readonly recipient: Compact; - } & Struct; - readonly isHrmpChannelClosing: boolean; - readonly asHrmpChannelClosing: { - readonly initiator: Compact; - readonly sender: Compact; - readonly recipient: Compact; - } & Struct; - readonly isRelayedFrom: boolean; - readonly asRelayedFrom: { - readonly who: XcmV1MultilocationJunctions; - readonly message: XcmV1Xcm; + readonly ticket: XcmV1MultiLocation; } & Struct; + readonly isTrap: boolean; + readonly asTrap: Compact; readonly isSubscribeVersion: boolean; readonly asSubscribeVersion: { readonly queryId: Compact; readonly maxResponseWeight: Compact; } & Struct; readonly isUnsubscribeVersion: boolean; - readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion'; + readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion'; } - /** @name XcmV1MultiassetMultiAssets (110) */ - export interface XcmV1MultiassetMultiAssets extends Vec {} + /** @name XcmV1MultiassetMultiAssets (58) */ + interface XcmV1MultiassetMultiAssets extends Vec {} - /** @name XcmV1MultiAsset (112) */ - export interface XcmV1MultiAsset extends Struct { + /** @name XcmV1MultiAsset (60) */ + interface XcmV1MultiAsset extends Struct { readonly id: XcmV1MultiassetAssetId; readonly fun: XcmV1MultiassetFungibility; } - /** @name XcmV1MultiassetAssetId (113) */ - export interface XcmV1MultiassetAssetId extends Enum { + /** @name XcmV1MultiassetAssetId (61) */ + interface XcmV1MultiassetAssetId extends Enum { readonly isConcrete: boolean; readonly asConcrete: XcmV1MultiLocation; readonly isAbstract: boolean; @@ -1048,8 +728,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Concrete' | 'Abstract'; } - /** @name XcmV1MultiassetFungibility (114) */ - export interface XcmV1MultiassetFungibility extends Enum { + /** @name XcmV1MultiassetFungibility (62) */ + interface XcmV1MultiassetFungibility extends Enum { readonly isFungible: boolean; readonly asFungible: Compact; readonly isNonFungible: boolean; @@ -1057,58 +737,52 @@ declare module '@polkadot/types/lookup' { readonly type: 'Fungible' | 'NonFungible'; } - /** @name XcmV1Order (116) */ - export interface XcmV1Order extends Enum { - readonly isNoop: boolean; - readonly isDepositAsset: boolean; - readonly asDepositAsset: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly maxAssets: u32; - readonly beneficiary: XcmV1MultiLocation; - } & Struct; - readonly isDepositReserveAsset: boolean; - readonly asDepositReserveAsset: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly maxAssets: u32; - readonly dest: XcmV1MultiLocation; - readonly effects: Vec; - } & Struct; - readonly isExchangeAsset: boolean; - readonly asExchangeAsset: { - readonly give: XcmV1MultiassetMultiAssetFilter; - readonly receive: XcmV1MultiassetMultiAssets; - } & Struct; - readonly isInitiateReserveWithdraw: boolean; - readonly asInitiateReserveWithdraw: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly reserve: XcmV1MultiLocation; - readonly effects: Vec; - } & Struct; - readonly isInitiateTeleport: boolean; - readonly asInitiateTeleport: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly dest: XcmV1MultiLocation; - readonly effects: Vec; - } & Struct; - readonly isQueryHolding: boolean; - readonly asQueryHolding: { - readonly queryId: Compact; - readonly dest: XcmV1MultiLocation; - readonly assets: XcmV1MultiassetMultiAssetFilter; - } & Struct; - readonly isBuyExecution: boolean; - readonly asBuyExecution: { - readonly fees: XcmV1MultiAsset; - readonly weight: u64; - readonly debt: u64; - readonly haltOnError: bool; - readonly instructions: Vec; - } & Struct; - readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; + /** @name XcmV1MultiassetAssetInstance (63) */ + interface XcmV1MultiassetAssetInstance extends Enum { + readonly isUndefined: boolean; + readonly isIndex: boolean; + readonly asIndex: Compact; + readonly isArray4: boolean; + readonly asArray4: U8aFixed; + readonly isArray8: boolean; + readonly asArray8: U8aFixed; + readonly isArray16: boolean; + readonly asArray16: U8aFixed; + readonly isArray32: boolean; + readonly asArray32: U8aFixed; + readonly isBlob: boolean; + readonly asBlob: Bytes; + readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob'; + } + + /** @name XcmV2Response (66) */ + interface XcmV2Response extends Enum { + readonly isNull: boolean; + readonly isAssets: boolean; + readonly asAssets: XcmV1MultiassetMultiAssets; + readonly isExecutionResult: boolean; + readonly asExecutionResult: Option>; + readonly isVersion: boolean; + readonly asVersion: u32; + readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version'; + } + + /** @name XcmV0OriginKind (69) */ + interface XcmV0OriginKind extends Enum { + readonly isNative: boolean; + readonly isSovereignAccount: boolean; + readonly isSuperuser: boolean; + readonly isXcm: boolean; + readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm'; + } + + /** @name XcmDoubleEncoded (70) */ + interface XcmDoubleEncoded extends Struct { + readonly encoded: Bytes; } - /** @name XcmV1MultiassetMultiAssetFilter (117) */ - export interface XcmV1MultiassetMultiAssetFilter extends Enum { + /** @name XcmV1MultiassetMultiAssetFilter (71) */ + interface XcmV1MultiassetMultiAssetFilter extends Enum { readonly isDefinite: boolean; readonly asDefinite: XcmV1MultiassetMultiAssets; readonly isWild: boolean; @@ -1116,8 +790,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Definite' | 'Wild'; } - /** @name XcmV1MultiassetWildMultiAsset (118) */ - export interface XcmV1MultiassetWildMultiAsset extends Enum { + /** @name XcmV1MultiassetWildMultiAsset (72) */ + interface XcmV1MultiassetWildMultiAsset extends Enum { readonly isAll: boolean; readonly isAllOf: boolean; readonly asAllOf: { @@ -1127,1636 +801,2012 @@ declare module '@polkadot/types/lookup' { readonly type: 'All' | 'AllOf'; } - /** @name XcmV1MultiassetWildFungibility (119) */ - export interface XcmV1MultiassetWildFungibility extends Enum { + /** @name XcmV1MultiassetWildFungibility (73) */ + interface XcmV1MultiassetWildFungibility extends Enum { readonly isFungible: boolean; readonly isNonFungible: boolean; readonly type: 'Fungible' | 'NonFungible'; } - /** @name XcmV1Response (121) */ - export interface XcmV1Response extends Enum { - readonly isAssets: boolean; - readonly asAssets: XcmV1MultiassetMultiAssets; - readonly isVersion: boolean; - readonly asVersion: u32; - readonly type: 'Assets' | 'Version'; + /** @name XcmV2WeightLimit (74) */ + interface XcmV2WeightLimit extends Enum { + readonly isUnlimited: boolean; + readonly isLimited: boolean; + readonly asLimited: Compact; + readonly type: 'Unlimited' | 'Limited'; } - /** @name XcmV2Xcm (122) */ - export interface XcmV2Xcm extends Vec {} + /** @name XcmVersionedMultiAssets (76) */ + interface XcmVersionedMultiAssets extends Enum { + readonly isV0: boolean; + readonly asV0: Vec; + readonly isV1: boolean; + readonly asV1: XcmV1MultiassetMultiAssets; + readonly type: 'V0' | 'V1'; + } - /** @name XcmV2Instruction (124) */ - export interface XcmV2Instruction extends Enum { - readonly isWithdrawAsset: boolean; - readonly asWithdrawAsset: XcmV1MultiassetMultiAssets; - readonly isReserveAssetDeposited: boolean; - readonly asReserveAssetDeposited: XcmV1MultiassetMultiAssets; - readonly isReceiveTeleportedAsset: boolean; - readonly asReceiveTeleportedAsset: XcmV1MultiassetMultiAssets; - readonly isQueryResponse: boolean; - readonly asQueryResponse: { - readonly queryId: Compact; - readonly response: XcmV2Response; - readonly maxWeight: Compact; - } & Struct; - readonly isTransferAsset: boolean; - readonly asTransferAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly beneficiary: XcmV1MultiLocation; + /** @name XcmV0MultiAsset (78) */ + interface XcmV0MultiAsset extends Enum { + readonly isNone: boolean; + readonly isAll: boolean; + readonly isAllFungible: boolean; + readonly isAllNonFungible: boolean; + readonly isAllAbstractFungible: boolean; + readonly asAllAbstractFungible: { + readonly id: Bytes; } & Struct; - readonly isTransferReserveAsset: boolean; - readonly asTransferReserveAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly dest: XcmV1MultiLocation; - readonly xcm: XcmV2Xcm; + readonly isAllAbstractNonFungible: boolean; + readonly asAllAbstractNonFungible: { + readonly class: Bytes; } & Struct; - readonly isTransact: boolean; - readonly asTransact: { - readonly originType: XcmV0OriginKind; - readonly requireWeightAtMost: Compact; - readonly call: XcmDoubleEncoded; + readonly isAllConcreteFungible: boolean; + readonly asAllConcreteFungible: { + readonly id: XcmV0MultiLocation; } & Struct; - readonly isHrmpNewChannelOpenRequest: boolean; - readonly asHrmpNewChannelOpenRequest: { - readonly sender: Compact; - readonly maxMessageSize: Compact; - readonly maxCapacity: Compact; + readonly isAllConcreteNonFungible: boolean; + readonly asAllConcreteNonFungible: { + readonly class: XcmV0MultiLocation; } & Struct; - readonly isHrmpChannelAccepted: boolean; - readonly asHrmpChannelAccepted: { - readonly recipient: Compact; - } & Struct; - readonly isHrmpChannelClosing: boolean; - readonly asHrmpChannelClosing: { - readonly initiator: Compact; - readonly sender: Compact; - readonly recipient: Compact; - } & Struct; - readonly isClearOrigin: boolean; - readonly isDescendOrigin: boolean; - readonly asDescendOrigin: XcmV1MultilocationJunctions; - readonly isReportError: boolean; - readonly asReportError: { - readonly queryId: Compact; - readonly dest: XcmV1MultiLocation; - readonly maxResponseWeight: Compact; - } & Struct; - readonly isDepositAsset: boolean; - readonly asDepositAsset: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly maxAssets: Compact; - readonly beneficiary: XcmV1MultiLocation; - } & Struct; - readonly isDepositReserveAsset: boolean; - readonly asDepositReserveAsset: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly maxAssets: Compact; - readonly dest: XcmV1MultiLocation; - readonly xcm: XcmV2Xcm; - } & Struct; - readonly isExchangeAsset: boolean; - readonly asExchangeAsset: { - readonly give: XcmV1MultiassetMultiAssetFilter; - readonly receive: XcmV1MultiassetMultiAssets; - } & Struct; - readonly isInitiateReserveWithdraw: boolean; - readonly asInitiateReserveWithdraw: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly reserve: XcmV1MultiLocation; - readonly xcm: XcmV2Xcm; - } & Struct; - readonly isInitiateTeleport: boolean; - readonly asInitiateTeleport: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly dest: XcmV1MultiLocation; - readonly xcm: XcmV2Xcm; - } & Struct; - readonly isQueryHolding: boolean; - readonly asQueryHolding: { - readonly queryId: Compact; - readonly dest: XcmV1MultiLocation; - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly maxResponseWeight: Compact; + readonly isAbstractFungible: boolean; + readonly asAbstractFungible: { + readonly id: Bytes; + readonly amount: Compact; } & Struct; - readonly isBuyExecution: boolean; - readonly asBuyExecution: { - readonly fees: XcmV1MultiAsset; - readonly weightLimit: XcmV2WeightLimit; + readonly isAbstractNonFungible: boolean; + readonly asAbstractNonFungible: { + readonly class: Bytes; + readonly instance: XcmV1MultiassetAssetInstance; } & Struct; - readonly isRefundSurplus: boolean; - readonly isSetErrorHandler: boolean; - readonly asSetErrorHandler: XcmV2Xcm; - readonly isSetAppendix: boolean; - readonly asSetAppendix: XcmV2Xcm; - readonly isClearError: boolean; - readonly isClaimAsset: boolean; - readonly asClaimAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly ticket: XcmV1MultiLocation; + readonly isConcreteFungible: boolean; + readonly asConcreteFungible: { + readonly id: XcmV0MultiLocation; + readonly amount: Compact; } & Struct; - readonly isTrap: boolean; - readonly asTrap: Compact; - readonly isSubscribeVersion: boolean; - readonly asSubscribeVersion: { - readonly queryId: Compact; - readonly maxResponseWeight: Compact; + readonly isConcreteNonFungible: boolean; + readonly asConcreteNonFungible: { + readonly class: XcmV0MultiLocation; + readonly instance: XcmV1MultiassetAssetInstance; } & Struct; - readonly isUnsubscribeVersion: boolean; - readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion'; + readonly type: 'None' | 'All' | 'AllFungible' | 'AllNonFungible' | 'AllAbstractFungible' | 'AllAbstractNonFungible' | 'AllConcreteFungible' | 'AllConcreteNonFungible' | 'AbstractFungible' | 'AbstractNonFungible' | 'ConcreteFungible' | 'ConcreteNonFungible'; } - /** @name XcmV2Response (125) */ - export interface XcmV2Response extends Enum { + /** @name XcmV0MultiLocation (79) */ + interface XcmV0MultiLocation extends Enum { readonly isNull: boolean; - readonly isAssets: boolean; - readonly asAssets: XcmV1MultiassetMultiAssets; - readonly isExecutionResult: boolean; - readonly asExecutionResult: Option>; - readonly isVersion: boolean; - readonly asVersion: u32; - readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version'; - } - - /** @name XcmV2TraitsError (128) */ - export interface XcmV2TraitsError extends Enum { - readonly isOverflow: boolean; - readonly isUnimplemented: boolean; - readonly isUntrustedReserveLocation: boolean; - readonly isUntrustedTeleportLocation: boolean; - readonly isMultiLocationFull: boolean; - readonly isMultiLocationNotInvertible: boolean; - readonly isBadOrigin: boolean; - readonly isInvalidLocation: boolean; - readonly isAssetNotFound: boolean; - readonly isFailedToTransactAsset: boolean; - readonly isNotWithdrawable: boolean; - readonly isLocationCannotHold: boolean; - readonly isExceedsMaxMessageSize: boolean; - readonly isDestinationUnsupported: boolean; - readonly isTransport: boolean; - readonly isUnroutable: boolean; - readonly isUnknownClaim: boolean; - readonly isFailedToDecode: boolean; - readonly isMaxWeightInvalid: boolean; - readonly isNotHoldingFees: boolean; - readonly isTooExpensive: boolean; - readonly isTrap: boolean; - readonly asTrap: u64; - readonly isUnhandledXcmVersion: boolean; - readonly isWeightLimitReached: boolean; - readonly asWeightLimitReached: u64; - readonly isBarrier: boolean; - readonly isWeightNotComputable: boolean; - readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable'; + readonly isX1: boolean; + readonly asX1: XcmV0Junction; + readonly isX2: boolean; + readonly asX2: ITuple<[XcmV0Junction, XcmV0Junction]>; + readonly isX3: boolean; + readonly asX3: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly isX4: boolean; + readonly asX4: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly isX5: boolean; + readonly asX5: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly isX6: boolean; + readonly asX6: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly isX7: boolean; + readonly asX7: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly isX8: boolean; + readonly asX8: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly type: 'Null' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; } - /** @name XcmV2WeightLimit (129) */ - export interface XcmV2WeightLimit extends Enum { - readonly isUnlimited: boolean; - readonly isLimited: boolean; - readonly asLimited: Compact; - readonly type: 'Unlimited' | 'Limited'; + /** @name XcmV0Junction (80) */ + interface XcmV0Junction extends Enum { + readonly isParent: boolean; + readonly isParachain: boolean; + readonly asParachain: Compact; + readonly isAccountId32: boolean; + readonly asAccountId32: { + readonly network: XcmV0JunctionNetworkId; + readonly id: U8aFixed; + } & Struct; + readonly isAccountIndex64: boolean; + readonly asAccountIndex64: { + readonly network: XcmV0JunctionNetworkId; + readonly index: Compact; + } & Struct; + readonly isAccountKey20: boolean; + readonly asAccountKey20: { + readonly network: XcmV0JunctionNetworkId; + readonly key: U8aFixed; + } & Struct; + readonly isPalletInstance: boolean; + readonly asPalletInstance: u8; + readonly isGeneralIndex: boolean; + readonly asGeneralIndex: Compact; + readonly isGeneralKey: boolean; + readonly asGeneralKey: Bytes; + readonly isOnlyChild: boolean; + readonly isPlurality: boolean; + readonly asPlurality: { + readonly id: XcmV0JunctionBodyId; + readonly part: XcmV0JunctionBodyPart; + } & Struct; + readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; } - /** @name XcmVersionedMultiAssets (130) */ - export interface XcmVersionedMultiAssets extends Enum { + /** @name XcmVersionedMultiLocation (81) */ + interface XcmVersionedMultiLocation extends Enum { readonly isV0: boolean; - readonly asV0: Vec; + readonly asV0: XcmV0MultiLocation; readonly isV1: boolean; - readonly asV1: XcmV1MultiassetMultiAssets; + readonly asV1: XcmV1MultiLocation; readonly type: 'V0' | 'V1'; } - /** @name CumulusPalletXcmCall (145) */ - export type CumulusPalletXcmCall = Null; - - /** @name CumulusPalletDmpQueueCall (146) */ - export interface CumulusPalletDmpQueueCall extends Enum { - readonly isServiceOverweight: boolean; - readonly asServiceOverweight: { - readonly index: u64; - readonly weightLimit: u64; - } & Struct; - readonly type: 'ServiceOverweight'; + /** @name CumulusPalletXcmEvent (82) */ + interface CumulusPalletXcmEvent extends Enum { + readonly isInvalidFormat: boolean; + readonly asInvalidFormat: U8aFixed; + readonly isUnsupportedVersion: boolean; + readonly asUnsupportedVersion: U8aFixed; + readonly isExecutedDownward: boolean; + readonly asExecutedDownward: ITuple<[U8aFixed, XcmV2TraitsOutcome]>; + readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; } - /** @name PalletInflationCall (147) */ - export interface PalletInflationCall extends Enum { - readonly isStartInflation: boolean; - readonly asStartInflation: { - readonly inflationStartRelayBlock: u32; + /** @name CumulusPalletDmpQueueEvent (83) */ + interface CumulusPalletDmpQueueEvent extends Enum { + readonly isInvalidFormat: boolean; + readonly asInvalidFormat: { + readonly messageId: U8aFixed; } & Struct; - readonly type: 'StartInflation'; - } - - /** @name PalletUniqueCall (148) */ - export interface PalletUniqueCall extends Enum { - readonly isCreateCollection: boolean; - readonly asCreateCollection: { - readonly collectionName: Vec; - readonly collectionDescription: Vec; - readonly tokenPrefix: Bytes; - readonly mode: UpDataStructsCollectionMode; + readonly isUnsupportedVersion: boolean; + readonly asUnsupportedVersion: { + readonly messageId: U8aFixed; } & Struct; - readonly isCreateCollectionEx: boolean; - readonly asCreateCollectionEx: { - readonly data: UpDataStructsCreateCollectionData; + readonly isExecutedDownward: boolean; + readonly asExecutedDownward: { + readonly messageId: U8aFixed; + readonly outcome: XcmV2TraitsOutcome; } & Struct; - readonly isDestroyCollection: boolean; - readonly asDestroyCollection: { - readonly collectionId: u32; + readonly isWeightExhausted: boolean; + readonly asWeightExhausted: { + readonly messageId: U8aFixed; + readonly remainingWeight: u64; + readonly requiredWeight: u64; } & Struct; - readonly isAddToAllowList: boolean; - readonly asAddToAllowList: { - readonly collectionId: u32; - readonly address: PalletEvmAccountBasicCrossAccountIdRepr; + readonly isOverweightEnqueued: boolean; + readonly asOverweightEnqueued: { + readonly messageId: U8aFixed; + readonly overweightIndex: u64; + readonly requiredWeight: u64; } & Struct; - readonly isRemoveFromAllowList: boolean; - readonly asRemoveFromAllowList: { - readonly collectionId: u32; - readonly address: PalletEvmAccountBasicCrossAccountIdRepr; + readonly isOverweightServiced: boolean; + readonly asOverweightServiced: { + readonly overweightIndex: u64; + readonly weightUsed: u64; } & Struct; - readonly isChangeCollectionOwner: boolean; - readonly asChangeCollectionOwner: { - readonly collectionId: u32; - readonly newOwner: AccountId32; - } & Struct; - readonly isAddCollectionAdmin: boolean; - readonly asAddCollectionAdmin: { - readonly collectionId: u32; - readonly newAdmin: PalletEvmAccountBasicCrossAccountIdRepr; - } & Struct; - readonly isRemoveCollectionAdmin: boolean; - readonly asRemoveCollectionAdmin: { - readonly collectionId: u32; - readonly accountId: PalletEvmAccountBasicCrossAccountIdRepr; - } & Struct; - readonly isSetCollectionSponsor: boolean; - readonly asSetCollectionSponsor: { - readonly collectionId: u32; - readonly newSponsor: AccountId32; - } & Struct; - readonly isConfirmSponsorship: boolean; - readonly asConfirmSponsorship: { - readonly collectionId: u32; + readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced'; + } + + /** @name PalletUniqueRawEvent (84) */ + interface PalletUniqueRawEvent extends Enum { + readonly isCollectionSponsorRemoved: boolean; + readonly asCollectionSponsorRemoved: u32; + readonly isCollectionAdminAdded: boolean; + readonly asCollectionAdminAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; + readonly isCollectionOwnedChanged: boolean; + readonly asCollectionOwnedChanged: ITuple<[u32, AccountId32]>; + readonly isCollectionSponsorSet: boolean; + readonly asCollectionSponsorSet: ITuple<[u32, AccountId32]>; + readonly isSponsorshipConfirmed: boolean; + readonly asSponsorshipConfirmed: ITuple<[u32, AccountId32]>; + readonly isCollectionAdminRemoved: boolean; + readonly asCollectionAdminRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; + readonly isAllowListAddressRemoved: boolean; + readonly asAllowListAddressRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; + readonly isAllowListAddressAdded: boolean; + readonly asAllowListAddressAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; + readonly isCollectionLimitSet: boolean; + readonly asCollectionLimitSet: u32; + readonly isCollectionPermissionSet: boolean; + readonly asCollectionPermissionSet: u32; + readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet'; + } + + /** @name PalletEvmAccountBasicCrossAccountIdRepr (85) */ + interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { + readonly isSubstrate: boolean; + readonly asSubstrate: AccountId32; + readonly isEthereum: boolean; + readonly asEthereum: H160; + readonly type: 'Substrate' | 'Ethereum'; + } + + /** @name PalletUniqueSchedulerEvent (88) */ + interface PalletUniqueSchedulerEvent extends Enum { + readonly isScheduled: boolean; + readonly asScheduled: { + readonly when: u32; + readonly index: u32; } & Struct; - readonly isRemoveCollectionSponsor: boolean; - readonly asRemoveCollectionSponsor: { - readonly collectionId: u32; + readonly isCanceled: boolean; + readonly asCanceled: { + readonly when: u32; + readonly index: u32; } & Struct; - readonly isCreateItem: boolean; - readonly asCreateItem: { - readonly collectionId: u32; - readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; - readonly data: UpDataStructsCreateItemData; + readonly isDispatched: boolean; + readonly asDispatched: { + readonly task: ITuple<[u32, u32]>; + readonly id: Option; + readonly result: Result; } & Struct; - readonly isCreateMultipleItems: boolean; - readonly asCreateMultipleItems: { - readonly collectionId: u32; - readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; - readonly itemsData: Vec; + readonly isCallLookupFailed: boolean; + readonly asCallLookupFailed: { + readonly task: ITuple<[u32, u32]>; + readonly id: Option; + readonly error: FrameSupportScheduleLookupError; } & Struct; - readonly isSetCollectionProperties: boolean; - readonly asSetCollectionProperties: { + readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; + } + + /** @name FrameSupportScheduleLookupError (91) */ + interface FrameSupportScheduleLookupError extends Enum { + readonly isUnknown: boolean; + readonly isBadFormat: boolean; + readonly type: 'Unknown' | 'BadFormat'; + } + + /** @name PalletCommonEvent (92) */ + interface PalletCommonEvent extends Enum { + readonly isCollectionCreated: boolean; + readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; + readonly isCollectionDestroyed: boolean; + readonly asCollectionDestroyed: u32; + readonly isItemCreated: boolean; + readonly asItemCreated: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; + readonly isItemDestroyed: boolean; + readonly asItemDestroyed: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; + readonly isTransfer: boolean; + readonly asTransfer: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; + readonly isApproved: boolean; + readonly asApproved: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; + readonly isCollectionPropertySet: boolean; + readonly asCollectionPropertySet: ITuple<[u32, Bytes]>; + readonly isCollectionPropertyDeleted: boolean; + readonly asCollectionPropertyDeleted: ITuple<[u32, Bytes]>; + readonly isTokenPropertySet: boolean; + readonly asTokenPropertySet: ITuple<[u32, u32, Bytes]>; + readonly isTokenPropertyDeleted: boolean; + readonly asTokenPropertyDeleted: ITuple<[u32, u32, Bytes]>; + readonly isPropertyPermissionSet: boolean; + readonly asPropertyPermissionSet: ITuple<[u32, Bytes]>; + readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; + } + + /** @name PalletStructureEvent (95) */ + interface PalletStructureEvent extends Enum { + readonly isExecuted: boolean; + readonly asExecuted: Result; + readonly type: 'Executed'; + } + + /** @name PalletRmrkCoreEvent (96) */ + interface PalletRmrkCoreEvent extends Enum { + readonly isCollectionCreated: boolean; + readonly asCollectionCreated: { + readonly issuer: AccountId32; readonly collectionId: u32; - readonly properties: Vec; } & Struct; - readonly isDeleteCollectionProperties: boolean; - readonly asDeleteCollectionProperties: { + readonly isCollectionDestroyed: boolean; + readonly asCollectionDestroyed: { + readonly issuer: AccountId32; readonly collectionId: u32; - readonly propertyKeys: Vec; } & Struct; - readonly isSetTokenProperties: boolean; - readonly asSetTokenProperties: { + readonly isIssuerChanged: boolean; + readonly asIssuerChanged: { + readonly oldIssuer: AccountId32; + readonly newIssuer: AccountId32; readonly collectionId: u32; - readonly tokenId: u32; - readonly properties: Vec; } & Struct; - readonly isDeleteTokenProperties: boolean; - readonly asDeleteTokenProperties: { + readonly isCollectionLocked: boolean; + readonly asCollectionLocked: { + readonly issuer: AccountId32; readonly collectionId: u32; - readonly tokenId: u32; - readonly propertyKeys: Vec; } & Struct; - readonly isSetTokenPropertyPermissions: boolean; - readonly asSetTokenPropertyPermissions: { + readonly isNftMinted: boolean; + readonly asNftMinted: { + readonly owner: AccountId32; readonly collectionId: u32; - readonly propertyPermissions: Vec; + readonly nftId: u32; } & Struct; - readonly isCreateMultipleItemsEx: boolean; - readonly asCreateMultipleItemsEx: { - readonly collectionId: u32; - readonly data: UpDataStructsCreateItemExData; + readonly isNftBurned: boolean; + readonly asNftBurned: { + readonly owner: AccountId32; + readonly nftId: u32; } & Struct; - readonly isSetTransfersEnabledFlag: boolean; - readonly asSetTransfersEnabledFlag: { + readonly isNftSent: boolean; + readonly asNftSent: { + readonly sender: AccountId32; + readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly collectionId: u32; - readonly value: bool; + readonly nftId: u32; + readonly approvalRequired: bool; } & Struct; - readonly isBurnItem: boolean; - readonly asBurnItem: { + readonly isNftAccepted: boolean; + readonly asNftAccepted: { + readonly sender: AccountId32; + readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly collectionId: u32; - readonly itemId: u32; - readonly value: u128; + readonly nftId: u32; } & Struct; - readonly isBurnFrom: boolean; - readonly asBurnFrom: { + readonly isNftRejected: boolean; + readonly asNftRejected: { + readonly sender: AccountId32; readonly collectionId: u32; - readonly from: PalletEvmAccountBasicCrossAccountIdRepr; - readonly itemId: u32; - readonly value: u128; + readonly nftId: u32; } & Struct; - readonly isTransfer: boolean; - readonly asTransfer: { - readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr; + readonly isPropertySet: boolean; + readonly asPropertySet: { readonly collectionId: u32; - readonly itemId: u32; - readonly value: u128; + readonly maybeNftId: Option; + readonly key: Bytes; + readonly value: Bytes; } & Struct; - readonly isApprove: boolean; - readonly asApprove: { - readonly spender: PalletEvmAccountBasicCrossAccountIdRepr; - readonly collectionId: u32; - readonly itemId: u32; - readonly amount: u128; + readonly isResourceAdded: boolean; + readonly asResourceAdded: { + readonly nftId: u32; + readonly resourceId: u32; } & Struct; - readonly isTransferFrom: boolean; - readonly asTransferFrom: { - readonly from: PalletEvmAccountBasicCrossAccountIdRepr; - readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr; - readonly collectionId: u32; - readonly itemId: u32; - readonly value: u128; + readonly isResourceRemoval: boolean; + readonly asResourceRemoval: { + readonly nftId: u32; + readonly resourceId: u32; } & Struct; - readonly isSetCollectionLimits: boolean; - readonly asSetCollectionLimits: { - readonly collectionId: u32; - readonly newLimit: UpDataStructsCollectionLimits; + readonly isResourceAccepted: boolean; + readonly asResourceAccepted: { + readonly nftId: u32; + readonly resourceId: u32; } & Struct; - readonly isSetCollectionPermissions: boolean; - readonly asSetCollectionPermissions: { - readonly collectionId: u32; - readonly newPermission: UpDataStructsCollectionPermissions; + readonly isResourceRemovalAccepted: boolean; + readonly asResourceRemovalAccepted: { + readonly nftId: u32; + readonly resourceId: u32; } & Struct; - readonly isRepartition: boolean; - readonly asRepartition: { + readonly isPrioritySet: boolean; + readonly asPrioritySet: { readonly collectionId: u32; - readonly tokenId: u32; - readonly amount: u128; + readonly nftId: u32; } & Struct; - readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; + readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; } - /** @name UpDataStructsCollectionMode (154) */ - export interface UpDataStructsCollectionMode extends Enum { - readonly isNft: boolean; - readonly isFungible: boolean; - readonly asFungible: u8; - readonly isReFungible: boolean; - readonly type: 'Nft' | 'Fungible' | 'ReFungible'; + /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (97) */ + interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { + readonly isAccountId: boolean; + readonly asAccountId: AccountId32; + readonly isCollectionAndNftTuple: boolean; + readonly asCollectionAndNftTuple: ITuple<[u32, u32]>; + readonly type: 'AccountId' | 'CollectionAndNftTuple'; } - /** @name UpDataStructsCreateCollectionData (155) */ - export interface UpDataStructsCreateCollectionData extends Struct { - readonly mode: UpDataStructsCollectionMode; - readonly access: Option; - readonly name: Vec; - readonly description: Vec; - readonly tokenPrefix: Bytes; - readonly pendingSponsor: Option; - readonly limits: Option; - readonly permissions: Option; - readonly tokenPropertyPermissions: Vec; - readonly properties: Vec; + /** @name PalletRmrkEquipEvent (102) */ + interface PalletRmrkEquipEvent extends Enum { + readonly isBaseCreated: boolean; + readonly asBaseCreated: { + readonly issuer: AccountId32; + readonly baseId: u32; + } & Struct; + readonly isEquippablesUpdated: boolean; + readonly asEquippablesUpdated: { + readonly baseId: u32; + readonly slotId: u32; + } & Struct; + readonly type: 'BaseCreated' | 'EquippablesUpdated'; } - /** @name UpDataStructsAccessMode (157) */ - export interface UpDataStructsAccessMode extends Enum { - readonly isNormal: boolean; - readonly isAllowList: boolean; - readonly type: 'Normal' | 'AllowList'; + /** @name PalletEvmEvent (103) */ + interface PalletEvmEvent extends Enum { + readonly isLog: boolean; + readonly asLog: EthereumLog; + readonly isCreated: boolean; + readonly asCreated: H160; + readonly isCreatedFailed: boolean; + readonly asCreatedFailed: H160; + readonly isExecuted: boolean; + readonly asExecuted: H160; + readonly isExecutedFailed: boolean; + readonly asExecutedFailed: H160; + readonly isBalanceDeposit: boolean; + readonly asBalanceDeposit: ITuple<[AccountId32, H160, U256]>; + readonly isBalanceWithdraw: boolean; + readonly asBalanceWithdraw: ITuple<[AccountId32, H160, U256]>; + readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; } - /** @name UpDataStructsCollectionLimits (160) */ - export interface UpDataStructsCollectionLimits extends Struct { - readonly accountTokenOwnershipLimit: Option; - readonly sponsoredDataSize: Option; - readonly sponsoredDataRateLimit: Option; - readonly tokenLimit: Option; - readonly sponsorTransferTimeout: Option; - readonly sponsorApproveTimeout: Option; - readonly ownerCanTransfer: Option; - readonly ownerCanDestroy: Option; - readonly transfersEnabled: Option; + /** @name EthereumLog (104) */ + interface EthereumLog extends Struct { + readonly address: H160; + readonly topics: Vec; + readonly data: Bytes; } - /** @name UpDataStructsSponsoringRateLimit (162) */ - export interface UpDataStructsSponsoringRateLimit extends Enum { - readonly isSponsoringDisabled: boolean; - readonly isBlocks: boolean; - readonly asBlocks: u32; - readonly type: 'SponsoringDisabled' | 'Blocks'; + /** @name PalletEthereumEvent (108) */ + interface PalletEthereumEvent extends Enum { + readonly isExecuted: boolean; + readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; + readonly type: 'Executed'; } - /** @name UpDataStructsCollectionPermissions (165) */ - export interface UpDataStructsCollectionPermissions extends Struct { - readonly access: Option; - readonly mintMode: Option; - readonly nesting: Option; + /** @name EvmCoreErrorExitReason (109) */ + interface EvmCoreErrorExitReason extends Enum { + readonly isSucceed: boolean; + readonly asSucceed: EvmCoreErrorExitSucceed; + readonly isError: boolean; + readonly asError: EvmCoreErrorExitError; + readonly isRevert: boolean; + readonly asRevert: EvmCoreErrorExitRevert; + readonly isFatal: boolean; + readonly asFatal: EvmCoreErrorExitFatal; + readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; } - /** @name UpDataStructsNestingPermissions (167) */ - export interface UpDataStructsNestingPermissions extends Struct { - readonly tokenOwner: bool; - readonly collectionAdmin: bool; - readonly restricted: Option; + /** @name EvmCoreErrorExitSucceed (110) */ + interface EvmCoreErrorExitSucceed extends Enum { + readonly isStopped: boolean; + readonly isReturned: boolean; + readonly isSuicided: boolean; + readonly type: 'Stopped' | 'Returned' | 'Suicided'; } - /** @name UpDataStructsOwnerRestrictedSet (169) */ - export interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} + /** @name EvmCoreErrorExitError (111) */ + interface EvmCoreErrorExitError extends Enum { + readonly isStackUnderflow: boolean; + readonly isStackOverflow: boolean; + readonly isInvalidJump: boolean; + readonly isInvalidRange: boolean; + readonly isDesignatedInvalid: boolean; + readonly isCallTooDeep: boolean; + readonly isCreateCollision: boolean; + readonly isCreateContractLimit: boolean; + readonly isOutOfOffset: boolean; + readonly isOutOfGas: boolean; + readonly isOutOfFund: boolean; + readonly isPcUnderflow: boolean; + readonly isCreateEmpty: boolean; + readonly isOther: boolean; + readonly asOther: Text; + readonly isInvalidCode: boolean; + readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; + } - /** @name UpDataStructsPropertyKeyPermission (175) */ - export interface UpDataStructsPropertyKeyPermission extends Struct { - readonly key: Bytes; - readonly permission: UpDataStructsPropertyPermission; + /** @name EvmCoreErrorExitRevert (114) */ + interface EvmCoreErrorExitRevert extends Enum { + readonly isReverted: boolean; + readonly type: 'Reverted'; } - /** @name UpDataStructsPropertyPermission (177) */ - export interface UpDataStructsPropertyPermission extends Struct { - readonly mutable: bool; - readonly collectionAdmin: bool; - readonly tokenOwner: bool; + /** @name EvmCoreErrorExitFatal (115) */ + interface EvmCoreErrorExitFatal extends Enum { + readonly isNotSupported: boolean; + readonly isUnhandledInterrupt: boolean; + readonly isCallErrorAsFatal: boolean; + readonly asCallErrorAsFatal: EvmCoreErrorExitError; + readonly isOther: boolean; + readonly asOther: Text; + readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; } - /** @name UpDataStructsProperty (180) */ - export interface UpDataStructsProperty extends Struct { - readonly key: Bytes; - readonly value: Bytes; + /** @name FrameSystemPhase (116) */ + interface FrameSystemPhase extends Enum { + readonly isApplyExtrinsic: boolean; + readonly asApplyExtrinsic: u32; + readonly isFinalization: boolean; + readonly isInitialization: boolean; + readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } - /** @name PalletEvmAccountBasicCrossAccountIdRepr (183) */ - export interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { - readonly isSubstrate: boolean; - readonly asSubstrate: AccountId32; - readonly isEthereum: boolean; - readonly asEthereum: H160; - readonly type: 'Substrate' | 'Ethereum'; + /** @name FrameSystemLastRuntimeUpgradeInfo (118) */ + interface FrameSystemLastRuntimeUpgradeInfo extends Struct { + readonly specVersion: Compact; + readonly specName: Text; } - /** @name UpDataStructsCreateItemData (185) */ - export interface UpDataStructsCreateItemData extends Enum { - readonly isNft: boolean; - readonly asNft: UpDataStructsCreateNftData; - readonly isFungible: boolean; - readonly asFungible: UpDataStructsCreateFungibleData; - readonly isReFungible: boolean; - readonly asReFungible: UpDataStructsCreateReFungibleData; - readonly type: 'Nft' | 'Fungible' | 'ReFungible'; + /** @name FrameSystemCall (119) */ + interface FrameSystemCall extends Enum { + readonly isFillBlock: boolean; + readonly asFillBlock: { + readonly ratio: Perbill; + } & Struct; + readonly isRemark: boolean; + readonly asRemark: { + readonly remark: Bytes; + } & Struct; + readonly isSetHeapPages: boolean; + readonly asSetHeapPages: { + readonly pages: u64; + } & Struct; + readonly isSetCode: boolean; + readonly asSetCode: { + readonly code: Bytes; + } & Struct; + readonly isSetCodeWithoutChecks: boolean; + readonly asSetCodeWithoutChecks: { + readonly code: Bytes; + } & Struct; + readonly isSetStorage: boolean; + readonly asSetStorage: { + readonly items: Vec>; + } & Struct; + readonly isKillStorage: boolean; + readonly asKillStorage: { + readonly keys_: Vec; + } & Struct; + readonly isKillPrefix: boolean; + readonly asKillPrefix: { + readonly prefix: Bytes; + readonly subkeys: u32; + } & Struct; + readonly isRemarkWithEvent: boolean; + readonly asRemarkWithEvent: { + readonly remark: Bytes; + } & Struct; + readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent'; } - /** @name UpDataStructsCreateNftData (186) */ - export interface UpDataStructsCreateNftData extends Struct { - readonly properties: Vec; + /** @name FrameSystemLimitsBlockWeights (124) */ + interface FrameSystemLimitsBlockWeights extends Struct { + readonly baseBlock: u64; + readonly maxBlock: u64; + readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; } - /** @name UpDataStructsCreateFungibleData (187) */ - export interface UpDataStructsCreateFungibleData extends Struct { - readonly value: u128; + /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (125) */ + interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { + readonly normal: FrameSystemLimitsWeightsPerClass; + readonly operational: FrameSystemLimitsWeightsPerClass; + readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name UpDataStructsCreateReFungibleData (188) */ - export interface UpDataStructsCreateReFungibleData extends Struct { - readonly pieces: u128; - readonly properties: Vec; + /** @name FrameSystemLimitsWeightsPerClass (126) */ + interface FrameSystemLimitsWeightsPerClass extends Struct { + readonly baseExtrinsic: u64; + readonly maxExtrinsic: Option; + readonly maxTotal: Option; + readonly reserved: Option; } - /** @name UpDataStructsCreateItemExData (192) */ - export interface UpDataStructsCreateItemExData extends Enum { - readonly isNft: boolean; - readonly asNft: Vec; - readonly isFungible: boolean; - readonly asFungible: BTreeMap; - readonly isRefungibleMultipleItems: boolean; - readonly asRefungibleMultipleItems: Vec; - readonly isRefungibleMultipleOwners: boolean; - readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners; - readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; + /** @name FrameSystemLimitsBlockLength (128) */ + interface FrameSystemLimitsBlockLength extends Struct { + readonly max: FrameSupportWeightsPerDispatchClassU32; } - /** @name UpDataStructsCreateNftExData (194) */ - export interface UpDataStructsCreateNftExData extends Struct { - readonly properties: Vec; - readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; + /** @name FrameSupportWeightsPerDispatchClassU32 (129) */ + interface FrameSupportWeightsPerDispatchClassU32 extends Struct { + readonly normal: u32; + readonly operational: u32; + readonly mandatory: u32; } - /** @name UpDataStructsCreateRefungibleExSingleOwner (201) */ - export interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { - readonly user: PalletEvmAccountBasicCrossAccountIdRepr; - readonly pieces: u128; - readonly properties: Vec; + /** @name FrameSupportWeightsRuntimeDbWeight (130) */ + interface FrameSupportWeightsRuntimeDbWeight extends Struct { + readonly read: u64; + readonly write: u64; } - /** @name UpDataStructsCreateRefungibleExMultipleOwners (203) */ - export interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { - readonly users: BTreeMap; - readonly properties: Vec; + /** @name SpVersionRuntimeVersion (131) */ + interface SpVersionRuntimeVersion extends Struct { + readonly specName: Text; + readonly implName: Text; + readonly authoringVersion: u32; + readonly specVersion: u32; + readonly implVersion: u32; + readonly apis: Vec>; + readonly transactionVersion: u32; + readonly stateVersion: u8; } - /** @name PalletUniqueSchedulerCall (204) */ - export interface PalletUniqueSchedulerCall extends Enum { - readonly isScheduleNamed: boolean; - readonly asScheduleNamed: { - readonly id: U8aFixed; - readonly when: u32; - readonly maybePeriodic: Option>; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; - } & Struct; - readonly isCancelNamed: boolean; - readonly asCancelNamed: { - readonly id: U8aFixed; - } & Struct; - readonly isScheduleNamedAfter: boolean; - readonly asScheduleNamedAfter: { - readonly id: U8aFixed; - readonly after: u32; - readonly maybePeriodic: Option>; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; - } & Struct; - readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; + /** @name FrameSystemError (136) */ + interface FrameSystemError extends Enum { + readonly isInvalidSpecName: boolean; + readonly isSpecVersionNeedsToIncrease: boolean; + readonly isFailedToExtractRuntimeVersion: boolean; + readonly isNonDefaultComposite: boolean; + readonly isNonZeroRefCount: boolean; + readonly isCallFiltered: boolean; + readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name FrameSupportScheduleMaybeHashed (206) */ - export interface FrameSupportScheduleMaybeHashed extends Enum { - readonly isValue: boolean; - readonly asValue: Call; - readonly isHash: boolean; - readonly asHash: H256; - readonly type: 'Value' | 'Hash'; + /** @name PolkadotPrimitivesV2PersistedValidationData (137) */ + interface PolkadotPrimitivesV2PersistedValidationData extends Struct { + readonly parentHead: Bytes; + readonly relayParentNumber: u32; + readonly relayParentStorageRoot: H256; + readonly maxPovSize: u32; } - /** @name PalletConfigurationCall (207) */ - export interface PalletConfigurationCall extends Enum { - readonly isSetWeightToFeeCoefficientOverride: boolean; - readonly asSetWeightToFeeCoefficientOverride: { - readonly coeff: Option; - } & Struct; - readonly isSetMinGasPriceOverride: boolean; - readonly asSetMinGasPriceOverride: { - readonly coeff: Option; - } & Struct; - readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride'; - } - - /** @name PalletTemplateTransactionPaymentCall (209) */ - export type PalletTemplateTransactionPaymentCall = Null; - - /** @name PalletStructureCall (210) */ - export type PalletStructureCall = Null; - - /** @name PalletRmrkCoreCall (211) */ - export interface PalletRmrkCoreCall extends Enum { - readonly isCreateCollection: boolean; - readonly asCreateCollection: { - readonly metadata: Bytes; - readonly max: Option; - readonly symbol: Bytes; - } & Struct; - readonly isDestroyCollection: boolean; - readonly asDestroyCollection: { - readonly collectionId: u32; - } & Struct; - readonly isChangeCollectionIssuer: boolean; - readonly asChangeCollectionIssuer: { - readonly collectionId: u32; - readonly newIssuer: MultiAddress; - } & Struct; - readonly isLockCollection: boolean; - readonly asLockCollection: { - readonly collectionId: u32; - } & Struct; - readonly isMintNft: boolean; - readonly asMintNft: { - readonly owner: Option; - readonly collectionId: u32; - readonly recipient: Option; - readonly royaltyAmount: Option; - readonly metadata: Bytes; - readonly transferable: bool; - readonly resources: Option>; - } & Struct; - readonly isBurnNft: boolean; - readonly asBurnNft: { - readonly collectionId: u32; - readonly nftId: u32; - readonly maxBurns: u32; - } & Struct; - readonly isSend: boolean; - readonly asSend: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; - } & Struct; - readonly isAcceptNft: boolean; - readonly asAcceptNft: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; - } & Struct; - readonly isRejectNft: boolean; - readonly asRejectNft: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - } & Struct; - readonly isAcceptResource: boolean; - readonly asAcceptResource: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isAcceptResourceRemoval: boolean; - readonly asAcceptResourceRemoval: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isSetProperty: boolean; - readonly asSetProperty: { - readonly rmrkCollectionId: Compact; - readonly maybeNftId: Option; - readonly key: Bytes; - readonly value: Bytes; - } & Struct; - readonly isSetPriority: boolean; - readonly asSetPriority: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly priorities: Vec; - } & Struct; - readonly isAddBasicResource: boolean; - readonly asAddBasicResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resource: RmrkTraitsResourceBasicResource; - } & Struct; - readonly isAddComposableResource: boolean; - readonly asAddComposableResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resource: RmrkTraitsResourceComposableResource; - } & Struct; - readonly isAddSlotResource: boolean; - readonly asAddSlotResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resource: RmrkTraitsResourceSlotResource; - } & Struct; - readonly isRemoveResource: boolean; - readonly asRemoveResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resourceId: u32; - } & Struct; - readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; + /** @name PolkadotPrimitivesV2UpgradeRestriction (140) */ + interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { + readonly isPresent: boolean; + readonly type: 'Present'; } - /** @name RmrkTraitsResourceResourceTypes (217) */ - export interface RmrkTraitsResourceResourceTypes extends Enum { - readonly isBasic: boolean; - readonly asBasic: RmrkTraitsResourceBasicResource; - readonly isComposable: boolean; - readonly asComposable: RmrkTraitsResourceComposableResource; - readonly isSlot: boolean; - readonly asSlot: RmrkTraitsResourceSlotResource; - readonly type: 'Basic' | 'Composable' | 'Slot'; + /** @name SpTrieStorageProof (141) */ + interface SpTrieStorageProof extends Struct { + readonly trieNodes: BTreeSet; } - /** @name RmrkTraitsResourceBasicResource (219) */ - export interface RmrkTraitsResourceBasicResource extends Struct { - readonly src: Option; - readonly metadata: Option; - readonly license: Option; - readonly thumb: Option; + /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (143) */ + interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { + readonly dmqMqcHead: H256; + readonly relayDispatchQueueSize: ITuple<[u32, u32]>; + readonly ingressChannels: Vec>; + readonly egressChannels: Vec>; } - /** @name RmrkTraitsResourceComposableResource (221) */ - export interface RmrkTraitsResourceComposableResource extends Struct { - readonly parts: Vec; - readonly base: u32; - readonly src: Option; - readonly metadata: Option; - readonly license: Option; - readonly thumb: Option; + /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (146) */ + interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { + readonly maxCapacity: u32; + readonly maxTotalSize: u32; + readonly maxMessageSize: u32; + readonly msgCount: u32; + readonly totalSize: u32; + readonly mqcHead: Option; } - /** @name RmrkTraitsResourceSlotResource (222) */ - export interface RmrkTraitsResourceSlotResource extends Struct { - readonly base: u32; - readonly src: Option; - readonly metadata: Option; - readonly slot: u32; - readonly license: Option; - readonly thumb: Option; + /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (147) */ + interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { + readonly maxCodeSize: u32; + readonly maxHeadDataSize: u32; + readonly maxUpwardQueueCount: u32; + readonly maxUpwardQueueSize: u32; + readonly maxUpwardMessageSize: u32; + readonly maxUpwardMessageNumPerCandidate: u32; + readonly hrmpMaxMessageNumPerCandidate: u32; + readonly validationUpgradeCooldown: u32; + readonly validationUpgradeDelay: u32; } - /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (224) */ - export interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { - readonly isAccountId: boolean; - readonly asAccountId: AccountId32; - readonly isCollectionAndNftTuple: boolean; - readonly asCollectionAndNftTuple: ITuple<[u32, u32]>; - readonly type: 'AccountId' | 'CollectionAndNftTuple'; + /** @name PolkadotCorePrimitivesOutboundHrmpMessage (153) */ + interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { + readonly recipient: u32; + readonly data: Bytes; } - /** @name PalletRmrkEquipCall (228) */ - export interface PalletRmrkEquipCall extends Enum { - readonly isCreateBase: boolean; - readonly asCreateBase: { - readonly baseType: Bytes; - readonly symbol: Bytes; - readonly parts: Vec; + /** @name CumulusPalletParachainSystemCall (154) */ + interface CumulusPalletParachainSystemCall extends Enum { + readonly isSetValidationData: boolean; + readonly asSetValidationData: { + readonly data: CumulusPrimitivesParachainInherentParachainInherentData; } & Struct; - readonly isThemeAdd: boolean; - readonly asThemeAdd: { - readonly baseId: u32; - readonly theme: RmrkTraitsTheme; + readonly isSudoSendUpwardMessage: boolean; + readonly asSudoSendUpwardMessage: { + readonly message: Bytes; } & Struct; - readonly isEquippable: boolean; - readonly asEquippable: { - readonly baseId: u32; - readonly slotId: u32; - readonly equippables: RmrkTraitsPartEquippableList; + readonly isAuthorizeUpgrade: boolean; + readonly asAuthorizeUpgrade: { + readonly codeHash: H256; } & Struct; - readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; + readonly isEnactAuthorizedUpgrade: boolean; + readonly asEnactAuthorizedUpgrade: { + readonly code: Bytes; + } & Struct; + readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade'; } - /** @name RmrkTraitsPartPartType (231) */ - export interface RmrkTraitsPartPartType extends Enum { - readonly isFixedPart: boolean; - readonly asFixedPart: RmrkTraitsPartFixedPart; - readonly isSlotPart: boolean; - readonly asSlotPart: RmrkTraitsPartSlotPart; - readonly type: 'FixedPart' | 'SlotPart'; + /** @name CumulusPrimitivesParachainInherentParachainInherentData (155) */ + interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { + readonly validationData: PolkadotPrimitivesV2PersistedValidationData; + readonly relayChainState: SpTrieStorageProof; + readonly downwardMessages: Vec; + readonly horizontalMessages: BTreeMap>; } - /** @name RmrkTraitsPartFixedPart (233) */ - export interface RmrkTraitsPartFixedPart extends Struct { - readonly id: u32; - readonly z: u32; - readonly src: Bytes; + /** @name PolkadotCorePrimitivesInboundDownwardMessage (157) */ + interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { + readonly sentAt: u32; + readonly msg: Bytes; } - /** @name RmrkTraitsPartSlotPart (234) */ - export interface RmrkTraitsPartSlotPart extends Struct { - readonly id: u32; - readonly equippable: RmrkTraitsPartEquippableList; - readonly src: Bytes; - readonly z: u32; + /** @name PolkadotCorePrimitivesInboundHrmpMessage (160) */ + interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { + readonly sentAt: u32; + readonly data: Bytes; + } + + /** @name CumulusPalletParachainSystemError (163) */ + interface CumulusPalletParachainSystemError extends Enum { + readonly isOverlappingUpgrades: boolean; + readonly isProhibitedByPolkadot: boolean; + readonly isTooBig: boolean; + readonly isValidationDataNotAvailable: boolean; + readonly isHostConfigurationNotAvailable: boolean; + readonly isNotScheduled: boolean; + readonly isNothingAuthorized: boolean; + readonly isUnauthorized: boolean; + readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized'; + } + + /** @name PalletBalancesBalanceLock (165) */ + interface PalletBalancesBalanceLock extends Struct { + readonly id: U8aFixed; + readonly amount: u128; + readonly reasons: PalletBalancesReasons; } - /** @name RmrkTraitsPartEquippableList (235) */ - export interface RmrkTraitsPartEquippableList extends Enum { + /** @name PalletBalancesReasons (166) */ + interface PalletBalancesReasons extends Enum { + readonly isFee: boolean; + readonly isMisc: boolean; readonly isAll: boolean; - readonly isEmpty: boolean; - readonly isCustom: boolean; - readonly asCustom: Vec; - readonly type: 'All' | 'Empty' | 'Custom'; + readonly type: 'Fee' | 'Misc' | 'All'; } - /** @name RmrkTraitsTheme (237) */ - export interface RmrkTraitsTheme extends Struct { - readonly name: Bytes; - readonly properties: Vec; - readonly inherit: bool; + /** @name PalletBalancesReserveData (169) */ + interface PalletBalancesReserveData extends Struct { + readonly id: U8aFixed; + readonly amount: u128; } - /** @name RmrkTraitsThemeThemeProperty (239) */ - export interface RmrkTraitsThemeThemeProperty extends Struct { - readonly key: Bytes; - readonly value: Bytes; + /** @name PalletBalancesReleases (171) */ + interface PalletBalancesReleases extends Enum { + readonly isV100: boolean; + readonly isV200: boolean; + readonly type: 'V100' | 'V200'; } - /** @name PalletEvmCall (241) */ - export interface PalletEvmCall extends Enum { - readonly isWithdraw: boolean; - readonly asWithdraw: { - readonly address: H160; - readonly value: u128; + /** @name PalletBalancesCall (172) */ + interface PalletBalancesCall extends Enum { + readonly isTransfer: boolean; + readonly asTransfer: { + readonly dest: MultiAddress; + readonly value: Compact; } & Struct; - readonly isCall: boolean; - readonly asCall: { - readonly source: H160; - readonly target: H160; - readonly input: Bytes; - readonly value: U256; - readonly gasLimit: u64; - readonly maxFeePerGas: U256; - readonly maxPriorityFeePerGas: Option; - readonly nonce: Option; - readonly accessList: Vec]>>; + readonly isSetBalance: boolean; + readonly asSetBalance: { + readonly who: MultiAddress; + readonly newFree: Compact; + readonly newReserved: Compact; } & Struct; - readonly isCreate: boolean; - readonly asCreate: { - readonly source: H160; - readonly init: Bytes; - readonly value: U256; - readonly gasLimit: u64; - readonly maxFeePerGas: U256; - readonly maxPriorityFeePerGas: Option; - readonly nonce: Option; - readonly accessList: Vec]>>; + readonly isForceTransfer: boolean; + readonly asForceTransfer: { + readonly source: MultiAddress; + readonly dest: MultiAddress; + readonly value: Compact; } & Struct; - readonly isCreate2: boolean; - readonly asCreate2: { - readonly source: H160; - readonly init: Bytes; - readonly salt: H256; - readonly value: U256; - readonly gasLimit: u64; - readonly maxFeePerGas: U256; - readonly maxPriorityFeePerGas: Option; - readonly nonce: Option; - readonly accessList: Vec]>>; + readonly isTransferKeepAlive: boolean; + readonly asTransferKeepAlive: { + readonly dest: MultiAddress; + readonly value: Compact; } & Struct; - readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; - } - - /** @name PalletEthereumCall (247) */ - export interface PalletEthereumCall extends Enum { - readonly isTransact: boolean; - readonly asTransact: { - readonly transaction: EthereumTransactionTransactionV2; + readonly isTransferAll: boolean; + readonly asTransferAll: { + readonly dest: MultiAddress; + readonly keepAlive: bool; } & Struct; - readonly type: 'Transact'; + readonly isForceUnreserve: boolean; + readonly asForceUnreserve: { + readonly who: MultiAddress; + readonly amount: u128; + } & Struct; + readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; } - /** @name EthereumTransactionTransactionV2 (248) */ - export interface EthereumTransactionTransactionV2 extends Enum { - readonly isLegacy: boolean; - readonly asLegacy: EthereumTransactionLegacyTransaction; - readonly isEip2930: boolean; - readonly asEip2930: EthereumTransactionEip2930Transaction; - readonly isEip1559: boolean; - readonly asEip1559: EthereumTransactionEip1559Transaction; - readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; + /** @name PalletBalancesError (175) */ + interface PalletBalancesError extends Enum { + readonly isVestingBalance: boolean; + readonly isLiquidityRestrictions: boolean; + readonly isInsufficientBalance: boolean; + readonly isExistentialDeposit: boolean; + readonly isKeepAlive: boolean; + readonly isExistingVestingSchedule: boolean; + readonly isDeadAccount: boolean; + readonly isTooManyReserves: boolean; + readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves'; } - /** @name EthereumTransactionLegacyTransaction (249) */ - export interface EthereumTransactionLegacyTransaction extends Struct { - readonly nonce: U256; - readonly gasPrice: U256; - readonly gasLimit: U256; - readonly action: EthereumTransactionTransactionAction; - readonly value: U256; - readonly input: Bytes; - readonly signature: EthereumTransactionTransactionSignature; + /** @name PalletTimestampCall (177) */ + interface PalletTimestampCall extends Enum { + readonly isSet: boolean; + readonly asSet: { + readonly now: Compact; + } & Struct; + readonly type: 'Set'; } - /** @name EthereumTransactionTransactionAction (250) */ - export interface EthereumTransactionTransactionAction extends Enum { - readonly isCall: boolean; - readonly asCall: H160; - readonly isCreate: boolean; - readonly type: 'Call' | 'Create'; + /** @name PalletTransactionPaymentReleases (179) */ + interface PalletTransactionPaymentReleases extends Enum { + readonly isV1Ancient: boolean; + readonly isV2: boolean; + readonly type: 'V1Ancient' | 'V2'; } - /** @name EthereumTransactionTransactionSignature (251) */ - export interface EthereumTransactionTransactionSignature extends Struct { - readonly v: u64; - readonly r: H256; - readonly s: H256; + /** @name PalletTreasuryProposal (180) */ + interface PalletTreasuryProposal extends Struct { + readonly proposer: AccountId32; + readonly value: u128; + readonly beneficiary: AccountId32; + readonly bond: u128; } - /** @name EthereumTransactionEip2930Transaction (253) */ - export interface EthereumTransactionEip2930Transaction extends Struct { - readonly chainId: u64; - readonly nonce: U256; - readonly gasPrice: U256; - readonly gasLimit: U256; - readonly action: EthereumTransactionTransactionAction; - readonly value: U256; - readonly input: Bytes; - readonly accessList: Vec; - readonly oddYParity: bool; - readonly r: H256; - readonly s: H256; + /** @name PalletTreasuryCall (183) */ + interface PalletTreasuryCall extends Enum { + readonly isProposeSpend: boolean; + readonly asProposeSpend: { + readonly value: Compact; + readonly beneficiary: MultiAddress; + } & Struct; + readonly isRejectProposal: boolean; + readonly asRejectProposal: { + readonly proposalId: Compact; + } & Struct; + readonly isApproveProposal: boolean; + readonly asApproveProposal: { + readonly proposalId: Compact; + } & Struct; + readonly isSpend: boolean; + readonly asSpend: { + readonly amount: Compact; + readonly beneficiary: MultiAddress; + } & Struct; + readonly isRemoveApproval: boolean; + readonly asRemoveApproval: { + readonly proposalId: Compact; + } & Struct; + readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval'; } - /** @name EthereumTransactionAccessListItem (255) */ - export interface EthereumTransactionAccessListItem extends Struct { - readonly address: H160; - readonly storageKeys: Vec; - } + /** @name FrameSupportPalletId (186) */ + interface FrameSupportPalletId extends U8aFixed {} - /** @name EthereumTransactionEip1559Transaction (256) */ - export interface EthereumTransactionEip1559Transaction extends Struct { - readonly chainId: u64; - readonly nonce: U256; - readonly maxPriorityFeePerGas: U256; - readonly maxFeePerGas: U256; - readonly gasLimit: U256; - readonly action: EthereumTransactionTransactionAction; - readonly value: U256; - readonly input: Bytes; - readonly accessList: Vec; - readonly oddYParity: bool; - readonly r: H256; - readonly s: H256; + /** @name PalletTreasuryError (187) */ + interface PalletTreasuryError extends Enum { + readonly isInsufficientProposersBalance: boolean; + readonly isInvalidIndex: boolean; + readonly isTooManyApprovals: boolean; + readonly isInsufficientPermission: boolean; + readonly isProposalNotApproved: boolean; + readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved'; } - /** @name PalletEvmMigrationCall (257) */ - export interface PalletEvmMigrationCall extends Enum { - readonly isBegin: boolean; - readonly asBegin: { - readonly address: H160; + /** @name PalletSudoCall (188) */ + interface PalletSudoCall extends Enum { + readonly isSudo: boolean; + readonly asSudo: { + readonly call: Call; } & Struct; - readonly isSetData: boolean; - readonly asSetData: { - readonly address: H160; - readonly data: Vec>; + readonly isSudoUncheckedWeight: boolean; + readonly asSudoUncheckedWeight: { + readonly call: Call; + readonly weight: u64; } & Struct; - readonly isFinish: boolean; - readonly asFinish: { - readonly address: H160; - readonly code: Bytes; + readonly isSetKey: boolean; + readonly asSetKey: { + readonly new_: MultiAddress; } & Struct; - readonly type: 'Begin' | 'SetData' | 'Finish'; + readonly isSudoAs: boolean; + readonly asSudoAs: { + readonly who: MultiAddress; + readonly call: Call; + } & Struct; + readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs'; } - /** @name PalletSudoEvent (260) */ - export interface PalletSudoEvent extends Enum { - readonly isSudid: boolean; - readonly asSudid: { - readonly sudoResult: Result; + /** @name OrmlVestingModuleCall (190) */ + interface OrmlVestingModuleCall extends Enum { + readonly isClaim: boolean; + readonly isVestedTransfer: boolean; + readonly asVestedTransfer: { + readonly dest: MultiAddress; + readonly schedule: OrmlVestingVestingSchedule; } & Struct; - readonly isKeyChanged: boolean; - readonly asKeyChanged: { - readonly oldSudoer: Option; + readonly isUpdateVestingSchedules: boolean; + readonly asUpdateVestingSchedules: { + readonly who: MultiAddress; + readonly vestingSchedules: Vec; } & Struct; - readonly isSudoAsDone: boolean; - readonly asSudoAsDone: { - readonly sudoResult: Result; + readonly isClaimFor: boolean; + readonly asClaimFor: { + readonly dest: MultiAddress; } & Struct; - readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone'; - } - - /** @name SpRuntimeDispatchError (262) */ - export interface SpRuntimeDispatchError extends Enum { - readonly isOther: boolean; - readonly isCannotLookup: boolean; - readonly isBadOrigin: boolean; - readonly isModule: boolean; - readonly asModule: SpRuntimeModuleError; - readonly isConsumerRemaining: boolean; - readonly isNoProviders: boolean; - readonly isTooManyConsumers: boolean; - readonly isToken: boolean; - readonly asToken: SpRuntimeTokenError; - readonly isArithmetic: boolean; - readonly asArithmetic: SpRuntimeArithmeticError; - readonly isTransactional: boolean; - readonly asTransactional: SpRuntimeTransactionalError; - readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional'; + readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor'; } - /** @name SpRuntimeModuleError (263) */ - export interface SpRuntimeModuleError extends Struct { - readonly index: u8; - readonly error: U8aFixed; + /** @name CumulusPalletXcmpQueueCall (192) */ + interface CumulusPalletXcmpQueueCall extends Enum { + readonly isServiceOverweight: boolean; + readonly asServiceOverweight: { + readonly index: u64; + readonly weightLimit: u64; + } & Struct; + readonly isSuspendXcmExecution: boolean; + readonly isResumeXcmExecution: boolean; + readonly isUpdateSuspendThreshold: boolean; + readonly asUpdateSuspendThreshold: { + readonly new_: u32; + } & Struct; + readonly isUpdateDropThreshold: boolean; + readonly asUpdateDropThreshold: { + readonly new_: u32; + } & Struct; + readonly isUpdateResumeThreshold: boolean; + readonly asUpdateResumeThreshold: { + readonly new_: u32; + } & Struct; + readonly isUpdateThresholdWeight: boolean; + readonly asUpdateThresholdWeight: { + readonly new_: u64; + } & Struct; + readonly isUpdateWeightRestrictDecay: boolean; + readonly asUpdateWeightRestrictDecay: { + readonly new_: u64; + } & Struct; + readonly isUpdateXcmpMaxIndividualWeight: boolean; + readonly asUpdateXcmpMaxIndividualWeight: { + readonly new_: u64; + } & Struct; + readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight'; } - /** @name SpRuntimeTokenError (264) */ - export interface SpRuntimeTokenError extends Enum { - readonly isNoFunds: boolean; - readonly isWouldDie: boolean; - readonly isBelowMinimum: boolean; - readonly isCannotCreate: boolean; - readonly isUnknownAsset: boolean; - readonly isFrozen: boolean; - readonly isUnsupported: boolean; - readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported'; + /** @name PalletXcmCall (193) */ + interface PalletXcmCall extends Enum { + readonly isSend: boolean; + readonly asSend: { + readonly dest: XcmVersionedMultiLocation; + readonly message: XcmVersionedXcm; + } & Struct; + readonly isTeleportAssets: boolean; + readonly asTeleportAssets: { + readonly dest: XcmVersionedMultiLocation; + readonly beneficiary: XcmVersionedMultiLocation; + readonly assets: XcmVersionedMultiAssets; + readonly feeAssetItem: u32; + } & Struct; + readonly isReserveTransferAssets: boolean; + readonly asReserveTransferAssets: { + readonly dest: XcmVersionedMultiLocation; + readonly beneficiary: XcmVersionedMultiLocation; + readonly assets: XcmVersionedMultiAssets; + readonly feeAssetItem: u32; + } & Struct; + readonly isExecute: boolean; + readonly asExecute: { + readonly message: XcmVersionedXcm; + readonly maxWeight: u64; + } & Struct; + readonly isForceXcmVersion: boolean; + readonly asForceXcmVersion: { + readonly location: XcmV1MultiLocation; + readonly xcmVersion: u32; + } & Struct; + readonly isForceDefaultXcmVersion: boolean; + readonly asForceDefaultXcmVersion: { + readonly maybeXcmVersion: Option; + } & Struct; + readonly isForceSubscribeVersionNotify: boolean; + readonly asForceSubscribeVersionNotify: { + readonly location: XcmVersionedMultiLocation; + } & Struct; + readonly isForceUnsubscribeVersionNotify: boolean; + readonly asForceUnsubscribeVersionNotify: { + readonly location: XcmVersionedMultiLocation; + } & Struct; + readonly isLimitedReserveTransferAssets: boolean; + readonly asLimitedReserveTransferAssets: { + readonly dest: XcmVersionedMultiLocation; + readonly beneficiary: XcmVersionedMultiLocation; + readonly assets: XcmVersionedMultiAssets; + readonly feeAssetItem: u32; + readonly weightLimit: XcmV2WeightLimit; + } & Struct; + readonly isLimitedTeleportAssets: boolean; + readonly asLimitedTeleportAssets: { + readonly dest: XcmVersionedMultiLocation; + readonly beneficiary: XcmVersionedMultiLocation; + readonly assets: XcmVersionedMultiAssets; + readonly feeAssetItem: u32; + readonly weightLimit: XcmV2WeightLimit; + } & Struct; + readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets'; } - /** @name SpRuntimeArithmeticError (265) */ - export interface SpRuntimeArithmeticError extends Enum { - readonly isUnderflow: boolean; - readonly isOverflow: boolean; - readonly isDivisionByZero: boolean; - readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero'; + /** @name XcmVersionedXcm (194) */ + interface XcmVersionedXcm extends Enum { + readonly isV0: boolean; + readonly asV0: XcmV0Xcm; + readonly isV1: boolean; + readonly asV1: XcmV1Xcm; + readonly isV2: boolean; + readonly asV2: XcmV2Xcm; + readonly type: 'V0' | 'V1' | 'V2'; } - /** @name SpRuntimeTransactionalError (266) */ - export interface SpRuntimeTransactionalError extends Enum { - readonly isLimitReached: boolean; - readonly isNoLayer: boolean; - readonly type: 'LimitReached' | 'NoLayer'; + /** @name XcmV0Xcm (195) */ + interface XcmV0Xcm extends Enum { + readonly isWithdrawAsset: boolean; + readonly asWithdrawAsset: { + readonly assets: Vec; + readonly effects: Vec; + } & Struct; + readonly isReserveAssetDeposit: boolean; + readonly asReserveAssetDeposit: { + readonly assets: Vec; + readonly effects: Vec; + } & Struct; + readonly isTeleportAsset: boolean; + readonly asTeleportAsset: { + readonly assets: Vec; + readonly effects: Vec; + } & Struct; + readonly isQueryResponse: boolean; + readonly asQueryResponse: { + readonly queryId: Compact; + readonly response: XcmV0Response; + } & Struct; + readonly isTransferAsset: boolean; + readonly asTransferAsset: { + readonly assets: Vec; + readonly dest: XcmV0MultiLocation; + } & Struct; + readonly isTransferReserveAsset: boolean; + readonly asTransferReserveAsset: { + readonly assets: Vec; + readonly dest: XcmV0MultiLocation; + readonly effects: Vec; + } & Struct; + readonly isTransact: boolean; + readonly asTransact: { + readonly originType: XcmV0OriginKind; + readonly requireWeightAtMost: u64; + readonly call: XcmDoubleEncoded; + } & Struct; + readonly isHrmpNewChannelOpenRequest: boolean; + readonly asHrmpNewChannelOpenRequest: { + readonly sender: Compact; + readonly maxMessageSize: Compact; + readonly maxCapacity: Compact; + } & Struct; + readonly isHrmpChannelAccepted: boolean; + readonly asHrmpChannelAccepted: { + readonly recipient: Compact; + } & Struct; + readonly isHrmpChannelClosing: boolean; + readonly asHrmpChannelClosing: { + readonly initiator: Compact; + readonly sender: Compact; + readonly recipient: Compact; + } & Struct; + readonly isRelayedFrom: boolean; + readonly asRelayedFrom: { + readonly who: XcmV0MultiLocation; + readonly message: XcmV0Xcm; + } & Struct; + readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom'; } - /** @name PalletSudoError (267) */ - export interface PalletSudoError extends Enum { - readonly isRequireSudo: boolean; - readonly type: 'RequireSudo'; + /** @name XcmV0Order (197) */ + interface XcmV0Order extends Enum { + readonly isNull: boolean; + readonly isDepositAsset: boolean; + readonly asDepositAsset: { + readonly assets: Vec; + readonly dest: XcmV0MultiLocation; + } & Struct; + readonly isDepositReserveAsset: boolean; + readonly asDepositReserveAsset: { + readonly assets: Vec; + readonly dest: XcmV0MultiLocation; + readonly effects: Vec; + } & Struct; + readonly isExchangeAsset: boolean; + readonly asExchangeAsset: { + readonly give: Vec; + readonly receive: Vec; + } & Struct; + readonly isInitiateReserveWithdraw: boolean; + readonly asInitiateReserveWithdraw: { + readonly assets: Vec; + readonly reserve: XcmV0MultiLocation; + readonly effects: Vec; + } & Struct; + readonly isInitiateTeleport: boolean; + readonly asInitiateTeleport: { + readonly assets: Vec; + readonly dest: XcmV0MultiLocation; + readonly effects: Vec; + } & Struct; + readonly isQueryHolding: boolean; + readonly asQueryHolding: { + readonly queryId: Compact; + readonly dest: XcmV0MultiLocation; + readonly assets: Vec; + } & Struct; + readonly isBuyExecution: boolean; + readonly asBuyExecution: { + readonly fees: XcmV0MultiAsset; + readonly weight: u64; + readonly debt: u64; + readonly haltOnError: bool; + readonly xcm: Vec; + } & Struct; + readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; + } + + /** @name XcmV0Response (199) */ + interface XcmV0Response extends Enum { + readonly isAssets: boolean; + readonly asAssets: Vec; + readonly type: 'Assets'; + } + + /** @name XcmV1Xcm (200) */ + interface XcmV1Xcm extends Enum { + readonly isWithdrawAsset: boolean; + readonly asWithdrawAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly effects: Vec; + } & Struct; + readonly isReserveAssetDeposited: boolean; + readonly asReserveAssetDeposited: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly effects: Vec; + } & Struct; + readonly isReceiveTeleportedAsset: boolean; + readonly asReceiveTeleportedAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly effects: Vec; + } & Struct; + readonly isQueryResponse: boolean; + readonly asQueryResponse: { + readonly queryId: Compact; + readonly response: XcmV1Response; + } & Struct; + readonly isTransferAsset: boolean; + readonly asTransferAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly beneficiary: XcmV1MultiLocation; + } & Struct; + readonly isTransferReserveAsset: boolean; + readonly asTransferReserveAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly dest: XcmV1MultiLocation; + readonly effects: Vec; + } & Struct; + readonly isTransact: boolean; + readonly asTransact: { + readonly originType: XcmV0OriginKind; + readonly requireWeightAtMost: u64; + readonly call: XcmDoubleEncoded; + } & Struct; + readonly isHrmpNewChannelOpenRequest: boolean; + readonly asHrmpNewChannelOpenRequest: { + readonly sender: Compact; + readonly maxMessageSize: Compact; + readonly maxCapacity: Compact; + } & Struct; + readonly isHrmpChannelAccepted: boolean; + readonly asHrmpChannelAccepted: { + readonly recipient: Compact; + } & Struct; + readonly isHrmpChannelClosing: boolean; + readonly asHrmpChannelClosing: { + readonly initiator: Compact; + readonly sender: Compact; + readonly recipient: Compact; + } & Struct; + readonly isRelayedFrom: boolean; + readonly asRelayedFrom: { + readonly who: XcmV1MultilocationJunctions; + readonly message: XcmV1Xcm; + } & Struct; + readonly isSubscribeVersion: boolean; + readonly asSubscribeVersion: { + readonly queryId: Compact; + readonly maxResponseWeight: Compact; + } & Struct; + readonly isUnsubscribeVersion: boolean; + readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion'; + } + + /** @name XcmV1Order (202) */ + interface XcmV1Order extends Enum { + readonly isNoop: boolean; + readonly isDepositAsset: boolean; + readonly asDepositAsset: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly maxAssets: u32; + readonly beneficiary: XcmV1MultiLocation; + } & Struct; + readonly isDepositReserveAsset: boolean; + readonly asDepositReserveAsset: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly maxAssets: u32; + readonly dest: XcmV1MultiLocation; + readonly effects: Vec; + } & Struct; + readonly isExchangeAsset: boolean; + readonly asExchangeAsset: { + readonly give: XcmV1MultiassetMultiAssetFilter; + readonly receive: XcmV1MultiassetMultiAssets; + } & Struct; + readonly isInitiateReserveWithdraw: boolean; + readonly asInitiateReserveWithdraw: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly reserve: XcmV1MultiLocation; + readonly effects: Vec; + } & Struct; + readonly isInitiateTeleport: boolean; + readonly asInitiateTeleport: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly dest: XcmV1MultiLocation; + readonly effects: Vec; + } & Struct; + readonly isQueryHolding: boolean; + readonly asQueryHolding: { + readonly queryId: Compact; + readonly dest: XcmV1MultiLocation; + readonly assets: XcmV1MultiassetMultiAssetFilter; + } & Struct; + readonly isBuyExecution: boolean; + readonly asBuyExecution: { + readonly fees: XcmV1MultiAsset; + readonly weight: u64; + readonly debt: u64; + readonly haltOnError: bool; + readonly instructions: Vec; + } & Struct; + readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; + } + + /** @name XcmV1Response (204) */ + interface XcmV1Response extends Enum { + readonly isAssets: boolean; + readonly asAssets: XcmV1MultiassetMultiAssets; + readonly isVersion: boolean; + readonly asVersion: u32; + readonly type: 'Assets' | 'Version'; + } + + /** @name CumulusPalletXcmCall (218) */ + type CumulusPalletXcmCall = Null; + + /** @name CumulusPalletDmpQueueCall (219) */ + interface CumulusPalletDmpQueueCall extends Enum { + readonly isServiceOverweight: boolean; + readonly asServiceOverweight: { + readonly index: u64; + readonly weightLimit: u64; + } & Struct; + readonly type: 'ServiceOverweight'; + } + + /** @name PalletInflationCall (220) */ + interface PalletInflationCall extends Enum { + readonly isStartInflation: boolean; + readonly asStartInflation: { + readonly inflationStartRelayBlock: u32; + } & Struct; + readonly type: 'StartInflation'; + } + + /** @name PalletUniqueCall (221) */ + interface PalletUniqueCall extends Enum { + readonly isCreateCollection: boolean; + readonly asCreateCollection: { + readonly collectionName: Vec; + readonly collectionDescription: Vec; + readonly tokenPrefix: Bytes; + readonly mode: UpDataStructsCollectionMode; + } & Struct; + readonly isCreateCollectionEx: boolean; + readonly asCreateCollectionEx: { + readonly data: UpDataStructsCreateCollectionData; + } & Struct; + readonly isDestroyCollection: boolean; + readonly asDestroyCollection: { + readonly collectionId: u32; + } & Struct; + readonly isAddToAllowList: boolean; + readonly asAddToAllowList: { + readonly collectionId: u32; + readonly address: PalletEvmAccountBasicCrossAccountIdRepr; + } & Struct; + readonly isRemoveFromAllowList: boolean; + readonly asRemoveFromAllowList: { + readonly collectionId: u32; + readonly address: PalletEvmAccountBasicCrossAccountIdRepr; + } & Struct; + readonly isChangeCollectionOwner: boolean; + readonly asChangeCollectionOwner: { + readonly collectionId: u32; + readonly newOwner: AccountId32; + } & Struct; + readonly isAddCollectionAdmin: boolean; + readonly asAddCollectionAdmin: { + readonly collectionId: u32; + readonly newAdminId: PalletEvmAccountBasicCrossAccountIdRepr; + } & Struct; + readonly isRemoveCollectionAdmin: boolean; + readonly asRemoveCollectionAdmin: { + readonly collectionId: u32; + readonly accountId: PalletEvmAccountBasicCrossAccountIdRepr; + } & Struct; + readonly isSetCollectionSponsor: boolean; + readonly asSetCollectionSponsor: { + readonly collectionId: u32; + readonly newSponsor: AccountId32; + } & Struct; + readonly isConfirmSponsorship: boolean; + readonly asConfirmSponsorship: { + readonly collectionId: u32; + } & Struct; + readonly isRemoveCollectionSponsor: boolean; + readonly asRemoveCollectionSponsor: { + readonly collectionId: u32; + } & Struct; + readonly isCreateItem: boolean; + readonly asCreateItem: { + readonly collectionId: u32; + readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; + readonly data: UpDataStructsCreateItemData; + } & Struct; + readonly isCreateMultipleItems: boolean; + readonly asCreateMultipleItems: { + readonly collectionId: u32; + readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; + readonly itemsData: Vec; + } & Struct; + readonly isSetCollectionProperties: boolean; + readonly asSetCollectionProperties: { + readonly collectionId: u32; + readonly properties: Vec; + } & Struct; + readonly isDeleteCollectionProperties: boolean; + readonly asDeleteCollectionProperties: { + readonly collectionId: u32; + readonly propertyKeys: Vec; + } & Struct; + readonly isSetTokenProperties: boolean; + readonly asSetTokenProperties: { + readonly collectionId: u32; + readonly tokenId: u32; + readonly properties: Vec; + } & Struct; + readonly isDeleteTokenProperties: boolean; + readonly asDeleteTokenProperties: { + readonly collectionId: u32; + readonly tokenId: u32; + readonly propertyKeys: Vec; + } & Struct; + readonly isSetTokenPropertyPermissions: boolean; + readonly asSetTokenPropertyPermissions: { + readonly collectionId: u32; + readonly propertyPermissions: Vec; + } & Struct; + readonly isCreateMultipleItemsEx: boolean; + readonly asCreateMultipleItemsEx: { + readonly collectionId: u32; + readonly data: UpDataStructsCreateItemExData; + } & Struct; + readonly isSetTransfersEnabledFlag: boolean; + readonly asSetTransfersEnabledFlag: { + readonly collectionId: u32; + readonly value: bool; + } & Struct; + readonly isBurnItem: boolean; + readonly asBurnItem: { + readonly collectionId: u32; + readonly itemId: u32; + readonly value: u128; + } & Struct; + readonly isBurnFrom: boolean; + readonly asBurnFrom: { + readonly collectionId: u32; + readonly from: PalletEvmAccountBasicCrossAccountIdRepr; + readonly itemId: u32; + readonly value: u128; + } & Struct; + readonly isTransfer: boolean; + readonly asTransfer: { + readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr; + readonly collectionId: u32; + readonly itemId: u32; + readonly value: u128; + } & Struct; + readonly isApprove: boolean; + readonly asApprove: { + readonly spender: PalletEvmAccountBasicCrossAccountIdRepr; + readonly collectionId: u32; + readonly itemId: u32; + readonly amount: u128; + } & Struct; + readonly isTransferFrom: boolean; + readonly asTransferFrom: { + readonly from: PalletEvmAccountBasicCrossAccountIdRepr; + readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr; + readonly collectionId: u32; + readonly itemId: u32; + readonly value: u128; + } & Struct; + readonly isSetCollectionLimits: boolean; + readonly asSetCollectionLimits: { + readonly collectionId: u32; + readonly newLimit: UpDataStructsCollectionLimits; + } & Struct; + readonly isSetCollectionPermissions: boolean; + readonly asSetCollectionPermissions: { + readonly collectionId: u32; + readonly newPermission: UpDataStructsCollectionPermissions; + } & Struct; + readonly isRepartition: boolean; + readonly asRepartition: { + readonly collectionId: u32; + readonly tokenId: u32; + readonly amount: u128; + } & Struct; + readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; } - /** @name FrameSystemAccountInfo (268) */ - export interface FrameSystemAccountInfo extends Struct { - readonly nonce: u32; - readonly consumers: u32; - readonly providers: u32; - readonly sufficients: u32; - readonly data: PalletBalancesAccountData; + /** @name UpDataStructsCollectionMode (226) */ + interface UpDataStructsCollectionMode extends Enum { + readonly isNft: boolean; + readonly isFungible: boolean; + readonly asFungible: u8; + readonly isReFungible: boolean; + readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name FrameSupportWeightsPerDispatchClassU64 (269) */ - export interface FrameSupportWeightsPerDispatchClassU64 extends Struct { - readonly normal: u64; - readonly operational: u64; - readonly mandatory: u64; + /** @name UpDataStructsCreateCollectionData (227) */ + interface UpDataStructsCreateCollectionData extends Struct { + readonly mode: UpDataStructsCollectionMode; + readonly access: Option; + readonly name: Vec; + readonly description: Vec; + readonly tokenPrefix: Bytes; + readonly pendingSponsor: Option; + readonly limits: Option; + readonly permissions: Option; + readonly tokenPropertyPermissions: Vec; + readonly properties: Vec; } - /** @name SpRuntimeDigest (270) */ - export interface SpRuntimeDigest extends Struct { - readonly logs: Vec; + /** @name UpDataStructsAccessMode (229) */ + interface UpDataStructsAccessMode extends Enum { + readonly isNormal: boolean; + readonly isAllowList: boolean; + readonly type: 'Normal' | 'AllowList'; } - /** @name SpRuntimeDigestDigestItem (272) */ - export interface SpRuntimeDigestDigestItem extends Enum { - readonly isOther: boolean; - readonly asOther: Bytes; - readonly isConsensus: boolean; - readonly asConsensus: ITuple<[U8aFixed, Bytes]>; - readonly isSeal: boolean; - readonly asSeal: ITuple<[U8aFixed, Bytes]>; - readonly isPreRuntime: boolean; - readonly asPreRuntime: ITuple<[U8aFixed, Bytes]>; - readonly isRuntimeEnvironmentUpdated: boolean; - readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated'; + /** @name UpDataStructsCollectionLimits (231) */ + interface UpDataStructsCollectionLimits extends Struct { + readonly accountTokenOwnershipLimit: Option; + readonly sponsoredDataSize: Option; + readonly sponsoredDataRateLimit: Option; + readonly tokenLimit: Option; + readonly sponsorTransferTimeout: Option; + readonly sponsorApproveTimeout: Option; + readonly ownerCanTransfer: Option; + readonly ownerCanDestroy: Option; + readonly transfersEnabled: Option; } - /** @name FrameSystemEventRecord (274) */ - export interface FrameSystemEventRecord extends Struct { - readonly phase: FrameSystemPhase; - readonly event: Event; - readonly topics: Vec; + /** @name UpDataStructsSponsoringRateLimit (233) */ + interface UpDataStructsSponsoringRateLimit extends Enum { + readonly isSponsoringDisabled: boolean; + readonly isBlocks: boolean; + readonly asBlocks: u32; + readonly type: 'SponsoringDisabled' | 'Blocks'; } - /** @name FrameSystemEvent (276) */ - export interface FrameSystemEvent extends Enum { - readonly isExtrinsicSuccess: boolean; - readonly asExtrinsicSuccess: { - readonly dispatchInfo: FrameSupportWeightsDispatchInfo; - } & Struct; - readonly isExtrinsicFailed: boolean; - readonly asExtrinsicFailed: { - readonly dispatchError: SpRuntimeDispatchError; - readonly dispatchInfo: FrameSupportWeightsDispatchInfo; - } & Struct; - readonly isCodeUpdated: boolean; - readonly isNewAccount: boolean; - readonly asNewAccount: { - readonly account: AccountId32; - } & Struct; - readonly isKilledAccount: boolean; - readonly asKilledAccount: { - readonly account: AccountId32; - } & Struct; - readonly isRemarked: boolean; - readonly asRemarked: { - readonly sender: AccountId32; - readonly hash_: H256; - } & Struct; - readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked'; + /** @name UpDataStructsCollectionPermissions (236) */ + interface UpDataStructsCollectionPermissions extends Struct { + readonly access: Option; + readonly mintMode: Option; + readonly nesting: Option; } - /** @name FrameSupportWeightsDispatchInfo (277) */ - export interface FrameSupportWeightsDispatchInfo extends Struct { - readonly weight: u64; - readonly class: FrameSupportWeightsDispatchClass; - readonly paysFee: FrameSupportWeightsPays; + /** @name UpDataStructsNestingPermissions (238) */ + interface UpDataStructsNestingPermissions extends Struct { + readonly tokenOwner: bool; + readonly collectionAdmin: bool; + readonly restricted: Option; } - /** @name FrameSupportWeightsDispatchClass (278) */ - export interface FrameSupportWeightsDispatchClass extends Enum { - readonly isNormal: boolean; - readonly isOperational: boolean; - readonly isMandatory: boolean; - readonly type: 'Normal' | 'Operational' | 'Mandatory'; - } + /** @name UpDataStructsOwnerRestrictedSet (240) */ + interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} - /** @name FrameSupportWeightsPays (279) */ - export interface FrameSupportWeightsPays extends Enum { - readonly isYes: boolean; - readonly isNo: boolean; - readonly type: 'Yes' | 'No'; + /** @name UpDataStructsPropertyKeyPermission (245) */ + interface UpDataStructsPropertyKeyPermission extends Struct { + readonly key: Bytes; + readonly permission: UpDataStructsPropertyPermission; } - /** @name OrmlVestingModuleEvent (280) */ - export interface OrmlVestingModuleEvent extends Enum { - readonly isVestingScheduleAdded: boolean; - readonly asVestingScheduleAdded: { - readonly from: AccountId32; - readonly to: AccountId32; - readonly vestingSchedule: OrmlVestingVestingSchedule; - } & Struct; - readonly isClaimed: boolean; - readonly asClaimed: { - readonly who: AccountId32; - readonly amount: u128; - } & Struct; - readonly isVestingSchedulesUpdated: boolean; - readonly asVestingSchedulesUpdated: { - readonly who: AccountId32; - } & Struct; - readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated'; + /** @name UpDataStructsPropertyPermission (246) */ + interface UpDataStructsPropertyPermission extends Struct { + readonly mutable: bool; + readonly collectionAdmin: bool; + readonly tokenOwner: bool; } - /** @name CumulusPalletXcmpQueueEvent (281) */ - export interface CumulusPalletXcmpQueueEvent extends Enum { - readonly isSuccess: boolean; - readonly asSuccess: Option; - readonly isFail: boolean; - readonly asFail: ITuple<[Option, XcmV2TraitsError]>; - readonly isBadVersion: boolean; - readonly asBadVersion: Option; - readonly isBadFormat: boolean; - readonly asBadFormat: Option; - readonly isUpwardMessageSent: boolean; - readonly asUpwardMessageSent: Option; - readonly isXcmpMessageSent: boolean; - readonly asXcmpMessageSent: Option; - readonly isOverweightEnqueued: boolean; - readonly asOverweightEnqueued: ITuple<[u32, u32, u64, u64]>; - readonly isOverweightServiced: boolean; - readonly asOverweightServiced: ITuple<[u64, u64]>; - readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced'; + /** @name UpDataStructsProperty (249) */ + interface UpDataStructsProperty extends Struct { + readonly key: Bytes; + readonly value: Bytes; } - /** @name PalletXcmEvent (282) */ - export interface PalletXcmEvent extends Enum { - readonly isAttempted: boolean; - readonly asAttempted: XcmV2TraitsOutcome; - readonly isSent: boolean; - readonly asSent: ITuple<[XcmV1MultiLocation, XcmV1MultiLocation, XcmV2Xcm]>; - readonly isUnexpectedResponse: boolean; - readonly asUnexpectedResponse: ITuple<[XcmV1MultiLocation, u64]>; - readonly isResponseReady: boolean; - readonly asResponseReady: ITuple<[u64, XcmV2Response]>; - readonly isNotified: boolean; - readonly asNotified: ITuple<[u64, u8, u8]>; - readonly isNotifyOverweight: boolean; - readonly asNotifyOverweight: ITuple<[u64, u8, u8, u64, u64]>; - readonly isNotifyDispatchError: boolean; - readonly asNotifyDispatchError: ITuple<[u64, u8, u8]>; - readonly isNotifyDecodeFailed: boolean; - readonly asNotifyDecodeFailed: ITuple<[u64, u8, u8]>; - readonly isInvalidResponder: boolean; - readonly asInvalidResponder: ITuple<[XcmV1MultiLocation, u64, Option]>; - readonly isInvalidResponderVersion: boolean; - readonly asInvalidResponderVersion: ITuple<[XcmV1MultiLocation, u64]>; - readonly isResponseTaken: boolean; - readonly asResponseTaken: u64; - readonly isAssetsTrapped: boolean; - readonly asAssetsTrapped: ITuple<[H256, XcmV1MultiLocation, XcmVersionedMultiAssets]>; - readonly isVersionChangeNotified: boolean; - readonly asVersionChangeNotified: ITuple<[XcmV1MultiLocation, u32]>; - readonly isSupportedVersionChanged: boolean; - readonly asSupportedVersionChanged: ITuple<[XcmV1MultiLocation, u32]>; - readonly isNotifyTargetSendFail: boolean; - readonly asNotifyTargetSendFail: ITuple<[XcmV1MultiLocation, u64, XcmV2TraitsError]>; - readonly isNotifyTargetMigrationFail: boolean; - readonly asNotifyTargetMigrationFail: ITuple<[XcmVersionedMultiLocation, u64]>; - readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail'; + /** @name UpDataStructsCreateItemData (252) */ + interface UpDataStructsCreateItemData extends Enum { + readonly isNft: boolean; + readonly asNft: UpDataStructsCreateNftData; + readonly isFungible: boolean; + readonly asFungible: UpDataStructsCreateFungibleData; + readonly isReFungible: boolean; + readonly asReFungible: UpDataStructsCreateReFungibleData; + readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name XcmV2TraitsOutcome (283) */ - export interface XcmV2TraitsOutcome extends Enum { - readonly isComplete: boolean; - readonly asComplete: u64; - readonly isIncomplete: boolean; - readonly asIncomplete: ITuple<[u64, XcmV2TraitsError]>; - readonly isError: boolean; - readonly asError: XcmV2TraitsError; - readonly type: 'Complete' | 'Incomplete' | 'Error'; + /** @name UpDataStructsCreateNftData (253) */ + interface UpDataStructsCreateNftData extends Struct { + readonly properties: Vec; } - /** @name CumulusPalletXcmEvent (285) */ - export interface CumulusPalletXcmEvent extends Enum { - readonly isInvalidFormat: boolean; - readonly asInvalidFormat: U8aFixed; - readonly isUnsupportedVersion: boolean; - readonly asUnsupportedVersion: U8aFixed; - readonly isExecutedDownward: boolean; - readonly asExecutedDownward: ITuple<[U8aFixed, XcmV2TraitsOutcome]>; - readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; + /** @name UpDataStructsCreateFungibleData (254) */ + interface UpDataStructsCreateFungibleData extends Struct { + readonly value: u128; } - /** @name CumulusPalletDmpQueueEvent (286) */ - export interface CumulusPalletDmpQueueEvent extends Enum { - readonly isInvalidFormat: boolean; - readonly asInvalidFormat: { - readonly messageId: U8aFixed; - } & Struct; - readonly isUnsupportedVersion: boolean; - readonly asUnsupportedVersion: { - readonly messageId: U8aFixed; - } & Struct; - readonly isExecutedDownward: boolean; - readonly asExecutedDownward: { - readonly messageId: U8aFixed; - readonly outcome: XcmV2TraitsOutcome; - } & Struct; - readonly isWeightExhausted: boolean; - readonly asWeightExhausted: { - readonly messageId: U8aFixed; - readonly remainingWeight: u64; - readonly requiredWeight: u64; - } & Struct; - readonly isOverweightEnqueued: boolean; - readonly asOverweightEnqueued: { - readonly messageId: U8aFixed; - readonly overweightIndex: u64; - readonly requiredWeight: u64; - } & Struct; - readonly isOverweightServiced: boolean; - readonly asOverweightServiced: { - readonly overweightIndex: u64; - readonly weightUsed: u64; - } & Struct; - readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced'; + /** @name UpDataStructsCreateReFungibleData (255) */ + interface UpDataStructsCreateReFungibleData extends Struct { + readonly pieces: u128; + readonly properties: Vec; } - /** @name PalletUniqueRawEvent (287) */ - export interface PalletUniqueRawEvent extends Enum { - readonly isCollectionSponsorRemoved: boolean; - readonly asCollectionSponsorRemoved: u32; - readonly isCollectionAdminAdded: boolean; - readonly asCollectionAdminAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; - readonly isCollectionOwnedChanged: boolean; - readonly asCollectionOwnedChanged: ITuple<[u32, AccountId32]>; - readonly isCollectionSponsorSet: boolean; - readonly asCollectionSponsorSet: ITuple<[u32, AccountId32]>; - readonly isSponsorshipConfirmed: boolean; - readonly asSponsorshipConfirmed: ITuple<[u32, AccountId32]>; - readonly isCollectionAdminRemoved: boolean; - readonly asCollectionAdminRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; - readonly isAllowListAddressRemoved: boolean; - readonly asAllowListAddressRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; - readonly isAllowListAddressAdded: boolean; - readonly asAllowListAddressAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; - readonly isCollectionLimitSet: boolean; - readonly asCollectionLimitSet: u32; - readonly isCollectionPermissionSet: boolean; - readonly asCollectionPermissionSet: u32; - readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet'; + /** @name UpDataStructsCreateItemExData (258) */ + interface UpDataStructsCreateItemExData extends Enum { + readonly isNft: boolean; + readonly asNft: Vec; + readonly isFungible: boolean; + readonly asFungible: BTreeMap; + readonly isRefungibleMultipleItems: boolean; + readonly asRefungibleMultipleItems: Vec; + readonly isRefungibleMultipleOwners: boolean; + readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners; + readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; } - /** @name PalletUniqueSchedulerEvent (288) */ - export interface PalletUniqueSchedulerEvent extends Enum { - readonly isScheduled: boolean; - readonly asScheduled: { - readonly when: u32; - readonly index: u32; - } & Struct; - readonly isCanceled: boolean; - readonly asCanceled: { + /** @name UpDataStructsCreateNftExData (260) */ + interface UpDataStructsCreateNftExData extends Struct { + readonly properties: Vec; + readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; + } + + /** @name UpDataStructsCreateRefungibleExSingleOwner (267) */ + interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { + readonly user: PalletEvmAccountBasicCrossAccountIdRepr; + readonly pieces: u128; + readonly properties: Vec; + } + + /** @name UpDataStructsCreateRefungibleExMultipleOwners (269) */ + interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { + readonly users: BTreeMap; + readonly properties: Vec; + } + + /** @name PalletUniqueSchedulerCall (270) */ + interface PalletUniqueSchedulerCall extends Enum { + readonly isScheduleNamed: boolean; + readonly asScheduleNamed: { + readonly id: U8aFixed; readonly when: u32; - readonly index: u32; + readonly maybePeriodic: Option>; + readonly priority: u8; + readonly call: FrameSupportScheduleMaybeHashed; } & Struct; - readonly isDispatched: boolean; - readonly asDispatched: { - readonly task: ITuple<[u32, u32]>; - readonly id: Option; - readonly result: Result; + readonly isCancelNamed: boolean; + readonly asCancelNamed: { + readonly id: U8aFixed; } & Struct; - readonly isCallLookupFailed: boolean; - readonly asCallLookupFailed: { - readonly task: ITuple<[u32, u32]>; - readonly id: Option; - readonly error: FrameSupportScheduleLookupError; + readonly isScheduleNamedAfter: boolean; + readonly asScheduleNamedAfter: { + readonly id: U8aFixed; + readonly after: u32; + readonly maybePeriodic: Option>; + readonly priority: u8; + readonly call: FrameSupportScheduleMaybeHashed; } & Struct; - readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; + readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; } - /** @name FrameSupportScheduleLookupError (290) */ - export interface FrameSupportScheduleLookupError extends Enum { - readonly isUnknown: boolean; - readonly isBadFormat: boolean; - readonly type: 'Unknown' | 'BadFormat'; + /** @name FrameSupportScheduleMaybeHashed (272) */ + interface FrameSupportScheduleMaybeHashed extends Enum { + readonly isValue: boolean; + readonly asValue: Call; + readonly isHash: boolean; + readonly asHash: H256; + readonly type: 'Value' | 'Hash'; } - /** @name PalletCommonEvent (291) */ - export interface PalletCommonEvent extends Enum { - readonly isCollectionCreated: boolean; - readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; - readonly isCollectionDestroyed: boolean; - readonly asCollectionDestroyed: u32; - readonly isItemCreated: boolean; - readonly asItemCreated: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; - readonly isItemDestroyed: boolean; - readonly asItemDestroyed: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; - readonly isTransfer: boolean; - readonly asTransfer: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; - readonly isApproved: boolean; - readonly asApproved: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; - readonly isCollectionPropertySet: boolean; - readonly asCollectionPropertySet: ITuple<[u32, Bytes]>; - readonly isCollectionPropertyDeleted: boolean; - readonly asCollectionPropertyDeleted: ITuple<[u32, Bytes]>; - readonly isTokenPropertySet: boolean; - readonly asTokenPropertySet: ITuple<[u32, u32, Bytes]>; - readonly isTokenPropertyDeleted: boolean; - readonly asTokenPropertyDeleted: ITuple<[u32, u32, Bytes]>; - readonly isPropertyPermissionSet: boolean; - readonly asPropertyPermissionSet: ITuple<[u32, Bytes]>; - readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; + /** @name PalletConfigurationCall (273) */ + interface PalletConfigurationCall extends Enum { + readonly isSetWeightToFeeCoefficientOverride: boolean; + readonly asSetWeightToFeeCoefficientOverride: { + readonly coeff: Option; + } & Struct; + readonly isSetMinGasPriceOverride: boolean; + readonly asSetMinGasPriceOverride: { + readonly coeff: Option; + } & Struct; + readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride'; } - /** @name PalletStructureEvent (292) */ - export interface PalletStructureEvent extends Enum { - readonly isExecuted: boolean; - readonly asExecuted: Result; - readonly type: 'Executed'; - } + /** @name PalletTemplateTransactionPaymentCall (274) */ + type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletRmrkCoreEvent (293) */ - export interface PalletRmrkCoreEvent extends Enum { - readonly isCollectionCreated: boolean; - readonly asCollectionCreated: { - readonly issuer: AccountId32; + /** @name PalletStructureCall (275) */ + type PalletStructureCall = Null; + + /** @name PalletRmrkCoreCall (276) */ + interface PalletRmrkCoreCall extends Enum { + readonly isCreateCollection: boolean; + readonly asCreateCollection: { + readonly metadata: Bytes; + readonly max: Option; + readonly symbol: Bytes; + } & Struct; + readonly isDestroyCollection: boolean; + readonly asDestroyCollection: { readonly collectionId: u32; } & Struct; - readonly isCollectionDestroyed: boolean; - readonly asCollectionDestroyed: { - readonly issuer: AccountId32; + readonly isChangeCollectionIssuer: boolean; + readonly asChangeCollectionIssuer: { readonly collectionId: u32; + readonly newIssuer: MultiAddress; } & Struct; - readonly isIssuerChanged: boolean; - readonly asIssuerChanged: { - readonly oldIssuer: AccountId32; - readonly newIssuer: AccountId32; + readonly isLockCollection: boolean; + readonly asLockCollection: { readonly collectionId: u32; } & Struct; - readonly isCollectionLocked: boolean; - readonly asCollectionLocked: { - readonly issuer: AccountId32; + readonly isMintNft: boolean; + readonly asMintNft: { + readonly owner: Option; readonly collectionId: u32; + readonly recipient: Option; + readonly royaltyAmount: Option; + readonly metadata: Bytes; + readonly transferable: bool; + readonly resources: Option>; } & Struct; - readonly isNftMinted: boolean; - readonly asNftMinted: { - readonly owner: AccountId32; + readonly isBurnNft: boolean; + readonly asBurnNft: { readonly collectionId: u32; readonly nftId: u32; + readonly maxBurns: u32; } & Struct; - readonly isNftBurned: boolean; - readonly asNftBurned: { - readonly owner: AccountId32; - readonly nftId: u32; + readonly isSend: boolean; + readonly asSend: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; } & Struct; - readonly isNftSent: boolean; - readonly asNftSent: { - readonly sender: AccountId32; - readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; - readonly collectionId: u32; - readonly nftId: u32; - readonly approvalRequired: bool; + readonly isAcceptNft: boolean; + readonly asAcceptNft: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; } & Struct; - readonly isNftAccepted: boolean; - readonly asNftAccepted: { - readonly sender: AccountId32; - readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; - readonly collectionId: u32; - readonly nftId: u32; + readonly isRejectNft: boolean; + readonly asRejectNft: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; } & Struct; - readonly isNftRejected: boolean; - readonly asNftRejected: { - readonly sender: AccountId32; - readonly collectionId: u32; - readonly nftId: u32; + readonly isAcceptResource: boolean; + readonly asAcceptResource: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly resourceId: u32; } & Struct; - readonly isPropertySet: boolean; - readonly asPropertySet: { - readonly collectionId: u32; + readonly isAcceptResourceRemoval: boolean; + readonly asAcceptResourceRemoval: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly resourceId: u32; + } & Struct; + readonly isSetProperty: boolean; + readonly asSetProperty: { + readonly rmrkCollectionId: Compact; readonly maybeNftId: Option; readonly key: Bytes; readonly value: Bytes; } & Struct; - readonly isResourceAdded: boolean; - readonly asResourceAdded: { - readonly nftId: u32; - readonly resourceId: u32; + readonly isSetPriority: boolean; + readonly asSetPriority: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly priorities: Vec; } & Struct; - readonly isResourceRemoval: boolean; - readonly asResourceRemoval: { + readonly isAddBasicResource: boolean; + readonly asAddBasicResource: { + readonly rmrkCollectionId: u32; readonly nftId: u32; - readonly resourceId: u32; + readonly resource: RmrkTraitsResourceBasicResource; } & Struct; - readonly isResourceAccepted: boolean; - readonly asResourceAccepted: { + readonly isAddComposableResource: boolean; + readonly asAddComposableResource: { + readonly rmrkCollectionId: u32; readonly nftId: u32; - readonly resourceId: u32; + readonly resource: RmrkTraitsResourceComposableResource; } & Struct; - readonly isResourceRemovalAccepted: boolean; - readonly asResourceRemovalAccepted: { + readonly isAddSlotResource: boolean; + readonly asAddSlotResource: { + readonly rmrkCollectionId: u32; readonly nftId: u32; - readonly resourceId: u32; + readonly resource: RmrkTraitsResourceSlotResource; } & Struct; - readonly isPrioritySet: boolean; - readonly asPrioritySet: { - readonly collectionId: u32; + readonly isRemoveResource: boolean; + readonly asRemoveResource: { + readonly rmrkCollectionId: u32; readonly nftId: u32; + readonly resourceId: u32; } & Struct; - readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; + readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; + } + + /** @name RmrkTraitsResourceResourceTypes (282) */ + interface RmrkTraitsResourceResourceTypes extends Enum { + readonly isBasic: boolean; + readonly asBasic: RmrkTraitsResourceBasicResource; + readonly isComposable: boolean; + readonly asComposable: RmrkTraitsResourceComposableResource; + readonly isSlot: boolean; + readonly asSlot: RmrkTraitsResourceSlotResource; + readonly type: 'Basic' | 'Composable' | 'Slot'; + } + + /** @name RmrkTraitsResourceBasicResource (284) */ + interface RmrkTraitsResourceBasicResource extends Struct { + readonly src: Option; + readonly metadata: Option; + readonly license: Option; + readonly thumb: Option; + } + + /** @name RmrkTraitsResourceComposableResource (286) */ + interface RmrkTraitsResourceComposableResource extends Struct { + readonly parts: Vec; + readonly base: u32; + readonly src: Option; + readonly metadata: Option; + readonly license: Option; + readonly thumb: Option; + } + + /** @name RmrkTraitsResourceSlotResource (287) */ + interface RmrkTraitsResourceSlotResource extends Struct { + readonly base: u32; + readonly src: Option; + readonly metadata: Option; + readonly slot: u32; + readonly license: Option; + readonly thumb: Option; } - /** @name PalletRmrkEquipEvent (294) */ - export interface PalletRmrkEquipEvent extends Enum { - readonly isBaseCreated: boolean; - readonly asBaseCreated: { - readonly issuer: AccountId32; + /** @name PalletRmrkEquipCall (290) */ + interface PalletRmrkEquipCall extends Enum { + readonly isCreateBase: boolean; + readonly asCreateBase: { + readonly baseType: Bytes; + readonly symbol: Bytes; + readonly parts: Vec; + } & Struct; + readonly isThemeAdd: boolean; + readonly asThemeAdd: { readonly baseId: u32; + readonly theme: RmrkTraitsTheme; } & Struct; - readonly isEquippablesUpdated: boolean; - readonly asEquippablesUpdated: { + readonly isEquippable: boolean; + readonly asEquippable: { readonly baseId: u32; readonly slotId: u32; + readonly equippables: RmrkTraitsPartEquippableList; } & Struct; - readonly type: 'BaseCreated' | 'EquippablesUpdated'; - } - - /** @name PalletEvmEvent (295) */ - export interface PalletEvmEvent extends Enum { - readonly isLog: boolean; - readonly asLog: EthereumLog; - readonly isCreated: boolean; - readonly asCreated: H160; - readonly isCreatedFailed: boolean; - readonly asCreatedFailed: H160; - readonly isExecuted: boolean; - readonly asExecuted: H160; - readonly isExecutedFailed: boolean; - readonly asExecutedFailed: H160; - readonly isBalanceDeposit: boolean; - readonly asBalanceDeposit: ITuple<[AccountId32, H160, U256]>; - readonly isBalanceWithdraw: boolean; - readonly asBalanceWithdraw: ITuple<[AccountId32, H160, U256]>; - readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; + readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; } - /** @name EthereumLog (296) */ - export interface EthereumLog extends Struct { - readonly address: H160; - readonly topics: Vec; - readonly data: Bytes; + /** @name RmrkTraitsPartPartType (293) */ + interface RmrkTraitsPartPartType extends Enum { + readonly isFixedPart: boolean; + readonly asFixedPart: RmrkTraitsPartFixedPart; + readonly isSlotPart: boolean; + readonly asSlotPart: RmrkTraitsPartSlotPart; + readonly type: 'FixedPart' | 'SlotPart'; } - /** @name PalletEthereumEvent (297) */ - export interface PalletEthereumEvent extends Enum { - readonly isExecuted: boolean; - readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; - readonly type: 'Executed'; + /** @name RmrkTraitsPartFixedPart (295) */ + interface RmrkTraitsPartFixedPart extends Struct { + readonly id: u32; + readonly z: u32; + readonly src: Bytes; } - /** @name EvmCoreErrorExitReason (298) */ - export interface EvmCoreErrorExitReason extends Enum { - readonly isSucceed: boolean; - readonly asSucceed: EvmCoreErrorExitSucceed; - readonly isError: boolean; - readonly asError: EvmCoreErrorExitError; - readonly isRevert: boolean; - readonly asRevert: EvmCoreErrorExitRevert; - readonly isFatal: boolean; - readonly asFatal: EvmCoreErrorExitFatal; - readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; + /** @name RmrkTraitsPartSlotPart (296) */ + interface RmrkTraitsPartSlotPart extends Struct { + readonly id: u32; + readonly equippable: RmrkTraitsPartEquippableList; + readonly src: Bytes; + readonly z: u32; } - /** @name EvmCoreErrorExitSucceed (299) */ - export interface EvmCoreErrorExitSucceed extends Enum { - readonly isStopped: boolean; - readonly isReturned: boolean; - readonly isSuicided: boolean; - readonly type: 'Stopped' | 'Returned' | 'Suicided'; + /** @name RmrkTraitsPartEquippableList (297) */ + interface RmrkTraitsPartEquippableList extends Enum { + readonly isAll: boolean; + readonly isEmpty: boolean; + readonly isCustom: boolean; + readonly asCustom: Vec; + readonly type: 'All' | 'Empty' | 'Custom'; } - /** @name EvmCoreErrorExitError (300) */ - export interface EvmCoreErrorExitError extends Enum { - readonly isStackUnderflow: boolean; - readonly isStackOverflow: boolean; - readonly isInvalidJump: boolean; - readonly isInvalidRange: boolean; - readonly isDesignatedInvalid: boolean; - readonly isCallTooDeep: boolean; - readonly isCreateCollision: boolean; - readonly isCreateContractLimit: boolean; - readonly isOutOfOffset: boolean; - readonly isOutOfGas: boolean; - readonly isOutOfFund: boolean; - readonly isPcUnderflow: boolean; - readonly isCreateEmpty: boolean; - readonly isOther: boolean; - readonly asOther: Text; - readonly isInvalidCode: boolean; - readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; + /** @name RmrkTraitsTheme (299) */ + interface RmrkTraitsTheme extends Struct { + readonly name: Bytes; + readonly properties: Vec; + readonly inherit: bool; } - /** @name EvmCoreErrorExitRevert (303) */ - export interface EvmCoreErrorExitRevert extends Enum { - readonly isReverted: boolean; - readonly type: 'Reverted'; + /** @name RmrkTraitsThemeThemeProperty (301) */ + interface RmrkTraitsThemeThemeProperty extends Struct { + readonly key: Bytes; + readonly value: Bytes; } - /** @name EvmCoreErrorExitFatal (304) */ - export interface EvmCoreErrorExitFatal extends Enum { - readonly isNotSupported: boolean; - readonly isUnhandledInterrupt: boolean; - readonly isCallErrorAsFatal: boolean; - readonly asCallErrorAsFatal: EvmCoreErrorExitError; - readonly isOther: boolean; - readonly asOther: Text; - readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; + /** @name PalletEvmCall (303) */ + interface PalletEvmCall extends Enum { + readonly isWithdraw: boolean; + readonly asWithdraw: { + readonly address: H160; + readonly value: u128; + } & Struct; + readonly isCall: boolean; + readonly asCall: { + readonly source: H160; + readonly target: H160; + readonly input: Bytes; + readonly value: U256; + readonly gasLimit: u64; + readonly maxFeePerGas: U256; + readonly maxPriorityFeePerGas: Option; + readonly nonce: Option; + readonly accessList: Vec]>>; + } & Struct; + readonly isCreate: boolean; + readonly asCreate: { + readonly source: H160; + readonly init: Bytes; + readonly value: U256; + readonly gasLimit: u64; + readonly maxFeePerGas: U256; + readonly maxPriorityFeePerGas: Option; + readonly nonce: Option; + readonly accessList: Vec]>>; + } & Struct; + readonly isCreate2: boolean; + readonly asCreate2: { + readonly source: H160; + readonly init: Bytes; + readonly salt: H256; + readonly value: U256; + readonly gasLimit: u64; + readonly maxFeePerGas: U256; + readonly maxPriorityFeePerGas: Option; + readonly nonce: Option; + readonly accessList: Vec]>>; + } & Struct; + readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name FrameSystemPhase (305) */ - export interface FrameSystemPhase extends Enum { - readonly isApplyExtrinsic: boolean; - readonly asApplyExtrinsic: u32; - readonly isFinalization: boolean; - readonly isInitialization: boolean; - readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; + /** @name PalletEthereumCall (307) */ + interface PalletEthereumCall extends Enum { + readonly isTransact: boolean; + readonly asTransact: { + readonly transaction: EthereumTransactionTransactionV2; + } & Struct; + readonly type: 'Transact'; } - /** @name FrameSystemLastRuntimeUpgradeInfo (307) */ - export interface FrameSystemLastRuntimeUpgradeInfo extends Struct { - readonly specVersion: Compact; - readonly specName: Text; + /** @name EthereumTransactionTransactionV2 (308) */ + interface EthereumTransactionTransactionV2 extends Enum { + readonly isLegacy: boolean; + readonly asLegacy: EthereumTransactionLegacyTransaction; + readonly isEip2930: boolean; + readonly asEip2930: EthereumTransactionEip2930Transaction; + readonly isEip1559: boolean; + readonly asEip1559: EthereumTransactionEip1559Transaction; + readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name FrameSystemLimitsBlockWeights (308) */ - export interface FrameSystemLimitsBlockWeights extends Struct { - readonly baseBlock: u64; - readonly maxBlock: u64; - readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; + /** @name EthereumTransactionLegacyTransaction (309) */ + interface EthereumTransactionLegacyTransaction extends Struct { + readonly nonce: U256; + readonly gasPrice: U256; + readonly gasLimit: U256; + readonly action: EthereumTransactionTransactionAction; + readonly value: U256; + readonly input: Bytes; + readonly signature: EthereumTransactionTransactionSignature; } - /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (309) */ - export interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { - readonly normal: FrameSystemLimitsWeightsPerClass; - readonly operational: FrameSystemLimitsWeightsPerClass; - readonly mandatory: FrameSystemLimitsWeightsPerClass; + /** @name EthereumTransactionTransactionAction (310) */ + interface EthereumTransactionTransactionAction extends Enum { + readonly isCall: boolean; + readonly asCall: H160; + readonly isCreate: boolean; + readonly type: 'Call' | 'Create'; } - /** @name FrameSystemLimitsWeightsPerClass (310) */ - export interface FrameSystemLimitsWeightsPerClass extends Struct { - readonly baseExtrinsic: u64; - readonly maxExtrinsic: Option; - readonly maxTotal: Option; - readonly reserved: Option; + /** @name EthereumTransactionTransactionSignature (311) */ + interface EthereumTransactionTransactionSignature extends Struct { + readonly v: u64; + readonly r: H256; + readonly s: H256; } - /** @name FrameSystemLimitsBlockLength (311) */ - export interface FrameSystemLimitsBlockLength extends Struct { - readonly max: FrameSupportWeightsPerDispatchClassU32; + /** @name EthereumTransactionEip2930Transaction (313) */ + interface EthereumTransactionEip2930Transaction extends Struct { + readonly chainId: u64; + readonly nonce: U256; + readonly gasPrice: U256; + readonly gasLimit: U256; + readonly action: EthereumTransactionTransactionAction; + readonly value: U256; + readonly input: Bytes; + readonly accessList: Vec; + readonly oddYParity: bool; + readonly r: H256; + readonly s: H256; } - /** @name FrameSupportWeightsPerDispatchClassU32 (312) */ - export interface FrameSupportWeightsPerDispatchClassU32 extends Struct { - readonly normal: u32; - readonly operational: u32; - readonly mandatory: u32; + /** @name EthereumTransactionAccessListItem (315) */ + interface EthereumTransactionAccessListItem extends Struct { + readonly address: H160; + readonly storageKeys: Vec; } - /** @name FrameSupportWeightsRuntimeDbWeight (313) */ - export interface FrameSupportWeightsRuntimeDbWeight extends Struct { - readonly read: u64; - readonly write: u64; + /** @name EthereumTransactionEip1559Transaction (316) */ + interface EthereumTransactionEip1559Transaction extends Struct { + readonly chainId: u64; + readonly nonce: U256; + readonly maxPriorityFeePerGas: U256; + readonly maxFeePerGas: U256; + readonly gasLimit: U256; + readonly action: EthereumTransactionTransactionAction; + readonly value: U256; + readonly input: Bytes; + readonly accessList: Vec; + readonly oddYParity: bool; + readonly r: H256; + readonly s: H256; } - /** @name SpVersionRuntimeVersion (314) */ - export interface SpVersionRuntimeVersion extends Struct { - readonly specName: Text; - readonly implName: Text; - readonly authoringVersion: u32; - readonly specVersion: u32; - readonly implVersion: u32; - readonly apis: Vec>; - readonly transactionVersion: u32; - readonly stateVersion: u8; + /** @name PalletEvmMigrationCall (317) */ + interface PalletEvmMigrationCall extends Enum { + readonly isBegin: boolean; + readonly asBegin: { + readonly address: H160; + } & Struct; + readonly isSetData: boolean; + readonly asSetData: { + readonly address: H160; + readonly data: Vec>; + } & Struct; + readonly isFinish: boolean; + readonly asFinish: { + readonly address: H160; + readonly code: Bytes; + } & Struct; + readonly type: 'Begin' | 'SetData' | 'Finish'; } - /** @name FrameSystemError (318) */ - export interface FrameSystemError extends Enum { - readonly isInvalidSpecName: boolean; - readonly isSpecVersionNeedsToIncrease: boolean; - readonly isFailedToExtractRuntimeVersion: boolean; - readonly isNonDefaultComposite: boolean; - readonly isNonZeroRefCount: boolean; - readonly isCallFiltered: boolean; - readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; + /** @name PalletSudoError (320) */ + interface PalletSudoError extends Enum { + readonly isRequireSudo: boolean; + readonly type: 'RequireSudo'; } - /** @name OrmlVestingModuleError (320) */ - export interface OrmlVestingModuleError extends Enum { + /** @name OrmlVestingModuleError (322) */ + interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; readonly isInsufficientBalanceToLock: boolean; @@ -2766,30 +2816,30 @@ declare module '@polkadot/types/lookup' { readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (322) */ - export interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { + /** @name CumulusPalletXcmpQueueInboundChannelDetails (324) */ + interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (323) */ - export interface CumulusPalletXcmpQueueInboundState extends Enum { + /** @name CumulusPalletXcmpQueueInboundState (325) */ + interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (326) */ - export interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (328) */ + interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; readonly isSignals: boolean; readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (329) */ - export interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (331) */ + interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; readonly signalsExist: bool; @@ -2797,15 +2847,15 @@ declare module '@polkadot/types/lookup' { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (330) */ - export interface CumulusPalletXcmpQueueOutboundState extends Enum { + /** @name CumulusPalletXcmpQueueOutboundState (332) */ + interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (332) */ - export interface CumulusPalletXcmpQueueQueueConfigData extends Struct { + /** @name CumulusPalletXcmpQueueQueueConfigData (334) */ + interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; readonly resumeThreshold: u32; @@ -2814,8 +2864,8 @@ declare module '@polkadot/types/lookup' { readonly xcmpMaxIndividualWeight: u64; } - /** @name CumulusPalletXcmpQueueError (334) */ - export interface CumulusPalletXcmpQueueError extends Enum { + /** @name CumulusPalletXcmpQueueError (336) */ + interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; readonly isBadXcm: boolean; @@ -2824,8 +2874,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (335) */ - export interface PalletXcmError extends Enum { + /** @name PalletXcmError (337) */ + interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; readonly isFiltered: boolean; @@ -2842,30 +2892,30 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (336) */ - export type CumulusPalletXcmError = Null; + /** @name CumulusPalletXcmError (338) */ + type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (337) */ - export interface CumulusPalletDmpQueueConfigData extends Struct { + /** @name CumulusPalletDmpQueueConfigData (339) */ + interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: u64; } - /** @name CumulusPalletDmpQueuePageIndexData (338) */ - export interface CumulusPalletDmpQueuePageIndexData extends Struct { + /** @name CumulusPalletDmpQueuePageIndexData (340) */ + interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (341) */ - export interface CumulusPalletDmpQueueError extends Enum { + /** @name CumulusPalletDmpQueueError (343) */ + interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (345) */ - export interface PalletUniqueError extends Enum { + /** @name PalletUniqueError (347) */ + interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; readonly isEmptyArgument: boolean; @@ -2873,8 +2923,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name PalletUniqueSchedulerScheduledV3 (348) */ - export interface PalletUniqueSchedulerScheduledV3 extends Struct { + /** @name PalletUniqueSchedulerScheduledV3 (350) */ + interface PalletUniqueSchedulerScheduledV3 extends Struct { readonly maybeId: Option; readonly priority: u8; readonly call: FrameSupportScheduleMaybeHashed; @@ -2882,22 +2932,22 @@ declare module '@polkadot/types/lookup' { readonly origin: OpalRuntimeOriginCaller; } - /** @name OpalRuntimeOriginCaller (349) */ - export interface OpalRuntimeOriginCaller extends Enum { - readonly isVoid: boolean; + /** @name OpalRuntimeOriginCaller (351) */ + interface OpalRuntimeOriginCaller extends Enum { readonly isSystem: boolean; readonly asSystem: FrameSupportDispatchRawOrigin; + readonly isVoid: boolean; readonly isPolkadotXcm: boolean; readonly asPolkadotXcm: PalletXcmOrigin; readonly isCumulusXcm: boolean; readonly asCumulusXcm: CumulusPalletXcmOrigin; readonly isEthereum: boolean; readonly asEthereum: PalletEthereumRawOrigin; - readonly type: 'Void' | 'System' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; + readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; } - /** @name FrameSupportDispatchRawOrigin (350) */ - export interface FrameSupportDispatchRawOrigin extends Enum { + /** @name FrameSupportDispatchRawOrigin (352) */ + interface FrameSupportDispatchRawOrigin extends Enum { readonly isRoot: boolean; readonly isSigned: boolean; readonly asSigned: AccountId32; @@ -2905,8 +2955,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Root' | 'Signed' | 'None'; } - /** @name PalletXcmOrigin (351) */ - export interface PalletXcmOrigin extends Enum { + /** @name PalletXcmOrigin (353) */ + interface PalletXcmOrigin extends Enum { readonly isXcm: boolean; readonly asXcm: XcmV1MultiLocation; readonly isResponse: boolean; @@ -2914,26 +2964,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'Xcm' | 'Response'; } - /** @name CumulusPalletXcmOrigin (352) */ - export interface CumulusPalletXcmOrigin extends Enum { + /** @name CumulusPalletXcmOrigin (354) */ + interface CumulusPalletXcmOrigin extends Enum { readonly isRelay: boolean; readonly isSiblingParachain: boolean; readonly asSiblingParachain: u32; readonly type: 'Relay' | 'SiblingParachain'; } - /** @name PalletEthereumRawOrigin (353) */ - export interface PalletEthereumRawOrigin extends Enum { + /** @name PalletEthereumRawOrigin (355) */ + interface PalletEthereumRawOrigin extends Enum { readonly isEthereumTransaction: boolean; readonly asEthereumTransaction: H160; readonly type: 'EthereumTransaction'; } - /** @name SpCoreVoid (354) */ - export type SpCoreVoid = Null; + /** @name SpCoreVoid (356) */ + type SpCoreVoid = Null; - /** @name PalletUniqueSchedulerError (355) */ - export interface PalletUniqueSchedulerError extends Enum { + /** @name PalletUniqueSchedulerError (357) */ + interface PalletUniqueSchedulerError extends Enum { readonly isFailedToSchedule: boolean; readonly isNotFound: boolean; readonly isTargetBlockNumberInPast: boolean; @@ -2941,8 +2991,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; } - /** @name UpDataStructsCollection (356) */ - export interface UpDataStructsCollection extends Struct { + /** @name UpDataStructsCollection (358) */ + interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; readonly name: Vec; @@ -2954,8 +3004,8 @@ declare module '@polkadot/types/lookup' { readonly externalCollection: bool; } - /** @name UpDataStructsSponsorshipState (357) */ - export interface UpDataStructsSponsorshipState extends Enum { + /** @name UpDataStructsSponsorshipState (359) */ + interface UpDataStructsSponsorshipState extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; readonly asUnconfirmed: AccountId32; @@ -2964,44 +3014,44 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (358) */ - export interface UpDataStructsProperties extends Struct { + /** @name UpDataStructsProperties (360) */ + interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (359) */ - export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} + /** @name UpDataStructsPropertiesMapBoundedVec (361) */ + interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (364) */ - export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} + /** @name UpDataStructsPropertiesMapPropertyPermission (366) */ + interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (371) */ - export interface UpDataStructsCollectionStats extends Struct { + /** @name UpDataStructsCollectionStats (373) */ + interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (372) */ - export interface UpDataStructsTokenChild extends Struct { + /** @name UpDataStructsTokenChild (374) */ + interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (373) */ - export interface PhantomTypeUpDataStructs extends Vec> {} + /** @name PhantomTypeUpDataStructs (375) */ + interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (375) */ - export interface UpDataStructsTokenData extends Struct { + /** @name UpDataStructsTokenData (377) */ + interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (377) */ - export interface UpDataStructsRpcCollection extends Struct { + /** @name UpDataStructsRpcCollection (379) */ + interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; readonly name: Vec; @@ -3015,8 +3065,8 @@ declare module '@polkadot/types/lookup' { readonly readOnly: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (378) */ - export interface RmrkTraitsCollectionCollectionInfo extends Struct { + /** @name RmrkTraitsCollectionCollectionInfo (380) */ + interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; readonly max: Option; @@ -3024,8 +3074,8 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (379) */ - export interface RmrkTraitsNftNftInfo extends Struct { + /** @name RmrkTraitsNftNftInfo (381) */ + interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; readonly metadata: Bytes; @@ -3033,41 +3083,41 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (381) */ - export interface RmrkTraitsNftRoyaltyInfo extends Struct { + /** @name RmrkTraitsNftRoyaltyInfo (383) */ + interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (382) */ - export interface RmrkTraitsResourceResourceInfo extends Struct { + /** @name RmrkTraitsResourceResourceInfo (384) */ + interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; readonly pending: bool; readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (383) */ - export interface RmrkTraitsPropertyPropertyInfo extends Struct { + /** @name RmrkTraitsPropertyPropertyInfo (385) */ + interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (384) */ - export interface RmrkTraitsBaseBaseInfo extends Struct { + /** @name RmrkTraitsBaseBaseInfo (386) */ + interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (385) */ - export interface RmrkTraitsNftNftChild extends Struct { + /** @name RmrkTraitsNftNftChild (387) */ + interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (387) */ - export interface PalletCommonError extends Enum { + /** @name PalletCommonError (389) */ + interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; readonly isNoPermission: boolean; @@ -3105,8 +3155,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (389) */ - export interface PalletFungibleError extends Enum { + /** @name PalletFungibleError (391) */ + interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; readonly isFungibleItemsDontHaveData: boolean; @@ -3115,13 +3165,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (390) */ - export interface PalletRefungibleItemData extends Struct { + /** @name PalletRefungibleItemData (392) */ + interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } - /** @name PalletRefungibleError (395) */ - export interface PalletRefungibleError extends Enum { + /** @name PalletRefungibleError (397) */ + interface PalletRefungibleError extends Enum { readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isWrongRefungiblePieces: boolean; readonly isRepartitionWhileNotOwningAllPieces: boolean; @@ -3130,29 +3180,29 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletNonfungibleItemData (396) */ - export interface PalletNonfungibleItemData extends Struct { + /** @name PalletNonfungibleItemData (398) */ + interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (398) */ - export interface UpDataStructsPropertyScope extends Enum { + /** @name UpDataStructsPropertyScope (400) */ + interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; readonly isEth: boolean; readonly type: 'None' | 'Rmrk' | 'Eth'; } - /** @name PalletNonfungibleError (400) */ - export interface PalletNonfungibleError extends Enum { + /** @name PalletNonfungibleError (402) */ + interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; readonly isCantBurnNftWithChildren: boolean; readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (401) */ - export interface PalletStructureError extends Enum { + /** @name PalletStructureError (403) */ + interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; readonly isBreadthLimit: boolean; @@ -3160,8 +3210,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletRmrkCoreError (402) */ - export interface PalletRmrkCoreError extends Enum { + /** @name PalletRmrkCoreError (404) */ + interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; readonly isRmrkPropertyValueIsTooLong: boolean; @@ -3184,8 +3234,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } - /** @name PalletRmrkEquipError (404) */ - export interface PalletRmrkEquipError extends Enum { + /** @name PalletRmrkEquipError (406) */ + interface PalletRmrkEquipError extends Enum { readonly isPermissionError: boolean; readonly isNoAvailableBaseId: boolean; readonly isNoAvailablePartId: boolean; @@ -3196,8 +3246,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; } - /** @name PalletEvmError (407) */ - export interface PalletEvmError extends Enum { + /** @name PalletEvmError (409) */ + interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; readonly isPaymentOverflow: boolean; @@ -3207,8 +3257,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (410) */ - export interface FpRpcTransactionStatus extends Struct { + /** @name FpRpcTransactionStatus (412) */ + interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; readonly from: H160; @@ -3218,11 +3268,11 @@ declare module '@polkadot/types/lookup' { readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (412) */ - export interface EthbloomBloom extends U8aFixed {} + /** @name EthbloomBloom (414) */ + interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (414) */ - export interface EthereumReceiptReceiptV3 extends Enum { + /** @name EthereumReceiptReceiptV3 (416) */ + interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; readonly isEip2930: boolean; @@ -3232,23 +3282,23 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (415) */ - export interface EthereumReceiptEip658ReceiptData extends Struct { + /** @name EthereumReceiptEip658ReceiptData (417) */ + interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; readonly logsBloom: EthbloomBloom; readonly logs: Vec; } - /** @name EthereumBlock (416) */ - export interface EthereumBlock extends Struct { + /** @name EthereumBlock (418) */ + interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (417) */ - export interface EthereumHeader extends Struct { + /** @name EthereumHeader (419) */ + interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; readonly beneficiary: H160; @@ -3266,46 +3316,46 @@ declare module '@polkadot/types/lookup' { readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (418) */ - export interface EthereumTypesHashH64 extends U8aFixed {} + /** @name EthereumTypesHashH64 (420) */ + interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (423) */ - export interface PalletEthereumError extends Enum { + /** @name PalletEthereumError (425) */ + interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (424) */ - export interface PalletEvmCoderSubstrateError extends Enum { + /** @name PalletEvmCoderSubstrateError (426) */ + interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name PalletEvmContractHelpersSponsoringModeT (425) */ - export interface PalletEvmContractHelpersSponsoringModeT extends Enum { + /** @name PalletEvmContractHelpersSponsoringModeT (427) */ + interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; readonly isGenerous: boolean; readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (427) */ - export interface PalletEvmContractHelpersError extends Enum { + /** @name PalletEvmContractHelpersError (429) */ + interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly type: 'NoPermission'; } - /** @name PalletEvmMigrationError (428) */ - export interface PalletEvmMigrationError extends Enum { + /** @name PalletEvmMigrationError (430) */ + interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (430) */ - export interface SpRuntimeMultiSignature extends Enum { + /** @name SpRuntimeMultiSignature (432) */ + interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; readonly isSr25519: boolean; @@ -3315,34 +3365,34 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (431) */ - export interface SpCoreEd25519Signature extends U8aFixed {} + /** @name SpCoreEd25519Signature (433) */ + interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (433) */ - export interface SpCoreSr25519Signature extends U8aFixed {} + /** @name SpCoreSr25519Signature (435) */ + interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (434) */ - export interface SpCoreEcdsaSignature extends U8aFixed {} + /** @name SpCoreEcdsaSignature (436) */ + interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (437) */ - export type FrameSystemExtensionsCheckSpecVersion = Null; + /** @name FrameSystemExtensionsCheckSpecVersion (439) */ + type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (438) */ - export type FrameSystemExtensionsCheckGenesis = Null; + /** @name FrameSystemExtensionsCheckGenesis (440) */ + type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (441) */ - export interface FrameSystemExtensionsCheckNonce extends Compact {} + /** @name FrameSystemExtensionsCheckNonce (443) */ + interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (442) */ - export type FrameSystemExtensionsCheckWeight = Null; + /** @name FrameSystemExtensionsCheckWeight (444) */ + type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (443) */ - export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (445) */ + interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (444) */ - export type OpalRuntimeRuntime = Null; + /** @name OpalRuntimeRuntime (446) */ + type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (445) */ - export type PalletEthereumFakeTransactionFinalizer = Null; + /** @name PalletEthereumFakeTransactionFinalizer (447) */ + type PalletEthereumFakeTransactionFinalizer = Null; } // declare module From 45948719b712143787abaa9e67deba968ee98801 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 16 Aug 2022 14:44:49 +0000 Subject: [PATCH 0423/1274] chore: bump versions, update CHANGELOGs --- client/rpc/CHANGELOG.md | 11 ++++++++ client/rpc/Cargo.toml | 2 +- crates/evm-coder/CHANGELOG.md | 10 ++++++++ crates/evm-coder/Cargo.toml | 2 +- node/cli/CHANGELOG.md | 15 +++++++++++ node/cli/Cargo.toml | 2 +- node/rpc/CHANGELOG.md | 10 ++++++++ node/rpc/Cargo.toml | 2 +- pallets/common/CHANGELOG.md | 24 ++++++++++++++--- pallets/common/Cargo.toml | 2 +- pallets/configuration/CHANGELOG.md | 6 +++++ pallets/configuration/Cargo.toml | 2 +- pallets/evm-coder-substrate/CHANGELOG.md | 16 +++++++++--- pallets/evm-coder-substrate/Cargo.toml | 2 +- pallets/evm-contract-helpers/CHANGELOG.md | 10 ++++++++ pallets/evm-contract-helpers/Cargo.toml | 2 +- pallets/evm-migration/CHANGELOG.md | 17 ++++++++++++ pallets/evm-migration/Cargo.toml | 2 +- pallets/evm-transaction-payment/CHANGELOG.md | 10 ++++++++ pallets/evm-transaction-payment/Cargo.toml | 2 +- pallets/fungible/CHANGELOG.md | 25 +++++++++++++++--- pallets/fungible/Cargo.toml | 2 +- pallets/inflation/CHANGELOG.md | 10 ++++++++ pallets/inflation/Cargo.toml | 2 +- pallets/nonfungible/CHANGELOG.md | 22 +++++++++++++++- pallets/nonfungible/Cargo.toml | 2 +- pallets/proxy-rmrk-core/CHANGELOG.md | 17 ++++++++++++ pallets/proxy-rmrk-core/Cargo.toml | 2 +- pallets/proxy-rmrk-equip/CHANGELOG.md | 17 ++++++++++++ pallets/proxy-rmrk-equip/Cargo.toml | 2 +- pallets/refungible/CHANGELOG.md | 19 ++++++++++++++ pallets/refungible/Cargo.toml | 2 +- pallets/scheduler/CHANGELOG.md | 10 ++++++++ pallets/scheduler/Cargo.toml | 2 +- pallets/structure/CHANGELOG.md | 10 ++++++++ pallets/structure/Cargo.toml | 2 +- pallets/unique/CHANGELOG.md | 27 ++++++++++++++++++++ pallets/unique/Cargo.toml | 2 +- primitives/common/CHANGELOG.md | 8 ++++++ primitives/common/Cargo.toml | 2 +- primitives/data-structs/CHANGELOG.md | 12 ++++++++- primitives/data-structs/Cargo.toml | 2 +- primitives/rmrk-rpc/CHANGELOG.md | 10 ++++++++ primitives/rmrk-rpc/Cargo.toml | 2 +- primitives/rpc/CHANGELOG.md | 13 +++++++++- primitives/rpc/Cargo.toml | 2 +- runtime/opal/CHANGELOG.md | 17 +++++++++++- runtime/opal/Cargo.toml | 2 +- runtime/tests/CHANGELOG.md | 18 +++++++++++++ runtime/tests/Cargo.toml | 2 +- 50 files changed, 374 insertions(+), 40 deletions(-) create mode 100644 crates/evm-coder/CHANGELOG.md create mode 100644 node/cli/CHANGELOG.md create mode 100644 node/rpc/CHANGELOG.md create mode 100644 pallets/configuration/CHANGELOG.md create mode 100644 pallets/evm-contract-helpers/CHANGELOG.md create mode 100644 pallets/evm-migration/CHANGELOG.md create mode 100644 pallets/evm-transaction-payment/CHANGELOG.md create mode 100644 pallets/inflation/CHANGELOG.md create mode 100644 pallets/proxy-rmrk-core/CHANGELOG.md create mode 100644 pallets/proxy-rmrk-equip/CHANGELOG.md create mode 100644 pallets/scheduler/CHANGELOG.md create mode 100644 pallets/structure/CHANGELOG.md create mode 100644 primitives/common/CHANGELOG.md create mode 100644 primitives/rmrk-rpc/CHANGELOG.md create mode 100644 runtime/tests/CHANGELOG.md diff --git a/client/rpc/CHANGELOG.md b/client/rpc/CHANGELOG.md index b423fc0e6a..2b6a8e5217 100644 --- a/client/rpc/CHANGELOG.md +++ b/client/rpc/CHANGELOG.md @@ -1,3 +1,14 @@ + +## [v0.1.3] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b + # Change Log All notable changes to this project will be documented in this file. diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index e69679e775..8ff392c5e7 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uc-rpc" -version = "0.1.2" +version = "0.1.3" license = "GPLv3" edition = "2021" diff --git a/crates/evm-coder/CHANGELOG.md b/crates/evm-coder/CHANGELOG.md new file mode 100644 index 0000000000..732ab15dc7 --- /dev/null +++ b/crates/evm-coder/CHANGELOG.md @@ -0,0 +1,10 @@ + +## [v0.1.1] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b \ No newline at end of file diff --git a/crates/evm-coder/Cargo.toml b/crates/evm-coder/Cargo.toml index 4f18ccd8aa..52b95c2505 100644 --- a/crates/evm-coder/Cargo.toml +++ b/crates/evm-coder/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "evm-coder" -version = "0.1.0" +version = "0.1.1" license = "GPLv3" edition = "2021" diff --git a/node/cli/CHANGELOG.md b/node/cli/CHANGELOG.md new file mode 100644 index 0000000000..8dcd41c277 --- /dev/null +++ b/node/cli/CHANGELOG.md @@ -0,0 +1,15 @@ + +## [v0.9.24] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- refactor: Use export-genesis state from cumulus e1980179e647db8b299cca32cdc9e2b3bf5e51b2 + +We had our implementation for some reason, however it is now broken, and +I see no reason to keep it, as upstream implements exact same options + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 3919e90c58..c4c888f3b9 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -290,7 +290,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'unique-node' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.9.24' +version = "0.9.24" [[bin]] name = 'unique-collator' diff --git a/node/rpc/CHANGELOG.md b/node/rpc/CHANGELOG.md new file mode 100644 index 0000000000..732ab15dc7 --- /dev/null +++ b/node/rpc/CHANGELOG.md @@ -0,0 +1,10 @@ + +## [v0.1.1] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b \ No newline at end of file diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index 6a684ba9a1..d8f4649fe6 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unique-rpc" -version = "0.1.0" +version = "0.1.1" authors = ['Unique Network '] license = 'GPLv3' edition = "2021" diff --git a/pallets/common/CHANGELOG.md b/pallets/common/CHANGELOG.md index 8662e22e61..c4a0cb072e 100644 --- a/pallets/common/CHANGELOG.md +++ b/pallets/common/CHANGELOG.md @@ -1,3 +1,23 @@ + +## [v0.1.5] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- refactor: Switch to new prefix removal methods 26734e9567589d75cdd99e404eabf11d5a97d975 + +New methods allows to call `remove_prefix` with limit multiple times +in the same block +However, we don't use prefix removal limits, so upgrade is +straightforward + +Upstream-Change: https://github.com/paritytech/substrate/pull/11490 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b + # Change Log All notable changes to this project will be documented in this file. @@ -18,6 +38,4 @@ All notable changes to this project will be documented in this file. ### Added - Implementation of RPC method `token_owners` returning 10 owners in no particular order. - This was an internal request to improve the web interface and support fractionalization event. - - \ No newline at end of file + This was an internal request to improve the web interface and support fractionalization event. \ No newline at end of file diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index 7980f772d9..8139686784 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-common" -version = "0.1.4" +version = "0.1.5" license = "GPLv3" edition = "2021" diff --git a/pallets/configuration/CHANGELOG.md b/pallets/configuration/CHANGELOG.md new file mode 100644 index 0000000000..20e9e64fc7 --- /dev/null +++ b/pallets/configuration/CHANGELOG.md @@ -0,0 +1,6 @@ + +## [v0.1.1] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a \ No newline at end of file diff --git a/pallets/configuration/Cargo.toml b/pallets/configuration/Cargo.toml index 844e109a38..8169a27735 100644 --- a/pallets/configuration/Cargo.toml +++ b/pallets/configuration/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-configuration" -version = "0.1.0" +version = "0.1.1" edition = "2021" [dependencies] diff --git a/pallets/evm-coder-substrate/CHANGELOG.md b/pallets/evm-coder-substrate/CHANGELOG.md index ec2a0a96ef..9cd7e92470 100644 --- a/pallets/evm-coder-substrate/CHANGELOG.md +++ b/pallets/evm-coder-substrate/CHANGELOG.md @@ -1,3 +1,14 @@ + +## [v0.1.3] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b + # Change Log All notable changes to this project will be documented in this file. @@ -6,7 +17,4 @@ All notable changes to this project will be documented in this file. ### Fixed - - Issue with error not being thrown when non existing function is called on collection contract - - - \ No newline at end of file + - Issue with error not being thrown when non existing function is called on collection contract \ No newline at end of file diff --git a/pallets/evm-coder-substrate/Cargo.toml b/pallets/evm-coder-substrate/Cargo.toml index bbc54a0194..94fa572dfa 100644 --- a/pallets/evm-coder-substrate/Cargo.toml +++ b/pallets/evm-coder-substrate/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-evm-coder-substrate" -version = "0.1.2" +version = "0.1.3" license = "GPLv3" edition = "2021" diff --git a/pallets/evm-contract-helpers/CHANGELOG.md b/pallets/evm-contract-helpers/CHANGELOG.md new file mode 100644 index 0000000000..830ad22333 --- /dev/null +++ b/pallets/evm-contract-helpers/CHANGELOG.md @@ -0,0 +1,10 @@ + +## [v0.1.2] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b \ No newline at end of file diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index e6908dfea0..0f5e242f9b 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-evm-contract-helpers" -version = "0.1.1" +version = "0.1.2" license = "GPLv3" edition = "2021" diff --git a/pallets/evm-migration/CHANGELOG.md b/pallets/evm-migration/CHANGELOG.md new file mode 100644 index 0000000000..1e324e9a52 --- /dev/null +++ b/pallets/evm-migration/CHANGELOG.md @@ -0,0 +1,17 @@ + +## [v0.1.1] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- refactor: Remove `#[transactional]` from extrinsics 7fd36cea2f6e00c02c67ccc1de9649ae404efd31 + +Every extrinsic now runs in transaction implicitly, and +`#[transactional]` on pallet dispatchable is now meaningless + +Upstream-Change: https://github.com/paritytech/substrate/issues/10806 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b \ No newline at end of file diff --git a/pallets/evm-migration/Cargo.toml b/pallets/evm-migration/Cargo.toml index 3ef78a066a..86645e8201 100644 --- a/pallets/evm-migration/Cargo.toml +++ b/pallets/evm-migration/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-evm-migration" -version = "0.1.0" +version = "0.1.1" license = "GPLv3" edition = "2021" diff --git a/pallets/evm-transaction-payment/CHANGELOG.md b/pallets/evm-transaction-payment/CHANGELOG.md new file mode 100644 index 0000000000..732ab15dc7 --- /dev/null +++ b/pallets/evm-transaction-payment/CHANGELOG.md @@ -0,0 +1,10 @@ + +## [v0.1.1] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b \ No newline at end of file diff --git a/pallets/evm-transaction-payment/Cargo.toml b/pallets/evm-transaction-payment/Cargo.toml index 2d21b6836a..3ec89bd4e5 100644 --- a/pallets/evm-transaction-payment/Cargo.toml +++ b/pallets/evm-transaction-payment/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-evm-transaction-payment" -version = "0.1.0" +version = "0.1.1" license = "GPLv3" edition = "2021" diff --git a/pallets/fungible/CHANGELOG.md b/pallets/fungible/CHANGELOG.md index 9967b4f69d..21ca551a3d 100644 --- a/pallets/fungible/CHANGELOG.md +++ b/pallets/fungible/CHANGELOG.md @@ -1,3 +1,23 @@ + +## [v0.1.3] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- refactor: Switch to new prefix removal methods 26734e9567589d75cdd99e404eabf11d5a97d975 + +New methods allows to call `remove_prefix` with limit multiple times +in the same block +However, we don't use prefix removal limits, so upgrade is +straightforward + +Upstream-Change: https://github.com/paritytech/substrate/pull/11490 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b + # Change Log All notable changes to this project will be documented in this file. @@ -13,7 +33,4 @@ All notable changes to this project will be documented in this file. ### Added - Implementation of RPC method `token_owners` returning 10 owners in no particular order. - This was an internal request to improve the web interface and support fractionalization event. - - - \ No newline at end of file + This was an internal request to improve the web interface and support fractionalization event. \ No newline at end of file diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index e28812a75c..f63656e239 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-fungible" -version = "0.1.2" +version = "0.1.3" license = "GPLv3" edition = "2021" diff --git a/pallets/inflation/CHANGELOG.md b/pallets/inflation/CHANGELOG.md new file mode 100644 index 0000000000..732ab15dc7 --- /dev/null +++ b/pallets/inflation/CHANGELOG.md @@ -0,0 +1,10 @@ + +## [v0.1.1] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b \ No newline at end of file diff --git a/pallets/inflation/Cargo.toml b/pallets/inflation/Cargo.toml index f5fbe8130a..74ceac9569 100644 --- a/pallets/inflation/Cargo.toml +++ b/pallets/inflation/Cargo.toml @@ -9,7 +9,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'pallet-inflation' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = "0.1.0" +version = "0.1.1" [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] diff --git a/pallets/nonfungible/CHANGELOG.md b/pallets/nonfungible/CHANGELOG.md index 0548d839e4..1ebb378a6b 100644 --- a/pallets/nonfungible/CHANGELOG.md +++ b/pallets/nonfungible/CHANGELOG.md @@ -1,3 +1,23 @@ + +## [v0.1.4] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- refactor: Switch to new prefix removal methods 26734e9567589d75cdd99e404eabf11d5a97d975 + +New methods allows to call `remove_prefix` with limit multiple times +in the same block +However, we don't use prefix removal limits, so upgrade is +straightforward + +Upstream-Change: https://github.com/paritytech/substrate/pull/11490 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b + # Change Log All notable changes to this project will be documented in this file. @@ -18,4 +38,4 @@ All notable changes to this project will be documented in this file. - Implementation of RPC method `token_owners`. For reasons of compatibility with this pallet, returns only one owner if token exists. - This was an internal request to improve the web interface and support fractionalization event. + This was an internal request to improve the web interface and support fractionalization event. \ No newline at end of file diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index 283559eb51..9b6cf37319 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-nonfungible" -version = "0.1.3" +version = "0.1.4" license = "GPLv3" edition = "2021" diff --git a/pallets/proxy-rmrk-core/CHANGELOG.md b/pallets/proxy-rmrk-core/CHANGELOG.md new file mode 100644 index 0000000000..e8229c5612 --- /dev/null +++ b/pallets/proxy-rmrk-core/CHANGELOG.md @@ -0,0 +1,17 @@ + +## [v0.1.2] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- refactor: Remove `#[transactional]` from extrinsics 7fd36cea2f6e00c02c67ccc1de9649ae404efd31 + +Every extrinsic now runs in transaction implicitly, and +`#[transactional]` on pallet dispatchable is now meaningless + +Upstream-Change: https://github.com/paritytech/substrate/issues/10806 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b \ No newline at end of file diff --git a/pallets/proxy-rmrk-core/Cargo.toml b/pallets/proxy-rmrk-core/Cargo.toml index e5d7d16002..e47c36f131 100644 --- a/pallets/proxy-rmrk-core/Cargo.toml +++ b/pallets/proxy-rmrk-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-rmrk-core" -version = "0.1.1" +version = "0.1.2" license = "GPLv3" edition = "2021" diff --git a/pallets/proxy-rmrk-equip/CHANGELOG.md b/pallets/proxy-rmrk-equip/CHANGELOG.md new file mode 100644 index 0000000000..e8229c5612 --- /dev/null +++ b/pallets/proxy-rmrk-equip/CHANGELOG.md @@ -0,0 +1,17 @@ + +## [v0.1.2] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- refactor: Remove `#[transactional]` from extrinsics 7fd36cea2f6e00c02c67ccc1de9649ae404efd31 + +Every extrinsic now runs in transaction implicitly, and +`#[transactional]` on pallet dispatchable is now meaningless + +Upstream-Change: https://github.com/paritytech/substrate/issues/10806 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b \ No newline at end of file diff --git a/pallets/proxy-rmrk-equip/Cargo.toml b/pallets/proxy-rmrk-equip/Cargo.toml index 638e74593e..71e4ed60bd 100644 --- a/pallets/proxy-rmrk-equip/Cargo.toml +++ b/pallets/proxy-rmrk-equip/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-rmrk-equip" -version = "0.1.1" +version = "0.1.2" license = "GPLv3" edition = "2021" diff --git a/pallets/refungible/CHANGELOG.md b/pallets/refungible/CHANGELOG.md index 73ef9fbbc4..795d1258a7 100644 --- a/pallets/refungible/CHANGELOG.md +++ b/pallets/refungible/CHANGELOG.md @@ -3,6 +3,25 @@ All notable changes to this project will be documented in this file. +## [v0.2.3] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- refactor: Switch to new prefix removal methods 26734e9567589d75cdd99e404eabf11d5a97d975 + +New methods allows to call `remove_prefix` with limit multiple times +in the same block +However, we don't use prefix removal limits, so upgrade is +straightforward + +Upstream-Change: https://github.com/paritytech/substrate/pull/11490 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b + ## [v0.2.2] 2022-08-04 ### Product changes diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index 84414c233f..b542ff31b6 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-refungible" -version = "0.2.2" +version = "0.2.3" license = "GPLv3" edition = "2021" diff --git a/pallets/scheduler/CHANGELOG.md b/pallets/scheduler/CHANGELOG.md new file mode 100644 index 0000000000..732ab15dc7 --- /dev/null +++ b/pallets/scheduler/CHANGELOG.md @@ -0,0 +1,10 @@ + +## [v0.1.1] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b \ No newline at end of file diff --git a/pallets/scheduler/Cargo.toml b/pallets/scheduler/Cargo.toml index 31f272ae8f..9537aefa15 100644 --- a/pallets/scheduler/Cargo.toml +++ b/pallets/scheduler/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-unique-scheduler" -version = "0.1.0" +version = "0.1.1" authors = ["Unique Network "] edition = "2021" license = "GPLv3" diff --git a/pallets/structure/CHANGELOG.md b/pallets/structure/CHANGELOG.md new file mode 100644 index 0000000000..830ad22333 --- /dev/null +++ b/pallets/structure/CHANGELOG.md @@ -0,0 +1,10 @@ + +## [v0.1.2] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b \ No newline at end of file diff --git a/pallets/structure/Cargo.toml b/pallets/structure/Cargo.toml index 20759a82b8..466289836d 100644 --- a/pallets/structure/Cargo.toml +++ b/pallets/structure/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-structure" -version = "0.1.1" +version = "0.1.2" edition = "2021" [dependencies] diff --git a/pallets/unique/CHANGELOG.md b/pallets/unique/CHANGELOG.md index fbe3ebd684..acfa47cee9 100644 --- a/pallets/unique/CHANGELOG.md +++ b/pallets/unique/CHANGELOG.md @@ -1,3 +1,30 @@ + +## [v0.1.3] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- refactor: Remove `#[transactional]` from extrinsics 7fd36cea2f6e00c02c67ccc1de9649ae404efd31 + +Every extrinsic now runs in transaction implicitly, and +`#[transactional]` on pallet dispatchable is now meaningless + +Upstream-Change: https://github.com/paritytech/substrate/issues/10806 + +- refactor: Switch to new prefix removal methods 26734e9567589d75cdd99e404eabf11d5a97d975 + +New methods allows to call `remove_prefix` with limit multiple times +in the same block +However, we don't use prefix removal limits, so upgrade is +straightforward + +Upstream-Change: https://github.com/paritytech/substrate/pull/11490 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b + # Change Log All notable changes to this project will be documented in this file. diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index 6ef57c677f..67fae52d66 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -9,7 +9,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'pallet-unique' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = "0.1.2" +version = "0.1.3" [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] diff --git a/primitives/common/CHANGELOG.md b/primitives/common/CHANGELOG.md new file mode 100644 index 0000000000..8c560e7fd1 --- /dev/null +++ b/primitives/common/CHANGELOG.md @@ -0,0 +1,8 @@ + +## [v0.9.25] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade up-common to polkadot-v0.9.26 3df3531cadd6d2ed23afe838d3a71321b0f12c2e \ No newline at end of file diff --git a/primitives/common/Cargo.toml b/primitives/common/Cargo.toml index 6a5fac2265..a31b3a0e73 100644 --- a/primitives/common/Cargo.toml +++ b/primitives/common/Cargo.toml @@ -6,7 +6,7 @@ homepage = 'https://unique.network' license = 'All Rights Reserved' name = 'up-common' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.9.24' +version = "0.9.25" [features] default = ['std'] diff --git a/primitives/data-structs/CHANGELOG.md b/primitives/data-structs/CHANGELOG.md index 9671afb6fa..03bded8ed1 100644 --- a/primitives/data-structs/CHANGELOG.md +++ b/primitives/data-structs/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file. +## [v0.2.2] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b + ## [v0.2.1] 2022-08-04 ### Product changes @@ -26,4 +36,4 @@ multiple users into `RefungibleMultipleItems` call. - Type aliases `CollectionName`, `CollectionDescription`, `CollectionTokenPrefix` ## [v0.1.1] - 2022-07-22 ### Added -- Аields with properties to `CreateReFungibleData` and `CreateRefungibleExData`. +- Аields with properties to `CreateReFungibleData` and `CreateRefungibleExData`. \ No newline at end of file diff --git a/primitives/data-structs/Cargo.toml b/primitives/data-structs/Cargo.toml index 71da24e08b..e8c94f47d0 100644 --- a/primitives/data-structs/Cargo.toml +++ b/primitives/data-structs/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = 'GPLv3' homepage = "https://unique.network" repository = 'https://github.com/UniqueNetwork/unique-chain' -version = "0.2.1" +version = "0.2.2" [dependencies] scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/primitives/rmrk-rpc/CHANGELOG.md b/primitives/rmrk-rpc/CHANGELOG.md new file mode 100644 index 0000000000..b6bf56646d --- /dev/null +++ b/primitives/rmrk-rpc/CHANGELOG.md @@ -0,0 +1,10 @@ + +## [v0.0.2] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b \ No newline at end of file diff --git a/primitives/rmrk-rpc/Cargo.toml b/primitives/rmrk-rpc/Cargo.toml index 2b151b91f3..569a3cc16d 100644 --- a/primitives/rmrk-rpc/Cargo.toml +++ b/primitives/rmrk-rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rmrk-rpc" -version = "0.0.1" +version = "0.0.2" license = "" edition = "2021" diff --git a/primitives/rpc/CHANGELOG.md b/primitives/rpc/CHANGELOG.md index a7a01eb6d8..a03c90bf96 100644 --- a/primitives/rpc/CHANGELOG.md +++ b/primitives/rpc/CHANGELOG.md @@ -1,3 +1,14 @@ + +## [v0.1.3] 2022-08-16 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b + # Change Log All notable changes to this project will be documented in this file. @@ -7,4 +18,4 @@ All notable changes to this project will be documented in this file. ### Added - Implementation of RPC method `token_owners` returning 10 owners in no particular order. - This was an internal request to improve the web interface and support fractionalization event. \ No newline at end of file + This was an internal request to improve the web interface and support fractionalization event. \ No newline at end of file diff --git a/primitives/rpc/Cargo.toml b/primitives/rpc/Cargo.toml index 0b59d29166..afe081658d 100644 --- a/primitives/rpc/Cargo.toml +++ b/primitives/rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "up-rpc" -version = "0.1.2" +version = "0.1.3" license = "GPLv3" edition = "2021" diff --git a/runtime/opal/CHANGELOG.md b/runtime/opal/CHANGELOG.md index 57df883e23..4d24f87673 100644 --- a/runtime/opal/CHANGELOG.md +++ b/runtime/opal/CHANGELOG.md @@ -1,3 +1,18 @@ + +## [v0.9.25] 2022-08-16 + +### Bugfixes + +- Add missing config keys 74f532ac28dce15c15e7d576c074a58eba658c08 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b + # Change Log -All notable changes to this project will be documented in this file. +All notable changes to this project will be documented in this file. \ No newline at end of file diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 40dde27f7f..ca9decde4f 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -10,7 +10,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'opal-runtime' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.9.24' +version = "0.9.24" [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] diff --git a/runtime/tests/CHANGELOG.md b/runtime/tests/CHANGELOG.md new file mode 100644 index 0000000000..08f2af5bc9 --- /dev/null +++ b/runtime/tests/CHANGELOG.md @@ -0,0 +1,18 @@ + +## [v0.1.1] 2022-08-16 + +### Bugfixes + +- After conflicts b66d0b01b670bbbdf05431c6636a0300907f0ec8 + +- Add missing config keys 74f532ac28dce15c15e7d576c074a58eba658c08 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade test runtime bdd7247a3eaa6f6d458f4320a8bbee98770da2b3 + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b \ No newline at end of file diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index 7101752af8..0a7d259288 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tests" -version = "0.1.0" +version = "0.1.1" edition = "2021" [features] From 300cebfbe22bbbc10231971311f0db94ee049caa Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 16 Aug 2022 17:57:40 +0300 Subject: [PATCH 0424/1274] try-runtime workflow --- .docker/Dockerfile-try-runtime | 2 +- ...-compose-try-runtime.yaml => docker-compose-try-runtime.yml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename .docker/{docker-compose-try-runtime.yaml => docker-compose-try-runtime.yml} (100%) diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index 0aae9a3e17..20ba8d9bb5 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -37,7 +37,7 @@ ARG FEATURE= ARG REPO_URL= ARG BRANCH= -RUN git clone $REPO_URL -b $BRANCH && \ +RUN git clone $REPO_URL -b $BRANCH . && \ cargo build --features=$FEATURE --$PROFILE diff --git a/.docker/docker-compose-try-runtime.yaml b/.docker/docker-compose-try-runtime.yml similarity index 100% rename from .docker/docker-compose-try-runtime.yaml rename to .docker/docker-compose-try-runtime.yml From da5862baca6eccfb0b29ac624cfa29d30eb0870b Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 16 Aug 2022 17:58:49 +0300 Subject: [PATCH 0425/1274] switch from develop branch to master branch --- .github/workflows/try-runtime.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index f9b93bea83..7f2e9804b6 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -5,7 +5,7 @@ on: # Triggers the workflow on push or pull request events but only for the master branch pull_request: branches: - - develop + - master types: - opened - reopened From 2aa37c4aa188aa1a5e306a759cb27fe8871c13a2 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 16 Aug 2022 18:13:06 +0300 Subject: [PATCH 0426/1274] fix: try-runtime build Signed-off-by: Yaroslav Bolyukin --- runtime/common/runtime_apis.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index 268e1d93e2..33bebf4d1e 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -717,13 +717,13 @@ macro_rules! impl_common_runtime_apis { #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { - fn on_runtime_upgrade() -> (Weight, Weight) { + fn on_runtime_upgrade() -> (frame_support::pallet_prelude::Weight, frame_support::pallet_prelude::Weight) { log::info!("try-runtime::on_runtime_upgrade unique-chain."); let weight = Executive::try_runtime_upgrade().unwrap(); - (weight, RuntimeBlockWeights::get().max_block) + (weight, crate::config::substrate::RuntimeBlockWeights::get().max_block) } - fn execute_block_no_check(block: Block) -> Weight { + fn execute_block_no_check(block: Block) -> frame_support::pallet_prelude::Weight { Executive::execute_block_no_check(block) } } From 3d43cce592db583beac33fb177927a1b15d448de Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 16 Aug 2022 18:13:06 +0300 Subject: [PATCH 0427/1274] fix: try-runtime build Signed-off-by: Yaroslav Bolyukin --- runtime/common/runtime_apis.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index 268e1d93e2..33bebf4d1e 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -717,13 +717,13 @@ macro_rules! impl_common_runtime_apis { #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { - fn on_runtime_upgrade() -> (Weight, Weight) { + fn on_runtime_upgrade() -> (frame_support::pallet_prelude::Weight, frame_support::pallet_prelude::Weight) { log::info!("try-runtime::on_runtime_upgrade unique-chain."); let weight = Executive::try_runtime_upgrade().unwrap(); - (weight, RuntimeBlockWeights::get().max_block) + (weight, crate::config::substrate::RuntimeBlockWeights::get().max_block) } - fn execute_block_no_check(block: Block) -> Weight { + fn execute_block_no_check(block: Block) -> frame_support::pallet_prelude::Weight { Executive::execute_block_no_check(block) } } From af74a777297d52a91a9268da3f31c4dd5df40650 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 16 Aug 2022 15:16:59 +0000 Subject: [PATCH 0428/1274] fix: runtimes and node version --- Cargo.lock | 54 ++++++++++++++++++------------------- node/cli/CHANGELOG.md | 2 +- node/cli/Cargo.toml | 2 +- runtime/opal/CHANGELOG.md | 4 +-- runtime/opal/Cargo.toml | 2 +- runtime/quartz/CHANGELOG.md | 15 +++++++++++ runtime/quartz/Cargo.toml | 2 +- runtime/unique/CHANGELOG.md | 15 +++++++++++ runtime/unique/Cargo.toml | 2 +- 9 files changed, 64 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2f8ecab7c3..349987a982 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2204,7 +2204,7 @@ dependencies = [ [[package]] name = "evm-coder" -version = "0.1.0" +version = "0.1.1" dependencies = [ "ethereum", "evm-coder-macros", @@ -5166,7 +5166,7 @@ checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" [[package]] name = "opal-runtime" -version = "0.9.24" +version = "0.9.27" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", @@ -5552,7 +5552,7 @@ dependencies = [ [[package]] name = "pallet-common" -version = "0.1.4" +version = "0.1.5" dependencies = [ "ethereum", "evm-coder", @@ -5573,7 +5573,7 @@ dependencies = [ [[package]] name = "pallet-configuration" -version = "0.1.0" +version = "0.1.1" dependencies = [ "fp-evm", "frame-support", @@ -5715,7 +5715,7 @@ dependencies = [ [[package]] name = "pallet-evm-coder-substrate" -version = "0.1.2" +version = "0.1.3" dependencies = [ "ethereum", "evm-coder", @@ -5733,7 +5733,7 @@ dependencies = [ [[package]] name = "pallet-evm-contract-helpers" -version = "0.1.1" +version = "0.1.2" dependencies = [ "evm-coder", "fp-evm-mapping", @@ -5754,7 +5754,7 @@ dependencies = [ [[package]] name = "pallet-evm-migration" -version = "0.1.0" +version = "0.1.1" dependencies = [ "fp-evm", "frame-benchmarking", @@ -5771,7 +5771,7 @@ dependencies = [ [[package]] name = "pallet-evm-transaction-payment" -version = "0.1.0" +version = "0.1.1" dependencies = [ "fp-evm", "fp-evm-mapping", @@ -5790,7 +5790,7 @@ dependencies = [ [[package]] name = "pallet-fungible" -version = "0.1.2" +version = "0.1.3" dependencies = [ "ethereum", "evm-coder", @@ -5902,7 +5902,7 @@ dependencies = [ [[package]] name = "pallet-inflation" -version = "0.1.0" +version = "0.1.1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6032,7 +6032,7 @@ dependencies = [ [[package]] name = "pallet-nonfungible" -version = "0.1.3" +version = "0.1.4" dependencies = [ "ethereum", "evm-coder", @@ -6154,7 +6154,7 @@ dependencies = [ [[package]] name = "pallet-refungible" -version = "0.2.2" +version = "0.2.3" dependencies = [ "derivative", "ethereum", @@ -6177,7 +6177,7 @@ dependencies = [ [[package]] name = "pallet-rmrk-core" -version = "0.1.1" +version = "0.1.2" dependencies = [ "derivative", "frame-benchmarking", @@ -6198,7 +6198,7 @@ dependencies = [ [[package]] name = "pallet-rmrk-equip" -version = "0.1.1" +version = "0.1.2" dependencies = [ "frame-benchmarking", "frame-support", @@ -6328,7 +6328,7 @@ dependencies = [ [[package]] name = "pallet-structure" -version = "0.1.1" +version = "0.1.2" dependencies = [ "frame-benchmarking", "frame-support", @@ -6473,7 +6473,7 @@ dependencies = [ [[package]] name = "pallet-unique" -version = "0.1.2" +version = "0.1.3" dependencies = [ "ethereum", "evm-coder", @@ -6497,7 +6497,7 @@ dependencies = [ [[package]] name = "pallet-unique-scheduler" -version = "0.1.0" +version = "0.1.1" dependencies = [ "frame-benchmarking", "frame-support", @@ -8371,7 +8371,7 @@ dependencies = [ [[package]] name = "quartz-runtime" -version = "0.9.24" +version = "0.9.27" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", @@ -8816,7 +8816,7 @@ dependencies = [ [[package]] name = "rmrk-rpc" -version = "0.0.1" +version = "0.0.2" dependencies = [ "parity-scale-codec 2.3.1", "rmrk-traits", @@ -11644,7 +11644,7 @@ dependencies = [ [[package]] name = "tests" -version = "0.1.0" +version = "0.1.1" dependencies = [ "evm-coder", "fp-evm-mapping", @@ -12144,7 +12144,7 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "uc-rpc" -version = "0.1.2" +version = "0.1.3" dependencies = [ "anyhow", "jsonrpsee", @@ -12223,7 +12223,7 @@ checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" [[package]] name = "unique-node" -version = "0.9.24" +version = "0.9.27" dependencies = [ "clap", "cumulus-client-cli", @@ -12311,7 +12311,7 @@ dependencies = [ [[package]] name = "unique-rpc" -version = "0.1.0" +version = "0.1.1" dependencies = [ "fc-db", "fc-mapping-sync", @@ -12360,7 +12360,7 @@ dependencies = [ [[package]] name = "unique-runtime" -version = "0.9.24" +version = "0.9.27" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", @@ -12473,7 +12473,7 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "up-common" -version = "0.9.24" +version = "0.9.25" dependencies = [ "fp-rpc", "frame-support", @@ -12486,7 +12486,7 @@ dependencies = [ [[package]] name = "up-data-structs" -version = "0.2.1" +version = "0.2.2" dependencies = [ "derivative", "frame-support", @@ -12504,7 +12504,7 @@ dependencies = [ [[package]] name = "up-rpc" -version = "0.1.2" +version = "0.1.3" dependencies = [ "pallet-common", "pallet-evm", diff --git a/node/cli/CHANGELOG.md b/node/cli/CHANGELOG.md index 8dcd41c277..e6007e524a 100644 --- a/node/cli/CHANGELOG.md +++ b/node/cli/CHANGELOG.md @@ -1,5 +1,5 @@ -## [v0.9.24] 2022-08-16 +## [v0.9.27] 2022-08-16 ### Other changes diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index c4c888f3b9..5a4c597a4b 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -290,7 +290,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'unique-node' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = "0.9.24" +version = "0.9.27" [[bin]] name = 'unique-collator' diff --git a/runtime/opal/CHANGELOG.md b/runtime/opal/CHANGELOG.md index 4d24f87673..b089e17bf4 100644 --- a/runtime/opal/CHANGELOG.md +++ b/runtime/opal/CHANGELOG.md @@ -1,5 +1,5 @@ -## [v0.9.25] 2022-08-16 +## [v0.9.27] 2022-08-16 ### Bugfixes @@ -15,4 +15,4 @@ # Change Log -All notable changes to this project will be documented in this file. \ No newline at end of file +All notable changes to this project will be documented in this file. diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index ca9decde4f..31ad731da2 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -10,7 +10,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'opal-runtime' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = "0.9.24" +version = "0.9.27" [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] diff --git a/runtime/quartz/CHANGELOG.md b/runtime/quartz/CHANGELOG.md index 57df883e23..b089e17bf4 100644 --- a/runtime/quartz/CHANGELOG.md +++ b/runtime/quartz/CHANGELOG.md @@ -1,3 +1,18 @@ + +## [v0.9.27] 2022-08-16 + +### Bugfixes + +- Add missing config keys 74f532ac28dce15c15e7d576c074a58eba658c08 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b + # Change Log All notable changes to this project will be documented in this file. diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index c116c17c9a..5c7cabad83 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -10,7 +10,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'quartz-runtime' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.9.24' +version = '0.9.27' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] diff --git a/runtime/unique/CHANGELOG.md b/runtime/unique/CHANGELOG.md index 57df883e23..b089e17bf4 100644 --- a/runtime/unique/CHANGELOG.md +++ b/runtime/unique/CHANGELOG.md @@ -1,3 +1,18 @@ + +## [v0.9.27] 2022-08-16 + +### Bugfixes + +- Add missing config keys 74f532ac28dce15c15e7d576c074a58eba658c08 + +### Other changes + +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a + +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 + +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b + # Change Log All notable changes to this project will be documented in this file. diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 61bcac99c5..20eadb9523 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -10,7 +10,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'unique-runtime' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.9.24' +version = '0.9.27' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] From 16de0e59abef41c645137e6ba1a3afc598b492c6 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 16 Aug 2022 15:33:03 +0000 Subject: [PATCH 0429/1274] fix: CHANGELOGs format --- client/rpc/CHANGELOG.md | 8 ++++---- pallets/common/CHANGELOG.md | 10 +++++----- pallets/evm-coder-substrate/CHANGELOG.md | 10 +++++----- pallets/fungible/CHANGELOG.md | 10 +++++----- pallets/nonfungible/CHANGELOG.md | 10 +++++----- pallets/unique/CHANGELOG.md | 8 ++++---- primitives/rpc/CHANGELOG.md | 10 +++++----- runtime/opal/CHANGELOG.md | 8 ++++---- runtime/quartz/CHANGELOG.md | 7 ++++--- runtime/unique/CHANGELOG.md | 8 ++++---- 10 files changed, 45 insertions(+), 44 deletions(-) diff --git a/client/rpc/CHANGELOG.md b/client/rpc/CHANGELOG.md index 2b6a8e5217..d51554c30b 100644 --- a/client/rpc/CHANGELOG.md +++ b/client/rpc/CHANGELOG.md @@ -1,3 +1,7 @@ +# Change Log + +All notable changes to this project will be documented in this file. + ## [v0.1.3] 2022-08-16 @@ -9,10 +13,6 @@ - build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b -# Change Log - -All notable changes to this project will be documented in this file. - ## [0.1.2] - 2022-08-12 ### Fixed diff --git a/pallets/common/CHANGELOG.md b/pallets/common/CHANGELOG.md index c4a0cb072e..19c407e60d 100644 --- a/pallets/common/CHANGELOG.md +++ b/pallets/common/CHANGELOG.md @@ -1,3 +1,7 @@ +# Change Log + +All notable changes to this project will be documented in this file. + ## [v0.1.5] 2022-08-16 @@ -18,10 +22,6 @@ Upstream-Change: https://github.com/paritytech/substrate/pull/11490 - build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b -# Change Log - -All notable changes to this project will be documented in this file. - ## [0.1.3] - 2022-07-25 ### Add - Some static property keys and values. @@ -38,4 +38,4 @@ All notable changes to this project will be documented in this file. ### Added - Implementation of RPC method `token_owners` returning 10 owners in no particular order. - This was an internal request to improve the web interface and support fractionalization event. \ No newline at end of file + This was an internal request to improve the web interface and support fractionalization event. diff --git a/pallets/evm-coder-substrate/CHANGELOG.md b/pallets/evm-coder-substrate/CHANGELOG.md index 9cd7e92470..ef5a3fde1e 100644 --- a/pallets/evm-coder-substrate/CHANGELOG.md +++ b/pallets/evm-coder-substrate/CHANGELOG.md @@ -1,3 +1,7 @@ +# Change Log + +All notable changes to this project will be documented in this file. + ## [v0.1.3] 2022-08-16 @@ -9,12 +13,8 @@ - build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b -# Change Log - -All notable changes to this project will be documented in this file. - ## [0.1.2] - 2022-08-12 ### Fixed - - Issue with error not being thrown when non existing function is called on collection contract \ No newline at end of file + - Issue with error not being thrown when non existing function is called on collection contract diff --git a/pallets/fungible/CHANGELOG.md b/pallets/fungible/CHANGELOG.md index 21ca551a3d..94e6403676 100644 --- a/pallets/fungible/CHANGELOG.md +++ b/pallets/fungible/CHANGELOG.md @@ -1,3 +1,7 @@ +# Change Log + +All notable changes to this project will be documented in this file. + ## [v0.1.3] 2022-08-16 @@ -18,10 +22,6 @@ Upstream-Change: https://github.com/paritytech/substrate/pull/11490 - build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b -# Change Log - -All notable changes to this project will be documented in this file. - ## [0.1.2] - 2022-08-04 ### Fixed @@ -33,4 +33,4 @@ All notable changes to this project will be documented in this file. ### Added - Implementation of RPC method `token_owners` returning 10 owners in no particular order. - This was an internal request to improve the web interface and support fractionalization event. \ No newline at end of file + This was an internal request to improve the web interface and support fractionalization event. diff --git a/pallets/nonfungible/CHANGELOG.md b/pallets/nonfungible/CHANGELOG.md index 1ebb378a6b..6bc075a843 100644 --- a/pallets/nonfungible/CHANGELOG.md +++ b/pallets/nonfungible/CHANGELOG.md @@ -1,3 +1,7 @@ +# Change Log + +All notable changes to this project will be documented in this file. + ## [v0.1.4] 2022-08-16 @@ -18,10 +22,6 @@ Upstream-Change: https://github.com/paritytech/substrate/pull/11490 - build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b -# Change Log - -All notable changes to this project will be documented in this file. - ## [0.1.2] - 2022-07-25 ### Changed - New `token_uri` retrieval logic: @@ -38,4 +38,4 @@ All notable changes to this project will be documented in this file. - Implementation of RPC method `token_owners`. For reasons of compatibility with this pallet, returns only one owner if token exists. - This was an internal request to improve the web interface and support fractionalization event. \ No newline at end of file + This was an internal request to improve the web interface and support fractionalization event. diff --git a/pallets/unique/CHANGELOG.md b/pallets/unique/CHANGELOG.md index acfa47cee9..5e8beeffe9 100644 --- a/pallets/unique/CHANGELOG.md +++ b/pallets/unique/CHANGELOG.md @@ -1,3 +1,7 @@ +# Change Log + +All notable changes to this project will be documented in this file. + ## [v0.1.3] 2022-08-16 @@ -25,10 +29,6 @@ Upstream-Change: https://github.com/paritytech/substrate/pull/11490 - build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b -# Change Log - -All notable changes to this project will be documented in this file. - ## [v0.1.1] - 2022-07-25 ### Added - Method for creating `ERC721Metadata` compatible NFT collection. diff --git a/primitives/rpc/CHANGELOG.md b/primitives/rpc/CHANGELOG.md index a03c90bf96..59bdd2c127 100644 --- a/primitives/rpc/CHANGELOG.md +++ b/primitives/rpc/CHANGELOG.md @@ -1,3 +1,7 @@ +# Change Log + +All notable changes to this project will be documented in this file. + ## [v0.1.3] 2022-08-16 @@ -9,13 +13,9 @@ - build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b -# Change Log - -All notable changes to this project will be documented in this file. - ## [0.1.1] - 2022-07-14 ### Added - Implementation of RPC method `token_owners` returning 10 owners in no particular order. - This was an internal request to improve the web interface and support fractionalization event. \ No newline at end of file + This was an internal request to improve the web interface and support fractionalization event. diff --git a/runtime/opal/CHANGELOG.md b/runtime/opal/CHANGELOG.md index b089e17bf4..574592dbcf 100644 --- a/runtime/opal/CHANGELOG.md +++ b/runtime/opal/CHANGELOG.md @@ -1,3 +1,7 @@ +# Change Log + +All notable changes to this project will be documented in this file. + ## [v0.9.27] 2022-08-16 @@ -12,7 +16,3 @@ - build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 - build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b - -# Change Log - -All notable changes to this project will be documented in this file. diff --git a/runtime/quartz/CHANGELOG.md b/runtime/quartz/CHANGELOG.md index b089e17bf4..31f9693ada 100644 --- a/runtime/quartz/CHANGELOG.md +++ b/runtime/quartz/CHANGELOG.md @@ -1,3 +1,7 @@ +# Change Log + +All notable changes to this project will be documented in this file. + ## [v0.9.27] 2022-08-16 @@ -13,6 +17,3 @@ - build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b -# Change Log - -All notable changes to this project will be documented in this file. diff --git a/runtime/unique/CHANGELOG.md b/runtime/unique/CHANGELOG.md index b089e17bf4..574592dbcf 100644 --- a/runtime/unique/CHANGELOG.md +++ b/runtime/unique/CHANGELOG.md @@ -1,3 +1,7 @@ +# Change Log + +All notable changes to this project will be documented in this file. + ## [v0.9.27] 2022-08-16 @@ -12,7 +16,3 @@ - build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 - build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b - -# Change Log - -All notable changes to this project will be documented in this file. From 4cfc421768bfe264c7b7ca01fe81e5fbbbb9015c Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 16 Aug 2022 15:33:15 +0000 Subject: [PATCH 0430/1274] fix: cargo fmt --- node/cli/src/command.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index e8cff1ffaf..55471393b5 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -407,7 +407,9 @@ pub fn run() -> Result<()> { BenchmarkCmd::Machine(cmd) => { runner.sync_run(|config| cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone())) } - BenchmarkCmd::Overhead(_) | BenchmarkCmd::Extrinsic(_) => Err("Unsupported benchmarking command".into()), + BenchmarkCmd::Overhead(_) | BenchmarkCmd::Extrinsic(_) => { + Err("Unsupported benchmarking command".into()) + } } } Some(Subcommand::TryRuntime(cmd)) => { From d2043ffafec9fb2d44b58639cad263fa1f733324 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 16 Aug 2022 22:39:32 +0300 Subject: [PATCH 0431/1274] update dockerfile for try runtime --- .docker/Dockerfile-try-runtime | 34 +++------------------------ .docker/docker-compose.try-runtime.j2 | 3 --- .github/workflows/try-runtime.yml | 11 ++++----- 3 files changed, 8 insertions(+), 40 deletions(-) diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index 20ba8d9bb5..87ba6ba207 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -36,38 +36,10 @@ ARG PROFILE=release ARG FEATURE= ARG REPO_URL= ARG BRANCH= +ARG FORK_FROM= -RUN git clone $REPO_URL -b $BRANCH . && \ - cargo build --features=$FEATURE --$PROFILE - - -# ===== BUILD POLKADOT ===== -FROM rust-builder as builder-polkadot - -ARG POLKADOT_BUILD_BRANCH= -ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH - -RUN mkdir /unique_parachain WORKDIR /unique_parachain -RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ - cd polkadot && \ - cargo build --release - -# ===== RUN ====== - -FROM ubuntu:20.04 - -ARG FORM_FROM= -ARG FEATURE= - -RUN apt-get -y update && \ - apt-get -y install curl git && \ - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v16.16.0 && \ - nvm use v16.16.0 +RUN git clone $REPO_URL -b $BRANCH . && \ + cargo run --features=FEATURE --release -- try-runtime on-runtime-upgrade live --uri $FORK_FROM -COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ \ No newline at end of file diff --git a/.docker/docker-compose.try-runtime.j2 b/.docker/docker-compose.try-runtime.j2 index 0ee0299570..3ac0439b39 100644 --- a/.docker/docker-compose.try-runtime.j2 +++ b/.docker/docker-compose.try-runtime.j2 @@ -8,8 +8,5 @@ services: - "BRANCH={{ BRANCH }}" - "REPO_URL={{ REPO_URL }}" - "FEATURE={{ FEATURE }}" - - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - "FORK_FROM={{ FORK_FROM }}" - command: cargo run --features=$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $FORK_FROM - diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 7f2e9804b6..6fdb65ab76 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -21,11 +21,11 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - fork-update-withdata: + try-runtime: # The type of runner that the job will run on runs-on: self-hosted-ci - name: Build Container, Spin it Up an test + name: ${{ matrix.network }} - Try-runtime continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. @@ -43,7 +43,7 @@ jobs: fork_from_address: wss://eu-ws.unique.network:443 steps: -# - name: Skip if pull request is in Draft + - name: Skip if pull request is in Draft # `if: github.event.pull_request.draft == true` should be kept here, at # the step level, rather than at the job level. The latter is not # recommended because when the PR is moved from "Draft" to "Ready to @@ -58,8 +58,8 @@ jobs: # 4. Move it to "Ready for review"; now the workflow is passing (it was # skipped) and "Check reviews" is also passing (it won't be updated # until the workflow is finished) -# if: github.event.pull_request.draft == true -# run: exit 1 + if: github.event.pull_request.draft == true + run: exit 1 - name: Clean Workspace @@ -81,7 +81,6 @@ jobs: variables: | REPO_URL=${{ github.server_url }}/${{ github.repository }}.git RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} FEATURE=${{ matrix.features }} BRANCH=${{ github.head_ref }} FORK_FROM=${{ matrix.fork_from_address }} From 7053399634629b8f011c405601d4a0198ee9f55e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 16 Aug 2022 22:39:32 +0300 Subject: [PATCH 0432/1274] update dockerfile for try runtime --- .docker/Dockerfile-try-runtime | 34 +++------------------------ .docker/docker-compose.try-runtime.j2 | 3 --- .github/workflows/try-runtime.yml | 11 ++++----- 3 files changed, 8 insertions(+), 40 deletions(-) diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index 20ba8d9bb5..87ba6ba207 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -36,38 +36,10 @@ ARG PROFILE=release ARG FEATURE= ARG REPO_URL= ARG BRANCH= +ARG FORK_FROM= -RUN git clone $REPO_URL -b $BRANCH . && \ - cargo build --features=$FEATURE --$PROFILE - - -# ===== BUILD POLKADOT ===== -FROM rust-builder as builder-polkadot - -ARG POLKADOT_BUILD_BRANCH= -ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH - -RUN mkdir /unique_parachain WORKDIR /unique_parachain -RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ - cd polkadot && \ - cargo build --release - -# ===== RUN ====== - -FROM ubuntu:20.04 - -ARG FORM_FROM= -ARG FEATURE= - -RUN apt-get -y update && \ - apt-get -y install curl git && \ - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v16.16.0 && \ - nvm use v16.16.0 +RUN git clone $REPO_URL -b $BRANCH . && \ + cargo run --features=FEATURE --release -- try-runtime on-runtime-upgrade live --uri $FORK_FROM -COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ \ No newline at end of file diff --git a/.docker/docker-compose.try-runtime.j2 b/.docker/docker-compose.try-runtime.j2 index 0ee0299570..3ac0439b39 100644 --- a/.docker/docker-compose.try-runtime.j2 +++ b/.docker/docker-compose.try-runtime.j2 @@ -8,8 +8,5 @@ services: - "BRANCH={{ BRANCH }}" - "REPO_URL={{ REPO_URL }}" - "FEATURE={{ FEATURE }}" - - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - "FORK_FROM={{ FORK_FROM }}" - command: cargo run --features=$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $FORK_FROM - diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 7f2e9804b6..6fdb65ab76 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -21,11 +21,11 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - fork-update-withdata: + try-runtime: # The type of runner that the job will run on runs-on: self-hosted-ci - name: Build Container, Spin it Up an test + name: ${{ matrix.network }} - Try-runtime continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. @@ -43,7 +43,7 @@ jobs: fork_from_address: wss://eu-ws.unique.network:443 steps: -# - name: Skip if pull request is in Draft + - name: Skip if pull request is in Draft # `if: github.event.pull_request.draft == true` should be kept here, at # the step level, rather than at the job level. The latter is not # recommended because when the PR is moved from "Draft" to "Ready to @@ -58,8 +58,8 @@ jobs: # 4. Move it to "Ready for review"; now the workflow is passing (it was # skipped) and "Check reviews" is also passing (it won't be updated # until the workflow is finished) -# if: github.event.pull_request.draft == true -# run: exit 1 + if: github.event.pull_request.draft == true + run: exit 1 - name: Clean Workspace @@ -81,7 +81,6 @@ jobs: variables: | REPO_URL=${{ github.server_url }}/${{ github.repository }}.git RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} FEATURE=${{ matrix.features }} BRANCH=${{ github.head_ref }} FORK_FROM=${{ matrix.fork_from_address }} From 2a07e943177a4e359ca7c7cde395efc8a3a9265e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 17 Aug 2022 11:54:14 +0300 Subject: [PATCH 0433/1274] workflow rename. runs_on update --- .github/workflows/build-test-master.yml | 8 ++++---- .github/workflows/fork-update-withdata.yml | 7 ++++--- .github/workflows/forkless-update-nodata.yml | 7 ++++--- .github/workflows/node_build_test.yml | 7 ++++--- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml index e564200395..b8858ab344 100644 --- a/.github/workflows/build-test-master.yml +++ b/.github/workflows/build-test-master.yml @@ -1,4 +1,4 @@ -name: MASTER - Build & Test +name: yarn test para # Controls when the action will run. on: @@ -23,10 +23,10 @@ jobs: master-build-and-test: # The type of runner that the job will run on - runs-on: self-hosted-ci + runs-on: [self-hosted-ci,large] + timeout-minutes: 1380 - - name: ${{ matrix.network }} - Build and Test + name: ${{ matrix.network }} continue-on-error: true #Do not stop testing of matrix runs failed. diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/fork-update-withdata.yml index 26f11f8949..c300a2a7bc 100644 --- a/.github/workflows/fork-update-withdata.yml +++ b/.github/workflows/fork-update-withdata.yml @@ -1,4 +1,4 @@ -name: Fork Parachain update with data +name: Upgrade replica # Controls when the action will run. on: @@ -23,9 +23,10 @@ jobs: fork-update-withdata: # The type of runner that the job will run on - runs-on: self-hosted-ci + runs-on: [self-hosted-ci,large] + timeout-minutes: 1380 - name: ${{ matrix.network }} Fork Parachain with data + name: ${{ matrix.network }} continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 79dd7eedd8..a4316ea92b 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -1,4 +1,4 @@ -name: Forkless Parachain update with no data +name: Upgrade nodata # Controls when the action will run. on: @@ -55,9 +55,10 @@ jobs: forkless-update-nodata: needs: prepare-execution-marix # The type of runner that the job will run on - runs-on: self-hosted-ci + runs-on: [self-hosted-ci,medium] + timeout-minutes: 1380 - name: ${{ matrix.network }} - Forkless Parachain Upgrade NO data + name: ${{ matrix.network }} continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index 6915b9e6fa..a5fea61076 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -1,4 +1,4 @@ -name: Develop - Build & test +name: yarn test dev # Controls when the action will run. on: @@ -22,9 +22,10 @@ env: jobs: dev_build_test: # The type of runner that the job will run on - runs-on: self-hosted-ci + runs-on: [self-hosted-ci,medium] + timeout-minutes: 1380 - name: Build Container, Spin it Up an test + name: ${{ matrix.network }} continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. From b93fe6529243506bce7593d838bedbee9a81140a Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 17 Aug 2022 11:56:48 +0300 Subject: [PATCH 0434/1274] look and fell make up --- .github/workflows/build-test-master.yml | 2 +- .github/workflows/node_build_test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml index b8858ab344..d512616505 100644 --- a/.github/workflows/build-test-master.yml +++ b/.github/workflows/build-test-master.yml @@ -1,4 +1,4 @@ -name: yarn test para +name: Yarn test para # Controls when the action will run. on: diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index a5fea61076..ccffc5d71d 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -1,4 +1,4 @@ -name: yarn test dev +name: Yarn test dev # Controls when the action will run. on: From 57b33c4b7c791c70c75b7cd3ecf42525a34f6591 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 17 Aug 2022 12:10:40 +0300 Subject: [PATCH 0435/1274] test: skip xcm transfer skip Signed-off-by: Yaroslav Bolyukin --- tests/src/xcmTransfer.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/src/xcmTransfer.test.ts b/tests/src/xcmTransfer.test.ts index a8b13237f4..904ebb64ab 100644 --- a/tests/src/xcmTransfer.test.ts +++ b/tests/src/xcmTransfer.test.ts @@ -33,9 +33,9 @@ const KARURA_CHAIN = 2000; const KARURA_PORT = '9946'; const TRANSFER_AMOUNT = 2000000000000000000000000n; -describe('Integration test: Exchanging QTZ with Karura', () => { +describe.skip('Integration test: Exchanging QTZ with Karura', () => { let alice: IKeyringPair; - + before(async () => { await usingApi(async (api, privateKeyWrapper) => { alice = privateKeyWrapper('//Alice'); @@ -75,7 +75,7 @@ describe('Integration test: Exchanging QTZ with Karura', () => { it('Should connect and send QTZ to Karura', async () => { let balanceOnKaruraBefore: bigint; - + await usingApi(async (api) => { const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any; balanceOnKaruraBefore = free; @@ -142,7 +142,7 @@ describe('Integration test: Exchanging QTZ with Karura', () => { it('Should connect to Karura and send QTZ back', async () => { let balanceBefore: bigint; - + await usingApi(async (api) => { [balanceBefore] = await getBalance(api, [alice.address]); }); @@ -183,4 +183,4 @@ describe('Integration test: Exchanging QTZ with Karura', () => { expect(balanceAfter > balanceBefore).to.be.true; }); }); -}); \ No newline at end of file +}); From ddcf89abd2836ea65b93846993341d4e4d35eda7 Mon Sep 17 00:00:00 2001 From: Igor Kozyrev Date: Mon, 15 Aug 2022 21:04:22 +0200 Subject: [PATCH 0436/1274] chore: regenerate weights --- pallets/evm-migration/src/weights.rs | 28 ++- pallets/fungible/src/weights.rs | 34 ++-- pallets/nonfungible/src/weights.rs | 90 +++++----- pallets/proxy-rmrk-core/src/weights.rs | 82 ++++----- pallets/proxy-rmrk-equip/src/weights.rs | 30 ++-- pallets/refungible/src/weights.rs | 218 ++++++++++++------------ pallets/scheduler/src/weights.rs | 126 +++++++------- pallets/structure/src/weights.rs | 8 +- pallets/unique/src/weights.rs | 50 +++--- primitives/common/src/constants.rs | 4 +- 10 files changed, 335 insertions(+), 335 deletions(-) diff --git a/pallets/evm-migration/src/weights.rs b/pallets/evm-migration/src/weights.rs index af58744a75..2b4dacb736 100644 --- a/pallets/evm-migration/src/weights.rs +++ b/pallets/evm-migration/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_evm_migration //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-06-15, STEPS: `50`, REPEAT: 200, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-08-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -19,7 +19,7 @@ // --template // .maintain/frame-weight-template.hbs // --steps=50 -// --repeat=200 +// --repeat=80 // --heap-pages=4096 // --output=./pallets/evm-migration/src/weights.rs @@ -45,25 +45,23 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:1 w:0) // Storage: EVM AccountCodes (r:1 w:0) fn begin() -> Weight { - (6_914_000 as Weight) + (8_035_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: EvmMigration MigrationPending (r:1 w:0) // Storage: EVM AccountStorages (r:0 w:1) fn set_data(b: u32, ) -> Weight { - (2_875_000 as Weight) + (3_076_000 as Weight) // Standard Error: 0 - .saturating_add((794_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((828_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) } // Storage: EvmMigration MigrationPending (r:1 w:1) // Storage: EVM AccountCodes (r:0 w:1) - fn finish(b: u32, ) -> Weight { - (6_320_000 as Weight) - // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) + fn finish(_b: u32, ) -> Weight { + (6_591_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -75,25 +73,23 @@ impl WeightInfo for () { // Storage: System Account (r:1 w:0) // Storage: EVM AccountCodes (r:1 w:0) fn begin() -> Weight { - (6_914_000 as Weight) + (8_035_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: EvmMigration MigrationPending (r:1 w:0) // Storage: EVM AccountStorages (r:0 w:1) fn set_data(b: u32, ) -> Weight { - (2_875_000 as Weight) + (3_076_000 as Weight) // Standard Error: 0 - .saturating_add((794_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((828_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) } // Storage: EvmMigration MigrationPending (r:1 w:1) // Storage: EVM AccountCodes (r:0 w:1) - fn finish(b: u32, ) -> Weight { - (6_320_000 as Weight) - // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) + fn finish(_b: u32, ) -> Weight { + (6_591_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } diff --git a/pallets/fungible/src/weights.rs b/pallets/fungible/src/weights.rs index c89e930a9e..2da1da43da 100644 --- a/pallets/fungible/src/weights.rs +++ b/pallets/fungible/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_fungible //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-06-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-08-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -48,16 +48,16 @@ impl WeightInfo for SubstrateWeight { // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:1 w:1) fn create_item() -> Weight { - (17_828_000 as Weight) + (18_195_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:4 w:4) fn create_multiple_items_ex(b: u32, ) -> Weight { - (17_574_000 as Weight) + (19_218_000 as Weight) // Standard Error: 3_000 - .saturating_add((4_288_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((4_516_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -66,27 +66,27 @@ impl WeightInfo for SubstrateWeight { // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:1 w:1) fn burn_item() -> Weight { - (18_417_000 as Weight) + (18_719_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Fungible Balance (r:2 w:2) fn transfer() -> Weight { - (20_090_000 as Weight) + (20_563_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Fungible Balance (r:1 w:0) // Storage: Fungible Allowance (r:0 w:1) fn approve() -> Weight { - (17_532_000 as Weight) + (17_583_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Fungible Allowance (r:1 w:1) // Storage: Fungible Balance (r:2 w:2) fn transfer_from() -> Weight { - (29_869_000 as Weight) + (29_845_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -94,7 +94,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:1 w:1) fn burn_from() -> Weight { - (27_835_000 as Weight) + (28_248_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -105,16 +105,16 @@ impl WeightInfo for () { // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:1 w:1) fn create_item() -> Weight { - (17_828_000 as Weight) + (18_195_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:4 w:4) fn create_multiple_items_ex(b: u32, ) -> Weight { - (17_574_000 as Weight) + (19_218_000 as Weight) // Standard Error: 3_000 - .saturating_add((4_288_000 as Weight).saturating_mul(b as Weight)) + .saturating_add((4_516_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -123,27 +123,27 @@ impl WeightInfo for () { // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:1 w:1) fn burn_item() -> Weight { - (18_417_000 as Weight) + (18_719_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Fungible Balance (r:2 w:2) fn transfer() -> Weight { - (20_090_000 as Weight) + (20_563_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Fungible Balance (r:1 w:0) // Storage: Fungible Allowance (r:0 w:1) fn approve() -> Weight { - (17_532_000 as Weight) + (17_583_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Fungible Allowance (r:1 w:1) // Storage: Fungible Balance (r:2 w:2) fn transfer_from() -> Weight { - (29_869_000 as Weight) + (29_845_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -151,7 +151,7 @@ impl WeightInfo for () { // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:1 w:1) fn burn_from() -> Weight { - (27_835_000 as Weight) + (28_248_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } diff --git a/pallets/nonfungible/src/weights.rs b/pallets/nonfungible/src/weights.rs index 1d093aac9d..4005d88096 100644 --- a/pallets/nonfungible/src/weights.rs +++ b/pallets/nonfungible/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_nonfungible //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-08-01, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-08-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -57,7 +57,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn create_item() -> Weight { - (20_909_000 as Weight) + (25_905_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -66,9 +66,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (12_601_000 as Weight) - // Standard Error: 1_000 - .saturating_add((4_920_000 as Weight).saturating_mul(b as Weight)) + (24_955_000 as Weight) + // Standard Error: 3_000 + .saturating_add((5_340_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(b as Weight))) @@ -78,9 +78,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items_ex(b: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 3_000 - .saturating_add((7_734_000 as Weight).saturating_mul(b as Weight)) + (13_666_000 as Weight) + // Standard Error: 5_000 + .saturating_add((8_299_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -94,7 +94,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_item() -> Weight { - (29_746_000 as Weight) + (36_205_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -106,7 +106,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_recursively_self_raw() -> Weight { - (36_077_000 as Weight) + (44_550_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -120,8 +120,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Common CollectionById (r:1 w:0) fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_605_000 - .saturating_add((312_391_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_536_000 + .saturating_add((312_125_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(6 as Weight)) @@ -132,14 +132,14 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Allowance (r:1 w:0) // Storage: Nonfungible Owned (r:0 w:2) fn transfer() -> Weight { - (25_248_000 as Weight) + (31_116_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } // Storage: Nonfungible TokenData (r:1 w:0) // Storage: Nonfungible Allowance (r:1 w:1) fn approve() -> Weight { - (16_321_000 as Weight) + (20_802_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -148,7 +148,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible AccountBalance (r:2 w:2) // Storage: Nonfungible Owned (r:0 w:2) fn transfer_from() -> Weight { - (29_325_000 as Weight) + (36_083_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -160,15 +160,15 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (33_323_000 as Weight) + (41_781_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Common CollectionPropertyPermissions (r:1 w:1) fn set_token_property_permissions(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 62_000 - .saturating_add((16_222_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 58_000 + .saturating_add((15_705_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -176,8 +176,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:1 w:1) fn set_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_750_000 - .saturating_add((304_476_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 3_595_000 + .saturating_add((590_344_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -185,14 +185,14 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:1 w:1) fn delete_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_638_000 - .saturating_add((294_096_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 3_664_000 + .saturating_add((605_836_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Nonfungible TokenData (r:1 w:0) fn token_owner() -> Weight { - (2_986_000 as Weight) + (4_366_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) } } @@ -204,7 +204,7 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn create_item() -> Weight { - (20_909_000 as Weight) + (25_905_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } @@ -213,9 +213,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (12_601_000 as Weight) - // Standard Error: 1_000 - .saturating_add((4_920_000 as Weight).saturating_mul(b as Weight)) + (24_955_000 as Weight) + // Standard Error: 3_000 + .saturating_add((5_340_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(b as Weight))) @@ -225,9 +225,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items_ex(b: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 3_000 - .saturating_add((7_734_000 as Weight).saturating_mul(b as Weight)) + (13_666_000 as Weight) + // Standard Error: 5_000 + .saturating_add((8_299_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -241,7 +241,7 @@ impl WeightInfo for () { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_item() -> Weight { - (29_746_000 as Weight) + (36_205_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -253,7 +253,7 @@ impl WeightInfo for () { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_recursively_self_raw() -> Weight { - (36_077_000 as Weight) + (44_550_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -267,8 +267,8 @@ impl WeightInfo for () { // Storage: Common CollectionById (r:1 w:0) fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_605_000 - .saturating_add((312_391_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_536_000 + .saturating_add((312_125_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(7 as Weight)) .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) @@ -279,14 +279,14 @@ impl WeightInfo for () { // Storage: Nonfungible Allowance (r:1 w:0) // Storage: Nonfungible Owned (r:0 w:2) fn transfer() -> Weight { - (25_248_000 as Weight) + (31_116_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } // Storage: Nonfungible TokenData (r:1 w:0) // Storage: Nonfungible Allowance (r:1 w:1) fn approve() -> Weight { - (16_321_000 as Weight) + (20_802_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -295,7 +295,7 @@ impl WeightInfo for () { // Storage: Nonfungible AccountBalance (r:2 w:2) // Storage: Nonfungible Owned (r:0 w:2) fn transfer_from() -> Weight { - (29_325_000 as Weight) + (36_083_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } @@ -307,15 +307,15 @@ impl WeightInfo for () { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (33_323_000 as Weight) + (41_781_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Common CollectionPropertyPermissions (r:1 w:1) fn set_token_property_permissions(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 62_000 - .saturating_add((16_222_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 58_000 + .saturating_add((15_705_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -323,8 +323,8 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:1 w:1) fn set_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_750_000 - .saturating_add((304_476_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 3_595_000 + .saturating_add((590_344_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -332,14 +332,14 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:1 w:1) fn delete_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_638_000 - .saturating_add((294_096_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 3_664_000 + .saturating_add((605_836_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Nonfungible TokenData (r:1 w:0) fn token_owner() -> Weight { - (2_986_000 as Weight) + (4_366_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) } } diff --git a/pallets/proxy-rmrk-core/src/weights.rs b/pallets/proxy-rmrk-core/src/weights.rs index 033440cf43..6c5bf15518 100644 --- a/pallets/proxy-rmrk-core/src/weights.rs +++ b/pallets/proxy-rmrk-core/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_proxy_rmrk_core //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-07-01, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-08-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -64,7 +64,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Common CollectionById (r:0 w:1) // Storage: RmrkCore UniqueCollectionId (r:0 w:1) fn create_collection() -> Weight { - (49_365_000 as Weight) + (49_754_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } @@ -77,7 +77,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokensBurnt (r:0 w:1) // Storage: Common AdminAmount (r:0 w:1) fn destroy_collection() -> Weight { - (49_903_000 as Weight) + (48_588_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -85,7 +85,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Common CollectionById (r:1 w:1) // Storage: Common CollectionProperties (r:1 w:0) fn change_collection_issuer() -> Weight { - (26_134_000 as Weight) + (25_054_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -95,7 +95,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokensMinted (r:1 w:0) // Storage: Nonfungible TokensBurnt (r:1 w:0) fn lock_collection() -> Weight { - (28_020_000 as Weight) + (26_483_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -109,9 +109,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenAuxProperties (r:2 w:2) fn mint_nft(b: u32, ) -> Weight { - (67_476_000 as Weight) - // Standard Error: 19_000 - .saturating_add((12_373_000 as Weight).saturating_mul(b as Weight)) + (62_419_000 as Weight) + // Standard Error: 7_000 + .saturating_add((12_325_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(5 as Weight)) @@ -129,8 +129,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_nft(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_500_000 - .saturating_add((300_520_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_488_000 + .saturating_add((298_367_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(9 as Weight)) .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(6 as Weight)) @@ -146,7 +146,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenChildren (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:2) fn send() -> Weight { - (84_023_000 as Weight) + (81_942_000 as Weight) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -161,7 +161,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenChildren (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:2) fn accept_nft() -> Weight { - (98_502_000 as Weight) + (97_925_000 as Weight) .saturating_add(T::DbWeight::get().reads(16 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } @@ -177,7 +177,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Allowance (r:5 w:0) // Storage: Nonfungible Owned (r:0 w:5) fn reject_nft() -> Weight { - (277_017_000 as Weight) + (277_794_000 as Weight) .saturating_add(T::DbWeight::get().reads(30 as Weight)) .saturating_add(T::DbWeight::get().writes(26 as Weight)) } @@ -187,7 +187,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenData (r:5 w:0) fn set_property() -> Weight { - (55_408_000 as Weight) + (54_657_000 as Weight) .saturating_add(T::DbWeight::get().reads(9 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -197,7 +197,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenData (r:5 w:0) fn set_priority() -> Weight { - (55_063_000 as Weight) + (55_056_000 as Weight) .saturating_add(T::DbWeight::get().reads(9 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -208,7 +208,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn add_basic_resource() -> Weight { - (64_656_000 as Weight) + (61_673_000 as Weight) .saturating_add(T::DbWeight::get().reads(10 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -219,7 +219,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenAuxProperties (r:2 w:2) fn add_composable_resource() -> Weight { - (67_593_000 as Weight) + (67_125_000 as Weight) .saturating_add(T::DbWeight::get().reads(11 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -230,7 +230,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn add_slot_resource() -> Weight { - (63_845_000 as Weight) + (69_058_000 as Weight) .saturating_add(T::DbWeight::get().reads(10 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -240,7 +240,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenAuxProperties (r:1 w:1) // Storage: Nonfungible TokenData (r:5 w:0) fn remove_resource() -> Weight { - (53_414_000 as Weight) + (53_427_000 as Weight) .saturating_add(T::DbWeight::get().reads(9 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -250,7 +250,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:5 w:0) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn accept_resource() -> Weight { - (51_869_000 as Weight) + (50_623_000 as Weight) .saturating_add(T::DbWeight::get().reads(9 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -260,7 +260,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:5 w:0) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn accept_resource_removal() -> Weight { - (53_168_000 as Weight) + (50_917_000 as Weight) .saturating_add(T::DbWeight::get().reads(9 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -277,7 +277,7 @@ impl WeightInfo for () { // Storage: Common CollectionById (r:0 w:1) // Storage: RmrkCore UniqueCollectionId (r:0 w:1) fn create_collection() -> Weight { - (49_365_000 as Weight) + (49_754_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) } @@ -290,7 +290,7 @@ impl WeightInfo for () { // Storage: Nonfungible TokensBurnt (r:0 w:1) // Storage: Common AdminAmount (r:0 w:1) fn destroy_collection() -> Weight { - (49_903_000 as Weight) + (48_588_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } @@ -298,7 +298,7 @@ impl WeightInfo for () { // Storage: Common CollectionById (r:1 w:1) // Storage: Common CollectionProperties (r:1 w:0) fn change_collection_issuer() -> Weight { - (26_134_000 as Weight) + (25_054_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -308,7 +308,7 @@ impl WeightInfo for () { // Storage: Nonfungible TokensMinted (r:1 w:0) // Storage: Nonfungible TokensBurnt (r:1 w:0) fn lock_collection() -> Weight { - (28_020_000 as Weight) + (26_483_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -322,9 +322,9 @@ impl WeightInfo for () { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenAuxProperties (r:2 w:2) fn mint_nft(b: u32, ) -> Weight { - (67_476_000 as Weight) - // Standard Error: 19_000 - .saturating_add((12_373_000 as Weight).saturating_mul(b as Weight)) + (62_419_000 as Weight) + // Standard Error: 7_000 + .saturating_add((12_325_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) @@ -342,8 +342,8 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_nft(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_500_000 - .saturating_add((300_520_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 1_488_000 + .saturating_add((298_367_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(9 as Weight)) .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) @@ -359,7 +359,7 @@ impl WeightInfo for () { // Storage: Nonfungible TokenChildren (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:2) fn send() -> Weight { - (84_023_000 as Weight) + (81_942_000 as Weight) .saturating_add(RocksDbWeight::get().reads(12 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } @@ -374,7 +374,7 @@ impl WeightInfo for () { // Storage: Nonfungible TokenChildren (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:2) fn accept_nft() -> Weight { - (98_502_000 as Weight) + (97_925_000 as Weight) .saturating_add(RocksDbWeight::get().reads(16 as Weight)) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) } @@ -390,7 +390,7 @@ impl WeightInfo for () { // Storage: Nonfungible Allowance (r:5 w:0) // Storage: Nonfungible Owned (r:0 w:5) fn reject_nft() -> Weight { - (277_017_000 as Weight) + (277_794_000 as Weight) .saturating_add(RocksDbWeight::get().reads(30 as Weight)) .saturating_add(RocksDbWeight::get().writes(26 as Weight)) } @@ -400,7 +400,7 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenData (r:5 w:0) fn set_property() -> Weight { - (55_408_000 as Weight) + (54_657_000 as Weight) .saturating_add(RocksDbWeight::get().reads(9 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -410,7 +410,7 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenData (r:5 w:0) fn set_priority() -> Weight { - (55_063_000 as Weight) + (55_056_000 as Weight) .saturating_add(RocksDbWeight::get().reads(9 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -421,7 +421,7 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn add_basic_resource() -> Weight { - (64_656_000 as Weight) + (61_673_000 as Weight) .saturating_add(RocksDbWeight::get().reads(10 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -432,7 +432,7 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenAuxProperties (r:2 w:2) fn add_composable_resource() -> Weight { - (67_593_000 as Weight) + (67_125_000 as Weight) .saturating_add(RocksDbWeight::get().reads(11 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } @@ -443,7 +443,7 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn add_slot_resource() -> Weight { - (63_845_000 as Weight) + (69_058_000 as Weight) .saturating_add(RocksDbWeight::get().reads(10 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -453,7 +453,7 @@ impl WeightInfo for () { // Storage: Nonfungible TokenAuxProperties (r:1 w:1) // Storage: Nonfungible TokenData (r:5 w:0) fn remove_resource() -> Weight { - (53_414_000 as Weight) + (53_427_000 as Weight) .saturating_add(RocksDbWeight::get().reads(9 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -463,7 +463,7 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:5 w:0) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn accept_resource() -> Weight { - (51_869_000 as Weight) + (50_623_000 as Weight) .saturating_add(RocksDbWeight::get().reads(9 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -473,7 +473,7 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:5 w:0) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn accept_resource_removal() -> Weight { - (53_168_000 as Weight) + (50_917_000 as Weight) .saturating_add(RocksDbWeight::get().reads(9 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/pallets/proxy-rmrk-equip/src/weights.rs b/pallets/proxy-rmrk-equip/src/weights.rs index aca21e466f..a064cf69c0 100644 --- a/pallets/proxy-rmrk-equip/src/weights.rs +++ b/pallets/proxy-rmrk-equip/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_proxy_rmrk_equip //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-07-01, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-08-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -54,9 +54,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn create_base(b: u32, ) -> Weight { - (57_871_000 as Weight) - // Standard Error: 21_000 - .saturating_add((19_870_000 as Weight).saturating_mul(b as Weight)) + (58_417_000 as Weight) + // Standard Error: 27_000 + .saturating_add((20_439_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(8 as Weight)) @@ -71,9 +71,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn theme_add(b: u32, ) -> Weight { - (46_121_000 as Weight) - // Standard Error: 31_000 - .saturating_add((2_988_000 as Weight).saturating_mul(b as Weight)) + (46_005_000 as Weight) + // Standard Error: 42_000 + .saturating_add((2_922_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -82,7 +82,7 @@ impl WeightInfo for SubstrateWeight { // Storage: RmrkEquip InernalPartId (r:1 w:0) // Storage: Nonfungible TokenProperties (r:1 w:1) fn equippable() -> Weight { - (32_032_000 as Weight) + (32_526_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -103,9 +103,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn create_base(b: u32, ) -> Weight { - (57_871_000 as Weight) - // Standard Error: 21_000 - .saturating_add((19_870_000 as Weight).saturating_mul(b as Weight)) + (58_417_000 as Weight) + // Standard Error: 27_000 + .saturating_add((20_439_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(8 as Weight)) @@ -120,9 +120,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn theme_add(b: u32, ) -> Weight { - (46_121_000 as Weight) - // Standard Error: 31_000 - .saturating_add((2_988_000 as Weight).saturating_mul(b as Weight)) + (46_005_000 as Weight) + // Standard Error: 42_000 + .saturating_add((2_922_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -131,7 +131,7 @@ impl WeightInfo for () { // Storage: RmrkEquip InernalPartId (r:1 w:0) // Storage: Nonfungible TokenProperties (r:1 w:1) fn equippable() -> Weight { - (32_032_000 as Weight) + (32_526_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/pallets/refungible/src/weights.rs b/pallets/refungible/src/weights.rs index afbdaf3d52..9ae639fd6b 100644 --- a/pallets/refungible/src/weights.rs +++ b/pallets/refungible/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_refungible //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-08-01, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-08-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -64,147 +64,150 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Balance (r:0 w:1) // Storage: Refungible TotalSupply (r:0 w:1) - // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) fn create_item() -> Weight { - (25_197_000 as Weight) + (29_527_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) } // Storage: Refungible TokensMinted (r:1 w:1) // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Balance (r:0 w:4) // Storage: Refungible TotalSupply (r:0 w:4) - // Storage: Refungible TokenData (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (10_852_000 as Weight) - // Standard Error: 2_000 - .saturating_add((8_087_000 as Weight).saturating_mul(b as Weight)) + (28_541_000 as Weight) + // Standard Error: 4_000 + .saturating_add((6_671_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) + .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight))) } // Storage: Refungible TokensMinted (r:1 w:1) // Storage: Refungible AccountBalance (r:4 w:4) // Storage: Refungible Balance (r:0 w:4) // Storage: Refungible TotalSupply (r:0 w:4) - // Storage: Refungible TokenData (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_items(b: u32, ) -> Weight { - (9_978_000 as Weight) - // Standard Error: 2_000 - .saturating_add((10_848_000 as Weight).saturating_mul(b as Weight)) + (24_366_000 as Weight) + // Standard Error: 5_000 + .saturating_add((9_338_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((5 as Weight).saturating_mul(b as Weight))) + .saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) } // Storage: Refungible TokensMinted (r:1 w:1) // Storage: Refungible TotalSupply (r:0 w:1) - // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible AccountBalance (r:4 w:4) // Storage: Refungible Balance (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight { - (15_419_000 as Weight) - // Standard Error: 2_000 - .saturating_add((7_813_000 as Weight).saturating_mul(b as Weight)) + (27_574_000 as Weight) + // Standard Error: 4_000 + .saturating_add((7_193_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight))) } // Storage: Refungible TotalSupply (r:1 w:1) - // Storage: Refungible Balance (r:1 w:1) + // Storage: Refungible Balance (r:3 w:1) // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn burn_item_partial() -> Weight { - (25_578_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) + (42_943_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } // Storage: Refungible TotalSupply (r:1 w:1) // Storage: Refungible Balance (r:1 w:1) // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible TokensBurnt (r:1 w:1) - // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) // Storage: Refungible TokenProperties (r:0 w:1) fn burn_item_fully() -> Weight { - (33_593_000 as Weight) + (36_861_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Refungible Balance (r:2 w:2) + // Storage: Refungible TotalSupply (r:1 w:0) fn transfer_normal() -> Weight { - (21_049_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) + (27_789_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:1 w:1) + // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_creating() -> Weight { - (24_646_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) + (32_893_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:1 w:1) + // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_removing() -> Weight { - (26_570_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) + (34_703_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:2 w:2) + // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:2) fn transfer_creating_removing() -> Weight { - (28_906_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) + (37_547_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Refungible Balance (r:1 w:0) // Storage: Refungible Allowance (r:0 w:1) fn approve() -> Weight { - (16_451_000 as Weight) + (20_039_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) + // Storage: Refungible TotalSupply (r:1 w:0) fn transfer_from_normal() -> Weight { - (29_545_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) + (37_628_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:1 w:1) + // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_creating() -> Weight { - (33_392_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) + (42_072_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:1 w:1) + // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_removing() -> Weight { - (35_446_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) + (43_024_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:2 w:2) + // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:2) fn transfer_from_creating_removing() -> Weight { - (37_762_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) + (45_910_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(7 as Weight)) } // Storage: Refungible Allowance (r:1 w:1) @@ -212,19 +215,18 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible Balance (r:1 w:1) // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible TokensBurnt (r:1 w:1) - // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) // Storage: Refungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (42_620_000 as Weight) + (48_584_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(8 as Weight)) + .saturating_add(T::DbWeight::get().writes(7 as Weight)) } // Storage: Common CollectionPropertyPermissions (r:1 w:1) fn set_token_property_permissions(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 65_000 - .saturating_add((16_513_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 60_000 + .saturating_add((15_533_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -232,8 +234,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TokenProperties (r:1 w:1) fn set_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_583_000 - .saturating_add((291_392_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 3_609_000 + .saturating_add((590_204_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -241,15 +243,15 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TokenProperties (r:1 w:1) fn delete_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_699_000 - .saturating_add((293_270_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 3_637_000 + .saturating_add((603_468_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Refungible TotalSupply (r:1 w:1) // Storage: Refungible Balance (r:1 w:1) fn repartition_item() -> Weight { - (19_206_000 as Weight) + (22_356_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -257,13 +259,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible TokenProperties (r:1 w:1) fn set_parent_nft_unchecked() -> Weight { - (10_189_000 as Weight) + (12_015_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Refungible Balance (r:2 w:0) fn token_owner() -> Weight { - (8_205_000 as Weight) + (9_431_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) } } @@ -274,147 +276,150 @@ impl WeightInfo for () { // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Balance (r:0 w:1) // Storage: Refungible TotalSupply (r:0 w:1) - // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) fn create_item() -> Weight { - (25_197_000 as Weight) + (29_527_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(6 as Weight)) + .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } // Storage: Refungible TokensMinted (r:1 w:1) // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Balance (r:0 w:4) // Storage: Refungible TotalSupply (r:0 w:4) - // Storage: Refungible TokenData (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (10_852_000 as Weight) - // Standard Error: 2_000 - .saturating_add((8_087_000 as Weight).saturating_mul(b as Weight)) + (28_541_000 as Weight) + // Standard Error: 4_000 + .saturating_add((6_671_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) + .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(b as Weight))) } // Storage: Refungible TokensMinted (r:1 w:1) // Storage: Refungible AccountBalance (r:4 w:4) // Storage: Refungible Balance (r:0 w:4) // Storage: Refungible TotalSupply (r:0 w:4) - // Storage: Refungible TokenData (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_items(b: u32, ) -> Weight { - (9_978_000 as Weight) - // Standard Error: 2_000 - .saturating_add((10_848_000 as Weight).saturating_mul(b as Weight)) + (24_366_000 as Weight) + // Standard Error: 5_000 + .saturating_add((9_338_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes((5 as Weight).saturating_mul(b as Weight))) + .saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) } // Storage: Refungible TokensMinted (r:1 w:1) // Storage: Refungible TotalSupply (r:0 w:1) - // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible AccountBalance (r:4 w:4) // Storage: Refungible Balance (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight { - (15_419_000 as Weight) - // Standard Error: 2_000 - .saturating_add((7_813_000 as Weight).saturating_mul(b as Weight)) + (27_574_000 as Weight) + // Standard Error: 4_000 + .saturating_add((7_193_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(b as Weight))) } // Storage: Refungible TotalSupply (r:1 w:1) - // Storage: Refungible Balance (r:1 w:1) + // Storage: Refungible Balance (r:3 w:1) // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn burn_item_partial() -> Weight { - (25_578_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + (42_943_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } // Storage: Refungible TotalSupply (r:1 w:1) // Storage: Refungible Balance (r:1 w:1) // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible TokensBurnt (r:1 w:1) - // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) // Storage: Refungible TokenProperties (r:0 w:1) fn burn_item_fully() -> Weight { - (33_593_000 as Weight) + (36_861_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(7 as Weight)) + .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Refungible Balance (r:2 w:2) + // Storage: Refungible TotalSupply (r:1 w:0) fn transfer_normal() -> Weight { - (21_049_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + (27_789_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:1 w:1) + // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_creating() -> Weight { - (24_646_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + (32_893_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:1 w:1) + // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_removing() -> Weight { - (26_570_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + (34_703_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:2 w:2) + // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:2) fn transfer_creating_removing() -> Weight { - (28_906_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + (37_547_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Refungible Balance (r:1 w:0) // Storage: Refungible Allowance (r:0 w:1) fn approve() -> Weight { - (16_451_000 as Weight) + (20_039_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) + // Storage: Refungible TotalSupply (r:1 w:0) fn transfer_from_normal() -> Weight { - (29_545_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + (37_628_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:1 w:1) + // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_creating() -> Weight { - (33_392_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + (42_072_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:1 w:1) + // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_removing() -> Weight { - (35_446_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + (43_024_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:2 w:2) + // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:2) fn transfer_from_creating_removing() -> Weight { - (37_762_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + (45_910_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(7 as Weight)) } // Storage: Refungible Allowance (r:1 w:1) @@ -422,19 +427,18 @@ impl WeightInfo for () { // Storage: Refungible Balance (r:1 w:1) // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible TokensBurnt (r:1 w:1) - // Storage: Refungible TokenData (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) // Storage: Refungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (42_620_000 as Weight) + (48_584_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(8 as Weight)) + .saturating_add(RocksDbWeight::get().writes(7 as Weight)) } // Storage: Common CollectionPropertyPermissions (r:1 w:1) fn set_token_property_permissions(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 65_000 - .saturating_add((16_513_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 60_000 + .saturating_add((15_533_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -442,8 +446,8 @@ impl WeightInfo for () { // Storage: Refungible TokenProperties (r:1 w:1) fn set_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_583_000 - .saturating_add((291_392_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 3_609_000 + .saturating_add((590_204_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -451,15 +455,15 @@ impl WeightInfo for () { // Storage: Refungible TokenProperties (r:1 w:1) fn delete_token_properties(b: u32, ) -> Weight { (0 as Weight) - // Standard Error: 1_699_000 - .saturating_add((293_270_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 3_637_000 + .saturating_add((603_468_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Refungible TotalSupply (r:1 w:1) // Storage: Refungible Balance (r:1 w:1) fn repartition_item() -> Weight { - (19_206_000 as Weight) + (22_356_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -467,13 +471,13 @@ impl WeightInfo for () { // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible TokenProperties (r:1 w:1) fn set_parent_nft_unchecked() -> Weight { - (10_189_000 as Weight) + (12_015_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Refungible Balance (r:2 w:0) fn token_owner() -> Weight { - (8_205_000 as Weight) + (9_431_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) } } diff --git a/pallets/scheduler/src/weights.rs b/pallets/scheduler/src/weights.rs index 98df961492..12e4c39a84 100644 --- a/pallets/scheduler/src/weights.rs +++ b/pallets/scheduler/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_unique_scheduler //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-06-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-08-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -55,9 +55,9 @@ impl WeightInfo for SubstrateWeight { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - (27_374_000 as Weight) - // Standard Error: 7_000 - .saturating_add((9_673_000 as Weight).saturating_mul(s as Weight)) + (26_641_000 as Weight) + // Standard Error: 9_000 + .saturating_add((8_547_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(T::DbWeight::get().writes(4 as Weight)) @@ -69,9 +69,9 @@ impl WeightInfo for SubstrateWeight { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_resolved(s: u32, ) -> Weight { - (25_967_000 as Weight) - // Standard Error: 6_000 - .saturating_add((5_916_000 as Weight).saturating_mul(s as Weight)) + (23_941_000 as Weight) + // Standard Error: 17_000 + .saturating_add((5_282_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -82,9 +82,9 @@ impl WeightInfo for SubstrateWeight { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic(s: u32, ) -> Weight { - (27_097_000 as Weight) - // Standard Error: 5_000 - .saturating_add((9_652_000 as Weight).saturating_mul(s as Weight)) + (24_858_000 as Weight) + // Standard Error: 7_000 + .saturating_add((8_657_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(T::DbWeight::get().writes(4 as Weight)) @@ -96,9 +96,9 @@ impl WeightInfo for SubstrateWeight { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - (43_116_000 as Weight) - // Standard Error: 18_000 - .saturating_add((8_352_000 as Weight).saturating_mul(s as Weight)) + (25_515_000 as Weight) + // Standard Error: 14_000 + .saturating_add((8_656_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(T::DbWeight::get().writes(4 as Weight)) @@ -107,9 +107,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_aborted(s: u32, ) -> Weight { - (4_921_000 as Weight) - // Standard Error: 4_000 - .saturating_add((2_249_000 as Weight).saturating_mul(s as Weight)) + (7_584_000 as Weight) + // Standard Error: 1_000 + .saturating_add((2_065_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -120,9 +120,9 @@ impl WeightInfo for SubstrateWeight { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_aborted(s: u32, ) -> Weight { - (26_934_000 as Weight) - // Standard Error: 7_000 - .saturating_add((5_819_000 as Weight).saturating_mul(s as Weight)) + (25_552_000 as Weight) + // Standard Error: 4_000 + .saturating_add((5_187_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -130,9 +130,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named(s: u32, ) -> Weight { - (6_423_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_141_000 as Weight).saturating_mul(s as Weight)) + (8_980_000 as Weight) + // Standard Error: 12_000 + .saturating_add((2_050_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -143,9 +143,9 @@ impl WeightInfo for SubstrateWeight { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize(s: u32, ) -> Weight { - (27_586_000 as Weight) - // Standard Error: 11_000 - .saturating_add((5_264_000 as Weight).saturating_mul(s as Weight)) + (24_482_000 as Weight) + // Standard Error: 4_000 + .saturating_add((5_249_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -156,9 +156,9 @@ impl WeightInfo for SubstrateWeight { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_resolved(s: u32, ) -> Weight { - (24_356_000 as Weight) + (25_187_000 as Weight) // Standard Error: 4_000 - .saturating_add((5_301_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((5_216_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -166,18 +166,18 @@ impl WeightInfo for SubstrateWeight { // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn schedule_named(s: u32, ) -> Weight { - (14_871_000 as Weight) - // Standard Error: 1_000 - .saturating_add((183_000 as Weight).saturating_mul(s as Weight)) + (17_316_000 as Weight) + // Standard Error: 3_000 + .saturating_add((82_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn cancel_named(s: u32, ) -> Weight { - (16_676_000 as Weight) + (15_652_000 as Weight) // Standard Error: 1_000 - .saturating_add((500_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((436_000 as Weight).saturating_mul(s as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -191,9 +191,9 @@ impl WeightInfo for () { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - (27_374_000 as Weight) - // Standard Error: 7_000 - .saturating_add((9_673_000 as Weight).saturating_mul(s as Weight)) + (26_641_000 as Weight) + // Standard Error: 9_000 + .saturating_add((8_547_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) @@ -205,9 +205,9 @@ impl WeightInfo for () { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_resolved(s: u32, ) -> Weight { - (25_967_000 as Weight) - // Standard Error: 6_000 - .saturating_add((5_916_000 as Weight).saturating_mul(s as Weight)) + (23_941_000 as Weight) + // Standard Error: 17_000 + .saturating_add((5_282_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -218,9 +218,9 @@ impl WeightInfo for () { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic(s: u32, ) -> Weight { - (27_097_000 as Weight) - // Standard Error: 5_000 - .saturating_add((9_652_000 as Weight).saturating_mul(s as Weight)) + (24_858_000 as Weight) + // Standard Error: 7_000 + .saturating_add((8_657_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) @@ -232,9 +232,9 @@ impl WeightInfo for () { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - (43_116_000 as Weight) - // Standard Error: 18_000 - .saturating_add((8_352_000 as Weight).saturating_mul(s as Weight)) + (25_515_000 as Weight) + // Standard Error: 14_000 + .saturating_add((8_656_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) @@ -243,9 +243,9 @@ impl WeightInfo for () { // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_aborted(s: u32, ) -> Weight { - (4_921_000 as Weight) - // Standard Error: 4_000 - .saturating_add((2_249_000 as Weight).saturating_mul(s as Weight)) + (7_584_000 as Weight) + // Standard Error: 1_000 + .saturating_add((2_065_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -256,9 +256,9 @@ impl WeightInfo for () { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_aborted(s: u32, ) -> Weight { - (26_934_000 as Weight) - // Standard Error: 7_000 - .saturating_add((5_819_000 as Weight).saturating_mul(s as Weight)) + (25_552_000 as Weight) + // Standard Error: 4_000 + .saturating_add((5_187_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -266,9 +266,9 @@ impl WeightInfo for () { // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named(s: u32, ) -> Weight { - (6_423_000 as Weight) - // Standard Error: 1_000 - .saturating_add((2_141_000 as Weight).saturating_mul(s as Weight)) + (8_980_000 as Weight) + // Standard Error: 12_000 + .saturating_add((2_050_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -279,9 +279,9 @@ impl WeightInfo for () { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize(s: u32, ) -> Weight { - (27_586_000 as Weight) - // Standard Error: 11_000 - .saturating_add((5_264_000 as Weight).saturating_mul(s as Weight)) + (24_482_000 as Weight) + // Standard Error: 4_000 + .saturating_add((5_249_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -292,9 +292,9 @@ impl WeightInfo for () { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_resolved(s: u32, ) -> Weight { - (24_356_000 as Weight) + (25_187_000 as Weight) // Standard Error: 4_000 - .saturating_add((5_301_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((5_216_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(4 as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) @@ -302,18 +302,18 @@ impl WeightInfo for () { // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn schedule_named(s: u32, ) -> Weight { - (14_871_000 as Weight) - // Standard Error: 1_000 - .saturating_add((183_000 as Weight).saturating_mul(s as Weight)) + (17_316_000 as Weight) + // Standard Error: 3_000 + .saturating_add((82_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn cancel_named(s: u32, ) -> Weight { - (16_676_000 as Weight) + (15_652_000 as Weight) // Standard Error: 1_000 - .saturating_add((500_000 as Weight).saturating_mul(s as Weight)) + .saturating_add((436_000 as Weight).saturating_mul(s as Weight)) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } diff --git a/pallets/structure/src/weights.rs b/pallets/structure/src/weights.rs index 1c290a32b5..98d0df6226 100644 --- a/pallets/structure/src/weights.rs +++ b/pallets/structure/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_structure //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-06-15, STEPS: `50`, REPEAT: 200, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-08-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -19,7 +19,7 @@ // --template // .maintain/frame-weight-template.hbs // --steps=50 -// --repeat=200 +// --repeat=80 // --heap-pages=4096 // --output=./pallets/structure/src/weights.rs @@ -42,7 +42,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Common CollectionById (r:1 w:0) // Storage: Nonfungible TokenData (r:1 w:0) fn find_parent() -> Weight { - (7_013_000 as Weight) + (7_180_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) } } @@ -52,7 +52,7 @@ impl WeightInfo for () { // Storage: Common CollectionById (r:1 w:0) // Storage: Nonfungible TokenData (r:1 w:0) fn find_parent() -> Weight { - (7_013_000 as Weight) + (7_180_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) } } diff --git a/pallets/unique/src/weights.rs b/pallets/unique/src/weights.rs index f13ae907fd..6184aebcf3 100644 --- a/pallets/unique/src/weights.rs +++ b/pallets/unique/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_unique //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-06-28, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-08-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -57,7 +57,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Common CollectionProperties (r:0 w:1) // Storage: Common CollectionById (r:0 w:1) fn create_collection() -> Weight { - (53_511_000 as Weight) + (43_143_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } @@ -69,27 +69,27 @@ impl WeightInfo for SubstrateWeight { // Storage: Common AdminAmount (r:0 w:1) // Storage: Common CollectionProperties (r:0 w:1) fn destroy_collection() -> Weight { - (69_481_000 as Weight) + (50_188_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: Common CollectionById (r:1 w:0) // Storage: Common Allowlist (r:0 w:1) fn add_to_allow_list() -> Weight { - (22_892_000 as Weight) + (18_238_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionById (r:1 w:0) // Storage: Common Allowlist (r:0 w:1) fn remove_from_allow_list() -> Weight { - (22_973_000 as Weight) + (18_084_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionById (r:1 w:1) fn change_collection_owner() -> Weight { - (22_392_000 as Weight) + (18_265_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -97,7 +97,7 @@ impl WeightInfo for SubstrateWeight { // Storage: Common IsAdmin (r:1 w:1) // Storage: Common AdminAmount (r:1 w:1) fn add_collection_admin() -> Weight { - (30_298_000 as Weight) + (23_558_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -105,37 +105,37 @@ impl WeightInfo for SubstrateWeight { // Storage: Common IsAdmin (r:1 w:1) // Storage: Common AdminAmount (r:1 w:1) fn remove_collection_admin() -> Weight { - (32_842_000 as Weight) + (25_285_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Common CollectionById (r:1 w:1) fn set_collection_sponsor() -> Weight { - (22_613_000 as Weight) + (17_885_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionById (r:1 w:1) fn confirm_sponsorship() -> Weight { - (22_462_000 as Weight) + (17_897_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionById (r:1 w:1) fn remove_collection_sponsor() -> Weight { - (21_730_000 as Weight) + (17_836_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionById (r:1 w:1) fn set_transfers_enabled_flag() -> Weight { - (10_941_000 as Weight) + (9_714_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionById (r:1 w:1) fn set_collection_limits() -> Weight { - (22_363_000 as Weight) + (18_166_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -150,7 +150,7 @@ impl WeightInfo for () { // Storage: Common CollectionProperties (r:0 w:1) // Storage: Common CollectionById (r:0 w:1) fn create_collection() -> Weight { - (53_511_000 as Weight) + (43_143_000 as Weight) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } @@ -162,27 +162,27 @@ impl WeightInfo for () { // Storage: Common AdminAmount (r:0 w:1) // Storage: Common CollectionProperties (r:0 w:1) fn destroy_collection() -> Weight { - (69_481_000 as Weight) + (50_188_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: Common CollectionById (r:1 w:0) // Storage: Common Allowlist (r:0 w:1) fn add_to_allow_list() -> Weight { - (22_892_000 as Weight) + (18_238_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionById (r:1 w:0) // Storage: Common Allowlist (r:0 w:1) fn remove_from_allow_list() -> Weight { - (22_973_000 as Weight) + (18_084_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionById (r:1 w:1) fn change_collection_owner() -> Weight { - (22_392_000 as Weight) + (18_265_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } @@ -190,7 +190,7 @@ impl WeightInfo for () { // Storage: Common IsAdmin (r:1 w:1) // Storage: Common AdminAmount (r:1 w:1) fn add_collection_admin() -> Weight { - (30_298_000 as Weight) + (23_558_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } @@ -198,37 +198,37 @@ impl WeightInfo for () { // Storage: Common IsAdmin (r:1 w:1) // Storage: Common AdminAmount (r:1 w:1) fn remove_collection_admin() -> Weight { - (32_842_000 as Weight) + (25_285_000 as Weight) .saturating_add(RocksDbWeight::get().reads(3 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Common CollectionById (r:1 w:1) fn set_collection_sponsor() -> Weight { - (22_613_000 as Weight) + (17_885_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionById (r:1 w:1) fn confirm_sponsorship() -> Weight { - (22_462_000 as Weight) + (17_897_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionById (r:1 w:1) fn remove_collection_sponsor() -> Weight { - (21_730_000 as Weight) + (17_836_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionById (r:1 w:1) fn set_transfers_enabled_flag() -> Weight { - (10_941_000 as Weight) + (9_714_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Common CollectionById (r:1 w:1) fn set_collection_limits() -> Weight { - (22_363_000 as Weight) + (18_166_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/primitives/common/src/constants.rs b/primitives/common/src/constants.rs index 1a8575f670..060353bd09 100644 --- a/primitives/common/src/constants.rs +++ b/primitives/common/src/constants.rs @@ -36,10 +36,10 @@ pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE; pub const UNIQUE: Balance = 100 * CENTIUNIQUE; // Targeting 0.1 UNQ per transfer -pub const WEIGHT_TO_FEE_COEFF: u32 = /**/207_267_232/**/; +pub const WEIGHT_TO_FEE_COEFF: u32 = /**/207_163_598/**/; // Targeting 0.15 UNQ per transfer via ETH -pub const MIN_GAS_PRICE: u64 = /**/1_019_488_372_383/**/; +pub const MIN_GAS_PRICE: u64 = /**/1_019_483_274_941/**/; /// We assume that ~10% of the block weight is consumed by `on_initalize` handlers. /// This is used to limit the maximal weight of a single extrinsic. From bafd87036c81702e18e5175c8bd5cd57874dbaef Mon Sep 17 00:00:00 2001 From: Igor Kozyrev Date: Tue, 16 Aug 2022 07:40:06 +0000 Subject: [PATCH 0437/1274] up runtime version --- runtime/opal/src/lib.rs | 2 +- runtime/quartz/src/lib.rs | 2 +- runtime/unique/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 710fffb60b..c9580a1421 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -45,7 +45,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 924012, + spec_version: 924020, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index 155e62b641..8914cd18d3 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -45,7 +45,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 924012, + spec_version: 924020, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index 928eb15aa5..227240cc33 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -45,7 +45,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 924012, + spec_version: 924020, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From a925383747bfc8a70aae6abe35b396e93996803d Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 17 Aug 2022 12:21:09 +0300 Subject: [PATCH 0438/1274] build: bump spec_version Signed-off-by: Yaroslav Bolyukin --- runtime/opal/src/lib.rs | 2 +- runtime/quartz/src/lib.rs | 2 +- runtime/unique/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 9dd0a97743..9aa6279049 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -45,7 +45,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 924020, + spec_version: 927020, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index 71c59b0324..cc196963c0 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -45,7 +45,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 924020, + spec_version: 927020, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index 1bfd756aa0..eca71fc905 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -45,7 +45,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 924020, + spec_version: 927020, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, From 0df91ae2c8abb683ae86fd1a014039adf620358b Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 17 Aug 2022 12:57:09 +0300 Subject: [PATCH 0439/1274] add dollar sign to veriable definition --- .docker/Dockerfile-try-runtime | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index 87ba6ba207..340431e426 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -40,6 +40,10 @@ ARG FORK_FROM= WORKDIR /unique_parachain -RUN git clone $REPO_URL -b $BRANCH . && \ - cargo run --features=FEATURE --release -- try-runtime on-runtime-upgrade live --uri $FORK_FROM +RUN echo "Requested features: $FEATURE\n" && \ + echo "Fork from: $FORK_FROM\n" && \ + echo "Repositry URL: $REPO_URL\n" && \ + echo "Branch: $BRANCH\n" && \ + git clone $REPO_URL -b $BRANCH . && \ + cargo run --features=$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $FORK_FROM From feb9eda279da3f5319c84697fd99a104fcb42b7a Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 17 Aug 2022 13:15:05 +0300 Subject: [PATCH 0440/1274] ci(cli): add opal-runtime feature Signed-off-by: Yaroslav Bolyukin --- node/cli/Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 5a4c597a4b..e5fd27e9c4 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -266,6 +266,7 @@ optional = true [dependencies.opal-runtime] path = '../../runtime/opal' +optional = true [dependencies.up-data-structs] path = "../../primitives/data-structs" @@ -320,7 +321,7 @@ unique-rpc = { default-features = false, path = "../rpc" } rmrk-rpc = { path = "../../primitives/rmrk-rpc" } [features] -default = [] +default = ["opal-runtime"] runtime-benchmarks = [ 'unique-runtime?/runtime-benchmarks', 'quartz-runtime?/runtime-benchmarks', From 5e93b06be93a1623fab4e953b47d875a65f785cf Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 17 Aug 2022 12:57:09 +0300 Subject: [PATCH 0441/1274] add dollar sign to veriable definition --- .docker/Dockerfile-try-runtime | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index 87ba6ba207..340431e426 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -40,6 +40,10 @@ ARG FORK_FROM= WORKDIR /unique_parachain -RUN git clone $REPO_URL -b $BRANCH . && \ - cargo run --features=FEATURE --release -- try-runtime on-runtime-upgrade live --uri $FORK_FROM +RUN echo "Requested features: $FEATURE\n" && \ + echo "Fork from: $FORK_FROM\n" && \ + echo "Repositry URL: $REPO_URL\n" && \ + echo "Branch: $BRANCH\n" && \ + git clone $REPO_URL -b $BRANCH . && \ + cargo run --features=$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $FORK_FROM From 383bd1491066e00eff3fc999b27fc4087443b28f Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 26 Jul 2022 13:35:13 +0000 Subject: [PATCH 0442/1274] fix: restore ability to run try-runtime Signed-off-by: Yaroslav Bolyukin --- node/cli/Cargo.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index e5fd27e9c4..d32eed39b0 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -328,4 +328,8 @@ runtime-benchmarks = [ 'opal-runtime/runtime-benchmarks', 'polkadot-service/runtime-benchmarks', ] -try-runtime = [] +try-runtime = [ + 'unique-runtime?/try-runtime', + 'quartz-runtime?/try-runtime', + 'opal-runtime?/try-runtime', +] From 49760fdbb603e1655b078c0146dcfe7808609fdb Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 17 Aug 2022 14:19:18 +0300 Subject: [PATCH 0443/1274] job concurency --- .github/workflows/build-test-master.yml | 4 ++++ .github/workflows/codestyle.yml | 8 ++++++++ .github/workflows/fork-update-withdata.yml | 4 ++++ .github/workflows/forkless-update-nodata.yml | 10 ++++++++++ .github/workflows/node_build_test.yml | 4 ++++ .github/workflows/tests_codestyle.yml | 4 ++++ .github/workflows/try-runtime.yml | 4 ++++ 7 files changed, 38 insertions(+) diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml index 4f52ff0dd5..d7eefe6d17 100644 --- a/.github/workflows/build-test-master.yml +++ b/.github/workflows/build-test-master.yml @@ -27,6 +27,10 @@ jobs: runs-on: [self-hosted-ci,large] timeout-minutes: 1380 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + name: ${{ matrix.network }} continue-on-error: true #Do not stop testing of matrix runs failed. diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 7cb19d5e2f..1b673ef6eb 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -13,6 +13,10 @@ on: jobs: rustfmt: runs-on: self-hosted-ci + + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true steps: - name: Skip if pull request is in Draft @@ -47,6 +51,10 @@ jobs: clippy: if: ${{ false }} runs-on: self-hosted-ci + + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true steps: - name: Skip if pull request is in Draft diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/fork-update-withdata.yml index 17b9a6c73d..288cc577ad 100644 --- a/.github/workflows/fork-update-withdata.yml +++ b/.github/workflows/fork-update-withdata.yml @@ -27,6 +27,10 @@ jobs: runs-on: [self-hosted-ci,large] timeout-minutes: 1380 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + name: ${{ matrix.network }} continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 472da7da0a..0bc3cb71c4 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -29,6 +29,11 @@ jobs: runs-on: self-hosted-ci outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} + + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + steps: - name: Clean Workspace @@ -57,6 +62,11 @@ jobs: needs: prepare-execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci,medium] + + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + timeout-minutes: 1380 name: ${{ matrix.network }} diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index ef97d6f405..e892755cc3 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -26,6 +26,10 @@ jobs: runs-on: [self-hosted-ci,medium] timeout-minutes: 1380 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + name: ${{ matrix.network }} continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. diff --git a/.github/workflows/tests_codestyle.yml b/.github/workflows/tests_codestyle.yml index 13ed3805e8..b597757bb1 100644 --- a/.github/workflows/tests_codestyle.yml +++ b/.github/workflows/tests_codestyle.yml @@ -14,6 +14,10 @@ jobs: code_style: runs-on: self-hosted-ci + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + steps: - name: Skip if pull request is in Draft # `if: github.event.pull_request.draft == true` should be kept here, at diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 6fdb65ab76..9544536e32 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -25,6 +25,10 @@ jobs: # The type of runner that the job will run on runs-on: self-hosted-ci + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + name: ${{ matrix.network }} - Try-runtime continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. From 032326eb63c9da1975f9cf9ab33e10ca74c38cde Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 17 Aug 2022 14:29:02 +0300 Subject: [PATCH 0444/1274] change concurency scope --- .github/workflows/build-test-master.yml | 8 ++++---- .github/workflows/codestyle.yml | 14 +++++--------- .github/workflows/fork-update-withdata.yml | 8 ++++---- .github/workflows/forkless-update-nodata.yml | 12 +++++------- .github/workflows/node_build_test.yml | 8 ++++---- .github/workflows/tests_codestyle.yml | 8 ++++---- .github/workflows/try-runtime.yml | 12 ++++++------ 7 files changed, 32 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml index d7eefe6d17..eaa09c80cf 100644 --- a/.github/workflows/build-test-master.yml +++ b/.github/workflows/build-test-master.yml @@ -19,6 +19,10 @@ on: env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -27,10 +31,6 @@ jobs: runs-on: [self-hosted-ci,large] timeout-minutes: 1380 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - name: ${{ matrix.network }} continue-on-error: true #Do not stop testing of matrix runs failed. diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 1b673ef6eb..467eacd9c0 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -10,13 +10,13 @@ on: - synchronize - ready_for_review +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: rustfmt: runs-on: self-hosted-ci - - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true steps: - name: Skip if pull request is in Draft @@ -51,11 +51,7 @@ jobs: clippy: if: ${{ false }} runs-on: self-hosted-ci - - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - + steps: - name: Skip if pull request is in Draft # `if: github.event.pull_request.draft == true` should be kept here, at diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/fork-update-withdata.yml index 288cc577ad..deb43b82f0 100644 --- a/.github/workflows/fork-update-withdata.yml +++ b/.github/workflows/fork-update-withdata.yml @@ -19,6 +19,10 @@ on: env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -27,10 +31,6 @@ jobs: runs-on: [self-hosted-ci,large] timeout-minutes: 1380 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - name: ${{ matrix.network }} continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 0bc3cb71c4..b223090a7b 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -19,6 +19,10 @@ on: env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -30,10 +34,6 @@ jobs: outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - steps: - name: Clean Workspace @@ -63,9 +63,7 @@ jobs: # The type of runner that the job will run on runs-on: [self-hosted-ci,medium] - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + timeout-minutes: 1380 diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/node_build_test.yml index e892755cc3..1418560484 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/node_build_test.yml @@ -19,6 +19,10 @@ on: env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: dev_build_test: @@ -26,10 +30,6 @@ jobs: runs-on: [self-hosted-ci,medium] timeout-minutes: 1380 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - name: ${{ matrix.network }} continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. diff --git a/.github/workflows/tests_codestyle.yml b/.github/workflows/tests_codestyle.yml index b597757bb1..cc20d61638 100644 --- a/.github/workflows/tests_codestyle.yml +++ b/.github/workflows/tests_codestyle.yml @@ -10,14 +10,14 @@ on: - synchronize - ready_for_review +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: code_style: runs-on: self-hosted-ci - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - steps: - name: Skip if pull request is in Draft # `if: github.event.pull_request.draft == true` should be kept here, at diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 9544536e32..9093c62de0 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -19,17 +19,17 @@ on: env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: try-runtime: # The type of runner that the job will run on runs-on: self-hosted-ci - - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - - name: ${{ matrix.network }} - Try-runtime + + name: ${{ matrix.network }} continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. From f59d814cf24db73612ec74cdae8d0c2eeca1f371 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 12:27:18 +0300 Subject: [PATCH 0445/1274] tests: add unit tests in a parallel to integration tests with autosealed mode --- .docker/Dockerfile-chain-dev | 7 +- .docker/Dockerfile-chain-dev-unit | 28 ++++++++ .docker/docker-compose-dev.yaml | 10 --- ...mpose.tmp.j2 => docker-compose.tmp-dev.j2} | 17 +++-- .docker/docker-compose.tmp-unit.j2 | 16 +++++ ...ode_build_test.yml => dev-build-tests.yml} | 72 +++++++++++++++++-- 6 files changed, 126 insertions(+), 24 deletions(-) create mode 100644 .docker/Dockerfile-chain-dev-unit rename .docker/{docker-compose.tmp.j2 => docker-compose.tmp-dev.j2} (52%) create mode 100644 .docker/docker-compose.tmp-unit.j2 rename .github/workflows/{node_build_test.yml => dev-build-tests.yml} (62%) diff --git a/.docker/Dockerfile-chain-dev b/.docker/Dockerfile-chain-dev index 007ece91be..af07fec2fa 100644 --- a/.docker/Dockerfile-chain-dev +++ b/.docker/Dockerfile-chain-dev @@ -11,9 +11,6 @@ ENV PATH="/cargo-home/bin:$PATH" RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none ARG RUST_TOOLCHAIN= -ARG POLKADOT_BUILD_BRANCH= -ARG BRANCH= -ARG REPO_URL= ARG FEATURE= RUN rustup toolchain uninstall $(rustup toolchain list) && \ @@ -21,7 +18,9 @@ RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup default $RUST_TOOLCHAIN && \ rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN -RUN mkdir /dev_chain && git clone $REPO_URL -b $BRANCH /dev_chain +RUN mkdir /dev_chain +COPY . /dev_chain + WORKDIR /dev_chain RUN cargo build --release diff --git a/.docker/Dockerfile-chain-dev-unit b/.docker/Dockerfile-chain-dev-unit new file mode 100644 index 0000000000..1f85306b86 --- /dev/null +++ b/.docker/Dockerfile-chain-dev-unit @@ -0,0 +1,28 @@ +FROM ubuntu:20.04 + +ENV DEBIAN_FRONTEND=noninteractive +ENV TZ=Etc/UTC + +RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +ARG RUST_TOOLCHAIN= +ARG FEATURE= + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install $RUST_TOOLCHAIN && \ + rustup default $RUST_TOOLCHAIN && \ + rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN + +RUN mkdir /dev_chain +COPY . /dev_chain + +WORKDIR /dev_chain + +RUN cargo test --features=limit-testing + +CMD cargo test --features=limit-testing \ No newline at end of file diff --git a/.docker/docker-compose-dev.yaml b/.docker/docker-compose-dev.yaml index 303fe36676..87989b4a5d 100644 --- a/.docker/docker-compose-dev.yaml +++ b/.docker/docker-compose-dev.yaml @@ -7,13 +7,3 @@ services: dockerfile: .docker/Dockerfile-chain-dev image: node-dev container_name: node-dev - expose: - - 9944 - - 9933 - ports: - - 127.0.0.1:9944:9944 - - 127.0.0.1:9933:9933 - logging: - options: - max-size: "1m" - max-file: "3" diff --git a/.docker/docker-compose.tmp.j2 b/.docker/docker-compose.tmp-dev.j2 similarity index 52% rename from .docker/docker-compose.tmp.j2 rename to .docker/docker-compose.tmp-dev.j2 index 12d4775478..c9401d9f12 100644 --- a/.docker/docker-compose.tmp.j2 +++ b/.docker/docker-compose.tmp-dev.j2 @@ -5,9 +5,18 @@ services: build: args: - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - - "BRANCH={{ BRANCH }}" - - "REPO_URL={{ REPO_URL }}" - "FEATURE={{ FEATURE }}" - - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - + context: ../ + dockerfile: .docker/Dockerfile-chain-dev + expose: + - 9944 + - 9933 + ports: + - 127.0.0.1:9944:9944 + - 127.0.0.1:9933:9933 + logging: + options: + max-size: "1m" + max-file: "3" command: cargo run --release --features=$FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external + \ No newline at end of file diff --git a/.docker/docker-compose.tmp-unit.j2 b/.docker/docker-compose.tmp-unit.j2 new file mode 100644 index 0000000000..db394cc7fe --- /dev/null +++ b/.docker/docker-compose.tmp-unit.j2 @@ -0,0 +1,16 @@ +version: "3.5" + +services: + node-dev: + build: + context: ../ + dockerfile: .docker/Dockerfile-chain-dev-unit + args: + - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" + - "FEATURE={{ FEATURE }}" + logging: + options: + max-size: "1m" + max-file: "3" + + \ No newline at end of file diff --git a/.github/workflows/node_build_test.yml b/.github/workflows/dev-build-tests.yml similarity index 62% rename from .github/workflows/node_build_test.yml rename to .github/workflows/dev-build-tests.yml index 1418560484..eda3735179 100644 --- a/.github/workflows/node_build_test.yml +++ b/.github/workflows/dev-build-tests.yml @@ -1,4 +1,4 @@ -name: Yarn test dev +name: yarn test dev # Controls when the action will run. on: @@ -25,7 +25,8 @@ concurrency: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - dev_build_test: + + dev_build_int_tests: # The type of runner that the job will run on runs-on: [self-hosted-ci,medium] timeout-minutes: 1380 @@ -77,14 +78,12 @@ jobs: - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 with: - template: .docker/docker-compose.tmp.j2 + template: .docker/docker-compose.tmp-dev.j2 output_file: .docker/docker-compose.${{ matrix.network }}.yml variables: | - REPO_URL=${{ github.server_url }}/${{ github.repository }}.git RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} FEATURE=${{ matrix.features }} - BRANCH=${{ github.head_ref }} + - name: Show build configuration run: cat .docker/docker-compose.${{ matrix.network }}.yml @@ -124,3 +123,64 @@ jobs: - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + + + dev_build_unit_test: + # The type of runner that the job will run on + runs-on: [self-hosted-ci,medium] + timeout-minutes: 1380 + + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + + steps: + - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-unit.j2 + output_file: .docker/docker-compose.unit.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + FEATURE=${{ matrix.features }} + + + - name: Show build configuration + run: cat .docker/docker-compose.unit.yml + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" up -d --build + + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" down From 9a483c86e2bb609a7ab7953e58c4d4bd0f61747e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 12:29:35 +0300 Subject: [PATCH 0446/1274] Fix: Newline add to EOF --- .docker/Dockerfile-chain-dev-unit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile-chain-dev-unit b/.docker/Dockerfile-chain-dev-unit index 1f85306b86..0e197c10da 100644 --- a/.docker/Dockerfile-chain-dev-unit +++ b/.docker/Dockerfile-chain-dev-unit @@ -25,4 +25,4 @@ WORKDIR /dev_chain RUN cargo test --features=limit-testing -CMD cargo test --features=limit-testing \ No newline at end of file +CMD cargo test --features=limit-testing From e89876d5617f4b990ef3dbc894b5e974a8213df5 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 12:33:57 +0300 Subject: [PATCH 0447/1274] tests: conver uppercase names to lowercase names --- .github/workflows/dev-build-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev-build-tests.yml b/.github/workflows/dev-build-tests.yml index eda3735179..63a6a03374 100644 --- a/.github/workflows/dev-build-tests.yml +++ b/.github/workflows/dev-build-tests.yml @@ -38,11 +38,11 @@ jobs: strategy: matrix: include: - - network: "Opal" + - network: "opal" features: "opal-runtime" - - network: "Quartz" + - network: "quartz" features: "quartz-runtime" - - network: "Unique" + - network: "unique" features: "unique-runtime" steps: From d948a2735af86d78f47c69006c3be8dda52e0c69 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 12:36:58 +0300 Subject: [PATCH 0448/1274] tests: add name for the job --- .github/workflows/dev-build-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dev-build-tests.yml b/.github/workflows/dev-build-tests.yml index 63a6a03374..757ff44001 100644 --- a/.github/workflows/dev-build-tests.yml +++ b/.github/workflows/dev-build-tests.yml @@ -130,6 +130,8 @@ jobs: runs-on: [self-hosted-ci,medium] timeout-minutes: 1380 + name: unit tests + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. From 918c44a5537b6acc5f3d4abfaa028e75dffae45a Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 13:13:26 +0300 Subject: [PATCH 0449/1274] tests: rename step and remove orphaned containers --- .github/workflows/dev-build-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev-build-tests.yml b/.github/workflows/dev-build-tests.yml index 757ff44001..4a4f3a0325 100644 --- a/.github/workflows/dev-build-tests.yml +++ b/.github/workflows/dev-build-tests.yml @@ -89,7 +89,7 @@ jobs: run: cat .docker/docker-compose.${{ matrix.network }}.yml - name: Build the stack - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans - uses: actions/setup-node@v3 with: @@ -111,7 +111,7 @@ jobs: id: test-report if: success() || failure() # run this step even if previous step failed with: - name: Tests ${{ matrix.network }} # Name of the check run which will be created + name: int test results: ${{ matrix.network }} # Name of the check run which will be created path: tests/mochawesome-report/test-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' @@ -180,7 +180,7 @@ jobs: run: cat .docker/docker-compose.unit.yml - name: Build the stack - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" up -d --build + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" up -d --build --remove-orphans - name: Stop running containers From d94acf9f03238f6ee3b26014a6d714e125d87d3b Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 13:17:54 +0300 Subject: [PATCH 0450/1274] tests: remove semicolumn from step name --- .github/workflows/dev-build-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev-build-tests.yml b/.github/workflows/dev-build-tests.yml index 4a4f3a0325..240224c1e5 100644 --- a/.github/workflows/dev-build-tests.yml +++ b/.github/workflows/dev-build-tests.yml @@ -111,7 +111,7 @@ jobs: id: test-report if: success() || failure() # run this step even if previous step failed with: - name: int test results: ${{ matrix.network }} # Name of the check run which will be created + name: int test results - ${{ matrix.network }} # Name of the check run which will be created path: tests/mochawesome-report/test-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' From b7c6b4899c01e204d3aafe94e3352a382d3b02e6 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 14:06:33 +0300 Subject: [PATCH 0451/1274] tests: change job name to lowercase --- .github/workflows/codestyle.yml | 2 +- .github/workflows/fork-update-withdata.yml | 8 ++++---- .github/workflows/forkless-update-nodata.yml | 8 ++++---- .github/workflows/tests_codestyle.yml | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 467eacd9c0..73e16d7ef0 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -1,4 +1,4 @@ -name: Code style +name: cargo fmt on: pull_request: diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/fork-update-withdata.yml index deb43b82f0..087c631031 100644 --- a/.github/workflows/fork-update-withdata.yml +++ b/.github/workflows/fork-update-withdata.yml @@ -1,4 +1,4 @@ -name: Upgrade replica +name: upgrade replica # Controls when the action will run. on: @@ -38,15 +38,15 @@ jobs: strategy: matrix: include: - - network: Opal + - network: opal features: opal-runtime runtime: opal fork_from_address: wss://eu-ws-opal.unique.network:443 - - network: Quartz + - network: quartz features: quartz-runtime runtime: quartz fork_from_address: wss://eu-ws-quartz.unique.network:443 - - network: Unique + - network: unique features: unique-runtime runtime: unique fork_from_address: wss://eu-ws.unique.network:443 diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index b223090a7b..fbbf72ed9b 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -1,4 +1,4 @@ -name: Upgrade nodata +name: upgrade nodata # Controls when the action will run. on: @@ -52,9 +52,9 @@ jobs: id: create_matrix with: matrix: | - network {Opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} - network {Quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} - network {Unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} diff --git a/.github/workflows/tests_codestyle.yml b/.github/workflows/tests_codestyle.yml index cc20d61638..f2b07afaec 100644 --- a/.github/workflows/tests_codestyle.yml +++ b/.github/workflows/tests_codestyle.yml @@ -1,4 +1,4 @@ -name: Tests code style +name: yarn eslint on: pull_request: From bcea5a567958e31f2261fda20895be3090aff022 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 14:21:22 +0300 Subject: [PATCH 0452/1274] tests: new line at EOF --- .docker/docker-compose.tmp-dev.j2 | 1 - .docker/docker-compose.tmp-unit.j2 | 2 -- 2 files changed, 3 deletions(-) diff --git a/.docker/docker-compose.tmp-dev.j2 b/.docker/docker-compose.tmp-dev.j2 index c9401d9f12..27ac397661 100644 --- a/.docker/docker-compose.tmp-dev.j2 +++ b/.docker/docker-compose.tmp-dev.j2 @@ -19,4 +19,3 @@ services: max-size: "1m" max-file: "3" command: cargo run --release --features=$FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external - \ No newline at end of file diff --git a/.docker/docker-compose.tmp-unit.j2 b/.docker/docker-compose.tmp-unit.j2 index db394cc7fe..c8bb94706c 100644 --- a/.docker/docker-compose.tmp-unit.j2 +++ b/.docker/docker-compose.tmp-unit.j2 @@ -12,5 +12,3 @@ services: options: max-size: "1m" max-file: "3" - - \ No newline at end of file From 096d422468b809fcfa198feba2d0eb953918489e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 15:24:37 +0300 Subject: [PATCH 0453/1274] fix: remove duplicate string --- .docker/Dockerfile-chain-dev-unit | 2 -- 1 file changed, 2 deletions(-) diff --git a/.docker/Dockerfile-chain-dev-unit b/.docker/Dockerfile-chain-dev-unit index 0e197c10da..96f307d2a5 100644 --- a/.docker/Dockerfile-chain-dev-unit +++ b/.docker/Dockerfile-chain-dev-unit @@ -23,6 +23,4 @@ COPY . /dev_chain WORKDIR /dev_chain -RUN cargo test --features=limit-testing - CMD cargo test --features=limit-testing From 59d6fa32d24e33297b8c73a7d56a81f17e2ced6f Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 15:33:00 +0300 Subject: [PATCH 0454/1274] fix: replace CMD with RUN due to CMD not works at build stage(start options up --build) --- .docker/Dockerfile-chain-dev-unit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile-chain-dev-unit b/.docker/Dockerfile-chain-dev-unit index 96f307d2a5..93145d6ff0 100644 --- a/.docker/Dockerfile-chain-dev-unit +++ b/.docker/Dockerfile-chain-dev-unit @@ -23,4 +23,4 @@ COPY . /dev_chain WORKDIR /dev_chain -CMD cargo test --features=limit-testing +RUN cargo test --features=limit-testing From 6fd78602200ef1ec38d91ca2569f9563a1d501aa Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 18:14:23 +0300 Subject: [PATCH 0455/1274] tests: change docker-compose file and workflow for forkless upgrade --- .docker/Dockerfile-parachain-upgrade | 12 ++- ...fork => Dockerfile-parachain-upgrade-data} | 9 ++- ...kless.yaml => docker-compose-forkless.yml} | 0 .docker/docker-compose.opal.yml | 33 ++++++++ .docker/docker-compose.tmp-forkless-data.j2 | 36 +++++++++ .docker/docker-compose.tmp-forkless-nodata.j2 | 33 ++++++++ .docker/docker-compose.tmp-forkless.j2 | 14 ---- .docker/forking/docker-compose-fork.yaml | 28 ------- .docker/forking/docker-compose.tmp-fork.j2 | 13 ---- .../{forking => forkless-config}/fork.jsonnet | 0 .../launch-config-forkless-data.j2} | 0 .../launch-config-forkless-nodata.j2} | 0 ...-withdata.yml => forkless-update-data.yml} | 44 +++++------ .github/workflows/forkless-update-nodata.yml | 75 +++++++++---------- 14 files changed, 164 insertions(+), 133 deletions(-) rename .docker/{forking/Dockerfile-parachain-live-fork => Dockerfile-parachain-upgrade-data} (95%) rename .docker/{docker-compose-forkless.yaml => docker-compose-forkless.yml} (100%) create mode 100644 .docker/docker-compose.opal.yml create mode 100644 .docker/docker-compose.tmp-forkless-data.j2 create mode 100644 .docker/docker-compose.tmp-forkless-nodata.j2 delete mode 100644 .docker/docker-compose.tmp-forkless.j2 delete mode 100644 .docker/forking/docker-compose-fork.yaml delete mode 100644 .docker/forking/docker-compose.tmp-fork.j2 rename .docker/{forking => forkless-config}/fork.jsonnet (100%) rename .docker/{forking/launch-config-fork.j2 => forkless-config/launch-config-forkless-data.j2} (100%) rename .docker/{launch-config.j2 => forkless-config/launch-config-forkless-nodata.j2} (100%) rename .github/workflows/{fork-update-withdata.yml => forkless-update-data.yml} (78%) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index f8a222a4a6..1dfbd5ff2c 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -25,8 +25,8 @@ RUN rustup toolchain uninstall $(rustup toolchain list) && \ RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN -#RUN mkdir /unique_parachain -#WORKDIR /unique_parachain +RUN mkdir /unique_parachain +WORKDIR /unique_parachain # ===== BUILD current version ====== @@ -37,7 +37,6 @@ ARG FEATURE= ARG MAINNET_BRANCH= ARG REPO_URL= -RUN mkdir /unique_parachain WORKDIR /unique_parachain RUN git clone $REPO_URL -b $MAINNET_BRANCH . && \ @@ -52,11 +51,10 @@ ARG FEATURE= ARG BRANCH= ARG REPO_URL= -RUN mkdir /unique_parachain +COPY . /unique_parachain WORKDIR /unique_parachain -RUN git clone $REPO_URL -b $BRANCH . && \ - cargo build --features=$FEATURE --$PROFILE +RUN cargo build --features=$FEATURE --$PROFILE # ===== BUILD POLKADOT ===== FROM rust-builder as builder-polkadot @@ -64,7 +62,7 @@ FROM rust-builder as builder-polkadot ARG POLKADOT_BUILD_BRANCH= ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH -RUN mkdir /unique_parachain + WORKDIR /unique_parachain RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ diff --git a/.docker/forking/Dockerfile-parachain-live-fork b/.docker/Dockerfile-parachain-upgrade-data similarity index 95% rename from .docker/forking/Dockerfile-parachain-live-fork rename to .docker/Dockerfile-parachain-upgrade-data index 22eb081908..3480f4d33f 100644 --- a/.docker/forking/Dockerfile-parachain-live-fork +++ b/.docker/Dockerfile-parachain-upgrade-data @@ -25,6 +25,9 @@ RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup show RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + # ===== BUILD target version ====== FROM rust-builder as builder-unique-target @@ -33,11 +36,10 @@ ARG FEATURE= ARG BRANCH= ARG REPO_URL= -RUN mkdir /unique_parachain +COPY . /unique_parachain WORKDIR /unique_parachain -RUN git clone $REPO_URL -b $BRANCH . && \ - cargo build --features=$FEATURE --$PROFILE +RUN cargo build --features=$FEATURE --$PROFILE # ===== BUILD POLKADOT ===== FROM rust-builder as builder-polkadot @@ -45,7 +47,6 @@ FROM rust-builder as builder-polkadot ARG POLKADOT_BUILD_BRANCH= ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH -RUN mkdir /unique_parachain WORKDIR /unique_parachain RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ diff --git a/.docker/docker-compose-forkless.yaml b/.docker/docker-compose-forkless.yml similarity index 100% rename from .docker/docker-compose-forkless.yaml rename to .docker/docker-compose-forkless.yml diff --git a/.docker/docker-compose.opal.yml b/.docker/docker-compose.opal.yml new file mode 100644 index 0000000000..737eefbb48 --- /dev/null +++ b/.docker/docker-compose.opal.yml @@ -0,0 +1,33 @@ +version: "3.5" + +services: + node-parachain: + build: + args: + - "RUST_TOOLCHAIN=nightly-2022-07-24" + - "BRANCH=release-v927020" + - "REPO_URL=https://github.com/UniqueNetwork/unique-chain.git" + - "FEATURE=quartz-runtime" + - "RUNTIME=quartz" + - "POLKADOT_BUILD_BRANCH=release-v0.9.27" + - "MAINNET_TAG=" + - "MAINNET_BRANCH=quartz-v924012-2" + context: ../ + dockerfile: .docker/Dockerfile-parachain-upgrade + image: node-parachain + container_name: node-parachain + volumes: + - type: bind + source: ./launch-config-forkless-nodata.json + target: /polkadot-launch/launch-config.json + read_only: true + expose: + - 9944 + - 9933 + ports: + - 127.0.0.1:9944:9944 + - 127.0.0.1:9933:9933 + logging: + options: + max-size: "1m" + max-file: "3" diff --git a/.docker/docker-compose.tmp-forkless-data.j2 b/.docker/docker-compose.tmp-forkless-data.j2 new file mode 100644 index 0000000000..730ddab85a --- /dev/null +++ b/.docker/docker-compose.tmp-forkless-data.j2 @@ -0,0 +1,36 @@ +version: "3.5" + +services: + node-parachain: + build: + args: + - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" + - "BRANCH={{ BRANCH }}" + - "REPO_URL={{ REPO_URL }}" + - "FEATURE={{ FEATURE }}" + - "RUNTIME={{ RUNTIME }}" + - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" + - "FORK_FROM={{ FORK_FROM }}" + context: ./ + dockerfile: ./Dockerfile-parachain-upgrade-data + image: node-parachain + container_name: node-parachain + volumes: + - type: bind + source: ./launch-config-forkless-data.json + target: /polkadot-launch/launch-config.json + read_only: true + - type: bind + source: ./fork.jsonnet + target: /polkadot-launch/fork.jsonnet + read_only: true + expose: + - 9944 + - 9933 + ports: + - 127.0.0.1:9944:9944 + - 127.0.0.1:9933:9933 + logging: + options: + max-size: "1m" + max-file: "3" \ No newline at end of file diff --git a/.docker/docker-compose.tmp-forkless-nodata.j2 b/.docker/docker-compose.tmp-forkless-nodata.j2 new file mode 100644 index 0000000000..66f9ec634b --- /dev/null +++ b/.docker/docker-compose.tmp-forkless-nodata.j2 @@ -0,0 +1,33 @@ +version: "3.5" + +services: + node-parachain: + build: + args: + - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" + - "BRANCH={{ BRANCH }}" + - "REPO_URL={{ REPO_URL }}" + - "FEATURE={{ FEATURE }}" + - "RUNTIME={{ RUNTIME }}" + - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" + - "MAINNET_TAG={{ MAINNET_TAG }}" + - "MAINNET_BRANCH={{ MAINNET_BRANCH }}" + context: ../ + dockerfile: .docker/Dockerfile-parachain-upgrade + image: node-parachain + container_name: node-parachain + volumes: + - type: bind + source: ./launch-config-forkless-nodata.json + target: /polkadot-launch/launch-config.json + read_only: true + expose: + - 9944 + - 9933 + ports: + - 127.0.0.1:9944:9944 + - 127.0.0.1:9933:9933 + logging: + options: + max-size: "1m" + max-file: "3" diff --git a/.docker/docker-compose.tmp-forkless.j2 b/.docker/docker-compose.tmp-forkless.j2 deleted file mode 100644 index ab2ec92803..0000000000 --- a/.docker/docker-compose.tmp-forkless.j2 +++ /dev/null @@ -1,14 +0,0 @@ -version: "3.5" - -services: - node-parachain: - build: - args: - - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - - "BRANCH={{ BRANCH }}" - - "REPO_URL={{ REPO_URL }}" - - "FEATURE={{ FEATURE }}" - - "RUNTIME={{ RUNTIME }}" - - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - - "MAINNET_TAG={{ MAINNET_TAG }}" - - "MAINNET_BRANCH={{ MAINNET_BRANCH }}" diff --git a/.docker/forking/docker-compose-fork.yaml b/.docker/forking/docker-compose-fork.yaml deleted file mode 100644 index e4fcff2504..0000000000 --- a/.docker/forking/docker-compose-fork.yaml +++ /dev/null @@ -1,28 +0,0 @@ -version: "3.5" - -services: - parachain-fork: - build: - context: ./ - dockerfile: ./Dockerfile-parachain-live-fork - image: parachain-fork - container_name: parachain-fork - volumes: - - type: bind - source: ./launch-config-fork.json - target: /polkadot-launch/launch-config.json - read_only: true - - type: bind - source: ./fork.jsonnet - target: /polkadot-launch/fork.jsonnet - read_only: true - expose: - - 9944 - - 9933 - ports: - - 127.0.0.1:9944:9944 - - 127.0.0.1:9933:9933 - logging: - options: - max-size: "1m" - max-file: "3" diff --git a/.docker/forking/docker-compose.tmp-fork.j2 b/.docker/forking/docker-compose.tmp-fork.j2 deleted file mode 100644 index 9a34999c98..0000000000 --- a/.docker/forking/docker-compose.tmp-fork.j2 +++ /dev/null @@ -1,13 +0,0 @@ -version: "3.5" - -services: - parachain-fork: - build: - args: - - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - - "BRANCH={{ BRANCH }}" - - "REPO_URL={{ REPO_URL }}" - - "FEATURE={{ FEATURE }}" - - "RUNTIME={{ RUNTIME }}" - - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - - "FORK_FROM={{ FORK_FROM }}" diff --git a/.docker/forking/fork.jsonnet b/.docker/forkless-config/fork.jsonnet similarity index 100% rename from .docker/forking/fork.jsonnet rename to .docker/forkless-config/fork.jsonnet diff --git a/.docker/forking/launch-config-fork.j2 b/.docker/forkless-config/launch-config-forkless-data.j2 similarity index 100% rename from .docker/forking/launch-config-fork.j2 rename to .docker/forkless-config/launch-config-forkless-data.j2 diff --git a/.docker/launch-config.j2 b/.docker/forkless-config/launch-config-forkless-nodata.j2 similarity index 100% rename from .docker/launch-config.j2 rename to .docker/forkless-config/launch-config-forkless-nodata.j2 diff --git a/.github/workflows/fork-update-withdata.yml b/.github/workflows/forkless-update-data.yml similarity index 78% rename from .github/workflows/fork-update-withdata.yml rename to .github/workflows/forkless-update-data.yml index deb43b82f0..4aeb5031a1 100644 --- a/.github/workflows/fork-update-withdata.yml +++ b/.github/workflows/forkless-update-data.yml @@ -1,4 +1,4 @@ -name: Upgrade replica +name: upgrade replica # Controls when the action will run. on: @@ -26,7 +26,7 @@ concurrency: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - fork-update-withdata: + forkless-update-data: # The type of runner that the job will run on runs-on: [self-hosted-ci,large] timeout-minutes: 1380 @@ -38,15 +38,15 @@ jobs: strategy: matrix: include: - - network: Opal + - network: opal features: opal-runtime runtime: opal fork_from_address: wss://eu-ws-opal.unique.network:443 - - network: Quartz + - network: quartz features: quartz-runtime runtime: quartz fork_from_address: wss://eu-ws-quartz.unique.network:443 - - network: Unique + - network: unique features: unique-runtime runtime: unique fork_from_address: wss://eu-ws.unique.network:443 @@ -84,8 +84,8 @@ jobs: - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 with: - template: .docker/forking/docker-compose.tmp-fork.j2 - output_file: .docker/forking/docker-compose.${{ matrix.network }}.yml + template: .docker/docker-compose.tmp-forkless-data.j2 + output_file: .docker/docker-compose.${{ matrix.network }}.yml variables: | REPO_URL=${{ github.server_url }}/${{ github.repository }}.git RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} @@ -99,21 +99,21 @@ jobs: - name: Show build configuration run: cat .docker/forking/docker-compose.${{ matrix.network }}.yml - - name: Generate launch-config-fork.json + - name: Generate launch-config-forkless-data.json uses: cuchi/jinja2-action@v1.2.0 with: - template: .docker/forking/launch-config-fork.j2 - output_file: .docker/forking/launch-config-fork.json + template: .docker/forkless-config/launch-config-forkless-data.j2 + output_file: .docker/launch-config-forkless-data.json variables: | FEATURE=${{ matrix.features }} RUNTIME=${{ matrix.runtime }} - - name: Show launch-config-fork configuration - run: cat .docker/forking/launch-config-fork.json + - name: Show launch-config-forkless configuration + run: cat .docker/launch-config-forkless-data.json - name: Build the stack - run: docker-compose -f ".docker/forking/docker-compose-fork.yaml" -f ".docker/forking/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 + run: docker-compose -f ".docker/forking/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 - name: Check if docker logs consist logs related to Runtime Upgrade testing. if: success() @@ -151,20 +151,12 @@ jobs: if: success() || failure() uses: jwalton/gh-docker-logs@v2.2.0 with: - dest: './fork-parachain-update-withdata-logs.${{ matrix.features }}' - images: 'parachain-fork' + dest: './forkless-parachain-upgrade-data-logs.${{ matrix.features }}.log' + images: 'node-parachain' - - name: Tar logs - if: success() || failure() - run: tar cvzf ./fork-parachain-update-withdata-logs.${{ matrix.features }}.tgz ./fork-parachain-update-withdata-logs.${{ matrix.features }} - - - name: Upload logs to GitHub - if: success() || failure() - uses: actions/upload-artifact@master - with: - name: fork-parachain-update-withdata-logs.${{ matrix.features }}.tgz - path: ./fork-parachain-update-withdata-logs.${{ matrix.features }}.tgz + - name: Show Docker logs + run: cat './forkless-parachain-upgrade-data-logs.${{ matrix.features }}.log' - name: Stop running containers if: always() # run this step always - run: docker-compose -f ".docker/forking/docker-compose-fork.yaml" -f ".docker/forking/docker-compose.${{ matrix.network }}.yml" down + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index b223090a7b..39080f60b4 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -1,4 +1,4 @@ -name: Upgrade nodata +name: upgrade nodata # Controls when the action will run. on: @@ -61,7 +61,7 @@ jobs: forkless-update-nodata: needs: prepare-execution-marix # The type of runner that the job will run on - runs-on: [self-hosted-ci,medium] + runs-on: [self-hosted-ci,large] @@ -109,7 +109,7 @@ jobs: - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 with: - template: .docker/docker-compose.tmp-forkless.j2 + template: .docker/docker-compose.tmp-forkless-nodata.j2 output_file: .docker/docker-compose.${{ matrix.network }}.yml variables: | REPO_URL=${{ github.server_url }}/${{ github.repository }}.git @@ -125,21 +125,21 @@ jobs: - name: Show build configuration run: cat .docker/docker-compose.${{ matrix.network }}.yml - - name: Generate launch-config.json + - name: Generate launch-config-forkless-nodata.json uses: cuchi/jinja2-action@v1.2.0 with: - template: .docker/launch-config.j2 - output_file: .docker/launch-config-forkless.json + template: .docker/forkless-config/launch-config-forkless-nodata.j2 + output_file: .docker/launch-config-forkless-nodata.json variables: | FEATURE=${{ matrix.features }} RUNTIME=${{ matrix.runtime }} - name: Show launch-config-forkless configuration - run: cat .docker/launch-config-forkless.json + run: cat .docker/launch-config-forkless-nodata.json - name: Build the stack - run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 - name: Check if docker logs consist logs related to Runtime Upgrade testing. if: success() @@ -153,24 +153,25 @@ jobs: } function is_started { if [ "$(check_container_status)" == "true" ]; then - echo "Container: node-parachain RUNNING"; - echo "Check Docker logs" - DOCKER_LOGS=$(do_docker_logs) - if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then - echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" - return 0 - exit 1 - else - echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸 - Not found in logs output." - return 1 - exit 1 - fi + echo "Container: node-parachain RUNNING"; + echo "Check Docker logs" + DOCKER_LOGS=$(do_docker_logs) + if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then + echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" + return 0 + elif [[ ${DOCKER_LOGS} = *"🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"* ]];then + echo "🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧" + return 1 + else + echo "Message not found in logs output, repeating..." + return 1 + fi else - echo "Container node-parachain not RUNNING" - echo "Halting all future checks" - exit 1 + echo "Container node-parachain not RUNNING" + echo "Halting all future checks" + exit 1 fi - exit 0 + exit 0 } while ! is_started; do echo "Waiting for special message in log files " @@ -178,33 +179,25 @@ jobs: counter=$(( $counter - 1 )) echo "Counter: $counter" if [ "$counter" -gt "0" ]; then - continue + continue else - break + break fi - done - echo "Halting script" - exit 0 + done + echo "Halting script" + exit 0 shell: bash - name: Collect Docker Logs if: success() || failure() uses: jwalton/gh-docker-logs@v2.2.0 with: - dest: './forkless-parachain-update-nodata-logs.${{ matrix.features }}' + dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.log' images: 'node-parachain' - - name: Tar logs - if: success() || failure() - run: tar cvzf ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz ./forkless-parachain-update-nodata-logs.${{ matrix.features }} - - - name: Upload logs to GitHub - if: success() || failure() - uses: actions/upload-artifact@master - with: - name: forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz - path: ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz + - name: Show docker logs + run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.log' - name: Stop running containers if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From ac754e12ced02a9ed10958f87b357dd262fffec6 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 18:18:44 +0300 Subject: [PATCH 0456/1274] fix: path to docker-compose file --- .github/workflows/forkless-update-data.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index 4aeb5031a1..f7d541e52a 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -97,7 +97,7 @@ jobs: FORK_FROM=${{ matrix.fork_from_address }} - name: Show build configuration - run: cat .docker/forking/docker-compose.${{ matrix.network }}.yml + run: cat .docker/docker-compose.${{ matrix.network }}.yml - name: Generate launch-config-forkless-data.json uses: cuchi/jinja2-action@v1.2.0 @@ -113,7 +113,7 @@ jobs: - name: Build the stack - run: docker-compose -f ".docker/forking/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 - name: Check if docker logs consist logs related to Runtime Upgrade testing. if: success() From 3773596c5279fac8df73854e6f8eed52dad451c4 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 18:23:42 +0300 Subject: [PATCH 0457/1274] fix: change path to configs --- .docker/docker-compose.tmp-forkless-data.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.docker/docker-compose.tmp-forkless-data.j2 b/.docker/docker-compose.tmp-forkless-data.j2 index 730ddab85a..56fbc20c40 100644 --- a/.docker/docker-compose.tmp-forkless-data.j2 +++ b/.docker/docker-compose.tmp-forkless-data.j2 @@ -11,8 +11,8 @@ services: - "RUNTIME={{ RUNTIME }}" - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - "FORK_FROM={{ FORK_FROM }}" - context: ./ - dockerfile: ./Dockerfile-parachain-upgrade-data + context: ../ + dockerfile: .docker/Dockerfile-parachain-upgrade-data image: node-parachain container_name: node-parachain volumes: @@ -21,7 +21,7 @@ services: target: /polkadot-launch/launch-config.json read_only: true - type: bind - source: ./fork.jsonnet + source: ./forkless-config/fork.jsonnet target: /polkadot-launch/fork.jsonnet read_only: true expose: From e9c057426c7091087a176ee231ce0a852e55f3e1 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 19:51:58 +0300 Subject: [PATCH 0458/1274] fix: path to log file --- .github/workflows/forkless-update-data.yml | 4 ++-- .github/workflows/forkless-update-nodata.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index f7d541e52a..eb4f9757b5 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -151,11 +151,11 @@ jobs: if: success() || failure() uses: jwalton/gh-docker-logs@v2.2.0 with: - dest: './forkless-parachain-upgrade-data-logs.${{ matrix.features }}.log' + dest: './forkless-parachain-upgrade-data-logs.${{ matrix.features }}' images: 'node-parachain' - name: Show Docker logs - run: cat './forkless-parachain-upgrade-data-logs.${{ matrix.features }}.log' + run: cat './forkless-parachain-upgrade-data-logs.${{ matrix.features }}/node-parachain.log' - name: Stop running containers if: always() # run this step always diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index 39080f60b4..dca411b4f1 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -192,11 +192,11 @@ jobs: if: success() || failure() uses: jwalton/gh-docker-logs@v2.2.0 with: - dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.log' + dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}' images: 'node-parachain' - name: Show docker logs - run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.log' + run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}/node-parachain.log' - name: Stop running containers if: always() # run this step always From 8b81bd98dc15afe4f73015bfd21be7fa6660a1c6 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 20:04:04 +0300 Subject: [PATCH 0459/1274] convert to lowercase --- .github/workflows/build-test-master.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml index eaa09c80cf..ac87d6f688 100644 --- a/.github/workflows/build-test-master.yml +++ b/.github/workflows/build-test-master.yml @@ -1,4 +1,4 @@ -name: Yarn test para +name: yarn test para # Controls when the action will run. on: @@ -38,11 +38,11 @@ jobs: strategy: matrix: include: - - network: "Opal" + - network: "opal" features: "opal-runtime" - - network: "Quartz" + - network: "quartz" features: "quartz-runtime" - - network: "Unique" + - network: "unique" features: "unique-runtime" steps: From f465c129b0385e5e75df39f1af8d3beeaa2764d9 Mon Sep 17 00:00:00 2001 From: Igor Kozyrev Date: Thu, 18 Aug 2022 02:30:43 +0000 Subject: [PATCH 0460/1274] update polkadot version dependency --- .env | 6 +++--- README.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.env b/.env index b7d82b4e36..cf06a2b13b 100644 --- a/.env +++ b/.env @@ -1,7 +1,7 @@ -RUST_TOOLCHAIN=nightly-2022-05-11 -POLKADOT_BUILD_BRANCH=release-v0.9.24 +RUST_TOOLCHAIN=nightly-2022-07-24 +POLKADOT_BUILD_BRANCH=release-v0.9.27 -POLKADOT_MAINNET_BRANCH=release-v0.9.25 +POLKADOT_MAINNET_BRANCH=release-v0.9.26 UNIQUE_MAINNET_TAG=v924010 KUSAMA_MAINNET_BRANCH=release-v0.9.26 diff --git a/README.md b/README.md index ce0f5216fb..9381de7d6b 100644 --- a/README.md +++ b/README.md @@ -51,14 +51,14 @@ curl https://sh.rustup.rs -sSf | sh 3. Install toolchain nightly-2022-05-11 and make it default: ```bash -rustup toolchain install nightly-2022-05-11 -rustup default nightly-2022-05-11 +rustup toolchain install nightly-2022-07-24 +rustup default nightly-2022-07-24 ``` 4. Add wasm target for nightly toolchain: ```bash -rustup target add wasm32-unknown-unknown --toolchain nightly-2022-05-11 +rustup target add wasm32-unknown-unknown --toolchain nightly-2022-07-24 ``` 5. Build: From 6bd537d868d33adf350af19bae2dfcd937c4de76 Mon Sep 17 00:00:00 2001 From: Igor Kozyrev Date: Thu, 18 Aug 2022 02:33:31 +0000 Subject: [PATCH 0461/1274] up runtime version --- primitives/common/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/primitives/common/Cargo.toml b/primitives/common/Cargo.toml index a31b3a0e73..df2f7986fa 100644 --- a/primitives/common/Cargo.toml +++ b/primitives/common/Cargo.toml @@ -6,7 +6,7 @@ homepage = 'https://unique.network' license = 'All Rights Reserved' name = 'up-common' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = "0.9.25" +version = "0.9.27" [features] default = ['std'] From 99b1e62d01d439048cff0894c2aa0be5792c6ea4 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 20:25:55 +0300 Subject: [PATCH 0462/1274] fix: build and start command splited to get exit code available --- .docker/Dockerfile-try-runtime | 7 ++++++- .github/workflows/try-runtime.yml | 10 ++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index 40dd20d3a1..4004eb1f25 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -35,6 +35,8 @@ FROM rust-builder as builder-unique ARG PROFILE=release ARG FEATURE= ARG FORK_FROM= +ENV FEATURE $FEATURE +ENV FORK_FROM $FORK_FROM COPY . /unique_parachain WORKDIR /unique_parachain @@ -42,4 +44,7 @@ WORKDIR /unique_parachain RUN echo "Requested features: $FEATURE\n" && \ echo "Fork from: $FORK_FROM\n" && \ - cargo run --features=$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $FORK_FROM + cargo build --features=$FEATURE --release + + +CMD cargo run --features=$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $FORK_FROM diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 225129248c..30be1d15f6 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -93,6 +93,16 @@ jobs: - name: Build the stack run: docker-compose -f ".docker/docker-compose-try-runtime.yml" -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 --remove-orphans + - name: Collect Docker Logs + if: success() || failure() + uses: jwalton/gh-docker-logs@v2.2.0 + with: + dest: './try-runtime-logs.${{ matrix.features }}' + images: 'try-runtime' + + - name: Show docker logs + run: cat './try-runtime-logs.${{ matrix.features }}/try-runtime.log' + - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-try-runtime.yml" -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" down From d65670117bc271dabf673fcce6b26b897e74a321 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 21:55:47 +0300 Subject: [PATCH 0463/1274] fix: wait for exit code from try-runtime service --- .docker/docker-compose.opal.yml | 33 ------------------------------- .github/workflows/try-runtime.yml | 8 ++++---- 2 files changed, 4 insertions(+), 37 deletions(-) delete mode 100644 .docker/docker-compose.opal.yml diff --git a/.docker/docker-compose.opal.yml b/.docker/docker-compose.opal.yml deleted file mode 100644 index 737eefbb48..0000000000 --- a/.docker/docker-compose.opal.yml +++ /dev/null @@ -1,33 +0,0 @@ -version: "3.5" - -services: - node-parachain: - build: - args: - - "RUST_TOOLCHAIN=nightly-2022-07-24" - - "BRANCH=release-v927020" - - "REPO_URL=https://github.com/UniqueNetwork/unique-chain.git" - - "FEATURE=quartz-runtime" - - "RUNTIME=quartz" - - "POLKADOT_BUILD_BRANCH=release-v0.9.27" - - "MAINNET_TAG=" - - "MAINNET_BRANCH=quartz-v924012-2" - context: ../ - dockerfile: .docker/Dockerfile-parachain-upgrade - image: node-parachain - container_name: node-parachain - volumes: - - type: bind - source: ./launch-config-forkless-nodata.json - target: /polkadot-launch/launch-config.json - read_only: true - expose: - - 9944 - - 9933 - ports: - - 127.0.0.1:9944:9944 - - 127.0.0.1:9933:9933 - logging: - options: - max-size: "1m" - max-file: "3" diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 30be1d15f6..4935576113 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -91,17 +91,17 @@ jobs: run: cat .docker/docker-compose.try-runtime.${{ matrix.network }}.yml - name: Build the stack - run: docker-compose -f ".docker/docker-compose-try-runtime.yml" -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 --remove-orphans - + run: docker-compose -f ".docker/docker-compose-try-runtime.yml" -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" up --build --force-recreate --timeout 300 --remove-orphans --exit-code-from try-runtime + - name: Collect Docker Logs if: success() || failure() uses: jwalton/gh-docker-logs@v2.2.0 with: - dest: './try-runtime-logs.${{ matrix.features }}' + dest: './try-runtime-logs.${{ matrix.network }}' images: 'try-runtime' - name: Show docker logs - run: cat './try-runtime-logs.${{ matrix.features }}/try-runtime.log' + run: cat './try-runtime-logs.${{ matrix.network }}/try-runtime.log' - name: Stop running containers if: always() # run this step always From 7572ca5b6a0eca36690f31327873f9c9b95f13b8 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 21:56:30 +0300 Subject: [PATCH 0464/1274] temporary switch to develop branch --- .github/workflows/try-runtime.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 4935576113..a47024b788 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -5,7 +5,7 @@ on: # Triggers the workflow on push or pull request events but only for the master branch pull_request: branches: - - master + - develop types: - opened - reopened From 54e6d5512f3128c44efe44558af5ea16de7a91a2 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 18 Aug 2022 22:16:45 +0300 Subject: [PATCH 0465/1274] fix: wait for exit code from container --- .github/workflows/try-runtime.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index a47024b788..4935576113 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -5,7 +5,7 @@ on: # Triggers the workflow on push or pull request events but only for the master branch pull_request: branches: - - develop + - master types: - opened - reopened From 7f428c48e2d7962ffa431a75d47cada940f26102 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 18 Aug 2022 21:24:30 +0300 Subject: [PATCH 0466/1274] ci: give money to alice on fork Signed-off-by: Yaroslav Bolyukin --- .docker/forkless-config/fork.jsonnet | 39 ++++++++++++++++- .docker/forkless-config/typeNames.jsonnet | 51 +++++++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 .docker/forkless-config/typeNames.jsonnet diff --git a/.docker/forkless-config/fork.jsonnet b/.docker/forkless-config/fork.jsonnet index affdc16067..af13f5db71 100644 --- a/.docker/forkless-config/fork.jsonnet +++ b/.docker/forkless-config/fork.jsonnet @@ -8,6 +8,8 @@ local raw = local sourceRaw = sourceChain._raw._preloadKeys; { if sourceRaw[key] != null }; +local typeNames = (import './typeNames.jsonnet')(sourceChain); + local auraKeys = [ // AuraExt.Authorities, we don't have aura pallet enabled for some reason, to refer using cql api @@ -45,6 +47,7 @@ cleanupRaw(raw) = { if std.all(std.map(function(prefix) !std.startsWith(key, prefix), unwantedPrefixes)) }; + local originalRaw = rawSpec.genesis.raw.top; local outSpec = rawSpec { genesis+: { @@ -52,8 +55,42 @@ local outSpec = rawSpec { top: cleanupRaw(raw) { [key]: originalRaw[key] for key in wantedKeys + if std.objectHas(originalRaw, key) }, }, }, }; -outSpec + +local + aliceAccount = sourceChain.System._encodeKey.Account(['0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d']), + totalIssuance = sourceChain.Balances._encodeKey.TotalIssuance([]), + unique = cql.calc(["10", "18", "**"]), + Munique = cql.calc([unique, "10", "6", "**", "*"]), +; + +outSpec { + genesis+: { + raw+: { + top+: { + [totalIssuance]: cql.calc([ + Munique, + if std.objectHas(super, totalIssuance) then sourceChain._decode(typeNames.u128, super[totalIssuance]) else '0', + if std.objectHas(super, aliceAccount) then sourceChain._decode(typeNames.AccountInfo, super[aliceAccount]).data.free else '0', + '-', '+', + ]), + [aliceAccount]: sourceChain._encode(typeNames.AccountInfo, { + nonce: 0, + consumers: 3, + providers: 1, + sufficients: 0, + data: { + free: Munique, + reserved: "0", + misc_frozen: "0", + fee_frozen: "0", + }, + },) + }, + }, + }, +} diff --git a/.docker/forkless-config/typeNames.jsonnet b/.docker/forkless-config/typeNames.jsonnet new file mode 100644 index 0000000000..82bcccefe5 --- /dev/null +++ b/.docker/forkless-config/typeNames.jsonnet @@ -0,0 +1,51 @@ +function(chain) +local + typeName(id) = local + ty = chain._meta.types.types[id], + name = if std.objectHas(ty.type, "path") then + std.join('::', ty.type.path) + else if std.objectHas(ty.type.def, "primitive") then ty.type.def.primitive + else if std.objectHas(ty.type.def, "tuple") then "(" + std.join(', ', std.map(typeName, ty.type.def.tuple)) + ")" + else if std.objectHas(ty.type.def, "sequence") then "Vec<" + typeName(ty.type.def.sequence.type) + ">" + else if std.objectHas(ty.type.def, "array") then "[" + typeName(ty.type.def.array.type) + "; " + ty.type.def.array.len + "]" + else if std.objectHas(ty.type.def, "compact") then "Compact<" + typeName(ty.type.def.compact.type) + ">" + else error "Can't generate useable name for " + ty.type, + generics = if std.objectHas(ty.type, "params") then + '<' + std.join(', ', std.map(function(p) if p.type == null then 'Spec#'+id else typeName(p.type), ty.type.params)) + '>' + else '' + ; name + generics, + shortenPrefix(obj, prefix, short) = { + [short]: obj[field] + for field in std.objectFields(obj) + // There should be at most one element with this prefix + if std.startsWith(field, prefix) + }, +; + +local typesRaw = { + [typeName(id)]: id + for id in std.range(0, std.length(chain._meta.types.types)-1) +}; + +local types = typesRaw + shortenPrefix(typesRaw, 'frame_system::AccountInfo<', 'AccountInfo'); + +types +// local +// ; + +// local encoded = chain._encode(types['AccountInfo'], { +// nonce: 0, +// consumers: 3, +// providers: 1, +// sufficients: 0, +// data: { +// free: Munique, +// reserved: "0", +// misc_frozen: "0", +// fee_frozen: "0", +// }, +// }); + +// local systemAccount = chain._decode(types['AccountInfo'], encoded); + +// chain.System._encodeKey.Account(['0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d']) From 4f3a2095e1dfffded1aca116ec77ae0a554fe0fb Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 18 Aug 2022 21:37:58 +0300 Subject: [PATCH 0467/1274] ci: synchronize forkless data/fork Signed-off-by: Yaroslav Bolyukin --- .docker/Dockerfile-parachain-upgrade | 16 +-- .docker/Dockerfile-parachain-upgrade-data | 41 ++++--- .docker/docker-compose.tmp-forkless-data.j2 | 10 +- .../launch-config-forkless-data.j2 | 4 + .env | 4 + .github/workflows/forkless-update-data.yml | 111 ++++++++++++------ 6 files changed, 125 insertions(+), 61 deletions(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index 1dfbd5ff2c..ef86bd66c0 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -24,11 +24,9 @@ RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup show RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN - RUN mkdir /unique_parachain WORKDIR /unique_parachain - # ===== BUILD current version ====== FROM rust-builder as builder-unique-current @@ -42,7 +40,6 @@ WORKDIR /unique_parachain RUN git clone $REPO_URL -b $MAINNET_BRANCH . && \ cargo build --features=$FEATURE --$PROFILE - # ===== BUILD target version ====== FROM rust-builder as builder-unique-target @@ -77,12 +74,12 @@ ARG RUNTIME= ENV RUNTIME $RUNTIME RUN apt-get -y update && \ - apt-get -y install curl git && \ - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v16.16.0 && \ - nvm use v16.16.0 + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/runtime-upgrade-testing @@ -100,7 +97,6 @@ COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNT COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm - CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ diff --git a/.docker/Dockerfile-parachain-upgrade-data b/.docker/Dockerfile-parachain-upgrade-data index 3480f4d33f..dbbb79942f 100644 --- a/.docker/Dockerfile-parachain-upgrade-data +++ b/.docker/Dockerfile-parachain-upgrade-data @@ -5,7 +5,6 @@ LABEL maintainer="Unique.Network" ARG RUST_TOOLCHAIN= ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN - ENV CARGO_HOME="/cargo-home" ENV PATH="/cargo-home/bin:$PATH" ENV TZ=UTC @@ -28,6 +27,19 @@ RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN RUN mkdir /unique_parachain WORKDIR /unique_parachain +# ===== BUILD current version ====== +FROM rust-builder as builder-unique-current + +ARG PROFILE=release +ARG FEATURE= +ARG MAINNET_BRANCH= +ARG REPO_URL= + +WORKDIR /unique_parachain + +RUN git clone $REPO_URL -b $MAINNET_BRANCH . && \ + cargo build --features=$FEATURE --$PROFILE + # ===== BUILD target version ====== FROM rust-builder as builder-unique-target @@ -59,7 +71,7 @@ FROM rust-builder as builder-chainql RUN mkdir chainql WORKDIR /chainql -RUN git clone --depth 1 https://github.com/CertainLach/chainql.git . && \ +RUN git clone -b v0.1.0 --depth 1 https://github.com/CertainLach/chainql.git . && \ cargo build --release # ===== RUN ====== @@ -70,14 +82,14 @@ ARG RUNTIME= ENV RUNTIME $RUNTIME RUN apt-get -y update && \ - apt-get -y install curl git && \ - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v16.16.0 && \ - nvm use v16.16.0 + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 -RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/parachain-forking +RUN git clone https://github.com/uniquenetwork/polkadot-launch.git -b feature/parachain-forking RUN export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ @@ -87,17 +99,18 @@ RUN export NVM_DIR="$HOME/.nvm" && \ RUN echo "$RUNTIME" +COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ - -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm COPY --from=builder-chainql /chainql/target/release/chainql /chainql/target/release/ +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm + ARG FORK_FROM= ENV FORK_FROM=$FORK_FROM CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" FORK_FROM && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ - yarn start launch-config.json - - + yarn start launch-config.json --test-upgrade-parachains diff --git a/.docker/docker-compose.tmp-forkless-data.j2 b/.docker/docker-compose.tmp-forkless-data.j2 index 56fbc20c40..f7dfd9f70d 100644 --- a/.docker/docker-compose.tmp-forkless-data.j2 +++ b/.docker/docker-compose.tmp-forkless-data.j2 @@ -10,6 +10,8 @@ services: - "FEATURE={{ FEATURE }}" - "RUNTIME={{ RUNTIME }}" - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" + - "MAINNET_TAG={{ MAINNET_TAG }}" + - "MAINNET_BRANCH={{ MAINNET_BRANCH }}" - "FORK_FROM={{ FORK_FROM }}" context: ../ dockerfile: .docker/Dockerfile-parachain-upgrade-data @@ -23,7 +25,11 @@ services: - type: bind source: ./forkless-config/fork.jsonnet target: /polkadot-launch/fork.jsonnet - read_only: true + read_only: true + - type: bind + source: ./forkless-config/typeNames.jsonnet + target: /polkadot-launch/typeNames.jsonnet + read_only: true expose: - 9944 - 9933 @@ -33,4 +39,4 @@ services: logging: options: max-size: "1m" - max-file: "3" \ No newline at end of file + max-file: "3" diff --git a/.docker/forkless-config/launch-config-forkless-data.j2 b/.docker/forkless-config/launch-config-forkless-data.j2 index df94ff7f7b..804044f8f1 100644 --- a/.docker/forkless-config/launch-config-forkless-data.j2 +++ b/.docker/forkless-config/launch-config-forkless-data.j2 @@ -1,6 +1,8 @@ { "relaychain": { "bin": "/polkadot/target/release/polkadot", + "upgradeBin": "/polkadot/target/release/polkadot", + "upgradeWasm": "/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm", "chain": "westend-local", "nodes": [ { @@ -85,6 +87,8 @@ "parachains": [ { "bin": "/unique-chain/target/release/unique-collator", + "upgradeBin": "/unique-chain/target/release/unique-collator", + "upgradeWasm": "/unique-chain/target/release/wbuild/{{ FEATURE }}/{{ RUNTIME }}_runtime.compact.compressed.wasm", "id": "1000", "balance": "1000000000000000000000000", "chainRawInitializer": [ diff --git a/.env b/.env index cf06a2b13b..a4c4f8a9c6 100644 --- a/.env +++ b/.env @@ -6,3 +6,7 @@ UNIQUE_MAINNET_TAG=v924010 KUSAMA_MAINNET_BRANCH=release-v0.9.26 QUARTZ_MAINNET_TAG=quartz-v924012-2 + +OPAL_FORK_FROM=wss://eu-ws-opal.unique.network:443 +QUARTZ_FORK_FROM=wss://eu-ws-quartz.unique.network:443 +UNIQUE_FORK_FROM=wss://eu-ws.unique.network:443 diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index eb4f9757b5..679f0a69cc 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -19,37 +19,61 @@ on: env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} -concurrency: +concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: + prepare-execution-marix: + + name: Prepare execution matrix + + runs-on: self-hosted-ci + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: CertainLach/create-matrix-action@v3 + id: create_matrix + with: + matrix: | + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, fork_from_address {${{ env.OPAL_FORK_FROM }}} + network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, fork_from_address {${{ env.QUARTZ_FORK_FROM }}} + network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, fork_from_address {${{ env.UNIQUE_FORK_FROM }}} + + + forkless-update-data: + needs: prepare-execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] timeout-minutes: 1380 + + name: ${{ matrix.network }} continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. strategy: matrix: - include: - - network: opal - features: opal-runtime - runtime: opal - fork_from_address: wss://eu-ws-opal.unique.network:443 - - network: quartz - features: quartz-runtime - runtime: quartz - fork_from_address: wss://eu-ws-quartz.unique.network:443 - - network: unique - features: unique-runtime - runtime: unique - fork_from_address: wss://eu-ws.unique.network:443 + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + steps: - name: Skip if pull request is in Draft @@ -91,6 +115,8 @@ jobs: RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }} + MAINNET_TAG=${{ matrix.mainnet_tag }} + MAINNET_BRANCH=${{ matrix.mainnet_branch }} FEATURE=${{ matrix.features }} RUNTIME=${{ matrix.runtime }} BRANCH=${{ github.head_ref }} @@ -118,33 +144,48 @@ jobs: - name: Check if docker logs consist logs related to Runtime Upgrade testing. if: success() run: | - counter=160 - function do_docker_logs { - docker logs --details parachain-fork 2>&1 - } - function is_started { - echo "Check Docker logs" - DOCKER_LOGS=$(do_docker_logs) - if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then - echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" - return 0 - exit 0 + counter=160 + function check_container_status { + docker inspect -f {{.State.Running}} node-parachain + } + function do_docker_logs { + docker logs --details node-parachain 2>&1 + } + function is_started { + if [ "$(check_container_status)" == "true" ]; then + echo "Container: node-parachain RUNNING"; + echo "Check Docker logs" + DOCKER_LOGS=$(do_docker_logs) + if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then + echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" + return 0 + elif [[ ${DOCKER_LOGS} = *"🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"* ]];then + echo "🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧" + return 1 + else + echo "Message not found in logs output, repeating..." + return 1 + fi + else + echo "Container node-parachain not RUNNING" + echo "Halting all future checks" + exit 1 fi - echo "Function is_started: Return 1" - return 1 - } - while ! is_started; do + exit 0 + } + while ! is_started; do echo "Waiting for special message in log files " sleep 30s counter=$(( $counter - 1 )) echo "Counter: $counter" if [ "$counter" -gt "0" ]; then - continue + continue else - break + break fi - done - exit 1 + done + echo "Halting script" + exit 0 shell: bash - name: Collect Docker Logs @@ -152,10 +193,10 @@ jobs: uses: jwalton/gh-docker-logs@v2.2.0 with: dest: './forkless-parachain-upgrade-data-logs.${{ matrix.features }}' - images: 'node-parachain' + images: 'node-parachain' - name: Show Docker logs - run: cat './forkless-parachain-upgrade-data-logs.${{ matrix.features }}/node-parachain.log' + run: cat './forkless-parachain-upgrade-data-logs.${{ matrix.features }}/node-parachain.log' - name: Stop running containers if: always() # run this step always From 93a0bf67ed672b85a7bee2066138fd89ce75bbec Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 18 Aug 2022 22:57:19 +0300 Subject: [PATCH 0468/1274] ci: always show docker logs Signed-off-by: Yaroslav Bolyukin --- .github/workflows/forkless-update-data.yml | 1 + .github/workflows/forkless-update-nodata.yml | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index 679f0a69cc..17fe1079a1 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -196,6 +196,7 @@ jobs: images: 'node-parachain' - name: Show Docker logs + if: success() || failure() run: cat './forkless-parachain-upgrade-data-logs.${{ matrix.features }}/node-parachain.log' - name: Stop running containers diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index ca8757c7d6..b8a8a5a2d6 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -19,7 +19,7 @@ on: env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} -concurrency: +concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -27,15 +27,15 @@ concurrency: jobs: prepare-execution-marix: - + name: Prepare execution matrix - + runs-on: self-hosted-ci outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} steps: - + - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 @@ -62,8 +62,8 @@ jobs: needs: prepare-execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] - - + + timeout-minutes: 1380 @@ -193,9 +193,10 @@ jobs: uses: jwalton/gh-docker-logs@v2.2.0 with: dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}' - images: 'node-parachain' + images: 'node-parachain' - name: Show docker logs + if: success() || failure() run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}/node-parachain.log' - name: Stop running containers From c3718108fd4610959c363261189c09bbdffa8867 Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Fri, 19 Aug 2022 16:11:31 +0700 Subject: [PATCH 0469/1274] Add foreign assets pallet --- pallets/foreing-assets/Cargo.toml | 50 ++ pallets/foreing-assets/src/impl_fungibles.rs | 621 +++++++++++++++++++ pallets/foreing-assets/src/lib.rs | 541 ++++++++++++++++ pallets/foreing-assets/src/weights.rs | 43 ++ runtime/common/construct_runtime/mod.rs | 3 + 5 files changed, 1258 insertions(+) create mode 100644 pallets/foreing-assets/Cargo.toml create mode 100644 pallets/foreing-assets/src/impl_fungibles.rs create mode 100644 pallets/foreing-assets/src/lib.rs create mode 100644 pallets/foreing-assets/src/weights.rs diff --git a/pallets/foreing-assets/Cargo.toml b/pallets/foreing-assets/Cargo.toml new file mode 100644 index 0000000000..a988923657 --- /dev/null +++ b/pallets/foreing-assets/Cargo.toml @@ -0,0 +1,50 @@ +[package] +name = "pallet-foreing-assets" +version = "0.1.0" +license = "GPLv3" +edition = "2021" + +[dependencies] +log = { version = "0.4.14", default-features = false } +serde = { version = "1.0.136", optional = true } +scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false } +up-data-structs = { default-features = false, path = '../../primitives/data-structs' } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false } +pallet-common = { default-features = false, path = '../common' } +pallet-fungible = { default-features = false, path = '../fungible' } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.24", default-features = false } +xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.24", default-features = false } +xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.24", default-features = false } +orml-tokens = { git = 'https://github.com/UniqueNetwork/open-runtime-module-library', branch = 'unique-polkadot-v0.9.24', version = "0.4.1-dev", default-features = false } + +[dev-dependencies] +serde_json = "1.0.68" +hex = { version = "0.4" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } + +[features] +default = ["std"] +std = [ + "serde", + "log/std", + "codec/std", + "scale-info/std", + "sp-runtime/std", + "sp-std/std", + "frame-support/std", + "frame-system/std", + "up-data-structs/std", + "pallet-common/std", + "pallet-balances/std", + "pallet-fungible/std", + "orml-tokens/std" +] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/foreing-assets/src/impl_fungibles.rs b/pallets/foreing-assets/src/impl_fungibles.rs new file mode 100644 index 0000000000..dd7460e19a --- /dev/null +++ b/pallets/foreing-assets/src/impl_fungibles.rs @@ -0,0 +1,621 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +//! Implementations for fungibles trait. + +use super::*; +use frame_system::Config as SystemConfig; + +use frame_support::traits::tokens::{DepositConsequence, WithdrawConsequence}; +use pallet_common::CollectionHandle; +use pallet_fungible::FungibleHandle; +use pallet_common::CommonCollectionOperations; +use up_data_structs::budget::Unlimited; +use sp_runtime::traits::{CheckedAdd, CheckedSub}; + +impl fungibles::Inspect<::AccountId> for Pallet +where + T: orml_tokens::Config, +{ + type AssetId = AssetIds; + type Balance = BalanceOf; + + fn total_issuance(asset: Self::AssetId) -> Self::Balance { + log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible total_issuance"); + + match asset { + AssetIds::NativeAssetId(NativeCurrency::Here) => { + let parent_amount = as fungible::Inspect< + T::AccountId, + >>::total_issuance(); + + let value: u128 = match parent_amount.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + let ti: Self::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + ti + } + AssetIds::NativeAssetId(NativeCurrency::Parent) => { + let amount = + as fungibles::Inspect>::total_issuance( + AssetIds::NativeAssetId(NativeCurrency::Parent), + ); + + let value: u128 = match amount.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + let ti: Self::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + ti + } + AssetIds::ForeignAssetId(fid) => { + let target_collection_id = match >::get(fid) { + Some(v) => v, + None => return Zero::zero(), + }; + let collection_handle = match >::try_get(target_collection_id) { + Ok(v) => v, + Err(_) => return Zero::zero(), + }; + let collection = FungibleHandle::cast(collection_handle); + Self::Balance::try_from(collection.total_supply()).unwrap_or(Zero::zero()) + } + } + } + + fn minimum_balance(asset: Self::AssetId) -> Self::Balance { + log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible minimum_balance"); + match asset { + AssetIds::NativeAssetId(NativeCurrency::Here) => { + let parent_amount = as fungible::Inspect< + T::AccountId, + >>::minimum_balance(); + + let value: u128 = match parent_amount.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + let ti: Self::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + ti + } + AssetIds::NativeAssetId(NativeCurrency::Parent) => { + let amount = + as fungibles::Inspect>::minimum_balance( + AssetIds::NativeAssetId(NativeCurrency::Parent), + ); + + let value: u128 = match amount.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + let ti: Self::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + ti + } + AssetIds::ForeignAssetId(fid) => { + AssetMetadatas::::get(AssetIds::ForeignAssetId(fid)) + .map(|x| x.minimal_balance) + .unwrap_or_else(Zero::zero) + } + } + } + + fn balance(asset: Self::AssetId, who: &::AccountId) -> Self::Balance { + log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible balance"); + match asset { + AssetIds::NativeAssetId(NativeCurrency::Here) => { + let parent_amount = + as fungible::Inspect>::balance(who); + + let value: u128 = match parent_amount.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + let ti: Self::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + ti + } + AssetIds::NativeAssetId(NativeCurrency::Parent) => { + let amount = as fungibles::Inspect>::balance( + AssetIds::NativeAssetId(NativeCurrency::Parent), + who, + ); + + let value: u128 = match amount.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + let ti: Self::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + ti + } + AssetIds::ForeignAssetId(fid) => { + let target_collection_id = match >::get(fid) { + Some(v) => v, + None => return Zero::zero(), + }; + let collection_handle = match >::try_get(target_collection_id) { + Ok(v) => v, + Err(_) => return Zero::zero(), + }; + let collection = FungibleHandle::cast(collection_handle); + Self::Balance::try_from( + collection.balance(T::CrossAccountId::from_sub(who.clone()), TokenId(0)), + ) + .unwrap_or(Zero::zero()) + } + } + } + + fn reducible_balance( + asset: Self::AssetId, + who: &::AccountId, + keep_alive: bool, + ) -> Self::Balance { + log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible reducible_balance"); + + match asset { + AssetIds::NativeAssetId(NativeCurrency::Here) => { + let parent_amount = as fungible::Inspect< + T::AccountId, + >>::reducible_balance(who, keep_alive); + + let value: u128 = match parent_amount.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + let ti: Self::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + ti + } + AssetIds::NativeAssetId(NativeCurrency::Parent) => { + let amount = + as fungibles::Inspect>::reducible_balance( + AssetIds::NativeAssetId(NativeCurrency::Parent), + who, + keep_alive, + ); + + let value: u128 = match amount.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + let ti: Self::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => return Zero::zero(), + }; + + ti + } + _ => Self::balance(asset, who), + } + } + + fn can_deposit( + asset: Self::AssetId, + who: &::AccountId, + amount: Self::Balance, + mint: bool, + ) -> DepositConsequence { + log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible can_deposit"); + + let value: u128 = match amount.try_into() { + Ok(val) => val, + Err(_) => return DepositConsequence::CannotCreate, + }; + + match asset { + AssetIds::NativeAssetId(NativeCurrency::Here) => { + let this_amount: ::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => { + return DepositConsequence::CannotCreate; + } + }; + as fungible::Inspect>::can_deposit( + who, + this_amount, + mint, + ) + } + AssetIds::NativeAssetId(NativeCurrency::Parent) => { + let parent_amount: ::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => { + return DepositConsequence::CannotCreate; + } + }; + as fungibles::Inspect>::can_deposit( + AssetIds::NativeAssetId(NativeCurrency::Parent), + who, + parent_amount, + mint, + ) + } + _ => { + if amount.is_zero() { + return DepositConsequence::Success; + } + + let extential_deposit_value = T::ExistentialDeposit::get(); + let ed_value: u128 = match extential_deposit_value.try_into() { + Ok(val) => val, + Err(_) => return DepositConsequence::CannotCreate, + }; + let extential_deposit: Self::Balance = match ed_value.try_into() { + Ok(val) => val, + Err(_) => return DepositConsequence::CannotCreate, + }; + + let new_total_balance = match Self::balance(asset, who).checked_add(&amount) { + Some(x) => x, + None => return DepositConsequence::Overflow, + }; + + if new_total_balance < extential_deposit { + return DepositConsequence::BelowMinimum; + } + + DepositConsequence::Success + } + } + } + + fn can_withdraw( + asset: Self::AssetId, + who: &::AccountId, + amount: Self::Balance, + ) -> WithdrawConsequence { + log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible can_withdraw"); + let value: u128 = match amount.try_into() { + Ok(val) => val, + Err(_) => return WithdrawConsequence::UnknownAsset, + }; + + match asset { + AssetIds::NativeAssetId(NativeCurrency::Here) => { + let this_amount: ::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => { + return WithdrawConsequence::UnknownAsset; + } + }; + match as fungible::Inspect>::can_withdraw( + who, + this_amount, + ) { + WithdrawConsequence::NoFunds => WithdrawConsequence::NoFunds, + WithdrawConsequence::WouldDie => WithdrawConsequence::WouldDie, + WithdrawConsequence::UnknownAsset => WithdrawConsequence::UnknownAsset, + WithdrawConsequence::Underflow => WithdrawConsequence::Underflow, + WithdrawConsequence::Overflow => WithdrawConsequence::Overflow, + WithdrawConsequence::Frozen => WithdrawConsequence::Frozen, + WithdrawConsequence::Success => WithdrawConsequence::Success, + _ => WithdrawConsequence::NoFunds, + } + } + AssetIds::NativeAssetId(NativeCurrency::Parent) => { + let parent_amount: ::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => { + return WithdrawConsequence::UnknownAsset; + } + }; + match as fungibles::Inspect>::can_withdraw( + AssetIds::NativeAssetId(NativeCurrency::Parent), + who, + parent_amount, + ) { + WithdrawConsequence::NoFunds => WithdrawConsequence::NoFunds, + WithdrawConsequence::WouldDie => WithdrawConsequence::WouldDie, + WithdrawConsequence::UnknownAsset => WithdrawConsequence::UnknownAsset, + WithdrawConsequence::Underflow => WithdrawConsequence::Underflow, + WithdrawConsequence::Overflow => WithdrawConsequence::Overflow, + WithdrawConsequence::Frozen => WithdrawConsequence::Frozen, + WithdrawConsequence::Success => WithdrawConsequence::Success, + _ => WithdrawConsequence::NoFunds, + } + } + _ => match Self::balance(asset, who).checked_sub(&amount) { + Some(_) => WithdrawConsequence::Success, + None => WithdrawConsequence::NoFunds, + }, + } + } +} + +impl fungibles::Mutate<::AccountId> for Pallet +where + T: orml_tokens::Config, +{ + fn mint_into( + asset: Self::AssetId, + who: &::AccountId, + amount: Self::Balance, + ) -> DispatchResult { + //Self::do_mint(asset, who, amount, None) + log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible mint_into {:?}", asset); + + let value: u128 = match amount.try_into() { + Ok(val) => val, + Err(_) => return Err(DispatchError::Other("Bad amount to value conversion")), + }; + + match asset { + AssetIds::NativeAssetId(NativeCurrency::Here) => { + let this_amount: ::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => { + return Err(DispatchError::Other( + "Bad amount to this parachain value conversion", + )) + } + }; + + as fungible::Mutate>::mint_into( + who, + this_amount, + ) + } + AssetIds::NativeAssetId(NativeCurrency::Parent) => { + let parent_amount: ::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => { + return Err(DispatchError::Other( + "Bad amount to relay chain value conversion", + )) + } + }; + + as fungibles::Mutate>::mint_into( + AssetIds::NativeAssetId(NativeCurrency::Parent), + who, + parent_amount, + ) + } + AssetIds::ForeignAssetId(fid) => { + let target_collection_id = match >::get(fid) { + Some(v) => v, + None => { + return Err(DispatchError::Other( + "Associated collection not found for asset", + )) + } + }; + let collection = + FungibleHandle::cast(>::try_get(target_collection_id)?); + let account = T::CrossAccountId::from_sub(who.clone()); + + let amount_data: pallet_fungible::CreateItemData = (account.clone(), value); + + pallet_fungible::Pallet::::create_item_foreign( + &collection, + &account, + amount_data, + &Unlimited, + )?; + + Ok(()) + } + } + } + + fn burn_from( + asset: Self::AssetId, + who: &::AccountId, + amount: Self::Balance, + ) -> Result { + // let f = DebitFlags { keep_alive: false, best_effort: false }; + log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible burn_from"); + + let value: u128 = match amount.try_into() { + Ok(val) => val, + Err(_) => return Err(DispatchError::Other("Bad amount to value conversion")), + }; + + match asset { + AssetIds::NativeAssetId(NativeCurrency::Here) => { + let this_amount: ::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => { + return Err(DispatchError::Other( + "Bad amount to this parachain value conversion", + )) + } + }; + + match as fungible::Mutate>::burn_from( + who, + this_amount, + ) { + Ok(_) => Ok(amount), + Err(e) => Err(e), + } + } + AssetIds::NativeAssetId(NativeCurrency::Parent) => { + let parent_amount: ::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => { + return Err(DispatchError::Other( + "Bad amount to relay chain value conversion", + )) + } + }; + + match as fungibles::Mutate>::burn_from( + AssetIds::NativeAssetId(NativeCurrency::Parent), + who, + parent_amount, + ) { + Ok(_) => Ok(amount), + Err(e) => Err(e), + } + } + AssetIds::ForeignAssetId(fid) => { + let target_collection_id = match >::get(fid) { + Some(v) => v, + None => { + return Err(DispatchError::Other( + "Associated collection not found for asset", + )) + } + }; + let collection = + FungibleHandle::cast(>::try_get(target_collection_id)?); + pallet_fungible::Pallet::::burn_foreign( + &collection, + &T::CrossAccountId::from_sub(who.clone()), + value, + )?; + + Ok(amount) + } + } + } + + fn slash( + asset: Self::AssetId, + who: &::AccountId, + amount: Self::Balance, + ) -> Result { + // let f = DebitFlags { keep_alive: false, best_effort: true }; + log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible slash"); + Self::burn_from(asset, who, amount)?; + Ok(amount) + } +} + +impl fungibles::Transfer for Pallet +where + T: orml_tokens::Config, +{ + fn transfer( + asset: Self::AssetId, + source: &::AccountId, + dest: &::AccountId, + amount: Self::Balance, + keep_alive: bool, + ) -> Result { + // let f = TransferFlags { keep_alive, best_effort: false, burn_dust: false }; + log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible transfer"); + + let value: u128 = match amount.try_into() { + Ok(val) => val, + Err(_) => return Err(DispatchError::Other("Bad amount to value conversion")), + }; + + match asset { + AssetIds::NativeAssetId(NativeCurrency::Here) => { + let this_amount: ::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => { + return Err(DispatchError::Other( + "Bad amount to this parachain value conversion", + )) + } + }; + + match as fungible::Transfer>::transfer( + source, + dest, + this_amount, + keep_alive, + ) { + Ok(_) => Ok(amount), + Err(_) => Err(DispatchError::Other( + "Bad amount to relay chain value conversion", + )), + } + } + AssetIds::NativeAssetId(NativeCurrency::Parent) => { + let parent_amount: ::Balance = match value.try_into() { + Ok(val) => val, + Err(_) => { + return Err(DispatchError::Other( + "Bad amount to relay chain value conversion", + )) + } + }; + + match as fungibles::Transfer>::transfer( + AssetIds::NativeAssetId(NativeCurrency::Parent), + source, + dest, + parent_amount, + keep_alive, + ) { + Ok(_) => Ok(amount), + Err(e) => Err(e), + } + } + AssetIds::ForeignAssetId(fid) => { + let target_collection_id = match >::get(fid) { + Some(v) => v, + None => { + return Err(DispatchError::Other( + "Associated collection not found for asset", + )) + } + }; + let collection = + FungibleHandle::cast(>::try_get(target_collection_id)?); + + pallet_fungible::Pallet::::transfer( + &collection, + &T::CrossAccountId::from_sub(source.clone()), + &T::CrossAccountId::from_sub(dest.clone()), + value, + &Unlimited, + )?; + + Ok(amount) + } + } + } +} diff --git a/pallets/foreing-assets/src/lib.rs b/pallets/foreing-assets/src/lib.rs new file mode 100644 index 0000000000..283c3bda0f --- /dev/null +++ b/pallets/foreing-assets/src/lib.rs @@ -0,0 +1,541 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +//! # Foreing assets +//! +//! - [`Config`] +//! - [`Call`] +//! - [`Pallet`] +//! +//! ## Overview +//! +//! The foreing assests pallet provides functions for: +//! +//! - Local and foreign assets management. The foreign assets can be updated without runtime upgrade. +//! - Bounds between asset and target collection for cross chain transfer and inner transfers. +//! +//! ## Overview +//! +//! Under construction + +#![cfg_attr(not(feature = "std"), no_std)] +#![allow(clippy::unused_unit)] + +use frame_support::{ + dispatch::DispatchResult, + ensure, + pallet_prelude::*, + traits::{fungible, fungibles, Currency, EnsureOrigin}, + transactional, RuntimeDebug, +}; +use frame_system::pallet_prelude::*; +use up_data_structs::{CollectionMode}; +use pallet_fungible::{Pallet as PalletFungible}; +use scale_info::{TypeInfo}; +use sp_runtime::{ + traits::{One, Zero}, + ArithmeticError, +}; +use sp_std::{boxed::Box, vec::Vec}; +use up_data_structs::{CollectionId, TokenId, CreateCollectionData}; + +// NOTE:v1::MultiLocation is used in storages, we would need to do migration if upgrade the +// MultiLocation in the future. +use xcm::opaque::latest::{prelude::XcmError, MultiAsset}; +use xcm::{v1::MultiLocation, VersionedMultiLocation}; +use xcm_executor::{traits::WeightTrader, Assets}; + +use pallet_common::erc::CrossAccountId; + +#[cfg(feature = "std")] +use serde::{Deserialize, Serialize}; + +// TODO: Move to primitives +// Id of native currency. +// 0 - QTZ\UNQ +// 1 - KSM\DOT +#[derive( + Clone, + Copy, + Eq, + PartialEq, + PartialOrd, + Ord, + MaxEncodedLen, + RuntimeDebug, + Encode, + Decode, + TypeInfo, +)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +pub enum NativeCurrency { + Here = 0, + Parent = 1, +} + +#[derive( + Clone, + Copy, + Eq, + PartialEq, + PartialOrd, + Ord, + MaxEncodedLen, + RuntimeDebug, + Encode, + Decode, + TypeInfo, +)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +pub enum AssetIds { + ForeignAssetId(ForeignAssetId), + NativeAssetId(NativeCurrency), +} + +pub trait TryAsForeing { + fn try_as_foreing(asset: T) -> Option; +} + +impl TryAsForeing for AssetIds { + fn try_as_foreing(asset: AssetIds) -> Option { + match asset { + AssetIds::ForeignAssetId(id) => Some(id), + _ => None, + } + } +} + +pub type ForeignAssetId = u32; +pub type CurrencyId = AssetIds; + +mod impl_fungibles; +mod weights; + +pub use module::*; +pub use weights::WeightInfo; + +/// Type alias for currency balance. +pub type BalanceOf = + <::Currency as Currency<::AccountId>>::Balance; + +/// A mapping between ForeignAssetId and AssetMetadata. +pub trait AssetIdMapping { + /// Returns the AssetMetadata associated with a given ForeignAssetId. + fn get_asset_metadata(foreign_asset_id: ForeignAssetId) -> Option; + /// Returns the MultiLocation associated with a given ForeignAssetId. + fn get_multi_location(foreign_asset_id: ForeignAssetId) -> Option; + /// Returns the CurrencyId associated with a given MultiLocation. + fn get_currency_id(multi_location: MultiLocation) -> Option; +} + +pub struct XcmForeignAssetIdMapping(sp_std::marker::PhantomData); + +impl AssetIdMapping>> + for XcmForeignAssetIdMapping +{ + fn get_asset_metadata(foreign_asset_id: ForeignAssetId) -> Option>> { + log::trace!(target: "fassets::asset_metadatas", "call"); + Pallet::::asset_metadatas(AssetIds::ForeignAssetId(foreign_asset_id)) + } + + fn get_multi_location(foreign_asset_id: ForeignAssetId) -> Option { + log::trace!(target: "fassets::get_multi_location", "call"); + Pallet::::foreign_asset_locations(foreign_asset_id) + } + + fn get_currency_id(multi_location: MultiLocation) -> Option { + log::trace!(target: "fassets::get_currency_id", "call"); + Some(AssetIds::ForeignAssetId( + Pallet::::location_to_currency_ids(multi_location).unwrap_or(0), + )) + } +} + +#[frame_support::pallet] +pub mod module { + use super::*; + + #[pallet::config] + pub trait Config: + frame_system::Config + + pallet_common::Config + + pallet_fungible::Config + + orml_tokens::Config + + pallet_balances::Config + { + /// The overarching event type. + type Event: From> + IsType<::Event>; + + /// Currency type for withdraw and balance storage. + type Currency: Currency; + + /// Required origin for registering asset. + type RegisterOrigin: EnsureOrigin; + + /// Weight information for the extrinsics in this module. + type WeightInfo: WeightInfo; + } + + #[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, TypeInfo)] + pub struct AssetMetadata { + pub name: Vec, + pub symbol: Vec, + pub decimals: u8, + pub minimal_balance: Balance, + } + + #[pallet::error] + pub enum Error { + /// The given location could not be used (e.g. because it cannot be expressed in the + /// desired version of XCM). + BadLocation, + /// MultiLocation existed + MultiLocationExisted, + /// AssetId not exists + AssetIdNotExists, + /// AssetId exists + AssetIdExisted, + } + + #[pallet::event] + #[pallet::generate_deposit(fn deposit_event)] + pub enum Event { + /// The foreign asset registered. + ForeignAssetRegistered { + asset_id: ForeignAssetId, + asset_address: MultiLocation, + metadata: AssetMetadata>, + }, + /// The foreign asset updated. + ForeignAssetUpdated { + asset_id: ForeignAssetId, + asset_address: MultiLocation, + metadata: AssetMetadata>, + }, + /// The asset registered. + AssetRegistered { + asset_id: AssetIds, + metadata: AssetMetadata>, + }, + /// The asset updated. + AssetUpdated { + asset_id: AssetIds, + metadata: AssetMetadata>, + }, + } + + /// Next available Foreign AssetId ID. + /// + /// NextForeignAssetId: ForeignAssetId + #[pallet::storage] + #[pallet::getter(fn next_foreign_asset_id)] + pub type NextForeignAssetId = StorageValue<_, ForeignAssetId, ValueQuery>; + /// The storages for MultiLocations. + /// + /// ForeignAssetLocations: map ForeignAssetId => Option + #[pallet::storage] + #[pallet::getter(fn foreign_asset_locations)] + pub type ForeignAssetLocations = + StorageMap<_, Twox64Concat, ForeignAssetId, MultiLocation, OptionQuery>; + + /// The storages for CurrencyIds. + /// + /// LocationToCurrencyIds: map MultiLocation => Option + #[pallet::storage] + #[pallet::getter(fn location_to_currency_ids)] + pub type LocationToCurrencyIds = + StorageMap<_, Twox64Concat, MultiLocation, ForeignAssetId, OptionQuery>; + + /// The storages for AssetMetadatas. + /// + /// AssetMetadatas: map AssetIds => Option + #[pallet::storage] + #[pallet::getter(fn asset_metadatas)] + pub type AssetMetadatas = + StorageMap<_, Twox64Concat, AssetIds, AssetMetadata>, OptionQuery>; + + /// The storages for assets to fungible collection binding + /// + #[pallet::storage] + #[pallet::getter(fn asset_binding)] + pub type AssetBinding = + StorageMap<_, Twox64Concat, ForeignAssetId, CollectionId, OptionQuery>; + + #[pallet::pallet] + #[pallet::without_storage_info] + pub struct Pallet(_); + + #[pallet::call] + impl Pallet { + #[pallet::weight(::WeightInfo::register_foreign_asset())] + #[transactional] + pub fn register_foreign_asset( + origin: OriginFor, + owner: T::AccountId, + location: Box, + metadata: Box>>, + ) -> DispatchResult { + T::RegisterOrigin::ensure_origin(origin.clone())?; + + let location: MultiLocation = (*location) + .try_into() + .map_err(|()| Error::::BadLocation)?; + + let md = metadata.clone(); + let name: Vec = md.name.into_iter().map(|x| x as u16).collect::>(); + let mut description: Vec = "Foreing assets collection for " + .encode_utf16() + .collect::>(); + description.append(&mut name.clone()); + + let data: CreateCollectionData = CreateCollectionData { + name: name.try_into().unwrap(), + description: description.try_into().unwrap(), + mode: CollectionMode::Fungible(18), + ..Default::default() + }; + + let bounded_collection_id = >::init_foreign_collection( + CrossAccountId::from_sub(owner), + data, + )?; + let foreign_asset_id = + Self::do_register_foreign_asset(&location, &metadata, bounded_collection_id)?; + + Self::deposit_event(Event::::ForeignAssetRegistered { + asset_id: foreign_asset_id, + asset_address: location, + metadata: *metadata, + }); + Ok(()) + } + + #[pallet::weight(::WeightInfo::update_foreign_asset())] + #[transactional] + pub fn update_foreign_asset( + origin: OriginFor, + foreign_asset_id: ForeignAssetId, + location: Box, + metadata: Box>>, + ) -> DispatchResult { + T::RegisterOrigin::ensure_origin(origin)?; + + let location: MultiLocation = (*location) + .try_into() + .map_err(|()| Error::::BadLocation)?; + Self::do_update_foreign_asset(foreign_asset_id, &location, &metadata)?; + + Self::deposit_event(Event::::ForeignAssetUpdated { + asset_id: foreign_asset_id, + asset_address: location, + metadata: *metadata, + }); + Ok(()) + } + } +} + +impl Pallet { + fn get_next_foreign_asset_id() -> Result { + NextForeignAssetId::::try_mutate(|current| -> Result { + let id = *current; + *current = current + .checked_add(One::one()) + .ok_or(ArithmeticError::Overflow)?; + Ok(id) + }) + } + + fn do_register_foreign_asset( + location: &MultiLocation, + metadata: &AssetMetadata>, + bounded_collection_id: CollectionId, + ) -> Result { + let foreign_asset_id = Self::get_next_foreign_asset_id()?; + LocationToCurrencyIds::::try_mutate(location, |maybe_currency_ids| -> DispatchResult { + ensure!( + maybe_currency_ids.is_none(), + Error::::MultiLocationExisted + ); + *maybe_currency_ids = Some(foreign_asset_id); + // *maybe_currency_ids = Some(CurrencyId::ForeignAsset(foreign_asset_id)); + + ForeignAssetLocations::::try_mutate( + foreign_asset_id, + |maybe_location| -> DispatchResult { + ensure!(maybe_location.is_none(), Error::::MultiLocationExisted); + *maybe_location = Some(location.clone()); + + AssetMetadatas::::try_mutate( + AssetIds::ForeignAssetId(foreign_asset_id), + |maybe_asset_metadatas| -> DispatchResult { + ensure!(maybe_asset_metadatas.is_none(), Error::::AssetIdExisted); + *maybe_asset_metadatas = Some(metadata.clone()); + Ok(()) + }, + ) + }, + )?; + + AssetBinding::::try_mutate(foreign_asset_id, |collection_id| -> DispatchResult { + *collection_id = Some(bounded_collection_id); + Ok(()) + }) + })?; + + Ok(foreign_asset_id) + } + + fn do_update_foreign_asset( + foreign_asset_id: ForeignAssetId, + location: &MultiLocation, + metadata: &AssetMetadata>, + ) -> DispatchResult { + ForeignAssetLocations::::try_mutate( + foreign_asset_id, + |maybe_multi_locations| -> DispatchResult { + let old_multi_locations = maybe_multi_locations + .as_mut() + .ok_or(Error::::AssetIdNotExists)?; + + AssetMetadatas::::try_mutate( + AssetIds::ForeignAssetId(foreign_asset_id), + |maybe_asset_metadatas| -> DispatchResult { + ensure!( + maybe_asset_metadatas.is_some(), + Error::::AssetIdNotExists + ); + + // modify location + if location != old_multi_locations { + LocationToCurrencyIds::::remove(old_multi_locations.clone()); + LocationToCurrencyIds::::try_mutate( + location, + |maybe_currency_ids| -> DispatchResult { + ensure!( + maybe_currency_ids.is_none(), + Error::::MultiLocationExisted + ); + // *maybe_currency_ids = Some(CurrencyId::ForeignAsset(foreign_asset_id)); + *maybe_currency_ids = Some(foreign_asset_id); + Ok(()) + }, + )?; + } + *maybe_asset_metadatas = Some(metadata.clone()); + *old_multi_locations = location.clone(); + Ok(()) + }, + ) + }, + ) + } +} + +use sp_runtime::SaturatedConversion; +use sp_runtime::traits::Saturating; +pub use frame_support::{ + traits::{ + fungibles::{Balanced, CreditOf}, + tokens::currency::Currency as CurrencyT, + OnUnbalanced as OnUnbalancedT, + }, + weights::{WeightToFeePolynomial, WeightToFee}, +}; + +use xcm::latest::{Fungibility::Fungible as XcmFungible}; + +pub struct UsingAnyCurrencyComponents< + WeightToFee: WeightToFeePolynomial, + AssetId: Get, + AccountId, + Currency: CurrencyT, + OnUnbalanced: OnUnbalancedT, +>( + Weight, + Currency::Balance, + PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>, +); + +impl< + WeightToFee: WeightToFeePolynomial, + AssetId: Get, + AccountId, + Currency: CurrencyT, + OnUnbalanced: OnUnbalancedT, + > WeightTrader + for UsingAnyCurrencyComponents +{ + fn new() -> Self { + Self(0, Zero::zero(), PhantomData) + } + + fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { + log::trace!(target: "fassets::weight", "buy_weight weight: {:?}, payment: {:?}", weight, payment); + + let amount = WeightToFee::weight_to_fee(&weight); + let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?; + + let asset_id = payment + .fungible + .iter() + .next() + .map_or(Err(XcmError::TooExpensive), |v| Ok(v.0))?; + + // First fungible pays fee + let required = MultiAsset { + id: asset_id.clone(), + fun: XcmFungible(u128_amount), + }; + + log::trace!( + target: "fassets::weight", "buy_weight payment: {:?}, required: {:?}", + payment, required, + ); + + let unused = payment + .checked_sub(required) + .map_err(|_| XcmError::TooExpensive)?; + self.0 = self.0.saturating_add(weight); + self.1 = self.1.saturating_add(amount); + Ok(unused) + } + + fn refund_weight(&mut self, weight: Weight) -> Option { + let weight = weight.min(self.0); + let amount = WeightToFee::weight_to_fee(&weight); + self.0 -= weight; + self.1 = self.1.saturating_sub(amount); + let amount: u128 = amount.saturated_into(); + if amount > 0 { + Some((AssetId::get(), amount).into()) + } else { + None + } + } +} +impl< + WeightToFee: WeightToFeePolynomial, + AssetId: Get, + AccountId, + Currency: CurrencyT, + OnUnbalanced: OnUnbalancedT, + > Drop for UsingAnyCurrencyComponents +{ + fn drop(&mut self) { + OnUnbalanced::on_unbalanced(Currency::issue(self.1)); + } +} diff --git a/pallets/foreing-assets/src/weights.rs b/pallets/foreing-assets/src/weights.rs new file mode 100644 index 0000000000..03c861b562 --- /dev/null +++ b/pallets/foreing-assets/src/weights.rs @@ -0,0 +1,43 @@ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for module_asset_registry. +pub trait WeightInfo { + fn register_foreign_asset() -> Weight; + fn update_foreign_asset() -> Weight; +} + +/// Weights for module_asset_registry using the Acala node and recommended hardware. +pub struct AcalaWeight(PhantomData); +impl WeightInfo for AcalaWeight { + fn register_foreign_asset() -> Weight { + (29_819_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + fn update_foreign_asset() -> Weight { + (25_119_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + fn register_foreign_asset() -> Weight { + (29_819_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + } + fn update_foreign_asset() -> Weight { + (25_119_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } +} \ No newline at end of file diff --git a/runtime/common/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs index 86dc0e24e1..043a1b69c2 100644 --- a/runtime/common/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -77,6 +77,9 @@ macro_rules! construct_runtime { #[runtimes(opal)] RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event} = 72, + #[runtimes(opal)] + ForeingAssets: pallet_foreing_assets::{Pallet, Call, Storage, Event} = 80, + // Frontier EVM: pallet_evm::{Pallet, Config, Call, Storage, Event} = 100, Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101, From 83658e7a287186b0ad062c335896809949e03506 Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Fri, 19 Aug 2022 16:11:52 +0700 Subject: [PATCH 0470/1274] Update our parachain index --- node/cli/src/chain_spec.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/node/cli/src/chain_spec.rs b/node/cli/src/chain_spec.rs index 3790f71d0c..7c58ab76df 100644 --- a/node/cli/src/chain_spec.rs +++ b/node/cli/src/chain_spec.rs @@ -235,7 +235,7 @@ pub fn development_config() -> DefaultChainSpec { get_account_id_from_seed::("Eve//stash"), get_account_id_from_seed::("Ferdie//stash"), ], - 1000 + 2037 ) }, // Bootnodes @@ -250,7 +250,7 @@ pub fn development_config() -> DefaultChainSpec { // Extensions Extensions { relay_chain: "rococo-dev".into(), - para_id: 1000, + para_id: 2037, }, ) } @@ -303,7 +303,7 @@ pub fn local_testnet_config() -> DefaultChainSpec { get_account_id_from_seed::("Eve//stash"), get_account_id_from_seed::("Ferdie//stash"), ], - 1000 + 2037 ) }, // Bootnodes @@ -318,7 +318,7 @@ pub fn local_testnet_config() -> DefaultChainSpec { // Extensions Extensions { relay_chain: "westend-local".into(), - para_id: 1000, + para_id: 2037, }, ) } From 538e9236a6e03cda8032b773cc75acf9d2503ff1 Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Fri, 19 Aug 2022 17:40:46 +0700 Subject: [PATCH 0471/1274] WIP: checkpoint. Opal builds. --- Cargo.lock | 117 +++++++++++++- pallets/foreing-assets/Cargo.toml | 29 ++-- pallets/fungible/src/lib.rs | 149 ++++++++++++++++++ .../common/config/pallets/foreign_asset.rs | 9 ++ runtime/common/config/pallets/mod.rs | 3 + runtime/common/construct_runtime/mod.rs | 2 + runtime/opal/Cargo.toml | 26 ++- runtime/opal/src/lib.rs | 2 + 8 files changed, 321 insertions(+), 16 deletions(-) create mode 100644 runtime/common/config/pallets/foreign_asset.rs diff --git a/Cargo.lock b/Cargo.lock index 349987a982..166f7762cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5190,7 +5190,10 @@ dependencies = [ "frame-try-runtime", "hex-literal", "log", + "orml-tokens", + "orml-traits", "orml-vesting", + "orml-xtokens", "pallet-aura", "pallet-balances", "pallet-base-fee", @@ -5202,6 +5205,7 @@ dependencies = [ "pallet-evm-contract-helpers", "pallet-evm-migration", "pallet-evm-transaction-payment", + "pallet-foreing-assets", "pallet-fungible", "pallet-inflation", "pallet-nonfungible", @@ -5306,6 +5310,53 @@ dependencies = [ "num-traits", ] +[[package]] +name = "orml-tokens" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" +dependencies = [ + "frame-support", + "frame-system", + "orml-traits", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "orml-traits" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" +dependencies = [ + "frame-support", + "impl-trait-for-tuples", + "num-traits", + "orml-utilities", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", +] + +[[package]] +name = "orml-utilities" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" +dependencies = [ + "frame-support", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "orml-vesting" version = "0.4.1-dev" @@ -5321,6 +5372,41 @@ dependencies = [ "sp-std", ] +[[package]] +name = "orml-xcm-support" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" +dependencies = [ + "frame-support", + "orml-traits", + "parity-scale-codec 3.1.5", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "orml-xtokens" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "orml-traits", + "orml-xcm-support", + "pallet-xcm", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + [[package]] name = "os_str_bytes" version = "6.3.0" @@ -5788,6 +5874,33 @@ dependencies = [ "up-sponsorship", ] +[[package]] +name = "pallet-foreing-assets" +version = "0.1.0" +dependencies = [ + "frame-support", + "frame-system", + "hex", + "log", + "orml-tokens", + "pallet-balances", + "pallet-common", + "pallet-fungible", + "pallet-timestamp", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "serde_json", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "up-data-structs", + "xcm", + "xcm-builder", + "xcm-executor", +] + [[package]] name = "pallet-fungible" version = "0.1.3" @@ -12130,7 +12243,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "digest 0.10.3", "rand 0.8.5", "static_assertions", @@ -12473,7 +12586,7 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "up-common" -version = "0.9.25" +version = "0.9.27" dependencies = [ "fp-rpc", "frame-support", diff --git a/pallets/foreing-assets/Cargo.toml b/pallets/foreing-assets/Cargo.toml index a988923657..75f99dced0 100644 --- a/pallets/foreing-assets/Cargo.toml +++ b/pallets/foreing-assets/Cargo.toml @@ -9,26 +9,29 @@ log = { version = "0.4.14", default-features = false } serde = { version = "1.0.136", optional = true } scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false } pallet-common = { default-features = false, path = '../common' } pallet-fungible = { default-features = false, path = '../fungible' } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.24", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.24", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.24", default-features = false } -orml-tokens = { git = 'https://github.com/UniqueNetwork/open-runtime-module-library', branch = 'unique-polkadot-v0.9.24', version = "0.4.1-dev", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false } +xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false } +xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false } +#orml-tokens = { git = 'https://github.com/UniqueNetwork/open-runtime-module-library', branch = 'unique-polkadot-v0.9.24', version = "0.4.1-dev", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.27", version = "0.4.1-dev", default-features = false } +#git = "https://github.com/open-web3-stack/open-runtime-module-library" +#branch = "polkadot-v0.9.27" [dev-dependencies] serde_json = "1.0.68" hex = { version = "0.4" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } [features] default = ["std"] diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index 777e71d0d2..d6f346d554 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -167,8 +167,14 @@ pub mod pallet { Value = u128, QueryKind = ValueQuery, >; + + /// Foreign collection flag + #[pallet::storage] + pub type ForeignCollection = + StorageMap; } + /// Wrapper around untyped collection handle, asserting inner collection is of fungible type. /// Required for interaction with Fungible collections, type safety and implementation [`solidity_interface`][`evm_coder::solidity_interface`]. pub struct FungibleHandle(pallet_common::CollectionHandle); @@ -215,6 +221,16 @@ impl Pallet { >::init_collection(owner, data, false) } + /// Initializes the collection with ForeignCollection flag. Returns [CollectionId] on success, [DispatchError] otherwise. + pub fn init_foreign_collection( + owner: T::CrossAccountId, + data: CreateCollectionData, + ) -> Result { + let id = >::init_collection(owner, data, false)?; + >::insert(id, true); + Ok(id) + } + /// Destroys a collection. pub fn destroy_collection( collection: FungibleHandle, @@ -230,6 +246,7 @@ impl Pallet { PalletCommon::destroy_collection(collection.0, sender)?; + >::remove(id); >::remove(id); let _ = >::clear_prefix((id,), u32::MAX, None); let _ = >::clear_prefix((id,), u32::MAX, None); @@ -257,6 +274,12 @@ impl Pallet { .checked_sub(amount) .ok_or(>::TokenValueTooLow)?; + // Foreign collection check + ensure!( + !>::get(collection.id), + >::NoPermission + ); + if collection.permissions.access() == AccessMode::AllowList { collection.check_allowlist(owner)?; } @@ -288,6 +311,46 @@ impl Pallet { Ok(()) } + /// Burns the specified amount of the token. + pub fn burn_foreign( + collection: &FungibleHandle, + owner: &T::CrossAccountId, + amount: u128, + ) -> DispatchResult { + let total_supply = >::get(collection.id) + .checked_sub(amount) + .ok_or(>::TokenValueTooLow)?; + + let balance = >::get((collection.id, owner)) + .checked_sub(amount) + .ok_or(>::TokenValueTooLow)?; + // ========= + + if balance == 0 { + >::remove((collection.id, owner)); + >::unnest_if_nested(owner, collection.id, TokenId::default()); + } else { + >::insert((collection.id, owner), balance); + } + >::insert(collection.id, total_supply); + + >::deposit_log( + ERC20Events::Transfer { + from: *owner.as_eth(), + to: H160::default(), + value: amount.into(), + } + .to_log(collection_id_to_address(collection.id)), + ); + >::deposit_event(CommonEvent::ItemDestroyed( + collection.id, + TokenId::default(), + owner.clone(), + amount, + )); + Ok(()) + } + /// Transfers the specified amount of tokens. Will check that /// the transfer is allowed for the token. /// @@ -373,6 +436,12 @@ impl Pallet { data: BTreeMap, nesting_budget: &dyn Budget, ) -> DispatchResult { + // Foreign collection check + ensure!( + !>::get(collection.id), + >::NoPermission + ); + if !collection.is_owner_or_admin(sender) { ensure!( collection.permissions.mint_mode(), @@ -442,6 +511,68 @@ impl Pallet { Ok(()) } + /// Minting tokens for multiple IDs. + /// See [`create_item_foreign`][`Pallet::create_item_foreign`] for more details. + pub fn create_multiple_items_foreign( + collection: &FungibleHandle, + sender: &T::CrossAccountId, + data: BTreeMap, + nesting_budget: &dyn Budget, + ) -> DispatchResult { + let total_supply = data + .iter() + .map(|(_, v)| *v) + .try_fold(>::get(collection.id), |acc, v| { + acc.checked_add(v) + }) + .ok_or(ArithmeticError::Overflow)?; + + let mut balances = data; + for (k, v) in balances.iter_mut() { + *v = >::get((collection.id, &k)) + .checked_add(*v) + .ok_or(ArithmeticError::Overflow)?; + } + + for (to, _) in balances.iter() { + >::check_nesting( + sender.clone(), + to, + collection.id, + TokenId::default(), + nesting_budget, + )?; + } + + // ========= + + >::insert(collection.id, total_supply); + for (user, amount) in balances { + >::insert((collection.id, &user), amount); + >::nest_if_sent_to_token_unchecked( + &user, + collection.id, + TokenId::default(), + ); + >::deposit_log( + ERC20Events::Transfer { + from: H160::default(), + to: *user.as_eth(), + value: amount.into(), + } + .to_log(collection_id_to_address(collection.id)), + ); + >::deposit_event(CommonEvent::ItemCreated( + collection.id, + TokenId::default(), + user.clone(), + amount, + )); + } + + Ok(()) + } + fn set_allowance_unchecked( collection: &FungibleHandle, owner: &T::CrossAccountId, @@ -615,6 +746,24 @@ impl Pallet { ) } + /// Creates fungible token. + /// + /// - `data`: Contains user who will become the owners of the tokens and amount + /// of tokens he will receive. + pub fn create_item_foreign( + collection: &FungibleHandle, + sender: &T::CrossAccountId, + data: CreateItemData, + nesting_budget: &dyn Budget, + ) -> DispatchResult { + Self::create_multiple_items_foreign( + collection, + sender, + [(data.0, data.1)].into_iter().collect(), + nesting_budget, + ) + } + /// Returns 10 tokens owners in no particular order /// /// There is no direct way to get token holders in ascending order, diff --git a/runtime/common/config/pallets/foreign_asset.rs b/runtime/common/config/pallets/foreign_asset.rs new file mode 100644 index 0000000000..530348463b --- /dev/null +++ b/runtime/common/config/pallets/foreign_asset.rs @@ -0,0 +1,9 @@ +use crate::{Runtime, Event, Balances}; +use up_common::types::AccountId; + +impl pallet_foreing_assets::Config for Runtime { + type Event = Event; + type Currency = Balances; + type RegisterOrigin = frame_system::EnsureRoot; + type WeightInfo = (); +} diff --git a/runtime/common/config/pallets/mod.rs b/runtime/common/config/pallets/mod.rs index d2d7a2f9e7..1a2582895c 100644 --- a/runtime/common/config/pallets/mod.rs +++ b/runtime/common/config/pallets/mod.rs @@ -40,6 +40,9 @@ pub mod rmrk; #[cfg(feature = "scheduler")] pub mod scheduler; +#[cfg(feature = "foreign-asset")] +pub mod foreign_asset; + parameter_types! { pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account_truncating(); pub const CollectionCreationPrice: Balance = 2 * UNIQUE; diff --git a/runtime/common/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs index 043a1b69c2..8176b516f7 100644 --- a/runtime/common/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -42,6 +42,8 @@ macro_rules! construct_runtime { Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 34, Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event} = 35, Vesting: orml_vesting::{Pallet, Storage, Call, Event, Config} = 37, + XTokens: orml_xtokens = 38, + Tokens: orml_tokens = 39, // Vesting: pallet_vesting::{Pallet, Call, Config, Storage, Event} = 37, // Contracts: pallet_contracts::{Pallet, Call, Storage, Event} = 38, diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 31ad731da2..84409dd888 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -120,13 +120,18 @@ std = [ 'up-sponsorship/std', "orml-vesting/std", + "orml-tokens/std", + "orml-xtokens/std", + "orml-traits/std", + "pallet-foreing-assets/std" ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] -opal-runtime = ['refungible', 'scheduler', 'rmrk'] +opal-runtime = ['refungible', 'scheduler', 'rmrk', 'foreign-asset'] refungible = [] scheduler = [] rmrk = [] +foreign-asset = [] ################################################################################ # Substrate Dependencies @@ -399,6 +404,24 @@ branch = "polkadot-v0.9.27" version = "0.4.1-dev" default-features = false +[dependencies.orml-xtokens] +git = "https://github.com/open-web3-stack/open-runtime-module-library" +branch = "polkadot-v0.9.27" +version = "0.4.1-dev" +default-features = false + +[dependencies.orml-tokens] +git = "https://github.com/open-web3-stack/open-runtime-module-library" +branch = "polkadot-v0.9.27" +version = "0.4.1-dev" +default-features = false + +[dependencies.orml-traits] +git = "https://github.com/open-web3-stack/open-runtime-module-library" +branch = "polkadot-v0.9.27" +version = "0.4.1-dev" +default-features = false + ################################################################################ # local dependencies @@ -437,6 +460,7 @@ fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/fro fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } +pallet-foreing-assets = { default-features = false, path = "../../pallets/foreing-assets" } ################################################################################ # Build Dependencies diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 9aa6279049..5f7fa119d5 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -35,6 +35,8 @@ use up_common::types::*; #[path = "../../common/mod.rs"] mod runtime_common; +pub mod xcm_config; + pub use runtime_common::*; pub const RUNTIME_NAME: &str = "opal"; From d59d4711fcdcc2cfc8e6276ee802a2b187ff1e31 Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Fri, 19 Aug 2022 19:03:41 +0700 Subject: [PATCH 0472/1274] Assets transactor --- runtime/common/config/xcm.rs | 134 ++++++++- runtime/opal/src/xcm_config.rs | 513 +++++++++++++++++++++++++++++++++ 2 files changed, 642 insertions(+), 5 deletions(-) create mode 100644 runtime/opal/src/xcm_config.rs diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs index 33d3515443..0ffe7dc24d 100644 --- a/runtime/common/config/xcm.rs +++ b/runtime/common/config/xcm.rs @@ -16,7 +16,8 @@ use frame_support::{ traits::{ - tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Get, Everything, + Contains, tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Get, Everything, + fungibles, }, weights::{Weight, WeightToFeePolynomial, WeightToFee}, parameter_types, match_types, @@ -34,18 +35,25 @@ use xcm::latest::{ Fungibility::Fungible as XcmFungible, MultiAsset, Error as XcmError, }; -use xcm_executor::traits::{MatchesFungible, WeightTrader}; +use xcm_executor::traits::{Convert as ConvertXcm, MatchesFungible, WeightTrader}; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative, + FixedWeightBounds, FungiblesAdapter, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ParentIsPreset, }; use xcm_executor::{Config, XcmExecutor, Assets}; -use sp_std::marker::PhantomData; +use pallet_foreing_assets::{ + AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, + UsingAnyCurrencyComponents, TryAsForeing, ForeignAssetId, +}; +use sp_std::{borrow::Borrow, marker::PhantomData, vec, vec::Vec}; use crate::{ - Runtime, Call, Event, Origin, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue, + Runtime, Call, Event, Origin, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue }; +#[cfg(feature = "foreign-assets")] +use crate::ForeingAssets; + use up_common::{ types::{AccountId, Balance}, constants::*, @@ -233,6 +241,121 @@ impl< } } +parameter_types! { + pub CheckingAccount: AccountId = PolkadotXcm::check_account(); +} +/// Allow checking in assets that have issuance > 0. +#[cfg(feature = "foreign-assets")] +pub struct NonZeroIssuance(PhantomData<(AccountId, ForeingAssets)>); + +#[cfg(feature = "foreign-assets")] +impl Contains<>::AssetId> +for NonZeroIssuance + where + ForeingAssets: fungibles::Inspect, +{ + fn contains(id: &>::AssetId) -> bool { + !ForeingAssets::total_issuance(*id).is_zero() + } +} + +#[cfg(feature = "foreign-assets")] +pub struct AsInnerId(PhantomData<(AssetId, ConvertAssetId)>); +#[cfg(feature = "foreign-assets")] +impl> +ConvertXcm for AsInnerId + where + AssetId: Borrow, + AssetId: TryAsForeing, + AssetIds: Borrow, +{ + fn convert_ref(id: impl Borrow) -> Result { + let id = id.borrow(); + + log::trace!( + target: "xcm::AsInnerId::Convert", + "AsInnerId {:?}", + id + ); + + let parent = MultiLocation::parent(); + let here = MultiLocation::here(); + let self_location = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); + + if *id == parent { + return ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Parent)); + } + + if *id == here || *id == self_location { + return ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Here)); + } + + match XcmForeignAssetIdMapping::::get_currency_id(id.clone()) { + Some(AssetIds::ForeignAssetId(foreign_asset_id)) => { + ConvertAssetId::convert_ref(AssetIds::ForeignAssetId(foreign_asset_id)) + } + _ => ConvertAssetId::convert_ref(AssetIds::ForeignAssetId(0)), + } + } + + fn reverse_ref(what: impl Borrow) -> Result { + log::trace!( + target: "xcm::AsInnerId::Reverse", + "AsInnerId", + ); + + let asset_id = what.borrow(); + + let parent_id = + ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Parent)).unwrap(); + let here_id = + ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Here)).unwrap(); + + if asset_id.clone() == parent_id { + return Ok(MultiLocation::parent()); + } + + if asset_id.clone() == here_id { + return Ok(MultiLocation::new( + 1, + X1(Parachain(ParachainInfo::get().into())), + )); + } + + match >::try_as_foreing(asset_id.clone()) { + Some(fid) => match XcmForeignAssetIdMapping::::get_multi_location(fid) { + Some(location) => Ok(location), + None => Err(()), + }, + None => Err(()), + } + } +} + +/// Means for transacting assets besides the native currency on this chain. +#[cfg(feature = "foreign-assets")] +pub type FungiblesTransactor = FungiblesAdapter< + // Use this fungibles implementation: + ForeingAssets, + // Use this currency when it is a fungible asset matching the given location or name: + ConvertedConcreteAssetId, JustTry>, + // Convert an XCM MultiLocation into a local account id: + LocationToAccountId, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // We only want to allow teleports of known assets. We use non-zero issuance as an indication + // that this asset is known. + NonZeroIssuance, + // The account to use for tracking teleports. + CheckingAccount, +>; + +/// Means for transacting assets on this chain. +#[cfg(feature = "foreign-assets")] +pub type AssetTransactors = FungiblesTransactor; +#[cfg(not(feature = "foreign-assets"))] +pub type AssetTransactors = LocalAssetTransactor; + pub struct XcmConfig(PhantomData); impl Config for XcmConfig where @@ -300,3 +423,4 @@ impl cumulus_pallet_dmp_queue::Config for Runtime { type XcmExecutor = XcmExecutor>; type ExecuteOverweightOrigin = frame_system::EnsureRoot; } + diff --git a/runtime/opal/src/xcm_config.rs b/runtime/opal/src/xcm_config.rs new file mode 100644 index 0000000000..3327e0f760 --- /dev/null +++ b/runtime/opal/src/xcm_config.rs @@ -0,0 +1,513 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use cumulus_pallet_xcm; +use frame_support::{ + {match_types, parameter_types, weights::Weight}, + pallet_prelude::Get, + traits::{Contains, Everything, fungibles}, +}; +use frame_system::EnsureRoot; +use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; +use pallet_xcm::XcmPassthrough; +use polkadot_parachain::primitives::Sibling; +use sp_runtime::traits::{AccountIdConversion, CheckedConversion, Convert, Zero}; +use sp_std::{borrow::Borrow, marker::PhantomData, vec, vec::Vec}; +use xcm::{ + latest::{MultiAsset, Xcm}, + prelude::{Concrete, Fungible as XcmFungible}, + v1::{BodyId, Junction::*, Junctions::*, MultiLocation, NetworkId}, +}; +use xcm_builder::{ + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, + EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter, LocationInverter, ParentAsSuperuser, + ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + ConvertedConcreteAssetId, +}; +use xcm_executor::{ + {Config, XcmExecutor}, + traits::{Convert as ConvertXcm, FilterAssetLocation, JustTry, MatchesFungible, ShouldExecute}, +}; + +use up_common::{ + constants::{MAXIMUM_BLOCK_WEIGHT, UNIQUE}, + types::{AccountId, Balance}, +}; + +use crate::{ + Balances, Call, DmpQueue, Event, ForeingAssets, Origin, ParachainInfo, + ParachainSystem, PolkadotXcm, Runtime, XcmpQueue, +}; +use crate::runtime_common::config::substrate::{TreasuryModuleId, MaxLocks, MaxReserves}; +use crate::runtime_common::config::pallets::TreasuryAccountId; +use crate::runtime_common::config::xcm::*; +use crate::*; + +use pallet_foreing_assets::{ + AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, + UsingAnyCurrencyComponents, TryAsForeing, ForeignAssetId, +}; + +// Signed version of balance +pub type Amount = i128; + +/* +parameter_types! { + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; +} + +impl cumulus_pallet_parachain_system::Config for Runtime { + type Event = Event; + type SelfParaId = parachain_info::Pallet; + type OnSystemEvent = (); + type OutboundXcmpMessageSource = XcmpQueue; + type DmpMessageHandler = DmpQueue; + type ReservedDmpWeight = ReservedDmpWeight; + type ReservedXcmpWeight = ReservedXcmpWeight; + type XcmpMessageHandler = XcmpQueue; +} + +impl parachain_info::Config for Runtime {} + +impl cumulus_pallet_aura_ext::Config for Runtime {} + */ + +parameter_types! { + pub const RelayLocation: MultiLocation = MultiLocation::parent(); + pub const RelayNetwork: NetworkId = NetworkId::Polkadot; + pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); + pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); +} + +/* +/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// when determining ownership of accounts for asset transacting and when attempting to use XCM +/// `Transact` in order to determine the dispatch Origin. +pub type LocationToAccountId = ( + // The parent (Relay-chain) origin converts to the default `AccountId`. + ParentIsPreset, + // Sibling parachain origins convert to AccountId via the `ParaId::into`. + SiblingParachainConvertsVia, + // Straight up local `AccountId32` origins just alias directly to `AccountId`. + AccountId32Aliases, +); + +pub struct OnlySelfCurrency; + +impl> MatchesFungible for OnlySelfCurrency { + fn matches_fungible(a: &MultiAsset) -> Option { + match (&a.id, &a.fun) { + (Concrete(_), XcmFungible(ref amount)) => CheckedConversion::checked_from(*amount), + _ => None, + } + } +} + +/// Means for transacting assets on this chain. +pub type LocalAssetTransactor = CurrencyAdapter< + // Use this currency: + Balances, + // Use this currency when it is a fungible asset matching the given location or name: + OnlySelfCurrency, + // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID: + LocationToAccountId, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // We don't track any teleports. + (), +>; + + */ + +/* +parameter_types! { + pub CheckingAccount: AccountId = PolkadotXcm::check_account(); +} + +/// Allow checking in assets that have issuance > 0. +pub struct NonZeroIssuance(PhantomData<(AccountId, ForeingAssets)>); +impl Contains<>::AssetId> + for NonZeroIssuance +where + ForeingAssets: fungibles::Inspect, +{ + fn contains(id: &>::AssetId) -> bool { + !ForeingAssets::total_issuance(*id).is_zero() + } +} + +pub struct AsInnerId(PhantomData<(AssetId, ConvertAssetId)>); +impl> + ConvertXcm for AsInnerId +where + AssetId: Borrow, + AssetId: TryAsForeing, + AssetIds: Borrow, +{ + fn convert_ref(id: impl Borrow) -> Result { + let id = id.borrow(); + + log::trace!( + target: "xcm::AsInnerId::Convert", + "AsInnerId {:?}", + id + ); + + let parent = MultiLocation::parent(); + let here = MultiLocation::here(); + let self_location = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); + + if *id == parent { + return ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Parent)); + } + + if *id == here || *id == self_location { + return ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Here)); + } + + match XcmForeignAssetIdMapping::::get_currency_id(id.clone()) { + Some(AssetIds::ForeignAssetId(foreign_asset_id)) => { + ConvertAssetId::convert_ref(AssetIds::ForeignAssetId(foreign_asset_id)) + } + _ => ConvertAssetId::convert_ref(AssetIds::ForeignAssetId(0)), + } + } + + fn reverse_ref(what: impl Borrow) -> Result { + log::trace!( + target: "xcm::AsInnerId::Reverse", + "AsInnerId", + ); + + let asset_id = what.borrow(); + + let parent_id = + ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Parent)).unwrap(); + let here_id = + ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Here)).unwrap(); + + if asset_id.clone() == parent_id { + return Ok(MultiLocation::parent()); + } + + if asset_id.clone() == here_id { + return Ok(MultiLocation::new( + 1, + X1(Parachain(ParachainInfo::get().into())), + )); + } + + match >::try_as_foreing(asset_id.clone()) { + Some(fid) => match XcmForeignAssetIdMapping::::get_multi_location(fid) { + Some(location) => Ok(location), + None => Err(()), + }, + None => Err(()), + } + } +} + +/// Means for transacting assets besides the native currency on this chain. +pub type FungiblesTransactor = FungiblesAdapter< + // Use this fungibles implementation: + ForeingAssets, + // Use this currency when it is a fungible asset matching the given location or name: + ConvertedConcreteAssetId, JustTry>, + // Convert an XCM MultiLocation into a local account id: + LocationToAccountId, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // We only want to allow teleports of known assets. We use non-zero issuance as an indication + // that this asset is known. + NonZeroIssuance, + // The account to use for tracking teleports. + CheckingAccount, +>; + +/// Means for transacting assets on this chain. +pub type AssetTransactors = FungiblesTransactor; + */ + +/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, +/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can +/// biases the kind of local `Origin` it will become. +pub type XcmOriginToTransactDispatchOrigin = ( + // Sovereign account converter; this attempts to derive an `AccountId` from the origin location + // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for + // foreign chains who want to have a local sovereign account on this chain which they control. + SovereignSignedViaLocation, + // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when + // recognised. + RelayChainAsNative, + // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when + // recognised. + SiblingParachainAsNative, + // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a + // transaction from the Root origin. + ParentAsSuperuser, + // Native signed account converter; this just converts an `AccountId32` origin into a normal + // `Origin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, + // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. + XcmPassthrough, +); + +parameter_types! { + // One XCM operation is 1_000_000 weight - almost certainly a conservative estimate. + pub UnitWeightCost: Weight = 1_000_000; + // 1200 UNIQUEs buy 1 second of weight. + pub const WeightPrice: (MultiLocation, u128) = (MultiLocation::parent(), 1_200 * UNIQUE); + pub const MaxInstructions: u32 = 100; + pub const MaxAuthorities: u32 = 100_000; +} + +match_types! { + pub type ParentOrParentsUnitPlurality: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) } + }; +} + +/// Execution barrier that just takes `max_weight` from `weight_credit`. +/// +/// Useful to allow XCM execution by local chain users via extrinsics. +/// E.g. `pallet_xcm::reserve_asset_transfer` to transfer a reserve asset +/// out of the local chain to another one. +pub struct AllowAllDebug; +impl ShouldExecute for AllowAllDebug { + fn should_execute( + _origin: &MultiLocation, + _message: &mut Xcm, + max_weight: Weight, + weight_credit: &mut Weight, + ) -> Result<(), ()> { + Ok(()) + } +} + +pub type Barrier = ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + AllowUnpaidExecutionFrom, + // ^^^ Parent & its unit plurality gets free execution + AllowAllDebug, +); + +pub struct AllAsset; +impl FilterAssetLocation for AllAsset { + fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool { + true + } +} + +/* /// CHANGEME!!! +pub struct XcmConfig; +impl Config for XcmConfig { + type Call = Call; + type XcmSender = XcmRouter; + // How to withdraw and deposit an asset. + type AssetTransactor = AssetTransactors; + type OriginConverter = XcmOriginToTransactDispatchOrigin; + type IsReserve = AllAsset; //NativeAsset; + type IsTeleporter = (); // Teleportation is disabled + type LocationInverter = LocationInverter; + type Barrier = Barrier; + type Weigher = FixedWeightBounds; + type Trader = + UsingAnyCurrencyComponents, RelayLocation, AccountId, Balances, ()>; + type ResponseHandler = (); // Don't handle responses for now. + type SubscriptionService = PolkadotXcm; + type AssetTrap = PolkadotXcm; + type AssetClaims = PolkadotXcm; +} + */ + +/* +/// No local origins on this chain are allowed to dispatch XCM sends/executions. +pub type LocalOriginToLocation = (SignedToAccountId32,); + +/// The means for routing XCM messages which are not for local execution into the right message +/// queues. +pub type XcmRouter = ( + // Two routers - use UMP to communicate with the relay chain: + cumulus_primitives_utility::ParentAsUmp, + // ..and XCMP to communicate with the sibling chains. + XcmpQueue, +); + */ + +/* +impl pallet_xcm::Config for Runtime { + type Event = Event; + type SendXcmOrigin = EnsureXcmOrigin; + type XcmRouter = XcmRouter; + type ExecuteXcmOrigin = EnsureXcmOrigin; + type XcmExecuteFilter = Everything; + type XcmExecutor = XcmExecutor>; + type XcmTeleportFilter = Everything; + type XcmReserveTransferFilter = Everything; + type Weigher = FixedWeightBounds; + type LocationInverter = LocationInverter; + type Origin = Origin; + type Call = Call; + const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; + type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; +} + */ + +/* +impl cumulus_pallet_xcm::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor; +} + +impl cumulus_pallet_xcmp_queue::Config for Runtime { + type WeightInfo = (); + type Event = Event; + type XcmExecutor = XcmExecutor; + type ChannelInfo = ParachainSystem; + type VersionWrapper = (); + type ExecuteOverweightOrigin = frame_system::EnsureRoot; + type ControllerOrigin = EnsureRoot; + type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; +} + +impl cumulus_pallet_dmp_queue::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor; + type ExecuteOverweightOrigin = frame_system::EnsureRoot; +} + */ + +pub struct CurrencyIdConvert; +impl Convert> for CurrencyIdConvert { + fn convert(id: AssetIds) -> Option { + match id { + AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new( + 1, + X1(Parachain(ParachainInfo::get().into())), + )), + AssetIds::NativeAssetId(NativeCurrency::Parent) => Some(MultiLocation::parent()), + AssetIds::ForeignAssetId(foreign_asset_id) => { + XcmForeignAssetIdMapping::::get_multi_location(foreign_asset_id) + } + } + } +} +impl Convert> for CurrencyIdConvert { + fn convert(location: MultiLocation) -> Option { + if location == MultiLocation::here() + || location == MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))) + { + return Some(AssetIds::NativeAssetId(NativeCurrency::Here)); + } + + if location == MultiLocation::parent() { + return Some(AssetIds::NativeAssetId(NativeCurrency::Parent)); + } + + if let Some(currency_id) = + XcmForeignAssetIdMapping::::get_currency_id(location.clone()) + { + return Some(currency_id); + } + + None + } +} + +pub fn get_all_module_accounts() -> Vec { + vec![TreasuryModuleId::get().into_account_truncating()] +} + +pub struct DustRemovalWhitelist; +impl Contains for DustRemovalWhitelist { + fn contains(a: &AccountId) -> bool { + get_all_module_accounts().contains(a) + } +} + +parameter_type_with_key! { + pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { + match currency_id { + CurrencyId::NativeAssetId(symbol) => match symbol { + NativeCurrency::Here => 0, + NativeCurrency::Parent=> 0, + }, + _ => 100_000 + } + }; +} + +impl orml_tokens::Config for Runtime { + type Event = Event; + type Balance = Balance; + type Amount = Amount; + type CurrencyId = CurrencyId; + type WeightInfo = (); + type ExistentialDeposits = ExistentialDeposits; + type OnDust = orml_tokens::TransferDust; + type MaxLocks = MaxLocks; + type MaxReserves = MaxReserves; + // TODO: Add all module accounts + type DustRemovalWhitelist = DustRemovalWhitelist; + /// The id type for named reserves. + type ReserveIdentifier = (); + type OnNewTokenAccount = (); + type OnKilledTokenAccount = (); +} + +parameter_types! { + pub const BaseXcmWeight: Weight = 100_000_000; // TODO: recheck this + pub const MaxAssetsForTransfer: usize = 2; +} + +parameter_type_with_key! { + pub ParachainMinFee: |_location: MultiLocation| -> Option { + Some(100_000_000) + }; +} + +pub struct AccountIdToMultiLocation; +impl Convert for AccountIdToMultiLocation { + fn convert(account: AccountId) -> MultiLocation { + X1(AccountId32 { + network: NetworkId::Any, + id: account.into(), + }) + .into() + } +} + +impl orml_xtokens::Config for Runtime { + type Event = Event; + type Balance = Balance; + type CurrencyId = AssetIds; + type CurrencyIdConvert = CurrencyIdConvert; + type AccountIdToMultiLocation = AccountIdToMultiLocation; + type SelfLocation = SelfLocation; + type XcmExecutor = XcmExecutor>; + type Weigher = FixedWeightBounds; + type BaseXcmWeight = BaseXcmWeight; + type LocationInverter = LocationInverter; + type MaxAssetsForTransfer = MaxAssetsForTransfer; + type MinXcmFee = ParachainMinFee; + type MultiLocationsFilter = Everything; + type ReserveProvider = AbsoluteReserveProvider; +} From a6465aad3e6209a3385f3b15c97eba2726f8e58a Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Fri, 19 Aug 2022 19:20:17 +0700 Subject: [PATCH 0473/1274] Add a few missing types. --- runtime/common/config/xcm.rs | 40 ++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs index 0ffe7dc24d..9d2524a02b 100644 --- a/runtime/common/config/xcm.rs +++ b/runtime/common/config/xcm.rs @@ -35,7 +35,6 @@ use xcm::latest::{ Fungibility::Fungible as XcmFungible, MultiAsset, Error as XcmError, }; -use xcm_executor::traits::{Convert as ConvertXcm, MatchesFungible, WeightTrader}; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative, @@ -43,6 +42,7 @@ use xcm_builder::{ SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ParentIsPreset, }; use xcm_executor::{Config, XcmExecutor, Assets}; +use xcm_executor::traits::{Convert as ConvertXcm, MatchesFungible, WeightTrader, FilterAssetLocation}; use pallet_foreing_assets::{ AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, UsingAnyCurrencyComponents, TryAsForeing, ForeignAssetId, @@ -356,6 +356,34 @@ pub type AssetTransactors = FungiblesTransactor; #[cfg(not(feature = "foreign-assets"))] pub type AssetTransactors = LocalAssetTransactor; +#[cfg(feature = "foreign-assets")] +pub struct AllAsset; +#[cfg(feature = "foreign-assets")] +impl FilterAssetLocation for AllAsset { + fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool { + true + } +} + +#[cfg(feature = "foreign-assets")] +pub type IsReserve = AllAsset; +#[cfg(not(feature = "foreign-assets"))] +pub type IsReserve = NativeAsset; + +#[cfg(feature = "foreign-assets")] +type Trader = + UsingAnyCurrencyComponents< + pallet_configuration::WeightToFee, + RelayLocation, AccountId, Balances, ()>; +#[cfg(not(feature = "foreign-assets"))] +type Trader = UsingOnlySelfCurrencyComponents< + pallet_configuration::WeightToFee, + RelayLocation, + AccountId, + Balances, + (), +>; + pub struct XcmConfig(PhantomData); impl Config for XcmConfig where @@ -366,18 +394,12 @@ where // How to withdraw and deposit an asset. type AssetTransactor = LocalAssetTransactor; type OriginConverter = XcmOriginToTransactDispatchOrigin; - type IsReserve = NativeAsset; + type IsReserve = IsReserve; type IsTeleporter = (); // Teleportation is disabled type LocationInverter = LocationInverter; type Barrier = Barrier; type Weigher = FixedWeightBounds; - type Trader = UsingOnlySelfCurrencyComponents< - pallet_configuration::WeightToFee, - RelayLocation, - AccountId, - Balances, - (), - >; + type Trader = Trader; type ResponseHandler = (); // Don't handle responses for now. type SubscriptionService = PolkadotXcm; From e6681da97c5487acfa2f64b894131b0192766895 Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Fri, 19 Aug 2022 19:27:24 +0700 Subject: [PATCH 0474/1274] WIP: import barrier from runtime. --- runtime/common/config/xcm.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs index 9d2524a02b..b5074d62d4 100644 --- a/runtime/common/config/xcm.rs +++ b/runtime/common/config/xcm.rs @@ -49,7 +49,8 @@ use pallet_foreing_assets::{ }; use sp_std::{borrow::Borrow, marker::PhantomData, vec, vec::Vec}; use crate::{ - Runtime, Call, Event, Origin, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue + Runtime, Call, Event, Origin, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue, + xcm_config::Barrier }; #[cfg(feature = "foreign-assets")] use crate::ForeingAssets; @@ -153,11 +154,13 @@ match_types! { }; } +/* pub type Barrier = ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, // ^^^ Parent & its unit plurality gets free execution ); + */ pub struct UsingOnlySelfCurrencyComponents< WeightToFee: WeightToFeePolynomial, From 62fb30561fe6bb27a9cbff5ca676116085c59ed2 Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Fri, 19 Aug 2022 19:30:23 +0700 Subject: [PATCH 0475/1274] Add tests --- tests/src/xcmTransferAcala.test.ts | 260 ++++++++++++++++++ tests/src/xcmTransferKarura.test.ts | 260 ++++++++++++++++++ tests/src/xcmTransferMoonbeam.test.ts | 360 +++++++++++++++++++++++++ tests/src/xcmTransferMoonriver.test.ts | 360 +++++++++++++++++++++++++ tests/src/xcmTransferStatemine.test.ts | 321 ++++++++++++++++++++++ 5 files changed, 1561 insertions(+) create mode 100644 tests/src/xcmTransferAcala.test.ts create mode 100644 tests/src/xcmTransferKarura.test.ts create mode 100644 tests/src/xcmTransferMoonbeam.test.ts create mode 100644 tests/src/xcmTransferMoonriver.test.ts create mode 100644 tests/src/xcmTransferStatemine.test.ts diff --git a/tests/src/xcmTransferAcala.test.ts b/tests/src/xcmTransferAcala.test.ts new file mode 100644 index 0000000000..ce43b98304 --- /dev/null +++ b/tests/src/xcmTransferAcala.test.ts @@ -0,0 +1,260 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; + +import {WsProvider} from '@polkadot/api'; +import {ApiOptions} from '@polkadot/api/types'; +import {IKeyringPair} from '@polkadot/types/types'; +import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; +import {getGenericResult, generateKeyringPair} from './util/helpers'; +import waitNewBlocks from './substrate/wait-new-blocks'; +import getBalance from './substrate/get-balance'; + +chai.use(chaiAsPromised); +const expect = chai.expect; + +const UNIQUE_CHAIN = 5000; +const ACALA_CHAIN = 2000; +const ACALA_PORT = '9946'; +const TRANSFER_AMOUNT = 2000000000000000000000000n; + +describe('Integration test: Exchanging UNQ with Acala', () => { + let alice: IKeyringPair; + let randomAccount: IKeyringPair; + + let actuallySent1: bigint; + let actuallySent2: bigint; + + let balanceUnique1: bigint; + let balanceUnique2: bigint; + let balanceUnique3: bigint; + + let balanceAcalaUnq1: bigint; + let balanceAcalaUnq2: bigint; + let balanceAcalaUnq3: bigint; + + let balanceAcalaAca1: bigint; + let balanceAcalaAca2: bigint; + let balanceAcalaAca3: bigint; + + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + alice = privateKeyWrapper('//Alice'); + randomAccount = generateKeyringPair(); + }); + + const acalaApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT), + }; + + await usingApi( + async (api) => { + const destination = { + V0: { + X2: [ + 'Parent', + { + Parachain: UNIQUE_CHAIN, + }, + ], + }, + }; + + const metadata = { + name: 'UNQ', + symbol: 'UNQ', + decimals: 18, + minimalBalance: 1, + }; + + const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata); + const sudoTx = api.tx.sudo.sudo(tx as any); + const events = await submitTransactionAsync(alice, sudoTx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); + const events1 = await submitTransactionAsync(alice, tx1); + const result1 = getGenericResult(events1); + expect(result1.success).to.be.true; + + [balanceAcalaAca1] = await getBalance(api, [randomAccount.address]); + { + const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceAcalaUnq1 = BigInt(free); + } + }, + acalaApiOptions, + ); + + await usingApi(async (api) => { + const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); + const events0 = await submitTransactionAsync(alice, tx0); + const result0 = getGenericResult(events0); + expect(result0.success).to.be.true; + + [balanceUnique1] = await getBalance(api, [randomAccount.address]); + }); + }); + + it('Should connect and send UNQ to Acala', async () => { + + await usingApi(async (api) => { + + const destination = { + V0: { + X2: [ + 'Parent', + { + Parachain: ACALA_CHAIN, + }, + ], + }, + }; + + const beneficiary = { + V0: { + X1: { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, + }, + }, + }, + }; + + const assets = { + V1: [ + { + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: TRANSFER_AMOUNT, + }, + }, + ], + }; + + const feeAssetItem = 0; + + const weightLimit = { + Limited: 5000000000, + }; + + const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); + const events = await submitTransactionAsync(randomAccount, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceUnique2] = await getBalance(api, [randomAccount.address]); + + const transactionFees = balanceUnique1 - balanceUnique2 - TRANSFER_AMOUNT; + actuallySent1 = TRANSFER_AMOUNT; // Why not TRANSFER_AMOUNT - transactionFees ??? + console.log('Unique to Acala transaction fees on Unique: %s UNQ', transactionFees); + expect(transactionFees > 0).to.be.true; + }); + + await usingApi( + async (api) => { + // todo do something about instant sealing, where there might not be any new blocks + await waitNewBlocks(api, 3); + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceAcalaUnq2 = BigInt(free); + expect(balanceAcalaUnq2 > balanceAcalaUnq1).to.be.true; + + [balanceAcalaAca2] = await getBalance(api, [randomAccount.address]); + + const acaFees = balanceAcalaAca1 - balanceAcalaAca2; + const unqFees = actuallySent1 - balanceAcalaUnq2 + balanceAcalaUnq1; + console.log('Unique to Acala transaction fees on Acala: %s ACA', acaFees); + console.log('Unique to Acala transaction fees on Acala: %s UNQ', unqFees); + expect(acaFees == 0n).to.be.true; + expect(unqFees == 0n).to.be.true; + }, + {provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT)}, + ); + }); + + it('Should connect to Acala and send UNQ back', async () => { + + await usingApi( + async (api) => { + const destination = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: UNIQUE_CHAIN}, + { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, + }, + }, + ], + }, + }, + }; + + const id = { + ForeignAsset: 0, + }; + + const amount = TRANSFER_AMOUNT; + const destWeight = 50000000; + + const tx = api.tx.xTokens.transfer(id, amount, destination, destWeight); + const events = await submitTransactionAsync(randomAccount, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceAcalaAca3] = await getBalance(api, [randomAccount.address]); + { + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceAcalaUnq3 = BigInt(free); + } + + const acaFees = balanceAcalaAca2 - balanceAcalaAca3; + const unqFees = balanceAcalaUnq2 - balanceAcalaUnq3 - amount; + actuallySent2 = amount; // Why not amount - UNQFees ??? + console.log('Acala to Unique transaction fees on Acala: %s ACA', acaFees); + console.log('Acala to Unique transaction fees on Acala: %s UNQ', unqFees); + expect(acaFees > 0).to.be.true; + expect(unqFees == 0n).to.be.true; + }, + {provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT)}, + ); + + await usingApi(async (api) => { + // todo do something about instant sealing, where there might not be any new blocks + await waitNewBlocks(api, 3); + + [balanceUnique3] = await getBalance(api, [randomAccount.address]); + const actuallyDelivered = balanceUnique3 - balanceUnique2; + expect(actuallyDelivered > 0).to.be.true; + + const unqFees = actuallySent2 - actuallyDelivered; + console.log('Acala to Unique transaction fees on Unique: %s UNQ', unqFees); + expect(unqFees > 0).to.be.true; + }); + }); +}); \ No newline at end of file diff --git a/tests/src/xcmTransferKarura.test.ts b/tests/src/xcmTransferKarura.test.ts new file mode 100644 index 0000000000..6ea8a52f96 --- /dev/null +++ b/tests/src/xcmTransferKarura.test.ts @@ -0,0 +1,260 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; + +import {WsProvider} from '@polkadot/api'; +import {ApiOptions} from '@polkadot/api/types'; +import {IKeyringPair} from '@polkadot/types/types'; +import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; +import {getGenericResult, generateKeyringPair} from './util/helpers'; +import waitNewBlocks from './substrate/wait-new-blocks'; +import getBalance from './substrate/get-balance'; + +chai.use(chaiAsPromised); +const expect = chai.expect; + +const UNIQUE_CHAIN = 5000; +const KARURA_CHAIN = 2000; +const KARURA_PORT = '9946'; +const TRANSFER_AMOUNT = 2000000000000000000000000n; + +describe('Integration test: Exchanging QTZ with Karura', () => { + let alice: IKeyringPair; + let randomAccount: IKeyringPair; + + let actuallySent1: bigint; + let actuallySent2: bigint; + + let balanceQuartz1: bigint; + let balanceQuartz2: bigint; + let balanceQuartz3: bigint; + + let balanceKaruraQtz1: bigint; + let balanceKaruraQtz2: bigint; + let balanceKaruraQtz3: bigint; + + let balanceKaruraKar1: bigint; + let balanceKaruraKar2: bigint; + let balanceKaruraKar3: bigint; + + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + alice = privateKeyWrapper('//Alice'); + randomAccount = generateKeyringPair(); + }); + + const karuraApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT), + }; + + await usingApi( + async (api) => { + const destination = { + V0: { + X2: [ + 'Parent', + { + Parachain: UNIQUE_CHAIN, + }, + ], + }, + }; + + const metadata = { + name: 'QTZ', + symbol: 'QTZ', + decimals: 18, + minimalBalance: 1, + }; + + const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata); + const sudoTx = api.tx.sudo.sudo(tx as any); + const events = await submitTransactionAsync(alice, sudoTx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); + const events1 = await submitTransactionAsync(alice, tx1); + const result1 = getGenericResult(events1); + expect(result1.success).to.be.true; + + [balanceKaruraKar1] = await getBalance(api, [randomAccount.address]); + { + const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceKaruraQtz1 = BigInt(free); + } + }, + karuraApiOptions, + ); + + await usingApi(async (api) => { + const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); + const events0 = await submitTransactionAsync(alice, tx0); + const result0 = getGenericResult(events0); + expect(result0.success).to.be.true; + + [balanceQuartz1] = await getBalance(api, [randomAccount.address]); + }); + }); + + it('Should connect and send QTZ to Karura', async () => { + + await usingApi(async (api) => { + + const destination = { + V0: { + X2: [ + 'Parent', + { + Parachain: KARURA_CHAIN, + }, + ], + }, + }; + + const beneficiary = { + V0: { + X1: { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, + }, + }, + }, + }; + + const assets = { + V1: [ + { + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: TRANSFER_AMOUNT, + }, + }, + ], + }; + + const feeAssetItem = 0; + + const weightLimit = { + Limited: 5000000000, + }; + + const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); + const events = await submitTransactionAsync(randomAccount, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceQuartz2] = await getBalance(api, [randomAccount.address]); + + const transactionFees = balanceQuartz1 - balanceQuartz2 - TRANSFER_AMOUNT; + actuallySent1 = TRANSFER_AMOUNT; // Why not TRANSFER_AMOUNT - transactionFees ??? + console.log('Quartz to Karura transaction fees on Quartz: %s QTZ', transactionFees); + expect(transactionFees > 0).to.be.true; + }); + + await usingApi( + async (api) => { + // todo do something about instant sealing, where there might not be any new blocks + await waitNewBlocks(api, 3); + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceKaruraQtz2 = BigInt(free); + expect(balanceKaruraQtz2 > balanceKaruraQtz1).to.be.true; + + [balanceKaruraKar2] = await getBalance(api, [randomAccount.address]); + + const karFees = balanceKaruraKar1 - balanceKaruraKar2; + const qtzFees = actuallySent1 - balanceKaruraQtz2 + balanceKaruraQtz1; + console.log('Quartz to Karura transaction fees on Karura: %s KAR', karFees); + console.log('Quartz to Karura transaction fees on Karura: %s QTZ', qtzFees); + expect(karFees == 0n).to.be.true; + expect(qtzFees == 0n).to.be.true; + }, + {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)}, + ); + }); + + it('Should connect to Karura and send QTZ back', async () => { + + await usingApi( + async (api) => { + const destination = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: UNIQUE_CHAIN}, + { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, + }, + }, + ], + }, + }, + }; + + const id = { + ForeignAsset: 0, + }; + + const amount = TRANSFER_AMOUNT; + const destWeight = 50000000; + + const tx = api.tx.xTokens.transfer(id, amount, destination, destWeight); + const events = await submitTransactionAsync(randomAccount, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceKaruraKar3] = await getBalance(api, [randomAccount.address]); + { + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceKaruraQtz3 = BigInt(free); + } + + const karFees = balanceKaruraKar2 - balanceKaruraKar3; + const qtzFees = balanceKaruraQtz2 - balanceKaruraQtz3 - amount; + actuallySent2 = amount; // Why not amount - qtzFees ??? + console.log('Karura to Quartz transaction fees on Karura: %s KAR', karFees); + console.log('Karura to Quartz transaction fees on Karura: %s QTZ', qtzFees); + expect(karFees > 0).to.be.true; + expect(qtzFees == 0n).to.be.true; + }, + {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)}, + ); + + await usingApi(async (api) => { + // todo do something about instant sealing, where there might not be any new blocks + await waitNewBlocks(api, 3); + + [balanceQuartz3] = await getBalance(api, [randomAccount.address]); + const actuallyDelivered = balanceQuartz3 - balanceQuartz2; + expect(actuallyDelivered > 0).to.be.true; + + const qtzFees = actuallySent2 - actuallyDelivered; + console.log('Karura to Quartz transaction fees on Quartz: %s QTZ', qtzFees); + expect(qtzFees > 0).to.be.true; + }); + }); +}); \ No newline at end of file diff --git a/tests/src/xcmTransferMoonbeam.test.ts b/tests/src/xcmTransferMoonbeam.test.ts new file mode 100644 index 0000000000..3fde3515b8 --- /dev/null +++ b/tests/src/xcmTransferMoonbeam.test.ts @@ -0,0 +1,360 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; + +import {Keyring, WsProvider} from '@polkadot/api'; +import {ApiOptions} from '@polkadot/api/types'; +import {IKeyringPair} from '@polkadot/types/types'; +import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; +import {getGenericResult, generateKeyringPair} from './util/helpers'; +import {MultiLocation} from '@polkadot/types/interfaces'; +import {blake2AsHex} from '@polkadot/util-crypto'; +import getBalance from './substrate/get-balance'; +import waitNewBlocks from './substrate/wait-new-blocks'; + +chai.use(chaiAsPromised); +const expect = chai.expect; + +const UNIQUE_CHAIN = 5000; +const MOONBEAM_CHAIN = 1000; +const UNIQUE_PORT = '9944'; +const MOONBEAM_PORT = '9946'; +const TRANSFER_AMOUNT = 2000000000000000000000000n; + +describe('Integration test: Exchanging UNQ with Moonbeam', () => { + + // Unique constants + let uniqueAlice: IKeyringPair; + let uniqueAssetLocation; + + let randomAccountUnique: IKeyringPair; + let randomAccountMoonbeam: IKeyringPair; + + // Moonbeam constants + let assetId: Uint8Array; + + const moonbeamKeyring = new Keyring({type: 'ethereum'}); + const alithPrivateKey = '0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133'; + const baltatharPrivateKey = '0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b'; + const dorothyPrivateKey = '0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68'; + + const alithAccount = moonbeamKeyring.addFromUri(alithPrivateKey, undefined, 'ethereum'); + const baltatharAccount = moonbeamKeyring.addFromUri(baltatharPrivateKey, undefined, 'ethereum'); + const dorothyAccount = moonbeamKeyring.addFromUri(dorothyPrivateKey, undefined, 'ethereum'); + + const councilVotingThreshold = 2; + const technicalCommitteeThreshold = 2; + const votingPeriod = 3; + const delayPeriod = 0; + + const uniqueAssetMetadata = { + name: 'xcUnique', + symbol: 'xcUNQ', + decimals: 18, + isFrozen: false, + minimalBalance: 1, + }; + + let actuallySent1: bigint; + let actuallySent2: bigint; + + let balanceUnique1: bigint; + let balanceUnique2: bigint; + let balanceUnique3: bigint; + + let balanceMoonbeamGlmr1: bigint; + let balanceMoonbeamGlmr2: bigint; + let balanceMoonbeamGlmr3: bigint; + + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + uniqueAlice = privateKeyWrapper('//Alice'); + randomAccountUnique = generateKeyringPair(); + randomAccountMoonbeam = generateKeyringPair('ethereum'); + }); + + const moonbeamApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + MOONBEAM_PORT), + }; + + await usingApi( + async (api) => { + + // >>> Sponsoring Dorothy >>> + const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n); + const events0 = await submitTransactionAsync(alithAccount, tx0); + const result0 = getGenericResult(events0); + expect(result0.success).to.be.true; + // <<< Sponsoring Dorothy <<< + + const sourceLocation: MultiLocation = api.createType( + 'MultiLocation', + { + parents: 1, + interior: {X1: {Parachain: UNIQUE_CHAIN}}, + }, + ); + + assetId = api.registry.hash(sourceLocation.toU8a()).slice(0, 16).reverse(); + console.log('Internal asset ID is %s', assetId); + uniqueAssetLocation = {XCM: sourceLocation}; + const existentialDeposit = 1; + const isSufficient = true; + const unitsPerSecond = '1'; + const numAssetsWeightHint = 0; + + const registerTx = api.tx.assetManager.registerForeignAsset( + uniqueAssetLocation, + uniqueAssetMetadata, + existentialDeposit, + isSufficient, + ); + console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || ''); + + const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond( + uniqueAssetLocation, + unitsPerSecond, + numAssetsWeightHint, + ); + console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || ''); + + const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]); + console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || ''); + + // >>> Note motion preimage >>> + const encodedProposal = batchCall?.method.toHex() || ''; + const proposalHash = blake2AsHex(encodedProposal); + console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal); + console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); + console.log('Encoded length %d', encodedProposal.length); + + const tx1 = api.tx.democracy.notePreimage(encodedProposal); + const events1 = await submitTransactionAsync(baltatharAccount, tx1); + const result1 = getGenericResult(events1); + expect(result1.success).to.be.true; + // <<< Note motion preimage <<< + + // >>> Propose external motion through council >>> + const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash); + const tx2 = api.tx.councilCollective.propose( + councilVotingThreshold, + externalMotion, + externalMotion.encodedLength, + ); + const events2 = await submitTransactionAsync(baltatharAccount, tx2); + const result2 = getGenericResult(events2); + expect(result2.success).to.be.true; + + const encodedMotion = externalMotion?.method.toHex() || ''; + const motionHash = blake2AsHex(encodedMotion); + console.log('Motion hash is %s', motionHash); + + const tx3 = api.tx.councilCollective.vote(motionHash, 0, true); + { + const events3 = await submitTransactionAsync(dorothyAccount, tx3); + const result3 = getGenericResult(events3); + expect(result3.success).to.be.true; + } + { + const events3 = await submitTransactionAsync(baltatharAccount, tx3); + const result3 = getGenericResult(events3); + expect(result3.success).to.be.true; + } + + const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength); + const events4 = await submitTransactionAsync(dorothyAccount, tx4); + const result4 = getGenericResult(events4); + expect(result4.success).to.be.true; + // <<< Propose external motion through council <<< + + // >>> Fast track proposal through technical committee >>> + const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); + const tx5 = api.tx.techCommitteeCollective.propose( + technicalCommitteeThreshold, + fastTrack, + fastTrack.encodedLength, + ); + const events5 = await submitTransactionAsync(alithAccount, tx5); + const result5 = getGenericResult(events5); + expect(result5.success).to.be.true; + + const encodedFastTrack = fastTrack?.method.toHex() || ''; + const fastTrackHash = blake2AsHex(encodedFastTrack); + console.log('FastTrack hash is %s', fastTrackHash); + + const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1; + const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true); + { + const events6 = await submitTransactionAsync(baltatharAccount, tx6); + const result6 = getGenericResult(events6); + expect(result6.success).to.be.true; + } + { + const events6 = await submitTransactionAsync(alithAccount, tx6); + const result6 = getGenericResult(events6); + expect(result6.success).to.be.true; + } + + const tx7 = api.tx.techCommitteeCollective + .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength); + const events7 = await submitTransactionAsync(baltatharAccount, tx7); + const result7 = getGenericResult(events7); + expect(result7.success).to.be.true; + // <<< Fast track proposal through technical committee <<< + + // >>> Referendum voting >>> + const tx8 = api.tx.democracy.vote( + 0, + {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}}, + ); + const events8 = await submitTransactionAsync(dorothyAccount, tx8); + const result8 = getGenericResult(events8); + expect(result8.success).to.be.true; + // <<< Referendum voting <<< + + // >>> Sponsoring random Account >>> + const tx9 = api.tx.balances.transfer(randomAccountMoonbeam.address, 11_000_000_000_000_000_000n); + const events9 = await submitTransactionAsync(baltatharAccount, tx9); + const result9 = getGenericResult(events9); + expect(result9.success).to.be.true; + // <<< Sponsoring random Account <<< + + [balanceMoonbeamGlmr1] = await getBalance(api, [randomAccountMoonbeam.address]); + }, + moonbeamApiOptions, + ); + + await usingApi(async (api) => { + const tx0 = api.tx.balances.transfer(randomAccountUnique.address, 10n * TRANSFER_AMOUNT); + const events0 = await submitTransactionAsync(uniqueAlice, tx0); + const result0 = getGenericResult(events0); + expect(result0.success).to.be.true; + + [balanceUnique1] = await getBalance(api, [randomAccountUnique.address]); + }); + }); + + it('Should connect and send UNQ to Moonbeam', async () => { + await usingApi(async (api) => { + const currencyId = { + NativeAssetId: 'Here', + }; + const dest = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: MOONBEAM_CHAIN}, + {AccountKey20: {network: 'Any', key: randomAccountMoonbeam.address}}, + ], + }, + }, + }; + const amount = TRANSFER_AMOUNT; + const destWeight = 50000000; + + const tx = api.tx.xTokens.transfer(currencyId, amount, dest, destWeight); + const events = await submitTransactionAsync(uniqueAlice, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceUnique2] = await getBalance(api, [randomAccountUnique.address]); + expect(balanceUnique2 < balanceUnique1).to.be.true; + + const transactionFees = balanceUnique1 - balanceUnique2 - TRANSFER_AMOUNT; + actuallySent1 = TRANSFER_AMOUNT; // Why not TRANSFER_AMOUNT - transactionFees ??? + console.log('Unique to Moonbeam transaction fees on Unique: %s UNQ', transactionFees); + expect(transactionFees > 0).to.be.true; + }); + + await usingApi( + async (api) => { + // todo do something about instant sealing, where there might not be any new blocks + await waitNewBlocks(api, 3); + + [balanceMoonbeamGlmr2] = await getBalance(api, [randomAccountMoonbeam.address]); + + const glmrFees = balanceMoonbeamGlmr1 - balanceMoonbeamGlmr2; + console.log('Unique to Moonbeam transaction fees on Moonbeam: %s GLMR', glmrFees); + expect(glmrFees == 0n).to.be.true; + }, + {provider: new WsProvider('ws://127.0.0.1:' + MOONBEAM_PORT)}, + ); + }); + + it('Should connect to Moonbeam and send UNQ back', async () => { + await usingApi( + async (api) => { + const amount = TRANSFER_AMOUNT / 2n; + const asset = { + V1: { + id: { + Concrete: { + parents: 1, + interior: { + X1: {Parachain: UNIQUE_CHAIN}, + }, + }, + }, + fun: { + Fungible: amount, + }, + }, + }; + const destination = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: UNIQUE_CHAIN}, + {AccountId32: {network: 'Any', id: randomAccountUnique.addressRaw}}, + ], + }, + }, + }; + const destWeight = 50000000; + + const tx = api.tx.xTokens.transferMultiasset(asset, destination, destWeight); + const events = await submitTransactionAsync(randomAccountMoonbeam, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceMoonbeamGlmr3] = await getBalance(api, [randomAccountMoonbeam.address]); + + const glmrFees = balanceMoonbeamGlmr2 - balanceMoonbeamGlmr3; + actuallySent2 = amount; + console.log('Moonbeam to Unique transaction fees on Moonbeam: %s GLMR', glmrFees); + expect(glmrFees > 0).to.be.true; + }, + {provider: new WsProvider('ws://127.0.0.1:' + MOONBEAM_PORT)}, + ); + + await usingApi(async (api) => { + // todo do something about instant sealing, where there might not be any new blocks + await waitNewBlocks(api, 3); + + [balanceUnique3] = await getBalance(api, [randomAccountUnique.address]); + const actuallyDelivered = balanceUnique3 - balanceUnique2; + expect(actuallyDelivered > 0).to.be.true; + + const unqFees = actuallySent2 - actuallyDelivered; + console.log('Moonbeam to Unique transaction fees on Unique: %s UNQ', unqFees); + expect(unqFees > 0).to.be.true; + }); + }); +}); diff --git a/tests/src/xcmTransferMoonriver.test.ts b/tests/src/xcmTransferMoonriver.test.ts new file mode 100644 index 0000000000..76eff81f3b --- /dev/null +++ b/tests/src/xcmTransferMoonriver.test.ts @@ -0,0 +1,360 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; + +import {Keyring, WsProvider} from '@polkadot/api'; +import {ApiOptions} from '@polkadot/api/types'; +import {IKeyringPair} from '@polkadot/types/types'; +import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; +import {getGenericResult, generateKeyringPair} from './util/helpers'; +import {MultiLocation} from '@polkadot/types/interfaces'; +import {blake2AsHex} from '@polkadot/util-crypto'; +import getBalance from './substrate/get-balance'; +import waitNewBlocks from './substrate/wait-new-blocks'; + +chai.use(chaiAsPromised); +const expect = chai.expect; + +const QUARTZ_CHAIN = 5000; +const MOONRIVER_CHAIN = 1000; +const QUARTZ_PORT = '9944'; +const MOONRIVER_PORT = '9946'; +const TRANSFER_AMOUNT = 2000000000000000000000000n; + +describe('Integration test: Exchanging QTZ with Moonriver', () => { + + // Unique constants + let quartzAlice: IKeyringPair; + let quartzAssetLocation; + + let randomAccountQuartz: IKeyringPair; + let randomAccountMoonriver: IKeyringPair; + + // Moonriver constants + let assetId: Uint8Array; + + const moonriverKeyring = new Keyring({type: 'ethereum'}); + const alithPrivateKey = '0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133'; + const baltatharPrivateKey = '0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b'; + const dorothyPrivateKey = '0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68'; + + const alithAccount = moonriverKeyring.addFromUri(alithPrivateKey, undefined, 'ethereum'); + const baltatharAccount = moonriverKeyring.addFromUri(baltatharPrivateKey, undefined, 'ethereum'); + const dorothyAccount = moonriverKeyring.addFromUri(dorothyPrivateKey, undefined, 'ethereum'); + + const councilVotingThreshold = 2; + const technicalCommitteeThreshold = 2; + const votingPeriod = 3; + const delayPeriod = 0; + + const uniqueAssetMetadata = { + name: 'xcQuartz', + symbol: 'xcQTZ', + decimals: 18, + isFrozen: false, + minimalBalance: 1, + }; + + let actuallySent1: bigint; + let actuallySent2: bigint; + + let balanceQuartz1: bigint; + let balanceQuartz2: bigint; + let balanceQuartz3: bigint; + + let balanceMoonriverMovr1: bigint; + let balanceMoonriverMovr2: bigint; + let balanceMoonriverMovr3: bigint; + + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + quartzAlice = privateKeyWrapper('//Alice'); + randomAccountQuartz = generateKeyringPair(); + randomAccountMoonriver = generateKeyringPair('ethereum'); + }); + + const moonriverApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + MOONRIVER_PORT), + }; + + await usingApi( + async (api) => { + + // >>> Sponsoring Dorothy >>> + const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n); + const events0 = await submitTransactionAsync(alithAccount, tx0); + const result0 = getGenericResult(events0); + expect(result0.success).to.be.true; + // <<< Sponsoring Dorothy <<< + + const sourceLocation: MultiLocation = api.createType( + 'MultiLocation', + { + parents: 1, + interior: {X1: {Parachain: QUARTZ_CHAIN}}, + }, + ); + + assetId = api.registry.hash(sourceLocation.toU8a()).slice(0, 16).reverse(); + console.log('Internal asset ID is %s', assetId); + quartzAssetLocation = {XCM: sourceLocation}; + const existentialDeposit = 1; + const isSufficient = true; + const unitsPerSecond = '1'; + const numAssetsWeightHint = 0; + + const registerTx = api.tx.assetManager.registerForeignAsset( + quartzAssetLocation, + uniqueAssetMetadata, + existentialDeposit, + isSufficient, + ); + console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || ''); + + const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond( + quartzAssetLocation, + unitsPerSecond, + numAssetsWeightHint, + ); + console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || ''); + + const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]); + console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || ''); + + // >>> Note motion preimage >>> + const encodedProposal = batchCall?.method.toHex() || ''; + const proposalHash = blake2AsHex(encodedProposal); + console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal); + console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); + console.log('Encoded length %d', encodedProposal.length); + + const tx1 = api.tx.democracy.notePreimage(encodedProposal); + const events1 = await submitTransactionAsync(baltatharAccount, tx1); + const result1 = getGenericResult(events1); + expect(result1.success).to.be.true; + // <<< Note motion preimage <<< + + // >>> Propose external motion through council >>> + const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash); + const tx2 = api.tx.councilCollective.propose( + councilVotingThreshold, + externalMotion, + externalMotion.encodedLength, + ); + const events2 = await submitTransactionAsync(baltatharAccount, tx2); + const result2 = getGenericResult(events2); + expect(result2.success).to.be.true; + + const encodedMotion = externalMotion?.method.toHex() || ''; + const motionHash = blake2AsHex(encodedMotion); + console.log('Motion hash is %s', motionHash); + + const tx3 = api.tx.councilCollective.vote(motionHash, 0, true); + { + const events3 = await submitTransactionAsync(dorothyAccount, tx3); + const result3 = getGenericResult(events3); + expect(result3.success).to.be.true; + } + { + const events3 = await submitTransactionAsync(baltatharAccount, tx3); + const result3 = getGenericResult(events3); + expect(result3.success).to.be.true; + } + + const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength); + const events4 = await submitTransactionAsync(dorothyAccount, tx4); + const result4 = getGenericResult(events4); + expect(result4.success).to.be.true; + // <<< Propose external motion through council <<< + + // >>> Fast track proposal through technical committee >>> + const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); + const tx5 = api.tx.techCommitteeCollective.propose( + technicalCommitteeThreshold, + fastTrack, + fastTrack.encodedLength, + ); + const events5 = await submitTransactionAsync(alithAccount, tx5); + const result5 = getGenericResult(events5); + expect(result5.success).to.be.true; + + const encodedFastTrack = fastTrack?.method.toHex() || ''; + const fastTrackHash = blake2AsHex(encodedFastTrack); + console.log('FastTrack hash is %s', fastTrackHash); + + const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1; + const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true); + { + const events6 = await submitTransactionAsync(baltatharAccount, tx6); + const result6 = getGenericResult(events6); + expect(result6.success).to.be.true; + } + { + const events6 = await submitTransactionAsync(alithAccount, tx6); + const result6 = getGenericResult(events6); + expect(result6.success).to.be.true; + } + + const tx7 = api.tx.techCommitteeCollective + .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength); + const events7 = await submitTransactionAsync(baltatharAccount, tx7); + const result7 = getGenericResult(events7); + expect(result7.success).to.be.true; + // <<< Fast track proposal through technical committee <<< + + // >>> Referendum voting >>> + const tx8 = api.tx.democracy.vote( + 0, + {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}}, + ); + const events8 = await submitTransactionAsync(dorothyAccount, tx8); + const result8 = getGenericResult(events8); + expect(result8.success).to.be.true; + // <<< Referendum voting <<< + + // >>> Sponsoring random Account >>> + const tx9 = api.tx.balances.transfer(randomAccountMoonriver.address, 11_000_000_000_000_000_000n); + const events9 = await submitTransactionAsync(baltatharAccount, tx9); + const result9 = getGenericResult(events9); + expect(result9.success).to.be.true; + // <<< Sponsoring random Account <<< + + [balanceMoonriverMovr1] = await getBalance(api, [randomAccountMoonriver.address]); + }, + moonriverApiOptions, + ); + + await usingApi(async (api) => { + const tx0 = api.tx.balances.transfer(randomAccountQuartz.address, 10n * TRANSFER_AMOUNT); + const events0 = await submitTransactionAsync(quartzAlice, tx0); + const result0 = getGenericResult(events0); + expect(result0.success).to.be.true; + + [balanceQuartz1] = await getBalance(api, [randomAccountQuartz.address]); + }); + }); + + it('Should connect and send QTZ to Moonriver', async () => { + await usingApi(async (api) => { + const currencyId = { + NativeAssetId: 'Here', + }; + const dest = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: MOONRIVER_CHAIN}, + {AccountKey20: {network: 'Any', key: randomAccountMoonriver.address}}, + ], + }, + }, + }; + const amount = TRANSFER_AMOUNT; + const destWeight = 50000000; + + const tx = api.tx.xTokens.transfer(currencyId, amount, dest, destWeight); + const events = await submitTransactionAsync(quartzAlice, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceQuartz2] = await getBalance(api, [randomAccountQuartz.address]); + expect(balanceQuartz2 < balanceQuartz1).to.be.true; + + const transactionFees = balanceQuartz1 - balanceQuartz2 - TRANSFER_AMOUNT; + actuallySent1 = TRANSFER_AMOUNT; // Why not TRANSFER_AMOUNT - transactionFees ??? + console.log('Quartz to Moonriver transaction fees on Quartz: %s QTZ', transactionFees); + expect(transactionFees > 0).to.be.true; + }); + + await usingApi( + async (api) => { + // todo do something about instant sealing, where there might not be any new blocks + await waitNewBlocks(api, 3); + + [balanceMoonriverMovr2] = await getBalance(api, [randomAccountMoonriver.address]); + + const movrFees = balanceMoonriverMovr1 - balanceMoonriverMovr2; + console.log('Quartz to Moonriver transaction fees on Moonriver: %s MOVR', movrFees); + expect(movrFees == 0n).to.be.true; + }, + {provider: new WsProvider('ws://127.0.0.1:' + MOONRIVER_PORT)}, + ); + }); + + it('Should connect to Moonriver and send QTZ back', async () => { + await usingApi( + async (api) => { + const amount = TRANSFER_AMOUNT / 2n; + const asset = { + V1: { + id: { + Concrete: { + parents: 1, + interior: { + X1: {Parachain: QUARTZ_CHAIN}, + }, + }, + }, + fun: { + Fungible: amount, + }, + }, + }; + const destination = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: QUARTZ_CHAIN}, + {AccountId32: {network: 'Any', id: randomAccountQuartz.addressRaw}}, + ], + }, + }, + }; + const destWeight = 50000000; + + const tx = api.tx.xTokens.transferMultiasset(asset, destination, destWeight); + const events = await submitTransactionAsync(randomAccountMoonriver, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceMoonriverMovr3] = await getBalance(api, [randomAccountMoonriver.address]); + + const movrFees = balanceMoonriverMovr2 - balanceMoonriverMovr3; + actuallySent2 = amount; + console.log('Moonriver to Quartz transaction fees on Moonriver: %s MOVR', movrFees); + expect(movrFees > 0).to.be.true; + }, + {provider: new WsProvider('ws://127.0.0.1:' + MOONRIVER_PORT)}, + ); + + await usingApi(async (api) => { + // todo do something about instant sealing, where there might not be any new blocks + await waitNewBlocks(api, 3); + + [balanceQuartz3] = await getBalance(api, [randomAccountQuartz.address]); + const actuallyDelivered = balanceQuartz3 - balanceQuartz2; + expect(actuallyDelivered > 0).to.be.true; + + const qtzFees = actuallySent2 - actuallyDelivered; + console.log('Moonriver to Quartz transaction fees on Quartz: %s QTZ', qtzFees); + expect(qtzFees > 0).to.be.true; + }); + }); +}); diff --git a/tests/src/xcmTransferStatemine.test.ts b/tests/src/xcmTransferStatemine.test.ts new file mode 100644 index 0000000000..5916a413f8 --- /dev/null +++ b/tests/src/xcmTransferStatemine.test.ts @@ -0,0 +1,321 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; + +import {WsProvider} from '@polkadot/api'; +import {ApiOptions} from '@polkadot/api/types'; +import {IKeyringPair} from '@polkadot/types/types'; +import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; +import {getGenericResult} from './util/helpers'; +import waitNewBlocks from './substrate/wait-new-blocks'; +import {normalizeAccountId} from './util/helpers'; + + +chai.use(chaiAsPromised); +const expect = chai.expect; + +const RELAY_PORT = '9844'; +const UNIQUE_CHAIN = 5000; +const UNIQUE_PORT = '9944'; +const STATEMINE_CHAIN = 1000; +const STATEMINE_PORT = '9946'; +const STATEMINE_PALLET_INSTANCE = 50; +const ASSET_ID = 100; +const ASSET_METADATA_DECIMALS = 18; +const ASSET_METADATA_NAME = 'USDT'; +const ASSET_METADATA_DESCRIPTION = 'USDT'; +const ASSET_METADATA_MINIMAL_BALANCE = 1; + +describe('Integration test: Exchanging USDT with Statemine', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + alice = privateKeyWrapper('//Alice'); + bob = privateKeyWrapper('//Bob'); // funds donor + }); + + const statemineApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT), + }; + + const uniqueApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), + }; + + const relayApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + RELAY_PORT), + }; + + await usingApi(async (api) => { + + // 10,000.00 (ten thousands) USDT + const assetAmount = 1_000_000_000_000_000_000_000n; + // 350.00 (three hundred fifty) DOT + const fundingAmount = 3_500_000_000_000; + + const tx = api.tx.assets.create(ASSET_ID, alice.addressRaw, ASSET_METADATA_MINIMAL_BALANCE); + const events = await submitTransactionAsync(alice, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + // set metadata + const tx2 = api.tx.assets.setMetadata(ASSET_ID, ASSET_METADATA_NAME, ASSET_METADATA_DESCRIPTION, ASSET_METADATA_DECIMALS); + const events2 = await submitTransactionAsync(alice, tx2); + const result2 = getGenericResult(events2); + expect(result2.success).to.be.true; + + // mint some amount of asset + const tx3 = api.tx.assets.mint(ASSET_ID, alice.addressRaw, assetAmount); + const events3 = await submitTransactionAsync(alice, tx3); + const result3 = getGenericResult(events3); + expect(result3.success).to.be.true; + + // funding parachain sovereing account (Parachain: 5000) + const parachainSovereingAccount = '0x7369626c88130000000000000000000000000000000000000000000000000000'; + const tx4 = api.tx.balances.transfer(parachainSovereingAccount, fundingAmount); + const events4 = await submitTransactionAsync(bob, tx4); + const result4 = getGenericResult(events4); + expect(result4.success).to.be.true; + + }, statemineApiOptions); + + + await usingApi(async (api) => { + + const location = { + V1: { + parents: 1, + interior: {X3: [ + { + Parachain: STATEMINE_CHAIN, + }, + { + PalletInstance: STATEMINE_PALLET_INSTANCE, + }, + { + GeneralIndex: ASSET_ID, + }, + ]}, + }, + }; + + const metadata = + { + name: ASSET_ID, + symbol: ASSET_METADATA_NAME, + decimals: ASSET_METADATA_DECIMALS, + minimalBalance: ASSET_METADATA_MINIMAL_BALANCE, + }; + //registerForeignAsset(owner, location, metadata) + const tx = api.tx.foreingAssets.registerForeignAsset(alice.addressRaw, location, metadata); + const sudoTx = api.tx.sudo.sudo(tx as any); + const events = await submitTransactionAsync(alice, sudoTx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + }, uniqueApiOptions); + + + // Providing the relay currency to the unique sender account + await usingApi(async (api) => { + const destination = { + V1: { + parents: 0, + interior: {X1: { + Parachain: UNIQUE_CHAIN, + }, + }, + }}; + + const beneficiary = { + V1: { + parents: 0, + interior: {X1: { + AccountId32: { + network: 'Any', + id: alice.addressRaw, + }, + }}, + }, + }; + + const assets = { + V1: [ + { + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: 50_000_000_000_000_000n, + }, + }, + ], + }; + + const feeAssetItem = 0; + + const weightLimit = { + Limited: 5_000_000_000, + }; + + const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); + const events = await submitTransactionAsync(alice, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + }, relayApiOptions); + + }); + + it('Should connect and send USDT from Statemine to Unique', async () => { + + const statemineApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT), + }; + + const uniqueApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), + }; + + await usingApi(async (api) => { + + const dest = { + V1: { + parents: 1, + interior: {X1: { + Parachain: UNIQUE_CHAIN, + }, + }, + }}; + + const beneficiary = { + V1: { + parents: 0, + interior: {X1: { + AccountId32: { + network: 'Any', + id: alice.addressRaw, + }, + }}, + }, + }; + + const assets = { + V1: [ + { + id: { + Concrete: { + parents: 0, + interior: { + X2: [ + { + PalletInstance: STATEMINE_PALLET_INSTANCE, + }, + { + GeneralIndex: ASSET_ID, + }, + ]}, + }, + }, + fun: { + Fungible: 1_000_000_000_000_000_000n, + }, + }, + ], + }; + + const feeAssetItem = 0; + + const weightLimit = { + Limited: 5000000000, + }; + + const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(dest, beneficiary, assets, feeAssetItem, weightLimit); + const events = await submitTransactionAsync(alice, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + }, statemineApiOptions); + + + // ensure that asset has been delivered + await usingApi(async (api) => { + await waitNewBlocks(api, 3); + // expext collection id will be with id 1 + const free = (await api.query.fungible.balance(1, normalizeAccountId(alice.address))).toBigInt(); + expect(free > 0).to.be.true; + }, uniqueApiOptions); + }); + + it('Should connect and send USDT from Unique to Statemine back', async () => { + let balanceBefore: bigint; + const uniqueApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), + }; + + await usingApi(async (api) => { + balanceBefore = (await api.query.fungible.balance(1, normalizeAccountId(alice.address))).toBigInt(); + + const destination = { + V1: { + parents: 1, + interior: {X2: [ + { + Parachain: STATEMINE_CHAIN, + }, + { + AccountId32: { + network: 'Any', + id: alice.addressRaw, + }, + }, + ]}, + }, + }; + + const currencies = [[ + { + ForeignAssetId: 0, + }, + 10_000_000_000_000_000n, + ], + [ + { + NativeAssetId: 'Parent', + }, + 400_000_000_000_000n, + ]]; + + const feeItem = 1; + const destWeight = 500000000000; + + const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight); + const events = await submitTransactionAsync(alice, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + // todo do something about instant sealing, where there might not be any new blocks + await waitNewBlocks(api, 3); + const balanceAfter = (await api.query.fungible.balance(1, normalizeAccountId(alice.address))).toBigInt(); + expect(balanceAfter < balanceBefore).to.be.true; + }, uniqueApiOptions); + }); +}); \ No newline at end of file From 55191cf0727176dbe48f0692c0fe81956f348c8a Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Fri, 19 Aug 2022 19:43:02 +0700 Subject: [PATCH 0476/1274] Add tokens --- node/cli/src/chain_spec.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/node/cli/src/chain_spec.rs b/node/cli/src/chain_spec.rs index 7c58ab76df..085b529ec8 100644 --- a/node/cli/src/chain_spec.rs +++ b/node/cli/src/chain_spec.rs @@ -167,6 +167,7 @@ macro_rules! testnet_genesis { .collect(), }, treasury: Default::default(), + tokens: TokensConfig { balances: vec![] }, sudo: SudoConfig { key: Some($root_key), }, From 88e36460f932ffeb37c6612391e4bf4f6c17f68b Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 22 Aug 2022 09:49:05 +0300 Subject: [PATCH 0477/1274] fix: rename variable --- .docker/Dockerfile-parachain-upgrade-data | 6 +++--- .docker/Dockerfile-try-runtime | 8 ++++---- .docker/docker-compose.tmp-forkless-data.j2 | 2 +- .docker/docker-compose.try-runtime.j2 | 2 +- .docker/forkless-config/launch-config-forkless-data.j2 | 4 ++-- .env | 6 +++--- .github/workflows/codestyle.yml | 10 +++++++--- .github/workflows/forkless-update-data.yml | 8 ++++---- .github/workflows/try-runtime.yml | 8 ++++---- 9 files changed, 29 insertions(+), 25 deletions(-) diff --git a/.docker/Dockerfile-parachain-upgrade-data b/.docker/Dockerfile-parachain-upgrade-data index dbbb79942f..dd73f5a618 100644 --- a/.docker/Dockerfile-parachain-upgrade-data +++ b/.docker/Dockerfile-parachain-upgrade-data @@ -108,9 +108,9 @@ COPY --from=builder-chainql /chainql/target/release/chainql /chainql/target/rele COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm -ARG FORK_FROM= -ENV FORK_FROM=$FORK_FROM -CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" FORK_FROM && \ +ARG REPLICA_FROM= +ENV REPLICA_FROM=$REPLICA_FROM +CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" REPLICA_FROM && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ yarn start launch-config.json --test-upgrade-parachains diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index 4004eb1f25..58ffe7a41b 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -34,17 +34,17 @@ FROM rust-builder as builder-unique ARG PROFILE=release ARG FEATURE= -ARG FORK_FROM= +ARG REPLICA_FROM= ENV FEATURE $FEATURE -ENV FORK_FROM $FORK_FROM +ENV REPLICA_FROM $REPLICA_FROM COPY . /unique_parachain WORKDIR /unique_parachain RUN echo "Requested features: $FEATURE\n" && \ - echo "Fork from: $FORK_FROM\n" && \ + echo "Fork from: $REPLICA_FROM\n" && \ cargo build --features=$FEATURE --release -CMD cargo run --features=$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $FORK_FROM +CMD cargo run --features=$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $REPLICA_FROM diff --git a/.docker/docker-compose.tmp-forkless-data.j2 b/.docker/docker-compose.tmp-forkless-data.j2 index f7dfd9f70d..6888b3a0ff 100644 --- a/.docker/docker-compose.tmp-forkless-data.j2 +++ b/.docker/docker-compose.tmp-forkless-data.j2 @@ -12,7 +12,7 @@ services: - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - "MAINNET_TAG={{ MAINNET_TAG }}" - "MAINNET_BRANCH={{ MAINNET_BRANCH }}" - - "FORK_FROM={{ FORK_FROM }}" + - "REPLICA_FROM={{ REPLICA_FROM }}" context: ../ dockerfile: .docker/Dockerfile-parachain-upgrade-data image: node-parachain diff --git a/.docker/docker-compose.try-runtime.j2 b/.docker/docker-compose.try-runtime.j2 index 653b32dfd3..ade4fba0e9 100644 --- a/.docker/docker-compose.try-runtime.j2 +++ b/.docker/docker-compose.try-runtime.j2 @@ -6,5 +6,5 @@ services: args: - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - "FEATURE={{ FEATURE }}" - - "FORK_FROM={{ FORK_FROM }}" + - "REPLICA_FROM={{ REPLICA_FROM }}" diff --git a/.docker/forkless-config/launch-config-forkless-data.j2 b/.docker/forkless-config/launch-config-forkless-data.j2 index 804044f8f1..1fccad7d74 100644 --- a/.docker/forkless-config/launch-config-forkless-data.j2 +++ b/.docker/forkless-config/launch-config-forkless-data.j2 @@ -93,9 +93,9 @@ "balance": "1000000000000000000000000", "chainRawInitializer": [ "chainql", - "--ext-str=FORK_FROM", + "--ext-str=REPLICA_FROM", "--tla-code=rawSpec=import '${rawSpec}'", - "--tla-code=forkFrom=std.extVar('FORK_FROM')", + "--tla-code=forkFrom=std.extVar('REPLICA_FROM')", "fork.jsonnet" ], "nodes": [ diff --git a/.env b/.env index a4c4f8a9c6..0755a73c83 100644 --- a/.env +++ b/.env @@ -7,6 +7,6 @@ UNIQUE_MAINNET_TAG=v924010 KUSAMA_MAINNET_BRANCH=release-v0.9.26 QUARTZ_MAINNET_TAG=quartz-v924012-2 -OPAL_FORK_FROM=wss://eu-ws-opal.unique.network:443 -QUARTZ_FORK_FROM=wss://eu-ws-quartz.unique.network:443 -UNIQUE_FORK_FROM=wss://eu-ws.unique.network:443 +OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443 +QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 +UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443 diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 73e16d7ef0..81641cbdbc 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -37,16 +37,20 @@ jobs: if: github.event.pull_request.draft == true run: exit 1 - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Install latest nightly uses: actions-rs/toolchain@v1 with: toolchain: nightly default: true target: wasm32-unknown-unknown - components: rustfmt, clippy + components: rustfmt, clippy - name: Run cargo fmt - run: cargo fmt -- --check + run: cargo fmt -- --check # In that mode it returns only exit code. + - name: Cargo fmt state + if: success() + run: echo "Nothing to do. Cargo fmt returned exit code 0." + clippy: if: ${{ false }} diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index 17fe1079a1..b468242705 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -52,9 +52,9 @@ jobs: id: create_matrix with: matrix: | - network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, fork_from_address {${{ env.OPAL_FORK_FROM }}} - network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, fork_from_address {${{ env.QUARTZ_FORK_FROM }}} - network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, fork_from_address {${{ env.UNIQUE_FORK_FROM }}} + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} + network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} + network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} @@ -120,7 +120,7 @@ jobs: FEATURE=${{ matrix.features }} RUNTIME=${{ matrix.runtime }} BRANCH=${{ github.head_ref }} - FORK_FROM=${{ matrix.fork_from_address }} + REPLICA_FROM=${{ matrix.replica_from_address }} - name: Show build configuration run: cat .docker/docker-compose.${{ matrix.network }}.yml diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 4935576113..397d0fd426 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -38,13 +38,13 @@ jobs: include: - network: opal features: try-runtime,opal-runtime - fork_from_address: wss://eu-ws-opal.unique.network:443 + replica_from_address: wss://eu-ws-opal.unique.network:443 - network: quartz features: try-runtime,quartz-runtime - fork_from_address: wss://eu-ws-quartz.unique.network:443 + replica_from_address: wss://eu-ws-quartz.unique.network:443 - network: unique features: try-runtime,unique-runtime - fork_from_address: wss://eu-ws.unique.network:443 + replica_from_address: wss://eu-ws.unique.network:443 steps: - name: Skip if pull request is in Draft @@ -85,7 +85,7 @@ jobs: variables: | RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} FEATURE=${{ matrix.features }} - FORK_FROM=${{ matrix.fork_from_address }} + REPLICA_FROM=${{ matrix.replica_from_address }} - name: Show build configuration run: cat .docker/docker-compose.try-runtime.${{ matrix.network }}.yml From d9cdcfb1a400d66c225ec9072178b1398170e9c4 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 22 Aug 2022 11:19:40 +0300 Subject: [PATCH 0478/1274] tests: separate unit tests into own workflow. apply for master and develop branches. --- .docker/Dockerfile-chain-dev-unit | 2 +- .env | 3 + .github/workflows/codestyle.yml | 2 +- .github/workflows/dev-build-tests.yml | 61 ------------------ .github/workflows/unit-tests.yml | 89 +++++++++++++++++++++++++++ 5 files changed, 94 insertions(+), 63 deletions(-) create mode 100644 .github/workflows/unit-tests.yml diff --git a/.docker/Dockerfile-chain-dev-unit b/.docker/Dockerfile-chain-dev-unit index 93145d6ff0..96f307d2a5 100644 --- a/.docker/Dockerfile-chain-dev-unit +++ b/.docker/Dockerfile-chain-dev-unit @@ -23,4 +23,4 @@ COPY . /dev_chain WORKDIR /dev_chain -RUN cargo test --features=limit-testing +CMD cargo test --features=limit-testing diff --git a/.env b/.env index 0755a73c83..1e0fe0920f 100644 --- a/.env +++ b/.env @@ -7,6 +7,9 @@ UNIQUE_MAINNET_TAG=v924010 KUSAMA_MAINNET_BRANCH=release-v0.9.26 QUARTZ_MAINNET_TAG=quartz-v924012-2 +UNQWND_MAINNET_BRANCH=release-v0.9.24 + OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443 QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443 + diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 81641cbdbc..fb3bdc4fb8 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -49,7 +49,7 @@ jobs: run: cargo fmt -- --check # In that mode it returns only exit code. - name: Cargo fmt state if: success() - run: echo "Nothing to do. Cargo fmt returned exit code 0." + run: echo "Nothing to do. Cargo fmt check - returned exit code 0." clippy: diff --git a/.github/workflows/dev-build-tests.yml b/.github/workflows/dev-build-tests.yml index 240224c1e5..d790938bb3 100644 --- a/.github/workflows/dev-build-tests.yml +++ b/.github/workflows/dev-build-tests.yml @@ -125,64 +125,3 @@ jobs: run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down - dev_build_unit_test: - # The type of runner that the job will run on - runs-on: [self-hosted-ci,medium] - timeout-minutes: 1380 - - name: unit tests - - - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - - - steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Generate ENV related extend file for docker-compose - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/docker-compose.tmp-unit.j2 - output_file: .docker/docker-compose.unit.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - FEATURE=${{ matrix.features }} - - - - name: Show build configuration - run: cat .docker/docker-compose.unit.yml - - - name: Build the stack - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" up -d --build --remove-orphans - - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" down diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000000..271b8932b3 --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,89 @@ +name: yarn test + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: + - develop + - master + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + - ready_for_review + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +#Define Workflow variables +env: + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + unit_tests: + # The type of runner that the job will run on + runs-on: [self-hosted-ci,medium] + timeout-minutes: 1380 + + name: unit tests + + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + + steps: + - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-unit.j2 + output_file: .docker/docker-compose.unit.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + FEATURE=${{ matrix.features }} + + + - name: Show build configuration + run: cat .docker/docker-compose.unit.yml + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" up --build --force-recreate --timeout 300 --remove-orphans --exit-code-from node-dev + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" down From 997ec5a7e5e6341320b0e86c34c52c2f1192660b Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 22 Aug 2022 11:21:35 +0300 Subject: [PATCH 0479/1274] Revert "tests: separate unit tests into own workflow. apply for master and develop branches." This reverts commit d9cdcfb1a400d66c225ec9072178b1398170e9c4. --- .docker/Dockerfile-chain-dev-unit | 2 +- .env | 3 - .github/workflows/codestyle.yml | 2 +- .github/workflows/dev-build-tests.yml | 61 ++++++++++++++++++ .github/workflows/unit-tests.yml | 89 --------------------------- 5 files changed, 63 insertions(+), 94 deletions(-) delete mode 100644 .github/workflows/unit-tests.yml diff --git a/.docker/Dockerfile-chain-dev-unit b/.docker/Dockerfile-chain-dev-unit index 96f307d2a5..93145d6ff0 100644 --- a/.docker/Dockerfile-chain-dev-unit +++ b/.docker/Dockerfile-chain-dev-unit @@ -23,4 +23,4 @@ COPY . /dev_chain WORKDIR /dev_chain -CMD cargo test --features=limit-testing +RUN cargo test --features=limit-testing diff --git a/.env b/.env index 1e0fe0920f..0755a73c83 100644 --- a/.env +++ b/.env @@ -7,9 +7,6 @@ UNIQUE_MAINNET_TAG=v924010 KUSAMA_MAINNET_BRANCH=release-v0.9.26 QUARTZ_MAINNET_TAG=quartz-v924012-2 -UNQWND_MAINNET_BRANCH=release-v0.9.24 - OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443 QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443 - diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index fb3bdc4fb8..81641cbdbc 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -49,7 +49,7 @@ jobs: run: cargo fmt -- --check # In that mode it returns only exit code. - name: Cargo fmt state if: success() - run: echo "Nothing to do. Cargo fmt check - returned exit code 0." + run: echo "Nothing to do. Cargo fmt returned exit code 0." clippy: diff --git a/.github/workflows/dev-build-tests.yml b/.github/workflows/dev-build-tests.yml index d790938bb3..240224c1e5 100644 --- a/.github/workflows/dev-build-tests.yml +++ b/.github/workflows/dev-build-tests.yml @@ -125,3 +125,64 @@ jobs: run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + dev_build_unit_test: + # The type of runner that the job will run on + runs-on: [self-hosted-ci,medium] + timeout-minutes: 1380 + + name: unit tests + + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + + steps: + - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-unit.j2 + output_file: .docker/docker-compose.unit.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + FEATURE=${{ matrix.features }} + + + - name: Show build configuration + run: cat .docker/docker-compose.unit.yml + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" up -d --build --remove-orphans + + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" down diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml deleted file mode 100644 index 271b8932b3..0000000000 --- a/.github/workflows/unit-tests.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: yarn test - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - develop - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -#Define Workflow variables -env: - REPO_URL: ${{ github.server_url }}/${{ github.repository }} - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - unit_tests: - # The type of runner that the job will run on - runs-on: [self-hosted-ci,medium] - timeout-minutes: 1380 - - name: unit tests - - - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - - - steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Generate ENV related extend file for docker-compose - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/docker-compose.tmp-unit.j2 - output_file: .docker/docker-compose.unit.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - FEATURE=${{ matrix.features }} - - - - name: Show build configuration - run: cat .docker/docker-compose.unit.yml - - - name: Build the stack - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" up --build --force-recreate --timeout 300 --remove-orphans --exit-code-from node-dev - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" down From a22c270fb3d4d1090292651c1a228a248fd5471e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 22 Aug 2022 11:46:12 +0300 Subject: [PATCH 0480/1274] tests: split integration tests and unit test into separate workflows --- .docker/Dockerfile-chain-dev-unit | 2 +- .github/workflows/unit-test.yml | 85 +++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/unit-test.yml diff --git a/.docker/Dockerfile-chain-dev-unit b/.docker/Dockerfile-chain-dev-unit index 93145d6ff0..96f307d2a5 100644 --- a/.docker/Dockerfile-chain-dev-unit +++ b/.docker/Dockerfile-chain-dev-unit @@ -23,4 +23,4 @@ COPY . /dev_chain WORKDIR /dev_chain -RUN cargo test --features=limit-testing +CMD cargo test --features=limit-testing diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml new file mode 100644 index 0000000000..2b503cf383 --- /dev/null +++ b/.github/workflows/unit-test.yml @@ -0,0 +1,85 @@ +name: unit tests + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: + - develop + - master + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + - ready_for_review + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + unit_tests: + # The type of runner that the job will run on + runs-on: [self-hosted-ci,medium] + timeout-minutes: 1380 + + name: unit tests ${{ GITHUB_REF }} + + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + + steps: + - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-unit.j2 + output_file: .docker/docker-compose.unit.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + FEATURE=${{ matrix.features }} + + + - name: Show build configuration + run: cat .docker/docker-compose.unit.yml + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" up --build --force-recreate --timeout 300 --remove-orphans --exit-code-from node-dev + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" down From c8ae4813a1adad8e8f6a7a2dd42f6ec88550fc36 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 22 Aug 2022 11:51:16 +0300 Subject: [PATCH 0481/1274] tests: remove unit test from integration tests --- .github/workflows/codestyle.yml | 2 +- .github/workflows/dev-build-tests.yml | 63 --------------------------- 2 files changed, 1 insertion(+), 64 deletions(-) diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 81641cbdbc..2536a5d8fb 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -49,7 +49,7 @@ jobs: run: cargo fmt -- --check # In that mode it returns only exit code. - name: Cargo fmt state if: success() - run: echo "Nothing to do. Cargo fmt returned exit code 0." + run: echo "Nothing to do. Command 'cargo fmt -- --check' returned exit code 0." clippy: diff --git a/.github/workflows/dev-build-tests.yml b/.github/workflows/dev-build-tests.yml index 240224c1e5..a1f08e1f4c 100644 --- a/.github/workflows/dev-build-tests.yml +++ b/.github/workflows/dev-build-tests.yml @@ -123,66 +123,3 @@ jobs: - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down - - - dev_build_unit_test: - # The type of runner that the job will run on - runs-on: [self-hosted-ci,medium] - timeout-minutes: 1380 - - name: unit tests - - - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - - - steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Generate ENV related extend file for docker-compose - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/docker-compose.tmp-unit.j2 - output_file: .docker/docker-compose.unit.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - FEATURE=${{ matrix.features }} - - - - name: Show build configuration - run: cat .docker/docker-compose.unit.yml - - - name: Build the stack - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" up -d --build --remove-orphans - - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" down From cf3633de37760b85ec8cb1bd4f4fa15740af42cb Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 22 Aug 2022 11:52:45 +0300 Subject: [PATCH 0482/1274] fix: leave only variable in job name --- .github/workflows/unit-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 2b503cf383..229dc3a5f7 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -28,7 +28,7 @@ jobs: runs-on: [self-hosted-ci,medium] timeout-minutes: 1380 - name: unit tests ${{ GITHUB_REF }} + name: ${{ GITHUB_REF }} continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. From b44720487369f2b58b9ddd536b4a67769b77a319 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 22 Aug 2022 11:59:14 +0300 Subject: [PATCH 0483/1274] add variable definition into .env --- .env | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.env b/.env index 0755a73c83..bdc9a7019a 100644 --- a/.env +++ b/.env @@ -7,6 +7,8 @@ UNIQUE_MAINNET_TAG=v924010 KUSAMA_MAINNET_BRANCH=release-v0.9.26 QUARTZ_MAINNET_TAG=quartz-v924012-2 +UNQWND_MAINNET_BRANCH=release-v0.9.24 + OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443 QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443 From 51e6bb1f06d2d5329b250694cad4922339f231a0 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 22 Aug 2022 12:06:47 +0300 Subject: [PATCH 0484/1274] fix: change env variable substitution --- .github/workflows/unit-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 229dc3a5f7..37cd78e059 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -28,7 +28,7 @@ jobs: runs-on: [self-hosted-ci,medium] timeout-minutes: 1380 - name: ${{ GITHUB_REF }} + name: ${{ env.GITHUB_REF }} continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. From 93d7101caaa2244d1e2d8613caf269829e0ba0a8 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 22 Aug 2022 12:12:29 +0300 Subject: [PATCH 0485/1274] fix: variable substitution. --- .github/workflows/unit-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 37cd78e059..66ab7cc958 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -28,7 +28,7 @@ jobs: runs-on: [self-hosted-ci,medium] timeout-minutes: 1380 - name: ${{ env.GITHUB_REF }} + name: ${{ github.ref }} continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. From 49055d4cb1eea466d3ea90d5aeb52f1c770068dc Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 22 Aug 2022 12:16:31 +0300 Subject: [PATCH 0486/1274] fix: switch to base_ref --- .github/workflows/unit-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 66ab7cc958..8557a47b7e 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -28,8 +28,7 @@ jobs: runs-on: [self-hosted-ci,medium] timeout-minutes: 1380 - name: ${{ github.ref }} - + name: ${{ github.base_ref }} continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. From 50312582bbeda87c52749160ba013769d90bb72f Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Mon, 22 Aug 2022 16:49:35 +0700 Subject: [PATCH 0487/1274] Fix feature foreign_assets misspels --- runtime/common/config/pallets/mod.rs | 2 +- runtime/common/config/xcm.rs | 14 +++++++++----- runtime/opal/Cargo.toml | 4 ++-- tests/package.json | 4 ++++ tests/src/xcmTransferStatemine.test.ts | 9 +++++---- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/runtime/common/config/pallets/mod.rs b/runtime/common/config/pallets/mod.rs index 1a2582895c..632b99b4ee 100644 --- a/runtime/common/config/pallets/mod.rs +++ b/runtime/common/config/pallets/mod.rs @@ -40,7 +40,7 @@ pub mod rmrk; #[cfg(feature = "scheduler")] pub mod scheduler; -#[cfg(feature = "foreign-asset")] +#[cfg(feature = "foreign-assets")] pub mod foreign_asset; parameter_types! { diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs index b5074d62d4..6e6b881342 100644 --- a/runtime/common/config/xcm.rs +++ b/runtime/common/config/xcm.rs @@ -40,9 +40,10 @@ use xcm_builder::{ FixedWeightBounds, FungiblesAdapter, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ParentIsPreset, + ConvertedConcreteAssetId }; use xcm_executor::{Config, XcmExecutor, Assets}; -use xcm_executor::traits::{Convert as ConvertXcm, MatchesFungible, WeightTrader, FilterAssetLocation}; +use xcm_executor::traits::{Convert as ConvertXcm, JustTry, MatchesFungible, WeightTrader, FilterAssetLocation}; use pallet_foreing_assets::{ AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, UsingAnyCurrencyComponents, TryAsForeing, ForeignAssetId, @@ -356,8 +357,9 @@ pub type FungiblesTransactor = FungiblesAdapter< /// Means for transacting assets on this chain. #[cfg(feature = "foreign-assets")] pub type AssetTransactors = FungiblesTransactor; -#[cfg(not(feature = "foreign-assets"))] -pub type AssetTransactors = LocalAssetTransactor; + +//#[cfg(not(feature = "foreign-assets"))] +//pub type AssetTransactors = LocalAssetTransactor; #[cfg(feature = "foreign-assets")] pub struct AllAsset; @@ -370,14 +372,15 @@ impl FilterAssetLocation for AllAsset { #[cfg(feature = "foreign-assets")] pub type IsReserve = AllAsset; -#[cfg(not(feature = "foreign-assets"))] -pub type IsReserve = NativeAsset; +//#[cfg(not(feature = "foreign-assets"))] +//pub type IsReserve = NativeAsset; #[cfg(feature = "foreign-assets")] type Trader = UsingAnyCurrencyComponents< pallet_configuration::WeightToFee, RelayLocation, AccountId, Balances, ()>; +/* #[cfg(not(feature = "foreign-assets"))] type Trader = UsingOnlySelfCurrencyComponents< pallet_configuration::WeightToFee, @@ -386,6 +389,7 @@ type Trader = UsingOnlySelfCurrencyComponents< Balances, (), >; +*/ pub struct XcmConfig(PhantomData); impl Config for XcmConfig diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 84409dd888..561d6367a3 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -126,12 +126,12 @@ std = [ "pallet-foreing-assets/std" ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] -opal-runtime = ['refungible', 'scheduler', 'rmrk', 'foreign-asset'] +opal-runtime = ['refungible', 'scheduler', 'rmrk', 'foreign-assets'] refungible = [] scheduler = [] rmrk = [] -foreign-asset = [] +foreign-assets = [] ################################################################################ # Substrate Dependencies diff --git a/tests/package.json b/tests/package.json index 804a2f9813..55f1e8def0 100644 --- a/tests/package.json +++ b/tests/package.json @@ -75,6 +75,10 @@ "testScheduler": "mocha --timeout 9999999 -r ts-node/register ./**/scheduler.test.ts", "testSchedulingEVM": "mocha --timeout 9999999 -r ts-node/register ./**/eth/scheduling.test.ts", "testXcmTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/xcmTransfer.test.ts", + "testXcmTransferAcala": "mocha --timeout 9999999 -r ts-node/register ./**/xcmTransferAcala.test.ts", + "testXcmTransferKarura": "mocha --timeout 9999999 -r ts-node/register ./**/xcmTransferKarura.test.ts", + "testXcmTransferStatemine": "mocha --timeout 9999999 -r ts-node/register ./**/xcmTransferStatemine.test.ts", + "testXcmTransferMoonriver": "mocha --timeout 9999999 -r ts-node/register ./**/xcmTransferMoonriver.test.ts", "testPalletPresence": "mocha --timeout 9999999 -r ts-node/register ./**/pallet-presence.test.ts", "testBlockProduction": "mocha --timeout 9999999 -r ts-node/register ./**/block-production.test.ts", "testEnableDisableTransfers": "mocha --timeout 9999999 -r ts-node/register ./**/enableDisableTransfer.test.ts", diff --git a/tests/src/xcmTransferStatemine.test.ts b/tests/src/xcmTransferStatemine.test.ts index 5916a413f8..097d510795 100644 --- a/tests/src/xcmTransferStatemine.test.ts +++ b/tests/src/xcmTransferStatemine.test.ts @@ -30,7 +30,7 @@ chai.use(chaiAsPromised); const expect = chai.expect; const RELAY_PORT = '9844'; -const UNIQUE_CHAIN = 5000; +const UNIQUE_CHAIN = 2037; const UNIQUE_PORT = '9944'; const STATEMINE_CHAIN = 1000; const STATEMINE_PORT = '9946'; @@ -87,8 +87,9 @@ describe('Integration test: Exchanging USDT with Statemine', () => { const result3 = getGenericResult(events3); expect(result3.success).to.be.true; - // funding parachain sovereing account (Parachain: 5000) - const parachainSovereingAccount = '0x7369626c88130000000000000000000000000000000000000000000000000000'; + // funding parachain sovereing account (Parachain: 2037) + //const parachainSovereingAccount = '0x70617261f5070000000000000000000000000000000000000000000000000000'; + const parachainSovereingAccount = '0x7369626cf5070000000000000000000000000000000000000000000000000000'; const tx4 = api.tx.balances.transfer(parachainSovereingAccount, fundingAmount); const events4 = await submitTransactionAsync(bob, tx4); const result4 = getGenericResult(events4); @@ -265,7 +266,7 @@ describe('Integration test: Exchanging USDT with Statemine', () => { }, uniqueApiOptions); }); - it('Should connect and send USDT from Unique to Statemine back', async () => { + it.skip('Should connect and send USDT from Unique to Statemine back', async () => { let balanceBefore: bigint; const uniqueApiOptions: ApiOptions = { provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), From 8f3105b215d3263d7e1ff607fb3a850ad8b8d2b4 Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Mon, 22 Aug 2022 17:28:38 +0700 Subject: [PATCH 0488/1274] update test types --- tests/src/interfaces/augment-api-consts.ts | 40 +- tests/src/interfaces/augment-api-errors.ts | 153 +- tests/src/interfaces/augment-api-events.ts | 104 +- tests/src/interfaces/augment-api-query.ts | 80 +- tests/src/interfaces/augment-api-rpc.ts | 28 +- tests/src/interfaces/augment-api-tx.ts | 245 +++- tests/src/interfaces/augment-api.ts | 1 - tests/src/interfaces/augment-types.ts | 110 +- tests/src/interfaces/default/types.ts | 326 +++++ tests/src/interfaces/lookup.ts | 962 +++++++----- tests/src/interfaces/registry.ts | 24 +- tests/src/interfaces/types-lookup.ts | 1526 ++++++++++++-------- 12 files changed, 2491 insertions(+), 1108 deletions(-) diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index fbcdedd375..a7b08ef06b 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -1,20 +1,14 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -// import type lookup before we augment - in some environments -// this is required to allow for ambient/previous definitions -import '@polkadot/api-base/types/consts'; - -import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types'; +import type { ApiTypes } from '@polkadot/api-base/types'; import type { Option, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { Codec } from '@polkadot/types-codec/types'; import type { Permill } from '@polkadot/types/interfaces/runtime'; -import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup'; - -export type __AugmentedConst = AugmentedConst; +import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion, XcmV1MultiLocation } from '@polkadot/types/lookup'; declare module '@polkadot/api-base/types/consts' { - interface AugmentedConsts { + export interface AugmentedConsts { balances: { /** * The minimum amount required to keep an account open. @@ -129,6 +123,17 @@ declare module '@polkadot/api-base/types/consts' { **/ [key: string]: Codec; }; + tokens: { + maxLocks: u32 & AugmentedConst; + /** + * The maximum number of named reserves that can exist on an account. + **/ + maxReserves: u32 & AugmentedConst; + /** + * Generic const + **/ + [key: string]: Codec; + }; transactionPayment: { /** * A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their @@ -206,5 +211,22 @@ declare module '@polkadot/api-base/types/consts' { **/ [key: string]: Codec; }; + xTokens: { + /** + * Base XCM weight. + * + * The actually weight for an XCM message is `T::BaseXcmWeight + + * T::Weigher::weight(&msg)`. + **/ + baseXcmWeight: u64 & AugmentedConst; + /** + * Self chain location. + **/ + selfLocation: XcmV1MultiLocation & AugmentedConst; + /** + * Generic const + **/ + [key: string]: Codec; + }; } // AugmentedConsts } // declare module diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 4148088679..0c06580ff8 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -1,16 +1,10 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -// import type lookup before we augment - in some environments -// this is required to allow for ambient/previous definitions -import '@polkadot/api-base/types/errors'; - -import type { ApiTypes, AugmentedError } from '@polkadot/api-base/types'; - -export type __AugmentedError = AugmentedError; +import type { ApiTypes } from '@polkadot/api-base/types'; declare module '@polkadot/api-base/types/errors' { - interface AugmentedErrors { + export interface AugmentedErrors { balances: { /** * Beneficiary account must pre-exist @@ -281,6 +275,29 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; + foreingAssets: { + /** + * AssetId exists + **/ + AssetIdExisted: AugmentedError; + /** + * AssetId not exists + **/ + AssetIdNotExists: AugmentedError; + /** + * The given location could not be used (e.g. because it cannot be expressed in the + * desired version of XCM). + **/ + BadLocation: AugmentedError; + /** + * MultiLocation existed + **/ + MultiLocationExisted: AugmentedError; + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; fungible: { /** * Fungible token does not support nesting. @@ -657,6 +674,41 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; + tokens: { + /** + * Cannot convert Amount into Balance type + **/ + AmountIntoBalanceFailed: AugmentedError; + /** + * The balance is too low + **/ + BalanceTooLow: AugmentedError; + /** + * Beneficiary account must pre-exist + **/ + DeadAccount: AugmentedError; + /** + * Value too low to create account due to existential deposit + **/ + ExistentialDeposit: AugmentedError; + /** + * Transfer/payment would kill account + **/ + KeepAlive: AugmentedError; + /** + * Failed because liquidity restrictions due to locking + **/ + LiquidityRestrictions: AugmentedError; + /** + * Failed because the maximum locks was exceeded + **/ + MaxLocksExceeded: AugmentedError; + TooManyReserves: AugmentedError; + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; treasury: { /** * The spend origin is valid but the amount it is allowed to spend is lower than the @@ -762,5 +814,90 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; + xTokens: { + /** + * Asset has no reserve location. + **/ + AssetHasNoReserve: AugmentedError; + /** + * The specified index does not exist in a MultiAssets struct. + **/ + AssetIndexNonExistent: AugmentedError; + /** + * The version of the `Versioned` value used is not able to be + * interpreted. + **/ + BadVersion: AugmentedError; + /** + * Could not re-anchor the assets to declare the fees for the + * destination chain. + **/ + CannotReanchor: AugmentedError; + /** + * The destination `MultiLocation` provided cannot be inverted. + **/ + DestinationNotInvertible: AugmentedError; + /** + * We tried sending distinct asset and fee but they have different + * reserve chains. + **/ + DistinctReserveForAssetAndFee: AugmentedError; + /** + * Fee is not enough. + **/ + FeeNotEnough: AugmentedError; + /** + * Could not get ancestry of asset reserve location. + **/ + InvalidAncestry: AugmentedError; + /** + * The MultiAsset is invalid. + **/ + InvalidAsset: AugmentedError; + /** + * Invalid transfer destination. + **/ + InvalidDest: AugmentedError; + /** + * MinXcmFee not registered for certain reserve location + **/ + MinXcmFeeNotDefined: AugmentedError; + /** + * Not cross-chain transfer. + **/ + NotCrossChainTransfer: AugmentedError; + /** + * Currency is not cross-chain transferable. + **/ + NotCrossChainTransferableCurrency: AugmentedError; + /** + * Not supported MultiLocation + **/ + NotSupportedMultiLocation: AugmentedError; + /** + * The number of assets to be sent is over the maximum. + **/ + TooManyAssetsBeingSent: AugmentedError; + /** + * The message's weight could not be determined. + **/ + UnweighableMessage: AugmentedError; + /** + * XCM execution failed. + **/ + XcmExecutionFailed: AugmentedError; + /** + * The transfering asset amount is zero. + **/ + ZeroAmount: AugmentedError; + /** + * The fee is zero. + **/ + ZeroFee: AugmentedError; + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; } // AugmentedErrors } // declare module diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index c812cba6f9..fdd82c93f1 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -1,20 +1,14 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -// import type lookup before we augment - in some environments -// this is required to allow for ambient/previous definitions -import '@polkadot/api-base/types/events'; - -import type { ApiTypes, AugmentedEvent } from '@polkadot/api-base/types'; +import type { ApiTypes } from '@polkadot/api-base/types'; import type { Bytes, Null, Option, Result, U256, U8aFixed, bool, u128, u32, u64, u8 } from '@polkadot/types-codec'; import type { ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime'; -import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; - -export type __AugmentedEvent = AugmentedEvent; +import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetMultiAssets, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; declare module '@polkadot/api-base/types/events' { - interface AugmentedEvents { + export interface AugmentedEvents { balances: { /** * A balance was set by root. @@ -208,6 +202,28 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; + foreingAssets: { + /** + * The asset registered. + **/ + AssetRegistered: AugmentedEvent; + /** + * The asset updated. + **/ + AssetUpdated: AugmentedEvent; + /** + * The foreign asset registered. + **/ + ForeignAssetRegistered: AugmentedEvent; + /** + * The foreign asset updated. + **/ + ForeignAssetUpdated: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; parachainSystem: { /** * Downward messages were processed using the given weight. @@ -469,6 +485,66 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; + tokens: { + /** + * A balance was set by root. + **/ + BalanceSet: AugmentedEvent; + /** + * Deposited some balance into an account + **/ + Deposited: AugmentedEvent; + /** + * An account was removed whose balance was non-zero but below + * ExistentialDeposit, resulting in an outright loss. + **/ + DustLost: AugmentedEvent; + /** + * An account was created with some free balance. + **/ + Endowed: AugmentedEvent; + /** + * Some locked funds were unlocked + **/ + LockRemoved: AugmentedEvent; + /** + * Some funds are locked + **/ + LockSet: AugmentedEvent; + /** + * Some balance was reserved (moved from free to reserved). + **/ + Reserved: AugmentedEvent; + /** + * Some reserved balance was repatriated (moved from reserved to + * another account). + **/ + ReserveRepatriated: AugmentedEvent; + /** + * Some balances were slashed (e.g. due to mis-behavior) + **/ + Slashed: AugmentedEvent; + /** + * The total issuance of an currency has been set + **/ + TotalIssuanceSet: AugmentedEvent; + /** + * Transfer succeeded. + **/ + Transfer: AugmentedEvent; + /** + * Some balance was unreserved (moved from reserved to free). + **/ + Unreserved: AugmentedEvent; + /** + * Some balances were withdrawn (e.g. pay for transaction fee) + **/ + Withdrawn: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; transactionPayment: { /** * A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee, @@ -657,5 +733,15 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; + xTokens: { + /** + * Transferred `MultiAsset` with fee. + **/ + TransferredMultiAssets: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; } // AugmentedEvents } // declare module diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 852f6e22f1..c03a606de1 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -1,22 +1,15 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -// import type lookup before we augment - in some environments -// this is required to allow for ambient/previous definitions -import '@polkadot/api-base/types/storage'; - -import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types'; +import type { ApiTypes } from '@polkadot/api-base/types'; import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime'; -import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsTokenChild } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup'; import type { Observable } from '@polkadot/types/types'; -export type __AugmentedQuery = AugmentedQuery unknown>; -export type __QueryableStorageEntry = QueryableStorageEntry; - declare module '@polkadot/api-base/types/storage' { - interface AugmentedQueries { + export interface AugmentedQueries { balances: { /** * The Balances pallet example of storing the balance of an account. @@ -213,6 +206,41 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; + foreingAssets: { + /** + * The storages for assets to fungible collection binding + * + **/ + assetBinding: AugmentedQuery Observable>, [u32]> & QueryableStorageEntry; + /** + * The storages for AssetMetadatas. + * + * AssetMetadatas: map AssetIds => Option + **/ + assetMetadatas: AugmentedQuery Observable>, [PalletForeingAssetsAssetIds]> & QueryableStorageEntry; + /** + * The storages for MultiLocations. + * + * ForeignAssetLocations: map ForeignAssetId => Option + **/ + foreignAssetLocations: AugmentedQuery Observable>, [u32]> & QueryableStorageEntry; + /** + * The storages for CurrencyIds. + * + * LocationToCurrencyIds: map MultiLocation => Option + **/ + locationToCurrencyIds: AugmentedQuery Observable>, [XcmV1MultiLocation]> & QueryableStorageEntry; + /** + * Next available Foreign AssetId ID. + * + * NextForeignAssetId: ForeignAssetId + **/ + nextForeignAssetId: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; fungible: { /** * Storage for assets delegated to a limited extent to other users. @@ -222,6 +250,10 @@ declare module '@polkadot/api-base/types/storage' { * Amount of tokens owned by an account inside a collection. **/ balance: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; + /** + * Foreign collection flag + **/ + foreignCollection: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; /** * Total amount of fungible tokens inside a collection. **/ @@ -668,6 +700,34 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; + tokens: { + /** + * The balance of a token type under an account. + * + * NOTE: If the total is ever zero, decrease account ref account. + * + * NOTE: This is only used in the case that this module is used to store + * balances. + **/ + accounts: AugmentedQuery Observable, [AccountId32, PalletForeingAssetsAssetIds]> & QueryableStorageEntry; + /** + * Any liquidity locks of a token type under an account. + * NOTE: Should only be accessed when setting, changing and freeing a lock. + **/ + locks: AugmentedQuery Observable>, [AccountId32, PalletForeingAssetsAssetIds]> & QueryableStorageEntry; + /** + * Named reserves on some account balances. + **/ + reserves: AugmentedQuery Observable>, [AccountId32, PalletForeingAssetsAssetIds]> & QueryableStorageEntry; + /** + * The total issuance of a token type. + **/ + totalIssuance: AugmentedQuery Observable, [PalletForeingAssetsAssetIds]> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; transactionPayment: { nextFeeMultiplier: AugmentedQuery Observable, []> & QueryableStorageEntry; storageVersion: AugmentedQuery Observable, []> & QueryableStorageEntry; diff --git a/tests/src/interfaces/augment-api-rpc.ts b/tests/src/interfaces/augment-api-rpc.ts index 7e220fca8e..f462d50d15 100644 --- a/tests/src/interfaces/augment-api-rpc.ts +++ b/tests/src/interfaces/augment-api-rpc.ts @@ -1,14 +1,10 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -// import type lookup before we augment - in some environments -// this is required to allow for ambient/previous definitions -import '@polkadot/rpc-core/types/jsonrpc'; - import type { PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsPartPartType, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionStats, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsRpcCollection, UpDataStructsTokenChild, UpDataStructsTokenData } from './default'; import type { AugmentedRpc } from '@polkadot/rpc-core/types'; import type { Metadata, StorageKey } from '@polkadot/types'; -import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, f64, u128, u32, u64 } from '@polkadot/types-codec'; +import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, u128, u32, u64 } from '@polkadot/types-codec'; import type { AnyNumber, Codec } from '@polkadot/types-codec/types'; import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; import type { EpochAuthorship } from '@polkadot/types/interfaces/babe'; @@ -19,7 +15,7 @@ import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; import type { CodeUploadRequest, CodeUploadResult, ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts'; import type { BlockStats } from '@polkadot/types/interfaces/dev'; import type { CreatedBlock } from '@polkadot/types/interfaces/engine'; -import type { EthAccount, EthCallRequest, EthFeeHistory, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth'; +import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth'; import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics'; import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa'; import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr'; @@ -31,10 +27,8 @@ import type { MigrationStatusResult, ReadProof, RuntimeVersion, TraceBlockRespon import type { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system'; import type { IExtrinsic, Observable } from '@polkadot/types/types'; -export type __AugmentedRpc = AugmentedRpc<() => unknown>; - declare module '@polkadot/rpc-core/types/jsonrpc' { - interface RpcInterface { + export interface RpcInterface { author: { /** * Returns true if the keystore has private keys for the given public key and key type. @@ -63,11 +57,11 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Submit and subscribe to watch an extrinsic until unsubscribed **/ - submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable>; + submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable>; /** * Submit a fully formatted extrinsic for block inclusion **/ - submitExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable>; + submitExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable>; }; babe: { /** @@ -204,10 +198,6 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { * Estimate gas needed for execution of given contract. **/ estimateGas: AugmentedRpc<(request: EthCallRequest | { from?: any; to?: any; gasPrice?: any; gas?: any; value?: any; data?: any; nonce?: any } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable>; - /** - * Returns fee history for given block count & reward percentiles - **/ - feeHistory: AugmentedRpc<(blockCount: U256 | AnyNumber | Uint8Array, newestBlock: BlockNumber | AnyNumber | Uint8Array, rewardPercentiles: Option> | null | Uint8Array | Vec | (f64)[]) => Observable>; /** * Returns current gas price. **/ @@ -300,10 +290,6 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { * Returns the number of hashes per second that the node is mining with. **/ hashrate: AugmentedRpc<() => Observable>; - /** - * Returns max priority fee per gas - **/ - maxPriorityFeePerGas: AugmentedRpc<() => Observable>; /** * Returns true if client is actively mining new blocks. **/ @@ -463,7 +449,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Get Theme's keys values **/ - themes: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, themeName: Text | string, keys: Option> | null | Uint8Array | Vec | (Text | string)[], at?: Hash | string | Uint8Array) => Observable>>; + themes: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, themeName: Text | string, keys: Option> | null | object | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; }; rpc: { /** @@ -551,7 +537,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Provides a way to trace the re-execution of a single block **/ - traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option | null | Uint8Array | Text | string, storageKeys: Option | null | Uint8Array | Text | string, methods: Option | null | Uint8Array | Text | string) => Observable>; + traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option | null | object | string | Uint8Array, storageKeys: Option | null | object | string | Uint8Array, methods: Option | null | object | string | Uint8Array) => Observable>; /** * Check current migration state **/ diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index 97d8627705..fd6371183d 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -1,22 +1,14 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -// import type lookup before we augment - in some environments -// this is required to allow for ambient/previous definitions -import '@polkadot/api-base/types/submittable'; - -import type { ApiTypes, AugmentedSubmittable, SubmittableExtrinsic, SubmittableExtrinsicFunction } from '@polkadot/api-base/types'; +import type { ApiTypes } from '@polkadot/api-base/types'; import type { Bytes, Compact, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; -import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, FrameSupportScheduleMaybeHashed, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartEquippableList, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; - -export type __AugmentedSubmittable = AugmentedSubmittable<() => unknown>; -export type __SubmittableExtrinsic = SubmittableExtrinsic; -export type __SubmittableExtrinsicFunction = SubmittableExtrinsicFunction; +import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, FrameSupportScheduleMaybeHashed, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartEquippableList, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/api-base/types/submittable' { - interface AugmentedSubmittables { + export interface AugmentedSubmittables { balances: { /** * Exactly as `transfer`, except the origin must be root and the source account may be @@ -113,8 +105,8 @@ declare module '@polkadot/api-base/types/submittable' { [key: string]: SubmittableExtrinsicFunction; }; configuration: { - setMinGasPriceOverride: AugmentedSubmittable<(coeff: Option | null | Uint8Array | u64 | AnyNumber) => SubmittableExtrinsic, [Option]>; - setWeightToFeeCoefficientOverride: AugmentedSubmittable<(coeff: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; + setMinGasPriceOverride: AugmentedSubmittable<(coeff: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + setWeightToFeeCoefficientOverride: AugmentedSubmittable<(coeff: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; /** * Generic tx **/ @@ -161,16 +153,16 @@ declare module '@polkadot/api-base/types/submittable' { /** * Issue an EVM call operation. This is similar to a message call transaction in Ethereum. **/ - call: AugmentedSubmittable<(source: H160 | string | Uint8Array, target: H160 | string | Uint8Array, input: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | Uint8Array | U256 | AnyNumber, nonce: Option | null | Uint8Array | U256 | AnyNumber, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, H160, Bytes, U256, u64, U256, Option, Option, Vec]>>]>; + call: AugmentedSubmittable<(source: H160 | string | Uint8Array, target: H160 | string | Uint8Array, input: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | object | string | Uint8Array, nonce: Option | null | object | string | Uint8Array, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, H160, Bytes, U256, u64, U256, Option, Option, Vec]>>]>; /** * Issue an EVM create operation. This is similar to a contract creation transaction in * Ethereum. **/ - create: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | Uint8Array | U256 | AnyNumber, nonce: Option | null | Uint8Array | U256 | AnyNumber, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, Bytes, U256, u64, U256, Option, Option, Vec]>>]>; + create: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | object | string | Uint8Array, nonce: Option | null | object | string | Uint8Array, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, Bytes, U256, u64, U256, Option, Option, Vec]>>]>; /** * Issue an EVM create2 operation. **/ - create2: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, salt: H256 | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | Uint8Array | U256 | AnyNumber, nonce: Option | null | Uint8Array | U256 | AnyNumber, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, Bytes, H256, U256, u64, U256, Option, Option, Vec]>>]>; + create2: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, salt: H256 | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | object | string | Uint8Array, nonce: Option | null | object | string | Uint8Array, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, Bytes, H256, U256, u64, U256, Option, Option, Vec]>>]>; /** * Withdraw balance from EVM into currency/balances pallet. **/ @@ -189,6 +181,14 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; + foreingAssets: { + registerForeignAsset: AugmentedSubmittable<(owner: AccountId32 | string | Uint8Array, location: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, metadata: PalletForeingAssetsModuleAssetMetadata | { name?: any; symbol?: any; decimals?: any; minimalBalance?: any } | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, XcmVersionedMultiLocation, PalletForeingAssetsModuleAssetMetadata]>; + updateForeignAsset: AugmentedSubmittable<(foreignAssetId: u32 | AnyNumber | Uint8Array, location: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, metadata: PalletForeingAssetsModuleAssetMetadata | { name?: any; symbol?: any; decimals?: any; minimalBalance?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, XcmVersionedMultiLocation, PalletForeingAssetsModuleAssetMetadata]>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; inflation: { /** * This method sets the inflation start date. Can be only called once. @@ -252,7 +252,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `origin`: Must be Root. * - `maybe_xcm_version`: The default XCM encoding version, or `None` to disable. **/ - forceDefaultXcmVersion: AugmentedSubmittable<(maybeXcmVersion: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; + forceDefaultXcmVersion: AugmentedSubmittable<(maybeXcmVersion: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; /** * Ask a location to notify us regarding their XCM version and any changes to it. * @@ -509,7 +509,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs. * Analogous to Unique's [`token_prefix`](up_data_structs::Collection). Cannot be changed. **/ - createCollection: AugmentedSubmittable<(metadata: Bytes | string | Uint8Array, max: Option | null | Uint8Array | u32 | AnyNumber, symbol: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes, Option, Bytes]>; + createCollection: AugmentedSubmittable<(metadata: Bytes | string | Uint8Array, max: Option | null | object | string | Uint8Array, symbol: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes, Option, Bytes]>; /** * Destroy a collection. * @@ -550,7 +550,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `transferable`: Can this NFT be transferred? Cannot be changed. * - `resources`: Resource data to be added to the NFT immediately after minting. **/ - mintNft: AugmentedSubmittable<(owner: Option | null | Uint8Array | AccountId32 | string, collectionId: u32 | AnyNumber | Uint8Array, recipient: Option | null | Uint8Array | AccountId32 | string, royaltyAmount: Option | null | Uint8Array | Permill | AnyNumber, metadata: Bytes | string | Uint8Array, transferable: bool | boolean | Uint8Array, resources: Option> | null | Uint8Array | Vec | (RmrkTraitsResourceResourceTypes | { Basic: any } | { Composable: any } | { Slot: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Option, u32, Option, Option, Bytes, bool, Option>]>; + mintNft: AugmentedSubmittable<(owner: Option | null | object | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, recipient: Option | null | object | string | Uint8Array, royaltyAmount: Option | null | object | string | Uint8Array, metadata: Bytes | string | Uint8Array, transferable: bool | boolean | Uint8Array, resources: Option> | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option, u32, Option, Option, Bytes, bool, Option>]>; /** * Reject an NFT sent from another account to self or owned NFT. * The NFT in question will not be sent back and burnt instead. @@ -636,7 +636,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `key`: Key of the custom property to be referenced by. * - `value`: Value of the custom property to be stored. **/ - setProperty: AugmentedSubmittable<(rmrkCollectionId: Compact | AnyNumber | Uint8Array, maybeNftId: Option | null | Uint8Array | u32 | AnyNumber, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Option, Bytes, Bytes]>; + setProperty: AugmentedSubmittable<(rmrkCollectionId: Compact | AnyNumber | Uint8Array, maybeNftId: Option | null | object | string | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Option, Bytes, Bytes]>; /** * Generic tx **/ @@ -706,7 +706,7 @@ declare module '@polkadot/api-base/types/submittable' { /** * Schedule a named task. **/ - scheduleNamed: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + scheduleNamed: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Schedule a named task after a delay. * @@ -714,7 +714,7 @@ declare module '@polkadot/api-base/types/submittable' { * Same as [`schedule_named`](Self::schedule_named). * # **/ - scheduleNamedAfter: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + scheduleNamedAfter: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Generic tx **/ @@ -878,6 +878,87 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; + tokens: { + /** + * Exactly as `transfer`, except the origin must be root and the source + * account may be specified. + * + * The dispatch origin for this call must be _Root_. + * + * - `source`: The sender of the transfer. + * - `dest`: The recipient of the transfer. + * - `currency_id`: currency type. + * - `amount`: free balance amount to tranfer. + **/ + forceTransfer: AugmentedSubmittable<(source: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [MultiAddress, MultiAddress, PalletForeingAssetsAssetIds, Compact]>; + /** + * Set the balances of a given account. + * + * This will alter `FreeBalance` and `ReservedBalance` in storage. it + * will also decrease the total issuance of the system + * (`TotalIssuance`). If the new free or reserved balance is below the + * existential deposit, it will reap the `AccountInfo`. + * + * The dispatch origin for this call is `root`. + **/ + setBalance: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, newFree: Compact | AnyNumber | Uint8Array, newReserved: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [MultiAddress, PalletForeingAssetsAssetIds, Compact, Compact]>; + /** + * Transfer some liquid free balance to another account. + * + * `transfer` will set the `FreeBalance` of the sender and receiver. + * It will decrease the total issuance of the system by the + * `TransferFee`. If the sender's account is below the existential + * deposit as a result of the transfer, the account will be reaped. + * + * The dispatch origin for this call must be `Signed` by the + * transactor. + * + * - `dest`: The recipient of the transfer. + * - `currency_id`: currency type. + * - `amount`: free balance amount to tranfer. + **/ + transfer: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [MultiAddress, PalletForeingAssetsAssetIds, Compact]>; + /** + * Transfer all remaining balance to the given account. + * + * NOTE: This function only attempts to transfer _transferable_ + * balances. This means that any locked, reserved, or existential + * deposits (when `keep_alive` is `true`), will not be transferred by + * this function. To ensure that this function results in a killed + * account, you might need to prepare the account by removing any + * reference counters, storage deposits, etc... + * + * The dispatch origin for this call must be `Signed` by the + * transactor. + * + * - `dest`: The recipient of the transfer. + * - `currency_id`: currency type. + * - `keep_alive`: A boolean to determine if the `transfer_all` + * operation should send all of the funds the account has, causing + * the sender account to be killed (false), or transfer everything + * except at least the existential deposit, which will guarantee to + * keep the sender account alive (true). + **/ + transferAll: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, keepAlive: bool | boolean | Uint8Array) => SubmittableExtrinsic, [MultiAddress, PalletForeingAssetsAssetIds, bool]>; + /** + * Same as the [`transfer`] call, but with a check that the transfer + * will not kill the origin account. + * + * 99% of the time you want [`transfer`] instead. + * + * The dispatch origin for this call must be `Signed` by the + * transactor. + * + * - `dest`: The recipient of the transfer. + * - `currency_id`: currency type. + * - `amount`: free balance amount to tranfer. + **/ + transferKeepAlive: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [MultiAddress, PalletForeingAssetsAssetIds, Compact]>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; treasury: { /** * Approve a proposal. At a later time, the proposal will be allocated to the beneficiary @@ -1538,5 +1619,125 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; + xTokens: { + /** + * Transfer native currencies. + * + * `dest_weight` is the weight for XCM execution on the dest chain, and + * it would be charged from the transferred assets. If set below + * requirements, the execution may fail and assets wouldn't be + * received. + * + * It's a no-op if any error on local XCM execution or message sending. + * Note sending assets out per se doesn't guarantee they would be + * received. Receiving depends on if the XCM message could be delivered + * by the network, and if the receiving chain would handle + * messages correctly. + **/ + transfer: AugmentedSubmittable<(currencyId: PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [PalletForeingAssetsAssetIds, u128, XcmVersionedMultiLocation, u64]>; + /** + * Transfer `MultiAsset`. + * + * `dest_weight` is the weight for XCM execution on the dest chain, and + * it would be charged from the transferred assets. If set below + * requirements, the execution may fail and assets wouldn't be + * received. + * + * It's a no-op if any error on local XCM execution or message sending. + * Note sending assets out per se doesn't guarantee they would be + * received. Receiving depends on if the XCM message could be delivered + * by the network, and if the receiving chain would handle + * messages correctly. + **/ + transferMultiasset: AugmentedSubmittable<(asset: XcmVersionedMultiAsset | { V0: any } | { V1: any } | string | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [XcmVersionedMultiAsset, XcmVersionedMultiLocation, u64]>; + /** + * Transfer several `MultiAsset` specifying the item to be used as fee + * + * `dest_weight` is the weight for XCM execution on the dest chain, and + * it would be charged from the transferred assets. If set below + * requirements, the execution may fail and assets wouldn't be + * received. + * + * `fee_item` is index of the MultiAssets that we want to use for + * payment + * + * It's a no-op if any error on local XCM execution or message sending. + * Note sending assets out per se doesn't guarantee they would be + * received. Receiving depends on if the XCM message could be delivered + * by the network, and if the receiving chain would handle + * messages correctly. + **/ + transferMultiassets: AugmentedSubmittable<(assets: XcmVersionedMultiAssets | { V0: any } | { V1: any } | string | Uint8Array, feeItem: u32 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [XcmVersionedMultiAssets, u32, XcmVersionedMultiLocation, u64]>; + /** + * Transfer `MultiAsset` specifying the fee and amount as separate. + * + * `dest_weight` is the weight for XCM execution on the dest chain, and + * it would be charged from the transferred assets. If set below + * requirements, the execution may fail and assets wouldn't be + * received. + * + * `fee` is the multiasset to be spent to pay for execution in + * destination chain. Both fee and amount will be subtracted form the + * callers balance For now we only accept fee and asset having the same + * `MultiLocation` id. + * + * If `fee` is not high enough to cover for the execution costs in the + * destination chain, then the assets will be trapped in the + * destination chain + * + * It's a no-op if any error on local XCM execution or message sending. + * Note sending assets out per se doesn't guarantee they would be + * received. Receiving depends on if the XCM message could be delivered + * by the network, and if the receiving chain would handle + * messages correctly. + **/ + transferMultiassetWithFee: AugmentedSubmittable<(asset: XcmVersionedMultiAsset | { V0: any } | { V1: any } | string | Uint8Array, fee: XcmVersionedMultiAsset | { V0: any } | { V1: any } | string | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [XcmVersionedMultiAsset, XcmVersionedMultiAsset, XcmVersionedMultiLocation, u64]>; + /** + * Transfer several currencies specifying the item to be used as fee + * + * `dest_weight` is the weight for XCM execution on the dest chain, and + * it would be charged from the transferred assets. If set below + * requirements, the execution may fail and assets wouldn't be + * received. + * + * `fee_item` is index of the currencies tuple that we want to use for + * payment + * + * It's a no-op if any error on local XCM execution or message sending. + * Note sending assets out per se doesn't guarantee they would be + * received. Receiving depends on if the XCM message could be delivered + * by the network, and if the receiving chain would handle + * messages correctly. + **/ + transferMulticurrencies: AugmentedSubmittable<(currencies: Vec> | ([PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, u128 | AnyNumber | Uint8Array])[], feeItem: u32 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec>, u32, XcmVersionedMultiLocation, u64]>; + /** + * Transfer native currencies specifying the fee and amount as + * separate. + * + * `dest_weight` is the weight for XCM execution on the dest chain, and + * it would be charged from the transferred assets. If set below + * requirements, the execution may fail and assets wouldn't be + * received. + * + * `fee` is the amount to be spent to pay for execution in destination + * chain. Both fee and amount will be subtracted form the callers + * balance. + * + * If `fee` is not high enough to cover for the execution costs in the + * destination chain, then the assets will be trapped in the + * destination chain + * + * It's a no-op if any error on local XCM execution or message sending. + * Note sending assets out per se doesn't guarantee they would be + * received. Receiving depends on if the XCM message could be delivered + * by the network, and if the receiving chain would handle + * messages correctly. + **/ + transferWithFee: AugmentedSubmittable<(currencyId: PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, fee: u128 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [PalletForeingAssetsAssetIds, u128, u128, XcmVersionedMultiLocation, u64]>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; } // AugmentedSubmittables } // declare module diff --git a/tests/src/interfaces/augment-api.ts b/tests/src/interfaces/augment-api.ts index 7cafd228bd..921d2f824d 100644 --- a/tests/src/interfaces/augment-api.ts +++ b/tests/src/interfaces/augment-api.ts @@ -7,4 +7,3 @@ import './augment-api-events'; import './augment-api-query'; import './augment-api-tx'; import './augment-api-rpc'; -import './augment-api-runtime'; diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index 4e44fb898c..c4c017a2b1 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -1,23 +1,17 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -// import type lookup before we augment - in some environments -// this is required to allow for ambient/previous definitions -import '@polkadot/types/types/registry'; - -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, PalletForeingAssetsModuleCall, PalletForeingAssetsModuleError, PalletForeingAssetsModuleEvent, PalletForeingAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; -import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; +import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations'; import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura'; import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; -import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeGenesisConfiguration, BabeGenesisConfigurationV1, BabeWeight, Epoch, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, OpaqueKeyOwnershipProof, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe'; +import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe'; import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, ReserveData, ReserveIdentifier, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances'; -import type { BeefyAuthoritySet, BeefyCommitment, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefyPayloadId, BeefySignedCommitment, MmrRootHash, ValidatorSet, ValidatorSetId } from '@polkadot/types/interfaces/beefy'; -import type { BenchmarkBatch, BenchmarkConfig, BenchmarkList, BenchmarkMetadata, BenchmarkParameter, BenchmarkResult } from '@polkadot/types/interfaces/benchmark'; -import type { CheckInherentsResult, InherentData, InherentIdentifier } from '@polkadot/types/interfaces/blockbuilder'; +import type { BeefyCommitment, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefySignedCommitment, MmrRootHash, ValidatorSetId } from '@polkadot/types/interfaces/beefy'; import type { BridgeMessageId, BridgedBlockHash, BridgedBlockNumber, BridgedHeader, CallOrigin, ChainId, DeliveredMessages, DispatchFeePayment, InboundLaneData, InboundRelayer, InitializationData, LaneId, MessageData, MessageKey, MessageNonce, MessagesDeliveryProofOf, MessagesProofOf, OperatingMode, OutboundLaneData, OutboundMessageFee, OutboundPayload, Parameter, RelayerId, UnrewardedRelayer, UnrewardedRelayersState } from '@polkadot/types/interfaces/bridges'; import type { BlockHash } from '@polkadot/types/interfaces/chain'; import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; @@ -27,13 +21,13 @@ import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/conse import type { AliveContractInfo, CodeHash, CodeSource, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractInstantiateResultTo299, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateRequestV1, InstantiateRequestV2, InstantiateReturnValue, InstantiateReturnValueOk, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts'; import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, ContractConstructorSpecV1, ContractConstructorSpecV2, ContractConstructorSpecV3, ContractContractSpecV0, ContractContractSpecV1, ContractContractSpecV2, ContractContractSpecV3, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpecLatest, ContractEventParamSpecV0, ContractEventParamSpecV2, ContractEventSpecLatest, ContractEventSpecV0, ContractEventSpecV1, ContractEventSpecV2, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpecLatest, ContractMessageParamSpecV0, ContractMessageParamSpecV2, ContractMessageSpecLatest, ContractMessageSpecV0, ContractMessageSpecV1, ContractMessageSpecV2, ContractMetadata, ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1, ContractMetadataV2, ContractMetadataV3, ContractProject, ContractProjectContract, ContractProjectInfo, ContractProjectSource, ContractProjectV0, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi'; import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan'; -import type { CollationInfo, CollationInfoV1, ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus'; +import type { ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus'; import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy'; import type { BlockStats } from '@polkadot/types/interfaces/dev'; import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections'; import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine'; -import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFeeHistory, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthReceiptV0, EthReceiptV3, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth'; -import type { EvmAccount, EvmCallInfo, EvmCreateInfo, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm'; +import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth'; +import type { EvmAccount, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm'; import type { AnySignature, EcdsaSignature, Ed25519Signature, Era, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics'; import type { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset'; import type { ActiveGilt, ActiveGiltsTotal, ActiveIndex, GiltBid } from '@polkadot/types/interfaces/gilt'; @@ -41,37 +35,35 @@ import type { AuthorityIndex, AuthorityList, AuthoritySet, AuthoritySetChange, A import type { IdentityFields, IdentityInfo, IdentityInfoAdditional, IdentityInfoTo198, IdentityJudgement, RegistrarIndex, RegistrarInfo, Registration, RegistrationJudgement, RegistrationTo198 } from '@polkadot/types/interfaces/identity'; import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline'; import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery'; -import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, OpaqueMetadata, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; -import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafBatchProof, MmrLeafIndex, MmrLeafProof, MmrNodeIndex, MmrProof } from '@polkadot/types/interfaces/mmr'; -import type { NpApiError } from '@polkadot/types/interfaces/nompools'; +import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; +import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr'; import type { StorageKind } from '@polkadot/types/interfaces/offchain'; import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences'; -import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateEvent, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, CoreState, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, GroupRotationInfo, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OccupiedCore, OccupiedCoreAssumption, OldV1SessionInfo, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, PvfCheckStatement, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, ScheduledCore, Scheduling, ScrapedOnChainVotes, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; +import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, Scheduling, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; import type { FeeDetails, InclusionFee, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; import type { Approvals } from '@polkadot/types/interfaces/poll'; import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy'; import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase'; import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery'; import type { RpcMethods } from '@polkadot/types/interfaces/rpc'; -import type { AccountId, AccountId20, AccountId32, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, SlotDuration, StorageData, StorageInfo, StorageProof, TransactionInfo, TransactionLongevity, TransactionPriority, TransactionStorageProof, TransactionTag, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; +import type { AccountId, AccountId20, AccountId32, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, StorageData, StorageProof, TransactionInfo, TransactionPriority, TransactionStorageProof, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; import type { Si0Field, Si0LookupTypeId, Si0Path, Si0Type, Si0TypeDef, Si0TypeDefArray, Si0TypeDefBitSequence, Si0TypeDefCompact, Si0TypeDefComposite, Si0TypeDefPhantom, Si0TypeDefPrimitive, Si0TypeDefSequence, Si0TypeDefTuple, Si0TypeDefVariant, Si0TypeParameter, Si0Variant, Si1Field, Si1LookupTypeId, Si1Path, Si1Type, Si1TypeDef, Si1TypeDefArray, Si1TypeDefBitSequence, Si1TypeDefCompact, Si1TypeDefComposite, Si1TypeDefPrimitive, Si1TypeDefSequence, Si1TypeDefTuple, Si1TypeDefVariant, Si1TypeParameter, Si1Variant, SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefBitSequence, SiTypeDefCompact, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiTypeParameter, SiVariant } from '@polkadot/types/interfaces/scaleInfo'; import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler'; import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session'; import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society'; import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactAssignmentsTo265, CompactAssignmentsWith16, CompactAssignmentsWith24, CompactScore, CompactScoreCompact, ElectionCompute, ElectionPhase, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, RawSolutionTo265, RawSolutionWith16, RawSolutionWith24, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SignedSubmission, SignedSubmissionOf, SignedSubmissionTo276, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, SubmissionIndicesOf, Supports, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking'; -import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, MigrationStatusResult, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, RuntimeVersionPre3, RuntimeVersionPre4, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state'; +import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, MigrationStatusResult, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state'; import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support'; -import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ApplyExtrinsicResultPre6, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorModulePre6, DispatchErrorModuleU8, DispatchErrorModuleU8a, DispatchErrorPre6, DispatchErrorPre6First, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchOutcomePre6, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, TransactionalError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system'; +import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, TransactionalError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system'; import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury'; import type { Multiplier } from '@polkadot/types/interfaces/txpayment'; -import type { TransactionSource, TransactionValidity, ValidTransaction } from '@polkadot/types/interfaces/txqueue'; import type { ClassDetails, ClassId, ClassMetadata, DepositBalance, DepositBalanceOf, DestroyWitness, InstanceDetails, InstanceId, InstanceMetadata } from '@polkadot/types/interfaces/uniques'; import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility'; import type { VestingInfo } from '@polkadot/types/interfaces/vesting'; import type { AssetInstance, AssetInstanceV0, AssetInstanceV1, AssetInstanceV2, BodyId, BodyPart, DoubleEncodedCall, Fungibility, FungibilityV0, FungibilityV1, FungibilityV2, InboundStatus, InstructionV2, InteriorMultiLocation, Junction, JunctionV0, JunctionV1, JunctionV2, Junctions, JunctionsV1, JunctionsV2, MultiAsset, MultiAssetFilter, MultiAssetFilterV1, MultiAssetFilterV2, MultiAssetV0, MultiAssetV1, MultiAssetV2, MultiAssets, MultiAssetsV1, MultiAssetsV2, MultiLocation, MultiLocationV0, MultiLocationV1, MultiLocationV2, NetworkId, OriginKindV0, OriginKindV1, OriginKindV2, OutboundStatus, Outcome, QueryId, QueryStatus, QueueConfigData, Response, ResponseV0, ResponseV1, ResponseV2, ResponseV2Error, ResponseV2Result, VersionMigrationStage, VersionedMultiAsset, VersionedMultiAssets, VersionedMultiLocation, VersionedResponse, VersionedXcm, WeightLimitV2, WildFungibility, WildFungibilityV0, WildFungibilityV1, WildFungibilityV2, WildMultiAsset, WildMultiAssetV1, WildMultiAssetV2, Xcm, XcmAssetId, XcmError, XcmErrorV0, XcmErrorV1, XcmErrorV2, XcmOrder, XcmOrderV0, XcmOrderV1, XcmOrderV2, XcmOrigin, XcmOriginKind, XcmV0, XcmV1, XcmV2, XcmVersion, XcmpMessageFormat } from '@polkadot/types/interfaces/xcm'; declare module '@polkadot/types/types/registry' { - interface InterfaceTypes { + export interface InterfaceTypes { AbridgedCandidateReceipt: AbridgedCandidateReceipt; AbridgedHostConfiguration: AbridgedHostConfiguration; AbridgedHrmpChannel: AbridgedHrmpChannel; @@ -103,7 +95,6 @@ declare module '@polkadot/types/types/registry' { AnySignature: AnySignature; ApiId: ApiId; ApplyExtrinsicResult: ApplyExtrinsicResult; - ApplyExtrinsicResultPre6: ApplyExtrinsicResultPre6; ApprovalFlag: ApprovalFlag; Approvals: Approvals; ArithmeticError: ArithmeticError; @@ -139,8 +130,6 @@ declare module '@polkadot/types/types/registry' { BabeBlockWeight: BabeBlockWeight; BabeEpochConfiguration: BabeEpochConfiguration; BabeEquivocationProof: BabeEquivocationProof; - BabeGenesisConfiguration: BabeGenesisConfiguration; - BabeGenesisConfigurationV1: BabeGenesisConfigurationV1; BabeWeight: BabeWeight; BackedCandidate: BackedCandidate; Balance: Balance; @@ -148,20 +137,12 @@ declare module '@polkadot/types/types/registry' { BalanceLockTo212: BalanceLockTo212; BalanceOf: BalanceOf; BalanceStatus: BalanceStatus; - BeefyAuthoritySet: BeefyAuthoritySet; BeefyCommitment: BeefyCommitment; BeefyId: BeefyId; BeefyKey: BeefyKey; BeefyNextAuthoritySet: BeefyNextAuthoritySet; BeefyPayload: BeefyPayload; - BeefyPayloadId: BeefyPayloadId; BeefySignedCommitment: BeefySignedCommitment; - BenchmarkBatch: BenchmarkBatch; - BenchmarkConfig: BenchmarkConfig; - BenchmarkList: BenchmarkList; - BenchmarkMetadata: BenchmarkMetadata; - BenchmarkParameter: BenchmarkParameter; - BenchmarkResult: BenchmarkResult; Bid: Bid; Bidder: Bidder; BidKind: BidKind; @@ -205,7 +186,6 @@ declare module '@polkadot/types/types/registry' { CallOrigin: CallOrigin; CandidateCommitments: CandidateCommitments; CandidateDescriptor: CandidateDescriptor; - CandidateEvent: CandidateEvent; CandidateHash: CandidateHash; CandidateInfo: CandidateInfo; CandidatePendingAvailability: CandidatePendingAvailability; @@ -215,7 +195,6 @@ declare module '@polkadot/types/types/registry' { ChainType: ChainType; ChangesTrieConfiguration: ChangesTrieConfiguration; ChangesTrieSignal: ChangesTrieSignal; - CheckInherentsResult: CheckInherentsResult; ClassDetails: ClassDetails; ClassId: ClassId; ClassMetadata: ClassMetadata; @@ -225,8 +204,6 @@ declare module '@polkadot/types/types/registry' { CodeUploadRequest: CodeUploadRequest; CodeUploadResult: CodeUploadResult; CodeUploadResultValue: CodeUploadResultValue; - CollationInfo: CollationInfo; - CollationInfoV1: CollationInfoV1; CollatorId: CollatorId; CollatorSignature: CollatorSignature; CollectiveOrigin: CollectiveOrigin; @@ -310,7 +287,6 @@ declare module '@polkadot/types/types/registry' { CoreAssignment: CoreAssignment; CoreIndex: CoreIndex; CoreOccupied: CoreOccupied; - CoreState: CoreState; CrateVersion: CrateVersion; CreatedBlock: CreatedBlock; CumulusPalletDmpQueueCall: CumulusPalletDmpQueueCall; @@ -352,18 +328,14 @@ declare module '@polkadot/types/types/registry' { DispatchClass: DispatchClass; DispatchError: DispatchError; DispatchErrorModule: DispatchErrorModule; - DispatchErrorModulePre6: DispatchErrorModulePre6; DispatchErrorModuleU8: DispatchErrorModuleU8; DispatchErrorModuleU8a: DispatchErrorModuleU8a; - DispatchErrorPre6: DispatchErrorPre6; - DispatchErrorPre6First: DispatchErrorPre6First; DispatchErrorTo198: DispatchErrorTo198; DispatchFeePayment: DispatchFeePayment; DispatchInfo: DispatchInfo; DispatchInfoTo190: DispatchInfoTo190; DispatchInfoTo244: DispatchInfoTo244; DispatchOutcome: DispatchOutcome; - DispatchOutcomePre6: DispatchOutcomePre6; DispatchResult: DispatchResult; DispatchResultOf: DispatchResultOf; DispatchResultTo198: DispatchResultTo198; @@ -387,7 +359,6 @@ declare module '@polkadot/types/types/registry' { ElectionStatus: ElectionStatus; EncodedFinalityProofs: EncodedFinalityProofs; EncodedJustification: EncodedJustification; - Epoch: Epoch; EpochAuthorship: EpochAuthorship; Era: Era; EraIndex: EraIndex; @@ -426,7 +397,6 @@ declare module '@polkadot/types/types/registry' { EthereumTransactionTransactionSignature: EthereumTransactionTransactionSignature; EthereumTransactionTransactionV2: EthereumTransactionTransactionV2; EthereumTypesHashH64: EthereumTypesHashH64; - EthFeeHistory: EthFeeHistory; EthFilter: EthFilter; EthFilterAddress: EthFilterAddress; EthFilterChanges: EthFilterChanges; @@ -436,8 +406,6 @@ declare module '@polkadot/types/types/registry' { EthHeader: EthHeader; EthLog: EthLog; EthReceipt: EthReceipt; - EthReceiptV0: EthReceiptV0; - EthReceiptV3: EthReceiptV3; EthRichBlock: EthRichBlock; EthRichHeader: EthRichHeader; EthStorageProof: EthStorageProof; @@ -465,13 +433,11 @@ declare module '@polkadot/types/types/registry' { EventMetadataV9: EventMetadataV9; EventRecord: EventRecord; EvmAccount: EvmAccount; - EvmCallInfo: EvmCallInfo; EvmCoreErrorExitError: EvmCoreErrorExitError; EvmCoreErrorExitFatal: EvmCoreErrorExitFatal; EvmCoreErrorExitReason: EvmCoreErrorExitReason; EvmCoreErrorExitRevert: EvmCoreErrorExitRevert; EvmCoreErrorExitSucceed: EvmCoreErrorExitSucceed; - EvmCreateInfo: EvmCreateInfo; EvmLog: EvmLog; EvmVicinity: EvmVicinity; ExecReturnValue: ExecReturnValue; @@ -500,10 +466,6 @@ declare module '@polkadot/types/types/registry' { ExtrinsicsWeight: ExtrinsicsWeight; ExtrinsicUnknown: ExtrinsicUnknown; ExtrinsicV4: ExtrinsicV4; - f32: f32; - F32: F32; - f64: f64; - F64: F64; FeeDetails: FeeDetails; Fixed128: Fixed128; Fixed64: Fixed64; @@ -575,7 +537,6 @@ declare module '@polkadot/types/types/registry' { GrandpaPrevote: GrandpaPrevote; GrandpaSignedPrecommit: GrandpaSignedPrecommit; GroupIndex: GroupIndex; - GroupRotationInfo: GroupRotationInfo; H1024: H1024; H128: H128; H160: H160; @@ -632,8 +593,6 @@ declare module '@polkadot/types/types/registry' { Index: Index; IndicesLookupSource: IndicesLookupSource; IndividualExposure: IndividualExposure; - InherentData: InherentData; - InherentIdentifier: InherentIdentifier; InitializationData: InitializationData; InstanceDetails: InstanceDetails; InstanceId: InstanceId; @@ -704,14 +663,8 @@ declare module '@polkadot/types/types/registry' { MetadataV14: MetadataV14; MetadataV9: MetadataV9; MigrationStatusResult: MigrationStatusResult; - MmrBatchProof: MmrBatchProof; - MmrEncodableOpaqueLeaf: MmrEncodableOpaqueLeaf; - MmrError: MmrError; MmrLeafBatchProof: MmrLeafBatchProof; - MmrLeafIndex: MmrLeafIndex; MmrLeafProof: MmrLeafProof; - MmrNodeIndex: MmrNodeIndex; - MmrProof: MmrProof; MmrRootHash: MmrRootHash; ModuleConstantMetadataV10: ModuleConstantMetadataV10; ModuleConstantMetadataV11: ModuleConstantMetadataV11; @@ -761,20 +714,14 @@ declare module '@polkadot/types/types/registry' { NominatorIndex: NominatorIndex; NominatorIndexCompact: NominatorIndexCompact; NotConnectedPeer: NotConnectedPeer; - NpApiError: NpApiError; Null: Null; - OccupiedCore: OccupiedCore; - OccupiedCoreAssumption: OccupiedCoreAssumption; OffchainAccuracy: OffchainAccuracy; OffchainAccuracyCompact: OffchainAccuracyCompact; OffenceDetails: OffenceDetails; Offender: Offender; - OldV1SessionInfo: OldV1SessionInfo; OpalRuntimeOriginCaller: OpalRuntimeOriginCaller; OpalRuntimeRuntime: OpalRuntimeRuntime; OpaqueCall: OpaqueCall; - OpaqueKeyOwnershipProof: OpaqueKeyOwnershipProof; - OpaqueMetadata: OpaqueMetadata; OpaqueMultiaddr: OpaqueMultiaddr; OpaqueNetworkState: OpaqueNetworkState; OpaquePeerId: OpaquePeerId; @@ -790,10 +737,19 @@ declare module '@polkadot/types/types/registry' { OriginKindV0: OriginKindV0; OriginKindV1: OriginKindV1; OriginKindV2: OriginKindV2; + OrmlTokensAccountData: OrmlTokensAccountData; + OrmlTokensBalanceLock: OrmlTokensBalanceLock; + OrmlTokensModuleCall: OrmlTokensModuleCall; + OrmlTokensModuleError: OrmlTokensModuleError; + OrmlTokensModuleEvent: OrmlTokensModuleEvent; + OrmlTokensReserveData: OrmlTokensReserveData; OrmlVestingModuleCall: OrmlVestingModuleCall; OrmlVestingModuleError: OrmlVestingModuleError; OrmlVestingModuleEvent: OrmlVestingModuleEvent; OrmlVestingVestingSchedule: OrmlVestingVestingSchedule; + OrmlXtokensModuleCall: OrmlXtokensModuleCall; + OrmlXtokensModuleError: OrmlXtokensModuleError; + OrmlXtokensModuleEvent: OrmlXtokensModuleEvent; OutboundHrmpMessage: OutboundHrmpMessage; OutboundLaneData: OutboundLaneData; OutboundMessageFee: OutboundMessageFee; @@ -837,6 +793,12 @@ declare module '@polkadot/types/types/registry' { PalletEvmEvent: PalletEvmEvent; PalletEvmMigrationCall: PalletEvmMigrationCall; PalletEvmMigrationError: PalletEvmMigrationError; + PalletForeingAssetsAssetIds: PalletForeingAssetsAssetIds; + PalletForeingAssetsModuleAssetMetadata: PalletForeingAssetsModuleAssetMetadata; + PalletForeingAssetsModuleCall: PalletForeingAssetsModuleCall; + PalletForeingAssetsModuleError: PalletForeingAssetsModuleError; + PalletForeingAssetsModuleEvent: PalletForeingAssetsModuleEvent; + PalletForeingAssetsNativeCurrency: PalletForeingAssetsNativeCurrency; PalletFungibleError: PalletFungibleError; PalletId: PalletId; PalletInflationCall: PalletInflationCall; @@ -951,7 +913,6 @@ declare module '@polkadot/types/types/registry' { ProxyDefinition: ProxyDefinition; ProxyState: ProxyState; ProxyType: ProxyType; - PvfCheckStatement: PvfCheckStatement; QueryId: QueryId; QueryStatus: QueryStatus; QueueConfigData: QueueConfigData; @@ -1040,11 +1001,8 @@ declare module '@polkadot/types/types/registry' { RuntimeVersion: RuntimeVersion; RuntimeVersionApi: RuntimeVersionApi; RuntimeVersionPartial: RuntimeVersionPartial; - RuntimeVersionPre3: RuntimeVersionPre3; - RuntimeVersionPre4: RuntimeVersionPre4; Schedule: Schedule; Scheduled: Scheduled; - ScheduledCore: ScheduledCore; ScheduledTo254: ScheduledTo254; SchedulePeriod: SchedulePeriod; SchedulePriority: SchedulePriority; @@ -1052,7 +1010,6 @@ declare module '@polkadot/types/types/registry' { ScheduleTo258: ScheduleTo258; ScheduleTo264: ScheduleTo264; Scheduling: Scheduling; - ScrapedOnChainVotes: ScrapedOnChainVotes; Seal: Seal; SealV0: SealV0; SeatHolder: SeatHolder; @@ -1141,7 +1098,6 @@ declare module '@polkadot/types/types/registry' { SlashingSpansTo204: SlashingSpansTo204; SlashJournalEntry: SlashJournalEntry; Slot: Slot; - SlotDuration: SlotDuration; SlotNumber: SlotNumber; SlotRange: SlotRange; SlotRange10: SlotRange10; @@ -1204,7 +1160,6 @@ declare module '@polkadot/types/types/registry' { StorageHasherV13: StorageHasherV13; StorageHasherV14: StorageHasherV14; StorageHasherV9: StorageHasherV9; - StorageInfo: StorageInfo; StorageKey: StorageKey; StorageKind: StorageKind; StorageMetadataV10: StorageMetadataV10; @@ -1234,15 +1189,11 @@ declare module '@polkadot/types/types/registry' { TraceError: TraceError; TransactionalError: TransactionalError; TransactionInfo: TransactionInfo; - TransactionLongevity: TransactionLongevity; TransactionPriority: TransactionPriority; - TransactionSource: TransactionSource; TransactionStorageProof: TransactionStorageProof; - TransactionTag: TransactionTag; TransactionV0: TransactionV0; TransactionV1: TransactionV1; TransactionV2: TransactionV2; - TransactionValidity: TransactionValidity; TransactionValidityError: TransactionValidityError; TransientValidationData: TransientValidationData; TreasuryProposal: TreasuryProposal; @@ -1318,12 +1269,10 @@ declare module '@polkadot/types/types/registry' { ValidatorPrefsTo196: ValidatorPrefsTo196; ValidatorPrefsWithBlocked: ValidatorPrefsWithBlocked; ValidatorPrefsWithCommission: ValidatorPrefsWithCommission; - ValidatorSet: ValidatorSet; ValidatorSetId: ValidatorSetId; ValidatorSignature: ValidatorSignature; ValidDisputeStatementKind: ValidDisputeStatementKind; ValidityAttestation: ValidityAttestation; - ValidTransaction: ValidTransaction; VecInboundHrmpMessage: VecInboundHrmpMessage; VersionedMultiAsset: VersionedMultiAsset; VersionedMultiAssets: VersionedMultiAssets; @@ -1417,6 +1366,7 @@ declare module '@polkadot/types/types/registry' { XcmV2WeightLimit: XcmV2WeightLimit; XcmV2Xcm: XcmV2Xcm; XcmVersion: XcmVersion; + XcmVersionedMultiAsset: XcmVersionedMultiAsset; XcmVersionedMultiAssets: XcmVersionedMultiAssets; XcmVersionedMultiLocation: XcmVersionedMultiLocation; XcmVersionedXcm: XcmVersionedXcm; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 731bbfa904..7375179edb 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -747,6 +747,163 @@ export interface OpalRuntimeOriginCaller extends Enum { /** @name OpalRuntimeRuntime */ export interface OpalRuntimeRuntime extends Null {} +/** @name OrmlTokensAccountData */ +export interface OrmlTokensAccountData extends Struct { + readonly free: u128; + readonly reserved: u128; + readonly frozen: u128; +} + +/** @name OrmlTokensBalanceLock */ +export interface OrmlTokensBalanceLock extends Struct { + readonly id: U8aFixed; + readonly amount: u128; +} + +/** @name OrmlTokensModuleCall */ +export interface OrmlTokensModuleCall extends Enum { + readonly isTransfer: boolean; + readonly asTransfer: { + readonly dest: MultiAddress; + readonly currencyId: PalletForeingAssetsAssetIds; + readonly amount: Compact; + } & Struct; + readonly isTransferAll: boolean; + readonly asTransferAll: { + readonly dest: MultiAddress; + readonly currencyId: PalletForeingAssetsAssetIds; + readonly keepAlive: bool; + } & Struct; + readonly isTransferKeepAlive: boolean; + readonly asTransferKeepAlive: { + readonly dest: MultiAddress; + readonly currencyId: PalletForeingAssetsAssetIds; + readonly amount: Compact; + } & Struct; + readonly isForceTransfer: boolean; + readonly asForceTransfer: { + readonly source: MultiAddress; + readonly dest: MultiAddress; + readonly currencyId: PalletForeingAssetsAssetIds; + readonly amount: Compact; + } & Struct; + readonly isSetBalance: boolean; + readonly asSetBalance: { + readonly who: MultiAddress; + readonly currencyId: PalletForeingAssetsAssetIds; + readonly newFree: Compact; + readonly newReserved: Compact; + } & Struct; + readonly type: 'Transfer' | 'TransferAll' | 'TransferKeepAlive' | 'ForceTransfer' | 'SetBalance'; +} + +/** @name OrmlTokensModuleError */ +export interface OrmlTokensModuleError extends Enum { + readonly isBalanceTooLow: boolean; + readonly isAmountIntoBalanceFailed: boolean; + readonly isLiquidityRestrictions: boolean; + readonly isMaxLocksExceeded: boolean; + readonly isKeepAlive: boolean; + readonly isExistentialDeposit: boolean; + readonly isDeadAccount: boolean; + readonly isTooManyReserves: boolean; + readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves'; +} + +/** @name OrmlTokensModuleEvent */ +export interface OrmlTokensModuleEvent extends Enum { + readonly isEndowed: boolean; + readonly asEndowed: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly amount: u128; + } & Struct; + readonly isDustLost: boolean; + readonly asDustLost: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly amount: u128; + } & Struct; + readonly isTransfer: boolean; + readonly asTransfer: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly from: AccountId32; + readonly to: AccountId32; + readonly amount: u128; + } & Struct; + readonly isReserved: boolean; + readonly asReserved: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly amount: u128; + } & Struct; + readonly isUnreserved: boolean; + readonly asUnreserved: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly amount: u128; + } & Struct; + readonly isReserveRepatriated: boolean; + readonly asReserveRepatriated: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly from: AccountId32; + readonly to: AccountId32; + readonly amount: u128; + readonly status: FrameSupportTokensMiscBalanceStatus; + } & Struct; + readonly isBalanceSet: boolean; + readonly asBalanceSet: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly free: u128; + readonly reserved: u128; + } & Struct; + readonly isTotalIssuanceSet: boolean; + readonly asTotalIssuanceSet: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly amount: u128; + } & Struct; + readonly isWithdrawn: boolean; + readonly asWithdrawn: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly amount: u128; + } & Struct; + readonly isSlashed: boolean; + readonly asSlashed: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly freeAmount: u128; + readonly reservedAmount: u128; + } & Struct; + readonly isDeposited: boolean; + readonly asDeposited: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly amount: u128; + } & Struct; + readonly isLockSet: boolean; + readonly asLockSet: { + readonly lockId: U8aFixed; + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly amount: u128; + } & Struct; + readonly isLockRemoved: boolean; + readonly asLockRemoved: { + readonly lockId: U8aFixed; + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + } & Struct; + readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'BalanceSet' | 'TotalIssuanceSet' | 'Withdrawn' | 'Slashed' | 'Deposited' | 'LockSet' | 'LockRemoved'; +} + +/** @name OrmlTokensReserveData */ +export interface OrmlTokensReserveData extends Struct { + readonly id: Null; + readonly amount: u128; +} + /** @name OrmlVestingModuleCall */ export interface OrmlVestingModuleCall extends Enum { readonly isClaim: boolean; @@ -806,6 +963,89 @@ export interface OrmlVestingVestingSchedule extends Struct { readonly perPeriod: Compact; } +/** @name OrmlXtokensModuleCall */ +export interface OrmlXtokensModuleCall extends Enum { + readonly isTransfer: boolean; + readonly asTransfer: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly amount: u128; + readonly dest: XcmVersionedMultiLocation; + readonly destWeight: u64; + } & Struct; + readonly isTransferMultiasset: boolean; + readonly asTransferMultiasset: { + readonly asset: XcmVersionedMultiAsset; + readonly dest: XcmVersionedMultiLocation; + readonly destWeight: u64; + } & Struct; + readonly isTransferWithFee: boolean; + readonly asTransferWithFee: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly amount: u128; + readonly fee: u128; + readonly dest: XcmVersionedMultiLocation; + readonly destWeight: u64; + } & Struct; + readonly isTransferMultiassetWithFee: boolean; + readonly asTransferMultiassetWithFee: { + readonly asset: XcmVersionedMultiAsset; + readonly fee: XcmVersionedMultiAsset; + readonly dest: XcmVersionedMultiLocation; + readonly destWeight: u64; + } & Struct; + readonly isTransferMulticurrencies: boolean; + readonly asTransferMulticurrencies: { + readonly currencies: Vec>; + readonly feeItem: u32; + readonly dest: XcmVersionedMultiLocation; + readonly destWeight: u64; + } & Struct; + readonly isTransferMultiassets: boolean; + readonly asTransferMultiassets: { + readonly assets: XcmVersionedMultiAssets; + readonly feeItem: u32; + readonly dest: XcmVersionedMultiLocation; + readonly destWeight: u64; + } & Struct; + readonly type: 'Transfer' | 'TransferMultiasset' | 'TransferWithFee' | 'TransferMultiassetWithFee' | 'TransferMulticurrencies' | 'TransferMultiassets'; +} + +/** @name OrmlXtokensModuleError */ +export interface OrmlXtokensModuleError extends Enum { + readonly isAssetHasNoReserve: boolean; + readonly isNotCrossChainTransfer: boolean; + readonly isInvalidDest: boolean; + readonly isNotCrossChainTransferableCurrency: boolean; + readonly isUnweighableMessage: boolean; + readonly isXcmExecutionFailed: boolean; + readonly isCannotReanchor: boolean; + readonly isInvalidAncestry: boolean; + readonly isInvalidAsset: boolean; + readonly isDestinationNotInvertible: boolean; + readonly isBadVersion: boolean; + readonly isDistinctReserveForAssetAndFee: boolean; + readonly isZeroFee: boolean; + readonly isZeroAmount: boolean; + readonly isTooManyAssetsBeingSent: boolean; + readonly isAssetIndexNonExistent: boolean; + readonly isFeeNotEnough: boolean; + readonly isNotSupportedMultiLocation: boolean; + readonly isMinXcmFeeNotDefined: boolean; + readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined'; +} + +/** @name OrmlXtokensModuleEvent */ +export interface OrmlXtokensModuleEvent extends Enum { + readonly isTransferredMultiAssets: boolean; + readonly asTransferredMultiAssets: { + readonly sender: AccountId32; + readonly assets: XcmV1MultiassetMultiAssets; + readonly fee: XcmV1MultiAsset; + readonly dest: XcmV1MultiLocation; + } & Struct; + readonly type: 'TransferredMultiAssets'; +} + /** @name PalletBalancesAccountData */ export interface PalletBalancesAccountData extends Struct { readonly free: u128; @@ -1194,6 +1434,83 @@ export interface PalletEvmMigrationError extends Enum { readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } +/** @name PalletForeingAssetsAssetIds */ +export interface PalletForeingAssetsAssetIds extends Enum { + readonly isForeignAssetId: boolean; + readonly asForeignAssetId: u32; + readonly isNativeAssetId: boolean; + readonly asNativeAssetId: PalletForeingAssetsNativeCurrency; + readonly type: 'ForeignAssetId' | 'NativeAssetId'; +} + +/** @name PalletForeingAssetsModuleAssetMetadata */ +export interface PalletForeingAssetsModuleAssetMetadata extends Struct { + readonly name: Bytes; + readonly symbol: Bytes; + readonly decimals: u8; + readonly minimalBalance: u128; +} + +/** @name PalletForeingAssetsModuleCall */ +export interface PalletForeingAssetsModuleCall extends Enum { + readonly isRegisterForeignAsset: boolean; + readonly asRegisterForeignAsset: { + readonly owner: AccountId32; + readonly location: XcmVersionedMultiLocation; + readonly metadata: PalletForeingAssetsModuleAssetMetadata; + } & Struct; + readonly isUpdateForeignAsset: boolean; + readonly asUpdateForeignAsset: { + readonly foreignAssetId: u32; + readonly location: XcmVersionedMultiLocation; + readonly metadata: PalletForeingAssetsModuleAssetMetadata; + } & Struct; + readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset'; +} + +/** @name PalletForeingAssetsModuleError */ +export interface PalletForeingAssetsModuleError extends Enum { + readonly isBadLocation: boolean; + readonly isMultiLocationExisted: boolean; + readonly isAssetIdNotExists: boolean; + readonly isAssetIdExisted: boolean; + readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted'; +} + +/** @name PalletForeingAssetsModuleEvent */ +export interface PalletForeingAssetsModuleEvent extends Enum { + readonly isForeignAssetRegistered: boolean; + readonly asForeignAssetRegistered: { + readonly assetId: u32; + readonly assetAddress: XcmV1MultiLocation; + readonly metadata: PalletForeingAssetsModuleAssetMetadata; + } & Struct; + readonly isForeignAssetUpdated: boolean; + readonly asForeignAssetUpdated: { + readonly assetId: u32; + readonly assetAddress: XcmV1MultiLocation; + readonly metadata: PalletForeingAssetsModuleAssetMetadata; + } & Struct; + readonly isAssetRegistered: boolean; + readonly asAssetRegistered: { + readonly assetId: PalletForeingAssetsAssetIds; + readonly metadata: PalletForeingAssetsModuleAssetMetadata; + } & Struct; + readonly isAssetUpdated: boolean; + readonly asAssetUpdated: { + readonly assetId: PalletForeingAssetsAssetIds; + readonly metadata: PalletForeingAssetsModuleAssetMetadata; + } & Struct; + readonly type: 'ForeignAssetRegistered' | 'ForeignAssetUpdated' | 'AssetRegistered' | 'AssetUpdated'; +} + +/** @name PalletForeingAssetsNativeCurrency */ +export interface PalletForeingAssetsNativeCurrency extends Enum { + readonly isHere: boolean; + readonly isParent: boolean; + readonly type: 'Here' | 'Parent'; +} + /** @name PalletFungibleError */ export interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; @@ -3362,6 +3679,15 @@ export interface XcmV2WeightLimit extends Enum { /** @name XcmV2Xcm */ export interface XcmV2Xcm extends Vec {} +/** @name XcmVersionedMultiAsset */ +export interface XcmVersionedMultiAsset extends Enum { + readonly isV0: boolean; + readonly asV0: XcmV0MultiAsset; + readonly isV1: boolean; + readonly asV1: XcmV1MultiAsset; + readonly type: 'V0' | 'V1'; +} + /** @name XcmVersionedMultiAssets */ export interface XcmVersionedMultiAssets extends Enum { readonly isV0: boolean; diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 303d76a552..318bb26e9f 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -323,118 +323,47 @@ export default { perPeriod: 'Compact' }, /** - * Lookup39: cumulus_pallet_xcmp_queue::pallet::Event + * Lookup39: orml_xtokens::module::Event **/ - CumulusPalletXcmpQueueEvent: { + OrmlXtokensModuleEvent: { _enum: { - Success: { - messageHash: 'Option', - weight: 'u64', - }, - Fail: { - messageHash: 'Option', - error: 'XcmV2TraitsError', - weight: 'u64', - }, - BadVersion: { - messageHash: 'Option', - }, - BadFormat: { - messageHash: 'Option', - }, - UpwardMessageSent: { - messageHash: 'Option', - }, - XcmpMessageSent: { - messageHash: 'Option', - }, - OverweightEnqueued: { - sender: 'u32', - sentAt: 'u32', - index: 'u64', - required: 'u64', - }, - OverweightServiced: { - index: 'u64', - used: 'u64' + TransferredMultiAssets: { + sender: 'AccountId32', + assets: 'XcmV1MultiassetMultiAssets', + fee: 'XcmV1MultiAsset', + dest: 'XcmV1MultiLocation' } } }, /** - * Lookup41: xcm::v2::traits::Error + * Lookup40: xcm::v1::multiasset::MultiAssets **/ - XcmV2TraitsError: { - _enum: { - Overflow: 'Null', - Unimplemented: 'Null', - UntrustedReserveLocation: 'Null', - UntrustedTeleportLocation: 'Null', - MultiLocationFull: 'Null', - MultiLocationNotInvertible: 'Null', - BadOrigin: 'Null', - InvalidLocation: 'Null', - AssetNotFound: 'Null', - FailedToTransactAsset: 'Null', - NotWithdrawable: 'Null', - LocationCannotHold: 'Null', - ExceedsMaxMessageSize: 'Null', - DestinationUnsupported: 'Null', - Transport: 'Null', - Unroutable: 'Null', - UnknownClaim: 'Null', - FailedToDecode: 'Null', - MaxWeightInvalid: 'Null', - NotHoldingFees: 'Null', - TooExpensive: 'Null', - Trap: 'u64', - UnhandledXcmVersion: 'Null', - WeightLimitReached: 'u64', - Barrier: 'Null', - WeightNotComputable: 'Null' - } - }, + XcmV1MultiassetMultiAssets: 'Vec', /** - * Lookup43: pallet_xcm::pallet::Event + * Lookup42: xcm::v1::multiasset::MultiAsset **/ - PalletXcmEvent: { - _enum: { - Attempted: 'XcmV2TraitsOutcome', - Sent: '(XcmV1MultiLocation,XcmV1MultiLocation,XcmV2Xcm)', - UnexpectedResponse: '(XcmV1MultiLocation,u64)', - ResponseReady: '(u64,XcmV2Response)', - Notified: '(u64,u8,u8)', - NotifyOverweight: '(u64,u8,u8,u64,u64)', - NotifyDispatchError: '(u64,u8,u8)', - NotifyDecodeFailed: '(u64,u8,u8)', - InvalidResponder: '(XcmV1MultiLocation,u64,Option)', - InvalidResponderVersion: '(XcmV1MultiLocation,u64)', - ResponseTaken: 'u64', - AssetsTrapped: '(H256,XcmV1MultiLocation,XcmVersionedMultiAssets)', - VersionChangeNotified: '(XcmV1MultiLocation,u32)', - SupportedVersionChanged: '(XcmV1MultiLocation,u32)', - NotifyTargetSendFail: '(XcmV1MultiLocation,u64,XcmV2TraitsError)', - NotifyTargetMigrationFail: '(XcmVersionedMultiLocation,u64)' - } + XcmV1MultiAsset: { + id: 'XcmV1MultiassetAssetId', + fun: 'XcmV1MultiassetFungibility' }, /** - * Lookup44: xcm::v2::traits::Outcome + * Lookup43: xcm::v1::multiasset::AssetId **/ - XcmV2TraitsOutcome: { + XcmV1MultiassetAssetId: { _enum: { - Complete: 'u64', - Incomplete: '(u64,XcmV2TraitsError)', - Error: 'XcmV2TraitsError' + Concrete: 'XcmV1MultiLocation', + Abstract: 'Bytes' } }, /** - * Lookup45: xcm::v1::multilocation::MultiLocation + * Lookup44: xcm::v1::multilocation::MultiLocation **/ XcmV1MultiLocation: { parents: 'u8', interior: 'XcmV1MultilocationJunctions' }, /** - * Lookup46: xcm::v1::multilocation::Junctions + * Lookup45: xcm::v1::multilocation::Junctions **/ XcmV1MultilocationJunctions: { _enum: { @@ -450,7 +379,7 @@ export default { } }, /** - * Lookup47: xcm::v1::junction::Junction + * Lookup46: xcm::v1::junction::Junction **/ XcmV1Junction: { _enum: { @@ -478,7 +407,7 @@ export default { } }, /** - * Lookup49: xcm::v0::junction::NetworkId + * Lookup48: xcm::v0::junction::NetworkId **/ XcmV0JunctionNetworkId: { _enum: { @@ -489,7 +418,7 @@ export default { } }, /** - * Lookup53: xcm::v0::junction::BodyId + * Lookup52: xcm::v0::junction::BodyId **/ XcmV0JunctionBodyId: { _enum: { @@ -503,7 +432,7 @@ export default { } }, /** - * Lookup54: xcm::v0::junction::BodyPart + * Lookup53: xcm::v0::junction::BodyPart **/ XcmV0JunctionBodyPart: { _enum: { @@ -526,11 +455,230 @@ export default { } }, /** - * Lookup55: xcm::v2::Xcm + * Lookup54: xcm::v1::multiasset::Fungibility + **/ + XcmV1MultiassetFungibility: { + _enum: { + Fungible: 'Compact', + NonFungible: 'XcmV1MultiassetAssetInstance' + } + }, + /** + * Lookup55: xcm::v1::multiasset::AssetInstance + **/ + XcmV1MultiassetAssetInstance: { + _enum: { + Undefined: 'Null', + Index: 'Compact', + Array4: '[u8;4]', + Array8: '[u8;8]', + Array16: '[u8;16]', + Array32: '[u8;32]', + Blob: 'Bytes' + } + }, + /** + * Lookup58: orml_tokens::module::Event + **/ + OrmlTokensModuleEvent: { + _enum: { + Endowed: { + currencyId: 'PalletForeingAssetsAssetIds', + who: 'AccountId32', + amount: 'u128', + }, + DustLost: { + currencyId: 'PalletForeingAssetsAssetIds', + who: 'AccountId32', + amount: 'u128', + }, + Transfer: { + currencyId: 'PalletForeingAssetsAssetIds', + from: 'AccountId32', + to: 'AccountId32', + amount: 'u128', + }, + Reserved: { + currencyId: 'PalletForeingAssetsAssetIds', + who: 'AccountId32', + amount: 'u128', + }, + Unreserved: { + currencyId: 'PalletForeingAssetsAssetIds', + who: 'AccountId32', + amount: 'u128', + }, + ReserveRepatriated: { + currencyId: 'PalletForeingAssetsAssetIds', + from: 'AccountId32', + to: 'AccountId32', + amount: 'u128', + status: 'FrameSupportTokensMiscBalanceStatus', + }, + BalanceSet: { + currencyId: 'PalletForeingAssetsAssetIds', + who: 'AccountId32', + free: 'u128', + reserved: 'u128', + }, + TotalIssuanceSet: { + currencyId: 'PalletForeingAssetsAssetIds', + amount: 'u128', + }, + Withdrawn: { + currencyId: 'PalletForeingAssetsAssetIds', + who: 'AccountId32', + amount: 'u128', + }, + Slashed: { + currencyId: 'PalletForeingAssetsAssetIds', + who: 'AccountId32', + freeAmount: 'u128', + reservedAmount: 'u128', + }, + Deposited: { + currencyId: 'PalletForeingAssetsAssetIds', + who: 'AccountId32', + amount: 'u128', + }, + LockSet: { + lockId: '[u8;8]', + currencyId: 'PalletForeingAssetsAssetIds', + who: 'AccountId32', + amount: 'u128', + }, + LockRemoved: { + lockId: '[u8;8]', + currencyId: 'PalletForeingAssetsAssetIds', + who: 'AccountId32' + } + } + }, + /** + * Lookup59: pallet_foreing_assets::AssetIds + **/ + PalletForeingAssetsAssetIds: { + _enum: { + ForeignAssetId: 'u32', + NativeAssetId: 'PalletForeingAssetsNativeCurrency' + } + }, + /** + * Lookup60: pallet_foreing_assets::NativeCurrency + **/ + PalletForeingAssetsNativeCurrency: { + _enum: ['Here', 'Parent'] + }, + /** + * Lookup61: cumulus_pallet_xcmp_queue::pallet::Event + **/ + CumulusPalletXcmpQueueEvent: { + _enum: { + Success: { + messageHash: 'Option', + weight: 'u64', + }, + Fail: { + messageHash: 'Option', + error: 'XcmV2TraitsError', + weight: 'u64', + }, + BadVersion: { + messageHash: 'Option', + }, + BadFormat: { + messageHash: 'Option', + }, + UpwardMessageSent: { + messageHash: 'Option', + }, + XcmpMessageSent: { + messageHash: 'Option', + }, + OverweightEnqueued: { + sender: 'u32', + sentAt: 'u32', + index: 'u64', + required: 'u64', + }, + OverweightServiced: { + index: 'u64', + used: 'u64' + } + } + }, + /** + * Lookup63: xcm::v2::traits::Error + **/ + XcmV2TraitsError: { + _enum: { + Overflow: 'Null', + Unimplemented: 'Null', + UntrustedReserveLocation: 'Null', + UntrustedTeleportLocation: 'Null', + MultiLocationFull: 'Null', + MultiLocationNotInvertible: 'Null', + BadOrigin: 'Null', + InvalidLocation: 'Null', + AssetNotFound: 'Null', + FailedToTransactAsset: 'Null', + NotWithdrawable: 'Null', + LocationCannotHold: 'Null', + ExceedsMaxMessageSize: 'Null', + DestinationUnsupported: 'Null', + Transport: 'Null', + Unroutable: 'Null', + UnknownClaim: 'Null', + FailedToDecode: 'Null', + MaxWeightInvalid: 'Null', + NotHoldingFees: 'Null', + TooExpensive: 'Null', + Trap: 'u64', + UnhandledXcmVersion: 'Null', + WeightLimitReached: 'u64', + Barrier: 'Null', + WeightNotComputable: 'Null' + } + }, + /** + * Lookup65: pallet_xcm::pallet::Event + **/ + PalletXcmEvent: { + _enum: { + Attempted: 'XcmV2TraitsOutcome', + Sent: '(XcmV1MultiLocation,XcmV1MultiLocation,XcmV2Xcm)', + UnexpectedResponse: '(XcmV1MultiLocation,u64)', + ResponseReady: '(u64,XcmV2Response)', + Notified: '(u64,u8,u8)', + NotifyOverweight: '(u64,u8,u8,u64,u64)', + NotifyDispatchError: '(u64,u8,u8)', + NotifyDecodeFailed: '(u64,u8,u8)', + InvalidResponder: '(XcmV1MultiLocation,u64,Option)', + InvalidResponderVersion: '(XcmV1MultiLocation,u64)', + ResponseTaken: 'u64', + AssetsTrapped: '(H256,XcmV1MultiLocation,XcmVersionedMultiAssets)', + VersionChangeNotified: '(XcmV1MultiLocation,u32)', + SupportedVersionChanged: '(XcmV1MultiLocation,u32)', + NotifyTargetSendFail: '(XcmV1MultiLocation,u64,XcmV2TraitsError)', + NotifyTargetMigrationFail: '(XcmVersionedMultiLocation,u64)' + } + }, + /** + * Lookup66: xcm::v2::traits::Outcome + **/ + XcmV2TraitsOutcome: { + _enum: { + Complete: 'u64', + Incomplete: '(u64,XcmV2TraitsError)', + Error: 'XcmV2TraitsError' + } + }, + /** + * Lookup67: xcm::v2::Xcm **/ XcmV2Xcm: 'Vec', /** - * Lookup57: xcm::v2::Instruction + * Lookup69: xcm::v2::Instruction **/ XcmV2Instruction: { _enum: { @@ -628,50 +776,7 @@ export default { } }, /** - * Lookup58: xcm::v1::multiasset::MultiAssets - **/ - XcmV1MultiassetMultiAssets: 'Vec', - /** - * Lookup60: xcm::v1::multiasset::MultiAsset - **/ - XcmV1MultiAsset: { - id: 'XcmV1MultiassetAssetId', - fun: 'XcmV1MultiassetFungibility' - }, - /** - * Lookup61: xcm::v1::multiasset::AssetId - **/ - XcmV1MultiassetAssetId: { - _enum: { - Concrete: 'XcmV1MultiLocation', - Abstract: 'Bytes' - } - }, - /** - * Lookup62: xcm::v1::multiasset::Fungibility - **/ - XcmV1MultiassetFungibility: { - _enum: { - Fungible: 'Compact', - NonFungible: 'XcmV1MultiassetAssetInstance' - } - }, - /** - * Lookup63: xcm::v1::multiasset::AssetInstance - **/ - XcmV1MultiassetAssetInstance: { - _enum: { - Undefined: 'Null', - Index: 'Compact', - Array4: '[u8;4]', - Array8: '[u8;8]', - Array16: '[u8;16]', - Array32: '[u8;32]', - Blob: 'Bytes' - } - }, - /** - * Lookup66: xcm::v2::Response + * Lookup70: xcm::v2::Response **/ XcmV2Response: { _enum: { @@ -682,19 +787,19 @@ export default { } }, /** - * Lookup69: xcm::v0::OriginKind + * Lookup73: xcm::v0::OriginKind **/ XcmV0OriginKind: { _enum: ['Native', 'SovereignAccount', 'Superuser', 'Xcm'] }, /** - * Lookup70: xcm::double_encoded::DoubleEncoded + * Lookup74: xcm::double_encoded::DoubleEncoded **/ XcmDoubleEncoded: { encoded: 'Bytes' }, /** - * Lookup71: xcm::v1::multiasset::MultiAssetFilter + * Lookup75: xcm::v1::multiasset::MultiAssetFilter **/ XcmV1MultiassetMultiAssetFilter: { _enum: { @@ -703,7 +808,7 @@ export default { } }, /** - * Lookup72: xcm::v1::multiasset::WildMultiAsset + * Lookup76: xcm::v1::multiasset::WildMultiAsset **/ XcmV1MultiassetWildMultiAsset: { _enum: { @@ -715,13 +820,13 @@ export default { } }, /** - * Lookup73: xcm::v1::multiasset::WildFungibility + * Lookup77: xcm::v1::multiasset::WildFungibility **/ XcmV1MultiassetWildFungibility: { _enum: ['Fungible', 'NonFungible'] }, /** - * Lookup74: xcm::v2::WeightLimit + * Lookup78: xcm::v2::WeightLimit **/ XcmV2WeightLimit: { _enum: { @@ -730,7 +835,7 @@ export default { } }, /** - * Lookup76: xcm::VersionedMultiAssets + * Lookup80: xcm::VersionedMultiAssets **/ XcmVersionedMultiAssets: { _enum: { @@ -739,7 +844,7 @@ export default { } }, /** - * Lookup78: xcm::v0::multi_asset::MultiAsset + * Lookup82: xcm::v0::multi_asset::MultiAsset **/ XcmV0MultiAsset: { _enum: { @@ -778,7 +883,7 @@ export default { } }, /** - * Lookup79: xcm::v0::multi_location::MultiLocation + * Lookup83: xcm::v0::multi_location::MultiLocation **/ XcmV0MultiLocation: { _enum: { @@ -794,7 +899,7 @@ export default { } }, /** - * Lookup80: xcm::v0::junction::Junction + * Lookup84: xcm::v0::junction::Junction **/ XcmV0Junction: { _enum: { @@ -823,7 +928,7 @@ export default { } }, /** - * Lookup81: xcm::VersionedMultiLocation + * Lookup85: xcm::VersionedMultiLocation **/ XcmVersionedMultiLocation: { _enum: { @@ -832,7 +937,7 @@ export default { } }, /** - * Lookup82: cumulus_pallet_xcm::pallet::Event + * Lookup86: cumulus_pallet_xcm::pallet::Event **/ CumulusPalletXcmEvent: { _enum: { @@ -842,7 +947,7 @@ export default { } }, /** - * Lookup83: cumulus_pallet_dmp_queue::pallet::Event + * Lookup87: cumulus_pallet_dmp_queue::pallet::Event **/ CumulusPalletDmpQueueEvent: { _enum: { @@ -873,7 +978,7 @@ export default { } }, /** - * Lookup84: pallet_unique::RawEvent> + * Lookup88: pallet_unique::RawEvent> **/ PalletUniqueRawEvent: { _enum: { @@ -890,7 +995,7 @@ export default { } }, /** - * Lookup85: pallet_evm::account::BasicCrossAccountIdRepr + * Lookup89: pallet_evm::account::BasicCrossAccountIdRepr **/ PalletEvmAccountBasicCrossAccountIdRepr: { _enum: { @@ -899,7 +1004,7 @@ export default { } }, /** - * Lookup88: pallet_unique_scheduler::pallet::Event + * Lookup92: pallet_unique_scheduler::pallet::Event **/ PalletUniqueSchedulerEvent: { _enum: { @@ -924,13 +1029,13 @@ export default { } }, /** - * Lookup91: frame_support::traits::schedule::LookupError + * Lookup95: frame_support::traits::schedule::LookupError **/ FrameSupportScheduleLookupError: { _enum: ['Unknown', 'BadFormat'] }, /** - * Lookup92: pallet_common::pallet::Event + * Lookup96: pallet_common::pallet::Event **/ PalletCommonEvent: { _enum: { @@ -948,7 +1053,7 @@ export default { } }, /** - * Lookup95: pallet_structure::pallet::Event + * Lookup99: pallet_structure::pallet::Event **/ PalletStructureEvent: { _enum: { @@ -956,7 +1061,7 @@ export default { } }, /** - * Lookup96: pallet_rmrk_core::pallet::Event + * Lookup100: pallet_rmrk_core::pallet::Event **/ PalletRmrkCoreEvent: { _enum: { @@ -1033,7 +1138,7 @@ export default { } }, /** - * Lookup97: rmrk_traits::nft::AccountIdOrCollectionNftTuple + * Lookup101: rmrk_traits::nft::AccountIdOrCollectionNftTuple **/ RmrkTraitsNftAccountIdOrCollectionNftTuple: { _enum: { @@ -1042,7 +1147,7 @@ export default { } }, /** - * Lookup102: pallet_rmrk_equip::pallet::Event + * Lookup106: pallet_rmrk_equip::pallet::Event **/ PalletRmrkEquipEvent: { _enum: { @@ -1057,7 +1162,41 @@ export default { } }, /** - * Lookup103: pallet_evm::pallet::Event + * Lookup107: pallet_foreing_assets::module::Event + **/ + PalletForeingAssetsModuleEvent: { + _enum: { + ForeignAssetRegistered: { + assetId: 'u32', + assetAddress: 'XcmV1MultiLocation', + metadata: 'PalletForeingAssetsModuleAssetMetadata', + }, + ForeignAssetUpdated: { + assetId: 'u32', + assetAddress: 'XcmV1MultiLocation', + metadata: 'PalletForeingAssetsModuleAssetMetadata', + }, + AssetRegistered: { + assetId: 'PalletForeingAssetsAssetIds', + metadata: 'PalletForeingAssetsModuleAssetMetadata', + }, + AssetUpdated: { + assetId: 'PalletForeingAssetsAssetIds', + metadata: 'PalletForeingAssetsModuleAssetMetadata' + } + } + }, + /** + * Lookup108: pallet_foreing_assets::module::AssetMetadata + **/ + PalletForeingAssetsModuleAssetMetadata: { + name: 'Bytes', + symbol: 'Bytes', + decimals: 'u8', + minimalBalance: 'u128' + }, + /** + * Lookup109: pallet_evm::pallet::Event **/ PalletEvmEvent: { _enum: { @@ -1071,7 +1210,7 @@ export default { } }, /** - * Lookup104: ethereum::log::Log + * Lookup110: ethereum::log::Log **/ EthereumLog: { address: 'H160', @@ -1079,7 +1218,7 @@ export default { data: 'Bytes' }, /** - * Lookup108: pallet_ethereum::pallet::Event + * Lookup114: pallet_ethereum::pallet::Event **/ PalletEthereumEvent: { _enum: { @@ -1087,7 +1226,7 @@ export default { } }, /** - * Lookup109: evm_core::error::ExitReason + * Lookup115: evm_core::error::ExitReason **/ EvmCoreErrorExitReason: { _enum: { @@ -1098,13 +1237,13 @@ export default { } }, /** - * Lookup110: evm_core::error::ExitSucceed + * Lookup116: evm_core::error::ExitSucceed **/ EvmCoreErrorExitSucceed: { _enum: ['Stopped', 'Returned', 'Suicided'] }, /** - * Lookup111: evm_core::error::ExitError + * Lookup117: evm_core::error::ExitError **/ EvmCoreErrorExitError: { _enum: { @@ -1126,13 +1265,13 @@ export default { } }, /** - * Lookup114: evm_core::error::ExitRevert + * Lookup120: evm_core::error::ExitRevert **/ EvmCoreErrorExitRevert: { _enum: ['Reverted'] }, /** - * Lookup115: evm_core::error::ExitFatal + * Lookup121: evm_core::error::ExitFatal **/ EvmCoreErrorExitFatal: { _enum: { @@ -1143,7 +1282,7 @@ export default { } }, /** - * Lookup116: frame_system::Phase + * Lookup122: frame_system::Phase **/ FrameSystemPhase: { _enum: { @@ -1153,14 +1292,14 @@ export default { } }, /** - * Lookup118: frame_system::LastRuntimeUpgradeInfo + * Lookup124: frame_system::LastRuntimeUpgradeInfo **/ FrameSystemLastRuntimeUpgradeInfo: { specVersion: 'Compact', specName: 'Text' }, /** - * Lookup119: frame_system::pallet::Call + * Lookup125: frame_system::pallet::Call **/ FrameSystemCall: { _enum: { @@ -1198,7 +1337,7 @@ export default { } }, /** - * Lookup124: frame_system::limits::BlockWeights + * Lookup130: frame_system::limits::BlockWeights **/ FrameSystemLimitsBlockWeights: { baseBlock: 'u64', @@ -1206,7 +1345,7 @@ export default { perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass' }, /** - * Lookup125: frame_support::weights::PerDispatchClass + * Lookup131: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassWeightsPerClass: { normal: 'FrameSystemLimitsWeightsPerClass', @@ -1214,7 +1353,7 @@ export default { mandatory: 'FrameSystemLimitsWeightsPerClass' }, /** - * Lookup126: frame_system::limits::WeightsPerClass + * Lookup132: frame_system::limits::WeightsPerClass **/ FrameSystemLimitsWeightsPerClass: { baseExtrinsic: 'u64', @@ -1223,13 +1362,13 @@ export default { reserved: 'Option' }, /** - * Lookup128: frame_system::limits::BlockLength + * Lookup134: frame_system::limits::BlockLength **/ FrameSystemLimitsBlockLength: { max: 'FrameSupportWeightsPerDispatchClassU32' }, /** - * Lookup129: frame_support::weights::PerDispatchClass + * Lookup135: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassU32: { normal: 'u32', @@ -1237,14 +1376,14 @@ export default { mandatory: 'u32' }, /** - * Lookup130: frame_support::weights::RuntimeDbWeight + * Lookup136: frame_support::weights::RuntimeDbWeight **/ FrameSupportWeightsRuntimeDbWeight: { read: 'u64', write: 'u64' }, /** - * Lookup131: sp_version::RuntimeVersion + * Lookup137: sp_version::RuntimeVersion **/ SpVersionRuntimeVersion: { specName: 'Text', @@ -1257,13 +1396,13 @@ export default { stateVersion: 'u8' }, /** - * Lookup136: frame_system::pallet::Error + * Lookup142: frame_system::pallet::Error **/ FrameSystemError: { _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] }, /** - * Lookup137: polkadot_primitives::v2::PersistedValidationData + * Lookup143: polkadot_primitives::v2::PersistedValidationData **/ PolkadotPrimitivesV2PersistedValidationData: { parentHead: 'Bytes', @@ -1272,19 +1411,19 @@ export default { maxPovSize: 'u32' }, /** - * Lookup140: polkadot_primitives::v2::UpgradeRestriction + * Lookup146: polkadot_primitives::v2::UpgradeRestriction **/ PolkadotPrimitivesV2UpgradeRestriction: { _enum: ['Present'] }, /** - * Lookup141: sp_trie::storage_proof::StorageProof + * Lookup147: sp_trie::storage_proof::StorageProof **/ SpTrieStorageProof: { trieNodes: 'BTreeSet' }, /** - * Lookup143: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot + * Lookup149: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot **/ CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: { dmqMqcHead: 'H256', @@ -1293,7 +1432,7 @@ export default { egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>' }, /** - * Lookup146: polkadot_primitives::v2::AbridgedHrmpChannel + * Lookup152: polkadot_primitives::v2::AbridgedHrmpChannel **/ PolkadotPrimitivesV2AbridgedHrmpChannel: { maxCapacity: 'u32', @@ -1304,7 +1443,7 @@ export default { mqcHead: 'Option' }, /** - * Lookup147: polkadot_primitives::v2::AbridgedHostConfiguration + * Lookup153: polkadot_primitives::v2::AbridgedHostConfiguration **/ PolkadotPrimitivesV2AbridgedHostConfiguration: { maxCodeSize: 'u32', @@ -1318,14 +1457,14 @@ export default { validationUpgradeDelay: 'u32' }, /** - * Lookup153: polkadot_core_primitives::OutboundHrmpMessage + * Lookup159: polkadot_core_primitives::OutboundHrmpMessage **/ PolkadotCorePrimitivesOutboundHrmpMessage: { recipient: 'u32', data: 'Bytes' }, /** - * Lookup154: cumulus_pallet_parachain_system::pallet::Call + * Lookup160: cumulus_pallet_parachain_system::pallet::Call **/ CumulusPalletParachainSystemCall: { _enum: { @@ -1344,7 +1483,7 @@ export default { } }, /** - * Lookup155: cumulus_primitives_parachain_inherent::ParachainInherentData + * Lookup161: cumulus_primitives_parachain_inherent::ParachainInherentData **/ CumulusPrimitivesParachainInherentParachainInherentData: { validationData: 'PolkadotPrimitivesV2PersistedValidationData', @@ -1353,27 +1492,27 @@ export default { horizontalMessages: 'BTreeMap>' }, /** - * Lookup157: polkadot_core_primitives::InboundDownwardMessage + * Lookup163: polkadot_core_primitives::InboundDownwardMessage **/ PolkadotCorePrimitivesInboundDownwardMessage: { sentAt: 'u32', msg: 'Bytes' }, /** - * Lookup160: polkadot_core_primitives::InboundHrmpMessage + * Lookup166: polkadot_core_primitives::InboundHrmpMessage **/ PolkadotCorePrimitivesInboundHrmpMessage: { sentAt: 'u32', data: 'Bytes' }, /** - * Lookup163: cumulus_pallet_parachain_system::pallet::Error + * Lookup169: cumulus_pallet_parachain_system::pallet::Error **/ CumulusPalletParachainSystemError: { _enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized'] }, /** - * Lookup165: pallet_balances::BalanceLock + * Lookup171: pallet_balances::BalanceLock **/ PalletBalancesBalanceLock: { id: '[u8;8]', @@ -1381,26 +1520,26 @@ export default { reasons: 'PalletBalancesReasons' }, /** - * Lookup166: pallet_balances::Reasons + * Lookup172: pallet_balances::Reasons **/ PalletBalancesReasons: { _enum: ['Fee', 'Misc', 'All'] }, /** - * Lookup169: pallet_balances::ReserveData + * Lookup175: pallet_balances::ReserveData **/ PalletBalancesReserveData: { id: '[u8;16]', amount: 'u128' }, /** - * Lookup171: pallet_balances::Releases + * Lookup177: pallet_balances::Releases **/ PalletBalancesReleases: { _enum: ['V1_0_0', 'V2_0_0'] }, /** - * Lookup172: pallet_balances::pallet::Call + * Lookup178: pallet_balances::pallet::Call **/ PalletBalancesCall: { _enum: { @@ -1433,13 +1572,13 @@ export default { } }, /** - * Lookup175: pallet_balances::pallet::Error + * Lookup181: pallet_balances::pallet::Error **/ PalletBalancesError: { _enum: ['VestingBalance', 'LiquidityRestrictions', 'InsufficientBalance', 'ExistentialDeposit', 'KeepAlive', 'ExistingVestingSchedule', 'DeadAccount', 'TooManyReserves'] }, /** - * Lookup177: pallet_timestamp::pallet::Call + * Lookup183: pallet_timestamp::pallet::Call **/ PalletTimestampCall: { _enum: { @@ -1449,13 +1588,13 @@ export default { } }, /** - * Lookup179: pallet_transaction_payment::Releases + * Lookup185: pallet_transaction_payment::Releases **/ PalletTransactionPaymentReleases: { _enum: ['V1Ancient', 'V2'] }, /** - * Lookup180: pallet_treasury::Proposal + * Lookup186: pallet_treasury::Proposal **/ PalletTreasuryProposal: { proposer: 'AccountId32', @@ -1464,7 +1603,7 @@ export default { bond: 'u128' }, /** - * Lookup183: pallet_treasury::pallet::Call + * Lookup189: pallet_treasury::pallet::Call **/ PalletTreasuryCall: { _enum: { @@ -1488,17 +1627,17 @@ export default { } }, /** - * Lookup186: frame_support::PalletId + * Lookup192: frame_support::PalletId **/ FrameSupportPalletId: '[u8;8]', /** - * Lookup187: pallet_treasury::pallet::Error + * Lookup193: pallet_treasury::pallet::Error **/ PalletTreasuryError: { _enum: ['InsufficientProposersBalance', 'InvalidIndex', 'TooManyApprovals', 'InsufficientPermission', 'ProposalNotApproved'] }, /** - * Lookup188: pallet_sudo::pallet::Call + * Lookup194: pallet_sudo::pallet::Call **/ PalletSudoCall: { _enum: { @@ -1522,7 +1661,7 @@ export default { } }, /** - * Lookup190: orml_vesting::module::Call + * Lookup196: orml_vesting::module::Call **/ OrmlVestingModuleCall: { _enum: { @@ -1541,7 +1680,93 @@ export default { } }, /** - * Lookup192: cumulus_pallet_xcmp_queue::pallet::Call + * Lookup198: orml_xtokens::module::Call + **/ + OrmlXtokensModuleCall: { + _enum: { + transfer: { + currencyId: 'PalletForeingAssetsAssetIds', + amount: 'u128', + dest: 'XcmVersionedMultiLocation', + destWeight: 'u64', + }, + transfer_multiasset: { + asset: 'XcmVersionedMultiAsset', + dest: 'XcmVersionedMultiLocation', + destWeight: 'u64', + }, + transfer_with_fee: { + currencyId: 'PalletForeingAssetsAssetIds', + amount: 'u128', + fee: 'u128', + dest: 'XcmVersionedMultiLocation', + destWeight: 'u64', + }, + transfer_multiasset_with_fee: { + asset: 'XcmVersionedMultiAsset', + fee: 'XcmVersionedMultiAsset', + dest: 'XcmVersionedMultiLocation', + destWeight: 'u64', + }, + transfer_multicurrencies: { + currencies: 'Vec<(PalletForeingAssetsAssetIds,u128)>', + feeItem: 'u32', + dest: 'XcmVersionedMultiLocation', + destWeight: 'u64', + }, + transfer_multiassets: { + assets: 'XcmVersionedMultiAssets', + feeItem: 'u32', + dest: 'XcmVersionedMultiLocation', + destWeight: 'u64' + } + } + }, + /** + * Lookup199: xcm::VersionedMultiAsset + **/ + XcmVersionedMultiAsset: { + _enum: { + V0: 'XcmV0MultiAsset', + V1: 'XcmV1MultiAsset' + } + }, + /** + * Lookup202: orml_tokens::module::Call + **/ + OrmlTokensModuleCall: { + _enum: { + transfer: { + dest: 'MultiAddress', + currencyId: 'PalletForeingAssetsAssetIds', + amount: 'Compact', + }, + transfer_all: { + dest: 'MultiAddress', + currencyId: 'PalletForeingAssetsAssetIds', + keepAlive: 'bool', + }, + transfer_keep_alive: { + dest: 'MultiAddress', + currencyId: 'PalletForeingAssetsAssetIds', + amount: 'Compact', + }, + force_transfer: { + source: 'MultiAddress', + dest: 'MultiAddress', + currencyId: 'PalletForeingAssetsAssetIds', + amount: 'Compact', + }, + set_balance: { + who: 'MultiAddress', + currencyId: 'PalletForeingAssetsAssetIds', + newFree: 'Compact', + newReserved: 'Compact' + } + } + }, + /** + * Lookup203: cumulus_pallet_xcmp_queue::pallet::Call **/ CumulusPalletXcmpQueueCall: { _enum: { @@ -1590,7 +1815,7 @@ export default { } }, /** - * Lookup193: pallet_xcm::pallet::Call + * Lookup204: pallet_xcm::pallet::Call **/ PalletXcmCall: { _enum: { @@ -1644,7 +1869,7 @@ export default { } }, /** - * Lookup194: xcm::VersionedXcm + * Lookup205: xcm::VersionedXcm **/ XcmVersionedXcm: { _enum: { @@ -1654,7 +1879,7 @@ export default { } }, /** - * Lookup195: xcm::v0::Xcm + * Lookup206: xcm::v0::Xcm **/ XcmV0Xcm: { _enum: { @@ -1708,7 +1933,7 @@ export default { } }, /** - * Lookup197: xcm::v0::order::Order + * Lookup208: xcm::v0::order::Order **/ XcmV0Order: { _enum: { @@ -1751,7 +1976,7 @@ export default { } }, /** - * Lookup199: xcm::v0::Response + * Lookup210: xcm::v0::Response **/ XcmV0Response: { _enum: { @@ -1759,7 +1984,7 @@ export default { } }, /** - * Lookup200: xcm::v1::Xcm + * Lookup211: xcm::v1::Xcm **/ XcmV1Xcm: { _enum: { @@ -1818,7 +2043,7 @@ export default { } }, /** - * Lookup202: xcm::v1::order::Order + * Lookup213: xcm::v1::order::Order **/ XcmV1Order: { _enum: { @@ -1863,7 +2088,7 @@ export default { } }, /** - * Lookup204: xcm::v1::Response + * Lookup215: xcm::v1::Response **/ XcmV1Response: { _enum: { @@ -1872,11 +2097,11 @@ export default { } }, /** - * Lookup218: cumulus_pallet_xcm::pallet::Call + * Lookup229: cumulus_pallet_xcm::pallet::Call **/ CumulusPalletXcmCall: 'Null', /** - * Lookup219: cumulus_pallet_dmp_queue::pallet::Call + * Lookup230: cumulus_pallet_dmp_queue::pallet::Call **/ CumulusPalletDmpQueueCall: { _enum: { @@ -1887,7 +2112,7 @@ export default { } }, /** - * Lookup220: pallet_inflation::pallet::Call + * Lookup231: pallet_inflation::pallet::Call **/ PalletInflationCall: { _enum: { @@ -1897,7 +2122,7 @@ export default { } }, /** - * Lookup221: pallet_unique::Call + * Lookup232: pallet_unique::Call **/ PalletUniqueCall: { _enum: { @@ -2029,7 +2254,7 @@ export default { } }, /** - * Lookup226: up_data_structs::CollectionMode + * Lookup237: up_data_structs::CollectionMode **/ UpDataStructsCollectionMode: { _enum: { @@ -2039,7 +2264,7 @@ export default { } }, /** - * Lookup227: up_data_structs::CreateCollectionData + * Lookup238: up_data_structs::CreateCollectionData **/ UpDataStructsCreateCollectionData: { mode: 'UpDataStructsCollectionMode', @@ -2054,13 +2279,13 @@ export default { properties: 'Vec' }, /** - * Lookup229: up_data_structs::AccessMode + * Lookup240: up_data_structs::AccessMode **/ UpDataStructsAccessMode: { _enum: ['Normal', 'AllowList'] }, /** - * Lookup231: up_data_structs::CollectionLimits + * Lookup242: up_data_structs::CollectionLimits **/ UpDataStructsCollectionLimits: { accountTokenOwnershipLimit: 'Option', @@ -2074,7 +2299,7 @@ export default { transfersEnabled: 'Option' }, /** - * Lookup233: up_data_structs::SponsoringRateLimit + * Lookup244: up_data_structs::SponsoringRateLimit **/ UpDataStructsSponsoringRateLimit: { _enum: { @@ -2083,7 +2308,7 @@ export default { } }, /** - * Lookup236: up_data_structs::CollectionPermissions + * Lookup247: up_data_structs::CollectionPermissions **/ UpDataStructsCollectionPermissions: { access: 'Option', @@ -2091,7 +2316,7 @@ export default { nesting: 'Option' }, /** - * Lookup238: up_data_structs::NestingPermissions + * Lookup249: up_data_structs::NestingPermissions **/ UpDataStructsNestingPermissions: { tokenOwner: 'bool', @@ -2099,18 +2324,18 @@ export default { restricted: 'Option' }, /** - * Lookup240: up_data_structs::OwnerRestrictedSet + * Lookup251: up_data_structs::OwnerRestrictedSet **/ UpDataStructsOwnerRestrictedSet: 'BTreeSet', /** - * Lookup245: up_data_structs::PropertyKeyPermission + * Lookup256: up_data_structs::PropertyKeyPermission **/ UpDataStructsPropertyKeyPermission: { key: 'Bytes', permission: 'UpDataStructsPropertyPermission' }, /** - * Lookup246: up_data_structs::PropertyPermission + * Lookup257: up_data_structs::PropertyPermission **/ UpDataStructsPropertyPermission: { mutable: 'bool', @@ -2118,14 +2343,14 @@ export default { tokenOwner: 'bool' }, /** - * Lookup249: up_data_structs::Property + * Lookup260: up_data_structs::Property **/ UpDataStructsProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup252: up_data_structs::CreateItemData + * Lookup263: up_data_structs::CreateItemData **/ UpDataStructsCreateItemData: { _enum: { @@ -2135,26 +2360,26 @@ export default { } }, /** - * Lookup253: up_data_structs::CreateNftData + * Lookup264: up_data_structs::CreateNftData **/ UpDataStructsCreateNftData: { properties: 'Vec' }, /** - * Lookup254: up_data_structs::CreateFungibleData + * Lookup265: up_data_structs::CreateFungibleData **/ UpDataStructsCreateFungibleData: { value: 'u128' }, /** - * Lookup255: up_data_structs::CreateReFungibleData + * Lookup266: up_data_structs::CreateReFungibleData **/ UpDataStructsCreateReFungibleData: { pieces: 'u128', properties: 'Vec' }, /** - * Lookup258: up_data_structs::CreateItemExData> + * Lookup269: up_data_structs::CreateItemExData> **/ UpDataStructsCreateItemExData: { _enum: { @@ -2165,14 +2390,14 @@ export default { } }, /** - * Lookup260: up_data_structs::CreateNftExData> + * Lookup271: up_data_structs::CreateNftExData> **/ UpDataStructsCreateNftExData: { properties: 'Vec', owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup267: up_data_structs::CreateRefungibleExSingleOwner> + * Lookup278: up_data_structs::CreateRefungibleExSingleOwner> **/ UpDataStructsCreateRefungibleExSingleOwner: { user: 'PalletEvmAccountBasicCrossAccountIdRepr', @@ -2180,14 +2405,14 @@ export default { properties: 'Vec' }, /** - * Lookup269: up_data_structs::CreateRefungibleExMultipleOwners> + * Lookup280: up_data_structs::CreateRefungibleExMultipleOwners> **/ UpDataStructsCreateRefungibleExMultipleOwners: { users: 'BTreeMap', properties: 'Vec' }, /** - * Lookup270: pallet_unique_scheduler::pallet::Call + * Lookup281: pallet_unique_scheduler::pallet::Call **/ PalletUniqueSchedulerCall: { _enum: { @@ -2211,7 +2436,7 @@ export default { } }, /** - * Lookup272: frame_support::traits::schedule::MaybeHashed + * Lookup283: frame_support::traits::schedule::MaybeHashed **/ FrameSupportScheduleMaybeHashed: { _enum: { @@ -2220,7 +2445,7 @@ export default { } }, /** - * Lookup273: pallet_configuration::pallet::Call + * Lookup284: pallet_configuration::pallet::Call **/ PalletConfigurationCall: { _enum: { @@ -2233,15 +2458,15 @@ export default { } }, /** - * Lookup274: pallet_template_transaction_payment::Call + * Lookup285: pallet_template_transaction_payment::Call **/ PalletTemplateTransactionPaymentCall: 'Null', /** - * Lookup275: pallet_structure::pallet::Call + * Lookup286: pallet_structure::pallet::Call **/ PalletStructureCall: 'Null', /** - * Lookup276: pallet_rmrk_core::pallet::Call + * Lookup287: pallet_rmrk_core::pallet::Call **/ PalletRmrkCoreCall: { _enum: { @@ -2332,7 +2557,7 @@ export default { } }, /** - * Lookup282: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup293: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceTypes: { _enum: { @@ -2342,7 +2567,7 @@ export default { } }, /** - * Lookup284: rmrk_traits::resource::BasicResource> + * Lookup295: rmrk_traits::resource::BasicResource> **/ RmrkTraitsResourceBasicResource: { src: 'Option', @@ -2351,7 +2576,7 @@ export default { thumb: 'Option' }, /** - * Lookup286: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup297: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceComposableResource: { parts: 'Vec', @@ -2362,7 +2587,7 @@ export default { thumb: 'Option' }, /** - * Lookup287: rmrk_traits::resource::SlotResource> + * Lookup298: rmrk_traits::resource::SlotResource> **/ RmrkTraitsResourceSlotResource: { base: 'u32', @@ -2373,7 +2598,7 @@ export default { thumb: 'Option' }, /** - * Lookup290: pallet_rmrk_equip::pallet::Call + * Lookup301: pallet_rmrk_equip::pallet::Call **/ PalletRmrkEquipCall: { _enum: { @@ -2394,7 +2619,7 @@ export default { } }, /** - * Lookup293: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup304: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPartPartType: { _enum: { @@ -2403,7 +2628,7 @@ export default { } }, /** - * Lookup295: rmrk_traits::part::FixedPart> + * Lookup306: rmrk_traits::part::FixedPart> **/ RmrkTraitsPartFixedPart: { id: 'u32', @@ -2411,7 +2636,7 @@ export default { src: 'Bytes' }, /** - * Lookup296: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup307: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPartSlotPart: { id: 'u32', @@ -2420,7 +2645,7 @@ export default { z: 'u32' }, /** - * Lookup297: rmrk_traits::part::EquippableList> + * Lookup308: rmrk_traits::part::EquippableList> **/ RmrkTraitsPartEquippableList: { _enum: { @@ -2430,7 +2655,7 @@ export default { } }, /** - * Lookup299: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> + * Lookup310: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> **/ RmrkTraitsTheme: { name: 'Bytes', @@ -2438,14 +2663,31 @@ export default { inherit: 'bool' }, /** - * Lookup301: rmrk_traits::theme::ThemeProperty> + * Lookup312: rmrk_traits::theme::ThemeProperty> **/ RmrkTraitsThemeThemeProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup303: pallet_evm::pallet::Call + * Lookup314: pallet_foreing_assets::module::Call + **/ + PalletForeingAssetsModuleCall: { + _enum: { + register_foreign_asset: { + owner: 'AccountId32', + location: 'XcmVersionedMultiLocation', + metadata: 'PalletForeingAssetsModuleAssetMetadata', + }, + update_foreign_asset: { + foreignAssetId: 'u32', + location: 'XcmVersionedMultiLocation', + metadata: 'PalletForeingAssetsModuleAssetMetadata' + } + } + }, + /** + * Lookup315: pallet_evm::pallet::Call **/ PalletEvmCall: { _enum: { @@ -2488,7 +2730,7 @@ export default { } }, /** - * Lookup307: pallet_ethereum::pallet::Call + * Lookup319: pallet_ethereum::pallet::Call **/ PalletEthereumCall: { _enum: { @@ -2498,7 +2740,7 @@ export default { } }, /** - * Lookup308: ethereum::transaction::TransactionV2 + * Lookup320: ethereum::transaction::TransactionV2 **/ EthereumTransactionTransactionV2: { _enum: { @@ -2508,7 +2750,7 @@ export default { } }, /** - * Lookup309: ethereum::transaction::LegacyTransaction + * Lookup321: ethereum::transaction::LegacyTransaction **/ EthereumTransactionLegacyTransaction: { nonce: 'U256', @@ -2520,7 +2762,7 @@ export default { signature: 'EthereumTransactionTransactionSignature' }, /** - * Lookup310: ethereum::transaction::TransactionAction + * Lookup322: ethereum::transaction::TransactionAction **/ EthereumTransactionTransactionAction: { _enum: { @@ -2529,7 +2771,7 @@ export default { } }, /** - * Lookup311: ethereum::transaction::TransactionSignature + * Lookup323: ethereum::transaction::TransactionSignature **/ EthereumTransactionTransactionSignature: { v: 'u64', @@ -2537,7 +2779,7 @@ export default { s: 'H256' }, /** - * Lookup313: ethereum::transaction::EIP2930Transaction + * Lookup325: ethereum::transaction::EIP2930Transaction **/ EthereumTransactionEip2930Transaction: { chainId: 'u64', @@ -2553,14 +2795,14 @@ export default { s: 'H256' }, /** - * Lookup315: ethereum::transaction::AccessListItem + * Lookup327: ethereum::transaction::AccessListItem **/ EthereumTransactionAccessListItem: { address: 'H160', storageKeys: 'Vec' }, /** - * Lookup316: ethereum::transaction::EIP1559Transaction + * Lookup328: ethereum::transaction::EIP1559Transaction **/ EthereumTransactionEip1559Transaction: { chainId: 'u64', @@ -2577,7 +2819,7 @@ export default { s: 'H256' }, /** - * Lookup317: pallet_evm_migration::pallet::Call + * Lookup329: pallet_evm_migration::pallet::Call **/ PalletEvmMigrationCall: { _enum: { @@ -2595,19 +2837,53 @@ export default { } }, /** - * Lookup320: pallet_sudo::pallet::Error + * Lookup332: pallet_sudo::pallet::Error **/ PalletSudoError: { _enum: ['RequireSudo'] }, /** - * Lookup322: orml_vesting::module::Error + * Lookup334: orml_vesting::module::Error **/ OrmlVestingModuleError: { _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded'] }, /** - * Lookup324: cumulus_pallet_xcmp_queue::InboundChannelDetails + * Lookup335: orml_xtokens::module::Error + **/ + OrmlXtokensModuleError: { + _enum: ['AssetHasNoReserve', 'NotCrossChainTransfer', 'InvalidDest', 'NotCrossChainTransferableCurrency', 'UnweighableMessage', 'XcmExecutionFailed', 'CannotReanchor', 'InvalidAncestry', 'InvalidAsset', 'DestinationNotInvertible', 'BadVersion', 'DistinctReserveForAssetAndFee', 'ZeroFee', 'ZeroAmount', 'TooManyAssetsBeingSent', 'AssetIndexNonExistent', 'FeeNotEnough', 'NotSupportedMultiLocation', 'MinXcmFeeNotDefined'] + }, + /** + * Lookup338: orml_tokens::BalanceLock + **/ + OrmlTokensBalanceLock: { + id: '[u8;8]', + amount: 'u128' + }, + /** + * Lookup340: orml_tokens::AccountData + **/ + OrmlTokensAccountData: { + free: 'u128', + reserved: 'u128', + frozen: 'u128' + }, + /** + * Lookup342: orml_tokens::ReserveData + **/ + OrmlTokensReserveData: { + id: 'Null', + amount: 'u128' + }, + /** + * Lookup344: orml_tokens::module::Error + **/ + OrmlTokensModuleError: { + _enum: ['BalanceTooLow', 'AmountIntoBalanceFailed', 'LiquidityRestrictions', 'MaxLocksExceeded', 'KeepAlive', 'ExistentialDeposit', 'DeadAccount', 'TooManyReserves'] + }, + /** + * Lookup346: cumulus_pallet_xcmp_queue::InboundChannelDetails **/ CumulusPalletXcmpQueueInboundChannelDetails: { sender: 'u32', @@ -2615,19 +2891,19 @@ export default { messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>' }, /** - * Lookup325: cumulus_pallet_xcmp_queue::InboundState + * Lookup347: cumulus_pallet_xcmp_queue::InboundState **/ CumulusPalletXcmpQueueInboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup328: polkadot_parachain::primitives::XcmpMessageFormat + * Lookup350: polkadot_parachain::primitives::XcmpMessageFormat **/ PolkadotParachainPrimitivesXcmpMessageFormat: { _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals'] }, /** - * Lookup331: cumulus_pallet_xcmp_queue::OutboundChannelDetails + * Lookup353: cumulus_pallet_xcmp_queue::OutboundChannelDetails **/ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: 'u32', @@ -2637,13 +2913,13 @@ export default { lastIndex: 'u16' }, /** - * Lookup332: cumulus_pallet_xcmp_queue::OutboundState + * Lookup354: cumulus_pallet_xcmp_queue::OutboundState **/ CumulusPalletXcmpQueueOutboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup334: cumulus_pallet_xcmp_queue::QueueConfigData + * Lookup356: cumulus_pallet_xcmp_queue::QueueConfigData **/ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: 'u32', @@ -2654,29 +2930,29 @@ export default { xcmpMaxIndividualWeight: 'u64' }, /** - * Lookup336: cumulus_pallet_xcmp_queue::pallet::Error + * Lookup358: cumulus_pallet_xcmp_queue::pallet::Error **/ CumulusPalletXcmpQueueError: { _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit'] }, /** - * Lookup337: pallet_xcm::pallet::Error + * Lookup359: pallet_xcm::pallet::Error **/ PalletXcmError: { _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed'] }, /** - * Lookup338: cumulus_pallet_xcm::pallet::Error + * Lookup360: cumulus_pallet_xcm::pallet::Error **/ CumulusPalletXcmError: 'Null', /** - * Lookup339: cumulus_pallet_dmp_queue::ConfigData + * Lookup361: cumulus_pallet_dmp_queue::ConfigData **/ CumulusPalletDmpQueueConfigData: { maxIndividual: 'u64' }, /** - * Lookup340: cumulus_pallet_dmp_queue::PageIndexData + * Lookup362: cumulus_pallet_dmp_queue::PageIndexData **/ CumulusPalletDmpQueuePageIndexData: { beginUsed: 'u32', @@ -2684,19 +2960,19 @@ export default { overweightCount: 'u64' }, /** - * Lookup343: cumulus_pallet_dmp_queue::pallet::Error + * Lookup365: cumulus_pallet_dmp_queue::pallet::Error **/ CumulusPalletDmpQueueError: { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup347: pallet_unique::Error + * Lookup369: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup350: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> + * Lookup372: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> **/ PalletUniqueSchedulerScheduledV3: { maybeId: 'Option<[u8;16]>', @@ -2706,7 +2982,7 @@ export default { origin: 'OpalRuntimeOriginCaller' }, /** - * Lookup351: opal_runtime::OriginCaller + * Lookup373: opal_runtime::OriginCaller **/ OpalRuntimeOriginCaller: { _enum: { @@ -2815,7 +3091,7 @@ export default { } }, /** - * Lookup352: frame_support::dispatch::RawOrigin + * Lookup374: frame_support::dispatch::RawOrigin **/ FrameSupportDispatchRawOrigin: { _enum: { @@ -2825,7 +3101,7 @@ export default { } }, /** - * Lookup353: pallet_xcm::pallet::Origin + * Lookup375: pallet_xcm::pallet::Origin **/ PalletXcmOrigin: { _enum: { @@ -2834,7 +3110,7 @@ export default { } }, /** - * Lookup354: cumulus_pallet_xcm::pallet::Origin + * Lookup376: cumulus_pallet_xcm::pallet::Origin **/ CumulusPalletXcmOrigin: { _enum: { @@ -2843,7 +3119,7 @@ export default { } }, /** - * Lookup355: pallet_ethereum::RawOrigin + * Lookup377: pallet_ethereum::RawOrigin **/ PalletEthereumRawOrigin: { _enum: { @@ -2851,17 +3127,17 @@ export default { } }, /** - * Lookup356: sp_core::Void + * Lookup378: sp_core::Void **/ SpCoreVoid: 'Null', /** - * Lookup357: pallet_unique_scheduler::pallet::Error + * Lookup379: pallet_unique_scheduler::pallet::Error **/ PalletUniqueSchedulerError: { _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] }, /** - * Lookup358: up_data_structs::Collection + * Lookup380: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -2875,7 +3151,7 @@ export default { externalCollection: 'bool' }, /** - * Lookup359: up_data_structs::SponsorshipState + * Lookup381: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipState: { _enum: { @@ -2885,7 +3161,7 @@ export default { } }, /** - * Lookup360: up_data_structs::Properties + * Lookup382: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -2893,15 +3169,15 @@ export default { spaceLimit: 'u32' }, /** - * Lookup361: up_data_structs::PropertiesMap> + * Lookup383: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** - * Lookup366: up_data_structs::PropertiesMap + * Lookup388: up_data_structs::PropertiesMap **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup373: up_data_structs::CollectionStats + * Lookup395: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -2909,18 +3185,18 @@ export default { alive: 'u32' }, /** - * Lookup374: up_data_structs::TokenChild + * Lookup396: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup375: PhantomType::up_data_structs + * Lookup397: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup377: up_data_structs::TokenData> + * Lookup399: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -2928,7 +3204,7 @@ export default { pieces: 'u128' }, /** - * Lookup379: up_data_structs::RpcCollection + * Lookup401: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -2944,7 +3220,7 @@ export default { readOnly: 'bool' }, /** - * Lookup380: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup402: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -2954,7 +3230,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup381: rmrk_traits::nft::NftInfo> + * Lookup403: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -2964,14 +3240,14 @@ export default { pending: 'bool' }, /** - * Lookup383: rmrk_traits::nft::RoyaltyInfo + * Lookup405: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup384: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup406: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -2980,14 +3256,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup385: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup407: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup386: rmrk_traits::base::BaseInfo> + * Lookup408: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -2995,80 +3271,86 @@ export default { symbol: 'Bytes' }, /** - * Lookup387: rmrk_traits::nft::NftChild + * Lookup409: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup389: pallet_common::pallet::Error + * Lookup411: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup391: pallet_fungible::pallet::Error + * Lookup413: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup392: pallet_refungible::ItemData + * Lookup414: pallet_refungible::ItemData **/ PalletRefungibleItemData: { constData: 'Bytes' }, /** - * Lookup397: pallet_refungible::pallet::Error + * Lookup419: pallet_refungible::pallet::Error **/ PalletRefungibleError: { _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup398: pallet_nonfungible::ItemData> + * Lookup420: pallet_nonfungible::ItemData> **/ PalletNonfungibleItemData: { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup400: up_data_structs::PropertyScope + * Lookup422: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { _enum: ['None', 'Rmrk', 'Eth'] }, /** - * Lookup402: pallet_nonfungible::pallet::Error + * Lookup424: pallet_nonfungible::pallet::Error **/ PalletNonfungibleError: { _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup403: pallet_structure::pallet::Error + * Lookup425: pallet_structure::pallet::Error **/ PalletStructureError: { _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup404: pallet_rmrk_core::pallet::Error + * Lookup426: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** - * Lookup406: pallet_rmrk_equip::pallet::Error + * Lookup428: pallet_rmrk_equip::pallet::Error **/ PalletRmrkEquipError: { _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] }, /** - * Lookup409: pallet_evm::pallet::Error + * Lookup429: pallet_foreing_assets::module::Error + **/ + PalletForeingAssetsModuleError: { + _enum: ['BadLocation', 'MultiLocationExisted', 'AssetIdNotExists', 'AssetIdExisted'] + }, + /** + * Lookup432: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup412: fp_rpc::TransactionStatus + * Lookup435: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -3080,11 +3362,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup414: ethbloom::Bloom + * Lookup437: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup416: ethereum::receipt::ReceiptV3 + * Lookup439: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -3094,7 +3376,7 @@ export default { } }, /** - * Lookup417: ethereum::receipt::EIP658ReceiptData + * Lookup440: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -3103,7 +3385,7 @@ export default { logs: 'Vec' }, /** - * Lookup418: ethereum::block::Block + * Lookup441: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -3111,7 +3393,7 @@ export default { ommers: 'Vec' }, /** - * Lookup419: ethereum::header::Header + * Lookup442: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -3131,41 +3413,41 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup420: ethereum_types::hash::H64 + * Lookup443: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup425: pallet_ethereum::pallet::Error + * Lookup448: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup426: pallet_evm_coder_substrate::pallet::Error + * Lookup449: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup427: pallet_evm_contract_helpers::SponsoringModeT + * Lookup450: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup429: pallet_evm_contract_helpers::pallet::Error + * Lookup452: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission'] }, /** - * Lookup430: pallet_evm_migration::pallet::Error + * Lookup453: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup432: sp_runtime::MultiSignature + * Lookup455: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3175,43 +3457,43 @@ export default { } }, /** - * Lookup433: sp_core::ed25519::Signature + * Lookup456: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup435: sp_core::sr25519::Signature + * Lookup458: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup436: sp_core::ecdsa::Signature + * Lookup459: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup439: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup462: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup440: frame_system::extensions::check_genesis::CheckGenesis + * Lookup463: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup443: frame_system::extensions::check_nonce::CheckNonce + * Lookup466: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup444: frame_system::extensions::check_weight::CheckWeight + * Lookup467: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup445: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup468: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup446: opal_runtime::Runtime + * Lookup469: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup447: pallet_ethereum::FakeTransactionFinalizer + * Lookup470: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index 7890b69b36..d0f65d9b48 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -1,14 +1,10 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -// import type lookup before we augment - in some environments -// this is required to allow for ambient/previous definitions -import '@polkadot/types/types/registry'; - -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, PalletForeingAssetsModuleCall, PalletForeingAssetsModuleError, PalletForeingAssetsModuleEvent, PalletForeingAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { - interface InterfaceTypes { + export interface InterfaceTypes { CumulusPalletDmpQueueCall: CumulusPalletDmpQueueCall; CumulusPalletDmpQueueConfigData: CumulusPalletDmpQueueConfigData; CumulusPalletDmpQueueError: CumulusPalletDmpQueueError; @@ -79,10 +75,19 @@ declare module '@polkadot/types/types/registry' { FrameSystemPhase: FrameSystemPhase; OpalRuntimeOriginCaller: OpalRuntimeOriginCaller; OpalRuntimeRuntime: OpalRuntimeRuntime; + OrmlTokensAccountData: OrmlTokensAccountData; + OrmlTokensBalanceLock: OrmlTokensBalanceLock; + OrmlTokensModuleCall: OrmlTokensModuleCall; + OrmlTokensModuleError: OrmlTokensModuleError; + OrmlTokensModuleEvent: OrmlTokensModuleEvent; + OrmlTokensReserveData: OrmlTokensReserveData; OrmlVestingModuleCall: OrmlVestingModuleCall; OrmlVestingModuleError: OrmlVestingModuleError; OrmlVestingModuleEvent: OrmlVestingModuleEvent; OrmlVestingVestingSchedule: OrmlVestingVestingSchedule; + OrmlXtokensModuleCall: OrmlXtokensModuleCall; + OrmlXtokensModuleError: OrmlXtokensModuleError; + OrmlXtokensModuleEvent: OrmlXtokensModuleEvent; PalletBalancesAccountData: PalletBalancesAccountData; PalletBalancesBalanceLock: PalletBalancesBalanceLock; PalletBalancesCall: PalletBalancesCall; @@ -108,6 +113,12 @@ declare module '@polkadot/types/types/registry' { PalletEvmEvent: PalletEvmEvent; PalletEvmMigrationCall: PalletEvmMigrationCall; PalletEvmMigrationError: PalletEvmMigrationError; + PalletForeingAssetsAssetIds: PalletForeingAssetsAssetIds; + PalletForeingAssetsModuleAssetMetadata: PalletForeingAssetsModuleAssetMetadata; + PalletForeingAssetsModuleCall: PalletForeingAssetsModuleCall; + PalletForeingAssetsModuleError: PalletForeingAssetsModuleError; + PalletForeingAssetsModuleEvent: PalletForeingAssetsModuleEvent; + PalletForeingAssetsNativeCurrency: PalletForeingAssetsNativeCurrency; PalletFungibleError: PalletFungibleError; PalletInflationCall: PalletInflationCall; PalletNonfungibleError: PalletNonfungibleError; @@ -247,6 +258,7 @@ declare module '@polkadot/types/types/registry' { XcmV2TraitsOutcome: XcmV2TraitsOutcome; XcmV2WeightLimit: XcmV2WeightLimit; XcmV2Xcm: XcmV2Xcm; + XcmVersionedMultiAsset: XcmVersionedMultiAsset; XcmVersionedMultiAssets: XcmVersionedMultiAssets; XcmVersionedMultiLocation: XcmVersionedMultiLocation; XcmVersionedXcm: XcmVersionedXcm; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 323fc2c01e..36821b9738 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1,18 +1,14 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -// import type lookup before we augment - in some environments -// this is required to allow for ambient/previous definitions -import '@polkadot/types/lookup'; - -import type { BTreeMap, BTreeSet, Bytes, Compact, Enum, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; -import type { ITuple } from '@polkadot/types-codec/types'; -import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; -import type { Event } from '@polkadot/types/interfaces/system'; - declare module '@polkadot/types/lookup' { + import type { BTreeMap, BTreeSet, Bytes, Compact, Enum, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; + import type { ITuple } from '@polkadot/types-codec/types'; + import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; + import type { Event } from '@polkadot/types/interfaces/system'; + /** @name FrameSystemAccountInfo (3) */ - interface FrameSystemAccountInfo extends Struct { + export interface FrameSystemAccountInfo extends Struct { readonly nonce: u32; readonly consumers: u32; readonly providers: u32; @@ -21,7 +17,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletBalancesAccountData (5) */ - interface PalletBalancesAccountData extends Struct { + export interface PalletBalancesAccountData extends Struct { readonly free: u128; readonly reserved: u128; readonly miscFrozen: u128; @@ -29,19 +25,19 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSupportWeightsPerDispatchClassU64 (7) */ - interface FrameSupportWeightsPerDispatchClassU64 extends Struct { + export interface FrameSupportWeightsPerDispatchClassU64 extends Struct { readonly normal: u64; readonly operational: u64; readonly mandatory: u64; } /** @name SpRuntimeDigest (11) */ - interface SpRuntimeDigest extends Struct { + export interface SpRuntimeDigest extends Struct { readonly logs: Vec; } /** @name SpRuntimeDigestDigestItem (13) */ - interface SpRuntimeDigestDigestItem extends Enum { + export interface SpRuntimeDigestDigestItem extends Enum { readonly isOther: boolean; readonly asOther: Bytes; readonly isConsensus: boolean; @@ -55,14 +51,14 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSystemEventRecord (16) */ - interface FrameSystemEventRecord extends Struct { + export interface FrameSystemEventRecord extends Struct { readonly phase: FrameSystemPhase; readonly event: Event; readonly topics: Vec; } /** @name FrameSystemEvent (18) */ - interface FrameSystemEvent extends Enum { + export interface FrameSystemEvent extends Enum { readonly isExtrinsicSuccess: boolean; readonly asExtrinsicSuccess: { readonly dispatchInfo: FrameSupportWeightsDispatchInfo; @@ -90,14 +86,14 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSupportWeightsDispatchInfo (19) */ - interface FrameSupportWeightsDispatchInfo extends Struct { + export interface FrameSupportWeightsDispatchInfo extends Struct { readonly weight: u64; readonly class: FrameSupportWeightsDispatchClass; readonly paysFee: FrameSupportWeightsPays; } /** @name FrameSupportWeightsDispatchClass (20) */ - interface FrameSupportWeightsDispatchClass extends Enum { + export interface FrameSupportWeightsDispatchClass extends Enum { readonly isNormal: boolean; readonly isOperational: boolean; readonly isMandatory: boolean; @@ -105,14 +101,14 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSupportWeightsPays (21) */ - interface FrameSupportWeightsPays extends Enum { + export interface FrameSupportWeightsPays extends Enum { readonly isYes: boolean; readonly isNo: boolean; readonly type: 'Yes' | 'No'; } /** @name SpRuntimeDispatchError (22) */ - interface SpRuntimeDispatchError extends Enum { + export interface SpRuntimeDispatchError extends Enum { readonly isOther: boolean; readonly isCannotLookup: boolean; readonly isBadOrigin: boolean; @@ -131,13 +127,13 @@ declare module '@polkadot/types/lookup' { } /** @name SpRuntimeModuleError (23) */ - interface SpRuntimeModuleError extends Struct { + export interface SpRuntimeModuleError extends Struct { readonly index: u8; readonly error: U8aFixed; } /** @name SpRuntimeTokenError (24) */ - interface SpRuntimeTokenError extends Enum { + export interface SpRuntimeTokenError extends Enum { readonly isNoFunds: boolean; readonly isWouldDie: boolean; readonly isBelowMinimum: boolean; @@ -149,7 +145,7 @@ declare module '@polkadot/types/lookup' { } /** @name SpRuntimeArithmeticError (25) */ - interface SpRuntimeArithmeticError extends Enum { + export interface SpRuntimeArithmeticError extends Enum { readonly isUnderflow: boolean; readonly isOverflow: boolean; readonly isDivisionByZero: boolean; @@ -157,14 +153,14 @@ declare module '@polkadot/types/lookup' { } /** @name SpRuntimeTransactionalError (26) */ - interface SpRuntimeTransactionalError extends Enum { + export interface SpRuntimeTransactionalError extends Enum { readonly isLimitReached: boolean; readonly isNoLayer: boolean; readonly type: 'LimitReached' | 'NoLayer'; } /** @name CumulusPalletParachainSystemEvent (27) */ - interface CumulusPalletParachainSystemEvent extends Enum { + export interface CumulusPalletParachainSystemEvent extends Enum { readonly isValidationFunctionStored: boolean; readonly isValidationFunctionApplied: boolean; readonly asValidationFunctionApplied: { @@ -188,7 +184,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletBalancesEvent (28) */ - interface PalletBalancesEvent extends Enum { + export interface PalletBalancesEvent extends Enum { readonly isEndowed: boolean; readonly asEndowed: { readonly account: AccountId32; @@ -247,14 +243,14 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSupportTokensMiscBalanceStatus (29) */ - interface FrameSupportTokensMiscBalanceStatus extends Enum { + export interface FrameSupportTokensMiscBalanceStatus extends Enum { readonly isFree: boolean; readonly isReserved: boolean; readonly type: 'Free' | 'Reserved'; } /** @name PalletTransactionPaymentEvent (30) */ - interface PalletTransactionPaymentEvent extends Enum { + export interface PalletTransactionPaymentEvent extends Enum { readonly isTransactionFeePaid: boolean; readonly asTransactionFeePaid: { readonly who: AccountId32; @@ -265,7 +261,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletTreasuryEvent (31) */ - interface PalletTreasuryEvent extends Enum { + export interface PalletTreasuryEvent extends Enum { readonly isProposed: boolean; readonly asProposed: { readonly proposalIndex: u32; @@ -307,7 +303,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletSudoEvent (32) */ - interface PalletSudoEvent extends Enum { + export interface PalletSudoEvent extends Enum { readonly isSudid: boolean; readonly asSudid: { readonly sudoResult: Result; @@ -324,7 +320,7 @@ declare module '@polkadot/types/lookup' { } /** @name OrmlVestingModuleEvent (36) */ - interface OrmlVestingModuleEvent extends Enum { + export interface OrmlVestingModuleEvent extends Enum { readonly isVestingScheduleAdded: boolean; readonly asVestingScheduleAdded: { readonly from: AccountId32; @@ -344,15 +340,287 @@ declare module '@polkadot/types/lookup' { } /** @name OrmlVestingVestingSchedule (37) */ - interface OrmlVestingVestingSchedule extends Struct { + export interface OrmlVestingVestingSchedule extends Struct { readonly start: u32; readonly period: u32; readonly periodCount: u32; readonly perPeriod: Compact; } - /** @name CumulusPalletXcmpQueueEvent (39) */ - interface CumulusPalletXcmpQueueEvent extends Enum { + /** @name OrmlXtokensModuleEvent (39) */ + export interface OrmlXtokensModuleEvent extends Enum { + readonly isTransferredMultiAssets: boolean; + readonly asTransferredMultiAssets: { + readonly sender: AccountId32; + readonly assets: XcmV1MultiassetMultiAssets; + readonly fee: XcmV1MultiAsset; + readonly dest: XcmV1MultiLocation; + } & Struct; + readonly type: 'TransferredMultiAssets'; + } + + /** @name XcmV1MultiassetMultiAssets (40) */ + export interface XcmV1MultiassetMultiAssets extends Vec {} + + /** @name XcmV1MultiAsset (42) */ + export interface XcmV1MultiAsset extends Struct { + readonly id: XcmV1MultiassetAssetId; + readonly fun: XcmV1MultiassetFungibility; + } + + /** @name XcmV1MultiassetAssetId (43) */ + export interface XcmV1MultiassetAssetId extends Enum { + readonly isConcrete: boolean; + readonly asConcrete: XcmV1MultiLocation; + readonly isAbstract: boolean; + readonly asAbstract: Bytes; + readonly type: 'Concrete' | 'Abstract'; + } + + /** @name XcmV1MultiLocation (44) */ + export interface XcmV1MultiLocation extends Struct { + readonly parents: u8; + readonly interior: XcmV1MultilocationJunctions; + } + + /** @name XcmV1MultilocationJunctions (45) */ + export interface XcmV1MultilocationJunctions extends Enum { + readonly isHere: boolean; + readonly isX1: boolean; + readonly asX1: XcmV1Junction; + readonly isX2: boolean; + readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>; + readonly isX3: boolean; + readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly isX4: boolean; + readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly isX5: boolean; + readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly isX6: boolean; + readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly isX7: boolean; + readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly isX8: boolean; + readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; + } + + /** @name XcmV1Junction (46) */ + export interface XcmV1Junction extends Enum { + readonly isParachain: boolean; + readonly asParachain: Compact; + readonly isAccountId32: boolean; + readonly asAccountId32: { + readonly network: XcmV0JunctionNetworkId; + readonly id: U8aFixed; + } & Struct; + readonly isAccountIndex64: boolean; + readonly asAccountIndex64: { + readonly network: XcmV0JunctionNetworkId; + readonly index: Compact; + } & Struct; + readonly isAccountKey20: boolean; + readonly asAccountKey20: { + readonly network: XcmV0JunctionNetworkId; + readonly key: U8aFixed; + } & Struct; + readonly isPalletInstance: boolean; + readonly asPalletInstance: u8; + readonly isGeneralIndex: boolean; + readonly asGeneralIndex: Compact; + readonly isGeneralKey: boolean; + readonly asGeneralKey: Bytes; + readonly isOnlyChild: boolean; + readonly isPlurality: boolean; + readonly asPlurality: { + readonly id: XcmV0JunctionBodyId; + readonly part: XcmV0JunctionBodyPart; + } & Struct; + readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; + } + + /** @name XcmV0JunctionNetworkId (48) */ + export interface XcmV0JunctionNetworkId extends Enum { + readonly isAny: boolean; + readonly isNamed: boolean; + readonly asNamed: Bytes; + readonly isPolkadot: boolean; + readonly isKusama: boolean; + readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama'; + } + + /** @name XcmV0JunctionBodyId (52) */ + export interface XcmV0JunctionBodyId extends Enum { + readonly isUnit: boolean; + readonly isNamed: boolean; + readonly asNamed: Bytes; + readonly isIndex: boolean; + readonly asIndex: Compact; + readonly isExecutive: boolean; + readonly isTechnical: boolean; + readonly isLegislative: boolean; + readonly isJudicial: boolean; + readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial'; + } + + /** @name XcmV0JunctionBodyPart (53) */ + export interface XcmV0JunctionBodyPart extends Enum { + readonly isVoice: boolean; + readonly isMembers: boolean; + readonly asMembers: { + readonly count: Compact; + } & Struct; + readonly isFraction: boolean; + readonly asFraction: { + readonly nom: Compact; + readonly denom: Compact; + } & Struct; + readonly isAtLeastProportion: boolean; + readonly asAtLeastProportion: { + readonly nom: Compact; + readonly denom: Compact; + } & Struct; + readonly isMoreThanProportion: boolean; + readonly asMoreThanProportion: { + readonly nom: Compact; + readonly denom: Compact; + } & Struct; + readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion'; + } + + /** @name XcmV1MultiassetFungibility (54) */ + export interface XcmV1MultiassetFungibility extends Enum { + readonly isFungible: boolean; + readonly asFungible: Compact; + readonly isNonFungible: boolean; + readonly asNonFungible: XcmV1MultiassetAssetInstance; + readonly type: 'Fungible' | 'NonFungible'; + } + + /** @name XcmV1MultiassetAssetInstance (55) */ + export interface XcmV1MultiassetAssetInstance extends Enum { + readonly isUndefined: boolean; + readonly isIndex: boolean; + readonly asIndex: Compact; + readonly isArray4: boolean; + readonly asArray4: U8aFixed; + readonly isArray8: boolean; + readonly asArray8: U8aFixed; + readonly isArray16: boolean; + readonly asArray16: U8aFixed; + readonly isArray32: boolean; + readonly asArray32: U8aFixed; + readonly isBlob: boolean; + readonly asBlob: Bytes; + readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob'; + } + + /** @name OrmlTokensModuleEvent (58) */ + export interface OrmlTokensModuleEvent extends Enum { + readonly isEndowed: boolean; + readonly asEndowed: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly amount: u128; + } & Struct; + readonly isDustLost: boolean; + readonly asDustLost: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly amount: u128; + } & Struct; + readonly isTransfer: boolean; + readonly asTransfer: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly from: AccountId32; + readonly to: AccountId32; + readonly amount: u128; + } & Struct; + readonly isReserved: boolean; + readonly asReserved: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly amount: u128; + } & Struct; + readonly isUnreserved: boolean; + readonly asUnreserved: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly amount: u128; + } & Struct; + readonly isReserveRepatriated: boolean; + readonly asReserveRepatriated: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly from: AccountId32; + readonly to: AccountId32; + readonly amount: u128; + readonly status: FrameSupportTokensMiscBalanceStatus; + } & Struct; + readonly isBalanceSet: boolean; + readonly asBalanceSet: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly free: u128; + readonly reserved: u128; + } & Struct; + readonly isTotalIssuanceSet: boolean; + readonly asTotalIssuanceSet: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly amount: u128; + } & Struct; + readonly isWithdrawn: boolean; + readonly asWithdrawn: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly amount: u128; + } & Struct; + readonly isSlashed: boolean; + readonly asSlashed: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly freeAmount: u128; + readonly reservedAmount: u128; + } & Struct; + readonly isDeposited: boolean; + readonly asDeposited: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly amount: u128; + } & Struct; + readonly isLockSet: boolean; + readonly asLockSet: { + readonly lockId: U8aFixed; + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + readonly amount: u128; + } & Struct; + readonly isLockRemoved: boolean; + readonly asLockRemoved: { + readonly lockId: U8aFixed; + readonly currencyId: PalletForeingAssetsAssetIds; + readonly who: AccountId32; + } & Struct; + readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'BalanceSet' | 'TotalIssuanceSet' | 'Withdrawn' | 'Slashed' | 'Deposited' | 'LockSet' | 'LockRemoved'; + } + + /** @name PalletForeingAssetsAssetIds (59) */ + export interface PalletForeingAssetsAssetIds extends Enum { + readonly isForeignAssetId: boolean; + readonly asForeignAssetId: u32; + readonly isNativeAssetId: boolean; + readonly asNativeAssetId: PalletForeingAssetsNativeCurrency; + readonly type: 'ForeignAssetId' | 'NativeAssetId'; + } + + /** @name PalletForeingAssetsNativeCurrency (60) */ + export interface PalletForeingAssetsNativeCurrency extends Enum { + readonly isHere: boolean; + readonly isParent: boolean; + readonly type: 'Here' | 'Parent'; + } + + /** @name CumulusPalletXcmpQueueEvent (61) */ + export interface CumulusPalletXcmpQueueEvent extends Enum { readonly isSuccess: boolean; readonly asSuccess: { readonly messageHash: Option; @@ -395,8 +663,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name XcmV2TraitsError (41) */ - interface XcmV2TraitsError extends Enum { + /** @name XcmV2TraitsError (63) */ + export interface XcmV2TraitsError extends Enum { readonly isOverflow: boolean; readonly isUnimplemented: boolean; readonly isUntrustedReserveLocation: boolean; @@ -428,8 +696,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable'; } - /** @name PalletXcmEvent (43) */ - interface PalletXcmEvent extends Enum { + /** @name PalletXcmEvent (65) */ + export interface PalletXcmEvent extends Enum { readonly isAttempted: boolean; readonly asAttempted: XcmV2TraitsOutcome; readonly isSent: boolean; @@ -465,8 +733,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail'; } - /** @name XcmV2TraitsOutcome (44) */ - interface XcmV2TraitsOutcome extends Enum { + /** @name XcmV2TraitsOutcome (66) */ + export interface XcmV2TraitsOutcome extends Enum { readonly isComplete: boolean; readonly asComplete: u64; readonly isIncomplete: boolean; @@ -476,122 +744,11 @@ declare module '@polkadot/types/lookup' { readonly type: 'Complete' | 'Incomplete' | 'Error'; } - /** @name XcmV1MultiLocation (45) */ - interface XcmV1MultiLocation extends Struct { - readonly parents: u8; - readonly interior: XcmV1MultilocationJunctions; - } + /** @name XcmV2Xcm (67) */ + export interface XcmV2Xcm extends Vec {} - /** @name XcmV1MultilocationJunctions (46) */ - interface XcmV1MultilocationJunctions extends Enum { - readonly isHere: boolean; - readonly isX1: boolean; - readonly asX1: XcmV1Junction; - readonly isX2: boolean; - readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>; - readonly isX3: boolean; - readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly isX4: boolean; - readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly isX5: boolean; - readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly isX6: boolean; - readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly isX7: boolean; - readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly isX8: boolean; - readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; - } - - /** @name XcmV1Junction (47) */ - interface XcmV1Junction extends Enum { - readonly isParachain: boolean; - readonly asParachain: Compact; - readonly isAccountId32: boolean; - readonly asAccountId32: { - readonly network: XcmV0JunctionNetworkId; - readonly id: U8aFixed; - } & Struct; - readonly isAccountIndex64: boolean; - readonly asAccountIndex64: { - readonly network: XcmV0JunctionNetworkId; - readonly index: Compact; - } & Struct; - readonly isAccountKey20: boolean; - readonly asAccountKey20: { - readonly network: XcmV0JunctionNetworkId; - readonly key: U8aFixed; - } & Struct; - readonly isPalletInstance: boolean; - readonly asPalletInstance: u8; - readonly isGeneralIndex: boolean; - readonly asGeneralIndex: Compact; - readonly isGeneralKey: boolean; - readonly asGeneralKey: Bytes; - readonly isOnlyChild: boolean; - readonly isPlurality: boolean; - readonly asPlurality: { - readonly id: XcmV0JunctionBodyId; - readonly part: XcmV0JunctionBodyPart; - } & Struct; - readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; - } - - /** @name XcmV0JunctionNetworkId (49) */ - interface XcmV0JunctionNetworkId extends Enum { - readonly isAny: boolean; - readonly isNamed: boolean; - readonly asNamed: Bytes; - readonly isPolkadot: boolean; - readonly isKusama: boolean; - readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama'; - } - - /** @name XcmV0JunctionBodyId (53) */ - interface XcmV0JunctionBodyId extends Enum { - readonly isUnit: boolean; - readonly isNamed: boolean; - readonly asNamed: Bytes; - readonly isIndex: boolean; - readonly asIndex: Compact; - readonly isExecutive: boolean; - readonly isTechnical: boolean; - readonly isLegislative: boolean; - readonly isJudicial: boolean; - readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial'; - } - - /** @name XcmV0JunctionBodyPart (54) */ - interface XcmV0JunctionBodyPart extends Enum { - readonly isVoice: boolean; - readonly isMembers: boolean; - readonly asMembers: { - readonly count: Compact; - } & Struct; - readonly isFraction: boolean; - readonly asFraction: { - readonly nom: Compact; - readonly denom: Compact; - } & Struct; - readonly isAtLeastProportion: boolean; - readonly asAtLeastProportion: { - readonly nom: Compact; - readonly denom: Compact; - } & Struct; - readonly isMoreThanProportion: boolean; - readonly asMoreThanProportion: { - readonly nom: Compact; - readonly denom: Compact; - } & Struct; - readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion'; - } - - /** @name XcmV2Xcm (55) */ - interface XcmV2Xcm extends Vec {} - - /** @name XcmV2Instruction (57) */ - interface XcmV2Instruction extends Enum { + /** @name XcmV2Instruction (69) */ + export interface XcmV2Instruction extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: XcmV1MultiassetMultiAssets; readonly isReserveAssetDeposited: boolean; @@ -710,53 +867,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion'; } - /** @name XcmV1MultiassetMultiAssets (58) */ - interface XcmV1MultiassetMultiAssets extends Vec {} - - /** @name XcmV1MultiAsset (60) */ - interface XcmV1MultiAsset extends Struct { - readonly id: XcmV1MultiassetAssetId; - readonly fun: XcmV1MultiassetFungibility; - } - - /** @name XcmV1MultiassetAssetId (61) */ - interface XcmV1MultiassetAssetId extends Enum { - readonly isConcrete: boolean; - readonly asConcrete: XcmV1MultiLocation; - readonly isAbstract: boolean; - readonly asAbstract: Bytes; - readonly type: 'Concrete' | 'Abstract'; - } - - /** @name XcmV1MultiassetFungibility (62) */ - interface XcmV1MultiassetFungibility extends Enum { - readonly isFungible: boolean; - readonly asFungible: Compact; - readonly isNonFungible: boolean; - readonly asNonFungible: XcmV1MultiassetAssetInstance; - readonly type: 'Fungible' | 'NonFungible'; - } - - /** @name XcmV1MultiassetAssetInstance (63) */ - interface XcmV1MultiassetAssetInstance extends Enum { - readonly isUndefined: boolean; - readonly isIndex: boolean; - readonly asIndex: Compact; - readonly isArray4: boolean; - readonly asArray4: U8aFixed; - readonly isArray8: boolean; - readonly asArray8: U8aFixed; - readonly isArray16: boolean; - readonly asArray16: U8aFixed; - readonly isArray32: boolean; - readonly asArray32: U8aFixed; - readonly isBlob: boolean; - readonly asBlob: Bytes; - readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob'; - } - - /** @name XcmV2Response (66) */ - interface XcmV2Response extends Enum { + /** @name XcmV2Response (70) */ + export interface XcmV2Response extends Enum { readonly isNull: boolean; readonly isAssets: boolean; readonly asAssets: XcmV1MultiassetMultiAssets; @@ -767,8 +879,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version'; } - /** @name XcmV0OriginKind (69) */ - interface XcmV0OriginKind extends Enum { + /** @name XcmV0OriginKind (73) */ + export interface XcmV0OriginKind extends Enum { readonly isNative: boolean; readonly isSovereignAccount: boolean; readonly isSuperuser: boolean; @@ -776,13 +888,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm'; } - /** @name XcmDoubleEncoded (70) */ - interface XcmDoubleEncoded extends Struct { + /** @name XcmDoubleEncoded (74) */ + export interface XcmDoubleEncoded extends Struct { readonly encoded: Bytes; } - /** @name XcmV1MultiassetMultiAssetFilter (71) */ - interface XcmV1MultiassetMultiAssetFilter extends Enum { + /** @name XcmV1MultiassetMultiAssetFilter (75) */ + export interface XcmV1MultiassetMultiAssetFilter extends Enum { readonly isDefinite: boolean; readonly asDefinite: XcmV1MultiassetMultiAssets; readonly isWild: boolean; @@ -790,8 +902,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Definite' | 'Wild'; } - /** @name XcmV1MultiassetWildMultiAsset (72) */ - interface XcmV1MultiassetWildMultiAsset extends Enum { + /** @name XcmV1MultiassetWildMultiAsset (76) */ + export interface XcmV1MultiassetWildMultiAsset extends Enum { readonly isAll: boolean; readonly isAllOf: boolean; readonly asAllOf: { @@ -801,23 +913,23 @@ declare module '@polkadot/types/lookup' { readonly type: 'All' | 'AllOf'; } - /** @name XcmV1MultiassetWildFungibility (73) */ - interface XcmV1MultiassetWildFungibility extends Enum { + /** @name XcmV1MultiassetWildFungibility (77) */ + export interface XcmV1MultiassetWildFungibility extends Enum { readonly isFungible: boolean; readonly isNonFungible: boolean; readonly type: 'Fungible' | 'NonFungible'; } - /** @name XcmV2WeightLimit (74) */ - interface XcmV2WeightLimit extends Enum { + /** @name XcmV2WeightLimit (78) */ + export interface XcmV2WeightLimit extends Enum { readonly isUnlimited: boolean; readonly isLimited: boolean; readonly asLimited: Compact; readonly type: 'Unlimited' | 'Limited'; } - /** @name XcmVersionedMultiAssets (76) */ - interface XcmVersionedMultiAssets extends Enum { + /** @name XcmVersionedMultiAssets (80) */ + export interface XcmVersionedMultiAssets extends Enum { readonly isV0: boolean; readonly asV0: Vec; readonly isV1: boolean; @@ -825,8 +937,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1'; } - /** @name XcmV0MultiAsset (78) */ - interface XcmV0MultiAsset extends Enum { + /** @name XcmV0MultiAsset (82) */ + export interface XcmV0MultiAsset extends Enum { readonly isNone: boolean; readonly isAll: boolean; readonly isAllFungible: boolean; @@ -870,8 +982,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'None' | 'All' | 'AllFungible' | 'AllNonFungible' | 'AllAbstractFungible' | 'AllAbstractNonFungible' | 'AllConcreteFungible' | 'AllConcreteNonFungible' | 'AbstractFungible' | 'AbstractNonFungible' | 'ConcreteFungible' | 'ConcreteNonFungible'; } - /** @name XcmV0MultiLocation (79) */ - interface XcmV0MultiLocation extends Enum { + /** @name XcmV0MultiLocation (83) */ + export interface XcmV0MultiLocation extends Enum { readonly isNull: boolean; readonly isX1: boolean; readonly asX1: XcmV0Junction; @@ -892,8 +1004,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Null' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; } - /** @name XcmV0Junction (80) */ - interface XcmV0Junction extends Enum { + /** @name XcmV0Junction (84) */ + export interface XcmV0Junction extends Enum { readonly isParent: boolean; readonly isParachain: boolean; readonly asParachain: Compact; @@ -927,8 +1039,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; } - /** @name XcmVersionedMultiLocation (81) */ - interface XcmVersionedMultiLocation extends Enum { + /** @name XcmVersionedMultiLocation (85) */ + export interface XcmVersionedMultiLocation extends Enum { readonly isV0: boolean; readonly asV0: XcmV0MultiLocation; readonly isV1: boolean; @@ -936,8 +1048,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1'; } - /** @name CumulusPalletXcmEvent (82) */ - interface CumulusPalletXcmEvent extends Enum { + /** @name CumulusPalletXcmEvent (86) */ + export interface CumulusPalletXcmEvent extends Enum { readonly isInvalidFormat: boolean; readonly asInvalidFormat: U8aFixed; readonly isUnsupportedVersion: boolean; @@ -947,8 +1059,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; } - /** @name CumulusPalletDmpQueueEvent (83) */ - interface CumulusPalletDmpQueueEvent extends Enum { + /** @name CumulusPalletDmpQueueEvent (87) */ + export interface CumulusPalletDmpQueueEvent extends Enum { readonly isInvalidFormat: boolean; readonly asInvalidFormat: { readonly messageId: U8aFixed; @@ -982,8 +1094,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name PalletUniqueRawEvent (84) */ - interface PalletUniqueRawEvent extends Enum { + /** @name PalletUniqueRawEvent (88) */ + export interface PalletUniqueRawEvent extends Enum { readonly isCollectionSponsorRemoved: boolean; readonly asCollectionSponsorRemoved: u32; readonly isCollectionAdminAdded: boolean; @@ -1007,8 +1119,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet'; } - /** @name PalletEvmAccountBasicCrossAccountIdRepr (85) */ - interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { + /** @name PalletEvmAccountBasicCrossAccountIdRepr (89) */ + export interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { readonly isSubstrate: boolean; readonly asSubstrate: AccountId32; readonly isEthereum: boolean; @@ -1016,8 +1128,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Substrate' | 'Ethereum'; } - /** @name PalletUniqueSchedulerEvent (88) */ - interface PalletUniqueSchedulerEvent extends Enum { + /** @name PalletUniqueSchedulerEvent (92) */ + export interface PalletUniqueSchedulerEvent extends Enum { readonly isScheduled: boolean; readonly asScheduled: { readonly when: u32; @@ -1043,15 +1155,15 @@ declare module '@polkadot/types/lookup' { readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; } - /** @name FrameSupportScheduleLookupError (91) */ - interface FrameSupportScheduleLookupError extends Enum { + /** @name FrameSupportScheduleLookupError (95) */ + export interface FrameSupportScheduleLookupError extends Enum { readonly isUnknown: boolean; readonly isBadFormat: boolean; readonly type: 'Unknown' | 'BadFormat'; } - /** @name PalletCommonEvent (92) */ - interface PalletCommonEvent extends Enum { + /** @name PalletCommonEvent (96) */ + export interface PalletCommonEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; readonly isCollectionDestroyed: boolean; @@ -1077,15 +1189,15 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; } - /** @name PalletStructureEvent (95) */ - interface PalletStructureEvent extends Enum { + /** @name PalletStructureEvent (99) */ + export interface PalletStructureEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: Result; readonly type: 'Executed'; } - /** @name PalletRmrkCoreEvent (96) */ - interface PalletRmrkCoreEvent extends Enum { + /** @name PalletRmrkCoreEvent (100) */ + export interface PalletRmrkCoreEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: { readonly issuer: AccountId32; @@ -1174,8 +1286,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; } - /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (97) */ - interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { + /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (101) */ + export interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { readonly isAccountId: boolean; readonly asAccountId: AccountId32; readonly isCollectionAndNftTuple: boolean; @@ -1183,8 +1295,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'AccountId' | 'CollectionAndNftTuple'; } - /** @name PalletRmrkEquipEvent (102) */ - interface PalletRmrkEquipEvent extends Enum { + /** @name PalletRmrkEquipEvent (106) */ + export interface PalletRmrkEquipEvent extends Enum { readonly isBaseCreated: boolean; readonly asBaseCreated: { readonly issuer: AccountId32; @@ -1198,8 +1310,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'BaseCreated' | 'EquippablesUpdated'; } - /** @name PalletEvmEvent (103) */ - interface PalletEvmEvent extends Enum { + /** @name PalletForeingAssetsModuleEvent (107) */ + export interface PalletForeingAssetsModuleEvent extends Enum { + readonly isForeignAssetRegistered: boolean; + readonly asForeignAssetRegistered: { + readonly assetId: u32; + readonly assetAddress: XcmV1MultiLocation; + readonly metadata: PalletForeingAssetsModuleAssetMetadata; + } & Struct; + readonly isForeignAssetUpdated: boolean; + readonly asForeignAssetUpdated: { + readonly assetId: u32; + readonly assetAddress: XcmV1MultiLocation; + readonly metadata: PalletForeingAssetsModuleAssetMetadata; + } & Struct; + readonly isAssetRegistered: boolean; + readonly asAssetRegistered: { + readonly assetId: PalletForeingAssetsAssetIds; + readonly metadata: PalletForeingAssetsModuleAssetMetadata; + } & Struct; + readonly isAssetUpdated: boolean; + readonly asAssetUpdated: { + readonly assetId: PalletForeingAssetsAssetIds; + readonly metadata: PalletForeingAssetsModuleAssetMetadata; + } & Struct; + readonly type: 'ForeignAssetRegistered' | 'ForeignAssetUpdated' | 'AssetRegistered' | 'AssetUpdated'; + } + + /** @name PalletForeingAssetsModuleAssetMetadata (108) */ + export interface PalletForeingAssetsModuleAssetMetadata extends Struct { + readonly name: Bytes; + readonly symbol: Bytes; + readonly decimals: u8; + readonly minimalBalance: u128; + } + + /** @name PalletEvmEvent (109) */ + export interface PalletEvmEvent extends Enum { readonly isLog: boolean; readonly asLog: EthereumLog; readonly isCreated: boolean; @@ -1217,22 +1364,22 @@ declare module '@polkadot/types/lookup' { readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; } - /** @name EthereumLog (104) */ - interface EthereumLog extends Struct { + /** @name EthereumLog (110) */ + export interface EthereumLog extends Struct { readonly address: H160; readonly topics: Vec; readonly data: Bytes; } - /** @name PalletEthereumEvent (108) */ - interface PalletEthereumEvent extends Enum { + /** @name PalletEthereumEvent (114) */ + export interface PalletEthereumEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; readonly type: 'Executed'; } - /** @name EvmCoreErrorExitReason (109) */ - interface EvmCoreErrorExitReason extends Enum { + /** @name EvmCoreErrorExitReason (115) */ + export interface EvmCoreErrorExitReason extends Enum { readonly isSucceed: boolean; readonly asSucceed: EvmCoreErrorExitSucceed; readonly isError: boolean; @@ -1244,16 +1391,16 @@ declare module '@polkadot/types/lookup' { readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; } - /** @name EvmCoreErrorExitSucceed (110) */ - interface EvmCoreErrorExitSucceed extends Enum { + /** @name EvmCoreErrorExitSucceed (116) */ + export interface EvmCoreErrorExitSucceed extends Enum { readonly isStopped: boolean; readonly isReturned: boolean; readonly isSuicided: boolean; readonly type: 'Stopped' | 'Returned' | 'Suicided'; } - /** @name EvmCoreErrorExitError (111) */ - interface EvmCoreErrorExitError extends Enum { + /** @name EvmCoreErrorExitError (117) */ + export interface EvmCoreErrorExitError extends Enum { readonly isStackUnderflow: boolean; readonly isStackOverflow: boolean; readonly isInvalidJump: boolean; @@ -1273,14 +1420,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; } - /** @name EvmCoreErrorExitRevert (114) */ - interface EvmCoreErrorExitRevert extends Enum { + /** @name EvmCoreErrorExitRevert (120) */ + export interface EvmCoreErrorExitRevert extends Enum { readonly isReverted: boolean; readonly type: 'Reverted'; } - /** @name EvmCoreErrorExitFatal (115) */ - interface EvmCoreErrorExitFatal extends Enum { + /** @name EvmCoreErrorExitFatal (121) */ + export interface EvmCoreErrorExitFatal extends Enum { readonly isNotSupported: boolean; readonly isUnhandledInterrupt: boolean; readonly isCallErrorAsFatal: boolean; @@ -1290,8 +1437,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; } - /** @name FrameSystemPhase (116) */ - interface FrameSystemPhase extends Enum { + /** @name FrameSystemPhase (122) */ + export interface FrameSystemPhase extends Enum { readonly isApplyExtrinsic: boolean; readonly asApplyExtrinsic: u32; readonly isFinalization: boolean; @@ -1299,14 +1446,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } - /** @name FrameSystemLastRuntimeUpgradeInfo (118) */ - interface FrameSystemLastRuntimeUpgradeInfo extends Struct { + /** @name FrameSystemLastRuntimeUpgradeInfo (124) */ + export interface FrameSystemLastRuntimeUpgradeInfo extends Struct { readonly specVersion: Compact; readonly specName: Text; } - /** @name FrameSystemCall (119) */ - interface FrameSystemCall extends Enum { + /** @name FrameSystemCall (125) */ + export interface FrameSystemCall extends Enum { readonly isFillBlock: boolean; readonly asFillBlock: { readonly ratio: Perbill; @@ -1347,48 +1494,48 @@ declare module '@polkadot/types/lookup' { readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent'; } - /** @name FrameSystemLimitsBlockWeights (124) */ - interface FrameSystemLimitsBlockWeights extends Struct { + /** @name FrameSystemLimitsBlockWeights (130) */ + export interface FrameSystemLimitsBlockWeights extends Struct { readonly baseBlock: u64; readonly maxBlock: u64; readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; } - /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (125) */ - interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { + /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (131) */ + export interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { readonly normal: FrameSystemLimitsWeightsPerClass; readonly operational: FrameSystemLimitsWeightsPerClass; readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name FrameSystemLimitsWeightsPerClass (126) */ - interface FrameSystemLimitsWeightsPerClass extends Struct { + /** @name FrameSystemLimitsWeightsPerClass (132) */ + export interface FrameSystemLimitsWeightsPerClass extends Struct { readonly baseExtrinsic: u64; readonly maxExtrinsic: Option; readonly maxTotal: Option; readonly reserved: Option; } - /** @name FrameSystemLimitsBlockLength (128) */ - interface FrameSystemLimitsBlockLength extends Struct { + /** @name FrameSystemLimitsBlockLength (134) */ + export interface FrameSystemLimitsBlockLength extends Struct { readonly max: FrameSupportWeightsPerDispatchClassU32; } - /** @name FrameSupportWeightsPerDispatchClassU32 (129) */ - interface FrameSupportWeightsPerDispatchClassU32 extends Struct { + /** @name FrameSupportWeightsPerDispatchClassU32 (135) */ + export interface FrameSupportWeightsPerDispatchClassU32 extends Struct { readonly normal: u32; readonly operational: u32; readonly mandatory: u32; } - /** @name FrameSupportWeightsRuntimeDbWeight (130) */ - interface FrameSupportWeightsRuntimeDbWeight extends Struct { + /** @name FrameSupportWeightsRuntimeDbWeight (136) */ + export interface FrameSupportWeightsRuntimeDbWeight extends Struct { readonly read: u64; readonly write: u64; } - /** @name SpVersionRuntimeVersion (131) */ - interface SpVersionRuntimeVersion extends Struct { + /** @name SpVersionRuntimeVersion (137) */ + export interface SpVersionRuntimeVersion extends Struct { readonly specName: Text; readonly implName: Text; readonly authoringVersion: u32; @@ -1399,8 +1546,8 @@ declare module '@polkadot/types/lookup' { readonly stateVersion: u8; } - /** @name FrameSystemError (136) */ - interface FrameSystemError extends Enum { + /** @name FrameSystemError (142) */ + export interface FrameSystemError extends Enum { readonly isInvalidSpecName: boolean; readonly isSpecVersionNeedsToIncrease: boolean; readonly isFailedToExtractRuntimeVersion: boolean; @@ -1410,35 +1557,35 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name PolkadotPrimitivesV2PersistedValidationData (137) */ - interface PolkadotPrimitivesV2PersistedValidationData extends Struct { + /** @name PolkadotPrimitivesV2PersistedValidationData (143) */ + export interface PolkadotPrimitivesV2PersistedValidationData extends Struct { readonly parentHead: Bytes; readonly relayParentNumber: u32; readonly relayParentStorageRoot: H256; readonly maxPovSize: u32; } - /** @name PolkadotPrimitivesV2UpgradeRestriction (140) */ - interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { + /** @name PolkadotPrimitivesV2UpgradeRestriction (146) */ + export interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { readonly isPresent: boolean; readonly type: 'Present'; } - /** @name SpTrieStorageProof (141) */ - interface SpTrieStorageProof extends Struct { + /** @name SpTrieStorageProof (147) */ + export interface SpTrieStorageProof extends Struct { readonly trieNodes: BTreeSet; } - /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (143) */ - interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { + /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (149) */ + export interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { readonly dmqMqcHead: H256; readonly relayDispatchQueueSize: ITuple<[u32, u32]>; readonly ingressChannels: Vec>; readonly egressChannels: Vec>; } - /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (146) */ - interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { + /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (152) */ + export interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { readonly maxCapacity: u32; readonly maxTotalSize: u32; readonly maxMessageSize: u32; @@ -1447,8 +1594,8 @@ declare module '@polkadot/types/lookup' { readonly mqcHead: Option; } - /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (147) */ - interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { + /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (153) */ + export interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { readonly maxCodeSize: u32; readonly maxHeadDataSize: u32; readonly maxUpwardQueueCount: u32; @@ -1460,14 +1607,14 @@ declare module '@polkadot/types/lookup' { readonly validationUpgradeDelay: u32; } - /** @name PolkadotCorePrimitivesOutboundHrmpMessage (153) */ - interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { + /** @name PolkadotCorePrimitivesOutboundHrmpMessage (159) */ + export interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { readonly recipient: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemCall (154) */ - interface CumulusPalletParachainSystemCall extends Enum { + /** @name CumulusPalletParachainSystemCall (160) */ + export interface CumulusPalletParachainSystemCall extends Enum { readonly isSetValidationData: boolean; readonly asSetValidationData: { readonly data: CumulusPrimitivesParachainInherentParachainInherentData; @@ -1487,28 +1634,28 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade'; } - /** @name CumulusPrimitivesParachainInherentParachainInherentData (155) */ - interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { + /** @name CumulusPrimitivesParachainInherentParachainInherentData (161) */ + export interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { readonly validationData: PolkadotPrimitivesV2PersistedValidationData; readonly relayChainState: SpTrieStorageProof; readonly downwardMessages: Vec; readonly horizontalMessages: BTreeMap>; } - /** @name PolkadotCorePrimitivesInboundDownwardMessage (157) */ - interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { + /** @name PolkadotCorePrimitivesInboundDownwardMessage (163) */ + export interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { readonly sentAt: u32; readonly msg: Bytes; } - /** @name PolkadotCorePrimitivesInboundHrmpMessage (160) */ - interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { + /** @name PolkadotCorePrimitivesInboundHrmpMessage (166) */ + export interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { readonly sentAt: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemError (163) */ - interface CumulusPalletParachainSystemError extends Enum { + /** @name CumulusPalletParachainSystemError (169) */ + export interface CumulusPalletParachainSystemError extends Enum { readonly isOverlappingUpgrades: boolean; readonly isProhibitedByPolkadot: boolean; readonly isTooBig: boolean; @@ -1520,36 +1667,36 @@ declare module '@polkadot/types/lookup' { readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized'; } - /** @name PalletBalancesBalanceLock (165) */ - interface PalletBalancesBalanceLock extends Struct { + /** @name PalletBalancesBalanceLock (171) */ + export interface PalletBalancesBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; readonly reasons: PalletBalancesReasons; } - /** @name PalletBalancesReasons (166) */ - interface PalletBalancesReasons extends Enum { + /** @name PalletBalancesReasons (172) */ + export interface PalletBalancesReasons extends Enum { readonly isFee: boolean; readonly isMisc: boolean; readonly isAll: boolean; readonly type: 'Fee' | 'Misc' | 'All'; } - /** @name PalletBalancesReserveData (169) */ - interface PalletBalancesReserveData extends Struct { + /** @name PalletBalancesReserveData (175) */ + export interface PalletBalancesReserveData extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name PalletBalancesReleases (171) */ - interface PalletBalancesReleases extends Enum { + /** @name PalletBalancesReleases (177) */ + export interface PalletBalancesReleases extends Enum { readonly isV100: boolean; readonly isV200: boolean; readonly type: 'V100' | 'V200'; } - /** @name PalletBalancesCall (172) */ - interface PalletBalancesCall extends Enum { + /** @name PalletBalancesCall (178) */ + export interface PalletBalancesCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { readonly dest: MultiAddress; @@ -1585,8 +1732,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; } - /** @name PalletBalancesError (175) */ - interface PalletBalancesError extends Enum { + /** @name PalletBalancesError (181) */ + export interface PalletBalancesError extends Enum { readonly isVestingBalance: boolean; readonly isLiquidityRestrictions: boolean; readonly isInsufficientBalance: boolean; @@ -1598,8 +1745,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves'; } - /** @name PalletTimestampCall (177) */ - interface PalletTimestampCall extends Enum { + /** @name PalletTimestampCall (183) */ + export interface PalletTimestampCall extends Enum { readonly isSet: boolean; readonly asSet: { readonly now: Compact; @@ -1607,23 +1754,23 @@ declare module '@polkadot/types/lookup' { readonly type: 'Set'; } - /** @name PalletTransactionPaymentReleases (179) */ - interface PalletTransactionPaymentReleases extends Enum { + /** @name PalletTransactionPaymentReleases (185) */ + export interface PalletTransactionPaymentReleases extends Enum { readonly isV1Ancient: boolean; readonly isV2: boolean; readonly type: 'V1Ancient' | 'V2'; } - /** @name PalletTreasuryProposal (180) */ - interface PalletTreasuryProposal extends Struct { + /** @name PalletTreasuryProposal (186) */ + export interface PalletTreasuryProposal extends Struct { readonly proposer: AccountId32; readonly value: u128; readonly beneficiary: AccountId32; readonly bond: u128; } - /** @name PalletTreasuryCall (183) */ - interface PalletTreasuryCall extends Enum { + /** @name PalletTreasuryCall (189) */ + export interface PalletTreasuryCall extends Enum { readonly isProposeSpend: boolean; readonly asProposeSpend: { readonly value: Compact; @@ -1649,11 +1796,11 @@ declare module '@polkadot/types/lookup' { readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval'; } - /** @name FrameSupportPalletId (186) */ - interface FrameSupportPalletId extends U8aFixed {} + /** @name FrameSupportPalletId (192) */ + export interface FrameSupportPalletId extends U8aFixed {} - /** @name PalletTreasuryError (187) */ - interface PalletTreasuryError extends Enum { + /** @name PalletTreasuryError (193) */ + export interface PalletTreasuryError extends Enum { readonly isInsufficientProposersBalance: boolean; readonly isInvalidIndex: boolean; readonly isTooManyApprovals: boolean; @@ -1662,8 +1809,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved'; } - /** @name PalletSudoCall (188) */ - interface PalletSudoCall extends Enum { + /** @name PalletSudoCall (194) */ + export interface PalletSudoCall extends Enum { readonly isSudo: boolean; readonly asSudo: { readonly call: Call; @@ -1685,8 +1832,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs'; } - /** @name OrmlVestingModuleCall (190) */ - interface OrmlVestingModuleCall extends Enum { + /** @name OrmlVestingModuleCall (196) */ + export interface OrmlVestingModuleCall extends Enum { readonly isClaim: boolean; readonly isVestedTransfer: boolean; readonly asVestedTransfer: { @@ -1705,8 +1852,101 @@ declare module '@polkadot/types/lookup' { readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor'; } - /** @name CumulusPalletXcmpQueueCall (192) */ - interface CumulusPalletXcmpQueueCall extends Enum { + /** @name OrmlXtokensModuleCall (198) */ + export interface OrmlXtokensModuleCall extends Enum { + readonly isTransfer: boolean; + readonly asTransfer: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly amount: u128; + readonly dest: XcmVersionedMultiLocation; + readonly destWeight: u64; + } & Struct; + readonly isTransferMultiasset: boolean; + readonly asTransferMultiasset: { + readonly asset: XcmVersionedMultiAsset; + readonly dest: XcmVersionedMultiLocation; + readonly destWeight: u64; + } & Struct; + readonly isTransferWithFee: boolean; + readonly asTransferWithFee: { + readonly currencyId: PalletForeingAssetsAssetIds; + readonly amount: u128; + readonly fee: u128; + readonly dest: XcmVersionedMultiLocation; + readonly destWeight: u64; + } & Struct; + readonly isTransferMultiassetWithFee: boolean; + readonly asTransferMultiassetWithFee: { + readonly asset: XcmVersionedMultiAsset; + readonly fee: XcmVersionedMultiAsset; + readonly dest: XcmVersionedMultiLocation; + readonly destWeight: u64; + } & Struct; + readonly isTransferMulticurrencies: boolean; + readonly asTransferMulticurrencies: { + readonly currencies: Vec>; + readonly feeItem: u32; + readonly dest: XcmVersionedMultiLocation; + readonly destWeight: u64; + } & Struct; + readonly isTransferMultiassets: boolean; + readonly asTransferMultiassets: { + readonly assets: XcmVersionedMultiAssets; + readonly feeItem: u32; + readonly dest: XcmVersionedMultiLocation; + readonly destWeight: u64; + } & Struct; + readonly type: 'Transfer' | 'TransferMultiasset' | 'TransferWithFee' | 'TransferMultiassetWithFee' | 'TransferMulticurrencies' | 'TransferMultiassets'; + } + + /** @name XcmVersionedMultiAsset (199) */ + export interface XcmVersionedMultiAsset extends Enum { + readonly isV0: boolean; + readonly asV0: XcmV0MultiAsset; + readonly isV1: boolean; + readonly asV1: XcmV1MultiAsset; + readonly type: 'V0' | 'V1'; + } + + /** @name OrmlTokensModuleCall (202) */ + export interface OrmlTokensModuleCall extends Enum { + readonly isTransfer: boolean; + readonly asTransfer: { + readonly dest: MultiAddress; + readonly currencyId: PalletForeingAssetsAssetIds; + readonly amount: Compact; + } & Struct; + readonly isTransferAll: boolean; + readonly asTransferAll: { + readonly dest: MultiAddress; + readonly currencyId: PalletForeingAssetsAssetIds; + readonly keepAlive: bool; + } & Struct; + readonly isTransferKeepAlive: boolean; + readonly asTransferKeepAlive: { + readonly dest: MultiAddress; + readonly currencyId: PalletForeingAssetsAssetIds; + readonly amount: Compact; + } & Struct; + readonly isForceTransfer: boolean; + readonly asForceTransfer: { + readonly source: MultiAddress; + readonly dest: MultiAddress; + readonly currencyId: PalletForeingAssetsAssetIds; + readonly amount: Compact; + } & Struct; + readonly isSetBalance: boolean; + readonly asSetBalance: { + readonly who: MultiAddress; + readonly currencyId: PalletForeingAssetsAssetIds; + readonly newFree: Compact; + readonly newReserved: Compact; + } & Struct; + readonly type: 'Transfer' | 'TransferAll' | 'TransferKeepAlive' | 'ForceTransfer' | 'SetBalance'; + } + + /** @name CumulusPalletXcmpQueueCall (203) */ + export interface CumulusPalletXcmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { readonly index: u64; @@ -1741,8 +1981,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight'; } - /** @name PalletXcmCall (193) */ - interface PalletXcmCall extends Enum { + /** @name PalletXcmCall (204) */ + export interface PalletXcmCall extends Enum { readonly isSend: boolean; readonly asSend: { readonly dest: XcmVersionedMultiLocation; @@ -1803,8 +2043,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets'; } - /** @name XcmVersionedXcm (194) */ - interface XcmVersionedXcm extends Enum { + /** @name XcmVersionedXcm (205) */ + export interface XcmVersionedXcm extends Enum { readonly isV0: boolean; readonly asV0: XcmV0Xcm; readonly isV1: boolean; @@ -1814,8 +2054,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1' | 'V2'; } - /** @name XcmV0Xcm (195) */ - interface XcmV0Xcm extends Enum { + /** @name XcmV0Xcm (206) */ + export interface XcmV0Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { readonly assets: Vec; @@ -1877,8 +2117,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom'; } - /** @name XcmV0Order (197) */ - interface XcmV0Order extends Enum { + /** @name XcmV0Order (208) */ + export interface XcmV0Order extends Enum { readonly isNull: boolean; readonly isDepositAsset: boolean; readonly asDepositAsset: { @@ -1925,15 +2165,15 @@ declare module '@polkadot/types/lookup' { readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV0Response (199) */ - interface XcmV0Response extends Enum { + /** @name XcmV0Response (210) */ + export interface XcmV0Response extends Enum { readonly isAssets: boolean; readonly asAssets: Vec; readonly type: 'Assets'; } - /** @name XcmV1Xcm (200) */ - interface XcmV1Xcm extends Enum { + /** @name XcmV1Xcm (211) */ + export interface XcmV1Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { readonly assets: XcmV1MultiassetMultiAssets; @@ -2001,8 +2241,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion'; } - /** @name XcmV1Order (202) */ - interface XcmV1Order extends Enum { + /** @name XcmV1Order (213) */ + export interface XcmV1Order extends Enum { readonly isNoop: boolean; readonly isDepositAsset: boolean; readonly asDepositAsset: { @@ -2051,8 +2291,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV1Response (204) */ - interface XcmV1Response extends Enum { + /** @name XcmV1Response (215) */ + export interface XcmV1Response extends Enum { readonly isAssets: boolean; readonly asAssets: XcmV1MultiassetMultiAssets; readonly isVersion: boolean; @@ -2060,11 +2300,11 @@ declare module '@polkadot/types/lookup' { readonly type: 'Assets' | 'Version'; } - /** @name CumulusPalletXcmCall (218) */ - type CumulusPalletXcmCall = Null; + /** @name CumulusPalletXcmCall (229) */ + export type CumulusPalletXcmCall = Null; - /** @name CumulusPalletDmpQueueCall (219) */ - interface CumulusPalletDmpQueueCall extends Enum { + /** @name CumulusPalletDmpQueueCall (230) */ + export interface CumulusPalletDmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { readonly index: u64; @@ -2073,8 +2313,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight'; } - /** @name PalletInflationCall (220) */ - interface PalletInflationCall extends Enum { + /** @name PalletInflationCall (231) */ + export interface PalletInflationCall extends Enum { readonly isStartInflation: boolean; readonly asStartInflation: { readonly inflationStartRelayBlock: u32; @@ -2082,8 +2322,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'StartInflation'; } - /** @name PalletUniqueCall (221) */ - interface PalletUniqueCall extends Enum { + /** @name PalletUniqueCall (232) */ + export interface PalletUniqueCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { readonly collectionName: Vec; @@ -2240,8 +2480,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; } - /** @name UpDataStructsCollectionMode (226) */ - interface UpDataStructsCollectionMode extends Enum { + /** @name UpDataStructsCollectionMode (237) */ + export interface UpDataStructsCollectionMode extends Enum { readonly isNft: boolean; readonly isFungible: boolean; readonly asFungible: u8; @@ -2249,8 +2489,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateCollectionData (227) */ - interface UpDataStructsCreateCollectionData extends Struct { + /** @name UpDataStructsCreateCollectionData (238) */ + export interface UpDataStructsCreateCollectionData extends Struct { readonly mode: UpDataStructsCollectionMode; readonly access: Option; readonly name: Vec; @@ -2263,15 +2503,15 @@ declare module '@polkadot/types/lookup' { readonly properties: Vec; } - /** @name UpDataStructsAccessMode (229) */ - interface UpDataStructsAccessMode extends Enum { + /** @name UpDataStructsAccessMode (240) */ + export interface UpDataStructsAccessMode extends Enum { readonly isNormal: boolean; readonly isAllowList: boolean; readonly type: 'Normal' | 'AllowList'; } - /** @name UpDataStructsCollectionLimits (231) */ - interface UpDataStructsCollectionLimits extends Struct { + /** @name UpDataStructsCollectionLimits (242) */ + export interface UpDataStructsCollectionLimits extends Struct { readonly accountTokenOwnershipLimit: Option; readonly sponsoredDataSize: Option; readonly sponsoredDataRateLimit: Option; @@ -2283,52 +2523,52 @@ declare module '@polkadot/types/lookup' { readonly transfersEnabled: Option; } - /** @name UpDataStructsSponsoringRateLimit (233) */ - interface UpDataStructsSponsoringRateLimit extends Enum { + /** @name UpDataStructsSponsoringRateLimit (244) */ + export interface UpDataStructsSponsoringRateLimit extends Enum { readonly isSponsoringDisabled: boolean; readonly isBlocks: boolean; readonly asBlocks: u32; readonly type: 'SponsoringDisabled' | 'Blocks'; } - /** @name UpDataStructsCollectionPermissions (236) */ - interface UpDataStructsCollectionPermissions extends Struct { + /** @name UpDataStructsCollectionPermissions (247) */ + export interface UpDataStructsCollectionPermissions extends Struct { readonly access: Option; readonly mintMode: Option; readonly nesting: Option; } - /** @name UpDataStructsNestingPermissions (238) */ - interface UpDataStructsNestingPermissions extends Struct { + /** @name UpDataStructsNestingPermissions (249) */ + export interface UpDataStructsNestingPermissions extends Struct { readonly tokenOwner: bool; readonly collectionAdmin: bool; readonly restricted: Option; } - /** @name UpDataStructsOwnerRestrictedSet (240) */ - interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} + /** @name UpDataStructsOwnerRestrictedSet (251) */ + export interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} - /** @name UpDataStructsPropertyKeyPermission (245) */ - interface UpDataStructsPropertyKeyPermission extends Struct { + /** @name UpDataStructsPropertyKeyPermission (256) */ + export interface UpDataStructsPropertyKeyPermission extends Struct { readonly key: Bytes; readonly permission: UpDataStructsPropertyPermission; } - /** @name UpDataStructsPropertyPermission (246) */ - interface UpDataStructsPropertyPermission extends Struct { + /** @name UpDataStructsPropertyPermission (257) */ + export interface UpDataStructsPropertyPermission extends Struct { readonly mutable: bool; readonly collectionAdmin: bool; readonly tokenOwner: bool; } - /** @name UpDataStructsProperty (249) */ - interface UpDataStructsProperty extends Struct { + /** @name UpDataStructsProperty (260) */ + export interface UpDataStructsProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name UpDataStructsCreateItemData (252) */ - interface UpDataStructsCreateItemData extends Enum { + /** @name UpDataStructsCreateItemData (263) */ + export interface UpDataStructsCreateItemData extends Enum { readonly isNft: boolean; readonly asNft: UpDataStructsCreateNftData; readonly isFungible: boolean; @@ -2338,24 +2578,24 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateNftData (253) */ - interface UpDataStructsCreateNftData extends Struct { + /** @name UpDataStructsCreateNftData (264) */ + export interface UpDataStructsCreateNftData extends Struct { readonly properties: Vec; } - /** @name UpDataStructsCreateFungibleData (254) */ - interface UpDataStructsCreateFungibleData extends Struct { + /** @name UpDataStructsCreateFungibleData (265) */ + export interface UpDataStructsCreateFungibleData extends Struct { readonly value: u128; } - /** @name UpDataStructsCreateReFungibleData (255) */ - interface UpDataStructsCreateReFungibleData extends Struct { + /** @name UpDataStructsCreateReFungibleData (266) */ + export interface UpDataStructsCreateReFungibleData extends Struct { readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateItemExData (258) */ - interface UpDataStructsCreateItemExData extends Enum { + /** @name UpDataStructsCreateItemExData (269) */ + export interface UpDataStructsCreateItemExData extends Enum { readonly isNft: boolean; readonly asNft: Vec; readonly isFungible: boolean; @@ -2367,27 +2607,27 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; } - /** @name UpDataStructsCreateNftExData (260) */ - interface UpDataStructsCreateNftExData extends Struct { + /** @name UpDataStructsCreateNftExData (271) */ + export interface UpDataStructsCreateNftExData extends Struct { readonly properties: Vec; readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsCreateRefungibleExSingleOwner (267) */ - interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { + /** @name UpDataStructsCreateRefungibleExSingleOwner (278) */ + export interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { readonly user: PalletEvmAccountBasicCrossAccountIdRepr; readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateRefungibleExMultipleOwners (269) */ - interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { + /** @name UpDataStructsCreateRefungibleExMultipleOwners (280) */ + export interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { readonly users: BTreeMap; readonly properties: Vec; } - /** @name PalletUniqueSchedulerCall (270) */ - interface PalletUniqueSchedulerCall extends Enum { + /** @name PalletUniqueSchedulerCall (281) */ + export interface PalletUniqueSchedulerCall extends Enum { readonly isScheduleNamed: boolean; readonly asScheduleNamed: { readonly id: U8aFixed; @@ -2411,8 +2651,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; } - /** @name FrameSupportScheduleMaybeHashed (272) */ - interface FrameSupportScheduleMaybeHashed extends Enum { + /** @name FrameSupportScheduleMaybeHashed (283) */ + export interface FrameSupportScheduleMaybeHashed extends Enum { readonly isValue: boolean; readonly asValue: Call; readonly isHash: boolean; @@ -2420,8 +2660,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Value' | 'Hash'; } - /** @name PalletConfigurationCall (273) */ - interface PalletConfigurationCall extends Enum { + /** @name PalletConfigurationCall (284) */ + export interface PalletConfigurationCall extends Enum { readonly isSetWeightToFeeCoefficientOverride: boolean; readonly asSetWeightToFeeCoefficientOverride: { readonly coeff: Option; @@ -2433,14 +2673,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride'; } - /** @name PalletTemplateTransactionPaymentCall (274) */ - type PalletTemplateTransactionPaymentCall = Null; + /** @name PalletTemplateTransactionPaymentCall (285) */ + export type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletStructureCall (275) */ - type PalletStructureCall = Null; + /** @name PalletStructureCall (286) */ + export type PalletStructureCall = Null; - /** @name PalletRmrkCoreCall (276) */ - interface PalletRmrkCoreCall extends Enum { + /** @name PalletRmrkCoreCall (287) */ + export interface PalletRmrkCoreCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { readonly metadata: Bytes; @@ -2545,8 +2785,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; } - /** @name RmrkTraitsResourceResourceTypes (282) */ - interface RmrkTraitsResourceResourceTypes extends Enum { + /** @name RmrkTraitsResourceResourceTypes (293) */ + export interface RmrkTraitsResourceResourceTypes extends Enum { readonly isBasic: boolean; readonly asBasic: RmrkTraitsResourceBasicResource; readonly isComposable: boolean; @@ -2556,16 +2796,16 @@ declare module '@polkadot/types/lookup' { readonly type: 'Basic' | 'Composable' | 'Slot'; } - /** @name RmrkTraitsResourceBasicResource (284) */ - interface RmrkTraitsResourceBasicResource extends Struct { + /** @name RmrkTraitsResourceBasicResource (295) */ + export interface RmrkTraitsResourceBasicResource extends Struct { readonly src: Option; readonly metadata: Option; readonly license: Option; readonly thumb: Option; } - /** @name RmrkTraitsResourceComposableResource (286) */ - interface RmrkTraitsResourceComposableResource extends Struct { + /** @name RmrkTraitsResourceComposableResource (297) */ + export interface RmrkTraitsResourceComposableResource extends Struct { readonly parts: Vec; readonly base: u32; readonly src: Option; @@ -2574,8 +2814,8 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceSlotResource (287) */ - interface RmrkTraitsResourceSlotResource extends Struct { + /** @name RmrkTraitsResourceSlotResource (298) */ + export interface RmrkTraitsResourceSlotResource extends Struct { readonly base: u32; readonly src: Option; readonly metadata: Option; @@ -2584,8 +2824,8 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name PalletRmrkEquipCall (290) */ - interface PalletRmrkEquipCall extends Enum { + /** @name PalletRmrkEquipCall (301) */ + export interface PalletRmrkEquipCall extends Enum { readonly isCreateBase: boolean; readonly asCreateBase: { readonly baseType: Bytes; @@ -2606,8 +2846,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; } - /** @name RmrkTraitsPartPartType (293) */ - interface RmrkTraitsPartPartType extends Enum { + /** @name RmrkTraitsPartPartType (304) */ + export interface RmrkTraitsPartPartType extends Enum { readonly isFixedPart: boolean; readonly asFixedPart: RmrkTraitsPartFixedPart; readonly isSlotPart: boolean; @@ -2615,23 +2855,23 @@ declare module '@polkadot/types/lookup' { readonly type: 'FixedPart' | 'SlotPart'; } - /** @name RmrkTraitsPartFixedPart (295) */ - interface RmrkTraitsPartFixedPart extends Struct { + /** @name RmrkTraitsPartFixedPart (306) */ + export interface RmrkTraitsPartFixedPart extends Struct { readonly id: u32; readonly z: u32; readonly src: Bytes; } - /** @name RmrkTraitsPartSlotPart (296) */ - interface RmrkTraitsPartSlotPart extends Struct { + /** @name RmrkTraitsPartSlotPart (307) */ + export interface RmrkTraitsPartSlotPart extends Struct { readonly id: u32; readonly equippable: RmrkTraitsPartEquippableList; readonly src: Bytes; readonly z: u32; } - /** @name RmrkTraitsPartEquippableList (297) */ - interface RmrkTraitsPartEquippableList extends Enum { + /** @name RmrkTraitsPartEquippableList (308) */ + export interface RmrkTraitsPartEquippableList extends Enum { readonly isAll: boolean; readonly isEmpty: boolean; readonly isCustom: boolean; @@ -2639,21 +2879,38 @@ declare module '@polkadot/types/lookup' { readonly type: 'All' | 'Empty' | 'Custom'; } - /** @name RmrkTraitsTheme (299) */ - interface RmrkTraitsTheme extends Struct { + /** @name RmrkTraitsTheme (310) */ + export interface RmrkTraitsTheme extends Struct { readonly name: Bytes; readonly properties: Vec; readonly inherit: bool; } - /** @name RmrkTraitsThemeThemeProperty (301) */ - interface RmrkTraitsThemeThemeProperty extends Struct { + /** @name RmrkTraitsThemeThemeProperty (312) */ + export interface RmrkTraitsThemeThemeProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name PalletEvmCall (303) */ - interface PalletEvmCall extends Enum { + /** @name PalletForeingAssetsModuleCall (314) */ + export interface PalletForeingAssetsModuleCall extends Enum { + readonly isRegisterForeignAsset: boolean; + readonly asRegisterForeignAsset: { + readonly owner: AccountId32; + readonly location: XcmVersionedMultiLocation; + readonly metadata: PalletForeingAssetsModuleAssetMetadata; + } & Struct; + readonly isUpdateForeignAsset: boolean; + readonly asUpdateForeignAsset: { + readonly foreignAssetId: u32; + readonly location: XcmVersionedMultiLocation; + readonly metadata: PalletForeingAssetsModuleAssetMetadata; + } & Struct; + readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset'; + } + + /** @name PalletEvmCall (315) */ + export interface PalletEvmCall extends Enum { readonly isWithdraw: boolean; readonly asWithdraw: { readonly address: H160; @@ -2697,8 +2954,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name PalletEthereumCall (307) */ - interface PalletEthereumCall extends Enum { + /** @name PalletEthereumCall (319) */ + export interface PalletEthereumCall extends Enum { readonly isTransact: boolean; readonly asTransact: { readonly transaction: EthereumTransactionTransactionV2; @@ -2706,8 +2963,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transact'; } - /** @name EthereumTransactionTransactionV2 (308) */ - interface EthereumTransactionTransactionV2 extends Enum { + /** @name EthereumTransactionTransactionV2 (320) */ + export interface EthereumTransactionTransactionV2 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumTransactionLegacyTransaction; readonly isEip2930: boolean; @@ -2717,8 +2974,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumTransactionLegacyTransaction (309) */ - interface EthereumTransactionLegacyTransaction extends Struct { + /** @name EthereumTransactionLegacyTransaction (321) */ + export interface EthereumTransactionLegacyTransaction extends Struct { readonly nonce: U256; readonly gasPrice: U256; readonly gasLimit: U256; @@ -2728,23 +2985,23 @@ declare module '@polkadot/types/lookup' { readonly signature: EthereumTransactionTransactionSignature; } - /** @name EthereumTransactionTransactionAction (310) */ - interface EthereumTransactionTransactionAction extends Enum { + /** @name EthereumTransactionTransactionAction (322) */ + export interface EthereumTransactionTransactionAction extends Enum { readonly isCall: boolean; readonly asCall: H160; readonly isCreate: boolean; readonly type: 'Call' | 'Create'; } - /** @name EthereumTransactionTransactionSignature (311) */ - interface EthereumTransactionTransactionSignature extends Struct { + /** @name EthereumTransactionTransactionSignature (323) */ + export interface EthereumTransactionTransactionSignature extends Struct { readonly v: u64; readonly r: H256; readonly s: H256; } - /** @name EthereumTransactionEip2930Transaction (313) */ - interface EthereumTransactionEip2930Transaction extends Struct { + /** @name EthereumTransactionEip2930Transaction (325) */ + export interface EthereumTransactionEip2930Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; readonly gasPrice: U256; @@ -2758,14 +3015,14 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name EthereumTransactionAccessListItem (315) */ - interface EthereumTransactionAccessListItem extends Struct { + /** @name EthereumTransactionAccessListItem (327) */ + export interface EthereumTransactionAccessListItem extends Struct { readonly address: H160; readonly storageKeys: Vec; } - /** @name EthereumTransactionEip1559Transaction (316) */ - interface EthereumTransactionEip1559Transaction extends Struct { + /** @name EthereumTransactionEip1559Transaction (328) */ + export interface EthereumTransactionEip1559Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; readonly maxPriorityFeePerGas: U256; @@ -2780,8 +3037,8 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name PalletEvmMigrationCall (317) */ - interface PalletEvmMigrationCall extends Enum { + /** @name PalletEvmMigrationCall (329) */ + export interface PalletEvmMigrationCall extends Enum { readonly isBegin: boolean; readonly asBegin: { readonly address: H160; @@ -2799,14 +3056,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Begin' | 'SetData' | 'Finish'; } - /** @name PalletSudoError (320) */ - interface PalletSudoError extends Enum { + /** @name PalletSudoError (332) */ + export interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: 'RequireSudo'; } - /** @name OrmlVestingModuleError (322) */ - interface OrmlVestingModuleError extends Enum { + /** @name OrmlVestingModuleError (334) */ + export interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; readonly isInsufficientBalanceToLock: boolean; @@ -2816,30 +3073,86 @@ declare module '@polkadot/types/lookup' { readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (324) */ - interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { + /** @name OrmlXtokensModuleError (335) */ + export interface OrmlXtokensModuleError extends Enum { + readonly isAssetHasNoReserve: boolean; + readonly isNotCrossChainTransfer: boolean; + readonly isInvalidDest: boolean; + readonly isNotCrossChainTransferableCurrency: boolean; + readonly isUnweighableMessage: boolean; + readonly isXcmExecutionFailed: boolean; + readonly isCannotReanchor: boolean; + readonly isInvalidAncestry: boolean; + readonly isInvalidAsset: boolean; + readonly isDestinationNotInvertible: boolean; + readonly isBadVersion: boolean; + readonly isDistinctReserveForAssetAndFee: boolean; + readonly isZeroFee: boolean; + readonly isZeroAmount: boolean; + readonly isTooManyAssetsBeingSent: boolean; + readonly isAssetIndexNonExistent: boolean; + readonly isFeeNotEnough: boolean; + readonly isNotSupportedMultiLocation: boolean; + readonly isMinXcmFeeNotDefined: boolean; + readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined'; + } + + /** @name OrmlTokensBalanceLock (338) */ + export interface OrmlTokensBalanceLock extends Struct { + readonly id: U8aFixed; + readonly amount: u128; + } + + /** @name OrmlTokensAccountData (340) */ + export interface OrmlTokensAccountData extends Struct { + readonly free: u128; + readonly reserved: u128; + readonly frozen: u128; + } + + /** @name OrmlTokensReserveData (342) */ + export interface OrmlTokensReserveData extends Struct { + readonly id: Null; + readonly amount: u128; + } + + /** @name OrmlTokensModuleError (344) */ + export interface OrmlTokensModuleError extends Enum { + readonly isBalanceTooLow: boolean; + readonly isAmountIntoBalanceFailed: boolean; + readonly isLiquidityRestrictions: boolean; + readonly isMaxLocksExceeded: boolean; + readonly isKeepAlive: boolean; + readonly isExistentialDeposit: boolean; + readonly isDeadAccount: boolean; + readonly isTooManyReserves: boolean; + readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves'; + } + + /** @name CumulusPalletXcmpQueueInboundChannelDetails (346) */ + export interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (325) */ - interface CumulusPalletXcmpQueueInboundState extends Enum { + /** @name CumulusPalletXcmpQueueInboundState (347) */ + export interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (328) */ - interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (350) */ + export interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; readonly isSignals: boolean; readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (331) */ - interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (353) */ + export interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; readonly signalsExist: bool; @@ -2847,15 +3160,15 @@ declare module '@polkadot/types/lookup' { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (332) */ - interface CumulusPalletXcmpQueueOutboundState extends Enum { + /** @name CumulusPalletXcmpQueueOutboundState (354) */ + export interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (334) */ - interface CumulusPalletXcmpQueueQueueConfigData extends Struct { + /** @name CumulusPalletXcmpQueueQueueConfigData (356) */ + export interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; readonly resumeThreshold: u32; @@ -2864,8 +3177,8 @@ declare module '@polkadot/types/lookup' { readonly xcmpMaxIndividualWeight: u64; } - /** @name CumulusPalletXcmpQueueError (336) */ - interface CumulusPalletXcmpQueueError extends Enum { + /** @name CumulusPalletXcmpQueueError (358) */ + export interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; readonly isBadXcm: boolean; @@ -2874,8 +3187,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (337) */ - interface PalletXcmError extends Enum { + /** @name PalletXcmError (359) */ + export interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; readonly isFiltered: boolean; @@ -2892,30 +3205,30 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (338) */ - type CumulusPalletXcmError = Null; + /** @name CumulusPalletXcmError (360) */ + export type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (339) */ - interface CumulusPalletDmpQueueConfigData extends Struct { + /** @name CumulusPalletDmpQueueConfigData (361) */ + export interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: u64; } - /** @name CumulusPalletDmpQueuePageIndexData (340) */ - interface CumulusPalletDmpQueuePageIndexData extends Struct { + /** @name CumulusPalletDmpQueuePageIndexData (362) */ + export interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (343) */ - interface CumulusPalletDmpQueueError extends Enum { + /** @name CumulusPalletDmpQueueError (365) */ + export interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (347) */ - interface PalletUniqueError extends Enum { + /** @name PalletUniqueError (369) */ + export interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; readonly isEmptyArgument: boolean; @@ -2923,8 +3236,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name PalletUniqueSchedulerScheduledV3 (350) */ - interface PalletUniqueSchedulerScheduledV3 extends Struct { + /** @name PalletUniqueSchedulerScheduledV3 (372) */ + export interface PalletUniqueSchedulerScheduledV3 extends Struct { readonly maybeId: Option; readonly priority: u8; readonly call: FrameSupportScheduleMaybeHashed; @@ -2932,8 +3245,8 @@ declare module '@polkadot/types/lookup' { readonly origin: OpalRuntimeOriginCaller; } - /** @name OpalRuntimeOriginCaller (351) */ - interface OpalRuntimeOriginCaller extends Enum { + /** @name OpalRuntimeOriginCaller (373) */ + export interface OpalRuntimeOriginCaller extends Enum { readonly isSystem: boolean; readonly asSystem: FrameSupportDispatchRawOrigin; readonly isVoid: boolean; @@ -2946,8 +3259,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; } - /** @name FrameSupportDispatchRawOrigin (352) */ - interface FrameSupportDispatchRawOrigin extends Enum { + /** @name FrameSupportDispatchRawOrigin (374) */ + export interface FrameSupportDispatchRawOrigin extends Enum { readonly isRoot: boolean; readonly isSigned: boolean; readonly asSigned: AccountId32; @@ -2955,8 +3268,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Root' | 'Signed' | 'None'; } - /** @name PalletXcmOrigin (353) */ - interface PalletXcmOrigin extends Enum { + /** @name PalletXcmOrigin (375) */ + export interface PalletXcmOrigin extends Enum { readonly isXcm: boolean; readonly asXcm: XcmV1MultiLocation; readonly isResponse: boolean; @@ -2964,26 +3277,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'Xcm' | 'Response'; } - /** @name CumulusPalletXcmOrigin (354) */ - interface CumulusPalletXcmOrigin extends Enum { + /** @name CumulusPalletXcmOrigin (376) */ + export interface CumulusPalletXcmOrigin extends Enum { readonly isRelay: boolean; readonly isSiblingParachain: boolean; readonly asSiblingParachain: u32; readonly type: 'Relay' | 'SiblingParachain'; } - /** @name PalletEthereumRawOrigin (355) */ - interface PalletEthereumRawOrigin extends Enum { + /** @name PalletEthereumRawOrigin (377) */ + export interface PalletEthereumRawOrigin extends Enum { readonly isEthereumTransaction: boolean; readonly asEthereumTransaction: H160; readonly type: 'EthereumTransaction'; } - /** @name SpCoreVoid (356) */ - type SpCoreVoid = Null; + /** @name SpCoreVoid (378) */ + export type SpCoreVoid = Null; - /** @name PalletUniqueSchedulerError (357) */ - interface PalletUniqueSchedulerError extends Enum { + /** @name PalletUniqueSchedulerError (379) */ + export interface PalletUniqueSchedulerError extends Enum { readonly isFailedToSchedule: boolean; readonly isNotFound: boolean; readonly isTargetBlockNumberInPast: boolean; @@ -2991,8 +3304,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; } - /** @name UpDataStructsCollection (358) */ - interface UpDataStructsCollection extends Struct { + /** @name UpDataStructsCollection (380) */ + export interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; readonly name: Vec; @@ -3004,8 +3317,8 @@ declare module '@polkadot/types/lookup' { readonly externalCollection: bool; } - /** @name UpDataStructsSponsorshipState (359) */ - interface UpDataStructsSponsorshipState extends Enum { + /** @name UpDataStructsSponsorshipState (381) */ + export interface UpDataStructsSponsorshipState extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; readonly asUnconfirmed: AccountId32; @@ -3014,44 +3327,44 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (360) */ - interface UpDataStructsProperties extends Struct { + /** @name UpDataStructsProperties (382) */ + export interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (361) */ - interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} + /** @name UpDataStructsPropertiesMapBoundedVec (383) */ + export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (366) */ - interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} + /** @name UpDataStructsPropertiesMapPropertyPermission (388) */ + export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (373) */ - interface UpDataStructsCollectionStats extends Struct { + /** @name UpDataStructsCollectionStats (395) */ + export interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (374) */ - interface UpDataStructsTokenChild extends Struct { + /** @name UpDataStructsTokenChild (396) */ + export interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (375) */ - interface PhantomTypeUpDataStructs extends Vec> {} + /** @name PhantomTypeUpDataStructs (397) */ + export interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (377) */ - interface UpDataStructsTokenData extends Struct { + /** @name UpDataStructsTokenData (399) */ + export interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (379) */ - interface UpDataStructsRpcCollection extends Struct { + /** @name UpDataStructsRpcCollection (401) */ + export interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; readonly name: Vec; @@ -3065,8 +3378,8 @@ declare module '@polkadot/types/lookup' { readonly readOnly: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (380) */ - interface RmrkTraitsCollectionCollectionInfo extends Struct { + /** @name RmrkTraitsCollectionCollectionInfo (402) */ + export interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; readonly max: Option; @@ -3074,8 +3387,8 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (381) */ - interface RmrkTraitsNftNftInfo extends Struct { + /** @name RmrkTraitsNftNftInfo (403) */ + export interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; readonly metadata: Bytes; @@ -3083,41 +3396,41 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (383) */ - interface RmrkTraitsNftRoyaltyInfo extends Struct { + /** @name RmrkTraitsNftRoyaltyInfo (405) */ + export interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (384) */ - interface RmrkTraitsResourceResourceInfo extends Struct { + /** @name RmrkTraitsResourceResourceInfo (406) */ + export interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; readonly pending: bool; readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (385) */ - interface RmrkTraitsPropertyPropertyInfo extends Struct { + /** @name RmrkTraitsPropertyPropertyInfo (407) */ + export interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (386) */ - interface RmrkTraitsBaseBaseInfo extends Struct { + /** @name RmrkTraitsBaseBaseInfo (408) */ + export interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (387) */ - interface RmrkTraitsNftNftChild extends Struct { + /** @name RmrkTraitsNftNftChild (409) */ + export interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (389) */ - interface PalletCommonError extends Enum { + /** @name PalletCommonError (411) */ + export interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; readonly isNoPermission: boolean; @@ -3155,8 +3468,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (391) */ - interface PalletFungibleError extends Enum { + /** @name PalletFungibleError (413) */ + export interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; readonly isFungibleItemsDontHaveData: boolean; @@ -3165,13 +3478,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (392) */ - interface PalletRefungibleItemData extends Struct { + /** @name PalletRefungibleItemData (414) */ + export interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } - /** @name PalletRefungibleError (397) */ - interface PalletRefungibleError extends Enum { + /** @name PalletRefungibleError (419) */ + export interface PalletRefungibleError extends Enum { readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isWrongRefungiblePieces: boolean; readonly isRepartitionWhileNotOwningAllPieces: boolean; @@ -3180,29 +3493,29 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletNonfungibleItemData (398) */ - interface PalletNonfungibleItemData extends Struct { + /** @name PalletNonfungibleItemData (420) */ + export interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (400) */ - interface UpDataStructsPropertyScope extends Enum { + /** @name UpDataStructsPropertyScope (422) */ + export interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; readonly isEth: boolean; readonly type: 'None' | 'Rmrk' | 'Eth'; } - /** @name PalletNonfungibleError (402) */ - interface PalletNonfungibleError extends Enum { + /** @name PalletNonfungibleError (424) */ + export interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; readonly isCantBurnNftWithChildren: boolean; readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (403) */ - interface PalletStructureError extends Enum { + /** @name PalletStructureError (425) */ + export interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; readonly isBreadthLimit: boolean; @@ -3210,8 +3523,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletRmrkCoreError (404) */ - interface PalletRmrkCoreError extends Enum { + /** @name PalletRmrkCoreError (426) */ + export interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; readonly isRmrkPropertyValueIsTooLong: boolean; @@ -3234,8 +3547,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } - /** @name PalletRmrkEquipError (406) */ - interface PalletRmrkEquipError extends Enum { + /** @name PalletRmrkEquipError (428) */ + export interface PalletRmrkEquipError extends Enum { readonly isPermissionError: boolean; readonly isNoAvailableBaseId: boolean; readonly isNoAvailablePartId: boolean; @@ -3246,8 +3559,17 @@ declare module '@polkadot/types/lookup' { readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; } - /** @name PalletEvmError (409) */ - interface PalletEvmError extends Enum { + /** @name PalletForeingAssetsModuleError (429) */ + export interface PalletForeingAssetsModuleError extends Enum { + readonly isBadLocation: boolean; + readonly isMultiLocationExisted: boolean; + readonly isAssetIdNotExists: boolean; + readonly isAssetIdExisted: boolean; + readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted'; + } + + /** @name PalletEvmError (432) */ + export interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; readonly isPaymentOverflow: boolean; @@ -3257,8 +3579,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (412) */ - interface FpRpcTransactionStatus extends Struct { + /** @name FpRpcTransactionStatus (435) */ + export interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; readonly from: H160; @@ -3268,11 +3590,11 @@ declare module '@polkadot/types/lookup' { readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (414) */ - interface EthbloomBloom extends U8aFixed {} + /** @name EthbloomBloom (437) */ + export interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (416) */ - interface EthereumReceiptReceiptV3 extends Enum { + /** @name EthereumReceiptReceiptV3 (439) */ + export interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; readonly isEip2930: boolean; @@ -3282,23 +3604,23 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (417) */ - interface EthereumReceiptEip658ReceiptData extends Struct { + /** @name EthereumReceiptEip658ReceiptData (440) */ + export interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; readonly logsBloom: EthbloomBloom; readonly logs: Vec; } - /** @name EthereumBlock (418) */ - interface EthereumBlock extends Struct { + /** @name EthereumBlock (441) */ + export interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (419) */ - interface EthereumHeader extends Struct { + /** @name EthereumHeader (442) */ + export interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; readonly beneficiary: H160; @@ -3316,46 +3638,46 @@ declare module '@polkadot/types/lookup' { readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (420) */ - interface EthereumTypesHashH64 extends U8aFixed {} + /** @name EthereumTypesHashH64 (443) */ + export interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (425) */ - interface PalletEthereumError extends Enum { + /** @name PalletEthereumError (448) */ + export interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (426) */ - interface PalletEvmCoderSubstrateError extends Enum { + /** @name PalletEvmCoderSubstrateError (449) */ + export interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name PalletEvmContractHelpersSponsoringModeT (427) */ - interface PalletEvmContractHelpersSponsoringModeT extends Enum { + /** @name PalletEvmContractHelpersSponsoringModeT (450) */ + export interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; readonly isGenerous: boolean; readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (429) */ - interface PalletEvmContractHelpersError extends Enum { + /** @name PalletEvmContractHelpersError (452) */ + export interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly type: 'NoPermission'; } - /** @name PalletEvmMigrationError (430) */ - interface PalletEvmMigrationError extends Enum { + /** @name PalletEvmMigrationError (453) */ + export interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (432) */ - interface SpRuntimeMultiSignature extends Enum { + /** @name SpRuntimeMultiSignature (455) */ + export interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; readonly isSr25519: boolean; @@ -3365,34 +3687,34 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (433) */ - interface SpCoreEd25519Signature extends U8aFixed {} + /** @name SpCoreEd25519Signature (456) */ + export interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (435) */ - interface SpCoreSr25519Signature extends U8aFixed {} + /** @name SpCoreSr25519Signature (458) */ + export interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (436) */ - interface SpCoreEcdsaSignature extends U8aFixed {} + /** @name SpCoreEcdsaSignature (459) */ + export interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (439) */ - type FrameSystemExtensionsCheckSpecVersion = Null; + /** @name FrameSystemExtensionsCheckSpecVersion (462) */ + export type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (440) */ - type FrameSystemExtensionsCheckGenesis = Null; + /** @name FrameSystemExtensionsCheckGenesis (463) */ + export type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (443) */ - interface FrameSystemExtensionsCheckNonce extends Compact {} + /** @name FrameSystemExtensionsCheckNonce (466) */ + export interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (444) */ - type FrameSystemExtensionsCheckWeight = Null; + /** @name FrameSystemExtensionsCheckWeight (467) */ + export type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (445) */ - interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (468) */ + export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (446) */ - type OpalRuntimeRuntime = Null; + /** @name OpalRuntimeRuntime (469) */ + export type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (447) */ - type PalletEthereumFakeTransactionFinalizer = Null; + /** @name PalletEthereumFakeTransactionFinalizer (470) */ + export type PalletEthereumFakeTransactionFinalizer = Null; } // declare module From 2eb5d08eae89fe1967319f244c7b0c4308cabb81 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Tue, 23 Aug 2022 05:14:28 +0000 Subject: [PATCH 0489/1274] add extension class to playgrounds + add creteAccounts method + move addCollectionAdmin tests to playgrounds --- tests/src/addCollectionAdmin.test.ts | 156 +++++++++++------------ tests/src/util/playgrounds/index.ts | 49 +------ tests/src/util/playgrounds/unique.dev.ts | 90 +++++++++++++ tests/src/util/playgrounds/unique.ts | 2 +- 4 files changed, 166 insertions(+), 131 deletions(-) create mode 100644 tests/src/util/playgrounds/unique.dev.ts diff --git a/tests/src/addCollectionAdmin.test.ts b/tests/src/addCollectionAdmin.test.ts index 100c572451..1fc77fa21f 100644 --- a/tests/src/addCollectionAdmin.test.ts +++ b/tests/src/addCollectionAdmin.test.ts @@ -14,136 +14,122 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {ApiPromise} from '@polkadot/api'; +import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api'; -import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, destroyCollectionExpectSuccess, getAdminList, normalizeAccountId, queryCollectionExpectSuccess} from './util/helpers'; +import {usingPlaygrounds} from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; +let donor: IKeyringPair; + +before(async () => { + await usingPlaygrounds(async (_, privateKeyWrapper) => { + donor = privateKeyWrapper('//Alice'); + }); +}); + describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => { it('Add collection admin.', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess(); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper) => { + const [alice, bob] = await helper.arrange.creteAccounts([10n, 10n], donor); + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); - const collection = await queryCollectionExpectSuccess(api, collectionId); - expect(collection.owner.toString()).to.be.equal(alice.address); + const collection = await helper.collection.getData(collectionId); + expect(collection?.normalizedOwner!).to.be.equal(alice.address); - const changeAdminTx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(bob.address)); - await submitTransactionAsync(alice, changeAdminTx); + await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address}); - const adminListAfterAddAdmin = await getAdminList(api, collectionId); - expect(adminListAfterAddAdmin).to.be.deep.contains(normalizeAccountId(bob.address)); + const adminListAfterAddAdmin = await helper.collection.getAdmins(collectionId); + expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: bob.address}); }); }); }); describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => { it("Not owner can't add collection admin.", async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess(); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//CHARLIE'); - - const collection = await queryCollectionExpectSuccess(api, collectionId); - expect(collection.owner.toString()).to.be.equal(alice.address); - - const adminListAfterAddAdmin = await getAdminList(api, collectionId); - expect(adminListAfterAddAdmin).to.be.not.deep.contains(normalizeAccountId(bob.address)); - - const changeAdminTxCharlie = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(charlie.address)); - await expect(submitTransactionAsync(bob, changeAdminTxCharlie)).to.be.rejected; - - const adminListAfterAddNewAdmin = await getAdminList(api, collectionId); - expect(adminListAfterAddNewAdmin).to.be.not.deep.contains(normalizeAccountId(bob.address)); - expect(adminListAfterAddNewAdmin).to.be.not.deep.contains(normalizeAccountId(charlie.address)); + await usingPlaygrounds(async (helper) => { + const [alice, bob, charlie] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor); + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); + + const collection = await helper.collection.getData(collectionId); + expect(collection?.normalizedOwner).to.be.equal(alice.address); + + const changeAdminTxBob = async () => helper.collection.addAdmin(bob, collectionId, {Substrate: bob.address}); + const changeAdminTxCharlie = async () => helper.collection.addAdmin(bob, collectionId, {Substrate: charlie.address}); + await expect(changeAdminTxCharlie()).to.be.rejected; + await expect(changeAdminTxBob()).to.be.rejected; + + const adminListAfterAddAdmin = await helper.collection.getAdmins(collectionId); + expect(adminListAfterAddAdmin).to.be.not.deep.contains({Substrate: charlie.address}); + expect(adminListAfterAddAdmin).to.be.not.deep.contains({Substrate: bob.address}); }); }); it("Admin can't add collection admin.", async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess(); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//CHARLIE'); - - const collection = await queryCollectionExpectSuccess(api, collectionId); - expect(collection.owner.toString()).to.be.equal(alice.address); - - const changeAdminTx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(bob.address)); - await submitTransactionAsync(alice, changeAdminTx); - - const adminListAfterAddAdmin = await getAdminList(api, collectionId); - expect(adminListAfterAddAdmin).to.be.deep.contains(normalizeAccountId(bob.address)); - - const changeAdminTxCharlie = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(charlie.address)); - await expect(submitTransactionAsync(bob, changeAdminTxCharlie)).to.be.rejected; - - const adminListAfterAddNewAdmin = await getAdminList(api, collectionId); - expect(adminListAfterAddNewAdmin).to.be.deep.contains(normalizeAccountId(bob.address)); - expect(adminListAfterAddNewAdmin).to.be.not.deep.contains(normalizeAccountId(charlie.address)); + await usingPlaygrounds(async (helper) => { + const [alice, bob, charlie] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor); + const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); + + await collection.addAdmin(alice, {Substrate: bob.address}); + + const adminListAfterAddAdmin = await collection.getAdmins(); + expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: bob.address}); + + const changeAdminTxCharlie = async () => collection.addAdmin(bob, {Substrate: charlie.address}); + await expect(changeAdminTxCharlie()).to.be.rejected; + + const adminListAfterAddNewAdmin = await collection.getAdmins(); + expect(adminListAfterAddNewAdmin).to.be.deep.contains({Substrate: bob.address}); + expect(adminListAfterAddNewAdmin).to.be.not.deep.contains({Substrate: charlie.address}); }); }); it("Can't add collection admin of not existing collection.", async () => { - await usingApi(async (api, privateKeyWrapper) => { + await usingPlaygrounds(async (helper) => { + const [alice, bob] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor); // tslint:disable-next-line: no-bitwise const collectionId = (1 << 32) - 1; - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const changeOwnerTx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(bob.address)); - await expect(submitTransactionExpectFailAsync(alice, changeOwnerTx)).to.be.rejected; + const addAdminTx = async () => helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); + await expect(addAdminTx()).to.be.rejected; // Verifying that nothing bad happened (network is live, new collections can be created, etc.) - await createCollectionExpectSuccess(); + await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); }); }); it("Can't add an admin to a destroyed collection.", async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess(); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - await destroyCollectionExpectSuccess(collectionId); - const changeOwnerTx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(bob.address)); - await expect(submitTransactionExpectFailAsync(alice, changeOwnerTx)).to.be.rejected; + await usingPlaygrounds(async (helper) => { + const [alice, bob] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor); + const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); + + await collection.burn(alice); + const addAdminTx = async () => collection.addAdmin(alice, {Substrate: bob.address}); + await expect(addAdminTx()).to.be.rejected; // Verifying that nothing bad happened (network is live, new collections can be created, etc.) - await createCollectionExpectSuccess(); + await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); }); }); it('Add an admin to a collection that has reached the maximum number of admins limit', async () => { - await usingApi(async (api: ApiPromise, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const accounts = [ - privateKeyWrapper('//AdminTest/1').address, - privateKeyWrapper('//AdminTest/2').address, - privateKeyWrapper('//AdminTest/3').address, - privateKeyWrapper('//AdminTest/4').address, - privateKeyWrapper('//AdminTest/5').address, - privateKeyWrapper('//AdminTest/6').address, - privateKeyWrapper('//AdminTest/7').address, - ]; - const collectionId = await createCollectionExpectSuccess(); - - const chainAdminLimit = (api.consts.common.collectionAdminsLimit as any).toNumber(); + await usingPlaygrounds(async (helper) => { + const [alice, ...accounts] = await helper.arrange.creteAccounts([10n, 0n, 0n, 0n, 0n, 0n, 0n, 0n], donor); + const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); + + const chainAdminLimit = (helper.api!.consts.common.collectionAdminsLimit as any).toNumber(); expect(chainAdminLimit).to.be.equal(5); for (let i = 0; i < chainAdminLimit; i++) { - await addCollectionAdminExpectSuccess(alice, collectionId, accounts[i]); - const adminListAfterAddAdmin = await getAdminList(api, collectionId); - expect(adminListAfterAddAdmin).to.be.deep.contains(normalizeAccountId(accounts[i])); + await collection.addAdmin(alice, {Substrate: accounts[i].address}); + const adminListAfterAddAdmin = await collection.getAdmins(); + expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: accounts[i].address}); } - const tx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(accounts[chainAdminLimit])); - await expect(submitTransactionExpectFailAsync(alice, tx)).to.be.rejected; + const addExtraAdminTx = async () => collection.addAdmin(alice, {Substrate: accounts[chainAdminLimit].address}); + await expect(addExtraAdminTx()).to.be.rejected; }); }); }); diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index 621d1c1800..c2b59cc025 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -2,15 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import {IKeyringPair} from '@polkadot/types/types'; -import {UniqueHelper} from './unique'; import config from '../../config'; import '../../interfaces/augment-api-events'; -import * as defs from '../../interfaces/definitions'; -import {ApiPromise, WsProvider} from '@polkadot/api'; - +import {DevUniqueHelper} from './unique.dev'; class SilentLogger { - log(msg: any, level: any): void {} + log(msg: any, level: any): void { } level = { ERROR: 'ERROR' as const, WARNING: 'WARNING' as const, @@ -18,45 +15,7 @@ class SilentLogger { }; } - -class DevUniqueHelper extends UniqueHelper { - async connect(wsEndpoint: string, listeners?: any): Promise { - const wsProvider = new WsProvider(wsEndpoint); - this.api = new ApiPromise({ - provider: wsProvider, - signedExtensions: { - ContractHelpers: { - extrinsic: {}, - payload: {}, - }, - FakeTransactionFinalizer: { - extrinsic: {}, - payload: {}, - }, - }, - rpc: { - unique: defs.unique.rpc, - rmrk: defs.rmrk.rpc, - eth: { - feeHistory: { - description: 'Dummy', - params: [], - type: 'u8', - }, - maxPriorityFeePerGas: { - description: 'Dummy', - params: [], - type: 'u8', - }, - }, - }, - }); - await this.api.isReadyOrError; - this.network = await UniqueHelper.detectNetwork(this.api); - } -} - -export const usingPlaygrounds = async (code: (helper: UniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { +export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { // TODO: Remove, this is temporary: Filter unneeded API output // (Jaco promised it will be removed in the next version) const consoleErr = console.error; @@ -83,7 +42,7 @@ export const usingPlaygrounds = async (code: (helper: UniqueHelper, privateKey: const ss58Format = helper.chain.getChainProperties().ss58Format; const privateKey = (seed: string) => helper.util.fromSeed(seed, ss58Format); await code(helper, privateKey); - } + } finally { await helper.disconnect(); console.error = consoleErr; diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts new file mode 100644 index 0000000000..2e098bb73b --- /dev/null +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -0,0 +1,90 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +import {mnemonicGenerate} from '@polkadot/util-crypto'; +import {UniqueHelper} from './unique'; +import {IKeyringPair} from '@polkadot/types/types'; +import {ApiPromise, WsProvider} from '@polkadot/api'; +import * as defs from '../../interfaces/definitions'; + + +export class DevUniqueHelper extends UniqueHelper { + /** + * Arrange methods for tests + */ + arrange: UniqueArrange; + + constructor(logger: { log: (msg: any, level: any) => void, level: any }) { + super(logger); + this.arrange = new UniqueArrange(this); + } + + async connect(wsEndpoint: string, listeners?: any): Promise { + const wsProvider = new WsProvider(wsEndpoint); + this.api = new ApiPromise({ + provider: wsProvider, + signedExtensions: { + ContractHelpers: { + extrinsic: {}, + payload: {}, + }, + FakeTransactionFinalizer: { + extrinsic: {}, + payload: {}, + }, + }, + rpc: { + unique: defs.unique.rpc, + rmrk: defs.rmrk.rpc, + eth: { + feeHistory: { + description: 'Dummy', + params: [], + type: 'u8', + }, + maxPriorityFeePerGas: { + description: 'Dummy', + params: [], + type: 'u8', + }, + }, + }, + }); + await this.api.isReadyOrError; + this.network = await UniqueHelper.detectNetwork(this.api); + } +} + +class UniqueArrange { + helper: UniqueHelper; + + constructor(helper: UniqueHelper) { + this.helper = helper; + } + + /** + * Generates accounts with the specified UNQ token balance + * @param balances balances for generated accounts. Each balance will be multiplied by the token nominal. + * @param donor donor account for balances + * @returns array of newly created accounts + * @example const [acc1, acc2, acc3] = await createAccounts([0n, 10n, 20n], donor); + */ + creteAccounts = async (balances: bigint[], donor: IKeyringPair): Promise => { + let nonce = await this.helper.chain.getNonce(donor.address); + const tokenNominal = this.helper.balance.getOneTokenNominal(); + const transactions = []; + const accounts = []; + for (const balance of balances) { + const recepient = this.helper.util.fromSeed(mnemonicGenerate()); + accounts.push(recepient); + if (balance !== 0n) { + const tx = this.helper.constructApiCall('api.tx.balances.transfer', [{Id: recepient.address}, balance * tokenNominal]); + transactions.push(this.helper.signTransaction(donor, tx, 'account generation', {nonce})); + nonce++; + } + } + + await Promise.all(transactions); + return accounts; + }; +} \ No newline at end of file diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 24981c7a28..c006b02c98 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -439,7 +439,7 @@ class ChainHelperBase { return this.transactionStatus.FAIL; } - signTransaction(sender: TSigner, transaction: any, label = 'transaction', options = null) { + signTransaction(sender: TSigner, transaction: any, label = 'transaction', options: any = null) { const sign = (callback: any) => { if(options !== null) return transaction.signAndSend(sender, options, callback); return transaction.signAndSend(sender, callback); From 57fb867d0a8ea997c12076a8e0424a90ad729158 Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Tue, 23 Aug 2022 13:12:47 +0700 Subject: [PATCH 0490/1274] Remove currency adapter --- runtime/common/config/xcm.rs | 2 +- runtime/opal/src/xcm_config.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs index 6e6b881342..37abd61428 100644 --- a/runtime/common/config/xcm.rs +++ b/runtime/common/config/xcm.rs @@ -399,7 +399,7 @@ where type Call = Call; type XcmSender = XcmRouter; // How to withdraw and deposit an asset. - type AssetTransactor = LocalAssetTransactor; + type AssetTransactor = AssetTransactors; type OriginConverter = XcmOriginToTransactDispatchOrigin; type IsReserve = IsReserve; type IsTeleporter = (); // Teleportation is disabled diff --git a/runtime/opal/src/xcm_config.rs b/runtime/opal/src/xcm_config.rs index 3327e0f760..0d008a02bb 100644 --- a/runtime/opal/src/xcm_config.rs +++ b/runtime/opal/src/xcm_config.rs @@ -32,7 +32,7 @@ use xcm::{ v1::{BodyId, Junction::*, Junctions::*, MultiLocation, NetworkId}, }; use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter, LocationInverter, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, From 565dfea9e629a8362085fcc63716e4f7f95f72a4 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 23 Aug 2022 06:18:48 +0000 Subject: [PATCH 0491/1274] chore: remove fractionalizer compiled data --- .../src/eth/fractionalizer/Fractionalizer.bin | 1 - .../eth/fractionalizer/FractionalizerAbi.json | 142 --------------- tests/src/eth/refungibleAbi.json | 167 ------------------ 3 files changed, 310 deletions(-) delete mode 100644 tests/src/eth/fractionalizer/Fractionalizer.bin delete mode 100644 tests/src/eth/fractionalizer/FractionalizerAbi.json delete mode 100644 tests/src/eth/refungibleAbi.json diff --git a/tests/src/eth/fractionalizer/Fractionalizer.bin b/tests/src/eth/fractionalizer/Fractionalizer.bin deleted file mode 100644 index 7cfd83958f..0000000000 --- a/tests/src/eth/fractionalizer/Fractionalizer.bin +++ /dev/null @@ -1 +0,0 @@ -60c0604052600a60805269526546756e6769626c6560b01b60a0527fcdb72fd4e1d0d6d4eebd7ab142113ec2b4b06ddb24324db5c287ef01ab484d6b60055534801561004a57600080fd5b50600480546001600160a01b0319163317905561137a8061006c6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063115091401461005c5780631b191ea214610071578063d470e60f14610084578063dbc38ad214610097578063eb292412146100aa575b600080fd5b61006f61006a366004610f85565b6100bd565b005b61006f61007f366004610ff2565b61035b565b61006f61009236600461108c565b6104c0565b61006f6100a53660046110b8565b61089d565b61006f6100b8366004611114565b610ee0565b6004546001600160a01b031633146100f05760405162461bcd60e51b81526004016100e79061114d565b60405180910390fd5b6000546001600160a01b0316156101495760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b60008190506000816001600160a01b031663d34b55b86040518163ffffffff1660e01b81526004016000604051808303816000875af1158015610190573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101b8919081019061118b565b905060055481805190602001201461022f5760405162461bcd60e51b815260206004820152603460248201527f57726f6e6720636f6c6c656374696f6e20747970652e20436f6c6c656374696f604482015273371034b9903737ba103932b33ab733b4b136329760611b60648201526084016100e7565b816001600160a01b03166304a460536040518163ffffffff1660e01b81526004016020604051808303816000875af115801561026f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610293919061125b565b6103055760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a657220636f6e74726163742073686f756c64206260448201527f6520616e2061646d696e206f662074686520636f6c6c656374696f6e0000000060648201526084016100e7565b600080546001600160a01b0319166001600160a01b0385169081179091556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef9060200160405180910390a1505050565b6004546001600160a01b031633146103855760405162461bcd60e51b81526004016100e79061114d565b6000546001600160a01b0316156103de5760405162461bcd60e51b815260206004820152601d60248201527f52465420636f6c6c656374696f6e20697320616c72656164792073657400000060448201526064016100e7565b6040516344a68ad560e01b8152736c4e9fe1ae37a41e93cee429e8e1881abdcbb54f9081906344a68ad590610421908a908a908a908a908a908a906004016112a1565b6020604051808303816000875af1158015610440573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046491906112ea565b600080546001600160a01b0319166001600160a01b039290921691821790556040519081527f7186a599bf2297b1f4c8957d30b0965291eee0021a5f9a0aeb54dcbd1ffdceef906020015b60405180910390a150505050505050565b6000546001600160a01b03166105145760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b6000546001600160a01b038381169116146105685760405162461bcd60e51b81526020600482015260146024820152732bb937b7339029232a1031b7b63632b1ba34b7b760611b60448201526064016100e7565b600080546040516355bb7d6360e11b8152600481018490526001600160a01b039091169190829063ab76fac690602401602060405180830381865afa1580156105b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d991906112ea565b6001600160a01b03808216600090815260036020908152604091829020825180840190935280549093168083526001909301549082015291925061065f5760405162461bcd60e51b815260206004820181905260248201527f4e6f20636f72726573706f6e64696e67204e465420746f6b656e20666f756e6460448201526064016100e7565b6000829050806001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c69190611307565b6040516370a0823160e01b81523360048201526001600160a01b038316906370a0823190602401602060405180830381865afa15801561070a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072e9190611307565b1461078a5760405162461bcd60e51b815260206004820152602660248201527f4e6f7420616c6c2070696563657320617265206f776e6564206279207468652060448201526531b0b63632b960d11b60648201526084016100e7565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd906107ba90339030908a90600401611320565b600060405180830381600087803b1580156107d457600080fd5b505af11580156107e8573d6000803e3d6000fd5b5050835160208501516040516323b872dd60e01b81526001600160a01b0390921693506323b872dd92506108229130913391600401611320565b600060405180830381600087803b15801561083c57600080fd5b505af1158015610850573d6000803e3d6000fd5b5050835160208501516040517fe9e9808d24ff79ccc3b1ecf48be7b2d11591adccc452150d0d7947cb48eb0d53945061088d935087929190611320565b60405180910390a1505050505050565b6000546001600160a01b03166108f15760405162461bcd60e51b81526020600482015260196024820152781491950818dbdb1b1958dd1a5bdb881a5cc81b9bdd081cd95d603a1b60448201526064016100e7565b600080546001600160a01b0385811683526001602081905260409093205491169160ff90911615151461098c5760405162461bcd60e51b815260206004820152603c60248201527f4672616374696f6e616c697a6174696f6e206f66207468697320636f6c6c656360448201527f74696f6e206973206e6f7420616c6c6f7765642062792061646d696e0000000060648201526084016100e7565b6040516331a9108f60e11b81526004810184905233906001600160a01b03861690636352211e90602401602060405180830381865afa1580156109d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f791906112ea565b6001600160a01b031614610a5d5760405162461bcd60e51b815260206004820152602760248201527f4f6e6c7920746f6b656e206f776e657220636f756c64206672616374696f6e616044820152661b1a5e99481a5d60ca1b60648201526084016100e7565b6040516323b872dd60e01b81526001600160a01b038516906323b872dd90610a8d90339030908890600401611320565b600060405180830381600087803b158015610aa757600080fd5b505af1158015610abb573d6000803e3d6000fd5b505050506001600160a01b0384166000908152600260209081526040808320868452909152812054819081908103610d0757836001600160a01b03166375794a3c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4f9190611307565b6040516340c10f1960e01b8152306004820152602481018290529093506001600160a01b038516906340c10f19906044016020604051808303816000875af1158015610b9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc3919061125b565b506040516355bb7d6360e11b8152600481018490526001600160a01b0385169063ab76fac690602401602060405180830381865afa158015610c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2d91906112ea565b6001600160a01b0388811660008181526002602090815260408083208c84528252808320899055805180820182528481528083018d8152878716808652600390945293829020905181546001600160a01b0319169616959095178555915160019094019390935551630217888360e11b81526004810191909152602481018990529193508392509063042f1106906044016020604051808303816000875af1158015610cdd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d01919061125b565b50610d98565b6001600160a01b0387811660009081526002602090815260408083208a8452909152908190205490516355bb7d6360e11b8152600481018290529094509085169063ab76fac690602401602060405180830381865afa158015610d6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9291906112ea565b91508190505b60405163d2418ca760e01b81526001600160801b03861660048201526001600160a01b0382169063d2418ca7906024016020604051808303816000875af1158015610de7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0b919061125b565b5060405163a9059cbb60e01b81523360048201526001600160801b03861660248201526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610e61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e85919061125b565b50604080516001600160a01b03808a168252602082018990528416918101919091526001600160801b03861660608201527f29f372538523984f33874da1b50e596ce0f180a6eb04d7ff22bb2ce80e1576b6906080016104af565b6004546001600160a01b03163314610f0a5760405162461bcd60e51b81526004016100e79061114d565b6001600160a01b038216600081815260016020908152604091829020805460ff19168515159081179091558251938452908301527f6dad0aed33f4b7f07095619b668698e17943fd9f4c83e7cfcc7f6dd880a11588910160405180910390a15050565b6001600160a01b0381168114610f8257600080fd5b50565b600060208284031215610f9757600080fd5b8135610fa281610f6d565b9392505050565b60008083601f840112610fbb57600080fd5b50813567ffffffffffffffff811115610fd357600080fd5b602083019150836020828501011115610feb57600080fd5b9250929050565b6000806000806000806060878903121561100b57600080fd5b863567ffffffffffffffff8082111561102357600080fd5b61102f8a838b01610fa9565b9098509650602089013591508082111561104857600080fd5b6110548a838b01610fa9565b9096509450604089013591508082111561106d57600080fd5b5061107a89828a01610fa9565b979a9699509497509295939492505050565b6000806040838503121561109f57600080fd5b82356110aa81610f6d565b946020939093013593505050565b6000806000606084860312156110cd57600080fd5b83356110d881610f6d565b92506020840135915060408401356001600160801b03811681146110fb57600080fd5b809150509250925092565b8015158114610f8257600080fd5b6000806040838503121561112757600080fd5b823561113281610f6d565b9150602083013561114281611106565b809150509250929050565b6020808252600e908201526d27b7363c9037bbb732b91031b0b760911b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561119e57600080fd5b825167ffffffffffffffff808211156111b657600080fd5b818501915085601f8301126111ca57600080fd5b8151818111156111dc576111dc611175565b604051601f8201601f19908116603f0116810190838211818310171561120457611204611175565b81604052828152888684870101111561121c57600080fd5b600093505b8284101561123e5784840186015181850187015292850192611221565b8284111561124f5760008684830101525b98975050505050505050565b60006020828403121561126d57600080fd5b8151610fa281611106565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006112b560608301888a611278565b82810360208401526112c8818789611278565b905082810360408401526112dd818587611278565b9998505050505050505050565b6000602082840312156112fc57600080fd5b8151610fa281610f6d565b60006020828403121561131957600080fd5b5051919050565b6001600160a01b03938416815291909216602082015260408101919091526060019056fea2646970667358221220a118fe8c3b83b3933baa7bfe084ed165a014ec509367252e5c99e1a3332d000364736f6c634300080f0033 \ No newline at end of file diff --git a/tests/src/eth/fractionalizer/FractionalizerAbi.json b/tests/src/eth/fractionalizer/FractionalizerAbi.json deleted file mode 100644 index 295d68ecc1..0000000000 --- a/tests/src/eth/fractionalizer/FractionalizerAbi.json +++ /dev/null @@ -1,142 +0,0 @@ -[ - { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "_collection", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "_status", - "type": "bool" - } - ], - "name": "AllowListSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "_rftToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "_nftCollection", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_nftTokenId", - "type": "uint256" - } - ], - "name": "Defractionalized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "_collection", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "_rftToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "_amount", - "type": "uint128" - } - ], - "name": "Fractionalized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "_collection", - "type": "address" - } - ], - "name": "RFTCollectionSet", - "type": "event" - }, - { - "inputs": [ - { "internalType": "string", "name": "_name", "type": "string" }, - { "internalType": "string", "name": "_description", "type": "string" }, - { "internalType": "string", "name": "_tokenPrefix", "type": "string" } - ], - "name": "createAndSetRFTCollection", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "_collection", "type": "address" }, - { "internalType": "uint256", "name": "_token", "type": "uint256" }, - { "internalType": "uint128", "name": "_pieces", "type": "uint128" } - ], - "name": "nft2rft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "_collection", "type": "address" }, - { "internalType": "uint256", "name": "_token", "type": "uint256" } - ], - "name": "rft2nft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "collection", "type": "address" }, - { "internalType": "bool", "name": "status", "type": "bool" } - ], - "name": "setNftCollectionIsAllowed", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "_collection", "type": "address" } - ], - "name": "setRFTCollection", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/tests/src/eth/refungibleAbi.json b/tests/src/eth/refungibleAbi.json deleted file mode 100644 index 1b50a797b1..0000000000 --- a/tests/src/eth/refungibleAbi.json +++ /dev/null @@ -1,167 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "address", "name": "newAdmin", "type": "address" } - ], - "name": "addCollectionAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "newAdmin", "type": "uint256" } - ], - "name": "addCollectionAdminSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "user", "type": "address" } - ], - "name": "addToCollectionAllowList", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], - "name": "collectionProperty", - "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "confirmCollectionSponsorship", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "contractAddress", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], - "name": "deleteCollectionProperty", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "admin", "type": "address" } - ], - "name": "removeCollectionAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "admin", "type": "uint256" } - ], - "name": "removeCollectionAdminSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "user", "type": "address" } - ], - "name": "removeFromCollectionAllowList", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint8", "name": "mode", "type": "uint8" }], - "name": "setCollectionAccess", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "string", "name": "limit", "type": "string" }, - { "internalType": "uint32", "name": "value", "type": "uint32" } - ], - "name": "setCollectionLimit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "string", "name": "limit", "type": "string" }, - { "internalType": "bool", "name": "value", "type": "bool" } - ], - "name": "setCollectionLimit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "bool", "name": "mode", "type": "bool" }], - "name": "setCollectionMintMode", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }], - "name": "setCollectionNesting", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bool", "name": "enable", "type": "bool" }, - { - "internalType": "address[]", - "name": "collections", - "type": "address[]" - } - ], - "name": "setCollectionNesting", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "string", "name": "key", "type": "string" }, - { "internalType": "bytes", "name": "value", "type": "bytes" } - ], - "name": "setCollectionProperty", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "sponsor", "type": "address" } - ], - "name": "setCollectionSponsor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" } - ], - "name": "supportsInterface", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - } -] From b24c73be918e25e048126127a4f26c52a0c6d65c Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 23 Aug 2022 06:18:48 +0000 Subject: [PATCH 0492/1274] feature(common-pallet): add changeOwner method --- pallets/common/src/erc.rs | 24 +- pallets/fungible/src/stubs/UniqueFungible.raw | Bin 2813 -> 2824 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 198 +++++++------ pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4184 -> 4211 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 88 +++--- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4211 -> 4238 bytes .../refungible/src/stubs/UniqueRefungible.sol | 272 +++++++++--------- tests/src/eth/api/UniqueFungible.sol | 94 +++--- tests/src/eth/api/UniqueNFT.sol | 56 ++-- tests/src/eth/api/UniqueRefungible.sol | 182 ++++++------ tests/src/eth/collectionAdmin.test.ts | 49 ++++ tests/src/eth/fungibleAbi.json | 9 + tests/src/eth/nonFungibleAbi.json | 9 + tests/src/eth/reFungibleAbi.json | 9 + 14 files changed, 574 insertions(+), 416 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index be4e5db414..a00696d0ef 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -431,6 +431,27 @@ where }; Ok(mode.into()) } + + /// Changes collection owner + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner + fn change_owner(&mut self, caller: caller, new_owner: address) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let new_owner = T::CrossAccountId::from_eth(new_owner); + self.change_owner_internal(caller, new_owner) + } + +impl CollectionHandle +where + T::AccountId: From<[u8; 32]>, +{ + + fn change_owner_internal(&mut self, caller: T::CrossAccountId, new_owner: T::CrossAccountId) -> Result { + self.check_is_owner(&caller).map_err(dispatch_to_evm::)?; + self.collection.owner = new_owner.as_sub().clone(); + save(self) + } } fn check_is_owner_or_admin( @@ -440,12 +461,13 @@ fn check_is_owner_or_admin( let caller = T::CrossAccountId::from_eth(caller); collection .check_is_owner_or_admin(&caller) - .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; + .map_err(dispatch_to_evm::)?; Ok(caller) } fn save(collection: &CollectionHandle) -> Result { // TODO possibly delete for the lack of transaction + collection.consume_store_writes(1)?; collection .check_is_internal() .map_err(dispatch_to_evm::)?; diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index c88943a4d07f8636e9ca1e4af3becd2c74c2fd30..47d58eab2b291a1ac76b8559a600dab3e642d487 100644 GIT binary patch literal 2824 zcmaJ@Yitxn9N+2Q-5waF1$w1klb%2biHf`qED~%XB0(a1M|(@MNM?F1waB{-J}P0K zS4b1Hcda1tRf!QuG$8>IHTnS|U_^}&(V)BxU{KKyhyg=ef3v%Hy`r+0OMWx|_hbGu z^gOLi(g{@4^`ygw|3rIhC~=rj?HEk>CZ)>LwQ?prpin{UQ)Nb+l$w5WLC1P}K1zio zt)qb?9Z!Wml@eXAa*T+^gk=idY(%oMN@GT;E;8XorC4TcK}OCxa!RGuMj31zhYdJE zV|t8M+k^(IbV6g9Qjqp2vIaJH(;!f+>wNo|V(1N&5GK42M`fA+Q>vbz1i#v-sB^Wy zDEKpBYD#57zs`gkRy`9Iq*RLu25iSPT5XoW`O%C_g9lbQBT+@RO_ETlP)Ws%6RoO@ zP+~jL3cCSDAtcy&KPxkltZHy?NTaePLlQi$SLcjoVh!M5`_JtMd>ruazK*$I zIN=%a)VOOcy(jqE$AI&}b!g)FZU~G4{Ca%fYQPD30sF|kU%=Q|kT~>Za~B(r`tarN zU#$b=F6?+@^GA>!o|onBgY-K{8^_g7@&%qh-r@jqyB(W;{R;3_USP`XOD%}E6C`DF z=zhSI55ct?u&Hz0Ho(JxE!N`8fF}S~K3w+$;Q3-TSZ6?*Enj&7uotj)!L6HsTuq(% z)FQwGd4aMAAIrelXCQHicKH) zP=w48l&|tW1P}4mOL+-8 z;AA7kQj+W7Ab)69v2D#2IF{2*_my*q^S3SZ^Z;c+79={z|S=j8DZ zstV8KTZ;<;@afPS6^Deu2S%cCe)LOvDT?3%goy@n7iMlEd1f);ggbH3I}o+FhB~3` zzx6u88+!uAqa}_kXX0<(HWRNKOgxfOyL0X&gF&AoaF55K$65`!cO3rxmj!fAC|MW7$D6J@G!MO_l zEGY8&CH;ICxJ=|B*aVIymxBeLrPY?J3Q1tW%9QHJhMqJ{lW@*1&t1dd37N^WXPL-e zp-Kj>5HgYl_xWLo*G)6-h7()}`-4de`gt?r1y?kF_XV%|lEIr96ov(Nq6cKIA)b|8 zj?f5?LpI^2PV7-Ebe}I1nrs`ehRcRqLj{pE_gXDJEbGq|5KUP3~L^XlEs3!PF}=#-mrjRvDxnT38vBHeuB z;?JVlNY>Jcv(-XQB;pBo+oW4HZQP*J1cgZzw%a2{lJ7eT}9=Pnmk%jIrs^YI(!kS(>5|*HE&QGzcMa;>Jjz9EV-Kf z`ZMW*WuV)6oqPBJ;iqn}O(g%ayUnlgDBrJeb+KP8Jjty-9~|zP@rqw4V0d9(Y>9U= zk$7Lk%LmG7;=o(=Iwgi)g^n}viVK@~#hHwD>D~r9 z-ihH)6!#?+KB=&9KVlld`^ZRI<>jciLAJp#-xa#JgcHNK%J8RC_=cj_TNqQko?8hE zpG&DG+0GwyJv(0E>2beQ|IVh?bt~GIjvX0$@0rU}H)cMVvtrrOyCR#MkTUW1J)x5fSO?z`wtaVLn K4Qp@R*!&O5E7S%6 literal 2813 zcmaJ@du$X%9NuB~9vB`ia)JTh~{LK#*GqPWWp+?r_9izjGS}iv`Q z@MprUX_X0=bS7M|W-*~Aty)YlpgXS73bPc(4`yT>EU+Ss#1z>!Nm8Xk85Ofmth_8r ziS5LO*tJj!A;B)#S(c6FRD)YX>Xc`)Bx%&PS)>gi%n`>Tj7)=Nw!zmmrNt&mch6^> z7`+h1wt6kMS(d@qW5lV2`K<3mjgeQVFo_Bsm#BvHxG5;{Q$VHhC5#-$C_#^vYnewU zR{vPa$UsHQY?!=ycPSG#1AcW+?M}d@J{-*Yi~u}RclwUOOdJh(ZpY6%0H*-{-PwF6 z2zxvQ-ZmI_VQE|7r4Iln1ActtuvQ542Rt~ea}i*yAkh5OsV|}ID3&;cz*#{1v+MV} z+iIEo@wz=eT>Jft)qo=kvfO-(zk$G#O~zQj-vC!sR*m)ro;Wby0i0YA7!#U05B|1* zRc$_WFJRh-V7&>b+!7oKxDjw}OXWJiU4Zkg`+f&3I?1=ecoCMyPB}3juo-ZQeDX=a zwSZMM7ykm>SkT+|;jP=D>=P_;h$SAC(wpzfqH<0GUKj0u1haPoR_$63U(e9K^mc;o^ZApxyZ=*@l;~sK~#Y_C#?!9>r=}5^m8ZA@<|QFSCw=k z5ng|UV=X5-9pH^-;zoCo^|>MEFlhnkMPVt=N6DhRD-B{V&W9KkZ3w*2*UW+h?Q(L_ z9#Y_O1H1XbF}+4OUp>|y>p2RI>@}K!5iIkZylm~&Ud*GMSqO*A8Rkwse*uEwHQS=165@`Q7; z&npA3*9qu}mN+QF#9zE=Cbk<)+?`fi^KScsLZ2at9z#z+3qivb%k(JUu-%(SyG&|U ziV9vkl&Tf zguTHc7L#IWRrB;BYMxr(4^%6yGHvdIw8i&9dfQ}Db6Rbq@m8mmBwBq}G-#z(*5w{5 zaDTw|;O1o}{Xye4%)}@s(<+N3968T_|9i<)C2?E0*6U<`m;dRdhEXyk!U7W%{F!ut z=P%{QyT~#ThrnzwX1fd)SV$`@cPj*e1qP&5M>h17X_|yHHP2kb-~pMyqi30jUNK7s z?hP`C1>W%865CBP;kpx;3jN(d3ixp|5=B!qe&Gdv^(6ymvPcXItVa#Ve1}9%b{Rp* zW5_1V)QNp93r2mJ;Bec3Hry~=8#0KXxp!%?dV(ki_s&jSR(Qb&y#&y*RXr0H>t`zamc5hMdj*`2x zpMMtm)-q7-JkM?Xfbdh-T_&NkSF|e}_U#G}?r9ebSGw8fxpB{om;7P^!&3`lHQvcY z;C&G<9!RH&18>dJDKYeNRGf*YTljH2-OOlSR&A5N+`?;%FE=|yy@#9KskUT^>D~r9 z9*5y~6!-ZQ-m9>12Yl+nqsT~EkqGi_kabYZXN70EgcC=*%JTP8__U(Wve2e@KGzTy z{yMFiWIcbywQYEThsXWWmp0FBSTb+<149SJ$2>n>{qqcY?XANdTiRYeANllf|BnWo zD%&^xy#X^{AGOk+yL|D&%rqf9P#D*=pkaADv$(No8Ot=qfg2VrSy;cQzOku(ZoHu} L-pHC7R@DCs%Ie@r diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index 0665fc0743..d077fe97d8 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -31,7 +31,103 @@ contract ERC20Events { ); } -// Selector: 6cf113cd +// Selector: 79cc6790 +contract ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) public returns (bool) { + require(false, stub_error); + from; + amount; + dummy = 0; + return false; + } +} + +// Selector: 942e8b22 +contract ERC20 is Dummy, ERC165, ERC20Events { + // Selector: name() 06fdde03 + function name() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: symbol() 95d89b41 + function symbol() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: decimals() 313ce567 + function decimals() public view returns (uint8) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) public view returns (uint256) { + require(false, stub_error); + owner; + dummy; + return 0; + } + + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 amount) public returns (bool) { + require(false, stub_error); + to; + amount; + dummy = 0; + return false; + } + + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 amount + ) public returns (bool) { + require(false, stub_error); + from; + to; + amount; + dummy = 0; + return false; + } + + // Selector: approve(address,uint256) 095ea7b3 + function approve(address spender, uint256 amount) public returns (bool) { + require(false, stub_error); + spender; + amount; + dummy = 0; + return false; + } + + // Selector: allowance(address,address) dd62ed3e + function allowance(address owner, address spender) + public + view + returns (uint256) + { + require(false, stub_error); + owner; + spender; + dummy; + return 0; + } +} + +// Selector: ca08c92c contract Collection is Dummy, ERC165 { // Set collection property. // @@ -280,101 +376,17 @@ contract Collection is Dummy, ERC165 { dummy = 0; return ""; } -} - -// Selector: 79cc6790 -contract ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) public returns (bool) { - require(false, stub_error); - from; - amount; - dummy = 0; - return false; - } -} - -// Selector: 942e8b22 -contract ERC20 is Dummy, ERC165, ERC20Events { - // Selector: name() 06fdde03 - function name() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: symbol() 95d89b41 - function symbol() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: decimals() 313ce567 - function decimals() public view returns (uint8) { - require(false, stub_error); - dummy; - return 0; - } - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) public view returns (uint256) { - require(false, stub_error); - owner; - dummy; - return 0; - } - - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 amount) public returns (bool) { - require(false, stub_error); - to; - amount; - dummy = 0; - return false; - } - - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 amount - ) public returns (bool) { - require(false, stub_error); - from; - to; - amount; - dummy = 0; - return false; - } - - // Selector: approve(address,uint256) 095ea7b3 - function approve(address spender, uint256 amount) public returns (bool) { + // Changes collection owner + // + // @dev Owner can be changed only by current owner + // @param newOwner new owner + // + // Selector: changeOwner(address) a6f9dae1 + function changeOwner(address newOwner) public { require(false, stub_error); - spender; - amount; + newOwner; dummy = 0; - return false; - } - - // Selector: allowance(address,address) dd62ed3e - function allowance(address owner, address spender) - public - view - returns (uint256) - { - require(false, stub_error); - owner; - spender; - dummy; - return 0; } } diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 3c681ec4814b29cf2770ad4ae3a41f6d75b93a7c..257d6e7321d8d03154bbfc174e8bc0d0a6cf1778 100644 GIT binary patch literal 4211 zcmai13viTI72eBc-@73RWO*z#YXHTu6woehg((SEORK=2mF%KFwD)F7+bB>Tp^9nc ze{O=%_TNpQWvo+Vtboqoqo_!0ox;@8De6?lYU=}ZYAtr0Ixwvi3HaT6|9|sut2SZ7 zch5cN+;h%7kGu2??a0#)P)*nKPEVj|DcySmB|w38$H3n|6jbF}trci)kp{F;Rp|+k z0|m9TY{|ezdL}~ydD=-E@^l6bjH;CA`ZUK#YvAuG(rre%qNp@$H0eQ5%%Weay(Xnp z9HpSrHlvxJ^IMz)V`x^-(l(pW&@`RUY`KZ={h+95U=&n?K)0?7`l+I!cT+;Z@)QhK z6#glwdKV@5?Z^amq547*3>WaZuAst=CLMob)(Q}o7E}xWZHF0IjkcN1@MI!(m%tbc zCzClv#WqQoN&{19usv#^RTZ=-C&f^A1ZeF_5mu0GrgcoOhiZ@>I!m-k@kkte`wdTKV! zI{ra;QUKT1lXp6Rb6qI7w9>$Rum2LV-vjl&HBZ9k;70)MXQnW{{N?Z-rJRn=P z-ntN6j{@E^z2h1`7Y`fOMQoMw?|&b-Rs*gXoW2{>Ucfu8<*y0>t@QcpJAV(TgSug_ zF%R%T&*nLiMRzo_ajUS^X|Db>U@PEF2S;v$`ER%o0jiAh>0k9(z|(;9SIi9q{sVBKa`wxB z{|4+>a_Ma$3;6W-DS*x1VX@oxKMtD@fr~>3n1Ic*KT)2@#=QwRDgWXCs1?A;=@b$` z1hakiLl*&m2h8jtFebXV7a2?%5(d%69-f1*FhDK-&UA4zX13#4oCkK1mxKm zo!oK>aCH&&h33P8Q5Fo&rwuH0KT0ArwV(z-yov=U3*vV<@kSJ5N0-yu%IlGEtW|=} zdBMjw$CQMB#8(OnsX~MWKU8s8+bH9-n+s}1QL0K+JQV_ZmuBT@K+Jy@X)ofnU=y8ml}%!h zJYkVAw+>cCu7x6~A0#BNDzr^Rrs`C=T~%mA#Ii_|0K(6WuvqvKNVUs~te18u$RO}) z(#XAdP>3sYa{#@`^D5%qf8>D4B3laT2+a;V!z4HCrhx|K)GG4`M4p$*&0G}`u*M>w z;U&Z(XWbA)-W)WCWC(^8+EFG5nBa&eT;o`Da@iR4M@gx2FL0JdHG7aB7QJ3FTXk`c zE^`lwes0ik4;fJu7VX263x$IOu445?eymtku(Bz2SB_HMRT;sxxTkrZMIZCj98@VnFGg~V35X2*Ixv+*3n8J-qlOU#g5`XFAQgR**JyIoq2 z#SXIAHw_k>iH_tJ2@RnHGRQ8x{&eDe)#S#UkP@~{R1R4o(j z{vb-3Y@Yz?MVHFr<5=j8f;wc7oSxr~zk^&VKDD+#>%kqoC`FWv9VD+&3*G5TU0V`yl9d~GUuG=6Q|34?V9l4m!W_4qS*SRjlqazG zPo!oo$Kub{Ld0MCB02^!iDM!9ZyDU|aWg;hlE?ZN(=D}kM>TO-GS#A*94`roYVxZ0ifVG9WUh-U zOXg*Oe8Ek2^1|?PBI!Q+#Z2S=`f?%ZzIey#mAjqv>OcAYTKmQv6m7nA1wSISl5YRg z{GGja=xfqeBw}smL9y#UOT{e%-GtAD5#Cze4&=r%HB$=LTa{WMsVsG~-zt_W@a`*O zE?SZtF}0SS+T@81c3;1W(2qq5AKOyjLZeT9V)>Da{CPFUl-f@%`9163K>^RTQY9?Z-8*7R+-WAn=P zmh7?7or_N#`}V)){Jj`^VCm21T>VpR`M&c#=T00=ZoTQp>EN2pcdspdJP;ip_-OxK neVenTyVv(`Vx|5paNoKOYkSxAuJ7+%lkHodUC;Xa?&@gtF{zl=rnaOZ(%6^A8pXC?rO~$1ClJ$6V}q2iZohNRy|Z_;k6mW@ z&VT;b`Op72L(kHlJiU?XhLLv%l(t*w;oB(zQl`5m{{F6@sh`n1faVpcqK|9pfI^NI zw9<-Y!`tZD3{~>9mp13=Osb4)lo-Y|*G%i+A1Km?&2&}OXx3~qLZDd1pw#rblv;Jw zf=0W|c5dek?7$hCHL|qZAv8SAAT(QU<9pvPsyY}2)g;hu7=nJfXd3;L5U{)ehgFq- z3YyVJ34VJrAw#IXTm-{qd=?Zm9HY&^pSZmegfA8}8~^Qw8(E!pTkSZ>RO~K;Gd3)f zxkc5nNS{WPE*dJknQ2{VN*p)S>GVVHG~^V=ce<;bu4<<6jO;3olu4i2KW39L#I;IX z8(xxC@X|54@8nRi;*dU}cf`%m%W0@K`uPD=6%s~wr-+vtN zD;}K6LbCxcI2T@;%9=UvrDN|L1N;E+%J}eNz*W+gRD<=8vGt4L!tVi30{(L5_$I)& zeJ*ZSNa>~8Uj|(VLQvWWKd*^gZT{2Hh;j&JAGqn^eA zvfuVZ$;2y916~AE_*6&(Qzu}Awf`Eho5S%xgaCQU#jcxj6>xD8MT8E+n*Pq3&d;aK zEW90g-#k&!6pe+NSkt&5j)54Sfr{(tb2~bC(GiaIYRG+G@bS$_C6Onv3guY1M~JXc zYt?1ZIh?3^DxN%`JkN6&N z-Ss2JXG>0g^vQ#8FDH2#y-C~>+)MQHRb6+3T;g(2XUmd?)whGIX=R>>;Sl zF252HVjkZ~XOkxyRv!dcDQ>iW*hW?IkiKG}rG8DR&0J2EAxB&98(5k-N&lKb=$i=( zUyplD9TGRma{<#x;m!ZQanb*=spoWL)>IbWBr{tMCPIT0;gI(Znc261Ix4xl&rr;7Ub zAKhoM=sg8(jAlpOQIZ?=(m;oDYL|HgqTiFsty~QeuqPv+E$&)-W#0nSQgX2P)|4Lae zD`GE7Nwe;zIBLv$II!5cGVW631A+mCelTL=Qcw-13}WpS43B7hMiC#8%qk6MkO914 z_}%I9LgKxi+wtYT+j#TAhOb5V5??2|j0&Ea6j6+ zAiMCyGl;v#;?6uPB^-xn79NBwf%%_vc+SRO;akSIRwnws5K5Wsz82JXJSvNyW8pUn z+K5SVMt(Q`R)o}qzn@4wx|bKFh?2RNc3`_nr7NOJQs>q&dhTH-pMXY{Hmbo2R?F&KykICq&e1-p1e!==;fY& zqukY&+dS4l8S&#z7EjAPzOs@dGI&&FE!#wi@ES+?_J~ZRG>|Mp^{6lS&3b+DJ{GJR zFY{Yo@L6BByi)skR9pTmnd(t(`KKfxs>!DR7uDnqlDQ$OEV)1iC=lG_jl3}YoJe|a zdok1ac>}qS^j^G^^~#T(^y@!)u-?8g2SuANP2fkQR?_Q#da$$Cjh>XgA`$B|4~o6> zv*bnFL^t7cVT`v{uLF6pOeLgnqgSb{q_WhkpjRxlkau4ZbJ3FIh^e>qRM8ise!2%m z0>MZbKIfi~a>}sbLM;p%d!<2%X-q>Ox6(RGJ&*6hR=TEYj)kwoEOn;-ZP>|E`DNG{ z*D7UViKnE2?{+ENJHCgq)g;gSZlhVSp@AsQ^y`ZB&&%B^TQ*n2e+=>v1UBqXbBq?3nm{xuB_^)H{IY7OA3-YHF`S zzE#jl%a&~4NYAFJlBWx4OP)@p%BV((VN7()ln(jcBHdx8YN|#vW}6Yfj8*h&O>StZ zHAgLIw99Pg`@D#K;0(9G*fBgYu_!ZIt0b6NnqPB#Qd3}Y4lJ+Ao4>v ztg8H5(2Qe`D-S%GxA_jFYW&A*A})jP=4*{O} zLeEjadt5l41xkPy$`_s<&w^cm|331EBY?92FO6oe!9Kz3Zw#n zznD6@4zS&m;`_R0_kViFF(~{FQio<9=?6Ry_|3O}e@>XyOOFN*JPFx{F#GtHOD6&E z_RQS5_4C)`Bn2#OzxS`t0nT+Hbe{#hx9sqY8*87ZrB5w5(Hv_3- zklHdOH`|rkdir)p?CVN#+QjC1sjoU^52SP`+-@&_-BtMVf`u;u9>DB|gXYHp9|PPp zvlzn>>r$3>(vX}08@au zCGWiL>gIlYMJM1)%r3OPv=s1Do|)*ahrb7(Phsh*RPq(Thg}HcoWaSn_Fe+~CE%2! zn-BoPu{q(-+y?kJzZs1ArMA!dYz43la6(wj&=gEAV1apJ@@IT< zCGs@a?R0eTR3#kiwSe=ckmHMEMncc?(Ha)qB2-x5#+t*zeSEUwnhf71mPCm;m<~9# zl&}g>zoGEqrjamvyy3|QX+&=DYeXJz8lC5(P)k3LI(@YEaJ<8Z}GF`9T}@#CZS#EFYlMW1=6>8(yr$w zIw2XyLYtf15_`b@ebBg1Xt2=N(Y=Lbq!kN&0~axGPA zysML%Q_DAKKufdAoT<=jQr^tgR4y**aQ6)pxyZuFvRT1yy#=kNs&%z4o+1>ZTetI6 z5swBed_xfr5@lkL?utcBk|!*D4fhUSg_pw+%vTA?Ybxy${@0y4_p1(zU@U_mQ9wU; z!e-$Km}*>Bc&GG3%?h@3>EuB?YltgzV*s_uJ5|`b|L_Tmg>fMxG&AfBlkBh?20DyW zyTTa=zb=hi**X}o#~9G@ki;S_E(MXcsx>4j7*=VnLO__5nC?2qBJ(O{)z6Yz=cmA4 zI@QZnzFFjpQrK?dIWpjFa%a_aHyKe?7QwxOb{@cWjOu(_F{)v7kWzQ#sP)~o5nPMA zn|HFvQ=ZvVU=%EHBQNs65F=c84#$Ny|43aoDk7JprrB^)95w1bZm{Up72KtW2ao}S z9vRVjQc?AX47hd^hBF#nS;SWavr2<$L;yS!cc;q>iQeV99o0Rz@uY}7JS)54x?p&5df5M_aGFdc-isU8<4I%~7h%P)B8pQdE#hv++)F_vUX5lfC#qgAn zE%TU-Ugk^2s8%8R{Q;yh*?A?_JKR|oyPAb!1#QSAStGv_zg4ak%Qn^*e{~m6O2Lx3 zi{w>1uhuFA|5y~gMb-E6=T83DNGPv5#kNVeP@OI}l_kNG%-q;RQijD2%NXYgto!0u zxZ{>H8yRPi%9Skkg4EKpEcV9+Mf@c|uwxR7I2PC$;_SrT{IA=ju9-IIiFXyPteNK% zc)E62JXFy1-S0VtFS+82T_@v9$LA@wYtDQOixW_p_SlltK+w6CafmU^TJe z|FN1VO5r9}Sz?_e$VYBs6;BK=CKB!&f#_-cyuMgSJSI(!-UN!H}dK$I2R>JwwOjqPu}mT?eW6hui_&k`F&6FsrO1s+Hj#3nvK1}pu{vLqK;cB zohAQ?w`eO>SGBT*muS|SY`jC4^Hjb`~>cvWsgt8MMj@FEXwDMPr4H7U`6Uvy-sar3K9*CTE9Mov!udv4>>Wp5mMVc*hy<}>?Gn-^z2^3vwNoI6l?Vn%D<<~!Dw v7Auh}lzD@z2R3I)cdQ@W#7cu1;DL1;*7mRKUq9I2ml;@}S?lmG=f90Pyks&`R>-_CSU7pl(}z;GU)Yw{}GXx8y3W~~6>mb_}=za20mqtSM=1)faA?ot?I z;bbzWpx7qqQfXic4VIkrv?(b{Y$rX*?uOh6$OUZA=qaUCMKy$FWP4$-M7oUbVT%kS zt`*`~u#&8VmA1icCl3|MHt7<22c0xMpMq+=n>(N=kkHe_>4qK{wf*=V4&YoDx&j0Dp7|xz{1DW8*FFQAgP#JlpP%}wI9=qeR^)21<^kEd z{pN+>dK7Tm^v z8S?-i@NAwFS#)~~8@CEui_O(v1Z)HR?4jY?VE$PbLSQ!F@^#1m3b+7Jd3xD>fHwga z=7v8381yu9HCVS}>jvwpCKz^%!#(Tn^mFlZvGp3Z=Jc<+74RhB{1tP9O>&ZiA5bU#WWG&QdVK)iwlCkx^aIPrQEV`rDs*2e3RaI95= z&N;!yH^-EOf67-13#mec1+T0)EOHYke$`bOStYhaAK8}aB^Rw~g(^H}X|Ycb#101i#M4 zHFc{O{Hp}3TiwG~o=&-^u!hI^m531Y_>LKyc-_BBw$`o0p`Nq#s-%;iVyVTurX)Hy zzcg|A==fbdpHKgS{w0mjHxL%e;$D+ah@0fOfI$`DbK$>n(f_fjWi@0L+Tx(hY&p9E z7;;vywT*=ym1Gt=Xt2=N^XgDlj3ON9aXcqE^sGp#Q|aIoJ;fCslyv`$^i9@It;@k6 zurmURh_BI0O1O zL1L4TU}4MCjIv_kNtmyC&Y~H!L`Vx*_qqyb2J<;%l51$7!bdl$IF(#2447M{%_9|l zS@Ij%io)4tIJ|S;lAA32j%}21+LF9lQIx7u6;FkL-lbVN8W8iJMLG(2E!adST_uwk zBu7{z%&mh}k*lEy>dS=WRE4&S$W)ywx2p<`h*$;xtXmZ0@hdr zG`xgZWW)_Y!o#X>wy;k`lH}R1sXs+Nd$ ze-Ncic1!^Ef=gxbaV&H;uMQd{tLJv$Z<$NQr`GmoJ+PA(rHGQTljIaDr&LM=|5yyO zMbRGQk4yejD=4o!#n(u)(48*VwIvZJS-Ejj^04?Wnd7{GHDCS;bKG`jq2hE>n!w^u zN+~VN;xE=h#9#U%ItDR`VtdZjcJfR&HKZA1I{Q)n0 z#nm{=HL`Ku*j>U#H}||7<)$`%$z}DG5qEd2cpA5Q%D!QX3?5Qg<1SGmyv9+!ogxz{ z^(Bi?eb^Ixs#agTkNK;{&HTnUJk~#(ZmE4Zs*RTnI+$;eNnb^RDMskN7ZtPnBpm^<7;0N?j2uIS<}n{YvRsd#`S51O;pen~#ZKiKSW&`W*+t&MU&w@{L diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index 860a5c32be..fe2c563f87 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -371,7 +371,142 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { } } -// Selector: 6cf113cd +// Selector: 780e9d63 +contract ERC721Enumerable is Dummy, ERC165 { + // @notice Enumerate valid RFTs + // @param index A counter less than `totalSupply()` + // @return The token identifier for the `index`th NFT, + // (sort order not specified) + // + // Selector: tokenByIndex(uint256) 4f6ccce7 + function tokenByIndex(uint256 index) public view returns (uint256) { + require(false, stub_error); + index; + dummy; + return 0; + } + + // Not implemented + // + // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 + function tokenOfOwnerByIndex(address owner, uint256 index) + public + view + returns (uint256) + { + require(false, stub_error); + owner; + index; + dummy; + return 0; + } + + // @notice Count RFTs tracked by this contract + // @return A count of valid RFTs tracked by this contract, where each one of + // them has an assigned and queryable owner not equal to the zero address + // + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } +} + +// Selector: 7c3bef89 +contract ERC721UniqueExtensions is Dummy, ERC165 { + // @notice Transfer ownership of an RFT + // @dev Throws unless `msg.sender` is the current owner. Throws if `to` + // is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param to The new owner + // @param tokenId The RFT to transfer + // @param _value Not used for an RFT + // + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 tokenId) public { + require(false, stub_error); + to; + tokenId; + dummy = 0; + } + + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this RFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param from The current owner of the RFT + // @param tokenId The RFT to transfer + // @param _value Not used for an RFT + // + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 tokenId) public { + require(false, stub_error); + from; + tokenId; + dummy = 0; + } + + // @notice Returns next free RFT ID. + // + // Selector: nextTokenId() 75794a3c + function nextTokenId() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } + + // @notice Function to mint multiple tokens. + // @dev `tokenIds` should be an array of consecutive numbers and first number + // should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokenIds IDs of the minted RFTs + // + // Selector: mintBulk(address,uint256[]) 44a9945e + function mintBulk(address to, uint256[] memory tokenIds) + public + returns (bool) + { + require(false, stub_error); + to; + tokenIds; + dummy = 0; + return false; + } + + // @notice Function to mint multiple tokens with the given tokenUris. + // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // numbers and first number should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokens array of pairs of token ID and token URI for minted tokens + // + // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 + function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + public + returns (bool) + { + require(false, stub_error); + to; + tokens; + dummy = 0; + return false; + } + + // Returns EVM address for refungible token + // + // @param token ID of the token + // + // Selector: tokenContractAddress(uint256) ab76fac6 + function tokenContractAddress(uint256 token) public view returns (address) { + require(false, stub_error); + token; + dummy; + return 0x0000000000000000000000000000000000000000; + } +} + +// Selector: ca08c92c contract Collection is Dummy, ERC165 { // Set collection property. // @@ -620,140 +755,17 @@ contract Collection is Dummy, ERC165 { dummy = 0; return ""; } -} - -// Selector: 780e9d63 -contract ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid RFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) - // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) public view returns (uint256) { - require(false, stub_error); - index; - dummy; - return 0; - } - - // Not implemented - // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - public - view - returns (uint256) - { - require(false, stub_error); - owner; - index; - dummy; - return 0; - } - - // @notice Count RFTs tracked by this contract - // @return A count of valid RFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address - // - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } -} - -// Selector: 7c3bef89 -contract ERC721UniqueExtensions is Dummy, ERC165 { - // @notice Transfer ownership of an RFT - // @dev Throws unless `msg.sender` is the current owner. Throws if `to` - // is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param to The new owner - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT - // - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 tokenId) public { - require(false, stub_error); - to; - tokenId; - dummy = 0; - } - - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this RFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param from The current owner of the RFT - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT - // - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 tokenId) public { - require(false, stub_error); - from; - tokenId; - dummy = 0; - } - // @notice Returns next free RFT ID. + // Changes collection owner // - // Selector: nextTokenId() 75794a3c - function nextTokenId() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } - - // @notice Function to mint multiple tokens. - // @dev `tokenIds` should be an array of consecutive numbers and first number - // should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokenIds IDs of the minted RFTs - // - // Selector: mintBulk(address,uint256[]) 44a9945e - function mintBulk(address to, uint256[] memory tokenIds) - public - returns (bool) - { - require(false, stub_error); - to; - tokenIds; - dummy = 0; - return false; - } - - // @notice Function to mint multiple tokens with the given tokenUris. - // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // numbers and first number should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokens array of pairs of token ID and token URI for minted tokens + // @dev Owner can be changed only by current owner + // @param newOwner new owner // - // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 - function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) - public - returns (bool) - { + // Selector: changeOwner(address) a6f9dae1 + function changeOwner(address newOwner) public { require(false, stub_error); - to; - tokens; + newOwner; dummy = 0; - return false; - } - - // Returns EVM address for refungible token - // - // @param token ID of the token - // - // Selector: tokenContractAddress(uint256) ab76fac6 - function tokenContractAddress(uint256 token) public view returns (address) { - require(false, stub_error); - token; - dummy; - return 0x0000000000000000000000000000000000000000; } } diff --git a/tests/src/eth/api/UniqueFungible.sol b/tests/src/eth/api/UniqueFungible.sol index 34554507cb..23abae5018 100644 --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -22,7 +22,50 @@ interface ERC20Events { ); } -// Selector: 6cf113cd +// Selector: 79cc6790 +interface ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) external returns (bool); +} + +// Selector: 942e8b22 +interface ERC20 is Dummy, ERC165, ERC20Events { + // Selector: name() 06fdde03 + function name() external view returns (string memory); + + // Selector: symbol() 95d89b41 + function symbol() external view returns (string memory); + + // Selector: totalSupply() 18160ddd + function totalSupply() external view returns (uint256); + + // Selector: decimals() 313ce567 + function decimals() external view returns (uint8); + + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) external view returns (uint256); + + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 amount) external returns (bool); + + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 amount + ) external returns (bool); + + // Selector: approve(address,uint256) 095ea7b3 + function approve(address spender, uint256 amount) external returns (bool); + + // Selector: allowance(address,address) dd62ed3e + function allowance(address owner, address spender) + external + view + returns (uint256); +} + +// Selector: ca08c92c interface Collection is Dummy, ERC165 { // Set collection property. // @@ -183,49 +226,14 @@ interface Collection is Dummy, ERC165 { // // Selector: uniqueCollectionType() d34b55b8 function uniqueCollectionType() external returns (string memory); -} -// Selector: 79cc6790 -interface ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) external returns (bool); -} - -// Selector: 942e8b22 -interface ERC20 is Dummy, ERC165, ERC20Events { - // Selector: name() 06fdde03 - function name() external view returns (string memory); - - // Selector: symbol() 95d89b41 - function symbol() external view returns (string memory); - - // Selector: totalSupply() 18160ddd - function totalSupply() external view returns (uint256); - - // Selector: decimals() 313ce567 - function decimals() external view returns (uint8); - - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) external view returns (uint256); - - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 amount) external returns (bool); - - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 amount - ) external returns (bool); - - // Selector: approve(address,uint256) 095ea7b3 - function approve(address spender, uint256 amount) external returns (bool); - - // Selector: allowance(address,address) dd62ed3e - function allowance(address owner, address spender) - external - view - returns (uint256); + // Changes collection owner + // + // @dev Owner can be changed only by current owner + // @param newOwner new owner + // + // Selector: changeOwner(address) a6f9dae1 + function changeOwner(address newOwner) external; } interface UniqueFungible is diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index 0fd1373566..ece1a0034c 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -250,7 +250,33 @@ interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { function finishMinting() external returns (bool); } -// Selector: 6cf113cd +// Selector: 780e9d63 +interface ERC721Enumerable is Dummy, ERC165 { + // @notice Enumerate valid NFTs + // @param index A counter less than `totalSupply()` + // @return The token identifier for the `index`th NFT, + // (sort order not specified) + // + // Selector: tokenByIndex(uint256) 4f6ccce7 + function tokenByIndex(uint256 index) external view returns (uint256); + + // @dev Not implemented + // + // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 + function tokenOfOwnerByIndex(address owner, uint256 index) + external + view + returns (uint256); + + // @notice Count NFTs tracked by this contract + // @return A count of valid NFTs tracked by this contract, where each one of + // them has an assigned and queryable owner not equal to the zero address + // + // Selector: totalSupply() 18160ddd + function totalSupply() external view returns (uint256); +} + +// Selector: ca08c92c interface Collection is Dummy, ERC165 { // Set collection property. // @@ -411,32 +437,14 @@ interface Collection is Dummy, ERC165 { // // Selector: uniqueCollectionType() d34b55b8 function uniqueCollectionType() external returns (string memory); -} - -// Selector: 780e9d63 -interface ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid NFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) - // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) external view returns (uint256); - // @dev Not implemented + // Changes collection owner // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - external - view - returns (uint256); - - // @notice Count NFTs tracked by this contract - // @return A count of valid NFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address + // @dev Owner can be changed only by current owner + // @param newOwner new owner // - // Selector: totalSupply() 18160ddd - function totalSupply() external view returns (uint256); + // Selector: changeOwner(address) a6f9dae1 + function changeOwner(address newOwner) external; } // Selector: d74d154f diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index 62b4d294a6..be386df242 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -248,7 +248,96 @@ interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { function finishMinting() external returns (bool); } -// Selector: 6cf113cd +// Selector: 780e9d63 +interface ERC721Enumerable is Dummy, ERC165 { + // @notice Enumerate valid RFTs + // @param index A counter less than `totalSupply()` + // @return The token identifier for the `index`th NFT, + // (sort order not specified) + // + // Selector: tokenByIndex(uint256) 4f6ccce7 + function tokenByIndex(uint256 index) external view returns (uint256); + + // Not implemented + // + // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 + function tokenOfOwnerByIndex(address owner, uint256 index) + external + view + returns (uint256); + + // @notice Count RFTs tracked by this contract + // @return A count of valid RFTs tracked by this contract, where each one of + // them has an assigned and queryable owner not equal to the zero address + // + // Selector: totalSupply() 18160ddd + function totalSupply() external view returns (uint256); +} + +// Selector: 7c3bef89 +interface ERC721UniqueExtensions is Dummy, ERC165 { + // @notice Transfer ownership of an RFT + // @dev Throws unless `msg.sender` is the current owner. Throws if `to` + // is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param to The new owner + // @param tokenId The RFT to transfer + // @param _value Not used for an RFT + // + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 tokenId) external; + + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this RFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param from The current owner of the RFT + // @param tokenId The RFT to transfer + // @param _value Not used for an RFT + // + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 tokenId) external; + + // @notice Returns next free RFT ID. + // + // Selector: nextTokenId() 75794a3c + function nextTokenId() external view returns (uint256); + + // @notice Function to mint multiple tokens. + // @dev `tokenIds` should be an array of consecutive numbers and first number + // should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokenIds IDs of the minted RFTs + // + // Selector: mintBulk(address,uint256[]) 44a9945e + function mintBulk(address to, uint256[] memory tokenIds) + external + returns (bool); + + // @notice Function to mint multiple tokens with the given tokenUris. + // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // numbers and first number should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokens array of pairs of token ID and token URI for minted tokens + // + // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 + function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + external + returns (bool); + + // Returns EVM address for refungible token + // + // @param token ID of the token + // + // Selector: tokenContractAddress(uint256) ab76fac6 + function tokenContractAddress(uint256 token) + external + view + returns (address); +} + +// Selector: ca08c92c interface Collection is Dummy, ERC165 { // Set collection property. // @@ -409,95 +498,14 @@ interface Collection is Dummy, ERC165 { // // Selector: uniqueCollectionType() d34b55b8 function uniqueCollectionType() external returns (string memory); -} - -// Selector: 780e9d63 -interface ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid RFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) - // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) external view returns (uint256); - // Not implemented - // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - external - view - returns (uint256); - - // @notice Count RFTs tracked by this contract - // @return A count of valid RFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address + // Changes collection owner // - // Selector: totalSupply() 18160ddd - function totalSupply() external view returns (uint256); -} - -// Selector: 7c3bef89 -interface ERC721UniqueExtensions is Dummy, ERC165 { - // @notice Transfer ownership of an RFT - // @dev Throws unless `msg.sender` is the current owner. Throws if `to` - // is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param to The new owner - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT + // @dev Owner can be changed only by current owner + // @param newOwner new owner // - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 tokenId) external; - - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this RFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param from The current owner of the RFT - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT - // - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 tokenId) external; - - // @notice Returns next free RFT ID. - // - // Selector: nextTokenId() 75794a3c - function nextTokenId() external view returns (uint256); - - // @notice Function to mint multiple tokens. - // @dev `tokenIds` should be an array of consecutive numbers and first number - // should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokenIds IDs of the minted RFTs - // - // Selector: mintBulk(address,uint256[]) 44a9945e - function mintBulk(address to, uint256[] memory tokenIds) - external - returns (bool); - - // @notice Function to mint multiple tokens with the given tokenUris. - // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // numbers and first number should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokens array of pairs of token ID and token URI for minted tokens - // - // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 - function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) - external - returns (bool); - - // Returns EVM address for refungible token - // - // @param token ID of the token - // - // Selector: tokenContractAddress(uint256) ab76fac6 - function tokenContractAddress(uint256 token) - external - view - returns (address); + // Selector: changeOwner(address) a6f9dae1 + function changeOwner(address newOwner) external; } interface UniqueRefungible is diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index 145d7d7749..cbd2975022 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -15,6 +15,7 @@ import {expect} from 'chai'; import privateKey from '../substrate/privateKey'; +import { UNIQUE } from '../util/helpers'; import { createEthAccount, createEthAccountWithBalance, @@ -22,6 +23,7 @@ import { evmCollectionHelpers, getCollectionAddressFromResult, itWeb3, + recordEthFee, } from './util/helpers'; describe('Add collection admins', () => { @@ -309,4 +311,51 @@ describe('Remove collection admins', () => { expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) .to.be.eq(adminSub.address.toLocaleLowerCase()); }); +}); + +describe('Change owner tests', () => { + itWeb3('Change owner', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const newOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelper = evmCollectionHelpers(web3, owner); + const result = await collectionHelper.methods + .createNonfungibleCollection('A', 'B', 'C') + .send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + + await collectionEvm.methods.changeOwner(newOwner).send(); + + expect(await collectionEvm.methods.verifyOwnerOrAdmin(owner).call()).to.be.false; + expect(await collectionEvm.methods.verifyOwnerOrAdmin(newOwner).call()).to.be.true; + }); + + itWeb3('change owner call fee', async ({web3, api, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const newOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelper = evmCollectionHelpers(web3, owner); + const result = await collectionHelper.methods + .createNonfungibleCollection('A', 'B', 'C') + .send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + + const cost = await recordEthFee(api, owner, () => collectionEvm.methods.changeOwner(newOwner).send()); + expect(cost < BigInt(0.2 * Number(UNIQUE))); + expect(cost > 0); + }); + + itWeb3('(!negative tests!) call changeOwner by not owner', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const newOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelper = evmCollectionHelpers(web3, owner); + const result = await collectionHelper.methods + .createNonfungibleCollection('A', 'B', 'C') + .send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + + await expect(collectionEvm.methods.changeOwner(newOwner).send({from: newOwner})).to.be.rejected; + expect(await collectionEvm.methods.verifyOwnerOrAdmin(newOwner).call()).to.be.false; + }); }); \ No newline at end of file diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index e7d10deb9d..f2893caf74 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -115,6 +115,15 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "changeOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], "name": "collectionProperty", diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index f27f758406..820e4264a7 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -145,6 +145,15 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "changeOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], "name": "collectionProperty", diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index 1c952893aa..b985797776 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -145,6 +145,15 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "changeOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], "name": "collectionProperty", From d8d026362576297a14e85c32a8ea1370a038e257 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 23 Aug 2022 06:18:48 +0000 Subject: [PATCH 0493/1274] feature(common-pallet): add changeOwnerSubstrate and verifyOwnerOrAdminSubstrate methods --- pallets/common/src/erc.rs | 57 +- pallets/common/src/lib.rs | 15 +- pallets/fungible/src/stubs/UniqueFungible.raw | Bin 2824 -> 2860 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 227 +++-- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4211 -> 4279 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 823 +++++++-------- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4238 -> 4306 bytes .../refungible/src/stubs/UniqueRefungible.sol | 961 +++++++++--------- tests/src/eth/api/UniqueFungible.sol | 111 +- tests/src/eth/api/UniqueNFT.sol | 361 +++---- tests/src/eth/api/UniqueRefungible.sol | 361 +++---- tests/src/eth/collectionAdmin.test.ts | 51 + tests/src/eth/fungibleAbi.json | 18 + tests/src/eth/nonFungibleAbi.json | 18 + tests/src/eth/reFungibleAbi.json | 18 + 15 files changed, 1650 insertions(+), 1371 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index a00696d0ef..7e98281a90 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -232,10 +232,7 @@ where new_admin: uint256, ) -> Result { let caller = T::CrossAccountId::from_eth(caller); - let mut new_admin_arr: [u8; 32] = Default::default(); - new_admin.to_big_endian(&mut new_admin_arr); - let account_id = T::AccountId::from(new_admin_arr); - let new_admin = T::CrossAccountId::from_sub(account_id); + let new_admin = convert_substrate_address_to_cross_account_id::(new_admin); >::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::)?; Ok(()) } @@ -248,10 +245,7 @@ where admin: uint256, ) -> Result { let caller = T::CrossAccountId::from_eth(caller); - let mut admin_arr: [u8; 32] = Default::default(); - admin.to_big_endian(&mut admin_arr); - let account_id = T::AccountId::from(admin_arr); - let admin = T::CrossAccountId::from_sub(account_id); + let admin = convert_substrate_address_to_cross_account_id::(admin); >::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::)?; Ok(()) } @@ -415,7 +409,21 @@ where /// @param user account to verify /// @return "true" if account is the owner or admin fn verify_owner_or_admin(&self, user: address) -> Result { - Ok(check_is_owner_or_admin(user, self) + let user = T::CrossAccountId::from_eth(user); + Ok(self + .check_is_owner_or_admin(&user) + .map(|_| true) + .unwrap_or(false)) + } + + /// Check that substrate account is the owner or admin of the collection + /// + /// @param user account to verify + /// @return "true" if account is the owner or admin + fn verify_owner_or_admin_substrate(&self, user: uint256) -> Result { + let user = convert_substrate_address_to_cross_account_id::(user); + Ok(self + .check_is_owner_or_admin(&user) .map(|_| true) .unwrap_or(false)) } @@ -432,26 +440,37 @@ where Ok(mode.into()) } - /// Changes collection owner + /// Changes collection owner to another account /// /// @dev Owner can be changed only by current owner - /// @param newOwner new owner + /// @param newOwner new owner account fn change_owner(&mut self, caller: caller, new_owner: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let new_owner = T::CrossAccountId::from_eth(new_owner); self.change_owner_internal(caller, new_owner) + .map_err(dispatch_to_evm::) } -impl CollectionHandle + /// Changes collection owner to another substrate account + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner substrate account + fn change_owner_substrate(&mut self, caller: caller, new_owner: uint256) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let new_owner = convert_substrate_address_to_cross_account_id::(new_owner); + self.change_owner_internal(caller, new_owner) + .map_err(dispatch_to_evm::) + } +} + +fn convert_substrate_address_to_cross_account_id(address: uint256) -> T::CrossAccountId where T::AccountId: From<[u8; 32]>, { - - fn change_owner_internal(&mut self, caller: T::CrossAccountId, new_owner: T::CrossAccountId) -> Result { - self.check_is_owner(&caller).map_err(dispatch_to_evm::)?; - self.collection.owner = new_owner.as_sub().clone(); - save(self) - } + let mut address_arr: [u8; 32] = Default::default(); + address.to_big_endian(&mut address_arr); + let account_id = T::AccountId::from(address_arr); + T::CrossAccountId::from_sub(account_id) } fn check_is_owner_or_admin( @@ -471,7 +490,7 @@ fn save(collection: &CollectionHandle) -> Result { collection .check_is_internal() .map_err(dispatch_to_evm::)?; - >::insert(collection.id, collection.collection.clone()); + collection.save().map_err(dispatch_to_evm::)?; Ok(()) } diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index df538bbf29..15108c318e 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -203,8 +203,8 @@ impl CollectionHandle { } /// Save collection to storage. - pub fn save(self) -> DispatchResult { - >::insert(self.id, self.collection); + pub fn save(&self) -> DispatchResult { + >::insert(self.id, self.collection.clone()); Ok(()) } @@ -302,6 +302,17 @@ impl CollectionHandle { ); Ok(()) } + + /// Changes collection owner to another account + fn change_owner_internal( + &mut self, + caller: T::CrossAccountId, + new_owner: T::CrossAccountId, + ) -> DispatchResult { + self.check_is_owner(&caller)?; + self.collection.owner = new_owner.as_sub().clone(); + self.save() + } } #[frame_support::pallet] diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index 47d58eab2b291a1ac76b8559a600dab3e642d487..d242181c1dc40806dceed5ba9cb918e5644081f6 100644 GIT binary patch literal 2860 zcmaJ@Yitxn9N+2P-d!ccw$OueCAR^51OWv+kbroVpahNVUD{jY0?zblNh!5dhyt?D zqlAR)wFN{l5Mv-{2p&B#o6V3jixQ)JsDDU}KpG>~;-l@(D+ zY$rCxu7Obq33lGkiflBe8r&OFt8`{b%BbnFNDoq&BaTHFSpd&$gVQx-lTA{t&Q2#r zZ$+V2ui-w+GWhivacbZ`D{j&l*+YdnRJh(xHI&CKL5W`i8k|+aibSju^n9gO*S6P~ zUdqTgMXTF)`|O2MCL9F(?zx&{fa`rYniV|@c&_&M`J-823E+*xKOY8M26(4$-P2&W z4A`%4O=5S0XUo&*lMaZxKL%V1u1_DH)D5m_fL~AQTM0NXFJPY-_a*FJ0f|Fjw(Hm0 z&waS<`(0Il+?$y&I&NZ%(0r zTy~y(D8sMYhry2pb z`o?O>R?Fun17GY1jDsoE_fr6n=cjo2{tp3{Drh(yK2|iI6^)%mgDlXGHVJIWr~)=; zu%fAaGbr)RL+H+A$|*1B4N5rHaslT$_?EChuS;Y_^K%Xh?g0Cs@F#rLUXXXC!FU(X zHNMLGAYS6D_wo{Sz{y32O6B=N%RMRX?x1vN?Om(4hpxge-L-m+uiE_}hta+n${88S zSNU{!oCta`PfnO~^7sc;MO41kPzZp}jJ>hIurTuKco=-Bq-vjueMK+E5NeRHz&>O$ zV!LVOdBzkJ?!`s#LDUi&s)qKy?e&K@8U>6{D^OO>g8unu!3u)~u4L5iE_d3&V4h=! zC#WZ2gk4aaK4_Syp6Lf=%SS+|WqiUXApF%E6aIB!RHl=p&qU6Tz6)F?@*sACqtoSJ;w~DuTvbQ{6Q9hej%?^@ z(=-X^Jmk4+7(5}fdG;(5*(+4Zz%@h4n0O|if(p}2xZ#Mcus@h2(XYReD7d2W`!Q7N zONPd0Q5YtEh8~c)hD1*GIQad=Z)p>5>ck$!LJRXU)wTg^xRAItR1isXuiirUgwPJI zaAH{Fg*JNxwAH|{ekv3;bTDt{sOdH*$|Gs0&#(~u`s-QT;aM*sq04#oZs&#WC@gfx z&A3LzSWaf)5lEz)Z#)iiXf~3wbmDBbkdyEOo^ZEKx>eK0EgN2}u<%^l?GYo*_Z=J0 zneb%v=XQS6;`>+Z;TGS0eztgb4Jk*s)1wV32R|XHi`Jx<}kk^vwgoJ3x@i|BDfAv zeLgtcGvgJ%P{2rQUTm#*GLd*+#LEZDY2v_J)jB1HUWtw~@zRUz$4k$QcFC%3@`qmJ zc;TUEr>XbOv-{LdSz@|(gO0akQSO|pYO`g(T0#na<{nf`a{o7);!zc`^x`s>eAR=@M| zs3TWTo{o=qj_s(oub#O{TdR)z*0?P@`H%Y5t6J(72$B1RnH{e*ua@dowRW_#x(*4r Zd1YHm!^(!%j)r=vxm9Xq9nEVR{sE#_;M)KI literal 2824 zcmaJ@Yitxn9N+2Q-5waF1$w1klb%2biHf`qED~%XB0(a1M|(@MNM?F1waB{-J}P0K zS4b1Hcda1tRf!QuG$8>IHTnS|U_^}&(V)BxU{KKyhyg=ef3v%Hy`r+0OMWx|_hbGu z^gOLi(g{@4^`ygw|3rIhC~=rj?HEk>CZ)>LwQ?prpin{UQ)Nb+l$w5WLC1P}K1zio zt)qb?9Z!Wml@eXAa*T+^gk=idY(%oMN@GT;E;8XorC4TcK}OCxa!RGuMj31zhYdJE zV|t8M+k^(IbV6g9Qjqp2vIaJH(;!f+>wNo|V(1N&5GK42M`fA+Q>vbz1i#v-sB^Wy zDEKpBYD#57zs`gkRy`9Iq*RLu25iSPT5XoW`O%C_g9lbQBT+@RO_ETlP)Ws%6RoO@ zP+~jL3cCSDAtcy&KPxkltZHy?NTaePLlQi$SLcjoVh!M5`_JtMd>ruazK*$I zIN=%a)VOOcy(jqE$AI&}b!g)FZU~G4{Ca%fYQPD30sF|kU%=Q|kT~>Za~B(r`tarN zU#$b=F6?+@^GA>!o|onBgY-K{8^_g7@&%qh-r@jqyB(W;{R;3_USP`XOD%}E6C`DF z=zhSI55ct?u&Hz0Ho(JxE!N`8fF}S~K3w+$;Q3-TSZ6?*Enj&7uotj)!L6HsTuq(% z)FQwGd4aMAAIrelXCQHicKH) zP=w48l&|tW1P}4mOL+-8 z;AA7kQj+W7Ab)69v2D#2IF{2*_my*q^S3SZ^Z;c+79={z|S=j8DZ zstV8KTZ;<;@afPS6^Deu2S%cCe)LOvDT?3%goy@n7iMlEd1f);ggbH3I}o+FhB~3` zzx6u88+!uAqa}_kXX0<(HWRNKOgxfOyL0X&gF&AoaF55K$65`!cO3rxmj!fAC|MW7$D6J@G!MO_l zEGY8&CH;ICxJ=|B*aVIymxBeLrPY?J3Q1tW%9QHJhMqJ{lW@*1&t1dd37N^WXPL-e zp-Kj>5HgYl_xWLo*G)6-h7()}`-4de`gt?r1y?kF_XV%|lEIr96ov(Nq6cKIA)b|8 zj?f5?LpI^2PV7-Ebe}I1nrs`ehRcRqLj{pE_gXDJEbGq|5KUP3~L^XlEs3!PF}=#-mrjRvDxnT38vBHeuB z;?JVlNY>Jcv(-XQB;pBo+oW4HZQP*J1cgZzw%a2{lJ7eT}9=Pnmk%jIrs^YI(!kS(>5|*HE&QGzcMa;>Jjz9EV-Kf z`ZMW*WuV)6oqPBJ;iqn}O(g%ayUnlgDBrJeb+KP8Jjty-9~|zP@rqw4V0d9(Y>9U= zk$7Lk%LmG7;=o(=Iwgi)g^n}viVK@~#hHwD>D~r9 z-ihH)6!#?+KB=&9KVlld`^ZRI<>jciLAJp#-xa#JgcHNK%J8RC_=cj_TNqQko?8hE zpG&DG+0GwyJv(0E>2beQ|IVh?bt~GIjvX0$@0rU}H)cMVvtrrOyCR#MkTUW1J)x5fSO?z`wtaVLn K4Qp@R*!&O5E7S%6 diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index d077fe97d8..85c6074c12 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -31,103 +31,7 @@ contract ERC20Events { ); } -// Selector: 79cc6790 -contract ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) public returns (bool) { - require(false, stub_error); - from; - amount; - dummy = 0; - return false; - } -} - -// Selector: 942e8b22 -contract ERC20 is Dummy, ERC165, ERC20Events { - // Selector: name() 06fdde03 - function name() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: symbol() 95d89b41 - function symbol() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: decimals() 313ce567 - function decimals() public view returns (uint8) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) public view returns (uint256) { - require(false, stub_error); - owner; - dummy; - return 0; - } - - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 amount) public returns (bool) { - require(false, stub_error); - to; - amount; - dummy = 0; - return false; - } - - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 amount - ) public returns (bool) { - require(false, stub_error); - from; - to; - amount; - dummy = 0; - return false; - } - - // Selector: approve(address,uint256) 095ea7b3 - function approve(address spender, uint256 amount) public returns (bool) { - require(false, stub_error); - spender; - amount; - dummy = 0; - return false; - } - - // Selector: allowance(address,address) dd62ed3e - function allowance(address owner, address spender) - public - view - returns (uint256) - { - require(false, stub_error); - owner; - spender; - dummy; - return 0; - } -} - -// Selector: ca08c92c +// Selector: 07f76b0c contract Collection is Dummy, ERC165 { // Set collection property. // @@ -366,6 +270,23 @@ contract Collection is Dummy, ERC165 { return false; } + // Check that substrate account is the owner or admin of the collection + // + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: verifyOwnerOrAdminSubstrate(uint256) fe818e40 + function verifyOwnerOrAdminSubstrate(uint256 user) + public + view + returns (bool) + { + require(false, stub_error); + user; + dummy; + return false; + } + // Returns collection type // // @return `Fungible` or `NFT` or `ReFungible` @@ -377,10 +298,10 @@ contract Collection is Dummy, ERC165 { return ""; } - // Changes collection owner + // Changes collection owner to another account // // @dev Owner can be changed only by current owner - // @param newOwner new owner + // @param newOwner new owner account // // Selector: changeOwner(address) a6f9dae1 function changeOwner(address newOwner) public { @@ -388,6 +309,114 @@ contract Collection is Dummy, ERC165 { newOwner; dummy = 0; } + + // Changes collection owner to another substrate account + // + // @dev Owner can be changed only by current owner + // @param newOwner new owner substrate account + // + // Selector: changeOwnerSubstrate(uint256) 337e2c60 + function changeOwnerSubstrate(uint256 newOwner) public { + require(false, stub_error); + newOwner; + dummy = 0; + } +} + +// Selector: 79cc6790 +contract ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) public returns (bool) { + require(false, stub_error); + from; + amount; + dummy = 0; + return false; + } +} + +// Selector: 942e8b22 +contract ERC20 is Dummy, ERC165, ERC20Events { + // Selector: name() 06fdde03 + function name() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: symbol() 95d89b41 + function symbol() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: decimals() 313ce567 + function decimals() public view returns (uint8) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) public view returns (uint256) { + require(false, stub_error); + owner; + dummy; + return 0; + } + + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 amount) public returns (bool) { + require(false, stub_error); + to; + amount; + dummy = 0; + return false; + } + + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 amount + ) public returns (bool) { + require(false, stub_error); + from; + to; + amount; + dummy = 0; + return false; + } + + // Selector: approve(address,uint256) 095ea7b3 + function approve(address spender, uint256 amount) public returns (bool) { + require(false, stub_error); + spender; + amount; + dummy = 0; + return false; + } + + // Selector: allowance(address,address) dd62ed3e + function allowance(address owner, address spender) + public + view + returns (uint256) + { + require(false, stub_error); + owner; + spender; + dummy; + return 0; + } } contract UniqueFungible is diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 257d6e7321d8d03154bbfc174e8bc0d0a6cf1778..15894f674a5382520528070cb4797c6dad361c15 100644 GIT binary patch literal 4279 zcmai1eQ;FO72nHdv)QkZAPL4rvIT}R1q6pK7VGGOlxD=j%Sv|bJWB7)0um=6La?PM zyszDarr_I60Ig0NaH?fGo#|MtP#jzAP_@MtOFwO~IJLHn_>b5MjDh~{$J@MB$0ls} z-E+@9_uSt(=bpRtEX`!;3~HEW*6j{7mFdVrN`L}WT?>EzmeaM*8ZAKc@-$$K>RNYz zd_SibmUnEwpPo(9K$b3|by+%{21a#COmnhpwHnax&eNS%YgyB2%4#x$kl1g5wjg| z#=*{HZeA48<=gu^9f+>`{&0N z3A0Aw(a-PvDWvatJ8Yi$i%;WZ_rt)pllQoQ%M?^*w?FjuZ?NDkNFQ4B98MNo4_G{L z-LHjlk$Fg?!we!=Y~c&c8SA%z3cs2d|!-PFg1V2Y$~RV z!h)6a>H%+r^cL;hHvn$~%yfKkNhxHGk8cC~qPJOO^;18Fqi;g%+SUY;Y25P)D%z&b z*?$@EZAhmb*?dNMGdFzOI+zLj&0va$zIo0UN`SKfCuRS*9q>h^)lK#|YKB~W`6<8* zltRA?>VQ0u^{n|-z)c*Ez8(bJ0oZWugbx6R@~BE&SuA)f3ocwh>saVj6jEq)P7gqM z7Yi;I!V6qzp@cJ?Zc7WVV#2Xe4!ReF9-kaDQh%9`N-XqUv4jP`T6S4@Hy0jICc`6Q zO58pp$)HVt@oR2)4aWPk7b#L&H2#PtsW2`5x zs~P2LMq*Php0%cUD0sA_VQIw+Q{ojqcR*0?BLXXU*XZnCntX-+Gl@Xd5f<8pC@0<* zapjqTW*7J*E&2(QM%qB0;kG*|^IZ1702-weoY2BT|Bzx9I&ZPib2)veBH9@?R2uam zsbQu?ik(dc+ssyO@Vu1!`>d}!XN*o4&6NL&o@iN3lUi7PR~{c$e?322)|HvtZV}p! zM)Xl_8``#~tvt8TGRXv1|9FjCVh`AV1}mNsD_H$YX!F7{ij39k=+S1@p((pWNHbK= zC<8Qw9-p$wO*ByE?Vpt0a<)nXdY@h7OobCt-%6J?t}f|N`-VRwCs}ww(JEoL!JJ;! zw2D>{&y9fDX*gLL5N`+;UYEymvV?{2;NHQj@Yi7o=KBfB>Kbhq{#V=z z_p1VnU@V0s34ng?gu}uah^oN~KP~;x(t<5RIyr(zi3pj>0o+v8Q+e?ZpSM}~Xigud zsUdfWq=!@*7%)zq5@(=cyfkj7D`3DGW5B>`iZ#qp6f`XCw+AEzLmJJL2ndrJE0lAr zVO7cM_p_u`_$jcLL5*U+*z7^6?9}kwQ1LeTPQRr#8P+t`@IyS?P&i273P#8HwqjJq z=w(XP$ki%)%fkqZ+O2xBbDr6E!6;aOkqAgFA~F~u;29hjtNE{7tFj`Z8lzQpQyevN zvoaW2T0$&EK7b4u^vH;;k{X&nWx%y67|v+K%Ht!FS)-vOGJqEhkDVa{5*hJ!Ipn#G zCnfgqtVmyeDYeXgykh%h^+aA%vNVgl!y^B-SfmH{lPVG#LJ1_1U3fv7#QmlXXQFYr zqF5xljrS&t;&qTN@|=y%N;~!aV9BU!=j_ovXN%7Sd}9FZ9%YO5u3O+*cssL#8mxP98%FO z2lT``@^;$Fasi&Bimye&)lo zj{j=e@gH?$*KE13w{Ux)VSHeI-};^{slt65`!=&eUkbQq!=~P~8`f^@Te~LJvoW=i J_4Pck_J5}Zh3xTp^9nc ze{O=%_TNpQWvo+Vtboqoqo_!0ox;@8De6?lYU=}ZYAtr0Ixwvi3HaT6|9|sut2SZ7 zch5cN+;h%7kGu2??a0#)P)*nKPEVj|DcySmB|w38$H3n|6jbF}trci)kp{F;Rp|+k z0|m9TY{|ezdL}~ydD=-E@^l6bjH;CA`ZUK#YvAuG(rre%qNp@$H0eQ5%%Weay(Xnp z9HpSrHlvxJ^IMz)V`x^-(l(pW&@`RUY`KZ={h+95U=&n?K)0?7`l+I!cT+;Z@)QhK z6#glwdKV@5?Z^amq547*3>WaZuAst=CLMob)(Q}o7E}xWZHF0IjkcN1@MI!(m%tbc zCzClv#WqQoN&{19usv#^RTZ=-C&f^A1ZeF_5mu0GrgcoOhiZ@>I!m-k@kkte`wdTKV! zI{ra;QUKT1lXp6Rb6qI7w9>$Rum2LV-vjl&HBZ9k;70)MXQnW{{N?Z-rJRn=P z-ntN6j{@E^z2h1`7Y`fOMQoMw?|&b-Rs*gXoW2{>Ucfu8<*y0>t@QcpJAV(TgSug_ zF%R%T&*nLiMRzo_ajUS^X|Db>U@PEF2S;v$`ER%o0jiAh>0k9(z|(;9SIi9q{sVBKa`wxB z{|4+>a_Ma$3;6W-DS*x1VX@oxKMtD@fr~>3n1Ic*KT)2@#=QwRDgWXCs1?A;=@b$` z1hakiLl*&m2h8jtFebXV7a2?%5(d%69-f1*FhDK-&UA4zX13#4oCkK1mxKm zo!oK>aCH&&h33P8Q5Fo&rwuH0KT0ArwV(z-yov=U3*vV<@kSJ5N0-yu%IlGEtW|=} zdBMjw$CQMB#8(OnsX~MWKU8s8+bH9-n+s}1QL0K+JQV_ZmuBT@K+Jy@X)ofnU=y8ml}%!h zJYkVAw+>cCu7x6~A0#BNDzr^Rrs`C=T~%mA#Ii_|0K(6WuvqvKNVUs~te18u$RO}) z(#XAdP>3sYa{#@`^D5%qf8>D4B3laT2+a;V!z4HCrhx|K)GG4`M4p$*&0G}`u*M>w z;U&Z(XWbA)-W)WCWC(^8+EFG5nBa&eT;o`Da@iR4M@gx2FL0JdHG7aB7QJ3FTXk`c zE^`lwes0ik4;fJu7VX263x$IOu445?eymtku(Bz2SB_HMRT;sxxTkrZMIZCj98@VnFGg~V35X2*Ixv+*3n8J-qlOU#g5`XFAQgR**JyIoq2 z#SXIAHw_k>iH_tJ2@RnHGRQ8x{&eDe)#S#UkP@~{R1R4o(j z{vb-3Y@Yz?MVHFr<5=j8f;wc7oSxr~zk^&VKDD+#>%kqoC`FWv9VD+&3*G5TU0V`yl9d~GUuG=6Q|34?V9l4m!W_4qS*SRjlqazG zPo!oo$Kub{Ld0MCB02^!iDM!9ZyDU|aWg;hlE?ZN(=D}kM>TO-GS#A*94`roYVxZ0ifVG9WUh-U zOXg*Oe8Ek2^1|?PBI!Q+#Z2S=`f?%ZzIey#mAjqv>OcAYTKmQv6m7nA1wSISl5YRg z{GGja=xfqeBw}smL9y#UOT{e%-GtAD5#Cze4&=r%HB$=LTa{WMsVsG~-zt_W@a`*O zE?SZtF}0SS+T@81c3;1W(2qq5AKOyjLZeT9V)>Da{CPFUl-f@%`9163K>^RTQY9?Z-8*7R+-WAn=P zmh7?7or_N#`}V)){Jj`^VCm21T>VpR`M&c#=T00=ZoTQp>EN2pcdspdJP;ip_-OxK neVenTyVv(`Vx|5paNoKOYkSxAuJ7+%lkHodUC;Xa?&P9NIZ@eNd4EfiZ@%i!3~&~_pv(BC=t+|4d_Y{G`$ zIp_Pn^PS)M9%t!k+L5JKQBBvgc8{m|X}V_tB|x5Owt>HY$f?TpS}V}pJoRX!s?y^j zPvz9Y@@1RX(bGxl$SQR6Ropemjz0U6>xpLtq4-8*(a+(X8W7$m+tx*K(?b|F*%6lt$al7Mx@vR+qsU z3p5;|Ic6|kfTcHPjIIH^3GnzW z-G?VK?`~IW|0nOhj~z~7i9>1Ypzpg!Aaw$>-`jZpSAfp|{$l2gA()xv>T;ijEv>No z%Uhqv(l|)%yXH_Y;OAYbZ*IDIAx^dqOPjZxeI4)?2_Z!Qx2!sf<9JQL;!B@S^ zpy$^DijdX{+zh1t0jZ7CJFb;dn_j)!#_S1qGtMZ++}l;<={q6yW5Bzu6@Qfq_s;Kp z5AYaf*X}XC1b7;7{mfrp4fwHZX3oIZSGKS#s#scVT^k3S3%FwSs~-Y}C4|Da0F@)l zw*o!}n4jyP1-J;1?oF%*e9E=R&0stcON)1|zDG)Z_2BTGfDgG+3zahuV29O^;t)%> z19mLC@QGCD`1!atz#hzYns?j^xYpI>K4Z)sz3!oFs8pEOHP;V#t1A_{^T3a=!zD;f zPQ(yrSNvW=N$#}SyUs(wkJ;&m*PjIBKFEx_#@j-K)Y?gk7_9)AJwnLH8})r@&pGH=&B z+QfVxA;)~1a;gWD{mk3PC;f3g`2@1NBV)I=@&qRwYZb43PRQ}aF(ZLiKHAHC&kGgi zeV}5q0Lmrv9+f5oN5qmSOnZ`EyOI!AA=+T*Z2c%G%#PGN`Cl4Ay+Pye^`p=%J{oa7 zXt2%w89Q+3fTPEW7@G|=XoR1xUkks%M>X3G)*|a2YYxK^l;$z2qE|MIe%3I0kB?lN zQL(m{HC^CWA}Hqkj+u(38%FCIMq*R^2k6R^n8{S{ftE|ts%}(ygqc|+-Z#-^iaz?zLohdI@8P_ zFqrS1oH|q$oempH34h9w(9dIARh0cXCx1=lt14lQG&&+=c*H=*&S&|v;Q;{_lr zBgvS5Bigr~wP?yL5z+$D5ov&?(Ed{NQMkB6 zhuk-CqqE2YnW9m`Zu@g;MNz6sRlGzzdPcLd)FYl3ETHG{7%38+WJ)G6NS3fbFZT{! z1%_Y<=F5a+RfV<-|EqSD`&ETSFqT4)ctAgQ!eRjxQ?<(qyyp0!qy<}=zFFMA}bQKI(V+?3`Xt5xF+VBb( z>?)gs4h2IB?I;lt=1ANtonyiKOGde#C8f$wfxR@U70Y6?U5>ETz;p2X?j}Di8*-Cj zMPb30@uEZGAb_hFz0J23qY6eJP%1~ZQr%G*#?cxq}fmmjDiIi2_<=8h!HNl z1IL9n|8;a_RD>2ennuk{anw+^Ymk+2mm(fO1`N7ngzk4Fl=_eX*D_%^qoF7A_=sRu zs1NQCo-q9GH0MG>N8DXrblt{l6MMK;9ADmdr1UZ#xMe4MLjRI;X%-H$u-9NA3-w7R z3H2cbl87!mE_Gr*Y{HrF)s9B7NK_L~Q5MD(p*me^C`*DTCv(HH#k25PC&qaKYjyF<-HFI@W+CHrQkuXblO4-innkXvQN+JU z2zCr&659kjgPfg+%>SxIs;Xguo=72Yrj0D0zzf}Gk(+a>w&Su>)FoG>>}$HZL8%M zuVeLDBO^aL-xcjNWvYFe)#x3LP>t1SzcT?=qYwT+R-=zQ!VRpl=nox&>d1}m;fdkK zMD&>SjQ2Et-nv+b%2)GPzVc(o-29I<*UC5gpeXZ&OZX9?6_fQ(tFP?trm>rxO%aH- zo(IG7{4CaI8K@?_FAVe2Dl3rWGG;l-mwEM=JV$JQy;m&u9Iw8Db5W9<7E>$fvA0~c zcinKWSE(Z-_8%!3Z@OI4p$!*mqS;toIwgia1$Ep^Xe@p`zKNTOs-hN6d=Y2yOznGk zF-x7V;l)w4Tq34;SnBvz8OOcj8!(Goc^3ZxuH+KF)EZfd*l_pRz%d)J2Brj1W&D-JG<&0c!t zmgv+|14|As`nY+{x!+FRUHRzt!PlRA#h$Qg!+om@OFY4Gp6dqg>D!Ph+}A&_o)rdC bzSqIe8+-o?=S!DU literal 4238 zcmai1dyrdI8NbJD-pR6Cx+!Z)H}qvk`_h_H6vnhgr=z948@mbRR_2_|E_CgKK9)jT znBG^Ctp&WvZeL@;S{N(fAE=$NQyj%sij|6DQB)qbigfB@lmVU6VX41!&b`?iK;1Oy z@0{~}-}%n(e2;tSS(?k!=~Oq2ywj_+t)>UBqXbBq?3nm{xuB_^)H{IY7OA3-YHF`S zzE#jl%a&~4NYAFJlBWx4OP)@p%BV((VN7()ln(jcBHdx8YN|#vW}6Yfj8*h&O>StZ zHAgLIw99Pg`@D#K;0(9G*fBgYu_!ZIt0b6NnqPB#Qd3}Y4lJ+Ao4>v ztg8H5(2Qe`D-S%GxA_jFYW&A*A})jP=4*{O} zLeEjadt5l41xkPy$`_s<&w^cm|331EBY?92FO6oe!9Kz3Zw#n zznD6@4zS&m;`_R0_kViFF(~{FQio<9=?6Ry_|3O}e@>XyOOFN*JPFx{F#GtHOD6&E z_RQS5_4C)`Bn2#OzxS`t0nT+Hbe{#hx9sqY8*87ZrB5w5(Hv_3- zklHdOH`|rkdir)p?CVN#+QjC1sjoU^52SP`+-@&_-BtMVf`u;u9>DB|gXYHp9|PPp zvlzn>>r$3>(vX}08@au zCGWiL>gIlYMJM1)%r3OPv=s1Do|)*ahrb7(Phsh*RPq(Thg}HcoWaSn_Fe+~CE%2! zn-BoPu{q(-+y?kJzZs1ArMA!dYz43la6(wj&=gEAV1apJ@@IT< zCGs@a?R0eTR3#kiwSe=ckmHMEMncc?(Ha)qB2-x5#+t*zeSEUwnhf71mPCm;m<~9# zl&}g>zoGEqrjamvyy3|QX+&=DYeXJz8lC5(P)k3LI(@YEaJ<8Z}GF`9T}@#CZS#EFYlMW1=6>8(yr$w zIw2XyLYtf15_`b@ebBg1Xt2=N(Y=Lbq!kN&0~axGPA zysML%Q_DAKKufdAoT<=jQr^tgR4y**aQ6)pxyZuFvRT1yy#=kNs&%z4o+1>ZTetI6 z5swBed_xfr5@lkL?utcBk|!*D4fhUSg_pw+%vTA?Ybxy${@0y4_p1(zU@U_mQ9wU; z!e-$Km}*>Bc&GG3%?h@3>EuB?YltgzV*s_uJ5|`b|L_Tmg>fMxG&AfBlkBh?20DyW zyTTa=zb=hi**X}o#~9G@ki;S_E(MXcsx>4j7*=VnLO__5nC?2qBJ(O{)z6Yz=cmA4 zI@QZnzFFjpQrK?dIWpjFa%a_aHyKe?7QwxOb{@cWjOu(_F{)v7kWzQ#sP)~o5nPMA zn|HFvQ=ZvVU=%EHBQNs65F=c84#$Ny|43aoDk7JprrB^)95w1bZm{Up72KtW2ao}S z9vRVjQc?AX47hd^hBF#nS;SWavr2<$L;yS!cc;q>iQeV99o0Rz@uY}7JS)54x?p&5df5M_aGFdc-isU8<4I%~7h%P)B8pQdE#hv++)F_vUX5lfC#qgAn zE%TU-Ugk^2s8%8R{Q;yh*?A?_JKR|oyPAb!1#QSAStGv_zg4ak%Qn^*e{~m6O2Lx3 zi{w>1uhuFA|5y~gMb-E6=T83DNGPv5#kNVeP@OI}l_kNG%-q;RQijD2%NXYgto!0u zxZ{>H8yRPi%9Skkg4EKpEcV9+Mf@c|uwxR7I2PC$;_SrT{IA=ju9-IIiFXyPteNK% zc)E62JXFy1-S0VtFS+82T_@v9$LA@wYtDQOixW_p_SlltK+w6CafmU^TJe z|FN1VO5r9}Sz?_e$VYBs6;BK=CKB!&f#_-cyuMgSJSI(!-UN!H}dK$I2R>JwwOjqPu}mT?eW6hui_&k`F&6FsrO1s+Hj#3nvK1}pu{vLqK;cB zohAQ?w`eO>SGBT*muS|SY`jC4^Hjb`~>cvWsgt8MMj@FEXwDMPr4H7U`6Uvy-sar3K9*CTE9Mov!udv4>>Wp5mMVc*hy<}>?Gn-^z2^3vwNoI6l?Vn%D<<~!Dw v7Auh}lzD@z2R3I)cdQ@W#7cu1;DL1;*7mRKUq9I2ml;@}S { @@ -358,4 +359,54 @@ describe('Change owner tests', () => { await expect(collectionEvm.methods.changeOwner(newOwner).send({from: newOwner})).to.be.rejected; expect(await collectionEvm.methods.verifyOwnerOrAdmin(newOwner).call()).to.be.false; }); +}); + +describe('Change substrate owner tests', () => { + itWeb3('Change owner', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const newOwner = privateKeyWrapper('//Alice'); + const collectionHelper = evmCollectionHelpers(web3, owner); + const result = await collectionHelper.methods + .createNonfungibleCollection('A', 'B', 'C') + .send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + + expect(await collectionEvm.methods.verifyOwnerOrAdmin(owner).call()).to.be.true; + expect(await collectionEvm.methods.verifyOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; + await collectionEvm.methods.changeOwnerSubstrate(newOwner.addressRaw).send(); + + expect(await collectionEvm.methods.verifyOwnerOrAdmin(owner).call()).to.be.false; + expect(await collectionEvm.methods.verifyOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.true; + }); + + itWeb3('change owner call fee', async ({web3, api, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const newOwner = privateKeyWrapper('//Alice'); + const collectionHelper = evmCollectionHelpers(web3, owner); + const result = await collectionHelper.methods + .createNonfungibleCollection('A', 'B', 'C') + .send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + + const cost = await recordEthFee(api, owner, () => collectionEvm.methods.changeOwnerSubstrate(newOwner.addressRaw).send()); + expect(cost < BigInt(0.2 * Number(UNIQUE))); + expect(cost > 0); + }); + + itWeb3('(!negative tests!) call changeOwner by not owner', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const otherReceiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const newOwner = privateKeyWrapper('//Alice'); + const collectionHelper = evmCollectionHelpers(web3, owner); + const result = await collectionHelper.methods + .createNonfungibleCollection('A', 'B', 'C') + .send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + + await expect(collectionEvm.methods.changeOwnerSubstrate(newOwner.addressRaw).send({from: otherReceiver})).to.be.rejected; + expect(await collectionEvm.methods.verifyOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; + }); }); \ No newline at end of file diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index f2893caf74..c9754f049d 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -124,6 +124,15 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "newOwner", "type": "uint256" } + ], + "name": "changeOwnerSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], "name": "collectionProperty", @@ -326,5 +335,14 @@ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "user", "type": "uint256" } + ], + "name": "verifyOwnerOrAdminSubstrate", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" } ] diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index 820e4264a7..25b43672c1 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -154,6 +154,15 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "newOwner", "type": "uint256" } + ], + "name": "changeOwnerSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], "name": "collectionProperty", @@ -551,5 +560,14 @@ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "user", "type": "uint256" } + ], + "name": "verifyOwnerOrAdminSubstrate", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" } ] diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index b985797776..4984767b1d 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -154,6 +154,15 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "newOwner", "type": "uint256" } + ], + "name": "changeOwnerSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], "name": "collectionProperty", @@ -560,5 +569,14 @@ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "user", "type": "uint256" } + ], + "name": "verifyOwnerOrAdminSubstrate", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" } ] From cfc56eede4ca7f30af5e44a53275fdcfd695eb4b Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 23 Aug 2022 06:18:48 +0000 Subject: [PATCH 0494/1274] chore: update changelog --- Cargo.lock | 2 +- pallets/common/CHANGELOG.md | 5 +++++ pallets/common/Cargo.toml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 349987a982..2325b92c53 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5552,7 +5552,7 @@ dependencies = [ [[package]] name = "pallet-common" -version = "0.1.5" +version = "0.1.6" dependencies = [ "ethereum", "evm-coder", diff --git a/pallets/common/CHANGELOG.md b/pallets/common/CHANGELOG.md index 19c407e60d..6e1ae29217 100644 --- a/pallets/common/CHANGELOG.md +++ b/pallets/common/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## [0.1.6] - 2022-08-16 + +### Added +- New Ethereum API methods: changeOwner, changeOwnerSubstrate and verifyOwnerOrAdminSubstrate. + ## [v0.1.5] 2022-08-16 diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index 8139686784..cdebd3d08c 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-common" -version = "0.1.5" +version = "0.1.6" license = "GPLv3" edition = "2021" From bad3c4a980a63030a5b5781383969487f277ea39 Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Tue, 23 Aug 2022 06:32:46 +0000 Subject: [PATCH 0495/1274] Unlock all statemine test --- tests/src/xcmTransferStatemine.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/xcmTransferStatemine.test.ts b/tests/src/xcmTransferStatemine.test.ts index 097d510795..260a5e8624 100644 --- a/tests/src/xcmTransferStatemine.test.ts +++ b/tests/src/xcmTransferStatemine.test.ts @@ -266,7 +266,7 @@ describe('Integration test: Exchanging USDT with Statemine', () => { }, uniqueApiOptions); }); - it.skip('Should connect and send USDT from Unique to Statemine back', async () => { + it('Should connect and send USDT from Unique to Statemine back', async () => { let balanceBefore: bigint; const uniqueApiOptions: ApiOptions = { provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), From cedda9c5ec27f2b082391fb6ab0b202ea5afc354 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 23 Aug 2022 08:01:09 +0000 Subject: [PATCH 0496/1274] chore: fix code review --- Cargo.lock | 2 +- pallets/common/CHANGELOG.md | 2 +- pallets/common/src/erc.rs | 2 + pallets/common/src/lib.rs | 2 +- .../src/stubs/ContractHelpers.raw | Bin 1559 -> 1559 bytes pallets/fungible/src/stubs/UniqueFungible.raw | Bin 2860 -> 2853 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 206 ++-- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4279 -> 4272 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 960 +++++++++-------- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4306 -> 4299 bytes .../refungible/src/stubs/UniqueRefungible.sol | 978 +++++++++--------- .../src/stubs/UniqueRefungibleToken.raw | Bin 1574 -> 1567 bytes .../src/eth/stubs/CollectionHelpers.raw | Bin 1488 -> 1488 bytes tests/src/eth/api/UniqueFungible.sol | 99 +- tests/src/eth/api/UniqueNFT.sol | 377 ++++--- tests/src/eth/api/UniqueRefungible.sol | 377 ++++--- tests/src/eth/collectionAdmin.test.ts | 12 +- tests/src/eth/fungibleAbi.json | 12 +- tests/src/eth/nonFungibleAbi.json | 12 +- tests/src/eth/reFungibleAbi.json | 12 +- 20 files changed, 1517 insertions(+), 1536 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2325b92c53..cf645143d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12473,7 +12473,7 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "up-common" -version = "0.9.25" +version = "0.9.27" dependencies = [ "fp-rpc", "frame-support", diff --git a/pallets/common/CHANGELOG.md b/pallets/common/CHANGELOG.md index 6e1ae29217..463e62b0e6 100644 --- a/pallets/common/CHANGELOG.md +++ b/pallets/common/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. ## [0.1.6] - 2022-08-16 ### Added -- New Ethereum API methods: changeOwner, changeOwnerSubstrate and verifyOwnerOrAdminSubstrate. +- New Ethereum API methods: changeOwner, changeOwner(Substrate) and verifyOwnerOrAdmin(Substrate). ## [v0.1.5] 2022-08-16 diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 7e98281a90..3762595e7c 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -420,6 +420,7 @@ where /// /// @param user account to verify /// @return "true" if account is the owner or admin + #[solidity(rename_selector = "verifyOwnerOrAdmin")] fn verify_owner_or_admin_substrate(&self, user: uint256) -> Result { let user = convert_substrate_address_to_cross_account_id::(user); Ok(self @@ -455,6 +456,7 @@ where /// /// @dev Owner can be changed only by current owner /// @param newOwner new owner substrate account + #[solidity(rename_selector = "changeOwner")] fn change_owner_substrate(&mut self, caller: caller, new_owner: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); let new_owner = convert_substrate_address_to_cross_account_id::(new_owner); diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 15108c318e..bf044d4cc5 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -204,7 +204,7 @@ impl CollectionHandle { /// Save collection to storage. pub fn save(&self) -> DispatchResult { - >::insert(self.id, self.collection.clone()); + >::insert(self.id, &self.collection); Ok(()) } diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw index 74c566d94e921ca663bf24d7ab7bdfe21622e8fc..c726de9f05b7902c1fccb9082f430e3ef947f077 100644 GIT binary patch delta 53 zcmV-50LuTD43`YB#sw)&LHD|UAOxyU*gtl*RUelUfD*^M?8PlR;cJZ9dlx-qb8l>8 LLjVX6lkWv6WcL;F delta 53 zcmV-50LuTD43`YB#sw)Tj>)77`}bj9|M3FdvT!~=Z#4R5z&bgcik#7CtPrGRb8l>8 LLjVX5lkWv6sSX$A diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index d242181c1dc40806dceed5ba9cb918e5644081f6..b785260ca5d7ae24d821083f439f558f2216ef07 100644 GIT binary patch delta 1476 zcmZuwZD?Cn7|u!V$7!T4-P*9U%Nos`9lFsvvw;heIdOA#>>6wC@H%?Vq7-pz*}xx8 zntSfKH>2!Nl2eDnsRQSjsEAPgQE|dRinyV_MCOk=Siyon{9sB)YkklC&{Vt-^1RP^ z-jDmd=YEiWH=QCsl2Vy$CN^W`22HMfoZ<)(F@?5nc{yL&)GZn=ca*p9^kFz6AyLM_)jK@*~?Z?!H@0g#q9(0pxOqi z_tdkW0sAz-%LAJPu*E2$HJteq`YgbagrK@4;f*7+VVT#ye`7bmy}+K?RTC5OPH{Tk zKWJCIFMGfCHDT+a;`|uA$D1HD2eo?u9u1)^D(2&N?y{@n=bRyEuSD%-5*(ieWzkr8 z1>mOuOZ%1I`uH5o;NX$8Mw6b6Y0Y2uKaP?w2`EA5r> zh@_6U)U0@1U5_Tj!|Gk?M8zT`j8CeQy#|SqoKr`rOmd_@L;5*Ndk8fRLkwxf+ph+O zQsp~Nm3PDmEt^#qLr#smz*Vf4LDdw=c}OZg(e@q~HK{sE)f}`cm75I%{$pb+;lsOn zsLDXWd<9jfNWY7qb(-W5Rd-aZhT*U>=Nw7pMe(S9ckSC~j11=mzm+;BtJqGAa{Rwy)$Kyh!NFgOgskhhL%4@Nl$JO{eDNTae{ zQ~Zk8^=Z$A`a<|-V4o{T&>WG+`Q(Kt`6FTAY%Mg9)xpxbbayS)t_KoUU`&qqy9qzv z44bHZO@r!+%L6Omt8Q}SqNdAGW6}k+zA;D^9ugM!Qo!snseZrbufi!yzTu$;)$)4T0Cp&X>c<0*-ZtBUmZa#DTrK8n7F`N?0Z3BM;@*fL3 delta 1476 zcmZuwZ-`V?6rVfq?~LT`=+5M=o-0pSwB>&{za;C;g)v1-eXDvA&v ziKhqe1HzAYwO#ir)2%tJ`Pkh?2Bln|u-d|m!LZCWs%#aS3_(>+ch)j(;o8HOYPqF1^Mqdhw6+5I{4s5{=9g_k zq`hCO_d8B1O;s0mLkes^LM0oMJR1U52f0-Fc&N;6dO2VtdAI&fd~ir%c=f&J7>G^LN^aRKt;O-#!cJ|!l#ph>xsVl zUYT8N+!mq+RMbf5OaF$=pZWW_~w#wp!G9*bjH$mV`g>Q9zC1vRysMFPhmM z(^8U}bwifeqnx5K8^t=NC=SJVU#1wJ`fe>6ViUs@87fYQX*(IGhZ?8&vx&aSZxPqI zxrnfY+z&N1&xNB9dzceVgy70 diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index 85c6074c12..60c9e4b666 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -31,7 +31,103 @@ contract ERC20Events { ); } -// Selector: 07f76b0c +// Selector: 79cc6790 +contract ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) public returns (bool) { + require(false, stub_error); + from; + amount; + dummy = 0; + return false; + } +} + +// Selector: 942e8b22 +contract ERC20 is Dummy, ERC165, ERC20Events { + // Selector: name() 06fdde03 + function name() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: symbol() 95d89b41 + function symbol() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: decimals() 313ce567 + function decimals() public view returns (uint8) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) public view returns (uint256) { + require(false, stub_error); + owner; + dummy; + return 0; + } + + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 amount) public returns (bool) { + require(false, stub_error); + to; + amount; + dummy = 0; + return false; + } + + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 amount + ) public returns (bool) { + require(false, stub_error); + from; + to; + amount; + dummy = 0; + return false; + } + + // Selector: approve(address,uint256) 095ea7b3 + function approve(address spender, uint256 amount) public returns (bool) { + require(false, stub_error); + spender; + amount; + dummy = 0; + return false; + } + + // Selector: allowance(address,address) dd62ed3e + function allowance(address owner, address spender) + public + view + returns (uint256) + { + require(false, stub_error); + owner; + spender; + dummy; + return 0; + } +} + +// Selector: f077f83e contract Collection is Dummy, ERC165 { // Set collection property. // @@ -275,12 +371,8 @@ contract Collection is Dummy, ERC165 { // @param user account to verify // @return "true" if account is the owner or admin // - // Selector: verifyOwnerOrAdminSubstrate(uint256) fe818e40 - function verifyOwnerOrAdminSubstrate(uint256 user) - public - view - returns (bool) - { + // Selector: verifyOwnerOrAdmin(uint256) a83328e5 + function verifyOwnerOrAdmin(uint256 user) public view returns (bool) { require(false, stub_error); user; dummy; @@ -315,110 +407,14 @@ contract Collection is Dummy, ERC165 { // @dev Owner can be changed only by current owner // @param newOwner new owner substrate account // - // Selector: changeOwnerSubstrate(uint256) 337e2c60 - function changeOwnerSubstrate(uint256 newOwner) public { + // Selector: changeOwner(uint256) 924c19f7 + function changeOwner(uint256 newOwner) public { require(false, stub_error); newOwner; dummy = 0; } } -// Selector: 79cc6790 -contract ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) public returns (bool) { - require(false, stub_error); - from; - amount; - dummy = 0; - return false; - } -} - -// Selector: 942e8b22 -contract ERC20 is Dummy, ERC165, ERC20Events { - // Selector: name() 06fdde03 - function name() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: symbol() 95d89b41 - function symbol() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: decimals() 313ce567 - function decimals() public view returns (uint8) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) public view returns (uint256) { - require(false, stub_error); - owner; - dummy; - return 0; - } - - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 amount) public returns (bool) { - require(false, stub_error); - to; - amount; - dummy = 0; - return false; - } - - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 amount - ) public returns (bool) { - require(false, stub_error); - from; - to; - amount; - dummy = 0; - return false; - } - - // Selector: approve(address,uint256) 095ea7b3 - function approve(address spender, uint256 amount) public returns (bool) { - require(false, stub_error); - spender; - amount; - dummy = 0; - return false; - } - - // Selector: allowance(address,address) dd62ed3e - function allowance(address owner, address spender) - public - view - returns (uint256) - { - require(false, stub_error); - owner; - spender; - dummy; - return 0; - } -} - contract UniqueFungible is Dummy, ERC165, diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 15894f674a5382520528070cb4797c6dad361c15..fadbc8ef37408f3d9ea13455998a4cda59a9de98 100644 GIT binary patch delta 2149 zcmah}eQZ-z6yIIjb?^1Per#*QC|kRY!AuC7l0ra)f(itPJS%I(BHr6d^bf=c5}8B# zKKfcdrR^mc%z}YG2t-5#5ACePXgRv!4~4!2=Kao{fidjS^)6&@hisxCIS9AIykq5I1i?9ojjUm zWgyfJp|1y%!vH4%{C524D*$I0EV`_|yZOMBo)K{PA$HI;bQ+F0Ma%V*o7W92oC$(n z1OMP#H@*S5hz{3x`a$aA);n;}baoK+IYQtZIR8?~$hDj?$Fx2;t%D)%jll@^r`%%}oaf-Wys2Y1{2IgA29q8fm*$y=XP-E@ za|OVx%`%FE9R$|YrF{(my8zCVuD=QJVSw=kf87OWoDl!a*9vexz&YCUivjktGROLy zt;knMrio)OaXd8@JBfQYeb&|OJ7@T25yy1XcZ+Uwb>&{D_BCFpwm8nPhV2?=_A{2n z>5S=GQJvx5ZCEzPU2`74r8>rcU|7Rsxh=3d=#dP|7U~(Qwgg9wwWr29WmvXgVGrHX z5Y07LGsGn|mRb3}+#2zMS-C)*SJ?oKJlhh@n)YzTFOAq<;!=}ojBxzv%)IagJQ7wC z*og>T;%-1UX`j2>bra&4KIR^SZXR3fK7__fxDH3v0zwHK#gSGV(NIW7s4Ph|&W%U! z)0JFb?gw_O#66-B_t9i}Cyvq*MKLN#FeX?5D1!3^M^lhAHZrajt4KJSM=_8Cg2E12 z4M22)RjKijqP7W2u#OuQO{)ynSvtUXj=N@O-pHFh7`(eUsw1%I3BG;CI7U!w6?0Rp zJZ^SDV{#0|kY_9A`l-*;**lmb+#qRaOQt343gaj$vB|_`HW+TVU1*;nfMU;>iD#Hg zDZ;#q#^{>}XKlF>Bizq~yQ&f{L*Mg6mb(~N*HKzi{6WI6PsuS|fuZspMo1Y=7m&Q& z0hfq2H-mSYN3p&BaDV32;V$J-iFkVGJt5*};Y@1cGTo0ZIdxSEU^`h|#JxA@N z)4F-vR3e^p<{N?07sWRIhE2Fb4~rdq$TEcpy(ETnk23RqYrM?PYEe4M6^~?F4H+ebG_J2uXuyJ)glq+)4#oKy_x^2FRr&FiTUdKM5J_~ zuYKN!cJ!qEN+4n^y}5c->cvYo^V+|ea2>C{fZ;X)_|;)$~b!$3q)Bn=T!F u`_>;DA|JO-;K+gD%(ni_MPVC~71Sr+;Wd#E6MYASOhe5Qm=oK1OTOw7>H^zjN+6 z_uSJHji(!f_!^GI@oX$BN<6pT5y*cK+>g)?^f+oyx>gZq1cuQkWojmj()>lN&sNjk^*aEC?Cf3MxdbcmA8B^Mp&&Xn5r|%N;9VRZ7{o3(vxDt$TZ1wsTHJ9+OHA)

x(IIN8zQZbrHQ3=PgD4LgK6%O$9 zmfUPFdK9XKdTX4l3{Sz%b8uL-^6Zfy=6xK=BI5cukt%?7j%7BiJXl}R zjeJw>gdKTHhtdok2OVV)EA#|kkDBRaKFlw&WZVk+J70zRsK?vnQj>&J>3nbPQ-^H# zn4JYjaI)CEQKI{iYIb1AW`ukQPinlR+s>34{or zPRh{?YnE?gE@di}Me2WEaMerd!Y>g!ElO)Xl8tq#YvcHES;FO31*vz%x>H=Zp{$PFrWXZm33$Fh3mAGKO!Q zro|9%KSSY9dQhxo+acCQ=9*zjN&h~pSmIknC&jw-22-S#iqh7JzR`>db7hNFfQ9hw z#}VCJft*y33OR|@IbDqJBRlL9HtR$R_M|AJSb5D-#(We1m$E?CysX8sL+@2EQk7cR zXDuufu{w#u7^U{RimQ4lF2$o z;cqFDi(p48%XUKCl~j6l6~%KIl-rJoI7F8O8Xp+aM|xhIjW(@(clmow^^=3kSC8EM e!{4_1!Si2tpFhzRe|FQ$g9FPP9zPukwEYJWI=>VE diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index 1bc2ab9ec1..0fcf9e0df8 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -51,738 +51,734 @@ contract ERC721MintableEvents { event MintingFinished(); } -// Selector: 07f76b0c -contract Collection is Dummy, ERC165 { - // Set collection property. +// Selector: 41369377 +contract TokenProperties is Dummy, ERC165 { + // @notice Set permissions for token property. + // @dev Throws error if `msg.sender` is not admin or owner of the collection. + // @param key Property key. + // @param is_mutable Permission to mutate property. + // @param collection_admin Permission to mutate property by collection admin if property is mutable. + // @param token_owner Permission to mutate property by token owner if property is mutable. // + // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa + function setTokenPropertyPermission( + string memory key, + bool isMutable, + bool collectionAdmin, + bool tokenOwner + ) public { + require(false, stub_error); + key; + isMutable; + collectionAdmin; + tokenOwner; + dummy = 0; + } + + // @notice Set token property value. + // @dev Throws error if `msg.sender` has no permission to edit the property. + // @param tokenId ID of the token. // @param key Property key. - // @param value Propery value. + // @param value Property value. // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - public - { + // Selector: setProperty(uint256,string,bytes) 1752d67b + function setProperty( + uint256 tokenId, + string memory key, + bytes memory value + ) public { require(false, stub_error); + tokenId; key; value; dummy = 0; } - // Delete collection property. - // + // @notice Delete token property value. + // @dev Throws error if `msg.sender` has no permission to edit the property. + // @param tokenId ID of the token. // @param key Property key. // - // Selector: deleteCollectionProperty(string) 7b7debce - function deleteCollectionProperty(string memory key) public { + // Selector: deleteProperty(uint256,string) 066111d1 + function deleteProperty(uint256 tokenId, string memory key) public { require(false, stub_error); + tokenId; key; dummy = 0; } - // Get collection property. - // - // @dev Throws error if key not found. - // + // @notice Get token property value. + // @dev Throws error if key not found + // @param tokenId ID of the token. // @param key Property key. - // @return bytes The property corresponding to the key. + // @return Property value bytes // - // Selector: collectionProperty(string) cf24fd6d - function collectionProperty(string memory key) + // Selector: property(uint256,string) 7228c327 + function property(uint256 tokenId, string memory key) public view returns (bytes memory) { require(false, stub_error); + tokenId; key; dummy; return hex""; } +} - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. +// Selector: 42966c68 +contract ERC721Burnable is Dummy, ERC165 { + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized + // operator of the current owner. + // @param tokenId The NFT to approve // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) public { + // Selector: burn(uint256) 42966c68 + function burn(uint256 tokenId) public { require(false, stub_error); - sponsor; + tokenId; dummy = 0; } +} - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. +// Selector: 58800161 +contract ERC721 is Dummy, ERC165, ERC721Events { + // @notice Count all NFTs assigned to an owner + // @dev NFTs assigned to the zero address are considered invalid, and this + // function throws for queries about the zero address. + // @param owner An address for whom to query the balance + // @return The number of NFTs owned by `owner`, possibly zero // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() public { + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) public view returns (uint256) { require(false, stub_error); - dummy = 0; + owner; + dummy; + return 0; } - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. + // @notice Find the owner of an NFT + // @dev NFTs assigned to zero address are considered invalid, and queries + // about them do throw. + // @param tokenId The identifier for an NFT + // @return The address of the owner of the NFT // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) public { + // Selector: ownerOf(uint256) 6352211e + function ownerOf(uint256 tokenId) public view returns (address) { require(false, stub_error); - limit; - value; - dummy = 0; + tokenId; + dummy; + return 0x0000000000000000000000000000000000000000; } - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. + // @dev Not implemented // - // Selector: setCollectionLimit(string,bool) 993b7fba - function setCollectionLimit(string memory limit, bool value) public { + // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672 + function safeTransferFromWithData( + address from, + address to, + uint256 tokenId, + bytes memory data + ) public { require(false, stub_error); - limit; - value; + from; + to; + tokenId; + data; dummy = 0; } - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 - function contractAddress() public view returns (address) { - require(false, stub_error); - dummy; - return 0x0000000000000000000000000000000000000000; - } - - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. + // @dev Not implemented // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) public { + // Selector: safeTransferFrom(address,address,uint256) 42842e0e + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) public { require(false, stub_error); - newAdmin; + from; + to; + tokenId; dummy = 0; } - // Remove collection admin by substrate address. - // @param admin Substrate administrator address. + // @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE + // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + // THEY MAY BE PERMANENTLY LOST + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this NFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid NFT. + // @param from The current owner of the NFT + // @param to The new owner + // @param tokenId The NFT to transfer + // @param _value Not used for an NFT // - // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 - function removeCollectionAdminSubstrate(uint256 admin) public { + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 tokenId + ) public { require(false, stub_error); - admin; + from; + to; + tokenId; dummy = 0; } - // Add collection admin. - // @param new_admin Address of the added administrator. + // @notice Set or reaffirm the approved address for an NFT + // @dev The zero address indicates there is no approved address. + // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized + // operator of the current owner. + // @param approved The new approved NFT controller + // @param tokenId The NFT to approve // - // Selector: addCollectionAdmin(address) 92e462c7 - function addCollectionAdmin(address newAdmin) public { + // Selector: approve(address,uint256) 095ea7b3 + function approve(address approved, uint256 tokenId) public { require(false, stub_error); - newAdmin; + approved; + tokenId; dummy = 0; } - // Remove collection admin. - // - // @param new_admin Address of the removed administrator. + // @dev Not implemented // - // Selector: removeCollectionAdmin(address) fafd7b42 - function removeCollectionAdmin(address admin) public { + // Selector: setApprovalForAll(address,bool) a22cb465 + function setApprovalForAll(address operator, bool approved) public { require(false, stub_error); - admin; + operator; + approved; dummy = 0; } - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // @dev Not implemented // - // Selector: setCollectionNesting(bool) 112d4586 - function setCollectionNesting(bool enable) public { + // Selector: getApproved(uint256) 081812fc + function getApproved(uint256 tokenId) public view returns (address) { require(false, stub_error); - enable; - dummy = 0; + tokenId; + dummy; + return 0x0000000000000000000000000000000000000000; } - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' - // @param collections Addresses of collections that will be available for nesting. + // @dev Not implemented // - // Selector: setCollectionNesting(bool,address[]) 64872396 - function setCollectionNesting(bool enable, address[] memory collections) + // Selector: isApprovedForAll(address,address) e985e9c5 + function isApprovedForAll(address owner, address operator) public + view + returns (address) { require(false, stub_error); - enable; - collections; - dummy = 0; + owner; + operator; + dummy; + return 0x0000000000000000000000000000000000000000; } +} - // Set the collection access method. - // @param mode Access mode - // 0 for Normal - // 1 for AllowList +// Selector: 5b5e139f +contract ERC721Metadata is Dummy, ERC165 { + // @notice A descriptive name for a collection of NFTs in this contract // - // Selector: setCollectionAccess(uint8) 41835d4c - function setCollectionAccess(uint8 mode) public { + // Selector: name() 06fdde03 + function name() public view returns (string memory) { require(false, stub_error); - mode; - dummy = 0; + dummy; + return ""; } - // Add the user to the allowed list. - // - // @param user Address of a trusted user. + // @notice An abbreviated name for NFTs in this contract // - // Selector: addToCollectionAllowList(address) 67844fe6 - function addToCollectionAllowList(address user) public { + // Selector: symbol() 95d89b41 + function symbol() public view returns (string memory) { require(false, stub_error); - user; - dummy = 0; + dummy; + return ""; } - // Remove the user from the allowed list. + // @notice A distinct Uniform Resource Identifier (URI) for a given asset. // - // @param user Address of a removed user. + // @dev If the token has a `url` property and it is not empty, it is returned. + // Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + // If the collection property `baseURI` is empty or absent, return "" (empty string) + // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). // - // Selector: removeFromCollectionAllowList(address) 85c51acb - function removeFromCollectionAllowList(address user) public { + // @return token's const_metadata + // + // Selector: tokenURI(uint256) c87b56dd + function tokenURI(uint256 tokenId) public view returns (string memory) { require(false, stub_error); - user; - dummy = 0; + tokenId; + dummy; + return ""; } +} - // Switch permission for minting. - // - // @param mode Enable if "true". +// Selector: 68ccfe89 +contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { + // Selector: mintingFinished() 05d2035b + function mintingFinished() public view returns (bool) { + require(false, stub_error); + dummy; + return false; + } + + // @notice Function to mint token. + // @dev `tokenId` should be obtained with `nextTokenId` method, + // unlike standard, you can't specify it manually + // @param to The new owner + // @param tokenId ID of the minted NFT // - // Selector: setCollectionMintMode(bool) 00018e84 - function setCollectionMintMode(bool mode) public { + // Selector: mint(address,uint256) 40c10f19 + function mint(address to, uint256 tokenId) public returns (bool) { require(false, stub_error); - mode; + to; + tokenId; dummy = 0; + return false; } - // Check that account is the owner or admin of the collection + // @notice Function to mint token with the given tokenUri. + // @dev `tokenId` should be obtained with `nextTokenId` method, + // unlike standard, you can't specify it manually + // @param to The new owner + // @param tokenId ID of the minted NFT + // @param tokenUri Token URI that would be stored in the NFT properties // - // @param user account to verify - // @return "true" if account is the owner or admin + // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f + function mintWithTokenURI( + address to, + uint256 tokenId, + string memory tokenUri + ) public returns (bool) { + require(false, stub_error); + to; + tokenId; + tokenUri; + dummy = 0; + return false; + } + + // @dev Not implemented // - // Selector: verifyOwnerOrAdmin(address) c2282493 - function verifyOwnerOrAdmin(address user) public view returns (bool) { + // Selector: finishMinting() 7d64bcb4 + function finishMinting() public returns (bool) { require(false, stub_error); - user; - dummy; + dummy = 0; return false; } +} - // Check that substrate account is the owner or admin of the collection +// Selector: 780e9d63 +contract ERC721Enumerable is Dummy, ERC165 { + // @notice Enumerate valid NFTs + // @param index A counter less than `totalSupply()` + // @return The token identifier for the `index`th NFT, + // (sort order not specified) // - // @param user account to verify - // @return "true" if account is the owner or admin + // Selector: tokenByIndex(uint256) 4f6ccce7 + function tokenByIndex(uint256 index) public view returns (uint256) { + require(false, stub_error); + index; + dummy; + return 0; + } + + // @dev Not implemented // - // Selector: verifyOwnerOrAdminSubstrate(uint256) fe818e40 - function verifyOwnerOrAdminSubstrate(uint256 user) + // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 + function tokenOfOwnerByIndex(address owner, uint256 index) public view - returns (bool) + returns (uint256) { require(false, stub_error); - user; + owner; + index; dummy; - return false; + return 0; } - // Returns collection type + // @notice Count NFTs tracked by this contract + // @return A count of valid NFTs tracked by this contract, where each one of + // them has an assigned and queryable owner not equal to the zero address // - // @return `Fungible` or `NFT` or `ReFungible` + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } +} + +// Selector: d74d154f +contract ERC721UniqueExtensions is Dummy, ERC165 { + // @notice Transfer ownership of an NFT + // @dev Throws unless `msg.sender` is the current owner. Throws if `to` + // is the zero address. Throws if `tokenId` is not a valid NFT. + // @param to The new owner + // @param tokenId The NFT to transfer + // @param _value Not used for an NFT // - // Selector: uniqueCollectionType() d34b55b8 - function uniqueCollectionType() public returns (string memory) { + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 tokenId) public { require(false, stub_error); + to; + tokenId; dummy = 0; - return ""; } - // Changes collection owner to another account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner account + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this NFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid NFT. + // @param from The current owner of the NFT + // @param tokenId The NFT to transfer + // @param _value Not used for an NFT // - // Selector: changeOwner(address) a6f9dae1 - function changeOwner(address newOwner) public { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 tokenId) public { require(false, stub_error); - newOwner; + from; + tokenId; dummy = 0; } - // Changes collection owner to another substrate account + // @notice Returns next free NFT ID. // - // @dev Owner can be changed only by current owner - // @param newOwner new owner substrate account + // Selector: nextTokenId() 75794a3c + function nextTokenId() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } + + // @notice Function to mint multiple tokens. + // @dev `tokenIds` should be an array of consecutive numbers and first number + // should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokenIds IDs of the minted NFTs // - // Selector: changeOwnerSubstrate(uint256) 337e2c60 - function changeOwnerSubstrate(uint256 newOwner) public { + // Selector: mintBulk(address,uint256[]) 44a9945e + function mintBulk(address to, uint256[] memory tokenIds) + public + returns (bool) + { require(false, stub_error); - newOwner; + to; + tokenIds; dummy = 0; + return false; } -} -// Selector: 41369377 -contract TokenProperties is Dummy, ERC165 { - // @notice Set permissions for token property. - // @dev Throws error if `msg.sender` is not admin or owner of the collection. - // @param key Property key. - // @param is_mutable Permission to mutate property. - // @param collection_admin Permission to mutate property by collection admin if property is mutable. - // @param token_owner Permission to mutate property by token owner if property is mutable. + // @notice Function to mint multiple tokens with the given tokenUris. + // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // numbers and first number should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokens array of pairs of token ID and token URI for minted tokens // - // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa - function setTokenPropertyPermission( - string memory key, - bool isMutable, - bool collectionAdmin, - bool tokenOwner - ) public { + // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 + function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + public + returns (bool) + { require(false, stub_error); - key; - isMutable; - collectionAdmin; - tokenOwner; + to; + tokens; dummy = 0; + return false; } +} - // @notice Set token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. +// Selector: f077f83e +contract Collection is Dummy, ERC165 { + // Set collection property. + // // @param key Property key. - // @param value Property value. + // @param value Propery value. // - // Selector: setProperty(uint256,string,bytes) 1752d67b - function setProperty( - uint256 tokenId, - string memory key, - bytes memory value - ) public { + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + public + { require(false, stub_error); - tokenId; key; value; dummy = 0; } - // @notice Delete token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. + // Delete collection property. + // // @param key Property key. // - // Selector: deleteProperty(uint256,string) 066111d1 - function deleteProperty(uint256 tokenId, string memory key) public { + // Selector: deleteCollectionProperty(string) 7b7debce + function deleteCollectionProperty(string memory key) public { require(false, stub_error); - tokenId; key; dummy = 0; } - // @notice Get token property value. - // @dev Throws error if key not found - // @param tokenId ID of the token. + // Get collection property. + // + // @dev Throws error if key not found. + // // @param key Property key. - // @return Property value bytes + // @return bytes The property corresponding to the key. // - // Selector: property(uint256,string) 7228c327 - function property(uint256 tokenId, string memory key) + // Selector: collectionProperty(string) cf24fd6d + function collectionProperty(string memory key) public view returns (bytes memory) { require(false, stub_error); - tokenId; key; dummy; return hex""; } -} - -// Selector: 42966c68 -contract ERC721Burnable is Dummy, ERC165 { - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized - // operator of the current owner. - // @param tokenId The NFT to approve - // - // Selector: burn(uint256) 42966c68 - function burn(uint256 tokenId) public { - require(false, stub_error); - tokenId; - dummy = 0; - } -} -// Selector: 58800161 -contract ERC721 is Dummy, ERC165, ERC721Events { - // @notice Count all NFTs assigned to an owner - // @dev NFTs assigned to the zero address are considered invalid, and this - // function throws for queries about the zero address. - // @param owner An address for whom to query the balance - // @return The number of NFTs owned by `owner`, possibly zero + // Set the sponsor of the collection. // - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) public view returns (uint256) { - require(false, stub_error); - owner; - dummy; - return 0; - } - - // @notice Find the owner of an NFT - // @dev NFTs assigned to zero address are considered invalid, and queries - // about them do throw. - // @param tokenId The identifier for an NFT - // @return The address of the owner of the NFT + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. // - // Selector: ownerOf(uint256) 6352211e - function ownerOf(uint256 tokenId) public view returns (address) { - require(false, stub_error); - tokenId; - dummy; - return 0x0000000000000000000000000000000000000000; - } - - // @dev Not implemented + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. // - // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672 - function safeTransferFromWithData( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public { + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) public { require(false, stub_error); - from; - to; - tokenId; - data; + sponsor; dummy = 0; } - // @dev Not implemented + // Collection sponsorship confirmation. // - // Selector: safeTransferFrom(address,address,uint256) 42842e0e - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public { - require(false, stub_error); - from; - to; - tokenId; - dummy = 0; - } - - // @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE - // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE - // THEY MAY BE PERMANENTLY LOST - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this NFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid NFT. - // @param from The current owner of the NFT - // @param to The new owner - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT + // @dev After setting the sponsor for the collection, it must be confirmed with this function. // - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 tokenId - ) public { + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() public { require(false, stub_error); - from; - to; - tokenId; dummy = 0; } - // @notice Set or reaffirm the approved address for an NFT - // @dev The zero address indicates there is no approved address. - // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized - // operator of the current owner. - // @param approved The new approved NFT controller - // @param tokenId The NFT to approve + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. // - // Selector: approve(address,uint256) 095ea7b3 - function approve(address approved, uint256 tokenId) public { + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) public { require(false, stub_error); - approved; - tokenId; + limit; + value; dummy = 0; } - // @dev Not implemented + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. // - // Selector: setApprovalForAll(address,bool) a22cb465 - function setApprovalForAll(address operator, bool approved) public { + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) public { require(false, stub_error); - operator; - approved; + limit; + value; dummy = 0; } - // @dev Not implemented - // - // Selector: getApproved(uint256) 081812fc - function getApproved(uint256 tokenId) public view returns (address) { - require(false, stub_error); - tokenId; - dummy; - return 0x0000000000000000000000000000000000000000; - } - - // @dev Not implemented + // Get contract address. // - // Selector: isApprovedForAll(address,address) e985e9c5 - function isApprovedForAll(address owner, address operator) - public - view - returns (address) - { + // Selector: contractAddress() f6b4dfb4 + function contractAddress() public view returns (address) { require(false, stub_error); - owner; - operator; dummy; return 0x0000000000000000000000000000000000000000; } -} -// Selector: 5b5e139f -contract ERC721Metadata is Dummy, ERC165 { - // @notice A descriptive name for a collection of NFTs in this contract + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. // - // Selector: name() 06fdde03 - function name() public view returns (string memory) { + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) public { require(false, stub_error); - dummy; - return ""; + newAdmin; + dummy = 0; } - // @notice An abbreviated name for NFTs in this contract + // Remove collection admin by substrate address. + // @param admin Substrate administrator address. // - // Selector: symbol() 95d89b41 - function symbol() public view returns (string memory) { + // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + function removeCollectionAdminSubstrate(uint256 admin) public { require(false, stub_error); - dummy; - return ""; + admin; + dummy = 0; } - // @notice A distinct Uniform Resource Identifier (URI) for a given asset. + // Add collection admin. + // @param new_admin Address of the added administrator. // - // @dev If the token has a `url` property and it is not empty, it is returned. - // Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. - // If the collection property `baseURI` is empty or absent, return "" (empty string) - // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix - // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). + // Selector: addCollectionAdmin(address) 92e462c7 + function addCollectionAdmin(address newAdmin) public { + require(false, stub_error); + newAdmin; + dummy = 0; + } + + // Remove collection admin. // - // @return token's const_metadata + // @param new_admin Address of the removed administrator. // - // Selector: tokenURI(uint256) c87b56dd - function tokenURI(uint256 tokenId) public view returns (string memory) { + // Selector: removeCollectionAdmin(address) fafd7b42 + function removeCollectionAdmin(address admin) public { require(false, stub_error); - tokenId; - dummy; - return ""; + admin; + dummy = 0; } -} -// Selector: 68ccfe89 -contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { - // Selector: mintingFinished() 05d2035b - function mintingFinished() public view returns (bool) { + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // + // Selector: setCollectionNesting(bool) 112d4586 + function setCollectionNesting(bool enable) public { require(false, stub_error); - dummy; - return false; + enable; + dummy = 0; } - // @notice Function to mint token. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted NFT + // Toggle accessibility of collection nesting. // - // Selector: mint(address,uint256) 40c10f19 - function mint(address to, uint256 tokenId) public returns (bool) { + // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + // @param collections Addresses of collections that will be available for nesting. + // + // Selector: setCollectionNesting(bool,address[]) 64872396 + function setCollectionNesting(bool enable, address[] memory collections) + public + { require(false, stub_error); - to; - tokenId; + enable; + collections; dummy = 0; - return false; } - // @notice Function to mint token with the given tokenUri. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted NFT - // @param tokenUri Token URI that would be stored in the NFT properties + // Set the collection access method. + // @param mode Access mode + // 0 for Normal + // 1 for AllowList // - // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f - function mintWithTokenURI( - address to, - uint256 tokenId, - string memory tokenUri - ) public returns (bool) { + // Selector: setCollectionAccess(uint8) 41835d4c + function setCollectionAccess(uint8 mode) public { require(false, stub_error); - to; - tokenId; - tokenUri; + mode; dummy = 0; - return false; } - // @dev Not implemented + // Add the user to the allowed list. // - // Selector: finishMinting() 7d64bcb4 - function finishMinting() public returns (bool) { + // @param user Address of a trusted user. + // + // Selector: addToCollectionAllowList(address) 67844fe6 + function addToCollectionAllowList(address user) public { require(false, stub_error); + user; dummy = 0; - return false; } -} -// Selector: 780e9d63 -contract ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid NFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) + // Remove the user from the allowed list. // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) public view returns (uint256) { + // @param user Address of a removed user. + // + // Selector: removeFromCollectionAllowList(address) 85c51acb + function removeFromCollectionAllowList(address user) public { require(false, stub_error); - index; - dummy; - return 0; + user; + dummy = 0; } - // @dev Not implemented + // Switch permission for minting. // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - public - view - returns (uint256) - { + // @param mode Enable if "true". + // + // Selector: setCollectionMintMode(bool) 00018e84 + function setCollectionMintMode(bool mode) public { require(false, stub_error); - owner; - index; - dummy; - return 0; + mode; + dummy = 0; } - // @notice Count NFTs tracked by this contract - // @return A count of valid NFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address + // Check that account is the owner or admin of the collection // - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: verifyOwnerOrAdmin(address) c2282493 + function verifyOwnerOrAdmin(address user) public view returns (bool) { require(false, stub_error); + user; dummy; - return 0; + return false; } -} -// Selector: d74d154f -contract ERC721UniqueExtensions is Dummy, ERC165 { - // @notice Transfer ownership of an NFT - // @dev Throws unless `msg.sender` is the current owner. Throws if `to` - // is the zero address. Throws if `tokenId` is not a valid NFT. - // @param to The new owner - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT + // Check that substrate account is the owner or admin of the collection // - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 tokenId) public { + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: verifyOwnerOrAdmin(uint256) a83328e5 + function verifyOwnerOrAdmin(uint256 user) public view returns (bool) { require(false, stub_error); - to; - tokenId; - dummy = 0; + user; + dummy; + return false; } - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this NFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid NFT. - // @param from The current owner of the NFT - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT + // Returns collection type // - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 tokenId) public { + // @return `Fungible` or `NFT` or `ReFungible` + // + // Selector: uniqueCollectionType() d34b55b8 + function uniqueCollectionType() public returns (string memory) { require(false, stub_error); - from; - tokenId; dummy = 0; + return ""; } - // @notice Returns next free NFT ID. + // Changes collection owner to another account // - // Selector: nextTokenId() 75794a3c - function nextTokenId() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } - - // @notice Function to mint multiple tokens. - // @dev `tokenIds` should be an array of consecutive numbers and first number - // should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokenIds IDs of the minted NFTs + // @dev Owner can be changed only by current owner + // @param newOwner new owner account // - // Selector: mintBulk(address,uint256[]) 44a9945e - function mintBulk(address to, uint256[] memory tokenIds) - public - returns (bool) - { + // Selector: changeOwner(address) a6f9dae1 + function changeOwner(address newOwner) public { require(false, stub_error); - to; - tokenIds; + newOwner; dummy = 0; - return false; } - // @notice Function to mint multiple tokens with the given tokenUris. - // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // numbers and first number should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokens array of pairs of token ID and token URI for minted tokens + // Changes collection owner to another substrate account // - // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 - function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) - public - returns (bool) - { + // @dev Owner can be changed only by current owner + // @param newOwner new owner substrate account + // + // Selector: changeOwner(uint256) 924c19f7 + function changeOwner(uint256 newOwner) public { require(false, stub_error); - to; - tokens; + newOwner; dummy = 0; - return false; } } diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index e12b70f1b6cbd5ce31f7c1287ea3a5e15cfb5839..c45f8c3112aed74ffd5a26bbc6643d0657345071 100644 GIT binary patch delta 2146 zcmZWp3v5$W817lucK6lC=;k^G?dVXHFlS65nuT;=!eD@xX0*aZbI(fRgNXw~!(;Z| z_O@d|vFn*LV0;V(5s^e$0w@~siB2RDA_g-BGlPqfXo3QUMgMajqt&!&zVClO&fjn9 zhwFXvc{v)BZDW~4;TodMvT>EwmNHj6848SFYqK47MzFd1Q{%xbX|OL{Wf5O(g3OGK2TITYy=m9(!4 zS0oJ!5m$7PTi9uBd4p>a8Nnwy*{)Kny;huedeUZ`ei3|*%b^^?j|_OT^Xkawdsb8Uk+uF&ibGl4Mp-|fqvo=oVFazWbKtzn3+TVV5`}smj6oP z<7!YBxs99V7)W4dfGp$cmJC_y_pR`9NXep!^7Ss6bB2}L1B2_KGpxkSB~uo`EW*t7 zG-kTVyIe38GUVATk}|5d3bQ1kM6z@YY%^7<<5CVO&)8ubsCN=bW2O|dE3tEFT-ugK z5jEBezdgFw`U$=A?Dh<-Qr|;*JBo=~Ozg`c_+l0gMpT}Mwcf|qpu=PxA71#qQ3+;8 z>009w3@fC-w2D{5*$g8M$w3w6CSlHJ2$Trsf>vK6d~JBHAunjCAf+{Ej9Zn+MA9)T z$ZIH%x%s442)Y$BE7waWN)`xH*f&iPypgp+&HR&=#kX0#E+S%XRDTJ^g5@YI0E(51 z_CP1WJ55Kvl6)c5FTBH|cW2C3^Z)+%xM4KWAOD~sfd2T6H~I@K=lcysNrRZ*Z@i15 zKKY&WoxxRU^qKL)W))6XTJNUl3Gx@opxe*!)*BWW@}awq-j=&A6gB+Rl644Xxmf5R z0nZfF4FRfB#7rT)oP|@?*I$715e~{B%{UnS0P-ITVa?;^<#H;0=xG?_J0Do>U2!2s*)X((`Z06 zq_*uU{QcxZvQ5g-lW^}&sO?%B#qwE{??u?%OJr~Tt;@v9(bk{T?#p#sFTJ$s+}MW6 hZ!LLs&iU8Q1V28T8n!>Vdc$L#$@#VlFWK*%@h^9**nj{4 delta 2232 zcmY*Z3v5$W7~Y}n+S~TF-B>4MV{7S#C^(j22^z8#5Sd#dm!`Cii{u_gqQJ!P5Hfk} zzS@EcxxEK4fFz<3SezOJB4mUR14=T4i1-Kw6hoq9iW(mQWaxkHW42q;e*gD>|MQ&F z!RV!Eh48(QND31KQIe9{lCn_$;fg&7{Ym;!b8lBNT3>BD^P9ah0XhMm+mOCm zfy>?kcr$zREWnKxtirAZ0RKMv-BEyD0PhZOm{o z*f{(Gz_|dw=vZ*P3OjaF)pRO5aOcW(C~*yZ6k5spTyG43>@u+LuDkmQ!1n=uJh72L zo=K!Is=4>2p7t5g@hadqY#O=%u)~5NK>#-`Jqc|(6oA>YV+XCw`i&)@8qjK!rUBJ& zpjsD8G+U~k^UrBUeM?0*Wi_!hAKL{gGS$)CVtJ>mUDR2DN9mAbmf9Qu*aC1~_xT?I zdMyYsuaSZy{7fql!v5;jKpe7{MZ>_Zq8WB|KM#_&a3iYzoi#QCvXqpQv?+ zGNkpi*#Rjs%#86ZH%$(E){}^Le8=mit&T*|UOeyFK_~L^7KF2j#GDf%IfPwb zr+FQ$uY`nU6~MYdwt1uD7^fA=uqrfY2$@f=Sj1_7EL1U{swf4EceF( zKbY09cgQ&8-`VOWpWEbAxEB)2jmEw)CLzYLZ-O-hnH;E@@0(*fbQS5mtU|NCu8b0w zla$b4D(q`d^Wsj<_|rLET=dJoajc%4C*m12NT9jvfPPUH6h!F)b zn>T_k+d)^e#=#Q~`-Y7B0x9;gW!6#b2yJnYpg5>Sc#Qy*e2>X5j diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index 8c5b422251..ae76fd479c 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -51,750 +51,746 @@ contract ERC721MintableEvents { event MintingFinished(); } -// Selector: 07f76b0c -contract Collection is Dummy, ERC165 { - // Set collection property. +// Selector: 41369377 +contract TokenProperties is Dummy, ERC165 { + // @notice Set permissions for token property. + // @dev Throws error if `msg.sender` is not admin or owner of the collection. + // @param key Property key. + // @param is_mutable Permission to mutate property. + // @param collection_admin Permission to mutate property by collection admin if property is mutable. + // @param token_owner Permission to mutate property by token owner if property is mutable. // + // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa + function setTokenPropertyPermission( + string memory key, + bool isMutable, + bool collectionAdmin, + bool tokenOwner + ) public { + require(false, stub_error); + key; + isMutable; + collectionAdmin; + tokenOwner; + dummy = 0; + } + + // @notice Set token property value. + // @dev Throws error if `msg.sender` has no permission to edit the property. + // @param tokenId ID of the token. // @param key Property key. - // @param value Propery value. + // @param value Property value. // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - public - { + // Selector: setProperty(uint256,string,bytes) 1752d67b + function setProperty( + uint256 tokenId, + string memory key, + bytes memory value + ) public { require(false, stub_error); + tokenId; key; value; dummy = 0; } - // Delete collection property. - // + // @notice Delete token property value. + // @dev Throws error if `msg.sender` has no permission to edit the property. + // @param tokenId ID of the token. // @param key Property key. // - // Selector: deleteCollectionProperty(string) 7b7debce - function deleteCollectionProperty(string memory key) public { + // Selector: deleteProperty(uint256,string) 066111d1 + function deleteProperty(uint256 tokenId, string memory key) public { require(false, stub_error); + tokenId; key; dummy = 0; } - // Get collection property. - // - // @dev Throws error if key not found. - // + // @notice Get token property value. + // @dev Throws error if key not found + // @param tokenId ID of the token. // @param key Property key. - // @return bytes The property corresponding to the key. + // @return Property value bytes // - // Selector: collectionProperty(string) cf24fd6d - function collectionProperty(string memory key) + // Selector: property(uint256,string) 7228c327 + function property(uint256 tokenId, string memory key) public view returns (bytes memory) { require(false, stub_error); + tokenId; key; dummy; return hex""; } +} - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. +// Selector: 42966c68 +contract ERC721Burnable is Dummy, ERC165 { + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current RFT owner, or an authorized + // operator of the current owner. + // @param tokenId The RFT to approve // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) public { + // Selector: burn(uint256) 42966c68 + function burn(uint256 tokenId) public { require(false, stub_error); - sponsor; + tokenId; dummy = 0; } +} - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. +// Selector: 58800161 +contract ERC721 is Dummy, ERC165, ERC721Events { + // @notice Count all RFTs assigned to an owner + // @dev RFTs assigned to the zero address are considered invalid, and this + // function throws for queries about the zero address. + // @param owner An address for whom to query the balance + // @return The number of RFTs owned by `owner`, possibly zero // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() public { + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) public view returns (uint256) { require(false, stub_error); - dummy = 0; + owner; + dummy; + return 0; } - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. + // @notice Find the owner of an RFT + // @dev RFTs assigned to zero address are considered invalid, and queries + // about them do throw. + // Returns special 0xffffffffffffffffffffffffffffffffffffffff address for + // the tokens that are partially owned. + // @param tokenId The identifier for an RFT + // @return The address of the owner of the RFT // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) public { + // Selector: ownerOf(uint256) 6352211e + function ownerOf(uint256 tokenId) public view returns (address) { require(false, stub_error); - limit; - value; - dummy = 0; + tokenId; + dummy; + return 0x0000000000000000000000000000000000000000; } - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. + // @dev Not implemented // - // Selector: setCollectionLimit(string,bool) 993b7fba - function setCollectionLimit(string memory limit, bool value) public { + // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672 + function safeTransferFromWithData( + address from, + address to, + uint256 tokenId, + bytes memory data + ) public { require(false, stub_error); - limit; - value; + from; + to; + tokenId; + data; dummy = 0; } - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 - function contractAddress() public view returns (address) { - require(false, stub_error); - dummy; - return 0x0000000000000000000000000000000000000000; - } - - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. + // @dev Not implemented // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) public { + // Selector: safeTransferFrom(address,address,uint256) 42842e0e + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) public { require(false, stub_error); - newAdmin; + from; + to; + tokenId; dummy = 0; } - // Remove collection admin by substrate address. - // @param admin Substrate administrator address. + // @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE + // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + // THEY MAY BE PERMANENTLY LOST + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this RFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param from The current owner of the NFT + // @param to The new owner + // @param tokenId The NFT to transfer + // @param _value Not used for an NFT // - // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 - function removeCollectionAdminSubstrate(uint256 admin) public { + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 tokenId + ) public { require(false, stub_error); - admin; + from; + to; + tokenId; dummy = 0; } - // Add collection admin. - // @param new_admin Address of the added administrator. + // @dev Not implemented // - // Selector: addCollectionAdmin(address) 92e462c7 - function addCollectionAdmin(address newAdmin) public { + // Selector: approve(address,uint256) 095ea7b3 + function approve(address approved, uint256 tokenId) public { require(false, stub_error); - newAdmin; + approved; + tokenId; dummy = 0; } - // Remove collection admin. - // - // @param new_admin Address of the removed administrator. + // @dev Not implemented // - // Selector: removeCollectionAdmin(address) fafd7b42 - function removeCollectionAdmin(address admin) public { + // Selector: setApprovalForAll(address,bool) a22cb465 + function setApprovalForAll(address operator, bool approved) public { require(false, stub_error); - admin; + operator; + approved; dummy = 0; } - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // @dev Not implemented // - // Selector: setCollectionNesting(bool) 112d4586 - function setCollectionNesting(bool enable) public { + // Selector: getApproved(uint256) 081812fc + function getApproved(uint256 tokenId) public view returns (address) { require(false, stub_error); - enable; - dummy = 0; + tokenId; + dummy; + return 0x0000000000000000000000000000000000000000; } - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' - // @param collections Addresses of collections that will be available for nesting. + // @dev Not implemented // - // Selector: setCollectionNesting(bool,address[]) 64872396 - function setCollectionNesting(bool enable, address[] memory collections) + // Selector: isApprovedForAll(address,address) e985e9c5 + function isApprovedForAll(address owner, address operator) public + view + returns (address) { require(false, stub_error); - enable; - collections; - dummy = 0; + owner; + operator; + dummy; + return 0x0000000000000000000000000000000000000000; } +} - // Set the collection access method. - // @param mode Access mode - // 0 for Normal - // 1 for AllowList +// Selector: 5b5e139f +contract ERC721Metadata is Dummy, ERC165 { + // @notice A descriptive name for a collection of RFTs in this contract // - // Selector: setCollectionAccess(uint8) 41835d4c - function setCollectionAccess(uint8 mode) public { + // Selector: name() 06fdde03 + function name() public view returns (string memory) { require(false, stub_error); - mode; - dummy = 0; + dummy; + return ""; } - // Add the user to the allowed list. - // - // @param user Address of a trusted user. + // @notice An abbreviated name for RFTs in this contract // - // Selector: addToCollectionAllowList(address) 67844fe6 - function addToCollectionAllowList(address user) public { + // Selector: symbol() 95d89b41 + function symbol() public view returns (string memory) { require(false, stub_error); - user; - dummy = 0; + dummy; + return ""; } - // Remove the user from the allowed list. - // - // @param user Address of a removed user. + // @notice A distinct Uniform Resource Identifier (URI) for a given asset. // - // Selector: removeFromCollectionAllowList(address) 85c51acb - function removeFromCollectionAllowList(address user) public { - require(false, stub_error); - user; - dummy = 0; - } - - // Switch permission for minting. + // @dev If the token has a `url` property and it is not empty, it is returned. + // Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + // If the collection property `baseURI` is empty or absent, return "" (empty string) + // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). // - // @param mode Enable if "true". + // @return token's const_metadata // - // Selector: setCollectionMintMode(bool) 00018e84 - function setCollectionMintMode(bool mode) public { + // Selector: tokenURI(uint256) c87b56dd + function tokenURI(uint256 tokenId) public view returns (string memory) { require(false, stub_error); - mode; - dummy = 0; + tokenId; + dummy; + return ""; } +} - // Check that account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: verifyOwnerOrAdmin(address) c2282493 - function verifyOwnerOrAdmin(address user) public view returns (bool) { +// Selector: 68ccfe89 +contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { + // Selector: mintingFinished() 05d2035b + function mintingFinished() public view returns (bool) { require(false, stub_error); - user; dummy; return false; } - // Check that substrate account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin + // @notice Function to mint token. + // @dev `tokenId` should be obtained with `nextTokenId` method, + // unlike standard, you can't specify it manually + // @param to The new owner + // @param tokenId ID of the minted RFT // - // Selector: verifyOwnerOrAdminSubstrate(uint256) fe818e40 - function verifyOwnerOrAdminSubstrate(uint256 user) - public - view - returns (bool) - { + // Selector: mint(address,uint256) 40c10f19 + function mint(address to, uint256 tokenId) public returns (bool) { require(false, stub_error); - user; - dummy; + to; + tokenId; + dummy = 0; return false; } - // Returns collection type - // - // @return `Fungible` or `NFT` or `ReFungible` + // @notice Function to mint token with the given tokenUri. + // @dev `tokenId` should be obtained with `nextTokenId` method, + // unlike standard, you can't specify it manually + // @param to The new owner + // @param tokenId ID of the minted RFT + // @param tokenUri Token URI that would be stored in the RFT properties // - // Selector: uniqueCollectionType() d34b55b8 - function uniqueCollectionType() public returns (string memory) { + // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f + function mintWithTokenURI( + address to, + uint256 tokenId, + string memory tokenUri + ) public returns (bool) { require(false, stub_error); + to; + tokenId; + tokenUri; dummy = 0; - return ""; + return false; } - // Changes collection owner to another account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner account + // @dev Not implemented // - // Selector: changeOwner(address) a6f9dae1 - function changeOwner(address newOwner) public { + // Selector: finishMinting() 7d64bcb4 + function finishMinting() public returns (bool) { require(false, stub_error); - newOwner; dummy = 0; + return false; } +} - // Changes collection owner to another substrate account +// Selector: 780e9d63 +contract ERC721Enumerable is Dummy, ERC165 { + // @notice Enumerate valid RFTs + // @param index A counter less than `totalSupply()` + // @return The token identifier for the `index`th NFT, + // (sort order not specified) // - // @dev Owner can be changed only by current owner - // @param newOwner new owner substrate account + // Selector: tokenByIndex(uint256) 4f6ccce7 + function tokenByIndex(uint256 index) public view returns (uint256) { + require(false, stub_error); + index; + dummy; + return 0; + } + + // Not implemented // - // Selector: changeOwnerSubstrate(uint256) 337e2c60 - function changeOwnerSubstrate(uint256 newOwner) public { + // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 + function tokenOfOwnerByIndex(address owner, uint256 index) + public + view + returns (uint256) + { require(false, stub_error); - newOwner; - dummy = 0; + owner; + index; + dummy; + return 0; } -} -// Selector: 41369377 -contract TokenProperties is Dummy, ERC165 { - // @notice Set permissions for token property. - // @dev Throws error if `msg.sender` is not admin or owner of the collection. - // @param key Property key. - // @param is_mutable Permission to mutate property. - // @param collection_admin Permission to mutate property by collection admin if property is mutable. - // @param token_owner Permission to mutate property by token owner if property is mutable. + // @notice Count RFTs tracked by this contract + // @return A count of valid RFTs tracked by this contract, where each one of + // them has an assigned and queryable owner not equal to the zero address // - // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa - function setTokenPropertyPermission( - string memory key, - bool isMutable, - bool collectionAdmin, - bool tokenOwner - ) public { + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { require(false, stub_error); - key; - isMutable; - collectionAdmin; - tokenOwner; - dummy = 0; + dummy; + return 0; } +} - // @notice Set token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. - // @param key Property key. - // @param value Property value. +// Selector: 7c3bef89 +contract ERC721UniqueExtensions is Dummy, ERC165 { + // @notice Transfer ownership of an RFT + // @dev Throws unless `msg.sender` is the current owner. Throws if `to` + // is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param to The new owner + // @param tokenId The RFT to transfer + // @param _value Not used for an RFT // - // Selector: setProperty(uint256,string,bytes) 1752d67b - function setProperty( - uint256 tokenId, - string memory key, - bytes memory value - ) public { + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 tokenId) public { require(false, stub_error); + to; tokenId; - key; - value; dummy = 0; } - // @notice Delete token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. - // @param key Property key. + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this RFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param from The current owner of the RFT + // @param tokenId The RFT to transfer + // @param _value Not used for an RFT // - // Selector: deleteProperty(uint256,string) 066111d1 - function deleteProperty(uint256 tokenId, string memory key) public { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 tokenId) public { require(false, stub_error); + from; tokenId; - key; dummy = 0; } - // @notice Get token property value. - // @dev Throws error if key not found - // @param tokenId ID of the token. - // @param key Property key. - // @return Property value bytes + // @notice Returns next free RFT ID. // - // Selector: property(uint256,string) 7228c327 - function property(uint256 tokenId, string memory key) - public - view - returns (bytes memory) - { + // Selector: nextTokenId() 75794a3c + function nextTokenId() public view returns (uint256) { require(false, stub_error); - tokenId; - key; dummy; - return hex""; + return 0; } -} -// Selector: 42966c68 -contract ERC721Burnable is Dummy, ERC165 { - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current RFT owner, or an authorized - // operator of the current owner. - // @param tokenId The RFT to approve + // @notice Function to mint multiple tokens. + // @dev `tokenIds` should be an array of consecutive numbers and first number + // should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokenIds IDs of the minted RFTs // - // Selector: burn(uint256) 42966c68 - function burn(uint256 tokenId) public { + // Selector: mintBulk(address,uint256[]) 44a9945e + function mintBulk(address to, uint256[] memory tokenIds) + public + returns (bool) + { require(false, stub_error); - tokenId; + to; + tokenIds; dummy = 0; + return false; } -} -// Selector: 58800161 -contract ERC721 is Dummy, ERC165, ERC721Events { - // @notice Count all RFTs assigned to an owner - // @dev RFTs assigned to the zero address are considered invalid, and this - // function throws for queries about the zero address. - // @param owner An address for whom to query the balance - // @return The number of RFTs owned by `owner`, possibly zero + // @notice Function to mint multiple tokens with the given tokenUris. + // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // numbers and first number should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokens array of pairs of token ID and token URI for minted tokens // - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) public view returns (uint256) { + // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 + function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + public + returns (bool) + { require(false, stub_error); - owner; - dummy; - return 0; + to; + tokens; + dummy = 0; + return false; } - // @notice Find the owner of an RFT - // @dev RFTs assigned to zero address are considered invalid, and queries - // about them do throw. - // Returns special 0xffffffffffffffffffffffffffffffffffffffff address for - // the tokens that are partially owned. - // @param tokenId The identifier for an RFT - // @return The address of the owner of the RFT + // Returns EVM address for refungible token // - // Selector: ownerOf(uint256) 6352211e - function ownerOf(uint256 tokenId) public view returns (address) { + // @param token ID of the token + // + // Selector: tokenContractAddress(uint256) ab76fac6 + function tokenContractAddress(uint256 token) public view returns (address) { require(false, stub_error); - tokenId; + token; dummy; return 0x0000000000000000000000000000000000000000; } +} - // @dev Not implemented +// Selector: f077f83e +contract Collection is Dummy, ERC165 { + // Set collection property. // - // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672 - function safeTransferFromWithData( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public { + // @param key Property key. + // @param value Propery value. + // + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + public + { require(false, stub_error); - from; - to; - tokenId; - data; + key; + value; dummy = 0; } - // @dev Not implemented + // Delete collection property. // - // Selector: safeTransferFrom(address,address,uint256) 42842e0e - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public { + // @param key Property key. + // + // Selector: deleteCollectionProperty(string) 7b7debce + function deleteCollectionProperty(string memory key) public { require(false, stub_error); - from; - to; - tokenId; + key; dummy = 0; } - // @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE - // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE - // THEY MAY BE PERMANENTLY LOST - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this RFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param from The current owner of the NFT - // @param to The new owner - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT + // Get collection property. // - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 tokenId - ) public { + // @dev Throws error if key not found. + // + // @param key Property key. + // @return bytes The property corresponding to the key. + // + // Selector: collectionProperty(string) cf24fd6d + function collectionProperty(string memory key) + public + view + returns (bytes memory) + { require(false, stub_error); - from; - to; - tokenId; - dummy = 0; + key; + dummy; + return hex""; } - // @dev Not implemented + // Set the sponsor of the collection. // - // Selector: approve(address,uint256) 095ea7b3 - function approve(address approved, uint256 tokenId) public { + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) public { require(false, stub_error); - approved; - tokenId; + sponsor; dummy = 0; } - // @dev Not implemented + // Collection sponsorship confirmation. // - // Selector: setApprovalForAll(address,bool) a22cb465 - function setApprovalForAll(address operator, bool approved) public { + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() public { require(false, stub_error); - operator; - approved; dummy = 0; } - // @dev Not implemented + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. // - // Selector: getApproved(uint256) 081812fc - function getApproved(uint256 tokenId) public view returns (address) { + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) public { require(false, stub_error); - tokenId; - dummy; - return 0x0000000000000000000000000000000000000000; + limit; + value; + dummy = 0; } - // @dev Not implemented + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. // - // Selector: isApprovedForAll(address,address) e985e9c5 - function isApprovedForAll(address owner, address operator) - public - view - returns (address) - { + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) public { require(false, stub_error); - owner; - operator; - dummy; - return 0x0000000000000000000000000000000000000000; + limit; + value; + dummy = 0; } -} -// Selector: 5b5e139f -contract ERC721Metadata is Dummy, ERC165 { - // @notice A descriptive name for a collection of RFTs in this contract + // Get contract address. // - // Selector: name() 06fdde03 - function name() public view returns (string memory) { + // Selector: contractAddress() f6b4dfb4 + function contractAddress() public view returns (address) { require(false, stub_error); dummy; - return ""; + return 0x0000000000000000000000000000000000000000; } - // @notice An abbreviated name for RFTs in this contract + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. // - // Selector: symbol() 95d89b41 - function symbol() public view returns (string memory) { + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) public { require(false, stub_error); - dummy; - return ""; + newAdmin; + dummy = 0; } - // @notice A distinct Uniform Resource Identifier (URI) for a given asset. - // - // @dev If the token has a `url` property and it is not empty, it is returned. - // Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. - // If the collection property `baseURI` is empty or absent, return "" (empty string) - // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix - // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). - // - // @return token's const_metadata + // Remove collection admin by substrate address. + // @param admin Substrate administrator address. // - // Selector: tokenURI(uint256) c87b56dd - function tokenURI(uint256 tokenId) public view returns (string memory) { + // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + function removeCollectionAdminSubstrate(uint256 admin) public { require(false, stub_error); - tokenId; - dummy; - return ""; + admin; + dummy = 0; } -} -// Selector: 68ccfe89 -contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { - // Selector: mintingFinished() 05d2035b - function mintingFinished() public view returns (bool) { + // Add collection admin. + // @param new_admin Address of the added administrator. + // + // Selector: addCollectionAdmin(address) 92e462c7 + function addCollectionAdmin(address newAdmin) public { require(false, stub_error); - dummy; - return false; + newAdmin; + dummy = 0; } - // @notice Function to mint token. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted RFT + // Remove collection admin. // - // Selector: mint(address,uint256) 40c10f19 - function mint(address to, uint256 tokenId) public returns (bool) { + // @param new_admin Address of the removed administrator. + // + // Selector: removeCollectionAdmin(address) fafd7b42 + function removeCollectionAdmin(address admin) public { require(false, stub_error); - to; - tokenId; + admin; dummy = 0; - return false; } - // @notice Function to mint token with the given tokenUri. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted RFT - // @param tokenUri Token URI that would be stored in the RFT properties + // Toggle accessibility of collection nesting. // - // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f - function mintWithTokenURI( - address to, - uint256 tokenId, - string memory tokenUri - ) public returns (bool) { + // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // + // Selector: setCollectionNesting(bool) 112d4586 + function setCollectionNesting(bool enable) public { require(false, stub_error); - to; - tokenId; - tokenUri; + enable; dummy = 0; - return false; } - // @dev Not implemented + // Toggle accessibility of collection nesting. // - // Selector: finishMinting() 7d64bcb4 - function finishMinting() public returns (bool) { + // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + // @param collections Addresses of collections that will be available for nesting. + // + // Selector: setCollectionNesting(bool,address[]) 64872396 + function setCollectionNesting(bool enable, address[] memory collections) + public + { require(false, stub_error); + enable; + collections; dummy = 0; - return false; } -} -// Selector: 780e9d63 -contract ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid RFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) + // Set the collection access method. + // @param mode Access mode + // 0 for Normal + // 1 for AllowList // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) public view returns (uint256) { + // Selector: setCollectionAccess(uint8) 41835d4c + function setCollectionAccess(uint8 mode) public { require(false, stub_error); - index; - dummy; - return 0; + mode; + dummy = 0; } - // Not implemented + // Add the user to the allowed list. // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - public - view - returns (uint256) - { + // @param user Address of a trusted user. + // + // Selector: addToCollectionAllowList(address) 67844fe6 + function addToCollectionAllowList(address user) public { require(false, stub_error); - owner; - index; - dummy; - return 0; + user; + dummy = 0; } - // @notice Count RFTs tracked by this contract - // @return A count of valid RFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address + // Remove the user from the allowed list. // - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { + // @param user Address of a removed user. + // + // Selector: removeFromCollectionAllowList(address) 85c51acb + function removeFromCollectionAllowList(address user) public { require(false, stub_error); - dummy; - return 0; + user; + dummy = 0; } -} -// Selector: 7c3bef89 -contract ERC721UniqueExtensions is Dummy, ERC165 { - // @notice Transfer ownership of an RFT - // @dev Throws unless `msg.sender` is the current owner. Throws if `to` - // is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param to The new owner - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT + // Switch permission for minting. // - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 tokenId) public { + // @param mode Enable if "true". + // + // Selector: setCollectionMintMode(bool) 00018e84 + function setCollectionMintMode(bool mode) public { require(false, stub_error); - to; - tokenId; + mode; dummy = 0; } - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this RFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param from The current owner of the RFT - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT + // Check that account is the owner or admin of the collection // - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 tokenId) public { + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: verifyOwnerOrAdmin(address) c2282493 + function verifyOwnerOrAdmin(address user) public view returns (bool) { require(false, stub_error); - from; - tokenId; - dummy = 0; + user; + dummy; + return false; } - // @notice Returns next free RFT ID. + // Check that substrate account is the owner or admin of the collection // - // Selector: nextTokenId() 75794a3c - function nextTokenId() public view returns (uint256) { + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: verifyOwnerOrAdmin(uint256) a83328e5 + function verifyOwnerOrAdmin(uint256 user) public view returns (bool) { require(false, stub_error); + user; dummy; - return 0; + return false; } - // @notice Function to mint multiple tokens. - // @dev `tokenIds` should be an array of consecutive numbers and first number - // should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokenIds IDs of the minted RFTs + // Returns collection type // - // Selector: mintBulk(address,uint256[]) 44a9945e - function mintBulk(address to, uint256[] memory tokenIds) - public - returns (bool) - { + // @return `Fungible` or `NFT` or `ReFungible` + // + // Selector: uniqueCollectionType() d34b55b8 + function uniqueCollectionType() public returns (string memory) { require(false, stub_error); - to; - tokenIds; dummy = 0; - return false; + return ""; } - // @notice Function to mint multiple tokens with the given tokenUris. - // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // numbers and first number should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokens array of pairs of token ID and token URI for minted tokens + // Changes collection owner to another account // - // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 - function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) - public - returns (bool) - { + // @dev Owner can be changed only by current owner + // @param newOwner new owner account + // + // Selector: changeOwner(address) a6f9dae1 + function changeOwner(address newOwner) public { require(false, stub_error); - to; - tokens; + newOwner; dummy = 0; - return false; } - // Returns EVM address for refungible token + // Changes collection owner to another substrate account // - // @param token ID of the token + // @dev Owner can be changed only by current owner + // @param newOwner new owner substrate account // - // Selector: tokenContractAddress(uint256) ab76fac6 - function tokenContractAddress(uint256 token) public view returns (address) { + // Selector: changeOwner(uint256) 924c19f7 + function changeOwner(uint256 newOwner) public { require(false, stub_error); - token; - dummy; - return 0x0000000000000000000000000000000000000000; + newOwner; + dummy = 0; } } diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.raw b/pallets/refungible/src/stubs/UniqueRefungibleToken.raw index 998445ec1d4178220745b9aeba3b46606e114c42..7e0271122124c295c926eae676151e4e2f2e29c4 100644 GIT binary patch delta 353 zcmZ3+GoMEw;X#5!P=Z=QLt|smghbY#8wHvf8KX8&VJu=~ygHekS)EaEvOcpezfM?m zBBO62BZpZ6OCq!D`DRA3Rz}82 z0RaJ%CI$qAMJF&c0F@-Pv@r{bCNjMW2lD?$Co+9*Nn~;ii=Gsa$jmr-K8uQsGEBy* z2`mHDq|np?(!^{x`96!JXarONb7C`C!9<|e{K>qm+Jdvf6Y87ACIv*dHVZT|Co*rJ z?8&O^aV0!~u~8(E`Biu#izv_?|0UbRnu1zHMH5)1n;54BKtvh38-o%QCMYB@M7K2x zh$gb|hc||_G%*HEXl0zx$(YFeZSodYMa>rpYv#T^5N7?VwQ9a|*hYh05?o#{XPw;l a{F9`2YTlK-DaH9Y$<7QM0+au-Y5)MuA9WW1 delta 359 zcmbQwvy4X|;X#5!P=Z=QLt|smghV!mjRMV#jES44FcvW~-kHqKtj;JgS)W;#-#9Ef zkp}$j(M4PW22yGBGa+(1cn5M=5|KLpy+@EdBy~J zNwG;2CNU;BFixHn5D*X+oxsolRFcrr#w-L>{}HIZ;cs*z)3269CdaVoNdbw>9Fu3T zs4!|x-peAT?+TF*Fr7F7s@I{p6{M3n9;%Z$qZzDoB2Z`9WHwf9!G+-o_03|F0-{@+ z1sa(XnfFb0VpaCI9iG70D3ZwhF+7n)2I!3cl5Jv5K`o-939QmhjMD-jq72=QK?w>I z6cQMs+ZqK#6IsN<8$()}7=tFXGEV4ZOl1B$c`d7==CvLls gM$VMiAz=$#Vlyt^>wA(?oS&2I%)r4v`8%ry0H>gL(*OVf diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index caca24e337c48bd30100df1fb6a3f05232c0393d..ca43173e6e955ef7a6ff22dd19b65ad432427dca 100644 GIT binary patch delta 53 zcmV-50LuT+3(yO&e+4Pr=6P5ouSwXG1`X7umI`Zih{syu>PKvqio(iR7Kevqb8l>8 LLjVX6lc)tKpcEHj delta 53 zcmV-50LuT+3(yO&e+4NS<2PG+7p}$9ibUc^oK=hC07{`_Ut~)A`+^$hDA^xmb8l>8 LLjVX5lc)tKgK`#` diff --git a/tests/src/eth/api/UniqueFungible.sol b/tests/src/eth/api/UniqueFungible.sol index 9fee4b5ff0..0d4a0b8c51 100644 --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -22,7 +22,50 @@ interface ERC20Events { ); } -// Selector: 07f76b0c +// Selector: 79cc6790 +interface ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) external returns (bool); +} + +// Selector: 942e8b22 +interface ERC20 is Dummy, ERC165, ERC20Events { + // Selector: name() 06fdde03 + function name() external view returns (string memory); + + // Selector: symbol() 95d89b41 + function symbol() external view returns (string memory); + + // Selector: totalSupply() 18160ddd + function totalSupply() external view returns (uint256); + + // Selector: decimals() 313ce567 + function decimals() external view returns (uint8); + + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) external view returns (uint256); + + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 amount) external returns (bool); + + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 amount + ) external returns (bool); + + // Selector: approve(address,uint256) 095ea7b3 + function approve(address spender, uint256 amount) external returns (bool); + + // Selector: allowance(address,address) dd62ed3e + function allowance(address owner, address spender) + external + view + returns (uint256); +} + +// Selector: f077f83e interface Collection is Dummy, ERC165 { // Set collection property. // @@ -182,11 +225,8 @@ interface Collection is Dummy, ERC165 { // @param user account to verify // @return "true" if account is the owner or admin // - // Selector: verifyOwnerOrAdminSubstrate(uint256) fe818e40 - function verifyOwnerOrAdminSubstrate(uint256 user) - external - view - returns (bool); + // Selector: verifyOwnerOrAdmin(uint256) a83328e5 + function verifyOwnerOrAdmin(uint256 user) external view returns (bool); // Returns collection type // @@ -208,51 +248,8 @@ interface Collection is Dummy, ERC165 { // @dev Owner can be changed only by current owner // @param newOwner new owner substrate account // - // Selector: changeOwnerSubstrate(uint256) 337e2c60 - function changeOwnerSubstrate(uint256 newOwner) external; -} - -// Selector: 79cc6790 -interface ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) external returns (bool); -} - -// Selector: 942e8b22 -interface ERC20 is Dummy, ERC165, ERC20Events { - // Selector: name() 06fdde03 - function name() external view returns (string memory); - - // Selector: symbol() 95d89b41 - function symbol() external view returns (string memory); - - // Selector: totalSupply() 18160ddd - function totalSupply() external view returns (uint256); - - // Selector: decimals() 313ce567 - function decimals() external view returns (uint8); - - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) external view returns (uint256); - - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 amount) external returns (bool); - - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 amount - ) external returns (bool); - - // Selector: approve(address,uint256) 095ea7b3 - function approve(address spender, uint256 amount) external returns (bool); - - // Selector: allowance(address,address) dd62ed3e - function allowance(address owner, address spender) - external - view - returns (uint256); + // Selector: changeOwner(uint256) 924c19f7 + function changeOwner(uint256 newOwner) external; } interface UniqueFungible is diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index a567e75adf..16322237c4 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -42,196 +42,6 @@ interface ERC721MintableEvents { event MintingFinished(); } -// Selector: 07f76b0c -interface Collection is Dummy, ERC165 { - // Set collection property. - // - // @param key Property key. - // @param value Propery value. - // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - external; - - // Delete collection property. - // - // @param key Property key. - // - // Selector: deleteCollectionProperty(string) 7b7debce - function deleteCollectionProperty(string memory key) external; - - // Get collection property. - // - // @dev Throws error if key not found. - // - // @param key Property key. - // @return bytes The property corresponding to the key. - // - // Selector: collectionProperty(string) cf24fd6d - function collectionProperty(string memory key) - external - view - returns (bytes memory); - - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) external; - - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,bool) 993b7fba - function setCollectionLimit(string memory limit, bool value) external; - - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 - function contractAddress() external view returns (address); - - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. - // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) external; - - // Remove collection admin by substrate address. - // @param admin Substrate administrator address. - // - // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 - function removeCollectionAdminSubstrate(uint256 admin) external; - - // Add collection admin. - // @param new_admin Address of the added administrator. - // - // Selector: addCollectionAdmin(address) 92e462c7 - function addCollectionAdmin(address newAdmin) external; - - // Remove collection admin. - // - // @param new_admin Address of the removed administrator. - // - // Selector: removeCollectionAdmin(address) fafd7b42 - function removeCollectionAdmin(address admin) external; - - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' - // - // Selector: setCollectionNesting(bool) 112d4586 - function setCollectionNesting(bool enable) external; - - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' - // @param collections Addresses of collections that will be available for nesting. - // - // Selector: setCollectionNesting(bool,address[]) 64872396 - function setCollectionNesting(bool enable, address[] memory collections) - external; - - // Set the collection access method. - // @param mode Access mode - // 0 for Normal - // 1 for AllowList - // - // Selector: setCollectionAccess(uint8) 41835d4c - function setCollectionAccess(uint8 mode) external; - - // Add the user to the allowed list. - // - // @param user Address of a trusted user. - // - // Selector: addToCollectionAllowList(address) 67844fe6 - function addToCollectionAllowList(address user) external; - - // Remove the user from the allowed list. - // - // @param user Address of a removed user. - // - // Selector: removeFromCollectionAllowList(address) 85c51acb - function removeFromCollectionAllowList(address user) external; - - // Switch permission for minting. - // - // @param mode Enable if "true". - // - // Selector: setCollectionMintMode(bool) 00018e84 - function setCollectionMintMode(bool mode) external; - - // Check that account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: verifyOwnerOrAdmin(address) c2282493 - function verifyOwnerOrAdmin(address user) external view returns (bool); - - // Check that substrate account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: verifyOwnerOrAdminSubstrate(uint256) fe818e40 - function verifyOwnerOrAdminSubstrate(uint256 user) - external - view - returns (bool); - - // Returns collection type - // - // @return `Fungible` or `NFT` or `ReFungible` - // - // Selector: uniqueCollectionType() d34b55b8 - function uniqueCollectionType() external returns (string memory); - - // Changes collection owner to another account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner account - // - // Selector: changeOwner(address) a6f9dae1 - function changeOwner(address newOwner) external; - - // Changes collection owner to another substrate account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner substrate account - // - // Selector: changeOwnerSubstrate(uint256) 337e2c60 - function changeOwnerSubstrate(uint256 newOwner) external; -} - // Selector: 41369377 interface TokenProperties is Dummy, ERC165 { // @notice Set permissions for token property. @@ -517,6 +327,193 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { returns (bool); } +// Selector: f077f83e +interface Collection is Dummy, ERC165 { + // Set collection property. + // + // @param key Property key. + // @param value Propery value. + // + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + external; + + // Delete collection property. + // + // @param key Property key. + // + // Selector: deleteCollectionProperty(string) 7b7debce + function deleteCollectionProperty(string memory key) external; + + // Get collection property. + // + // @dev Throws error if key not found. + // + // @param key Property key. + // @return bytes The property corresponding to the key. + // + // Selector: collectionProperty(string) cf24fd6d + function collectionProperty(string memory key) + external + view + returns (bytes memory); + + // Set the sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) external; + + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) external; + + // Get contract address. + // + // Selector: contractAddress() f6b4dfb4 + function contractAddress() external view returns (address); + + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. + // + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) external; + + // Remove collection admin by substrate address. + // @param admin Substrate administrator address. + // + // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + function removeCollectionAdminSubstrate(uint256 admin) external; + + // Add collection admin. + // @param new_admin Address of the added administrator. + // + // Selector: addCollectionAdmin(address) 92e462c7 + function addCollectionAdmin(address newAdmin) external; + + // Remove collection admin. + // + // @param new_admin Address of the removed administrator. + // + // Selector: removeCollectionAdmin(address) fafd7b42 + function removeCollectionAdmin(address admin) external; + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // + // Selector: setCollectionNesting(bool) 112d4586 + function setCollectionNesting(bool enable) external; + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + // @param collections Addresses of collections that will be available for nesting. + // + // Selector: setCollectionNesting(bool,address[]) 64872396 + function setCollectionNesting(bool enable, address[] memory collections) + external; + + // Set the collection access method. + // @param mode Access mode + // 0 for Normal + // 1 for AllowList + // + // Selector: setCollectionAccess(uint8) 41835d4c + function setCollectionAccess(uint8 mode) external; + + // Add the user to the allowed list. + // + // @param user Address of a trusted user. + // + // Selector: addToCollectionAllowList(address) 67844fe6 + function addToCollectionAllowList(address user) external; + + // Remove the user from the allowed list. + // + // @param user Address of a removed user. + // + // Selector: removeFromCollectionAllowList(address) 85c51acb + function removeFromCollectionAllowList(address user) external; + + // Switch permission for minting. + // + // @param mode Enable if "true". + // + // Selector: setCollectionMintMode(bool) 00018e84 + function setCollectionMintMode(bool mode) external; + + // Check that account is the owner or admin of the collection + // + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: verifyOwnerOrAdmin(address) c2282493 + function verifyOwnerOrAdmin(address user) external view returns (bool); + + // Check that substrate account is the owner or admin of the collection + // + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: verifyOwnerOrAdmin(uint256) a83328e5 + function verifyOwnerOrAdmin(uint256 user) external view returns (bool); + + // Returns collection type + // + // @return `Fungible` or `NFT` or `ReFungible` + // + // Selector: uniqueCollectionType() d34b55b8 + function uniqueCollectionType() external returns (string memory); + + // Changes collection owner to another account + // + // @dev Owner can be changed only by current owner + // @param newOwner new owner account + // + // Selector: changeOwner(address) a6f9dae1 + function changeOwner(address newOwner) external; + + // Changes collection owner to another substrate account + // + // @dev Owner can be changed only by current owner + // @param newOwner new owner substrate account + // + // Selector: changeOwner(uint256) 924c19f7 + function changeOwner(uint256 newOwner) external; +} + interface UniqueNFT is Dummy, ERC165, diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index cf479880c0..58ed712f93 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -42,196 +42,6 @@ interface ERC721MintableEvents { event MintingFinished(); } -// Selector: 07f76b0c -interface Collection is Dummy, ERC165 { - // Set collection property. - // - // @param key Property key. - // @param value Propery value. - // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - external; - - // Delete collection property. - // - // @param key Property key. - // - // Selector: deleteCollectionProperty(string) 7b7debce - function deleteCollectionProperty(string memory key) external; - - // Get collection property. - // - // @dev Throws error if key not found. - // - // @param key Property key. - // @return bytes The property corresponding to the key. - // - // Selector: collectionProperty(string) cf24fd6d - function collectionProperty(string memory key) - external - view - returns (bytes memory); - - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) external; - - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,bool) 993b7fba - function setCollectionLimit(string memory limit, bool value) external; - - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 - function contractAddress() external view returns (address); - - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. - // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) external; - - // Remove collection admin by substrate address. - // @param admin Substrate administrator address. - // - // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 - function removeCollectionAdminSubstrate(uint256 admin) external; - - // Add collection admin. - // @param new_admin Address of the added administrator. - // - // Selector: addCollectionAdmin(address) 92e462c7 - function addCollectionAdmin(address newAdmin) external; - - // Remove collection admin. - // - // @param new_admin Address of the removed administrator. - // - // Selector: removeCollectionAdmin(address) fafd7b42 - function removeCollectionAdmin(address admin) external; - - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' - // - // Selector: setCollectionNesting(bool) 112d4586 - function setCollectionNesting(bool enable) external; - - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' - // @param collections Addresses of collections that will be available for nesting. - // - // Selector: setCollectionNesting(bool,address[]) 64872396 - function setCollectionNesting(bool enable, address[] memory collections) - external; - - // Set the collection access method. - // @param mode Access mode - // 0 for Normal - // 1 for AllowList - // - // Selector: setCollectionAccess(uint8) 41835d4c - function setCollectionAccess(uint8 mode) external; - - // Add the user to the allowed list. - // - // @param user Address of a trusted user. - // - // Selector: addToCollectionAllowList(address) 67844fe6 - function addToCollectionAllowList(address user) external; - - // Remove the user from the allowed list. - // - // @param user Address of a removed user. - // - // Selector: removeFromCollectionAllowList(address) 85c51acb - function removeFromCollectionAllowList(address user) external; - - // Switch permission for minting. - // - // @param mode Enable if "true". - // - // Selector: setCollectionMintMode(bool) 00018e84 - function setCollectionMintMode(bool mode) external; - - // Check that account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: verifyOwnerOrAdmin(address) c2282493 - function verifyOwnerOrAdmin(address user) external view returns (bool); - - // Check that substrate account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: verifyOwnerOrAdminSubstrate(uint256) fe818e40 - function verifyOwnerOrAdminSubstrate(uint256 user) - external - view - returns (bool); - - // Returns collection type - // - // @return `Fungible` or `NFT` or `ReFungible` - // - // Selector: uniqueCollectionType() d34b55b8 - function uniqueCollectionType() external returns (string memory); - - // Changes collection owner to another account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner account - // - // Selector: changeOwner(address) a6f9dae1 - function changeOwner(address newOwner) external; - - // Changes collection owner to another substrate account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner substrate account - // - // Selector: changeOwnerSubstrate(uint256) 337e2c60 - function changeOwnerSubstrate(uint256 newOwner) external; -} - // Selector: 41369377 interface TokenProperties is Dummy, ERC165 { // @notice Set permissions for token property. @@ -527,6 +337,193 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { returns (address); } +// Selector: f077f83e +interface Collection is Dummy, ERC165 { + // Set collection property. + // + // @param key Property key. + // @param value Propery value. + // + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + external; + + // Delete collection property. + // + // @param key Property key. + // + // Selector: deleteCollectionProperty(string) 7b7debce + function deleteCollectionProperty(string memory key) external; + + // Get collection property. + // + // @dev Throws error if key not found. + // + // @param key Property key. + // @return bytes The property corresponding to the key. + // + // Selector: collectionProperty(string) cf24fd6d + function collectionProperty(string memory key) + external + view + returns (bytes memory); + + // Set the sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) external; + + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) external; + + // Get contract address. + // + // Selector: contractAddress() f6b4dfb4 + function contractAddress() external view returns (address); + + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. + // + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) external; + + // Remove collection admin by substrate address. + // @param admin Substrate administrator address. + // + // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + function removeCollectionAdminSubstrate(uint256 admin) external; + + // Add collection admin. + // @param new_admin Address of the added administrator. + // + // Selector: addCollectionAdmin(address) 92e462c7 + function addCollectionAdmin(address newAdmin) external; + + // Remove collection admin. + // + // @param new_admin Address of the removed administrator. + // + // Selector: removeCollectionAdmin(address) fafd7b42 + function removeCollectionAdmin(address admin) external; + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // + // Selector: setCollectionNesting(bool) 112d4586 + function setCollectionNesting(bool enable) external; + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + // @param collections Addresses of collections that will be available for nesting. + // + // Selector: setCollectionNesting(bool,address[]) 64872396 + function setCollectionNesting(bool enable, address[] memory collections) + external; + + // Set the collection access method. + // @param mode Access mode + // 0 for Normal + // 1 for AllowList + // + // Selector: setCollectionAccess(uint8) 41835d4c + function setCollectionAccess(uint8 mode) external; + + // Add the user to the allowed list. + // + // @param user Address of a trusted user. + // + // Selector: addToCollectionAllowList(address) 67844fe6 + function addToCollectionAllowList(address user) external; + + // Remove the user from the allowed list. + // + // @param user Address of a removed user. + // + // Selector: removeFromCollectionAllowList(address) 85c51acb + function removeFromCollectionAllowList(address user) external; + + // Switch permission for minting. + // + // @param mode Enable if "true". + // + // Selector: setCollectionMintMode(bool) 00018e84 + function setCollectionMintMode(bool mode) external; + + // Check that account is the owner or admin of the collection + // + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: verifyOwnerOrAdmin(address) c2282493 + function verifyOwnerOrAdmin(address user) external view returns (bool); + + // Check that substrate account is the owner or admin of the collection + // + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: verifyOwnerOrAdmin(uint256) a83328e5 + function verifyOwnerOrAdmin(uint256 user) external view returns (bool); + + // Returns collection type + // + // @return `Fungible` or `NFT` or `ReFungible` + // + // Selector: uniqueCollectionType() d34b55b8 + function uniqueCollectionType() external returns (string memory); + + // Changes collection owner to another account + // + // @dev Owner can be changed only by current owner + // @param newOwner new owner account + // + // Selector: changeOwner(address) a6f9dae1 + function changeOwner(address newOwner) external; + + // Changes collection owner to another substrate account + // + // @dev Owner can be changed only by current owner + // @param newOwner new owner substrate account + // + // Selector: changeOwner(uint256) 924c19f7 + function changeOwner(uint256 newOwner) external; +} + interface UniqueRefungible is Dummy, ERC165, diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index 752ea239d8..9e189c2593 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -373,11 +373,11 @@ describe('Change substrate owner tests', () => { const collectionEvm = evmCollection(web3, owner, collectionIdAddress); expect(await collectionEvm.methods.verifyOwnerOrAdmin(owner).call()).to.be.true; - expect(await collectionEvm.methods.verifyOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; - await collectionEvm.methods.changeOwnerSubstrate(newOwner.addressRaw).send(); + expect(await collectionEvm.methods['verifyOwnerOrAdmin(uint256)'](newOwner.addressRaw).call()).to.be.false; + await collectionEvm.methods['changeOwner(uint256)'](newOwner.addressRaw).send(); expect(await collectionEvm.methods.verifyOwnerOrAdmin(owner).call()).to.be.false; - expect(await collectionEvm.methods.verifyOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.true; + expect(await collectionEvm.methods['verifyOwnerOrAdmin(uint256)'](newOwner.addressRaw).call()).to.be.true; }); itWeb3('change owner call fee', async ({web3, api, privateKeyWrapper}) => { @@ -390,7 +390,7 @@ describe('Change substrate owner tests', () => { const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - const cost = await recordEthFee(api, owner, () => collectionEvm.methods.changeOwnerSubstrate(newOwner.addressRaw).send()); + const cost = await recordEthFee(api, owner, () => collectionEvm.methods['changeOwner(uint256)'](newOwner.addressRaw).send()); expect(cost < BigInt(0.2 * Number(UNIQUE))); expect(cost > 0); }); @@ -406,7 +406,7 @@ describe('Change substrate owner tests', () => { const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await expect(collectionEvm.methods.changeOwnerSubstrate(newOwner.addressRaw).send({from: otherReceiver})).to.be.rejected; - expect(await collectionEvm.methods.verifyOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; + await expect(collectionEvm.methods['changeOwner(uint256)'](newOwner.addressRaw).send({from: otherReceiver})).to.be.rejected; + expect(await collectionEvm.methods['verifyOwnerOrAdmin(uint256)'](newOwner.addressRaw).call()).to.be.false; }); }); \ No newline at end of file diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index c9754f049d..c18c5702ff 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -117,7 +117,7 @@ }, { "inputs": [ - { "internalType": "address", "name": "newOwner", "type": "address" } + { "internalType": "uint256", "name": "newOwner", "type": "uint256" } ], "name": "changeOwner", "outputs": [], @@ -126,9 +126,9 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "newOwner", "type": "uint256" } + { "internalType": "address", "name": "newOwner", "type": "address" } ], - "name": "changeOwnerSubstrate", + "name": "changeOwner", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -329,7 +329,7 @@ }, { "inputs": [ - { "internalType": "address", "name": "user", "type": "address" } + { "internalType": "uint256", "name": "user", "type": "uint256" } ], "name": "verifyOwnerOrAdmin", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], @@ -338,9 +338,9 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } + { "internalType": "address", "name": "user", "type": "address" } ], - "name": "verifyOwnerOrAdminSubstrate", + "name": "verifyOwnerOrAdmin", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index 25b43672c1..fb3a419e7e 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -147,7 +147,7 @@ }, { "inputs": [ - { "internalType": "address", "name": "newOwner", "type": "address" } + { "internalType": "uint256", "name": "newOwner", "type": "uint256" } ], "name": "changeOwner", "outputs": [], @@ -156,9 +156,9 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "newOwner", "type": "uint256" } + { "internalType": "address", "name": "newOwner", "type": "address" } ], - "name": "changeOwnerSubstrate", + "name": "changeOwner", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -554,7 +554,7 @@ }, { "inputs": [ - { "internalType": "address", "name": "user", "type": "address" } + { "internalType": "uint256", "name": "user", "type": "uint256" } ], "name": "verifyOwnerOrAdmin", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], @@ -563,9 +563,9 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } + { "internalType": "address", "name": "user", "type": "address" } ], - "name": "verifyOwnerOrAdminSubstrate", + "name": "verifyOwnerOrAdmin", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index 4984767b1d..8f4fec7232 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -147,7 +147,7 @@ }, { "inputs": [ - { "internalType": "address", "name": "newOwner", "type": "address" } + { "internalType": "uint256", "name": "newOwner", "type": "uint256" } ], "name": "changeOwner", "outputs": [], @@ -156,9 +156,9 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "newOwner", "type": "uint256" } + { "internalType": "address", "name": "newOwner", "type": "address" } ], - "name": "changeOwnerSubstrate", + "name": "changeOwner", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -563,7 +563,7 @@ }, { "inputs": [ - { "internalType": "address", "name": "user", "type": "address" } + { "internalType": "uint256", "name": "user", "type": "uint256" } ], "name": "verifyOwnerOrAdmin", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], @@ -572,9 +572,9 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } + { "internalType": "address", "name": "user", "type": "address" } ], - "name": "verifyOwnerOrAdminSubstrate", + "name": "verifyOwnerOrAdmin", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" From 5ae285ceffc0dfa8cdb31e84129ee7b527a75974 Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Tue, 23 Aug 2022 17:42:29 +0700 Subject: [PATCH 0497/1274] WIP: upd quartz --- runtime/common/config/xcm.rs | 10 ++- runtime/quartz/src/lib.rs | 2 + runtime/quartz/src/xcm_config.rs | 109 +++++++++++++++++++++++++++++++ runtime/unique/src/xcm_config.rs | 0 4 files changed, 115 insertions(+), 6 deletions(-) create mode 100644 runtime/quartz/src/xcm_config.rs create mode 100644 runtime/unique/src/xcm_config.rs diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs index 37abd61428..1b71cc1deb 100644 --- a/runtime/common/config/xcm.rs +++ b/runtime/common/config/xcm.rs @@ -358,8 +358,8 @@ pub type FungiblesTransactor = FungiblesAdapter< #[cfg(feature = "foreign-assets")] pub type AssetTransactors = FungiblesTransactor; -//#[cfg(not(feature = "foreign-assets"))] -//pub type AssetTransactors = LocalAssetTransactor; +#[cfg(not(feature = "foreign-assets"))] +pub type AssetTransactors = LocalAssetTransactor; #[cfg(feature = "foreign-assets")] pub struct AllAsset; @@ -372,15 +372,14 @@ impl FilterAssetLocation for AllAsset { #[cfg(feature = "foreign-assets")] pub type IsReserve = AllAsset; -//#[cfg(not(feature = "foreign-assets"))] -//pub type IsReserve = NativeAsset; +#[cfg(not(feature = "foreign-assets"))] +pub type IsReserve = NativeAsset; #[cfg(feature = "foreign-assets")] type Trader = UsingAnyCurrencyComponents< pallet_configuration::WeightToFee, RelayLocation, AccountId, Balances, ()>; -/* #[cfg(not(feature = "foreign-assets"))] type Trader = UsingOnlySelfCurrencyComponents< pallet_configuration::WeightToFee, @@ -389,7 +388,6 @@ type Trader = UsingOnlySelfCurrencyComponents< Balances, (), >; -*/ pub struct XcmConfig(PhantomData); impl Config for XcmConfig diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index cc196963c0..a735564e6f 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -35,6 +35,8 @@ use up_common::types::*; #[path = "../../common/mod.rs"] mod runtime_common; +pub mod xcm_config; + pub use runtime_common::*; pub const RUNTIME_NAME: &str = "quartz"; diff --git a/runtime/quartz/src/xcm_config.rs b/runtime/quartz/src/xcm_config.rs new file mode 100644 index 0000000000..9125e53869 --- /dev/null +++ b/runtime/quartz/src/xcm_config.rs @@ -0,0 +1,109 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use cumulus_pallet_xcm; +use frame_support::{ + {match_types, parameter_types, weights::Weight}, + pallet_prelude::Get, + traits::{Contains, Everything, fungibles}, +}; +use frame_system::EnsureRoot; +use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; +use pallet_xcm::XcmPassthrough; +use polkadot_parachain::primitives::Sibling; +use sp_runtime::traits::{AccountIdConversion, CheckedConversion, Convert, Zero}; +use sp_std::{borrow::Borrow, marker::PhantomData, vec, vec::Vec}; +use xcm::{ + latest::{MultiAsset, Xcm}, + prelude::{Concrete, Fungible as XcmFungible}, + v1::{BodyId, Junction::*, Junctions::*, MultiLocation, NetworkId}, +}; +use xcm_builder::{ + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, + EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter, LocationInverter, ParentAsSuperuser, + ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + ConvertedConcreteAssetId, +}; +use xcm_executor::{ + {Config, XcmExecutor}, + traits::{Convert as ConvertXcm, FilterAssetLocation, JustTry, MatchesFungible, ShouldExecute}, +}; + +use up_common::{ + constants::{MAXIMUM_BLOCK_WEIGHT, UNIQUE}, + types::{AccountId, Balance}, +}; + +use crate::{ + Balances, Call, DmpQueue, Event, Origin, ParachainInfo, + ParachainSystem, PolkadotXcm, Runtime, XcmpQueue, +}; +use crate::runtime_common::config::substrate::{TreasuryModuleId, MaxLocks, MaxReserves}; +use crate::runtime_common::config::pallets::TreasuryAccountId; +use crate::runtime_common::config::xcm::*; +use crate::*; + +// Signed version of balance +pub type Amount = i128; + +match_types! { + pub type ParentOrParentsExecutivePlurality: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } + }; + pub type ParentOrSiblings: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(_) } + }; +} + +/// Deny executing the XCM if it matches any of the Deny filter regardless of anything else. +/// If it passes the Deny, and matches one of the Allow cases then it is let through. +pub struct DenyThenTry(PhantomData, PhantomData) + where + Deny: ShouldExecute, + Allow: ShouldExecute; + +impl ShouldExecute for DenyThenTry + where + Deny: ShouldExecute, + Allow: ShouldExecute, +{ + fn should_execute( + origin: &MultiLocation, + message: &mut Xcm, + max_weight: Weight, + weight_credit: &mut Weight, + ) -> Result<(), ()> { + Deny::should_execute(origin, message, max_weight, weight_credit)?; + Allow::should_execute(origin, message, max_weight, weight_credit) + } +} + +pub type Barrier = DenyThenTry< + DenyExchangeWithUnknownLocation, + ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + // Parent and its exec plurality get free execution + AllowUnpaidExecutionFrom, + // Expected responses are OK. + AllowKnownQueryResponses, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), +>; \ No newline at end of file diff --git a/runtime/unique/src/xcm_config.rs b/runtime/unique/src/xcm_config.rs new file mode 100644 index 0000000000..e69de29bb2 From c31f5c85f1489673967ea6448568aedb7d18161f Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 23 Aug 2022 10:55:13 +0000 Subject: [PATCH 0498/1274] chore: change method names --- pallets/common/src/erc.rs | 42 +- pallets/common/src/eth.rs | 19 +- pallets/common/src/lib.rs | 2 +- pallets/fungible/src/stubs/UniqueFungible.raw | Bin 2853 -> 2853 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 210 ++-- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4272 -> 4272 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 962 ++++++++--------- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4299 -> 4299 bytes .../refungible/src/stubs/UniqueRefungible.sol | 974 +++++++++--------- tests/src/eth/api/UniqueFungible.sol | 104 +- tests/src/eth/api/UniqueNFT.sol | 374 +++---- tests/src/eth/api/UniqueRefungible.sol | 374 +++---- tests/src/eth/collectionAdmin.test.ts | 36 +- .../src/eth/fractionalizer/Fractionalizer.sol | 2 +- tests/src/eth/fungibleAbi.json | 72 +- tests/src/eth/nonFungibleAbi.json | 72 +- tests/src/eth/reFungibleAbi.json | 72 +- 17 files changed, 1660 insertions(+), 1655 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 3762595e7c..48af4fbf81 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -30,7 +30,10 @@ use up_data_structs::{ }; use alloc::format; -use crate::{Pallet, CollectionHandle, Config, CollectionProperties}; +use crate::{ + Pallet, CollectionHandle, Config, CollectionProperties, + eth::convert_substrate_address_to_cross_account_id, +}; /// Events for ethereum collection helper. #[derive(ToLog)] @@ -408,25 +411,20 @@ where /// /// @param user account to verify /// @return "true" if account is the owner or admin - fn verify_owner_or_admin(&self, user: address) -> Result { + #[solidity(rename_selector = "isOwnerOrAdmin")] + fn is_owner_or_admin_eth(&self, user: address) -> Result { let user = T::CrossAccountId::from_eth(user); - Ok(self - .check_is_owner_or_admin(&user) - .map(|_| true) - .unwrap_or(false)) + Ok(self.is_owner_or_admin(&user)) } /// Check that substrate account is the owner or admin of the collection /// /// @param user account to verify /// @return "true" if account is the owner or admin - #[solidity(rename_selector = "verifyOwnerOrAdmin")] - fn verify_owner_or_admin_substrate(&self, user: uint256) -> Result { + #[solidity(rename_selector = "isOwnerOrAdmin")] + fn is_owner_or_admin_substrate(&self, user: uint256) -> Result { let user = convert_substrate_address_to_cross_account_id::(user); - Ok(self - .check_is_owner_or_admin(&user) - .map(|_| true) - .unwrap_or(false)) + Ok(self.is_owner_or_admin(&user)) } /// Returns collection type @@ -445,10 +443,10 @@ where /// /// @dev Owner can be changed only by current owner /// @param newOwner new owner account - fn change_owner(&mut self, caller: caller, new_owner: address) -> Result { + fn set_owner(&mut self, caller: caller, new_owner: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let new_owner = T::CrossAccountId::from_eth(new_owner); - self.change_owner_internal(caller, new_owner) + self.set_owner_internal(caller, new_owner) .map_err(dispatch_to_evm::) } @@ -456,25 +454,15 @@ where /// /// @dev Owner can be changed only by current owner /// @param newOwner new owner substrate account - #[solidity(rename_selector = "changeOwner")] - fn change_owner_substrate(&mut self, caller: caller, new_owner: uint256) -> Result { + #[solidity(rename_selector = "setOwner")] + fn set_owner_substrate(&mut self, caller: caller, new_owner: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); let new_owner = convert_substrate_address_to_cross_account_id::(new_owner); - self.change_owner_internal(caller, new_owner) + self.set_owner_internal(caller, new_owner) .map_err(dispatch_to_evm::) } } -fn convert_substrate_address_to_cross_account_id(address: uint256) -> T::CrossAccountId -where - T::AccountId: From<[u8; 32]>, -{ - let mut address_arr: [u8; 32] = Default::default(); - address.to_big_endian(&mut address_arr); - let account_id = T::AccountId::from(address_arr); - T::CrossAccountId::from_sub(account_id) -} - fn check_is_owner_or_admin( caller: caller, collection: &CollectionHandle, diff --git a/pallets/common/src/eth.rs b/pallets/common/src/eth.rs index 21bc27ae04..bf74dfe763 100644 --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -16,8 +16,12 @@ //! The module contains a number of functions for converting and checking ethereum identifiers. -use up_data_structs::CollectionId; +use evm_coder::{types::*}; +pub use pallet_evm::account::CrossAccountId; use sp_core::H160; +use up_data_structs::CollectionId; + +use crate::Config; // 0x17c4e6453Cc49AAAaEACA894e6D9683e00000001 - collection 1 // TODO: Unhardcode prefix @@ -47,3 +51,16 @@ pub fn collection_id_to_address(id: CollectionId) -> H160 { pub fn is_collection(address: &H160) -> bool { address[0..16] == ETH_COLLECTION_PREFIX } + +/// Converts Substrate address to CrossAccountId +pub fn convert_substrate_address_to_cross_account_id( + address: uint256, +) -> T::CrossAccountId +where + T::AccountId: From<[u8; 32]>, +{ + let mut address_arr: [u8; 32] = Default::default(); + address.to_big_endian(&mut address_arr); + let account_id = T::AccountId::from(address_arr); + T::CrossAccountId::from_sub(account_id) +} diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index bf044d4cc5..7cef3f065e 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -304,7 +304,7 @@ impl CollectionHandle { } /// Changes collection owner to another account - fn change_owner_internal( + fn set_owner_internal( &mut self, caller: T::CrossAccountId, new_owner: T::CrossAccountId, diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index b785260ca5d7ae24d821083f439f558f2216ef07..73a7aedd7404fe8eda18ba2b127563d02f952644 100644 GIT binary patch delta 1034 zcmZ9JUr1AN6vzE-_ug&7(#k zlj>#L55;Ig5EAu};#1U1niKtK^ZpO5X0~<7oK+iM@7!d`Z?nA$JG?&BbZ5NSS@$e1ja>g+-MYL`FHP?JlJv_bS6ZxmLijd6KV}bi&yw$zzCYju BV%q=! delta 1049 zcmZ8eT}TvB81?SXk1JWLt;?>`y0t-4W|^%9S*=As51ND0t}%&owOW!W*@qr_+4)`R zZFg@8l4ekf(L)gtVUQ$*LPp1dMjj0ZdBp*dPpG3UX~Du9pJfmgs@060;xlK@+v zGh`e6e~NJ40<_C`|U+)?WD7Jh+#H}pd<6BNn-_wmOrlk3hwlptkH zfP7*KdG>2m#EyrgiP@cuQMe5|e6#A$CN?^xc>f6wJw^o_Y(dvM$ z|x#rQQXECme^#_3d9if9JihW%kF)bRfxSp`2=U^_W)O6vvNcvK_;oe<6l zmZH*92pTM*AY&`$j^;c~h6-sqDl_9Uf{+!m*5^n;Rj0Y!6%xqzA(hnShms>X-xCcx z7ouVYf@B?STxrUZDJhf@Qc}5wiZM59b74iHTmOu~ZJv)Tv1J(n^Ng-pr=ut>84c+u zqbn$VO9wR{u*{XjKt$9GH&7>Hm_KNk|3z(~eA+;1%!i_)+$YeBNG{LjOZLKyUj-@I zLo40c zduh`M9Hb@nM>Vkx_J^d9P^4}KxO@C6sgyq~>#%Riv_I~qe*oY1Hg3(HrrrXwPQwcO-40j`cp&W^fjS0kPqban6e!`>pKOX;gFFSf z`%J7Bc-fd%o!9W1jpn`st113+3$Oz%O*f;eP>^mlZ79sXcRvo-HT;g}egUd$DJc zb(uZpl203bjG0$A?4YJ?b+Vb}7Y0Jqw9E!A4$mPK*NmIl5w}rG`_WQH&aj)7+VID! z@H{oOs$KYRGPWM&jb?ko8){^<6{fNy(XlR?R-Ej#0+m~wyXnve2?a`$4C>tm+`XT+uH$s`HI zqeZ2Z$GhcAs;A`ZRV%t0N)hFRNp@C{{t~EuU8Ve9YJEHqIvOLssJ|b-=}cA6nycny~#o9zKe@)wj@=NSpv9e0Y(c%P=ol%l1 zp@K~l6dx6w#u03V6&r;enlY3hL!np#hYG``$UlkAhGuyFnWb)_c?Yqu$-?r3u SwY98tZ5AD0{>~yrwf_ST?<9-> delta 1627 zcmY+Ce@t6d6vw%3U)T2o1`O)>5en^?Bu)lmnK&Y4(MT9>FDPxaI^U(@%rXrUry_HG zeSK~B3vGL0%QAwxKXCkEY+#AoFixk7S(wJeXcSWox*svP7_g%TOA6bKz^i?F>OhZkW~vBbUl&S)XKA*&<*|t{M7%2aZ== zo_eMlys|rLlQ9edl#%*z-X9Pkq$HURG2d*ue8zz`h9F7nKdpkW5|HCXQfYyni>vkw3cXFD2g z;ABfs+IDR33rzL!nr66m5qQMI20&JCke*>@)(9`kX5}+}{^V!-m zz()bw!_Ra9_GG8=yWXFMlU{|=dV78v@DqmY4xRTN{}*rpvaYiOX?ij)uz5|}^W;T~ z({fk$_d|qOmQk9#!&Nz-_4={-A#84GRxH@|Rc^%dMwBMMaCQ_Sx4FiW!$#t9Y~Epr zg%4;sWi9Ox(jYVx@2*>o`UF#me9X8iryh zA;%O)7!_llJ?)Si^VcyyuVKCyF4gMy`a_{^g-gT}6=9^KxE@0B!(rH1;Aodf1o^|E zLP)&sQ{55cGK3nV6k7I2kveQv9A)UxI>>HeSr-=Cu(iqSKd2#hsQVE7#xgb^6JVi_ z)JqkJC!LZ5jgdW)tKd^Q4GWjUa7*N`e0!~MjplTuI6^484hy$wLUm)&!j>SL3d$Z6 zU9^zYQPQvJa9FY37j|piMj{SdVX@BZS4ZW{Cn+c6@DgE#J5NUJWAnwANNax0mN*M- zJyDJQ2N}JpsF9fQ#>ALB&f*`Z-umb7{f_fx8+m*>-FvjBcdqurH>q^n{KU;g5-e=|AMYSH#{d8T diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index 0fcf9e0df8..a7dad7a0bd 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -51,734 +51,734 @@ contract ERC721MintableEvents { event MintingFinished(); } -// Selector: 41369377 -contract TokenProperties is Dummy, ERC165 { - // @notice Set permissions for token property. - // @dev Throws error if `msg.sender` is not admin or owner of the collection. - // @param key Property key. - // @param is_mutable Permission to mutate property. - // @param collection_admin Permission to mutate property by collection admin if property is mutable. - // @param token_owner Permission to mutate property by token owner if property is mutable. +// Selector: 2f4a7085 +contract Collection is Dummy, ERC165 { + // Set collection property. // - // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa - function setTokenPropertyPermission( - string memory key, - bool isMutable, - bool collectionAdmin, - bool tokenOwner - ) public { - require(false, stub_error); - key; - isMutable; - collectionAdmin; - tokenOwner; - dummy = 0; - } - - // @notice Set token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. // @param key Property key. - // @param value Property value. + // @param value Propery value. // - // Selector: setProperty(uint256,string,bytes) 1752d67b - function setProperty( - uint256 tokenId, - string memory key, - bytes memory value - ) public { + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + public + { require(false, stub_error); - tokenId; key; value; dummy = 0; } - // @notice Delete token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. + // Delete collection property. + // // @param key Property key. // - // Selector: deleteProperty(uint256,string) 066111d1 - function deleteProperty(uint256 tokenId, string memory key) public { + // Selector: deleteCollectionProperty(string) 7b7debce + function deleteCollectionProperty(string memory key) public { require(false, stub_error); - tokenId; key; dummy = 0; } - // @notice Get token property value. - // @dev Throws error if key not found - // @param tokenId ID of the token. + // Get collection property. + // + // @dev Throws error if key not found. + // // @param key Property key. - // @return Property value bytes + // @return bytes The property corresponding to the key. // - // Selector: property(uint256,string) 7228c327 - function property(uint256 tokenId, string memory key) + // Selector: collectionProperty(string) cf24fd6d + function collectionProperty(string memory key) public view returns (bytes memory) { require(false, stub_error); - tokenId; key; dummy; return hex""; } -} -// Selector: 42966c68 -contract ERC721Burnable is Dummy, ERC165 { - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized - // operator of the current owner. - // @param tokenId The NFT to approve + // Set the sponsor of the collection. // - // Selector: burn(uint256) 42966c68 - function burn(uint256 tokenId) public { + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) public { require(false, stub_error); - tokenId; + sponsor; dummy = 0; } -} -// Selector: 58800161 -contract ERC721 is Dummy, ERC165, ERC721Events { - // @notice Count all NFTs assigned to an owner - // @dev NFTs assigned to the zero address are considered invalid, and this - // function throws for queries about the zero address. - // @param owner An address for whom to query the balance - // @return The number of NFTs owned by `owner`, possibly zero + // Collection sponsorship confirmation. // - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) public view returns (uint256) { + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() public { require(false, stub_error); - owner; - dummy; - return 0; + dummy = 0; } - // @notice Find the owner of an NFT - // @dev NFTs assigned to zero address are considered invalid, and queries - // about them do throw. - // @param tokenId The identifier for an NFT - // @return The address of the owner of the NFT + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. // - // Selector: ownerOf(uint256) 6352211e - function ownerOf(uint256 tokenId) public view returns (address) { + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) public { require(false, stub_error); - tokenId; - dummy; - return 0x0000000000000000000000000000000000000000; + limit; + value; + dummy = 0; } - // @dev Not implemented + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. // - // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672 - function safeTransferFromWithData( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public { + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) public { require(false, stub_error); - from; - to; - tokenId; - data; + limit; + value; dummy = 0; } - // @dev Not implemented + // Get contract address. // - // Selector: safeTransferFrom(address,address,uint256) 42842e0e - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public { + // Selector: contractAddress() f6b4dfb4 + function contractAddress() public view returns (address) { require(false, stub_error); - from; - to; - tokenId; + dummy; + return 0x0000000000000000000000000000000000000000; + } + + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. + // + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) public { + require(false, stub_error); + newAdmin; dummy = 0; } - // @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE - // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE - // THEY MAY BE PERMANENTLY LOST - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this NFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid NFT. - // @param from The current owner of the NFT - // @param to The new owner - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT + // Remove collection admin by substrate address. + // @param admin Substrate administrator address. // - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 tokenId - ) public { + // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + function removeCollectionAdminSubstrate(uint256 admin) public { require(false, stub_error); - from; - to; - tokenId; + admin; dummy = 0; } - // @notice Set or reaffirm the approved address for an NFT - // @dev The zero address indicates there is no approved address. - // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized - // operator of the current owner. - // @param approved The new approved NFT controller - // @param tokenId The NFT to approve + // Add collection admin. + // @param new_admin Address of the added administrator. // - // Selector: approve(address,uint256) 095ea7b3 - function approve(address approved, uint256 tokenId) public { + // Selector: addCollectionAdmin(address) 92e462c7 + function addCollectionAdmin(address newAdmin) public { require(false, stub_error); - approved; - tokenId; + newAdmin; dummy = 0; } - // @dev Not implemented + // Remove collection admin. // - // Selector: setApprovalForAll(address,bool) a22cb465 - function setApprovalForAll(address operator, bool approved) public { + // @param new_admin Address of the removed administrator. + // + // Selector: removeCollectionAdmin(address) fafd7b42 + function removeCollectionAdmin(address admin) public { require(false, stub_error); - operator; - approved; + admin; dummy = 0; } - // @dev Not implemented + // Toggle accessibility of collection nesting. // - // Selector: getApproved(uint256) 081812fc - function getApproved(uint256 tokenId) public view returns (address) { + // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // + // Selector: setCollectionNesting(bool) 112d4586 + function setCollectionNesting(bool enable) public { require(false, stub_error); - tokenId; - dummy; - return 0x0000000000000000000000000000000000000000; + enable; + dummy = 0; } - // @dev Not implemented + // Toggle accessibility of collection nesting. // - // Selector: isApprovedForAll(address,address) e985e9c5 - function isApprovedForAll(address owner, address operator) + // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + // @param collections Addresses of collections that will be available for nesting. + // + // Selector: setCollectionNesting(bool,address[]) 64872396 + function setCollectionNesting(bool enable, address[] memory collections) public - view - returns (address) { require(false, stub_error); - owner; - operator; - dummy; - return 0x0000000000000000000000000000000000000000; + enable; + collections; + dummy = 0; } -} -// Selector: 5b5e139f -contract ERC721Metadata is Dummy, ERC165 { - // @notice A descriptive name for a collection of NFTs in this contract - // - // Selector: name() 06fdde03 - function name() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // @notice An abbreviated name for NFTs in this contract + // Set the collection access method. + // @param mode Access mode + // 0 for Normal + // 1 for AllowList // - // Selector: symbol() 95d89b41 - function symbol() public view returns (string memory) { + // Selector: setCollectionAccess(uint8) 41835d4c + function setCollectionAccess(uint8 mode) public { require(false, stub_error); - dummy; - return ""; + mode; + dummy = 0; } - // @notice A distinct Uniform Resource Identifier (URI) for a given asset. - // - // @dev If the token has a `url` property and it is not empty, it is returned. - // Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. - // If the collection property `baseURI` is empty or absent, return "" (empty string) - // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix - // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). - // - // @return token's const_metadata + // Add the user to the allowed list. // - // Selector: tokenURI(uint256) c87b56dd - function tokenURI(uint256 tokenId) public view returns (string memory) { - require(false, stub_error); - tokenId; - dummy; - return ""; - } -} - -// Selector: 68ccfe89 -contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { - // Selector: mintingFinished() 05d2035b - function mintingFinished() public view returns (bool) { - require(false, stub_error); - dummy; - return false; - } - - // @notice Function to mint token. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted NFT + // @param user Address of a trusted user. // - // Selector: mint(address,uint256) 40c10f19 - function mint(address to, uint256 tokenId) public returns (bool) { + // Selector: addToCollectionAllowList(address) 67844fe6 + function addToCollectionAllowList(address user) public { require(false, stub_error); - to; - tokenId; + user; dummy = 0; - return false; } - // @notice Function to mint token with the given tokenUri. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted NFT - // @param tokenUri Token URI that would be stored in the NFT properties + // Remove the user from the allowed list. // - // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f - function mintWithTokenURI( - address to, - uint256 tokenId, - string memory tokenUri - ) public returns (bool) { + // @param user Address of a removed user. + // + // Selector: removeFromCollectionAllowList(address) 85c51acb + function removeFromCollectionAllowList(address user) public { require(false, stub_error); - to; - tokenId; - tokenUri; + user; dummy = 0; - return false; } - // @dev Not implemented + // Switch permission for minting. // - // Selector: finishMinting() 7d64bcb4 - function finishMinting() public returns (bool) { + // @param mode Enable if "true". + // + // Selector: setCollectionMintMode(bool) 00018e84 + function setCollectionMintMode(bool mode) public { require(false, stub_error); + mode; dummy = 0; - return false; } -} -// Selector: 780e9d63 -contract ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid NFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) + // Check that account is the owner or admin of the collection // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) public view returns (uint256) { - require(false, stub_error); - index; - dummy; - return 0; - } - - // @dev Not implemented + // @param user account to verify + // @return "true" if account is the owner or admin // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - public - view - returns (uint256) - { + // Selector: isOwnerOrAdmin(address) 9811b0c7 + function isOwnerOrAdmin(address user) public view returns (bool) { require(false, stub_error); - owner; - index; + user; dummy; - return 0; + return false; } - // @notice Count NFTs tracked by this contract - // @return A count of valid NFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address + // Check that substrate account is the owner or admin of the collection // - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: isOwnerOrAdmin(uint256) 8a6cfe67 + function isOwnerOrAdmin(uint256 user) public view returns (bool) { require(false, stub_error); + user; dummy; - return 0; + return false; } -} -// Selector: d74d154f -contract ERC721UniqueExtensions is Dummy, ERC165 { - // @notice Transfer ownership of an NFT - // @dev Throws unless `msg.sender` is the current owner. Throws if `to` - // is the zero address. Throws if `tokenId` is not a valid NFT. - // @param to The new owner - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT + // Returns collection type // - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 tokenId) public { + // @return `Fungible` or `NFT` or `ReFungible` + // + // Selector: uniqueCollectionType() d34b55b8 + function uniqueCollectionType() public returns (string memory) { require(false, stub_error); - to; - tokenId; dummy = 0; + return ""; } - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this NFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid NFT. - // @param from The current owner of the NFT - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT + // Changes collection owner to another account // - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 tokenId) public { + // @dev Owner can be changed only by current owner + // @param newOwner new owner account + // + // Selector: setOwner(address) 13af4035 + function setOwner(address newOwner) public { require(false, stub_error); - from; - tokenId; + newOwner; dummy = 0; } - // @notice Returns next free NFT ID. + // Changes collection owner to another substrate account // - // Selector: nextTokenId() 75794a3c - function nextTokenId() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } - - // @notice Function to mint multiple tokens. - // @dev `tokenIds` should be an array of consecutive numbers and first number - // should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokenIds IDs of the minted NFTs + // @dev Owner can be changed only by current owner + // @param newOwner new owner substrate account // - // Selector: mintBulk(address,uint256[]) 44a9945e - function mintBulk(address to, uint256[] memory tokenIds) - public - returns (bool) - { + // Selector: setOwner(uint256) 8041494e + function setOwner(uint256 newOwner) public { require(false, stub_error); - to; - tokenIds; + newOwner; dummy = 0; - return false; } +} - // @notice Function to mint multiple tokens with the given tokenUris. - // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // numbers and first number should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokens array of pairs of token ID and token URI for minted tokens +// Selector: 41369377 +contract TokenProperties is Dummy, ERC165 { + // @notice Set permissions for token property. + // @dev Throws error if `msg.sender` is not admin or owner of the collection. + // @param key Property key. + // @param is_mutable Permission to mutate property. + // @param collection_admin Permission to mutate property by collection admin if property is mutable. + // @param token_owner Permission to mutate property by token owner if property is mutable. // - // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 - function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) - public - returns (bool) - { + // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa + function setTokenPropertyPermission( + string memory key, + bool isMutable, + bool collectionAdmin, + bool tokenOwner + ) public { require(false, stub_error); - to; - tokens; + key; + isMutable; + collectionAdmin; + tokenOwner; dummy = 0; - return false; } -} -// Selector: f077f83e -contract Collection is Dummy, ERC165 { - // Set collection property. - // + // @notice Set token property value. + // @dev Throws error if `msg.sender` has no permission to edit the property. + // @param tokenId ID of the token. // @param key Property key. - // @param value Propery value. + // @param value Property value. // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - public - { + // Selector: setProperty(uint256,string,bytes) 1752d67b + function setProperty( + uint256 tokenId, + string memory key, + bytes memory value + ) public { require(false, stub_error); + tokenId; key; value; dummy = 0; } - // Delete collection property. - // + // @notice Delete token property value. + // @dev Throws error if `msg.sender` has no permission to edit the property. + // @param tokenId ID of the token. // @param key Property key. // - // Selector: deleteCollectionProperty(string) 7b7debce - function deleteCollectionProperty(string memory key) public { + // Selector: deleteProperty(uint256,string) 066111d1 + function deleteProperty(uint256 tokenId, string memory key) public { require(false, stub_error); + tokenId; key; dummy = 0; } - // Get collection property. - // - // @dev Throws error if key not found. - // + // @notice Get token property value. + // @dev Throws error if key not found + // @param tokenId ID of the token. // @param key Property key. - // @return bytes The property corresponding to the key. + // @return Property value bytes // - // Selector: collectionProperty(string) cf24fd6d - function collectionProperty(string memory key) + // Selector: property(uint256,string) 7228c327 + function property(uint256 tokenId, string memory key) public view returns (bytes memory) { require(false, stub_error); + tokenId; key; dummy; return hex""; } +} - // Set the sponsor of the collection. +// Selector: 42966c68 +contract ERC721Burnable is Dummy, ERC165 { + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized + // operator of the current owner. + // @param tokenId The NFT to approve // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // Selector: burn(uint256) 42966c68 + function burn(uint256 tokenId) public { + require(false, stub_error); + tokenId; + dummy = 0; + } +} + +// Selector: 58800161 +contract ERC721 is Dummy, ERC165, ERC721Events { + // @notice Count all NFTs assigned to an owner + // @dev NFTs assigned to the zero address are considered invalid, and this + // function throws for queries about the zero address. + // @param owner An address for whom to query the balance + // @return The number of NFTs owned by `owner`, possibly zero // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) public view returns (uint256) { + require(false, stub_error); + owner; + dummy; + return 0; + } + + // @notice Find the owner of an NFT + // @dev NFTs assigned to zero address are considered invalid, and queries + // about them do throw. + // @param tokenId The identifier for an NFT + // @return The address of the owner of the NFT // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) public { + // Selector: ownerOf(uint256) 6352211e + function ownerOf(uint256 tokenId) public view returns (address) { require(false, stub_error); - sponsor; + tokenId; + dummy; + return 0x0000000000000000000000000000000000000000; + } + + // @dev Not implemented + // + // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672 + function safeTransferFromWithData( + address from, + address to, + uint256 tokenId, + bytes memory data + ) public { + require(false, stub_error); + from; + to; + tokenId; + data; dummy = 0; } - // Collection sponsorship confirmation. + // @dev Not implemented // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // Selector: safeTransferFrom(address,address,uint256) 42842e0e + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) public { + require(false, stub_error); + from; + to; + tokenId; + dummy = 0; + } + + // @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE + // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + // THEY MAY BE PERMANENTLY LOST + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this NFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid NFT. + // @param from The current owner of the NFT + // @param to The new owner + // @param tokenId The NFT to transfer + // @param _value Not used for an NFT // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() public { + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 tokenId + ) public { require(false, stub_error); + from; + to; + tokenId; dummy = 0; } - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. + // @notice Set or reaffirm the approved address for an NFT + // @dev The zero address indicates there is no approved address. + // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized + // operator of the current owner. + // @param approved The new approved NFT controller + // @param tokenId The NFT to approve // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) public { + // Selector: approve(address,uint256) 095ea7b3 + function approve(address approved, uint256 tokenId) public { require(false, stub_error); - limit; - value; + approved; + tokenId; dummy = 0; } - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. + // @dev Not implemented // - // Selector: setCollectionLimit(string,bool) 993b7fba - function setCollectionLimit(string memory limit, bool value) public { + // Selector: setApprovalForAll(address,bool) a22cb465 + function setApprovalForAll(address operator, bool approved) public { require(false, stub_error); - limit; - value; + operator; + approved; dummy = 0; } - // Get contract address. + // @dev Not implemented // - // Selector: contractAddress() f6b4dfb4 - function contractAddress() public view returns (address) { + // Selector: getApproved(uint256) 081812fc + function getApproved(uint256 tokenId) public view returns (address) { + require(false, stub_error); + tokenId; + dummy; + return 0x0000000000000000000000000000000000000000; + } + + // @dev Not implemented + // + // Selector: isApprovedForAll(address,address) e985e9c5 + function isApprovedForAll(address owner, address operator) + public + view + returns (address) + { require(false, stub_error); + owner; + operator; dummy; return 0x0000000000000000000000000000000000000000; } +} - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. +// Selector: 5b5e139f +contract ERC721Metadata is Dummy, ERC165 { + // @notice A descriptive name for a collection of NFTs in this contract // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) public { + // Selector: name() 06fdde03 + function name() public view returns (string memory) { require(false, stub_error); - newAdmin; - dummy = 0; + dummy; + return ""; } - // Remove collection admin by substrate address. - // @param admin Substrate administrator address. + // @notice An abbreviated name for NFTs in this contract // - // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 - function removeCollectionAdminSubstrate(uint256 admin) public { + // Selector: symbol() 95d89b41 + function symbol() public view returns (string memory) { require(false, stub_error); - admin; - dummy = 0; + dummy; + return ""; } - // Add collection admin. - // @param new_admin Address of the added administrator. + // @notice A distinct Uniform Resource Identifier (URI) for a given asset. // - // Selector: addCollectionAdmin(address) 92e462c7 - function addCollectionAdmin(address newAdmin) public { - require(false, stub_error); - newAdmin; - dummy = 0; - } - - // Remove collection admin. + // @dev If the token has a `url` property and it is not empty, it is returned. + // Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + // If the collection property `baseURI` is empty or absent, return "" (empty string) + // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). // - // @param new_admin Address of the removed administrator. + // @return token's const_metadata // - // Selector: removeCollectionAdmin(address) fafd7b42 - function removeCollectionAdmin(address admin) public { + // Selector: tokenURI(uint256) c87b56dd + function tokenURI(uint256 tokenId) public view returns (string memory) { require(false, stub_error); - admin; - dummy = 0; + tokenId; + dummy; + return ""; } +} - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' - // - // Selector: setCollectionNesting(bool) 112d4586 - function setCollectionNesting(bool enable) public { +// Selector: 68ccfe89 +contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { + // Selector: mintingFinished() 05d2035b + function mintingFinished() public view returns (bool) { require(false, stub_error); - enable; - dummy = 0; + dummy; + return false; } - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' - // @param collections Addresses of collections that will be available for nesting. + // @notice Function to mint token. + // @dev `tokenId` should be obtained with `nextTokenId` method, + // unlike standard, you can't specify it manually + // @param to The new owner + // @param tokenId ID of the minted NFT // - // Selector: setCollectionNesting(bool,address[]) 64872396 - function setCollectionNesting(bool enable, address[] memory collections) - public - { + // Selector: mint(address,uint256) 40c10f19 + function mint(address to, uint256 tokenId) public returns (bool) { require(false, stub_error); - enable; - collections; + to; + tokenId; dummy = 0; + return false; } - // Set the collection access method. - // @param mode Access mode - // 0 for Normal - // 1 for AllowList + // @notice Function to mint token with the given tokenUri. + // @dev `tokenId` should be obtained with `nextTokenId` method, + // unlike standard, you can't specify it manually + // @param to The new owner + // @param tokenId ID of the minted NFT + // @param tokenUri Token URI that would be stored in the NFT properties // - // Selector: setCollectionAccess(uint8) 41835d4c - function setCollectionAccess(uint8 mode) public { + // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f + function mintWithTokenURI( + address to, + uint256 tokenId, + string memory tokenUri + ) public returns (bool) { require(false, stub_error); - mode; + to; + tokenId; + tokenUri; dummy = 0; + return false; } - // Add the user to the allowed list. - // - // @param user Address of a trusted user. + // @dev Not implemented // - // Selector: addToCollectionAllowList(address) 67844fe6 - function addToCollectionAllowList(address user) public { + // Selector: finishMinting() 7d64bcb4 + function finishMinting() public returns (bool) { require(false, stub_error); - user; dummy = 0; + return false; } +} - // Remove the user from the allowed list. - // - // @param user Address of a removed user. +// Selector: 780e9d63 +contract ERC721Enumerable is Dummy, ERC165 { + // @notice Enumerate valid NFTs + // @param index A counter less than `totalSupply()` + // @return The token identifier for the `index`th NFT, + // (sort order not specified) // - // Selector: removeFromCollectionAllowList(address) 85c51acb - function removeFromCollectionAllowList(address user) public { + // Selector: tokenByIndex(uint256) 4f6ccce7 + function tokenByIndex(uint256 index) public view returns (uint256) { require(false, stub_error); - user; - dummy = 0; + index; + dummy; + return 0; } - // Switch permission for minting. - // - // @param mode Enable if "true". + // @dev Not implemented // - // Selector: setCollectionMintMode(bool) 00018e84 - function setCollectionMintMode(bool mode) public { + // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 + function tokenOfOwnerByIndex(address owner, uint256 index) + public + view + returns (uint256) + { require(false, stub_error); - mode; - dummy = 0; + owner; + index; + dummy; + return 0; } - // Check that account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin + // @notice Count NFTs tracked by this contract + // @return A count of valid NFTs tracked by this contract, where each one of + // them has an assigned and queryable owner not equal to the zero address // - // Selector: verifyOwnerOrAdmin(address) c2282493 - function verifyOwnerOrAdmin(address user) public view returns (bool) { + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { require(false, stub_error); - user; dummy; - return false; + return 0; } +} - // Check that substrate account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin +// Selector: d74d154f +contract ERC721UniqueExtensions is Dummy, ERC165 { + // @notice Transfer ownership of an NFT + // @dev Throws unless `msg.sender` is the current owner. Throws if `to` + // is the zero address. Throws if `tokenId` is not a valid NFT. + // @param to The new owner + // @param tokenId The NFT to transfer + // @param _value Not used for an NFT // - // Selector: verifyOwnerOrAdmin(uint256) a83328e5 - function verifyOwnerOrAdmin(uint256 user) public view returns (bool) { + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 tokenId) public { require(false, stub_error); - user; - dummy; - return false; + to; + tokenId; + dummy = 0; } - // Returns collection type - // - // @return `Fungible` or `NFT` or `ReFungible` + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this NFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid NFT. + // @param from The current owner of the NFT + // @param tokenId The NFT to transfer + // @param _value Not used for an NFT // - // Selector: uniqueCollectionType() d34b55b8 - function uniqueCollectionType() public returns (string memory) { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 tokenId) public { require(false, stub_error); + from; + tokenId; dummy = 0; - return ""; } - // Changes collection owner to another account + // @notice Returns next free NFT ID. // - // @dev Owner can be changed only by current owner - // @param newOwner new owner account + // Selector: nextTokenId() 75794a3c + function nextTokenId() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } + + // @notice Function to mint multiple tokens. + // @dev `tokenIds` should be an array of consecutive numbers and first number + // should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokenIds IDs of the minted NFTs // - // Selector: changeOwner(address) a6f9dae1 - function changeOwner(address newOwner) public { + // Selector: mintBulk(address,uint256[]) 44a9945e + function mintBulk(address to, uint256[] memory tokenIds) + public + returns (bool) + { require(false, stub_error); - newOwner; + to; + tokenIds; dummy = 0; + return false; } - // Changes collection owner to another substrate account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner substrate account + // @notice Function to mint multiple tokens with the given tokenUris. + // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // numbers and first number should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokens array of pairs of token ID and token URI for minted tokens // - // Selector: changeOwner(uint256) 924c19f7 - function changeOwner(uint256 newOwner) public { + // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 + function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + public + returns (bool) + { require(false, stub_error); - newOwner; + to; + tokens; dummy = 0; + return false; } } diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index c45f8c3112aed74ffd5a26bbc6643d0657345071..8af90da9fabae1597b8707061ca09c247c112317 100644 GIT binary patch delta 1684 zcmZ9LU2GIp6vulzyR*A9+m>xhzioHB^g$_Yc^IU$pHHfet6 z{LlZMbMD;E`R05lzeZ&}L0_c@qcdTp=V0IcUO*e*@xgnuMce7%y7~8Erty11Wv0 z8@$j%=^4K|*$Q~nsv6ke)(pe!1?j-h?au%=Qv`1W0T1o?cp4lUpwjwedm*-U1IEsm z&1H_HV;ko{d>^Dif1oZSDLwly_9g)rXEJU9;wh-wk?K)%v!|wI1*C0C& z+5R_FA~K!`ZBXxMdESGw)1Yk9>v91b06Y3FehK36*m+IzdQg(e+4-M;SPQUEGf#l0cc!h z^_ti2fvFJCe`eneGHk216`TkNWXiUX*NK^}>tq{tJ{*#;jV15fD;viF8B1_6%c7P{ z8D@4FCdVy9+e0JQ3}M){J)bVkaW|LMPcPN@xDi=>`1z%gyKz}`86q1?`#5vSJ8Vsf z)z-1>P!MNX@9AvEh3pR5tLjYtO6>HSSBY7NiXE3i61)aEOP2L`M%`$tnvfP{uZ{#6 z!Ed0PQB)6jw^6TiCs}Zn@bs&Q*f~nPT=nMTrmQczqK4_LWxAA5hY@Dq4M}4nc&^Ld zIKuWTAt?>fPjY}pDTwZpL!7V3RYI*UpPrc&3SIT&99Od;Xe#PrtIU9|U6x@Wt|iP~ z1Qv-QAtjm>qr}fw+fRkD>lA6@E4a@s$5qnLS493W!)OAf#DrX>p?u7_XimUf1?GxX z>^cIUfE^4;(P&V%r;@314e2PUM^W;i1}k$-rXvHGH|5(~(>iMezd6*P01M!2AZf1gXs}eTwfig|v>+lB&b7{7Yd?P=iJy z30q;lDO>*F}R z&x31M--X{C7@J=(7W=m@+=3N-P@_=q@Sk5^4R9~09f^l_0PF|2S!rAb&|&n_(7!(7#LN2PThMt=($h3a$Vh-dA~x53GP>ODOGD$J83>&iDhLWa#A zb5-E-VRF*Eh;EXzWp%BGf?;ghjZNL_B{R1CUd-5f%5GxQW3*PDr|e0cv9A*w(;R)f zSmVB0;-4w5@lQ}@?BP!pGofw?JF|q%Qf6cj)Y>s@UQiQNkZGpsUSp{B@#03Sy26NC zz9furX8Io{S8A1|5=l~0CVK_8c*%8k_1X^Y^4PL7oft-#nGA-BDEU*!H!8|;8~7rc zL&TPTvXS#_&uConNeF)YwWb(#O&W7PNXPX#Vs^71NS4f$W&QrfWXTAJ3pL($P0uPQ8;&cGo$m=HeDMGkG78FI{(jPEb#k)4l^-D?tGnfdPA&bZ zxPEndO!$?PY5IxcFB%P(lWI&NVm?pav(|HrUJ>kM-sW>&!UX;QORl&=;|e)F1yde}xYI|L{fS%;iuU~0 mpJPKeRy}v^wZXZoPuIS?^UanY- { const newAdmin = createEthAccount(web3); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - expect(await collectionEvm.methods.verifyOwnerOrAdmin(newAdmin).call()).to.be.false; + expect(await collectionEvm.methods.isOwnerOrAdmin(newAdmin).call()).to.be.false; await collectionEvm.methods.addCollectionAdmin(newAdmin).send(); - expect(await collectionEvm.methods.verifyOwnerOrAdmin(newAdmin).call()).to.be.true; + expect(await collectionEvm.methods.isOwnerOrAdmin(newAdmin).call()).to.be.true; }); itWeb3('(!negative tests!) Add admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { @@ -325,10 +325,10 @@ describe('Change owner tests', () => { const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await collectionEvm.methods.changeOwner(newOwner).send(); + await collectionEvm.methods.setOwner(newOwner).send(); - expect(await collectionEvm.methods.verifyOwnerOrAdmin(owner).call()).to.be.false; - expect(await collectionEvm.methods.verifyOwnerOrAdmin(newOwner).call()).to.be.true; + expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.false; + expect(await collectionEvm.methods.isOwnerOrAdmin(newOwner).call()).to.be.true; }); itWeb3('change owner call fee', async ({web3, api, privateKeyWrapper}) => { @@ -341,12 +341,12 @@ describe('Change owner tests', () => { const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - const cost = await recordEthFee(api, owner, () => collectionEvm.methods.changeOwner(newOwner).send()); + const cost = await recordEthFee(api, owner, () => collectionEvm.methods.setOwner(newOwner).send()); expect(cost < BigInt(0.2 * Number(UNIQUE))); expect(cost > 0); }); - itWeb3('(!negative tests!) call changeOwner by not owner', async ({api, web3, privateKeyWrapper}) => { + itWeb3('(!negative tests!) call setOwner by non owner', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const newOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelper = evmCollectionHelpers(web3, owner); @@ -356,8 +356,8 @@ describe('Change owner tests', () => { const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await expect(collectionEvm.methods.changeOwner(newOwner).send({from: newOwner})).to.be.rejected; - expect(await collectionEvm.methods.verifyOwnerOrAdmin(newOwner).call()).to.be.false; + await expect(collectionEvm.methods.setOwner(newOwner).send({from: newOwner})).to.be.rejected; + expect(await collectionEvm.methods.isOwnerOrAdmin(newOwner).call()).to.be.false; }); }); @@ -372,12 +372,12 @@ describe('Change substrate owner tests', () => { const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - expect(await collectionEvm.methods.verifyOwnerOrAdmin(owner).call()).to.be.true; - expect(await collectionEvm.methods['verifyOwnerOrAdmin(uint256)'](newOwner.addressRaw).call()).to.be.false; - await collectionEvm.methods['changeOwner(uint256)'](newOwner.addressRaw).send(); + expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.true; + expect(await collectionEvm.methods['isOwnerOrAdmin(uint256)'](newOwner.addressRaw).call()).to.be.false; + await collectionEvm.methods['setOwner(uint256)'](newOwner.addressRaw).send(); - expect(await collectionEvm.methods.verifyOwnerOrAdmin(owner).call()).to.be.false; - expect(await collectionEvm.methods['verifyOwnerOrAdmin(uint256)'](newOwner.addressRaw).call()).to.be.true; + expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.false; + expect(await collectionEvm.methods['isOwnerOrAdmin(uint256)'](newOwner.addressRaw).call()).to.be.true; }); itWeb3('change owner call fee', async ({web3, api, privateKeyWrapper}) => { @@ -390,12 +390,12 @@ describe('Change substrate owner tests', () => { const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - const cost = await recordEthFee(api, owner, () => collectionEvm.methods['changeOwner(uint256)'](newOwner.addressRaw).send()); + const cost = await recordEthFee(api, owner, () => collectionEvm.methods['setOwner(uint256)'](newOwner.addressRaw).send()); expect(cost < BigInt(0.2 * Number(UNIQUE))); expect(cost > 0); }); - itWeb3('(!negative tests!) call changeOwner by not owner', async ({api, web3, privateKeyWrapper}) => { + itWeb3('(!negative tests!) call setOwner by non owner', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const otherReceiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const newOwner = privateKeyWrapper('//Alice'); @@ -406,7 +406,7 @@ describe('Change substrate owner tests', () => { const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await expect(collectionEvm.methods['changeOwner(uint256)'](newOwner.addressRaw).send({from: otherReceiver})).to.be.rejected; - expect(await collectionEvm.methods['verifyOwnerOrAdmin(uint256)'](newOwner.addressRaw).call()).to.be.false; + await expect(collectionEvm.methods['setOwner(uint256)'](newOwner.addressRaw).send({from: otherReceiver})).to.be.rejected; + expect(await collectionEvm.methods['isOwnerOrAdmin(uint256)'](newOwner.addressRaw).call()).to.be.false; }); }); \ No newline at end of file diff --git a/tests/src/eth/fractionalizer/Fractionalizer.sol b/tests/src/eth/fractionalizer/Fractionalizer.sol index c27ddf22fe..81a2fb4ca5 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.sol +++ b/tests/src/eth/fractionalizer/Fractionalizer.sol @@ -64,7 +64,7 @@ contract Fractionalizer { "Wrong collection type. Collection is not refungible." ); require( - refungibleContract.verifyOwnerOrAdmin(address(this)), + refungibleContract.isOwnerOrAdmin(address(this)), "Fractionalizer contract should be an admin of the collection" ); rftCollection = _collection; diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index c18c5702ff..725b22b9a0 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -115,24 +115,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "newOwner", "type": "uint256" } - ], - "name": "changeOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "newOwner", "type": "address" } - ], - "name": "changeOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], "name": "collectionProperty", @@ -168,6 +150,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "user", "type": "uint256" } + ], + "name": "isOwnerOrAdmin", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "isOwnerOrAdmin", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "name", @@ -276,6 +276,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "setOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "newOwner", "type": "uint256" } + ], + "name": "setOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" } @@ -326,23 +344,5 @@ "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "verifyOwnerOrAdmin", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "user", "type": "address" } - ], - "name": "verifyOwnerOrAdmin", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" } ] diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index fb3a419e7e..1dd0e8463b 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -145,24 +145,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "newOwner", "type": "uint256" } - ], - "name": "changeOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "newOwner", "type": "address" } - ], - "name": "changeOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], "name": "collectionProperty", @@ -227,6 +209,24 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "user", "type": "uint256" } + ], + "name": "isOwnerOrAdmin", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "isOwnerOrAdmin", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, @@ -450,6 +450,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "setOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "newOwner", "type": "uint256" } + ], + "name": "setOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, @@ -551,23 +569,5 @@ "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "verifyOwnerOrAdmin", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "user", "type": "address" } - ], - "name": "verifyOwnerOrAdmin", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" } ] diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index 8f4fec7232..7770682df0 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -145,24 +145,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "newOwner", "type": "uint256" } - ], - "name": "changeOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "newOwner", "type": "address" } - ], - "name": "changeOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], "name": "collectionProperty", @@ -227,6 +209,24 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "user", "type": "uint256" } + ], + "name": "isOwnerOrAdmin", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "isOwnerOrAdmin", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, @@ -450,6 +450,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "setOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "newOwner", "type": "uint256" } + ], + "name": "setOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, @@ -560,23 +578,5 @@ "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "verifyOwnerOrAdmin", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "user", "type": "address" } - ], - "name": "verifyOwnerOrAdmin", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" } ] From c48658e80a8984957ef1e0a24f02e501b31c2c2c Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 23 Aug 2022 10:59:38 +0000 Subject: [PATCH 0499/1274] fix: quartz deps --- runtime/quartz/Cargo.toml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 5c7cabad83..41107a323f 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -115,8 +115,15 @@ std = [ 'xcm-builder/std', 'xcm-executor/std', 'up-common/std', + 'rmrk-rpc/std', + 'evm-coder/std', + 'up-sponsorship/std', "orml-vesting/std", + "orml-tokens/std", + "orml-xtokens/std", + "orml-traits/std", + "pallet-foreing-assets/std" ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] quartz-runtime = [] @@ -124,6 +131,7 @@ quartz-runtime = [] refungible = [] scheduler = [] rmrk = [] +foreign-assets = [] ################################################################################ # Substrate Dependencies @@ -396,6 +404,25 @@ branch = "polkadot-v0.9.27" version = "0.4.1-dev" default-features = false +[dependencies.orml-xtokens] +git = "https://github.com/open-web3-stack/open-runtime-module-library" +branch = "polkadot-v0.9.27" +version = "0.4.1-dev" +default-features = false + +[dependencies.orml-tokens] +git = "https://github.com/open-web3-stack/open-runtime-module-library" +branch = "polkadot-v0.9.27" +version = "0.4.1-dev" +default-features = false + +[dependencies.orml-traits] +git = "https://github.com/open-web3-stack/open-runtime-module-library" +branch = "polkadot-v0.9.27" +version = "0.4.1-dev" +default-features = false + + ################################################################################ # RMRK dependencies @@ -441,6 +468,7 @@ fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/fro fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } +pallet-foreing-assets = { default-features = false, path = "../../pallets/foreing-assets" } ################################################################################ # Build Dependencies From 1c90efe5bb3e6848ac709f9410642076b59ccce3 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 23 Aug 2022 11:04:54 +0000 Subject: [PATCH 0500/1274] fix: unique deps --- Cargo.lock | 8 ++++++++ runtime/unique/Cargo.toml | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 166f7762cd..fc1311c42f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8508,7 +8508,10 @@ dependencies = [ "frame-try-runtime", "hex-literal", "log", + "orml-tokens", + "orml-traits", "orml-vesting", + "orml-xtokens", "pallet-aura", "pallet-balances", "pallet-base-fee", @@ -8520,6 +8523,7 @@ dependencies = [ "pallet-evm-contract-helpers", "pallet-evm-migration", "pallet-evm-transaction-payment", + "pallet-foreing-assets", "pallet-fungible", "pallet-inflation", "pallet-nonfungible", @@ -12497,7 +12501,10 @@ dependencies = [ "frame-try-runtime", "hex-literal", "log", + "orml-tokens", + "orml-traits", "orml-vesting", + "orml-xtokens", "pallet-aura", "pallet-balances", "pallet-base-fee", @@ -12509,6 +12516,7 @@ dependencies = [ "pallet-evm-contract-helpers", "pallet-evm-migration", "pallet-evm-transaction-payment", + "pallet-foreing-assets", "pallet-fungible", "pallet-inflation", "pallet-nonfungible", diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 20eadb9523..b3c9b3729a 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -116,8 +116,15 @@ std = [ 'xcm-builder/std', 'xcm-executor/std', 'up-common/std', + 'rmrk-rpc/std', + 'evm-coder/std', + 'up-sponsorship/std', "orml-vesting/std", + "orml-tokens/std", + "orml-xtokens/std", + "orml-traits/std", + "pallet-foreing-assets/std" ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] unique-runtime = [] @@ -125,6 +132,7 @@ unique-runtime = [] refungible = [] scheduler = [] rmrk = [] +foreign-assets = [] ################################################################################ # Substrate Dependencies @@ -397,6 +405,23 @@ branch = "polkadot-v0.9.27" version = "0.4.1-dev" default-features = false +[dependencies.orml-xtokens] +git = "https://github.com/open-web3-stack/open-runtime-module-library" +branch = "polkadot-v0.9.27" +version = "0.4.1-dev" +default-features = false + +[dependencies.orml-tokens] +git = "https://github.com/open-web3-stack/open-runtime-module-library" +branch = "polkadot-v0.9.27" +version = "0.4.1-dev" +default-features = false + +[dependencies.orml-traits] +git = "https://github.com/open-web3-stack/open-runtime-module-library" +branch = "polkadot-v0.9.27" +version = "0.4.1-dev" +default-features = false ################################################################################ # local dependencies @@ -435,6 +460,7 @@ fp-self-contained = { default-features = false, git = "https://github.com/unique fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } +pallet-foreing-assets = { default-features = false, path = "../../pallets/foreing-assets" } ################################################################################ # Build Dependencies From 97b5bf9e9391e67beb6102de4d1e06138700a65e Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Tue, 23 Aug 2022 11:08:15 +0000 Subject: [PATCH 0501/1274] fix eslint and review suggestions --- tests/src/addCollectionAdmin.test.ts | 2 +- tests/src/util/playgrounds/unique.dev.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/src/addCollectionAdmin.test.ts b/tests/src/addCollectionAdmin.test.ts index 1fc77fa21f..a0d7dcc31e 100644 --- a/tests/src/addCollectionAdmin.test.ts +++ b/tests/src/addCollectionAdmin.test.ts @@ -37,7 +37,7 @@ describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () const {collectionId} = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); const collection = await helper.collection.getData(collectionId); - expect(collection?.normalizedOwner!).to.be.equal(alice.address); + expect(collection!.normalizedOwner!).to.be.equal(alice.address); await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address}); diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 2e098bb73b..6fab87f0c8 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -12,11 +12,11 @@ export class DevUniqueHelper extends UniqueHelper { /** * Arrange methods for tests */ - arrange: UniqueArrange; + arrange: ArrangeGroup; constructor(logger: { log: (msg: any, level: any) => void, level: any }) { super(logger); - this.arrange = new UniqueArrange(this); + this.arrange = new ArrangeGroup(this); } async connect(wsEndpoint: string, listeners?: any): Promise { @@ -55,7 +55,7 @@ export class DevUniqueHelper extends UniqueHelper { } } -class UniqueArrange { +class ArrangeGroup { helper: UniqueHelper; constructor(helper: UniqueHelper) { From 43593c00594ba6cb1fa8327a016de09ff2fbb707 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 23 Aug 2022 15:00:25 +0300 Subject: [PATCH 0502/1274] CI Step 2.1 --- .docker/docker-compose.tmp-node.j2 | 37 +++++ .github/workflows/nodes-only-update.yml | 204 ++++++++++++++++++++++++ 2 files changed, 241 insertions(+) create mode 100644 .docker/docker-compose.tmp-node.j2 create mode 100644 .github/workflows/nodes-only-update.yml diff --git a/.docker/docker-compose.tmp-node.j2 b/.docker/docker-compose.tmp-node.j2 new file mode 100644 index 0000000000..341da49d13 --- /dev/null +++ b/.docker/docker-compose.tmp-node.j2 @@ -0,0 +1,37 @@ +version: "3.5" + +services: + node-parachain: + build: + args: + - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" + - "BRANCH={{ BRANCH }}" + - "REPO_URL={{ REPO_URL }}" + - "FEATURE={{ FEATURE }}" + - "RUNTIME={{ RUNTIME }}" + - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" + - "MAINNET_TAG={{ MAINNET_TAG }}" + - "MAINNET_BRANCH={{ MAINNET_BRANCH }}" + context: ../ + dockerfile: .docker/Dockerfile-parachain-upgrade + command: export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start launch-config.json --test-upgrade-parachains -w -n + image: node-parachain + container_name: node-parachain + volumes: + - type: bind + source: ./launch-config-forkless-nodata.json + target: /polkadot-launch/launch-config.json + read_only: true + expose: + - 9944 + - 9933 + ports: + - 127.0.0.1:9944:9944 + - 127.0.0.1:9933:9933 + logging: + options: + max-size: "1m" + max-file: "3" diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml new file mode 100644 index 0000000000..c6d7acedda --- /dev/null +++ b/.github/workflows/nodes-only-update.yml @@ -0,0 +1,204 @@ +name: + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: + - master + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + - ready_for_review + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +#Define Workflow variables +env: + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + prepare-execution-marix: + + name: Prepare execution matrix + + runs-on: self-hosted-ci + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: fabiocaccamo/create-matrix-action@v2 + id: create_matrix + with: + matrix: | + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + # network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + # network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} + + + + forkless-update-nodata: + needs: prepare-execution-marix + # The type of runner that the job will run on + runs-on: [self-hosted-ci,large] + + + + timeout-minutes: 1380 + + name: ${{ matrix.network }} + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + + + steps: + - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-node.j2 + output_file: .docker/docker-compose.node.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }} + MAINNET_TAG=${{ matrix.mainnet_tag }} + MAINNET_BRANCH=${{ matrix.mainnet_branch }} + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + BRANCH=${{ github.head_ref }} + + - name: Show build configuration + run: cat .docker/docker-compose.node.${{ matrix.network }}.yml + + - name: Generate launch-config-forkless-nodata.json + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/forkless-config/launch-config-forkless-nodata.j2 + output_file: .docker/launch-config-forkless-nodata.json + variables: | + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + + - name: Show launch-config-forkless configuration + run: cat .docker/launch-config-forkless-nodata.json + + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 + + - name: Check if docker logs consist logs related to Runtime Upgrade testing. + if: success() + run: | + counter=160 + function check_container_status { + docker inspect -f {{.State.Running}} node-parachain + } + function do_docker_logs { + docker logs --details node-parachain 2>&1 + } + function is_started { + if [ "$(check_container_status)" == "true" ]; then + echo "Container: node-parachain RUNNING"; + echo "Check Docker logs" + DOCKER_LOGS=$(do_docker_logs) + if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then + echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" + return 0 + elif [[ ${DOCKER_LOGS} = *"🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"* ]];then + echo "🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧" + return 1 + else + echo "Message not found in logs output, repeating..." + return 1 + fi + else + echo "Container node-parachain not RUNNING" + echo "Halting all future checks" + exit 1 + fi + exit 0 + } + while ! is_started; do + echo "Waiting for special message in log files " + sleep 30s + counter=$(( $counter - 1 )) + echo "Counter: $counter" + if [ "$counter" -gt "0" ]; then + continue + else + break + fi + done + echo "Halting script" + exit 0 + shell: bash + + - name: Collect Docker Logs + if: success() || failure() + uses: jwalton/gh-docker-logs@v2.2.0 + with: + dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}' + images: 'node-parachain' + + - name: Show docker logs + if: success() || failure() + run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}/node-parachain.log' + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" down From dbcb7abfb453b90b42e67fc050cd757a970e109c Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 23 Aug 2022 15:10:28 +0300 Subject: [PATCH 0503/1274] fix: yaml structure of compose file --- .docker/docker-compose.tmp-node.j2 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.docker/docker-compose.tmp-node.j2 b/.docker/docker-compose.tmp-node.j2 index 341da49d13..1da487b0c8 100644 --- a/.docker/docker-compose.tmp-node.j2 +++ b/.docker/docker-compose.tmp-node.j2 @@ -14,10 +14,7 @@ services: - "MAINNET_BRANCH={{ MAINNET_BRANCH }}" context: ../ dockerfile: .docker/Dockerfile-parachain-upgrade - command: export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - yarn start launch-config.json --test-upgrade-parachains -w -n + command: export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && cd /polkadot-launch && yarn start launch-config.json --test-upgrade-parachains -w -n image: node-parachain container_name: node-parachain volumes: From ce442c5a4cf9286ec5041af91ac5f2326abbf89b Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 23 Aug 2022 12:11:07 +0000 Subject: [PATCH 0504/1274] test(helpers): add paraSiblingSovereignAccount --- tests/src/util/helpers.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index 91c41f7da6..62e48f0ec0 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -1096,6 +1096,16 @@ getFreeBalance(account: IKeyringPair): Promise { return balance; } +export async function paraSiblingSovereignAccount(paraid: number): Promise { + return usingApi(async api => { + const siblingPrefix = '0x7369626c'; + const encodedParaId = api.createType('u32', paraid).toHex(true).substring(2); + const suffix = '000000000000000000000000000000000000000000000000'; + + return siblingPrefix + encodedParaId + suffix; + }); +} + export async function transferBalanceTo(api: ApiPromise, source: IKeyringPair, target: string, amount = 1000n * UNIQUE) { const tx = api.tx.balances.transfer(target, amount); const events = await submitTransactionAsync(source, tx); From b8477b4d3aeb157e631ae3191ad0eb4dae936c60 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 23 Aug 2022 15:15:23 +0300 Subject: [PATCH 0505/1274] fix: reuse quarts-runtime for test --- .github/workflows/nodes-only-update.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index c6d7acedda..967b259fdc 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -52,8 +52,8 @@ jobs: id: create_matrix with: matrix: | - network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} - # network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + # network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} # network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} From 6dafe970d7650aa756b9582d8dabc86a9f391f7e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 23 Aug 2022 15:17:27 +0300 Subject: [PATCH 0506/1274] fix: yaml syntax --- .github/workflows/nodes-only-update.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index 967b259fdc..54c78f96ea 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -52,9 +52,9 @@ jobs: id: create_matrix with: matrix: | - # network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} - # network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} + network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} From e52bef420515e6210d1cfddc0b4ec39b48f547a5 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 23 Aug 2022 15:36:30 +0300 Subject: [PATCH 0507/1274] fix: replace dockerfile in compose configuration --- .docker/Dockerfile-parachain-node-only | 116 +++++++++++++++++++++++++ .docker/docker-compose.tmp-node.j2 | 3 +- 2 files changed, 117 insertions(+), 2 deletions(-) create mode 100644 .docker/Dockerfile-parachain-node-only diff --git a/.docker/Dockerfile-parachain-node-only b/.docker/Dockerfile-parachain-node-only new file mode 100644 index 0000000000..b4aa85aec5 --- /dev/null +++ b/.docker/Dockerfile-parachain-node-only @@ -0,0 +1,116 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ARG RUST_TOOLCHAIN= + +ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install $RUST_TOOLCHAIN && \ + rustup default $RUST_TOOLCHAIN && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD current version ====== +FROM rust-builder as builder-unique-current + +ARG PROFILE=release +ARG FEATURE= +ARG MAINNET_BRANCH= +ARG REPO_URL= + +WORKDIR /unique_parachain + +RUN git clone $REPO_URL -b $MAINNET_BRANCH . && \ + cargo build --features=$FEATURE --$PROFILE + +# ===== BUILD target version ====== +FROM rust-builder as builder-unique-target + +ARG PROFILE=release +ARG FEATURE= +ARG BRANCH= +ARG REPO_URL= + +COPY . /unique_parachain +WORKDIR /unique_parachain + +RUN cargo build --features=$FEATURE --$PROFILE + +# ===== BUILD POLKADOT ===== +FROM rust-builder as builder-polkadot + +ARG POLKADOT_BUILD_BRANCH= +ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH + +WORKDIR /unique_parachain + +RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ + cd polkadot && \ + cargo build --release + +# ===== BUILD CHAINQL ===== +FROM rust-builder as builder-chainql + +RUN mkdir chainql +WORKDIR /chainql + +RUN git clone -b v0.1.0 --depth 1 https://github.com/CertainLach/chainql.git . && \ + cargo build --release + +# ===== RUN ====== + +FROM ubuntu:20.04 + +ARG RUNTIME= +ENV RUNTIME $RUNTIME + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch.git -b feature/parachain-forking + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn install + +RUN echo "$RUNTIME" + +COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ +COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm + +COPY --from=builder-chainql /chainql/target/release/chainql /chainql/target/release/ + +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm + +ARG REPLICA_FROM= +ENV REPLICA_FROM=$REPLICA_FROM +CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" REPLICA_FROM && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start launch-config.json --test-upgrade-parachains -w -n diff --git a/.docker/docker-compose.tmp-node.j2 b/.docker/docker-compose.tmp-node.j2 index 1da487b0c8..9fa8b80ff8 100644 --- a/.docker/docker-compose.tmp-node.j2 +++ b/.docker/docker-compose.tmp-node.j2 @@ -13,8 +13,7 @@ services: - "MAINNET_TAG={{ MAINNET_TAG }}" - "MAINNET_BRANCH={{ MAINNET_BRANCH }}" context: ../ - dockerfile: .docker/Dockerfile-parachain-upgrade - command: export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && cd /polkadot-launch && yarn start launch-config.json --test-upgrade-parachains -w -n + dockerfile: .docker/Dockerfile-parachain-node-only image: node-parachain container_name: node-parachain volumes: From 70d58144dbd37dc75554feddcbafdb0599fbae0e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 23 Aug 2022 17:19:37 +0300 Subject: [PATCH 0508/1274] tests: check if docker exec sends SIGUSR1 to polkadot-launch correct --- .github/workflows/nodes-only-update.yml | 78 ++++++++++++++++++++----- 1 file changed, 62 insertions(+), 16 deletions(-) diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index 54c78f96ea..fa3212a895 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -137,11 +137,48 @@ jobs: - name: Show launch-config-forkless configuration run: cat .docker/launch-config-forkless-nodata.json + - uses: actions/setup-node@v3 + with: + node-version: 16 - name: Build the stack run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 - - name: Check if docker logs consist logs related to Runtime Upgrade testing. + + - name: Temp Wait. Will be remove after send SIGUSER to polkadot-launch + run: sleep 600s + +# - name: Run tests before Node Parachain upgrade +# run: | +# cd tests +# yarn install +# yarn add mochawesome +# echo "Ready to start tests" +# node scripts/readyness.js +# NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} +# env: +# RPC_URL: http://127.0.0.1:9933/ +# +# - name: Test Report Before Node upgrade +# uses: phoenix-actions/test-reporting@v8 +# id: test-report-before +# if: success() || failure() # run this step even if previous step failed +# with: +# name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created +# path: tests/mochawesome-report/test-*.json # Path to test results +# reporter: mochawesome-json +# fail-on-error: 'false' + + - name: Send SIGUSR1 to polkadotlaunch process + if: success() + run: | + #Get PID of polkadot-launch + PID=$(docker exec -it node-parachain pidof 'polkadot-launch') + #Send SIGUSR1 signal to $PID + docker exec -it node-parachain kill -SIGUSR1 $(PID) + + # 🌗 All parachain collators restarted with the new binaries. + - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade. if: success() run: | counter=160 @@ -156,22 +193,20 @@ jobs: echo "Container: node-parachain RUNNING"; echo "Check Docker logs" DOCKER_LOGS=$(do_docker_logs) - if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then - echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸" + if [[ ${DOCKER_LOGS} = *"🌗 All parachain collators restarted with the new binaries."* ]];then + echo "🌗 All parachain collators restarted with the new binaries." return 0 - elif [[ ${DOCKER_LOGS} = *"🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"* ]];then - echo "🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧" - return 1 else echo "Message not found in logs output, repeating..." return 1 fi else - echo "Container node-parachain not RUNNING" + echo "Container node-parachain NOT RUNNING" echo "Halting all future checks" exit 1 fi - exit 0 + echo "something goes wrong" + exit 1 } while ! is_started; do echo "Waiting for special message in log files " @@ -188,16 +223,27 @@ jobs: exit 0 shell: bash - - name: Collect Docker Logs - if: success() || failure() - uses: jwalton/gh-docker-logs@v2.2.0 + - name: Run tests after Node Parachain upgrade + run: | + cd tests + yarn install + yarn add mochawesome + echo "Ready to start tests" + node scripts/readyness.js + NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Test Report After Node upgrade + uses: phoenix-actions/test-reporting@v8 + id: test-report-after + if: success() || failure() # run this step even if previous step failed with: - dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}' - images: 'node-parachain' + name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created + path: tests/mochawesome-report/test-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' - - name: Show docker logs - if: success() || failure() - run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}/node-parachain.log' - name: Stop running containers if: always() # run this step always From 0b95edb08466edfec93a13976c9db9bf2be1a9da Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Tue, 23 Aug 2022 21:34:33 +0700 Subject: [PATCH 0509/1274] Buildable Opal, Quartz and Unique runtimes. --- runtime/common/construct_runtime/mod.rs | 1 + runtime/quartz/src/xcm_config.rs | 189 +++++++++++++++++++- runtime/unique/src/lib.rs | 2 + runtime/unique/src/xcm_config.rs | 226 ++++++++++++++++++++++++ 4 files changed, 416 insertions(+), 2 deletions(-) diff --git a/runtime/common/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs index 8176b516f7..264159a8e1 100644 --- a/runtime/common/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -42,6 +42,7 @@ macro_rules! construct_runtime { Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 34, Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event} = 35, Vesting: orml_vesting::{Pallet, Storage, Call, Event, Config} = 37, + #[runtimes(opal)] XTokens: orml_xtokens = 38, Tokens: orml_tokens = 39, // Vesting: pallet_vesting::{Pallet, Call, Config, Storage, Event} = 37, diff --git a/runtime/quartz/src/xcm_config.rs b/runtime/quartz/src/xcm_config.rs index 9125e53869..791390da34 100644 --- a/runtime/quartz/src/xcm_config.rs +++ b/runtime/quartz/src/xcm_config.rs @@ -32,6 +32,7 @@ use xcm::{ v1::{BodyId, Junction::*, Junctions::*, MultiLocation, NetworkId}, }; use xcm_builder::{ + AllowKnownQueryResponses, AllowSubscriptionsFrom, AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter, LocationInverter, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, @@ -47,7 +48,10 @@ use up_common::{ constants::{MAXIMUM_BLOCK_WEIGHT, UNIQUE}, types::{AccountId, Balance}, }; - +use pallet_foreing_assets::{ + AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, + UsingAnyCurrencyComponents, TryAsForeing, ForeignAssetId, +}; use crate::{ Balances, Call, DmpQueue, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, XcmpQueue, @@ -56,6 +60,7 @@ use crate::runtime_common::config::substrate::{TreasuryModuleId, MaxLocks, MaxRe use crate::runtime_common::config::pallets::TreasuryAccountId; use crate::runtime_common::config::xcm::*; use crate::*; +use xcm::opaque::latest::prelude::{ DepositReserveAsset, DepositAsset, TransferAsset, TransferReserveAsset }; // Signed version of balance pub type Amount = i128; @@ -94,6 +99,55 @@ impl ShouldExecute for DenyThenTry } } +pub fn get_allowed_locations() -> Vec { + vec![ + // Self location + MultiLocation { parents: 0, interior: Here }, + // Parent location + MultiLocation { parents: 1, interior: Here }, + // Karura/Acala location + MultiLocation { parents: 1, interior: X1(Parachain(2000)) }, + // Moonriver location + MultiLocation { parents: 1, interior: X1(Parachain(2023)) }, + // Self parachain address + MultiLocation { parents: 1, interior: X1(Parachain(ParachainInfo::get().into())) }, + ] +} + +// Allow xcm exchange only with locations in list +pub struct DenyExchangeWithUnknownLocation; +impl ShouldExecute for DenyExchangeWithUnknownLocation { + fn should_execute( + origin: &MultiLocation, + message: &mut Xcm, + _max_weight: Weight, + _weight_credit: &mut Weight, + ) -> Result<(), ()> { + + // Check if deposit or transfer belongs to allowed parachains + let mut allowed = get_allowed_locations().contains(origin); + + message.0.iter().for_each(|inst| { + match inst { + DepositReserveAsset { dest: dst, .. } => { allowed |= get_allowed_locations().contains(dst); } + TransferReserveAsset { dest: dst, .. } => { allowed |= get_allowed_locations().contains(dst); } + _ => {} + } + }); + + if allowed { + return Ok(()); + } + + log::warn!( + target: "xcm::barrier", + "Unexpected deposit or transfer location" + ); + // Deny + Err(()) + } +} + pub type Barrier = DenyThenTry< DenyExchangeWithUnknownLocation, ( @@ -106,4 +160,135 @@ pub type Barrier = DenyThenTry< // Subscriptions for version tracking are OK. AllowSubscriptionsFrom, ), ->; \ No newline at end of file +>; + +impl orml_tokens::Config for Runtime { + type Event = Event; + type Balance = Balance; + type Amount = Amount; + type CurrencyId = CurrencyId; + type WeightInfo = (); + type ExistentialDeposits = ExistentialDeposits; + type OnDust = orml_tokens::TransferDust; + type MaxLocks = MaxLocks; + type MaxReserves = MaxReserves; + // TODO: Add all module accounts + type DustRemovalWhitelist = DustRemovalWhitelist; + /// The id type for named reserves. + type ReserveIdentifier = (); + type OnNewTokenAccount = (); + type OnKilledTokenAccount = (); +} + +/* +impl orml_xtokens::Config for Runtime { + type Event = Event; + type Balance = Balance; + type CurrencyId = AssetIds; + type CurrencyIdConvert = CurrencyIdConvert; + type AccountIdToMultiLocation = AccountIdToMultiLocation; + type SelfLocation = SelfLocation; + type XcmExecutor = XcmExecutor>; + type Weigher = FixedWeightBounds; + type BaseXcmWeight = BaseXcmWeight; + type LocationInverter = LocationInverter; + type MaxAssetsForTransfer = MaxAssetsForTransfer; + type MinXcmFee = ParachainMinFee; + type MultiLocationsFilter = Everything; + type ReserveProvider = AbsoluteReserveProvider; +} + */ + +parameter_type_with_key! { + pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { + match currency_id { + CurrencyId::NativeAssetId(symbol) => match symbol { + NativeCurrency::Here => 0, + NativeCurrency::Parent=> 0, + }, + _ => 100_000 + } + }; +} + +pub struct DustRemovalWhitelist; +impl Contains for DustRemovalWhitelist { + fn contains(a: &AccountId) -> bool { + get_all_module_accounts().contains(a) + } +} + +/* +pub struct CurrencyIdConvert; +impl Convert> for CurrencyIdConvert { + fn convert(id: AssetIds) -> Option { + match id { + AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new( + 1, + X1(Parachain(ParachainInfo::get().into())), + )), + AssetIds::NativeAssetId(NativeCurrency::Parent) => Some(MultiLocation::parent()), + AssetIds::ForeignAssetId(foreign_asset_id) => { + XcmForeignAssetIdMapping::::get_multi_location(foreign_asset_id) + } + } + } +} +impl Convert> for CurrencyIdConvert { + fn convert(location: MultiLocation) -> Option { + if location == MultiLocation::here() + || location == MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))) + { + return Some(AssetIds::NativeAssetId(NativeCurrency::Here)); + } + + if location == MultiLocation::parent() { + return Some(AssetIds::NativeAssetId(NativeCurrency::Parent)); + } + + if let Some(currency_id) = + XcmForeignAssetIdMapping::::get_currency_id(location.clone()) + { + return Some(currency_id); + } + + None + } +} + + */ + + +parameter_types! { + pub const BaseXcmWeight: Weight = 100_000_000; // TODO: recheck this + pub const MaxAssetsForTransfer: usize = 2; +} + +parameter_types! { + pub const RelayLocation: MultiLocation = MultiLocation::parent(); + pub const RelayNetwork: NetworkId = NetworkId::Polkadot; + pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); + pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); +} + +parameter_type_with_key! { + pub ParachainMinFee: |_location: MultiLocation| -> Option { + Some(100_000_000) + }; +} + +pub fn get_all_module_accounts() -> Vec { + vec![TreasuryModuleId::get().into_account_truncating()] +} + +pub struct AccountIdToMultiLocation; +impl Convert for AccountIdToMultiLocation { + fn convert(account: AccountId) -> MultiLocation { + X1(AccountId32 { + network: NetworkId::Any, + id: account.into(), + }) + .into() + } +} diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index eca71fc905..5ed7157523 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -35,6 +35,8 @@ use up_common::types::*; #[path = "../../common/mod.rs"] mod runtime_common; +pub mod xcm_config; + pub use runtime_common::*; pub const RUNTIME_NAME: &str = "unique"; diff --git a/runtime/unique/src/xcm_config.rs b/runtime/unique/src/xcm_config.rs index e69de29bb2..ea87b5ca43 100644 --- a/runtime/unique/src/xcm_config.rs +++ b/runtime/unique/src/xcm_config.rs @@ -0,0 +1,226 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use cumulus_pallet_xcm; +use frame_support::{ + {match_types, parameter_types, weights::Weight}, + pallet_prelude::Get, + traits::{Contains, Everything, fungibles}, +}; +use frame_system::EnsureRoot; +use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; +use pallet_xcm::XcmPassthrough; +use polkadot_parachain::primitives::Sibling; +use sp_runtime::traits::{AccountIdConversion, CheckedConversion, Convert, Zero}; +use sp_std::{borrow::Borrow, marker::PhantomData, vec, vec::Vec}; +use xcm::{ + latest::{MultiAsset, Xcm}, + prelude::{Concrete, Fungible as XcmFungible}, + v1::{BodyId, Junction::*, Junctions::*, MultiLocation, NetworkId}, +}; +use xcm_builder::{ + AllowKnownQueryResponses, AllowSubscriptionsFrom, + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, + EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter, LocationInverter, ParentAsSuperuser, + ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + ConvertedConcreteAssetId, +}; +use xcm_executor::{ + {Config, XcmExecutor}, + traits::{Convert as ConvertXcm, FilterAssetLocation, JustTry, MatchesFungible, ShouldExecute}, +}; + +use up_common::{ + constants::{MAXIMUM_BLOCK_WEIGHT, UNIQUE}, + types::{AccountId, Balance}, +}; +use pallet_foreing_assets::{ + AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, + UsingAnyCurrencyComponents, TryAsForeing, ForeignAssetId, +}; +use crate::{ + Balances, Call, DmpQueue, Event, Origin, ParachainInfo, + ParachainSystem, PolkadotXcm, Runtime, XcmpQueue, +}; +use crate::runtime_common::config::substrate::{TreasuryModuleId, MaxLocks, MaxReserves}; +use crate::runtime_common::config::pallets::TreasuryAccountId; +use crate::runtime_common::config::xcm::*; +use crate::*; +use xcm::opaque::latest::prelude::{ DepositReserveAsset, DepositAsset, TransferAsset, TransferReserveAsset }; + +// Signed version of balance +pub type Amount = i128; + + +pub type Barrier = DenyThenTry< + DenyExchangeWithUnknownLocation, + ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + // Parent and its exec plurality get free execution + AllowUnpaidExecutionFrom, + // Expected responses are OK. + AllowKnownQueryResponses, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), +>; + +pub fn get_allowed_locations() -> Vec { + vec![ + // Self location + MultiLocation { parents: 0, interior: Here }, + // Parent location + MultiLocation { parents: 1, interior: Here }, + // Karura/Acala location + MultiLocation { parents: 1, interior: X1(Parachain(2000)) }, + // Self parachain address + MultiLocation { parents: 1, interior: X1(Parachain(ParachainInfo::get().into())) }, + ] +} + +pub struct DenyThenTry(PhantomData, PhantomData) + where + Deny: ShouldExecute, + Allow: ShouldExecute; + +impl ShouldExecute for DenyThenTry + where + Deny: ShouldExecute, + Allow: ShouldExecute, +{ + fn should_execute( + origin: &MultiLocation, + message: &mut Xcm, + max_weight: Weight, + weight_credit: &mut Weight, + ) -> Result<(), ()> { + Deny::should_execute(origin, message, max_weight, weight_credit)?; + Allow::should_execute(origin, message, max_weight, weight_credit) + } +} + +// Allow xcm exchange only with locations in list +pub struct DenyExchangeWithUnknownLocation; +impl ShouldExecute for DenyExchangeWithUnknownLocation { + fn should_execute( + origin: &MultiLocation, + message: &mut Xcm, + _max_weight: Weight, + _weight_credit: &mut Weight, + ) -> Result<(), ()> { + + // Check if deposit or transfer belongs to allowed parachains + let mut allowed = get_allowed_locations().contains(origin); + + message.0.iter().for_each(|inst| { + match inst { + DepositReserveAsset { dest: dst, .. } => { allowed |= get_allowed_locations().contains(dst); } + TransferReserveAsset { dest: dst, .. } => { allowed |= get_allowed_locations().contains(dst); } + _ => {} + } + }); + + if allowed { + return Ok(()); + } + + log::warn!( + target: "xcm::barrier", + "Unexpected deposit or transfer location" + ); + // Deny + Err(()) + } +} + + +match_types! { + pub type ParentOrParentsExecutivePlurality: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } + }; + pub type ParentOrSiblings: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(_) } + }; +} + +pub fn get_all_module_accounts() -> Vec { + vec![TreasuryModuleId::get().into_account_truncating()] +} + +pub struct DustRemovalWhitelist; +impl Contains for DustRemovalWhitelist { + fn contains(a: &AccountId) -> bool { + get_all_module_accounts().contains(a) + } +} + +parameter_type_with_key! { + pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { + match currency_id { + CurrencyId::NativeAssetId(symbol) => match symbol { + NativeCurrency::Here => 0, + NativeCurrency::Parent=> 0, + }, + _ => 100_000 + } + }; +} + +impl orml_tokens::Config for Runtime { + type Event = Event; + type Balance = Balance; + type Amount = Amount; + type CurrencyId = CurrencyId; + type WeightInfo = (); + type ExistentialDeposits = ExistentialDeposits; + type OnDust = orml_tokens::TransferDust; + type MaxLocks = MaxLocks; + type MaxReserves = MaxReserves; + // TODO: Add all module accounts + type DustRemovalWhitelist = DustRemovalWhitelist; + /// The id type for named reserves. + type ReserveIdentifier = (); + type OnNewTokenAccount = (); + type OnKilledTokenAccount = (); +} + + +parameter_types! { + pub const BaseXcmWeight: Weight = 100_000_000; // TODO: recheck this + pub const MaxAssetsForTransfer: usize = 2; +} + +parameter_type_with_key! { + pub ParachainMinFee: |_location: MultiLocation| -> Option { + Some(100_000_000) + }; +} + + +pub struct AccountIdToMultiLocation; +impl Convert for AccountIdToMultiLocation { + fn convert(account: AccountId) -> MultiLocation { + X1(AccountId32 { + network: NetworkId::Any, + id: account.into(), + }) + .into() + } +} \ No newline at end of file From e99a7d7d088d499b9476c79abcc178e37f45f175 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 23 Aug 2022 17:44:06 +0300 Subject: [PATCH 0510/1274] debug: send SIGUSR1 to docker process --- .github/workflows/nodes-only-update.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index fa3212a895..0d39815555 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -146,7 +146,7 @@ jobs: - name: Temp Wait. Will be remove after send SIGUSER to polkadot-launch - run: sleep 600s + run: sleep 30s # - name: Run tests before Node Parachain upgrade # run: | @@ -173,9 +173,10 @@ jobs: if: success() run: | #Get PID of polkadot-launch - PID=$(docker exec -it node-parachain pidof 'polkadot-launch') + PID=$(docker exec node-parachain pidof 'polkadot-launch') + echo $PID #Send SIGUSR1 signal to $PID - docker exec -it node-parachain kill -SIGUSR1 $(PID) + docker exec node-parachain kill -SIGUSR1 $PID # 🌗 All parachain collators restarted with the new binaries. - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade. From cd63f09a6eb67051fc382bbb448838381936acc1 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 23 Aug 2022 17:59:08 +0300 Subject: [PATCH 0511/1274] test pattern change --- .github/workflows/nodes-only-update.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index 0d39815555..b7d3f0a34a 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -1,4 +1,4 @@ -name: +name: nodes-only update # Controls when the action will run. on: @@ -194,7 +194,7 @@ jobs: echo "Container: node-parachain RUNNING"; echo "Check Docker logs" DOCKER_LOGS=$(do_docker_logs) - if [[ ${DOCKER_LOGS} = *"🌗 All parachain collators restarted with the new binaries."* ]];then + if [[ ${DOCKER_LOGS} = *"All parachain collators restarted with the new binaries."* ]];then echo "🌗 All parachain collators restarted with the new binaries." return 0 else From 3887d6d2abc5fbcadbfb1c6cd67d0e04192d5004 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 23 Aug 2022 18:22:44 +0300 Subject: [PATCH 0512/1274] tests: add before upgrade tests and after upgrade tests --- .github/workflows/build-test-master.yml | 127 ------------------------ .github/workflows/nodes-only-update.yml | 92 ++++++++++++----- 2 files changed, 67 insertions(+), 152 deletions(-) delete mode 100644 .github/workflows/build-test-master.yml diff --git a/.github/workflows/build-test-master.yml b/.github/workflows/build-test-master.yml deleted file mode 100644 index ac87d6f688..0000000000 --- a/.github/workflows/build-test-master.yml +++ /dev/null @@ -1,127 +0,0 @@ -name: yarn test para - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -#Define Workflow variables -env: - REPO_URL: ${{ github.server_url }}/${{ github.repository }} - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - master-build-and-test: - # The type of runner that the job will run on - runs-on: [self-hosted-ci,large] - timeout-minutes: 1380 - - name: ${{ matrix.network }} - - continue-on-error: true #Do not stop testing of matrix runs failed. - - strategy: - matrix: - include: - - network: "opal" - features: "opal-runtime" - - network: "quartz" - features: "quartz-runtime" - - network: "unique" - features: "unique-runtime" - - steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Generate ENV related extend file for docker-compose - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/docker-compose.tmp-master.j2 - output_file: .docker/docker-compose.${{ matrix.network }}.yml - variables: | - REPO_URL=${{ github.server_url }}/${{ github.repository }}.git - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} - FEATURE=${{ matrix.features }} - BRANCH=${{ github.head_ref }} - - - name: Show build configuration - run: cat .docker/docker-compose.${{ matrix.network }}.yml - - - name: Build the stack - run: docker-compose -f ".docker/docker-compose-master.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build - - - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Run tests - run: | - cd tests - yarn install - yarn add mochawesome - echo "Ready to start tests" - node scripts/readyness.js - NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} - env: - RPC_URL: http://127.0.0.1:9933/ - - - name: Test Report - uses: phoenix-actions/test-reporting@v8 - id: test-report - if: success() || failure() # run this step even if previous step failed - with: - name: Tests ${{ matrix.network }} # Name of the check run which will be created - path: tests/mochawesome-report/test-*.json # Path to test results - reporter: mochawesome-json - fail-on-error: 'false' - - - name: Read output variables - run: | - echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}" - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-master.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index b7d3f0a34a..2165536d20 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -144,39 +144,81 @@ jobs: - name: Build the stack run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 + # 🚀 POLKADOT LAUNCH COMPLETE 🚀 + - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade. + if: success() + run: | + counter=160 + function check_container_status { + docker inspect -f {{.State.Running}} node-parachain + } + function do_docker_logs { + docker logs --details node-parachain 2>&1 + } + function is_started { + if [ "$(check_container_status)" == "true" ]; then + echo "Container: node-parachain RUNNING"; + echo "Check Docker logs" + DOCKER_LOGS=$(do_docker_logs) + if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then + echo "🚀 POLKADOT LAUNCH COMPLETE 🚀" + return 0 + else + echo "Message not found in logs output, repeating..." + return 1 + fi + else + echo "Container node-parachain NOT RUNNING" + echo "Halting all future checks" + exit 1 + fi + echo "something goes wrong" + exit 1 + } + while ! is_started; do + echo "Waiting for special message in log files " + sleep 30s + counter=$(( $counter - 1 )) + echo "Counter: $counter" + if [ "$counter" -gt "0" ]; then + continue + else + break + fi + done + echo "Halting script" + exit 0 + shell: bash - - name: Temp Wait. Will be remove after send SIGUSER to polkadot-launch - run: sleep 30s - -# - name: Run tests before Node Parachain upgrade -# run: | -# cd tests -# yarn install -# yarn add mochawesome -# echo "Ready to start tests" -# node scripts/readyness.js -# NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} -# env: -# RPC_URL: http://127.0.0.1:9933/ -# -# - name: Test Report Before Node upgrade -# uses: phoenix-actions/test-reporting@v8 -# id: test-report-before -# if: success() || failure() # run this step even if previous step failed -# with: -# name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created -# path: tests/mochawesome-report/test-*.json # Path to test results -# reporter: mochawesome-json -# fail-on-error: 'false' + - name: Run tests before Node Parachain upgrade + run: | + cd tests + yarn install + yarn add mochawesome + echo "Ready to start tests" + node scripts/readyness.js + NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Test Report Before Node upgrade + uses: phoenix-actions/test-reporting@v8 + id: test-report-before + if: success() || failure() # run this step even if previous step failed + with: + name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created + path: tests/mochawesome-report/test-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' - name: Send SIGUSR1 to polkadotlaunch process if: success() run: | #Get PID of polkadot-launch PID=$(docker exec node-parachain pidof 'polkadot-launch') - echo $PID + echo "Polkadot-launch PID: $PID" #Send SIGUSR1 signal to $PID - docker exec node-parachain kill -SIGUSR1 $PID + docker exec node-parachain kill -SIGUSR1 ${PID} # 🌗 All parachain collators restarted with the new binaries. - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade. From 112c7ddd2d0abcd8417868dae1e7e71195763512 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 23 Aug 2022 12:03:57 +0000 Subject: [PATCH 0513/1274] chore: return separate setOwner and isOwnerOrAdmin methods --- pallets/common/src/erc.rs | 2 - pallets/fungible/src/stubs/UniqueFungible.raw | Bin 2853 -> 2853 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 202 ++-- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4272 -> 4272 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 962 ++++++++--------- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4299 -> 4299 bytes .../refungible/src/stubs/UniqueRefungible.sol | 974 +++++++++--------- tests/src/eth/api/UniqueFungible.sol | 96 +- tests/src/eth/api/UniqueNFT.sol | 374 +++---- tests/src/eth/api/UniqueRefungible.sol | 374 +++---- tests/src/eth/collectionAdmin.test.ts | 13 +- tests/src/eth/fungibleAbi.json | 8 +- tests/src/eth/nonFungibleAbi.json | 8 +- tests/src/eth/reFungibleAbi.json | 8 +- 14 files changed, 1510 insertions(+), 1511 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 48af4fbf81..a42f7fea9e 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -421,7 +421,6 @@ where /// /// @param user account to verify /// @return "true" if account is the owner or admin - #[solidity(rename_selector = "isOwnerOrAdmin")] fn is_owner_or_admin_substrate(&self, user: uint256) -> Result { let user = convert_substrate_address_to_cross_account_id::(user); Ok(self.is_owner_or_admin(&user)) @@ -454,7 +453,6 @@ where /// /// @dev Owner can be changed only by current owner /// @param newOwner new owner substrate account - #[solidity(rename_selector = "setOwner")] fn set_owner_substrate(&mut self, caller: caller, new_owner: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); let new_owner = convert_substrate_address_to_cross_account_id::(new_owner); diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index 73a7aedd7404fe8eda18ba2b127563d02f952644..a4ac087109e18fff3aba98a5ef348ed976957fb8 100644 GIT binary patch delta 230 zcmZ1~wp47xK}P;83&-1niHuU=4aqYEHyodQfzfZWCX;-9L-Hme;eL@srZeFQ3=Myy z8#1Khjau1&@!=&h)z|inFx*@s2 z(bG>bk>Mp!A&3c-KLcd89+f%`WM%=GT{-{KMG~16fXqoxl8%E#p?X1<0Hs(a&tnqj zYDliGeSHqd6`H(-$%`e+!twTICgy33lb5j=F|ieGKEuMnrf~Pk)bjfRW>0U+G_6;B cP-WWe{X(BNAS>a`<;ydKf_#ol{=#Jl0Nja7Q2+n{ diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index e09e26d860..5de80ec40f 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -31,7 +31,103 @@ contract ERC20Events { ); } -// Selector: 2f4a7085 +// Selector: 79cc6790 +contract ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) public returns (bool) { + require(false, stub_error); + from; + amount; + dummy = 0; + return false; + } +} + +// Selector: 942e8b22 +contract ERC20 is Dummy, ERC165, ERC20Events { + // Selector: name() 06fdde03 + function name() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: symbol() 95d89b41 + function symbol() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: decimals() 313ce567 + function decimals() public view returns (uint8) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) public view returns (uint256) { + require(false, stub_error); + owner; + dummy; + return 0; + } + + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 amount) public returns (bool) { + require(false, stub_error); + to; + amount; + dummy = 0; + return false; + } + + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 amount + ) public returns (bool) { + require(false, stub_error); + from; + to; + amount; + dummy = 0; + return false; + } + + // Selector: approve(address,uint256) 095ea7b3 + function approve(address spender, uint256 amount) public returns (bool) { + require(false, stub_error); + spender; + amount; + dummy = 0; + return false; + } + + // Selector: allowance(address,address) dd62ed3e + function allowance(address owner, address spender) + public + view + returns (uint256) + { + require(false, stub_error); + owner; + spender; + dummy; + return 0; + } +} + +// Selector: ffe4da23 contract Collection is Dummy, ERC165 { // Set collection property. // @@ -275,8 +371,8 @@ contract Collection is Dummy, ERC165 { // @param user account to verify // @return "true" if account is the owner or admin // - // Selector: isOwnerOrAdmin(uint256) 8a6cfe67 - function isOwnerOrAdmin(uint256 user) public view returns (bool) { + // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00 + function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) { require(false, stub_error); user; dummy; @@ -311,110 +407,14 @@ contract Collection is Dummy, ERC165 { // @dev Owner can be changed only by current owner // @param newOwner new owner substrate account // - // Selector: setOwner(uint256) 8041494e - function setOwner(uint256 newOwner) public { + // Selector: setOwnerSubstrate(uint256) b212138f + function setOwnerSubstrate(uint256 newOwner) public { require(false, stub_error); newOwner; dummy = 0; } } -// Selector: 79cc6790 -contract ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) public returns (bool) { - require(false, stub_error); - from; - amount; - dummy = 0; - return false; - } -} - -// Selector: 942e8b22 -contract ERC20 is Dummy, ERC165, ERC20Events { - // Selector: name() 06fdde03 - function name() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: symbol() 95d89b41 - function symbol() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: decimals() 313ce567 - function decimals() public view returns (uint8) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) public view returns (uint256) { - require(false, stub_error); - owner; - dummy; - return 0; - } - - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 amount) public returns (bool) { - require(false, stub_error); - to; - amount; - dummy = 0; - return false; - } - - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 amount - ) public returns (bool) { - require(false, stub_error); - from; - to; - amount; - dummy = 0; - return false; - } - - // Selector: approve(address,uint256) 095ea7b3 - function approve(address spender, uint256 amount) public returns (bool) { - require(false, stub_error); - spender; - amount; - dummy = 0; - return false; - } - - // Selector: allowance(address,address) dd62ed3e - function allowance(address owner, address spender) - public - view - returns (uint256) - { - require(false, stub_error); - owner; - spender; - dummy; - return 0; - } -} - contract UniqueFungible is Dummy, ERC165, diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 3a1377d5c43e74e84da5b3cf8af9cd7ba255d031..76148569b0332221fd3a0fa403b4f46a8c541929 100644 GIT binary patch delta 295 zcmdm>xIuBl2S%1nLc;x%zc4y;fEXf)Ebf!-ndCTT2yQqon8ZcAi&zxgLy8mEGBN=4P_Wyk&&Y+UgE9@B%2sb`KK=znnZi{ieTTBoTFrzh77 G7yxIuBl2S%2ataElx{=(?Y0b+2^~P*R!9<38;SI?kCQ!U?aw?P3 zcrAjNkY=EjB1DR#Y4thW)wHzaQo67HY;h0&P<#1KhjNt$fWB*!t+x_*~nBE!AO z1x!ly4auv^ejO7@WL_7Zz|inFx*-{)AIN_M)IascY)2q-CXhKpa05`3RTieINaL_N z(3V1=ROOlU2|%VdlnK;u1<0(feSHq7fgi}MP1&;rDB28UwjPx_4K^HVnHq1x<#V)0x$nx$+X3 zGtClM64|#*?qpM9V&$5=mQ8i?12z=_RxXHmSac%u!bDcC%_8h+oC^C7ukH}}yKaZl g{R>Wq)z2D4Px45K%MIbHdQ^U^^26P{$+H9u0Ub1cLI3~& delta 320 zcmX@Dcv^A8Q%3%-oPX(piHt1a4auv^ejS_qh0&P<#1KhjUN_mENlti%;D+OZi46CE z3P4PeL{{0!sZ2`s2@DN?qZ^Vz`hjBnKucB9bvc{y(79WEo~o zu7>2wGwBn6B3CA>Fl$O>SvcMX>bwM$E?CfH2xLA0GK(}0t8Y$cR%4z#n@x_1<;slaCPECE9Rl2(1) diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index 9a77fdeda5..e0ac243257 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -51,746 +51,746 @@ contract ERC721MintableEvents { event MintingFinished(); } -// Selector: 2f4a7085 -contract Collection is Dummy, ERC165 { - // Set collection property. +// Selector: 41369377 +contract TokenProperties is Dummy, ERC165 { + // @notice Set permissions for token property. + // @dev Throws error if `msg.sender` is not admin or owner of the collection. + // @param key Property key. + // @param is_mutable Permission to mutate property. + // @param collection_admin Permission to mutate property by collection admin if property is mutable. + // @param token_owner Permission to mutate property by token owner if property is mutable. // + // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa + function setTokenPropertyPermission( + string memory key, + bool isMutable, + bool collectionAdmin, + bool tokenOwner + ) public { + require(false, stub_error); + key; + isMutable; + collectionAdmin; + tokenOwner; + dummy = 0; + } + + // @notice Set token property value. + // @dev Throws error if `msg.sender` has no permission to edit the property. + // @param tokenId ID of the token. // @param key Property key. - // @param value Propery value. + // @param value Property value. // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - public - { + // Selector: setProperty(uint256,string,bytes) 1752d67b + function setProperty( + uint256 tokenId, + string memory key, + bytes memory value + ) public { require(false, stub_error); + tokenId; key; value; dummy = 0; } - // Delete collection property. - // + // @notice Delete token property value. + // @dev Throws error if `msg.sender` has no permission to edit the property. + // @param tokenId ID of the token. // @param key Property key. // - // Selector: deleteCollectionProperty(string) 7b7debce - function deleteCollectionProperty(string memory key) public { + // Selector: deleteProperty(uint256,string) 066111d1 + function deleteProperty(uint256 tokenId, string memory key) public { require(false, stub_error); + tokenId; key; dummy = 0; } - // Get collection property. - // - // @dev Throws error if key not found. - // + // @notice Get token property value. + // @dev Throws error if key not found + // @param tokenId ID of the token. // @param key Property key. - // @return bytes The property corresponding to the key. + // @return Property value bytes // - // Selector: collectionProperty(string) cf24fd6d - function collectionProperty(string memory key) + // Selector: property(uint256,string) 7228c327 + function property(uint256 tokenId, string memory key) public view returns (bytes memory) { require(false, stub_error); + tokenId; key; dummy; return hex""; } +} - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. +// Selector: 42966c68 +contract ERC721Burnable is Dummy, ERC165 { + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current RFT owner, or an authorized + // operator of the current owner. + // @param tokenId The RFT to approve // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) public { + // Selector: burn(uint256) 42966c68 + function burn(uint256 tokenId) public { require(false, stub_error); - sponsor; + tokenId; dummy = 0; } +} - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. +// Selector: 58800161 +contract ERC721 is Dummy, ERC165, ERC721Events { + // @notice Count all RFTs assigned to an owner + // @dev RFTs assigned to the zero address are considered invalid, and this + // function throws for queries about the zero address. + // @param owner An address for whom to query the balance + // @return The number of RFTs owned by `owner`, possibly zero // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() public { + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) public view returns (uint256) { require(false, stub_error); - dummy = 0; + owner; + dummy; + return 0; } - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. + // @notice Find the owner of an RFT + // @dev RFTs assigned to zero address are considered invalid, and queries + // about them do throw. + // Returns special 0xffffffffffffffffffffffffffffffffffffffff address for + // the tokens that are partially owned. + // @param tokenId The identifier for an RFT + // @return The address of the owner of the RFT // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) public { + // Selector: ownerOf(uint256) 6352211e + function ownerOf(uint256 tokenId) public view returns (address) { require(false, stub_error); - limit; - value; - dummy = 0; + tokenId; + dummy; + return 0x0000000000000000000000000000000000000000; } - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. + // @dev Not implemented // - // Selector: setCollectionLimit(string,bool) 993b7fba - function setCollectionLimit(string memory limit, bool value) public { + // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672 + function safeTransferFromWithData( + address from, + address to, + uint256 tokenId, + bytes memory data + ) public { require(false, stub_error); - limit; - value; + from; + to; + tokenId; + data; dummy = 0; } - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 - function contractAddress() public view returns (address) { - require(false, stub_error); - dummy; - return 0x0000000000000000000000000000000000000000; - } - - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. + // @dev Not implemented // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) public { + // Selector: safeTransferFrom(address,address,uint256) 42842e0e + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) public { require(false, stub_error); - newAdmin; + from; + to; + tokenId; dummy = 0; } - // Remove collection admin by substrate address. - // @param admin Substrate administrator address. + // @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE + // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + // THEY MAY BE PERMANENTLY LOST + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this RFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param from The current owner of the NFT + // @param to The new owner + // @param tokenId The NFT to transfer + // @param _value Not used for an NFT // - // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 - function removeCollectionAdminSubstrate(uint256 admin) public { + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 tokenId + ) public { require(false, stub_error); - admin; + from; + to; + tokenId; dummy = 0; } - // Add collection admin. - // @param new_admin Address of the added administrator. + // @dev Not implemented // - // Selector: addCollectionAdmin(address) 92e462c7 - function addCollectionAdmin(address newAdmin) public { + // Selector: approve(address,uint256) 095ea7b3 + function approve(address approved, uint256 tokenId) public { require(false, stub_error); - newAdmin; + approved; + tokenId; dummy = 0; } - // Remove collection admin. - // - // @param new_admin Address of the removed administrator. + // @dev Not implemented // - // Selector: removeCollectionAdmin(address) fafd7b42 - function removeCollectionAdmin(address admin) public { + // Selector: setApprovalForAll(address,bool) a22cb465 + function setApprovalForAll(address operator, bool approved) public { require(false, stub_error); - admin; + operator; + approved; dummy = 0; } - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // @dev Not implemented // - // Selector: setCollectionNesting(bool) 112d4586 - function setCollectionNesting(bool enable) public { + // Selector: getApproved(uint256) 081812fc + function getApproved(uint256 tokenId) public view returns (address) { require(false, stub_error); - enable; - dummy = 0; + tokenId; + dummy; + return 0x0000000000000000000000000000000000000000; } - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' - // @param collections Addresses of collections that will be available for nesting. + // @dev Not implemented // - // Selector: setCollectionNesting(bool,address[]) 64872396 - function setCollectionNesting(bool enable, address[] memory collections) + // Selector: isApprovedForAll(address,address) e985e9c5 + function isApprovedForAll(address owner, address operator) public + view + returns (address) { require(false, stub_error); - enable; - collections; - dummy = 0; + owner; + operator; + dummy; + return 0x0000000000000000000000000000000000000000; } +} - // Set the collection access method. - // @param mode Access mode - // 0 for Normal - // 1 for AllowList +// Selector: 5b5e139f +contract ERC721Metadata is Dummy, ERC165 { + // @notice A descriptive name for a collection of RFTs in this contract // - // Selector: setCollectionAccess(uint8) 41835d4c - function setCollectionAccess(uint8 mode) public { + // Selector: name() 06fdde03 + function name() public view returns (string memory) { require(false, stub_error); - mode; - dummy = 0; + dummy; + return ""; } - // Add the user to the allowed list. - // - // @param user Address of a trusted user. + // @notice An abbreviated name for RFTs in this contract // - // Selector: addToCollectionAllowList(address) 67844fe6 - function addToCollectionAllowList(address user) public { + // Selector: symbol() 95d89b41 + function symbol() public view returns (string memory) { require(false, stub_error); - user; - dummy = 0; + dummy; + return ""; } - // Remove the user from the allowed list. - // - // @param user Address of a removed user. + // @notice A distinct Uniform Resource Identifier (URI) for a given asset. // - // Selector: removeFromCollectionAllowList(address) 85c51acb - function removeFromCollectionAllowList(address user) public { - require(false, stub_error); - user; - dummy = 0; - } - - // Switch permission for minting. + // @dev If the token has a `url` property and it is not empty, it is returned. + // Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + // If the collection property `baseURI` is empty or absent, return "" (empty string) + // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). // - // @param mode Enable if "true". + // @return token's const_metadata // - // Selector: setCollectionMintMode(bool) 00018e84 - function setCollectionMintMode(bool mode) public { + // Selector: tokenURI(uint256) c87b56dd + function tokenURI(uint256 tokenId) public view returns (string memory) { require(false, stub_error); - mode; - dummy = 0; + tokenId; + dummy; + return ""; } +} - // Check that account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdmin(address) 9811b0c7 - function isOwnerOrAdmin(address user) public view returns (bool) { +// Selector: 68ccfe89 +contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { + // Selector: mintingFinished() 05d2035b + function mintingFinished() public view returns (bool) { require(false, stub_error); - user; dummy; return false; } - // Check that substrate account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin + // @notice Function to mint token. + // @dev `tokenId` should be obtained with `nextTokenId` method, + // unlike standard, you can't specify it manually + // @param to The new owner + // @param tokenId ID of the minted RFT // - // Selector: isOwnerOrAdmin(uint256) 8a6cfe67 - function isOwnerOrAdmin(uint256 user) public view returns (bool) { + // Selector: mint(address,uint256) 40c10f19 + function mint(address to, uint256 tokenId) public returns (bool) { require(false, stub_error); - user; - dummy; + to; + tokenId; + dummy = 0; return false; } - // Returns collection type - // - // @return `Fungible` or `NFT` or `ReFungible` + // @notice Function to mint token with the given tokenUri. + // @dev `tokenId` should be obtained with `nextTokenId` method, + // unlike standard, you can't specify it manually + // @param to The new owner + // @param tokenId ID of the minted RFT + // @param tokenUri Token URI that would be stored in the RFT properties // - // Selector: uniqueCollectionType() d34b55b8 - function uniqueCollectionType() public returns (string memory) { + // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f + function mintWithTokenURI( + address to, + uint256 tokenId, + string memory tokenUri + ) public returns (bool) { require(false, stub_error); + to; + tokenId; + tokenUri; dummy = 0; - return ""; + return false; } - // Changes collection owner to another account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner account + // @dev Not implemented // - // Selector: setOwner(address) 13af4035 - function setOwner(address newOwner) public { + // Selector: finishMinting() 7d64bcb4 + function finishMinting() public returns (bool) { require(false, stub_error); - newOwner; dummy = 0; + return false; } +} - // Changes collection owner to another substrate account +// Selector: 780e9d63 +contract ERC721Enumerable is Dummy, ERC165 { + // @notice Enumerate valid RFTs + // @param index A counter less than `totalSupply()` + // @return The token identifier for the `index`th NFT, + // (sort order not specified) // - // @dev Owner can be changed only by current owner - // @param newOwner new owner substrate account + // Selector: tokenByIndex(uint256) 4f6ccce7 + function tokenByIndex(uint256 index) public view returns (uint256) { + require(false, stub_error); + index; + dummy; + return 0; + } + + // Not implemented // - // Selector: setOwner(uint256) 8041494e - function setOwner(uint256 newOwner) public { + // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 + function tokenOfOwnerByIndex(address owner, uint256 index) + public + view + returns (uint256) + { require(false, stub_error); - newOwner; - dummy = 0; + owner; + index; + dummy; + return 0; } -} -// Selector: 41369377 -contract TokenProperties is Dummy, ERC165 { - // @notice Set permissions for token property. - // @dev Throws error if `msg.sender` is not admin or owner of the collection. - // @param key Property key. - // @param is_mutable Permission to mutate property. - // @param collection_admin Permission to mutate property by collection admin if property is mutable. - // @param token_owner Permission to mutate property by token owner if property is mutable. + // @notice Count RFTs tracked by this contract + // @return A count of valid RFTs tracked by this contract, where each one of + // them has an assigned and queryable owner not equal to the zero address // - // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa - function setTokenPropertyPermission( - string memory key, - bool isMutable, - bool collectionAdmin, - bool tokenOwner - ) public { + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { require(false, stub_error); - key; - isMutable; - collectionAdmin; - tokenOwner; - dummy = 0; + dummy; + return 0; } +} - // @notice Set token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. - // @param key Property key. - // @param value Property value. +// Selector: 7c3bef89 +contract ERC721UniqueExtensions is Dummy, ERC165 { + // @notice Transfer ownership of an RFT + // @dev Throws unless `msg.sender` is the current owner. Throws if `to` + // is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param to The new owner + // @param tokenId The RFT to transfer + // @param _value Not used for an RFT // - // Selector: setProperty(uint256,string,bytes) 1752d67b - function setProperty( - uint256 tokenId, - string memory key, - bytes memory value - ) public { + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 tokenId) public { require(false, stub_error); + to; tokenId; - key; - value; dummy = 0; } - // @notice Delete token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. - // @param key Property key. + // @notice Burns a specific ERC721 token. + // @dev Throws unless `msg.sender` is the current owner or an authorized + // operator for this RFT. Throws if `from` is not the current owner. Throws + // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + // Throws if RFT pieces have multiple owners. + // @param from The current owner of the RFT + // @param tokenId The RFT to transfer + // @param _value Not used for an RFT // - // Selector: deleteProperty(uint256,string) 066111d1 - function deleteProperty(uint256 tokenId, string memory key) public { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 tokenId) public { require(false, stub_error); + from; tokenId; - key; dummy = 0; } - // @notice Get token property value. - // @dev Throws error if key not found - // @param tokenId ID of the token. - // @param key Property key. - // @return Property value bytes + // @notice Returns next free RFT ID. // - // Selector: property(uint256,string) 7228c327 - function property(uint256 tokenId, string memory key) - public - view - returns (bytes memory) - { + // Selector: nextTokenId() 75794a3c + function nextTokenId() public view returns (uint256) { require(false, stub_error); - tokenId; - key; dummy; - return hex""; + return 0; } -} -// Selector: 42966c68 -contract ERC721Burnable is Dummy, ERC165 { - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current RFT owner, or an authorized - // operator of the current owner. - // @param tokenId The RFT to approve + // @notice Function to mint multiple tokens. + // @dev `tokenIds` should be an array of consecutive numbers and first number + // should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokenIds IDs of the minted RFTs // - // Selector: burn(uint256) 42966c68 - function burn(uint256 tokenId) public { + // Selector: mintBulk(address,uint256[]) 44a9945e + function mintBulk(address to, uint256[] memory tokenIds) + public + returns (bool) + { require(false, stub_error); - tokenId; + to; + tokenIds; dummy = 0; + return false; } -} -// Selector: 58800161 -contract ERC721 is Dummy, ERC165, ERC721Events { - // @notice Count all RFTs assigned to an owner - // @dev RFTs assigned to the zero address are considered invalid, and this - // function throws for queries about the zero address. - // @param owner An address for whom to query the balance - // @return The number of RFTs owned by `owner`, possibly zero + // @notice Function to mint multiple tokens with the given tokenUris. + // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // numbers and first number should be obtained with `nextTokenId` method + // @param to The new owner + // @param tokens array of pairs of token ID and token URI for minted tokens // - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) public view returns (uint256) { + // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 + function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + public + returns (bool) + { require(false, stub_error); - owner; - dummy; - return 0; + to; + tokens; + dummy = 0; + return false; } - // @notice Find the owner of an RFT - // @dev RFTs assigned to zero address are considered invalid, and queries - // about them do throw. - // Returns special 0xffffffffffffffffffffffffffffffffffffffff address for - // the tokens that are partially owned. - // @param tokenId The identifier for an RFT - // @return The address of the owner of the RFT + // Returns EVM address for refungible token // - // Selector: ownerOf(uint256) 6352211e - function ownerOf(uint256 tokenId) public view returns (address) { + // @param token ID of the token + // + // Selector: tokenContractAddress(uint256) ab76fac6 + function tokenContractAddress(uint256 token) public view returns (address) { require(false, stub_error); - tokenId; + token; dummy; return 0x0000000000000000000000000000000000000000; } +} - // @dev Not implemented +// Selector: ffe4da23 +contract Collection is Dummy, ERC165 { + // Set collection property. // - // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672 - function safeTransferFromWithData( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public { + // @param key Property key. + // @param value Propery value. + // + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + public + { require(false, stub_error); - from; - to; - tokenId; - data; + key; + value; dummy = 0; } - // @dev Not implemented + // Delete collection property. // - // Selector: safeTransferFrom(address,address,uint256) 42842e0e - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public { + // @param key Property key. + // + // Selector: deleteCollectionProperty(string) 7b7debce + function deleteCollectionProperty(string memory key) public { require(false, stub_error); - from; - to; - tokenId; + key; dummy = 0; } - // @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE - // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE - // THEY MAY BE PERMANENTLY LOST - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this RFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param from The current owner of the NFT - // @param to The new owner - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT + // Get collection property. // - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 tokenId - ) public { + // @dev Throws error if key not found. + // + // @param key Property key. + // @return bytes The property corresponding to the key. + // + // Selector: collectionProperty(string) cf24fd6d + function collectionProperty(string memory key) + public + view + returns (bytes memory) + { require(false, stub_error); - from; - to; - tokenId; - dummy = 0; + key; + dummy; + return hex""; } - // @dev Not implemented + // Set the sponsor of the collection. // - // Selector: approve(address,uint256) 095ea7b3 - function approve(address approved, uint256 tokenId) public { + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) public { require(false, stub_error); - approved; - tokenId; + sponsor; dummy = 0; } - // @dev Not implemented + // Collection sponsorship confirmation. // - // Selector: setApprovalForAll(address,bool) a22cb465 - function setApprovalForAll(address operator, bool approved) public { + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() public { require(false, stub_error); - operator; - approved; dummy = 0; } - // @dev Not implemented + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. // - // Selector: getApproved(uint256) 081812fc - function getApproved(uint256 tokenId) public view returns (address) { + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) public { require(false, stub_error); - tokenId; - dummy; - return 0x0000000000000000000000000000000000000000; + limit; + value; + dummy = 0; } - // @dev Not implemented + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. // - // Selector: isApprovedForAll(address,address) e985e9c5 - function isApprovedForAll(address owner, address operator) - public - view - returns (address) - { + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) public { require(false, stub_error); - owner; - operator; - dummy; - return 0x0000000000000000000000000000000000000000; + limit; + value; + dummy = 0; } -} -// Selector: 5b5e139f -contract ERC721Metadata is Dummy, ERC165 { - // @notice A descriptive name for a collection of RFTs in this contract + // Get contract address. // - // Selector: name() 06fdde03 - function name() public view returns (string memory) { + // Selector: contractAddress() f6b4dfb4 + function contractAddress() public view returns (address) { require(false, stub_error); dummy; - return ""; + return 0x0000000000000000000000000000000000000000; } - // @notice An abbreviated name for RFTs in this contract + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. // - // Selector: symbol() 95d89b41 - function symbol() public view returns (string memory) { + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) public { require(false, stub_error); - dummy; - return ""; + newAdmin; + dummy = 0; } - // @notice A distinct Uniform Resource Identifier (URI) for a given asset. - // - // @dev If the token has a `url` property and it is not empty, it is returned. - // Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. - // If the collection property `baseURI` is empty or absent, return "" (empty string) - // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix - // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). - // - // @return token's const_metadata + // Remove collection admin by substrate address. + // @param admin Substrate administrator address. // - // Selector: tokenURI(uint256) c87b56dd - function tokenURI(uint256 tokenId) public view returns (string memory) { + // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + function removeCollectionAdminSubstrate(uint256 admin) public { require(false, stub_error); - tokenId; - dummy; - return ""; + admin; + dummy = 0; } -} -// Selector: 68ccfe89 -contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { - // Selector: mintingFinished() 05d2035b - function mintingFinished() public view returns (bool) { + // Add collection admin. + // @param new_admin Address of the added administrator. + // + // Selector: addCollectionAdmin(address) 92e462c7 + function addCollectionAdmin(address newAdmin) public { require(false, stub_error); - dummy; - return false; + newAdmin; + dummy = 0; } - // @notice Function to mint token. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted RFT + // Remove collection admin. // - // Selector: mint(address,uint256) 40c10f19 - function mint(address to, uint256 tokenId) public returns (bool) { + // @param new_admin Address of the removed administrator. + // + // Selector: removeCollectionAdmin(address) fafd7b42 + function removeCollectionAdmin(address admin) public { require(false, stub_error); - to; - tokenId; + admin; dummy = 0; - return false; } - // @notice Function to mint token with the given tokenUri. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted RFT - // @param tokenUri Token URI that would be stored in the RFT properties + // Toggle accessibility of collection nesting. // - // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f - function mintWithTokenURI( - address to, - uint256 tokenId, - string memory tokenUri - ) public returns (bool) { + // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // + // Selector: setCollectionNesting(bool) 112d4586 + function setCollectionNesting(bool enable) public { require(false, stub_error); - to; - tokenId; - tokenUri; + enable; dummy = 0; - return false; } - // @dev Not implemented + // Toggle accessibility of collection nesting. // - // Selector: finishMinting() 7d64bcb4 - function finishMinting() public returns (bool) { + // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + // @param collections Addresses of collections that will be available for nesting. + // + // Selector: setCollectionNesting(bool,address[]) 64872396 + function setCollectionNesting(bool enable, address[] memory collections) + public + { require(false, stub_error); + enable; + collections; dummy = 0; - return false; } -} -// Selector: 780e9d63 -contract ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid RFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) + // Set the collection access method. + // @param mode Access mode + // 0 for Normal + // 1 for AllowList // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) public view returns (uint256) { + // Selector: setCollectionAccess(uint8) 41835d4c + function setCollectionAccess(uint8 mode) public { require(false, stub_error); - index; - dummy; - return 0; + mode; + dummy = 0; } - // Not implemented + // Add the user to the allowed list. // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - public - view - returns (uint256) - { + // @param user Address of a trusted user. + // + // Selector: addToCollectionAllowList(address) 67844fe6 + function addToCollectionAllowList(address user) public { require(false, stub_error); - owner; - index; - dummy; - return 0; + user; + dummy = 0; } - // @notice Count RFTs tracked by this contract - // @return A count of valid RFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address + // Remove the user from the allowed list. // - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { + // @param user Address of a removed user. + // + // Selector: removeFromCollectionAllowList(address) 85c51acb + function removeFromCollectionAllowList(address user) public { require(false, stub_error); - dummy; - return 0; + user; + dummy = 0; } -} -// Selector: 7c3bef89 -contract ERC721UniqueExtensions is Dummy, ERC165 { - // @notice Transfer ownership of an RFT - // @dev Throws unless `msg.sender` is the current owner. Throws if `to` - // is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param to The new owner - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT + // Switch permission for minting. // - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 tokenId) public { + // @param mode Enable if "true". + // + // Selector: setCollectionMintMode(bool) 00018e84 + function setCollectionMintMode(bool mode) public { require(false, stub_error); - to; - tokenId; + mode; dummy = 0; } - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this RFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param from The current owner of the RFT - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT + // Check that account is the owner or admin of the collection // - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 tokenId) public { + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: isOwnerOrAdmin(address) 9811b0c7 + function isOwnerOrAdmin(address user) public view returns (bool) { require(false, stub_error); - from; - tokenId; - dummy = 0; + user; + dummy; + return false; } - // @notice Returns next free RFT ID. + // Check that substrate account is the owner or admin of the collection // - // Selector: nextTokenId() 75794a3c - function nextTokenId() public view returns (uint256) { + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00 + function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) { require(false, stub_error); + user; dummy; - return 0; + return false; } - // @notice Function to mint multiple tokens. - // @dev `tokenIds` should be an array of consecutive numbers and first number - // should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokenIds IDs of the minted RFTs + // Returns collection type // - // Selector: mintBulk(address,uint256[]) 44a9945e - function mintBulk(address to, uint256[] memory tokenIds) - public - returns (bool) - { + // @return `Fungible` or `NFT` or `ReFungible` + // + // Selector: uniqueCollectionType() d34b55b8 + function uniqueCollectionType() public returns (string memory) { require(false, stub_error); - to; - tokenIds; dummy = 0; - return false; + return ""; } - // @notice Function to mint multiple tokens with the given tokenUris. - // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // numbers and first number should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokens array of pairs of token ID and token URI for minted tokens + // Changes collection owner to another account // - // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 - function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) - public - returns (bool) - { + // @dev Owner can be changed only by current owner + // @param newOwner new owner account + // + // Selector: setOwner(address) 13af4035 + function setOwner(address newOwner) public { require(false, stub_error); - to; - tokens; + newOwner; dummy = 0; - return false; } - // Returns EVM address for refungible token + // Changes collection owner to another substrate account // - // @param token ID of the token + // @dev Owner can be changed only by current owner + // @param newOwner new owner substrate account // - // Selector: tokenContractAddress(uint256) ab76fac6 - function tokenContractAddress(uint256 token) public view returns (address) { + // Selector: setOwnerSubstrate(uint256) b212138f + function setOwnerSubstrate(uint256 newOwner) public { require(false, stub_error); - token; - dummy; - return 0x0000000000000000000000000000000000000000; + newOwner; + dummy = 0; } } diff --git a/tests/src/eth/api/UniqueFungible.sol b/tests/src/eth/api/UniqueFungible.sol index 1d409a7abd..dcf3e11023 100644 --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -22,7 +22,50 @@ interface ERC20Events { ); } -// Selector: 2f4a7085 +// Selector: 79cc6790 +interface ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) external returns (bool); +} + +// Selector: 942e8b22 +interface ERC20 is Dummy, ERC165, ERC20Events { + // Selector: name() 06fdde03 + function name() external view returns (string memory); + + // Selector: symbol() 95d89b41 + function symbol() external view returns (string memory); + + // Selector: totalSupply() 18160ddd + function totalSupply() external view returns (uint256); + + // Selector: decimals() 313ce567 + function decimals() external view returns (uint8); + + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) external view returns (uint256); + + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 amount) external returns (bool); + + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 amount + ) external returns (bool); + + // Selector: approve(address,uint256) 095ea7b3 + function approve(address spender, uint256 amount) external returns (bool); + + // Selector: allowance(address,address) dd62ed3e + function allowance(address owner, address spender) + external + view + returns (uint256); +} + +// Selector: ffe4da23 interface Collection is Dummy, ERC165 { // Set collection property. // @@ -182,8 +225,8 @@ interface Collection is Dummy, ERC165 { // @param user account to verify // @return "true" if account is the owner or admin // - // Selector: isOwnerOrAdmin(uint256) 8a6cfe67 - function isOwnerOrAdmin(uint256 user) external view returns (bool); + // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00 + function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool); // Returns collection type // @@ -205,51 +248,8 @@ interface Collection is Dummy, ERC165 { // @dev Owner can be changed only by current owner // @param newOwner new owner substrate account // - // Selector: setOwner(uint256) 8041494e - function setOwner(uint256 newOwner) external; -} - -// Selector: 79cc6790 -interface ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) external returns (bool); -} - -// Selector: 942e8b22 -interface ERC20 is Dummy, ERC165, ERC20Events { - // Selector: name() 06fdde03 - function name() external view returns (string memory); - - // Selector: symbol() 95d89b41 - function symbol() external view returns (string memory); - - // Selector: totalSupply() 18160ddd - function totalSupply() external view returns (uint256); - - // Selector: decimals() 313ce567 - function decimals() external view returns (uint8); - - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) external view returns (uint256); - - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 amount) external returns (bool); - - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 amount - ) external returns (bool); - - // Selector: approve(address,uint256) 095ea7b3 - function approve(address spender, uint256 amount) external returns (bool); - - // Selector: allowance(address,address) dd62ed3e - function allowance(address owner, address spender) - external - view - returns (uint256); + // Selector: setOwnerSubstrate(uint256) b212138f + function setOwnerSubstrate(uint256 newOwner) external; } interface UniqueFungible is diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index b12db3d9cc..5ba5322869 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -42,193 +42,6 @@ interface ERC721MintableEvents { event MintingFinished(); } -// Selector: 2f4a7085 -interface Collection is Dummy, ERC165 { - // Set collection property. - // - // @param key Property key. - // @param value Propery value. - // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - external; - - // Delete collection property. - // - // @param key Property key. - // - // Selector: deleteCollectionProperty(string) 7b7debce - function deleteCollectionProperty(string memory key) external; - - // Get collection property. - // - // @dev Throws error if key not found. - // - // @param key Property key. - // @return bytes The property corresponding to the key. - // - // Selector: collectionProperty(string) cf24fd6d - function collectionProperty(string memory key) - external - view - returns (bytes memory); - - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) external; - - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,bool) 993b7fba - function setCollectionLimit(string memory limit, bool value) external; - - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 - function contractAddress() external view returns (address); - - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. - // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) external; - - // Remove collection admin by substrate address. - // @param admin Substrate administrator address. - // - // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 - function removeCollectionAdminSubstrate(uint256 admin) external; - - // Add collection admin. - // @param new_admin Address of the added administrator. - // - // Selector: addCollectionAdmin(address) 92e462c7 - function addCollectionAdmin(address newAdmin) external; - - // Remove collection admin. - // - // @param new_admin Address of the removed administrator. - // - // Selector: removeCollectionAdmin(address) fafd7b42 - function removeCollectionAdmin(address admin) external; - - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' - // - // Selector: setCollectionNesting(bool) 112d4586 - function setCollectionNesting(bool enable) external; - - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' - // @param collections Addresses of collections that will be available for nesting. - // - // Selector: setCollectionNesting(bool,address[]) 64872396 - function setCollectionNesting(bool enable, address[] memory collections) - external; - - // Set the collection access method. - // @param mode Access mode - // 0 for Normal - // 1 for AllowList - // - // Selector: setCollectionAccess(uint8) 41835d4c - function setCollectionAccess(uint8 mode) external; - - // Add the user to the allowed list. - // - // @param user Address of a trusted user. - // - // Selector: addToCollectionAllowList(address) 67844fe6 - function addToCollectionAllowList(address user) external; - - // Remove the user from the allowed list. - // - // @param user Address of a removed user. - // - // Selector: removeFromCollectionAllowList(address) 85c51acb - function removeFromCollectionAllowList(address user) external; - - // Switch permission for minting. - // - // @param mode Enable if "true". - // - // Selector: setCollectionMintMode(bool) 00018e84 - function setCollectionMintMode(bool mode) external; - - // Check that account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdmin(address) 9811b0c7 - function isOwnerOrAdmin(address user) external view returns (bool); - - // Check that substrate account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdmin(uint256) 8a6cfe67 - function isOwnerOrAdmin(uint256 user) external view returns (bool); - - // Returns collection type - // - // @return `Fungible` or `NFT` or `ReFungible` - // - // Selector: uniqueCollectionType() d34b55b8 - function uniqueCollectionType() external returns (string memory); - - // Changes collection owner to another account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner account - // - // Selector: setOwner(address) 13af4035 - function setOwner(address newOwner) external; - - // Changes collection owner to another substrate account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner substrate account - // - // Selector: setOwner(uint256) 8041494e - function setOwner(uint256 newOwner) external; -} - // Selector: 41369377 interface TokenProperties is Dummy, ERC165 { // @notice Set permissions for token property. @@ -514,6 +327,193 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { returns (bool); } +// Selector: ffe4da23 +interface Collection is Dummy, ERC165 { + // Set collection property. + // + // @param key Property key. + // @param value Propery value. + // + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + external; + + // Delete collection property. + // + // @param key Property key. + // + // Selector: deleteCollectionProperty(string) 7b7debce + function deleteCollectionProperty(string memory key) external; + + // Get collection property. + // + // @dev Throws error if key not found. + // + // @param key Property key. + // @return bytes The property corresponding to the key. + // + // Selector: collectionProperty(string) cf24fd6d + function collectionProperty(string memory key) + external + view + returns (bytes memory); + + // Set the sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) external; + + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) external; + + // Get contract address. + // + // Selector: contractAddress() f6b4dfb4 + function contractAddress() external view returns (address); + + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. + // + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) external; + + // Remove collection admin by substrate address. + // @param admin Substrate administrator address. + // + // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + function removeCollectionAdminSubstrate(uint256 admin) external; + + // Add collection admin. + // @param new_admin Address of the added administrator. + // + // Selector: addCollectionAdmin(address) 92e462c7 + function addCollectionAdmin(address newAdmin) external; + + // Remove collection admin. + // + // @param new_admin Address of the removed administrator. + // + // Selector: removeCollectionAdmin(address) fafd7b42 + function removeCollectionAdmin(address admin) external; + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // + // Selector: setCollectionNesting(bool) 112d4586 + function setCollectionNesting(bool enable) external; + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + // @param collections Addresses of collections that will be available for nesting. + // + // Selector: setCollectionNesting(bool,address[]) 64872396 + function setCollectionNesting(bool enable, address[] memory collections) + external; + + // Set the collection access method. + // @param mode Access mode + // 0 for Normal + // 1 for AllowList + // + // Selector: setCollectionAccess(uint8) 41835d4c + function setCollectionAccess(uint8 mode) external; + + // Add the user to the allowed list. + // + // @param user Address of a trusted user. + // + // Selector: addToCollectionAllowList(address) 67844fe6 + function addToCollectionAllowList(address user) external; + + // Remove the user from the allowed list. + // + // @param user Address of a removed user. + // + // Selector: removeFromCollectionAllowList(address) 85c51acb + function removeFromCollectionAllowList(address user) external; + + // Switch permission for minting. + // + // @param mode Enable if "true". + // + // Selector: setCollectionMintMode(bool) 00018e84 + function setCollectionMintMode(bool mode) external; + + // Check that account is the owner or admin of the collection + // + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: isOwnerOrAdmin(address) 9811b0c7 + function isOwnerOrAdmin(address user) external view returns (bool); + + // Check that substrate account is the owner or admin of the collection + // + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00 + function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool); + + // Returns collection type + // + // @return `Fungible` or `NFT` or `ReFungible` + // + // Selector: uniqueCollectionType() d34b55b8 + function uniqueCollectionType() external returns (string memory); + + // Changes collection owner to another account + // + // @dev Owner can be changed only by current owner + // @param newOwner new owner account + // + // Selector: setOwner(address) 13af4035 + function setOwner(address newOwner) external; + + // Changes collection owner to another substrate account + // + // @dev Owner can be changed only by current owner + // @param newOwner new owner substrate account + // + // Selector: setOwnerSubstrate(uint256) b212138f + function setOwnerSubstrate(uint256 newOwner) external; +} + interface UniqueNFT is Dummy, ERC165, diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index 188f44db87..7af76dc250 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -42,193 +42,6 @@ interface ERC721MintableEvents { event MintingFinished(); } -// Selector: 2f4a7085 -interface Collection is Dummy, ERC165 { - // Set collection property. - // - // @param key Property key. - // @param value Propery value. - // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - external; - - // Delete collection property. - // - // @param key Property key. - // - // Selector: deleteCollectionProperty(string) 7b7debce - function deleteCollectionProperty(string memory key) external; - - // Get collection property. - // - // @dev Throws error if key not found. - // - // @param key Property key. - // @return bytes The property corresponding to the key. - // - // Selector: collectionProperty(string) cf24fd6d - function collectionProperty(string memory key) - external - view - returns (bytes memory); - - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) external; - - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,bool) 993b7fba - function setCollectionLimit(string memory limit, bool value) external; - - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 - function contractAddress() external view returns (address); - - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. - // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) external; - - // Remove collection admin by substrate address. - // @param admin Substrate administrator address. - // - // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 - function removeCollectionAdminSubstrate(uint256 admin) external; - - // Add collection admin. - // @param new_admin Address of the added administrator. - // - // Selector: addCollectionAdmin(address) 92e462c7 - function addCollectionAdmin(address newAdmin) external; - - // Remove collection admin. - // - // @param new_admin Address of the removed administrator. - // - // Selector: removeCollectionAdmin(address) fafd7b42 - function removeCollectionAdmin(address admin) external; - - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' - // - // Selector: setCollectionNesting(bool) 112d4586 - function setCollectionNesting(bool enable) external; - - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' - // @param collections Addresses of collections that will be available for nesting. - // - // Selector: setCollectionNesting(bool,address[]) 64872396 - function setCollectionNesting(bool enable, address[] memory collections) - external; - - // Set the collection access method. - // @param mode Access mode - // 0 for Normal - // 1 for AllowList - // - // Selector: setCollectionAccess(uint8) 41835d4c - function setCollectionAccess(uint8 mode) external; - - // Add the user to the allowed list. - // - // @param user Address of a trusted user. - // - // Selector: addToCollectionAllowList(address) 67844fe6 - function addToCollectionAllowList(address user) external; - - // Remove the user from the allowed list. - // - // @param user Address of a removed user. - // - // Selector: removeFromCollectionAllowList(address) 85c51acb - function removeFromCollectionAllowList(address user) external; - - // Switch permission for minting. - // - // @param mode Enable if "true". - // - // Selector: setCollectionMintMode(bool) 00018e84 - function setCollectionMintMode(bool mode) external; - - // Check that account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdmin(address) 9811b0c7 - function isOwnerOrAdmin(address user) external view returns (bool); - - // Check that substrate account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdmin(uint256) 8a6cfe67 - function isOwnerOrAdmin(uint256 user) external view returns (bool); - - // Returns collection type - // - // @return `Fungible` or `NFT` or `ReFungible` - // - // Selector: uniqueCollectionType() d34b55b8 - function uniqueCollectionType() external returns (string memory); - - // Changes collection owner to another account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner account - // - // Selector: setOwner(address) 13af4035 - function setOwner(address newOwner) external; - - // Changes collection owner to another substrate account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner substrate account - // - // Selector: setOwner(uint256) 8041494e - function setOwner(uint256 newOwner) external; -} - // Selector: 41369377 interface TokenProperties is Dummy, ERC165 { // @notice Set permissions for token property. @@ -524,6 +337,193 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { returns (address); } +// Selector: ffe4da23 +interface Collection is Dummy, ERC165 { + // Set collection property. + // + // @param key Property key. + // @param value Propery value. + // + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + external; + + // Delete collection property. + // + // @param key Property key. + // + // Selector: deleteCollectionProperty(string) 7b7debce + function deleteCollectionProperty(string memory key) external; + + // Get collection property. + // + // @dev Throws error if key not found. + // + // @param key Property key. + // @return bytes The property corresponding to the key. + // + // Selector: collectionProperty(string) cf24fd6d + function collectionProperty(string memory key) + external + view + returns (bytes memory); + + // Set the sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) external; + + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) external; + + // Get contract address. + // + // Selector: contractAddress() f6b4dfb4 + function contractAddress() external view returns (address); + + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. + // + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) external; + + // Remove collection admin by substrate address. + // @param admin Substrate administrator address. + // + // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + function removeCollectionAdminSubstrate(uint256 admin) external; + + // Add collection admin. + // @param new_admin Address of the added administrator. + // + // Selector: addCollectionAdmin(address) 92e462c7 + function addCollectionAdmin(address newAdmin) external; + + // Remove collection admin. + // + // @param new_admin Address of the removed administrator. + // + // Selector: removeCollectionAdmin(address) fafd7b42 + function removeCollectionAdmin(address admin) external; + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + // + // Selector: setCollectionNesting(bool) 112d4586 + function setCollectionNesting(bool enable) external; + + // Toggle accessibility of collection nesting. + // + // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + // @param collections Addresses of collections that will be available for nesting. + // + // Selector: setCollectionNesting(bool,address[]) 64872396 + function setCollectionNesting(bool enable, address[] memory collections) + external; + + // Set the collection access method. + // @param mode Access mode + // 0 for Normal + // 1 for AllowList + // + // Selector: setCollectionAccess(uint8) 41835d4c + function setCollectionAccess(uint8 mode) external; + + // Add the user to the allowed list. + // + // @param user Address of a trusted user. + // + // Selector: addToCollectionAllowList(address) 67844fe6 + function addToCollectionAllowList(address user) external; + + // Remove the user from the allowed list. + // + // @param user Address of a removed user. + // + // Selector: removeFromCollectionAllowList(address) 85c51acb + function removeFromCollectionAllowList(address user) external; + + // Switch permission for minting. + // + // @param mode Enable if "true". + // + // Selector: setCollectionMintMode(bool) 00018e84 + function setCollectionMintMode(bool mode) external; + + // Check that account is the owner or admin of the collection + // + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: isOwnerOrAdmin(address) 9811b0c7 + function isOwnerOrAdmin(address user) external view returns (bool); + + // Check that substrate account is the owner or admin of the collection + // + // @param user account to verify + // @return "true" if account is the owner or admin + // + // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00 + function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool); + + // Returns collection type + // + // @return `Fungible` or `NFT` or `ReFungible` + // + // Selector: uniqueCollectionType() d34b55b8 + function uniqueCollectionType() external returns (string memory); + + // Changes collection owner to another account + // + // @dev Owner can be changed only by current owner + // @param newOwner new owner account + // + // Selector: setOwner(address) 13af4035 + function setOwner(address newOwner) external; + + // Changes collection owner to another substrate account + // + // @dev Owner can be changed only by current owner + // @param newOwner new owner substrate account + // + // Selector: setOwnerSubstrate(uint256) b212138f + function setOwnerSubstrate(uint256 newOwner) external; +} + interface UniqueRefungible is Dummy, ERC165, diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index dbb3edfa7b..e525dc4a98 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -373,11 +373,12 @@ describe('Change substrate owner tests', () => { const collectionEvm = evmCollection(web3, owner, collectionIdAddress); expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.true; - expect(await collectionEvm.methods['isOwnerOrAdmin(uint256)'](newOwner.addressRaw).call()).to.be.false; - await collectionEvm.methods['setOwner(uint256)'](newOwner.addressRaw).send(); + expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; + + await collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send(); expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.false; - expect(await collectionEvm.methods['isOwnerOrAdmin(uint256)'](newOwner.addressRaw).call()).to.be.true; + expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.true; }); itWeb3('change owner call fee', async ({web3, api, privateKeyWrapper}) => { @@ -390,7 +391,7 @@ describe('Change substrate owner tests', () => { const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - const cost = await recordEthFee(api, owner, () => collectionEvm.methods['setOwner(uint256)'](newOwner.addressRaw).send()); + const cost = await recordEthFee(api, owner, () => collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send()); expect(cost < BigInt(0.2 * Number(UNIQUE))); expect(cost > 0); }); @@ -406,7 +407,7 @@ describe('Change substrate owner tests', () => { const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await expect(collectionEvm.methods['setOwner(uint256)'](newOwner.addressRaw).send({from: otherReceiver})).to.be.rejected; - expect(await collectionEvm.methods['isOwnerOrAdmin(uint256)'](newOwner.addressRaw).call()).to.be.false; + await expect(collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send({from: otherReceiver})).to.be.rejected; + expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; }); }); \ No newline at end of file diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index 725b22b9a0..9330c16638 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -152,7 +152,7 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } + { "internalType": "address", "name": "user", "type": "address" } ], "name": "isOwnerOrAdmin", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], @@ -161,9 +161,9 @@ }, { "inputs": [ - { "internalType": "address", "name": "user", "type": "address" } + { "internalType": "uint256", "name": "user", "type": "uint256" } ], - "name": "isOwnerOrAdmin", + "name": "isOwnerOrAdminSubstrate", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" @@ -289,7 +289,7 @@ "inputs": [ { "internalType": "uint256", "name": "newOwner", "type": "uint256" } ], - "name": "setOwner", + "name": "setOwnerSubstrate", "outputs": [], "stateMutability": "nonpayable", "type": "function" diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index 1dd0e8463b..17f742d97d 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -211,7 +211,7 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } + { "internalType": "address", "name": "user", "type": "address" } ], "name": "isOwnerOrAdmin", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], @@ -220,9 +220,9 @@ }, { "inputs": [ - { "internalType": "address", "name": "user", "type": "address" } + { "internalType": "uint256", "name": "user", "type": "uint256" } ], - "name": "isOwnerOrAdmin", + "name": "isOwnerOrAdminSubstrate", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" @@ -463,7 +463,7 @@ "inputs": [ { "internalType": "uint256", "name": "newOwner", "type": "uint256" } ], - "name": "setOwner", + "name": "setOwnerSubstrate", "outputs": [], "stateMutability": "nonpayable", "type": "function" diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index 7770682df0..cafb05331a 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -211,7 +211,7 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } + { "internalType": "address", "name": "user", "type": "address" } ], "name": "isOwnerOrAdmin", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], @@ -220,9 +220,9 @@ }, { "inputs": [ - { "internalType": "address", "name": "user", "type": "address" } + { "internalType": "uint256", "name": "user", "type": "uint256" } ], - "name": "isOwnerOrAdmin", + "name": "isOwnerOrAdminSubstrate", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" @@ -463,7 +463,7 @@ "inputs": [ { "internalType": "uint256", "name": "newOwner", "type": "uint256" } ], - "name": "setOwner", + "name": "setOwnerSubstrate", "outputs": [], "stateMutability": "nonpayable", "type": "function" From edbaeb3cd480923af6d5ecbf2c43d01bbcd7f35d Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 23 Aug 2022 18:36:52 +0300 Subject: [PATCH 0514/1274] fix: Dockerfile-parachain-node-only --- .docker/Dockerfile-parachain-node-only | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/.docker/Dockerfile-parachain-node-only b/.docker/Dockerfile-parachain-node-only index b4aa85aec5..f237291052 100644 --- a/.docker/Dockerfile-parachain-node-only +++ b/.docker/Dockerfile-parachain-node-only @@ -59,21 +59,13 @@ FROM rust-builder as builder-polkadot ARG POLKADOT_BUILD_BRANCH= ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH + WORKDIR /unique_parachain RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ cd polkadot && \ cargo build --release -# ===== BUILD CHAINQL ===== -FROM rust-builder as builder-chainql - -RUN mkdir chainql -WORKDIR /chainql - -RUN git clone -b v0.1.0 --depth 1 https://github.com/CertainLach/chainql.git . && \ - cargo build --release - # ===== RUN ====== FROM ubuntu:20.04 @@ -89,7 +81,7 @@ RUN apt-get -y update && \ nvm install v16.16.0 && \ nvm use v16.16.0 -RUN git clone https://github.com/uniquenetwork/polkadot-launch.git -b feature/parachain-forking +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/runtime-upgrade-testing RUN export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ @@ -103,14 +95,10 @@ COPY --from=builder-unique-current /unique_parachain/target/release/unique-colla COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm -COPY --from=builder-chainql /chainql/target/release/chainql /chainql/target/release/ - COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm -ARG REPLICA_FROM= -ENV REPLICA_FROM=$REPLICA_FROM -CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" REPLICA_FROM && \ +CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ yarn start launch-config.json --test-upgrade-parachains -w -n From 129947cf5141c44a4fae0f6a96145b94be7e004f Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Wed, 24 Aug 2022 11:36:32 +0700 Subject: [PATCH 0515/1274] add docker-compose files for xcm --- .docker/Dockerfile-xcm | 127 ++++++++++++++++ .docker/docker-compose-xcm.yml | 25 ++++ .docker/docker-compose.tmp-xcm-quartz.yml | 19 +++ .docker/docker-compose.tmp-xcm-unique.yml | 19 +++ .docker/launch-config-xcm-quartz.json | 171 ++++++++++++++++++++++ .docker/launch-config-xcm-unique.json | 171 ++++++++++++++++++++++ 6 files changed, 532 insertions(+) create mode 100644 .docker/Dockerfile-xcm create mode 100644 .docker/docker-compose-xcm.yml create mode 100644 .docker/docker-compose.tmp-xcm-quartz.yml create mode 100644 .docker/docker-compose.tmp-xcm-unique.yml create mode 100644 .docker/launch-config-xcm-quartz.json create mode 100644 .docker/launch-config-xcm-unique.json diff --git a/.docker/Dockerfile-xcm b/.docker/Dockerfile-xcm new file mode 100644 index 0000000000..b48ca6b50a --- /dev/null +++ b/.docker/Dockerfile-xcm @@ -0,0 +1,127 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ARG RUST_TOOLCHAIN= + +ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install $RUST_TOOLCHAIN && \ + rustup default $RUST_TOOLCHAIN && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + + +# ===== BUILD ====== +FROM rust-builder as builder-unique + +ARG PROFILE=release +ARG FEATURE= +ARG REPO_URL= +ARG BRANCH= + + +WORKDIR /unique_parachain + +RUN git clone $REPO_URL -b $BRANCH . && \ + cargo build --features=$FEATURE --$PROFILE + +# ===== BUILD POLKADOT ===== +FROM rust-builder as builder-polkadot + +ARG POLKADOT_BUILD_BRANCH= +ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH + + +WORKDIR /unique_parachain + +RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ + cd polkadot && \ + cargo build --release + +# ===== BUILD ACALA ===== +FROM rust-builder as builder-acala + +ARG ACALA_BUILD_BRANCH= +ENV ACALA_BUILD_BRANCH $ACALA_BUILD_BRANCH + + +WORKDIR /unique_parachain + +RUN git clone -b $ACALA_BUILD_BRANCH --depth 1 https://github.com/AcalaNetwork/Acala.git && \ + cd Acala && \ + make init && \ + cargo build --release + +# ===== BUILD MOONBEAM ===== +FROM rust-builder as builder-moonbeam + +ARG MOONBEAM_BUILD_BRANCH= +ENV MOONBEAM_BUILD_BRANCH $MOONBEAM_BUILD_BRANCH + + +WORKDIR /unique_parachain + +RUN git clone -b $MOONBEAM_BUILD_BRANCH --depth 1 https://github.com/PureStake/moonbeam.git && \ + cd moonbeam && \ + cargo build --release + +# ===== BUILD CUMULUS ===== +FROM rust-builder as builder-cumulus + +ARG CUMULUS_BUILD_BRANCH= +ENV CUMULUS_BUILD_BRANCH $CUMULUS_BUILD_BRANCH + + +WORKDIR /unique_parachain + +RUN git clone -b $CUMULUS_BUILD_BRANCH --depth 1 https://github.com/paritytech/cumulus.git && \ + cd cumulus && \ + cargo build --release + +# ===== RUN ====== + +FROM ubuntu:20.04 + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/runtime-upgrade-testing + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn install + +COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=builder-acala /unique_parachain/Acala/target/production/acala /acala/target/release/ +COPY --from=builder-moonbeam /unique_parachain/moonbeam/target/release/moonbeam /moonbeam/target/release/ +COPY --from=builder-cumulus /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus + +CMD export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start launch-config.json diff --git a/.docker/docker-compose-xcm.yml b/.docker/docker-compose-xcm.yml new file mode 100644 index 0000000000..faa7cfcc47 --- /dev/null +++ b/.docker/docker-compose-xcm.yml @@ -0,0 +1,25 @@ +version: "3.5" + +services: + xcm_nodes: + build: + context: ../ + dockerfile: .docker/Dockerfile-xcm + image: xcm_nodes + container_name: xcm_nodes + expose: + - 9844 + - 9944 + - 9946 + - 9947 + - 9948 + ports: + - 127.0.0.1:9844:9844 + - 127.0.0.1:9944:9944 + - 127.0.0.1:9946:9946 + - 127.0.0.1:9947:9947 + - 127.0.0.1:9948:9948 + logging: + options: + max-size: "1m" + max-file: "3" diff --git a/.docker/docker-compose.tmp-xcm-quartz.yml b/.docker/docker-compose.tmp-xcm-quartz.yml new file mode 100644 index 0000000000..1d3dfc6de1 --- /dev/null +++ b/.docker/docker-compose.tmp-xcm-quartz.yml @@ -0,0 +1,19 @@ +version: "3.5" + +services: + xcm_nodes: + build: + args: + - "RUST_TOOLCHAIN=nightly-2022-07-24" + - "BRANCH=release-v927020" + - "REPO_URL=https://github.com/UniqueNetwork/unique-chain.git" + - "FEATURE=quartz-runtime" + - "POLKADOT_BUILD_BRANCH=release-v0.9.27" + - "ACALA_BUILD_BRANCH=2.9.0" + - "MOONBEAM_BUILD_BRANCH=v0.25.0" + - "CUMULUS_BUILD_BRANCH=release-v0.9.230" + volumes: + - type: bind + source: ./launch-config-xcm-quartz.json + target: /polkadot-launch/launch-config.json + read_only: true diff --git a/.docker/docker-compose.tmp-xcm-unique.yml b/.docker/docker-compose.tmp-xcm-unique.yml new file mode 100644 index 0000000000..3b4c633955 --- /dev/null +++ b/.docker/docker-compose.tmp-xcm-unique.yml @@ -0,0 +1,19 @@ +version: "3.5" + +services: + xcm_nodes: + build: + args: + - "RUST_TOOLCHAIN=nightly-2022-07-24" + - "BRANCH=release-v927020" + - "REPO_URL=https://github.com/UniqueNetwork/unique-chain.git" + - "FEATURE=unique-runtime" + - "POLKADOT_BUILD_BRANCH=release-v0.9.27" + - "ACALA_BUILD_BRANCH=2.9.0" + - "MOONBEAM_BUILD_BRANCH=v0.25.0" + - "CUMULUS_BUILD_BRANCH=release-v0.9.230" + volumes: + - type: bind + source: ./launch-config-xcm-unique.json + target: /polkadot-launch/launch-config.json + read_only: true diff --git a/.docker/launch-config-xcm-quartz.json b/.docker/launch-config-xcm-quartz.json new file mode 100644 index 0000000000..fd6b983dcc --- /dev/null +++ b/.docker/launch-config-xcm-quartz.json @@ -0,0 +1,171 @@ +{ + "relaychain": { + "bin": "/polkadot/target/release/polkadot", + "chain": "westend-local", + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "-lparachain::candidate_validation=debug" + ] + } + + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "/unique-chain/target/release/unique-collator", + "id": "2095", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + ] + } + ] + }, + { + "bin": "/acala/target/release/acala", + "id": "2000", + "chain": "karura-dev", + "balance": "1000000000000000000000", + "nodes": [ + { + "wsPort": 9946, + "port": 31202, + "name": "alice", + "flags": [ + ] + } + ] + }, + { + "bin": "/moonbeam/target/release/moonbeam", + "id": 2023, + "balance": "1000000000000000000000", + "chain": "moonriver-local", + "nodes": [ + { + "wsPort": 9947, + "port": 31203, + "name": "alice", + "flags": [ + "--", + "--execution=wasm" + ] + } + ] + }, + { + "bin": "/cumulus/target/release/cumulus", + "id": "1000", + "chain": "statemine-local", + "balance": "1000000000000000000000000", + "nodes": [ + { + "wsPort": 9948, + "port": 31204, + "name": "alice", + "flags": [ + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [ + { + "sender": 2095, + "recipient": 2000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2000, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2095, + "recipient": 2023, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2023, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2095, + "recipient": 1000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 1000, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + } + ], + "finalization": false +} + diff --git a/.docker/launch-config-xcm-unique.json b/.docker/launch-config-xcm-unique.json new file mode 100644 index 0000000000..f95cbcd240 --- /dev/null +++ b/.docker/launch-config-xcm-unique.json @@ -0,0 +1,171 @@ +{ + "relaychain": { + "bin": "/polkadot/target/release/polkadot", + "chain": "westend-local", + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "-lparachain::candidate_validation=debug" + ] + } + + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "/unique-chain/target/release/unique-collator", + "id": "2037", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + ] + } + ] + }, + { + "bin": "/acala/target/release/acala", + "id": "2000", + "chain": "acala-dev", + "balance": "1000000000000000000000", + "nodes": [ + { + "wsPort": 9946, + "port": 31202, + "name": "alice", + "flags": [ + ] + } + ] + }, + { + "bin": "/moonbeam/target/release/moonbeam", + "id": "2004", + "balance": "1000000000000000000000", + "chain": "moonbeam-local", + "nodes": [ + { + "wsPort": 9947, + "port": 31203, + "name": "alice", + "flags": [ + "--", + "--execution=wasm" + ] + } + ] + }, + { + "bin": "/cumulus/target/release/cumulus", + "id": "1000", + "chain": "statemint-local", + "balance": "1000000000000000000000000", + "nodes": [ + { + "wsPort": 9948, + "port": 31204, + "name": "alice", + "flags": [ + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [ + { + "sender": 2037, + "recipient": 2000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2000, + "recipient": 2037, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2037, + "recipient": 2004, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2004, + "recipient": 2037, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2037, + "recipient": 1000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 1000, + "recipient": 2037, + "maxCapacity": 8, + "maxMessageSize": 512 + } + ], + "finalization": false +} + From cfe013be94f62f3c74f0ea52df84c2f51417bf1e Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Wed, 24 Aug 2022 12:57:28 +0700 Subject: [PATCH 0516/1274] correct build acala in docker --- .docker/Dockerfile-xcm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.docker/Dockerfile-xcm b/.docker/Dockerfile-xcm index b48ca6b50a..860f4ee72c 100644 --- a/.docker/Dockerfile-xcm +++ b/.docker/Dockerfile-xcm @@ -67,7 +67,7 @@ WORKDIR /unique_parachain RUN git clone -b $ACALA_BUILD_BRANCH --depth 1 https://github.com/AcalaNetwork/Acala.git && \ cd Acala && \ make init && \ - cargo build --release + make build-release # ===== BUILD MOONBEAM ===== FROM rust-builder as builder-moonbeam @@ -117,9 +117,9 @@ RUN export NVM_DIR="$HOME/.nvm" && \ COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=builder-acala /unique_parachain/Acala/target/production/acala /acala/target/release/ COPY --from=builder-moonbeam /unique_parachain/moonbeam/target/release/moonbeam /moonbeam/target/release/ COPY --from=builder-cumulus /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus +COPY --from=builder-acala /unique_parachain/Acala/target/production/acala /acala/target/release/ CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ From ad7c2552ea339858488f6e66d2ecf35f43eaf88e Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Wed, 24 Aug 2022 14:44:26 +0700 Subject: [PATCH 0517/1274] add external flags --- .docker/launch-config-xcm-unique.json | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.docker/launch-config-xcm-unique.json b/.docker/launch-config-xcm-unique.json index f95cbcd240..17e5780fbd 100644 --- a/.docker/launch-config-xcm-unique.json +++ b/.docker/launch-config-xcm-unique.json @@ -9,6 +9,8 @@ "rpcPort": 9843, "port": 30444, "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", "-lparachain::candidate_validation=debug" ] }, @@ -18,6 +20,8 @@ "rpcPort": 9854, "port": 30555, "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", "-lparachain::candidate_validation=debug" ] }, @@ -27,6 +31,8 @@ "rpcPort": 9865, "port": 30666, "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", "-lparachain::candidate_validation=debug" ] }, @@ -36,6 +42,8 @@ "rpcPort": 9876, "port": 30777, "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", "-lparachain::candidate_validation=debug" ] }, @@ -45,6 +53,8 @@ "rpcPort": 9887, "port": 30888, "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", "-lparachain::candidate_validation=debug" ] } @@ -75,7 +85,9 @@ "rpcPort": 9933, "name": "alice", "flags": [ - ] + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] } ] }, @@ -90,7 +102,9 @@ "port": 31202, "name": "alice", "flags": [ - ] + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] } ] }, @@ -105,7 +119,9 @@ "port": 31203, "name": "alice", "flags": [ - "--", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "--", "--execution=wasm" ] } @@ -122,7 +138,9 @@ "port": 31204, "name": "alice", "flags": [ - ] + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] } ] } From 6a24fd755450d2af6d837755e2fcb64ffec6b87e Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Wed, 24 Aug 2022 15:40:11 +0700 Subject: [PATCH 0518/1274] create folder xcm-config --- .docker/docker-compose.tmp-xcm-quartz.yml | 2 +- .docker/docker-compose.tmp-xcm-unique.yml | 2 +- .docker/{ => xcm-config}/launch-config-xcm-quartz.json | 0 .docker/{ => xcm-config}/launch-config-xcm-unique.json | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename .docker/{ => xcm-config}/launch-config-xcm-quartz.json (100%) rename .docker/{ => xcm-config}/launch-config-xcm-unique.json (100%) diff --git a/.docker/docker-compose.tmp-xcm-quartz.yml b/.docker/docker-compose.tmp-xcm-quartz.yml index 1d3dfc6de1..70f2b0a196 100644 --- a/.docker/docker-compose.tmp-xcm-quartz.yml +++ b/.docker/docker-compose.tmp-xcm-quartz.yml @@ -14,6 +14,6 @@ services: - "CUMULUS_BUILD_BRANCH=release-v0.9.230" volumes: - type: bind - source: ./launch-config-xcm-quartz.json + source: ./xcm-config/launch-config-xcm-quartz.json target: /polkadot-launch/launch-config.json read_only: true diff --git a/.docker/docker-compose.tmp-xcm-unique.yml b/.docker/docker-compose.tmp-xcm-unique.yml index 3b4c633955..ccdc180b6c 100644 --- a/.docker/docker-compose.tmp-xcm-unique.yml +++ b/.docker/docker-compose.tmp-xcm-unique.yml @@ -14,6 +14,6 @@ services: - "CUMULUS_BUILD_BRANCH=release-v0.9.230" volumes: - type: bind - source: ./launch-config-xcm-unique.json + source: ./xcm-config/launch-config-xcm-unique.json target: /polkadot-launch/launch-config.json read_only: true diff --git a/.docker/launch-config-xcm-quartz.json b/.docker/xcm-config/launch-config-xcm-quartz.json similarity index 100% rename from .docker/launch-config-xcm-quartz.json rename to .docker/xcm-config/launch-config-xcm-quartz.json diff --git a/.docker/launch-config-xcm-unique.json b/.docker/xcm-config/launch-config-xcm-unique.json similarity index 100% rename from .docker/launch-config-xcm-unique.json rename to .docker/xcm-config/launch-config-xcm-unique.json From 1d2032e21502945d677701cddb689e481bbdf542 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Wed, 24 Aug 2022 18:30:52 +0700 Subject: [PATCH 0519/1274] add external flags --- .../xcm-config/launch-config-xcm-quartz.json | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.docker/xcm-config/launch-config-xcm-quartz.json b/.docker/xcm-config/launch-config-xcm-quartz.json index fd6b983dcc..e8368298fb 100644 --- a/.docker/xcm-config/launch-config-xcm-quartz.json +++ b/.docker/xcm-config/launch-config-xcm-quartz.json @@ -9,6 +9,8 @@ "rpcPort": 9843, "port": 30444, "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", "-lparachain::candidate_validation=debug" ] }, @@ -18,6 +20,8 @@ "rpcPort": 9854, "port": 30555, "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", "-lparachain::candidate_validation=debug" ] }, @@ -27,6 +31,8 @@ "rpcPort": 9865, "port": 30666, "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", "-lparachain::candidate_validation=debug" ] }, @@ -36,6 +42,8 @@ "rpcPort": 9876, "port": 30777, "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", "-lparachain::candidate_validation=debug" ] }, @@ -45,6 +53,8 @@ "rpcPort": 9887, "port": 30888, "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", "-lparachain::candidate_validation=debug" ] } @@ -75,7 +85,9 @@ "rpcPort": 9933, "name": "alice", "flags": [ - ] + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] } ] }, @@ -90,6 +102,8 @@ "port": 31202, "name": "alice", "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" ] } ] @@ -105,6 +119,8 @@ "port": 31203, "name": "alice", "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", "--", "--execution=wasm" ] @@ -122,6 +138,8 @@ "port": 31204, "name": "alice", "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" ] } ] From 3be2070a21b62e177ddd78ad5220653ab89f0d5f Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 24 Aug 2022 12:07:46 +0000 Subject: [PATCH 0520/1274] fix(test): add generateKeyringPair --- tests/src/util/helpers.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index 62e48f0ec0..632de20ca1 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -16,7 +16,7 @@ import '../interfaces/augment-api-rpc'; import '../interfaces/augment-api-query'; -import {ApiPromise} from '@polkadot/api'; +import {ApiPromise, Keyring} from '@polkadot/api'; import type {AccountId, EventRecord, Event} from '@polkadot/types/interfaces'; import type {GenericEventData} from '@polkadot/types'; import {AnyTuple, IEvent, IKeyringPair} from '@polkadot/types/types'; @@ -1785,3 +1785,19 @@ export async function itApi(name: string, cb: (apis: { api: ApiPromise, privateK itApi.only = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {only: true}); itApi.skip = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {skip: true}); + +let accountSeed = 10000; + +const keyringEth = new Keyring({type: 'ethereum'}); +const keyringEd25519 = new Keyring({type: 'ed25519'}); +const keyringSr25519 = new Keyring({type: 'sr25519'}); + +export function generateKeyringPair(type: 'ethereum' | 'sr25519' | 'ed25519' = 'sr25519') { + const privateKey = `0xDEADBEEF${(accountSeed++).toString(16).padStart(56, '0')}`; + if (type == 'sr25519') { + return keyringSr25519.addFromUri(privateKey); + } else if (type == 'ed25519') { + return keyringEd25519.addFromUri(privateKey); + } + return keyringEth.addFromUri(privateKey); +} From a688446a20a64447a1b07b2606ac552a9f6d77ab Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 24 Aug 2022 15:22:51 +0300 Subject: [PATCH 0521/1274] fix: launch-config for forkless parachain upgrade with data --- .docker/forkless-config/launch-config-forkless-data.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/forkless-config/launch-config-forkless-data.j2 b/.docker/forkless-config/launch-config-forkless-data.j2 index 1fccad7d74..7b52cd723b 100644 --- a/.docker/forkless-config/launch-config-forkless-data.j2 +++ b/.docker/forkless-config/launch-config-forkless-data.j2 @@ -86,7 +86,7 @@ }, "parachains": [ { - "bin": "/unique-chain/target/release/unique-collator", + "bin": "/unique-chain/current/release/unique-collator", "upgradeBin": "/unique-chain/target/release/unique-collator", "upgradeWasm": "/unique-chain/target/release/wbuild/{{ FEATURE }}/{{ RUNTIME }}_runtime.compact.compressed.wasm", "id": "1000", From 85f3ef2e0166f1917e5827c58e1cf434c55f94e8 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Wed, 24 Aug 2022 13:06:53 +0000 Subject: [PATCH 0522/1274] move types and interfaces to types.ts --- tests/src/util/playgrounds/types.ts | 130 +++++++++++++++++++++++ tests/src/util/playgrounds/unique.dev.ts | 4 +- tests/src/util/playgrounds/unique.ts | 90 +--------------- 3 files changed, 133 insertions(+), 91 deletions(-) create mode 100644 tests/src/util/playgrounds/types.ts diff --git a/tests/src/util/playgrounds/types.ts b/tests/src/util/playgrounds/types.ts new file mode 100644 index 0000000000..d6633d1f58 --- /dev/null +++ b/tests/src/util/playgrounds/types.ts @@ -0,0 +1,130 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +import {IKeyringPair} from '@polkadot/types/types'; + +export interface IChainEvent { + data: any; + method: string; + section: string; +} + +export interface ITransactionResult { + status: 'Fail' | 'Success'; + result: { + events: { + event: IChainEvent + }[]; + }, + moduleError?: string; +} + +export interface ILogger { + log: (msg: any, level?: string) => void; + level: { + ERROR: 'ERROR'; + WARNING: 'WARNING'; + INFO: 'INFO'; + [key: string]: string; + } +} + +export interface IUniqueHelperLog { + executedAt: number; + executionTime: number; + type: 'extrinsic' | 'rpc'; + status: 'Fail' | 'Success'; + call: string; + params: any[]; + moduleError?: string; + events?: any; +} + +export interface IApiListeners { + connected?: (...args: any[]) => any; + disconnected?: (...args: any[]) => any; + error?: (...args: any[]) => any; + ready?: (...args: any[]) => any; + decorated?: (...args: any[]) => any; +} + +export interface ICrossAccountId { + Substrate?: TSubstrateAccount; + Ethereum?: TEthereumAccount; +} + +export interface ICrossAccountIdLower { + substrate?: TSubstrateAccount; + ethereum?: TEthereumAccount; +} + +export interface ICollectionLimits { + accountTokenOwnershipLimit?: number | null; + sponsoredDataSize?: number | null; + sponsoredDataRateLimit?: {blocks: number} | {sponsoringDisabled: null} | null; + tokenLimit?: number | null; + sponsorTransferTimeout?: number | null; + sponsorApproveTimeout?: number | null; + ownerCanTransfer?: boolean | null; + ownerCanDestroy?: boolean | null; + transfersEnabled?: boolean | null; +} + +export interface INestingPermissions { + tokenOwner?: boolean; + collectionAdmin?: boolean; + restricted?: number[] | null; +} + +export interface ICollectionPermissions { + access?: 'Normal' | 'AllowList'; + mintMode?: boolean; + nesting?: INestingPermissions; +} + +export interface IProperty { + key: string; + value: string; +} + +export interface ITokenPropertyPermission { + key: string; + permission: { + mutable: boolean; + tokenOwner: boolean; + collectionAdmin: boolean; + } +} + +export interface IToken { + collectionId: number; + tokenId: number; +} + +export interface ICollectionCreationOptions { + name: string | number[]; + description: string | number[]; + tokenPrefix: string | number[]; + mode?: { + nft?: null; + refungible?: null; + fungible?: number; + } + permissions?: ICollectionPermissions; + properties?: IProperty[]; + tokenPropertyPermissions?: ITokenPropertyPermission[]; + limits?: ICollectionLimits; + pendingSponsor?: TSubstrateAccount; +} + +export interface IChainProperties { + ss58Format: number; + tokenDecimals: number[]; + tokenSymbol: string[] +} + +export type TSubstrateAccount = string; +export type TEthereumAccount = string; +export type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated'; +export type TUniqueNetworks = 'opal' | 'quartz' | 'unique'; +export type TSigner = IKeyringPair; // | 'string' \ No newline at end of file diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 6fab87f0c8..1c3b0f9a57 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -3,9 +3,9 @@ import {mnemonicGenerate} from '@polkadot/util-crypto'; import {UniqueHelper} from './unique'; -import {IKeyringPair} from '@polkadot/types/types'; import {ApiPromise, WsProvider} from '@polkadot/api'; import * as defs from '../../interfaces/definitions'; +import { TSigner } from './types'; export class DevUniqueHelper extends UniqueHelper { @@ -69,7 +69,7 @@ class ArrangeGroup { * @returns array of newly created accounts * @example const [acc1, acc2, acc3] = await createAccounts([0n, 10n, 20n], donor); */ - creteAccounts = async (balances: bigint[], donor: IKeyringPair): Promise => { + creteAccounts = async (balances: bigint[], donor: TSigner): Promise => { let nonce = await this.helper.chain.getNonce(donor.address); const tokenNominal = this.helper.balance.getOneTokenNominal(); const transactions = []; diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index c006b02c98..0aa2653703 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -9,6 +9,7 @@ import {ApiPromise, WsProvider, Keyring} from '@polkadot/api'; import {ApiInterfaceEvents} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto'; +import { ICrossAccountIdLower, ICrossAccountId, TUniqueNetworks, IApiListeners, TApiAllowedListeners, TSigner, TSubstrateAccount, ICollectionLimits, ICollectionPermissions, INestingPermissions, IProperty, ITokenPropertyPermission, ICollectionCreationOptions, IToken, IChainProperties, TEthereumAccount } from './types'; const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => { @@ -82,95 +83,6 @@ interface IUniqueHelperLog { events?: any; } -interface IApiListeners { - connected?: (...args: any[]) => any; - disconnected?: (...args: any[]) => any; - error?: (...args: any[]) => any; - ready?: (...args: any[]) => any; - decorated?: (...args: any[]) => any; -} - -interface ICrossAccountId { - Substrate?: TSubstrateAccount; - Ethereum?: TEthereumAccount; -} - -interface ICrossAccountIdLower { - substrate?: TSubstrateAccount; - ethereum?: TEthereumAccount; -} - -interface ICollectionLimits { - accountTokenOwnershipLimit?: number | null; - sponsoredDataSize?: number | null; - sponsoredDataRateLimit?: {blocks: number} | {sponsoringDisabled: null} | null; - tokenLimit?: number | null; - sponsorTransferTimeout?: number | null; - sponsorApproveTimeout?: number | null; - ownerCanTransfer?: boolean | null; - ownerCanDestroy?: boolean | null; - transfersEnabled?: boolean | null; -} - -interface INestingPermissions { - tokenOwner?: boolean; - collectionAdmin?: boolean; - restricted?: number[] | null; -} - -interface ICollectionPermissions { - access?: 'Normal' | 'AllowList'; - mintMode?: boolean; - nesting?: INestingPermissions; -} - -interface IProperty { - key: string; - value: string; -} - -interface ITokenPropertyPermission { - key: string; - permission: { - mutable: boolean; - tokenOwner: boolean; - collectionAdmin: boolean; - } -} - -interface IToken { - collectionId: number; - tokenId: number; -} - -interface ICollectionCreationOptions { - name: string | number[]; - description: string | number[]; - tokenPrefix: string | number[]; - mode?: { - nft?: null; - refungible?: null; - fungible?: number; - } - permissions?: ICollectionPermissions; - properties?: IProperty[]; - tokenPropertyPermissions?: ITokenPropertyPermission[]; - limits?: ICollectionLimits; - pendingSponsor?: TSubstrateAccount; -} - -interface IChainProperties { - ss58Format: number; - tokenDecimals: number[]; - tokenSymbol: string[] -} - -type TSubstrateAccount = string; -type TEthereumAccount = string; -type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated'; -type TUniqueNetworks = 'opal' | 'quartz' | 'unique'; -type TSigner = IKeyringPair; // | 'string' - class UniqueUtil { static transactionStatus = { NOT_READY: 'NotReady', From 15ab5917359382053f721722e6307bfb91ccffba Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Wed, 24 Aug 2022 13:50:36 +0000 Subject: [PATCH 0523/1274] remove duplicated interfaces --- tests/src/util/playgrounds/unique.ts | 43 ++-------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 0aa2653703..f667261476 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -7,10 +7,9 @@ import {ApiPromise, WsProvider, Keyring} from '@polkadot/api'; import {ApiInterfaceEvents} from '@polkadot/api/types'; -import {IKeyringPair} from '@polkadot/types/types'; import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto'; -import { ICrossAccountIdLower, ICrossAccountId, TUniqueNetworks, IApiListeners, TApiAllowedListeners, TSigner, TSubstrateAccount, ICollectionLimits, ICollectionPermissions, INestingPermissions, IProperty, ITokenPropertyPermission, ICollectionCreationOptions, IToken, IChainProperties, TEthereumAccount } from './types'; - +import {IKeyringPair} from '@polkadot/types/types'; +import {IApiListeners, IChainEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => { const address = {} as ICrossAccountId; @@ -45,44 +44,6 @@ const nesting = { }, }; - -interface IChainEvent { - data: any; - method: string; - section: string; -} - -interface ITransactionResult { - status: 'Fail' | 'Success'; - result: { - events: { - event: IChainEvent - }[]; - }, - moduleError?: string; -} - -interface ILogger { - log: (msg: any, level?: string) => void; - level: { - ERROR: 'ERROR'; - WARNING: 'WARNING'; - INFO: 'INFO'; - [key: string]: string; - } -} - -interface IUniqueHelperLog { - executedAt: number; - executionTime: number; - type: 'extrinsic' | 'rpc'; - status: 'Fail' | 'Success'; - call: string; - params: any[]; - moduleError?: string; - events?: any; -} - class UniqueUtil { static transactionStatus = { NOT_READY: 'NotReady', From e1ae4a6cdf40bc2a37981a011a46e7115e882041 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Wed, 24 Aug 2022 13:52:24 +0000 Subject: [PATCH 0524/1274] add collection allow-list methods to playgrounds --- tests/src/util/playgrounds/unique.ts | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index f667261476..0c2aabe759 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -524,6 +524,22 @@ class CollectionGroup extends HelperGroup { return normalized; } + /** + * Get the normalized addresses added to the collection allow-list. + * @param collectionId ID of collection + * @example await getAllowList(1) + * @returns array of allow-listed addresses + */ + async getAllowList(collectionId: number): Promise { + const normalized = []; + const allowListed = (await this.helper.callRpc('api.rpc.unique.allowlist', [collectionId])).toHuman(); + for (const address of allowListed) { + if (address.Substrate) normalized.push({Substrate: this.helper.address.normalizeSubstrate(address.Substrate)}); + else normalized.push(address); + } + return normalized; + } + /** * Get the effective limits of the collection instead of null for default values * @@ -667,6 +683,25 @@ class CollectionGroup extends HelperGroup { return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionAdminAdded', label); } + /** + * Adds an address to allow list + * @param signer keyring of signer + * @param collectionId ID of collection + * @param addressObj address to add to the allow list + * @param label extra label for log + * @returns ```true``` if extrinsic success, otherwise ```false``` + */ + async addToAllowList(signer: TSigner, collectionId: number, addressObj: ICrossAccountId, label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.addToAllowList', [collectionId, addressObj], + true, `Unable to add address to allow list for ${label}`, + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'AllowListAddressAdded'); + } + /** * Removes a collection administrator. * @@ -1992,6 +2027,10 @@ class UniqueCollectionBase { return await this.helper.collection.getAdmins(this.collectionId); } + async getAllowList() { + return await this.helper.collection.getAllowList(this.collectionId); + } + async getEffectiveLimits() { return await this.helper.collection.getEffectiveLimits(this.collectionId); } @@ -2016,6 +2055,10 @@ class UniqueCollectionBase { return await this.helper.collection.addAdmin(signer, this.collectionId, adminAddressObj, label); } + async addToAllowList(signer: TSigner, addressObj: ICrossAccountId, label?: string) { + return await this.helper.collection.addToAllowList(signer, this.collectionId, addressObj, label); + } + async removeAdmin(signer: TSigner, adminAddressObj: ICrossAccountId, label?: string) { return await this.helper.collection.removeAdmin(signer, this.collectionId, adminAddressObj, label); } From c396bdd22f0e3080cb0b3e66780ff7e7e253ad15 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 2 Aug 2022 14:13:47 +0000 Subject: [PATCH 0525/1274] refactor: Chage Owner storage value type H160 -> CrossAccountId BREAKING CHANGE: changed `fn allowed` signature --- pallets/evm-contract-helpers/src/eth.rs | 22 ++++++---- pallets/evm-contract-helpers/src/lib.rs | 56 +++++++++++++++++++++---- 2 files changed, 63 insertions(+), 15 deletions(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index e4e6375f81..041fd8a64a 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -15,8 +15,13 @@ // along with Unique Network. If not, see . use core::marker::PhantomData; -use evm_coder::{abi::AbiWriter, execution::Result, generate_stubgen, solidity_interface, types::*}; -use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder}; +use evm_coder::{ + abi::AbiWriter, + execution::{Result, Error}, + generate_stubgen, solidity_interface, + types::*, +}; +use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder, dispatch_to_evm}; use pallet_evm::{ ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure, PrecompileHandle, account::CrossAccountId, @@ -43,7 +48,10 @@ impl WithRecorder for ContractHelpers { #[solidity_interface(name = "ContractHelpers")] impl ContractHelpers { fn contract_owner(&self, contract_address: address) -> Result

{ - Ok(>::get(contract_address)) + Ok(>::contract_owner(contract_address) + .map_err(dispatch_to_evm::)? + .as_eth() + .clone()) } fn sponsoring_enabled(&self, contract_address: address) -> Result { @@ -97,7 +105,7 @@ impl ContractHelpers { fn allowed(&self, contract_address: address, user: address) -> Result { self.0.consume_sload()?; - Ok(>::allowed(contract_address, user)) + Ok(>::allowed(contract_address, T::CrossAccountId::from_eth(user))) } fn allowlist_enabled(&self, contract_address: address) -> Result { @@ -141,7 +149,7 @@ impl OnMethodCall for HelpersOnMethodCall { fn call(handle: &mut impl PrecompileHandle) -> Option { // TODO: Extract to another OnMethodCall handler if >::get(handle.code_address()) - && !>::allowed(handle.code_address(), handle.context().caller) + && !>::allowed(handle.code_address(), T::CrossAccountId::from_eth(handle.context().caller)) { return Some(Err(PrecompileFailure::Revert { exit_status: ExitRevert::Reverted, @@ -170,7 +178,7 @@ impl OnMethodCall for HelpersOnMethodCall { pub struct HelpersOnCreate(PhantomData<*const T>); impl OnCreate for HelpersOnCreate { fn on_create(owner: H160, contract: H160) { - >::insert(contract, owner); + >::insert(contract, T::CrossAccountId::from_eth(owner)); } } @@ -184,7 +192,7 @@ impl SponsorshipHandler)> return None; } - if mode == SponsoringModeT::Allowlisted && !>::allowed(call.0, *who.as_eth()) { + if mode == SponsoringModeT::Allowlisted && !>::allowed(call.0, who.clone()) { return None; } let block_number = >::block_number() as T::BlockNumber; diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index e18866cd9a..f86b3decd2 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -15,6 +15,7 @@ // along with Unique Network. If not, see . #![cfg_attr(not(feature = "std"), no_std)] +#![feature(is_some_with)] use codec::{Decode, Encode, MaxEncodedLen}; pub use pallet::*; @@ -25,9 +26,10 @@ pub mod eth; #[frame_support::pallet] pub mod pallet { pub use super::*; - use evm_coder::execution::Result; use frame_support::pallet_prelude::*; use sp_core::H160; + use pallet_evm::account::CrossAccountId; + use frame_system::pallet_prelude::BlockNumberFor; #[pallet::config] pub trait Config: @@ -39,17 +41,31 @@ pub mod pallet { #[pallet::error] pub enum Error { - /// This method is only executable by owner + /// This method is only executable by owner. NoPermission, + + /// Contract has no owner. + NoContractOwner, } + const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); + #[pallet::pallet] + #[pallet::storage_version(STORAGE_VERSION)] #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); + /// Store owner for contract. + /// + /// * **Key** - contract address. + /// * **Value** - owner for contract. #[pallet::storage] - pub(super) type Owner = - StorageMap; + pub(super) type Owner = StorageMap< + Hasher = Twox128, + Key = H160, + Value = T::CrossAccountId, + QueryKind = OptionQuery, + >; #[pallet::storage] #[deprecated] @@ -57,10 +73,12 @@ pub mod pallet { StorageMap; #[pallet::storage] + #[deprecated] pub(super) type SponsoringMode = StorageMap; #[pallet::storage] + #[deprecated] pub(super) type SponsoringRateLimit = StorageMap< Hasher = Twox128, Key = H160, @@ -70,6 +88,7 @@ pub mod pallet { >; #[pallet::storage] + #[deprecated] pub(super) type SponsorBasket = StorageDoubleMap< Hasher1 = Twox128, Key1 = H160, @@ -80,10 +99,12 @@ pub mod pallet { >; #[pallet::storage] + #[deprecated] pub(super) type AllowlistEnabled = StorageMap; #[pallet::storage] + #[deprecated] pub(super) type Allowlist = StorageDoubleMap< Hasher1 = Twox128, Key1 = H160, @@ -93,6 +114,18 @@ pub mod pallet { QueryKind = ValueQuery, >; + #[pallet::hooks] + impl Hooks> for Pallet { + fn on_runtime_upgrade() -> Weight { + let storage_version = StorageVersion::get::>(); + if storage_version < StorageVersion::new(1) { + >::translate_values::(|address| Some(T::CrossAccountId::from_eth(address))); + } + + 0 + } + } + impl Pallet { pub fn sponsoring_mode(contract: H160) -> SponsoringModeT { >::get(contract) @@ -125,8 +158,9 @@ pub mod pallet { >::insert(contract, rate_limit); } - pub fn allowed(contract: H160, user: H160) -> bool { - >::get(&contract, &user) || >::get(&contract) == user + pub fn allowed(contract: H160, user: T::CrossAccountId) -> bool { + >::get(&contract, user.as_eth()) + || Pallet::::contract_owner(contract).is_ok_and(|owner| *owner == user) } pub fn toggle_allowlist(contract: H160, enabled: bool) { @@ -137,11 +171,17 @@ pub mod pallet { >::insert(contract, user, allowed); } - pub fn ensure_owner(contract: H160, user: H160) -> Result<()> { - ensure!(>::get(&contract) == user, "no permission"); + pub fn ensure_owner(contract: H160, user: H160) -> evm_coder::execution::Result<()> { + ensure!(Pallet::::contract_owner(contract).is_ok_and(|owner| *owner.as_eth() == user), "no permission"); Ok(()) } } + + impl Pallet { + pub fn contract_owner(contract: H160) -> Result { + Ok(>::get(contract).ok_or::>(Error::NoContractOwner)?) + } + } } #[derive(Encode, Decode, PartialEq, TypeInfo, MaxEncodedLen)] From d144cc6cfeaa5a033741a075dc9979f127ee1fce Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 2 Aug 2022 15:16:31 +0000 Subject: [PATCH 0526/1274] docs --- pallets/evm-contract-helpers/src/lib.rs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index f86b3decd2..fb70bfb8a8 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -72,13 +72,22 @@ pub mod pallet { pub(super) type SelfSponsoring = StorageMap; + /// Store for sponsoring mode. + /// + /// ### Usage + /// Prefer to delete collection from storage if mode chaged to [`Disabled`](SponsoringModeT::Disabled). + /// + /// * **Key** - contract address. + /// * **Value** - [`sponsoring mode`](SponsoringModeT). #[pallet::storage] - #[deprecated] pub(super) type SponsoringMode = StorageMap; + /// Storage for sponsoring rate limit in blocks. + /// + /// * **Key** - contract address. + /// * **Value** - amount of sponsored blocks. #[pallet::storage] - #[deprecated] pub(super) type SponsoringRateLimit = StorageMap< Hasher = Twox128, Key = H160, @@ -98,8 +107,14 @@ pub mod pallet { QueryKind = OptionQuery, >; + /// Storege for contracts with [`Allowlisted`](SponsoringModeT::Allowlisted) sponsoring mode. + /// + /// ### Usage + /// Prefer to delete collection from storage if mode chaged to non `Allowlisted`, than set **Value** to **false**. + /// + /// * **Key** - contract address. + /// * **Value** - is contract in [`Allowlisted`](SponsoringModeT::Allowlisted) mode. #[pallet::storage] - #[deprecated] pub(super) type AllowlistEnabled = StorageMap; From 6fbb7219f087c55e9c5183f81960ecda931884dc Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 3 Aug 2022 06:09:39 +0000 Subject: [PATCH 0527/1274] misk: revert owners storage --- pallets/evm-contract-helpers/src/eth.rs | 34 ++++++++++++------------- pallets/evm-contract-helpers/src/lib.rs | 24 ++++++----------- 2 files changed, 24 insertions(+), 34 deletions(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 041fd8a64a..b3a86cb300 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -48,10 +48,7 @@ impl WithRecorder for ContractHelpers { #[solidity_interface(name = "ContractHelpers")] impl ContractHelpers { fn contract_owner(&self, contract_address: address) -> Result
{ - Ok(>::contract_owner(contract_address) - .map_err(dispatch_to_evm::)? - .as_eth() - .clone()) + Ok(>::get(contract_address)) } fn sponsoring_enabled(&self, contract_address: address) -> Result { @@ -65,7 +62,7 @@ impl ContractHelpers { contract_address: address, enabled: bool, ) -> Result { - >::ensure_owner(contract_address, caller)?; + >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; >::toggle_sponsoring(contract_address, enabled); Ok(()) } @@ -76,7 +73,7 @@ impl ContractHelpers { contract_address: address, mode: uint8, ) -> Result { - >::ensure_owner(contract_address, caller)?; + >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; let mode = SponsoringModeT::from_eth(mode).ok_or("unknown mode")?; >::set_sponsoring_mode(contract_address, mode); Ok(()) @@ -92,7 +89,7 @@ impl ContractHelpers { contract_address: address, rate_limit: uint32, ) -> Result { - >::ensure_owner(contract_address, caller)?; + >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; >::set_sponsoring_rate_limit(contract_address, rate_limit.into()); Ok(()) } @@ -105,7 +102,7 @@ impl ContractHelpers { fn allowed(&self, contract_address: address, user: address) -> Result { self.0.consume_sload()?; - Ok(>::allowed(contract_address, T::CrossAccountId::from_eth(user))) + Ok(>::allowed(contract_address, user)) } fn allowlist_enabled(&self, contract_address: address) -> Result { @@ -118,7 +115,7 @@ impl ContractHelpers { contract_address: address, enabled: bool, ) -> Result { - >::ensure_owner(contract_address, caller)?; + >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; >::toggle_allowlist(contract_address, enabled); Ok(()) } @@ -130,7 +127,7 @@ impl ContractHelpers { user: address, allowed: bool, ) -> Result { - >::ensure_owner(contract_address, caller)?; + >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; >::toggle_allowed(contract_address, user, allowed); Ok(()) } @@ -149,7 +146,7 @@ impl OnMethodCall for HelpersOnMethodCall { fn call(handle: &mut impl PrecompileHandle) -> Option { // TODO: Extract to another OnMethodCall handler if >::get(handle.code_address()) - && !>::allowed(handle.code_address(), T::CrossAccountId::from_eth(handle.context().caller)) + && !>::allowed(handle.code_address(), handle.context().caller) { return Some(Err(PrecompileFailure::Revert { exit_status: ExitRevert::Reverted, @@ -178,7 +175,7 @@ impl OnMethodCall for HelpersOnMethodCall { pub struct HelpersOnCreate(PhantomData<*const T>); impl OnCreate for HelpersOnCreate { fn on_create(owner: H160, contract: H160) { - >::insert(contract, T::CrossAccountId::from_eth(owner)); + >::insert(contract, owner); } } @@ -187,18 +184,19 @@ impl SponsorshipHandler)> for HelpersContractSponsoring { fn get_sponsor(who: &T::CrossAccountId, call: &(H160, Vec)) -> Option { - let mode = >::sponsoring_mode(call.0); + let (contract, _) = call; + let mode = >::sponsoring_mode(*contract); if mode == SponsoringModeT::Disabled { return None; } - if mode == SponsoringModeT::Allowlisted && !>::allowed(call.0, who.clone()) { + if mode == SponsoringModeT::Allowlisted && !>::allowed(*contract, *who.as_eth()) { return None; } let block_number = >::block_number() as T::BlockNumber; - if let Some(last_tx_block) = >::get(&call.0, who.as_eth()) { - let limit = >::get(&call.0); + if let Some(last_tx_block) = >::get(contract, who.as_eth()) { + let limit = >::get(contract); let timeout = last_tx_block + limit; if block_number < timeout { @@ -206,9 +204,9 @@ impl SponsorshipHandler)> } } - >::insert(&call.0, who.as_eth(), block_number); + >::insert(contract, who.as_eth(), block_number); - let sponsor = T::CrossAccountId::from_eth(call.0); + let sponsor = T::CrossAccountId::from_eth(*contract); Some(sponsor) } } diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index fb70bfb8a8..0adc7f962b 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -60,12 +60,8 @@ pub mod pallet { /// * **Key** - contract address. /// * **Value** - owner for contract. #[pallet::storage] - pub(super) type Owner = StorageMap< - Hasher = Twox128, - Key = H160, - Value = T::CrossAccountId, - QueryKind = OptionQuery, - >; + pub(super) type Owner = + StorageMap; #[pallet::storage] #[deprecated] @@ -97,7 +93,6 @@ pub mod pallet { >; #[pallet::storage] - #[deprecated] pub(super) type SponsorBasket = StorageDoubleMap< Hasher1 = Twox128, Key1 = H160, @@ -119,7 +114,6 @@ pub mod pallet { StorageMap; #[pallet::storage] - #[deprecated] pub(super) type Allowlist = StorageDoubleMap< Hasher1 = Twox128, Key1 = H160, @@ -134,7 +128,6 @@ pub mod pallet { fn on_runtime_upgrade() -> Weight { let storage_version = StorageVersion::get::>(); if storage_version < StorageVersion::new(1) { - >::translate_values::(|address| Some(T::CrossAccountId::from_eth(address))); } 0 @@ -173,9 +166,8 @@ pub mod pallet { >::insert(contract, rate_limit); } - pub fn allowed(contract: H160, user: T::CrossAccountId) -> bool { - >::get(&contract, user.as_eth()) - || Pallet::::contract_owner(contract).is_ok_and(|owner| *owner == user) + pub fn allowed(contract: H160, user: H160) -> bool { + >::get(&contract, &user) || >::get(&contract) == user } pub fn toggle_allowlist(contract: H160, enabled: bool) { @@ -186,15 +178,15 @@ pub mod pallet { >::insert(contract, user, allowed); } - pub fn ensure_owner(contract: H160, user: H160) -> evm_coder::execution::Result<()> { - ensure!(Pallet::::contract_owner(contract).is_ok_and(|owner| *owner.as_eth() == user), "no permission"); + pub fn ensure_owner(contract: H160, user: H160) -> DispatchResult { + ensure!(>::get(&contract) == user, Error::::NoPermission); Ok(()) } } impl Pallet { - pub fn contract_owner(contract: H160) -> Result { - Ok(>::get(contract).ok_or::>(Error::NoContractOwner)?) + pub fn contract_owner(contract: H160) -> H160 { + >::get(contract) } } } From f96d4840cdf2d7b31b8beecd446e4e7ed56fab46 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 3 Aug 2022 15:48:32 +0000 Subject: [PATCH 0528/1274] path: Add sponsorship for CrossAccountId. --- pallets/evm-contract-helpers/src/eth.rs | 33 +++++++++++- pallets/evm-contract-helpers/src/lib.rs | 69 +++++++++++++++++++++---- 2 files changed, 91 insertions(+), 11 deletions(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index b3a86cb300..7b8d16bc1e 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -51,6 +51,33 @@ impl ContractHelpers { Ok(>::get(contract_address)) } + fn set_sponsor( + &mut self, + caller: caller, + contract_address: address, + sponsor: address, + ) -> Result { + Pallet::::set_sponsor( + &T::CrossAccountId::from_eth(caller), + contract_address, + &T::CrossAccountId::from_eth(sponsor), + ) + .map_err(dispatch_to_evm::)?; + Ok(()) + } + + fn confirm_sponsorship(&mut self, caller: caller, contract_address: address) -> Result { + Pallet::::confirm_sponsorship(&T::CrossAccountId::from_eth(caller), contract_address) + .map_err(dispatch_to_evm::)?; + Ok(()) + } + + fn get_sponsor(&self, contract_address: address) -> Result
{ + let sponsor = + Pallet::::get_sponsor(contract_address).ok_or("Contract has no sponsor")?; + Ok(*sponsor.as_eth()) + } + fn sponsoring_enabled(&self, contract_address: address) -> Result { Ok(>::sponsoring_mode(contract_address) != SponsoringModeT::Disabled) } @@ -190,6 +217,11 @@ impl SponsorshipHandler)> return None; } + let sponsor = match >::get_sponsor(*contract) { + Some(sponsor) => sponsor, + None => return None, + }; + if mode == SponsoringModeT::Allowlisted && !>::allowed(*contract, *who.as_eth()) { return None; } @@ -206,7 +238,6 @@ impl SponsorshipHandler)> >::insert(contract, who.as_eth(), block_number); - let sponsor = T::CrossAccountId::from_eth(*contract); Some(sponsor) } } diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index 0adc7f962b..0887af0e80 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -15,7 +15,6 @@ // along with Unique Network. If not, see . #![cfg_attr(not(feature = "std"), no_std)] -#![feature(is_some_with)] use codec::{Decode, Encode, MaxEncodedLen}; pub use pallet::*; @@ -27,9 +26,11 @@ pub mod eth; pub mod pallet { pub use super::*; use frame_support::pallet_prelude::*; + use pallet_evm_coder_substrate::DispatchResult; use sp_core::H160; use pallet_evm::account::CrossAccountId; use frame_system::pallet_prelude::BlockNumberFor; + use up_data_structs::SponsorshipState; #[pallet::config] pub trait Config: @@ -44,8 +45,8 @@ pub mod pallet { /// This method is only executable by owner. NoPermission, - /// Contract has no owner. - NoContractOwner, + /// No pending sponsor for contract. + NoPendingSponsor, } const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); @@ -68,11 +69,19 @@ pub mod pallet { pub(super) type SelfSponsoring = StorageMap; + #[pallet::storage] + pub(super) type Sponsoring = StorageMap< + Hasher = Twox128, + Key = H160, + Value = SponsorshipState, + QueryKind = ValueQuery, + >; + /// Store for sponsoring mode. - /// + /// /// ### Usage /// Prefer to delete collection from storage if mode chaged to [`Disabled`](SponsoringModeT::Disabled). - /// + /// /// * **Key** - contract address. /// * **Value** - [`sponsoring mode`](SponsoringModeT). #[pallet::storage] @@ -80,7 +89,7 @@ pub mod pallet { StorageMap; /// Storage for sponsoring rate limit in blocks. - /// + /// /// * **Key** - contract address. /// * **Value** - amount of sponsored blocks. #[pallet::storage] @@ -103,16 +112,24 @@ pub mod pallet { >; /// Storege for contracts with [`Allowlisted`](SponsoringModeT::Allowlisted) sponsoring mode. - /// + /// /// ### Usage /// Prefer to delete collection from storage if mode chaged to non `Allowlisted`, than set **Value** to **false**. - /// + /// /// * **Key** - contract address. /// * **Value** - is contract in [`Allowlisted`](SponsoringModeT::Allowlisted) mode. #[pallet::storage] pub(super) type AllowlistEnabled = StorageMap; + /// Storage for users that allowed for sponsorship. + /// + /// ### Usage + /// Prefer to delete record from storage if user no more allowed for sponsorship. + /// + /// * **Key1** - contract address. + /// * **Key2** - user that allowed for sponsorship. + /// * **Value** - allowance for sponsorship. #[pallet::storage] pub(super) type Allowlist = StorageDoubleMap< Hasher1 = Twox128, @@ -127,14 +144,45 @@ pub mod pallet { impl Hooks> for Pallet { fn on_runtime_upgrade() -> Weight { let storage_version = StorageVersion::get::>(); - if storage_version < StorageVersion::new(1) { - } + if storage_version < StorageVersion::new(1) {} 0 } } impl Pallet { + pub fn set_sponsor( + sender: &T::CrossAccountId, + contract: H160, + sponsor: &T::CrossAccountId, + ) -> DispatchResult { + Pallet::::ensure_owner(contract, *sender.as_eth())?; + Sponsoring::::insert( + contract, + SponsorshipState::::Unconfirmed(sponsor.clone()), + ); + Ok(()) + } + + pub fn confirm_sponsorship(sender: &T::CrossAccountId, contract: H160) -> DispatchResult { + match Sponsoring::::get(contract) { + SponsorshipState::Unconfirmed(sponsor) => { + ensure!(sponsor == *sender, Error::::NoPermission); + Ok(()) + } + SponsorshipState::Disabled | SponsorshipState::Confirmed(_) => { + Err(Error::::NoPendingSponsor.into()) + } + } + } + + pub fn get_sponsor(contract: H160) -> Option { + match Sponsoring::::get(contract) { + SponsorshipState::Disabled | SponsorshipState::Unconfirmed(_) => None, + SponsorshipState::Confirmed(sponsor) => Some(sponsor), + } + } + pub fn sponsoring_mode(contract: H160) -> SponsoringModeT { >::get(contract) .or_else(|| { @@ -142,6 +190,7 @@ pub mod pallet { }) .unwrap_or_default() } + pub fn set_sponsoring_mode(contract: H160, mode: SponsoringModeT) { if mode == SponsoringModeT::Disabled { >::remove(contract); From 14eb87cf32d1ac725b20a915f2380b928a4b5343 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 4 Aug 2022 07:23:26 +0000 Subject: [PATCH 0529/1274] path: Impl AbiWrite for tuples --- crates/evm-coder/src/abi.rs | 48 ++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/crates/evm-coder/src/abi.rs b/crates/evm-coder/src/abi.rs index b63c93b473..8915f0f15e 100644 --- a/crates/evm-coder/src/abi.rs +++ b/crates/evm-coder/src/abi.rs @@ -328,7 +328,7 @@ where } } -macro_rules! impl_tuples { +macro_rules! impl_tuples_abi_reader { ($($ident:ident)+) => { impl<$($ident),+> sealed::CanBePlacedInVec for ($($ident,)+) {} impl<$($ident),+> AbiRead<($($ident,)+)> for AbiReader<'_> @@ -345,16 +345,16 @@ macro_rules! impl_tuples { }; } -impl_tuples! {A} -impl_tuples! {A B} -impl_tuples! {A B C} -impl_tuples! {A B C D} -impl_tuples! {A B C D E} -impl_tuples! {A B C D E F} -impl_tuples! {A B C D E F G} -impl_tuples! {A B C D E F G H} -impl_tuples! {A B C D E F G H I} -impl_tuples! {A B C D E F G H I J} +impl_tuples_abi_reader! {A} +impl_tuples_abi_reader! {A B} +impl_tuples_abi_reader! {A B C} +impl_tuples_abi_reader! {A B C D} +impl_tuples_abi_reader! {A B C D E} +impl_tuples_abi_reader! {A B C D E F} +impl_tuples_abi_reader! {A B C D E F G} +impl_tuples_abi_reader! {A B C D E F G H} +impl_tuples_abi_reader! {A B C D E F G H I} +impl_tuples_abi_reader! {A B C D E F G H I J} pub trait AbiWrite { fn abi_write(&self, writer: &mut AbiWriter); @@ -422,6 +422,32 @@ impl AbiWrite for () { fn abi_write(&self, _writer: &mut AbiWriter) {} } +macro_rules! impl_tuples_abi_writer { + ($($ident:ident)+) => { + #[allow(non_snake_case)] + impl<$($ident),+> AbiWrite for &($($ident,)+) + where + $($ident: AbiWrite,)+ + { + fn abi_write(&self, writer: &mut AbiWriter) { + let ($($ident,)+) = self; + $($ident.abi_write(writer);)+ + } + } + }; +} + +impl_tuples_abi_writer! {A} +impl_tuples_abi_writer! {A B} +impl_tuples_abi_writer! {A B C} +impl_tuples_abi_writer! {A B C D} +impl_tuples_abi_writer! {A B C D E} +impl_tuples_abi_writer! {A B C D E F} +impl_tuples_abi_writer! {A B C D E F G} +impl_tuples_abi_writer! {A B C D E F G H} +impl_tuples_abi_writer! {A B C D E F G H I} +impl_tuples_abi_writer! {A B C D E F G H I J} + #[macro_export] macro_rules! abi_decode { ($reader:expr, $($name:ident: $typ:ident),+ $(,)?) => { From ce257eae23740473965217cd73c9d5312cf82f56 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 24 Aug 2022 16:13:59 +0300 Subject: [PATCH 0530/1274] fix: comment launch of readyness check --- .github/workflows/nodes-only-update.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index 2165536d20..6f009a9bb5 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -77,7 +77,7 @@ jobs: steps: - - name: Skip if pull request is in Draft +# - name: Skip if pull request is in Draft # `if: github.event.pull_request.draft == true` should be kept here, at # the step level, rather than at the job level. The latter is not # recommended because when the PR is moved from "Draft" to "Ready to @@ -92,8 +92,8 @@ jobs: # 4. Move it to "Ready for review"; now the workflow is passing (it was # skipped) and "Check reviews" is also passing (it won't be updated # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 +# if: github.event.pull_request.draft == true +# run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 @@ -196,7 +196,7 @@ jobs: yarn install yarn add mochawesome echo "Ready to start tests" - node scripts/readyness.js +# node scripts/readyness.js NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ @@ -272,7 +272,7 @@ jobs: yarn install yarn add mochawesome echo "Ready to start tests" - node scripts/readyness.js +# node scripts/readyness.js NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ From 1ec825011bb99ed9b463fdb5153e4d0a0baae928 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 24 Aug 2022 16:20:41 +0300 Subject: [PATCH 0531/1274] fix: comments inside steps not supported --- .github/workflows/nodes-only-update.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index 6f009a9bb5..a1cdba0a62 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -196,7 +196,6 @@ jobs: yarn install yarn add mochawesome echo "Ready to start tests" -# node scripts/readyness.js NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ @@ -272,7 +271,6 @@ jobs: yarn install yarn add mochawesome echo "Ready to start tests" -# node scripts/readyness.js NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ From cdbbf0967c68ecd98e7d6287c48b5e53392d37fe Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 24 Aug 2022 16:45:26 +0300 Subject: [PATCH 0532/1274] fix: enable draft mode fot nodes only tests --- .github/workflows/nodes-only-update.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index a1cdba0a62..0dee535dd4 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -77,7 +77,7 @@ jobs: steps: -# - name: Skip if pull request is in Draft + - name: Skip if pull request is in Draft # `if: github.event.pull_request.draft == true` should be kept here, at # the step level, rather than at the job level. The latter is not # recommended because when the PR is moved from "Draft" to "Ready to @@ -92,8 +92,8 @@ jobs: # 4. Move it to "Ready for review"; now the workflow is passing (it was # skipped) and "Check reviews" is also passing (it won't be updated # until the workflow is finished) -# if: github.event.pull_request.draft == true -# run: exit 1 + if: github.event.pull_request.draft == true + run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 From e50c7257388ca0b363af7081c9ddae4286f32701 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 4 Aug 2022 13:04:01 +0000 Subject: [PATCH 0533/1274] path: Return sponsor as a tuple. --- crates/evm-coder/src/abi.rs | 2 +- pallets/common/src/eth.rs | 10 ++++++++++ pallets/evm-contract-helpers/src/eth.rs | 25 ++++++++++++++----------- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/crates/evm-coder/src/abi.rs b/crates/evm-coder/src/abi.rs index 8915f0f15e..abe0c7b0eb 100644 --- a/crates/evm-coder/src/abi.rs +++ b/crates/evm-coder/src/abi.rs @@ -425,7 +425,7 @@ impl AbiWrite for () { macro_rules! impl_tuples_abi_writer { ($($ident:ident)+) => { #[allow(non_snake_case)] - impl<$($ident),+> AbiWrite for &($($ident,)+) + impl<$($ident),+> AbiWrite for &($($ident,)+) where $($ident: AbiWrite,)+ { diff --git a/pallets/common/src/eth.rs b/pallets/common/src/eth.rs index bf74dfe763..36437dc75c 100644 --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -52,6 +52,16 @@ pub fn is_collection(address: &H160) -> bool { address[0..16] == ETH_COLLECTION_PREFIX } +/// Convert `CrossAccountId` to `uint256`. +pub fn convert_cross_account_to_eth_uint256(from: &T::CrossAccountId) -> uint256 +where + T::AccountId: AsRef<[u8]>, +{ + use pallet_evm::account::CrossAccountId; + let slice = from.as_sub().as_ref(); + uint256::from_big_endian(slice) +} + /// Converts Substrate address to CrossAccountId pub fn convert_substrate_address_to_cross_account_id( address: uint256, diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 7b8d16bc1e..67155baa9f 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -15,12 +15,7 @@ // along with Unique Network. If not, see . use core::marker::PhantomData; -use evm_coder::{ - abi::AbiWriter, - execution::{Result, Error}, - generate_stubgen, solidity_interface, - types::*, -}; +use evm_coder::{abi::AbiWriter, execution::Result, generate_stubgen, solidity_interface, types::*}; use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder, dispatch_to_evm}; use pallet_evm::{ ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure, PrecompileHandle, @@ -46,7 +41,10 @@ impl WithRecorder for ContractHelpers { } #[solidity_interface(name = "ContractHelpers")] -impl ContractHelpers { +impl ContractHelpers +where + T::AccountId: AsRef<[u8]>, +{ fn contract_owner(&self, contract_address: address) -> Result
{ Ok(>::get(contract_address)) } @@ -72,17 +70,19 @@ impl ContractHelpers { Ok(()) } - fn get_sponsor(&self, contract_address: address) -> Result
{ + fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> { let sponsor = Pallet::::get_sponsor(contract_address).ok_or("Contract has no sponsor")?; - Ok(*sponsor.as_eth()) + let sponsor_sub = + pallet_common::eth::convert_cross_account_to_eth_uint256::(&sponsor); + Ok((*sponsor.as_eth(), sponsor_sub)) } fn sponsoring_enabled(&self, contract_address: address) -> Result { Ok(>::sponsoring_mode(contract_address) != SponsoringModeT::Disabled) } - /// Deprecated + /// Deprecated fn toggle_sponsoring( &mut self, caller: caller, @@ -161,7 +161,10 @@ impl ContractHelpers { } pub struct HelpersOnMethodCall(PhantomData<*const T>); -impl OnMethodCall for HelpersOnMethodCall { +impl OnMethodCall for HelpersOnMethodCall +where + T::AccountId: AsRef<[u8]>, +{ fn is_reserved(contract: &sp_core::H160) -> bool { contract == &T::ContractAddress::get() } From 3bb7d245f74128b5b27c864d9d97d3a59cd6cb03 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 4 Aug 2022 14:17:00 +0000 Subject: [PATCH 0534/1274] refactor: remove toggle_sponsoring BREAKING CHANGE --- pallets/evm-contract-helpers/src/eth.rs | 12 ------------ pallets/evm-contract-helpers/src/lib.rs | 11 ----------- 2 files changed, 23 deletions(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 67155baa9f..09d753621a 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -82,18 +82,6 @@ where Ok(>::sponsoring_mode(contract_address) != SponsoringModeT::Disabled) } - /// Deprecated - fn toggle_sponsoring( - &mut self, - caller: caller, - contract_address: address, - enabled: bool, - ) -> Result { - >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; - >::toggle_sponsoring(contract_address, enabled); - Ok(()) - } - fn set_sponsoring_mode( &mut self, caller: caller, diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index 0887af0e80..68f5f0541d 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -200,17 +200,6 @@ pub mod pallet { >::remove(contract) } - pub fn toggle_sponsoring(contract: H160, enabled: bool) { - Self::set_sponsoring_mode( - contract, - if enabled { - SponsoringModeT::Allowlisted - } else { - SponsoringModeT::Disabled - }, - ) - } - pub fn set_sponsoring_rate_limit(contract: H160, rate_limit: T::BlockNumber) { >::insert(contract, rate_limit); } From f5f392cb05f15a6de3853e96dd8ca90944dbe65f Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 5 Aug 2022 06:50:02 +0000 Subject: [PATCH 0535/1274] path: Fix tuple generation. --- crates/evm-coder/src/solidity.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/evm-coder/src/solidity.rs b/crates/evm-coder/src/solidity.rs index 6625fd0ec8..c182ac89d9 100644 --- a/crates/evm-coder/src/solidity.rs +++ b/crates/evm-coder/src/solidity.rs @@ -180,9 +180,16 @@ macro_rules! impl_tuples { fn is_simple() -> bool { false } + #[allow(unused_assignments)] fn solidity_default(writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result { write!(writer, "{}(", tc.collect_tuple::())?; + let mut first = true; $( + if !first { + write!(writer, ",")?; + } else { + first = false; + } <$ident>::solidity_default(writer, tc)?; )* write!(writer, ")") From 7a21c0bed6bb88d04bfc6bbe79dd280508ed56db Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 5 Aug 2022 07:39:57 +0000 Subject: [PATCH 0536/1274] path: Add has_sponsor function to solidity. Fix confirm_sponsorship. --- pallets/evm-contract-helpers/src/eth.rs | 7 +++++-- pallets/evm-contract-helpers/src/lib.rs | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 09d753621a..7b0bcd7f4e 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -73,11 +73,14 @@ where fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> { let sponsor = Pallet::::get_sponsor(contract_address).ok_or("Contract has no sponsor")?; - let sponsor_sub = - pallet_common::eth::convert_cross_account_to_eth_uint256::(&sponsor); + let sponsor_sub = pallet_common::eth::convert_cross_account_to_eth_uint256::(&sponsor); Ok((*sponsor.as_eth(), sponsor_sub)) } + fn has_sponsor(&self, contract_address: address) -> Result { + Ok(Pallet::::get_sponsor(contract_address).is_some()) + } + fn sponsoring_enabled(&self, contract_address: address) -> Result { Ok(>::sponsoring_mode(contract_address) != SponsoringModeT::Disabled) } diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index 68f5f0541d..bfea16fb03 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -168,6 +168,11 @@ pub mod pallet { match Sponsoring::::get(contract) { SponsorshipState::Unconfirmed(sponsor) => { ensure!(sponsor == *sender, Error::::NoPermission); + Sponsoring::::mutate_exists(contract, |state| { + *state = Some(SponsorshipState::::Confirmed( + sponsor.clone(), + )) + }); Ok(()) } SponsorshipState::Disabled | SponsorshipState::Confirmed(_) => { From 3daa4917a91b2ba2fcad714802d23efabe86d755 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 5 Aug 2022 09:22:53 +0000 Subject: [PATCH 0537/1274] patch: add has_pending_sponsor to evm --- pallets/evm-contract-helpers/src/eth.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 7b0bcd7f4e..e4746267ac 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -22,8 +22,9 @@ use pallet_evm::{ account::CrossAccountId, }; use sp_core::H160; +use up_data_structs::SponsorshipState; use crate::{ - AllowlistEnabled, Config, Owner, Pallet, SponsorBasket, SponsoringRateLimit, SponsoringModeT, + AllowlistEnabled, Config, Owner, Pallet, SponsorBasket, SponsoringRateLimit, SponsoringModeT, Sponsoring, }; use frame_support::traits::Get; use up_sponsorship::SponsorshipHandler; @@ -81,6 +82,13 @@ where Ok(Pallet::::get_sponsor(contract_address).is_some()) } + fn has_pending_sponsor(&self, contract_address: address) -> Result { + Ok(match Sponsoring::::get(contract_address) { + SponsorshipState::Disabled | SponsorshipState::Confirmed(_) => false, + SponsorshipState::Unconfirmed(_) => true, + }) + } + fn sponsoring_enabled(&self, contract_address: address) -> Result { Ok(>::sponsoring_mode(contract_address) != SponsoringModeT::Disabled) } From 1b2f0f9403a4804531f88c9dca20adfee1f62204 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 5 Aug 2022 12:00:18 +0000 Subject: [PATCH 0538/1274] patch: Fix broken test. Add some new tests. Move tests. --- tests/src/eth/collectionSponsoring.test.ts | 131 +++++++++- tests/src/eth/contractSponsoring.test.ts | 275 +++++++-------------- 2 files changed, 223 insertions(+), 183 deletions(-) diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index 61045fb924..1e7d9bf5f5 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -1,7 +1,8 @@ -import {addToAllowListExpectSuccess, confirmSponsorshipExpectSuccess, createCollectionExpectSuccess, enablePublicMintingExpectSuccess, setCollectionSponsorExpectSuccess} from '../util/helpers'; -import {itWeb3, createEthAccount, collectionIdToAddress, GAS_ARGS, normalizeEvents} from './util/helpers'; +import {addToAllowListExpectSuccess, confirmSponsorshipExpectSuccess, createCollectionExpectSuccess, enablePublicMintingExpectSuccess, getDetailedCollectionInfo, setCollectionSponsorExpectSuccess} from '../util/helpers'; +import {itWeb3, createEthAccount, collectionIdToAddress, GAS_ARGS, normalizeEvents, createEthAccountWithBalance, evmCollectionHelpers, getCollectionAddressFromResult, evmCollection, ethBalanceViaSub} from './util/helpers'; import nonFungibleAbi from './nonFungibleAbi.json'; import {expect} from 'chai'; +import { evmToAddress } from '@polkadot/util-crypto'; describe('evm collection sponsoring', () => { itWeb3('sponsors mint transactions', async ({web3, privateKeyWrapper}) => { @@ -36,4 +37,130 @@ describe('evm collection sponsoring', () => { }, ]); }); + + itWeb3('Sponsoring collection from evm address via access list', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelpers = evmCollectionHelpers(web3, owner); + let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner}); + let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; + const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format; + expect(collectionSub.sponsorship.isUnconfirmed).to.be.true; + expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); + + await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor}); + collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; + expect(collectionSub.sponsorship.isConfirmed).to.be.true; + expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + + const user = createEthAccount(web3); + const nextTokenId = await collectionEvm.methods.nextTokenId().call(); + expect(nextTokenId).to.be.equal('1'); + + const oldPermissions = (await getDetailedCollectionInfo(api, collectionId))!.permissions.toHuman(); + expect(oldPermissions.mintMode).to.be.false; + expect(oldPermissions.access).to.be.equal('Normal'); + + await collectionEvm.methods.setCollectionAccess(1 /*'AllowList'*/).send({from: owner}); + await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner}); + await collectionEvm.methods.setCollectionMintMode(true).send({from: owner}); + + const newPermissions = (await getDetailedCollectionInfo(api, collectionId))!.permissions.toHuman(); + expect(newPermissions.mintMode).to.be.true; + expect(newPermissions.access).to.be.equal('AllowList'); + + const ownerBalanceBefore = await ethBalanceViaSub(api, owner); + const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor); + + { + const nextTokenId = await collectionEvm.methods.nextTokenId().call(); + expect(nextTokenId).to.be.equal('1'); + const result = await collectionEvm.methods.mintWithTokenURI( + user, + nextTokenId, + 'Test URI', + ).send({from: user}); + const events = normalizeEvents(result.events); + + expect(events).to.be.deep.equal([ + { + address: collectionIdAddress, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: user, + tokenId: nextTokenId, + }, + }, + ]); + + const ownerBalanceAfter = await ethBalanceViaSub(api, owner); + const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor); + + expect(await collectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); + expect(ownerBalanceBefore).to.be.eq(ownerBalanceAfter); + expect(sponsorBalanceBefore > sponsorBalanceAfter).to.be.true; + } + }); + + itWeb3('Check that transaction via EVM spend money from sponsor address', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelpers = evmCollectionHelpers(web3, owner); + let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + result = await collectionEvm.methods.setCollectionSponsor(sponsor).send(); + let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; + const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format; + expect(collectionSub.sponsorship.isUnconfirmed).to.be.true; + expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); + const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress); + await sponsorCollection.methods.confirmCollectionSponsorship().send(); + collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; + expect(collectionSub.sponsorship.isConfirmed).to.be.true; + expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + + const user = createEthAccount(web3); + await collectionEvm.methods.addCollectionAdmin(user).send(); + + const ownerBalanceBefore = await ethBalanceViaSub(api, owner); + const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor); + + + const userCollectionEvm = evmCollection(web3, user, collectionIdAddress); + const nextTokenId = await userCollectionEvm.methods.nextTokenId().call(); + expect(nextTokenId).to.be.equal('1'); + result = await userCollectionEvm.methods.mintWithTokenURI( + user, + nextTokenId, + 'Test URI', + ).send(); + + const events = normalizeEvents(result.events); + const address = collectionIdToAddress(collectionId); + + expect(events).to.be.deep.equal([ + { + address, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: user, + tokenId: nextTokenId, + }, + }, + ]); + expect(await userCollectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); + + const ownerBalanceAfter = await ethBalanceViaSub(api, owner); + expect(ownerBalanceAfter).to.be.eq(ownerBalanceBefore); + const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor); + expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; + }); }); diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index d74e5790f0..388286374a 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -23,24 +23,8 @@ import { itWeb3, SponsoringMode, createEthAccount, - collectionIdToAddress, - GAS_ARGS, - normalizeEvents, - subToEth, - executeEthTxOnSub, - evmCollectionHelpers, - getCollectionAddressFromResult, - evmCollection, ethBalanceViaSub, } from './util/helpers'; -import { - addCollectionAdminExpectSuccess, - createCollectionExpectSuccess, - getDetailedCollectionInfo, - transferBalanceTo, -} from '../util/helpers'; -import nonFungibleAbi from './nonFungibleAbi.json'; -import getBalance from '../substrate/get-balance'; import {evmToAddress} from '@polkadot/util-crypto'; describe('Sponsoring EVM contracts', () => { @@ -62,39 +46,99 @@ describe('Sponsoring EVM contracts', () => { await expect(helpers.methods.setSponsoringMode(notOwner, SponsoringMode.Allowlisted).send({from: notOwner})).to.rejected; expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; }); + + itWeb3('Sponsor can be set by the address that deployed the contract', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.false; + await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected; + expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.true; + }); + + itWeb3('Sponsor can not be set by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.false; + await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).call({from: notOwner})).to.be.rejectedWith('NoPermission'); + expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.false; + }); - itWeb3('In generous mode, non-allowlisted user transaction will be sponsored', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); + itWeb3('Sponsorship can be confirmed by the address that pending as sponsor', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; + await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected; + await expect(helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor})).to.be.not.rejected; + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; + }); + + itWeb3('Sponsorship can not be confirmed by the address that not pending as sponsor', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const notSponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; + await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected; + await expect(helpers.methods.confirmSponsorship(flipper.options.address).call({from: notSponsor})).to.be.rejectedWith('NoPermission'); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; + }); + itWeb3('Get confirmed sponsor', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); + await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); + + const result = await helpers.methods.getSponsor(flipper.options.address).call(); + + expect(result[0]).to.be.eq(sponsor); + const sponsorSub = api.registry.createType('AccountId', '0x' + BigInt(result[1]).toString(16).padStart(64, '0')).toJSON(); + expect(sponsorSub).to.be.eq(evmToAddress(sponsor)); + }); + + itWeb3('In generous mode, non-allowlisted user transaction will be sponsored', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const flipper = await deployFlipper(web3, owner); const helpers = contractHelpers(web3, owner); - expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; + await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); + await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; + await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: owner}); await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner}); - expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.true; - - await transferBalanceToEth(api, alice, flipper.options.address); - const originalFlipperBalance = await web3.eth.getBalance(flipper.options.address); - expect(originalFlipperBalance).to.be.not.equal('0'); + const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor); + const callerBalanceBefore = await ethBalanceViaSub(api, caller); await flipper.methods.flip().send({from: caller}); expect(await flipper.methods.getValue().call()).to.be.true; - // Balance should be taken from flipper instead of caller - const balanceAfter = await web3.eth.getBalance(flipper.options.address); - expect(+balanceAfter).to.be.lessThan(+originalFlipperBalance); + // Balance should be taken from sponsor instead of caller + const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor); + const callerBalanceAfter = await ethBalanceViaSub(api, caller); + expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; + expect(callerBalanceAfter).to.be.eq(callerBalanceBefore); }); itWeb3('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should decrease (allowlisted)', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const caller = createEthAccount(web3); const flipper = await deployFlipper(web3, owner); @@ -103,22 +147,21 @@ describe('Sponsoring EVM contracts', () => { await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner}); await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner}); - expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Allowlisted).send({from: owner}); await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner}); - expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.true; - await transferBalanceToEth(api, alice, flipper.options.address); + await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); + await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); - const originalFlipperBalance = await web3.eth.getBalance(flipper.options.address); - expect(originalFlipperBalance).to.be.not.equal('0'); + const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor); + expect(sponsorBalanceBefore).to.be.not.equal('0'); await flipper.methods.flip().send({from: caller}); expect(await flipper.methods.getValue().call()).to.be.true; // Balance should be taken from flipper instead of caller - const balanceAfter = await web3.eth.getBalance(flipper.options.address); - expect(+balanceAfter).to.be.lessThan(+originalFlipperBalance); + const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor); + expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; }); itWeb3('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should not decrease (non-allowlisted)', async ({api, web3, privateKeyWrapper}) => { @@ -131,10 +174,8 @@ describe('Sponsoring EVM contracts', () => { const helpers = contractHelpers(web3, owner); - expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Allowlisted).send({from: owner}); await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner}); - expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.true; await transferBalanceToEth(api, alice, flipper.options.address); @@ -150,11 +191,9 @@ describe('Sponsoring EVM contracts', () => { }); itWeb3('Sponsoring is set, an address that has UNQ can send a transaction and it works. User balance should not change', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const originalCallerBalance = await web3.eth.getBalance(caller); const flipper = await deployFlipper(web3, owner); @@ -162,26 +201,27 @@ describe('Sponsoring EVM contracts', () => { await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner}); await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner}); - expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Allowlisted).send({from: owner}); await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner}); - expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.true; - await transferBalanceToEth(api, alice, flipper.options.address); + await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); + await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); - const originalFlipperBalance = await web3.eth.getBalance(flipper.options.address); - expect(originalFlipperBalance).to.be.not.equal('0'); + const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor); + const callerBalanceBefore = await ethBalanceViaSub(api, caller); await flipper.methods.flip().send({from: caller}); expect(await flipper.methods.getValue().call()).to.be.true; - expect(await web3.eth.getBalance(caller)).to.be.equals(originalCallerBalance); + const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor); + const callerBalanceAfter = await ethBalanceViaSub(api, caller); + expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; + expect(callerBalanceAfter).to.be.equals(callerBalanceBefore); }); itWeb3('Sponsoring is limited, with setContractRateLimit. The limitation is working if transactions are sent more often, the sender pays the commission.', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const originalCallerBalance = await web3.eth.getBalance(caller); @@ -191,25 +231,24 @@ describe('Sponsoring EVM contracts', () => { await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner}); await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner}); - expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Allowlisted).send({from: owner}); await helpers.methods.setSponsoringRateLimit(flipper.options.address, 10).send({from: owner}); - expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.true; - await transferBalanceToEth(api, alice, flipper.options.address); + await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); + await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); - const originalFlipperBalance = await web3.eth.getBalance(flipper.options.address); + const originalFlipperBalance = await web3.eth.getBalance(sponsor); expect(originalFlipperBalance).to.be.not.equal('0'); await flipper.methods.flip().send({from: caller}); expect(await flipper.methods.getValue().call()).to.be.true; expect(await web3.eth.getBalance(caller)).to.be.equals(originalCallerBalance); - const newFlipperBalance = await web3.eth.getBalance(flipper.options.address); + const newFlipperBalance = await web3.eth.getBalance(sponsor); expect(newFlipperBalance).to.be.not.equals(originalFlipperBalance); await flipper.methods.flip().send({from: caller}); - expect(await web3.eth.getBalance(flipper.options.address)).to.be.equal(newFlipperBalance); + expect(await web3.eth.getBalance(sponsor)).to.be.equal(newFlipperBalance); expect(await web3.eth.getBalance(caller)).to.be.not.equals(originalCallerBalance); }); @@ -220,130 +259,4 @@ describe('Sponsoring EVM contracts', () => { const helpers = contractHelpers(web3, owner); expect(await helpers.methods.getSponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200'); }); - - itWeb3('Sponsoring collection from evm address via access list', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner}); - let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format; - expect(collectionSub.sponsorship.isUnconfirmed).to.be.true; - expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); - await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); - - await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor}); - collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - expect(collectionSub.sponsorship.isConfirmed).to.be.true; - expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); - - const user = createEthAccount(web3); - const nextTokenId = await collectionEvm.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - - const oldPermissions = (await getDetailedCollectionInfo(api, collectionId))!.permissions.toHuman(); - expect(oldPermissions.mintMode).to.be.false; - expect(oldPermissions.access).to.be.equal('Normal'); - - await collectionEvm.methods.setCollectionAccess(1 /*'AllowList'*/).send({from: owner}); - await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner}); - await collectionEvm.methods.setCollectionMintMode(true).send({from: owner}); - - const newPermissions = (await getDetailedCollectionInfo(api, collectionId))!.permissions.toHuman(); - expect(newPermissions.mintMode).to.be.true; - expect(newPermissions.access).to.be.equal('AllowList'); - - const ownerBalanceBefore = await ethBalanceViaSub(api, owner); - const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor); - - { - const nextTokenId = await collectionEvm.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - const result = await collectionEvm.methods.mintWithTokenURI( - user, - nextTokenId, - 'Test URI', - ).send({from: user}); - const events = normalizeEvents(result.events); - - expect(events).to.be.deep.equal([ - { - address: collectionIdAddress, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: user, - tokenId: nextTokenId, - }, - }, - ]); - - const ownerBalanceAfter = await ethBalanceViaSub(api, owner); - const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor); - - expect(await collectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); - expect(ownerBalanceBefore).to.be.eq(ownerBalanceAfter); - expect(sponsorBalanceBefore > sponsorBalanceAfter).to.be.true; - } - }); - - itWeb3('Check that transaction via EVM spend money from sponsor address', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - result = await collectionEvm.methods.setCollectionSponsor(sponsor).send(); - let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format; - expect(collectionSub.sponsorship.isUnconfirmed).to.be.true; - expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); - await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); - const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress); - await sponsorCollection.methods.confirmCollectionSponsorship().send(); - collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - expect(collectionSub.sponsorship.isConfirmed).to.be.true; - expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); - - const user = createEthAccount(web3); - await collectionEvm.methods.addCollectionAdmin(user).send(); - - const ownerBalanceBefore = await ethBalanceViaSub(api, owner); - const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor); - - - const userCollectionEvm = evmCollection(web3, user, collectionIdAddress); - const nextTokenId = await userCollectionEvm.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - result = await userCollectionEvm.methods.mintWithTokenURI( - user, - nextTokenId, - 'Test URI', - ).send(); - - const events = normalizeEvents(result.events); - const address = collectionIdToAddress(collectionId); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: user, - tokenId: nextTokenId, - }, - }, - ]); - expect(await userCollectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); - - const ownerBalanceAfter = await ethBalanceViaSub(api, owner); - expect(ownerBalanceAfter).to.be.eq(ownerBalanceBefore); - const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor); - expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; - }); }); From ee664e3c373c449f8ffba8310fc68ee68f578245 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 5 Aug 2022 12:45:30 +0000 Subject: [PATCH 0539/1274] path: Fix other broken tests. --- tests/src/eth/marketplace/marketplace.test.ts | 10 +++++-- tests/src/eth/sponsoring.test.ts | 27 ++++++++++--------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/tests/src/eth/marketplace/marketplace.test.ts b/tests/src/eth/marketplace/marketplace.test.ts index 753939c830..e4161c3a73 100644 --- a/tests/src/eth/marketplace/marketplace.test.ts +++ b/tests/src/eth/marketplace/marketplace.test.ts @@ -39,6 +39,7 @@ const PRICE = 2000n; describe('Matcher contract usage', () => { itWeb3('With UNQ', async ({api, web3, privateKeyWrapper}) => { const alice = privateKeyWrapper('//Alice'); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const matcherOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const matcherContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/MarketPlace.abi`)).toString()), undefined, { from: matcherOwner, @@ -48,7 +49,9 @@ describe('Matcher contract usage', () => { const helpers = contractHelpers(web3, matcherOwner); await helpers.methods.setSponsoringMode(matcher.options.address, SponsoringMode.Allowlisted).send({from: matcherOwner}); await helpers.methods.setSponsoringRateLimit(matcher.options.address, 1).send({from: matcherOwner}); - await transferBalanceToEth(api, alice, matcher.options.address); + + await helpers.methods.setSponsor(matcher.options.address, sponsor).send({from: matcherOwner}); + await helpers.methods.confirmSponsorship(matcher.options.address).send({from: sponsor}); const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsorApproveTimeout: 1}); @@ -100,6 +103,7 @@ describe('Matcher contract usage', () => { itWeb3('With escrow', async ({api, web3, privateKeyWrapper}) => { const alice = privateKeyWrapper('//Alice'); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const matcherOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const escrow = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const matcherContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/MarketPlace.abi`)).toString()), undefined, { @@ -111,7 +115,9 @@ describe('Matcher contract usage', () => { const helpers = contractHelpers(web3, matcherOwner); await helpers.methods.setSponsoringMode(matcher.options.address, SponsoringMode.Allowlisted).send({from: matcherOwner}); await helpers.methods.setSponsoringRateLimit(matcher.options.address, 1).send({from: matcherOwner}); - await transferBalanceToEth(api, alice, matcher.options.address); + + await helpers.methods.setSponsor(matcher.options.address, sponsor).send({from: matcherOwner}); + await helpers.methods.confirmSponsorship(matcher.options.address).send({from: sponsor}); const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsorApproveTimeout: 1}); diff --git a/tests/src/eth/sponsoring.test.ts b/tests/src/eth/sponsoring.test.ts index cca9293db9..335ef6345f 100644 --- a/tests/src/eth/sponsoring.test.ts +++ b/tests/src/eth/sponsoring.test.ts @@ -15,13 +15,12 @@ // along with Unique Network. If not, see . import {expect} from 'chai'; -import {contractHelpers, createEthAccount, createEthAccountWithBalance, deployCollector, deployFlipper, itWeb3, SponsoringMode, transferBalanceToEth} from './util/helpers'; +import {contractHelpers, createEthAccount, createEthAccountWithBalance, deployCollector, deployFlipper, itWeb3, SponsoringMode} from './util/helpers'; describe('EVM sponsoring', () => { itWeb3('Fee is deducted from contract if sponsoring is enabled', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const caller = createEthAccount(web3); const originalCallerBalance = await web3.eth.getBalance(caller); expect(originalCallerBalance).to.be.equal('0'); @@ -31,28 +30,31 @@ describe('EVM sponsoring', () => { const helpers = contractHelpers(web3, owner); await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner}); await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner}); + + await helpers.methods.setSponsor(flipper.options.address, sponsor).send({from: owner}); + await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Allowlisted).send({from: owner}); await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner}); expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.true; - await transferBalanceToEth(api, alice, flipper.options.address); - - const originalFlipperBalance = await web3.eth.getBalance(flipper.options.address); - expect(originalFlipperBalance).to.be.not.equal('0'); + const originalSponsorBalance = await web3.eth.getBalance(sponsor); + expect(originalSponsorBalance).to.be.not.equal('0'); await flipper.methods.flip().send({from: caller}); expect(await flipper.methods.getValue().call()).to.be.true; // Balance should be taken from flipper instead of caller expect(await web3.eth.getBalance(caller)).to.be.equals(originalCallerBalance); - expect(await web3.eth.getBalance(flipper.options.address)).to.be.not.equals(originalFlipperBalance); + expect(await web3.eth.getBalance(sponsor)).to.be.not.equals(originalSponsorBalance); }); + itWeb3('...but this doesn\'t applies to payable value', async ({api, web3, privateKeyWrapper}) => { const alice = privateKeyWrapper('//Alice'); const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const originalCallerBalance = await web3.eth.getBalance(caller); expect(originalCallerBalance).to.be.not.equal('0'); @@ -68,16 +70,17 @@ describe('EVM sponsoring', () => { await helpers.methods.setSponsoringRateLimit(collector.options.address, 0).send({from: owner}); expect(await helpers.methods.sponsoringEnabled(collector.options.address).call()).to.be.true; - await transferBalanceToEth(api, alice, collector.options.address); + await helpers.methods.setSponsor(collector.options.address, sponsor).send({from: owner}); + await helpers.methods.confirmSponsorship(collector.options.address).send({from: sponsor}); - const originalCollectorBalance = await web3.eth.getBalance(collector.options.address); - expect(originalCollectorBalance).to.be.not.equal('0'); + const originalSponsorBalance = await web3.eth.getBalance(sponsor); + expect(originalSponsorBalance).to.be.not.equal('0'); await collector.methods.giveMoney().send({from: caller, value: '10000'}); // Balance will be taken from both caller (value) and from collector (fee) expect(await web3.eth.getBalance(caller)).to.be.equals((BigInt(originalCallerBalance) - 10000n).toString()); - expect(await web3.eth.getBalance(collector.options.address)).to.be.not.equals(originalCollectorBalance); + expect(await web3.eth.getBalance(sponsor)).to.be.not.equals(originalSponsorBalance); expect(await collector.methods.getCollected().call()).to.be.equal('10000'); }); }); From 4afd851ef43b0f8e52c89c6014c421d3206ab475 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 5 Aug 2022 12:45:55 +0000 Subject: [PATCH 0540/1274] path: add stubs --- .../src/stubs/ContractHelpers.sol | 61 +++++++++++-- tests/src/eth/api/ContractHelpers.sol | 34 +++++-- tests/src/eth/util/contractHelpersAbi.json | 90 ++++++++++++++++--- 3 files changed, 156 insertions(+), 29 deletions(-) diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol index 3de92cd40e..f9eefd3262 100644 --- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol +++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol @@ -3,6 +3,12 @@ pragma solidity >=0.8.0 <0.9.0; +// Anonymous struct +struct Tuple0 { + address field_0; + uint256 field_1; +} + // Common stubs holder contract Dummy { uint8 dummy; @@ -21,7 +27,7 @@ contract ERC165 is Dummy { } } -// Selector: 7b4866f9 +// Selector: 06fc42e9 contract ContractHelpers is Dummy, ERC165 { // Selector: contractOwner(address) 5152b14c function contractOwner(address contractAddress) @@ -35,8 +41,43 @@ contract ContractHelpers is Dummy, ERC165 { return 0x0000000000000000000000000000000000000000; } - // Selector: sponsoringEnabled(address) 6027dc61 - function sponsoringEnabled(address contractAddress) + // Selector: setSponsor(address,address) f01fba93 + function setSponsor(address contractAddress, address sponsor) public { + require(false, stub_error); + contractAddress; + sponsor; + dummy = 0; + } + + // Selector: confirmSponsorship(address) abc00001 + function confirmSponsorship(address contractAddress) public { + require(false, stub_error); + contractAddress; + dummy = 0; + } + + // Selector: getSponsor(address) 743fc745 + function getSponsor(address contractAddress) + public + view + returns (Tuple0 memory) + { + require(false, stub_error); + contractAddress; + dummy; + return Tuple0(0x0000000000000000000000000000000000000000, 0); + } + + // Selector: hasSponsor(address) 97418603 + function hasSponsor(address contractAddress) public view returns (bool) { + require(false, stub_error); + contractAddress; + dummy; + return false; + } + + // Selector: hasPendingSponsor(address) 39b9b242 + function hasPendingSponsor(address contractAddress) public view returns (bool) @@ -47,14 +88,16 @@ contract ContractHelpers is Dummy, ERC165 { return false; } - // Deprecated - // - // Selector: toggleSponsoring(address,bool) fcac6d86 - function toggleSponsoring(address contractAddress, bool enabled) public { + // Selector: sponsoringEnabled(address) 6027dc61 + function sponsoringEnabled(address contractAddress) + public + view + returns (bool) + { require(false, stub_error); contractAddress; - enabled; - dummy = 0; + dummy; + return false; } // Selector: setSponsoringMode(address,uint8) fde8a560 diff --git a/tests/src/eth/api/ContractHelpers.sol b/tests/src/eth/api/ContractHelpers.sol index 0205993a7e..bb855faa77 100644 --- a/tests/src/eth/api/ContractHelpers.sol +++ b/tests/src/eth/api/ContractHelpers.sol @@ -3,6 +3,12 @@ pragma solidity >=0.8.0 <0.9.0; +// Anonymous struct +struct Tuple0 { + address field_0; + uint256 field_1; +} + // Common stubs holder interface Dummy { @@ -12,7 +18,7 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } -// Selector: 7b4866f9 +// Selector: 06fc42e9 interface ContractHelpers is Dummy, ERC165 { // Selector: contractOwner(address) 5152b14c function contractOwner(address contractAddress) @@ -20,17 +26,33 @@ interface ContractHelpers is Dummy, ERC165 { view returns (address); + // Selector: setSponsor(address,address) f01fba93 + function setSponsor(address contractAddress, address sponsor) external; + + // Selector: confirmSponsorship(address) abc00001 + function confirmSponsorship(address contractAddress) external; + + // Selector: getSponsor(address) 743fc745 + function getSponsor(address contractAddress) + external + view + returns (Tuple0 memory); + + // Selector: hasSponsor(address) 97418603 + function hasSponsor(address contractAddress) external view returns (bool); + + // Selector: hasPendingSponsor(address) 39b9b242 + function hasPendingSponsor(address contractAddress) + external + view + returns (bool); + // Selector: sponsoringEnabled(address) 6027dc61 function sponsoringEnabled(address contractAddress) external view returns (bool); - // Deprecated - // - // Selector: toggleSponsoring(address,bool) fcac6d86 - function toggleSponsoring(address contractAddress, bool enabled) external; - // Selector: setSponsoringMode(address,uint8) fde8a560 function setSponsoringMode(address contractAddress, uint8 mode) external; diff --git a/tests/src/eth/util/contractHelpersAbi.json b/tests/src/eth/util/contractHelpersAbi.json index 158e35d96f..a81633f04c 100644 --- a/tests/src/eth/util/contractHelpersAbi.json +++ b/tests/src/eth/util/contractHelpersAbi.json @@ -26,6 +26,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "confirmSponsorship", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -39,6 +52,29 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "getSponsor", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "field_0", "type": "address" }, + { "internalType": "uint256", "name": "field_1", "type": "uint256" } + ], + "internalType": "struct Tuple0", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -52,6 +88,46 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "hasPendingSponsor", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "hasSponsor", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { "internalType": "address", "name": "sponsor", "type": "address" } + ], + "name": "setSponsor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -143,19 +219,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contractAddress", - "type": "address" - }, - { "internalType": "bool", "name": "enabled", "type": "bool" } - ], - "name": "toggleSponsoring", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" } ] From 9d33b05e829a2578bd9299b1fd825908fc1937e7 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 5 Aug 2022 14:06:10 +0000 Subject: [PATCH 0541/1274] docs --- pallets/evm-contract-helpers/src/eth.rs | 25 +++++++++++++++++++++++++ pallets/evm-contract-helpers/src/lib.rs | 23 +++++++++++++++++------ 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index e4746267ac..4904c7e0dc 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -46,10 +46,18 @@ impl ContractHelpers where T::AccountId: AsRef<[u8]>, { + /// Get contract ovner + /// + /// @param Contract_address contract for which the owner is being determined. + /// @return Contract owner. fn contract_owner(&self, contract_address: address) -> Result
{ Ok(>::get(contract_address)) } + /// Set sponsor. + /// + /// @param contract_address Contract for which a sponsor is being established. + /// @param sponsor User address who set as pending sponsor. fn set_sponsor( &mut self, caller: caller, @@ -65,12 +73,21 @@ where Ok(()) } + /// Confirm sponsorship. + /// + /// @dev Caller must be same that set via [`set_sponsor`]. + /// + /// @param contract_address Сontract for which need to confirm sponsorship. fn confirm_sponsorship(&mut self, caller: caller, contract_address: address) -> Result { Pallet::::confirm_sponsorship(&T::CrossAccountId::from_eth(caller), contract_address) .map_err(dispatch_to_evm::)?; Ok(()) } + /// Get current sponsor. + /// + /// @param contract_address The contract for which a sponsor is requested. + /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> { let sponsor = Pallet::::get_sponsor(contract_address).ok_or("Contract has no sponsor")?; @@ -78,10 +95,18 @@ where Ok((*sponsor.as_eth(), sponsor_sub)) } + /// Check tat contract has confirmed sponsor. + /// + /// @param contract_address The contract for which the presence of a confirmed sponsor is checked. + /// @return **true** if contract has confirmed sponsor. fn has_sponsor(&self, contract_address: address) -> Result { Ok(Pallet::::get_sponsor(contract_address).is_some()) } + /// Check tat contract has pending sponsor. + /// + /// @param contract_address The contract for which the presence of a pending sponsor is checked. + /// @return **true** if contract has pending sponsor. fn has_pending_sponsor(&self, contract_address: address) -> Result { Ok(match Sponsoring::::get(contract_address) { SponsorshipState::Disabled | SponsorshipState::Confirmed(_) => false, diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index bfea16fb03..a24b722f37 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -101,6 +101,11 @@ pub mod pallet { OnEmpty = T::DefaultSponsoringRateLimit, >; + /// Storage for last sponsored block. + /// + /// * **Key1** - contract address. + /// * **Key2** - sponsored user address. + /// * **Value** - last sponsored block number. #[pallet::storage] pub(super) type SponsorBasket = StorageDoubleMap< Hasher1 = Twox128, @@ -151,6 +156,14 @@ pub mod pallet { } impl Pallet { + /// Get contract owner. + pub fn contract_owner(contract: H160) -> H160 { + >::get(contract) + } + + /// Set `sponsor` for `contract`. + /// + /// `sender` must be owner of contract. pub fn set_sponsor( sender: &T::CrossAccountId, contract: H160, @@ -164,6 +177,9 @@ pub mod pallet { Ok(()) } + /// Confirm sponsorship. + /// + /// `sender` must be same that set via [`set_sponsor`]. pub fn confirm_sponsorship(sender: &T::CrossAccountId, contract: H160) -> DispatchResult { match Sponsoring::::get(contract) { SponsorshipState::Unconfirmed(sponsor) => { @@ -181,6 +197,7 @@ pub mod pallet { } } + /// Get sponsor. pub fn get_sponsor(contract: H160) -> Option { match Sponsoring::::get(contract) { SponsorshipState::Disabled | SponsorshipState::Unconfirmed(_) => None, @@ -226,12 +243,6 @@ pub mod pallet { Ok(()) } } - - impl Pallet { - pub fn contract_owner(contract: H160) -> H160 { - >::get(contract) - } - } } #[derive(Encode, Decode, PartialEq, TypeInfo, MaxEncodedLen)] From f1e64f25a71dc6ee5a7d6925f55401782948bb35 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 5 Aug 2022 14:25:01 +0000 Subject: [PATCH 0542/1274] path: Add 'self_sponsored_enable' and 'remove_sponsor'. --- pallets/evm-contract-helpers/src/eth.rs | 35 ++++++++++++++----- pallets/evm-contract-helpers/src/lib.rs | 46 +++++++++++++++---------- 2 files changed, 55 insertions(+), 26 deletions(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 4904c7e0dc..07b11ab08e 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -24,7 +24,8 @@ use pallet_evm::{ use sp_core::H160; use up_data_structs::SponsorshipState; use crate::{ - AllowlistEnabled, Config, Owner, Pallet, SponsorBasket, SponsoringRateLimit, SponsoringModeT, Sponsoring, + AllowlistEnabled, Config, Owner, Pallet, SponsorBasket, SponsoringRateLimit, SponsoringModeT, + Sponsoring, }; use frame_support::traits::Get; use up_sponsorship::SponsorshipHandler; @@ -47,7 +48,7 @@ where T::AccountId: AsRef<[u8]>, { /// Get contract ovner - /// + /// /// @param Contract_address contract for which the owner is being determined. /// @return Contract owner. fn contract_owner(&self, contract_address: address) -> Result
{ @@ -55,7 +56,7 @@ where } /// Set sponsor. - /// + /// /// @param contract_address Contract for which a sponsor is being established. /// @param sponsor User address who set as pending sponsor. fn set_sponsor( @@ -73,10 +74,28 @@ where Ok(()) } + /// Set contract as self sponsored. + /// + /// @param contract_address Contract for which a self sponsoring is being enabled. + fn self_sponsored_enable(&mut self, caller: caller, contract_address: address) -> Result { + Pallet::::self_sponsored_enable(&T::CrossAccountId::from_eth(caller), contract_address) + .map_err(dispatch_to_evm::)?; + Ok(()) + } + + /// Remove sponsor. + /// + /// @param contract_address Contract for which a sponsorship is being removed. + fn remove_sponsor(&mut self, caller: caller, contract_address: address) -> Result { + Pallet::::remove_sponsor(&T::CrossAccountId::from_eth(caller), contract_address) + .map_err(dispatch_to_evm::)?; + Ok(()) + } + /// Confirm sponsorship. - /// + /// /// @dev Caller must be same that set via [`set_sponsor`]. - /// + /// /// @param contract_address Сontract for which need to confirm sponsorship. fn confirm_sponsorship(&mut self, caller: caller, contract_address: address) -> Result { Pallet::::confirm_sponsorship(&T::CrossAccountId::from_eth(caller), contract_address) @@ -85,7 +104,7 @@ where } /// Get current sponsor. - /// + /// /// @param contract_address The contract for which a sponsor is requested. /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> { @@ -96,7 +115,7 @@ where } /// Check tat contract has confirmed sponsor. - /// + /// /// @param contract_address The contract for which the presence of a confirmed sponsor is checked. /// @return **true** if contract has confirmed sponsor. fn has_sponsor(&self, contract_address: address) -> Result { @@ -104,7 +123,7 @@ where } /// Check tat contract has pending sponsor. - /// + /// /// @param contract_address The contract for which the presence of a pending sponsor is checked. /// @return **true** if contract has pending sponsor. fn has_pending_sponsor(&self, contract_address: address) -> Result { diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index a24b722f37..70d3c414bc 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -49,10 +49,7 @@ pub mod pallet { NoPendingSponsor, } - const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); - #[pallet::pallet] - #[pallet::storage_version(STORAGE_VERSION)] #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); @@ -102,7 +99,7 @@ pub mod pallet { >; /// Storage for last sponsored block. - /// + /// /// * **Key1** - contract address. /// * **Key2** - sponsored user address. /// * **Value** - last sponsored block number. @@ -145,24 +142,14 @@ pub mod pallet { QueryKind = ValueQuery, >; - #[pallet::hooks] - impl Hooks> for Pallet { - fn on_runtime_upgrade() -> Weight { - let storage_version = StorageVersion::get::>(); - if storage_version < StorageVersion::new(1) {} - - 0 - } - } - impl Pallet { /// Get contract owner. pub fn contract_owner(contract: H160) -> H160 { >::get(contract) } - - /// Set `sponsor` for `contract`. - /// + + /// Set `sponsor` for `contract`. + /// /// `sender` must be owner of contract. pub fn set_sponsor( sender: &T::CrossAccountId, @@ -177,8 +164,31 @@ pub mod pallet { Ok(()) } + /// Set `contract` as self sponsored. + /// + /// `sender` must be owner of contract. + pub fn self_sponsored_enable(sender: &T::CrossAccountId, contract: H160) -> DispatchResult { + Pallet::::ensure_owner(contract, *sender.as_eth())?; + Sponsoring::::insert( + contract, + SponsorshipState::::Confirmed(T::CrossAccountId::from_eth( + contract, + )), + ); + Ok(()) + } + + /// Remove sponsor for `contract`. + /// + /// `sender` must be owner of contract. + pub fn remove_sponsor(sender: &T::CrossAccountId, contract: H160) -> DispatchResult { + Pallet::::ensure_owner(contract, *sender.as_eth())?; + Sponsoring::::remove(contract); + Ok(()) + } + /// Confirm sponsorship. - /// + /// /// `sender` must be same that set via [`set_sponsor`]. pub fn confirm_sponsorship(sender: &T::CrossAccountId, contract: H160) -> DispatchResult { match Sponsoring::::get(contract) { From a0a04c832ebb534b185d3aadce402e005282bdbb Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 5 Aug 2022 15:36:22 +0000 Subject: [PATCH 0543/1274] test: Add test for "sef sponsoring" and "remove sponsor". --- .../src/stubs/ContractHelpers.sol | 55 ++++++++++- tests/src/eth/api/ContractHelpers.sol | 47 ++++++++- tests/src/eth/contractSponsoring.test.ts | 99 ++++++++++++++++++- tests/src/eth/util/contractHelpersAbi.json | 26 +++++ 4 files changed, 221 insertions(+), 6 deletions(-) diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol index f9eefd3262..302d2f0657 100644 --- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol +++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol @@ -27,8 +27,13 @@ contract ERC165 is Dummy { } } -// Selector: 06fc42e9 +// Selector: 6073d917 contract ContractHelpers is Dummy, ERC165 { + // Get contract ovner + // + // @param Contract_address contract for which the owner is being determined. + // @return Contract owner. + // // Selector: contractOwner(address) 5152b14c function contractOwner(address contractAddress) public @@ -41,6 +46,11 @@ contract ContractHelpers is Dummy, ERC165 { return 0x0000000000000000000000000000000000000000; } + // Set sponsor. + // + // @param contract_address Contract for which a sponsor is being established. + // @param sponsor User address who set as pending sponsor. + // // Selector: setSponsor(address,address) f01fba93 function setSponsor(address contractAddress, address sponsor) public { require(false, stub_error); @@ -49,6 +59,34 @@ contract ContractHelpers is Dummy, ERC165 { dummy = 0; } + // Set contract as self sponsored. + // + // @param contract_address Contract for which a self sponsoring is being enabled. + // + // Selector: selfSponsoredEnable(address) 89f7d9ae + function selfSponsoredEnable(address contractAddress) public { + require(false, stub_error); + contractAddress; + dummy = 0; + } + + // Remove sponsor. + // + // @param contract_address Contract for which a sponsorship is being removed. + // + // Selector: removeSponsor(address) ef784250 + function removeSponsor(address contractAddress) public { + require(false, stub_error); + contractAddress; + dummy = 0; + } + + // Confirm sponsorship. + // + // @dev Caller must be same that set via [`set_sponsor`]. + // + // @param contract_address Сontract for which need to confirm sponsorship. + // // Selector: confirmSponsorship(address) abc00001 function confirmSponsorship(address contractAddress) public { require(false, stub_error); @@ -56,6 +94,11 @@ contract ContractHelpers is Dummy, ERC165 { dummy = 0; } + // Get current sponsor. + // + // @param contract_address The contract for which a sponsor is requested. + // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + // // Selector: getSponsor(address) 743fc745 function getSponsor(address contractAddress) public @@ -68,6 +111,11 @@ contract ContractHelpers is Dummy, ERC165 { return Tuple0(0x0000000000000000000000000000000000000000, 0); } + // Check tat contract has confirmed sponsor. + // + // @param contract_address The contract for which the presence of a confirmed sponsor is checked. + // @return **true** if contract has confirmed sponsor. + // // Selector: hasSponsor(address) 97418603 function hasSponsor(address contractAddress) public view returns (bool) { require(false, stub_error); @@ -76,6 +124,11 @@ contract ContractHelpers is Dummy, ERC165 { return false; } + // Check tat contract has pending sponsor. + // + // @param contract_address The contract for which the presence of a pending sponsor is checked. + // @return **true** if contract has pending sponsor. + // // Selector: hasPendingSponsor(address) 39b9b242 function hasPendingSponsor(address contractAddress) public diff --git a/tests/src/eth/api/ContractHelpers.sol b/tests/src/eth/api/ContractHelpers.sol index bb855faa77..5afcdd50b7 100644 --- a/tests/src/eth/api/ContractHelpers.sol +++ b/tests/src/eth/api/ContractHelpers.sol @@ -18,29 +18,74 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } -// Selector: 06fc42e9 +// Selector: 6073d917 interface ContractHelpers is Dummy, ERC165 { + // Get contract ovner + // + // @param Contract_address contract for which the owner is being determined. + // @return Contract owner. + // // Selector: contractOwner(address) 5152b14c function contractOwner(address contractAddress) external view returns (address); + // Set sponsor. + // + // @param contract_address Contract for which a sponsor is being established. + // @param sponsor User address who set as pending sponsor. + // // Selector: setSponsor(address,address) f01fba93 function setSponsor(address contractAddress, address sponsor) external; + // Set contract as self sponsored. + // + // @param contract_address Contract for which a self sponsoring is being enabled. + // + // Selector: selfSponsoredEnable(address) 89f7d9ae + function selfSponsoredEnable(address contractAddress) external; + + // Remove sponsor. + // + // @param contract_address Contract for which a sponsorship is being removed. + // + // Selector: removeSponsor(address) ef784250 + function removeSponsor(address contractAddress) external; + + // Confirm sponsorship. + // + // @dev Caller must be same that set via [`set_sponsor`]. + // + // @param contract_address Сontract for which need to confirm sponsorship. + // // Selector: confirmSponsorship(address) abc00001 function confirmSponsorship(address contractAddress) external; + // Get current sponsor. + // + // @param contract_address The contract for which a sponsor is requested. + // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + // // Selector: getSponsor(address) 743fc745 function getSponsor(address contractAddress) external view returns (Tuple0 memory); + // Check tat contract has confirmed sponsor. + // + // @param contract_address The contract for which the presence of a confirmed sponsor is checked. + // @return **true** if contract has confirmed sponsor. + // // Selector: hasSponsor(address) 97418603 function hasSponsor(address contractAddress) external view returns (bool); + // Check tat contract has pending sponsor. + // + // @param contract_address The contract for which the presence of a pending sponsor is checked. + // @return **true** if contract has pending sponsor. + // // Selector: hasPendingSponsor(address) 39b9b242 function hasPendingSponsor(address contractAddress) external diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index 388286374a..6a1045d0ce 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -28,12 +28,31 @@ import { import {evmToAddress} from '@polkadot/util-crypto'; describe('Sponsoring EVM contracts', () => { + itWeb3('Self sponsored can be set by the address that deployed the contract', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; + await expect(helpers.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; + }); + + itWeb3('Self sponsored can not be set by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; + await expect(helpers.methods.selfSponsoredEnable(flipper.options.address).call({from: notOwner})).to.be.rejectedWith('NoPermission'); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; + }); + itWeb3('Sponsoring can be set by the address that has deployed the contract', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const flipper = await deployFlipper(web3, owner); const helpers = contractHelpers(web3, owner); expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; - await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Allowlisted).send({from: owner}); + await expect(helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Allowlisted).send({from: owner})).to.be.not.rejected; expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.true; }); @@ -43,7 +62,7 @@ describe('Sponsoring EVM contracts', () => { const flipper = await deployFlipper(web3, owner); const helpers = contractHelpers(web3, owner); expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; - await expect(helpers.methods.setSponsoringMode(notOwner, SponsoringMode.Allowlisted).send({from: notOwner})).to.rejected; + await expect(helpers.methods.setSponsoringMode(notOwner, SponsoringMode.Allowlisted).call({from: notOwner})).to.be.rejectedWith('NoPermission'); expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; }); @@ -91,6 +110,19 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; }); + itWeb3('Get self sponsored sponsor', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + await helpers.methods.selfSponsoredEnable(flipper.options.address).send(); + + const result = await helpers.methods.getSponsor(flipper.options.address).call(); + + expect(result[0]).to.be.eq(flipper.options.address); + const sponsorSub = api.registry.createType('AccountId', '0x' + BigInt(result[1]).toString(16).padStart(64, '0')).toJSON(); + expect(sponsorSub).to.be.eq(evmToAddress(flipper.options.address)); + }); + itWeb3('Get confirmed sponsor', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -106,6 +138,37 @@ describe('Sponsoring EVM contracts', () => { expect(sponsorSub).to.be.eq(evmToAddress(sponsor)); }); + itWeb3('Sponsor can be removed by the address that deployed the contract', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; + await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); + await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; + + await helpers.methods.removeSponsor(flipper.options.address).send(); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; + }); + + itWeb3('Sponsor can not be removed by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; + await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); + await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; + + await expect(helpers.methods.removeSponsor(flipper.options.address).call({from: notOwner})).to.be.rejectedWith('NoPermission'); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; + }); + itWeb3('In generous mode, non-allowlisted user transaction will be sponsored', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -115,10 +178,8 @@ describe('Sponsoring EVM contracts', () => { const helpers = contractHelpers(web3, owner); - expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); - expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: owner}); await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner}); @@ -136,6 +197,36 @@ describe('Sponsoring EVM contracts', () => { expect(callerBalanceAfter).to.be.eq(callerBalanceBefore); }); + itWeb3('In generous mode, non-allowlisted user transaction will be self sponsored', async ({api, web3, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const flipper = await deployFlipper(web3, owner); + + const helpers = contractHelpers(web3, owner); + + await helpers.methods.selfSponsoredEnable(flipper.options.address).send(); + + await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: owner}); + await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner}); + + await transferBalanceToEth(api, alice, flipper.options.address); + + const contractBalanceBefore = await ethBalanceViaSub(api, flipper.options.address); + const callerBalanceBefore = await ethBalanceViaSub(api, caller); + + await flipper.methods.flip().send({from: caller}); + expect(await flipper.methods.getValue().call()).to.be.true; + + // Balance should be taken from sponsor instead of caller + const contractBalanceAfter = await ethBalanceViaSub(api, flipper.options.address); + const callerBalanceAfter = await ethBalanceViaSub(api, caller); + expect(contractBalanceAfter < contractBalanceBefore).to.be.true; + expect(callerBalanceAfter).to.be.eq(callerBalanceBefore); + }); + itWeb3('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should decrease (allowlisted)', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); diff --git a/tests/src/eth/util/contractHelpersAbi.json b/tests/src/eth/util/contractHelpersAbi.json index a81633f04c..d527e1a51d 100644 --- a/tests/src/eth/util/contractHelpersAbi.json +++ b/tests/src/eth/util/contractHelpersAbi.json @@ -114,6 +114,32 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "removeSponsor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "selfSponsoredEnable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { From 9252b2e53bcd4c9983e37170675b44fd206da863 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 5 Aug 2022 15:39:41 +0000 Subject: [PATCH 0544/1274] path: Add check for address length. --- pallets/common/src/eth.rs | 17 ++--------------- pallets/evm-contract-helpers/src/eth.rs | 2 +- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/pallets/common/src/eth.rs b/pallets/common/src/eth.rs index 36437dc75c..52fc1ddd65 100644 --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -16,7 +16,7 @@ //! The module contains a number of functions for converting and checking ethereum identifiers. -use evm_coder::{types::*}; +use evm_coder::{types::uint256, execution::Result}; pub use pallet_evm::account::CrossAccountId; use sp_core::H160; use up_data_structs::CollectionId; @@ -53,7 +53,7 @@ pub fn is_collection(address: &H160) -> bool { } /// Convert `CrossAccountId` to `uint256`. -pub fn convert_cross_account_to_eth_uint256(from: &T::CrossAccountId) -> uint256 +pub fn convert_cross_account_to_eth_uint256(from: &T::CrossAccountId) -> Result where T::AccountId: AsRef<[u8]>, { @@ -61,16 +61,3 @@ where let slice = from.as_sub().as_ref(); uint256::from_big_endian(slice) } - -/// Converts Substrate address to CrossAccountId -pub fn convert_substrate_address_to_cross_account_id( - address: uint256, -) -> T::CrossAccountId -where - T::AccountId: From<[u8; 32]>, -{ - let mut address_arr: [u8; 32] = Default::default(); - address.to_big_endian(&mut address_arr); - let account_id = T::AccountId::from(address_arr); - T::CrossAccountId::from_sub(account_id) -} diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 07b11ab08e..ec0428f5c6 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -110,7 +110,7 @@ where fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> { let sponsor = Pallet::::get_sponsor(contract_address).ok_or("Contract has no sponsor")?; - let sponsor_sub = pallet_common::eth::convert_cross_account_to_eth_uint256::(&sponsor); + let sponsor_sub = pallet_common::eth::convert_cross_account_to_eth_uint256::(&sponsor)?; Ok((*sponsor.as_eth(), sponsor_sub)) } From b87343e4913b083fdef18584e8cf6760215ea52f Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 5 Aug 2022 15:57:00 +0000 Subject: [PATCH 0545/1274] patch: Refactor confirm sponsorship. Add test for confrim sponsorship. --- pallets/evm-contract-helpers/src/lib.rs | 9 ++++----- tests/src/eth/contractSponsoring.test.ts | 10 ++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index 70d3c414bc..db9a1a75e8 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -194,11 +194,10 @@ pub mod pallet { match Sponsoring::::get(contract) { SponsorshipState::Unconfirmed(sponsor) => { ensure!(sponsor == *sender, Error::::NoPermission); - Sponsoring::::mutate_exists(contract, |state| { - *state = Some(SponsorshipState::::Confirmed( - sponsor.clone(), - )) - }); + Sponsoring::::insert( + contract, + SponsorshipState::::Confirmed(sponsor), + ); Ok(()) } SponsorshipState::Disabled | SponsorshipState::Confirmed(_) => { diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index 6a1045d0ce..0ee93591f3 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -110,6 +110,16 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; }); + itWeb3('Sponsorship can not be confirmed by the address that not set as sponsor', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const notSponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; + await expect(helpers.methods.confirmSponsorship(flipper.options.address).call({from: notSponsor})).to.be.rejectedWith('NoPendingSponsor'); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; + }); + itWeb3('Get self sponsored sponsor', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const flipper = await deployFlipper(web3, owner); From 4747e947742757564ca8b33e23502f987737c44d Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 5 Aug 2022 16:48:51 +0000 Subject: [PATCH 0546/1274] misk: Refactor tuple generation --- crates/evm-coder/src/abi.rs | 58 ++++++++++++++----------------------- 1 file changed, 21 insertions(+), 37 deletions(-) diff --git a/crates/evm-coder/src/abi.rs b/crates/evm-coder/src/abi.rs index abe0c7b0eb..a5f75022a6 100644 --- a/crates/evm-coder/src/abi.rs +++ b/crates/evm-coder/src/abi.rs @@ -328,7 +328,7 @@ where } } -macro_rules! impl_tuples_abi_reader { +macro_rules! impl_tuples { ($($ident:ident)+) => { impl<$($ident),+> sealed::CanBePlacedInVec for ($($ident,)+) {} impl<$($ident),+> AbiRead<($($ident,)+)> for AbiReader<'_> @@ -342,19 +342,29 @@ macro_rules! impl_tuples_abi_reader { )) } } + #[allow(non_snake_case)] + impl<$($ident),+> AbiWrite for &($($ident,)+) + where + $($ident: AbiWrite,)+ + { + fn abi_write(&self, writer: &mut AbiWriter) { + let ($($ident,)+) = self; + $($ident.abi_write(writer);)+ + } + } }; } -impl_tuples_abi_reader! {A} -impl_tuples_abi_reader! {A B} -impl_tuples_abi_reader! {A B C} -impl_tuples_abi_reader! {A B C D} -impl_tuples_abi_reader! {A B C D E} -impl_tuples_abi_reader! {A B C D E F} -impl_tuples_abi_reader! {A B C D E F G} -impl_tuples_abi_reader! {A B C D E F G H} -impl_tuples_abi_reader! {A B C D E F G H I} -impl_tuples_abi_reader! {A B C D E F G H I J} +impl_tuples! {A} +impl_tuples! {A B} +impl_tuples! {A B C} +impl_tuples! {A B C D} +impl_tuples! {A B C D E} +impl_tuples! {A B C D E F} +impl_tuples! {A B C D E F G} +impl_tuples! {A B C D E F G H} +impl_tuples! {A B C D E F G H I} +impl_tuples! {A B C D E F G H I J} pub trait AbiWrite { fn abi_write(&self, writer: &mut AbiWriter); @@ -422,32 +432,6 @@ impl AbiWrite for () { fn abi_write(&self, _writer: &mut AbiWriter) {} } -macro_rules! impl_tuples_abi_writer { - ($($ident:ident)+) => { - #[allow(non_snake_case)] - impl<$($ident),+> AbiWrite for &($($ident,)+) - where - $($ident: AbiWrite,)+ - { - fn abi_write(&self, writer: &mut AbiWriter) { - let ($($ident,)+) = self; - $($ident.abi_write(writer);)+ - } - } - }; -} - -impl_tuples_abi_writer! {A} -impl_tuples_abi_writer! {A B} -impl_tuples_abi_writer! {A B C} -impl_tuples_abi_writer! {A B C D} -impl_tuples_abi_writer! {A B C D E} -impl_tuples_abi_writer! {A B C D E F} -impl_tuples_abi_writer! {A B C D E F G} -impl_tuples_abi_writer! {A B C D E F G H} -impl_tuples_abi_writer! {A B C D E F G H I} -impl_tuples_abi_writer! {A B C D E F G H I J} - #[macro_export] macro_rules! abi_decode { ($reader:expr, $($name:ident: $typ:ident),+ $(,)?) => { From 66a04f87c9e0322c6b077e30add1406cfc1bcb57 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 5 Aug 2022 16:49:47 +0000 Subject: [PATCH 0547/1274] misk: Change versions and update changelogs. --- Cargo.lock | 2 +- crates/evm-coder/CHANGELOG.md | 14 +++++++++++++- pallets/common/CHANGELOG.md | 7 +++++++ pallets/evm-contract-helpers/CHANGELOG.md | 17 ++++++++++++++++- pallets/evm-contract-helpers/Cargo.toml | 2 +- 5 files changed, 38 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cf645143d6..0581c3ef43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5733,7 +5733,7 @@ dependencies = [ [[package]] name = "pallet-evm-contract-helpers" -version = "0.1.2" +version = "0.2.0" dependencies = [ "evm-coder", "fp-evm-mapping", diff --git a/crates/evm-coder/CHANGELOG.md b/crates/evm-coder/CHANGELOG.md index 732ab15dc7..a45e01ce54 100644 --- a/crates/evm-coder/CHANGELOG.md +++ b/crates/evm-coder/CHANGELOG.md @@ -1,4 +1,16 @@ - +# Change Log + +All notable changes to this project will be documented in this file. +## [v0.1.2] 2022-08-19 + +### Added + + - Implementation `AbiWrite` for tuples. + + ### Fixes + + - Tuple generation for solidity. + ## [v0.1.1] 2022-08-16 ### Other changes diff --git a/pallets/common/CHANGELOG.md b/pallets/common/CHANGELOG.md index 463e62b0e6..8d15115ff9 100644 --- a/pallets/common/CHANGELOG.md +++ b/pallets/common/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## [0.2.0] - 2022-08-19 + +### Added + + - Add convert funtion from `CrossAccountId` to eth `uint256`. + + ## [0.1.6] - 2022-08-16 ### Added diff --git a/pallets/evm-contract-helpers/CHANGELOG.md b/pallets/evm-contract-helpers/CHANGELOG.md index 830ad22333..e233229e2e 100644 --- a/pallets/evm-contract-helpers/CHANGELOG.md +++ b/pallets/evm-contract-helpers/CHANGELOG.md @@ -1,4 +1,19 @@ - +# Change Log + +All notable changes to this project will be documented in this file. + +## [v0.2.0] - 2022-08-19 + +### Added + + - Set arbitrary evm address as contract sponsor. + - Ability to remove current sponsor. + + ### Changed + + - Change `toggle_sponsoring` to `self_sponsored_enable`. + + ## [v0.1.2] 2022-08-16 ### Other changes diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index 0f5e242f9b..a6dc361efb 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-evm-contract-helpers" -version = "0.1.2" +version = "0.2.0" license = "GPLv3" edition = "2021" From a7d85fce612dd2bf0f9d77b9e31b2dfff3ad1671 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 24 Aug 2022 10:47:23 +0000 Subject: [PATCH 0548/1274] misk: Change bound. Update changelog --- pallets/common/src/eth.rs | 4 ++-- pallets/evm-contract-helpers/CHANGELOG.md | 5 +++++ pallets/evm-contract-helpers/src/eth.rs | 6 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pallets/common/src/eth.rs b/pallets/common/src/eth.rs index 52fc1ddd65..a49b061c8f 100644 --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -53,9 +53,9 @@ pub fn is_collection(address: &H160) -> bool { } /// Convert `CrossAccountId` to `uint256`. -pub fn convert_cross_account_to_eth_uint256(from: &T::CrossAccountId) -> Result +pub fn convert_cross_account_to_uint256(from: &T::CrossAccountId) -> uint256 where - T::AccountId: AsRef<[u8]>, + T::AccountId: AsRef<[u8; 32]>, { use pallet_evm::account::CrossAccountId; let slice = from.as_sub().as_ref(); diff --git a/pallets/evm-contract-helpers/CHANGELOG.md b/pallets/evm-contract-helpers/CHANGELOG.md index e233229e2e..436a2ce9f0 100644 --- a/pallets/evm-contract-helpers/CHANGELOG.md +++ b/pallets/evm-contract-helpers/CHANGELOG.md @@ -9,6 +9,11 @@ All notable changes to this project will be documented in this file. - Set arbitrary evm address as contract sponsor. - Ability to remove current sponsor. +### Removed + - Remove methods + + sponsoring_enabled + + toggle_sponsoring + ### Changed - Change `toggle_sponsoring` to `self_sponsored_enable`. diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index ec0428f5c6..cc7baa352c 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -45,7 +45,7 @@ impl WithRecorder for ContractHelpers { #[solidity_interface(name = "ContractHelpers")] impl ContractHelpers where - T::AccountId: AsRef<[u8]>, + T::AccountId: AsRef<[u8; 32]>, { /// Get contract ovner /// @@ -110,7 +110,7 @@ where fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> { let sponsor = Pallet::::get_sponsor(contract_address).ok_or("Contract has no sponsor")?; - let sponsor_sub = pallet_common::eth::convert_cross_account_to_eth_uint256::(&sponsor)?; + let sponsor_sub = pallet_common::eth::convert_cross_account_to_uint256::(&sponsor); Ok((*sponsor.as_eth(), sponsor_sub)) } @@ -206,7 +206,7 @@ where pub struct HelpersOnMethodCall(PhantomData<*const T>); impl OnMethodCall for HelpersOnMethodCall where - T::AccountId: AsRef<[u8]>, + T::AccountId: AsRef<[u8; 32]>, { fn is_reserved(contract: &sp_core::H160) -> bool { contract == &T::ContractAddress::get() From e12eaf11c1955ddc525307e2667cf664b5a7ee70 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 24 Aug 2022 12:23:28 +0000 Subject: [PATCH 0549/1274] path: add weights --- pallets/evm-contract-helpers/src/eth.rs | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index cc7baa352c..6a6e0410c4 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -71,6 +71,10 @@ where &T::CrossAccountId::from_eth(sponsor), ) .map_err(dispatch_to_evm::)?; + + self.recorder().consume_sload()?; + self.recorder().consume_sstore()?; + Ok(()) } @@ -80,6 +84,10 @@ where fn self_sponsored_enable(&mut self, caller: caller, contract_address: address) -> Result { Pallet::::self_sponsored_enable(&T::CrossAccountId::from_eth(caller), contract_address) .map_err(dispatch_to_evm::)?; + + self.recorder().consume_sload()?; + self.recorder().consume_sstore()?; + Ok(()) } @@ -89,6 +97,10 @@ where fn remove_sponsor(&mut self, caller: caller, contract_address: address) -> Result { Pallet::::remove_sponsor(&T::CrossAccountId::from_eth(caller), contract_address) .map_err(dispatch_to_evm::)?; + + self.recorder().consume_sload()?; + self.recorder().consume_sstore()?; + Ok(()) } @@ -100,6 +112,10 @@ where fn confirm_sponsorship(&mut self, caller: caller, contract_address: address) -> Result { Pallet::::confirm_sponsorship(&T::CrossAccountId::from_eth(caller), contract_address) .map_err(dispatch_to_evm::)?; + + self.recorder().consume_sload()?; + self.recorder().consume_sstore()?; + Ok(()) } @@ -146,6 +162,10 @@ where >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; let mode = SponsoringModeT::from_eth(mode).ok_or("unknown mode")?; >::set_sponsoring_mode(contract_address, mode); + + self.recorder().consume_sload()?; + self.recorder().consume_sstore()?; + Ok(()) } @@ -161,6 +181,10 @@ where ) -> Result { >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; >::set_sponsoring_rate_limit(contract_address, rate_limit.into()); + + self.recorder().consume_sload()?; + self.recorder().consume_sstore()?; + Ok(()) } @@ -187,6 +211,10 @@ where ) -> Result { >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; >::toggle_allowlist(contract_address, enabled); + + self.recorder().consume_sload()?; + self.recorder().consume_sstore()?; + Ok(()) } @@ -199,6 +227,10 @@ where ) -> Result { >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; >::toggle_allowed(contract_address, user, allowed); + + self.recorder().consume_sload()?; + self.recorder().consume_sstore()?; + Ok(()) } } From 42c7b2c48281271da7db41d843692ab01e91d151 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 24 Aug 2022 13:52:21 +0000 Subject: [PATCH 0550/1274] fix: Return sponsor address in canonical form. --- Cargo.lock | 30 ++++++++++++------------ pallets/evm-contract-helpers/src/eth.rs | 10 ++++++-- runtime/tests/src/lib.rs | 9 ++++--- tests/src/eth/contractSponsoring.test.ts | 6 ++--- 4 files changed, 31 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0581c3ef43..b0843a750a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2345,7 +2345,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "async-trait", "fc-db", @@ -2364,7 +2364,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -2380,7 +2380,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "fc-db", "fp-consensus", @@ -2397,7 +2397,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "ethereum", "ethereum-types", @@ -2437,7 +2437,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "ethereum", "ethereum-types", @@ -2578,7 +2578,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "ethereum", "parity-scale-codec 3.1.5", @@ -2590,7 +2590,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "evm", "frame-support", @@ -2604,7 +2604,7 @@ dependencies = [ [[package]] name = "fp-evm-mapping" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "frame-support", "sp-core", @@ -2613,7 +2613,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "ethereum", "ethereum-types", @@ -2630,7 +2630,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "ethereum", "frame-support", @@ -2646,7 +2646,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "parity-scale-codec 3.1.5", ] @@ -5445,7 +5445,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "fp-evm", "frame-support", @@ -5660,7 +5660,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "ethereum", "ethereum-types", @@ -5689,7 +5689,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#64915c0986fcf2bbe942794b838c0cf359c93c21" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "evm", "fp-evm", @@ -12130,7 +12130,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "digest 0.10.3", "rand 0.8.5", "static_assertions", diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 6a6e0410c4..a3e33fbb4e 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -126,8 +126,14 @@ where fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> { let sponsor = Pallet::::get_sponsor(contract_address).ok_or("Contract has no sponsor")?; - let sponsor_sub = pallet_common::eth::convert_cross_account_to_uint256::(&sponsor); - Ok((*sponsor.as_eth(), sponsor_sub)) + let result: (address, uint256) = if sponsor.is_canonical_substrate() { + let sponsor = pallet_common::eth::convert_cross_account_to_uint256::(&sponsor); + (Default::default(), sponsor) + } else { + let sponsor = *sponsor.as_eth(); + (sponsor, Default::default()) + }; + Ok(result) } /// Check tat contract has confirmed sponsor. diff --git a/runtime/tests/src/lib.rs b/runtime/tests/src/lib.rs index 3fc12a004b..ee33bc1858 100644 --- a/runtime/tests/src/lib.rs +++ b/runtime/tests/src/lib.rs @@ -167,7 +167,7 @@ impl EvmBackwardsAddressMapping for TestEvmBackwardsAddressMapping { } #[derive(Encode, Decode, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, TypeInfo, MaxEncodedLen)] -pub struct TestCrossAccountId(u64, sp_core::H160); +pub struct TestCrossAccountId(u64, sp_core::H160, bool); impl CrossAccountId for TestCrossAccountId { fn as_sub(&self) -> &u64 { &self.0 @@ -178,17 +178,20 @@ impl CrossAccountId for TestCrossAccountId { fn from_sub(sub: u64) -> Self { let mut eth = [0; 20]; eth[12..20].copy_from_slice(&sub.to_be_bytes()); - Self(sub, sp_core::H160(eth)) + Self(sub, sp_core::H160(eth), true) } fn from_eth(eth: sp_core::H160) -> Self { let mut sub_raw = [0; 8]; sub_raw.copy_from_slice(ð.0[0..8]); let sub = u64::from_be_bytes(sub_raw); - Self(sub, eth) + Self(sub, eth, false) } fn conv_eq(&self, other: &Self) -> bool { self.as_sub() == other.as_sub() } + fn is_canonical_substrate(&self) -> bool { + self.2 + } } impl Default for TestCrossAccountId { diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index 0ee93591f3..7e47716ddc 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -129,8 +129,7 @@ describe('Sponsoring EVM contracts', () => { const result = await helpers.methods.getSponsor(flipper.options.address).call(); expect(result[0]).to.be.eq(flipper.options.address); - const sponsorSub = api.registry.createType('AccountId', '0x' + BigInt(result[1]).toString(16).padStart(64, '0')).toJSON(); - expect(sponsorSub).to.be.eq(evmToAddress(flipper.options.address)); + expect(result[1]).to.be.eq('0'); }); itWeb3('Get confirmed sponsor', async ({api, web3, privateKeyWrapper}) => { @@ -144,8 +143,7 @@ describe('Sponsoring EVM contracts', () => { const result = await helpers.methods.getSponsor(flipper.options.address).call(); expect(result[0]).to.be.eq(sponsor); - const sponsorSub = api.registry.createType('AccountId', '0x' + BigInt(result[1]).toString(16).padStart(64, '0')).toJSON(); - expect(sponsorSub).to.be.eq(evmToAddress(sponsor)); + expect(result[1]).to.be.eq('0'); }); itWeb3('Sponsor can be removed by the address that deployed the contract', async ({api, web3, privateKeyWrapper}) => { From 2b8c75faeb1228eba0d01b2754ca2625de805769 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 24 Aug 2022 14:48:22 +0000 Subject: [PATCH 0551/1274] fix: After rebase --- pallets/common/src/eth.rs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/pallets/common/src/eth.rs b/pallets/common/src/eth.rs index a49b061c8f..fc78834098 100644 --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -16,13 +16,11 @@ //! The module contains a number of functions for converting and checking ethereum identifiers. -use evm_coder::{types::uint256, execution::Result}; -pub use pallet_evm::account::CrossAccountId; +use evm_coder::types::uint256; +pub use pallet_evm::account::{Config, CrossAccountId}; use sp_core::H160; use up_data_structs::CollectionId; -use crate::Config; - // 0x17c4e6453Cc49AAAaEACA894e6D9683e00000001 - collection 1 // TODO: Unhardcode prefix const ETH_COLLECTION_PREFIX: [u8; 16] = [ @@ -57,7 +55,19 @@ pub fn convert_cross_account_to_uint256(from: &T::CrossAccountId) -> where T::AccountId: AsRef<[u8; 32]>, { - use pallet_evm::account::CrossAccountId; let slice = from.as_sub().as_ref(); uint256::from_big_endian(slice) } + +/// Converts Substrate address to CrossAccountId +pub fn convert_substrate_address_to_cross_account_id( + address: uint256, +) -> T::CrossAccountId +where + T::AccountId: From<[u8; 32]>, +{ + let mut address_arr: [u8; 32] = Default::default(); + address.to_big_endian(&mut address_arr); + let account_id = T::AccountId::from(address_arr); + T::CrossAccountId::from_sub(account_id) +} \ No newline at end of file From 45c16b312a42d43cccabdbe749e74abc44b7a210 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 24 Aug 2022 14:49:38 +0000 Subject: [PATCH 0552/1274] fmt --- pallets/common/src/eth.rs | 2 +- pallets/evm-contract-helpers/src/eth.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pallets/common/src/eth.rs b/pallets/common/src/eth.rs index fc78834098..19e1e1dfe5 100644 --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -70,4 +70,4 @@ where address.to_big_endian(&mut address_arr); let account_id = T::AccountId::from(address_arr); T::CrossAccountId::from_sub(account_id) -} \ No newline at end of file +} diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index a3e33fbb4e..ac0b787ff5 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -74,7 +74,7 @@ where self.recorder().consume_sload()?; self.recorder().consume_sstore()?; - + Ok(()) } @@ -84,7 +84,7 @@ where fn self_sponsored_enable(&mut self, caller: caller, contract_address: address) -> Result { Pallet::::self_sponsored_enable(&T::CrossAccountId::from_eth(caller), contract_address) .map_err(dispatch_to_evm::)?; - + self.recorder().consume_sload()?; self.recorder().consume_sstore()?; @@ -100,7 +100,7 @@ where self.recorder().consume_sload()?; self.recorder().consume_sstore()?; - + Ok(()) } @@ -130,7 +130,7 @@ where let sponsor = pallet_common::eth::convert_cross_account_to_uint256::(&sponsor); (Default::default(), sponsor) } else { - let sponsor = *sponsor.as_eth(); + let sponsor = *sponsor.as_eth(); (sponsor, Default::default()) }; Ok(result) @@ -236,7 +236,7 @@ where self.recorder().consume_sload()?; self.recorder().consume_sstore()?; - + Ok(()) } } From 98febe7588f821f23e964a2ea65b77607e6ff75e Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 24 Aug 2022 15:10:16 +0000 Subject: [PATCH 0553/1274] fix: Change hashier for `Sponsoring` storage --- pallets/evm-contract-helpers/src/eth.rs | 14 +++++++------- pallets/evm-contract-helpers/src/lib.rs | 7 +++++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index ac0b787ff5..261c065580 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -295,24 +295,24 @@ impl SponsorshipHandler)> for HelpersContractSponsoring { fn get_sponsor(who: &T::CrossAccountId, call: &(H160, Vec)) -> Option { - let (contract, _) = call; - let mode = >::sponsoring_mode(*contract); + let (contract_address, _) = call; + let mode = >::sponsoring_mode(*contract_address); if mode == SponsoringModeT::Disabled { return None; } - let sponsor = match >::get_sponsor(*contract) { + let sponsor = match >::get_sponsor(*contract_address) { Some(sponsor) => sponsor, None => return None, }; - if mode == SponsoringModeT::Allowlisted && !>::allowed(*contract, *who.as_eth()) { + if mode == SponsoringModeT::Allowlisted && !>::allowed(*contract_address, *who.as_eth()) { return None; } let block_number = >::block_number() as T::BlockNumber; - if let Some(last_tx_block) = >::get(contract, who.as_eth()) { - let limit = >::get(contract); + if let Some(last_tx_block) = >::get(contract_address, who.as_eth()) { + let limit = >::get(contract_address); let timeout = last_tx_block + limit; if block_number < timeout { @@ -320,7 +320,7 @@ impl SponsorshipHandler)> } } - >::insert(contract, who.as_eth(), block_number); + >::insert(contract_address, who.as_eth(), block_number); Some(sponsor) } diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index db9a1a75e8..a8f672b350 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -29,7 +29,6 @@ pub mod pallet { use pallet_evm_coder_substrate::DispatchResult; use sp_core::H160; use pallet_evm::account::CrossAccountId; - use frame_system::pallet_prelude::BlockNumberFor; use up_data_structs::SponsorshipState; #[pallet::config] @@ -66,9 +65,13 @@ pub mod pallet { pub(super) type SelfSponsoring = StorageMap; + /// Store for contract sponsorship state. + /// + /// * **Key** - contract address. + /// * **Value** - sponsorship state. #[pallet::storage] pub(super) type Sponsoring = StorageMap< - Hasher = Twox128, + Hasher = Twox64Concat, Key = H160, Value = SponsorshipState, QueryKind = ValueQuery, From b434daccc682aa63a6c5c6bf3d1626fed81f8da9 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 24 Aug 2022 15:11:07 +0000 Subject: [PATCH 0554/1274] fmt --- pallets/evm-contract-helpers/src/eth.rs | 4 +++- pallets/evm-contract-helpers/src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 261c065580..98c1020dda 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -306,7 +306,9 @@ impl SponsorshipHandler)> None => return None, }; - if mode == SponsoringModeT::Allowlisted && !>::allowed(*contract_address, *who.as_eth()) { + if mode == SponsoringModeT::Allowlisted + && !>::allowed(*contract_address, *who.as_eth()) + { return None; } let block_number = >::block_number() as T::BlockNumber; diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index a8f672b350..56b1d5b88e 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -66,7 +66,7 @@ pub mod pallet { StorageMap; /// Store for contract sponsorship state. - /// + /// /// * **Key** - contract address. /// * **Value** - sponsorship state. #[pallet::storage] From c52e8a647b656153fbce4553350009610cbedc34 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Thu, 25 Aug 2022 04:28:56 +0000 Subject: [PATCH 0555/1274] fix flaky tests: account generation with nonce ignore errors wait for balances --- tests/src/util/playgrounds/unique.dev.ts | 32 +++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 1c3b0f9a57..59b883fa9a 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -5,7 +5,8 @@ import {mnemonicGenerate} from '@polkadot/util-crypto'; import {UniqueHelper} from './unique'; import {ApiPromise, WsProvider} from '@polkadot/api'; import * as defs from '../../interfaces/definitions'; -import { TSigner } from './types'; +import {TSigner} from './types'; +import {IKeyringPair} from '@polkadot/types/types'; export class DevUniqueHelper extends UniqueHelper { @@ -73,7 +74,7 @@ class ArrangeGroup { let nonce = await this.helper.chain.getNonce(donor.address); const tokenNominal = this.helper.balance.getOneTokenNominal(); const transactions = []; - const accounts = []; + const accounts: IKeyringPair[] = []; for (const balance of balances) { const recepient = this.helper.util.fromSeed(mnemonicGenerate()); accounts.push(recepient); @@ -84,7 +85,32 @@ class ArrangeGroup { } } - await Promise.all(transactions); + await Promise.all(transactions).catch(e => {}); + + //#region TODO remove this region, when nonce problem will be solved + const checkBalances = async () => { + let isSuccess = true; + for (let i = 0; i < balances.length; i++) { + const balance = await this.helper.balance.getSubstrate(accounts[i].address); + if (balance !== balances[i] * tokenNominal) { + isSuccess = false; + break; + } + } + return isSuccess; + }; + + let accountsCreated = false; + // waiting up to 1 minute with .25 sec retry + for (let index = 0; index < 240; index++) { + accountsCreated = await checkBalances(); + if(accountsCreated) break; + await new Promise(resolve => setTimeout(resolve, 250)); + } + + if (!accountsCreated) throw Error('Accounts generation failed'); + //#endregion + return accounts; }; } \ No newline at end of file From 1b03174d8784c7295f19db05b596b5aa5de9316e Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 25 Aug 2022 05:51:30 +0000 Subject: [PATCH 0556/1274] fix: Spend gas before do some thing. --- pallets/evm-contract-helpers/src/eth.rs | 48 ++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 98c1020dda..8dc67933ce 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -65,6 +65,9 @@ where contract_address: address, sponsor: address, ) -> Result { + self.recorder().consume_sload()?; + self.recorder().consume_sstore()?; + Pallet::::set_sponsor( &T::CrossAccountId::from_eth(caller), contract_address, @@ -72,9 +75,6 @@ where ) .map_err(dispatch_to_evm::)?; - self.recorder().consume_sload()?; - self.recorder().consume_sstore()?; - Ok(()) } @@ -82,12 +82,12 @@ where /// /// @param contract_address Contract for which a self sponsoring is being enabled. fn self_sponsored_enable(&mut self, caller: caller, contract_address: address) -> Result { - Pallet::::self_sponsored_enable(&T::CrossAccountId::from_eth(caller), contract_address) - .map_err(dispatch_to_evm::)?; - self.recorder().consume_sload()?; self.recorder().consume_sstore()?; + Pallet::::self_sponsored_enable(&T::CrossAccountId::from_eth(caller), contract_address) + .map_err(dispatch_to_evm::)?; + Ok(()) } @@ -95,12 +95,12 @@ where /// /// @param contract_address Contract for which a sponsorship is being removed. fn remove_sponsor(&mut self, caller: caller, contract_address: address) -> Result { - Pallet::::remove_sponsor(&T::CrossAccountId::from_eth(caller), contract_address) - .map_err(dispatch_to_evm::)?; - self.recorder().consume_sload()?; self.recorder().consume_sstore()?; + Pallet::::remove_sponsor(&T::CrossAccountId::from_eth(caller), contract_address) + .map_err(dispatch_to_evm::)?; + Ok(()) } @@ -110,12 +110,12 @@ where /// /// @param contract_address Сontract for which need to confirm sponsorship. fn confirm_sponsorship(&mut self, caller: caller, contract_address: address) -> Result { - Pallet::::confirm_sponsorship(&T::CrossAccountId::from_eth(caller), contract_address) - .map_err(dispatch_to_evm::)?; - self.recorder().consume_sload()?; self.recorder().consume_sstore()?; + Pallet::::confirm_sponsorship(&T::CrossAccountId::from_eth(caller), contract_address) + .map_err(dispatch_to_evm::)?; + Ok(()) } @@ -165,13 +165,13 @@ where contract_address: address, mode: uint8, ) -> Result { + self.recorder().consume_sload()?; + self.recorder().consume_sstore()?; + >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; let mode = SponsoringModeT::from_eth(mode).ok_or("unknown mode")?; >::set_sponsoring_mode(contract_address, mode); - self.recorder().consume_sload()?; - self.recorder().consume_sstore()?; - Ok(()) } @@ -185,12 +185,12 @@ where contract_address: address, rate_limit: uint32, ) -> Result { - >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; - >::set_sponsoring_rate_limit(contract_address, rate_limit.into()); - self.recorder().consume_sload()?; self.recorder().consume_sstore()?; + >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; + >::set_sponsoring_rate_limit(contract_address, rate_limit.into()); + Ok(()) } @@ -215,12 +215,12 @@ where contract_address: address, enabled: bool, ) -> Result { - >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; - >::toggle_allowlist(contract_address, enabled); - self.recorder().consume_sload()?; self.recorder().consume_sstore()?; + >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; + >::toggle_allowlist(contract_address, enabled); + Ok(()) } @@ -231,11 +231,11 @@ where user: address, allowed: bool, ) -> Result { - >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; - >::toggle_allowed(contract_address, user, allowed); - self.recorder().consume_sload()?; self.recorder().consume_sstore()?; + + >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; + >::toggle_allowed(contract_address, user, allowed); Ok(()) } From 4b4feb5f2c47fe8bd36eef6860949a6dc3d295f4 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 25 Aug 2022 06:11:52 +0000 Subject: [PATCH 0557/1274] fix: Small fixes. --- Cargo.lock | 2 +- pallets/common/CHANGELOG.md | 2 +- pallets/common/Cargo.toml | 2 +- tests/src/eth/collectionSponsoring.test.ts | 2 +- tests/src/eth/contractSponsoring.test.ts | 1 - tests/src/eth/sponsoring.test.ts | 2 -- 6 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b0843a750a..f7f6a639b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5552,7 +5552,7 @@ dependencies = [ [[package]] name = "pallet-common" -version = "0.1.6" +version = "0.1.7" dependencies = [ "ethereum", "evm-coder", diff --git a/pallets/common/CHANGELOG.md b/pallets/common/CHANGELOG.md index 8d15115ff9..e3be235edc 100644 --- a/pallets/common/CHANGELOG.md +++ b/pallets/common/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -## [0.2.0] - 2022-08-19 +## [0.1.7] - 2022-08-19 ### Added diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index cdebd3d08c..fedca0d6e2 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-common" -version = "0.1.6" +version = "0.1.7" license = "GPLv3" edition = "2021" diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index 1e7d9bf5f5..71db092067 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -2,7 +2,7 @@ import {addToAllowListExpectSuccess, confirmSponsorshipExpectSuccess, createColl import {itWeb3, createEthAccount, collectionIdToAddress, GAS_ARGS, normalizeEvents, createEthAccountWithBalance, evmCollectionHelpers, getCollectionAddressFromResult, evmCollection, ethBalanceViaSub} from './util/helpers'; import nonFungibleAbi from './nonFungibleAbi.json'; import {expect} from 'chai'; -import { evmToAddress } from '@polkadot/util-crypto'; +import {evmToAddress} from '@polkadot/util-crypto'; describe('evm collection sponsoring', () => { itWeb3('sponsors mint transactions', async ({web3, privateKeyWrapper}) => { diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index 7e47716ddc..a493c4d0e1 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -25,7 +25,6 @@ import { createEthAccount, ethBalanceViaSub, } from './util/helpers'; -import {evmToAddress} from '@polkadot/util-crypto'; describe('Sponsoring EVM contracts', () => { itWeb3('Self sponsored can be set by the address that deployed the contract', async ({api, web3, privateKeyWrapper}) => { diff --git a/tests/src/eth/sponsoring.test.ts b/tests/src/eth/sponsoring.test.ts index 335ef6345f..c6ebe18768 100644 --- a/tests/src/eth/sponsoring.test.ts +++ b/tests/src/eth/sponsoring.test.ts @@ -51,8 +51,6 @@ describe('EVM sponsoring', () => { }); itWeb3('...but this doesn\'t applies to payable value', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); From e80fd26fb5bfa9712ec2f08d05fa41da12e48929 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 25 Aug 2022 08:57:24 +0000 Subject: [PATCH 0558/1274] fmt --- pallets/evm-contract-helpers/src/eth.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 8dc67933ce..2153d003d2 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -233,7 +233,7 @@ where ) -> Result { self.recorder().consume_sload()?; self.recorder().consume_sstore()?; - + >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; >::toggle_allowed(contract_address, user, allowed); From 7079d71009aa44e1e4ed5ca122f6e0a7a88dd398 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Thu, 25 Aug 2022 09:34:06 +0000 Subject: [PATCH 0559/1274] fix after review --- tests/src/util/playgrounds/unique.dev.ts | 28 ++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 59b883fa9a..c183a2b6f2 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -70,7 +70,7 @@ class ArrangeGroup { * @returns array of newly created accounts * @example const [acc1, acc2, acc3] = await createAccounts([0n, 10n, 20n], donor); */ - creteAccounts = async (balances: bigint[], donor: TSigner): Promise => { + creteAccounts = async (balances: bigint[], donor: IKeyringPair): Promise => { let nonce = await this.helper.chain.getNonce(donor.address); const tokenNominal = this.helper.balance.getOneTokenNominal(); const transactions = []; @@ -101,11 +101,12 @@ class ArrangeGroup { }; let accountsCreated = false; - // waiting up to 1 minute with .25 sec retry - for (let index = 0; index < 240; index++) { + // checkBalances retry up to 5 blocks + for (let index = 0; index < 5; index++) { + console.log(await this.helper.chain.getLatestBlockNumber()); accountsCreated = await checkBalances(); if(accountsCreated) break; - await new Promise(resolve => setTimeout(resolve, 250)); + await this.waitNewBlocks(1); } if (!accountsCreated) throw Error('Accounts generation failed'); @@ -113,4 +114,23 @@ class ArrangeGroup { return accounts; }; + + /** + * Wait for specified bnumber of blocks + * @param blocksCount number of blocks to wait + * @returns + */ + async waitNewBlocks(blocksCount = 1): Promise { + const promise = new Promise(async (resolve) => { + const unsubscribe = await this.helper.api!.rpc.chain.subscribeNewHeads(() => { + if (blocksCount > 0) { + blocksCount--; + } else { + unsubscribe(); + resolve(); + } + }); + }); + return promise; + } } \ No newline at end of file From 0dac160136eb68a2d91425836f92a51b19769b85 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 25 Aug 2022 09:42:35 +0000 Subject: [PATCH 0560/1274] feat(chain_spec): depend on runtime feature --- node/cli/src/chain_spec.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/node/cli/src/chain_spec.rs b/node/cli/src/chain_spec.rs index 085b529ec8..19551004b3 100644 --- a/node/cli/src/chain_spec.rs +++ b/node/cli/src/chain_spec.rs @@ -65,6 +65,15 @@ pub enum RuntimeId { Unknown(String), } + +#[cfg(not(feature = "unique-runtime"))] +/// PARA_ID for Opal/Quartz +const PARA_ID: u32 = 2095; + +#[cfg(feature = "unique-runtime")] +/// PARA_ID for Unique +const PARA_ID: u32 = 2037; + pub trait RuntimeIdentification { fn runtime_id(&self) -> RuntimeId; } @@ -236,7 +245,7 @@ pub fn development_config() -> DefaultChainSpec { get_account_id_from_seed::("Eve//stash"), get_account_id_from_seed::("Ferdie//stash"), ], - 2037 + PARA_ID ) }, // Bootnodes @@ -251,7 +260,7 @@ pub fn development_config() -> DefaultChainSpec { // Extensions Extensions { relay_chain: "rococo-dev".into(), - para_id: 2037, + para_id: PARA_ID, }, ) } @@ -304,7 +313,7 @@ pub fn local_testnet_config() -> DefaultChainSpec { get_account_id_from_seed::("Eve//stash"), get_account_id_from_seed::("Ferdie//stash"), ], - 2037 + PARA_ID ) }, // Bootnodes @@ -319,7 +328,7 @@ pub fn local_testnet_config() -> DefaultChainSpec { // Extensions Extensions { relay_chain: "westend-local".into(), - para_id: 2037, + para_id: PARA_ID, }, ) } From 1985fdc1d4b3b260b724028807f05bb30594eae0 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 25 Aug 2022 11:01:49 +0300 Subject: [PATCH 0561/1274] fix: specify ws max connections to handle higher load --- .docker/forkless-config/launch-config-forkless-nodata.j2 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.docker/forkless-config/launch-config-forkless-nodata.j2 b/.docker/forkless-config/launch-config-forkless-nodata.j2 index 94f121b0fa..71ccf2da38 100644 --- a/.docker/forkless-config/launch-config-forkless-nodata.j2 +++ b/.docker/forkless-config/launch-config-forkless-nodata.j2 @@ -101,7 +101,8 @@ "--rpc-cors=all", "--unsafe-rpc-external", "--unsafe-ws-external", - "-lxcm=trace" + "-lxcm=trace", + "--ws-max-connections=1000" ] }, { @@ -113,7 +114,8 @@ "--rpc-cors=all", "--unsafe-rpc-external", "--unsafe-ws-external", - "-lxcm=trace" + "-lxcm=trace", + "--ws-max-connections=1000" ] } ] From 34aa63775a59f91868d037fce87fc2e90f361d75 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 25 Aug 2022 11:05:33 +0300 Subject: [PATCH 0562/1274] fix: docker cache cleanup --- .github/workflows/nodes-only-update.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index 0dee535dd4..7e63f598bc 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -289,3 +289,8 @@ jobs: - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" down + + #docker-compose rm -f + - name: Remove Docker build artefacts + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" rm -f From b6f414fb480e392cde6e7534d72902ba284a5957 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 12 Jul 2022 10:57:01 +0200 Subject: [PATCH 0563/1274] refactor(evm-coder)!: manual macro parsing We have plans to allow evm-coder to generate Callables for externally defined contracts, however our current attribute parsing was limiting code maintanability, rework was needed before starting to implement new features BREAKING CHANGE: solidity_interface definitions may now look slightly different, for example interface names now should be identifiers, not strings --- crates/evm-coder-macros/Cargo.toml | 5 +- crates/evm-coder-macros/src/lib.rs | 8 +- .../src/solidity_interface.rs | 251 +++++++++++------- crates/evm-coder-macros/src/to_log.rs | 2 +- crates/evm-coder/src/solidity.rs | 10 +- crates/evm-coder/tests/generics.rs | 6 +- crates/evm-coder/tests/random.rs | 12 +- crates/evm-coder/tests/solidity_generation.rs | 2 +- 8 files changed, 185 insertions(+), 111 deletions(-) diff --git a/crates/evm-coder-macros/Cargo.toml b/crates/evm-coder-macros/Cargo.toml index f8f7c85d6d..d24553a78e 100644 --- a/crates/evm-coder-macros/Cargo.toml +++ b/crates/evm-coder-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "evm-coder-macros" -version = "0.1.0" +version = "0.2.0" license = "GPLv3" edition = "2021" @@ -8,10 +8,9 @@ edition = "2021" proc-macro = true [dependencies] -sha3 = "0.9.1" +sha3 = "0.10.1" quote = "1.0" proc-macro2 = "1.0" syn = { version = "1.0", features = ["full"] } hex = "0.4.3" Inflector = "0.11.4" -darling = "0.13.0" diff --git a/crates/evm-coder-macros/src/lib.rs b/crates/evm-coder-macros/src/lib.rs index a241a91059..f0619ce694 100644 --- a/crates/evm-coder-macros/src/lib.rs +++ b/crates/evm-coder-macros/src/lib.rs @@ -16,14 +16,13 @@ #![allow(dead_code)] -use darling::FromMeta; use inflector::cases; use proc_macro::TokenStream; use quote::quote; use sha3::{Digest, Keccak256}; use syn::{ - AttributeArgs, DeriveInput, GenericArgument, Ident, ItemImpl, Pat, Path, PathArguments, - PathSegment, Type, parse_macro_input, spanned::Spanned, + DeriveInput, GenericArgument, Ident, ItemImpl, Pat, Path, PathArguments, + PathSegment, Type, parse_macro_input, spanned::Spanned, Attribute, parse::Parse, }; mod solidity_interface; @@ -254,8 +253,7 @@ fn pascal_ident_to_snake_call(ident: &Ident) -> Ident { /// ``` #[proc_macro_attribute] pub fn solidity_interface(args: TokenStream, stream: TokenStream) -> TokenStream { - let args = parse_macro_input!(args as AttributeArgs); - let args = solidity_interface::InterfaceInfo::from_list(&args).unwrap(); + let args = parse_macro_input!(args as solidity_interface::InterfaceInfo); let input: ItemImpl = match syn::parse(stream) { Ok(t) => t, diff --git a/crates/evm-coder-macros/src/solidity_interface.rs b/crates/evm-coder-macros/src/solidity_interface.rs index cd9e1abdcd..722abd1aca 100644 --- a/crates/evm-coder-macros/src/solidity_interface.rs +++ b/crates/evm-coder-macros/src/solidity_interface.rs @@ -16,14 +16,15 @@ #![allow(dead_code)] -use quote::quote; -use darling::{FromMeta, ToTokens}; +use quote::{quote, ToTokens}; use inflector::cases; use std::fmt::Write; use syn::{ Expr, FnArg, GenericArgument, Generics, Ident, ImplItem, ImplItemMethod, ItemImpl, Lit, Meta, - MetaNameValue, NestedMeta, PatType, Path, PathArguments, ReturnType, Type, spanned::Spanned, - parse_str, + MetaNameValue, PatType, PathArguments, ReturnType, Type, + spanned::Spanned, + parse::{Parse, ParseStream}, + parenthesized, Token, LitInt, LitStr, }; use crate::{ @@ -39,19 +40,6 @@ struct Is { via: Option<(Type, Ident)>, } impl Is { - fn new_via(path: &Path, via: Option<(Type, Ident)>) -> syn::Result { - let name = parse_ident_from_path(path, false)?.clone(); - Ok(Self { - pascal_call_name: pascal_ident_to_call(&name), - snake_call_name: pascal_ident_to_snake_call(&name), - name, - via, - }) - } - fn new(path: &Path) -> syn::Result { - Self::new_via(path, None) - } - fn expand_call_def(&self, gen_ref: &proc_macro2::TokenStream) -> proc_macro2::TokenStream { let name = &self.name; let pascal_call_name = &self.pascal_call_name; @@ -137,73 +125,141 @@ impl Is { #[derive(Default)] struct IsList(Vec); -impl FromMeta for IsList { - fn from_list(items: &[NestedMeta]) -> darling::Result { - let mut out = Vec::new(); - for item in items { - match item { - NestedMeta::Meta(Meta::Path(path)) => out.push(Is::new(path)?), - // TODO: replace meta parsing with manual - NestedMeta::Meta(Meta::List(list)) - if list.path.is_ident("via") && list.nested.len() == 3 => - { - let mut data = list.nested.iter(); - let typ = match data.next().expect("len == 3") { - NestedMeta::Lit(Lit::Str(s)) => { - let v = s.value(); - let typ: Type = parse_str(&v)?; - typ - } - _ => { - return Err(syn::Error::new( - item.span(), - "via typ should be type in string", - ) - .into()) - } - }; - let via = match data.next().expect("len == 3") { - NestedMeta::Meta(Meta::Path(path)) => path - .get_ident() - .ok_or_else(|| syn::Error::new(item.span(), "via should be ident"))?, - _ => return Err(syn::Error::new(item.span(), "via should be ident").into()), - }; - let path = match data.next().expect("len == 3") { - NestedMeta::Meta(Meta::Path(path)) => path, - _ => return Err(syn::Error::new(item.span(), "path should be path").into()), - }; - - out.push(Is::new_via(path, Some((typ, via.clone())))?) - } - _ => { - return Err(syn::Error::new( - item.span(), - "expected either Name or via(\"Type\", getter, Name)", - ) - .into()) - } +impl Parse for IsList { + fn parse(input: ParseStream) -> syn::Result { + let mut out = vec![]; + loop { + if input.is_empty() { + break; + } + let name = input.parse::()?; + let lookahead = input.lookahead1(); + let via = if lookahead.peek(syn::token::Paren) { + let contents; + parenthesized!(contents in input); + let method = contents.parse::()?; + contents.parse::()?; + let ty = contents.parse::()?; + Some((ty, method)) + } else if lookahead.peek(Token![,]) { + None + } else if input.is_empty() { + None + } else { + return Err(lookahead.error()); + }; + out.push(Is { + pascal_call_name: pascal_ident_to_call(&name), + snake_call_name: pascal_ident_to_snake_call(&name), + name, + via, + }); + if input.peek(Token![,]) { + input.parse::()?; + continue; + } else { + break; } } Ok(Self(out)) } } -#[derive(FromMeta)] pub struct InterfaceInfo { name: Ident, - #[darling(default)] is: IsList, - #[darling(default)] inline_is: IsList, - #[darling(default)] events: IsList, + expect_selector: Option, +} +impl Parse for InterfaceInfo { + fn parse(input: ParseStream) -> syn::Result { + let mut name = None; + let mut is = None; + let mut inline_is = None; + let mut events = None; + let mut expect_selector = None; + // TODO: create proc-macro to optimize proc-macro boilerplate? :D + loop { + let lookahead = input.lookahead1(); + if lookahead.peek(kw::name) { + let k = input.parse::()?; + input.parse::()?; + if name.replace(input.parse::()?).is_some() { + return Err(syn::Error::new(k.span(), "name is already set")); + } + } else if lookahead.peek(kw::is) { + let k = input.parse::()?; + let contents; + parenthesized!(contents in input); + if is.replace(contents.parse::()?).is_some() { + return Err(syn::Error::new(k.span(), "is is already set")); + } + } else if lookahead.peek(kw::inline_is) { + let k = input.parse::()?; + let contents; + parenthesized!(contents in input); + if inline_is.replace(contents.parse::()?).is_some() { + return Err(syn::Error::new(k.span(), "inline_is is already set")); + } + } else if lookahead.peek(kw::events) { + let k = input.parse::()?; + let contents; + parenthesized!(contents in input); + if events.replace(contents.parse::()?).is_some() { + return Err(syn::Error::new(k.span(), "events is already set")); + } + } else if lookahead.peek(kw::expect_selector) { + let k = input.parse::()?; + input.parse::()?; + let value = input.parse::()?; + if expect_selector + .replace(value.base10_parse::()?) + .is_some() + { + return Err(syn::Error::new(k.span(), "expect_selector is already set")); + } + } else if input.is_empty() { + break; + } else { + return Err(lookahead.error()); + } + if input.peek(Token![,]) { + input.parse::()?; + } else { + break; + } + } + Ok(Self { + name: name.ok_or_else(|| syn::Error::new(input.span(), "missing name"))?, + is: is.unwrap_or_default(), + inline_is: inline_is.unwrap_or_default(), + events: events.unwrap_or_default(), + expect_selector, + }) + } } -#[derive(FromMeta)] struct MethodInfo { - #[darling(default)] rename_selector: Option, } +impl Parse for MethodInfo { + fn parse(input: ParseStream) -> syn::Result { + let mut rename_selector = None; + let lookahead = input.lookahead1(); + if lookahead.peek(kw::rename_selector) { + let k = input.parse::()?; + input.parse::()?; + if rename_selector + .replace(input.parse::()?.value()) + .is_some() + { + return Err(syn::Error::new(k.span(), "rename_selector is already set")); + } + } + Ok(Self { rename_selector }) + } +} enum AbiType { // type @@ -258,7 +314,7 @@ impl AbiType { "expected only one generic for vec", )); } - let arg = args.first().unwrap(); + let arg = args.first().expect("first arg"); let ty = match arg { GenericArgument::Type(ty) => ty, @@ -429,23 +485,17 @@ enum Mutability { Pure, } -pub struct WeightAttr(syn::Expr); - -mod keyword { +mod kw { syn::custom_keyword!(weight); -} -impl syn::parse::Parse for WeightAttr { - fn parse(input: syn::parse::ParseStream) -> syn::Result { - input.parse::()?; - let content; - syn::bracketed!(content in input); - content.parse::()?; + syn::custom_keyword!(via); + syn::custom_keyword!(name); + syn::custom_keyword!(is); + syn::custom_keyword!(inline_is); + syn::custom_keyword!(events); + syn::custom_keyword!(expect_selector); - let weight_content; - syn::parenthesized!(weight_content in content); - Ok(WeightAttr(weight_content.parse::()?)) - } + syn::custom_keyword!(rename_selector); } struct Method { @@ -472,8 +522,7 @@ impl Method { for attr in &value.attrs { let ident = parse_ident_from_path(&attr.path, false)?; if ident == "solidity" { - let args = attr.parse_meta().unwrap(); - info = MethodInfo::from_meta(&args).unwrap(); + info = attr.parse_args::()?; } else if ident == "doc" { let args = attr.parse_meta().unwrap(); let value = match args { @@ -484,7 +533,7 @@ impl Method { }; docs.push(value); } else if ident == "weight" { - weight = Some(syn::parse2::(attr.to_token_stream())?.0); + weight = Some(attr.parse_args::()?); } } let ident = &value.sig.ident; @@ -869,6 +918,28 @@ impl SolidityInterface { .map(|is| Is::expand_generator(is, &gen_ref)); let solidity_event_generators = self.info.events.0.iter().map(Is::expand_event_generator); + if let Some(expect_selector) = &self.info.expect_selector { + if !self.info.inline_is.0.is_empty() { + return syn::Error::new( + name.span(), + "expect_selector is not compatible with inline_is", + ) + .to_compile_error(); + } + let selector = self + .methods + .iter() + .map(|m| m.selector) + .fold(0, |a, b| a ^ b); + + if *expect_selector != selector { + let mut methods = String::new(); + for meth in self.methods.iter() { + write!(methods, "\n- {}", meth.selector_str).expect("write to string"); + } + return syn::Error::new(name.span(), format!("expected selector mismatch, expected {expect_selector:0>8x}, but implementation has {selector:0>8x}{methods}")).to_compile_error(); + } + } // let methods = self.methods.iter().map(Method::solidity_def); quote! { @@ -917,9 +988,9 @@ impl SolidityInterface { )*), }; if is_impl { - tc.collect("// Common stubs holder\ncontract Dummy {\n\tuint8 dummy;\n\tstring stub_error = \"this contract is implemented in native\";\n}\ncontract ERC165 is Dummy {\n\tfunction supportsInterface(bytes4 interfaceID) external view returns (bool) {\n\t\trequire(false, stub_error);\n\t\tinterfaceID;\n\t\treturn true;\n\t}\n}\n".into()); + tc.collect("/// @dev common stubs holder\ncontract Dummy {\n\tuint8 dummy;\n\tstring stub_error = \"this contract is implemented in native\";\n}\ncontract ERC165 is Dummy {\n\tfunction supportsInterface(bytes4 interfaceID) external view returns (bool) {\n\t\trequire(false, stub_error);\n\t\tinterfaceID;\n\t\treturn true;\n\t}\n}\n".into()); } else { - tc.collect("// Common stubs holder\ninterface Dummy {\n}\ninterface ERC165 is Dummy {\n\tfunction supportsInterface(bytes4 interfaceID) external view returns (bool);\n}\n".into()); + tc.collect("/// @dev common stubs holder\ninterface Dummy {\n}\ninterface ERC165 is Dummy {\n\tfunction supportsInterface(bytes4 interfaceID) external view returns (bool);\n}\n".into()); } #( #solidity_generators @@ -930,9 +1001,9 @@ impl SolidityInterface { let mut out = string::new(); // In solidity interface usage (is) should be preceeded by interface definition - // This comment helps to sort it in a set + // HACK: this comment helps to sort it in a set if #solidity_name.starts_with("Inline") { - out.push_str("// Inline\n"); + out.push_str("/// @dev inlined interface\n"); } let _ = interface.format(is_impl, &mut out, tc); tc.collect(out); diff --git a/crates/evm-coder-macros/src/to_log.rs b/crates/evm-coder-macros/src/to_log.rs index 6b9dab8a21..27fb1998be 100644 --- a/crates/evm-coder-macros/src/to_log.rs +++ b/crates/evm-coder-macros/src/to_log.rs @@ -207,7 +207,7 @@ impl Events { )*), }; let mut out = string::new(); - out.push_str("// Inline\n"); + out.push_str("/// @dev inlined interface\n"); let _ = interface.format(is_impl, &mut out, tc); tc.collect(out); } diff --git a/crates/evm-coder/src/solidity.rs b/crates/evm-coder/src/solidity.rs index c182ac89d9..b07a0dc238 100644 --- a/crates/evm-coder/src/solidity.rs +++ b/crates/evm-coder/src/solidity.rs @@ -56,7 +56,7 @@ impl TypeCollector { } let id = self.next_id(); let mut str = String::new(); - writeln!(str, "// Anonymous struct").unwrap(); + writeln!(str, "/// @dev anonymous struct").unwrap(); writeln!(str, "struct Tuple{} {{", id).unwrap(); for (i, name) in names.iter().enumerate() { writeln!(str, "\t{} field_{};", name, i).unwrap(); @@ -416,12 +416,12 @@ impl SolidityFunctions for SolidityF tc: &TypeCollector, ) -> fmt::Result { for doc in self.docs { - writeln!(writer, "\t//{}", doc)?; + writeln!(writer, "\t///{}", doc)?; } if !self.docs.is_empty() { - writeln!(writer, "\t//")?; + writeln!(writer, "\t///")?; } - writeln!(writer, "\t// Selector: {}", self.selector)?; + writeln!(writer, "\t/// Selector: {}", self.selector)?; write!(writer, "\tfunction {}(", self.name)?; self.args.solidity_name(writer, tc)?; write!(writer, ")")?; @@ -498,7 +498,7 @@ impl SolidityInterface { if self.selector != ZERO_BYTES { writeln!( out, - "// Selector: {:0>8x}", + "/// @dev the ERC-165 identifier for this interface is 0x{:0>8x}", u32::from_be_bytes(self.selector) )?; } diff --git a/crates/evm-coder/tests/generics.rs b/crates/evm-coder/tests/generics.rs index 5ca4bab56a..34b2238aec 100644 --- a/crates/evm-coder/tests/generics.rs +++ b/crates/evm-coder/tests/generics.rs @@ -19,14 +19,14 @@ use evm_coder::{execution::Result, generate_stubgen, solidity_interface, types:: struct Generic(PhantomData); -#[solidity_interface(name = "GenericIs")] +#[solidity_interface(name = GenericIs)] impl Generic { fn test_1(&self) -> Result { unreachable!() } } -#[solidity_interface(name = "Generic", is(GenericIs))] +#[solidity_interface(name = Generic, is(GenericIs))] impl> Generic { fn test_2(&self) -> Result { unreachable!() @@ -35,7 +35,7 @@ impl> Generic { generate_stubgen!(gen_iface, GenericCall<()>, false); -#[solidity_interface(name = "GenericWhere")] +#[solidity_interface(name = GenericWhere)] impl Generic where T: core::fmt::Debug, diff --git a/crates/evm-coder/tests/random.rs b/crates/evm-coder/tests/random.rs index 09ec1dd37a..434f69c54b 100644 --- a/crates/evm-coder/tests/random.rs +++ b/crates/evm-coder/tests/random.rs @@ -21,14 +21,14 @@ use evm_coder_macros::{solidity, weight}; struct Impls; -#[solidity_interface(name = "OurInterface")] +#[solidity_interface(name = OurInterface)] impl Impls { fn fn_a(&self, _input: uint256) -> Result { unreachable!() } } -#[solidity_interface(name = "OurInterface1")] +#[solidity_interface(name = OurInterface1)] impl Impls { fn fn_b(&self, _input: uint128) -> Result { unreachable!() @@ -48,7 +48,7 @@ enum OurEvents { } #[solidity_interface( - name = "OurInterface2", + name = OurInterface2, is(OurInterface), inline_is(OurInterface1), events(OurEvents) @@ -79,3 +79,9 @@ impl Impls { unreachable!() } } + +#[solidity_interface( + name = ValidSelector, + expect_selector = 0x00000000, +)] +impl Impls {} diff --git a/crates/evm-coder/tests/solidity_generation.rs b/crates/evm-coder/tests/solidity_generation.rs index 4a44582ba2..6653070195 100644 --- a/crates/evm-coder/tests/solidity_generation.rs +++ b/crates/evm-coder/tests/solidity_generation.rs @@ -18,7 +18,7 @@ use evm_coder::{execution::Result, generate_stubgen, solidity_interface, types:: struct ERC20; -#[solidity_interface(name = "ERC20")] +#[solidity_interface(name = ERC20)] impl ERC20 { fn decimals(&self) -> Result { unreachable!() From 4e01cb3cfaf7942442f508d95d78a0e355cdc2ee Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 12 Jul 2022 11:01:20 +0200 Subject: [PATCH 0564/1274] build: upgrade to new evm-coder syntax Signed-off-by: Yaroslav Bolyukin --- Cargo.lock | 46 +- pallets/common/src/erc.rs | 8 +- pallets/evm-contract-helpers/src/eth.rs | 24 +- .../src/stubs/ContractHelpers.raw | Bin 1559 -> 1785 bytes .../src/stubs/ContractHelpers.sol | 122 +- pallets/fungible/src/erc.rs | 8 +- pallets/fungible/src/stubs/UniqueFungible.raw | Bin 2853 -> 2853 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 493 ++++---- pallets/nonfungible/src/erc.rs | 55 +- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4272 -> 4272 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 1057 ++++++++-------- pallets/refungible/src/erc.rs | 54 +- pallets/refungible/src/erc_token.rs | 10 +- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4299 -> 4299 bytes .../refungible/src/stubs/UniqueRefungible.sol | 1065 +++++++++-------- .../src/stubs/UniqueRefungibleToken.raw | Bin 1567 -> 1567 bytes .../src/stubs/UniqueRefungibleToken.sol | 185 +-- pallets/unique/src/eth/mod.rs | 6 +- .../src/eth/stubs/CollectionHelpers.raw | Bin 1488 -> 1488 bytes .../src/eth/stubs/CollectionHelpers.sol | 40 +- tests/src/eth/api/CollectionHelpers.sol | 40 +- tests/src/eth/api/ContractHelpers.sol | 120 +- tests/src/eth/api/UniqueFungible.sol | 387 +++--- tests/src/eth/api/UniqueNFT.sol | 845 ++++++------- tests/src/eth/api/UniqueRefungible.sol | 853 ++++++------- tests/src/eth/api/UniqueRefungibleToken.sol | 163 +-- tests/src/eth/nonFungibleAbi.json | 4 +- tests/src/eth/reFungibleAbi.json | 2 +- tests/src/eth/util/contractHelpersAbi.json | 2 +- 29 files changed, 2788 insertions(+), 2801 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f7f6a639b2..1f7a931813 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1771,41 +1771,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "darling" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" -dependencies = [ - "darling_core", - "quote", - "syn", -] - [[package]] name = "data-encoding" version = "2.3.2" @@ -2217,14 +2182,13 @@ dependencies = [ [[package]] name = "evm-coder-macros" -version = "0.1.0" +version = "0.2.0" dependencies = [ "Inflector", - "darling", "hex", "proc-macro2", "quote", - "sha3 0.9.1", + "sha3 0.10.2", "syn", ] @@ -3428,12 +3392,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "idna" version = "0.2.3" diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index a42f7fea9e..44b11c9d75 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -60,7 +60,7 @@ pub trait CommonEvmHandler { } /// @title A contract that allows you to work with collections. -#[solidity_interface(name = "Collection")] +#[solidity_interface(name = Collection)] impl CollectionHandle where T::AccountId: From<[u8; 32]>, @@ -228,7 +228,7 @@ where } /// Add collection admin by substrate address. - /// @param new_admin Substrate administrator address. + /// @param newAdmin Substrate administrator address. fn add_collection_admin_substrate( &mut self, caller: caller, @@ -254,7 +254,7 @@ where } /// Add collection admin. - /// @param new_admin Address of the added administrator. + /// @param newAdmin Address of the added administrator. fn add_collection_admin(&mut self, caller: caller, new_admin: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let new_admin = T::CrossAccountId::from_eth(new_admin); @@ -264,7 +264,7 @@ where /// Remove collection admin. /// - /// @param new_admin Address of the removed administrator. + /// @param admin Address of the removed administrator. fn remove_collection_admin(&mut self, caller: caller, admin: address) -> Result { let caller = T::CrossAccountId::from_eth(caller); let admin = T::CrossAccountId::from_eth(admin); diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 2153d003d2..658db0fe42 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -42,14 +42,14 @@ impl WithRecorder for ContractHelpers { } } -#[solidity_interface(name = "ContractHelpers")] +#[solidity_interface(name = ContractHelpers)] impl ContractHelpers where T::AccountId: AsRef<[u8; 32]>, { /// Get contract ovner /// - /// @param Contract_address contract for which the owner is being determined. + /// @param contractAddress contract for which the owner is being determined. /// @return Contract owner. fn contract_owner(&self, contract_address: address) -> Result
{ Ok(>::get(contract_address)) @@ -57,7 +57,7 @@ where /// Set sponsor. /// - /// @param contract_address Contract for which a sponsor is being established. + /// @param contractAddress Contract for which a sponsor is being established. /// @param sponsor User address who set as pending sponsor. fn set_sponsor( &mut self, @@ -80,7 +80,7 @@ where /// Set contract as self sponsored. /// - /// @param contract_address Contract for which a self sponsoring is being enabled. + /// @param contractAddress Contract for which a self sponsoring is being enabled. fn self_sponsored_enable(&mut self, caller: caller, contract_address: address) -> Result { self.recorder().consume_sload()?; self.recorder().consume_sstore()?; @@ -93,7 +93,7 @@ where /// Remove sponsor. /// - /// @param contract_address Contract for which a sponsorship is being removed. + /// @param contractAddress Contract for which a sponsorship is being removed. fn remove_sponsor(&mut self, caller: caller, contract_address: address) -> Result { self.recorder().consume_sload()?; self.recorder().consume_sstore()?; @@ -106,9 +106,9 @@ where /// Confirm sponsorship. /// - /// @dev Caller must be same that set via [`set_sponsor`]. + /// @dev Caller must be same that set via [`setSponsor`]. /// - /// @param contract_address Сontract for which need to confirm sponsorship. + /// @param contractAddress Сontract for which need to confirm sponsorship. fn confirm_sponsorship(&mut self, caller: caller, contract_address: address) -> Result { self.recorder().consume_sload()?; self.recorder().consume_sstore()?; @@ -121,7 +121,7 @@ where /// Get current sponsor. /// - /// @param contract_address The contract for which a sponsor is requested. + /// @param contractAddress The contract for which a sponsor is requested. /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> { let sponsor = @@ -138,7 +138,7 @@ where /// Check tat contract has confirmed sponsor. /// - /// @param contract_address The contract for which the presence of a confirmed sponsor is checked. + /// @param contractAddress The contract for which the presence of a confirmed sponsor is checked. /// @return **true** if contract has confirmed sponsor. fn has_sponsor(&self, contract_address: address) -> Result { Ok(Pallet::::get_sponsor(contract_address).is_some()) @@ -146,7 +146,7 @@ where /// Check tat contract has pending sponsor. /// - /// @param contract_address The contract for which the presence of a pending sponsor is checked. + /// @param contractAddress The contract for which the presence of a pending sponsor is checked. /// @return **true** if contract has pending sponsor. fn has_pending_sponsor(&self, contract_address: address) -> Result { Ok(match Sponsoring::::get(contract_address) { @@ -229,13 +229,13 @@ where caller: caller, contract_address: address, user: address, - allowed: bool, + is_allowed: bool, ) -> Result { self.recorder().consume_sload()?; self.recorder().consume_sstore()?; >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; - >::toggle_allowed(contract_address, user, allowed); + >::toggle_allowed(contract_address, user, is_allowed); Ok(()) } diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw index c726de9f05b7902c1fccb9082f430e3ef947f077..7d2e5081f0a7b41788ad22f83ad0beff52c5815c 100644 GIT binary patch literal 1785 zcmaJ?U1(fI6rS08Q}R$@Q?je^F7BmNMJRo+O)w&wG^l+jdiRpt8@v_HbhFiHnzqSe z1qEmB&oe>#UK(jb#_&;-jilDi>q#^<#_S<>_U47BQq{9 zeztYu8HC3gu#=_kLO4IMIEIHCM!5LmUJI>hgn#D0IEC zw3Z*4e-z<&&AfDV;eA{ixYcvb{0rd#!rsq6*^5xhe|*d39Ku5`Rsg$^(Orz**8@6B zVNqD>DXdIiAWftJ#e)#Z~;<6mX5vt4fDVnR-WZ^Mc=^SL9XfysDtpxN2kjs5~wC zHJPWiQY1S!W`)fuTi!}zbETWIi{&dR9DL099)30OTsmc`<4MePTOC?no_yB-{9-p#Sfovdj@0nisjl3jbC&cd|*fTeCZUScurNiajow2b4$R@JJiq0`c% zJ=cgx-SAa}WFr7!Me$8F`I1oWR*~-vm=Ru9gZ&)z;i|=MRps5T30i0p{J2?=Bv|jc z)b#wf=?P{)yHzKtOVBfQ51v?S=V)cp<@}QGLVsvOJgjaA#5F)pRUC-E9cD7n zX880Ct8OK)$%xnl;#K6V)UUf@FqHig(fA}b$Q8#6=xI5@r{8*0O+@+Stjvsz9z8TU zynUP5KK^O{#S0U!{&wm49ao;dv-ma1uih~?KQq_$?l-sHdi~3h$s=RM0n(l(yUWjx kPMXCdH1M99=LjV8( delta 949 zcmaKqO=#0#7{}j_v?_Gam9=xWXtslb;6O%)AZkUJ2#Q&lDHy@$bqo<5=nmV#Lz8}q zY=^WN_AU%TggKDO6fc6zv3m0`L1Y{FaTrd)Z=Cf>($o#noc{Sg|KI<8c$4ooZ{({r0qUO;(2 zG;|*22+G-^)k`S%q5OGgu-GEV63VrA6M$|7D~&bX=%=;0TR57*QTHqPb3Ju5SWTe( zf^Kh8ojQ($g!;^YIe>CEO4#*Mxb3=IBuG_|*=~>oeWU4uPS{npwUc}jWYsa*5yza@ zbfSwt=CET%>KvP~Wgg3r1vDFF?D>Yb83*WV0GbY|-u@asRw-txAXDMtjbnc~Kw%>Q z|4Q?NnmzyoD7K#Ki9dtaaV(XnppQ$I;FsOwj1srj^#5fD$k{xPLPJB%zU732cw>avCzZSXt2v zxvabIGXllUOnky=aD`LfVuz z`|??;S_Nudr-Hw?uLaxX6NkS($jH*|lM9E2r%&yuM2yJn!<8p{_Agx=dvUe(fc-SM F_cu4@NACat diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol index 302d2f0657..ebecaffc51 100644 --- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol +++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol @@ -3,13 +3,13 @@ pragma solidity >=0.8.0 <0.9.0; -// Anonymous struct +/// @dev anonymous struct struct Tuple0 { address field_0; uint256 field_1; } -// Common stubs holder +/// @dev common stubs holder contract Dummy { uint8 dummy; string stub_error = "this contract is implemented in native"; @@ -27,14 +27,14 @@ contract ERC165 is Dummy { } } -// Selector: 6073d917 +/// @dev the ERC-165 identifier for this interface is 0x6073d917 contract ContractHelpers is Dummy, ERC165 { - // Get contract ovner - // - // @param Contract_address contract for which the owner is being determined. - // @return Contract owner. - // - // Selector: contractOwner(address) 5152b14c + /// Get contract ovner + /// + /// @param contractAddress contract for which the owner is being determined. + /// @return Contract owner. + /// + /// Selector: contractOwner(address) 5152b14c function contractOwner(address contractAddress) public view @@ -46,12 +46,12 @@ contract ContractHelpers is Dummy, ERC165 { return 0x0000000000000000000000000000000000000000; } - // Set sponsor. - // - // @param contract_address Contract for which a sponsor is being established. - // @param sponsor User address who set as pending sponsor. - // - // Selector: setSponsor(address,address) f01fba93 + /// Set sponsor. + /// + /// @param contractAddress Contract for which a sponsor is being established. + /// @param sponsor User address who set as pending sponsor. + /// + /// Selector: setSponsor(address,address) f01fba93 function setSponsor(address contractAddress, address sponsor) public { require(false, stub_error); contractAddress; @@ -59,47 +59,47 @@ contract ContractHelpers is Dummy, ERC165 { dummy = 0; } - // Set contract as self sponsored. - // - // @param contract_address Contract for which a self sponsoring is being enabled. - // - // Selector: selfSponsoredEnable(address) 89f7d9ae + /// Set contract as self sponsored. + /// + /// @param contractAddress Contract for which a self sponsoring is being enabled. + /// + /// Selector: selfSponsoredEnable(address) 89f7d9ae function selfSponsoredEnable(address contractAddress) public { require(false, stub_error); contractAddress; dummy = 0; } - // Remove sponsor. - // - // @param contract_address Contract for which a sponsorship is being removed. - // - // Selector: removeSponsor(address) ef784250 + /// Remove sponsor. + /// + /// @param contractAddress Contract for which a sponsorship is being removed. + /// + /// Selector: removeSponsor(address) ef784250 function removeSponsor(address contractAddress) public { require(false, stub_error); contractAddress; dummy = 0; } - // Confirm sponsorship. - // - // @dev Caller must be same that set via [`set_sponsor`]. - // - // @param contract_address Сontract for which need to confirm sponsorship. - // - // Selector: confirmSponsorship(address) abc00001 + /// Confirm sponsorship. + /// + /// @dev Caller must be same that set via [`setSponsor`]. + /// + /// @param contractAddress Сontract for which need to confirm sponsorship. + /// + /// Selector: confirmSponsorship(address) abc00001 function confirmSponsorship(address contractAddress) public { require(false, stub_error); contractAddress; dummy = 0; } - // Get current sponsor. - // - // @param contract_address The contract for which a sponsor is requested. - // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - // - // Selector: getSponsor(address) 743fc745 + /// Get current sponsor. + /// + /// @param contractAddress The contract for which a sponsor is requested. + /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + /// + /// Selector: getSponsor(address) 743fc745 function getSponsor(address contractAddress) public view @@ -111,12 +111,12 @@ contract ContractHelpers is Dummy, ERC165 { return Tuple0(0x0000000000000000000000000000000000000000, 0); } - // Check tat contract has confirmed sponsor. - // - // @param contract_address The contract for which the presence of a confirmed sponsor is checked. - // @return **true** if contract has confirmed sponsor. - // - // Selector: hasSponsor(address) 97418603 + /// Check tat contract has confirmed sponsor. + /// + /// @param contractAddress The contract for which the presence of a confirmed sponsor is checked. + /// @return **true** if contract has confirmed sponsor. + /// + /// Selector: hasSponsor(address) 97418603 function hasSponsor(address contractAddress) public view returns (bool) { require(false, stub_error); contractAddress; @@ -124,12 +124,12 @@ contract ContractHelpers is Dummy, ERC165 { return false; } - // Check tat contract has pending sponsor. - // - // @param contract_address The contract for which the presence of a pending sponsor is checked. - // @return **true** if contract has pending sponsor. - // - // Selector: hasPendingSponsor(address) 39b9b242 + /// Check tat contract has pending sponsor. + /// + /// @param contractAddress The contract for which the presence of a pending sponsor is checked. + /// @return **true** if contract has pending sponsor. + /// + /// Selector: hasPendingSponsor(address) 39b9b242 function hasPendingSponsor(address contractAddress) public view @@ -141,7 +141,7 @@ contract ContractHelpers is Dummy, ERC165 { return false; } - // Selector: sponsoringEnabled(address) 6027dc61 + /// Selector: sponsoringEnabled(address) 6027dc61 function sponsoringEnabled(address contractAddress) public view @@ -153,7 +153,7 @@ contract ContractHelpers is Dummy, ERC165 { return false; } - // Selector: setSponsoringMode(address,uint8) fde8a560 + /// Selector: setSponsoringMode(address,uint8) fde8a560 function setSponsoringMode(address contractAddress, uint8 mode) public { require(false, stub_error); contractAddress; @@ -161,7 +161,7 @@ contract ContractHelpers is Dummy, ERC165 { dummy = 0; } - // Selector: sponsoringMode(address) b70c7267 + /// Selector: sponsoringMode(address) b70c7267 function sponsoringMode(address contractAddress) public view @@ -173,7 +173,7 @@ contract ContractHelpers is Dummy, ERC165 { return 0; } - // Selector: setSponsoringRateLimit(address,uint32) 77b6c908 + /// Selector: setSponsoringRateLimit(address,uint32) 77b6c908 function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) public { @@ -183,7 +183,7 @@ contract ContractHelpers is Dummy, ERC165 { dummy = 0; } - // Selector: getSponsoringRateLimit(address) 610cfabd + /// Selector: getSponsoringRateLimit(address) 610cfabd function getSponsoringRateLimit(address contractAddress) public view @@ -195,7 +195,7 @@ contract ContractHelpers is Dummy, ERC165 { return 0; } - // Selector: allowed(address,address) 5c658165 + /// Selector: allowed(address,address) 5c658165 function allowed(address contractAddress, address user) public view @@ -208,7 +208,7 @@ contract ContractHelpers is Dummy, ERC165 { return false; } - // Selector: allowlistEnabled(address) c772ef6c + /// Selector: allowlistEnabled(address) c772ef6c function allowlistEnabled(address contractAddress) public view @@ -220,7 +220,7 @@ contract ContractHelpers is Dummy, ERC165 { return false; } - // Selector: toggleAllowlist(address,bool) 36de20f5 + /// Selector: toggleAllowlist(address,bool) 36de20f5 function toggleAllowlist(address contractAddress, bool enabled) public { require(false, stub_error); contractAddress; @@ -228,16 +228,16 @@ contract ContractHelpers is Dummy, ERC165 { dummy = 0; } - // Selector: toggleAllowed(address,address,bool) 4706cc1c + /// Selector: toggleAllowed(address,address,bool) 4706cc1c function toggleAllowed( address contractAddress, address user, - bool allowed + bool isAllowed ) public { require(false, stub_error); contractAddress; user; - allowed; + isAllowed; dummy = 0; } } diff --git a/pallets/fungible/src/erc.rs b/pallets/fungible/src/erc.rs index fcdcf025a4..86712df9a2 100644 --- a/pallets/fungible/src/erc.rs +++ b/pallets/fungible/src/erc.rs @@ -50,7 +50,7 @@ pub enum ERC20Events { }, } -#[solidity_interface(name = "ERC20", events(ERC20Events))] +#[solidity_interface(name = ERC20, events(ERC20Events))] impl FungibleHandle { fn name(&self) -> Result { Ok(decode_utf16(self.name.iter().copied()) @@ -129,7 +129,7 @@ impl FungibleHandle { } } -#[solidity_interface(name = "ERC20UniqueExtensions")] +#[solidity_interface(name = ERC20UniqueExtensions)] impl FungibleHandle { #[weight(>::burn_from())] fn burn_from(&mut self, caller: caller, from: address, amount: uint256) -> Result { @@ -147,11 +147,11 @@ impl FungibleHandle { } #[solidity_interface( - name = "UniqueFungible", + name = UniqueFungible, is( ERC20, ERC20UniqueExtensions, - via("CollectionHandle", common_mut, Collection) + Collection(common_mut, CollectionHandle), ) )] impl FungibleHandle where T::AccountId: From<[u8; 32]> {} diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index a4ac087109e18fff3aba98a5ef348ed976957fb8..aabc949e52af579eae754af245332143be518430 100644 GIT binary patch delta 44 zcmV+{0Mq}a7Nr)j)CwS5ml<*ndu$JtN|HPtBxn?goz~o*;~AHePwi!Z#o0iU^a?SN C9}{i> delta 44 zcmV+{0Mq}a7Nr)j)CwTww;9%m5E0d8Zy}w;GP_^e9VaAYCT#u@t?-7CzkAb@^a?S) CSrnT9 diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index 5de80ec40f..1be1a6a614 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -3,7 +3,7 @@ pragma solidity >=0.8.0 <0.9.0; -// Common stubs holder +/// @dev common stubs holder contract Dummy { uint8 dummy; string stub_error = "this contract is implemented in native"; @@ -21,120 +21,15 @@ contract ERC165 is Dummy { } } -// Inline -contract ERC20Events { - event Transfer(address indexed from, address indexed to, uint256 value); - event Approval( - address indexed owner, - address indexed spender, - uint256 value - ); -} - -// Selector: 79cc6790 -contract ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) public returns (bool) { - require(false, stub_error); - from; - amount; - dummy = 0; - return false; - } -} - -// Selector: 942e8b22 -contract ERC20 is Dummy, ERC165, ERC20Events { - // Selector: name() 06fdde03 - function name() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: symbol() 95d89b41 - function symbol() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: decimals() 313ce567 - function decimals() public view returns (uint8) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) public view returns (uint256) { - require(false, stub_error); - owner; - dummy; - return 0; - } - - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 amount) public returns (bool) { - require(false, stub_error); - to; - amount; - dummy = 0; - return false; - } - - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 amount - ) public returns (bool) { - require(false, stub_error); - from; - to; - amount; - dummy = 0; - return false; - } - - // Selector: approve(address,uint256) 095ea7b3 - function approve(address spender, uint256 amount) public returns (bool) { - require(false, stub_error); - spender; - amount; - dummy = 0; - return false; - } - - // Selector: allowance(address,address) dd62ed3e - function allowance(address owner, address spender) - public - view - returns (uint256) - { - require(false, stub_error); - owner; - spender; - dummy; - return 0; - } -} - -// Selector: ffe4da23 +/// @title A contract that allows you to work with collections. +/// @dev the ERC-165 identifier for this interface is 0xffe4da23 contract Collection is Dummy, ERC165 { - // Set collection property. - // - // @param key Property key. - // @param value Propery value. - // - // Selector: setCollectionProperty(string,bytes) 2f073f66 + /// Set collection property. + /// + /// @param key Property key. + /// @param value Propery value. + /// @dev EVM selector for this function is: 0x2f073f66, + /// or in textual repr: setCollectionProperty(string,bytes) function setCollectionProperty(string memory key, bytes memory value) public { @@ -144,25 +39,25 @@ contract Collection is Dummy, ERC165 { dummy = 0; } - // Delete collection property. - // - // @param key Property key. - // - // Selector: deleteCollectionProperty(string) 7b7debce + /// Delete collection property. + /// + /// @param key Property key. + /// @dev EVM selector for this function is: 0x7b7debce, + /// or in textual repr: deleteCollectionProperty(string) function deleteCollectionProperty(string memory key) public { require(false, stub_error); key; dummy = 0; } - // Get collection property. - // - // @dev Throws error if key not found. - // - // @param key Property key. - // @return bytes The property corresponding to the key. - // - // Selector: collectionProperty(string) cf24fd6d + /// Get collection property. + /// + /// @dev Throws error if key not found. + /// + /// @param key Property key. + /// @return bytes The property corresponding to the key. + /// @dev EVM selector for this function is: 0xcf24fd6d, + /// or in textual repr: collectionProperty(string) function collectionProperty(string memory key) public view @@ -174,41 +69,41 @@ contract Collection is Dummy, ERC165 { return hex""; } - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsor(address) 7623402e + /// Set the sponsor of the collection. + /// + /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + /// + /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + /// @dev EVM selector for this function is: 0x7623402e, + /// or in textual repr: setCollectionSponsor(address) function setCollectionSponsor(address sponsor) public { require(false, stub_error); sponsor; dummy = 0; } - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a + /// Collection sponsorship confirmation. + /// + /// @dev After setting the sponsor for the collection, it must be confirmed with this function. + /// @dev EVM selector for this function is: 0x3c50e97a, + /// or in textual repr: confirmCollectionSponsorship() function confirmCollectionSponsorship() public { require(false, stub_error); dummy = 0; } - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db + /// Set limits for the collection. + /// @dev Throws error if limit not found. + /// @param limit Name of the limit. Valid names: + /// "accountTokenOwnershipLimit", + /// "sponsoredDataSize", + /// "sponsoredDataRateLimit", + /// "tokenLimit", + /// "sponsorTransferTimeout", + /// "sponsorApproveTimeout" + /// @param value Value of the limit. + /// @dev EVM selector for this function is: 0x6a3841db, + /// or in textual repr: setCollectionLimit(string,uint32) function setCollectionLimit(string memory limit, uint32 value) public { require(false, stub_error); limit; @@ -216,15 +111,15 @@ contract Collection is Dummy, ERC165 { dummy = 0; } - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,bool) 993b7fba + /// Set limits for the collection. + /// @dev Throws error if limit not found. + /// @param limit Name of the limit. Valid names: + /// "ownerCanTransfer", + /// "ownerCanDestroy", + /// "transfersEnabled" + /// @param value Value of the limit. + /// @dev EVM selector for this function is: 0x993b7fba, + /// or in textual repr: setCollectionLimit(string,bool) function setCollectionLimit(string memory limit, bool value) public { require(false, stub_error); limit; @@ -232,73 +127,73 @@ contract Collection is Dummy, ERC165 { dummy = 0; } - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 + /// Get contract address. + /// @dev EVM selector for this function is: 0xf6b4dfb4, + /// or in textual repr: contractAddress() function contractAddress() public view returns (address) { require(false, stub_error); dummy; return 0x0000000000000000000000000000000000000000; } - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. - // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b + /// Add collection admin by substrate address. + /// @param newAdmin Substrate administrator address. + /// @dev EVM selector for this function is: 0x5730062b, + /// or in textual repr: addCollectionAdminSubstrate(uint256) function addCollectionAdminSubstrate(uint256 newAdmin) public { require(false, stub_error); newAdmin; dummy = 0; } - // Remove collection admin by substrate address. - // @param admin Substrate administrator address. - // - // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + /// Remove collection admin by substrate address. + /// @param admin Substrate administrator address. + /// @dev EVM selector for this function is: 0x4048fcf9, + /// or in textual repr: removeCollectionAdminSubstrate(uint256) function removeCollectionAdminSubstrate(uint256 admin) public { require(false, stub_error); admin; dummy = 0; } - // Add collection admin. - // @param new_admin Address of the added administrator. - // - // Selector: addCollectionAdmin(address) 92e462c7 + /// Add collection admin. + /// @param newAdmin Address of the added administrator. + /// @dev EVM selector for this function is: 0x92e462c7, + /// or in textual repr: addCollectionAdmin(address) function addCollectionAdmin(address newAdmin) public { require(false, stub_error); newAdmin; dummy = 0; } - // Remove collection admin. - // - // @param new_admin Address of the removed administrator. - // - // Selector: removeCollectionAdmin(address) fafd7b42 + /// Remove collection admin. + /// + /// @param admin Address of the removed administrator. + /// @dev EVM selector for this function is: 0xfafd7b42, + /// or in textual repr: removeCollectionAdmin(address) function removeCollectionAdmin(address admin) public { require(false, stub_error); admin; dummy = 0; } - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' - // - // Selector: setCollectionNesting(bool) 112d4586 + /// Toggle accessibility of collection nesting. + /// + /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + /// @dev EVM selector for this function is: 0x112d4586, + /// or in textual repr: setCollectionNesting(bool) function setCollectionNesting(bool enable) public { require(false, stub_error); enable; dummy = 0; } - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' - // @param collections Addresses of collections that will be available for nesting. - // - // Selector: setCollectionNesting(bool,address[]) 64872396 + /// Toggle accessibility of collection nesting. + /// + /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + /// @param collections Addresses of collections that will be available for nesting. + /// @dev EVM selector for this function is: 0x64872396, + /// or in textual repr: setCollectionNesting(bool,address[]) function setCollectionNesting(bool enable, address[] memory collections) public { @@ -308,57 +203,57 @@ contract Collection is Dummy, ERC165 { dummy = 0; } - // Set the collection access method. - // @param mode Access mode - // 0 for Normal - // 1 for AllowList - // - // Selector: setCollectionAccess(uint8) 41835d4c + /// Set the collection access method. + /// @param mode Access mode + /// 0 for Normal + /// 1 for AllowList + /// @dev EVM selector for this function is: 0x41835d4c, + /// or in textual repr: setCollectionAccess(uint8) function setCollectionAccess(uint8 mode) public { require(false, stub_error); mode; dummy = 0; } - // Add the user to the allowed list. - // - // @param user Address of a trusted user. - // - // Selector: addToCollectionAllowList(address) 67844fe6 + /// Add the user to the allowed list. + /// + /// @param user Address of a trusted user. + /// @dev EVM selector for this function is: 0x67844fe6, + /// or in textual repr: addToCollectionAllowList(address) function addToCollectionAllowList(address user) public { require(false, stub_error); user; dummy = 0; } - // Remove the user from the allowed list. - // - // @param user Address of a removed user. - // - // Selector: removeFromCollectionAllowList(address) 85c51acb + /// Remove the user from the allowed list. + /// + /// @param user Address of a removed user. + /// @dev EVM selector for this function is: 0x85c51acb, + /// or in textual repr: removeFromCollectionAllowList(address) function removeFromCollectionAllowList(address user) public { require(false, stub_error); user; dummy = 0; } - // Switch permission for minting. - // - // @param mode Enable if "true". - // - // Selector: setCollectionMintMode(bool) 00018e84 + /// Switch permission for minting. + /// + /// @param mode Enable if "true". + /// @dev EVM selector for this function is: 0x00018e84, + /// or in textual repr: setCollectionMintMode(bool) function setCollectionMintMode(bool mode) public { require(false, stub_error); mode; dummy = 0; } - // Check that account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdmin(address) 9811b0c7 + /// Check that account is the owner or admin of the collection + /// + /// @param user account to verify + /// @return "true" if account is the owner or admin + /// @dev EVM selector for this function is: 0x9811b0c7, + /// or in textual repr: isOwnerOrAdmin(address) function isOwnerOrAdmin(address user) public view returns (bool) { require(false, stub_error); user; @@ -366,12 +261,12 @@ contract Collection is Dummy, ERC165 { return false; } - // Check that substrate account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00 + /// Check that substrate account is the owner or admin of the collection + /// + /// @param user account to verify + /// @return "true" if account is the owner or admin + /// @dev EVM selector for this function is: 0x68910e00, + /// or in textual repr: isOwnerOrAdminSubstrate(uint256) function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) { require(false, stub_error); user; @@ -379,35 +274,35 @@ contract Collection is Dummy, ERC165 { return false; } - // Returns collection type - // - // @return `Fungible` or `NFT` or `ReFungible` - // - // Selector: uniqueCollectionType() d34b55b8 + /// Returns collection type + /// + /// @return `Fungible` or `NFT` or `ReFungible` + /// @dev EVM selector for this function is: 0xd34b55b8, + /// or in textual repr: uniqueCollectionType() function uniqueCollectionType() public returns (string memory) { require(false, stub_error); dummy = 0; return ""; } - // Changes collection owner to another account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner account - // - // Selector: setOwner(address) 13af4035 + /// Changes collection owner to another account + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner account + /// @dev EVM selector for this function is: 0x13af4035, + /// or in textual repr: setOwner(address) function setOwner(address newOwner) public { require(false, stub_error); newOwner; dummy = 0; } - // Changes collection owner to another substrate account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner substrate account - // - // Selector: setOwnerSubstrate(uint256) b212138f + /// Changes collection owner to another substrate account + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner substrate account + /// @dev EVM selector for this function is: 0xb212138f, + /// or in textual repr: setOwnerSubstrate(uint256) function setOwnerSubstrate(uint256 newOwner) public { require(false, stub_error); newOwner; @@ -415,6 +310,122 @@ contract Collection is Dummy, ERC165 { } } +/// @dev the ERC-165 identifier for this interface is 0x79cc6790 +contract ERC20UniqueExtensions is Dummy, ERC165 { + /// @dev EVM selector for this function is: 0x79cc6790, + /// or in textual repr: burnFrom(address,uint256) + function burnFrom(address from, uint256 amount) public returns (bool) { + require(false, stub_error); + from; + amount; + dummy = 0; + return false; + } +} + +/// @dev inlined interface +contract ERC20Events { + event Transfer(address indexed from, address indexed to, uint256 value); + event Approval( + address indexed owner, + address indexed spender, + uint256 value + ); +} + +/// @dev the ERC-165 identifier for this interface is 0x942e8b22 +contract ERC20 is Dummy, ERC165, ERC20Events { + /// @dev EVM selector for this function is: 0x06fdde03, + /// or in textual repr: name() + function name() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + /// @dev EVM selector for this function is: 0x95d89b41, + /// or in textual repr: symbol() + function symbol() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + /// @dev EVM selector for this function is: 0x18160ddd, + /// or in textual repr: totalSupply() + function totalSupply() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } + + /// @dev EVM selector for this function is: 0x313ce567, + /// or in textual repr: decimals() + function decimals() public view returns (uint8) { + require(false, stub_error); + dummy; + return 0; + } + + /// @dev EVM selector for this function is: 0x70a08231, + /// or in textual repr: balanceOf(address) + function balanceOf(address owner) public view returns (uint256) { + require(false, stub_error); + owner; + dummy; + return 0; + } + + /// @dev EVM selector for this function is: 0xa9059cbb, + /// or in textual repr: transfer(address,uint256) + function transfer(address to, uint256 amount) public returns (bool) { + require(false, stub_error); + to; + amount; + dummy = 0; + return false; + } + + /// @dev EVM selector for this function is: 0x23b872dd, + /// or in textual repr: transferFrom(address,address,uint256) + function transferFrom( + address from, + address to, + uint256 amount + ) public returns (bool) { + require(false, stub_error); + from; + to; + amount; + dummy = 0; + return false; + } + + /// @dev EVM selector for this function is: 0x095ea7b3, + /// or in textual repr: approve(address,uint256) + function approve(address spender, uint256 amount) public returns (bool) { + require(false, stub_error); + spender; + amount; + dummy = 0; + return false; + } + + /// @dev EVM selector for this function is: 0xdd62ed3e, + /// or in textual repr: allowance(address,address) + function allowance(address owner, address spender) + public + view + returns (uint256) + { + require(false, stub_error); + owner; + spender; + dummy; + return 0; + } +} + contract UniqueFungible is Dummy, ERC165, diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index fb3a01438c..8ec1bf3e0d 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -50,14 +50,14 @@ use crate::{ }; /// @title A contract that allows to set and delete token properties and change token property permissions. -#[solidity_interface(name = "TokenProperties")] +#[solidity_interface(name = TokenProperties)] impl NonfungibleHandle { /// @notice Set permissions for token property. /// @dev Throws error if `msg.sender` is not admin or owner of the collection. /// @param key Property key. - /// @param is_mutable Permission to mutate property. - /// @param collection_admin Permission to mutate property by collection admin if property is mutable. - /// @param token_owner Permission to mutate property by token owner if property is mutable. + /// @param isMutable Permission to mutate property. + /// @param collectionAdmin Permission to mutate property by collection admin if property is mutable. + /// @param tokenOwner Permission to mutate property by token owner if property is mutable. fn set_token_property_permission( &mut self, caller: caller, @@ -201,7 +201,7 @@ pub enum ERC721MintableEvents { /// @title ERC-721 Non-Fungible Token Standard, optional metadata extension /// @dev See https://eips.ethereum.org/EIPS/eip-721 -#[solidity_interface(name = "ERC721Metadata")] +#[solidity_interface(name = ERC721Metadata, expect_selector = 0x5b5e139f)] impl NonfungibleHandle { /// @notice A descriptive name for a collection of NFTs in this contract fn name(&self) -> Result { @@ -262,7 +262,7 @@ impl NonfungibleHandle { /// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension /// @dev See https://eips.ethereum.org/EIPS/eip-721 -#[solidity_interface(name = "ERC721Enumerable")] +#[solidity_interface(name = ERC721Enumerable, expect_selector = 0x780e9d63)] impl NonfungibleHandle { /// @notice Enumerate valid NFTs /// @param index A counter less than `totalSupply()` @@ -289,7 +289,7 @@ impl NonfungibleHandle { /// @title ERC-721 Non-Fungible Token Standard /// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md -#[solidity_interface(name = "ERC721", events(ERC721Events))] +#[solidity_interface(name = ERC721, events(ERC721Events), expect_selector = 0x80ac58cd)] impl NonfungibleHandle { /// @notice Count all NFTs assigned to an owner /// @dev NFTs assigned to the zero address are considered invalid, and this @@ -316,13 +316,13 @@ impl NonfungibleHandle { .as_eth()) } /// @dev Not implemented + #[solidity(rename_selector = "safeTransferFrom")] fn safe_transfer_from_with_data( &mut self, _from: address, _to: address, _token_id: uint256, _data: bytes, - _value: value, ) -> Result { // TODO: Not implemetable Err("not implemented".into()) @@ -333,7 +333,6 @@ impl NonfungibleHandle { _from: address, _to: address, _token_id: uint256, - _value: value, ) -> Result { // TODO: Not implemetable Err("not implemented".into()) @@ -348,7 +347,6 @@ impl NonfungibleHandle { /// @param from The current owner of the NFT /// @param to The new owner /// @param tokenId The NFT to transfer - /// @param _value Not used for an NFT #[weight(>::transfer_from())] fn transfer_from( &mut self, @@ -356,7 +354,6 @@ impl NonfungibleHandle { from: address, to: address, token_id: uint256, - _value: value, ) -> Result { let caller = T::CrossAccountId::from_eth(caller); let from = T::CrossAccountId::from_eth(from); @@ -378,13 +375,7 @@ impl NonfungibleHandle { /// @param approved The new approved NFT controller /// @param tokenId The NFT to approve #[weight(>::approve())] - fn approve( - &mut self, - caller: caller, - approved: address, - token_id: uint256, - _value: value, - ) -> Result { + fn approve(&mut self, caller: caller, approved: address, token_id: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); let approved = T::CrossAccountId::from_eth(approved); let token = token_id.try_into()?; @@ -419,7 +410,7 @@ impl NonfungibleHandle { } /// @title ERC721 Token that can be irreversibly burned (destroyed). -#[solidity_interface(name = "ERC721Burnable")] +#[solidity_interface(name = ERC721Burnable)] impl NonfungibleHandle { /// @notice Burns a specific ERC721 token. /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized @@ -436,7 +427,7 @@ impl NonfungibleHandle { } /// @title ERC721 minting logic. -#[solidity_interface(name = "ERC721Mintable", events(ERC721MintableEvents))] +#[solidity_interface(name = ERC721Mintable, events(ERC721MintableEvents))] impl NonfungibleHandle { fn minting_finished(&self) -> Result { Ok(false) @@ -597,22 +588,15 @@ fn has_token_permission(collection_id: CollectionId, key: &PropertyKe } /// @title Unique extensions for ERC721. -#[solidity_interface(name = "ERC721UniqueExtensions")] +#[solidity_interface(name = ERC721UniqueExtensions)] impl NonfungibleHandle { /// @notice Transfer ownership of an NFT /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` /// is the zero address. Throws if `tokenId` is not a valid NFT. /// @param to The new owner /// @param tokenId The NFT to transfer - /// @param _value Not used for an NFT #[weight(>::transfer())] - fn transfer( - &mut self, - caller: caller, - to: address, - token_id: uint256, - _value: value, - ) -> Result { + fn transfer(&mut self, caller: caller, to: address, token_id: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); let to = T::CrossAccountId::from_eth(to); let token = token_id.try_into()?; @@ -630,15 +614,8 @@ impl NonfungibleHandle { /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT. /// @param from The current owner of the NFT /// @param tokenId The NFT to transfer - /// @param _value Not used for an NFT #[weight(>::burn_from())] - fn burn_from( - &mut self, - caller: caller, - from: address, - token_id: uint256, - _value: value, - ) -> Result { + fn burn_from(&mut self, caller: caller, from: address, token_id: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); let from = T::CrossAccountId::from_eth(from); let token = token_id.try_into()?; @@ -751,7 +728,7 @@ impl NonfungibleHandle { } #[solidity_interface( - name = "UniqueNFT", + name = UniqueNFT, is( ERC721, ERC721Metadata, @@ -759,7 +736,7 @@ impl NonfungibleHandle { ERC721UniqueExtensions, ERC721Mintable, ERC721Burnable, - via("CollectionHandle", common_mut, Collection), + Collection(common_mut, CollectionHandle), TokenProperties, ) )] diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 76148569b0332221fd3a0fa403b4f46a8c541929..45c1c73831d922618ad66037d4da4eef1cdc0e24 100644 GIT binary patch delta 867 zcmdm>xIuBlEk>#2AVoRBM8+NA4at+9BpnAbS%AzPz5e$me_?dy05L=oS>-0%Gs)G@ zw65PJn8GI1W_x1*WP<F6R4pcWNvls>vKRI z&w$L@ls#L3!Wlqj>rtuGVAG+tfy@D_x(t*mt@N@1N<9WL%ak4TkX3>F4&+Y;N~N?b zPXlV04P>Ub_&)=yYDmtQ$j1N_T?rJ;vT)?N4PwDEh)rBPC@eaW z`E??*pIHJ+BKv0$uPu?~;p7Eu;$b{%K-^#yNxMX5OOR5Y7a%zpkJl817Y{QAZ0Jm6 z9?zQ1|Jh2}gdCb%nT13Xxlcg?FOmE5jew}Zs;@_ delta 852 zcmZvZPiT^H7{~qj>O0Bbt8=;?+_2Xq>M&vwMzv9{9R>yMWd}WYd4HRs?6d@9tIU6| z?$BZCFQc(R)*)COvTe|;Q9&#ZS{;Ijim_^R88jkKfvo49zTlwuy?mbM`+fesZ_!?~ z7e6Dbc&{sDB52hc8&9oUD}Wlnr4I8ft)U^E3>Kmprf1c*=p9qBY$B=+Fvw^jS~cKY zfAkq(JK+7^l}ms&z(wuCa|>ZgUQrdR`x?z5E`yZY8iU$B%zv661iYcRCJPBCtZ*4z zR~+tRfEStwuBco*T@7S_OMurR+wWkv8eqh~wgTB;Yaft4fD}6V`Uv1R!0`0>0dW0L zT=MN8&4V;PYPW$z0sS+M+mKxZ3`iqCAuG=fW(`zeG`gq26DJ41EC-mn`oI~&oH`+D z2)0p??d~gie1zF1%tblZ_D7D=M6)AD>|cnqcjc5)#F^`N}RR<+HwMx1$h zmkqPLDkjEKGfYP((Z6lnLi8U~q;1LLqXN-y(E+1FkJ+Y#JLrUwAHq&0KAj}mHIFYV zh!E)l`&?q=eqPJ%rRlZ3>Bag;U_9B3qBE`r1KJ?7Q;7X6LQQGy>zdlM6*ISJ)5 z63P$^+rsY_-N}@^9IiHM6Z=PeSN8aoN~95CZ+d(=0d`3u*Z3|x@vgXqaJuH)tRUos zTt<*Pi+nBR{|0hXic4x8NH|Kr8f-m}6?HYacTZLT zMdT#}ABjechY+O&<4gXyf9h)G!JGQzlfur1dNY`>mS4?ouGj1@u1C)0-4z;bcm4x8 C<1r5a diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index b7d8fabac0..9d9c5da60f 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -3,13 +3,7 @@ pragma solidity >=0.8.0 <0.9.0; -// Anonymous struct -struct Tuple0 { - uint256 field_0; - string field_1; -} - -// Common stubs holder +/// @dev common stubs holder contract Dummy { uint8 dummy; string stub_error = "this contract is implemented in native"; @@ -27,40 +21,17 @@ contract ERC165 is Dummy { } } -// Inline -contract ERC721Events { - event Transfer( - address indexed from, - address indexed to, - uint256 indexed tokenId - ); - event Approval( - address indexed owner, - address indexed approved, - uint256 indexed tokenId - ); - event ApprovalForAll( - address indexed owner, - address indexed operator, - bool approved - ); -} - -// Inline -contract ERC721MintableEvents { - event MintingFinished(); -} - -// Selector: 41369377 +/// @title A contract that allows to set and delete token properties and change token property permissions. +/// @dev the ERC-165 identifier for this interface is 0x41369377 contract TokenProperties is Dummy, ERC165 { - // @notice Set permissions for token property. - // @dev Throws error if `msg.sender` is not admin or owner of the collection. - // @param key Property key. - // @param is_mutable Permission to mutate property. - // @param collection_admin Permission to mutate property by collection admin if property is mutable. - // @param token_owner Permission to mutate property by token owner if property is mutable. - // - // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa + /// @notice Set permissions for token property. + /// @dev Throws error if `msg.sender` is not admin or owner of the collection. + /// @param key Property key. + /// @param isMutable Permission to mutate property. + /// @param collectionAdmin Permission to mutate property by collection admin if property is mutable. + /// @param tokenOwner Permission to mutate property by token owner if property is mutable. + /// @dev EVM selector for this function is: 0x222d97fa, + /// or in textual repr: setTokenPropertyPermission(string,bool,bool,bool) function setTokenPropertyPermission( string memory key, bool isMutable, @@ -75,13 +46,13 @@ contract TokenProperties is Dummy, ERC165 { dummy = 0; } - // @notice Set token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. - // @param key Property key. - // @param value Property value. - // - // Selector: setProperty(uint256,string,bytes) 1752d67b + /// @notice Set token property value. + /// @dev Throws error if `msg.sender` has no permission to edit the property. + /// @param tokenId ID of the token. + /// @param key Property key. + /// @param value Property value. + /// @dev EVM selector for this function is: 0x1752d67b, + /// or in textual repr: setProperty(uint256,string,bytes) function setProperty( uint256 tokenId, string memory key, @@ -94,12 +65,12 @@ contract TokenProperties is Dummy, ERC165 { dummy = 0; } - // @notice Delete token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. - // @param key Property key. - // - // Selector: deleteProperty(uint256,string) 066111d1 + /// @notice Delete token property value. + /// @dev Throws error if `msg.sender` has no permission to edit the property. + /// @param tokenId ID of the token. + /// @param key Property key. + /// @dev EVM selector for this function is: 0x066111d1, + /// or in textual repr: deleteProperty(uint256,string) function deleteProperty(uint256 tokenId, string memory key) public { require(false, stub_error); tokenId; @@ -107,13 +78,13 @@ contract TokenProperties is Dummy, ERC165 { dummy = 0; } - // @notice Get token property value. - // @dev Throws error if key not found - // @param tokenId ID of the token. - // @param key Property key. - // @return Property value bytes - // - // Selector: property(uint256,string) 7228c327 + /// @notice Get token property value. + /// @dev Throws error if key not found + /// @param tokenId ID of the token. + /// @param key Property key. + /// @return Property value bytes + /// @dev EVM selector for this function is: 0x7228c327, + /// or in textual repr: property(uint256,string) function property(uint256 tokenId, string memory key) public view @@ -127,213 +98,334 @@ contract TokenProperties is Dummy, ERC165 { } } -// Selector: 42966c68 -contract ERC721Burnable is Dummy, ERC165 { - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized - // operator of the current owner. - // @param tokenId The NFT to approve - // - // Selector: burn(uint256) 42966c68 - function burn(uint256 tokenId) public { +/// @title A contract that allows you to work with collections. +/// @dev the ERC-165 identifier for this interface is 0xffe4da23 +contract Collection is Dummy, ERC165 { + /// Set collection property. + /// + /// @param key Property key. + /// @param value Propery value. + /// @dev EVM selector for this function is: 0x2f073f66, + /// or in textual repr: setCollectionProperty(string,bytes) + function setCollectionProperty(string memory key, bytes memory value) + public + { require(false, stub_error); - tokenId; + key; + value; dummy = 0; } -} -// Selector: 58800161 -contract ERC721 is Dummy, ERC165, ERC721Events { - // @notice Count all NFTs assigned to an owner - // @dev NFTs assigned to the zero address are considered invalid, and this - // function throws for queries about the zero address. - // @param owner An address for whom to query the balance - // @return The number of NFTs owned by `owner`, possibly zero - // - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) public view returns (uint256) { + /// Delete collection property. + /// + /// @param key Property key. + /// @dev EVM selector for this function is: 0x7b7debce, + /// or in textual repr: deleteCollectionProperty(string) + function deleteCollectionProperty(string memory key) public { require(false, stub_error); - owner; - dummy; - return 0; + key; + dummy = 0; } - // @notice Find the owner of an NFT - // @dev NFTs assigned to zero address are considered invalid, and queries - // about them do throw. - // @param tokenId The identifier for an NFT - // @return The address of the owner of the NFT - // - // Selector: ownerOf(uint256) 6352211e - function ownerOf(uint256 tokenId) public view returns (address) { + /// Get collection property. + /// + /// @dev Throws error if key not found. + /// + /// @param key Property key. + /// @return bytes The property corresponding to the key. + /// @dev EVM selector for this function is: 0xcf24fd6d, + /// or in textual repr: collectionProperty(string) + function collectionProperty(string memory key) + public + view + returns (bytes memory) + { require(false, stub_error); - tokenId; + key; dummy; - return 0x0000000000000000000000000000000000000000; + return hex""; } - // @dev Not implemented - // - // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672 - function safeTransferFromWithData( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public { + /// Set the sponsor of the collection. + /// + /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + /// + /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + /// @dev EVM selector for this function is: 0x7623402e, + /// or in textual repr: setCollectionSponsor(address) + function setCollectionSponsor(address sponsor) public { require(false, stub_error); - from; - to; - tokenId; - data; + sponsor; dummy = 0; } - // @dev Not implemented - // - // Selector: safeTransferFrom(address,address,uint256) 42842e0e - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public { + /// Collection sponsorship confirmation. + /// + /// @dev After setting the sponsor for the collection, it must be confirmed with this function. + /// @dev EVM selector for this function is: 0x3c50e97a, + /// or in textual repr: confirmCollectionSponsorship() + function confirmCollectionSponsorship() public { require(false, stub_error); - from; - to; - tokenId; dummy = 0; } - // @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE - // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE - // THEY MAY BE PERMANENTLY LOST - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this NFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid NFT. - // @param from The current owner of the NFT - // @param to The new owner - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT - // - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 tokenId - ) public { + /// Set limits for the collection. + /// @dev Throws error if limit not found. + /// @param limit Name of the limit. Valid names: + /// "accountTokenOwnershipLimit", + /// "sponsoredDataSize", + /// "sponsoredDataRateLimit", + /// "tokenLimit", + /// "sponsorTransferTimeout", + /// "sponsorApproveTimeout" + /// @param value Value of the limit. + /// @dev EVM selector for this function is: 0x6a3841db, + /// or in textual repr: setCollectionLimit(string,uint32) + function setCollectionLimit(string memory limit, uint32 value) public { require(false, stub_error); - from; - to; - tokenId; + limit; + value; dummy = 0; } - // @notice Set or reaffirm the approved address for an NFT - // @dev The zero address indicates there is no approved address. - // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized - // operator of the current owner. - // @param approved The new approved NFT controller - // @param tokenId The NFT to approve - // - // Selector: approve(address,uint256) 095ea7b3 - function approve(address approved, uint256 tokenId) public { + /// Set limits for the collection. + /// @dev Throws error if limit not found. + /// @param limit Name of the limit. Valid names: + /// "ownerCanTransfer", + /// "ownerCanDestroy", + /// "transfersEnabled" + /// @param value Value of the limit. + /// @dev EVM selector for this function is: 0x993b7fba, + /// or in textual repr: setCollectionLimit(string,bool) + function setCollectionLimit(string memory limit, bool value) public { require(false, stub_error); - approved; - tokenId; + limit; + value; dummy = 0; } - // @dev Not implemented - // - // Selector: setApprovalForAll(address,bool) a22cb465 - function setApprovalForAll(address operator, bool approved) public { + /// Get contract address. + /// @dev EVM selector for this function is: 0xf6b4dfb4, + /// or in textual repr: contractAddress() + function contractAddress() public view returns (address) { require(false, stub_error); - operator; - approved; + dummy; + return 0x0000000000000000000000000000000000000000; + } + + /// Add collection admin by substrate address. + /// @param newAdmin Substrate administrator address. + /// @dev EVM selector for this function is: 0x5730062b, + /// or in textual repr: addCollectionAdminSubstrate(uint256) + function addCollectionAdminSubstrate(uint256 newAdmin) public { + require(false, stub_error); + newAdmin; dummy = 0; } - // @dev Not implemented - // - // Selector: getApproved(uint256) 081812fc - function getApproved(uint256 tokenId) public view returns (address) { + /// Remove collection admin by substrate address. + /// @param admin Substrate administrator address. + /// @dev EVM selector for this function is: 0x4048fcf9, + /// or in textual repr: removeCollectionAdminSubstrate(uint256) + function removeCollectionAdminSubstrate(uint256 admin) public { require(false, stub_error); - tokenId; - dummy; - return 0x0000000000000000000000000000000000000000; + admin; + dummy = 0; } - // @dev Not implemented - // - // Selector: isApprovedForAll(address,address) e985e9c5 - function isApprovedForAll(address owner, address operator) + /// Add collection admin. + /// @param newAdmin Address of the added administrator. + /// @dev EVM selector for this function is: 0x92e462c7, + /// or in textual repr: addCollectionAdmin(address) + function addCollectionAdmin(address newAdmin) public { + require(false, stub_error); + newAdmin; + dummy = 0; + } + + /// Remove collection admin. + /// + /// @param admin Address of the removed administrator. + /// @dev EVM selector for this function is: 0xfafd7b42, + /// or in textual repr: removeCollectionAdmin(address) + function removeCollectionAdmin(address admin) public { + require(false, stub_error); + admin; + dummy = 0; + } + + /// Toggle accessibility of collection nesting. + /// + /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + /// @dev EVM selector for this function is: 0x112d4586, + /// or in textual repr: setCollectionNesting(bool) + function setCollectionNesting(bool enable) public { + require(false, stub_error); + enable; + dummy = 0; + } + + /// Toggle accessibility of collection nesting. + /// + /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + /// @param collections Addresses of collections that will be available for nesting. + /// @dev EVM selector for this function is: 0x64872396, + /// or in textual repr: setCollectionNesting(bool,address[]) + function setCollectionNesting(bool enable, address[] memory collections) public - view - returns (address) { require(false, stub_error); - owner; - operator; - dummy; - return 0x0000000000000000000000000000000000000000; + enable; + collections; + dummy = 0; } -} -// Selector: 5b5e139f -contract ERC721Metadata is Dummy, ERC165 { - // @notice A descriptive name for a collection of NFTs in this contract - // - // Selector: name() 06fdde03 - function name() public view returns (string memory) { + /// Set the collection access method. + /// @param mode Access mode + /// 0 for Normal + /// 1 for AllowList + /// @dev EVM selector for this function is: 0x41835d4c, + /// or in textual repr: setCollectionAccess(uint8) + function setCollectionAccess(uint8 mode) public { + require(false, stub_error); + mode; + dummy = 0; + } + + /// Add the user to the allowed list. + /// + /// @param user Address of a trusted user. + /// @dev EVM selector for this function is: 0x67844fe6, + /// or in textual repr: addToCollectionAllowList(address) + function addToCollectionAllowList(address user) public { require(false, stub_error); + user; + dummy = 0; + } + + /// Remove the user from the allowed list. + /// + /// @param user Address of a removed user. + /// @dev EVM selector for this function is: 0x85c51acb, + /// or in textual repr: removeFromCollectionAllowList(address) + function removeFromCollectionAllowList(address user) public { + require(false, stub_error); + user; + dummy = 0; + } + + /// Switch permission for minting. + /// + /// @param mode Enable if "true". + /// @dev EVM selector for this function is: 0x00018e84, + /// or in textual repr: setCollectionMintMode(bool) + function setCollectionMintMode(bool mode) public { + require(false, stub_error); + mode; + dummy = 0; + } + + /// Check that account is the owner or admin of the collection + /// + /// @param user account to verify + /// @return "true" if account is the owner or admin + /// @dev EVM selector for this function is: 0x9811b0c7, + /// or in textual repr: isOwnerOrAdmin(address) + function isOwnerOrAdmin(address user) public view returns (bool) { + require(false, stub_error); + user; dummy; - return ""; + return false; } - // @notice An abbreviated name for NFTs in this contract - // - // Selector: symbol() 95d89b41 - function symbol() public view returns (string memory) { + /// Check that substrate account is the owner or admin of the collection + /// + /// @param user account to verify + /// @return "true" if account is the owner or admin + /// @dev EVM selector for this function is: 0x68910e00, + /// or in textual repr: isOwnerOrAdminSubstrate(uint256) + function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) { require(false, stub_error); + user; dummy; + return false; + } + + /// Returns collection type + /// + /// @return `Fungible` or `NFT` or `ReFungible` + /// @dev EVM selector for this function is: 0xd34b55b8, + /// or in textual repr: uniqueCollectionType() + function uniqueCollectionType() public returns (string memory) { + require(false, stub_error); + dummy = 0; return ""; } - // @notice A distinct Uniform Resource Identifier (URI) for a given asset. - // - // @dev If the token has a `url` property and it is not empty, it is returned. - // Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. - // If the collection property `baseURI` is empty or absent, return "" (empty string) - // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix - // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). - // - // @return token's const_metadata - // - // Selector: tokenURI(uint256) c87b56dd - function tokenURI(uint256 tokenId) public view returns (string memory) { + /// Changes collection owner to another account + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner account + /// @dev EVM selector for this function is: 0x13af4035, + /// or in textual repr: setOwner(address) + function setOwner(address newOwner) public { + require(false, stub_error); + newOwner; + dummy = 0; + } + + /// Changes collection owner to another substrate account + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner substrate account + /// @dev EVM selector for this function is: 0xb212138f, + /// or in textual repr: setOwnerSubstrate(uint256) + function setOwnerSubstrate(uint256 newOwner) public { + require(false, stub_error); + newOwner; + dummy = 0; + } +} + +/// @title ERC721 Token that can be irreversibly burned (destroyed). +/// @dev the ERC-165 identifier for this interface is 0x42966c68 +contract ERC721Burnable is Dummy, ERC165 { + /// @notice Burns a specific ERC721 token. + /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized + /// operator of the current owner. + /// @param tokenId The NFT to approve + /// @dev EVM selector for this function is: 0x42966c68, + /// or in textual repr: burn(uint256) + function burn(uint256 tokenId) public { require(false, stub_error); tokenId; - dummy; - return ""; + dummy = 0; } } -// Selector: 68ccfe89 +/// @dev inlined interface +contract ERC721MintableEvents { + event MintingFinished(); +} + +/// @title ERC721 minting logic. +/// @dev the ERC-165 identifier for this interface is 0x68ccfe89 contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { - // Selector: mintingFinished() 05d2035b + /// @dev EVM selector for this function is: 0x05d2035b, + /// or in textual repr: mintingFinished() function mintingFinished() public view returns (bool) { require(false, stub_error); dummy; return false; } - // @notice Function to mint token. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted NFT - // - // Selector: mint(address,uint256) 40c10f19 + /// @notice Function to mint token. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted NFT + /// @dev EVM selector for this function is: 0x40c10f19, + /// or in textual repr: mint(address,uint256) function mint(address to, uint256 tokenId) public returns (bool) { require(false, stub_error); to; @@ -342,14 +434,14 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { return false; } - // @notice Function to mint token with the given tokenUri. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted NFT - // @param tokenUri Token URI that would be stored in the NFT properties - // - // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f + /// @notice Function to mint token with the given tokenUri. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted NFT + /// @param tokenUri Token URI that would be stored in the NFT properties + /// @dev EVM selector for this function is: 0x50bb4e7f, + /// or in textual repr: mintWithTokenURI(address,uint256,string) function mintWithTokenURI( address to, uint256 tokenId, @@ -363,9 +455,9 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { return false; } - // @dev Not implemented - // - // Selector: finishMinting() 7d64bcb4 + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x7d64bcb4, + /// or in textual repr: finishMinting() function finishMinting() public returns (bool) { require(false, stub_error); dummy = 0; @@ -373,58 +465,16 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { } } -// Selector: 780e9d63 -contract ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid NFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) - // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) public view returns (uint256) { - require(false, stub_error); - index; - dummy; - return 0; - } - - // @dev Not implemented - // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - public - view - returns (uint256) - { - require(false, stub_error); - owner; - index; - dummy; - return 0; - } - - // @notice Count NFTs tracked by this contract - // @return A count of valid NFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address - // - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } -} - -// Selector: d74d154f +/// @title Unique extensions for ERC721. +/// @dev the ERC-165 identifier for this interface is 0xd74d154f contract ERC721UniqueExtensions is Dummy, ERC165 { - // @notice Transfer ownership of an NFT - // @dev Throws unless `msg.sender` is the current owner. Throws if `to` - // is the zero address. Throws if `tokenId` is not a valid NFT. - // @param to The new owner - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT - // - // Selector: transfer(address,uint256) a9059cbb + /// @notice Transfer ownership of an NFT + /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` + /// is the zero address. Throws if `tokenId` is not a valid NFT. + /// @param to The new owner + /// @param tokenId The NFT to transfer + /// @dev EVM selector for this function is: 0xa9059cbb, + /// or in textual repr: transfer(address,uint256) function transfer(address to, uint256 tokenId) public { require(false, stub_error); to; @@ -432,15 +482,14 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { dummy = 0; } - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this NFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid NFT. - // @param from The current owner of the NFT - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT - // - // Selector: burnFrom(address,uint256) 79cc6790 + /// @notice Burns a specific ERC721 token. + /// @dev Throws unless `msg.sender` is the current owner or an authorized + /// operator for this NFT. Throws if `from` is not the current owner. Throws + /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT. + /// @param from The current owner of the NFT + /// @param tokenId The NFT to transfer + /// @dev EVM selector for this function is: 0x79cc6790, + /// or in textual repr: burnFrom(address,uint256) function burnFrom(address from, uint256 tokenId) public { require(false, stub_error); from; @@ -448,22 +497,22 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { dummy = 0; } - // @notice Returns next free NFT ID. - // - // Selector: nextTokenId() 75794a3c + /// @notice Returns next free NFT ID. + /// @dev EVM selector for this function is: 0x75794a3c, + /// or in textual repr: nextTokenId() function nextTokenId() public view returns (uint256) { require(false, stub_error); dummy; return 0; } - // @notice Function to mint multiple tokens. - // @dev `tokenIds` should be an array of consecutive numbers and first number - // should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokenIds IDs of the minted NFTs - // - // Selector: mintBulk(address,uint256[]) 44a9945e + /// @notice Function to mint multiple tokens. + /// @dev `tokenIds` should be an array of consecutive numbers and first number + /// should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokenIds IDs of the minted NFTs + /// @dev EVM selector for this function is: 0x44a9945e, + /// or in textual repr: mintBulk(address,uint256[]) function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) @@ -475,14 +524,14 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { return false; } - // @notice Function to mint multiple tokens with the given tokenUris. - // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // numbers and first number should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokens array of pairs of token ID and token URI for minted tokens - // - // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 - function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + /// @notice Function to mint multiple tokens with the given tokenUris. + /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + /// numbers and first number should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokens array of pairs of token ID and token URI for minted tokens + /// @dev EVM selector for this function is: 0x36543006, + /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) + function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) public returns (bool) { @@ -494,291 +543,251 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { } } -// Selector: ffe4da23 -contract Collection is Dummy, ERC165 { - // Set collection property. - // - // @param key Property key. - // @param value Propery value. - // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - public - { - require(false, stub_error); - key; - value; - dummy = 0; - } +/// @dev anonymous struct +struct Tuple8 { + uint256 field_0; + string field_1; +} - // Delete collection property. - // - // @param key Property key. - // - // Selector: deleteCollectionProperty(string) 7b7debce - function deleteCollectionProperty(string memory key) public { +/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension +/// @dev See https://eips.ethereum.org/EIPS/eip-721 +/// @dev the ERC-165 identifier for this interface is 0x780e9d63 +contract ERC721Enumerable is Dummy, ERC165 { + /// @notice Enumerate valid NFTs + /// @param index A counter less than `totalSupply()` + /// @return The token identifier for the `index`th NFT, + /// (sort order not specified) + /// @dev EVM selector for this function is: 0x4f6ccce7, + /// or in textual repr: tokenByIndex(uint256) + function tokenByIndex(uint256 index) public view returns (uint256) { require(false, stub_error); - key; - dummy = 0; + index; + dummy; + return 0; } - // Get collection property. - // - // @dev Throws error if key not found. - // - // @param key Property key. - // @return bytes The property corresponding to the key. - // - // Selector: collectionProperty(string) cf24fd6d - function collectionProperty(string memory key) + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x2f745c59, + /// or in textual repr: tokenOfOwnerByIndex(address,uint256) + function tokenOfOwnerByIndex(address owner, uint256 index) public view - returns (bytes memory) + returns (uint256) { require(false, stub_error); - key; + owner; + index; dummy; - return hex""; - } - - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) public { - require(false, stub_error); - sponsor; - dummy = 0; - } - - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() public { - require(false, stub_error); - dummy = 0; - } - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) public { - require(false, stub_error); - limit; - value; - dummy = 0; + return 0; } - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,bool) 993b7fba - function setCollectionLimit(string memory limit, bool value) public { + /// @notice Count NFTs tracked by this contract + /// @return A count of valid NFTs tracked by this contract, where each one of + /// them has an assigned and queryable owner not equal to the zero address + /// @dev EVM selector for this function is: 0x18160ddd, + /// or in textual repr: totalSupply() + function totalSupply() public view returns (uint256) { require(false, stub_error); - limit; - value; - dummy = 0; + dummy; + return 0; } +} - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 - function contractAddress() public view returns (address) { +/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension +/// @dev See https://eips.ethereum.org/EIPS/eip-721 +/// @dev the ERC-165 identifier for this interface is 0x5b5e139f +contract ERC721Metadata is Dummy, ERC165 { + /// @notice A descriptive name for a collection of NFTs in this contract + /// @dev EVM selector for this function is: 0x06fdde03, + /// or in textual repr: name() + function name() public view returns (string memory) { require(false, stub_error); dummy; - return 0x0000000000000000000000000000000000000000; + return ""; } - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. - // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) public { + /// @notice An abbreviated name for NFTs in this contract + /// @dev EVM selector for this function is: 0x95d89b41, + /// or in textual repr: symbol() + function symbol() public view returns (string memory) { require(false, stub_error); - newAdmin; - dummy = 0; + dummy; + return ""; } - // Remove collection admin by substrate address. - // @param admin Substrate administrator address. - // - // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 - function removeCollectionAdminSubstrate(uint256 admin) public { + /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. + /// + /// @dev If the token has a `url` property and it is not empty, it is returned. + /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + /// If the collection property `baseURI` is empty or absent, return "" (empty string) + /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). + /// + /// @return token's const_metadata + /// @dev EVM selector for this function is: 0xc87b56dd, + /// or in textual repr: tokenURI(uint256) + function tokenURI(uint256 tokenId) public view returns (string memory) { require(false, stub_error); - admin; - dummy = 0; + tokenId; + dummy; + return ""; } +} - // Add collection admin. - // @param new_admin Address of the added administrator. - // - // Selector: addCollectionAdmin(address) 92e462c7 - function addCollectionAdmin(address newAdmin) public { - require(false, stub_error); - newAdmin; - dummy = 0; - } +/// @dev inlined interface +contract ERC721Events { + event Transfer( + address indexed from, + address indexed to, + uint256 indexed tokenId + ); + event Approval( + address indexed owner, + address indexed approved, + uint256 indexed tokenId + ); + event ApprovalForAll( + address indexed owner, + address indexed operator, + bool approved + ); +} - // Remove collection admin. - // - // @param new_admin Address of the removed administrator. - // - // Selector: removeCollectionAdmin(address) fafd7b42 - function removeCollectionAdmin(address admin) public { +/// @title ERC-721 Non-Fungible Token Standard +/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md +/// @dev the ERC-165 identifier for this interface is 0x80ac58cd +contract ERC721 is Dummy, ERC165, ERC721Events { + /// @notice Count all NFTs assigned to an owner + /// @dev NFTs assigned to the zero address are considered invalid, and this + /// function throws for queries about the zero address. + /// @param owner An address for whom to query the balance + /// @return The number of NFTs owned by `owner`, possibly zero + /// @dev EVM selector for this function is: 0x70a08231, + /// or in textual repr: balanceOf(address) + function balanceOf(address owner) public view returns (uint256) { require(false, stub_error); - admin; - dummy = 0; + owner; + dummy; + return 0; } - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' - // - // Selector: setCollectionNesting(bool) 112d4586 - function setCollectionNesting(bool enable) public { + /// @notice Find the owner of an NFT + /// @dev NFTs assigned to zero address are considered invalid, and queries + /// about them do throw. + /// @param tokenId The identifier for an NFT + /// @return The address of the owner of the NFT + /// @dev EVM selector for this function is: 0x6352211e, + /// or in textual repr: ownerOf(uint256) + function ownerOf(uint256 tokenId) public view returns (address) { require(false, stub_error); - enable; - dummy = 0; + tokenId; + dummy; + return 0x0000000000000000000000000000000000000000; } - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' - // @param collections Addresses of collections that will be available for nesting. - // - // Selector: setCollectionNesting(bool,address[]) 64872396 - function setCollectionNesting(bool enable, address[] memory collections) - public - { + /// @dev Not implemented + /// @dev EVM selector for this function is: 0xb88d4fde, + /// or in textual repr: safeTransferFrom(address,address,uint256,bytes) + function safeTransferFrom( + address from, + address to, + uint256 tokenId, + bytes memory data + ) public { require(false, stub_error); - enable; - collections; + from; + to; + tokenId; + data; dummy = 0; } - // Set the collection access method. - // @param mode Access mode - // 0 for Normal - // 1 for AllowList - // - // Selector: setCollectionAccess(uint8) 41835d4c - function setCollectionAccess(uint8 mode) public { + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x42842e0e, + /// or in textual repr: safeTransferFrom(address,address,uint256) + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) public { require(false, stub_error); - mode; + from; + to; + tokenId; dummy = 0; } - // Add the user to the allowed list. - // - // @param user Address of a trusted user. - // - // Selector: addToCollectionAllowList(address) 67844fe6 - function addToCollectionAllowList(address user) public { + /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE + /// TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + /// THEY MAY BE PERMANENTLY LOST + /// @dev Throws unless `msg.sender` is the current owner or an authorized + /// operator for this NFT. Throws if `from` is not the current owner. Throws + /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT. + /// @param from The current owner of the NFT + /// @param to The new owner + /// @param tokenId The NFT to transfer + /// @dev EVM selector for this function is: 0x23b872dd, + /// or in textual repr: transferFrom(address,address,uint256) + function transferFrom( + address from, + address to, + uint256 tokenId + ) public { require(false, stub_error); - user; + from; + to; + tokenId; dummy = 0; } - // Remove the user from the allowed list. - // - // @param user Address of a removed user. - // - // Selector: removeFromCollectionAllowList(address) 85c51acb - function removeFromCollectionAllowList(address user) public { + /// @notice Set or reaffirm the approved address for an NFT + /// @dev The zero address indicates there is no approved address. + /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized + /// operator of the current owner. + /// @param approved The new approved NFT controller + /// @param tokenId The NFT to approve + /// @dev EVM selector for this function is: 0x095ea7b3, + /// or in textual repr: approve(address,uint256) + function approve(address approved, uint256 tokenId) public { require(false, stub_error); - user; + approved; + tokenId; dummy = 0; } - // Switch permission for minting. - // - // @param mode Enable if "true". - // - // Selector: setCollectionMintMode(bool) 00018e84 - function setCollectionMintMode(bool mode) public { + /// @dev Not implemented + /// @dev EVM selector for this function is: 0xa22cb465, + /// or in textual repr: setApprovalForAll(address,bool) + function setApprovalForAll(address operator, bool approved) public { require(false, stub_error); - mode; + operator; + approved; dummy = 0; } - // Check that account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdmin(address) 9811b0c7 - function isOwnerOrAdmin(address user) public view returns (bool) { + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x081812fc, + /// or in textual repr: getApproved(uint256) + function getApproved(uint256 tokenId) public view returns (address) { require(false, stub_error); - user; + tokenId; dummy; - return false; + return 0x0000000000000000000000000000000000000000; } - // Check that substrate account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00 - function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) { + /// @dev Not implemented + /// @dev EVM selector for this function is: 0xe985e9c5, + /// or in textual repr: isApprovedForAll(address,address) + function isApprovedForAll(address owner, address operator) + public + view + returns (address) + { require(false, stub_error); - user; + owner; + operator; dummy; - return false; - } - - // Returns collection type - // - // @return `Fungible` or `NFT` or `ReFungible` - // - // Selector: uniqueCollectionType() d34b55b8 - function uniqueCollectionType() public returns (string memory) { - require(false, stub_error); - dummy = 0; - return ""; - } - - // Changes collection owner to another account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner account - // - // Selector: setOwner(address) 13af4035 - function setOwner(address newOwner) public { - require(false, stub_error); - newOwner; - dummy = 0; - } - - // Changes collection owner to another substrate account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner substrate account - // - // Selector: setOwnerSubstrate(uint256) b212138f - function setOwnerSubstrate(uint256 newOwner) public { - require(false, stub_error); - newOwner; - dummy = 0; + return 0x0000000000000000000000000000000000000000; } } diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 5f1a7914e7..b1a3854641 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -53,14 +53,14 @@ use crate::{ pub const ADDRESS_FOR_PARTIALLY_OWNED_TOKENS: H160 = H160::repeat_byte(0xff); /// @title A contract that allows to set and delete token properties and change token property permissions. -#[solidity_interface(name = "TokenProperties")] +#[solidity_interface(name = TokenProperties)] impl RefungibleHandle { /// @notice Set permissions for token property. /// @dev Throws error if `msg.sender` is not admin or owner of the collection. /// @param key Property key. - /// @param is_mutable Permission to mutate property. - /// @param collection_admin Permission to mutate property by collection admin if property is mutable. - /// @param token_owner Permission to mutate property by token owner if property is mutable. + /// @param isMutable Permission to mutate property. + /// @param collectionAdmin Permission to mutate property by collection admin if property is mutable. + /// @param tokenOwner Permission to mutate property by token owner if property is mutable. fn set_token_property_permission( &mut self, caller: caller, @@ -197,7 +197,7 @@ pub enum ERC721MintableEvents { MintingFinished {}, } -#[solidity_interface(name = "ERC721Metadata")] +#[solidity_interface(name = ERC721Metadata)] impl RefungibleHandle { /// @notice A descriptive name for a collection of RFTs in this contract fn name(&self) -> Result { @@ -258,7 +258,7 @@ impl RefungibleHandle { /// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension /// @dev See https://eips.ethereum.org/EIPS/eip-721 -#[solidity_interface(name = "ERC721Enumerable")] +#[solidity_interface(name = ERC721Enumerable)] impl RefungibleHandle { /// @notice Enumerate valid RFTs /// @param index A counter less than `totalSupply()` @@ -285,7 +285,7 @@ impl RefungibleHandle { /// @title ERC-721 Non-Fungible Token Standard /// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md -#[solidity_interface(name = "ERC721", events(ERC721Events))] +#[solidity_interface(name = ERC721, events(ERC721Events))] impl RefungibleHandle { /// @notice Count all RFTs assigned to an owner /// @dev RFTs assigned to the zero address are considered invalid, and this @@ -322,7 +322,6 @@ impl RefungibleHandle { _to: address, _token_id: uint256, _data: bytes, - _value: value, ) -> Result { // TODO: Not implemetable Err("not implemented".into()) @@ -334,7 +333,6 @@ impl RefungibleHandle { _from: address, _to: address, _token_id: uint256, - _value: value, ) -> Result { // TODO: Not implemetable Err("not implemented".into()) @@ -350,7 +348,6 @@ impl RefungibleHandle { /// @param from The current owner of the NFT /// @param to The new owner /// @param tokenId The NFT to transfer - /// @param _value Not used for an NFT #[weight(>::transfer_from_creating_removing())] fn transfer_from( &mut self, @@ -358,7 +355,6 @@ impl RefungibleHandle { from: address, to: address, token_id: uint256, - _value: value, ) -> Result { let caller = T::CrossAccountId::from_eth(caller); let from = T::CrossAccountId::from_eth(from); @@ -378,13 +374,7 @@ impl RefungibleHandle { } /// @dev Not implemented - fn approve( - &mut self, - _caller: caller, - _approved: address, - _token_id: uint256, - _value: value, - ) -> Result { + fn approve(&mut self, _caller: caller, _approved: address, _token_id: uint256) -> Result { Err("not implemented".into()) } @@ -438,7 +428,7 @@ pub fn ensure_single_owner( } /// @title ERC721 Token that can be irreversibly burned (destroyed). -#[solidity_interface(name = "ERC721Burnable")] +#[solidity_interface(name = ERC721Burnable)] impl RefungibleHandle { /// @notice Burns a specific ERC721 token. /// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized @@ -458,7 +448,7 @@ impl RefungibleHandle { } /// @title ERC721 minting logic. -#[solidity_interface(name = "ERC721Mintable", events(ERC721MintableEvents))] +#[solidity_interface(name = ERC721Mintable, events(ERC721MintableEvents))] impl RefungibleHandle { fn minting_finished(&self) -> Result { Ok(false) @@ -616,7 +606,7 @@ fn get_token_permission( } /// @title Unique extensions for ERC721. -#[solidity_interface(name = "ERC721UniqueExtensions")] +#[solidity_interface(name = ERC721UniqueExtensions)] impl RefungibleHandle { /// @notice Transfer ownership of an RFT /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` @@ -624,15 +614,8 @@ impl RefungibleHandle { /// Throws if RFT pieces have multiple owners. /// @param to The new owner /// @param tokenId The RFT to transfer - /// @param _value Not used for an RFT #[weight(>::transfer_creating_removing())] - fn transfer( - &mut self, - caller: caller, - to: address, - token_id: uint256, - _value: value, - ) -> Result { + fn transfer(&mut self, caller: caller, to: address, token_id: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); let to = T::CrossAccountId::from_eth(to); let token = token_id.try_into()?; @@ -655,15 +638,8 @@ impl RefungibleHandle { /// Throws if RFT pieces have multiple owners. /// @param from The current owner of the RFT /// @param tokenId The RFT to transfer - /// @param _value Not used for an RFT #[weight(>::burn_from())] - fn burn_from( - &mut self, - caller: caller, - from: address, - token_id: uint256, - _value: value, - ) -> Result { + fn burn_from(&mut self, caller: caller, from: address, token_id: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); let from = T::CrossAccountId::from_eth(from); let token = token_id.try_into()?; @@ -801,7 +777,7 @@ impl RefungibleHandle { } #[solidity_interface( - name = "UniqueRefungible", + name = UniqueRefungible, is( ERC721, ERC721Metadata, @@ -809,7 +785,7 @@ impl RefungibleHandle { ERC721UniqueExtensions, ERC721Mintable, ERC721Burnable, - via("CollectionHandle", common_mut, Collection), + Collection(common_mut, CollectionHandle), TokenProperties, ) )] diff --git a/pallets/refungible/src/erc_token.rs b/pallets/refungible/src/erc_token.rs index 2b2accbb0e..f5df3c3cca 100644 --- a/pallets/refungible/src/erc_token.rs +++ b/pallets/refungible/src/erc_token.rs @@ -49,7 +49,7 @@ use crate::{ pub struct RefungibleTokenHandle(pub RefungibleHandle, pub TokenId); -#[solidity_interface(name = "ERC1633")] +#[solidity_interface(name = ERC1633)] impl RefungibleTokenHandle { fn parent_token(&self) -> Result
{ self.consume_store_reads(2)?; @@ -87,7 +87,7 @@ impl RefungibleTokenHandle { } } -#[solidity_interface(name = "ERC1633UniqueExtensions")] +#[solidity_interface(name = ERC1633UniqueExtensions)] impl RefungibleTokenHandle { #[solidity(rename_selector = "setParentNFT")] #[weight(>::token_owner() + >::set_parent_nft_unchecked())] @@ -137,7 +137,7 @@ pub enum ERC20Events { /// /// @dev Implementation of the basic standard token. /// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md -#[solidity_interface(name = "ERC20", events(ERC20Events))] +#[solidity_interface(name = ERC20, events(ERC20Events))] impl RefungibleTokenHandle { /// @return the name of the token. fn name(&self) -> Result { @@ -246,7 +246,7 @@ impl RefungibleTokenHandle { } } -#[solidity_interface(name = "ERC20UniqueExtensions")] +#[solidity_interface(name = ERC20UniqueExtensions)] impl RefungibleTokenHandle { /// @dev Function that burns an amount of the token of a given account, /// deducting from the sender's allowance for said account. @@ -306,7 +306,7 @@ impl Deref for RefungibleTokenHandle { } #[solidity_interface( - name = "UniqueRefungibleToken", + name = UniqueRefungibleToken, is(ERC20, ERC20UniqueExtensions, ERC1633, ERC1633UniqueExtensions) )] impl RefungibleTokenHandle where T::AccountId: From<[u8; 32]> {} diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index 8a94c4523aa7e2ed90326ad0bc893ad392fda985..c12a635e148d4ff66fbee8eb72861f2f9df151a2 100644 GIT binary patch delta 44 zcmV+{0Mq}=AfoC{jRto-_SzCC(SThl1OA;ZB!0=;&=0.8.0 <0.9.0; -// Anonymous struct -struct Tuple0 { - uint256 field_0; - string field_1; -} - -// Common stubs holder +/// @dev common stubs holder contract Dummy { uint8 dummy; string stub_error = "this contract is implemented in native"; @@ -27,40 +21,17 @@ contract ERC165 is Dummy { } } -// Inline -contract ERC721Events { - event Transfer( - address indexed from, - address indexed to, - uint256 indexed tokenId - ); - event Approval( - address indexed owner, - address indexed approved, - uint256 indexed tokenId - ); - event ApprovalForAll( - address indexed owner, - address indexed operator, - bool approved - ); -} - -// Inline -contract ERC721MintableEvents { - event MintingFinished(); -} - -// Selector: 41369377 +/// @title A contract that allows to set and delete token properties and change token property permissions. +/// @dev the ERC-165 identifier for this interface is 0x41369377 contract TokenProperties is Dummy, ERC165 { - // @notice Set permissions for token property. - // @dev Throws error if `msg.sender` is not admin or owner of the collection. - // @param key Property key. - // @param is_mutable Permission to mutate property. - // @param collection_admin Permission to mutate property by collection admin if property is mutable. - // @param token_owner Permission to mutate property by token owner if property is mutable. - // - // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa + /// @notice Set permissions for token property. + /// @dev Throws error if `msg.sender` is not admin or owner of the collection. + /// @param key Property key. + /// @param isMutable Permission to mutate property. + /// @param collectionAdmin Permission to mutate property by collection admin if property is mutable. + /// @param tokenOwner Permission to mutate property by token owner if property is mutable. + /// @dev EVM selector for this function is: 0x222d97fa, + /// or in textual repr: setTokenPropertyPermission(string,bool,bool,bool) function setTokenPropertyPermission( string memory key, bool isMutable, @@ -75,13 +46,13 @@ contract TokenProperties is Dummy, ERC165 { dummy = 0; } - // @notice Set token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. - // @param key Property key. - // @param value Property value. - // - // Selector: setProperty(uint256,string,bytes) 1752d67b + /// @notice Set token property value. + /// @dev Throws error if `msg.sender` has no permission to edit the property. + /// @param tokenId ID of the token. + /// @param key Property key. + /// @param value Property value. + /// @dev EVM selector for this function is: 0x1752d67b, + /// or in textual repr: setProperty(uint256,string,bytes) function setProperty( uint256 tokenId, string memory key, @@ -94,12 +65,12 @@ contract TokenProperties is Dummy, ERC165 { dummy = 0; } - // @notice Delete token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. - // @param key Property key. - // - // Selector: deleteProperty(uint256,string) 066111d1 + /// @notice Delete token property value. + /// @dev Throws error if `msg.sender` has no permission to edit the property. + /// @param tokenId ID of the token. + /// @param key Property key. + /// @dev EVM selector for this function is: 0x066111d1, + /// or in textual repr: deleteProperty(uint256,string) function deleteProperty(uint256 tokenId, string memory key) public { require(false, stub_error); tokenId; @@ -107,13 +78,13 @@ contract TokenProperties is Dummy, ERC165 { dummy = 0; } - // @notice Get token property value. - // @dev Throws error if key not found - // @param tokenId ID of the token. - // @param key Property key. - // @return Property value bytes - // - // Selector: property(uint256,string) 7228c327 + /// @notice Get token property value. + /// @dev Throws error if key not found + /// @param tokenId ID of the token. + /// @param key Property key. + /// @return Property value bytes + /// @dev EVM selector for this function is: 0x7228c327, + /// or in textual repr: property(uint256,string) function property(uint256 tokenId, string memory key) public view @@ -127,211 +98,334 @@ contract TokenProperties is Dummy, ERC165 { } } -// Selector: 42966c68 -contract ERC721Burnable is Dummy, ERC165 { - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current RFT owner, or an authorized - // operator of the current owner. - // @param tokenId The RFT to approve - // - // Selector: burn(uint256) 42966c68 - function burn(uint256 tokenId) public { +/// @title A contract that allows you to work with collections. +/// @dev the ERC-165 identifier for this interface is 0xffe4da23 +contract Collection is Dummy, ERC165 { + /// Set collection property. + /// + /// @param key Property key. + /// @param value Propery value. + /// @dev EVM selector for this function is: 0x2f073f66, + /// or in textual repr: setCollectionProperty(string,bytes) + function setCollectionProperty(string memory key, bytes memory value) + public + { require(false, stub_error); - tokenId; + key; + value; dummy = 0; } -} -// Selector: 58800161 -contract ERC721 is Dummy, ERC165, ERC721Events { - // @notice Count all RFTs assigned to an owner - // @dev RFTs assigned to the zero address are considered invalid, and this - // function throws for queries about the zero address. - // @param owner An address for whom to query the balance - // @return The number of RFTs owned by `owner`, possibly zero - // - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) public view returns (uint256) { + /// Delete collection property. + /// + /// @param key Property key. + /// @dev EVM selector for this function is: 0x7b7debce, + /// or in textual repr: deleteCollectionProperty(string) + function deleteCollectionProperty(string memory key) public { require(false, stub_error); - owner; - dummy; - return 0; + key; + dummy = 0; } - // @notice Find the owner of an RFT - // @dev RFTs assigned to zero address are considered invalid, and queries - // about them do throw. - // Returns special 0xffffffffffffffffffffffffffffffffffffffff address for - // the tokens that are partially owned. - // @param tokenId The identifier for an RFT - // @return The address of the owner of the RFT - // - // Selector: ownerOf(uint256) 6352211e - function ownerOf(uint256 tokenId) public view returns (address) { + /// Get collection property. + /// + /// @dev Throws error if key not found. + /// + /// @param key Property key. + /// @return bytes The property corresponding to the key. + /// @dev EVM selector for this function is: 0xcf24fd6d, + /// or in textual repr: collectionProperty(string) + function collectionProperty(string memory key) + public + view + returns (bytes memory) + { require(false, stub_error); - tokenId; + key; dummy; - return 0x0000000000000000000000000000000000000000; + return hex""; } - // @dev Not implemented - // - // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672 - function safeTransferFromWithData( - address from, - address to, - uint256 tokenId, - bytes memory data - ) public { + /// Set the sponsor of the collection. + /// + /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + /// + /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + /// @dev EVM selector for this function is: 0x7623402e, + /// or in textual repr: setCollectionSponsor(address) + function setCollectionSponsor(address sponsor) public { require(false, stub_error); - from; - to; - tokenId; - data; + sponsor; dummy = 0; } - // @dev Not implemented - // - // Selector: safeTransferFrom(address,address,uint256) 42842e0e - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) public { + /// Collection sponsorship confirmation. + /// + /// @dev After setting the sponsor for the collection, it must be confirmed with this function. + /// @dev EVM selector for this function is: 0x3c50e97a, + /// or in textual repr: confirmCollectionSponsorship() + function confirmCollectionSponsorship() public { require(false, stub_error); - from; - to; - tokenId; dummy = 0; } - // @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE - // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE - // THEY MAY BE PERMANENTLY LOST - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this RFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param from The current owner of the NFT - // @param to The new owner - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT - // - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 tokenId - ) public { + /// Set limits for the collection. + /// @dev Throws error if limit not found. + /// @param limit Name of the limit. Valid names: + /// "accountTokenOwnershipLimit", + /// "sponsoredDataSize", + /// "sponsoredDataRateLimit", + /// "tokenLimit", + /// "sponsorTransferTimeout", + /// "sponsorApproveTimeout" + /// @param value Value of the limit. + /// @dev EVM selector for this function is: 0x6a3841db, + /// or in textual repr: setCollectionLimit(string,uint32) + function setCollectionLimit(string memory limit, uint32 value) public { require(false, stub_error); - from; - to; - tokenId; + limit; + value; dummy = 0; } - // @dev Not implemented - // - // Selector: approve(address,uint256) 095ea7b3 - function approve(address approved, uint256 tokenId) public { + /// Set limits for the collection. + /// @dev Throws error if limit not found. + /// @param limit Name of the limit. Valid names: + /// "ownerCanTransfer", + /// "ownerCanDestroy", + /// "transfersEnabled" + /// @param value Value of the limit. + /// @dev EVM selector for this function is: 0x993b7fba, + /// or in textual repr: setCollectionLimit(string,bool) + function setCollectionLimit(string memory limit, bool value) public { require(false, stub_error); - approved; - tokenId; + limit; + value; dummy = 0; } - // @dev Not implemented - // - // Selector: setApprovalForAll(address,bool) a22cb465 - function setApprovalForAll(address operator, bool approved) public { + /// Get contract address. + /// @dev EVM selector for this function is: 0xf6b4dfb4, + /// or in textual repr: contractAddress() + function contractAddress() public view returns (address) { require(false, stub_error); - operator; - approved; + dummy; + return 0x0000000000000000000000000000000000000000; + } + + /// Add collection admin by substrate address. + /// @param newAdmin Substrate administrator address. + /// @dev EVM selector for this function is: 0x5730062b, + /// or in textual repr: addCollectionAdminSubstrate(uint256) + function addCollectionAdminSubstrate(uint256 newAdmin) public { + require(false, stub_error); + newAdmin; dummy = 0; } - // @dev Not implemented - // - // Selector: getApproved(uint256) 081812fc - function getApproved(uint256 tokenId) public view returns (address) { + /// Remove collection admin by substrate address. + /// @param admin Substrate administrator address. + /// @dev EVM selector for this function is: 0x4048fcf9, + /// or in textual repr: removeCollectionAdminSubstrate(uint256) + function removeCollectionAdminSubstrate(uint256 admin) public { require(false, stub_error); - tokenId; - dummy; - return 0x0000000000000000000000000000000000000000; + admin; + dummy = 0; } - // @dev Not implemented - // - // Selector: isApprovedForAll(address,address) e985e9c5 - function isApprovedForAll(address owner, address operator) + /// Add collection admin. + /// @param newAdmin Address of the added administrator. + /// @dev EVM selector for this function is: 0x92e462c7, + /// or in textual repr: addCollectionAdmin(address) + function addCollectionAdmin(address newAdmin) public { + require(false, stub_error); + newAdmin; + dummy = 0; + } + + /// Remove collection admin. + /// + /// @param admin Address of the removed administrator. + /// @dev EVM selector for this function is: 0xfafd7b42, + /// or in textual repr: removeCollectionAdmin(address) + function removeCollectionAdmin(address admin) public { + require(false, stub_error); + admin; + dummy = 0; + } + + /// Toggle accessibility of collection nesting. + /// + /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + /// @dev EVM selector for this function is: 0x112d4586, + /// or in textual repr: setCollectionNesting(bool) + function setCollectionNesting(bool enable) public { + require(false, stub_error); + enable; + dummy = 0; + } + + /// Toggle accessibility of collection nesting. + /// + /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + /// @param collections Addresses of collections that will be available for nesting. + /// @dev EVM selector for this function is: 0x64872396, + /// or in textual repr: setCollectionNesting(bool,address[]) + function setCollectionNesting(bool enable, address[] memory collections) public - view - returns (address) { require(false, stub_error); - owner; - operator; - dummy; - return 0x0000000000000000000000000000000000000000; + enable; + collections; + dummy = 0; } -} -// Selector: 5b5e139f -contract ERC721Metadata is Dummy, ERC165 { - // @notice A descriptive name for a collection of RFTs in this contract - // - // Selector: name() 06fdde03 - function name() public view returns (string memory) { + /// Set the collection access method. + /// @param mode Access mode + /// 0 for Normal + /// 1 for AllowList + /// @dev EVM selector for this function is: 0x41835d4c, + /// or in textual repr: setCollectionAccess(uint8) + function setCollectionAccess(uint8 mode) public { + require(false, stub_error); + mode; + dummy = 0; + } + + /// Add the user to the allowed list. + /// + /// @param user Address of a trusted user. + /// @dev EVM selector for this function is: 0x67844fe6, + /// or in textual repr: addToCollectionAllowList(address) + function addToCollectionAllowList(address user) public { require(false, stub_error); + user; + dummy = 0; + } + + /// Remove the user from the allowed list. + /// + /// @param user Address of a removed user. + /// @dev EVM selector for this function is: 0x85c51acb, + /// or in textual repr: removeFromCollectionAllowList(address) + function removeFromCollectionAllowList(address user) public { + require(false, stub_error); + user; + dummy = 0; + } + + /// Switch permission for minting. + /// + /// @param mode Enable if "true". + /// @dev EVM selector for this function is: 0x00018e84, + /// or in textual repr: setCollectionMintMode(bool) + function setCollectionMintMode(bool mode) public { + require(false, stub_error); + mode; + dummy = 0; + } + + /// Check that account is the owner or admin of the collection + /// + /// @param user account to verify + /// @return "true" if account is the owner or admin + /// @dev EVM selector for this function is: 0x9811b0c7, + /// or in textual repr: isOwnerOrAdmin(address) + function isOwnerOrAdmin(address user) public view returns (bool) { + require(false, stub_error); + user; dummy; - return ""; + return false; } - // @notice An abbreviated name for RFTs in this contract - // - // Selector: symbol() 95d89b41 - function symbol() public view returns (string memory) { + /// Check that substrate account is the owner or admin of the collection + /// + /// @param user account to verify + /// @return "true" if account is the owner or admin + /// @dev EVM selector for this function is: 0x68910e00, + /// or in textual repr: isOwnerOrAdminSubstrate(uint256) + function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) { require(false, stub_error); + user; dummy; + return false; + } + + /// Returns collection type + /// + /// @return `Fungible` or `NFT` or `ReFungible` + /// @dev EVM selector for this function is: 0xd34b55b8, + /// or in textual repr: uniqueCollectionType() + function uniqueCollectionType() public returns (string memory) { + require(false, stub_error); + dummy = 0; return ""; } - // @notice A distinct Uniform Resource Identifier (URI) for a given asset. - // - // @dev If the token has a `url` property and it is not empty, it is returned. - // Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. - // If the collection property `baseURI` is empty or absent, return "" (empty string) - // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix - // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). - // - // @return token's const_metadata - // - // Selector: tokenURI(uint256) c87b56dd - function tokenURI(uint256 tokenId) public view returns (string memory) { + /// Changes collection owner to another account + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner account + /// @dev EVM selector for this function is: 0x13af4035, + /// or in textual repr: setOwner(address) + function setOwner(address newOwner) public { + require(false, stub_error); + newOwner; + dummy = 0; + } + + /// Changes collection owner to another substrate account + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner substrate account + /// @dev EVM selector for this function is: 0xb212138f, + /// or in textual repr: setOwnerSubstrate(uint256) + function setOwnerSubstrate(uint256 newOwner) public { + require(false, stub_error); + newOwner; + dummy = 0; + } +} + +/// @title ERC721 Token that can be irreversibly burned (destroyed). +/// @dev the ERC-165 identifier for this interface is 0x42966c68 +contract ERC721Burnable is Dummy, ERC165 { + /// @notice Burns a specific ERC721 token. + /// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized + /// operator of the current owner. + /// @param tokenId The RFT to approve + /// @dev EVM selector for this function is: 0x42966c68, + /// or in textual repr: burn(uint256) + function burn(uint256 tokenId) public { require(false, stub_error); tokenId; - dummy; - return ""; + dummy = 0; } } -// Selector: 68ccfe89 +/// @dev inlined interface +contract ERC721MintableEvents { + event MintingFinished(); +} + +/// @title ERC721 minting logic. +/// @dev the ERC-165 identifier for this interface is 0x68ccfe89 contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { - // Selector: mintingFinished() 05d2035b + /// @dev EVM selector for this function is: 0x05d2035b, + /// or in textual repr: mintingFinished() function mintingFinished() public view returns (bool) { require(false, stub_error); dummy; return false; } - // @notice Function to mint token. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted RFT - // - // Selector: mint(address,uint256) 40c10f19 + /// @notice Function to mint token. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted RFT + /// @dev EVM selector for this function is: 0x40c10f19, + /// or in textual repr: mint(address,uint256) function mint(address to, uint256 tokenId) public returns (bool) { require(false, stub_error); to; @@ -340,14 +434,14 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { return false; } - // @notice Function to mint token with the given tokenUri. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted RFT - // @param tokenUri Token URI that would be stored in the RFT properties - // - // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f + /// @notice Function to mint token with the given tokenUri. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted RFT + /// @param tokenUri Token URI that would be stored in the RFT properties + /// @dev EVM selector for this function is: 0x50bb4e7f, + /// or in textual repr: mintWithTokenURI(address,uint256,string) function mintWithTokenURI( address to, uint256 tokenId, @@ -361,9 +455,9 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { return false; } - // @dev Not implemented - // - // Selector: finishMinting() 7d64bcb4 + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x7d64bcb4, + /// or in textual repr: finishMinting() function finishMinting() public returns (bool) { require(false, stub_error); dummy = 0; @@ -371,59 +465,17 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { } } -// Selector: 780e9d63 -contract ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid RFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) - // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) public view returns (uint256) { - require(false, stub_error); - index; - dummy; - return 0; - } - - // Not implemented - // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - public - view - returns (uint256) - { - require(false, stub_error); - owner; - index; - dummy; - return 0; - } - - // @notice Count RFTs tracked by this contract - // @return A count of valid RFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address - // - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } -} - -// Selector: 7c3bef89 +/// @title Unique extensions for ERC721. +/// @dev the ERC-165 identifier for this interface is 0x7c3bef89 contract ERC721UniqueExtensions is Dummy, ERC165 { - // @notice Transfer ownership of an RFT - // @dev Throws unless `msg.sender` is the current owner. Throws if `to` - // is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param to The new owner - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT - // - // Selector: transfer(address,uint256) a9059cbb + /// @notice Transfer ownership of an RFT + /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` + /// is the zero address. Throws if `tokenId` is not a valid RFT. + /// Throws if RFT pieces have multiple owners. + /// @param to The new owner + /// @param tokenId The RFT to transfer + /// @dev EVM selector for this function is: 0xa9059cbb, + /// or in textual repr: transfer(address,uint256) function transfer(address to, uint256 tokenId) public { require(false, stub_error); to; @@ -431,16 +483,15 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { dummy = 0; } - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this RFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param from The current owner of the RFT - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT - // - // Selector: burnFrom(address,uint256) 79cc6790 + /// @notice Burns a specific ERC721 token. + /// @dev Throws unless `msg.sender` is the current owner or an authorized + /// operator for this RFT. Throws if `from` is not the current owner. Throws + /// if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + /// Throws if RFT pieces have multiple owners. + /// @param from The current owner of the RFT + /// @param tokenId The RFT to transfer + /// @dev EVM selector for this function is: 0x79cc6790, + /// or in textual repr: burnFrom(address,uint256) function burnFrom(address from, uint256 tokenId) public { require(false, stub_error); from; @@ -448,22 +499,22 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { dummy = 0; } - // @notice Returns next free RFT ID. - // - // Selector: nextTokenId() 75794a3c + /// @notice Returns next free RFT ID. + /// @dev EVM selector for this function is: 0x75794a3c, + /// or in textual repr: nextTokenId() function nextTokenId() public view returns (uint256) { require(false, stub_error); dummy; return 0; } - // @notice Function to mint multiple tokens. - // @dev `tokenIds` should be an array of consecutive numbers and first number - // should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokenIds IDs of the minted RFTs - // - // Selector: mintBulk(address,uint256[]) 44a9945e + /// @notice Function to mint multiple tokens. + /// @dev `tokenIds` should be an array of consecutive numbers and first number + /// should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokenIds IDs of the minted RFTs + /// @dev EVM selector for this function is: 0x44a9945e, + /// or in textual repr: mintBulk(address,uint256[]) function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) @@ -475,14 +526,14 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { return false; } - // @notice Function to mint multiple tokens with the given tokenUris. - // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // numbers and first number should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokens array of pairs of token ID and token URI for minted tokens - // - // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 - function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + /// @notice Function to mint multiple tokens with the given tokenUris. + /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + /// numbers and first number should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokens array of pairs of token ID and token URI for minted tokens + /// @dev EVM selector for this function is: 0x36543006, + /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) + function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) public returns (bool) { @@ -493,11 +544,11 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { return false; } - // Returns EVM address for refungible token - // - // @param token ID of the token - // - // Selector: tokenContractAddress(uint256) ab76fac6 + /// Returns EVM address for refungible token + /// + /// @param token ID of the token + /// @dev EVM selector for this function is: 0xab76fac6, + /// or in textual repr: tokenContractAddress(uint256) function tokenContractAddress(uint256 token) public view returns (address) { require(false, stub_error); token; @@ -506,291 +557,247 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { } } -// Selector: ffe4da23 -contract Collection is Dummy, ERC165 { - // Set collection property. - // - // @param key Property key. - // @param value Propery value. - // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - public - { - require(false, stub_error); - key; - value; - dummy = 0; - } +/// @dev anonymous struct +struct Tuple8 { + uint256 field_0; + string field_1; +} - // Delete collection property. - // - // @param key Property key. - // - // Selector: deleteCollectionProperty(string) 7b7debce - function deleteCollectionProperty(string memory key) public { +/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension +/// @dev See https://eips.ethereum.org/EIPS/eip-721 +/// @dev the ERC-165 identifier for this interface is 0x780e9d63 +contract ERC721Enumerable is Dummy, ERC165 { + /// @notice Enumerate valid RFTs + /// @param index A counter less than `totalSupply()` + /// @return The token identifier for the `index`th NFT, + /// (sort order not specified) + /// @dev EVM selector for this function is: 0x4f6ccce7, + /// or in textual repr: tokenByIndex(uint256) + function tokenByIndex(uint256 index) public view returns (uint256) { require(false, stub_error); - key; - dummy = 0; + index; + dummy; + return 0; } - // Get collection property. - // - // @dev Throws error if key not found. - // - // @param key Property key. - // @return bytes The property corresponding to the key. - // - // Selector: collectionProperty(string) cf24fd6d - function collectionProperty(string memory key) + /// Not implemented + /// @dev EVM selector for this function is: 0x2f745c59, + /// or in textual repr: tokenOfOwnerByIndex(address,uint256) + function tokenOfOwnerByIndex(address owner, uint256 index) public view - returns (bytes memory) + returns (uint256) { require(false, stub_error); - key; + owner; + index; dummy; - return hex""; - } - - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) public { - require(false, stub_error); - sponsor; - dummy = 0; - } - - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() public { - require(false, stub_error); - dummy = 0; - } - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) public { - require(false, stub_error); - limit; - value; - dummy = 0; + return 0; } - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,bool) 993b7fba - function setCollectionLimit(string memory limit, bool value) public { + /// @notice Count RFTs tracked by this contract + /// @return A count of valid RFTs tracked by this contract, where each one of + /// them has an assigned and queryable owner not equal to the zero address + /// @dev EVM selector for this function is: 0x18160ddd, + /// or in textual repr: totalSupply() + function totalSupply() public view returns (uint256) { require(false, stub_error); - limit; - value; - dummy = 0; + dummy; + return 0; } +} - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 - function contractAddress() public view returns (address) { +/// @dev the ERC-165 identifier for this interface is 0x5b5e139f +contract ERC721Metadata is Dummy, ERC165 { + /// @notice A descriptive name for a collection of RFTs in this contract + /// @dev EVM selector for this function is: 0x06fdde03, + /// or in textual repr: name() + function name() public view returns (string memory) { require(false, stub_error); dummy; - return 0x0000000000000000000000000000000000000000; + return ""; } - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. - // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) public { + /// @notice An abbreviated name for RFTs in this contract + /// @dev EVM selector for this function is: 0x95d89b41, + /// or in textual repr: symbol() + function symbol() public view returns (string memory) { require(false, stub_error); - newAdmin; - dummy = 0; + dummy; + return ""; } - // Remove collection admin by substrate address. - // @param admin Substrate administrator address. - // - // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 - function removeCollectionAdminSubstrate(uint256 admin) public { + /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. + /// + /// @dev If the token has a `url` property and it is not empty, it is returned. + /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + /// If the collection property `baseURI` is empty or absent, return "" (empty string) + /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). + /// + /// @return token's const_metadata + /// @dev EVM selector for this function is: 0xc87b56dd, + /// or in textual repr: tokenURI(uint256) + function tokenURI(uint256 tokenId) public view returns (string memory) { require(false, stub_error); - admin; - dummy = 0; + tokenId; + dummy; + return ""; } +} - // Add collection admin. - // @param new_admin Address of the added administrator. - // - // Selector: addCollectionAdmin(address) 92e462c7 - function addCollectionAdmin(address newAdmin) public { - require(false, stub_error); - newAdmin; - dummy = 0; - } +/// @dev inlined interface +contract ERC721Events { + event Transfer( + address indexed from, + address indexed to, + uint256 indexed tokenId + ); + event Approval( + address indexed owner, + address indexed approved, + uint256 indexed tokenId + ); + event ApprovalForAll( + address indexed owner, + address indexed operator, + bool approved + ); +} - // Remove collection admin. - // - // @param new_admin Address of the removed administrator. - // - // Selector: removeCollectionAdmin(address) fafd7b42 - function removeCollectionAdmin(address admin) public { +/// @title ERC-721 Non-Fungible Token Standard +/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md +/// @dev the ERC-165 identifier for this interface is 0x58800161 +contract ERC721 is Dummy, ERC165, ERC721Events { + /// @notice Count all RFTs assigned to an owner + /// @dev RFTs assigned to the zero address are considered invalid, and this + /// function throws for queries about the zero address. + /// @param owner An address for whom to query the balance + /// @return The number of RFTs owned by `owner`, possibly zero + /// @dev EVM selector for this function is: 0x70a08231, + /// or in textual repr: balanceOf(address) + function balanceOf(address owner) public view returns (uint256) { require(false, stub_error); - admin; - dummy = 0; + owner; + dummy; + return 0; } - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' - // - // Selector: setCollectionNesting(bool) 112d4586 - function setCollectionNesting(bool enable) public { + /// @notice Find the owner of an RFT + /// @dev RFTs assigned to zero address are considered invalid, and queries + /// about them do throw. + /// Returns special 0xffffffffffffffffffffffffffffffffffffffff address for + /// the tokens that are partially owned. + /// @param tokenId The identifier for an RFT + /// @return The address of the owner of the RFT + /// @dev EVM selector for this function is: 0x6352211e, + /// or in textual repr: ownerOf(uint256) + function ownerOf(uint256 tokenId) public view returns (address) { require(false, stub_error); - enable; - dummy = 0; + tokenId; + dummy; + return 0x0000000000000000000000000000000000000000; } - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' - // @param collections Addresses of collections that will be available for nesting. - // - // Selector: setCollectionNesting(bool,address[]) 64872396 - function setCollectionNesting(bool enable, address[] memory collections) - public - { + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x60a11672, + /// or in textual repr: safeTransferFromWithData(address,address,uint256,bytes) + function safeTransferFromWithData( + address from, + address to, + uint256 tokenId, + bytes memory data + ) public { require(false, stub_error); - enable; - collections; + from; + to; + tokenId; + data; dummy = 0; } - // Set the collection access method. - // @param mode Access mode - // 0 for Normal - // 1 for AllowList - // - // Selector: setCollectionAccess(uint8) 41835d4c - function setCollectionAccess(uint8 mode) public { + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x42842e0e, + /// or in textual repr: safeTransferFrom(address,address,uint256) + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) public { require(false, stub_error); - mode; + from; + to; + tokenId; dummy = 0; } - // Add the user to the allowed list. - // - // @param user Address of a trusted user. - // - // Selector: addToCollectionAllowList(address) 67844fe6 - function addToCollectionAllowList(address user) public { + /// @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE + /// TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + /// THEY MAY BE PERMANENTLY LOST + /// @dev Throws unless `msg.sender` is the current owner or an authorized + /// operator for this RFT. Throws if `from` is not the current owner. Throws + /// if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + /// Throws if RFT pieces have multiple owners. + /// @param from The current owner of the NFT + /// @param to The new owner + /// @param tokenId The NFT to transfer + /// @dev EVM selector for this function is: 0x23b872dd, + /// or in textual repr: transferFrom(address,address,uint256) + function transferFrom( + address from, + address to, + uint256 tokenId + ) public { require(false, stub_error); - user; + from; + to; + tokenId; dummy = 0; } - // Remove the user from the allowed list. - // - // @param user Address of a removed user. - // - // Selector: removeFromCollectionAllowList(address) 85c51acb - function removeFromCollectionAllowList(address user) public { + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x095ea7b3, + /// or in textual repr: approve(address,uint256) + function approve(address approved, uint256 tokenId) public { require(false, stub_error); - user; + approved; + tokenId; dummy = 0; } - // Switch permission for minting. - // - // @param mode Enable if "true". - // - // Selector: setCollectionMintMode(bool) 00018e84 - function setCollectionMintMode(bool mode) public { + /// @dev Not implemented + /// @dev EVM selector for this function is: 0xa22cb465, + /// or in textual repr: setApprovalForAll(address,bool) + function setApprovalForAll(address operator, bool approved) public { require(false, stub_error); - mode; + operator; + approved; dummy = 0; } - // Check that account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdmin(address) 9811b0c7 - function isOwnerOrAdmin(address user) public view returns (bool) { + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x081812fc, + /// or in textual repr: getApproved(uint256) + function getApproved(uint256 tokenId) public view returns (address) { require(false, stub_error); - user; + tokenId; dummy; - return false; + return 0x0000000000000000000000000000000000000000; } - // Check that substrate account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00 - function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) { + /// @dev Not implemented + /// @dev EVM selector for this function is: 0xe985e9c5, + /// or in textual repr: isApprovedForAll(address,address) + function isApprovedForAll(address owner, address operator) + public + view + returns (address) + { require(false, stub_error); - user; + owner; + operator; dummy; - return false; - } - - // Returns collection type - // - // @return `Fungible` or `NFT` or `ReFungible` - // - // Selector: uniqueCollectionType() d34b55b8 - function uniqueCollectionType() public returns (string memory) { - require(false, stub_error); - dummy = 0; - return ""; - } - - // Changes collection owner to another account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner account - // - // Selector: setOwner(address) 13af4035 - function setOwner(address newOwner) public { - require(false, stub_error); - newOwner; - dummy = 0; - } - - // Changes collection owner to another substrate account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner substrate account - // - // Selector: setOwnerSubstrate(uint256) b212138f - function setOwnerSubstrate(uint256 newOwner) public { - require(false, stub_error); - newOwner; - dummy = 0; + return 0x0000000000000000000000000000000000000000; } } diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.raw b/pallets/refungible/src/stubs/UniqueRefungibleToken.raw index 7e0271122124c295c926eae676151e4e2f2e29c4..d4ac6e1830fca41eb070a5fce98636bb12261a46 100644 GIT binary patch delta 44 zcmV+{0Mq}U44(|J&IKTB0A_$U?yM+d4FUM^>y_sx;}h=0.8.0 <0.9.0; -// Common stubs holder +/// @dev common stubs holder contract Dummy { uint8 dummy; string stub_error = "this contract is implemented in native"; @@ -21,19 +21,10 @@ contract ERC165 is Dummy { } } -// Inline -contract ERC20Events { - event Transfer(address indexed from, address indexed to, uint256 value); - event Approval( - address indexed owner, - address indexed spender, - uint256 value - ); -} - -// Selector: 042f1106 +/// @dev the ERC-165 identifier for this interface is 0x042f1106 contract ERC1633UniqueExtensions is Dummy, ERC165 { - // Selector: setParentNFT(address,uint256) 042f1106 + /// @dev EVM selector for this function is: 0x042f1106, + /// or in textual repr: setParentNFT(address,uint256) function setParentNFT(address collection, uint256 nftId) public returns (bool) @@ -46,16 +37,18 @@ contract ERC1633UniqueExtensions is Dummy, ERC165 { } } -// Selector: 5755c3f2 +/// @dev the ERC-165 identifier for this interface is 0x5755c3f2 contract ERC1633 is Dummy, ERC165 { - // Selector: parentToken() 80a54001 + /// @dev EVM selector for this function is: 0x80a54001, + /// or in textual repr: parentToken() function parentToken() public view returns (address) { require(false, stub_error); dummy; return 0x0000000000000000000000000000000000000000; } - // Selector: parentTokenId() d7f083f3 + /// @dev EVM selector for this function is: 0xd7f083f3, + /// or in textual repr: parentTokenId() function parentTokenId() public view returns (uint256) { require(false, stub_error); dummy; @@ -63,49 +56,92 @@ contract ERC1633 is Dummy, ERC165 { } } -// Selector: 942e8b22 +/// @dev the ERC-165 identifier for this interface is 0xab8deb37 +contract ERC20UniqueExtensions is Dummy, ERC165 { + /// @dev Function that burns an amount of the token of a given account, + /// deducting from the sender's allowance for said account. + /// @param from The account whose tokens will be burnt. + /// @param amount The amount that will be burnt. + /// @dev EVM selector for this function is: 0x79cc6790, + /// or in textual repr: burnFrom(address,uint256) + function burnFrom(address from, uint256 amount) public returns (bool) { + require(false, stub_error); + from; + amount; + dummy = 0; + return false; + } + + /// @dev Function that changes total amount of the tokens. + /// Throws if `msg.sender` doesn't owns all of the tokens. + /// @param amount New total amount of the tokens. + /// @dev EVM selector for this function is: 0xd2418ca7, + /// or in textual repr: repartition(uint256) + function repartition(uint256 amount) public returns (bool) { + require(false, stub_error); + amount; + dummy = 0; + return false; + } +} + +/// @dev inlined interface +contract ERC20Events { + event Transfer(address indexed from, address indexed to, uint256 value); + event Approval( + address indexed owner, + address indexed spender, + uint256 value + ); +} + +/// @title Standard ERC20 token +/// +/// @dev Implementation of the basic standard token. +/// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md +/// @dev the ERC-165 identifier for this interface is 0x942e8b22 contract ERC20 is Dummy, ERC165, ERC20Events { - // @return the name of the token. - // - // Selector: name() 06fdde03 + /// @return the name of the token. + /// @dev EVM selector for this function is: 0x06fdde03, + /// or in textual repr: name() function name() public view returns (string memory) { require(false, stub_error); dummy; return ""; } - // @return the symbol of the token. - // - // Selector: symbol() 95d89b41 + /// @return the symbol of the token. + /// @dev EVM selector for this function is: 0x95d89b41, + /// or in textual repr: symbol() function symbol() public view returns (string memory) { require(false, stub_error); dummy; return ""; } - // @dev Total number of tokens in existence - // - // Selector: totalSupply() 18160ddd + /// @dev Total number of tokens in existence + /// @dev EVM selector for this function is: 0x18160ddd, + /// or in textual repr: totalSupply() function totalSupply() public view returns (uint256) { require(false, stub_error); dummy; return 0; } - // @dev Not supported - // - // Selector: decimals() 313ce567 + /// @dev Not supported + /// @dev EVM selector for this function is: 0x313ce567, + /// or in textual repr: decimals() function decimals() public view returns (uint8) { require(false, stub_error); dummy; return 0; } - // @dev Gets the balance of the specified address. - // @param owner The address to query the balance of. - // @return An uint256 representing the amount owned by the passed address. - // - // Selector: balanceOf(address) 70a08231 + /// @dev Gets the balance of the specified address. + /// @param owner The address to query the balance of. + /// @return An uint256 representing the amount owned by the passed address. + /// @dev EVM selector for this function is: 0x70a08231, + /// or in textual repr: balanceOf(address) function balanceOf(address owner) public view returns (uint256) { require(false, stub_error); owner; @@ -113,11 +149,11 @@ contract ERC20 is Dummy, ERC165, ERC20Events { return 0; } - // @dev Transfer token for a specified address - // @param to The address to transfer to. - // @param amount The amount to be transferred. - // - // Selector: transfer(address,uint256) a9059cbb + /// @dev Transfer token for a specified address + /// @param to The address to transfer to. + /// @param amount The amount to be transferred. + /// @dev EVM selector for this function is: 0xa9059cbb, + /// or in textual repr: transfer(address,uint256) function transfer(address to, uint256 amount) public returns (bool) { require(false, stub_error); to; @@ -126,12 +162,12 @@ contract ERC20 is Dummy, ERC165, ERC20Events { return false; } - // @dev Transfer tokens from one address to another - // @param from address The address which you want to send tokens from - // @param to address The address which you want to transfer to - // @param amount uint256 the amount of tokens to be transferred - // - // Selector: transferFrom(address,address,uint256) 23b872dd + /// @dev Transfer tokens from one address to another + /// @param from address The address which you want to send tokens from + /// @param to address The address which you want to transfer to + /// @param amount uint256 the amount of tokens to be transferred + /// @dev EVM selector for this function is: 0x23b872dd, + /// or in textual repr: transferFrom(address,address,uint256) function transferFrom( address from, address to, @@ -145,15 +181,15 @@ contract ERC20 is Dummy, ERC165, ERC20Events { return false; } - // @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`. - // Beware that changing an allowance with this method brings the risk that someone may use both the old - // and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this - // race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: - // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - // @param spender The address which will spend the funds. - // @param amount The amount of tokens to be spent. - // - // Selector: approve(address,uint256) 095ea7b3 + /// @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`. + /// Beware that changing an allowance with this method brings the risk that someone may use both the old + /// and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this + /// race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: + /// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + /// @param spender The address which will spend the funds. + /// @param amount The amount of tokens to be spent. + /// @dev EVM selector for this function is: 0x095ea7b3, + /// or in textual repr: approve(address,uint256) function approve(address spender, uint256 amount) public returns (bool) { require(false, stub_error); spender; @@ -162,12 +198,12 @@ contract ERC20 is Dummy, ERC165, ERC20Events { return false; } - // @dev Function to check the amount of tokens that an owner allowed to a spender. - // @param owner address The address which owns the funds. - // @param spender address The address which will spend the funds. - // @return A uint256 specifying the amount of tokens still available for the spender. - // - // Selector: allowance(address,address) dd62ed3e + /// @dev Function to check the amount of tokens that an owner allowed to a spender. + /// @param owner address The address which owns the funds. + /// @param spender address The address which will spend the funds. + /// @return A uint256 specifying the amount of tokens still available for the spender. + /// @dev EVM selector for this function is: 0xdd62ed3e, + /// or in textual repr: allowance(address,address) function allowance(address owner, address spender) public view @@ -181,35 +217,6 @@ contract ERC20 is Dummy, ERC165, ERC20Events { } } -// Selector: ab8deb37 -contract ERC20UniqueExtensions is Dummy, ERC165 { - // @dev Function that burns an amount of the token of a given account, - // deducting from the sender's allowance for said account. - // @param from The account whose tokens will be burnt. - // @param amount The amount that will be burnt. - // - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) public returns (bool) { - require(false, stub_error); - from; - amount; - dummy = 0; - return false; - } - - // @dev Function that changes total amount of the tokens. - // Throws if `msg.sender` doesn't owns all of the tokens. - // @param amount New total amount of the tokens. - // - // Selector: repartition(uint256) d2418ca7 - function repartition(uint256 amount) public returns (bool) { - require(false, stub_error); - amount; - dummy = 0; - return false; - } -} - contract UniqueRefungibleToken is Dummy, ERC165, diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 7bde2ee4d4..57a09eb36b 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -203,7 +203,7 @@ fn create_refungible_collection_internal< } /// @title Contract, which allows users to operate with collections -#[solidity_interface(name = "CollectionHelpers", events(CollectionHelpersEvents))] +#[solidity_interface(name = CollectionHelpers, events(CollectionHelpersEvents))] impl EvmCollectionHelpers where T: Config + pallet_nonfungible::Config + pallet_refungible::Config, @@ -211,7 +211,7 @@ where /// Create an NFT collection /// @param name Name of the collection /// @param description Informative description of the collection - /// @param token_prefix Token prefix to represent the collection tokens in UI and user applications + /// @param tokenPrefix Token prefix to represent the collection tokens in UI and user applications /// @return address Address of the newly created collection #[weight(>::create_collection())] fn create_nonfungible_collection( @@ -304,7 +304,7 @@ where } /// Check if a collection exists - /// @param collection_address Address of the collection in question + /// @param collectionAddress Address of the collection in question /// @return bool Does the collection exist? fn is_collection_exist(&self, _caller: caller, collection_address: address) -> Result { if let Some(id) = pallet_common::eth::map_eth_to_id(&collection_address) { diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index ca43173e6e955ef7a6ff22dd19b65ad432427dca..220e733ff87501f767eca64356b648b00545b171 100644 GIT binary patch delta 44 zcmV+{0Mq}_3(yO&e+3}VT79&so6Gpq90(kJQf-56YfSr0Qu{mF0gn>?zp9L}K CnH4br delta 44 zcmV+{0Mq}_3(yO&e+3}i=6P5ouSwXG1`X7umI`Zih{syu>PKvqio(iR7KewEp9L}1 CO%&(= diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.sol b/pallets/unique/src/eth/stubs/CollectionHelpers.sol index 2db0c73d43..afe228fd64 100644 --- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol +++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol @@ -3,7 +3,7 @@ pragma solidity >=0.8.0 <0.9.0; -// Common stubs holder +/// @dev common stubs holder contract Dummy { uint8 dummy; string stub_error = "this contract is implemented in native"; @@ -21,7 +21,7 @@ contract ERC165 is Dummy { } } -// Inline +/// @dev inlined interface contract CollectionHelpersEvents { event CollectionCreated( address indexed owner, @@ -29,15 +29,16 @@ contract CollectionHelpersEvents { ); } -// Selector: 675f3074 +/// @title Contract, which allows users to operate with collections +/// @dev the ERC-165 identifier for this interface is 0x675f3074 contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { - // Create an NFT collection - // @param name Name of the collection - // @param description Informative description of the collection - // @param token_prefix Token prefix to represent the collection tokens in UI and user applications - // @return address Address of the newly created collection - // - // Selector: createNonfungibleCollection(string,string,string) e34a6844 + /// Create an NFT collection + /// @param name Name of the collection + /// @param description Informative description of the collection + /// @param tokenPrefix Token prefix to represent the collection tokens in UI and user applications + /// @return address Address of the newly created collection + /// @dev EVM selector for this function is: 0xe34a6844, + /// or in textual repr: createNonfungibleCollection(string,string,string) function createNonfungibleCollection( string memory name, string memory description, @@ -51,7 +52,8 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { return 0x0000000000000000000000000000000000000000; } - // Selector: createERC721MetadataCompatibleCollection(string,string,string,string) a634a5f9 + /// @dev EVM selector for this function is: 0xa634a5f9, + /// or in textual repr: createERC721MetadataCompatibleCollection(string,string,string,string) function createERC721MetadataCompatibleCollection( string memory name, string memory description, @@ -67,7 +69,8 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { return 0x0000000000000000000000000000000000000000; } - // Selector: createRefungibleCollection(string,string,string) 44a68ad5 + /// @dev EVM selector for this function is: 0x44a68ad5, + /// or in textual repr: createRefungibleCollection(string,string,string) function createRefungibleCollection( string memory name, string memory description, @@ -81,7 +84,8 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { return 0x0000000000000000000000000000000000000000; } - // Selector: createERC721MetadataCompatibleRFTCollection(string,string,string,string) a5596388 + /// @dev EVM selector for this function is: 0xa5596388, + /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string) function createERC721MetadataCompatibleRFTCollection( string memory name, string memory description, @@ -97,11 +101,11 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { return 0x0000000000000000000000000000000000000000; } - // Check if a collection exists - // @param collection_address Address of the collection in question - // @return bool Does the collection exist? - // - // Selector: isCollectionExist(address) c3de1494 + /// Check if a collection exists + /// @param collectionAddress Address of the collection in question + /// @return bool Does the collection exist? + /// @dev EVM selector for this function is: 0xc3de1494, + /// or in textual repr: isCollectionExist(address) function isCollectionExist(address collectionAddress) public view diff --git a/tests/src/eth/api/CollectionHelpers.sol b/tests/src/eth/api/CollectionHelpers.sol index de8ffc6338..8df752e7dd 100644 --- a/tests/src/eth/api/CollectionHelpers.sol +++ b/tests/src/eth/api/CollectionHelpers.sol @@ -3,7 +3,7 @@ pragma solidity >=0.8.0 <0.9.0; -// Common stubs holder +/// @dev common stubs holder interface Dummy { } @@ -12,7 +12,7 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } -// Inline +/// @dev inlined interface interface CollectionHelpersEvents { event CollectionCreated( address indexed owner, @@ -20,22 +20,24 @@ interface CollectionHelpersEvents { ); } -// Selector: 675f3074 +/// @title Contract, which allows users to operate with collections +/// @dev the ERC-165 identifier for this interface is 0x675f3074 interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { - // Create an NFT collection - // @param name Name of the collection - // @param description Informative description of the collection - // @param token_prefix Token prefix to represent the collection tokens in UI and user applications - // @return address Address of the newly created collection - // - // Selector: createNonfungibleCollection(string,string,string) e34a6844 + /// Create an NFT collection + /// @param name Name of the collection + /// @param description Informative description of the collection + /// @param tokenPrefix Token prefix to represent the collection tokens in UI and user applications + /// @return address Address of the newly created collection + /// @dev EVM selector for this function is: 0xe34a6844, + /// or in textual repr: createNonfungibleCollection(string,string,string) function createNonfungibleCollection( string memory name, string memory description, string memory tokenPrefix ) external returns (address); - // Selector: createERC721MetadataCompatibleCollection(string,string,string,string) a634a5f9 + /// @dev EVM selector for this function is: 0xa634a5f9, + /// or in textual repr: createERC721MetadataCompatibleCollection(string,string,string,string) function createERC721MetadataCompatibleCollection( string memory name, string memory description, @@ -43,14 +45,16 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory baseUri ) external returns (address); - // Selector: createRefungibleCollection(string,string,string) 44a68ad5 + /// @dev EVM selector for this function is: 0x44a68ad5, + /// or in textual repr: createRefungibleCollection(string,string,string) function createRefungibleCollection( string memory name, string memory description, string memory tokenPrefix ) external returns (address); - // Selector: createERC721MetadataCompatibleRFTCollection(string,string,string,string) a5596388 + /// @dev EVM selector for this function is: 0xa5596388, + /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string) function createERC721MetadataCompatibleRFTCollection( string memory name, string memory description, @@ -58,11 +62,11 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory baseUri ) external returns (address); - // Check if a collection exists - // @param collection_address Address of the collection in question - // @return bool Does the collection exist? - // - // Selector: isCollectionExist(address) c3de1494 + /// Check if a collection exists + /// @param collectionAddress Address of the collection in question + /// @return bool Does the collection exist? + /// @dev EVM selector for this function is: 0xc3de1494, + /// or in textual repr: isCollectionExist(address) function isCollectionExist(address collectionAddress) external view diff --git a/tests/src/eth/api/ContractHelpers.sol b/tests/src/eth/api/ContractHelpers.sol index 5afcdd50b7..fa37be6326 100644 --- a/tests/src/eth/api/ContractHelpers.sol +++ b/tests/src/eth/api/ContractHelpers.sol @@ -3,13 +3,13 @@ pragma solidity >=0.8.0 <0.9.0; -// Anonymous struct +/// @dev anonymous struct struct Tuple0 { address field_0; uint256 field_1; } -// Common stubs holder +/// @dev common stubs holder interface Dummy { } @@ -18,124 +18,124 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } -// Selector: 6073d917 +/// @dev the ERC-165 identifier for this interface is 0x6073d917 interface ContractHelpers is Dummy, ERC165 { - // Get contract ovner - // - // @param Contract_address contract for which the owner is being determined. - // @return Contract owner. - // - // Selector: contractOwner(address) 5152b14c + /// Get contract ovner + /// + /// @param contractAddress contract for which the owner is being determined. + /// @return Contract owner. + /// + /// Selector: contractOwner(address) 5152b14c function contractOwner(address contractAddress) external view returns (address); - // Set sponsor. - // - // @param contract_address Contract for which a sponsor is being established. - // @param sponsor User address who set as pending sponsor. - // - // Selector: setSponsor(address,address) f01fba93 + /// Set sponsor. + /// + /// @param contractAddress Contract for which a sponsor is being established. + /// @param sponsor User address who set as pending sponsor. + /// + /// Selector: setSponsor(address,address) f01fba93 function setSponsor(address contractAddress, address sponsor) external; - // Set contract as self sponsored. - // - // @param contract_address Contract for which a self sponsoring is being enabled. - // - // Selector: selfSponsoredEnable(address) 89f7d9ae + /// Set contract as self sponsored. + /// + /// @param contractAddress Contract for which a self sponsoring is being enabled. + /// + /// Selector: selfSponsoredEnable(address) 89f7d9ae function selfSponsoredEnable(address contractAddress) external; - // Remove sponsor. - // - // @param contract_address Contract for which a sponsorship is being removed. - // - // Selector: removeSponsor(address) ef784250 + /// Remove sponsor. + /// + /// @param contractAddress Contract for which a sponsorship is being removed. + /// + /// Selector: removeSponsor(address) ef784250 function removeSponsor(address contractAddress) external; - // Confirm sponsorship. - // - // @dev Caller must be same that set via [`set_sponsor`]. - // - // @param contract_address Сontract for which need to confirm sponsorship. - // - // Selector: confirmSponsorship(address) abc00001 + /// Confirm sponsorship. + /// + /// @dev Caller must be same that set via [`setSponsor`]. + /// + /// @param contractAddress Сontract for which need to confirm sponsorship. + /// + /// Selector: confirmSponsorship(address) abc00001 function confirmSponsorship(address contractAddress) external; - // Get current sponsor. - // - // @param contract_address The contract for which a sponsor is requested. - // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - // - // Selector: getSponsor(address) 743fc745 + /// Get current sponsor. + /// + /// @param contractAddress The contract for which a sponsor is requested. + /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + /// + /// Selector: getSponsor(address) 743fc745 function getSponsor(address contractAddress) external view returns (Tuple0 memory); - // Check tat contract has confirmed sponsor. - // - // @param contract_address The contract for which the presence of a confirmed sponsor is checked. - // @return **true** if contract has confirmed sponsor. - // - // Selector: hasSponsor(address) 97418603 + /// Check tat contract has confirmed sponsor. + /// + /// @param contractAddress The contract for which the presence of a confirmed sponsor is checked. + /// @return **true** if contract has confirmed sponsor. + /// + /// Selector: hasSponsor(address) 97418603 function hasSponsor(address contractAddress) external view returns (bool); - // Check tat contract has pending sponsor. - // - // @param contract_address The contract for which the presence of a pending sponsor is checked. - // @return **true** if contract has pending sponsor. - // - // Selector: hasPendingSponsor(address) 39b9b242 + /// Check tat contract has pending sponsor. + /// + /// @param contractAddress The contract for which the presence of a pending sponsor is checked. + /// @return **true** if contract has pending sponsor. + /// + /// Selector: hasPendingSponsor(address) 39b9b242 function hasPendingSponsor(address contractAddress) external view returns (bool); - // Selector: sponsoringEnabled(address) 6027dc61 + /// Selector: sponsoringEnabled(address) 6027dc61 function sponsoringEnabled(address contractAddress) external view returns (bool); - // Selector: setSponsoringMode(address,uint8) fde8a560 + /// Selector: setSponsoringMode(address,uint8) fde8a560 function setSponsoringMode(address contractAddress, uint8 mode) external; - // Selector: sponsoringMode(address) b70c7267 + /// Selector: sponsoringMode(address) b70c7267 function sponsoringMode(address contractAddress) external view returns (uint8); - // Selector: setSponsoringRateLimit(address,uint32) 77b6c908 + /// Selector: setSponsoringRateLimit(address,uint32) 77b6c908 function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) external; - // Selector: getSponsoringRateLimit(address) 610cfabd + /// Selector: getSponsoringRateLimit(address) 610cfabd function getSponsoringRateLimit(address contractAddress) external view returns (uint32); - // Selector: allowed(address,address) 5c658165 + /// Selector: allowed(address,address) 5c658165 function allowed(address contractAddress, address user) external view returns (bool); - // Selector: allowlistEnabled(address) c772ef6c + /// Selector: allowlistEnabled(address) c772ef6c function allowlistEnabled(address contractAddress) external view returns (bool); - // Selector: toggleAllowlist(address,bool) 36de20f5 + /// Selector: toggleAllowlist(address,bool) 36de20f5 function toggleAllowlist(address contractAddress, bool enabled) external; - // Selector: toggleAllowed(address,address,bool) 4706cc1c + /// Selector: toggleAllowed(address,address,bool) 4706cc1c function toggleAllowed( address contractAddress, address user, - bool allowed + bool isAllowed ) external; } diff --git a/tests/src/eth/api/UniqueFungible.sol b/tests/src/eth/api/UniqueFungible.sol index dcf3e11023..358c4a6841 100644 --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -3,7 +3,7 @@ pragma solidity >=0.8.0 <0.9.0; -// Common stubs holder +/// @dev common stubs holder interface Dummy { } @@ -12,246 +12,257 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } -// Inline -interface ERC20Events { - event Transfer(address indexed from, address indexed to, uint256 value); - event Approval( - address indexed owner, - address indexed spender, - uint256 value - ); -} - -// Selector: 79cc6790 -interface ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) external returns (bool); -} - -// Selector: 942e8b22 -interface ERC20 is Dummy, ERC165, ERC20Events { - // Selector: name() 06fdde03 - function name() external view returns (string memory); - - // Selector: symbol() 95d89b41 - function symbol() external view returns (string memory); - - // Selector: totalSupply() 18160ddd - function totalSupply() external view returns (uint256); - - // Selector: decimals() 313ce567 - function decimals() external view returns (uint8); - - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) external view returns (uint256); - - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 amount) external returns (bool); - - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 amount - ) external returns (bool); - - // Selector: approve(address,uint256) 095ea7b3 - function approve(address spender, uint256 amount) external returns (bool); - - // Selector: allowance(address,address) dd62ed3e - function allowance(address owner, address spender) - external - view - returns (uint256); -} - -// Selector: ffe4da23 +/// @title A contract that allows you to work with collections. +/// @dev the ERC-165 identifier for this interface is 0xffe4da23 interface Collection is Dummy, ERC165 { - // Set collection property. - // - // @param key Property key. - // @param value Propery value. - // - // Selector: setCollectionProperty(string,bytes) 2f073f66 + /// Set collection property. + /// + /// @param key Property key. + /// @param value Propery value. + /// @dev EVM selector for this function is: 0x2f073f66, + /// or in textual repr: setCollectionProperty(string,bytes) function setCollectionProperty(string memory key, bytes memory value) external; - // Delete collection property. - // - // @param key Property key. - // - // Selector: deleteCollectionProperty(string) 7b7debce + /// Delete collection property. + /// + /// @param key Property key. + /// @dev EVM selector for this function is: 0x7b7debce, + /// or in textual repr: deleteCollectionProperty(string) function deleteCollectionProperty(string memory key) external; - // Get collection property. - // - // @dev Throws error if key not found. - // - // @param key Property key. - // @return bytes The property corresponding to the key. - // - // Selector: collectionProperty(string) cf24fd6d + /// Get collection property. + /// + /// @dev Throws error if key not found. + /// + /// @param key Property key. + /// @return bytes The property corresponding to the key. + /// @dev EVM selector for this function is: 0xcf24fd6d, + /// or in textual repr: collectionProperty(string) function collectionProperty(string memory key) external view returns (bytes memory); - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsor(address) 7623402e + /// Set the sponsor of the collection. + /// + /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + /// + /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + /// @dev EVM selector for this function is: 0x7623402e, + /// or in textual repr: setCollectionSponsor(address) function setCollectionSponsor(address sponsor) external; - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a + /// Collection sponsorship confirmation. + /// + /// @dev After setting the sponsor for the collection, it must be confirmed with this function. + /// @dev EVM selector for this function is: 0x3c50e97a, + /// or in textual repr: confirmCollectionSponsorship() function confirmCollectionSponsorship() external; - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db + /// Set limits for the collection. + /// @dev Throws error if limit not found. + /// @param limit Name of the limit. Valid names: + /// "accountTokenOwnershipLimit", + /// "sponsoredDataSize", + /// "sponsoredDataRateLimit", + /// "tokenLimit", + /// "sponsorTransferTimeout", + /// "sponsorApproveTimeout" + /// @param value Value of the limit. + /// @dev EVM selector for this function is: 0x6a3841db, + /// or in textual repr: setCollectionLimit(string,uint32) function setCollectionLimit(string memory limit, uint32 value) external; - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,bool) 993b7fba + /// Set limits for the collection. + /// @dev Throws error if limit not found. + /// @param limit Name of the limit. Valid names: + /// "ownerCanTransfer", + /// "ownerCanDestroy", + /// "transfersEnabled" + /// @param value Value of the limit. + /// @dev EVM selector for this function is: 0x993b7fba, + /// or in textual repr: setCollectionLimit(string,bool) function setCollectionLimit(string memory limit, bool value) external; - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 + /// Get contract address. + /// @dev EVM selector for this function is: 0xf6b4dfb4, + /// or in textual repr: contractAddress() function contractAddress() external view returns (address); - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. - // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b + /// Add collection admin by substrate address. + /// @param newAdmin Substrate administrator address. + /// @dev EVM selector for this function is: 0x5730062b, + /// or in textual repr: addCollectionAdminSubstrate(uint256) function addCollectionAdminSubstrate(uint256 newAdmin) external; - // Remove collection admin by substrate address. - // @param admin Substrate administrator address. - // - // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 + /// Remove collection admin by substrate address. + /// @param admin Substrate administrator address. + /// @dev EVM selector for this function is: 0x4048fcf9, + /// or in textual repr: removeCollectionAdminSubstrate(uint256) function removeCollectionAdminSubstrate(uint256 admin) external; - // Add collection admin. - // @param new_admin Address of the added administrator. - // - // Selector: addCollectionAdmin(address) 92e462c7 + /// Add collection admin. + /// @param newAdmin Address of the added administrator. + /// @dev EVM selector for this function is: 0x92e462c7, + /// or in textual repr: addCollectionAdmin(address) function addCollectionAdmin(address newAdmin) external; - // Remove collection admin. - // - // @param new_admin Address of the removed administrator. - // - // Selector: removeCollectionAdmin(address) fafd7b42 + /// Remove collection admin. + /// + /// @param admin Address of the removed administrator. + /// @dev EVM selector for this function is: 0xfafd7b42, + /// or in textual repr: removeCollectionAdmin(address) function removeCollectionAdmin(address admin) external; - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' - // - // Selector: setCollectionNesting(bool) 112d4586 + /// Toggle accessibility of collection nesting. + /// + /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + /// @dev EVM selector for this function is: 0x112d4586, + /// or in textual repr: setCollectionNesting(bool) function setCollectionNesting(bool enable) external; - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' - // @param collections Addresses of collections that will be available for nesting. - // - // Selector: setCollectionNesting(bool,address[]) 64872396 + /// Toggle accessibility of collection nesting. + /// + /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + /// @param collections Addresses of collections that will be available for nesting. + /// @dev EVM selector for this function is: 0x64872396, + /// or in textual repr: setCollectionNesting(bool,address[]) function setCollectionNesting(bool enable, address[] memory collections) external; - // Set the collection access method. - // @param mode Access mode - // 0 for Normal - // 1 for AllowList - // - // Selector: setCollectionAccess(uint8) 41835d4c + /// Set the collection access method. + /// @param mode Access mode + /// 0 for Normal + /// 1 for AllowList + /// @dev EVM selector for this function is: 0x41835d4c, + /// or in textual repr: setCollectionAccess(uint8) function setCollectionAccess(uint8 mode) external; - // Add the user to the allowed list. - // - // @param user Address of a trusted user. - // - // Selector: addToCollectionAllowList(address) 67844fe6 + /// Add the user to the allowed list. + /// + /// @param user Address of a trusted user. + /// @dev EVM selector for this function is: 0x67844fe6, + /// or in textual repr: addToCollectionAllowList(address) function addToCollectionAllowList(address user) external; - // Remove the user from the allowed list. - // - // @param user Address of a removed user. - // - // Selector: removeFromCollectionAllowList(address) 85c51acb + /// Remove the user from the allowed list. + /// + /// @param user Address of a removed user. + /// @dev EVM selector for this function is: 0x85c51acb, + /// or in textual repr: removeFromCollectionAllowList(address) function removeFromCollectionAllowList(address user) external; - // Switch permission for minting. - // - // @param mode Enable if "true". - // - // Selector: setCollectionMintMode(bool) 00018e84 + /// Switch permission for minting. + /// + /// @param mode Enable if "true". + /// @dev EVM selector for this function is: 0x00018e84, + /// or in textual repr: setCollectionMintMode(bool) function setCollectionMintMode(bool mode) external; - // Check that account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdmin(address) 9811b0c7 + /// Check that account is the owner or admin of the collection + /// + /// @param user account to verify + /// @return "true" if account is the owner or admin + /// @dev EVM selector for this function is: 0x9811b0c7, + /// or in textual repr: isOwnerOrAdmin(address) function isOwnerOrAdmin(address user) external view returns (bool); - // Check that substrate account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00 + /// Check that substrate account is the owner or admin of the collection + /// + /// @param user account to verify + /// @return "true" if account is the owner or admin + /// @dev EVM selector for this function is: 0x68910e00, + /// or in textual repr: isOwnerOrAdminSubstrate(uint256) function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool); - // Returns collection type - // - // @return `Fungible` or `NFT` or `ReFungible` - // - // Selector: uniqueCollectionType() d34b55b8 + /// Returns collection type + /// + /// @return `Fungible` or `NFT` or `ReFungible` + /// @dev EVM selector for this function is: 0xd34b55b8, + /// or in textual repr: uniqueCollectionType() function uniqueCollectionType() external returns (string memory); - // Changes collection owner to another account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner account - // - // Selector: setOwner(address) 13af4035 + /// Changes collection owner to another account + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner account + /// @dev EVM selector for this function is: 0x13af4035, + /// or in textual repr: setOwner(address) function setOwner(address newOwner) external; - // Changes collection owner to another substrate account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner substrate account - // - // Selector: setOwnerSubstrate(uint256) b212138f + /// Changes collection owner to another substrate account + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner substrate account + /// @dev EVM selector for this function is: 0xb212138f, + /// or in textual repr: setOwnerSubstrate(uint256) function setOwnerSubstrate(uint256 newOwner) external; } +/// @dev the ERC-165 identifier for this interface is 0x79cc6790 +interface ERC20UniqueExtensions is Dummy, ERC165 { + /// @dev EVM selector for this function is: 0x79cc6790, + /// or in textual repr: burnFrom(address,uint256) + function burnFrom(address from, uint256 amount) external returns (bool); +} + +/// @dev inlined interface +interface ERC20Events { + event Transfer(address indexed from, address indexed to, uint256 value); + event Approval( + address indexed owner, + address indexed spender, + uint256 value + ); +} + +/// @dev the ERC-165 identifier for this interface is 0x942e8b22 +interface ERC20 is Dummy, ERC165, ERC20Events { + /// @dev EVM selector for this function is: 0x06fdde03, + /// or in textual repr: name() + function name() external view returns (string memory); + + /// @dev EVM selector for this function is: 0x95d89b41, + /// or in textual repr: symbol() + function symbol() external view returns (string memory); + + /// @dev EVM selector for this function is: 0x18160ddd, + /// or in textual repr: totalSupply() + function totalSupply() external view returns (uint256); + + /// @dev EVM selector for this function is: 0x313ce567, + /// or in textual repr: decimals() + function decimals() external view returns (uint8); + + /// @dev EVM selector for this function is: 0x70a08231, + /// or in textual repr: balanceOf(address) + function balanceOf(address owner) external view returns (uint256); + + /// @dev EVM selector for this function is: 0xa9059cbb, + /// or in textual repr: transfer(address,uint256) + function transfer(address to, uint256 amount) external returns (bool); + + /// @dev EVM selector for this function is: 0x23b872dd, + /// or in textual repr: transferFrom(address,address,uint256) + function transferFrom( + address from, + address to, + uint256 amount + ) external returns (bool); + + /// @dev EVM selector for this function is: 0x095ea7b3, + /// or in textual repr: approve(address,uint256) + function approve(address spender, uint256 amount) external returns (bool); + + /// @dev EVM selector for this function is: 0xdd62ed3e, + /// or in textual repr: allowance(address,address) + function allowance(address owner, address spender) + external + view + returns (uint256); +} + interface UniqueFungible is Dummy, ERC165, diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index 5ba5322869..62d718dd06 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -3,13 +3,7 @@ pragma solidity >=0.8.0 <0.9.0; -// Anonymous struct -struct Tuple0 { - uint256 field_0; - string field_1; -} - -// Common stubs holder +/// @dev common stubs holder interface Dummy { } @@ -18,40 +12,17 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } -// Inline -interface ERC721Events { - event Transfer( - address indexed from, - address indexed to, - uint256 indexed tokenId - ); - event Approval( - address indexed owner, - address indexed approved, - uint256 indexed tokenId - ); - event ApprovalForAll( - address indexed owner, - address indexed operator, - bool approved - ); -} - -// Inline -interface ERC721MintableEvents { - event MintingFinished(); -} - -// Selector: 41369377 +/// @title A contract that allows to set and delete token properties and change token property permissions. +/// @dev the ERC-165 identifier for this interface is 0x41369377 interface TokenProperties is Dummy, ERC165 { - // @notice Set permissions for token property. - // @dev Throws error if `msg.sender` is not admin or owner of the collection. - // @param key Property key. - // @param is_mutable Permission to mutate property. - // @param collection_admin Permission to mutate property by collection admin if property is mutable. - // @param token_owner Permission to mutate property by token owner if property is mutable. - // - // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa + /// @notice Set permissions for token property. + /// @dev Throws error if `msg.sender` is not admin or owner of the collection. + /// @param key Property key. + /// @param isMutable Permission to mutate property. + /// @param collectionAdmin Permission to mutate property by collection admin if property is mutable. + /// @param tokenOwner Permission to mutate property by token owner if property is mutable. + /// @dev EVM selector for this function is: 0x222d97fa, + /// or in textual repr: setTokenPropertyPermission(string,bool,bool,bool) function setTokenPropertyPermission( string memory key, bool isMutable, @@ -59,459 +30,497 @@ interface TokenProperties is Dummy, ERC165 { bool tokenOwner ) external; - // @notice Set token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. - // @param key Property key. - // @param value Property value. - // - // Selector: setProperty(uint256,string,bytes) 1752d67b + /// @notice Set token property value. + /// @dev Throws error if `msg.sender` has no permission to edit the property. + /// @param tokenId ID of the token. + /// @param key Property key. + /// @param value Property value. + /// @dev EVM selector for this function is: 0x1752d67b, + /// or in textual repr: setProperty(uint256,string,bytes) function setProperty( uint256 tokenId, string memory key, bytes memory value ) external; - // @notice Delete token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. - // @param key Property key. - // - // Selector: deleteProperty(uint256,string) 066111d1 + /// @notice Delete token property value. + /// @dev Throws error if `msg.sender` has no permission to edit the property. + /// @param tokenId ID of the token. + /// @param key Property key. + /// @dev EVM selector for this function is: 0x066111d1, + /// or in textual repr: deleteProperty(uint256,string) function deleteProperty(uint256 tokenId, string memory key) external; - // @notice Get token property value. - // @dev Throws error if key not found - // @param tokenId ID of the token. - // @param key Property key. - // @return Property value bytes - // - // Selector: property(uint256,string) 7228c327 + /// @notice Get token property value. + /// @dev Throws error if key not found + /// @param tokenId ID of the token. + /// @param key Property key. + /// @return Property value bytes + /// @dev EVM selector for this function is: 0x7228c327, + /// or in textual repr: property(uint256,string) function property(uint256 tokenId, string memory key) external view returns (bytes memory); } -// Selector: 42966c68 -interface ERC721Burnable is Dummy, ERC165 { - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized - // operator of the current owner. - // @param tokenId The NFT to approve - // - // Selector: burn(uint256) 42966c68 - function burn(uint256 tokenId) external; -} +/// @title A contract that allows you to work with collections. +/// @dev the ERC-165 identifier for this interface is 0xffe4da23 +interface Collection is Dummy, ERC165 { + /// Set collection property. + /// + /// @param key Property key. + /// @param value Propery value. + /// @dev EVM selector for this function is: 0x2f073f66, + /// or in textual repr: setCollectionProperty(string,bytes) + function setCollectionProperty(string memory key, bytes memory value) + external; -// Selector: 58800161 -interface ERC721 is Dummy, ERC165, ERC721Events { - // @notice Count all NFTs assigned to an owner - // @dev NFTs assigned to the zero address are considered invalid, and this - // function throws for queries about the zero address. - // @param owner An address for whom to query the balance - // @return The number of NFTs owned by `owner`, possibly zero - // - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) external view returns (uint256); + /// Delete collection property. + /// + /// @param key Property key. + /// @dev EVM selector for this function is: 0x7b7debce, + /// or in textual repr: deleteCollectionProperty(string) + function deleteCollectionProperty(string memory key) external; - // @notice Find the owner of an NFT - // @dev NFTs assigned to zero address are considered invalid, and queries - // about them do throw. - // @param tokenId The identifier for an NFT - // @return The address of the owner of the NFT - // - // Selector: ownerOf(uint256) 6352211e - function ownerOf(uint256 tokenId) external view returns (address); + /// Get collection property. + /// + /// @dev Throws error if key not found. + /// + /// @param key Property key. + /// @return bytes The property corresponding to the key. + /// @dev EVM selector for this function is: 0xcf24fd6d, + /// or in textual repr: collectionProperty(string) + function collectionProperty(string memory key) + external + view + returns (bytes memory); - // @dev Not implemented - // - // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672 - function safeTransferFromWithData( - address from, - address to, - uint256 tokenId, - bytes memory data - ) external; + /// Set the sponsor of the collection. + /// + /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + /// + /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + /// @dev EVM selector for this function is: 0x7623402e, + /// or in textual repr: setCollectionSponsor(address) + function setCollectionSponsor(address sponsor) external; - // @dev Not implemented - // - // Selector: safeTransferFrom(address,address,uint256) 42842e0e - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) external; + /// Collection sponsorship confirmation. + /// + /// @dev After setting the sponsor for the collection, it must be confirmed with this function. + /// @dev EVM selector for this function is: 0x3c50e97a, + /// or in textual repr: confirmCollectionSponsorship() + function confirmCollectionSponsorship() external; - // @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE - // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE - // THEY MAY BE PERMANENTLY LOST - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this NFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid NFT. - // @param from The current owner of the NFT - // @param to The new owner - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT - // - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 tokenId - ) external; + /// Set limits for the collection. + /// @dev Throws error if limit not found. + /// @param limit Name of the limit. Valid names: + /// "accountTokenOwnershipLimit", + /// "sponsoredDataSize", + /// "sponsoredDataRateLimit", + /// "tokenLimit", + /// "sponsorTransferTimeout", + /// "sponsorApproveTimeout" + /// @param value Value of the limit. + /// @dev EVM selector for this function is: 0x6a3841db, + /// or in textual repr: setCollectionLimit(string,uint32) + function setCollectionLimit(string memory limit, uint32 value) external; - // @notice Set or reaffirm the approved address for an NFT - // @dev The zero address indicates there is no approved address. - // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized - // operator of the current owner. - // @param approved The new approved NFT controller - // @param tokenId The NFT to approve - // - // Selector: approve(address,uint256) 095ea7b3 - function approve(address approved, uint256 tokenId) external; + /// Set limits for the collection. + /// @dev Throws error if limit not found. + /// @param limit Name of the limit. Valid names: + /// "ownerCanTransfer", + /// "ownerCanDestroy", + /// "transfersEnabled" + /// @param value Value of the limit. + /// @dev EVM selector for this function is: 0x993b7fba, + /// or in textual repr: setCollectionLimit(string,bool) + function setCollectionLimit(string memory limit, bool value) external; - // @dev Not implemented - // - // Selector: setApprovalForAll(address,bool) a22cb465 - function setApprovalForAll(address operator, bool approved) external; + /// Get contract address. + /// @dev EVM selector for this function is: 0xf6b4dfb4, + /// or in textual repr: contractAddress() + function contractAddress() external view returns (address); - // @dev Not implemented - // - // Selector: getApproved(uint256) 081812fc - function getApproved(uint256 tokenId) external view returns (address); + /// Add collection admin by substrate address. + /// @param newAdmin Substrate administrator address. + /// @dev EVM selector for this function is: 0x5730062b, + /// or in textual repr: addCollectionAdminSubstrate(uint256) + function addCollectionAdminSubstrate(uint256 newAdmin) external; - // @dev Not implemented - // - // Selector: isApprovedForAll(address,address) e985e9c5 - function isApprovedForAll(address owner, address operator) - external - view - returns (address); -} + /// Remove collection admin by substrate address. + /// @param admin Substrate administrator address. + /// @dev EVM selector for this function is: 0x4048fcf9, + /// or in textual repr: removeCollectionAdminSubstrate(uint256) + function removeCollectionAdminSubstrate(uint256 admin) external; -// Selector: 5b5e139f -interface ERC721Metadata is Dummy, ERC165 { - // @notice A descriptive name for a collection of NFTs in this contract - // - // Selector: name() 06fdde03 - function name() external view returns (string memory); + /// Add collection admin. + /// @param newAdmin Address of the added administrator. + /// @dev EVM selector for this function is: 0x92e462c7, + /// or in textual repr: addCollectionAdmin(address) + function addCollectionAdmin(address newAdmin) external; - // @notice An abbreviated name for NFTs in this contract - // - // Selector: symbol() 95d89b41 - function symbol() external view returns (string memory); + /// Remove collection admin. + /// + /// @param admin Address of the removed administrator. + /// @dev EVM selector for this function is: 0xfafd7b42, + /// or in textual repr: removeCollectionAdmin(address) + function removeCollectionAdmin(address admin) external; - // @notice A distinct Uniform Resource Identifier (URI) for a given asset. - // - // @dev If the token has a `url` property and it is not empty, it is returned. - // Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. - // If the collection property `baseURI` is empty or absent, return "" (empty string) - // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix - // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). - // - // @return token's const_metadata - // - // Selector: tokenURI(uint256) c87b56dd - function tokenURI(uint256 tokenId) external view returns (string memory); + /// Toggle accessibility of collection nesting. + /// + /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + /// @dev EVM selector for this function is: 0x112d4586, + /// or in textual repr: setCollectionNesting(bool) + function setCollectionNesting(bool enable) external; + + /// Toggle accessibility of collection nesting. + /// + /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + /// @param collections Addresses of collections that will be available for nesting. + /// @dev EVM selector for this function is: 0x64872396, + /// or in textual repr: setCollectionNesting(bool,address[]) + function setCollectionNesting(bool enable, address[] memory collections) + external; + + /// Set the collection access method. + /// @param mode Access mode + /// 0 for Normal + /// 1 for AllowList + /// @dev EVM selector for this function is: 0x41835d4c, + /// or in textual repr: setCollectionAccess(uint8) + function setCollectionAccess(uint8 mode) external; + + /// Add the user to the allowed list. + /// + /// @param user Address of a trusted user. + /// @dev EVM selector for this function is: 0x67844fe6, + /// or in textual repr: addToCollectionAllowList(address) + function addToCollectionAllowList(address user) external; + + /// Remove the user from the allowed list. + /// + /// @param user Address of a removed user. + /// @dev EVM selector for this function is: 0x85c51acb, + /// or in textual repr: removeFromCollectionAllowList(address) + function removeFromCollectionAllowList(address user) external; + + /// Switch permission for minting. + /// + /// @param mode Enable if "true". + /// @dev EVM selector for this function is: 0x00018e84, + /// or in textual repr: setCollectionMintMode(bool) + function setCollectionMintMode(bool mode) external; + + /// Check that account is the owner or admin of the collection + /// + /// @param user account to verify + /// @return "true" if account is the owner or admin + /// @dev EVM selector for this function is: 0x9811b0c7, + /// or in textual repr: isOwnerOrAdmin(address) + function isOwnerOrAdmin(address user) external view returns (bool); + + /// Check that substrate account is the owner or admin of the collection + /// + /// @param user account to verify + /// @return "true" if account is the owner or admin + /// @dev EVM selector for this function is: 0x68910e00, + /// or in textual repr: isOwnerOrAdminSubstrate(uint256) + function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool); + + /// Returns collection type + /// + /// @return `Fungible` or `NFT` or `ReFungible` + /// @dev EVM selector for this function is: 0xd34b55b8, + /// or in textual repr: uniqueCollectionType() + function uniqueCollectionType() external returns (string memory); + + /// Changes collection owner to another account + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner account + /// @dev EVM selector for this function is: 0x13af4035, + /// or in textual repr: setOwner(address) + function setOwner(address newOwner) external; + + /// Changes collection owner to another substrate account + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner substrate account + /// @dev EVM selector for this function is: 0xb212138f, + /// or in textual repr: setOwnerSubstrate(uint256) + function setOwnerSubstrate(uint256 newOwner) external; } -// Selector: 68ccfe89 +/// @title ERC721 Token that can be irreversibly burned (destroyed). +/// @dev the ERC-165 identifier for this interface is 0x42966c68 +interface ERC721Burnable is Dummy, ERC165 { + /// @notice Burns a specific ERC721 token. + /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized + /// operator of the current owner. + /// @param tokenId The NFT to approve + /// @dev EVM selector for this function is: 0x42966c68, + /// or in textual repr: burn(uint256) + function burn(uint256 tokenId) external; +} + +/// @dev inlined interface +interface ERC721MintableEvents { + event MintingFinished(); +} + +/// @title ERC721 minting logic. +/// @dev the ERC-165 identifier for this interface is 0x68ccfe89 interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { - // Selector: mintingFinished() 05d2035b + /// @dev EVM selector for this function is: 0x05d2035b, + /// or in textual repr: mintingFinished() function mintingFinished() external view returns (bool); - // @notice Function to mint token. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted NFT - // - // Selector: mint(address,uint256) 40c10f19 + /// @notice Function to mint token. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted NFT + /// @dev EVM selector for this function is: 0x40c10f19, + /// or in textual repr: mint(address,uint256) function mint(address to, uint256 tokenId) external returns (bool); - // @notice Function to mint token with the given tokenUri. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted NFT - // @param tokenUri Token URI that would be stored in the NFT properties - // - // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f + /// @notice Function to mint token with the given tokenUri. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted NFT + /// @param tokenUri Token URI that would be stored in the NFT properties + /// @dev EVM selector for this function is: 0x50bb4e7f, + /// or in textual repr: mintWithTokenURI(address,uint256,string) function mintWithTokenURI( address to, uint256 tokenId, string memory tokenUri ) external returns (bool); - // @dev Not implemented - // - // Selector: finishMinting() 7d64bcb4 + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x7d64bcb4, + /// or in textual repr: finishMinting() function finishMinting() external returns (bool); } -// Selector: 780e9d63 -interface ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid NFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) - // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) external view returns (uint256); - - // @dev Not implemented - // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - external - view - returns (uint256); - - // @notice Count NFTs tracked by this contract - // @return A count of valid NFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address - // - // Selector: totalSupply() 18160ddd - function totalSupply() external view returns (uint256); -} - -// Selector: d74d154f +/// @title Unique extensions for ERC721. +/// @dev the ERC-165 identifier for this interface is 0xd74d154f interface ERC721UniqueExtensions is Dummy, ERC165 { - // @notice Transfer ownership of an NFT - // @dev Throws unless `msg.sender` is the current owner. Throws if `to` - // is the zero address. Throws if `tokenId` is not a valid NFT. - // @param to The new owner - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT - // - // Selector: transfer(address,uint256) a9059cbb + /// @notice Transfer ownership of an NFT + /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` + /// is the zero address. Throws if `tokenId` is not a valid NFT. + /// @param to The new owner + /// @param tokenId The NFT to transfer + /// @dev EVM selector for this function is: 0xa9059cbb, + /// or in textual repr: transfer(address,uint256) function transfer(address to, uint256 tokenId) external; - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this NFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid NFT. - // @param from The current owner of the NFT - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT - // - // Selector: burnFrom(address,uint256) 79cc6790 + /// @notice Burns a specific ERC721 token. + /// @dev Throws unless `msg.sender` is the current owner or an authorized + /// operator for this NFT. Throws if `from` is not the current owner. Throws + /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT. + /// @param from The current owner of the NFT + /// @param tokenId The NFT to transfer + /// @dev EVM selector for this function is: 0x79cc6790, + /// or in textual repr: burnFrom(address,uint256) function burnFrom(address from, uint256 tokenId) external; - // @notice Returns next free NFT ID. - // - // Selector: nextTokenId() 75794a3c + /// @notice Returns next free NFT ID. + /// @dev EVM selector for this function is: 0x75794a3c, + /// or in textual repr: nextTokenId() function nextTokenId() external view returns (uint256); - // @notice Function to mint multiple tokens. - // @dev `tokenIds` should be an array of consecutive numbers and first number - // should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokenIds IDs of the minted NFTs - // - // Selector: mintBulk(address,uint256[]) 44a9945e + /// @notice Function to mint multiple tokens. + /// @dev `tokenIds` should be an array of consecutive numbers and first number + /// should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokenIds IDs of the minted NFTs + /// @dev EVM selector for this function is: 0x44a9945e, + /// or in textual repr: mintBulk(address,uint256[]) function mintBulk(address to, uint256[] memory tokenIds) external returns (bool); - // @notice Function to mint multiple tokens with the given tokenUris. - // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // numbers and first number should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokens array of pairs of token ID and token URI for minted tokens - // - // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 - function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + /// @notice Function to mint multiple tokens with the given tokenUris. + /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + /// numbers and first number should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokens array of pairs of token ID and token URI for minted tokens + /// @dev EVM selector for this function is: 0x36543006, + /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) + function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) external returns (bool); } -// Selector: ffe4da23 -interface Collection is Dummy, ERC165 { - // Set collection property. - // - // @param key Property key. - // @param value Propery value. - // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - external; +/// @dev anonymous struct +struct Tuple8 { + uint256 field_0; + string field_1; +} - // Delete collection property. - // - // @param key Property key. - // - // Selector: deleteCollectionProperty(string) 7b7debce - function deleteCollectionProperty(string memory key) external; +/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension +/// @dev See https://eips.ethereum.org/EIPS/eip-721 +/// @dev the ERC-165 identifier for this interface is 0x780e9d63 +interface ERC721Enumerable is Dummy, ERC165 { + /// @notice Enumerate valid NFTs + /// @param index A counter less than `totalSupply()` + /// @return The token identifier for the `index`th NFT, + /// (sort order not specified) + /// @dev EVM selector for this function is: 0x4f6ccce7, + /// or in textual repr: tokenByIndex(uint256) + function tokenByIndex(uint256 index) external view returns (uint256); - // Get collection property. - // - // @dev Throws error if key not found. - // - // @param key Property key. - // @return bytes The property corresponding to the key. - // - // Selector: collectionProperty(string) cf24fd6d - function collectionProperty(string memory key) + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x2f745c59, + /// or in textual repr: tokenOfOwnerByIndex(address,uint256) + function tokenOfOwnerByIndex(address owner, uint256 index) external view - returns (bytes memory); - - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) external; - - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,bool) 993b7fba - function setCollectionLimit(string memory limit, bool value) external; - - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 - function contractAddress() external view returns (address); - - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. - // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) external; + returns (uint256); - // Remove collection admin by substrate address. - // @param admin Substrate administrator address. - // - // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 - function removeCollectionAdminSubstrate(uint256 admin) external; + /// @notice Count NFTs tracked by this contract + /// @return A count of valid NFTs tracked by this contract, where each one of + /// them has an assigned and queryable owner not equal to the zero address + /// @dev EVM selector for this function is: 0x18160ddd, + /// or in textual repr: totalSupply() + function totalSupply() external view returns (uint256); +} - // Add collection admin. - // @param new_admin Address of the added administrator. - // - // Selector: addCollectionAdmin(address) 92e462c7 - function addCollectionAdmin(address newAdmin) external; +/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension +/// @dev See https://eips.ethereum.org/EIPS/eip-721 +/// @dev the ERC-165 identifier for this interface is 0x5b5e139f +interface ERC721Metadata is Dummy, ERC165 { + /// @notice A descriptive name for a collection of NFTs in this contract + /// @dev EVM selector for this function is: 0x06fdde03, + /// or in textual repr: name() + function name() external view returns (string memory); - // Remove collection admin. - // - // @param new_admin Address of the removed administrator. - // - // Selector: removeCollectionAdmin(address) fafd7b42 - function removeCollectionAdmin(address admin) external; + /// @notice An abbreviated name for NFTs in this contract + /// @dev EVM selector for this function is: 0x95d89b41, + /// or in textual repr: symbol() + function symbol() external view returns (string memory); - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' - // - // Selector: setCollectionNesting(bool) 112d4586 - function setCollectionNesting(bool enable) external; + /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. + /// + /// @dev If the token has a `url` property and it is not empty, it is returned. + /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + /// If the collection property `baseURI` is empty or absent, return "" (empty string) + /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). + /// + /// @return token's const_metadata + /// @dev EVM selector for this function is: 0xc87b56dd, + /// or in textual repr: tokenURI(uint256) + function tokenURI(uint256 tokenId) external view returns (string memory); +} - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' - // @param collections Addresses of collections that will be available for nesting. - // - // Selector: setCollectionNesting(bool,address[]) 64872396 - function setCollectionNesting(bool enable, address[] memory collections) - external; +/// @dev inlined interface +interface ERC721Events { + event Transfer( + address indexed from, + address indexed to, + uint256 indexed tokenId + ); + event Approval( + address indexed owner, + address indexed approved, + uint256 indexed tokenId + ); + event ApprovalForAll( + address indexed owner, + address indexed operator, + bool approved + ); +} - // Set the collection access method. - // @param mode Access mode - // 0 for Normal - // 1 for AllowList - // - // Selector: setCollectionAccess(uint8) 41835d4c - function setCollectionAccess(uint8 mode) external; +/// @title ERC-721 Non-Fungible Token Standard +/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md +/// @dev the ERC-165 identifier for this interface is 0x80ac58cd +interface ERC721 is Dummy, ERC165, ERC721Events { + /// @notice Count all NFTs assigned to an owner + /// @dev NFTs assigned to the zero address are considered invalid, and this + /// function throws for queries about the zero address. + /// @param owner An address for whom to query the balance + /// @return The number of NFTs owned by `owner`, possibly zero + /// @dev EVM selector for this function is: 0x70a08231, + /// or in textual repr: balanceOf(address) + function balanceOf(address owner) external view returns (uint256); - // Add the user to the allowed list. - // - // @param user Address of a trusted user. - // - // Selector: addToCollectionAllowList(address) 67844fe6 - function addToCollectionAllowList(address user) external; + /// @notice Find the owner of an NFT + /// @dev NFTs assigned to zero address are considered invalid, and queries + /// about them do throw. + /// @param tokenId The identifier for an NFT + /// @return The address of the owner of the NFT + /// @dev EVM selector for this function is: 0x6352211e, + /// or in textual repr: ownerOf(uint256) + function ownerOf(uint256 tokenId) external view returns (address); - // Remove the user from the allowed list. - // - // @param user Address of a removed user. - // - // Selector: removeFromCollectionAllowList(address) 85c51acb - function removeFromCollectionAllowList(address user) external; + /// @dev Not implemented + /// @dev EVM selector for this function is: 0xb88d4fde, + /// or in textual repr: safeTransferFrom(address,address,uint256,bytes) + function safeTransferFrom( + address from, + address to, + uint256 tokenId, + bytes memory data + ) external; - // Switch permission for minting. - // - // @param mode Enable if "true". - // - // Selector: setCollectionMintMode(bool) 00018e84 - function setCollectionMintMode(bool mode) external; + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x42842e0e, + /// or in textual repr: safeTransferFrom(address,address,uint256) + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) external; - // Check that account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdmin(address) 9811b0c7 - function isOwnerOrAdmin(address user) external view returns (bool); + /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE + /// TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + /// THEY MAY BE PERMANENTLY LOST + /// @dev Throws unless `msg.sender` is the current owner or an authorized + /// operator for this NFT. Throws if `from` is not the current owner. Throws + /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT. + /// @param from The current owner of the NFT + /// @param to The new owner + /// @param tokenId The NFT to transfer + /// @dev EVM selector for this function is: 0x23b872dd, + /// or in textual repr: transferFrom(address,address,uint256) + function transferFrom( + address from, + address to, + uint256 tokenId + ) external; - // Check that substrate account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00 - function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool); + /// @notice Set or reaffirm the approved address for an NFT + /// @dev The zero address indicates there is no approved address. + /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized + /// operator of the current owner. + /// @param approved The new approved NFT controller + /// @param tokenId The NFT to approve + /// @dev EVM selector for this function is: 0x095ea7b3, + /// or in textual repr: approve(address,uint256) + function approve(address approved, uint256 tokenId) external; - // Returns collection type - // - // @return `Fungible` or `NFT` or `ReFungible` - // - // Selector: uniqueCollectionType() d34b55b8 - function uniqueCollectionType() external returns (string memory); + /// @dev Not implemented + /// @dev EVM selector for this function is: 0xa22cb465, + /// or in textual repr: setApprovalForAll(address,bool) + function setApprovalForAll(address operator, bool approved) external; - // Changes collection owner to another account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner account - // - // Selector: setOwner(address) 13af4035 - function setOwner(address newOwner) external; + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x081812fc, + /// or in textual repr: getApproved(uint256) + function getApproved(uint256 tokenId) external view returns (address); - // Changes collection owner to another substrate account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner substrate account - // - // Selector: setOwnerSubstrate(uint256) b212138f - function setOwnerSubstrate(uint256 newOwner) external; + /// @dev Not implemented + /// @dev EVM selector for this function is: 0xe985e9c5, + /// or in textual repr: isApprovedForAll(address,address) + function isApprovedForAll(address owner, address operator) + external + view + returns (address); } interface UniqueNFT is diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index 7af76dc250..2c17d5571a 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -3,13 +3,7 @@ pragma solidity >=0.8.0 <0.9.0; -// Anonymous struct -struct Tuple0 { - uint256 field_0; - string field_1; -} - -// Common stubs holder +/// @dev common stubs holder interface Dummy { } @@ -18,40 +12,17 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } -// Inline -interface ERC721Events { - event Transfer( - address indexed from, - address indexed to, - uint256 indexed tokenId - ); - event Approval( - address indexed owner, - address indexed approved, - uint256 indexed tokenId - ); - event ApprovalForAll( - address indexed owner, - address indexed operator, - bool approved - ); -} - -// Inline -interface ERC721MintableEvents { - event MintingFinished(); -} - -// Selector: 41369377 +/// @title A contract that allows to set and delete token properties and change token property permissions. +/// @dev the ERC-165 identifier for this interface is 0x41369377 interface TokenProperties is Dummy, ERC165 { - // @notice Set permissions for token property. - // @dev Throws error if `msg.sender` is not admin or owner of the collection. - // @param key Property key. - // @param is_mutable Permission to mutate property. - // @param collection_admin Permission to mutate property by collection admin if property is mutable. - // @param token_owner Permission to mutate property by token owner if property is mutable. - // - // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa + /// @notice Set permissions for token property. + /// @dev Throws error if `msg.sender` is not admin or owner of the collection. + /// @param key Property key. + /// @param isMutable Permission to mutate property. + /// @param collectionAdmin Permission to mutate property by collection admin if property is mutable. + /// @param tokenOwner Permission to mutate property by token owner if property is mutable. + /// @dev EVM selector for this function is: 0x222d97fa, + /// or in textual repr: setTokenPropertyPermission(string,bool,bool,bool) function setTokenPropertyPermission( string memory key, bool isMutable, @@ -59,469 +30,505 @@ interface TokenProperties is Dummy, ERC165 { bool tokenOwner ) external; - // @notice Set token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. - // @param key Property key. - // @param value Property value. - // - // Selector: setProperty(uint256,string,bytes) 1752d67b + /// @notice Set token property value. + /// @dev Throws error if `msg.sender` has no permission to edit the property. + /// @param tokenId ID of the token. + /// @param key Property key. + /// @param value Property value. + /// @dev EVM selector for this function is: 0x1752d67b, + /// or in textual repr: setProperty(uint256,string,bytes) function setProperty( uint256 tokenId, string memory key, bytes memory value ) external; - // @notice Delete token property value. - // @dev Throws error if `msg.sender` has no permission to edit the property. - // @param tokenId ID of the token. - // @param key Property key. - // - // Selector: deleteProperty(uint256,string) 066111d1 + /// @notice Delete token property value. + /// @dev Throws error if `msg.sender` has no permission to edit the property. + /// @param tokenId ID of the token. + /// @param key Property key. + /// @dev EVM selector for this function is: 0x066111d1, + /// or in textual repr: deleteProperty(uint256,string) function deleteProperty(uint256 tokenId, string memory key) external; - // @notice Get token property value. - // @dev Throws error if key not found - // @param tokenId ID of the token. - // @param key Property key. - // @return Property value bytes - // - // Selector: property(uint256,string) 7228c327 + /// @notice Get token property value. + /// @dev Throws error if key not found + /// @param tokenId ID of the token. + /// @param key Property key. + /// @return Property value bytes + /// @dev EVM selector for this function is: 0x7228c327, + /// or in textual repr: property(uint256,string) function property(uint256 tokenId, string memory key) external view returns (bytes memory); } -// Selector: 42966c68 -interface ERC721Burnable is Dummy, ERC165 { - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current RFT owner, or an authorized - // operator of the current owner. - // @param tokenId The RFT to approve - // - // Selector: burn(uint256) 42966c68 - function burn(uint256 tokenId) external; -} +/// @title A contract that allows you to work with collections. +/// @dev the ERC-165 identifier for this interface is 0xffe4da23 +interface Collection is Dummy, ERC165 { + /// Set collection property. + /// + /// @param key Property key. + /// @param value Propery value. + /// @dev EVM selector for this function is: 0x2f073f66, + /// or in textual repr: setCollectionProperty(string,bytes) + function setCollectionProperty(string memory key, bytes memory value) + external; -// Selector: 58800161 -interface ERC721 is Dummy, ERC165, ERC721Events { - // @notice Count all RFTs assigned to an owner - // @dev RFTs assigned to the zero address are considered invalid, and this - // function throws for queries about the zero address. - // @param owner An address for whom to query the balance - // @return The number of RFTs owned by `owner`, possibly zero - // - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) external view returns (uint256); + /// Delete collection property. + /// + /// @param key Property key. + /// @dev EVM selector for this function is: 0x7b7debce, + /// or in textual repr: deleteCollectionProperty(string) + function deleteCollectionProperty(string memory key) external; - // @notice Find the owner of an RFT - // @dev RFTs assigned to zero address are considered invalid, and queries - // about them do throw. - // Returns special 0xffffffffffffffffffffffffffffffffffffffff address for - // the tokens that are partially owned. - // @param tokenId The identifier for an RFT - // @return The address of the owner of the RFT - // - // Selector: ownerOf(uint256) 6352211e - function ownerOf(uint256 tokenId) external view returns (address); + /// Get collection property. + /// + /// @dev Throws error if key not found. + /// + /// @param key Property key. + /// @return bytes The property corresponding to the key. + /// @dev EVM selector for this function is: 0xcf24fd6d, + /// or in textual repr: collectionProperty(string) + function collectionProperty(string memory key) + external + view + returns (bytes memory); - // @dev Not implemented - // - // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672 - function safeTransferFromWithData( - address from, - address to, - uint256 tokenId, - bytes memory data - ) external; + /// Set the sponsor of the collection. + /// + /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + /// + /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + /// @dev EVM selector for this function is: 0x7623402e, + /// or in textual repr: setCollectionSponsor(address) + function setCollectionSponsor(address sponsor) external; - // @dev Not implemented - // - // Selector: safeTransferFrom(address,address,uint256) 42842e0e - function safeTransferFrom( - address from, - address to, - uint256 tokenId - ) external; + /// Collection sponsorship confirmation. + /// + /// @dev After setting the sponsor for the collection, it must be confirmed with this function. + /// @dev EVM selector for this function is: 0x3c50e97a, + /// or in textual repr: confirmCollectionSponsorship() + function confirmCollectionSponsorship() external; - // @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE - // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE - // THEY MAY BE PERMANENTLY LOST - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this RFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param from The current owner of the NFT - // @param to The new owner - // @param tokenId The NFT to transfer - // @param _value Not used for an NFT - // - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 tokenId - ) external; + /// Set limits for the collection. + /// @dev Throws error if limit not found. + /// @param limit Name of the limit. Valid names: + /// "accountTokenOwnershipLimit", + /// "sponsoredDataSize", + /// "sponsoredDataRateLimit", + /// "tokenLimit", + /// "sponsorTransferTimeout", + /// "sponsorApproveTimeout" + /// @param value Value of the limit. + /// @dev EVM selector for this function is: 0x6a3841db, + /// or in textual repr: setCollectionLimit(string,uint32) + function setCollectionLimit(string memory limit, uint32 value) external; - // @dev Not implemented - // - // Selector: approve(address,uint256) 095ea7b3 - function approve(address approved, uint256 tokenId) external; + /// Set limits for the collection. + /// @dev Throws error if limit not found. + /// @param limit Name of the limit. Valid names: + /// "ownerCanTransfer", + /// "ownerCanDestroy", + /// "transfersEnabled" + /// @param value Value of the limit. + /// @dev EVM selector for this function is: 0x993b7fba, + /// or in textual repr: setCollectionLimit(string,bool) + function setCollectionLimit(string memory limit, bool value) external; - // @dev Not implemented - // - // Selector: setApprovalForAll(address,bool) a22cb465 - function setApprovalForAll(address operator, bool approved) external; + /// Get contract address. + /// @dev EVM selector for this function is: 0xf6b4dfb4, + /// or in textual repr: contractAddress() + function contractAddress() external view returns (address); - // @dev Not implemented - // - // Selector: getApproved(uint256) 081812fc - function getApproved(uint256 tokenId) external view returns (address); + /// Add collection admin by substrate address. + /// @param newAdmin Substrate administrator address. + /// @dev EVM selector for this function is: 0x5730062b, + /// or in textual repr: addCollectionAdminSubstrate(uint256) + function addCollectionAdminSubstrate(uint256 newAdmin) external; - // @dev Not implemented - // - // Selector: isApprovedForAll(address,address) e985e9c5 - function isApprovedForAll(address owner, address operator) - external - view - returns (address); -} + /// Remove collection admin by substrate address. + /// @param admin Substrate administrator address. + /// @dev EVM selector for this function is: 0x4048fcf9, + /// or in textual repr: removeCollectionAdminSubstrate(uint256) + function removeCollectionAdminSubstrate(uint256 admin) external; -// Selector: 5b5e139f -interface ERC721Metadata is Dummy, ERC165 { - // @notice A descriptive name for a collection of RFTs in this contract - // - // Selector: name() 06fdde03 - function name() external view returns (string memory); + /// Add collection admin. + /// @param newAdmin Address of the added administrator. + /// @dev EVM selector for this function is: 0x92e462c7, + /// or in textual repr: addCollectionAdmin(address) + function addCollectionAdmin(address newAdmin) external; - // @notice An abbreviated name for RFTs in this contract - // - // Selector: symbol() 95d89b41 - function symbol() external view returns (string memory); + /// Remove collection admin. + /// + /// @param admin Address of the removed administrator. + /// @dev EVM selector for this function is: 0xfafd7b42, + /// or in textual repr: removeCollectionAdmin(address) + function removeCollectionAdmin(address admin) external; - // @notice A distinct Uniform Resource Identifier (URI) for a given asset. - // - // @dev If the token has a `url` property and it is not empty, it is returned. - // Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. - // If the collection property `baseURI` is empty or absent, return "" (empty string) - // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix - // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). - // - // @return token's const_metadata - // - // Selector: tokenURI(uint256) c87b56dd - function tokenURI(uint256 tokenId) external view returns (string memory); + /// Toggle accessibility of collection nesting. + /// + /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' + /// @dev EVM selector for this function is: 0x112d4586, + /// or in textual repr: setCollectionNesting(bool) + function setCollectionNesting(bool enable) external; + + /// Toggle accessibility of collection nesting. + /// + /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' + /// @param collections Addresses of collections that will be available for nesting. + /// @dev EVM selector for this function is: 0x64872396, + /// or in textual repr: setCollectionNesting(bool,address[]) + function setCollectionNesting(bool enable, address[] memory collections) + external; + + /// Set the collection access method. + /// @param mode Access mode + /// 0 for Normal + /// 1 for AllowList + /// @dev EVM selector for this function is: 0x41835d4c, + /// or in textual repr: setCollectionAccess(uint8) + function setCollectionAccess(uint8 mode) external; + + /// Add the user to the allowed list. + /// + /// @param user Address of a trusted user. + /// @dev EVM selector for this function is: 0x67844fe6, + /// or in textual repr: addToCollectionAllowList(address) + function addToCollectionAllowList(address user) external; + + /// Remove the user from the allowed list. + /// + /// @param user Address of a removed user. + /// @dev EVM selector for this function is: 0x85c51acb, + /// or in textual repr: removeFromCollectionAllowList(address) + function removeFromCollectionAllowList(address user) external; + + /// Switch permission for minting. + /// + /// @param mode Enable if "true". + /// @dev EVM selector for this function is: 0x00018e84, + /// or in textual repr: setCollectionMintMode(bool) + function setCollectionMintMode(bool mode) external; + + /// Check that account is the owner or admin of the collection + /// + /// @param user account to verify + /// @return "true" if account is the owner or admin + /// @dev EVM selector for this function is: 0x9811b0c7, + /// or in textual repr: isOwnerOrAdmin(address) + function isOwnerOrAdmin(address user) external view returns (bool); + + /// Check that substrate account is the owner or admin of the collection + /// + /// @param user account to verify + /// @return "true" if account is the owner or admin + /// @dev EVM selector for this function is: 0x68910e00, + /// or in textual repr: isOwnerOrAdminSubstrate(uint256) + function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool); + + /// Returns collection type + /// + /// @return `Fungible` or `NFT` or `ReFungible` + /// @dev EVM selector for this function is: 0xd34b55b8, + /// or in textual repr: uniqueCollectionType() + function uniqueCollectionType() external returns (string memory); + + /// Changes collection owner to another account + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner account + /// @dev EVM selector for this function is: 0x13af4035, + /// or in textual repr: setOwner(address) + function setOwner(address newOwner) external; + + /// Changes collection owner to another substrate account + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner substrate account + /// @dev EVM selector for this function is: 0xb212138f, + /// or in textual repr: setOwnerSubstrate(uint256) + function setOwnerSubstrate(uint256 newOwner) external; +} + +/// @title ERC721 Token that can be irreversibly burned (destroyed). +/// @dev the ERC-165 identifier for this interface is 0x42966c68 +interface ERC721Burnable is Dummy, ERC165 { + /// @notice Burns a specific ERC721 token. + /// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized + /// operator of the current owner. + /// @param tokenId The RFT to approve + /// @dev EVM selector for this function is: 0x42966c68, + /// or in textual repr: burn(uint256) + function burn(uint256 tokenId) external; +} + +/// @dev inlined interface +interface ERC721MintableEvents { + event MintingFinished(); } -// Selector: 68ccfe89 +/// @title ERC721 minting logic. +/// @dev the ERC-165 identifier for this interface is 0x68ccfe89 interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { - // Selector: mintingFinished() 05d2035b + /// @dev EVM selector for this function is: 0x05d2035b, + /// or in textual repr: mintingFinished() function mintingFinished() external view returns (bool); - // @notice Function to mint token. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted RFT - // - // Selector: mint(address,uint256) 40c10f19 + /// @notice Function to mint token. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted RFT + /// @dev EVM selector for this function is: 0x40c10f19, + /// or in textual repr: mint(address,uint256) function mint(address to, uint256 tokenId) external returns (bool); - // @notice Function to mint token with the given tokenUri. - // @dev `tokenId` should be obtained with `nextTokenId` method, - // unlike standard, you can't specify it manually - // @param to The new owner - // @param tokenId ID of the minted RFT - // @param tokenUri Token URI that would be stored in the RFT properties - // - // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f + /// @notice Function to mint token with the given tokenUri. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted RFT + /// @param tokenUri Token URI that would be stored in the RFT properties + /// @dev EVM selector for this function is: 0x50bb4e7f, + /// or in textual repr: mintWithTokenURI(address,uint256,string) function mintWithTokenURI( address to, uint256 tokenId, string memory tokenUri ) external returns (bool); - // @dev Not implemented - // - // Selector: finishMinting() 7d64bcb4 + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x7d64bcb4, + /// or in textual repr: finishMinting() function finishMinting() external returns (bool); } -// Selector: 780e9d63 -interface ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid RFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) - // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) external view returns (uint256); - - // Not implemented - // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - external - view - returns (uint256); - - // @notice Count RFTs tracked by this contract - // @return A count of valid RFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address - // - // Selector: totalSupply() 18160ddd - function totalSupply() external view returns (uint256); -} - -// Selector: 7c3bef89 +/// @title Unique extensions for ERC721. +/// @dev the ERC-165 identifier for this interface is 0x7c3bef89 interface ERC721UniqueExtensions is Dummy, ERC165 { - // @notice Transfer ownership of an RFT - // @dev Throws unless `msg.sender` is the current owner. Throws if `to` - // is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param to The new owner - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT - // - // Selector: transfer(address,uint256) a9059cbb + /// @notice Transfer ownership of an RFT + /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` + /// is the zero address. Throws if `tokenId` is not a valid RFT. + /// Throws if RFT pieces have multiple owners. + /// @param to The new owner + /// @param tokenId The RFT to transfer + /// @dev EVM selector for this function is: 0xa9059cbb, + /// or in textual repr: transfer(address,uint256) function transfer(address to, uint256 tokenId) external; - // @notice Burns a specific ERC721 token. - // @dev Throws unless `msg.sender` is the current owner or an authorized - // operator for this RFT. Throws if `from` is not the current owner. Throws - // if `to` is the zero address. Throws if `tokenId` is not a valid RFT. - // Throws if RFT pieces have multiple owners. - // @param from The current owner of the RFT - // @param tokenId The RFT to transfer - // @param _value Not used for an RFT - // - // Selector: burnFrom(address,uint256) 79cc6790 + /// @notice Burns a specific ERC721 token. + /// @dev Throws unless `msg.sender` is the current owner or an authorized + /// operator for this RFT. Throws if `from` is not the current owner. Throws + /// if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + /// Throws if RFT pieces have multiple owners. + /// @param from The current owner of the RFT + /// @param tokenId The RFT to transfer + /// @dev EVM selector for this function is: 0x79cc6790, + /// or in textual repr: burnFrom(address,uint256) function burnFrom(address from, uint256 tokenId) external; - // @notice Returns next free RFT ID. - // - // Selector: nextTokenId() 75794a3c + /// @notice Returns next free RFT ID. + /// @dev EVM selector for this function is: 0x75794a3c, + /// or in textual repr: nextTokenId() function nextTokenId() external view returns (uint256); - // @notice Function to mint multiple tokens. - // @dev `tokenIds` should be an array of consecutive numbers and first number - // should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokenIds IDs of the minted RFTs - // - // Selector: mintBulk(address,uint256[]) 44a9945e + /// @notice Function to mint multiple tokens. + /// @dev `tokenIds` should be an array of consecutive numbers and first number + /// should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokenIds IDs of the minted RFTs + /// @dev EVM selector for this function is: 0x44a9945e, + /// or in textual repr: mintBulk(address,uint256[]) function mintBulk(address to, uint256[] memory tokenIds) external returns (bool); - // @notice Function to mint multiple tokens with the given tokenUris. - // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // numbers and first number should be obtained with `nextTokenId` method - // @param to The new owner - // @param tokens array of pairs of token ID and token URI for minted tokens - // - // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006 - function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + /// @notice Function to mint multiple tokens with the given tokenUris. + /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + /// numbers and first number should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokens array of pairs of token ID and token URI for minted tokens + /// @dev EVM selector for this function is: 0x36543006, + /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) + function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) external returns (bool); - // Returns EVM address for refungible token - // - // @param token ID of the token - // - // Selector: tokenContractAddress(uint256) ab76fac6 + /// Returns EVM address for refungible token + /// + /// @param token ID of the token + /// @dev EVM selector for this function is: 0xab76fac6, + /// or in textual repr: tokenContractAddress(uint256) function tokenContractAddress(uint256 token) external view returns (address); } -// Selector: ffe4da23 -interface Collection is Dummy, ERC165 { - // Set collection property. - // - // @param key Property key. - // @param value Propery value. - // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - external; +/// @dev anonymous struct +struct Tuple8 { + uint256 field_0; + string field_1; +} - // Delete collection property. - // - // @param key Property key. - // - // Selector: deleteCollectionProperty(string) 7b7debce - function deleteCollectionProperty(string memory key) external; +/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension +/// @dev See https://eips.ethereum.org/EIPS/eip-721 +/// @dev the ERC-165 identifier for this interface is 0x780e9d63 +interface ERC721Enumerable is Dummy, ERC165 { + /// @notice Enumerate valid RFTs + /// @param index A counter less than `totalSupply()` + /// @return The token identifier for the `index`th NFT, + /// (sort order not specified) + /// @dev EVM selector for this function is: 0x4f6ccce7, + /// or in textual repr: tokenByIndex(uint256) + function tokenByIndex(uint256 index) external view returns (uint256); - // Get collection property. - // - // @dev Throws error if key not found. - // - // @param key Property key. - // @return bytes The property corresponding to the key. - // - // Selector: collectionProperty(string) cf24fd6d - function collectionProperty(string memory key) + /// Not implemented + /// @dev EVM selector for this function is: 0x2f745c59, + /// or in textual repr: tokenOfOwnerByIndex(address,uint256) + function tokenOfOwnerByIndex(address owner, uint256 index) external view - returns (bytes memory); - - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) external; - - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,bool) 993b7fba - function setCollectionLimit(string memory limit, bool value) external; - - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 - function contractAddress() external view returns (address); - - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. - // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) external; + returns (uint256); - // Remove collection admin by substrate address. - // @param admin Substrate administrator address. - // - // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 - function removeCollectionAdminSubstrate(uint256 admin) external; + /// @notice Count RFTs tracked by this contract + /// @return A count of valid RFTs tracked by this contract, where each one of + /// them has an assigned and queryable owner not equal to the zero address + /// @dev EVM selector for this function is: 0x18160ddd, + /// or in textual repr: totalSupply() + function totalSupply() external view returns (uint256); +} - // Add collection admin. - // @param new_admin Address of the added administrator. - // - // Selector: addCollectionAdmin(address) 92e462c7 - function addCollectionAdmin(address newAdmin) external; +/// @dev the ERC-165 identifier for this interface is 0x5b5e139f +interface ERC721Metadata is Dummy, ERC165 { + /// @notice A descriptive name for a collection of RFTs in this contract + /// @dev EVM selector for this function is: 0x06fdde03, + /// or in textual repr: name() + function name() external view returns (string memory); - // Remove collection admin. - // - // @param new_admin Address of the removed administrator. - // - // Selector: removeCollectionAdmin(address) fafd7b42 - function removeCollectionAdmin(address admin) external; + /// @notice An abbreviated name for RFTs in this contract + /// @dev EVM selector for this function is: 0x95d89b41, + /// or in textual repr: symbol() + function symbol() external view returns (string memory); - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' - // - // Selector: setCollectionNesting(bool) 112d4586 - function setCollectionNesting(bool enable) external; + /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. + /// + /// @dev If the token has a `url` property and it is not empty, it is returned. + /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + /// If the collection property `baseURI` is empty or absent, return "" (empty string) + /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). + /// + /// @return token's const_metadata + /// @dev EVM selector for this function is: 0xc87b56dd, + /// or in textual repr: tokenURI(uint256) + function tokenURI(uint256 tokenId) external view returns (string memory); +} - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' - // @param collections Addresses of collections that will be available for nesting. - // - // Selector: setCollectionNesting(bool,address[]) 64872396 - function setCollectionNesting(bool enable, address[] memory collections) - external; +/// @dev inlined interface +interface ERC721Events { + event Transfer( + address indexed from, + address indexed to, + uint256 indexed tokenId + ); + event Approval( + address indexed owner, + address indexed approved, + uint256 indexed tokenId + ); + event ApprovalForAll( + address indexed owner, + address indexed operator, + bool approved + ); +} - // Set the collection access method. - // @param mode Access mode - // 0 for Normal - // 1 for AllowList - // - // Selector: setCollectionAccess(uint8) 41835d4c - function setCollectionAccess(uint8 mode) external; +/// @title ERC-721 Non-Fungible Token Standard +/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md +/// @dev the ERC-165 identifier for this interface is 0x58800161 +interface ERC721 is Dummy, ERC165, ERC721Events { + /// @notice Count all RFTs assigned to an owner + /// @dev RFTs assigned to the zero address are considered invalid, and this + /// function throws for queries about the zero address. + /// @param owner An address for whom to query the balance + /// @return The number of RFTs owned by `owner`, possibly zero + /// @dev EVM selector for this function is: 0x70a08231, + /// or in textual repr: balanceOf(address) + function balanceOf(address owner) external view returns (uint256); - // Add the user to the allowed list. - // - // @param user Address of a trusted user. - // - // Selector: addToCollectionAllowList(address) 67844fe6 - function addToCollectionAllowList(address user) external; + /// @notice Find the owner of an RFT + /// @dev RFTs assigned to zero address are considered invalid, and queries + /// about them do throw. + /// Returns special 0xffffffffffffffffffffffffffffffffffffffff address for + /// the tokens that are partially owned. + /// @param tokenId The identifier for an RFT + /// @return The address of the owner of the RFT + /// @dev EVM selector for this function is: 0x6352211e, + /// or in textual repr: ownerOf(uint256) + function ownerOf(uint256 tokenId) external view returns (address); - // Remove the user from the allowed list. - // - // @param user Address of a removed user. - // - // Selector: removeFromCollectionAllowList(address) 85c51acb - function removeFromCollectionAllowList(address user) external; + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x60a11672, + /// or in textual repr: safeTransferFromWithData(address,address,uint256,bytes) + function safeTransferFromWithData( + address from, + address to, + uint256 tokenId, + bytes memory data + ) external; - // Switch permission for minting. - // - // @param mode Enable if "true". - // - // Selector: setCollectionMintMode(bool) 00018e84 - function setCollectionMintMode(bool mode) external; + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x42842e0e, + /// or in textual repr: safeTransferFrom(address,address,uint256) + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) external; - // Check that account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdmin(address) 9811b0c7 - function isOwnerOrAdmin(address user) external view returns (bool); + /// @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE + /// TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + /// THEY MAY BE PERMANENTLY LOST + /// @dev Throws unless `msg.sender` is the current owner or an authorized + /// operator for this RFT. Throws if `from` is not the current owner. Throws + /// if `to` is the zero address. Throws if `tokenId` is not a valid RFT. + /// Throws if RFT pieces have multiple owners. + /// @param from The current owner of the NFT + /// @param to The new owner + /// @param tokenId The NFT to transfer + /// @dev EVM selector for this function is: 0x23b872dd, + /// or in textual repr: transferFrom(address,address,uint256) + function transferFrom( + address from, + address to, + uint256 tokenId + ) external; - // Check that substrate account is the owner or admin of the collection - // - // @param user account to verify - // @return "true" if account is the owner or admin - // - // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00 - function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool); + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x095ea7b3, + /// or in textual repr: approve(address,uint256) + function approve(address approved, uint256 tokenId) external; - // Returns collection type - // - // @return `Fungible` or `NFT` or `ReFungible` - // - // Selector: uniqueCollectionType() d34b55b8 - function uniqueCollectionType() external returns (string memory); + /// @dev Not implemented + /// @dev EVM selector for this function is: 0xa22cb465, + /// or in textual repr: setApprovalForAll(address,bool) + function setApprovalForAll(address operator, bool approved) external; - // Changes collection owner to another account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner account - // - // Selector: setOwner(address) 13af4035 - function setOwner(address newOwner) external; + /// @dev Not implemented + /// @dev EVM selector for this function is: 0x081812fc, + /// or in textual repr: getApproved(uint256) + function getApproved(uint256 tokenId) external view returns (address); - // Changes collection owner to another substrate account - // - // @dev Owner can be changed only by current owner - // @param newOwner new owner substrate account - // - // Selector: setOwnerSubstrate(uint256) b212138f - function setOwnerSubstrate(uint256 newOwner) external; + /// @dev Not implemented + /// @dev EVM selector for this function is: 0xe985e9c5, + /// or in textual repr: isApprovedForAll(address,address) + function isApprovedForAll(address owner, address operator) + external + view + returns (address); } interface UniqueRefungible is diff --git a/tests/src/eth/api/UniqueRefungibleToken.sol b/tests/src/eth/api/UniqueRefungibleToken.sol index 13373419e2..5209775588 100644 --- a/tests/src/eth/api/UniqueRefungibleToken.sol +++ b/tests/src/eth/api/UniqueRefungibleToken.sol @@ -3,7 +3,7 @@ pragma solidity >=0.8.0 <0.9.0; -// Common stubs holder +/// @dev common stubs holder interface Dummy { } @@ -12,122 +12,129 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } -// Inline -interface ERC20Events { - event Transfer(address indexed from, address indexed to, uint256 value); - event Approval( - address indexed owner, - address indexed spender, - uint256 value - ); -} - -// Selector: 042f1106 +/// @dev the ERC-165 identifier for this interface is 0x042f1106 interface ERC1633UniqueExtensions is Dummy, ERC165 { - // Selector: setParentNFT(address,uint256) 042f1106 + /// @dev EVM selector for this function is: 0x042f1106, + /// or in textual repr: setParentNFT(address,uint256) function setParentNFT(address collection, uint256 nftId) external returns (bool); } -// Selector: 5755c3f2 +/// @dev the ERC-165 identifier for this interface is 0x5755c3f2 interface ERC1633 is Dummy, ERC165 { - // Selector: parentToken() 80a54001 + /// @dev EVM selector for this function is: 0x80a54001, + /// or in textual repr: parentToken() function parentToken() external view returns (address); - // Selector: parentTokenId() d7f083f3 + /// @dev EVM selector for this function is: 0xd7f083f3, + /// or in textual repr: parentTokenId() function parentTokenId() external view returns (uint256); } -// Selector: 942e8b22 +/// @dev the ERC-165 identifier for this interface is 0xab8deb37 +interface ERC20UniqueExtensions is Dummy, ERC165 { + /// @dev Function that burns an amount of the token of a given account, + /// deducting from the sender's allowance for said account. + /// @param from The account whose tokens will be burnt. + /// @param amount The amount that will be burnt. + /// @dev EVM selector for this function is: 0x79cc6790, + /// or in textual repr: burnFrom(address,uint256) + function burnFrom(address from, uint256 amount) external returns (bool); + + /// @dev Function that changes total amount of the tokens. + /// Throws if `msg.sender` doesn't owns all of the tokens. + /// @param amount New total amount of the tokens. + /// @dev EVM selector for this function is: 0xd2418ca7, + /// or in textual repr: repartition(uint256) + function repartition(uint256 amount) external returns (bool); +} + +/// @dev inlined interface +interface ERC20Events { + event Transfer(address indexed from, address indexed to, uint256 value); + event Approval( + address indexed owner, + address indexed spender, + uint256 value + ); +} + +/// @title Standard ERC20 token +/// +/// @dev Implementation of the basic standard token. +/// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md +/// @dev the ERC-165 identifier for this interface is 0x942e8b22 interface ERC20 is Dummy, ERC165, ERC20Events { - // @return the name of the token. - // - // Selector: name() 06fdde03 + /// @return the name of the token. + /// @dev EVM selector for this function is: 0x06fdde03, + /// or in textual repr: name() function name() external view returns (string memory); - // @return the symbol of the token. - // - // Selector: symbol() 95d89b41 + /// @return the symbol of the token. + /// @dev EVM selector for this function is: 0x95d89b41, + /// or in textual repr: symbol() function symbol() external view returns (string memory); - // @dev Total number of tokens in existence - // - // Selector: totalSupply() 18160ddd + /// @dev Total number of tokens in existence + /// @dev EVM selector for this function is: 0x18160ddd, + /// or in textual repr: totalSupply() function totalSupply() external view returns (uint256); - // @dev Not supported - // - // Selector: decimals() 313ce567 + /// @dev Not supported + /// @dev EVM selector for this function is: 0x313ce567, + /// or in textual repr: decimals() function decimals() external view returns (uint8); - // @dev Gets the balance of the specified address. - // @param owner The address to query the balance of. - // @return An uint256 representing the amount owned by the passed address. - // - // Selector: balanceOf(address) 70a08231 + /// @dev Gets the balance of the specified address. + /// @param owner The address to query the balance of. + /// @return An uint256 representing the amount owned by the passed address. + /// @dev EVM selector for this function is: 0x70a08231, + /// or in textual repr: balanceOf(address) function balanceOf(address owner) external view returns (uint256); - // @dev Transfer token for a specified address - // @param to The address to transfer to. - // @param amount The amount to be transferred. - // - // Selector: transfer(address,uint256) a9059cbb + /// @dev Transfer token for a specified address + /// @param to The address to transfer to. + /// @param amount The amount to be transferred. + /// @dev EVM selector for this function is: 0xa9059cbb, + /// or in textual repr: transfer(address,uint256) function transfer(address to, uint256 amount) external returns (bool); - // @dev Transfer tokens from one address to another - // @param from address The address which you want to send tokens from - // @param to address The address which you want to transfer to - // @param amount uint256 the amount of tokens to be transferred - // - // Selector: transferFrom(address,address,uint256) 23b872dd + /// @dev Transfer tokens from one address to another + /// @param from address The address which you want to send tokens from + /// @param to address The address which you want to transfer to + /// @param amount uint256 the amount of tokens to be transferred + /// @dev EVM selector for this function is: 0x23b872dd, + /// or in textual repr: transferFrom(address,address,uint256) function transferFrom( address from, address to, uint256 amount ) external returns (bool); - // @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`. - // Beware that changing an allowance with this method brings the risk that someone may use both the old - // and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this - // race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: - // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - // @param spender The address which will spend the funds. - // @param amount The amount of tokens to be spent. - // - // Selector: approve(address,uint256) 095ea7b3 + /// @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`. + /// Beware that changing an allowance with this method brings the risk that someone may use both the old + /// and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this + /// race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: + /// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + /// @param spender The address which will spend the funds. + /// @param amount The amount of tokens to be spent. + /// @dev EVM selector for this function is: 0x095ea7b3, + /// or in textual repr: approve(address,uint256) function approve(address spender, uint256 amount) external returns (bool); - // @dev Function to check the amount of tokens that an owner allowed to a spender. - // @param owner address The address which owns the funds. - // @param spender address The address which will spend the funds. - // @return A uint256 specifying the amount of tokens still available for the spender. - // - // Selector: allowance(address,address) dd62ed3e + /// @dev Function to check the amount of tokens that an owner allowed to a spender. + /// @param owner address The address which owns the funds. + /// @param spender address The address which will spend the funds. + /// @return A uint256 specifying the amount of tokens still available for the spender. + /// @dev EVM selector for this function is: 0xdd62ed3e, + /// or in textual repr: allowance(address,address) function allowance(address owner, address spender) external view returns (uint256); } -// Selector: ab8deb37 -interface ERC20UniqueExtensions is Dummy, ERC165 { - // @dev Function that burns an amount of the token of a given account, - // deducting from the sender's allowance for said account. - // @param from The account whose tokens will be burnt. - // @param amount The amount that will be burnt. - // - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) external returns (bool); - - // @dev Function that changes total amount of the tokens. - // Throws if `msg.sender` doesn't owns all of the tokens. - // @param amount New total amount of the tokens. - // - // Selector: repartition(uint256) d2418ca7 - function repartition(uint256 amount) external returns (bool); -} - interface UniqueRefungibleToken is Dummy, ERC165, diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index 17f742d97d..feec234821 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -255,7 +255,7 @@ { "internalType": "uint256", "name": "field_0", "type": "uint256" }, { "internalType": "string", "name": "field_1", "type": "string" } ], - "internalType": "struct Tuple0[]", + "internalType": "struct Tuple8[]", "name": "tokens", "type": "tuple[]" } @@ -361,7 +361,7 @@ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], - "name": "safeTransferFromWithData", + "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index cafb05331a..9d21b9faba 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -255,7 +255,7 @@ { "internalType": "uint256", "name": "field_0", "type": "uint256" }, { "internalType": "string", "name": "field_1", "type": "string" } ], - "internalType": "struct Tuple0[]", + "internalType": "struct Tuple8[]", "name": "tokens", "type": "tuple[]" } diff --git a/tests/src/eth/util/contractHelpersAbi.json b/tests/src/eth/util/contractHelpersAbi.json index d527e1a51d..55cc33acf5 100644 --- a/tests/src/eth/util/contractHelpersAbi.json +++ b/tests/src/eth/util/contractHelpersAbi.json @@ -225,7 +225,7 @@ "type": "address" }, { "internalType": "address", "name": "user", "type": "address" }, - { "internalType": "bool", "name": "allowed", "type": "bool" } + { "internalType": "bool", "name": "isAllowed", "type": "bool" } ], "name": "toggleAllowed", "outputs": [], From 50d005ef0b3cb4ba01fed45904cc6b62956ea47d Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 12 Jul 2022 13:19:53 +0200 Subject: [PATCH 0565/1274] refactor(evm-coder): fancier selector doccomment Make it closer to format used in standards Signed-off-by: Yaroslav Bolyukin --- crates/evm-coder-macros/src/solidity_interface.rs | 4 +++- crates/evm-coder/src/solidity.rs | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/evm-coder-macros/src/solidity_interface.rs b/crates/evm-coder-macros/src/solidity_interface.rs index 722abd1aca..d7b358a16e 100644 --- a/crates/evm-coder-macros/src/solidity_interface.rs +++ b/crates/evm-coder-macros/src/solidity_interface.rs @@ -765,11 +765,13 @@ impl Method { .filter(|a| !a.is_special()) .map(MethodArg::expand_solidity_argument); let docs = self.docs.iter(); - let selector = format!("{} {:0>8x}", self.selector_str, self.selector); + let selector_str = &self.selector_str; + let selector = self.selector; quote! { SolidityFunction { docs: &[#(#docs),*], + selector_str: #selector_str, selector: #selector, name: #camel_name, mutability: #mutability, diff --git a/crates/evm-coder/src/solidity.rs b/crates/evm-coder/src/solidity.rs index b07a0dc238..00ed4d6a8f 100644 --- a/crates/evm-coder/src/solidity.rs +++ b/crates/evm-coder/src/solidity.rs @@ -402,7 +402,8 @@ pub enum SolidityMutability { } pub struct SolidityFunction { pub docs: &'static [&'static str], - pub selector: &'static str, + pub selector_str: &'static str, + pub selector: u32, pub name: &'static str, pub args: A, pub result: R, @@ -421,7 +422,8 @@ impl SolidityFunctions for SolidityF if !self.docs.is_empty() { writeln!(writer, "\t///")?; } - writeln!(writer, "\t/// Selector: {}", self.selector)?; + writeln!(writer, "\t/// @dev EVM selector for this function is: 0x{:0>8x},", self.selector)?; + writeln!(writer, "\t/// or in textual repr: {}", self.selector_str)?; write!(writer, "\tfunction {}(", self.name)?; self.args.solidity_name(writer, tc)?; write!(writer, ")")?; From 7d5b680cd73d8d635cffa0b58423e43c244d5654 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 12 Jul 2022 13:24:49 +0200 Subject: [PATCH 0566/1274] refactor(evm-coder): toposort generated code Previously, all items from evm-coder codegen was sorted lexically, which caused some problems, where lexically sorted names of contract were not in the same order as contract inherit chain Now they are sorted by insertion order, and macro-generated code now inserts them in order of definition, thus providing topological sort of output contract items Signed-off-by: Yaroslav Bolyukin --- crates/evm-coder-macros/src/lib.rs | 4 ++-- .../src/solidity_interface.rs | 24 +++++++++---------- crates/evm-coder/src/solidity.rs | 20 +++++++++++----- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/crates/evm-coder-macros/src/lib.rs b/crates/evm-coder-macros/src/lib.rs index f0619ce694..f900c8eefd 100644 --- a/crates/evm-coder-macros/src/lib.rs +++ b/crates/evm-coder-macros/src/lib.rs @@ -22,7 +22,7 @@ use quote::quote; use sha3::{Digest, Keccak256}; use syn::{ DeriveInput, GenericArgument, Ident, ItemImpl, Pat, Path, PathArguments, - PathSegment, Type, parse_macro_input, spanned::Spanned, Attribute, parse::Parse, + PathSegment, Type, parse_macro_input, spanned::Spanned, }; mod solidity_interface; @@ -241,7 +241,7 @@ fn pascal_ident_to_snake_call(ident: &Ident) -> Ident { /// Event(#[indexed] uint32), /// } /// -/// #[solidity_interface(name = "MyContract", is(SuperContract), inline_is(InlineContract))] +/// #[solidity_interface(name = MyContract, is(SuperContract), inline_is(InlineContract))] /// impl Contract { /// /// Multiply two numbers /// #[weight(200 + a + b)] diff --git a/crates/evm-coder-macros/src/solidity_interface.rs b/crates/evm-coder-macros/src/solidity_interface.rs index d7b358a16e..80f0af40fc 100644 --- a/crates/evm-coder-macros/src/solidity_interface.rs +++ b/crates/evm-coder-macros/src/solidity_interface.rs @@ -989,26 +989,24 @@ impl SolidityInterface { #solidity_functions, )*), }; - if is_impl { - tc.collect("/// @dev common stubs holder\ncontract Dummy {\n\tuint8 dummy;\n\tstring stub_error = \"this contract is implemented in native\";\n}\ncontract ERC165 is Dummy {\n\tfunction supportsInterface(bytes4 interfaceID) external view returns (bool) {\n\t\trequire(false, stub_error);\n\t\tinterfaceID;\n\t\treturn true;\n\t}\n}\n".into()); - } else { - tc.collect("/// @dev common stubs holder\ninterface Dummy {\n}\ninterface ERC165 is Dummy {\n\tfunction supportsInterface(bytes4 interfaceID) external view returns (bool);\n}\n".into()); - } - #( - #solidity_generators - )* - #( - #solidity_event_generators - )* let mut out = string::new(); - // In solidity interface usage (is) should be preceeded by interface definition - // HACK: this comment helps to sort it in a set if #solidity_name.starts_with("Inline") { out.push_str("/// @dev inlined interface\n"); } let _ = interface.format(is_impl, &mut out, tc); tc.collect(out); + #( + #solidity_event_generators + )* + #( + #solidity_generators + )* + if is_impl { + tc.collect("/// @dev common stubs holder\ncontract Dummy {\n\tuint8 dummy;\n\tstring stub_error = \"this contract is implemented in native\";\n}\ncontract ERC165 is Dummy {\n\tfunction supportsInterface(bytes4 interfaceID) external view returns (bool) {\n\t\trequire(false, stub_error);\n\t\tinterfaceID;\n\t\treturn true;\n\t}\n}\n".into()); + } else { + tc.collect("/// @dev common stubs holder\ninterface Dummy {\n}\ninterface ERC165 is Dummy {\n\tfunction supportsInterface(bytes4 interfaceID) external view returns (bool);\n}\n".into()); + } } } impl #gen_ref ::evm_coder::Call for #call_name #gen_ref { diff --git a/crates/evm-coder/src/solidity.rs b/crates/evm-coder/src/solidity.rs index 00ed4d6a8f..85b3c86fbf 100644 --- a/crates/evm-coder/src/solidity.rs +++ b/crates/evm-coder/src/solidity.rs @@ -14,26 +14,31 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! Implementation detail of [`evm_coder::solidity_interface`] macro code-generation + #[cfg(not(feature = "std"))] use alloc::{ string::String, vec::Vec, - collections::{BTreeSet, BTreeMap}, + collections::BTreeMap, format, }; #[cfg(feature = "std")] -use std::collections::{BTreeSet, BTreeMap}; +use std::collections::BTreeMap; use core::{ fmt::{self, Write}, marker::PhantomData, cell::{Cell, RefCell}, + cmp::Reverse, }; use impl_trait_for_tuples::impl_for_tuples; use crate::types::*; #[derive(Default)] pub struct TypeCollector { - structs: RefCell>, + /// Code => id + /// id ordering is required to perform topo-sort on the resulting data + structs: RefCell>, anonymous: RefCell, usize>>, id: Cell, } @@ -42,7 +47,8 @@ impl TypeCollector { Self::default() } pub fn collect(&self, item: string) { - self.structs.borrow_mut().insert(item); + let id = self.next_id(); + self.structs.borrow_mut().insert(item, id); } pub fn next_id(&self) -> usize { let v = self.id.get(); @@ -66,8 +72,10 @@ impl TypeCollector { self.anonymous.borrow_mut().insert(names, id); format!("Tuple{}", id) } - pub fn finish(self) -> BTreeSet { - self.structs.into_inner() + pub fn finish(self) -> Vec { + let mut data = self.structs.into_inner().into_iter().collect::>(); + data.sort_by_key(|(_, id)| Reverse(*id)); + data.into_iter().map(|(code, _)| code).collect() } } From f0dde168a42b9e91b81ade3b985f378a8f6025e9 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 12 Jul 2022 15:23:24 +0200 Subject: [PATCH 0567/1274] feat(evm-coder): parse #[doc] for interface types Previously, only documentation on items was parsed and preserved in generated code, now you can have documentation on interface itself Signed-off-by: Yaroslav Bolyukin --- Cargo.lock | 4 ++-- .../procedural}/Cargo.toml | 2 +- .../procedural}/src/lib.rs | 0 .../procedural}/src/solidity_interface.rs | 19 +++++++++++++++++++ .../procedural}/src/to_log.rs | 1 + crates/evm-coder/src/solidity.rs | 7 ++++--- 6 files changed, 27 insertions(+), 6 deletions(-) rename crates/{evm-coder-macros => evm-coder/procedural}/Cargo.toml (88%) rename crates/{evm-coder-macros => evm-coder/procedural}/src/lib.rs (100%) rename crates/{evm-coder-macros => evm-coder/procedural}/src/solidity_interface.rs (98%) rename crates/{evm-coder-macros => evm-coder/procedural}/src/to_log.rs (99%) diff --git a/Cargo.lock b/Cargo.lock index 1f7a931813..4083fdf813 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2172,7 +2172,7 @@ name = "evm-coder" version = "0.1.1" dependencies = [ "ethereum", - "evm-coder-macros", + "evm-coder-procedural", "evm-core", "hex", "hex-literal", @@ -2181,7 +2181,7 @@ dependencies = [ ] [[package]] -name = "evm-coder-macros" +name = "evm-coder-procedural" version = "0.2.0" dependencies = [ "Inflector", diff --git a/crates/evm-coder-macros/Cargo.toml b/crates/evm-coder/procedural/Cargo.toml similarity index 88% rename from crates/evm-coder-macros/Cargo.toml rename to crates/evm-coder/procedural/Cargo.toml index d24553a78e..d3a1ebaa28 100644 --- a/crates/evm-coder-macros/Cargo.toml +++ b/crates/evm-coder/procedural/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "evm-coder-macros" +name = "evm-coder-procedural" version = "0.2.0" license = "GPLv3" edition = "2021" diff --git a/crates/evm-coder-macros/src/lib.rs b/crates/evm-coder/procedural/src/lib.rs similarity index 100% rename from crates/evm-coder-macros/src/lib.rs rename to crates/evm-coder/procedural/src/lib.rs diff --git a/crates/evm-coder-macros/src/solidity_interface.rs b/crates/evm-coder/procedural/src/solidity_interface.rs similarity index 98% rename from crates/evm-coder-macros/src/solidity_interface.rs rename to crates/evm-coder/procedural/src/solidity_interface.rs index 80f0af40fc..e58bbaf719 100644 --- a/crates/evm-coder-macros/src/solidity_interface.rs +++ b/crates/evm-coder/procedural/src/solidity_interface.rs @@ -827,6 +827,7 @@ pub struct SolidityInterface { name: Box, info: InterfaceInfo, methods: Vec, + docs: Vec, } impl SolidityInterface { pub fn try_from(info: InterfaceInfo, value: &ItemImpl) -> syn::Result { @@ -837,11 +838,26 @@ impl SolidityInterface { methods.push(Method::try_from(method)?) } } + let mut docs = vec![]; + for attr in &value.attrs { + let ident = parse_ident_from_path(&attr.path, false)?; + if ident == "doc" { + let args = attr.parse_meta().unwrap(); + let value = match args { + Meta::NameValue(MetaNameValue { + lit: Lit::Str(str), .. + }) => str.value(), + _ => unreachable!(), + }; + docs.push(value); + } + } Ok(Self { generics: value.generics.clone(), name: value.self_ty.clone(), info, methods, + docs, }) } pub fn expand(self) -> proc_macro2::TokenStream { @@ -920,6 +936,8 @@ impl SolidityInterface { .map(|is| Is::expand_generator(is, &gen_ref)); let solidity_event_generators = self.info.events.0.iter().map(Is::expand_event_generator); + let docs = self.docs.iter(); + if let Some(expect_selector) = &self.info.expect_selector { if !self.info.inline_is.0.is_empty() { return syn::Error::new( @@ -978,6 +996,7 @@ impl SolidityInterface { use evm_coder::solidity::*; use core::fmt::Write; let interface = SolidityInterface { + docs: &[#(#docs),*], name: #solidity_name, selector: Self::interface_id(), is: &["Dummy", "ERC165", #( diff --git a/crates/evm-coder-macros/src/to_log.rs b/crates/evm-coder/procedural/src/to_log.rs similarity index 99% rename from crates/evm-coder-macros/src/to_log.rs rename to crates/evm-coder/procedural/src/to_log.rs index 27fb1998be..7fd8e0a76e 100644 --- a/crates/evm-coder-macros/src/to_log.rs +++ b/crates/evm-coder/procedural/src/to_log.rs @@ -199,6 +199,7 @@ impl Events { use evm_coder::solidity::*; use core::fmt::Write; let interface = SolidityInterface { + docs: &[], selector: [0; 4], name: #solidity_name, is: &[], diff --git a/crates/evm-coder/src/solidity.rs b/crates/evm-coder/src/solidity.rs index 85b3c86fbf..6d69e65cef 100644 --- a/crates/evm-coder/src/solidity.rs +++ b/crates/evm-coder/src/solidity.rs @@ -427,9 +427,6 @@ impl SolidityFunctions for SolidityF for doc in self.docs { writeln!(writer, "\t///{}", doc)?; } - if !self.docs.is_empty() { - writeln!(writer, "\t///")?; - } writeln!(writer, "\t/// @dev EVM selector for this function is: 0x{:0>8x},", self.selector)?; writeln!(writer, "\t/// or in textual repr: {}", self.selector_str)?; write!(writer, "\tfunction {}(", self.name)?; @@ -491,6 +488,7 @@ impl SolidityFunctions for Tuple { } pub struct SolidityInterface { + pub docs: &'static [&'static str], pub selector: bytes4, pub name: &'static str, pub is: &'static [&'static str], @@ -505,6 +503,9 @@ impl SolidityInterface { tc: &TypeCollector, ) -> fmt::Result { const ZERO_BYTES: [u8; 4] = [0; 4]; + for doc in self.docs { + writeln!(out, "///{}", doc)?; + } if self.selector != ZERO_BYTES { writeln!( out, From c0989353baf4b1120643206f027feda3def84839 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 12 Jul 2022 17:23:24 +0200 Subject: [PATCH 0568/1274] doc(evm-coder): document public api Signed-off-by: Yaroslav Bolyukin --- crates/evm-coder/Cargo.toml | 12 ++- crates/evm-coder/README.md | 15 +++ crates/evm-coder/procedural/Cargo.toml | 7 +- crates/evm-coder/procedural/src/lib.rs | 62 +----------- crates/evm-coder/src/abi.rs | 72 +++++++++++--- crates/evm-coder/src/events.rs | 12 +++ crates/evm-coder/src/execution.rs | 19 ++++ crates/evm-coder/src/lib.rs | 126 +++++++++++++++++++++++-- crates/evm-coder/src/solidity.rs | 26 +++-- 9 files changed, 259 insertions(+), 92 deletions(-) create mode 100644 crates/evm-coder/README.md diff --git a/crates/evm-coder/Cargo.toml b/crates/evm-coder/Cargo.toml index 52b95c2505..8a5abc61fb 100644 --- a/crates/evm-coder/Cargo.toml +++ b/crates/evm-coder/Cargo.toml @@ -5,15 +5,21 @@ license = "GPLv3" edition = "2021" [dependencies] -evm-coder-macros = { path = "../evm-coder-macros" } +# evm-coder reexports those proc-macro +evm-coder-procedural = { path = "./procedural" } +# Evm uses primitive-types for H160, H256 and others primitive-types = { version = "0.11.1", default-features = false } -hex-literal = "0.3.3" +# Evm doesn't have reexports for log and others ethereum = { version = "0.12.0", default-features = false } +# Error types for execution evm-core = { default-features = false, git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.27" } -impl-trait-for-tuples = "0.2.1" +# We have tuple-heavy code in solidity.rs +impl-trait-for-tuples = "0.2.2" [dev-dependencies] +# We want to assert some large binary blobs equality in tests hex = "0.4.3" +hex-literal = "0.3.4" [features] default = ["std"] diff --git a/crates/evm-coder/README.md b/crates/evm-coder/README.md new file mode 100644 index 0000000000..f9f30c7f9e --- /dev/null +++ b/crates/evm-coder/README.md @@ -0,0 +1,15 @@ +# evm-coder + +Library for seamless call translation between Rust and Solidity code + +By encoding solidity definitions in Rust, this library also provides generation of +solidity interfaces for ethereum developers + +## Overview + +Most of this library functionality shouldn't be used directly, but via macros + +- [`solidity_interface`] +- [`ToLog`] + + \ No newline at end of file diff --git a/crates/evm-coder/procedural/Cargo.toml b/crates/evm-coder/procedural/Cargo.toml index d3a1ebaa28..0b9956cd67 100644 --- a/crates/evm-coder/procedural/Cargo.toml +++ b/crates/evm-coder/procedural/Cargo.toml @@ -8,9 +8,12 @@ edition = "2021" proc-macro = true [dependencies] +# Ethereum uses keccak (=sha3) for selectors sha3 = "0.10.1" +# Value formatting +hex = "0.4.3" +Inflector = "0.11.4" +# General proc-macro utilities quote = "1.0" proc-macro2 = "1.0" syn = { version = "1.0", features = ["full"] } -hex = "0.4.3" -Inflector = "0.11.4" diff --git a/crates/evm-coder/procedural/src/lib.rs b/crates/evm-coder/procedural/src/lib.rs index f900c8eefd..63c916ca1c 100644 --- a/crates/evm-coder/procedural/src/lib.rs +++ b/crates/evm-coder/procedural/src/lib.rs @@ -21,8 +21,8 @@ use proc_macro::TokenStream; use quote::quote; use sha3::{Digest, Keccak256}; use syn::{ - DeriveInput, GenericArgument, Ident, ItemImpl, Pat, Path, PathArguments, - PathSegment, Type, parse_macro_input, spanned::Spanned, + DeriveInput, GenericArgument, Ident, ItemImpl, Pat, Path, PathArguments, PathSegment, Type, + parse_macro_input, spanned::Spanned, }; mod solidity_interface; @@ -199,58 +199,7 @@ fn pascal_ident_to_snake_call(ident: &Ident) -> Ident { Ident::new(&name, ident.span()) } -/// Derives call enum implementing [`evm_coder::Callable`], [`evm_coder::Weighted`] -/// and [`evm_coder::Call`] from impl block -/// -/// ## Macro syntax -/// -/// `#[solidity_interface(name, is, inline_is, events)]` -/// - *name*: used in generated code, and for Call enum name -/// - *is*: used to provide call inheritance, not found methods will be delegated to all contracts -/// specified in is/inline_is -/// - *inline_is*: same as is, but selectors for passed contracts will be used by derived ERC165 -/// implementation -/// -/// `#[weight(value)]` -/// Can be added to every method of impl block, used for deriving [`evm_coder::Weighted`], which -/// is used by substrate bridge -/// - *value*: expression, which evaluates to weight required to call this method. -/// This expression can use call arguments to calculate non-constant execution time. -/// This expression should evaluate faster than actual execution does, and may provide worser case -/// than one is called -/// -/// `#[solidity_interface(rename_selector)]` -/// - *rename_selector*: by default, selector name will be generated by transforming method name -/// from snake_case to camelCase. Use this option, if other naming convention is required. -/// I.e: method `token_uri` will be automatically renamed to `tokenUri` in selector, but name -/// required by ERC721 standard is `tokenURI`, thus we need to specify `rename_selector = "tokenURI"` -/// explicitly -/// -/// Also, any contract method may have doc comments, which will be automatically added to generated -/// solidity interface definitions -/// -/// ## Example -/// -/// ```ignore -/// struct SuperContract; -/// struct InlineContract; -/// struct Contract; -/// -/// #[derive(ToLog)] -/// enum ContractEvents { -/// Event(#[indexed] uint32), -/// } -/// -/// #[solidity_interface(name = MyContract, is(SuperContract), inline_is(InlineContract))] -/// impl Contract { -/// /// Multiply two numbers -/// #[weight(200 + a + b)] -/// #[solidity_interface(rename_selector = "mul")] -/// fn mul(&mut self, a: uint32, b: uint32) -> Result { -/// Ok(a.checked_mul(b).ok_or("overflow")?) -/// } -/// } -/// ``` +/// See documentation for this proc-macro reexported in `evm-coder` crate #[proc_macro_attribute] pub fn solidity_interface(args: TokenStream, stream: TokenStream) -> TokenStream { let args = parse_macro_input!(args as solidity_interface::InterfaceInfo); @@ -282,10 +231,7 @@ pub fn weight(_args: TokenStream, stream: TokenStream) -> TokenStream { stream } -/// ## Syntax -/// -/// `#[indexed]` -/// Marks this field as indexed, so it will appear in [`ethereum::Log`] topics instead of data +/// See documentation for this proc-macro reexported in `evm-coder` crate #[proc_macro_derive(ToLog, attributes(indexed))] pub fn to_log(value: TokenStream) -> TokenStream { let input = parse_macro_input!(value as DeriveInput); diff --git a/crates/evm-coder/src/abi.rs b/crates/evm-coder/src/abi.rs index a5f75022a6..769ad30608 100644 --- a/crates/evm-coder/src/abi.rs +++ b/crates/evm-coder/src/abi.rs @@ -14,8 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -//! TODO: I misunterstood therminology, abi IS rlp encoded, so -//! this module should be replaced with rlp crate +//! Implementation of EVM RLP reader/writer #![allow(dead_code)] @@ -32,6 +31,7 @@ use crate::execution::Result; const ABI_ALIGNMENT: usize = 32; +/// View into RLP data, which provides method to read typed items from it #[derive(Clone)] pub struct AbiReader<'i> { buf: &'i [u8], @@ -39,6 +39,7 @@ pub struct AbiReader<'i> { offset: usize, } impl<'i> AbiReader<'i> { + /// Start reading RLP buffer, assuming there is no padding bytes pub fn new(buf: &'i [u8]) -> Self { Self { buf, @@ -46,6 +47,7 @@ impl<'i> AbiReader<'i> { offset: 0, } } + /// Start reading RLP buffer, parsing first 4 bytes as selector pub fn new_call(buf: &'i [u8]) -> Result<(types::bytes4, Self)> { if buf.len() < 4 { return Err(Error::Error(ExitError::OutOfOffset)); @@ -109,10 +111,12 @@ impl<'i> AbiReader<'i> { ) } + /// Read [`H160`] at current position, then advance pub fn address(&mut self) -> Result { Ok(H160(self.read_padleft()?)) } + /// Read [`bool`] at current position, then advance pub fn bool(&mut self) -> Result { let data: [u8; 1] = self.read_padleft()?; match data[0] { @@ -122,49 +126,61 @@ impl<'i> AbiReader<'i> { } } + /// Read [`[u8; 4]`] at current position, then advance pub fn bytes4(&mut self) -> Result<[u8; 4]> { self.read_padright() } + /// Read [`Vec`] at current position, then advance pub fn bytes(&mut self) -> Result> { let mut subresult = self.subresult()?; - let length = subresult.read_usize()?; + let length = subresult.uint32()? as usize; if subresult.buf.len() < subresult.offset + length { return Err(Error::Error(ExitError::OutOfOffset)); } Ok(subresult.buf[subresult.offset..subresult.offset + length].into()) } + + /// Read [`string`] at current position, then advance pub fn string(&mut self) -> Result { string::from_utf8(self.bytes()?).map_err(|_| Error::Error(ExitError::InvalidRange)) } + /// Read [`u8`] at current position, then advance pub fn uint8(&mut self) -> Result { Ok(self.read_padleft::<1>()?[0]) } + /// Read [`u32`] at current position, then advance pub fn uint32(&mut self) -> Result { Ok(u32::from_be_bytes(self.read_padleft()?)) } + /// Read [`u128`] at current position, then advance pub fn uint128(&mut self) -> Result { Ok(u128::from_be_bytes(self.read_padleft()?)) } + /// Read [`U256`] at current position, then advance pub fn uint256(&mut self) -> Result { let buf: [u8; 32] = self.read_padleft()?; Ok(U256::from_big_endian(&buf)) } + /// Read [`u64`] at current position, then advance pub fn uint64(&mut self) -> Result { Ok(u64::from_be_bytes(self.read_padleft()?)) } + /// Read [`usize`] at current position, then advance + #[deprecated = "dangerous, as usize may have different width in wasm and native execution"] pub fn read_usize(&mut self) -> Result { Ok(usize::from_be_bytes(self.read_padleft()?)) } + /// Slice recursive buffer, advance one word for buffer offset fn subresult(&mut self) -> Result> { - let offset = self.read_usize()?; + let offset = self.uint32()? as usize; if offset + self.subresult_offset > self.buf.len() { return Err(Error::Error(ExitError::InvalidRange)); } @@ -175,11 +191,13 @@ impl<'i> AbiReader<'i> { }) } + /// Is this parser reached end of buffer? pub fn is_finished(&self) -> bool { self.buf.len() == self.offset } } +/// Writer for RLP encoded data #[derive(Default)] pub struct AbiWriter { static_part: Vec, @@ -187,9 +205,11 @@ pub struct AbiWriter { had_call: bool, } impl AbiWriter { + /// Initialize internal buffers for output data, assuming no padding required pub fn new() -> Self { Self::default() } + /// Initialize internal buffers, inserting method selector at beginning pub fn new_call(method_id: u32) -> Self { let mut val = Self::new(); val.static_part.extend(&method_id.to_be_bytes()); @@ -211,59 +231,71 @@ impl AbiWriter { .extend(&[0; ABI_ALIGNMENT][0..ABI_ALIGNMENT - bytes.len()]); } + /// Write [`H160`] to end of buffer pub fn address(&mut self, address: &H160) { self.write_padleft(&address.0) } + /// Write [`bool`] to end of buffer pub fn bool(&mut self, value: &bool) { self.write_padleft(&[if *value { 1 } else { 0 }]) } + /// Write [`u8`] to end of buffer pub fn uint8(&mut self, value: &u8) { self.write_padleft(&[*value]) } + /// Write [`u32`] to end of buffer pub fn uint32(&mut self, value: &u32) { self.write_padleft(&u32::to_be_bytes(*value)) } + /// Write [`u128`] to end of buffer pub fn uint128(&mut self, value: &u128) { self.write_padleft(&u128::to_be_bytes(*value)) } + /// Write [`U256`] to end of buffer pub fn uint256(&mut self, value: &U256) { let mut out = [0; 32]; value.to_big_endian(&mut out); self.write_padleft(&out) } + /// Write [`usize`] to end of buffer + #[deprecated = "dangerous, as usize may have different width in wasm and native execution"] pub fn write_usize(&mut self, value: &usize) { self.write_padleft(&usize::to_be_bytes(*value)) } + /// Append recursive data, writing pending offset at end of buffer pub fn write_subresult(&mut self, result: Self) { self.dynamic_part.push((self.static_part.len(), result)); // Empty block, to be filled later self.write_padleft(&[]); } - pub fn memory(&mut self, value: &[u8]) { + fn memory(&mut self, value: &[u8]) { let mut sub = Self::new(); - sub.write_usize(&value.len()); + sub.uint32(&(value.len() as u32)); for chunk in value.chunks(ABI_ALIGNMENT) { sub.write_padright(chunk); } self.write_subresult(sub); } + /// Append recursive [`str`] at end of buffer pub fn string(&mut self, value: &str) { self.memory(value.as_bytes()) } + /// Append recursive [`[u8]`] at end of buffer pub fn bytes(&mut self, value: &[u8]) { self.memory(value) } + /// Finish writer, concatenating all internal buffers pub fn finish(mut self) -> Vec { for (static_offset, part) in self.dynamic_part { let part_offset = self.static_part.len() - self.had_call.then(|| 4).unwrap_or(0); @@ -278,7 +310,13 @@ impl AbiWriter { } } +/// [`AbiReader`] implements reading of many types, but it should +/// be limited to types defined in spec +/// +/// As this trait can't be made sealed, +/// instead of having `impl AbiRead for T`, we have `impl AbiRead for AbiReader` pub trait AbiRead { + /// Read item from current position, advanding decoder fn abi_read(&mut self) -> Result; } @@ -318,7 +356,7 @@ where { fn abi_read(&mut self) -> Result> { let mut sub = self.subresult()?; - let size = sub.read_usize()?; + let size = sub.uint32()? as usize; sub.subresult_offset = sub.offset; let mut out = Vec::with_capacity(size); for _ in 0..size { @@ -366,8 +404,13 @@ impl_tuples! {A B C D E F G H} impl_tuples! {A B C D E F G H I} impl_tuples! {A B C D E F G H I J} +/// For questions about inability to provide custom implementations, +/// see [`AbiRead`] pub trait AbiWrite { + /// Write value to end of specified encoder fn abi_write(&self, writer: &mut AbiWriter); + /// Specialization for [`crate::solidity_interface`] implementation, + /// see comment in `impl AbiWrite for ResultWithPostInfo` fn to_result(&self) -> ResultWithPostInfo { let mut writer = AbiWriter::new(); self.abi_write(&mut writer); @@ -375,13 +418,11 @@ pub trait AbiWrite { } } +/// This particular AbiWrite implementation should be split to another trait, +/// which only implements `to_result`, but due to lack of specialization feature +/// in stable Rust, we can't have blanket impl of this trait `for T where T: AbiWrite`, +/// so here we abusing default trait methods for it impl AbiWrite for ResultWithPostInfo { - // this particular AbiWrite implementation should be split to another trait, - // which only implements [`to_result`] - // - // But due to lack of specialization feature in stable Rust, we can't have - // blanket impl of this trait `for T where T: AbiWrite`, so here we abusing - // default trait methods for it fn abi_write(&self, _writer: &mut AbiWriter) { debug_assert!(false, "shouldn't be called, see comment") } @@ -432,6 +473,8 @@ impl AbiWrite for () { fn abi_write(&self, _writer: &mut AbiWriter) {} } +/// Helper macros to parse reader into variables +#[deprecated] #[macro_export] macro_rules! abi_decode { ($reader:expr, $($name:ident: $typ:ident),+ $(,)?) => { @@ -440,6 +483,9 @@ macro_rules! abi_decode { )+ } } + +/// Helper macros to construct RLP-encoded buffer +#[deprecated] #[macro_export] macro_rules! abi_encode { ($($typ:ident($value:expr)),* $(,)?) => {{ diff --git a/crates/evm-coder/src/events.rs b/crates/evm-coder/src/events.rs index 05b057f0f4..0c4c955f7f 100644 --- a/crates/evm-coder/src/events.rs +++ b/crates/evm-coder/src/events.rs @@ -19,11 +19,23 @@ use primitive_types::{H160, H256}; use crate::types::*; +/// Implementation of this trait should not be written manually, +/// instead use [`crate::ToLog`] proc macros. +/// +/// See also [`evm_coder_procedural::ToLog`], [solidity docs on events](https://docs.soliditylang.org/en/develop/contracts.html#events) pub trait ToLog { + /// Convert event to [`ethereum::Log`]. + /// Because event by itself doesn't contains current contract + /// address, it should be specified manually. fn to_log(&self, contract: H160) -> Log; } +/// Only items implementing `ToTopic` may be used as `#[indexed]` field +/// in [`crate::ToLog`] macro usage. +/// +/// See also (solidity docs on events)[] pub trait ToTopic { + /// Convert value to topic to be used in [`ethereum::Log`] fn to_topic(&self) -> H256; } diff --git a/crates/evm-coder/src/execution.rs b/crates/evm-coder/src/execution.rs index 61dddff4b6..6ad0e544b7 100644 --- a/crates/evm-coder/src/execution.rs +++ b/crates/evm-coder/src/execution.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! Contract execution related types + #[cfg(not(feature = "std"))] use alloc::string::{String, ToString}; use evm_core::{ExitError, ExitFatal}; @@ -22,10 +24,14 @@ use std::string::{String, ToString}; use crate::Weight; +/// Execution error, should be convertible between EVM and Substrate. #[derive(Debug, Clone)] pub enum Error { + /// Non-fatal contract error occured Revert(String), + /// EVM fatal error Fatal(ExitFatal), + /// EVM normal error Error(ExitError), } @@ -38,9 +44,12 @@ where } } +/// To be used in [`crate::solidity_interface`] implementation. pub type Result = core::result::Result; +/// Static information collected from [`crate::weight`]. pub struct DispatchInfo { + /// Statically predicted call weight pub weight: Weight, } @@ -55,16 +64,22 @@ impl From<()> for DispatchInfo { } } +/// Weight information that is only available post dispatch. +/// Note: This can only be used to reduce the weight or fee, not increase it. #[derive(Default, Clone)] pub struct PostDispatchInfo { + /// Actual weight consumed by call actual_weight: Option, } impl PostDispatchInfo { + /// Calculate amount to be returned back to user pub fn calc_unspent(&self, info: &DispatchInfo) -> Weight { info.weight - self.calc_actual_weight(info) } + /// Calculate actual cansumed weight, saturating to weight reported + /// pre-dispatch pub fn calc_actual_weight(&self, info: &DispatchInfo) -> Weight { if let Some(actual_weight) = self.actual_weight { actual_weight.min(info.weight) @@ -74,9 +89,12 @@ impl PostDispatchInfo { } } +/// Wrapper for PostDispatchInfo and any user-provided data #[derive(Clone)] pub struct WithPostDispatchInfo { + /// User provided data pub data: T, + /// Info known after dispatch pub post_info: PostDispatchInfo, } @@ -89,5 +107,6 @@ impl From for WithPostDispatchInfo { } } +/// Return type of items in [`crate::solidity_interface`] definition pub type ResultWithPostInfo = core::result::Result, WithPostDispatchInfo>; diff --git a/crates/evm-coder/src/lib.rs b/crates/evm-coder/src/lib.rs index 136811bc37..00d501d789 100644 --- a/crates/evm-coder/src/lib.rs +++ b/crates/evm-coder/src/lib.rs @@ -14,22 +14,102 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +#![doc = include_str!("../README.md")] +#![deny(missing_docs)] #![cfg_attr(not(feature = "std"), no_std)] #[cfg(not(feature = "std"))] extern crate alloc; use abi::{AbiRead, AbiReader, AbiWriter}; -pub use evm_coder_macros::{event_topic, fn_selector, solidity_interface, solidity, weight, ToLog}; +pub use evm_coder_procedural::{event_topic, fn_selector}; pub mod abi; -pub mod events; -pub use events::ToLog; +pub use events::{ToLog, ToTopic}; use execution::DispatchInfo; pub mod execution; + +/// Derives call enum implementing [`crate::Callable`], [`crate::Weighted`] +/// and [`crate::Call`] from impl block. +/// +/// ## Macro syntax +/// +/// `#[solidity_interface(name, is, inline_is, events)]` +/// - *name* - used in generated code, and for Call enum name +/// - *is* - used to provide call inheritance, not found methods will be delegated to all contracts +/// specified in is/inline_is +/// - *inline_is* - same as is, but selectors for passed contracts will be used by derived ERC165 +/// implementation +/// +/// `#[weight(value)]` +/// Can be added to every method of impl block, used for deriving [`crate::Weighted`], which +/// is used by substrate bridge. +/// - *value*: expression, which evaluates to weight required to call this method. +/// This expression can use call arguments to calculate non-constant execution time. +/// This expression should evaluate faster than actual execution does, and may provide worser case +/// than one is called. +/// +/// `#[solidity_interface(rename_selector)]` +/// - *rename_selector* - by default, selector name will be generated by transforming method name +/// from snake_case to camelCase. Use this option, if other naming convention is required. +/// I.e: method `token_uri` will be automatically renamed to `tokenUri` in selector, but name +/// required by ERC721 standard is `tokenURI`, thus we need to specify `rename_selector = "tokenURI"` +/// explicitly. +/// +/// Both contract and contract methods may have doccomments, which will end up in a generated +/// solidity interface file, thus you should use [solidity syntax](https://docs.soliditylang.org/en/latest/natspec-format.html) for writing documentation in this macro +/// +/// ## Example +/// +/// ```ignore +/// struct SuperContract; +/// struct InlineContract; +/// struct Contract; +/// +/// #[derive(ToLog)] +/// enum ContractEvents { +/// Event(#[indexed] uint32), +/// } +/// +/// /// @dev This contract provides function to multiply two numbers +/// #[solidity_interface(name = MyContract, is(SuperContract), inline_is(InlineContract))] +/// impl Contract { +/// /// Multiply two numbers +/// /// @param a First number +/// /// @param b Second number +/// /// @return uint32 Product of two passed numbers +/// /// @dev This function returns error in case of overflow +/// #[weight(200 + a + b)] +/// #[solidity_interface(rename_selector = "mul")] +/// fn mul(&mut self, a: uint32, b: uint32) -> Result { +/// Ok(a.checked_mul(b).ok_or("overflow")?) +/// } +/// } +/// ``` +pub use evm_coder_procedural::solidity_interface; +/// See [`solidity_interface`] +pub use evm_coder_procedural::solidity; +/// See [`solidity_interface`] +pub use evm_coder_procedural::weight; + +/// Derives [`ToLog`] for enum +/// +/// Selectors will be derived from variant names, there is currently no way to have custom naming +/// for them +/// +/// `#[indexed]` +/// Marks this field as indexed, so it will appear in [`ethereum::Log`] topics instead of data +pub use evm_coder_procedural::ToLog; + +// Api of those modules shouldn't be consumed directly, it is only exported for usage in proc macros +#[doc(hidden)] +pub mod events; +#[doc(hidden)] pub mod solidity; -/// Solidity type definitions +/// Solidity type definitions (aliases from solidity name to rust type) +/// To be used in [`solidity_interface`] definitions, to make sure there is no +/// type conflict between Rust code and generated definitions pub mod types { - #![allow(non_camel_case_types)] + #![allow(non_camel_case_types, missing_docs)] #[cfg(not(feature = "std"))] use alloc::{vec::Vec}; @@ -54,6 +134,8 @@ pub mod types { pub type string = ::std::string::String; pub type bytes = Vec; + /// Solidity doesn't have `void` type, however we have special implementation + /// for empty tuple return type pub type void = (); //#region Special types @@ -63,36 +145,64 @@ pub mod types { pub type caller = address; //#endregion + /// Ethereum typed call message, similar to solidity + /// `msg` object. pub struct Msg { pub call: C, + /// Address of user, which called this contract. pub caller: H160, + /// Payment amount to contract. + /// Contract should reject payment, if target call is not payable, + /// and there is no `receiver()` function defined. pub value: U256, } } +/// Parseable EVM call, this trait should be implemented with [`solidity_interface`] macro pub trait Call: Sized { + /// Parse call buffer into typed call enum fn parse(selector: types::bytes4, input: &mut AbiReader) -> execution::Result>; } +/// Intended to be used as `#[weight]` output type +/// Should be same between evm-coder and substrate to avoid confusion +/// +/// Isn't same thing as gas, some mapping is required between those types pub type Weight = u64; +/// In substrate, we have benchmarking, which allows +/// us to not rely on gas metering, but instead predict amount of gas to execute call pub trait Weighted: Call { + /// Predict weight of this call fn weight(&self) -> DispatchInfo; } +/// Type callable with ethereum message, may be implemented by [`solidity_interface`] macro +/// on interface implementation, or for externally-owned real EVM contract pub trait Callable { + /// Call contract using specified call data fn call(&mut self, call: types::Msg) -> execution::ResultWithPostInfo; } -/// Implementation is implicitly provided for all interfaces +/// Implementation of ERC165 is implicitly generated for all interfaces in [`solidity_interface`], +/// this structure holds parsed data for ERC165Call subvariant +/// +/// Note: no [`Callable`] implementation is provided, call implementation is inlined into every +/// implementing contract /// -/// Note: no Callable implementation is provided +/// See #[derive(Debug)] pub enum ERC165Call { - SupportsInterface { interface_id: types::bytes4 }, + /// ERC165 provides single method, which returns true, if contract + /// implements specified interface + SupportsInterface { + /// Requested interface + interface_id: types::bytes4, + }, } impl ERC165Call { + /// ERC165 selector is provided by standard pub const INTERFACE_ID: types::bytes4 = u32::to_be_bytes(0x01ffc9a7); } diff --git a/crates/evm-coder/src/solidity.rs b/crates/evm-coder/src/solidity.rs index 6d69e65cef..ddec31fc03 100644 --- a/crates/evm-coder/src/solidity.rs +++ b/crates/evm-coder/src/solidity.rs @@ -14,15 +14,15 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -//! Implementation detail of [`evm_coder::solidity_interface`] macro code-generation +//! Implementation detail of [`crate::solidity_interface`] macro code-generation. +//! You should not rely on any public item from this module, as it is only intended to be used +//! by procedural macro, API and output format may be changed at any time. +//! +//! Purpose of this module is to receive solidity contract definition in module-specified +//! format, and then output string, representing interface of this contract in solidity language #[cfg(not(feature = "std"))] -use alloc::{ - string::String, - vec::Vec, - collections::BTreeMap, - format, -}; +use alloc::{string::String, vec::Vec, collections::BTreeMap, format}; #[cfg(feature = "std")] use std::collections::BTreeMap; use core::{ @@ -81,8 +81,10 @@ impl TypeCollector { pub trait SolidityTypeName: 'static { fn solidity_name(writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result; + /// "simple" types are stored inline, no `memory` modifier should be used in solidity fn is_simple() -> bool; fn solidity_default(writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result; + /// Specialization fn is_void() -> bool { false } @@ -133,6 +135,10 @@ impl SolidityTypeName for void { } mod sealed { + /// Not every type should be directly placed in vec. + /// Vec encoding is not memory efficient, as every item will be padded + /// to 32 bytes. + /// Instead you should use specialized types (`bytes` in case of `Vec`) pub trait CanBePlacedInVec {} } @@ -427,7 +433,11 @@ impl SolidityFunctions for SolidityF for doc in self.docs { writeln!(writer, "\t///{}", doc)?; } - writeln!(writer, "\t/// @dev EVM selector for this function is: 0x{:0>8x},", self.selector)?; + writeln!( + writer, + "\t/// @dev EVM selector for this function is: 0x{:0>8x},", + self.selector + )?; writeln!(writer, "\t/// or in textual repr: {}", self.selector_str)?; write!(writer, "\tfunction {}(", self.name)?; self.args.solidity_name(writer, tc)?; From 4efa9ce6208121a59a209ff3a1a1dd7c02528cf1 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 12 Jul 2022 18:43:43 +0200 Subject: [PATCH 0569/1274] doc(pallet-evm-contract-helpers): document public api Signed-off-by: Yaroslav Bolyukin --- pallets/evm-contract-helpers/README.md | 13 ++ pallets/evm-contract-helpers/src/eth.rs | 87 ++++++---- pallets/evm-contract-helpers/src/lib.rs | 27 +++- .../src/stubs/ContractHelpers.raw | Bin 1785 -> 1742 bytes .../src/stubs/ContractHelpers.sol | 148 +++++++++++------- tests/src/eth/api/ContractHelpers.sol | 132 ++++++++++------ tests/src/eth/util/contractHelpersAbi.json | 13 -- 7 files changed, 263 insertions(+), 157 deletions(-) create mode 100644 pallets/evm-contract-helpers/README.md diff --git a/pallets/evm-contract-helpers/README.md b/pallets/evm-contract-helpers/README.md new file mode 100644 index 0000000000..f320a12c2c --- /dev/null +++ b/pallets/evm-contract-helpers/README.md @@ -0,0 +1,13 @@ +# EVM Contract Helpers + +This pallet extends pallet-evm contracts with several new functions. + +## Overview + +Evm contract helpers pallet provides ability to + +- Tracking and getting of user, which deployed contract +- Sponsoring EVM contract calls (Make transaction calls to be free for users, instead making them being paid from contract address) +- Allowlist access mode + +As most of those functions are intented to be consumed by ethereum users, only API provided by this pallet is [ContractHelpers magic contract](./src/stubs/ContractHelpers.sol) \ No newline at end of file diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 658db0fe42..63a0a3ce6c 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +//! Implementation of magic contract + use core::marker::PhantomData; use evm_coder::{abi::AbiWriter, execution::Result, generate_stubgen, solidity_interface, types::*}; use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder, dispatch_to_evm}; @@ -31,7 +33,8 @@ use frame_support::traits::Get; use up_sponsorship::SponsorshipHandler; use sp_std::vec::Vec; -struct ContractHelpers(SubstrateRecorder); +/// See [`ContractHelpersCall`] +pub struct ContractHelpers(SubstrateRecorder); impl WithRecorder for ContractHelpers { fn recorder(&self) -> &SubstrateRecorder { &self.0 @@ -42,21 +45,24 @@ impl WithRecorder for ContractHelpers { } } +/// @title Magic contract, which allows users to reconfigure other contracts #[solidity_interface(name = ContractHelpers)] impl ContractHelpers where T::AccountId: AsRef<[u8; 32]>, { - /// Get contract ovner - /// - /// @param contractAddress contract for which the owner is being determined. - /// @return Contract owner. + /// Get user, which deployed specified contract + /// @dev May return zero address in case if contract is deployed + /// using uniquenetwork evm-migration pallet, or using other terms not + /// intended by pallet-evm + /// @dev Returns zero address if contract does not exists + /// @param contractAddress Contract to get owner of + /// @return address Owner of contract fn contract_owner(&self, contract_address: address) -> Result
{ Ok(>::get(contract_address)) } /// Set sponsor. - /// /// @param contractAddress Contract for which a sponsor is being established. /// @param sponsor User address who set as pending sponsor. fn set_sponsor( @@ -163,6 +169,7 @@ where &mut self, caller: caller, contract_address: address, + // TODO: implement support for enums in evm-coder mode: uint8, ) -> Result { self.recorder().consume_sload()?; @@ -175,10 +182,21 @@ where Ok(()) } - fn sponsoring_mode(&self, contract_address: address) -> Result { - Ok(>::sponsoring_mode(contract_address).to_eth()) + /// Get current contract sponsoring rate limit + /// @param contractAddress Contract to get sponsoring mode of + /// @return uint32 Amount of blocks between two sponsored transactions + fn get_sponsoring_rate_limit(&self, contract_address: address) -> Result { + Ok(>::get(contract_address) + .try_into() + .map_err(|_| "rate limit > u32::MAX")?) } + /// Set contract sponsoring rate limit + /// @dev Sponsoring rate limit - is a minimum amount of blocks that should + /// pass between two sponsored transactions + /// @param contractAddress Contract to change sponsoring rate limit of + /// @param rateLimit Target rate limit + /// @dev Only contract owner can change this setting fn set_sponsoring_rate_limit( &mut self, caller: caller, @@ -190,57 +208,70 @@ where >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; >::set_sponsoring_rate_limit(contract_address, rate_limit.into()); - Ok(()) } - fn get_sponsoring_rate_limit(&self, contract_address: address) -> Result { - Ok(>::get(contract_address) - .try_into() - .map_err(|_| "rate limit > u32::MAX")?) - } - + /// Is specified user present in contract allow list + /// @dev Contract owner always implicitly included + /// @param contractAddress Contract to check allowlist of + /// @param user User to check + /// @return bool Is specified users exists in contract allowlist fn allowed(&self, contract_address: address, user: address) -> Result { self.0.consume_sload()?; Ok(>::allowed(contract_address, user)) } - fn allowlist_enabled(&self, contract_address: address) -> Result { - Ok(>::get(contract_address)) - } - - fn toggle_allowlist( + /// Toggle user presence in contract allowlist + /// @param contractAddress Contract to change allowlist of + /// @param user Which user presence should be toggled + /// @param isAllowed `true` if user should be allowed to be sponsored + /// or call this contract, `false` otherwise + /// @dev Only contract owner can change this setting + fn toggle_allowed( &mut self, caller: caller, contract_address: address, - enabled: bool, + user: address, + is_allowed: bool, ) -> Result { self.recorder().consume_sload()?; self.recorder().consume_sstore()?; >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; - >::toggle_allowlist(contract_address, enabled); + >::toggle_allowed(contract_address, user, is_allowed); Ok(()) } - fn toggle_allowed( + /// Is this contract has allowlist access enabled + /// @dev Allowlist always can have users, and it is used for two purposes: + /// in case of allowlist sponsoring mode, users will be sponsored if they exist in allowlist + /// in case of allowlist access enabled, only users from allowlist may call this contract + /// @param contractAddress Contract to get allowlist access of + /// @return bool Is specified contract has allowlist access enabled + fn allowlist_enabled(&self, contract_address: address) -> Result { + Ok(>::get(contract_address)) + } + + /// Toggle contract allowlist access + /// @param contractAddress Contract to change allowlist access of + /// @param enabled Should allowlist access to be enabled? + fn toggle_allowlist( &mut self, caller: caller, contract_address: address, - user: address, - is_allowed: bool, + enabled: bool, ) -> Result { self.recorder().consume_sload()?; self.recorder().consume_sstore()?; >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; - >::toggle_allowed(contract_address, user, is_allowed); - + >::toggle_allowlist(contract_address, enabled); Ok(()) } } +/// Implements [`OnMethodCall`], which delegates call to [`ContractHelpers`] pub struct HelpersOnMethodCall(PhantomData<*const T>); impl OnMethodCall for HelpersOnMethodCall where @@ -283,6 +314,7 @@ where } } +/// Hooks into contract creation, storing owner of newly deployed contract pub struct HelpersOnCreate(PhantomData<*const T>); impl OnCreate for HelpersOnCreate { fn on_create(owner: H160, contract: H160) { @@ -290,6 +322,7 @@ impl OnCreate for HelpersOnCreate { } } +/// Bridge to pallet-sponsoring pub struct HelpersContractSponsoring(PhantomData<*const T>); impl SponsorshipHandler)> for HelpersContractSponsoring diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index 56b1d5b88e..c539c54dcf 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -14,7 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +#![doc = include_str!("../README.md")] #![cfg_attr(not(feature = "std"), no_std)] +#![deny(missing_docs)] use codec::{Decode, Encode, MaxEncodedLen}; pub use pallet::*; @@ -35,13 +37,16 @@ pub mod pallet { pub trait Config: frame_system::Config + pallet_evm_coder_substrate::Config + pallet_evm::account::Config { + /// Address, under which magic contract will be available type ContractAddress: Get; + /// In case of enabled sponsoring, but no sponsoring rate limit set, + /// this value will be used implicitly type DefaultSponsoringRateLimit: Get; } #[pallet::error] pub enum Error { - /// This method is only executable by owner. + /// This method is only executable by contract owner NoPermission, /// No pending sponsor for contract. @@ -217,6 +222,7 @@ pub mod pallet { } } + /// Get current sponsoring mode, performing lazy migration from legacy storage pub fn sponsoring_mode(contract: H160) -> SponsoringModeT { >::get(contract) .or_else(|| { @@ -225,6 +231,7 @@ pub mod pallet { .unwrap_or_default() } + /// Reconfigure contract sponsoring mode pub fn set_sponsoring_mode(contract: H160, mode: SponsoringModeT) { if mode == SponsoringModeT::Disabled { >::remove(contract); @@ -234,22 +241,27 @@ pub mod pallet { >::remove(contract) } + /// Set duration between two sponsored contract calls pub fn set_sponsoring_rate_limit(contract: H160, rate_limit: T::BlockNumber) { >::insert(contract, rate_limit); } + /// Is user added to allowlist, or he is owner of specified contract pub fn allowed(contract: H160, user: H160) -> bool { >::get(&contract, &user) || >::get(&contract) == user } + /// Toggle contract allowlist access pub fn toggle_allowlist(contract: H160, enabled: bool) { >::insert(contract, enabled) } + /// Toggle user presence in contract's allowlist pub fn toggle_allowed(contract: H160, user: H160, allowed: bool) { >::insert(contract, user, allowed); } + /// Throw error if user is not allowed to reconfigure target contract pub fn ensure_owner(contract: H160, user: H160) -> DispatchResult { ensure!(>::get(&contract) == user, Error::::NoPermission); Ok(()) @@ -257,10 +269,15 @@ pub mod pallet { } } -#[derive(Encode, Decode, PartialEq, TypeInfo, MaxEncodedLen)] +/// Available contract sponsoring modes +#[derive(Encode, Decode, PartialEq, TypeInfo, MaxEncodedLen, Default)] pub enum SponsoringModeT { + /// Sponsoring is disabled + #[default] Disabled, + /// Only users from allowlist will be sponsored Allowlisted, + /// All users will be sponsored Generous, } @@ -281,9 +298,3 @@ impl SponsoringModeT { } } } - -impl Default for SponsoringModeT { - fn default() -> Self { - Self::Disabled - } -} diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw index 7d2e5081f0a7b41788ad22f83ad0beff52c5815c..b2a38a375eb4d0262dfea0ef0c44d978bed5db45 100644 GIT binary patch delta 1071 zcmaJ2o%PnLxuPpK@#D_@{5T;;4^c0l%Vub|OgGhp`@0{IhNzk5t-}n9geD^#1Rl8X0 zBg-TjCkKdb7;%ewA5HsAgsSa3D4g1*5+OpCLwa(kqtsPLg$JshoSYF5z^e|dr=ka7 z>Dt<*dWuc~T)W<>INcvjuWW#Opu6>LoB(VFOMOeLID%jXM#InNs{n2Q%x`>r>}c;D zOXV=PbQFE@=@yA?z!(5{8z5=XC$)$D605*0@i8WmgZ1+n2sFGbzFx5;{E5}KfKCMV*9 z&_pf;_poZ1B4=jHcyCuL>w$BnH^Qn(w*obZ_9e^kvkCztPGm$87kr>-k)`qg@rr!| zhf{p8o%L)-^3FYY$~JQyQUrn^slPk;j;sVBNJ3PM6)Y;X@D=m|wzjnYa&-Hs)YulY z2(p-(3k4#lGkCY3ic^)V8xin8WI2c%jDP{JTC#6Rp_I5%85b-iq3IFb?`Jco3CAZ< zGs|pnZG}g1z@*}0LMtc~?Ap&(S%@z;e<3DqUfO{go`42wKkY`Kk0qHBM*JC~jqum4~+*w{Loz<-D%-F8zEvOV2Ol dVrui)@rV8S7hf+w8C?I85kAjdwCB8SzX7CDYd8P^ delta 1075 zcmZ8fTSyd97@jj{T!h?M!`amo9n*{;0;!dXsMUyGgvKRytT8x;#e#}J6YOng_D0r2 zGdn@hg+hpeNU+FmgbId97o?tykbR2mWy^>#lI=gUGo!Zi^8Nq+UH)^HTs zb`)LF(M||n00o0U8vxkTtM>xD29Rv|OdT<;`12CrJ?IYXpFRlijT?-LGk2k`g;CqQ z^b6ntfV-bP>;TC2KjeE`2k?XvQtf1lwo|mVjR=%~9aAZP%$nqD5;2OpSPySzJuRkk z>IxBeLlb$FbF4}_CTvC`T?D~*yA~T}P>&J`QM8A#+$cQ8s8>;Og*-}hFb}e^$v%8gQh`+sPzrkyKud*sddmG z$RGlO5gd>sQZkJ~rLk$qF;xp|q6jm$3D-{| zsSLBhyGlHY+f$TZim9ed@nIsR5yfImHRPO}V-_pH_>`mI7n8Pvxp9P~v$o#_d)lm0 zY^LpT4h(M*DT6%w2P6U&7A>hPl$dezKm4E1wpqRDPnY@EWfCcc!uI3YM;F8rLo?-- zwY`%HI~={Rca?q}3X`IvwkFFODhCvjNCk7Unn?w8Oa;^WQP$)iQ3!$y6s8m^6s$&{ z*ivB2U1EPRLn54-)dM0G78LzRI*Fo21{p)}VzX9{uTd&L`>6ftuGW&i*H diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol index ebecaffc51..b76865911a 100644 --- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol +++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol @@ -3,12 +3,6 @@ pragma solidity >=0.8.0 <0.9.0; -/// @dev anonymous struct -struct Tuple0 { - address field_0; - uint256 field_1; -} - /// @dev common stubs holder contract Dummy { uint8 dummy; @@ -27,14 +21,18 @@ contract ERC165 is Dummy { } } -/// @dev the ERC-165 identifier for this interface is 0x6073d917 +/// @title Magic contract, which allows users to reconfigure other contracts +/// @dev the ERC-165 identifier for this interface is 0xd77fab70 contract ContractHelpers is Dummy, ERC165 { - /// Get contract ovner - /// - /// @param contractAddress contract for which the owner is being determined. - /// @return Contract owner. - /// - /// Selector: contractOwner(address) 5152b14c + /// Get user, which deployed specified contract + /// @dev May return zero address in case if contract is deployed + /// using uniquenetwork evm-migration pallet, or using other terms not + /// intended by pallet-evm + /// @dev Returns zero address if contract does not exists + /// @param contractAddress Contract to get owner of + /// @return address Owner of contract + /// @dev EVM selector for this function is: 0x5152b14c, + /// or in textual repr: contractOwner(address) function contractOwner(address contractAddress) public view @@ -47,11 +45,10 @@ contract ContractHelpers is Dummy, ERC165 { } /// Set sponsor. - /// /// @param contractAddress Contract for which a sponsor is being established. /// @param sponsor User address who set as pending sponsor. - /// - /// Selector: setSponsor(address,address) f01fba93 + /// @dev EVM selector for this function is: 0xf01fba93, + /// or in textual repr: setSponsor(address,address) function setSponsor(address contractAddress, address sponsor) public { require(false, stub_error); contractAddress; @@ -62,8 +59,8 @@ contract ContractHelpers is Dummy, ERC165 { /// Set contract as self sponsored. /// /// @param contractAddress Contract for which a self sponsoring is being enabled. - /// - /// Selector: selfSponsoredEnable(address) 89f7d9ae + /// @dev EVM selector for this function is: 0x89f7d9ae, + /// or in textual repr: selfSponsoredEnable(address) function selfSponsoredEnable(address contractAddress) public { require(false, stub_error); contractAddress; @@ -73,8 +70,8 @@ contract ContractHelpers is Dummy, ERC165 { /// Remove sponsor. /// /// @param contractAddress Contract for which a sponsorship is being removed. - /// - /// Selector: removeSponsor(address) ef784250 + /// @dev EVM selector for this function is: 0xef784250, + /// or in textual repr: removeSponsor(address) function removeSponsor(address contractAddress) public { require(false, stub_error); contractAddress; @@ -86,8 +83,8 @@ contract ContractHelpers is Dummy, ERC165 { /// @dev Caller must be same that set via [`setSponsor`]. /// /// @param contractAddress Сontract for which need to confirm sponsorship. - /// - /// Selector: confirmSponsorship(address) abc00001 + /// @dev EVM selector for this function is: 0xabc00001, + /// or in textual repr: confirmSponsorship(address) function confirmSponsorship(address contractAddress) public { require(false, stub_error); contractAddress; @@ -98,8 +95,8 @@ contract ContractHelpers is Dummy, ERC165 { /// /// @param contractAddress The contract for which a sponsor is requested. /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - /// - /// Selector: getSponsor(address) 743fc745 + /// @dev EVM selector for this function is: 0x743fc745, + /// or in textual repr: getSponsor(address) function getSponsor(address contractAddress) public view @@ -115,8 +112,8 @@ contract ContractHelpers is Dummy, ERC165 { /// /// @param contractAddress The contract for which the presence of a confirmed sponsor is checked. /// @return **true** if contract has confirmed sponsor. - /// - /// Selector: hasSponsor(address) 97418603 + /// @dev EVM selector for this function is: 0x97418603, + /// or in textual repr: hasSponsor(address) function hasSponsor(address contractAddress) public view returns (bool) { require(false, stub_error); contractAddress; @@ -128,8 +125,8 @@ contract ContractHelpers is Dummy, ERC165 { /// /// @param contractAddress The contract for which the presence of a pending sponsor is checked. /// @return **true** if contract has pending sponsor. - /// - /// Selector: hasPendingSponsor(address) 39b9b242 + /// @dev EVM selector for this function is: 0x39b9b242, + /// or in textual repr: hasPendingSponsor(address) function hasPendingSponsor(address contractAddress) public view @@ -141,7 +138,8 @@ contract ContractHelpers is Dummy, ERC165 { return false; } - /// Selector: sponsoringEnabled(address) 6027dc61 + /// @dev EVM selector for this function is: 0x6027dc61, + /// or in textual repr: sponsoringEnabled(address) function sponsoringEnabled(address contractAddress) public view @@ -153,7 +151,8 @@ contract ContractHelpers is Dummy, ERC165 { return false; } - /// Selector: setSponsoringMode(address,uint8) fde8a560 + /// @dev EVM selector for this function is: 0xfde8a560, + /// or in textual repr: setSponsoringMode(address,uint8) function setSponsoringMode(address contractAddress, uint8 mode) public { require(false, stub_error); contractAddress; @@ -161,11 +160,15 @@ contract ContractHelpers is Dummy, ERC165 { dummy = 0; } - /// Selector: sponsoringMode(address) b70c7267 - function sponsoringMode(address contractAddress) + /// Get current contract sponsoring rate limit + /// @param contractAddress Contract to get sponsoring mode of + /// @return uint32 Amount of blocks between two sponsored transactions + /// @dev EVM selector for this function is: 0x610cfabd, + /// or in textual repr: getSponsoringRateLimit(address) + function getSponsoringRateLimit(address contractAddress) public view - returns (uint8) + returns (uint32) { require(false, stub_error); contractAddress; @@ -173,7 +176,14 @@ contract ContractHelpers is Dummy, ERC165 { return 0; } - /// Selector: setSponsoringRateLimit(address,uint32) 77b6c908 + /// Set contract sponsoring rate limit + /// @dev Sponsoring rate limit - is a minimum amount of blocks that should + /// pass between two sponsored transactions + /// @param contractAddress Contract to change sponsoring rate limit of + /// @param rateLimit Target rate limit + /// @dev Only contract owner can change this setting + /// @dev EVM selector for this function is: 0x77b6c908, + /// or in textual repr: setSponsoringRateLimit(address,uint32) function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) public { @@ -183,32 +193,53 @@ contract ContractHelpers is Dummy, ERC165 { dummy = 0; } - /// Selector: getSponsoringRateLimit(address) 610cfabd - function getSponsoringRateLimit(address contractAddress) + /// Is specified user present in contract allow list + /// @dev Contract owner always implicitly included + /// @param contractAddress Contract to check allowlist of + /// @param user User to check + /// @return bool Is specified users exists in contract allowlist + /// @dev EVM selector for this function is: 0x5c658165, + /// or in textual repr: allowed(address,address) + function allowed(address contractAddress, address user) public view - returns (uint32) + returns (bool) { require(false, stub_error); contractAddress; + user; dummy; - return 0; + return false; } - /// Selector: allowed(address,address) 5c658165 - function allowed(address contractAddress, address user) - public - view - returns (bool) - { + /// Toggle user presence in contract allowlist + /// @param contractAddress Contract to change allowlist of + /// @param user Which user presence should be toggled + /// @param isAllowed `true` if user should be allowed to be sponsored + /// or call this contract, `false` otherwise + /// @dev Only contract owner can change this setting + /// @dev EVM selector for this function is: 0x4706cc1c, + /// or in textual repr: toggleAllowed(address,address,bool) + function toggleAllowed( + address contractAddress, + address user, + bool isAllowed + ) public { require(false, stub_error); contractAddress; user; - dummy; - return false; + isAllowed; + dummy = 0; } - /// Selector: allowlistEnabled(address) c772ef6c + /// Is this contract has allowlist access enabled + /// @dev Allowlist always can have users, and it is used for two purposes: + /// in case of allowlist sponsoring mode, users will be sponsored if they exist in allowlist + /// in case of allowlist access enabled, only users from allowlist may call this contract + /// @param contractAddress Contract to get allowlist access of + /// @return bool Is specified contract has allowlist access enabled + /// @dev EVM selector for this function is: 0xc772ef6c, + /// or in textual repr: allowlistEnabled(address) function allowlistEnabled(address contractAddress) public view @@ -220,24 +251,21 @@ contract ContractHelpers is Dummy, ERC165 { return false; } - /// Selector: toggleAllowlist(address,bool) 36de20f5 + /// Toggle contract allowlist access + /// @param contractAddress Contract to change allowlist access of + /// @param enabled Should allowlist access to be enabled? + /// @dev EVM selector for this function is: 0x36de20f5, + /// or in textual repr: toggleAllowlist(address,bool) function toggleAllowlist(address contractAddress, bool enabled) public { require(false, stub_error); contractAddress; enabled; dummy = 0; } +} - /// Selector: toggleAllowed(address,address,bool) 4706cc1c - function toggleAllowed( - address contractAddress, - address user, - bool isAllowed - ) public { - require(false, stub_error); - contractAddress; - user; - isAllowed; - dummy = 0; - } +/// @dev anonymous struct +struct Tuple0 { + address field_0; + uint256 field_1; } diff --git a/tests/src/eth/api/ContractHelpers.sol b/tests/src/eth/api/ContractHelpers.sol index fa37be6326..7a124bf1e7 100644 --- a/tests/src/eth/api/ContractHelpers.sol +++ b/tests/src/eth/api/ContractHelpers.sol @@ -3,12 +3,6 @@ pragma solidity >=0.8.0 <0.9.0; -/// @dev anonymous struct -struct Tuple0 { - address field_0; - uint256 field_1; -} - /// @dev common stubs holder interface Dummy { @@ -18,39 +12,42 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } -/// @dev the ERC-165 identifier for this interface is 0x6073d917 +/// @title Magic contract, which allows users to reconfigure other contracts +/// @dev the ERC-165 identifier for this interface is 0xd77fab70 interface ContractHelpers is Dummy, ERC165 { - /// Get contract ovner - /// - /// @param contractAddress contract for which the owner is being determined. - /// @return Contract owner. - /// - /// Selector: contractOwner(address) 5152b14c + /// Get user, which deployed specified contract + /// @dev May return zero address in case if contract is deployed + /// using uniquenetwork evm-migration pallet, or using other terms not + /// intended by pallet-evm + /// @dev Returns zero address if contract does not exists + /// @param contractAddress Contract to get owner of + /// @return address Owner of contract + /// @dev EVM selector for this function is: 0x5152b14c, + /// or in textual repr: contractOwner(address) function contractOwner(address contractAddress) external view returns (address); /// Set sponsor. - /// /// @param contractAddress Contract for which a sponsor is being established. /// @param sponsor User address who set as pending sponsor. - /// - /// Selector: setSponsor(address,address) f01fba93 + /// @dev EVM selector for this function is: 0xf01fba93, + /// or in textual repr: setSponsor(address,address) function setSponsor(address contractAddress, address sponsor) external; /// Set contract as self sponsored. /// /// @param contractAddress Contract for which a self sponsoring is being enabled. - /// - /// Selector: selfSponsoredEnable(address) 89f7d9ae + /// @dev EVM selector for this function is: 0x89f7d9ae, + /// or in textual repr: selfSponsoredEnable(address) function selfSponsoredEnable(address contractAddress) external; /// Remove sponsor. /// /// @param contractAddress Contract for which a sponsorship is being removed. - /// - /// Selector: removeSponsor(address) ef784250 + /// @dev EVM selector for this function is: 0xef784250, + /// or in textual repr: removeSponsor(address) function removeSponsor(address contractAddress) external; /// Confirm sponsorship. @@ -58,16 +55,16 @@ interface ContractHelpers is Dummy, ERC165 { /// @dev Caller must be same that set via [`setSponsor`]. /// /// @param contractAddress Сontract for which need to confirm sponsorship. - /// - /// Selector: confirmSponsorship(address) abc00001 + /// @dev EVM selector for this function is: 0xabc00001, + /// or in textual repr: confirmSponsorship(address) function confirmSponsorship(address contractAddress) external; /// Get current sponsor. /// /// @param contractAddress The contract for which a sponsor is requested. /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - /// - /// Selector: getSponsor(address) 743fc745 + /// @dev EVM selector for this function is: 0x743fc745, + /// or in textual repr: getSponsor(address) function getSponsor(address contractAddress) external view @@ -77,65 +74,102 @@ interface ContractHelpers is Dummy, ERC165 { /// /// @param contractAddress The contract for which the presence of a confirmed sponsor is checked. /// @return **true** if contract has confirmed sponsor. - /// - /// Selector: hasSponsor(address) 97418603 + /// @dev EVM selector for this function is: 0x97418603, + /// or in textual repr: hasSponsor(address) function hasSponsor(address contractAddress) external view returns (bool); /// Check tat contract has pending sponsor. /// /// @param contractAddress The contract for which the presence of a pending sponsor is checked. /// @return **true** if contract has pending sponsor. - /// - /// Selector: hasPendingSponsor(address) 39b9b242 + /// @dev EVM selector for this function is: 0x39b9b242, + /// or in textual repr: hasPendingSponsor(address) function hasPendingSponsor(address contractAddress) external view returns (bool); - /// Selector: sponsoringEnabled(address) 6027dc61 + /// @dev EVM selector for this function is: 0x6027dc61, + /// or in textual repr: sponsoringEnabled(address) function sponsoringEnabled(address contractAddress) external view returns (bool); - /// Selector: setSponsoringMode(address,uint8) fde8a560 + /// @dev EVM selector for this function is: 0xfde8a560, + /// or in textual repr: setSponsoringMode(address,uint8) function setSponsoringMode(address contractAddress, uint8 mode) external; - /// Selector: sponsoringMode(address) b70c7267 - function sponsoringMode(address contractAddress) + /// Get current contract sponsoring rate limit + /// @param contractAddress Contract to get sponsoring mode of + /// @return uint32 Amount of blocks between two sponsored transactions + /// @dev EVM selector for this function is: 0x610cfabd, + /// or in textual repr: getSponsoringRateLimit(address) + function getSponsoringRateLimit(address contractAddress) external view - returns (uint8); + returns (uint32); - /// Selector: setSponsoringRateLimit(address,uint32) 77b6c908 + /// Set contract sponsoring rate limit + /// @dev Sponsoring rate limit - is a minimum amount of blocks that should + /// pass between two sponsored transactions + /// @param contractAddress Contract to change sponsoring rate limit of + /// @param rateLimit Target rate limit + /// @dev Only contract owner can change this setting + /// @dev EVM selector for this function is: 0x77b6c908, + /// or in textual repr: setSponsoringRateLimit(address,uint32) function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) external; - /// Selector: getSponsoringRateLimit(address) 610cfabd - function getSponsoringRateLimit(address contractAddress) - external - view - returns (uint32); - - /// Selector: allowed(address,address) 5c658165 + /// Is specified user present in contract allow list + /// @dev Contract owner always implicitly included + /// @param contractAddress Contract to check allowlist of + /// @param user User to check + /// @return bool Is specified users exists in contract allowlist + /// @dev EVM selector for this function is: 0x5c658165, + /// or in textual repr: allowed(address,address) function allowed(address contractAddress, address user) external view returns (bool); - /// Selector: allowlistEnabled(address) c772ef6c + /// Toggle user presence in contract allowlist + /// @param contractAddress Contract to change allowlist of + /// @param user Which user presence should be toggled + /// @param isAllowed `true` if user should be allowed to be sponsored + /// or call this contract, `false` otherwise + /// @dev Only contract owner can change this setting + /// @dev EVM selector for this function is: 0x4706cc1c, + /// or in textual repr: toggleAllowed(address,address,bool) + function toggleAllowed( + address contractAddress, + address user, + bool isAllowed + ) external; + + /// Is this contract has allowlist access enabled + /// @dev Allowlist always can have users, and it is used for two purposes: + /// in case of allowlist sponsoring mode, users will be sponsored if they exist in allowlist + /// in case of allowlist access enabled, only users from allowlist may call this contract + /// @param contractAddress Contract to get allowlist access of + /// @return bool Is specified contract has allowlist access enabled + /// @dev EVM selector for this function is: 0xc772ef6c, + /// or in textual repr: allowlistEnabled(address) function allowlistEnabled(address contractAddress) external view returns (bool); - /// Selector: toggleAllowlist(address,bool) 36de20f5 + /// Toggle contract allowlist access + /// @param contractAddress Contract to change allowlist access of + /// @param enabled Should allowlist access to be enabled? + /// @dev EVM selector for this function is: 0x36de20f5, + /// or in textual repr: toggleAllowlist(address,bool) function toggleAllowlist(address contractAddress, bool enabled) external; +} - /// Selector: toggleAllowed(address,address,bool) 4706cc1c - function toggleAllowed( - address contractAddress, - address user, - bool isAllowed - ) external; +/// @dev anonymous struct +struct Tuple0 { + address field_0; + uint256 field_1; } diff --git a/tests/src/eth/util/contractHelpersAbi.json b/tests/src/eth/util/contractHelpersAbi.json index 55cc33acf5..c3cd1fd091 100644 --- a/tests/src/eth/util/contractHelpersAbi.json +++ b/tests/src/eth/util/contractHelpersAbi.json @@ -195,19 +195,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "contractAddress", - "type": "address" - } - ], - "name": "sponsoringMode", - "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" } From dced9b9b78b460de069b212450363dfaf425461f Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 12 Jul 2022 18:44:35 +0200 Subject: [PATCH 0570/1274] feat(evm-coder): apply interface docs to generated call Previously, generated `Call` enum had no documentation, and documentation on interface items was only kept in generated solidity interfaces. Now all documentation will be moved from impl items to generated `Call` enum Signed-off-by: Yaroslav Bolyukin --- .../evm-coder/procedural/src/solidity_interface.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/evm-coder/procedural/src/solidity_interface.rs b/crates/evm-coder/procedural/src/solidity_interface.rs index e58bbaf719..1ab5c07e22 100644 --- a/crates/evm-coder/procedural/src/solidity_interface.rs +++ b/crates/evm-coder/procedural/src/solidity_interface.rs @@ -627,9 +627,12 @@ impl Method { .filter(|a| !a.is_special()) .map(|a| a.expand_call_def()); let pascal_name = &self.pascal_name; + let docs = &self.docs; if self.has_normal_args { quote! { + #(#[doc = #docs])* + #[allow(missing_docs)] #pascal_name { #( #defs, @@ -764,7 +767,7 @@ impl Method { .iter() .filter(|a| !a.is_special()) .map(MethodArg::expand_solidity_argument); - let docs = self.docs.iter(); + let docs = &self.docs; let selector_str = &self.selector_str; let selector = self.selector; @@ -936,7 +939,7 @@ impl SolidityInterface { .map(|is| Is::expand_generator(is, &gen_ref)); let solidity_event_generators = self.info.events.0.iter().map(Is::expand_event_generator); - let docs = self.docs.iter(); + let docs = &self.docs; if let Some(expect_selector) = &self.info.expect_selector { if !self.info.inline_is.0.is_empty() { @@ -964,7 +967,9 @@ impl SolidityInterface { quote! { #[derive(Debug)] + #(#[doc = #docs])* pub enum #call_name #gen_ref { + /// Inherited method ERC165Call(::evm_coder::ERC165Call, ::core::marker::PhantomData<#gen_data>), #( #calls, @@ -977,12 +982,14 @@ impl SolidityInterface { #( #consts )* + /// Return this call ERC165 selector pub fn interface_id() -> ::evm_coder::types::bytes4 { let mut interface_id = 0; #(#interface_id)* #(#inline_interface_id)* u32::to_be_bytes(interface_id) } + /// Is this contract implements specified ERC165 selector pub fn supports_interface(interface_id: ::evm_coder::types::bytes4) -> bool { interface_id != u32::to_be_bytes(0xffffff) && ( interface_id == ::evm_coder::ERC165Call::INTERFACE_ID || @@ -992,6 +999,7 @@ impl SolidityInterface { )* ) } + /// Generate solidity definitions for methods described in this interface pub fn generate_solidity_interface(tc: &evm_coder::solidity::TypeCollector, is_impl: bool) { use evm_coder::solidity::*; use core::fmt::Write; From 19dbab98f182f3ae7b6a1186d43a8a3cc6c5037e Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 12 Jul 2022 18:51:31 +0200 Subject: [PATCH 0571/1274] style: allow missing docs in weights Signed-off-by: Yaroslav Bolyukin --- .maintain/frame-weight-template.hbs | 1 + 1 file changed, 1 insertion(+) diff --git a/.maintain/frame-weight-template.hbs b/.maintain/frame-weight-template.hbs index 09eccff3a9..0ec6414a55 100644 --- a/.maintain/frame-weight-template.hbs +++ b/.maintain/frame-weight-template.hbs @@ -14,6 +14,7 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] +#![allow(missing_docs)] #![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; From 68058b4890a6ade3cb0d3aee26f23609e5b658fb Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 12 Jul 2022 18:51:57 +0200 Subject: [PATCH 0572/1274] doc(pallet-evm-migration): document public api Signed-off-by: Yaroslav Bolyukin --- pallets/evm-migration/README.md | 18 ++++++++++++++++++ pallets/evm-migration/src/benchmarking.rs | 2 ++ pallets/evm-migration/src/lib.rs | 13 +++++++++++++ pallets/evm-migration/src/weights.rs | 1 + 4 files changed, 34 insertions(+) create mode 100644 pallets/evm-migration/README.md diff --git a/pallets/evm-migration/README.md b/pallets/evm-migration/README.md new file mode 100644 index 0000000000..ace6de8f0f --- /dev/null +++ b/pallets/evm-migration/README.md @@ -0,0 +1,18 @@ +# EVM contract migration pallet + +This pallet is only callable by root, it has functionality to migrate contract +from other ethereum chain to pallet-evm + +Contract data includes contract code, and contract storage, +where contract storage is a mapping from evm word to evm word (evm word = 32 byte) + +To import contract data into pallet-evm admin should call this pallet multiple times: +1. Start migration via `begin` +2. Insert all contract data using single or + multiple (If data can't be fit into single extrinsic) calls + to `set_data` +3. Finish migration using `finish`, providing contract code + +During migration no one can insert code at address of this contract, +as [`pallet::OnMethodCall`] prevents this, and no one can call this contract, +as code is only supplied at final stage of contract deployment \ No newline at end of file diff --git a/pallets/evm-migration/src/benchmarking.rs b/pallets/evm-migration/src/benchmarking.rs index cfe44d5cc1..247953105e 100644 --- a/pallets/evm-migration/src/benchmarking.rs +++ b/pallets/evm-migration/src/benchmarking.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +#![allow(missing_docs)] + use super::{Call, Config, Pallet}; use frame_benchmarking::benchmarks; use frame_system::RawOrigin; diff --git a/pallets/evm-migration/src/lib.rs b/pallets/evm-migration/src/lib.rs index 598cc921a4..795f23f44a 100644 --- a/pallets/evm-migration/src/lib.rs +++ b/pallets/evm-migration/src/lib.rs @@ -14,7 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +#![doc = include_str!("../README.md")] #![cfg_attr(not(feature = "std"), no_std)] +#![deny(missing_docs)] pub use pallet::*; #[cfg(feature = "runtime-benchmarks")] @@ -32,6 +34,7 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config + pallet_evm::Config { + /// Weights type WeightInfo: WeightInfo; } @@ -43,7 +46,9 @@ pub mod pallet { #[pallet::error] pub enum Error { + /// Can only migrate to empty address. AccountNotEmpty, + /// Migration of this account is not yet started, or already finished. AccountIsNotMigrating, } @@ -53,6 +58,8 @@ pub mod pallet { #[pallet::call] impl Pallet { + /// Start contract migration, inserts contract stub at target address, + /// and marks account as pending, allowing to insert storage #[pallet::weight(>::begin())] pub fn begin(origin: OriginFor, address: H160) -> DispatchResult { ensure_root(origin)?; @@ -65,6 +72,8 @@ pub mod pallet { Ok(()) } + /// Insert items into contract storage, this method can be called + /// multiple times #[pallet::weight(>::set_data(data.len() as u32))] pub fn set_data( origin: OriginFor, @@ -83,6 +92,9 @@ pub mod pallet { Ok(()) } + /// Finish contract migration, allows it to be called. + /// It is not possible to alter contract storage via [`Self::set_data`] + /// after this call. #[pallet::weight(>::finish(code.len() as u32))] pub fn finish(origin: OriginFor, address: H160, code: Vec) -> DispatchResult { ensure_root(origin)?; @@ -97,6 +109,7 @@ pub mod pallet { } } + /// Implements [`pallet_evm::OnMethodCall`], which reserves accounts with pending migration pub struct OnMethodCall(PhantomData); impl pallet_evm::OnMethodCall for OnMethodCall { fn is_reserved(contract: &H160) -> bool { diff --git a/pallets/evm-migration/src/weights.rs b/pallets/evm-migration/src/weights.rs index 2b4dacb736..82969f2fa4 100644 --- a/pallets/evm-migration/src/weights.rs +++ b/pallets/evm-migration/src/weights.rs @@ -26,6 +26,7 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] +#![allow(missing_docs)] #![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; From 40ef8e0c0f72257454ae794755a865a5a352a34e Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 12 Jul 2022 19:00:52 +0200 Subject: [PATCH 0573/1274] doc(pallet-evm-transaction-payment): document public api Signed-off-by: Yaroslav Bolyukin --- pallets/evm-transaction-payment/README.md | 5 +++++ pallets/evm-transaction-payment/src/lib.rs | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 pallets/evm-transaction-payment/README.md diff --git a/pallets/evm-transaction-payment/README.md b/pallets/evm-transaction-payment/README.md new file mode 100644 index 0000000000..6ecc640857 --- /dev/null +++ b/pallets/evm-transaction-payment/README.md @@ -0,0 +1,5 @@ +# Evm transaction payment pallet + +pallet-evm-transaction-payment is a bridge between pallet-evm substrate calls and pallet-sponsoring. +It doesn't provide any sponsoring logic by itself, instead all sponsoring handlers +are loosly coupled via [`Config::EvmSponsorshipHandler`] trait. \ No newline at end of file diff --git a/pallets/evm-transaction-payment/src/lib.rs b/pallets/evm-transaction-payment/src/lib.rs index 1343a0948a..eee7b20df1 100644 --- a/pallets/evm-transaction-payment/src/lib.rs +++ b/pallets/evm-transaction-payment/src/lib.rs @@ -14,7 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +#![doc = include_str!("../README.md")] #![cfg_attr(not(feature = "std"), no_std)] +#![deny(missing_docs)] use core::marker::PhantomData; use fp_evm::WithdrawReason; @@ -29,13 +31,12 @@ use up_sponsorship::SponsorshipHandler; pub mod pallet { use super::*; - use frame_support::traits::Currency; use sp_std::vec::Vec; #[pallet::config] pub trait Config: frame_system::Config + pallet_evm::account::Config { + /// Loosly-coupled handlers for evm call sponsoring type EvmSponsorshipHandler: SponsorshipHandler)>; - type Currency: Currency; } #[pallet::pallet] @@ -43,6 +44,7 @@ pub mod pallet { pub struct Pallet(_); } +/// Implements [`fp_evm::TransactionValidityHack`], which provides sponsor address to pallet-evm pub struct TransactionValidityHack(PhantomData<*const T>); impl fp_evm::TransactionValidityHack for TransactionValidityHack { fn who_pays_fee(origin: H160, reason: &WithdrawReason) -> Option { From c89a3faebe76c75ef317cc857bc9881243f1f105 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 12 Jul 2022 19:03:18 +0200 Subject: [PATCH 0574/1274] doc(node): fix ChainSpec reference Signed-off-by: Yaroslav Bolyukin --- node/cli/src/chain_spec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/cli/src/chain_spec.rs b/node/cli/src/chain_spec.rs index 3790f71d0c..8c9017f02d 100644 --- a/node/cli/src/chain_spec.rs +++ b/node/cli/src/chain_spec.rs @@ -115,7 +115,7 @@ pub fn get_from_seed(seed: &str) -> ::Pu .public() } -/// The extensions for the [`ChainSpec`]. +/// The extensions for the [`DefaultChainSpec`]. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)] #[serde(deny_unknown_fields)] pub struct Extensions { From 5af31166e6dbea77661c2cc18234e08149a64c3c Mon Sep 17 00:00:00 2001 From: Greg Zaitsev Date: Fri, 19 Aug 2022 19:02:12 +0300 Subject: [PATCH 0575/1274] doc: clarification review --- crates/evm-coder/procedural/src/solidity_interface.rs | 7 +++++++ crates/evm-coder/src/execution.rs | 2 +- crates/evm-coder/src/lib.rs | 11 ++++++----- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/crates/evm-coder/procedural/src/solidity_interface.rs b/crates/evm-coder/procedural/src/solidity_interface.rs index 1ab5c07e22..fe206e76e6 100644 --- a/crates/evm-coder/procedural/src/solidity_interface.rs +++ b/crates/evm-coder/procedural/src/solidity_interface.rs @@ -16,6 +16,10 @@ #![allow(dead_code)] +// NOTE: In order to understand this Rust macro better, first read this chapter +// about Procedural Macros in Rust book: +// https://doc.rust-lang.org/reference/procedural-macros.html + use quote::{quote, ToTokens}; use inflector::cases; use std::fmt::Write; @@ -485,6 +489,8 @@ enum Mutability { Pure, } +/// Group all keywords for this macro. Usage example: +/// #[solidity_interface(name = "B", inline_is(A))] mod kw { syn::custom_keyword!(weight); @@ -498,6 +504,7 @@ mod kw { syn::custom_keyword!(rename_selector); } +/// Rust methods are parsed into this structure when Solidity code is generated struct Method { name: Ident, camel_name: String, diff --git a/crates/evm-coder/src/execution.rs b/crates/evm-coder/src/execution.rs index 6ad0e544b7..cd38d18d1e 100644 --- a/crates/evm-coder/src/execution.rs +++ b/crates/evm-coder/src/execution.rs @@ -78,7 +78,7 @@ impl PostDispatchInfo { info.weight - self.calc_actual_weight(info) } - /// Calculate actual cansumed weight, saturating to weight reported + /// Calculate actual consumed weight, saturating to weight reported /// pre-dispatch pub fn calc_actual_weight(&self, info: &DispatchInfo) -> Weight { if let Some(actual_weight) = self.actual_weight { diff --git a/crates/evm-coder/src/lib.rs b/crates/evm-coder/src/lib.rs index 00d501d789..3e254296d0 100644 --- a/crates/evm-coder/src/lib.rs +++ b/crates/evm-coder/src/lib.rs @@ -34,17 +34,18 @@ pub mod execution; /// /// `#[solidity_interface(name, is, inline_is, events)]` /// - *name* - used in generated code, and for Call enum name -/// - *is* - used to provide call inheritance, not found methods will be delegated to all contracts -/// specified in is/inline_is -/// - *inline_is* - same as is, but selectors for passed contracts will be used by derived ERC165 -/// implementation +/// - *is* - used to provide inheritance in Solidity +/// - *inline_is* - same as `is`, but ERC165::SupportsInterface will work differently: For `is` SupportsInterface(A) will return true +/// if A is one of the interfaces the contract is inherited from (e.g. B is created as `is(A)`). If B is created as `inline_is(A)` +/// SupportsInterface(A) will internally create a new interface that combines all methods of A and B, so SupportsInterface(A) will return +/// false. /// /// `#[weight(value)]` /// Can be added to every method of impl block, used for deriving [`crate::Weighted`], which /// is used by substrate bridge. /// - *value*: expression, which evaluates to weight required to call this method. /// This expression can use call arguments to calculate non-constant execution time. -/// This expression should evaluate faster than actual execution does, and may provide worser case +/// This expression should evaluate faster than actual execution does, and may provide worse case /// than one is called. /// /// `#[solidity_interface(rename_selector)]` From 625c503244604a7119068d47ceeace05318d250e Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 25 Aug 2022 16:30:05 +0300 Subject: [PATCH 0576/1274] chore: remove unused config param Signed-off-by: Yaroslav Bolyukin --- runtime/common/config/ethereum.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/common/config/ethereum.rs b/runtime/common/config/ethereum.rs index c70883df36..26dee6bece 100644 --- a/runtime/common/config/ethereum.rs +++ b/runtime/common/config/ethereum.rs @@ -120,5 +120,4 @@ impl pallet_evm_coder_substrate::Config for Runtime {} impl pallet_evm_transaction_payment::Config for Runtime { type EvmSponsorshipHandler = EvmSponsorshipHandler; - type Currency = Balances; } From 02857307a238c6c60e096c0ccbac955a4a9a13aa Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 4 Aug 2022 13:04:01 +0000 Subject: [PATCH 0577/1274] path: Return sponsor as a tuple. --- pallets/evm-contract-helpers/src/eth.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 63a0a3ce6c..fbedba302e 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -357,7 +357,7 @@ impl SponsorshipHandler)> >::insert(contract_address, who.as_eth(), block_number); - Some(sponsor) + Some(sponsor) } } From f9d5d231c21ac891ef29e230329e6df6f2d1a705 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 5 Aug 2022 12:45:55 +0000 Subject: [PATCH 0578/1274] path: add stubs --- .../src/stubs/ContractHelpers.sol | 83 +++++++++++++++++++ tests/src/eth/api/ContractHelpers.sol | 58 +++++++++++++ tests/src/eth/util/contractHelpersAbi.json | 3 + 3 files changed, 144 insertions(+) diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol index b76865911a..55df2910ea 100644 --- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol +++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol @@ -21,8 +21,16 @@ contract ERC165 is Dummy { } } +<<<<<<< HEAD /// @title Magic contract, which allows users to reconfigure other contracts /// @dev the ERC-165 identifier for this interface is 0xd77fab70 +======= +<<<<<<< HEAD +// Selector: 6073d917 +======= +// Selector: 06fc42e9 +>>>>>>> path: add stubs +>>>>>>> path: add stubs contract ContractHelpers is Dummy, ERC165 { /// Get user, which deployed specified contract /// @dev May return zero address in case if contract is deployed @@ -44,11 +52,23 @@ contract ContractHelpers is Dummy, ERC165 { return 0x0000000000000000000000000000000000000000; } +<<<<<<< HEAD /// Set sponsor. /// @param contractAddress Contract for which a sponsor is being established. /// @param sponsor User address who set as pending sponsor. /// @dev EVM selector for this function is: 0xf01fba93, /// or in textual repr: setSponsor(address,address) +======= +<<<<<<< HEAD + // Set sponsor. + // + // @param contract_address Contract for which a sponsor is being established. + // @param sponsor User address who set as pending sponsor. + // +======= +>>>>>>> path: add stubs + // Selector: setSponsor(address,address) f01fba93 +>>>>>>> path: add stubs function setSponsor(address contractAddress, address sponsor) public { require(false, stub_error); contractAddress; @@ -56,22 +76,44 @@ contract ContractHelpers is Dummy, ERC165 { dummy = 0; } +<<<<<<< HEAD /// Set contract as self sponsored. /// /// @param contractAddress Contract for which a self sponsoring is being enabled. /// @dev EVM selector for this function is: 0x89f7d9ae, /// or in textual repr: selfSponsoredEnable(address) +======= +<<<<<<< HEAD + // Set contract as self sponsored. + // + // @param contract_address Contract for which a self sponsoring is being enabled. + // + // Selector: selfSponsoredEnable(address) 89f7d9ae +>>>>>>> path: add stubs function selfSponsoredEnable(address contractAddress) public { +======= + // Selector: confirmSponsorship(address) abc00001 + function confirmSponsorship(address contractAddress) public { +>>>>>>> path: add stubs require(false, stub_error); contractAddress; dummy = 0; } +<<<<<<< HEAD /// Remove sponsor. /// /// @param contractAddress Contract for which a sponsorship is being removed. /// @dev EVM selector for this function is: 0xef784250, /// or in textual repr: removeSponsor(address) +======= +<<<<<<< HEAD + // Remove sponsor. + // + // @param contract_address Contract for which a sponsorship is being removed. + // + // Selector: removeSponsor(address) ef784250 +>>>>>>> path: add stubs function removeSponsor(address contractAddress) public { require(false, stub_error); contractAddress; @@ -97,6 +139,9 @@ contract ContractHelpers is Dummy, ERC165 { /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. /// @dev EVM selector for this function is: 0x743fc745, /// or in textual repr: getSponsor(address) + function getSponsor(address contractAddress) +======= + // Selector: getSponsor(address) 743fc745 function getSponsor(address contractAddress) public view @@ -108,6 +153,27 @@ contract ContractHelpers is Dummy, ERC165 { return Tuple0(0x0000000000000000000000000000000000000000, 0); } + // Selector: hasSponsor(address) 97418603 + function hasSponsor(address contractAddress) public view returns (bool) { + require(false, stub_error); + contractAddress; + dummy; + return false; + } + + // Selector: hasPendingSponsor(address) 39b9b242 + function hasPendingSponsor(address contractAddress) +>>>>>>> path: add stubs + public + view + returns (Tuple0 memory) + { + require(false, stub_error); + contractAddress; + dummy; + return Tuple0(0x0000000000000000000000000000000000000000, 0); + } + /// Check tat contract has confirmed sponsor. /// /// @param contractAddress The contract for which the presence of a confirmed sponsor is checked. @@ -121,13 +187,27 @@ contract ContractHelpers is Dummy, ERC165 { return false; } +<<<<<<< HEAD /// Check tat contract has pending sponsor. /// /// @param contractAddress The contract for which the presence of a pending sponsor is checked. /// @return **true** if contract has pending sponsor. /// @dev EVM selector for this function is: 0x39b9b242, /// or in textual repr: hasPendingSponsor(address) +======= +<<<<<<< HEAD + // Check tat contract has pending sponsor. + // + // @param contract_address The contract for which the presence of a pending sponsor is checked. + // @return **true** if contract has pending sponsor. + // + // Selector: hasPendingSponsor(address) 39b9b242 +>>>>>>> path: add stubs function hasPendingSponsor(address contractAddress) +======= + // Selector: sponsoringEnabled(address) 6027dc61 + function sponsoringEnabled(address contractAddress) +>>>>>>> path: add stubs public view returns (bool) @@ -136,6 +216,7 @@ contract ContractHelpers is Dummy, ERC165 { contractAddress; dummy; return false; +<<<<<<< HEAD } /// @dev EVM selector for this function is: 0x6027dc61, @@ -149,6 +230,8 @@ contract ContractHelpers is Dummy, ERC165 { contractAddress; dummy; return false; +======= +>>>>>>> path: add stubs } /// @dev EVM selector for this function is: 0xfde8a560, diff --git a/tests/src/eth/api/ContractHelpers.sol b/tests/src/eth/api/ContractHelpers.sol index 7a124bf1e7..c1ffbcffa5 100644 --- a/tests/src/eth/api/ContractHelpers.sol +++ b/tests/src/eth/api/ContractHelpers.sol @@ -12,8 +12,16 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } +<<<<<<< HEAD /// @title Magic contract, which allows users to reconfigure other contracts /// @dev the ERC-165 identifier for this interface is 0xd77fab70 +======= +<<<<<<< HEAD +// Selector: 6073d917 +======= +// Selector: 06fc42e9 +>>>>>>> path: add stubs +>>>>>>> path: add stubs interface ContractHelpers is Dummy, ERC165 { /// Get user, which deployed specified contract /// @dev May return zero address in case if contract is deployed @@ -29,11 +37,21 @@ interface ContractHelpers is Dummy, ERC165 { view returns (address); +<<<<<<< HEAD /// Set sponsor. /// @param contractAddress Contract for which a sponsor is being established. /// @param sponsor User address who set as pending sponsor. /// @dev EVM selector for this function is: 0xf01fba93, /// or in textual repr: setSponsor(address,address) +======= +<<<<<<< HEAD + // Set sponsor. + // + // @param contract_address Contract for which a sponsor is being established. + // @param sponsor User address who set as pending sponsor. + // + // Selector: setSponsor(address,address) f01fba93 +>>>>>>> path: add stubs function setSponsor(address contractAddress, address sponsor) external; /// Set contract as self sponsored. @@ -59,17 +77,35 @@ interface ContractHelpers is Dummy, ERC165 { /// or in textual repr: confirmSponsorship(address) function confirmSponsorship(address contractAddress) external; +<<<<<<< HEAD /// Get current sponsor. /// /// @param contractAddress The contract for which a sponsor is requested. /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. /// @dev EVM selector for this function is: 0x743fc745, /// or in textual repr: getSponsor(address) +======= + // Get current sponsor. + // + // @param contract_address The contract for which a sponsor is requested. + // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + // +======= + // Selector: setSponsor(address,address) f01fba93 + function setSponsor(address contractAddress, address sponsor) external; + + // Selector: confirmSponsorship(address) abc00001 + function confirmSponsorship(address contractAddress) external; + +>>>>>>> path: add stubs + // Selector: getSponsor(address) 743fc745 +>>>>>>> path: add stubs function getSponsor(address contractAddress) external view returns (Tuple0 memory); +<<<<<<< HEAD /// Check tat contract has confirmed sponsor. /// /// @param contractAddress The contract for which the presence of a confirmed sponsor is checked. @@ -84,6 +120,28 @@ interface ContractHelpers is Dummy, ERC165 { /// @return **true** if contract has pending sponsor. /// @dev EVM selector for this function is: 0x39b9b242, /// or in textual repr: hasPendingSponsor(address) +======= +<<<<<<< HEAD + // Check tat contract has confirmed sponsor. + // + // @param contract_address The contract for which the presence of a confirmed sponsor is checked. + // @return **true** if contract has confirmed sponsor. + // + // Selector: hasSponsor(address) 97418603 + function hasSponsor(address contractAddress) external view returns (bool); + + // Check tat contract has pending sponsor. + // + // @param contract_address The contract for which the presence of a pending sponsor is checked. + // @return **true** if contract has pending sponsor. + // +======= + // Selector: hasSponsor(address) 97418603 + function hasSponsor(address contractAddress) external view returns (bool); + +>>>>>>> path: add stubs + // Selector: hasPendingSponsor(address) 39b9b242 +>>>>>>> path: add stubs function hasPendingSponsor(address contractAddress) external view diff --git a/tests/src/eth/util/contractHelpersAbi.json b/tests/src/eth/util/contractHelpersAbi.json index c3cd1fd091..dfb07b7768 100644 --- a/tests/src/eth/util/contractHelpersAbi.json +++ b/tests/src/eth/util/contractHelpersAbi.json @@ -120,6 +120,7 @@ "internalType": "address", "name": "contractAddress", "type": "address" +<<<<<<< HEAD } ], "name": "removeSponsor", @@ -146,6 +147,8 @@ "internalType": "address", "name": "contractAddress", "type": "address" +======= +>>>>>>> path: add stubs }, { "internalType": "address", "name": "sponsor", "type": "address" } ], From 8684bc0f6fa5baed2964ec2d8b50aea2584bdcaa Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 5 Aug 2022 15:39:41 +0000 Subject: [PATCH 0579/1274] path: Add check for address length. --- pallets/common/src/eth.rs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/pallets/common/src/eth.rs b/pallets/common/src/eth.rs index 19e1e1dfe5..c672fab8e5 100644 --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -58,16 +58,3 @@ where let slice = from.as_sub().as_ref(); uint256::from_big_endian(slice) } - -/// Converts Substrate address to CrossAccountId -pub fn convert_substrate_address_to_cross_account_id( - address: uint256, -) -> T::CrossAccountId -where - T::AccountId: From<[u8; 32]>, -{ - let mut address_arr: [u8; 32] = Default::default(); - address.to_big_endian(&mut address_arr); - let account_id = T::AccountId::from(address_arr); - T::CrossAccountId::from_sub(account_id) -} From c0ab2ae2da4dc656787947452cc1bc56dce66e6c Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 24 Aug 2022 09:25:04 +0000 Subject: [PATCH 0580/1274] path: Add some methods for manipulate collection sponsor via eth. --- pallets/common/src/erc.rs | 43 ++++++++- pallets/common/src/eth.rs | 11 +++ pallets/common/src/lib.rs | 13 +-- pallets/fungible/src/erc.rs | 4 +- pallets/nonfungible/src/erc.rs | 4 +- pallets/refungible/src/erc.rs | 4 +- runtime/common/dispatch.rs | 2 +- tests/src/eth/collectionSponsoring.test.ts | 100 ++++++++++++++++++++- 8 files changed, 165 insertions(+), 16 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 44b11c9d75..19f3256839 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -26,7 +26,7 @@ use pallet_evm_coder_substrate::dispatch_to_evm; use sp_std::vec::Vec; use up_data_structs::{ AccessMode, CollectionMode, CollectionPermissions, OwnerRestrictedSet, Property, - SponsoringRateLimit, + SponsoringRateLimit, SponsorshipState, }; use alloc::format; @@ -63,7 +63,7 @@ pub trait CommonEvmHandler { #[solidity_interface(name = Collection)] impl CollectionHandle where - T::AccountId: From<[u8; 32]>, + T::AccountId: From<[u8; 32]> + AsRef<[u8]>, { /// Set collection property. /// @@ -128,6 +128,25 @@ where save(self) } + /// Set the substrate sponsor of the collection. + /// + /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + /// + /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. + fn set_collection_sponsor_substrate(&mut self, caller: caller, sponsor: uint256) -> Result { + check_is_owner_or_admin(caller, self)?; + + let sponsor = convert_uint256_to_cross_account::(sponsor); + self.set_sponsor(sponsor.as_sub().clone()) + .map_err(dispatch_to_evm::)?; + save(self) + } + + // /// Whether there is a pending sponsor. + fn has_collection_pending_sponsor(&self) -> Result { + Ok(matches!(self.collection.sponsorship, SponsorshipState::Unconfirmed(_))) + } + /// Collection sponsorship confirmation. /// /// @dev After setting the sponsor for the collection, it must be confirmed with this function. @@ -142,6 +161,26 @@ where save(self) } + /// Remove collection sponsor. + fn remove_collection_sponsor(&mut self, caller: caller) -> Result { + check_is_owner_or_admin(caller, self)?; + self.remove_sponsor().map_err(dispatch_to_evm::)?; + save(self) + } + + /// Get current sponsor. + /// + /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + fn get_collection_sponsor(&self) -> Result<(address, uint256)> { + let sponsor = match self.collection.sponsorship { + SponsorshipState::Disabled | SponsorshipState::Unconfirmed(_) => return Ok(Default::default()), + SponsorshipState::Confirmed(ref sponsor) => sponsor, + }; + let sponsor = T::CrossAccountId::from_sub(sponsor.clone()); + let sponsor_sub = convert_cross_account_to_uint256::(&sponsor)?; + Ok((*sponsor.as_eth(), sponsor_sub)) + } + /// Set limits for the collection. /// @dev Throws error if limit not found. /// @param limit Name of the limit. Valid names: diff --git a/pallets/common/src/eth.rs b/pallets/common/src/eth.rs index c672fab8e5..5df1476b37 100644 --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -58,3 +58,14 @@ where let slice = from.as_sub().as_ref(); uint256::from_big_endian(slice) } + +/// Convert `uint256` to `CrossAccountId`. +pub fn convert_uint256_to_cross_account(from: uint256) -> T::CrossAccountId +where + T::AccountId: From<[u8; 32]>, +{ + let mut new_admin_arr: [u8; 32] = Default::default(); + from.to_big_endian(&mut new_admin_arr); + let account_id = T::AccountId::from(new_admin_arr); + T::CrossAccountId::from_sub(account_id) +} diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 7cef3f065e..7f912fb8dc 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -231,6 +231,12 @@ impl CollectionHandle { Ok(true) } + /// Remove collection sponsor. + pub fn remove_sponsor(&mut self) -> DispatchResult { + self.collection.sponsorship = SponsorshipState::Disabled; + Ok(()) + } + /// Checks that the collection was created with, and must be operated upon through **Unique API**. /// Now check only the `external_collection` flag and if it's **true**, then return [`Error::CollectionIsExternal`] error. pub fn check_is_internal(&self) -> DispatchResult { @@ -732,12 +738,7 @@ impl Pallet { /// Get the effective limits for the collection. pub fn effective_collection_limits(collection: CollectionId) -> Option { - let collection = >::get(collection); - if collection.is_none() { - return None; - } - - let collection = collection.unwrap(); + let collection = >::get(collection)?; let limits = collection.limits; let effective_limits = CollectionLimits { account_token_ownership_limit: Some(limits.account_token_ownership_limit()), diff --git a/pallets/fungible/src/erc.rs b/pallets/fungible/src/erc.rs index 86712df9a2..03a678791d 100644 --- a/pallets/fungible/src/erc.rs +++ b/pallets/fungible/src/erc.rs @@ -154,14 +154,14 @@ impl FungibleHandle { Collection(common_mut, CollectionHandle), ) )] -impl FungibleHandle where T::AccountId: From<[u8; 32]> {} +impl FungibleHandle where T::AccountId: From<[u8; 32]> + AsRef<[u8]> {} generate_stubgen!(gen_impl, UniqueFungibleCall<()>, true); generate_stubgen!(gen_iface, UniqueFungibleCall<()>, false); impl CommonEvmHandler for FungibleHandle where - T::AccountId: From<[u8; 32]>, + T::AccountId: From<[u8; 32]> + AsRef<[u8]>, { const CODE: &'static [u8] = include_bytes!("./stubs/UniqueFungible.raw"); diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 8ec1bf3e0d..ea6fe94d8b 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -740,7 +740,7 @@ impl NonfungibleHandle { TokenProperties, ) )] -impl NonfungibleHandle where T::AccountId: From<[u8; 32]> {} +impl NonfungibleHandle where T::AccountId: From<[u8; 32]> + AsRef<[u8]> {} // Not a tests, but code generators generate_stubgen!(gen_impl, UniqueNFTCall<()>, true); @@ -748,7 +748,7 @@ generate_stubgen!(gen_iface, UniqueNFTCall<()>, false); impl CommonEvmHandler for NonfungibleHandle where - T::AccountId: From<[u8; 32]>, + T::AccountId: From<[u8; 32]> + AsRef<[u8]>, { const CODE: &'static [u8] = include_bytes!("./stubs/UniqueNFT.raw"); diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index b1a3854641..ef69cf19c8 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -789,7 +789,7 @@ impl RefungibleHandle { TokenProperties, ) )] -impl RefungibleHandle where T::AccountId: From<[u8; 32]> {} +impl RefungibleHandle where T::AccountId: From<[u8; 32]> + AsRef<[u8]> {} // Not a tests, but code generators generate_stubgen!(gen_impl, UniqueRefungibleCall<()>, true); @@ -797,7 +797,7 @@ generate_stubgen!(gen_iface, UniqueRefungibleCall<()>, false); impl CommonEvmHandler for RefungibleHandle where - T::AccountId: From<[u8; 32]>, + T::AccountId: From<[u8; 32]> + AsRef<[u8]>, { const CODE: &'static [u8] = include_bytes!("./stubs/UniqueRefungible.raw"); fn call( diff --git a/runtime/common/dispatch.rs b/runtime/common/dispatch.rs index 24e4c484be..b8f3a658ee 100644 --- a/runtime/common/dispatch.rs +++ b/runtime/common/dispatch.rs @@ -124,7 +124,7 @@ where + pallet_fungible::Config + pallet_nonfungible::Config + pallet_refungible::Config, - T::AccountId: From<[u8; 32]>, + T::AccountId: From<[u8; 32]> + AsRef<[u8]>, { fn is_reserved(target: &H160) -> bool { map_eth_to_id(target).is_some() diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index 71db092067..ab5025c4b7 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -1,8 +1,10 @@ import {addToAllowListExpectSuccess, confirmSponsorshipExpectSuccess, createCollectionExpectSuccess, enablePublicMintingExpectSuccess, getDetailedCollectionInfo, setCollectionSponsorExpectSuccess} from '../util/helpers'; -import {itWeb3, createEthAccount, collectionIdToAddress, GAS_ARGS, normalizeEvents, createEthAccountWithBalance, evmCollectionHelpers, getCollectionAddressFromResult, evmCollection, ethBalanceViaSub} from './util/helpers'; +import {itWeb3, createEthAccount, collectionIdToAddress, GAS_ARGS, normalizeEvents, createEthAccountWithBalance, evmCollectionHelpers, getCollectionAddressFromResult, evmCollection, ethBalanceViaSub, subToEth} from './util/helpers'; import nonFungibleAbi from './nonFungibleAbi.json'; import {expect} from 'chai'; import {evmToAddress} from '@polkadot/util-crypto'; +import {submitTransactionAsync} from '../substrate/substrate-api'; +import getBalance from '../substrate/get-balance'; describe('evm collection sponsoring', () => { itWeb3('sponsors mint transactions', async ({web3, privateKeyWrapper}) => { @@ -38,6 +40,47 @@ describe('evm collection sponsoring', () => { ]); }); + itWeb3('Set substrate sponsor', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelpers = evmCollectionHelpers(web3, owner); + let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const sponsor = privateKeyWrapper('//Alice'); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + + expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; + result = await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner}); + expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.true; + + const confirmTx = await api.tx.unique.confirmSponsorship(collectionId); + await submitTransactionAsync(sponsor, confirmTx); + expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; + + const sponsorTuple = await collectionEvm.methods.getCollectionSponsor().call({from: owner}); + expect(sponsorTuple.field_0).to.be.eq(subToEth(sponsor.address)); + }); + + itWeb3('Remove sponsor', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelpers = evmCollectionHelpers(web3, owner); + let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + + expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; + result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner}); + expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.true; + + await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor}); + expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; + + await collectionEvm.methods.removeCollectionSponsor().send({from: owner}); + + const sponsorTuple = await collectionEvm.methods.getCollectionSponsor().call({from: owner}); + expect(sponsorTuple.field_0).to.be.eq('0x0000000000000000000000000000000000000000'); + }); + itWeb3('Sponsoring collection from evm address via access list', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelpers = evmCollectionHelpers(web3, owner); @@ -107,6 +150,61 @@ describe('evm collection sponsoring', () => { } }); + itWeb3('Sponsoring collection from substrate address via access list', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collectionHelpers = evmCollectionHelpers(web3, owner); + const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const sponsor = privateKeyWrapper('//Alice'); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + + await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner}); + + const confirmTx = await api.tx.unique.confirmSponsorship(collectionId); + await submitTransactionAsync(sponsor, confirmTx); + + const user = createEthAccount(web3); + const nextTokenId = await collectionEvm.methods.nextTokenId().call(); + expect(nextTokenId).to.be.equal('1'); + + await collectionEvm.methods.setCollectionAccess(1 /*'AllowList'*/).send({from: owner}); + await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner}); + await collectionEvm.methods.setCollectionMintMode(true).send({from: owner}); + + const ownerBalanceBefore = await ethBalanceViaSub(api, owner); + const sponsorBalanceBefore = (await getBalance(api, [sponsor.address]))[0]; + + { + const nextTokenId = await collectionEvm.methods.nextTokenId().call(); + expect(nextTokenId).to.be.equal('1'); + const result = await collectionEvm.methods.mintWithTokenURI( + user, + nextTokenId, + 'Test URI', + ).send({from: user}); + const events = normalizeEvents(result.events); + + expect(events).to.be.deep.equal([ + { + address: collectionIdAddress, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: user, + tokenId: nextTokenId, + }, + }, + ]); + + const ownerBalanceAfter = await ethBalanceViaSub(api, owner); + const sponsorBalanceAfter = (await getBalance(api, [sponsor.address]))[0]; + + expect(await collectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); + expect(ownerBalanceBefore).to.be.eq(ownerBalanceAfter); + expect(sponsorBalanceBefore > sponsorBalanceAfter).to.be.true; + } + }); + itWeb3('Check that transaction via EVM spend money from sponsor address', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelpers = evmCollectionHelpers(web3, owner); From 83de2b0d533dcd0b61b9110e56464e66aac7a010 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 24 Aug 2022 09:26:03 +0000 Subject: [PATCH 0581/1274] misk: Change versions --- Cargo.lock | 8 ++++---- pallets/common/CHANGELOG.md | 10 ++++++++++ pallets/common/Cargo.toml | 2 +- pallets/fungible/CHANGELOG.md | 5 +++++ pallets/fungible/Cargo.toml | 2 +- pallets/nonfungible/CHANGELOG.md | 5 +++++ pallets/nonfungible/Cargo.toml | 2 +- pallets/refungible/CHANGELOG.md | 5 +++++ pallets/refungible/Cargo.toml | 2 +- 9 files changed, 33 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4083fdf813..269ae8342d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5510,7 +5510,7 @@ dependencies = [ [[package]] name = "pallet-common" -version = "0.1.7" +version = "0.1.8" dependencies = [ "ethereum", "evm-coder", @@ -5748,7 +5748,7 @@ dependencies = [ [[package]] name = "pallet-fungible" -version = "0.1.3" +version = "0.1.4" dependencies = [ "ethereum", "evm-coder", @@ -5990,7 +5990,7 @@ dependencies = [ [[package]] name = "pallet-nonfungible" -version = "0.1.4" +version = "0.1.5" dependencies = [ "ethereum", "evm-coder", @@ -6112,7 +6112,7 @@ dependencies = [ [[package]] name = "pallet-refungible" -version = "0.2.3" +version = "0.2.4" dependencies = [ "derivative", "ethereum", diff --git a/pallets/common/CHANGELOG.md b/pallets/common/CHANGELOG.md index e3be235edc..a2edeaa3d5 100644 --- a/pallets/common/CHANGELOG.md +++ b/pallets/common/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. +## [0.1.8] - 2022-08-24 + +## Added + - Eth methods for collection + + set_collection_sponsor_substrate + + has_collection_pending_sponsor + + remove_collection_sponsor + + get_collection_sponsor +- Add convert function from `uint256` to `CrossAccountId`. + ## [0.1.7] - 2022-08-19 ### Added diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index fedca0d6e2..4d24c3db8d 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-common" -version = "0.1.7" +version = "0.1.8" license = "GPLv3" edition = "2021" diff --git a/pallets/fungible/CHANGELOG.md b/pallets/fungible/CHANGELOG.md index 94e6403676..1a9fc79147 100644 --- a/pallets/fungible/CHANGELOG.md +++ b/pallets/fungible/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## [v0.1.4] - 2022-08-24 + +### Change + - Add bound `AsRef<[u8]>` to `T::CrossAccountId`. + ## [v0.1.3] 2022-08-16 diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index f63656e239..dca9ee8c71 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-fungible" -version = "0.1.3" +version = "0.1.4" license = "GPLv3" edition = "2021" diff --git a/pallets/nonfungible/CHANGELOG.md b/pallets/nonfungible/CHANGELOG.md index 6bc075a843..242d2a4373 100644 --- a/pallets/nonfungible/CHANGELOG.md +++ b/pallets/nonfungible/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## [v0.1.5] - 2022-08-24 + +### Change + - Add bound `AsRef<[u8]>` to `T::CrossAccountId`. + ## [v0.1.4] 2022-08-16 diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index 9b6cf37319..e7ea92b9c7 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-nonfungible" -version = "0.1.4" +version = "0.1.5" license = "GPLv3" edition = "2021" diff --git a/pallets/refungible/CHANGELOG.md b/pallets/refungible/CHANGELOG.md index 795d1258a7..b4e5243ef2 100644 --- a/pallets/refungible/CHANGELOG.md +++ b/pallets/refungible/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## [v0.2.4] - 2022-08-24 + +### Change + - Add bound `AsRef<[u8]>` to `T::CrossAccountId`. + ## [v0.2.3] 2022-08-16 diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index b542ff31b6..921b28e2b4 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-refungible" -version = "0.2.3" +version = "0.2.4" license = "GPLv3" edition = "2021" From fd0a5840191711946dbf421087d0345f3214bb6e Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 24 Aug 2022 09:30:27 +0000 Subject: [PATCH 0582/1274] misk: Update stubs --- pallets/fungible/src/stubs/UniqueFungible.sol | 186 ++++++++++++++++++ pallets/nonfungible/src/stubs/UniqueNFT.sol | 170 ++++++++++++++++ .../refungible/src/stubs/UniqueRefungible.sol | 170 ++++++++++++++++ tests/src/eth/api/UniqueFungible.sol | 117 +++++++++++ tests/src/eth/api/UniqueNFT.sol | 143 ++++++++++++++ tests/src/eth/api/UniqueRefungible.sol | 143 ++++++++++++++ tests/src/eth/fungibleAbi.json | 37 ++++ tests/src/eth/nonFungibleAbi.json | 37 ++++ tests/src/eth/reFungibleAbi.json | 37 ++++ 9 files changed, 1040 insertions(+) diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index 1be1a6a614..93368d38d6 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -3,7 +3,17 @@ pragma solidity >=0.8.0 <0.9.0; +<<<<<<< HEAD /// @dev common stubs holder +======= +// Anonymous struct +struct Tuple0 { + address field_0; + uint256 field_1; +} + +// Common stubs holder +>>>>>>> misk: Update stubs contract Dummy { uint8 dummy; string stub_error = "this contract is implemented in native"; @@ -21,8 +31,122 @@ contract ERC165 is Dummy { } } +<<<<<<< HEAD /// @title A contract that allows you to work with collections. /// @dev the ERC-165 identifier for this interface is 0xffe4da23 +======= +// Inline +contract ERC20Events { + event Transfer(address indexed from, address indexed to, uint256 value); + event Approval( + address indexed owner, + address indexed spender, + uint256 value + ); +} + +<<<<<<< HEAD +// Selector: 79cc6790 +contract ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) public returns (bool) { + require(false, stub_error); + from; + amount; + dummy = 0; + return false; + } +} + +// Selector: 942e8b22 +contract ERC20 is Dummy, ERC165, ERC20Events { + // Selector: name() 06fdde03 + function name() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: symbol() 95d89b41 + function symbol() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: decimals() 313ce567 + function decimals() public view returns (uint8) { + require(false, stub_error); + dummy; + return 0; + } + + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) public view returns (uint256) { + require(false, stub_error); + owner; + dummy; + return 0; + } + + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 amount) public returns (bool) { + require(false, stub_error); + to; + amount; + dummy = 0; + return false; + } + + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 amount + ) public returns (bool) { + require(false, stub_error); + from; + to; + amount; + dummy = 0; + return false; + } + + // Selector: approve(address,uint256) 095ea7b3 + function approve(address spender, uint256 amount) public returns (bool) { + require(false, stub_error); + spender; + amount; + dummy = 0; + return false; + } + + // Selector: allowance(address,address) dd62ed3e + function allowance(address owner, address spender) + public + view + returns (uint256) + { + require(false, stub_error); + owner; + spender; + dummy; + return 0; + } +} + +// Selector: ffe4da23 +======= +// Selector: 765e2fae +>>>>>>> misk: Update stubs +>>>>>>> misk: Update stubs contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -82,16 +206,45 @@ contract Collection is Dummy, ERC165 { dummy = 0; } +<<<<<<< HEAD /// Collection sponsorship confirmation. /// /// @dev After setting the sponsor for the collection, it must be confirmed with this function. /// @dev EVM selector for this function is: 0x3c50e97a, /// or in textual repr: confirmCollectionSponsorship() +======= + // Set the substrate sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsorSubstrate(uint256) c74d6751 + function setCollectionSponsorSubstrate(uint256 sponsor) public { + require(false, stub_error); + sponsor; + dummy = 0; + } + + // Selector: hasCollectionPendingSponsor() 058ac185 + function hasCollectionPendingSponsor() public view returns (bool) { + require(false, stub_error); + dummy; + return false; + } + + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a +>>>>>>> misk: Update stubs function confirmCollectionSponsorship() public { require(false, stub_error); dummy = 0; } +<<<<<<< HEAD /// Set limits for the collection. /// @dev Throws error if limit not found. /// @param limit Name of the limit. Valid names: @@ -104,6 +257,39 @@ contract Collection is Dummy, ERC165 { /// @param value Value of the limit. /// @dev EVM selector for this function is: 0x6a3841db, /// or in textual repr: setCollectionLimit(string,uint32) +======= + // Remove collection sponsor. + // + // Selector: removeCollectionSponsor() 6e0326a3 + function removeCollectionSponsor() public { + require(false, stub_error); + dummy = 0; + } + + // Get current sponsor. + // + // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + // + // Selector: getCollectionSponsor() b66bbc14 + function getCollectionSponsor() public view returns (Tuple0 memory) { + require(false, stub_error); + dummy; + return Tuple0(0x0000000000000000000000000000000000000000, 0); + } + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,uint32) 6a3841db +>>>>>>> misk: Update stubs function setCollectionLimit(string memory limit, uint32 value) public { require(false, stub_error); limit; diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index 9d9c5da60f..834c0a1eee 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -3,7 +3,23 @@ pragma solidity >=0.8.0 <0.9.0; +<<<<<<< HEAD /// @dev common stubs holder +======= +// Anonymous struct +struct Tuple0 { + uint256 field_0; + string field_1; +} + +// Anonymous struct +struct Tuple1 { + address field_0; + uint256 field_1; +} + +// Common stubs holder +>>>>>>> misk: Update stubs contract Dummy { uint8 dummy; string stub_error = "this contract is implemented in native"; @@ -465,8 +481,55 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { } } +<<<<<<< HEAD /// @title Unique extensions for ERC721. /// @dev the ERC-165 identifier for this interface is 0xd74d154f +======= +<<<<<<< HEAD +// Selector: 780e9d63 +contract ERC721Enumerable is Dummy, ERC165 { + // @notice Enumerate valid NFTs + // @param index A counter less than `totalSupply()` + // @return The token identifier for the `index`th NFT, + // (sort order not specified) + // + // Selector: tokenByIndex(uint256) 4f6ccce7 + function tokenByIndex(uint256 index) public view returns (uint256) { + require(false, stub_error); + index; + dummy; + return 0; + } + + // @dev Not implemented + // + // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 + function tokenOfOwnerByIndex(address owner, uint256 index) + public + view + returns (uint256) + { + require(false, stub_error); + owner; + index; + dummy; + return 0; + } + + // @notice Count NFTs tracked by this contract + // @return A count of valid NFTs tracked by this contract, where each one of + // them has an assigned and queryable owner not equal to the zero address + // + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } +} + +// Selector: d74d154f +>>>>>>> misk: Update stubs contract ERC721UniqueExtensions is Dummy, ERC165 { /// @notice Transfer ownership of an NFT /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` @@ -543,11 +606,33 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { } } +<<<<<<< HEAD /// @dev anonymous struct struct Tuple8 { uint256 field_0; string field_1; } +======= +// Selector: ffe4da23 +======= +// Selector: 765e2fae +>>>>>>> misk: Update stubs +contract Collection is Dummy, ERC165 { + // Set collection property. + // + // @param key Property key. + // @param value Propery value. + // + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + public + { + require(false, stub_error); + key; + value; + dummy = 0; + } +>>>>>>> misk: Update stubs /// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension /// @dev See https://eips.ethereum.org/EIPS/eip-721 @@ -578,7 +663,92 @@ contract ERC721Enumerable is Dummy, ERC165 { owner; index; dummy; +<<<<<<< HEAD return 0; +======= + return hex""; + } + + // Set the sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) public { + require(false, stub_error); + sponsor; + dummy = 0; + } + + // Set the substrate sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsorSubstrate(uint256) c74d6751 + function setCollectionSponsorSubstrate(uint256 sponsor) public { + require(false, stub_error); + sponsor; + dummy = 0; + } + + // Selector: hasCollectionPendingSponsor() 058ac185 + function hasCollectionPendingSponsor() public view returns (bool) { + require(false, stub_error); + dummy; + return false; + } + + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() public { + require(false, stub_error); + dummy = 0; + } + + // Remove collection sponsor. + // + // Selector: removeCollectionSponsor() 6e0326a3 + function removeCollectionSponsor() public { + require(false, stub_error); + dummy = 0; + } + + // Get current sponsor. + // + // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + // + // Selector: getCollectionSponsor() b66bbc14 + function getCollectionSponsor() public view returns (Tuple1 memory) { + require(false, stub_error); + dummy; + return Tuple1(0x0000000000000000000000000000000000000000, 0); + } + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) public { + require(false, stub_error); + limit; + value; + dummy = 0; +>>>>>>> misk: Update stubs } /// @notice Count NFTs tracked by this contract diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index 6e33f9300c..edc9b83208 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -3,7 +3,23 @@ pragma solidity >=0.8.0 <0.9.0; +<<<<<<< HEAD /// @dev common stubs holder +======= +// Anonymous struct +struct Tuple0 { + uint256 field_0; + string field_1; +} + +// Anonymous struct +struct Tuple1 { + address field_0; + uint256 field_1; +} + +// Common stubs holder +>>>>>>> misk: Update stubs contract Dummy { uint8 dummy; string stub_error = "this contract is implemented in native"; @@ -465,8 +481,55 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { } } +<<<<<<< HEAD /// @title Unique extensions for ERC721. /// @dev the ERC-165 identifier for this interface is 0x7c3bef89 +======= +<<<<<<< HEAD +// Selector: 780e9d63 +contract ERC721Enumerable is Dummy, ERC165 { + // @notice Enumerate valid RFTs + // @param index A counter less than `totalSupply()` + // @return The token identifier for the `index`th NFT, + // (sort order not specified) + // + // Selector: tokenByIndex(uint256) 4f6ccce7 + function tokenByIndex(uint256 index) public view returns (uint256) { + require(false, stub_error); + index; + dummy; + return 0; + } + + // Not implemented + // + // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 + function tokenOfOwnerByIndex(address owner, uint256 index) + public + view + returns (uint256) + { + require(false, stub_error); + owner; + index; + dummy; + return 0; + } + + // @notice Count RFTs tracked by this contract + // @return A count of valid RFTs tracked by this contract, where each one of + // them has an assigned and queryable owner not equal to the zero address + // + // Selector: totalSupply() 18160ddd + function totalSupply() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } +} + +// Selector: 7c3bef89 +>>>>>>> misk: Update stubs contract ERC721UniqueExtensions is Dummy, ERC165 { /// @notice Transfer ownership of an RFT /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` @@ -557,11 +620,33 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { } } +<<<<<<< HEAD /// @dev anonymous struct struct Tuple8 { uint256 field_0; string field_1; } +======= +// Selector: ffe4da23 +======= +// Selector: 765e2fae +>>>>>>> misk: Update stubs +contract Collection is Dummy, ERC165 { + // Set collection property. + // + // @param key Property key. + // @param value Propery value. + // + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + public + { + require(false, stub_error); + key; + value; + dummy = 0; + } +>>>>>>> misk: Update stubs /// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension /// @dev See https://eips.ethereum.org/EIPS/eip-721 @@ -592,7 +677,92 @@ contract ERC721Enumerable is Dummy, ERC165 { owner; index; dummy; +<<<<<<< HEAD return 0; +======= + return hex""; + } + + // Set the sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) public { + require(false, stub_error); + sponsor; + dummy = 0; + } + + // Set the substrate sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsorSubstrate(uint256) c74d6751 + function setCollectionSponsorSubstrate(uint256 sponsor) public { + require(false, stub_error); + sponsor; + dummy = 0; + } + + // Selector: hasCollectionPendingSponsor() 058ac185 + function hasCollectionPendingSponsor() public view returns (bool) { + require(false, stub_error); + dummy; + return false; + } + + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() public { + require(false, stub_error); + dummy = 0; + } + + // Remove collection sponsor. + // + // Selector: removeCollectionSponsor() 6e0326a3 + function removeCollectionSponsor() public { + require(false, stub_error); + dummy = 0; + } + + // Get current sponsor. + // + // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + // + // Selector: getCollectionSponsor() b66bbc14 + function getCollectionSponsor() public view returns (Tuple1 memory) { + require(false, stub_error); + dummy; + return Tuple1(0x0000000000000000000000000000000000000000, 0); + } + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) public { + require(false, stub_error); + limit; + value; + dummy = 0; +>>>>>>> misk: Update stubs } /// @notice Count RFTs tracked by this contract diff --git a/tests/src/eth/api/UniqueFungible.sol b/tests/src/eth/api/UniqueFungible.sol index 358c4a6841..8689c21184 100644 --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -3,7 +3,17 @@ pragma solidity >=0.8.0 <0.9.0; +<<<<<<< HEAD /// @dev common stubs holder +======= +// Anonymous struct +struct Tuple0 { + address field_0; + uint256 field_1; +} + +// Common stubs holder +>>>>>>> misk: Update stubs interface Dummy { } @@ -12,8 +22,69 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } +<<<<<<< HEAD /// @title A contract that allows you to work with collections. /// @dev the ERC-165 identifier for this interface is 0xffe4da23 +======= +// Inline +interface ERC20Events { + event Transfer(address indexed from, address indexed to, uint256 value); + event Approval( + address indexed owner, + address indexed spender, + uint256 value + ); +} + +<<<<<<< HEAD +// Selector: 79cc6790 +interface ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) external returns (bool); +} + +// Selector: 942e8b22 +interface ERC20 is Dummy, ERC165, ERC20Events { + // Selector: name() 06fdde03 + function name() external view returns (string memory); + + // Selector: symbol() 95d89b41 + function symbol() external view returns (string memory); + + // Selector: totalSupply() 18160ddd + function totalSupply() external view returns (uint256); + + // Selector: decimals() 313ce567 + function decimals() external view returns (uint8); + + // Selector: balanceOf(address) 70a08231 + function balanceOf(address owner) external view returns (uint256); + + // Selector: transfer(address,uint256) a9059cbb + function transfer(address to, uint256 amount) external returns (bool); + + // Selector: transferFrom(address,address,uint256) 23b872dd + function transferFrom( + address from, + address to, + uint256 amount + ) external returns (bool); + + // Selector: approve(address,uint256) 095ea7b3 + function approve(address spender, uint256 amount) external returns (bool); + + // Selector: allowance(address,address) dd62ed3e + function allowance(address owner, address spender) + external + view + returns (uint256); +} + +// Selector: ffe4da23 +======= +// Selector: 765e2fae +>>>>>>> misk: Update stubs +>>>>>>> misk: Update stubs interface Collection is Dummy, ERC165 { /// Set collection property. /// @@ -53,6 +124,7 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: setCollectionSponsor(address) function setCollectionSponsor(address sponsor) external; +<<<<<<< HEAD /// Collection sponsorship confirmation. /// /// @dev After setting the sponsor for the collection, it must be confirmed with this function. @@ -72,6 +144,51 @@ interface Collection is Dummy, ERC165 { /// @param value Value of the limit. /// @dev EVM selector for this function is: 0x6a3841db, /// or in textual repr: setCollectionLimit(string,uint32) +======= + // Set the substrate sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsorSubstrate(uint256) c74d6751 + function setCollectionSponsorSubstrate(uint256 sponsor) external; + + // Selector: hasCollectionPendingSponsor() 058ac185 + function hasCollectionPendingSponsor() external view returns (bool); + + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() external; + + // Remove collection sponsor. + // + // Selector: removeCollectionSponsor() 6e0326a3 + function removeCollectionSponsor() external; + + // Get current sponsor. + // + // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + // + // Selector: getCollectionSponsor() b66bbc14 + function getCollectionSponsor() external view returns (Tuple0 memory); + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,uint32) 6a3841db +>>>>>>> misk: Update stubs function setCollectionLimit(string memory limit, uint32 value) external; /// Set limits for the collection. diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index 62d718dd06..abda6a3896 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -3,7 +3,23 @@ pragma solidity >=0.8.0 <0.9.0; +<<<<<<< HEAD /// @dev common stubs holder +======= +// Anonymous struct +struct Tuple0 { + uint256 field_0; + string field_1; +} + +// Anonymous struct +struct Tuple1 { + address field_0; + uint256 field_1; +} + +// Common stubs holder +>>>>>>> misk: Update stubs interface Dummy { } @@ -305,8 +321,39 @@ interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { function finishMinting() external returns (bool); } +<<<<<<< HEAD /// @title Unique extensions for ERC721. /// @dev the ERC-165 identifier for this interface is 0xd74d154f +======= +<<<<<<< HEAD +// Selector: 780e9d63 +interface ERC721Enumerable is Dummy, ERC165 { + // @notice Enumerate valid NFTs + // @param index A counter less than `totalSupply()` + // @return The token identifier for the `index`th NFT, + // (sort order not specified) + // + // Selector: tokenByIndex(uint256) 4f6ccce7 + function tokenByIndex(uint256 index) external view returns (uint256); + + // @dev Not implemented + // + // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 + function tokenOfOwnerByIndex(address owner, uint256 index) + external + view + returns (uint256); + + // @notice Count NFTs tracked by this contract + // @return A count of valid NFTs tracked by this contract, where each one of + // them has an assigned and queryable owner not equal to the zero address + // + // Selector: totalSupply() 18160ddd + function totalSupply() external view returns (uint256); +} + +// Selector: d74d154f +>>>>>>> misk: Update stubs interface ERC721UniqueExtensions is Dummy, ERC165 { /// @notice Transfer ownership of an NFT /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` @@ -355,11 +402,27 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { returns (bool); } +<<<<<<< HEAD /// @dev anonymous struct struct Tuple8 { uint256 field_0; string field_1; } +======= +// Selector: ffe4da23 +======= +// Selector: 765e2fae +>>>>>>> misk: Update stubs +interface Collection is Dummy, ERC165 { + // Set collection property. + // + // @param key Property key. + // @param value Propery value. + // + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + external; +>>>>>>> misk: Update stubs /// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension /// @dev See https://eips.ethereum.org/EIPS/eip-721 @@ -379,7 +442,87 @@ interface ERC721Enumerable is Dummy, ERC165 { function tokenOfOwnerByIndex(address owner, uint256 index) external view +<<<<<<< HEAD returns (uint256); +======= + returns (bytes memory); + + // Set the sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) external; + + // Set the substrate sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsorSubstrate(uint256) c74d6751 + function setCollectionSponsorSubstrate(uint256 sponsor) external; + + // Selector: hasCollectionPendingSponsor() 058ac185 + function hasCollectionPendingSponsor() external view returns (bool); + + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() external; + + // Remove collection sponsor. + // + // Selector: removeCollectionSponsor() 6e0326a3 + function removeCollectionSponsor() external; + + // Get current sponsor. + // + // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + // + // Selector: getCollectionSponsor() b66bbc14 + function getCollectionSponsor() external view returns (Tuple1 memory); + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) external; + + // Get contract address. + // + // Selector: contractAddress() f6b4dfb4 + function contractAddress() external view returns (address); + + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. + // + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) external; +>>>>>>> misk: Update stubs /// @notice Count NFTs tracked by this contract /// @return A count of valid NFTs tracked by this contract, where each one of diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index 2c17d5571a..32711924dd 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -3,7 +3,23 @@ pragma solidity >=0.8.0 <0.9.0; +<<<<<<< HEAD /// @dev common stubs holder +======= +// Anonymous struct +struct Tuple0 { + uint256 field_0; + string field_1; +} + +// Anonymous struct +struct Tuple1 { + address field_0; + uint256 field_1; +} + +// Common stubs holder +>>>>>>> misk: Update stubs interface Dummy { } @@ -305,8 +321,39 @@ interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { function finishMinting() external returns (bool); } +<<<<<<< HEAD /// @title Unique extensions for ERC721. /// @dev the ERC-165 identifier for this interface is 0x7c3bef89 +======= +<<<<<<< HEAD +// Selector: 780e9d63 +interface ERC721Enumerable is Dummy, ERC165 { + // @notice Enumerate valid RFTs + // @param index A counter less than `totalSupply()` + // @return The token identifier for the `index`th NFT, + // (sort order not specified) + // + // Selector: tokenByIndex(uint256) 4f6ccce7 + function tokenByIndex(uint256 index) external view returns (uint256); + + // Not implemented + // + // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 + function tokenOfOwnerByIndex(address owner, uint256 index) + external + view + returns (uint256); + + // @notice Count RFTs tracked by this contract + // @return A count of valid RFTs tracked by this contract, where each one of + // them has an assigned and queryable owner not equal to the zero address + // + // Selector: totalSupply() 18160ddd + function totalSupply() external view returns (uint256); +} + +// Selector: 7c3bef89 +>>>>>>> misk: Update stubs interface ERC721UniqueExtensions is Dummy, ERC165 { /// @notice Transfer ownership of an RFT /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` @@ -367,11 +414,27 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { returns (address); } +<<<<<<< HEAD /// @dev anonymous struct struct Tuple8 { uint256 field_0; string field_1; } +======= +// Selector: ffe4da23 +======= +// Selector: 765e2fae +>>>>>>> misk: Update stubs +interface Collection is Dummy, ERC165 { + // Set collection property. + // + // @param key Property key. + // @param value Propery value. + // + // Selector: setCollectionProperty(string,bytes) 2f073f66 + function setCollectionProperty(string memory key, bytes memory value) + external; +>>>>>>> misk: Update stubs /// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension /// @dev See https://eips.ethereum.org/EIPS/eip-721 @@ -391,7 +454,87 @@ interface ERC721Enumerable is Dummy, ERC165 { function tokenOfOwnerByIndex(address owner, uint256 index) external view +<<<<<<< HEAD returns (uint256); +======= + returns (bytes memory); + + // Set the sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsor(address) 7623402e + function setCollectionSponsor(address sponsor) external; + + // Set the substrate sponsor of the collection. + // + // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // + // @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. + // + // Selector: setCollectionSponsorSubstrate(uint256) c74d6751 + function setCollectionSponsorSubstrate(uint256 sponsor) external; + + // Selector: hasCollectionPendingSponsor() 058ac185 + function hasCollectionPendingSponsor() external view returns (bool); + + // Collection sponsorship confirmation. + // + // @dev After setting the sponsor for the collection, it must be confirmed with this function. + // + // Selector: confirmCollectionSponsorship() 3c50e97a + function confirmCollectionSponsorship() external; + + // Remove collection sponsor. + // + // Selector: removeCollectionSponsor() 6e0326a3 + function removeCollectionSponsor() external; + + // Get current sponsor. + // + // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + // + // Selector: getCollectionSponsor() b66bbc14 + function getCollectionSponsor() external view returns (Tuple1 memory); + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "accountTokenOwnershipLimit", + // "sponsoredDataSize", + // "sponsoredDataRateLimit", + // "tokenLimit", + // "sponsorTransferTimeout", + // "sponsorApproveTimeout" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,uint32) 6a3841db + function setCollectionLimit(string memory limit, uint32 value) external; + + // Set limits for the collection. + // @dev Throws error if limit not found. + // @param limit Name of the limit. Valid names: + // "ownerCanTransfer", + // "ownerCanDestroy", + // "transfersEnabled" + // @param value Value of the limit. + // + // Selector: setCollectionLimit(string,bool) 993b7fba + function setCollectionLimit(string memory limit, bool value) external; + + // Get contract address. + // + // Selector: contractAddress() f6b4dfb4 + function contractAddress() external view returns (address); + + // Add collection admin by substrate address. + // @param new_admin Substrate administrator address. + // + // Selector: addCollectionAdminSubstrate(uint256) 5730062b + function addCollectionAdminSubstrate(uint256 newAdmin) external; +>>>>>>> misk: Update stubs /// @notice Count RFTs tracked by this contract /// @return A count of valid RFTs tracked by this contract, where each one of diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index 9330c16638..1313347941 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -168,6 +168,30 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "getCollectionSponsor", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "field_0", "type": "address" }, + { "internalType": "uint256", "name": "field_1", "type": "uint256" } + ], + "internalType": "struct Tuple0", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hasCollectionPendingSponsor", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "name", @@ -193,6 +217,13 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "removeCollectionSponsor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" } @@ -278,6 +309,7 @@ }, { "inputs": [ +<<<<<<< HEAD { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "setOwner", @@ -290,6 +322,11 @@ { "internalType": "uint256", "name": "newOwner", "type": "uint256" } ], "name": "setOwnerSubstrate", +======= + { "internalType": "uint256", "name": "sponsor", "type": "uint256" } + ], + "name": "setCollectionSponsorSubstrate", +>>>>>>> misk: Update stubs "outputs": [], "stateMutability": "nonpayable", "type": "function" diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index feec234821..2e3b5dc6b3 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -199,6 +199,30 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "getCollectionSponsor", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "field_0", "type": "address" }, + { "internalType": "uint256", "name": "field_1", "type": "uint256" } + ], + "internalType": "struct Tuple1", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hasCollectionPendingSponsor", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, @@ -334,6 +358,13 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "removeCollectionSponsor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" } @@ -452,6 +483,7 @@ }, { "inputs": [ +<<<<<<< HEAD { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "setOwner", @@ -464,6 +496,11 @@ { "internalType": "uint256", "name": "newOwner", "type": "uint256" } ], "name": "setOwnerSubstrate", +======= + { "internalType": "uint256", "name": "sponsor", "type": "uint256" } + ], + "name": "setCollectionSponsorSubstrate", +>>>>>>> misk: Update stubs "outputs": [], "stateMutability": "nonpayable", "type": "function" diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index 9d21b9faba..84e3c54766 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -199,6 +199,30 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "getCollectionSponsor", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "field_0", "type": "address" }, + { "internalType": "uint256", "name": "field_1", "type": "uint256" } + ], + "internalType": "struct Tuple1", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "hasCollectionPendingSponsor", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, @@ -334,6 +358,13 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "removeCollectionSponsor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" } @@ -452,6 +483,7 @@ }, { "inputs": [ +<<<<<<< HEAD { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "setOwner", @@ -464,6 +496,11 @@ { "internalType": "uint256", "name": "newOwner", "type": "uint256" } ], "name": "setOwnerSubstrate", +======= + { "internalType": "uint256", "name": "sponsor", "type": "uint256" } + ], + "name": "setCollectionSponsorSubstrate", +>>>>>>> misk: Update stubs "outputs": [], "stateMutability": "nonpayable", "type": "function" From 41b5a1d1099fde7570873eb60dbedfb32814924f Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 25 Aug 2022 11:24:28 +0000 Subject: [PATCH 0583/1274] fix: After rebase --- crates/evm-coder/src/solidity.rs | 2 +- pallets/common/src/erc.rs | 14 +++++++------- pallets/fungible/src/erc.rs | 4 ++-- pallets/nonfungible/src/erc.rs | 4 ++-- pallets/refungible/src/erc.rs | 4 ++-- runtime/common/dispatch.rs | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/crates/evm-coder/src/solidity.rs b/crates/evm-coder/src/solidity.rs index ddec31fc03..d0cb5c80e2 100644 --- a/crates/evm-coder/src/solidity.rs +++ b/crates/evm-coder/src/solidity.rs @@ -479,7 +479,7 @@ impl SolidityFunctions for SolidityF } } -#[impl_for_tuples(0, 24)] +#[impl_for_tuples(0, 48)] impl SolidityFunctions for Tuple { for_tuples!( where #( Tuple: SolidityFunctions ),* ); diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 19f3256839..754142a237 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -32,7 +32,7 @@ use alloc::format; use crate::{ Pallet, CollectionHandle, Config, CollectionProperties, - eth::convert_substrate_address_to_cross_account_id, + eth::{convert_cross_account_to_uint256, convert_uint256_to_cross_account}, }; /// Events for ethereum collection helper. @@ -63,7 +63,7 @@ pub trait CommonEvmHandler { #[solidity_interface(name = Collection)] impl CollectionHandle where - T::AccountId: From<[u8; 32]> + AsRef<[u8]>, + T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]>, { /// Set collection property. /// @@ -177,7 +177,7 @@ where SponsorshipState::Confirmed(ref sponsor) => sponsor, }; let sponsor = T::CrossAccountId::from_sub(sponsor.clone()); - let sponsor_sub = convert_cross_account_to_uint256::(&sponsor)?; + let sponsor_sub = convert_cross_account_to_uint256::(&sponsor); Ok((*sponsor.as_eth(), sponsor_sub)) } @@ -274,7 +274,7 @@ where new_admin: uint256, ) -> Result { let caller = T::CrossAccountId::from_eth(caller); - let new_admin = convert_substrate_address_to_cross_account_id::(new_admin); + let new_admin = convert_uint256_to_cross_account::(new_admin); >::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::)?; Ok(()) } @@ -287,7 +287,7 @@ where admin: uint256, ) -> Result { let caller = T::CrossAccountId::from_eth(caller); - let admin = convert_substrate_address_to_cross_account_id::(admin); + let admin = convert_uint256_to_cross_account::(admin); >::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::)?; Ok(()) } @@ -461,7 +461,7 @@ where /// @param user account to verify /// @return "true" if account is the owner or admin fn is_owner_or_admin_substrate(&self, user: uint256) -> Result { - let user = convert_substrate_address_to_cross_account_id::(user); + let user = convert_uint256_to_cross_account::(user); Ok(self.is_owner_or_admin(&user)) } @@ -494,7 +494,7 @@ where /// @param newOwner new owner substrate account fn set_owner_substrate(&mut self, caller: caller, new_owner: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); - let new_owner = convert_substrate_address_to_cross_account_id::(new_owner); + let new_owner = convert_uint256_to_cross_account::(new_owner); self.set_owner_internal(caller, new_owner) .map_err(dispatch_to_evm::) } diff --git a/pallets/fungible/src/erc.rs b/pallets/fungible/src/erc.rs index 03a678791d..49f93582d2 100644 --- a/pallets/fungible/src/erc.rs +++ b/pallets/fungible/src/erc.rs @@ -154,14 +154,14 @@ impl FungibleHandle { Collection(common_mut, CollectionHandle), ) )] -impl FungibleHandle where T::AccountId: From<[u8; 32]> + AsRef<[u8]> {} +impl FungibleHandle where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {} generate_stubgen!(gen_impl, UniqueFungibleCall<()>, true); generate_stubgen!(gen_iface, UniqueFungibleCall<()>, false); impl CommonEvmHandler for FungibleHandle where - T::AccountId: From<[u8; 32]> + AsRef<[u8]>, + T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]>, { const CODE: &'static [u8] = include_bytes!("./stubs/UniqueFungible.raw"); diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index ea6fe94d8b..8da82496d4 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -740,7 +740,7 @@ impl NonfungibleHandle { TokenProperties, ) )] -impl NonfungibleHandle where T::AccountId: From<[u8; 32]> + AsRef<[u8]> {} +impl NonfungibleHandle where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {} // Not a tests, but code generators generate_stubgen!(gen_impl, UniqueNFTCall<()>, true); @@ -748,7 +748,7 @@ generate_stubgen!(gen_iface, UniqueNFTCall<()>, false); impl CommonEvmHandler for NonfungibleHandle where - T::AccountId: From<[u8; 32]> + AsRef<[u8]>, + T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]>, { const CODE: &'static [u8] = include_bytes!("./stubs/UniqueNFT.raw"); diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index ef69cf19c8..16629643e5 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -789,7 +789,7 @@ impl RefungibleHandle { TokenProperties, ) )] -impl RefungibleHandle where T::AccountId: From<[u8; 32]> + AsRef<[u8]> {} +impl RefungibleHandle where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {} // Not a tests, but code generators generate_stubgen!(gen_impl, UniqueRefungibleCall<()>, true); @@ -797,7 +797,7 @@ generate_stubgen!(gen_iface, UniqueRefungibleCall<()>, false); impl CommonEvmHandler for RefungibleHandle where - T::AccountId: From<[u8; 32]> + AsRef<[u8]>, + T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]>, { const CODE: &'static [u8] = include_bytes!("./stubs/UniqueRefungible.raw"); fn call( diff --git a/runtime/common/dispatch.rs b/runtime/common/dispatch.rs index b8f3a658ee..9b14c7d2aa 100644 --- a/runtime/common/dispatch.rs +++ b/runtime/common/dispatch.rs @@ -124,7 +124,7 @@ where + pallet_fungible::Config + pallet_nonfungible::Config + pallet_refungible::Config, - T::AccountId: From<[u8; 32]> + AsRef<[u8]>, + T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]>, { fn is_reserved(target: &H160) -> bool { map_eth_to_id(target).is_some() From 2ba119d71c401390427858fa1c526ccb198c17ff Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 25 Aug 2022 11:26:07 +0000 Subject: [PATCH 0584/1274] misc: update stubs --- .../src/stubs/ContractHelpers.sol | 53 ++++++------------- pallets/fungible/src/stubs/UniqueFungible.sol | 5 +- pallets/nonfungible/src/stubs/UniqueNFT.sol | 7 +++ .../refungible/src/stubs/UniqueRefungible.sol | 7 +++ tests/src/eth/api/ContractHelpers.sol | 23 ++++---- tests/src/eth/api/UniqueFungible.sol | 5 +- tests/src/eth/api/UniqueNFT.sol | 7 +++ tests/src/eth/api/UniqueRefungible.sol | 7 +++ tests/src/eth/fungibleAbi.json | 51 +++++++++--------- tests/src/eth/nonFungibleAbi.json | 15 +++--- tests/src/eth/reFungibleAbi.json | 15 +++--- tests/src/eth/util/contractHelpersAbi.json | 3 -- 12 files changed, 107 insertions(+), 91 deletions(-) diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol index 55df2910ea..5fd5f729e2 100644 --- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol +++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol @@ -21,6 +21,7 @@ contract ERC165 is Dummy { } } +<<<<<<< HEAD <<<<<<< HEAD /// @title Magic contract, which allows users to reconfigure other contracts /// @dev the ERC-165 identifier for this interface is 0xd77fab70 @@ -31,6 +32,9 @@ contract ERC165 is Dummy { // Selector: 06fc42e9 >>>>>>> path: add stubs >>>>>>> path: add stubs +======= +// Selector: 6073d917 +>>>>>>> misc: update stubs contract ContractHelpers is Dummy, ERC165 { /// Get user, which deployed specified contract /// @dev May return zero address in case if contract is deployed @@ -52,6 +56,7 @@ contract ContractHelpers is Dummy, ERC165 { return 0x0000000000000000000000000000000000000000; } +<<<<<<< HEAD <<<<<<< HEAD /// Set sponsor. /// @param contractAddress Contract for which a sponsor is being established. @@ -60,13 +65,13 @@ contract ContractHelpers is Dummy, ERC165 { /// or in textual repr: setSponsor(address,address) ======= <<<<<<< HEAD +======= +>>>>>>> misc: update stubs // Set sponsor. // // @param contract_address Contract for which a sponsor is being established. // @param sponsor User address who set as pending sponsor. // -======= ->>>>>>> path: add stubs // Selector: setSponsor(address,address) f01fba93 >>>>>>> path: add stubs function setSponsor(address contractAddress, address sponsor) public { @@ -76,6 +81,7 @@ contract ContractHelpers is Dummy, ERC165 { dummy = 0; } +<<<<<<< HEAD <<<<<<< HEAD /// Set contract as self sponsored. /// @@ -84,6 +90,8 @@ contract ContractHelpers is Dummy, ERC165 { /// or in textual repr: selfSponsoredEnable(address) ======= <<<<<<< HEAD +======= +>>>>>>> misc: update stubs // Set contract as self sponsored. // // @param contract_address Contract for which a self sponsoring is being enabled. @@ -91,15 +99,12 @@ contract ContractHelpers is Dummy, ERC165 { // Selector: selfSponsoredEnable(address) 89f7d9ae >>>>>>> path: add stubs function selfSponsoredEnable(address contractAddress) public { -======= - // Selector: confirmSponsorship(address) abc00001 - function confirmSponsorship(address contractAddress) public { ->>>>>>> path: add stubs require(false, stub_error); contractAddress; dummy = 0; } +<<<<<<< HEAD <<<<<<< HEAD /// Remove sponsor. /// @@ -108,6 +113,8 @@ contract ContractHelpers is Dummy, ERC165 { /// or in textual repr: removeSponsor(address) ======= <<<<<<< HEAD +======= +>>>>>>> misc: update stubs // Remove sponsor. // // @param contract_address Contract for which a sponsorship is being removed. @@ -140,30 +147,6 @@ contract ContractHelpers is Dummy, ERC165 { /// @dev EVM selector for this function is: 0x743fc745, /// or in textual repr: getSponsor(address) function getSponsor(address contractAddress) -======= - // Selector: getSponsor(address) 743fc745 - function getSponsor(address contractAddress) - public - view - returns (Tuple0 memory) - { - require(false, stub_error); - contractAddress; - dummy; - return Tuple0(0x0000000000000000000000000000000000000000, 0); - } - - // Selector: hasSponsor(address) 97418603 - function hasSponsor(address contractAddress) public view returns (bool) { - require(false, stub_error); - contractAddress; - dummy; - return false; - } - - // Selector: hasPendingSponsor(address) 39b9b242 - function hasPendingSponsor(address contractAddress) ->>>>>>> path: add stubs public view returns (Tuple0 memory) @@ -187,6 +170,7 @@ contract ContractHelpers is Dummy, ERC165 { return false; } +<<<<<<< HEAD <<<<<<< HEAD /// Check tat contract has pending sponsor. /// @@ -196,6 +180,8 @@ contract ContractHelpers is Dummy, ERC165 { /// or in textual repr: hasPendingSponsor(address) ======= <<<<<<< HEAD +======= +>>>>>>> misc: update stubs // Check tat contract has pending sponsor. // // @param contract_address The contract for which the presence of a pending sponsor is checked. @@ -204,10 +190,6 @@ contract ContractHelpers is Dummy, ERC165 { // Selector: hasPendingSponsor(address) 39b9b242 >>>>>>> path: add stubs function hasPendingSponsor(address contractAddress) -======= - // Selector: sponsoringEnabled(address) 6027dc61 - function sponsoringEnabled(address contractAddress) ->>>>>>> path: add stubs public view returns (bool) @@ -216,7 +198,6 @@ contract ContractHelpers is Dummy, ERC165 { contractAddress; dummy; return false; -<<<<<<< HEAD } /// @dev EVM selector for this function is: 0x6027dc61, @@ -230,8 +211,6 @@ contract ContractHelpers is Dummy, ERC165 { contractAddress; dummy; return false; -======= ->>>>>>> path: add stubs } /// @dev EVM selector for this function is: 0xfde8a560, diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index 93368d38d6..7ac77ecde6 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -45,7 +45,6 @@ contract ERC20Events { ); } -<<<<<<< HEAD // Selector: 79cc6790 contract ERC20UniqueExtensions is Dummy, ERC165 { // Selector: burnFrom(address,uint256) 79cc6790 @@ -142,11 +141,15 @@ contract ERC20 is Dummy, ERC165, ERC20Events { } } +<<<<<<< HEAD // Selector: ffe4da23 ======= // Selector: 765e2fae >>>>>>> misk: Update stubs >>>>>>> misk: Update stubs +======= +// Selector: e54be640 +>>>>>>> misc: update stubs contract Collection is Dummy, ERC165 { /// Set collection property. /// diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index 834c0a1eee..e933817efb 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -481,11 +481,14 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { } } +<<<<<<< HEAD <<<<<<< HEAD /// @title Unique extensions for ERC721. /// @dev the ERC-165 identifier for this interface is 0xd74d154f ======= <<<<<<< HEAD +======= +>>>>>>> misc: update stubs // Selector: 780e9d63 contract ERC721Enumerable is Dummy, ERC165 { // @notice Enumerate valid NFTs @@ -606,6 +609,7 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { } } +<<<<<<< HEAD <<<<<<< HEAD /// @dev anonymous struct struct Tuple8 { @@ -617,6 +621,9 @@ struct Tuple8 { ======= // Selector: 765e2fae >>>>>>> misk: Update stubs +======= +// Selector: e54be640 +>>>>>>> misc: update stubs contract Collection is Dummy, ERC165 { // Set collection property. // diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index edc9b83208..5d1c51fafe 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -481,11 +481,14 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { } } +<<<<<<< HEAD <<<<<<< HEAD /// @title Unique extensions for ERC721. /// @dev the ERC-165 identifier for this interface is 0x7c3bef89 ======= <<<<<<< HEAD +======= +>>>>>>> misc: update stubs // Selector: 780e9d63 contract ERC721Enumerable is Dummy, ERC165 { // @notice Enumerate valid RFTs @@ -620,6 +623,7 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { } } +<<<<<<< HEAD <<<<<<< HEAD /// @dev anonymous struct struct Tuple8 { @@ -631,6 +635,9 @@ struct Tuple8 { ======= // Selector: 765e2fae >>>>>>> misk: Update stubs +======= +// Selector: e54be640 +>>>>>>> misc: update stubs contract Collection is Dummy, ERC165 { // Set collection property. // diff --git a/tests/src/eth/api/ContractHelpers.sol b/tests/src/eth/api/ContractHelpers.sol index c1ffbcffa5..dad2aa9d1d 100644 --- a/tests/src/eth/api/ContractHelpers.sol +++ b/tests/src/eth/api/ContractHelpers.sol @@ -12,6 +12,7 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } +<<<<<<< HEAD <<<<<<< HEAD /// @title Magic contract, which allows users to reconfigure other contracts /// @dev the ERC-165 identifier for this interface is 0xd77fab70 @@ -22,6 +23,9 @@ interface ERC165 is Dummy { // Selector: 06fc42e9 >>>>>>> path: add stubs >>>>>>> path: add stubs +======= +// Selector: 6073d917 +>>>>>>> misc: update stubs interface ContractHelpers is Dummy, ERC165 { /// Get user, which deployed specified contract /// @dev May return zero address in case if contract is deployed @@ -37,6 +41,7 @@ interface ContractHelpers is Dummy, ERC165 { view returns (address); +<<<<<<< HEAD <<<<<<< HEAD /// Set sponsor. /// @param contractAddress Contract for which a sponsor is being established. @@ -45,6 +50,8 @@ interface ContractHelpers is Dummy, ERC165 { /// or in textual repr: setSponsor(address,address) ======= <<<<<<< HEAD +======= +>>>>>>> misc: update stubs // Set sponsor. // // @param contract_address Contract for which a sponsor is being established. @@ -90,14 +97,6 @@ interface ContractHelpers is Dummy, ERC165 { // @param contract_address The contract for which a sponsor is requested. // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. // -======= - // Selector: setSponsor(address,address) f01fba93 - function setSponsor(address contractAddress, address sponsor) external; - - // Selector: confirmSponsorship(address) abc00001 - function confirmSponsorship(address contractAddress) external; - ->>>>>>> path: add stubs // Selector: getSponsor(address) 743fc745 >>>>>>> path: add stubs function getSponsor(address contractAddress) @@ -105,6 +104,7 @@ interface ContractHelpers is Dummy, ERC165 { view returns (Tuple0 memory); +<<<<<<< HEAD <<<<<<< HEAD /// Check tat contract has confirmed sponsor. /// @@ -122,6 +122,8 @@ interface ContractHelpers is Dummy, ERC165 { /// or in textual repr: hasPendingSponsor(address) ======= <<<<<<< HEAD +======= +>>>>>>> misc: update stubs // Check tat contract has confirmed sponsor. // // @param contract_address The contract for which the presence of a confirmed sponsor is checked. @@ -135,11 +137,6 @@ interface ContractHelpers is Dummy, ERC165 { // @param contract_address The contract for which the presence of a pending sponsor is checked. // @return **true** if contract has pending sponsor. // -======= - // Selector: hasSponsor(address) 97418603 - function hasSponsor(address contractAddress) external view returns (bool); - ->>>>>>> path: add stubs // Selector: hasPendingSponsor(address) 39b9b242 >>>>>>> path: add stubs function hasPendingSponsor(address contractAddress) diff --git a/tests/src/eth/api/UniqueFungible.sol b/tests/src/eth/api/UniqueFungible.sol index 8689c21184..a7b10766ed 100644 --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -36,7 +36,6 @@ interface ERC20Events { ); } -<<<<<<< HEAD // Selector: 79cc6790 interface ERC20UniqueExtensions is Dummy, ERC165 { // Selector: burnFrom(address,uint256) 79cc6790 @@ -80,11 +79,15 @@ interface ERC20 is Dummy, ERC165, ERC20Events { returns (uint256); } +<<<<<<< HEAD // Selector: ffe4da23 ======= // Selector: 765e2fae >>>>>>> misk: Update stubs >>>>>>> misk: Update stubs +======= +// Selector: e54be640 +>>>>>>> misc: update stubs interface Collection is Dummy, ERC165 { /// Set collection property. /// diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index abda6a3896..8493e1a988 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -321,11 +321,14 @@ interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { function finishMinting() external returns (bool); } +<<<<<<< HEAD <<<<<<< HEAD /// @title Unique extensions for ERC721. /// @dev the ERC-165 identifier for this interface is 0xd74d154f ======= <<<<<<< HEAD +======= +>>>>>>> misc: update stubs // Selector: 780e9d63 interface ERC721Enumerable is Dummy, ERC165 { // @notice Enumerate valid NFTs @@ -402,6 +405,7 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { returns (bool); } +<<<<<<< HEAD <<<<<<< HEAD /// @dev anonymous struct struct Tuple8 { @@ -413,6 +417,9 @@ struct Tuple8 { ======= // Selector: 765e2fae >>>>>>> misk: Update stubs +======= +// Selector: e54be640 +>>>>>>> misc: update stubs interface Collection is Dummy, ERC165 { // Set collection property. // diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index 32711924dd..b08b89205e 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -321,11 +321,14 @@ interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { function finishMinting() external returns (bool); } +<<<<<<< HEAD <<<<<<< HEAD /// @title Unique extensions for ERC721. /// @dev the ERC-165 identifier for this interface is 0x7c3bef89 ======= <<<<<<< HEAD +======= +>>>>>>> misc: update stubs // Selector: 780e9d63 interface ERC721Enumerable is Dummy, ERC165 { // @notice Enumerate valid RFTs @@ -414,6 +417,7 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { returns (address); } +<<<<<<< HEAD <<<<<<< HEAD /// @dev anonymous struct struct Tuple8 { @@ -425,6 +429,9 @@ struct Tuple8 { ======= // Selector: 765e2fae >>>>>>> misk: Update stubs +======= +// Selector: e54be640 +>>>>>>> misc: update stubs interface Collection is Dummy, ERC165 { // Set collection property. // diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index 1313347941..6e32f8076f 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -150,24 +150,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "address", "name": "user", "type": "address" } - ], - "name": "isOwnerOrAdmin", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "isOwnerOrAdminSubstrate", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "getCollectionSponsor", @@ -192,6 +174,24 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "isOwnerOrAdmin", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "user", "type": "uint256" } + ], + "name": "isOwnerOrAdminSubstrate", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "name", @@ -309,7 +309,15 @@ }, { "inputs": [ -<<<<<<< HEAD + { "internalType": "uint256", "name": "sponsor", "type": "uint256" } + ], + "name": "setCollectionSponsorSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "setOwner", @@ -322,11 +330,6 @@ { "internalType": "uint256", "name": "newOwner", "type": "uint256" } ], "name": "setOwnerSubstrate", -======= - { "internalType": "uint256", "name": "sponsor", "type": "uint256" } - ], - "name": "setCollectionSponsorSubstrate", ->>>>>>> misk: Update stubs "outputs": [], "stateMutability": "nonpayable", "type": "function" diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index 2e3b5dc6b3..f8511e27e5 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -483,7 +483,15 @@ }, { "inputs": [ -<<<<<<< HEAD + { "internalType": "uint256", "name": "sponsor", "type": "uint256" } + ], + "name": "setCollectionSponsorSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "setOwner", @@ -496,11 +504,6 @@ { "internalType": "uint256", "name": "newOwner", "type": "uint256" } ], "name": "setOwnerSubstrate", -======= - { "internalType": "uint256", "name": "sponsor", "type": "uint256" } - ], - "name": "setCollectionSponsorSubstrate", ->>>>>>> misk: Update stubs "outputs": [], "stateMutability": "nonpayable", "type": "function" diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index 84e3c54766..2df8d41cc9 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -483,7 +483,15 @@ }, { "inputs": [ -<<<<<<< HEAD + { "internalType": "uint256", "name": "sponsor", "type": "uint256" } + ], + "name": "setCollectionSponsorSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "setOwner", @@ -496,11 +504,6 @@ { "internalType": "uint256", "name": "newOwner", "type": "uint256" } ], "name": "setOwnerSubstrate", -======= - { "internalType": "uint256", "name": "sponsor", "type": "uint256" } - ], - "name": "setCollectionSponsorSubstrate", ->>>>>>> misk: Update stubs "outputs": [], "stateMutability": "nonpayable", "type": "function" diff --git a/tests/src/eth/util/contractHelpersAbi.json b/tests/src/eth/util/contractHelpersAbi.json index dfb07b7768..c3cd1fd091 100644 --- a/tests/src/eth/util/contractHelpersAbi.json +++ b/tests/src/eth/util/contractHelpersAbi.json @@ -120,7 +120,6 @@ "internalType": "address", "name": "contractAddress", "type": "address" -<<<<<<< HEAD } ], "name": "removeSponsor", @@ -147,8 +146,6 @@ "internalType": "address", "name": "contractAddress", "type": "address" -======= ->>>>>>> path: add stubs }, { "internalType": "address", "name": "sponsor", "type": "address" } ], From 9d78c86ffab59240dc9abf46b943599945850d2c Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 25 Aug 2022 11:28:00 +0000 Subject: [PATCH 0585/1274] fmt --- pallets/common/src/erc.rs | 15 ++++++++++++--- pallets/common/src/eth.rs | 2 +- pallets/evm-contract-helpers/src/eth.rs | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 754142a237..c6be777ac2 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -133,7 +133,11 @@ where /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. /// /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - fn set_collection_sponsor_substrate(&mut self, caller: caller, sponsor: uint256) -> Result { + fn set_collection_sponsor_substrate( + &mut self, + caller: caller, + sponsor: uint256, + ) -> Result { check_is_owner_or_admin(caller, self)?; let sponsor = convert_uint256_to_cross_account::(sponsor); @@ -144,7 +148,10 @@ where // /// Whether there is a pending sponsor. fn has_collection_pending_sponsor(&self) -> Result { - Ok(matches!(self.collection.sponsorship, SponsorshipState::Unconfirmed(_))) + Ok(matches!( + self.collection.sponsorship, + SponsorshipState::Unconfirmed(_) + )) } /// Collection sponsorship confirmation. @@ -173,7 +180,9 @@ where /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. fn get_collection_sponsor(&self) -> Result<(address, uint256)> { let sponsor = match self.collection.sponsorship { - SponsorshipState::Disabled | SponsorshipState::Unconfirmed(_) => return Ok(Default::default()), + SponsorshipState::Disabled | SponsorshipState::Unconfirmed(_) => { + return Ok(Default::default()) + } SponsorshipState::Confirmed(ref sponsor) => sponsor, }; let sponsor = T::CrossAccountId::from_sub(sponsor.clone()); diff --git a/pallets/common/src/eth.rs b/pallets/common/src/eth.rs index 5df1476b37..7bc01c5778 100644 --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -60,7 +60,7 @@ where } /// Convert `uint256` to `CrossAccountId`. -pub fn convert_uint256_to_cross_account(from: uint256) -> T::CrossAccountId +pub fn convert_uint256_to_cross_account(from: uint256) -> T::CrossAccountId where T::AccountId: From<[u8; 32]>, { diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index fbedba302e..63a0a3ce6c 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -357,7 +357,7 @@ impl SponsorshipHandler)> >::insert(contract_address, who.as_eth(), block_number); - Some(sponsor) + Some(sponsor) } } From e137eba0a7ea4aff54905e2df3c631144df2d01b Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 25 Aug 2022 13:38:36 +0000 Subject: [PATCH 0586/1274] fix: small fixes --- pallets/common/src/erc.rs | 18 +++++++++++------- pallets/common/src/eth.rs | 2 +- pallets/fungible/CHANGELOG.md | 2 +- pallets/nonfungible/CHANGELOG.md | 2 +- pallets/refungible/CHANGELOG.md | 2 +- tests/src/eth/collectionSponsoring.test.ts | 4 ++-- tests/src/util/helpers.ts | 4 ++++ 7 files changed, 21 insertions(+), 13 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index c6be777ac2..416d410410 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -179,15 +179,19 @@ where /// /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. fn get_collection_sponsor(&self) -> Result<(address, uint256)> { - let sponsor = match self.collection.sponsorship { - SponsorshipState::Disabled | SponsorshipState::Unconfirmed(_) => { - return Ok(Default::default()) - } - SponsorshipState::Confirmed(ref sponsor) => sponsor, + let sponsor = match self.collection.sponsorship.sponsor() { + Some(sponsor) => sponsor, + None => return Ok(Default::default()), }; let sponsor = T::CrossAccountId::from_sub(sponsor.clone()); - let sponsor_sub = convert_cross_account_to_uint256::(&sponsor); - Ok((*sponsor.as_eth(), sponsor_sub)) + let result: (address, uint256) = if sponsor.is_canonical_substrate() { + let sponsor = convert_cross_account_to_uint256::(&sponsor); + (Default::default(), sponsor) + } else { + let sponsor = *sponsor.as_eth(); + (sponsor, Default::default()) + }; + Ok(result) } /// Set limits for the collection. diff --git a/pallets/common/src/eth.rs b/pallets/common/src/eth.rs index 7bc01c5778..fbcc12ddba 100644 --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -64,7 +64,7 @@ pub fn convert_uint256_to_cross_account(from: uint256) -> T::CrossAcc where T::AccountId: From<[u8; 32]>, { - let mut new_admin_arr: [u8; 32] = Default::default(); + let mut new_admin_arr = [0_u8; 32]; from.to_big_endian(&mut new_admin_arr); let account_id = T::AccountId::from(new_admin_arr); T::CrossAccountId::from_sub(account_id) diff --git a/pallets/fungible/CHANGELOG.md b/pallets/fungible/CHANGELOG.md index 1a9fc79147..e922ef073e 100644 --- a/pallets/fungible/CHANGELOG.md +++ b/pallets/fungible/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. ## [v0.1.4] - 2022-08-24 ### Change - - Add bound `AsRef<[u8]>` to `T::CrossAccountId`. + - Add bound `AsRef<[u8; 32]>` to `T::CrossAccountId`. ## [v0.1.3] 2022-08-16 diff --git a/pallets/nonfungible/CHANGELOG.md b/pallets/nonfungible/CHANGELOG.md index 242d2a4373..90cd277bff 100644 --- a/pallets/nonfungible/CHANGELOG.md +++ b/pallets/nonfungible/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. ## [v0.1.5] - 2022-08-24 ### Change - - Add bound `AsRef<[u8]>` to `T::CrossAccountId`. + - Add bound `AsRef<[u8; 32]>` to `T::CrossAccountId`. ## [v0.1.4] 2022-08-16 diff --git a/pallets/refungible/CHANGELOG.md b/pallets/refungible/CHANGELOG.md index b4e5243ef2..3041556898 100644 --- a/pallets/refungible/CHANGELOG.md +++ b/pallets/refungible/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. ## [v0.2.4] - 2022-08-24 ### Change - - Add bound `AsRef<[u8]>` to `T::CrossAccountId`. + - Add bound `AsRef<[u8; 32]>` to `T::CrossAccountId`. ## [v0.2.3] 2022-08-16 diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index ab5025c4b7..e0295305ec 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -1,4 +1,4 @@ -import {addToAllowListExpectSuccess, confirmSponsorshipExpectSuccess, createCollectionExpectSuccess, enablePublicMintingExpectSuccess, getDetailedCollectionInfo, setCollectionSponsorExpectSuccess} from '../util/helpers'; +import {addToAllowListExpectSuccess, bigIntToSub, confirmSponsorshipExpectSuccess, createCollectionExpectSuccess, enablePublicMintingExpectSuccess, getDetailedCollectionInfo, setCollectionSponsorExpectSuccess} from '../util/helpers'; import {itWeb3, createEthAccount, collectionIdToAddress, GAS_ARGS, normalizeEvents, createEthAccountWithBalance, evmCollectionHelpers, getCollectionAddressFromResult, evmCollection, ethBalanceViaSub, subToEth} from './util/helpers'; import nonFungibleAbi from './nonFungibleAbi.json'; import {expect} from 'chai'; @@ -57,7 +57,7 @@ describe('evm collection sponsoring', () => { expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; const sponsorTuple = await collectionEvm.methods.getCollectionSponsor().call({from: owner}); - expect(sponsorTuple.field_0).to.be.eq(subToEth(sponsor.address)); + expect(bigIntToSub(api, BigInt(sponsorTuple[1]))).to.be.eq(sponsor.address); }); itWeb3('Remove sponsor', async ({api, web3, privateKeyWrapper}) => { diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index 91c41f7da6..e87e1d1fe8 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -99,6 +99,10 @@ export async function requirePallets(mocha: Context, requiredPallets: string[]) } } +export function bigIntToSub(api: ApiPromise, number: bigint) { + return api.registry.createType('AccountId', '0x' + number.toString(16).padStart(64, '0')).toJSON(); +} + export function normalizeAccountId(input: string | AccountId | CrossAccountId | IKeyringPair): CrossAccountId { if (typeof input === 'string') { if (input.length >= 47) { From 40371d433f235eea51ba488ed1c0b3b9e10cecd6 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 25 Aug 2022 13:51:36 +0000 Subject: [PATCH 0587/1274] fix: return comment --- crates/evm-coder/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/evm-coder/CHANGELOG.md b/crates/evm-coder/CHANGELOG.md index a45e01ce54..cb8bd85c0f 100644 --- a/crates/evm-coder/CHANGELOG.md +++ b/crates/evm-coder/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log All notable changes to this project will be documented in this file. + + ## [v0.1.2] 2022-08-19 ### Added From 6b71957232bbf0f3f3472587e2fe1c09f172fee6 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 25 Aug 2022 14:21:27 +0000 Subject: [PATCH 0588/1274] misc: update stubs --- .../src/stubs/ContractHelpers.sol | 62 ----- pallets/fungible/src/stubs/UniqueFungible.raw | Bin 2853 -> 2994 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 221 +++-------------- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4272 -> 4453 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 225 ++++-------------- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4299 -> 4464 bytes .../refungible/src/stubs/UniqueRefungible.sol | 225 ++++-------------- tests/src/eth/api/ContractHelpers.sol | 55 ----- tests/src/eth/api/UniqueFungible.sol | 153 +++--------- tests/src/eth/api/UniqueNFT.sol | 183 +++----------- tests/src/eth/api/UniqueRefungible.sol | 183 +++----------- tests/src/eth/fungibleAbi.json | 2 +- tests/src/eth/nonFungibleAbi.json | 2 +- tests/src/eth/reFungibleAbi.json | 2 +- 14 files changed, 232 insertions(+), 1081 deletions(-) diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol index 5fd5f729e2..b76865911a 100644 --- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol +++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol @@ -21,20 +21,8 @@ contract ERC165 is Dummy { } } -<<<<<<< HEAD -<<<<<<< HEAD /// @title Magic contract, which allows users to reconfigure other contracts /// @dev the ERC-165 identifier for this interface is 0xd77fab70 -======= -<<<<<<< HEAD -// Selector: 6073d917 -======= -// Selector: 06fc42e9 ->>>>>>> path: add stubs ->>>>>>> path: add stubs -======= -// Selector: 6073d917 ->>>>>>> misc: update stubs contract ContractHelpers is Dummy, ERC165 { /// Get user, which deployed specified contract /// @dev May return zero address in case if contract is deployed @@ -56,24 +44,11 @@ contract ContractHelpers is Dummy, ERC165 { return 0x0000000000000000000000000000000000000000; } -<<<<<<< HEAD -<<<<<<< HEAD /// Set sponsor. /// @param contractAddress Contract for which a sponsor is being established. /// @param sponsor User address who set as pending sponsor. /// @dev EVM selector for this function is: 0xf01fba93, /// or in textual repr: setSponsor(address,address) -======= -<<<<<<< HEAD -======= ->>>>>>> misc: update stubs - // Set sponsor. - // - // @param contract_address Contract for which a sponsor is being established. - // @param sponsor User address who set as pending sponsor. - // - // Selector: setSponsor(address,address) f01fba93 ->>>>>>> path: add stubs function setSponsor(address contractAddress, address sponsor) public { require(false, stub_error); contractAddress; @@ -81,46 +56,22 @@ contract ContractHelpers is Dummy, ERC165 { dummy = 0; } -<<<<<<< HEAD -<<<<<<< HEAD /// Set contract as self sponsored. /// /// @param contractAddress Contract for which a self sponsoring is being enabled. /// @dev EVM selector for this function is: 0x89f7d9ae, /// or in textual repr: selfSponsoredEnable(address) -======= -<<<<<<< HEAD -======= ->>>>>>> misc: update stubs - // Set contract as self sponsored. - // - // @param contract_address Contract for which a self sponsoring is being enabled. - // - // Selector: selfSponsoredEnable(address) 89f7d9ae ->>>>>>> path: add stubs function selfSponsoredEnable(address contractAddress) public { require(false, stub_error); contractAddress; dummy = 0; } -<<<<<<< HEAD -<<<<<<< HEAD /// Remove sponsor. /// /// @param contractAddress Contract for which a sponsorship is being removed. /// @dev EVM selector for this function is: 0xef784250, /// or in textual repr: removeSponsor(address) -======= -<<<<<<< HEAD -======= ->>>>>>> misc: update stubs - // Remove sponsor. - // - // @param contract_address Contract for which a sponsorship is being removed. - // - // Selector: removeSponsor(address) ef784250 ->>>>>>> path: add stubs function removeSponsor(address contractAddress) public { require(false, stub_error); contractAddress; @@ -170,25 +121,12 @@ contract ContractHelpers is Dummy, ERC165 { return false; } -<<<<<<< HEAD -<<<<<<< HEAD /// Check tat contract has pending sponsor. /// /// @param contractAddress The contract for which the presence of a pending sponsor is checked. /// @return **true** if contract has pending sponsor. /// @dev EVM selector for this function is: 0x39b9b242, /// or in textual repr: hasPendingSponsor(address) -======= -<<<<<<< HEAD -======= ->>>>>>> misc: update stubs - // Check tat contract has pending sponsor. - // - // @param contract_address The contract for which the presence of a pending sponsor is checked. - // @return **true** if contract has pending sponsor. - // - // Selector: hasPendingSponsor(address) 39b9b242 ->>>>>>> path: add stubs function hasPendingSponsor(address contractAddress) public view diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index aabc949e52af579eae754af245332143be518430..88f4d00f5c11ce6e28f4ca52f5a0d32e5a26ab5e 100644 GIT binary patch literal 2994 zcmaJ@32YQq7@pU?L%=Syt7U6C5j7D-L0yzUWD6c33bQNSQAWvoU7!@DT$QLrnR6>b zbaq=&JPV}bb*@#Va+Z0M%CN;SxllB)h<#N5ANf)V9()%@q5x1Zf=g#U{MGvQ`l&8%! zoTukfsb8bSFdAJmr8DVPm995aWksX1S!;xtv`!srb57MpDZ5HRqfKTKG4>$_NKo03 zX_G@}q|qQ$F4aQxysGF>6N@H+W5eLfAF8I&LJ48gYaps9{3&QgjuQN3(;`t&um!Q_N%N`R9A$Gn`)0B!|5D>d>U;ERCc`c`xJp6{lWJZSs+WZ=@LRNE&SbPbK;WIGF*_>Nn&xe_C ztd~RX38BY@tj1#Di-Z!ZSypygK@O4b-XatZkVhGvQUYIXY&&1 zInz5=wxvUYW(6li#UK^8k|%zi77O+9@(QoKa)V*x-*IOLs>$*b3Z70&nIBrY)@#!r z(<5mVB1~8~imE3@h!*hP;FOjAPmBJa5Gm*;G4mJ@{F6(l#4@%2j%hfjE=FW zW8soFfZjPR!O9Meu4myVy=4}D)@0$e1+Awdj$W_}G~V$vj0`9dd@Mo@Mv6Op)?3F> zpVMt{@s9Fvzlw9;AqL5nECOoC9TiiA!xACjOPd;SQj?TJ@BvUNcu*D@b&}we$`-L% z_)E@Q1VnAUczyy%nr1DBlaDO$$w!J7i%cwNy;SaTdq}2dSPl_uNS0iYJCP{0OTx|5 zftwd>;ijUnNFS9QBHqdh&Dtd6Di!|spC8R^4qrcl+)@T<8}NTd(ll$&tY^`fiibt` zCnuZtdr;M~@O6t`0F4WT28&LkO}21_-OM6~3Yx2!M&7b4!Zj6-u4(dGUBL@$TPSR` zb0)9uXcoPznzUtQL^@G^Pz=^D`k3!2Q>CKw4|sH^Zy9~NWOWl3ZNpqB+(V|Ucp9I3 z8j1y)264u)=+VIDH^)RY8)k^c8?02s-Jm*Av7~RD88(cu@ty#qHZW|)sy&a*_2a}; zoM{+Xv`5y_pVL!_-RZk3Va7^cL1G&M_XfXD#2#1ih>Ghpk}fMO_96-?>W$k=8FNU= zwn5wtHrL+c8TUA(N3$GU17gQu|BWMN#LV+`*TH=&wilzjnO_C)tL9$iANRi}<{)8C zCVrluR(z6Umb{WqjbE&boh8ebZuS1pC`ygu-}(Ka#CyqUdxgYaE9 zI16!qI}hjeR$%?nP+lzlm1r?voivG{c}aeei=>Ex+*+jRQ1?h>)Y_r<`CHqoYvJ73~nl_j1-P6N2f znR&au9!)jLX2n~THgXGB#yM5um%PMw)tGPdqZ3WrfU|N#L9@ss{OZ}eXFtcXTdZB)50S9jvo`?c#p`Ee8qg literal 2853 zcmaJ@dx%t39KL7gxq`O4?v9SLHW#)2G0jI~iHpr9m1wkg26wJ;RnFOQUDtHo)t7 zq9)R~MQEU2BUH>)fpkcgRIoXlI)P$Ma$N8HEXh8WV1tOPH`QqnJ$4VOvyb+^B~0wT#S$2WA~3Fp4cW~WC1+0bWT_09*d+Lo!jgf zy&ZvCt(p5QN#NIF#BPTBtdgpXyhDY#RJb`vRg}jmL6uhm>Yr1^Dgsy~=%so!yXL9J z3)PHFkk#zo>Q7EqGvOn^AEykg1Ki@lTIO2>`19iCW3{Z}dBBS;H|Aq^IpD3MzaIsB z8Sw7F=4ZgL#+zL(Oh}{rV5EdkrKG zAs_-;CnkLFs8zFt%Pl88xa*g<8Udd#%JN7c;D z2We)*l{UZ+0UM-in*hH7OfI~42e1@x^|WVmuzL<94nZ0PIQDQd0mvjDsmS@S6{im#A{Z!A}8~$!ItvmsLz;731enKl2TuO?*2t zih#{otYRA9^oxA+FuF6Dvg_)2gA$I_ywAP~z9!~7?GRbT{JhQlILKwf$N8$L-+!5} z)RHzw7sT$97%GnGC<-q?P9xQ&4yi7kvOxO{l0En*NU4AMR)rFhWgVO&#-l=b!nbI`du2D7^(| z+QDFvW0otZC18bMKKr6t1Pc98cOTO=rJ89fxYN_$DPz=HL?fx3L3ENP%#S2Uj=~%v z=pP!7VmOkBMKE)v0zO14B6I;tsb~0>M3W{-*iwQ2 z|M#9srf}g9#1_#=+mQFus&&0;987GI@v*=>UemN!gA$j43nkDGj(&%O1rF1=>8QeC zV}Vpgu_awg8-_tR=hv>gy3TX;Bu}hqAhD&&={&nNEO5P;ov2|XoNxmCY8uX8aI~i> zQF2A)cV_SrPck?&XY{~>^XLnSYe?iJm&2Q`k^wh0VvS|Nmx?m0EgjZyNpWkuz*51v zj!PXCG+kCHF`^lR`&|NBZD>S~m1-XRs%Yms!)aKQM^sUt5g}alROQfPIX5A}dqwpc zzrsUfWPDD>RT_xpB^HV!kxstxV928nN#4|mz1`&8b6w$Hi}Wgng_}3D0`g6k(<6GC z@7orhI3dh4bvM6#@hin%@;{`xdh}t39cT8s+bs0HrRUs~<0SG5C$hYmoP317bh*_3 zN^9tXOVmba{->yU(A3e=yqJCbfbdf{+zVmvIFIlvJj0U?H zYe4DA5yQC#G&~~1=Vj-a75-ahl`+ILgvXPfHtXt8RGsXW++AS@m#{_5sT_Y-Ro2Pc z5)<=@7i~LX;d>dyAba?0uW#R8o*w6y8GLtTd*`YRODENc%ARP~n9XY++O??A@bHw? zwcGcf{q^lXqI-IqZnUZ=&LvlFSid&AKnPa}v%6QfZxFNVJG#4Awp#>lU)Q;|bzN&m Rck4>Ay+iC^-R&D&{{_Vp*W~~J diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index 7ac77ecde6..bdc7e8865d 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -3,17 +3,7 @@ pragma solidity >=0.8.0 <0.9.0; -<<<<<<< HEAD /// @dev common stubs holder -======= -// Anonymous struct -struct Tuple0 { - address field_0; - uint256 field_1; -} - -// Common stubs holder ->>>>>>> misk: Update stubs contract Dummy { uint8 dummy; string stub_error = "this contract is implemented in native"; @@ -31,125 +21,8 @@ contract ERC165 is Dummy { } } -<<<<<<< HEAD /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0xffe4da23 -======= -// Inline -contract ERC20Events { - event Transfer(address indexed from, address indexed to, uint256 value); - event Approval( - address indexed owner, - address indexed spender, - uint256 value - ); -} - -// Selector: 79cc6790 -contract ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) public returns (bool) { - require(false, stub_error); - from; - amount; - dummy = 0; - return false; - } -} - -// Selector: 942e8b22 -contract ERC20 is Dummy, ERC165, ERC20Events { - // Selector: name() 06fdde03 - function name() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: symbol() 95d89b41 - function symbol() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: decimals() 313ce567 - function decimals() public view returns (uint8) { - require(false, stub_error); - dummy; - return 0; - } - - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) public view returns (uint256) { - require(false, stub_error); - owner; - dummy; - return 0; - } - - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 amount) public returns (bool) { - require(false, stub_error); - to; - amount; - dummy = 0; - return false; - } - - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 amount - ) public returns (bool) { - require(false, stub_error); - from; - to; - amount; - dummy = 0; - return false; - } - - // Selector: approve(address,uint256) 095ea7b3 - function approve(address spender, uint256 amount) public returns (bool) { - require(false, stub_error); - spender; - amount; - dummy = 0; - return false; - } - - // Selector: allowance(address,address) dd62ed3e - function allowance(address owner, address spender) - public - view - returns (uint256) - { - require(false, stub_error); - owner; - spender; - dummy; - return 0; - } -} - -<<<<<<< HEAD -// Selector: ffe4da23 -======= -// Selector: 765e2fae ->>>>>>> misk: Update stubs ->>>>>>> misk: Update stubs -======= -// Selector: e54be640 ->>>>>>> misc: update stubs +/// @dev the ERC-165 identifier for this interface is 0xe54be640 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -209,45 +82,56 @@ contract Collection is Dummy, ERC165 { dummy = 0; } -<<<<<<< HEAD - /// Collection sponsorship confirmation. + /// Set the substrate sponsor of the collection. /// - /// @dev After setting the sponsor for the collection, it must be confirmed with this function. - /// @dev EVM selector for this function is: 0x3c50e97a, - /// or in textual repr: confirmCollectionSponsorship() -======= - // Set the substrate sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsorSubstrate(uint256) c74d6751 + /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + /// + /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. + /// @dev EVM selector for this function is: 0xc74d6751, + /// or in textual repr: setCollectionSponsorSubstrate(uint256) function setCollectionSponsorSubstrate(uint256 sponsor) public { require(false, stub_error); sponsor; dummy = 0; } - // Selector: hasCollectionPendingSponsor() 058ac185 + /// @dev EVM selector for this function is: 0x058ac185, + /// or in textual repr: hasCollectionPendingSponsor() function hasCollectionPendingSponsor() public view returns (bool) { require(false, stub_error); dummy; return false; } - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a ->>>>>>> misk: Update stubs + /// Collection sponsorship confirmation. + /// + /// @dev After setting the sponsor for the collection, it must be confirmed with this function. + /// @dev EVM selector for this function is: 0x3c50e97a, + /// or in textual repr: confirmCollectionSponsorship() function confirmCollectionSponsorship() public { require(false, stub_error); dummy = 0; } -<<<<<<< HEAD + /// Remove collection sponsor. + /// @dev EVM selector for this function is: 0x6e0326a3, + /// or in textual repr: removeCollectionSponsor() + function removeCollectionSponsor() public { + require(false, stub_error); + dummy = 0; + } + + /// Get current sponsor. + /// + /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + /// @dev EVM selector for this function is: 0xb66bbc14, + /// or in textual repr: getCollectionSponsor() + function getCollectionSponsor() public view returns (Tuple6 memory) { + require(false, stub_error); + dummy; + return Tuple6(0x0000000000000000000000000000000000000000, 0); + } + /// Set limits for the collection. /// @dev Throws error if limit not found. /// @param limit Name of the limit. Valid names: @@ -260,39 +144,6 @@ contract Collection is Dummy, ERC165 { /// @param value Value of the limit. /// @dev EVM selector for this function is: 0x6a3841db, /// or in textual repr: setCollectionLimit(string,uint32) -======= - // Remove collection sponsor. - // - // Selector: removeCollectionSponsor() 6e0326a3 - function removeCollectionSponsor() public { - require(false, stub_error); - dummy = 0; - } - - // Get current sponsor. - // - // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - // - // Selector: getCollectionSponsor() b66bbc14 - function getCollectionSponsor() public view returns (Tuple0 memory) { - require(false, stub_error); - dummy; - return Tuple0(0x0000000000000000000000000000000000000000, 0); - } - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db ->>>>>>> misk: Update stubs function setCollectionLimit(string memory limit, uint32 value) public { require(false, stub_error); limit; @@ -499,6 +350,12 @@ contract Collection is Dummy, ERC165 { } } +/// @dev anonymous struct +struct Tuple6 { + address field_0; + uint256 field_1; +} + /// @dev the ERC-165 identifier for this interface is 0x79cc6790 contract ERC20UniqueExtensions is Dummy, ERC165 { /// @dev EVM selector for this function is: 0x79cc6790, diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 45c1c73831d922618ad66037d4da4eef1cdc0e24..a428c0703df3a1ea56bf0c801875b60b604cb5ba 100644 GIT binary patch literal 4453 zcmai23vg6d8NR2RZ1$aONCI>j*+MD4DAc+XrYH+7$`lJXJ7l+dl{qJYhG2L{Mu^CL z?gkjj-A#D5&d^e=b;hAZ>@ZD7r&2^l>I1A+tCTXeh;_zs7!f;7<9F`4cXOAbW*_;^ zIsg0r&wtKcdWmLp^e(DuTF&m2lJn`2xs(7&Q*0gIf6OcLr`1-VSp_PoBZ}N9k?-b} zuBD6nH_}TfD&^<`T9>1DQfWk?MAIhOdYcOR&H~+`x0Pjuru8N*fElCU=bBRGlFPQ7 zSLkFt$@TmWdSDDqYiT;!BD8*zMrgX&#Mh1&WEF(YtWF?X)13JW1zqc)gn;BnFj$uP zC$DJjl;D+31vE$WjRFX6;B#MIfg4R4zQX2mOgx-dO#IskGtw%ZY$V}H3sx7y7!#Vw z%z|tgq+OxXL>egCsYw&tD6#C+c&h_^7r-Z3p3xJFZDmDwEF)VB14YuVcMO?i2yrbF z+k}|BHT}(3R`+yggbeshI zh6`I*;17UTt*fV7SpBa6ub+7H1R$62-bnw#7FIV^=n`VE^c^gndAPeBOGg2J)}Q|q zW={bA^3IX9fIsmVp8Dj8RZw;nOB`aU7x3BoCx*e>3V6JE++J7A3txSy1q9nXUT(f? z-NEE@XRsuL;n4j%UIbj>QGIReL-XJycc*{*yT1U;yAV_h0k^Mw3GM`50klrv{&UA2 zwX5=WCnSz}#>HSfA5>eWX76^Xww~*@0b4y~YvwF?0~$_(ibH4^2e>Y9*HKVC4!Gfn zeh+5v0NnJ^Q_}%wdb~U_p!ye=G_TE?#{B_ zb5{Uoxe&Z>0LsHlcL4I>7G?!M0m!q_mAm63@b~YYL@owPU07PUzjw7u_29EZD*#{h zsOHI6w?RV%R2*W7yOUk~{=Z#@?8}W40iVb00^=)R0Q|AX%WcMZBbH|Neff)kI{;@d zpA`h$<57iIJoAGj3rxe(_}p*%p={KJpt=WeLR%bV`Z<0H5GecD-x?zEZ%BM>}MJ!z{3GHmzg9A~tFLJ9$OIJ7$$}BI zhitpu+R8fw;aDvP>}w7kUmO$CaEy;Gv*2`xg$0JoHVfU)Cr4b7p{34})7g%s0(QC0 zkqT13pwKsKM%;|5rJ++8)qTEd*RA-&GyNRlZ`F)`FZhLvLX+okq(e~hK=?Gm=CPpE z+7|tie=WKlBiQE3uHlQN{W4>{em)+RF@5od8YzzVms$O1cuJfQ^Z5G6S&gWgV8v@( zkN*{v^*Rea$djP9>*9n#9-J&xa70uzQn4#Ja#KPQEnJ6ZgfQ0|#U1@#f)o9mazvyD zr&oLD=TfiIKc|qUI>Lek6_NP1QvjQej?^nWeF163z_4yBB*v`%vNm>j6G zaR70pT%VdzQNS%MsEHjY4s8isW}vy11rLg87JL%n*_c-bE6y1V>pY4V1%;MzYWGqq zFi~sc0-qG~{>y>yN&y>f+yMA1%MWs0ZyMjq8X^UJSnxa#M9vmlVzN%?WSpKKrk(@p zIUcoZxlSh=q?t9e*O=w#fc!P!SmSW8hV8hUIFhk@Swj;p7Fy1vX`@I;5~LMZ08Qg! zk~YYFR4Vg33o=#CRl|S-+pu_~8r(xs&y;0OF2dpIeNzZy4ewfd5!$kOr7X)8x#HZB zB&}UFkuK-r!$PS7u1OZrNPE#B$R6lNakFq@4&#tg#DlxpW)WPMYP3P}#LObl6~_?z}QY(}VUP$qe3<|B#!1 zr$RU(7a~z=7I{=cuM06orh=%LV^L9YEo7nVu9EO=C1XH@Wl*NsB0&%xitq&2ZWf+a z)Jy)z$rV?ZN>!`Gm4z1xVzVapVZ~F@UD918L$b`mTX6rx&O=dGFfzGXXH>?hLa95l z<;uSD5K?uMXW`?X*kRKN5EpWm7mG7O5oF;mxcN))x|I_Co8Z)|W;(7$0w@ zS5Rps)K`g@S~H6rb>}iH@&b!Iud~Rf(9+zEL+i0EQYbuJg*9UDGPp6X2@cC5ih+wW zi!Lsx84I^|7WoHX(ngdbQTGH;&Sd8}tT(u`EZWF|f5|HYI>~6co%k+suITjYdS>r# zzEPc>r0*s<+04o1BEg$QaFEIB0e;iwf7MOqb*yNwFbf@Pw5C=0%0Frg8Wuey%Aap) z)mOicIX@IcCc215isM-Hr(#0Qu;_29A>xlcPIPo)5Zgd>26%L$*939JBo#$B5uRAG zU}W?hpTP5k&7wEZpZDG5g>Q4kGOm%a&yM91HoCRvWt5v5bN9c08~NOg?eHWG815eU zu)DFR1yR-AnCm~>jh*^`?#3?P!d(`-AuRWK9lKJqTjIA1zOmiH{fWEJtt>vT+E8&a zIgPh#6n{=)<9WfW`g^Tc2Jy{e5oJ(4g&=sRm}T*OrjEVLJM|FndG7vq_i+5VTUzDj zpT*Dntzz-Fc<*xp>of$>^sBu#KH}<31ifPOv+z9O?KZi@$35bEEvM5A$}F+KX=S|o zqRnQVjzOt!Q}d7|+&eZ)tgrS#9v6RibG=JE=IJV2voHA~CQf(nQ09ZX+r1hjP|9zQ7t6BJ-no z&en5gYb)B9PWH=UR@%)u>@?2EBJU)P^9tH>lizGCV(%oZacW*M2==@p4;?xvwhYhN z2T!f++3@J*N2WBV=WeTi=j5d$B;DJ$x@U8`YyG;uO{}Xg4cxPKL+`4!tJd|cTAA)ymtM#EdbX_k58yDwb^rhX literal 4272 zcmai13y@P+8NP>Xl1(;=yUT6>L%R`}>R4X22E;OLD6M7sfV+`RYHy|IY*-4)V+-3l zbfw%^5*}i2vI~W2X9PxV869uAL6nCwbbJizP-KhWIp^N&4We#x zv)?)A|Nry9&$;vz&F1J$R5y&A)2p;@p}Xf$0;EiGO#Hr^*VIqyoj@}SRMAH?wO1i8 z#Qz@$C=sen#qf@9dqETWP6CE?DgTA*wH=4<+s?oIBY6LK275rS2>Rf8o zQS%z@GTZn*zrsFHhNg`)?J5x(oM;f5F1PZv{RLGAp_nxZWE+NmnLyfdfyR0@?(t*_lP{zj2 zWJWO~5DS1jyC?~6$DKsPN3!BQM+w2*($uRs{ zC5{a($%D|cWOCif&O)U`x`o_LPKsViLbTDt4Nz5Z7%AfPz!sKx8(t-cs4|Bt7eAmn z;)cL5rPYlKZJO1}0ykllp{FM5#bWLwH?}cysGt{XXL?@;Yyv#AZPCd#rtAegeqYZa zz%RS7g9V-fJYPD0q=N+)0RHp9?+yUw0WXgX-U))&^{tX;ZyV80XzuUzuUY8@QA1LjPM=H+Sr&cVQHTA`TGH90^YT6cnM(Cg<#-DEn0c( zkANEi)t47;1l$H#m>IemuT0K**aSh?I!#rMUy6H7A&9{wEQWWZUA zXNCZ80i3Ize-iKx!0du6?*rb$;cFk70NCTHA6fGJ_o3(+ERDoL0S%A`GQ`^60_^8-#B^T|D~$nY+) zB)ZS;RKTewg;bFG1%=;e7;!b~nl>l+=t5nu>+v@~*}(B9|0ps=@=FutPM*P$-I9_! zVsuBY^QcoAb&Gz(zZN~pM;Cmyj`Fp9(J!;*pr23f;Kd@AYmg$WFSDlK^Ndz z4PA;*P*NBfkz%J(feA*E3w%$``_Eb5>73QO9UP|oBhEzAY#rChLOlgMEOZ06E$7J0 z?J^1N!a?+()E1~MkJ{DT#F0tbS?IY2wZtBf{~|bE6dWvc6vw=fj3Q$p4QI5GvuWBY z6Ve9K6RrT7#u=Zs$ZV=q`SDMxPBm9|1I|9H#61;`OL{X?RXMqIhr4h1<8qOOXO+w{ zcH5fQs;XL3YvQ`07~Q&^ql&mgu<)`1ZX6|IknXZYOp+rkd@l}Z;d3a5rT~9%Gm|BP zn}=G%16QSy9SZ!;cehzMi>Z2)!rzh#s2SlVU23-*w-FI5H~45#b#vbJG(Kyw@cz6u zOw&Wo5XlT(6aQv6{vty-As3=hYL~fJnkP#!R;C88*rQ(2al>NG^W06EAE;QHq+5nm znk^GJQBo9Ly;*aA*{t|Ir`FuPbgGvsVlzh)+YP>N{-(Fd{)*{tGOVhs`88bSP)tbb z8b)vOZN;dH(Fsc3k)zhOSBDX*Yb_gb#YRGKHtdFwNC!_AF+vh#VJ^7&NAkLv5}7SI z&AOVx)W||l;6r80wG_^PK+hSGeo3MF(+IwHi->zPvZH`UB)Ce0DP$`zA|6&<1|)L8 z+vQbHZCo?4hbKkq@>@w|RFGd4o@(tZ@@IE0!=i*mu9z&c0bR;192!Jfq>y;HRT{+E zVnLZ`T5^<1M6+-QWl`K$G9_GqS#&O6GDfsA(YFPV&Sdjg%;wx#7JZ0?Zp~|(Op-Bj zoAFx_Tx;v=`qNu^p^8c}x00M{=hSMM;LD;oZ&dvmere@@^&;~+R`j4$3mxlfL#y(o zfAk$m!=h(o`tzdJefi7PX;CDRjV@x4@>tf=CMWa^Yw4=Hh`&Jy@0i3Qjs@>*;@)Yw zT@u%9QqxQu?rC|rU}el4pTO1JVJ-9Xn!f!SD}2S(qPt4AY#xmzbaZpii>Of5t$%+R z`OIzku_x)c<<`J;%>9cbs+${g?T5Ls#Q!rlHtjm*veOq&vWbF zt>M_eBw3?YaX0=feuG~t7N5#{pKz>b2(szddu^P*+VRU_yxU7QKMRi&zHXC?KkgAf zRT75dnYuYUcu>6gd%jQnlOX=O}o|0Ao)Dhx+hu;Pin Fe*?gafN}r; diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index e933817efb..bff0092436 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -3,23 +3,7 @@ pragma solidity >=0.8.0 <0.9.0; -<<<<<<< HEAD /// @dev common stubs holder -======= -// Anonymous struct -struct Tuple0 { - uint256 field_0; - string field_1; -} - -// Anonymous struct -struct Tuple1 { - address field_0; - uint256 field_1; -} - -// Common stubs holder ->>>>>>> misk: Update stubs contract Dummy { uint8 dummy; string stub_error = "this contract is implemented in native"; @@ -115,7 +99,7 @@ contract TokenProperties is Dummy, ERC165 { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0xffe4da23 +/// @dev the ERC-165 identifier for this interface is 0xe54be640 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -175,6 +159,27 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Set the substrate sponsor of the collection. + /// + /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + /// + /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. + /// @dev EVM selector for this function is: 0xc74d6751, + /// or in textual repr: setCollectionSponsorSubstrate(uint256) + function setCollectionSponsorSubstrate(uint256 sponsor) public { + require(false, stub_error); + sponsor; + dummy = 0; + } + + /// @dev EVM selector for this function is: 0x058ac185, + /// or in textual repr: hasCollectionPendingSponsor() + function hasCollectionPendingSponsor() public view returns (bool) { + require(false, stub_error); + dummy; + return false; + } + /// Collection sponsorship confirmation. /// /// @dev After setting the sponsor for the collection, it must be confirmed with this function. @@ -185,6 +190,25 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Remove collection sponsor. + /// @dev EVM selector for this function is: 0x6e0326a3, + /// or in textual repr: removeCollectionSponsor() + function removeCollectionSponsor() public { + require(false, stub_error); + dummy = 0; + } + + /// Get current sponsor. + /// + /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + /// @dev EVM selector for this function is: 0xb66bbc14, + /// or in textual repr: getCollectionSponsor() + function getCollectionSponsor() public view returns (Tuple17 memory) { + require(false, stub_error); + dummy; + return Tuple17(0x0000000000000000000000000000000000000000, 0); + } + /// Set limits for the collection. /// @dev Throws error if limit not found. /// @param limit Name of the limit. Valid names: @@ -403,6 +427,12 @@ contract Collection is Dummy, ERC165 { } } +/// @dev anonymous struct +struct Tuple17 { + address field_0; + uint256 field_1; +} + /// @title ERC721 Token that can be irreversibly burned (destroyed). /// @dev the ERC-165 identifier for this interface is 0x42966c68 contract ERC721Burnable is Dummy, ERC165 { @@ -481,58 +511,8 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { } } -<<<<<<< HEAD -<<<<<<< HEAD /// @title Unique extensions for ERC721. /// @dev the ERC-165 identifier for this interface is 0xd74d154f -======= -<<<<<<< HEAD -======= ->>>>>>> misc: update stubs -// Selector: 780e9d63 -contract ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid NFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) - // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) public view returns (uint256) { - require(false, stub_error); - index; - dummy; - return 0; - } - - // @dev Not implemented - // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - public - view - returns (uint256) - { - require(false, stub_error); - owner; - index; - dummy; - return 0; - } - - // @notice Count NFTs tracked by this contract - // @return A count of valid NFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address - // - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } -} - -// Selector: d74d154f ->>>>>>> misk: Update stubs contract ERC721UniqueExtensions is Dummy, ERC165 { /// @notice Transfer ownership of an NFT /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` @@ -609,37 +589,11 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { } } -<<<<<<< HEAD -<<<<<<< HEAD /// @dev anonymous struct struct Tuple8 { uint256 field_0; string field_1; } -======= -// Selector: ffe4da23 -======= -// Selector: 765e2fae ->>>>>>> misk: Update stubs -======= -// Selector: e54be640 ->>>>>>> misc: update stubs -contract Collection is Dummy, ERC165 { - // Set collection property. - // - // @param key Property key. - // @param value Propery value. - // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - public - { - require(false, stub_error); - key; - value; - dummy = 0; - } ->>>>>>> misk: Update stubs /// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension /// @dev See https://eips.ethereum.org/EIPS/eip-721 @@ -670,92 +624,7 @@ contract ERC721Enumerable is Dummy, ERC165 { owner; index; dummy; -<<<<<<< HEAD return 0; -======= - return hex""; - } - - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) public { - require(false, stub_error); - sponsor; - dummy = 0; - } - - // Set the substrate sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsorSubstrate(uint256) c74d6751 - function setCollectionSponsorSubstrate(uint256 sponsor) public { - require(false, stub_error); - sponsor; - dummy = 0; - } - - // Selector: hasCollectionPendingSponsor() 058ac185 - function hasCollectionPendingSponsor() public view returns (bool) { - require(false, stub_error); - dummy; - return false; - } - - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() public { - require(false, stub_error); - dummy = 0; - } - - // Remove collection sponsor. - // - // Selector: removeCollectionSponsor() 6e0326a3 - function removeCollectionSponsor() public { - require(false, stub_error); - dummy = 0; - } - - // Get current sponsor. - // - // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - // - // Selector: getCollectionSponsor() b66bbc14 - function getCollectionSponsor() public view returns (Tuple1 memory) { - require(false, stub_error); - dummy; - return Tuple1(0x0000000000000000000000000000000000000000, 0); - } - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) public { - require(false, stub_error); - limit; - value; - dummy = 0; ->>>>>>> misk: Update stubs } /// @notice Count NFTs tracked by this contract diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index c12a635e148d4ff66fbee8eb72861f2f9df151a2..f60f02ce7ea959994e8c904f35f8f41158772912 100644 GIT binary patch literal 4464 zcmaJ_4RBP&9e?X3m;25K$srsy*Wf^BRG_wpAEna+)KaYSa*{ipN1fe-08t1u1Smy@ z_i=X#P~qJrAQYKNQA(X!YL&JOQZ3_vwpAISqfRZzOvMiE*p5TT(nz4c-F@%!g0(r` z@!Q@1*Z#kD-_dh4ouN~xZWtN6U8$c>hwh*RNNKT6eE&JCsbAHbfM(>VqK{~5yFz}F z)jIB1dfv;eGAtvt2YI*#(8D=DP+HBQhCyiL02V?Tk zOs415f<;<2s!X81qMevDAx=rbPK+G zN8At?rqnrcp;a^MnD23nQuN#;y<>6TJVQU0JE5=VE&#b7)iRBI=vr#V#XUtekiCS7HZ+&=p~XgCZi4x!;@z;54^r$F^% zz*R%$moa-MV9%FcnF`2L3H2ibgK-^}mgX0H=xA70iYb`A!KIpB^Nl6-?7CM#H77qU z2FL)_7w_K$IKzS9{TEHKcn`!}2iTGM;tj&1j$SSXRNYvbvvc_}hvBYg z1|J4|7qbhNzy4Ri4_y;xsTaNvWqYy2A(r^g((^9=$Kg#MtDOLN6tlCf?|d8Z_bx9t zA7dVk>Ai~{0^9;PbKwj>;4YUc`0#-j>Y0ykXME=E4S*pBf@&7v_3l-cu4m%p!$+kR(Tq?Qxy90m+xRfo&3VI<`=ywC0h9hFbc%GV-PFXJ1>smP`Rt2=jxUZ1sX4+&A2I)}f`$1`lx!Bb2a{C+ zM`Yk3u_T(@P{L=I;zBA&y@CShYNKKU+>DB)fj7ClOvSGM#UH%W%MnELALS2zAo=AM zr6za7Au1`kBSty6&7)2kYg@R}yB6-p2(~%0$M8jN^2&^?8#6lVl_K@Ik%_J!BUAX| zBUYW|0TK@9-X1kJipK6Sc8u#{wO-2DB8;l{F#iG`61~-wM-QSRVp7K0Q8q}~E@y}n z9#^e2&>abll>oPNQvA%m+(z6;#}afa^8DS@Z2t7qm9b||D^euZkl!Dn^;X#4iEF6 z;f~1IvLu>KLYr}rewKPJsOP%Wj^!q8wnzi3Sv1Bhp#$>QfMbo|U^V@?rU=QXURIO9 z9mB}vY0@eZQV-I-jsTj(9VKaz+o)3F*B4TP*15W%!hHyeIM4>caJ=R~L>45Dl3=vY z>X&XAP-(hI;6zC=*|D1iXB5poujkaVqf4iHp^qyIs**TA#`nP`u9BWU(@`?0sw`;W zDvHWOQkOB>&ee)h38TG~IwM;x?1Ziv+-25YX zolFV-TXLEeGsRXzF-Kr%V$pJT3THr|>x__lZ}+AVeC-qw_h=}a!y^)0rPT>!D=#7* zR$T@p)az>5=$egdGIY37q%A*`R7M~2tBG^cQAHOeA^ z#KW!FAodoE8*@%_6beMMaEE5$2XcCEP-+i1bd~0Pry?rY$R8dLhR+3Tk8MRa-_{Tyx$W;9ae(C0al_GOHR@k{` zqGMeh)2ck_AKoKPXW^%1`tzdJJ^3rl`K=_%ql*}%IF5zik`sE0h2O8Zh`#{|@0i3Q zwgvC>bMJ(&NaAvylr=LC_e3V;tdyDI6L__-S;U9_yyKc(c#12Mc8rXCYc!Uy(aAkG zqTJMoQ~%yF5`|hRo(O;4;8&l>&VtC`0hL9b79}FHo2Er3QtC+-A^L>Nc&bugyeWCB z#>xE1$1drx<&@fIy&8>6qKa3eQ{@D_8b$6oiT62PjV_eLW4y|uk4Oi3oEzmAuF-xM zbz0zPQS!Y-_c;bf4_5j%4nWc0JFenSeUM?crDu*2ef9eR1)#OdI z41ORC^499K8OLF<7D+bNs@Ux=^Icx6SnL7bVufQx-;rlarKQJKx@_NbbK1+|aYk&n zOS$h_O4;ENH4BGLexX5$X-q=1w&FUAox<+~R=lig1q(kDu-HEk}) zp5JT=#NJF;?X;|B5!Ae<4({G1ONKl1%D%;2tCp;Ou%#jS^4p*82sdaeSFZb0v}fCy zsb3h^@{eE7UN*nDZD{{X!@sz^c=gKV9dngHo${65WnHV29V@$gdss(r61Z!{s^y(4 UI=g#27bm;AlijShYi;L$0l}clg#Z8m literal 4299 zcmai13y@St6@BgO{6E=U*a4i43=lO|!pG8q5K_s2CQ?ZxZ%1|}_#)N4!v;15WPt@G zEAoCbyST=@nO%OO2$UwIQbjaUh62hmWr)9EBBTtKNkkJ(@K;*Vh!o3uy8FG^x5Up5 zGo0?e_xA16_xA0k=V`t`KR|WEC^%h8^Ec^%g_Hm(GaVDZuM{=)qk0?Ayb@LPQBCbq z$l;<^UbeJ<13jOiN`Wq>O$B-#RYo;R45QsK(>mn4N_4xKuBjT$n$1Q4JyyxDHM60m z)*Q8{(dlLjpXX)F17~Q~$kOQ*LWAuFq1kFPAA72#>JSvYCV_3k5dCLMrqM|WfynpZ zu&VNJQ8PLy!6%;y7{c_$5(F;dyP&9H8O;WMqV{rhe6pz7_-_Z?$m(>u)q<5w#^_Qw zV`FAAx1?4q(xFjh8VyvPO#8GnB^4(#rP2w#v(Qs2p3~E+>6&H=&&bx&V3l;3og+3G z0k1XU*zl6v3ok1s_nqu14OB>nusi5v=*2Wl8=ZUsstOGwL!3^mg{A%sR>?7{ETqcY zSE!DC!^SYB+1(e~G{2bz7NeD;=iBvixiI5>EsPv1>E-$xT|WeD0(`1<(jzTQIRtq2 zuFhkCpLgM87T61Tp>pBWWELy~zH{`~M*%kgUK;IR0)gMkxuluNtf>n_Kk6^O3aL*3 zzHr^>I>1g(YVV@$$1%fe7~&8^Hvk^G@n|>TLcqs^Up)b{F9ANW<x6}F(CJDPs_K^8@$$&+IamBK8TfZ7q>pY+5x=Fg|6BDZGZe36s|$(L3<{Kmh4))#+CZ`<0C5pzvM~XqF#6iGpvOa zhZy=aV1DW4f4K_zXRetB*o)r9)@SYp{DP;;eMXx*I=An>6@a$_&R;$+1bDY66Q>%4Q>WfJStjd-(Cg0 z18~xl`5d4Zf?edxwmU+`e*74q2BF}YfCk9-IK*0h4miZ&=xYH$9zc<)t(O6hl#sAE z%~)Us3oM^cn^^Eq$g$woqNbp8Jqz^k&QOYXeht~3?{M1Mc!Cp-^;*DrTgdUjaU6#256+_}+I*E-@@-@)jIDAtgBx<1=!f$4QYI9&fSl`^RFhqXpkw+Y|KSRlm*n z8GkFW&~HV~=gp9K$!}9~0g7XMg9PE6?Qv(5bNr?zQkQ&Sg5=Y@)i5QT^;*)3w`s}W zaLJRBauk$~t~)ZP>F+Y2zKO8l2zEIY7yHU119ed0W#_+1(f={1=XAswPOLX&HptSb zpoZFk);1QrBD+~AY_j0XMQyk)Djge+n7Eq-mBsYB3{zu&X7ZJh*xesr?6VjYL zf&0ia-Xy07Om~tI6$W3yEf2|rpsu6!2R^N6)zG>~soQeY`p()2w(6>tMW?!EqccD@ z)(s=kxja}z3qg>_a-q#XQrC@?XhCY44L8M7qdlI%%~i`?Dae39kBsP$lu-R)1g_mA z;*3VWUBXucxJrW=L@Q4szOB04kmw8EEayD8aRbF1o)ziKKcti~fcP5Vq1MV`QMWJ0 zV(lz8#bnVvIHlagp+TfY27!kQr$L-AT5u+|NNQ9nM6+-`Wiec3auwW-S**l|j8Uyh z^oIioXR>1wde^zVEVh}2mKC)@ljMxT4*U)Xt%n=q`yLtMi7GP593lnPE~vFC!9Ny5 zy;1eu{65S78cF7zSg|wGEu2_m6OJlh_{ZLnGAuSG!=ER$?u%dUPCO%pY@8wnsZL_? z8)b){WAU3C6!FJ}V8jBc72kw~d8 zSh(rL3|BERyOCe~Q1WMu8~F+M=Ef48mYZttW;L-v+H0_yFl7f=O*sFL)x?uhcmk^| zaY_>8BR7Ha>)Y^zTmQzBQmk#%U0X8RIJZ#%#ra+y!=H$s!RTQV;P5p9iP z*T#}X&v2J*;>h3yVT2#8?lI#MmfR-ACVG_|_LRTw_lhNt@FP|bE6yERTN+1t@+Y3! zSudvjDn2rjfA=Iuua=Z2Ja)}Ov9XsMl$b_44r?o|v(#)n!L4*%)hZTV;4F1#;{jeN zQ2G9@jA{c_Vj(56#K3bhwYtQgzAUw^#8P!7iyB$w zCrRp1$yjcqHaZpJ>>w=0.8.0 <0.9.0; -<<<<<<< HEAD /// @dev common stubs holder -======= -// Anonymous struct -struct Tuple0 { - uint256 field_0; - string field_1; -} - -// Anonymous struct -struct Tuple1 { - address field_0; - uint256 field_1; -} - -// Common stubs holder ->>>>>>> misk: Update stubs contract Dummy { uint8 dummy; string stub_error = "this contract is implemented in native"; @@ -115,7 +99,7 @@ contract TokenProperties is Dummy, ERC165 { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0xffe4da23 +/// @dev the ERC-165 identifier for this interface is 0xe54be640 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -175,6 +159,27 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Set the substrate sponsor of the collection. + /// + /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + /// + /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. + /// @dev EVM selector for this function is: 0xc74d6751, + /// or in textual repr: setCollectionSponsorSubstrate(uint256) + function setCollectionSponsorSubstrate(uint256 sponsor) public { + require(false, stub_error); + sponsor; + dummy = 0; + } + + /// @dev EVM selector for this function is: 0x058ac185, + /// or in textual repr: hasCollectionPendingSponsor() + function hasCollectionPendingSponsor() public view returns (bool) { + require(false, stub_error); + dummy; + return false; + } + /// Collection sponsorship confirmation. /// /// @dev After setting the sponsor for the collection, it must be confirmed with this function. @@ -185,6 +190,25 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Remove collection sponsor. + /// @dev EVM selector for this function is: 0x6e0326a3, + /// or in textual repr: removeCollectionSponsor() + function removeCollectionSponsor() public { + require(false, stub_error); + dummy = 0; + } + + /// Get current sponsor. + /// + /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + /// @dev EVM selector for this function is: 0xb66bbc14, + /// or in textual repr: getCollectionSponsor() + function getCollectionSponsor() public view returns (Tuple17 memory) { + require(false, stub_error); + dummy; + return Tuple17(0x0000000000000000000000000000000000000000, 0); + } + /// Set limits for the collection. /// @dev Throws error if limit not found. /// @param limit Name of the limit. Valid names: @@ -403,6 +427,12 @@ contract Collection is Dummy, ERC165 { } } +/// @dev anonymous struct +struct Tuple17 { + address field_0; + uint256 field_1; +} + /// @title ERC721 Token that can be irreversibly burned (destroyed). /// @dev the ERC-165 identifier for this interface is 0x42966c68 contract ERC721Burnable is Dummy, ERC165 { @@ -481,58 +511,8 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { } } -<<<<<<< HEAD -<<<<<<< HEAD /// @title Unique extensions for ERC721. /// @dev the ERC-165 identifier for this interface is 0x7c3bef89 -======= -<<<<<<< HEAD -======= ->>>>>>> misc: update stubs -// Selector: 780e9d63 -contract ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid RFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) - // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) public view returns (uint256) { - require(false, stub_error); - index; - dummy; - return 0; - } - - // Not implemented - // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - public - view - returns (uint256) - { - require(false, stub_error); - owner; - index; - dummy; - return 0; - } - - // @notice Count RFTs tracked by this contract - // @return A count of valid RFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address - // - // Selector: totalSupply() 18160ddd - function totalSupply() public view returns (uint256) { - require(false, stub_error); - dummy; - return 0; - } -} - -// Selector: 7c3bef89 ->>>>>>> misk: Update stubs contract ERC721UniqueExtensions is Dummy, ERC165 { /// @notice Transfer ownership of an RFT /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` @@ -623,37 +603,11 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { } } -<<<<<<< HEAD -<<<<<<< HEAD /// @dev anonymous struct struct Tuple8 { uint256 field_0; string field_1; } -======= -// Selector: ffe4da23 -======= -// Selector: 765e2fae ->>>>>>> misk: Update stubs -======= -// Selector: e54be640 ->>>>>>> misc: update stubs -contract Collection is Dummy, ERC165 { - // Set collection property. - // - // @param key Property key. - // @param value Propery value. - // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - public - { - require(false, stub_error); - key; - value; - dummy = 0; - } ->>>>>>> misk: Update stubs /// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension /// @dev See https://eips.ethereum.org/EIPS/eip-721 @@ -684,92 +638,7 @@ contract ERC721Enumerable is Dummy, ERC165 { owner; index; dummy; -<<<<<<< HEAD return 0; -======= - return hex""; - } - - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) public { - require(false, stub_error); - sponsor; - dummy = 0; - } - - // Set the substrate sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsorSubstrate(uint256) c74d6751 - function setCollectionSponsorSubstrate(uint256 sponsor) public { - require(false, stub_error); - sponsor; - dummy = 0; - } - - // Selector: hasCollectionPendingSponsor() 058ac185 - function hasCollectionPendingSponsor() public view returns (bool) { - require(false, stub_error); - dummy; - return false; - } - - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() public { - require(false, stub_error); - dummy = 0; - } - - // Remove collection sponsor. - // - // Selector: removeCollectionSponsor() 6e0326a3 - function removeCollectionSponsor() public { - require(false, stub_error); - dummy = 0; - } - - // Get current sponsor. - // - // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - // - // Selector: getCollectionSponsor() b66bbc14 - function getCollectionSponsor() public view returns (Tuple1 memory) { - require(false, stub_error); - dummy; - return Tuple1(0x0000000000000000000000000000000000000000, 0); - } - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) public { - require(false, stub_error); - limit; - value; - dummy = 0; ->>>>>>> misk: Update stubs } /// @notice Count RFTs tracked by this contract diff --git a/tests/src/eth/api/ContractHelpers.sol b/tests/src/eth/api/ContractHelpers.sol index dad2aa9d1d..7a124bf1e7 100644 --- a/tests/src/eth/api/ContractHelpers.sol +++ b/tests/src/eth/api/ContractHelpers.sol @@ -12,20 +12,8 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } -<<<<<<< HEAD -<<<<<<< HEAD /// @title Magic contract, which allows users to reconfigure other contracts /// @dev the ERC-165 identifier for this interface is 0xd77fab70 -======= -<<<<<<< HEAD -// Selector: 6073d917 -======= -// Selector: 06fc42e9 ->>>>>>> path: add stubs ->>>>>>> path: add stubs -======= -// Selector: 6073d917 ->>>>>>> misc: update stubs interface ContractHelpers is Dummy, ERC165 { /// Get user, which deployed specified contract /// @dev May return zero address in case if contract is deployed @@ -41,24 +29,11 @@ interface ContractHelpers is Dummy, ERC165 { view returns (address); -<<<<<<< HEAD -<<<<<<< HEAD /// Set sponsor. /// @param contractAddress Contract for which a sponsor is being established. /// @param sponsor User address who set as pending sponsor. /// @dev EVM selector for this function is: 0xf01fba93, /// or in textual repr: setSponsor(address,address) -======= -<<<<<<< HEAD -======= ->>>>>>> misc: update stubs - // Set sponsor. - // - // @param contract_address Contract for which a sponsor is being established. - // @param sponsor User address who set as pending sponsor. - // - // Selector: setSponsor(address,address) f01fba93 ->>>>>>> path: add stubs function setSponsor(address contractAddress, address sponsor) external; /// Set contract as self sponsored. @@ -84,28 +59,17 @@ interface ContractHelpers is Dummy, ERC165 { /// or in textual repr: confirmSponsorship(address) function confirmSponsorship(address contractAddress) external; -<<<<<<< HEAD /// Get current sponsor. /// /// @param contractAddress The contract for which a sponsor is requested. /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. /// @dev EVM selector for this function is: 0x743fc745, /// or in textual repr: getSponsor(address) -======= - // Get current sponsor. - // - // @param contract_address The contract for which a sponsor is requested. - // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - // - // Selector: getSponsor(address) 743fc745 ->>>>>>> path: add stubs function getSponsor(address contractAddress) external view returns (Tuple0 memory); -<<<<<<< HEAD -<<<<<<< HEAD /// Check tat contract has confirmed sponsor. /// /// @param contractAddress The contract for which the presence of a confirmed sponsor is checked. @@ -120,25 +84,6 @@ interface ContractHelpers is Dummy, ERC165 { /// @return **true** if contract has pending sponsor. /// @dev EVM selector for this function is: 0x39b9b242, /// or in textual repr: hasPendingSponsor(address) -======= -<<<<<<< HEAD -======= ->>>>>>> misc: update stubs - // Check tat contract has confirmed sponsor. - // - // @param contract_address The contract for which the presence of a confirmed sponsor is checked. - // @return **true** if contract has confirmed sponsor. - // - // Selector: hasSponsor(address) 97418603 - function hasSponsor(address contractAddress) external view returns (bool); - - // Check tat contract has pending sponsor. - // - // @param contract_address The contract for which the presence of a pending sponsor is checked. - // @return **true** if contract has pending sponsor. - // - // Selector: hasPendingSponsor(address) 39b9b242 ->>>>>>> path: add stubs function hasPendingSponsor(address contractAddress) external view diff --git a/tests/src/eth/api/UniqueFungible.sol b/tests/src/eth/api/UniqueFungible.sol index a7b10766ed..4570f4929e 100644 --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -3,17 +3,7 @@ pragma solidity >=0.8.0 <0.9.0; -<<<<<<< HEAD /// @dev common stubs holder -======= -// Anonymous struct -struct Tuple0 { - address field_0; - uint256 field_1; -} - -// Common stubs holder ->>>>>>> misk: Update stubs interface Dummy { } @@ -22,72 +12,8 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } -<<<<<<< HEAD /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0xffe4da23 -======= -// Inline -interface ERC20Events { - event Transfer(address indexed from, address indexed to, uint256 value); - event Approval( - address indexed owner, - address indexed spender, - uint256 value - ); -} - -// Selector: 79cc6790 -interface ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) external returns (bool); -} - -// Selector: 942e8b22 -interface ERC20 is Dummy, ERC165, ERC20Events { - // Selector: name() 06fdde03 - function name() external view returns (string memory); - - // Selector: symbol() 95d89b41 - function symbol() external view returns (string memory); - - // Selector: totalSupply() 18160ddd - function totalSupply() external view returns (uint256); - - // Selector: decimals() 313ce567 - function decimals() external view returns (uint8); - - // Selector: balanceOf(address) 70a08231 - function balanceOf(address owner) external view returns (uint256); - - // Selector: transfer(address,uint256) a9059cbb - function transfer(address to, uint256 amount) external returns (bool); - - // Selector: transferFrom(address,address,uint256) 23b872dd - function transferFrom( - address from, - address to, - uint256 amount - ) external returns (bool); - - // Selector: approve(address,uint256) 095ea7b3 - function approve(address spender, uint256 amount) external returns (bool); - - // Selector: allowance(address,address) dd62ed3e - function allowance(address owner, address spender) - external - view - returns (uint256); -} - -<<<<<<< HEAD -// Selector: ffe4da23 -======= -// Selector: 765e2fae ->>>>>>> misk: Update stubs ->>>>>>> misk: Update stubs -======= -// Selector: e54be640 ->>>>>>> misc: update stubs +/// @dev the ERC-165 identifier for this interface is 0xe54be640 interface Collection is Dummy, ERC165 { /// Set collection property. /// @@ -127,7 +53,19 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: setCollectionSponsor(address) function setCollectionSponsor(address sponsor) external; -<<<<<<< HEAD + /// Set the substrate sponsor of the collection. + /// + /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + /// + /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. + /// @dev EVM selector for this function is: 0xc74d6751, + /// or in textual repr: setCollectionSponsorSubstrate(uint256) + function setCollectionSponsorSubstrate(uint256 sponsor) external; + + /// @dev EVM selector for this function is: 0x058ac185, + /// or in textual repr: hasCollectionPendingSponsor() + function hasCollectionPendingSponsor() external view returns (bool); + /// Collection sponsorship confirmation. /// /// @dev After setting the sponsor for the collection, it must be confirmed with this function. @@ -135,6 +73,18 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: confirmCollectionSponsorship() function confirmCollectionSponsorship() external; + /// Remove collection sponsor. + /// @dev EVM selector for this function is: 0x6e0326a3, + /// or in textual repr: removeCollectionSponsor() + function removeCollectionSponsor() external; + + /// Get current sponsor. + /// + /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + /// @dev EVM selector for this function is: 0xb66bbc14, + /// or in textual repr: getCollectionSponsor() + function getCollectionSponsor() external view returns (Tuple6 memory); + /// Set limits for the collection. /// @dev Throws error if limit not found. /// @param limit Name of the limit. Valid names: @@ -147,51 +97,6 @@ interface Collection is Dummy, ERC165 { /// @param value Value of the limit. /// @dev EVM selector for this function is: 0x6a3841db, /// or in textual repr: setCollectionLimit(string,uint32) -======= - // Set the substrate sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsorSubstrate(uint256) c74d6751 - function setCollectionSponsorSubstrate(uint256 sponsor) external; - - // Selector: hasCollectionPendingSponsor() 058ac185 - function hasCollectionPendingSponsor() external view returns (bool); - - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() external; - - // Remove collection sponsor. - // - // Selector: removeCollectionSponsor() 6e0326a3 - function removeCollectionSponsor() external; - - // Get current sponsor. - // - // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - // - // Selector: getCollectionSponsor() b66bbc14 - function getCollectionSponsor() external view returns (Tuple0 memory); - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db ->>>>>>> misk: Update stubs function setCollectionLimit(string memory limit, uint32 value) external; /// Set limits for the collection. @@ -320,6 +225,12 @@ interface Collection is Dummy, ERC165 { function setOwnerSubstrate(uint256 newOwner) external; } +/// @dev anonymous struct +struct Tuple6 { + address field_0; + uint256 field_1; +} + /// @dev the ERC-165 identifier for this interface is 0x79cc6790 interface ERC20UniqueExtensions is Dummy, ERC165 { /// @dev EVM selector for this function is: 0x79cc6790, diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index 8493e1a988..8339e4e2d0 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -3,23 +3,7 @@ pragma solidity >=0.8.0 <0.9.0; -<<<<<<< HEAD /// @dev common stubs holder -======= -// Anonymous struct -struct Tuple0 { - uint256 field_0; - string field_1; -} - -// Anonymous struct -struct Tuple1 { - address field_0; - uint256 field_1; -} - -// Common stubs holder ->>>>>>> misk: Update stubs interface Dummy { } @@ -81,7 +65,7 @@ interface TokenProperties is Dummy, ERC165 { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0xffe4da23 +/// @dev the ERC-165 identifier for this interface is 0xe54be640 interface Collection is Dummy, ERC165 { /// Set collection property. /// @@ -121,6 +105,19 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: setCollectionSponsor(address) function setCollectionSponsor(address sponsor) external; + /// Set the substrate sponsor of the collection. + /// + /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + /// + /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. + /// @dev EVM selector for this function is: 0xc74d6751, + /// or in textual repr: setCollectionSponsorSubstrate(uint256) + function setCollectionSponsorSubstrate(uint256 sponsor) external; + + /// @dev EVM selector for this function is: 0x058ac185, + /// or in textual repr: hasCollectionPendingSponsor() + function hasCollectionPendingSponsor() external view returns (bool); + /// Collection sponsorship confirmation. /// /// @dev After setting the sponsor for the collection, it must be confirmed with this function. @@ -128,6 +125,18 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: confirmCollectionSponsorship() function confirmCollectionSponsorship() external; + /// Remove collection sponsor. + /// @dev EVM selector for this function is: 0x6e0326a3, + /// or in textual repr: removeCollectionSponsor() + function removeCollectionSponsor() external; + + /// Get current sponsor. + /// + /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + /// @dev EVM selector for this function is: 0xb66bbc14, + /// or in textual repr: getCollectionSponsor() + function getCollectionSponsor() external view returns (Tuple17 memory); + /// Set limits for the collection. /// @dev Throws error if limit not found. /// @param limit Name of the limit. Valid names: @@ -268,6 +277,12 @@ interface Collection is Dummy, ERC165 { function setOwnerSubstrate(uint256 newOwner) external; } +/// @dev anonymous struct +struct Tuple17 { + address field_0; + uint256 field_1; +} + /// @title ERC721 Token that can be irreversibly burned (destroyed). /// @dev the ERC-165 identifier for this interface is 0x42966c68 interface ERC721Burnable is Dummy, ERC165 { @@ -321,42 +336,8 @@ interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { function finishMinting() external returns (bool); } -<<<<<<< HEAD -<<<<<<< HEAD /// @title Unique extensions for ERC721. /// @dev the ERC-165 identifier for this interface is 0xd74d154f -======= -<<<<<<< HEAD -======= ->>>>>>> misc: update stubs -// Selector: 780e9d63 -interface ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid NFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) - // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) external view returns (uint256); - - // @dev Not implemented - // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - external - view - returns (uint256); - - // @notice Count NFTs tracked by this contract - // @return A count of valid NFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address - // - // Selector: totalSupply() 18160ddd - function totalSupply() external view returns (uint256); -} - -// Selector: d74d154f ->>>>>>> misk: Update stubs interface ERC721UniqueExtensions is Dummy, ERC165 { /// @notice Transfer ownership of an NFT /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` @@ -405,31 +386,11 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { returns (bool); } -<<<<<<< HEAD -<<<<<<< HEAD /// @dev anonymous struct struct Tuple8 { uint256 field_0; string field_1; } -======= -// Selector: ffe4da23 -======= -// Selector: 765e2fae ->>>>>>> misk: Update stubs -======= -// Selector: e54be640 ->>>>>>> misc: update stubs -interface Collection is Dummy, ERC165 { - // Set collection property. - // - // @param key Property key. - // @param value Propery value. - // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - external; ->>>>>>> misk: Update stubs /// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension /// @dev See https://eips.ethereum.org/EIPS/eip-721 @@ -449,87 +410,7 @@ interface ERC721Enumerable is Dummy, ERC165 { function tokenOfOwnerByIndex(address owner, uint256 index) external view -<<<<<<< HEAD returns (uint256); -======= - returns (bytes memory); - - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) external; - - // Set the substrate sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsorSubstrate(uint256) c74d6751 - function setCollectionSponsorSubstrate(uint256 sponsor) external; - - // Selector: hasCollectionPendingSponsor() 058ac185 - function hasCollectionPendingSponsor() external view returns (bool); - - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() external; - - // Remove collection sponsor. - // - // Selector: removeCollectionSponsor() 6e0326a3 - function removeCollectionSponsor() external; - - // Get current sponsor. - // - // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - // - // Selector: getCollectionSponsor() b66bbc14 - function getCollectionSponsor() external view returns (Tuple1 memory); - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,bool) 993b7fba - function setCollectionLimit(string memory limit, bool value) external; - - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 - function contractAddress() external view returns (address); - - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. - // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) external; ->>>>>>> misk: Update stubs /// @notice Count NFTs tracked by this contract /// @return A count of valid NFTs tracked by this contract, where each one of diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index b08b89205e..94d7884f88 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -3,23 +3,7 @@ pragma solidity >=0.8.0 <0.9.0; -<<<<<<< HEAD /// @dev common stubs holder -======= -// Anonymous struct -struct Tuple0 { - uint256 field_0; - string field_1; -} - -// Anonymous struct -struct Tuple1 { - address field_0; - uint256 field_1; -} - -// Common stubs holder ->>>>>>> misk: Update stubs interface Dummy { } @@ -81,7 +65,7 @@ interface TokenProperties is Dummy, ERC165 { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0xffe4da23 +/// @dev the ERC-165 identifier for this interface is 0xe54be640 interface Collection is Dummy, ERC165 { /// Set collection property. /// @@ -121,6 +105,19 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: setCollectionSponsor(address) function setCollectionSponsor(address sponsor) external; + /// Set the substrate sponsor of the collection. + /// + /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + /// + /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. + /// @dev EVM selector for this function is: 0xc74d6751, + /// or in textual repr: setCollectionSponsorSubstrate(uint256) + function setCollectionSponsorSubstrate(uint256 sponsor) external; + + /// @dev EVM selector for this function is: 0x058ac185, + /// or in textual repr: hasCollectionPendingSponsor() + function hasCollectionPendingSponsor() external view returns (bool); + /// Collection sponsorship confirmation. /// /// @dev After setting the sponsor for the collection, it must be confirmed with this function. @@ -128,6 +125,18 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: confirmCollectionSponsorship() function confirmCollectionSponsorship() external; + /// Remove collection sponsor. + /// @dev EVM selector for this function is: 0x6e0326a3, + /// or in textual repr: removeCollectionSponsor() + function removeCollectionSponsor() external; + + /// Get current sponsor. + /// + /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. + /// @dev EVM selector for this function is: 0xb66bbc14, + /// or in textual repr: getCollectionSponsor() + function getCollectionSponsor() external view returns (Tuple17 memory); + /// Set limits for the collection. /// @dev Throws error if limit not found. /// @param limit Name of the limit. Valid names: @@ -268,6 +277,12 @@ interface Collection is Dummy, ERC165 { function setOwnerSubstrate(uint256 newOwner) external; } +/// @dev anonymous struct +struct Tuple17 { + address field_0; + uint256 field_1; +} + /// @title ERC721 Token that can be irreversibly burned (destroyed). /// @dev the ERC-165 identifier for this interface is 0x42966c68 interface ERC721Burnable is Dummy, ERC165 { @@ -321,42 +336,8 @@ interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { function finishMinting() external returns (bool); } -<<<<<<< HEAD -<<<<<<< HEAD /// @title Unique extensions for ERC721. /// @dev the ERC-165 identifier for this interface is 0x7c3bef89 -======= -<<<<<<< HEAD -======= ->>>>>>> misc: update stubs -// Selector: 780e9d63 -interface ERC721Enumerable is Dummy, ERC165 { - // @notice Enumerate valid RFTs - // @param index A counter less than `totalSupply()` - // @return The token identifier for the `index`th NFT, - // (sort order not specified) - // - // Selector: tokenByIndex(uint256) 4f6ccce7 - function tokenByIndex(uint256 index) external view returns (uint256); - - // Not implemented - // - // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59 - function tokenOfOwnerByIndex(address owner, uint256 index) - external - view - returns (uint256); - - // @notice Count RFTs tracked by this contract - // @return A count of valid RFTs tracked by this contract, where each one of - // them has an assigned and queryable owner not equal to the zero address - // - // Selector: totalSupply() 18160ddd - function totalSupply() external view returns (uint256); -} - -// Selector: 7c3bef89 ->>>>>>> misk: Update stubs interface ERC721UniqueExtensions is Dummy, ERC165 { /// @notice Transfer ownership of an RFT /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` @@ -417,31 +398,11 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { returns (address); } -<<<<<<< HEAD -<<<<<<< HEAD /// @dev anonymous struct struct Tuple8 { uint256 field_0; string field_1; } -======= -// Selector: ffe4da23 -======= -// Selector: 765e2fae ->>>>>>> misk: Update stubs -======= -// Selector: e54be640 ->>>>>>> misc: update stubs -interface Collection is Dummy, ERC165 { - // Set collection property. - // - // @param key Property key. - // @param value Propery value. - // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - external; ->>>>>>> misk: Update stubs /// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension /// @dev See https://eips.ethereum.org/EIPS/eip-721 @@ -461,87 +422,7 @@ interface ERC721Enumerable is Dummy, ERC165 { function tokenOfOwnerByIndex(address owner, uint256 index) external view -<<<<<<< HEAD returns (uint256); -======= - returns (bytes memory); - - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) external; - - // Set the substrate sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsorSubstrate(uint256) c74d6751 - function setCollectionSponsorSubstrate(uint256 sponsor) external; - - // Selector: hasCollectionPendingSponsor() 058ac185 - function hasCollectionPendingSponsor() external view returns (bool); - - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() external; - - // Remove collection sponsor. - // - // Selector: removeCollectionSponsor() 6e0326a3 - function removeCollectionSponsor() external; - - // Get current sponsor. - // - // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - // - // Selector: getCollectionSponsor() b66bbc14 - function getCollectionSponsor() external view returns (Tuple1 memory); - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,bool) 993b7fba - function setCollectionLimit(string memory limit, bool value) external; - - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 - function contractAddress() external view returns (address); - - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. - // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) external; ->>>>>>> misk: Update stubs /// @notice Count RFTs tracked by this contract /// @return A count of valid RFTs tracked by this contract, where each one of diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index 6e32f8076f..58ca3332b2 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -159,7 +159,7 @@ { "internalType": "address", "name": "field_0", "type": "address" }, { "internalType": "uint256", "name": "field_1", "type": "uint256" } ], - "internalType": "struct Tuple0", + "internalType": "struct Tuple6", "name": "", "type": "tuple" } diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index f8511e27e5..9b3c870c21 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -208,7 +208,7 @@ { "internalType": "address", "name": "field_0", "type": "address" }, { "internalType": "uint256", "name": "field_1", "type": "uint256" } ], - "internalType": "struct Tuple1", + "internalType": "struct Tuple17", "name": "", "type": "tuple" } diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index 2df8d41cc9..1633b7a4ed 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -208,7 +208,7 @@ { "internalType": "address", "name": "field_0", "type": "address" }, { "internalType": "uint256", "name": "field_1", "type": "uint256" } ], - "internalType": "struct Tuple1", + "internalType": "struct Tuple17", "name": "", "type": "tuple" } From d254843023e32632a8822e0ca58b1738811d1a8f Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 25 Aug 2022 17:40:42 +0300 Subject: [PATCH 0589/1274] test: fix attribute imports Signed-off-by: Yaroslav Bolyukin --- crates/evm-coder/tests/random.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/evm-coder/tests/random.rs b/crates/evm-coder/tests/random.rs index 434f69c54b..6655db534c 100644 --- a/crates/evm-coder/tests/random.rs +++ b/crates/evm-coder/tests/random.rs @@ -16,8 +16,7 @@ #![allow(dead_code)] // This test only checks that macros is not panicking -use evm_coder::{ToLog, execution::Result, solidity_interface, types::*}; -use evm_coder_macros::{solidity, weight}; +use evm_coder::{ToLog, execution::Result, solidity_interface, types::*, solidity, weight}; struct Impls; From 6fb8930110f829cd02594650e8bda306ee040385 Mon Sep 17 00:00:00 2001 From: Ilja Khabarov Date: Thu, 25 Aug 2022 22:00:48 +0700 Subject: [PATCH 0590/1274] Set XCM incoming transaction fee amount to 0. --- pallets/foreing-assets/src/lib.rs | 2 +- runtime/common/config/xcm.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pallets/foreing-assets/src/lib.rs b/pallets/foreing-assets/src/lib.rs index 283c3bda0f..ea466280a9 100644 --- a/pallets/foreing-assets/src/lib.rs +++ b/pallets/foreing-assets/src/lib.rs @@ -486,7 +486,7 @@ impl< fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { log::trace!(target: "fassets::weight", "buy_weight weight: {:?}, payment: {:?}", weight, payment); - let amount = WeightToFee::weight_to_fee(&weight); + let amount: Currency::Balance = (0 as u32).into(); let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?; let asset_id = payment diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs index 1b71cc1deb..117c6e2d7b 100644 --- a/runtime/common/config/xcm.rs +++ b/runtime/common/config/xcm.rs @@ -188,7 +188,8 @@ impl< } fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { - let amount = WeightToFee::weight_to_fee(&weight); + let amount: Currency::Balance = (0 as u32).into(); + //let amount = WeightToFee::weight_to_fee(&weight); let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?; // location to this parachain through relay chain From fa9ccd787b5f6e6a20731ff0b9de1f1b3aca9297 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 26 Aug 2022 09:52:03 +0000 Subject: [PATCH 0591/1274] fix: remove `setParentNFT` --- pallets/refungible/src/benchmarking.rs | 9 --- pallets/refungible/src/erc_token.rs | 63 ++--------------- pallets/refungible/src/lib.rs | 64 ------------------ .../src/stubs/UniqueRefungibleToken.raw | Bin 1567 -> 1556 bytes .../src/stubs/UniqueRefungibleToken.sol | 19 +----- pallets/refungible/src/weights.rs | 17 ----- pallets/unique/src/eth/mod.rs | 20 ------ primitives/data-structs/src/lib.rs | 2 - tests/src/eth/api/UniqueRefungibleToken.sol | 12 +--- .../src/eth/fractionalizer/Fractionalizer.sol | 1 - tests/src/eth/reFungibleToken.test.ts | 25 ------- tests/src/eth/reFungibleTokenAbi.json | 10 --- 12 files changed, 9 insertions(+), 233 deletions(-) diff --git a/pallets/refungible/src/benchmarking.rs b/pallets/refungible/src/benchmarking.rs index 5abae3b05c..82712f38b4 100644 --- a/pallets/refungible/src/benchmarking.rs +++ b/pallets/refungible/src/benchmarking.rs @@ -281,15 +281,6 @@ benchmarks! { let item = create_max_item(&collection, &sender, [(owner.clone(), 100)])?; }: {>::repartition(&collection, &owner, item, 200)?} - set_parent_nft_unchecked { - bench_init!{ - owner: sub; collection: collection(owner); - sender: cross_from_sub(owner); owner: cross_sub; - }; - let item = create_max_item(&collection, &sender, [(owner.clone(), 100)])?; - - }: {>::set_parent_nft_unchecked(&collection, item, owner, T::CrossAccountId::from_eth(H160::default()))?} - token_owner { bench_init!{ owner: sub; collection: collection(owner); diff --git a/pallets/refungible/src/erc_token.rs b/pallets/refungible/src/erc_token.rs index f5df3c3cca..f902d0f947 100644 --- a/pallets/refungible/src/erc_token.rs +++ b/pallets/refungible/src/erc_token.rs @@ -29,22 +29,20 @@ use core::{ convert::TryInto, ops::Deref, }; -use evm_coder::{ToLog, execution::*, generate_stubgen, solidity, solidity_interface, types::*, weight}; +use evm_coder::{ToLog, execution::*, generate_stubgen, solidity_interface, types::*, weight}; use pallet_common::{ CommonWeightInfo, - erc::{CommonEvmHandler, PrecompileResult, static_property::key}, - eth::map_eth_to_id, + erc::{CommonEvmHandler, PrecompileResult}, }; use pallet_evm::{account::CrossAccountId, PrecompileHandle}; use pallet_evm_coder_substrate::{call, dispatch_to_evm, WithRecorder}; use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _}; -use sp_core::H160; use sp_std::vec::Vec; -use up_data_structs::{mapping::TokenAddressMapping, PropertyScope, TokenId}; +use up_data_structs::{mapping::TokenAddressMapping, TokenId}; use crate::{ Allowance, Balance, common::CommonWeights, Config, Pallet, RefungibleHandle, SelfWeightOf, - TokenProperties, TotalSupply, weights::WeightInfo, + TotalSupply, weights::WeightInfo, }; pub struct RefungibleTokenHandle(pub RefungibleHandle, pub TokenId); @@ -53,59 +51,12 @@ pub struct RefungibleTokenHandle(pub RefungibleHandle, pub TokenId impl RefungibleTokenHandle { fn parent_token(&self) -> Result
{ self.consume_store_reads(2)?; - let props = >::get((self.id, self.1)); - let key = key::parent_nft(); - - let key_scoped = PropertyScope::Eth - .apply(key) - .expect("property key shouldn't exceed length limit"); - if let Some(value) = props.get(&key_scoped) { - Ok(H160::from_slice(value.as_slice())) - } else { - Ok(*T::CrossTokenAddressMapping::token_to_address(self.id, self.1).as_eth()) - } + Ok(*T::CrossTokenAddressMapping::token_to_address(self.id, self.1).as_eth()) } fn parent_token_id(&self) -> Result { self.consume_store_reads(2)?; - let props = >::get((self.id, self.1)); - let key = key::parent_nft(); - - let key_scoped = PropertyScope::Eth - .apply(key) - .expect("property key shouldn't exceed length limit"); - if let Some(value) = props.get(&key_scoped) { - let nft_token_address = H160::from_slice(value.as_slice()); - let nft_token_account = T::CrossAccountId::from_eth(nft_token_address); - let (_, token_id) = T::CrossTokenAddressMapping::address_to_token(&nft_token_account) - .ok_or("parent NFT should contain NFT token address")?; - - Ok(token_id.into()) - } else { - Ok(self.1.into()) - } - } -} - -#[solidity_interface(name = ERC1633UniqueExtensions)] -impl RefungibleTokenHandle { - #[solidity(rename_selector = "setParentNFT")] - #[weight(>::token_owner() + >::set_parent_nft_unchecked())] - fn set_parent_nft( - &mut self, - caller: caller, - collection: address, - nft_id: uint256, - ) -> Result { - self.consume_store_reads(1)?; - let caller = T::CrossAccountId::from_eth(caller); - let nft_collection = map_eth_to_id(&collection).ok_or("collection not found")?; - let nft_token = nft_id.try_into()?; - - >::set_parent_nft(&self.0, self.1, caller, nft_collection, nft_token) - .map_err(dispatch_to_evm::)?; - - Ok(true) + Ok(self.1.into()) } } @@ -307,7 +258,7 @@ impl Deref for RefungibleTokenHandle { #[solidity_interface( name = UniqueRefungibleToken, - is(ERC20, ERC20UniqueExtensions, ERC1633, ERC1633UniqueExtensions) + is(ERC20, ERC20UniqueExtensions, ERC1633) )] impl RefungibleTokenHandle where T::AccountId: From<[u8; 32]> {} diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index a3eb6bdf98..5f14f89584 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -1379,68 +1379,4 @@ impl Pallet { Some(res) } } - - /// Sets the NFT token as a parent for the RFT token - /// - /// Throws if `sender` is not the owner of the NFT token. - /// Throws if `sender` is not the owner of all of the RFT token pieces. - pub fn set_parent_nft( - collection: &RefungibleHandle, - rft_token_id: TokenId, - sender: T::CrossAccountId, - nft_collection: CollectionId, - nft_token: TokenId, - ) -> DispatchResult { - let handle = >::try_get(nft_collection)?; - if handle.mode != CollectionMode::NFT { - return Err("Only NFT token could be parent to RFT".into()); - } - let dispatch = T::CollectionDispatch::dispatch(handle); - let dispatch = dispatch.as_dyn(); - - let owner = dispatch.token_owner(nft_token).ok_or("owner not found")?; - if owner != sender { - return Err("Only owned token could be set as parent".into()); - } - - let nft_token_address = - T::CrossTokenAddressMapping::token_to_address(nft_collection, nft_token); - - Self::set_parent_nft_unchecked(collection, rft_token_id, sender, nft_token_address) - } - - /// Sets the NFT token as a parent for the RFT token - /// - /// `sender` should be the owner of the NFT token. - /// Throws if `sender` is not the owner of all of the RFT token pieces. - pub fn set_parent_nft_unchecked( - collection: &RefungibleHandle, - rft_token_id: TokenId, - sender: T::CrossAccountId, - nft_token_address: T::CrossAccountId, - ) -> DispatchResult { - let owner_balance = >::get((collection.id, rft_token_id, &sender)); - let total_supply = >::get((collection.id, rft_token_id)); - if total_supply != owner_balance { - return Err("token has multiple owners".into()); - } - - let parent_nft_property_key = key::parent_nft(); - - let parent_nft_property_value = - property_value_from_bytes(&nft_token_address.as_eth().to_fixed_bytes()) - .expect("address should fit in value length limit"); - - >::set_scoped_token_property( - collection.id, - rft_token_id, - PropertyScope::Eth, - Property { - key: parent_nft_property_key, - value: parent_nft_property_value, - }, - )?; - - Ok(()) - } } diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.raw b/pallets/refungible/src/stubs/UniqueRefungibleToken.raw index d4ac6e1830fca41eb070a5fce98636bb12261a46..b3837138deccefbf8c6f21ed6b1e6ce0917cd9cb 100644 GIT binary patch delta 979 zcmZ9KO-K}R7{=$F|IAXMvYNXp8|;YTNf3$kAQ7X`$0eE_Vh0+K|KANINQf@gY3Fmv zlA7JIE(YzTB&ZgY|IAprzt5elXDQxog4G$lij`j>7*m?}DfC zhKBBXmGr;5k+=y-1iCwWI-o#nnUiFnyb(>hqv+@}$Pjkq&>`o?PGvsOwG2iGz+e?S zlS%(3kxCJUI>~ZKTZ-}V$;})(fz~sm%S@Z?jPH-G=~op+i42CV+IhorL8Y8-nn^Sl zHP-|i@~(xkpjyEA(*<3@8nRUe6v{N)MYA@fU4W|MPYMT0MwC>`kSJ(23aWTvj6r4F z4U5f3?-~EvX1r6-XQEfoH2UYLUArCWKn?r(_$e*yiQNi6^X delta 896 zcmZ9JUq}>D6vpSwos|;BUE5h(^kHzLdn&ctztiG69KL>2CG z=;Hh(X^Y<1^AUAMm;QST(#sd5cw1#{Mp&?30h3QsCFdn`F|;FcRi{}eR#c6=6SfE= z4|sPdk$t06u%e8t=uDDv;zoQTW@|ZFrlD3FuBbs(xa9pHSD}J2VTENTHR;x&oDG_r z2lpZ{@*{0HFr})7TAG Weight; fn delete_token_properties(b: u32, ) -> Weight; fn repartition_item() -> Weight; - fn set_parent_nft_unchecked() -> Weight; fn token_owner() -> Weight; } @@ -255,14 +254,6 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } - // Storage: Refungible Balance (r:1 w:0) - // Storage: Refungible TotalSupply (r:1 w:0) - // Storage: Refungible TokenProperties (r:1 w:1) - fn set_parent_nft_unchecked() -> Weight { - (12_015_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } // Storage: Refungible Balance (r:2 w:0) fn token_owner() -> Weight { (9_431_000 as Weight) @@ -467,14 +458,6 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } - // Storage: Refungible Balance (r:1 w:0) - // Storage: Refungible TotalSupply (r:1 w:0) - // Storage: Refungible TokenProperties (r:1 w:1) - fn set_parent_nft_unchecked() -> Weight { - (12_015_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } // Storage: Refungible Balance (r:2 w:0) fn token_owner() -> Weight { (9_431_000 as Weight) diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 57a09eb36b..cc417bedc1 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -154,16 +154,6 @@ fn make_data( Ok(data) } -fn parent_nft_property_permissions() -> PropertyKeyPermission { - PropertyKeyPermission { - key: key::parent_nft(), - permission: PropertyPermission { - mutable: false, - collection_admin: false, - token_owner: true, - }, - } -} fn create_refungible_collection_internal< T: Config + pallet_nonfungible::Config + pallet_refungible::Config, @@ -188,16 +178,6 @@ fn create_refungible_collection_internal< let collection_id = T::CollectionDispatch::create(caller.clone(), data) .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; - - let handle = >::try_get(collection_id).map_err(dispatch_to_evm::)?; - >::set_scoped_token_property_permissions( - &handle, - &caller, - PropertyScope::Eth, - vec![parent_nft_property_permissions()], - ) - .map_err(dispatch_to_evm::)?; - let address = pallet_common::eth::collection_id_to_address(collection_id); Ok(address) } diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 9f0cceae9e..9180f3d050 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -1050,7 +1050,6 @@ pub enum PropertiesError { pub enum PropertyScope { None, Rmrk, - Eth, } impl PropertyScope { @@ -1059,7 +1058,6 @@ impl PropertyScope { let scope_str: &[u8] = match self { Self::None => return Ok(key), Self::Rmrk => b"rmrk", - Self::Eth => b"eth", }; [scope_str, b":", key.as_slice()] diff --git a/tests/src/eth/api/UniqueRefungibleToken.sol b/tests/src/eth/api/UniqueRefungibleToken.sol index 5209775588..bddf75d131 100644 --- a/tests/src/eth/api/UniqueRefungibleToken.sol +++ b/tests/src/eth/api/UniqueRefungibleToken.sol @@ -12,15 +12,6 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } -/// @dev the ERC-165 identifier for this interface is 0x042f1106 -interface ERC1633UniqueExtensions is Dummy, ERC165 { - /// @dev EVM selector for this function is: 0x042f1106, - /// or in textual repr: setParentNFT(address,uint256) - function setParentNFT(address collection, uint256 nftId) - external - returns (bool); -} - /// @dev the ERC-165 identifier for this interface is 0x5755c3f2 interface ERC1633 is Dummy, ERC165 { /// @dev EVM selector for this function is: 0x80a54001, @@ -140,6 +131,5 @@ interface UniqueRefungibleToken is ERC165, ERC20, ERC20UniqueExtensions, - ERC1633, - ERC1633UniqueExtensions + ERC1633 {} diff --git a/tests/src/eth/fractionalizer/Fractionalizer.sol b/tests/src/eth/fractionalizer/Fractionalizer.sol index 81a2fb4ca5..91234694da 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.sol +++ b/tests/src/eth/fractionalizer/Fractionalizer.sol @@ -137,7 +137,6 @@ contract Fractionalizer { rft2nftMapping[rftTokenAddress] = Token(_collection, _token); rftTokenContract = UniqueRefungibleToken(rftTokenAddress); - rftTokenContract.setParentNFT(_collection, _token); } else { rftTokenId = nft2rftMapping[_collection][_token]; rftTokenAddress = rftCollectionContract.tokenContractAddress(rftTokenId); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 3f67177ed9..c80276eab5 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -655,31 +655,6 @@ describe('ERC 1633 implementation', () => { await requirePallets(this, [Pallets.ReFungible]); }); - itWeb3('Parent NFT token address and id', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - - const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); - const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); - const nftTokenId = await nftContract.methods.nextTokenId().call(); - await nftContract.methods.mint(owner, nftTokenId).send(); - const nftCollectionId = collectionIdFromAddress(nftCollectionAddress); - - const {collectionIdAddress, collectionId} = await createRefungibleCollection(api, web3, owner); - const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner); - const refungibleTokenId = await refungibleContract.methods.nextTokenId().call(); - await refungibleContract.methods.mint(owner, refungibleTokenId).send(); - - const rftTokenAddress = tokenIdToAddress(collectionId, refungibleTokenId); - const refungibleTokenContract = uniqueRefungibleToken(web3, rftTokenAddress, owner); - await refungibleTokenContract.methods.setParentNFT(nftCollectionAddress, nftTokenId).send(); - - const tokenAddress = await refungibleTokenContract.methods.parentToken().call(); - const tokenId = await refungibleTokenContract.methods.parentTokenId().call(); - const nftTokenAddress = tokenIdToAddress(nftCollectionId, nftTokenId); - expect(tokenAddress).to.be.equal(nftTokenAddress); - expect(tokenId).to.be.equal(nftTokenId); - }); - itWeb3('Default parent token address and id', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); diff --git a/tests/src/eth/reFungibleTokenAbi.json b/tests/src/eth/reFungibleTokenAbi.json index 9e89d3919f..608f4feafc 100644 --- a/tests/src/eth/reFungibleTokenAbi.json +++ b/tests/src/eth/reFungibleTokenAbi.json @@ -125,16 +125,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "address", "name": "collection", "type": "address" }, - { "internalType": "uint256", "name": "nftId", "type": "uint256" } - ], - "name": "setParentNFT", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" } From f1d8c4ae7d7d6a42381f0eac96768415c004b71c Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 26 Aug 2022 10:56:02 +0000 Subject: [PATCH 0592/1274] fix: Return erc721 instead erc20 --- pallets/refungible/src/erc_token.rs | 6 +++--- tests/src/eth/reFungibleToken.test.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pallets/refungible/src/erc_token.rs b/pallets/refungible/src/erc_token.rs index f902d0f947..7816469ae1 100644 --- a/pallets/refungible/src/erc_token.rs +++ b/pallets/refungible/src/erc_token.rs @@ -32,13 +32,13 @@ use core::{ use evm_coder::{ToLog, execution::*, generate_stubgen, solidity_interface, types::*, weight}; use pallet_common::{ CommonWeightInfo, - erc::{CommonEvmHandler, PrecompileResult}, + erc::{CommonEvmHandler, PrecompileResult}, eth::collection_id_to_address, }; use pallet_evm::{account::CrossAccountId, PrecompileHandle}; use pallet_evm_coder_substrate::{call, dispatch_to_evm, WithRecorder}; use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _}; use sp_std::vec::Vec; -use up_data_structs::{mapping::TokenAddressMapping, TokenId}; +use up_data_structs::TokenId; use crate::{ Allowance, Balance, common::CommonWeights, Config, Pallet, RefungibleHandle, SelfWeightOf, @@ -51,7 +51,7 @@ pub struct RefungibleTokenHandle(pub RefungibleHandle, pub TokenId impl RefungibleTokenHandle { fn parent_token(&self) -> Result
{ self.consume_store_reads(2)?; - Ok(*T::CrossTokenAddressMapping::token_to_address(self.id, self.1).as_eth()) + Ok(collection_id_to_address(self.id)) } fn parent_token_id(&self) -> Result { diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index c80276eab5..70c3bce0a6 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -668,7 +668,7 @@ describe('ERC 1633 implementation', () => { const tokenAddress = await refungibleTokenContract.methods.parentToken().call(); const tokenId = await refungibleTokenContract.methods.parentTokenId().call(); - expect(tokenAddress).to.be.equal(rftTokenAddress); + expect(tokenAddress).to.be.equal(collectionIdAddress); expect(tokenId).to.be.equal(refungibleTokenId); }); }); From 036aece6500a503da3bd36648492f335406a7aa0 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 26 Aug 2022 18:42:38 +0700 Subject: [PATCH 0593/1274] correct build commands for parachains --- .docker/Dockerfile-xcm | 13 ++++++++----- .docker/docker-compose-xcm.yml | 2 -- .docker/docker-compose.tmp-xcm-quartz.yml | 4 +++- .docker/docker-compose.tmp-xcm-unique.yml | 3 +++ .docker/docker-compose.tmp-xcm.j2 | 21 +++++++++++++++++++++ 5 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 .docker/docker-compose.tmp-xcm.j2 diff --git a/.docker/Dockerfile-xcm b/.docker/Dockerfile-xcm index 860f4ee72c..731fc75408 100644 --- a/.docker/Dockerfile-xcm +++ b/.docker/Dockerfile-xcm @@ -33,13 +33,13 @@ FROM rust-builder as builder-unique ARG PROFILE=release ARG FEATURE= -ARG REPO_URL= ARG BRANCH= WORKDIR /unique_parachain -RUN git clone $REPO_URL -b $BRANCH . && \ +RUN git clone -b $BRANCH https://github.com/UniqueNetwork/unique-chain.git && \ + cd unique-chain && \ cargo build --features=$FEATURE --$PROFILE # ===== BUILD POLKADOT ===== @@ -93,12 +93,15 @@ WORKDIR /unique_parachain RUN git clone -b $CUMULUS_BUILD_BRANCH --depth 1 https://github.com/paritytech/cumulus.git && \ cd cumulus && \ - cargo build --release + cargo build --release --locked -p polkadot-parachain # ===== RUN ====== FROM ubuntu:20.04 +ARG POLKADOT_LAUNCH_BRANCH= +ENV POLKADOT_LAUNCH_BRANCH $POLKADOT_LAUNCH_BRANCH + RUN apt-get -y update && \ apt-get -y install curl git && \ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ @@ -107,7 +110,7 @@ RUN apt-get -y update && \ nvm install v16.16.0 && \ nvm use v16.16.0 -RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/runtime-upgrade-testing +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b $POLKADOT_LAUNCH_BRANCH RUN export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ @@ -115,7 +118,7 @@ RUN export NVM_DIR="$HOME/.nvm" && \ npm install --global yarn && \ yarn install -COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ COPY --from=builder-moonbeam /unique_parachain/moonbeam/target/release/moonbeam /moonbeam/target/release/ COPY --from=builder-cumulus /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus diff --git a/.docker/docker-compose-xcm.yml b/.docker/docker-compose-xcm.yml index faa7cfcc47..d34f2c4f8f 100644 --- a/.docker/docker-compose-xcm.yml +++ b/.docker/docker-compose-xcm.yml @@ -5,8 +5,6 @@ services: build: context: ../ dockerfile: .docker/Dockerfile-xcm - image: xcm_nodes - container_name: xcm_nodes expose: - 9844 - 9944 diff --git a/.docker/docker-compose.tmp-xcm-quartz.yml b/.docker/docker-compose.tmp-xcm-quartz.yml index 70f2b0a196..ddaf0ba8f9 100644 --- a/.docker/docker-compose.tmp-xcm-quartz.yml +++ b/.docker/docker-compose.tmp-xcm-quartz.yml @@ -6,12 +6,14 @@ services: args: - "RUST_TOOLCHAIN=nightly-2022-07-24" - "BRANCH=release-v927020" - - "REPO_URL=https://github.com/UniqueNetwork/unique-chain.git" - "FEATURE=quartz-runtime" - "POLKADOT_BUILD_BRANCH=release-v0.9.27" - "ACALA_BUILD_BRANCH=2.9.0" - "MOONBEAM_BUILD_BRANCH=v0.25.0" - "CUMULUS_BUILD_BRANCH=release-v0.9.230" + - "POLKADOT_LAUNCH_BRANCH=feature/rewrite-chain-id-in-spec" + image: xcm_nodes_quartz + container_name: xcm_nodes_quartz volumes: - type: bind source: ./xcm-config/launch-config-xcm-quartz.json diff --git a/.docker/docker-compose.tmp-xcm-unique.yml b/.docker/docker-compose.tmp-xcm-unique.yml index ccdc180b6c..0218d10d38 100644 --- a/.docker/docker-compose.tmp-xcm-unique.yml +++ b/.docker/docker-compose.tmp-xcm-unique.yml @@ -12,6 +12,9 @@ services: - "ACALA_BUILD_BRANCH=2.9.0" - "MOONBEAM_BUILD_BRANCH=v0.25.0" - "CUMULUS_BUILD_BRANCH=release-v0.9.230" + - "POLKADOT_LAUNCH_BRANCH=feature/rewrite-chain-id-in-spec" + image: xcm_nodes_unique + container_name: xcm_nodes_unique volumes: - type: bind source: ./xcm-config/launch-config-xcm-unique.json diff --git a/.docker/docker-compose.tmp-xcm.j2 b/.docker/docker-compose.tmp-xcm.j2 new file mode 100644 index 0000000000..e7f0181631 --- /dev/null +++ b/.docker/docker-compose.tmp-xcm.j2 @@ -0,0 +1,21 @@ +version: "3.5" + +services: + xcm_nodes: + build: + args: + - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" + - "BRANCH={{ BRANCH }}" + - "FEATURE={{ FEATURE }}" + - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" + - "ACALA_BUILD_BRANCH={{ ACALA_BUILD_BRANCH }}" + - "MOONBEAM_BUILD_BRANCH={{ MOONBEAM_BUILD_BRANCH }}" + - "CUMULUS_BUILD_BRANCH={{ CUMULUS_BUILD_BRANCH }}" + - "POLKADOT_LAUNCH_BRANCH={{ POLKADOT_LAUNCH_BRANCH }}" + image: xcm_nodes_{{ NETWORK }} + container_name: xcm_nodes_{{ NETWORK }} + volumes: + - type: bind + source: ./xcm-config/launch-config-xcm-{{ NETWORK }}.json + target: /polkadot-launch/launch-config.json + read_only: true From 942486a34d88b2aafa3f4116526c6819668db15e Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 26 Aug 2022 13:07:40 +0000 Subject: [PATCH 0594/1274] feat: make `nft2rftMapping` and `rft2nftMapping` public in Fractionalizer.sol --- .../src/eth/fractionalizer/Fractionalizer.sol | 4 ++-- .../eth/fractionalizer/fractionalizer.test.ts | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/tests/src/eth/fractionalizer/Fractionalizer.sol b/tests/src/eth/fractionalizer/Fractionalizer.sol index 91234694da..d6ac7c093e 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.sol +++ b/tests/src/eth/fractionalizer/Fractionalizer.sol @@ -16,8 +16,8 @@ contract Fractionalizer { } address rftCollection; mapping(address => bool) nftCollectionAllowList; - mapping(address => mapping(uint256 => uint256)) nft2rftMapping; - mapping(address => Token) rft2nftMapping; + mapping(address => mapping(uint256 => uint256)) public nft2rftMapping; + mapping(address => Token) public rft2nftMapping; bytes32 refungibleCollectionType = keccak256(bytes("ReFungible")); receive() external payable onlyOwner {} diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index 4d3de33cb3..c2c0e129da 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -223,6 +223,28 @@ describe('Fractionalizer contract usage', () => { }, }); }); + + itWeb3('Test fractionalizer NFT <-> RFT mapping ', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const {fractionalizer, rftCollectionAddress} = await initFractionalizer(api, web3, privateKeyWrapper, owner); + const {rftTokenAddress, nftCollectionAddress, nftTokenId} = await createRFTToken(api, web3, owner, fractionalizer, 100n); + + const {collectionId, tokenId} = tokenIdFromAddress(rftTokenAddress); + const refungibleAddress = collectionIdToAddress(collectionId); + expect(rftCollectionAddress).to.be.equal(refungibleAddress); + const refungibleTokenContract = uniqueRefungibleToken(web3, rftTokenAddress, owner); + await refungibleTokenContract.methods.approve(fractionalizer.options.address, 100).send(); + + const rft2nft = await fractionalizer.methods.rft2nftMapping(rftTokenAddress).call(); + expect(rft2nft).to.be.like({ + _collection: nftCollectionAddress, + _tokenId: nftTokenId, + }); + + const nft2rft = await fractionalizer.methods.nft2rftMapping(nftCollectionAddress, nftTokenId).call(); + expect(nft2rft).to.be.eq(tokenId.toString()); + }); }); From 65f94fd4f852c9f0622b0c886829e7d75147183e Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 26 Aug 2022 13:27:44 +0000 Subject: [PATCH 0595/1274] fix: remove gas consuption --- pallets/refungible/src/erc_token.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/pallets/refungible/src/erc_token.rs b/pallets/refungible/src/erc_token.rs index 7816469ae1..82dacc9d42 100644 --- a/pallets/refungible/src/erc_token.rs +++ b/pallets/refungible/src/erc_token.rs @@ -50,12 +50,10 @@ pub struct RefungibleTokenHandle(pub RefungibleHandle, pub TokenId #[solidity_interface(name = ERC1633)] impl RefungibleTokenHandle { fn parent_token(&self) -> Result
{ - self.consume_store_reads(2)?; Ok(collection_id_to_address(self.id)) } fn parent_token_id(&self) -> Result { - self.consume_store_reads(2)?; Ok(self.1.into()) } } From ef7158955b3a7529a5aa63eb0fc2eccd4bc196c9 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 26 Aug 2022 13:29:01 +0000 Subject: [PATCH 0596/1274] fmt --- pallets/refungible/src/erc_token.rs | 3 ++- pallets/unique/src/eth/mod.rs | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/refungible/src/erc_token.rs b/pallets/refungible/src/erc_token.rs index 82dacc9d42..5bc182e884 100644 --- a/pallets/refungible/src/erc_token.rs +++ b/pallets/refungible/src/erc_token.rs @@ -32,7 +32,8 @@ use core::{ use evm_coder::{ToLog, execution::*, generate_stubgen, solidity_interface, types::*, weight}; use pallet_common::{ CommonWeightInfo, - erc::{CommonEvmHandler, PrecompileResult}, eth::collection_id_to_address, + erc::{CommonEvmHandler, PrecompileResult}, + eth::collection_id_to_address, }; use pallet_evm::{account::CrossAccountId, PrecompileHandle}; use pallet_evm_coder_substrate::{call, dispatch_to_evm, WithRecorder}; diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index cc417bedc1..268aa0c69a 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -154,7 +154,6 @@ fn make_data( Ok(data) } - fn create_refungible_collection_internal< T: Config + pallet_nonfungible::Config + pallet_refungible::Config, >( From 68035dd8291c62f010f0d6b44edfc3576b1af6cb Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 26 Aug 2022 14:41:17 +0000 Subject: [PATCH 0597/1274] fix: test erc165 --- tests/src/eth/base.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/eth/base.test.ts b/tests/src/eth/base.test.ts index d7a4a96f26..606eab642d 100644 --- a/tests/src/eth/base.test.ts +++ b/tests/src/eth/base.test.ts @@ -94,7 +94,7 @@ describe('ERC165 tests', async () => { }); itWeb3('ERC721 support', async ({web3}) => { - expect(await contract(web3).methods.supportsInterface('0x58800161').call()).to.be.true; + expect(await contract(web3).methods.supportsInterface('0x780e9d63').call()).to.be.true; }); itWeb3('ERC721Metadata support', async ({web3}) => { From d91db108761f1bb02910235420d9981c0501fba2 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 29 Aug 2022 13:42:48 +0700 Subject: [PATCH 0598/1274] add job in workflow that build testnet-local --- .docker/Dockerfile-testnet | 96 +++++++ .docker/docker-compose-testnet.yml | 17 ++ .docker/docker-compose.tmp-testnet.j2 | 18 ++ .../testnet-config/launch-config-testnet.json | 121 +++++++++ .env | 9 + .github/workflows/xcm-testnet.yml | 254 ++++++++++++++++++ 6 files changed, 515 insertions(+) create mode 100644 .docker/Dockerfile-testnet create mode 100644 .docker/docker-compose-testnet.yml create mode 100644 .docker/docker-compose.tmp-testnet.j2 create mode 100644 .docker/testnet-config/launch-config-testnet.json create mode 100644 .github/workflows/xcm-testnet.yml diff --git a/.docker/Dockerfile-testnet b/.docker/Dockerfile-testnet new file mode 100644 index 0000000000..91b4e3bd07 --- /dev/null +++ b/.docker/Dockerfile-testnet @@ -0,0 +1,96 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ARG RUST_TOOLCHAIN= + +ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install $RUST_TOOLCHAIN && \ + rustup default $RUST_TOOLCHAIN && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + + +# ===== BUILD ====== +FROM rust-builder as builder-unique + +ARG PROFILE=release +ARG FEATURE= +ARG BRANCH= + + +WORKDIR /unique_parachain + +RUN git clone -b $BRANCH https://github.com/UniqueNetwork/unique-chain.git && \ + cd unique-chain && \ + cargo build --features=$FEATURE --$PROFILE + +# ===== BUILD POLKADOT ===== +FROM rust-builder as builder-polkadot + +ARG POLKADOT_BUILD_BRANCH= +ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH + + +WORKDIR /unique_parachain + +RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ + cd polkadot && \ + cargo build --release + +# ===== RUN ====== + +FROM ubuntu:20.04 + +ARG POLKADOT_LAUNCH_BRANCH= +ENV POLKADOT_LAUNCH_BRANCH $POLKADOT_LAUNCH_BRANCH + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b $POLKADOT_LAUNCH_BRANCH + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn install + +COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ + +EXPOSE 9844 +EXPOSE 9944 +EXPOSE 9933 +EXPOSE 9833 +EXPOSE 40333 +EXPOSE 30333 + +CMD export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start launch-config.json + + diff --git a/.docker/docker-compose-testnet.yml b/.docker/docker-compose-testnet.yml new file mode 100644 index 0000000000..34f6e9258a --- /dev/null +++ b/.docker/docker-compose-testnet.yml @@ -0,0 +1,17 @@ +version: "3.5" + +services: + xcm_nodes: + build: + context: ../ + dockerfile: .docker/Dockerfile-testnet + expose: + - 9844 + - 9944 + ports: + - 127.0.0.1:9844:9844 + - 127.0.0.1:9944:9944 + logging: + options: + max-size: "1m" + max-file: "3" diff --git a/.docker/docker-compose.tmp-testnet.j2 b/.docker/docker-compose.tmp-testnet.j2 new file mode 100644 index 0000000000..6f237e758b --- /dev/null +++ b/.docker/docker-compose.tmp-testnet.j2 @@ -0,0 +1,18 @@ +version: "3.5" + +services: + xcm_nodes: + build: + args: + - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" + - "BRANCH={{ BRANCH }}" + - "FEATURE={{ FEATURE }}" + - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" + - "POLKADOT_LAUNCH_BRANCH={{ POLKADOT_LAUNCH_BRANCH }}" + image: testnet_node_{{ NETWORK }} + container_name: testnet_node_{{ NETWORK }} + volumes: + - type: bind + source: ./testnet-config/launch-config-testnet.json + target: /polkadot-launch/launch-config.json + read_only: true diff --git a/.docker/testnet-config/launch-config-testnet.json b/.docker/testnet-config/launch-config-testnet.json new file mode 100644 index 0000000000..65a83f6620 --- /dev/null +++ b/.docker/testnet-config/launch-config-testnet.json @@ -0,0 +1,121 @@ +{ + "relaychain": { + "bin": "../polkadot/target/release/polkadot", + "chain": "rococo-local", + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "../unique-chain/target/release/unique-collator", + "id": "1000", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace" + ] + }, + { + "port": 31201, + "wsPort": 9945, + "rpcPort": 9934, + "name": "bob", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [], + "finalization": false +} diff --git a/.env b/.env index 0755a73c83..62280df1da 100644 --- a/.env +++ b/.env @@ -10,3 +10,12 @@ QUARTZ_MAINNET_TAG=quartz-v924012-2 OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443 QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443 + + +POLKADOT_LAUNCH_BRANCH=feature/rewrite-chain-id-in-spec + +ACALA_BUILD_BRANCH=2.9.0 +MOONBEAM_BUILD_BRANCH=v0.25.0 +CUMULUS_BUILD_BRANCH=release-v0.9.230 + + diff --git a/.github/workflows/xcm-testnet.yml b/.github/workflows/xcm-testnet.yml new file mode 100644 index 0000000000..85e7a732b5 --- /dev/null +++ b/.github/workflows/xcm-testnet.yml @@ -0,0 +1,254 @@ +name: upgrade nodata + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: + - master + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + - ready_for_review + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +#Define Workflow variables +env: + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + prepare-execution-marix: + + name: Prepare execution matrix + + runs-on: XL + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: fabiocaccamo/create-matrix-action@v2 + id: create_matrix + with: + matrix: | + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} + + xcm-build: + needs: prepare-execution-marix + # The type of runner that the job will run on + runs-on: [XL] + + timeout-minutes: 600 + + name: ${{ matrix.network }} + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + + + steps: + - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-xcm.j2 + output_file: .docker/docker-compose-xcm.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + NETWORK=${{ matrix.network }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} + MAINNET_BRANCH=${{ matrix.mainnet_branch }} + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + BRANCH=${{ github.head_ref }} + ACALA_BUILD_BRANCH=${{ env.ACALA_BUILD_BRANCH }} + MOONBEAM_BUILD_BRANCH=${{ env.MOONBEAM_BUILD_BRANCH }} + CUMULUS_BUILD_BRANCH=${{ env.CUMULUS_BUILD_BRANCH }} + + - name: Show build configuration + run: cat .docker/docker-compose-xcm.${{ matrix.network }}.yml + + - name: Show launch-config-xcm-${{ matrix.network }} configuration + run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-xcm.yml" -f ".docker/docker-compose-xcm.${{ matrix.network }}.yml" up -d --build + + - name: Collect Docker Logs + if: success() || failure() + uses: jwalton/gh-docker-logs@v2.2.0 + with: + dest: './xcm-build-logs.${{ matrix.features }}' + images: 'xcm-nodes-${{ matrix.network }}' + + - name: Show docker logs + if: success() || failure() + run: cat './xcm-build-logs.${{ matrix.features }}/xcm-nodes-${{ matrix.network }}.log' + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-xcm.yml" -f ".docker/docker-compose-xcm.${{ matrix.network }}.yml" down + + - name: Log in to Docker Hub + uses: docker/login-action + with: + username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + + - name: Tag docker image + run: docker tag xcm_nodes_${{ matrix.network }} uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} + + - name: Push docker image + run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} + + testnet-build: + needs: prepare-execution-marix + # The type of runner that the job will run on + runs-on: [XL] + + timeout-minutes: 600 + + name: ${{ matrix.network }} + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + + steps: + - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-testnet.j2 + output_file: .docker/docker-compose-testnet.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + NETWORK=${{ matrix.network }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} + MAINNET_BRANCH=${{ matrix.mainnet_branch }} + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + BRANCH=${{ github.head_ref }} + + - name: Show build configuration + run: cat .docker/docker-compose-testnet.${{ matrix.network }}.yml + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-testnet.yml" -f ".docker/docker-compose-testnet.${{ matrix.network }}.yml" up -d --build + + - name: Collect Docker Logs + if: success() || failure() + uses: jwalton/gh-docker-logs@v2.2.0 + with: + dest: './testnet-build-logs.${{ matrix.features }}' + images: 'testnet_node_${{ matrix.network }}' + + - name: Show docker logs + if: success() || failure() + run: cat './testnet-build-logs.${{ matrix.features }}/testnet_node_${{ matrix.network }}.log' + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-testnet.yml" -f ".docker/docker-compose-testnet.${{ matrix.network }}.yml" down + + - name: Log in to Docker Hub + uses: docker/login-action + with: + username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + + - name: Tag docker image + run: docker tag testnet_node_${{ matrix.network }} uniquenetwork/${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} + + - name: Push docker image + run: docker push uniquenetwork/${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} + + From fc406280aa2f70f1b73d5377f5903955fdf22845 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 18 Aug 2022 09:47:20 +0000 Subject: [PATCH 0599/1274] feature/mint-for-fungible-token --- pallets/fungible/src/erc.rs | 35 ++++- pallets/fungible/src/stubs/UniqueFungible.sol | 54 +++++++- tests/src/eth/api/UniqueFungible.sol | 59 ++++---- tests/src/eth/fungible.test.ts | 128 +++++++++++++++++- tests/src/eth/fungibleAbi.json | 27 ++++ 5 files changed, 272 insertions(+), 31 deletions(-) diff --git a/pallets/fungible/src/erc.rs b/pallets/fungible/src/erc.rs index 49f93582d2..a955099f9b 100644 --- a/pallets/fungible/src/erc.rs +++ b/pallets/fungible/src/erc.rs @@ -129,7 +129,23 @@ impl FungibleHandle { } } -#[solidity_interface(name = ERC20UniqueExtensions)] +#[solidity_interface(name = "ERC20Mintable")] +impl FungibleHandle { + #[weight(>::create_item())] + fn mint(&mut self, caller: caller, to: address, amount: uint256) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let to = T::CrossAccountId::from_eth(to); + let amount = amount.try_into().map_err(|_| "amount overflow")?; + let budget = self + .recorder + .weight_calls_budget(>::find_parent()); + >::create_item(&self, &caller, (to, amount), &budget) + .map_err(dispatch_to_evm::)?; + Ok(true) + } +} + +#[solidity_interface(name = "ERC20UniqueExtensions")] impl FungibleHandle { #[weight(>::burn_from())] fn burn_from(&mut self, caller: caller, from: address, amount: uint256) -> Result { @@ -144,12 +160,29 @@ impl FungibleHandle { .map_err(dispatch_to_evm::)?; Ok(true) } + + #[weight(>::create_multiple_items_ex(amounts.len() as u32))] + fn mint_bulk(&mut self, caller: caller, amounts: Vec<(address, uint256)>) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let budget = self + .recorder + .weight_calls_budget(>::find_parent()); + let amounts = amounts + .into_iter() + .map(|(to, amount)| Ok((T::CrossAccountId::from_eth(to), amount.try_into().map_err(|_| "amount overflow")?))) + .collect::>()?; + + >::create_multiple_items(&self, &caller, amounts, &budget) + .map_err(dispatch_to_evm::)?; + Ok(true) + } } #[solidity_interface( name = UniqueFungible, is( ERC20, + ERC20Mintable, ERC20UniqueExtensions, Collection(common_mut, CollectionHandle), ) diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index bdc7e8865d..1df0b0946f 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -3,7 +3,13 @@ pragma solidity >=0.8.0 <0.9.0; -/// @dev common stubs holder +// Anonymous struct +struct Tuple0 { + address field_0; + uint256 field_1; +} + +// Common stubs holder contract Dummy { uint8 dummy; string stub_error = "this contract is implemented in native"; @@ -21,8 +27,49 @@ contract ERC165 is Dummy { } } -/// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0xe54be640 +// Inline +contract ERC20Events { + event Transfer(address indexed from, address indexed to, uint256 value); + event Approval( + address indexed owner, + address indexed spender, + uint256 value + ); +} + +// Selector: 40c10f19 +contract ERC20Mintable is Dummy, ERC165 { + // Selector: mint(address,uint256) 40c10f19 + function mint(address to, uint256 amount) public returns (bool) { + require(false, stub_error); + to; + amount; + dummy = 0; + return false; + } +} + +// Selector: 63034ac5 +contract ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) public returns (bool) { + require(false, stub_error); + from; + amount; + dummy = 0; + return false; + } + + // Selector: mintBulk((address,uint256)[]) 1acf2d55 + function mintBulk(Tuple0[] memory amounts) public returns (bool) { + require(false, stub_error); + amounts; + dummy = 0; + return false; + } +} + +// Selector: 6cf113cd contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -476,6 +523,7 @@ contract UniqueFungible is Dummy, ERC165, ERC20, + ERC20Mintable, ERC20UniqueExtensions, Collection {} diff --git a/tests/src/eth/api/UniqueFungible.sol b/tests/src/eth/api/UniqueFungible.sol index 4570f4929e..fdb7391f16 100644 --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -3,7 +3,13 @@ pragma solidity >=0.8.0 <0.9.0; -/// @dev common stubs holder +// Anonymous struct +struct Tuple0 { + address field_0; + uint256 field_1; +} + +// Common stubs holder interface Dummy { } @@ -12,8 +18,32 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } -/// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0xe54be640 +// Inline +interface ERC20Events { + event Transfer(address indexed from, address indexed to, uint256 value); + event Approval( + address indexed owner, + address indexed spender, + uint256 value + ); +} + +// Selector: 40c10f19 +interface ERC20Mintable is Dummy, ERC165 { + // Selector: mint(address,uint256) 40c10f19 + function mint(address to, uint256 amount) external returns (bool); +} + +// Selector: 63034ac5 +interface ERC20UniqueExtensions is Dummy, ERC165 { + // Selector: burnFrom(address,uint256) 79cc6790 + function burnFrom(address from, uint256 amount) external returns (bool); + + // Selector: mintBulk((address,uint256)[]) 1acf2d55 + function mintBulk(Tuple0[] memory amounts) external returns (bool); +} + +// Selector: 6cf113cd interface Collection is Dummy, ERC165 { /// Set collection property. /// @@ -207,28 +237,6 @@ interface Collection is Dummy, ERC165 { /// @dev EVM selector for this function is: 0xd34b55b8, /// or in textual repr: uniqueCollectionType() function uniqueCollectionType() external returns (string memory); - - /// Changes collection owner to another account - /// - /// @dev Owner can be changed only by current owner - /// @param newOwner new owner account - /// @dev EVM selector for this function is: 0x13af4035, - /// or in textual repr: setOwner(address) - function setOwner(address newOwner) external; - - /// Changes collection owner to another substrate account - /// - /// @dev Owner can be changed only by current owner - /// @param newOwner new owner substrate account - /// @dev EVM selector for this function is: 0xb212138f, - /// or in textual repr: setOwnerSubstrate(uint256) - function setOwnerSubstrate(uint256 newOwner) external; -} - -/// @dev anonymous struct -struct Tuple6 { - address field_0; - uint256 field_1; } /// @dev the ERC-165 identifier for this interface is 0x79cc6790 @@ -298,6 +306,7 @@ interface UniqueFungible is Dummy, ERC165, ERC20, + ERC20Mintable, ERC20UniqueExtensions, Collection {} diff --git a/tests/src/eth/fungible.test.ts b/tests/src/eth/fungible.test.ts index 7acd39cd10..a8d05510d8 100644 --- a/tests/src/eth/fungible.test.ts +++ b/tests/src/eth/fungible.test.ts @@ -14,10 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess, UNIQUE} from '../util/helpers'; -import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, transferBalanceToEth} from './util/helpers'; +import {approveExpectSuccess, createCollection, createCollectionExpectSuccess, createFungibleItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess, UNIQUE} from '../util/helpers'; +import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, GAS_ARGS, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, transferBalanceToEth} from './util/helpers'; import fungibleAbi from './fungibleAbi.json'; import {expect} from 'chai'; +import {submitTransactionAsync} from '../substrate/substrate-api'; describe('Fungible: Information getting', () => { itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => { @@ -58,6 +59,129 @@ describe('Fungible: Information getting', () => { }); describe('Fungible: Plain calls', () => { + itWeb3('Can perform mint()', async ({web3, api, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + const collection = await createCollection(api, alice, { + name: 'token name', + mode: {type: 'Fungible', decimalPoints: 0}, + }); + + const receiver = createEthAccount(web3); + + const collectionIdAddress = collectionIdToAddress(collection.collectionId); + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const changeAdminTx = api.tx.unique.addCollectionAdmin(collection.collectionId, {Ethereum: owner}); + await submitTransactionAsync(alice, changeAdminTx); + + const collectionContract = evmCollection(web3, owner, collectionIdAddress, {type: 'Fungible', decimalPoints: 0}); + const result = await collectionContract.methods.mint(receiver, 100).send(); + const events = normalizeEvents(result.events); + + expect(events).to.be.deep.equal([ + { + address: collectionIdAddress, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver, + value: '100', + }, + }, + ]); + }); + + itWeb3('Can perform mintBulk()', async ({web3, api, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + const collection = await createCollection(api, alice, { + name: 'token name', + mode: {type: 'Fungible', decimalPoints: 0}, + }); + + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const receiver1 = createEthAccount(web3); + const receiver2 = createEthAccount(web3); + const receiver3 = createEthAccount(web3); + + const collectionIdAddress = collectionIdToAddress(collection.collectionId); + const changeAdminTx = api.tx.unique.addCollectionAdmin(collection.collectionId, {Ethereum: owner}); + await submitTransactionAsync(alice, changeAdminTx); + + const collectionContract = evmCollection(web3, owner, collectionIdAddress, {type: 'Fungible', decimalPoints: 0}); + const result = await collectionContract.methods.mintBulk([ + [receiver1, 10], + [receiver2, 20], + [receiver3, 30], + ]).call(); + console.log(result); + const events = normalizeEvents(result.events); + + expect(events).to.be.deep.equal([ + { + address:collectionIdAddress, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver1, + value: '10', + }, + }, + { + address:collectionIdAddress, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver2, + value: '20', + }, + }, + { + address:collectionIdAddress, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver3, + value: '30', + }, + }, + ]); + }); + + itWeb3('Can perform burn()', async ({web3, api, privateKeyWrapper}) => { + const alice = privateKeyWrapper('//Alice'); + const collection = await createCollection(api, alice, { + name: 'token name', + mode: {type: 'Fungible', decimalPoints: 0}, + }); + + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const changeAdminTx = api.tx.unique.addCollectionAdmin(collection.collectionId, {Ethereum: owner}); + await submitTransactionAsync(alice, changeAdminTx); + const receiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const collectionIdAddress = collectionIdToAddress(collection.collectionId); + const collectionContract = evmCollection(web3, owner, collectionIdAddress, {type: 'Fungible', decimalPoints: 0}); + await collectionContract.methods.mint(receiver, 100).send(); + + const result = await collectionContract.methods.burnFrom(receiver, 49).send({from: receiver}); + + const events = normalizeEvents(result.events); + + expect(events).to.be.deep.equal([ + { + address: collectionIdAddress, + event: 'Transfer', + args: { + from: receiver, + to: '0x0000000000000000000000000000000000000000', + value: '49', + }, + }, + ]); + + const balance = await collectionContract.methods.balanceOf(receiver).call(); + expect(balance).to.equal('51'); + }); + itWeb3('Can perform approve()', async ({web3, api, privateKeyWrapper}) => { const collection = await createCollectionExpectSuccess({ name: 'token name', diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index 58ca3332b2..07e4ca754b 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -150,6 +150,33 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "mint", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "field_0", "type": "address" }, + { "internalType": "uint256", "name": "field_1", "type": "uint256" } + ], + "internalType": "struct Tuple0[]", + "name": "amounts", + "type": "tuple[]" + } + ], + "name": "mintBulk", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "getCollectionSponsor", From 5562dabdb63ff1fa436d5fe1371716197c22c409 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 11 Aug 2022 09:44:22 +0000 Subject: [PATCH 0600/1274] chore: add docs --- pallets/fungible/CHANGELOG.md | 7 +++++++ pallets/fungible/src/erc.rs | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/pallets/fungible/CHANGELOG.md b/pallets/fungible/CHANGELOG.md index e922ef073e..ef52e80d02 100644 --- a/pallets/fungible/CHANGELOG.md +++ b/pallets/fungible/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. + +## [0.1.5] - 2022-08-29 + +### Added + + - Implementation of `mint` and `mint_bulk` methods for ERC20 API. + ## [v0.1.4] - 2022-08-24 ### Change diff --git a/pallets/fungible/src/erc.rs b/pallets/fungible/src/erc.rs index a955099f9b..d3f51611ed 100644 --- a/pallets/fungible/src/erc.rs +++ b/pallets/fungible/src/erc.rs @@ -131,6 +131,9 @@ impl FungibleHandle { #[solidity_interface(name = "ERC20Mintable")] impl FungibleHandle { + /// Mint tokens for `to` account. + /// @param to account that will receive minted tokens + /// @param amount amount of tokens to mint #[weight(>::create_item())] fn mint(&mut self, caller: caller, to: address, amount: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -147,6 +150,11 @@ impl FungibleHandle { #[solidity_interface(name = "ERC20UniqueExtensions")] impl FungibleHandle { + /// Burn tokens from account + /// @dev Function that burns an `amount` of the tokens of a given account, + /// deducting from the sender's allowance for said account. + /// @param from The account whose tokens will be burnt. + /// @param amount The amount that will be burnt. #[weight(>::burn_from())] fn burn_from(&mut self, caller: caller, from: address, amount: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -161,6 +169,8 @@ impl FungibleHandle { Ok(true) } + /// Mint tokens for multiple accounts. + /// @param amounts array of pairs of account address and amount #[weight(>::create_multiple_items_ex(amounts.len() as u32))] fn mint_bulk(&mut self, caller: caller, amounts: Vec<(address, uint256)>) -> Result { let caller = T::CrossAccountId::from_eth(caller); From 420882b802b824d3cdcdafb2dc9d54967b7b78f1 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 17 Aug 2022 06:58:13 +0000 Subject: [PATCH 0601/1274] path: Fix parsing simple values. --- Cargo.lock | 3 +- crates/evm-coder/CHANGELOG.md | 8 ++++- crates/evm-coder/Cargo.toml | 5 +-- crates/evm-coder/src/abi.rs | 52 +++++++++++++++++++++++++------- crates/evm-coder/src/solidity.rs | 5 ++- pallets/fungible/src/erc.rs | 7 ++++- 6 files changed, 63 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 269ae8342d..c414a937bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2169,7 +2169,7 @@ dependencies = [ [[package]] name = "evm-coder" -version = "0.1.1" +version = "0.1.2" dependencies = [ "ethereum", "evm-coder-procedural", @@ -2178,6 +2178,7 @@ dependencies = [ "hex-literal", "impl-trait-for-tuples", "primitive-types", + "sp-std", ] [[package]] diff --git a/crates/evm-coder/CHANGELOG.md b/crates/evm-coder/CHANGELOG.md index cb8bd85c0f..711280f911 100644 --- a/crates/evm-coder/CHANGELOG.md +++ b/crates/evm-coder/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.1.3] - 2022-08-29 + +### Fixed + + - Parsing simple values. + ## [v0.1.2] 2022-08-19 @@ -21,4 +27,4 @@ All notable changes to this project will be documented in this file. - build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 -- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b \ No newline at end of file +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b diff --git a/crates/evm-coder/Cargo.toml b/crates/evm-coder/Cargo.toml index 8a5abc61fb..b8db5c369e 100644 --- a/crates/evm-coder/Cargo.toml +++ b/crates/evm-coder/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "evm-coder" -version = "0.1.1" +version = "0.1.2" license = "GPLv3" edition = "2021" @@ -11,8 +11,9 @@ evm-coder-procedural = { path = "./procedural" } primitive-types = { version = "0.11.1", default-features = false } # Evm doesn't have reexports for log and others ethereum = { version = "0.12.0", default-features = false } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } # Error types for execution -evm-core = { default-features = false, git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.27" } +evm-core = { default-features = false , git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.27" } # We have tuple-heavy code in solidity.rs impl-trait-for-tuples = "0.2.2" diff --git a/crates/evm-coder/src/abi.rs b/crates/evm-coder/src/abi.rs index 769ad30608..bf0404fd6c 100644 --- a/crates/evm-coder/src/abi.rs +++ b/crates/evm-coder/src/abi.rs @@ -28,6 +28,7 @@ use crate::{ types::{string, self}, }; use crate::execution::Result; +use crate::solidity::SolidityTypeName; const ABI_ALIGNMENT: usize = 32; @@ -77,8 +78,8 @@ impl<'i> AbiReader<'i> { return Err(Error::Error(ExitError::OutOfOffset)); } let mut block = [0; S]; - // Verify padding is empty - if !buf[pad_start..pad_size].iter().all(|&v| v == 0) { + let is_pad_zeroed = !buf[pad_start..pad_size].iter().all(|&v| v == 0); + if is_pad_zeroed { return Err(Error::Error(ExitError::InvalidRange)); } block.copy_from_slice(&buf[block_start..block_size]); @@ -133,7 +134,7 @@ impl<'i> AbiReader<'i> { /// Read [`Vec`] at current position, then advance pub fn bytes(&mut self) -> Result> { - let mut subresult = self.subresult()?; + let mut subresult = self.subresult(None)?; let length = subresult.uint32()? as usize; if subresult.buf.len() < subresult.offset + length { return Err(Error::Error(ExitError::OutOfOffset)); @@ -179,15 +180,26 @@ impl<'i> AbiReader<'i> { } /// Slice recursive buffer, advance one word for buffer offset - fn subresult(&mut self) -> Result> { - let offset = self.uint32()? as usize; + /// If `size` is [`None`] then [`Self::offset`] and [`Self::subresult_offset`] evals from [`Self::buf`]. + fn subresult(&mut self, size: Option) -> Result> { + let subresult_offset = self.subresult_offset; + let offset = if let Some(size) = size { + self.offset += size; + self.subresult_offset += size; + 0 + } else { + self.uint32()? as usize + }; + if offset + self.subresult_offset > self.buf.len() { return Err(Error::Error(ExitError::InvalidRange)); } + + let new_offset = offset + subresult_offset; Ok(AbiReader { buf: self.buf, - subresult_offset: offset + self.subresult_offset, - offset: offset + self.subresult_offset, + subresult_offset: new_offset, + offset: new_offset, }) } @@ -355,7 +367,7 @@ where Self: AbiRead, { fn abi_read(&mut self) -> Result> { - let mut sub = self.subresult()?; + let mut sub = self.subresult(None)?; let size = sub.uint32()? as usize; sub.subresult_offset = sub.offset; let mut out = Vec::with_capacity(size); @@ -366,15 +378,33 @@ where } } +fn aligned_size(size: usize) -> usize { + let need_align = (size % ABI_ALIGNMENT) != 0; + let aligned_parts = size / ABI_ALIGNMENT; + (aligned_parts * ABI_ALIGNMENT) + if need_align { ABI_ALIGNMENT } else { 0 } +} + +#[test] +fn test_aligned_size() { + assert_eq!(aligned_size(20), ABI_ALIGNMENT); + assert_eq!(aligned_size(32), ABI_ALIGNMENT); + assert_eq!(aligned_size(52), 2 * ABI_ALIGNMENT); + assert_eq!(aligned_size(64), 2 * ABI_ALIGNMENT); +} + macro_rules! impl_tuples { ($($ident:ident)+) => { impl<$($ident),+> sealed::CanBePlacedInVec for ($($ident,)+) {} impl<$($ident),+> AbiRead<($($ident,)+)> for AbiReader<'_> where - $(Self: AbiRead<$ident>),+ + $( + Self: AbiRead<$ident>, + )+ + ($($ident,)+): SolidityTypeName, { fn abi_read(&mut self) -> Result<($($ident,)+)> { - let mut subresult = self.subresult()?; + let size = if <($($ident,)+)>::is_simple() { Some(0 $(+aligned_size(sp_std::mem::size_of::<$ident>()))+) } else { None }; + let mut subresult = self.subresult(size)?; Ok(( $(>::abi_read(&mut subresult)?,)+ )) @@ -535,7 +565,7 @@ pub mod test { assert_eq!(encoded, alternative_encoded); let mut decoder = AbiReader::new(&encoded); - assert_eq!(decoder.bool().unwrap(), true); + assert!(decoder.bool().unwrap()); assert_eq!(decoder.string().unwrap(), "test"); } diff --git a/crates/evm-coder/src/solidity.rs b/crates/evm-coder/src/solidity.rs index d0cb5c80e2..450f6aed72 100644 --- a/crates/evm-coder/src/solidity.rs +++ b/crates/evm-coder/src/solidity.rs @@ -192,7 +192,10 @@ macro_rules! impl_tuples { write!(writer, "{}", tc.collect_tuple::()) } fn is_simple() -> bool { - false + true + $( + && <$ident>::is_simple() + )* } #[allow(unused_assignments)] fn solidity_default(writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result { diff --git a/pallets/fungible/src/erc.rs b/pallets/fungible/src/erc.rs index d3f51611ed..11d21448c0 100644 --- a/pallets/fungible/src/erc.rs +++ b/pallets/fungible/src/erc.rs @@ -179,7 +179,12 @@ impl FungibleHandle { .weight_calls_budget(>::find_parent()); let amounts = amounts .into_iter() - .map(|(to, amount)| Ok((T::CrossAccountId::from_eth(to), amount.try_into().map_err(|_| "amount overflow")?))) + .map(|(to, amount)| { + Ok(( + T::CrossAccountId::from_eth(to), + amount.try_into().map_err(|_| "amount overflow")?, + )) + }) .collect::>()?; >::create_multiple_items(&self, &caller, amounts, &budget) From 2cb27561505bebc94940b8018a116421c4d0ff75 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 17 Aug 2022 08:58:55 +0000 Subject: [PATCH 0602/1274] path: Add test for simple data --- crates/evm-coder/src/abi.rs | 40 +++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/crates/evm-coder/src/abi.rs b/crates/evm-coder/src/abi.rs index bf0404fd6c..2088259ed4 100644 --- a/crates/evm-coder/src/abi.rs +++ b/crates/evm-coder/src/abi.rs @@ -78,8 +78,8 @@ impl<'i> AbiReader<'i> { return Err(Error::Error(ExitError::OutOfOffset)); } let mut block = [0; S]; - let is_pad_zeroed = !buf[pad_start..pad_size].iter().all(|&v| v == 0); - if is_pad_zeroed { + let is_pad_zeroed = buf[pad_start..pad_size].iter().all(|&v| v == 0); + if !is_pad_zeroed { return Err(Error::Error(ExitError::InvalidRange)); } block.copy_from_slice(&buf[block_start..block_size]); @@ -634,4 +634,40 @@ pub mod test { ] ); } + + #[test] + fn parse_vec_with_simple_type() { + use crate::types::address; + use primitive_types::{H160, U256}; + + let (call, mut decoder) = AbiReader::new_call(&hex!( + " + 1ACF2D55 + 0000000000000000000000000000000000000000000000000000000000000020 // offset of (address, uint256)[] + 0000000000000000000000000000000000000000000000000000000000000003 // length of (address, uint256)[] + + 0000000000000000000000002D2FF76104B7BACB2E8F6731D5BFC184EBECDDBC // address + 000000000000000000000000000000000000000000000000000000000000000A // uint256 + + 000000000000000000000000AB8E3D9134955566483B11E6825C9223B6737B10 // address + 0000000000000000000000000000000000000000000000000000000000000014 // uint256 + + 0000000000000000000000008C582BDF2953046705FC56F189385255EFC1BE18 // address + 000000000000000000000000000000000000000000000000000000000000001E // uint256 + " + )) + .unwrap(); + assert_eq!(call, u32::to_be_bytes(0x1ACF2D55)); + let data = + as AbiRead>>::abi_read(&mut decoder).unwrap(); + assert_eq!(data.len(), 3); + assert_eq!( + data, + vec![ + (H160(hex!("2D2FF76104B7BACB2E8F6731D5BFC184EBECDDBC")), U256([10, 0, 0, 0])), + (H160(hex!("AB8E3D9134955566483B11E6825C9223B6737B10")), U256([20, 0, 0, 0])), + (H160(hex!("8C582BDF2953046705FC56F189385255EFC1BE18")), U256([30, 0, 0, 0])), + ] + ); + } } From 3114b4fb8796ab54c277732e0c20ee5a5feec287 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 17 Aug 2022 11:58:51 +0000 Subject: [PATCH 0603/1274] test: Fix test --- tests/src/eth/fungible.test.ts | 55 +++++++++++++++++----------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/tests/src/eth/fungible.test.ts b/tests/src/eth/fungible.test.ts index a8d05510d8..9eb3d01306 100644 --- a/tests/src/eth/fungible.test.ts +++ b/tests/src/eth/fungible.test.ts @@ -111,39 +111,38 @@ describe('Fungible: Plain calls', () => { [receiver1, 10], [receiver2, 20], [receiver3, 30], - ]).call(); - console.log(result); + ]).send(); const events = normalizeEvents(result.events); - expect(events).to.be.deep.equal([ - { - address:collectionIdAddress, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver1, - value: '10', - }, + expect(events).to.be.deep.contain({ + address:collectionIdAddress, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver1, + value: '10', }, - { - address:collectionIdAddress, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver2, - value: '20', - }, + }); + + expect(events).to.be.deep.contain({ + address:collectionIdAddress, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver2, + value: '20', }, - { - address:collectionIdAddress, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver3, - value: '30', - }, + }); + + expect(events).to.be.deep.contain({ + address:collectionIdAddress, + event: 'Transfer', + args: { + from: '0x0000000000000000000000000000000000000000', + to: receiver3, + value: '30', }, - ]); + }); }); itWeb3('Can perform burn()', async ({web3, api, privateKeyWrapper}) => { From 0a5eeb039c86165fbcaa4a2cb97185ca9ab2381c Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 19 Aug 2022 15:08:21 +0000 Subject: [PATCH 0604/1274] minor: change calculating size for simple types. --- crates/evm-coder/src/abi.rs | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/crates/evm-coder/src/abi.rs b/crates/evm-coder/src/abi.rs index 2088259ed4..37669a7525 100644 --- a/crates/evm-coder/src/abi.rs +++ b/crates/evm-coder/src/abi.rs @@ -330,6 +330,7 @@ impl AbiWriter { pub trait AbiRead { /// Read item from current position, advanding decoder fn abi_read(&mut self) -> Result; + fn size() -> usize; } macro_rules! impl_abi_readable { @@ -338,6 +339,10 @@ macro_rules! impl_abi_readable { fn abi_read(&mut self) -> Result<$ty> { self.$method() } + + fn size() -> usize { + ABI_ALIGNMENT + } } }; } @@ -376,20 +381,10 @@ where } Ok(out) } -} - -fn aligned_size(size: usize) -> usize { - let need_align = (size % ABI_ALIGNMENT) != 0; - let aligned_parts = size / ABI_ALIGNMENT; - (aligned_parts * ABI_ALIGNMENT) + if need_align { ABI_ALIGNMENT } else { 0 } -} -#[test] -fn test_aligned_size() { - assert_eq!(aligned_size(20), ABI_ALIGNMENT); - assert_eq!(aligned_size(32), ABI_ALIGNMENT); - assert_eq!(aligned_size(52), 2 * ABI_ALIGNMENT); - assert_eq!(aligned_size(64), 2 * ABI_ALIGNMENT); + fn size() -> usize { + ABI_ALIGNMENT + } } macro_rules! impl_tuples { @@ -403,12 +398,16 @@ macro_rules! impl_tuples { ($($ident,)+): SolidityTypeName, { fn abi_read(&mut self) -> Result<($($ident,)+)> { - let size = if <($($ident,)+)>::is_simple() { Some(0 $(+aligned_size(sp_std::mem::size_of::<$ident>()))+) } else { None }; + let size = if <($($ident,)+)>::is_simple() { Some(>::size()) } else { None }; let mut subresult = self.subresult(size)?; Ok(( $(>::abi_read(&mut subresult)?,)+ )) } + + fn size() -> usize { + 0 $(+ {let _ : $ident; ABI_ALIGNMENT})+ + } } #[allow(non_snake_case)] impl<$($ident),+> AbiWrite for &($($ident,)+) From c288f0959e9503ded9e6d15b7da435d699a69d31 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Sat, 20 Aug 2022 07:11:19 +0000 Subject: [PATCH 0605/1274] fmt --- crates/evm-coder/src/abi.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/crates/evm-coder/src/abi.rs b/crates/evm-coder/src/abi.rs index 37669a7525..a0aa4eb424 100644 --- a/crates/evm-coder/src/abi.rs +++ b/crates/evm-coder/src/abi.rs @@ -663,9 +663,18 @@ pub mod test { assert_eq!( data, vec![ - (H160(hex!("2D2FF76104B7BACB2E8F6731D5BFC184EBECDDBC")), U256([10, 0, 0, 0])), - (H160(hex!("AB8E3D9134955566483B11E6825C9223B6737B10")), U256([20, 0, 0, 0])), - (H160(hex!("8C582BDF2953046705FC56F189385255EFC1BE18")), U256([30, 0, 0, 0])), + ( + H160(hex!("2D2FF76104B7BACB2E8F6731D5BFC184EBECDDBC")), + U256([10, 0, 0, 0]) + ), + ( + H160(hex!("AB8E3D9134955566483B11E6825C9223B6737B10")), + U256([20, 0, 0, 0]) + ), + ( + H160(hex!("8C582BDF2953046705FC56F189385255EFC1BE18")), + U256([30, 0, 0, 0]) + ), ] ); } From 9b72a3a55cc6b17d5fd66724c1e9311c554432b3 Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 29 Aug 2022 13:07:24 +0300 Subject: [PATCH 0606/1274] Weight trader removed --- node/cli/src/chain_spec.rs | 1 - pallets/foreing-assets/src/lib.rs | 48 +------- pallets/fungible/src/lib.rs | 7 +- .../common/config/pallets/foreign_asset.rs | 8 +- runtime/common/config/xcm.rs | 109 +++++++----------- runtime/opal/src/xcm_config.rs | 16 +-- runtime/quartz/src/xcm_config.rs | 2 +- runtime/unique/src/xcm_config.rs | 2 +- 8 files changed, 64 insertions(+), 129 deletions(-) diff --git a/node/cli/src/chain_spec.rs b/node/cli/src/chain_spec.rs index 19551004b3..9eb8d54245 100644 --- a/node/cli/src/chain_spec.rs +++ b/node/cli/src/chain_spec.rs @@ -65,7 +65,6 @@ pub enum RuntimeId { Unknown(String), } - #[cfg(not(feature = "unique-runtime"))] /// PARA_ID for Opal/Quartz const PARA_ID: u32 = 2095; diff --git a/pallets/foreing-assets/src/lib.rs b/pallets/foreing-assets/src/lib.rs index ea466280a9..b9e94fdf09 100644 --- a/pallets/foreing-assets/src/lib.rs +++ b/pallets/foreing-assets/src/lib.rs @@ -458,7 +458,7 @@ pub use frame_support::{ use xcm::latest::{Fungibility::Fungible as XcmFungible}; -pub struct UsingAnyCurrencyComponents< +pub struct FreeForAll< WeightToFee: WeightToFeePolynomial, AssetId: Get, AccountId, @@ -476,8 +476,7 @@ impl< AccountId, Currency: CurrencyT, OnUnbalanced: OnUnbalancedT, - > WeightTrader - for UsingAnyCurrencyComponents + > WeightTrader for FreeForAll { fn new() -> Self { Self(0, Zero::zero(), PhantomData) @@ -485,46 +484,7 @@ impl< fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { log::trace!(target: "fassets::weight", "buy_weight weight: {:?}, payment: {:?}", weight, payment); - - let amount: Currency::Balance = (0 as u32).into(); - let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?; - - let asset_id = payment - .fungible - .iter() - .next() - .map_or(Err(XcmError::TooExpensive), |v| Ok(v.0))?; - - // First fungible pays fee - let required = MultiAsset { - id: asset_id.clone(), - fun: XcmFungible(u128_amount), - }; - - log::trace!( - target: "fassets::weight", "buy_weight payment: {:?}, required: {:?}", - payment, required, - ); - - let unused = payment - .checked_sub(required) - .map_err(|_| XcmError::TooExpensive)?; - self.0 = self.0.saturating_add(weight); - self.1 = self.1.saturating_add(amount); - Ok(unused) - } - - fn refund_weight(&mut self, weight: Weight) -> Option { - let weight = weight.min(self.0); - let amount = WeightToFee::weight_to_fee(&weight); - self.0 -= weight; - self.1 = self.1.saturating_sub(amount); - let amount: u128 = amount.saturated_into(); - if amount > 0 { - Some((AssetId::get(), amount).into()) - } else { - None - } + Ok(payment) } } impl< @@ -533,7 +493,7 @@ impl< AccountId, Currency: CurrencyT, OnUnbalanced: OnUnbalancedT, - > Drop for UsingAnyCurrencyComponents + > Drop for FreeForAll { fn drop(&mut self) { OnUnbalanced::on_unbalanced(Currency::issue(self.1)); diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index d6f346d554..6de15a96f4 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -171,10 +171,9 @@ pub mod pallet { /// Foreign collection flag #[pallet::storage] pub type ForeignCollection = - StorageMap; + StorageMap; } - /// Wrapper around untyped collection handle, asserting inner collection is of fungible type. /// Required for interaction with Fungible collections, type safety and implementation [`solidity_interface`][`evm_coder::solidity_interface`]. pub struct FungibleHandle(pallet_common::CollectionHandle); @@ -340,7 +339,7 @@ impl Pallet { to: H160::default(), value: amount.into(), } - .to_log(collection_id_to_address(collection.id)), + .to_log(collection_id_to_address(collection.id)), ); >::deposit_event(CommonEvent::ItemDestroyed( collection.id, @@ -560,7 +559,7 @@ impl Pallet { to: *user.as_eth(), value: amount.into(), } - .to_log(collection_id_to_address(collection.id)), + .to_log(collection_id_to_address(collection.id)), ); >::deposit_event(CommonEvent::ItemCreated( collection.id, diff --git a/runtime/common/config/pallets/foreign_asset.rs b/runtime/common/config/pallets/foreign_asset.rs index 530348463b..c333241d17 100644 --- a/runtime/common/config/pallets/foreign_asset.rs +++ b/runtime/common/config/pallets/foreign_asset.rs @@ -2,8 +2,8 @@ use crate::{Runtime, Event, Balances}; use up_common::types::AccountId; impl pallet_foreing_assets::Config for Runtime { - type Event = Event; - type Currency = Balances; - type RegisterOrigin = frame_system::EnsureRoot; - type WeightInfo = (); + type Event = Event; + type Currency = Balances; + type RegisterOrigin = frame_system::EnsureRoot; + type WeightInfo = (); } diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs index 117c6e2d7b..8cd90fb669 100644 --- a/runtime/common/config/xcm.rs +++ b/runtime/common/config/xcm.rs @@ -16,8 +16,8 @@ use frame_support::{ traits::{ - Contains, tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Get, Everything, - fungibles, + Contains, tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Get, + Everything, fungibles, }, weights::{Weight, WeightToFeePolynomial, WeightToFee}, parameter_types, match_types, @@ -37,21 +37,23 @@ use xcm::latest::{ }; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - FixedWeightBounds, FungiblesAdapter, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative, - SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ParentIsPreset, - ConvertedConcreteAssetId + FixedWeightBounds, FungiblesAdapter, LocationInverter, NativeAsset, ParentAsSuperuser, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + ParentIsPreset, ConvertedConcreteAssetId, }; use xcm_executor::{Config, XcmExecutor, Assets}; -use xcm_executor::traits::{Convert as ConvertXcm, JustTry, MatchesFungible, WeightTrader, FilterAssetLocation}; +use xcm_executor::traits::{ + Convert as ConvertXcm, JustTry, MatchesFungible, WeightTrader, FilterAssetLocation, +}; use pallet_foreing_assets::{ - AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, - UsingAnyCurrencyComponents, TryAsForeing, ForeignAssetId, + AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, FreeForAll, + TryAsForeing, ForeignAssetId, }; use sp_std::{borrow::Borrow, marker::PhantomData, vec, vec::Vec}; use crate::{ Runtime, Call, Event, Origin, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue, - xcm_config::Barrier + xcm_config::Barrier, }; #[cfg(feature = "foreign-assets")] use crate::ForeingAssets; @@ -83,8 +85,22 @@ pub type LocationToAccountId = ( pub struct OnlySelfCurrency; impl> MatchesFungible for OnlySelfCurrency { fn matches_fungible(a: &MultiAsset) -> Option { + let paraid = Parachain(ParachainInfo::parachain_id().into()); match (&a.id, &a.fun) { - (Concrete(_), XcmFungible(ref amount)) => CheckedConversion::checked_from(*amount), + ( + Concrete(MultiLocation { + parents: 1, + interior: X1(loc), + }), + XcmFungible(ref amount), + ) if paraid == *loc => CheckedConversion::checked_from(*amount), + ( + Concrete(MultiLocation { + parents: 0, + interior: Here, + }), + XcmFungible(ref amount), + ) => CheckedConversion::checked_from(*amount), _ => None, } } @@ -188,48 +204,7 @@ impl< } fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { - let amount: Currency::Balance = (0 as u32).into(); - //let amount = WeightToFee::weight_to_fee(&weight); - let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?; - - // location to this parachain through relay chain - let option1: xcm::v1::AssetId = Concrete(MultiLocation { - parents: 1, - interior: X1(Parachain(ParachainInfo::parachain_id().into())), - }); - // direct location - let option2: xcm::v1::AssetId = Concrete(MultiLocation { - parents: 0, - interior: Here, - }); - - let required = if payment.fungible.contains_key(&option1) { - (option1, u128_amount).into() - } else if payment.fungible.contains_key(&option2) { - (option2, u128_amount).into() - } else { - (Concrete(MultiLocation::default()), u128_amount).into() - }; - - let unused = payment - .checked_sub(required) - .map_err(|_| XcmError::TooExpensive)?; - self.0 = self.0.saturating_add(weight); - self.1 = self.1.saturating_add(amount); - Ok(unused) - } - - fn refund_weight(&mut self, weight: Weight) -> Option { - let weight = weight.min(self.0); - let amount = WeightToFee::weight_to_fee(&weight); - self.0 -= weight; - self.1 = self.1.saturating_sub(amount); - let amount: u128 = amount.saturated_into(); - if amount > 0 { - Some((AssetId::get(), amount).into()) - } else { - None - } + Ok(payment) } } impl< @@ -255,9 +230,9 @@ pub struct NonZeroIssuance(PhantomData<(AccountId, For #[cfg(feature = "foreign-assets")] impl Contains<>::AssetId> -for NonZeroIssuance - where - ForeingAssets: fungibles::Inspect, + for NonZeroIssuance +where + ForeingAssets: fungibles::Inspect, { fn contains(id: &>::AssetId) -> bool { !ForeingAssets::total_issuance(*id).is_zero() @@ -268,11 +243,11 @@ for NonZeroIssuance pub struct AsInnerId(PhantomData<(AssetId, ConvertAssetId)>); #[cfg(feature = "foreign-assets")] impl> -ConvertXcm for AsInnerId - where - AssetId: Borrow, - AssetId: TryAsForeing, - AssetIds: Borrow, + ConvertXcm for AsInnerId +where + AssetId: Borrow, + AssetId: TryAsForeing, + AssetIds: Borrow, { fn convert_ref(id: impl Borrow) -> Result { let id = id.borrow(); @@ -377,10 +352,13 @@ pub type IsReserve = AllAsset; pub type IsReserve = NativeAsset; #[cfg(feature = "foreign-assets")] -type Trader = - UsingAnyCurrencyComponents< - pallet_configuration::WeightToFee, - RelayLocation, AccountId, Balances, ()>; +type Trader = FreeForAll< + pallet_configuration::WeightToFee, + RelayLocation, + AccountId, + Balances, + (), +>; #[cfg(not(feature = "foreign-assets"))] type Trader = UsingOnlySelfCurrencyComponents< pallet_configuration::WeightToFee, @@ -451,4 +429,3 @@ impl cumulus_pallet_dmp_queue::Config for Runtime { type XcmExecutor = XcmExecutor>; type ExecuteOverweightOrigin = frame_system::EnsureRoot; } - diff --git a/runtime/opal/src/xcm_config.rs b/runtime/opal/src/xcm_config.rs index 0d008a02bb..cbc3ca347e 100644 --- a/runtime/opal/src/xcm_config.rs +++ b/runtime/opal/src/xcm_config.rs @@ -32,9 +32,9 @@ use xcm::{ v1::{BodyId, Junction::*, Junctions::*, MultiLocation, NetworkId}, }; use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, - EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter, LocationInverter, ParentAsSuperuser, - ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, EnsureXcmOrigin, + FixedWeightBounds, FungiblesAdapter, LocationInverter, ParentAsSuperuser, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ConvertedConcreteAssetId, }; @@ -49,8 +49,8 @@ use up_common::{ }; use crate::{ - Balances, Call, DmpQueue, Event, ForeingAssets, Origin, ParachainInfo, - ParachainSystem, PolkadotXcm, Runtime, XcmpQueue, + Balances, Call, DmpQueue, Event, ForeingAssets, Origin, ParachainInfo, ParachainSystem, + PolkadotXcm, Runtime, XcmpQueue, }; use crate::runtime_common::config::substrate::{TreasuryModuleId, MaxLocks, MaxReserves}; use crate::runtime_common::config::pallets::TreasuryAccountId; @@ -58,8 +58,8 @@ use crate::runtime_common::config::xcm::*; use crate::*; use pallet_foreing_assets::{ - AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, - UsingAnyCurrencyComponents, TryAsForeing, ForeignAssetId, + AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, FreeForAll, + TryAsForeing, ForeignAssetId, }; // Signed version of balance @@ -330,7 +330,7 @@ impl Config for XcmConfig { type Barrier = Barrier; type Weigher = FixedWeightBounds; type Trader = - UsingAnyCurrencyComponents, RelayLocation, AccountId, Balances, ()>; + FreeForAll, RelayLocation, AccountId, Balances, ()>; type ResponseHandler = (); // Don't handle responses for now. type SubscriptionService = PolkadotXcm; type AssetTrap = PolkadotXcm; diff --git a/runtime/quartz/src/xcm_config.rs b/runtime/quartz/src/xcm_config.rs index 791390da34..3da2d875e8 100644 --- a/runtime/quartz/src/xcm_config.rs +++ b/runtime/quartz/src/xcm_config.rs @@ -50,7 +50,7 @@ use up_common::{ }; use pallet_foreing_assets::{ AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, - UsingAnyCurrencyComponents, TryAsForeing, ForeignAssetId, + FreeForAll, TryAsForeing, ForeignAssetId, }; use crate::{ Balances, Call, DmpQueue, Event, Origin, ParachainInfo, diff --git a/runtime/unique/src/xcm_config.rs b/runtime/unique/src/xcm_config.rs index ea87b5ca43..c29ecab3f5 100644 --- a/runtime/unique/src/xcm_config.rs +++ b/runtime/unique/src/xcm_config.rs @@ -50,7 +50,7 @@ use up_common::{ }; use pallet_foreing_assets::{ AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, - UsingAnyCurrencyComponents, TryAsForeing, ForeignAssetId, + FreeForAll, TryAsForeing, ForeignAssetId, }; use crate::{ Balances, Call, DmpQueue, Event, Origin, ParachainInfo, From 2ea7263a8f0c46b633278e9fc9cc4e9021e79888 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 29 Aug 2022 21:00:35 +0700 Subject: [PATCH 0607/1274] add 5 validators --- .docker/Dockerfile-xcm | 20 +++++++- .docker/docker-compose.tmp-xcm-quartz.yml | 6 ++- .docker/docker-compose.tmp-xcm-unique.yml | 7 ++- .docker/xcm-config/5validators.jsonnet | 50 +++++++++++++++++++ .../xcm-config/launch-config-xcm-quartz.json | 5 ++ .../xcm-config/launch-config-xcm-unique.json | 5 ++ 6 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 .docker/xcm-config/5validators.jsonnet diff --git a/.docker/Dockerfile-xcm b/.docker/Dockerfile-xcm index 731fc75408..b3a3e381bc 100644 --- a/.docker/Dockerfile-xcm +++ b/.docker/Dockerfile-xcm @@ -95,6 +95,15 @@ RUN git clone -b $CUMULUS_BUILD_BRANCH --depth 1 https://github.com/paritytech/c cd cumulus && \ cargo build --release --locked -p polkadot-parachain +# ===== BUILD CHAINQL ===== +FROM rust-builder as builder-chainql + +RUN mkdir chainql +WORKDIR /chainql + +RUN git clone -b v0.1.0 --depth 1 https://github.com/CertainLach/chainql.git . && \ + cargo build --release + # ===== RUN ====== FROM ubuntu:20.04 @@ -103,7 +112,7 @@ ARG POLKADOT_LAUNCH_BRANCH= ENV POLKADOT_LAUNCH_BRANCH $POLKADOT_LAUNCH_BRANCH RUN apt-get -y update && \ - apt-get -y install curl git && \ + apt-get -y install curl git jsonnet && \ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ @@ -123,8 +132,15 @@ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot COPY --from=builder-moonbeam /unique_parachain/moonbeam/target/release/moonbeam /moonbeam/target/release/ COPY --from=builder-cumulus /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus COPY --from=builder-acala /unique_parachain/Acala/target/production/acala /acala/target/release/ +COPY --from=builder-chainql /chainql/target/release/chainql /chainql/target/release/ + +EXPOSE 9844 +EXPOSE 9944 +EXPOSE 9946 +EXPOSE 9947 +EXPOSE 9948 -CMD export NVM_DIR="$HOME/.nvm" && \ +CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ yarn start launch-config.json diff --git a/.docker/docker-compose.tmp-xcm-quartz.yml b/.docker/docker-compose.tmp-xcm-quartz.yml index ddaf0ba8f9..ee1eedb95e 100644 --- a/.docker/docker-compose.tmp-xcm-quartz.yml +++ b/.docker/docker-compose.tmp-xcm-quartz.yml @@ -18,4 +18,8 @@ services: - type: bind source: ./xcm-config/launch-config-xcm-quartz.json target: /polkadot-launch/launch-config.json - read_only: true + read_only: true + - type: bind + source: ./xcm-config/5validators.jsonnet + target: /polkadot-launch/5validators.jsonnet + read_only: true diff --git a/.docker/docker-compose.tmp-xcm-unique.yml b/.docker/docker-compose.tmp-xcm-unique.yml index 0218d10d38..5533f04c20 100644 --- a/.docker/docker-compose.tmp-xcm-unique.yml +++ b/.docker/docker-compose.tmp-xcm-unique.yml @@ -19,4 +19,9 @@ services: - type: bind source: ./xcm-config/launch-config-xcm-unique.json target: /polkadot-launch/launch-config.json - read_only: true + read_only: true + - type: bind + source: ./xcm-config/5validators.jsonnet + target: /polkadot-launch/5validators.jsonnet + read_only: true + diff --git a/.docker/xcm-config/5validators.jsonnet b/.docker/xcm-config/5validators.jsonnet new file mode 100644 index 0000000000..582cc9d3c5 --- /dev/null +++ b/.docker/xcm-config/5validators.jsonnet @@ -0,0 +1,50 @@ + +function(spec) + spec { + genesis+: { + runtime+: { + staking+: { + validatorCount: 5, + invulnerables: [ + '5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY', + '5HpG9w8EBLe5XCrbczpwq5TSXvedjrBGCwqxK1iQ7qUsSWFc', + '5Ck5SLSHYac6WFt5UZRSsdJjwmpSZq85fd5TRNAdZQVzEAPT', + '5HKPmK9GYtE1PSLsS1qiYU9xQ9Si1NcEhdeCq9sw5bqu4ns8', + '5FCfAonRZgTFrTd9HREEyeJjDpT397KMzizE6T3DvebLFE7n', + ], + stakers: [ + [ + '5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY', + '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY', + 100000000000000, + 'Validator', + ], + [ + '5HpG9w8EBLe5XCrbczpwq5TSXvedjrBGCwqxK1iQ7qUsSWFc', + '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty', + 100000000000000, + 'Validator', + ], + [ + '5Ck5SLSHYac6WFt5UZRSsdJjwmpSZq85fd5TRNAdZQVzEAPT', + '5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y', + 100000000000000, + 'Validator', + ], + [ + '5HKPmK9GYtE1PSLsS1qiYU9xQ9Si1NcEhdeCq9sw5bqu4ns8', + '5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy', + 100000000000000, + 'Validator', + ], + [ + '5FCfAonRZgTFrTd9HREEyeJjDpT397KMzizE6T3DvebLFE7n', + '5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw', + 100000000000000, + 'Validator', + ], + ], + }, + }, + }, + } diff --git a/.docker/xcm-config/launch-config-xcm-quartz.json b/.docker/xcm-config/launch-config-xcm-quartz.json index e8368298fb..9c46271393 100644 --- a/.docker/xcm-config/launch-config-xcm-quartz.json +++ b/.docker/xcm-config/launch-config-xcm-quartz.json @@ -2,6 +2,11 @@ "relaychain": { "bin": "/polkadot/target/release/polkadot", "chain": "westend-local", + "chainInitializer": [ + "chainql", + "--tla-code=spec=import '${spec}'", + "5validators.jsonnet" + ], "nodes": [ { "name": "alice", diff --git a/.docker/xcm-config/launch-config-xcm-unique.json b/.docker/xcm-config/launch-config-xcm-unique.json index 17e5780fbd..fcc465a031 100644 --- a/.docker/xcm-config/launch-config-xcm-unique.json +++ b/.docker/xcm-config/launch-config-xcm-unique.json @@ -2,6 +2,11 @@ "relaychain": { "bin": "/polkadot/target/release/polkadot", "chain": "westend-local", + "chainInitializer": [ + "chainql", + "--tla-code=spec=import '${spec}'", + "5validators.jsonnet" + ], "nodes": [ { "name": "alice", From 78a995207d2e43dd4f50d742fe79fccf53497b83 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 29 Aug 2022 14:19:27 +0000 Subject: [PATCH 0608/1274] fix: After rebase --- crates/evm-coder/src/abi.rs | 46 ++++++--- crates/evm-coder/src/solidity.rs | 5 +- pallets/fungible/src/erc.rs | 4 +- pallets/fungible/src/stubs/UniqueFungible.raw | Bin 2994 -> 3305 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 97 ++++++++---------- tests/src/eth/api/UniqueFungible.sol | 81 +++++++++------ tests/src/eth/base.test.ts | 2 +- tests/src/eth/fungibleAbi.json | 54 +++++----- 8 files changed, 151 insertions(+), 138 deletions(-) diff --git a/crates/evm-coder/src/abi.rs b/crates/evm-coder/src/abi.rs index a0aa4eb424..f66318993c 100644 --- a/crates/evm-coder/src/abi.rs +++ b/crates/evm-coder/src/abi.rs @@ -28,10 +28,13 @@ use crate::{ types::{string, self}, }; use crate::execution::Result; -use crate::solidity::SolidityTypeName; const ABI_ALIGNMENT: usize = 32; +trait TypeHelper { + fn is_dynamic() -> bool; +} + /// View into RLP data, which provides method to read typed items from it #[derive(Clone)] pub struct AbiReader<'i> { @@ -330,11 +333,18 @@ impl AbiWriter { pub trait AbiRead { /// Read item from current position, advanding decoder fn abi_read(&mut self) -> Result; + + /// Size for type aligned to [`ABI_ALIGNMENT`]. fn size() -> usize; } macro_rules! impl_abi_readable { - ($ty:ty, $method:ident) => { + ($ty:ty, $method:ident, $dynamic:literal) => { + impl TypeHelper<$ty> for $ty { + fn is_dynamic() -> bool { + $dynamic + } + } impl AbiRead<$ty> for AbiReader<'_> { fn abi_read(&mut self) -> Result<$ty> { self.$method() @@ -347,16 +357,16 @@ macro_rules! impl_abi_readable { }; } -impl_abi_readable!(u8, uint8); -impl_abi_readable!(u32, uint32); -impl_abi_readable!(u64, uint64); -impl_abi_readable!(u128, uint128); -impl_abi_readable!(U256, uint256); -impl_abi_readable!([u8; 4], bytes4); -impl_abi_readable!(H160, address); -impl_abi_readable!(Vec, bytes); -impl_abi_readable!(bool, bool); -impl_abi_readable!(string, string); +impl_abi_readable!(u8, uint8, false); +impl_abi_readable!(u32, uint32, false); +impl_abi_readable!(u64, uint64, false); +impl_abi_readable!(u128, uint128, false); +impl_abi_readable!(U256, uint256, false); +impl_abi_readable!([u8; 4], bytes4, false); +impl_abi_readable!(H160, address, false); +impl_abi_readable!(Vec, bytes, true); +impl_abi_readable!(bool, bool, true); +impl_abi_readable!(string, string, true); mod sealed { /// Not all types can be placed in vec, i.e `Vec` is restricted, `bytes` should be used instead @@ -389,16 +399,24 @@ where macro_rules! impl_tuples { ($($ident:ident)+) => { + impl<$($ident: TypeHelper<$ident>,)+> TypeHelper<($($ident,)+)> for ($($ident,)+) { + fn is_dynamic() -> bool { + false + $( + || <$ident>::is_dynamic() + )* + } + } impl<$($ident),+> sealed::CanBePlacedInVec for ($($ident,)+) {} impl<$($ident),+> AbiRead<($($ident,)+)> for AbiReader<'_> where $( Self: AbiRead<$ident>, )+ - ($($ident,)+): SolidityTypeName, + ($($ident,)+): TypeHelper<($($ident,)+)>, { fn abi_read(&mut self) -> Result<($($ident,)+)> { - let size = if <($($ident,)+)>::is_simple() { Some(>::size()) } else { None }; + let size = if !<($($ident,)+)>::is_dynamic() { Some(>::size()) } else { None }; let mut subresult = self.subresult(size)?; Ok(( $(>::abi_read(&mut subresult)?,)+ diff --git a/crates/evm-coder/src/solidity.rs b/crates/evm-coder/src/solidity.rs index 450f6aed72..d0cb5c80e2 100644 --- a/crates/evm-coder/src/solidity.rs +++ b/crates/evm-coder/src/solidity.rs @@ -192,10 +192,7 @@ macro_rules! impl_tuples { write!(writer, "{}", tc.collect_tuple::()) } fn is_simple() -> bool { - true - $( - && <$ident>::is_simple() - )* + false } #[allow(unused_assignments)] fn solidity_default(writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result { diff --git a/pallets/fungible/src/erc.rs b/pallets/fungible/src/erc.rs index 11d21448c0..92e970c3f7 100644 --- a/pallets/fungible/src/erc.rs +++ b/pallets/fungible/src/erc.rs @@ -129,7 +129,7 @@ impl FungibleHandle { } } -#[solidity_interface(name = "ERC20Mintable")] +#[solidity_interface(name = ERC20Mintable)] impl FungibleHandle { /// Mint tokens for `to` account. /// @param to account that will receive minted tokens @@ -148,7 +148,7 @@ impl FungibleHandle { } } -#[solidity_interface(name = "ERC20UniqueExtensions")] +#[solidity_interface(name = ERC20UniqueExtensions)] impl FungibleHandle { /// Burn tokens from account /// @dev Function that burns an `amount` of the tokens of a given account, diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index 88f4d00f5c11ce6e28f4ca52f5a0d32e5a26ab5e..ebe29b3712a96cbcc6e60406f8f4425e351a48aa 100644 GIT binary patch literal 3305 zcmaJ@d2Afj9iF$lGkee$+p(9Jwd5g*P%jFEE|f#<8fY6S9J5<{2X#Vu&zs;Fh?5eF z7E+oy*9nMrcI{lHl_Dx7h5o_O2w4=hO%D)mA*%8RkvN*F4Hc;>ia?MyHSYI&GrL|} z5nk>3d%yd72S3S66@D?d9j6kGDxdfrKX^4~K+3An#qaA?%lM+*2XvXq6?@(?Miut6 zs#UvX-HvbblLf9+_z+K3_!_RvTbw!0KKfN^!eVO+0w5$_q(upua^E`x2yk@VxH>x^*5Ao42&Y#8*d zT27fWd`g9+BTb(%A#euYtEv{#=yLFr^@l;YxoY|Nw;N&THXro5kx4JO>ky0&&+Jmu z2s~D{xYEy)^{_C|pXV$H3l{_<&^r!2C1?fRU(YuzS4PI}H+R)p*&Uhj*$nF1V4;sF z*=>k2a4B}S-<%3qS=!wd7WkPwOgkf#fMGzxDX?$^xrp=5Lsi)^W0iLYZ-xfKLu*C-U@;8!+HZ)6UmEz3OE3`?Vx)(;9Y?CtuB2bHgo@<#zMeDE!|7gU%3;t zc?nWO-t9L5J`zLdt_3tN(>@1CnQWX|y%(?qIOgB_R%~%|<5LQ#w{%(r>wQRFe%+}t zuo8gR8E-!TNP(5s{qH}3WU+Mg{Qk~px-a=^y;~%@z#<6NO@J$&EEQvCEAyXx1Ms(? zUU=-15x^6Gt7q>e>RWLLqwEJhmZZuSUOEgY0M&<%27tQ(wfQ%bfK_kvJey zw2w<=k+2(~P=|=vGNRs1tCk;i53T0fR;5j-b!uogcCOM|r+)f5tdhBwK3@nM`A!>m z$Rrm1W!83TXVx!SP0*?p=TgaRKk??`LPSxwa>!10>Mi3v4PNpIk=jB9vCD3B5*;ig zWtdGIB~6Dl!)ArWSsxI|*QwajD%Ek(ZFYf-eb`Qx;Y@?2B`MP}S04RZ;bnfRfI_60 zNPQMP$bCjOggS-OS@}3A{&7sCV7tt%U|jH{yQ~r}dV{MFClxs*e|FKvko1bw6VYTw zr@I0zKiShKQb!}QNX@w-^`oja-IRwlqH9U~Es}7G2#Mj6N%lK=GB_8}aX*x8AF;^e zU#J(ExGVzZuyWmF2#pC<#rY}?))_;*e6SyfI?D$Pmxj^A7iG~=Cj~~i?lE7a&Qj#k zA!-}>ixWW7yyOKGy!!n(cy-DX>TuPX;retq&5F~@a!?Ojx?G+Yg(?~1#SHuJ27x2 zl(>nTGZfmhRcqf~x*PFF8Q4gI`*kvwE<~P0dW|n_G!2nn%k=;QfethbcxA=VXwrvt z+o@8V=?x~nvO*%gl@I!|*eH}tE;L-H;&~n;NiXu_x->dhQ5Ag;bJiYYmxirJq<=`orpTO)+Uiz_F2^Br8oPE+ zG!5-E+o5JZANgE1)Y%*246?TdZau0l&LC=Lu|^wFrk)*-13p&;v+*;;S(kMFmyu2-P>+wMM@=e1EJiO0EZgcy29#nYrIuGWpsXFt}B%L{UY~})! z9>yZ~s3~&Tt$YD*UAN-*_2Eo$*_O18SZcs8^$`zBF$G7XXtrL^?irS{nwZ?QQ6HbsC&c9V HeVhIdZ8(6r literal 2994 zcmaJ@32YQq7@pU?L%=Syt7U6C5j7D-L0yzUWD6c33bQNSQAWvoU7!@DT$QLrnR6>b zbaq=&JPV}bb*@#Va+Z0M%CN;SxllB)h<#N5ANf)V9()%@q5x1Zf=g#U{MGvQ`l&8%! zoTukfsb8bSFdAJmr8DVPm995aWksX1S!;xtv`!srb57MpDZ5HRqfKTKG4>$_NKo03 zX_G@}q|qQ$F4aQxysGF>6N@H+W5eLfAF8I&LJ48gYaps9{3&QgjuQN3(;`t&um!Q_N%N`R9A$Gn`)0B!|5D>d>U;ERCc`c`xJp6{lWJZSs+WZ=@LRNE&SbPbK;WIGF*_>Nn&xe_C ztd~RX38BY@tj1#Di-Z!ZSypygK@O4b-XatZkVhGvQUYIXY&&1 zInz5=wxvUYW(6li#UK^8k|%zi77O+9@(QoKa)V*x-*IOLs>$*b3Z70&nIBrY)@#!r z(<5mVB1~8~imE3@h!*hP;FOjAPmBJa5Gm*;G4mJ@{F6(l#4@%2j%hfjE=FW zW8soFfZjPR!O9Meu4myVy=4}D)@0$e1+Awdj$W_}G~V$vj0`9dd@Mo@Mv6Op)?3F> zpVMt{@s9Fvzlw9;AqL5nECOoC9TiiA!xACjOPd;SQj?TJ@BvUNcu*D@b&}we$`-L% z_)E@Q1VnAUczyy%nr1DBlaDO$$w!J7i%cwNy;SaTdq}2dSPl_uNS0iYJCP{0OTx|5 zftwd>;ijUnNFS9QBHqdh&Dtd6Di!|spC8R^4qrcl+)@T<8}NTd(ll$&tY^`fiibt` zCnuZtdr;M~@O6t`0F4WT28&LkO}21_-OM6~3Yx2!M&7b4!Zj6-u4(dGUBL@$TPSR` zb0)9uXcoPznzUtQL^@G^Pz=^D`k3!2Q>CKw4|sH^Zy9~NWOWl3ZNpqB+(V|Ucp9I3 z8j1y)264u)=+VIDH^)RY8)k^c8?02s-Jm*Av7~RD88(cu@ty#qHZW|)sy&a*_2a}; zoM{+Xv`5y_pVL!_-RZk3Va7^cL1G&M_XfXD#2#1ih>Ghpk}fMO_96-?>W$k=8FNU= zwn5wtHrL+c8TUA(N3$GU17gQu|BWMN#LV+`*TH=&wilzjnO_C)tL9$iANRi}<{)8C zCVrluR(z6Umb{WqjbE&boh8ebZuS1pC`ygu-}(Ka#CyqUdxgYaE9 zI16!qI}hjeR$%?nP+lzlm1r?voivG{c}aeei=>Ex+*+jRQ1?h>)Y_r<`CHqoYvJ73~nl_j1-P6N2f znR&au9!)jLX2n~THgXGB#yM5um%PMw)tGPdqZ3WrfU|N#L9@ss{OZ}eXFtcXTdZB)50S9jvo`?c#p`Ee8qg diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index 1df0b0946f..cb99e1917a 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -3,13 +3,7 @@ pragma solidity >=0.8.0 <0.9.0; -// Anonymous struct -struct Tuple0 { - address field_0; - uint256 field_1; -} - -// Common stubs holder +/// @dev common stubs holder contract Dummy { uint8 dummy; string stub_error = "this contract is implemented in native"; @@ -27,49 +21,8 @@ contract ERC165 is Dummy { } } -// Inline -contract ERC20Events { - event Transfer(address indexed from, address indexed to, uint256 value); - event Approval( - address indexed owner, - address indexed spender, - uint256 value - ); -} - -// Selector: 40c10f19 -contract ERC20Mintable is Dummy, ERC165 { - // Selector: mint(address,uint256) 40c10f19 - function mint(address to, uint256 amount) public returns (bool) { - require(false, stub_error); - to; - amount; - dummy = 0; - return false; - } -} - -// Selector: 63034ac5 -contract ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) public returns (bool) { - require(false, stub_error); - from; - amount; - dummy = 0; - return false; - } - - // Selector: mintBulk((address,uint256)[]) 1acf2d55 - function mintBulk(Tuple0[] memory amounts) public returns (bool) { - require(false, stub_error); - amounts; - dummy = 0; - return false; - } -} - -// Selector: 6cf113cd +/// @title A contract that allows you to work with collections. +/// @dev the ERC-165 identifier for this interface is 0xe54be640 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -397,19 +350,51 @@ contract Collection is Dummy, ERC165 { } } +/// @dev the ERC-165 identifier for this interface is 0x63034ac5 +contract ERC20UniqueExtensions is Dummy, ERC165 { + /// Burn tokens from account + /// @dev Function that burns an `amount` of the tokens of a given account, + /// deducting from the sender's allowance for said account. + /// @param from The account whose tokens will be burnt. + /// @param amount The amount that will be burnt. + /// @dev EVM selector for this function is: 0x79cc6790, + /// or in textual repr: burnFrom(address,uint256) + function burnFrom(address from, uint256 amount) public returns (bool) { + require(false, stub_error); + from; + amount; + dummy = 0; + return false; + } + + /// Mint tokens for multiple accounts. + /// @param amounts array of pairs of account address and amount + /// @dev EVM selector for this function is: 0x1acf2d55, + /// or in textual repr: mintBulk((address,uint256)[]) + function mintBulk(Tuple6[] memory amounts) public returns (bool) { + require(false, stub_error); + amounts; + dummy = 0; + return false; + } +} + /// @dev anonymous struct struct Tuple6 { address field_0; uint256 field_1; } -/// @dev the ERC-165 identifier for this interface is 0x79cc6790 -contract ERC20UniqueExtensions is Dummy, ERC165 { - /// @dev EVM selector for this function is: 0x79cc6790, - /// or in textual repr: burnFrom(address,uint256) - function burnFrom(address from, uint256 amount) public returns (bool) { +/// @dev the ERC-165 identifier for this interface is 0x40c10f19 +contract ERC20Mintable is Dummy, ERC165 { + /// Mint tokens for `to` account. + /// @param to account that will receive minted tokens + /// @param amount amount of tokens to mint + /// @dev EVM selector for this function is: 0x40c10f19, + /// or in textual repr: mint(address,uint256) + function mint(address to, uint256 amount) public returns (bool) { require(false, stub_error); - from; + to; amount; dummy = 0; return false; diff --git a/tests/src/eth/api/UniqueFungible.sol b/tests/src/eth/api/UniqueFungible.sol index fdb7391f16..65a4610b76 100644 --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -3,13 +3,7 @@ pragma solidity >=0.8.0 <0.9.0; -// Anonymous struct -struct Tuple0 { - address field_0; - uint256 field_1; -} - -// Common stubs holder +/// @dev common stubs holder interface Dummy { } @@ -18,32 +12,8 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } -// Inline -interface ERC20Events { - event Transfer(address indexed from, address indexed to, uint256 value); - event Approval( - address indexed owner, - address indexed spender, - uint256 value - ); -} - -// Selector: 40c10f19 -interface ERC20Mintable is Dummy, ERC165 { - // Selector: mint(address,uint256) 40c10f19 - function mint(address to, uint256 amount) external returns (bool); -} - -// Selector: 63034ac5 -interface ERC20UniqueExtensions is Dummy, ERC165 { - // Selector: burnFrom(address,uint256) 79cc6790 - function burnFrom(address from, uint256 amount) external returns (bool); - - // Selector: mintBulk((address,uint256)[]) 1acf2d55 - function mintBulk(Tuple0[] memory amounts) external returns (bool); -} - -// Selector: 6cf113cd +/// @title A contract that allows you to work with collections. +/// @dev the ERC-165 identifier for this interface is 0xe54be640 interface Collection is Dummy, ERC165 { /// Set collection property. /// @@ -237,13 +207,56 @@ interface Collection is Dummy, ERC165 { /// @dev EVM selector for this function is: 0xd34b55b8, /// or in textual repr: uniqueCollectionType() function uniqueCollectionType() external returns (string memory); + + /// Changes collection owner to another account + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner account + /// @dev EVM selector for this function is: 0x13af4035, + /// or in textual repr: setOwner(address) + function setOwner(address newOwner) external; + + /// Changes collection owner to another substrate account + /// + /// @dev Owner can be changed only by current owner + /// @param newOwner new owner substrate account + /// @dev EVM selector for this function is: 0xb212138f, + /// or in textual repr: setOwnerSubstrate(uint256) + function setOwnerSubstrate(uint256 newOwner) external; } -/// @dev the ERC-165 identifier for this interface is 0x79cc6790 +/// @dev the ERC-165 identifier for this interface is 0x63034ac5 interface ERC20UniqueExtensions is Dummy, ERC165 { + /// Burn tokens from account + /// @dev Function that burns an `amount` of the tokens of a given account, + /// deducting from the sender's allowance for said account. + /// @param from The account whose tokens will be burnt. + /// @param amount The amount that will be burnt. /// @dev EVM selector for this function is: 0x79cc6790, /// or in textual repr: burnFrom(address,uint256) function burnFrom(address from, uint256 amount) external returns (bool); + + /// Mint tokens for multiple accounts. + /// @param amounts array of pairs of account address and amount + /// @dev EVM selector for this function is: 0x1acf2d55, + /// or in textual repr: mintBulk((address,uint256)[]) + function mintBulk(Tuple6[] memory amounts) external returns (bool); +} + +/// @dev anonymous struct +struct Tuple6 { + address field_0; + uint256 field_1; +} + +/// @dev the ERC-165 identifier for this interface is 0x40c10f19 +interface ERC20Mintable is Dummy, ERC165 { + /// Mint tokens for `to` account. + /// @param to account that will receive minted tokens + /// @param amount amount of tokens to mint + /// @dev EVM selector for this function is: 0x40c10f19, + /// or in textual repr: mint(address,uint256) + function mint(address to, uint256 amount) external returns (bool); } /// @dev inlined interface diff --git a/tests/src/eth/base.test.ts b/tests/src/eth/base.test.ts index d7a4a96f26..606eab642d 100644 --- a/tests/src/eth/base.test.ts +++ b/tests/src/eth/base.test.ts @@ -94,7 +94,7 @@ describe('ERC165 tests', async () => { }); itWeb3('ERC721 support', async ({web3}) => { - expect(await contract(web3).methods.supportsInterface('0x58800161').call()).to.be.true; + expect(await contract(web3).methods.supportsInterface('0x780e9d63').call()).to.be.true; }); itWeb3('ERC721Metadata support', async ({web3}) => { diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index 07e4ca754b..a3ee287023 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -150,33 +150,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "mint", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { "internalType": "address", "name": "field_0", "type": "address" }, - { "internalType": "uint256", "name": "field_1", "type": "uint256" } - ], - "internalType": "struct Tuple0[]", - "name": "amounts", - "type": "tuple[]" - } - ], - "name": "mintBulk", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "getCollectionSponsor", @@ -219,6 +192,33 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "mint", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "field_0", "type": "address" }, + { "internalType": "uint256", "name": "field_1", "type": "uint256" } + ], + "internalType": "struct Tuple6[]", + "name": "amounts", + "type": "tuple[]" + } + ], + "name": "mintBulk", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "name", From 67a4ea452077705d4b170254cea08b6f31af23f8 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 29 Aug 2022 15:11:55 +0000 Subject: [PATCH 0609/1274] fix: Tuple size calculation. Some PR fixes. --- Cargo.lock | 4 ++-- crates/evm-coder/Cargo.toml | 2 +- crates/evm-coder/src/abi.rs | 12 +++++++++++- pallets/fungible/Cargo.toml | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c414a937bd..4feb49e478 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2169,7 +2169,7 @@ dependencies = [ [[package]] name = "evm-coder" -version = "0.1.2" +version = "0.1.3" dependencies = [ "ethereum", "evm-coder-procedural", @@ -5749,7 +5749,7 @@ dependencies = [ [[package]] name = "pallet-fungible" -version = "0.1.4" +version = "0.1.5" dependencies = [ "ethereum", "evm-coder", diff --git a/crates/evm-coder/Cargo.toml b/crates/evm-coder/Cargo.toml index b8db5c369e..98cccf41c8 100644 --- a/crates/evm-coder/Cargo.toml +++ b/crates/evm-coder/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "evm-coder" -version = "0.1.2" +version = "0.1.3" license = "GPLv3" edition = "2021" diff --git a/crates/evm-coder/src/abi.rs b/crates/evm-coder/src/abi.rs index f66318993c..ff00ce0190 100644 --- a/crates/evm-coder/src/abi.rs +++ b/crates/evm-coder/src/abi.rs @@ -350,6 +350,15 @@ macro_rules! impl_abi_readable { self.$method() } + fn size() -> usize { + ABI_ALIGNMENT + } + } + impl AbiRead<$ty> for $ty { + fn abi_read(&mut self) -> Result<$ty> { + todo!("Refactor requered.") + } + fn size() -> usize { ABI_ALIGNMENT } @@ -412,6 +421,7 @@ macro_rules! impl_tuples { where $( Self: AbiRead<$ident>, + $ident: AbiRead<$ident>, )+ ($($ident,)+): TypeHelper<($($ident,)+)>, { @@ -424,7 +434,7 @@ macro_rules! impl_tuples { } fn size() -> usize { - 0 $(+ {let _ : $ident; ABI_ALIGNMENT})+ + 0 $(+ <$ident>::size())+ } } #[allow(non_snake_case)] diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index dca9ee8c71..0a0176cd70 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-fungible" -version = "0.1.4" +version = "0.1.5" license = "GPLv3" edition = "2021" From 547bb74cad58ef0d1b2401c1f22a6e98e1fba1ce Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 30 Aug 2022 01:30:38 +0700 Subject: [PATCH 0610/1274] add jinja for dockerfile --- .docker/Dockerfile-xcm | 2 +- .docker/Dockerfile-xcm-2 | 150 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 .docker/Dockerfile-xcm-2 diff --git a/.docker/Dockerfile-xcm b/.docker/Dockerfile-xcm index b3a3e381bc..c17a9c3ee8 100644 --- a/.docker/Dockerfile-xcm +++ b/.docker/Dockerfile-xcm @@ -93,7 +93,7 @@ WORKDIR /unique_parachain RUN git clone -b $CUMULUS_BUILD_BRANCH --depth 1 https://github.com/paritytech/cumulus.git && \ cd cumulus && \ - cargo build --release --locked -p polkadot-parachain + cargo build --release # ===== BUILD CHAINQL ===== FROM rust-builder as builder-chainql diff --git a/.docker/Dockerfile-xcm-2 b/.docker/Dockerfile-xcm-2 new file mode 100644 index 0000000000..b93c04337a --- /dev/null +++ b/.docker/Dockerfile-xcm-2 @@ -0,0 +1,150 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +#ARG RUST_TOOLCHAIN= + +#ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install {{ RUST_TOOLCHAIN }} && \ + rustup default {{ RUST_TOOLCHAIN }} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + + +# ===== BUILD ====== +FROM rust-builder as builder-unique + +ARG PROFILE=release +#ARG FEATURE= +#ARG BRANCH= + +WORKDIR /unique_parachain + +COPY ./xcm-config/launch-config-xcm-{{ NETWORK }}.json ./launch-config-xcm-{{ NETWORK }}.json +COPY ./xcm-config/5validators.jsonnet ./5validators.jsonnet + +RUN git clone -b {{ BRANCH }} https://github.com/UniqueNetwork/unique-chain.git && \ + cd unique-chain && \ + cargo build --features={{ FEATURE }} --$PROFILE + +# ===== BUILD POLKADOT ===== +FROM rust-builder as builder-polkadot + +#ARG POLKADOT_BUILD_BRANCH= +#ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH + + +WORKDIR /unique_parachain + +RUN git clone -b {{ POLKADOT_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/polkadot.git && \ + cd polkadot && \ + cargo build --release + +# ===== BUILD ACALA ===== +FROM rust-builder as builder-acala + +#ARG ACALA_BUILD_BRANCH= +#ENV ACALA_BUILD_BRANCH $ACALA_BUILD_BRANCH + + +WORKDIR /unique_parachain + +RUN git clone -b {{ ACALA_BUILD_BRANCH }} --depth 1 https://github.com/AcalaNetwork/Acala.git && \ + cd Acala && \ + make init && \ + make build-release + +# ===== BUILD MOONBEAM ===== +FROM rust-builder as builder-moonbeam + +#ARG MOONBEAM_BUILD_BRANCH= +#ENV MOONBEAM_BUILD_BRANCH $MOONBEAM_BUILD_BRANCH + + +WORKDIR /unique_parachain + +RUN git clone -b {{ MOONBEAM_BUILD_BRANCH }} --depth 1 https://github.com/PureStake/moonbeam.git && \ + cd moonbeam && \ + cargo build --release + +# ===== BUILD CUMULUS ===== +FROM rust-builder as builder-cumulus + +#ARG CUMULUS_BUILD_BRANCH= +#ENV CUMULUS_BUILD_BRANCH $CUMULUS_BUILD_BRANCH + + +WORKDIR /unique_parachain + +RUN git clone -b {{ CUMULUS_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/cumulus.git && \ + cd cumulus && \ + cargo build --release + +# ===== BUILD CHAINQL ===== +FROM rust-builder as builder-chainql + +RUN mkdir chainql +WORKDIR /chainql + +RUN git clone -b v0.1.0 --depth 1 https://github.com/CertainLach/chainql.git . && \ + cargo build --release + +# ===== RUN ====== + +FROM ubuntu:20.04 + +#ARG POLKADOT_LAUNCH_BRANCH= +#ENV POLKADOT_LAUNCH_BRANCH $POLKADOT_LAUNCH_BRANCH + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b {{ POLKADOT_LAUNCH_BRANCH }} + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn install + +COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-unique /unique_parachain/launch-config-xcm-{{ NETWORK }}.json /polkadot-launch/ +COPY --from=builder-unique /unique_parachain/5validators.jsonnet /polkadot-launch/5validators.jsonnet +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=builder-moonbeam /unique_parachain/moonbeam/target/release/moonbeam /moonbeam/target/release/ +COPY --from=builder-cumulus /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus +COPY --from=builder-acala /unique_parachain/Acala/target/production/acala /acala/target/release/ +COPY --from=builder-chainql /chainql/target/release/chainql /chainql/target/release/ + +EXPOSE 9844 +EXPOSE 9944 +EXPOSE 9946 +EXPOSE 9947 +EXPOSE 9948 + +CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start launch-config-xcm-{{ NETWORK }}.json From eab52559897aa0373d528aab4c82c799e4ae34cd Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 30 Aug 2022 02:59:26 +0700 Subject: [PATCH 0611/1274] xcm testnet workflow --- .docker/Dockerfile-testnet.j2 | 96 +++++++++++++ .../{Dockerfile-xcm-2 => Dockerfile-xcm.j2} | 0 .github/workflows/xcm-testnet.yml | 134 +++--------------- 3 files changed, 112 insertions(+), 118 deletions(-) create mode 100644 .docker/Dockerfile-testnet.j2 rename .docker/{Dockerfile-xcm-2 => Dockerfile-xcm.j2} (100%) diff --git a/.docker/Dockerfile-testnet.j2 b/.docker/Dockerfile-testnet.j2 new file mode 100644 index 0000000000..83407229a9 --- /dev/null +++ b/.docker/Dockerfile-testnet.j2 @@ -0,0 +1,96 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +#ARG RUST_TOOLCHAIN= + +#ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install {{ RUST_TOOLCHAIN }} && \ + rustup default {{ RUST_TOOLCHAIN }} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + + +# ===== BUILD ====== +FROM rust-builder as builder-unique + +ARG PROFILE=release +#ARG FEATURE= +#ARG BRANCH= + + +WORKDIR /unique_parachain + +RUN git clone -b {{ BRANCH }} https://github.com/UniqueNetwork/unique-chain.git && \ + cd unique-chain && \ + cargo build --features={{ FEATURE }} --$PROFILE + +# ===== BUILD POLKADOT ===== +FROM rust-builder as builder-polkadot + +#ARG POLKADOT_BUILD_BRANCH= +#ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH + + +WORKDIR /unique_parachain + +RUN git clone -b {{ POLKADOT_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/polkadot.git && \ + cd polkadot && \ + cargo build --release + +# ===== RUN ====== + +FROM ubuntu:20.04 + +#ARG POLKADOT_LAUNCH_BRANCH= +#ENV POLKADOT_LAUNCH_BRANCH $POLKADOT_LAUNCH_BRANCH + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b {{ POLKADOT_LAUNCH_BRANCH }} + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn install + +COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ + +EXPOSE 9844 +EXPOSE 9944 +EXPOSE 9933 +EXPOSE 9833 +EXPOSE 40333 +EXPOSE 30333 + +CMD export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start launch-config.json + + diff --git a/.docker/Dockerfile-xcm-2 b/.docker/Dockerfile-xcm.j2 similarity index 100% rename from .docker/Dockerfile-xcm-2 rename to .docker/Dockerfile-xcm.j2 diff --git a/.github/workflows/xcm-testnet.yml b/.github/workflows/xcm-testnet.yml index 85e7a732b5..be6c27efd2 100644 --- a/.github/workflows/xcm-testnet.yml +++ b/.github/workflows/xcm-testnet.yml @@ -1,4 +1,4 @@ -name: upgrade nodata +name: xcm testnet # Controls when the action will run. on: @@ -30,7 +30,7 @@ jobs: name: Prepare execution matrix - runs-on: XL + runs-on: XL2 outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} @@ -59,7 +59,7 @@ jobs: xcm-build: needs: prepare-execution-marix # The type of runner that the job will run on - runs-on: [XL] + runs-on: [XL2] timeout-minutes: 600 @@ -73,7 +73,7 @@ jobs: steps: - - name: Skip if pull request is in Draft + #- name: Skip if pull request is in Draft # `if: github.event.pull_request.draft == true` should be kept here, at # the step level, rather than at the job level. The latter is not # recommended because when the PR is moved from "Draft" to "Ready to @@ -88,8 +88,8 @@ jobs: # 4. Move it to "Ready for review"; now the workflow is passing (it was # skipped) and "Check reviews" is also passing (it won't be updated # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 + # if: github.event.pull_request.draft == true + #run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 @@ -102,18 +102,16 @@ jobs: - name: Read .env file uses: xom9ikk/dotenv@v1.0.2 - - name: Generate ENV related extend file for docker-compose + - name: Generate ENV related extend Dockerfile file uses: cuchi/jinja2-action@v1.2.0 with: - template: .docker/docker-compose.tmp-xcm.j2 - output_file: .docker/docker-compose-xcm.${{ matrix.network }}.yml + template: .docker/Dockerfile-xcm.j2 + output_file: .docker/Dockerfile-xcm.${{ matrix.network }}.yml variables: | - REPO_URL=${{ github.server_url }}/${{ github.repository }}.git RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} NETWORK=${{ matrix.network }} POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} - MAINNET_BRANCH=${{ matrix.mainnet_branch }} FEATURE=${{ matrix.features }} RUNTIME=${{ matrix.runtime }} BRANCH=${{ github.head_ref }} @@ -121,14 +119,14 @@ jobs: MOONBEAM_BUILD_BRANCH=${{ env.MOONBEAM_BUILD_BRANCH }} CUMULUS_BUILD_BRANCH=${{ env.CUMULUS_BUILD_BRANCH }} - - name: Show build configuration - run: cat .docker/docker-compose-xcm.${{ matrix.network }}.yml + - name: Show build Dockerfile + run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml - name: Show launch-config-xcm-${{ matrix.network }} configuration run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json - name: Build the stack - run: docker-compose -f ".docker/docker-compose-xcm.yml" -f ".docker/docker-compose-xcm.${{ matrix.network }}.yml" up -d --build + run: cd .docker/ && docker build --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag xcm-nodes-${{ matrix.network }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . - name: Collect Docker Logs if: success() || failure() @@ -141,114 +139,14 @@ jobs: if: success() || failure() run: cat './xcm-build-logs.${{ matrix.features }}/xcm-nodes-${{ matrix.network }}.log' - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-xcm.yml" -f ".docker/docker-compose-xcm.${{ matrix.network }}.yml" down - - name: Log in to Docker Hub - uses: docker/login-action + uses: docker/login-action@v2.0.0 with: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - name: Tag docker image - run: docker tag xcm_nodes_${{ matrix.network }} uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} - - - name: Push docker image + - name: Push docker version image run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} - testnet-build: - needs: prepare-execution-marix - # The type of runner that the job will run on - runs-on: [XL] - - timeout-minutes: 600 - - name: ${{ matrix.network }} - - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - - strategy: - matrix: - include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} - - steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Generate ENV related extend file for docker-compose - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/docker-compose.tmp-testnet.j2 - output_file: .docker/docker-compose-testnet.${{ matrix.network }}.yml - variables: | - REPO_URL=${{ github.server_url }}/${{ github.repository }}.git - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - NETWORK=${{ matrix.network }} - POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} - POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} - MAINNET_BRANCH=${{ matrix.mainnet_branch }} - FEATURE=${{ matrix.features }} - RUNTIME=${{ matrix.runtime }} - BRANCH=${{ github.head_ref }} - - - name: Show build configuration - run: cat .docker/docker-compose-testnet.${{ matrix.network }}.yml - - - name: Build the stack - run: docker-compose -f ".docker/docker-compose-testnet.yml" -f ".docker/docker-compose-testnet.${{ matrix.network }}.yml" up -d --build - - - name: Collect Docker Logs - if: success() || failure() - uses: jwalton/gh-docker-logs@v2.2.0 - with: - dest: './testnet-build-logs.${{ matrix.features }}' - images: 'testnet_node_${{ matrix.network }}' - - - name: Show docker logs - if: success() || failure() - run: cat './testnet-build-logs.${{ matrix.features }}/testnet_node_${{ matrix.network }}.log' - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-testnet.yml" -f ".docker/docker-compose-testnet.${{ matrix.network }}.yml" down - - - name: Log in to Docker Hub - uses: docker/login-action - with: - username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} - password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - - name: Tag docker image - run: docker tag testnet_node_${{ matrix.network }} uniquenetwork/${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} - - - name: Push docker image - run: docker push uniquenetwork/${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} - - + - name: Push docker image latest + run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest From f652d06c809eb5dc9e8d73b2609cf9fc6540b958 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 30 Aug 2022 03:17:38 +0700 Subject: [PATCH 0612/1274] xcm testnet workflow --- .env | 4 ++-- .github/workflows/xcm-testnet.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.env b/.env index 62280df1da..6b6c05f19c 100644 --- a/.env +++ b/.env @@ -2,10 +2,10 @@ RUST_TOOLCHAIN=nightly-2022-07-24 POLKADOT_BUILD_BRANCH=release-v0.9.27 POLKADOT_MAINNET_BRANCH=release-v0.9.26 -UNIQUE_MAINNET_TAG=v924010 +UNIQUE_MAINNET_TAG=release-v927020 KUSAMA_MAINNET_BRANCH=release-v0.9.26 -QUARTZ_MAINNET_TAG=quartz-v924012-2 +QUARTZ_MAINNET_TAG=release-v927020 OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443 QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 diff --git a/.github/workflows/xcm-testnet.yml b/.github/workflows/xcm-testnet.yml index be6c27efd2..c799300be2 100644 --- a/.github/workflows/xcm-testnet.yml +++ b/.github/workflows/xcm-testnet.yml @@ -52,7 +52,7 @@ jobs: id: create_matrix with: matrix: | - network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + # network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} @@ -114,7 +114,7 @@ jobs: POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} FEATURE=${{ matrix.features }} RUNTIME=${{ matrix.runtime }} - BRANCH=${{ github.head_ref }} + BRANCH=${{ matrix.mainnet_branch }} ACALA_BUILD_BRANCH=${{ env.ACALA_BUILD_BRANCH }} MOONBEAM_BUILD_BRANCH=${{ env.MOONBEAM_BUILD_BRANCH }} CUMULUS_BUILD_BRANCH=${{ env.CUMULUS_BUILD_BRANCH }} From 529b8ad99b093a0247f1e12af00148c59daa07ae Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 30 Aug 2022 12:11:18 +0700 Subject: [PATCH 0613/1274] xcm testnet workflow --- .github/workflows/xcm-testnet.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/xcm-testnet.yml b/.github/workflows/xcm-testnet.yml index c799300be2..5307323a46 100644 --- a/.github/workflows/xcm-testnet.yml +++ b/.github/workflows/xcm-testnet.yml @@ -128,16 +128,16 @@ jobs: - name: Build the stack run: cd .docker/ && docker build --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag xcm-nodes-${{ matrix.network }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . - - name: Collect Docker Logs - if: success() || failure() - uses: jwalton/gh-docker-logs@v2.2.0 - with: - dest: './xcm-build-logs.${{ matrix.features }}' - images: 'xcm-nodes-${{ matrix.network }}' - - - name: Show docker logs - if: success() || failure() - run: cat './xcm-build-logs.${{ matrix.features }}/xcm-nodes-${{ matrix.network }}.log' + # - name: Collect Docker Logs + # if: success() || failure() + # uses: jwalton/gh-docker-logs@v2.2.0 + # with: + # dest: './xcm-build-logs.${{ matrix.features }}' + # images: 'xcm-nodes-${{ matrix.network }}' + + # - name: Show docker logs + # if: success() || failure() + # run: cat './xcm-build-logs.${{ matrix.features }}/xcm-nodes-${{ matrix.network }}.log' - name: Log in to Docker Hub uses: docker/login-action@v2.0.0 From acaa3b6a1b4872cbd17016cf63f34ec33dde5b3c Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 30 Aug 2022 06:16:36 +0000 Subject: [PATCH 0614/1274] fix: Tuple size calc --- crates/evm-coder/src/abi.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/crates/evm-coder/src/abi.rs b/crates/evm-coder/src/abi.rs index ff00ce0190..0ed5614b8c 100644 --- a/crates/evm-coder/src/abi.rs +++ b/crates/evm-coder/src/abi.rs @@ -350,15 +350,6 @@ macro_rules! impl_abi_readable { self.$method() } - fn size() -> usize { - ABI_ALIGNMENT - } - } - impl AbiRead<$ty> for $ty { - fn abi_read(&mut self) -> Result<$ty> { - todo!("Refactor requered.") - } - fn size() -> usize { ABI_ALIGNMENT } @@ -421,7 +412,6 @@ macro_rules! impl_tuples { where $( Self: AbiRead<$ident>, - $ident: AbiRead<$ident>, )+ ($($ident,)+): TypeHelper<($($ident,)+)>, { @@ -434,7 +424,7 @@ macro_rules! impl_tuples { } fn size() -> usize { - 0 $(+ <$ident>::size())+ + 0 $(+ as AbiRead<$ident>>::size())+ } } #[allow(non_snake_case)] From 42824e2d6d73fab0a6342ee9b33c0f1b0ebdf825 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 30 Aug 2022 07:26:10 +0000 Subject: [PATCH 0615/1274] fix: Remove redudant template --- crates/evm-coder/src/abi.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/evm-coder/src/abi.rs b/crates/evm-coder/src/abi.rs index 0ed5614b8c..daaf93a8b2 100644 --- a/crates/evm-coder/src/abi.rs +++ b/crates/evm-coder/src/abi.rs @@ -31,7 +31,7 @@ use crate::execution::Result; const ABI_ALIGNMENT: usize = 32; -trait TypeHelper { +trait TypeHelper { fn is_dynamic() -> bool; } @@ -340,7 +340,7 @@ pub trait AbiRead { macro_rules! impl_abi_readable { ($ty:ty, $method:ident, $dynamic:literal) => { - impl TypeHelper<$ty> for $ty { + impl TypeHelper for $ty { fn is_dynamic() -> bool { $dynamic } @@ -399,7 +399,7 @@ where macro_rules! impl_tuples { ($($ident:ident)+) => { - impl<$($ident: TypeHelper<$ident>,)+> TypeHelper<($($ident,)+)> for ($($ident,)+) { + impl<$($ident: TypeHelper,)+> TypeHelper for ($($ident,)+) { fn is_dynamic() -> bool { false $( @@ -413,7 +413,7 @@ macro_rules! impl_tuples { $( Self: AbiRead<$ident>, )+ - ($($ident,)+): TypeHelper<($($ident,)+)>, + ($($ident,)+): TypeHelper, { fn abi_read(&mut self) -> Result<($($ident,)+)> { let size = if !<($($ident,)+)>::is_dynamic() { Some(>::size()) } else { None }; From b6fea42a7f335b4fbe740a4db9073e1c7553e365 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 30 Aug 2022 10:57:27 +0300 Subject: [PATCH 0616/1274] Tests --- tests/src/xcmTransferAcala.test.ts | 61 ++--- tests/src/xcmTransferKarura.test.ts | 260 ------------------ tests/src/xcmTransferMoonbeam.test.ts | 49 ++-- tests/src/xcmTransferMoonriver.test.ts | 360 ------------------------- 4 files changed, 52 insertions(+), 678 deletions(-) delete mode 100644 tests/src/xcmTransferKarura.test.ts delete mode 100644 tests/src/xcmTransferMoonriver.test.ts diff --git a/tests/src/xcmTransferAcala.test.ts b/tests/src/xcmTransferAcala.test.ts index ce43b98304..60be3d4d6b 100644 --- a/tests/src/xcmTransferAcala.test.ts +++ b/tests/src/xcmTransferAcala.test.ts @@ -37,20 +37,15 @@ describe('Integration test: Exchanging UNQ with Acala', () => { let alice: IKeyringPair; let randomAccount: IKeyringPair; - let actuallySent1: bigint; - let actuallySent2: bigint; - - let balanceUnique1: bigint; - let balanceUnique2: bigint; - let balanceUnique3: bigint; - - let balanceAcalaUnq1: bigint; - let balanceAcalaUnq2: bigint; - let balanceAcalaUnq3: bigint; - - let balanceAcalaAca1: bigint; - let balanceAcalaAca2: bigint; - let balanceAcalaAca3: bigint; + let balanceUniqueTokenBefore: bigint; + let balanceUniqueTokenAfter: bigint; + let balanceUniqueTokenFinal: bigint; + let balanceAcalaTokenBefore: bigint; + let balanceAcalaTokenAfter: bigint; + let balanceAcalaTokenFinal: bigint; + let balanceUniqueForeignTokenAfter: bigint; + let balanceUniqueForeignTokenBefore: bigint; + let balanceUniqueForeignTokenFinal: bigint; before(async () => { await usingApi(async (api, privateKeyWrapper) => { @@ -93,10 +88,10 @@ describe('Integration test: Exchanging UNQ with Acala', () => { const result1 = getGenericResult(events1); expect(result1.success).to.be.true; - [balanceAcalaAca1] = await getBalance(api, [randomAccount.address]); + [balanceAcalaTokenBefore] = await getBalance(api, [randomAccount.address]); { const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceAcalaUnq1 = BigInt(free); + balanceUniqueForeignTokenBefore = BigInt(free); } }, acalaApiOptions, @@ -108,7 +103,7 @@ describe('Integration test: Exchanging UNQ with Acala', () => { const result0 = getGenericResult(events0); expect(result0.success).to.be.true; - [balanceUnique1] = await getBalance(api, [randomAccount.address]); + [balanceUniqueTokenBefore] = await getBalance(api, [randomAccount.address]); }); }); @@ -165,12 +160,9 @@ describe('Integration test: Exchanging UNQ with Acala', () => { const result = getGenericResult(events); expect(result.success).to.be.true; - [balanceUnique2] = await getBalance(api, [randomAccount.address]); + [balanceUniqueTokenAfter] = await getBalance(api, [randomAccount.address]); - const transactionFees = balanceUnique1 - balanceUnique2 - TRANSFER_AMOUNT; - actuallySent1 = TRANSFER_AMOUNT; // Why not TRANSFER_AMOUNT - transactionFees ??? - console.log('Unique to Acala transaction fees on Unique: %s UNQ', transactionFees); - expect(transactionFees > 0).to.be.true; + expect((balanceUniqueTokenBefore - balanceUniqueTokenAfter) > 0n).to.be.true; }); await usingApi( @@ -178,13 +170,11 @@ describe('Integration test: Exchanging UNQ with Acala', () => { // todo do something about instant sealing, where there might not be any new blocks await waitNewBlocks(api, 3); const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceAcalaUnq2 = BigInt(free); - expect(balanceAcalaUnq2 > balanceAcalaUnq1).to.be.true; - - [balanceAcalaAca2] = await getBalance(api, [randomAccount.address]); + balanceUniqueForeignTokenAfter = BigInt(free); - const acaFees = balanceAcalaAca1 - balanceAcalaAca2; - const unqFees = actuallySent1 - balanceAcalaUnq2 + balanceAcalaUnq1; + [balanceAcalaTokenAfter] = await getBalance(api, [randomAccount.address]); + const acaFees = balanceAcalaTokenBefore - balanceAcalaTokenAfter; + const unqFees = balanceUniqueForeignTokenBefore - balanceUniqueForeignTokenAfter; console.log('Unique to Acala transaction fees on Acala: %s ACA', acaFees); console.log('Unique to Acala transaction fees on Acala: %s UNQ', unqFees); expect(acaFees == 0n).to.be.true; @@ -227,15 +217,14 @@ describe('Integration test: Exchanging UNQ with Acala', () => { const result = getGenericResult(events); expect(result.success).to.be.true; - [balanceAcalaAca3] = await getBalance(api, [randomAccount.address]); + [balanceAcalaTokenFinal] = await getBalance(api, [randomAccount.address]); { const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceAcalaUnq3 = BigInt(free); + balanceUniqueForeignTokenFinal = BigInt(free); } - const acaFees = balanceAcalaAca2 - balanceAcalaAca3; - const unqFees = balanceAcalaUnq2 - balanceAcalaUnq3 - amount; - actuallySent2 = amount; // Why not amount - UNQFees ??? + const acaFees = balanceAcalaTokenFinal - balanceAcalaTokenAfter; + const unqFees = balanceUniqueForeignTokenFinal - balanceUniqueForeignTokenAfter; console.log('Acala to Unique transaction fees on Acala: %s ACA', acaFees); console.log('Acala to Unique transaction fees on Acala: %s UNQ', unqFees); expect(acaFees > 0).to.be.true; @@ -248,11 +237,11 @@ describe('Integration test: Exchanging UNQ with Acala', () => { // todo do something about instant sealing, where there might not be any new blocks await waitNewBlocks(api, 3); - [balanceUnique3] = await getBalance(api, [randomAccount.address]); - const actuallyDelivered = balanceUnique3 - balanceUnique2; + [balanceUniqueTokenFinal] = await getBalance(api, [randomAccount.address]); + const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenAfter; expect(actuallyDelivered > 0).to.be.true; - const unqFees = actuallySent2 - actuallyDelivered; + const unqFees = TRANSFER_AMOUNT - actuallyDelivered; console.log('Acala to Unique transaction fees on Unique: %s UNQ', unqFees); expect(unqFees > 0).to.be.true; }); diff --git a/tests/src/xcmTransferKarura.test.ts b/tests/src/xcmTransferKarura.test.ts deleted file mode 100644 index 6ea8a52f96..0000000000 --- a/tests/src/xcmTransferKarura.test.ts +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; - -import {WsProvider} from '@polkadot/api'; -import {ApiOptions} from '@polkadot/api/types'; -import {IKeyringPair} from '@polkadot/types/types'; -import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; -import {getGenericResult, generateKeyringPair} from './util/helpers'; -import waitNewBlocks from './substrate/wait-new-blocks'; -import getBalance from './substrate/get-balance'; - -chai.use(chaiAsPromised); -const expect = chai.expect; - -const UNIQUE_CHAIN = 5000; -const KARURA_CHAIN = 2000; -const KARURA_PORT = '9946'; -const TRANSFER_AMOUNT = 2000000000000000000000000n; - -describe('Integration test: Exchanging QTZ with Karura', () => { - let alice: IKeyringPair; - let randomAccount: IKeyringPair; - - let actuallySent1: bigint; - let actuallySent2: bigint; - - let balanceQuartz1: bigint; - let balanceQuartz2: bigint; - let balanceQuartz3: bigint; - - let balanceKaruraQtz1: bigint; - let balanceKaruraQtz2: bigint; - let balanceKaruraQtz3: bigint; - - let balanceKaruraKar1: bigint; - let balanceKaruraKar2: bigint; - let balanceKaruraKar3: bigint; - - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - randomAccount = generateKeyringPair(); - }); - - const karuraApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT), - }; - - await usingApi( - async (api) => { - const destination = { - V0: { - X2: [ - 'Parent', - { - Parachain: UNIQUE_CHAIN, - }, - ], - }, - }; - - const metadata = { - name: 'QTZ', - symbol: 'QTZ', - decimals: 18, - minimalBalance: 1, - }; - - const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata); - const sudoTx = api.tx.sudo.sudo(tx as any); - const events = await submitTransactionAsync(alice, sudoTx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); - const events1 = await submitTransactionAsync(alice, tx1); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; - - [balanceKaruraKar1] = await getBalance(api, [randomAccount.address]); - { - const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceKaruraQtz1 = BigInt(free); - } - }, - karuraApiOptions, - ); - - await usingApi(async (api) => { - const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); - const events0 = await submitTransactionAsync(alice, tx0); - const result0 = getGenericResult(events0); - expect(result0.success).to.be.true; - - [balanceQuartz1] = await getBalance(api, [randomAccount.address]); - }); - }); - - it('Should connect and send QTZ to Karura', async () => { - - await usingApi(async (api) => { - - const destination = { - V0: { - X2: [ - 'Parent', - { - Parachain: KARURA_CHAIN, - }, - ], - }, - }; - - const beneficiary = { - V0: { - X1: { - AccountId32: { - network: 'Any', - id: randomAccount.addressRaw, - }, - }, - }, - }; - - const assets = { - V1: [ - { - id: { - Concrete: { - parents: 0, - interior: 'Here', - }, - }, - fun: { - Fungible: TRANSFER_AMOUNT, - }, - }, - ], - }; - - const feeAssetItem = 0; - - const weightLimit = { - Limited: 5000000000, - }; - - const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); - const events = await submitTransactionAsync(randomAccount, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - [balanceQuartz2] = await getBalance(api, [randomAccount.address]); - - const transactionFees = balanceQuartz1 - balanceQuartz2 - TRANSFER_AMOUNT; - actuallySent1 = TRANSFER_AMOUNT; // Why not TRANSFER_AMOUNT - transactionFees ??? - console.log('Quartz to Karura transaction fees on Quartz: %s QTZ', transactionFees); - expect(transactionFees > 0).to.be.true; - }); - - await usingApi( - async (api) => { - // todo do something about instant sealing, where there might not be any new blocks - await waitNewBlocks(api, 3); - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceKaruraQtz2 = BigInt(free); - expect(balanceKaruraQtz2 > balanceKaruraQtz1).to.be.true; - - [balanceKaruraKar2] = await getBalance(api, [randomAccount.address]); - - const karFees = balanceKaruraKar1 - balanceKaruraKar2; - const qtzFees = actuallySent1 - balanceKaruraQtz2 + balanceKaruraQtz1; - console.log('Quartz to Karura transaction fees on Karura: %s KAR', karFees); - console.log('Quartz to Karura transaction fees on Karura: %s QTZ', qtzFees); - expect(karFees == 0n).to.be.true; - expect(qtzFees == 0n).to.be.true; - }, - {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)}, - ); - }); - - it('Should connect to Karura and send QTZ back', async () => { - - await usingApi( - async (api) => { - const destination = { - V1: { - parents: 1, - interior: { - X2: [ - {Parachain: UNIQUE_CHAIN}, - { - AccountId32: { - network: 'Any', - id: randomAccount.addressRaw, - }, - }, - ], - }, - }, - }; - - const id = { - ForeignAsset: 0, - }; - - const amount = TRANSFER_AMOUNT; - const destWeight = 50000000; - - const tx = api.tx.xTokens.transfer(id, amount, destination, destWeight); - const events = await submitTransactionAsync(randomAccount, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - [balanceKaruraKar3] = await getBalance(api, [randomAccount.address]); - { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceKaruraQtz3 = BigInt(free); - } - - const karFees = balanceKaruraKar2 - balanceKaruraKar3; - const qtzFees = balanceKaruraQtz2 - balanceKaruraQtz3 - amount; - actuallySent2 = amount; // Why not amount - qtzFees ??? - console.log('Karura to Quartz transaction fees on Karura: %s KAR', karFees); - console.log('Karura to Quartz transaction fees on Karura: %s QTZ', qtzFees); - expect(karFees > 0).to.be.true; - expect(qtzFees == 0n).to.be.true; - }, - {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)}, - ); - - await usingApi(async (api) => { - // todo do something about instant sealing, where there might not be any new blocks - await waitNewBlocks(api, 3); - - [balanceQuartz3] = await getBalance(api, [randomAccount.address]); - const actuallyDelivered = balanceQuartz3 - balanceQuartz2; - expect(actuallyDelivered > 0).to.be.true; - - const qtzFees = actuallySent2 - actuallyDelivered; - console.log('Karura to Quartz transaction fees on Quartz: %s QTZ', qtzFees); - expect(qtzFees > 0).to.be.true; - }); - }); -}); \ No newline at end of file diff --git a/tests/src/xcmTransferMoonbeam.test.ts b/tests/src/xcmTransferMoonbeam.test.ts index 3fde3515b8..cf199e22f3 100644 --- a/tests/src/xcmTransferMoonbeam.test.ts +++ b/tests/src/xcmTransferMoonbeam.test.ts @@ -70,16 +70,23 @@ describe('Integration test: Exchanging UNQ with Moonbeam', () => { minimalBalance: 1, }; - let actuallySent1: bigint; - let actuallySent2: bigint; + // let actuallySent1: bigint; + // let actuallySent2: bigint; - let balanceUnique1: bigint; - let balanceUnique2: bigint; - let balanceUnique3: bigint; + // let balanceUnique1: bigint; + // let balanceUnique2: bigint; + // let balanceUnique3: bigint; - let balanceMoonbeamGlmr1: bigint; - let balanceMoonbeamGlmr2: bigint; - let balanceMoonbeamGlmr3: bigint; + // let balanceMoonbeamGlmr1: bigint; + // let balanceMoonbeamGlmr2: bigint; + // let balanceMoonbeamGlmr3: bigint; + + let balanceUniqueTokenBefore: bigint; + let balanceUniqueTokenAfter: bigint; + let balanceUniqueTokenFinal: bigint; + let balanceGlmrTokenBefore: bigint; + let balanceGlmrTokenAfter: bigint; + let balanceGlmrTokenFinal: bigint; before(async () => { await usingApi(async (api, privateKeyWrapper) => { @@ -234,7 +241,7 @@ describe('Integration test: Exchanging UNQ with Moonbeam', () => { expect(result9.success).to.be.true; // <<< Sponsoring random Account <<< - [balanceMoonbeamGlmr1] = await getBalance(api, [randomAccountMoonbeam.address]); + [balanceGlmrTokenBefore] = await getBalance(api, [randomAccountMoonbeam.address]); }, moonbeamApiOptions, ); @@ -245,7 +252,7 @@ describe('Integration test: Exchanging UNQ with Moonbeam', () => { const result0 = getGenericResult(events0); expect(result0.success).to.be.true; - [balanceUnique1] = await getBalance(api, [randomAccountUnique.address]); + [balanceUniqueTokenBefore] = await getBalance(api, [randomAccountUnique.address]); }); }); @@ -273,11 +280,10 @@ describe('Integration test: Exchanging UNQ with Moonbeam', () => { const result = getGenericResult(events); expect(result.success).to.be.true; - [balanceUnique2] = await getBalance(api, [randomAccountUnique.address]); - expect(balanceUnique2 < balanceUnique1).to.be.true; + [balanceUniqueTokenAfter] = await getBalance(api, [randomAccountUnique.address]); + expect(balanceUniqueTokenAfter < balanceUniqueTokenBefore).to.be.true; - const transactionFees = balanceUnique1 - balanceUnique2 - TRANSFER_AMOUNT; - actuallySent1 = TRANSFER_AMOUNT; // Why not TRANSFER_AMOUNT - transactionFees ??? + const transactionFees = balanceUniqueTokenBefore - balanceUniqueTokenAfter - TRANSFER_AMOUNT; console.log('Unique to Moonbeam transaction fees on Unique: %s UNQ', transactionFees); expect(transactionFees > 0).to.be.true; }); @@ -287,9 +293,9 @@ describe('Integration test: Exchanging UNQ with Moonbeam', () => { // todo do something about instant sealing, where there might not be any new blocks await waitNewBlocks(api, 3); - [balanceMoonbeamGlmr2] = await getBalance(api, [randomAccountMoonbeam.address]); + [balanceGlmrTokenAfter] = await getBalance(api, [randomAccountMoonbeam.address]); - const glmrFees = balanceMoonbeamGlmr1 - balanceMoonbeamGlmr2; + const glmrFees = balanceGlmrTokenBefore - balanceGlmrTokenAfter; console.log('Unique to Moonbeam transaction fees on Moonbeam: %s GLMR', glmrFees); expect(glmrFees == 0n).to.be.true; }, @@ -334,10 +340,9 @@ describe('Integration test: Exchanging UNQ with Moonbeam', () => { const result = getGenericResult(events); expect(result.success).to.be.true; - [balanceMoonbeamGlmr3] = await getBalance(api, [randomAccountMoonbeam.address]); + [balanceGlmrTokenFinal] = await getBalance(api, [randomAccountMoonbeam.address]); - const glmrFees = balanceMoonbeamGlmr2 - balanceMoonbeamGlmr3; - actuallySent2 = amount; + const glmrFees = balanceGlmrTokenAfter - balanceGlmrTokenFinal; console.log('Moonbeam to Unique transaction fees on Moonbeam: %s GLMR', glmrFees); expect(glmrFees > 0).to.be.true; }, @@ -348,11 +353,11 @@ describe('Integration test: Exchanging UNQ with Moonbeam', () => { // todo do something about instant sealing, where there might not be any new blocks await waitNewBlocks(api, 3); - [balanceUnique3] = await getBalance(api, [randomAccountUnique.address]); - const actuallyDelivered = balanceUnique3 - balanceUnique2; + [balanceUniqueTokenFinal] = await getBalance(api, [randomAccountUnique.address]); + const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenAfter; expect(actuallyDelivered > 0).to.be.true; - const unqFees = actuallySent2 - actuallyDelivered; + const unqFees = TRANSFER_AMOUNT - actuallyDelivered; console.log('Moonbeam to Unique transaction fees on Unique: %s UNQ', unqFees); expect(unqFees > 0).to.be.true; }); diff --git a/tests/src/xcmTransferMoonriver.test.ts b/tests/src/xcmTransferMoonriver.test.ts deleted file mode 100644 index 76eff81f3b..0000000000 --- a/tests/src/xcmTransferMoonriver.test.ts +++ /dev/null @@ -1,360 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; - -import {Keyring, WsProvider} from '@polkadot/api'; -import {ApiOptions} from '@polkadot/api/types'; -import {IKeyringPair} from '@polkadot/types/types'; -import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; -import {getGenericResult, generateKeyringPair} from './util/helpers'; -import {MultiLocation} from '@polkadot/types/interfaces'; -import {blake2AsHex} from '@polkadot/util-crypto'; -import getBalance from './substrate/get-balance'; -import waitNewBlocks from './substrate/wait-new-blocks'; - -chai.use(chaiAsPromised); -const expect = chai.expect; - -const QUARTZ_CHAIN = 5000; -const MOONRIVER_CHAIN = 1000; -const QUARTZ_PORT = '9944'; -const MOONRIVER_PORT = '9946'; -const TRANSFER_AMOUNT = 2000000000000000000000000n; - -describe('Integration test: Exchanging QTZ with Moonriver', () => { - - // Unique constants - let quartzAlice: IKeyringPair; - let quartzAssetLocation; - - let randomAccountQuartz: IKeyringPair; - let randomAccountMoonriver: IKeyringPair; - - // Moonriver constants - let assetId: Uint8Array; - - const moonriverKeyring = new Keyring({type: 'ethereum'}); - const alithPrivateKey = '0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133'; - const baltatharPrivateKey = '0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b'; - const dorothyPrivateKey = '0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68'; - - const alithAccount = moonriverKeyring.addFromUri(alithPrivateKey, undefined, 'ethereum'); - const baltatharAccount = moonriverKeyring.addFromUri(baltatharPrivateKey, undefined, 'ethereum'); - const dorothyAccount = moonriverKeyring.addFromUri(dorothyPrivateKey, undefined, 'ethereum'); - - const councilVotingThreshold = 2; - const technicalCommitteeThreshold = 2; - const votingPeriod = 3; - const delayPeriod = 0; - - const uniqueAssetMetadata = { - name: 'xcQuartz', - symbol: 'xcQTZ', - decimals: 18, - isFrozen: false, - minimalBalance: 1, - }; - - let actuallySent1: bigint; - let actuallySent2: bigint; - - let balanceQuartz1: bigint; - let balanceQuartz2: bigint; - let balanceQuartz3: bigint; - - let balanceMoonriverMovr1: bigint; - let balanceMoonriverMovr2: bigint; - let balanceMoonriverMovr3: bigint; - - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - quartzAlice = privateKeyWrapper('//Alice'); - randomAccountQuartz = generateKeyringPair(); - randomAccountMoonriver = generateKeyringPair('ethereum'); - }); - - const moonriverApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + MOONRIVER_PORT), - }; - - await usingApi( - async (api) => { - - // >>> Sponsoring Dorothy >>> - const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n); - const events0 = await submitTransactionAsync(alithAccount, tx0); - const result0 = getGenericResult(events0); - expect(result0.success).to.be.true; - // <<< Sponsoring Dorothy <<< - - const sourceLocation: MultiLocation = api.createType( - 'MultiLocation', - { - parents: 1, - interior: {X1: {Parachain: QUARTZ_CHAIN}}, - }, - ); - - assetId = api.registry.hash(sourceLocation.toU8a()).slice(0, 16).reverse(); - console.log('Internal asset ID is %s', assetId); - quartzAssetLocation = {XCM: sourceLocation}; - const existentialDeposit = 1; - const isSufficient = true; - const unitsPerSecond = '1'; - const numAssetsWeightHint = 0; - - const registerTx = api.tx.assetManager.registerForeignAsset( - quartzAssetLocation, - uniqueAssetMetadata, - existentialDeposit, - isSufficient, - ); - console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || ''); - - const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond( - quartzAssetLocation, - unitsPerSecond, - numAssetsWeightHint, - ); - console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || ''); - - const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]); - console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || ''); - - // >>> Note motion preimage >>> - const encodedProposal = batchCall?.method.toHex() || ''; - const proposalHash = blake2AsHex(encodedProposal); - console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal); - console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); - console.log('Encoded length %d', encodedProposal.length); - - const tx1 = api.tx.democracy.notePreimage(encodedProposal); - const events1 = await submitTransactionAsync(baltatharAccount, tx1); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; - // <<< Note motion preimage <<< - - // >>> Propose external motion through council >>> - const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash); - const tx2 = api.tx.councilCollective.propose( - councilVotingThreshold, - externalMotion, - externalMotion.encodedLength, - ); - const events2 = await submitTransactionAsync(baltatharAccount, tx2); - const result2 = getGenericResult(events2); - expect(result2.success).to.be.true; - - const encodedMotion = externalMotion?.method.toHex() || ''; - const motionHash = blake2AsHex(encodedMotion); - console.log('Motion hash is %s', motionHash); - - const tx3 = api.tx.councilCollective.vote(motionHash, 0, true); - { - const events3 = await submitTransactionAsync(dorothyAccount, tx3); - const result3 = getGenericResult(events3); - expect(result3.success).to.be.true; - } - { - const events3 = await submitTransactionAsync(baltatharAccount, tx3); - const result3 = getGenericResult(events3); - expect(result3.success).to.be.true; - } - - const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength); - const events4 = await submitTransactionAsync(dorothyAccount, tx4); - const result4 = getGenericResult(events4); - expect(result4.success).to.be.true; - // <<< Propose external motion through council <<< - - // >>> Fast track proposal through technical committee >>> - const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); - const tx5 = api.tx.techCommitteeCollective.propose( - technicalCommitteeThreshold, - fastTrack, - fastTrack.encodedLength, - ); - const events5 = await submitTransactionAsync(alithAccount, tx5); - const result5 = getGenericResult(events5); - expect(result5.success).to.be.true; - - const encodedFastTrack = fastTrack?.method.toHex() || ''; - const fastTrackHash = blake2AsHex(encodedFastTrack); - console.log('FastTrack hash is %s', fastTrackHash); - - const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1; - const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true); - { - const events6 = await submitTransactionAsync(baltatharAccount, tx6); - const result6 = getGenericResult(events6); - expect(result6.success).to.be.true; - } - { - const events6 = await submitTransactionAsync(alithAccount, tx6); - const result6 = getGenericResult(events6); - expect(result6.success).to.be.true; - } - - const tx7 = api.tx.techCommitteeCollective - .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength); - const events7 = await submitTransactionAsync(baltatharAccount, tx7); - const result7 = getGenericResult(events7); - expect(result7.success).to.be.true; - // <<< Fast track proposal through technical committee <<< - - // >>> Referendum voting >>> - const tx8 = api.tx.democracy.vote( - 0, - {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}}, - ); - const events8 = await submitTransactionAsync(dorothyAccount, tx8); - const result8 = getGenericResult(events8); - expect(result8.success).to.be.true; - // <<< Referendum voting <<< - - // >>> Sponsoring random Account >>> - const tx9 = api.tx.balances.transfer(randomAccountMoonriver.address, 11_000_000_000_000_000_000n); - const events9 = await submitTransactionAsync(baltatharAccount, tx9); - const result9 = getGenericResult(events9); - expect(result9.success).to.be.true; - // <<< Sponsoring random Account <<< - - [balanceMoonriverMovr1] = await getBalance(api, [randomAccountMoonriver.address]); - }, - moonriverApiOptions, - ); - - await usingApi(async (api) => { - const tx0 = api.tx.balances.transfer(randomAccountQuartz.address, 10n * TRANSFER_AMOUNT); - const events0 = await submitTransactionAsync(quartzAlice, tx0); - const result0 = getGenericResult(events0); - expect(result0.success).to.be.true; - - [balanceQuartz1] = await getBalance(api, [randomAccountQuartz.address]); - }); - }); - - it('Should connect and send QTZ to Moonriver', async () => { - await usingApi(async (api) => { - const currencyId = { - NativeAssetId: 'Here', - }; - const dest = { - V1: { - parents: 1, - interior: { - X2: [ - {Parachain: MOONRIVER_CHAIN}, - {AccountKey20: {network: 'Any', key: randomAccountMoonriver.address}}, - ], - }, - }, - }; - const amount = TRANSFER_AMOUNT; - const destWeight = 50000000; - - const tx = api.tx.xTokens.transfer(currencyId, amount, dest, destWeight); - const events = await submitTransactionAsync(quartzAlice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - [balanceQuartz2] = await getBalance(api, [randomAccountQuartz.address]); - expect(balanceQuartz2 < balanceQuartz1).to.be.true; - - const transactionFees = balanceQuartz1 - balanceQuartz2 - TRANSFER_AMOUNT; - actuallySent1 = TRANSFER_AMOUNT; // Why not TRANSFER_AMOUNT - transactionFees ??? - console.log('Quartz to Moonriver transaction fees on Quartz: %s QTZ', transactionFees); - expect(transactionFees > 0).to.be.true; - }); - - await usingApi( - async (api) => { - // todo do something about instant sealing, where there might not be any new blocks - await waitNewBlocks(api, 3); - - [balanceMoonriverMovr2] = await getBalance(api, [randomAccountMoonriver.address]); - - const movrFees = balanceMoonriverMovr1 - balanceMoonriverMovr2; - console.log('Quartz to Moonriver transaction fees on Moonriver: %s MOVR', movrFees); - expect(movrFees == 0n).to.be.true; - }, - {provider: new WsProvider('ws://127.0.0.1:' + MOONRIVER_PORT)}, - ); - }); - - it('Should connect to Moonriver and send QTZ back', async () => { - await usingApi( - async (api) => { - const amount = TRANSFER_AMOUNT / 2n; - const asset = { - V1: { - id: { - Concrete: { - parents: 1, - interior: { - X1: {Parachain: QUARTZ_CHAIN}, - }, - }, - }, - fun: { - Fungible: amount, - }, - }, - }; - const destination = { - V1: { - parents: 1, - interior: { - X2: [ - {Parachain: QUARTZ_CHAIN}, - {AccountId32: {network: 'Any', id: randomAccountQuartz.addressRaw}}, - ], - }, - }, - }; - const destWeight = 50000000; - - const tx = api.tx.xTokens.transferMultiasset(asset, destination, destWeight); - const events = await submitTransactionAsync(randomAccountMoonriver, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - [balanceMoonriverMovr3] = await getBalance(api, [randomAccountMoonriver.address]); - - const movrFees = balanceMoonriverMovr2 - balanceMoonriverMovr3; - actuallySent2 = amount; - console.log('Moonriver to Quartz transaction fees on Moonriver: %s MOVR', movrFees); - expect(movrFees > 0).to.be.true; - }, - {provider: new WsProvider('ws://127.0.0.1:' + MOONRIVER_PORT)}, - ); - - await usingApi(async (api) => { - // todo do something about instant sealing, where there might not be any new blocks - await waitNewBlocks(api, 3); - - [balanceQuartz3] = await getBalance(api, [randomAccountQuartz.address]); - const actuallyDelivered = balanceQuartz3 - balanceQuartz2; - expect(actuallyDelivered > 0).to.be.true; - - const qtzFees = actuallySent2 - actuallyDelivered; - console.log('Moonriver to Quartz transaction fees on Quartz: %s QTZ', qtzFees); - expect(qtzFees > 0).to.be.true; - }); - }); -}); From ddfc60f7e94f61d6a5ea4daa1f142c0a6d98d4e2 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 10 Aug 2022 21:27:08 +0700 Subject: [PATCH 0617/1274] features: added app-promotion pallet prototype --- Cargo.lock | 3240 +++++++++++++-------- Makefile | 4 + client/rpc/src/lib.rs | 34 +- node/cli/src/service.rs | 10 +- node/rpc/src/lib.rs | 6 +- pallets/app-promotion/Cargo.toml | 110 + pallets/app-promotion/src/benchmarking.rs | 72 + pallets/app-promotion/src/lib.rs | 494 ++++ pallets/app-promotion/src/tests.rs | 128 + pallets/app-promotion/src/types.rs | 20 + pallets/app-promotion/src/weights.rs | 141 + primitives/rpc/src/lib.rs | 12 +- runtime/common/runtime_apis.rs | 18 +- runtime/opal/Cargo.toml | 3 + 14 files changed, 2999 insertions(+), 1293 deletions(-) create mode 100644 pallets/app-promotion/Cargo.toml create mode 100644 pallets/app-promotion/src/benchmarking.rs create mode 100644 pallets/app-promotion/src/lib.rs create mode 100644 pallets/app-promotion/src/tests.rs create mode 100644 pallets/app-promotion/src/types.rs create mode 100644 pallets/app-promotion/src/weights.rs diff --git a/Cargo.lock b/Cargo.lock index 4feb49e478..a80b451032 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -446,15 +446,15 @@ dependencies = [ "sc-network", "sc-network-gossip", "sc-utils", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-keystore", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-mmr-primitives", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-prometheus-endpoint", "thiserror", "wasm-timer", @@ -475,8 +475,8 @@ dependencies = [ "sc-rpc", "sc-utils", "serde", - "sp-core", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -486,7 +486,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "beefy-primitives", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -496,11 +496,11 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "parity-scale-codec 3.1.5", "scale-info", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -1300,8 +1300,8 @@ dependencies = [ "sc-chain-spec", "sc-cli", "sc-service", - "sp-core", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "url", ] @@ -1322,10 +1322,10 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "sc-client-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-consensus", - "sp-core", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tracing", ] @@ -1344,16 +1344,16 @@ dependencies = [ "sc-consensus-aura", "sc-consensus-slots", "sc-telemetry", - "sp-api", - "sp-application-crypto", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", - "sp-core", - "sp-inherents", - "sp-keystore", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-prometheus-endpoint", "tracing", ] @@ -1371,11 +1371,11 @@ dependencies = [ "polkadot-primitives", "sc-client-api", "sc-consensus", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", "sp-consensus", - "sp-runtime", - "sp-trie", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tracing", ] @@ -1395,12 +1395,12 @@ dependencies = [ "polkadot-parachain", "polkadot-primitives", "sc-client-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-runtime", - "sp-state-machine", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tracing", ] @@ -1421,10 +1421,10 @@ dependencies = [ "rand 0.8.5", "sc-client-api", "sc-consensus", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-consensus", "sp-maybe-compressed-blob", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tracing", ] @@ -1448,11 +1448,11 @@ dependencies = [ "sc-service", "sc-telemetry", "sc-tracing", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tracing", ] @@ -1462,16 +1462,16 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-aura", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-application-crypto", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-consensus-aura", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -1480,14 +1480,14 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "xcm", "xcm-executor", ] @@ -1501,24 +1501,24 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "environmental", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "impl-trait-for-tuples", "log", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "polkadot-parachain", "scale-info", "serde", - "sp-core", - "sp-externalities", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-trie", - "sp-version", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "xcm", ] @@ -1539,14 +1539,14 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "xcm", ] @@ -1556,14 +1556,14 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "rand_chacha 0.3.1", "scale-info", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "xcm", "xcm-executor", ] @@ -1573,15 +1573,15 @@ name = "cumulus-primitives-core" version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "polkadot-core-primitives", "polkadot-parachain", "polkadot-primitives", - "sp-api", - "sp-runtime", - "sp-std", - "sp-trie", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -1596,14 +1596,14 @@ dependencies = [ "parity-scale-codec 3.1.5", "sc-client-api", "scale-info", - "sp-api", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-storage", - "sp-trie", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tracing", ] @@ -1615,9 +1615,9 @@ dependencies = [ "cumulus-primitives-core", "futures 0.3.23", "parity-scale-codec 3.1.5", - "sp-inherents", - "sp-std", - "sp-timestamp", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -1626,14 +1626,14 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "polkadot-core-primitives", "polkadot-parachain", "polkadot-primitives", - "sp-runtime", - "sp-std", - "sp-trie", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "xcm", "xcm-builder", "xcm-executor", @@ -1660,12 +1660,12 @@ dependencies = [ "sc-sysinfo", "sc-telemetry", "sc-tracing", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-runtime", - "sp-state-machine", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tracing", ] @@ -1684,11 +1684,11 @@ dependencies = [ "polkadot-overseer", "polkadot-service", "sc-client-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", - "sp-core", - "sp-runtime", - "sp-state-machine", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -1709,11 +1709,11 @@ dependencies = [ "polkadot-service", "sc-client-api", "sc-rpc-api", - "sp-api", - "sp-core", - "sp-runtime", - "sp-state-machine", - "sp-storage", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tokio", "tracing", "url", @@ -1727,9 +1727,9 @@ dependencies = [ "cumulus-primitives-core", "parity-scale-codec 3.1.5", "polkadot-primitives", - "sp-runtime", - "sp-state-machine", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -2147,6 +2147,24 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "evm" +version = "0.35.0" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24#e9252ed42dc26fc85b6703b1ba50660a08209e55" +dependencies = [ + "auto_impl", + "ethereum", + "evm-core 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", + "evm-gasometer 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", + "evm-runtime 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", + "log", + "parity-scale-codec 3.1.5", + "primitive-types", + "rlp", + "scale-info", + "sha3 0.10.2", +] + [[package]] name = "evm" version = "0.35.0" @@ -2155,9 +2173,9 @@ dependencies = [ "auto_impl", "environmental", "ethereum", - "evm-core", - "evm-gasometer", - "evm-runtime", + "evm-core 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", + "evm-gasometer 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", + "evm-runtime 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "primitive-types", @@ -2193,6 +2211,16 @@ dependencies = [ "syn", ] +[[package]] +name = "evm-core" +version = "0.35.0" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24#e9252ed42dc26fc85b6703b1ba50660a08209e55" +dependencies = [ + "parity-scale-codec 3.1.5", + "primitive-types", + "scale-info", +] + [[package]] name = "evm-core" version = "0.35.0" @@ -2204,15 +2232,36 @@ dependencies = [ "serde", ] +[[package]] +name = "evm-gasometer" +version = "0.35.0" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24#e9252ed42dc26fc85b6703b1ba50660a08209e55" +dependencies = [ + "evm-core 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", + "evm-runtime 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", + "primitive-types", +] + [[package]] name = "evm-gasometer" version = "0.35.0" source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "environmental", - "evm-core", - "evm-runtime", + "evm-core 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", + "evm-runtime 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", + "primitive-types", +] + +[[package]] +name = "evm-runtime" +version = "0.35.0" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24#e9252ed42dc26fc85b6703b1ba50660a08209e55" +dependencies = [ + "auto_impl", + "evm-core 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", "primitive-types", + "sha3 0.10.2", ] [[package]] @@ -2222,7 +2271,7 @@ source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.2 dependencies = [ "auto_impl", "environmental", - "evm-core", + "evm-core 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", "primitive-types", "sha3 0.10.2", ] @@ -2318,11 +2367,11 @@ dependencies = [ "fp-rpc", "sc-client-api", "sc-consensus", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-block-builder", "sp-blockchain", "sp-consensus", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -2337,9 +2386,9 @@ dependencies = [ "parity-scale-codec 3.1.5", "parking_lot 0.12.1", "sc-client-db", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-database", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -2354,9 +2403,9 @@ dependencies = [ "futures-timer", "log", "sc-client-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -2366,7 +2415,7 @@ source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v dependencies = [ "ethereum", "ethereum-types", - "evm", + "evm 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", "fc-db", "fc-rpc-core", "fp-rpc", @@ -2388,13 +2437,13 @@ dependencies = [ "sc-service", "sc-transaction-pool", "sc-transaction-pool-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-block-builder", "sp-blockchain", - "sp-core", - "sp-io", - "sp-runtime", - "sp-storage", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-prometheus-endpoint", "tokio", ] @@ -2547,9 +2596,22 @@ source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v dependencies = [ "ethereum", "parity-scale-codec 3.1.5", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", +] + +[[package]] +name = "fp-evm" +version = "3.0.0-dev" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +dependencies = [ + "evm 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "impl-trait-for-tuples", + "parity-scale-codec 3.1.5", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", ] [[package]] @@ -2557,13 +2619,22 @@ name = "fp-evm" version = "3.0.0-dev" source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ - "evm", - "frame-support", + "evm 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "impl-trait-for-tuples", "parity-scale-codec 3.1.5", "serde", - "sp-core", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", +] + +[[package]] +name = "fp-evm-mapping" +version = "0.1.0" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +dependencies = [ + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", ] [[package]] @@ -2571,8 +2642,8 @@ name = "fp-evm-mapping" version = "0.1.0" source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ - "frame-support", - "sp-core", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -2582,14 +2653,14 @@ source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v dependencies = [ "ethereum", "ethereum-types", - "fp-evm", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-api", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -2598,14 +2669,14 @@ version = "1.0.0-dev" source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "ethereum", - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "parity-util-mem", "scale-info", "serde", - "sp-debug-derive", - "sp-io", - "sp-runtime", + "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -2616,26 +2687,48 @@ dependencies = [ "parity-scale-codec 3.1.5", ] +[[package]] +name = "frame-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "linregress", + "log", + "parity-scale-codec 3.1.5", + "paste", + "scale-info", + "serde", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", +] + [[package]] name = "frame-benchmarking" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "linregress", "log", "parity-scale-codec 3.1.5", "paste", "scale-info", "serde", - "sp-api", - "sp-application-crypto", - "sp-io", - "sp-runtime", - "sp-runtime-interface", - "sp-std", - "sp-storage", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -2647,9 +2740,9 @@ dependencies = [ "chrono", "clap", "comfy-table", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "gethostname", "handlebars", "hash-db", @@ -2673,17 +2766,17 @@ dependencies = [ "serde", "serde_json", "serde_nanos", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-database", - "sp-externalities", - "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "sp-storage", - "sp-trie", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tempfile", "thiserror", "thousands", @@ -2706,14 +2799,14 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-election-provider-solution-type", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-arithmetic", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-npos-elections", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -2721,15 +2814,15 @@ name = "frame-executive" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "sp-tracing", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -2744,6 +2837,36 @@ dependencies = [ "serde", ] +[[package]] +name = "frame-support" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "bitflags", + "frame-metadata", + "frame-support-procedural 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "impl-trait-for-tuples", + "k256", + "log", + "once_cell", + "parity-scale-codec 3.1.5", + "paste", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-core-hashing-proc-macro 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "tt-call", +] + [[package]] name = "frame-support" version = "4.0.0-dev" @@ -2751,7 +2874,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "bitflags", "frame-metadata", - "frame-support-procedural", + "frame-support-procedural 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "impl-trait-for-tuples", "k256", "log", @@ -2761,26 +2884,50 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-arithmetic", - "sp-core", - "sp-core-hashing-proc-macro", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-state-machine", - "sp-std", - "sp-tracing", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core-hashing-proc-macro 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tt-call", ] +[[package]] +name = "frame-support-procedural" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "Inflector", + "frame-support-procedural-tools 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "frame-support-procedural" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "Inflector", - "frame-support-procedural-tools", + "frame-support-procedural-tools 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "frame-support-procedural-tools-derive 3.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -2791,13 +2938,23 @@ name = "frame-support-procedural-tools" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support-procedural-tools-derive", + "frame-support-procedural-tools-derive 3.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "proc-macro-crate", "proc-macro2", "quote", "syn", ] +[[package]] +name = "frame-support-procedural-tools-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" @@ -2808,21 +2965,38 @@ dependencies = [ "syn", ] +[[package]] +name = "frame-system" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", +] + [[package]] name = "frame-system" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "sp-version", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -2830,14 +3004,14 @@ name = "frame-system-benchmarking" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -2846,7 +3020,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -2854,10 +3028,10 @@ name = "frame-try-runtime" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support", - "sp-api", - "sp-runtime", - "sp-std", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -3735,11 +3909,11 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017 dependencies = [ "beefy-primitives", "bitvec 1.0.1", - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-election-provider-support", "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", @@ -3750,7 +3924,7 @@ dependencies = [ "pallet-authorship", "pallet-babe", "pallet-bags-list", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-bounties", "pallet-child-bounties", "pallet-collective", @@ -3779,7 +3953,7 @@ dependencies = [ "pallet-society", "pallet-staking", "pallet-staking-reward-fn", - "pallet-timestamp", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-tips", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", @@ -3797,23 +3971,23 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "sp-api", - "sp-arithmetic", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-io", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-mmr-primitives", "sp-npos-elections", "sp-offchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-transaction-pool", - "sp-version", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "static_assertions", "substrate-wasm-builder", "xcm", @@ -3826,11 +4000,11 @@ name = "kusama-runtime-constants" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "polkadot-primitives", "polkadot-runtime-common", "smallvec", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5137,26 +5311,27 @@ dependencies = [ "cumulus-primitives-utility", "derivative", "evm-coder", - "fp-evm-mapping", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "fp-rpc", "fp-self-contained", - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", "hex-literal", "log", "orml-vesting", + "pallet-app-promotion", "pallet-aura", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-base-fee", "pallet-common", "pallet-configuration", "pallet-ethereum", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "pallet-evm-coder-substrate", "pallet-evm-contract-helpers", "pallet-evm-migration", @@ -5164,14 +5339,14 @@ dependencies = [ "pallet-fungible", "pallet-inflation", "pallet-nonfungible", - "pallet-randomness-collective-flip", + "pallet-randomness-collective-flip 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-refungible", "pallet-rmrk-core", "pallet-rmrk-equip", "pallet-structure", "pallet-sudo", "pallet-template-transaction-payment", - "pallet-timestamp", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", @@ -5185,19 +5360,19 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-api", - "sp-arithmetic", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-block-builder", "sp-consensus-aura", - "sp-core", - "sp-inherents", - "sp-io", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-offchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-std", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-transaction-pool", - "sp-version", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-wasm-builder", "up-common", "up-data-structs", @@ -5270,14 +5445,14 @@ name = "orml-vesting" version = "0.4.1-dev" source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5295,20 +5470,40 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "pallet-app-promotion" +version = "0.1.0" +dependencies = [ + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24)", + "pallet-randomness-collective-flip 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", +] + [[package]] name = "pallet-aura" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support", - "frame-system", - "pallet-timestamp", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-application-crypto", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-consensus-aura", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5316,15 +5511,15 @@ name = "pallet-authority-discovery" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-session", "parity-scale-codec 3.1.5", "scale-info", - "sp-application-crypto", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-authority-discovery", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5332,14 +5527,14 @@ name = "pallet-authorship" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "impl-trait-for-tuples", "parity-scale-codec 3.1.5", "scale-info", "sp-authorship", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5347,23 +5542,23 @@ name = "pallet-babe" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "pallet-authorship", "pallet-session", - "pallet-timestamp", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-application-crypto", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-consensus-babe", "sp-consensus-vrf", - "sp-io", - "sp-runtime", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5371,19 +5566,34 @@ name = "pallet-bags-list" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-election-provider-support", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "sp-tracing", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", +] + +[[package]] +name = "pallet-balances" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", ] [[package]] @@ -5391,14 +5601,14 @@ name = "pallet-balances" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5406,14 +5616,14 @@ name = "pallet-base-fee" version = "1.0.0" source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ - "fp-evm", - "frame-support", - "frame-system", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5422,14 +5632,14 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "beefy-primitives", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-session", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5439,8 +5649,8 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "beefy-merkle-tree", "beefy-primitives", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "hex", "log", "pallet-beefy", @@ -5449,10 +5659,10 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5460,17 +5670,17 @@ name = "pallet-bounties" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "pallet-treasury", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5478,18 +5688,18 @@ name = "pallet-child-bounties" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "pallet-bounties", "pallet-treasury", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5497,16 +5707,16 @@ name = "pallet-collective" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5515,18 +5725,18 @@ version = "0.1.8" dependencies = [ "ethereum", "evm-coder", - "fp-evm-mapping", - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-evm", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "pallet-evm-coder-substrate", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "up-data-structs", ] @@ -5534,16 +5744,16 @@ dependencies = [ name = "pallet-configuration" version = "0.1.1" dependencies = [ - "fp-evm", - "frame-support", - "frame-system", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", "smallvec", - "sp-arithmetic", - "sp-core", - "sp-runtime", - "sp-std", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5551,15 +5761,15 @@ name = "pallet-democracy" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5567,20 +5777,20 @@ name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-election-provider-support", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "rand 0.7.3", "scale-info", - "sp-arithmetic", - "sp-core", - "sp-io", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-npos-elections", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "static_assertions", "strum", ] @@ -5590,12 +5800,12 @@ name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-election-provider-support", - "frame-system", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "sp-npos-elections", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5603,17 +5813,17 @@ name = "pallet-elections-phragmen" version = "5.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-npos-elections", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5623,26 +5833,51 @@ source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v dependencies = [ "ethereum", "ethereum-types", - "evm", + "evm 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", "fp-consensus", - "fp-evm", - "fp-evm-mapping", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "fp-rpc", "fp-self-contained", "fp-storage", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", - "pallet-evm", - "pallet-timestamp", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "rlp", "scale-info", "serde", "sha3 0.10.2", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", +] + +[[package]] +name = "pallet-evm" +version = "6.0.0-dev" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" +dependencies = [ + "evm 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24)", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "hex", + "impl-trait-for-tuples", + "log", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "parity-scale-codec 3.1.5", + "primitive-types", + "rlp", + "scale-info", + "sha3 0.10.2", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", ] [[package]] @@ -5650,26 +5885,26 @@ name = "pallet-evm" version = "6.0.0-dev" source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ - "evm", - "fp-evm", - "fp-evm-mapping", - "frame-benchmarking", - "frame-support", - "frame-system", + "evm 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "hex", "impl-trait-for-tuples", "log", - "pallet-timestamp", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "primitive-types", "rlp", "scale-info", "serde", "sha3 0.10.2", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5678,15 +5913,15 @@ version = "0.1.3" dependencies = [ "ethereum", "evm-coder", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-ethereum", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "up-data-structs", ] @@ -5695,18 +5930,18 @@ name = "pallet-evm-contract-helpers" version = "0.2.0" dependencies = [ "evm-coder", - "fp-evm-mapping", - "frame-support", - "frame-system", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "pallet-evm-coder-substrate", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "up-data-structs", "up-sponsorship", ] @@ -5715,35 +5950,35 @@ dependencies = [ name = "pallet-evm-migration" version = "0.1.1" dependencies = [ - "fp-evm", - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-evm", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] name = "pallet-evm-transaction-payment" version = "0.1.1" dependencies = [ - "fp-evm", - "fp-evm-mapping", - "frame-support", - "frame-system", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-ethereum", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "up-sponsorship", ] @@ -5753,18 +5988,18 @@ version = "0.1.5" dependencies = [ "ethereum", "evm-coder", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "pallet-evm-coder-substrate", "pallet-structure", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "up-data-structs", ] @@ -5773,14 +6008,14 @@ name = "pallet-gilt" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-arithmetic", - "sp-runtime", - "sp-std", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5788,22 +6023,22 @@ name = "pallet-grandpa" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "pallet-authorship", "pallet-session", "parity-scale-codec 3.1.5", "scale-info", - "sp-application-crypto", - "sp-core", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-finality-grandpa", - "sp-io", - "sp-runtime", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5812,14 +6047,14 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "enumflags2", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5827,19 +6062,19 @@ name = "pallet-im-online" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "pallet-authorship", "parity-scale-codec 3.1.5", "scale-info", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-std", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5847,35 +6082,35 @@ name = "pallet-indices" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-keyring", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] name = "pallet-inflation" version = "0.1.1" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-balances", - "pallet-randomness-collective-flip", - "pallet-timestamp", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-randomness-collective-flip 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5883,16 +6118,16 @@ name = "pallet-membership" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5901,16 +6136,16 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "ckb-merkle-mountain-range", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-mmr-primitives", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5921,11 +6156,11 @@ dependencies = [ "jsonrpsee", "parity-scale-codec 3.1.5", "serde", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-mmr-primitives", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5933,14 +6168,14 @@ name = "pallet-multisig" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5948,16 +6183,16 @@ name = "pallet-nomination-pools" version = "1.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5965,18 +6200,18 @@ name = "pallet-nomination-pools-benchmarking" version = "1.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-election-provider-support", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-bags-list", "pallet-nomination-pools", "pallet-staking", "parity-scale-codec 3.1.5", "scale-info", - "sp-runtime", - "sp-staking", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5985,8 +6220,8 @@ version = "1.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", - "sp-api", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -5995,18 +6230,18 @@ version = "0.1.5" dependencies = [ "ethereum", "evm-coder", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "pallet-evm-coder-substrate", "pallet-structure", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "struct-versioning", "up-data-structs", ] @@ -6016,16 +6251,16 @@ name = "pallet-offences" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-runtime", - "sp-staking", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6033,12 +6268,12 @@ name = "pallet-offences-benchmarking" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-election-provider-support", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-babe", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-grandpa", "pallet-im-online", "pallet-offences", @@ -6046,9 +6281,9 @@ dependencies = [ "pallet-staking", "parity-scale-codec 3.1.5", "scale-info", - "sp-runtime", - "sp-staking", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6056,15 +6291,15 @@ name = "pallet-preimage" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6072,14 +6307,28 @@ name = "pallet-proxy" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", +] + +[[package]] +name = "pallet-randomness-collective-flip" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "parity-scale-codec 3.1.5", + "safe-mix", + "scale-info", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", ] [[package]] @@ -6087,13 +6336,13 @@ name = "pallet-randomness-collective-flip" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "safe-mix", "scale-info", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6101,14 +6350,14 @@ name = "pallet-recovery" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6118,18 +6367,18 @@ dependencies = [ "derivative", "ethereum", "evm-coder", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "pallet-evm-coder-substrate", "pallet-structure", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "struct-versioning", "up-data-structs", ] @@ -6139,19 +6388,19 @@ name = "pallet-rmrk-core" version = "0.1.2" dependencies = [ "derivative", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "pallet-nonfungible", "pallet-structure", "parity-scale-codec 3.1.5", "rmrk-traits", "scale-info", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "up-data-structs", ] @@ -6159,19 +6408,19 @@ dependencies = [ name = "pallet-rmrk-equip" version = "0.1.2" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "pallet-nonfungible", "pallet-rmrk-core", "parity-scale-codec 3.1.5", "rmrk-traits", "scale-info", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "up-data-structs", ] @@ -6180,15 +6429,15 @@ name = "pallet-scheduler" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6196,20 +6445,20 @@ name = "pallet-session" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "impl-trait-for-tuples", "log", - "pallet-timestamp", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-staking", - "sp-std", - "sp-trie", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6217,15 +6466,15 @@ name = "pallet-session-benchmarking" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-session", "pallet-staking", "rand 0.7.3", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-std", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6233,13 +6482,13 @@ name = "pallet-society" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "rand_chacha 0.2.2", "scale-info", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6247,10 +6496,10 @@ name = "pallet-staking" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-election-provider-support", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "pallet-authorship", "pallet-session", @@ -6258,11 +6507,11 @@ dependencies = [ "rand_chacha 0.2.2", "scale-info", "serde", - "sp-application-crypto", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-std", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6282,21 +6531,21 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "log", - "sp-arithmetic", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] name = "pallet-structure" version = "0.1.2" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-std", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "up-data-structs", ] @@ -6305,13 +6554,13 @@ name = "pallet-sudo" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6319,37 +6568,54 @@ name = "pallet-template-transaction-payment" version = "3.0.0" source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-balances", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-transaction-payment", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "up-sponsorship", ] +[[package]] +name = "pallet-timestamp" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", +] + [[package]] name = "pallet-timestamp" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-std", - "sp-timestamp", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6357,18 +6623,18 @@ name = "pallet-tips" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "pallet-treasury", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6376,15 +6642,15 @@ name = "pallet-transaction-payment" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6395,11 +6661,11 @@ dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec 3.1.5", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-rpc", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6409,8 +6675,8 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "pallet-transaction-payment", "parity-scale-codec 3.1.5", - "sp-api", - "sp-runtime", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6418,16 +6684,16 @@ name = "pallet-treasury" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "impl-trait-for-tuples", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6436,21 +6702,21 @@ version = "0.1.3" dependencies = [ "ethereum", "evm-coder", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "pallet-evm-coder-substrate", "pallet-nonfungible", "pallet-refungible", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "up-data-structs", ] @@ -6458,17 +6724,17 @@ dependencies = [ name = "pallet-unique-scheduler" version = "0.1.1" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-test-utils", "up-sponsorship", ] @@ -6478,15 +6744,15 @@ name = "pallet-utility" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6494,14 +6760,14 @@ name = "pallet-vesting" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -6509,15 +6775,15 @@ name = "pallet-xcm" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "xcm", "xcm-executor", ] @@ -6527,14 +6793,14 @@ name = "pallet-xcm-benchmarks" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "xcm", "xcm-executor", ] @@ -6545,8 +6811,8 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "scale-info", "serde", @@ -6913,8 +7179,8 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "rand 0.8.5", - "sp-core", - "sp-keystore", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", "tracing-gum", ] @@ -6958,9 +7224,9 @@ dependencies = [ "sc-service", "sc-sysinfo", "sc-tracing", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-keyring", - "sp-trie", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-build-script-utils", "thiserror", "try-runtime-cli", @@ -6972,9 +7238,9 @@ version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "beefy-primitives", - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-benchmarking-cli", - "frame-system", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-system-rpc-runtime-api", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", @@ -6987,22 +7253,22 @@ dependencies = [ "sc-consensus", "sc-executor", "sc-service", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-authority-discovery", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-finality-grandpa", - "sp-inherents", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-keyring", "sp-mmr-primitives", "sp-offchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-storage", - "sp-timestamp", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-transaction-pool", ] @@ -7020,9 +7286,9 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-core", - "sp-keystore", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", "tracing-gum", ] @@ -7035,9 +7301,9 @@ dependencies = [ "parity-scale-codec 3.1.5", "parity-util-mem", "scale-info", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -7057,8 +7323,8 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "sc-network", - "sp-application-crypto", - "sp-keystore", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", "tracing-gum", ] @@ -7072,8 +7338,8 @@ dependencies = [ "polkadot-node-primitives", "polkadot-primitives", "reed-solomon-novelpoly", - "sp-core", - "sp-trie", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -7091,9 +7357,9 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "sc-network", - "sp-application-crypto", - "sp-core", - "sp-keystore", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tracing-gum", ] @@ -7132,7 +7398,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-maybe-compressed-blob", "thiserror", "tracing-gum", @@ -7159,10 +7425,10 @@ dependencies = [ "polkadot-primitives", "sc-keystore", "schnorrkel", - "sp-application-crypto", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-consensus", "sp-consensus-slots", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", "tracing-gum", ] @@ -7201,7 +7467,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "polkadot-statement-table", - "sp-keystore", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", "tracing-gum", ] @@ -7215,7 +7481,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-keystore", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", "tracing-gum", "wasm-timer", @@ -7301,8 +7567,8 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-primitives", "sp-blockchain", - "sp-inherents", - "sp-runtime", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", "tracing-gum", ] @@ -7347,12 +7613,12 @@ dependencies = [ "sc-executor-common", "sc-executor-wasmtime", "slotmap", - "sp-core", - "sp-externalities", - "sp-io", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-maybe-compressed-blob", - "sp-tracing", - "sp-wasm-interface", + "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tempfile", "tracing-gum", ] @@ -7368,7 +7634,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-primitives", - "sp-keystore", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", "tracing-gum", ] @@ -7403,7 +7669,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-primitives", "sc-network", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -7459,11 +7725,11 @@ dependencies = [ "polkadot-primitives", "schnorrkel", "serde", - "sp-application-crypto", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-consensus-babe", "sp-consensus-vrf", - "sp-core", - "sp-keystore", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-maybe-compressed-blob", "thiserror", "zstd", @@ -7495,7 +7761,7 @@ dependencies = [ "polkadot-statement-table", "sc-network", "smallvec", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-authority-discovery", "sp-consensus-babe", "substrate-prometheus-endpoint", @@ -7528,9 +7794,9 @@ dependencies = [ "polkadot-primitives", "prioritized-metered-channel", "rand 0.8.5", - "sp-application-crypto", - "sp-core", - "sp-keystore", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", "tracing-gum", ] @@ -7553,8 +7819,8 @@ dependencies = [ "polkadot-node-subsystem-types", "polkadot-primitives", "sc-client-api", - "sp-api", - "sp-core", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tracing-gum", ] @@ -7564,15 +7830,15 @@ version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "derive_more", - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "parity-util-mem", "polkadot-core-primitives", "scale-info", "serde", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -7596,7 +7862,7 @@ version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "bitvec 1.0.1", - "frame-system", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "hex-literal", "parity-scale-codec 3.1.5", "parity-util-mem", @@ -7604,20 +7870,20 @@ dependencies = [ "polkadot-parachain", "scale-info", "serde", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-authority-discovery", "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-staking", - "sp-std", - "sp-trie", - "sp-version", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -7641,13 +7907,13 @@ dependencies = [ "sc-rpc", "sc-sync-state-rpc", "sc-transaction-pool-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", - "sp-keystore", - "sp-runtime", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-frame-rpc-system", "substrate-state-trie-migration-rpc", ] @@ -7659,11 +7925,11 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017 dependencies = [ "beefy-primitives", "bitvec 1.0.1", - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-election-provider-support", "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", @@ -7673,7 +7939,7 @@ dependencies = [ "pallet-authorship", "pallet-babe", "pallet-bags-list", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-bounties", "pallet-child-bounties", "pallet-collective", @@ -7696,7 +7962,7 @@ dependencies = [ "pallet-session-benchmarking", "pallet-staking", "pallet-staking-reward-curve", - "pallet-timestamp", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-tips", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", @@ -7714,22 +7980,22 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-io", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-mmr-primitives", "sp-npos-elections", "sp-offchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-transaction-pool", - "sp-version", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "static_assertions", "substrate-wasm-builder", "xcm", @@ -7744,22 +8010,22 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017 dependencies = [ "beefy-primitives", "bitvec 1.0.1", - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-election-provider-support", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "impl-trait-for-tuples", "libsecp256k1", "log", "pallet-authorship", "pallet-babe", "pallet-bags-list", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-beefy-mmr", "pallet-election-provider-multi-phase", "pallet-session", "pallet-staking", - "pallet-timestamp", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-transaction-payment", "pallet-treasury", "pallet-vesting", @@ -7771,15 +8037,15 @@ dependencies = [ "serde", "serde_derive", "slot-range-helper", - "sp-api", - "sp-core", - "sp-inherents", - "sp-io", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-npos-elections", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "static_assertions", "xcm", ] @@ -7789,11 +8055,11 @@ name = "polkadot-runtime-constants" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "polkadot-primitives", "polkadot-runtime-common", "smallvec", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -7804,8 +8070,8 @@ dependencies = [ "bs58", "parity-scale-codec 3.1.5", "polkadot-primitives", - "sp-std", - "sp-tracing", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -7816,17 +8082,17 @@ dependencies = [ "bitflags", "bitvec 1.0.1", "derive_more", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "pallet-authority-discovery", "pallet-authorship", "pallet-babe", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-session", "pallet-staking", - "pallet-timestamp", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-vesting", "parity-scale-codec 3.1.5", "polkadot-primitives", @@ -7836,16 +8102,16 @@ dependencies = [ "rustc-hex", "scale-info", "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "static_assertions", "xcm", "xcm-executor", @@ -7929,25 +8195,25 @@ dependencies = [ "sc-transaction-pool", "serde", "serde_json", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-authority-discovery", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-finality-grandpa", - "sp-inherents", - "sp-io", - "sp-keystore", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-offchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-state-machine", - "sp-storage", - "sp-timestamp", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-transaction-pool", - "sp-trie", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-prometheus-endpoint", "thiserror", "tracing-gum", @@ -7969,8 +8235,8 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-keystore", - "sp-staking", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", "tracing-gum", ] @@ -7982,7 +8248,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017 dependencies = [ "parity-scale-codec 3.1.5", "polkadot-primitives", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -7994,14 +8260,14 @@ dependencies = [ "bitvec 1.0.1", "frame-election-provider-support", "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-system-rpc-runtime-api", "log", "pallet-authority-discovery", "pallet-authorship", "pallet-babe", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-grandpa", "pallet-indices", "pallet-offences", @@ -8009,7 +8275,7 @@ dependencies = [ "pallet-staking", "pallet-staking-reward-curve", "pallet-sudo", - "pallet-timestamp", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-vesting", @@ -8024,21 +8290,21 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-io", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-mmr-primitives", "sp-offchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-transaction-pool", - "sp-version", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-wasm-builder", "test-runtime-constants", "xcm", @@ -8051,11 +8317,11 @@ name = "polkadot-test-service" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-benchmarking", - "frame-system", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "futures 0.3.23", "hex", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-staking", "pallet-transaction-payment", "polkadot-node-primitives", @@ -8081,17 +8347,17 @@ dependencies = [ "sc-service", "sc-tracing", "sc-transaction-pool", - "sp-arithmetic", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-authority-discovery", "sp-blockchain", "sp-consensus", "sp-consensus-babe", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-finality-grandpa", - "sp-inherents", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-keyring", - "sp-runtime", - "sp-state-machine", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-test-client", "tempfile", "test-runtime-constants", @@ -8342,13 +8608,13 @@ dependencies = [ "cumulus-primitives-utility", "derivative", "evm-coder", - "fp-evm-mapping", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "fp-rpc", "fp-self-contained", - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", @@ -8356,12 +8622,12 @@ dependencies = [ "log", "orml-vesting", "pallet-aura", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-base-fee", "pallet-common", "pallet-configuration", "pallet-ethereum", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "pallet-evm-coder-substrate", "pallet-evm-contract-helpers", "pallet-evm-migration", @@ -8369,14 +8635,14 @@ dependencies = [ "pallet-fungible", "pallet-inflation", "pallet-nonfungible", - "pallet-randomness-collective-flip", + "pallet-randomness-collective-flip 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-refungible", "pallet-rmrk-core", "pallet-rmrk-equip", "pallet-structure", "pallet-sudo", "pallet-template-transaction-payment", - "pallet-timestamp", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", @@ -8390,19 +8656,19 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-api", - "sp-arithmetic", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-block-builder", "sp-consensus-aura", - "sp-core", - "sp-inherents", - "sp-io", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-offchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-std", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-transaction-pool", - "sp-version", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-wasm-builder", "up-common", "up-data-structs", @@ -8695,10 +8961,10 @@ dependencies = [ "parity-scale-codec 3.1.5", "serde", "serde_json", - "sp-core", - "sp-io", - "sp-runtime", - "sp-version", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -8780,10 +9046,10 @@ dependencies = [ "parity-scale-codec 2.3.1", "rmrk-traits", "serde", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -8812,10 +9078,10 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017 dependencies = [ "beefy-merkle-tree", "beefy-primitives", - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "hex-literal", @@ -8823,7 +9089,7 @@ dependencies = [ "pallet-authority-discovery", "pallet-authorship", "pallet-babe", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-beefy", "pallet-beefy-mmr", "pallet-collective", @@ -8838,7 +9104,7 @@ dependencies = [ "pallet-session", "pallet-staking", "pallet-sudo", - "pallet-timestamp", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-utility", @@ -8853,21 +9119,21 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-io", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-mmr-primitives", "sp-offchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-transaction-pool", - "sp-version", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-wasm-builder", "xcm", "xcm-builder", @@ -8879,11 +9145,11 @@ name = "rococo-runtime-constants" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "polkadot-primitives", "polkadot-runtime-common", "smallvec", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -9064,8 +9330,8 @@ version = "4.1.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "log", - "sp-core", - "sp-wasm-interface", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -9086,12 +9352,12 @@ dependencies = [ "rand 0.7.3", "sc-client-api", "sc-network", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-authority-discovery", "sp-blockchain", - "sp-core", - "sp-keystore", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-prometheus-endpoint", "thiserror", ] @@ -9110,12 +9376,12 @@ dependencies = [ "sc-proposer-metrics", "sc-telemetry", "sc-transaction-pool-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-inherents", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-prometheus-endpoint", ] @@ -9126,13 +9392,13 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "parity-scale-codec 3.1.5", "sc-client-api", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-block-builder", "sp-blockchain", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -9148,8 +9414,8 @@ dependencies = [ "sc-telemetry", "serde", "serde_json", - "sp-core", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -9191,12 +9457,12 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-keyring", - "sp-keystore", - "sp-panic-handler", - "sp-runtime", - "sp-version", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-panic-handler 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", "tiny-bip39", "tokio", @@ -9216,17 +9482,17 @@ dependencies = [ "sc-executor", "sc-transaction-pool-api", "sc-utils", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", "sp-consensus", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-database", - "sp-externalities", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "sp-storage", - "sp-trie", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-prometheus-endpoint", ] @@ -9246,13 +9512,13 @@ dependencies = [ "parking_lot 0.12.1", "sc-client-api", "sc-state-db", - "sp-arithmetic", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-database", - "sp-runtime", - "sp-state-machine", - "sp-trie", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -9269,12 +9535,12 @@ dependencies = [ "sc-client-api", "sc-utils", "serde", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-runtime", - "sp-state-machine", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-prometheus-endpoint", "thiserror", ] @@ -9293,17 +9559,17 @@ dependencies = [ "sc-consensus", "sc-consensus-slots", "sc-telemetry", - "sp-api", - "sp-application-crypto", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-keystore", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-prometheus-endpoint", "thiserror", ] @@ -9333,20 +9599,20 @@ dependencies = [ "sc-telemetry", "schnorrkel", "serde", - "sp-api", - "sp-application-crypto", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", "sp-consensus-slots", "sp-consensus-vrf", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-version", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-prometheus-endpoint", "thiserror", ] @@ -9362,14 +9628,14 @@ dependencies = [ "sc-consensus-epochs", "sc-rpc-api", "serde", - "sp-api", - "sp-application-crypto", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", "sp-consensus", "sp-consensus-babe", - "sp-core", - "sp-keystore", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -9383,7 +9649,7 @@ dependencies = [ "sc-client-api", "sc-consensus", "sp-blockchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -9405,17 +9671,17 @@ dependencies = [ "sc-transaction-pool", "sc-transaction-pool-api", "serde", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", "sp-consensus", "sp-consensus-aura", "sp-consensus-babe", "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-timestamp", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-prometheus-endpoint", "thiserror", ] @@ -9433,15 +9699,15 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-telemetry", - "sp-arithmetic", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", "sp-consensus", "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", - "sp-timestamp", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -9452,7 +9718,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "sc-client-api", "sp-authorship", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -9468,17 +9734,17 @@ dependencies = [ "sc-executor-common", "sc-executor-wasmi", "sc-executor-wasmtime", - "sp-api", - "sp-core", - "sp-core-hashing-proc-macro", - "sp-externalities", - "sp-io", - "sp-panic-handler", - "sp-runtime-interface", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core-hashing-proc-macro 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-panic-handler 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-tasks", - "sp-trie", - "sp-version", - "sp-wasm-interface", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tracing", "wasmi", ] @@ -9494,7 +9760,7 @@ dependencies = [ "sp-maybe-compressed-blob", "sp-sandbox", "sp-serializer", - "sp-wasm-interface", + "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", "wasm-instrument", "wasmi", @@ -9509,9 +9775,9 @@ dependencies = [ "parity-scale-codec 3.1.5", "sc-allocator", "sc-executor-common", - "sp-runtime-interface", + "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-sandbox", - "sp-wasm-interface", + "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "wasmi", ] @@ -9529,9 +9795,9 @@ dependencies = [ "rustix 0.35.7", "sc-allocator", "sc-executor-common", - "sp-runtime-interface", + "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-sandbox", - "sp-wasm-interface", + "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "wasmtime", ] @@ -9563,15 +9829,15 @@ dependencies = [ "sc-telemetry", "sc-utils", "serde_json", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", "sp-consensus", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-finality-grandpa", - "sp-keystore", - "sp-runtime", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-prometheus-endpoint", "thiserror", ] @@ -9592,8 +9858,8 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -9611,7 +9877,7 @@ dependencies = [ "sc-network", "sc-transaction-pool-api", "sp-blockchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -9623,9 +9889,9 @@ dependencies = [ "hex", "parking_lot 0.12.1", "serde_json", - "sp-application-crypto", - "sp-core", - "sp-keystore", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -9666,11 +9932,11 @@ dependencies = [ "serde", "serde_json", "smallvec", - "sp-arithmetic", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-prometheus-endpoint", "thiserror", "unsigned-varint", @@ -9693,7 +9959,7 @@ dependencies = [ "smallvec", "sp-consensus", "sp-finality-grandpa", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -9708,7 +9974,7 @@ dependencies = [ "log", "lru 0.7.8", "sc-network", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-prometheus-endpoint", "tracing", ] @@ -9728,8 +9994,8 @@ dependencies = [ "sc-network-common", "sc-peerset", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -9751,12 +10017,12 @@ dependencies = [ "sc-network-common", "sc-peerset", "smallvec", - "sp-arithmetic", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", "sp-consensus", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-finality-grandpa", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -9780,10 +10046,10 @@ dependencies = [ "sc-client-api", "sc-network", "sc-utils", - "sp-api", - "sp-core", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-offchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "threadpool", "tracing", ] @@ -9829,15 +10095,15 @@ dependencies = [ "sc-transaction-pool-api", "sc-utils", "serde_json", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", - "sp-core", - "sp-keystore", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-offchain", "sp-rpc", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-version", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -9855,11 +10121,11 @@ dependencies = [ "scale-info", "serde", "serde_json", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-rpc", - "sp-runtime", - "sp-tracing", - "sp-version", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -9917,24 +10183,24 @@ dependencies = [ "sc-utils", "serde", "serde_json", - "sp-api", - "sp-application-crypto", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-block-builder", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-externalities", - "sp-inherents", - "sp-keystore", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-state-machine", - "sp-storage", - "sp-tracing", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-transaction-pool", "sp-transaction-storage-proof", - "sp-trie", - "sp-version", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-prometheus-endpoint", "tempfile", "thiserror", @@ -9954,7 +10220,7 @@ dependencies = [ "parity-util-mem-derive", "parking_lot 0.12.1", "sc-client-api", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -9972,7 +10238,7 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -9990,9 +10256,9 @@ dependencies = [ "sc-telemetry", "serde", "serde_json", - "sp-core", - "sp-io", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -10032,12 +10298,12 @@ dependencies = [ "sc-rpc-server", "sc-tracing-proc-macro", "serde", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-rpc", - "sp-runtime", - "sp-tracing", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", "tracing", "tracing-log", @@ -10072,11 +10338,11 @@ dependencies = [ "sc-transaction-pool-api", "sc-utils", "serde", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", - "sp-core", - "sp-runtime", - "sp-tracing", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-transaction-pool", "substrate-prometheus-endpoint", "thiserror", @@ -10091,7 +10357,7 @@ dependencies = [ "log", "serde", "sp-blockchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -10190,13 +10456,31 @@ dependencies = [ "zeroize", ] +[[package]] +name = "secp256k1" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c42e6f1735c5f00f51e43e28d6634141f2bcad10931b2609ddd74a86d751260" +dependencies = [ + "secp256k1-sys 0.4.2", +] + [[package]] name = "secp256k1" version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7649a0b3ffb32636e60c7ce0d70511eda9c52c658cd0634e194d5a19943aeff" dependencies = [ - "secp256k1-sys", + "secp256k1-sys 0.6.0", +] + +[[package]] +name = "secp256k1-sys" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957da2573cde917463ece3570eab4a0b3f19de6f1646cde62e6fd3868f566036" +dependencies = [ + "cc", ] [[package]] @@ -10474,8 +10758,8 @@ dependencies = [ "enumn", "parity-scale-codec 3.1.5", "paste", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -10542,6 +10826,23 @@ dependencies = [ "sha-1 0.9.8", ] +[[package]] +name = "sp-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec 3.1.5", + "sp-api-proc-macro 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "thiserror", +] + [[package]] name = "sp-api" version = "4.0.0-dev" @@ -10550,15 +10851,27 @@ dependencies = [ "hash-db", "log", "parity-scale-codec 3.1.5", - "sp-api-proc-macro", - "sp-core", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-version", + "sp-api-proc-macro 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] +[[package]] +name = "sp-api-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "blake2", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" @@ -10571,6 +10884,19 @@ dependencies = [ "syn", ] +[[package]] +name = "sp-application-crypto" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", +] + [[package]] name = "sp-application-crypto" version = "6.0.0" @@ -10579,9 +10905,24 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", +] + +[[package]] +name = "sp-arithmetic" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "static_assertions", ] [[package]] @@ -10594,8 +10935,8 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-debug-derive", - "sp-std", + "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "static_assertions", ] @@ -10606,10 +10947,10 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "parity-scale-codec 3.1.5", "scale-info", - "sp-api", - "sp-application-crypto", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -10619,9 +10960,9 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "async-trait", "parity-scale-codec 3.1.5", - "sp-inherents", - "sp-runtime", - "sp-std", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -10630,10 +10971,10 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", - "sp-api", - "sp-inherents", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -10646,11 +10987,11 @@ dependencies = [ "lru 0.7.8", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-consensus", "sp-database", - "sp-runtime", - "sp-state-machine", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -10664,12 +11005,12 @@ dependencies = [ "futures-timer", "log", "parity-scale-codec 3.1.5", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-version", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -10681,14 +11022,14 @@ dependencies = [ "async-trait", "parity-scale-codec 3.1.5", "scale-info", - "sp-api", - "sp-application-crypto", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-consensus", "sp-consensus-slots", - "sp-inherents", - "sp-runtime", - "sp-std", - "sp-timestamp", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -10701,17 +11042,17 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-api", - "sp-application-crypto", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-consensus", "sp-consensus-slots", "sp-consensus-vrf", - "sp-core", - "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-std", - "sp-timestamp", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -10722,10 +11063,10 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-arithmetic", - "sp-runtime", - "sp-std", - "sp-timestamp", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -10736,9 +11077,55 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "schnorrkel", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", +] + +[[package]] +name = "sp-core" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "base58", + "bitflags", + "blake2-rfc", + "byteorder", + "dyn-clonable", + "ed25519-dalek", + "futures 0.3.23", + "hash-db", + "hash256-std-hasher", + "hex", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin", + "num-traits", + "parity-scale-codec 3.1.5", + "parity-util-mem", + "parking_lot 0.12.1", + "primitive-types", + "rand 0.7.3", + "regex", + "scale-info", + "schnorrkel", + "secp256k1 0.21.3", + "secrecy", + "serde", + "sp-core-hashing 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "ss58-registry", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "wasmi", + "zeroize", ] [[package]] @@ -10770,15 +11157,15 @@ dependencies = [ "regex", "scale-info", "schnorrkel", - "secp256k1", + "secp256k1 0.24.0", "secrecy", "serde", - "sp-core-hashing", - "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", - "sp-std", - "sp-storage", + "sp-core-hashing 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "ss58-registry", "substrate-bip39", "thiserror", @@ -10787,6 +11174,20 @@ dependencies = [ "zeroize", ] +[[package]] +name = "sp-core-hashing" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "blake2", + "byteorder", + "digest 0.10.3", + "sha2 0.10.2", + "sha3 0.10.2", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "twox-hash", +] + [[package]] name = "sp-core-hashing" version = "4.0.0" @@ -10797,10 +11198,21 @@ dependencies = [ "digest 0.10.3", "sha2 0.10.2", "sha3 0.10.2", - "sp-std", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "twox-hash", ] +[[package]] +name = "sp-core-hashing-proc-macro" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "proc-macro2", + "quote", + "sp-core-hashing 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "syn", +] + [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" @@ -10808,7 +11220,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "proc-macro2", "quote", - "sp-core-hashing", + "sp-core-hashing 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "syn", ] @@ -10821,6 +11233,16 @@ dependencies = [ "parking_lot 0.12.1", ] +[[package]] +name = "sp-debug-derive" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "sp-debug-derive" version = "4.0.0" @@ -10831,6 +11253,17 @@ dependencies = [ "syn", ] +[[package]] +name = "sp-externalities" +version = "0.12.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "environmental", + "parity-scale-codec 3.1.5", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", +] + [[package]] name = "sp-externalities" version = "0.12.0" @@ -10838,8 +11271,8 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "environmental", "parity-scale-codec 3.1.5", - "sp-std", - "sp-storage", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -10852,12 +11285,26 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", +] + +[[package]] +name = "sp-inherents" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec 3.1.5", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "thiserror", ] [[package]] @@ -10868,12 +11315,37 @@ dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec 3.1.5", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] +[[package]] +name = "sp-io" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "futures 0.3.23", + "hash-db", + "libsecp256k1", + "log", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "secp256k1 0.21.3", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "tracing", + "tracing-core", +] + [[package]] name = "sp-io" version = "6.0.0" @@ -10885,16 +11357,16 @@ dependencies = [ "log", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", - "secp256k1", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", - "sp-std", - "sp-tracing", - "sp-trie", - "sp-wasm-interface", + "secp256k1 0.24.0", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tracing", "tracing-core", ] @@ -10905,11 +11377,27 @@ version = "6.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "lazy_static", - "sp-core", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "strum", ] +[[package]] +name = "sp-keystore" +version = "0.12.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "async-trait", + "futures 0.3.23", + "merlin", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "schnorrkel", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "thiserror", +] + [[package]] name = "sp-keystore" version = "0.12.0" @@ -10922,8 +11410,8 @@ dependencies = [ "parking_lot 0.12.1", "schnorrkel", "serde", - "sp-core", - "sp-externalities", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] @@ -10944,11 +11432,11 @@ dependencies = [ "log", "parity-scale-codec 3.1.5", "serde", - "sp-api", - "sp-core", - "sp-debug-derive", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -10959,10 +11447,10 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-arithmetic", - "sp-core", - "sp-runtime", - "sp-std", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -10970,9 +11458,19 @@ name = "sp-offchain" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "sp-api", - "sp-core", - "sp-runtime", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", +] + +[[package]] +name = "sp-panic-handler" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "backtrace", + "lazy_static", + "regex", ] [[package]] @@ -10992,7 +11490,29 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "rustc-hash", "serde", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", +] + +[[package]] +name = "sp-runtime" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec 3.1.5", + "parity-util-mem", + "paste", + "rand 0.7.3", + "scale-info", + "serde", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", ] [[package]] @@ -11010,11 +11530,28 @@ dependencies = [ "rand 0.7.3", "scale-info", "serde", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-std", + "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", +] + +[[package]] +name = "sp-runtime-interface" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec 3.1.5", + "primitive-types", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-runtime-interface-proc-macro 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "static_assertions", ] [[package]] @@ -11025,15 +11562,27 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec 3.1.5", "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime-interface-proc-macro 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "static_assertions", ] +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "Inflector", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" @@ -11053,10 +11602,10 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "log", "parity-scale-codec 3.1.5", - "sp-core", - "sp-io", - "sp-std", - "sp-wasm-interface", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "wasmi", ] @@ -11076,11 +11625,22 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "parity-scale-codec 3.1.5", "scale-info", - "sp-api", - "sp-core", - "sp-runtime", - "sp-staking", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", +] + +[[package]] +name = "sp-staking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "parity-scale-codec 3.1.5", + "scale-info", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", ] [[package]] @@ -11090,8 +11650,30 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "parity-scale-codec 3.1.5", "scale-info", - "sp-runtime", - "sp-std", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", +] + +[[package]] +name = "sp-state-machine" +version = "0.12.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "hash-db", + "log", + "num-traits", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "rand 0.7.3", + "smallvec", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-panic-handler 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "thiserror", + "tracing", + "trie-root", ] [[package]] @@ -11106,21 +11688,39 @@ dependencies = [ "parking_lot 0.12.1", "rand 0.7.3", "smallvec", - "sp-core", - "sp-externalities", - "sp-panic-handler", - "sp-std", - "sp-trie", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-panic-handler 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", "tracing", "trie-root", ] +[[package]] +name = "sp-std" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" + [[package]] name = "sp-std" version = "4.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +[[package]] +name = "sp-storage" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "impl-serde", + "parity-scale-codec 3.1.5", + "ref-cast", + "serde", + "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", +] + [[package]] name = "sp-storage" version = "6.0.0" @@ -11130,8 +11730,8 @@ dependencies = [ "parity-scale-codec 3.1.5", "ref-cast", "serde", - "sp-debug-derive", - "sp-std", + "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -11140,11 +11740,27 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "log", - "sp-core", - "sp-externalities", - "sp-io", - "sp-runtime-interface", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", +] + +[[package]] +name = "sp-timestamp" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "async-trait", + "futures-timer", + "log", + "parity-scale-codec 3.1.5", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "thiserror", ] [[package]] @@ -11156,20 +11772,32 @@ dependencies = [ "futures-timer", "log", "parity-scale-codec 3.1.5", - "sp-api", - "sp-inherents", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] +[[package]] +name = "sp-tracing" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "parity-scale-codec 3.1.5", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "tracing", + "tracing-core", + "tracing-subscriber", +] + [[package]] name = "sp-tracing" version = "5.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", - "sp-std", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "tracing", "tracing-core", "tracing-subscriber", @@ -11180,8 +11808,8 @@ name = "sp-transaction-pool" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "sp-api", - "sp-runtime", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -11193,11 +11821,27 @@ dependencies = [ "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-std", - "sp-trie", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", +] + +[[package]] +name = "sp-trie" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "hash-db", + "memory-db", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "thiserror", + "trie-db", + "trie-root", ] [[package]] @@ -11209,13 +11853,30 @@ dependencies = [ "memory-db", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", "trie-db", "trie-root", ] +[[package]] +name = "sp-version" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "impl-serde", + "parity-scale-codec 3.1.5", + "parity-wasm 0.42.2", + "scale-info", + "serde", + "sp-core-hashing-proc-macro 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-version-proc-macro 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "thiserror", +] + [[package]] name = "sp-version" version = "5.0.0" @@ -11226,13 +11887,24 @@ dependencies = [ "parity-wasm 0.42.2", "scale-info", "serde", - "sp-core-hashing-proc-macro", - "sp-runtime", - "sp-std", - "sp-version-proc-macro", + "sp-core-hashing-proc-macro 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version-proc-macro 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "thiserror", ] +[[package]] +name = "sp-version-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "parity-scale-codec 3.1.5", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" @@ -11244,6 +11916,18 @@ dependencies = [ "syn", ] +[[package]] +name = "sp-wasm-interface" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" +dependencies = [ + "impl-trait-for-tuples", + "log", + "parity-scale-codec 3.1.5", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "wasmi", +] + [[package]] name = "sp-wasm-interface" version = "6.0.0" @@ -11252,7 +11936,7 @@ dependencies = [ "impl-trait-for-tuples", "log", "parity-scale-codec 3.1.5", - "sp-std", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "wasmi", "wasmtime", ] @@ -11399,11 +12083,11 @@ dependencies = [ "sc-rpc-api", "sc-transaction-pool-api", "serde_json", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-block-builder", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -11431,12 +12115,12 @@ dependencies = [ "sc-rpc-api", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-trie", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "trie-db", ] @@ -11459,11 +12143,11 @@ dependencies = [ "serde_json", "sp-blockchain", "sp-consensus", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-keyring", - "sp-keystore", - "sp-runtime", - "sp-state-machine", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -11594,11 +12278,11 @@ name = "test-runtime-constants" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "polkadot-primitives", "polkadot-runtime-common", "smallvec", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -11606,27 +12290,27 @@ name = "tests" version = "0.1.1" dependencies = [ "evm-coder", - "fp-evm-mapping", - "frame-support", - "frame-system", - "pallet-balances", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-common", "pallet-ethereum", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "pallet-evm-coder-substrate", "pallet-fungible", "pallet-nonfungible", "pallet-refungible", "pallet-structure", - "pallet-timestamp", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-transaction-payment", "pallet-unique", "parity-scale-codec 3.1.5", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "up-data-structs", "up-sponsorship", ] @@ -12067,13 +12751,13 @@ dependencies = [ "sc-executor", "sc-service", "serde", - "sp-core", - "sp-externalities", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "sp-version", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "zstd", ] @@ -12108,14 +12792,14 @@ dependencies = [ "anyhow", "jsonrpsee", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "rmrk-rpc", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-blockchain", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-rpc", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "up-data-structs", "up-rpc", ] @@ -12203,7 +12887,7 @@ dependencies = [ "fc-rpc-core", "flexi_logger", "fp-rpc", - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-benchmarking-cli", "futures 0.3.23", "jsonrpsee", @@ -12241,21 +12925,21 @@ dependencies = [ "sc-transaction-pool", "serde", "serde_json", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-finality-grandpa", - "sp-inherents", - "sp-keystore", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-offchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-timestamp", + "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-transaction-pool", - "sp-trie", + "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-build-script-utils", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", @@ -12298,16 +12982,16 @@ dependencies = [ "sc-service", "sc-transaction-pool", "serde", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", - "sp-core", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-offchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-storage", + "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-transaction-pool", "substrate-frame-rpc-system", "tokio", @@ -12331,13 +13015,13 @@ dependencies = [ "cumulus-primitives-utility", "derivative", "evm-coder", - "fp-evm-mapping", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "fp-rpc", "fp-self-contained", - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", @@ -12345,12 +13029,12 @@ dependencies = [ "log", "orml-vesting", "pallet-aura", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-base-fee", "pallet-common", "pallet-configuration", "pallet-ethereum", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "pallet-evm-coder-substrate", "pallet-evm-contract-helpers", "pallet-evm-migration", @@ -12358,14 +13042,14 @@ dependencies = [ "pallet-fungible", "pallet-inflation", "pallet-nonfungible", - "pallet-randomness-collective-flip", + "pallet-randomness-collective-flip 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-refungible", "pallet-rmrk-core", "pallet-rmrk-equip", "pallet-structure", "pallet-sudo", "pallet-template-transaction-payment", - "pallet-timestamp", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", @@ -12379,19 +13063,19 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-api", - "sp-arithmetic", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-block-builder", "sp-consensus-aura", - "sp-core", - "sp-inherents", - "sp-io", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-offchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-std", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-transaction-pool", - "sp-version", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-wasm-builder", "up-common", "up-data-structs", @@ -12435,12 +13119,12 @@ name = "up-common" version = "0.9.27" dependencies = [ "fp-rpc", - "frame-support", - "pallet-evm", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "sp-consensus-aura", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -12448,16 +13132,16 @@ name = "up-data-structs" version = "0.2.2" dependencies = [ "derivative", - "frame-support", - "frame-system", - "pallet-evm", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "rmrk-traits", "scale-info", "serde", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "struct-versioning", ] @@ -12466,12 +13150,12 @@ name = "up-rpc" version = "0.1.3" dependencies = [ "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "parity-scale-codec 3.1.5", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "up-data-structs", ] @@ -12922,11 +13606,11 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017 dependencies = [ "beefy-primitives", "bitvec 1.0.1", - "frame-benchmarking", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-election-provider-support", "frame-executive", - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", @@ -12936,7 +13620,7 @@ dependencies = [ "pallet-authorship", "pallet-babe", "pallet-bags-list", - "pallet-balances", + "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-collective", "pallet-democracy", "pallet-election-provider-multi-phase", @@ -12963,7 +13647,7 @@ dependencies = [ "pallet-staking", "pallet-staking-reward-curve", "pallet-sudo", - "pallet-timestamp", + "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", @@ -12981,22 +13665,22 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "sp-api", + "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-io", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-mmr-primitives", "sp-npos-elections", "sp-offchain", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-session", - "sp-staking", - "sp-std", + "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "sp-transaction-pool", - "sp-version", + "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "substrate-wasm-builder", "westend-runtime-constants", "xcm", @@ -13009,11 +13693,11 @@ name = "westend-runtime-constants" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-support", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "polkadot-primitives", "polkadot-runtime-common", "smallvec", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", ] [[package]] @@ -13195,7 +13879,7 @@ dependencies = [ "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-runtime", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "xcm-procedural", ] @@ -13204,17 +13888,17 @@ name = "xcm-builder" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-support", - "frame-system", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "log", "pallet-transaction-payment", "parity-scale-codec 3.1.5", "polkadot-parachain", "scale-info", - "sp-arithmetic", - "sp-io", - "sp-runtime", - "sp-std", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "xcm", "xcm-executor", ] @@ -13224,16 +13908,16 @@ name = "xcm-executor" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-benchmarking", - "frame-support", + "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "impl-trait-for-tuples", "log", "parity-scale-codec 3.1.5", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", "xcm", ] diff --git a/Makefile b/Makefile index f468a410aa..e159fe3e07 100644 --- a/Makefile +++ b/Makefile @@ -128,5 +128,9 @@ bench-rmrk-core: bench-rmrk-equip: make _bench PALLET=proxy-rmrk-equip +.PHONY: bench-app-promotion +bench-app-promotion: + make _bench PALLET=app-promotion PALLET_DIR=app-promotion + .PHONY: bench bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler bench-rmrk-core bench-rmrk-equip diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index 9d91bdd528..dc87dcdc2c 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -23,6 +23,7 @@ use jsonrpsee::{ proc_macros::rpc, }; use anyhow::anyhow; +use sp_runtime::traits::{AtLeast32BitUnsigned, Member}; use up_data_structs::{ RpcCollection, CollectionId, CollectionStats, CollectionLimits, TokenId, Property, PropertyKeyPermission, TokenData, TokenChild, @@ -41,7 +42,7 @@ pub use rmrk_unique_rpc::RmrkApiServer; #[rpc(server)] #[async_trait] -pub trait UniqueApi { +pub trait UniqueApi { /// Get tokens owned by account. #[method(name = "unique_accountTokens")] fn account_tokens( @@ -242,7 +243,23 @@ pub trait UniqueApi { collection_id: CollectionId, token_id: TokenId, at: Option, - ) -> Result>; + ) -> Result>; + + /// Returns the total amount of staked tokens. + #[method(name = "unique_totalStaked")] + fn total_staked(&self, staker: CrossAccountId, at: Option) -> Result; + + ///Returns the total amount of staked tokens per block when staked. + #[method(name = "unique_totalStakedPerBlock")] + fn total_staked_per_block( + &self, + staker: CrossAccountId, + at: Option, + ) -> Result>; + + /// Return the total amount locked by staking tokens. + #[method(name = "unique_totalStakingLocked")] + fn total_staking_locked(&self, staker: CrossAccountId, at: Option) -> Result; } mod rmrk_unique_rpc { @@ -436,7 +453,7 @@ macro_rules! pass_method { macro_rules! unique_api { () => { - dyn UniqueRuntimeApi + dyn UniqueRuntimeApi }; } @@ -447,13 +464,15 @@ macro_rules! rmrk_api { } #[allow(deprecated)] -impl - UniqueApiServer<::Hash, CrossAccountId, AccountId> for Unique +impl + UniqueApiServer<::Hash, BlockNumber, CrossAccountId, AccountId> + for Unique where Block: BlockT, + BlockNumber: Decode + Member + AtLeast32BitUnsigned, AccountId: Decode, C: 'static + ProvideRuntimeApi + HeaderBackend, - C::Api: UniqueRuntimeApi, + C::Api: UniqueRuntimeApi, CrossAccountId: pallet_evm::account::CrossAccountId, { pass_method!( @@ -520,6 +539,9 @@ where pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option, unique_api); pass_method!(total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option => |o| o.map(|number| number.to_string()) , unique_api); pass_method!(token_owners(collection: CollectionId, token: TokenId) -> Vec, unique_api); + pass_method!(total_staked(staker: CrossAccountId) -> u128, unique_api); + pass_method!(total_staked_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, u128)>, unique_api); + pass_method!(total_staking_locked(staker: CrossAccountId) -> u128, unique_api); } #[allow(deprecated)] diff --git a/node/cli/src/service.rs b/node/cli/src/service.rs index 2dc7e467f0..79e36f075a 100644 --- a/node/cli/src/service.rs +++ b/node/cli/src/service.rs @@ -63,7 +63,9 @@ use polkadot_service::CollatorPair; use fc_rpc_core::types::FilterPool; use fc_mapping_sync::{MappingSyncWorker, SyncStrategy}; -use up_common::types::opaque::{AuraId, RuntimeInstance, AccountId, Balance, Index, Hash, Block}; +use unique_runtime_common::types::{ + AuraId, RuntimeInstance, AccountId, Balance, Index, Hash, Block, BlockNumber, +}; // RMRK use up_data_structs::{ @@ -361,7 +363,7 @@ where + sp_block_builder::BlockBuilder + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::ApiExt> - + up_rpc::UniqueApi + + up_rpc::UniqueApi + rmrk_rpc::RmrkApi< Block, AccountId, @@ -662,7 +664,7 @@ where + sp_block_builder::BlockBuilder + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::ApiExt> - + up_rpc::UniqueApi + + up_rpc::UniqueApi + rmrk_rpc::RmrkApi< Block, AccountId, @@ -806,7 +808,7 @@ where + sp_block_builder::BlockBuilder + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::ApiExt> - + up_rpc::UniqueApi + + up_rpc::UniqueApi + rmrk_rpc::RmrkApi< Block, AccountId, diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index bb585a47c1..cdcae0b821 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -100,7 +100,8 @@ where C: HeaderBackend + HeaderMetadata, C: Send + Sync + 'static, C::Api: fp_rpc::EthereumRuntimeRPCApi, - C::Api: up_rpc::UniqueApi::CrossAccountId, AccountId>, + C::Api: + up_rpc::UniqueApi::CrossAccountId, AccountId>, BE: Backend + 'static, BE::State: StateBackend, R: RuntimeInstance + Send + Sync + 'static, @@ -144,7 +145,8 @@ where C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: fp_rpc::EthereumRuntimeRPCApi, C::Api: fp_rpc::ConvertTransactionRuntimeApi, - C::Api: up_rpc::UniqueApi::CrossAccountId, AccountId>, + C::Api: + up_rpc::UniqueApi::CrossAccountId, AccountId>, C::Api: rmrk_rpc::RmrkApi< Block, AccountId, diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml new file mode 100644 index 0000000000..a124b0d123 --- /dev/null +++ b/pallets/app-promotion/Cargo.toml @@ -0,0 +1,110 @@ +################################################################################ +# Package + +[package] +authors = ['Unique Network '] +description = 'Unique App Promotion Pallet' +edition = '2021' +homepage = 'https://unique.network' +license = 'GPLv3' +name = 'pallet-app-promotion' +repository = 'https://github.com/UniqueNetwork/unique-chain' +version = '0.1.0' + +[package.metadata.docs.rs] +targets = ['x86_64-unknown-linux-gnu'] + +[features] +default = ['std'] +runtime-benchmarks = [ + 'frame-benchmarking', + 'frame-support/runtime-benchmarks', + 'frame-system/runtime-benchmarks', +] +std = [ + 'codec/std', + 'serde/std', + 'frame-support/std', + 'frame-system/std', + 'pallet-balances/std', + 'pallet-timestamp/std', + 'pallet-randomness-collective-flip/std', + 'sp-std/std', + 'sp-runtime/std', + 'frame-benchmarking/std', +] + +################################################################################ +# Substrate Dependencies + +[dependencies.codec] +default-features = false +features = ['derive'] +package = 'parity-scale-codec' +version = '3.1.2' + +[dependencies.frame-benchmarking] +default-features = false +optional = true +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.frame-support] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.frame-system] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.pallet-balances] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.pallet-timestamp] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.pallet-randomness-collective-flip] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.sp-std] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.serde] +default-features = false +features = ['derive'] +version = '1.0.130' + +[dependencies.sp-runtime] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.sp-core] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.sp-io] +default-features = false +git = "https://github.com/paritytech/substrate" +branch = "polkadot-v0.9.24" + +[dependencies.pallet-evm] +default-features = false +git = "https://github.com/uniquenetwork/frontier" +branch = "unique-polkadot-v0.9.24" + +[dependencies] +scale-info = { version = "2.0.1", default-features = false, features = [ + "derive", +] } diff --git a/pallets/app-promotion/src/benchmarking.rs b/pallets/app-promotion/src/benchmarking.rs new file mode 100644 index 0000000000..2aa32ba1c8 --- /dev/null +++ b/pallets/app-promotion/src/benchmarking.rs @@ -0,0 +1,72 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +#![cfg(feature = "runtime-benchmarks")] + +use super::*; +use crate::Pallet as PromototionPallet; + +use sp_runtime::traits::Bounded; + +use frame_benchmarking::{benchmarks, account}; +use frame_support::traits::OnInitialize; +use frame_system::{Origin, RawOrigin}; + +const SEED: u32 = 0; +benchmarks! { + where_clause{ + where T: Config + + } + on_initialize { + let block1: T::BlockNumber = T::BlockNumber::from(1u32); + let block2: T::BlockNumber = T::BlockNumber::from(2u32); + PromototionPallet::::on_initialize(block1); // Create Treasury account + }: { PromototionPallet::::on_initialize(block2); } // Benchmark deposit_into_existing path + + start_app_promotion { + let caller = account::("caller", 0, SEED); + + } : {PromototionPallet::::start_app_promotion(RawOrigin::Root.into(), T::BlockNumber::from(2u32))?} + + set_admin_address { + let caller = account::("caller", 0, SEED); + let _ = T::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + } : {PromototionPallet::::set_admin_address(RawOrigin::Root.into(), caller)?} + + stake { + let caller = account::("caller", 0, SEED); + let share = Perbill::from_rational(1u32, 10); + let _ = T::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + } : {PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * T::Currency::total_balance(&caller))?} + + unstake { + let caller = account::("caller", 0, SEED); + let share = Perbill::from_rational(1u32, 10); + let _ = T::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + let _ = PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * T::Currency::total_balance(&caller))?; + + } : {PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * T::Currency::total_balance(&caller))?} + + recalculate_stake { + let caller = account::("caller", 0, SEED); + let share = Perbill::from_rational(1u32, 10); + let _ = T::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + let _ = PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * T::Currency::total_balance(&caller))?; + let block = ::current_block_number(); + let mut acc = >::default(); + } : {PromototionPallet::::recalculate_stake(&caller, block, share * T::Currency::total_balance(&caller), &mut acc)} +} diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs new file mode 100644 index 0000000000..d59065e91c --- /dev/null +++ b/pallets/app-promotion/src/lib.rs @@ -0,0 +1,494 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +//! # App promotion +//! +//! The app promotion pallet is designed to ... . +//! +//! ## Interface +//! +//! ### Dispatchable Functions +//! +//! * `start_inflation` - This method sets the inflation start date. Can be only called once. +//! Inflation start block can be backdated and will catch up. The method will create Treasury +//! account if it does not exist and perform the first inflation deposit. + +// #![recursion_limit = "1024"] +#![cfg_attr(not(feature = "std"), no_std)] + +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; +pub mod types; + +#[cfg(test)] +mod tests; + +use sp_std::vec::Vec; +use codec::EncodeLike; +use pallet_balances::BalanceLock; +pub use types::ExtendedLockableCurrency; + +use frame_support::{ + dispatch::{DispatchResult}, + traits::{ + Currency, Get, LockableCurrency, WithdrawReasons, tokens::Balance, ExistenceRequirement, + }, + ensure, +}; +pub use pallet::*; +use pallet_evm::account::CrossAccountId; +use sp_runtime::{ + Perbill, + traits::{BlockNumberProvider, CheckedAdd, CheckedSub}, + ArithmeticError, +}; + +type BalanceOf = + <::Currency as Currency<::AccountId>>::Balance; + +const SECONDS_TO_BLOCK: u32 = 6; +const DAY: u32 = 60 * 60 * 24 / SECONDS_TO_BLOCK; +const WEEK: u32 = 7 * DAY; +const TWO_WEEK: u32 = 2 * WEEK; +const YEAR: u32 = DAY * 365; + +pub const LOCK_IDENTIFIER: [u8; 8] = *b"appstake"; + +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::{Blake2_128Concat, Twox64Concat, pallet_prelude::*, storage::Key}; + use frame_system::pallet_prelude::*; + + #[pallet::config] + pub trait Config: frame_system::Config + pallet_evm::account::Config { + type Currency: ExtendedLockableCurrency; + + type TreasuryAccountId: Get; + + // The block number provider + type BlockNumberProvider: BlockNumberProvider; + + // /// Number of blocks that pass between treasury balance updates due to inflation + // #[pallet::constant] + // type InterestBlockInterval: Get; + + // // Weight information for functions of this pallet. + // type WeightInfo: WeightInfo; + } + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); + + #[pallet::storage] + pub type TotalStaked = StorageValue, QueryKind = ValueQuery>; + + #[pallet::storage] + pub type Admin = StorageValue; + + /// Amount of tokens staked by account in the blocknumber. + #[pallet::storage] + pub type Staked = StorageNMap< + Key = ( + Key, + Key, + ), + Value = BalanceOf, + QueryKind = ValueQuery, + >; + + #[pallet::storage] + pub type PendingUnstake = StorageNMap< + Key = ( + Key, + Key, + ), + Value = BalanceOf, + QueryKind = ValueQuery, + >; + + /// A block when app-promotion has started + #[pallet::storage] + pub type StartBlock = StorageValue; + + /// Next target block when interest is recalculated + #[pallet::storage] + #[pallet::getter(fn get_interest_block)] + pub type NextInterestBlock = + StorageValue; + + #[pallet::hooks] + impl Hooks> for Pallet { + fn on_initialize(current_block: T::BlockNumber) -> Weight + where + ::BlockNumber: From, + { + PendingUnstake::::iter() + .filter_map(|((staker, block), amount)| { + if block <= current_block { + Some((staker, block, amount)) + } else { + None + } + }) + .for_each(|(staker, block, amount)| { + Self::unlock_balance_unchecked(&staker, amount); // TO-DO : Replace with a method that will check that the unstack is less than it was blocked, otherwise take the delta from the treasuries + >::remove((staker, block)); + }); + + let next_interest_block = Self::get_interest_block(); + + if next_interest_block != 0.into() && current_block >= next_interest_block { + let mut acc = >::default(); + let mut weight: Weight = 0; + NextInterestBlock::::set(current_block + DAY.into()); + Staked::::iter() + .filter(|((_, block), _)| *block + DAY.into() <= current_block) + .for_each(|((staker, block), amount)| { + Self::recalculate_stake(&staker, block, amount, &mut acc); + // weight += recalculate_stake(); + }); + >::get() + .checked_add(&acc) + .map(|res| >::set(res)); + }; + 0 + } + } + + #[pallet::call] + impl Pallet { + #[pallet::weight(0)] + pub fn set_admin_address(origin: OriginFor, admin: T::AccountId) -> DispatchResult { + ensure_root(origin)?; + >::set(Some(admin)); + + Ok(()) + } + + #[pallet::weight(0)] + pub fn start_app_promotion( + origin: OriginFor, + promotion_start_relay_block: T::BlockNumber, + ) -> DispatchResult + where + ::BlockNumber: From, + { + ensure_root(origin)?; + + // Start app-promotion mechanics if it has not been yet initialized + if >::get() == 0u32.into() { + // Set promotion global start block + >::set(promotion_start_relay_block); + + >::set(promotion_start_relay_block + DAY.into()); + } + + Ok(()) + } + + #[pallet::weight(0)] + pub fn stake(staker: OriginFor, amount: BalanceOf) -> DispatchResult { + let staker_id = ensure_signed(staker)?; + + let balance = + <::Currency as Currency>::free_balance(&staker_id); + + ensure!(balance >= amount, ArithmeticError::Underflow); + + Self::set_lock_unchecked(&staker_id, amount); + + let block_number = + ::current_block_number(); + + >::insert( + (&staker_id, block_number), + >::get((&staker_id, block_number)) + .checked_add(&amount) + .ok_or(ArithmeticError::Overflow)?, + ); + + >::set( + >::get() + .checked_add(&amount) + .ok_or(ArithmeticError::Overflow)?, + ); + + Ok(()) + } + + #[pallet::weight(0)] + pub fn unstake(staker: OriginFor, amount: BalanceOf) -> DispatchResult { + let staker_id = ensure_signed(staker)?; + + let mut stakes = Staked::::iter_prefix((&staker_id,)).collect::>(); + + let total_staked = stakes + .iter() + .fold(>::default(), |acc, (_, amount)| acc + *amount); + + ensure!(total_staked >= amount, ArithmeticError::Underflow); + + >::set( + >::get() + .checked_sub(&amount) + .ok_or(ArithmeticError::Underflow)?, + ); + + let block = ::current_block_number() + WEEK.into(); + >::insert( + (&staker_id, block), + >::get((&staker_id, block)) + .checked_add(&amount) + .ok_or(ArithmeticError::Overflow)?, + ); + + stakes.sort_by_key(|(block, _)| *block); + + let mut acc_amount = amount; + let new_state = stakes + .into_iter() + .map_while(|(block, balance_per_block)| { + if acc_amount == >::default() { + return None; + } + if acc_amount <= balance_per_block { + let res = (block, balance_per_block - acc_amount, acc_amount); + acc_amount = >::default(); + return Some(res); + } else { + acc_amount -= balance_per_block; + return Some((block, >::default(), acc_amount)); + } + }) + .collect::>(); + + new_state + .into_iter() + .for_each(|(block, to_staked, _to_pending)| { + if to_staked == >::default() { + >::remove((&staker_id, block)); + } else { + >::insert((&staker_id, block), to_staked); + } + }); + + Ok(()) + } + } +} + +impl Pallet { + // pub fn stake(staker: &T::AccountId, amount: BalanceOf) -> DispatchResult { + // let balance = <::Currency as Currency>::free_balance(staker); + + // ensure!(balance >= amount, ArithmeticError::Underflow); + + // Self::set_lock_unchecked(staker, amount); + + // let block_number = ::current_block_number(); + + // >::insert( + // (staker, block_number), + // >::get((staker, block_number)) + // .checked_add(&amount) + // .ok_or(ArithmeticError::Overflow)?, + // ); + + // >::set( + // >::get() + // .checked_add(&amount) + // .ok_or(ArithmeticError::Overflow)?, + // ); + + // Ok(()) + // } + + // pub fn unstake(staker: &T::AccountId, amount: BalanceOf) -> DispatchResult { + // let mut stakes = Staked::::iter_prefix((staker,)).collect::>(); + + // let total_staked = stakes + // .iter() + // .fold(>::default(), |acc, (_, amount)| acc + *amount); + + // ensure!(total_staked >= amount, ArithmeticError::Underflow); + + // >::set( + // >::get() + // .checked_sub(&amount) + // .ok_or(ArithmeticError::Underflow)?, + // ); + + // let block = ::current_block_number() + WEEK.into(); + // >::insert( + // (staker, block), + // >::get((staker, block)) + // .checked_add(&amount) + // .ok_or(ArithmeticError::Overflow)?, + // ); + + // stakes.sort_by_key(|(block, _)| *block); + + // let mut acc_amount = amount; + // let new_state = stakes + // .into_iter() + // .map_while(|(block, balance_per_block)| { + // if acc_amount == >::default() { + // return None; + // } + // if acc_amount <= balance_per_block { + // let res = (block, balance_per_block - acc_amount, acc_amount); + // acc_amount = >::default(); + // return Some(res); + // } else { + // acc_amount -= balance_per_block; + // return Some((block, >::default(), acc_amount)); + // } + // }) + // .collect::>(); + + // new_state + // .into_iter() + // .for_each(|(block, to_staked, _to_pending)| { + // if to_staked == >::default() { + // >::remove((staker, block)); + // } else { + // >::insert((staker, block), to_staked); + // } + // }); + + // Ok(()) + // } + + pub fn sponsor_collection(admin: T::AccountId, collection_id: u32) -> DispatchResult { + Ok(()) + } + + pub fn stop_sponsorign_collection(admin: T::AccountId, collection_id: u32) -> DispatchResult { + Ok(()) + } + + pub fn sponsor_conract(admin: T::AccountId, app_id: u32) -> DispatchResult { + Ok(()) + } + + pub fn stop_sponsorign_contract(admin: T::AccountId, app_id: u32) -> DispatchResult { + Ok(()) + } +} + +impl Pallet { + fn unlock_balance_unchecked(staker: &T::AccountId, amount: BalanceOf) { + let mut locked_balance = Self::get_locked_balance(staker).map(|l| l.amount).unwrap(); + locked_balance -= amount; + Self::set_lock_unchecked(staker, locked_balance); + } + + fn add_lock_balance(staker: &T::AccountId, amount: BalanceOf) -> DispatchResult { + Self::get_locked_balance(staker) + .map(|l| l.amount) + .and_then(|b| b.checked_add(&amount)) + .map(|new_lock| Self::set_lock_unchecked(staker, new_lock)) + .ok_or(ArithmeticError::Overflow.into()) + } + + fn set_lock_unchecked(staker: &T::AccountId, amount: BalanceOf) { + >::set_lock( + LOCK_IDENTIFIER, + staker, + amount, + WithdrawReasons::all(), + ) + } + + pub fn get_locked_balance( + staker: impl EncodeLike, + ) -> Option>> { + >::locks(staker) + .into_iter() + .find(|l| l.id == LOCK_IDENTIFIER) + } + + pub fn total_staked_by_id(staker: impl EncodeLike) -> Option> { + let staked = Staked::::iter_prefix((staker,)) + .into_iter() + .fold(>::default(), |acc, (_, amount)| acc + amount); + if staked != >::default() { + Some(staked) + } else { + None + } + } + + pub fn total_staked_by_id_per_block( + staker: impl EncodeLike, + ) -> Option)>> { + let staked = Staked::::iter_prefix((staker,)) + .into_iter() + .map(|(block, amount)| (block, amount)) + .collect::>(); + if !staked.is_empty() { + Some(staked) + } else { + None + } + } + + pub fn cross_id_total_staked(staker: T::CrossAccountId) -> Option> { + Self::total_staked_by_id(staker.as_sub()) + } + + pub fn cross_id_locked_balance(staker: T::CrossAccountId) -> BalanceOf { + Self::get_locked_balance(staker.as_sub()) + .map(|l| l.amount) + .unwrap_or_default() + } + + pub fn cross_id_total_staked_per_block( + staker: T::CrossAccountId, + ) -> Vec<(T::BlockNumber, BalanceOf)> { + Self::total_staked_by_id_per_block(staker.as_sub()).unwrap_or_default() + } + + fn recalculate_stake( + staker: &T::AccountId, + block: T::BlockNumber, + base: BalanceOf, + income_acc: &mut BalanceOf, + ) { + let income = Self::calculate_income(base); + base.checked_add(&income).map(|res| { + >::insert((staker, block), res); + *income_acc += income; + >::transfer( + &T::TreasuryAccountId::get(), + staker, + income, + ExistenceRequirement::KeepAlive, + ) + .and_then(|_| Self::add_lock_balance(staker, income)); + }); + } + + fn calculate_income(base: I) -> I + where + I: EncodeLike> + Balance, + { + let day_rate = Perbill::from_rational(5u32, 1_0000); + day_rate * base + } +} diff --git a/pallets/app-promotion/src/tests.rs b/pallets/app-promotion/src/tests.rs new file mode 100644 index 0000000000..b5c110c5c8 --- /dev/null +++ b/pallets/app-promotion/src/tests.rs @@ -0,0 +1,128 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +#![cfg(test)] +#![allow(clippy::from_over_into)] +use crate as pallet_promotion; + +use frame_benchmarking::{add_benchmark, BenchmarkBatch}; +use frame_support::{ + assert_ok, parameter_types, + traits::{Currency, OnInitialize, Everything, ConstU32}, +}; +use frame_system::RawOrigin; +use sp_core::H256; +use sp_runtime::{ + traits::{BlakeTwo256, BlockNumberProvider, IdentityLookup}, + testing::Header, + Perbill, +}; + +// type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +// type Block = frame_system::mocking::MockBlock; + +// parameter_types! { +// pub const BlockHashCount: u64 = 250; +// pub BlockWeights: frame_system::limits::BlockWeights = +// frame_system::limits::BlockWeights::simple_max(1024); +// pub const SS58Prefix: u8 = 42; +// pub TreasuryAccountId: u64 = 1234; +// pub const InflationBlockInterval: u32 = 100; // every time per how many blocks inflation is applied +// pub static MockBlockNumberProvider: u64 = 0; +// pub const ExistentialDeposit: u64 = 1; +// pub const MaxLocks: u32 = 50; +// } + +// impl BlockNumberProvider for MockBlockNumberProvider { +// type BlockNumber = u64; + +// fn current_block_number() -> Self::BlockNumber { +// Self::get() +// } +// } + +// frame_support::construct_runtime!( +// pub enum Test where +// Block = Block, +// NodeBlock = Block, +// UncheckedExtrinsic = UncheckedExtrinsic, +// { +// Balances: pallet_balances::{Pallet, Call, Storage}, +// System: frame_system::{Pallet, Call, Config, Storage, Event}, +// Promotion: pallet_promotion::{Pallet, Call, Storage} +// } +// ); + +// impl frame_system::Config for Test { +// type BaseCallFilter = Everything; +// type BlockWeights = (); +// type BlockLength = (); +// type DbWeight = (); +// type Origin = Origin; +// type Call = Call; +// type Index = u64; +// type BlockNumber = u64; +// type Hash = H256; +// type Hashing = BlakeTwo256; +// type AccountId = u64; +// type Lookup = IdentityLookup; +// type Header = Header; +// type Event = (); +// type BlockHashCount = BlockHashCount; +// type Version = (); +// type PalletInfo = PalletInfo; +// type AccountData = pallet_balances::AccountData; +// type OnNewAccount = (); +// type OnKilledAccount = (); +// type SystemWeightInfo = (); +// type SS58Prefix = SS58Prefix; +// type OnSetCode = (); +// type MaxConsumers = ConstU32<16>; +// } + +// impl pallet_balances::Config for Test { +// type AccountStore = System; +// type Balance = u64; +// type DustRemoval = (); +// type Event = (); +// type ExistentialDeposit = ExistentialDeposit; +// type WeightInfo = (); +// type MaxLocks = MaxLocks; +// type MaxReserves = (); +// type ReserveIdentifier = [u8; 8]; +// } + +// impl pallet_promotion::Config for Test { +// type Currency = Balances; + +// type TreasuryAccountId = TreasuryAccountId; + +// type BlockNumberProvider = MockBlockNumberProvider; +// } + +// pub fn new_test_ext() -> sp_io::TestExternalities { +// frame_system::GenesisConfig::default() +// .build_storage::() +// .unwrap() +// .into() +// } + +// #[test] +// fn test_benchmark() { +// new_test_ext().execute_with(|| { +// test_benchmark_stake::(); +// } ) +// } diff --git a/pallets/app-promotion/src/types.rs b/pallets/app-promotion/src/types.rs new file mode 100644 index 0000000000..bf561bb5fd --- /dev/null +++ b/pallets/app-promotion/src/types.rs @@ -0,0 +1,20 @@ +use codec::EncodeLike; +use frame_support::{traits::LockableCurrency, WeakBoundedVec, Parameter}; +use pallet_balances::{BalanceLock, Config as BalancesConfig, Pallet as PalletBalances}; + +pub trait ExtendedLockableCurrency: LockableCurrency { + fn locks(who: KArg) -> WeakBoundedVec, Self::MaxLocks> + where + KArg: EncodeLike; +} + +impl, I: 'static> ExtendedLockableCurrency + for PalletBalances +{ + fn locks(who: KArg) -> WeakBoundedVec, Self::MaxLocks> + where + KArg: EncodeLike, + { + Self::locks(who) + } +} diff --git a/pallets/app-promotion/src/weights.rs b/pallets/app-promotion/src/weights.rs new file mode 100644 index 0000000000..933fd0e0e9 --- /dev/null +++ b/pallets/app-promotion/src/weights.rs @@ -0,0 +1,141 @@ +// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs + +//! Autogenerated weights for pallet_app_promotion +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-08-09, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 + +// Executed Command: +// target/release/unique-collator +// benchmark +// pallet +// --pallet +// pallet-app-promotion +// --wasm-execution +// compiled +// --extrinsic +// * +// --template +// .maintain/frame-weight-template.hbs +// --steps=50 +// --repeat=80 +// --heap-pages=4096 +// --output=./pallets/app-promotion/src/weights.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for pallet_app_promotion. +pub trait WeightInfo { + fn on_initialize() -> Weight; + fn start_app_promotion() -> Weight; + fn set_admin_address() -> Weight; + fn stake() -> Weight; + fn unstake() -> Weight; + fn recalculate_stake() -> Weight; +} + +/// Weights for pallet_app_promotion using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + // Storage: Promotion PendingUnstake (r:1 w:0) + // Storage: Promotion NextInterestBlock (r:1 w:0) + fn on_initialize() -> Weight { + (2_705_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + } + // Storage: Promotion StartBlock (r:1 w:1) + // Storage: Promotion NextInterestBlock (r:0 w:1) + fn start_app_promotion() -> Weight { + (1_436_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: Promotion Admin (r:0 w:1) + fn set_admin_address() -> Weight { + (516_000 as Weight) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: System Account (r:1 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Storage: Promotion Staked (r:1 w:1) + // Storage: Promotion TotalStaked (r:1 w:1) + fn stake() -> Weight { + (10_019_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + // Storage: System Account (r:1 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Storage: Promotion Staked (r:1 w:1) + // Storage: Promotion TotalStaked (r:1 w:1) + fn unstake() -> Weight { + (10_619_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + // Storage: System Account (r:2 w:0) + // Storage: Promotion Staked (r:0 w:1) + fn recalculate_stake() -> Weight { + (4_932_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + // Storage: Promotion PendingUnstake (r:1 w:0) + // Storage: Promotion NextInterestBlock (r:1 w:0) + fn on_initialize() -> Weight { + (2_705_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + } + // Storage: Promotion StartBlock (r:1 w:1) + // Storage: Promotion NextInterestBlock (r:0 w:1) + fn start_app_promotion() -> Weight { + (1_436_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } + // Storage: Promotion Admin (r:0 w:1) + fn set_admin_address() -> Weight { + (516_000 as Weight) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: System Account (r:1 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Storage: Promotion Staked (r:1 w:1) + // Storage: Promotion TotalStaked (r:1 w:1) + fn stake() -> Weight { + (10_019_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + // Storage: System Account (r:1 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Storage: Promotion Staked (r:1 w:1) + // Storage: Promotion TotalStaked (r:1 w:1) + fn unstake() -> Weight { + (10_619_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + // Storage: System Account (r:2 w:0) + // Storage: Promotion Staked (r:0 w:1) + fn recalculate_stake() -> Weight { + (4_932_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } +} diff --git a/primitives/rpc/src/lib.rs b/primitives/rpc/src/lib.rs index 2039dc81b1..040e2e860b 100644 --- a/primitives/rpc/src/lib.rs +++ b/primitives/rpc/src/lib.rs @@ -20,16 +20,21 @@ use up_data_structs::{ CollectionId, TokenId, RpcCollection, CollectionStats, CollectionLimits, Property, PropertyKeyPermission, TokenData, TokenChild, }; + use sp_std::vec::Vec; use codec::Decode; -use sp_runtime::DispatchError; +use sp_runtime::{ + DispatchError, + traits::{AtLeast32BitUnsigned, Member}, +}; type Result = core::result::Result; sp_api::decl_runtime_apis! { #[api_version(2)] /// Trait for generate rpc. - pub trait UniqueApi where + pub trait UniqueApi where + BlockNumber: Decode + Member + AtLeast32BitUnsigned, AccountId: Decode, CrossAccountId: pallet_evm::account::CrossAccountId, { @@ -121,5 +126,8 @@ sp_api::decl_runtime_apis! { /// Get total pieces of token. fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Result>; fn token_owners(collection: CollectionId, token: TokenId) -> Result>; + fn total_staked(staker: CrossAccountId) -> Result; + fn total_staked_per_block(staker: CrossAccountId) -> Result>; + fn total_staking_locked(staker: CrossAccountId) -> Result; } } diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index 33bebf4d1e..d36b41536d 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -61,7 +61,7 @@ macro_rules! impl_common_runtime_apis { impl_runtime_apis! { $($($custom_apis)+)? - impl up_rpc::UniqueApi for Runtime { + impl up_rpc::UniqueApi for Runtime { fn account_tokens(collection: CollectionId, account: CrossAccountId) -> Result, DispatchError> { dispatch_unique_runtime!(collection.account_tokens(account)) } @@ -187,6 +187,20 @@ macro_rules! impl_common_runtime_apis { fn total_pieces(collection: CollectionId, token_id: TokenId) -> Result, DispatchError> { dispatch_unique_runtime!(collection.total_pieces(token_id)) } + + fn total_staked(staker: CrossAccountId) -> Result { + Ok(>::cross_id_total_staked(staker).unwrap_or_default()) + // Ok(0) + } + + fn total_staked_per_block(staker: CrossAccountId) -> Result, DispatchError> { + Ok(>::cross_id_total_staked_per_block(staker)) + } + + fn total_staking_locked(staker: CrossAccountId) -> Result { + // Ok(0) + Ok(>::cross_id_locked_balance(staker)) + } } impl rmrk_rpc::RmrkApi< @@ -638,6 +652,7 @@ macro_rules! impl_common_runtime_apis { list_benchmark!(list, extra, pallet_unique, Unique); list_benchmark!(list, extra, pallet_structure, Structure); list_benchmark!(list, extra, pallet_inflation, Inflation); + list_benchmark!(list, extra, pallet_app_promotion, Promotion); list_benchmark!(list, extra, pallet_fungible, Fungible); list_benchmark!(list, extra, pallet_nonfungible, Nonfungible); @@ -693,6 +708,7 @@ macro_rules! impl_common_runtime_apis { add_benchmark!(params, batches, pallet_unique, Unique); add_benchmark!(params, batches, pallet_structure, Structure); add_benchmark!(params, batches, pallet_inflation, Inflation); + add_benchmark!(params, batches, pallet_app_promotion, Promotion); add_benchmark!(params, batches, pallet_fungible, Fungible); add_benchmark!(params, batches, pallet_nonfungible, Nonfungible); diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 31ad731da2..f8a6705187 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -37,6 +37,7 @@ runtime-benchmarks = [ 'pallet-proxy-rmrk-equip/runtime-benchmarks', 'pallet-unique/runtime-benchmarks', 'pallet-inflation/runtime-benchmarks', + 'pallet-app-promotion/runtime-benchmarks', 'pallet-unique-scheduler/runtime-benchmarks', 'pallet-xcm/runtime-benchmarks', 'sp-runtime/runtime-benchmarks', @@ -88,6 +89,7 @@ std = [ 'serde', 'pallet-inflation/std', 'pallet-configuration/std', + 'pallet-app-promotion/std', 'pallet-common/std', 'pallet-structure/std', 'pallet-fungible/std', @@ -414,6 +416,7 @@ up-rpc = { path = "../../primitives/rpc", default-features = false } rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false } fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } +pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } pallet-configuration = { default-features = false, path = "../../pallets/configuration" } pallet-common = { default-features = false, path = "../../pallets/common" } From e8045651d40ea8ba88e44f3b03935a1609d85a90 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Fri, 12 Aug 2022 20:19:22 +0700 Subject: [PATCH 0618/1274] added totalstaked & fix bug with number in RPC Client --- client/rpc/src/lib.rs | 18 +- pallets/app-promotion/src/lib.rs | 7 +- primitives/rpc/src/lib.rs | 2 +- runtime/common/runtime_apis.rs | 2 +- tests/package.json | 1 + tests/src/app-promotion.test.ts | 90 + tests/src/interfaces/augment-api-query.ts | 21 + tests/src/interfaces/augment-api-rpc.ts | 16 +- tests/src/interfaces/augment-api-tx.ts | 10 + tests/src/interfaces/augment-types.ts | 1 + tests/src/interfaces/default/types.ts | 21 + tests/src/interfaces/lookup.ts | 16 + tests/src/interfaces/registry.ts | 1 + tests/src/interfaces/types-lookup.ts | 3906 +++++++++++--------- tests/src/interfaces/unique/definitions.ts | 15 + 15 files changed, 2312 insertions(+), 1815 deletions(-) create mode 100644 tests/src/app-promotion.test.ts diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index dc87dcdc2c..6ff95e2e79 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -247,7 +247,8 @@ pub trait UniqueApi { /// Returns the total amount of staked tokens. #[method(name = "unique_totalStaked")] - fn total_staked(&self, staker: CrossAccountId, at: Option) -> Result; + fn total_staked(&self, staker: Option, at: Option) + -> Result; ///Returns the total amount of staked tokens per block when staked. #[method(name = "unique_totalStakedPerBlock")] @@ -255,11 +256,12 @@ pub trait UniqueApi { &self, staker: CrossAccountId, at: Option, - ) -> Result>; + ) -> Result>; /// Return the total amount locked by staking tokens. #[method(name = "unique_totalStakingLocked")] - fn total_staking_locked(&self, staker: CrossAccountId, at: Option) -> Result; + fn total_staking_locked(&self, staker: CrossAccountId, at: Option) + -> Result; } mod rmrk_unique_rpc { @@ -539,9 +541,13 @@ where pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option, unique_api); pass_method!(total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option => |o| o.map(|number| number.to_string()) , unique_api); pass_method!(token_owners(collection: CollectionId, token: TokenId) -> Vec, unique_api); - pass_method!(total_staked(staker: CrossAccountId) -> u128, unique_api); - pass_method!(total_staked_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, u128)>, unique_api); - pass_method!(total_staking_locked(staker: CrossAccountId) -> u128, unique_api); + pass_method!(total_staked(staker: Option) -> String => |v| v.to_string(), unique_api); + pass_method!(total_staked_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, String)> => + |v| v + .into_iter() + .map(|(b, a)| (b, a.to_string())) + .collect::>(), unique_api); + pass_method!(total_staking_locked(staker: CrossAccountId) -> String => |v| v.to_string(), unique_api); } #[allow(deprecated)] diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index d59065e91c..dce11b5d7a 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -448,8 +448,11 @@ impl Pallet { } } - pub fn cross_id_total_staked(staker: T::CrossAccountId) -> Option> { - Self::total_staked_by_id(staker.as_sub()) + pub fn cross_id_total_staked(staker: Option) -> Option> { + staker.map_or(Some(>::get()), |s| { + Self::total_staked_by_id(s.as_sub()) + }) + // Self::total_staked_by_id(staker.as_sub()) } pub fn cross_id_locked_balance(staker: T::CrossAccountId) -> BalanceOf { diff --git a/primitives/rpc/src/lib.rs b/primitives/rpc/src/lib.rs index 040e2e860b..89b0aac886 100644 --- a/primitives/rpc/src/lib.rs +++ b/primitives/rpc/src/lib.rs @@ -126,7 +126,7 @@ sp_api::decl_runtime_apis! { /// Get total pieces of token. fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Result>; fn token_owners(collection: CollectionId, token: TokenId) -> Result>; - fn total_staked(staker: CrossAccountId) -> Result; + fn total_staked(staker: Option) -> Result; fn total_staked_per_block(staker: CrossAccountId) -> Result>; fn total_staking_locked(staker: CrossAccountId) -> Result; } diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index d36b41536d..267b1c6409 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -188,7 +188,7 @@ macro_rules! impl_common_runtime_apis { dispatch_unique_runtime!(collection.total_pieces(token_id)) } - fn total_staked(staker: CrossAccountId) -> Result { + fn total_staked(staker: Option) -> Result { Ok(>::cross_id_total_staked(staker).unwrap_or_default()) // Ok(0) } diff --git a/tests/package.json b/tests/package.json index 804a2f9813..34601ddc8f 100644 --- a/tests/package.json +++ b/tests/package.json @@ -83,6 +83,7 @@ "testRFT": "mocha --timeout 9999999 -r ts-node/register ./**/refungible.test.ts", "testFT": "mocha --timeout 9999999 -r ts-node/register ./**/fungible.test.ts", "testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts", + "testPromotion": "mocha --timeout 9999999 -r ts-node/register ./**/app-promotion.test.ts", "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", "polkadot-types-from-defs": "ts-node ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .", "polkadot-types-from-chain": "ts-node ./node_modules/.bin/polkadot-types-from-chain --endpoint src/interfaces/metadata.json --output src/interfaces/ --package .", diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts new file mode 100644 index 0000000000..00d6b8665c --- /dev/null +++ b/tests/src/app-promotion.test.ts @@ -0,0 +1,90 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import {default as usingApi, submitTransactionAsync} from './substrate/substrate-api'; +import {IKeyringPair} from '@polkadot/types/types'; +import { + + createMultipleItemsExpectSuccess, + isTokenExists, + getLastTokenId, + getAllowance, + approve, + transferFrom, + createCollection, + transfer, + burnItem, + normalizeAccountId, + CrossAccountId, + createFungibleItemExpectSuccess, + U128_MAX, + burnFromExpectSuccess, + UNIQUE, +} from './util/helpers'; + +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; +import getBalance from './substrate/get-balance'; +import { unique } from './interfaces/definitions'; +chai.use(chaiAsPromised); +const expect = chai.expect; + +let alice: IKeyringPair; +let bob: IKeyringPair; +let palletAdmin: IKeyringPair; + +describe('integration test: AppPromotion', () => { + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + alice = privateKeyWrapper('//Alice'); + bob = privateKeyWrapper('//Bob'); + palletAdmin = privateKeyWrapper('//palletAdmin'); + const tx = api.tx.sudo.sudo(api.tx.promotion.setAdminAddress(palletAdmin.addressRaw)); + await submitTransactionAsync(alice, tx); + }); + }); + it('will change balance state to "locked", add it to "staked" map, and increase "totalStaked" amount', async () => { + // arrange: Alice balance = 1000 + // act: Alice calls appPromotion.stake(100) + // assert: Alice locked balance equal 100 + // assert: Alice free balance closeTo 900 + // assert: query appPromotion.staked(Alice) equal [100] + // assert: query appPromotion.totalStaked() increased by 100 + // act: Alice extrinsic appPromotion.stake(200) + + // assert: Alice locked balance equal 300 + // assert: query appPromotion.staked(Alice) equal [100, 200] + // assert: query appPromotion.totalStaked() increased by 200 + + await usingApi(async (api, privateKeyWrapper) => { + await submitTransactionAsync(alice, api.tx.balances.transfer(bob.addressRaw, 10n * UNIQUE)); + const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alice.address, bob.address]); + + console.log(`alice: ${alicesBalanceBefore} \n bob: ${bobsBalanceBefore}`); + + await submitTransactionAsync(alice, api.tx.promotion.stake(1n * UNIQUE)); + await submitTransactionAsync(bob, api.tx.promotion.stake(1n * UNIQUE)); + const alice_total_staked = (await (api.rpc.unique.totalStaked(normalizeAccountId(alice)))).toBigInt(); + const bob_total_staked = (await api.rpc.unique.totalStaked(normalizeAccountId(bob))).toBigInt(); + + console.log(`alice staked: ${alice_total_staked} \n bob staked: ${bob_total_staked}, total staked: ${(await api.rpc.unique.totalStaked()).toBigInt()}`); + + + + }); + }); + +}); \ No newline at end of file diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 852f6e22f1..753a5fc956 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -456,6 +456,27 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; + promotion: { + admin: AugmentedQuery Observable>, []> & QueryableStorageEntry; + /** + * Next target block when interest is recalculated + **/ + nextInterestBlock: AugmentedQuery Observable, []> & QueryableStorageEntry; + pendingUnstake: AugmentedQuery Observable, [AccountId32, u32]> & QueryableStorageEntry; + /** + * Amount of tokens staked by account in the blocknumber. + **/ + staked: AugmentedQuery Observable, [AccountId32, u32]> & QueryableStorageEntry; + /** + * A block when app-promotion has started + **/ + startBlock: AugmentedQuery Observable, []> & QueryableStorageEntry; + totalStaked: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; randomnessCollectiveFlip: { /** * Series of block headers from the last 81 blocks that acts as random seed material. This diff --git a/tests/src/interfaces/augment-api-rpc.ts b/tests/src/interfaces/augment-api-rpc.ts index 7e220fca8e..d89d2b1ff2 100644 --- a/tests/src/interfaces/augment-api-rpc.ts +++ b/tests/src/interfaces/augment-api-rpc.ts @@ -8,8 +8,8 @@ import '@polkadot/rpc-core/types/jsonrpc'; import type { PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsPartPartType, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionStats, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsRpcCollection, UpDataStructsTokenChild, UpDataStructsTokenData } from './default'; import type { AugmentedRpc } from '@polkadot/rpc-core/types'; import type { Metadata, StorageKey } from '@polkadot/types'; -import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, f64, u128, u32, u64 } from '@polkadot/types-codec'; -import type { AnyNumber, Codec } from '@polkadot/types-codec/types'; +import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, u128, u32, u64 } from '@polkadot/types-codec'; +import type { AnyNumber, Codec, ITuple } from '@polkadot/types-codec/types'; import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; import type { EpochAuthorship } from '@polkadot/types/interfaces/babe'; import type { BeefySignedCommitment } from '@polkadot/types/interfaces/beefy'; @@ -738,6 +738,18 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { * Get the total amount of pieces of an RFT **/ totalPieces: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; + /** + * Returns the total amount of staked tokens + **/ + totalStaked: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; + /** + * Returns the total amount of staked tokens per block when staked + **/ + totalStakedPerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>>; + /** + * Return the total amount locked by staking tokens + **/ + totalStakingLocked: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; /** * Get the amount of distinctive tokens present in a collection **/ diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index 97d8627705..9349a853bd 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -362,6 +362,16 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; + promotion: { + setAdminAddress: AugmentedSubmittable<(admin: AccountId32 | string | Uint8Array) => SubmittableExtrinsic, [AccountId32]>; + stake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; + startAppPromotion: AugmentedSubmittable<(promotionStartRelayBlock: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; + unstake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; rmrkCore: { /** * Accept an NFT sent from another account to self or an owned NFT. diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index 4e44fb898c..8685acd75a 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -804,6 +804,7 @@ declare module '@polkadot/types/types/registry' { Owner: Owner; PageCounter: PageCounter; PageIndexData: PageIndexData; + PalletAppPromotionCall: PalletAppPromotionCall; PalletBalancesAccountData: PalletBalancesAccountData; PalletBalancesBalanceLock: PalletBalancesBalanceLock; PalletBalancesCall: PalletBalancesCall; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 731bbfa904..9783b78054 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -806,6 +806,27 @@ export interface OrmlVestingVestingSchedule extends Struct { readonly perPeriod: Compact; } +/** @name PalletAppPromotionCall */ +export interface PalletAppPromotionCall extends Enum { + readonly isSetAdminAddress: boolean; + readonly asSetAdminAddress: { + readonly admin: AccountId32; + } & Struct; + readonly isStartAppPromotion: boolean; + readonly asStartAppPromotion: { + readonly promotionStartRelayBlock: u32; + } & Struct; + readonly isStake: boolean; + readonly asStake: { + readonly amount: u128; + } & Struct; + readonly isUnstake: boolean; + readonly asUnstake: { + readonly amount: u128; + } & Struct; + readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake'; +} + /** @name PalletBalancesAccountData */ export interface PalletBalancesAccountData extends Struct { readonly free: u128; diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 303d76a552..df1e5567a7 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -1979,9 +1979,25 @@ export default { collectionId: 'u32', data: 'UpDataStructsCreateItemExData', }, +<<<<<<< HEAD set_transfers_enabled_flag: { collectionId: 'u32', value: 'bool', +======= + finish: { + address: 'H160', + code: 'Bytes' + } + } + }, + /** + * Lookup259: pallet_sudo::pallet::Event + **/ + PalletSudoEvent: { + _enum: { + Sudid: { + sudoResult: 'Result', +>>>>>>> b43f8da0... added totalstaked & fix bug with number in RPC Client }, burn_item: { collectionId: 'u32', diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index 7890b69b36..82c56d2f34 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -83,6 +83,7 @@ declare module '@polkadot/types/types/registry' { OrmlVestingModuleError: OrmlVestingModuleError; OrmlVestingModuleEvent: OrmlVestingModuleEvent; OrmlVestingVestingSchedule: OrmlVestingVestingSchedule; + PalletAppPromotionCall: PalletAppPromotionCall; PalletBalancesAccountData: PalletBalancesAccountData; PalletBalancesBalanceLock: PalletBalancesBalanceLock; PalletBalancesCall: PalletBalancesCall; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 323fc2c01e..2e0e8fe399 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -10,62 +10,67 @@ import type { ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; import type { Event } from '@polkadot/types/interfaces/system'; -declare module '@polkadot/types/lookup' { - /** @name FrameSystemAccountInfo (3) */ - interface FrameSystemAccountInfo extends Struct { - readonly nonce: u32; - readonly consumers: u32; - readonly providers: u32; - readonly sufficients: u32; - readonly data: PalletBalancesAccountData; + /** @name PolkadotPrimitivesV2PersistedValidationData (2) */ + export interface PolkadotPrimitivesV2PersistedValidationData extends Struct { + readonly parentHead: Bytes; + readonly relayParentNumber: u32; + readonly relayParentStorageRoot: H256; + readonly maxPovSize: u32; } - /** @name PalletBalancesAccountData (5) */ - interface PalletBalancesAccountData extends Struct { - readonly free: u128; - readonly reserved: u128; - readonly miscFrozen: u128; - readonly feeFrozen: u128; + /** @name PolkadotPrimitivesV2UpgradeRestriction (9) */ + export interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { + readonly isPresent: boolean; + readonly type: 'Present'; } - /** @name FrameSupportWeightsPerDispatchClassU64 (7) */ - interface FrameSupportWeightsPerDispatchClassU64 extends Struct { - readonly normal: u64; - readonly operational: u64; - readonly mandatory: u64; + /** @name SpTrieStorageProof (10) */ + export interface SpTrieStorageProof extends Struct { + readonly trieNodes: BTreeSet; } - /** @name SpRuntimeDigest (11) */ - interface SpRuntimeDigest extends Struct { - readonly logs: Vec; + /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (13) */ + export interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { + readonly dmqMqcHead: H256; + readonly relayDispatchQueueSize: ITuple<[u32, u32]>; + readonly ingressChannels: Vec>; + readonly egressChannels: Vec>; } - /** @name SpRuntimeDigestDigestItem (13) */ - interface SpRuntimeDigestDigestItem extends Enum { - readonly isOther: boolean; - readonly asOther: Bytes; - readonly isConsensus: boolean; - readonly asConsensus: ITuple<[U8aFixed, Bytes]>; - readonly isSeal: boolean; - readonly asSeal: ITuple<[U8aFixed, Bytes]>; - readonly isPreRuntime: boolean; - readonly asPreRuntime: ITuple<[U8aFixed, Bytes]>; - readonly isRuntimeEnvironmentUpdated: boolean; - readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated'; + /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (18) */ + export interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { + readonly maxCapacity: u32; + readonly maxTotalSize: u32; + readonly maxMessageSize: u32; + readonly msgCount: u32; + readonly totalSize: u32; + readonly mqcHead: Option; } - /** @name FrameSystemEventRecord (16) */ - interface FrameSystemEventRecord extends Struct { - readonly phase: FrameSystemPhase; - readonly event: Event; - readonly topics: Vec; + /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (20) */ + export interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { + readonly maxCodeSize: u32; + readonly maxHeadDataSize: u32; + readonly maxUpwardQueueCount: u32; + readonly maxUpwardQueueSize: u32; + readonly maxUpwardMessageSize: u32; + readonly maxUpwardMessageNumPerCandidate: u32; + readonly hrmpMaxMessageNumPerCandidate: u32; + readonly validationUpgradeCooldown: u32; + readonly validationUpgradeDelay: u32; } - /** @name FrameSystemEvent (18) */ - interface FrameSystemEvent extends Enum { - readonly isExtrinsicSuccess: boolean; - readonly asExtrinsicSuccess: { - readonly dispatchInfo: FrameSupportWeightsDispatchInfo; + /** @name PolkadotCorePrimitivesOutboundHrmpMessage (26) */ + export interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { + readonly recipient: u32; + readonly data: Bytes; + } + + /** @name CumulusPalletParachainSystemCall (28) */ + export interface CumulusPalletParachainSystemCall extends Enum { + readonly isSetValidationData: boolean; + readonly asSetValidationData: { + readonly data: CumulusPrimitivesParachainInherentParachainInherentData; } & Struct; readonly isExtrinsicFailed: boolean; readonly asExtrinsicFailed: { @@ -89,82 +94,28 @@ declare module '@polkadot/types/lookup' { readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked'; } - /** @name FrameSupportWeightsDispatchInfo (19) */ - interface FrameSupportWeightsDispatchInfo extends Struct { - readonly weight: u64; - readonly class: FrameSupportWeightsDispatchClass; - readonly paysFee: FrameSupportWeightsPays; - } - - /** @name FrameSupportWeightsDispatchClass (20) */ - interface FrameSupportWeightsDispatchClass extends Enum { - readonly isNormal: boolean; - readonly isOperational: boolean; - readonly isMandatory: boolean; - readonly type: 'Normal' | 'Operational' | 'Mandatory'; - } - - /** @name FrameSupportWeightsPays (21) */ - interface FrameSupportWeightsPays extends Enum { - readonly isYes: boolean; - readonly isNo: boolean; - readonly type: 'Yes' | 'No'; - } - - /** @name SpRuntimeDispatchError (22) */ - interface SpRuntimeDispatchError extends Enum { - readonly isOther: boolean; - readonly isCannotLookup: boolean; - readonly isBadOrigin: boolean; - readonly isModule: boolean; - readonly asModule: SpRuntimeModuleError; - readonly isConsumerRemaining: boolean; - readonly isNoProviders: boolean; - readonly isTooManyConsumers: boolean; - readonly isToken: boolean; - readonly asToken: SpRuntimeTokenError; - readonly isArithmetic: boolean; - readonly asArithmetic: SpRuntimeArithmeticError; - readonly isTransactional: boolean; - readonly asTransactional: SpRuntimeTransactionalError; - readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional'; - } - - /** @name SpRuntimeModuleError (23) */ - interface SpRuntimeModuleError extends Struct { - readonly index: u8; - readonly error: U8aFixed; - } - - /** @name SpRuntimeTokenError (24) */ - interface SpRuntimeTokenError extends Enum { - readonly isNoFunds: boolean; - readonly isWouldDie: boolean; - readonly isBelowMinimum: boolean; - readonly isCannotCreate: boolean; - readonly isUnknownAsset: boolean; - readonly isFrozen: boolean; - readonly isUnsupported: boolean; - readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported'; + /** @name CumulusPrimitivesParachainInherentParachainInherentData (29) */ + export interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { + readonly validationData: PolkadotPrimitivesV2PersistedValidationData; + readonly relayChainState: SpTrieStorageProof; + readonly downwardMessages: Vec; + readonly horizontalMessages: BTreeMap>; } - /** @name SpRuntimeArithmeticError (25) */ - interface SpRuntimeArithmeticError extends Enum { - readonly isUnderflow: boolean; - readonly isOverflow: boolean; - readonly isDivisionByZero: boolean; - readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero'; + /** @name PolkadotCorePrimitivesInboundDownwardMessage (31) */ + export interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { + readonly sentAt: u32; + readonly msg: Bytes; } - /** @name SpRuntimeTransactionalError (26) */ - interface SpRuntimeTransactionalError extends Enum { - readonly isLimitReached: boolean; - readonly isNoLayer: boolean; - readonly type: 'LimitReached' | 'NoLayer'; + /** @name PolkadotCorePrimitivesInboundHrmpMessage (34) */ + export interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { + readonly sentAt: u32; + readonly data: Bytes; } - /** @name CumulusPalletParachainSystemEvent (27) */ - interface CumulusPalletParachainSystemEvent extends Enum { + /** @name CumulusPalletParachainSystemEvent (37) */ + export interface CumulusPalletParachainSystemEvent extends Enum { readonly isValidationFunctionStored: boolean; readonly isValidationFunctionApplied: boolean; readonly asValidationFunctionApplied: { @@ -187,8 +138,94 @@ declare module '@polkadot/types/lookup' { readonly type: 'ValidationFunctionStored' | 'ValidationFunctionApplied' | 'ValidationFunctionDiscarded' | 'UpgradeAuthorized' | 'DownwardMessagesReceived' | 'DownwardMessagesProcessed'; } - /** @name PalletBalancesEvent (28) */ - interface PalletBalancesEvent extends Enum { + /** @name CumulusPalletParachainSystemError (38) */ + export interface CumulusPalletParachainSystemError extends Enum { + readonly isOverlappingUpgrades: boolean; + readonly isProhibitedByPolkadot: boolean; + readonly isTooBig: boolean; + readonly isValidationDataNotAvailable: boolean; + readonly isHostConfigurationNotAvailable: boolean; + readonly isNotScheduled: boolean; + readonly isNothingAuthorized: boolean; + readonly isUnauthorized: boolean; + readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized'; + } + + /** @name PalletBalancesAccountData (41) */ + export interface PalletBalancesAccountData extends Struct { + readonly free: u128; + readonly reserved: u128; + readonly miscFrozen: u128; + readonly feeFrozen: u128; + } + + /** @name PalletBalancesBalanceLock (43) */ + export interface PalletBalancesBalanceLock extends Struct { + readonly id: U8aFixed; + readonly amount: u128; + readonly reasons: PalletBalancesReasons; + } + + /** @name PalletBalancesReasons (45) */ + export interface PalletBalancesReasons extends Enum { + readonly isFee: boolean; + readonly isMisc: boolean; + readonly isAll: boolean; + readonly type: 'Fee' | 'Misc' | 'All'; + } + + /** @name PalletBalancesReserveData (48) */ + export interface PalletBalancesReserveData extends Struct { + readonly id: U8aFixed; + readonly amount: u128; + } + + /** @name PalletBalancesReleases (51) */ + export interface PalletBalancesReleases extends Enum { + readonly isV100: boolean; + readonly isV200: boolean; + readonly type: 'V100' | 'V200'; + } + + /** @name PalletBalancesCall (52) */ + export interface PalletBalancesCall extends Enum { + readonly isTransfer: boolean; + readonly asTransfer: { + readonly dest: MultiAddress; + readonly value: Compact; + } & Struct; + readonly isSetBalance: boolean; + readonly asSetBalance: { + readonly who: MultiAddress; + readonly newFree: Compact; + readonly newReserved: Compact; + } & Struct; + readonly isForceTransfer: boolean; + readonly asForceTransfer: { + readonly source: MultiAddress; + readonly dest: MultiAddress; + readonly value: Compact; + } & Struct; + readonly isTransferKeepAlive: boolean; + readonly asTransferKeepAlive: { + readonly dest: MultiAddress; + readonly value: Compact; + } & Struct; + readonly isTransferAll: boolean; + readonly asTransferAll: { + readonly dest: MultiAddress; + readonly keepAlive: bool; + } & Struct; + readonly isForceUnreserve: boolean; + readonly asForceUnreserve: { + readonly who: MultiAddress; + readonly amount: u128; + } & Struct; + readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; + } + + /** @name PalletBalancesEvent (58) */ + export interface PalletBalancesEvent extends Enum { readonly isEndowed: boolean; readonly asEndowed: { readonly account: AccountId32; @@ -246,26 +283,74 @@ declare module '@polkadot/types/lookup' { readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'BalanceSet' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'Deposit' | 'Withdraw' | 'Slashed'; } - /** @name FrameSupportTokensMiscBalanceStatus (29) */ - interface FrameSupportTokensMiscBalanceStatus extends Enum { + /** @name FrameSupportTokensMiscBalanceStatus (59) */ + export interface FrameSupportTokensMiscBalanceStatus extends Enum { readonly isFree: boolean; readonly isReserved: boolean; readonly type: 'Free' | 'Reserved'; } - /** @name PalletTransactionPaymentEvent (30) */ - interface PalletTransactionPaymentEvent extends Enum { - readonly isTransactionFeePaid: boolean; - readonly asTransactionFeePaid: { - readonly who: AccountId32; - readonly actualFee: u128; - readonly tip: u128; + /** @name PalletBalancesError (60) */ + export interface PalletBalancesError extends Enum { + readonly isVestingBalance: boolean; + readonly isLiquidityRestrictions: boolean; + readonly isInsufficientBalance: boolean; + readonly isExistentialDeposit: boolean; + readonly isKeepAlive: boolean; + readonly isExistingVestingSchedule: boolean; + readonly isDeadAccount: boolean; + readonly isTooManyReserves: boolean; + readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves'; + } + + /** @name PalletTimestampCall (63) */ + export interface PalletTimestampCall extends Enum { + readonly isSet: boolean; + readonly asSet: { + readonly now: Compact; + } & Struct; + readonly type: 'Set'; + } + + /** @name PalletTransactionPaymentReleases (66) */ + export interface PalletTransactionPaymentReleases extends Enum { + readonly isV1Ancient: boolean; + readonly isV2: boolean; + readonly type: 'V1Ancient' | 'V2'; + } + + /** @name PalletTreasuryProposal (67) */ + export interface PalletTreasuryProposal extends Struct { + readonly proposer: AccountId32; + readonly value: u128; + readonly beneficiary: AccountId32; + readonly bond: u128; + } + + /** @name PalletTreasuryCall (70) */ + export interface PalletTreasuryCall extends Enum { + readonly isProposeSpend: boolean; + readonly asProposeSpend: { + readonly value: Compact; + readonly beneficiary: MultiAddress; + } & Struct; + readonly isRejectProposal: boolean; + readonly asRejectProposal: { + readonly proposalId: Compact; + } & Struct; + readonly isApproveProposal: boolean; + readonly asApproveProposal: { + readonly proposalId: Compact; + } & Struct; + readonly isRemoveApproval: boolean; + readonly asRemoveApproval: { + readonly proposalId: Compact; } & Struct; - readonly type: 'TransactionFeePaid'; + readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'RemoveApproval'; } - /** @name PalletTreasuryEvent (31) */ - interface PalletTreasuryEvent extends Enum { + /** @name PalletTreasuryEvent (72) */ + export interface PalletTreasuryEvent extends Enum { readonly isProposed: boolean; readonly asProposed: { readonly proposalIndex: u32; @@ -297,39 +382,93 @@ declare module '@polkadot/types/lookup' { readonly asDeposit: { readonly value: u128; } & Struct; - readonly isSpendApproved: boolean; - readonly asSpendApproved: { - readonly proposalIndex: u32; - readonly amount: u128; - readonly beneficiary: AccountId32; - } & Struct; - readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit' | 'SpendApproved'; + readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit'; } - /** @name PalletSudoEvent (32) */ - interface PalletSudoEvent extends Enum { - readonly isSudid: boolean; - readonly asSudid: { - readonly sudoResult: Result; - } & Struct; - readonly isKeyChanged: boolean; - readonly asKeyChanged: { - readonly oldSudoer: Option; - } & Struct; - readonly isSudoAsDone: boolean; - readonly asSudoAsDone: { - readonly sudoResult: Result; - } & Struct; - readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone'; + /** @name FrameSupportPalletId (75) */ + export interface FrameSupportPalletId extends U8aFixed {} + + /** @name PalletTreasuryError (76) */ + export interface PalletTreasuryError extends Enum { + readonly isInsufficientProposersBalance: boolean; + readonly isInvalidIndex: boolean; + readonly isTooManyApprovals: boolean; + readonly isProposalNotApproved: boolean; + readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'ProposalNotApproved'; } - /** @name OrmlVestingModuleEvent (36) */ - interface OrmlVestingModuleEvent extends Enum { - readonly isVestingScheduleAdded: boolean; - readonly asVestingScheduleAdded: { - readonly from: AccountId32; - readonly to: AccountId32; - readonly vestingSchedule: OrmlVestingVestingSchedule; + /** @name PalletSudoCall (77) */ + export interface PalletSudoCall extends Enum { + readonly isSudo: boolean; + readonly asSudo: { + readonly call: Call; + } & Struct; + readonly isSudoUncheckedWeight: boolean; + readonly asSudoUncheckedWeight: { + readonly call: Call; + readonly weight: u64; + } & Struct; + readonly isSetKey: boolean; + readonly asSetKey: { + readonly new_: MultiAddress; + } & Struct; + readonly isSudoAs: boolean; + readonly asSudoAs: { + readonly who: MultiAddress; + readonly call: Call; + } & Struct; + readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit' | 'SpendApproved'; + } + + /** @name FrameSystemCall (79) */ + export interface FrameSystemCall extends Enum { + readonly isFillBlock: boolean; + readonly asFillBlock: { + readonly ratio: Perbill; + } & Struct; + readonly isRemark: boolean; + readonly asRemark: { + readonly remark: Bytes; + } & Struct; + readonly isSetHeapPages: boolean; + readonly asSetHeapPages: { + readonly pages: u64; + } & Struct; + readonly isSetCode: boolean; + readonly asSetCode: { + readonly code: Bytes; + } & Struct; + readonly isSetCodeWithoutChecks: boolean; + readonly asSetCodeWithoutChecks: { + readonly code: Bytes; + } & Struct; + readonly isSetStorage: boolean; + readonly asSetStorage: { + readonly items: Vec>; + } & Struct; + readonly isKillStorage: boolean; + readonly asKillStorage: { + readonly keys_: Vec; + } & Struct; + readonly isKillPrefix: boolean; + readonly asKillPrefix: { + readonly prefix: Bytes; + readonly subkeys: u32; + } & Struct; + readonly isRemarkWithEvent: boolean; + readonly asRemarkWithEvent: { + readonly remark: Bytes; + } & Struct; + readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent'; + } + + /** @name OrmlVestingModuleCall (83) */ + export interface OrmlVestingModuleCall extends Enum { + readonly isClaim: boolean; + readonly isVestedTransfer: boolean; + readonly asVestedTransfer: { + readonly dest: MultiAddress; + readonly schedule: OrmlVestingVestingSchedule; } & Struct; readonly isClaimed: boolean; readonly asClaimed: { @@ -343,20 +482,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated'; } - /** @name OrmlVestingVestingSchedule (37) */ - interface OrmlVestingVestingSchedule extends Struct { + /** @name OrmlVestingVestingSchedule (84) */ + export interface OrmlVestingVestingSchedule extends Struct { readonly start: u32; readonly period: u32; readonly periodCount: u32; readonly perPeriod: Compact; } - /** @name CumulusPalletXcmpQueueEvent (39) */ - interface CumulusPalletXcmpQueueEvent extends Enum { - readonly isSuccess: boolean; - readonly asSuccess: { - readonly messageHash: Option; - readonly weight: u64; + /** @name CumulusPalletXcmpQueueCall (86) */ + export interface CumulusPalletXcmpQueueCall extends Enum { + readonly isServiceOverweight: boolean; + readonly asServiceOverweight: { + readonly index: u64; + readonly weightLimit: u64; } & Struct; readonly isFail: boolean; readonly asFail: { @@ -395,117 +534,102 @@ declare module '@polkadot/types/lookup' { readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name XcmV2TraitsError (41) */ - interface XcmV2TraitsError extends Enum { - readonly isOverflow: boolean; - readonly isUnimplemented: boolean; - readonly isUntrustedReserveLocation: boolean; - readonly isUntrustedTeleportLocation: boolean; - readonly isMultiLocationFull: boolean; - readonly isMultiLocationNotInvertible: boolean; - readonly isBadOrigin: boolean; - readonly isInvalidLocation: boolean; - readonly isAssetNotFound: boolean; - readonly isFailedToTransactAsset: boolean; - readonly isNotWithdrawable: boolean; - readonly isLocationCannotHold: boolean; - readonly isExceedsMaxMessageSize: boolean; - readonly isDestinationUnsupported: boolean; - readonly isTransport: boolean; - readonly isUnroutable: boolean; - readonly isUnknownClaim: boolean; - readonly isFailedToDecode: boolean; - readonly isMaxWeightInvalid: boolean; - readonly isNotHoldingFees: boolean; - readonly isTooExpensive: boolean; - readonly isTrap: boolean; - readonly asTrap: u64; - readonly isUnhandledXcmVersion: boolean; - readonly isWeightLimitReached: boolean; - readonly asWeightLimitReached: u64; - readonly isBarrier: boolean; - readonly isWeightNotComputable: boolean; - readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable'; - } - - /** @name PalletXcmEvent (43) */ - interface PalletXcmEvent extends Enum { - readonly isAttempted: boolean; - readonly asAttempted: XcmV2TraitsOutcome; - readonly isSent: boolean; - readonly asSent: ITuple<[XcmV1MultiLocation, XcmV1MultiLocation, XcmV2Xcm]>; - readonly isUnexpectedResponse: boolean; - readonly asUnexpectedResponse: ITuple<[XcmV1MultiLocation, u64]>; - readonly isResponseReady: boolean; - readonly asResponseReady: ITuple<[u64, XcmV2Response]>; - readonly isNotified: boolean; - readonly asNotified: ITuple<[u64, u8, u8]>; - readonly isNotifyOverweight: boolean; - readonly asNotifyOverweight: ITuple<[u64, u8, u8, u64, u64]>; - readonly isNotifyDispatchError: boolean; - readonly asNotifyDispatchError: ITuple<[u64, u8, u8]>; - readonly isNotifyDecodeFailed: boolean; - readonly asNotifyDecodeFailed: ITuple<[u64, u8, u8]>; - readonly isInvalidResponder: boolean; - readonly asInvalidResponder: ITuple<[XcmV1MultiLocation, u64, Option]>; - readonly isInvalidResponderVersion: boolean; - readonly asInvalidResponderVersion: ITuple<[XcmV1MultiLocation, u64]>; - readonly isResponseTaken: boolean; - readonly asResponseTaken: u64; - readonly isAssetsTrapped: boolean; - readonly asAssetsTrapped: ITuple<[H256, XcmV1MultiLocation, XcmVersionedMultiAssets]>; - readonly isVersionChangeNotified: boolean; - readonly asVersionChangeNotified: ITuple<[XcmV1MultiLocation, u32]>; - readonly isSupportedVersionChanged: boolean; - readonly asSupportedVersionChanged: ITuple<[XcmV1MultiLocation, u32]>; - readonly isNotifyTargetSendFail: boolean; - readonly asNotifyTargetSendFail: ITuple<[XcmV1MultiLocation, u64, XcmV2TraitsError]>; - readonly isNotifyTargetMigrationFail: boolean; - readonly asNotifyTargetMigrationFail: ITuple<[XcmVersionedMultiLocation, u64]>; - readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail'; - } - - /** @name XcmV2TraitsOutcome (44) */ - interface XcmV2TraitsOutcome extends Enum { - readonly isComplete: boolean; - readonly asComplete: u64; - readonly isIncomplete: boolean; - readonly asIncomplete: ITuple<[u64, XcmV2TraitsError]>; - readonly isError: boolean; - readonly asError: XcmV2TraitsError; - readonly type: 'Complete' | 'Incomplete' | 'Error'; + /** @name PalletXcmCall (87) */ + export interface PalletXcmCall extends Enum { + readonly isSend: boolean; + readonly asSend: { + readonly dest: XcmVersionedMultiLocation; + readonly message: XcmVersionedXcm; + } & Struct; + readonly isTeleportAssets: boolean; + readonly asTeleportAssets: { + readonly dest: XcmVersionedMultiLocation; + readonly beneficiary: XcmVersionedMultiLocation; + readonly assets: XcmVersionedMultiAssets; + readonly feeAssetItem: u32; + } & Struct; + readonly isReserveTransferAssets: boolean; + readonly asReserveTransferAssets: { + readonly dest: XcmVersionedMultiLocation; + readonly beneficiary: XcmVersionedMultiLocation; + readonly assets: XcmVersionedMultiAssets; + readonly feeAssetItem: u32; + } & Struct; + readonly isExecute: boolean; + readonly asExecute: { + readonly message: XcmVersionedXcm; + readonly maxWeight: u64; + } & Struct; + readonly isForceXcmVersion: boolean; + readonly asForceXcmVersion: { + readonly location: XcmV1MultiLocation; + readonly xcmVersion: u32; + } & Struct; + readonly isForceDefaultXcmVersion: boolean; + readonly asForceDefaultXcmVersion: { + readonly maybeXcmVersion: Option; + } & Struct; + readonly isForceSubscribeVersionNotify: boolean; + readonly asForceSubscribeVersionNotify: { + readonly location: XcmVersionedMultiLocation; + } & Struct; + readonly isForceUnsubscribeVersionNotify: boolean; + readonly asForceUnsubscribeVersionNotify: { + readonly location: XcmVersionedMultiLocation; + } & Struct; + readonly isLimitedReserveTransferAssets: boolean; + readonly asLimitedReserveTransferAssets: { + readonly dest: XcmVersionedMultiLocation; + readonly beneficiary: XcmVersionedMultiLocation; + readonly assets: XcmVersionedMultiAssets; + readonly feeAssetItem: u32; + readonly weightLimit: XcmV2WeightLimit; + } & Struct; + readonly isLimitedTeleportAssets: boolean; + readonly asLimitedTeleportAssets: { + readonly dest: XcmVersionedMultiLocation; + readonly beneficiary: XcmVersionedMultiLocation; + readonly assets: XcmVersionedMultiAssets; + readonly feeAssetItem: u32; + readonly weightLimit: XcmV2WeightLimit; + } & Struct; + readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets'; } - /** @name XcmV1MultiLocation (45) */ - interface XcmV1MultiLocation extends Struct { - readonly parents: u8; - readonly interior: XcmV1MultilocationJunctions; + /** @name XcmVersionedMultiLocation (88) */ + export interface XcmVersionedMultiLocation extends Enum { + readonly isV0: boolean; + readonly asV0: XcmV0MultiLocation; + readonly isV1: boolean; + readonly asV1: XcmV1MultiLocation; + readonly type: 'V0' | 'V1'; } - /** @name XcmV1MultilocationJunctions (46) */ - interface XcmV1MultilocationJunctions extends Enum { - readonly isHere: boolean; + /** @name XcmV0MultiLocation (89) */ + export interface XcmV0MultiLocation extends Enum { + readonly isNull: boolean; readonly isX1: boolean; - readonly asX1: XcmV1Junction; + readonly asX1: XcmV0Junction; readonly isX2: boolean; - readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>; + readonly asX2: ITuple<[XcmV0Junction, XcmV0Junction]>; readonly isX3: boolean; - readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly asX3: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction]>; readonly isX4: boolean; - readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly asX4: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; readonly isX5: boolean; - readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly asX5: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; readonly isX6: boolean; - readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly asX6: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; readonly isX7: boolean; - readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly asX7: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; readonly isX8: boolean; - readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; + readonly asX8: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly type: 'Null' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; } - /** @name XcmV1Junction (47) */ - interface XcmV1Junction extends Enum { + /** @name XcmV0Junction (90) */ + export interface XcmV0Junction extends Enum { + readonly isParent: boolean; readonly isParachain: boolean; readonly asParachain: Compact; readonly isAccountId32: boolean; @@ -535,11 +659,11 @@ declare module '@polkadot/types/lookup' { readonly id: XcmV0JunctionBodyId; readonly part: XcmV0JunctionBodyPart; } & Struct; - readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; + readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; } - /** @name XcmV0JunctionNetworkId (49) */ - interface XcmV0JunctionNetworkId extends Enum { + /** @name XcmV0JunctionNetworkId (91) */ + export interface XcmV0JunctionNetworkId extends Enum { readonly isAny: boolean; readonly isNamed: boolean; readonly asNamed: Bytes; @@ -548,8 +672,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama'; } - /** @name XcmV0JunctionBodyId (53) */ - interface XcmV0JunctionBodyId extends Enum { + /** @name XcmV0JunctionBodyId (92) */ + export interface XcmV0JunctionBodyId extends Enum { readonly isUnit: boolean; readonly isNamed: boolean; readonly asNamed: Bytes; @@ -562,8 +686,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial'; } - /** @name XcmV0JunctionBodyPart (54) */ - interface XcmV0JunctionBodyPart extends Enum { + /** @name XcmV0JunctionBodyPart (93) */ + export interface XcmV0JunctionBodyPart extends Enum { readonly isVoice: boolean; readonly isMembers: boolean; readonly asMembers: { @@ -587,38 +711,116 @@ declare module '@polkadot/types/lookup' { readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion'; } - /** @name XcmV2Xcm (55) */ - interface XcmV2Xcm extends Vec {} + /** @name XcmV1MultiLocation (94) */ + export interface XcmV1MultiLocation extends Struct { + readonly parents: u8; + readonly interior: XcmV1MultilocationJunctions; + } - /** @name XcmV2Instruction (57) */ - interface XcmV2Instruction extends Enum { - readonly isWithdrawAsset: boolean; - readonly asWithdrawAsset: XcmV1MultiassetMultiAssets; - readonly isReserveAssetDeposited: boolean; - readonly asReserveAssetDeposited: XcmV1MultiassetMultiAssets; - readonly isReceiveTeleportedAsset: boolean; - readonly asReceiveTeleportedAsset: XcmV1MultiassetMultiAssets; - readonly isQueryResponse: boolean; - readonly asQueryResponse: { + /** @name XcmV1MultilocationJunctions (95) */ + export interface XcmV1MultilocationJunctions extends Enum { + readonly isHere: boolean; + readonly isX1: boolean; + readonly asX1: XcmV1Junction; + readonly isX2: boolean; + readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>; + readonly isX3: boolean; + readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly isX4: boolean; + readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly isX5: boolean; + readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly isX6: boolean; + readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly isX7: boolean; + readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly isX8: boolean; + readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; + } + + /** @name XcmV1Junction (96) */ + export interface XcmV1Junction extends Enum { + readonly isParachain: boolean; + readonly asParachain: Compact; + readonly isAccountId32: boolean; + readonly asAccountId32: { + readonly network: XcmV0JunctionNetworkId; + readonly id: U8aFixed; + } & Struct; + readonly isAccountIndex64: boolean; + readonly asAccountIndex64: { + readonly network: XcmV0JunctionNetworkId; + readonly index: Compact; + } & Struct; + readonly isAccountKey20: boolean; + readonly asAccountKey20: { + readonly network: XcmV0JunctionNetworkId; + readonly key: U8aFixed; + } & Struct; + readonly isPalletInstance: boolean; + readonly asPalletInstance: u8; + readonly isGeneralIndex: boolean; + readonly asGeneralIndex: Compact; + readonly isGeneralKey: boolean; + readonly asGeneralKey: Bytes; + readonly isOnlyChild: boolean; + readonly isPlurality: boolean; + readonly asPlurality: { + readonly id: XcmV0JunctionBodyId; + readonly part: XcmV0JunctionBodyPart; + } & Struct; + readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; + } + + /** @name XcmVersionedXcm (97) */ + export interface XcmVersionedXcm extends Enum { + readonly isV0: boolean; + readonly asV0: XcmV0Xcm; + readonly isV1: boolean; + readonly asV1: XcmV1Xcm; + readonly isV2: boolean; + readonly asV2: XcmV2Xcm; + readonly type: 'V0' | 'V1' | 'V2'; + } + + /** @name XcmV0Xcm (98) */ + export interface XcmV0Xcm extends Enum { + readonly isWithdrawAsset: boolean; + readonly asWithdrawAsset: { + readonly assets: Vec; + readonly effects: Vec; + } & Struct; + readonly isReserveAssetDeposit: boolean; + readonly asReserveAssetDeposit: { + readonly assets: Vec; + readonly effects: Vec; + } & Struct; + readonly isTeleportAsset: boolean; + readonly asTeleportAsset: { + readonly assets: Vec; + readonly effects: Vec; + } & Struct; + readonly isQueryResponse: boolean; + readonly asQueryResponse: { readonly queryId: Compact; - readonly response: XcmV2Response; - readonly maxWeight: Compact; + readonly response: XcmV0Response; } & Struct; readonly isTransferAsset: boolean; readonly asTransferAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly beneficiary: XcmV1MultiLocation; + readonly assets: Vec; + readonly dest: XcmV0MultiLocation; } & Struct; readonly isTransferReserveAsset: boolean; readonly asTransferReserveAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly dest: XcmV1MultiLocation; - readonly xcm: XcmV2Xcm; + readonly assets: Vec; + readonly dest: XcmV0MultiLocation; + readonly effects: Vec; } & Struct; readonly isTransact: boolean; readonly asTransact: { readonly originType: XcmV0OriginKind; - readonly requireWeightAtMost: Compact; + readonly requireWeightAtMost: u64; readonly call: XcmDoubleEncoded; } & Struct; readonly isHrmpNewChannelOpenRequest: boolean; @@ -637,152 +839,294 @@ declare module '@polkadot/types/lookup' { readonly sender: Compact; readonly recipient: Compact; } & Struct; - readonly isClearOrigin: boolean; - readonly isDescendOrigin: boolean; - readonly asDescendOrigin: XcmV1MultilocationJunctions; - readonly isReportError: boolean; - readonly asReportError: { - readonly queryId: Compact; - readonly dest: XcmV1MultiLocation; - readonly maxResponseWeight: Compact; + readonly isRelayedFrom: boolean; + readonly asRelayedFrom: { + readonly who: XcmV0MultiLocation; + readonly message: XcmV0Xcm; + } & Struct; + readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom'; + } + + /** @name XcmV0MultiAsset (100) */ + export interface XcmV0MultiAsset extends Enum { + readonly isNone: boolean; + readonly isAll: boolean; + readonly isAllFungible: boolean; + readonly isAllNonFungible: boolean; + readonly isAllAbstractFungible: boolean; + readonly asAllAbstractFungible: { + readonly id: Bytes; + } & Struct; + readonly isAllAbstractNonFungible: boolean; + readonly asAllAbstractNonFungible: { + readonly class: Bytes; + } & Struct; + readonly isAllConcreteFungible: boolean; + readonly asAllConcreteFungible: { + readonly id: XcmV0MultiLocation; + } & Struct; + readonly isAllConcreteNonFungible: boolean; + readonly asAllConcreteNonFungible: { + readonly class: XcmV0MultiLocation; } & Struct; + readonly isAbstractFungible: boolean; + readonly asAbstractFungible: { + readonly id: Bytes; + readonly amount: Compact; + } & Struct; + readonly isAbstractNonFungible: boolean; + readonly asAbstractNonFungible: { + readonly class: Bytes; + readonly instance: XcmV1MultiassetAssetInstance; + } & Struct; + readonly isConcreteFungible: boolean; + readonly asConcreteFungible: { + readonly id: XcmV0MultiLocation; + readonly amount: Compact; + } & Struct; + readonly isConcreteNonFungible: boolean; + readonly asConcreteNonFungible: { + readonly class: XcmV0MultiLocation; + readonly instance: XcmV1MultiassetAssetInstance; + } & Struct; + readonly type: 'None' | 'All' | 'AllFungible' | 'AllNonFungible' | 'AllAbstractFungible' | 'AllAbstractNonFungible' | 'AllConcreteFungible' | 'AllConcreteNonFungible' | 'AbstractFungible' | 'AbstractNonFungible' | 'ConcreteFungible' | 'ConcreteNonFungible'; + } + + /** @name XcmV1MultiassetAssetInstance (101) */ + export interface XcmV1MultiassetAssetInstance extends Enum { + readonly isUndefined: boolean; + readonly isIndex: boolean; + readonly asIndex: Compact; + readonly isArray4: boolean; + readonly asArray4: U8aFixed; + readonly isArray8: boolean; + readonly asArray8: U8aFixed; + readonly isArray16: boolean; + readonly asArray16: U8aFixed; + readonly isArray32: boolean; + readonly asArray32: U8aFixed; + readonly isBlob: boolean; + readonly asBlob: Bytes; + readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob'; + } + + /** @name XcmV0Order (104) */ + export interface XcmV0Order extends Enum { + readonly isNull: boolean; readonly isDepositAsset: boolean; readonly asDepositAsset: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly maxAssets: Compact; - readonly beneficiary: XcmV1MultiLocation; + readonly assets: Vec; + readonly dest: XcmV0MultiLocation; } & Struct; readonly isDepositReserveAsset: boolean; readonly asDepositReserveAsset: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly maxAssets: Compact; - readonly dest: XcmV1MultiLocation; - readonly xcm: XcmV2Xcm; + readonly assets: Vec; + readonly dest: XcmV0MultiLocation; + readonly effects: Vec; } & Struct; readonly isExchangeAsset: boolean; readonly asExchangeAsset: { - readonly give: XcmV1MultiassetMultiAssetFilter; - readonly receive: XcmV1MultiassetMultiAssets; + readonly give: Vec; + readonly receive: Vec; } & Struct; readonly isInitiateReserveWithdraw: boolean; readonly asInitiateReserveWithdraw: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly reserve: XcmV1MultiLocation; - readonly xcm: XcmV2Xcm; + readonly assets: Vec; + readonly reserve: XcmV0MultiLocation; + readonly effects: Vec; } & Struct; readonly isInitiateTeleport: boolean; readonly asInitiateTeleport: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly dest: XcmV1MultiLocation; - readonly xcm: XcmV2Xcm; + readonly assets: Vec; + readonly dest: XcmV0MultiLocation; + readonly effects: Vec; } & Struct; readonly isQueryHolding: boolean; readonly asQueryHolding: { readonly queryId: Compact; - readonly dest: XcmV1MultiLocation; - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly maxResponseWeight: Compact; + readonly dest: XcmV0MultiLocation; + readonly assets: Vec; } & Struct; readonly isBuyExecution: boolean; readonly asBuyExecution: { - readonly fees: XcmV1MultiAsset; - readonly weightLimit: XcmV2WeightLimit; - } & Struct; - readonly isRefundSurplus: boolean; - readonly isSetErrorHandler: boolean; - readonly asSetErrorHandler: XcmV2Xcm; - readonly isSetAppendix: boolean; - readonly asSetAppendix: XcmV2Xcm; - readonly isClearError: boolean; - readonly isClaimAsset: boolean; - readonly asClaimAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly ticket: XcmV1MultiLocation; - } & Struct; - readonly isTrap: boolean; - readonly asTrap: Compact; - readonly isSubscribeVersion: boolean; - readonly asSubscribeVersion: { - readonly queryId: Compact; - readonly maxResponseWeight: Compact; + readonly fees: XcmV0MultiAsset; + readonly weight: u64; + readonly debt: u64; + readonly haltOnError: bool; + readonly xcm: Vec; } & Struct; - readonly isUnsubscribeVersion: boolean; - readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion'; + readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV1MultiassetMultiAssets (58) */ - interface XcmV1MultiassetMultiAssets extends Vec {} - - /** @name XcmV1MultiAsset (60) */ - interface XcmV1MultiAsset extends Struct { - readonly id: XcmV1MultiassetAssetId; - readonly fun: XcmV1MultiassetFungibility; + /** @name XcmV0Response (106) */ + export interface XcmV0Response extends Enum { + readonly isAssets: boolean; + readonly asAssets: Vec; + readonly type: 'Assets'; } - /** @name XcmV1MultiassetAssetId (61) */ - interface XcmV1MultiassetAssetId extends Enum { - readonly isConcrete: boolean; - readonly asConcrete: XcmV1MultiLocation; - readonly isAbstract: boolean; - readonly asAbstract: Bytes; - readonly type: 'Concrete' | 'Abstract'; + /** @name XcmV0OriginKind (107) */ + export interface XcmV0OriginKind extends Enum { + readonly isNative: boolean; + readonly isSovereignAccount: boolean; + readonly isSuperuser: boolean; + readonly isXcm: boolean; + readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm'; } - /** @name XcmV1MultiassetFungibility (62) */ - interface XcmV1MultiassetFungibility extends Enum { - readonly isFungible: boolean; - readonly asFungible: Compact; - readonly isNonFungible: boolean; - readonly asNonFungible: XcmV1MultiassetAssetInstance; - readonly type: 'Fungible' | 'NonFungible'; + /** @name XcmDoubleEncoded (108) */ + export interface XcmDoubleEncoded extends Struct { + readonly encoded: Bytes; } - /** @name XcmV1MultiassetAssetInstance (63) */ - interface XcmV1MultiassetAssetInstance extends Enum { - readonly isUndefined: boolean; - readonly isIndex: boolean; - readonly asIndex: Compact; - readonly isArray4: boolean; - readonly asArray4: U8aFixed; - readonly isArray8: boolean; - readonly asArray8: U8aFixed; - readonly isArray16: boolean; - readonly asArray16: U8aFixed; - readonly isArray32: boolean; - readonly asArray32: U8aFixed; - readonly isBlob: boolean; - readonly asBlob: Bytes; - readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob'; + /** @name XcmV1Xcm (109) */ + export interface XcmV1Xcm extends Enum { + readonly isWithdrawAsset: boolean; + readonly asWithdrawAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly effects: Vec; + } & Struct; + readonly isReserveAssetDeposited: boolean; + readonly asReserveAssetDeposited: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly effects: Vec; + } & Struct; + readonly isReceiveTeleportedAsset: boolean; + readonly asReceiveTeleportedAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly effects: Vec; + } & Struct; + readonly isQueryResponse: boolean; + readonly asQueryResponse: { + readonly queryId: Compact; + readonly response: XcmV1Response; + } & Struct; + readonly isTransferAsset: boolean; + readonly asTransferAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly beneficiary: XcmV1MultiLocation; + } & Struct; + readonly isTransferReserveAsset: boolean; + readonly asTransferReserveAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly dest: XcmV1MultiLocation; + readonly effects: Vec; + } & Struct; + readonly isTransact: boolean; + readonly asTransact: { + readonly originType: XcmV0OriginKind; + readonly requireWeightAtMost: u64; + readonly call: XcmDoubleEncoded; + } & Struct; + readonly isHrmpNewChannelOpenRequest: boolean; + readonly asHrmpNewChannelOpenRequest: { + readonly sender: Compact; + readonly maxMessageSize: Compact; + readonly maxCapacity: Compact; + } & Struct; + readonly isHrmpChannelAccepted: boolean; + readonly asHrmpChannelAccepted: { + readonly recipient: Compact; + } & Struct; + readonly isHrmpChannelClosing: boolean; + readonly asHrmpChannelClosing: { + readonly initiator: Compact; + readonly sender: Compact; + readonly recipient: Compact; + } & Struct; + readonly isRelayedFrom: boolean; + readonly asRelayedFrom: { + readonly who: XcmV1MultilocationJunctions; + readonly message: XcmV1Xcm; + } & Struct; + readonly isSubscribeVersion: boolean; + readonly asSubscribeVersion: { + readonly queryId: Compact; + readonly maxResponseWeight: Compact; + } & Struct; + readonly isUnsubscribeVersion: boolean; + readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion'; } - /** @name XcmV2Response (66) */ - interface XcmV2Response extends Enum { - readonly isNull: boolean; - readonly isAssets: boolean; - readonly asAssets: XcmV1MultiassetMultiAssets; - readonly isExecutionResult: boolean; - readonly asExecutionResult: Option>; - readonly isVersion: boolean; - readonly asVersion: u32; - readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version'; + /** @name XcmV1MultiassetMultiAssets (110) */ + export interface XcmV1MultiassetMultiAssets extends Vec {} + + /** @name XcmV1MultiAsset (112) */ + export interface XcmV1MultiAsset extends Struct { + readonly id: XcmV1MultiassetAssetId; + readonly fun: XcmV1MultiassetFungibility; } - /** @name XcmV0OriginKind (69) */ - interface XcmV0OriginKind extends Enum { - readonly isNative: boolean; - readonly isSovereignAccount: boolean; - readonly isSuperuser: boolean; - readonly isXcm: boolean; - readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm'; + /** @name XcmV1MultiassetAssetId (113) */ + export interface XcmV1MultiassetAssetId extends Enum { + readonly isConcrete: boolean; + readonly asConcrete: XcmV1MultiLocation; + readonly isAbstract: boolean; + readonly asAbstract: Bytes; + readonly type: 'Concrete' | 'Abstract'; } - /** @name XcmDoubleEncoded (70) */ - interface XcmDoubleEncoded extends Struct { - readonly encoded: Bytes; + /** @name XcmV1MultiassetFungibility (114) */ + export interface XcmV1MultiassetFungibility extends Enum { + readonly isFungible: boolean; + readonly asFungible: Compact; + readonly isNonFungible: boolean; + readonly asNonFungible: XcmV1MultiassetAssetInstance; + readonly type: 'Fungible' | 'NonFungible'; + } + + /** @name XcmV1Order (116) */ + export interface XcmV1Order extends Enum { + readonly isNoop: boolean; + readonly isDepositAsset: boolean; + readonly asDepositAsset: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly maxAssets: u32; + readonly beneficiary: XcmV1MultiLocation; + } & Struct; + readonly isDepositReserveAsset: boolean; + readonly asDepositReserveAsset: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly maxAssets: u32; + readonly dest: XcmV1MultiLocation; + readonly effects: Vec; + } & Struct; + readonly isExchangeAsset: boolean; + readonly asExchangeAsset: { + readonly give: XcmV1MultiassetMultiAssetFilter; + readonly receive: XcmV1MultiassetMultiAssets; + } & Struct; + readonly isInitiateReserveWithdraw: boolean; + readonly asInitiateReserveWithdraw: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly reserve: XcmV1MultiLocation; + readonly effects: Vec; + } & Struct; + readonly isInitiateTeleport: boolean; + readonly asInitiateTeleport: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly dest: XcmV1MultiLocation; + readonly effects: Vec; + } & Struct; + readonly isQueryHolding: boolean; + readonly asQueryHolding: { + readonly queryId: Compact; + readonly dest: XcmV1MultiLocation; + readonly assets: XcmV1MultiassetMultiAssetFilter; + } & Struct; + readonly isBuyExecution: boolean; + readonly asBuyExecution: { + readonly fees: XcmV1MultiAsset; + readonly weight: u64; + readonly debt: u64; + readonly haltOnError: bool; + readonly instructions: Vec; + } & Struct; + readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV1MultiassetMultiAssetFilter (71) */ - interface XcmV1MultiassetMultiAssetFilter extends Enum { + /** @name XcmV1MultiassetMultiAssetFilter (117) */ + export interface XcmV1MultiassetMultiAssetFilter extends Enum { readonly isDefinite: boolean; readonly asDefinite: XcmV1MultiassetMultiAssets; readonly isWild: boolean; @@ -790,8 +1134,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Definite' | 'Wild'; } - /** @name XcmV1MultiassetWildMultiAsset (72) */ - interface XcmV1MultiassetWildMultiAsset extends Enum { + /** @name XcmV1MultiassetWildMultiAsset (118) */ + export interface XcmV1MultiassetWildMultiAsset extends Enum { readonly isAll: boolean; readonly isAllOf: boolean; readonly asAllOf: { @@ -801,128 +1145,216 @@ declare module '@polkadot/types/lookup' { readonly type: 'All' | 'AllOf'; } - /** @name XcmV1MultiassetWildFungibility (73) */ - interface XcmV1MultiassetWildFungibility extends Enum { + /** @name XcmV1MultiassetWildFungibility (119) */ + export interface XcmV1MultiassetWildFungibility extends Enum { readonly isFungible: boolean; readonly isNonFungible: boolean; readonly type: 'Fungible' | 'NonFungible'; } - /** @name XcmV2WeightLimit (74) */ - interface XcmV2WeightLimit extends Enum { - readonly isUnlimited: boolean; - readonly isLimited: boolean; - readonly asLimited: Compact; - readonly type: 'Unlimited' | 'Limited'; + /** @name XcmV1Response (121) */ + export interface XcmV1Response extends Enum { + readonly isAssets: boolean; + readonly asAssets: XcmV1MultiassetMultiAssets; + readonly isVersion: boolean; + readonly asVersion: u32; + readonly type: 'Assets' | 'Version'; } - /** @name XcmVersionedMultiAssets (76) */ - interface XcmVersionedMultiAssets extends Enum { - readonly isV0: boolean; - readonly asV0: Vec; - readonly isV1: boolean; - readonly asV1: XcmV1MultiassetMultiAssets; - readonly type: 'V0' | 'V1'; - } + /** @name XcmV2Xcm (122) */ + export interface XcmV2Xcm extends Vec {} - /** @name XcmV0MultiAsset (78) */ - interface XcmV0MultiAsset extends Enum { - readonly isNone: boolean; - readonly isAll: boolean; - readonly isAllFungible: boolean; - readonly isAllNonFungible: boolean; - readonly isAllAbstractFungible: boolean; - readonly asAllAbstractFungible: { - readonly id: Bytes; + /** @name XcmV2Instruction (124) */ + export interface XcmV2Instruction extends Enum { + readonly isWithdrawAsset: boolean; + readonly asWithdrawAsset: XcmV1MultiassetMultiAssets; + readonly isReserveAssetDeposited: boolean; + readonly asReserveAssetDeposited: XcmV1MultiassetMultiAssets; + readonly isReceiveTeleportedAsset: boolean; + readonly asReceiveTeleportedAsset: XcmV1MultiassetMultiAssets; + readonly isQueryResponse: boolean; + readonly asQueryResponse: { + readonly queryId: Compact; + readonly response: XcmV2Response; + readonly maxWeight: Compact; } & Struct; - readonly isAllAbstractNonFungible: boolean; - readonly asAllAbstractNonFungible: { - readonly class: Bytes; + readonly isTransferAsset: boolean; + readonly asTransferAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly beneficiary: XcmV1MultiLocation; } & Struct; - readonly isAllConcreteFungible: boolean; - readonly asAllConcreteFungible: { - readonly id: XcmV0MultiLocation; + readonly isTransferReserveAsset: boolean; + readonly asTransferReserveAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly dest: XcmV1MultiLocation; + readonly xcm: XcmV2Xcm; } & Struct; - readonly isAllConcreteNonFungible: boolean; - readonly asAllConcreteNonFungible: { - readonly class: XcmV0MultiLocation; + readonly isTransact: boolean; + readonly asTransact: { + readonly originType: XcmV0OriginKind; + readonly requireWeightAtMost: Compact; + readonly call: XcmDoubleEncoded; } & Struct; - readonly isAbstractFungible: boolean; - readonly asAbstractFungible: { - readonly id: Bytes; - readonly amount: Compact; + readonly isHrmpNewChannelOpenRequest: boolean; + readonly asHrmpNewChannelOpenRequest: { + readonly sender: Compact; + readonly maxMessageSize: Compact; + readonly maxCapacity: Compact; } & Struct; - readonly isAbstractNonFungible: boolean; - readonly asAbstractNonFungible: { - readonly class: Bytes; - readonly instance: XcmV1MultiassetAssetInstance; + readonly isHrmpChannelAccepted: boolean; + readonly asHrmpChannelAccepted: { + readonly recipient: Compact; } & Struct; - readonly isConcreteFungible: boolean; - readonly asConcreteFungible: { - readonly id: XcmV0MultiLocation; - readonly amount: Compact; + readonly isHrmpChannelClosing: boolean; + readonly asHrmpChannelClosing: { + readonly initiator: Compact; + readonly sender: Compact; + readonly recipient: Compact; } & Struct; - readonly isConcreteNonFungible: boolean; - readonly asConcreteNonFungible: { - readonly class: XcmV0MultiLocation; - readonly instance: XcmV1MultiassetAssetInstance; + readonly isClearOrigin: boolean; + readonly isDescendOrigin: boolean; + readonly asDescendOrigin: XcmV1MultilocationJunctions; + readonly isReportError: boolean; + readonly asReportError: { + readonly queryId: Compact; + readonly dest: XcmV1MultiLocation; + readonly maxResponseWeight: Compact; } & Struct; - readonly type: 'None' | 'All' | 'AllFungible' | 'AllNonFungible' | 'AllAbstractFungible' | 'AllAbstractNonFungible' | 'AllConcreteFungible' | 'AllConcreteNonFungible' | 'AbstractFungible' | 'AbstractNonFungible' | 'ConcreteFungible' | 'ConcreteNonFungible'; - } - - /** @name XcmV0MultiLocation (79) */ - interface XcmV0MultiLocation extends Enum { - readonly isNull: boolean; - readonly isX1: boolean; - readonly asX1: XcmV0Junction; - readonly isX2: boolean; - readonly asX2: ITuple<[XcmV0Junction, XcmV0Junction]>; - readonly isX3: boolean; - readonly asX3: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction]>; - readonly isX4: boolean; - readonly asX4: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; - readonly isX5: boolean; - readonly asX5: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; - readonly isX6: boolean; - readonly asX6: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; - readonly isX7: boolean; - readonly asX7: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; - readonly isX8: boolean; - readonly asX8: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; - readonly type: 'Null' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; - } - - /** @name XcmV0Junction (80) */ - interface XcmV0Junction extends Enum { - readonly isParent: boolean; - readonly isParachain: boolean; - readonly asParachain: Compact; - readonly isAccountId32: boolean; - readonly asAccountId32: { - readonly network: XcmV0JunctionNetworkId; - readonly id: U8aFixed; + readonly isDepositAsset: boolean; + readonly asDepositAsset: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly maxAssets: Compact; + readonly beneficiary: XcmV1MultiLocation; } & Struct; - readonly isAccountIndex64: boolean; - readonly asAccountIndex64: { - readonly network: XcmV0JunctionNetworkId; - readonly index: Compact; + readonly isDepositReserveAsset: boolean; + readonly asDepositReserveAsset: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly maxAssets: Compact; + readonly dest: XcmV1MultiLocation; + readonly xcm: XcmV2Xcm; } & Struct; - readonly isAccountKey20: boolean; - readonly asAccountKey20: { - readonly network: XcmV0JunctionNetworkId; - readonly key: U8aFixed; + readonly isExchangeAsset: boolean; + readonly asExchangeAsset: { + readonly give: XcmV1MultiassetMultiAssetFilter; + readonly receive: XcmV1MultiassetMultiAssets; } & Struct; - readonly isPalletInstance: boolean; - readonly asPalletInstance: u8; - readonly isGeneralIndex: boolean; - readonly asGeneralIndex: Compact; - readonly isGeneralKey: boolean; - readonly asGeneralKey: Bytes; - readonly isOnlyChild: boolean; - readonly isPlurality: boolean; - readonly asPlurality: { - readonly id: XcmV0JunctionBodyId; - readonly part: XcmV0JunctionBodyPart; + readonly isInitiateReserveWithdraw: boolean; + readonly asInitiateReserveWithdraw: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly reserve: XcmV1MultiLocation; + readonly xcm: XcmV2Xcm; + } & Struct; + readonly isInitiateTeleport: boolean; + readonly asInitiateTeleport: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly dest: XcmV1MultiLocation; + readonly xcm: XcmV2Xcm; + } & Struct; + readonly isQueryHolding: boolean; + readonly asQueryHolding: { + readonly queryId: Compact; + readonly dest: XcmV1MultiLocation; + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly maxResponseWeight: Compact; + } & Struct; + readonly isBuyExecution: boolean; + readonly asBuyExecution: { + readonly fees: XcmV1MultiAsset; + readonly weightLimit: XcmV2WeightLimit; + } & Struct; + readonly isRefundSurplus: boolean; + readonly isSetErrorHandler: boolean; + readonly asSetErrorHandler: XcmV2Xcm; + readonly isSetAppendix: boolean; + readonly asSetAppendix: XcmV2Xcm; + readonly isClearError: boolean; + readonly isClaimAsset: boolean; + readonly asClaimAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly ticket: XcmV1MultiLocation; + } & Struct; + readonly isTrap: boolean; + readonly asTrap: Compact; + readonly isSubscribeVersion: boolean; + readonly asSubscribeVersion: { + readonly queryId: Compact; + readonly maxResponseWeight: Compact; + } & Struct; + readonly isUnsubscribeVersion: boolean; + readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion'; + } + + /** @name XcmV2Response (125) */ + export interface XcmV2Response extends Enum { + readonly isNull: boolean; + readonly isAssets: boolean; + readonly asAssets: XcmV1MultiassetMultiAssets; + readonly isExecutionResult: boolean; + readonly asExecutionResult: Option>; + readonly isVersion: boolean; + readonly asVersion: u32; + readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version'; + } + + /** @name XcmV2TraitsError (128) */ + export interface XcmV2TraitsError extends Enum { + readonly isOverflow: boolean; + readonly isUnimplemented: boolean; + readonly isUntrustedReserveLocation: boolean; + readonly isUntrustedTeleportLocation: boolean; + readonly isMultiLocationFull: boolean; + readonly isMultiLocationNotInvertible: boolean; + readonly isBadOrigin: boolean; + readonly isInvalidLocation: boolean; + readonly isAssetNotFound: boolean; + readonly isFailedToTransactAsset: boolean; + readonly isNotWithdrawable: boolean; + readonly isLocationCannotHold: boolean; + readonly isExceedsMaxMessageSize: boolean; + readonly isDestinationUnsupported: boolean; + readonly isTransport: boolean; + readonly isUnroutable: boolean; + readonly isUnknownClaim: boolean; + readonly isFailedToDecode: boolean; + readonly isMaxWeightInvalid: boolean; + readonly isNotHoldingFees: boolean; + readonly isTooExpensive: boolean; + readonly isTrap: boolean; + readonly asTrap: u64; + readonly isUnhandledXcmVersion: boolean; + readonly isWeightLimitReached: boolean; + readonly asWeightLimitReached: u64; + readonly isBarrier: boolean; + readonly isWeightNotComputable: boolean; + readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable'; + } + + /** @name XcmV2WeightLimit (129) */ + export interface XcmV2WeightLimit extends Enum { + readonly isUnlimited: boolean; + readonly isLimited: boolean; + readonly asLimited: Compact; + readonly type: 'Unlimited' | 'Limited'; + } + + /** @name XcmVersionedMultiAssets (130) */ + export interface XcmVersionedMultiAssets extends Enum { + readonly isV0: boolean; + readonly asV0: Vec; + readonly isV1: boolean; + readonly asV1: XcmV1MultiassetMultiAssets; + readonly type: 'V0' | 'V1'; + } + + /** @name CumulusPalletXcmCall (145) */ + export type CumulusPalletXcmCall = Null; + + /** @name CumulusPalletDmpQueueCall (146) */ + export interface CumulusPalletDmpQueueCall extends Enum { + readonly isServiceOverweight: boolean; + readonly asServiceOverweight: { + readonly index: u64; + readonly weightLimit: u64; } & Struct; readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; } @@ -947,15 +1379,50 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; } - /** @name CumulusPalletDmpQueueEvent (83) */ - interface CumulusPalletDmpQueueEvent extends Enum { - readonly isInvalidFormat: boolean; - readonly asInvalidFormat: { - readonly messageId: U8aFixed; + /** @name PalletInflationCall (147) */ + export interface PalletInflationCall extends Enum { + readonly isStartInflation: boolean; + readonly asStartInflation: { + readonly inflationStartRelayBlock: u32; } & Struct; +<<<<<<< HEAD readonly isUnsupportedVersion: boolean; readonly asUnsupportedVersion: { readonly messageId: U8aFixed; +======= + readonly type: 'StartInflation'; + } + + /** @name PalletAppPromotionCall (148) */ + export interface PalletAppPromotionCall extends Enum { + readonly isSetAdminAddress: boolean; + readonly asSetAdminAddress: { + readonly admin: AccountId32; + } & Struct; + readonly isStartAppPromotion: boolean; + readonly asStartAppPromotion: { + readonly promotionStartRelayBlock: u32; + } & Struct; + readonly isStake: boolean; + readonly asStake: { + readonly amount: u128; + } & Struct; + readonly isUnstake: boolean; + readonly asUnstake: { + readonly amount: u128; + } & Struct; + readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake'; + } + + /** @name PalletUniqueCall (149) */ + export interface PalletUniqueCall extends Enum { + readonly isCreateCollection: boolean; + readonly asCreateCollection: { + readonly collectionName: Vec; + readonly collectionDescription: Vec; + readonly tokenPrefix: Bytes; + readonly mode: UpDataStructsCollectionMode; +>>>>>>> b43f8da0... added totalstaked & fix bug with number in RPC Client } & Struct; readonly isExecutedDownward: boolean; readonly asExecutedDownward: { @@ -1095,6 +1562,7 @@ declare module '@polkadot/types/lookup' { readonly asCollectionDestroyed: { readonly issuer: AccountId32; readonly collectionId: u32; + readonly newAdmin: PalletEvmAccountBasicCrossAccountIdRepr; } & Struct; readonly isIssuerChanged: boolean; readonly asIssuerChanged: { @@ -1174,6 +1642,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; } +<<<<<<< HEAD /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (97) */ interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { readonly isAccountId: boolean; @@ -1361,1452 +1830,1282 @@ declare module '@polkadot/types/lookup' { readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name FrameSystemLimitsWeightsPerClass (126) */ - interface FrameSystemLimitsWeightsPerClass extends Struct { - readonly baseExtrinsic: u64; - readonly maxExtrinsic: Option; - readonly maxTotal: Option; - readonly reserved: Option; + /** @name UpDataStructsCollectionMode (155) */ + export interface UpDataStructsCollectionMode extends Enum { + readonly isNft: boolean; + readonly isFungible: boolean; + readonly asFungible: u8; + readonly isReFungible: boolean; + readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name FrameSystemLimitsBlockLength (128) */ - interface FrameSystemLimitsBlockLength extends Struct { - readonly max: FrameSupportWeightsPerDispatchClassU32; + /** @name UpDataStructsCreateCollectionData (156) */ + export interface UpDataStructsCreateCollectionData extends Struct { + readonly mode: UpDataStructsCollectionMode; + readonly access: Option; + readonly name: Vec; + readonly description: Vec; + readonly tokenPrefix: Bytes; + readonly pendingSponsor: Option; + readonly limits: Option; + readonly permissions: Option; + readonly tokenPropertyPermissions: Vec; + readonly properties: Vec; } - /** @name FrameSupportWeightsPerDispatchClassU32 (129) */ - interface FrameSupportWeightsPerDispatchClassU32 extends Struct { - readonly normal: u32; - readonly operational: u32; - readonly mandatory: u32; + /** @name UpDataStructsAccessMode (158) */ + export interface UpDataStructsAccessMode extends Enum { + readonly isNormal: boolean; + readonly isAllowList: boolean; + readonly type: 'Normal' | 'AllowList'; } - /** @name FrameSupportWeightsRuntimeDbWeight (130) */ - interface FrameSupportWeightsRuntimeDbWeight extends Struct { - readonly read: u64; - readonly write: u64; + /** @name UpDataStructsCollectionLimits (161) */ + export interface UpDataStructsCollectionLimits extends Struct { + readonly accountTokenOwnershipLimit: Option; + readonly sponsoredDataSize: Option; + readonly sponsoredDataRateLimit: Option; + readonly tokenLimit: Option; + readonly sponsorTransferTimeout: Option; + readonly sponsorApproveTimeout: Option; + readonly ownerCanTransfer: Option; + readonly ownerCanDestroy: Option; + readonly transfersEnabled: Option; } - /** @name SpVersionRuntimeVersion (131) */ - interface SpVersionRuntimeVersion extends Struct { - readonly specName: Text; - readonly implName: Text; - readonly authoringVersion: u32; - readonly specVersion: u32; - readonly implVersion: u32; - readonly apis: Vec>; - readonly transactionVersion: u32; - readonly stateVersion: u8; + /** @name UpDataStructsSponsoringRateLimit (163) */ + export interface UpDataStructsSponsoringRateLimit extends Enum { + readonly isSponsoringDisabled: boolean; + readonly isBlocks: boolean; + readonly asBlocks: u32; + readonly type: 'SponsoringDisabled' | 'Blocks'; } - /** @name FrameSystemError (136) */ - interface FrameSystemError extends Enum { - readonly isInvalidSpecName: boolean; - readonly isSpecVersionNeedsToIncrease: boolean; - readonly isFailedToExtractRuntimeVersion: boolean; - readonly isNonDefaultComposite: boolean; - readonly isNonZeroRefCount: boolean; - readonly isCallFiltered: boolean; - readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; + /** @name UpDataStructsCollectionPermissions (166) */ + export interface UpDataStructsCollectionPermissions extends Struct { + readonly access: Option; + readonly mintMode: Option; + readonly nesting: Option; } - /** @name PolkadotPrimitivesV2PersistedValidationData (137) */ - interface PolkadotPrimitivesV2PersistedValidationData extends Struct { - readonly parentHead: Bytes; - readonly relayParentNumber: u32; - readonly relayParentStorageRoot: H256; - readonly maxPovSize: u32; + /** @name UpDataStructsNestingPermissions (168) */ + export interface UpDataStructsNestingPermissions extends Struct { + readonly tokenOwner: bool; + readonly collectionAdmin: bool; + readonly restricted: Option; } - /** @name PolkadotPrimitivesV2UpgradeRestriction (140) */ - interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { - readonly isPresent: boolean; - readonly type: 'Present'; + /** @name UpDataStructsOwnerRestrictedSet (170) */ + export interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} + + /** @name UpDataStructsPropertyKeyPermission (176) */ + export interface UpDataStructsPropertyKeyPermission extends Struct { + readonly key: Bytes; + readonly permission: UpDataStructsPropertyPermission; } - /** @name SpTrieStorageProof (141) */ - interface SpTrieStorageProof extends Struct { - readonly trieNodes: BTreeSet; + /** @name UpDataStructsPropertyPermission (178) */ + export interface UpDataStructsPropertyPermission extends Struct { + readonly mutable: bool; + readonly collectionAdmin: bool; + readonly tokenOwner: bool; } - /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (143) */ - interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { - readonly dmqMqcHead: H256; - readonly relayDispatchQueueSize: ITuple<[u32, u32]>; - readonly ingressChannels: Vec>; - readonly egressChannels: Vec>; + /** @name UpDataStructsProperty (181) */ + export interface UpDataStructsProperty extends Struct { + readonly key: Bytes; + readonly value: Bytes; } - /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (146) */ - interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { - readonly maxCapacity: u32; - readonly maxTotalSize: u32; - readonly maxMessageSize: u32; - readonly msgCount: u32; - readonly totalSize: u32; - readonly mqcHead: Option; + /** @name PalletEvmAccountBasicCrossAccountIdRepr (184) */ + export interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { + readonly isSubstrate: boolean; + readonly asSubstrate: AccountId32; + readonly isEthereum: boolean; + readonly asEthereum: H160; + readonly type: 'Substrate' | 'Ethereum'; } - /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (147) */ - interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { - readonly maxCodeSize: u32; - readonly maxHeadDataSize: u32; - readonly maxUpwardQueueCount: u32; - readonly maxUpwardQueueSize: u32; - readonly maxUpwardMessageSize: u32; - readonly maxUpwardMessageNumPerCandidate: u32; - readonly hrmpMaxMessageNumPerCandidate: u32; - readonly validationUpgradeCooldown: u32; - readonly validationUpgradeDelay: u32; + /** @name UpDataStructsCreateItemData (186) */ + export interface UpDataStructsCreateItemData extends Enum { + readonly isNft: boolean; + readonly asNft: UpDataStructsCreateNftData; + readonly isFungible: boolean; + readonly asFungible: UpDataStructsCreateFungibleData; + readonly isReFungible: boolean; + readonly asReFungible: UpDataStructsCreateReFungibleData; + readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name PolkadotCorePrimitivesOutboundHrmpMessage (153) */ - interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { - readonly recipient: u32; - readonly data: Bytes; + /** @name UpDataStructsCreateNftData (187) */ + export interface UpDataStructsCreateNftData extends Struct { + readonly properties: Vec; } - /** @name CumulusPalletParachainSystemCall (154) */ - interface CumulusPalletParachainSystemCall extends Enum { - readonly isSetValidationData: boolean; - readonly asSetValidationData: { - readonly data: CumulusPrimitivesParachainInherentParachainInherentData; - } & Struct; - readonly isSudoSendUpwardMessage: boolean; - readonly asSudoSendUpwardMessage: { - readonly message: Bytes; - } & Struct; - readonly isAuthorizeUpgrade: boolean; - readonly asAuthorizeUpgrade: { - readonly codeHash: H256; - } & Struct; - readonly isEnactAuthorizedUpgrade: boolean; - readonly asEnactAuthorizedUpgrade: { - readonly code: Bytes; - } & Struct; - readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade'; + /** @name UpDataStructsCreateFungibleData (188) */ + export interface UpDataStructsCreateFungibleData extends Struct { + readonly value: u128; } - /** @name CumulusPrimitivesParachainInherentParachainInherentData (155) */ - interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { - readonly validationData: PolkadotPrimitivesV2PersistedValidationData; - readonly relayChainState: SpTrieStorageProof; - readonly downwardMessages: Vec; - readonly horizontalMessages: BTreeMap>; + /** @name UpDataStructsCreateReFungibleData (189) */ + export interface UpDataStructsCreateReFungibleData extends Struct { + readonly pieces: u128; + readonly properties: Vec; +>>>>>>> b43f8da0... added totalstaked & fix bug with number in RPC Client } - /** @name PolkadotCorePrimitivesInboundDownwardMessage (157) */ - interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { - readonly sentAt: u32; - readonly msg: Bytes; + /** @name FrameSystemLimitsBlockLength (128) */ + interface FrameSystemLimitsBlockLength extends Struct { + readonly max: FrameSupportWeightsPerDispatchClassU32; } - /** @name PolkadotCorePrimitivesInboundHrmpMessage (160) */ - interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { - readonly sentAt: u32; - readonly data: Bytes; + /** @name FrameSupportWeightsPerDispatchClassU32 (129) */ + interface FrameSupportWeightsPerDispatchClassU32 extends Struct { + readonly normal: u32; + readonly operational: u32; + readonly mandatory: u32; } - /** @name CumulusPalletParachainSystemError (163) */ - interface CumulusPalletParachainSystemError extends Enum { - readonly isOverlappingUpgrades: boolean; - readonly isProhibitedByPolkadot: boolean; - readonly isTooBig: boolean; - readonly isValidationDataNotAvailable: boolean; - readonly isHostConfigurationNotAvailable: boolean; - readonly isNotScheduled: boolean; - readonly isNothingAuthorized: boolean; - readonly isUnauthorized: boolean; - readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized'; + /** @name FrameSupportWeightsRuntimeDbWeight (130) */ + interface FrameSupportWeightsRuntimeDbWeight extends Struct { + readonly read: u64; + readonly write: u64; } - /** @name PalletBalancesBalanceLock (165) */ - interface PalletBalancesBalanceLock extends Struct { - readonly id: U8aFixed; - readonly amount: u128; - readonly reasons: PalletBalancesReasons; + /** @name SpVersionRuntimeVersion (131) */ + interface SpVersionRuntimeVersion extends Struct { + readonly specName: Text; + readonly implName: Text; + readonly authoringVersion: u32; + readonly specVersion: u32; + readonly implVersion: u32; + readonly apis: Vec>; + readonly transactionVersion: u32; + readonly stateVersion: u8; } - /** @name PalletBalancesReasons (166) */ - interface PalletBalancesReasons extends Enum { - readonly isFee: boolean; - readonly isMisc: boolean; - readonly isAll: boolean; - readonly type: 'Fee' | 'Misc' | 'All'; +<<<<<<< HEAD + /** @name FrameSystemError (136) */ + interface FrameSystemError extends Enum { + readonly isInvalidSpecName: boolean; + readonly isSpecVersionNeedsToIncrease: boolean; + readonly isFailedToExtractRuntimeVersion: boolean; + readonly isNonDefaultComposite: boolean; + readonly isNonZeroRefCount: boolean; + readonly isCallFiltered: boolean; + readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name PalletBalancesReserveData (169) */ - interface PalletBalancesReserveData extends Struct { - readonly id: U8aFixed; - readonly amount: u128; + /** @name UpDataStructsCreateItemExData (192) */ + export interface UpDataStructsCreateItemExData extends Enum { + readonly isNft: boolean; + readonly asNft: Vec; + readonly isFungible: boolean; + readonly asFungible: BTreeMap; + readonly isRefungibleMultipleItems: boolean; + readonly asRefungibleMultipleItems: Vec; + readonly isRefungibleMultipleOwners: boolean; + readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners; + readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; } - /** @name PalletBalancesReleases (171) */ - interface PalletBalancesReleases extends Enum { - readonly isV100: boolean; - readonly isV200: boolean; - readonly type: 'V100' | 'V200'; + /** @name UpDataStructsCreateNftExData (194) */ + export interface UpDataStructsCreateNftExData extends Struct { + readonly properties: Vec; + readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name PalletBalancesCall (172) */ - interface PalletBalancesCall extends Enum { - readonly isTransfer: boolean; - readonly asTransfer: { - readonly dest: MultiAddress; - readonly value: Compact; - } & Struct; - readonly isSetBalance: boolean; - readonly asSetBalance: { - readonly who: MultiAddress; - readonly newFree: Compact; - readonly newReserved: Compact; - } & Struct; - readonly isForceTransfer: boolean; - readonly asForceTransfer: { - readonly source: MultiAddress; - readonly dest: MultiAddress; - readonly value: Compact; - } & Struct; - readonly isTransferKeepAlive: boolean; - readonly asTransferKeepAlive: { - readonly dest: MultiAddress; - readonly value: Compact; - } & Struct; - readonly isTransferAll: boolean; - readonly asTransferAll: { - readonly dest: MultiAddress; - readonly keepAlive: bool; - } & Struct; - readonly isForceUnreserve: boolean; - readonly asForceUnreserve: { - readonly who: MultiAddress; - readonly amount: u128; - } & Struct; - readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; + /** @name UpDataStructsCreateRefungibleExSingleOwner (201) */ + export interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { + readonly user: PalletEvmAccountBasicCrossAccountIdRepr; + readonly pieces: u128; + readonly properties: Vec; } - /** @name PalletBalancesError (175) */ - interface PalletBalancesError extends Enum { - readonly isVestingBalance: boolean; - readonly isLiquidityRestrictions: boolean; - readonly isInsufficientBalance: boolean; - readonly isExistentialDeposit: boolean; - readonly isKeepAlive: boolean; - readonly isExistingVestingSchedule: boolean; - readonly isDeadAccount: boolean; - readonly isTooManyReserves: boolean; - readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves'; + /** @name UpDataStructsCreateRefungibleExMultipleOwners (203) */ + export interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { + readonly users: BTreeMap; + readonly properties: Vec; } - /** @name PalletTimestampCall (177) */ - interface PalletTimestampCall extends Enum { - readonly isSet: boolean; - readonly asSet: { - readonly now: Compact; + /** @name PalletUniqueSchedulerCall (205) */ + export interface PalletUniqueSchedulerCall extends Enum { + readonly isScheduleNamed: boolean; + readonly asScheduleNamed: { + readonly id: U8aFixed; + readonly when: u32; + readonly maybePeriodic: Option>; + readonly priority: u8; + readonly call: FrameSupportScheduleMaybeHashed; } & Struct; - readonly type: 'Set'; + readonly isCancelNamed: boolean; + readonly asCancelNamed: { + readonly id: U8aFixed; + } & Struct; + readonly isScheduleNamedAfter: boolean; + readonly asScheduleNamedAfter: { + readonly id: U8aFixed; + readonly after: u32; + readonly maybePeriodic: Option>; + readonly priority: u8; + readonly call: FrameSupportScheduleMaybeHashed; + } & Struct; + readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; } - /** @name PalletTransactionPaymentReleases (179) */ - interface PalletTransactionPaymentReleases extends Enum { - readonly isV1Ancient: boolean; - readonly isV2: boolean; - readonly type: 'V1Ancient' | 'V2'; + /** @name FrameSupportScheduleMaybeHashed (207) */ + export interface FrameSupportScheduleMaybeHashed extends Enum { + readonly isValue: boolean; + readonly asValue: Call; + readonly isHash: boolean; + readonly asHash: H256; + readonly type: 'Value' | 'Hash'; } - /** @name PalletTreasuryProposal (180) */ - interface PalletTreasuryProposal extends Struct { - readonly proposer: AccountId32; - readonly value: u128; - readonly beneficiary: AccountId32; - readonly bond: u128; - } + /** @name PalletTemplateTransactionPaymentCall (208) */ + export type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletTreasuryCall (183) */ - interface PalletTreasuryCall extends Enum { - readonly isProposeSpend: boolean; - readonly asProposeSpend: { - readonly value: Compact; - readonly beneficiary: MultiAddress; + /** @name PalletStructureCall (209) */ + export type PalletStructureCall = Null; + + /** @name PalletRmrkCoreCall (210) */ + export interface PalletRmrkCoreCall extends Enum { + readonly isCreateCollection: boolean; + readonly asCreateCollection: { + readonly metadata: Bytes; + readonly max: Option; + readonly symbol: Bytes; } & Struct; - readonly isRejectProposal: boolean; - readonly asRejectProposal: { - readonly proposalId: Compact; + readonly isDestroyCollection: boolean; + readonly asDestroyCollection: { + readonly collectionId: u32; } & Struct; - readonly isApproveProposal: boolean; - readonly asApproveProposal: { - readonly proposalId: Compact; + readonly isChangeCollectionIssuer: boolean; + readonly asChangeCollectionIssuer: { + readonly collectionId: u32; + readonly newIssuer: MultiAddress; } & Struct; - readonly isSpend: boolean; - readonly asSpend: { - readonly amount: Compact; - readonly beneficiary: MultiAddress; + readonly isLockCollection: boolean; + readonly asLockCollection: { + readonly collectionId: u32; } & Struct; - readonly isRemoveApproval: boolean; - readonly asRemoveApproval: { - readonly proposalId: Compact; + readonly isMintNft: boolean; + readonly asMintNft: { + readonly owner: Option; + readonly collectionId: u32; + readonly recipient: Option; + readonly royaltyAmount: Option; + readonly metadata: Bytes; + readonly transferable: bool; + readonly resources: Option>; } & Struct; - readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval'; - } - - /** @name FrameSupportPalletId (186) */ - interface FrameSupportPalletId extends U8aFixed {} - - /** @name PalletTreasuryError (187) */ - interface PalletTreasuryError extends Enum { - readonly isInsufficientProposersBalance: boolean; - readonly isInvalidIndex: boolean; - readonly isTooManyApprovals: boolean; - readonly isInsufficientPermission: boolean; - readonly isProposalNotApproved: boolean; - readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved'; - } - - /** @name PalletSudoCall (188) */ - interface PalletSudoCall extends Enum { - readonly isSudo: boolean; - readonly asSudo: { - readonly call: Call; - } & Struct; - readonly isSudoUncheckedWeight: boolean; - readonly asSudoUncheckedWeight: { - readonly call: Call; - readonly weight: u64; - } & Struct; - readonly isSetKey: boolean; - readonly asSetKey: { - readonly new_: MultiAddress; + readonly isBurnNft: boolean; + readonly asBurnNft: { + readonly collectionId: u32; + readonly nftId: u32; + readonly maxBurns: u32; } & Struct; - readonly isSudoAs: boolean; - readonly asSudoAs: { - readonly who: MultiAddress; - readonly call: Call; + readonly isSend: boolean; + readonly asSend: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; } & Struct; - readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs'; - } - - /** @name OrmlVestingModuleCall (190) */ - interface OrmlVestingModuleCall extends Enum { - readonly isClaim: boolean; - readonly isVestedTransfer: boolean; - readonly asVestedTransfer: { - readonly dest: MultiAddress; - readonly schedule: OrmlVestingVestingSchedule; + readonly isAcceptNft: boolean; + readonly asAcceptNft: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; } & Struct; - readonly isUpdateVestingSchedules: boolean; - readonly asUpdateVestingSchedules: { - readonly who: MultiAddress; - readonly vestingSchedules: Vec; + readonly isRejectNft: boolean; + readonly asRejectNft: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; } & Struct; - readonly isClaimFor: boolean; - readonly asClaimFor: { - readonly dest: MultiAddress; + readonly isAcceptResource: boolean; + readonly asAcceptResource: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly resourceId: u32; } & Struct; - readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor'; - } - - /** @name CumulusPalletXcmpQueueCall (192) */ - interface CumulusPalletXcmpQueueCall extends Enum { - readonly isServiceOverweight: boolean; - readonly asServiceOverweight: { - readonly index: u64; - readonly weightLimit: u64; + readonly isAcceptResourceRemoval: boolean; + readonly asAcceptResourceRemoval: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly resourceId: u32; } & Struct; - readonly isSuspendXcmExecution: boolean; - readonly isResumeXcmExecution: boolean; - readonly isUpdateSuspendThreshold: boolean; - readonly asUpdateSuspendThreshold: { - readonly new_: u32; + readonly isSetProperty: boolean; + readonly asSetProperty: { + readonly rmrkCollectionId: Compact; + readonly maybeNftId: Option; + readonly key: Bytes; + readonly value: Bytes; } & Struct; - readonly isUpdateDropThreshold: boolean; - readonly asUpdateDropThreshold: { - readonly new_: u32; + readonly isSetPriority: boolean; + readonly asSetPriority: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly priorities: Vec; } & Struct; - readonly isUpdateResumeThreshold: boolean; - readonly asUpdateResumeThreshold: { - readonly new_: u32; + readonly isAddBasicResource: boolean; + readonly asAddBasicResource: { + readonly rmrkCollectionId: u32; + readonly nftId: u32; + readonly resource: RmrkTraitsResourceBasicResource; } & Struct; - readonly isUpdateThresholdWeight: boolean; - readonly asUpdateThresholdWeight: { - readonly new_: u64; + readonly isAddComposableResource: boolean; + readonly asAddComposableResource: { + readonly rmrkCollectionId: u32; + readonly nftId: u32; + readonly resource: RmrkTraitsResourceComposableResource; } & Struct; - readonly isUpdateWeightRestrictDecay: boolean; - readonly asUpdateWeightRestrictDecay: { - readonly new_: u64; + readonly isAddSlotResource: boolean; + readonly asAddSlotResource: { + readonly rmrkCollectionId: u32; + readonly nftId: u32; + readonly resource: RmrkTraitsResourceSlotResource; } & Struct; - readonly isUpdateXcmpMaxIndividualWeight: boolean; - readonly asUpdateXcmpMaxIndividualWeight: { - readonly new_: u64; + readonly isRemoveResource: boolean; + readonly asRemoveResource: { + readonly rmrkCollectionId: u32; + readonly nftId: u32; + readonly resourceId: u32; } & Struct; - readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight'; + readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; } - /** @name PalletXcmCall (193) */ - interface PalletXcmCall extends Enum { - readonly isSend: boolean; - readonly asSend: { - readonly dest: XcmVersionedMultiLocation; - readonly message: XcmVersionedXcm; - } & Struct; - readonly isTeleportAssets: boolean; - readonly asTeleportAssets: { - readonly dest: XcmVersionedMultiLocation; - readonly beneficiary: XcmVersionedMultiLocation; - readonly assets: XcmVersionedMultiAssets; - readonly feeAssetItem: u32; - } & Struct; - readonly isReserveTransferAssets: boolean; - readonly asReserveTransferAssets: { - readonly dest: XcmVersionedMultiLocation; - readonly beneficiary: XcmVersionedMultiLocation; - readonly assets: XcmVersionedMultiAssets; - readonly feeAssetItem: u32; - } & Struct; - readonly isExecute: boolean; - readonly asExecute: { - readonly message: XcmVersionedXcm; - readonly maxWeight: u64; + /** @name RmrkTraitsResourceResourceTypes (216) */ + export interface RmrkTraitsResourceResourceTypes extends Enum { + readonly isBasic: boolean; + readonly asBasic: RmrkTraitsResourceBasicResource; + readonly isComposable: boolean; + readonly asComposable: RmrkTraitsResourceComposableResource; + readonly isSlot: boolean; + readonly asSlot: RmrkTraitsResourceSlotResource; + readonly type: 'Basic' | 'Composable' | 'Slot'; + } + + /** @name RmrkTraitsResourceBasicResource (218) */ + export interface RmrkTraitsResourceBasicResource extends Struct { + readonly src: Option; + readonly metadata: Option; + readonly license: Option; + readonly thumb: Option; + } + + /** @name RmrkTraitsResourceComposableResource (220) */ + export interface RmrkTraitsResourceComposableResource extends Struct { + readonly parts: Vec; + readonly base: u32; + readonly src: Option; + readonly metadata: Option; + readonly license: Option; + readonly thumb: Option; + } + + /** @name RmrkTraitsResourceSlotResource (221) */ + export interface RmrkTraitsResourceSlotResource extends Struct { + readonly base: u32; + readonly src: Option; + readonly metadata: Option; + readonly slot: u32; + readonly license: Option; + readonly thumb: Option; + } + + /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (223) */ + export interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { + readonly isAccountId: boolean; + readonly asAccountId: AccountId32; + readonly isCollectionAndNftTuple: boolean; + readonly asCollectionAndNftTuple: ITuple<[u32, u32]>; + readonly type: 'AccountId' | 'CollectionAndNftTuple'; + } + + /** @name PalletRmrkEquipCall (227) */ + export interface PalletRmrkEquipCall extends Enum { + readonly isCreateBase: boolean; + readonly asCreateBase: { + readonly baseType: Bytes; + readonly symbol: Bytes; + readonly parts: Vec; } & Struct; - readonly isForceXcmVersion: boolean; - readonly asForceXcmVersion: { - readonly location: XcmV1MultiLocation; - readonly xcmVersion: u32; + readonly isThemeAdd: boolean; + readonly asThemeAdd: { + readonly baseId: u32; + readonly theme: RmrkTraitsTheme; } & Struct; - readonly isForceDefaultXcmVersion: boolean; - readonly asForceDefaultXcmVersion: { - readonly maybeXcmVersion: Option; + readonly isEquippable: boolean; + readonly asEquippable: { + readonly baseId: u32; + readonly slotId: u32; + readonly equippables: RmrkTraitsPartEquippableList; } & Struct; - readonly isForceSubscribeVersionNotify: boolean; - readonly asForceSubscribeVersionNotify: { - readonly location: XcmVersionedMultiLocation; + readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; + } + + /** @name RmrkTraitsPartPartType (230) */ + export interface RmrkTraitsPartPartType extends Enum { + readonly isFixedPart: boolean; + readonly asFixedPart: RmrkTraitsPartFixedPart; + readonly isSlotPart: boolean; + readonly asSlotPart: RmrkTraitsPartSlotPart; + readonly type: 'FixedPart' | 'SlotPart'; + } + + /** @name RmrkTraitsPartFixedPart (232) */ + export interface RmrkTraitsPartFixedPart extends Struct { + readonly id: u32; + readonly z: u32; + readonly src: Bytes; + } + + /** @name RmrkTraitsPartSlotPart (233) */ + export interface RmrkTraitsPartSlotPart extends Struct { + readonly id: u32; + readonly equippable: RmrkTraitsPartEquippableList; + readonly src: Bytes; + readonly z: u32; + } + + /** @name RmrkTraitsPartEquippableList (234) */ + export interface RmrkTraitsPartEquippableList extends Enum { + readonly isAll: boolean; + readonly type: 'Fee' | 'Misc' | 'All'; + } + + /** @name RmrkTraitsTheme (236) */ + export interface RmrkTraitsTheme extends Struct { + readonly name: Bytes; + readonly properties: Vec; + readonly inherit: bool; + } + + /** @name RmrkTraitsThemeThemeProperty (238) */ + export interface RmrkTraitsThemeThemeProperty extends Struct { + readonly key: Bytes; + readonly value: Bytes; + } + + /** @name PalletEvmCall (240) */ + export interface PalletEvmCall extends Enum { + readonly isWithdraw: boolean; + readonly asWithdraw: { + readonly address: H160; + readonly value: u128; +>>>>>>> b43f8da0... added totalstaked & fix bug with number in RPC Client } & Struct; - readonly isForceUnsubscribeVersionNotify: boolean; - readonly asForceUnsubscribeVersionNotify: { - readonly location: XcmVersionedMultiLocation; + readonly isSetBalance: boolean; + readonly asSetBalance: { + readonly who: MultiAddress; + readonly newFree: Compact; + readonly newReserved: Compact; } & Struct; - readonly isLimitedReserveTransferAssets: boolean; - readonly asLimitedReserveTransferAssets: { - readonly dest: XcmVersionedMultiLocation; - readonly beneficiary: XcmVersionedMultiLocation; - readonly assets: XcmVersionedMultiAssets; - readonly feeAssetItem: u32; - readonly weightLimit: XcmV2WeightLimit; + readonly isForceTransfer: boolean; + readonly asForceTransfer: { + readonly source: MultiAddress; + readonly dest: MultiAddress; + readonly value: Compact; } & Struct; - readonly isLimitedTeleportAssets: boolean; - readonly asLimitedTeleportAssets: { - readonly dest: XcmVersionedMultiLocation; - readonly beneficiary: XcmVersionedMultiLocation; - readonly assets: XcmVersionedMultiAssets; - readonly feeAssetItem: u32; - readonly weightLimit: XcmV2WeightLimit; + readonly isTransferKeepAlive: boolean; + readonly asTransferKeepAlive: { + readonly dest: MultiAddress; + readonly value: Compact; } & Struct; - readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets'; +<<<<<<< HEAD + readonly isTransferAll: boolean; + readonly asTransferAll: { + readonly dest: MultiAddress; + readonly keepAlive: bool; +======= + readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name XcmVersionedXcm (194) */ - interface XcmVersionedXcm extends Enum { - readonly isV0: boolean; - readonly asV0: XcmV0Xcm; - readonly isV1: boolean; - readonly asV1: XcmV1Xcm; - readonly isV2: boolean; - readonly asV2: XcmV2Xcm; - readonly type: 'V0' | 'V1' | 'V2'; - } - - /** @name XcmV0Xcm (195) */ - interface XcmV0Xcm extends Enum { - readonly isWithdrawAsset: boolean; - readonly asWithdrawAsset: { - readonly assets: Vec; - readonly effects: Vec; - } & Struct; - readonly isReserveAssetDeposit: boolean; - readonly asReserveAssetDeposit: { - readonly assets: Vec; - readonly effects: Vec; - } & Struct; - readonly isTeleportAsset: boolean; - readonly asTeleportAsset: { - readonly assets: Vec; - readonly effects: Vec; - } & Struct; - readonly isQueryResponse: boolean; - readonly asQueryResponse: { - readonly queryId: Compact; - readonly response: XcmV0Response; - } & Struct; - readonly isTransferAsset: boolean; - readonly asTransferAsset: { - readonly assets: Vec; - readonly dest: XcmV0MultiLocation; - } & Struct; - readonly isTransferReserveAsset: boolean; - readonly asTransferReserveAsset: { - readonly assets: Vec; - readonly dest: XcmV0MultiLocation; - readonly effects: Vec; - } & Struct; + /** @name PalletEthereumCall (246) */ + export interface PalletEthereumCall extends Enum { readonly isTransact: boolean; readonly asTransact: { - readonly originType: XcmV0OriginKind; - readonly requireWeightAtMost: u64; - readonly call: XcmDoubleEncoded; - } & Struct; - readonly isHrmpNewChannelOpenRequest: boolean; - readonly asHrmpNewChannelOpenRequest: { - readonly sender: Compact; - readonly maxMessageSize: Compact; - readonly maxCapacity: Compact; - } & Struct; - readonly isHrmpChannelAccepted: boolean; - readonly asHrmpChannelAccepted: { - readonly recipient: Compact; - } & Struct; - readonly isHrmpChannelClosing: boolean; - readonly asHrmpChannelClosing: { - readonly initiator: Compact; - readonly sender: Compact; - readonly recipient: Compact; + readonly transaction: EthereumTransactionTransactionV2; +>>>>>>> b43f8da0... added totalstaked & fix bug with number in RPC Client } & Struct; - readonly isRelayedFrom: boolean; - readonly asRelayedFrom: { - readonly who: XcmV0MultiLocation; - readonly message: XcmV0Xcm; + readonly isForceUnreserve: boolean; + readonly asForceUnreserve: { + readonly who: MultiAddress; + readonly amount: u128; } & Struct; - readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom'; + readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; } - /** @name XcmV0Order (197) */ - interface XcmV0Order extends Enum { - readonly isNull: boolean; - readonly isDepositAsset: boolean; - readonly asDepositAsset: { - readonly assets: Vec; - readonly dest: XcmV0MultiLocation; - } & Struct; - readonly isDepositReserveAsset: boolean; - readonly asDepositReserveAsset: { - readonly assets: Vec; - readonly dest: XcmV0MultiLocation; - readonly effects: Vec; - } & Struct; - readonly isExchangeAsset: boolean; - readonly asExchangeAsset: { - readonly give: Vec; - readonly receive: Vec; - } & Struct; - readonly isInitiateReserveWithdraw: boolean; - readonly asInitiateReserveWithdraw: { - readonly assets: Vec; - readonly reserve: XcmV0MultiLocation; - readonly effects: Vec; - } & Struct; - readonly isInitiateTeleport: boolean; - readonly asInitiateTeleport: { - readonly assets: Vec; - readonly dest: XcmV0MultiLocation; - readonly effects: Vec; - } & Struct; - readonly isQueryHolding: boolean; - readonly asQueryHolding: { - readonly queryId: Compact; - readonly dest: XcmV0MultiLocation; - readonly assets: Vec; - } & Struct; - readonly isBuyExecution: boolean; - readonly asBuyExecution: { - readonly fees: XcmV0MultiAsset; - readonly weight: u64; - readonly debt: u64; - readonly haltOnError: bool; - readonly xcm: Vec; - } & Struct; - readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; + /** @name EthereumTransactionTransactionV2 (247) */ + export interface EthereumTransactionTransactionV2 extends Enum { + readonly isLegacy: boolean; + readonly asLegacy: EthereumTransactionLegacyTransaction; + readonly isEip2930: boolean; + readonly asEip2930: EthereumTransactionEip2930Transaction; + readonly isEip1559: boolean; + readonly asEip1559: EthereumTransactionEip1559Transaction; + readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name XcmV0Response (199) */ - interface XcmV0Response extends Enum { - readonly isAssets: boolean; - readonly asAssets: Vec; - readonly type: 'Assets'; + /** @name EthereumTransactionLegacyTransaction (248) */ + export interface EthereumTransactionLegacyTransaction extends Struct { + readonly nonce: U256; + readonly gasPrice: U256; + readonly gasLimit: U256; + readonly action: EthereumTransactionTransactionAction; + readonly value: U256; + readonly input: Bytes; + readonly signature: EthereumTransactionTransactionSignature; } - /** @name XcmV1Xcm (200) */ - interface XcmV1Xcm extends Enum { - readonly isWithdrawAsset: boolean; - readonly asWithdrawAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly effects: Vec; - } & Struct; - readonly isReserveAssetDeposited: boolean; - readonly asReserveAssetDeposited: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly effects: Vec; - } & Struct; - readonly isReceiveTeleportedAsset: boolean; - readonly asReceiveTeleportedAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly effects: Vec; - } & Struct; - readonly isQueryResponse: boolean; - readonly asQueryResponse: { - readonly queryId: Compact; - readonly response: XcmV1Response; - } & Struct; - readonly isTransferAsset: boolean; - readonly asTransferAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly beneficiary: XcmV1MultiLocation; - } & Struct; - readonly isTransferReserveAsset: boolean; - readonly asTransferReserveAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly dest: XcmV1MultiLocation; - readonly effects: Vec; - } & Struct; - readonly isTransact: boolean; - readonly asTransact: { - readonly originType: XcmV0OriginKind; - readonly requireWeightAtMost: u64; - readonly call: XcmDoubleEncoded; - } & Struct; - readonly isHrmpNewChannelOpenRequest: boolean; - readonly asHrmpNewChannelOpenRequest: { - readonly sender: Compact; - readonly maxMessageSize: Compact; - readonly maxCapacity: Compact; - } & Struct; - readonly isHrmpChannelAccepted: boolean; - readonly asHrmpChannelAccepted: { - readonly recipient: Compact; - } & Struct; - readonly isHrmpChannelClosing: boolean; - readonly asHrmpChannelClosing: { - readonly initiator: Compact; - readonly sender: Compact; - readonly recipient: Compact; - } & Struct; - readonly isRelayedFrom: boolean; - readonly asRelayedFrom: { - readonly who: XcmV1MultilocationJunctions; - readonly message: XcmV1Xcm; - } & Struct; - readonly isSubscribeVersion: boolean; - readonly asSubscribeVersion: { - readonly queryId: Compact; - readonly maxResponseWeight: Compact; - } & Struct; - readonly isUnsubscribeVersion: boolean; - readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion'; + /** @name EthereumTransactionTransactionAction (249) */ + export interface EthereumTransactionTransactionAction extends Enum { + readonly isCall: boolean; + readonly asCall: H160; + readonly isCreate: boolean; + readonly type: 'Call' | 'Create'; } - /** @name XcmV1Order (202) */ - interface XcmV1Order extends Enum { - readonly isNoop: boolean; - readonly isDepositAsset: boolean; - readonly asDepositAsset: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly maxAssets: u32; - readonly beneficiary: XcmV1MultiLocation; - } & Struct; - readonly isDepositReserveAsset: boolean; - readonly asDepositReserveAsset: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly maxAssets: u32; - readonly dest: XcmV1MultiLocation; - readonly effects: Vec; - } & Struct; - readonly isExchangeAsset: boolean; - readonly asExchangeAsset: { - readonly give: XcmV1MultiassetMultiAssetFilter; - readonly receive: XcmV1MultiassetMultiAssets; - } & Struct; - readonly isInitiateReserveWithdraw: boolean; - readonly asInitiateReserveWithdraw: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly reserve: XcmV1MultiLocation; - readonly effects: Vec; - } & Struct; - readonly isInitiateTeleport: boolean; - readonly asInitiateTeleport: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly dest: XcmV1MultiLocation; - readonly effects: Vec; - } & Struct; - readonly isQueryHolding: boolean; - readonly asQueryHolding: { - readonly queryId: Compact; - readonly dest: XcmV1MultiLocation; - readonly assets: XcmV1MultiassetMultiAssetFilter; - } & Struct; - readonly isBuyExecution: boolean; - readonly asBuyExecution: { - readonly fees: XcmV1MultiAsset; - readonly weight: u64; - readonly debt: u64; - readonly haltOnError: bool; - readonly instructions: Vec; - } & Struct; - readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; + /** @name EthereumTransactionTransactionSignature (250) */ + export interface EthereumTransactionTransactionSignature extends Struct { + readonly v: u64; + readonly r: H256; + readonly s: H256; } - /** @name XcmV1Response (204) */ - interface XcmV1Response extends Enum { - readonly isAssets: boolean; - readonly asAssets: XcmV1MultiassetMultiAssets; - readonly isVersion: boolean; - readonly asVersion: u32; - readonly type: 'Assets' | 'Version'; + /** @name EthereumTransactionEip2930Transaction (252) */ + export interface EthereumTransactionEip2930Transaction extends Struct { + readonly chainId: u64; + readonly nonce: U256; + readonly gasPrice: U256; + readonly gasLimit: U256; + readonly action: EthereumTransactionTransactionAction; + readonly value: U256; + readonly input: Bytes; + readonly accessList: Vec; + readonly oddYParity: bool; + readonly r: H256; + readonly s: H256; } - /** @name CumulusPalletXcmCall (218) */ - type CumulusPalletXcmCall = Null; - - /** @name CumulusPalletDmpQueueCall (219) */ - interface CumulusPalletDmpQueueCall extends Enum { - readonly isServiceOverweight: boolean; - readonly asServiceOverweight: { - readonly index: u64; - readonly weightLimit: u64; - } & Struct; - readonly type: 'ServiceOverweight'; + /** @name EthereumTransactionAccessListItem (254) */ + export interface EthereumTransactionAccessListItem extends Struct { + readonly address: H160; + readonly storageKeys: Vec; } - /** @name PalletInflationCall (220) */ - interface PalletInflationCall extends Enum { - readonly isStartInflation: boolean; - readonly asStartInflation: { - readonly inflationStartRelayBlock: u32; - } & Struct; - readonly type: 'StartInflation'; + /** @name EthereumTransactionEip1559Transaction (255) */ + export interface EthereumTransactionEip1559Transaction extends Struct { + readonly chainId: u64; + readonly nonce: U256; + readonly maxPriorityFeePerGas: U256; + readonly maxFeePerGas: U256; + readonly gasLimit: U256; + readonly action: EthereumTransactionTransactionAction; + readonly value: U256; + readonly input: Bytes; + readonly accessList: Vec; + readonly oddYParity: bool; + readonly r: H256; + readonly s: H256; } - /** @name PalletUniqueCall (221) */ - interface PalletUniqueCall extends Enum { - readonly isCreateCollection: boolean; - readonly asCreateCollection: { - readonly collectionName: Vec; - readonly collectionDescription: Vec; - readonly tokenPrefix: Bytes; - readonly mode: UpDataStructsCollectionMode; - } & Struct; - readonly isCreateCollectionEx: boolean; - readonly asCreateCollectionEx: { - readonly data: UpDataStructsCreateCollectionData; - } & Struct; - readonly isDestroyCollection: boolean; - readonly asDestroyCollection: { - readonly collectionId: u32; - } & Struct; - readonly isAddToAllowList: boolean; - readonly asAddToAllowList: { - readonly collectionId: u32; - readonly address: PalletEvmAccountBasicCrossAccountIdRepr; - } & Struct; - readonly isRemoveFromAllowList: boolean; - readonly asRemoveFromAllowList: { - readonly collectionId: u32; - readonly address: PalletEvmAccountBasicCrossAccountIdRepr; - } & Struct; - readonly isChangeCollectionOwner: boolean; - readonly asChangeCollectionOwner: { - readonly collectionId: u32; - readonly newOwner: AccountId32; - } & Struct; - readonly isAddCollectionAdmin: boolean; - readonly asAddCollectionAdmin: { - readonly collectionId: u32; - readonly newAdminId: PalletEvmAccountBasicCrossAccountIdRepr; - } & Struct; - readonly isRemoveCollectionAdmin: boolean; - readonly asRemoveCollectionAdmin: { - readonly collectionId: u32; - readonly accountId: PalletEvmAccountBasicCrossAccountIdRepr; - } & Struct; - readonly isSetCollectionSponsor: boolean; - readonly asSetCollectionSponsor: { - readonly collectionId: u32; - readonly newSponsor: AccountId32; - } & Struct; - readonly isConfirmSponsorship: boolean; - readonly asConfirmSponsorship: { - readonly collectionId: u32; - } & Struct; - readonly isRemoveCollectionSponsor: boolean; - readonly asRemoveCollectionSponsor: { - readonly collectionId: u32; - } & Struct; - readonly isCreateItem: boolean; - readonly asCreateItem: { - readonly collectionId: u32; - readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; - readonly data: UpDataStructsCreateItemData; - } & Struct; - readonly isCreateMultipleItems: boolean; - readonly asCreateMultipleItems: { - readonly collectionId: u32; - readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; - readonly itemsData: Vec; - } & Struct; - readonly isSetCollectionProperties: boolean; - readonly asSetCollectionProperties: { - readonly collectionId: u32; - readonly properties: Vec; - } & Struct; - readonly isDeleteCollectionProperties: boolean; - readonly asDeleteCollectionProperties: { - readonly collectionId: u32; - readonly propertyKeys: Vec; - } & Struct; - readonly isSetTokenProperties: boolean; - readonly asSetTokenProperties: { - readonly collectionId: u32; - readonly tokenId: u32; - readonly properties: Vec; - } & Struct; - readonly isDeleteTokenProperties: boolean; - readonly asDeleteTokenProperties: { - readonly collectionId: u32; - readonly tokenId: u32; - readonly propertyKeys: Vec; - } & Struct; - readonly isSetTokenPropertyPermissions: boolean; - readonly asSetTokenPropertyPermissions: { - readonly collectionId: u32; - readonly propertyPermissions: Vec; - } & Struct; - readonly isCreateMultipleItemsEx: boolean; - readonly asCreateMultipleItemsEx: { - readonly collectionId: u32; - readonly data: UpDataStructsCreateItemExData; - } & Struct; - readonly isSetTransfersEnabledFlag: boolean; - readonly asSetTransfersEnabledFlag: { - readonly collectionId: u32; - readonly value: bool; - } & Struct; - readonly isBurnItem: boolean; - readonly asBurnItem: { - readonly collectionId: u32; - readonly itemId: u32; - readonly value: u128; - } & Struct; - readonly isBurnFrom: boolean; - readonly asBurnFrom: { - readonly collectionId: u32; - readonly from: PalletEvmAccountBasicCrossAccountIdRepr; - readonly itemId: u32; - readonly value: u128; - } & Struct; - readonly isTransfer: boolean; - readonly asTransfer: { - readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr; - readonly collectionId: u32; - readonly itemId: u32; - readonly value: u128; + /** @name PalletEvmMigrationCall (256) */ + export interface PalletEvmMigrationCall extends Enum { + readonly isBegin: boolean; + readonly asBegin: { + readonly address: H160; +>>>>>>> b43f8da0... added totalstaked & fix bug with number in RPC Client } & Struct; - readonly isApprove: boolean; - readonly asApprove: { - readonly spender: PalletEvmAccountBasicCrossAccountIdRepr; - readonly collectionId: u32; - readonly itemId: u32; - readonly amount: u128; + readonly isSudoUncheckedWeight: boolean; + readonly asSudoUncheckedWeight: { + readonly call: Call; + readonly weight: u64; } & Struct; - readonly isTransferFrom: boolean; - readonly asTransferFrom: { - readonly from: PalletEvmAccountBasicCrossAccountIdRepr; - readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr; - readonly collectionId: u32; - readonly itemId: u32; - readonly value: u128; + readonly isSetKey: boolean; + readonly asSetKey: { + readonly new_: MultiAddress; } & Struct; - readonly isSetCollectionLimits: boolean; - readonly asSetCollectionLimits: { - readonly collectionId: u32; - readonly newLimit: UpDataStructsCollectionLimits; + readonly isSudoAs: boolean; + readonly asSudoAs: { + readonly who: MultiAddress; + readonly call: Call; } & Struct; - readonly isSetCollectionPermissions: boolean; - readonly asSetCollectionPermissions: { - readonly collectionId: u32; - readonly newPermission: UpDataStructsCollectionPermissions; + readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs'; + } + + /** @name PalletSudoEvent (259) */ + export interface PalletSudoEvent extends Enum { + readonly isSudid: boolean; + readonly asSudid: { + readonly sudoResult: Result; } & Struct; - readonly isRepartition: boolean; - readonly asRepartition: { - readonly collectionId: u32; - readonly tokenId: u32; - readonly amount: u128; + readonly isKeyChanged: boolean; + readonly asKeyChanged: { + readonly oldSudoer: Option; + } & Struct; + readonly isSudoAsDone: boolean; + readonly asSudoAsDone: { + readonly sudoResult: Result; } & Struct; - readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; + readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone'; } - /** @name UpDataStructsCollectionMode (226) */ - interface UpDataStructsCollectionMode extends Enum { - readonly isNft: boolean; - readonly isFungible: boolean; - readonly asFungible: u8; - readonly isReFungible: boolean; - readonly type: 'Nft' | 'Fungible' | 'ReFungible'; + /** @name SpRuntimeDispatchError (261) */ + export interface SpRuntimeDispatchError extends Enum { + readonly isOther: boolean; + readonly isCannotLookup: boolean; + readonly isBadOrigin: boolean; + readonly isModule: boolean; + readonly asModule: SpRuntimeModuleError; + readonly isConsumerRemaining: boolean; + readonly isNoProviders: boolean; + readonly isTooManyConsumers: boolean; + readonly isToken: boolean; + readonly asToken: SpRuntimeTokenError; + readonly isArithmetic: boolean; + readonly asArithmetic: SpRuntimeArithmeticError; + readonly isTransactional: boolean; + readonly asTransactional: SpRuntimeTransactionalError; + readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional'; } - /** @name UpDataStructsCreateCollectionData (227) */ - interface UpDataStructsCreateCollectionData extends Struct { - readonly mode: UpDataStructsCollectionMode; - readonly access: Option; - readonly name: Vec; - readonly description: Vec; - readonly tokenPrefix: Bytes; - readonly pendingSponsor: Option; - readonly limits: Option; - readonly permissions: Option; - readonly tokenPropertyPermissions: Vec; - readonly properties: Vec; + /** @name SpRuntimeModuleError (262) */ + export interface SpRuntimeModuleError extends Struct { + readonly index: u8; + readonly error: U8aFixed; } - /** @name UpDataStructsAccessMode (229) */ - interface UpDataStructsAccessMode extends Enum { - readonly isNormal: boolean; - readonly isAllowList: boolean; - readonly type: 'Normal' | 'AllowList'; + /** @name SpRuntimeTokenError (263) */ + export interface SpRuntimeTokenError extends Enum { + readonly isNoFunds: boolean; + readonly isWouldDie: boolean; + readonly isBelowMinimum: boolean; + readonly isCannotCreate: boolean; + readonly isUnknownAsset: boolean; + readonly isFrozen: boolean; + readonly isUnsupported: boolean; + readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported'; } - /** @name UpDataStructsCollectionLimits (231) */ - interface UpDataStructsCollectionLimits extends Struct { - readonly accountTokenOwnershipLimit: Option; - readonly sponsoredDataSize: Option; - readonly sponsoredDataRateLimit: Option; - readonly tokenLimit: Option; - readonly sponsorTransferTimeout: Option; - readonly sponsorApproveTimeout: Option; - readonly ownerCanTransfer: Option; - readonly ownerCanDestroy: Option; - readonly transfersEnabled: Option; + /** @name SpRuntimeArithmeticError (264) */ + export interface SpRuntimeArithmeticError extends Enum { + readonly isUnderflow: boolean; + readonly isOverflow: boolean; + readonly isDivisionByZero: boolean; + readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero'; } - /** @name UpDataStructsSponsoringRateLimit (233) */ - interface UpDataStructsSponsoringRateLimit extends Enum { - readonly isSponsoringDisabled: boolean; - readonly isBlocks: boolean; - readonly asBlocks: u32; - readonly type: 'SponsoringDisabled' | 'Blocks'; + /** @name SpRuntimeTransactionalError (265) */ + export interface SpRuntimeTransactionalError extends Enum { + readonly isLimitReached: boolean; + readonly isNoLayer: boolean; + readonly type: 'LimitReached' | 'NoLayer'; } - /** @name UpDataStructsCollectionPermissions (236) */ - interface UpDataStructsCollectionPermissions extends Struct { - readonly access: Option; - readonly mintMode: Option; - readonly nesting: Option; + /** @name PalletSudoError (266) */ + export interface PalletSudoError extends Enum { + readonly isRequireSudo: boolean; + readonly type: 'RequireSudo'; } - /** @name UpDataStructsNestingPermissions (238) */ - interface UpDataStructsNestingPermissions extends Struct { - readonly tokenOwner: bool; - readonly collectionAdmin: bool; - readonly restricted: Option; + /** @name FrameSystemAccountInfo (267) */ + export interface FrameSystemAccountInfo extends Struct { + readonly nonce: u32; + readonly consumers: u32; + readonly providers: u32; + readonly sufficients: u32; + readonly data: PalletBalancesAccountData; } - /** @name UpDataStructsOwnerRestrictedSet (240) */ - interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} + /** @name FrameSupportWeightsPerDispatchClassU64 (268) */ + export interface FrameSupportWeightsPerDispatchClassU64 extends Struct { + readonly normal: u64; + readonly operational: u64; + readonly mandatory: u64; + } - /** @name UpDataStructsPropertyKeyPermission (245) */ - interface UpDataStructsPropertyKeyPermission extends Struct { - readonly key: Bytes; - readonly permission: UpDataStructsPropertyPermission; + /** @name SpRuntimeDigest (269) */ + export interface SpRuntimeDigest extends Struct { + readonly logs: Vec; } - /** @name UpDataStructsPropertyPermission (246) */ - interface UpDataStructsPropertyPermission extends Struct { - readonly mutable: bool; - readonly collectionAdmin: bool; - readonly tokenOwner: bool; + /** @name SpRuntimeDigestDigestItem (271) */ + export interface SpRuntimeDigestDigestItem extends Enum { + readonly isOther: boolean; + readonly asOther: Bytes; + readonly isConsensus: boolean; + readonly asConsensus: ITuple<[U8aFixed, Bytes]>; + readonly isSeal: boolean; + readonly asSeal: ITuple<[U8aFixed, Bytes]>; + readonly isPreRuntime: boolean; + readonly asPreRuntime: ITuple<[U8aFixed, Bytes]>; + readonly isRuntimeEnvironmentUpdated: boolean; + readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated'; } - /** @name UpDataStructsProperty (249) */ - interface UpDataStructsProperty extends Struct { - readonly key: Bytes; - readonly value: Bytes; + /** @name FrameSystemEventRecord (273) */ + export interface FrameSystemEventRecord extends Struct { + readonly phase: FrameSystemPhase; + readonly event: Event; + readonly topics: Vec; } - /** @name UpDataStructsCreateItemData (252) */ - interface UpDataStructsCreateItemData extends Enum { - readonly isNft: boolean; - readonly asNft: UpDataStructsCreateNftData; - readonly isFungible: boolean; - readonly asFungible: UpDataStructsCreateFungibleData; - readonly isReFungible: boolean; - readonly asReFungible: UpDataStructsCreateReFungibleData; - readonly type: 'Nft' | 'Fungible' | 'ReFungible'; + /** @name FrameSystemEvent (275) */ + export interface FrameSystemEvent extends Enum { + readonly isExtrinsicSuccess: boolean; + readonly asExtrinsicSuccess: { + readonly dispatchInfo: FrameSupportWeightsDispatchInfo; + } & Struct; + readonly isExtrinsicFailed: boolean; + readonly asExtrinsicFailed: { + readonly dispatchError: SpRuntimeDispatchError; + readonly dispatchInfo: FrameSupportWeightsDispatchInfo; + } & Struct; + readonly isCodeUpdated: boolean; + readonly isNewAccount: boolean; + readonly asNewAccount: { + readonly account: AccountId32; + } & Struct; + readonly isKilledAccount: boolean; + readonly asKilledAccount: { + readonly account: AccountId32; + } & Struct; + readonly isRemarked: boolean; + readonly asRemarked: { + readonly sender: AccountId32; + readonly hash_: H256; + } & Struct; + readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked'; } - /** @name UpDataStructsCreateNftData (253) */ - interface UpDataStructsCreateNftData extends Struct { - readonly properties: Vec; + /** @name FrameSupportWeightsDispatchInfo (276) */ + export interface FrameSupportWeightsDispatchInfo extends Struct { + readonly weight: u64; + readonly class: FrameSupportWeightsDispatchClass; + readonly paysFee: FrameSupportWeightsPays; } - /** @name UpDataStructsCreateFungibleData (254) */ - interface UpDataStructsCreateFungibleData extends Struct { - readonly value: u128; + /** @name FrameSupportWeightsDispatchClass (277) */ + export interface FrameSupportWeightsDispatchClass extends Enum { + readonly isNormal: boolean; + readonly isOperational: boolean; + readonly isMandatory: boolean; + readonly type: 'Normal' | 'Operational' | 'Mandatory'; } - /** @name UpDataStructsCreateReFungibleData (255) */ - interface UpDataStructsCreateReFungibleData extends Struct { - readonly pieces: u128; - readonly properties: Vec; + /** @name FrameSupportWeightsPays (278) */ + export interface FrameSupportWeightsPays extends Enum { + readonly isYes: boolean; + readonly isNo: boolean; + readonly type: 'Yes' | 'No'; } - /** @name UpDataStructsCreateItemExData (258) */ - interface UpDataStructsCreateItemExData extends Enum { - readonly isNft: boolean; - readonly asNft: Vec; - readonly isFungible: boolean; - readonly asFungible: BTreeMap; - readonly isRefungibleMultipleItems: boolean; - readonly asRefungibleMultipleItems: Vec; - readonly isRefungibleMultipleOwners: boolean; - readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners; - readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; + /** @name OrmlVestingModuleEvent (279) */ + export interface OrmlVestingModuleEvent extends Enum { + readonly isVestingScheduleAdded: boolean; + readonly asVestingScheduleAdded: { + readonly from: AccountId32; + readonly to: AccountId32; + readonly vestingSchedule: OrmlVestingVestingSchedule; + } & Struct; + readonly isClaimed: boolean; + readonly asClaimed: { + readonly who: AccountId32; + readonly amount: u128; + } & Struct; + readonly isVestingSchedulesUpdated: boolean; + readonly asVestingSchedulesUpdated: { + readonly who: AccountId32; + } & Struct; + readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated'; } - /** @name UpDataStructsCreateNftExData (260) */ - interface UpDataStructsCreateNftExData extends Struct { - readonly properties: Vec; - readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; + /** @name CumulusPalletXcmpQueueEvent (280) */ + export interface CumulusPalletXcmpQueueEvent extends Enum { + readonly isSuccess: boolean; + readonly asSuccess: Option; + readonly isFail: boolean; + readonly asFail: ITuple<[Option, XcmV2TraitsError]>; + readonly isBadVersion: boolean; + readonly asBadVersion: Option; + readonly isBadFormat: boolean; + readonly asBadFormat: Option; + readonly isUpwardMessageSent: boolean; + readonly asUpwardMessageSent: Option; + readonly isXcmpMessageSent: boolean; + readonly asXcmpMessageSent: Option; + readonly isOverweightEnqueued: boolean; + readonly asOverweightEnqueued: ITuple<[u32, u32, u64, u64]>; + readonly isOverweightServiced: boolean; + readonly asOverweightServiced: ITuple<[u64, u64]>; + readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name UpDataStructsCreateRefungibleExSingleOwner (267) */ - interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { - readonly user: PalletEvmAccountBasicCrossAccountIdRepr; - readonly pieces: u128; - readonly properties: Vec; + /** @name PalletXcmEvent (281) */ + export interface PalletXcmEvent extends Enum { + readonly isAttempted: boolean; + readonly asAttempted: XcmV2TraitsOutcome; + readonly isSent: boolean; + readonly asSent: ITuple<[XcmV1MultiLocation, XcmV1MultiLocation, XcmV2Xcm]>; + readonly isUnexpectedResponse: boolean; + readonly asUnexpectedResponse: ITuple<[XcmV1MultiLocation, u64]>; + readonly isResponseReady: boolean; + readonly asResponseReady: ITuple<[u64, XcmV2Response]>; + readonly isNotified: boolean; + readonly asNotified: ITuple<[u64, u8, u8]>; + readonly isNotifyOverweight: boolean; + readonly asNotifyOverweight: ITuple<[u64, u8, u8, u64, u64]>; + readonly isNotifyDispatchError: boolean; + readonly asNotifyDispatchError: ITuple<[u64, u8, u8]>; + readonly isNotifyDecodeFailed: boolean; + readonly asNotifyDecodeFailed: ITuple<[u64, u8, u8]>; + readonly isInvalidResponder: boolean; + readonly asInvalidResponder: ITuple<[XcmV1MultiLocation, u64, Option]>; + readonly isInvalidResponderVersion: boolean; + readonly asInvalidResponderVersion: ITuple<[XcmV1MultiLocation, u64]>; + readonly isResponseTaken: boolean; + readonly asResponseTaken: u64; + readonly isAssetsTrapped: boolean; + readonly asAssetsTrapped: ITuple<[H256, XcmV1MultiLocation, XcmVersionedMultiAssets]>; + readonly isVersionChangeNotified: boolean; + readonly asVersionChangeNotified: ITuple<[XcmV1MultiLocation, u32]>; + readonly isSupportedVersionChanged: boolean; + readonly asSupportedVersionChanged: ITuple<[XcmV1MultiLocation, u32]>; + readonly isNotifyTargetSendFail: boolean; + readonly asNotifyTargetSendFail: ITuple<[XcmV1MultiLocation, u64, XcmV2TraitsError]>; + readonly isNotifyTargetMigrationFail: boolean; + readonly asNotifyTargetMigrationFail: ITuple<[XcmVersionedMultiLocation, u64]>; + readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail'; + } + + /** @name XcmV2TraitsOutcome (282) */ + export interface XcmV2TraitsOutcome extends Enum { + readonly isComplete: boolean; + readonly asComplete: u64; + readonly isIncomplete: boolean; + readonly asIncomplete: ITuple<[u64, XcmV2TraitsError]>; + readonly isError: boolean; + readonly asError: XcmV2TraitsError; + readonly type: 'Complete' | 'Incomplete' | 'Error'; } - /** @name UpDataStructsCreateRefungibleExMultipleOwners (269) */ - interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { - readonly users: BTreeMap; - readonly properties: Vec; + /** @name CumulusPalletXcmEvent (284) */ + export interface CumulusPalletXcmEvent extends Enum { + readonly isInvalidFormat: boolean; + readonly asInvalidFormat: U8aFixed; + readonly isUnsupportedVersion: boolean; + readonly asUnsupportedVersion: U8aFixed; + readonly isExecutedDownward: boolean; + readonly asExecutedDownward: ITuple<[U8aFixed, XcmV2TraitsOutcome]>; + readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; } - /** @name PalletUniqueSchedulerCall (270) */ - interface PalletUniqueSchedulerCall extends Enum { - readonly isScheduleNamed: boolean; - readonly asScheduleNamed: { - readonly id: U8aFixed; - readonly when: u32; - readonly maybePeriodic: Option>; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; + /** @name CumulusPalletDmpQueueEvent (285) */ + export interface CumulusPalletDmpQueueEvent extends Enum { + readonly isInvalidFormat: boolean; + readonly asInvalidFormat: { + readonly messageId: U8aFixed; } & Struct; - readonly isCancelNamed: boolean; - readonly asCancelNamed: { - readonly id: U8aFixed; + readonly isUnsupportedVersion: boolean; + readonly asUnsupportedVersion: { + readonly messageId: U8aFixed; } & Struct; - readonly isScheduleNamedAfter: boolean; - readonly asScheduleNamedAfter: { - readonly id: U8aFixed; - readonly after: u32; - readonly maybePeriodic: Option>; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; + readonly isExecutedDownward: boolean; + readonly asExecutedDownward: { + readonly messageId: U8aFixed; + readonly outcome: XcmV2TraitsOutcome; } & Struct; - readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; + readonly isWeightExhausted: boolean; + readonly asWeightExhausted: { + readonly messageId: U8aFixed; + readonly remainingWeight: u64; + readonly requiredWeight: u64; + } & Struct; + readonly isOverweightEnqueued: boolean; + readonly asOverweightEnqueued: { + readonly messageId: U8aFixed; + readonly overweightIndex: u64; + readonly requiredWeight: u64; + } & Struct; + readonly isOverweightServiced: boolean; + readonly asOverweightServiced: { + readonly overweightIndex: u64; + readonly weightUsed: u64; + } & Struct; + readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name FrameSupportScheduleMaybeHashed (272) */ - interface FrameSupportScheduleMaybeHashed extends Enum { - readonly isValue: boolean; - readonly asValue: Call; - readonly isHash: boolean; - readonly asHash: H256; - readonly type: 'Value' | 'Hash'; + /** @name PalletUniqueRawEvent (286) */ + export interface PalletUniqueRawEvent extends Enum { + readonly isCollectionSponsorRemoved: boolean; + readonly asCollectionSponsorRemoved: u32; + readonly isCollectionAdminAdded: boolean; + readonly asCollectionAdminAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; + readonly isCollectionOwnedChanged: boolean; + readonly asCollectionOwnedChanged: ITuple<[u32, AccountId32]>; + readonly isCollectionSponsorSet: boolean; + readonly asCollectionSponsorSet: ITuple<[u32, AccountId32]>; + readonly isSponsorshipConfirmed: boolean; + readonly asSponsorshipConfirmed: ITuple<[u32, AccountId32]>; + readonly isCollectionAdminRemoved: boolean; + readonly asCollectionAdminRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; + readonly isAllowListAddressRemoved: boolean; + readonly asAllowListAddressRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; + readonly isAllowListAddressAdded: boolean; + readonly asAllowListAddressAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; + readonly isCollectionLimitSet: boolean; + readonly asCollectionLimitSet: u32; + readonly isCollectionPermissionSet: boolean; + readonly asCollectionPermissionSet: u32; + readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet'; } - /** @name PalletConfigurationCall (273) */ - interface PalletConfigurationCall extends Enum { - readonly isSetWeightToFeeCoefficientOverride: boolean; - readonly asSetWeightToFeeCoefficientOverride: { - readonly coeff: Option; + /** @name PalletUniqueSchedulerEvent (287) */ + export interface PalletUniqueSchedulerEvent extends Enum { + readonly isScheduled: boolean; + readonly asScheduled: { + readonly when: u32; + readonly index: u32; + } & Struct; + readonly isCanceled: boolean; + readonly asCanceled: { + readonly when: u32; + readonly index: u32; + } & Struct; + readonly isDispatched: boolean; + readonly asDispatched: { + readonly task: ITuple<[u32, u32]>; + readonly id: Option; + readonly result: Result; } & Struct; - readonly isSetMinGasPriceOverride: boolean; - readonly asSetMinGasPriceOverride: { - readonly coeff: Option; + readonly isCallLookupFailed: boolean; + readonly asCallLookupFailed: { + readonly task: ITuple<[u32, u32]>; + readonly id: Option; + readonly error: FrameSupportScheduleLookupError; } & Struct; - readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride'; + readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; + } + + /** @name FrameSupportScheduleLookupError (289) */ + export interface FrameSupportScheduleLookupError extends Enum { + readonly isUnknown: boolean; + readonly isBadFormat: boolean; + readonly type: 'Unknown' | 'BadFormat'; } - /** @name PalletTemplateTransactionPaymentCall (274) */ - type PalletTemplateTransactionPaymentCall = Null; + /** @name PalletCommonEvent (290) */ + export interface PalletCommonEvent extends Enum { + readonly isCollectionCreated: boolean; + readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; + readonly isCollectionDestroyed: boolean; + readonly asCollectionDestroyed: u32; + readonly isItemCreated: boolean; + readonly asItemCreated: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; + readonly isItemDestroyed: boolean; + readonly asItemDestroyed: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; + readonly isTransfer: boolean; + readonly asTransfer: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; + readonly isApproved: boolean; + readonly asApproved: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; + readonly isCollectionPropertySet: boolean; + readonly asCollectionPropertySet: ITuple<[u32, Bytes]>; + readonly isCollectionPropertyDeleted: boolean; + readonly asCollectionPropertyDeleted: ITuple<[u32, Bytes]>; + readonly isTokenPropertySet: boolean; + readonly asTokenPropertySet: ITuple<[u32, u32, Bytes]>; + readonly isTokenPropertyDeleted: boolean; + readonly asTokenPropertyDeleted: ITuple<[u32, u32, Bytes]>; + readonly isPropertyPermissionSet: boolean; + readonly asPropertyPermissionSet: ITuple<[u32, Bytes]>; + readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; + } - /** @name PalletStructureCall (275) */ - type PalletStructureCall = Null; + /** @name PalletStructureEvent (291) */ + export interface PalletStructureEvent extends Enum { + readonly isExecuted: boolean; + readonly asExecuted: Result; + readonly type: 'Executed'; + } - /** @name PalletRmrkCoreCall (276) */ - interface PalletRmrkCoreCall extends Enum { - readonly isCreateCollection: boolean; - readonly asCreateCollection: { - readonly metadata: Bytes; - readonly max: Option; - readonly symbol: Bytes; - } & Struct; - readonly isDestroyCollection: boolean; - readonly asDestroyCollection: { + /** @name PalletRmrkCoreEvent (292) */ + export interface PalletRmrkCoreEvent extends Enum { + readonly isCollectionCreated: boolean; + readonly asCollectionCreated: { + readonly issuer: AccountId32; readonly collectionId: u32; } & Struct; - readonly isChangeCollectionIssuer: boolean; - readonly asChangeCollectionIssuer: { + readonly isCollectionDestroyed: boolean; + readonly asCollectionDestroyed: { + readonly issuer: AccountId32; readonly collectionId: u32; - readonly newIssuer: MultiAddress; } & Struct; - readonly isLockCollection: boolean; - readonly asLockCollection: { + readonly isIssuerChanged: boolean; + readonly asIssuerChanged: { + readonly oldIssuer: AccountId32; + readonly newIssuer: AccountId32; readonly collectionId: u32; } & Struct; - readonly isMintNft: boolean; - readonly asMintNft: { - readonly owner: Option; + readonly isCollectionLocked: boolean; + readonly asCollectionLocked: { + readonly issuer: AccountId32; readonly collectionId: u32; - readonly recipient: Option; - readonly royaltyAmount: Option; - readonly metadata: Bytes; - readonly transferable: bool; - readonly resources: Option>; } & Struct; - readonly isBurnNft: boolean; - readonly asBurnNft: { + readonly isNftMinted: boolean; + readonly asNftMinted: { + readonly owner: AccountId32; readonly collectionId: u32; readonly nftId: u32; - readonly maxBurns: u32; - } & Struct; - readonly isSend: boolean; - readonly asSend: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; } & Struct; - readonly isAcceptNft: boolean; - readonly asAcceptNft: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; + readonly isNftBurned: boolean; + readonly asNftBurned: { + readonly owner: AccountId32; + readonly nftId: u32; } & Struct; - readonly isRejectNft: boolean; - readonly asRejectNft: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; + readonly isNftSent: boolean; + readonly asNftSent: { + readonly sender: AccountId32; + readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; + readonly collectionId: u32; + readonly nftId: u32; + readonly approvalRequired: bool; } & Struct; - readonly isAcceptResource: boolean; - readonly asAcceptResource: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly resourceId: u32; + readonly isNftAccepted: boolean; + readonly asNftAccepted: { + readonly sender: AccountId32; + readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; + readonly collectionId: u32; + readonly nftId: u32; } & Struct; - readonly isAcceptResourceRemoval: boolean; - readonly asAcceptResourceRemoval: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly resourceId: u32; + readonly isNftRejected: boolean; + readonly asNftRejected: { + readonly sender: AccountId32; + readonly collectionId: u32; + readonly nftId: u32; } & Struct; - readonly isSetProperty: boolean; - readonly asSetProperty: { - readonly rmrkCollectionId: Compact; + readonly isPropertySet: boolean; + readonly asPropertySet: { + readonly collectionId: u32; readonly maybeNftId: Option; readonly key: Bytes; readonly value: Bytes; } & Struct; - readonly isSetPriority: boolean; - readonly asSetPriority: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly priorities: Vec; - } & Struct; - readonly isAddBasicResource: boolean; - readonly asAddBasicResource: { - readonly rmrkCollectionId: u32; + readonly isResourceAdded: boolean; + readonly asResourceAdded: { readonly nftId: u32; - readonly resource: RmrkTraitsResourceBasicResource; + readonly resourceId: u32; } & Struct; - readonly isAddComposableResource: boolean; - readonly asAddComposableResource: { - readonly rmrkCollectionId: u32; + readonly isResourceRemoval: boolean; + readonly asResourceRemoval: { readonly nftId: u32; - readonly resource: RmrkTraitsResourceComposableResource; + readonly resourceId: u32; } & Struct; - readonly isAddSlotResource: boolean; - readonly asAddSlotResource: { - readonly rmrkCollectionId: u32; + readonly isResourceAccepted: boolean; + readonly asResourceAccepted: { readonly nftId: u32; - readonly resource: RmrkTraitsResourceSlotResource; + readonly resourceId: u32; } & Struct; - readonly isRemoveResource: boolean; - readonly asRemoveResource: { - readonly rmrkCollectionId: u32; + readonly isResourceRemovalAccepted: boolean; + readonly asResourceRemovalAccepted: { readonly nftId: u32; readonly resourceId: u32; } & Struct; - readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; - } - - /** @name RmrkTraitsResourceResourceTypes (282) */ - interface RmrkTraitsResourceResourceTypes extends Enum { - readonly isBasic: boolean; - readonly asBasic: RmrkTraitsResourceBasicResource; - readonly isComposable: boolean; - readonly asComposable: RmrkTraitsResourceComposableResource; - readonly isSlot: boolean; - readonly asSlot: RmrkTraitsResourceSlotResource; - readonly type: 'Basic' | 'Composable' | 'Slot'; - } - - /** @name RmrkTraitsResourceBasicResource (284) */ - interface RmrkTraitsResourceBasicResource extends Struct { - readonly src: Option; - readonly metadata: Option; - readonly license: Option; - readonly thumb: Option; - } - - /** @name RmrkTraitsResourceComposableResource (286) */ - interface RmrkTraitsResourceComposableResource extends Struct { - readonly parts: Vec; - readonly base: u32; - readonly src: Option; - readonly metadata: Option; - readonly license: Option; - readonly thumb: Option; - } - - /** @name RmrkTraitsResourceSlotResource (287) */ - interface RmrkTraitsResourceSlotResource extends Struct { - readonly base: u32; - readonly src: Option; - readonly metadata: Option; - readonly slot: u32; - readonly license: Option; - readonly thumb: Option; + readonly isPrioritySet: boolean; + readonly asPrioritySet: { + readonly collectionId: u32; + readonly nftId: u32; + } & Struct; + readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; } - /** @name PalletRmrkEquipCall (290) */ - interface PalletRmrkEquipCall extends Enum { - readonly isCreateBase: boolean; - readonly asCreateBase: { - readonly baseType: Bytes; - readonly symbol: Bytes; - readonly parts: Vec; - } & Struct; - readonly isThemeAdd: boolean; - readonly asThemeAdd: { + /** @name PalletRmrkEquipEvent (293) */ + export interface PalletRmrkEquipEvent extends Enum { + readonly isBaseCreated: boolean; + readonly asBaseCreated: { + readonly issuer: AccountId32; readonly baseId: u32; - readonly theme: RmrkTraitsTheme; } & Struct; - readonly isEquippable: boolean; - readonly asEquippable: { + readonly isEquippablesUpdated: boolean; + readonly asEquippablesUpdated: { readonly baseId: u32; readonly slotId: u32; - readonly equippables: RmrkTraitsPartEquippableList; } & Struct; - readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; + readonly type: 'BaseCreated' | 'EquippablesUpdated'; } - /** @name RmrkTraitsPartPartType (293) */ - interface RmrkTraitsPartPartType extends Enum { - readonly isFixedPart: boolean; - readonly asFixedPart: RmrkTraitsPartFixedPart; - readonly isSlotPart: boolean; - readonly asSlotPart: RmrkTraitsPartSlotPart; - readonly type: 'FixedPart' | 'SlotPart'; + /** @name PalletEvmEvent (294) */ + export interface PalletEvmEvent extends Enum { + readonly isLog: boolean; + readonly asLog: EthereumLog; + readonly isCreated: boolean; + readonly asCreated: H160; + readonly isCreatedFailed: boolean; + readonly asCreatedFailed: H160; + readonly isExecuted: boolean; + readonly asExecuted: H160; + readonly isExecutedFailed: boolean; + readonly asExecutedFailed: H160; + readonly isBalanceDeposit: boolean; + readonly asBalanceDeposit: ITuple<[AccountId32, H160, U256]>; + readonly isBalanceWithdraw: boolean; + readonly asBalanceWithdraw: ITuple<[AccountId32, H160, U256]>; + readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; } - /** @name RmrkTraitsPartFixedPart (295) */ - interface RmrkTraitsPartFixedPart extends Struct { - readonly id: u32; - readonly z: u32; - readonly src: Bytes; + /** @name EthereumLog (295) */ + export interface EthereumLog extends Struct { + readonly address: H160; + readonly topics: Vec; + readonly data: Bytes; } - /** @name RmrkTraitsPartSlotPart (296) */ - interface RmrkTraitsPartSlotPart extends Struct { - readonly id: u32; - readonly equippable: RmrkTraitsPartEquippableList; - readonly src: Bytes; - readonly z: u32; + /** @name PalletEthereumEvent (296) */ + export interface PalletEthereumEvent extends Enum { + readonly isExecuted: boolean; + readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; + readonly type: 'Executed'; } - /** @name RmrkTraitsPartEquippableList (297) */ - interface RmrkTraitsPartEquippableList extends Enum { - readonly isAll: boolean; - readonly isEmpty: boolean; - readonly isCustom: boolean; - readonly asCustom: Vec; - readonly type: 'All' | 'Empty' | 'Custom'; + /** @name EvmCoreErrorExitReason (297) */ + export interface EvmCoreErrorExitReason extends Enum { + readonly isSucceed: boolean; + readonly asSucceed: EvmCoreErrorExitSucceed; + readonly isError: boolean; + readonly asError: EvmCoreErrorExitError; + readonly isRevert: boolean; + readonly asRevert: EvmCoreErrorExitRevert; + readonly isFatal: boolean; + readonly asFatal: EvmCoreErrorExitFatal; + readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; } - /** @name RmrkTraitsTheme (299) */ - interface RmrkTraitsTheme extends Struct { - readonly name: Bytes; - readonly properties: Vec; - readonly inherit: bool; + /** @name EvmCoreErrorExitSucceed (298) */ + export interface EvmCoreErrorExitSucceed extends Enum { + readonly isStopped: boolean; + readonly isReturned: boolean; + readonly isSuicided: boolean; + readonly type: 'Stopped' | 'Returned' | 'Suicided'; } - /** @name RmrkTraitsThemeThemeProperty (301) */ - interface RmrkTraitsThemeThemeProperty extends Struct { - readonly key: Bytes; - readonly value: Bytes; + /** @name EvmCoreErrorExitError (299) */ + export interface EvmCoreErrorExitError extends Enum { + readonly isStackUnderflow: boolean; + readonly isStackOverflow: boolean; + readonly isInvalidJump: boolean; + readonly isInvalidRange: boolean; + readonly isDesignatedInvalid: boolean; + readonly isCallTooDeep: boolean; + readonly isCreateCollision: boolean; + readonly isCreateContractLimit: boolean; + readonly isOutOfOffset: boolean; + readonly isOutOfGas: boolean; + readonly isOutOfFund: boolean; + readonly isPcUnderflow: boolean; + readonly isCreateEmpty: boolean; + readonly isOther: boolean; + readonly asOther: Text; + readonly isInvalidCode: boolean; + readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; } - /** @name PalletEvmCall (303) */ - interface PalletEvmCall extends Enum { - readonly isWithdraw: boolean; - readonly asWithdraw: { - readonly address: H160; - readonly value: u128; - } & Struct; - readonly isCall: boolean; - readonly asCall: { - readonly source: H160; - readonly target: H160; - readonly input: Bytes; - readonly value: U256; - readonly gasLimit: u64; - readonly maxFeePerGas: U256; - readonly maxPriorityFeePerGas: Option; - readonly nonce: Option; - readonly accessList: Vec]>>; - } & Struct; - readonly isCreate: boolean; - readonly asCreate: { - readonly source: H160; - readonly init: Bytes; - readonly value: U256; - readonly gasLimit: u64; - readonly maxFeePerGas: U256; - readonly maxPriorityFeePerGas: Option; - readonly nonce: Option; - readonly accessList: Vec]>>; - } & Struct; - readonly isCreate2: boolean; - readonly asCreate2: { - readonly source: H160; - readonly init: Bytes; - readonly salt: H256; - readonly value: U256; - readonly gasLimit: u64; - readonly maxFeePerGas: U256; - readonly maxPriorityFeePerGas: Option; - readonly nonce: Option; - readonly accessList: Vec]>>; - } & Struct; - readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; + /** @name EvmCoreErrorExitRevert (302) */ + export interface EvmCoreErrorExitRevert extends Enum { + readonly isReverted: boolean; + readonly type: 'Reverted'; } - /** @name PalletEthereumCall (307) */ - interface PalletEthereumCall extends Enum { - readonly isTransact: boolean; - readonly asTransact: { - readonly transaction: EthereumTransactionTransactionV2; - } & Struct; - readonly type: 'Transact'; + /** @name EvmCoreErrorExitFatal (303) */ + export interface EvmCoreErrorExitFatal extends Enum { + readonly isNotSupported: boolean; + readonly isUnhandledInterrupt: boolean; + readonly isCallErrorAsFatal: boolean; + readonly asCallErrorAsFatal: EvmCoreErrorExitError; + readonly isOther: boolean; + readonly asOther: Text; + readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; } - /** @name EthereumTransactionTransactionV2 (308) */ - interface EthereumTransactionTransactionV2 extends Enum { - readonly isLegacy: boolean; - readonly asLegacy: EthereumTransactionLegacyTransaction; - readonly isEip2930: boolean; - readonly asEip2930: EthereumTransactionEip2930Transaction; - readonly isEip1559: boolean; - readonly asEip1559: EthereumTransactionEip1559Transaction; - readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; + /** @name FrameSystemPhase (304) */ + export interface FrameSystemPhase extends Enum { + readonly isApplyExtrinsic: boolean; + readonly asApplyExtrinsic: u32; + readonly isFinalization: boolean; + readonly isInitialization: boolean; + readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } - /** @name EthereumTransactionLegacyTransaction (309) */ - interface EthereumTransactionLegacyTransaction extends Struct { - readonly nonce: U256; - readonly gasPrice: U256; - readonly gasLimit: U256; - readonly action: EthereumTransactionTransactionAction; - readonly value: U256; - readonly input: Bytes; - readonly signature: EthereumTransactionTransactionSignature; + /** @name FrameSystemLastRuntimeUpgradeInfo (306) */ + export interface FrameSystemLastRuntimeUpgradeInfo extends Struct { + readonly specVersion: Compact; + readonly specName: Text; } - /** @name EthereumTransactionTransactionAction (310) */ - interface EthereumTransactionTransactionAction extends Enum { - readonly isCall: boolean; - readonly asCall: H160; - readonly isCreate: boolean; - readonly type: 'Call' | 'Create'; + /** @name FrameSystemLimitsBlockWeights (307) */ + export interface FrameSystemLimitsBlockWeights extends Struct { + readonly baseBlock: u64; + readonly maxBlock: u64; + readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; } - /** @name EthereumTransactionTransactionSignature (311) */ - interface EthereumTransactionTransactionSignature extends Struct { - readonly v: u64; - readonly r: H256; - readonly s: H256; + /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (308) */ + export interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { + readonly normal: FrameSystemLimitsWeightsPerClass; + readonly operational: FrameSystemLimitsWeightsPerClass; + readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name EthereumTransactionEip2930Transaction (313) */ - interface EthereumTransactionEip2930Transaction extends Struct { - readonly chainId: u64; - readonly nonce: U256; - readonly gasPrice: U256; - readonly gasLimit: U256; - readonly action: EthereumTransactionTransactionAction; - readonly value: U256; - readonly input: Bytes; - readonly accessList: Vec; - readonly oddYParity: bool; - readonly r: H256; - readonly s: H256; + /** @name FrameSystemLimitsWeightsPerClass (309) */ + export interface FrameSystemLimitsWeightsPerClass extends Struct { + readonly baseExtrinsic: u64; + readonly maxExtrinsic: Option; + readonly maxTotal: Option; + readonly reserved: Option; } - /** @name EthereumTransactionAccessListItem (315) */ - interface EthereumTransactionAccessListItem extends Struct { - readonly address: H160; - readonly storageKeys: Vec; + /** @name FrameSystemLimitsBlockLength (311) */ + export interface FrameSystemLimitsBlockLength extends Struct { + readonly max: FrameSupportWeightsPerDispatchClassU32; } - /** @name EthereumTransactionEip1559Transaction (316) */ - interface EthereumTransactionEip1559Transaction extends Struct { - readonly chainId: u64; - readonly nonce: U256; - readonly maxPriorityFeePerGas: U256; - readonly maxFeePerGas: U256; - readonly gasLimit: U256; - readonly action: EthereumTransactionTransactionAction; - readonly value: U256; - readonly input: Bytes; - readonly accessList: Vec; - readonly oddYParity: bool; - readonly r: H256; - readonly s: H256; + /** @name FrameSupportWeightsPerDispatchClassU32 (312) */ + export interface FrameSupportWeightsPerDispatchClassU32 extends Struct { + readonly normal: u32; + readonly operational: u32; + readonly mandatory: u32; } - /** @name PalletEvmMigrationCall (317) */ - interface PalletEvmMigrationCall extends Enum { - readonly isBegin: boolean; - readonly asBegin: { - readonly address: H160; - } & Struct; - readonly isSetData: boolean; - readonly asSetData: { - readonly address: H160; - readonly data: Vec>; - } & Struct; - readonly isFinish: boolean; - readonly asFinish: { - readonly address: H160; - readonly code: Bytes; - } & Struct; - readonly type: 'Begin' | 'SetData' | 'Finish'; + /** @name FrameSupportWeightsRuntimeDbWeight (313) */ + export interface FrameSupportWeightsRuntimeDbWeight extends Struct { + readonly read: u64; + readonly write: u64; } - /** @name PalletSudoError (320) */ - interface PalletSudoError extends Enum { - readonly isRequireSudo: boolean; - readonly type: 'RequireSudo'; + /** @name SpVersionRuntimeVersion (314) */ + export interface SpVersionRuntimeVersion extends Struct { + readonly specName: Text; + readonly implName: Text; + readonly authoringVersion: u32; + readonly specVersion: u32; + readonly implVersion: u32; + readonly apis: Vec>; + readonly transactionVersion: u32; + readonly stateVersion: u8; + } + + /** @name FrameSystemError (318) */ + export interface FrameSystemError extends Enum { + readonly isInvalidSpecName: boolean; + readonly isSpecVersionNeedsToIncrease: boolean; + readonly isFailedToExtractRuntimeVersion: boolean; + readonly isNonDefaultComposite: boolean; + readonly isNonZeroRefCount: boolean; + readonly isCallFiltered: boolean; + readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name OrmlVestingModuleError (322) */ - interface OrmlVestingModuleError extends Enum { + /** @name OrmlVestingModuleError (320) */ + export interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; readonly isInsufficientBalanceToLock: boolean; @@ -2816,30 +3115,30 @@ declare module '@polkadot/types/lookup' { readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (324) */ - interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { + /** @name CumulusPalletXcmpQueueInboundChannelDetails (322) */ + export interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (325) */ - interface CumulusPalletXcmpQueueInboundState extends Enum { + /** @name CumulusPalletXcmpQueueInboundState (323) */ + export interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (328) */ - interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (326) */ + export interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; readonly isSignals: boolean; readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (331) */ - interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (329) */ + export interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; readonly signalsExist: bool; @@ -2847,15 +3146,15 @@ declare module '@polkadot/types/lookup' { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (332) */ - interface CumulusPalletXcmpQueueOutboundState extends Enum { + /** @name CumulusPalletXcmpQueueOutboundState (330) */ + export interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (334) */ - interface CumulusPalletXcmpQueueQueueConfigData extends Struct { + /** @name CumulusPalletXcmpQueueQueueConfigData (332) */ + export interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; readonly resumeThreshold: u32; @@ -2864,8 +3163,8 @@ declare module '@polkadot/types/lookup' { readonly xcmpMaxIndividualWeight: u64; } - /** @name CumulusPalletXcmpQueueError (336) */ - interface CumulusPalletXcmpQueueError extends Enum { + /** @name CumulusPalletXcmpQueueError (334) */ + export interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; readonly isBadXcm: boolean; @@ -2874,8 +3173,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (337) */ - interface PalletXcmError extends Enum { + /** @name PalletXcmError (335) */ + export interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; readonly isFiltered: boolean; @@ -2892,30 +3191,30 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (338) */ - type CumulusPalletXcmError = Null; + /** @name CumulusPalletXcmError (336) */ + export type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (339) */ - interface CumulusPalletDmpQueueConfigData extends Struct { + /** @name CumulusPalletDmpQueueConfigData (337) */ + export interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: u64; } - /** @name CumulusPalletDmpQueuePageIndexData (340) */ - interface CumulusPalletDmpQueuePageIndexData extends Struct { + /** @name CumulusPalletDmpQueuePageIndexData (338) */ + export interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (343) */ - interface CumulusPalletDmpQueueError extends Enum { + /** @name CumulusPalletDmpQueueError (341) */ + export interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (347) */ - interface PalletUniqueError extends Enum { + /** @name PalletUniqueError (346) */ + export interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; readonly isEmptyArgument: boolean; @@ -2923,8 +3222,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name PalletUniqueSchedulerScheduledV3 (350) */ - interface PalletUniqueSchedulerScheduledV3 extends Struct { + /** @name PalletUniqueSchedulerScheduledV3 (349) */ + export interface PalletUniqueSchedulerScheduledV3 extends Struct { readonly maybeId: Option; readonly priority: u8; readonly call: FrameSupportScheduleMaybeHashed; @@ -2932,8 +3231,9 @@ declare module '@polkadot/types/lookup' { readonly origin: OpalRuntimeOriginCaller; } - /** @name OpalRuntimeOriginCaller (351) */ - interface OpalRuntimeOriginCaller extends Enum { + /** @name OpalRuntimeOriginCaller (350) */ + export interface OpalRuntimeOriginCaller extends Enum { + readonly isVoid: boolean; readonly isSystem: boolean; readonly asSystem: FrameSupportDispatchRawOrigin; readonly isVoid: boolean; @@ -2946,8 +3246,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; } - /** @name FrameSupportDispatchRawOrigin (352) */ - interface FrameSupportDispatchRawOrigin extends Enum { + /** @name FrameSupportDispatchRawOrigin (351) */ + export interface FrameSupportDispatchRawOrigin extends Enum { readonly isRoot: boolean; readonly isSigned: boolean; readonly asSigned: AccountId32; @@ -2955,8 +3255,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'Root' | 'Signed' | 'None'; } - /** @name PalletXcmOrigin (353) */ - interface PalletXcmOrigin extends Enum { + /** @name PalletXcmOrigin (352) */ + export interface PalletXcmOrigin extends Enum { readonly isXcm: boolean; readonly asXcm: XcmV1MultiLocation; readonly isResponse: boolean; @@ -2964,26 +3264,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'Xcm' | 'Response'; } - /** @name CumulusPalletXcmOrigin (354) */ - interface CumulusPalletXcmOrigin extends Enum { + /** @name CumulusPalletXcmOrigin (353) */ + export interface CumulusPalletXcmOrigin extends Enum { readonly isRelay: boolean; readonly isSiblingParachain: boolean; readonly asSiblingParachain: u32; readonly type: 'Relay' | 'SiblingParachain'; } - /** @name PalletEthereumRawOrigin (355) */ - interface PalletEthereumRawOrigin extends Enum { + /** @name PalletEthereumRawOrigin (354) */ + export interface PalletEthereumRawOrigin extends Enum { readonly isEthereumTransaction: boolean; readonly asEthereumTransaction: H160; readonly type: 'EthereumTransaction'; } - /** @name SpCoreVoid (356) */ - type SpCoreVoid = Null; + /** @name SpCoreVoid (355) */ + export type SpCoreVoid = Null; - /** @name PalletUniqueSchedulerError (357) */ - interface PalletUniqueSchedulerError extends Enum { + /** @name PalletUniqueSchedulerError (356) */ + export interface PalletUniqueSchedulerError extends Enum { readonly isFailedToSchedule: boolean; readonly isNotFound: boolean; readonly isTargetBlockNumberInPast: boolean; @@ -2991,8 +3291,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; } - /** @name UpDataStructsCollection (358) */ - interface UpDataStructsCollection extends Struct { + /** @name UpDataStructsCollection (357) */ + export interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; readonly name: Vec; @@ -3004,8 +3304,8 @@ declare module '@polkadot/types/lookup' { readonly externalCollection: bool; } - /** @name UpDataStructsSponsorshipState (359) */ - interface UpDataStructsSponsorshipState extends Enum { + /** @name UpDataStructsSponsorshipState (358) */ + export interface UpDataStructsSponsorshipState extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; readonly asUnconfirmed: AccountId32; @@ -3014,44 +3314,44 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (360) */ - interface UpDataStructsProperties extends Struct { + /** @name UpDataStructsProperties (359) */ + export interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (361) */ - interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} + /** @name UpDataStructsPropertiesMapBoundedVec (360) */ + export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (366) */ - interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} + /** @name UpDataStructsPropertiesMapPropertyPermission (365) */ + export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (373) */ - interface UpDataStructsCollectionStats extends Struct { + /** @name UpDataStructsCollectionStats (372) */ + export interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (374) */ - interface UpDataStructsTokenChild extends Struct { + /** @name UpDataStructsTokenChild (373) */ + export interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (375) */ - interface PhantomTypeUpDataStructs extends Vec> {} + /** @name PhantomTypeUpDataStructs (374) */ + export interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (377) */ - interface UpDataStructsTokenData extends Struct { + /** @name UpDataStructsTokenData (376) */ + export interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (379) */ - interface UpDataStructsRpcCollection extends Struct { + /** @name UpDataStructsRpcCollection (378) */ + export interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; readonly name: Vec; @@ -3065,8 +3365,8 @@ declare module '@polkadot/types/lookup' { readonly readOnly: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (380) */ - interface RmrkTraitsCollectionCollectionInfo extends Struct { + /** @name RmrkTraitsCollectionCollectionInfo (379) */ + export interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; readonly max: Option; @@ -3074,8 +3374,8 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (381) */ - interface RmrkTraitsNftNftInfo extends Struct { + /** @name RmrkTraitsNftNftInfo (380) */ + export interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; readonly metadata: Bytes; @@ -3083,41 +3383,41 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (383) */ - interface RmrkTraitsNftRoyaltyInfo extends Struct { + /** @name RmrkTraitsNftRoyaltyInfo (382) */ + export interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (384) */ - interface RmrkTraitsResourceResourceInfo extends Struct { + /** @name RmrkTraitsResourceResourceInfo (383) */ + export interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; readonly pending: bool; readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (385) */ - interface RmrkTraitsPropertyPropertyInfo extends Struct { + /** @name RmrkTraitsPropertyPropertyInfo (384) */ + export interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (386) */ - interface RmrkTraitsBaseBaseInfo extends Struct { + /** @name RmrkTraitsBaseBaseInfo (385) */ + export interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (387) */ - interface RmrkTraitsNftNftChild extends Struct { + /** @name RmrkTraitsNftNftChild (386) */ + export interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (389) */ - interface PalletCommonError extends Enum { + /** @name PalletCommonError (388) */ + export interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; readonly isNoPermission: boolean; @@ -3155,8 +3455,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (391) */ - interface PalletFungibleError extends Enum { + /** @name PalletFungibleError (390) */ + export interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; readonly isFungibleItemsDontHaveData: boolean; @@ -3165,8 +3465,8 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (392) */ - interface PalletRefungibleItemData extends Struct { + /** @name PalletRefungibleItemData (391) */ + export interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } diff --git a/tests/src/interfaces/unique/definitions.ts b/tests/src/interfaces/unique/definitions.ts index 29daa4c791..ea93f78d07 100644 --- a/tests/src/interfaces/unique/definitions.ts +++ b/tests/src/interfaces/unique/definitions.ts @@ -175,5 +175,20 @@ export default { [collectionParam, tokenParam], 'Option', ), + totalStaked: fun( + 'Returns the total amount of staked tokens', + [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}], + 'u128', + ), + totalStakedPerBlock: fun( + 'Returns the total amount of staked tokens per block when staked', + [crossAccountParam('staker')], + 'Vec<(u32, u128)>', + ), + totalStakingLocked: fun( + 'Return the total amount locked by staking tokens', + [crossAccountParam('staker')], + 'u128', + ), }, }; From 4d07c60d3d95f593acad6f54a9f5c08555046a1e Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 17 Aug 2022 14:02:51 +0700 Subject: [PATCH 0619/1274] add rpc methods + tests --- client/rpc/src/lib.rs | 9 + node/cli/src/service.rs | 2 +- pallets/app-promotion/src/lib.rs | 53 +- primitives/rpc/src/lib.rs | 1 + .../common/config/pallets/app_promotion.rs | 27 + runtime/common/config/pallets/mod.rs | 3 + runtime/common/construct_runtime/mod.rs | 3 + runtime/common/runtime_apis.rs | 6 +- runtime/opal/Cargo.toml | 3 +- tests/src/app-promotion.test.ts | 136 +- tests/src/interfaces/augment-api-rpc.ts | 4 + tests/src/interfaces/lookup.ts | 1437 ++--------------- tests/src/interfaces/types-lookup.ts | 478 ++---- tests/src/interfaces/unique/definitions.ts | 5 + tests/src/pallet-presence.test.ts | 3 +- tests/src/util/helpers.ts | 1 + tests/src/util/playgrounds/index.ts | 52 +- 17 files changed, 536 insertions(+), 1687 deletions(-) create mode 100644 runtime/common/config/pallets/app_promotion.rs diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index 6ff95e2e79..af69fd6b63 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -262,6 +262,14 @@ pub trait UniqueApi { #[method(name = "unique_totalStakingLocked")] fn total_staking_locked(&self, staker: CrossAccountId, at: Option) -> Result; + + /// Return the total amount locked by staking tokens. + #[method(name = "unique_pendingUnstake")] + fn pending_unstake( + &self, + staker: Option, + at: Option, + ) -> Result; } mod rmrk_unique_rpc { @@ -548,6 +556,7 @@ where .map(|(b, a)| (b, a.to_string())) .collect::>(), unique_api); pass_method!(total_staking_locked(staker: CrossAccountId) -> String => |v| v.to_string(), unique_api); + pass_method!(pending_unstake(staker: Option) -> String => |v| v.to_string(), unique_api); } #[allow(deprecated)] diff --git a/node/cli/src/service.rs b/node/cli/src/service.rs index 79e36f075a..b19145569b 100644 --- a/node/cli/src/service.rs +++ b/node/cli/src/service.rs @@ -63,7 +63,7 @@ use polkadot_service::CollatorPair; use fc_rpc_core::types::FilterPool; use fc_mapping_sync::{MappingSyncWorker, SyncStrategy}; -use unique_runtime_common::types::{ +use up_common::types::opaque::{ AuraId, RuntimeInstance, AccountId, Balance, Index, Hash, Block, BlockNumber, }; diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index dce11b5d7a..57d88dd7e5 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -31,12 +31,12 @@ #[cfg(feature = "runtime-benchmarks")] mod benchmarking; -pub mod types; - #[cfg(test)] mod tests; +pub mod types; +pub mod weights; -use sp_std::vec::Vec; +use sp_std::{vec::Vec, iter::Sum}; use codec::EncodeLike; use pallet_balances::BalanceLock; pub use types::ExtendedLockableCurrency; @@ -48,6 +48,9 @@ use frame_support::{ }, ensure, }; + +use weights::WeightInfo; + pub use pallet::*; use pallet_evm::account::CrossAccountId; use sp_runtime::{ @@ -79,6 +82,9 @@ pub mod pallet { type TreasuryAccountId: Get; + /// Weight information for extrinsics in this pallet. + type WeightInfo: WeightInfo; + // The block number provider type BlockNumberProvider: BlockNumberProvider; @@ -136,6 +142,7 @@ pub mod pallet { fn on_initialize(current_block: T::BlockNumber) -> Weight where ::BlockNumber: From, + // <::Currency as Currency>::Balance: Sum, { PendingUnstake::::iter() .filter_map(|((staker, block), amount)| { @@ -172,7 +179,7 @@ pub mod pallet { #[pallet::call] impl Pallet { - #[pallet::weight(0)] + #[pallet::weight(T::WeightInfo::set_admin_address())] pub fn set_admin_address(origin: OriginFor, admin: T::AccountId) -> DispatchResult { ensure_root(origin)?; >::set(Some(admin)); @@ -180,7 +187,7 @@ pub mod pallet { Ok(()) } - #[pallet::weight(0)] + #[pallet::weight(T::WeightInfo::start_app_promotion())] pub fn start_app_promotion( origin: OriginFor, promotion_start_relay_block: T::BlockNumber, @@ -201,7 +208,7 @@ pub mod pallet { Ok(()) } - #[pallet::weight(0)] + #[pallet::weight(T::WeightInfo::stake())] pub fn stake(staker: OriginFor, amount: BalanceOf) -> DispatchResult { let staker_id = ensure_signed(staker)?; @@ -210,10 +217,16 @@ pub mod pallet { ensure!(balance >= amount, ArithmeticError::Underflow); - Self::set_lock_unchecked(&staker_id, amount); + <::Currency as Currency>::ensure_can_withdraw( + &staker_id, + amount, + WithdrawReasons::all(), + balance - amount, + )?; + + Self::add_lock_balance(&staker_id, amount)?; - let block_number = - ::current_block_number(); + let block_number = frame_system::Pallet::::block_number(); >::insert( (&staker_id, block_number), @@ -231,7 +244,7 @@ pub mod pallet { Ok(()) } - #[pallet::weight(0)] + #[pallet::weight(T::WeightInfo::unstake())] pub fn unstake(staker: OriginFor, amount: BalanceOf) -> DispatchResult { let staker_id = ensure_signed(staker)?; @@ -249,7 +262,7 @@ pub mod pallet { .ok_or(ArithmeticError::Underflow)?, ); - let block = ::current_block_number() + WEEK.into(); + let block = frame_system::Pallet::::block_number() + WEEK.into(); >::insert( (&staker_id, block), >::get((&staker_id, block)) @@ -400,8 +413,8 @@ impl Pallet { fn add_lock_balance(staker: &T::AccountId, amount: BalanceOf) -> DispatchResult { Self::get_locked_balance(staker) - .map(|l| l.amount) - .and_then(|b| b.checked_add(&amount)) + .map_or(>::default(), |l| l.amount) + .checked_add(&amount) .map(|new_lock| Self::set_lock_unchecked(staker, new_lock)) .ok_or(ArithmeticError::Overflow.into()) } @@ -437,10 +450,11 @@ impl Pallet { pub fn total_staked_by_id_per_block( staker: impl EncodeLike, ) -> Option)>> { - let staked = Staked::::iter_prefix((staker,)) + let mut staked = Staked::::iter_prefix((staker,)) .into_iter() .map(|(block, amount)| (block, amount)) .collect::>(); + staked.sort_by_key(|(block, _)| *block); if !staked.is_empty() { Some(staked) } else { @@ -495,3 +509,14 @@ impl Pallet { day_rate * base } } + +impl Pallet +where + <::Currency as Currency>::Balance: Sum, +{ + pub fn cross_id_pending_unstake(staker: Option) -> BalanceOf { + staker.map_or(PendingUnstake::::iter_values().sum(), |s| { + PendingUnstake::::iter_prefix_values((s.as_sub(),)).sum() + }) + } +} diff --git a/primitives/rpc/src/lib.rs b/primitives/rpc/src/lib.rs index 89b0aac886..b4e0111225 100644 --- a/primitives/rpc/src/lib.rs +++ b/primitives/rpc/src/lib.rs @@ -129,5 +129,6 @@ sp_api::decl_runtime_apis! { fn total_staked(staker: Option) -> Result; fn total_staked_per_block(staker: CrossAccountId) -> Result>; fn total_staking_locked(staker: CrossAccountId) -> Result; + fn pending_unstake(staker: Option) -> Result; } } diff --git a/runtime/common/config/pallets/app_promotion.rs b/runtime/common/config/pallets/app_promotion.rs new file mode 100644 index 0000000000..08e289b506 --- /dev/null +++ b/runtime/common/config/pallets/app_promotion.rs @@ -0,0 +1,27 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use crate::{ + runtime_common::config::pallets::{TreasuryAccountId, RelayChainBlockNumberProvider}, + Runtime, Balances, +}; + +impl pallet_app_promotion::Config for Runtime { + type Currency = Balances; + type WeightInfo = pallet_app_promotion::weights::SubstrateWeight; + type TreasuryAccountId = TreasuryAccountId; + type BlockNumberProvider = RelayChainBlockNumberProvider; +} diff --git a/runtime/common/config/pallets/mod.rs b/runtime/common/config/pallets/mod.rs index d2d7a2f9e7..287b7786ba 100644 --- a/runtime/common/config/pallets/mod.rs +++ b/runtime/common/config/pallets/mod.rs @@ -40,6 +40,9 @@ pub mod rmrk; #[cfg(feature = "scheduler")] pub mod scheduler; +#[cfg(feature = "app-promotion")] +pub mod app_promotion; + parameter_types! { pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account_truncating(); pub const CollectionCreationPrice: Balance = 2 * UNIQUE; diff --git a/runtime/common/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs index 86dc0e24e1..091b342a04 100644 --- a/runtime/common/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -77,6 +77,9 @@ macro_rules! construct_runtime { #[runtimes(opal)] RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event} = 72, + #[runtimes(opal)] + Promotion: pallet_app_promotion::{Pallet, Call, Storage} = 73, + // Frontier EVM: pallet_evm::{Pallet, Config, Call, Storage, Event} = 100, Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101, diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index 267b1c6409..023617ec4b 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -190,7 +190,6 @@ macro_rules! impl_common_runtime_apis { fn total_staked(staker: Option) -> Result { Ok(>::cross_id_total_staked(staker).unwrap_or_default()) - // Ok(0) } fn total_staked_per_block(staker: CrossAccountId) -> Result, DispatchError> { @@ -198,9 +197,12 @@ macro_rules! impl_common_runtime_apis { } fn total_staking_locked(staker: CrossAccountId) -> Result { - // Ok(0) Ok(>::cross_id_locked_balance(staker)) } + + fn pending_unstake(staker: Option) -> Result { + Ok(>::cross_id_pending_unstake(staker)) + } } impl rmrk_rpc::RmrkApi< diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index f8a6705187..fd7163e2dd 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -124,11 +124,12 @@ std = [ "orml-vesting/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] -opal-runtime = ['refungible', 'scheduler', 'rmrk'] +opal-runtime = ['refungible', 'scheduler', 'rmrk', 'app-promotion'] refungible = [] scheduler = [] rmrk = [] +app-promotion = [] ################################################################################ # Substrate Dependencies diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 00d6b8665c..69d78a57b9 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {default as usingApi, submitTransactionAsync} from './substrate/substrate-api'; -import {IKeyringPair} from '@polkadot/types/types'; +import {IKeyringPair, ITuple} from '@polkadot/types/types'; import { createMultipleItemsExpectSuccess, @@ -33,26 +33,38 @@ import { U128_MAX, burnFromExpectSuccess, UNIQUE, + getModuleNames, + Pallets, + getBlockNumber, } from './util/helpers'; -import chai from 'chai'; +import chai, {use} from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import getBalance from './substrate/get-balance'; -import { unique } from './interfaces/definitions'; +import getBalance, {getBalanceSingle} from './substrate/get-balance'; +import {unique} from './interfaces/definitions'; +import {usingPlaygrounds} from './util/playgrounds'; +import {default as waitNewBlocks} from './substrate/wait-new-blocks'; + +import BN from 'bn.js'; +import {mnemonicGenerate} from '@polkadot/util-crypto'; +import {UniqueHelper} from './util/playgrounds/unique'; chai.use(chaiAsPromised); const expect = chai.expect; let alice: IKeyringPair; let bob: IKeyringPair; let palletAdmin: IKeyringPair; +let nominal: bigint; describe('integration test: AppPromotion', () => { - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { + before(async function() { + await usingPlaygrounds(async (helper, privateKeyWrapper) => { + if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); alice = privateKeyWrapper('//Alice'); bob = privateKeyWrapper('//Bob'); palletAdmin = privateKeyWrapper('//palletAdmin'); - const tx = api.tx.sudo.sudo(api.tx.promotion.setAdminAddress(palletAdmin.addressRaw)); + const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(palletAdmin.addressRaw)); + nominal = helper.balance.getOneTokenNominal(); await submitTransactionAsync(alice, tx); }); }); @@ -69,22 +81,110 @@ describe('integration test: AppPromotion', () => { // assert: query appPromotion.staked(Alice) equal [100, 200] // assert: query appPromotion.totalStaked() increased by 200 - await usingApi(async (api, privateKeyWrapper) => { - await submitTransactionAsync(alice, api.tx.balances.transfer(bob.addressRaw, 10n * UNIQUE)); - const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alice.address, bob.address]); + await usingPlaygrounds(async (helper, privateKeyWrapper) => { + const totalStakedBefore = (await helper.api!.rpc.unique.totalStaked()).toBigInt(); + const staker = await createUser(); + + const firstStakedBlock = await helper.chain.getLatestBlockNumber(); + + await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(1n * nominal))).to.be.eventually.fulfilled; + expect((await helper.api!.rpc.unique.totalStakingLocked(normalizeAccountId(staker))).toBigInt()).to.be.equal(nominal); + expect(9n * nominal - await helper.balance.getSubstrate(staker.address) <= nominal / 2n).to.be.true; + expect((await helper.api!.rpc.unique.totalStaked(normalizeAccountId(staker))).toBigInt()).to.be.equal(nominal); + expect((await helper.api!.rpc.unique.totalStaked()).toBigInt()).to.be.equal(totalStakedBefore + nominal); - console.log(`alice: ${alicesBalanceBefore} \n bob: ${bobsBalanceBefore}`); + await waitNewBlocks(helper.api!, 1); + const secondStakedBlock = await helper.chain.getLatestBlockNumber(); - await submitTransactionAsync(alice, api.tx.promotion.stake(1n * UNIQUE)); - await submitTransactionAsync(bob, api.tx.promotion.stake(1n * UNIQUE)); - const alice_total_staked = (await (api.rpc.unique.totalStaked(normalizeAccountId(alice)))).toBigInt(); - const bob_total_staked = (await api.rpc.unique.totalStaked(normalizeAccountId(bob))).toBigInt(); - - console.log(`alice staked: ${alice_total_staked} \n bob staked: ${bob_total_staked}, total staked: ${(await api.rpc.unique.totalStaked()).toBigInt()}`); + await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(2n * nominal))).to.be.eventually.fulfilled; + expect((await helper.api!.rpc.unique.totalStakingLocked(normalizeAccountId(staker))).toBigInt()).to.be.equal(3n * nominal); + const stakedPerBlock = (await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([block, amount]) => [block.toBigInt(), amount.toBigInt()]); + expect(stakedPerBlock.map((x) => x[1])).to.be.deep.equal([nominal, 2n * nominal]); + }); + }); + + it('will throws if stake amount is more than total free balance', async () => { + // arrange: Alice balance = 1000 + // assert: Alice calls appPromotion.stake(1000) throws /// because Alice needs some fee + + // act: Alice calls appPromotion.stake(700) + // assert: Alice calls appPromotion.stake(400) throws /// because Alice has ~300 free QTZ and 700 locked + + await usingPlaygrounds(async helper => { + const staker = await createUser(); + + await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.rejected; + await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(7n * nominal))).to.be.eventually.fulfilled; + await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(4n * nominal))).to.be.eventually.rejected; }); }); + + it.skip('for different accounts in one block is possible', async () => { + // arrange: Alice, Bob, Charlie, Dave balance = 1000 + // arrange: Alice, Bob, Charlie, Dave calls appPromotion.stake(100) in the same time + + // assert: query appPromotion.staked(Alice/Bob/Charlie/Dave) equal [100] + await usingPlaygrounds(async helper => { + const crowd = await creteAccounts([10n, 10n, 10n, 10n], alice, helper); + // const promises = crowd.map(async user => submitTransactionAsync(user, helper.api!.tx.promotion.stake(nominal))); + // await expect(Promise.all(promises)).to.be.eventually.fulfilled; + }); + }); + +}); + +describe.skip('unstake balance extrinsic', () => { + before(async function() { + await usingPlaygrounds(async (helper, privateKeyWrapper) => { + if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); + alice = privateKeyWrapper('//Alice'); + bob = privateKeyWrapper('//Bob'); + palletAdmin = privateKeyWrapper('//palletAdmin'); + const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(palletAdmin.addressRaw)); + nominal = helper.balance.getOneTokenNominal(); + await submitTransactionAsync(alice, tx); + }); + }); + it('will change balance state to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => { + // arrange: Alice balance = 1000 + // arrange: Alice calls appPromotion.stake(Alice, 500) + + // act: Alice calls appPromotion.unstake(300) + // assert: Alice reserved balance to equal 300 + // assert: query appPromotion.staked(Alice) equal [200] /// 500 - 300 + // assert: query appPromotion.pendingUnstake(Alice) to equal [300] + // assert: query appPromotion.totalStaked() decreased by 300 + }); +}); + + + +async function createUser(amount?: bigint) { + return await usingPlaygrounds(async (helper, privateKeyWrapper) => { + const user: IKeyringPair = privateKeyWrapper(`//Alice+${(new Date()).getTime()}`); + await helper.balance.transferToSubstrate(alice, user.address, amount ? amount : 10n * helper.balance.getOneTokenNominal()); + return user; + }); +} + +const creteAccounts = async (balances: bigint[], donor: IKeyringPair, helper: UniqueHelper) => { + let nonce = await helper.chain.getNonce(donor.address); + const tokenNominal = helper.balance.getOneTokenNominal(); + const transactions = []; + const accounts = []; + for (const balance of balances) { + const recepient = helper.util.fromSeed(mnemonicGenerate()); + accounts.push(recepient); + if (balance !== 0n){ + const tx = helper.constructApiCall('api.tx.balances.transfer', [{Id: recepient.address}, balance * tokenNominal]); + transactions.push(helper.signTransaction(donor, tx, 'account generation', {nonce})); + nonce++; + } + } -}); \ No newline at end of file + await Promise.all(transactions); + return accounts; +}; \ No newline at end of file diff --git a/tests/src/interfaces/augment-api-rpc.ts b/tests/src/interfaces/augment-api-rpc.ts index d89d2b1ff2..539c5fa16c 100644 --- a/tests/src/interfaces/augment-api-rpc.ts +++ b/tests/src/interfaces/augment-api-rpc.ts @@ -702,6 +702,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { * Get the number of blocks until sponsoring a transaction is available **/ nextSponsored: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; + /** + * Returns the total amount of unstaked tokens + **/ + pendingUnstake: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; /** * Get property permissions, optionally limited to the provided keys **/ diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index df1e5567a7..943a6ff6c5 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -5,1265 +5,7 @@ export default { /** - * Lookup3: frame_system::AccountInfo> - **/ - FrameSystemAccountInfo: { - nonce: 'u32', - consumers: 'u32', - providers: 'u32', - sufficients: 'u32', - data: 'PalletBalancesAccountData' - }, - /** - * Lookup5: pallet_balances::AccountData - **/ - PalletBalancesAccountData: { - free: 'u128', - reserved: 'u128', - miscFrozen: 'u128', - feeFrozen: 'u128' - }, - /** - * Lookup7: frame_support::weights::PerDispatchClass - **/ - FrameSupportWeightsPerDispatchClassU64: { - normal: 'u64', - operational: 'u64', - mandatory: 'u64' - }, - /** - * Lookup11: sp_runtime::generic::digest::Digest - **/ - SpRuntimeDigest: { - logs: 'Vec' - }, - /** - * Lookup13: sp_runtime::generic::digest::DigestItem - **/ - SpRuntimeDigestDigestItem: { - _enum: { - Other: 'Bytes', - __Unused1: 'Null', - __Unused2: 'Null', - __Unused3: 'Null', - Consensus: '([u8;4],Bytes)', - Seal: '([u8;4],Bytes)', - PreRuntime: '([u8;4],Bytes)', - __Unused7: 'Null', - RuntimeEnvironmentUpdated: 'Null' - } - }, - /** - * Lookup16: frame_system::EventRecord - **/ - FrameSystemEventRecord: { - phase: 'FrameSystemPhase', - event: 'Event', - topics: 'Vec' - }, - /** - * Lookup18: frame_system::pallet::Event - **/ - FrameSystemEvent: { - _enum: { - ExtrinsicSuccess: { - dispatchInfo: 'FrameSupportWeightsDispatchInfo', - }, - ExtrinsicFailed: { - dispatchError: 'SpRuntimeDispatchError', - dispatchInfo: 'FrameSupportWeightsDispatchInfo', - }, - CodeUpdated: 'Null', - NewAccount: { - account: 'AccountId32', - }, - KilledAccount: { - account: 'AccountId32', - }, - Remarked: { - _alias: { - hash_: 'hash', - }, - sender: 'AccountId32', - hash_: 'H256' - } - } - }, - /** - * Lookup19: frame_support::weights::DispatchInfo - **/ - FrameSupportWeightsDispatchInfo: { - weight: 'u64', - class: 'FrameSupportWeightsDispatchClass', - paysFee: 'FrameSupportWeightsPays' - }, - /** - * Lookup20: frame_support::weights::DispatchClass - **/ - FrameSupportWeightsDispatchClass: { - _enum: ['Normal', 'Operational', 'Mandatory'] - }, - /** - * Lookup21: frame_support::weights::Pays - **/ - FrameSupportWeightsPays: { - _enum: ['Yes', 'No'] - }, - /** - * Lookup22: sp_runtime::DispatchError - **/ - SpRuntimeDispatchError: { - _enum: { - Other: 'Null', - CannotLookup: 'Null', - BadOrigin: 'Null', - Module: 'SpRuntimeModuleError', - ConsumerRemaining: 'Null', - NoProviders: 'Null', - TooManyConsumers: 'Null', - Token: 'SpRuntimeTokenError', - Arithmetic: 'SpRuntimeArithmeticError', - Transactional: 'SpRuntimeTransactionalError' - } - }, - /** - * Lookup23: sp_runtime::ModuleError - **/ - SpRuntimeModuleError: { - index: 'u8', - error: '[u8;4]' - }, - /** - * Lookup24: sp_runtime::TokenError - **/ - SpRuntimeTokenError: { - _enum: ['NoFunds', 'WouldDie', 'BelowMinimum', 'CannotCreate', 'UnknownAsset', 'Frozen', 'Unsupported'] - }, - /** - * Lookup25: sp_runtime::ArithmeticError - **/ - SpRuntimeArithmeticError: { - _enum: ['Underflow', 'Overflow', 'DivisionByZero'] - }, - /** - * Lookup26: sp_runtime::TransactionalError - **/ - SpRuntimeTransactionalError: { - _enum: ['LimitReached', 'NoLayer'] - }, - /** - * Lookup27: cumulus_pallet_parachain_system::pallet::Event - **/ - CumulusPalletParachainSystemEvent: { - _enum: { - ValidationFunctionStored: 'Null', - ValidationFunctionApplied: { - relayChainBlockNum: 'u32', - }, - ValidationFunctionDiscarded: 'Null', - UpgradeAuthorized: { - codeHash: 'H256', - }, - DownwardMessagesReceived: { - count: 'u32', - }, - DownwardMessagesProcessed: { - weightUsed: 'u64', - dmqHead: 'H256' - } - } - }, - /** - * Lookup28: pallet_balances::pallet::Event - **/ - PalletBalancesEvent: { - _enum: { - Endowed: { - account: 'AccountId32', - freeBalance: 'u128', - }, - DustLost: { - account: 'AccountId32', - amount: 'u128', - }, - Transfer: { - from: 'AccountId32', - to: 'AccountId32', - amount: 'u128', - }, - BalanceSet: { - who: 'AccountId32', - free: 'u128', - reserved: 'u128', - }, - Reserved: { - who: 'AccountId32', - amount: 'u128', - }, - Unreserved: { - who: 'AccountId32', - amount: 'u128', - }, - ReserveRepatriated: { - from: 'AccountId32', - to: 'AccountId32', - amount: 'u128', - destinationStatus: 'FrameSupportTokensMiscBalanceStatus', - }, - Deposit: { - who: 'AccountId32', - amount: 'u128', - }, - Withdraw: { - who: 'AccountId32', - amount: 'u128', - }, - Slashed: { - who: 'AccountId32', - amount: 'u128' - } - } - }, - /** - * Lookup29: frame_support::traits::tokens::misc::BalanceStatus - **/ - FrameSupportTokensMiscBalanceStatus: { - _enum: ['Free', 'Reserved'] - }, - /** - * Lookup30: pallet_transaction_payment::pallet::Event - **/ - PalletTransactionPaymentEvent: { - _enum: { - TransactionFeePaid: { - who: 'AccountId32', - actualFee: 'u128', - tip: 'u128' - } - } - }, - /** - * Lookup31: pallet_treasury::pallet::Event - **/ - PalletTreasuryEvent: { - _enum: { - Proposed: { - proposalIndex: 'u32', - }, - Spending: { - budgetRemaining: 'u128', - }, - Awarded: { - proposalIndex: 'u32', - award: 'u128', - account: 'AccountId32', - }, - Rejected: { - proposalIndex: 'u32', - slashed: 'u128', - }, - Burnt: { - burntFunds: 'u128', - }, - Rollover: { - rolloverBalance: 'u128', - }, - Deposit: { - value: 'u128', - }, - SpendApproved: { - proposalIndex: 'u32', - amount: 'u128', - beneficiary: 'AccountId32' - } - } - }, - /** - * Lookup32: pallet_sudo::pallet::Event - **/ - PalletSudoEvent: { - _enum: { - Sudid: { - sudoResult: 'Result', - }, - KeyChanged: { - oldSudoer: 'Option', - }, - SudoAsDone: { - sudoResult: 'Result' - } - } - }, - /** - * Lookup36: orml_vesting::module::Event - **/ - OrmlVestingModuleEvent: { - _enum: { - VestingScheduleAdded: { - from: 'AccountId32', - to: 'AccountId32', - vestingSchedule: 'OrmlVestingVestingSchedule', - }, - Claimed: { - who: 'AccountId32', - amount: 'u128', - }, - VestingSchedulesUpdated: { - who: 'AccountId32' - } - } - }, - /** - * Lookup37: orml_vesting::VestingSchedule - **/ - OrmlVestingVestingSchedule: { - start: 'u32', - period: 'u32', - periodCount: 'u32', - perPeriod: 'Compact' - }, - /** - * Lookup39: cumulus_pallet_xcmp_queue::pallet::Event - **/ - CumulusPalletXcmpQueueEvent: { - _enum: { - Success: { - messageHash: 'Option', - weight: 'u64', - }, - Fail: { - messageHash: 'Option', - error: 'XcmV2TraitsError', - weight: 'u64', - }, - BadVersion: { - messageHash: 'Option', - }, - BadFormat: { - messageHash: 'Option', - }, - UpwardMessageSent: { - messageHash: 'Option', - }, - XcmpMessageSent: { - messageHash: 'Option', - }, - OverweightEnqueued: { - sender: 'u32', - sentAt: 'u32', - index: 'u64', - required: 'u64', - }, - OverweightServiced: { - index: 'u64', - used: 'u64' - } - } - }, - /** - * Lookup41: xcm::v2::traits::Error - **/ - XcmV2TraitsError: { - _enum: { - Overflow: 'Null', - Unimplemented: 'Null', - UntrustedReserveLocation: 'Null', - UntrustedTeleportLocation: 'Null', - MultiLocationFull: 'Null', - MultiLocationNotInvertible: 'Null', - BadOrigin: 'Null', - InvalidLocation: 'Null', - AssetNotFound: 'Null', - FailedToTransactAsset: 'Null', - NotWithdrawable: 'Null', - LocationCannotHold: 'Null', - ExceedsMaxMessageSize: 'Null', - DestinationUnsupported: 'Null', - Transport: 'Null', - Unroutable: 'Null', - UnknownClaim: 'Null', - FailedToDecode: 'Null', - MaxWeightInvalid: 'Null', - NotHoldingFees: 'Null', - TooExpensive: 'Null', - Trap: 'u64', - UnhandledXcmVersion: 'Null', - WeightLimitReached: 'u64', - Barrier: 'Null', - WeightNotComputable: 'Null' - } - }, - /** - * Lookup43: pallet_xcm::pallet::Event - **/ - PalletXcmEvent: { - _enum: { - Attempted: 'XcmV2TraitsOutcome', - Sent: '(XcmV1MultiLocation,XcmV1MultiLocation,XcmV2Xcm)', - UnexpectedResponse: '(XcmV1MultiLocation,u64)', - ResponseReady: '(u64,XcmV2Response)', - Notified: '(u64,u8,u8)', - NotifyOverweight: '(u64,u8,u8,u64,u64)', - NotifyDispatchError: '(u64,u8,u8)', - NotifyDecodeFailed: '(u64,u8,u8)', - InvalidResponder: '(XcmV1MultiLocation,u64,Option)', - InvalidResponderVersion: '(XcmV1MultiLocation,u64)', - ResponseTaken: 'u64', - AssetsTrapped: '(H256,XcmV1MultiLocation,XcmVersionedMultiAssets)', - VersionChangeNotified: '(XcmV1MultiLocation,u32)', - SupportedVersionChanged: '(XcmV1MultiLocation,u32)', - NotifyTargetSendFail: '(XcmV1MultiLocation,u64,XcmV2TraitsError)', - NotifyTargetMigrationFail: '(XcmVersionedMultiLocation,u64)' - } - }, - /** - * Lookup44: xcm::v2::traits::Outcome - **/ - XcmV2TraitsOutcome: { - _enum: { - Complete: 'u64', - Incomplete: '(u64,XcmV2TraitsError)', - Error: 'XcmV2TraitsError' - } - }, - /** - * Lookup45: xcm::v1::multilocation::MultiLocation - **/ - XcmV1MultiLocation: { - parents: 'u8', - interior: 'XcmV1MultilocationJunctions' - }, - /** - * Lookup46: xcm::v1::multilocation::Junctions - **/ - XcmV1MultilocationJunctions: { - _enum: { - Here: 'Null', - X1: 'XcmV1Junction', - X2: '(XcmV1Junction,XcmV1Junction)', - X3: '(XcmV1Junction,XcmV1Junction,XcmV1Junction)', - X4: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', - X5: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', - X6: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', - X7: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', - X8: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)' - } - }, - /** - * Lookup47: xcm::v1::junction::Junction - **/ - XcmV1Junction: { - _enum: { - Parachain: 'Compact', - AccountId32: { - network: 'XcmV0JunctionNetworkId', - id: '[u8;32]', - }, - AccountIndex64: { - network: 'XcmV0JunctionNetworkId', - index: 'Compact', - }, - AccountKey20: { - network: 'XcmV0JunctionNetworkId', - key: '[u8;20]', - }, - PalletInstance: 'u8', - GeneralIndex: 'Compact', - GeneralKey: 'Bytes', - OnlyChild: 'Null', - Plurality: { - id: 'XcmV0JunctionBodyId', - part: 'XcmV0JunctionBodyPart' - } - } - }, - /** - * Lookup49: xcm::v0::junction::NetworkId - **/ - XcmV0JunctionNetworkId: { - _enum: { - Any: 'Null', - Named: 'Bytes', - Polkadot: 'Null', - Kusama: 'Null' - } - }, - /** - * Lookup53: xcm::v0::junction::BodyId - **/ - XcmV0JunctionBodyId: { - _enum: { - Unit: 'Null', - Named: 'Bytes', - Index: 'Compact', - Executive: 'Null', - Technical: 'Null', - Legislative: 'Null', - Judicial: 'Null' - } - }, - /** - * Lookup54: xcm::v0::junction::BodyPart - **/ - XcmV0JunctionBodyPart: { - _enum: { - Voice: 'Null', - Members: { - count: 'Compact', - }, - Fraction: { - nom: 'Compact', - denom: 'Compact', - }, - AtLeastProportion: { - nom: 'Compact', - denom: 'Compact', - }, - MoreThanProportion: { - nom: 'Compact', - denom: 'Compact' - } - } - }, - /** - * Lookup55: xcm::v2::Xcm - **/ - XcmV2Xcm: 'Vec', - /** - * Lookup57: xcm::v2::Instruction - **/ - XcmV2Instruction: { - _enum: { - WithdrawAsset: 'XcmV1MultiassetMultiAssets', - ReserveAssetDeposited: 'XcmV1MultiassetMultiAssets', - ReceiveTeleportedAsset: 'XcmV1MultiassetMultiAssets', - QueryResponse: { - queryId: 'Compact', - response: 'XcmV2Response', - maxWeight: 'Compact', - }, - TransferAsset: { - assets: 'XcmV1MultiassetMultiAssets', - beneficiary: 'XcmV1MultiLocation', - }, - TransferReserveAsset: { - assets: 'XcmV1MultiassetMultiAssets', - dest: 'XcmV1MultiLocation', - xcm: 'XcmV2Xcm', - }, - Transact: { - originType: 'XcmV0OriginKind', - requireWeightAtMost: 'Compact', - call: 'XcmDoubleEncoded', - }, - HrmpNewChannelOpenRequest: { - sender: 'Compact', - maxMessageSize: 'Compact', - maxCapacity: 'Compact', - }, - HrmpChannelAccepted: { - recipient: 'Compact', - }, - HrmpChannelClosing: { - initiator: 'Compact', - sender: 'Compact', - recipient: 'Compact', - }, - ClearOrigin: 'Null', - DescendOrigin: 'XcmV1MultilocationJunctions', - ReportError: { - queryId: 'Compact', - dest: 'XcmV1MultiLocation', - maxResponseWeight: 'Compact', - }, - DepositAsset: { - assets: 'XcmV1MultiassetMultiAssetFilter', - maxAssets: 'Compact', - beneficiary: 'XcmV1MultiLocation', - }, - DepositReserveAsset: { - assets: 'XcmV1MultiassetMultiAssetFilter', - maxAssets: 'Compact', - dest: 'XcmV1MultiLocation', - xcm: 'XcmV2Xcm', - }, - ExchangeAsset: { - give: 'XcmV1MultiassetMultiAssetFilter', - receive: 'XcmV1MultiassetMultiAssets', - }, - InitiateReserveWithdraw: { - assets: 'XcmV1MultiassetMultiAssetFilter', - reserve: 'XcmV1MultiLocation', - xcm: 'XcmV2Xcm', - }, - InitiateTeleport: { - assets: 'XcmV1MultiassetMultiAssetFilter', - dest: 'XcmV1MultiLocation', - xcm: 'XcmV2Xcm', - }, - QueryHolding: { - queryId: 'Compact', - dest: 'XcmV1MultiLocation', - assets: 'XcmV1MultiassetMultiAssetFilter', - maxResponseWeight: 'Compact', - }, - BuyExecution: { - fees: 'XcmV1MultiAsset', - weightLimit: 'XcmV2WeightLimit', - }, - RefundSurplus: 'Null', - SetErrorHandler: 'XcmV2Xcm', - SetAppendix: 'XcmV2Xcm', - ClearError: 'Null', - ClaimAsset: { - assets: 'XcmV1MultiassetMultiAssets', - ticket: 'XcmV1MultiLocation', - }, - Trap: 'Compact', - SubscribeVersion: { - queryId: 'Compact', - maxResponseWeight: 'Compact', - }, - UnsubscribeVersion: 'Null' - } - }, - /** - * Lookup58: xcm::v1::multiasset::MultiAssets - **/ - XcmV1MultiassetMultiAssets: 'Vec', - /** - * Lookup60: xcm::v1::multiasset::MultiAsset - **/ - XcmV1MultiAsset: { - id: 'XcmV1MultiassetAssetId', - fun: 'XcmV1MultiassetFungibility' - }, - /** - * Lookup61: xcm::v1::multiasset::AssetId - **/ - XcmV1MultiassetAssetId: { - _enum: { - Concrete: 'XcmV1MultiLocation', - Abstract: 'Bytes' - } - }, - /** - * Lookup62: xcm::v1::multiasset::Fungibility - **/ - XcmV1MultiassetFungibility: { - _enum: { - Fungible: 'Compact', - NonFungible: 'XcmV1MultiassetAssetInstance' - } - }, - /** - * Lookup63: xcm::v1::multiasset::AssetInstance - **/ - XcmV1MultiassetAssetInstance: { - _enum: { - Undefined: 'Null', - Index: 'Compact', - Array4: '[u8;4]', - Array8: '[u8;8]', - Array16: '[u8;16]', - Array32: '[u8;32]', - Blob: 'Bytes' - } - }, - /** - * Lookup66: xcm::v2::Response - **/ - XcmV2Response: { - _enum: { - Null: 'Null', - Assets: 'XcmV1MultiassetMultiAssets', - ExecutionResult: 'Option<(u32,XcmV2TraitsError)>', - Version: 'u32' - } - }, - /** - * Lookup69: xcm::v0::OriginKind - **/ - XcmV0OriginKind: { - _enum: ['Native', 'SovereignAccount', 'Superuser', 'Xcm'] - }, - /** - * Lookup70: xcm::double_encoded::DoubleEncoded - **/ - XcmDoubleEncoded: { - encoded: 'Bytes' - }, - /** - * Lookup71: xcm::v1::multiasset::MultiAssetFilter - **/ - XcmV1MultiassetMultiAssetFilter: { - _enum: { - Definite: 'XcmV1MultiassetMultiAssets', - Wild: 'XcmV1MultiassetWildMultiAsset' - } - }, - /** - * Lookup72: xcm::v1::multiasset::WildMultiAsset - **/ - XcmV1MultiassetWildMultiAsset: { - _enum: { - All: 'Null', - AllOf: { - id: 'XcmV1MultiassetAssetId', - fun: 'XcmV1MultiassetWildFungibility' - } - } - }, - /** - * Lookup73: xcm::v1::multiasset::WildFungibility - **/ - XcmV1MultiassetWildFungibility: { - _enum: ['Fungible', 'NonFungible'] - }, - /** - * Lookup74: xcm::v2::WeightLimit - **/ - XcmV2WeightLimit: { - _enum: { - Unlimited: 'Null', - Limited: 'Compact' - } - }, - /** - * Lookup76: xcm::VersionedMultiAssets - **/ - XcmVersionedMultiAssets: { - _enum: { - V0: 'Vec', - V1: 'XcmV1MultiassetMultiAssets' - } - }, - /** - * Lookup78: xcm::v0::multi_asset::MultiAsset - **/ - XcmV0MultiAsset: { - _enum: { - None: 'Null', - All: 'Null', - AllFungible: 'Null', - AllNonFungible: 'Null', - AllAbstractFungible: { - id: 'Bytes', - }, - AllAbstractNonFungible: { - class: 'Bytes', - }, - AllConcreteFungible: { - id: 'XcmV0MultiLocation', - }, - AllConcreteNonFungible: { - class: 'XcmV0MultiLocation', - }, - AbstractFungible: { - id: 'Bytes', - amount: 'Compact', - }, - AbstractNonFungible: { - class: 'Bytes', - instance: 'XcmV1MultiassetAssetInstance', - }, - ConcreteFungible: { - id: 'XcmV0MultiLocation', - amount: 'Compact', - }, - ConcreteNonFungible: { - class: 'XcmV0MultiLocation', - instance: 'XcmV1MultiassetAssetInstance' - } - } - }, - /** - * Lookup79: xcm::v0::multi_location::MultiLocation - **/ - XcmV0MultiLocation: { - _enum: { - Null: 'Null', - X1: 'XcmV0Junction', - X2: '(XcmV0Junction,XcmV0Junction)', - X3: '(XcmV0Junction,XcmV0Junction,XcmV0Junction)', - X4: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', - X5: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', - X6: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', - X7: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', - X8: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)' - } - }, - /** - * Lookup80: xcm::v0::junction::Junction - **/ - XcmV0Junction: { - _enum: { - Parent: 'Null', - Parachain: 'Compact', - AccountId32: { - network: 'XcmV0JunctionNetworkId', - id: '[u8;32]', - }, - AccountIndex64: { - network: 'XcmV0JunctionNetworkId', - index: 'Compact', - }, - AccountKey20: { - network: 'XcmV0JunctionNetworkId', - key: '[u8;20]', - }, - PalletInstance: 'u8', - GeneralIndex: 'Compact', - GeneralKey: 'Bytes', - OnlyChild: 'Null', - Plurality: { - id: 'XcmV0JunctionBodyId', - part: 'XcmV0JunctionBodyPart' - } - } - }, - /** - * Lookup81: xcm::VersionedMultiLocation - **/ - XcmVersionedMultiLocation: { - _enum: { - V0: 'XcmV0MultiLocation', - V1: 'XcmV1MultiLocation' - } - }, - /** - * Lookup82: cumulus_pallet_xcm::pallet::Event - **/ - CumulusPalletXcmEvent: { - _enum: { - InvalidFormat: '[u8;8]', - UnsupportedVersion: '[u8;8]', - ExecutedDownward: '([u8;8],XcmV2TraitsOutcome)' - } - }, - /** - * Lookup83: cumulus_pallet_dmp_queue::pallet::Event - **/ - CumulusPalletDmpQueueEvent: { - _enum: { - InvalidFormat: { - messageId: '[u8;32]', - }, - UnsupportedVersion: { - messageId: '[u8;32]', - }, - ExecutedDownward: { - messageId: '[u8;32]', - outcome: 'XcmV2TraitsOutcome', - }, - WeightExhausted: { - messageId: '[u8;32]', - remainingWeight: 'u64', - requiredWeight: 'u64', - }, - OverweightEnqueued: { - messageId: '[u8;32]', - overweightIndex: 'u64', - requiredWeight: 'u64', - }, - OverweightServiced: { - overweightIndex: 'u64', - weightUsed: 'u64' - } - } - }, - /** - * Lookup84: pallet_unique::RawEvent> - **/ - PalletUniqueRawEvent: { - _enum: { - CollectionSponsorRemoved: 'u32', - CollectionAdminAdded: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', - CollectionOwnedChanged: '(u32,AccountId32)', - CollectionSponsorSet: '(u32,AccountId32)', - SponsorshipConfirmed: '(u32,AccountId32)', - CollectionAdminRemoved: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', - AllowListAddressRemoved: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', - AllowListAddressAdded: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', - CollectionLimitSet: 'u32', - CollectionPermissionSet: 'u32' - } - }, - /** - * Lookup85: pallet_evm::account::BasicCrossAccountIdRepr - **/ - PalletEvmAccountBasicCrossAccountIdRepr: { - _enum: { - Substrate: 'AccountId32', - Ethereum: 'H160' - } - }, - /** - * Lookup88: pallet_unique_scheduler::pallet::Event - **/ - PalletUniqueSchedulerEvent: { - _enum: { - Scheduled: { - when: 'u32', - index: 'u32', - }, - Canceled: { - when: 'u32', - index: 'u32', - }, - Dispatched: { - task: '(u32,u32)', - id: 'Option<[u8;16]>', - result: 'Result', - }, - CallLookupFailed: { - task: '(u32,u32)', - id: 'Option<[u8;16]>', - error: 'FrameSupportScheduleLookupError' - } - } - }, - /** - * Lookup91: frame_support::traits::schedule::LookupError - **/ - FrameSupportScheduleLookupError: { - _enum: ['Unknown', 'BadFormat'] - }, - /** - * Lookup92: pallet_common::pallet::Event - **/ - PalletCommonEvent: { - _enum: { - CollectionCreated: '(u32,u8,AccountId32)', - CollectionDestroyed: 'u32', - ItemCreated: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,u128)', - ItemDestroyed: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,u128)', - Transfer: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,PalletEvmAccountBasicCrossAccountIdRepr,u128)', - Approved: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,PalletEvmAccountBasicCrossAccountIdRepr,u128)', - CollectionPropertySet: '(u32,Bytes)', - CollectionPropertyDeleted: '(u32,Bytes)', - TokenPropertySet: '(u32,u32,Bytes)', - TokenPropertyDeleted: '(u32,u32,Bytes)', - PropertyPermissionSet: '(u32,Bytes)' - } - }, - /** - * Lookup95: pallet_structure::pallet::Event - **/ - PalletStructureEvent: { - _enum: { - Executed: 'Result' - } - }, - /** - * Lookup96: pallet_rmrk_core::pallet::Event - **/ - PalletRmrkCoreEvent: { - _enum: { - CollectionCreated: { - issuer: 'AccountId32', - collectionId: 'u32', - }, - CollectionDestroyed: { - issuer: 'AccountId32', - collectionId: 'u32', - }, - IssuerChanged: { - oldIssuer: 'AccountId32', - newIssuer: 'AccountId32', - collectionId: 'u32', - }, - CollectionLocked: { - issuer: 'AccountId32', - collectionId: 'u32', - }, - NftMinted: { - owner: 'AccountId32', - collectionId: 'u32', - nftId: 'u32', - }, - NFTBurned: { - owner: 'AccountId32', - nftId: 'u32', - }, - NFTSent: { - sender: 'AccountId32', - recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', - collectionId: 'u32', - nftId: 'u32', - approvalRequired: 'bool', - }, - NFTAccepted: { - sender: 'AccountId32', - recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', - collectionId: 'u32', - nftId: 'u32', - }, - NFTRejected: { - sender: 'AccountId32', - collectionId: 'u32', - nftId: 'u32', - }, - PropertySet: { - collectionId: 'u32', - maybeNftId: 'Option', - key: 'Bytes', - value: 'Bytes', - }, - ResourceAdded: { - nftId: 'u32', - resourceId: 'u32', - }, - ResourceRemoval: { - nftId: 'u32', - resourceId: 'u32', - }, - ResourceAccepted: { - nftId: 'u32', - resourceId: 'u32', - }, - ResourceRemovalAccepted: { - nftId: 'u32', - resourceId: 'u32', - }, - PrioritySet: { - collectionId: 'u32', - nftId: 'u32' - } - } - }, - /** - * Lookup97: rmrk_traits::nft::AccountIdOrCollectionNftTuple - **/ - RmrkTraitsNftAccountIdOrCollectionNftTuple: { - _enum: { - AccountId: 'AccountId32', - CollectionAndNftTuple: '(u32,u32)' - } - }, - /** - * Lookup102: pallet_rmrk_equip::pallet::Event - **/ - PalletRmrkEquipEvent: { - _enum: { - BaseCreated: { - issuer: 'AccountId32', - baseId: 'u32', - }, - EquippablesUpdated: { - baseId: 'u32', - slotId: 'u32' - } - } - }, - /** - * Lookup103: pallet_evm::pallet::Event - **/ - PalletEvmEvent: { - _enum: { - Log: 'EthereumLog', - Created: 'H160', - CreatedFailed: 'H160', - Executed: 'H160', - ExecutedFailed: 'H160', - BalanceDeposit: '(AccountId32,H160,U256)', - BalanceWithdraw: '(AccountId32,H160,U256)' - } - }, - /** - * Lookup104: ethereum::log::Log - **/ - EthereumLog: { - address: 'H160', - topics: 'Vec', - data: 'Bytes' - }, - /** - * Lookup108: pallet_ethereum::pallet::Event - **/ - PalletEthereumEvent: { - _enum: { - Executed: '(H160,H160,H256,EvmCoreErrorExitReason)' - } - }, - /** - * Lookup109: evm_core::error::ExitReason - **/ - EvmCoreErrorExitReason: { - _enum: { - Succeed: 'EvmCoreErrorExitSucceed', - Error: 'EvmCoreErrorExitError', - Revert: 'EvmCoreErrorExitRevert', - Fatal: 'EvmCoreErrorExitFatal' - } - }, - /** - * Lookup110: evm_core::error::ExitSucceed - **/ - EvmCoreErrorExitSucceed: { - _enum: ['Stopped', 'Returned', 'Suicided'] - }, - /** - * Lookup111: evm_core::error::ExitError - **/ - EvmCoreErrorExitError: { - _enum: { - StackUnderflow: 'Null', - StackOverflow: 'Null', - InvalidJump: 'Null', - InvalidRange: 'Null', - DesignatedInvalid: 'Null', - CallTooDeep: 'Null', - CreateCollision: 'Null', - CreateContractLimit: 'Null', - OutOfOffset: 'Null', - OutOfGas: 'Null', - OutOfFund: 'Null', - PCUnderflow: 'Null', - CreateEmpty: 'Null', - Other: 'Text', - InvalidCode: 'Null' - } - }, - /** - * Lookup114: evm_core::error::ExitRevert - **/ - EvmCoreErrorExitRevert: { - _enum: ['Reverted'] - }, - /** - * Lookup115: evm_core::error::ExitFatal - **/ - EvmCoreErrorExitFatal: { - _enum: { - NotSupported: 'Null', - UnhandledInterrupt: 'Null', - CallErrorAsFatal: 'EvmCoreErrorExitError', - Other: 'Text' - } - }, - /** - * Lookup116: frame_system::Phase - **/ - FrameSystemPhase: { - _enum: { - ApplyExtrinsic: 'u32', - Finalization: 'Null', - Initialization: 'Null' - } - }, - /** - * Lookup118: frame_system::LastRuntimeUpgradeInfo - **/ - FrameSystemLastRuntimeUpgradeInfo: { - specVersion: 'Compact', - specName: 'Text' - }, - /** - * Lookup119: frame_system::pallet::Call - **/ - FrameSystemCall: { - _enum: { - fill_block: { - ratio: 'Perbill', - }, - remark: { - remark: 'Bytes', - }, - set_heap_pages: { - pages: 'u64', - }, - set_code: { - code: 'Bytes', - }, - set_code_without_checks: { - code: 'Bytes', - }, - set_storage: { - items: 'Vec<(Bytes,Bytes)>', - }, - kill_storage: { - _alias: { - keys_: 'keys', - }, - keys_: 'Vec', - }, - kill_prefix: { - prefix: 'Bytes', - subkeys: 'u32', - }, - remark_with_event: { - remark: 'Bytes' - } - } - }, - /** - * Lookup124: frame_system::limits::BlockWeights - **/ - FrameSystemLimitsBlockWeights: { - baseBlock: 'u64', - maxBlock: 'u64', - perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass' - }, - /** - * Lookup125: frame_support::weights::PerDispatchClass - **/ - FrameSupportWeightsPerDispatchClassWeightsPerClass: { - normal: 'FrameSystemLimitsWeightsPerClass', - operational: 'FrameSystemLimitsWeightsPerClass', - mandatory: 'FrameSystemLimitsWeightsPerClass' - }, - /** - * Lookup126: frame_system::limits::WeightsPerClass - **/ - FrameSystemLimitsWeightsPerClass: { - baseExtrinsic: 'u64', - maxExtrinsic: 'Option', - maxTotal: 'Option', - reserved: 'Option' - }, - /** - * Lookup128: frame_system::limits::BlockLength - **/ - FrameSystemLimitsBlockLength: { - max: 'FrameSupportWeightsPerDispatchClassU32' - }, - /** - * Lookup129: frame_support::weights::PerDispatchClass - **/ - FrameSupportWeightsPerDispatchClassU32: { - normal: 'u32', - operational: 'u32', - mandatory: 'u32' - }, - /** - * Lookup130: frame_support::weights::RuntimeDbWeight - **/ - FrameSupportWeightsRuntimeDbWeight: { - read: 'u64', - write: 'u64' - }, - /** - * Lookup131: sp_version::RuntimeVersion - **/ - SpVersionRuntimeVersion: { - specName: 'Text', - implName: 'Text', - authoringVersion: 'u32', - specVersion: 'u32', - implVersion: 'u32', - apis: 'Vec<([u8;8],u32)>', - transactionVersion: 'u32', - stateVersion: 'u8' - }, - /** - * Lookup136: frame_system::pallet::Error - **/ - FrameSystemError: { - _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] - }, - /** - * Lookup137: polkadot_primitives::v2::PersistedValidationData + * Lookup2: polkadot_primitives::v2::PersistedValidationData **/ PolkadotPrimitivesV2PersistedValidationData: { parentHead: 'Bytes', @@ -1272,19 +14,19 @@ export default { maxPovSize: 'u32' }, /** - * Lookup140: polkadot_primitives::v2::UpgradeRestriction + * Lookup9: polkadot_primitives::v2::UpgradeRestriction **/ PolkadotPrimitivesV2UpgradeRestriction: { _enum: ['Present'] }, /** - * Lookup141: sp_trie::storage_proof::StorageProof + * Lookup10: sp_trie::storage_proof::StorageProof **/ SpTrieStorageProof: { trieNodes: 'BTreeSet' }, /** - * Lookup143: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot + * Lookup13: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot **/ CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: { dmqMqcHead: 'H256', @@ -1293,7 +35,7 @@ export default { egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>' }, /** - * Lookup146: polkadot_primitives::v2::AbridgedHrmpChannel + * Lookup18: polkadot_primitives::v2::AbridgedHrmpChannel **/ PolkadotPrimitivesV2AbridgedHrmpChannel: { maxCapacity: 'u32', @@ -1304,7 +46,7 @@ export default { mqcHead: 'Option' }, /** - * Lookup147: polkadot_primitives::v2::AbridgedHostConfiguration + * Lookup20: polkadot_primitives::v2::AbridgedHostConfiguration **/ PolkadotPrimitivesV2AbridgedHostConfiguration: { maxCodeSize: 'u32', @@ -1318,14 +60,14 @@ export default { validationUpgradeDelay: 'u32' }, /** - * Lookup153: polkadot_core_primitives::OutboundHrmpMessage + * Lookup26: polkadot_core_primitives::OutboundHrmpMessage **/ PolkadotCorePrimitivesOutboundHrmpMessage: { recipient: 'u32', data: 'Bytes' }, /** - * Lookup154: cumulus_pallet_parachain_system::pallet::Call + * Lookup28: cumulus_pallet_parachain_system::pallet::Call **/ CumulusPalletParachainSystemCall: { _enum: { @@ -1344,7 +86,7 @@ export default { } }, /** - * Lookup155: cumulus_primitives_parachain_inherent::ParachainInherentData + * Lookup29: cumulus_primitives_parachain_inherent::ParachainInherentData **/ CumulusPrimitivesParachainInherentParachainInherentData: { validationData: 'PolkadotPrimitivesV2PersistedValidationData', @@ -1353,27 +95,58 @@ export default { horizontalMessages: 'BTreeMap>' }, /** - * Lookup157: polkadot_core_primitives::InboundDownwardMessage + * Lookup31: polkadot_core_primitives::InboundDownwardMessage **/ PolkadotCorePrimitivesInboundDownwardMessage: { sentAt: 'u32', msg: 'Bytes' }, /** - * Lookup160: polkadot_core_primitives::InboundHrmpMessage + * Lookup34: polkadot_core_primitives::InboundHrmpMessage **/ PolkadotCorePrimitivesInboundHrmpMessage: { sentAt: 'u32', data: 'Bytes' }, /** - * Lookup163: cumulus_pallet_parachain_system::pallet::Error + * Lookup37: cumulus_pallet_parachain_system::pallet::Event + **/ + CumulusPalletParachainSystemEvent: { + _enum: { + ValidationFunctionStored: 'Null', + ValidationFunctionApplied: { + relayChainBlockNum: 'u32', + }, + ValidationFunctionDiscarded: 'Null', + UpgradeAuthorized: { + codeHash: 'H256', + }, + DownwardMessagesReceived: { + count: 'u32', + }, + DownwardMessagesProcessed: { + weightUsed: 'u64', + dmqHead: 'H256' + } + } + }, + /** + * Lookup38: cumulus_pallet_parachain_system::pallet::Error **/ CumulusPalletParachainSystemError: { _enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized'] }, /** - * Lookup165: pallet_balances::BalanceLock + * Lookup41: pallet_balances::AccountData + **/ + PalletBalancesAccountData: { + free: 'u128', + reserved: 'u128', + miscFrozen: 'u128', + feeFrozen: 'u128' + }, + /** + * Lookup43: pallet_balances::BalanceLock **/ PalletBalancesBalanceLock: { id: '[u8;8]', @@ -1381,13 +154,13 @@ export default { reasons: 'PalletBalancesReasons' }, /** - * Lookup166: pallet_balances::Reasons + * Lookup45: pallet_balances::Reasons **/ PalletBalancesReasons: { _enum: ['Fee', 'Misc', 'All'] }, /** - * Lookup169: pallet_balances::ReserveData + * Lookup48: pallet_balances::ReserveData **/ PalletBalancesReserveData: { id: '[u8;16]', @@ -2706,13 +1479,13 @@ export default { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup347: pallet_unique::Error + * Lookup346: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup350: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> + * Lookup349: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> **/ PalletUniqueSchedulerScheduledV3: { maybeId: 'Option<[u8;16]>', @@ -2722,7 +1495,7 @@ export default { origin: 'OpalRuntimeOriginCaller' }, /** - * Lookup351: opal_runtime::OriginCaller + * Lookup350: opal_runtime::OriginCaller **/ OpalRuntimeOriginCaller: { _enum: { @@ -2831,7 +1604,7 @@ export default { } }, /** - * Lookup352: frame_support::dispatch::RawOrigin + * Lookup351: frame_support::dispatch::RawOrigin **/ FrameSupportDispatchRawOrigin: { _enum: { @@ -2841,7 +1614,7 @@ export default { } }, /** - * Lookup353: pallet_xcm::pallet::Origin + * Lookup352: pallet_xcm::pallet::Origin **/ PalletXcmOrigin: { _enum: { @@ -2850,7 +1623,7 @@ export default { } }, /** - * Lookup354: cumulus_pallet_xcm::pallet::Origin + * Lookup353: cumulus_pallet_xcm::pallet::Origin **/ CumulusPalletXcmOrigin: { _enum: { @@ -2859,7 +1632,7 @@ export default { } }, /** - * Lookup355: pallet_ethereum::RawOrigin + * Lookup354: pallet_ethereum::RawOrigin **/ PalletEthereumRawOrigin: { _enum: { @@ -2867,17 +1640,17 @@ export default { } }, /** - * Lookup356: sp_core::Void + * Lookup355: sp_core::Void **/ SpCoreVoid: 'Null', /** - * Lookup357: pallet_unique_scheduler::pallet::Error + * Lookup356: pallet_unique_scheduler::pallet::Error **/ PalletUniqueSchedulerError: { _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] }, /** - * Lookup358: up_data_structs::Collection + * Lookup357: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -2891,7 +1664,7 @@ export default { externalCollection: 'bool' }, /** - * Lookup359: up_data_structs::SponsorshipState + * Lookup358: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipState: { _enum: { @@ -2901,7 +1674,7 @@ export default { } }, /** - * Lookup360: up_data_structs::Properties + * Lookup359: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -2909,7 +1682,7 @@ export default { spaceLimit: 'u32' }, /** - * Lookup361: up_data_structs::PropertiesMap> + * Lookup360: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** @@ -2917,7 +1690,7 @@ export default { **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup373: up_data_structs::CollectionStats + * Lookup372: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -2925,18 +1698,18 @@ export default { alive: 'u32' }, /** - * Lookup374: up_data_structs::TokenChild + * Lookup373: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup375: PhantomType::up_data_structs + * Lookup374: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup377: up_data_structs::TokenData> + * Lookup376: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -2944,7 +1717,7 @@ export default { pieces: 'u128' }, /** - * Lookup379: up_data_structs::RpcCollection + * Lookup378: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -2960,7 +1733,7 @@ export default { readOnly: 'bool' }, /** - * Lookup380: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup379: rmrk_traits::collection::CollectionInfo, frame_support::storage::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -2970,7 +1743,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup381: rmrk_traits::nft::NftInfo> + * Lookup380: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -2980,14 +1753,14 @@ export default { pending: 'bool' }, /** - * Lookup383: rmrk_traits::nft::RoyaltyInfo + * Lookup382: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup384: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup383: rmrk_traits::resource::ResourceInfo, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -2996,14 +1769,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup385: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup384: rmrk_traits::property::PropertyInfo, frame_support::storage::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup386: rmrk_traits::base::BaseInfo> + * Lookup385: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -3011,80 +1784,80 @@ export default { symbol: 'Bytes' }, /** - * Lookup387: rmrk_traits::nft::NftChild + * Lookup386: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup389: pallet_common::pallet::Error + * Lookup388: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup391: pallet_fungible::pallet::Error + * Lookup390: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup392: pallet_refungible::ItemData + * Lookup391: pallet_refungible::ItemData **/ PalletRefungibleItemData: { constData: 'Bytes' }, /** - * Lookup397: pallet_refungible::pallet::Error + * Lookup394: pallet_refungible::pallet::Error **/ PalletRefungibleError: { _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup398: pallet_nonfungible::ItemData> + * Lookup395: pallet_nonfungible::ItemData> **/ PalletNonfungibleItemData: { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup400: up_data_structs::PropertyScope + * Lookup397: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { _enum: ['None', 'Rmrk', 'Eth'] }, /** - * Lookup402: pallet_nonfungible::pallet::Error + * Lookup399: pallet_nonfungible::pallet::Error **/ PalletNonfungibleError: { _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup403: pallet_structure::pallet::Error + * Lookup400: pallet_structure::pallet::Error **/ PalletStructureError: { _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup404: pallet_rmrk_core::pallet::Error + * Lookup401: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** - * Lookup406: pallet_rmrk_equip::pallet::Error + * Lookup403: pallet_rmrk_equip::pallet::Error **/ PalletRmrkEquipError: { _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] }, /** - * Lookup409: pallet_evm::pallet::Error + * Lookup406: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup412: fp_rpc::TransactionStatus + * Lookup409: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -3096,11 +1869,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup414: ethbloom::Bloom + * Lookup411: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup416: ethereum::receipt::ReceiptV3 + * Lookup413: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -3110,7 +1883,7 @@ export default { } }, /** - * Lookup417: ethereum::receipt::EIP658ReceiptData + * Lookup414: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -3119,7 +1892,7 @@ export default { logs: 'Vec' }, /** - * Lookup418: ethereum::block::Block + * Lookup415: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -3127,7 +1900,7 @@ export default { ommers: 'Vec' }, /** - * Lookup419: ethereum::header::Header + * Lookup416: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -3147,41 +1920,41 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup420: ethereum_types::hash::H64 + * Lookup417: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup425: pallet_ethereum::pallet::Error + * Lookup422: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup426: pallet_evm_coder_substrate::pallet::Error + * Lookup423: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup427: pallet_evm_contract_helpers::SponsoringModeT + * Lookup424: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup429: pallet_evm_contract_helpers::pallet::Error + * Lookup426: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission'] }, /** - * Lookup430: pallet_evm_migration::pallet::Error + * Lookup427: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup432: sp_runtime::MultiSignature + * Lookup429: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3191,43 +1964,43 @@ export default { } }, /** - * Lookup433: sp_core::ed25519::Signature + * Lookup430: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup435: sp_core::sr25519::Signature + * Lookup434: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup436: sp_core::ecdsa::Signature + * Lookup435: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup439: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup438: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup440: frame_system::extensions::check_genesis::CheckGenesis + * Lookup439: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup443: frame_system::extensions::check_nonce::CheckNonce + * Lookup442: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup444: frame_system::extensions::check_weight::CheckWeight + * Lookup443: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup445: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup444: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup446: opal_runtime::Runtime + * Lookup445: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup447: pallet_ethereum::FakeTransactionFinalizer + * Lookup444: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 2e0e8fe399..950696394e 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1393,28 +1393,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'StartInflation'; } - /** @name PalletAppPromotionCall (148) */ - export interface PalletAppPromotionCall extends Enum { - readonly isSetAdminAddress: boolean; - readonly asSetAdminAddress: { - readonly admin: AccountId32; - } & Struct; - readonly isStartAppPromotion: boolean; - readonly asStartAppPromotion: { - readonly promotionStartRelayBlock: u32; - } & Struct; - readonly isStake: boolean; - readonly asStake: { - readonly amount: u128; - } & Struct; - readonly isUnstake: boolean; - readonly asUnstake: { - readonly amount: u128; - } & Struct; - readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake'; - } - - /** @name PalletUniqueCall (149) */ + /** @name PalletUniqueCall (148) */ export interface PalletUniqueCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -1629,164 +1608,28 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly nftId: u32; readonly resourceId: u32; } & Struct; - readonly isResourceRemovalAccepted: boolean; - readonly asResourceRemovalAccepted: { - readonly nftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isPrioritySet: boolean; - readonly asPrioritySet: { + readonly isCreateMultipleItemsEx: boolean; + readonly asCreateMultipleItemsEx: { readonly collectionId: u32; - readonly nftId: u32; - } & Struct; - readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; - } - -<<<<<<< HEAD - /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (97) */ - interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { - readonly isAccountId: boolean; - readonly asAccountId: AccountId32; - readonly isCollectionAndNftTuple: boolean; - readonly asCollectionAndNftTuple: ITuple<[u32, u32]>; - readonly type: 'AccountId' | 'CollectionAndNftTuple'; - } - - /** @name PalletRmrkEquipEvent (102) */ - interface PalletRmrkEquipEvent extends Enum { - readonly isBaseCreated: boolean; - readonly asBaseCreated: { - readonly issuer: AccountId32; - readonly baseId: u32; - } & Struct; - readonly isEquippablesUpdated: boolean; - readonly asEquippablesUpdated: { - readonly baseId: u32; - readonly slotId: u32; + readonly data: UpDataStructsCreateItemExData; } & Struct; - readonly type: 'BaseCreated' | 'EquippablesUpdated'; - } - - /** @name PalletEvmEvent (103) */ - interface PalletEvmEvent extends Enum { - readonly isLog: boolean; - readonly asLog: EthereumLog; - readonly isCreated: boolean; - readonly asCreated: H160; - readonly isCreatedFailed: boolean; - readonly asCreatedFailed: H160; - readonly isExecuted: boolean; - readonly asExecuted: H160; - readonly isExecutedFailed: boolean; - readonly asExecutedFailed: H160; - readonly isBalanceDeposit: boolean; - readonly asBalanceDeposit: ITuple<[AccountId32, H160, U256]>; - readonly isBalanceWithdraw: boolean; - readonly asBalanceWithdraw: ITuple<[AccountId32, H160, U256]>; - readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; - } - - /** @name EthereumLog (104) */ - interface EthereumLog extends Struct { - readonly address: H160; - readonly topics: Vec; - readonly data: Bytes; - } - - /** @name PalletEthereumEvent (108) */ - interface PalletEthereumEvent extends Enum { - readonly isExecuted: boolean; - readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; - readonly type: 'Executed'; - } - - /** @name EvmCoreErrorExitReason (109) */ - interface EvmCoreErrorExitReason extends Enum { - readonly isSucceed: boolean; - readonly asSucceed: EvmCoreErrorExitSucceed; - readonly isError: boolean; - readonly asError: EvmCoreErrorExitError; - readonly isRevert: boolean; - readonly asRevert: EvmCoreErrorExitRevert; - readonly isFatal: boolean; - readonly asFatal: EvmCoreErrorExitFatal; - readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; - } - - /** @name EvmCoreErrorExitSucceed (110) */ - interface EvmCoreErrorExitSucceed extends Enum { - readonly isStopped: boolean; - readonly isReturned: boolean; - readonly isSuicided: boolean; - readonly type: 'Stopped' | 'Returned' | 'Suicided'; - } - - /** @name EvmCoreErrorExitError (111) */ - interface EvmCoreErrorExitError extends Enum { - readonly isStackUnderflow: boolean; - readonly isStackOverflow: boolean; - readonly isInvalidJump: boolean; - readonly isInvalidRange: boolean; - readonly isDesignatedInvalid: boolean; - readonly isCallTooDeep: boolean; - readonly isCreateCollision: boolean; - readonly isCreateContractLimit: boolean; - readonly isOutOfOffset: boolean; - readonly isOutOfGas: boolean; - readonly isOutOfFund: boolean; - readonly isPcUnderflow: boolean; - readonly isCreateEmpty: boolean; - readonly isOther: boolean; - readonly asOther: Text; - readonly isInvalidCode: boolean; - readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; - } - - /** @name EvmCoreErrorExitRevert (114) */ - interface EvmCoreErrorExitRevert extends Enum { - readonly isReverted: boolean; - readonly type: 'Reverted'; - } - - /** @name EvmCoreErrorExitFatal (115) */ - interface EvmCoreErrorExitFatal extends Enum { - readonly isNotSupported: boolean; - readonly isUnhandledInterrupt: boolean; - readonly isCallErrorAsFatal: boolean; - readonly asCallErrorAsFatal: EvmCoreErrorExitError; - readonly isOther: boolean; - readonly asOther: Text; - readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; - } - - /** @name FrameSystemPhase (116) */ - interface FrameSystemPhase extends Enum { - readonly isApplyExtrinsic: boolean; - readonly asApplyExtrinsic: u32; - readonly isFinalization: boolean; - readonly isInitialization: boolean; - readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; - } - - /** @name FrameSystemLastRuntimeUpgradeInfo (118) */ - interface FrameSystemLastRuntimeUpgradeInfo extends Struct { - readonly specVersion: Compact; - readonly specName: Text; - } - - /** @name FrameSystemCall (119) */ - interface FrameSystemCall extends Enum { - readonly isFillBlock: boolean; - readonly asFillBlock: { - readonly ratio: Perbill; + readonly isSetTransfersEnabledFlag: boolean; + readonly asSetTransfersEnabledFlag: { + readonly collectionId: u32; + readonly value: bool; } & Struct; - readonly isRemark: boolean; - readonly asRemark: { - readonly remark: Bytes; + readonly isBurnItem: boolean; + readonly asBurnItem: { + readonly collectionId: u32; + readonly itemId: u32; + readonly value: u128; } & Struct; - readonly isSetHeapPages: boolean; - readonly asSetHeapPages: { - readonly pages: u64; + readonly isBurnFrom: boolean; + readonly asBurnFrom: { + readonly collectionId: u32; + readonly from: PalletEvmAccountBasicCrossAccountIdRepr; + readonly itemId: u32; + readonly value: u128; } & Struct; readonly isSetCode: boolean; readonly asSetCode: { @@ -1813,21 +1656,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly asRemarkWithEvent: { readonly remark: Bytes; } & Struct; - readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent'; - } - - /** @name FrameSystemLimitsBlockWeights (124) */ - interface FrameSystemLimitsBlockWeights extends Struct { - readonly baseBlock: u64; - readonly maxBlock: u64; - readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; - } - - /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (125) */ - interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { - readonly normal: FrameSystemLimitsWeightsPerClass; - readonly operational: FrameSystemLimitsWeightsPerClass; - readonly mandatory: FrameSystemLimitsWeightsPerClass; + readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; } /** @name UpDataStructsCollectionMode (155) */ @@ -1839,7 +1668,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateCollectionData (156) */ + /** @name UpDataStructsCreateCollectionData (155) */ export interface UpDataStructsCreateCollectionData extends Struct { readonly mode: UpDataStructsCollectionMode; readonly access: Option; @@ -1853,14 +1682,14 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly properties: Vec; } - /** @name UpDataStructsAccessMode (158) */ + /** @name UpDataStructsAccessMode (157) */ export interface UpDataStructsAccessMode extends Enum { readonly isNormal: boolean; readonly isAllowList: boolean; readonly type: 'Normal' | 'AllowList'; } - /** @name UpDataStructsCollectionLimits (161) */ + /** @name UpDataStructsCollectionLimits (160) */ export interface UpDataStructsCollectionLimits extends Struct { readonly accountTokenOwnershipLimit: Option; readonly sponsoredDataSize: Option; @@ -1873,7 +1702,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly transfersEnabled: Option; } - /** @name UpDataStructsSponsoringRateLimit (163) */ + /** @name UpDataStructsSponsoringRateLimit (162) */ export interface UpDataStructsSponsoringRateLimit extends Enum { readonly isSponsoringDisabled: boolean; readonly isBlocks: boolean; @@ -1881,43 +1710,43 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'SponsoringDisabled' | 'Blocks'; } - /** @name UpDataStructsCollectionPermissions (166) */ + /** @name UpDataStructsCollectionPermissions (165) */ export interface UpDataStructsCollectionPermissions extends Struct { readonly access: Option; readonly mintMode: Option; readonly nesting: Option; } - /** @name UpDataStructsNestingPermissions (168) */ + /** @name UpDataStructsNestingPermissions (167) */ export interface UpDataStructsNestingPermissions extends Struct { readonly tokenOwner: bool; readonly collectionAdmin: bool; readonly restricted: Option; } - /** @name UpDataStructsOwnerRestrictedSet (170) */ + /** @name UpDataStructsOwnerRestrictedSet (169) */ export interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} - /** @name UpDataStructsPropertyKeyPermission (176) */ + /** @name UpDataStructsPropertyKeyPermission (175) */ export interface UpDataStructsPropertyKeyPermission extends Struct { readonly key: Bytes; readonly permission: UpDataStructsPropertyPermission; } - /** @name UpDataStructsPropertyPermission (178) */ + /** @name UpDataStructsPropertyPermission (177) */ export interface UpDataStructsPropertyPermission extends Struct { readonly mutable: bool; readonly collectionAdmin: bool; readonly tokenOwner: bool; } - /** @name UpDataStructsProperty (181) */ + /** @name UpDataStructsProperty (180) */ export interface UpDataStructsProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name PalletEvmAccountBasicCrossAccountIdRepr (184) */ + /** @name PalletEvmAccountBasicCrossAccountIdRepr (183) */ export interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { readonly isSubstrate: boolean; readonly asSubstrate: AccountId32; @@ -1926,7 +1755,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Substrate' | 'Ethereum'; } - /** @name UpDataStructsCreateItemData (186) */ + /** @name UpDataStructsCreateItemData (185) */ export interface UpDataStructsCreateItemData extends Enum { readonly isNft: boolean; readonly asNft: UpDataStructsCreateNftData; @@ -1937,17 +1766,17 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateNftData (187) */ + /** @name UpDataStructsCreateNftData (186) */ export interface UpDataStructsCreateNftData extends Struct { readonly properties: Vec; } - /** @name UpDataStructsCreateFungibleData (188) */ + /** @name UpDataStructsCreateFungibleData (187) */ export interface UpDataStructsCreateFungibleData extends Struct { readonly value: u128; } - /** @name UpDataStructsCreateReFungibleData (189) */ + /** @name UpDataStructsCreateReFungibleData (188) */ export interface UpDataStructsCreateReFungibleData extends Struct { readonly pieces: u128; readonly properties: Vec; @@ -2028,7 +1857,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly properties: Vec; } - /** @name PalletUniqueSchedulerCall (205) */ + /** @name PalletUniqueSchedulerCall (204) */ export interface PalletUniqueSchedulerCall extends Enum { readonly isScheduleNamed: boolean; readonly asScheduleNamed: { @@ -2053,7 +1882,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; } - /** @name FrameSupportScheduleMaybeHashed (207) */ + /** @name FrameSupportScheduleMaybeHashed (206) */ export interface FrameSupportScheduleMaybeHashed extends Enum { readonly isValue: boolean; readonly asValue: Call; @@ -2062,13 +1891,13 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Value' | 'Hash'; } - /** @name PalletTemplateTransactionPaymentCall (208) */ + /** @name PalletTemplateTransactionPaymentCall (207) */ export type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletStructureCall (209) */ + /** @name PalletStructureCall (208) */ export type PalletStructureCall = Null; - /** @name PalletRmrkCoreCall (210) */ + /** @name PalletRmrkCoreCall (209) */ export interface PalletRmrkCoreCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -2174,7 +2003,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; } - /** @name RmrkTraitsResourceResourceTypes (216) */ + /** @name RmrkTraitsResourceResourceTypes (215) */ export interface RmrkTraitsResourceResourceTypes extends Enum { readonly isBasic: boolean; readonly asBasic: RmrkTraitsResourceBasicResource; @@ -2185,7 +2014,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Basic' | 'Composable' | 'Slot'; } - /** @name RmrkTraitsResourceBasicResource (218) */ + /** @name RmrkTraitsResourceBasicResource (217) */ export interface RmrkTraitsResourceBasicResource extends Struct { readonly src: Option; readonly metadata: Option; @@ -2193,7 +2022,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly thumb: Option; } - /** @name RmrkTraitsResourceComposableResource (220) */ + /** @name RmrkTraitsResourceComposableResource (219) */ export interface RmrkTraitsResourceComposableResource extends Struct { readonly parts: Vec; readonly base: u32; @@ -2203,7 +2032,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly thumb: Option; } - /** @name RmrkTraitsResourceSlotResource (221) */ + /** @name RmrkTraitsResourceSlotResource (220) */ export interface RmrkTraitsResourceSlotResource extends Struct { readonly base: u32; readonly src: Option; @@ -2213,7 +2042,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly thumb: Option; } - /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (223) */ + /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (222) */ export interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { readonly isAccountId: boolean; readonly asAccountId: AccountId32; @@ -2222,7 +2051,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'AccountId' | 'CollectionAndNftTuple'; } - /** @name PalletRmrkEquipCall (227) */ + /** @name PalletRmrkEquipCall (226) */ export interface PalletRmrkEquipCall extends Enum { readonly isCreateBase: boolean; readonly asCreateBase: { @@ -2244,7 +2073,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; } - /** @name RmrkTraitsPartPartType (230) */ + /** @name RmrkTraitsPartPartType (229) */ export interface RmrkTraitsPartPartType extends Enum { readonly isFixedPart: boolean; readonly asFixedPart: RmrkTraitsPartFixedPart; @@ -2253,14 +2082,14 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'FixedPart' | 'SlotPart'; } - /** @name RmrkTraitsPartFixedPart (232) */ + /** @name RmrkTraitsPartFixedPart (231) */ export interface RmrkTraitsPartFixedPart extends Struct { readonly id: u32; readonly z: u32; readonly src: Bytes; } - /** @name RmrkTraitsPartSlotPart (233) */ + /** @name RmrkTraitsPartSlotPart (232) */ export interface RmrkTraitsPartSlotPart extends Struct { readonly id: u32; readonly equippable: RmrkTraitsPartEquippableList; @@ -2268,25 +2097,46 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly z: u32; } - /** @name RmrkTraitsPartEquippableList (234) */ + /** @name RmrkTraitsPartEquippableList (233) */ export interface RmrkTraitsPartEquippableList extends Enum { readonly isAll: boolean; readonly type: 'Fee' | 'Misc' | 'All'; } - /** @name RmrkTraitsTheme (236) */ + /** @name RmrkTraitsTheme (235) */ export interface RmrkTraitsTheme extends Struct { readonly name: Bytes; readonly properties: Vec; readonly inherit: bool; } - /** @name RmrkTraitsThemeThemeProperty (238) */ + /** @name RmrkTraitsThemeThemeProperty (237) */ export interface RmrkTraitsThemeThemeProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } + /** @name PalletAppPromotionCall (239) */ + export interface PalletAppPromotionCall extends Enum { + readonly isSetAdminAddress: boolean; + readonly asSetAdminAddress: { + readonly admin: AccountId32; + } & Struct; + readonly isStartAppPromotion: boolean; + readonly asStartAppPromotion: { + readonly promotionStartRelayBlock: u32; + } & Struct; + readonly isStake: boolean; + readonly asStake: { + readonly amount: u128; + } & Struct; + readonly isUnstake: boolean; + readonly asUnstake: { + readonly amount: u128; + } & Struct; + readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake'; + } + /** @name PalletEvmCall (240) */ export interface PalletEvmCall extends Enum { readonly isWithdraw: boolean; @@ -3213,7 +3063,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (346) */ + /** @name PalletUniqueError (345) */ export interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; @@ -3222,7 +3072,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name PalletUniqueSchedulerScheduledV3 (349) */ + /** @name PalletUniqueSchedulerScheduledV3 (348) */ export interface PalletUniqueSchedulerScheduledV3 extends Struct { readonly maybeId: Option; readonly priority: u8; @@ -3231,7 +3081,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly origin: OpalRuntimeOriginCaller; } - /** @name OpalRuntimeOriginCaller (350) */ + /** @name OpalRuntimeOriginCaller (349) */ export interface OpalRuntimeOriginCaller extends Enum { readonly isVoid: boolean; readonly isSystem: boolean; @@ -3246,7 +3096,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; } - /** @name FrameSupportDispatchRawOrigin (351) */ + /** @name FrameSupportDispatchRawOrigin (350) */ export interface FrameSupportDispatchRawOrigin extends Enum { readonly isRoot: boolean; readonly isSigned: boolean; @@ -3255,7 +3105,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Root' | 'Signed' | 'None'; } - /** @name PalletXcmOrigin (352) */ + /** @name PalletXcmOrigin (351) */ export interface PalletXcmOrigin extends Enum { readonly isXcm: boolean; readonly asXcm: XcmV1MultiLocation; @@ -3264,7 +3114,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Xcm' | 'Response'; } - /** @name CumulusPalletXcmOrigin (353) */ + /** @name CumulusPalletXcmOrigin (352) */ export interface CumulusPalletXcmOrigin extends Enum { readonly isRelay: boolean; readonly isSiblingParachain: boolean; @@ -3272,17 +3122,17 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Relay' | 'SiblingParachain'; } - /** @name PalletEthereumRawOrigin (354) */ + /** @name PalletEthereumRawOrigin (353) */ export interface PalletEthereumRawOrigin extends Enum { readonly isEthereumTransaction: boolean; readonly asEthereumTransaction: H160; readonly type: 'EthereumTransaction'; } - /** @name SpCoreVoid (355) */ + /** @name SpCoreVoid (354) */ export type SpCoreVoid = Null; - /** @name PalletUniqueSchedulerError (356) */ + /** @name PalletUniqueSchedulerError (355) */ export interface PalletUniqueSchedulerError extends Enum { readonly isFailedToSchedule: boolean; readonly isNotFound: boolean; @@ -3291,7 +3141,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; } - /** @name UpDataStructsCollection (357) */ + /** @name UpDataStructsCollection (356) */ export interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3304,7 +3154,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly externalCollection: bool; } - /** @name UpDataStructsSponsorshipState (358) */ + /** @name UpDataStructsSponsorshipState (357) */ export interface UpDataStructsSponsorshipState extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3314,43 +3164,43 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (359) */ + /** @name UpDataStructsProperties (358) */ export interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (360) */ + /** @name UpDataStructsPropertiesMapBoundedVec (359) */ export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (365) */ + /** @name UpDataStructsPropertiesMapPropertyPermission (364) */ export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (372) */ + /** @name UpDataStructsCollectionStats (371) */ export interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (373) */ + /** @name UpDataStructsTokenChild (372) */ export interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (374) */ + /** @name PhantomTypeUpDataStructs (373) */ export interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (376) */ + /** @name UpDataStructsTokenData (375) */ export interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (378) */ + /** @name UpDataStructsRpcCollection (377) */ export interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3365,7 +3215,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly readOnly: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (379) */ + /** @name RmrkTraitsCollectionCollectionInfo (378) */ export interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; @@ -3374,7 +3224,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (380) */ + /** @name RmrkTraitsNftNftInfo (379) */ export interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; @@ -3383,13 +3233,13 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (382) */ + /** @name RmrkTraitsNftRoyaltyInfo (381) */ export interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (383) */ + /** @name RmrkTraitsResourceResourceInfo (382) */ export interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; @@ -3397,26 +3247,26 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (384) */ + /** @name RmrkTraitsPropertyPropertyInfo (383) */ export interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (385) */ + /** @name RmrkTraitsBaseBaseInfo (384) */ export interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (386) */ + /** @name RmrkTraitsNftNftChild (385) */ export interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (388) */ + /** @name PalletCommonError (387) */ export interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; @@ -3455,7 +3305,7 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (390) */ + /** @name PalletFungibleError (389) */ export interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; @@ -3465,13 +3315,13 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (391) */ + /** @name PalletRefungibleItemData (390) */ export interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } - /** @name PalletRefungibleError (397) */ - interface PalletRefungibleError extends Enum { + /** @name PalletRefungibleError (394) */ + export interface PalletRefungibleError extends Enum { readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isWrongRefungiblePieces: boolean; readonly isRepartitionWhileNotOwningAllPieces: boolean; @@ -3480,29 +3330,29 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletNonfungibleItemData (398) */ - interface PalletNonfungibleItemData extends Struct { + /** @name PalletNonfungibleItemData (395) */ + export interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (400) */ - interface UpDataStructsPropertyScope extends Enum { + /** @name UpDataStructsPropertyScope (397) */ + export interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; readonly isEth: boolean; readonly type: 'None' | 'Rmrk' | 'Eth'; } - /** @name PalletNonfungibleError (402) */ - interface PalletNonfungibleError extends Enum { + /** @name PalletNonfungibleError (399) */ + export interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; readonly isCantBurnNftWithChildren: boolean; readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (403) */ - interface PalletStructureError extends Enum { + /** @name PalletStructureError (400) */ + export interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; readonly isBreadthLimit: boolean; @@ -3510,8 +3360,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletRmrkCoreError (404) */ - interface PalletRmrkCoreError extends Enum { + /** @name PalletRmrkCoreError (401) */ + export interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; readonly isRmrkPropertyValueIsTooLong: boolean; @@ -3534,8 +3384,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } - /** @name PalletRmrkEquipError (406) */ - interface PalletRmrkEquipError extends Enum { + /** @name PalletRmrkEquipError (403) */ + export interface PalletRmrkEquipError extends Enum { readonly isPermissionError: boolean; readonly isNoAvailableBaseId: boolean; readonly isNoAvailablePartId: boolean; @@ -3546,8 +3396,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; } - /** @name PalletEvmError (409) */ - interface PalletEvmError extends Enum { + /** @name PalletEvmError (406) */ + export interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; readonly isPaymentOverflow: boolean; @@ -3557,8 +3407,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (412) */ - interface FpRpcTransactionStatus extends Struct { + /** @name FpRpcTransactionStatus (409) */ + export interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; readonly from: H160; @@ -3568,11 +3418,11 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (414) */ - interface EthbloomBloom extends U8aFixed {} + /** @name EthbloomBloom (411) */ + export interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (416) */ - interface EthereumReceiptReceiptV3 extends Enum { + /** @name EthereumReceiptReceiptV3 (413) */ + export interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; readonly isEip2930: boolean; @@ -3582,23 +3432,23 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (417) */ - interface EthereumReceiptEip658ReceiptData extends Struct { + /** @name EthereumReceiptEip658ReceiptData (414) */ + export interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; readonly logsBloom: EthbloomBloom; readonly logs: Vec; } - /** @name EthereumBlock (418) */ - interface EthereumBlock extends Struct { + /** @name EthereumBlock (415) */ + export interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (419) */ - interface EthereumHeader extends Struct { + /** @name EthereumHeader (416) */ + export interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; readonly beneficiary: H160; @@ -3616,46 +3466,46 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (420) */ - interface EthereumTypesHashH64 extends U8aFixed {} + /** @name EthereumTypesHashH64 (417) */ + export interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (425) */ - interface PalletEthereumError extends Enum { + /** @name PalletEthereumError (422) */ + export interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (426) */ - interface PalletEvmCoderSubstrateError extends Enum { + /** @name PalletEvmCoderSubstrateError (423) */ + export interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name PalletEvmContractHelpersSponsoringModeT (427) */ - interface PalletEvmContractHelpersSponsoringModeT extends Enum { + /** @name PalletEvmContractHelpersSponsoringModeT (424) */ + export interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; readonly isGenerous: boolean; readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (429) */ - interface PalletEvmContractHelpersError extends Enum { + /** @name PalletEvmContractHelpersError (426) */ + export interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly type: 'NoPermission'; } - /** @name PalletEvmMigrationError (430) */ - interface PalletEvmMigrationError extends Enum { + /** @name PalletEvmMigrationError (427) */ + export interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (432) */ - interface SpRuntimeMultiSignature extends Enum { + /** @name SpRuntimeMultiSignature (429) */ + export interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; readonly isSr25519: boolean; @@ -3665,34 +3515,34 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (433) */ - interface SpCoreEd25519Signature extends U8aFixed {} + /** @name SpCoreEd25519Signature (430) */ + export interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (435) */ - interface SpCoreSr25519Signature extends U8aFixed {} + /** @name SpCoreSr25519Signature (434) */ + export interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (436) */ - interface SpCoreEcdsaSignature extends U8aFixed {} + /** @name SpCoreEcdsaSignature (435) */ + export interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (439) */ - type FrameSystemExtensionsCheckSpecVersion = Null; + /** @name FrameSystemExtensionsCheckSpecVersion (438) */ + export type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (440) */ - type FrameSystemExtensionsCheckGenesis = Null; + /** @name FrameSystemExtensionsCheckGenesis (439) */ + export type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (443) */ - interface FrameSystemExtensionsCheckNonce extends Compact {} + /** @name FrameSystemExtensionsCheckNonce (442) */ + export interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (444) */ - type FrameSystemExtensionsCheckWeight = Null; + /** @name FrameSystemExtensionsCheckWeight (443) */ + export type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (445) */ - interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (444) */ + export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (446) */ - type OpalRuntimeRuntime = Null; + /** @name OpalRuntimeRuntime (445) */ + export type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (447) */ - type PalletEthereumFakeTransactionFinalizer = Null; + /** @name PalletEthereumFakeTransactionFinalizer (444) */ + export type PalletEthereumFakeTransactionFinalizer = Null; } // declare module diff --git a/tests/src/interfaces/unique/definitions.ts b/tests/src/interfaces/unique/definitions.ts index ea93f78d07..762d38d6b0 100644 --- a/tests/src/interfaces/unique/definitions.ts +++ b/tests/src/interfaces/unique/definitions.ts @@ -190,5 +190,10 @@ export default { [crossAccountParam('staker')], 'u128', ), + pendingUnstake: fun( + 'Returns the total amount of unstaked tokens', + [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}], + 'u128', + ), }, }; diff --git a/tests/src/pallet-presence.test.ts b/tests/src/pallet-presence.test.ts index 7421c0d0ad..457dcf9f47 100644 --- a/tests/src/pallet-presence.test.ts +++ b/tests/src/pallet-presence.test.ts @@ -68,9 +68,10 @@ describe('Pallet presence', () => { const refungible = 'refungible'; const scheduler = 'scheduler'; const rmrkPallets = ['rmrkcore', 'rmrkequip']; + const appPromotion = 'promotion'; if (chain.eq('OPAL by UNIQUE')) { - requiredPallets.push(refungible, scheduler, ...rmrkPallets); + requiredPallets.push(refungible, scheduler, appPromotion, ...rmrkPallets); } else if (chain.eq('QUARTZ by UNIQUE')) { // Insert Quartz additional pallets here } else if (chain.eq('UNIQUE')) { diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index e87e1d1fe8..fde984045e 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -48,6 +48,7 @@ export enum Pallets { Fungible = 'fungible', NFT = 'nonfungible', Scheduler = 'scheduler', + AppPromotion = 'promotion', } export async function isUnique(): Promise { diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index c2b59cc025..5d864cf200 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -4,7 +4,10 @@ import {IKeyringPair} from '@polkadot/types/types'; import config from '../../config'; import '../../interfaces/augment-api-events'; -import {DevUniqueHelper} from './unique.dev'; +import * as defs from '../../interfaces/definitions'; +import {ApiPromise, WsProvider} from '@polkadot/api'; +import { UniqueHelper } from './unique'; + class SilentLogger { log(msg: any, level: any): void { } @@ -15,13 +18,53 @@ class SilentLogger { }; } -export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { + +class DevUniqueHelper extends UniqueHelper { + async connect(wsEndpoint: string, listeners?: any): Promise { + const wsProvider = new WsProvider(wsEndpoint); + this.api = new ApiPromise({ + provider: wsProvider, + signedExtensions: { + ContractHelpers: { + extrinsic: {}, + payload: {}, + }, + FakeTransactionFinalizer: { + extrinsic: {}, + payload: {}, + }, + }, + rpc: { + unique: defs.unique.rpc, + rmrk: defs.rmrk.rpc, + eth: { + feeHistory: { + description: 'Dummy', + params: [], + type: 'u8', + }, + maxPriorityFeePerGas: { + description: 'Dummy', + params: [], + type: 'u8', + }, + }, + }, + }); + await this.api.isReadyOrError; + this.network = await UniqueHelper.detectNetwork(this.api); + } +} + + +export const usingPlaygrounds = async (code: (helper: UniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { // TODO: Remove, this is temporary: Filter unneeded API output // (Jaco promised it will be removed in the next version) const consoleErr = console.error; const consoleLog = console.log; const consoleWarn = console.warn; - + let result: T = null as unknown as T; + const outFn = (printer: any) => (...args: any[]) => { for (const arg of args) { if (typeof arg !== 'string') @@ -41,7 +84,7 @@ export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKe await helper.connect(config.substrateUrl); const ss58Format = helper.chain.getChainProperties().ss58Format; const privateKey = (seed: string) => helper.util.fromSeed(seed, ss58Format); - await code(helper, privateKey); + result = await code(helper, privateKey); } finally { await helper.disconnect(); @@ -49,4 +92,5 @@ export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKe console.log = consoleLog; console.warn = consoleWarn; } + return result as T; }; \ No newline at end of file From 8d226d67b0fab2ba7726c340d452e8159bcd3b2c Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 17 Aug 2022 20:55:10 +0700 Subject: [PATCH 0620/1274] add rpc method `pendingUnstakePerBlock` + tests --- Cargo.lock | 3241 ++++++-------- client/rpc/src/lib.rs | 18 +- pallets/app-promotion/Cargo.toml | 22 +- pallets/app-promotion/src/lib.rs | 27 +- primitives/rpc/src/lib.rs | 3 + runtime/common/runtime_apis.rs | 4 + tests/src/app-promotion.test.ts | 84 +- tests/src/interfaces/augment-api-query.ts | 3 + tests/src/interfaces/augment-api-rpc.ts | 6 +- tests/src/interfaces/augment-types.ts | 2 +- tests/src/interfaces/lookup.ts | 1522 ++++++- tests/src/interfaces/registry.ts | 2 +- tests/src/interfaces/types-lookup.ts | 4643 ++++++++++---------- tests/src/interfaces/unique/definitions.ts | 5 + 14 files changed, 5070 insertions(+), 4512 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a80b451032..cb8a959576 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -446,15 +446,15 @@ dependencies = [ "sc-network", "sc-network-gossip", "sc-utils", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", "sp-blockchain", "sp-consensus", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-keystore", "sp-mmr-primitives", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "substrate-prometheus-endpoint", "thiserror", "wasm-timer", @@ -475,8 +475,8 @@ dependencies = [ "sc-rpc", "sc-utils", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", "thiserror", ] @@ -486,7 +486,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "beefy-primitives", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", ] [[package]] @@ -496,11 +496,11 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "parity-scale-codec 3.1.5", "scale-info", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -1300,8 +1300,8 @@ dependencies = [ "sc-chain-spec", "sc-cli", "sc-service", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", "url", ] @@ -1322,10 +1322,10 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "sc-client-api", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-consensus", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", "tracing", ] @@ -1344,16 +1344,16 @@ dependencies = [ "sc-consensus-aura", "sc-consensus-slots", "sc-telemetry", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-application-crypto", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", "substrate-prometheus-endpoint", "tracing", ] @@ -1371,11 +1371,11 @@ dependencies = [ "polkadot-primitives", "sc-client-api", "sc-consensus", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", "sp-consensus", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-trie", "tracing", ] @@ -1395,12 +1395,12 @@ dependencies = [ "polkadot-parachain", "polkadot-primitives", "sc-client-api", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-state-machine", "tracing", ] @@ -1421,10 +1421,10 @@ dependencies = [ "rand 0.8.5", "sc-client-api", "sc-consensus", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-consensus", "sp-maybe-compressed-blob", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "tracing", ] @@ -1448,11 +1448,11 @@ dependencies = [ "sc-service", "sc-telemetry", "sc-tracing", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", "tracing", ] @@ -1462,16 +1462,16 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "frame-executive", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "pallet-aura", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto", "sp-consensus-aura", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", ] [[package]] @@ -1480,14 +1480,14 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io", + "sp-runtime", + "sp-std", "xcm", "xcm-executor", ] @@ -1501,24 +1501,24 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "environmental", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances", "parity-scale-codec 3.1.5", "polkadot-parachain", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-externalities", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", + "sp-version", "xcm", ] @@ -1539,14 +1539,14 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io", + "sp-runtime", + "sp-std", "xcm", ] @@ -1556,14 +1556,14 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "log", "parity-scale-codec 3.1.5", "rand_chacha 0.3.1", "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", "xcm", "xcm-executor", ] @@ -1573,15 +1573,15 @@ name = "cumulus-primitives-core" version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", "parity-scale-codec 3.1.5", "polkadot-core-primitives", "polkadot-parachain", "polkadot-primitives", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-runtime", + "sp-std", + "sp-trie", ] [[package]] @@ -1596,14 +1596,14 @@ dependencies = [ "parity-scale-codec 3.1.5", "sc-client-api", "scale-info", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-storage", + "sp-trie", "tracing", ] @@ -1615,9 +1615,9 @@ dependencies = [ "cumulus-primitives-core", "futures 0.3.23", "parity-scale-codec 3.1.5", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents", + "sp-std", + "sp-timestamp", ] [[package]] @@ -1626,14 +1626,14 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", "parity-scale-codec 3.1.5", "polkadot-core-primitives", "polkadot-parachain", "polkadot-primitives", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", + "sp-trie", "xcm", "xcm-builder", "xcm-executor", @@ -1660,12 +1660,12 @@ dependencies = [ "sc-sysinfo", "sc-telemetry", "sc-tracing", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-state-machine", "tracing", ] @@ -1684,11 +1684,11 @@ dependencies = [ "polkadot-overseer", "polkadot-service", "sc-client-api", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-state-machine", "thiserror", ] @@ -1709,11 +1709,11 @@ dependencies = [ "polkadot-service", "sc-client-api", "sc-rpc-api", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-storage", "tokio", "tracing", "url", @@ -1727,9 +1727,9 @@ dependencies = [ "cumulus-primitives-core", "parity-scale-codec 3.1.5", "polkadot-primitives", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-state-machine", + "sp-std", ] [[package]] @@ -2147,24 +2147,6 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" -[[package]] -name = "evm" -version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24#e9252ed42dc26fc85b6703b1ba50660a08209e55" -dependencies = [ - "auto_impl", - "ethereum", - "evm-core 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", - "evm-gasometer 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", - "evm-runtime 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", - "log", - "parity-scale-codec 3.1.5", - "primitive-types", - "rlp", - "scale-info", - "sha3 0.10.2", -] - [[package]] name = "evm" version = "0.35.0" @@ -2173,9 +2155,9 @@ dependencies = [ "auto_impl", "environmental", "ethereum", - "evm-core 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", - "evm-gasometer 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", - "evm-runtime 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", + "evm-core", + "evm-gasometer", + "evm-runtime", "log", "parity-scale-codec 3.1.5", "primitive-types", @@ -2211,16 +2193,6 @@ dependencies = [ "syn", ] -[[package]] -name = "evm-core" -version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24#e9252ed42dc26fc85b6703b1ba50660a08209e55" -dependencies = [ - "parity-scale-codec 3.1.5", - "primitive-types", - "scale-info", -] - [[package]] name = "evm-core" version = "0.35.0" @@ -2232,36 +2204,15 @@ dependencies = [ "serde", ] -[[package]] -name = "evm-gasometer" -version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24#e9252ed42dc26fc85b6703b1ba50660a08209e55" -dependencies = [ - "evm-core 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", - "evm-runtime 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", - "primitive-types", -] - [[package]] name = "evm-gasometer" version = "0.35.0" source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "environmental", - "evm-core 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", - "evm-runtime 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", - "primitive-types", -] - -[[package]] -name = "evm-runtime" -version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24#e9252ed42dc26fc85b6703b1ba50660a08209e55" -dependencies = [ - "auto_impl", - "evm-core 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", + "evm-core", + "evm-runtime", "primitive-types", - "sha3 0.10.2", ] [[package]] @@ -2271,7 +2222,7 @@ source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.2 dependencies = [ "auto_impl", "environmental", - "evm-core 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", + "evm-core", "primitive-types", "sha3 0.10.2", ] @@ -2367,11 +2318,11 @@ dependencies = [ "fp-rpc", "sc-client-api", "sc-consensus", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-block-builder", "sp-blockchain", "sp-consensus", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "thiserror", ] @@ -2386,9 +2337,9 @@ dependencies = [ "parity-scale-codec 3.1.5", "parking_lot 0.12.1", "sc-client-db", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-database", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", ] [[package]] @@ -2403,9 +2354,9 @@ dependencies = [ "futures-timer", "log", "sc-client-api", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", ] [[package]] @@ -2415,7 +2366,7 @@ source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v dependencies = [ "ethereum", "ethereum-types", - "evm 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", + "evm", "fc-db", "fc-rpc-core", "fp-rpc", @@ -2437,13 +2388,13 @@ dependencies = [ "sc-service", "sc-transaction-pool", "sc-transaction-pool-api", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-block-builder", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-storage", "substrate-prometheus-endpoint", "tokio", ] @@ -2596,22 +2547,9 @@ source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v dependencies = [ "ethereum", "parity-scale-codec 3.1.5", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", -] - -[[package]] -name = "fp-evm" -version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" -dependencies = [ - "evm 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "impl-trait-for-tuples", - "parity-scale-codec 3.1.5", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -2619,22 +2557,13 @@ name = "fp-evm" version = "3.0.0-dev" source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ - "evm 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "evm", + "frame-support", "impl-trait-for-tuples", "parity-scale-codec 3.1.5", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", -] - -[[package]] -name = "fp-evm-mapping" -version = "0.1.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" -dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-core", + "sp-std", ] [[package]] @@ -2642,8 +2571,8 @@ name = "fp-evm-mapping" version = "0.1.0" source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "sp-core", ] [[package]] @@ -2653,14 +2582,14 @@ source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v dependencies = [ "ethereum", "ethereum-types", - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "fp-evm", "parity-scale-codec 3.1.5", "scale-info", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -2669,14 +2598,14 @@ version = "1.0.0-dev" source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "ethereum", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", "parity-scale-codec 3.1.5", "parity-util-mem", "scale-info", "serde", - "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-debug-derive", + "sp-io", + "sp-runtime", ] [[package]] @@ -2687,48 +2616,26 @@ dependencies = [ "parity-scale-codec 3.1.5", ] -[[package]] -name = "frame-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "linregress", - "log", - "parity-scale-codec 3.1.5", - "paste", - "scale-info", - "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", -] - [[package]] name = "frame-benchmarking" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "linregress", "log", "parity-scale-codec 3.1.5", "paste", "scale-info", "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-application-crypto", + "sp-io", + "sp-runtime", + "sp-runtime-interface", + "sp-std", + "sp-storage", ] [[package]] @@ -2740,9 +2647,9 @@ dependencies = [ "chrono", "clap", "comfy-table", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "gethostname", "handlebars", "hash-db", @@ -2766,17 +2673,17 @@ dependencies = [ "serde", "serde_json", "serde_nanos", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-database", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-externalities", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "sp-state-machine", + "sp-storage", + "sp-trie", "tempfile", "thiserror", "thousands", @@ -2799,14 +2706,14 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "frame-election-provider-solution-type", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic", "sp-npos-elections", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", ] [[package]] @@ -2814,15 +2721,15 @@ name = "frame-executive" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", ] [[package]] @@ -2837,36 +2744,6 @@ dependencies = [ "serde", ] -[[package]] -name = "frame-support" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "bitflags", - "frame-metadata", - "frame-support-procedural 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "impl-trait-for-tuples", - "k256", - "log", - "once_cell", - "parity-scale-codec 3.1.5", - "paste", - "scale-info", - "serde", - "smallvec", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-core-hashing-proc-macro 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "tt-call", -] - [[package]] name = "frame-support" version = "4.0.0-dev" @@ -2874,7 +2751,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "bitflags", "frame-metadata", - "frame-support-procedural 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support-procedural", "impl-trait-for-tuples", "k256", "log", @@ -2884,50 +2761,26 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core-hashing-proc-macro 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic", + "sp-core", + "sp-core-hashing-proc-macro", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-state-machine", + "sp-std", + "sp-tracing", "tt-call", ] -[[package]] -name = "frame-support-procedural" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "Inflector", - "frame-support-procedural-tools 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "frame-support-procedural" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "Inflector", - "frame-support-procedural-tools 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "frame-support-procedural-tools" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "frame-support-procedural-tools-derive 3.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "proc-macro-crate", + "frame-support-procedural-tools", "proc-macro2", "quote", "syn", @@ -2938,23 +2791,13 @@ name = "frame-support-procedural-tools" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support-procedural-tools-derive 3.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support-procedural-tools-derive", "proc-macro-crate", "proc-macro2", "quote", "syn", ] -[[package]] -name = "frame-support-procedural-tools-derive" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" @@ -2965,38 +2808,21 @@ dependencies = [ "syn", ] -[[package]] -name = "frame-system" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", -] - [[package]] name = "frame-system" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", "log", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-version", ] [[package]] @@ -3004,14 +2830,14 @@ name = "frame-system-benchmarking" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -3020,7 +2846,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", ] [[package]] @@ -3028,10 +2854,10 @@ name = "frame-try-runtime" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "sp-api", + "sp-runtime", + "sp-std", ] [[package]] @@ -3909,11 +3735,11 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017 dependencies = [ "beefy-primitives", "bitvec 1.0.1", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-election-provider-support", "frame-executive", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", @@ -3924,7 +3750,7 @@ dependencies = [ "pallet-authorship", "pallet-babe", "pallet-bags-list", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances", "pallet-bounties", "pallet-child-bounties", "pallet-collective", @@ -3953,7 +3779,7 @@ dependencies = [ "pallet-society", "pallet-staking", "pallet-staking-reward-fn", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp", "pallet-tips", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", @@ -3971,23 +3797,23 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-arithmetic", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-io", "sp-mmr-primitives", "sp-npos-elections", "sp-offchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "sp-session", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking", + "sp-std", "sp-transaction-pool", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version", "static_assertions", "substrate-wasm-builder", "xcm", @@ -4000,11 +3826,11 @@ name = "kusama-runtime-constants" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", "polkadot-primitives", "polkadot-runtime-common", "smallvec", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", ] [[package]] @@ -5311,13 +5137,13 @@ dependencies = [ "cumulus-primitives-utility", "derivative", "evm-coder", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "fp-evm-mapping", "fp-rpc", "fp-self-contained", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-executive", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", @@ -5326,12 +5152,12 @@ dependencies = [ "orml-vesting", "pallet-app-promotion", "pallet-aura", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances", "pallet-base-fee", "pallet-common", "pallet-configuration", "pallet-ethereum", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-evm-contract-helpers", "pallet-evm-migration", @@ -5339,14 +5165,14 @@ dependencies = [ "pallet-fungible", "pallet-inflation", "pallet-nonfungible", - "pallet-randomness-collective-flip 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-randomness-collective-flip", "pallet-refungible", "pallet-rmrk-core", "pallet-rmrk-equip", "pallet-structure", "pallet-sudo", "pallet-template-transaction-payment", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", @@ -5360,19 +5186,19 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-arithmetic", "sp-block-builder", "sp-consensus-aura", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-io", "sp-offchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "sp-session", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std", "sp-transaction-pool", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version", "substrate-wasm-builder", "up-common", "up-data-structs", @@ -5445,14 +5271,14 @@ name = "orml-vesting" version = "0.4.1-dev" source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -5474,20 +5300,20 @@ dependencies = [ name = "pallet-app-promotion" version = "0.1.0" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24)", - "pallet-randomness-collective-flip 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-balances", + "pallet-evm", + "pallet-randomness-collective-flip", + "pallet-timestamp", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -5495,15 +5321,15 @@ name = "pallet-aura" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", + "pallet-timestamp", "parity-scale-codec 3.1.5", "scale-info", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto", "sp-consensus-aura", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", ] [[package]] @@ -5511,15 +5337,15 @@ name = "pallet-authority-discovery" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "pallet-session", "parity-scale-codec 3.1.5", "scale-info", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto", "sp-authority-discovery", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", ] [[package]] @@ -5527,14 +5353,14 @@ name = "pallet-authorship" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "impl-trait-for-tuples", "parity-scale-codec 3.1.5", "scale-info", "sp-authorship", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", ] [[package]] @@ -5542,23 +5368,23 @@ name = "pallet-babe" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "pallet-authorship", "pallet-session", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp", "parity-scale-codec 3.1.5", "scale-info", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto", "sp-consensus-babe", "sp-consensus-vrf", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io", + "sp-runtime", "sp-session", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking", + "sp-std", ] [[package]] @@ -5566,34 +5392,19 @@ name = "pallet-bags-list" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-election-provider-support", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "log", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", -] - -[[package]] -name = "pallet-balances" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "frame-support", + "frame-system", "log", + "pallet-balances", "parity-scale-codec 3.1.5", "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", ] [[package]] @@ -5601,14 +5412,14 @@ name = "pallet-balances" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", ] [[package]] @@ -5616,14 +5427,14 @@ name = "pallet-base-fee" version = "1.0.0" source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "fp-evm", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", ] [[package]] @@ -5632,14 +5443,14 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "beefy-primitives", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "pallet-session", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", ] [[package]] @@ -5649,8 +5460,8 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "beefy-merkle-tree", "beefy-primitives", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "hex", "log", "pallet-beefy", @@ -5659,10 +5470,10 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -5670,17 +5481,17 @@ name = "pallet-bounties" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "pallet-treasury", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -5688,18 +5499,18 @@ name = "pallet-child-bounties" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "pallet-bounties", "pallet-treasury", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -5707,16 +5518,16 @@ name = "pallet-collective" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -5725,18 +5536,18 @@ version = "0.1.8" dependencies = [ "ethereum", "evm-coder", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "fp-evm-mapping", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-evm", "pallet-evm-coder-substrate", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-std", "up-data-structs", ] @@ -5744,16 +5555,16 @@ dependencies = [ name = "pallet-configuration" version = "0.1.1" dependencies = [ - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "fp-evm", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", "smallvec", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -5761,15 +5572,15 @@ name = "pallet-democracy" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -5777,20 +5588,20 @@ name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-election-provider-support", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "log", "parity-scale-codec 3.1.5", "rand 0.7.3", "scale-info", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic", + "sp-core", + "sp-io", "sp-npos-elections", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", "static_assertions", "strum", ] @@ -5800,12 +5611,12 @@ name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-election-provider-support", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system", "parity-scale-codec 3.1.5", "sp-npos-elections", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", ] [[package]] @@ -5813,17 +5624,17 @@ name = "pallet-elections-phragmen" version = "5.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", "sp-npos-elections", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", ] [[package]] @@ -5833,51 +5644,26 @@ source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v dependencies = [ "ethereum", "ethereum-types", - "evm 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", + "evm", "fp-consensus", - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "fp-evm", + "fp-evm-mapping", "fp-rpc", "fp-self-contained", "fp-storage", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "log", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-evm", + "pallet-timestamp", "parity-scale-codec 3.1.5", "rlp", "scale-info", "serde", "sha3 0.10.2", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", -] - -[[package]] -name = "pallet-evm" -version = "6.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24#b1941ba0e691e4a95b414343fd89aceb94c4172b" -dependencies = [ - "evm 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.24)", - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24)", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.24)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "hex", - "impl-trait-for-tuples", - "log", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "parity-scale-codec 3.1.5", - "primitive-types", - "rlp", - "scale-info", - "sha3 0.10.2", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -5885,26 +5671,26 @@ name = "pallet-evm" version = "6.0.0-dev" source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ - "evm 0.35.0 (git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27)", - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "evm", + "fp-evm", + "fp-evm-mapping", + "frame-benchmarking", + "frame-support", + "frame-system", "hex", "impl-trait-for-tuples", "log", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp", "parity-scale-codec 3.1.5", "primitive-types", "rlp", "scale-info", "serde", "sha3 0.10.2", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -5913,15 +5699,15 @@ version = "0.1.3" dependencies = [ "ethereum", "evm-coder", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "pallet-ethereum", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-std", "up-data-structs", ] @@ -5930,18 +5716,18 @@ name = "pallet-evm-contract-helpers" version = "0.2.0" dependencies = [ "evm-coder", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "fp-evm-mapping", + "frame-support", + "frame-system", "log", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "pallet-evm-coder-substrate", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-std", "up-data-structs", "up-sponsorship", ] @@ -5950,35 +5736,35 @@ dependencies = [ name = "pallet-evm-migration" version = "0.1.1" dependencies = [ - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "fp-evm", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-evm", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] name = "pallet-evm-transaction-payment" version = "0.1.1" dependencies = [ - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "fp-evm", + "fp-evm-mapping", + "frame-support", + "frame-system", "pallet-ethereum", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", "up-sponsorship", ] @@ -5988,18 +5774,18 @@ version = "0.1.5" dependencies = [ "ethereum", "evm-coder", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-structure", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-std", "up-data-structs", ] @@ -6008,14 +5794,14 @@ name = "pallet-gilt" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic", + "sp-runtime", + "sp-std", ] [[package]] @@ -6023,22 +5809,22 @@ name = "pallet-grandpa" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "pallet-authorship", "pallet-session", "parity-scale-codec 3.1.5", "scale-info", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto", + "sp-core", "sp-finality-grandpa", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io", + "sp-runtime", "sp-session", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking", + "sp-std", ] [[package]] @@ -6047,14 +5833,14 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "enumflags2", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -6062,19 +5848,19 @@ name = "pallet-im-online" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "pallet-authorship", "parity-scale-codec 3.1.5", "scale-info", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", ] [[package]] @@ -6082,35 +5868,35 @@ name = "pallet-indices" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", "sp-keyring", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", ] [[package]] name = "pallet-inflation" version = "0.1.1" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "pallet-randomness-collective-flip 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-balances", + "pallet-randomness-collective-flip", + "pallet-timestamp", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -6118,16 +5904,16 @@ name = "pallet-membership" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -6136,16 +5922,16 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "ckb-merkle-mountain-range", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", "sp-mmr-primitives", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", ] [[package]] @@ -6156,11 +5942,11 @@ dependencies = [ "jsonrpsee", "parity-scale-codec 3.1.5", "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-mmr-primitives", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", ] [[package]] @@ -6168,14 +5954,14 @@ name = "pallet-multisig" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -6183,16 +5969,16 @@ name = "pallet-nomination-pools" version = "1.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", ] [[package]] @@ -6200,18 +5986,18 @@ name = "pallet-nomination-pools-benchmarking" version = "1.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-election-provider-support", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "pallet-bags-list", "pallet-nomination-pools", "pallet-staking", "parity-scale-codec 3.1.5", "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-staking", + "sp-std", ] [[package]] @@ -6220,8 +6006,8 @@ version = "1.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-std", ] [[package]] @@ -6230,18 +6016,18 @@ version = "0.1.5" dependencies = [ "ethereum", "evm-coder", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-structure", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-std", "struct-versioning", "up-data-structs", ] @@ -6251,16 +6037,16 @@ name = "pallet-offences" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "log", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-staking", + "sp-std", ] [[package]] @@ -6268,12 +6054,12 @@ name = "pallet-offences-benchmarking" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-election-provider-support", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "pallet-babe", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances", "pallet-grandpa", "pallet-im-online", "pallet-offences", @@ -6281,9 +6067,9 @@ dependencies = [ "pallet-staking", "parity-scale-codec 3.1.5", "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-staking", + "sp-std", ] [[package]] @@ -6291,15 +6077,15 @@ name = "pallet-preimage" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -6307,28 +6093,14 @@ name = "pallet-proxy" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", -] - -[[package]] -name = "pallet-randomness-collective-flip" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", - "safe-mix", "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -6336,13 +6108,13 @@ name = "pallet-randomness-collective-flip" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "safe-mix", "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", ] [[package]] @@ -6350,14 +6122,14 @@ name = "pallet-recovery" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -6367,18 +6139,18 @@ dependencies = [ "derivative", "ethereum", "evm-coder", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-structure", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-std", "struct-versioning", "up-data-structs", ] @@ -6388,19 +6160,19 @@ name = "pallet-rmrk-core" version = "0.1.2" dependencies = [ "derivative", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "pallet-nonfungible", "pallet-structure", "parity-scale-codec 3.1.5", "rmrk-traits", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-std", "up-data-structs", ] @@ -6408,19 +6180,19 @@ dependencies = [ name = "pallet-rmrk-equip" version = "0.1.2" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "pallet-nonfungible", "pallet-rmrk-core", "parity-scale-codec 3.1.5", "rmrk-traits", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-std", "up-data-structs", ] @@ -6429,15 +6201,15 @@ name = "pallet-scheduler" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -6445,20 +6217,20 @@ name = "pallet-session" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", "sp-session", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking", + "sp-std", + "sp-trie", ] [[package]] @@ -6466,15 +6238,15 @@ name = "pallet-session-benchmarking" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "pallet-session", "pallet-staking", "rand 0.7.3", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "sp-session", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std", ] [[package]] @@ -6482,13 +6254,13 @@ name = "pallet-society" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "rand_chacha 0.2.2", "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", ] [[package]] @@ -6496,10 +6268,10 @@ name = "pallet-staking" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-election-provider-support", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "log", "pallet-authorship", "pallet-session", @@ -6507,11 +6279,11 @@ dependencies = [ "rand_chacha 0.2.2", "scale-info", "serde", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", ] [[package]] @@ -6531,21 +6303,21 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "log", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic", ] [[package]] name = "pallet-structure" version = "0.1.2" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "parity-scale-codec 3.1.5", "scale-info", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std", "up-data-structs", ] @@ -6554,13 +6326,13 @@ name = "pallet-sudo" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -6568,54 +6340,37 @@ name = "pallet-template-transaction-payment" version = "3.0.0" source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-balances", "pallet-transaction-payment", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", "up-sponsorship", ] -[[package]] -name = "pallet-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", -] - [[package]] name = "pallet-timestamp" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-std", + "sp-timestamp", ] [[package]] @@ -6623,18 +6378,18 @@ name = "pallet-tips" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "pallet-treasury", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -6642,15 +6397,15 @@ name = "pallet-transaction-payment" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -6661,11 +6416,11 @@ dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec 3.1.5", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-rpc", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", ] [[package]] @@ -6675,8 +6430,8 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "pallet-transaction-payment", "parity-scale-codec 3.1.5", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-runtime", ] [[package]] @@ -6684,16 +6439,16 @@ name = "pallet-treasury" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "impl-trait-for-tuples", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", ] [[package]] @@ -6702,21 +6457,21 @@ version = "0.1.3" dependencies = [ "ethereum", "evm-coder", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-nonfungible", "pallet-refungible", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", "up-data-structs", ] @@ -6724,17 +6479,17 @@ dependencies = [ name = "pallet-unique-scheduler" version = "0.1.1" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", "substrate-test-utils", "up-sponsorship", ] @@ -6744,15 +6499,15 @@ name = "pallet-utility" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -6760,14 +6515,14 @@ name = "pallet-vesting" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", ] [[package]] @@ -6775,15 +6530,15 @@ name = "pallet-xcm" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "log", "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-std", "xcm", "xcm-executor", ] @@ -6793,14 +6548,14 @@ name = "pallet-xcm-benchmarks" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", "xcm", "xcm-executor", ] @@ -6811,8 +6566,8 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" dependencies = [ "cumulus-primitives-core", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "parity-scale-codec 3.1.5", "scale-info", "serde", @@ -7179,8 +6934,8 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "rand 0.8.5", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-keystore", "thiserror", "tracing-gum", ] @@ -7224,9 +6979,9 @@ dependencies = [ "sc-service", "sc-sysinfo", "sc-tracing", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-keyring", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie", "substrate-build-script-utils", "thiserror", "try-runtime-cli", @@ -7238,9 +6993,9 @@ version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "beefy-primitives", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-benchmarking-cli", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system", "frame-system-rpc-runtime-api", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", @@ -7253,22 +7008,22 @@ dependencies = [ "sc-consensus", "sc-executor", "sc-service", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-authority-discovery", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-finality-grandpa", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents", "sp-keyring", "sp-mmr-primitives", "sp-offchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "sp-session", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-storage", + "sp-timestamp", "sp-transaction-pool", ] @@ -7286,9 +7041,9 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-keystore", + "sp-runtime", "thiserror", "tracing-gum", ] @@ -7301,9 +7056,9 @@ dependencies = [ "parity-scale-codec 3.1.5", "parity-util-mem", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -7323,8 +7078,8 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "sc-network", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto", + "sp-keystore", "thiserror", "tracing-gum", ] @@ -7338,8 +7093,8 @@ dependencies = [ "polkadot-node-primitives", "polkadot-primitives", "reed-solomon-novelpoly", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-trie", "thiserror", ] @@ -7357,9 +7112,9 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "sc-network", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto", + "sp-core", + "sp-keystore", "tracing-gum", ] @@ -7398,7 +7153,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-maybe-compressed-blob", "thiserror", "tracing-gum", @@ -7425,10 +7180,10 @@ dependencies = [ "polkadot-primitives", "sc-keystore", "schnorrkel", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto", "sp-consensus", "sp-consensus-slots", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "thiserror", "tracing-gum", ] @@ -7467,7 +7222,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "polkadot-statement-table", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore", "thiserror", "tracing-gum", ] @@ -7481,7 +7236,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore", "thiserror", "tracing-gum", "wasm-timer", @@ -7567,8 +7322,8 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-primitives", "sp-blockchain", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents", + "sp-runtime", "thiserror", "tracing-gum", ] @@ -7613,12 +7368,12 @@ dependencies = [ "sc-executor-common", "sc-executor-wasmtime", "slotmap", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-externalities", + "sp-io", "sp-maybe-compressed-blob", - "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-tracing", + "sp-wasm-interface", "tempfile", "tracing-gum", ] @@ -7634,7 +7389,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-primitives", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore", "thiserror", "tracing-gum", ] @@ -7669,7 +7424,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-primitives", "sc-network", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "thiserror", ] @@ -7725,11 +7480,11 @@ dependencies = [ "polkadot-primitives", "schnorrkel", "serde", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto", "sp-consensus-babe", "sp-consensus-vrf", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-keystore", "sp-maybe-compressed-blob", "thiserror", "zstd", @@ -7761,7 +7516,7 @@ dependencies = [ "polkadot-statement-table", "sc-network", "smallvec", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-authority-discovery", "sp-consensus-babe", "substrate-prometheus-endpoint", @@ -7794,9 +7549,9 @@ dependencies = [ "polkadot-primitives", "prioritized-metered-channel", "rand 0.8.5", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto", + "sp-core", + "sp-keystore", "thiserror", "tracing-gum", ] @@ -7819,8 +7574,8 @@ dependencies = [ "polkadot-node-subsystem-types", "polkadot-primitives", "sc-client-api", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-core", "tracing-gum", ] @@ -7830,15 +7585,15 @@ version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "derive_more", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", "parity-scale-codec 3.1.5", "parity-util-mem", "polkadot-core-primitives", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -7862,7 +7617,7 @@ version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ "bitvec 1.0.1", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-system", "hex-literal", "parity-scale-codec 3.1.5", "parity-util-mem", @@ -7870,20 +7625,20 @@ dependencies = [ "polkadot-parachain", "scale-info", "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", "sp-authority-discovery", "sp-consensus-slots", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-staking", + "sp-std", + "sp-trie", + "sp-version", ] [[package]] @@ -7907,13 +7662,13 @@ dependencies = [ "sc-rpc", "sc-sync-state-rpc", "sc-transaction-pool-api", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore", + "sp-runtime", "substrate-frame-rpc-system", "substrate-state-trie-migration-rpc", ] @@ -7925,11 +7680,11 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017 dependencies = [ "beefy-primitives", "bitvec 1.0.1", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-election-provider-support", "frame-executive", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", @@ -7939,7 +7694,7 @@ dependencies = [ "pallet-authorship", "pallet-babe", "pallet-bags-list", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances", "pallet-bounties", "pallet-child-bounties", "pallet-collective", @@ -7962,7 +7717,7 @@ dependencies = [ "pallet-session-benchmarking", "pallet-staking", "pallet-staking-reward-curve", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp", "pallet-tips", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", @@ -7980,22 +7735,22 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-io", "sp-mmr-primitives", "sp-npos-elections", "sp-offchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "sp-session", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking", + "sp-std", "sp-transaction-pool", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version", "static_assertions", "substrate-wasm-builder", "xcm", @@ -8010,22 +7765,22 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017 dependencies = [ "beefy-primitives", "bitvec 1.0.1", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-election-provider-support", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "impl-trait-for-tuples", "libsecp256k1", "log", "pallet-authorship", "pallet-babe", "pallet-bags-list", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances", "pallet-beefy-mmr", "pallet-election-provider-multi-phase", "pallet-session", "pallet-staking", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp", "pallet-transaction-payment", "pallet-treasury", "pallet-vesting", @@ -8037,15 +7792,15 @@ dependencies = [ "serde", "serde_derive", "slot-range-helper", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-core", + "sp-inherents", + "sp-io", "sp-npos-elections", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "sp-session", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking", + "sp-std", "static_assertions", "xcm", ] @@ -8055,11 +7810,11 @@ name = "polkadot-runtime-constants" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", "polkadot-primitives", "polkadot-runtime-common", "smallvec", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", ] [[package]] @@ -8070,8 +7825,8 @@ dependencies = [ "bs58", "parity-scale-codec 3.1.5", "polkadot-primitives", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std", + "sp-tracing", ] [[package]] @@ -8082,17 +7837,17 @@ dependencies = [ "bitflags", "bitvec 1.0.1", "derive_more", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "pallet-authority-discovery", "pallet-authorship", "pallet-babe", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances", "pallet-session", "pallet-staking", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp", "pallet-vesting", "parity-scale-codec 3.1.5", "polkadot-primitives", @@ -8102,16 +7857,16 @@ dependencies = [ "rustc-hex", "scale-info", "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", "sp-session", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking", + "sp-std", "static_assertions", "xcm", "xcm-executor", @@ -8195,25 +7950,25 @@ dependencies = [ "sc-transaction-pool", "serde", "serde_json", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-authority-discovery", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-finality-grandpa", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents", + "sp-io", + "sp-keystore", "sp-offchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "sp-session", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine", + "sp-storage", + "sp-timestamp", "sp-transaction-pool", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie", "substrate-prometheus-endpoint", "thiserror", "tracing-gum", @@ -8235,8 +7990,8 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore", + "sp-staking", "thiserror", "tracing-gum", ] @@ -8248,7 +8003,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017 dependencies = [ "parity-scale-codec 3.1.5", "polkadot-primitives", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", ] [[package]] @@ -8260,14 +8015,14 @@ dependencies = [ "bitvec 1.0.1", "frame-election-provider-support", "frame-executive", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "frame-system-rpc-runtime-api", "log", "pallet-authority-discovery", "pallet-authorship", "pallet-babe", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances", "pallet-grandpa", "pallet-indices", "pallet-offences", @@ -8275,7 +8030,7 @@ dependencies = [ "pallet-staking", "pallet-staking-reward-curve", "pallet-sudo", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-vesting", @@ -8290,21 +8045,21 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-io", "sp-mmr-primitives", "sp-offchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "sp-session", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking", + "sp-std", "sp-transaction-pool", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version", "substrate-wasm-builder", "test-runtime-constants", "xcm", @@ -8317,11 +8072,11 @@ name = "polkadot-test-service" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-system", "futures 0.3.23", "hex", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances", "pallet-staking", "pallet-transaction-payment", "polkadot-node-primitives", @@ -8347,17 +8102,17 @@ dependencies = [ "sc-service", "sc-tracing", "sc-transaction-pool", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic", "sp-authority-discovery", "sp-blockchain", "sp-consensus", "sp-consensus-babe", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-finality-grandpa", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents", "sp-keyring", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-state-machine", "substrate-test-client", "tempfile", "test-runtime-constants", @@ -8608,13 +8363,13 @@ dependencies = [ "cumulus-primitives-utility", "derivative", "evm-coder", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "fp-evm-mapping", "fp-rpc", "fp-self-contained", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-executive", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", @@ -8622,12 +8377,12 @@ dependencies = [ "log", "orml-vesting", "pallet-aura", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances", "pallet-base-fee", "pallet-common", "pallet-configuration", "pallet-ethereum", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-evm-contract-helpers", "pallet-evm-migration", @@ -8635,14 +8390,14 @@ dependencies = [ "pallet-fungible", "pallet-inflation", "pallet-nonfungible", - "pallet-randomness-collective-flip 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-randomness-collective-flip", "pallet-refungible", "pallet-rmrk-core", "pallet-rmrk-equip", "pallet-structure", "pallet-sudo", "pallet-template-transaction-payment", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", @@ -8656,19 +8411,19 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-arithmetic", "sp-block-builder", "sp-consensus-aura", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-io", "sp-offchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "sp-session", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std", "sp-transaction-pool", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version", "substrate-wasm-builder", "up-common", "up-data-structs", @@ -8961,10 +8716,10 @@ dependencies = [ "parity-scale-codec 3.1.5", "serde", "serde_json", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-version", ] [[package]] @@ -9046,10 +8801,10 @@ dependencies = [ "parity-scale-codec 2.3.1", "rmrk-traits", "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -9078,10 +8833,10 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017 dependencies = [ "beefy-merkle-tree", "beefy-primitives", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-executive", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "hex-literal", @@ -9089,7 +8844,7 @@ dependencies = [ "pallet-authority-discovery", "pallet-authorship", "pallet-babe", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances", "pallet-beefy", "pallet-beefy-mmr", "pallet-collective", @@ -9104,7 +8859,7 @@ dependencies = [ "pallet-session", "pallet-staking", "pallet-sudo", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-utility", @@ -9119,21 +8874,21 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-io", "sp-mmr-primitives", "sp-offchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "sp-session", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking", + "sp-std", "sp-transaction-pool", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version", "substrate-wasm-builder", "xcm", "xcm-builder", @@ -9145,11 +8900,11 @@ name = "rococo-runtime-constants" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", "polkadot-primitives", "polkadot-runtime-common", "smallvec", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", ] [[package]] @@ -9330,8 +9085,8 @@ version = "4.1.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "log", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-wasm-interface", "thiserror", ] @@ -9352,12 +9107,12 @@ dependencies = [ "rand 0.7.3", "sc-client-api", "sc-network", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-authority-discovery", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-keystore", + "sp-runtime", "substrate-prometheus-endpoint", "thiserror", ] @@ -9376,12 +9131,12 @@ dependencies = [ "sc-proposer-metrics", "sc-telemetry", "sc-transaction-pool-api", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-runtime", "substrate-prometheus-endpoint", ] @@ -9392,13 +9147,13 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "parity-scale-codec 3.1.5", "sc-client-api", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-block-builder", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", ] [[package]] @@ -9414,8 +9169,8 @@ dependencies = [ "sc-telemetry", "serde", "serde_json", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", ] [[package]] @@ -9457,12 +9212,12 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-keyring", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-panic-handler 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore", + "sp-panic-handler", + "sp-runtime", + "sp-version", "thiserror", "tiny-bip39", "tokio", @@ -9482,17 +9237,17 @@ dependencies = [ "sc-executor", "sc-transaction-pool-api", "sc-utils", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-database", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-externalities", + "sp-keystore", + "sp-runtime", + "sp-state-machine", + "sp-storage", + "sp-trie", "substrate-prometheus-endpoint", ] @@ -9512,13 +9267,13 @@ dependencies = [ "parking_lot 0.12.1", "sc-client-api", "sc-state-db", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-database", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-state-machine", + "sp-trie", ] [[package]] @@ -9535,12 +9290,12 @@ dependencies = [ "sc-client-api", "sc-utils", "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-state-machine", "substrate-prometheus-endpoint", "thiserror", ] @@ -9559,17 +9314,17 @@ dependencies = [ "sc-consensus", "sc-consensus-slots", "sc-telemetry", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-application-crypto", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", "sp-consensus-slots", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", "substrate-prometheus-endpoint", "thiserror", ] @@ -9599,20 +9354,20 @@ dependencies = [ "sc-telemetry", "schnorrkel", "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-application-crypto", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", "sp-consensus-slots", "sp-consensus-vrf", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-version", "substrate-prometheus-endpoint", "thiserror", ] @@ -9628,14 +9383,14 @@ dependencies = [ "sc-consensus-epochs", "sc-rpc-api", "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-application-crypto", "sp-blockchain", "sp-consensus", "sp-consensus-babe", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-keystore", + "sp-runtime", "thiserror", ] @@ -9649,7 +9404,7 @@ dependencies = [ "sc-client-api", "sc-consensus", "sp-blockchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", ] [[package]] @@ -9671,17 +9426,17 @@ dependencies = [ "sc-transaction-pool", "sc-transaction-pool-api", "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", "sp-consensus", "sp-consensus-aura", "sp-consensus-babe", "sp-consensus-slots", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "sp-timestamp", "substrate-prometheus-endpoint", "thiserror", ] @@ -9699,15 +9454,15 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-telemetry", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic", "sp-blockchain", "sp-consensus", "sp-consensus-slots", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "sp-timestamp", "thiserror", ] @@ -9718,7 +9473,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "sc-client-api", "sp-authorship", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "thiserror", ] @@ -9734,17 +9489,17 @@ dependencies = [ "sc-executor-common", "sc-executor-wasmi", "sc-executor-wasmtime", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core-hashing-proc-macro 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-panic-handler 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-core", + "sp-core-hashing-proc-macro", + "sp-externalities", + "sp-io", + "sp-panic-handler", + "sp-runtime-interface", "sp-tasks", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie", + "sp-version", + "sp-wasm-interface", "tracing", "wasmi", ] @@ -9760,7 +9515,7 @@ dependencies = [ "sp-maybe-compressed-blob", "sp-sandbox", "sp-serializer", - "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-wasm-interface", "thiserror", "wasm-instrument", "wasmi", @@ -9775,9 +9530,9 @@ dependencies = [ "parity-scale-codec 3.1.5", "sc-allocator", "sc-executor-common", - "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime-interface", "sp-sandbox", - "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-wasm-interface", "wasmi", ] @@ -9795,9 +9550,9 @@ dependencies = [ "rustix 0.35.7", "sc-allocator", "sc-executor-common", - "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime-interface", "sp-sandbox", - "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-wasm-interface", "wasmtime", ] @@ -9829,15 +9584,15 @@ dependencies = [ "sc-telemetry", "sc-utils", "serde_json", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", "sp-blockchain", "sp-consensus", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-finality-grandpa", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore", + "sp-runtime", "substrate-prometheus-endpoint", "thiserror", ] @@ -9858,8 +9613,8 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", "thiserror", ] @@ -9877,7 +9632,7 @@ dependencies = [ "sc-network", "sc-transaction-pool-api", "sp-blockchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", ] [[package]] @@ -9889,9 +9644,9 @@ dependencies = [ "hex", "parking_lot 0.12.1", "serde_json", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-application-crypto", + "sp-core", + "sp-keystore", "thiserror", ] @@ -9932,11 +9687,11 @@ dependencies = [ "serde", "serde_json", "smallvec", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic", "sp-blockchain", "sp-consensus", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", "substrate-prometheus-endpoint", "thiserror", "unsigned-varint", @@ -9959,7 +9714,7 @@ dependencies = [ "smallvec", "sp-consensus", "sp-finality-grandpa", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", ] [[package]] @@ -9974,7 +9729,7 @@ dependencies = [ "log", "lru 0.7.8", "sc-network", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "substrate-prometheus-endpoint", "tracing", ] @@ -9994,8 +9749,8 @@ dependencies = [ "sc-network-common", "sc-peerset", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", "thiserror", ] @@ -10017,12 +9772,12 @@ dependencies = [ "sc-network-common", "sc-peerset", "smallvec", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic", "sp-blockchain", "sp-consensus", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-finality-grandpa", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "thiserror", ] @@ -10046,10 +9801,10 @@ dependencies = [ "sc-client-api", "sc-network", "sc-utils", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-core", "sp-offchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "threadpool", "tracing", ] @@ -10095,15 +9850,15 @@ dependencies = [ "sc-transaction-pool-api", "sc-utils", "serde_json", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-keystore", "sp-offchain", "sp-rpc", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "sp-session", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version", ] [[package]] @@ -10121,11 +9876,11 @@ dependencies = [ "scale-info", "serde", "serde_json", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-rpc", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-tracing", + "sp-version", "thiserror", ] @@ -10183,24 +9938,24 @@ dependencies = [ "sc-utils", "serde", "serde_json", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-application-crypto", "sp-block-builder", "sp-blockchain", "sp-consensus", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-externalities", + "sp-inherents", + "sp-keystore", + "sp-runtime", "sp-session", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-state-machine", + "sp-storage", + "sp-tracing", "sp-transaction-pool", "sp-transaction-storage-proof", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie", + "sp-version", "substrate-prometheus-endpoint", "tempfile", "thiserror", @@ -10220,7 +9975,7 @@ dependencies = [ "parity-util-mem-derive", "parking_lot 0.12.1", "sc-client-api", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", ] [[package]] @@ -10238,7 +9993,7 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "thiserror", ] @@ -10256,9 +10011,9 @@ dependencies = [ "sc-telemetry", "serde", "serde_json", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-std", ] [[package]] @@ -10298,12 +10053,12 @@ dependencies = [ "sc-rpc-server", "sc-tracing-proc-macro", "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-rpc", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-tracing", "thiserror", "tracing", "tracing-log", @@ -10338,11 +10093,11 @@ dependencies = [ "sc-transaction-pool-api", "sc-utils", "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-tracing", "sp-transaction-pool", "substrate-prometheus-endpoint", "thiserror", @@ -10357,7 +10112,7 @@ dependencies = [ "log", "serde", "sp-blockchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "thiserror", ] @@ -10456,31 +10211,13 @@ dependencies = [ "zeroize", ] -[[package]] -name = "secp256k1" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c42e6f1735c5f00f51e43e28d6634141f2bcad10931b2609ddd74a86d751260" -dependencies = [ - "secp256k1-sys 0.4.2", -] - [[package]] name = "secp256k1" version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7649a0b3ffb32636e60c7ce0d70511eda9c52c658cd0634e194d5a19943aeff" dependencies = [ - "secp256k1-sys 0.6.0", -] - -[[package]] -name = "secp256k1-sys" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957da2573cde917463ece3570eab4a0b3f19de6f1646cde62e6fd3868f566036" -dependencies = [ - "cc", + "secp256k1-sys", ] [[package]] @@ -10758,8 +10495,8 @@ dependencies = [ "enumn", "parity-scale-codec 3.1.5", "paste", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-std", ] [[package]] @@ -10826,23 +10563,6 @@ dependencies = [ "sha-1 0.9.8", ] -[[package]] -name = "sp-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "hash-db", - "log", - "parity-scale-codec 3.1.5", - "sp-api-proc-macro 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "thiserror", -] - [[package]] name = "sp-api" version = "4.0.0-dev" @@ -10851,27 +10571,15 @@ dependencies = [ "hash-db", "log", "parity-scale-codec 3.1.5", - "sp-api-proc-macro 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api-proc-macro", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-version", "thiserror", ] -[[package]] -name = "sp-api-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "blake2", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" @@ -10884,19 +10592,6 @@ dependencies = [ "syn", ] -[[package]] -name = "sp-application-crypto" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", -] - [[package]] name = "sp-application-crypto" version = "6.0.0" @@ -10905,24 +10600,9 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", -] - -[[package]] -name = "sp-arithmetic" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "integer-sqrt", - "num-traits", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "static_assertions", + "sp-core", + "sp-io", + "sp-std", ] [[package]] @@ -10935,8 +10615,8 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-debug-derive", + "sp-std", "static_assertions", ] @@ -10947,10 +10627,10 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "parity-scale-codec 3.1.5", "scale-info", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-application-crypto", + "sp-runtime", + "sp-std", ] [[package]] @@ -10960,9 +10640,9 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "async-trait", "parity-scale-codec 3.1.5", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents", + "sp-runtime", + "sp-std", ] [[package]] @@ -10971,10 +10651,10 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-inherents", + "sp-runtime", + "sp-std", ] [[package]] @@ -10987,11 +10667,11 @@ dependencies = [ "lru 0.7.8", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-consensus", "sp-database", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", + "sp-state-machine", "thiserror", ] @@ -11005,12 +10685,12 @@ dependencies = [ "futures-timer", "log", "parity-scale-codec 3.1.5", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-version", "thiserror", ] @@ -11022,14 +10702,14 @@ dependencies = [ "async-trait", "parity-scale-codec 3.1.5", "scale-info", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-application-crypto", "sp-consensus", "sp-consensus-slots", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents", + "sp-runtime", + "sp-std", + "sp-timestamp", ] [[package]] @@ -11042,17 +10722,17 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-application-crypto", "sp-consensus", "sp-consensus-slots", "sp-consensus-vrf", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "sp-std", + "sp-timestamp", ] [[package]] @@ -11063,10 +10743,10 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic", + "sp-runtime", + "sp-std", + "sp-timestamp", ] [[package]] @@ -11077,55 +10757,9 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "schnorrkel", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", -] - -[[package]] -name = "sp-core" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "base58", - "bitflags", - "blake2-rfc", - "byteorder", - "dyn-clonable", - "ed25519-dalek", - "futures 0.3.23", - "hash-db", - "hash256-std-hasher", - "hex", - "impl-serde", - "lazy_static", - "libsecp256k1", - "log", - "merlin", - "num-traits", - "parity-scale-codec 3.1.5", - "parity-util-mem", - "parking_lot 0.12.1", - "primitive-types", - "rand 0.7.3", - "regex", - "scale-info", - "schnorrkel", - "secp256k1 0.21.3", - "secrecy", - "serde", - "sp-core-hashing 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "ss58-registry", - "substrate-bip39", - "thiserror", - "tiny-bip39", - "wasmi", - "zeroize", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -11157,15 +10791,15 @@ dependencies = [ "regex", "scale-info", "schnorrkel", - "secp256k1 0.24.0", + "secp256k1", "secrecy", "serde", - "sp-core-hashing 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core-hashing", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", "ss58-registry", "substrate-bip39", "thiserror", @@ -11174,20 +10808,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "sp-core-hashing" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "blake2", - "byteorder", - "digest 0.10.3", - "sha2 0.10.2", - "sha3 0.10.2", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "twox-hash", -] - [[package]] name = "sp-core-hashing" version = "4.0.0" @@ -11198,21 +10818,10 @@ dependencies = [ "digest 0.10.3", "sha2 0.10.2", "sha3 0.10.2", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std", "twox-hash", ] -[[package]] -name = "sp-core-hashing-proc-macro" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "proc-macro2", - "quote", - "sp-core-hashing 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "syn", -] - [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" @@ -11220,7 +10829,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "proc-macro2", "quote", - "sp-core-hashing 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core-hashing", "syn", ] @@ -11233,16 +10842,6 @@ dependencies = [ "parking_lot 0.12.1", ] -[[package]] -name = "sp-debug-derive" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "sp-debug-derive" version = "4.0.0" @@ -11253,17 +10852,6 @@ dependencies = [ "syn", ] -[[package]] -name = "sp-externalities" -version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "environmental", - "parity-scale-codec 3.1.5", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", -] - [[package]] name = "sp-externalities" version = "0.12.0" @@ -11271,8 +10859,8 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "environmental", "parity-scale-codec 3.1.5", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std", + "sp-storage", ] [[package]] @@ -11285,26 +10873,12 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", -] - -[[package]] -name = "sp-inherents" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "async-trait", - "impl-trait-for-tuples", - "parity-scale-codec 3.1.5", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "thiserror", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "sp-runtime", + "sp-std", ] [[package]] @@ -11315,37 +10889,12 @@ dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec 3.1.5", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-std", "thiserror", ] -[[package]] -name = "sp-io" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "futures 0.3.23", - "hash-db", - "libsecp256k1", - "log", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "secp256k1 0.21.3", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "tracing", - "tracing-core", -] - [[package]] name = "sp-io" version = "6.0.0" @@ -11357,16 +10906,16 @@ dependencies = [ "log", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", - "secp256k1 0.24.0", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "secp256k1", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-trie", + "sp-wasm-interface", "tracing", "tracing-core", ] @@ -11377,27 +10926,11 @@ version = "6.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "lazy_static", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", "strum", ] -[[package]] -name = "sp-keystore" -version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "async-trait", - "futures 0.3.23", - "merlin", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "schnorrkel", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "thiserror", -] - [[package]] name = "sp-keystore" version = "0.12.0" @@ -11410,8 +10943,8 @@ dependencies = [ "parking_lot 0.12.1", "schnorrkel", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-externalities", "thiserror", ] @@ -11432,11 +10965,11 @@ dependencies = [ "log", "parity-scale-codec 3.1.5", "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-core", + "sp-debug-derive", + "sp-runtime", + "sp-std", ] [[package]] @@ -11447,10 +10980,10 @@ dependencies = [ "parity-scale-codec 3.1.5", "scale-info", "serde", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -11458,19 +10991,9 @@ name = "sp-offchain" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", -] - -[[package]] -name = "sp-panic-handler" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "backtrace", - "lazy_static", - "regex", + "sp-api", + "sp-core", + "sp-runtime", ] [[package]] @@ -11490,29 +11013,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "rustc-hash", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", -] - -[[package]] -name = "sp-runtime" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "parity-scale-codec 3.1.5", - "parity-util-mem", - "paste", - "rand 0.7.3", - "scale-info", - "serde", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-core", ] [[package]] @@ -11530,28 +11031,11 @@ dependencies = [ "rand 0.7.3", "scale-info", "serde", - "sp-application-crypto 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", -] - -[[package]] -name = "sp-runtime-interface" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec 3.1.5", - "primitive-types", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-runtime-interface-proc-macro 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "static_assertions", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-std", ] [[package]] @@ -11562,27 +11046,15 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec 3.1.5", "primitive-types", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime-interface-proc-macro 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-tracing 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", "static_assertions", ] -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "Inflector", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" @@ -11602,10 +11074,10 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "log", "parity-scale-codec 3.1.5", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-wasm-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-std", + "sp-wasm-interface", "wasmi", ] @@ -11625,22 +11097,11 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "parity-scale-codec 3.1.5", "scale-info", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", -] - -[[package]] -name = "sp-staking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "parity-scale-codec 3.1.5", - "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", + "sp-api", + "sp-core", + "sp-runtime", + "sp-staking", + "sp-std", ] [[package]] @@ -11650,30 +11111,8 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8e dependencies = [ "parity-scale-codec 3.1.5", "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", -] - -[[package]] -name = "sp-state-machine" -version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "hash-db", - "log", - "num-traits", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "rand 0.7.3", - "smallvec", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-panic-handler 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "thiserror", - "tracing", - "trie-root", + "sp-runtime", + "sp-std", ] [[package]] @@ -11688,39 +11127,21 @@ dependencies = [ "parking_lot 0.12.1", "rand 0.7.3", "smallvec", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-panic-handler 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-std", + "sp-trie", "thiserror", "tracing", "trie-root", ] -[[package]] -name = "sp-std" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" - [[package]] name = "sp-std" version = "4.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -[[package]] -name = "sp-storage" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "impl-serde", - "parity-scale-codec 3.1.5", - "ref-cast", - "serde", - "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", -] - [[package]] name = "sp-storage" version = "6.0.0" @@ -11730,8 +11151,8 @@ dependencies = [ "parity-scale-codec 3.1.5", "ref-cast", "serde", - "sp-debug-derive 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-debug-derive", + "sp-std", ] [[package]] @@ -11740,27 +11161,11 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "log", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime-interface 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", -] - -[[package]] -name = "sp-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "async-trait", - "futures-timer", - "log", - "parity-scale-codec 3.1.5", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "thiserror", + "sp-core", + "sp-externalities", + "sp-io", + "sp-runtime-interface", + "sp-std", ] [[package]] @@ -11772,32 +11177,20 @@ dependencies = [ "futures-timer", "log", "parity-scale-codec 3.1.5", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-inherents", + "sp-runtime", + "sp-std", "thiserror", ] -[[package]] -name = "sp-tracing" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "parity-scale-codec 3.1.5", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "tracing", - "tracing-core", - "tracing-subscriber", -] - [[package]] name = "sp-tracing" version = "5.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ "parity-scale-codec 3.1.5", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std", "tracing", "tracing-core", "tracing-subscriber", @@ -11808,8 +11201,8 @@ name = "sp-transaction-pool" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" dependencies = [ - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-runtime", ] [[package]] @@ -11821,27 +11214,11 @@ dependencies = [ "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", -] - -[[package]] -name = "sp-trie" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "hash-db", - "memory-db", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "thiserror", - "trie-db", - "trie-root", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-std", + "sp-trie", ] [[package]] @@ -11853,30 +11230,13 @@ dependencies = [ "memory-db", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-std", "thiserror", "trie-db", "trie-root", ] -[[package]] -name = "sp-version" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "impl-serde", - "parity-scale-codec 3.1.5", - "parity-wasm 0.42.2", - "scale-info", - "serde", - "sp-core-hashing-proc-macro 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "sp-version-proc-macro 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "thiserror", -] - [[package]] name = "sp-version" version = "5.0.0" @@ -11887,24 +11247,13 @@ dependencies = [ "parity-wasm 0.42.2", "scale-info", "serde", - "sp-core-hashing-proc-macro 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-version-proc-macro 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core-hashing-proc-macro", + "sp-runtime", + "sp-std", + "sp-version-proc-macro", "thiserror", ] -[[package]] -name = "sp-version-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "parity-scale-codec 3.1.5", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" @@ -11916,18 +11265,6 @@ dependencies = [ "syn", ] -[[package]] -name = "sp-wasm-interface" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f60ab8cce7e2ece3ce0c1b10799b4eab28" -dependencies = [ - "impl-trait-for-tuples", - "log", - "parity-scale-codec 3.1.5", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.24)", - "wasmi", -] - [[package]] name = "sp-wasm-interface" version = "6.0.0" @@ -11936,7 +11273,7 @@ dependencies = [ "impl-trait-for-tuples", "log", "parity-scale-codec 3.1.5", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std", "wasmi", "wasmtime", ] @@ -12083,11 +11420,11 @@ dependencies = [ "sc-rpc-api", "sc-transaction-pool-api", "serde_json", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-block-builder", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", ] [[package]] @@ -12115,12 +11452,12 @@ dependencies = [ "sc-rpc-api", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", "trie-db", ] @@ -12143,11 +11480,11 @@ dependencies = [ "serde_json", "sp-blockchain", "sp-consensus", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-keyring", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-keystore", + "sp-runtime", + "sp-state-machine", ] [[package]] @@ -12278,11 +11615,11 @@ name = "test-runtime-constants" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", "polkadot-primitives", "polkadot-runtime-common", "smallvec", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", ] [[package]] @@ -12290,27 +11627,27 @@ name = "tests" version = "0.1.1" dependencies = [ "evm-coder", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "fp-evm-mapping", + "frame-support", + "frame-system", + "pallet-balances", "pallet-common", "pallet-ethereum", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-fungible", "pallet-nonfungible", "pallet-refungible", "pallet-structure", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp", "pallet-transaction-payment", "pallet-unique", "parity-scale-codec 3.1.5", "scale-info", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", "up-data-structs", "up-sponsorship", ] @@ -12751,13 +12088,13 @@ dependencies = [ "sc-executor", "sc-service", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-externalities 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-state-machine 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-externalities", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-state-machine", + "sp-version", "zstd", ] @@ -12792,14 +12129,14 @@ dependencies = [ "anyhow", "jsonrpsee", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "parity-scale-codec 3.1.5", "rmrk-rpc", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-blockchain", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-rpc", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "up-data-structs", "up-rpc", ] @@ -12887,7 +12224,7 @@ dependencies = [ "fc-rpc-core", "flexi_logger", "fp-rpc", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-benchmarking-cli", "futures 0.3.23", "jsonrpsee", @@ -12925,21 +12262,21 @@ dependencies = [ "sc-transaction-pool", "serde", "serde_json", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-finality-grandpa", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-keystore 0.12.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-inherents", + "sp-keystore", "sp-offchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "sp-session", - "sp-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-timestamp", "sp-transaction-pool", - "sp-trie 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-trie", "substrate-build-script-utils", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", @@ -12982,16 +12319,16 @@ dependencies = [ "sc-service", "sc-transaction-pool", "serde", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", "sp-offchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "sp-session", - "sp-storage 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-storage", "sp-transaction-pool", "substrate-frame-rpc-system", "tokio", @@ -13015,13 +12352,13 @@ dependencies = [ "cumulus-primitives-utility", "derivative", "evm-coder", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "fp-evm-mapping", "fp-rpc", "fp-self-contained", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-executive", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", @@ -13029,12 +12366,12 @@ dependencies = [ "log", "orml-vesting", "pallet-aura", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances", "pallet-base-fee", "pallet-common", "pallet-configuration", "pallet-ethereum", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-evm-contract-helpers", "pallet-evm-migration", @@ -13042,14 +12379,14 @@ dependencies = [ "pallet-fungible", "pallet-inflation", "pallet-nonfungible", - "pallet-randomness-collective-flip 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-randomness-collective-flip", "pallet-refungible", "pallet-rmrk-core", "pallet-rmrk-equip", "pallet-structure", "pallet-sudo", "pallet-template-transaction-payment", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", @@ -13063,19 +12400,19 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-arithmetic", "sp-block-builder", "sp-consensus-aura", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-io", "sp-offchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "sp-session", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-std", "sp-transaction-pool", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version", "substrate-wasm-builder", "up-common", "up-data-structs", @@ -13119,12 +12456,12 @@ name = "up-common" version = "0.9.27" dependencies = [ "fp-rpc", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "frame-support", + "pallet-evm", "sp-consensus-aura", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -13132,16 +12469,16 @@ name = "up-data-structs" version = "0.2.2" dependencies = [ "derivative", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "frame-support", + "frame-system", + "pallet-evm", "parity-scale-codec 3.1.5", "rmrk-traits", "scale-info", "serde", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-runtime", + "sp-std", "struct-versioning", ] @@ -13150,12 +12487,12 @@ name = "up-rpc" version = "0.1.3" dependencies = [ "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "parity-scale-codec 3.1.5", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", + "sp-core", + "sp-runtime", + "sp-std", "up-data-structs", ] @@ -13606,11 +12943,11 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017 dependencies = [ "beefy-primitives", "bitvec 1.0.1", - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", "frame-election-provider-support", "frame-executive", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", @@ -13620,7 +12957,7 @@ dependencies = [ "pallet-authorship", "pallet-babe", "pallet-bags-list", - "pallet-balances 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-balances", "pallet-collective", "pallet-democracy", "pallet-election-provider-multi-phase", @@ -13647,7 +12984,7 @@ dependencies = [ "pallet-staking", "pallet-staking-reward-curve", "pallet-sudo", - "pallet-timestamp 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", @@ -13665,22 +13002,22 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "sp-api 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-api", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-inherents 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-core", + "sp-inherents", + "sp-io", "sp-mmr-primitives", "sp-npos-elections", "sp-offchain", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "sp-session", - "sp-staking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-staking", + "sp-std", "sp-transaction-pool", - "sp-version 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-version", "substrate-wasm-builder", "westend-runtime-constants", "xcm", @@ -13693,11 +13030,11 @@ name = "westend-runtime-constants" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", "polkadot-primitives", "polkadot-runtime-common", "smallvec", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", ] [[package]] @@ -13879,7 +13216,7 @@ dependencies = [ "log", "parity-scale-codec 3.1.5", "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-runtime", "xcm-procedural", ] @@ -13888,17 +13225,17 @@ name = "xcm-builder" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-system 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-support", + "frame-system", "log", "pallet-transaction-payment", "parity-scale-codec 3.1.5", "polkadot-parachain", "scale-info", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic", + "sp-io", + "sp-runtime", + "sp-std", "xcm", "xcm-executor", ] @@ -13908,16 +13245,16 @@ name = "xcm-executor" version = "0.9.27" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" dependencies = [ - "frame-benchmarking 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "frame-support 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", "impl-trait-for-tuples", "log", "parity-scale-codec 3.1.5", - "sp-arithmetic 5.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-core 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-io 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-runtime 6.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", - "sp-std 4.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27)", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", "xcm", ] diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index af69fd6b63..1b15b01dd9 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -243,7 +243,7 @@ pub trait UniqueApi { collection_id: CollectionId, token_id: TokenId, at: Option, - ) -> Result>; + ) -> Result>; /// Returns the total amount of staked tokens. #[method(name = "unique_totalStaked")] @@ -258,18 +258,25 @@ pub trait UniqueApi { at: Option, ) -> Result>; - /// Return the total amount locked by staking tokens. + /// Returns the total amount locked by staking tokens. #[method(name = "unique_totalStakingLocked")] fn total_staking_locked(&self, staker: CrossAccountId, at: Option) -> Result; - /// Return the total amount locked by staking tokens. + /// Returns the total amount of tokens pending withdrawal from staking. #[method(name = "unique_pendingUnstake")] fn pending_unstake( &self, staker: Option, at: Option, ) -> Result; + /// Returns the total amount of tokens pending withdrawal from staking per block. + #[method(name = "unique_pendingUnstakePerBlock")] + fn pending_unstake_per_block( + &self, + staker: CrossAccountId, + at: Option, + ) -> Result>; } mod rmrk_unique_rpc { @@ -557,6 +564,11 @@ where .collect::>(), unique_api); pass_method!(total_staking_locked(staker: CrossAccountId) -> String => |v| v.to_string(), unique_api); pass_method!(pending_unstake(staker: Option) -> String => |v| v.to_string(), unique_api); + pass_method!(pending_unstake_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, String)> => + |v| v + .into_iter() + .map(|(b, a)| (b, a.to_string())) + .collect::>(), unique_api); } #[allow(deprecated)] diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index a124b0d123..11c6f947a0 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -47,37 +47,37 @@ version = '3.1.2' default-features = false optional = true git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.27" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.27" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.27" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.27" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.27" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.27" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.27" [dependencies.serde] default-features = false @@ -87,22 +87,22 @@ version = '1.0.130' [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.27" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.27" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.24" +branch = "polkadot-v0.9.27" [dependencies.pallet-evm] default-features = false git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.24" +branch = "unique-polkadot-v0.9.27" [dependencies] scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 57d88dd7e5..237211c356 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -117,6 +117,7 @@ pub mod pallet { QueryKind = ValueQuery, >; + /// Amount of tokens pending unstake per user per block. #[pallet::storage] pub type PendingUnstake = StorageNMap< Key = ( @@ -142,8 +143,13 @@ pub mod pallet { fn on_initialize(current_block: T::BlockNumber) -> Weight where ::BlockNumber: From, - // <::Currency as Currency>::Balance: Sum, { + let mut consumed_weight = 0; + let mut add_weight = |reads, writes, weight| { + consumed_weight += T::DbWeight::get().reads_writes(reads, writes); + consumed_weight += weight; + }; + PendingUnstake::::iter() .filter_map(|((staker, block), amount)| { if block <= current_block { @@ -161,19 +167,22 @@ pub mod pallet { if next_interest_block != 0.into() && current_block >= next_interest_block { let mut acc = >::default(); - let mut weight: Weight = 0; + NextInterestBlock::::set(current_block + DAY.into()); + add_weight(0, 1, 0); + Staked::::iter() .filter(|((_, block), _)| *block + DAY.into() <= current_block) .for_each(|((staker, block), amount)| { Self::recalculate_stake(&staker, block, amount, &mut acc); - // weight += recalculate_stake(); + add_weight(0, 0, T::WeightInfo::recalculate_stake()); }); >::get() .checked_add(&acc) .map(|res| >::set(res)); + add_weight(0, 1, 0); }; - 0 + consumed_weight } } @@ -519,4 +528,14 @@ where PendingUnstake::::iter_prefix_values((s.as_sub(),)).sum() }) } + + pub fn cross_id_pending_unstake_per_block( + staker: T::CrossAccountId, + ) -> Vec<(T::BlockNumber, BalanceOf)> { + let mut unsorted_res = PendingUnstake::::iter_prefix((staker.as_sub(),)) + .into_iter() + .collect::>(); + unsorted_res.sort_by_key(|(block, _)| *block); + unsorted_res + } } diff --git a/primitives/rpc/src/lib.rs b/primitives/rpc/src/lib.rs index b4e0111225..d23493cf9f 100644 --- a/primitives/rpc/src/lib.rs +++ b/primitives/rpc/src/lib.rs @@ -125,10 +125,13 @@ sp_api::decl_runtime_apis! { /// Get total pieces of token. fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Result>; + fn token_owners(collection: CollectionId, token: TokenId) -> Result>; fn total_staked(staker: Option) -> Result; fn total_staked_per_block(staker: CrossAccountId) -> Result>; fn total_staking_locked(staker: CrossAccountId) -> Result; fn pending_unstake(staker: Option) -> Result; + fn pending_unstake_per_block(staker: CrossAccountId) -> Result>; + } } diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index 023617ec4b..bec32e1393 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -203,6 +203,10 @@ macro_rules! impl_common_runtime_apis { fn pending_unstake(staker: Option) -> Result { Ok(>::cross_id_pending_unstake(staker)) } + + fn pending_unstake_per_block(staker: CrossAccountId) -> Result, DispatchError> { + Ok(>::cross_id_pending_unstake_per_block(staker)) + } } impl rmrk_rpc::RmrkApi< diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 69d78a57b9..7638ff65ef 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -122,22 +122,35 @@ describe('integration test: AppPromotion', () => { }); }); - it.skip('for different accounts in one block is possible', async () => { + it('for different accounts in one block is possible', async () => { // arrange: Alice, Bob, Charlie, Dave balance = 1000 // arrange: Alice, Bob, Charlie, Dave calls appPromotion.stake(100) in the same time // assert: query appPromotion.staked(Alice/Bob/Charlie/Dave) equal [100] await usingPlaygrounds(async helper => { - const crowd = await creteAccounts([10n, 10n, 10n, 10n], alice, helper); - // const promises = crowd.map(async user => submitTransactionAsync(user, helper.api!.tx.promotion.stake(nominal))); - // await expect(Promise.all(promises)).to.be.eventually.fulfilled; + // const userOne = await createUser(); + // const userTwo = await createUser(); + // const userThree = await createUser(); + // const userFour = await createUser(); + const crowd = []; + for(let i = 4; i--;) crowd.push(await createUser()); + // const crowd = await creteAccounts([10n, 10n, 10n, 10n], alice, helper); + // const crowd = [userOne, userTwo, userThree, userFour]; + + + const promises = crowd.map(async user => submitTransactionAsync(user, helper.api!.tx.promotion.stake(nominal))); + await expect(Promise.all(promises)).to.be.eventually.fulfilled; + + for (let i = 0; i < crowd.length; i++){ + expect((await helper.api!.rpc.unique.totalStaked(normalizeAccountId(crowd[i]))).toBigInt()).to.be.equal(nominal); + } }); }); }); -describe.skip('unstake balance extrinsic', () => { - before(async function() { +describe('unstake balance extrinsic', () => { + before(async function () { await usingPlaygrounds(async (helper, privateKeyWrapper) => { if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); alice = privateKeyWrapper('//Alice'); @@ -148,6 +161,7 @@ describe.skip('unstake balance extrinsic', () => { await submitTransactionAsync(alice, tx); }); }); + it('will change balance state to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => { // arrange: Alice balance = 1000 // arrange: Alice calls appPromotion.stake(Alice, 500) @@ -157,9 +171,65 @@ describe.skip('unstake balance extrinsic', () => { // assert: query appPromotion.staked(Alice) equal [200] /// 500 - 300 // assert: query appPromotion.pendingUnstake(Alice) to equal [300] // assert: query appPromotion.totalStaked() decreased by 300 + await usingPlaygrounds(async helper => { + const totalStakedBefore = (await helper.api!.rpc.unique.totalStaked()).toBigInt(); + const staker = await createUser(); + await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(5n * nominal))).to.be.eventually.fulfilled; + await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.unstake(3n * nominal))).to.be.eventually.fulfilled; + expect((await helper.api!.rpc.unique.pendingUnstake(normalizeAccountId(staker.address))).toBigInt()).to.be.equal(3n * nominal); + expect((await helper.api!.rpc.unique.totalStaked(normalizeAccountId(staker))).toBigInt()).to.be.equal(2n * nominal); + expect((await helper.api!.rpc.unique.totalStaked()).toBigInt()).to.be.equal(totalStakedBefore + 2n * nominal); + }); }); -}); + it('will remove from the "staked" map starting from the oldest entry', async () => { + // arrange: Alice balance = 1000 + // arrange: Alice stakes 100 + // arrange: Alice stakes 200 + // arrange: Alice stakes 300 + + // assert Alice stake is [100, 200, 300] + + + // act: Alice calls appPromotion.unstake(30) + // assert: query appPromotion.staked(Alice) to equal [70, 200, 300] /// Can unstake part of stake + // assert: query appPromotion.pendingUnstake(Alice) to equal [30] + + // act: Alice calls appPromotion.unstake(170) + // assert: query appPromotion.staked(Alice) to equal [100, 300] /// Can unstake one stake totally and one more partialy + // assert: query appPromotion.pendingUnstake(Alice) to equal [30, 170] + // act: Alice calls appPromotion.unstake(400) + // assert: query appPromotion.staked(Alice) to equal [100, 300] /// Can totally unstake 2 stakes in one tx + // assert: query appPromotion.pendingUnstake(Alice) to equal [30, 170, 400] + await usingPlaygrounds(async helper => { + const totalStakedBefore = (await helper.api!.rpc.unique.totalStaked()).toBigInt(); + const staker = await createUser(); + await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(1n * nominal))).to.be.eventually.fulfilled; + await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(2n * nominal))).to.be.eventually.fulfilled; + await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(3n * nominal))).to.be.eventually.fulfilled; + let stakedPerBlock = (await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt()); + expect(stakedPerBlock).to.be.deep.equal([nominal, 2n * nominal, 3n * nominal]); + await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.unstake(3n * nominal / 10n))).to.be.eventually.fulfilled; + expect((await helper.api!.rpc.unique.pendingUnstake(normalizeAccountId(staker.address))).toBigInt()).to.be.equal(3n * nominal / 10n); + stakedPerBlock = (await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt()); + + expect(stakedPerBlock).to.be.deep.equal([7n * nominal / 10n, 2n * nominal, 3n * nominal]); + + await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.unstake(17n * nominal / 10n))).to.be.eventually.fulfilled; + stakedPerBlock = (await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt()); + expect(stakedPerBlock).to.be.deep.equal([nominal, 3n * nominal]); + const unstakedPerBlock = (await helper.api!.rpc.unique.pendingUnstakePerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt()); + + expect(unstakedPerBlock).to.be.deep.equal([3n * nominal / 10n, 17n * nominal / 10n]); + + await waitNewBlocks(helper.api!, 1); + await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.unstake(4n * nominal))).to.be.eventually.fulfilled; + expect((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt())).to.be.deep.equal([]); + expect((await helper.api!.rpc.unique.pendingUnstakePerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt())).to.be.deep.equal([3n * nominal / 10n, 17n * nominal / 10n, 4n * nominal]); + }); + + }); +}); async function createUser(amount?: bigint) { diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 753a5fc956..ef72ddbb71 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -462,6 +462,9 @@ declare module '@polkadot/api-base/types/storage' { * Next target block when interest is recalculated **/ nextInterestBlock: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Amount of tokens pending unstake per user per block. + **/ pendingUnstake: AugmentedQuery Observable, [AccountId32, u32]> & QueryableStorageEntry; /** * Amount of tokens staked by account in the blocknumber. diff --git a/tests/src/interfaces/augment-api-rpc.ts b/tests/src/interfaces/augment-api-rpc.ts index 539c5fa16c..3b71dca022 100644 --- a/tests/src/interfaces/augment-api-rpc.ts +++ b/tests/src/interfaces/augment-api-rpc.ts @@ -8,7 +8,7 @@ import '@polkadot/rpc-core/types/jsonrpc'; import type { PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsPartPartType, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionStats, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsRpcCollection, UpDataStructsTokenChild, UpDataStructsTokenData } from './default'; import type { AugmentedRpc } from '@polkadot/rpc-core/types'; import type { Metadata, StorageKey } from '@polkadot/types'; -import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, u128, u32, u64 } from '@polkadot/types-codec'; +import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, f64, u128, u32, u64 } from '@polkadot/types-codec'; import type { AnyNumber, Codec, ITuple } from '@polkadot/types-codec/types'; import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; import type { EpochAuthorship } from '@polkadot/types/interfaces/babe'; @@ -706,6 +706,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { * Returns the total amount of unstaked tokens **/ pendingUnstake: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; + /** + * Returns the total amount of unstaked tokens per block + **/ + pendingUnstakePerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>>; /** * Get property permissions, optionally limited to the provided keys **/ diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index 8685acd75a..e28267c02f 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 943a6ff6c5..28bcbd1dfb 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -5,7 +5,1265 @@ export default { /** - * Lookup2: polkadot_primitives::v2::PersistedValidationData + * Lookup3: frame_system::AccountInfo> + **/ + FrameSystemAccountInfo: { + nonce: 'u32', + consumers: 'u32', + providers: 'u32', + sufficients: 'u32', + data: 'PalletBalancesAccountData' + }, + /** + * Lookup5: pallet_balances::AccountData + **/ + PalletBalancesAccountData: { + free: 'u128', + reserved: 'u128', + miscFrozen: 'u128', + feeFrozen: 'u128' + }, + /** + * Lookup7: frame_support::weights::PerDispatchClass + **/ + FrameSupportWeightsPerDispatchClassU64: { + normal: 'u64', + operational: 'u64', + mandatory: 'u64' + }, + /** + * Lookup11: sp_runtime::generic::digest::Digest + **/ + SpRuntimeDigest: { + logs: 'Vec' + }, + /** + * Lookup13: sp_runtime::generic::digest::DigestItem + **/ + SpRuntimeDigestDigestItem: { + _enum: { + Other: 'Bytes', + __Unused1: 'Null', + __Unused2: 'Null', + __Unused3: 'Null', + Consensus: '([u8;4],Bytes)', + Seal: '([u8;4],Bytes)', + PreRuntime: '([u8;4],Bytes)', + __Unused7: 'Null', + RuntimeEnvironmentUpdated: 'Null' + } + }, + /** + * Lookup16: frame_system::EventRecord + **/ + FrameSystemEventRecord: { + phase: 'FrameSystemPhase', + event: 'Event', + topics: 'Vec' + }, + /** + * Lookup18: frame_system::pallet::Event + **/ + FrameSystemEvent: { + _enum: { + ExtrinsicSuccess: { + dispatchInfo: 'FrameSupportWeightsDispatchInfo', + }, + ExtrinsicFailed: { + dispatchError: 'SpRuntimeDispatchError', + dispatchInfo: 'FrameSupportWeightsDispatchInfo', + }, + CodeUpdated: 'Null', + NewAccount: { + account: 'AccountId32', + }, + KilledAccount: { + account: 'AccountId32', + }, + Remarked: { + _alias: { + hash_: 'hash', + }, + sender: 'AccountId32', + hash_: 'H256' + } + } + }, + /** + * Lookup19: frame_support::weights::DispatchInfo + **/ + FrameSupportWeightsDispatchInfo: { + weight: 'u64', + class: 'FrameSupportWeightsDispatchClass', + paysFee: 'FrameSupportWeightsPays' + }, + /** + * Lookup20: frame_support::weights::DispatchClass + **/ + FrameSupportWeightsDispatchClass: { + _enum: ['Normal', 'Operational', 'Mandatory'] + }, + /** + * Lookup21: frame_support::weights::Pays + **/ + FrameSupportWeightsPays: { + _enum: ['Yes', 'No'] + }, + /** + * Lookup22: sp_runtime::DispatchError + **/ + SpRuntimeDispatchError: { + _enum: { + Other: 'Null', + CannotLookup: 'Null', + BadOrigin: 'Null', + Module: 'SpRuntimeModuleError', + ConsumerRemaining: 'Null', + NoProviders: 'Null', + TooManyConsumers: 'Null', + Token: 'SpRuntimeTokenError', + Arithmetic: 'SpRuntimeArithmeticError', + Transactional: 'SpRuntimeTransactionalError' + } + }, + /** + * Lookup23: sp_runtime::ModuleError + **/ + SpRuntimeModuleError: { + index: 'u8', + error: '[u8;4]' + }, + /** + * Lookup24: sp_runtime::TokenError + **/ + SpRuntimeTokenError: { + _enum: ['NoFunds', 'WouldDie', 'BelowMinimum', 'CannotCreate', 'UnknownAsset', 'Frozen', 'Unsupported'] + }, + /** + * Lookup25: sp_runtime::ArithmeticError + **/ + SpRuntimeArithmeticError: { + _enum: ['Underflow', 'Overflow', 'DivisionByZero'] + }, + /** + * Lookup26: sp_runtime::TransactionalError + **/ + SpRuntimeTransactionalError: { + _enum: ['LimitReached', 'NoLayer'] + }, + /** + * Lookup27: cumulus_pallet_parachain_system::pallet::Event + **/ + CumulusPalletParachainSystemEvent: { + _enum: { + ValidationFunctionStored: 'Null', + ValidationFunctionApplied: { + relayChainBlockNum: 'u32', + }, + ValidationFunctionDiscarded: 'Null', + UpgradeAuthorized: { + codeHash: 'H256', + }, + DownwardMessagesReceived: { + count: 'u32', + }, + DownwardMessagesProcessed: { + weightUsed: 'u64', + dmqHead: 'H256' + } + } + }, + /** + * Lookup28: pallet_balances::pallet::Event + **/ + PalletBalancesEvent: { + _enum: { + Endowed: { + account: 'AccountId32', + freeBalance: 'u128', + }, + DustLost: { + account: 'AccountId32', + amount: 'u128', + }, + Transfer: { + from: 'AccountId32', + to: 'AccountId32', + amount: 'u128', + }, + BalanceSet: { + who: 'AccountId32', + free: 'u128', + reserved: 'u128', + }, + Reserved: { + who: 'AccountId32', + amount: 'u128', + }, + Unreserved: { + who: 'AccountId32', + amount: 'u128', + }, + ReserveRepatriated: { + from: 'AccountId32', + to: 'AccountId32', + amount: 'u128', + destinationStatus: 'FrameSupportTokensMiscBalanceStatus', + }, + Deposit: { + who: 'AccountId32', + amount: 'u128', + }, + Withdraw: { + who: 'AccountId32', + amount: 'u128', + }, + Slashed: { + who: 'AccountId32', + amount: 'u128' + } + } + }, + /** + * Lookup29: frame_support::traits::tokens::misc::BalanceStatus + **/ + FrameSupportTokensMiscBalanceStatus: { + _enum: ['Free', 'Reserved'] + }, + /** + * Lookup30: pallet_transaction_payment::pallet::Event + **/ + PalletTransactionPaymentEvent: { + _enum: { + TransactionFeePaid: { + who: 'AccountId32', + actualFee: 'u128', + tip: 'u128' + } + } + }, + /** + * Lookup31: pallet_treasury::pallet::Event + **/ + PalletTreasuryEvent: { + _enum: { + Proposed: { + proposalIndex: 'u32', + }, + Spending: { + budgetRemaining: 'u128', + }, + Awarded: { + proposalIndex: 'u32', + award: 'u128', + account: 'AccountId32', + }, + Rejected: { + proposalIndex: 'u32', + slashed: 'u128', + }, + Burnt: { + burntFunds: 'u128', + }, + Rollover: { + rolloverBalance: 'u128', + }, + Deposit: { + value: 'u128', + }, + SpendApproved: { + proposalIndex: 'u32', + amount: 'u128', + beneficiary: 'AccountId32' + } + } + }, + /** + * Lookup32: pallet_sudo::pallet::Event + **/ + PalletSudoEvent: { + _enum: { + Sudid: { + sudoResult: 'Result', + }, + KeyChanged: { + oldSudoer: 'Option', + }, + SudoAsDone: { + sudoResult: 'Result' + } + } + }, + /** + * Lookup36: orml_vesting::module::Event + **/ + OrmlVestingModuleEvent: { + _enum: { + VestingScheduleAdded: { + from: 'AccountId32', + to: 'AccountId32', + vestingSchedule: 'OrmlVestingVestingSchedule', + }, + Claimed: { + who: 'AccountId32', + amount: 'u128', + }, + VestingSchedulesUpdated: { + who: 'AccountId32' + } + } + }, + /** + * Lookup37: orml_vesting::VestingSchedule + **/ + OrmlVestingVestingSchedule: { + start: 'u32', + period: 'u32', + periodCount: 'u32', + perPeriod: 'Compact' + }, + /** + * Lookup39: cumulus_pallet_xcmp_queue::pallet::Event + **/ + CumulusPalletXcmpQueueEvent: { + _enum: { + Success: { + messageHash: 'Option', + weight: 'u64', + }, + Fail: { + messageHash: 'Option', + error: 'XcmV2TraitsError', + weight: 'u64', + }, + BadVersion: { + messageHash: 'Option', + }, + BadFormat: { + messageHash: 'Option', + }, + UpwardMessageSent: { + messageHash: 'Option', + }, + XcmpMessageSent: { + messageHash: 'Option', + }, + OverweightEnqueued: { + sender: 'u32', + sentAt: 'u32', + index: 'u64', + required: 'u64', + }, + OverweightServiced: { + index: 'u64', + used: 'u64' + } + } + }, + /** + * Lookup41: xcm::v2::traits::Error + **/ + XcmV2TraitsError: { + _enum: { + Overflow: 'Null', + Unimplemented: 'Null', + UntrustedReserveLocation: 'Null', + UntrustedTeleportLocation: 'Null', + MultiLocationFull: 'Null', + MultiLocationNotInvertible: 'Null', + BadOrigin: 'Null', + InvalidLocation: 'Null', + AssetNotFound: 'Null', + FailedToTransactAsset: 'Null', + NotWithdrawable: 'Null', + LocationCannotHold: 'Null', + ExceedsMaxMessageSize: 'Null', + DestinationUnsupported: 'Null', + Transport: 'Null', + Unroutable: 'Null', + UnknownClaim: 'Null', + FailedToDecode: 'Null', + MaxWeightInvalid: 'Null', + NotHoldingFees: 'Null', + TooExpensive: 'Null', + Trap: 'u64', + UnhandledXcmVersion: 'Null', + WeightLimitReached: 'u64', + Barrier: 'Null', + WeightNotComputable: 'Null' + } + }, + /** + * Lookup43: pallet_xcm::pallet::Event + **/ + PalletXcmEvent: { + _enum: { + Attempted: 'XcmV2TraitsOutcome', + Sent: '(XcmV1MultiLocation,XcmV1MultiLocation,XcmV2Xcm)', + UnexpectedResponse: '(XcmV1MultiLocation,u64)', + ResponseReady: '(u64,XcmV2Response)', + Notified: '(u64,u8,u8)', + NotifyOverweight: '(u64,u8,u8,u64,u64)', + NotifyDispatchError: '(u64,u8,u8)', + NotifyDecodeFailed: '(u64,u8,u8)', + InvalidResponder: '(XcmV1MultiLocation,u64,Option)', + InvalidResponderVersion: '(XcmV1MultiLocation,u64)', + ResponseTaken: 'u64', + AssetsTrapped: '(H256,XcmV1MultiLocation,XcmVersionedMultiAssets)', + VersionChangeNotified: '(XcmV1MultiLocation,u32)', + SupportedVersionChanged: '(XcmV1MultiLocation,u32)', + NotifyTargetSendFail: '(XcmV1MultiLocation,u64,XcmV2TraitsError)', + NotifyTargetMigrationFail: '(XcmVersionedMultiLocation,u64)' + } + }, + /** + * Lookup44: xcm::v2::traits::Outcome + **/ + XcmV2TraitsOutcome: { + _enum: { + Complete: 'u64', + Incomplete: '(u64,XcmV2TraitsError)', + Error: 'XcmV2TraitsError' + } + }, + /** + * Lookup45: xcm::v1::multilocation::MultiLocation + **/ + XcmV1MultiLocation: { + parents: 'u8', + interior: 'XcmV1MultilocationJunctions' + }, + /** + * Lookup46: xcm::v1::multilocation::Junctions + **/ + XcmV1MultilocationJunctions: { + _enum: { + Here: 'Null', + X1: 'XcmV1Junction', + X2: '(XcmV1Junction,XcmV1Junction)', + X3: '(XcmV1Junction,XcmV1Junction,XcmV1Junction)', + X4: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', + X5: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', + X6: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', + X7: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)', + X8: '(XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction,XcmV1Junction)' + } + }, + /** + * Lookup47: xcm::v1::junction::Junction + **/ + XcmV1Junction: { + _enum: { + Parachain: 'Compact', + AccountId32: { + network: 'XcmV0JunctionNetworkId', + id: '[u8;32]', + }, + AccountIndex64: { + network: 'XcmV0JunctionNetworkId', + index: 'Compact', + }, + AccountKey20: { + network: 'XcmV0JunctionNetworkId', + key: '[u8;20]', + }, + PalletInstance: 'u8', + GeneralIndex: 'Compact', + GeneralKey: 'Bytes', + OnlyChild: 'Null', + Plurality: { + id: 'XcmV0JunctionBodyId', + part: 'XcmV0JunctionBodyPart' + } + } + }, + /** + * Lookup49: xcm::v0::junction::NetworkId + **/ + XcmV0JunctionNetworkId: { + _enum: { + Any: 'Null', + Named: 'Bytes', + Polkadot: 'Null', + Kusama: 'Null' + } + }, + /** + * Lookup53: xcm::v0::junction::BodyId + **/ + XcmV0JunctionBodyId: { + _enum: { + Unit: 'Null', + Named: 'Bytes', + Index: 'Compact', + Executive: 'Null', + Technical: 'Null', + Legislative: 'Null', + Judicial: 'Null' + } + }, + /** + * Lookup54: xcm::v0::junction::BodyPart + **/ + XcmV0JunctionBodyPart: { + _enum: { + Voice: 'Null', + Members: { + count: 'Compact', + }, + Fraction: { + nom: 'Compact', + denom: 'Compact', + }, + AtLeastProportion: { + nom: 'Compact', + denom: 'Compact', + }, + MoreThanProportion: { + nom: 'Compact', + denom: 'Compact' + } + } + }, + /** + * Lookup55: xcm::v2::Xcm + **/ + XcmV2Xcm: 'Vec', + /** + * Lookup57: xcm::v2::Instruction + **/ + XcmV2Instruction: { + _enum: { + WithdrawAsset: 'XcmV1MultiassetMultiAssets', + ReserveAssetDeposited: 'XcmV1MultiassetMultiAssets', + ReceiveTeleportedAsset: 'XcmV1MultiassetMultiAssets', + QueryResponse: { + queryId: 'Compact', + response: 'XcmV2Response', + maxWeight: 'Compact', + }, + TransferAsset: { + assets: 'XcmV1MultiassetMultiAssets', + beneficiary: 'XcmV1MultiLocation', + }, + TransferReserveAsset: { + assets: 'XcmV1MultiassetMultiAssets', + dest: 'XcmV1MultiLocation', + xcm: 'XcmV2Xcm', + }, + Transact: { + originType: 'XcmV0OriginKind', + requireWeightAtMost: 'Compact', + call: 'XcmDoubleEncoded', + }, + HrmpNewChannelOpenRequest: { + sender: 'Compact', + maxMessageSize: 'Compact', + maxCapacity: 'Compact', + }, + HrmpChannelAccepted: { + recipient: 'Compact', + }, + HrmpChannelClosing: { + initiator: 'Compact', + sender: 'Compact', + recipient: 'Compact', + }, + ClearOrigin: 'Null', + DescendOrigin: 'XcmV1MultilocationJunctions', + ReportError: { + queryId: 'Compact', + dest: 'XcmV1MultiLocation', + maxResponseWeight: 'Compact', + }, + DepositAsset: { + assets: 'XcmV1MultiassetMultiAssetFilter', + maxAssets: 'Compact', + beneficiary: 'XcmV1MultiLocation', + }, + DepositReserveAsset: { + assets: 'XcmV1MultiassetMultiAssetFilter', + maxAssets: 'Compact', + dest: 'XcmV1MultiLocation', + xcm: 'XcmV2Xcm', + }, + ExchangeAsset: { + give: 'XcmV1MultiassetMultiAssetFilter', + receive: 'XcmV1MultiassetMultiAssets', + }, + InitiateReserveWithdraw: { + assets: 'XcmV1MultiassetMultiAssetFilter', + reserve: 'XcmV1MultiLocation', + xcm: 'XcmV2Xcm', + }, + InitiateTeleport: { + assets: 'XcmV1MultiassetMultiAssetFilter', + dest: 'XcmV1MultiLocation', + xcm: 'XcmV2Xcm', + }, + QueryHolding: { + queryId: 'Compact', + dest: 'XcmV1MultiLocation', + assets: 'XcmV1MultiassetMultiAssetFilter', + maxResponseWeight: 'Compact', + }, + BuyExecution: { + fees: 'XcmV1MultiAsset', + weightLimit: 'XcmV2WeightLimit', + }, + RefundSurplus: 'Null', + SetErrorHandler: 'XcmV2Xcm', + SetAppendix: 'XcmV2Xcm', + ClearError: 'Null', + ClaimAsset: { + assets: 'XcmV1MultiassetMultiAssets', + ticket: 'XcmV1MultiLocation', + }, + Trap: 'Compact', + SubscribeVersion: { + queryId: 'Compact', + maxResponseWeight: 'Compact', + }, + UnsubscribeVersion: 'Null' + } + }, + /** + * Lookup58: xcm::v1::multiasset::MultiAssets + **/ + XcmV1MultiassetMultiAssets: 'Vec', + /** + * Lookup60: xcm::v1::multiasset::MultiAsset + **/ + XcmV1MultiAsset: { + id: 'XcmV1MultiassetAssetId', + fun: 'XcmV1MultiassetFungibility' + }, + /** + * Lookup61: xcm::v1::multiasset::AssetId + **/ + XcmV1MultiassetAssetId: { + _enum: { + Concrete: 'XcmV1MultiLocation', + Abstract: 'Bytes' + } + }, + /** + * Lookup62: xcm::v1::multiasset::Fungibility + **/ + XcmV1MultiassetFungibility: { + _enum: { + Fungible: 'Compact', + NonFungible: 'XcmV1MultiassetAssetInstance' + } + }, + /** + * Lookup63: xcm::v1::multiasset::AssetInstance + **/ + XcmV1MultiassetAssetInstance: { + _enum: { + Undefined: 'Null', + Index: 'Compact', + Array4: '[u8;4]', + Array8: '[u8;8]', + Array16: '[u8;16]', + Array32: '[u8;32]', + Blob: 'Bytes' + } + }, + /** + * Lookup66: xcm::v2::Response + **/ + XcmV2Response: { + _enum: { + Null: 'Null', + Assets: 'XcmV1MultiassetMultiAssets', + ExecutionResult: 'Option<(u32,XcmV2TraitsError)>', + Version: 'u32' + } + }, + /** + * Lookup69: xcm::v0::OriginKind + **/ + XcmV0OriginKind: { + _enum: ['Native', 'SovereignAccount', 'Superuser', 'Xcm'] + }, + /** + * Lookup70: xcm::double_encoded::DoubleEncoded + **/ + XcmDoubleEncoded: { + encoded: 'Bytes' + }, + /** + * Lookup71: xcm::v1::multiasset::MultiAssetFilter + **/ + XcmV1MultiassetMultiAssetFilter: { + _enum: { + Definite: 'XcmV1MultiassetMultiAssets', + Wild: 'XcmV1MultiassetWildMultiAsset' + } + }, + /** + * Lookup72: xcm::v1::multiasset::WildMultiAsset + **/ + XcmV1MultiassetWildMultiAsset: { + _enum: { + All: 'Null', + AllOf: { + id: 'XcmV1MultiassetAssetId', + fun: 'XcmV1MultiassetWildFungibility' + } + } + }, + /** + * Lookup73: xcm::v1::multiasset::WildFungibility + **/ + XcmV1MultiassetWildFungibility: { + _enum: ['Fungible', 'NonFungible'] + }, + /** + * Lookup74: xcm::v2::WeightLimit + **/ + XcmV2WeightLimit: { + _enum: { + Unlimited: 'Null', + Limited: 'Compact' + } + }, + /** + * Lookup76: xcm::VersionedMultiAssets + **/ + XcmVersionedMultiAssets: { + _enum: { + V0: 'Vec', + V1: 'XcmV1MultiassetMultiAssets' + } + }, + /** + * Lookup78: xcm::v0::multi_asset::MultiAsset + **/ + XcmV0MultiAsset: { + _enum: { + None: 'Null', + All: 'Null', + AllFungible: 'Null', + AllNonFungible: 'Null', + AllAbstractFungible: { + id: 'Bytes', + }, + AllAbstractNonFungible: { + class: 'Bytes', + }, + AllConcreteFungible: { + id: 'XcmV0MultiLocation', + }, + AllConcreteNonFungible: { + class: 'XcmV0MultiLocation', + }, + AbstractFungible: { + id: 'Bytes', + amount: 'Compact', + }, + AbstractNonFungible: { + class: 'Bytes', + instance: 'XcmV1MultiassetAssetInstance', + }, + ConcreteFungible: { + id: 'XcmV0MultiLocation', + amount: 'Compact', + }, + ConcreteNonFungible: { + class: 'XcmV0MultiLocation', + instance: 'XcmV1MultiassetAssetInstance' + } + } + }, + /** + * Lookup79: xcm::v0::multi_location::MultiLocation + **/ + XcmV0MultiLocation: { + _enum: { + Null: 'Null', + X1: 'XcmV0Junction', + X2: '(XcmV0Junction,XcmV0Junction)', + X3: '(XcmV0Junction,XcmV0Junction,XcmV0Junction)', + X4: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', + X5: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', + X6: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', + X7: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)', + X8: '(XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction,XcmV0Junction)' + } + }, + /** + * Lookup80: xcm::v0::junction::Junction + **/ + XcmV0Junction: { + _enum: { + Parent: 'Null', + Parachain: 'Compact', + AccountId32: { + network: 'XcmV0JunctionNetworkId', + id: '[u8;32]', + }, + AccountIndex64: { + network: 'XcmV0JunctionNetworkId', + index: 'Compact', + }, + AccountKey20: { + network: 'XcmV0JunctionNetworkId', + key: '[u8;20]', + }, + PalletInstance: 'u8', + GeneralIndex: 'Compact', + GeneralKey: 'Bytes', + OnlyChild: 'Null', + Plurality: { + id: 'XcmV0JunctionBodyId', + part: 'XcmV0JunctionBodyPart' + } + } + }, + /** + * Lookup81: xcm::VersionedMultiLocation + **/ + XcmVersionedMultiLocation: { + _enum: { + V0: 'XcmV0MultiLocation', + V1: 'XcmV1MultiLocation' + } + }, + /** + * Lookup82: cumulus_pallet_xcm::pallet::Event + **/ + CumulusPalletXcmEvent: { + _enum: { + InvalidFormat: '[u8;8]', + UnsupportedVersion: '[u8;8]', + ExecutedDownward: '([u8;8],XcmV2TraitsOutcome)' + } + }, + /** + * Lookup83: cumulus_pallet_dmp_queue::pallet::Event + **/ + CumulusPalletDmpQueueEvent: { + _enum: { + InvalidFormat: { + messageId: '[u8;32]', + }, + UnsupportedVersion: { + messageId: '[u8;32]', + }, + ExecutedDownward: { + messageId: '[u8;32]', + outcome: 'XcmV2TraitsOutcome', + }, + WeightExhausted: { + messageId: '[u8;32]', + remainingWeight: 'u64', + requiredWeight: 'u64', + }, + OverweightEnqueued: { + messageId: '[u8;32]', + overweightIndex: 'u64', + requiredWeight: 'u64', + }, + OverweightServiced: { + overweightIndex: 'u64', + weightUsed: 'u64' + } + } + }, + /** + * Lookup84: pallet_unique::RawEvent> + **/ + PalletUniqueRawEvent: { + _enum: { + CollectionSponsorRemoved: 'u32', + CollectionAdminAdded: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', + CollectionOwnedChanged: '(u32,AccountId32)', + CollectionSponsorSet: '(u32,AccountId32)', + SponsorshipConfirmed: '(u32,AccountId32)', + CollectionAdminRemoved: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', + AllowListAddressRemoved: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', + AllowListAddressAdded: '(u32,PalletEvmAccountBasicCrossAccountIdRepr)', + CollectionLimitSet: 'u32', + CollectionPermissionSet: 'u32' + } + }, + /** + * Lookup85: pallet_evm::account::BasicCrossAccountIdRepr + **/ + PalletEvmAccountBasicCrossAccountIdRepr: { + _enum: { + Substrate: 'AccountId32', + Ethereum: 'H160' + } + }, + /** + * Lookup88: pallet_unique_scheduler::pallet::Event + **/ + PalletUniqueSchedulerEvent: { + _enum: { + Scheduled: { + when: 'u32', + index: 'u32', + }, + Canceled: { + when: 'u32', + index: 'u32', + }, + Dispatched: { + task: '(u32,u32)', + id: 'Option<[u8;16]>', + result: 'Result', + }, + CallLookupFailed: { + task: '(u32,u32)', + id: 'Option<[u8;16]>', + error: 'FrameSupportScheduleLookupError' + } + } + }, + /** + * Lookup91: frame_support::traits::schedule::LookupError + **/ + FrameSupportScheduleLookupError: { + _enum: ['Unknown', 'BadFormat'] + }, + /** + * Lookup92: pallet_common::pallet::Event + **/ + PalletCommonEvent: { + _enum: { + CollectionCreated: '(u32,u8,AccountId32)', + CollectionDestroyed: 'u32', + ItemCreated: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,u128)', + ItemDestroyed: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,u128)', + Transfer: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,PalletEvmAccountBasicCrossAccountIdRepr,u128)', + Approved: '(u32,u32,PalletEvmAccountBasicCrossAccountIdRepr,PalletEvmAccountBasicCrossAccountIdRepr,u128)', + CollectionPropertySet: '(u32,Bytes)', + CollectionPropertyDeleted: '(u32,Bytes)', + TokenPropertySet: '(u32,u32,Bytes)', + TokenPropertyDeleted: '(u32,u32,Bytes)', + PropertyPermissionSet: '(u32,Bytes)' + } + }, + /** + * Lookup95: pallet_structure::pallet::Event + **/ + PalletStructureEvent: { + _enum: { + Executed: 'Result' + } + }, + /** + * Lookup96: pallet_rmrk_core::pallet::Event + **/ + PalletRmrkCoreEvent: { + _enum: { + CollectionCreated: { + issuer: 'AccountId32', + collectionId: 'u32', + }, + CollectionDestroyed: { + issuer: 'AccountId32', + collectionId: 'u32', + }, + IssuerChanged: { + oldIssuer: 'AccountId32', + newIssuer: 'AccountId32', + collectionId: 'u32', + }, + CollectionLocked: { + issuer: 'AccountId32', + collectionId: 'u32', + }, + NftMinted: { + owner: 'AccountId32', + collectionId: 'u32', + nftId: 'u32', + }, + NFTBurned: { + owner: 'AccountId32', + nftId: 'u32', + }, + NFTSent: { + sender: 'AccountId32', + recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', + collectionId: 'u32', + nftId: 'u32', + approvalRequired: 'bool', + }, + NFTAccepted: { + sender: 'AccountId32', + recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', + collectionId: 'u32', + nftId: 'u32', + }, + NFTRejected: { + sender: 'AccountId32', + collectionId: 'u32', + nftId: 'u32', + }, + PropertySet: { + collectionId: 'u32', + maybeNftId: 'Option', + key: 'Bytes', + value: 'Bytes', + }, + ResourceAdded: { + nftId: 'u32', + resourceId: 'u32', + }, + ResourceRemoval: { + nftId: 'u32', + resourceId: 'u32', + }, + ResourceAccepted: { + nftId: 'u32', + resourceId: 'u32', + }, + ResourceRemovalAccepted: { + nftId: 'u32', + resourceId: 'u32', + }, + PrioritySet: { + collectionId: 'u32', + nftId: 'u32' + } + } + }, + /** + * Lookup97: rmrk_traits::nft::AccountIdOrCollectionNftTuple + **/ + RmrkTraitsNftAccountIdOrCollectionNftTuple: { + _enum: { + AccountId: 'AccountId32', + CollectionAndNftTuple: '(u32,u32)' + } + }, + /** + * Lookup102: pallet_rmrk_equip::pallet::Event + **/ + PalletRmrkEquipEvent: { + _enum: { + BaseCreated: { + issuer: 'AccountId32', + baseId: 'u32', + }, + EquippablesUpdated: { + baseId: 'u32', + slotId: 'u32' + } + } + }, + /** + * Lookup103: pallet_evm::pallet::Event + **/ + PalletEvmEvent: { + _enum: { + Log: 'EthereumLog', + Created: 'H160', + CreatedFailed: 'H160', + Executed: 'H160', + ExecutedFailed: 'H160', + BalanceDeposit: '(AccountId32,H160,U256)', + BalanceWithdraw: '(AccountId32,H160,U256)' + } + }, + /** + * Lookup104: ethereum::log::Log + **/ + EthereumLog: { + address: 'H160', + topics: 'Vec', + data: 'Bytes' + }, + /** + * Lookup108: pallet_ethereum::pallet::Event + **/ + PalletEthereumEvent: { + _enum: { + Executed: '(H160,H160,H256,EvmCoreErrorExitReason)' + } + }, + /** + * Lookup109: evm_core::error::ExitReason + **/ + EvmCoreErrorExitReason: { + _enum: { + Succeed: 'EvmCoreErrorExitSucceed', + Error: 'EvmCoreErrorExitError', + Revert: 'EvmCoreErrorExitRevert', + Fatal: 'EvmCoreErrorExitFatal' + } + }, + /** + * Lookup110: evm_core::error::ExitSucceed + **/ + EvmCoreErrorExitSucceed: { + _enum: ['Stopped', 'Returned', 'Suicided'] + }, + /** + * Lookup111: evm_core::error::ExitError + **/ + EvmCoreErrorExitError: { + _enum: { + StackUnderflow: 'Null', + StackOverflow: 'Null', + InvalidJump: 'Null', + InvalidRange: 'Null', + DesignatedInvalid: 'Null', + CallTooDeep: 'Null', + CreateCollision: 'Null', + CreateContractLimit: 'Null', + OutOfOffset: 'Null', + OutOfGas: 'Null', + OutOfFund: 'Null', + PCUnderflow: 'Null', + CreateEmpty: 'Null', + Other: 'Text', + InvalidCode: 'Null' + } + }, + /** + * Lookup114: evm_core::error::ExitRevert + **/ + EvmCoreErrorExitRevert: { + _enum: ['Reverted'] + }, + /** + * Lookup115: evm_core::error::ExitFatal + **/ + EvmCoreErrorExitFatal: { + _enum: { + NotSupported: 'Null', + UnhandledInterrupt: 'Null', + CallErrorAsFatal: 'EvmCoreErrorExitError', + Other: 'Text' + } + }, + /** + * Lookup116: frame_system::Phase + **/ + FrameSystemPhase: { + _enum: { + ApplyExtrinsic: 'u32', + Finalization: 'Null', + Initialization: 'Null' + } + }, + /** + * Lookup118: frame_system::LastRuntimeUpgradeInfo + **/ + FrameSystemLastRuntimeUpgradeInfo: { + specVersion: 'Compact', + specName: 'Text' + }, + /** + * Lookup119: frame_system::pallet::Call + **/ + FrameSystemCall: { + _enum: { + fill_block: { + ratio: 'Perbill', + }, + remark: { + remark: 'Bytes', + }, + set_heap_pages: { + pages: 'u64', + }, + set_code: { + code: 'Bytes', + }, + set_code_without_checks: { + code: 'Bytes', + }, + set_storage: { + items: 'Vec<(Bytes,Bytes)>', + }, + kill_storage: { + _alias: { + keys_: 'keys', + }, + keys_: 'Vec', + }, + kill_prefix: { + prefix: 'Bytes', + subkeys: 'u32', + }, + remark_with_event: { + remark: 'Bytes' + } + } + }, + /** + * Lookup124: frame_system::limits::BlockWeights + **/ + FrameSystemLimitsBlockWeights: { + baseBlock: 'u64', + maxBlock: 'u64', + perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass' + }, + /** + * Lookup125: frame_support::weights::PerDispatchClass + **/ + FrameSupportWeightsPerDispatchClassWeightsPerClass: { + normal: 'FrameSystemLimitsWeightsPerClass', + operational: 'FrameSystemLimitsWeightsPerClass', + mandatory: 'FrameSystemLimitsWeightsPerClass' + }, + /** + * Lookup126: frame_system::limits::WeightsPerClass + **/ + FrameSystemLimitsWeightsPerClass: { + baseExtrinsic: 'u64', + maxExtrinsic: 'Option', + maxTotal: 'Option', + reserved: 'Option' + }, + /** + * Lookup128: frame_system::limits::BlockLength + **/ + FrameSystemLimitsBlockLength: { + max: 'FrameSupportWeightsPerDispatchClassU32' + }, + /** + * Lookup129: frame_support::weights::PerDispatchClass + **/ + FrameSupportWeightsPerDispatchClassU32: { + normal: 'u32', + operational: 'u32', + mandatory: 'u32' + }, + /** + * Lookup130: frame_support::weights::RuntimeDbWeight + **/ + FrameSupportWeightsRuntimeDbWeight: { + read: 'u64', + write: 'u64' + }, + /** + * Lookup131: sp_version::RuntimeVersion + **/ + SpVersionRuntimeVersion: { + specName: 'Text', + implName: 'Text', + authoringVersion: 'u32', + specVersion: 'u32', + implVersion: 'u32', + apis: 'Vec<([u8;8],u32)>', + transactionVersion: 'u32', + stateVersion: 'u8' + }, + /** + * Lookup136: frame_system::pallet::Error + **/ + FrameSystemError: { + _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] + }, + /** + * Lookup137: polkadot_primitives::v2::PersistedValidationData **/ PolkadotPrimitivesV2PersistedValidationData: { parentHead: 'Bytes', @@ -14,19 +1272,19 @@ export default { maxPovSize: 'u32' }, /** - * Lookup9: polkadot_primitives::v2::UpgradeRestriction + * Lookup140: polkadot_primitives::v2::UpgradeRestriction **/ PolkadotPrimitivesV2UpgradeRestriction: { _enum: ['Present'] }, /** - * Lookup10: sp_trie::storage_proof::StorageProof + * Lookup141: sp_trie::storage_proof::StorageProof **/ SpTrieStorageProof: { trieNodes: 'BTreeSet' }, /** - * Lookup13: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot + * Lookup143: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot **/ CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: { dmqMqcHead: 'H256', @@ -35,7 +1293,7 @@ export default { egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>' }, /** - * Lookup18: polkadot_primitives::v2::AbridgedHrmpChannel + * Lookup146: polkadot_primitives::v2::AbridgedHrmpChannel **/ PolkadotPrimitivesV2AbridgedHrmpChannel: { maxCapacity: 'u32', @@ -46,7 +1304,7 @@ export default { mqcHead: 'Option' }, /** - * Lookup20: polkadot_primitives::v2::AbridgedHostConfiguration + * Lookup147: polkadot_primitives::v2::AbridgedHostConfiguration **/ PolkadotPrimitivesV2AbridgedHostConfiguration: { maxCodeSize: 'u32', @@ -60,14 +1318,14 @@ export default { validationUpgradeDelay: 'u32' }, /** - * Lookup26: polkadot_core_primitives::OutboundHrmpMessage + * Lookup153: polkadot_core_primitives::OutboundHrmpMessage **/ PolkadotCorePrimitivesOutboundHrmpMessage: { recipient: 'u32', data: 'Bytes' }, /** - * Lookup28: cumulus_pallet_parachain_system::pallet::Call + * Lookup154: cumulus_pallet_parachain_system::pallet::Call **/ CumulusPalletParachainSystemCall: { _enum: { @@ -86,7 +1344,7 @@ export default { } }, /** - * Lookup29: cumulus_primitives_parachain_inherent::ParachainInherentData + * Lookup155: cumulus_primitives_parachain_inherent::ParachainInherentData **/ CumulusPrimitivesParachainInherentParachainInherentData: { validationData: 'PolkadotPrimitivesV2PersistedValidationData', @@ -95,58 +1353,27 @@ export default { horizontalMessages: 'BTreeMap>' }, /** - * Lookup31: polkadot_core_primitives::InboundDownwardMessage + * Lookup157: polkadot_core_primitives::InboundDownwardMessage **/ PolkadotCorePrimitivesInboundDownwardMessage: { sentAt: 'u32', msg: 'Bytes' }, /** - * Lookup34: polkadot_core_primitives::InboundHrmpMessage + * Lookup160: polkadot_core_primitives::InboundHrmpMessage **/ PolkadotCorePrimitivesInboundHrmpMessage: { sentAt: 'u32', data: 'Bytes' }, /** - * Lookup37: cumulus_pallet_parachain_system::pallet::Event - **/ - CumulusPalletParachainSystemEvent: { - _enum: { - ValidationFunctionStored: 'Null', - ValidationFunctionApplied: { - relayChainBlockNum: 'u32', - }, - ValidationFunctionDiscarded: 'Null', - UpgradeAuthorized: { - codeHash: 'H256', - }, - DownwardMessagesReceived: { - count: 'u32', - }, - DownwardMessagesProcessed: { - weightUsed: 'u64', - dmqHead: 'H256' - } - } - }, - /** - * Lookup38: cumulus_pallet_parachain_system::pallet::Error + * Lookup163: cumulus_pallet_parachain_system::pallet::Error **/ CumulusPalletParachainSystemError: { _enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized'] }, /** - * Lookup41: pallet_balances::AccountData - **/ - PalletBalancesAccountData: { - free: 'u128', - reserved: 'u128', - miscFrozen: 'u128', - feeFrozen: 'u128' - }, - /** - * Lookup43: pallet_balances::BalanceLock + * Lookup165: pallet_balances::BalanceLock **/ PalletBalancesBalanceLock: { id: '[u8;8]', @@ -154,13 +1381,13 @@ export default { reasons: 'PalletBalancesReasons' }, /** - * Lookup45: pallet_balances::Reasons + * Lookup166: pallet_balances::Reasons **/ PalletBalancesReasons: { _enum: ['Fee', 'Misc', 'All'] }, /** - * Lookup48: pallet_balances::ReserveData + * Lookup169: pallet_balances::ReserveData **/ PalletBalancesReserveData: { id: '[u8;16]', @@ -752,25 +1979,9 @@ export default { collectionId: 'u32', data: 'UpDataStructsCreateItemExData', }, -<<<<<<< HEAD set_transfers_enabled_flag: { collectionId: 'u32', value: 'bool', -======= - finish: { - address: 'H160', - code: 'Bytes' - } - } - }, - /** - * Lookup259: pallet_sudo::pallet::Event - **/ - PalletSudoEvent: { - _enum: { - Sudid: { - sudoResult: 'Result', ->>>>>>> b43f8da0... added totalstaked & fix bug with number in RPC Client }, burn_item: { collectionId: 'u32', @@ -1234,7 +2445,26 @@ export default { value: 'Bytes' }, /** - * Lookup303: pallet_evm::pallet::Call + * Lookup303: pallet_app_promotion::pallet::Call + **/ + PalletAppPromotionCall: { + _enum: { + set_admin_address: { + admin: 'AccountId32', + }, + start_app_promotion: { + promotionStartRelayBlock: 'u32', + }, + stake: { + amount: 'u128', + }, + unstake: { + amount: 'u128' + } + } + }, + /** + * Lookup304: pallet_evm::pallet::Call **/ PalletEvmCall: { _enum: { @@ -1277,7 +2507,7 @@ export default { } }, /** - * Lookup307: pallet_ethereum::pallet::Call + * Lookup308: pallet_ethereum::pallet::Call **/ PalletEthereumCall: { _enum: { @@ -1287,7 +2517,7 @@ export default { } }, /** - * Lookup308: ethereum::transaction::TransactionV2 + * Lookup309: ethereum::transaction::TransactionV2 **/ EthereumTransactionTransactionV2: { _enum: { @@ -1297,7 +2527,7 @@ export default { } }, /** - * Lookup309: ethereum::transaction::LegacyTransaction + * Lookup310: ethereum::transaction::LegacyTransaction **/ EthereumTransactionLegacyTransaction: { nonce: 'U256', @@ -1309,7 +2539,7 @@ export default { signature: 'EthereumTransactionTransactionSignature' }, /** - * Lookup310: ethereum::transaction::TransactionAction + * Lookup311: ethereum::transaction::TransactionAction **/ EthereumTransactionTransactionAction: { _enum: { @@ -1318,7 +2548,7 @@ export default { } }, /** - * Lookup311: ethereum::transaction::TransactionSignature + * Lookup312: ethereum::transaction::TransactionSignature **/ EthereumTransactionTransactionSignature: { v: 'u64', @@ -1326,7 +2556,7 @@ export default { s: 'H256' }, /** - * Lookup313: ethereum::transaction::EIP2930Transaction + * Lookup314: ethereum::transaction::EIP2930Transaction **/ EthereumTransactionEip2930Transaction: { chainId: 'u64', @@ -1342,14 +2572,14 @@ export default { s: 'H256' }, /** - * Lookup315: ethereum::transaction::AccessListItem + * Lookup316: ethereum::transaction::AccessListItem **/ EthereumTransactionAccessListItem: { address: 'H160', storageKeys: 'Vec' }, /** - * Lookup316: ethereum::transaction::EIP1559Transaction + * Lookup317: ethereum::transaction::EIP1559Transaction **/ EthereumTransactionEip1559Transaction: { chainId: 'u64', @@ -1366,7 +2596,7 @@ export default { s: 'H256' }, /** - * Lookup317: pallet_evm_migration::pallet::Call + * Lookup318: pallet_evm_migration::pallet::Call **/ PalletEvmMigrationCall: { _enum: { @@ -1384,19 +2614,19 @@ export default { } }, /** - * Lookup320: pallet_sudo::pallet::Error + * Lookup321: pallet_sudo::pallet::Error **/ PalletSudoError: { _enum: ['RequireSudo'] }, /** - * Lookup322: orml_vesting::module::Error + * Lookup323: orml_vesting::module::Error **/ OrmlVestingModuleError: { _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded'] }, /** - * Lookup324: cumulus_pallet_xcmp_queue::InboundChannelDetails + * Lookup325: cumulus_pallet_xcmp_queue::InboundChannelDetails **/ CumulusPalletXcmpQueueInboundChannelDetails: { sender: 'u32', @@ -1404,19 +2634,19 @@ export default { messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>' }, /** - * Lookup325: cumulus_pallet_xcmp_queue::InboundState + * Lookup326: cumulus_pallet_xcmp_queue::InboundState **/ CumulusPalletXcmpQueueInboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup328: polkadot_parachain::primitives::XcmpMessageFormat + * Lookup329: polkadot_parachain::primitives::XcmpMessageFormat **/ PolkadotParachainPrimitivesXcmpMessageFormat: { _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals'] }, /** - * Lookup331: cumulus_pallet_xcmp_queue::OutboundChannelDetails + * Lookup332: cumulus_pallet_xcmp_queue::OutboundChannelDetails **/ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: 'u32', @@ -1426,13 +2656,13 @@ export default { lastIndex: 'u16' }, /** - * Lookup332: cumulus_pallet_xcmp_queue::OutboundState + * Lookup333: cumulus_pallet_xcmp_queue::OutboundState **/ CumulusPalletXcmpQueueOutboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup334: cumulus_pallet_xcmp_queue::QueueConfigData + * Lookup335: cumulus_pallet_xcmp_queue::QueueConfigData **/ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: 'u32', @@ -1443,29 +2673,29 @@ export default { xcmpMaxIndividualWeight: 'u64' }, /** - * Lookup336: cumulus_pallet_xcmp_queue::pallet::Error + * Lookup337: cumulus_pallet_xcmp_queue::pallet::Error **/ CumulusPalletXcmpQueueError: { _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit'] }, /** - * Lookup337: pallet_xcm::pallet::Error + * Lookup338: pallet_xcm::pallet::Error **/ PalletXcmError: { _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed'] }, /** - * Lookup338: cumulus_pallet_xcm::pallet::Error + * Lookup339: cumulus_pallet_xcm::pallet::Error **/ CumulusPalletXcmError: 'Null', /** - * Lookup339: cumulus_pallet_dmp_queue::ConfigData + * Lookup340: cumulus_pallet_dmp_queue::ConfigData **/ CumulusPalletDmpQueueConfigData: { maxIndividual: 'u64' }, /** - * Lookup340: cumulus_pallet_dmp_queue::PageIndexData + * Lookup341: cumulus_pallet_dmp_queue::PageIndexData **/ CumulusPalletDmpQueuePageIndexData: { beginUsed: 'u32', @@ -1473,19 +2703,19 @@ export default { overweightCount: 'u64' }, /** - * Lookup343: cumulus_pallet_dmp_queue::pallet::Error + * Lookup344: cumulus_pallet_dmp_queue::pallet::Error **/ CumulusPalletDmpQueueError: { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup346: pallet_unique::Error + * Lookup348: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup349: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> + * Lookup351: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> **/ PalletUniqueSchedulerScheduledV3: { maybeId: 'Option<[u8;16]>', @@ -1495,7 +2725,7 @@ export default { origin: 'OpalRuntimeOriginCaller' }, /** - * Lookup350: opal_runtime::OriginCaller + * Lookup352: opal_runtime::OriginCaller **/ OpalRuntimeOriginCaller: { _enum: { @@ -1604,7 +2834,7 @@ export default { } }, /** - * Lookup351: frame_support::dispatch::RawOrigin + * Lookup353: frame_support::dispatch::RawOrigin **/ FrameSupportDispatchRawOrigin: { _enum: { @@ -1614,7 +2844,7 @@ export default { } }, /** - * Lookup352: pallet_xcm::pallet::Origin + * Lookup354: pallet_xcm::pallet::Origin **/ PalletXcmOrigin: { _enum: { @@ -1623,7 +2853,7 @@ export default { } }, /** - * Lookup353: cumulus_pallet_xcm::pallet::Origin + * Lookup355: cumulus_pallet_xcm::pallet::Origin **/ CumulusPalletXcmOrigin: { _enum: { @@ -1632,7 +2862,7 @@ export default { } }, /** - * Lookup354: pallet_ethereum::RawOrigin + * Lookup356: pallet_ethereum::RawOrigin **/ PalletEthereumRawOrigin: { _enum: { @@ -1640,17 +2870,17 @@ export default { } }, /** - * Lookup355: sp_core::Void + * Lookup357: sp_core::Void **/ SpCoreVoid: 'Null', /** - * Lookup356: pallet_unique_scheduler::pallet::Error + * Lookup358: pallet_unique_scheduler::pallet::Error **/ PalletUniqueSchedulerError: { _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] }, /** - * Lookup357: up_data_structs::Collection + * Lookup359: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -1664,7 +2894,7 @@ export default { externalCollection: 'bool' }, /** - * Lookup358: up_data_structs::SponsorshipState + * Lookup360: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipState: { _enum: { @@ -1674,7 +2904,7 @@ export default { } }, /** - * Lookup359: up_data_structs::Properties + * Lookup361: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -1682,15 +2912,15 @@ export default { spaceLimit: 'u32' }, /** - * Lookup360: up_data_structs::PropertiesMap> + * Lookup362: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** - * Lookup366: up_data_structs::PropertiesMap + * Lookup367: up_data_structs::PropertiesMap **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup372: up_data_structs::CollectionStats + * Lookup374: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -1698,18 +2928,18 @@ export default { alive: 'u32' }, /** - * Lookup373: up_data_structs::TokenChild + * Lookup375: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup374: PhantomType::up_data_structs + * Lookup376: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup376: up_data_structs::TokenData> + * Lookup378: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -1717,7 +2947,7 @@ export default { pieces: 'u128' }, /** - * Lookup378: up_data_structs::RpcCollection + * Lookup380: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -1733,7 +2963,7 @@ export default { readOnly: 'bool' }, /** - * Lookup379: rmrk_traits::collection::CollectionInfo, frame_support::storage::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup381: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -1743,7 +2973,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup380: rmrk_traits::nft::NftInfo> + * Lookup382: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -1753,14 +2983,14 @@ export default { pending: 'bool' }, /** - * Lookup382: rmrk_traits::nft::RoyaltyInfo + * Lookup384: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup383: rmrk_traits::resource::ResourceInfo, frame_support::storage::bounded_vec::BoundedVec> + * Lookup385: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -1769,14 +2999,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup384: rmrk_traits::property::PropertyInfo, frame_support::storage::bounded_vec::BoundedVec> + * Lookup386: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup385: rmrk_traits::base::BaseInfo> + * Lookup387: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -1784,80 +3014,80 @@ export default { symbol: 'Bytes' }, /** - * Lookup386: rmrk_traits::nft::NftChild + * Lookup388: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup388: pallet_common::pallet::Error + * Lookup390: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup390: pallet_fungible::pallet::Error + * Lookup392: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup391: pallet_refungible::ItemData + * Lookup393: pallet_refungible::ItemData **/ PalletRefungibleItemData: { constData: 'Bytes' }, /** - * Lookup394: pallet_refungible::pallet::Error + * Lookup398: pallet_refungible::pallet::Error **/ PalletRefungibleError: { _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup395: pallet_nonfungible::ItemData> + * Lookup399: pallet_nonfungible::ItemData> **/ PalletNonfungibleItemData: { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup397: up_data_structs::PropertyScope + * Lookup401: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { _enum: ['None', 'Rmrk', 'Eth'] }, /** - * Lookup399: pallet_nonfungible::pallet::Error + * Lookup403: pallet_nonfungible::pallet::Error **/ PalletNonfungibleError: { _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup400: pallet_structure::pallet::Error + * Lookup404: pallet_structure::pallet::Error **/ PalletStructureError: { _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup401: pallet_rmrk_core::pallet::Error + * Lookup405: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** - * Lookup403: pallet_rmrk_equip::pallet::Error + * Lookup407: pallet_rmrk_equip::pallet::Error **/ PalletRmrkEquipError: { _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] }, /** - * Lookup406: pallet_evm::pallet::Error + * Lookup411: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup409: fp_rpc::TransactionStatus + * Lookup414: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -1869,11 +3099,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup411: ethbloom::Bloom + * Lookup416: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup413: ethereum::receipt::ReceiptV3 + * Lookup418: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -1883,7 +3113,7 @@ export default { } }, /** - * Lookup414: ethereum::receipt::EIP658ReceiptData + * Lookup419: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -1892,7 +3122,7 @@ export default { logs: 'Vec' }, /** - * Lookup415: ethereum::block::Block + * Lookup420: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -1900,7 +3130,7 @@ export default { ommers: 'Vec' }, /** - * Lookup416: ethereum::header::Header + * Lookup421: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -1920,41 +3150,41 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup417: ethereum_types::hash::H64 + * Lookup422: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup422: pallet_ethereum::pallet::Error + * Lookup427: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup423: pallet_evm_coder_substrate::pallet::Error + * Lookup428: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup424: pallet_evm_contract_helpers::SponsoringModeT + * Lookup429: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup426: pallet_evm_contract_helpers::pallet::Error + * Lookup431: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission'] }, /** - * Lookup427: pallet_evm_migration::pallet::Error + * Lookup432: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup429: sp_runtime::MultiSignature + * Lookup434: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -1964,43 +3194,43 @@ export default { } }, /** - * Lookup430: sp_core::ed25519::Signature + * Lookup435: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup434: sp_core::sr25519::Signature + * Lookup437: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup435: sp_core::ecdsa::Signature + * Lookup438: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup438: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup441: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup439: frame_system::extensions::check_genesis::CheckGenesis + * Lookup442: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup442: frame_system::extensions::check_nonce::CheckNonce + * Lookup445: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup443: frame_system::extensions::check_weight::CheckWeight + * Lookup446: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup444: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup447: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup445: opal_runtime::Runtime + * Lookup448: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup444: pallet_ethereum::FakeTransactionFinalizer + * Lookup449: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index 82c56d2f34..32e6885f58 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { interface InterfaceTypes { diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 950696394e..600c10f56c 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -10,67 +10,62 @@ import type { ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; import type { Event } from '@polkadot/types/interfaces/system'; - /** @name PolkadotPrimitivesV2PersistedValidationData (2) */ - export interface PolkadotPrimitivesV2PersistedValidationData extends Struct { - readonly parentHead: Bytes; - readonly relayParentNumber: u32; - readonly relayParentStorageRoot: H256; - readonly maxPovSize: u32; - } - - /** @name PolkadotPrimitivesV2UpgradeRestriction (9) */ - export interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { - readonly isPresent: boolean; - readonly type: 'Present'; +declare module '@polkadot/types/lookup' { + /** @name FrameSystemAccountInfo (3) */ + interface FrameSystemAccountInfo extends Struct { + readonly nonce: u32; + readonly consumers: u32; + readonly providers: u32; + readonly sufficients: u32; + readonly data: PalletBalancesAccountData; } - /** @name SpTrieStorageProof (10) */ - export interface SpTrieStorageProof extends Struct { - readonly trieNodes: BTreeSet; + /** @name PalletBalancesAccountData (5) */ + interface PalletBalancesAccountData extends Struct { + readonly free: u128; + readonly reserved: u128; + readonly miscFrozen: u128; + readonly feeFrozen: u128; } - /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (13) */ - export interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { - readonly dmqMqcHead: H256; - readonly relayDispatchQueueSize: ITuple<[u32, u32]>; - readonly ingressChannels: Vec>; - readonly egressChannels: Vec>; + /** @name FrameSupportWeightsPerDispatchClassU64 (7) */ + interface FrameSupportWeightsPerDispatchClassU64 extends Struct { + readonly normal: u64; + readonly operational: u64; + readonly mandatory: u64; } - /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (18) */ - export interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { - readonly maxCapacity: u32; - readonly maxTotalSize: u32; - readonly maxMessageSize: u32; - readonly msgCount: u32; - readonly totalSize: u32; - readonly mqcHead: Option; + /** @name SpRuntimeDigest (11) */ + interface SpRuntimeDigest extends Struct { + readonly logs: Vec; } - /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (20) */ - export interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { - readonly maxCodeSize: u32; - readonly maxHeadDataSize: u32; - readonly maxUpwardQueueCount: u32; - readonly maxUpwardQueueSize: u32; - readonly maxUpwardMessageSize: u32; - readonly maxUpwardMessageNumPerCandidate: u32; - readonly hrmpMaxMessageNumPerCandidate: u32; - readonly validationUpgradeCooldown: u32; - readonly validationUpgradeDelay: u32; + /** @name SpRuntimeDigestDigestItem (13) */ + interface SpRuntimeDigestDigestItem extends Enum { + readonly isOther: boolean; + readonly asOther: Bytes; + readonly isConsensus: boolean; + readonly asConsensus: ITuple<[U8aFixed, Bytes]>; + readonly isSeal: boolean; + readonly asSeal: ITuple<[U8aFixed, Bytes]>; + readonly isPreRuntime: boolean; + readonly asPreRuntime: ITuple<[U8aFixed, Bytes]>; + readonly isRuntimeEnvironmentUpdated: boolean; + readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated'; } - /** @name PolkadotCorePrimitivesOutboundHrmpMessage (26) */ - export interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { - readonly recipient: u32; - readonly data: Bytes; + /** @name FrameSystemEventRecord (16) */ + interface FrameSystemEventRecord extends Struct { + readonly phase: FrameSystemPhase; + readonly event: Event; + readonly topics: Vec; } - /** @name CumulusPalletParachainSystemCall (28) */ - export interface CumulusPalletParachainSystemCall extends Enum { - readonly isSetValidationData: boolean; - readonly asSetValidationData: { - readonly data: CumulusPrimitivesParachainInherentParachainInherentData; + /** @name FrameSystemEvent (18) */ + interface FrameSystemEvent extends Enum { + readonly isExtrinsicSuccess: boolean; + readonly asExtrinsicSuccess: { + readonly dispatchInfo: FrameSupportWeightsDispatchInfo; } & Struct; readonly isExtrinsicFailed: boolean; readonly asExtrinsicFailed: { @@ -94,28 +89,82 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked'; } - /** @name CumulusPrimitivesParachainInherentParachainInherentData (29) */ - export interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { - readonly validationData: PolkadotPrimitivesV2PersistedValidationData; - readonly relayChainState: SpTrieStorageProof; - readonly downwardMessages: Vec; - readonly horizontalMessages: BTreeMap>; + /** @name FrameSupportWeightsDispatchInfo (19) */ + interface FrameSupportWeightsDispatchInfo extends Struct { + readonly weight: u64; + readonly class: FrameSupportWeightsDispatchClass; + readonly paysFee: FrameSupportWeightsPays; } - /** @name PolkadotCorePrimitivesInboundDownwardMessage (31) */ - export interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { - readonly sentAt: u32; - readonly msg: Bytes; + /** @name FrameSupportWeightsDispatchClass (20) */ + interface FrameSupportWeightsDispatchClass extends Enum { + readonly isNormal: boolean; + readonly isOperational: boolean; + readonly isMandatory: boolean; + readonly type: 'Normal' | 'Operational' | 'Mandatory'; } - /** @name PolkadotCorePrimitivesInboundHrmpMessage (34) */ - export interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { - readonly sentAt: u32; - readonly data: Bytes; + /** @name FrameSupportWeightsPays (21) */ + interface FrameSupportWeightsPays extends Enum { + readonly isYes: boolean; + readonly isNo: boolean; + readonly type: 'Yes' | 'No'; + } + + /** @name SpRuntimeDispatchError (22) */ + interface SpRuntimeDispatchError extends Enum { + readonly isOther: boolean; + readonly isCannotLookup: boolean; + readonly isBadOrigin: boolean; + readonly isModule: boolean; + readonly asModule: SpRuntimeModuleError; + readonly isConsumerRemaining: boolean; + readonly isNoProviders: boolean; + readonly isTooManyConsumers: boolean; + readonly isToken: boolean; + readonly asToken: SpRuntimeTokenError; + readonly isArithmetic: boolean; + readonly asArithmetic: SpRuntimeArithmeticError; + readonly isTransactional: boolean; + readonly asTransactional: SpRuntimeTransactionalError; + readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional'; + } + + /** @name SpRuntimeModuleError (23) */ + interface SpRuntimeModuleError extends Struct { + readonly index: u8; + readonly error: U8aFixed; + } + + /** @name SpRuntimeTokenError (24) */ + interface SpRuntimeTokenError extends Enum { + readonly isNoFunds: boolean; + readonly isWouldDie: boolean; + readonly isBelowMinimum: boolean; + readonly isCannotCreate: boolean; + readonly isUnknownAsset: boolean; + readonly isFrozen: boolean; + readonly isUnsupported: boolean; + readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported'; + } + + /** @name SpRuntimeArithmeticError (25) */ + interface SpRuntimeArithmeticError extends Enum { + readonly isUnderflow: boolean; + readonly isOverflow: boolean; + readonly isDivisionByZero: boolean; + readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero'; + } + + /** @name SpRuntimeTransactionalError (26) */ + interface SpRuntimeTransactionalError extends Enum { + readonly isLimitReached: boolean; + readonly isNoLayer: boolean; + readonly type: 'LimitReached' | 'NoLayer'; } - /** @name CumulusPalletParachainSystemEvent (37) */ - export interface CumulusPalletParachainSystemEvent extends Enum { + /** @name CumulusPalletParachainSystemEvent (27) */ + interface CumulusPalletParachainSystemEvent extends Enum { readonly isValidationFunctionStored: boolean; readonly isValidationFunctionApplied: boolean; readonly asValidationFunctionApplied: { @@ -138,94 +187,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'ValidationFunctionStored' | 'ValidationFunctionApplied' | 'ValidationFunctionDiscarded' | 'UpgradeAuthorized' | 'DownwardMessagesReceived' | 'DownwardMessagesProcessed'; } - /** @name CumulusPalletParachainSystemError (38) */ - export interface CumulusPalletParachainSystemError extends Enum { - readonly isOverlappingUpgrades: boolean; - readonly isProhibitedByPolkadot: boolean; - readonly isTooBig: boolean; - readonly isValidationDataNotAvailable: boolean; - readonly isHostConfigurationNotAvailable: boolean; - readonly isNotScheduled: boolean; - readonly isNothingAuthorized: boolean; - readonly isUnauthorized: boolean; - readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized'; - } - - /** @name PalletBalancesAccountData (41) */ - export interface PalletBalancesAccountData extends Struct { - readonly free: u128; - readonly reserved: u128; - readonly miscFrozen: u128; - readonly feeFrozen: u128; - } - - /** @name PalletBalancesBalanceLock (43) */ - export interface PalletBalancesBalanceLock extends Struct { - readonly id: U8aFixed; - readonly amount: u128; - readonly reasons: PalletBalancesReasons; - } - - /** @name PalletBalancesReasons (45) */ - export interface PalletBalancesReasons extends Enum { - readonly isFee: boolean; - readonly isMisc: boolean; - readonly isAll: boolean; - readonly type: 'Fee' | 'Misc' | 'All'; - } - - /** @name PalletBalancesReserveData (48) */ - export interface PalletBalancesReserveData extends Struct { - readonly id: U8aFixed; - readonly amount: u128; - } - - /** @name PalletBalancesReleases (51) */ - export interface PalletBalancesReleases extends Enum { - readonly isV100: boolean; - readonly isV200: boolean; - readonly type: 'V100' | 'V200'; - } - - /** @name PalletBalancesCall (52) */ - export interface PalletBalancesCall extends Enum { - readonly isTransfer: boolean; - readonly asTransfer: { - readonly dest: MultiAddress; - readonly value: Compact; - } & Struct; - readonly isSetBalance: boolean; - readonly asSetBalance: { - readonly who: MultiAddress; - readonly newFree: Compact; - readonly newReserved: Compact; - } & Struct; - readonly isForceTransfer: boolean; - readonly asForceTransfer: { - readonly source: MultiAddress; - readonly dest: MultiAddress; - readonly value: Compact; - } & Struct; - readonly isTransferKeepAlive: boolean; - readonly asTransferKeepAlive: { - readonly dest: MultiAddress; - readonly value: Compact; - } & Struct; - readonly isTransferAll: boolean; - readonly asTransferAll: { - readonly dest: MultiAddress; - readonly keepAlive: bool; - } & Struct; - readonly isForceUnreserve: boolean; - readonly asForceUnreserve: { - readonly who: MultiAddress; - readonly amount: u128; - } & Struct; - readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; - } - - /** @name PalletBalancesEvent (58) */ - export interface PalletBalancesEvent extends Enum { + /** @name PalletBalancesEvent (28) */ + interface PalletBalancesEvent extends Enum { readonly isEndowed: boolean; readonly asEndowed: { readonly account: AccountId32; @@ -283,74 +246,26 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'BalanceSet' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'Deposit' | 'Withdraw' | 'Slashed'; } - /** @name FrameSupportTokensMiscBalanceStatus (59) */ - export interface FrameSupportTokensMiscBalanceStatus extends Enum { + /** @name FrameSupportTokensMiscBalanceStatus (29) */ + interface FrameSupportTokensMiscBalanceStatus extends Enum { readonly isFree: boolean; readonly isReserved: boolean; readonly type: 'Free' | 'Reserved'; } - /** @name PalletBalancesError (60) */ - export interface PalletBalancesError extends Enum { - readonly isVestingBalance: boolean; - readonly isLiquidityRestrictions: boolean; - readonly isInsufficientBalance: boolean; - readonly isExistentialDeposit: boolean; - readonly isKeepAlive: boolean; - readonly isExistingVestingSchedule: boolean; - readonly isDeadAccount: boolean; - readonly isTooManyReserves: boolean; - readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves'; - } - - /** @name PalletTimestampCall (63) */ - export interface PalletTimestampCall extends Enum { - readonly isSet: boolean; - readonly asSet: { - readonly now: Compact; - } & Struct; - readonly type: 'Set'; - } - - /** @name PalletTransactionPaymentReleases (66) */ - export interface PalletTransactionPaymentReleases extends Enum { - readonly isV1Ancient: boolean; - readonly isV2: boolean; - readonly type: 'V1Ancient' | 'V2'; - } - - /** @name PalletTreasuryProposal (67) */ - export interface PalletTreasuryProposal extends Struct { - readonly proposer: AccountId32; - readonly value: u128; - readonly beneficiary: AccountId32; - readonly bond: u128; - } - - /** @name PalletTreasuryCall (70) */ - export interface PalletTreasuryCall extends Enum { - readonly isProposeSpend: boolean; - readonly asProposeSpend: { - readonly value: Compact; - readonly beneficiary: MultiAddress; - } & Struct; - readonly isRejectProposal: boolean; - readonly asRejectProposal: { - readonly proposalId: Compact; - } & Struct; - readonly isApproveProposal: boolean; - readonly asApproveProposal: { - readonly proposalId: Compact; - } & Struct; - readonly isRemoveApproval: boolean; - readonly asRemoveApproval: { - readonly proposalId: Compact; + /** @name PalletTransactionPaymentEvent (30) */ + interface PalletTransactionPaymentEvent extends Enum { + readonly isTransactionFeePaid: boolean; + readonly asTransactionFeePaid: { + readonly who: AccountId32; + readonly actualFee: u128; + readonly tip: u128; } & Struct; - readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'RemoveApproval'; + readonly type: 'TransactionFeePaid'; } - /** @name PalletTreasuryEvent (72) */ - export interface PalletTreasuryEvent extends Enum { + /** @name PalletTreasuryEvent (31) */ + interface PalletTreasuryEvent extends Enum { readonly isProposed: boolean; readonly asProposed: { readonly proposalIndex: u32; @@ -382,93 +297,39 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly asDeposit: { readonly value: u128; } & Struct; - readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit'; - } - - /** @name FrameSupportPalletId (75) */ - export interface FrameSupportPalletId extends U8aFixed {} - - /** @name PalletTreasuryError (76) */ - export interface PalletTreasuryError extends Enum { - readonly isInsufficientProposersBalance: boolean; - readonly isInvalidIndex: boolean; - readonly isTooManyApprovals: boolean; - readonly isProposalNotApproved: boolean; - readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'ProposalNotApproved'; + readonly isSpendApproved: boolean; + readonly asSpendApproved: { + readonly proposalIndex: u32; + readonly amount: u128; + readonly beneficiary: AccountId32; + } & Struct; + readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit' | 'SpendApproved'; } - /** @name PalletSudoCall (77) */ - export interface PalletSudoCall extends Enum { - readonly isSudo: boolean; - readonly asSudo: { - readonly call: Call; - } & Struct; - readonly isSudoUncheckedWeight: boolean; - readonly asSudoUncheckedWeight: { - readonly call: Call; - readonly weight: u64; - } & Struct; - readonly isSetKey: boolean; - readonly asSetKey: { - readonly new_: MultiAddress; - } & Struct; - readonly isSudoAs: boolean; - readonly asSudoAs: { - readonly who: MultiAddress; - readonly call: Call; - } & Struct; - readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit' | 'SpendApproved'; - } - - /** @name FrameSystemCall (79) */ - export interface FrameSystemCall extends Enum { - readonly isFillBlock: boolean; - readonly asFillBlock: { - readonly ratio: Perbill; - } & Struct; - readonly isRemark: boolean; - readonly asRemark: { - readonly remark: Bytes; - } & Struct; - readonly isSetHeapPages: boolean; - readonly asSetHeapPages: { - readonly pages: u64; - } & Struct; - readonly isSetCode: boolean; - readonly asSetCode: { - readonly code: Bytes; - } & Struct; - readonly isSetCodeWithoutChecks: boolean; - readonly asSetCodeWithoutChecks: { - readonly code: Bytes; - } & Struct; - readonly isSetStorage: boolean; - readonly asSetStorage: { - readonly items: Vec>; - } & Struct; - readonly isKillStorage: boolean; - readonly asKillStorage: { - readonly keys_: Vec; + /** @name PalletSudoEvent (32) */ + interface PalletSudoEvent extends Enum { + readonly isSudid: boolean; + readonly asSudid: { + readonly sudoResult: Result; } & Struct; - readonly isKillPrefix: boolean; - readonly asKillPrefix: { - readonly prefix: Bytes; - readonly subkeys: u32; + readonly isKeyChanged: boolean; + readonly asKeyChanged: { + readonly oldSudoer: Option; } & Struct; - readonly isRemarkWithEvent: boolean; - readonly asRemarkWithEvent: { - readonly remark: Bytes; + readonly isSudoAsDone: boolean; + readonly asSudoAsDone: { + readonly sudoResult: Result; } & Struct; - readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent'; + readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone'; } - /** @name OrmlVestingModuleCall (83) */ - export interface OrmlVestingModuleCall extends Enum { - readonly isClaim: boolean; - readonly isVestedTransfer: boolean; - readonly asVestedTransfer: { - readonly dest: MultiAddress; - readonly schedule: OrmlVestingVestingSchedule; + /** @name OrmlVestingModuleEvent (36) */ + interface OrmlVestingModuleEvent extends Enum { + readonly isVestingScheduleAdded: boolean; + readonly asVestingScheduleAdded: { + readonly from: AccountId32; + readonly to: AccountId32; + readonly vestingSchedule: OrmlVestingVestingSchedule; } & Struct; readonly isClaimed: boolean; readonly asClaimed: { @@ -482,20 +343,20 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated'; } - /** @name OrmlVestingVestingSchedule (84) */ - export interface OrmlVestingVestingSchedule extends Struct { + /** @name OrmlVestingVestingSchedule (37) */ + interface OrmlVestingVestingSchedule extends Struct { readonly start: u32; readonly period: u32; readonly periodCount: u32; readonly perPeriod: Compact; } - /** @name CumulusPalletXcmpQueueCall (86) */ - export interface CumulusPalletXcmpQueueCall extends Enum { - readonly isServiceOverweight: boolean; - readonly asServiceOverweight: { - readonly index: u64; - readonly weightLimit: u64; + /** @name CumulusPalletXcmpQueueEvent (39) */ + interface CumulusPalletXcmpQueueEvent extends Enum { + readonly isSuccess: boolean; + readonly asSuccess: { + readonly messageHash: Option; + readonly weight: u64; } & Struct; readonly isFail: boolean; readonly asFail: { @@ -534,102 +395,117 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name PalletXcmCall (87) */ - export interface PalletXcmCall extends Enum { - readonly isSend: boolean; - readonly asSend: { - readonly dest: XcmVersionedMultiLocation; - readonly message: XcmVersionedXcm; - } & Struct; - readonly isTeleportAssets: boolean; - readonly asTeleportAssets: { - readonly dest: XcmVersionedMultiLocation; - readonly beneficiary: XcmVersionedMultiLocation; - readonly assets: XcmVersionedMultiAssets; - readonly feeAssetItem: u32; - } & Struct; - readonly isReserveTransferAssets: boolean; - readonly asReserveTransferAssets: { - readonly dest: XcmVersionedMultiLocation; - readonly beneficiary: XcmVersionedMultiLocation; - readonly assets: XcmVersionedMultiAssets; - readonly feeAssetItem: u32; - } & Struct; - readonly isExecute: boolean; - readonly asExecute: { - readonly message: XcmVersionedXcm; - readonly maxWeight: u64; - } & Struct; - readonly isForceXcmVersion: boolean; - readonly asForceXcmVersion: { - readonly location: XcmV1MultiLocation; - readonly xcmVersion: u32; - } & Struct; - readonly isForceDefaultXcmVersion: boolean; - readonly asForceDefaultXcmVersion: { - readonly maybeXcmVersion: Option; - } & Struct; - readonly isForceSubscribeVersionNotify: boolean; - readonly asForceSubscribeVersionNotify: { - readonly location: XcmVersionedMultiLocation; - } & Struct; - readonly isForceUnsubscribeVersionNotify: boolean; - readonly asForceUnsubscribeVersionNotify: { - readonly location: XcmVersionedMultiLocation; - } & Struct; - readonly isLimitedReserveTransferAssets: boolean; - readonly asLimitedReserveTransferAssets: { - readonly dest: XcmVersionedMultiLocation; - readonly beneficiary: XcmVersionedMultiLocation; - readonly assets: XcmVersionedMultiAssets; - readonly feeAssetItem: u32; - readonly weightLimit: XcmV2WeightLimit; - } & Struct; - readonly isLimitedTeleportAssets: boolean; - readonly asLimitedTeleportAssets: { - readonly dest: XcmVersionedMultiLocation; - readonly beneficiary: XcmVersionedMultiLocation; - readonly assets: XcmVersionedMultiAssets; - readonly feeAssetItem: u32; - readonly weightLimit: XcmV2WeightLimit; - } & Struct; - readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets'; + /** @name XcmV2TraitsError (41) */ + interface XcmV2TraitsError extends Enum { + readonly isOverflow: boolean; + readonly isUnimplemented: boolean; + readonly isUntrustedReserveLocation: boolean; + readonly isUntrustedTeleportLocation: boolean; + readonly isMultiLocationFull: boolean; + readonly isMultiLocationNotInvertible: boolean; + readonly isBadOrigin: boolean; + readonly isInvalidLocation: boolean; + readonly isAssetNotFound: boolean; + readonly isFailedToTransactAsset: boolean; + readonly isNotWithdrawable: boolean; + readonly isLocationCannotHold: boolean; + readonly isExceedsMaxMessageSize: boolean; + readonly isDestinationUnsupported: boolean; + readonly isTransport: boolean; + readonly isUnroutable: boolean; + readonly isUnknownClaim: boolean; + readonly isFailedToDecode: boolean; + readonly isMaxWeightInvalid: boolean; + readonly isNotHoldingFees: boolean; + readonly isTooExpensive: boolean; + readonly isTrap: boolean; + readonly asTrap: u64; + readonly isUnhandledXcmVersion: boolean; + readonly isWeightLimitReached: boolean; + readonly asWeightLimitReached: u64; + readonly isBarrier: boolean; + readonly isWeightNotComputable: boolean; + readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable'; } - /** @name XcmVersionedMultiLocation (88) */ - export interface XcmVersionedMultiLocation extends Enum { - readonly isV0: boolean; - readonly asV0: XcmV0MultiLocation; - readonly isV1: boolean; - readonly asV1: XcmV1MultiLocation; - readonly type: 'V0' | 'V1'; + /** @name PalletXcmEvent (43) */ + interface PalletXcmEvent extends Enum { + readonly isAttempted: boolean; + readonly asAttempted: XcmV2TraitsOutcome; + readonly isSent: boolean; + readonly asSent: ITuple<[XcmV1MultiLocation, XcmV1MultiLocation, XcmV2Xcm]>; + readonly isUnexpectedResponse: boolean; + readonly asUnexpectedResponse: ITuple<[XcmV1MultiLocation, u64]>; + readonly isResponseReady: boolean; + readonly asResponseReady: ITuple<[u64, XcmV2Response]>; + readonly isNotified: boolean; + readonly asNotified: ITuple<[u64, u8, u8]>; + readonly isNotifyOverweight: boolean; + readonly asNotifyOverweight: ITuple<[u64, u8, u8, u64, u64]>; + readonly isNotifyDispatchError: boolean; + readonly asNotifyDispatchError: ITuple<[u64, u8, u8]>; + readonly isNotifyDecodeFailed: boolean; + readonly asNotifyDecodeFailed: ITuple<[u64, u8, u8]>; + readonly isInvalidResponder: boolean; + readonly asInvalidResponder: ITuple<[XcmV1MultiLocation, u64, Option]>; + readonly isInvalidResponderVersion: boolean; + readonly asInvalidResponderVersion: ITuple<[XcmV1MultiLocation, u64]>; + readonly isResponseTaken: boolean; + readonly asResponseTaken: u64; + readonly isAssetsTrapped: boolean; + readonly asAssetsTrapped: ITuple<[H256, XcmV1MultiLocation, XcmVersionedMultiAssets]>; + readonly isVersionChangeNotified: boolean; + readonly asVersionChangeNotified: ITuple<[XcmV1MultiLocation, u32]>; + readonly isSupportedVersionChanged: boolean; + readonly asSupportedVersionChanged: ITuple<[XcmV1MultiLocation, u32]>; + readonly isNotifyTargetSendFail: boolean; + readonly asNotifyTargetSendFail: ITuple<[XcmV1MultiLocation, u64, XcmV2TraitsError]>; + readonly isNotifyTargetMigrationFail: boolean; + readonly asNotifyTargetMigrationFail: ITuple<[XcmVersionedMultiLocation, u64]>; + readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail'; } - /** @name XcmV0MultiLocation (89) */ - export interface XcmV0MultiLocation extends Enum { - readonly isNull: boolean; + /** @name XcmV2TraitsOutcome (44) */ + interface XcmV2TraitsOutcome extends Enum { + readonly isComplete: boolean; + readonly asComplete: u64; + readonly isIncomplete: boolean; + readonly asIncomplete: ITuple<[u64, XcmV2TraitsError]>; + readonly isError: boolean; + readonly asError: XcmV2TraitsError; + readonly type: 'Complete' | 'Incomplete' | 'Error'; + } + + /** @name XcmV1MultiLocation (45) */ + interface XcmV1MultiLocation extends Struct { + readonly parents: u8; + readonly interior: XcmV1MultilocationJunctions; + } + + /** @name XcmV1MultilocationJunctions (46) */ + interface XcmV1MultilocationJunctions extends Enum { + readonly isHere: boolean; readonly isX1: boolean; - readonly asX1: XcmV0Junction; + readonly asX1: XcmV1Junction; readonly isX2: boolean; - readonly asX2: ITuple<[XcmV0Junction, XcmV0Junction]>; + readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>; readonly isX3: boolean; - readonly asX3: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>; readonly isX4: boolean; - readonly asX4: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; readonly isX5: boolean; - readonly asX5: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; readonly isX6: boolean; - readonly asX6: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; readonly isX7: boolean; - readonly asX7: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; readonly isX8: boolean; - readonly asX8: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; - readonly type: 'Null' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; + readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; + readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; } - /** @name XcmV0Junction (90) */ - export interface XcmV0Junction extends Enum { - readonly isParent: boolean; + /** @name XcmV1Junction (47) */ + interface XcmV1Junction extends Enum { readonly isParachain: boolean; readonly asParachain: Compact; readonly isAccountId32: boolean; @@ -659,11 +535,11 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly id: XcmV0JunctionBodyId; readonly part: XcmV0JunctionBodyPart; } & Struct; - readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; + readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; } - /** @name XcmV0JunctionNetworkId (91) */ - export interface XcmV0JunctionNetworkId extends Enum { + /** @name XcmV0JunctionNetworkId (49) */ + interface XcmV0JunctionNetworkId extends Enum { readonly isAny: boolean; readonly isNamed: boolean; readonly asNamed: Bytes; @@ -672,8 +548,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama'; } - /** @name XcmV0JunctionBodyId (92) */ - export interface XcmV0JunctionBodyId extends Enum { + /** @name XcmV0JunctionBodyId (53) */ + interface XcmV0JunctionBodyId extends Enum { readonly isUnit: boolean; readonly isNamed: boolean; readonly asNamed: Bytes; @@ -686,8 +562,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial'; } - /** @name XcmV0JunctionBodyPart (93) */ - export interface XcmV0JunctionBodyPart extends Enum { + /** @name XcmV0JunctionBodyPart (54) */ + interface XcmV0JunctionBodyPart extends Enum { readonly isVoice: boolean; readonly isMembers: boolean; readonly asMembers: { @@ -711,116 +587,38 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion'; } - /** @name XcmV1MultiLocation (94) */ - export interface XcmV1MultiLocation extends Struct { - readonly parents: u8; - readonly interior: XcmV1MultilocationJunctions; - } + /** @name XcmV2Xcm (55) */ + interface XcmV2Xcm extends Vec {} - /** @name XcmV1MultilocationJunctions (95) */ - export interface XcmV1MultilocationJunctions extends Enum { - readonly isHere: boolean; - readonly isX1: boolean; - readonly asX1: XcmV1Junction; - readonly isX2: boolean; - readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>; - readonly isX3: boolean; - readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly isX4: boolean; - readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly isX5: boolean; - readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly isX6: boolean; - readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly isX7: boolean; - readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly isX8: boolean; - readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>; - readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; - } - - /** @name XcmV1Junction (96) */ - export interface XcmV1Junction extends Enum { - readonly isParachain: boolean; - readonly asParachain: Compact; - readonly isAccountId32: boolean; - readonly asAccountId32: { - readonly network: XcmV0JunctionNetworkId; - readonly id: U8aFixed; - } & Struct; - readonly isAccountIndex64: boolean; - readonly asAccountIndex64: { - readonly network: XcmV0JunctionNetworkId; - readonly index: Compact; - } & Struct; - readonly isAccountKey20: boolean; - readonly asAccountKey20: { - readonly network: XcmV0JunctionNetworkId; - readonly key: U8aFixed; - } & Struct; - readonly isPalletInstance: boolean; - readonly asPalletInstance: u8; - readonly isGeneralIndex: boolean; - readonly asGeneralIndex: Compact; - readonly isGeneralKey: boolean; - readonly asGeneralKey: Bytes; - readonly isOnlyChild: boolean; - readonly isPlurality: boolean; - readonly asPlurality: { - readonly id: XcmV0JunctionBodyId; - readonly part: XcmV0JunctionBodyPart; - } & Struct; - readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; - } - - /** @name XcmVersionedXcm (97) */ - export interface XcmVersionedXcm extends Enum { - readonly isV0: boolean; - readonly asV0: XcmV0Xcm; - readonly isV1: boolean; - readonly asV1: XcmV1Xcm; - readonly isV2: boolean; - readonly asV2: XcmV2Xcm; - readonly type: 'V0' | 'V1' | 'V2'; - } - - /** @name XcmV0Xcm (98) */ - export interface XcmV0Xcm extends Enum { + /** @name XcmV2Instruction (57) */ + interface XcmV2Instruction extends Enum { readonly isWithdrawAsset: boolean; - readonly asWithdrawAsset: { - readonly assets: Vec; - readonly effects: Vec; - } & Struct; - readonly isReserveAssetDeposit: boolean; - readonly asReserveAssetDeposit: { - readonly assets: Vec; - readonly effects: Vec; - } & Struct; - readonly isTeleportAsset: boolean; - readonly asTeleportAsset: { - readonly assets: Vec; - readonly effects: Vec; - } & Struct; + readonly asWithdrawAsset: XcmV1MultiassetMultiAssets; + readonly isReserveAssetDeposited: boolean; + readonly asReserveAssetDeposited: XcmV1MultiassetMultiAssets; + readonly isReceiveTeleportedAsset: boolean; + readonly asReceiveTeleportedAsset: XcmV1MultiassetMultiAssets; readonly isQueryResponse: boolean; readonly asQueryResponse: { readonly queryId: Compact; - readonly response: XcmV0Response; + readonly response: XcmV2Response; + readonly maxWeight: Compact; } & Struct; readonly isTransferAsset: boolean; readonly asTransferAsset: { - readonly assets: Vec; - readonly dest: XcmV0MultiLocation; + readonly assets: XcmV1MultiassetMultiAssets; + readonly beneficiary: XcmV1MultiLocation; } & Struct; readonly isTransferReserveAsset: boolean; readonly asTransferReserveAsset: { - readonly assets: Vec; - readonly dest: XcmV0MultiLocation; - readonly effects: Vec; + readonly assets: XcmV1MultiassetMultiAssets; + readonly dest: XcmV1MultiLocation; + readonly xcm: XcmV2Xcm; } & Struct; readonly isTransact: boolean; readonly asTransact: { readonly originType: XcmV0OriginKind; - readonly requireWeightAtMost: u64; + readonly requireWeightAtMost: Compact; readonly call: XcmDoubleEncoded; } & Struct; readonly isHrmpNewChannelOpenRequest: boolean; @@ -839,16 +637,196 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly sender: Compact; readonly recipient: Compact; } & Struct; - readonly isRelayedFrom: boolean; - readonly asRelayedFrom: { - readonly who: XcmV0MultiLocation; - readonly message: XcmV0Xcm; + readonly isClearOrigin: boolean; + readonly isDescendOrigin: boolean; + readonly asDescendOrigin: XcmV1MultilocationJunctions; + readonly isReportError: boolean; + readonly asReportError: { + readonly queryId: Compact; + readonly dest: XcmV1MultiLocation; + readonly maxResponseWeight: Compact; } & Struct; - readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom'; + readonly isDepositAsset: boolean; + readonly asDepositAsset: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly maxAssets: Compact; + readonly beneficiary: XcmV1MultiLocation; + } & Struct; + readonly isDepositReserveAsset: boolean; + readonly asDepositReserveAsset: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly maxAssets: Compact; + readonly dest: XcmV1MultiLocation; + readonly xcm: XcmV2Xcm; + } & Struct; + readonly isExchangeAsset: boolean; + readonly asExchangeAsset: { + readonly give: XcmV1MultiassetMultiAssetFilter; + readonly receive: XcmV1MultiassetMultiAssets; + } & Struct; + readonly isInitiateReserveWithdraw: boolean; + readonly asInitiateReserveWithdraw: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly reserve: XcmV1MultiLocation; + readonly xcm: XcmV2Xcm; + } & Struct; + readonly isInitiateTeleport: boolean; + readonly asInitiateTeleport: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly dest: XcmV1MultiLocation; + readonly xcm: XcmV2Xcm; + } & Struct; + readonly isQueryHolding: boolean; + readonly asQueryHolding: { + readonly queryId: Compact; + readonly dest: XcmV1MultiLocation; + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly maxResponseWeight: Compact; + } & Struct; + readonly isBuyExecution: boolean; + readonly asBuyExecution: { + readonly fees: XcmV1MultiAsset; + readonly weightLimit: XcmV2WeightLimit; + } & Struct; + readonly isRefundSurplus: boolean; + readonly isSetErrorHandler: boolean; + readonly asSetErrorHandler: XcmV2Xcm; + readonly isSetAppendix: boolean; + readonly asSetAppendix: XcmV2Xcm; + readonly isClearError: boolean; + readonly isClaimAsset: boolean; + readonly asClaimAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly ticket: XcmV1MultiLocation; + } & Struct; + readonly isTrap: boolean; + readonly asTrap: Compact; + readonly isSubscribeVersion: boolean; + readonly asSubscribeVersion: { + readonly queryId: Compact; + readonly maxResponseWeight: Compact; + } & Struct; + readonly isUnsubscribeVersion: boolean; + readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion'; + } + + /** @name XcmV1MultiassetMultiAssets (58) */ + interface XcmV1MultiassetMultiAssets extends Vec {} + + /** @name XcmV1MultiAsset (60) */ + interface XcmV1MultiAsset extends Struct { + readonly id: XcmV1MultiassetAssetId; + readonly fun: XcmV1MultiassetFungibility; + } + + /** @name XcmV1MultiassetAssetId (61) */ + interface XcmV1MultiassetAssetId extends Enum { + readonly isConcrete: boolean; + readonly asConcrete: XcmV1MultiLocation; + readonly isAbstract: boolean; + readonly asAbstract: Bytes; + readonly type: 'Concrete' | 'Abstract'; + } + + /** @name XcmV1MultiassetFungibility (62) */ + interface XcmV1MultiassetFungibility extends Enum { + readonly isFungible: boolean; + readonly asFungible: Compact; + readonly isNonFungible: boolean; + readonly asNonFungible: XcmV1MultiassetAssetInstance; + readonly type: 'Fungible' | 'NonFungible'; + } + + /** @name XcmV1MultiassetAssetInstance (63) */ + interface XcmV1MultiassetAssetInstance extends Enum { + readonly isUndefined: boolean; + readonly isIndex: boolean; + readonly asIndex: Compact; + readonly isArray4: boolean; + readonly asArray4: U8aFixed; + readonly isArray8: boolean; + readonly asArray8: U8aFixed; + readonly isArray16: boolean; + readonly asArray16: U8aFixed; + readonly isArray32: boolean; + readonly asArray32: U8aFixed; + readonly isBlob: boolean; + readonly asBlob: Bytes; + readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob'; + } + + /** @name XcmV2Response (66) */ + interface XcmV2Response extends Enum { + readonly isNull: boolean; + readonly isAssets: boolean; + readonly asAssets: XcmV1MultiassetMultiAssets; + readonly isExecutionResult: boolean; + readonly asExecutionResult: Option>; + readonly isVersion: boolean; + readonly asVersion: u32; + readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version'; + } + + /** @name XcmV0OriginKind (69) */ + interface XcmV0OriginKind extends Enum { + readonly isNative: boolean; + readonly isSovereignAccount: boolean; + readonly isSuperuser: boolean; + readonly isXcm: boolean; + readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm'; + } + + /** @name XcmDoubleEncoded (70) */ + interface XcmDoubleEncoded extends Struct { + readonly encoded: Bytes; + } + + /** @name XcmV1MultiassetMultiAssetFilter (71) */ + interface XcmV1MultiassetMultiAssetFilter extends Enum { + readonly isDefinite: boolean; + readonly asDefinite: XcmV1MultiassetMultiAssets; + readonly isWild: boolean; + readonly asWild: XcmV1MultiassetWildMultiAsset; + readonly type: 'Definite' | 'Wild'; + } + + /** @name XcmV1MultiassetWildMultiAsset (72) */ + interface XcmV1MultiassetWildMultiAsset extends Enum { + readonly isAll: boolean; + readonly isAllOf: boolean; + readonly asAllOf: { + readonly id: XcmV1MultiassetAssetId; + readonly fun: XcmV1MultiassetWildFungibility; + } & Struct; + readonly type: 'All' | 'AllOf'; + } + + /** @name XcmV1MultiassetWildFungibility (73) */ + interface XcmV1MultiassetWildFungibility extends Enum { + readonly isFungible: boolean; + readonly isNonFungible: boolean; + readonly type: 'Fungible' | 'NonFungible'; + } + + /** @name XcmV2WeightLimit (74) */ + interface XcmV2WeightLimit extends Enum { + readonly isUnlimited: boolean; + readonly isLimited: boolean; + readonly asLimited: Compact; + readonly type: 'Unlimited' | 'Limited'; + } + + /** @name XcmVersionedMultiAssets (76) */ + interface XcmVersionedMultiAssets extends Enum { + readonly isV0: boolean; + readonly asV0: Vec; + readonly isV1: boolean; + readonly asV1: XcmV1MultiassetMultiAssets; + readonly type: 'V0' | 'V1'; } - /** @name XcmV0MultiAsset (100) */ - export interface XcmV0MultiAsset extends Enum { + /** @name XcmV0MultiAsset (78) */ + interface XcmV0MultiAsset extends Enum { readonly isNone: boolean; readonly isAll: boolean; readonly isAllFungible: boolean; @@ -892,2070 +870,1964 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'None' | 'All' | 'AllFungible' | 'AllNonFungible' | 'AllAbstractFungible' | 'AllAbstractNonFungible' | 'AllConcreteFungible' | 'AllConcreteNonFungible' | 'AbstractFungible' | 'AbstractNonFungible' | 'ConcreteFungible' | 'ConcreteNonFungible'; } - /** @name XcmV1MultiassetAssetInstance (101) */ - export interface XcmV1MultiassetAssetInstance extends Enum { - readonly isUndefined: boolean; - readonly isIndex: boolean; - readonly asIndex: Compact; - readonly isArray4: boolean; - readonly asArray4: U8aFixed; - readonly isArray8: boolean; - readonly asArray8: U8aFixed; - readonly isArray16: boolean; - readonly asArray16: U8aFixed; - readonly isArray32: boolean; - readonly asArray32: U8aFixed; - readonly isBlob: boolean; - readonly asBlob: Bytes; - readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob'; + /** @name XcmV0MultiLocation (79) */ + interface XcmV0MultiLocation extends Enum { + readonly isNull: boolean; + readonly isX1: boolean; + readonly asX1: XcmV0Junction; + readonly isX2: boolean; + readonly asX2: ITuple<[XcmV0Junction, XcmV0Junction]>; + readonly isX3: boolean; + readonly asX3: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly isX4: boolean; + readonly asX4: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly isX5: boolean; + readonly asX5: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly isX6: boolean; + readonly asX6: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly isX7: boolean; + readonly asX7: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly isX8: boolean; + readonly asX8: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>; + readonly type: 'Null' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; } - /** @name XcmV0Order (104) */ - export interface XcmV0Order extends Enum { - readonly isNull: boolean; - readonly isDepositAsset: boolean; - readonly asDepositAsset: { - readonly assets: Vec; - readonly dest: XcmV0MultiLocation; - } & Struct; - readonly isDepositReserveAsset: boolean; - readonly asDepositReserveAsset: { - readonly assets: Vec; - readonly dest: XcmV0MultiLocation; - readonly effects: Vec; - } & Struct; - readonly isExchangeAsset: boolean; - readonly asExchangeAsset: { - readonly give: Vec; - readonly receive: Vec; - } & Struct; - readonly isInitiateReserveWithdraw: boolean; - readonly asInitiateReserveWithdraw: { - readonly assets: Vec; - readonly reserve: XcmV0MultiLocation; - readonly effects: Vec; + /** @name XcmV0Junction (80) */ + interface XcmV0Junction extends Enum { + readonly isParent: boolean; + readonly isParachain: boolean; + readonly asParachain: Compact; + readonly isAccountId32: boolean; + readonly asAccountId32: { + readonly network: XcmV0JunctionNetworkId; + readonly id: U8aFixed; } & Struct; - readonly isInitiateTeleport: boolean; - readonly asInitiateTeleport: { - readonly assets: Vec; - readonly dest: XcmV0MultiLocation; - readonly effects: Vec; + readonly isAccountIndex64: boolean; + readonly asAccountIndex64: { + readonly network: XcmV0JunctionNetworkId; + readonly index: Compact; } & Struct; - readonly isQueryHolding: boolean; - readonly asQueryHolding: { - readonly queryId: Compact; - readonly dest: XcmV0MultiLocation; - readonly assets: Vec; + readonly isAccountKey20: boolean; + readonly asAccountKey20: { + readonly network: XcmV0JunctionNetworkId; + readonly key: U8aFixed; } & Struct; - readonly isBuyExecution: boolean; - readonly asBuyExecution: { - readonly fees: XcmV0MultiAsset; - readonly weight: u64; - readonly debt: u64; - readonly haltOnError: bool; - readonly xcm: Vec; + readonly isPalletInstance: boolean; + readonly asPalletInstance: u8; + readonly isGeneralIndex: boolean; + readonly asGeneralIndex: Compact; + readonly isGeneralKey: boolean; + readonly asGeneralKey: Bytes; + readonly isOnlyChild: boolean; + readonly isPlurality: boolean; + readonly asPlurality: { + readonly id: XcmV0JunctionBodyId; + readonly part: XcmV0JunctionBodyPart; } & Struct; - readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; - } - - /** @name XcmV0Response (106) */ - export interface XcmV0Response extends Enum { - readonly isAssets: boolean; - readonly asAssets: Vec; - readonly type: 'Assets'; + readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; } - /** @name XcmV0OriginKind (107) */ - export interface XcmV0OriginKind extends Enum { - readonly isNative: boolean; - readonly isSovereignAccount: boolean; - readonly isSuperuser: boolean; - readonly isXcm: boolean; - readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm'; + /** @name XcmVersionedMultiLocation (81) */ + interface XcmVersionedMultiLocation extends Enum { + readonly isV0: boolean; + readonly asV0: XcmV0MultiLocation; + readonly isV1: boolean; + readonly asV1: XcmV1MultiLocation; + readonly type: 'V0' | 'V1'; } - /** @name XcmDoubleEncoded (108) */ - export interface XcmDoubleEncoded extends Struct { - readonly encoded: Bytes; + /** @name CumulusPalletXcmEvent (82) */ + interface CumulusPalletXcmEvent extends Enum { + readonly isInvalidFormat: boolean; + readonly asInvalidFormat: U8aFixed; + readonly isUnsupportedVersion: boolean; + readonly asUnsupportedVersion: U8aFixed; + readonly isExecutedDownward: boolean; + readonly asExecutedDownward: ITuple<[U8aFixed, XcmV2TraitsOutcome]>; + readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; } - /** @name XcmV1Xcm (109) */ - export interface XcmV1Xcm extends Enum { - readonly isWithdrawAsset: boolean; - readonly asWithdrawAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly effects: Vec; - } & Struct; - readonly isReserveAssetDeposited: boolean; - readonly asReserveAssetDeposited: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly effects: Vec; - } & Struct; - readonly isReceiveTeleportedAsset: boolean; - readonly asReceiveTeleportedAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly effects: Vec; - } & Struct; - readonly isQueryResponse: boolean; - readonly asQueryResponse: { - readonly queryId: Compact; - readonly response: XcmV1Response; - } & Struct; - readonly isTransferAsset: boolean; - readonly asTransferAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly beneficiary: XcmV1MultiLocation; - } & Struct; - readonly isTransferReserveAsset: boolean; - readonly asTransferReserveAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly dest: XcmV1MultiLocation; - readonly effects: Vec; - } & Struct; - readonly isTransact: boolean; - readonly asTransact: { - readonly originType: XcmV0OriginKind; - readonly requireWeightAtMost: u64; - readonly call: XcmDoubleEncoded; + /** @name CumulusPalletDmpQueueEvent (83) */ + interface CumulusPalletDmpQueueEvent extends Enum { + readonly isInvalidFormat: boolean; + readonly asInvalidFormat: { + readonly messageId: U8aFixed; } & Struct; - readonly isHrmpNewChannelOpenRequest: boolean; - readonly asHrmpNewChannelOpenRequest: { - readonly sender: Compact; - readonly maxMessageSize: Compact; - readonly maxCapacity: Compact; + readonly isUnsupportedVersion: boolean; + readonly asUnsupportedVersion: { + readonly messageId: U8aFixed; } & Struct; - readonly isHrmpChannelAccepted: boolean; - readonly asHrmpChannelAccepted: { - readonly recipient: Compact; + readonly isExecutedDownward: boolean; + readonly asExecutedDownward: { + readonly messageId: U8aFixed; + readonly outcome: XcmV2TraitsOutcome; } & Struct; - readonly isHrmpChannelClosing: boolean; - readonly asHrmpChannelClosing: { - readonly initiator: Compact; - readonly sender: Compact; - readonly recipient: Compact; + readonly isWeightExhausted: boolean; + readonly asWeightExhausted: { + readonly messageId: U8aFixed; + readonly remainingWeight: u64; + readonly requiredWeight: u64; } & Struct; - readonly isRelayedFrom: boolean; - readonly asRelayedFrom: { - readonly who: XcmV1MultilocationJunctions; - readonly message: XcmV1Xcm; + readonly isOverweightEnqueued: boolean; + readonly asOverweightEnqueued: { + readonly messageId: U8aFixed; + readonly overweightIndex: u64; + readonly requiredWeight: u64; } & Struct; - readonly isSubscribeVersion: boolean; - readonly asSubscribeVersion: { - readonly queryId: Compact; - readonly maxResponseWeight: Compact; + readonly isOverweightServiced: boolean; + readonly asOverweightServiced: { + readonly overweightIndex: u64; + readonly weightUsed: u64; } & Struct; - readonly isUnsubscribeVersion: boolean; - readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion'; - } - - /** @name XcmV1MultiassetMultiAssets (110) */ - export interface XcmV1MultiassetMultiAssets extends Vec {} - - /** @name XcmV1MultiAsset (112) */ - export interface XcmV1MultiAsset extends Struct { - readonly id: XcmV1MultiassetAssetId; - readonly fun: XcmV1MultiassetFungibility; + readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name XcmV1MultiassetAssetId (113) */ - export interface XcmV1MultiassetAssetId extends Enum { - readonly isConcrete: boolean; - readonly asConcrete: XcmV1MultiLocation; - readonly isAbstract: boolean; - readonly asAbstract: Bytes; - readonly type: 'Concrete' | 'Abstract'; + /** @name PalletUniqueRawEvent (84) */ + interface PalletUniqueRawEvent extends Enum { + readonly isCollectionSponsorRemoved: boolean; + readonly asCollectionSponsorRemoved: u32; + readonly isCollectionAdminAdded: boolean; + readonly asCollectionAdminAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; + readonly isCollectionOwnedChanged: boolean; + readonly asCollectionOwnedChanged: ITuple<[u32, AccountId32]>; + readonly isCollectionSponsorSet: boolean; + readonly asCollectionSponsorSet: ITuple<[u32, AccountId32]>; + readonly isSponsorshipConfirmed: boolean; + readonly asSponsorshipConfirmed: ITuple<[u32, AccountId32]>; + readonly isCollectionAdminRemoved: boolean; + readonly asCollectionAdminRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; + readonly isAllowListAddressRemoved: boolean; + readonly asAllowListAddressRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; + readonly isAllowListAddressAdded: boolean; + readonly asAllowListAddressAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; + readonly isCollectionLimitSet: boolean; + readonly asCollectionLimitSet: u32; + readonly isCollectionPermissionSet: boolean; + readonly asCollectionPermissionSet: u32; + readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet'; } - /** @name XcmV1MultiassetFungibility (114) */ - export interface XcmV1MultiassetFungibility extends Enum { - readonly isFungible: boolean; - readonly asFungible: Compact; - readonly isNonFungible: boolean; - readonly asNonFungible: XcmV1MultiassetAssetInstance; - readonly type: 'Fungible' | 'NonFungible'; + /** @name PalletEvmAccountBasicCrossAccountIdRepr (85) */ + interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { + readonly isSubstrate: boolean; + readonly asSubstrate: AccountId32; + readonly isEthereum: boolean; + readonly asEthereum: H160; + readonly type: 'Substrate' | 'Ethereum'; } - /** @name XcmV1Order (116) */ - export interface XcmV1Order extends Enum { - readonly isNoop: boolean; - readonly isDepositAsset: boolean; - readonly asDepositAsset: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly maxAssets: u32; - readonly beneficiary: XcmV1MultiLocation; + /** @name PalletUniqueSchedulerEvent (88) */ + interface PalletUniqueSchedulerEvent extends Enum { + readonly isScheduled: boolean; + readonly asScheduled: { + readonly when: u32; + readonly index: u32; } & Struct; - readonly isDepositReserveAsset: boolean; - readonly asDepositReserveAsset: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly maxAssets: u32; - readonly dest: XcmV1MultiLocation; - readonly effects: Vec; - } & Struct; - readonly isExchangeAsset: boolean; - readonly asExchangeAsset: { - readonly give: XcmV1MultiassetMultiAssetFilter; - readonly receive: XcmV1MultiassetMultiAssets; - } & Struct; - readonly isInitiateReserveWithdraw: boolean; - readonly asInitiateReserveWithdraw: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly reserve: XcmV1MultiLocation; - readonly effects: Vec; - } & Struct; - readonly isInitiateTeleport: boolean; - readonly asInitiateTeleport: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly dest: XcmV1MultiLocation; - readonly effects: Vec; + readonly isCanceled: boolean; + readonly asCanceled: { + readonly when: u32; + readonly index: u32; } & Struct; - readonly isQueryHolding: boolean; - readonly asQueryHolding: { - readonly queryId: Compact; - readonly dest: XcmV1MultiLocation; - readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly isDispatched: boolean; + readonly asDispatched: { + readonly task: ITuple<[u32, u32]>; + readonly id: Option; + readonly result: Result; } & Struct; - readonly isBuyExecution: boolean; - readonly asBuyExecution: { - readonly fees: XcmV1MultiAsset; - readonly weight: u64; - readonly debt: u64; - readonly haltOnError: bool; - readonly instructions: Vec; + readonly isCallLookupFailed: boolean; + readonly asCallLookupFailed: { + readonly task: ITuple<[u32, u32]>; + readonly id: Option; + readonly error: FrameSupportScheduleLookupError; } & Struct; - readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; - } - - /** @name XcmV1MultiassetMultiAssetFilter (117) */ - export interface XcmV1MultiassetMultiAssetFilter extends Enum { - readonly isDefinite: boolean; - readonly asDefinite: XcmV1MultiassetMultiAssets; - readonly isWild: boolean; - readonly asWild: XcmV1MultiassetWildMultiAsset; - readonly type: 'Definite' | 'Wild'; + readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; } - /** @name XcmV1MultiassetWildMultiAsset (118) */ - export interface XcmV1MultiassetWildMultiAsset extends Enum { - readonly isAll: boolean; - readonly isAllOf: boolean; - readonly asAllOf: { - readonly id: XcmV1MultiassetAssetId; - readonly fun: XcmV1MultiassetWildFungibility; - } & Struct; - readonly type: 'All' | 'AllOf'; + /** @name FrameSupportScheduleLookupError (91) */ + interface FrameSupportScheduleLookupError extends Enum { + readonly isUnknown: boolean; + readonly isBadFormat: boolean; + readonly type: 'Unknown' | 'BadFormat'; } - /** @name XcmV1MultiassetWildFungibility (119) */ - export interface XcmV1MultiassetWildFungibility extends Enum { - readonly isFungible: boolean; - readonly isNonFungible: boolean; - readonly type: 'Fungible' | 'NonFungible'; + /** @name PalletCommonEvent (92) */ + interface PalletCommonEvent extends Enum { + readonly isCollectionCreated: boolean; + readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; + readonly isCollectionDestroyed: boolean; + readonly asCollectionDestroyed: u32; + readonly isItemCreated: boolean; + readonly asItemCreated: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; + readonly isItemDestroyed: boolean; + readonly asItemDestroyed: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; + readonly isTransfer: boolean; + readonly asTransfer: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; + readonly isApproved: boolean; + readonly asApproved: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; + readonly isCollectionPropertySet: boolean; + readonly asCollectionPropertySet: ITuple<[u32, Bytes]>; + readonly isCollectionPropertyDeleted: boolean; + readonly asCollectionPropertyDeleted: ITuple<[u32, Bytes]>; + readonly isTokenPropertySet: boolean; + readonly asTokenPropertySet: ITuple<[u32, u32, Bytes]>; + readonly isTokenPropertyDeleted: boolean; + readonly asTokenPropertyDeleted: ITuple<[u32, u32, Bytes]>; + readonly isPropertyPermissionSet: boolean; + readonly asPropertyPermissionSet: ITuple<[u32, Bytes]>; + readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; } - /** @name XcmV1Response (121) */ - export interface XcmV1Response extends Enum { - readonly isAssets: boolean; - readonly asAssets: XcmV1MultiassetMultiAssets; - readonly isVersion: boolean; - readonly asVersion: u32; - readonly type: 'Assets' | 'Version'; + /** @name PalletStructureEvent (95) */ + interface PalletStructureEvent extends Enum { + readonly isExecuted: boolean; + readonly asExecuted: Result; + readonly type: 'Executed'; } - /** @name XcmV2Xcm (122) */ - export interface XcmV2Xcm extends Vec {} - - /** @name XcmV2Instruction (124) */ - export interface XcmV2Instruction extends Enum { - readonly isWithdrawAsset: boolean; - readonly asWithdrawAsset: XcmV1MultiassetMultiAssets; - readonly isReserveAssetDeposited: boolean; - readonly asReserveAssetDeposited: XcmV1MultiassetMultiAssets; - readonly isReceiveTeleportedAsset: boolean; - readonly asReceiveTeleportedAsset: XcmV1MultiassetMultiAssets; - readonly isQueryResponse: boolean; - readonly asQueryResponse: { - readonly queryId: Compact; - readonly response: XcmV2Response; - readonly maxWeight: Compact; + /** @name PalletRmrkCoreEvent (96) */ + interface PalletRmrkCoreEvent extends Enum { + readonly isCollectionCreated: boolean; + readonly asCollectionCreated: { + readonly issuer: AccountId32; + readonly collectionId: u32; } & Struct; - readonly isTransferAsset: boolean; - readonly asTransferAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly beneficiary: XcmV1MultiLocation; + readonly isCollectionDestroyed: boolean; + readonly asCollectionDestroyed: { + readonly issuer: AccountId32; + readonly collectionId: u32; } & Struct; - readonly isTransferReserveAsset: boolean; - readonly asTransferReserveAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly dest: XcmV1MultiLocation; - readonly xcm: XcmV2Xcm; + readonly isIssuerChanged: boolean; + readonly asIssuerChanged: { + readonly oldIssuer: AccountId32; + readonly newIssuer: AccountId32; + readonly collectionId: u32; } & Struct; - readonly isTransact: boolean; - readonly asTransact: { - readonly originType: XcmV0OriginKind; - readonly requireWeightAtMost: Compact; - readonly call: XcmDoubleEncoded; + readonly isCollectionLocked: boolean; + readonly asCollectionLocked: { + readonly issuer: AccountId32; + readonly collectionId: u32; } & Struct; - readonly isHrmpNewChannelOpenRequest: boolean; - readonly asHrmpNewChannelOpenRequest: { - readonly sender: Compact; - readonly maxMessageSize: Compact; - readonly maxCapacity: Compact; + readonly isNftMinted: boolean; + readonly asNftMinted: { + readonly owner: AccountId32; + readonly collectionId: u32; + readonly nftId: u32; } & Struct; - readonly isHrmpChannelAccepted: boolean; - readonly asHrmpChannelAccepted: { - readonly recipient: Compact; + readonly isNftBurned: boolean; + readonly asNftBurned: { + readonly owner: AccountId32; + readonly nftId: u32; } & Struct; - readonly isHrmpChannelClosing: boolean; - readonly asHrmpChannelClosing: { - readonly initiator: Compact; - readonly sender: Compact; - readonly recipient: Compact; + readonly isNftSent: boolean; + readonly asNftSent: { + readonly sender: AccountId32; + readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; + readonly collectionId: u32; + readonly nftId: u32; + readonly approvalRequired: bool; } & Struct; - readonly isClearOrigin: boolean; - readonly isDescendOrigin: boolean; - readonly asDescendOrigin: XcmV1MultilocationJunctions; - readonly isReportError: boolean; - readonly asReportError: { - readonly queryId: Compact; - readonly dest: XcmV1MultiLocation; - readonly maxResponseWeight: Compact; + readonly isNftAccepted: boolean; + readonly asNftAccepted: { + readonly sender: AccountId32; + readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; + readonly collectionId: u32; + readonly nftId: u32; } & Struct; - readonly isDepositAsset: boolean; - readonly asDepositAsset: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly maxAssets: Compact; - readonly beneficiary: XcmV1MultiLocation; + readonly isNftRejected: boolean; + readonly asNftRejected: { + readonly sender: AccountId32; + readonly collectionId: u32; + readonly nftId: u32; } & Struct; - readonly isDepositReserveAsset: boolean; - readonly asDepositReserveAsset: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly maxAssets: Compact; - readonly dest: XcmV1MultiLocation; - readonly xcm: XcmV2Xcm; + readonly isPropertySet: boolean; + readonly asPropertySet: { + readonly collectionId: u32; + readonly maybeNftId: Option; + readonly key: Bytes; + readonly value: Bytes; } & Struct; - readonly isExchangeAsset: boolean; - readonly asExchangeAsset: { - readonly give: XcmV1MultiassetMultiAssetFilter; - readonly receive: XcmV1MultiassetMultiAssets; + readonly isResourceAdded: boolean; + readonly asResourceAdded: { + readonly nftId: u32; + readonly resourceId: u32; } & Struct; - readonly isInitiateReserveWithdraw: boolean; - readonly asInitiateReserveWithdraw: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly reserve: XcmV1MultiLocation; - readonly xcm: XcmV2Xcm; + readonly isResourceRemoval: boolean; + readonly asResourceRemoval: { + readonly nftId: u32; + readonly resourceId: u32; } & Struct; - readonly isInitiateTeleport: boolean; - readonly asInitiateTeleport: { - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly dest: XcmV1MultiLocation; - readonly xcm: XcmV2Xcm; + readonly isResourceAccepted: boolean; + readonly asResourceAccepted: { + readonly nftId: u32; + readonly resourceId: u32; } & Struct; - readonly isQueryHolding: boolean; - readonly asQueryHolding: { - readonly queryId: Compact; - readonly dest: XcmV1MultiLocation; - readonly assets: XcmV1MultiassetMultiAssetFilter; - readonly maxResponseWeight: Compact; + readonly isResourceRemovalAccepted: boolean; + readonly asResourceRemovalAccepted: { + readonly nftId: u32; + readonly resourceId: u32; } & Struct; - readonly isBuyExecution: boolean; - readonly asBuyExecution: { - readonly fees: XcmV1MultiAsset; - readonly weightLimit: XcmV2WeightLimit; + readonly isPrioritySet: boolean; + readonly asPrioritySet: { + readonly collectionId: u32; + readonly nftId: u32; } & Struct; - readonly isRefundSurplus: boolean; - readonly isSetErrorHandler: boolean; - readonly asSetErrorHandler: XcmV2Xcm; - readonly isSetAppendix: boolean; - readonly asSetAppendix: XcmV2Xcm; - readonly isClearError: boolean; - readonly isClaimAsset: boolean; - readonly asClaimAsset: { - readonly assets: XcmV1MultiassetMultiAssets; - readonly ticket: XcmV1MultiLocation; + readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; + } + + /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (97) */ + interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { + readonly isAccountId: boolean; + readonly asAccountId: AccountId32; + readonly isCollectionAndNftTuple: boolean; + readonly asCollectionAndNftTuple: ITuple<[u32, u32]>; + readonly type: 'AccountId' | 'CollectionAndNftTuple'; + } + + /** @name PalletRmrkEquipEvent (102) */ + interface PalletRmrkEquipEvent extends Enum { + readonly isBaseCreated: boolean; + readonly asBaseCreated: { + readonly issuer: AccountId32; + readonly baseId: u32; } & Struct; - readonly isTrap: boolean; - readonly asTrap: Compact; - readonly isSubscribeVersion: boolean; - readonly asSubscribeVersion: { - readonly queryId: Compact; - readonly maxResponseWeight: Compact; + readonly isEquippablesUpdated: boolean; + readonly asEquippablesUpdated: { + readonly baseId: u32; + readonly slotId: u32; } & Struct; - readonly isUnsubscribeVersion: boolean; - readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion'; + readonly type: 'BaseCreated' | 'EquippablesUpdated'; } - /** @name XcmV2Response (125) */ - export interface XcmV2Response extends Enum { - readonly isNull: boolean; - readonly isAssets: boolean; - readonly asAssets: XcmV1MultiassetMultiAssets; - readonly isExecutionResult: boolean; - readonly asExecutionResult: Option>; - readonly isVersion: boolean; - readonly asVersion: u32; - readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version'; + /** @name PalletEvmEvent (103) */ + interface PalletEvmEvent extends Enum { + readonly isLog: boolean; + readonly asLog: EthereumLog; + readonly isCreated: boolean; + readonly asCreated: H160; + readonly isCreatedFailed: boolean; + readonly asCreatedFailed: H160; + readonly isExecuted: boolean; + readonly asExecuted: H160; + readonly isExecutedFailed: boolean; + readonly asExecutedFailed: H160; + readonly isBalanceDeposit: boolean; + readonly asBalanceDeposit: ITuple<[AccountId32, H160, U256]>; + readonly isBalanceWithdraw: boolean; + readonly asBalanceWithdraw: ITuple<[AccountId32, H160, U256]>; + readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; } - /** @name XcmV2TraitsError (128) */ - export interface XcmV2TraitsError extends Enum { - readonly isOverflow: boolean; - readonly isUnimplemented: boolean; - readonly isUntrustedReserveLocation: boolean; - readonly isUntrustedTeleportLocation: boolean; - readonly isMultiLocationFull: boolean; - readonly isMultiLocationNotInvertible: boolean; - readonly isBadOrigin: boolean; - readonly isInvalidLocation: boolean; - readonly isAssetNotFound: boolean; - readonly isFailedToTransactAsset: boolean; - readonly isNotWithdrawable: boolean; - readonly isLocationCannotHold: boolean; - readonly isExceedsMaxMessageSize: boolean; - readonly isDestinationUnsupported: boolean; - readonly isTransport: boolean; - readonly isUnroutable: boolean; - readonly isUnknownClaim: boolean; - readonly isFailedToDecode: boolean; - readonly isMaxWeightInvalid: boolean; - readonly isNotHoldingFees: boolean; - readonly isTooExpensive: boolean; - readonly isTrap: boolean; - readonly asTrap: u64; - readonly isUnhandledXcmVersion: boolean; - readonly isWeightLimitReached: boolean; - readonly asWeightLimitReached: u64; - readonly isBarrier: boolean; - readonly isWeightNotComputable: boolean; - readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable'; + /** @name EthereumLog (104) */ + interface EthereumLog extends Struct { + readonly address: H160; + readonly topics: Vec; + readonly data: Bytes; } - /** @name XcmV2WeightLimit (129) */ - export interface XcmV2WeightLimit extends Enum { - readonly isUnlimited: boolean; - readonly isLimited: boolean; - readonly asLimited: Compact; - readonly type: 'Unlimited' | 'Limited'; + /** @name PalletEthereumEvent (108) */ + interface PalletEthereumEvent extends Enum { + readonly isExecuted: boolean; + readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; + readonly type: 'Executed'; } - /** @name XcmVersionedMultiAssets (130) */ - export interface XcmVersionedMultiAssets extends Enum { - readonly isV0: boolean; - readonly asV0: Vec; - readonly isV1: boolean; - readonly asV1: XcmV1MultiassetMultiAssets; - readonly type: 'V0' | 'V1'; + /** @name EvmCoreErrorExitReason (109) */ + interface EvmCoreErrorExitReason extends Enum { + readonly isSucceed: boolean; + readonly asSucceed: EvmCoreErrorExitSucceed; + readonly isError: boolean; + readonly asError: EvmCoreErrorExitError; + readonly isRevert: boolean; + readonly asRevert: EvmCoreErrorExitRevert; + readonly isFatal: boolean; + readonly asFatal: EvmCoreErrorExitFatal; + readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; } - /** @name CumulusPalletXcmCall (145) */ - export type CumulusPalletXcmCall = Null; + /** @name EvmCoreErrorExitSucceed (110) */ + interface EvmCoreErrorExitSucceed extends Enum { + readonly isStopped: boolean; + readonly isReturned: boolean; + readonly isSuicided: boolean; + readonly type: 'Stopped' | 'Returned' | 'Suicided'; + } - /** @name CumulusPalletDmpQueueCall (146) */ - export interface CumulusPalletDmpQueueCall extends Enum { - readonly isServiceOverweight: boolean; - readonly asServiceOverweight: { - readonly index: u64; - readonly weightLimit: u64; - } & Struct; - readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; + /** @name EvmCoreErrorExitError (111) */ + interface EvmCoreErrorExitError extends Enum { + readonly isStackUnderflow: boolean; + readonly isStackOverflow: boolean; + readonly isInvalidJump: boolean; + readonly isInvalidRange: boolean; + readonly isDesignatedInvalid: boolean; + readonly isCallTooDeep: boolean; + readonly isCreateCollision: boolean; + readonly isCreateContractLimit: boolean; + readonly isOutOfOffset: boolean; + readonly isOutOfGas: boolean; + readonly isOutOfFund: boolean; + readonly isPcUnderflow: boolean; + readonly isCreateEmpty: boolean; + readonly isOther: boolean; + readonly asOther: Text; + readonly isInvalidCode: boolean; + readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; } - /** @name XcmVersionedMultiLocation (81) */ - interface XcmVersionedMultiLocation extends Enum { - readonly isV0: boolean; - readonly asV0: XcmV0MultiLocation; - readonly isV1: boolean; - readonly asV1: XcmV1MultiLocation; - readonly type: 'V0' | 'V1'; + /** @name EvmCoreErrorExitRevert (114) */ + interface EvmCoreErrorExitRevert extends Enum { + readonly isReverted: boolean; + readonly type: 'Reverted'; } - /** @name CumulusPalletXcmEvent (82) */ - interface CumulusPalletXcmEvent extends Enum { - readonly isInvalidFormat: boolean; - readonly asInvalidFormat: U8aFixed; - readonly isUnsupportedVersion: boolean; - readonly asUnsupportedVersion: U8aFixed; - readonly isExecutedDownward: boolean; - readonly asExecutedDownward: ITuple<[U8aFixed, XcmV2TraitsOutcome]>; - readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; + /** @name EvmCoreErrorExitFatal (115) */ + interface EvmCoreErrorExitFatal extends Enum { + readonly isNotSupported: boolean; + readonly isUnhandledInterrupt: boolean; + readonly isCallErrorAsFatal: boolean; + readonly asCallErrorAsFatal: EvmCoreErrorExitError; + readonly isOther: boolean; + readonly asOther: Text; + readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; } - /** @name PalletInflationCall (147) */ - export interface PalletInflationCall extends Enum { - readonly isStartInflation: boolean; - readonly asStartInflation: { - readonly inflationStartRelayBlock: u32; - } & Struct; -<<<<<<< HEAD - readonly isUnsupportedVersion: boolean; - readonly asUnsupportedVersion: { - readonly messageId: U8aFixed; -======= - readonly type: 'StartInflation'; + /** @name FrameSystemPhase (116) */ + interface FrameSystemPhase extends Enum { + readonly isApplyExtrinsic: boolean; + readonly asApplyExtrinsic: u32; + readonly isFinalization: boolean; + readonly isInitialization: boolean; + readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } - /** @name PalletUniqueCall (148) */ - export interface PalletUniqueCall extends Enum { - readonly isCreateCollection: boolean; - readonly asCreateCollection: { - readonly collectionName: Vec; - readonly collectionDescription: Vec; - readonly tokenPrefix: Bytes; - readonly mode: UpDataStructsCollectionMode; ->>>>>>> b43f8da0... added totalstaked & fix bug with number in RPC Client + /** @name FrameSystemLastRuntimeUpgradeInfo (118) */ + interface FrameSystemLastRuntimeUpgradeInfo extends Struct { + readonly specVersion: Compact; + readonly specName: Text; + } + + /** @name FrameSystemCall (119) */ + interface FrameSystemCall extends Enum { + readonly isFillBlock: boolean; + readonly asFillBlock: { + readonly ratio: Perbill; } & Struct; - readonly isExecutedDownward: boolean; - readonly asExecutedDownward: { - readonly messageId: U8aFixed; - readonly outcome: XcmV2TraitsOutcome; + readonly isRemark: boolean; + readonly asRemark: { + readonly remark: Bytes; } & Struct; - readonly isWeightExhausted: boolean; - readonly asWeightExhausted: { - readonly messageId: U8aFixed; - readonly remainingWeight: u64; - readonly requiredWeight: u64; + readonly isSetHeapPages: boolean; + readonly asSetHeapPages: { + readonly pages: u64; } & Struct; - readonly isOverweightEnqueued: boolean; - readonly asOverweightEnqueued: { - readonly messageId: U8aFixed; - readonly overweightIndex: u64; - readonly requiredWeight: u64; + readonly isSetCode: boolean; + readonly asSetCode: { + readonly code: Bytes; } & Struct; - readonly isOverweightServiced: boolean; - readonly asOverweightServiced: { - readonly overweightIndex: u64; - readonly weightUsed: u64; + readonly isSetCodeWithoutChecks: boolean; + readonly asSetCodeWithoutChecks: { + readonly code: Bytes; } & Struct; - readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced'; + readonly isSetStorage: boolean; + readonly asSetStorage: { + readonly items: Vec>; + } & Struct; + readonly isKillStorage: boolean; + readonly asKillStorage: { + readonly keys_: Vec; + } & Struct; + readonly isKillPrefix: boolean; + readonly asKillPrefix: { + readonly prefix: Bytes; + readonly subkeys: u32; + } & Struct; + readonly isRemarkWithEvent: boolean; + readonly asRemarkWithEvent: { + readonly remark: Bytes; + } & Struct; + readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent'; } - /** @name PalletUniqueRawEvent (84) */ - interface PalletUniqueRawEvent extends Enum { - readonly isCollectionSponsorRemoved: boolean; - readonly asCollectionSponsorRemoved: u32; - readonly isCollectionAdminAdded: boolean; - readonly asCollectionAdminAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; - readonly isCollectionOwnedChanged: boolean; - readonly asCollectionOwnedChanged: ITuple<[u32, AccountId32]>; - readonly isCollectionSponsorSet: boolean; - readonly asCollectionSponsorSet: ITuple<[u32, AccountId32]>; - readonly isSponsorshipConfirmed: boolean; - readonly asSponsorshipConfirmed: ITuple<[u32, AccountId32]>; - readonly isCollectionAdminRemoved: boolean; - readonly asCollectionAdminRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; - readonly isAllowListAddressRemoved: boolean; - readonly asAllowListAddressRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; - readonly isAllowListAddressAdded: boolean; - readonly asAllowListAddressAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; - readonly isCollectionLimitSet: boolean; - readonly asCollectionLimitSet: u32; - readonly isCollectionPermissionSet: boolean; - readonly asCollectionPermissionSet: u32; - readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet'; + /** @name FrameSystemLimitsBlockWeights (124) */ + interface FrameSystemLimitsBlockWeights extends Struct { + readonly baseBlock: u64; + readonly maxBlock: u64; + readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; } - /** @name PalletEvmAccountBasicCrossAccountIdRepr (85) */ - interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { - readonly isSubstrate: boolean; - readonly asSubstrate: AccountId32; - readonly isEthereum: boolean; - readonly asEthereum: H160; - readonly type: 'Substrate' | 'Ethereum'; + /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (125) */ + interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { + readonly normal: FrameSystemLimitsWeightsPerClass; + readonly operational: FrameSystemLimitsWeightsPerClass; + readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name PalletUniqueSchedulerEvent (88) */ - interface PalletUniqueSchedulerEvent extends Enum { - readonly isScheduled: boolean; - readonly asScheduled: { - readonly when: u32; - readonly index: u32; - } & Struct; - readonly isCanceled: boolean; - readonly asCanceled: { - readonly when: u32; - readonly index: u32; - } & Struct; - readonly isDispatched: boolean; - readonly asDispatched: { - readonly task: ITuple<[u32, u32]>; - readonly id: Option; - readonly result: Result; - } & Struct; - readonly isCallLookupFailed: boolean; - readonly asCallLookupFailed: { - readonly task: ITuple<[u32, u32]>; - readonly id: Option; - readonly error: FrameSupportScheduleLookupError; - } & Struct; - readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; + /** @name FrameSystemLimitsWeightsPerClass (126) */ + interface FrameSystemLimitsWeightsPerClass extends Struct { + readonly baseExtrinsic: u64; + readonly maxExtrinsic: Option; + readonly maxTotal: Option; + readonly reserved: Option; } - /** @name FrameSupportScheduleLookupError (91) */ - interface FrameSupportScheduleLookupError extends Enum { - readonly isUnknown: boolean; - readonly isBadFormat: boolean; - readonly type: 'Unknown' | 'BadFormat'; + /** @name FrameSystemLimitsBlockLength (128) */ + interface FrameSystemLimitsBlockLength extends Struct { + readonly max: FrameSupportWeightsPerDispatchClassU32; } - /** @name PalletCommonEvent (92) */ - interface PalletCommonEvent extends Enum { - readonly isCollectionCreated: boolean; - readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; - readonly isCollectionDestroyed: boolean; - readonly asCollectionDestroyed: u32; - readonly isItemCreated: boolean; - readonly asItemCreated: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; - readonly isItemDestroyed: boolean; - readonly asItemDestroyed: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; - readonly isTransfer: boolean; - readonly asTransfer: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; - readonly isApproved: boolean; - readonly asApproved: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; - readonly isCollectionPropertySet: boolean; - readonly asCollectionPropertySet: ITuple<[u32, Bytes]>; - readonly isCollectionPropertyDeleted: boolean; - readonly asCollectionPropertyDeleted: ITuple<[u32, Bytes]>; - readonly isTokenPropertySet: boolean; - readonly asTokenPropertySet: ITuple<[u32, u32, Bytes]>; - readonly isTokenPropertyDeleted: boolean; - readonly asTokenPropertyDeleted: ITuple<[u32, u32, Bytes]>; - readonly isPropertyPermissionSet: boolean; - readonly asPropertyPermissionSet: ITuple<[u32, Bytes]>; - readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; + /** @name FrameSupportWeightsPerDispatchClassU32 (129) */ + interface FrameSupportWeightsPerDispatchClassU32 extends Struct { + readonly normal: u32; + readonly operational: u32; + readonly mandatory: u32; } - /** @name PalletStructureEvent (95) */ - interface PalletStructureEvent extends Enum { - readonly isExecuted: boolean; - readonly asExecuted: Result; - readonly type: 'Executed'; + /** @name FrameSupportWeightsRuntimeDbWeight (130) */ + interface FrameSupportWeightsRuntimeDbWeight extends Struct { + readonly read: u64; + readonly write: u64; } - /** @name PalletRmrkCoreEvent (96) */ - interface PalletRmrkCoreEvent extends Enum { - readonly isCollectionCreated: boolean; - readonly asCollectionCreated: { - readonly issuer: AccountId32; - readonly collectionId: u32; - } & Struct; - readonly isCollectionDestroyed: boolean; - readonly asCollectionDestroyed: { - readonly issuer: AccountId32; - readonly collectionId: u32; - readonly newAdmin: PalletEvmAccountBasicCrossAccountIdRepr; - } & Struct; - readonly isIssuerChanged: boolean; - readonly asIssuerChanged: { - readonly oldIssuer: AccountId32; - readonly newIssuer: AccountId32; - readonly collectionId: u32; - } & Struct; - readonly isCollectionLocked: boolean; - readonly asCollectionLocked: { - readonly issuer: AccountId32; - readonly collectionId: u32; - } & Struct; - readonly isNftMinted: boolean; - readonly asNftMinted: { - readonly owner: AccountId32; - readonly collectionId: u32; - readonly nftId: u32; - } & Struct; - readonly isNftBurned: boolean; - readonly asNftBurned: { - readonly owner: AccountId32; - readonly nftId: u32; - } & Struct; - readonly isNftSent: boolean; - readonly asNftSent: { - readonly sender: AccountId32; - readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; - readonly collectionId: u32; - readonly nftId: u32; - readonly approvalRequired: bool; - } & Struct; - readonly isNftAccepted: boolean; - readonly asNftAccepted: { - readonly sender: AccountId32; - readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; - readonly collectionId: u32; - readonly nftId: u32; - } & Struct; - readonly isNftRejected: boolean; - readonly asNftRejected: { - readonly sender: AccountId32; - readonly collectionId: u32; - readonly nftId: u32; - } & Struct; - readonly isPropertySet: boolean; - readonly asPropertySet: { - readonly collectionId: u32; - readonly maybeNftId: Option; - readonly key: Bytes; - readonly value: Bytes; - } & Struct; - readonly isResourceAdded: boolean; - readonly asResourceAdded: { - readonly nftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isResourceRemoval: boolean; - readonly asResourceRemoval: { - readonly nftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isResourceAccepted: boolean; - readonly asResourceAccepted: { - readonly nftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isCreateMultipleItemsEx: boolean; - readonly asCreateMultipleItemsEx: { - readonly collectionId: u32; - readonly data: UpDataStructsCreateItemExData; - } & Struct; - readonly isSetTransfersEnabledFlag: boolean; - readonly asSetTransfersEnabledFlag: { - readonly collectionId: u32; - readonly value: bool; - } & Struct; - readonly isBurnItem: boolean; - readonly asBurnItem: { - readonly collectionId: u32; - readonly itemId: u32; - readonly value: u128; - } & Struct; - readonly isBurnFrom: boolean; - readonly asBurnFrom: { - readonly collectionId: u32; - readonly from: PalletEvmAccountBasicCrossAccountIdRepr; - readonly itemId: u32; - readonly value: u128; - } & Struct; - readonly isSetCode: boolean; - readonly asSetCode: { - readonly code: Bytes; - } & Struct; - readonly isSetCodeWithoutChecks: boolean; - readonly asSetCodeWithoutChecks: { - readonly code: Bytes; - } & Struct; - readonly isSetStorage: boolean; - readonly asSetStorage: { - readonly items: Vec>; - } & Struct; - readonly isKillStorage: boolean; - readonly asKillStorage: { - readonly keys_: Vec; - } & Struct; - readonly isKillPrefix: boolean; - readonly asKillPrefix: { - readonly prefix: Bytes; - readonly subkeys: u32; - } & Struct; - readonly isRemarkWithEvent: boolean; - readonly asRemarkWithEvent: { - readonly remark: Bytes; - } & Struct; - readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; + /** @name SpVersionRuntimeVersion (131) */ + interface SpVersionRuntimeVersion extends Struct { + readonly specName: Text; + readonly implName: Text; + readonly authoringVersion: u32; + readonly specVersion: u32; + readonly implVersion: u32; + readonly apis: Vec>; + readonly transactionVersion: u32; + readonly stateVersion: u8; } - /** @name UpDataStructsCollectionMode (155) */ - export interface UpDataStructsCollectionMode extends Enum { - readonly isNft: boolean; - readonly isFungible: boolean; - readonly asFungible: u8; - readonly isReFungible: boolean; - readonly type: 'Nft' | 'Fungible' | 'ReFungible'; + /** @name FrameSystemError (136) */ + interface FrameSystemError extends Enum { + readonly isInvalidSpecName: boolean; + readonly isSpecVersionNeedsToIncrease: boolean; + readonly isFailedToExtractRuntimeVersion: boolean; + readonly isNonDefaultComposite: boolean; + readonly isNonZeroRefCount: boolean; + readonly isCallFiltered: boolean; + readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name UpDataStructsCreateCollectionData (155) */ - export interface UpDataStructsCreateCollectionData extends Struct { - readonly mode: UpDataStructsCollectionMode; - readonly access: Option; - readonly name: Vec; - readonly description: Vec; - readonly tokenPrefix: Bytes; - readonly pendingSponsor: Option; - readonly limits: Option; - readonly permissions: Option; - readonly tokenPropertyPermissions: Vec; - readonly properties: Vec; + /** @name PolkadotPrimitivesV2PersistedValidationData (137) */ + interface PolkadotPrimitivesV2PersistedValidationData extends Struct { + readonly parentHead: Bytes; + readonly relayParentNumber: u32; + readonly relayParentStorageRoot: H256; + readonly maxPovSize: u32; } - /** @name UpDataStructsAccessMode (157) */ - export interface UpDataStructsAccessMode extends Enum { - readonly isNormal: boolean; - readonly isAllowList: boolean; - readonly type: 'Normal' | 'AllowList'; + /** @name PolkadotPrimitivesV2UpgradeRestriction (140) */ + interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { + readonly isPresent: boolean; + readonly type: 'Present'; } - /** @name UpDataStructsCollectionLimits (160) */ - export interface UpDataStructsCollectionLimits extends Struct { - readonly accountTokenOwnershipLimit: Option; - readonly sponsoredDataSize: Option; - readonly sponsoredDataRateLimit: Option; - readonly tokenLimit: Option; - readonly sponsorTransferTimeout: Option; - readonly sponsorApproveTimeout: Option; - readonly ownerCanTransfer: Option; - readonly ownerCanDestroy: Option; - readonly transfersEnabled: Option; + /** @name SpTrieStorageProof (141) */ + interface SpTrieStorageProof extends Struct { + readonly trieNodes: BTreeSet; } - /** @name UpDataStructsSponsoringRateLimit (162) */ - export interface UpDataStructsSponsoringRateLimit extends Enum { - readonly isSponsoringDisabled: boolean; - readonly isBlocks: boolean; - readonly asBlocks: u32; - readonly type: 'SponsoringDisabled' | 'Blocks'; + /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (143) */ + interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { + readonly dmqMqcHead: H256; + readonly relayDispatchQueueSize: ITuple<[u32, u32]>; + readonly ingressChannels: Vec>; + readonly egressChannels: Vec>; } - /** @name UpDataStructsCollectionPermissions (165) */ - export interface UpDataStructsCollectionPermissions extends Struct { - readonly access: Option; - readonly mintMode: Option; - readonly nesting: Option; + /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (146) */ + interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { + readonly maxCapacity: u32; + readonly maxTotalSize: u32; + readonly maxMessageSize: u32; + readonly msgCount: u32; + readonly totalSize: u32; + readonly mqcHead: Option; } - /** @name UpDataStructsNestingPermissions (167) */ - export interface UpDataStructsNestingPermissions extends Struct { - readonly tokenOwner: bool; - readonly collectionAdmin: bool; - readonly restricted: Option; + /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (147) */ + interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { + readonly maxCodeSize: u32; + readonly maxHeadDataSize: u32; + readonly maxUpwardQueueCount: u32; + readonly maxUpwardQueueSize: u32; + readonly maxUpwardMessageSize: u32; + readonly maxUpwardMessageNumPerCandidate: u32; + readonly hrmpMaxMessageNumPerCandidate: u32; + readonly validationUpgradeCooldown: u32; + readonly validationUpgradeDelay: u32; } - /** @name UpDataStructsOwnerRestrictedSet (169) */ - export interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} + /** @name PolkadotCorePrimitivesOutboundHrmpMessage (153) */ + interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { + readonly recipient: u32; + readonly data: Bytes; + } - /** @name UpDataStructsPropertyKeyPermission (175) */ - export interface UpDataStructsPropertyKeyPermission extends Struct { - readonly key: Bytes; - readonly permission: UpDataStructsPropertyPermission; + /** @name CumulusPalletParachainSystemCall (154) */ + interface CumulusPalletParachainSystemCall extends Enum { + readonly isSetValidationData: boolean; + readonly asSetValidationData: { + readonly data: CumulusPrimitivesParachainInherentParachainInherentData; + } & Struct; + readonly isSudoSendUpwardMessage: boolean; + readonly asSudoSendUpwardMessage: { + readonly message: Bytes; + } & Struct; + readonly isAuthorizeUpgrade: boolean; + readonly asAuthorizeUpgrade: { + readonly codeHash: H256; + } & Struct; + readonly isEnactAuthorizedUpgrade: boolean; + readonly asEnactAuthorizedUpgrade: { + readonly code: Bytes; + } & Struct; + readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade'; } - /** @name UpDataStructsPropertyPermission (177) */ - export interface UpDataStructsPropertyPermission extends Struct { - readonly mutable: bool; - readonly collectionAdmin: bool; - readonly tokenOwner: bool; + /** @name CumulusPrimitivesParachainInherentParachainInherentData (155) */ + interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { + readonly validationData: PolkadotPrimitivesV2PersistedValidationData; + readonly relayChainState: SpTrieStorageProof; + readonly downwardMessages: Vec; + readonly horizontalMessages: BTreeMap>; } - /** @name UpDataStructsProperty (180) */ - export interface UpDataStructsProperty extends Struct { - readonly key: Bytes; - readonly value: Bytes; + /** @name PolkadotCorePrimitivesInboundDownwardMessage (157) */ + interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { + readonly sentAt: u32; + readonly msg: Bytes; } - /** @name PalletEvmAccountBasicCrossAccountIdRepr (183) */ - export interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { - readonly isSubstrate: boolean; - readonly asSubstrate: AccountId32; - readonly isEthereum: boolean; - readonly asEthereum: H160; - readonly type: 'Substrate' | 'Ethereum'; + /** @name PolkadotCorePrimitivesInboundHrmpMessage (160) */ + interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { + readonly sentAt: u32; + readonly data: Bytes; } - /** @name UpDataStructsCreateItemData (185) */ - export interface UpDataStructsCreateItemData extends Enum { - readonly isNft: boolean; - readonly asNft: UpDataStructsCreateNftData; - readonly isFungible: boolean; - readonly asFungible: UpDataStructsCreateFungibleData; - readonly isReFungible: boolean; - readonly asReFungible: UpDataStructsCreateReFungibleData; - readonly type: 'Nft' | 'Fungible' | 'ReFungible'; + /** @name CumulusPalletParachainSystemError (163) */ + interface CumulusPalletParachainSystemError extends Enum { + readonly isOverlappingUpgrades: boolean; + readonly isProhibitedByPolkadot: boolean; + readonly isTooBig: boolean; + readonly isValidationDataNotAvailable: boolean; + readonly isHostConfigurationNotAvailable: boolean; + readonly isNotScheduled: boolean; + readonly isNothingAuthorized: boolean; + readonly isUnauthorized: boolean; + readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized'; } - /** @name UpDataStructsCreateNftData (186) */ - export interface UpDataStructsCreateNftData extends Struct { - readonly properties: Vec; + /** @name PalletBalancesBalanceLock (165) */ + interface PalletBalancesBalanceLock extends Struct { + readonly id: U8aFixed; + readonly amount: u128; + readonly reasons: PalletBalancesReasons; } - /** @name UpDataStructsCreateFungibleData (187) */ - export interface UpDataStructsCreateFungibleData extends Struct { - readonly value: u128; + /** @name PalletBalancesReasons (166) */ + interface PalletBalancesReasons extends Enum { + readonly isFee: boolean; + readonly isMisc: boolean; + readonly isAll: boolean; + readonly type: 'Fee' | 'Misc' | 'All'; } - /** @name UpDataStructsCreateReFungibleData (188) */ - export interface UpDataStructsCreateReFungibleData extends Struct { - readonly pieces: u128; - readonly properties: Vec; ->>>>>>> b43f8da0... added totalstaked & fix bug with number in RPC Client + /** @name PalletBalancesReserveData (169) */ + interface PalletBalancesReserveData extends Struct { + readonly id: U8aFixed; + readonly amount: u128; } - /** @name FrameSystemLimitsBlockLength (128) */ - interface FrameSystemLimitsBlockLength extends Struct { - readonly max: FrameSupportWeightsPerDispatchClassU32; + /** @name PalletBalancesReleases (171) */ + interface PalletBalancesReleases extends Enum { + readonly isV100: boolean; + readonly isV200: boolean; + readonly type: 'V100' | 'V200'; } - /** @name FrameSupportWeightsPerDispatchClassU32 (129) */ - interface FrameSupportWeightsPerDispatchClassU32 extends Struct { - readonly normal: u32; - readonly operational: u32; - readonly mandatory: u32; + /** @name PalletBalancesCall (172) */ + interface PalletBalancesCall extends Enum { + readonly isTransfer: boolean; + readonly asTransfer: { + readonly dest: MultiAddress; + readonly value: Compact; + } & Struct; + readonly isSetBalance: boolean; + readonly asSetBalance: { + readonly who: MultiAddress; + readonly newFree: Compact; + readonly newReserved: Compact; + } & Struct; + readonly isForceTransfer: boolean; + readonly asForceTransfer: { + readonly source: MultiAddress; + readonly dest: MultiAddress; + readonly value: Compact; + } & Struct; + readonly isTransferKeepAlive: boolean; + readonly asTransferKeepAlive: { + readonly dest: MultiAddress; + readonly value: Compact; + } & Struct; + readonly isTransferAll: boolean; + readonly asTransferAll: { + readonly dest: MultiAddress; + readonly keepAlive: bool; + } & Struct; + readonly isForceUnreserve: boolean; + readonly asForceUnreserve: { + readonly who: MultiAddress; + readonly amount: u128; + } & Struct; + readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; } - /** @name FrameSupportWeightsRuntimeDbWeight (130) */ - interface FrameSupportWeightsRuntimeDbWeight extends Struct { - readonly read: u64; - readonly write: u64; + /** @name PalletBalancesError (175) */ + interface PalletBalancesError extends Enum { + readonly isVestingBalance: boolean; + readonly isLiquidityRestrictions: boolean; + readonly isInsufficientBalance: boolean; + readonly isExistentialDeposit: boolean; + readonly isKeepAlive: boolean; + readonly isExistingVestingSchedule: boolean; + readonly isDeadAccount: boolean; + readonly isTooManyReserves: boolean; + readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves'; } - /** @name SpVersionRuntimeVersion (131) */ - interface SpVersionRuntimeVersion extends Struct { - readonly specName: Text; - readonly implName: Text; - readonly authoringVersion: u32; - readonly specVersion: u32; - readonly implVersion: u32; - readonly apis: Vec>; - readonly transactionVersion: u32; - readonly stateVersion: u8; + /** @name PalletTimestampCall (177) */ + interface PalletTimestampCall extends Enum { + readonly isSet: boolean; + readonly asSet: { + readonly now: Compact; + } & Struct; + readonly type: 'Set'; + } + + /** @name PalletTransactionPaymentReleases (179) */ + interface PalletTransactionPaymentReleases extends Enum { + readonly isV1Ancient: boolean; + readonly isV2: boolean; + readonly type: 'V1Ancient' | 'V2'; } -<<<<<<< HEAD - /** @name FrameSystemError (136) */ - interface FrameSystemError extends Enum { - readonly isInvalidSpecName: boolean; - readonly isSpecVersionNeedsToIncrease: boolean; - readonly isFailedToExtractRuntimeVersion: boolean; - readonly isNonDefaultComposite: boolean; - readonly isNonZeroRefCount: boolean; - readonly isCallFiltered: boolean; - readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; + /** @name PalletTreasuryProposal (180) */ + interface PalletTreasuryProposal extends Struct { + readonly proposer: AccountId32; + readonly value: u128; + readonly beneficiary: AccountId32; + readonly bond: u128; } - /** @name UpDataStructsCreateItemExData (192) */ - export interface UpDataStructsCreateItemExData extends Enum { - readonly isNft: boolean; - readonly asNft: Vec; - readonly isFungible: boolean; - readonly asFungible: BTreeMap; - readonly isRefungibleMultipleItems: boolean; - readonly asRefungibleMultipleItems: Vec; - readonly isRefungibleMultipleOwners: boolean; - readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners; - readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; + /** @name PalletTreasuryCall (183) */ + interface PalletTreasuryCall extends Enum { + readonly isProposeSpend: boolean; + readonly asProposeSpend: { + readonly value: Compact; + readonly beneficiary: MultiAddress; + } & Struct; + readonly isRejectProposal: boolean; + readonly asRejectProposal: { + readonly proposalId: Compact; + } & Struct; + readonly isApproveProposal: boolean; + readonly asApproveProposal: { + readonly proposalId: Compact; + } & Struct; + readonly isSpend: boolean; + readonly asSpend: { + readonly amount: Compact; + readonly beneficiary: MultiAddress; + } & Struct; + readonly isRemoveApproval: boolean; + readonly asRemoveApproval: { + readonly proposalId: Compact; + } & Struct; + readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval'; } - /** @name UpDataStructsCreateNftExData (194) */ - export interface UpDataStructsCreateNftExData extends Struct { - readonly properties: Vec; - readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; - } + /** @name FrameSupportPalletId (186) */ + interface FrameSupportPalletId extends U8aFixed {} - /** @name UpDataStructsCreateRefungibleExSingleOwner (201) */ - export interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { - readonly user: PalletEvmAccountBasicCrossAccountIdRepr; - readonly pieces: u128; - readonly properties: Vec; + /** @name PalletTreasuryError (187) */ + interface PalletTreasuryError extends Enum { + readonly isInsufficientProposersBalance: boolean; + readonly isInvalidIndex: boolean; + readonly isTooManyApprovals: boolean; + readonly isInsufficientPermission: boolean; + readonly isProposalNotApproved: boolean; + readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved'; } - /** @name UpDataStructsCreateRefungibleExMultipleOwners (203) */ - export interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { - readonly users: BTreeMap; - readonly properties: Vec; + /** @name PalletSudoCall (188) */ + interface PalletSudoCall extends Enum { + readonly isSudo: boolean; + readonly asSudo: { + readonly call: Call; + } & Struct; + readonly isSudoUncheckedWeight: boolean; + readonly asSudoUncheckedWeight: { + readonly call: Call; + readonly weight: u64; + } & Struct; + readonly isSetKey: boolean; + readonly asSetKey: { + readonly new_: MultiAddress; + } & Struct; + readonly isSudoAs: boolean; + readonly asSudoAs: { + readonly who: MultiAddress; + readonly call: Call; + } & Struct; + readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs'; } - /** @name PalletUniqueSchedulerCall (204) */ - export interface PalletUniqueSchedulerCall extends Enum { - readonly isScheduleNamed: boolean; - readonly asScheduleNamed: { - readonly id: U8aFixed; - readonly when: u32; - readonly maybePeriodic: Option>; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; + /** @name OrmlVestingModuleCall (190) */ + interface OrmlVestingModuleCall extends Enum { + readonly isClaim: boolean; + readonly isVestedTransfer: boolean; + readonly asVestedTransfer: { + readonly dest: MultiAddress; + readonly schedule: OrmlVestingVestingSchedule; } & Struct; - readonly isCancelNamed: boolean; - readonly asCancelNamed: { - readonly id: U8aFixed; + readonly isUpdateVestingSchedules: boolean; + readonly asUpdateVestingSchedules: { + readonly who: MultiAddress; + readonly vestingSchedules: Vec; } & Struct; - readonly isScheduleNamedAfter: boolean; - readonly asScheduleNamedAfter: { - readonly id: U8aFixed; - readonly after: u32; - readonly maybePeriodic: Option>; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; + readonly isClaimFor: boolean; + readonly asClaimFor: { + readonly dest: MultiAddress; } & Struct; - readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; + readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor'; } - /** @name FrameSupportScheduleMaybeHashed (206) */ - export interface FrameSupportScheduleMaybeHashed extends Enum { - readonly isValue: boolean; - readonly asValue: Call; - readonly isHash: boolean; - readonly asHash: H256; - readonly type: 'Value' | 'Hash'; + /** @name CumulusPalletXcmpQueueCall (192) */ + interface CumulusPalletXcmpQueueCall extends Enum { + readonly isServiceOverweight: boolean; + readonly asServiceOverweight: { + readonly index: u64; + readonly weightLimit: u64; + } & Struct; + readonly isSuspendXcmExecution: boolean; + readonly isResumeXcmExecution: boolean; + readonly isUpdateSuspendThreshold: boolean; + readonly asUpdateSuspendThreshold: { + readonly new_: u32; + } & Struct; + readonly isUpdateDropThreshold: boolean; + readonly asUpdateDropThreshold: { + readonly new_: u32; + } & Struct; + readonly isUpdateResumeThreshold: boolean; + readonly asUpdateResumeThreshold: { + readonly new_: u32; + } & Struct; + readonly isUpdateThresholdWeight: boolean; + readonly asUpdateThresholdWeight: { + readonly new_: u64; + } & Struct; + readonly isUpdateWeightRestrictDecay: boolean; + readonly asUpdateWeightRestrictDecay: { + readonly new_: u64; + } & Struct; + readonly isUpdateXcmpMaxIndividualWeight: boolean; + readonly asUpdateXcmpMaxIndividualWeight: { + readonly new_: u64; + } & Struct; + readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight'; } - /** @name PalletTemplateTransactionPaymentCall (207) */ - export type PalletTemplateTransactionPaymentCall = Null; + /** @name PalletXcmCall (193) */ + interface PalletXcmCall extends Enum { + readonly isSend: boolean; + readonly asSend: { + readonly dest: XcmVersionedMultiLocation; + readonly message: XcmVersionedXcm; + } & Struct; + readonly isTeleportAssets: boolean; + readonly asTeleportAssets: { + readonly dest: XcmVersionedMultiLocation; + readonly beneficiary: XcmVersionedMultiLocation; + readonly assets: XcmVersionedMultiAssets; + readonly feeAssetItem: u32; + } & Struct; + readonly isReserveTransferAssets: boolean; + readonly asReserveTransferAssets: { + readonly dest: XcmVersionedMultiLocation; + readonly beneficiary: XcmVersionedMultiLocation; + readonly assets: XcmVersionedMultiAssets; + readonly feeAssetItem: u32; + } & Struct; + readonly isExecute: boolean; + readonly asExecute: { + readonly message: XcmVersionedXcm; + readonly maxWeight: u64; + } & Struct; + readonly isForceXcmVersion: boolean; + readonly asForceXcmVersion: { + readonly location: XcmV1MultiLocation; + readonly xcmVersion: u32; + } & Struct; + readonly isForceDefaultXcmVersion: boolean; + readonly asForceDefaultXcmVersion: { + readonly maybeXcmVersion: Option; + } & Struct; + readonly isForceSubscribeVersionNotify: boolean; + readonly asForceSubscribeVersionNotify: { + readonly location: XcmVersionedMultiLocation; + } & Struct; + readonly isForceUnsubscribeVersionNotify: boolean; + readonly asForceUnsubscribeVersionNotify: { + readonly location: XcmVersionedMultiLocation; + } & Struct; + readonly isLimitedReserveTransferAssets: boolean; + readonly asLimitedReserveTransferAssets: { + readonly dest: XcmVersionedMultiLocation; + readonly beneficiary: XcmVersionedMultiLocation; + readonly assets: XcmVersionedMultiAssets; + readonly feeAssetItem: u32; + readonly weightLimit: XcmV2WeightLimit; + } & Struct; + readonly isLimitedTeleportAssets: boolean; + readonly asLimitedTeleportAssets: { + readonly dest: XcmVersionedMultiLocation; + readonly beneficiary: XcmVersionedMultiLocation; + readonly assets: XcmVersionedMultiAssets; + readonly feeAssetItem: u32; + readonly weightLimit: XcmV2WeightLimit; + } & Struct; + readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets'; + } - /** @name PalletStructureCall (208) */ - export type PalletStructureCall = Null; + /** @name XcmVersionedXcm (194) */ + interface XcmVersionedXcm extends Enum { + readonly isV0: boolean; + readonly asV0: XcmV0Xcm; + readonly isV1: boolean; + readonly asV1: XcmV1Xcm; + readonly isV2: boolean; + readonly asV2: XcmV2Xcm; + readonly type: 'V0' | 'V1' | 'V2'; + } - /** @name PalletRmrkCoreCall (209) */ - export interface PalletRmrkCoreCall extends Enum { - readonly isCreateCollection: boolean; - readonly asCreateCollection: { - readonly metadata: Bytes; - readonly max: Option; - readonly symbol: Bytes; + /** @name XcmV0Xcm (195) */ + interface XcmV0Xcm extends Enum { + readonly isWithdrawAsset: boolean; + readonly asWithdrawAsset: { + readonly assets: Vec; + readonly effects: Vec; } & Struct; - readonly isDestroyCollection: boolean; - readonly asDestroyCollection: { - readonly collectionId: u32; + readonly isReserveAssetDeposit: boolean; + readonly asReserveAssetDeposit: { + readonly assets: Vec; + readonly effects: Vec; } & Struct; - readonly isChangeCollectionIssuer: boolean; - readonly asChangeCollectionIssuer: { - readonly collectionId: u32; - readonly newIssuer: MultiAddress; + readonly isTeleportAsset: boolean; + readonly asTeleportAsset: { + readonly assets: Vec; + readonly effects: Vec; } & Struct; - readonly isLockCollection: boolean; - readonly asLockCollection: { - readonly collectionId: u32; + readonly isQueryResponse: boolean; + readonly asQueryResponse: { + readonly queryId: Compact; + readonly response: XcmV0Response; } & Struct; - readonly isMintNft: boolean; - readonly asMintNft: { - readonly owner: Option; - readonly collectionId: u32; - readonly recipient: Option; - readonly royaltyAmount: Option; - readonly metadata: Bytes; - readonly transferable: bool; - readonly resources: Option>; + readonly isTransferAsset: boolean; + readonly asTransferAsset: { + readonly assets: Vec; + readonly dest: XcmV0MultiLocation; } & Struct; - readonly isBurnNft: boolean; - readonly asBurnNft: { - readonly collectionId: u32; - readonly nftId: u32; - readonly maxBurns: u32; + readonly isTransferReserveAsset: boolean; + readonly asTransferReserveAsset: { + readonly assets: Vec; + readonly dest: XcmV0MultiLocation; + readonly effects: Vec; } & Struct; - readonly isSend: boolean; - readonly asSend: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; + readonly isTransact: boolean; + readonly asTransact: { + readonly originType: XcmV0OriginKind; + readonly requireWeightAtMost: u64; + readonly call: XcmDoubleEncoded; } & Struct; - readonly isAcceptNft: boolean; - readonly asAcceptNft: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; + readonly isHrmpNewChannelOpenRequest: boolean; + readonly asHrmpNewChannelOpenRequest: { + readonly sender: Compact; + readonly maxMessageSize: Compact; + readonly maxCapacity: Compact; } & Struct; - readonly isRejectNft: boolean; - readonly asRejectNft: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; + readonly isHrmpChannelAccepted: boolean; + readonly asHrmpChannelAccepted: { + readonly recipient: Compact; } & Struct; - readonly isAcceptResource: boolean; - readonly asAcceptResource: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly resourceId: u32; + readonly isHrmpChannelClosing: boolean; + readonly asHrmpChannelClosing: { + readonly initiator: Compact; + readonly sender: Compact; + readonly recipient: Compact; } & Struct; - readonly isAcceptResourceRemoval: boolean; - readonly asAcceptResourceRemoval: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly resourceId: u32; + readonly isRelayedFrom: boolean; + readonly asRelayedFrom: { + readonly who: XcmV0MultiLocation; + readonly message: XcmV0Xcm; } & Struct; - readonly isSetProperty: boolean; - readonly asSetProperty: { - readonly rmrkCollectionId: Compact; - readonly maybeNftId: Option; - readonly key: Bytes; - readonly value: Bytes; + readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom'; + } + + /** @name XcmV0Order (197) */ + interface XcmV0Order extends Enum { + readonly isNull: boolean; + readonly isDepositAsset: boolean; + readonly asDepositAsset: { + readonly assets: Vec; + readonly dest: XcmV0MultiLocation; } & Struct; - readonly isSetPriority: boolean; - readonly asSetPriority: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly priorities: Vec; + readonly isDepositReserveAsset: boolean; + readonly asDepositReserveAsset: { + readonly assets: Vec; + readonly dest: XcmV0MultiLocation; + readonly effects: Vec; } & Struct; - readonly isAddBasicResource: boolean; - readonly asAddBasicResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resource: RmrkTraitsResourceBasicResource; + readonly isExchangeAsset: boolean; + readonly asExchangeAsset: { + readonly give: Vec; + readonly receive: Vec; } & Struct; - readonly isAddComposableResource: boolean; - readonly asAddComposableResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resource: RmrkTraitsResourceComposableResource; + readonly isInitiateReserveWithdraw: boolean; + readonly asInitiateReserveWithdraw: { + readonly assets: Vec; + readonly reserve: XcmV0MultiLocation; + readonly effects: Vec; } & Struct; - readonly isAddSlotResource: boolean; - readonly asAddSlotResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resource: RmrkTraitsResourceSlotResource; + readonly isInitiateTeleport: boolean; + readonly asInitiateTeleport: { + readonly assets: Vec; + readonly dest: XcmV0MultiLocation; + readonly effects: Vec; } & Struct; - readonly isRemoveResource: boolean; - readonly asRemoveResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resourceId: u32; + readonly isQueryHolding: boolean; + readonly asQueryHolding: { + readonly queryId: Compact; + readonly dest: XcmV0MultiLocation; + readonly assets: Vec; } & Struct; - readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; - } - - /** @name RmrkTraitsResourceResourceTypes (215) */ - export interface RmrkTraitsResourceResourceTypes extends Enum { - readonly isBasic: boolean; - readonly asBasic: RmrkTraitsResourceBasicResource; - readonly isComposable: boolean; - readonly asComposable: RmrkTraitsResourceComposableResource; - readonly isSlot: boolean; - readonly asSlot: RmrkTraitsResourceSlotResource; - readonly type: 'Basic' | 'Composable' | 'Slot'; - } - - /** @name RmrkTraitsResourceBasicResource (217) */ - export interface RmrkTraitsResourceBasicResource extends Struct { - readonly src: Option; - readonly metadata: Option; - readonly license: Option; - readonly thumb: Option; - } - - /** @name RmrkTraitsResourceComposableResource (219) */ - export interface RmrkTraitsResourceComposableResource extends Struct { - readonly parts: Vec; - readonly base: u32; - readonly src: Option; - readonly metadata: Option; - readonly license: Option; - readonly thumb: Option; - } - - /** @name RmrkTraitsResourceSlotResource (220) */ - export interface RmrkTraitsResourceSlotResource extends Struct { - readonly base: u32; - readonly src: Option; - readonly metadata: Option; - readonly slot: u32; - readonly license: Option; - readonly thumb: Option; + readonly isBuyExecution: boolean; + readonly asBuyExecution: { + readonly fees: XcmV0MultiAsset; + readonly weight: u64; + readonly debt: u64; + readonly haltOnError: bool; + readonly xcm: Vec; + } & Struct; + readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (222) */ - export interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { - readonly isAccountId: boolean; - readonly asAccountId: AccountId32; - readonly isCollectionAndNftTuple: boolean; - readonly asCollectionAndNftTuple: ITuple<[u32, u32]>; - readonly type: 'AccountId' | 'CollectionAndNftTuple'; + /** @name XcmV0Response (199) */ + interface XcmV0Response extends Enum { + readonly isAssets: boolean; + readonly asAssets: Vec; + readonly type: 'Assets'; } - /** @name PalletRmrkEquipCall (226) */ - export interface PalletRmrkEquipCall extends Enum { - readonly isCreateBase: boolean; - readonly asCreateBase: { - readonly baseType: Bytes; - readonly symbol: Bytes; - readonly parts: Vec; + /** @name XcmV1Xcm (200) */ + interface XcmV1Xcm extends Enum { + readonly isWithdrawAsset: boolean; + readonly asWithdrawAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly effects: Vec; } & Struct; - readonly isThemeAdd: boolean; - readonly asThemeAdd: { - readonly baseId: u32; - readonly theme: RmrkTraitsTheme; + readonly isReserveAssetDeposited: boolean; + readonly asReserveAssetDeposited: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly effects: Vec; } & Struct; - readonly isEquippable: boolean; - readonly asEquippable: { - readonly baseId: u32; - readonly slotId: u32; - readonly equippables: RmrkTraitsPartEquippableList; + readonly isReceiveTeleportedAsset: boolean; + readonly asReceiveTeleportedAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly effects: Vec; } & Struct; - readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; - } - - /** @name RmrkTraitsPartPartType (229) */ - export interface RmrkTraitsPartPartType extends Enum { - readonly isFixedPart: boolean; - readonly asFixedPart: RmrkTraitsPartFixedPart; - readonly isSlotPart: boolean; - readonly asSlotPart: RmrkTraitsPartSlotPart; - readonly type: 'FixedPart' | 'SlotPart'; - } - - /** @name RmrkTraitsPartFixedPart (231) */ - export interface RmrkTraitsPartFixedPart extends Struct { - readonly id: u32; - readonly z: u32; - readonly src: Bytes; - } - - /** @name RmrkTraitsPartSlotPart (232) */ - export interface RmrkTraitsPartSlotPart extends Struct { - readonly id: u32; - readonly equippable: RmrkTraitsPartEquippableList; - readonly src: Bytes; - readonly z: u32; - } - - /** @name RmrkTraitsPartEquippableList (233) */ - export interface RmrkTraitsPartEquippableList extends Enum { - readonly isAll: boolean; - readonly type: 'Fee' | 'Misc' | 'All'; - } - - /** @name RmrkTraitsTheme (235) */ - export interface RmrkTraitsTheme extends Struct { - readonly name: Bytes; - readonly properties: Vec; - readonly inherit: bool; - } - - /** @name RmrkTraitsThemeThemeProperty (237) */ - export interface RmrkTraitsThemeThemeProperty extends Struct { - readonly key: Bytes; - readonly value: Bytes; - } - - /** @name PalletAppPromotionCall (239) */ - export interface PalletAppPromotionCall extends Enum { - readonly isSetAdminAddress: boolean; - readonly asSetAdminAddress: { - readonly admin: AccountId32; + readonly isQueryResponse: boolean; + readonly asQueryResponse: { + readonly queryId: Compact; + readonly response: XcmV1Response; } & Struct; - readonly isStartAppPromotion: boolean; - readonly asStartAppPromotion: { - readonly promotionStartRelayBlock: u32; + readonly isTransferAsset: boolean; + readonly asTransferAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly beneficiary: XcmV1MultiLocation; } & Struct; - readonly isStake: boolean; - readonly asStake: { - readonly amount: u128; + readonly isTransferReserveAsset: boolean; + readonly asTransferReserveAsset: { + readonly assets: XcmV1MultiassetMultiAssets; + readonly dest: XcmV1MultiLocation; + readonly effects: Vec; } & Struct; - readonly isUnstake: boolean; - readonly asUnstake: { - readonly amount: u128; + readonly isTransact: boolean; + readonly asTransact: { + readonly originType: XcmV0OriginKind; + readonly requireWeightAtMost: u64; + readonly call: XcmDoubleEncoded; } & Struct; - readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake'; + readonly isHrmpNewChannelOpenRequest: boolean; + readonly asHrmpNewChannelOpenRequest: { + readonly sender: Compact; + readonly maxMessageSize: Compact; + readonly maxCapacity: Compact; + } & Struct; + readonly isHrmpChannelAccepted: boolean; + readonly asHrmpChannelAccepted: { + readonly recipient: Compact; + } & Struct; + readonly isHrmpChannelClosing: boolean; + readonly asHrmpChannelClosing: { + readonly initiator: Compact; + readonly sender: Compact; + readonly recipient: Compact; + } & Struct; + readonly isRelayedFrom: boolean; + readonly asRelayedFrom: { + readonly who: XcmV1MultilocationJunctions; + readonly message: XcmV1Xcm; + } & Struct; + readonly isSubscribeVersion: boolean; + readonly asSubscribeVersion: { + readonly queryId: Compact; + readonly maxResponseWeight: Compact; + } & Struct; + readonly isUnsubscribeVersion: boolean; + readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion'; } - /** @name PalletEvmCall (240) */ - export interface PalletEvmCall extends Enum { - readonly isWithdraw: boolean; - readonly asWithdraw: { - readonly address: H160; - readonly value: u128; ->>>>>>> b43f8da0... added totalstaked & fix bug with number in RPC Client + /** @name XcmV1Order (202) */ + interface XcmV1Order extends Enum { + readonly isNoop: boolean; + readonly isDepositAsset: boolean; + readonly asDepositAsset: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly maxAssets: u32; + readonly beneficiary: XcmV1MultiLocation; } & Struct; - readonly isSetBalance: boolean; - readonly asSetBalance: { - readonly who: MultiAddress; - readonly newFree: Compact; - readonly newReserved: Compact; + readonly isDepositReserveAsset: boolean; + readonly asDepositReserveAsset: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly maxAssets: u32; + readonly dest: XcmV1MultiLocation; + readonly effects: Vec; } & Struct; - readonly isForceTransfer: boolean; - readonly asForceTransfer: { - readonly source: MultiAddress; - readonly dest: MultiAddress; - readonly value: Compact; + readonly isExchangeAsset: boolean; + readonly asExchangeAsset: { + readonly give: XcmV1MultiassetMultiAssetFilter; + readonly receive: XcmV1MultiassetMultiAssets; } & Struct; - readonly isTransferKeepAlive: boolean; - readonly asTransferKeepAlive: { - readonly dest: MultiAddress; - readonly value: Compact; + readonly isInitiateReserveWithdraw: boolean; + readonly asInitiateReserveWithdraw: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly reserve: XcmV1MultiLocation; + readonly effects: Vec; } & Struct; -<<<<<<< HEAD - readonly isTransferAll: boolean; - readonly asTransferAll: { - readonly dest: MultiAddress; - readonly keepAlive: bool; -======= - readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; - } - - /** @name PalletEthereumCall (246) */ - export interface PalletEthereumCall extends Enum { - readonly isTransact: boolean; - readonly asTransact: { - readonly transaction: EthereumTransactionTransactionV2; ->>>>>>> b43f8da0... added totalstaked & fix bug with number in RPC Client + readonly isInitiateTeleport: boolean; + readonly asInitiateTeleport: { + readonly assets: XcmV1MultiassetMultiAssetFilter; + readonly dest: XcmV1MultiLocation; + readonly effects: Vec; } & Struct; - readonly isForceUnreserve: boolean; - readonly asForceUnreserve: { - readonly who: MultiAddress; - readonly amount: u128; + readonly isQueryHolding: boolean; + readonly asQueryHolding: { + readonly queryId: Compact; + readonly dest: XcmV1MultiLocation; + readonly assets: XcmV1MultiassetMultiAssetFilter; } & Struct; - readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; - } - - /** @name EthereumTransactionTransactionV2 (247) */ - export interface EthereumTransactionTransactionV2 extends Enum { - readonly isLegacy: boolean; - readonly asLegacy: EthereumTransactionLegacyTransaction; - readonly isEip2930: boolean; - readonly asEip2930: EthereumTransactionEip2930Transaction; - readonly isEip1559: boolean; - readonly asEip1559: EthereumTransactionEip1559Transaction; - readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; - } - - /** @name EthereumTransactionLegacyTransaction (248) */ - export interface EthereumTransactionLegacyTransaction extends Struct { - readonly nonce: U256; - readonly gasPrice: U256; - readonly gasLimit: U256; - readonly action: EthereumTransactionTransactionAction; - readonly value: U256; - readonly input: Bytes; - readonly signature: EthereumTransactionTransactionSignature; - } - - /** @name EthereumTransactionTransactionAction (249) */ - export interface EthereumTransactionTransactionAction extends Enum { - readonly isCall: boolean; - readonly asCall: H160; - readonly isCreate: boolean; - readonly type: 'Call' | 'Create'; + readonly isBuyExecution: boolean; + readonly asBuyExecution: { + readonly fees: XcmV1MultiAsset; + readonly weight: u64; + readonly debt: u64; + readonly haltOnError: bool; + readonly instructions: Vec; + } & Struct; + readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name EthereumTransactionTransactionSignature (250) */ - export interface EthereumTransactionTransactionSignature extends Struct { - readonly v: u64; - readonly r: H256; - readonly s: H256; + /** @name XcmV1Response (204) */ + interface XcmV1Response extends Enum { + readonly isAssets: boolean; + readonly asAssets: XcmV1MultiassetMultiAssets; + readonly isVersion: boolean; + readonly asVersion: u32; + readonly type: 'Assets' | 'Version'; } - /** @name EthereumTransactionEip2930Transaction (252) */ - export interface EthereumTransactionEip2930Transaction extends Struct { - readonly chainId: u64; - readonly nonce: U256; - readonly gasPrice: U256; - readonly gasLimit: U256; - readonly action: EthereumTransactionTransactionAction; - readonly value: U256; - readonly input: Bytes; - readonly accessList: Vec; - readonly oddYParity: bool; - readonly r: H256; - readonly s: H256; - } + /** @name CumulusPalletXcmCall (218) */ + type CumulusPalletXcmCall = Null; - /** @name EthereumTransactionAccessListItem (254) */ - export interface EthereumTransactionAccessListItem extends Struct { - readonly address: H160; - readonly storageKeys: Vec; + /** @name CumulusPalletDmpQueueCall (219) */ + interface CumulusPalletDmpQueueCall extends Enum { + readonly isServiceOverweight: boolean; + readonly asServiceOverweight: { + readonly index: u64; + readonly weightLimit: u64; + } & Struct; + readonly type: 'ServiceOverweight'; } - /** @name EthereumTransactionEip1559Transaction (255) */ - export interface EthereumTransactionEip1559Transaction extends Struct { - readonly chainId: u64; - readonly nonce: U256; - readonly maxPriorityFeePerGas: U256; - readonly maxFeePerGas: U256; - readonly gasLimit: U256; - readonly action: EthereumTransactionTransactionAction; - readonly value: U256; - readonly input: Bytes; - readonly accessList: Vec; - readonly oddYParity: bool; - readonly r: H256; - readonly s: H256; + /** @name PalletInflationCall (220) */ + interface PalletInflationCall extends Enum { + readonly isStartInflation: boolean; + readonly asStartInflation: { + readonly inflationStartRelayBlock: u32; + } & Struct; + readonly type: 'StartInflation'; } - /** @name PalletEvmMigrationCall (256) */ - export interface PalletEvmMigrationCall extends Enum { - readonly isBegin: boolean; - readonly asBegin: { - readonly address: H160; ->>>>>>> b43f8da0... added totalstaked & fix bug with number in RPC Client + /** @name PalletUniqueCall (221) */ + interface PalletUniqueCall extends Enum { + readonly isCreateCollection: boolean; + readonly asCreateCollection: { + readonly collectionName: Vec; + readonly collectionDescription: Vec; + readonly tokenPrefix: Bytes; + readonly mode: UpDataStructsCollectionMode; } & Struct; - readonly isSudoUncheckedWeight: boolean; - readonly asSudoUncheckedWeight: { - readonly call: Call; - readonly weight: u64; + readonly isCreateCollectionEx: boolean; + readonly asCreateCollectionEx: { + readonly data: UpDataStructsCreateCollectionData; } & Struct; - readonly isSetKey: boolean; - readonly asSetKey: { - readonly new_: MultiAddress; + readonly isDestroyCollection: boolean; + readonly asDestroyCollection: { + readonly collectionId: u32; } & Struct; - readonly isSudoAs: boolean; - readonly asSudoAs: { - readonly who: MultiAddress; - readonly call: Call; + readonly isAddToAllowList: boolean; + readonly asAddToAllowList: { + readonly collectionId: u32; + readonly address: PalletEvmAccountBasicCrossAccountIdRepr; } & Struct; - readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs'; - } - - /** @name PalletSudoEvent (259) */ - export interface PalletSudoEvent extends Enum { - readonly isSudid: boolean; - readonly asSudid: { - readonly sudoResult: Result; + readonly isRemoveFromAllowList: boolean; + readonly asRemoveFromAllowList: { + readonly collectionId: u32; + readonly address: PalletEvmAccountBasicCrossAccountIdRepr; } & Struct; - readonly isKeyChanged: boolean; - readonly asKeyChanged: { - readonly oldSudoer: Option; + readonly isChangeCollectionOwner: boolean; + readonly asChangeCollectionOwner: { + readonly collectionId: u32; + readonly newOwner: AccountId32; } & Struct; - readonly isSudoAsDone: boolean; - readonly asSudoAsDone: { - readonly sudoResult: Result; + readonly isAddCollectionAdmin: boolean; + readonly asAddCollectionAdmin: { + readonly collectionId: u32; + readonly newAdminId: PalletEvmAccountBasicCrossAccountIdRepr; } & Struct; - readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone'; - } - - /** @name SpRuntimeDispatchError (261) */ - export interface SpRuntimeDispatchError extends Enum { - readonly isOther: boolean; - readonly isCannotLookup: boolean; - readonly isBadOrigin: boolean; - readonly isModule: boolean; - readonly asModule: SpRuntimeModuleError; - readonly isConsumerRemaining: boolean; - readonly isNoProviders: boolean; - readonly isTooManyConsumers: boolean; - readonly isToken: boolean; - readonly asToken: SpRuntimeTokenError; - readonly isArithmetic: boolean; - readonly asArithmetic: SpRuntimeArithmeticError; - readonly isTransactional: boolean; - readonly asTransactional: SpRuntimeTransactionalError; - readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional'; - } - - /** @name SpRuntimeModuleError (262) */ - export interface SpRuntimeModuleError extends Struct { - readonly index: u8; - readonly error: U8aFixed; - } - - /** @name SpRuntimeTokenError (263) */ - export interface SpRuntimeTokenError extends Enum { - readonly isNoFunds: boolean; - readonly isWouldDie: boolean; - readonly isBelowMinimum: boolean; - readonly isCannotCreate: boolean; - readonly isUnknownAsset: boolean; - readonly isFrozen: boolean; - readonly isUnsupported: boolean; - readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported'; - } - - /** @name SpRuntimeArithmeticError (264) */ - export interface SpRuntimeArithmeticError extends Enum { - readonly isUnderflow: boolean; - readonly isOverflow: boolean; - readonly isDivisionByZero: boolean; - readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero'; - } - - /** @name SpRuntimeTransactionalError (265) */ - export interface SpRuntimeTransactionalError extends Enum { - readonly isLimitReached: boolean; - readonly isNoLayer: boolean; - readonly type: 'LimitReached' | 'NoLayer'; - } - - /** @name PalletSudoError (266) */ - export interface PalletSudoError extends Enum { - readonly isRequireSudo: boolean; - readonly type: 'RequireSudo'; - } - - /** @name FrameSystemAccountInfo (267) */ - export interface FrameSystemAccountInfo extends Struct { - readonly nonce: u32; - readonly consumers: u32; - readonly providers: u32; - readonly sufficients: u32; - readonly data: PalletBalancesAccountData; - } - - /** @name FrameSupportWeightsPerDispatchClassU64 (268) */ - export interface FrameSupportWeightsPerDispatchClassU64 extends Struct { - readonly normal: u64; - readonly operational: u64; - readonly mandatory: u64; + readonly isRemoveCollectionAdmin: boolean; + readonly asRemoveCollectionAdmin: { + readonly collectionId: u32; + readonly accountId: PalletEvmAccountBasicCrossAccountIdRepr; + } & Struct; + readonly isSetCollectionSponsor: boolean; + readonly asSetCollectionSponsor: { + readonly collectionId: u32; + readonly newSponsor: AccountId32; + } & Struct; + readonly isConfirmSponsorship: boolean; + readonly asConfirmSponsorship: { + readonly collectionId: u32; + } & Struct; + readonly isRemoveCollectionSponsor: boolean; + readonly asRemoveCollectionSponsor: { + readonly collectionId: u32; + } & Struct; + readonly isCreateItem: boolean; + readonly asCreateItem: { + readonly collectionId: u32; + readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; + readonly data: UpDataStructsCreateItemData; + } & Struct; + readonly isCreateMultipleItems: boolean; + readonly asCreateMultipleItems: { + readonly collectionId: u32; + readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; + readonly itemsData: Vec; + } & Struct; + readonly isSetCollectionProperties: boolean; + readonly asSetCollectionProperties: { + readonly collectionId: u32; + readonly properties: Vec; + } & Struct; + readonly isDeleteCollectionProperties: boolean; + readonly asDeleteCollectionProperties: { + readonly collectionId: u32; + readonly propertyKeys: Vec; + } & Struct; + readonly isSetTokenProperties: boolean; + readonly asSetTokenProperties: { + readonly collectionId: u32; + readonly tokenId: u32; + readonly properties: Vec; + } & Struct; + readonly isDeleteTokenProperties: boolean; + readonly asDeleteTokenProperties: { + readonly collectionId: u32; + readonly tokenId: u32; + readonly propertyKeys: Vec; + } & Struct; + readonly isSetTokenPropertyPermissions: boolean; + readonly asSetTokenPropertyPermissions: { + readonly collectionId: u32; + readonly propertyPermissions: Vec; + } & Struct; + readonly isCreateMultipleItemsEx: boolean; + readonly asCreateMultipleItemsEx: { + readonly collectionId: u32; + readonly data: UpDataStructsCreateItemExData; + } & Struct; + readonly isSetTransfersEnabledFlag: boolean; + readonly asSetTransfersEnabledFlag: { + readonly collectionId: u32; + readonly value: bool; + } & Struct; + readonly isBurnItem: boolean; + readonly asBurnItem: { + readonly collectionId: u32; + readonly itemId: u32; + readonly value: u128; + } & Struct; + readonly isBurnFrom: boolean; + readonly asBurnFrom: { + readonly collectionId: u32; + readonly from: PalletEvmAccountBasicCrossAccountIdRepr; + readonly itemId: u32; + readonly value: u128; + } & Struct; + readonly isTransfer: boolean; + readonly asTransfer: { + readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr; + readonly collectionId: u32; + readonly itemId: u32; + readonly value: u128; + } & Struct; + readonly isApprove: boolean; + readonly asApprove: { + readonly spender: PalletEvmAccountBasicCrossAccountIdRepr; + readonly collectionId: u32; + readonly itemId: u32; + readonly amount: u128; + } & Struct; + readonly isTransferFrom: boolean; + readonly asTransferFrom: { + readonly from: PalletEvmAccountBasicCrossAccountIdRepr; + readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr; + readonly collectionId: u32; + readonly itemId: u32; + readonly value: u128; + } & Struct; + readonly isSetCollectionLimits: boolean; + readonly asSetCollectionLimits: { + readonly collectionId: u32; + readonly newLimit: UpDataStructsCollectionLimits; + } & Struct; + readonly isSetCollectionPermissions: boolean; + readonly asSetCollectionPermissions: { + readonly collectionId: u32; + readonly newPermission: UpDataStructsCollectionPermissions; + } & Struct; + readonly isRepartition: boolean; + readonly asRepartition: { + readonly collectionId: u32; + readonly tokenId: u32; + readonly amount: u128; + } & Struct; + readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; } - /** @name SpRuntimeDigest (269) */ - export interface SpRuntimeDigest extends Struct { - readonly logs: Vec; + /** @name UpDataStructsCollectionMode (226) */ + interface UpDataStructsCollectionMode extends Enum { + readonly isNft: boolean; + readonly isFungible: boolean; + readonly asFungible: u8; + readonly isReFungible: boolean; + readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name SpRuntimeDigestDigestItem (271) */ - export interface SpRuntimeDigestDigestItem extends Enum { - readonly isOther: boolean; - readonly asOther: Bytes; - readonly isConsensus: boolean; - readonly asConsensus: ITuple<[U8aFixed, Bytes]>; - readonly isSeal: boolean; - readonly asSeal: ITuple<[U8aFixed, Bytes]>; - readonly isPreRuntime: boolean; - readonly asPreRuntime: ITuple<[U8aFixed, Bytes]>; - readonly isRuntimeEnvironmentUpdated: boolean; - readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated'; + /** @name UpDataStructsCreateCollectionData (227) */ + interface UpDataStructsCreateCollectionData extends Struct { + readonly mode: UpDataStructsCollectionMode; + readonly access: Option; + readonly name: Vec; + readonly description: Vec; + readonly tokenPrefix: Bytes; + readonly pendingSponsor: Option; + readonly limits: Option; + readonly permissions: Option; + readonly tokenPropertyPermissions: Vec; + readonly properties: Vec; } - /** @name FrameSystemEventRecord (273) */ - export interface FrameSystemEventRecord extends Struct { - readonly phase: FrameSystemPhase; - readonly event: Event; - readonly topics: Vec; + /** @name UpDataStructsAccessMode (229) */ + interface UpDataStructsAccessMode extends Enum { + readonly isNormal: boolean; + readonly isAllowList: boolean; + readonly type: 'Normal' | 'AllowList'; } - /** @name FrameSystemEvent (275) */ - export interface FrameSystemEvent extends Enum { - readonly isExtrinsicSuccess: boolean; - readonly asExtrinsicSuccess: { - readonly dispatchInfo: FrameSupportWeightsDispatchInfo; - } & Struct; - readonly isExtrinsicFailed: boolean; - readonly asExtrinsicFailed: { - readonly dispatchError: SpRuntimeDispatchError; - readonly dispatchInfo: FrameSupportWeightsDispatchInfo; - } & Struct; - readonly isCodeUpdated: boolean; - readonly isNewAccount: boolean; - readonly asNewAccount: { - readonly account: AccountId32; - } & Struct; - readonly isKilledAccount: boolean; - readonly asKilledAccount: { - readonly account: AccountId32; - } & Struct; - readonly isRemarked: boolean; - readonly asRemarked: { - readonly sender: AccountId32; - readonly hash_: H256; - } & Struct; - readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked'; + /** @name UpDataStructsCollectionLimits (231) */ + interface UpDataStructsCollectionLimits extends Struct { + readonly accountTokenOwnershipLimit: Option; + readonly sponsoredDataSize: Option; + readonly sponsoredDataRateLimit: Option; + readonly tokenLimit: Option; + readonly sponsorTransferTimeout: Option; + readonly sponsorApproveTimeout: Option; + readonly ownerCanTransfer: Option; + readonly ownerCanDestroy: Option; + readonly transfersEnabled: Option; } - /** @name FrameSupportWeightsDispatchInfo (276) */ - export interface FrameSupportWeightsDispatchInfo extends Struct { - readonly weight: u64; - readonly class: FrameSupportWeightsDispatchClass; - readonly paysFee: FrameSupportWeightsPays; + /** @name UpDataStructsSponsoringRateLimit (233) */ + interface UpDataStructsSponsoringRateLimit extends Enum { + readonly isSponsoringDisabled: boolean; + readonly isBlocks: boolean; + readonly asBlocks: u32; + readonly type: 'SponsoringDisabled' | 'Blocks'; } - /** @name FrameSupportWeightsDispatchClass (277) */ - export interface FrameSupportWeightsDispatchClass extends Enum { - readonly isNormal: boolean; - readonly isOperational: boolean; - readonly isMandatory: boolean; - readonly type: 'Normal' | 'Operational' | 'Mandatory'; + /** @name UpDataStructsCollectionPermissions (236) */ + interface UpDataStructsCollectionPermissions extends Struct { + readonly access: Option; + readonly mintMode: Option; + readonly nesting: Option; } - /** @name FrameSupportWeightsPays (278) */ - export interface FrameSupportWeightsPays extends Enum { - readonly isYes: boolean; - readonly isNo: boolean; - readonly type: 'Yes' | 'No'; + /** @name UpDataStructsNestingPermissions (238) */ + interface UpDataStructsNestingPermissions extends Struct { + readonly tokenOwner: bool; + readonly collectionAdmin: bool; + readonly restricted: Option; } - /** @name OrmlVestingModuleEvent (279) */ - export interface OrmlVestingModuleEvent extends Enum { - readonly isVestingScheduleAdded: boolean; - readonly asVestingScheduleAdded: { - readonly from: AccountId32; - readonly to: AccountId32; - readonly vestingSchedule: OrmlVestingVestingSchedule; - } & Struct; - readonly isClaimed: boolean; - readonly asClaimed: { - readonly who: AccountId32; - readonly amount: u128; - } & Struct; - readonly isVestingSchedulesUpdated: boolean; - readonly asVestingSchedulesUpdated: { - readonly who: AccountId32; - } & Struct; - readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated'; - } + /** @name UpDataStructsOwnerRestrictedSet (240) */ + interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} - /** @name CumulusPalletXcmpQueueEvent (280) */ - export interface CumulusPalletXcmpQueueEvent extends Enum { - readonly isSuccess: boolean; - readonly asSuccess: Option; - readonly isFail: boolean; - readonly asFail: ITuple<[Option, XcmV2TraitsError]>; - readonly isBadVersion: boolean; - readonly asBadVersion: Option; - readonly isBadFormat: boolean; - readonly asBadFormat: Option; - readonly isUpwardMessageSent: boolean; - readonly asUpwardMessageSent: Option; - readonly isXcmpMessageSent: boolean; - readonly asXcmpMessageSent: Option; - readonly isOverweightEnqueued: boolean; - readonly asOverweightEnqueued: ITuple<[u32, u32, u64, u64]>; - readonly isOverweightServiced: boolean; - readonly asOverweightServiced: ITuple<[u64, u64]>; - readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced'; + /** @name UpDataStructsPropertyKeyPermission (245) */ + interface UpDataStructsPropertyKeyPermission extends Struct { + readonly key: Bytes; + readonly permission: UpDataStructsPropertyPermission; } - /** @name PalletXcmEvent (281) */ - export interface PalletXcmEvent extends Enum { - readonly isAttempted: boolean; - readonly asAttempted: XcmV2TraitsOutcome; - readonly isSent: boolean; - readonly asSent: ITuple<[XcmV1MultiLocation, XcmV1MultiLocation, XcmV2Xcm]>; - readonly isUnexpectedResponse: boolean; - readonly asUnexpectedResponse: ITuple<[XcmV1MultiLocation, u64]>; - readonly isResponseReady: boolean; - readonly asResponseReady: ITuple<[u64, XcmV2Response]>; - readonly isNotified: boolean; - readonly asNotified: ITuple<[u64, u8, u8]>; - readonly isNotifyOverweight: boolean; - readonly asNotifyOverweight: ITuple<[u64, u8, u8, u64, u64]>; - readonly isNotifyDispatchError: boolean; - readonly asNotifyDispatchError: ITuple<[u64, u8, u8]>; - readonly isNotifyDecodeFailed: boolean; - readonly asNotifyDecodeFailed: ITuple<[u64, u8, u8]>; - readonly isInvalidResponder: boolean; - readonly asInvalidResponder: ITuple<[XcmV1MultiLocation, u64, Option]>; - readonly isInvalidResponderVersion: boolean; - readonly asInvalidResponderVersion: ITuple<[XcmV1MultiLocation, u64]>; - readonly isResponseTaken: boolean; - readonly asResponseTaken: u64; - readonly isAssetsTrapped: boolean; - readonly asAssetsTrapped: ITuple<[H256, XcmV1MultiLocation, XcmVersionedMultiAssets]>; - readonly isVersionChangeNotified: boolean; - readonly asVersionChangeNotified: ITuple<[XcmV1MultiLocation, u32]>; - readonly isSupportedVersionChanged: boolean; - readonly asSupportedVersionChanged: ITuple<[XcmV1MultiLocation, u32]>; - readonly isNotifyTargetSendFail: boolean; - readonly asNotifyTargetSendFail: ITuple<[XcmV1MultiLocation, u64, XcmV2TraitsError]>; - readonly isNotifyTargetMigrationFail: boolean; - readonly asNotifyTargetMigrationFail: ITuple<[XcmVersionedMultiLocation, u64]>; - readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail'; + /** @name UpDataStructsPropertyPermission (246) */ + interface UpDataStructsPropertyPermission extends Struct { + readonly mutable: bool; + readonly collectionAdmin: bool; + readonly tokenOwner: bool; } - /** @name XcmV2TraitsOutcome (282) */ - export interface XcmV2TraitsOutcome extends Enum { - readonly isComplete: boolean; - readonly asComplete: u64; - readonly isIncomplete: boolean; - readonly asIncomplete: ITuple<[u64, XcmV2TraitsError]>; - readonly isError: boolean; - readonly asError: XcmV2TraitsError; - readonly type: 'Complete' | 'Incomplete' | 'Error'; + /** @name UpDataStructsProperty (249) */ + interface UpDataStructsProperty extends Struct { + readonly key: Bytes; + readonly value: Bytes; } - /** @name CumulusPalletXcmEvent (284) */ - export interface CumulusPalletXcmEvent extends Enum { - readonly isInvalidFormat: boolean; - readonly asInvalidFormat: U8aFixed; - readonly isUnsupportedVersion: boolean; - readonly asUnsupportedVersion: U8aFixed; - readonly isExecutedDownward: boolean; - readonly asExecutedDownward: ITuple<[U8aFixed, XcmV2TraitsOutcome]>; - readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; + /** @name UpDataStructsCreateItemData (252) */ + interface UpDataStructsCreateItemData extends Enum { + readonly isNft: boolean; + readonly asNft: UpDataStructsCreateNftData; + readonly isFungible: boolean; + readonly asFungible: UpDataStructsCreateFungibleData; + readonly isReFungible: boolean; + readonly asReFungible: UpDataStructsCreateReFungibleData; + readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name CumulusPalletDmpQueueEvent (285) */ - export interface CumulusPalletDmpQueueEvent extends Enum { - readonly isInvalidFormat: boolean; - readonly asInvalidFormat: { - readonly messageId: U8aFixed; - } & Struct; - readonly isUnsupportedVersion: boolean; - readonly asUnsupportedVersion: { - readonly messageId: U8aFixed; - } & Struct; - readonly isExecutedDownward: boolean; - readonly asExecutedDownward: { - readonly messageId: U8aFixed; - readonly outcome: XcmV2TraitsOutcome; - } & Struct; - readonly isWeightExhausted: boolean; - readonly asWeightExhausted: { - readonly messageId: U8aFixed; - readonly remainingWeight: u64; - readonly requiredWeight: u64; - } & Struct; - readonly isOverweightEnqueued: boolean; - readonly asOverweightEnqueued: { - readonly messageId: U8aFixed; - readonly overweightIndex: u64; - readonly requiredWeight: u64; - } & Struct; - readonly isOverweightServiced: boolean; - readonly asOverweightServiced: { - readonly overweightIndex: u64; - readonly weightUsed: u64; - } & Struct; - readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced'; + /** @name UpDataStructsCreateNftData (253) */ + interface UpDataStructsCreateNftData extends Struct { + readonly properties: Vec; } - /** @name PalletUniqueRawEvent (286) */ - export interface PalletUniqueRawEvent extends Enum { - readonly isCollectionSponsorRemoved: boolean; - readonly asCollectionSponsorRemoved: u32; - readonly isCollectionAdminAdded: boolean; - readonly asCollectionAdminAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; - readonly isCollectionOwnedChanged: boolean; - readonly asCollectionOwnedChanged: ITuple<[u32, AccountId32]>; - readonly isCollectionSponsorSet: boolean; - readonly asCollectionSponsorSet: ITuple<[u32, AccountId32]>; - readonly isSponsorshipConfirmed: boolean; - readonly asSponsorshipConfirmed: ITuple<[u32, AccountId32]>; - readonly isCollectionAdminRemoved: boolean; - readonly asCollectionAdminRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; - readonly isAllowListAddressRemoved: boolean; - readonly asAllowListAddressRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; - readonly isAllowListAddressAdded: boolean; - readonly asAllowListAddressAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>; - readonly isCollectionLimitSet: boolean; - readonly asCollectionLimitSet: u32; - readonly isCollectionPermissionSet: boolean; - readonly asCollectionPermissionSet: u32; - readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet'; + /** @name UpDataStructsCreateFungibleData (254) */ + interface UpDataStructsCreateFungibleData extends Struct { + readonly value: u128; } - /** @name PalletUniqueSchedulerEvent (287) */ - export interface PalletUniqueSchedulerEvent extends Enum { - readonly isScheduled: boolean; - readonly asScheduled: { - readonly when: u32; - readonly index: u32; - } & Struct; - readonly isCanceled: boolean; - readonly asCanceled: { + /** @name UpDataStructsCreateReFungibleData (255) */ + interface UpDataStructsCreateReFungibleData extends Struct { + readonly pieces: u128; + readonly properties: Vec; + } + + /** @name UpDataStructsCreateItemExData (258) */ + interface UpDataStructsCreateItemExData extends Enum { + readonly isNft: boolean; + readonly asNft: Vec; + readonly isFungible: boolean; + readonly asFungible: BTreeMap; + readonly isRefungibleMultipleItems: boolean; + readonly asRefungibleMultipleItems: Vec; + readonly isRefungibleMultipleOwners: boolean; + readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners; + readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; + } + + /** @name UpDataStructsCreateNftExData (260) */ + interface UpDataStructsCreateNftExData extends Struct { + readonly properties: Vec; + readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; + } + + /** @name UpDataStructsCreateRefungibleExSingleOwner (267) */ + interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { + readonly user: PalletEvmAccountBasicCrossAccountIdRepr; + readonly pieces: u128; + readonly properties: Vec; + } + + /** @name UpDataStructsCreateRefungibleExMultipleOwners (269) */ + interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { + readonly users: BTreeMap; + readonly properties: Vec; + } + + /** @name PalletUniqueSchedulerCall (270) */ + interface PalletUniqueSchedulerCall extends Enum { + readonly isScheduleNamed: boolean; + readonly asScheduleNamed: { + readonly id: U8aFixed; readonly when: u32; - readonly index: u32; + readonly maybePeriodic: Option>; + readonly priority: u8; + readonly call: FrameSupportScheduleMaybeHashed; } & Struct; - readonly isDispatched: boolean; - readonly asDispatched: { - readonly task: ITuple<[u32, u32]>; - readonly id: Option; - readonly result: Result; + readonly isCancelNamed: boolean; + readonly asCancelNamed: { + readonly id: U8aFixed; } & Struct; - readonly isCallLookupFailed: boolean; - readonly asCallLookupFailed: { - readonly task: ITuple<[u32, u32]>; - readonly id: Option; - readonly error: FrameSupportScheduleLookupError; + readonly isScheduleNamedAfter: boolean; + readonly asScheduleNamedAfter: { + readonly id: U8aFixed; + readonly after: u32; + readonly maybePeriodic: Option>; + readonly priority: u8; + readonly call: FrameSupportScheduleMaybeHashed; } & Struct; - readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; + readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; } - /** @name FrameSupportScheduleLookupError (289) */ - export interface FrameSupportScheduleLookupError extends Enum { - readonly isUnknown: boolean; - readonly isBadFormat: boolean; - readonly type: 'Unknown' | 'BadFormat'; + /** @name FrameSupportScheduleMaybeHashed (272) */ + interface FrameSupportScheduleMaybeHashed extends Enum { + readonly isValue: boolean; + readonly asValue: Call; + readonly isHash: boolean; + readonly asHash: H256; + readonly type: 'Value' | 'Hash'; } - /** @name PalletCommonEvent (290) */ - export interface PalletCommonEvent extends Enum { - readonly isCollectionCreated: boolean; - readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; - readonly isCollectionDestroyed: boolean; - readonly asCollectionDestroyed: u32; - readonly isItemCreated: boolean; - readonly asItemCreated: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; - readonly isItemDestroyed: boolean; - readonly asItemDestroyed: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; - readonly isTransfer: boolean; - readonly asTransfer: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; - readonly isApproved: boolean; - readonly asApproved: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>; - readonly isCollectionPropertySet: boolean; - readonly asCollectionPropertySet: ITuple<[u32, Bytes]>; - readonly isCollectionPropertyDeleted: boolean; - readonly asCollectionPropertyDeleted: ITuple<[u32, Bytes]>; - readonly isTokenPropertySet: boolean; - readonly asTokenPropertySet: ITuple<[u32, u32, Bytes]>; - readonly isTokenPropertyDeleted: boolean; - readonly asTokenPropertyDeleted: ITuple<[u32, u32, Bytes]>; - readonly isPropertyPermissionSet: boolean; - readonly asPropertyPermissionSet: ITuple<[u32, Bytes]>; - readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; + /** @name PalletConfigurationCall (273) */ + interface PalletConfigurationCall extends Enum { + readonly isSetWeightToFeeCoefficientOverride: boolean; + readonly asSetWeightToFeeCoefficientOverride: { + readonly coeff: Option; + } & Struct; + readonly isSetMinGasPriceOverride: boolean; + readonly asSetMinGasPriceOverride: { + readonly coeff: Option; + } & Struct; + readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride'; } - /** @name PalletStructureEvent (291) */ - export interface PalletStructureEvent extends Enum { - readonly isExecuted: boolean; - readonly asExecuted: Result; - readonly type: 'Executed'; - } + /** @name PalletTemplateTransactionPaymentCall (274) */ + type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletRmrkCoreEvent (292) */ - export interface PalletRmrkCoreEvent extends Enum { - readonly isCollectionCreated: boolean; - readonly asCollectionCreated: { - readonly issuer: AccountId32; + /** @name PalletStructureCall (275) */ + type PalletStructureCall = Null; + + /** @name PalletRmrkCoreCall (276) */ + interface PalletRmrkCoreCall extends Enum { + readonly isCreateCollection: boolean; + readonly asCreateCollection: { + readonly metadata: Bytes; + readonly max: Option; + readonly symbol: Bytes; + } & Struct; + readonly isDestroyCollection: boolean; + readonly asDestroyCollection: { readonly collectionId: u32; } & Struct; - readonly isCollectionDestroyed: boolean; - readonly asCollectionDestroyed: { - readonly issuer: AccountId32; + readonly isChangeCollectionIssuer: boolean; + readonly asChangeCollectionIssuer: { readonly collectionId: u32; + readonly newIssuer: MultiAddress; } & Struct; - readonly isIssuerChanged: boolean; - readonly asIssuerChanged: { - readonly oldIssuer: AccountId32; - readonly newIssuer: AccountId32; + readonly isLockCollection: boolean; + readonly asLockCollection: { readonly collectionId: u32; } & Struct; - readonly isCollectionLocked: boolean; - readonly asCollectionLocked: { - readonly issuer: AccountId32; + readonly isMintNft: boolean; + readonly asMintNft: { + readonly owner: Option; readonly collectionId: u32; + readonly recipient: Option; + readonly royaltyAmount: Option; + readonly metadata: Bytes; + readonly transferable: bool; + readonly resources: Option>; } & Struct; - readonly isNftMinted: boolean; - readonly asNftMinted: { - readonly owner: AccountId32; + readonly isBurnNft: boolean; + readonly asBurnNft: { readonly collectionId: u32; readonly nftId: u32; + readonly maxBurns: u32; } & Struct; - readonly isNftBurned: boolean; - readonly asNftBurned: { - readonly owner: AccountId32; - readonly nftId: u32; + readonly isSend: boolean; + readonly asSend: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; } & Struct; - readonly isNftSent: boolean; - readonly asNftSent: { - readonly sender: AccountId32; - readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; - readonly collectionId: u32; - readonly nftId: u32; - readonly approvalRequired: bool; + readonly isAcceptNft: boolean; + readonly asAcceptNft: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; } & Struct; - readonly isNftAccepted: boolean; - readonly asNftAccepted: { - readonly sender: AccountId32; - readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; - readonly collectionId: u32; - readonly nftId: u32; + readonly isRejectNft: boolean; + readonly asRejectNft: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; } & Struct; - readonly isNftRejected: boolean; - readonly asNftRejected: { - readonly sender: AccountId32; - readonly collectionId: u32; - readonly nftId: u32; + readonly isAcceptResource: boolean; + readonly asAcceptResource: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly resourceId: u32; } & Struct; - readonly isPropertySet: boolean; - readonly asPropertySet: { - readonly collectionId: u32; + readonly isAcceptResourceRemoval: boolean; + readonly asAcceptResourceRemoval: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly resourceId: u32; + } & Struct; + readonly isSetProperty: boolean; + readonly asSetProperty: { + readonly rmrkCollectionId: Compact; readonly maybeNftId: Option; readonly key: Bytes; readonly value: Bytes; } & Struct; - readonly isResourceAdded: boolean; - readonly asResourceAdded: { - readonly nftId: u32; - readonly resourceId: u32; + readonly isSetPriority: boolean; + readonly asSetPriority: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly priorities: Vec; } & Struct; - readonly isResourceRemoval: boolean; - readonly asResourceRemoval: { + readonly isAddBasicResource: boolean; + readonly asAddBasicResource: { + readonly rmrkCollectionId: u32; readonly nftId: u32; - readonly resourceId: u32; + readonly resource: RmrkTraitsResourceBasicResource; } & Struct; - readonly isResourceAccepted: boolean; - readonly asResourceAccepted: { + readonly isAddComposableResource: boolean; + readonly asAddComposableResource: { + readonly rmrkCollectionId: u32; readonly nftId: u32; - readonly resourceId: u32; + readonly resource: RmrkTraitsResourceComposableResource; } & Struct; - readonly isResourceRemovalAccepted: boolean; - readonly asResourceRemovalAccepted: { + readonly isAddSlotResource: boolean; + readonly asAddSlotResource: { + readonly rmrkCollectionId: u32; readonly nftId: u32; - readonly resourceId: u32; + readonly resource: RmrkTraitsResourceSlotResource; } & Struct; - readonly isPrioritySet: boolean; - readonly asPrioritySet: { - readonly collectionId: u32; + readonly isRemoveResource: boolean; + readonly asRemoveResource: { + readonly rmrkCollectionId: u32; readonly nftId: u32; + readonly resourceId: u32; } & Struct; - readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; + readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; } - /** @name PalletRmrkEquipEvent (293) */ - export interface PalletRmrkEquipEvent extends Enum { - readonly isBaseCreated: boolean; - readonly asBaseCreated: { - readonly issuer: AccountId32; + /** @name RmrkTraitsResourceResourceTypes (282) */ + interface RmrkTraitsResourceResourceTypes extends Enum { + readonly isBasic: boolean; + readonly asBasic: RmrkTraitsResourceBasicResource; + readonly isComposable: boolean; + readonly asComposable: RmrkTraitsResourceComposableResource; + readonly isSlot: boolean; + readonly asSlot: RmrkTraitsResourceSlotResource; + readonly type: 'Basic' | 'Composable' | 'Slot'; + } + + /** @name RmrkTraitsResourceBasicResource (284) */ + interface RmrkTraitsResourceBasicResource extends Struct { + readonly src: Option; + readonly metadata: Option; + readonly license: Option; + readonly thumb: Option; + } + + /** @name RmrkTraitsResourceComposableResource (286) */ + interface RmrkTraitsResourceComposableResource extends Struct { + readonly parts: Vec; + readonly base: u32; + readonly src: Option; + readonly metadata: Option; + readonly license: Option; + readonly thumb: Option; + } + + /** @name RmrkTraitsResourceSlotResource (287) */ + interface RmrkTraitsResourceSlotResource extends Struct { + readonly base: u32; + readonly src: Option; + readonly metadata: Option; + readonly slot: u32; + readonly license: Option; + readonly thumb: Option; + } + + /** @name PalletRmrkEquipCall (290) */ + interface PalletRmrkEquipCall extends Enum { + readonly isCreateBase: boolean; + readonly asCreateBase: { + readonly baseType: Bytes; + readonly symbol: Bytes; + readonly parts: Vec; + } & Struct; + readonly isThemeAdd: boolean; + readonly asThemeAdd: { readonly baseId: u32; + readonly theme: RmrkTraitsTheme; } & Struct; - readonly isEquippablesUpdated: boolean; - readonly asEquippablesUpdated: { + readonly isEquippable: boolean; + readonly asEquippable: { readonly baseId: u32; readonly slotId: u32; + readonly equippables: RmrkTraitsPartEquippableList; } & Struct; - readonly type: 'BaseCreated' | 'EquippablesUpdated'; + readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; } - /** @name PalletEvmEvent (294) */ - export interface PalletEvmEvent extends Enum { - readonly isLog: boolean; - readonly asLog: EthereumLog; - readonly isCreated: boolean; - readonly asCreated: H160; - readonly isCreatedFailed: boolean; - readonly asCreatedFailed: H160; - readonly isExecuted: boolean; - readonly asExecuted: H160; - readonly isExecutedFailed: boolean; - readonly asExecutedFailed: H160; - readonly isBalanceDeposit: boolean; - readonly asBalanceDeposit: ITuple<[AccountId32, H160, U256]>; - readonly isBalanceWithdraw: boolean; - readonly asBalanceWithdraw: ITuple<[AccountId32, H160, U256]>; - readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; + /** @name RmrkTraitsPartPartType (293) */ + interface RmrkTraitsPartPartType extends Enum { + readonly isFixedPart: boolean; + readonly asFixedPart: RmrkTraitsPartFixedPart; + readonly isSlotPart: boolean; + readonly asSlotPart: RmrkTraitsPartSlotPart; + readonly type: 'FixedPart' | 'SlotPart'; } - /** @name EthereumLog (295) */ - export interface EthereumLog extends Struct { - readonly address: H160; - readonly topics: Vec; - readonly data: Bytes; + /** @name RmrkTraitsPartFixedPart (295) */ + interface RmrkTraitsPartFixedPart extends Struct { + readonly id: u32; + readonly z: u32; + readonly src: Bytes; } - /** @name PalletEthereumEvent (296) */ - export interface PalletEthereumEvent extends Enum { - readonly isExecuted: boolean; - readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; - readonly type: 'Executed'; + /** @name RmrkTraitsPartSlotPart (296) */ + interface RmrkTraitsPartSlotPart extends Struct { + readonly id: u32; + readonly equippable: RmrkTraitsPartEquippableList; + readonly src: Bytes; + readonly z: u32; } - /** @name EvmCoreErrorExitReason (297) */ - export interface EvmCoreErrorExitReason extends Enum { - readonly isSucceed: boolean; - readonly asSucceed: EvmCoreErrorExitSucceed; - readonly isError: boolean; - readonly asError: EvmCoreErrorExitError; - readonly isRevert: boolean; - readonly asRevert: EvmCoreErrorExitRevert; - readonly isFatal: boolean; - readonly asFatal: EvmCoreErrorExitFatal; - readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; + /** @name RmrkTraitsPartEquippableList (297) */ + interface RmrkTraitsPartEquippableList extends Enum { + readonly isAll: boolean; + readonly isEmpty: boolean; + readonly isCustom: boolean; + readonly asCustom: Vec; + readonly type: 'All' | 'Empty' | 'Custom'; } - /** @name EvmCoreErrorExitSucceed (298) */ - export interface EvmCoreErrorExitSucceed extends Enum { - readonly isStopped: boolean; - readonly isReturned: boolean; - readonly isSuicided: boolean; - readonly type: 'Stopped' | 'Returned' | 'Suicided'; + /** @name RmrkTraitsTheme (299) */ + interface RmrkTraitsTheme extends Struct { + readonly name: Bytes; + readonly properties: Vec; + readonly inherit: bool; } - /** @name EvmCoreErrorExitError (299) */ - export interface EvmCoreErrorExitError extends Enum { - readonly isStackUnderflow: boolean; - readonly isStackOverflow: boolean; - readonly isInvalidJump: boolean; - readonly isInvalidRange: boolean; - readonly isDesignatedInvalid: boolean; - readonly isCallTooDeep: boolean; - readonly isCreateCollision: boolean; - readonly isCreateContractLimit: boolean; - readonly isOutOfOffset: boolean; - readonly isOutOfGas: boolean; - readonly isOutOfFund: boolean; - readonly isPcUnderflow: boolean; - readonly isCreateEmpty: boolean; - readonly isOther: boolean; - readonly asOther: Text; - readonly isInvalidCode: boolean; - readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; + /** @name RmrkTraitsThemeThemeProperty (301) */ + interface RmrkTraitsThemeThemeProperty extends Struct { + readonly key: Bytes; + readonly value: Bytes; } - /** @name EvmCoreErrorExitRevert (302) */ - export interface EvmCoreErrorExitRevert extends Enum { - readonly isReverted: boolean; - readonly type: 'Reverted'; + /** @name PalletAppPromotionCall (303) */ + interface PalletAppPromotionCall extends Enum { + readonly isSetAdminAddress: boolean; + readonly asSetAdminAddress: { + readonly admin: AccountId32; + } & Struct; + readonly isStartAppPromotion: boolean; + readonly asStartAppPromotion: { + readonly promotionStartRelayBlock: u32; + } & Struct; + readonly isStake: boolean; + readonly asStake: { + readonly amount: u128; + } & Struct; + readonly isUnstake: boolean; + readonly asUnstake: { + readonly amount: u128; + } & Struct; + readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake'; } - /** @name EvmCoreErrorExitFatal (303) */ - export interface EvmCoreErrorExitFatal extends Enum { - readonly isNotSupported: boolean; - readonly isUnhandledInterrupt: boolean; - readonly isCallErrorAsFatal: boolean; - readonly asCallErrorAsFatal: EvmCoreErrorExitError; - readonly isOther: boolean; - readonly asOther: Text; - readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; + /** @name PalletEvmCall (304) */ + interface PalletEvmCall extends Enum { + readonly isWithdraw: boolean; + readonly asWithdraw: { + readonly address: H160; + readonly value: u128; + } & Struct; + readonly isCall: boolean; + readonly asCall: { + readonly source: H160; + readonly target: H160; + readonly input: Bytes; + readonly value: U256; + readonly gasLimit: u64; + readonly maxFeePerGas: U256; + readonly maxPriorityFeePerGas: Option; + readonly nonce: Option; + readonly accessList: Vec]>>; + } & Struct; + readonly isCreate: boolean; + readonly asCreate: { + readonly source: H160; + readonly init: Bytes; + readonly value: U256; + readonly gasLimit: u64; + readonly maxFeePerGas: U256; + readonly maxPriorityFeePerGas: Option; + readonly nonce: Option; + readonly accessList: Vec]>>; + } & Struct; + readonly isCreate2: boolean; + readonly asCreate2: { + readonly source: H160; + readonly init: Bytes; + readonly salt: H256; + readonly value: U256; + readonly gasLimit: u64; + readonly maxFeePerGas: U256; + readonly maxPriorityFeePerGas: Option; + readonly nonce: Option; + readonly accessList: Vec]>>; + } & Struct; + readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name FrameSystemPhase (304) */ - export interface FrameSystemPhase extends Enum { - readonly isApplyExtrinsic: boolean; - readonly asApplyExtrinsic: u32; - readonly isFinalization: boolean; - readonly isInitialization: boolean; - readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; + /** @name PalletEthereumCall (308) */ + interface PalletEthereumCall extends Enum { + readonly isTransact: boolean; + readonly asTransact: { + readonly transaction: EthereumTransactionTransactionV2; + } & Struct; + readonly type: 'Transact'; } - /** @name FrameSystemLastRuntimeUpgradeInfo (306) */ - export interface FrameSystemLastRuntimeUpgradeInfo extends Struct { - readonly specVersion: Compact; - readonly specName: Text; + /** @name EthereumTransactionTransactionV2 (309) */ + interface EthereumTransactionTransactionV2 extends Enum { + readonly isLegacy: boolean; + readonly asLegacy: EthereumTransactionLegacyTransaction; + readonly isEip2930: boolean; + readonly asEip2930: EthereumTransactionEip2930Transaction; + readonly isEip1559: boolean; + readonly asEip1559: EthereumTransactionEip1559Transaction; + readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name FrameSystemLimitsBlockWeights (307) */ - export interface FrameSystemLimitsBlockWeights extends Struct { - readonly baseBlock: u64; - readonly maxBlock: u64; - readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; + /** @name EthereumTransactionLegacyTransaction (310) */ + interface EthereumTransactionLegacyTransaction extends Struct { + readonly nonce: U256; + readonly gasPrice: U256; + readonly gasLimit: U256; + readonly action: EthereumTransactionTransactionAction; + readonly value: U256; + readonly input: Bytes; + readonly signature: EthereumTransactionTransactionSignature; } - /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (308) */ - export interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { - readonly normal: FrameSystemLimitsWeightsPerClass; - readonly operational: FrameSystemLimitsWeightsPerClass; - readonly mandatory: FrameSystemLimitsWeightsPerClass; + /** @name EthereumTransactionTransactionAction (311) */ + interface EthereumTransactionTransactionAction extends Enum { + readonly isCall: boolean; + readonly asCall: H160; + readonly isCreate: boolean; + readonly type: 'Call' | 'Create'; } - /** @name FrameSystemLimitsWeightsPerClass (309) */ - export interface FrameSystemLimitsWeightsPerClass extends Struct { - readonly baseExtrinsic: u64; - readonly maxExtrinsic: Option; - readonly maxTotal: Option; - readonly reserved: Option; + /** @name EthereumTransactionTransactionSignature (312) */ + interface EthereumTransactionTransactionSignature extends Struct { + readonly v: u64; + readonly r: H256; + readonly s: H256; } - /** @name FrameSystemLimitsBlockLength (311) */ - export interface FrameSystemLimitsBlockLength extends Struct { - readonly max: FrameSupportWeightsPerDispatchClassU32; + /** @name EthereumTransactionEip2930Transaction (314) */ + interface EthereumTransactionEip2930Transaction extends Struct { + readonly chainId: u64; + readonly nonce: U256; + readonly gasPrice: U256; + readonly gasLimit: U256; + readonly action: EthereumTransactionTransactionAction; + readonly value: U256; + readonly input: Bytes; + readonly accessList: Vec; + readonly oddYParity: bool; + readonly r: H256; + readonly s: H256; } - /** @name FrameSupportWeightsPerDispatchClassU32 (312) */ - export interface FrameSupportWeightsPerDispatchClassU32 extends Struct { - readonly normal: u32; - readonly operational: u32; - readonly mandatory: u32; + /** @name EthereumTransactionAccessListItem (316) */ + interface EthereumTransactionAccessListItem extends Struct { + readonly address: H160; + readonly storageKeys: Vec; } - /** @name FrameSupportWeightsRuntimeDbWeight (313) */ - export interface FrameSupportWeightsRuntimeDbWeight extends Struct { - readonly read: u64; - readonly write: u64; + /** @name EthereumTransactionEip1559Transaction (317) */ + interface EthereumTransactionEip1559Transaction extends Struct { + readonly chainId: u64; + readonly nonce: U256; + readonly maxPriorityFeePerGas: U256; + readonly maxFeePerGas: U256; + readonly gasLimit: U256; + readonly action: EthereumTransactionTransactionAction; + readonly value: U256; + readonly input: Bytes; + readonly accessList: Vec; + readonly oddYParity: bool; + readonly r: H256; + readonly s: H256; } - /** @name SpVersionRuntimeVersion (314) */ - export interface SpVersionRuntimeVersion extends Struct { - readonly specName: Text; - readonly implName: Text; - readonly authoringVersion: u32; - readonly specVersion: u32; - readonly implVersion: u32; - readonly apis: Vec>; - readonly transactionVersion: u32; - readonly stateVersion: u8; + /** @name PalletEvmMigrationCall (318) */ + interface PalletEvmMigrationCall extends Enum { + readonly isBegin: boolean; + readonly asBegin: { + readonly address: H160; + } & Struct; + readonly isSetData: boolean; + readonly asSetData: { + readonly address: H160; + readonly data: Vec>; + } & Struct; + readonly isFinish: boolean; + readonly asFinish: { + readonly address: H160; + readonly code: Bytes; + } & Struct; + readonly type: 'Begin' | 'SetData' | 'Finish'; } - /** @name FrameSystemError (318) */ - export interface FrameSystemError extends Enum { - readonly isInvalidSpecName: boolean; - readonly isSpecVersionNeedsToIncrease: boolean; - readonly isFailedToExtractRuntimeVersion: boolean; - readonly isNonDefaultComposite: boolean; - readonly isNonZeroRefCount: boolean; - readonly isCallFiltered: boolean; - readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; + /** @name PalletSudoError (321) */ + interface PalletSudoError extends Enum { + readonly isRequireSudo: boolean; + readonly type: 'RequireSudo'; } - /** @name OrmlVestingModuleError (320) */ - export interface OrmlVestingModuleError extends Enum { + /** @name OrmlVestingModuleError (323) */ + interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; readonly isInsufficientBalanceToLock: boolean; @@ -2965,30 +2837,30 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (322) */ - export interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { + /** @name CumulusPalletXcmpQueueInboundChannelDetails (325) */ + interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (323) */ - export interface CumulusPalletXcmpQueueInboundState extends Enum { + /** @name CumulusPalletXcmpQueueInboundState (326) */ + interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (326) */ - export interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (329) */ + interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; readonly isSignals: boolean; readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (329) */ - export interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (332) */ + interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; readonly signalsExist: bool; @@ -2996,15 +2868,15 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (330) */ - export interface CumulusPalletXcmpQueueOutboundState extends Enum { + /** @name CumulusPalletXcmpQueueOutboundState (333) */ + interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (332) */ - export interface CumulusPalletXcmpQueueQueueConfigData extends Struct { + /** @name CumulusPalletXcmpQueueQueueConfigData (335) */ + interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; readonly resumeThreshold: u32; @@ -3013,8 +2885,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly xcmpMaxIndividualWeight: u64; } - /** @name CumulusPalletXcmpQueueError (334) */ - export interface CumulusPalletXcmpQueueError extends Enum { + /** @name CumulusPalletXcmpQueueError (337) */ + interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; readonly isBadXcm: boolean; @@ -3023,8 +2895,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (335) */ - export interface PalletXcmError extends Enum { + /** @name PalletXcmError (338) */ + interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; readonly isFiltered: boolean; @@ -3041,30 +2913,30 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (336) */ - export type CumulusPalletXcmError = Null; + /** @name CumulusPalletXcmError (339) */ + type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (337) */ - export interface CumulusPalletDmpQueueConfigData extends Struct { + /** @name CumulusPalletDmpQueueConfigData (340) */ + interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: u64; } - /** @name CumulusPalletDmpQueuePageIndexData (338) */ - export interface CumulusPalletDmpQueuePageIndexData extends Struct { + /** @name CumulusPalletDmpQueuePageIndexData (341) */ + interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (341) */ - export interface CumulusPalletDmpQueueError extends Enum { + /** @name CumulusPalletDmpQueueError (344) */ + interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (345) */ - export interface PalletUniqueError extends Enum { + /** @name PalletUniqueError (348) */ + interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; readonly isEmptyArgument: boolean; @@ -3072,8 +2944,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name PalletUniqueSchedulerScheduledV3 (348) */ - export interface PalletUniqueSchedulerScheduledV3 extends Struct { + /** @name PalletUniqueSchedulerScheduledV3 (351) */ + interface PalletUniqueSchedulerScheduledV3 extends Struct { readonly maybeId: Option; readonly priority: u8; readonly call: FrameSupportScheduleMaybeHashed; @@ -3081,9 +2953,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly origin: OpalRuntimeOriginCaller; } - /** @name OpalRuntimeOriginCaller (349) */ - export interface OpalRuntimeOriginCaller extends Enum { - readonly isVoid: boolean; + /** @name OpalRuntimeOriginCaller (352) */ + interface OpalRuntimeOriginCaller extends Enum { readonly isSystem: boolean; readonly asSystem: FrameSupportDispatchRawOrigin; readonly isVoid: boolean; @@ -3096,8 +2967,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; } - /** @name FrameSupportDispatchRawOrigin (350) */ - export interface FrameSupportDispatchRawOrigin extends Enum { + /** @name FrameSupportDispatchRawOrigin (353) */ + interface FrameSupportDispatchRawOrigin extends Enum { readonly isRoot: boolean; readonly isSigned: boolean; readonly asSigned: AccountId32; @@ -3105,8 +2976,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Root' | 'Signed' | 'None'; } - /** @name PalletXcmOrigin (351) */ - export interface PalletXcmOrigin extends Enum { + /** @name PalletXcmOrigin (354) */ + interface PalletXcmOrigin extends Enum { readonly isXcm: boolean; readonly asXcm: XcmV1MultiLocation; readonly isResponse: boolean; @@ -3114,26 +2985,26 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Xcm' | 'Response'; } - /** @name CumulusPalletXcmOrigin (352) */ - export interface CumulusPalletXcmOrigin extends Enum { + /** @name CumulusPalletXcmOrigin (355) */ + interface CumulusPalletXcmOrigin extends Enum { readonly isRelay: boolean; readonly isSiblingParachain: boolean; readonly asSiblingParachain: u32; readonly type: 'Relay' | 'SiblingParachain'; } - /** @name PalletEthereumRawOrigin (353) */ - export interface PalletEthereumRawOrigin extends Enum { + /** @name PalletEthereumRawOrigin (356) */ + interface PalletEthereumRawOrigin extends Enum { readonly isEthereumTransaction: boolean; readonly asEthereumTransaction: H160; readonly type: 'EthereumTransaction'; } - /** @name SpCoreVoid (354) */ - export type SpCoreVoid = Null; + /** @name SpCoreVoid (357) */ + type SpCoreVoid = Null; - /** @name PalletUniqueSchedulerError (355) */ - export interface PalletUniqueSchedulerError extends Enum { + /** @name PalletUniqueSchedulerError (358) */ + interface PalletUniqueSchedulerError extends Enum { readonly isFailedToSchedule: boolean; readonly isNotFound: boolean; readonly isTargetBlockNumberInPast: boolean; @@ -3141,8 +3012,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; } - /** @name UpDataStructsCollection (356) */ - export interface UpDataStructsCollection extends Struct { + /** @name UpDataStructsCollection (359) */ + interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; readonly name: Vec; @@ -3154,8 +3025,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly externalCollection: bool; } - /** @name UpDataStructsSponsorshipState (357) */ - export interface UpDataStructsSponsorshipState extends Enum { + /** @name UpDataStructsSponsorshipState (360) */ + interface UpDataStructsSponsorshipState extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; readonly asUnconfirmed: AccountId32; @@ -3164,44 +3035,44 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (358) */ - export interface UpDataStructsProperties extends Struct { + /** @name UpDataStructsProperties (361) */ + interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (359) */ - export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} + /** @name UpDataStructsPropertiesMapBoundedVec (362) */ + interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (364) */ - export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} + /** @name UpDataStructsPropertiesMapPropertyPermission (367) */ + interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (371) */ - export interface UpDataStructsCollectionStats extends Struct { + /** @name UpDataStructsCollectionStats (374) */ + interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (372) */ - export interface UpDataStructsTokenChild extends Struct { + /** @name UpDataStructsTokenChild (375) */ + interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (373) */ - export interface PhantomTypeUpDataStructs extends Vec> {} + /** @name PhantomTypeUpDataStructs (376) */ + interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (375) */ - export interface UpDataStructsTokenData extends Struct { + /** @name UpDataStructsTokenData (378) */ + interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (377) */ - export interface UpDataStructsRpcCollection extends Struct { + /** @name UpDataStructsRpcCollection (380) */ + interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; readonly name: Vec; @@ -3215,8 +3086,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly readOnly: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (378) */ - export interface RmrkTraitsCollectionCollectionInfo extends Struct { + /** @name RmrkTraitsCollectionCollectionInfo (381) */ + interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; readonly max: Option; @@ -3224,8 +3095,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (379) */ - export interface RmrkTraitsNftNftInfo extends Struct { + /** @name RmrkTraitsNftNftInfo (382) */ + interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; readonly metadata: Bytes; @@ -3233,41 +3104,41 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (381) */ - export interface RmrkTraitsNftRoyaltyInfo extends Struct { + /** @name RmrkTraitsNftRoyaltyInfo (384) */ + interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (382) */ - export interface RmrkTraitsResourceResourceInfo extends Struct { + /** @name RmrkTraitsResourceResourceInfo (385) */ + interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; readonly pending: bool; readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (383) */ - export interface RmrkTraitsPropertyPropertyInfo extends Struct { + /** @name RmrkTraitsPropertyPropertyInfo (386) */ + interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (384) */ - export interface RmrkTraitsBaseBaseInfo extends Struct { + /** @name RmrkTraitsBaseBaseInfo (387) */ + interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (385) */ - export interface RmrkTraitsNftNftChild extends Struct { + /** @name RmrkTraitsNftNftChild (388) */ + interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (387) */ - export interface PalletCommonError extends Enum { + /** @name PalletCommonError (390) */ + interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; readonly isNoPermission: boolean; @@ -3305,8 +3176,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (389) */ - export interface PalletFungibleError extends Enum { + /** @name PalletFungibleError (392) */ + interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; readonly isFungibleItemsDontHaveData: boolean; @@ -3315,13 +3186,13 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (390) */ - export interface PalletRefungibleItemData extends Struct { + /** @name PalletRefungibleItemData (393) */ + interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } - /** @name PalletRefungibleError (394) */ - export interface PalletRefungibleError extends Enum { + /** @name PalletRefungibleError (398) */ + interface PalletRefungibleError extends Enum { readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isWrongRefungiblePieces: boolean; readonly isRepartitionWhileNotOwningAllPieces: boolean; @@ -3330,29 +3201,29 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletNonfungibleItemData (395) */ - export interface PalletNonfungibleItemData extends Struct { + /** @name PalletNonfungibleItemData (399) */ + interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (397) */ - export interface UpDataStructsPropertyScope extends Enum { + /** @name UpDataStructsPropertyScope (401) */ + interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; readonly isEth: boolean; readonly type: 'None' | 'Rmrk' | 'Eth'; } - /** @name PalletNonfungibleError (399) */ - export interface PalletNonfungibleError extends Enum { + /** @name PalletNonfungibleError (403) */ + interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; readonly isCantBurnNftWithChildren: boolean; readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (400) */ - export interface PalletStructureError extends Enum { + /** @name PalletStructureError (404) */ + interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; readonly isBreadthLimit: boolean; @@ -3360,8 +3231,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletRmrkCoreError (401) */ - export interface PalletRmrkCoreError extends Enum { + /** @name PalletRmrkCoreError (405) */ + interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; readonly isRmrkPropertyValueIsTooLong: boolean; @@ -3384,8 +3255,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } - /** @name PalletRmrkEquipError (403) */ - export interface PalletRmrkEquipError extends Enum { + /** @name PalletRmrkEquipError (407) */ + interface PalletRmrkEquipError extends Enum { readonly isPermissionError: boolean; readonly isNoAvailableBaseId: boolean; readonly isNoAvailablePartId: boolean; @@ -3396,8 +3267,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; } - /** @name PalletEvmError (406) */ - export interface PalletEvmError extends Enum { + /** @name PalletEvmError (411) */ + interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; readonly isPaymentOverflow: boolean; @@ -3407,8 +3278,8 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (409) */ - export interface FpRpcTransactionStatus extends Struct { + /** @name FpRpcTransactionStatus (414) */ + interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; readonly from: H160; @@ -3418,11 +3289,11 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (411) */ - export interface EthbloomBloom extends U8aFixed {} + /** @name EthbloomBloom (416) */ + interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (413) */ - export interface EthereumReceiptReceiptV3 extends Enum { + /** @name EthereumReceiptReceiptV3 (418) */ + interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; readonly isEip2930: boolean; @@ -3432,23 +3303,23 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (414) */ - export interface EthereumReceiptEip658ReceiptData extends Struct { + /** @name EthereumReceiptEip658ReceiptData (419) */ + interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; readonly logsBloom: EthbloomBloom; readonly logs: Vec; } - /** @name EthereumBlock (415) */ - export interface EthereumBlock extends Struct { + /** @name EthereumBlock (420) */ + interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (416) */ - export interface EthereumHeader extends Struct { + /** @name EthereumHeader (421) */ + interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; readonly beneficiary: H160; @@ -3466,46 +3337,46 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (417) */ - export interface EthereumTypesHashH64 extends U8aFixed {} + /** @name EthereumTypesHashH64 (422) */ + interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (422) */ - export interface PalletEthereumError extends Enum { + /** @name PalletEthereumError (427) */ + interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (423) */ - export interface PalletEvmCoderSubstrateError extends Enum { + /** @name PalletEvmCoderSubstrateError (428) */ + interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name PalletEvmContractHelpersSponsoringModeT (424) */ - export interface PalletEvmContractHelpersSponsoringModeT extends Enum { + /** @name PalletEvmContractHelpersSponsoringModeT (429) */ + interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; readonly isGenerous: boolean; readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (426) */ - export interface PalletEvmContractHelpersError extends Enum { + /** @name PalletEvmContractHelpersError (431) */ + interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly type: 'NoPermission'; } - /** @name PalletEvmMigrationError (427) */ - export interface PalletEvmMigrationError extends Enum { + /** @name PalletEvmMigrationError (432) */ + interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (429) */ - export interface SpRuntimeMultiSignature extends Enum { + /** @name SpRuntimeMultiSignature (434) */ + interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; readonly isSr25519: boolean; @@ -3515,34 +3386,34 @@ import type { Event } from '@polkadot/types/interfaces/system'; readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (430) */ - export interface SpCoreEd25519Signature extends U8aFixed {} + /** @name SpCoreEd25519Signature (435) */ + interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (434) */ - export interface SpCoreSr25519Signature extends U8aFixed {} + /** @name SpCoreSr25519Signature (437) */ + interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (435) */ - export interface SpCoreEcdsaSignature extends U8aFixed {} + /** @name SpCoreEcdsaSignature (438) */ + interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (438) */ - export type FrameSystemExtensionsCheckSpecVersion = Null; + /** @name FrameSystemExtensionsCheckSpecVersion (441) */ + type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (439) */ - export type FrameSystemExtensionsCheckGenesis = Null; + /** @name FrameSystemExtensionsCheckGenesis (442) */ + type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (442) */ - export interface FrameSystemExtensionsCheckNonce extends Compact {} + /** @name FrameSystemExtensionsCheckNonce (445) */ + interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (443) */ - export type FrameSystemExtensionsCheckWeight = Null; + /** @name FrameSystemExtensionsCheckWeight (446) */ + type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (444) */ - export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (447) */ + interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (445) */ - export type OpalRuntimeRuntime = Null; + /** @name OpalRuntimeRuntime (448) */ + type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (444) */ - export type PalletEthereumFakeTransactionFinalizer = Null; + /** @name PalletEthereumFakeTransactionFinalizer (449) */ + type PalletEthereumFakeTransactionFinalizer = Null; } // declare module diff --git a/tests/src/interfaces/unique/definitions.ts b/tests/src/interfaces/unique/definitions.ts index 762d38d6b0..d2dee8b6fc 100644 --- a/tests/src/interfaces/unique/definitions.ts +++ b/tests/src/interfaces/unique/definitions.ts @@ -195,5 +195,10 @@ export default { [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}], 'u128', ), + pendingUnstakePerBlock: fun( + 'Returns the total amount of unstaked tokens per block', + [crossAccountParam('staker')], + 'Vec<(u32, u128)>', + ), }, }; From 35a9f8c20eddf88cabe974d1d7ec027944d4499d Mon Sep 17 00:00:00 2001 From: PraetorP Date: Thu, 25 Aug 2022 18:27:26 +0700 Subject: [PATCH 0621/1274] features : added full test coverage(except contract sponsoting) + switch to realay block for income calc + add recalc event --- Cargo.lock | 3 + pallets/app-promotion/Cargo.toml | 16 + pallets/app-promotion/src/benchmarking.rs | 2 +- pallets/app-promotion/src/lib.rs | 165 ++++- pallets/app-promotion/src/tests.rs | 24 +- pallets/app-promotion/src/types.rs | 77 +- pallets/unique/src/lib.rs | 2 +- .../common/config/pallets/app_promotion.rs | 28 +- runtime/common/construct_runtime/mod.rs | 2 +- tests/src/app-promotion.test.ts | 698 +++++++++++++++++- tests/src/interfaces/augment-api-consts.ts | 26 +- tests/src/interfaces/augment-api-errors.ts | 17 + tests/src/interfaces/augment-api-events.ts | 7 + tests/src/interfaces/augment-api-tx.ts | 6 +- tests/src/interfaces/augment-types.ts | 4 +- tests/src/interfaces/default/types.ts | 31 +- tests/src/interfaces/lookup.ts | 384 +++++----- tests/src/interfaces/registry.ts | 4 +- tests/src/interfaces/types-lookup.ts | 389 +++++----- 19 files changed, 1442 insertions(+), 443 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cb8a959576..ec67590ccb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5304,9 +5304,11 @@ dependencies = [ "frame-support", "frame-system", "pallet-balances", + "pallet-common", "pallet-evm", "pallet-randomness-collective-flip", "pallet-timestamp", + "pallet-unique", "parity-scale-codec 3.1.5", "scale-info", "serde", @@ -5314,6 +5316,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", + "up-data-structs", ] [[package]] diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index 11c6f947a0..2faa34ca99 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -104,6 +104,22 @@ default-features = false git = "https://github.com/uniquenetwork/frontier" branch = "unique-polkadot-v0.9.27" +################################################################################ +# local dependencies +[dependencies.up-data-structs] +default-features = false +path = "../../primitives/data-structs" + +[dependencies.pallet-common] +default-features = false +path = "../common" + +[dependencies.pallet-unique] +default-features = false +path = "../unique" + +################################################################################ + [dependencies] scale-info = { version = "2.0.1", default-features = false, features = [ "derive", diff --git a/pallets/app-promotion/src/benchmarking.rs b/pallets/app-promotion/src/benchmarking.rs index 2aa32ba1c8..1d8fd361bc 100644 --- a/pallets/app-promotion/src/benchmarking.rs +++ b/pallets/app-promotion/src/benchmarking.rs @@ -59,7 +59,7 @@ benchmarks! { let _ = T::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); let _ = PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * T::Currency::total_balance(&caller))?; - } : {PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * T::Currency::total_balance(&caller))?} + } : {PromototionPallet::::unstake(RawOrigin::Signed(caller.clone()).into(), share * T::Currency::total_balance(&caller))?} recalculate_stake { let caller = account::("caller", 0, SEED); diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 237211c356..18fbf80524 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -36,11 +36,14 @@ mod tests; pub mod types; pub mod weights; -use sp_std::{vec::Vec, iter::Sum}; +use sp_std::{vec::Vec, iter::Sum, borrow::ToOwned}; use codec::EncodeLike; use pallet_balances::BalanceLock; pub use types::ExtendedLockableCurrency; +// use up_common::constants::{DAYS, UNIQUE}; +use up_data_structs::CollectionId; + use frame_support::{ dispatch::{DispatchResult}, traits::{ @@ -55,38 +58,68 @@ pub use pallet::*; use pallet_evm::account::CrossAccountId; use sp_runtime::{ Perbill, - traits::{BlockNumberProvider, CheckedAdd, CheckedSub}, + traits::{BlockNumberProvider, CheckedAdd, CheckedSub, AccountIdConversion}, ArithmeticError, }; type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; -const SECONDS_TO_BLOCK: u32 = 6; -const DAY: u32 = 60 * 60 * 24 / SECONDS_TO_BLOCK; -const WEEK: u32 = 7 * DAY; -const TWO_WEEK: u32 = 2 * WEEK; -const YEAR: u32 = DAY * 365; +// const SECONDS_TO_BLOCK: u32 = 6; +// const DAY: u32 = 60 * 60 * 24 / SECONDS_TO_BLOCK; +// const WEEK: u32 = 7 * DAY; +// const TWO_WEEK: u32 = 2 * WEEK; +// const YEAR: u32 = DAY * 365; pub const LOCK_IDENTIFIER: [u8; 8] = *b"appstake"; #[frame_support::pallet] pub mod pallet { use super::*; - use frame_support::{Blake2_128Concat, Twox64Concat, pallet_prelude::*, storage::Key}; + use frame_support::{Blake2_128Concat, Twox64Concat, pallet_prelude::*, storage::Key, PalletId}; use frame_system::pallet_prelude::*; + use types::CollectionHandler; #[pallet::config] pub trait Config: frame_system::Config + pallet_evm::account::Config { type Currency: ExtendedLockableCurrency; + type CollectionHandler: CollectionHandler< + AccountId = Self::AccountId, + CollectionId = CollectionId, + >; + type TreasuryAccountId: Get; + /// The app's pallet id, used for deriving its sovereign account ID. + #[pallet::constant] + type PalletId: Get; + + /// In relay blocks. + #[pallet::constant] + type RecalculationInterval: Get; + /// In chain blocks. + #[pallet::constant] + type PendingInterval: Get; + + /// In chain blocks. + #[pallet::constant] + type Day: Get; // useless + + #[pallet::constant] + type Nominal: Get>; + + #[pallet::constant] + type IntervalIncome: Get; + /// Weight information for extrinsics in this pallet. type WeightInfo: WeightInfo; - // The block number provider - type BlockNumberProvider: BlockNumberProvider; + // The relay block number provider + type RelayBlockNumberProvider: BlockNumberProvider; + + /// Events compatible with [`frame_system::Config::Event`]. + type Event: IsType<::Event> + From>; // /// Number of blocks that pass between treasury balance updates due to inflation // #[pallet::constant] @@ -100,6 +133,28 @@ pub mod pallet { #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); + #[pallet::event] + #[pallet::generate_deposit(fn deposit_event)] + pub enum Event { + StakingRecalculation( + /// Base on which interest is calculated + BalanceOf, + /// Amount of accrued interest + BalanceOf, + ), + } + + #[pallet::error] + pub enum Error { + AdminNotSet, + /// No permission to perform action + NoPermission, + /// Insufficient funds to perform an action + NotSufficientFounds, + InvalidArgument, + AlreadySponsored, + } + #[pallet::storage] pub type TotalStaked = StorageValue, QueryKind = ValueQuery>; @@ -164,23 +219,33 @@ pub mod pallet { }); let next_interest_block = Self::get_interest_block(); - - if next_interest_block != 0.into() && current_block >= next_interest_block { + let current_relay_block = T::RelayBlockNumberProvider::current_block_number(); + if next_interest_block != 0.into() && current_relay_block >= next_interest_block { let mut acc = >::default(); + let mut base_acc = >::default(); - NextInterestBlock::::set(current_block + DAY.into()); + NextInterestBlock::::set( + NextInterestBlock::::get() + T::RecalculationInterval::get(), + ); add_weight(0, 1, 0); Staked::::iter() - .filter(|((_, block), _)| *block + DAY.into() <= current_block) + .filter(|((_, block), _)| { + *block + T::RecalculationInterval::get() <= current_relay_block + }) .for_each(|((staker, block), amount)| { Self::recalculate_stake(&staker, block, amount, &mut acc); add_weight(0, 0, T::WeightInfo::recalculate_stake()); + base_acc += amount; }); >::get() .checked_add(&acc) .map(|res| >::set(res)); + + Self::deposit_event(Event::StakingRecalculation(base_acc, acc)); add_weight(0, 1, 0); + } else { + add_weight(1, 0, 0) }; consumed_weight } @@ -189,9 +254,9 @@ pub mod pallet { #[pallet::call] impl Pallet { #[pallet::weight(T::WeightInfo::set_admin_address())] - pub fn set_admin_address(origin: OriginFor, admin: T::AccountId) -> DispatchResult { + pub fn set_admin_address(origin: OriginFor, admin: T::CrossAccountId) -> DispatchResult { ensure_root(origin)?; - >::set(Some(admin)); + >::set(Some(admin.as_sub().to_owned())); Ok(()) } @@ -199,7 +264,7 @@ pub mod pallet { #[pallet::weight(T::WeightInfo::start_app_promotion())] pub fn start_app_promotion( origin: OriginFor, - promotion_start_relay_block: T::BlockNumber, + promotion_start_relay_block: Option, ) -> DispatchResult where ::BlockNumber: From, @@ -208,10 +273,13 @@ pub mod pallet { // Start app-promotion mechanics if it has not been yet initialized if >::get() == 0u32.into() { + let start_block = promotion_start_relay_block + .unwrap_or(T::RelayBlockNumberProvider::current_block_number()); + // Set promotion global start block - >::set(promotion_start_relay_block); + >::set(start_block); - >::set(promotion_start_relay_block + DAY.into()); + >::set(start_block + T::RecalculationInterval::get()); } Ok(()) @@ -221,6 +289,8 @@ pub mod pallet { pub fn stake(staker: OriginFor, amount: BalanceOf) -> DispatchResult { let staker_id = ensure_signed(staker)?; + ensure!(amount >= T::Nominal::get(), ArithmeticError::Underflow); + let balance = <::Currency as Currency>::free_balance(&staker_id); @@ -235,7 +305,7 @@ pub mod pallet { Self::add_lock_balance(&staker_id, amount)?; - let block_number = frame_system::Pallet::::block_number(); + let block_number = T::RelayBlockNumberProvider::current_block_number(); >::insert( (&staker_id, block_number), @@ -271,7 +341,7 @@ pub mod pallet { .ok_or(ArithmeticError::Underflow)?, ); - let block = frame_system::Pallet::::block_number() + WEEK.into(); + let block = frame_system::Pallet::::block_number() + T::PendingInterval::get(); >::insert( (&staker_id, block), >::get((&staker_id, block)) @@ -311,6 +381,40 @@ pub mod pallet { Ok(()) } + + #[pallet::weight(0)] + pub fn sponsor_collection( + admin: OriginFor, + collection_id: CollectionId, + ) -> DispatchResult { + let admin_id = ensure_signed(admin)?; + ensure!( + admin_id == Admin::::get().ok_or(Error::::AdminNotSet)?, + Error::::NoPermission + ); + + T::CollectionHandler::set_sponsor(Self::account_id(), collection_id) + } + #[pallet::weight(0)] + pub fn stop_sponsorign_collection( + admin: OriginFor, + collection_id: CollectionId, + ) -> DispatchResult { + let admin_id = ensure_signed(admin)?; + + ensure!( + admin_id == Admin::::get().ok_or(Error::::AdminNotSet)?, + Error::::NoPermission + ); + + ensure!( + T::CollectionHandler::get_sponsor(collection_id)? + .ok_or(>::InvalidArgument)? + == Self::account_id(), + >::NoPermission + ); + T::CollectionHandler::remove_collection_sponsor(collection_id) + } } } @@ -396,13 +500,13 @@ impl Pallet { // Ok(()) // } - pub fn sponsor_collection(admin: T::AccountId, collection_id: u32) -> DispatchResult { - Ok(()) - } + // pub fn sponsor_collection(admin: T::AccountId, collection_id: u32) -> DispatchResult { + // Ok(()) + // } - pub fn stop_sponsorign_collection(admin: T::AccountId, collection_id: u32) -> DispatchResult { - Ok(()) - } + // pub fn stop_sponsorign_collection(admin: T::AccountId, collection_id: u32) -> DispatchResult { + // Ok(()) + // } pub fn sponsor_conract(admin: T::AccountId, app_id: u32) -> DispatchResult { Ok(()) @@ -411,6 +515,10 @@ impl Pallet { pub fn stop_sponsorign_contract(admin: T::AccountId, app_id: u32) -> DispatchResult { Ok(()) } + + pub fn account_id() -> T::AccountId { + T::PalletId::get().into_account_truncating() + } } impl Pallet { @@ -514,8 +622,7 @@ impl Pallet { where I: EncodeLike> + Balance, { - let day_rate = Perbill::from_rational(5u32, 1_0000); - day_rate * base + T::IntervalIncome::get() * base } } diff --git a/pallets/app-promotion/src/tests.rs b/pallets/app-promotion/src/tests.rs index b5c110c5c8..eaec6f37a3 100644 --- a/pallets/app-promotion/src/tests.rs +++ b/pallets/app-promotion/src/tests.rs @@ -28,7 +28,7 @@ use sp_core::H256; use sp_runtime::{ traits::{BlakeTwo256, BlockNumberProvider, IdentityLookup}, testing::Header, - Perbill, + Perbill, Perquintill, }; // type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; @@ -126,3 +126,25 @@ use sp_runtime::{ // test_benchmark_stake::(); // } ) // } + +#[test] +fn test_perbill() { + const ONE_UNIQE: u128 = 1_000_000_000_000_000_000; + const SECONDS_TO_BLOCK: u32 = 12; + const DAY: u32 = 60 * 60 * 24 / SECONDS_TO_BLOCK; + const RECALCULATION_INTERVAL: u32 = 10; + let day_rate = Perbill::from_rational(5u64, 10_000); + let interval_rate = + Perbill::from_rational::(RECALCULATION_INTERVAL.into(), DAY.into()) * day_rate; + println!("{:?}", interval_rate * ONE_UNIQE + ONE_UNIQE); + println!("{:?}", day_rate * ONE_UNIQE); + println!("{:?}", Perbill::one() * ONE_UNIQE); + println!("{:?}", ONE_UNIQE); + let mut next_iters = ONE_UNIQE + interval_rate * ONE_UNIQE; + next_iters += interval_rate * next_iters; + println!("{:?}", next_iters); + let day_income = day_rate * ONE_UNIQE; + let interval_income = interval_rate * ONE_UNIQE; + let ratio = day_income / interval_income; + println!("{:?} || {:?}", ratio, DAY / RECALCULATION_INTERVAL); +} diff --git a/pallets/app-promotion/src/types.rs b/pallets/app-promotion/src/types.rs index bf561bb5fd..42b706b3c7 100644 --- a/pallets/app-promotion/src/types.rs +++ b/pallets/app-promotion/src/types.rs @@ -1,6 +1,14 @@ use codec::EncodeLike; -use frame_support::{traits::LockableCurrency, WeakBoundedVec, Parameter}; +use frame_support::{ + traits::LockableCurrency, WeakBoundedVec, Parameter, dispatch::DispatchResult, ensure, +}; +use frame_system::Config; use pallet_balances::{BalanceLock, Config as BalancesConfig, Pallet as PalletBalances}; +use pallet_common::CollectionHandle; +use pallet_unique::{Event as UniqueEvent, Error as UniqueError}; +use sp_runtime::DispatchError; +use up_data_structs::{CollectionId, SponsorshipState}; +use sp_std::borrow::ToOwned; pub trait ExtendedLockableCurrency: LockableCurrency { fn locks(who: KArg) -> WeakBoundedVec, Self::MaxLocks> @@ -18,3 +26,70 @@ impl, I: 'static> ExtendedLockableCurrency Self::locks(who) } } + +pub trait CollectionHandler { + type CollectionId; + type AccountId; + + fn set_sponsor( + sponsor_id: Self::AccountId, + collection_id: Self::CollectionId, + ) -> DispatchResult; + + fn remove_collection_sponsor(collection_id: Self::CollectionId) -> DispatchResult; + + fn get_sponsor( + collection_id: Self::CollectionId, + ) -> Result, DispatchError>; +} + +impl CollectionHandler for pallet_unique::Pallet { + type CollectionId = CollectionId; + + type AccountId = T::AccountId; + + fn set_sponsor( + sponsor_id: Self::AccountId, + collection_id: Self::CollectionId, + ) -> DispatchResult { + let mut target_collection = >::try_get(collection_id)?; + target_collection.check_is_internal()?; + target_collection.set_sponsor(sponsor_id.clone())?; + + Self::deposit_event(UniqueEvent::::CollectionSponsorSet( + collection_id, + sponsor_id.clone(), + )); + + ensure!( + target_collection.confirm_sponsorship(&sponsor_id)?, + UniqueError::::ConfirmUnsetSponsorFail + ); + + Self::deposit_event(UniqueEvent::::SponsorshipConfirmed( + collection_id, + sponsor_id, + )); + + target_collection.save() + } + + fn remove_collection_sponsor(collection_id: Self::CollectionId) -> DispatchResult { + let mut target_collection = >::try_get(collection_id)?; + target_collection.check_is_internal()?; + target_collection.sponsorship = SponsorshipState::Disabled; + + Self::deposit_event(UniqueEvent::::CollectionSponsorRemoved(collection_id)); + + target_collection.save() + } + + fn get_sponsor( + collection_id: Self::CollectionId, + ) -> Result, DispatchError> { + Ok(>::try_get(collection_id)? + .sponsorship + .pending_sponsor() + .map(|acc| acc.to_owned())) + } +} diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index acd6c0dc62..232c2beb6b 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -277,7 +277,7 @@ decl_module! { { type Error = Error; - fn deposit_event() = default; + pub fn deposit_event() = default; fn on_initialize(_now: T::BlockNumber) -> Weight { 0 diff --git a/runtime/common/config/pallets/app_promotion.rs b/runtime/common/config/pallets/app_promotion.rs index 08e289b506..1d0519fe63 100644 --- a/runtime/common/config/pallets/app_promotion.rs +++ b/runtime/common/config/pallets/app_promotion.rs @@ -16,12 +16,36 @@ use crate::{ runtime_common::config::pallets::{TreasuryAccountId, RelayChainBlockNumberProvider}, - Runtime, Balances, + Runtime, Balances, BlockNumber, Unique, Event, }; +use frame_support::{parameter_types, PalletId}; +use sp_arithmetic::Perbill; +use up_common::{ + constants::{DAYS, UNIQUE}, + types::Balance, +}; + +parameter_types! { + pub const AppPromotionId: PalletId = PalletId(*b"appstake"); + pub const RecalculationInterval: BlockNumber = 20; + pub const PendingInterval: BlockNumber = 10; + pub const Nominal: Balance = UNIQUE; + pub const Day: BlockNumber = DAYS; + pub IntervalIncome: Perbill = Perbill::from_rational(RecalculationInterval::get(), 2 * DAYS) * Perbill::from_rational(5u32, 10_000); +} + impl pallet_app_promotion::Config for Runtime { + type PalletId = AppPromotionId; + type CollectionHandler = Unique; type Currency = Balances; type WeightInfo = pallet_app_promotion::weights::SubstrateWeight; type TreasuryAccountId = TreasuryAccountId; - type BlockNumberProvider = RelayChainBlockNumberProvider; + type RelayBlockNumberProvider = RelayChainBlockNumberProvider; + type RecalculationInterval = RecalculationInterval; + type PendingInterval = PendingInterval; + type Day = Day; + type Nominal = Nominal; + type IntervalIncome = IntervalIncome; + type Event = Event; } diff --git a/runtime/common/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs index 091b342a04..5a87b0029f 100644 --- a/runtime/common/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -78,7 +78,7 @@ macro_rules! construct_runtime { RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event} = 72, #[runtimes(opal)] - Promotion: pallet_app_promotion::{Pallet, Call, Storage} = 73, + Promotion: pallet_app_promotion::{Pallet, Call, Storage, Event} = 73, // Frontier EVM: pallet_evm::{Pallet, Config, Call, Storage, Event} = 100, diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 7638ff65ef..0dc00d5313 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -40,32 +40,32 @@ import { import chai, {use} from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import getBalance, {getBalanceSingle} from './substrate/get-balance'; -import {unique} from './interfaces/definitions'; import {usingPlaygrounds} from './util/playgrounds'; import {default as waitNewBlocks} from './substrate/wait-new-blocks'; -import BN from 'bn.js'; -import {mnemonicGenerate} from '@polkadot/util-crypto'; +import {encodeAddress, hdEthereum, mnemonicGenerate} from '@polkadot/util-crypto'; +import {stringToU8a} from '@polkadot/util'; import {UniqueHelper} from './util/playgrounds/unique'; +import {ApiPromise} from '@polkadot/api'; chai.use(chaiAsPromised); const expect = chai.expect; let alice: IKeyringPair; let bob: IKeyringPair; let palletAdmin: IKeyringPair; -let nominal: bigint; +let nominal: bigint; +let promotionStartBlock: number | null = null; -describe('integration test: AppPromotion', () => { +describe('app-promotions.stake extrinsic', () => { before(async function() { await usingPlaygrounds(async (helper, privateKeyWrapper) => { if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); alice = privateKeyWrapper('//Alice'); bob = privateKeyWrapper('//Bob'); palletAdmin = privateKeyWrapper('//palletAdmin'); - const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(palletAdmin.addressRaw)); + const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); nominal = helper.balance.getOneTokenNominal(); - await submitTransactionAsync(alice, tx); + await helper.signTransaction(alice, tx); }); }); it('will change balance state to "locked", add it to "staked" map, and increase "totalStaked" amount', async () => { @@ -85,18 +85,19 @@ describe('integration test: AppPromotion', () => { const totalStakedBefore = (await helper.api!.rpc.unique.totalStaked()).toBigInt(); const staker = await createUser(); - const firstStakedBlock = await helper.chain.getLatestBlockNumber(); - await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(1n * nominal))).to.be.eventually.fulfilled; + + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(nominal / 2n))).to.be.eventually.rejected; + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(1n * nominal))).to.be.eventually.fulfilled; expect((await helper.api!.rpc.unique.totalStakingLocked(normalizeAccountId(staker))).toBigInt()).to.be.equal(nominal); expect(9n * nominal - await helper.balance.getSubstrate(staker.address) <= nominal / 2n).to.be.true; expect((await helper.api!.rpc.unique.totalStaked(normalizeAccountId(staker))).toBigInt()).to.be.equal(nominal); expect((await helper.api!.rpc.unique.totalStaked()).toBigInt()).to.be.equal(totalStakedBefore + nominal); await waitNewBlocks(helper.api!, 1); - const secondStakedBlock = await helper.chain.getLatestBlockNumber(); - await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(2n * nominal))).to.be.eventually.fulfilled; + + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(2n * nominal))).to.be.eventually.fulfilled; expect((await helper.api!.rpc.unique.totalStakingLocked(normalizeAccountId(staker))).toBigInt()).to.be.equal(3n * nominal); const stakedPerBlock = (await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([block, amount]) => [block.toBigInt(), amount.toBigInt()]); @@ -115,9 +116,9 @@ describe('integration test: AppPromotion', () => { const staker = await createUser(); - await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.rejected; - await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(7n * nominal))).to.be.eventually.fulfilled; - await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(4n * nominal))).to.be.eventually.rejected; + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.rejected; + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(7n * nominal))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(4n * nominal))).to.be.eventually.rejected; }); }); @@ -128,17 +129,10 @@ describe('integration test: AppPromotion', () => { // assert: query appPromotion.staked(Alice/Bob/Charlie/Dave) equal [100] await usingPlaygrounds(async helper => { - // const userOne = await createUser(); - // const userTwo = await createUser(); - // const userThree = await createUser(); - // const userFour = await createUser(); const crowd = []; for(let i = 4; i--;) crowd.push(await createUser()); - // const crowd = await creteAccounts([10n, 10n, 10n, 10n], alice, helper); - // const crowd = [userOne, userTwo, userThree, userFour]; - - const promises = crowd.map(async user => submitTransactionAsync(user, helper.api!.tx.promotion.stake(nominal))); + const promises = crowd.map(async user => helper.signTransaction(user, helper.api!.tx.promotion.stake(nominal))); await expect(Promise.all(promises)).to.be.eventually.fulfilled; for (let i = 0; i < crowd.length; i++){ @@ -156,9 +150,9 @@ describe('unstake balance extrinsic', () => { alice = privateKeyWrapper('//Alice'); bob = privateKeyWrapper('//Bob'); palletAdmin = privateKeyWrapper('//palletAdmin'); - const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(palletAdmin.addressRaw)); + const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); nominal = helper.balance.getOneTokenNominal(); - await submitTransactionAsync(alice, tx); + await helper.signTransaction(alice, tx); }); }); @@ -174,8 +168,8 @@ describe('unstake balance extrinsic', () => { await usingPlaygrounds(async helper => { const totalStakedBefore = (await helper.api!.rpc.unique.totalStaked()).toBigInt(); const staker = await createUser(); - await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(5n * nominal))).to.be.eventually.fulfilled; - await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.unstake(3n * nominal))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(5n * nominal))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.unstake(3n * nominal))).to.be.eventually.fulfilled; expect((await helper.api!.rpc.unique.pendingUnstake(normalizeAccountId(staker.address))).toBigInt()).to.be.equal(3n * nominal); expect((await helper.api!.rpc.unique.totalStaked(normalizeAccountId(staker))).toBigInt()).to.be.equal(2n * nominal); expect((await helper.api!.rpc.unique.totalStaked()).toBigInt()).to.be.equal(totalStakedBefore + 2n * nominal); @@ -204,18 +198,18 @@ describe('unstake balance extrinsic', () => { await usingPlaygrounds(async helper => { const totalStakedBefore = (await helper.api!.rpc.unique.totalStaked()).toBigInt(); const staker = await createUser(); - await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(1n * nominal))).to.be.eventually.fulfilled; - await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(2n * nominal))).to.be.eventually.fulfilled; - await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.stake(3n * nominal))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(1n * nominal))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(2n * nominal))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(3n * nominal))).to.be.eventually.fulfilled; let stakedPerBlock = (await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt()); expect(stakedPerBlock).to.be.deep.equal([nominal, 2n * nominal, 3n * nominal]); - await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.unstake(3n * nominal / 10n))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.unstake(3n * nominal / 10n))).to.be.eventually.fulfilled; expect((await helper.api!.rpc.unique.pendingUnstake(normalizeAccountId(staker.address))).toBigInt()).to.be.equal(3n * nominal / 10n); stakedPerBlock = (await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt()); expect(stakedPerBlock).to.be.deep.equal([7n * nominal / 10n, 2n * nominal, 3n * nominal]); - await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.unstake(17n * nominal / 10n))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.unstake(17n * nominal / 10n))).to.be.eventually.fulfilled; stakedPerBlock = (await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt()); expect(stakedPerBlock).to.be.deep.equal([nominal, 3n * nominal]); const unstakedPerBlock = (await helper.api!.rpc.unique.pendingUnstakePerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt()); @@ -223,7 +217,7 @@ describe('unstake balance extrinsic', () => { expect(unstakedPerBlock).to.be.deep.equal([3n * nominal / 10n, 17n * nominal / 10n]); await waitNewBlocks(helper.api!, 1); - await expect(submitTransactionAsync(staker, helper.api!.tx.promotion.unstake(4n * nominal))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.unstake(4n * nominal))).to.be.eventually.fulfilled; expect((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt())).to.be.deep.equal([]); expect((await helper.api!.rpc.unique.pendingUnstakePerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt())).to.be.deep.equal([3n * nominal / 10n, 17n * nominal / 10n, 4n * nominal]); }); @@ -232,9 +226,643 @@ describe('unstake balance extrinsic', () => { }); + +describe('Admin adress', () => { + before(async function () { + await usingPlaygrounds(async (helper, privateKeyWrapper) => { + if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); + alice = privateKeyWrapper('//Alice'); + bob = privateKeyWrapper('//Bob'); + palletAdmin = privateKeyWrapper('//palletAdmin'); + await helper.balance.transferToSubstrate(alice, palletAdmin.address, 10n * helper.balance.getOneTokenNominal()); + const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); + + await helper.signTransaction(alice, tx); + + nominal = helper.balance.getOneTokenNominal(); + }); + }); + + it('can be set by sudo only', async () => { + // assert: Sudo calls appPromotion.setAdminAddress(Alice) /// Sudo successfully sets Alice as admin + // assert: Bob calls appPromotion.setAdminAddress(Bob) throws /// Random account can not set admin + // assert: Alice calls appPromotion.setAdminAddress(Bob) throws /// Admin account can not set admin + await usingPlaygrounds(async (helper) => { + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(alice))))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(bob, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(bob))))).to.be.eventually.rejected; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(bob))))).to.be.eventually.fulfilled; + }); + + }); + + it('can be any valid CrossAccountId', async () => { + /// We are not going to set an eth address as a sponsor, + /// but we do want to check, it doesn't break anything; + + // arrange: Charlie creates Punks + // arrange: Sudo calls appPromotion.setAdminAddress(0x0...) success + // arrange: Sudo calls appPromotion.setAdminAddress(Alice) success + + // assert: Alice calls appPromotion.sponsorCollection(Punks.id) success + + await usingPlaygrounds(async (helper) => { + + const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; + + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(ethAcc)))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))))).to.be.eventually.fulfilled; + + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; + }); + + }); + + it('can be reassigned', async () => { + // arrange: Charlie creates Punks + // arrange: Sudo calls appPromotion.setAdminAddress(Alice) + // act: Sudo calls appPromotion.setAdminAddress(Bob) + + // assert: Alice calls appPromotion.sponsorCollection(Punks.id) throws /// Alice can not set collection sponsor + // assert: Bob calls appPromotion.sponsorCollection(Punks.id) successful /// Bob can set collection sponsor + + // act: Sudo calls appPromotion.setAdminAddress(null) successful /// Sudo can set null as a sponsor + // assert: Bob calls appPromotion.stopSponsoringCollection(Punks.id) throws /// Bob is no longer an admin + + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(alice))))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(bob))))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; + + await expect(helper.signTransaction(bob, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; + }); + + }); + +}); + +describe('App-promotion collection sponsoring', () => { + before(async function () { + await usingPlaygrounds(async (helper, privateKeyWrapper) => { + if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); + alice = privateKeyWrapper('//Alice'); + bob = privateKeyWrapper('//Bob'); + palletAdmin = privateKeyWrapper('//palletAdmin'); + await helper.balance.transferToSubstrate(alice, palletAdmin.address, 10n * helper.balance.getOneTokenNominal()); + await helper.balance.transferToSubstrate(alice, calculatePalleteAddress('appstake'), 10n * helper.balance.getOneTokenNominal()); + + + const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); + await helper.signTransaction(alice, tx); + + // const txStart = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.startAppPromotion(promotionStartBlock)); + // await helper.signTransaction(alice, txStart); + + nominal = helper.balance.getOneTokenNominal(); + }); + }); + + it('can not be set by non admin', async () => { + + + // arrange: Charlie creates Punks + // arrange: Sudo calls appPromotion.setAdminAddress(Alice) + + // assert: Random calls appPromotion.sponsorCollection(Punks.id) throws /// Random account can not set sponsoring + // assert: Alice calls appPromotion.sponsorCollection(Punks.id) success /// Admin account can set sponsoring + + await usingPlaygrounds(async (helper) => { + const colletcion = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + + const collectionId = colletcion.collectionId; + + await expect(helper.signTransaction(bob, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; + }); + + }); + + it('will set pallet address as confirmed admin for collection without sponsor', async () => { + // arrange: Charlie creates Punks + + // act: Admin calls appPromotion.sponsorCollection(Punks.id) + + // assert: query collectionById: Punks sponsoring is confirmed by PalleteAddress + + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + const collectionId = collection.collectionId; + + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: calculatePalleteAddress('appstake')}); + }); + + }); + + it('will set pallet address as confirmed admin for collection with unconfirmed sponsor', async () => { + // arrange: Charlie creates Punks + // arrange: Charlie calls setCollectionSponsor(Punks.Id, Dave) /// Dave is unconfirmed sponsor + + // act: Admin calls appPromotion.sponsorCollection(Punks.id) + + // assert: query collectionById: Punks sponsoring is confirmed by PalleteAddress + + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + await collection.setSponsor(alice, bob.address); + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: bob.address}); + + const collectionId = collection.collectionId; + + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: calculatePalleteAddress('appstake')}); + }); + + }); + + it('will set pallet address as confirmed admin for collection with confirmed sponsor', async () => { + // arrange: Charlie creates Punks + // arrange: setCollectionSponsor(Punks.Id, Dave) + // arrange: confirmSponsorship(Punks.Id, Dave) /// Dave is confirmed sponsor + + // act: Admin calls appPromotion.sponsorCollection(Punks.id) + + // assert: query collectionById: Punks sponsoring is confirmed by PalleteAddress + + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + await collection.setSponsor(alice, bob.address); + + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: bob.address}); + expect(await collection.confirmSponsorship(bob)).to.be.true; + + const collectionId = collection.collectionId; + + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: calculatePalleteAddress('appstake')}); + }); + }); + + it('can be overwritten by collection owner', async () => { + // arrange: Charlie creates Punks + // arrange: appPromotion.sponsorCollection(Punks.Id) /// Sponsor of Punks is pallete + + // act: Charlie calls unique.setCollectionLimits(limits) /// Charlie as owner can successfully change limits + // assert: query collectionById(Punks.id) 1. sponsored by pallete, 2. limits has been changed + + // act: Charlie calls setCollectionSponsor(Dave) /// Collection owner reasignes sponsoring + // assert: query collectionById: Punks sponsoring is unconfirmed by Dave + + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + const collectionId = collection.collectionId; + + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: calculatePalleteAddress('appstake')}); + + expect(await collection.setLimits(alice, {sponsorTransferTimeout: 0})).to.be.true; + expect((await collection.getData())?.raw.limits.sponsorTransferTimeout).to.be.equal(0); + + expect((await collection.setSponsor(alice, bob.address))).to.be.true; + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: bob.address}); + }); + + }); + + it('will keep collection limits set by the owner earlier', async () => { + // arrange: const limits = {...all possible collection limits} + // arrange: Charlie creates Punks + // arrange: Charlie calls unique.setCollectionLimits(limits) /// Owner sets all possible limits + + // act: Admin calls appPromotion.sponsorCollection(Punks.id) + // assert: query collectionById(Punks.id) returns limits + + await usingPlaygrounds(async (helper) => { + + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + expect(await collection.setLimits(alice, {sponsorTransferTimeout: 0})).to.be.true; + const limits = (await collection.getData())?.raw.limits; + + const collectionId = collection.collectionId; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; + expect((await collection.getData())?.raw.limits).to.be.deep.equal(limits); + }); + + }); + + it('will throw if collection doesn\'t exist', async () => { + // assert: Admin calls appPromotion.sponsorCollection(999999999999999) throw + await usingPlaygrounds(async (helper) => { + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(999999999))).to.be.eventually.rejected; + }); + }); + + it('will throw if collection was burnt', async () => { + // arrange: Charlie creates Punks + // arrange: Charlie burns Punks + + // assert: Admin calls appPromotion.sponsorCollection(Punks.id) throw + + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + const collectionId = collection.collectionId; + + expect((await collection.burn(alice))).to.be.true; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.rejected; + }); + + }); +}); + + +describe('app-promotion stopSponsoringCollection', () => { + before(async function () { + await usingPlaygrounds(async (helper, privateKeyWrapper) => { + if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); + alice = privateKeyWrapper('//Alice'); + bob = privateKeyWrapper('//Bob'); + palletAdmin = privateKeyWrapper('//palletAdmin'); + await helper.balance.transferToSubstrate(alice, palletAdmin.address, 10n * helper.balance.getOneTokenNominal()); + await helper.balance.transferToSubstrate(alice, calculatePalleteAddress('appstake'), 10n * helper.balance.getOneTokenNominal()); + + const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); + await helper.signTransaction(alice, tx); + + nominal = helper.balance.getOneTokenNominal(); + }); + }); + + it('can not be called by non-admin', async () => { + // arrange: Alice creates Punks + // arrange: appPromotion.sponsorCollection(Punks.Id) + + // assert: Random calls appPromotion.stopSponsoringCollection(Punks) throws + // assert: query collectionById(Punks.id): sponsoring confirmed by PalleteAddress + + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + const collectionId = collection.collectionId; + + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; + + await expect(helper.signTransaction(bob, helper.api!.tx.promotion.stopSponsorignCollection(collectionId))).to.be.eventually.rejected; + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: calculatePalleteAddress('appstake')}); + }); + }); + + it('will set sponsoring as disabled', async () => { + // arrange: Alice creates Punks + // arrange: appPromotion.sponsorCollection(Punks.Id) + + // act: Admin calls appPromotion.stopSponsoringCollection(Punks) + + // assert: query collectionById(Punks.id): sponsoring unconfirmed + + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + const collectionId = collection.collectionId; + + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsorignCollection(collectionId))).to.be.eventually.fulfilled; + + expect((await collection.getData())?.raw.sponsorship).to.be.equal('Disabled'); + }); + }); + + it('will not affect collection which is not sponsored by pallete', async () => { + // arrange: Alice creates Punks + // arrange: Alice calls setCollectionSponsoring(Punks) + // arrange: Alice calls confirmSponsorship(Punks) + + // act: Admin calls appPromotion.stopSponsoringCollection(A) + // assert: query collectionById(Punks): Sponsoring: {Confirmed: Alice} /// Alice still collection owner + + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + const collectionId = collection.collectionId; + expect(await collection.setSponsor(alice, alice.address)).to.be.true; + expect(await collection.confirmSponsorship(alice)).to.be.true; + + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsorignCollection(collectionId))).to.be.eventually.rejected; + + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: alice.address}); + }); + + }); + + it('will throw if collection does not exist', async () => { + // arrange: Alice creates Punks + // arrange: Alice burns Punks + + // assert: Admin calls appPromotion.stopSponsoringCollection(Punks.id) throws + // assert: Admin calls appPromotion.stopSponsoringCollection(999999999999999) throw + + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + const collectionId = collection.collectionId; + + expect((await collection.burn(alice))).to.be.true; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsorignCollection(collectionId))).to.be.eventually.rejected; + }); + }); +}); + +describe('app-promotion contract sponsoring', () => { + it('will set contract sponsoring mode and set palletes address as a sponsor', async () => { + // arrange: Alice deploys Flipper + + // act: Admin calls appPromotion.sponsorContract(Flipper.address) + + // assert: contract.sponsoringMode = TODO + // assert: contract.sponsor to be PalleteAddress + }); + + it('will overwrite sponsoring mode and existed sponsor', async () => { + // arrange: Alice deploys Flipper + // arrange: Alice sets self sponsoring for Flipper + + // act: Admin calls appPromotion.sponsorContract(Flipper.address) + + // assert: contract.sponsoringMode = TODO + // assert: contract.sponsor to be PalleteAddress + }); + + it('can be overwritten by contract owner', async () => { + // arrange: Alice deploys Flipper + // arrange: Admin calls appPromotion.sponsorContract(Flipper.address) + + // act: Alice sets self sponsoring for Flipper + + // assert: contract.sponsoringMode = Self + // assert: contract.sponsor to be contract + }); + + it('can not be set by non admin', async () => { + // arrange: Alice deploys Flipper + // arrange: Alice sets self sponsoring for Flipper + + // assert: Random calls appPromotion.sponsorContract(Flipper.address) throws + // assert: contract.sponsoringMode = Self + // assert: contract.sponsor to be contract + }); + + it('will return unused gas fee to app-promotion pallete', async () => { + // arrange: Alice deploys Flipper + // arrange: Admin calls appPromotion.sponsorContract(Flipper.address) + + // assert: Bob calls Flipper - expect balances deposit event do not appears for Bob /// Unused gas fee returns to contract + // assert: Bobs balance the same + }); + + it('will failed for non contract address', async () => { + // arrange: web3 creates new address - 0x0 + + // assert: Admin calls appPromotion.sponsorContract(0x0) throws + // assert: Admin calls appPromotion.sponsorContract(Substrate address) throws + }); + + it('will actually sponsor transactions', async () => { + // TODO test it because this is a new way of contract sponsoring + }); +}); + +describe('app-promotion stopSponsoringContract', () => { + before(async function () { + await usingPlaygrounds(async (helper, privateKeyWrapper) => { + if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); + alice = privateKeyWrapper('//Alice'); + bob = privateKeyWrapper('//Bob'); + palletAdmin = privateKeyWrapper('//palletAdmin'); + await helper.balance.transferToSubstrate(alice, palletAdmin.address, 10n * helper.balance.getOneTokenNominal()); + await helper.balance.transferToSubstrate(alice, calculatePalleteAddress('appstake'), 10n * helper.balance.getOneTokenNominal()); + + const promotionStartBlock = await helper.chain.getLatestBlockNumber(); + const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); + await helper.signTransaction(alice, tx); + + const txStart = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.startAppPromotion(promotionStartBlock)); + await helper.signTransaction(alice, txStart); + + nominal = helper.balance.getOneTokenNominal(); + }); + }); + + it('will set contract sponsoring mode as disabled', async () => { + // arrange: Alice deploys Flipper + // arrange: Admin calls appPromotion.sponsorContract(Flipper.address) + + // act: Admin calls appPromotion.stopSponsoringContract(Flipper.address) + // assert: contract sponsoring mode = TODO + + // act: Bob calls Flipper + + // assert: PalleteAddress balance did not change + // assert: Bobs balance less than before /// Bob payed some fee + }); + + it('can not be called by non-admin', async () => { + // arrange: Alice deploys Flipper + // arrange: Admin calls appPromotion.sponsorContract(Flipper.address) + + // assert: Random calls appPromotion.stopSponsoringContract(Flipper.address) throws + // assert: contract sponsor is PallereAddress + }); + + it('will not affect a contract which is not sponsored by pallete', async () => { + // arrange: Alice deploys Flipper + // arrange: Alice sets self sponsoring for Flipper + + // act: Admin calls appPromotion.stopSponsoringContract(Flipper.address) throws + + // assert: contract.sponsoringMode = Self + // assert: contract.sponsor to be contract + }); + + it('will failed for non contract address', async () => { + // arrange: web3 creates new address - 0x0 + + // expect stopSponsoringContract(0x0) throws + }); +}); + +describe('app-promotion rewards', () => { + const DAY = 7200n; + + + before(async function () { + await usingPlaygrounds(async (helper, privateKeyWrapper) => { + if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); + alice = privateKeyWrapper('//Alice'); + bob = privateKeyWrapper('//Bob'); + palletAdmin = privateKeyWrapper('//palletAdmin'); + if (promotionStartBlock == null) { + promotionStartBlock = (await helper.api!.query.parachainSystem.lastRelayChainBlockNumber()).toNumber(); + } + const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); + await helper.signTransaction(alice, tx); + + const txStart = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.startAppPromotion(promotionStartBlock!)); + await helper.signTransaction(alice, txStart); + + nominal = helper.balance.getOneTokenNominal(); + }); + }); + + it('will credit 0.05% for staking period', async () => { + // arrange: bob.stake(10000); + // arrange: bob.stake(20000); + // arrange: waitForRewards(); + + // assert: bob.staked to equal [10005, 20010] + + await usingPlaygrounds(async helper => { + const staker = await createUser(50n * nominal); + await waitForRecalculationBlock(helper.api!); + + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(1n * nominal))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(2n * nominal))).to.be.eventually.fulfilled; + await waitForRelayBlock(helper.api!, 36); + + + expect((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))) + .map(([_, amount]) => amount.toBigInt())) + .to.be.deep.equal([calculateIncome(nominal, 10n), calculateIncome(2n * nominal, 10n)]); + }); + + }); + + it('will not be credited for unstaked (reserved) balance', async () => { + // arrange: bob.stake(10000); + // arrange: bob.unstake(5000); + // arrange: waitForRewards(); + + // assert: bob.staked to equal [5002.5] + await usingPlaygrounds(async helper => { + const staker = await createUser(20n * nominal); + await waitForRecalculationBlock(helper.api!); + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.unstake(5n * nominal))).to.be.eventually.fulfilled; + await waitForRelayBlock(helper.api!, 38); + + expect((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))) + .map(([_, amount]) => amount.toBigInt())) + .to.be.deep.equal([calculateIncome(5n * nominal, 10n)]); + + }); + + }); + + it('will bring compound interest', async () => { + // arrange: bob balance = 30000 + // arrange: bob.stake(10000); + // arrange: bob.stake(10000); + // arrange: waitForRewards(); + + // assert: bob.staked() equal [10005, 10005, 10005] /// 10_000 * 1.0005 + // act: waitForRewards(); + + // assert: bob.staked() equal [10010.0025, 10010.0025, 10010.0025] /// 10_005 * 1.0005 + // act: bob.unstake(10.0025) + // assert: bob.staked() equal [10000, 10010.0025, 10010.0025] /// 10_005 * 1.0005 + + // act: waitForRewards(); + // assert: bob.staked() equal [10005, 10015,00750125, 10015,00750125] /// + await usingPlaygrounds(async helper => { + const staker = await createUser(40n * nominal); + + await waitForRecalculationBlock(helper.api!); + // const foo = await helper.api!.registry.getChainProperties(). + + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.fulfilled; + // await waitNewBlocks(helper.api!, 1); + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.fulfilled; + // await waitNewBlocks(helper.api!, 1); + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.fulfilled; + // console.log(await helper.balance.getSubstrate(staker.address)); + // await waitNewBlocks(helper.api!, 17); + await waitForRelayBlock(helper.api!, 34); + expect((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))) + .map(([_, amount]) => amount.toBigInt())) + .to.be.deep.equal([calculateIncome(10n * nominal, 10n), calculateIncome(10n * nominal, 10n), calculateIncome(10n * nominal, 10n)]); + + // console.log(await getBlockNumber(helper.api!)); + // console.log((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([block, amount]) => [block.toBigInt(), amount.toBigInt()])); + // console.log(`${calculateIncome(10n * nominal, 10n)} || ${calculateIncome(10n * nominal, 10n, 2)}`); + // await waitNewBlocks(helper.api!, 10); + await waitForRelayBlock(helper.api!, 20); + // console.log((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt())); + // console.log(await helper.balance.getSubstrate(staker.address)); + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.unstake(calculateIncome(10n * nominal, 10n, 2) - 10n * nominal))).to.be.eventually.fulfilled; + // console.log(calculateIncome(10n * nominal, 10n, 2)); + // console.log(calculateIncome(10n * nominal, 10n, 3)); + // console.log(calculateIncome(10n * nominal, 10n, 4)); + // console.log(calculateIncome(10n * nominal, 10n, 5)); + expect((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))) + .map(([_, amount]) => amount.toBigInt())) + .to.be.deep.equal([10n * nominal, calculateIncome(10n * nominal, 10n, 2), calculateIncome(10n * nominal, 10n, 2)]); + + // console.log((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt())); + + // console.log(await helper.balance.getSubstrate(staker.address)); + }); + + }); +}); + + +function waitForRecalculationBlock(api: ApiPromise): Promise { + return new Promise(async (resolve, reject) => { + const unsubscribe = await api.query.system.events((events) => { + + events.forEach((record) => { + + const {event, phase} = record; + const types = event.typeDef; + + if (event.section === 'promotion' && event.method === 'StakingRecalculation') { + unsubscribe(); + resolve(); + } + }); + }); + }); +} + +async function waitForRelayBlock(api: ApiPromise, blocks = 1): Promise { + const current_block = (await api.query.parachainSystem.lastRelayChainBlockNumber()).toNumber(); + return new Promise(async (resolve, reject) => { + const unsubscribe = await api.query.parachainSystem.validationData(async (data) => { + // console.log(`${current_block} || ${data.value.relayParentNumber.toNumber()}`); + if (data.value.relayParentNumber.toNumber() - current_block >= blocks) { + unsubscribe(); + resolve(); + } + }); + }); + +} + + +function calculatePalleteAddress(palletId: any) { + const address = stringToU8a(('modl' + palletId).padEnd(32, '\0')); + return encodeAddress(address); +} +function calculateIncome(base: bigint, calcPeriod: bigint, iter = 0): bigint { + const DAY = 7200n; + const ACCURACY = 1_000_000_000n; + const income = base + base * (ACCURACY * (calcPeriod * 5n) / (10_000n * DAY)) / ACCURACY ; + + if (iter > 1) { + return calculateIncome(income, calcPeriod, iter - 1); + } else return income; +} + async function createUser(amount?: bigint) { - return await usingPlaygrounds(async (helper, privateKeyWrapper) => { - const user: IKeyringPair = privateKeyWrapper(`//Alice+${(new Date()).getTime()}`); + return await usingPlaygrounds(async helper => { + const user: IKeyringPair = helper.util.fromSeed(mnemonicGenerate()); await helper.balance.transferToSubstrate(alice, user.address, amount ? amount : 10n * helper.balance.getOneTokenNominal()); return user; }); diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index fbcdedd375..1a5253aeb8 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -8,7 +8,7 @@ import '@polkadot/api-base/types/consts'; import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types'; import type { Option, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { Codec } from '@polkadot/types-codec/types'; -import type { Permill } from '@polkadot/types/interfaces/runtime'; +import type { Perbill, Permill } from '@polkadot/types/interfaces/runtime'; import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup'; export type __AugmentedConst = AugmentedConst; @@ -66,6 +66,30 @@ declare module '@polkadot/api-base/types/consts' { **/ [key: string]: Codec; }; + promotion: { + /** + * In chain blocks. + **/ + day: u32 & AugmentedConst; + intervalIncome: Perbill & AugmentedConst; + nominal: u128 & AugmentedConst; + /** + * The app's pallet id, used for deriving its sovereign account ID. + **/ + palletId: FrameSupportPalletId & AugmentedConst; + /** + * In chain blocks. + **/ + pendingInterval: u32 & AugmentedConst; + /** + * In relay blocks. + **/ + recalculationInterval: u32 & AugmentedConst; + /** + * Generic const + **/ + [key: string]: Codec; + }; scheduler: { /** * The maximum weight that may be scheduled per block for any dispatchables of less diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 4148088679..b8ed34b991 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -425,6 +425,23 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; + promotion: { + AdminNotSet: AugmentedError; + AlreadySponsored: AugmentedError; + InvalidArgument: AugmentedError; + /** + * No permission to perform action + **/ + NoPermission: AugmentedError; + /** + * Insufficient funds to perform an action + **/ + NotSufficientFounds: AugmentedError; + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; refungible: { /** * Not Refungible item data used to mint in Refungible collection. diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index c812cba6f9..4e07c80484 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -360,6 +360,13 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; + promotion: { + StakingRecalculation: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; rmrkCore: { CollectionCreated: AugmentedEvent; CollectionDestroyed: AugmentedEvent; diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index 9349a853bd..ae1d66b218 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -363,9 +363,11 @@ declare module '@polkadot/api-base/types/submittable' { [key: string]: SubmittableExtrinsicFunction; }; promotion: { - setAdminAddress: AugmentedSubmittable<(admin: AccountId32 | string | Uint8Array) => SubmittableExtrinsic, [AccountId32]>; + setAdminAddress: AugmentedSubmittable<(admin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic, [PalletEvmAccountBasicCrossAccountIdRepr]>; + sponsorCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; stake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; - startAppPromotion: AugmentedSubmittable<(promotionStartRelayBlock: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; + startAppPromotion: AugmentedSubmittable<(promotionStartRelayBlock: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; + stopSponsorignCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; unstake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; /** * Generic tx diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index e28267c02f..e96fa69378 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; @@ -805,6 +805,8 @@ declare module '@polkadot/types/types/registry' { PageCounter: PageCounter; PageIndexData: PageIndexData; PalletAppPromotionCall: PalletAppPromotionCall; + PalletAppPromotionError: PalletAppPromotionError; + PalletAppPromotionEvent: PalletAppPromotionEvent; PalletBalancesAccountData: PalletBalancesAccountData; PalletBalancesBalanceLock: PalletBalancesBalanceLock; PalletBalancesCall: PalletBalancesCall; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 9783b78054..2d357a9d52 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -810,11 +810,11 @@ export interface OrmlVestingVestingSchedule extends Struct { export interface PalletAppPromotionCall extends Enum { readonly isSetAdminAddress: boolean; readonly asSetAdminAddress: { - readonly admin: AccountId32; + readonly admin: PalletEvmAccountBasicCrossAccountIdRepr; } & Struct; readonly isStartAppPromotion: boolean; readonly asStartAppPromotion: { - readonly promotionStartRelayBlock: u32; + readonly promotionStartRelayBlock: Option; } & Struct; readonly isStake: boolean; readonly asStake: { @@ -824,7 +824,32 @@ export interface PalletAppPromotionCall extends Enum { readonly asUnstake: { readonly amount: u128; } & Struct; - readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake'; + readonly isSponsorCollection: boolean; + readonly asSponsorCollection: { + readonly collectionId: u32; + } & Struct; + readonly isStopSponsorignCollection: boolean; + readonly asStopSponsorignCollection: { + readonly collectionId: u32; + } & Struct; + readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsorignCollection'; +} + +/** @name PalletAppPromotionError */ +export interface PalletAppPromotionError extends Enum { + readonly isAdminNotSet: boolean; + readonly isNoPermission: boolean; + readonly isNotSufficientFounds: boolean; + readonly isInvalidArgument: boolean; + readonly isAlreadySponsored: boolean; + readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'InvalidArgument' | 'AlreadySponsored'; +} + +/** @name PalletAppPromotionEvent */ +export interface PalletAppPromotionEvent extends Enum { + readonly isStakingRecalculation: boolean; + readonly asStakingRecalculation: ITuple<[u128, u128]>; + readonly type: 'StakingRecalculation'; } /** @name PalletBalancesAccountData */ diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 28bcbd1dfb..4e8621a586 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -1057,7 +1057,15 @@ export default { } }, /** - * Lookup103: pallet_evm::pallet::Event + * Lookup103: pallet_app_promotion::pallet::Event + **/ + PalletAppPromotionEvent: { + _enum: { + StakingRecalculation: '(u128,u128)' + } + }, + /** + * Lookup104: pallet_evm::pallet::Event **/ PalletEvmEvent: { _enum: { @@ -1071,7 +1079,7 @@ export default { } }, /** - * Lookup104: ethereum::log::Log + * Lookup105: ethereum::log::Log **/ EthereumLog: { address: 'H160', @@ -1079,7 +1087,7 @@ export default { data: 'Bytes' }, /** - * Lookup108: pallet_ethereum::pallet::Event + * Lookup109: pallet_ethereum::pallet::Event **/ PalletEthereumEvent: { _enum: { @@ -1087,7 +1095,7 @@ export default { } }, /** - * Lookup109: evm_core::error::ExitReason + * Lookup110: evm_core::error::ExitReason **/ EvmCoreErrorExitReason: { _enum: { @@ -1098,13 +1106,13 @@ export default { } }, /** - * Lookup110: evm_core::error::ExitSucceed + * Lookup111: evm_core::error::ExitSucceed **/ EvmCoreErrorExitSucceed: { _enum: ['Stopped', 'Returned', 'Suicided'] }, /** - * Lookup111: evm_core::error::ExitError + * Lookup112: evm_core::error::ExitError **/ EvmCoreErrorExitError: { _enum: { @@ -1126,13 +1134,13 @@ export default { } }, /** - * Lookup114: evm_core::error::ExitRevert + * Lookup115: evm_core::error::ExitRevert **/ EvmCoreErrorExitRevert: { _enum: ['Reverted'] }, /** - * Lookup115: evm_core::error::ExitFatal + * Lookup116: evm_core::error::ExitFatal **/ EvmCoreErrorExitFatal: { _enum: { @@ -1143,7 +1151,7 @@ export default { } }, /** - * Lookup116: frame_system::Phase + * Lookup117: frame_system::Phase **/ FrameSystemPhase: { _enum: { @@ -1153,14 +1161,14 @@ export default { } }, /** - * Lookup118: frame_system::LastRuntimeUpgradeInfo + * Lookup119: frame_system::LastRuntimeUpgradeInfo **/ FrameSystemLastRuntimeUpgradeInfo: { specVersion: 'Compact', specName: 'Text' }, /** - * Lookup119: frame_system::pallet::Call + * Lookup120: frame_system::pallet::Call **/ FrameSystemCall: { _enum: { @@ -1198,7 +1206,7 @@ export default { } }, /** - * Lookup124: frame_system::limits::BlockWeights + * Lookup125: frame_system::limits::BlockWeights **/ FrameSystemLimitsBlockWeights: { baseBlock: 'u64', @@ -1206,7 +1214,7 @@ export default { perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass' }, /** - * Lookup125: frame_support::weights::PerDispatchClass + * Lookup126: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassWeightsPerClass: { normal: 'FrameSystemLimitsWeightsPerClass', @@ -1214,7 +1222,7 @@ export default { mandatory: 'FrameSystemLimitsWeightsPerClass' }, /** - * Lookup126: frame_system::limits::WeightsPerClass + * Lookup127: frame_system::limits::WeightsPerClass **/ FrameSystemLimitsWeightsPerClass: { baseExtrinsic: 'u64', @@ -1223,13 +1231,13 @@ export default { reserved: 'Option' }, /** - * Lookup128: frame_system::limits::BlockLength + * Lookup129: frame_system::limits::BlockLength **/ FrameSystemLimitsBlockLength: { max: 'FrameSupportWeightsPerDispatchClassU32' }, /** - * Lookup129: frame_support::weights::PerDispatchClass + * Lookup130: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassU32: { normal: 'u32', @@ -1237,14 +1245,14 @@ export default { mandatory: 'u32' }, /** - * Lookup130: frame_support::weights::RuntimeDbWeight + * Lookup131: frame_support::weights::RuntimeDbWeight **/ FrameSupportWeightsRuntimeDbWeight: { read: 'u64', write: 'u64' }, /** - * Lookup131: sp_version::RuntimeVersion + * Lookup132: sp_version::RuntimeVersion **/ SpVersionRuntimeVersion: { specName: 'Text', @@ -1257,13 +1265,13 @@ export default { stateVersion: 'u8' }, /** - * Lookup136: frame_system::pallet::Error + * Lookup137: frame_system::pallet::Error **/ FrameSystemError: { _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] }, /** - * Lookup137: polkadot_primitives::v2::PersistedValidationData + * Lookup138: polkadot_primitives::v2::PersistedValidationData **/ PolkadotPrimitivesV2PersistedValidationData: { parentHead: 'Bytes', @@ -1272,19 +1280,19 @@ export default { maxPovSize: 'u32' }, /** - * Lookup140: polkadot_primitives::v2::UpgradeRestriction + * Lookup141: polkadot_primitives::v2::UpgradeRestriction **/ PolkadotPrimitivesV2UpgradeRestriction: { _enum: ['Present'] }, /** - * Lookup141: sp_trie::storage_proof::StorageProof + * Lookup142: sp_trie::storage_proof::StorageProof **/ SpTrieStorageProof: { trieNodes: 'BTreeSet' }, /** - * Lookup143: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot + * Lookup144: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot **/ CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: { dmqMqcHead: 'H256', @@ -1293,7 +1301,7 @@ export default { egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>' }, /** - * Lookup146: polkadot_primitives::v2::AbridgedHrmpChannel + * Lookup147: polkadot_primitives::v2::AbridgedHrmpChannel **/ PolkadotPrimitivesV2AbridgedHrmpChannel: { maxCapacity: 'u32', @@ -1304,7 +1312,7 @@ export default { mqcHead: 'Option' }, /** - * Lookup147: polkadot_primitives::v2::AbridgedHostConfiguration + * Lookup148: polkadot_primitives::v2::AbridgedHostConfiguration **/ PolkadotPrimitivesV2AbridgedHostConfiguration: { maxCodeSize: 'u32', @@ -1318,14 +1326,14 @@ export default { validationUpgradeDelay: 'u32' }, /** - * Lookup153: polkadot_core_primitives::OutboundHrmpMessage + * Lookup154: polkadot_core_primitives::OutboundHrmpMessage **/ PolkadotCorePrimitivesOutboundHrmpMessage: { recipient: 'u32', data: 'Bytes' }, /** - * Lookup154: cumulus_pallet_parachain_system::pallet::Call + * Lookup155: cumulus_pallet_parachain_system::pallet::Call **/ CumulusPalletParachainSystemCall: { _enum: { @@ -1344,7 +1352,7 @@ export default { } }, /** - * Lookup155: cumulus_primitives_parachain_inherent::ParachainInherentData + * Lookup156: cumulus_primitives_parachain_inherent::ParachainInherentData **/ CumulusPrimitivesParachainInherentParachainInherentData: { validationData: 'PolkadotPrimitivesV2PersistedValidationData', @@ -1353,27 +1361,27 @@ export default { horizontalMessages: 'BTreeMap>' }, /** - * Lookup157: polkadot_core_primitives::InboundDownwardMessage + * Lookup158: polkadot_core_primitives::InboundDownwardMessage **/ PolkadotCorePrimitivesInboundDownwardMessage: { sentAt: 'u32', msg: 'Bytes' }, /** - * Lookup160: polkadot_core_primitives::InboundHrmpMessage + * Lookup161: polkadot_core_primitives::InboundHrmpMessage **/ PolkadotCorePrimitivesInboundHrmpMessage: { sentAt: 'u32', data: 'Bytes' }, /** - * Lookup163: cumulus_pallet_parachain_system::pallet::Error + * Lookup164: cumulus_pallet_parachain_system::pallet::Error **/ CumulusPalletParachainSystemError: { _enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized'] }, /** - * Lookup165: pallet_balances::BalanceLock + * Lookup166: pallet_balances::BalanceLock **/ PalletBalancesBalanceLock: { id: '[u8;8]', @@ -1381,26 +1389,26 @@ export default { reasons: 'PalletBalancesReasons' }, /** - * Lookup166: pallet_balances::Reasons + * Lookup167: pallet_balances::Reasons **/ PalletBalancesReasons: { _enum: ['Fee', 'Misc', 'All'] }, /** - * Lookup169: pallet_balances::ReserveData + * Lookup170: pallet_balances::ReserveData **/ PalletBalancesReserveData: { id: '[u8;16]', amount: 'u128' }, /** - * Lookup171: pallet_balances::Releases + * Lookup172: pallet_balances::Releases **/ PalletBalancesReleases: { _enum: ['V1_0_0', 'V2_0_0'] }, /** - * Lookup172: pallet_balances::pallet::Call + * Lookup173: pallet_balances::pallet::Call **/ PalletBalancesCall: { _enum: { @@ -1433,13 +1441,13 @@ export default { } }, /** - * Lookup175: pallet_balances::pallet::Error + * Lookup176: pallet_balances::pallet::Error **/ PalletBalancesError: { _enum: ['VestingBalance', 'LiquidityRestrictions', 'InsufficientBalance', 'ExistentialDeposit', 'KeepAlive', 'ExistingVestingSchedule', 'DeadAccount', 'TooManyReserves'] }, /** - * Lookup177: pallet_timestamp::pallet::Call + * Lookup178: pallet_timestamp::pallet::Call **/ PalletTimestampCall: { _enum: { @@ -1449,13 +1457,13 @@ export default { } }, /** - * Lookup179: pallet_transaction_payment::Releases + * Lookup180: pallet_transaction_payment::Releases **/ PalletTransactionPaymentReleases: { _enum: ['V1Ancient', 'V2'] }, /** - * Lookup180: pallet_treasury::Proposal + * Lookup181: pallet_treasury::Proposal **/ PalletTreasuryProposal: { proposer: 'AccountId32', @@ -1464,7 +1472,7 @@ export default { bond: 'u128' }, /** - * Lookup183: pallet_treasury::pallet::Call + * Lookup184: pallet_treasury::pallet::Call **/ PalletTreasuryCall: { _enum: { @@ -1488,17 +1496,17 @@ export default { } }, /** - * Lookup186: frame_support::PalletId + * Lookup187: frame_support::PalletId **/ FrameSupportPalletId: '[u8;8]', /** - * Lookup187: pallet_treasury::pallet::Error + * Lookup188: pallet_treasury::pallet::Error **/ PalletTreasuryError: { _enum: ['InsufficientProposersBalance', 'InvalidIndex', 'TooManyApprovals', 'InsufficientPermission', 'ProposalNotApproved'] }, /** - * Lookup188: pallet_sudo::pallet::Call + * Lookup189: pallet_sudo::pallet::Call **/ PalletSudoCall: { _enum: { @@ -1522,7 +1530,7 @@ export default { } }, /** - * Lookup190: orml_vesting::module::Call + * Lookup191: orml_vesting::module::Call **/ OrmlVestingModuleCall: { _enum: { @@ -1541,7 +1549,7 @@ export default { } }, /** - * Lookup192: cumulus_pallet_xcmp_queue::pallet::Call + * Lookup193: cumulus_pallet_xcmp_queue::pallet::Call **/ CumulusPalletXcmpQueueCall: { _enum: { @@ -1590,7 +1598,7 @@ export default { } }, /** - * Lookup193: pallet_xcm::pallet::Call + * Lookup194: pallet_xcm::pallet::Call **/ PalletXcmCall: { _enum: { @@ -1644,7 +1652,7 @@ export default { } }, /** - * Lookup194: xcm::VersionedXcm + * Lookup195: xcm::VersionedXcm **/ XcmVersionedXcm: { _enum: { @@ -1654,7 +1662,7 @@ export default { } }, /** - * Lookup195: xcm::v0::Xcm + * Lookup196: xcm::v0::Xcm **/ XcmV0Xcm: { _enum: { @@ -1708,7 +1716,7 @@ export default { } }, /** - * Lookup197: xcm::v0::order::Order + * Lookup198: xcm::v0::order::Order **/ XcmV0Order: { _enum: { @@ -1751,7 +1759,7 @@ export default { } }, /** - * Lookup199: xcm::v0::Response + * Lookup200: xcm::v0::Response **/ XcmV0Response: { _enum: { @@ -1759,7 +1767,7 @@ export default { } }, /** - * Lookup200: xcm::v1::Xcm + * Lookup201: xcm::v1::Xcm **/ XcmV1Xcm: { _enum: { @@ -1818,7 +1826,7 @@ export default { } }, /** - * Lookup202: xcm::v1::order::Order + * Lookup203: xcm::v1::order::Order **/ XcmV1Order: { _enum: { @@ -1863,7 +1871,7 @@ export default { } }, /** - * Lookup204: xcm::v1::Response + * Lookup205: xcm::v1::Response **/ XcmV1Response: { _enum: { @@ -1872,11 +1880,11 @@ export default { } }, /** - * Lookup218: cumulus_pallet_xcm::pallet::Call + * Lookup219: cumulus_pallet_xcm::pallet::Call **/ CumulusPalletXcmCall: 'Null', /** - * Lookup219: cumulus_pallet_dmp_queue::pallet::Call + * Lookup220: cumulus_pallet_dmp_queue::pallet::Call **/ CumulusPalletDmpQueueCall: { _enum: { @@ -1887,7 +1895,7 @@ export default { } }, /** - * Lookup220: pallet_inflation::pallet::Call + * Lookup221: pallet_inflation::pallet::Call **/ PalletInflationCall: { _enum: { @@ -1897,7 +1905,7 @@ export default { } }, /** - * Lookup221: pallet_unique::Call + * Lookup222: pallet_unique::Call **/ PalletUniqueCall: { _enum: { @@ -2029,7 +2037,7 @@ export default { } }, /** - * Lookup226: up_data_structs::CollectionMode + * Lookup227: up_data_structs::CollectionMode **/ UpDataStructsCollectionMode: { _enum: { @@ -2039,7 +2047,7 @@ export default { } }, /** - * Lookup227: up_data_structs::CreateCollectionData + * Lookup228: up_data_structs::CreateCollectionData **/ UpDataStructsCreateCollectionData: { mode: 'UpDataStructsCollectionMode', @@ -2054,13 +2062,13 @@ export default { properties: 'Vec' }, /** - * Lookup229: up_data_structs::AccessMode + * Lookup230: up_data_structs::AccessMode **/ UpDataStructsAccessMode: { _enum: ['Normal', 'AllowList'] }, /** - * Lookup231: up_data_structs::CollectionLimits + * Lookup232: up_data_structs::CollectionLimits **/ UpDataStructsCollectionLimits: { accountTokenOwnershipLimit: 'Option', @@ -2074,7 +2082,7 @@ export default { transfersEnabled: 'Option' }, /** - * Lookup233: up_data_structs::SponsoringRateLimit + * Lookup234: up_data_structs::SponsoringRateLimit **/ UpDataStructsSponsoringRateLimit: { _enum: { @@ -2083,7 +2091,7 @@ export default { } }, /** - * Lookup236: up_data_structs::CollectionPermissions + * Lookup237: up_data_structs::CollectionPermissions **/ UpDataStructsCollectionPermissions: { access: 'Option', @@ -2091,7 +2099,7 @@ export default { nesting: 'Option' }, /** - * Lookup238: up_data_structs::NestingPermissions + * Lookup239: up_data_structs::NestingPermissions **/ UpDataStructsNestingPermissions: { tokenOwner: 'bool', @@ -2099,18 +2107,18 @@ export default { restricted: 'Option' }, /** - * Lookup240: up_data_structs::OwnerRestrictedSet + * Lookup241: up_data_structs::OwnerRestrictedSet **/ UpDataStructsOwnerRestrictedSet: 'BTreeSet', /** - * Lookup245: up_data_structs::PropertyKeyPermission + * Lookup246: up_data_structs::PropertyKeyPermission **/ UpDataStructsPropertyKeyPermission: { key: 'Bytes', permission: 'UpDataStructsPropertyPermission' }, /** - * Lookup246: up_data_structs::PropertyPermission + * Lookup247: up_data_structs::PropertyPermission **/ UpDataStructsPropertyPermission: { mutable: 'bool', @@ -2118,14 +2126,14 @@ export default { tokenOwner: 'bool' }, /** - * Lookup249: up_data_structs::Property + * Lookup250: up_data_structs::Property **/ UpDataStructsProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup252: up_data_structs::CreateItemData + * Lookup253: up_data_structs::CreateItemData **/ UpDataStructsCreateItemData: { _enum: { @@ -2135,26 +2143,26 @@ export default { } }, /** - * Lookup253: up_data_structs::CreateNftData + * Lookup254: up_data_structs::CreateNftData **/ UpDataStructsCreateNftData: { properties: 'Vec' }, /** - * Lookup254: up_data_structs::CreateFungibleData + * Lookup255: up_data_structs::CreateFungibleData **/ UpDataStructsCreateFungibleData: { value: 'u128' }, /** - * Lookup255: up_data_structs::CreateReFungibleData + * Lookup256: up_data_structs::CreateReFungibleData **/ UpDataStructsCreateReFungibleData: { pieces: 'u128', properties: 'Vec' }, /** - * Lookup258: up_data_structs::CreateItemExData> + * Lookup259: up_data_structs::CreateItemExData> **/ UpDataStructsCreateItemExData: { _enum: { @@ -2165,14 +2173,14 @@ export default { } }, /** - * Lookup260: up_data_structs::CreateNftExData> + * Lookup261: up_data_structs::CreateNftExData> **/ UpDataStructsCreateNftExData: { properties: 'Vec', owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup267: up_data_structs::CreateRefungibleExSingleOwner> + * Lookup268: up_data_structs::CreateRefungibleExSingleOwner> **/ UpDataStructsCreateRefungibleExSingleOwner: { user: 'PalletEvmAccountBasicCrossAccountIdRepr', @@ -2180,14 +2188,14 @@ export default { properties: 'Vec' }, /** - * Lookup269: up_data_structs::CreateRefungibleExMultipleOwners> + * Lookup270: up_data_structs::CreateRefungibleExMultipleOwners> **/ UpDataStructsCreateRefungibleExMultipleOwners: { users: 'BTreeMap', properties: 'Vec' }, /** - * Lookup270: pallet_unique_scheduler::pallet::Call + * Lookup271: pallet_unique_scheduler::pallet::Call **/ PalletUniqueSchedulerCall: { _enum: { @@ -2211,7 +2219,7 @@ export default { } }, /** - * Lookup272: frame_support::traits::schedule::MaybeHashed + * Lookup273: frame_support::traits::schedule::MaybeHashed **/ FrameSupportScheduleMaybeHashed: { _enum: { @@ -2220,7 +2228,7 @@ export default { } }, /** - * Lookup273: pallet_configuration::pallet::Call + * Lookup274: pallet_configuration::pallet::Call **/ PalletConfigurationCall: { _enum: { @@ -2233,15 +2241,15 @@ export default { } }, /** - * Lookup274: pallet_template_transaction_payment::Call + * Lookup275: pallet_template_transaction_payment::Call **/ PalletTemplateTransactionPaymentCall: 'Null', /** - * Lookup275: pallet_structure::pallet::Call + * Lookup276: pallet_structure::pallet::Call **/ PalletStructureCall: 'Null', /** - * Lookup276: pallet_rmrk_core::pallet::Call + * Lookup277: pallet_rmrk_core::pallet::Call **/ PalletRmrkCoreCall: { _enum: { @@ -2332,7 +2340,7 @@ export default { } }, /** - * Lookup282: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup283: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceTypes: { _enum: { @@ -2342,7 +2350,7 @@ export default { } }, /** - * Lookup284: rmrk_traits::resource::BasicResource> + * Lookup285: rmrk_traits::resource::BasicResource> **/ RmrkTraitsResourceBasicResource: { src: 'Option', @@ -2351,7 +2359,7 @@ export default { thumb: 'Option' }, /** - * Lookup286: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup287: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceComposableResource: { parts: 'Vec', @@ -2362,7 +2370,7 @@ export default { thumb: 'Option' }, /** - * Lookup287: rmrk_traits::resource::SlotResource> + * Lookup288: rmrk_traits::resource::SlotResource> **/ RmrkTraitsResourceSlotResource: { base: 'u32', @@ -2373,7 +2381,7 @@ export default { thumb: 'Option' }, /** - * Lookup290: pallet_rmrk_equip::pallet::Call + * Lookup291: pallet_rmrk_equip::pallet::Call **/ PalletRmrkEquipCall: { _enum: { @@ -2394,7 +2402,7 @@ export default { } }, /** - * Lookup293: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup294: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPartPartType: { _enum: { @@ -2403,7 +2411,7 @@ export default { } }, /** - * Lookup295: rmrk_traits::part::FixedPart> + * Lookup296: rmrk_traits::part::FixedPart> **/ RmrkTraitsPartFixedPart: { id: 'u32', @@ -2411,7 +2419,7 @@ export default { src: 'Bytes' }, /** - * Lookup296: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup297: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPartSlotPart: { id: 'u32', @@ -2420,7 +2428,7 @@ export default { z: 'u32' }, /** - * Lookup297: rmrk_traits::part::EquippableList> + * Lookup298: rmrk_traits::part::EquippableList> **/ RmrkTraitsPartEquippableList: { _enum: { @@ -2430,7 +2438,7 @@ export default { } }, /** - * Lookup299: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> + * Lookup300: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> **/ RmrkTraitsTheme: { name: 'Bytes', @@ -2438,33 +2446,39 @@ export default { inherit: 'bool' }, /** - * Lookup301: rmrk_traits::theme::ThemeProperty> + * Lookup302: rmrk_traits::theme::ThemeProperty> **/ RmrkTraitsThemeThemeProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup303: pallet_app_promotion::pallet::Call + * Lookup304: pallet_app_promotion::pallet::Call **/ PalletAppPromotionCall: { _enum: { set_admin_address: { - admin: 'AccountId32', + admin: 'PalletEvmAccountBasicCrossAccountIdRepr', }, start_app_promotion: { - promotionStartRelayBlock: 'u32', + promotionStartRelayBlock: 'Option', }, stake: { amount: 'u128', }, unstake: { - amount: 'u128' + amount: 'u128', + }, + sponsor_collection: { + collectionId: 'u32', + }, + stop_sponsorign_collection: { + collectionId: 'u32' } } }, /** - * Lookup304: pallet_evm::pallet::Call + * Lookup305: pallet_evm::pallet::Call **/ PalletEvmCall: { _enum: { @@ -2507,7 +2521,7 @@ export default { } }, /** - * Lookup308: pallet_ethereum::pallet::Call + * Lookup309: pallet_ethereum::pallet::Call **/ PalletEthereumCall: { _enum: { @@ -2517,7 +2531,7 @@ export default { } }, /** - * Lookup309: ethereum::transaction::TransactionV2 + * Lookup310: ethereum::transaction::TransactionV2 **/ EthereumTransactionTransactionV2: { _enum: { @@ -2527,7 +2541,7 @@ export default { } }, /** - * Lookup310: ethereum::transaction::LegacyTransaction + * Lookup311: ethereum::transaction::LegacyTransaction **/ EthereumTransactionLegacyTransaction: { nonce: 'U256', @@ -2539,7 +2553,7 @@ export default { signature: 'EthereumTransactionTransactionSignature' }, /** - * Lookup311: ethereum::transaction::TransactionAction + * Lookup312: ethereum::transaction::TransactionAction **/ EthereumTransactionTransactionAction: { _enum: { @@ -2548,7 +2562,7 @@ export default { } }, /** - * Lookup312: ethereum::transaction::TransactionSignature + * Lookup313: ethereum::transaction::TransactionSignature **/ EthereumTransactionTransactionSignature: { v: 'u64', @@ -2556,7 +2570,7 @@ export default { s: 'H256' }, /** - * Lookup314: ethereum::transaction::EIP2930Transaction + * Lookup315: ethereum::transaction::EIP2930Transaction **/ EthereumTransactionEip2930Transaction: { chainId: 'u64', @@ -2572,14 +2586,14 @@ export default { s: 'H256' }, /** - * Lookup316: ethereum::transaction::AccessListItem + * Lookup317: ethereum::transaction::AccessListItem **/ EthereumTransactionAccessListItem: { address: 'H160', storageKeys: 'Vec' }, /** - * Lookup317: ethereum::transaction::EIP1559Transaction + * Lookup318: ethereum::transaction::EIP1559Transaction **/ EthereumTransactionEip1559Transaction: { chainId: 'u64', @@ -2596,7 +2610,7 @@ export default { s: 'H256' }, /** - * Lookup318: pallet_evm_migration::pallet::Call + * Lookup319: pallet_evm_migration::pallet::Call **/ PalletEvmMigrationCall: { _enum: { @@ -2614,19 +2628,19 @@ export default { } }, /** - * Lookup321: pallet_sudo::pallet::Error + * Lookup322: pallet_sudo::pallet::Error **/ PalletSudoError: { _enum: ['RequireSudo'] }, /** - * Lookup323: orml_vesting::module::Error + * Lookup324: orml_vesting::module::Error **/ OrmlVestingModuleError: { _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded'] }, /** - * Lookup325: cumulus_pallet_xcmp_queue::InboundChannelDetails + * Lookup326: cumulus_pallet_xcmp_queue::InboundChannelDetails **/ CumulusPalletXcmpQueueInboundChannelDetails: { sender: 'u32', @@ -2634,19 +2648,19 @@ export default { messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>' }, /** - * Lookup326: cumulus_pallet_xcmp_queue::InboundState + * Lookup327: cumulus_pallet_xcmp_queue::InboundState **/ CumulusPalletXcmpQueueInboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup329: polkadot_parachain::primitives::XcmpMessageFormat + * Lookup330: polkadot_parachain::primitives::XcmpMessageFormat **/ PolkadotParachainPrimitivesXcmpMessageFormat: { _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals'] }, /** - * Lookup332: cumulus_pallet_xcmp_queue::OutboundChannelDetails + * Lookup333: cumulus_pallet_xcmp_queue::OutboundChannelDetails **/ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: 'u32', @@ -2656,13 +2670,13 @@ export default { lastIndex: 'u16' }, /** - * Lookup333: cumulus_pallet_xcmp_queue::OutboundState + * Lookup334: cumulus_pallet_xcmp_queue::OutboundState **/ CumulusPalletXcmpQueueOutboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup335: cumulus_pallet_xcmp_queue::QueueConfigData + * Lookup336: cumulus_pallet_xcmp_queue::QueueConfigData **/ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: 'u32', @@ -2673,29 +2687,29 @@ export default { xcmpMaxIndividualWeight: 'u64' }, /** - * Lookup337: cumulus_pallet_xcmp_queue::pallet::Error + * Lookup338: cumulus_pallet_xcmp_queue::pallet::Error **/ CumulusPalletXcmpQueueError: { _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit'] }, /** - * Lookup338: pallet_xcm::pallet::Error + * Lookup339: pallet_xcm::pallet::Error **/ PalletXcmError: { _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed'] }, /** - * Lookup339: cumulus_pallet_xcm::pallet::Error + * Lookup340: cumulus_pallet_xcm::pallet::Error **/ CumulusPalletXcmError: 'Null', /** - * Lookup340: cumulus_pallet_dmp_queue::ConfigData + * Lookup341: cumulus_pallet_dmp_queue::ConfigData **/ CumulusPalletDmpQueueConfigData: { maxIndividual: 'u64' }, /** - * Lookup341: cumulus_pallet_dmp_queue::PageIndexData + * Lookup342: cumulus_pallet_dmp_queue::PageIndexData **/ CumulusPalletDmpQueuePageIndexData: { beginUsed: 'u32', @@ -2703,19 +2717,19 @@ export default { overweightCount: 'u64' }, /** - * Lookup344: cumulus_pallet_dmp_queue::pallet::Error + * Lookup345: cumulus_pallet_dmp_queue::pallet::Error **/ CumulusPalletDmpQueueError: { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup348: pallet_unique::Error + * Lookup349: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup351: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> + * Lookup352: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> **/ PalletUniqueSchedulerScheduledV3: { maybeId: 'Option<[u8;16]>', @@ -2725,7 +2739,7 @@ export default { origin: 'OpalRuntimeOriginCaller' }, /** - * Lookup352: opal_runtime::OriginCaller + * Lookup353: opal_runtime::OriginCaller **/ OpalRuntimeOriginCaller: { _enum: { @@ -2834,7 +2848,7 @@ export default { } }, /** - * Lookup353: frame_support::dispatch::RawOrigin + * Lookup354: frame_support::dispatch::RawOrigin **/ FrameSupportDispatchRawOrigin: { _enum: { @@ -2844,7 +2858,7 @@ export default { } }, /** - * Lookup354: pallet_xcm::pallet::Origin + * Lookup355: pallet_xcm::pallet::Origin **/ PalletXcmOrigin: { _enum: { @@ -2853,7 +2867,7 @@ export default { } }, /** - * Lookup355: cumulus_pallet_xcm::pallet::Origin + * Lookup356: cumulus_pallet_xcm::pallet::Origin **/ CumulusPalletXcmOrigin: { _enum: { @@ -2862,7 +2876,7 @@ export default { } }, /** - * Lookup356: pallet_ethereum::RawOrigin + * Lookup357: pallet_ethereum::RawOrigin **/ PalletEthereumRawOrigin: { _enum: { @@ -2870,17 +2884,17 @@ export default { } }, /** - * Lookup357: sp_core::Void + * Lookup358: sp_core::Void **/ SpCoreVoid: 'Null', /** - * Lookup358: pallet_unique_scheduler::pallet::Error + * Lookup359: pallet_unique_scheduler::pallet::Error **/ PalletUniqueSchedulerError: { _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] }, /** - * Lookup359: up_data_structs::Collection + * Lookup360: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -2894,7 +2908,7 @@ export default { externalCollection: 'bool' }, /** - * Lookup360: up_data_structs::SponsorshipState + * Lookup361: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipState: { _enum: { @@ -2904,7 +2918,7 @@ export default { } }, /** - * Lookup361: up_data_structs::Properties + * Lookup362: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -2912,15 +2926,15 @@ export default { spaceLimit: 'u32' }, /** - * Lookup362: up_data_structs::PropertiesMap> + * Lookup363: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** - * Lookup367: up_data_structs::PropertiesMap + * Lookup368: up_data_structs::PropertiesMap **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup374: up_data_structs::CollectionStats + * Lookup375: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -2928,18 +2942,18 @@ export default { alive: 'u32' }, /** - * Lookup375: up_data_structs::TokenChild + * Lookup376: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup376: PhantomType::up_data_structs + * Lookup377: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup378: up_data_structs::TokenData> + * Lookup379: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -2947,7 +2961,7 @@ export default { pieces: 'u128' }, /** - * Lookup380: up_data_structs::RpcCollection + * Lookup381: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -2963,7 +2977,7 @@ export default { readOnly: 'bool' }, /** - * Lookup381: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup382: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -2973,7 +2987,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup382: rmrk_traits::nft::NftInfo> + * Lookup383: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -2983,14 +2997,14 @@ export default { pending: 'bool' }, /** - * Lookup384: rmrk_traits::nft::RoyaltyInfo + * Lookup385: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup385: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup386: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -2999,14 +3013,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup386: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup387: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup387: rmrk_traits::base::BaseInfo> + * Lookup388: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -3014,80 +3028,86 @@ export default { symbol: 'Bytes' }, /** - * Lookup388: rmrk_traits::nft::NftChild + * Lookup389: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup390: pallet_common::pallet::Error + * Lookup391: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup392: pallet_fungible::pallet::Error + * Lookup393: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup393: pallet_refungible::ItemData + * Lookup394: pallet_refungible::ItemData **/ PalletRefungibleItemData: { constData: 'Bytes' }, /** - * Lookup398: pallet_refungible::pallet::Error + * Lookup399: pallet_refungible::pallet::Error **/ PalletRefungibleError: { _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup399: pallet_nonfungible::ItemData> + * Lookup400: pallet_nonfungible::ItemData> **/ PalletNonfungibleItemData: { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup401: up_data_structs::PropertyScope + * Lookup402: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { _enum: ['None', 'Rmrk', 'Eth'] }, /** - * Lookup403: pallet_nonfungible::pallet::Error + * Lookup404: pallet_nonfungible::pallet::Error **/ PalletNonfungibleError: { _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup404: pallet_structure::pallet::Error + * Lookup405: pallet_structure::pallet::Error **/ PalletStructureError: { _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup405: pallet_rmrk_core::pallet::Error + * Lookup406: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** - * Lookup407: pallet_rmrk_equip::pallet::Error + * Lookup408: pallet_rmrk_equip::pallet::Error **/ PalletRmrkEquipError: { _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] }, /** - * Lookup411: pallet_evm::pallet::Error + * Lookup410: pallet_app_promotion::pallet::Error + **/ + PalletAppPromotionError: { + _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFounds', 'InvalidArgument', 'AlreadySponsored'] + }, + /** + * Lookup413: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup414: fp_rpc::TransactionStatus + * Lookup416: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -3099,11 +3119,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup416: ethbloom::Bloom + * Lookup418: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup418: ethereum::receipt::ReceiptV3 + * Lookup420: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -3113,7 +3133,7 @@ export default { } }, /** - * Lookup419: ethereum::receipt::EIP658ReceiptData + * Lookup421: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -3122,7 +3142,7 @@ export default { logs: 'Vec' }, /** - * Lookup420: ethereum::block::Block + * Lookup422: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -3130,7 +3150,7 @@ export default { ommers: 'Vec' }, /** - * Lookup421: ethereum::header::Header + * Lookup423: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -3150,41 +3170,41 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup422: ethereum_types::hash::H64 + * Lookup424: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup427: pallet_ethereum::pallet::Error + * Lookup429: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup428: pallet_evm_coder_substrate::pallet::Error + * Lookup430: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup429: pallet_evm_contract_helpers::SponsoringModeT + * Lookup431: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup431: pallet_evm_contract_helpers::pallet::Error + * Lookup433: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission'] }, /** - * Lookup432: pallet_evm_migration::pallet::Error + * Lookup434: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup434: sp_runtime::MultiSignature + * Lookup436: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3194,43 +3214,43 @@ export default { } }, /** - * Lookup435: sp_core::ed25519::Signature + * Lookup437: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup437: sp_core::sr25519::Signature + * Lookup439: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup438: sp_core::ecdsa::Signature + * Lookup440: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup441: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup443: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup442: frame_system::extensions::check_genesis::CheckGenesis + * Lookup444: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup445: frame_system::extensions::check_nonce::CheckNonce + * Lookup447: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup446: frame_system::extensions::check_weight::CheckWeight + * Lookup448: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup447: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup449: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup448: opal_runtime::Runtime + * Lookup450: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup449: pallet_ethereum::FakeTransactionFinalizer + * Lookup451: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index 32e6885f58..dea4dba987 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { interface InterfaceTypes { @@ -84,6 +84,8 @@ declare module '@polkadot/types/types/registry' { OrmlVestingModuleEvent: OrmlVestingModuleEvent; OrmlVestingVestingSchedule: OrmlVestingVestingSchedule; PalletAppPromotionCall: PalletAppPromotionCall; + PalletAppPromotionError: PalletAppPromotionError; + PalletAppPromotionEvent: PalletAppPromotionEvent; PalletBalancesAccountData: PalletBalancesAccountData; PalletBalancesBalanceLock: PalletBalancesBalanceLock; PalletBalancesCall: PalletBalancesCall; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 600c10f56c..da000ad48d 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1198,7 +1198,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'BaseCreated' | 'EquippablesUpdated'; } - /** @name PalletEvmEvent (103) */ + /** @name PalletAppPromotionEvent (103) */ + interface PalletAppPromotionEvent extends Enum { + readonly isStakingRecalculation: boolean; + readonly asStakingRecalculation: ITuple<[u128, u128]>; + readonly type: 'StakingRecalculation'; + } + + /** @name PalletEvmEvent (104) */ interface PalletEvmEvent extends Enum { readonly isLog: boolean; readonly asLog: EthereumLog; @@ -1217,21 +1224,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; } - /** @name EthereumLog (104) */ + /** @name EthereumLog (105) */ interface EthereumLog extends Struct { readonly address: H160; readonly topics: Vec; readonly data: Bytes; } - /** @name PalletEthereumEvent (108) */ + /** @name PalletEthereumEvent (109) */ interface PalletEthereumEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; readonly type: 'Executed'; } - /** @name EvmCoreErrorExitReason (109) */ + /** @name EvmCoreErrorExitReason (110) */ interface EvmCoreErrorExitReason extends Enum { readonly isSucceed: boolean; readonly asSucceed: EvmCoreErrorExitSucceed; @@ -1244,7 +1251,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; } - /** @name EvmCoreErrorExitSucceed (110) */ + /** @name EvmCoreErrorExitSucceed (111) */ interface EvmCoreErrorExitSucceed extends Enum { readonly isStopped: boolean; readonly isReturned: boolean; @@ -1252,7 +1259,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Stopped' | 'Returned' | 'Suicided'; } - /** @name EvmCoreErrorExitError (111) */ + /** @name EvmCoreErrorExitError (112) */ interface EvmCoreErrorExitError extends Enum { readonly isStackUnderflow: boolean; readonly isStackOverflow: boolean; @@ -1273,13 +1280,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; } - /** @name EvmCoreErrorExitRevert (114) */ + /** @name EvmCoreErrorExitRevert (115) */ interface EvmCoreErrorExitRevert extends Enum { readonly isReverted: boolean; readonly type: 'Reverted'; } - /** @name EvmCoreErrorExitFatal (115) */ + /** @name EvmCoreErrorExitFatal (116) */ interface EvmCoreErrorExitFatal extends Enum { readonly isNotSupported: boolean; readonly isUnhandledInterrupt: boolean; @@ -1290,7 +1297,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; } - /** @name FrameSystemPhase (116) */ + /** @name FrameSystemPhase (117) */ interface FrameSystemPhase extends Enum { readonly isApplyExtrinsic: boolean; readonly asApplyExtrinsic: u32; @@ -1299,13 +1306,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } - /** @name FrameSystemLastRuntimeUpgradeInfo (118) */ + /** @name FrameSystemLastRuntimeUpgradeInfo (119) */ interface FrameSystemLastRuntimeUpgradeInfo extends Struct { readonly specVersion: Compact; readonly specName: Text; } - /** @name FrameSystemCall (119) */ + /** @name FrameSystemCall (120) */ interface FrameSystemCall extends Enum { readonly isFillBlock: boolean; readonly asFillBlock: { @@ -1347,21 +1354,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent'; } - /** @name FrameSystemLimitsBlockWeights (124) */ + /** @name FrameSystemLimitsBlockWeights (125) */ interface FrameSystemLimitsBlockWeights extends Struct { readonly baseBlock: u64; readonly maxBlock: u64; readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; } - /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (125) */ + /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (126) */ interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { readonly normal: FrameSystemLimitsWeightsPerClass; readonly operational: FrameSystemLimitsWeightsPerClass; readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name FrameSystemLimitsWeightsPerClass (126) */ + /** @name FrameSystemLimitsWeightsPerClass (127) */ interface FrameSystemLimitsWeightsPerClass extends Struct { readonly baseExtrinsic: u64; readonly maxExtrinsic: Option; @@ -1369,25 +1376,25 @@ declare module '@polkadot/types/lookup' { readonly reserved: Option; } - /** @name FrameSystemLimitsBlockLength (128) */ + /** @name FrameSystemLimitsBlockLength (129) */ interface FrameSystemLimitsBlockLength extends Struct { readonly max: FrameSupportWeightsPerDispatchClassU32; } - /** @name FrameSupportWeightsPerDispatchClassU32 (129) */ + /** @name FrameSupportWeightsPerDispatchClassU32 (130) */ interface FrameSupportWeightsPerDispatchClassU32 extends Struct { readonly normal: u32; readonly operational: u32; readonly mandatory: u32; } - /** @name FrameSupportWeightsRuntimeDbWeight (130) */ + /** @name FrameSupportWeightsRuntimeDbWeight (131) */ interface FrameSupportWeightsRuntimeDbWeight extends Struct { readonly read: u64; readonly write: u64; } - /** @name SpVersionRuntimeVersion (131) */ + /** @name SpVersionRuntimeVersion (132) */ interface SpVersionRuntimeVersion extends Struct { readonly specName: Text; readonly implName: Text; @@ -1399,7 +1406,7 @@ declare module '@polkadot/types/lookup' { readonly stateVersion: u8; } - /** @name FrameSystemError (136) */ + /** @name FrameSystemError (137) */ interface FrameSystemError extends Enum { readonly isInvalidSpecName: boolean; readonly isSpecVersionNeedsToIncrease: boolean; @@ -1410,7 +1417,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name PolkadotPrimitivesV2PersistedValidationData (137) */ + /** @name PolkadotPrimitivesV2PersistedValidationData (138) */ interface PolkadotPrimitivesV2PersistedValidationData extends Struct { readonly parentHead: Bytes; readonly relayParentNumber: u32; @@ -1418,18 +1425,18 @@ declare module '@polkadot/types/lookup' { readonly maxPovSize: u32; } - /** @name PolkadotPrimitivesV2UpgradeRestriction (140) */ + /** @name PolkadotPrimitivesV2UpgradeRestriction (141) */ interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { readonly isPresent: boolean; readonly type: 'Present'; } - /** @name SpTrieStorageProof (141) */ + /** @name SpTrieStorageProof (142) */ interface SpTrieStorageProof extends Struct { readonly trieNodes: BTreeSet; } - /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (143) */ + /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (144) */ interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { readonly dmqMqcHead: H256; readonly relayDispatchQueueSize: ITuple<[u32, u32]>; @@ -1437,7 +1444,7 @@ declare module '@polkadot/types/lookup' { readonly egressChannels: Vec>; } - /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (146) */ + /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (147) */ interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { readonly maxCapacity: u32; readonly maxTotalSize: u32; @@ -1447,7 +1454,7 @@ declare module '@polkadot/types/lookup' { readonly mqcHead: Option; } - /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (147) */ + /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (148) */ interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { readonly maxCodeSize: u32; readonly maxHeadDataSize: u32; @@ -1460,13 +1467,13 @@ declare module '@polkadot/types/lookup' { readonly validationUpgradeDelay: u32; } - /** @name PolkadotCorePrimitivesOutboundHrmpMessage (153) */ + /** @name PolkadotCorePrimitivesOutboundHrmpMessage (154) */ interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { readonly recipient: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemCall (154) */ + /** @name CumulusPalletParachainSystemCall (155) */ interface CumulusPalletParachainSystemCall extends Enum { readonly isSetValidationData: boolean; readonly asSetValidationData: { @@ -1487,7 +1494,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade'; } - /** @name CumulusPrimitivesParachainInherentParachainInherentData (155) */ + /** @name CumulusPrimitivesParachainInherentParachainInherentData (156) */ interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { readonly validationData: PolkadotPrimitivesV2PersistedValidationData; readonly relayChainState: SpTrieStorageProof; @@ -1495,19 +1502,19 @@ declare module '@polkadot/types/lookup' { readonly horizontalMessages: BTreeMap>; } - /** @name PolkadotCorePrimitivesInboundDownwardMessage (157) */ + /** @name PolkadotCorePrimitivesInboundDownwardMessage (158) */ interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { readonly sentAt: u32; readonly msg: Bytes; } - /** @name PolkadotCorePrimitivesInboundHrmpMessage (160) */ + /** @name PolkadotCorePrimitivesInboundHrmpMessage (161) */ interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { readonly sentAt: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemError (163) */ + /** @name CumulusPalletParachainSystemError (164) */ interface CumulusPalletParachainSystemError extends Enum { readonly isOverlappingUpgrades: boolean; readonly isProhibitedByPolkadot: boolean; @@ -1520,14 +1527,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized'; } - /** @name PalletBalancesBalanceLock (165) */ + /** @name PalletBalancesBalanceLock (166) */ interface PalletBalancesBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; readonly reasons: PalletBalancesReasons; } - /** @name PalletBalancesReasons (166) */ + /** @name PalletBalancesReasons (167) */ interface PalletBalancesReasons extends Enum { readonly isFee: boolean; readonly isMisc: boolean; @@ -1535,20 +1542,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'Fee' | 'Misc' | 'All'; } - /** @name PalletBalancesReserveData (169) */ + /** @name PalletBalancesReserveData (170) */ interface PalletBalancesReserveData extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name PalletBalancesReleases (171) */ + /** @name PalletBalancesReleases (172) */ interface PalletBalancesReleases extends Enum { readonly isV100: boolean; readonly isV200: boolean; readonly type: 'V100' | 'V200'; } - /** @name PalletBalancesCall (172) */ + /** @name PalletBalancesCall (173) */ interface PalletBalancesCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1585,7 +1592,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; } - /** @name PalletBalancesError (175) */ + /** @name PalletBalancesError (176) */ interface PalletBalancesError extends Enum { readonly isVestingBalance: boolean; readonly isLiquidityRestrictions: boolean; @@ -1598,7 +1605,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves'; } - /** @name PalletTimestampCall (177) */ + /** @name PalletTimestampCall (178) */ interface PalletTimestampCall extends Enum { readonly isSet: boolean; readonly asSet: { @@ -1607,14 +1614,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Set'; } - /** @name PalletTransactionPaymentReleases (179) */ + /** @name PalletTransactionPaymentReleases (180) */ interface PalletTransactionPaymentReleases extends Enum { readonly isV1Ancient: boolean; readonly isV2: boolean; readonly type: 'V1Ancient' | 'V2'; } - /** @name PalletTreasuryProposal (180) */ + /** @name PalletTreasuryProposal (181) */ interface PalletTreasuryProposal extends Struct { readonly proposer: AccountId32; readonly value: u128; @@ -1622,7 +1629,7 @@ declare module '@polkadot/types/lookup' { readonly bond: u128; } - /** @name PalletTreasuryCall (183) */ + /** @name PalletTreasuryCall (184) */ interface PalletTreasuryCall extends Enum { readonly isProposeSpend: boolean; readonly asProposeSpend: { @@ -1649,10 +1656,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval'; } - /** @name FrameSupportPalletId (186) */ + /** @name FrameSupportPalletId (187) */ interface FrameSupportPalletId extends U8aFixed {} - /** @name PalletTreasuryError (187) */ + /** @name PalletTreasuryError (188) */ interface PalletTreasuryError extends Enum { readonly isInsufficientProposersBalance: boolean; readonly isInvalidIndex: boolean; @@ -1662,7 +1669,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved'; } - /** @name PalletSudoCall (188) */ + /** @name PalletSudoCall (189) */ interface PalletSudoCall extends Enum { readonly isSudo: boolean; readonly asSudo: { @@ -1685,7 +1692,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs'; } - /** @name OrmlVestingModuleCall (190) */ + /** @name OrmlVestingModuleCall (191) */ interface OrmlVestingModuleCall extends Enum { readonly isClaim: boolean; readonly isVestedTransfer: boolean; @@ -1705,7 +1712,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor'; } - /** @name CumulusPalletXcmpQueueCall (192) */ + /** @name CumulusPalletXcmpQueueCall (193) */ interface CumulusPalletXcmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { @@ -1741,7 +1748,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight'; } - /** @name PalletXcmCall (193) */ + /** @name PalletXcmCall (194) */ interface PalletXcmCall extends Enum { readonly isSend: boolean; readonly asSend: { @@ -1803,7 +1810,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets'; } - /** @name XcmVersionedXcm (194) */ + /** @name XcmVersionedXcm (195) */ interface XcmVersionedXcm extends Enum { readonly isV0: boolean; readonly asV0: XcmV0Xcm; @@ -1814,7 +1821,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1' | 'V2'; } - /** @name XcmV0Xcm (195) */ + /** @name XcmV0Xcm (196) */ interface XcmV0Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -1877,7 +1884,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom'; } - /** @name XcmV0Order (197) */ + /** @name XcmV0Order (198) */ interface XcmV0Order extends Enum { readonly isNull: boolean; readonly isDepositAsset: boolean; @@ -1925,14 +1932,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV0Response (199) */ + /** @name XcmV0Response (200) */ interface XcmV0Response extends Enum { readonly isAssets: boolean; readonly asAssets: Vec; readonly type: 'Assets'; } - /** @name XcmV1Xcm (200) */ + /** @name XcmV1Xcm (201) */ interface XcmV1Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -2001,7 +2008,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion'; } - /** @name XcmV1Order (202) */ + /** @name XcmV1Order (203) */ interface XcmV1Order extends Enum { readonly isNoop: boolean; readonly isDepositAsset: boolean; @@ -2051,7 +2058,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV1Response (204) */ + /** @name XcmV1Response (205) */ interface XcmV1Response extends Enum { readonly isAssets: boolean; readonly asAssets: XcmV1MultiassetMultiAssets; @@ -2060,10 +2067,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'Assets' | 'Version'; } - /** @name CumulusPalletXcmCall (218) */ + /** @name CumulusPalletXcmCall (219) */ type CumulusPalletXcmCall = Null; - /** @name CumulusPalletDmpQueueCall (219) */ + /** @name CumulusPalletDmpQueueCall (220) */ interface CumulusPalletDmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { @@ -2073,7 +2080,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight'; } - /** @name PalletInflationCall (220) */ + /** @name PalletInflationCall (221) */ interface PalletInflationCall extends Enum { readonly isStartInflation: boolean; readonly asStartInflation: { @@ -2082,7 +2089,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'StartInflation'; } - /** @name PalletUniqueCall (221) */ + /** @name PalletUniqueCall (222) */ interface PalletUniqueCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -2240,7 +2247,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; } - /** @name UpDataStructsCollectionMode (226) */ + /** @name UpDataStructsCollectionMode (227) */ interface UpDataStructsCollectionMode extends Enum { readonly isNft: boolean; readonly isFungible: boolean; @@ -2249,7 +2256,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateCollectionData (227) */ + /** @name UpDataStructsCreateCollectionData (228) */ interface UpDataStructsCreateCollectionData extends Struct { readonly mode: UpDataStructsCollectionMode; readonly access: Option; @@ -2263,14 +2270,14 @@ declare module '@polkadot/types/lookup' { readonly properties: Vec; } - /** @name UpDataStructsAccessMode (229) */ + /** @name UpDataStructsAccessMode (230) */ interface UpDataStructsAccessMode extends Enum { readonly isNormal: boolean; readonly isAllowList: boolean; readonly type: 'Normal' | 'AllowList'; } - /** @name UpDataStructsCollectionLimits (231) */ + /** @name UpDataStructsCollectionLimits (232) */ interface UpDataStructsCollectionLimits extends Struct { readonly accountTokenOwnershipLimit: Option; readonly sponsoredDataSize: Option; @@ -2283,7 +2290,7 @@ declare module '@polkadot/types/lookup' { readonly transfersEnabled: Option; } - /** @name UpDataStructsSponsoringRateLimit (233) */ + /** @name UpDataStructsSponsoringRateLimit (234) */ interface UpDataStructsSponsoringRateLimit extends Enum { readonly isSponsoringDisabled: boolean; readonly isBlocks: boolean; @@ -2291,43 +2298,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'SponsoringDisabled' | 'Blocks'; } - /** @name UpDataStructsCollectionPermissions (236) */ + /** @name UpDataStructsCollectionPermissions (237) */ interface UpDataStructsCollectionPermissions extends Struct { readonly access: Option; readonly mintMode: Option; readonly nesting: Option; } - /** @name UpDataStructsNestingPermissions (238) */ + /** @name UpDataStructsNestingPermissions (239) */ interface UpDataStructsNestingPermissions extends Struct { readonly tokenOwner: bool; readonly collectionAdmin: bool; readonly restricted: Option; } - /** @name UpDataStructsOwnerRestrictedSet (240) */ + /** @name UpDataStructsOwnerRestrictedSet (241) */ interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} - /** @name UpDataStructsPropertyKeyPermission (245) */ + /** @name UpDataStructsPropertyKeyPermission (246) */ interface UpDataStructsPropertyKeyPermission extends Struct { readonly key: Bytes; readonly permission: UpDataStructsPropertyPermission; } - /** @name UpDataStructsPropertyPermission (246) */ + /** @name UpDataStructsPropertyPermission (247) */ interface UpDataStructsPropertyPermission extends Struct { readonly mutable: bool; readonly collectionAdmin: bool; readonly tokenOwner: bool; } - /** @name UpDataStructsProperty (249) */ + /** @name UpDataStructsProperty (250) */ interface UpDataStructsProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name UpDataStructsCreateItemData (252) */ + /** @name UpDataStructsCreateItemData (253) */ interface UpDataStructsCreateItemData extends Enum { readonly isNft: boolean; readonly asNft: UpDataStructsCreateNftData; @@ -2338,23 +2345,23 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateNftData (253) */ + /** @name UpDataStructsCreateNftData (254) */ interface UpDataStructsCreateNftData extends Struct { readonly properties: Vec; } - /** @name UpDataStructsCreateFungibleData (254) */ + /** @name UpDataStructsCreateFungibleData (255) */ interface UpDataStructsCreateFungibleData extends Struct { readonly value: u128; } - /** @name UpDataStructsCreateReFungibleData (255) */ + /** @name UpDataStructsCreateReFungibleData (256) */ interface UpDataStructsCreateReFungibleData extends Struct { readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateItemExData (258) */ + /** @name UpDataStructsCreateItemExData (259) */ interface UpDataStructsCreateItemExData extends Enum { readonly isNft: boolean; readonly asNft: Vec; @@ -2367,26 +2374,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; } - /** @name UpDataStructsCreateNftExData (260) */ + /** @name UpDataStructsCreateNftExData (261) */ interface UpDataStructsCreateNftExData extends Struct { readonly properties: Vec; readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsCreateRefungibleExSingleOwner (267) */ + /** @name UpDataStructsCreateRefungibleExSingleOwner (268) */ interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { readonly user: PalletEvmAccountBasicCrossAccountIdRepr; readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateRefungibleExMultipleOwners (269) */ + /** @name UpDataStructsCreateRefungibleExMultipleOwners (270) */ interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { readonly users: BTreeMap; readonly properties: Vec; } - /** @name PalletUniqueSchedulerCall (270) */ + /** @name PalletUniqueSchedulerCall (271) */ interface PalletUniqueSchedulerCall extends Enum { readonly isScheduleNamed: boolean; readonly asScheduleNamed: { @@ -2411,7 +2418,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; } - /** @name FrameSupportScheduleMaybeHashed (272) */ + /** @name FrameSupportScheduleMaybeHashed (273) */ interface FrameSupportScheduleMaybeHashed extends Enum { readonly isValue: boolean; readonly asValue: Call; @@ -2420,7 +2427,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Value' | 'Hash'; } - /** @name PalletConfigurationCall (273) */ + /** @name PalletConfigurationCall (274) */ interface PalletConfigurationCall extends Enum { readonly isSetWeightToFeeCoefficientOverride: boolean; readonly asSetWeightToFeeCoefficientOverride: { @@ -2433,13 +2440,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride'; } - /** @name PalletTemplateTransactionPaymentCall (274) */ + /** @name PalletTemplateTransactionPaymentCall (275) */ type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletStructureCall (275) */ + /** @name PalletStructureCall (276) */ type PalletStructureCall = Null; - /** @name PalletRmrkCoreCall (276) */ + /** @name PalletRmrkCoreCall (277) */ interface PalletRmrkCoreCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -2545,7 +2552,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; } - /** @name RmrkTraitsResourceResourceTypes (282) */ + /** @name RmrkTraitsResourceResourceTypes (283) */ interface RmrkTraitsResourceResourceTypes extends Enum { readonly isBasic: boolean; readonly asBasic: RmrkTraitsResourceBasicResource; @@ -2556,7 +2563,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Basic' | 'Composable' | 'Slot'; } - /** @name RmrkTraitsResourceBasicResource (284) */ + /** @name RmrkTraitsResourceBasicResource (285) */ interface RmrkTraitsResourceBasicResource extends Struct { readonly src: Option; readonly metadata: Option; @@ -2564,7 +2571,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceComposableResource (286) */ + /** @name RmrkTraitsResourceComposableResource (287) */ interface RmrkTraitsResourceComposableResource extends Struct { readonly parts: Vec; readonly base: u32; @@ -2574,7 +2581,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceSlotResource (287) */ + /** @name RmrkTraitsResourceSlotResource (288) */ interface RmrkTraitsResourceSlotResource extends Struct { readonly base: u32; readonly src: Option; @@ -2584,7 +2591,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name PalletRmrkEquipCall (290) */ + /** @name PalletRmrkEquipCall (291) */ interface PalletRmrkEquipCall extends Enum { readonly isCreateBase: boolean; readonly asCreateBase: { @@ -2606,7 +2613,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; } - /** @name RmrkTraitsPartPartType (293) */ + /** @name RmrkTraitsPartPartType (294) */ interface RmrkTraitsPartPartType extends Enum { readonly isFixedPart: boolean; readonly asFixedPart: RmrkTraitsPartFixedPart; @@ -2615,14 +2622,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'FixedPart' | 'SlotPart'; } - /** @name RmrkTraitsPartFixedPart (295) */ + /** @name RmrkTraitsPartFixedPart (296) */ interface RmrkTraitsPartFixedPart extends Struct { readonly id: u32; readonly z: u32; readonly src: Bytes; } - /** @name RmrkTraitsPartSlotPart (296) */ + /** @name RmrkTraitsPartSlotPart (297) */ interface RmrkTraitsPartSlotPart extends Struct { readonly id: u32; readonly equippable: RmrkTraitsPartEquippableList; @@ -2630,7 +2637,7 @@ declare module '@polkadot/types/lookup' { readonly z: u32; } - /** @name RmrkTraitsPartEquippableList (297) */ + /** @name RmrkTraitsPartEquippableList (298) */ interface RmrkTraitsPartEquippableList extends Enum { readonly isAll: boolean; readonly isEmpty: boolean; @@ -2639,28 +2646,28 @@ declare module '@polkadot/types/lookup' { readonly type: 'All' | 'Empty' | 'Custom'; } - /** @name RmrkTraitsTheme (299) */ + /** @name RmrkTraitsTheme (300) */ interface RmrkTraitsTheme extends Struct { readonly name: Bytes; readonly properties: Vec; readonly inherit: bool; } - /** @name RmrkTraitsThemeThemeProperty (301) */ + /** @name RmrkTraitsThemeThemeProperty (302) */ interface RmrkTraitsThemeThemeProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name PalletAppPromotionCall (303) */ + /** @name PalletAppPromotionCall (304) */ interface PalletAppPromotionCall extends Enum { readonly isSetAdminAddress: boolean; readonly asSetAdminAddress: { - readonly admin: AccountId32; + readonly admin: PalletEvmAccountBasicCrossAccountIdRepr; } & Struct; readonly isStartAppPromotion: boolean; readonly asStartAppPromotion: { - readonly promotionStartRelayBlock: u32; + readonly promotionStartRelayBlock: Option; } & Struct; readonly isStake: boolean; readonly asStake: { @@ -2670,10 +2677,18 @@ declare module '@polkadot/types/lookup' { readonly asUnstake: { readonly amount: u128; } & Struct; - readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake'; + readonly isSponsorCollection: boolean; + readonly asSponsorCollection: { + readonly collectionId: u32; + } & Struct; + readonly isStopSponsorignCollection: boolean; + readonly asStopSponsorignCollection: { + readonly collectionId: u32; + } & Struct; + readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsorignCollection'; } - /** @name PalletEvmCall (304) */ + /** @name PalletEvmCall (305) */ interface PalletEvmCall extends Enum { readonly isWithdraw: boolean; readonly asWithdraw: { @@ -2718,7 +2733,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name PalletEthereumCall (308) */ + /** @name PalletEthereumCall (309) */ interface PalletEthereumCall extends Enum { readonly isTransact: boolean; readonly asTransact: { @@ -2727,7 +2742,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transact'; } - /** @name EthereumTransactionTransactionV2 (309) */ + /** @name EthereumTransactionTransactionV2 (310) */ interface EthereumTransactionTransactionV2 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumTransactionLegacyTransaction; @@ -2738,7 +2753,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumTransactionLegacyTransaction (310) */ + /** @name EthereumTransactionLegacyTransaction (311) */ interface EthereumTransactionLegacyTransaction extends Struct { readonly nonce: U256; readonly gasPrice: U256; @@ -2749,7 +2764,7 @@ declare module '@polkadot/types/lookup' { readonly signature: EthereumTransactionTransactionSignature; } - /** @name EthereumTransactionTransactionAction (311) */ + /** @name EthereumTransactionTransactionAction (312) */ interface EthereumTransactionTransactionAction extends Enum { readonly isCall: boolean; readonly asCall: H160; @@ -2757,14 +2772,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Call' | 'Create'; } - /** @name EthereumTransactionTransactionSignature (312) */ + /** @name EthereumTransactionTransactionSignature (313) */ interface EthereumTransactionTransactionSignature extends Struct { readonly v: u64; readonly r: H256; readonly s: H256; } - /** @name EthereumTransactionEip2930Transaction (314) */ + /** @name EthereumTransactionEip2930Transaction (315) */ interface EthereumTransactionEip2930Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -2779,13 +2794,13 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name EthereumTransactionAccessListItem (316) */ + /** @name EthereumTransactionAccessListItem (317) */ interface EthereumTransactionAccessListItem extends Struct { readonly address: H160; readonly storageKeys: Vec; } - /** @name EthereumTransactionEip1559Transaction (317) */ + /** @name EthereumTransactionEip1559Transaction (318) */ interface EthereumTransactionEip1559Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -2801,7 +2816,7 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name PalletEvmMigrationCall (318) */ + /** @name PalletEvmMigrationCall (319) */ interface PalletEvmMigrationCall extends Enum { readonly isBegin: boolean; readonly asBegin: { @@ -2820,13 +2835,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Begin' | 'SetData' | 'Finish'; } - /** @name PalletSudoError (321) */ + /** @name PalletSudoError (322) */ interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: 'RequireSudo'; } - /** @name OrmlVestingModuleError (323) */ + /** @name OrmlVestingModuleError (324) */ interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; @@ -2837,21 +2852,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (325) */ + /** @name CumulusPalletXcmpQueueInboundChannelDetails (326) */ interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (326) */ + /** @name CumulusPalletXcmpQueueInboundState (327) */ interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (329) */ + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (330) */ interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; @@ -2859,7 +2874,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (332) */ + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (333) */ interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; @@ -2868,14 +2883,14 @@ declare module '@polkadot/types/lookup' { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (333) */ + /** @name CumulusPalletXcmpQueueOutboundState (334) */ interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (335) */ + /** @name CumulusPalletXcmpQueueQueueConfigData (336) */ interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; @@ -2885,7 +2900,7 @@ declare module '@polkadot/types/lookup' { readonly xcmpMaxIndividualWeight: u64; } - /** @name CumulusPalletXcmpQueueError (337) */ + /** @name CumulusPalletXcmpQueueError (338) */ interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; @@ -2895,7 +2910,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (338) */ + /** @name PalletXcmError (339) */ interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; @@ -2913,29 +2928,29 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (339) */ + /** @name CumulusPalletXcmError (340) */ type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (340) */ + /** @name CumulusPalletDmpQueueConfigData (341) */ interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: u64; } - /** @name CumulusPalletDmpQueuePageIndexData (341) */ + /** @name CumulusPalletDmpQueuePageIndexData (342) */ interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (344) */ + /** @name CumulusPalletDmpQueueError (345) */ interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (348) */ + /** @name PalletUniqueError (349) */ interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; @@ -2944,7 +2959,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name PalletUniqueSchedulerScheduledV3 (351) */ + /** @name PalletUniqueSchedulerScheduledV3 (352) */ interface PalletUniqueSchedulerScheduledV3 extends Struct { readonly maybeId: Option; readonly priority: u8; @@ -2953,7 +2968,7 @@ declare module '@polkadot/types/lookup' { readonly origin: OpalRuntimeOriginCaller; } - /** @name OpalRuntimeOriginCaller (352) */ + /** @name OpalRuntimeOriginCaller (353) */ interface OpalRuntimeOriginCaller extends Enum { readonly isSystem: boolean; readonly asSystem: FrameSupportDispatchRawOrigin; @@ -2967,7 +2982,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; } - /** @name FrameSupportDispatchRawOrigin (353) */ + /** @name FrameSupportDispatchRawOrigin (354) */ interface FrameSupportDispatchRawOrigin extends Enum { readonly isRoot: boolean; readonly isSigned: boolean; @@ -2976,7 +2991,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Root' | 'Signed' | 'None'; } - /** @name PalletXcmOrigin (354) */ + /** @name PalletXcmOrigin (355) */ interface PalletXcmOrigin extends Enum { readonly isXcm: boolean; readonly asXcm: XcmV1MultiLocation; @@ -2985,7 +3000,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Xcm' | 'Response'; } - /** @name CumulusPalletXcmOrigin (355) */ + /** @name CumulusPalletXcmOrigin (356) */ interface CumulusPalletXcmOrigin extends Enum { readonly isRelay: boolean; readonly isSiblingParachain: boolean; @@ -2993,17 +3008,17 @@ declare module '@polkadot/types/lookup' { readonly type: 'Relay' | 'SiblingParachain'; } - /** @name PalletEthereumRawOrigin (356) */ + /** @name PalletEthereumRawOrigin (357) */ interface PalletEthereumRawOrigin extends Enum { readonly isEthereumTransaction: boolean; readonly asEthereumTransaction: H160; readonly type: 'EthereumTransaction'; } - /** @name SpCoreVoid (357) */ + /** @name SpCoreVoid (358) */ type SpCoreVoid = Null; - /** @name PalletUniqueSchedulerError (358) */ + /** @name PalletUniqueSchedulerError (359) */ interface PalletUniqueSchedulerError extends Enum { readonly isFailedToSchedule: boolean; readonly isNotFound: boolean; @@ -3012,7 +3027,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; } - /** @name UpDataStructsCollection (359) */ + /** @name UpDataStructsCollection (360) */ interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3025,7 +3040,7 @@ declare module '@polkadot/types/lookup' { readonly externalCollection: bool; } - /** @name UpDataStructsSponsorshipState (360) */ + /** @name UpDataStructsSponsorshipState (361) */ interface UpDataStructsSponsorshipState extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3035,43 +3050,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (361) */ + /** @name UpDataStructsProperties (362) */ interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (362) */ + /** @name UpDataStructsPropertiesMapBoundedVec (363) */ interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (367) */ + /** @name UpDataStructsPropertiesMapPropertyPermission (368) */ interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (374) */ + /** @name UpDataStructsCollectionStats (375) */ interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (375) */ + /** @name UpDataStructsTokenChild (376) */ interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (376) */ + /** @name PhantomTypeUpDataStructs (377) */ interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (378) */ + /** @name UpDataStructsTokenData (379) */ interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (380) */ + /** @name UpDataStructsRpcCollection (381) */ interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3086,7 +3101,7 @@ declare module '@polkadot/types/lookup' { readonly readOnly: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (381) */ + /** @name RmrkTraitsCollectionCollectionInfo (382) */ interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; @@ -3095,7 +3110,7 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (382) */ + /** @name RmrkTraitsNftNftInfo (383) */ interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; @@ -3104,13 +3119,13 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (384) */ + /** @name RmrkTraitsNftRoyaltyInfo (385) */ interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (385) */ + /** @name RmrkTraitsResourceResourceInfo (386) */ interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; @@ -3118,26 +3133,26 @@ declare module '@polkadot/types/lookup' { readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (386) */ + /** @name RmrkTraitsPropertyPropertyInfo (387) */ interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (387) */ + /** @name RmrkTraitsBaseBaseInfo (388) */ interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (388) */ + /** @name RmrkTraitsNftNftChild (389) */ interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (390) */ + /** @name PalletCommonError (391) */ interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; @@ -3176,7 +3191,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (392) */ + /** @name PalletFungibleError (393) */ interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; @@ -3186,12 +3201,12 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (393) */ + /** @name PalletRefungibleItemData (394) */ interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } - /** @name PalletRefungibleError (398) */ + /** @name PalletRefungibleError (399) */ interface PalletRefungibleError extends Enum { readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isWrongRefungiblePieces: boolean; @@ -3201,12 +3216,12 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletNonfungibleItemData (399) */ + /** @name PalletNonfungibleItemData (400) */ interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (401) */ + /** @name UpDataStructsPropertyScope (402) */ interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; @@ -3214,7 +3229,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'None' | 'Rmrk' | 'Eth'; } - /** @name PalletNonfungibleError (403) */ + /** @name PalletNonfungibleError (404) */ interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; @@ -3222,7 +3237,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (404) */ + /** @name PalletStructureError (405) */ interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; @@ -3231,7 +3246,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletRmrkCoreError (405) */ + /** @name PalletRmrkCoreError (406) */ interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; @@ -3255,7 +3270,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } - /** @name PalletRmrkEquipError (407) */ + /** @name PalletRmrkEquipError (408) */ interface PalletRmrkEquipError extends Enum { readonly isPermissionError: boolean; readonly isNoAvailableBaseId: boolean; @@ -3267,7 +3282,17 @@ declare module '@polkadot/types/lookup' { readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; } - /** @name PalletEvmError (411) */ + /** @name PalletAppPromotionError (410) */ + interface PalletAppPromotionError extends Enum { + readonly isAdminNotSet: boolean; + readonly isNoPermission: boolean; + readonly isNotSufficientFounds: boolean; + readonly isInvalidArgument: boolean; + readonly isAlreadySponsored: boolean; + readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'InvalidArgument' | 'AlreadySponsored'; + } + + /** @name PalletEvmError (413) */ interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; @@ -3278,7 +3303,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (414) */ + /** @name FpRpcTransactionStatus (416) */ interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; @@ -3289,10 +3314,10 @@ declare module '@polkadot/types/lookup' { readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (416) */ + /** @name EthbloomBloom (418) */ interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (418) */ + /** @name EthereumReceiptReceiptV3 (420) */ interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; @@ -3303,7 +3328,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (419) */ + /** @name EthereumReceiptEip658ReceiptData (421) */ interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; @@ -3311,14 +3336,14 @@ declare module '@polkadot/types/lookup' { readonly logs: Vec; } - /** @name EthereumBlock (420) */ + /** @name EthereumBlock (422) */ interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (421) */ + /** @name EthereumHeader (423) */ interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; @@ -3337,24 +3362,24 @@ declare module '@polkadot/types/lookup' { readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (422) */ + /** @name EthereumTypesHashH64 (424) */ interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (427) */ + /** @name PalletEthereumError (429) */ interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (428) */ + /** @name PalletEvmCoderSubstrateError (430) */ interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name PalletEvmContractHelpersSponsoringModeT (429) */ + /** @name PalletEvmContractHelpersSponsoringModeT (431) */ interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; @@ -3362,20 +3387,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (431) */ + /** @name PalletEvmContractHelpersError (433) */ interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly type: 'NoPermission'; } - /** @name PalletEvmMigrationError (432) */ + /** @name PalletEvmMigrationError (434) */ interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (434) */ + /** @name SpRuntimeMultiSignature (436) */ interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; @@ -3386,34 +3411,34 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (435) */ + /** @name SpCoreEd25519Signature (437) */ interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (437) */ + /** @name SpCoreSr25519Signature (439) */ interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (438) */ + /** @name SpCoreEcdsaSignature (440) */ interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (441) */ + /** @name FrameSystemExtensionsCheckSpecVersion (443) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (442) */ + /** @name FrameSystemExtensionsCheckGenesis (444) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (445) */ + /** @name FrameSystemExtensionsCheckNonce (447) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (446) */ + /** @name FrameSystemExtensionsCheckWeight (448) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (447) */ + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (449) */ interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (448) */ + /** @name OpalRuntimeRuntime (450) */ type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (449) */ + /** @name PalletEthereumFakeTransactionFinalizer (451) */ type PalletEthereumFakeTransactionFinalizer = Null; } // declare module From a06730ecc75573334ea3f16014b10c7d51c5017c Mon Sep 17 00:00:00 2001 From: PraetorP Date: Thu, 25 Aug 2022 19:13:03 +0700 Subject: [PATCH 0622/1274] fix test --- tests/src/app-promotion.test.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 0dc00d5313..0417d6720e 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -638,14 +638,10 @@ describe('app-promotion stopSponsoringContract', () => { palletAdmin = privateKeyWrapper('//palletAdmin'); await helper.balance.transferToSubstrate(alice, palletAdmin.address, 10n * helper.balance.getOneTokenNominal()); await helper.balance.transferToSubstrate(alice, calculatePalleteAddress('appstake'), 10n * helper.balance.getOneTokenNominal()); - - const promotionStartBlock = await helper.chain.getLatestBlockNumber(); + const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); await helper.signTransaction(alice, tx); - const txStart = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.startAppPromotion(promotionStartBlock)); - await helper.signTransaction(alice, txStart); - nominal = helper.balance.getOneTokenNominal(); }); }); From 9d0f344e127b9efb881fb5f837504d60356e0cc7 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Fri, 26 Aug 2022 13:22:20 +0700 Subject: [PATCH 0623/1274] fixup generate ts types --- Cargo.lock | 1 + pallets/app-promotion/Cargo.toml | 3 ++ pallets/app-promotion/src/types.rs | 3 +- tests/src/interfaces/augment-api-errors.ts | 6 ++- tests/src/interfaces/augment-api-query.ts | 56 +++++++++++++++++++++- tests/src/interfaces/augment-types.ts | 5 +- tests/src/interfaces/default/types.ts | 21 ++++++-- tests/src/interfaces/lookup.ts | 46 +++++++++++------- tests/src/interfaces/registry.ts | 5 +- tests/src/interfaces/types-lookup.ts | 49 +++++++++++-------- tests/src/util/playgrounds/index.ts | 42 +--------------- 11 files changed, 148 insertions(+), 89 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ec67590ccb..527c6ee4ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5306,6 +5306,7 @@ dependencies = [ "pallet-balances", "pallet-common", "pallet-evm", + "pallet-evm-contract-helpers", "pallet-randomness-collective-flip", "pallet-timestamp", "pallet-unique", diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index 2faa34ca99..83c9895024 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -118,6 +118,9 @@ path = "../common" default-features = false path = "../unique" +[dependencies.pallet-evm-contract-helpers] +default-features = false +path = "../evm-contract-helpers" ################################################################################ [dependencies] diff --git a/pallets/app-promotion/src/types.rs b/pallets/app-promotion/src/types.rs index 42b706b3c7..3f06594efb 100644 --- a/pallets/app-promotion/src/types.rs +++ b/pallets/app-promotion/src/types.rs @@ -2,7 +2,7 @@ use codec::EncodeLike; use frame_support::{ traits::LockableCurrency, WeakBoundedVec, Parameter, dispatch::DispatchResult, ensure, }; -use frame_system::Config; + use pallet_balances::{BalanceLock, Config as BalancesConfig, Pallet as PalletBalances}; use pallet_common::CollectionHandle; use pallet_unique::{Event as UniqueEvent, Error as UniqueError}; @@ -10,6 +10,7 @@ use sp_runtime::DispatchError; use up_data_structs::{CollectionId, SponsorshipState}; use sp_std::borrow::ToOwned; + pub trait ExtendedLockableCurrency: LockableCurrency { fn locks(who: KArg) -> WeakBoundedVec, Self::MaxLocks> where diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index b8ed34b991..c7b3bc6aa1 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -265,7 +265,11 @@ declare module '@polkadot/api-base/types/errors' { }; evmContractHelpers: { /** - * This method is only executable by owner + * No pending sponsor for contract. + **/ + NoPendingSponsor: AugmentedError; + /** + * This method is only executable by owner. **/ NoPermission: AugmentedError; /** diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index ef72ddbb71..66c5c89678 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -9,7 +9,7 @@ import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/ import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime'; -import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsTokenChild } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild } from '@polkadot/types/lookup'; import type { Observable } from '@polkadot/types/types'; export type __AugmentedQuery = AugmentedQuery unknown>; @@ -194,12 +194,66 @@ declare module '@polkadot/api-base/types/storage' { [key: string]: QueryableStorageEntry; }; evmContractHelpers: { + /** + * Storage for users that allowed for sponsorship. + * + * ### Usage + * Prefer to delete record from storage if user no more allowed for sponsorship. + * + * * **Key1** - contract address. + * * **Key2** - user that allowed for sponsorship. + * * **Value** - allowance for sponsorship. + **/ allowlist: AugmentedQuery Observable, [H160, H160]> & QueryableStorageEntry; + /** + * Storege for contracts with [`Allowlisted`](SponsoringModeT::Allowlisted) sponsoring mode. + * + * ### Usage + * Prefer to delete collection from storage if mode chaged to non `Allowlisted`, than set **Value** to **false**. + * + * * **Key** - contract address. + * * **Value** - is contract in [`Allowlisted`](SponsoringModeT::Allowlisted) mode. + **/ allowlistEnabled: AugmentedQuery Observable, [H160]> & QueryableStorageEntry; + /** + * Store owner for contract. + * + * * **Key** - contract address. + * * **Value** - owner for contract. + **/ owner: AugmentedQuery Observable, [H160]> & QueryableStorageEntry; selfSponsoring: AugmentedQuery Observable, [H160]> & QueryableStorageEntry; + /** + * Storage for last sponsored block. + * + * * **Key1** - contract address. + * * **Key2** - sponsored user address. + * * **Value** - last sponsored block number. + **/ sponsorBasket: AugmentedQuery Observable>, [H160, H160]> & QueryableStorageEntry; + /** + * Store for contract sponsorship state. + * + * * **Key** - contract address. + * * **Value** - sponsorship state. + **/ + sponsoring: AugmentedQuery Observable, [H160]> & QueryableStorageEntry; + /** + * Store for sponsoring mode. + * + * ### Usage + * Prefer to delete collection from storage if mode chaged to [`Disabled`](SponsoringModeT::Disabled). + * + * * **Key** - contract address. + * * **Value** - [`sponsoring mode`](SponsoringModeT). + **/ sponsoringMode: AugmentedQuery Observable>, [H160]> & QueryableStorageEntry; + /** + * Storage for sponsoring rate limit in blocks. + * + * * **Key** - contract address. + * * **Value** - amount of sponsored blocks. + **/ sponsoringRateLimit: AugmentedQuery Observable, [H160]> & QueryableStorageEntry; /** * Generic query diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index e96fa69378..1a3a74f362 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; @@ -1298,7 +1298,8 @@ declare module '@polkadot/types/types/registry' { UpDataStructsPropertyScope: UpDataStructsPropertyScope; UpDataStructsRpcCollection: UpDataStructsRpcCollection; UpDataStructsSponsoringRateLimit: UpDataStructsSponsoringRateLimit; - UpDataStructsSponsorshipState: UpDataStructsSponsorshipState; + UpDataStructsSponsorshipStateAccountId32: UpDataStructsSponsorshipStateAccountId32; + UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: UpDataStructsSponsorshipStateBasicCrossAccountIdRepr; UpDataStructsTokenChild: UpDataStructsTokenChild; UpDataStructsTokenData: UpDataStructsTokenData; UpgradeGoAhead: UpgradeGoAhead; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 2d357a9d52..495359fb81 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -1173,7 +1173,8 @@ export interface PalletEvmCoderSubstrateError extends Enum { /** @name PalletEvmContractHelpersError */ export interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; - readonly type: 'NoPermission'; + readonly isNoPendingSponsor: boolean; + readonly type: 'NoPermission' | 'NoPendingSponsor'; } /** @name PalletEvmContractHelpersSponsoringModeT */ @@ -2465,7 +2466,7 @@ export interface UpDataStructsCollection extends Struct { readonly name: Vec; readonly description: Vec; readonly tokenPrefix: Bytes; - readonly sponsorship: UpDataStructsSponsorshipState; + readonly sponsorship: UpDataStructsSponsorshipStateAccountId32; readonly limits: UpDataStructsCollectionLimits; readonly permissions: UpDataStructsCollectionPermissions; readonly externalCollection: bool; @@ -2637,7 +2638,7 @@ export interface UpDataStructsRpcCollection extends Struct { readonly name: Vec; readonly description: Vec; readonly tokenPrefix: Bytes; - readonly sponsorship: UpDataStructsSponsorshipState; + readonly sponsorship: UpDataStructsSponsorshipStateAccountId32; readonly limits: UpDataStructsCollectionLimits; readonly permissions: UpDataStructsCollectionPermissions; readonly tokenPropertyPermissions: Vec; @@ -2653,8 +2654,8 @@ export interface UpDataStructsSponsoringRateLimit extends Enum { readonly type: 'SponsoringDisabled' | 'Blocks'; } -/** @name UpDataStructsSponsorshipState */ -export interface UpDataStructsSponsorshipState extends Enum { +/** @name UpDataStructsSponsorshipStateAccountId32 */ +export interface UpDataStructsSponsorshipStateAccountId32 extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; readonly asUnconfirmed: AccountId32; @@ -2663,6 +2664,16 @@ export interface UpDataStructsSponsorshipState extends Enum { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } +/** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr */ +export interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum { + readonly isDisabled: boolean; + readonly isUnconfirmed: boolean; + readonly asUnconfirmed: PalletEvmAccountBasicCrossAccountIdRepr; + readonly isConfirmed: boolean; + readonly asConfirmed: PalletEvmAccountBasicCrossAccountIdRepr; + readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; +} + /** @name UpDataStructsTokenChild */ export interface UpDataStructsTokenChild extends Struct { readonly token: u32; diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 4e8621a586..fe0169f63d 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -2902,7 +2902,7 @@ export default { name: 'Vec', description: 'Vec', tokenPrefix: 'Bytes', - sponsorship: 'UpDataStructsSponsorshipState', + sponsorship: 'UpDataStructsSponsorshipStateAccountId32', limits: 'UpDataStructsCollectionLimits', permissions: 'UpDataStructsCollectionPermissions', externalCollection: 'bool' @@ -2910,7 +2910,7 @@ export default { /** * Lookup361: up_data_structs::SponsorshipState **/ - UpDataStructsSponsorshipState: { + UpDataStructsSponsorshipStateAccountId32: { _enum: { Disabled: 'Null', Unconfirmed: 'AccountId32', @@ -2969,7 +2969,7 @@ export default { name: 'Vec', description: 'Vec', tokenPrefix: 'Bytes', - sponsorship: 'UpDataStructsSponsorshipState', + sponsorship: 'UpDataStructsSponsorshipStateAccountId32', limits: 'UpDataStructsCollectionLimits', permissions: 'UpDataStructsCollectionPermissions', tokenPropertyPermissions: 'Vec', @@ -3186,25 +3186,35 @@ export default { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup431: pallet_evm_contract_helpers::SponsoringModeT + * Lookup431: up_data_structs::SponsorshipState> + **/ + UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: { + _enum: { + Disabled: 'Null', + Unconfirmed: 'PalletEvmAccountBasicCrossAccountIdRepr', + Confirmed: 'PalletEvmAccountBasicCrossAccountIdRepr' + } + }, + /** + * Lookup432: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup433: pallet_evm_contract_helpers::pallet::Error + * Lookup434: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { - _enum: ['NoPermission'] + _enum: ['NoPermission', 'NoPendingSponsor'] }, /** - * Lookup434: pallet_evm_migration::pallet::Error + * Lookup435: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup436: sp_runtime::MultiSignature + * Lookup437: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3214,43 +3224,43 @@ export default { } }, /** - * Lookup437: sp_core::ed25519::Signature + * Lookup438: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup439: sp_core::sr25519::Signature + * Lookup440: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup440: sp_core::ecdsa::Signature + * Lookup441: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup443: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup444: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup444: frame_system::extensions::check_genesis::CheckGenesis + * Lookup445: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup447: frame_system::extensions::check_nonce::CheckNonce + * Lookup448: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup448: frame_system::extensions::check_weight::CheckWeight + * Lookup449: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup449: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup450: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup450: opal_runtime::Runtime + * Lookup451: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup451: pallet_ethereum::FakeTransactionFinalizer + * Lookup452: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index dea4dba987..be526ecd7f 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { interface InterfaceTypes { @@ -216,7 +216,8 @@ declare module '@polkadot/types/types/registry' { UpDataStructsPropertyScope: UpDataStructsPropertyScope; UpDataStructsRpcCollection: UpDataStructsRpcCollection; UpDataStructsSponsoringRateLimit: UpDataStructsSponsoringRateLimit; - UpDataStructsSponsorshipState: UpDataStructsSponsorshipState; + UpDataStructsSponsorshipStateAccountId32: UpDataStructsSponsorshipStateAccountId32; + UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: UpDataStructsSponsorshipStateBasicCrossAccountIdRepr; UpDataStructsTokenChild: UpDataStructsTokenChild; UpDataStructsTokenData: UpDataStructsTokenData; XcmDoubleEncoded: XcmDoubleEncoded; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index da000ad48d..3305bd3476 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -3034,14 +3034,14 @@ declare module '@polkadot/types/lookup' { readonly name: Vec; readonly description: Vec; readonly tokenPrefix: Bytes; - readonly sponsorship: UpDataStructsSponsorshipState; + readonly sponsorship: UpDataStructsSponsorshipStateAccountId32; readonly limits: UpDataStructsCollectionLimits; readonly permissions: UpDataStructsCollectionPermissions; readonly externalCollection: bool; } - /** @name UpDataStructsSponsorshipState (361) */ - interface UpDataStructsSponsorshipState extends Enum { + /** @name UpDataStructsSponsorshipStateAccountId32 (361) */ + interface UpDataStructsSponsorshipStateAccountId32 extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; readonly asUnconfirmed: AccountId32; @@ -3093,7 +3093,7 @@ declare module '@polkadot/types/lookup' { readonly name: Vec; readonly description: Vec; readonly tokenPrefix: Bytes; - readonly sponsorship: UpDataStructsSponsorshipState; + readonly sponsorship: UpDataStructsSponsorshipStateAccountId32; readonly limits: UpDataStructsCollectionLimits; readonly permissions: UpDataStructsCollectionPermissions; readonly tokenPropertyPermissions: Vec; @@ -3379,7 +3379,17 @@ declare module '@polkadot/types/lookup' { readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name PalletEvmContractHelpersSponsoringModeT (431) */ + /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (431) */ + interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum { + readonly isDisabled: boolean; + readonly isUnconfirmed: boolean; + readonly asUnconfirmed: PalletEvmAccountBasicCrossAccountIdRepr; + readonly isConfirmed: boolean; + readonly asConfirmed: PalletEvmAccountBasicCrossAccountIdRepr; + readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; + } + + /** @name PalletEvmContractHelpersSponsoringModeT (432) */ interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; @@ -3387,20 +3397,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (433) */ + /** @name PalletEvmContractHelpersError (434) */ interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; - readonly type: 'NoPermission'; + readonly isNoPendingSponsor: boolean; + readonly type: 'NoPermission' | 'NoPendingSponsor'; } - /** @name PalletEvmMigrationError (434) */ + /** @name PalletEvmMigrationError (435) */ interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (436) */ + /** @name SpRuntimeMultiSignature (437) */ interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; @@ -3411,34 +3422,34 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (437) */ + /** @name SpCoreEd25519Signature (438) */ interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (439) */ + /** @name SpCoreSr25519Signature (440) */ interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (440) */ + /** @name SpCoreEcdsaSignature (441) */ interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (443) */ + /** @name FrameSystemExtensionsCheckSpecVersion (444) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (444) */ + /** @name FrameSystemExtensionsCheckGenesis (445) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (447) */ + /** @name FrameSystemExtensionsCheckNonce (448) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (448) */ + /** @name FrameSystemExtensionsCheckWeight (449) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (449) */ + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (450) */ interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (450) */ + /** @name OpalRuntimeRuntime (451) */ type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (451) */ + /** @name PalletEthereumFakeTransactionFinalizer (452) */ type PalletEthereumFakeTransactionFinalizer = Null; } // declare module diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index 5d864cf200..89a1e0fa4d 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -4,9 +4,7 @@ import {IKeyringPair} from '@polkadot/types/types'; import config from '../../config'; import '../../interfaces/augment-api-events'; -import * as defs from '../../interfaces/definitions'; -import {ApiPromise, WsProvider} from '@polkadot/api'; -import { UniqueHelper } from './unique'; +import {DevUniqueHelper} from './unique.dev'; class SilentLogger { @@ -19,45 +17,9 @@ class SilentLogger { } -class DevUniqueHelper extends UniqueHelper { - async connect(wsEndpoint: string, listeners?: any): Promise { - const wsProvider = new WsProvider(wsEndpoint); - this.api = new ApiPromise({ - provider: wsProvider, - signedExtensions: { - ContractHelpers: { - extrinsic: {}, - payload: {}, - }, - FakeTransactionFinalizer: { - extrinsic: {}, - payload: {}, - }, - }, - rpc: { - unique: defs.unique.rpc, - rmrk: defs.rmrk.rpc, - eth: { - feeHistory: { - description: 'Dummy', - params: [], - type: 'u8', - }, - maxPriorityFeePerGas: { - description: 'Dummy', - params: [], - type: 'u8', - }, - }, - }, - }); - await this.api.isReadyOrError; - this.network = await UniqueHelper.detectNetwork(this.api); - } -} -export const usingPlaygrounds = async (code: (helper: UniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { +export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { // TODO: Remove, this is temporary: Filter unneeded API output // (Jaco promised it will be removed in the next version) const consoleErr = console.error; From 982476ef99fe79e3c6791046322bd359003daa30 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Mon, 29 Aug 2022 12:58:46 +0700 Subject: [PATCH 0624/1274] feautres: Pending interval is now tied to relay blocks, contract sponsors and `stopAppPromotion` added. Preparing to integrate the `app-promotion` palette to integrate with Unique and Quartz. --- pallets/app-promotion/src/lib.rs | 171 ++++++------------ pallets/app-promotion/src/types.rs | 39 +++- pallets/evm-contract-helpers/src/lib.rs | 2 +- primitives/common/src/constants.rs | 6 + .../common/config/pallets/app_promotion.rs | 20 +- tests/src/app-promotion.test.ts | 29 +-- tests/src/interfaces/augment-api-consts.ts | 2 +- tests/src/interfaces/augment-api-errors.ts | 9 +- tests/src/interfaces/augment-api-query.ts | 2 +- tests/src/interfaces/augment-api-tx.ts | 3 + tests/src/interfaces/default/types.ts | 14 +- tests/src/interfaces/lookup.ts | 11 +- tests/src/interfaces/types-lookup.ts | 14 +- 13 files changed, 172 insertions(+), 150 deletions(-) diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 18fbf80524..118ec29194 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -37,9 +37,10 @@ pub mod types; pub mod weights; use sp_std::{vec::Vec, iter::Sum, borrow::ToOwned}; +use sp_core::H160; use codec::EncodeLike; use pallet_balances::BalanceLock; -pub use types::ExtendedLockableCurrency; +pub use types::*; // use up_common::constants::{DAYS, UNIQUE}; use up_data_structs::CollectionId; @@ -78,7 +79,6 @@ pub mod pallet { use super::*; use frame_support::{Blake2_128Concat, Twox64Concat, pallet_prelude::*, storage::Key, PalletId}; use frame_system::pallet_prelude::*; - use types::CollectionHandler; #[pallet::config] pub trait Config: frame_system::Config + pallet_evm::account::Config { @@ -89,6 +89,8 @@ pub mod pallet { CollectionId = CollectionId, >; + type ContractHandler: ContractHandler; + type TreasuryAccountId: Get; /// The app's pallet id, used for deriving its sovereign account ID. @@ -98,7 +100,7 @@ pub mod pallet { /// In relay blocks. #[pallet::constant] type RecalculationInterval: Get; - /// In chain blocks. + /// In relay blocks. #[pallet::constant] type PendingInterval: Get; @@ -120,13 +122,6 @@ pub mod pallet { /// Events compatible with [`frame_system::Config::Event`]. type Event: IsType<::Event> + From>; - - // /// Number of blocks that pass between treasury balance updates due to inflation - // #[pallet::constant] - // type InterestBlockInterval: Get; - - // // Weight information for functions of this pallet. - // type WeightInfo: WeightInfo; } #[pallet::pallet] @@ -146,13 +141,14 @@ pub mod pallet { #[pallet::error] pub enum Error { + /// Error due to action requiring admin to be set AdminNotSet, - /// No permission to perform action + /// No permission to perform an action NoPermission, /// Insufficient funds to perform an action NotSufficientFounds, + /// An error related to the fact that an invalid argument was passed to perform an action InvalidArgument, - AlreadySponsored, } #[pallet::storage] @@ -183,7 +179,7 @@ pub mod pallet { QueryKind = ValueQuery, >; - /// A block when app-promotion has started + /// A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`. #[pallet::storage] pub type StartBlock = StorageValue; @@ -285,6 +281,21 @@ pub mod pallet { Ok(()) } + #[pallet::weight(0)] + pub fn stop_app_promotion(origin: OriginFor) -> DispatchResult + where + ::BlockNumber: From, + { + ensure_root(origin)?; + + if >::get() != 0u32.into() { + >::set(T::BlockNumber::default()); + >::set(T::BlockNumber::default()); + } + + Ok(()) + } + #[pallet::weight(T::WeightInfo::stake())] pub fn stake(staker: OriginFor, amount: BalanceOf) -> DispatchResult { let staker_id = ensure_signed(staker)?; @@ -341,7 +352,8 @@ pub mod pallet { .ok_or(ArithmeticError::Underflow)?, ); - let block = frame_system::Pallet::::block_number() + T::PendingInterval::get(); + let block = + T::RelayBlockNumberProvider::current_block_number() + T::PendingInterval::get(); >::insert( (&staker_id, block), >::get((&staker_id, block)) @@ -415,113 +427,46 @@ pub mod pallet { ); T::CollectionHandler::remove_collection_sponsor(collection_id) } - } -} -impl Pallet { - // pub fn stake(staker: &T::AccountId, amount: BalanceOf) -> DispatchResult { - // let balance = <::Currency as Currency>::free_balance(staker); - - // ensure!(balance >= amount, ArithmeticError::Underflow); - - // Self::set_lock_unchecked(staker, amount); - - // let block_number = ::current_block_number(); - - // >::insert( - // (staker, block_number), - // >::get((staker, block_number)) - // .checked_add(&amount) - // .ok_or(ArithmeticError::Overflow)?, - // ); - - // >::set( - // >::get() - // .checked_add(&amount) - // .ok_or(ArithmeticError::Overflow)?, - // ); - - // Ok(()) - // } - - // pub fn unstake(staker: &T::AccountId, amount: BalanceOf) -> DispatchResult { - // let mut stakes = Staked::::iter_prefix((staker,)).collect::>(); - - // let total_staked = stakes - // .iter() - // .fold(>::default(), |acc, (_, amount)| acc + *amount); - - // ensure!(total_staked >= amount, ArithmeticError::Underflow); - - // >::set( - // >::get() - // .checked_sub(&amount) - // .ok_or(ArithmeticError::Underflow)?, - // ); - - // let block = ::current_block_number() + WEEK.into(); - // >::insert( - // (staker, block), - // >::get((staker, block)) - // .checked_add(&amount) - // .ok_or(ArithmeticError::Overflow)?, - // ); - - // stakes.sort_by_key(|(block, _)| *block); - - // let mut acc_amount = amount; - // let new_state = stakes - // .into_iter() - // .map_while(|(block, balance_per_block)| { - // if acc_amount == >::default() { - // return None; - // } - // if acc_amount <= balance_per_block { - // let res = (block, balance_per_block - acc_amount, acc_amount); - // acc_amount = >::default(); - // return Some(res); - // } else { - // acc_amount -= balance_per_block; - // return Some((block, >::default(), acc_amount)); - // } - // }) - // .collect::>(); - - // new_state - // .into_iter() - // .for_each(|(block, to_staked, _to_pending)| { - // if to_staked == >::default() { - // >::remove((staker, block)); - // } else { - // >::insert((staker, block), to_staked); - // } - // }); - - // Ok(()) - // } - - // pub fn sponsor_collection(admin: T::AccountId, collection_id: u32) -> DispatchResult { - // Ok(()) - // } - - // pub fn stop_sponsorign_collection(admin: T::AccountId, collection_id: u32) -> DispatchResult { - // Ok(()) - // } - - pub fn sponsor_conract(admin: T::AccountId, app_id: u32) -> DispatchResult { - Ok(()) - } + #[pallet::weight(0)] + pub fn sponsor_conract(admin: OriginFor, contract_id: H160) -> DispatchResult { + let admin_id = ensure_signed(admin)?; + + ensure!( + admin_id == Admin::::get().ok_or(Error::::AdminNotSet)?, + Error::::NoPermission + ); + + T::ContractHandler::set_sponsor( + T::CrossAccountId::from_sub(Self::account_id()), + contract_id, + ) + } + + #[pallet::weight(0)] + pub fn stop_sponsorign_contract(admin: OriginFor, contract_id: H160) -> DispatchResult { + let admin_id = ensure_signed(admin)?; - pub fn stop_sponsorign_contract(admin: T::AccountId, app_id: u32) -> DispatchResult { - Ok(()) + ensure!( + admin_id == Admin::::get().ok_or(Error::::AdminNotSet)?, + Error::::NoPermission + ); + + ensure!( + T::ContractHandler::get_sponsor(contract_id)?.ok_or(>::InvalidArgument)? + == T::CrossAccountId::from_sub(Self::account_id()), + >::NoPermission + ); + T::ContractHandler::remove_contract_sponsor(contract_id) + } } +} +impl Pallet { pub fn account_id() -> T::AccountId { T::PalletId::get().into_account_truncating() } -} -impl Pallet { fn unlock_balance_unchecked(staker: &T::AccountId, amount: BalanceOf) { let mut locked_balance = Self::get_locked_balance(staker).map(|l| l.amount).unwrap(); locked_balance -= amount; diff --git a/pallets/app-promotion/src/types.rs b/pallets/app-promotion/src/types.rs index 3f06594efb..0f356e10a1 100644 --- a/pallets/app-promotion/src/types.rs +++ b/pallets/app-promotion/src/types.rs @@ -9,7 +9,7 @@ use pallet_unique::{Event as UniqueEvent, Error as UniqueError}; use sp_runtime::DispatchError; use up_data_structs::{CollectionId, SponsorshipState}; use sp_std::borrow::ToOwned; - +use pallet_evm_contract_helpers::{Pallet as EvmHelpersPallet, Config as EvmHelpersConfig, Sponsoring}; pub trait ExtendedLockableCurrency: LockableCurrency { fn locks(who: KArg) -> WeakBoundedVec, Self::MaxLocks> @@ -94,3 +94,40 @@ impl CollectionHandler for pallet_unique::Pallet { .map(|acc| acc.to_owned())) } } + +pub trait ContractHandler { + type ContractId; + type AccountId; + + fn set_sponsor(sponsor_id: Self::AccountId, contract_id: Self::ContractId) -> DispatchResult; + + fn remove_contract_sponsor(collection_id: Self::ContractId) -> DispatchResult; + + fn get_sponsor(contract_id: Self::ContractId) + -> Result, DispatchError>; +} + +impl ContractHandler for EvmHelpersPallet { + type ContractId = sp_core::H160; + + type AccountId = T::CrossAccountId; + + fn set_sponsor(sponsor_id: Self::AccountId, contract_id: Self::ContractId) -> DispatchResult { + Sponsoring::::insert( + contract_id, + SponsorshipState::::Confirmed(sponsor_id), + ); + Ok(()) + } + + fn remove_contract_sponsor(contract_id: Self::ContractId) -> DispatchResult { + Sponsoring::::remove(contract_id); + Ok(()) + } + + fn get_sponsor( + contract_id: Self::ContractId, + ) -> Result, DispatchError> { + Ok(Self::get_sponsor(contract_id)) + } +} diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index c539c54dcf..f7069fef28 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -75,7 +75,7 @@ pub mod pallet { /// * **Key** - contract address. /// * **Value** - sponsorship state. #[pallet::storage] - pub(super) type Sponsoring = StorageMap< + pub type Sponsoring = StorageMap< Hasher = Twox64Concat, Key = H160, Value = SponsorshipState, diff --git a/primitives/common/src/constants.rs b/primitives/common/src/constants.rs index 060353bd09..1a5eba72af 100644 --- a/primitives/common/src/constants.rs +++ b/primitives/common/src/constants.rs @@ -22,6 +22,7 @@ use frame_support::{ use crate::types::{BlockNumber, Balance}; pub const MILLISECS_PER_BLOCK: u64 = 12000; +pub const MILLISECS_PER_RELAY_BLOCK: u64 = 6000; pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; @@ -30,6 +31,11 @@ pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); pub const HOURS: BlockNumber = MINUTES * 60; pub const DAYS: BlockNumber = HOURS * 24; +// These time units are defined in number of relay blocks. +pub const RELAY_MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_RELAY_BLOCK as BlockNumber); +pub const RELAY_HOURS: BlockNumber = RELAY_MINUTES * 60; +pub const RELAY_DAYS: BlockNumber = RELAY_HOURS * 24; + pub const MICROUNIQUE: Balance = 1_000_000_000_000; pub const MILLIUNIQUE: Balance = 1_000 * MICROUNIQUE; pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE; diff --git a/runtime/common/config/pallets/app_promotion.rs b/runtime/common/config/pallets/app_promotion.rs index 1d0519fe63..d551967b11 100644 --- a/runtime/common/config/pallets/app_promotion.rs +++ b/runtime/common/config/pallets/app_promotion.rs @@ -16,28 +16,40 @@ use crate::{ runtime_common::config::pallets::{TreasuryAccountId, RelayChainBlockNumberProvider}, - Runtime, Balances, BlockNumber, Unique, Event, + Runtime, Balances, BlockNumber, Unique, Event, EvmContractHelpers, }; use frame_support::{parameter_types, PalletId}; use sp_arithmetic::Perbill; use up_common::{ - constants::{DAYS, UNIQUE}, + constants::{DAYS, UNIQUE, RELAY_DAYS}, types::Balance, }; +#[cfg(all(not(feature = "unique-runtime"), not(feature = "quartz-runtime")))] parameter_types! { pub const AppPromotionId: PalletId = PalletId(*b"appstake"); pub const RecalculationInterval: BlockNumber = 20; - pub const PendingInterval: BlockNumber = 10; + pub const PendingInterval: BlockNumber = 20; pub const Nominal: Balance = UNIQUE; pub const Day: BlockNumber = DAYS; - pub IntervalIncome: Perbill = Perbill::from_rational(RecalculationInterval::get(), 2 * DAYS) * Perbill::from_rational(5u32, 10_000); + pub IntervalIncome: Perbill = Perbill::from_rational(RecalculationInterval::get(), RELAY_DAYS) * Perbill::from_rational(5u32, 10_000); +} + +#[cfg(any(feature = "unique-runtime", feature = "quartz-runtime"))] +parameter_types! { + pub const AppPromotionId: PalletId = PalletId(*b"appstake"); + pub const RecalculationInterval: BlockNumber = RELAY_DAYS; + pub const PendingInterval: BlockNumber = 7 * RELAY_DAYS; + pub const Nominal: Balance = UNIQUE; + pub const Day: BlockNumber = RELAY_DAYS; + pub IntervalIncome: Perbill = Perbill::from_rational(5u32, 10_000); } impl pallet_app_promotion::Config for Runtime { type PalletId = AppPromotionId; type CollectionHandler = Unique; + type ContractHandler = EvmContractHelpers; type Currency = Balances; type WeightInfo = pallet_app_promotion::weights::SubstrateWeight; type TreasuryAccountId = TreasuryAccountId; diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 0417d6720e..595671f83a 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -706,6 +706,12 @@ describe('app-promotion rewards', () => { nominal = helper.balance.getOneTokenNominal(); }); }); + + after(async function () { + await usingPlaygrounds(async (helper) => { + await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.stopAppPromotion())); + }); + }); it('will credit 0.05% for staking period', async () => { // arrange: bob.stake(10000); @@ -770,39 +776,24 @@ describe('app-promotion rewards', () => { const staker = await createUser(40n * nominal); await waitForRecalculationBlock(helper.api!); - // const foo = await helper.api!.registry.getChainProperties(). + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.fulfilled; - // await waitNewBlocks(helper.api!, 1); + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.fulfilled; - // await waitNewBlocks(helper.api!, 1); + await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.fulfilled; - // console.log(await helper.balance.getSubstrate(staker.address)); - // await waitNewBlocks(helper.api!, 17); + await waitForRelayBlock(helper.api!, 34); expect((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))) .map(([_, amount]) => amount.toBigInt())) .to.be.deep.equal([calculateIncome(10n * nominal, 10n), calculateIncome(10n * nominal, 10n), calculateIncome(10n * nominal, 10n)]); - // console.log(await getBlockNumber(helper.api!)); - // console.log((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([block, amount]) => [block.toBigInt(), amount.toBigInt()])); - // console.log(`${calculateIncome(10n * nominal, 10n)} || ${calculateIncome(10n * nominal, 10n, 2)}`); - // await waitNewBlocks(helper.api!, 10); await waitForRelayBlock(helper.api!, 20); - // console.log((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt())); - // console.log(await helper.balance.getSubstrate(staker.address)); await expect(helper.signTransaction(staker, helper.api!.tx.promotion.unstake(calculateIncome(10n * nominal, 10n, 2) - 10n * nominal))).to.be.eventually.fulfilled; - // console.log(calculateIncome(10n * nominal, 10n, 2)); - // console.log(calculateIncome(10n * nominal, 10n, 3)); - // console.log(calculateIncome(10n * nominal, 10n, 4)); - // console.log(calculateIncome(10n * nominal, 10n, 5)); expect((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))) .map(([_, amount]) => amount.toBigInt())) .to.be.deep.equal([10n * nominal, calculateIncome(10n * nominal, 10n, 2), calculateIncome(10n * nominal, 10n, 2)]); - - // console.log((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt())); - - // console.log(await helper.balance.getSubstrate(staker.address)); }); }); diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index 1a5253aeb8..d4441be26c 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -78,7 +78,7 @@ declare module '@polkadot/api-base/types/consts' { **/ palletId: FrameSupportPalletId & AugmentedConst; /** - * In chain blocks. + * In relay blocks. **/ pendingInterval: u32 & AugmentedConst; /** diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index c7b3bc6aa1..93ed1d8244 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -430,11 +430,16 @@ declare module '@polkadot/api-base/types/errors' { [key: string]: AugmentedError; }; promotion: { + /** + * Error due to action requiring admin to be set + **/ AdminNotSet: AugmentedError; - AlreadySponsored: AugmentedError; + /** + * An error related to the fact that an invalid argument was passed to perform an action + **/ InvalidArgument: AugmentedError; /** - * No permission to perform action + * No permission to perform an action **/ NoPermission: AugmentedError; /** diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 66c5c89678..5ebf8f1bdb 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -525,7 +525,7 @@ declare module '@polkadot/api-base/types/storage' { **/ staked: AugmentedQuery Observable, [AccountId32, u32]> & QueryableStorageEntry; /** - * A block when app-promotion has started + * A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`. **/ startBlock: AugmentedQuery Observable, []> & QueryableStorageEntry; totalStaked: AugmentedQuery Observable, []> & QueryableStorageEntry; diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index ae1d66b218..ed42321155 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -365,9 +365,12 @@ declare module '@polkadot/api-base/types/submittable' { promotion: { setAdminAddress: AugmentedSubmittable<(admin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic, [PalletEvmAccountBasicCrossAccountIdRepr]>; sponsorCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; + sponsorConract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; stake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; startAppPromotion: AugmentedSubmittable<(promotionStartRelayBlock: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; + stopAppPromotion: AugmentedSubmittable<() => SubmittableExtrinsic, []>; stopSponsorignCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; + stopSponsorignContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; unstake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; /** * Generic tx diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 495359fb81..644ba5c7d1 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -816,6 +816,7 @@ export interface PalletAppPromotionCall extends Enum { readonly asStartAppPromotion: { readonly promotionStartRelayBlock: Option; } & Struct; + readonly isStopAppPromotion: boolean; readonly isStake: boolean; readonly asStake: { readonly amount: u128; @@ -832,7 +833,15 @@ export interface PalletAppPromotionCall extends Enum { readonly asStopSponsorignCollection: { readonly collectionId: u32; } & Struct; - readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsorignCollection'; + readonly isSponsorConract: boolean; + readonly asSponsorConract: { + readonly contractId: H160; + } & Struct; + readonly isStopSponsorignContract: boolean; + readonly asStopSponsorignContract: { + readonly contractId: H160; + } & Struct; + readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'StopAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsorignCollection' | 'SponsorConract' | 'StopSponsorignContract'; } /** @name PalletAppPromotionError */ @@ -841,8 +850,7 @@ export interface PalletAppPromotionError extends Enum { readonly isNoPermission: boolean; readonly isNotSufficientFounds: boolean; readonly isInvalidArgument: boolean; - readonly isAlreadySponsored: boolean; - readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'InvalidArgument' | 'AlreadySponsored'; + readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'InvalidArgument'; } /** @name PalletAppPromotionEvent */ diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index fe0169f63d..41628940ad 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -2463,6 +2463,7 @@ export default { start_app_promotion: { promotionStartRelayBlock: 'Option', }, + stop_app_promotion: 'Null', stake: { amount: 'u128', }, @@ -2473,7 +2474,13 @@ export default { collectionId: 'u32', }, stop_sponsorign_collection: { - collectionId: 'u32' + collectionId: 'u32', + }, + sponsor_conract: { + contractId: 'H160', + }, + stop_sponsorign_contract: { + contractId: 'H160' } } }, @@ -3098,7 +3105,7 @@ export default { * Lookup410: pallet_app_promotion::pallet::Error **/ PalletAppPromotionError: { - _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFounds', 'InvalidArgument', 'AlreadySponsored'] + _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFounds', 'InvalidArgument'] }, /** * Lookup413: pallet_evm::pallet::Error diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 3305bd3476..094599580c 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -2669,6 +2669,7 @@ declare module '@polkadot/types/lookup' { readonly asStartAppPromotion: { readonly promotionStartRelayBlock: Option; } & Struct; + readonly isStopAppPromotion: boolean; readonly isStake: boolean; readonly asStake: { readonly amount: u128; @@ -2685,7 +2686,15 @@ declare module '@polkadot/types/lookup' { readonly asStopSponsorignCollection: { readonly collectionId: u32; } & Struct; - readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsorignCollection'; + readonly isSponsorConract: boolean; + readonly asSponsorConract: { + readonly contractId: H160; + } & Struct; + readonly isStopSponsorignContract: boolean; + readonly asStopSponsorignContract: { + readonly contractId: H160; + } & Struct; + readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'StopAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsorignCollection' | 'SponsorConract' | 'StopSponsorignContract'; } /** @name PalletEvmCall (305) */ @@ -3288,8 +3297,7 @@ declare module '@polkadot/types/lookup' { readonly isNoPermission: boolean; readonly isNotSufficientFounds: boolean; readonly isInvalidArgument: boolean; - readonly isAlreadySponsored: boolean; - readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'InvalidArgument' | 'AlreadySponsored'; + readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'InvalidArgument'; } /** @name PalletEvmError (413) */ From ac1baa6db9e90d52ef6fed64ac36edab52a9df04 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Fri, 26 Aug 2022 12:52:11 +0000 Subject: [PATCH 0625/1274] add playgrounds and fix test --- tests/src/app-promotion.test.ts | 53 ++++++++++------------------ tests/src/util/playgrounds/unique.ts | 33 +++++++++++++++++ 2 files changed, 51 insertions(+), 35 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 595671f83a..1a89132dfd 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -14,36 +14,20 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {default as usingApi, submitTransactionAsync} from './substrate/substrate-api'; -import {IKeyringPair, ITuple} from '@polkadot/types/types'; +import {IKeyringPair} from '@polkadot/types/types'; import { - createMultipleItemsExpectSuccess, - isTokenExists, - getLastTokenId, - getAllowance, - approve, - transferFrom, - createCollection, - transfer, - burnItem, normalizeAccountId, - CrossAccountId, - createFungibleItemExpectSuccess, - U128_MAX, - burnFromExpectSuccess, - UNIQUE, getModuleNames, Pallets, - getBlockNumber, } from './util/helpers'; -import chai, {use} from 'chai'; +import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; import {usingPlaygrounds} from './util/playgrounds'; import {default as waitNewBlocks} from './substrate/wait-new-blocks'; -import {encodeAddress, hdEthereum, mnemonicGenerate} from '@polkadot/util-crypto'; +import {encodeAddress, mnemonicGenerate} from '@polkadot/util-crypto'; import {stringToU8a} from '@polkadot/util'; import {UniqueHelper} from './util/playgrounds/unique'; import {ApiPromise} from '@polkadot/api'; @@ -81,26 +65,25 @@ describe('app-promotions.stake extrinsic', () => { // assert: query appPromotion.staked(Alice) equal [100, 200] // assert: query appPromotion.totalStaked() increased by 200 - await usingPlaygrounds(async (helper, privateKeyWrapper) => { - const totalStakedBefore = (await helper.api!.rpc.unique.totalStaked()).toBigInt(); + await usingPlaygrounds(async (helper) => { + const totalStakedBefore = await helper.staking.getTotalStaked(); const staker = await createUser(); + await expect(helper.staking.stake(staker, nominal - 1n)).to.be.eventually.rejected; + await expect(helper.staking.stake(staker, nominal * 1n)).to.be.eventually.fulfilled; + expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(nominal); + + // TODO add helpers to assert bigints. Check balance close to 10 + expect(await helper.balance.getSubstrate(staker.address) - 9n * nominal >= (nominal / 2n)).to.be.true; + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(nominal); + expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + nominal); + + await helper.arrange.waitNewBlocks(1); + await expect(helper.staking.stake(staker, 2n * nominal)).to.be.eventually.fulfilled; + expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(3n * nominal); - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(nominal / 2n))).to.be.eventually.rejected; - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(1n * nominal))).to.be.eventually.fulfilled; - expect((await helper.api!.rpc.unique.totalStakingLocked(normalizeAccountId(staker))).toBigInt()).to.be.equal(nominal); - expect(9n * nominal - await helper.balance.getSubstrate(staker.address) <= nominal / 2n).to.be.true; - expect((await helper.api!.rpc.unique.totalStaked(normalizeAccountId(staker))).toBigInt()).to.be.equal(nominal); - expect((await helper.api!.rpc.unique.totalStaked()).toBigInt()).to.be.equal(totalStakedBefore + nominal); - - await waitNewBlocks(helper.api!, 1); - - - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(2n * nominal))).to.be.eventually.fulfilled; - expect((await helper.api!.rpc.unique.totalStakingLocked(normalizeAccountId(staker))).toBigInt()).to.be.equal(3n * nominal); - - const stakedPerBlock = (await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([block, amount]) => [block.toBigInt(), amount.toBigInt()]); + const stakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); expect(stakedPerBlock.map((x) => x[1])).to.be.deep.equal([nominal, 2n * nominal]); }); }); diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 0c2aabe759..c15d3f24a2 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -1979,6 +1979,37 @@ class AddressGroup extends HelperGroup { } } +class StakingGroup extends HelperGroup { + /** + * Stake tokens for App Promotion + * @param signer keyring of signer + * @param amount amount of tokens to stake + * @param label extra label for log + */ + async stake(signer: TSigner, amount: bigint, label?: string): Promise { + if(typeof label === 'undefined') label = `${signer.address} amount: ${amount}`; + const stakeResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.promotion.stake', [amount], + true, `stake failed for ${label}`, + ); + // TODO extract info from events + return true; + } + + async getTotalStaked(address?: ICrossAccountId): Promise { + if (address) return (await this.helper.callRpc('api.rpc.unique.totalStaked', [address])).toBigInt(); + return (await this.helper.callRpc('api.rpc.unique.totalStaked')).toBigInt(); + } + + async getTotalStakingLocked(address: ICrossAccountId): Promise { + return (await this.helper.callRpc('api.rpc.unique.totalStakingLocked', [address])).toBigInt(); + } + + async getTotalStakedPerBlock(address: ICrossAccountId): Promise { + return (await this.helper.callRpc('api.rpc.unique.totalStakedPerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]); + } +} export class UniqueHelper extends ChainHelperBase { chain: ChainGroup; @@ -1988,6 +2019,7 @@ export class UniqueHelper extends ChainHelperBase { nft: NFTGroup; rft: RFTGroup; ft: FTGroup; + staking: StakingGroup; constructor(logger?: ILogger) { super(logger); @@ -1998,6 +2030,7 @@ export class UniqueHelper extends ChainHelperBase { this.nft = new NFTGroup(this); this.rft = new RFTGroup(this); this.ft = new FTGroup(this); + this.staking = new StakingGroup(this); } } From 0095393c2f8909af2371f3fede12bc2e5be0abe4 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Sat, 27 Aug 2022 08:37:20 +0000 Subject: [PATCH 0626/1274] Add helpers and refactor some tests --- tests/src/app-promotion.test.ts | 144 ++++++++------------------- tests/src/util/playgrounds/unique.ts | 33 +++++- 2 files changed, 68 insertions(+), 109 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 1a89132dfd..2905bdc750 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -16,7 +16,6 @@ import {IKeyringPair} from '@polkadot/types/types'; import { - normalizeAccountId, getModuleNames, Pallets, @@ -29,7 +28,6 @@ import {default as waitNewBlocks} from './substrate/wait-new-blocks'; import {encodeAddress, mnemonicGenerate} from '@polkadot/util-crypto'; import {stringToU8a} from '@polkadot/util'; -import {UniqueHelper} from './util/playgrounds/unique'; import {ApiPromise} from '@polkadot/api'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -40,46 +38,34 @@ let palletAdmin: IKeyringPair; let nominal: bigint; let promotionStartBlock: number | null = null; -describe('app-promotions.stake extrinsic', () => { - before(async function() { - await usingPlaygrounds(async (helper, privateKeyWrapper) => { - if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - palletAdmin = privateKeyWrapper('//palletAdmin'); - const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); - nominal = helper.balance.getOneTokenNominal(); - await helper.signTransaction(alice, tx); - }); +before(async function () { + await usingPlaygrounds(async (helper, privateKeyWrapper) => { + if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); + alice = privateKeyWrapper('//Alice'); + bob = privateKeyWrapper('//Bob'); + palletAdmin = privateKeyWrapper('//palletAdmin'); + const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); + await helper.signTransaction(alice, tx); + nominal = helper.balance.getOneTokenNominal(); }); +}); + +describe('app-promotions.stake extrinsic', () => { it('will change balance state to "locked", add it to "staked" map, and increase "totalStaked" amount', async () => { - // arrange: Alice balance = 1000 - // act: Alice calls appPromotion.stake(100) - // assert: Alice locked balance equal 100 - // assert: Alice free balance closeTo 900 - // assert: query appPromotion.staked(Alice) equal [100] - // assert: query appPromotion.totalStaked() increased by 100 - // act: Alice extrinsic appPromotion.stake(200) - - // assert: Alice locked balance equal 300 - // assert: query appPromotion.staked(Alice) equal [100, 200] - // assert: query appPromotion.totalStaked() increased by 200 - await usingPlaygrounds(async (helper) => { const totalStakedBefore = await helper.staking.getTotalStaked(); - const staker = await createUser(); + const [staker] = await helper.arrange.creteAccounts([10n], alice); - await expect(helper.staking.stake(staker, nominal - 1n)).to.be.eventually.rejected; - await expect(helper.staking.stake(staker, nominal * 1n)).to.be.eventually.fulfilled; + await expect(helper.staking.stake(staker, nominal - 1n)).to.be.eventually.rejected; // minimum stake amount is 1 + await expect(helper.staking.stake(staker, nominal)).to.be.eventually.fulfilled; expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(nominal); // TODO add helpers to assert bigints. Check balance close to 10 expect(await helper.balance.getSubstrate(staker.address) - 9n * nominal >= (nominal / 2n)).to.be.true; expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(nominal); - expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + nominal); + // it is potentially flaky test. Promotion can credited some tokens. Maybe we need to use closeTo? + expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + nominal); // total tokens amount staked in app-promotion increased - await helper.arrange.waitNewBlocks(1); - await expect(helper.staking.stake(staker, 2n * nominal)).to.be.eventually.fulfilled; expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(3n * nominal); @@ -89,73 +75,42 @@ describe('app-promotions.stake extrinsic', () => { }); it('will throws if stake amount is more than total free balance', async () => { - // arrange: Alice balance = 1000 - // assert: Alice calls appPromotion.stake(1000) throws /// because Alice needs some fee - - // act: Alice calls appPromotion.stake(700) - // assert: Alice calls appPromotion.stake(400) throws /// because Alice has ~300 free QTZ and 700 locked - await usingPlaygrounds(async helper => { - - const staker = await createUser(); - - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.rejected; - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(7n * nominal))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(4n * nominal))).to.be.eventually.rejected; - + const [staker] = await helper.arrange.creteAccounts([10n], alice); + + await expect(helper.staking.stake(staker, 10n * nominal)).to.be.eventually.rejected; // because Alice needs some fee + await expect(helper.staking.stake(staker, 7n * nominal)).to.be.eventually.fulfilled; + await expect(helper.staking.stake(staker, 4n * nominal)).to.be.eventually.rejected; // because Alice has ~300 free QTZ and 700 locked + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(7n * nominal); }); }); it('for different accounts in one block is possible', async () => { - // arrange: Alice, Bob, Charlie, Dave balance = 1000 - // arrange: Alice, Bob, Charlie, Dave calls appPromotion.stake(100) in the same time - - // assert: query appPromotion.staked(Alice/Bob/Charlie/Dave) equal [100] await usingPlaygrounds(async helper => { - const crowd = []; - for(let i = 4; i--;) crowd.push(await createUser()); + const crowd = await helper.arrange.creteAccounts([10n, 10n, 10n, 10n], alice); - const promises = crowd.map(async user => helper.signTransaction(user, helper.api!.tx.promotion.stake(nominal))); - await expect(Promise.all(promises)).to.be.eventually.fulfilled; - - for (let i = 0; i < crowd.length; i++){ - expect((await helper.api!.rpc.unique.totalStaked(normalizeAccountId(crowd[i]))).toBigInt()).to.be.equal(nominal); - } + const crowdStartsToStake = crowd.map(user => helper.staking.stake(user, nominal)); + await expect(Promise.all(crowdStartsToStake)).to.be.eventually.fulfilled; + + const crowdStakes = await Promise.all(crowd.map(address => helper.staking.getTotalStaked({Substrate: address.address}))); + expect(crowdStakes).to.deep.equal([nominal, nominal, nominal, nominal]); }); }); - + // TODO it('Staker stakes 5 times in one block with nonce'); + // TODO it('Staked balance appears as locked in the balance pallet') }); -describe('unstake balance extrinsic', () => { - before(async function () { - await usingPlaygrounds(async (helper, privateKeyWrapper) => { - if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - palletAdmin = privateKeyWrapper('//palletAdmin'); - const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); - nominal = helper.balance.getOneTokenNominal(); - await helper.signTransaction(alice, tx); - }); - }); - +describe('unstake balance extrinsic', () => { it('will change balance state to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => { - // arrange: Alice balance = 1000 - // arrange: Alice calls appPromotion.stake(Alice, 500) - - // act: Alice calls appPromotion.unstake(300) - // assert: Alice reserved balance to equal 300 - // assert: query appPromotion.staked(Alice) equal [200] /// 500 - 300 - // assert: query appPromotion.pendingUnstake(Alice) to equal [300] - // assert: query appPromotion.totalStaked() decreased by 300 await usingPlaygrounds(async helper => { - const totalStakedBefore = (await helper.api!.rpc.unique.totalStaked()).toBigInt(); - const staker = await createUser(); - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(5n * nominal))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.unstake(3n * nominal))).to.be.eventually.fulfilled; - expect((await helper.api!.rpc.unique.pendingUnstake(normalizeAccountId(staker.address))).toBigInt()).to.be.equal(3n * nominal); - expect((await helper.api!.rpc.unique.totalStaked(normalizeAccountId(staker))).toBigInt()).to.be.equal(2n * nominal); - expect((await helper.api!.rpc.unique.totalStaked()).toBigInt()).to.be.equal(totalStakedBefore + 2n * nominal); + const totalStakedBefore = await helper.staking.getTotalStaked(); + const [staker] = await helper.arrange.creteAccounts([10n], alice); + await expect(helper.staking.stake(staker, 5n * nominal)).to.be.eventually.fulfilled; + await expect(helper.staking.unstake(staker, 3n * nominal)).to.be.eventually.fulfilled; + + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(3n * nominal); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(2n * nominal); + expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + 2n * nominal); }); }); it('will remove from the "staked" map starting from the oldest entry', async () => { @@ -837,22 +792,3 @@ async function createUser(amount?: bigint) { return user; }); } - -const creteAccounts = async (balances: bigint[], donor: IKeyringPair, helper: UniqueHelper) => { - let nonce = await helper.chain.getNonce(donor.address); - const tokenNominal = helper.balance.getOneTokenNominal(); - const transactions = []; - const accounts = []; - for (const balance of balances) { - const recepient = helper.util.fromSeed(mnemonicGenerate()); - accounts.push(recepient); - if (balance !== 0n){ - const tx = helper.constructApiCall('api.tx.balances.transfer', [{Id: recepient.address}, balance * tokenNominal]); - transactions.push(helper.signTransaction(donor, tx, 'account generation', {nonce})); - nonce++; - } - } - - await Promise.all(transactions); - return accounts; -}; \ No newline at end of file diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index c15d3f24a2..9841a6fc70 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -1983,17 +1983,36 @@ class StakingGroup extends HelperGroup { /** * Stake tokens for App Promotion * @param signer keyring of signer - * @param amount amount of tokens to stake + * @param amountToStake amount of tokens to stake * @param label extra label for log + * @returns */ - async stake(signer: TSigner, amount: bigint, label?: string): Promise { - if(typeof label === 'undefined') label = `${signer.address} amount: ${amount}`; + async stake(signer: TSigner, amountToStake: bigint, label?: string): Promise { + if(typeof label === 'undefined') label = `${signer.address} amount: ${amountToStake}`; const stakeResult = await this.helper.executeExtrinsic( signer, - 'api.tx.promotion.stake', [amount], + 'api.tx.promotion.stake', [amountToStake], true, `stake failed for ${label}`, ); - // TODO extract info from events + // TODO extract info from stakeResult + return true; + } + + /** + * Unstake tokens for App Promotion + * @param signer keyring of signer + * @param amountToUnstake amount of tokens to unstake + * @param label extra label for log + * @returns + */ + async unstake(signer: TSigner, amountToUnstake: bigint, label?: string): Promise { + if(typeof label === 'undefined') label = `${signer.address} amount: ${amountToUnstake}`; + const unstakeResult = await this.helper.executeExtrinsic( + signer, + 'api.tx.promotion.unstake', [amountToUnstake], + true, `unstake failed for ${label}`, + ); + // TODO extract info from unstakeResult return true; } @@ -2009,6 +2028,10 @@ class StakingGroup extends HelperGroup { async getTotalStakedPerBlock(address: ICrossAccountId): Promise { return (await this.helper.callRpc('api.rpc.unique.totalStakedPerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]); } + + async getPendingUnstake(address: ICrossAccountId): Promise { + return (await this.helper.callRpc('api.rpc.unique.pendingUnstake')).toBigInt(); + } } export class UniqueHelper extends ChainHelperBase { From 160555a5ac1e633748ddd6173c7644d1f390cb56 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Sat, 27 Aug 2022 10:07:32 +0000 Subject: [PATCH 0627/1274] Fix helpers, refactor tests, and add tests TODOs --- tests/src/app-promotion.test.ts | 117 ++++++++++++++------------- tests/src/util/playgrounds/unique.ts | 6 +- 2 files changed, 64 insertions(+), 59 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 2905bdc750..6a7d6f065f 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -24,7 +24,6 @@ import { import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; import {usingPlaygrounds} from './util/playgrounds'; -import {default as waitNewBlocks} from './substrate/wait-new-blocks'; import {encodeAddress, mnemonicGenerate} from '@polkadot/util-crypto'; import {stringToU8a} from '@polkadot/util'; @@ -56,8 +55,9 @@ describe('app-promotions.stake extrinsic', () => { const totalStakedBefore = await helper.staking.getTotalStaked(); const [staker] = await helper.arrange.creteAccounts([10n], alice); - await expect(helper.staking.stake(staker, nominal - 1n)).to.be.eventually.rejected; // minimum stake amount is 1 - await expect(helper.staking.stake(staker, nominal)).to.be.eventually.fulfilled; + // Minimum stake amount is 1: + await expect(helper.staking.stake(staker, nominal - 1n)).to.be.eventually.rejected; + await helper.staking.stake(staker, nominal); expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(nominal); // TODO add helpers to assert bigints. Check balance close to 10 @@ -66,11 +66,11 @@ describe('app-promotions.stake extrinsic', () => { // it is potentially flaky test. Promotion can credited some tokens. Maybe we need to use closeTo? expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + nominal); // total tokens amount staked in app-promotion increased - await expect(helper.staking.stake(staker, 2n * nominal)).to.be.eventually.fulfilled; + await helper.staking.stake(staker, 2n * nominal); expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(3n * nominal); - const stakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - expect(stakedPerBlock.map((x) => x[1])).to.be.deep.equal([nominal, 2n * nominal]); + const stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map((x) => x[1]); + expect(stakedPerBlock).to.be.deep.equal([nominal, 2n * nominal]); }); }); @@ -78,9 +78,12 @@ describe('app-promotions.stake extrinsic', () => { await usingPlaygrounds(async helper => { const [staker] = await helper.arrange.creteAccounts([10n], alice); - await expect(helper.staking.stake(staker, 10n * nominal)).to.be.eventually.rejected; // because Alice needs some fee - await expect(helper.staking.stake(staker, 7n * nominal)).to.be.eventually.fulfilled; - await expect(helper.staking.stake(staker, 4n * nominal)).to.be.eventually.rejected; // because Alice has ~300 free QTZ and 700 locked + // Can't stake full balance because Alice needs to pay some fee + await expect(helper.staking.stake(staker, 10n * nominal)).to.be.eventually.rejected; + await helper.staking.stake(staker, 7n * nominal); + + // Can't stake 4 tkn because Alice has ~3 free tkn, and 7 locked + await expect(helper.staking.stake(staker, 4n * nominal)).to.be.eventually.rejected; expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(7n * nominal); }); }); @@ -97,7 +100,9 @@ describe('app-promotions.stake extrinsic', () => { }); }); // TODO it('Staker stakes 5 times in one block with nonce'); - // TODO it('Staked balance appears as locked in the balance pallet') + // TODO it('Staked balance appears as locked in the balance pallet'); + // TODO it('Alice stakes huge amount of tokens'); + // TODO it('Can stake from ethereum account') }); describe('unstake balance extrinsic', () => { @@ -105,66 +110,62 @@ describe('unstake balance extrinsic', () => { await usingPlaygrounds(async helper => { const totalStakedBefore = await helper.staking.getTotalStaked(); const [staker] = await helper.arrange.creteAccounts([10n], alice); - await expect(helper.staking.stake(staker, 5n * nominal)).to.be.eventually.fulfilled; - await expect(helper.staking.unstake(staker, 3n * nominal)).to.be.eventually.fulfilled; + await helper.staking.stake(staker, 5n * nominal); + await helper.staking.unstake(staker, 3n * nominal); expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(3n * nominal); expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(2n * nominal); expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + 2n * nominal); }); }); - it('will remove from the "staked" map starting from the oldest entry', async () => { - // arrange: Alice balance = 1000 - // arrange: Alice stakes 100 - // arrange: Alice stakes 200 - // arrange: Alice stakes 300 - - // assert Alice stake is [100, 200, 300] - - // act: Alice calls appPromotion.unstake(30) - // assert: query appPromotion.staked(Alice) to equal [70, 200, 300] /// Can unstake part of stake - // assert: query appPromotion.pendingUnstake(Alice) to equal [30] - - // act: Alice calls appPromotion.unstake(170) - // assert: query appPromotion.staked(Alice) to equal [100, 300] /// Can unstake one stake totally and one more partialy - // assert: query appPromotion.pendingUnstake(Alice) to equal [30, 170] - - // act: Alice calls appPromotion.unstake(400) - // assert: query appPromotion.staked(Alice) to equal [100, 300] /// Can totally unstake 2 stakes in one tx - // assert: query appPromotion.pendingUnstake(Alice) to equal [30, 170, 400] + it('will remove from the "staked" map starting from the oldest entry', async () => { await usingPlaygrounds(async helper => { - const totalStakedBefore = (await helper.api!.rpc.unique.totalStaked()).toBigInt(); - const staker = await createUser(); - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(1n * nominal))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(2n * nominal))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(3n * nominal))).to.be.eventually.fulfilled; - let stakedPerBlock = (await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt()); - expect(stakedPerBlock).to.be.deep.equal([nominal, 2n * nominal, 3n * nominal]); - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.unstake(3n * nominal / 10n))).to.be.eventually.fulfilled; - expect((await helper.api!.rpc.unique.pendingUnstake(normalizeAccountId(staker.address))).toBigInt()).to.be.equal(3n * nominal / 10n); - stakedPerBlock = (await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt()); - - expect(stakedPerBlock).to.be.deep.equal([7n * nominal / 10n, 2n * nominal, 3n * nominal]); - - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.unstake(17n * nominal / 10n))).to.be.eventually.fulfilled; - stakedPerBlock = (await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt()); - expect(stakedPerBlock).to.be.deep.equal([nominal, 3n * nominal]); - const unstakedPerBlock = (await helper.api!.rpc.unique.pendingUnstakePerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt()); - - expect(unstakedPerBlock).to.be.deep.equal([3n * nominal / 10n, 17n * nominal / 10n]); - - await waitNewBlocks(helper.api!, 1); - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.unstake(4n * nominal))).to.be.eventually.fulfilled; - expect((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt())).to.be.deep.equal([]); - expect((await helper.api!.rpc.unique.pendingUnstakePerBlock(normalizeAccountId(staker))).map(([_, amount]) => amount.toBigInt())).to.be.deep.equal([3n * nominal / 10n, 17n * nominal / 10n, 4n * nominal]); + const [staker] = await helper.arrange.creteAccounts([100n], alice); + await helper.staking.stake(staker, 10n * nominal); + await helper.staking.stake(staker, 20n * nominal); + await helper.staking.stake(staker, 30n * nominal); + + // staked: [10, 20, 30]; unstaked: 0 + let pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); + let unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]); + let stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]); + expect(pendingUnstake).to.be.deep.equal(0n); + expect(unstakedPerBlock).to.be.deep.equal([]); + expect(stakedPerBlock).to.be.deep.equal([10n * nominal, 20n * nominal, 30n * nominal]); + + // Can unstake the part of a stake + await helper.staking.unstake(staker, 5n * nominal); + pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); + unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]); + stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]); + expect(pendingUnstake).to.be.equal(5n * nominal); + expect(stakedPerBlock).to.be.deep.equal([5n * nominal, 20n * nominal, 30n * nominal]); + expect(unstakedPerBlock).to.be.deep.equal([5n * nominal]); + + // Can unstake one stake totally and one more partially + await helper.staking.unstake(staker, 10n * nominal); + pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); + unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]); + stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]); + expect(pendingUnstake).to.be.equal(15n * nominal); + expect(stakedPerBlock).to.be.deep.equal([15n * nominal, 30n * nominal]); + expect(unstakedPerBlock).to.deep.equal([5n * nominal, 10n * nominal]); + + // Can totally unstake 2 stakes in one tx + await helper.staking.unstake(staker, 45n * nominal); + pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); + unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]); + stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]); + expect(pendingUnstake).to.be.equal(60n * nominal); + expect(stakedPerBlock).to.deep.equal([]); + expect(unstakedPerBlock).to.deep.equal([5n * nominal, 10n * nominal, 45n * nominal]); }); - + + // TODO it('try to hack unstaking with nonce') }); }); - - describe('Admin adress', () => { before(async function () { await usingPlaygrounds(async (helper, privateKeyWrapper) => { diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 9841a6fc70..a6b30affb4 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -2030,7 +2030,11 @@ class StakingGroup extends HelperGroup { } async getPendingUnstake(address: ICrossAccountId): Promise { - return (await this.helper.callRpc('api.rpc.unique.pendingUnstake')).toBigInt(); + return (await this.helper.callRpc('api.rpc.unique.pendingUnstake', [address])).toBigInt(); + } + + async getPendingUnstakePerBlock(address: ICrossAccountId): Promise { + return (await this.helper.callRpc('api.rpc.unique.pendingUnstakePerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]); } } From 8ee00409a0372edcbc3154cc434fe92edcd3e02c Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Sun, 28 Aug 2022 20:27:04 +0000 Subject: [PATCH 0628/1274] Add missing tests --- tests/src/app-promotion.test.ts | 140 ++++++++++++++++++-------------- 1 file changed, 79 insertions(+), 61 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 6a7d6f065f..92f7c5e993 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -43,8 +43,7 @@ before(async function () { alice = privateKeyWrapper('//Alice'); bob = privateKeyWrapper('//Bob'); palletAdmin = privateKeyWrapper('//palletAdmin'); - const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); - await helper.signTransaction(alice, tx); + await helper.balance.transferToSubstrate(alice, palletAdmin.address, 10n * helper.balance.getOneTokenNominal()); nominal = helper.balance.getOneTokenNominal(); }); }); @@ -161,86 +160,104 @@ describe('unstake balance extrinsic', () => { expect(stakedPerBlock).to.deep.equal([]); expect(unstakedPerBlock).to.deep.equal([5n * nominal, 10n * nominal, 45n * nominal]); }); - - // TODO it('try to hack unstaking with nonce') }); -}); -describe('Admin adress', () => { - before(async function () { - await usingPlaygrounds(async (helper, privateKeyWrapper) => { - if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - palletAdmin = privateKeyWrapper('//palletAdmin'); - await helper.balance.transferToSubstrate(alice, palletAdmin.address, 10n * helper.balance.getOneTokenNominal()); - const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); - - await helper.signTransaction(alice, tx); + it('should reject transaction if unstake amount is greater than staked', async () => { + await usingPlaygrounds(async (helper) => { + const [staker] = await helper.arrange.creteAccounts([10n], alice); - nominal = helper.balance.getOneTokenNominal(); + // can't unstsake more than one stake amount + await helper.staking.stake(staker, 1n * nominal); + await expect(helper.staking.unstake(staker, 1n * nominal + 1n)).to.be.eventually.rejected; + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(0n); + expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(1n * nominal); + + // can't unstsake more than two stakes amount + await helper.staking.stake(staker, 1n * nominal); + await expect(helper.staking.unstake(staker, 2n * nominal + 1n)).to.be.eventually.rejected; + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(0n); + expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(2n * nominal); + + // can't unstake more than have with nonce // TODO not sure we need this assertion + const nonce1 = await helper.chain.getNonce(staker.address); + const nonce2 = nonce1 + 1; + const unstakeMoreThanHaveWithNonce = Promise.all([ + helper.signTransaction(staker, helper.constructApiCall('api.tx.promotion.unstake', [1n * nominal]), 'unstaking 1', {nonce: nonce1}), + helper.signTransaction(staker, helper.constructApiCall('api.tx.promotion.unstake', [1n * nominal + 1n]), 'unstaking 1+', {nonce: nonce2}), + ]); + await expect(unstakeMoreThanHaveWithNonce).to.be.rejected; + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(1n * nominal); + }); + }); + + it('should allow to unstake even smallest unit', async () => { + await usingPlaygrounds(async (helper) => { + const [staker] = await helper.arrange.creteAccounts([10n], alice); + await helper.staking.stake(staker, nominal); + // unstake .000...001 is possible + await helper.staking.unstake(staker, 1n); + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(1n); }); }); + it('should work fine if stake amount is smallest unit', async () => { + await usingPlaygrounds(async (helper) => { + const [staker] = await helper.arrange.creteAccounts([10n], alice); + await helper.staking.stake(staker, nominal); + await helper.staking.unstake(staker, nominal - 1n); + await waitForRecalculationBlock(helper.api!); + + // Everything fine, blockchain alive + await helper.nft.mintCollection(staker, {name: 'name', description: 'description', tokenPrefix: 'prefix'}); + }); + }); + + // TODO will return balance to "available" state after the period of unstaking is finished, and subtract it from "pendingUnstake + // TODO for different accounts in one block is possible +}); + +describe('Admin adress', () => { it('can be set by sudo only', async () => { - // assert: Sudo calls appPromotion.setAdminAddress(Alice) /// Sudo successfully sets Alice as admin - // assert: Bob calls appPromotion.setAdminAddress(Bob) throws /// Random account can not set admin - // assert: Alice calls appPromotion.setAdminAddress(Bob) throws /// Admin account can not set admin await usingPlaygrounds(async (helper) => { - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(alice))))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(bob, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(bob))))).to.be.eventually.rejected; - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(bob))))).to.be.eventually.fulfilled; + // Bob can not set admin not from himself nor as a sudo + await expect(helper.signTransaction(bob, helper.api!.tx.promotion.setAdminAddress({Substrate: bob.address}))).to.be.eventually.rejected; + await expect(helper.signTransaction(bob, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: bob.address})))).to.be.eventually.rejected; + + // Alice can + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled; }); - }); it('can be any valid CrossAccountId', async () => { - /// We are not going to set an eth address as a sponsor, - /// but we do want to check, it doesn't break anything; - - // arrange: Charlie creates Punks - // arrange: Sudo calls appPromotion.setAdminAddress(0x0...) success - // arrange: Sudo calls appPromotion.setAdminAddress(Alice) success - - // assert: Alice calls appPromotion.sponsorCollection(Punks.id) success - + // We are not going to set an eth address as a sponsor, + // but we do want to check, it doesn't break anything; await usingPlaygrounds(async (helper) => { - - const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; - - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(ethAcc)))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))))).to.be.eventually.fulfilled; - - const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; + const [charlie] = await helper.arrange.creteAccounts([10n], alice); + const ethCharlie = helper.address.substrateToEth(charlie.address); + // Alice sets Ethereum address as a sudo. Then Substrate address back... + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Ethereum: ethCharlie})))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled; + + // ...It doesn't break anything; + console.log(await helper.balance.getSubstrate(charlie.address)); + console.log(await helper.balance.getSubstrate(palletAdmin.address)); + const collection = await helper.nft.mintCollection(charlie, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + await expect(helper.signTransaction(charlie, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; }); - }); it('can be reassigned', async () => { - // arrange: Charlie creates Punks - // arrange: Sudo calls appPromotion.setAdminAddress(Alice) - // act: Sudo calls appPromotion.setAdminAddress(Bob) - - // assert: Alice calls appPromotion.sponsorCollection(Punks.id) throws /// Alice can not set collection sponsor - // assert: Bob calls appPromotion.sponsorCollection(Punks.id) successful /// Bob can set collection sponsor - - // act: Sudo calls appPromotion.setAdminAddress(null) successful /// Sudo can set null as a sponsor - // assert: Bob calls appPromotion.stopSponsoringCollection(Punks.id) throws /// Bob is no longer an admin - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + const [oldAdmin, newAdmin, collectionOwner] = await helper.arrange.creteAccounts([10n, 10n, 10n], alice); + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(alice))))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(bob))))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(alice, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(oldAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; - await expect(helper.signTransaction(bob, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(newAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; }); - }); - }); describe('App-promotion collection sponsoring', () => { @@ -625,6 +642,8 @@ describe('app-promotion stopSponsoringContract', () => { describe('app-promotion rewards', () => { const DAY = 7200n; + + // TODO (load test. Can pay reward for 10000 addresses) before(async function () { @@ -768,7 +787,6 @@ async function waitForRelayBlock(api: ApiPromise, blocks = 1): Promise { } }); }); - } From f9edb50d1095df5fe1e89fe34eda075a2c0332ae Mon Sep 17 00:00:00 2001 From: PraetorP Date: Tue, 30 Aug 2022 17:06:54 +0700 Subject: [PATCH 0629/1274] added bench for sponsoring, logic broken , commit for rebase --- Cargo.lock | 1 + pallets/app-promotion/Cargo.toml | 9 +- pallets/app-promotion/src/benchmarking.rs | 102 +++++-- pallets/app-promotion/src/lib.rs | 322 +++++++++++++-------- pallets/app-promotion/src/types.rs | 2 +- pallets/app-promotion/src/weights.rs | 151 +++++++--- pallets/unique/src/benchmarking.rs | 4 +- pallets/unique/src/lib.rs | 2 +- tests/src/interfaces/augment-api-events.ts | 2 +- tests/src/interfaces/augment-api-query.ts | 7 +- tests/src/interfaces/augment-api-tx.ts | 5 +- tests/src/interfaces/default/types.ts | 16 +- tests/src/interfaces/lookup.ts | 183 ++++++------ tests/src/interfaces/types-lookup.ts | 188 ++++++------ 14 files changed, 612 insertions(+), 382 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 527c6ee4ef..46b5c8f2a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5307,6 +5307,7 @@ dependencies = [ "pallet-common", "pallet-evm", "pallet-evm-contract-helpers", + "pallet-evm-migration", "pallet-randomness-collective-flip", "pallet-timestamp", "pallet-unique", diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index 83c9895024..d5ab2b9325 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -15,7 +15,7 @@ version = '0.1.0' targets = ['x86_64-unknown-linux-gnu'] [features] -default = ['std'] +default = ['std',] runtime-benchmarks = [ 'frame-benchmarking', 'frame-support/runtime-benchmarks', @@ -121,6 +121,13 @@ path = "../unique" [dependencies.pallet-evm-contract-helpers] default-features = false path = "../evm-contract-helpers" + +[dev-dependencies] +[dependencies.pallet-evm-migration] +default-features = false +path = "../evm-migration" + + ################################################################################ [dependencies] diff --git a/pallets/app-promotion/src/benchmarking.rs b/pallets/app-promotion/src/benchmarking.rs index 1d8fd361bc..e55939f430 100644 --- a/pallets/app-promotion/src/benchmarking.rs +++ b/pallets/app-promotion/src/benchmarking.rs @@ -20,53 +20,109 @@ use super::*; use crate::Pallet as PromototionPallet; use sp_runtime::traits::Bounded; +use sp_std::vec; use frame_benchmarking::{benchmarks, account}; -use frame_support::traits::OnInitialize; + use frame_system::{Origin, RawOrigin}; +use pallet_unique::benchmarking::create_nft_collection; +use pallet_evm_migration::Pallet as EvmMigrationPallet; + +// trait BenchmarkingConfig: Config + pallet_unique::Config { } + +// impl BenchmarkingConfig for T { } const SEED: u32 = 0; benchmarks! { where_clause{ - where T: Config - + where T: Config + pallet_unique::Config + pallet_evm_migration::Config , + T::BlockNumber: From } - on_initialize { - let block1: T::BlockNumber = T::BlockNumber::from(1u32); - let block2: T::BlockNumber = T::BlockNumber::from(2u32); - PromototionPallet::::on_initialize(block1); // Create Treasury account - }: { PromototionPallet::::on_initialize(block2); } // Benchmark deposit_into_existing path - start_app_promotion { - let caller = account::("caller", 0, SEED); - } : {PromototionPallet::::start_app_promotion(RawOrigin::Root.into(), T::BlockNumber::from(2u32))?} + } : {PromototionPallet::::start_app_promotion(RawOrigin::Root.into(), None)?} + + stop_app_promotion{ + PromototionPallet::::start_app_promotion(RawOrigin::Root.into(), Some(25.into()))?; + } : {PromototionPallet::::stop_app_promotion(RawOrigin::Root.into())?} set_admin_address { - let caller = account::("caller", 0, SEED); - let _ = T::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); - } : {PromototionPallet::::set_admin_address(RawOrigin::Root.into(), caller)?} + let pallet_admin = account::("admin", 0, SEED); + let _ = ::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + } : {PromototionPallet::::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin))?} + + payout_stakers{ + let pallet_admin = account::("admin", 0, SEED); + let share = Perbill::from_rational(1u32, 10); + PromototionPallet::::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?; + let _ = ::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + let staker: T::AccountId = account("caller", 0, SEED); + let _ = ::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + let _ = PromototionPallet::::stake(RawOrigin::Signed(staker.clone()).into(), share * ::Currency::total_balance(&staker))?; + } : {PromototionPallet::::payout_stakers(RawOrigin::Signed(pallet_admin.clone()).into(), Some(1))?} stake { let caller = account::("caller", 0, SEED); let share = Perbill::from_rational(1u32, 10); - let _ = T::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); - } : {PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * T::Currency::total_balance(&caller))?} + let _ = ::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + } : {PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller))?} unstake { let caller = account::("caller", 0, SEED); let share = Perbill::from_rational(1u32, 10); - let _ = T::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); - let _ = PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * T::Currency::total_balance(&caller))?; + let _ = ::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + let _ = PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller))?; - } : {PromototionPallet::::unstake(RawOrigin::Signed(caller.clone()).into(), share * T::Currency::total_balance(&caller))?} + } : {PromototionPallet::::unstake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller))?} recalculate_stake { let caller = account::("caller", 0, SEED); let share = Perbill::from_rational(1u32, 10); - let _ = T::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); - let _ = PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * T::Currency::total_balance(&caller))?; - let block = ::current_block_number(); + let _ = ::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + let _ = PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller))?; + let block = ::current_block_number(); let mut acc = >::default(); - } : {PromototionPallet::::recalculate_stake(&caller, block, share * T::Currency::total_balance(&caller), &mut acc)} + } : {PromototionPallet::::recalculate_stake(&caller, block, share * ::Currency::total_balance(&caller), &mut acc)} + + sponsor_collection { + let pallet_admin = account::("admin", 0, SEED); + PromototionPallet::::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?; + let _ = ::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + let caller: T::AccountId = account("caller", 0, SEED); + let _ = ::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + let collection = create_nft_collection::(caller.clone())?; + } : {PromototionPallet::::sponsor_collection(RawOrigin::Signed(pallet_admin.clone()).into(), collection)?} + + stop_sponsoring_collection { + let pallet_admin = account::("admin", 0, SEED); + PromototionPallet::::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?; + let _ = ::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + let caller: T::AccountId = account("caller", 0, SEED); + let _ = ::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + let collection = create_nft_collection::(caller.clone())?; + PromototionPallet::::sponsor_collection(RawOrigin::Signed(pallet_admin.clone()).into(), collection)?; + } : {PromototionPallet::::stop_sponsoring_collection(RawOrigin::Signed(pallet_admin.clone()).into(), collection)?} + + sponsor_contract { + let pallet_admin = account::("admin", 0, SEED); + PromototionPallet::::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?; + + let _ = ::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + let address = H160::from_low_u64_be(SEED as u64); + let data: Vec = (0..20 as u8).collect(); + >::begin(RawOrigin::Root.into(), address)?; + >::finish(RawOrigin::Root.into(), address, data)?; + } : {PromototionPallet::::sponsor_conract(RawOrigin::Signed(pallet_admin.clone()).into(), address)?} + + stop_sponsoring_contract { + let pallet_admin = account::("admin", 0, SEED); + PromototionPallet::::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?; + + let _ = ::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + let address = H160::from_low_u64_be(SEED as u64); + let data: Vec = (0..20 as u8).collect(); + >::begin(RawOrigin::Root.into(), address)?; + >::finish(RawOrigin::Root.into(), address, data)?; + PromototionPallet::::sponsor_conract(RawOrigin::Signed(pallet_admin.clone()).into(), address)?; + } : {PromototionPallet::::stop_sponsoring_contract(RawOrigin::Signed(pallet_admin.clone()).into(), address)?} } diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 118ec29194..2a3b9254ac 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -132,6 +132,8 @@ pub mod pallet { #[pallet::generate_deposit(fn deposit_event)] pub enum Event { StakingRecalculation( + /// An recalculated staker + T::AccountId, /// Base on which interest is calculated BalanceOf, /// Amount of accrued interest @@ -164,7 +166,7 @@ pub mod pallet { Key, Key, ), - Value = BalanceOf, + Value = (BalanceOf, T::BlockNumber), QueryKind = ValueQuery, >; @@ -189,6 +191,13 @@ pub mod pallet { pub type NextInterestBlock = StorageValue; + /// Stores the address of the staker for which the last revenue recalculation was performed. + /// If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers. + #[pallet::storage] + #[pallet::getter(fn get_last_calculated_staker)] + pub type LastCalcucaltedStaker = + StorageValue; + #[pallet::hooks] impl Hooks> for Pallet { fn on_initialize(current_block: T::BlockNumber) -> Weight @@ -196,10 +205,10 @@ pub mod pallet { ::BlockNumber: From, { let mut consumed_weight = 0; - let mut add_weight = |reads, writes, weight| { - consumed_weight += T::DbWeight::get().reads_writes(reads, writes); - consumed_weight += weight; - }; + // let mut add_weight = |reads, writes, weight| { + // consumed_weight += T::DbWeight::get().reads_writes(reads, writes); + // consumed_weight += weight; + // }; PendingUnstake::::iter() .filter_map(|((staker, block), amount)| { @@ -214,41 +223,44 @@ pub mod pallet { >::remove((staker, block)); }); - let next_interest_block = Self::get_interest_block(); - let current_relay_block = T::RelayBlockNumberProvider::current_block_number(); - if next_interest_block != 0.into() && current_relay_block >= next_interest_block { - let mut acc = >::default(); - let mut base_acc = >::default(); - - NextInterestBlock::::set( - NextInterestBlock::::get() + T::RecalculationInterval::get(), - ); - add_weight(0, 1, 0); - - Staked::::iter() - .filter(|((_, block), _)| { - *block + T::RecalculationInterval::get() <= current_relay_block - }) - .for_each(|((staker, block), amount)| { - Self::recalculate_stake(&staker, block, amount, &mut acc); - add_weight(0, 0, T::WeightInfo::recalculate_stake()); - base_acc += amount; - }); - >::get() - .checked_add(&acc) - .map(|res| >::set(res)); - - Self::deposit_event(Event::StakingRecalculation(base_acc, acc)); - add_weight(0, 1, 0); - } else { - add_weight(1, 0, 0) - }; + // let next_interest_block = Self::get_interest_block(); + // let current_relay_block = T::RelayBlockNumberProvider::current_block_number(); + // if next_interest_block != 0.into() && current_relay_block >= next_interest_block { + // let mut acc = >::default(); + // let mut base_acc = >::default(); + + // NextInterestBlock::::set( + // NextInterestBlock::::get() + T::RecalculationInterval::get(), + // ); + // add_weight(0, 1, 0); + + // Staked::::iter() + // .filter(|((_, block), _)| { + // *block + T::RecalculationInterval::get() <= current_relay_block + // }) + // .for_each(|((staker, block), amount)| { + // Self::recalculate_stake(&staker, block, amount, &mut acc); + // add_weight(0, 0, T::WeightInfo::recalculate_stake()); + // base_acc += amount; + // }); + // >::get() + // .checked_add(&acc) + // .map(|res| >::set(res)); + + // Self::deposit_event(Event::StakingRecalculation(base_acc, acc)); + // add_weight(0, 1, 0); + // } else { + // add_weight(1, 0, 0) + // }; consumed_weight } } #[pallet::call] - impl Pallet { + impl Pallet + where + T::BlockNumber: From, + { #[pallet::weight(T::WeightInfo::set_admin_address())] pub fn set_admin_address(origin: OriginFor, admin: T::CrossAccountId) -> DispatchResult { ensure_root(origin)?; @@ -281,7 +293,7 @@ pub mod pallet { Ok(()) } - #[pallet::weight(0)] + #[pallet::weight(T::WeightInfo::stop_app_promotion())] pub fn stop_app_promotion(origin: OriginFor) -> DispatchResult where ::BlockNumber: From, @@ -317,19 +329,24 @@ pub mod pallet { Self::add_lock_balance(&staker_id, amount)?; let block_number = T::RelayBlockNumberProvider::current_block_number(); + let recalc_block = (block_number / T::RecalculationInterval::get() + 2u32.into()) + * T::RecalculationInterval::get(); - >::insert( - (&staker_id, block_number), - >::get((&staker_id, block_number)) + >::insert((&staker_id, block_number), { + let mut balance_and_recalc_block = >::get((&staker_id, block_number)); + balance_and_recalc_block.0 = balance_and_recalc_block + .0 .checked_add(&amount) - .ok_or(ArithmeticError::Overflow)?, - ); + .ok_or(ArithmeticError::Overflow)?; + balance_and_recalc_block.1 = recalc_block; + balance_and_recalc_block + }); - >::set( - >::get() - .checked_add(&amount) - .ok_or(ArithmeticError::Overflow)?, - ); + // >::set( + // >::get() + // .checked_add(&amount) + // .ok_or(ArithmeticError::Overflow)?, + // ); Ok(()) } @@ -338,63 +355,120 @@ pub mod pallet { pub fn unstake(staker: OriginFor, amount: BalanceOf) -> DispatchResult { let staker_id = ensure_signed(staker)?; - let mut stakes = Staked::::iter_prefix((&staker_id,)).collect::>(); - - let total_staked = stakes - .iter() - .fold(>::default(), |acc, (_, amount)| acc + *amount); - - ensure!(total_staked >= amount, ArithmeticError::Underflow); - - >::set( - >::get() - .checked_sub(&amount) - .ok_or(ArithmeticError::Underflow)?, - ); - - let block = - T::RelayBlockNumberProvider::current_block_number() + T::PendingInterval::get(); - >::insert( - (&staker_id, block), - >::get((&staker_id, block)) - .checked_add(&amount) - .ok_or(ArithmeticError::Overflow)?, - ); - - stakes.sort_by_key(|(block, _)| *block); - - let mut acc_amount = amount; - let new_state = stakes - .into_iter() - .map_while(|(block, balance_per_block)| { - if acc_amount == >::default() { - return None; - } - if acc_amount <= balance_per_block { - let res = (block, balance_per_block - acc_amount, acc_amount); - acc_amount = >::default(); - return Some(res); - } else { - acc_amount -= balance_per_block; - return Some((block, >::default(), acc_amount)); - } - }) - .collect::>(); - - new_state - .into_iter() - .for_each(|(block, to_staked, _to_pending)| { - if to_staked == >::default() { - >::remove((&staker_id, block)); - } else { - >::insert((&staker_id, block), to_staked); - } - }); + let mut stakes = Staked::::drain_prefix((&staker_id,)); + + // let total_staked = stakes + // .iter() + // .fold(>::default(), |acc, (_, amount)| acc + *amount); + + // ensure!(total_staked >= amount, ArithmeticError::Underflow); + + // >::set( + // >::get() + // .checked_sub(&amount) + // .ok_or(ArithmeticError::Underflow)?, + // ); + + // let block = + // T::RelayBlockNumberProvider::current_block_number() + T::PendingInterval::get(); + // >::insert( + // (&staker_id, block), + // >::get((&staker_id, block)) + // .checked_add(&amount) + // .ok_or(ArithmeticError::Overflow)?, + // ); + + // stakes.sort_by_key(|(block, _)| *block); + + // let mut acc_amount = amount; + // let new_state = stakes + // .into_iter() + // .map_while(|(block, balance_per_block)| { + // if acc_amount == >::default() { + // return None; + // } + // if acc_amount <= balance_per_block { + // let res = (block, balance_per_block - acc_amount, acc_amount); + // acc_amount = >::default(); + // return Some(res); + // } else { + // acc_amount -= balance_per_block; + // return Some((block, >::default(), acc_amount)); + // } + // }) + // .collect::>(); + + // new_state + // .into_iter() + // .for_each(|(block, to_staked, _to_pending)| { + // if to_staked == >::default() { + // >::remove((&staker_id, block)); + // } else { + // >::insert((&staker_id, block), to_staked); + // } + // }); Ok(()) + + // let staker_id = ensure_signed(staker)?; + + // let mut stakes = Staked::::iter_prefix((&staker_id,)).collect::>(); + + // let total_staked = stakes + // .iter() + // .fold(>::default(), |acc, (_, amount)| acc + *amount); + + // ensure!(total_staked >= amount, ArithmeticError::Underflow); + + // >::set( + // >::get() + // .checked_sub(&amount) + // .ok_or(ArithmeticError::Underflow)?, + // ); + + // let block = + // T::RelayBlockNumberProvider::current_block_number() + T::PendingInterval::get(); + // >::insert( + // (&staker_id, block), + // >::get((&staker_id, block)) + // .checked_add(&amount) + // .ok_or(ArithmeticError::Overflow)?, + // ); + + // stakes.sort_by_key(|(block, _)| *block); + + // let mut acc_amount = amount; + // let new_state = stakes + // .into_iter() + // .map_while(|(block, balance_per_block)| { + // if acc_amount == >::default() { + // return None; + // } + // if acc_amount <= balance_per_block { + // let res = (block, balance_per_block - acc_amount, acc_amount); + // acc_amount = >::default(); + // return Some(res); + // } else { + // acc_amount -= balance_per_block; + // return Some((block, >::default(), acc_amount)); + // } + // }) + // .collect::>(); + + // new_state + // .into_iter() + // .for_each(|(block, to_staked, _to_pending)| { + // if to_staked == >::default() { + // >::remove((&staker_id, block)); + // } else { + // >::insert((&staker_id, block), to_staked); + // } + // }); + + // Ok(()) } - #[pallet::weight(0)] + #[pallet::weight(T::WeightInfo::sponsor_collection())] pub fn sponsor_collection( admin: OriginFor, collection_id: CollectionId, @@ -407,8 +481,8 @@ pub mod pallet { T::CollectionHandler::set_sponsor(Self::account_id(), collection_id) } - #[pallet::weight(0)] - pub fn stop_sponsorign_collection( + #[pallet::weight(T::WeightInfo::stop_sponsoring_collection())] + pub fn stop_sponsoring_collection( admin: OriginFor, collection_id: CollectionId, ) -> DispatchResult { @@ -428,7 +502,7 @@ pub mod pallet { T::CollectionHandler::remove_collection_sponsor(collection_id) } - #[pallet::weight(0)] + #[pallet::weight(T::WeightInfo::sponsor_contract())] pub fn sponsor_conract(admin: OriginFor, contract_id: H160) -> DispatchResult { let admin_id = ensure_signed(admin)?; @@ -443,8 +517,8 @@ pub mod pallet { ) } - #[pallet::weight(0)] - pub fn stop_sponsorign_contract(admin: OriginFor, contract_id: H160) -> DispatchResult { + #[pallet::weight(T::WeightInfo::stop_sponsoring_contract())] + pub fn stop_sponsoring_contract(admin: OriginFor, contract_id: H160) -> DispatchResult { let admin_id = ensure_signed(admin)?; ensure!( @@ -459,6 +533,18 @@ pub mod pallet { ); T::ContractHandler::remove_contract_sponsor(contract_id) } + + #[pallet::weight(0)] + pub fn payout_stakers(admin: OriginFor, stakers_number: Option) -> DispatchResult { + let admin_id = ensure_signed(admin)?; + + ensure!( + admin_id == Admin::::get().ok_or(Error::::AdminNotSet)?, + Error::::NoPermission + ); + + Ok(()) + } } } @@ -501,7 +587,9 @@ impl Pallet { pub fn total_staked_by_id(staker: impl EncodeLike) -> Option> { let staked = Staked::::iter_prefix((staker,)) .into_iter() - .fold(>::default(), |acc, (_, amount)| acc + amount); + .fold(>::default(), |acc, (_, (amount, _))| { + acc + amount + }); if staked != >::default() { Some(staked) } else { @@ -514,7 +602,7 @@ impl Pallet { ) -> Option)>> { let mut staked = Staked::::iter_prefix((staker,)) .into_iter() - .map(|(block, amount)| (block, amount)) + .map(|(block, (amount, _))| (block, amount)) .collect::>(); staked.sort_by_key(|(block, _)| *block); if !staked.is_empty() { @@ -550,17 +638,17 @@ impl Pallet { income_acc: &mut BalanceOf, ) { let income = Self::calculate_income(base); - base.checked_add(&income).map(|res| { - >::insert((staker, block), res); - *income_acc += income; - >::transfer( - &T::TreasuryAccountId::get(), - staker, - income, - ExistenceRequirement::KeepAlive, - ) - .and_then(|_| Self::add_lock_balance(staker, income)); - }); + // base.checked_add(&income).map(|res| { + // >::insert((staker, block), res); + // *income_acc += income; + // >::transfer( + // &T::TreasuryAccountId::get(), + // staker, + // income, + // ExistenceRequirement::KeepAlive, + // ) + // .and_then(|_| Self::add_lock_balance(staker, income)); + // }); } fn calculate_income(base: I) -> I diff --git a/pallets/app-promotion/src/types.rs b/pallets/app-promotion/src/types.rs index 0f356e10a1..2abd5bc90a 100644 --- a/pallets/app-promotion/src/types.rs +++ b/pallets/app-promotion/src/types.rs @@ -101,7 +101,7 @@ pub trait ContractHandler { fn set_sponsor(sponsor_id: Self::AccountId, contract_id: Self::ContractId) -> DispatchResult; - fn remove_contract_sponsor(collection_id: Self::ContractId) -> DispatchResult; + fn remove_contract_sponsor(contract_id: Self::ContractId) -> DispatchResult; fn get_sponsor(contract_id: Self::ContractId) -> Result, DispatchError>; diff --git a/pallets/app-promotion/src/weights.rs b/pallets/app-promotion/src/weights.rs index 933fd0e0e9..fc709cdd65 100644 --- a/pallets/app-promotion/src/weights.rs +++ b/pallets/app-promotion/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_app_promotion //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-08-09, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-08-30, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -33,59 +33,91 @@ use sp_std::marker::PhantomData; /// Weight functions needed for pallet_app_promotion. pub trait WeightInfo { - fn on_initialize() -> Weight; fn start_app_promotion() -> Weight; + fn stop_app_promotion() -> Weight; fn set_admin_address() -> Weight; + fn payout_stakers() -> Weight; fn stake() -> Weight; fn unstake() -> Weight; fn recalculate_stake() -> Weight; + fn sponsor_collection() -> Weight; + fn stop_sponsoring_collection() -> Weight; + fn sponsor_contract() -> Weight; + fn stop_sponsoring_contract() -> Weight; } /// Weights for pallet_app_promotion using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - // Storage: Promotion PendingUnstake (r:1 w:0) - // Storage: Promotion NextInterestBlock (r:1 w:0) - fn on_initialize() -> Weight { - (2_705_000 as Weight) + // Storage: Promotion StartBlock (r:1 w:1) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Storage: Promotion NextInterestBlock (r:0 w:1) + fn start_app_promotion() -> Weight { + (2_299_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Promotion StartBlock (r:1 w:1) // Storage: Promotion NextInterestBlock (r:0 w:1) - fn start_app_promotion() -> Weight { - (1_436_000 as Weight) + fn stop_app_promotion() -> Weight { + (1_733_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Promotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - (516_000 as Weight) + (553_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } + // Storage: Promotion Admin (r:1 w:0) + fn payout_stakers() -> Weight { + (1_398_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + } // Storage: System Account (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: ParachainSystem ValidationData (r:1 w:0) // Storage: Promotion Staked (r:1 w:1) - // Storage: Promotion TotalStaked (r:1 w:1) fn stake() -> Weight { - (10_019_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + (9_506_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) } - // Storage: System Account (r:1 w:1) - // Storage: Balances Locks (r:1 w:1) - // Storage: ParachainSystem ValidationData (r:1 w:0) - // Storage: Promotion Staked (r:1 w:1) - // Storage: Promotion TotalStaked (r:1 w:1) + // Storage: System Account (r:1 w:0) fn unstake() -> Weight { - (10_619_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + (2_529_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) } - // Storage: System Account (r:2 w:0) - // Storage: Promotion Staked (r:0 w:1) + // Storage: System Account (r:1 w:0) fn recalculate_stake() -> Weight { - (4_932_000 as Weight) + (2_203_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + } + // Storage: Promotion Admin (r:1 w:0) + // Storage: Common CollectionById (r:1 w:1) + fn sponsor_collection() -> Weight { + (10_882_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Promotion Admin (r:1 w:0) + // Storage: Common CollectionById (r:1 w:1) + fn stop_sponsoring_collection() -> Weight { + (10_544_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Promotion Admin (r:1 w:0) + // Storage: EvmContractHelpers Sponsoring (r:0 w:1) + fn sponsor_contract() -> Weight { + (2_163_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: Promotion Admin (r:1 w:0) + // Storage: EvmContractHelpers Sponsoring (r:1 w:1) + fn stop_sponsoring_contract() -> Weight { + (3_511_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -93,48 +125,75 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { - // Storage: Promotion PendingUnstake (r:1 w:0) - // Storage: Promotion NextInterestBlock (r:1 w:0) - fn on_initialize() -> Weight { - (2_705_000 as Weight) + // Storage: Promotion StartBlock (r:1 w:1) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Storage: Promotion NextInterestBlock (r:0 w:1) + fn start_app_promotion() -> Weight { + (2_299_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Promotion StartBlock (r:1 w:1) // Storage: Promotion NextInterestBlock (r:0 w:1) - fn start_app_promotion() -> Weight { - (1_436_000 as Weight) + fn stop_app_promotion() -> Weight { + (1_733_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Promotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - (516_000 as Weight) + (553_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } + // Storage: Promotion Admin (r:1 w:0) + fn payout_stakers() -> Weight { + (1_398_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + } // Storage: System Account (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: ParachainSystem ValidationData (r:1 w:0) // Storage: Promotion Staked (r:1 w:1) - // Storage: Promotion TotalStaked (r:1 w:1) fn stake() -> Weight { - (10_019_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + (9_506_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } - // Storage: System Account (r:1 w:1) - // Storage: Balances Locks (r:1 w:1) - // Storage: ParachainSystem ValidationData (r:1 w:0) - // Storage: Promotion Staked (r:1 w:1) - // Storage: Promotion TotalStaked (r:1 w:1) + // Storage: System Account (r:1 w:0) fn unstake() -> Weight { - (10_619_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + (2_529_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) } - // Storage: System Account (r:2 w:0) - // Storage: Promotion Staked (r:0 w:1) + // Storage: System Account (r:1 w:0) fn recalculate_stake() -> Weight { - (4_932_000 as Weight) + (2_203_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + } + // Storage: Promotion Admin (r:1 w:0) + // Storage: Common CollectionById (r:1 w:1) + fn sponsor_collection() -> Weight { + (10_882_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Promotion Admin (r:1 w:0) + // Storage: Common CollectionById (r:1 w:1) + fn stop_sponsoring_collection() -> Weight { + (10_544_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Promotion Admin (r:1 w:0) + // Storage: EvmContractHelpers Sponsoring (r:0 w:1) + fn sponsor_contract() -> Weight { + (2_163_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: Promotion Admin (r:1 w:0) + // Storage: EvmContractHelpers Sponsoring (r:1 w:1) + fn stop_sponsoring_contract() -> Weight { + (3_511_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/pallets/unique/src/benchmarking.rs b/pallets/unique/src/benchmarking.rs index eb7e7cf6d5..f679247427 100644 --- a/pallets/unique/src/benchmarking.rs +++ b/pallets/unique/src/benchmarking.rs @@ -46,7 +46,9 @@ fn create_collection_helper( )?; Ok(>::get()) } -fn create_nft_collection(owner: T::AccountId) -> Result { +pub fn create_nft_collection( + owner: T::AccountId, +) -> Result { create_collection_helper::(owner, CollectionMode::NFT) } diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index 232c2beb6b..9940938474 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -98,7 +98,7 @@ use pallet_common::{ pub mod eth; #[cfg(feature = "runtime-benchmarks")] -mod benchmarking; +pub mod benchmarking; pub mod weights; use weights::WeightInfo; diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index 4e07c80484..4172a0189e 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -361,7 +361,7 @@ declare module '@polkadot/api-base/types/events' { [key: string]: AugmentedEvent; }; promotion: { - StakingRecalculation: AugmentedEvent; + StakingRecalculation: AugmentedEvent; /** * Generic event **/ diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 5ebf8f1bdb..ff7f2e2405 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -512,6 +512,11 @@ declare module '@polkadot/api-base/types/storage' { }; promotion: { admin: AugmentedQuery Observable>, []> & QueryableStorageEntry; + /** + * Stores the address of the staker for which the last revenue recalculation was performed. + * If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers. + **/ + lastCalcucaltedStaker: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Next target block when interest is recalculated **/ @@ -523,7 +528,7 @@ declare module '@polkadot/api-base/types/storage' { /** * Amount of tokens staked by account in the blocknumber. **/ - staked: AugmentedQuery Observable, [AccountId32, u32]> & QueryableStorageEntry; + staked: AugmentedQuery Observable>, [AccountId32, u32]> & QueryableStorageEntry; /** * A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`. **/ diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index ed42321155..11321f65c6 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -363,14 +363,15 @@ declare module '@polkadot/api-base/types/submittable' { [key: string]: SubmittableExtrinsicFunction; }; promotion: { + payoutStakers: AugmentedSubmittable<(stakersNumber: Option | null | Uint8Array | u8 | AnyNumber) => SubmittableExtrinsic, [Option]>; setAdminAddress: AugmentedSubmittable<(admin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic, [PalletEvmAccountBasicCrossAccountIdRepr]>; sponsorCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; sponsorConract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; stake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; startAppPromotion: AugmentedSubmittable<(promotionStartRelayBlock: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; stopAppPromotion: AugmentedSubmittable<() => SubmittableExtrinsic, []>; - stopSponsorignCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; - stopSponsorignContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; + stopSponsoringCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; + stopSponsoringContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; unstake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; /** * Generic tx diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 644ba5c7d1..8b254d6b35 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -829,19 +829,23 @@ export interface PalletAppPromotionCall extends Enum { readonly asSponsorCollection: { readonly collectionId: u32; } & Struct; - readonly isStopSponsorignCollection: boolean; - readonly asStopSponsorignCollection: { + readonly isStopSponsoringCollection: boolean; + readonly asStopSponsoringCollection: { readonly collectionId: u32; } & Struct; readonly isSponsorConract: boolean; readonly asSponsorConract: { readonly contractId: H160; } & Struct; - readonly isStopSponsorignContract: boolean; - readonly asStopSponsorignContract: { + readonly isStopSponsoringContract: boolean; + readonly asStopSponsoringContract: { readonly contractId: H160; } & Struct; - readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'StopAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsorignCollection' | 'SponsorConract' | 'StopSponsorignContract'; + readonly isPayoutStakers: boolean; + readonly asPayoutStakers: { + readonly stakersNumber: Option; + } & Struct; + readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'StopAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorConract' | 'StopSponsoringContract' | 'PayoutStakers'; } /** @name PalletAppPromotionError */ @@ -856,7 +860,7 @@ export interface PalletAppPromotionError extends Enum { /** @name PalletAppPromotionEvent */ export interface PalletAppPromotionEvent extends Enum { readonly isStakingRecalculation: boolean; - readonly asStakingRecalculation: ITuple<[u128, u128]>; + readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>; readonly type: 'StakingRecalculation'; } diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 41628940ad..2c84a86389 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -1061,7 +1061,7 @@ export default { **/ PalletAppPromotionEvent: { _enum: { - StakingRecalculation: '(u128,u128)' + StakingRecalculation: '(AccountId32,u128,u128)' } }, /** @@ -2473,19 +2473,22 @@ export default { sponsor_collection: { collectionId: 'u32', }, - stop_sponsorign_collection: { + stop_sponsoring_collection: { collectionId: 'u32', }, sponsor_conract: { contractId: 'H160', }, - stop_sponsorign_contract: { - contractId: 'H160' + stop_sponsoring_contract: { + contractId: 'H160', + }, + payout_stakers: { + stakersNumber: 'Option' } } }, /** - * Lookup305: pallet_evm::pallet::Call + * Lookup306: pallet_evm::pallet::Call **/ PalletEvmCall: { _enum: { @@ -2528,7 +2531,7 @@ export default { } }, /** - * Lookup309: pallet_ethereum::pallet::Call + * Lookup310: pallet_ethereum::pallet::Call **/ PalletEthereumCall: { _enum: { @@ -2538,7 +2541,7 @@ export default { } }, /** - * Lookup310: ethereum::transaction::TransactionV2 + * Lookup311: ethereum::transaction::TransactionV2 **/ EthereumTransactionTransactionV2: { _enum: { @@ -2548,7 +2551,7 @@ export default { } }, /** - * Lookup311: ethereum::transaction::LegacyTransaction + * Lookup312: ethereum::transaction::LegacyTransaction **/ EthereumTransactionLegacyTransaction: { nonce: 'U256', @@ -2560,7 +2563,7 @@ export default { signature: 'EthereumTransactionTransactionSignature' }, /** - * Lookup312: ethereum::transaction::TransactionAction + * Lookup313: ethereum::transaction::TransactionAction **/ EthereumTransactionTransactionAction: { _enum: { @@ -2569,7 +2572,7 @@ export default { } }, /** - * Lookup313: ethereum::transaction::TransactionSignature + * Lookup314: ethereum::transaction::TransactionSignature **/ EthereumTransactionTransactionSignature: { v: 'u64', @@ -2577,7 +2580,7 @@ export default { s: 'H256' }, /** - * Lookup315: ethereum::transaction::EIP2930Transaction + * Lookup316: ethereum::transaction::EIP2930Transaction **/ EthereumTransactionEip2930Transaction: { chainId: 'u64', @@ -2593,14 +2596,14 @@ export default { s: 'H256' }, /** - * Lookup317: ethereum::transaction::AccessListItem + * Lookup318: ethereum::transaction::AccessListItem **/ EthereumTransactionAccessListItem: { address: 'H160', storageKeys: 'Vec' }, /** - * Lookup318: ethereum::transaction::EIP1559Transaction + * Lookup319: ethereum::transaction::EIP1559Transaction **/ EthereumTransactionEip1559Transaction: { chainId: 'u64', @@ -2617,7 +2620,7 @@ export default { s: 'H256' }, /** - * Lookup319: pallet_evm_migration::pallet::Call + * Lookup320: pallet_evm_migration::pallet::Call **/ PalletEvmMigrationCall: { _enum: { @@ -2635,19 +2638,19 @@ export default { } }, /** - * Lookup322: pallet_sudo::pallet::Error + * Lookup323: pallet_sudo::pallet::Error **/ PalletSudoError: { _enum: ['RequireSudo'] }, /** - * Lookup324: orml_vesting::module::Error + * Lookup325: orml_vesting::module::Error **/ OrmlVestingModuleError: { _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded'] }, /** - * Lookup326: cumulus_pallet_xcmp_queue::InboundChannelDetails + * Lookup327: cumulus_pallet_xcmp_queue::InboundChannelDetails **/ CumulusPalletXcmpQueueInboundChannelDetails: { sender: 'u32', @@ -2655,19 +2658,19 @@ export default { messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>' }, /** - * Lookup327: cumulus_pallet_xcmp_queue::InboundState + * Lookup328: cumulus_pallet_xcmp_queue::InboundState **/ CumulusPalletXcmpQueueInboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup330: polkadot_parachain::primitives::XcmpMessageFormat + * Lookup331: polkadot_parachain::primitives::XcmpMessageFormat **/ PolkadotParachainPrimitivesXcmpMessageFormat: { _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals'] }, /** - * Lookup333: cumulus_pallet_xcmp_queue::OutboundChannelDetails + * Lookup334: cumulus_pallet_xcmp_queue::OutboundChannelDetails **/ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: 'u32', @@ -2677,13 +2680,13 @@ export default { lastIndex: 'u16' }, /** - * Lookup334: cumulus_pallet_xcmp_queue::OutboundState + * Lookup335: cumulus_pallet_xcmp_queue::OutboundState **/ CumulusPalletXcmpQueueOutboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup336: cumulus_pallet_xcmp_queue::QueueConfigData + * Lookup337: cumulus_pallet_xcmp_queue::QueueConfigData **/ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: 'u32', @@ -2694,29 +2697,29 @@ export default { xcmpMaxIndividualWeight: 'u64' }, /** - * Lookup338: cumulus_pallet_xcmp_queue::pallet::Error + * Lookup339: cumulus_pallet_xcmp_queue::pallet::Error **/ CumulusPalletXcmpQueueError: { _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit'] }, /** - * Lookup339: pallet_xcm::pallet::Error + * Lookup340: pallet_xcm::pallet::Error **/ PalletXcmError: { _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed'] }, /** - * Lookup340: cumulus_pallet_xcm::pallet::Error + * Lookup341: cumulus_pallet_xcm::pallet::Error **/ CumulusPalletXcmError: 'Null', /** - * Lookup341: cumulus_pallet_dmp_queue::ConfigData + * Lookup342: cumulus_pallet_dmp_queue::ConfigData **/ CumulusPalletDmpQueueConfigData: { maxIndividual: 'u64' }, /** - * Lookup342: cumulus_pallet_dmp_queue::PageIndexData + * Lookup343: cumulus_pallet_dmp_queue::PageIndexData **/ CumulusPalletDmpQueuePageIndexData: { beginUsed: 'u32', @@ -2724,19 +2727,19 @@ export default { overweightCount: 'u64' }, /** - * Lookup345: cumulus_pallet_dmp_queue::pallet::Error + * Lookup346: cumulus_pallet_dmp_queue::pallet::Error **/ CumulusPalletDmpQueueError: { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup349: pallet_unique::Error + * Lookup350: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup352: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> + * Lookup353: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> **/ PalletUniqueSchedulerScheduledV3: { maybeId: 'Option<[u8;16]>', @@ -2746,7 +2749,7 @@ export default { origin: 'OpalRuntimeOriginCaller' }, /** - * Lookup353: opal_runtime::OriginCaller + * Lookup354: opal_runtime::OriginCaller **/ OpalRuntimeOriginCaller: { _enum: { @@ -2855,7 +2858,7 @@ export default { } }, /** - * Lookup354: frame_support::dispatch::RawOrigin + * Lookup355: frame_support::dispatch::RawOrigin **/ FrameSupportDispatchRawOrigin: { _enum: { @@ -2865,7 +2868,7 @@ export default { } }, /** - * Lookup355: pallet_xcm::pallet::Origin + * Lookup356: pallet_xcm::pallet::Origin **/ PalletXcmOrigin: { _enum: { @@ -2874,7 +2877,7 @@ export default { } }, /** - * Lookup356: cumulus_pallet_xcm::pallet::Origin + * Lookup357: cumulus_pallet_xcm::pallet::Origin **/ CumulusPalletXcmOrigin: { _enum: { @@ -2883,7 +2886,7 @@ export default { } }, /** - * Lookup357: pallet_ethereum::RawOrigin + * Lookup358: pallet_ethereum::RawOrigin **/ PalletEthereumRawOrigin: { _enum: { @@ -2891,17 +2894,17 @@ export default { } }, /** - * Lookup358: sp_core::Void + * Lookup359: sp_core::Void **/ SpCoreVoid: 'Null', /** - * Lookup359: pallet_unique_scheduler::pallet::Error + * Lookup360: pallet_unique_scheduler::pallet::Error **/ PalletUniqueSchedulerError: { _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] }, /** - * Lookup360: up_data_structs::Collection + * Lookup361: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -2915,7 +2918,7 @@ export default { externalCollection: 'bool' }, /** - * Lookup361: up_data_structs::SponsorshipState + * Lookup362: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipStateAccountId32: { _enum: { @@ -2925,7 +2928,7 @@ export default { } }, /** - * Lookup362: up_data_structs::Properties + * Lookup363: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -2933,15 +2936,15 @@ export default { spaceLimit: 'u32' }, /** - * Lookup363: up_data_structs::PropertiesMap> + * Lookup364: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** - * Lookup368: up_data_structs::PropertiesMap + * Lookup369: up_data_structs::PropertiesMap **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup375: up_data_structs::CollectionStats + * Lookup376: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -2949,18 +2952,18 @@ export default { alive: 'u32' }, /** - * Lookup376: up_data_structs::TokenChild + * Lookup377: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup377: PhantomType::up_data_structs + * Lookup378: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup379: up_data_structs::TokenData> + * Lookup380: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -2968,7 +2971,7 @@ export default { pieces: 'u128' }, /** - * Lookup381: up_data_structs::RpcCollection + * Lookup382: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -2984,7 +2987,7 @@ export default { readOnly: 'bool' }, /** - * Lookup382: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup383: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -2994,7 +2997,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup383: rmrk_traits::nft::NftInfo> + * Lookup384: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -3004,14 +3007,14 @@ export default { pending: 'bool' }, /** - * Lookup385: rmrk_traits::nft::RoyaltyInfo + * Lookup386: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup386: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup387: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -3020,14 +3023,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup387: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup388: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup388: rmrk_traits::base::BaseInfo> + * Lookup389: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -3035,86 +3038,86 @@ export default { symbol: 'Bytes' }, /** - * Lookup389: rmrk_traits::nft::NftChild + * Lookup390: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup391: pallet_common::pallet::Error + * Lookup392: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup393: pallet_fungible::pallet::Error + * Lookup394: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup394: pallet_refungible::ItemData + * Lookup395: pallet_refungible::ItemData **/ PalletRefungibleItemData: { constData: 'Bytes' }, /** - * Lookup399: pallet_refungible::pallet::Error + * Lookup400: pallet_refungible::pallet::Error **/ PalletRefungibleError: { _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup400: pallet_nonfungible::ItemData> + * Lookup401: pallet_nonfungible::ItemData> **/ PalletNonfungibleItemData: { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup402: up_data_structs::PropertyScope + * Lookup403: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { _enum: ['None', 'Rmrk', 'Eth'] }, /** - * Lookup404: pallet_nonfungible::pallet::Error + * Lookup405: pallet_nonfungible::pallet::Error **/ PalletNonfungibleError: { _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup405: pallet_structure::pallet::Error + * Lookup406: pallet_structure::pallet::Error **/ PalletStructureError: { _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup406: pallet_rmrk_core::pallet::Error + * Lookup407: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** - * Lookup408: pallet_rmrk_equip::pallet::Error + * Lookup409: pallet_rmrk_equip::pallet::Error **/ PalletRmrkEquipError: { _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] }, /** - * Lookup410: pallet_app_promotion::pallet::Error + * Lookup412: pallet_app_promotion::pallet::Error **/ PalletAppPromotionError: { _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFounds', 'InvalidArgument'] }, /** - * Lookup413: pallet_evm::pallet::Error + * Lookup415: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup416: fp_rpc::TransactionStatus + * Lookup418: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -3126,11 +3129,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup418: ethbloom::Bloom + * Lookup420: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup420: ethereum::receipt::ReceiptV3 + * Lookup422: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -3140,7 +3143,7 @@ export default { } }, /** - * Lookup421: ethereum::receipt::EIP658ReceiptData + * Lookup423: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -3149,7 +3152,7 @@ export default { logs: 'Vec' }, /** - * Lookup422: ethereum::block::Block + * Lookup424: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -3157,7 +3160,7 @@ export default { ommers: 'Vec' }, /** - * Lookup423: ethereum::header::Header + * Lookup425: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -3177,23 +3180,23 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup424: ethereum_types::hash::H64 + * Lookup426: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup429: pallet_ethereum::pallet::Error + * Lookup431: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup430: pallet_evm_coder_substrate::pallet::Error + * Lookup432: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup431: up_data_structs::SponsorshipState> + * Lookup433: up_data_structs::SponsorshipState> **/ UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: { _enum: { @@ -3203,25 +3206,25 @@ export default { } }, /** - * Lookup432: pallet_evm_contract_helpers::SponsoringModeT + * Lookup434: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup434: pallet_evm_contract_helpers::pallet::Error + * Lookup436: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission', 'NoPendingSponsor'] }, /** - * Lookup435: pallet_evm_migration::pallet::Error + * Lookup437: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup437: sp_runtime::MultiSignature + * Lookup439: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3231,43 +3234,43 @@ export default { } }, /** - * Lookup438: sp_core::ed25519::Signature + * Lookup440: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup440: sp_core::sr25519::Signature + * Lookup442: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup441: sp_core::ecdsa::Signature + * Lookup443: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup444: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup446: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup445: frame_system::extensions::check_genesis::CheckGenesis + * Lookup447: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup448: frame_system::extensions::check_nonce::CheckNonce + * Lookup450: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup449: frame_system::extensions::check_weight::CheckWeight + * Lookup451: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup450: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup452: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup451: opal_runtime::Runtime + * Lookup453: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup452: pallet_ethereum::FakeTransactionFinalizer + * Lookup454: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 094599580c..9a4b8e9d42 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1201,7 +1201,7 @@ declare module '@polkadot/types/lookup' { /** @name PalletAppPromotionEvent (103) */ interface PalletAppPromotionEvent extends Enum { readonly isStakingRecalculation: boolean; - readonly asStakingRecalculation: ITuple<[u128, u128]>; + readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>; readonly type: 'StakingRecalculation'; } @@ -2682,22 +2682,26 @@ declare module '@polkadot/types/lookup' { readonly asSponsorCollection: { readonly collectionId: u32; } & Struct; - readonly isStopSponsorignCollection: boolean; - readonly asStopSponsorignCollection: { + readonly isStopSponsoringCollection: boolean; + readonly asStopSponsoringCollection: { readonly collectionId: u32; } & Struct; readonly isSponsorConract: boolean; readonly asSponsorConract: { readonly contractId: H160; } & Struct; - readonly isStopSponsorignContract: boolean; - readonly asStopSponsorignContract: { + readonly isStopSponsoringContract: boolean; + readonly asStopSponsoringContract: { readonly contractId: H160; } & Struct; - readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'StopAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsorignCollection' | 'SponsorConract' | 'StopSponsorignContract'; + readonly isPayoutStakers: boolean; + readonly asPayoutStakers: { + readonly stakersNumber: Option; + } & Struct; + readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'StopAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorConract' | 'StopSponsoringContract' | 'PayoutStakers'; } - /** @name PalletEvmCall (305) */ + /** @name PalletEvmCall (306) */ interface PalletEvmCall extends Enum { readonly isWithdraw: boolean; readonly asWithdraw: { @@ -2742,7 +2746,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name PalletEthereumCall (309) */ + /** @name PalletEthereumCall (310) */ interface PalletEthereumCall extends Enum { readonly isTransact: boolean; readonly asTransact: { @@ -2751,7 +2755,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transact'; } - /** @name EthereumTransactionTransactionV2 (310) */ + /** @name EthereumTransactionTransactionV2 (311) */ interface EthereumTransactionTransactionV2 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumTransactionLegacyTransaction; @@ -2762,7 +2766,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumTransactionLegacyTransaction (311) */ + /** @name EthereumTransactionLegacyTransaction (312) */ interface EthereumTransactionLegacyTransaction extends Struct { readonly nonce: U256; readonly gasPrice: U256; @@ -2773,7 +2777,7 @@ declare module '@polkadot/types/lookup' { readonly signature: EthereumTransactionTransactionSignature; } - /** @name EthereumTransactionTransactionAction (312) */ + /** @name EthereumTransactionTransactionAction (313) */ interface EthereumTransactionTransactionAction extends Enum { readonly isCall: boolean; readonly asCall: H160; @@ -2781,14 +2785,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Call' | 'Create'; } - /** @name EthereumTransactionTransactionSignature (313) */ + /** @name EthereumTransactionTransactionSignature (314) */ interface EthereumTransactionTransactionSignature extends Struct { readonly v: u64; readonly r: H256; readonly s: H256; } - /** @name EthereumTransactionEip2930Transaction (315) */ + /** @name EthereumTransactionEip2930Transaction (316) */ interface EthereumTransactionEip2930Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -2803,13 +2807,13 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name EthereumTransactionAccessListItem (317) */ + /** @name EthereumTransactionAccessListItem (318) */ interface EthereumTransactionAccessListItem extends Struct { readonly address: H160; readonly storageKeys: Vec; } - /** @name EthereumTransactionEip1559Transaction (318) */ + /** @name EthereumTransactionEip1559Transaction (319) */ interface EthereumTransactionEip1559Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -2825,7 +2829,7 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name PalletEvmMigrationCall (319) */ + /** @name PalletEvmMigrationCall (320) */ interface PalletEvmMigrationCall extends Enum { readonly isBegin: boolean; readonly asBegin: { @@ -2844,13 +2848,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Begin' | 'SetData' | 'Finish'; } - /** @name PalletSudoError (322) */ + /** @name PalletSudoError (323) */ interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: 'RequireSudo'; } - /** @name OrmlVestingModuleError (324) */ + /** @name OrmlVestingModuleError (325) */ interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; @@ -2861,21 +2865,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (326) */ + /** @name CumulusPalletXcmpQueueInboundChannelDetails (327) */ interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (327) */ + /** @name CumulusPalletXcmpQueueInboundState (328) */ interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (330) */ + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (331) */ interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; @@ -2883,7 +2887,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (333) */ + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (334) */ interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; @@ -2892,14 +2896,14 @@ declare module '@polkadot/types/lookup' { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (334) */ + /** @name CumulusPalletXcmpQueueOutboundState (335) */ interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (336) */ + /** @name CumulusPalletXcmpQueueQueueConfigData (337) */ interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; @@ -2909,7 +2913,7 @@ declare module '@polkadot/types/lookup' { readonly xcmpMaxIndividualWeight: u64; } - /** @name CumulusPalletXcmpQueueError (338) */ + /** @name CumulusPalletXcmpQueueError (339) */ interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; @@ -2919,7 +2923,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (339) */ + /** @name PalletXcmError (340) */ interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; @@ -2937,29 +2941,29 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (340) */ + /** @name CumulusPalletXcmError (341) */ type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (341) */ + /** @name CumulusPalletDmpQueueConfigData (342) */ interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: u64; } - /** @name CumulusPalletDmpQueuePageIndexData (342) */ + /** @name CumulusPalletDmpQueuePageIndexData (343) */ interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (345) */ + /** @name CumulusPalletDmpQueueError (346) */ interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (349) */ + /** @name PalletUniqueError (350) */ interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; @@ -2968,7 +2972,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name PalletUniqueSchedulerScheduledV3 (352) */ + /** @name PalletUniqueSchedulerScheduledV3 (353) */ interface PalletUniqueSchedulerScheduledV3 extends Struct { readonly maybeId: Option; readonly priority: u8; @@ -2977,7 +2981,7 @@ declare module '@polkadot/types/lookup' { readonly origin: OpalRuntimeOriginCaller; } - /** @name OpalRuntimeOriginCaller (353) */ + /** @name OpalRuntimeOriginCaller (354) */ interface OpalRuntimeOriginCaller extends Enum { readonly isSystem: boolean; readonly asSystem: FrameSupportDispatchRawOrigin; @@ -2991,7 +2995,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; } - /** @name FrameSupportDispatchRawOrigin (354) */ + /** @name FrameSupportDispatchRawOrigin (355) */ interface FrameSupportDispatchRawOrigin extends Enum { readonly isRoot: boolean; readonly isSigned: boolean; @@ -3000,7 +3004,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Root' | 'Signed' | 'None'; } - /** @name PalletXcmOrigin (355) */ + /** @name PalletXcmOrigin (356) */ interface PalletXcmOrigin extends Enum { readonly isXcm: boolean; readonly asXcm: XcmV1MultiLocation; @@ -3009,7 +3013,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Xcm' | 'Response'; } - /** @name CumulusPalletXcmOrigin (356) */ + /** @name CumulusPalletXcmOrigin (357) */ interface CumulusPalletXcmOrigin extends Enum { readonly isRelay: boolean; readonly isSiblingParachain: boolean; @@ -3017,17 +3021,17 @@ declare module '@polkadot/types/lookup' { readonly type: 'Relay' | 'SiblingParachain'; } - /** @name PalletEthereumRawOrigin (357) */ + /** @name PalletEthereumRawOrigin (358) */ interface PalletEthereumRawOrigin extends Enum { readonly isEthereumTransaction: boolean; readonly asEthereumTransaction: H160; readonly type: 'EthereumTransaction'; } - /** @name SpCoreVoid (358) */ + /** @name SpCoreVoid (359) */ type SpCoreVoid = Null; - /** @name PalletUniqueSchedulerError (359) */ + /** @name PalletUniqueSchedulerError (360) */ interface PalletUniqueSchedulerError extends Enum { readonly isFailedToSchedule: boolean; readonly isNotFound: boolean; @@ -3036,7 +3040,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; } - /** @name UpDataStructsCollection (360) */ + /** @name UpDataStructsCollection (361) */ interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3049,7 +3053,7 @@ declare module '@polkadot/types/lookup' { readonly externalCollection: bool; } - /** @name UpDataStructsSponsorshipStateAccountId32 (361) */ + /** @name UpDataStructsSponsorshipStateAccountId32 (362) */ interface UpDataStructsSponsorshipStateAccountId32 extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3059,43 +3063,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (362) */ + /** @name UpDataStructsProperties (363) */ interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (363) */ + /** @name UpDataStructsPropertiesMapBoundedVec (364) */ interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (368) */ + /** @name UpDataStructsPropertiesMapPropertyPermission (369) */ interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (375) */ + /** @name UpDataStructsCollectionStats (376) */ interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (376) */ + /** @name UpDataStructsTokenChild (377) */ interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (377) */ + /** @name PhantomTypeUpDataStructs (378) */ interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (379) */ + /** @name UpDataStructsTokenData (380) */ interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (381) */ + /** @name UpDataStructsRpcCollection (382) */ interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3110,7 +3114,7 @@ declare module '@polkadot/types/lookup' { readonly readOnly: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (382) */ + /** @name RmrkTraitsCollectionCollectionInfo (383) */ interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; @@ -3119,7 +3123,7 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (383) */ + /** @name RmrkTraitsNftNftInfo (384) */ interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; @@ -3128,13 +3132,13 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (385) */ + /** @name RmrkTraitsNftRoyaltyInfo (386) */ interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (386) */ + /** @name RmrkTraitsResourceResourceInfo (387) */ interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; @@ -3142,26 +3146,26 @@ declare module '@polkadot/types/lookup' { readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (387) */ + /** @name RmrkTraitsPropertyPropertyInfo (388) */ interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (388) */ + /** @name RmrkTraitsBaseBaseInfo (389) */ interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (389) */ + /** @name RmrkTraitsNftNftChild (390) */ interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (391) */ + /** @name PalletCommonError (392) */ interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; @@ -3200,7 +3204,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (393) */ + /** @name PalletFungibleError (394) */ interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; @@ -3210,12 +3214,12 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (394) */ + /** @name PalletRefungibleItemData (395) */ interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } - /** @name PalletRefungibleError (399) */ + /** @name PalletRefungibleError (400) */ interface PalletRefungibleError extends Enum { readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isWrongRefungiblePieces: boolean; @@ -3225,12 +3229,12 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletNonfungibleItemData (400) */ + /** @name PalletNonfungibleItemData (401) */ interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (402) */ + /** @name UpDataStructsPropertyScope (403) */ interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; @@ -3238,7 +3242,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'None' | 'Rmrk' | 'Eth'; } - /** @name PalletNonfungibleError (404) */ + /** @name PalletNonfungibleError (405) */ interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; @@ -3246,7 +3250,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (405) */ + /** @name PalletStructureError (406) */ interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; @@ -3255,7 +3259,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletRmrkCoreError (406) */ + /** @name PalletRmrkCoreError (407) */ interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; @@ -3279,7 +3283,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } - /** @name PalletRmrkEquipError (408) */ + /** @name PalletRmrkEquipError (409) */ interface PalletRmrkEquipError extends Enum { readonly isPermissionError: boolean; readonly isNoAvailableBaseId: boolean; @@ -3291,7 +3295,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; } - /** @name PalletAppPromotionError (410) */ + /** @name PalletAppPromotionError (412) */ interface PalletAppPromotionError extends Enum { readonly isAdminNotSet: boolean; readonly isNoPermission: boolean; @@ -3300,7 +3304,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'InvalidArgument'; } - /** @name PalletEvmError (413) */ + /** @name PalletEvmError (415) */ interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; @@ -3311,7 +3315,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (416) */ + /** @name FpRpcTransactionStatus (418) */ interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; @@ -3322,10 +3326,10 @@ declare module '@polkadot/types/lookup' { readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (418) */ + /** @name EthbloomBloom (420) */ interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (420) */ + /** @name EthereumReceiptReceiptV3 (422) */ interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; @@ -3336,7 +3340,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (421) */ + /** @name EthereumReceiptEip658ReceiptData (423) */ interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; @@ -3344,14 +3348,14 @@ declare module '@polkadot/types/lookup' { readonly logs: Vec; } - /** @name EthereumBlock (422) */ + /** @name EthereumBlock (424) */ interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (423) */ + /** @name EthereumHeader (425) */ interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; @@ -3370,24 +3374,24 @@ declare module '@polkadot/types/lookup' { readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (424) */ + /** @name EthereumTypesHashH64 (426) */ interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (429) */ + /** @name PalletEthereumError (431) */ interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (430) */ + /** @name PalletEvmCoderSubstrateError (432) */ interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (431) */ + /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (433) */ interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3397,7 +3401,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name PalletEvmContractHelpersSponsoringModeT (432) */ + /** @name PalletEvmContractHelpersSponsoringModeT (434) */ interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; @@ -3405,21 +3409,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (434) */ + /** @name PalletEvmContractHelpersError (436) */ interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly isNoPendingSponsor: boolean; readonly type: 'NoPermission' | 'NoPendingSponsor'; } - /** @name PalletEvmMigrationError (435) */ + /** @name PalletEvmMigrationError (437) */ interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (437) */ + /** @name SpRuntimeMultiSignature (439) */ interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; @@ -3430,34 +3434,34 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (438) */ + /** @name SpCoreEd25519Signature (440) */ interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (440) */ + /** @name SpCoreSr25519Signature (442) */ interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (441) */ + /** @name SpCoreEcdsaSignature (443) */ interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (444) */ + /** @name FrameSystemExtensionsCheckSpecVersion (446) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (445) */ + /** @name FrameSystemExtensionsCheckGenesis (447) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (448) */ + /** @name FrameSystemExtensionsCheckNonce (450) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (449) */ + /** @name FrameSystemExtensionsCheckWeight (451) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (450) */ + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (452) */ interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (451) */ + /** @name OpalRuntimeRuntime (453) */ type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (452) */ + /** @name PalletEthereumFakeTransactionFinalizer (454) */ type PalletEthereumFakeTransactionFinalizer = Null; } // declare module From daf5420dd5ee582d7740413f0fb2831de0f44177 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Mon, 29 Aug 2022 19:15:25 +0000 Subject: [PATCH 0630/1274] Move old tests to playgrounds-helpers --- tests/src/app-promotion.test.ts | 415 ++++++++------------------------ 1 file changed, 107 insertions(+), 308 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 92f7c5e993..f751316be2 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -36,6 +36,7 @@ let bob: IKeyringPair; let palletAdmin: IKeyringPair; let nominal: bigint; let promotionStartBlock: number | null = null; +const palletAddress = calculatePalleteAddress('appstake'); before(async function () { await usingPlaygrounds(async (helper, privateKeyWrapper) => { @@ -43,13 +44,24 @@ before(async function () { alice = privateKeyWrapper('//Alice'); bob = privateKeyWrapper('//Bob'); palletAdmin = privateKeyWrapper('//palletAdmin'); - await helper.balance.transferToSubstrate(alice, palletAdmin.address, 10n * helper.balance.getOneTokenNominal()); nominal = helper.balance.getOneTokenNominal(); + await helper.balance.transferToSubstrate(alice, palletAdmin.address, 100n * nominal); + await helper.balance.transferToSubstrate(alice, palletAddress, 100n * nominal); + if (!promotionStartBlock) { + promotionStartBlock = (await helper.api!.query.parachainSystem.lastRelayChainBlockNumber()).toNumber(); + } + await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.startAppPromotion(promotionStartBlock!))); + }); +}); + +after(async function () { + await usingPlaygrounds(async (helper) => { + await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.stopAppPromotion())); }); }); describe('app-promotions.stake extrinsic', () => { - it('will change balance state to "locked", add it to "staked" map, and increase "totalStaked" amount', async () => { + it('should change balance state to "locked", add it to "staked" map, and increase "totalStaked" amount', async () => { await usingPlaygrounds(async (helper) => { const totalStakedBefore = await helper.staking.getTotalStaked(); const [staker] = await helper.arrange.creteAccounts([10n], alice); @@ -73,7 +85,7 @@ describe('app-promotions.stake extrinsic', () => { }); }); - it('will throws if stake amount is more than total free balance', async () => { + it('should reject transaction if stake amount is more than total free balance', async () => { await usingPlaygrounds(async helper => { const [staker] = await helper.arrange.creteAccounts([10n], alice); @@ -101,11 +113,10 @@ describe('app-promotions.stake extrinsic', () => { // TODO it('Staker stakes 5 times in one block with nonce'); // TODO it('Staked balance appears as locked in the balance pallet'); // TODO it('Alice stakes huge amount of tokens'); - // TODO it('Can stake from ethereum account') }); describe('unstake balance extrinsic', () => { - it('will change balance state to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => { + it('should change balance state to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => { await usingPlaygrounds(async helper => { const totalStakedBefore = await helper.staking.getTotalStaked(); const [staker] = await helper.arrange.creteAccounts([10n], alice); @@ -118,7 +129,7 @@ describe('unstake balance extrinsic', () => { }); }); - it('will remove from the "staked" map starting from the oldest entry', async () => { + it('should remove from the "staked" map starting from the oldest entry', async () => { await usingPlaygrounds(async helper => { const [staker] = await helper.arrange.creteAccounts([100n], alice); await helper.staking.stake(staker, 10n * nominal); @@ -239,8 +250,6 @@ describe('Admin adress', () => { await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled; // ...It doesn't break anything; - console.log(await helper.balance.getSubstrate(charlie.address)); - console.log(await helper.balance.getSubstrate(palletAdmin.address)); const collection = await helper.nft.mintCollection(charlie, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await expect(helper.signTransaction(charlie, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; }); @@ -262,266 +271,137 @@ describe('Admin adress', () => { describe('App-promotion collection sponsoring', () => { before(async function () { - await usingPlaygrounds(async (helper, privateKeyWrapper) => { - if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - palletAdmin = privateKeyWrapper('//palletAdmin'); - await helper.balance.transferToSubstrate(alice, palletAdmin.address, 10n * helper.balance.getOneTokenNominal()); - await helper.balance.transferToSubstrate(alice, calculatePalleteAddress('appstake'), 10n * helper.balance.getOneTokenNominal()); - - - const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); + await usingPlaygrounds(async (helper) => { + const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address})); await helper.signTransaction(alice, tx); - - // const txStart = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.startAppPromotion(promotionStartBlock)); - // await helper.signTransaction(alice, txStart); - - nominal = helper.balance.getOneTokenNominal(); }); }); it('can not be set by non admin', async () => { - - - // arrange: Charlie creates Punks - // arrange: Sudo calls appPromotion.setAdminAddress(Alice) - - // assert: Random calls appPromotion.sponsorCollection(Punks.id) throws /// Random account can not set sponsoring - // assert: Alice calls appPromotion.sponsorCollection(Punks.id) success /// Admin account can set sponsoring - - await usingPlaygrounds(async (helper) => { - const colletcion = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - - const collectionId = colletcion.collectionId; - - await expect(helper.signTransaction(bob, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.rejected; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; - }); - - }); - - it('will set pallet address as confirmed admin for collection without sponsor', async () => { - // arrange: Charlie creates Punks - - // act: Admin calls appPromotion.sponsorCollection(Punks.id) - - // assert: query collectionById: Punks sponsoring is confirmed by PalleteAddress - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - const collectionId = collection.collectionId; + const [collectionOwner, nonAdmin] = await helper.arrange.creteAccounts([10n, 10n], alice); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: calculatePalleteAddress('appstake')}); + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; + expect((await collection.getData())?.raw.sponsorship).to.equal('Disabled'); }); - }); - it('will set pallet address as confirmed admin for collection with unconfirmed sponsor', async () => { - // arrange: Charlie creates Punks - // arrange: Charlie calls setCollectionSponsor(Punks.Id, Dave) /// Dave is unconfirmed sponsor - - // act: Admin calls appPromotion.sponsorCollection(Punks.id) - - // assert: query collectionById: Punks sponsoring is confirmed by PalleteAddress - + it('should set pallet address as confirmed admin', async () => { await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await collection.setSponsor(alice, bob.address); - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: bob.address}); - - const collectionId = collection.collectionId; + const [collectionOwner, oldSponsor] = await helper.arrange.creteAccounts([20n, 20n], alice); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: calculatePalleteAddress('appstake')}); - }); - - }); - - it('will set pallet address as confirmed admin for collection with confirmed sponsor', async () => { - // arrange: Charlie creates Punks - // arrange: setCollectionSponsor(Punks.Id, Dave) - // arrange: confirmSponsorship(Punks.Id, Dave) /// Dave is confirmed sponsor + // Can set sponsoring for collection without sponsor + const collectionWithoutSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'No-sponsor', description: 'New Collection', tokenPrefix: 'Promotion'}); + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.eventually.fulfilled; + expect((await collectionWithoutSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); - // act: Admin calls appPromotion.sponsorCollection(Punks.id) + // Can set sponsoring for collection with unconfirmed sponsor + const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); + expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address}); + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.eventually.fulfilled; + expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); - // assert: query collectionById: Punks sponsoring is confirmed by PalleteAddress - - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await collection.setSponsor(alice, bob.address); - - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: bob.address}); - expect(await collection.confirmSponsorship(bob)).to.be.true; - - const collectionId = collection.collectionId; - - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: calculatePalleteAddress('appstake')}); + // Can set sponsoring for collection with confirmed sponsor + const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); + await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor); + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.eventually.fulfilled; + expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); }); }); - it('can be overwritten by collection owner', async () => { - // arrange: Charlie creates Punks - // arrange: appPromotion.sponsorCollection(Punks.Id) /// Sponsor of Punks is pallete - - // act: Charlie calls unique.setCollectionLimits(limits) /// Charlie as owner can successfully change limits - // assert: query collectionById(Punks.id) 1. sponsored by pallete, 2. limits has been changed - - // act: Charlie calls setCollectionSponsor(Dave) /// Collection owner reasignes sponsoring - // assert: query collectionById: Punks sponsoring is unconfirmed by Dave - + it('can be overwritten by collection owner', async () => { await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + const [collectionOwner, newSponsor] = await helper.arrange.creteAccounts([20n, 0n], alice); + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); const collectionId = collection.collectionId; await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: calculatePalleteAddress('appstake')}); - expect(await collection.setLimits(alice, {sponsorTransferTimeout: 0})).to.be.true; + // Collection limits still can be changed by the owner + expect(await collection.setLimits(collectionOwner, {sponsorTransferTimeout: 0})).to.be.true; expect((await collection.getData())?.raw.limits.sponsorTransferTimeout).to.be.equal(0); - - expect((await collection.setSponsor(alice, bob.address))).to.be.true; - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: bob.address}); + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); + + // Collection sponsor can be changed too + expect((await collection.setSponsor(collectionOwner, newSponsor.address))).to.be.true; + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: newSponsor.address}); }); - }); - it('will keep collection limits set by the owner earlier', async () => { - // arrange: const limits = {...all possible collection limits} - // arrange: Charlie creates Punks - // arrange: Charlie calls unique.setCollectionLimits(limits) /// Owner sets all possible limits - - // act: Admin calls appPromotion.sponsorCollection(Punks.id) - // assert: query collectionById(Punks.id) returns limits - + it('should not overwrite collection limits set by the owner earlier', async () => { await usingPlaygrounds(async (helper) => { - - const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - expect(await collection.setLimits(alice, {sponsorTransferTimeout: 0})).to.be.true; - const limits = (await collection.getData())?.raw.limits; - - const collectionId = collection.collectionId; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; - expect((await collection.getData())?.raw.limits).to.be.deep.equal(limits); + const limits = {ownerCanDestroy: true, ownerCanTransfer: true, sponsorTransferTimeout: 0}; + const collectionWithLimits = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits}); + + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.eventually.fulfilled; + expect((await collectionWithLimits.getData())?.raw.limits).to.be.deep.contain(limits); }); - }); - it('will throw if collection doesn\'t exist', async () => { - // assert: Admin calls appPromotion.sponsorCollection(999999999999999) throw + it('should reject transaction if collection doesn\'t exist', async () => { await usingPlaygrounds(async (helper) => { await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(999999999))).to.be.eventually.rejected; }); }); - it('will throw if collection was burnt', async () => { - // arrange: Charlie creates Punks - // arrange: Charlie burns Punks - - // assert: Admin calls appPromotion.sponsorCollection(Punks.id) throw - + it('should reject transaction if collection was burnt', async () => { await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - const collectionId = collection.collectionId; - - expect((await collection.burn(alice))).to.be.true; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.rejected; + const [collectionOwner] = await helper.arrange.creteAccounts([10n], alice); + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + await collection.burn(collectionOwner); + + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; }); - }); }); - describe('app-promotion stopSponsoringCollection', () => { - before(async function () { - await usingPlaygrounds(async (helper, privateKeyWrapper) => { - if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - palletAdmin = privateKeyWrapper('//palletAdmin'); - await helper.balance.transferToSubstrate(alice, palletAdmin.address, 10n * helper.balance.getOneTokenNominal()); - await helper.balance.transferToSubstrate(alice, calculatePalleteAddress('appstake'), 10n * helper.balance.getOneTokenNominal()); - - const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); - await helper.signTransaction(alice, tx); - - nominal = helper.balance.getOneTokenNominal(); - }); - }); - - it('can not be called by non-admin', async () => { - // arrange: Alice creates Punks - // arrange: appPromotion.sponsorCollection(Punks.Id) - - // assert: Random calls appPromotion.stopSponsoringCollection(Punks) throws - // assert: query collectionById(Punks.id): sponsoring confirmed by PalleteAddress - + it('can not be called by non-admin', async () => { await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - const collectionId = collection.collectionId; + const [collectionOwner, nonAdmin] = await helper.arrange.creteAccounts([10n, 10n], alice); + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(bob, helper.api!.tx.promotion.stopSponsorignCollection(collectionId))).to.be.eventually.rejected; - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: calculatePalleteAddress('appstake')}); + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.stopSponsorignCollection(collection.collectionId))).to.be.eventually.rejected; + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); }); }); - it('will set sponsoring as disabled', async () => { - // arrange: Alice creates Punks - // arrange: appPromotion.sponsorCollection(Punks.Id) - - // act: Admin calls appPromotion.stopSponsoringCollection(Punks) - - // assert: query collectionById(Punks.id): sponsoring unconfirmed - + it('should set sponsoring as disabled', async () => { await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - const collectionId = collection.collectionId; + const [collectionOwner] = await helper.arrange.creteAccounts([10n, 10n], alice); + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsorignCollection(collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsorignCollection(collection.collectionId))).to.be.eventually.fulfilled; expect((await collection.getData())?.raw.sponsorship).to.be.equal('Disabled'); }); }); - it('will not affect collection which is not sponsored by pallete', async () => { - // arrange: Alice creates Punks - // arrange: Alice calls setCollectionSponsoring(Punks) - // arrange: Alice calls confirmSponsorship(Punks) - - // act: Admin calls appPromotion.stopSponsoringCollection(A) - // assert: query collectionById(Punks): Sponsoring: {Confirmed: Alice} /// Alice still collection owner - + it('should not affect collection which is not sponsored by pallete', async () => { await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - const collectionId = collection.collectionId; - expect(await collection.setSponsor(alice, alice.address)).to.be.true; - expect(await collection.confirmSponsorship(alice)).to.be.true; + const [collectionOwner] = await helper.arrange.creteAccounts([10n, 10n], alice); + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address}); + await collection.confirmSponsorship(collectionOwner); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsorignCollection(collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsorignCollection(collection.collectionId))).to.be.eventually.rejected; - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: alice.address}); + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: collectionOwner.address}); }); - }); - it('will throw if collection does not exist', async () => { - // arrange: Alice creates Punks - // arrange: Alice burns Punks - - // assert: Admin calls appPromotion.stopSponsoringCollection(Punks.id) throws - // assert: Admin calls appPromotion.stopSponsoringCollection(999999999999999) throw - + it('should reject transaction if collection does not exist', async () => { await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - const collectionId = collection.collectionId; + const [collectionOwner] = await helper.arrange.creteAccounts([10n], alice); + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - expect((await collection.burn(alice))).to.be.true; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsorignCollection(collectionId))).to.be.eventually.rejected; + await collection.burn(collectionOwner); + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsorignCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsorignCollection(999999999))).to.be.eventually.rejected; }); }); }); @@ -593,7 +473,7 @@ describe('app-promotion stopSponsoringContract', () => { bob = privateKeyWrapper('//Bob'); palletAdmin = privateKeyWrapper('//palletAdmin'); await helper.balance.transferToSubstrate(alice, palletAdmin.address, 10n * helper.balance.getOneTokenNominal()); - await helper.balance.transferToSubstrate(alice, calculatePalleteAddress('appstake'), 10n * helper.balance.getOneTokenNominal()); + await helper.balance.transferToSubstrate(alice, palletAddress, 10n * helper.balance.getOneTokenNominal()); const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); await helper.signTransaction(alice, tx); @@ -641,120 +521,47 @@ describe('app-promotion stopSponsoringContract', () => { }); describe('app-promotion rewards', () => { - const DAY = 7200n; - - // TODO (load test. Can pay reward for 10000 addresses) - - - before(async function () { - await usingPlaygrounds(async (helper, privateKeyWrapper) => { - if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - palletAdmin = privateKeyWrapper('//palletAdmin'); - if (promotionStartBlock == null) { - promotionStartBlock = (await helper.api!.query.parachainSystem.lastRelayChainBlockNumber()).toNumber(); - } - const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); - await helper.signTransaction(alice, tx); - - const txStart = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.startAppPromotion(promotionStartBlock!)); - await helper.signTransaction(alice, txStart); - - nominal = helper.balance.getOneTokenNominal(); - }); - }); - - after(async function () { - await usingPlaygrounds(async (helper) => { - await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.stopAppPromotion())); - }); - }); - - it('will credit 0.05% for staking period', async () => { - // arrange: bob.stake(10000); - // arrange: bob.stake(20000); - // arrange: waitForRewards(); - - // assert: bob.staked to equal [10005, 20010] - + it('should credit 0.05% for staking period', async () => { await usingPlaygrounds(async helper => { - const staker = await createUser(50n * nominal); + const [staker] = await helper.arrange.creteAccounts([50n], alice); await waitForRecalculationBlock(helper.api!); - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(1n * nominal))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(2n * nominal))).to.be.eventually.fulfilled; + await helper.staking.stake(staker, 1n * nominal); + await helper.staking.stake(staker, 2n * nominal); await waitForRelayBlock(helper.api!, 36); - - expect((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))) - .map(([_, amount]) => amount.toBigInt())) - .to.be.deep.equal([calculateIncome(nominal, 10n), calculateIncome(2n * nominal, 10n)]); + const totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); + expect(totalStakedPerBlock).to.be.deep.equal([calculateIncome(nominal, 10n), calculateIncome(2n * nominal, 10n)]); }); - }); - it('will not be credited for unstaked (reserved) balance', async () => { - // arrange: bob.stake(10000); - // arrange: bob.unstake(5000); - // arrange: waitForRewards(); - - // assert: bob.staked to equal [5002.5] + it('should not be credited for unstaked (reserved) balance', async () => { await usingPlaygrounds(async helper => { - const staker = await createUser(20n * nominal); - await waitForRecalculationBlock(helper.api!); - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.unstake(5n * nominal))).to.be.eventually.fulfilled; - await waitForRelayBlock(helper.api!, 38); - - expect((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))) - .map(([_, amount]) => amount.toBigInt())) - .to.be.deep.equal([calculateIncome(5n * nominal, 10n)]); - + expect.fail('Implement me after unstake method will be fixed'); }); - }); - it('will bring compound interest', async () => { - // arrange: bob balance = 30000 - // arrange: bob.stake(10000); - // arrange: bob.stake(10000); - // arrange: waitForRewards(); - - // assert: bob.staked() equal [10005, 10005, 10005] /// 10_000 * 1.0005 - // act: waitForRewards(); - - // assert: bob.staked() equal [10010.0025, 10010.0025, 10010.0025] /// 10_005 * 1.0005 - // act: bob.unstake(10.0025) - // assert: bob.staked() equal [10000, 10010.0025, 10010.0025] /// 10_005 * 1.0005 - - // act: waitForRewards(); - // assert: bob.staked() equal [10005, 10015,00750125, 10015,00750125] /// + it('should bring compound interest', async () => { await usingPlaygrounds(async helper => { - const staker = await createUser(40n * nominal); + const [staker] = await helper.arrange.creteAccounts([80n], alice); await waitForRecalculationBlock(helper.api!); - - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.fulfilled; - - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.fulfilled; - - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.stake(10n * nominal))).to.be.eventually.fulfilled; + await helper.staking.stake(staker, 10n * nominal); + await helper.staking.stake(staker, 20n * nominal); + await helper.staking.stake(staker, 30n * nominal); await waitForRelayBlock(helper.api!, 34); - expect((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))) - .map(([_, amount]) => amount.toBigInt())) - .to.be.deep.equal([calculateIncome(10n * nominal, 10n), calculateIncome(10n * nominal, 10n), calculateIncome(10n * nominal, 10n)]); + let totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); + expect(totalStakedPerBlock).to.deep.equal([calculateIncome(10n * nominal, 10n), calculateIncome(20n * nominal, 10n), calculateIncome(30n * nominal, 10n)]); await waitForRelayBlock(helper.api!, 20); - await expect(helper.signTransaction(staker, helper.api!.tx.promotion.unstake(calculateIncome(10n * nominal, 10n, 2) - 10n * nominal))).to.be.eventually.fulfilled; - expect((await helper.api!.rpc.unique.totalStakedPerBlock(normalizeAccountId(staker))) - .map(([_, amount]) => amount.toBigInt())) - .to.be.deep.equal([10n * nominal, calculateIncome(10n * nominal, 10n, 2), calculateIncome(10n * nominal, 10n, 2)]); + totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); + expect(totalStakedPerBlock).to.deep.equal([calculateIncome(10n * nominal, 10n, 2), calculateIncome(20n * nominal, 10n, 2), calculateIncome(30n * nominal, 10n, 2)]); }); - }); + + // TODO (load test. Can pay reward for 10000 addresses) }); @@ -789,11 +596,11 @@ async function waitForRelayBlock(api: ApiPromise, blocks = 1): Promise { }); } - function calculatePalleteAddress(palletId: any) { const address = stringToU8a(('modl' + palletId).padEnd(32, '\0')); return encodeAddress(address); } + function calculateIncome(base: bigint, calcPeriod: bigint, iter = 0): bigint { const DAY = 7200n; const ACCURACY = 1_000_000_000n; @@ -803,11 +610,3 @@ function calculateIncome(base: bigint, calcPeriod: bigint, iter = 0): bigint { return calculateIncome(income, calcPeriod, iter - 1); } else return income; } - -async function createUser(amount?: bigint) { - return await usingPlaygrounds(async helper => { - const user: IKeyringPair = helper.util.fromSeed(mnemonicGenerate()); - await helper.balance.transferToSubstrate(alice, user.address, amount ? amount : 10n * helper.balance.getOneTokenNominal()); - return user; - }); -} From ab7da3bbb8df5913171fbb1d65f42beb43749cbb Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 30 Aug 2022 17:55:49 +0700 Subject: [PATCH 0631/1274] add opal for xcm workflow --- .../xcm-config/launch-config-xcm-opal.json | 134 ++++++++++++++++++ .env | 6 +- .github/workflows/xcm-testnet.yml | 8 +- 3 files changed, 142 insertions(+), 6 deletions(-) create mode 100644 .docker/xcm-config/launch-config-xcm-opal.json diff --git a/.docker/xcm-config/launch-config-xcm-opal.json b/.docker/xcm-config/launch-config-xcm-opal.json new file mode 100644 index 0000000000..b74af89925 --- /dev/null +++ b/.docker/xcm-config/launch-config-xcm-opal.json @@ -0,0 +1,134 @@ +{ + "relaychain": { + "bin": "/polkadot/target/release/polkadot", + "chain": "westend-local", + "chainInitializer": [ + "chainql", + "--tla-code=spec=import '${spec}'", + "5validators.jsonnet" + ], + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + } + + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "/unique-chain/target/release/unique-collator", + "id": "2095", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + }, + { + "bin": "/cumulus/target/release/cumulus", + "id": "1000", + "chain": "westmint-local", + "balance": "1000000000000000000000000", + "nodes": [ + { + "wsPort": 9948, + "port": 31204, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [ + { + "sender": 2095, + "recipient": 1000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 1000, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + } + ], + "finalization": false +} + diff --git a/.env b/.env index 6b6c05f19c..7a082b1dfd 100644 --- a/.env +++ b/.env @@ -2,10 +2,12 @@ RUST_TOOLCHAIN=nightly-2022-07-24 POLKADOT_BUILD_BRANCH=release-v0.9.27 POLKADOT_MAINNET_BRANCH=release-v0.9.26 -UNIQUE_MAINNET_TAG=release-v927020 +UNIQUE_MAINNET_TAG=feature/multi-assets-redone KUSAMA_MAINNET_BRANCH=release-v0.9.26 -QUARTZ_MAINNET_TAG=release-v927020 +QUARTZ_MAINNET_TAG=feature/multi-assets-redone + +OPAL_MAINNET_TAG=feature/multi-assets-redone OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443 QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 diff --git a/.github/workflows/xcm-testnet.yml b/.github/workflows/xcm-testnet.yml index 5307323a46..7b2e4d0741 100644 --- a/.github/workflows/xcm-testnet.yml +++ b/.github/workflows/xcm-testnet.yml @@ -52,7 +52,7 @@ jobs: id: create_matrix with: matrix: | - # network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} @@ -114,7 +114,7 @@ jobs: POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} FEATURE=${{ matrix.features }} RUNTIME=${{ matrix.runtime }} - BRANCH=${{ matrix.mainnet_branch }} + BRANCH=${{ mainnet_branch }} ACALA_BUILD_BRANCH=${{ env.ACALA_BUILD_BRANCH }} MOONBEAM_BUILD_BRANCH=${{ env.MOONBEAM_BUILD_BRANCH }} CUMULUS_BUILD_BRANCH=${{ env.CUMULUS_BUILD_BRANCH }} @@ -126,7 +126,7 @@ jobs: run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json - name: Build the stack - run: cd .docker/ && docker build --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag xcm-nodes-${{ matrix.network }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . + run: cd .docker/ && docker build --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag xcm-nodes-${{ matrix.network }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ mainnet_branch }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . # - name: Collect Docker Logs # if: success() || failure() @@ -146,7 +146,7 @@ jobs: password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - name: Push docker version image - run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} + run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ mainnet_branch }}-${{ github.sha }} - name: Push docker image latest run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest From 269ae53b476124711108782b070d24564e16b9b2 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 30 Aug 2022 18:22:25 +0700 Subject: [PATCH 0632/1274] bug fix for moonriver --- .docker/Dockerfile-xcm.j2 | 5 ++++- .docker/xcm-config/launch-config-xcm-quartz.json | 5 +++++ .docker/xcm-config/minBondFix.jsonnet | 10 ++++++++++ .env | 6 +++--- .github/workflows/xcm-testnet.yml | 6 +++--- 5 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 .docker/xcm-config/minBondFix.jsonnet diff --git a/.docker/Dockerfile-xcm.j2 b/.docker/Dockerfile-xcm.j2 index b93c04337a..c03be3363e 100644 --- a/.docker/Dockerfile-xcm.j2 +++ b/.docker/Dockerfile-xcm.j2 @@ -39,6 +39,7 @@ WORKDIR /unique_parachain COPY ./xcm-config/launch-config-xcm-{{ NETWORK }}.json ./launch-config-xcm-{{ NETWORK }}.json COPY ./xcm-config/5validators.jsonnet ./5validators.jsonnet +COPY ./xcm-config/minBondFix.jsonnet ./minBondFix.jsonnet RUN git clone -b {{ BRANCH }} https://github.com/UniqueNetwork/unique-chain.git && \ cd unique-chain && \ @@ -129,9 +130,11 @@ RUN export NVM_DIR="$HOME/.nvm" && \ npm install --global yarn && \ yarn install -COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ COPY --from=builder-unique /unique_parachain/launch-config-xcm-{{ NETWORK }}.json /polkadot-launch/ COPY --from=builder-unique /unique_parachain/5validators.jsonnet /polkadot-launch/5validators.jsonnet +COPY --from=builder-unique /unique_parachain/minBondFix.jsonnet /polkadot-launch/minBondFix.jsonnet + +COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ COPY --from=builder-moonbeam /unique_parachain/moonbeam/target/release/moonbeam /moonbeam/target/release/ COPY --from=builder-cumulus /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus diff --git a/.docker/xcm-config/launch-config-xcm-quartz.json b/.docker/xcm-config/launch-config-xcm-quartz.json index 9c46271393..b26f10c456 100644 --- a/.docker/xcm-config/launch-config-xcm-quartz.json +++ b/.docker/xcm-config/launch-config-xcm-quartz.json @@ -118,6 +118,11 @@ "id": 2023, "balance": "1000000000000000000000", "chain": "moonriver-local", + "chainInitializer": [ + "chainql", + "--tla-code=spec=import '${spec}'", + "minBondFix.jsonnet" + ], "nodes": [ { "wsPort": 9947, diff --git a/.docker/xcm-config/minBondFix.jsonnet b/.docker/xcm-config/minBondFix.jsonnet new file mode 100644 index 0000000000..ed2ba50f3e --- /dev/null +++ b/.docker/xcm-config/minBondFix.jsonnet @@ -0,0 +1,10 @@ +function(spec) +spec { + genesis+: { + runtime+: { + parachainStaking+: { + candidates: std.map(function(candidate) [candidate[0], candidate[1] * 1000], super.candidates) + }, + }, + }, +} diff --git a/.env b/.env index 7a082b1dfd..624558f4b4 100644 --- a/.env +++ b/.env @@ -2,12 +2,12 @@ RUST_TOOLCHAIN=nightly-2022-07-24 POLKADOT_BUILD_BRANCH=release-v0.9.27 POLKADOT_MAINNET_BRANCH=release-v0.9.26 -UNIQUE_MAINNET_TAG=feature/multi-assets-redone +UNIQUE_MAINNET_TAG=v924010 KUSAMA_MAINNET_BRANCH=release-v0.9.26 -QUARTZ_MAINNET_TAG=feature/multi-assets-redone +QUARTZ_MAINNET_TAG=quartz-v924012-2 -OPAL_MAINNET_TAG=feature/multi-assets-redone +UNQWND_MAINNET_BRANCH=release-v0.9.24 OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443 QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 diff --git a/.github/workflows/xcm-testnet.yml b/.github/workflows/xcm-testnet.yml index 7b2e4d0741..23948137bc 100644 --- a/.github/workflows/xcm-testnet.yml +++ b/.github/workflows/xcm-testnet.yml @@ -114,7 +114,7 @@ jobs: POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} FEATURE=${{ matrix.features }} RUNTIME=${{ matrix.runtime }} - BRANCH=${{ mainnet_branch }} + BRANCH=${{ github.head_ref }} ACALA_BUILD_BRANCH=${{ env.ACALA_BUILD_BRANCH }} MOONBEAM_BUILD_BRANCH=${{ env.MOONBEAM_BUILD_BRANCH }} CUMULUS_BUILD_BRANCH=${{ env.CUMULUS_BUILD_BRANCH }} @@ -126,7 +126,7 @@ jobs: run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json - name: Build the stack - run: cd .docker/ && docker build --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag xcm-nodes-${{ matrix.network }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ mainnet_branch }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . + run: cd .docker/ && docker build --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag xcm-nodes-${{ matrix.network }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . # - name: Collect Docker Logs # if: success() || failure() @@ -146,7 +146,7 @@ jobs: password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - name: Push docker version image - run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ mainnet_branch }}-${{ github.sha }} + run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} - name: Push docker image latest run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest From 102f1fad9bd91a2d1f6621097b2952954eb18f7b Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 30 Aug 2022 18:40:40 +0700 Subject: [PATCH 0633/1274] correct tag name for docker image --- .github/workflows/xcm-testnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/xcm-testnet.yml b/.github/workflows/xcm-testnet.yml index 23948137bc..64607b6c39 100644 --- a/.github/workflows/xcm-testnet.yml +++ b/.github/workflows/xcm-testnet.yml @@ -126,7 +126,7 @@ jobs: run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json - name: Build the stack - run: cd .docker/ && docker build --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag xcm-nodes-${{ matrix.network }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . + run: cd .docker/ && docker build --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag xcm-nodes-${{ matrix.network }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . # - name: Collect Docker Logs # if: success() || failure() @@ -146,7 +146,7 @@ jobs: password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - name: Push docker version image - run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.head_ref }}-${{ github.sha }} + run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.sha }} - name: Push docker image latest run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest From bb78c7a27ce8354136a00a225dcf9b4c8b20683d Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 30 Aug 2022 13:38:57 +0300 Subject: [PATCH 0634/1274] Clean up workflow. Add docker builder cleanup. --- .docker/Dockerfile-parachain-node-only | 3 +-- .github/workflows/nodes-only-update.yml | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.docker/Dockerfile-parachain-node-only b/.docker/Dockerfile-parachain-node-only index f237291052..9c38cf4c0b 100644 --- a/.docker/Dockerfile-parachain-node-only +++ b/.docker/Dockerfile-parachain-node-only @@ -27,6 +27,7 @@ RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN RUN mkdir /unique_parachain WORKDIR /unique_parachain + # ===== BUILD current version ====== FROM rust-builder as builder-unique-current @@ -45,8 +46,6 @@ FROM rust-builder as builder-unique-target ARG PROFILE=release ARG FEATURE= -ARG BRANCH= -ARG REPO_URL= COPY . /unique_parachain WORKDIR /unique_parachain diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index 7e63f598bc..072ae7cd69 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -142,7 +142,7 @@ jobs: node-version: 16 - name: Build the stack - run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate --timeout 300 # 🚀 POLKADOT LAUNCH COMPLETE 🚀 - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade. @@ -191,8 +191,8 @@ jobs: shell: bash - name: Run tests before Node Parachain upgrade + working-directory: tests run: | - cd tests yarn install yarn add mochawesome echo "Ready to start tests" @@ -211,7 +211,7 @@ jobs: fail-on-error: 'false' - name: Send SIGUSR1 to polkadotlaunch process - if: success() + if: success() || failure() run: | #Get PID of polkadot-launch PID=$(docker exec node-parachain pidof 'polkadot-launch') @@ -266,8 +266,8 @@ jobs: shell: bash - name: Run tests after Node Parachain upgrade + working-directory: tests run: | - cd tests yarn install yarn add mochawesome echo "Ready to start tests" @@ -288,9 +288,14 @@ jobs: - name: Stop running containers if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" down + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" down --volumes - #docker-compose rm -f - - name: Remove Docker build artefacts + - name: Remove builder cache if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" rm -f + run: | + docker builder prune -f + docker system prune -f + + - name: Clean Workspace + if: always() + uses: AutoModality/action-clean@v1.1.0 From e4ba9b2f5aa036c830d97c5358b8db08010307b5 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Tue, 30 Aug 2022 12:07:07 +0000 Subject: [PATCH 0635/1274] Add contract sponsoring tests Also removed waitForRecalculationBlock function --- tests/src/app-promotion.test.ts | 136 ++++++++++++++++++++------------ 1 file changed, 84 insertions(+), 52 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index f751316be2..fbc9a7d4bc 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -25,9 +25,10 @@ import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; import {usingPlaygrounds} from './util/playgrounds'; -import {encodeAddress, mnemonicGenerate} from '@polkadot/util-crypto'; +import {encodeAddress} from '@polkadot/util-crypto'; import {stringToU8a} from '@polkadot/util'; import {ApiPromise} from '@polkadot/api'; +import {contractHelpers, createEthAccountWithBalance, deployFlipper, itWeb3} from './eth/util/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -43,10 +44,11 @@ before(async function () { if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); alice = privateKeyWrapper('//Alice'); bob = privateKeyWrapper('//Bob'); - palletAdmin = privateKeyWrapper('//palletAdmin'); + palletAdmin = privateKeyWrapper('//Charlie'); + await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address}))); nominal = helper.balance.getOneTokenNominal(); - await helper.balance.transferToSubstrate(alice, palletAdmin.address, 100n * nominal); - await helper.balance.transferToSubstrate(alice, palletAddress, 100n * nominal); + await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal); + await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal); if (!promotionStartBlock) { promotionStartBlock = (await helper.api!.query.parachainSystem.lastRelayChainBlockNumber()).toNumber(); } @@ -216,7 +218,6 @@ describe('unstake balance extrinsic', () => { const [staker] = await helper.arrange.creteAccounts([10n], alice); await helper.staking.stake(staker, nominal); await helper.staking.unstake(staker, nominal - 1n); - await waitForRecalculationBlock(helper.api!); // Everything fine, blockchain alive await helper.nft.mintCollection(staker, {name: 'name', description: 'description', tokenPrefix: 'prefix'}); @@ -407,45 +408,98 @@ describe('app-promotion stopSponsoringCollection', () => { }); describe('app-promotion contract sponsoring', () => { - it('will set contract sponsoring mode and set palletes address as a sponsor', async () => { - // arrange: Alice deploys Flipper - - // act: Admin calls appPromotion.sponsorContract(Flipper.address) + itWeb3('should set palletes address as a sponsor', async ({api, web3, privateKeyWrapper}) => { + await usingPlaygrounds(async (helper) => { + const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); + const flipper = await deployFlipper(web3, contractOwner); + const contractMethods = contractHelpers(web3, contractOwner); - // assert: contract.sponsoringMode = TODO - // assert: contract.sponsor to be PalleteAddress + await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address)); + + expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true; + expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); + expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + confirmed: { + substrate: palletAddress, + }, + }); + }); }); - it('will overwrite sponsoring mode and existed sponsor', async () => { - // arrange: Alice deploys Flipper - // arrange: Alice sets self sponsoring for Flipper + itWeb3('should overwrite sponsoring mode and existed sponsor', async ({api, web3, privateKeyWrapper}) => { + await usingPlaygrounds(async (helper) => { + const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); + const flipper = await deployFlipper(web3, contractOwner); + const contractMethods = contractHelpers(web3, contractOwner); - // act: Admin calls appPromotion.sponsorContract(Flipper.address) + await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; + + // Contract is self sponsored + expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.be.deep.equal({ + confirmed: { + ethereum: flipper.options.address.toLowerCase(), + }, + }); - // assert: contract.sponsoringMode = TODO - // assert: contract.sponsor to be PalleteAddress + // set promotion sponsoring + await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address)); + + // new sponsor is pallet address + expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true; + expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); + expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + confirmed: { + substrate: palletAddress, + }, + }); + }); }); - it('can be overwritten by contract owner', async () => { - // arrange: Alice deploys Flipper - // arrange: Admin calls appPromotion.sponsorContract(Flipper.address) + itWeb3('can be overwritten by contract owner', async ({api, web3, privateKeyWrapper}) => { + await usingPlaygrounds(async (helper) => { + const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); + const flipper = await deployFlipper(web3, contractOwner); + const contractMethods = contractHelpers(web3, contractOwner); - // act: Alice sets self sponsoring for Flipper + // contract sponsored by pallet + await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address)); - // assert: contract.sponsoringMode = Self - // assert: contract.sponsor to be contract + // owner sets self sponsoring + await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; + + expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true; + expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); + expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + confirmed: { + ethereum: flipper.options.address.toLowerCase(), + }, + }); + }); }); - it('can not be set by non admin', async () => { - // arrange: Alice deploys Flipper - // arrange: Alice sets self sponsoring for Flipper + itWeb3('can not be set by non admin', async ({api, web3, privateKeyWrapper}) => { + await usingPlaygrounds(async (helper) => { + const [nonAdmin] = await helper.arrange.creteAccounts([50n], alice); + const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); + const flipper = await deployFlipper(web3, contractOwner); + const contractMethods = contractHelpers(web3, contractOwner); - // assert: Random calls appPromotion.sponsorContract(Flipper.address) throws - // assert: contract.sponsoringMode = Self - // assert: contract.sponsor to be contract + await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; + + // nonAdmin calls sponsorConract + await expect(helper.signTransaction(nonAdmin, api.tx.promotion.sponsorConract(flipper.options.address))).to.be.rejected; + + // contract still self-sponsored + expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + confirmed: { + ethereum: flipper.options.address.toLowerCase(), + }, + }); + }); }); it('will return unused gas fee to app-promotion pallete', async () => { + // TODO // arrange: Alice deploys Flipper // arrange: Admin calls appPromotion.sponsorContract(Flipper.address) @@ -524,7 +578,6 @@ describe('app-promotion rewards', () => { it('should credit 0.05% for staking period', async () => { await usingPlaygrounds(async helper => { const [staker] = await helper.arrange.creteAccounts([50n], alice); - await waitForRecalculationBlock(helper.api!); await helper.staking.stake(staker, 1n * nominal); await helper.staking.stake(staker, 2n * nominal); @@ -544,9 +597,7 @@ describe('app-promotion rewards', () => { it('should bring compound interest', async () => { await usingPlaygrounds(async helper => { const [staker] = await helper.arrange.creteAccounts([80n], alice); - - await waitForRecalculationBlock(helper.api!); - + await helper.staking.stake(staker, 10n * nominal); await helper.staking.stake(staker, 20n * nominal); await helper.staking.stake(staker, 30n * nominal); @@ -564,25 +615,6 @@ describe('app-promotion rewards', () => { // TODO (load test. Can pay reward for 10000 addresses) }); - -function waitForRecalculationBlock(api: ApiPromise): Promise { - return new Promise(async (resolve, reject) => { - const unsubscribe = await api.query.system.events((events) => { - - events.forEach((record) => { - - const {event, phase} = record; - const types = event.typeDef; - - if (event.section === 'promotion' && event.method === 'StakingRecalculation') { - unsubscribe(); - resolve(); - } - }); - }); - }); -} - async function waitForRelayBlock(api: ApiPromise, blocks = 1): Promise { const current_block = (await api.query.parachainSystem.lastRelayChainBlockNumber()).toNumber(); return new Promise(async (resolve, reject) => { From e413fd637719a1e86ee8e0eeea997fdb59ea470a Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 30 Aug 2022 15:35:48 +0300 Subject: [PATCH 0636/1274] Tests --- tests/package.json | 9 ++-- tests/src/{ => xcm}/xcmTransfer.test.ts | 0 tests/src/{ => xcm}/xcmTransferAcala.test.ts | 20 +++++++- .../src/{ => xcm}/xcmTransferMoonbeam.test.ts | 21 ++++++++- .../{ => xcm}/xcmTransferStatemine.test.ts | 46 +++++++++++++++++-- 5 files changed, 83 insertions(+), 13 deletions(-) rename tests/src/{ => xcm}/xcmTransfer.test.ts (100%) rename tests/src/{ => xcm}/xcmTransferAcala.test.ts (95%) rename tests/src/{ => xcm}/xcmTransferMoonbeam.test.ts (97%) rename tests/src/{ => xcm}/xcmTransferStatemine.test.ts (89%) diff --git a/tests/package.json b/tests/package.json index 55f1e8def0..d22c87fba2 100644 --- a/tests/package.json +++ b/tests/package.json @@ -74,11 +74,10 @@ "testInflation": "mocha --timeout 9999999 -r ts-node/register ./**/inflation.test.ts", "testScheduler": "mocha --timeout 9999999 -r ts-node/register ./**/scheduler.test.ts", "testSchedulingEVM": "mocha --timeout 9999999 -r ts-node/register ./**/eth/scheduling.test.ts", - "testXcmTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/xcmTransfer.test.ts", - "testXcmTransferAcala": "mocha --timeout 9999999 -r ts-node/register ./**/xcmTransferAcala.test.ts", - "testXcmTransferKarura": "mocha --timeout 9999999 -r ts-node/register ./**/xcmTransferKarura.test.ts", - "testXcmTransferStatemine": "mocha --timeout 9999999 -r ts-node/register ./**/xcmTransferStatemine.test.ts", - "testXcmTransferMoonriver": "mocha --timeout 9999999 -r ts-node/register ./**/xcmTransferMoonriver.test.ts", + "testXcmTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransfer.test.ts", + "testXcmTransferAcala": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferAcala.test.ts acalaId=2000 uniqueId=5000", + "testXcmTransferStatemine": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferStatemine.test.ts statemineId=1000 uniqueId=5000", + "testXcmTransferMoonbeam": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferMoonbeam.test.ts moonbeamId=2000 uniqueId=5000", "testPalletPresence": "mocha --timeout 9999999 -r ts-node/register ./**/pallet-presence.test.ts", "testBlockProduction": "mocha --timeout 9999999 -r ts-node/register ./**/block-production.test.ts", "testEnableDisableTransfers": "mocha --timeout 9999999 -r ts-node/register ./**/enableDisableTransfer.test.ts", diff --git a/tests/src/xcmTransfer.test.ts b/tests/src/xcm/xcmTransfer.test.ts similarity index 100% rename from tests/src/xcmTransfer.test.ts rename to tests/src/xcm/xcmTransfer.test.ts diff --git a/tests/src/xcmTransferAcala.test.ts b/tests/src/xcm/xcmTransferAcala.test.ts similarity index 95% rename from tests/src/xcmTransferAcala.test.ts rename to tests/src/xcm/xcmTransferAcala.test.ts index 60be3d4d6b..dad199c06c 100644 --- a/tests/src/xcmTransferAcala.test.ts +++ b/tests/src/xcm/xcmTransferAcala.test.ts @@ -28,8 +28,24 @@ import getBalance from './substrate/get-balance'; chai.use(chaiAsPromised); const expect = chai.expect; -const UNIQUE_CHAIN = 5000; -const ACALA_CHAIN = 2000; +let UNIQUE_CHAIN = 0; +let ACALA_CHAIN = 0; + +// parse parachain id numbers +process.argv.forEach((val) => { + + const ai = val.indexOf('acalaId='); + const ui = val.indexOf('uniqueId='); + if (ai != -1) + { + ACALA_CHAIN = Number(val.substring('acalaId='.length)); + } + if (ui != -1) + { + UNIQUE_CHAIN = Number(val.substring('uniqueId='.length)); + } +}); + const ACALA_PORT = '9946'; const TRANSFER_AMOUNT = 2000000000000000000000000n; diff --git a/tests/src/xcmTransferMoonbeam.test.ts b/tests/src/xcm/xcmTransferMoonbeam.test.ts similarity index 97% rename from tests/src/xcmTransferMoonbeam.test.ts rename to tests/src/xcm/xcmTransferMoonbeam.test.ts index cf199e22f3..35b89b7812 100644 --- a/tests/src/xcmTransferMoonbeam.test.ts +++ b/tests/src/xcm/xcmTransferMoonbeam.test.ts @@ -30,8 +30,25 @@ import waitNewBlocks from './substrate/wait-new-blocks'; chai.use(chaiAsPromised); const expect = chai.expect; -const UNIQUE_CHAIN = 5000; -const MOONBEAM_CHAIN = 1000; + +let UNIQUE_CHAIN = 0; +let MOONBEAM_CHAIN = 0; + +// parse parachain id numbers +process.argv.forEach((val) => { + + const ai = val.indexOf('moonbeamId='); + const ui = val.indexOf('uniqueId='); + if (ai != -1) + { + MOONBEAM_CHAIN = Number(val.substring('moonbeamId='.length)); + } + if (ui != -1) + { + UNIQUE_CHAIN = Number(val.substring('uniqueId='.length)); + } +}); + const UNIQUE_PORT = '9944'; const MOONBEAM_PORT = '9946'; const TRANSFER_AMOUNT = 2000000000000000000000000n; diff --git a/tests/src/xcmTransferStatemine.test.ts b/tests/src/xcm/xcmTransferStatemine.test.ts similarity index 89% rename from tests/src/xcmTransferStatemine.test.ts rename to tests/src/xcm/xcmTransferStatemine.test.ts index 260a5e8624..59989a353d 100644 --- a/tests/src/xcmTransferStatemine.test.ts +++ b/tests/src/xcm/xcmTransferStatemine.test.ts @@ -24,15 +24,35 @@ import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; import {getGenericResult} from './util/helpers'; import waitNewBlocks from './substrate/wait-new-blocks'; import {normalizeAccountId} from './util/helpers'; +import getBalance from './substrate/get-balance'; chai.use(chaiAsPromised); const expect = chai.expect; +// const STATEMINE_CHAIN = 1000; +// const UNIQUE_CHAIN = 2037; + +let UNIQUE_CHAIN = 0; +let STATEMINE_CHAIN = 0; + +// parse parachain id numbers +process.argv.forEach((val) => { + + const ai = val.indexOf('statemineId='); + const ui = val.indexOf('uniqueId='); + if (ai != -1) + { + STATEMINE_CHAIN = Number(val.substring('statemineId='.length)); + } + if (ui != -1) + { + UNIQUE_CHAIN = Number(val.substring('uniqueId='.length)); + } +}); + const RELAY_PORT = '9844'; -const UNIQUE_CHAIN = 2037; const UNIQUE_PORT = '9944'; -const STATEMINE_CHAIN = 1000; const STATEMINE_PORT = '9946'; const STATEMINE_PALLET_INSTANCE = 50; const ASSET_ID = 100; @@ -41,10 +61,17 @@ const ASSET_METADATA_NAME = 'USDT'; const ASSET_METADATA_DESCRIPTION = 'USDT'; const ASSET_METADATA_MINIMAL_BALANCE = 1; +const TRANSFER_AMOUNT = 1_000_000_000_000_000_000n; +const TRANSFER_AMOUNT2 = 10_000_000_000_000_000n; + describe('Integration test: Exchanging USDT with Statemine', () => { let alice: IKeyringPair; let bob: IKeyringPair; + let balanceStmnBefore: bigint; + let balanceStmnAfter: bigint; + let balanceStmnFinal: bigint; + before(async () => { await usingApi(async (api, privateKeyWrapper) => { alice = privateKeyWrapper('//Alice'); @@ -238,7 +265,7 @@ describe('Integration test: Exchanging USDT with Statemine', () => { }, }, fun: { - Fungible: 1_000_000_000_000_000_000n, + Fungible: TRANSFER_AMOUNT, }, }, ], @@ -250,10 +277,16 @@ describe('Integration test: Exchanging USDT with Statemine', () => { Limited: 5000000000, }; + [balanceStmnBefore] = await getBalance(api, [alice.address]); + const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(dest, beneficiary, assets, feeAssetItem, weightLimit); const events = await submitTransactionAsync(alice, tx); const result = getGenericResult(events); expect(result.success).to.be.true; + + [balanceStmnAfter] = await getBalance(api, [alice.address]); + expect(balanceStmnBefore > balanceStmnAfter).to.be.true; + }, statemineApiOptions); @@ -262,7 +295,8 @@ describe('Integration test: Exchanging USDT with Statemine', () => { await waitNewBlocks(api, 3); // expext collection id will be with id 1 const free = (await api.query.fungible.balance(1, normalizeAccountId(alice.address))).toBigInt(); - expect(free > 0).to.be.true; + expect(free == TRANSFER_AMOUNT).to.be.true; + }, uniqueApiOptions); }); @@ -313,6 +347,10 @@ describe('Integration test: Exchanging USDT with Statemine', () => { const result = getGenericResult(events); expect(result.success).to.be.true; + + [balanceStmnFinal] = await getBalance(api, [alice.address]); + expect(balanceStmnFinal > balanceStmnBefore).to.be.true; + // todo do something about instant sealing, where there might not be any new blocks await waitNewBlocks(api, 3); const balanceAfter = (await api.query.fungible.balance(1, normalizeAccountId(alice.address))).toBigInt(); From ba730d0009ae5ab51c3af19f96bb11b9cd78b1f0 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 30 Aug 2022 16:32:13 +0300 Subject: [PATCH 0637/1274] change name of concurency group --- .github/workflows/codestyle.yml | 2 +- .github/workflows/dev-build-tests.yml | 2 +- .github/workflows/forkless-update-data.yml | 2 +- .github/workflows/forkless-update-nodata.yml | 2 +- .github/workflows/nodes-only-update.yml | 2 +- .github/workflows/tests_codestyle.yml | 2 +- .github/workflows/try-runtime.yml | 2 +- .github/workflows/unit-test.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 2536a5d8fb..f9c582e6ae 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -11,7 +11,7 @@ on: - ready_for_review concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true jobs: diff --git a/.github/workflows/dev-build-tests.yml b/.github/workflows/dev-build-tests.yml index a1f08e1f4c..a8536f765e 100644 --- a/.github/workflows/dev-build-tests.yml +++ b/.github/workflows/dev-build-tests.yml @@ -20,7 +20,7 @@ env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index b468242705..95c872373a 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -20,7 +20,7 @@ env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index b8a8a5a2d6..e666df9f62 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -20,7 +20,7 @@ env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index 072ae7cd69..ae9779349f 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -20,7 +20,7 @@ env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel diff --git a/.github/workflows/tests_codestyle.yml b/.github/workflows/tests_codestyle.yml index f2b07afaec..b3063d4fd7 100644 --- a/.github/workflows/tests_codestyle.yml +++ b/.github/workflows/tests_codestyle.yml @@ -11,7 +11,7 @@ on: - ready_for_review concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true jobs: diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 397d0fd426..52907787bc 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -20,7 +20,7 @@ env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 8557a47b7e..1c56e04d25 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -17,7 +17,7 @@ on: workflow_dispatch: concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel From c1f4e7e1cab1ed16ba25d0eaa1c2b7c000f57a8e Mon Sep 17 00:00:00 2001 From: PraetorP Date: Tue, 30 Aug 2022 20:57:52 +0700 Subject: [PATCH 0638/1274] fix stake and unstake extrinsics --- pallets/app-promotion/src/lib.rs | 98 +++++++++++++------------------- 1 file changed, 38 insertions(+), 60 deletions(-) diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 2a3b9254ac..586f4c6342 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -260,6 +260,7 @@ pub mod pallet { impl Pallet where T::BlockNumber: From, + <::Currency as Currency>::Balance: Sum + From { #[pallet::weight(T::WeightInfo::set_admin_address())] pub fn set_admin_address(origin: OriginFor, admin: T::CrossAccountId) -> DispatchResult { @@ -311,8 +312,9 @@ pub mod pallet { #[pallet::weight(T::WeightInfo::stake())] pub fn stake(staker: OriginFor, amount: BalanceOf) -> DispatchResult { let staker_id = ensure_signed(staker)?; + - ensure!(amount >= T::Nominal::get(), ArithmeticError::Underflow); + ensure!(amount >= Into::>::into(100u128) * T::Nominal::get(), ArithmeticError::Underflow); let balance = <::Currency as Currency>::free_balance(&staker_id); @@ -342,73 +344,40 @@ pub mod pallet { balance_and_recalc_block }); - // >::set( - // >::get() - // .checked_add(&amount) - // .ok_or(ArithmeticError::Overflow)?, - // ); + >::set( + >::get() + .checked_add(&amount) + .ok_or(ArithmeticError::Overflow)?, + ); Ok(()) } #[pallet::weight(T::WeightInfo::unstake())] - pub fn unstake(staker: OriginFor, amount: BalanceOf) -> DispatchResult { + pub fn unstake(staker: OriginFor) -> DispatchResultWithPostInfo { let staker_id = ensure_signed(staker)?; - let mut stakes = Staked::::drain_prefix((&staker_id,)); - - // let total_staked = stakes - // .iter() - // .fold(>::default(), |acc, (_, amount)| acc + *amount); - - // ensure!(total_staked >= amount, ArithmeticError::Underflow); - - // >::set( - // >::get() - // .checked_sub(&amount) - // .ok_or(ArithmeticError::Underflow)?, - // ); - - // let block = - // T::RelayBlockNumberProvider::current_block_number() + T::PendingInterval::get(); - // >::insert( - // (&staker_id, block), - // >::get((&staker_id, block)) - // .checked_add(&amount) - // .ok_or(ArithmeticError::Overflow)?, - // ); - - // stakes.sort_by_key(|(block, _)| *block); - - // let mut acc_amount = amount; - // let new_state = stakes - // .into_iter() - // .map_while(|(block, balance_per_block)| { - // if acc_amount == >::default() { - // return None; - // } - // if acc_amount <= balance_per_block { - // let res = (block, balance_per_block - acc_amount, acc_amount); - // acc_amount = >::default(); - // return Some(res); - // } else { - // acc_amount -= balance_per_block; - // return Some((block, >::default(), acc_amount)); - // } - // }) - // .collect::>(); + let mut total_stakes = 0u64; - // new_state - // .into_iter() - // .for_each(|(block, to_staked, _to_pending)| { - // if to_staked == >::default() { - // >::remove((&staker_id, block)); - // } else { - // >::insert((&staker_id, block), to_staked); - // } - // }); + let total_staked: BalanceOf = Staked::::drain_prefix((&staker_id,)) + .map(|(_, (amount, _))| { + *&mut total_stakes += 1; + amount + }) + .sum(); + + let block = + T::RelayBlockNumberProvider::current_block_number() + T::PendingInterval::get(); + >::insert( + (&staker_id, block), + >::get((&staker_id, block)) + .checked_add(&total_staked) + .ok_or(ArithmeticError::Overflow)?, + ); + + TotalStaked::::set(TotalStaked::::get().checked_sub(&total_staked).ok_or(ArithmeticError::Underflow)?); // when error we should recover stake state for the staker - Ok(()) + Ok(None.into()) // let staker_id = ensure_signed(staker)?; @@ -542,6 +511,15 @@ pub mod pallet { admin_id == Admin::::get().ok_or(Error::::AdminNotSet)?, Error::::NoPermission ); + + let raw_key = Staked::::hashed_key_for((admin_id, T::BlockNumber::default())); + + let key_iterator = Staked::::iter_keys_from(raw_key).skip(1).into_iter(); + + match Self::get_last_calculated_staker() { + Some(last_staker) => {}, + None => {} + }; Ok(()) } @@ -661,7 +639,7 @@ impl Pallet { impl Pallet where - <::Currency as Currency>::Balance: Sum, + <::Currency as Currency>::Balance: Sum, { pub fn cross_id_pending_unstake(staker: Option) -> BalanceOf { staker.map_or(PendingUnstake::::iter_values().sum(), |s| { From d6df15bc0fd8df9d825f1eeb568f5dff3d6c7401 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 30 Aug 2022 16:32:13 +0300 Subject: [PATCH 0639/1274] change name of concurency group --- .github/workflows/codestyle.yml | 2 +- .github/workflows/dev-build-tests.yml | 2 +- .github/workflows/forkless-update-data.yml | 2 +- .github/workflows/forkless-update-nodata.yml | 2 +- .github/workflows/nodes-only-update.yml | 2 +- .github/workflows/tests_codestyle.yml | 2 +- .github/workflows/try-runtime.yml | 2 +- .github/workflows/unit-test.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 2536a5d8fb..f9c582e6ae 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -11,7 +11,7 @@ on: - ready_for_review concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true jobs: diff --git a/.github/workflows/dev-build-tests.yml b/.github/workflows/dev-build-tests.yml index a1f08e1f4c..a8536f765e 100644 --- a/.github/workflows/dev-build-tests.yml +++ b/.github/workflows/dev-build-tests.yml @@ -20,7 +20,7 @@ env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index b468242705..95c872373a 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -20,7 +20,7 @@ env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index b8a8a5a2d6..e666df9f62 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -20,7 +20,7 @@ env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index 072ae7cd69..ae9779349f 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -20,7 +20,7 @@ env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel diff --git a/.github/workflows/tests_codestyle.yml b/.github/workflows/tests_codestyle.yml index f2b07afaec..b3063d4fd7 100644 --- a/.github/workflows/tests_codestyle.yml +++ b/.github/workflows/tests_codestyle.yml @@ -11,7 +11,7 @@ on: - ready_for_review concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true jobs: diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime.yml index 397d0fd426..52907787bc 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime.yml @@ -20,7 +20,7 @@ env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 8557a47b7e..1c56e04d25 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -17,7 +17,7 @@ on: workflow_dispatch: concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel From f5b1655cf87f6496997a71296374039fd50154b9 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 30 Aug 2022 20:59:53 +0700 Subject: [PATCH 0640/1274] correct concurency group name for xcm-testnet --- .github/workflows/xcm-testnet.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/xcm-testnet.yml b/.github/workflows/xcm-testnet.yml index 64607b6c39..9e3fdf8e4b 100644 --- a/.github/workflows/xcm-testnet.yml +++ b/.github/workflows/xcm-testnet.yml @@ -20,7 +20,7 @@ env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel @@ -128,17 +128,6 @@ jobs: - name: Build the stack run: cd .docker/ && docker build --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag xcm-nodes-${{ matrix.network }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . - # - name: Collect Docker Logs - # if: success() || failure() - # uses: jwalton/gh-docker-logs@v2.2.0 - # with: - # dest: './xcm-build-logs.${{ matrix.features }}' - # images: 'xcm-nodes-${{ matrix.network }}' - - # - name: Show docker logs - # if: success() || failure() - # run: cat './xcm-build-logs.${{ matrix.features }}/xcm-nodes-${{ matrix.network }}.log' - - name: Log in to Docker Hub uses: docker/login-action@v2.0.0 with: From 183fa35b79fd357d9e88d349e84c1d10dbc61d28 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 30 Aug 2022 14:42:49 +0000 Subject: [PATCH 0641/1274] test(xcm): add XCM Unique --- tests/package.json | 1 + tests/src/xcm/xcmUnique.test.ts | 267 ++++++++++++++++++++++++++++++++ 2 files changed, 268 insertions(+) create mode 100644 tests/src/xcm/xcmUnique.test.ts diff --git a/tests/package.json b/tests/package.json index d22c87fba2..93c1b5e105 100644 --- a/tests/package.json +++ b/tests/package.json @@ -74,6 +74,7 @@ "testInflation": "mocha --timeout 9999999 -r ts-node/register ./**/inflation.test.ts", "testScheduler": "mocha --timeout 9999999 -r ts-node/register ./**/scheduler.test.ts", "testSchedulingEVM": "mocha --timeout 9999999 -r ts-node/register ./**/eth/scheduling.test.ts", + "testXcmUnique": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmUnique.test.ts", "testXcmTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransfer.test.ts", "testXcmTransferAcala": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferAcala.test.ts acalaId=2000 uniqueId=5000", "testXcmTransferStatemine": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferStatemine.test.ts statemineId=1000 uniqueId=5000", diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts new file mode 100644 index 0000000000..69ce7c757d --- /dev/null +++ b/tests/src/xcm/xcmUnique.test.ts @@ -0,0 +1,267 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; + +import {WsProvider} from '@polkadot/api'; +import {ApiOptions} from '@polkadot/api/types'; +import {IKeyringPair} from '@polkadot/types/types'; +import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; +import {getGenericResult, generateKeyringPair} from '../util/helpers'; +import waitNewBlocks from '../substrate/wait-new-blocks'; +import getBalance from '../substrate/get-balance'; + +chai.use(chaiAsPromised); +const expect = chai.expect; + +const UNIQUE_CHAIN = 2037; +const ACALA_CHAIN = 2000; + +const ACALA_PORT = '9946'; + +const TRANSFER_AMOUNT = 2000000000000000000000000n; + +describe('Integration test: Exchanging UNQ with Acala', () => { + let alice: IKeyringPair; + let randomAccount: IKeyringPair; + + let balanceUniqueTokenBefore: bigint; + let balanceUniqueTokenAfter: bigint; + let balanceUniqueTokenFinal: bigint; + let balanceAcalaTokenBefore: bigint; + let balanceAcalaTokenAfter: bigint; + let balanceAcalaTokenFinal: bigint; + let balanceUniqueForeignTokenAfter: bigint; + let balanceUniqueForeignTokenBefore: bigint; + let balanceUniqueForeignTokenFinal: bigint; + + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + alice = privateKeyWrapper('//Alice'); + randomAccount = generateKeyringPair(); + }); + + const acalaApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT), + }; + + // Acala side + await usingApi( + async (api) => { + const destination = { + V0: { + X2: [ + 'Parent', + { + Parachain: UNIQUE_CHAIN, + }, + ], + }, + }; + + const metadata = { + name: 'UNQ', + symbol: 'UNQ', + decimals: 18, + minimalBalance: 1, + }; + + const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata); + const sudoTx = api.tx.sudo.sudo(tx as any); + const events = await submitTransactionAsync(alice, sudoTx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); + const events1 = await submitTransactionAsync(alice, tx1); + const result1 = getGenericResult(events1); + expect(result1.success).to.be.true; + + [balanceAcalaTokenBefore] = await getBalance(api, [randomAccount.address]); + { + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceUniqueForeignTokenBefore = BigInt(free); + } + }, + acalaApiOptions, + ); + + // Unique side + await usingApi(async (api) => { + const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); + const events0 = await submitTransactionAsync(alice, tx0); + const result0 = getGenericResult(events0); + expect(result0.success).to.be.true; + + [balanceUniqueTokenBefore] = await getBalance(api, [randomAccount.address]); + }); + }); + + it('Should connect and send UNQ to Acala', async () => { + + // Unique side + await usingApi(async (api) => { + + const destination = { + V0: { + X2: [ + 'Parent', + { + Parachain: ACALA_CHAIN, + }, + ], + }, + }; + + const beneficiary = { + V0: { + X1: { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, + }, + }, + }, + }; + + const assets = { + V1: [ + { + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: TRANSFER_AMOUNT, + }, + }, + ], + }; + + const feeAssetItem = 0; + + const weightLimit = { + Limited: 5000000000, + }; + + const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); + const events = await submitTransactionAsync(randomAccount, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceUniqueTokenAfter] = await getBalance(api, [randomAccount.address]); + + const unqFees = balanceUniqueTokenBefore - balanceUniqueTokenAfter; + console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', unqFees); + expect(unqFees > 0n).to.be.true; + }); + + // Acala side + await usingApi( + async (api) => { + // todo do something about instant sealing, where there might not be any new blocks + await waitNewBlocks(api, 3); + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceUniqueForeignTokenAfter = BigInt(free); + + [balanceAcalaTokenAfter] = await getBalance(api, [randomAccount.address]); + + const acaFees = balanceAcalaTokenBefore - balanceAcalaTokenAfter; + const unqDiffAfterIncomeTransfer = balanceUniqueForeignTokenAfter - balanceUniqueForeignTokenBefore; + + const unqFees = unqDiffAfterIncomeTransfer - TRANSFER_AMOUNT; + + console.log('[Unique -> Acala] transaction fees on Acala: %s ACA', acaFees); + console.log('[Unique -> Acala] transaction fees on Acala: %s UNQ', unqFees); + expect(acaFees == 0n).to.be.true; + expect(unqFees == 0n).to.be.true; + }, + {provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT)}, + ); + }); + + it('Should connect to Acala and send UNQ back', async () => { + + // Acala side + await usingApi( + async (api) => { + const destination = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: UNIQUE_CHAIN}, + { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, + }, + }, + ], + }, + }, + }; + + const id = { + ForeignAsset: 0, + }; + + const amount = TRANSFER_AMOUNT; + const destWeight = 50000000; + + const tx = api.tx.xTokens.transfer(id, amount, destination, destWeight); + const events = await submitTransactionAsync(randomAccount, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceAcalaTokenFinal] = await getBalance(api, [randomAccount.address]); + { + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceUniqueForeignTokenFinal = BigInt(free); + } + + const acaFees = balanceAcalaTokenAfter - balanceAcalaTokenFinal; + const unqDiffAfterOutcomeTransfer = balanceUniqueForeignTokenAfter - TRANSFER_AMOUNT; + + const unqFees = unqDiffAfterOutcomeTransfer - balanceUniqueForeignTokenFinal; + + console.log('[Acala -> Unique] transaction fees on Acala: %s ACA', acaFees); + console.log('[Acala -> Unique] transaction fees on Acala: %s UNQ', unqFees); + + expect(acaFees > 0).to.be.true; + expect(unqFees == 0n).to.be.true; + }, + {provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT)}, + ); + + // Unique side + await usingApi(async (api) => { + // todo do something about instant sealing, where there might not be any new blocks + await waitNewBlocks(api, 3); + + [balanceUniqueTokenFinal] = await getBalance(api, [randomAccount.address]); + const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenAfter; + expect(actuallyDelivered > 0).to.be.true; + + const unqFees = TRANSFER_AMOUNT - actuallyDelivered; + console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', unqFees); + expect(unqFees == 0n).to.be.true; + }); + }); + }); From d952a795042ebdf2538fcd1d770c660065759d8a Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 30 Aug 2022 14:47:02 +0000 Subject: [PATCH 0642/1274] fix: yarn fix --- tests/src/eth/collectionAdmin.test.ts | 2 +- tests/src/xcm/xcmUnique.test.ts | 364 +++++++++++++------------- 2 files changed, 183 insertions(+), 183 deletions(-) diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index e525dc4a98..e93539102f 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -15,7 +15,7 @@ import {expect} from 'chai'; import privateKey from '../substrate/privateKey'; -import { UNIQUE } from '../util/helpers'; +import {UNIQUE} from '../util/helpers'; import { createEthAccount, createEthAccountWithBalance, diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index 69ce7c757d..c415816918 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -36,232 +36,232 @@ const ACALA_PORT = '9946'; const TRANSFER_AMOUNT = 2000000000000000000000000n; describe('Integration test: Exchanging UNQ with Acala', () => { - let alice: IKeyringPair; - let randomAccount: IKeyringPair; + let alice: IKeyringPair; + let randomAccount: IKeyringPair; - let balanceUniqueTokenBefore: bigint; - let balanceUniqueTokenAfter: bigint; - let balanceUniqueTokenFinal: bigint; - let balanceAcalaTokenBefore: bigint; - let balanceAcalaTokenAfter: bigint; - let balanceAcalaTokenFinal: bigint; - let balanceUniqueForeignTokenAfter: bigint; - let balanceUniqueForeignTokenBefore: bigint; - let balanceUniqueForeignTokenFinal: bigint; + let balanceUniqueTokenBefore: bigint; + let balanceUniqueTokenAfter: bigint; + let balanceUniqueTokenFinal: bigint; + let balanceAcalaTokenBefore: bigint; + let balanceAcalaTokenAfter: bigint; + let balanceAcalaTokenFinal: bigint; + let balanceUniqueForeignTokenAfter: bigint; + let balanceUniqueForeignTokenBefore: bigint; + let balanceUniqueForeignTokenFinal: bigint; - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - randomAccount = generateKeyringPair(); - }); - - const acalaApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT), - }; - - // Acala side - await usingApi( - async (api) => { - const destination = { - V0: { - X2: [ - 'Parent', - { - Parachain: UNIQUE_CHAIN, - }, - ], - }, - }; - - const metadata = { - name: 'UNQ', - symbol: 'UNQ', - decimals: 18, - minimalBalance: 1, - }; - - const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata); - const sudoTx = api.tx.sudo.sudo(tx as any); - const events = await submitTransactionAsync(alice, sudoTx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); - const events1 = await submitTransactionAsync(alice, tx1); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; - - [balanceAcalaTokenBefore] = await getBalance(api, [randomAccount.address]); - { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceUniqueForeignTokenBefore = BigInt(free); - } - }, - acalaApiOptions, - ); - - // Unique side - await usingApi(async (api) => { - const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); - const events0 = await submitTransactionAsync(alice, tx0); - const result0 = getGenericResult(events0); - expect(result0.success).to.be.true; - - [balanceUniqueTokenBefore] = await getBalance(api, [randomAccount.address]); - }); + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + alice = privateKeyWrapper('//Alice'); + randomAccount = generateKeyringPair(); }); - it('Should connect and send UNQ to Acala', async () => { - - // Unique side - await usingApi(async (api) => { + const acalaApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT), + }; + // Acala side + await usingApi( + async (api) => { const destination = { V0: { X2: [ 'Parent', { - Parachain: ACALA_CHAIN, + Parachain: UNIQUE_CHAIN, }, ], }, }; - const beneficiary = { - V0: { - X1: { - AccountId32: { - network: 'Any', - id: randomAccount.addressRaw, - }, - }, - }, + const metadata = { + name: 'UNQ', + symbol: 'UNQ', + decimals: 18, + minimalBalance: 1, }; - const assets = { - V1: [ + const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata); + const sudoTx = api.tx.sudo.sudo(tx as any); + const events = await submitTransactionAsync(alice, sudoTx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); + const events1 = await submitTransactionAsync(alice, tx1); + const result1 = getGenericResult(events1); + expect(result1.success).to.be.true; + + [balanceAcalaTokenBefore] = await getBalance(api, [randomAccount.address]); + { + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceUniqueForeignTokenBefore = BigInt(free); + } + }, + acalaApiOptions, + ); + + // Unique side + await usingApi(async (api) => { + const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); + const events0 = await submitTransactionAsync(alice, tx0); + const result0 = getGenericResult(events0); + expect(result0.success).to.be.true; + + [balanceUniqueTokenBefore] = await getBalance(api, [randomAccount.address]); + }); + }); + + it('Should connect and send UNQ to Acala', async () => { + + // Unique side + await usingApi(async (api) => { + + const destination = { + V0: { + X2: [ + 'Parent', { - id: { - Concrete: { - parents: 0, - interior: 'Here', - }, - }, - fun: { - Fungible: TRANSFER_AMOUNT, - }, + Parachain: ACALA_CHAIN, }, ], - }; + }, + }; - const feeAssetItem = 0; + const beneficiary = { + V0: { + X1: { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, + }, + }, + }, + }; - const weightLimit = { - Limited: 5000000000, - }; + const assets = { + V1: [ + { + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: TRANSFER_AMOUNT, + }, + }, + ], + }; - const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); - const events = await submitTransactionAsync(randomAccount, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + const feeAssetItem = 0; - [balanceUniqueTokenAfter] = await getBalance(api, [randomAccount.address]); + const weightLimit = { + Limited: 5000000000, + }; - const unqFees = balanceUniqueTokenBefore - balanceUniqueTokenAfter; - console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', unqFees); - expect(unqFees > 0n).to.be.true; - }); + const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); + const events = await submitTransactionAsync(randomAccount, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; - // Acala side - await usingApi( - async (api) => { - // todo do something about instant sealing, where there might not be any new blocks - await waitNewBlocks(api, 3); - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceUniqueForeignTokenAfter = BigInt(free); + [balanceUniqueTokenAfter] = await getBalance(api, [randomAccount.address]); + + const unqFees = balanceUniqueTokenBefore - balanceUniqueTokenAfter; + console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', unqFees); + expect(unqFees > 0n).to.be.true; + }); + + // Acala side + await usingApi( + async (api) => { + // todo do something about instant sealing, where there might not be any new blocks + await waitNewBlocks(api, 3); + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceUniqueForeignTokenAfter = BigInt(free); - [balanceAcalaTokenAfter] = await getBalance(api, [randomAccount.address]); + [balanceAcalaTokenAfter] = await getBalance(api, [randomAccount.address]); - const acaFees = balanceAcalaTokenBefore - balanceAcalaTokenAfter; - const unqDiffAfterIncomeTransfer = balanceUniqueForeignTokenAfter - balanceUniqueForeignTokenBefore; + const acaFees = balanceAcalaTokenBefore - balanceAcalaTokenAfter; + const unqDiffAfterIncomeTransfer = balanceUniqueForeignTokenAfter - balanceUniqueForeignTokenBefore; - const unqFees = unqDiffAfterIncomeTransfer - TRANSFER_AMOUNT; + const unqFees = unqDiffAfterIncomeTransfer - TRANSFER_AMOUNT; - console.log('[Unique -> Acala] transaction fees on Acala: %s ACA', acaFees); - console.log('[Unique -> Acala] transaction fees on Acala: %s UNQ', unqFees); - expect(acaFees == 0n).to.be.true; - expect(unqFees == 0n).to.be.true; - }, - {provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT)}, - ); - }); + console.log('[Unique -> Acala] transaction fees on Acala: %s ACA', acaFees); + console.log('[Unique -> Acala] transaction fees on Acala: %s UNQ', unqFees); + expect(acaFees == 0n).to.be.true; + expect(unqFees == 0n).to.be.true; + }, + {provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT)}, + ); + }); - it('Should connect to Acala and send UNQ back', async () => { + it('Should connect to Acala and send UNQ back', async () => { - // Acala side - await usingApi( - async (api) => { - const destination = { - V1: { - parents: 1, - interior: { - X2: [ - {Parachain: UNIQUE_CHAIN}, - { - AccountId32: { - network: 'Any', - id: randomAccount.addressRaw, - }, + // Acala side + await usingApi( + async (api) => { + const destination = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: UNIQUE_CHAIN}, + { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, }, - ], - }, + }, + ], }, - }; + }, + }; - const id = { - ForeignAsset: 0, - }; + const id = { + ForeignAsset: 0, + }; - const amount = TRANSFER_AMOUNT; - const destWeight = 50000000; + const amount = TRANSFER_AMOUNT; + const destWeight = 50000000; - const tx = api.tx.xTokens.transfer(id, amount, destination, destWeight); - const events = await submitTransactionAsync(randomAccount, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + const tx = api.tx.xTokens.transfer(id, amount, destination, destWeight); + const events = await submitTransactionAsync(randomAccount, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; - [balanceAcalaTokenFinal] = await getBalance(api, [randomAccount.address]); - { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceUniqueForeignTokenFinal = BigInt(free); - } + [balanceAcalaTokenFinal] = await getBalance(api, [randomAccount.address]); + { + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceUniqueForeignTokenFinal = BigInt(free); + } - const acaFees = balanceAcalaTokenAfter - balanceAcalaTokenFinal; - const unqDiffAfterOutcomeTransfer = balanceUniqueForeignTokenAfter - TRANSFER_AMOUNT; + const acaFees = balanceAcalaTokenAfter - balanceAcalaTokenFinal; + const unqDiffAfterOutcomeTransfer = balanceUniqueForeignTokenAfter - TRANSFER_AMOUNT; - const unqFees = unqDiffAfterOutcomeTransfer - balanceUniqueForeignTokenFinal; + const unqFees = unqDiffAfterOutcomeTransfer - balanceUniqueForeignTokenFinal; - console.log('[Acala -> Unique] transaction fees on Acala: %s ACA', acaFees); - console.log('[Acala -> Unique] transaction fees on Acala: %s UNQ', unqFees); + console.log('[Acala -> Unique] transaction fees on Acala: %s ACA', acaFees); + console.log('[Acala -> Unique] transaction fees on Acala: %s UNQ', unqFees); - expect(acaFees > 0).to.be.true; - expect(unqFees == 0n).to.be.true; - }, - {provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT)}, - ); + expect(acaFees > 0).to.be.true; + expect(unqFees == 0n).to.be.true; + }, + {provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT)}, + ); - // Unique side - await usingApi(async (api) => { - // todo do something about instant sealing, where there might not be any new blocks - await waitNewBlocks(api, 3); + // Unique side + await usingApi(async (api) => { + // todo do something about instant sealing, where there might not be any new blocks + await waitNewBlocks(api, 3); - [balanceUniqueTokenFinal] = await getBalance(api, [randomAccount.address]); - const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenAfter; - expect(actuallyDelivered > 0).to.be.true; + [balanceUniqueTokenFinal] = await getBalance(api, [randomAccount.address]); + const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenAfter; + expect(actuallyDelivered > 0).to.be.true; - const unqFees = TRANSFER_AMOUNT - actuallyDelivered; - console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', unqFees); - expect(unqFees == 0n).to.be.true; - }); + const unqFees = TRANSFER_AMOUNT - actuallyDelivered; + console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', unqFees); + expect(unqFees == 0n).to.be.true; }); }); +}); From e85b045d6752578f51c29c1a10c5c285b830b2fe Mon Sep 17 00:00:00 2001 From: Maksandre Date: Tue, 30 Aug 2022 21:04:56 +0500 Subject: [PATCH 0643/1274] Tests up Some tests are red because of not implemented logic --- tests/src/app-promotion.test.ts | 207 +++++++++++++-------------- tests/src/util/playgrounds/unique.ts | 6 +- 2 files changed, 104 insertions(+), 109 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index fbc9a7d4bc..bdb4c8f69d 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -44,7 +44,7 @@ before(async function () { if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); alice = privateKeyWrapper('//Alice'); bob = privateKeyWrapper('//Bob'); - palletAdmin = privateKeyWrapper('//Charlie'); + palletAdmin = privateKeyWrapper('//Charlie'); // TODO use custom address await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address}))); nominal = helper.balance.getOneTokenNominal(); await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal); @@ -66,50 +66,50 @@ describe('app-promotions.stake extrinsic', () => { it('should change balance state to "locked", add it to "staked" map, and increase "totalStaked" amount', async () => { await usingPlaygrounds(async (helper) => { const totalStakedBefore = await helper.staking.getTotalStaked(); - const [staker] = await helper.arrange.creteAccounts([10n], alice); + const [staker] = await helper.arrange.creteAccounts([400n], alice); - // Minimum stake amount is 1: - await expect(helper.staking.stake(staker, nominal - 1n)).to.be.eventually.rejected; - await helper.staking.stake(staker, nominal); - expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(nominal); - - // TODO add helpers to assert bigints. Check balance close to 10 - expect(await helper.balance.getSubstrate(staker.address) - 9n * nominal >= (nominal / 2n)).to.be.true; - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(nominal); + // Minimum stake amount is 100: + await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.eventually.rejected; + await helper.staking.stake(staker, 100n * nominal); + expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(100n * nominal); + + // TODO add helpers to assert bigints. Check balance close to 100 + expect(await helper.balance.getSubstrate(staker.address) - 99n * nominal >= (nominal / 2n)).to.be.true; + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(100n * nominal); // it is potentially flaky test. Promotion can credited some tokens. Maybe we need to use closeTo? - expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + nominal); // total tokens amount staked in app-promotion increased + expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + 100n * nominal); // total tokens amount staked in app-promotion increased - await helper.staking.stake(staker, 2n * nominal); - expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(3n * nominal); + await helper.staking.stake(staker, 200n * nominal); + expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(300n * nominal); const stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map((x) => x[1]); - expect(stakedPerBlock).to.be.deep.equal([nominal, 2n * nominal]); + expect(stakedPerBlock).to.be.deep.equal([100n * nominal, 200n * nominal]); }); }); it('should reject transaction if stake amount is more than total free balance', async () => { await usingPlaygrounds(async helper => { - const [staker] = await helper.arrange.creteAccounts([10n], alice); + const [staker] = await helper.arrange.creteAccounts([300n], alice); // Can't stake full balance because Alice needs to pay some fee - await expect(helper.staking.stake(staker, 10n * nominal)).to.be.eventually.rejected; - await helper.staking.stake(staker, 7n * nominal); + await expect(helper.staking.stake(staker, 300n * nominal)).to.be.eventually.rejected; + await helper.staking.stake(staker, 150n * nominal); // Can't stake 4 tkn because Alice has ~3 free tkn, and 7 locked - await expect(helper.staking.stake(staker, 4n * nominal)).to.be.eventually.rejected; - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(7n * nominal); + await expect(helper.staking.stake(staker, 150n * nominal)).to.be.eventually.rejected; + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(150n * nominal); }); }); it('for different accounts in one block is possible', async () => { await usingPlaygrounds(async helper => { - const crowd = await helper.arrange.creteAccounts([10n, 10n, 10n, 10n], alice); + const crowd = await helper.arrange.creteAccounts([1000n, 1000n, 1000n, 1000n], alice); - const crowdStartsToStake = crowd.map(user => helper.staking.stake(user, nominal)); + const crowdStartsToStake = crowd.map(user => helper.staking.stake(user, 100n * nominal)); await expect(Promise.all(crowdStartsToStake)).to.be.eventually.fulfilled; const crowdStakes = await Promise.all(crowd.map(address => helper.staking.getTotalStaked({Substrate: address.address}))); - expect(crowdStakes).to.deep.equal([nominal, nominal, nominal, nominal]); + expect(crowdStakes).to.deep.equal([100n * nominal, 100n * nominal, 100n * nominal, 100n * nominal]); }); }); // TODO it('Staker stakes 5 times in one block with nonce'); @@ -121,110 +121,102 @@ describe('unstake balance extrinsic', () => { it('should change balance state to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => { await usingPlaygrounds(async helper => { const totalStakedBefore = await helper.staking.getTotalStaked(); - const [staker] = await helper.arrange.creteAccounts([10n], alice); - await helper.staking.stake(staker, 5n * nominal); - await helper.staking.unstake(staker, 3n * nominal); + const [staker] = await helper.arrange.creteAccounts([1000n], alice); + await helper.staking.stake(staker, 500n * nominal); + await helper.staking.unstake(staker); - expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(3n * nominal); - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(2n * nominal); - expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + 2n * nominal); + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(500n * nominal); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); + expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore); }); }); - it('should remove from the "staked" map starting from the oldest entry', async () => { + it('should remove multiple stakes', async () => { await usingPlaygrounds(async helper => { - const [staker] = await helper.arrange.creteAccounts([100n], alice); - await helper.staking.stake(staker, 10n * nominal); - await helper.staking.stake(staker, 20n * nominal); - await helper.staking.stake(staker, 30n * nominal); + const [staker] = await helper.arrange.creteAccounts([1000n], alice); + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.stake(staker, 200n * nominal); + await helper.staking.stake(staker, 300n * nominal); - // staked: [10, 20, 30]; unstaked: 0 + // staked: [100, 200, 300]; unstaked: 0 let pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); let unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]); let stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]); expect(pendingUnstake).to.be.deep.equal(0n); expect(unstakedPerBlock).to.be.deep.equal([]); - expect(stakedPerBlock).to.be.deep.equal([10n * nominal, 20n * nominal, 30n * nominal]); + expect(stakedPerBlock).to.be.deep.equal([100n * nominal, 200n * nominal, 300n * nominal]); - // Can unstake the part of a stake - await helper.staking.unstake(staker, 5n * nominal); + // Can unstake multiple stakes + await helper.staking.unstake(staker); pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]); stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]); - expect(pendingUnstake).to.be.equal(5n * nominal); - expect(stakedPerBlock).to.be.deep.equal([5n * nominal, 20n * nominal, 30n * nominal]); - expect(unstakedPerBlock).to.be.deep.equal([5n * nominal]); - - // Can unstake one stake totally and one more partially - await helper.staking.unstake(staker, 10n * nominal); - pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); - unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]); - stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]); - expect(pendingUnstake).to.be.equal(15n * nominal); - expect(stakedPerBlock).to.be.deep.equal([15n * nominal, 30n * nominal]); - expect(unstakedPerBlock).to.deep.equal([5n * nominal, 10n * nominal]); - - // Can totally unstake 2 stakes in one tx - await helper.staking.unstake(staker, 45n * nominal); - pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); - unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]); - stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]); - expect(pendingUnstake).to.be.equal(60n * nominal); - expect(stakedPerBlock).to.deep.equal([]); - expect(unstakedPerBlock).to.deep.equal([5n * nominal, 10n * nominal, 45n * nominal]); + expect(pendingUnstake).to.be.equal(600n * nominal); + expect(stakedPerBlock).to.be.deep.equal([]); + expect(unstakedPerBlock).to.be.deep.equal([600n * nominal]); }); }); - it('should reject transaction if unstake amount is greater than staked', async () => { + it('should not have any effects if no active stakes', async () => { await usingPlaygrounds(async (helper) => { - const [staker] = await helper.arrange.creteAccounts([10n], alice); + const [staker] = await helper.arrange.creteAccounts([1000n], alice); - // can't unstsake more than one stake amount - await helper.staking.stake(staker, 1n * nominal); - await expect(helper.staking.unstake(staker, 1n * nominal + 1n)).to.be.eventually.rejected; + // unstake has no effect if no stakes at all + await helper.staking.unstake(staker); expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(0n); - expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(1n * nominal); + expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(0n); + expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); // TODO bigint closeTo helper - // can't unstsake more than two stakes amount - await helper.staking.stake(staker, 1n * nominal); - await expect(helper.staking.unstake(staker, 2n * nominal + 1n)).to.be.eventually.rejected; - expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(0n); - expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(2n * nominal); + // TODO stake() unstake() waitUnstaked() unstake(); + + // can't unstake if there are only pendingUnstakes + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.unstake(staker); + await helper.staking.unstake(staker); - // can't unstake more than have with nonce // TODO not sure we need this assertion - const nonce1 = await helper.chain.getNonce(staker.address); - const nonce2 = nonce1 + 1; - const unstakeMoreThanHaveWithNonce = Promise.all([ - helper.signTransaction(staker, helper.constructApiCall('api.tx.promotion.unstake', [1n * nominal]), 'unstaking 1', {nonce: nonce1}), - helper.signTransaction(staker, helper.constructApiCall('api.tx.promotion.unstake', [1n * nominal + 1n]), 'unstaking 1+', {nonce: nonce2}), - ]); - await expect(unstakeMoreThanHaveWithNonce).to.be.rejected; - expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(1n * nominal); + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal); + expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(100n * nominal); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); }); }); - it('should allow to unstake even smallest unit', async () => { + it('should keep different unlocking block for each unlocking stake', async () => { await usingPlaygrounds(async (helper) => { - const [staker] = await helper.arrange.creteAccounts([10n], alice); - await helper.staking.stake(staker, nominal); - // unstake .000...001 is possible - await helper.staking.unstake(staker, 1n); - expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(1n); + const [staker] = await helper.arrange.creteAccounts([1000n], alice); + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.unstake(staker); + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.unstake(staker); + expect.fail('Not implemented'); }); }); - it('should work fine if stake amount is smallest unit', async () => { + it('should unlock balance after unlocking period ends and subtract it from "pendingUnstake"', async () => { await usingPlaygrounds(async (helper) => { - const [staker] = await helper.arrange.creteAccounts([10n], alice); - await helper.staking.stake(staker, nominal); - await helper.staking.unstake(staker, nominal - 1n); + const [staker] = await helper.arrange.creteAccounts([1000n], alice); + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.unstake(staker); + // get unstake from block + // wait it + // check balance returned + expect.fail('Not implemented'); + }); + }); + + it('should be possible for different accounts in one block', async () => { + await usingPlaygrounds(async (helper) => { + const stakers = await helper.arrange.creteAccounts([200n, 200n, 200n, 200n, 200n], alice); + + await Promise.all(stakers.map(staker => helper.staking.stake(staker, 100n * nominal))); + await Promise.all(stakers.map(staker => helper.staking.unstake(staker))); - // Everything fine, blockchain alive - await helper.nft.mintCollection(staker, {name: 'name', description: 'description', tokenPrefix: 'prefix'}); + await Promise.all(stakers.map(async (staker) => { + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); + })); }); }); - // TODO will return balance to "available" state after the period of unstaking is finished, and subtract it from "pendingUnstake // TODO for different accounts in one block is possible }); @@ -366,7 +358,7 @@ describe('app-promotion stopSponsoringCollection', () => { await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.stopSponsorignCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); }); }); @@ -377,7 +369,7 @@ describe('app-promotion stopSponsoringCollection', () => { const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsorignCollection(collection.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.fulfilled; expect((await collection.getData())?.raw.sponsorship).to.be.equal('Disabled'); }); @@ -389,7 +381,7 @@ describe('app-promotion stopSponsoringCollection', () => { const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address}); await collection.confirmSponsorship(collectionOwner); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsorignCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: collectionOwner.address}); }); @@ -401,8 +393,8 @@ describe('app-promotion stopSponsoringCollection', () => { const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await collection.burn(collectionOwner); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsorignCollection(collection.collectionId))).to.be.eventually.rejected; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsorignCollection(999999999))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsoringCollection(999999999))).to.be.eventually.rejected; }); }); }); @@ -577,14 +569,15 @@ describe('app-promotion stopSponsoringContract', () => { describe('app-promotion rewards', () => { it('should credit 0.05% for staking period', async () => { await usingPlaygrounds(async helper => { - const [staker] = await helper.arrange.creteAccounts([50n], alice); + const [staker] = await helper.arrange.creteAccounts([5000n], alice); - await helper.staking.stake(staker, 1n * nominal); - await helper.staking.stake(staker, 2n * nominal); - await waitForRelayBlock(helper.api!, 36); + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.stake(staker, 200n * nominal); + await waitForRelayBlock(helper.api!, 55); + await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(50)); const totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); - expect(totalStakedPerBlock).to.be.deep.equal([calculateIncome(nominal, 10n), calculateIncome(2n * nominal, 10n)]); + expect(totalStakedPerBlock).to.be.deep.equal([calculateIncome(100n * nominal, 10n), calculateIncome(200n * nominal, 10n)]); }); }); @@ -596,17 +589,19 @@ describe('app-promotion rewards', () => { it('should bring compound interest', async () => { await usingPlaygrounds(async helper => { - const [staker] = await helper.arrange.creteAccounts([80n], alice); + const [staker] = await helper.arrange.creteAccounts([800n], alice); - await helper.staking.stake(staker, 10n * nominal); - await helper.staking.stake(staker, 20n * nominal); - await helper.staking.stake(staker, 30n * nominal); + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.stake(staker, 200n * nominal); + await helper.staking.stake(staker, 300n * nominal); await waitForRelayBlock(helper.api!, 34); + await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(50)); let totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); - expect(totalStakedPerBlock).to.deep.equal([calculateIncome(10n * nominal, 10n), calculateIncome(20n * nominal, 10n), calculateIncome(30n * nominal, 10n)]); + expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n), calculateIncome(200n * nominal, 10n), calculateIncome(300n * nominal, 10n)]); await waitForRelayBlock(helper.api!, 20); + await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(50)); totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); expect(totalStakedPerBlock).to.deep.equal([calculateIncome(10n * nominal, 10n, 2), calculateIncome(20n * nominal, 10n, 2), calculateIncome(30n * nominal, 10n, 2)]); }); diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index a6b30affb4..b8cabf9cc0 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -2005,11 +2005,11 @@ class StakingGroup extends HelperGroup { * @param label extra label for log * @returns */ - async unstake(signer: TSigner, amountToUnstake: bigint, label?: string): Promise { - if(typeof label === 'undefined') label = `${signer.address} amount: ${amountToUnstake}`; + async unstake(signer: TSigner, label?: string): Promise { + if(typeof label === 'undefined') label = `${signer.address}`; const unstakeResult = await this.helper.executeExtrinsic( signer, - 'api.tx.promotion.unstake', [amountToUnstake], + 'api.tx.promotion.unstake', [], true, `unstake failed for ${label}`, ); // TODO extract info from unstakeResult From 7a7b4a5ca2fe6ccb4aac64827cfc2fdb37691b37 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Wed, 31 Aug 2022 09:13:50 +0000 Subject: [PATCH 0644/1274] test: fix typo in createAccounts --- tests/src/addCollectionAdmin.test.ts | 12 ++++++------ tests/src/util/playgrounds/unique.dev.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/src/addCollectionAdmin.test.ts b/tests/src/addCollectionAdmin.test.ts index a0d7dcc31e..398df41c8c 100644 --- a/tests/src/addCollectionAdmin.test.ts +++ b/tests/src/addCollectionAdmin.test.ts @@ -33,7 +33,7 @@ before(async () => { describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => { it('Add collection admin.', async () => { await usingPlaygrounds(async (helper) => { - const [alice, bob] = await helper.arrange.creteAccounts([10n, 10n], donor); + const [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); const {collectionId} = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); const collection = await helper.collection.getData(collectionId); @@ -50,7 +50,7 @@ describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => { it("Not owner can't add collection admin.", async () => { await usingPlaygrounds(async (helper) => { - const [alice, bob, charlie] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor); + const [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); const {collectionId} = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); const collection = await helper.collection.getData(collectionId); @@ -69,7 +69,7 @@ describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_ it("Admin can't add collection admin.", async () => { await usingPlaygrounds(async (helper) => { - const [alice, bob, charlie] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor); + const [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); await collection.addAdmin(alice, {Substrate: bob.address}); @@ -88,7 +88,7 @@ describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_ it("Can't add collection admin of not existing collection.", async () => { await usingPlaygrounds(async (helper) => { - const [alice, bob] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor); + const [alice, bob] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); // tslint:disable-next-line: no-bitwise const collectionId = (1 << 32) - 1; @@ -102,7 +102,7 @@ describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_ it("Can't add an admin to a destroyed collection.", async () => { await usingPlaygrounds(async (helper) => { - const [alice, bob] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor); + const [alice, bob] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); await collection.burn(alice); @@ -116,7 +116,7 @@ describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_ it('Add an admin to a collection that has reached the maximum number of admins limit', async () => { await usingPlaygrounds(async (helper) => { - const [alice, ...accounts] = await helper.arrange.creteAccounts([10n, 0n, 0n, 0n, 0n, 0n, 0n, 0n], donor); + const [alice, ...accounts] = await helper.arrange.createAccounts([10n, 0n, 0n, 0n, 0n, 0n, 0n, 0n], donor); const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); const chainAdminLimit = (helper.api!.consts.common.collectionAdminsLimit as any).toNumber(); diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index c183a2b6f2..f61437ea72 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -70,7 +70,7 @@ class ArrangeGroup { * @returns array of newly created accounts * @example const [acc1, acc2, acc3] = await createAccounts([0n, 10n, 20n], donor); */ - creteAccounts = async (balances: bigint[], donor: IKeyringPair): Promise => { + createAccounts = async (balances: bigint[], donor: IKeyringPair): Promise => { let nonce = await this.helper.chain.getNonce(donor.address); const tokenNominal = this.helper.balance.getOneTokenNominal(); const transactions = []; From 50852e23a74351ca98188350609da0c073faab14 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 31 Aug 2022 21:08:40 +0700 Subject: [PATCH 0645/1274] minimal deposit for staking increased to 100 , added impl for `payout_stakers`. --- pallets/app-promotion/src/benchmarking.rs | 21 ++-- pallets/app-promotion/src/lib.rs | 138 ++++++++++++++++------ pallets/app-promotion/src/weights.rs | 92 ++++++++------- 3 files changed, 163 insertions(+), 88 deletions(-) diff --git a/pallets/app-promotion/src/benchmarking.rs b/pallets/app-promotion/src/benchmarking.rs index e55939f430..591f1f07c2 100644 --- a/pallets/app-promotion/src/benchmarking.rs +++ b/pallets/app-promotion/src/benchmarking.rs @@ -36,7 +36,8 @@ const SEED: u32 = 0; benchmarks! { where_clause{ where T: Config + pallet_unique::Config + pallet_evm_migration::Config , - T::BlockNumber: From + T::BlockNumber: From + Into, + <::Currency as Currency>::Balance: Sum + From } start_app_promotion { @@ -73,16 +74,16 @@ benchmarks! { let _ = ::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); let _ = PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller))?; - } : {PromototionPallet::::unstake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller))?} + } : {PromototionPallet::::unstake(RawOrigin::Signed(caller.clone()).into())?} - recalculate_stake { - let caller = account::("caller", 0, SEED); - let share = Perbill::from_rational(1u32, 10); - let _ = ::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); - let _ = PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller))?; - let block = ::current_block_number(); - let mut acc = >::default(); - } : {PromototionPallet::::recalculate_stake(&caller, block, share * ::Currency::total_balance(&caller), &mut acc)} + // recalculate_and_insert_stake{ + // let caller = account::("caller", 0, SEED); + // let share = Perbill::from_rational(1u32, 10); + // let _ = ::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + // let _ = PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller))?; + // let block = ::current_block_number(); + // let mut acc = >::default(); + // } : {PromototionPallet::::recalculate_and_insert_stake(&caller, block, share * ::Currency::total_balance(&caller), &mut acc)} sponsor_collection { let pallet_admin = account::("admin", 0, SEED); diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 586f4c6342..4d507d180c 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -191,12 +191,12 @@ pub mod pallet { pub type NextInterestBlock = StorageValue; - /// Stores the address of the staker for which the last revenue recalculation was performed. + /// Stores hash a record for which the last revenue recalculation was performed. /// If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers. #[pallet::storage] - #[pallet::getter(fn get_last_calculated_staker)] - pub type LastCalcucaltedStaker = - StorageValue; + #[pallet::getter(fn get_next_calculated_record)] + pub type NextCalculatedRecord = + StorageValue; #[pallet::hooks] impl Hooks> for Pallet { @@ -259,8 +259,8 @@ pub mod pallet { #[pallet::call] impl Pallet where - T::BlockNumber: From, - <::Currency as Currency>::Balance: Sum + From + T::BlockNumber: From + Into, + <::Currency as Currency>::Balance: Sum + From, { #[pallet::weight(T::WeightInfo::set_admin_address())] pub fn set_admin_address(origin: OriginFor, admin: T::CrossAccountId) -> DispatchResult { @@ -312,9 +312,11 @@ pub mod pallet { #[pallet::weight(T::WeightInfo::stake())] pub fn stake(staker: OriginFor, amount: BalanceOf) -> DispatchResult { let staker_id = ensure_signed(staker)?; - - ensure!(amount >= Into::>::into(100u128) * T::Nominal::get(), ArithmeticError::Underflow); + ensure!( + amount >= Into::>::into(100u128) * T::Nominal::get(), + ArithmeticError::Underflow + ); let balance = <::Currency as Currency>::free_balance(&staker_id); @@ -365,7 +367,7 @@ pub mod pallet { amount }) .sum(); - + let block = T::RelayBlockNumberProvider::current_block_number() + T::PendingInterval::get(); >::insert( @@ -374,8 +376,12 @@ pub mod pallet { .checked_add(&total_staked) .ok_or(ArithmeticError::Overflow)?, ); - - TotalStaked::::set(TotalStaked::::get().checked_sub(&total_staked).ok_or(ArithmeticError::Underflow)?); // when error we should recover stake state for the staker + + TotalStaked::::set( + TotalStaked::::get() + .checked_sub(&total_staked) + .ok_or(ArithmeticError::Underflow)?, + ); // when error we should recover initial stake state for the staker Ok(None.into()) @@ -511,15 +517,63 @@ pub mod pallet { admin_id == Admin::::get().ok_or(Error::::AdminNotSet)?, Error::::NoPermission ); - - let raw_key = Staked::::hashed_key_for((admin_id, T::BlockNumber::default())); - - let key_iterator = Staked::::iter_keys_from(raw_key).skip(1).into_iter(); - - match Self::get_last_calculated_staker() { - Some(last_staker) => {}, - None => {} - }; + + let current_recalc_block = + Self::get_current_recalc_block(T::RelayBlockNumberProvider::current_block_number()); + let next_recalc_block = current_recalc_block + T::RecalculationInterval::get(); + + let mut storage_iterator = Self::get_next_calculated_key() + .map_or(Staked::::iter().skip(0), |key| { + Staked::::iter_from(key).skip(1) + }); + + NextCalculatedRecord::::set(None); + + { + let mut stakers_number = stakers_number.unwrap_or(20); + let mut current_id = admin_id; + let mut income_acc = BalanceOf::::default(); + + while let Some(((id, staked_block), (amount, next_recalc_block_for_stake))) = + storage_iterator.next() + { + if current_id != id { + if income_acc != BalanceOf::::default() { + >::transfer( + &T::TreasuryAccountId::get(), + ¤t_id, + income_acc, + ExistenceRequirement::KeepAlive, + ) + .and_then(|_| Self::add_lock_balance(¤t_id, income_acc))?; + + Self::deposit_event(Event::StakingRecalculation( + current_id, amount, income_acc, + )); + } + + stakers_number -= 1; + if stakers_number == 0 { + NextCalculatedRecord::::set(Some((id, staked_block))); + break; + } + income_acc = BalanceOf::::default(); + current_id = id; + }; + if next_recalc_block_for_stake >= current_recalc_block { + Self::recalculate_and_insert_stake( + ¤t_id, + staked_block, + next_recalc_block, + amount, + ((next_recalc_block_for_stake - current_recalc_block) + / T::RecalculationInterval::get()) + .into() + 1, + &mut income_acc, + ); + } + } + } Ok(()) } @@ -609,31 +663,43 @@ impl Pallet { Self::total_staked_by_id_per_block(staker.as_sub()).unwrap_or_default() } - fn recalculate_stake( + fn recalculate_and_insert_stake( staker: &T::AccountId, - block: T::BlockNumber, + staked_block: T::BlockNumber, + next_recalc_block: T::BlockNumber, base: BalanceOf, + iters: u32, income_acc: &mut BalanceOf, ) { - let income = Self::calculate_income(base); - // base.checked_add(&income).map(|res| { - // >::insert((staker, block), res); - // *income_acc += income; - // >::transfer( - // &T::TreasuryAccountId::get(), - // staker, - // income, - // ExistenceRequirement::KeepAlive, - // ) - // .and_then(|_| Self::add_lock_balance(staker, income)); - // }); + let income = Self::calculate_income(base, iters); + + base.checked_add(&income).map(|res| { + >::insert((staker, staked_block), (res, next_recalc_block)); + *income_acc += income; + }); } - fn calculate_income(base: I) -> I + fn calculate_income(base: I, iters: u32) -> I where I: EncodeLike> + Balance, { - T::IntervalIncome::get() * base + let mut income = base; + + (0..iters).for_each(|_| income += T::IntervalIncome::get() * income); + + income - base + } + + fn get_current_recalc_block(current_relay_block: T::BlockNumber) -> T::BlockNumber { + (current_relay_block / T::RecalculationInterval::get()) * T::RecalculationInterval::get() + } + + // fn get_next_recalc_block(current_relay_block: T::BlockNumber) -> T::BlockNumber { + // Self::get_current_recalc_block(current_relay_block) + T::RecalculationInterval::get() + // } + + fn get_next_calculated_key() -> Option> { + Self::get_next_calculated_record().map(|key| Staked::::hashed_key_for(key)) } } diff --git a/pallets/app-promotion/src/weights.rs b/pallets/app-promotion/src/weights.rs index fc709cdd65..84a0b3fa96 100644 --- a/pallets/app-promotion/src/weights.rs +++ b/pallets/app-promotion/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_app_promotion //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-08-30, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-08-31, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -26,6 +26,7 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] +#![allow(missing_docs)] #![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; @@ -39,7 +40,6 @@ pub trait WeightInfo { fn payout_stakers() -> Weight; fn stake() -> Weight; fn unstake() -> Weight; - fn recalculate_stake() -> Weight; fn sponsor_collection() -> Weight; fn stop_sponsoring_collection() -> Weight; fn sponsor_contract() -> Weight; @@ -53,71 +53,75 @@ impl WeightInfo for SubstrateWeight { // Storage: ParachainSystem ValidationData (r:1 w:0) // Storage: Promotion NextInterestBlock (r:0 w:1) fn start_app_promotion() -> Weight { - (2_299_000 as Weight) + (3_995_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Promotion StartBlock (r:1 w:1) // Storage: Promotion NextInterestBlock (r:0 w:1) fn stop_app_promotion() -> Weight { - (1_733_000 as Weight) + (3_623_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Promotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - (553_000 as Weight) + (1_203_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Storage: Promotion NextCalculatedRecord (r:1 w:1) + // Storage: Promotion Staked (r:2 w:0) fn payout_stakers() -> Weight { - (1_398_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) + (10_859_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: ParachainSystem ValidationData (r:1 w:0) // Storage: Promotion Staked (r:1 w:1) + // Storage: Promotion TotalStaked (r:1 w:1) fn stake() -> Weight { - (9_506_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + (14_789_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) } - // Storage: System Account (r:1 w:0) + // Storage: Promotion Staked (r:2 w:1) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Storage: Promotion PendingUnstake (r:1 w:1) + // Storage: Promotion TotalStaked (r:1 w:1) fn unstake() -> Weight { - (2_529_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - } - // Storage: System Account (r:1 w:0) - fn recalculate_stake() -> Weight { - (2_203_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) + (16_889_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn sponsor_collection() -> Weight { - (10_882_000 as Weight) + (18_377_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn stop_sponsoring_collection() -> Weight { - (10_544_000 as Weight) + (13_989_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:0 w:1) fn sponsor_contract() -> Weight { - (2_163_000 as Weight) + (4_162_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:1 w:1) fn stop_sponsoring_contract() -> Weight { - (3_511_000 as Weight) + (5_457_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -129,71 +133,75 @@ impl WeightInfo for () { // Storage: ParachainSystem ValidationData (r:1 w:0) // Storage: Promotion NextInterestBlock (r:0 w:1) fn start_app_promotion() -> Weight { - (2_299_000 as Weight) + (3_995_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Promotion StartBlock (r:1 w:1) // Storage: Promotion NextInterestBlock (r:0 w:1) fn stop_app_promotion() -> Weight { - (1_733_000 as Weight) + (3_623_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } // Storage: Promotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - (553_000 as Weight) + (1_203_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Storage: Promotion NextCalculatedRecord (r:1 w:1) + // Storage: Promotion Staked (r:2 w:0) fn payout_stakers() -> Weight { - (1_398_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + (10_859_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: ParachainSystem ValidationData (r:1 w:0) // Storage: Promotion Staked (r:1 w:1) + // Storage: Promotion TotalStaked (r:1 w:1) fn stake() -> Weight { - (9_506_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + (14_789_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } - // Storage: System Account (r:1 w:0) + // Storage: Promotion Staked (r:2 w:1) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Storage: Promotion PendingUnstake (r:1 w:1) + // Storage: Promotion TotalStaked (r:1 w:1) fn unstake() -> Weight { - (2_529_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - } - // Storage: System Account (r:1 w:0) - fn recalculate_stake() -> Weight { - (2_203_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + (16_889_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + .saturating_add(RocksDbWeight::get().writes(3 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn sponsor_collection() -> Weight { - (10_882_000 as Weight) + (18_377_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn stop_sponsoring_collection() -> Weight { - (10_544_000 as Weight) + (13_989_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:0 w:1) fn sponsor_contract() -> Weight { - (2_163_000 as Weight) + (4_162_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:1 w:1) fn stop_sponsoring_contract() -> Weight { - (3_511_000 as Weight) + (5_457_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } From fc68cba5bed8d472e4339de243c09386d91ff720 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 31 Aug 2022 17:12:24 +0300 Subject: [PATCH 0646/1274] Remove logs from the console Signed-off-by: Yaroslav Bolyukin --- tests/src/substrate/substrate-api.ts | 2 +- tests/src/util/playgrounds/index.ts | 4 ++-- tests/src/util/playgrounds/unique.dev.ts | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/src/substrate/substrate-api.ts b/tests/src/substrate/substrate-api.ts index cf6493cd73..f8c7252862 100644 --- a/tests/src/substrate/substrate-api.ts +++ b/tests/src/substrate/substrate-api.ts @@ -85,7 +85,7 @@ export default async function usingApi(action: (api: ApiPromise, priva for (const arg of args) { if (typeof arg !== 'string') continue; - if (arg.includes('1000:: Normal connection closure' || arg === 'Normal connection closure')) + if (arg.includes('1000:: Normal connection closure') || arg.includes('Not decorating unknown runtime apis:') || arg.includes('RPC methods not decorated:') || arg === 'Normal connection closure') return; } printer(...args); diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index c2b59cc025..354a8ad0b6 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -26,7 +26,7 @@ export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKe for (const arg of args) { if (typeof arg !== 'string') continue; - if (arg.includes('1000:: Normal connection closure' || arg === 'Normal connection closure')) + if (arg.includes('1000:: Normal connection closure') || arg.includes('Not decorating unknown runtime apis:') || arg.includes('RPC methods not decorated:') || arg === 'Normal connection closure') return; } printer(...args); @@ -49,4 +49,4 @@ export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKe console.log = consoleLog; console.warn = consoleWarn; } -}; \ No newline at end of file +}; diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index f61437ea72..ff6e2bcab8 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -103,7 +103,6 @@ class ArrangeGroup { let accountsCreated = false; // checkBalances retry up to 5 blocks for (let index = 0; index < 5; index++) { - console.log(await this.helper.chain.getLatestBlockNumber()); accountsCreated = await checkBalances(); if(accountsCreated) break; await this.waitNewBlocks(1); From 36c9f569dead1415ca11ef04d40755aee4770df9 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 31 Aug 2022 19:24:48 +0500 Subject: [PATCH 0647/1274] Tests up and add some new --- tests/src/addCollectionAdmin.test.ts | 12 +- tests/src/app-promotion.test.ts | 227 ++++++++++++++--------- tests/src/removeCollectionAdmin.test.ts | 1 + tests/src/util/playgrounds/unique.dev.ts | 70 ++++++- 4 files changed, 215 insertions(+), 95 deletions(-) diff --git a/tests/src/addCollectionAdmin.test.ts b/tests/src/addCollectionAdmin.test.ts index a0d7dcc31e..398df41c8c 100644 --- a/tests/src/addCollectionAdmin.test.ts +++ b/tests/src/addCollectionAdmin.test.ts @@ -33,7 +33,7 @@ before(async () => { describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => { it('Add collection admin.', async () => { await usingPlaygrounds(async (helper) => { - const [alice, bob] = await helper.arrange.creteAccounts([10n, 10n], donor); + const [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); const {collectionId} = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); const collection = await helper.collection.getData(collectionId); @@ -50,7 +50,7 @@ describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => { it("Not owner can't add collection admin.", async () => { await usingPlaygrounds(async (helper) => { - const [alice, bob, charlie] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor); + const [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); const {collectionId} = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); const collection = await helper.collection.getData(collectionId); @@ -69,7 +69,7 @@ describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_ it("Admin can't add collection admin.", async () => { await usingPlaygrounds(async (helper) => { - const [alice, bob, charlie] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor); + const [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); await collection.addAdmin(alice, {Substrate: bob.address}); @@ -88,7 +88,7 @@ describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_ it("Can't add collection admin of not existing collection.", async () => { await usingPlaygrounds(async (helper) => { - const [alice, bob] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor); + const [alice, bob] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); // tslint:disable-next-line: no-bitwise const collectionId = (1 << 32) - 1; @@ -102,7 +102,7 @@ describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_ it("Can't add an admin to a destroyed collection.", async () => { await usingPlaygrounds(async (helper) => { - const [alice, bob] = await helper.arrange.creteAccounts([10n, 10n, 10n], donor); + const [alice, bob] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); await collection.burn(alice); @@ -116,7 +116,7 @@ describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_ it('Add an admin to a collection that has reached the maximum number of admins limit', async () => { await usingPlaygrounds(async (helper) => { - const [alice, ...accounts] = await helper.arrange.creteAccounts([10n, 0n, 0n, 0n, 0n, 0n, 0n, 0n], donor); + const [alice, ...accounts] = await helper.arrange.createAccounts([10n, 0n, 0n, 0n, 0n, 0n, 0n, 0n], donor); const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); const chainAdminLimit = (helper.api!.consts.common.collectionAdminsLimit as any).toNumber(); diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index bdb4c8f69d..9615ff5d48 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -28,7 +28,7 @@ import {usingPlaygrounds} from './util/playgrounds'; import {encodeAddress} from '@polkadot/util-crypto'; import {stringToU8a} from '@polkadot/util'; import {ApiPromise} from '@polkadot/api'; -import {contractHelpers, createEthAccountWithBalance, deployFlipper, itWeb3} from './eth/util/helpers'; +import {SponsoringMode, contractHelpers, createEthAccountWithBalance, deployFlipper, itWeb3, transferBalanceToEth} from './eth/util/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -66,7 +66,7 @@ describe('app-promotions.stake extrinsic', () => { it('should change balance state to "locked", add it to "staked" map, and increase "totalStaked" amount', async () => { await usingPlaygrounds(async (helper) => { const totalStakedBefore = await helper.staking.getTotalStaked(); - const [staker] = await helper.arrange.creteAccounts([400n], alice); + const [staker] = await helper.arrange.createAccounts([400n], alice); // Minimum stake amount is 100: await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.eventually.rejected; @@ -89,7 +89,7 @@ describe('app-promotions.stake extrinsic', () => { it('should reject transaction if stake amount is more than total free balance', async () => { await usingPlaygrounds(async helper => { - const [staker] = await helper.arrange.creteAccounts([300n], alice); + const [staker] = await helper.arrange.createAccounts([300n], alice); // Can't stake full balance because Alice needs to pay some fee await expect(helper.staking.stake(staker, 300n * nominal)).to.be.eventually.rejected; @@ -103,7 +103,7 @@ describe('app-promotions.stake extrinsic', () => { it('for different accounts in one block is possible', async () => { await usingPlaygrounds(async helper => { - const crowd = await helper.arrange.creteAccounts([1000n, 1000n, 1000n, 1000n], alice); + const crowd = await helper.arrange.createAccounts([1000n, 1000n, 1000n, 1000n], alice); const crowdStartsToStake = crowd.map(user => helper.staking.stake(user, 100n * nominal)); await expect(Promise.all(crowdStartsToStake)).to.be.eventually.fulfilled; @@ -121,7 +121,7 @@ describe('unstake balance extrinsic', () => { it('should change balance state to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => { await usingPlaygrounds(async helper => { const totalStakedBefore = await helper.staking.getTotalStaked(); - const [staker] = await helper.arrange.creteAccounts([1000n], alice); + const [staker] = await helper.arrange.createAccounts([1000n], alice); await helper.staking.stake(staker, 500n * nominal); await helper.staking.unstake(staker); @@ -133,7 +133,7 @@ describe('unstake balance extrinsic', () => { it('should remove multiple stakes', async () => { await usingPlaygrounds(async helper => { - const [staker] = await helper.arrange.creteAccounts([1000n], alice); + const [staker] = await helper.arrange.createAccounts([1000n], alice); await helper.staking.stake(staker, 100n * nominal); await helper.staking.stake(staker, 200n * nominal); await helper.staking.stake(staker, 300n * nominal); @@ -159,7 +159,7 @@ describe('unstake balance extrinsic', () => { it('should not have any effects if no active stakes', async () => { await usingPlaygrounds(async (helper) => { - const [staker] = await helper.arrange.creteAccounts([1000n], alice); + const [staker] = await helper.arrange.createAccounts([1000n], alice); // unstake has no effect if no stakes at all await helper.staking.unstake(staker); @@ -182,30 +182,31 @@ describe('unstake balance extrinsic', () => { it('should keep different unlocking block for each unlocking stake', async () => { await usingPlaygrounds(async (helper) => { - const [staker] = await helper.arrange.creteAccounts([1000n], alice); + const [staker] = await helper.arrange.createAccounts([1000n], alice); await helper.staking.stake(staker, 100n * nominal); await helper.staking.unstake(staker); - await helper.staking.stake(staker, 100n * nominal); + await helper.staking.stake(staker, 120n * nominal); await helper.staking.unstake(staker); - expect.fail('Not implemented'); + + const unstakingPerBlock = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); + expect(unstakingPerBlock).has.length(2); + expect(unstakingPerBlock[0][1]).to.equal(100n * nominal); + expect(unstakingPerBlock[1][1]).to.equal(120n * nominal); }); }); it('should unlock balance after unlocking period ends and subtract it from "pendingUnstake"', async () => { await usingPlaygrounds(async (helper) => { - const [staker] = await helper.arrange.creteAccounts([1000n], alice); + const [staker] = await helper.arrange.createAccounts([1000n], alice); await helper.staking.stake(staker, 100n * nominal); await helper.staking.unstake(staker); - // get unstake from block - // wait it - // check balance returned expect.fail('Not implemented'); }); }); it('should be possible for different accounts in one block', async () => { await usingPlaygrounds(async (helper) => { - const stakers = await helper.arrange.creteAccounts([200n, 200n, 200n, 200n, 200n], alice); + const stakers = await helper.arrange.createAccounts([200n, 200n, 200n, 200n, 200n], alice); await Promise.all(stakers.map(staker => helper.staking.stake(staker, 100n * nominal))); await Promise.all(stakers.map(staker => helper.staking.unstake(staker))); @@ -236,7 +237,7 @@ describe('Admin adress', () => { // We are not going to set an eth address as a sponsor, // but we do want to check, it doesn't break anything; await usingPlaygrounds(async (helper) => { - const [charlie] = await helper.arrange.creteAccounts([10n], alice); + const [charlie] = await helper.arrange.createAccounts([10n], alice); const ethCharlie = helper.address.substrateToEth(charlie.address); // Alice sets Ethereum address as a sudo. Then Substrate address back... await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Ethereum: ethCharlie})))).to.be.eventually.fulfilled; @@ -250,7 +251,7 @@ describe('Admin adress', () => { it('can be reassigned', async () => { await usingPlaygrounds(async (helper) => { - const [oldAdmin, newAdmin, collectionOwner] = await helper.arrange.creteAccounts([10n, 10n, 10n], alice); + const [oldAdmin, newAdmin, collectionOwner] = await helper.arrange.createAccounts([10n, 10n, 10n], alice); const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.eventually.fulfilled; @@ -269,10 +270,28 @@ describe('App-promotion collection sponsoring', () => { await helper.signTransaction(alice, tx); }); }); - + + it('should actually sponsor transactions', async () => { + await usingPlaygrounds(async (helper) => { + const [collectionOwner, tokenSender, receiver] = await helper.arrange.createAccounts([10n, 10n, 0n], alice); + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'Name', description: 'Description', tokenPrefix: 'Prefix', limits: {sponsorTransferTimeout: 0}}); + const token = await collection.mintToken(collectionOwner, {Substrate: tokenSender.address}); + await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId)); + const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress); + + await token.transfer(tokenSender, {Substrate: receiver.address}); + expect (await token.getOwner()).to.be.deep.equal({Substrate: receiver.address}); + const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress); + + // senders balance the same + expect (await helper.balance.getSubstrate(tokenSender.address)).to.be.equal(10n * nominal); + expect (palletBalanceBefore > palletBalanceAfter).to.be.true; + }); + }); + it('can not be set by non admin', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner, nonAdmin] = await helper.arrange.creteAccounts([10n, 10n], alice); + const [collectionOwner, nonAdmin] = await helper.arrange.createAccounts([10n, 10n], alice); const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); @@ -283,7 +302,7 @@ describe('App-promotion collection sponsoring', () => { it('should set pallet address as confirmed admin', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner, oldSponsor] = await helper.arrange.creteAccounts([20n, 20n], alice); + const [collectionOwner, oldSponsor] = await helper.arrange.createAccounts([20n, 20n], alice); // Can set sponsoring for collection without sponsor const collectionWithoutSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'No-sponsor', description: 'New Collection', tokenPrefix: 'Promotion'}); @@ -306,7 +325,7 @@ describe('App-promotion collection sponsoring', () => { it('can be overwritten by collection owner', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner, newSponsor] = await helper.arrange.creteAccounts([20n, 0n], alice); + const [collectionOwner, newSponsor] = await helper.arrange.createAccounts([20n, 0n], alice); const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); const collectionId = collection.collectionId; @@ -341,7 +360,7 @@ describe('App-promotion collection sponsoring', () => { it('should reject transaction if collection was burnt', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner] = await helper.arrange.creteAccounts([10n], alice); + const [collectionOwner] = await helper.arrange.createAccounts([10n], alice); const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await collection.burn(collectionOwner); @@ -353,7 +372,7 @@ describe('App-promotion collection sponsoring', () => { describe('app-promotion stopSponsoringCollection', () => { it('can not be called by non-admin', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner, nonAdmin] = await helper.arrange.creteAccounts([10n, 10n], alice); + const [collectionOwner, nonAdmin] = await helper.arrange.createAccounts([10n, 10n], alice); const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; @@ -365,7 +384,7 @@ describe('app-promotion stopSponsoringCollection', () => { it('should set sponsoring as disabled', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner] = await helper.arrange.creteAccounts([10n, 10n], alice); + const [collectionOwner] = await helper.arrange.createAccounts([10n, 10n], alice); const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; @@ -377,7 +396,7 @@ describe('app-promotion stopSponsoringCollection', () => { it('should not affect collection which is not sponsored by pallete', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner] = await helper.arrange.creteAccounts([10n, 10n], alice); + const [collectionOwner] = await helper.arrange.createAccounts([10n, 10n], alice); const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address}); await collection.confirmSponsorship(collectionOwner); @@ -389,7 +408,7 @@ describe('app-promotion stopSponsoringCollection', () => { it('should reject transaction if collection does not exist', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner] = await helper.arrange.creteAccounts([10n], alice); + const [collectionOwner] = await helper.arrange.createAccounts([10n], alice); const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await collection.burn(collectionOwner); @@ -471,7 +490,7 @@ describe('app-promotion contract sponsoring', () => { itWeb3('can not be set by non admin', async ({api, web3, privateKeyWrapper}) => { await usingPlaygrounds(async (helper) => { - const [nonAdmin] = await helper.arrange.creteAccounts([50n], alice); + const [nonAdmin] = await helper.arrange.createAccounts([50n], alice); const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); const flipper = await deployFlipper(web3, contractOwner); const contractMethods = contractHelpers(web3, contractOwner); @@ -488,88 +507,95 @@ describe('app-promotion contract sponsoring', () => { }, }); }); - }); - it('will return unused gas fee to app-promotion pallete', async () => { - // TODO - // arrange: Alice deploys Flipper - // arrange: Admin calls appPromotion.sponsorContract(Flipper.address) + itWeb3('should be rejected for non-contract address', async ({api, web3, privateKeyWrapper}) => { + await usingPlaygrounds(async (helper) => { - // assert: Bob calls Flipper - expect balances deposit event do not appears for Bob /// Unused gas fee returns to contract - // assert: Bobs balance the same + }); + }); }); - it('will failed for non contract address', async () => { - // arrange: web3 creates new address - 0x0 + itWeb3('should actually sponsor transactions', async ({api, web3, privateKeyWrapper}) => { + await usingPlaygrounds(async (helper) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); + const flipper = await deployFlipper(web3, contractOwner); + const contractHelper = contractHelpers(web3, contractOwner); + await contractHelper.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: contractOwner}); + await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); + await transferBalanceToEth(api, alice, flipper.options.address, 1000n); - // assert: Admin calls appPromotion.sponsorContract(0x0) throws - // assert: Admin calls appPromotion.sponsorContract(Substrate address) throws - }); + await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address)); + await flipper.methods.flip().send({from: caller}); + expect(await flipper.methods.getValue().call()).to.be.true; - it('will actually sponsor transactions', async () => { - // TODO test it because this is a new way of contract sponsoring - }); -}); + const callerBalance = await helper.balance.getEthereum(caller); + const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address); -describe('app-promotion stopSponsoringContract', () => { - before(async function () { - await usingPlaygrounds(async (helper, privateKeyWrapper) => { - if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - palletAdmin = privateKeyWrapper('//palletAdmin'); - await helper.balance.transferToSubstrate(alice, palletAdmin.address, 10n * helper.balance.getOneTokenNominal()); - await helper.balance.transferToSubstrate(alice, palletAddress, 10n * helper.balance.getOneTokenNominal()); - - const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(palletAdmin))); - await helper.signTransaction(alice, tx); - - nominal = helper.balance.getOneTokenNominal(); + expect(callerBalance).to.be.equal(1000n * nominal); + expect(1000n * nominal > contractBalanceAfter).to.be.true; }); }); - - it('will set contract sponsoring mode as disabled', async () => { - // arrange: Alice deploys Flipper - // arrange: Admin calls appPromotion.sponsorContract(Flipper.address) - - // act: Admin calls appPromotion.stopSponsoringContract(Flipper.address) - // assert: contract sponsoring mode = TODO +}); + +describe('app-promotion stopSponsoringContract', () => { + itWeb3('should remove pallet address from contract sponsors', async ({api, web3, privateKeyWrapper}) => { + await usingPlaygrounds(async (helper) => { + const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); + const flipper = await deployFlipper(web3, contractOwner); + await transferBalanceToEth(api, alice, flipper.options.address); + const contractHelper = contractHelpers(web3, contractOwner); + await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); + await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address)); + await helper.signTransaction(palletAdmin, api.tx.promotion.stopSponsoringContract(flipper.options.address)); - // act: Bob calls Flipper + expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.false; + expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); + expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + disabled: null, + }); - // assert: PalleteAddress balance did not change - // assert: Bobs balance less than before /// Bob payed some fee - }); + await flipper.methods.flip().send({from: caller}); + expect(await flipper.methods.getValue().call()).to.be.true; - it('can not be called by non-admin', async () => { - // arrange: Alice deploys Flipper - // arrange: Admin calls appPromotion.sponsorContract(Flipper.address) + const callerBalance = await helper.balance.getEthereum(caller); + const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address); - // assert: Random calls appPromotion.stopSponsoringContract(Flipper.address) throws - // assert: contract sponsor is PallereAddress + // caller payed for call + expect(1000n * nominal > callerBalance).to.be.true; + expect(contractBalanceAfter).to.be.equal(1000n * nominal); + }); }); - it('will not affect a contract which is not sponsored by pallete', async () => { - // arrange: Alice deploys Flipper - // arrange: Alice sets self sponsoring for Flipper - - // act: Admin calls appPromotion.stopSponsoringContract(Flipper.address) throws + itWeb3('can not be called by non-admin', async ({api, web3, privateKeyWrapper}) => { + await usingPlaygrounds(async (helper) => { + const [nonAdmin] = await helper.arrange.createAccounts([10n], alice); + const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); + const flipper = await deployFlipper(web3, contractOwner); - // assert: contract.sponsoringMode = Self - // assert: contract.sponsor to be contract + await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address)); + await expect(helper.signTransaction(nonAdmin, api.tx.promotion.stopSponsoringContract(flipper.options.address))).to.be.rejected; + }); }); - it('will failed for non contract address', async () => { - // arrange: web3 creates new address - 0x0 + itWeb3('should not affect a contract which is not sponsored by pallete', async ({api, web3, privateKeyWrapper}) => { + await usingPlaygrounds(async (helper) => { + const [nonAdmin] = await helper.arrange.createAccounts([10n], alice); + const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); + const flipper = await deployFlipper(web3, contractOwner); + const contractHelper = contractHelpers(web3, contractOwner); + await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; - // expect stopSponsoringContract(0x0) throws + await expect(helper.signTransaction(nonAdmin, api.tx.promotion.stopSponsoringContract(flipper.options.address))).to.be.rejected; + }); }); }); describe('app-promotion rewards', () => { it('should credit 0.05% for staking period', async () => { await usingPlaygrounds(async helper => { - const [staker] = await helper.arrange.creteAccounts([5000n], alice); + const [staker] = await helper.arrange.createAccounts([5000n], alice); await helper.staking.stake(staker, 100n * nominal); await helper.staking.stake(staker, 200n * nominal); @@ -580,6 +606,18 @@ describe('app-promotion rewards', () => { expect(totalStakedPerBlock).to.be.deep.equal([calculateIncome(100n * nominal, 10n), calculateIncome(200n * nominal, 10n)]); }); }); + + it('can not be initialized by non admin', async () => { + await usingPlaygrounds(async (helper) => { + expect.fail('Test not implemented'); + }); + }); + + it('shoud be paid for more than one period if payments was missed', async () => { + await usingPlaygrounds(async (helper) => { + expect.fail('Test not implemented'); + }); + }); it('should not be credited for unstaked (reserved) balance', async () => { await usingPlaygrounds(async helper => { @@ -589,7 +627,7 @@ describe('app-promotion rewards', () => { it('should bring compound interest', async () => { await usingPlaygrounds(async helper => { - const [staker] = await helper.arrange.creteAccounts([800n], alice); + const [staker] = await helper.arrange.createAccounts([800n], alice); await helper.staking.stake(staker, 100n * nominal); await helper.staking.stake(staker, 200n * nominal); @@ -607,7 +645,24 @@ describe('app-promotion rewards', () => { }); }); - // TODO (load test. Can pay reward for 10000 addresses) + it.skip('can handle 40.000 rewards', async () => { + await usingPlaygrounds(async (helper) => { + const [donor] = await helper.arrange.createAccounts([7_000_000n], alice); + const crowdStakes = async () => { + // each account in the crowd stakes 2 times + const crowd = await helper.arrange.createCrowd(500, 300n, donor); + await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal))); + await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal))); + // + }; + + for (let i = 0; i < 40; i++) { + await crowdStakes(); + } + + // TODO pay rewards for some period + }); + }); }); async function waitForRelayBlock(api: ApiPromise, blocks = 1): Promise { diff --git a/tests/src/removeCollectionAdmin.test.ts b/tests/src/removeCollectionAdmin.test.ts index 6841434400..d9b2a23a3a 100644 --- a/tests/src/removeCollectionAdmin.test.ts +++ b/tests/src/removeCollectionAdmin.test.ts @@ -27,6 +27,7 @@ describe('Integration Test removeCollectionAdmin(collection_id, account_id):', ( const alice = privateKey('//Alice'); const bob = privateKey('//Bob'); const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const collectionInfo = await collection.getData(); expect(collectionInfo?.raw.owner.toString()).to.be.deep.eq(alice.address); // first - add collection admin Bob diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index c183a2b6f2..5d9c79dae8 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -5,7 +5,6 @@ import {mnemonicGenerate} from '@polkadot/util-crypto'; import {UniqueHelper} from './unique'; import {ApiPromise, WsProvider} from '@polkadot/api'; import * as defs from '../../interfaces/definitions'; -import {TSigner} from './types'; import {IKeyringPair} from '@polkadot/types/types'; @@ -70,7 +69,7 @@ class ArrangeGroup { * @returns array of newly created accounts * @example const [acc1, acc2, acc3] = await createAccounts([0n, 10n, 20n], donor); */ - creteAccounts = async (balances: bigint[], donor: IKeyringPair): Promise => { + createAccounts = async (balances: bigint[], donor: IKeyringPair): Promise => { let nonce = await this.helper.chain.getNonce(donor.address); const tokenNominal = this.helper.balance.getOneTokenNominal(); const transactions = []; @@ -103,7 +102,6 @@ class ArrangeGroup { let accountsCreated = false; // checkBalances retry up to 5 blocks for (let index = 0; index < 5; index++) { - console.log(await this.helper.chain.getLatestBlockNumber()); accountsCreated = await checkBalances(); if(accountsCreated) break; await this.waitNewBlocks(1); @@ -115,6 +113,72 @@ class ArrangeGroup { return accounts; }; + // TODO combine this method and createAccounts into one + createCrowd = async (accountsToCreate: number, withBalance: bigint, donor: IKeyringPair): Promise => { + let transactions: any = []; + const accounts: IKeyringPair[] = []; + + const createAsManyAsCan = async () => { + let nonce = await this.helper.chain.getNonce(donor.address); + const tokenNominal = this.helper.balance.getOneTokenNominal(); + for (let i = 0; i < accountsToCreate; i++) { + if (i === 500) { // if there are too many accounts to create + await Promise.allSettled(transactions); // wait while first 500 (should be 100 for devnode) tx will be settled + transactions = []; // + nonce = await this.helper.chain.getNonce(donor.address); // update nonce + } + const recepient = this.helper.util.fromSeed(mnemonicGenerate()); + accounts.push(recepient); + if (withBalance !== 0n) { + const tx = this.helper.constructApiCall('api.tx.balances.transfer', [{Id: recepient.address}, withBalance * tokenNominal]); + transactions.push(this.helper.signTransaction(donor, tx, 'account generation', {nonce})); + nonce++; + } + } + + const fullfilledAccounts = []; + await Promise.allSettled(transactions); + for (const account of accounts) { + const accountBalance = await this.helper.balance.getSubstrate(account.address); + if (accountBalance === withBalance * tokenNominal) { + fullfilledAccounts.push(account); + } + } + return fullfilledAccounts; + }; + + + const crowd: IKeyringPair[] = []; + // do up to 5 retries + for (let index = 0; index < 5 && accountsToCreate !== 0; index++) { + const asManyAsCan = await createAsManyAsCan(); + crowd.push(...asManyAsCan); + accountsToCreate -= asManyAsCan.length; + } + + if (accountsToCreate !== 0) throw Error(`Crowd generation failed: ${accountsToCreate} accounts left`); + + return crowd; + }; + + isDevNode = async () => { + const block1 = await this.helper.api?.rpc.chain.getBlock(await this.helper.api?.rpc.chain.getBlockHash(1)); + const block2 = await this.helper.api?.rpc.chain.getBlock(await this.helper.api?.rpc.chain.getBlockHash(2)); + const findCreationDate = async (block: any) => { + const humanBlock = block.toHuman(); + let date; + humanBlock.block.extrinsics.forEach((ext: any) => { + if(ext.method.section === 'timestamp') { + date = Number(ext.method.args.now.replaceAll(',', '')); + } + }); + return date; + }; + const block1date = await findCreationDate(block1); + const block2date = await findCreationDate(block2); + if(block2date! - block1date! < 9000) return true; + }; + /** * Wait for specified bnumber of blocks * @param blocksCount number of blocks to wait From dffea63482ac7a58c99f91fcd3d8c5feb2bb3a5c Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 31 Aug 2022 21:57:57 +0700 Subject: [PATCH 0648/1274] fix logic --- pallets/app-promotion/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 4d507d180c..f43d537cd6 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -552,11 +552,11 @@ pub mod pallet { )); } - stakers_number -= 1; if stakers_number == 0 { NextCalculatedRecord::::set(Some((id, staked_block))); break; } + stakers_number -= 1; income_acc = BalanceOf::::default(); current_id = id; }; From 0889383aee24bdc9189b92a67486887f036e09be Mon Sep 17 00:00:00 2001 From: PraetorP Date: Thu, 1 Sep 2022 12:45:08 +0700 Subject: [PATCH 0649/1274] fix unstake --- pallets/app-promotion/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index f43d537cd6..6a4ed57612 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -209,17 +209,18 @@ pub mod pallet { // consumed_weight += T::DbWeight::get().reads_writes(reads, writes); // consumed_weight += weight; // }; - + + let current_relay_block = T::RelayBlockNumberProvider::current_block_number(); PendingUnstake::::iter() .filter_map(|((staker, block), amount)| { - if block <= current_block { + if block <= current_relay_block { Some((staker, block, amount)) } else { None } }) .for_each(|(staker, block, amount)| { - Self::unlock_balance_unchecked(&staker, amount); // TO-DO : Replace with a method that will check that the unstack is less than it was blocked, otherwise take the delta from the treasuries + Self::unlock_balance_unchecked(&staker, amount); >::remove((staker, block)); }); From 7a09794fa753b31c5ae33963fd8aa9793f6b703c Mon Sep 17 00:00:00 2001 From: Maksandre Date: Thu, 1 Sep 2022 10:54:40 +0500 Subject: [PATCH 0650/1274] Tests: add balance state asserts --- tests/src/app-promotion.test.ts | 32 +++++++++++++++++++++++----- tests/src/util/playgrounds/types.ts | 9 +++++++- tests/src/util/playgrounds/unique.ts | 12 ++++++++++- 3 files changed, 46 insertions(+), 7 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 9615ff5d48..0740ce598c 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -63,16 +63,21 @@ after(async function () { }); describe('app-promotions.stake extrinsic', () => { - it('should change balance state to "locked", add it to "staked" map, and increase "totalStaked" amount', async () => { + it('should "lock" some balance in system.account, add it to "staked" map, and increase "totalStaked" amount', async () => { await usingPlaygrounds(async (helper) => { const totalStakedBefore = await helper.staking.getTotalStaked(); - const [staker] = await helper.arrange.createAccounts([400n], alice); + const [staker, recepient] = await helper.arrange.createAccounts([400n, 0n], alice); // Minimum stake amount is 100: await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.eventually.rejected; await helper.staking.stake(staker, 100n * nominal); - expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(100n * nominal); + // Staker balance is: miscFrozen: 100, feeFrozen: 100, reserved: 0n, free less than 300... + // ...so he can not transfer 300 + expect (await helper.balance.getSubstrateFull(staker.address)).to.contain({miscFrozen: 100n * nominal, feeFrozen: 100n * nominal, reserved: 0n}); + await expect(helper.balance.transferToSubstrate(staker, recepient.address, 300n * nominal)).to.be.rejected; + + expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(100n * nominal); // TODO add helpers to assert bigints. Check balance close to 100 expect(await helper.balance.getSubstrate(staker.address) - 99n * nominal >= (nominal / 2n)).to.be.true; expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(100n * nominal); @@ -121,17 +126,27 @@ describe('unstake balance extrinsic', () => { it('should change balance state to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => { await usingPlaygrounds(async helper => { const totalStakedBefore = await helper.staking.getTotalStaked(); - const [staker] = await helper.arrange.createAccounts([1000n], alice); + const [staker, recepient] = await helper.arrange.createAccounts([600n, 0n], alice); await helper.staking.stake(staker, 500n * nominal); await helper.staking.unstake(staker); + // Stakers balance now: {free: <100n, reserved: 500n, miscFrozen: 0, feeFrozen: 0}; + // Staker can not transfer + // TODO expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 500n * nominal, miscFrozen: 0n, feeFrozen: 0n}); + await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejected; + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(500n * nominal); expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore); + + // Wait for unstaking period. Balance now free ~600, and reserved, frozen, miscFrozeb 0n + await waitForRelayBlock(helper.api!, 20); + expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n * nominal, miscFrozen: 0n, feeFrozen: 0n}); + expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(599n); }); }); - it('should remove multiple stakes', async () => { + it('should successfully unstake multiple stakes', async () => { await usingPlaygrounds(async helper => { const [staker] = await helper.arrange.createAccounts([1000n], alice); await helper.staking.stake(staker, 100n * nominal); @@ -154,6 +169,11 @@ describe('unstake balance extrinsic', () => { expect(pendingUnstake).to.be.equal(600n * nominal); expect(stakedPerBlock).to.be.deep.equal([]); expect(unstakedPerBlock).to.be.deep.equal([600n * nominal]); + + expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 600n * nominal, miscFrozen: 600n * nominal}); + await waitForRelayBlock(helper.api!, 20); + expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 0n, miscFrozen: 0n}); + expect (await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); }); }); @@ -200,6 +220,8 @@ describe('unstake balance extrinsic', () => { const [staker] = await helper.arrange.createAccounts([1000n], alice); await helper.staking.stake(staker, 100n * nominal); await helper.staking.unstake(staker); + await waitForRelayBlock(helper.api!, 20); + // expect balance unlocked expect.fail('Not implemented'); }); }); diff --git a/tests/src/util/playgrounds/types.ts b/tests/src/util/playgrounds/types.ts index d6633d1f58..de8fab3069 100644 --- a/tests/src/util/playgrounds/types.ts +++ b/tests/src/util/playgrounds/types.ts @@ -123,8 +123,15 @@ export interface IChainProperties { tokenSymbol: string[] } +export interface ISubstrateBalance { + free: bigint, + reserved: bigint, + miscFrozen: bigint, + feeFrozen: bigint +} + export type TSubstrateAccount = string; export type TEthereumAccount = string; export type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated'; export type TUniqueNetworks = 'opal' | 'quartz' | 'unique'; -export type TSigner = IKeyringPair; // | 'string' \ No newline at end of file +export type TSigner = IKeyringPair; // | 'string' diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index b8cabf9cc0..40fa1b07f3 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -9,7 +9,7 @@ import {ApiPromise, WsProvider, Keyring} from '@polkadot/api'; import {ApiInterfaceEvents} from '@polkadot/api/types'; import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; -import {IApiListeners, IChainEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; +import {IApiListeners, IChainEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => { const address = {} as ICrossAccountId; @@ -1893,6 +1893,16 @@ class BalanceGroup extends HelperGroup { return (await this.helper.callRpc('api.query.system.account', [address])).data.free.toBigInt(); } + /** + * Get full substrate balance including free, miscFrozen, feeFrozen, and reserved + * @param address substrate address + * @returns + */ + async getSubstrateFull(address: TSubstrateAccount): Promise { + const accountInfo = (await this.helper.callRpc('api.query.system.account', [address])).data; + return {free: accountInfo.free.toBigInt(), miscFrozen: accountInfo.miscFrozen.toBigInt(), feeFrozen: accountInfo.feeFrozen.toBigInt(), reserved: accountInfo.reserved.toBigInt()}; + } + /** * Get ethereum address balance * @param address ethereum address From 2904753764fcb9eb31c9aa3512dec0bb81e3426e Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 1 Sep 2022 15:59:04 +0700 Subject: [PATCH 0651/1274] add workflows for build xcm stack and run xcm tests --- .docker/Dockerfile-testnet.j2 | 96 +++++++++ .docker/Dockerfile-xcm.j2 | 85 ++++++++ .docker/docker-compose.tmp-xcm-tests.j2 | 23 ++ .../testnet-config/launch-config-testnet.json | 121 +++++++++++ .docker/xcm-config/5validators.jsonnet | 50 +++++ .../xcm-config/launch-config-xcm-opal.json | 134 ++++++++++++ .../xcm-config/launch-config-xcm-quartz.json | 199 ++++++++++++++++++ .../xcm-config/launch-config-xcm-unique.json | 194 +++++++++++++++++ .docker/xcm-config/minBondFix.jsonnet | 10 + .env | 6 + .github/workflows/xcm-testnet-build.yml | 157 ++++++++++++++ .github/workflows/xcm-tests.yml | 188 +++++++++++++++++ 12 files changed, 1263 insertions(+) create mode 100644 .docker/Dockerfile-testnet.j2 create mode 100644 .docker/Dockerfile-xcm.j2 create mode 100644 .docker/docker-compose.tmp-xcm-tests.j2 create mode 100644 .docker/testnet-config/launch-config-testnet.json create mode 100644 .docker/xcm-config/5validators.jsonnet create mode 100644 .docker/xcm-config/launch-config-xcm-opal.json create mode 100644 .docker/xcm-config/launch-config-xcm-quartz.json create mode 100644 .docker/xcm-config/launch-config-xcm-unique.json create mode 100644 .docker/xcm-config/minBondFix.jsonnet create mode 100644 .github/workflows/xcm-testnet-build.yml create mode 100644 .github/workflows/xcm-tests.yml diff --git a/.docker/Dockerfile-testnet.j2 b/.docker/Dockerfile-testnet.j2 new file mode 100644 index 0000000000..83407229a9 --- /dev/null +++ b/.docker/Dockerfile-testnet.j2 @@ -0,0 +1,96 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +#ARG RUST_TOOLCHAIN= + +#ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install {{ RUST_TOOLCHAIN }} && \ + rustup default {{ RUST_TOOLCHAIN }} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + + +# ===== BUILD ====== +FROM rust-builder as builder-unique + +ARG PROFILE=release +#ARG FEATURE= +#ARG BRANCH= + + +WORKDIR /unique_parachain + +RUN git clone -b {{ BRANCH }} https://github.com/UniqueNetwork/unique-chain.git && \ + cd unique-chain && \ + cargo build --features={{ FEATURE }} --$PROFILE + +# ===== BUILD POLKADOT ===== +FROM rust-builder as builder-polkadot + +#ARG POLKADOT_BUILD_BRANCH= +#ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH + + +WORKDIR /unique_parachain + +RUN git clone -b {{ POLKADOT_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/polkadot.git && \ + cd polkadot && \ + cargo build --release + +# ===== RUN ====== + +FROM ubuntu:20.04 + +#ARG POLKADOT_LAUNCH_BRANCH= +#ENV POLKADOT_LAUNCH_BRANCH $POLKADOT_LAUNCH_BRANCH + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b {{ POLKADOT_LAUNCH_BRANCH }} + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn install + +COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ + +EXPOSE 9844 +EXPOSE 9944 +EXPOSE 9933 +EXPOSE 9833 +EXPOSE 40333 +EXPOSE 30333 + +CMD export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start launch-config.json + + diff --git a/.docker/Dockerfile-xcm.j2 b/.docker/Dockerfile-xcm.j2 new file mode 100644 index 0000000000..a2e3703958 --- /dev/null +++ b/.docker/Dockerfile-xcm.j2 @@ -0,0 +1,85 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install {{ RUST_TOOLCHAIN }} && \ + rustup default {{ RUST_TOOLCHAIN }} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD ====== +FROM rust-builder as builder-unique + +ARG PROFILE=release + +WORKDIR /unique_parachain + +COPY ./xcm-config/launch-config-xcm-{{ NETWORK }}.json ./launch-config-xcm-{{ NETWORK }}.json +COPY ./xcm-config/5validators.jsonnet ./5validators.jsonnet +COPY ./xcm-config/minBondFix.jsonnet ./minBondFix.jsonnet + +RUN git clone -b {{ BRANCH }} https://github.com/UniqueNetwork/unique-chain.git && \ + cd unique-chain && \ + cargo build --features={{ FEATURE }} --$PROFILE + +# ===== RUN ====== + +FROM ubuntu:20.04 + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b {{ POLKADOT_LAUNCH_BRANCH }} + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn install + +COPY --from=builder-unique /unique_parachain/launch-config-xcm-{{ NETWORK }}.json /polkadot-launch/ +COPY --from=builder-unique /unique_parachain/5validators.jsonnet /polkadot-launch/5validators.jsonnet +COPY --from=builder-unique /unique_parachain/minBondFix.jsonnet /polkadot-launch/minBondFix.jsonnet + +COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ + +COPY --from=uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=uniquenetwork/builder-moonbeam:{{ MOONBEAM_BUILD_BRANCH }} /unique_parachain/moonbeam/target/release/moonbeam /moonbeam/target/release/ +COPY --from=uniquenetwork/builder-cumulus:{{ CUMULUS_BUILD_BRANCH }} /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus +COPY --from=uniquenetwork/builder-acala:{{ ACALA_BUILD_BRANCH }} /unique_parachain/Acala/target/production/acala /acala/target/release/ +COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/ + +EXPOSE 9844 +EXPOSE 9944 +EXPOSE 9946 +EXPOSE 9947 +EXPOSE 9948 + +CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start launch-config-xcm-{{ NETWORK }}.json + + diff --git a/.docker/docker-compose.tmp-xcm-tests.j2 b/.docker/docker-compose.tmp-xcm-tests.j2 new file mode 100644 index 0000000000..ede212ea9e --- /dev/null +++ b/.docker/docker-compose.tmp-xcm-tests.j2 @@ -0,0 +1,23 @@ +version: "3.5" + +services: + xcm_nodes: + image: uniquenetwork/xcm-{{ NETWORK }}-testnet-local:latest + container_name: xcm-{{ NETWORK }}-testnet-local + expose: + - 9844 + - 9944 + - 9946 + - 9947 + - 9948 + ports: + - 127.0.0.1:9844:9844 + - 127.0.0.1:9944:9944 + - 127.0.0.1:9946:9946 + - 127.0.0.1:9947:9947 + - 127.0.0.1:9948:9948 + logging: + options: + max-size: "1m" + max-file: "3" + diff --git a/.docker/testnet-config/launch-config-testnet.json b/.docker/testnet-config/launch-config-testnet.json new file mode 100644 index 0000000000..65a83f6620 --- /dev/null +++ b/.docker/testnet-config/launch-config-testnet.json @@ -0,0 +1,121 @@ +{ + "relaychain": { + "bin": "../polkadot/target/release/polkadot", + "chain": "rococo-local", + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "../unique-chain/target/release/unique-collator", + "id": "1000", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace" + ] + }, + { + "port": 31201, + "wsPort": 9945, + "rpcPort": 9934, + "name": "bob", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [], + "finalization": false +} diff --git a/.docker/xcm-config/5validators.jsonnet b/.docker/xcm-config/5validators.jsonnet new file mode 100644 index 0000000000..582cc9d3c5 --- /dev/null +++ b/.docker/xcm-config/5validators.jsonnet @@ -0,0 +1,50 @@ + +function(spec) + spec { + genesis+: { + runtime+: { + staking+: { + validatorCount: 5, + invulnerables: [ + '5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY', + '5HpG9w8EBLe5XCrbczpwq5TSXvedjrBGCwqxK1iQ7qUsSWFc', + '5Ck5SLSHYac6WFt5UZRSsdJjwmpSZq85fd5TRNAdZQVzEAPT', + '5HKPmK9GYtE1PSLsS1qiYU9xQ9Si1NcEhdeCq9sw5bqu4ns8', + '5FCfAonRZgTFrTd9HREEyeJjDpT397KMzizE6T3DvebLFE7n', + ], + stakers: [ + [ + '5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY', + '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY', + 100000000000000, + 'Validator', + ], + [ + '5HpG9w8EBLe5XCrbczpwq5TSXvedjrBGCwqxK1iQ7qUsSWFc', + '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty', + 100000000000000, + 'Validator', + ], + [ + '5Ck5SLSHYac6WFt5UZRSsdJjwmpSZq85fd5TRNAdZQVzEAPT', + '5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y', + 100000000000000, + 'Validator', + ], + [ + '5HKPmK9GYtE1PSLsS1qiYU9xQ9Si1NcEhdeCq9sw5bqu4ns8', + '5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy', + 100000000000000, + 'Validator', + ], + [ + '5FCfAonRZgTFrTd9HREEyeJjDpT397KMzizE6T3DvebLFE7n', + '5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw', + 100000000000000, + 'Validator', + ], + ], + }, + }, + }, + } diff --git a/.docker/xcm-config/launch-config-xcm-opal.json b/.docker/xcm-config/launch-config-xcm-opal.json new file mode 100644 index 0000000000..b74af89925 --- /dev/null +++ b/.docker/xcm-config/launch-config-xcm-opal.json @@ -0,0 +1,134 @@ +{ + "relaychain": { + "bin": "/polkadot/target/release/polkadot", + "chain": "westend-local", + "chainInitializer": [ + "chainql", + "--tla-code=spec=import '${spec}'", + "5validators.jsonnet" + ], + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + } + + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "/unique-chain/target/release/unique-collator", + "id": "2095", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + }, + { + "bin": "/cumulus/target/release/cumulus", + "id": "1000", + "chain": "westmint-local", + "balance": "1000000000000000000000000", + "nodes": [ + { + "wsPort": 9948, + "port": 31204, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [ + { + "sender": 2095, + "recipient": 1000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 1000, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + } + ], + "finalization": false +} + diff --git a/.docker/xcm-config/launch-config-xcm-quartz.json b/.docker/xcm-config/launch-config-xcm-quartz.json new file mode 100644 index 0000000000..b26f10c456 --- /dev/null +++ b/.docker/xcm-config/launch-config-xcm-quartz.json @@ -0,0 +1,199 @@ +{ + "relaychain": { + "bin": "/polkadot/target/release/polkadot", + "chain": "westend-local", + "chainInitializer": [ + "chainql", + "--tla-code=spec=import '${spec}'", + "5validators.jsonnet" + ], + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + } + + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "/unique-chain/target/release/unique-collator", + "id": "2095", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + }, + { + "bin": "/acala/target/release/acala", + "id": "2000", + "chain": "karura-dev", + "balance": "1000000000000000000000", + "nodes": [ + { + "wsPort": 9946, + "port": 31202, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + }, + { + "bin": "/moonbeam/target/release/moonbeam", + "id": 2023, + "balance": "1000000000000000000000", + "chain": "moonriver-local", + "chainInitializer": [ + "chainql", + "--tla-code=spec=import '${spec}'", + "minBondFix.jsonnet" + ], + "nodes": [ + { + "wsPort": 9947, + "port": 31203, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "--", + "--execution=wasm" + ] + } + ] + }, + { + "bin": "/cumulus/target/release/cumulus", + "id": "1000", + "chain": "statemine-local", + "balance": "1000000000000000000000000", + "nodes": [ + { + "wsPort": 9948, + "port": 31204, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [ + { + "sender": 2095, + "recipient": 2000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2000, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2095, + "recipient": 2023, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2023, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2095, + "recipient": 1000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 1000, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + } + ], + "finalization": false +} + diff --git a/.docker/xcm-config/launch-config-xcm-unique.json b/.docker/xcm-config/launch-config-xcm-unique.json new file mode 100644 index 0000000000..fcc465a031 --- /dev/null +++ b/.docker/xcm-config/launch-config-xcm-unique.json @@ -0,0 +1,194 @@ +{ + "relaychain": { + "bin": "/polkadot/target/release/polkadot", + "chain": "westend-local", + "chainInitializer": [ + "chainql", + "--tla-code=spec=import '${spec}'", + "5validators.jsonnet" + ], + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + } + + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "/unique-chain/target/release/unique-collator", + "id": "2037", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + }, + { + "bin": "/acala/target/release/acala", + "id": "2000", + "chain": "acala-dev", + "balance": "1000000000000000000000", + "nodes": [ + { + "wsPort": 9946, + "port": 31202, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + }, + { + "bin": "/moonbeam/target/release/moonbeam", + "id": "2004", + "balance": "1000000000000000000000", + "chain": "moonbeam-local", + "nodes": [ + { + "wsPort": 9947, + "port": 31203, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "--", + "--execution=wasm" + ] + } + ] + }, + { + "bin": "/cumulus/target/release/cumulus", + "id": "1000", + "chain": "statemint-local", + "balance": "1000000000000000000000000", + "nodes": [ + { + "wsPort": 9948, + "port": 31204, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [ + { + "sender": 2037, + "recipient": 2000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2000, + "recipient": 2037, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2037, + "recipient": 2004, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2004, + "recipient": 2037, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2037, + "recipient": 1000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 1000, + "recipient": 2037, + "maxCapacity": 8, + "maxMessageSize": 512 + } + ], + "finalization": false +} + diff --git a/.docker/xcm-config/minBondFix.jsonnet b/.docker/xcm-config/minBondFix.jsonnet new file mode 100644 index 0000000000..ed2ba50f3e --- /dev/null +++ b/.docker/xcm-config/minBondFix.jsonnet @@ -0,0 +1,10 @@ +function(spec) +spec { + genesis+: { + runtime+: { + parachainStaking+: { + candidates: std.map(function(candidate) [candidate[0], candidate[1] * 1000], super.candidates) + }, + }, + }, +} diff --git a/.env b/.env index bdc9a7019a..612d31aa0a 100644 --- a/.env +++ b/.env @@ -12,3 +12,9 @@ UNQWND_MAINNET_BRANCH=release-v0.9.24 OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443 QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443 + +POLKADOT_LAUNCH_BRANCH=feature/rewrite-chain-id-in-spec + +ACALA_BUILD_BRANCH=2.9.0 +MOONBEAM_BUILD_BRANCH=v0.25.0 +CUMULUS_BUILD_BRANCH=release-v0.9.230 diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml new file mode 100644 index 0000000000..2d08ddd151 --- /dev/null +++ b/.github/workflows/xcm-testnet-build.yml @@ -0,0 +1,157 @@ +name: xcm-testnet-build + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: + - master + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + - ready_for_review + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +#Define Workflow variables +env: + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + prepare-execution-marix: + + name: Prepare execution matrix + + runs-on: XL + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: fabiocaccamo/create-matrix-action@v2 + id: create_matrix + with: + matrix: | + network {opal}, runtime {opal}, features {opal-runtime} + network {quartz}, runtime {quartz}, features {quartz-runtime} + network {unique}, runtime {unique}, features {unique-runtime} + + xcm-build: + needs: prepare-execution-marix + # The type of runner that the job will run on + runs-on: [XL] + + timeout-minutes: 600 + + name: ${{ matrix.network }} + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + + + steps: + - name: Skip if pull request is in Draft + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend Dockerfile file + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-xcm.j2 + output_file: .docker/Dockerfile-xcm.${{ matrix.network }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + NETWORK=${{ matrix.network }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + BRANCH=${{ github.head_ref }} + ACALA_BUILD_BRANCH=${{ env.ACALA_BUILD_BRANCH }} + MOONBEAM_BUILD_BRANCH=${{ env.MOONBEAM_BUILD_BRANCH }} + CUMULUS_BUILD_BRANCH=${{ env.CUMULUS_BUILD_BRANCH }} + + - name: Show build Dockerfile + run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml + + - name: Show launch-config-xcm-${{ matrix.network }} configuration + run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json + + - name: Run find-and-replace to remove slashes from branch name + uses: mad9000/actions-find-and-replace-string@2 + id: branchname + with: + source: ${{ github.head_ref }} + find: '/' + replace: '-' + + - name: Log in to Docker Hub + uses: docker/login-action@v2.0.0 + with: + username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + + - name: Pull acala docker image + run: docker pull uniquenetwork/builder-acala:${{ env.ACALA_BUILD_BRANCH }} + + - name: Pull moonbeam docker image + run: docker pull uniquenetwork/builder-moonbeam:${{ env.MOONBEAM_BUILD_BRANCH }} + + - name: Pull cumulus docker image + run: docker pull uniquenetwork/builder-cumulus:${{ env.CUMULUS_BUILD_BRANCH }} + + - name: Pull polkadot docker image + run: docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} + + - name: Pull chainql docker image + run: docker pull uniquenetwork/builder-chainql:latest + + - name: Build the stack + run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . + + - name: Push docker version image + run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} + + - name: Push docker image latest + run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f + docker system prune -f + diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml new file mode 100644 index 0000000000..395dcb5f9d --- /dev/null +++ b/.github/workflows/xcm-tests.yml @@ -0,0 +1,188 @@ +name: xcm-tests + +# Controls when the action will run. +on: + # Triggers the workflow after xcm-testnet-build + workflow_run: + workflows: ["xcm-testnet-build"] + types: [requested] + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: + - master + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + - ready_for_review + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +#Define Workflow variables +env: + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + prepare-execution-marix: + + name: Prepare execution matrix + + runs-on: XL + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: fabiocaccamo/create-matrix-action@v2 + id: create_matrix + with: + matrix: | + network {opal}, runtime {opal}, features {opal-runtime}, runtest {testXcmOpal} + network {quartz}, runtime {quartz}, features {quartz-runtime}, runtest {testXcmQuartz} + network {unique}, runtime {unique}, features {unique-runtime}, runtest {testXcmUnique} + + xcm-tests: + needs: prepare-execution-marix + # The type of runner that the job will run on + runs-on: [XL] + + timeout-minutes: 600 + + name: ${{ matrix.network }} + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + + + steps: + - name: Skip if pull request is in Draft + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-xcm-tests.j2 + output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml + variables: | + NETWORK=${{ matrix.network }} + + - name: Show build configuration + run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300 + + # 🚀 POLKADOT LAUNCH COMPLETE 🚀 + - name: Check if docker logs consist messages related to testing of xcm tests + if: success() + run: | + counter=160 + function check_container_status { + docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local + } + function do_docker_logs { + docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1 + } + function is_started { + if [ "$(check_container_status)" == "true" ]; then + echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING"; + echo "Check Docker logs" + DOCKER_LOGS=$(do_docker_logs) + if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then + echo "🚀 POLKADOT LAUNCH COMPLETE 🚀" + return 0 + else + echo "Message not found in logs output, repeating..." + return 1 + fi + else + echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING" + echo "Halting all future checks" + exit 1 + fi + echo "something goes wrong" + exit 1 + } + while ! is_started; do + echo "Waiting for special message in log files " + sleep 30s + counter=$(( $counter - 1 )) + echo "Counter: $counter" + if [ "$counter" -gt "0" ]; then + continue + else + break + fi + done + echo "Halting script" + exit 0 + shell: bash + + - name: Run XCM tests + working-directory: tests + run: | + yarn install + yarn add mochawesome + echo "Ready to start tests" + NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW} + + - name: XCM Test Report + uses: phoenix-actions/test-reporting@v8 + id: test-report + if: success() || failure() # run this step even if previous step failed + with: + name: XCM Tests ${{ matrix.network }} # Name of the check run which will be created + path: tests/mochawesome-report/test-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down + + - name: Remove builder cache + if: always() # run this step always + run: | + docker system prune -a -f + + - name: Clean Workspace + if: always() + uses: AutoModality/action-clean@v1.1.0 From a25acd93d97d8f2bbcd85ff0f7a4079a658385f9 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 1 Sep 2022 16:28:35 +0700 Subject: [PATCH 0652/1274] delete old xcm-testnet workflow --- .github/workflows/xcm-testnet.yml | 141 ------------------------------ 1 file changed, 141 deletions(-) delete mode 100644 .github/workflows/xcm-testnet.yml diff --git a/.github/workflows/xcm-testnet.yml b/.github/workflows/xcm-testnet.yml deleted file mode 100644 index 9e3fdf8e4b..0000000000 --- a/.github/workflows/xcm-testnet.yml +++ /dev/null @@ -1,141 +0,0 @@ -name: xcm testnet - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -#Define Workflow variables -env: - REPO_URL: ${{ github.server_url }}/${{ github.repository }} - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - prepare-execution-marix: - - name: Prepare execution matrix - - runs-on: XL2 - outputs: - matrix: ${{ steps.create_matrix.outputs.matrix }} - - steps: - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Create Execution matrix - uses: fabiocaccamo/create-matrix-action@v2 - id: create_matrix - with: - matrix: | - network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} - network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} - network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} - - xcm-build: - needs: prepare-execution-marix - # The type of runner that the job will run on - runs-on: [XL2] - - timeout-minutes: 600 - - name: ${{ matrix.network }} - - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - - strategy: - matrix: - include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} - - - steps: - #- name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - # if: github.event.pull_request.draft == true - #run: exit 1 - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Generate ENV related extend Dockerfile file - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/Dockerfile-xcm.j2 - output_file: .docker/Dockerfile-xcm.${{ matrix.network }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - NETWORK=${{ matrix.network }} - POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} - POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} - FEATURE=${{ matrix.features }} - RUNTIME=${{ matrix.runtime }} - BRANCH=${{ github.head_ref }} - ACALA_BUILD_BRANCH=${{ env.ACALA_BUILD_BRANCH }} - MOONBEAM_BUILD_BRANCH=${{ env.MOONBEAM_BUILD_BRANCH }} - CUMULUS_BUILD_BRANCH=${{ env.CUMULUS_BUILD_BRANCH }} - - - name: Show build Dockerfile - run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml - - - name: Show launch-config-xcm-${{ matrix.network }} configuration - run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json - - - name: Build the stack - run: cd .docker/ && docker build --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag xcm-nodes-${{ matrix.network }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . - - - name: Log in to Docker Hub - uses: docker/login-action@v2.0.0 - with: - username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} - password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - - name: Push docker version image - run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ github.sha }} - - - name: Push docker image latest - run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest From 74b5e68278b9c99d07f9530abc7a6a37b8c48ae2 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 1 Sep 2022 16:35:58 +0700 Subject: [PATCH 0653/1274] enable draft for xcm tests --- .github/workflows/xcm-testnet-build.yml | 6 +++--- .github/workflows/xcm-tests.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 2d08ddd151..06be6b510e 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -73,9 +73,9 @@ jobs: steps: - - name: Skip if pull request is in Draft - if: github.event.pull_request.draft == true - run: exit 1 + #- name: Skip if pull request is in Draft + # if: github.event.pull_request.draft == true + # run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index 395dcb5f9d..baa747406d 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -77,9 +77,9 @@ jobs: steps: - - name: Skip if pull request is in Draft - if: github.event.pull_request.draft == true - run: exit 1 + # - name: Skip if pull request is in Draft + # if: github.event.pull_request.draft == true + # run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 From 0d4880c6617e9ff4742773d829c62ccb7c727191 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 1 Sep 2022 16:52:23 +0700 Subject: [PATCH 0654/1274] enable draft for xcm tests --- .github/workflows/xcm-testnet-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 06be6b510e..e0b13f27ad 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -155,3 +155,5 @@ jobs: docker builder prune -f docker system prune -f + + From 890dd1cced3ee3c384237b7f9ade80f6255ccca7 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 1 Sep 2022 16:55:56 +0700 Subject: [PATCH 0655/1274] enable draft for xcm tests --- .github/workflows/xcm-testnet-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index e0b13f27ad..7a698c69fc 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -57,6 +57,7 @@ jobs: network {unique}, runtime {unique}, features {unique-runtime} xcm-build: + needs: prepare-execution-marix # The type of runner that the job will run on runs-on: [XL] From f9d5b88c2faf15f26a44f73a5ece0b197dc5dd5b Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 1 Sep 2022 16:57:32 +0700 Subject: [PATCH 0656/1274] enable draft for xcm tests --- .github/workflows/xcm-testnet-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 7a698c69fc..5173b8e4a4 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -74,9 +74,9 @@ jobs: steps: - #- name: Skip if pull request is in Draft - # if: github.event.pull_request.draft == true - # run: exit 1 + - name: Skip if pull request is in Draft + if: github.event.pull_request.draft == true + run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 From 4a2f5e7dc343208cd095f19c190de0ac64b290da Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 1 Sep 2022 16:58:34 +0700 Subject: [PATCH 0657/1274] enable draft for xcm tests --- .github/workflows/xcm-testnet-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 5173b8e4a4..14e2710391 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -56,7 +56,7 @@ jobs: network {quartz}, runtime {quartz}, features {quartz-runtime} network {unique}, runtime {unique}, features {unique-runtime} - xcm-build: + xcm_build: needs: prepare-execution-marix # The type of runner that the job will run on From 78b3d2042361ccc5f9db1729a643fd061b6c4bf1 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 1 Sep 2022 17:00:03 +0700 Subject: [PATCH 0658/1274] enable draft for xcm tests --- .github/workflows/xcm-testnet-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 14e2710391..2821aab1b9 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -56,7 +56,7 @@ jobs: network {quartz}, runtime {quartz}, features {quartz-runtime} network {unique}, runtime {unique}, features {unique-runtime} - xcm_build: + xcm-build: needs: prepare-execution-marix # The type of runner that the job will run on @@ -112,7 +112,7 @@ jobs: - name: Show launch-config-xcm-${{ matrix.network }} configuration run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json - - name: Run find-and-replace to remove slashes from branch name + - name: Run find-and-replace to remove slashes from branch name uses: mad9000/actions-find-and-replace-string@2 id: branchname with: From ab27f3dd7a37fc1fc620c9ddfcce46903abdfdf6 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 1 Sep 2022 17:07:18 +0700 Subject: [PATCH 0659/1274] enable draft for xcm tests --- .github/workflows/xcm-testnet-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 2821aab1b9..85e976a85d 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -74,9 +74,9 @@ jobs: steps: - - name: Skip if pull request is in Draft - if: github.event.pull_request.draft == true - run: exit 1 + #- name: Skip if pull request is in Draft + # if: github.event.pull_request.draft == true + # run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 From 8410d7e204a8990006b17d78b12905910f58a68e Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 1 Sep 2022 17:08:43 +0700 Subject: [PATCH 0660/1274] enable draft for xcm tests --- .github/workflows/xcm-tests.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index baa747406d..581b0f2d41 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -7,14 +7,14 @@ on: workflows: ["xcm-testnet-build"] types: [requested] # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review + # pull_request: + # branches: + # - master + # types: + # - opened + # - reopened + # - synchronize #commit(s) pushed to the pull request + # - ready_for_review # Allows you to run this workflow manually from the Actions tab workflow_dispatch: From defcf03b8d417adb8d527b09f825169cfacef22b Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 1 Sep 2022 11:10:03 +0000 Subject: [PATCH 0661/1274] chore: regenerate test types --- tests/src/interfaces/augment-api-consts.ts | 10 +- tests/src/interfaces/augment-api-errors.ts | 22 +- tests/src/interfaces/augment-api-events.ts | 10 +- tests/src/interfaces/augment-api-query.ts | 69 ++- tests/src/interfaces/augment-api-rpc.ts | 28 +- tests/src/interfaces/augment-api-tx.ts | 47 +- tests/src/interfaces/augment-api.ts | 1 + tests/src/interfaces/augment-types.ts | 97 +++- tests/src/interfaces/default/types.ts | 24 +- tests/src/interfaces/lookup.ts | 48 +- tests/src/interfaces/registry.ts | 11 +- tests/src/interfaces/types-lookup.ts | 578 +++++++++++---------- 12 files changed, 588 insertions(+), 357 deletions(-) diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index a7b08ef06b..a005e0d69e 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -1,14 +1,20 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { ApiTypes } from '@polkadot/api-base/types'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/api-base/types/consts'; + +import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types'; import type { Option, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { Codec } from '@polkadot/types-codec/types'; import type { Permill } from '@polkadot/types/interfaces/runtime'; import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion, XcmV1MultiLocation } from '@polkadot/types/lookup'; +export type __AugmentedConst = AugmentedConst; + declare module '@polkadot/api-base/types/consts' { - export interface AugmentedConsts { + interface AugmentedConsts { balances: { /** * The minimum amount required to keep an account open. diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 0c06580ff8..7380d0aa4f 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -1,10 +1,16 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { ApiTypes } from '@polkadot/api-base/types'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/api-base/types/errors'; + +import type { ApiTypes, AugmentedError } from '@polkadot/api-base/types'; + +export type __AugmentedError = AugmentedError; declare module '@polkadot/api-base/types/errors' { - export interface AugmentedErrors { + interface AugmentedErrors { balances: { /** * Beneficiary account must pre-exist @@ -259,7 +265,11 @@ declare module '@polkadot/api-base/types/errors' { }; evmContractHelpers: { /** - * This method is only executable by owner + * No pending sponsor for contract. + **/ + NoPendingSponsor: AugmentedError; + /** + * This method is only executable by contract owner **/ NoPermission: AugmentedError; /** @@ -268,7 +278,13 @@ declare module '@polkadot/api-base/types/errors' { [key: string]: AugmentedError; }; evmMigration: { + /** + * Migration of this account is not yet started, or already finished. + **/ AccountIsNotMigrating: AugmentedError; + /** + * Can only migrate to empty address. + **/ AccountNotEmpty: AugmentedError; /** * Generic error diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index fdd82c93f1..b5ab5d9a07 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -1,14 +1,20 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { ApiTypes } from '@polkadot/api-base/types'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/api-base/types/events'; + +import type { ApiTypes, AugmentedEvent } from '@polkadot/api-base/types'; import type { Bytes, Null, Option, Result, U256, U8aFixed, bool, u128, u32, u64, u8 } from '@polkadot/types-codec'; import type { ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime'; import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetMultiAssets, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; +export type __AugmentedEvent = AugmentedEvent; + declare module '@polkadot/api-base/types/events' { - export interface AugmentedEvents { + interface AugmentedEvents { balances: { /** * A balance was set by root. diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index c03a606de1..dfebb7ecd8 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -1,15 +1,22 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { ApiTypes } from '@polkadot/api-base/types'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/api-base/types/storage'; + +import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types'; import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime'; -import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup'; import type { Observable } from '@polkadot/types/types'; +export type __AugmentedQuery = AugmentedQuery unknown>; +export type __QueryableStorageEntry = QueryableStorageEntry; + declare module '@polkadot/api-base/types/storage' { - export interface AugmentedQueries { + interface AugmentedQueries { balances: { /** * The Balances pallet example of storing the balance of an account. @@ -187,12 +194,66 @@ declare module '@polkadot/api-base/types/storage' { [key: string]: QueryableStorageEntry; }; evmContractHelpers: { + /** + * Storage for users that allowed for sponsorship. + * + * ### Usage + * Prefer to delete record from storage if user no more allowed for sponsorship. + * + * * **Key1** - contract address. + * * **Key2** - user that allowed for sponsorship. + * * **Value** - allowance for sponsorship. + **/ allowlist: AugmentedQuery Observable, [H160, H160]> & QueryableStorageEntry; + /** + * Storege for contracts with [`Allowlisted`](SponsoringModeT::Allowlisted) sponsoring mode. + * + * ### Usage + * Prefer to delete collection from storage if mode chaged to non `Allowlisted`, than set **Value** to **false**. + * + * * **Key** - contract address. + * * **Value** - is contract in [`Allowlisted`](SponsoringModeT::Allowlisted) mode. + **/ allowlistEnabled: AugmentedQuery Observable, [H160]> & QueryableStorageEntry; + /** + * Store owner for contract. + * + * * **Key** - contract address. + * * **Value** - owner for contract. + **/ owner: AugmentedQuery Observable, [H160]> & QueryableStorageEntry; selfSponsoring: AugmentedQuery Observable, [H160]> & QueryableStorageEntry; + /** + * Storage for last sponsored block. + * + * * **Key1** - contract address. + * * **Key2** - sponsored user address. + * * **Value** - last sponsored block number. + **/ sponsorBasket: AugmentedQuery Observable>, [H160, H160]> & QueryableStorageEntry; + /** + * Store for contract sponsorship state. + * + * * **Key** - contract address. + * * **Value** - sponsorship state. + **/ + sponsoring: AugmentedQuery Observable, [H160]> & QueryableStorageEntry; + /** + * Store for sponsoring mode. + * + * ### Usage + * Prefer to delete collection from storage if mode chaged to [`Disabled`](SponsoringModeT::Disabled). + * + * * **Key** - contract address. + * * **Value** - [`sponsoring mode`](SponsoringModeT). + **/ sponsoringMode: AugmentedQuery Observable>, [H160]> & QueryableStorageEntry; + /** + * Storage for sponsoring rate limit in blocks. + * + * * **Key** - contract address. + * * **Value** - amount of sponsored blocks. + **/ sponsoringRateLimit: AugmentedQuery Observable, [H160]> & QueryableStorageEntry; /** * Generic query @@ -313,7 +374,7 @@ declare module '@polkadot/api-base/types/storage' { * * Currently used to store RMRK data. **/ - tokenAuxProperties: AugmentedQuery Observable>, [u32, u32, UpDataStructsPropertyScope, Bytes]> & QueryableStorageEntry; + tokenAuxProperties: AugmentedQuery Observable>, [u32, u32, UpDataStructsPropertyScope, Bytes]> & QueryableStorageEntry; /** * Used to enumerate token's children. **/ diff --git a/tests/src/interfaces/augment-api-rpc.ts b/tests/src/interfaces/augment-api-rpc.ts index f462d50d15..7e220fca8e 100644 --- a/tests/src/interfaces/augment-api-rpc.ts +++ b/tests/src/interfaces/augment-api-rpc.ts @@ -1,10 +1,14 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/rpc-core/types/jsonrpc'; + import type { PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsPartPartType, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionStats, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsRpcCollection, UpDataStructsTokenChild, UpDataStructsTokenData } from './default'; import type { AugmentedRpc } from '@polkadot/rpc-core/types'; import type { Metadata, StorageKey } from '@polkadot/types'; -import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, u128, u32, u64 } from '@polkadot/types-codec'; +import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, f64, u128, u32, u64 } from '@polkadot/types-codec'; import type { AnyNumber, Codec } from '@polkadot/types-codec/types'; import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; import type { EpochAuthorship } from '@polkadot/types/interfaces/babe'; @@ -15,7 +19,7 @@ import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; import type { CodeUploadRequest, CodeUploadResult, ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts'; import type { BlockStats } from '@polkadot/types/interfaces/dev'; import type { CreatedBlock } from '@polkadot/types/interfaces/engine'; -import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth'; +import type { EthAccount, EthCallRequest, EthFeeHistory, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth'; import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics'; import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa'; import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr'; @@ -27,8 +31,10 @@ import type { MigrationStatusResult, ReadProof, RuntimeVersion, TraceBlockRespon import type { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system'; import type { IExtrinsic, Observable } from '@polkadot/types/types'; +export type __AugmentedRpc = AugmentedRpc<() => unknown>; + declare module '@polkadot/rpc-core/types/jsonrpc' { - export interface RpcInterface { + interface RpcInterface { author: { /** * Returns true if the keystore has private keys for the given public key and key type. @@ -57,11 +63,11 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Submit and subscribe to watch an extrinsic until unsubscribed **/ - submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable>; + submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable>; /** * Submit a fully formatted extrinsic for block inclusion **/ - submitExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable>; + submitExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable>; }; babe: { /** @@ -198,6 +204,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { * Estimate gas needed for execution of given contract. **/ estimateGas: AugmentedRpc<(request: EthCallRequest | { from?: any; to?: any; gasPrice?: any; gas?: any; value?: any; data?: any; nonce?: any } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable>; + /** + * Returns fee history for given block count & reward percentiles + **/ + feeHistory: AugmentedRpc<(blockCount: U256 | AnyNumber | Uint8Array, newestBlock: BlockNumber | AnyNumber | Uint8Array, rewardPercentiles: Option> | null | Uint8Array | Vec | (f64)[]) => Observable>; /** * Returns current gas price. **/ @@ -290,6 +300,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { * Returns the number of hashes per second that the node is mining with. **/ hashrate: AugmentedRpc<() => Observable>; + /** + * Returns max priority fee per gas + **/ + maxPriorityFeePerGas: AugmentedRpc<() => Observable>; /** * Returns true if client is actively mining new blocks. **/ @@ -449,7 +463,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Get Theme's keys values **/ - themes: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, themeName: Text | string, keys: Option> | null | object | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; + themes: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, themeName: Text | string, keys: Option> | null | Uint8Array | Vec | (Text | string)[], at?: Hash | string | Uint8Array) => Observable>>; }; rpc: { /** @@ -537,7 +551,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Provides a way to trace the re-execution of a single block **/ - traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option | null | object | string | Uint8Array, storageKeys: Option | null | object | string | Uint8Array, methods: Option | null | object | string | Uint8Array) => Observable>; + traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option | null | Uint8Array | Text | string, storageKeys: Option | null | Uint8Array | Text | string, methods: Option | null | Uint8Array | Text | string) => Observable>; /** * Check current migration state **/ diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index fd6371183d..d54c667633 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -1,14 +1,22 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { ApiTypes } from '@polkadot/api-base/types'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/api-base/types/submittable'; + +import type { ApiTypes, AugmentedSubmittable, SubmittableExtrinsic, SubmittableExtrinsicFunction } from '@polkadot/api-base/types'; import type { Bytes, Compact, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, FrameSupportScheduleMaybeHashed, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartEquippableList, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +export type __AugmentedSubmittable = AugmentedSubmittable<() => unknown>; +export type __SubmittableExtrinsic = SubmittableExtrinsic; +export type __SubmittableExtrinsicFunction = SubmittableExtrinsicFunction; + declare module '@polkadot/api-base/types/submittable' { - export interface AugmentedSubmittables { + interface AugmentedSubmittables { balances: { /** * Exactly as `transfer`, except the origin must be root and the source account may be @@ -105,8 +113,8 @@ declare module '@polkadot/api-base/types/submittable' { [key: string]: SubmittableExtrinsicFunction; }; configuration: { - setMinGasPriceOverride: AugmentedSubmittable<(coeff: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; - setWeightToFeeCoefficientOverride: AugmentedSubmittable<(coeff: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + setMinGasPriceOverride: AugmentedSubmittable<(coeff: Option | null | Uint8Array | u64 | AnyNumber) => SubmittableExtrinsic, [Option]>; + setWeightToFeeCoefficientOverride: AugmentedSubmittable<(coeff: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; /** * Generic tx **/ @@ -153,16 +161,16 @@ declare module '@polkadot/api-base/types/submittable' { /** * Issue an EVM call operation. This is similar to a message call transaction in Ethereum. **/ - call: AugmentedSubmittable<(source: H160 | string | Uint8Array, target: H160 | string | Uint8Array, input: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | object | string | Uint8Array, nonce: Option | null | object | string | Uint8Array, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, H160, Bytes, U256, u64, U256, Option, Option, Vec]>>]>; + call: AugmentedSubmittable<(source: H160 | string | Uint8Array, target: H160 | string | Uint8Array, input: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | Uint8Array | U256 | AnyNumber, nonce: Option | null | Uint8Array | U256 | AnyNumber, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, H160, Bytes, U256, u64, U256, Option, Option, Vec]>>]>; /** * Issue an EVM create operation. This is similar to a contract creation transaction in * Ethereum. **/ - create: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | object | string | Uint8Array, nonce: Option | null | object | string | Uint8Array, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, Bytes, U256, u64, U256, Option, Option, Vec]>>]>; + create: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | Uint8Array | U256 | AnyNumber, nonce: Option | null | Uint8Array | U256 | AnyNumber, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, Bytes, U256, u64, U256, Option, Option, Vec]>>]>; /** * Issue an EVM create2 operation. **/ - create2: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, salt: H256 | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | object | string | Uint8Array, nonce: Option | null | object | string | Uint8Array, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, Bytes, H256, U256, u64, U256, Option, Option, Vec]>>]>; + create2: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, salt: H256 | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option | null | Uint8Array | U256 | AnyNumber, nonce: Option | null | Uint8Array | U256 | AnyNumber, accessList: Vec]>> | ([H160 | string | Uint8Array, Vec | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic, [H160, Bytes, H256, U256, u64, U256, Option, Option, Vec]>>]>; /** * Withdraw balance from EVM into currency/balances pallet. **/ @@ -173,8 +181,21 @@ declare module '@polkadot/api-base/types/submittable' { [key: string]: SubmittableExtrinsicFunction; }; evmMigration: { + /** + * Start contract migration, inserts contract stub at target address, + * and marks account as pending, allowing to insert storage + **/ begin: AugmentedSubmittable<(address: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; + /** + * Finish contract migration, allows it to be called. + * It is not possible to alter contract storage via [`Self::set_data`] + * after this call. + **/ finish: AugmentedSubmittable<(address: H160 | string | Uint8Array, code: Bytes | string | Uint8Array) => SubmittableExtrinsic, [H160, Bytes]>; + /** + * Insert items into contract storage, this method can be called + * multiple times + **/ setData: AugmentedSubmittable<(address: H160 | string | Uint8Array, data: Vec> | ([H256 | string | Uint8Array, H256 | string | Uint8Array])[]) => SubmittableExtrinsic, [H160, Vec>]>; /** * Generic tx @@ -252,7 +273,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `origin`: Must be Root. * - `maybe_xcm_version`: The default XCM encoding version, or `None` to disable. **/ - forceDefaultXcmVersion: AugmentedSubmittable<(maybeXcmVersion: Option | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option]>; + forceDefaultXcmVersion: AugmentedSubmittable<(maybeXcmVersion: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; /** * Ask a location to notify us regarding their XCM version and any changes to it. * @@ -509,7 +530,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs. * Analogous to Unique's [`token_prefix`](up_data_structs::Collection). Cannot be changed. **/ - createCollection: AugmentedSubmittable<(metadata: Bytes | string | Uint8Array, max: Option | null | object | string | Uint8Array, symbol: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes, Option, Bytes]>; + createCollection: AugmentedSubmittable<(metadata: Bytes | string | Uint8Array, max: Option | null | Uint8Array | u32 | AnyNumber, symbol: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes, Option, Bytes]>; /** * Destroy a collection. * @@ -550,7 +571,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `transferable`: Can this NFT be transferred? Cannot be changed. * - `resources`: Resource data to be added to the NFT immediately after minting. **/ - mintNft: AugmentedSubmittable<(owner: Option | null | object | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, recipient: Option | null | object | string | Uint8Array, royaltyAmount: Option | null | object | string | Uint8Array, metadata: Bytes | string | Uint8Array, transferable: bool | boolean | Uint8Array, resources: Option> | null | object | string | Uint8Array) => SubmittableExtrinsic, [Option, u32, Option, Option, Bytes, bool, Option>]>; + mintNft: AugmentedSubmittable<(owner: Option | null | Uint8Array | AccountId32 | string, collectionId: u32 | AnyNumber | Uint8Array, recipient: Option | null | Uint8Array | AccountId32 | string, royaltyAmount: Option | null | Uint8Array | Permill | AnyNumber, metadata: Bytes | string | Uint8Array, transferable: bool | boolean | Uint8Array, resources: Option> | null | Uint8Array | Vec | (RmrkTraitsResourceResourceTypes | { Basic: any } | { Composable: any } | { Slot: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Option, u32, Option, Option, Bytes, bool, Option>]>; /** * Reject an NFT sent from another account to self or owned NFT. * The NFT in question will not be sent back and burnt instead. @@ -636,7 +657,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `key`: Key of the custom property to be referenced by. * - `value`: Value of the custom property to be stored. **/ - setProperty: AugmentedSubmittable<(rmrkCollectionId: Compact | AnyNumber | Uint8Array, maybeNftId: Option | null | object | string | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Option, Bytes, Bytes]>; + setProperty: AugmentedSubmittable<(rmrkCollectionId: Compact | AnyNumber | Uint8Array, maybeNftId: Option | null | Uint8Array | u32 | AnyNumber, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Option, Bytes, Bytes]>; /** * Generic tx **/ @@ -706,7 +727,7 @@ declare module '@polkadot/api-base/types/submittable' { /** * Schedule a named task. **/ - scheduleNamed: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + scheduleNamed: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Schedule a named task after a delay. * @@ -714,7 +735,7 @@ declare module '@polkadot/api-base/types/submittable' { * Same as [`schedule_named`](Self::schedule_named). * # **/ - scheduleNamedAfter: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + scheduleNamedAfter: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Generic tx **/ diff --git a/tests/src/interfaces/augment-api.ts b/tests/src/interfaces/augment-api.ts index 921d2f824d..7cafd228bd 100644 --- a/tests/src/interfaces/augment-api.ts +++ b/tests/src/interfaces/augment-api.ts @@ -7,3 +7,4 @@ import './augment-api-events'; import './augment-api-query'; import './augment-api-tx'; import './augment-api-rpc'; +import './augment-api-runtime'; diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index c4c017a2b1..5ea0a97ece 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -1,17 +1,23 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, PalletForeingAssetsModuleCall, PalletForeingAssetsModuleError, PalletForeingAssetsModuleEvent, PalletForeingAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/types/types/registry'; + +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, PalletForeingAssetsModuleCall, PalletForeingAssetsModuleError, PalletForeingAssetsModuleEvent, PalletForeingAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; -import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; +import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations'; import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura'; import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; -import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe'; +import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeGenesisConfiguration, BabeGenesisConfigurationV1, BabeWeight, Epoch, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, OpaqueKeyOwnershipProof, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe'; import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, ReserveData, ReserveIdentifier, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances'; -import type { BeefyCommitment, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefySignedCommitment, MmrRootHash, ValidatorSetId } from '@polkadot/types/interfaces/beefy'; +import type { BeefyAuthoritySet, BeefyCommitment, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefyPayloadId, BeefySignedCommitment, MmrRootHash, ValidatorSet, ValidatorSetId } from '@polkadot/types/interfaces/beefy'; +import type { BenchmarkBatch, BenchmarkConfig, BenchmarkList, BenchmarkMetadata, BenchmarkParameter, BenchmarkResult } from '@polkadot/types/interfaces/benchmark'; +import type { CheckInherentsResult, InherentData, InherentIdentifier } from '@polkadot/types/interfaces/blockbuilder'; import type { BridgeMessageId, BridgedBlockHash, BridgedBlockNumber, BridgedHeader, CallOrigin, ChainId, DeliveredMessages, DispatchFeePayment, InboundLaneData, InboundRelayer, InitializationData, LaneId, MessageData, MessageKey, MessageNonce, MessagesDeliveryProofOf, MessagesProofOf, OperatingMode, OutboundLaneData, OutboundMessageFee, OutboundPayload, Parameter, RelayerId, UnrewardedRelayer, UnrewardedRelayersState } from '@polkadot/types/interfaces/bridges'; import type { BlockHash } from '@polkadot/types/interfaces/chain'; import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; @@ -21,13 +27,13 @@ import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/conse import type { AliveContractInfo, CodeHash, CodeSource, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractInstantiateResultTo299, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateRequestV1, InstantiateRequestV2, InstantiateReturnValue, InstantiateReturnValueOk, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts'; import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, ContractConstructorSpecV1, ContractConstructorSpecV2, ContractConstructorSpecV3, ContractContractSpecV0, ContractContractSpecV1, ContractContractSpecV2, ContractContractSpecV3, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpecLatest, ContractEventParamSpecV0, ContractEventParamSpecV2, ContractEventSpecLatest, ContractEventSpecV0, ContractEventSpecV1, ContractEventSpecV2, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpecLatest, ContractMessageParamSpecV0, ContractMessageParamSpecV2, ContractMessageSpecLatest, ContractMessageSpecV0, ContractMessageSpecV1, ContractMessageSpecV2, ContractMetadata, ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1, ContractMetadataV2, ContractMetadataV3, ContractProject, ContractProjectContract, ContractProjectInfo, ContractProjectSource, ContractProjectV0, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi'; import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan'; -import type { ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus'; +import type { CollationInfo, CollationInfoV1, ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus'; import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy'; import type { BlockStats } from '@polkadot/types/interfaces/dev'; import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections'; import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine'; -import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth'; -import type { EvmAccount, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm'; +import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFeeHistory, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthReceiptV0, EthReceiptV3, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth'; +import type { EvmAccount, EvmCallInfo, EvmCreateInfo, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm'; import type { AnySignature, EcdsaSignature, Ed25519Signature, Era, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics'; import type { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset'; import type { ActiveGilt, ActiveGiltsTotal, ActiveIndex, GiltBid } from '@polkadot/types/interfaces/gilt'; @@ -35,35 +41,37 @@ import type { AuthorityIndex, AuthorityList, AuthoritySet, AuthoritySetChange, A import type { IdentityFields, IdentityInfo, IdentityInfoAdditional, IdentityInfoTo198, IdentityJudgement, RegistrarIndex, RegistrarInfo, Registration, RegistrationJudgement, RegistrationTo198 } from '@polkadot/types/interfaces/identity'; import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline'; import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery'; -import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; -import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr'; +import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, OpaqueMetadata, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; +import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafBatchProof, MmrLeafIndex, MmrLeafProof, MmrNodeIndex, MmrProof } from '@polkadot/types/interfaces/mmr'; +import type { NpApiError } from '@polkadot/types/interfaces/nompools'; import type { StorageKind } from '@polkadot/types/interfaces/offchain'; import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences'; -import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, Scheduling, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; +import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateEvent, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, CoreState, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, GroupRotationInfo, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OccupiedCore, OccupiedCoreAssumption, OldV1SessionInfo, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, PvfCheckStatement, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, ScheduledCore, Scheduling, ScrapedOnChainVotes, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; import type { FeeDetails, InclusionFee, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; import type { Approvals } from '@polkadot/types/interfaces/poll'; import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy'; import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase'; import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery'; import type { RpcMethods } from '@polkadot/types/interfaces/rpc'; -import type { AccountId, AccountId20, AccountId32, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, StorageData, StorageProof, TransactionInfo, TransactionPriority, TransactionStorageProof, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; +import type { AccountId, AccountId20, AccountId32, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, SlotDuration, StorageData, StorageInfo, StorageProof, TransactionInfo, TransactionLongevity, TransactionPriority, TransactionStorageProof, TransactionTag, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; import type { Si0Field, Si0LookupTypeId, Si0Path, Si0Type, Si0TypeDef, Si0TypeDefArray, Si0TypeDefBitSequence, Si0TypeDefCompact, Si0TypeDefComposite, Si0TypeDefPhantom, Si0TypeDefPrimitive, Si0TypeDefSequence, Si0TypeDefTuple, Si0TypeDefVariant, Si0TypeParameter, Si0Variant, Si1Field, Si1LookupTypeId, Si1Path, Si1Type, Si1TypeDef, Si1TypeDefArray, Si1TypeDefBitSequence, Si1TypeDefCompact, Si1TypeDefComposite, Si1TypeDefPrimitive, Si1TypeDefSequence, Si1TypeDefTuple, Si1TypeDefVariant, Si1TypeParameter, Si1Variant, SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefBitSequence, SiTypeDefCompact, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiTypeParameter, SiVariant } from '@polkadot/types/interfaces/scaleInfo'; import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler'; import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session'; import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society'; import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactAssignmentsTo265, CompactAssignmentsWith16, CompactAssignmentsWith24, CompactScore, CompactScoreCompact, ElectionCompute, ElectionPhase, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, RawSolutionTo265, RawSolutionWith16, RawSolutionWith24, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SignedSubmission, SignedSubmissionOf, SignedSubmissionTo276, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, SubmissionIndicesOf, Supports, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking'; -import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, MigrationStatusResult, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state'; +import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, MigrationStatusResult, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, RuntimeVersionPre3, RuntimeVersionPre4, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state'; import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support'; -import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, TransactionalError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system'; +import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ApplyExtrinsicResultPre6, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorModulePre6, DispatchErrorModuleU8, DispatchErrorModuleU8a, DispatchErrorPre6, DispatchErrorPre6First, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchOutcomePre6, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, TransactionalError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system'; import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury'; import type { Multiplier } from '@polkadot/types/interfaces/txpayment'; +import type { TransactionSource, TransactionValidity, ValidTransaction } from '@polkadot/types/interfaces/txqueue'; import type { ClassDetails, ClassId, ClassMetadata, DepositBalance, DepositBalanceOf, DestroyWitness, InstanceDetails, InstanceId, InstanceMetadata } from '@polkadot/types/interfaces/uniques'; import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility'; import type { VestingInfo } from '@polkadot/types/interfaces/vesting'; import type { AssetInstance, AssetInstanceV0, AssetInstanceV1, AssetInstanceV2, BodyId, BodyPart, DoubleEncodedCall, Fungibility, FungibilityV0, FungibilityV1, FungibilityV2, InboundStatus, InstructionV2, InteriorMultiLocation, Junction, JunctionV0, JunctionV1, JunctionV2, Junctions, JunctionsV1, JunctionsV2, MultiAsset, MultiAssetFilter, MultiAssetFilterV1, MultiAssetFilterV2, MultiAssetV0, MultiAssetV1, MultiAssetV2, MultiAssets, MultiAssetsV1, MultiAssetsV2, MultiLocation, MultiLocationV0, MultiLocationV1, MultiLocationV2, NetworkId, OriginKindV0, OriginKindV1, OriginKindV2, OutboundStatus, Outcome, QueryId, QueryStatus, QueueConfigData, Response, ResponseV0, ResponseV1, ResponseV2, ResponseV2Error, ResponseV2Result, VersionMigrationStage, VersionedMultiAsset, VersionedMultiAssets, VersionedMultiLocation, VersionedResponse, VersionedXcm, WeightLimitV2, WildFungibility, WildFungibilityV0, WildFungibilityV1, WildFungibilityV2, WildMultiAsset, WildMultiAssetV1, WildMultiAssetV2, Xcm, XcmAssetId, XcmError, XcmErrorV0, XcmErrorV1, XcmErrorV2, XcmOrder, XcmOrderV0, XcmOrderV1, XcmOrderV2, XcmOrigin, XcmOriginKind, XcmV0, XcmV1, XcmV2, XcmVersion, XcmpMessageFormat } from '@polkadot/types/interfaces/xcm'; declare module '@polkadot/types/types/registry' { - export interface InterfaceTypes { + interface InterfaceTypes { AbridgedCandidateReceipt: AbridgedCandidateReceipt; AbridgedHostConfiguration: AbridgedHostConfiguration; AbridgedHrmpChannel: AbridgedHrmpChannel; @@ -95,6 +103,7 @@ declare module '@polkadot/types/types/registry' { AnySignature: AnySignature; ApiId: ApiId; ApplyExtrinsicResult: ApplyExtrinsicResult; + ApplyExtrinsicResultPre6: ApplyExtrinsicResultPre6; ApprovalFlag: ApprovalFlag; Approvals: Approvals; ArithmeticError: ArithmeticError; @@ -130,6 +139,8 @@ declare module '@polkadot/types/types/registry' { BabeBlockWeight: BabeBlockWeight; BabeEpochConfiguration: BabeEpochConfiguration; BabeEquivocationProof: BabeEquivocationProof; + BabeGenesisConfiguration: BabeGenesisConfiguration; + BabeGenesisConfigurationV1: BabeGenesisConfigurationV1; BabeWeight: BabeWeight; BackedCandidate: BackedCandidate; Balance: Balance; @@ -137,12 +148,20 @@ declare module '@polkadot/types/types/registry' { BalanceLockTo212: BalanceLockTo212; BalanceOf: BalanceOf; BalanceStatus: BalanceStatus; + BeefyAuthoritySet: BeefyAuthoritySet; BeefyCommitment: BeefyCommitment; BeefyId: BeefyId; BeefyKey: BeefyKey; BeefyNextAuthoritySet: BeefyNextAuthoritySet; BeefyPayload: BeefyPayload; + BeefyPayloadId: BeefyPayloadId; BeefySignedCommitment: BeefySignedCommitment; + BenchmarkBatch: BenchmarkBatch; + BenchmarkConfig: BenchmarkConfig; + BenchmarkList: BenchmarkList; + BenchmarkMetadata: BenchmarkMetadata; + BenchmarkParameter: BenchmarkParameter; + BenchmarkResult: BenchmarkResult; Bid: Bid; Bidder: Bidder; BidKind: BidKind; @@ -186,6 +205,7 @@ declare module '@polkadot/types/types/registry' { CallOrigin: CallOrigin; CandidateCommitments: CandidateCommitments; CandidateDescriptor: CandidateDescriptor; + CandidateEvent: CandidateEvent; CandidateHash: CandidateHash; CandidateInfo: CandidateInfo; CandidatePendingAvailability: CandidatePendingAvailability; @@ -195,6 +215,7 @@ declare module '@polkadot/types/types/registry' { ChainType: ChainType; ChangesTrieConfiguration: ChangesTrieConfiguration; ChangesTrieSignal: ChangesTrieSignal; + CheckInherentsResult: CheckInherentsResult; ClassDetails: ClassDetails; ClassId: ClassId; ClassMetadata: ClassMetadata; @@ -204,6 +225,8 @@ declare module '@polkadot/types/types/registry' { CodeUploadRequest: CodeUploadRequest; CodeUploadResult: CodeUploadResult; CodeUploadResultValue: CodeUploadResultValue; + CollationInfo: CollationInfo; + CollationInfoV1: CollationInfoV1; CollatorId: CollatorId; CollatorSignature: CollatorSignature; CollectiveOrigin: CollectiveOrigin; @@ -287,6 +310,7 @@ declare module '@polkadot/types/types/registry' { CoreAssignment: CoreAssignment; CoreIndex: CoreIndex; CoreOccupied: CoreOccupied; + CoreState: CoreState; CrateVersion: CrateVersion; CreatedBlock: CreatedBlock; CumulusPalletDmpQueueCall: CumulusPalletDmpQueueCall; @@ -328,14 +352,18 @@ declare module '@polkadot/types/types/registry' { DispatchClass: DispatchClass; DispatchError: DispatchError; DispatchErrorModule: DispatchErrorModule; + DispatchErrorModulePre6: DispatchErrorModulePre6; DispatchErrorModuleU8: DispatchErrorModuleU8; DispatchErrorModuleU8a: DispatchErrorModuleU8a; + DispatchErrorPre6: DispatchErrorPre6; + DispatchErrorPre6First: DispatchErrorPre6First; DispatchErrorTo198: DispatchErrorTo198; DispatchFeePayment: DispatchFeePayment; DispatchInfo: DispatchInfo; DispatchInfoTo190: DispatchInfoTo190; DispatchInfoTo244: DispatchInfoTo244; DispatchOutcome: DispatchOutcome; + DispatchOutcomePre6: DispatchOutcomePre6; DispatchResult: DispatchResult; DispatchResultOf: DispatchResultOf; DispatchResultTo198: DispatchResultTo198; @@ -359,6 +387,7 @@ declare module '@polkadot/types/types/registry' { ElectionStatus: ElectionStatus; EncodedFinalityProofs: EncodedFinalityProofs; EncodedJustification: EncodedJustification; + Epoch: Epoch; EpochAuthorship: EpochAuthorship; Era: Era; EraIndex: EraIndex; @@ -397,6 +426,7 @@ declare module '@polkadot/types/types/registry' { EthereumTransactionTransactionSignature: EthereumTransactionTransactionSignature; EthereumTransactionTransactionV2: EthereumTransactionTransactionV2; EthereumTypesHashH64: EthereumTypesHashH64; + EthFeeHistory: EthFeeHistory; EthFilter: EthFilter; EthFilterAddress: EthFilterAddress; EthFilterChanges: EthFilterChanges; @@ -406,6 +436,8 @@ declare module '@polkadot/types/types/registry' { EthHeader: EthHeader; EthLog: EthLog; EthReceipt: EthReceipt; + EthReceiptV0: EthReceiptV0; + EthReceiptV3: EthReceiptV3; EthRichBlock: EthRichBlock; EthRichHeader: EthRichHeader; EthStorageProof: EthStorageProof; @@ -433,11 +465,13 @@ declare module '@polkadot/types/types/registry' { EventMetadataV9: EventMetadataV9; EventRecord: EventRecord; EvmAccount: EvmAccount; + EvmCallInfo: EvmCallInfo; EvmCoreErrorExitError: EvmCoreErrorExitError; EvmCoreErrorExitFatal: EvmCoreErrorExitFatal; EvmCoreErrorExitReason: EvmCoreErrorExitReason; EvmCoreErrorExitRevert: EvmCoreErrorExitRevert; EvmCoreErrorExitSucceed: EvmCoreErrorExitSucceed; + EvmCreateInfo: EvmCreateInfo; EvmLog: EvmLog; EvmVicinity: EvmVicinity; ExecReturnValue: ExecReturnValue; @@ -466,6 +500,10 @@ declare module '@polkadot/types/types/registry' { ExtrinsicsWeight: ExtrinsicsWeight; ExtrinsicUnknown: ExtrinsicUnknown; ExtrinsicV4: ExtrinsicV4; + f32: f32; + F32: F32; + f64: f64; + F64: F64; FeeDetails: FeeDetails; Fixed128: Fixed128; Fixed64: Fixed64; @@ -537,6 +575,7 @@ declare module '@polkadot/types/types/registry' { GrandpaPrevote: GrandpaPrevote; GrandpaSignedPrecommit: GrandpaSignedPrecommit; GroupIndex: GroupIndex; + GroupRotationInfo: GroupRotationInfo; H1024: H1024; H128: H128; H160: H160; @@ -593,6 +632,8 @@ declare module '@polkadot/types/types/registry' { Index: Index; IndicesLookupSource: IndicesLookupSource; IndividualExposure: IndividualExposure; + InherentData: InherentData; + InherentIdentifier: InherentIdentifier; InitializationData: InitializationData; InstanceDetails: InstanceDetails; InstanceId: InstanceId; @@ -663,8 +704,14 @@ declare module '@polkadot/types/types/registry' { MetadataV14: MetadataV14; MetadataV9: MetadataV9; MigrationStatusResult: MigrationStatusResult; + MmrBatchProof: MmrBatchProof; + MmrEncodableOpaqueLeaf: MmrEncodableOpaqueLeaf; + MmrError: MmrError; MmrLeafBatchProof: MmrLeafBatchProof; + MmrLeafIndex: MmrLeafIndex; MmrLeafProof: MmrLeafProof; + MmrNodeIndex: MmrNodeIndex; + MmrProof: MmrProof; MmrRootHash: MmrRootHash; ModuleConstantMetadataV10: ModuleConstantMetadataV10; ModuleConstantMetadataV11: ModuleConstantMetadataV11; @@ -714,14 +761,20 @@ declare module '@polkadot/types/types/registry' { NominatorIndex: NominatorIndex; NominatorIndexCompact: NominatorIndexCompact; NotConnectedPeer: NotConnectedPeer; + NpApiError: NpApiError; Null: Null; + OccupiedCore: OccupiedCore; + OccupiedCoreAssumption: OccupiedCoreAssumption; OffchainAccuracy: OffchainAccuracy; OffchainAccuracyCompact: OffchainAccuracyCompact; OffenceDetails: OffenceDetails; Offender: Offender; + OldV1SessionInfo: OldV1SessionInfo; OpalRuntimeOriginCaller: OpalRuntimeOriginCaller; OpalRuntimeRuntime: OpalRuntimeRuntime; OpaqueCall: OpaqueCall; + OpaqueKeyOwnershipProof: OpaqueKeyOwnershipProof; + OpaqueMetadata: OpaqueMetadata; OpaqueMultiaddr: OpaqueMultiaddr; OpaqueNetworkState: OpaqueNetworkState; OpaquePeerId: OpaquePeerId; @@ -913,6 +966,7 @@ declare module '@polkadot/types/types/registry' { ProxyDefinition: ProxyDefinition; ProxyState: ProxyState; ProxyType: ProxyType; + PvfCheckStatement: PvfCheckStatement; QueryId: QueryId; QueryStatus: QueryStatus; QueueConfigData: QueueConfigData; @@ -1001,8 +1055,11 @@ declare module '@polkadot/types/types/registry' { RuntimeVersion: RuntimeVersion; RuntimeVersionApi: RuntimeVersionApi; RuntimeVersionPartial: RuntimeVersionPartial; + RuntimeVersionPre3: RuntimeVersionPre3; + RuntimeVersionPre4: RuntimeVersionPre4; Schedule: Schedule; Scheduled: Scheduled; + ScheduledCore: ScheduledCore; ScheduledTo254: ScheduledTo254; SchedulePeriod: SchedulePeriod; SchedulePriority: SchedulePriority; @@ -1010,6 +1067,7 @@ declare module '@polkadot/types/types/registry' { ScheduleTo258: ScheduleTo258; ScheduleTo264: ScheduleTo264; Scheduling: Scheduling; + ScrapedOnChainVotes: ScrapedOnChainVotes; Seal: Seal; SealV0: SealV0; SeatHolder: SeatHolder; @@ -1098,6 +1156,7 @@ declare module '@polkadot/types/types/registry' { SlashingSpansTo204: SlashingSpansTo204; SlashJournalEntry: SlashJournalEntry; Slot: Slot; + SlotDuration: SlotDuration; SlotNumber: SlotNumber; SlotRange: SlotRange; SlotRange10: SlotRange10; @@ -1160,6 +1219,7 @@ declare module '@polkadot/types/types/registry' { StorageHasherV13: StorageHasherV13; StorageHasherV14: StorageHasherV14; StorageHasherV9: StorageHasherV9; + StorageInfo: StorageInfo; StorageKey: StorageKey; StorageKind: StorageKind; StorageMetadataV10: StorageMetadataV10; @@ -1189,11 +1249,15 @@ declare module '@polkadot/types/types/registry' { TraceError: TraceError; TransactionalError: TransactionalError; TransactionInfo: TransactionInfo; + TransactionLongevity: TransactionLongevity; TransactionPriority: TransactionPriority; + TransactionSource: TransactionSource; TransactionStorageProof: TransactionStorageProof; + TransactionTag: TransactionTag; TransactionV0: TransactionV0; TransactionV1: TransactionV1; TransactionV2: TransactionV2; + TransactionValidity: TransactionValidity; TransactionValidityError: TransactionValidityError; TransientValidationData: TransientValidationData; TreasuryProposal: TreasuryProposal; @@ -1246,7 +1310,8 @@ declare module '@polkadot/types/types/registry' { UpDataStructsPropertyScope: UpDataStructsPropertyScope; UpDataStructsRpcCollection: UpDataStructsRpcCollection; UpDataStructsSponsoringRateLimit: UpDataStructsSponsoringRateLimit; - UpDataStructsSponsorshipState: UpDataStructsSponsorshipState; + UpDataStructsSponsorshipStateAccountId32: UpDataStructsSponsorshipStateAccountId32; + UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: UpDataStructsSponsorshipStateBasicCrossAccountIdRepr; UpDataStructsTokenChild: UpDataStructsTokenChild; UpDataStructsTokenData: UpDataStructsTokenData; UpgradeGoAhead: UpgradeGoAhead; @@ -1269,10 +1334,12 @@ declare module '@polkadot/types/types/registry' { ValidatorPrefsTo196: ValidatorPrefsTo196; ValidatorPrefsWithBlocked: ValidatorPrefsWithBlocked; ValidatorPrefsWithCommission: ValidatorPrefsWithCommission; + ValidatorSet: ValidatorSet; ValidatorSetId: ValidatorSetId; ValidatorSignature: ValidatorSignature; ValidDisputeStatementKind: ValidDisputeStatementKind; ValidityAttestation: ValidityAttestation; + ValidTransaction: ValidTransaction; VecInboundHrmpMessage: VecInboundHrmpMessage; VersionedMultiAsset: VersionedMultiAsset; VersionedMultiAssets: VersionedMultiAssets; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 7375179edb..c462d8411b 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -1367,7 +1367,8 @@ export interface PalletEvmCoderSubstrateError extends Enum { /** @name PalletEvmContractHelpersError */ export interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; - readonly type: 'NoPermission'; + readonly isNoPendingSponsor: boolean; + readonly type: 'NoPermission' | 'NoPendingSponsor'; } /** @name PalletEvmContractHelpersSponsoringModeT */ @@ -2736,7 +2737,7 @@ export interface UpDataStructsCollection extends Struct { readonly name: Vec; readonly description: Vec; readonly tokenPrefix: Bytes; - readonly sponsorship: UpDataStructsSponsorshipState; + readonly sponsorship: UpDataStructsSponsorshipStateAccountId32; readonly limits: UpDataStructsCollectionLimits; readonly permissions: UpDataStructsCollectionPermissions; readonly externalCollection: bool; @@ -2897,8 +2898,7 @@ export interface UpDataStructsPropertyPermission extends Struct { export interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; - readonly isEth: boolean; - readonly type: 'None' | 'Rmrk' | 'Eth'; + readonly type: 'None' | 'Rmrk'; } /** @name UpDataStructsRpcCollection */ @@ -2908,7 +2908,7 @@ export interface UpDataStructsRpcCollection extends Struct { readonly name: Vec; readonly description: Vec; readonly tokenPrefix: Bytes; - readonly sponsorship: UpDataStructsSponsorshipState; + readonly sponsorship: UpDataStructsSponsorshipStateAccountId32; readonly limits: UpDataStructsCollectionLimits; readonly permissions: UpDataStructsCollectionPermissions; readonly tokenPropertyPermissions: Vec; @@ -2924,8 +2924,8 @@ export interface UpDataStructsSponsoringRateLimit extends Enum { readonly type: 'SponsoringDisabled' | 'Blocks'; } -/** @name UpDataStructsSponsorshipState */ -export interface UpDataStructsSponsorshipState extends Enum { +/** @name UpDataStructsSponsorshipStateAccountId32 */ +export interface UpDataStructsSponsorshipStateAccountId32 extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; readonly asUnconfirmed: AccountId32; @@ -2934,6 +2934,16 @@ export interface UpDataStructsSponsorshipState extends Enum { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } +/** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr */ +export interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum { + readonly isDisabled: boolean; + readonly isUnconfirmed: boolean; + readonly asUnconfirmed: PalletEvmAccountBasicCrossAccountIdRepr; + readonly isConfirmed: boolean; + readonly asConfirmed: PalletEvmAccountBasicCrossAccountIdRepr; + readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; +} + /** @name UpDataStructsTokenChild */ export interface UpDataStructsTokenChild extends Struct { readonly token: u32; diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 318bb26e9f..9a4c914a19 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -3145,7 +3145,7 @@ export default { name: 'Vec', description: 'Vec', tokenPrefix: 'Bytes', - sponsorship: 'UpDataStructsSponsorshipState', + sponsorship: 'UpDataStructsSponsorshipStateAccountId32', limits: 'UpDataStructsCollectionLimits', permissions: 'UpDataStructsCollectionPermissions', externalCollection: 'bool' @@ -3153,7 +3153,7 @@ export default { /** * Lookup381: up_data_structs::SponsorshipState **/ - UpDataStructsSponsorshipState: { + UpDataStructsSponsorshipStateAccountId32: { _enum: { Disabled: 'Null', Unconfirmed: 'AccountId32', @@ -3212,7 +3212,7 @@ export default { name: 'Vec', description: 'Vec', tokenPrefix: 'Bytes', - sponsorship: 'UpDataStructsSponsorshipState', + sponsorship: 'UpDataStructsSponsorshipStateAccountId32', limits: 'UpDataStructsCollectionLimits', permissions: 'UpDataStructsCollectionPermissions', tokenPropertyPermissions: 'Vec', @@ -3311,7 +3311,7 @@ export default { * Lookup422: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { - _enum: ['None', 'Rmrk', 'Eth'] + _enum: ['None', 'Rmrk'] }, /** * Lookup424: pallet_nonfungible::pallet::Error @@ -3429,25 +3429,35 @@ export default { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup450: pallet_evm_contract_helpers::SponsoringModeT + * Lookup450: up_data_structs::SponsorshipState> + **/ + UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: { + _enum: { + Disabled: 'Null', + Unconfirmed: 'PalletEvmAccountBasicCrossAccountIdRepr', + Confirmed: 'PalletEvmAccountBasicCrossAccountIdRepr' + } + }, + /** + * Lookup451: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup452: pallet_evm_contract_helpers::pallet::Error + * Lookup453: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { - _enum: ['NoPermission'] + _enum: ['NoPermission', 'NoPendingSponsor'] }, /** - * Lookup453: pallet_evm_migration::pallet::Error + * Lookup454: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup455: sp_runtime::MultiSignature + * Lookup456: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3457,43 +3467,43 @@ export default { } }, /** - * Lookup456: sp_core::ed25519::Signature + * Lookup457: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup458: sp_core::sr25519::Signature + * Lookup459: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup459: sp_core::ecdsa::Signature + * Lookup460: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup462: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup463: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup463: frame_system::extensions::check_genesis::CheckGenesis + * Lookup464: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup466: frame_system::extensions::check_nonce::CheckNonce + * Lookup467: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup467: frame_system::extensions::check_weight::CheckWeight + * Lookup468: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup468: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup469: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup469: opal_runtime::Runtime + * Lookup470: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup470: pallet_ethereum::FakeTransactionFinalizer + * Lookup471: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index d0f65d9b48..c24acc4bdc 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -1,10 +1,14 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, PalletForeingAssetsModuleCall, PalletForeingAssetsModuleError, PalletForeingAssetsModuleEvent, PalletForeingAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipState, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/types/types/registry'; + +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, PalletForeingAssetsModuleCall, PalletForeingAssetsModuleError, PalletForeingAssetsModuleEvent, PalletForeingAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { - export interface InterfaceTypes { + interface InterfaceTypes { CumulusPalletDmpQueueCall: CumulusPalletDmpQueueCall; CumulusPalletDmpQueueConfigData: CumulusPalletDmpQueueConfigData; CumulusPalletDmpQueueError: CumulusPalletDmpQueueError; @@ -224,7 +228,8 @@ declare module '@polkadot/types/types/registry' { UpDataStructsPropertyScope: UpDataStructsPropertyScope; UpDataStructsRpcCollection: UpDataStructsRpcCollection; UpDataStructsSponsoringRateLimit: UpDataStructsSponsoringRateLimit; - UpDataStructsSponsorshipState: UpDataStructsSponsorshipState; + UpDataStructsSponsorshipStateAccountId32: UpDataStructsSponsorshipStateAccountId32; + UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: UpDataStructsSponsorshipStateBasicCrossAccountIdRepr; UpDataStructsTokenChild: UpDataStructsTokenChild; UpDataStructsTokenData: UpDataStructsTokenData; XcmDoubleEncoded: XcmDoubleEncoded; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 36821b9738..72d07d97ad 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1,14 +1,18 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -declare module '@polkadot/types/lookup' { - import type { BTreeMap, BTreeSet, Bytes, Compact, Enum, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; - import type { ITuple } from '@polkadot/types-codec/types'; - import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; - import type { Event } from '@polkadot/types/interfaces/system'; +// import type lookup before we augment - in some environments +// this is required to allow for ambient/previous definitions +import '@polkadot/types/lookup'; + +import type { BTreeMap, BTreeSet, Bytes, Compact, Enum, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; +import type { ITuple } from '@polkadot/types-codec/types'; +import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; +import type { Event } from '@polkadot/types/interfaces/system'; +declare module '@polkadot/types/lookup' { /** @name FrameSystemAccountInfo (3) */ - export interface FrameSystemAccountInfo extends Struct { + interface FrameSystemAccountInfo extends Struct { readonly nonce: u32; readonly consumers: u32; readonly providers: u32; @@ -17,7 +21,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletBalancesAccountData (5) */ - export interface PalletBalancesAccountData extends Struct { + interface PalletBalancesAccountData extends Struct { readonly free: u128; readonly reserved: u128; readonly miscFrozen: u128; @@ -25,19 +29,19 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSupportWeightsPerDispatchClassU64 (7) */ - export interface FrameSupportWeightsPerDispatchClassU64 extends Struct { + interface FrameSupportWeightsPerDispatchClassU64 extends Struct { readonly normal: u64; readonly operational: u64; readonly mandatory: u64; } /** @name SpRuntimeDigest (11) */ - export interface SpRuntimeDigest extends Struct { + interface SpRuntimeDigest extends Struct { readonly logs: Vec; } /** @name SpRuntimeDigestDigestItem (13) */ - export interface SpRuntimeDigestDigestItem extends Enum { + interface SpRuntimeDigestDigestItem extends Enum { readonly isOther: boolean; readonly asOther: Bytes; readonly isConsensus: boolean; @@ -51,14 +55,14 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSystemEventRecord (16) */ - export interface FrameSystemEventRecord extends Struct { + interface FrameSystemEventRecord extends Struct { readonly phase: FrameSystemPhase; readonly event: Event; readonly topics: Vec; } /** @name FrameSystemEvent (18) */ - export interface FrameSystemEvent extends Enum { + interface FrameSystemEvent extends Enum { readonly isExtrinsicSuccess: boolean; readonly asExtrinsicSuccess: { readonly dispatchInfo: FrameSupportWeightsDispatchInfo; @@ -86,14 +90,14 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSupportWeightsDispatchInfo (19) */ - export interface FrameSupportWeightsDispatchInfo extends Struct { + interface FrameSupportWeightsDispatchInfo extends Struct { readonly weight: u64; readonly class: FrameSupportWeightsDispatchClass; readonly paysFee: FrameSupportWeightsPays; } /** @name FrameSupportWeightsDispatchClass (20) */ - export interface FrameSupportWeightsDispatchClass extends Enum { + interface FrameSupportWeightsDispatchClass extends Enum { readonly isNormal: boolean; readonly isOperational: boolean; readonly isMandatory: boolean; @@ -101,14 +105,14 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSupportWeightsPays (21) */ - export interface FrameSupportWeightsPays extends Enum { + interface FrameSupportWeightsPays extends Enum { readonly isYes: boolean; readonly isNo: boolean; readonly type: 'Yes' | 'No'; } /** @name SpRuntimeDispatchError (22) */ - export interface SpRuntimeDispatchError extends Enum { + interface SpRuntimeDispatchError extends Enum { readonly isOther: boolean; readonly isCannotLookup: boolean; readonly isBadOrigin: boolean; @@ -127,13 +131,13 @@ declare module '@polkadot/types/lookup' { } /** @name SpRuntimeModuleError (23) */ - export interface SpRuntimeModuleError extends Struct { + interface SpRuntimeModuleError extends Struct { readonly index: u8; readonly error: U8aFixed; } /** @name SpRuntimeTokenError (24) */ - export interface SpRuntimeTokenError extends Enum { + interface SpRuntimeTokenError extends Enum { readonly isNoFunds: boolean; readonly isWouldDie: boolean; readonly isBelowMinimum: boolean; @@ -145,7 +149,7 @@ declare module '@polkadot/types/lookup' { } /** @name SpRuntimeArithmeticError (25) */ - export interface SpRuntimeArithmeticError extends Enum { + interface SpRuntimeArithmeticError extends Enum { readonly isUnderflow: boolean; readonly isOverflow: boolean; readonly isDivisionByZero: boolean; @@ -153,14 +157,14 @@ declare module '@polkadot/types/lookup' { } /** @name SpRuntimeTransactionalError (26) */ - export interface SpRuntimeTransactionalError extends Enum { + interface SpRuntimeTransactionalError extends Enum { readonly isLimitReached: boolean; readonly isNoLayer: boolean; readonly type: 'LimitReached' | 'NoLayer'; } /** @name CumulusPalletParachainSystemEvent (27) */ - export interface CumulusPalletParachainSystemEvent extends Enum { + interface CumulusPalletParachainSystemEvent extends Enum { readonly isValidationFunctionStored: boolean; readonly isValidationFunctionApplied: boolean; readonly asValidationFunctionApplied: { @@ -184,7 +188,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletBalancesEvent (28) */ - export interface PalletBalancesEvent extends Enum { + interface PalletBalancesEvent extends Enum { readonly isEndowed: boolean; readonly asEndowed: { readonly account: AccountId32; @@ -243,14 +247,14 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSupportTokensMiscBalanceStatus (29) */ - export interface FrameSupportTokensMiscBalanceStatus extends Enum { + interface FrameSupportTokensMiscBalanceStatus extends Enum { readonly isFree: boolean; readonly isReserved: boolean; readonly type: 'Free' | 'Reserved'; } /** @name PalletTransactionPaymentEvent (30) */ - export interface PalletTransactionPaymentEvent extends Enum { + interface PalletTransactionPaymentEvent extends Enum { readonly isTransactionFeePaid: boolean; readonly asTransactionFeePaid: { readonly who: AccountId32; @@ -261,7 +265,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletTreasuryEvent (31) */ - export interface PalletTreasuryEvent extends Enum { + interface PalletTreasuryEvent extends Enum { readonly isProposed: boolean; readonly asProposed: { readonly proposalIndex: u32; @@ -303,7 +307,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletSudoEvent (32) */ - export interface PalletSudoEvent extends Enum { + interface PalletSudoEvent extends Enum { readonly isSudid: boolean; readonly asSudid: { readonly sudoResult: Result; @@ -320,7 +324,7 @@ declare module '@polkadot/types/lookup' { } /** @name OrmlVestingModuleEvent (36) */ - export interface OrmlVestingModuleEvent extends Enum { + interface OrmlVestingModuleEvent extends Enum { readonly isVestingScheduleAdded: boolean; readonly asVestingScheduleAdded: { readonly from: AccountId32; @@ -340,7 +344,7 @@ declare module '@polkadot/types/lookup' { } /** @name OrmlVestingVestingSchedule (37) */ - export interface OrmlVestingVestingSchedule extends Struct { + interface OrmlVestingVestingSchedule extends Struct { readonly start: u32; readonly period: u32; readonly periodCount: u32; @@ -348,7 +352,7 @@ declare module '@polkadot/types/lookup' { } /** @name OrmlXtokensModuleEvent (39) */ - export interface OrmlXtokensModuleEvent extends Enum { + interface OrmlXtokensModuleEvent extends Enum { readonly isTransferredMultiAssets: boolean; readonly asTransferredMultiAssets: { readonly sender: AccountId32; @@ -360,16 +364,16 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV1MultiassetMultiAssets (40) */ - export interface XcmV1MultiassetMultiAssets extends Vec {} + interface XcmV1MultiassetMultiAssets extends Vec {} /** @name XcmV1MultiAsset (42) */ - export interface XcmV1MultiAsset extends Struct { + interface XcmV1MultiAsset extends Struct { readonly id: XcmV1MultiassetAssetId; readonly fun: XcmV1MultiassetFungibility; } /** @name XcmV1MultiassetAssetId (43) */ - export interface XcmV1MultiassetAssetId extends Enum { + interface XcmV1MultiassetAssetId extends Enum { readonly isConcrete: boolean; readonly asConcrete: XcmV1MultiLocation; readonly isAbstract: boolean; @@ -378,13 +382,13 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV1MultiLocation (44) */ - export interface XcmV1MultiLocation extends Struct { + interface XcmV1MultiLocation extends Struct { readonly parents: u8; readonly interior: XcmV1MultilocationJunctions; } /** @name XcmV1MultilocationJunctions (45) */ - export interface XcmV1MultilocationJunctions extends Enum { + interface XcmV1MultilocationJunctions extends Enum { readonly isHere: boolean; readonly isX1: boolean; readonly asX1: XcmV1Junction; @@ -406,7 +410,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV1Junction (46) */ - export interface XcmV1Junction extends Enum { + interface XcmV1Junction extends Enum { readonly isParachain: boolean; readonly asParachain: Compact; readonly isAccountId32: boolean; @@ -440,7 +444,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV0JunctionNetworkId (48) */ - export interface XcmV0JunctionNetworkId extends Enum { + interface XcmV0JunctionNetworkId extends Enum { readonly isAny: boolean; readonly isNamed: boolean; readonly asNamed: Bytes; @@ -450,7 +454,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV0JunctionBodyId (52) */ - export interface XcmV0JunctionBodyId extends Enum { + interface XcmV0JunctionBodyId extends Enum { readonly isUnit: boolean; readonly isNamed: boolean; readonly asNamed: Bytes; @@ -464,7 +468,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV0JunctionBodyPart (53) */ - export interface XcmV0JunctionBodyPart extends Enum { + interface XcmV0JunctionBodyPart extends Enum { readonly isVoice: boolean; readonly isMembers: boolean; readonly asMembers: { @@ -489,7 +493,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV1MultiassetFungibility (54) */ - export interface XcmV1MultiassetFungibility extends Enum { + interface XcmV1MultiassetFungibility extends Enum { readonly isFungible: boolean; readonly asFungible: Compact; readonly isNonFungible: boolean; @@ -498,7 +502,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV1MultiassetAssetInstance (55) */ - export interface XcmV1MultiassetAssetInstance extends Enum { + interface XcmV1MultiassetAssetInstance extends Enum { readonly isUndefined: boolean; readonly isIndex: boolean; readonly asIndex: Compact; @@ -516,7 +520,7 @@ declare module '@polkadot/types/lookup' { } /** @name OrmlTokensModuleEvent (58) */ - export interface OrmlTokensModuleEvent extends Enum { + interface OrmlTokensModuleEvent extends Enum { readonly isEndowed: boolean; readonly asEndowed: { readonly currencyId: PalletForeingAssetsAssetIds; @@ -604,7 +608,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletForeingAssetsAssetIds (59) */ - export interface PalletForeingAssetsAssetIds extends Enum { + interface PalletForeingAssetsAssetIds extends Enum { readonly isForeignAssetId: boolean; readonly asForeignAssetId: u32; readonly isNativeAssetId: boolean; @@ -613,14 +617,14 @@ declare module '@polkadot/types/lookup' { } /** @name PalletForeingAssetsNativeCurrency (60) */ - export interface PalletForeingAssetsNativeCurrency extends Enum { + interface PalletForeingAssetsNativeCurrency extends Enum { readonly isHere: boolean; readonly isParent: boolean; readonly type: 'Here' | 'Parent'; } /** @name CumulusPalletXcmpQueueEvent (61) */ - export interface CumulusPalletXcmpQueueEvent extends Enum { + interface CumulusPalletXcmpQueueEvent extends Enum { readonly isSuccess: boolean; readonly asSuccess: { readonly messageHash: Option; @@ -664,7 +668,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV2TraitsError (63) */ - export interface XcmV2TraitsError extends Enum { + interface XcmV2TraitsError extends Enum { readonly isOverflow: boolean; readonly isUnimplemented: boolean; readonly isUntrustedReserveLocation: boolean; @@ -697,7 +701,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletXcmEvent (65) */ - export interface PalletXcmEvent extends Enum { + interface PalletXcmEvent extends Enum { readonly isAttempted: boolean; readonly asAttempted: XcmV2TraitsOutcome; readonly isSent: boolean; @@ -734,7 +738,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV2TraitsOutcome (66) */ - export interface XcmV2TraitsOutcome extends Enum { + interface XcmV2TraitsOutcome extends Enum { readonly isComplete: boolean; readonly asComplete: u64; readonly isIncomplete: boolean; @@ -745,10 +749,10 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV2Xcm (67) */ - export interface XcmV2Xcm extends Vec {} + interface XcmV2Xcm extends Vec {} /** @name XcmV2Instruction (69) */ - export interface XcmV2Instruction extends Enum { + interface XcmV2Instruction extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: XcmV1MultiassetMultiAssets; readonly isReserveAssetDeposited: boolean; @@ -868,7 +872,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV2Response (70) */ - export interface XcmV2Response extends Enum { + interface XcmV2Response extends Enum { readonly isNull: boolean; readonly isAssets: boolean; readonly asAssets: XcmV1MultiassetMultiAssets; @@ -880,7 +884,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV0OriginKind (73) */ - export interface XcmV0OriginKind extends Enum { + interface XcmV0OriginKind extends Enum { readonly isNative: boolean; readonly isSovereignAccount: boolean; readonly isSuperuser: boolean; @@ -889,12 +893,12 @@ declare module '@polkadot/types/lookup' { } /** @name XcmDoubleEncoded (74) */ - export interface XcmDoubleEncoded extends Struct { + interface XcmDoubleEncoded extends Struct { readonly encoded: Bytes; } /** @name XcmV1MultiassetMultiAssetFilter (75) */ - export interface XcmV1MultiassetMultiAssetFilter extends Enum { + interface XcmV1MultiassetMultiAssetFilter extends Enum { readonly isDefinite: boolean; readonly asDefinite: XcmV1MultiassetMultiAssets; readonly isWild: boolean; @@ -903,7 +907,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV1MultiassetWildMultiAsset (76) */ - export interface XcmV1MultiassetWildMultiAsset extends Enum { + interface XcmV1MultiassetWildMultiAsset extends Enum { readonly isAll: boolean; readonly isAllOf: boolean; readonly asAllOf: { @@ -914,14 +918,14 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV1MultiassetWildFungibility (77) */ - export interface XcmV1MultiassetWildFungibility extends Enum { + interface XcmV1MultiassetWildFungibility extends Enum { readonly isFungible: boolean; readonly isNonFungible: boolean; readonly type: 'Fungible' | 'NonFungible'; } /** @name XcmV2WeightLimit (78) */ - export interface XcmV2WeightLimit extends Enum { + interface XcmV2WeightLimit extends Enum { readonly isUnlimited: boolean; readonly isLimited: boolean; readonly asLimited: Compact; @@ -929,7 +933,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmVersionedMultiAssets (80) */ - export interface XcmVersionedMultiAssets extends Enum { + interface XcmVersionedMultiAssets extends Enum { readonly isV0: boolean; readonly asV0: Vec; readonly isV1: boolean; @@ -938,7 +942,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV0MultiAsset (82) */ - export interface XcmV0MultiAsset extends Enum { + interface XcmV0MultiAsset extends Enum { readonly isNone: boolean; readonly isAll: boolean; readonly isAllFungible: boolean; @@ -983,7 +987,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV0MultiLocation (83) */ - export interface XcmV0MultiLocation extends Enum { + interface XcmV0MultiLocation extends Enum { readonly isNull: boolean; readonly isX1: boolean; readonly asX1: XcmV0Junction; @@ -1005,7 +1009,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV0Junction (84) */ - export interface XcmV0Junction extends Enum { + interface XcmV0Junction extends Enum { readonly isParent: boolean; readonly isParachain: boolean; readonly asParachain: Compact; @@ -1040,7 +1044,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmVersionedMultiLocation (85) */ - export interface XcmVersionedMultiLocation extends Enum { + interface XcmVersionedMultiLocation extends Enum { readonly isV0: boolean; readonly asV0: XcmV0MultiLocation; readonly isV1: boolean; @@ -1049,7 +1053,7 @@ declare module '@polkadot/types/lookup' { } /** @name CumulusPalletXcmEvent (86) */ - export interface CumulusPalletXcmEvent extends Enum { + interface CumulusPalletXcmEvent extends Enum { readonly isInvalidFormat: boolean; readonly asInvalidFormat: U8aFixed; readonly isUnsupportedVersion: boolean; @@ -1060,7 +1064,7 @@ declare module '@polkadot/types/lookup' { } /** @name CumulusPalletDmpQueueEvent (87) */ - export interface CumulusPalletDmpQueueEvent extends Enum { + interface CumulusPalletDmpQueueEvent extends Enum { readonly isInvalidFormat: boolean; readonly asInvalidFormat: { readonly messageId: U8aFixed; @@ -1095,7 +1099,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletUniqueRawEvent (88) */ - export interface PalletUniqueRawEvent extends Enum { + interface PalletUniqueRawEvent extends Enum { readonly isCollectionSponsorRemoved: boolean; readonly asCollectionSponsorRemoved: u32; readonly isCollectionAdminAdded: boolean; @@ -1120,7 +1124,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletEvmAccountBasicCrossAccountIdRepr (89) */ - export interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { + interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { readonly isSubstrate: boolean; readonly asSubstrate: AccountId32; readonly isEthereum: boolean; @@ -1129,7 +1133,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletUniqueSchedulerEvent (92) */ - export interface PalletUniqueSchedulerEvent extends Enum { + interface PalletUniqueSchedulerEvent extends Enum { readonly isScheduled: boolean; readonly asScheduled: { readonly when: u32; @@ -1156,14 +1160,14 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSupportScheduleLookupError (95) */ - export interface FrameSupportScheduleLookupError extends Enum { + interface FrameSupportScheduleLookupError extends Enum { readonly isUnknown: boolean; readonly isBadFormat: boolean; readonly type: 'Unknown' | 'BadFormat'; } /** @name PalletCommonEvent (96) */ - export interface PalletCommonEvent extends Enum { + interface PalletCommonEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; readonly isCollectionDestroyed: boolean; @@ -1190,14 +1194,14 @@ declare module '@polkadot/types/lookup' { } /** @name PalletStructureEvent (99) */ - export interface PalletStructureEvent extends Enum { + interface PalletStructureEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: Result; readonly type: 'Executed'; } /** @name PalletRmrkCoreEvent (100) */ - export interface PalletRmrkCoreEvent extends Enum { + interface PalletRmrkCoreEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: { readonly issuer: AccountId32; @@ -1287,7 +1291,7 @@ declare module '@polkadot/types/lookup' { } /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (101) */ - export interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { + interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { readonly isAccountId: boolean; readonly asAccountId: AccountId32; readonly isCollectionAndNftTuple: boolean; @@ -1296,7 +1300,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletRmrkEquipEvent (106) */ - export interface PalletRmrkEquipEvent extends Enum { + interface PalletRmrkEquipEvent extends Enum { readonly isBaseCreated: boolean; readonly asBaseCreated: { readonly issuer: AccountId32; @@ -1311,7 +1315,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletForeingAssetsModuleEvent (107) */ - export interface PalletForeingAssetsModuleEvent extends Enum { + interface PalletForeingAssetsModuleEvent extends Enum { readonly isForeignAssetRegistered: boolean; readonly asForeignAssetRegistered: { readonly assetId: u32; @@ -1338,7 +1342,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletForeingAssetsModuleAssetMetadata (108) */ - export interface PalletForeingAssetsModuleAssetMetadata extends Struct { + interface PalletForeingAssetsModuleAssetMetadata extends Struct { readonly name: Bytes; readonly symbol: Bytes; readonly decimals: u8; @@ -1346,7 +1350,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletEvmEvent (109) */ - export interface PalletEvmEvent extends Enum { + interface PalletEvmEvent extends Enum { readonly isLog: boolean; readonly asLog: EthereumLog; readonly isCreated: boolean; @@ -1365,21 +1369,21 @@ declare module '@polkadot/types/lookup' { } /** @name EthereumLog (110) */ - export interface EthereumLog extends Struct { + interface EthereumLog extends Struct { readonly address: H160; readonly topics: Vec; readonly data: Bytes; } /** @name PalletEthereumEvent (114) */ - export interface PalletEthereumEvent extends Enum { + interface PalletEthereumEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; readonly type: 'Executed'; } /** @name EvmCoreErrorExitReason (115) */ - export interface EvmCoreErrorExitReason extends Enum { + interface EvmCoreErrorExitReason extends Enum { readonly isSucceed: boolean; readonly asSucceed: EvmCoreErrorExitSucceed; readonly isError: boolean; @@ -1392,7 +1396,7 @@ declare module '@polkadot/types/lookup' { } /** @name EvmCoreErrorExitSucceed (116) */ - export interface EvmCoreErrorExitSucceed extends Enum { + interface EvmCoreErrorExitSucceed extends Enum { readonly isStopped: boolean; readonly isReturned: boolean; readonly isSuicided: boolean; @@ -1400,7 +1404,7 @@ declare module '@polkadot/types/lookup' { } /** @name EvmCoreErrorExitError (117) */ - export interface EvmCoreErrorExitError extends Enum { + interface EvmCoreErrorExitError extends Enum { readonly isStackUnderflow: boolean; readonly isStackOverflow: boolean; readonly isInvalidJump: boolean; @@ -1421,13 +1425,13 @@ declare module '@polkadot/types/lookup' { } /** @name EvmCoreErrorExitRevert (120) */ - export interface EvmCoreErrorExitRevert extends Enum { + interface EvmCoreErrorExitRevert extends Enum { readonly isReverted: boolean; readonly type: 'Reverted'; } /** @name EvmCoreErrorExitFatal (121) */ - export interface EvmCoreErrorExitFatal extends Enum { + interface EvmCoreErrorExitFatal extends Enum { readonly isNotSupported: boolean; readonly isUnhandledInterrupt: boolean; readonly isCallErrorAsFatal: boolean; @@ -1438,7 +1442,7 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSystemPhase (122) */ - export interface FrameSystemPhase extends Enum { + interface FrameSystemPhase extends Enum { readonly isApplyExtrinsic: boolean; readonly asApplyExtrinsic: u32; readonly isFinalization: boolean; @@ -1447,13 +1451,13 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSystemLastRuntimeUpgradeInfo (124) */ - export interface FrameSystemLastRuntimeUpgradeInfo extends Struct { + interface FrameSystemLastRuntimeUpgradeInfo extends Struct { readonly specVersion: Compact; readonly specName: Text; } /** @name FrameSystemCall (125) */ - export interface FrameSystemCall extends Enum { + interface FrameSystemCall extends Enum { readonly isFillBlock: boolean; readonly asFillBlock: { readonly ratio: Perbill; @@ -1495,21 +1499,21 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSystemLimitsBlockWeights (130) */ - export interface FrameSystemLimitsBlockWeights extends Struct { + interface FrameSystemLimitsBlockWeights extends Struct { readonly baseBlock: u64; readonly maxBlock: u64; readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; } /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (131) */ - export interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { + interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { readonly normal: FrameSystemLimitsWeightsPerClass; readonly operational: FrameSystemLimitsWeightsPerClass; readonly mandatory: FrameSystemLimitsWeightsPerClass; } /** @name FrameSystemLimitsWeightsPerClass (132) */ - export interface FrameSystemLimitsWeightsPerClass extends Struct { + interface FrameSystemLimitsWeightsPerClass extends Struct { readonly baseExtrinsic: u64; readonly maxExtrinsic: Option; readonly maxTotal: Option; @@ -1517,25 +1521,25 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSystemLimitsBlockLength (134) */ - export interface FrameSystemLimitsBlockLength extends Struct { + interface FrameSystemLimitsBlockLength extends Struct { readonly max: FrameSupportWeightsPerDispatchClassU32; } /** @name FrameSupportWeightsPerDispatchClassU32 (135) */ - export interface FrameSupportWeightsPerDispatchClassU32 extends Struct { + interface FrameSupportWeightsPerDispatchClassU32 extends Struct { readonly normal: u32; readonly operational: u32; readonly mandatory: u32; } /** @name FrameSupportWeightsRuntimeDbWeight (136) */ - export interface FrameSupportWeightsRuntimeDbWeight extends Struct { + interface FrameSupportWeightsRuntimeDbWeight extends Struct { readonly read: u64; readonly write: u64; } /** @name SpVersionRuntimeVersion (137) */ - export interface SpVersionRuntimeVersion extends Struct { + interface SpVersionRuntimeVersion extends Struct { readonly specName: Text; readonly implName: Text; readonly authoringVersion: u32; @@ -1547,7 +1551,7 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSystemError (142) */ - export interface FrameSystemError extends Enum { + interface FrameSystemError extends Enum { readonly isInvalidSpecName: boolean; readonly isSpecVersionNeedsToIncrease: boolean; readonly isFailedToExtractRuntimeVersion: boolean; @@ -1558,7 +1562,7 @@ declare module '@polkadot/types/lookup' { } /** @name PolkadotPrimitivesV2PersistedValidationData (143) */ - export interface PolkadotPrimitivesV2PersistedValidationData extends Struct { + interface PolkadotPrimitivesV2PersistedValidationData extends Struct { readonly parentHead: Bytes; readonly relayParentNumber: u32; readonly relayParentStorageRoot: H256; @@ -1566,18 +1570,18 @@ declare module '@polkadot/types/lookup' { } /** @name PolkadotPrimitivesV2UpgradeRestriction (146) */ - export interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { + interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { readonly isPresent: boolean; readonly type: 'Present'; } /** @name SpTrieStorageProof (147) */ - export interface SpTrieStorageProof extends Struct { + interface SpTrieStorageProof extends Struct { readonly trieNodes: BTreeSet; } /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (149) */ - export interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { + interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { readonly dmqMqcHead: H256; readonly relayDispatchQueueSize: ITuple<[u32, u32]>; readonly ingressChannels: Vec>; @@ -1585,7 +1589,7 @@ declare module '@polkadot/types/lookup' { } /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (152) */ - export interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { + interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { readonly maxCapacity: u32; readonly maxTotalSize: u32; readonly maxMessageSize: u32; @@ -1595,7 +1599,7 @@ declare module '@polkadot/types/lookup' { } /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (153) */ - export interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { + interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { readonly maxCodeSize: u32; readonly maxHeadDataSize: u32; readonly maxUpwardQueueCount: u32; @@ -1608,13 +1612,13 @@ declare module '@polkadot/types/lookup' { } /** @name PolkadotCorePrimitivesOutboundHrmpMessage (159) */ - export interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { + interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { readonly recipient: u32; readonly data: Bytes; } /** @name CumulusPalletParachainSystemCall (160) */ - export interface CumulusPalletParachainSystemCall extends Enum { + interface CumulusPalletParachainSystemCall extends Enum { readonly isSetValidationData: boolean; readonly asSetValidationData: { readonly data: CumulusPrimitivesParachainInherentParachainInherentData; @@ -1635,7 +1639,7 @@ declare module '@polkadot/types/lookup' { } /** @name CumulusPrimitivesParachainInherentParachainInherentData (161) */ - export interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { + interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { readonly validationData: PolkadotPrimitivesV2PersistedValidationData; readonly relayChainState: SpTrieStorageProof; readonly downwardMessages: Vec; @@ -1643,19 +1647,19 @@ declare module '@polkadot/types/lookup' { } /** @name PolkadotCorePrimitivesInboundDownwardMessage (163) */ - export interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { + interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { readonly sentAt: u32; readonly msg: Bytes; } /** @name PolkadotCorePrimitivesInboundHrmpMessage (166) */ - export interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { + interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { readonly sentAt: u32; readonly data: Bytes; } /** @name CumulusPalletParachainSystemError (169) */ - export interface CumulusPalletParachainSystemError extends Enum { + interface CumulusPalletParachainSystemError extends Enum { readonly isOverlappingUpgrades: boolean; readonly isProhibitedByPolkadot: boolean; readonly isTooBig: boolean; @@ -1668,14 +1672,14 @@ declare module '@polkadot/types/lookup' { } /** @name PalletBalancesBalanceLock (171) */ - export interface PalletBalancesBalanceLock extends Struct { + interface PalletBalancesBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; readonly reasons: PalletBalancesReasons; } /** @name PalletBalancesReasons (172) */ - export interface PalletBalancesReasons extends Enum { + interface PalletBalancesReasons extends Enum { readonly isFee: boolean; readonly isMisc: boolean; readonly isAll: boolean; @@ -1683,20 +1687,20 @@ declare module '@polkadot/types/lookup' { } /** @name PalletBalancesReserveData (175) */ - export interface PalletBalancesReserveData extends Struct { + interface PalletBalancesReserveData extends Struct { readonly id: U8aFixed; readonly amount: u128; } /** @name PalletBalancesReleases (177) */ - export interface PalletBalancesReleases extends Enum { + interface PalletBalancesReleases extends Enum { readonly isV100: boolean; readonly isV200: boolean; readonly type: 'V100' | 'V200'; } /** @name PalletBalancesCall (178) */ - export interface PalletBalancesCall extends Enum { + interface PalletBalancesCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { readonly dest: MultiAddress; @@ -1733,7 +1737,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletBalancesError (181) */ - export interface PalletBalancesError extends Enum { + interface PalletBalancesError extends Enum { readonly isVestingBalance: boolean; readonly isLiquidityRestrictions: boolean; readonly isInsufficientBalance: boolean; @@ -1746,7 +1750,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletTimestampCall (183) */ - export interface PalletTimestampCall extends Enum { + interface PalletTimestampCall extends Enum { readonly isSet: boolean; readonly asSet: { readonly now: Compact; @@ -1755,14 +1759,14 @@ declare module '@polkadot/types/lookup' { } /** @name PalletTransactionPaymentReleases (185) */ - export interface PalletTransactionPaymentReleases extends Enum { + interface PalletTransactionPaymentReleases extends Enum { readonly isV1Ancient: boolean; readonly isV2: boolean; readonly type: 'V1Ancient' | 'V2'; } /** @name PalletTreasuryProposal (186) */ - export interface PalletTreasuryProposal extends Struct { + interface PalletTreasuryProposal extends Struct { readonly proposer: AccountId32; readonly value: u128; readonly beneficiary: AccountId32; @@ -1770,7 +1774,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletTreasuryCall (189) */ - export interface PalletTreasuryCall extends Enum { + interface PalletTreasuryCall extends Enum { readonly isProposeSpend: boolean; readonly asProposeSpend: { readonly value: Compact; @@ -1797,10 +1801,10 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSupportPalletId (192) */ - export interface FrameSupportPalletId extends U8aFixed {} + interface FrameSupportPalletId extends U8aFixed {} /** @name PalletTreasuryError (193) */ - export interface PalletTreasuryError extends Enum { + interface PalletTreasuryError extends Enum { readonly isInsufficientProposersBalance: boolean; readonly isInvalidIndex: boolean; readonly isTooManyApprovals: boolean; @@ -1810,7 +1814,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletSudoCall (194) */ - export interface PalletSudoCall extends Enum { + interface PalletSudoCall extends Enum { readonly isSudo: boolean; readonly asSudo: { readonly call: Call; @@ -1833,7 +1837,7 @@ declare module '@polkadot/types/lookup' { } /** @name OrmlVestingModuleCall (196) */ - export interface OrmlVestingModuleCall extends Enum { + interface OrmlVestingModuleCall extends Enum { readonly isClaim: boolean; readonly isVestedTransfer: boolean; readonly asVestedTransfer: { @@ -1853,7 +1857,7 @@ declare module '@polkadot/types/lookup' { } /** @name OrmlXtokensModuleCall (198) */ - export interface OrmlXtokensModuleCall extends Enum { + interface OrmlXtokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { readonly currencyId: PalletForeingAssetsAssetIds; @@ -1900,7 +1904,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmVersionedMultiAsset (199) */ - export interface XcmVersionedMultiAsset extends Enum { + interface XcmVersionedMultiAsset extends Enum { readonly isV0: boolean; readonly asV0: XcmV0MultiAsset; readonly isV1: boolean; @@ -1909,7 +1913,7 @@ declare module '@polkadot/types/lookup' { } /** @name OrmlTokensModuleCall (202) */ - export interface OrmlTokensModuleCall extends Enum { + interface OrmlTokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { readonly dest: MultiAddress; @@ -1946,7 +1950,7 @@ declare module '@polkadot/types/lookup' { } /** @name CumulusPalletXcmpQueueCall (203) */ - export interface CumulusPalletXcmpQueueCall extends Enum { + interface CumulusPalletXcmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { readonly index: u64; @@ -1982,7 +1986,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletXcmCall (204) */ - export interface PalletXcmCall extends Enum { + interface PalletXcmCall extends Enum { readonly isSend: boolean; readonly asSend: { readonly dest: XcmVersionedMultiLocation; @@ -2044,7 +2048,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmVersionedXcm (205) */ - export interface XcmVersionedXcm extends Enum { + interface XcmVersionedXcm extends Enum { readonly isV0: boolean; readonly asV0: XcmV0Xcm; readonly isV1: boolean; @@ -2055,7 +2059,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV0Xcm (206) */ - export interface XcmV0Xcm extends Enum { + interface XcmV0Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { readonly assets: Vec; @@ -2118,7 +2122,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV0Order (208) */ - export interface XcmV0Order extends Enum { + interface XcmV0Order extends Enum { readonly isNull: boolean; readonly isDepositAsset: boolean; readonly asDepositAsset: { @@ -2166,14 +2170,14 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV0Response (210) */ - export interface XcmV0Response extends Enum { + interface XcmV0Response extends Enum { readonly isAssets: boolean; readonly asAssets: Vec; readonly type: 'Assets'; } /** @name XcmV1Xcm (211) */ - export interface XcmV1Xcm extends Enum { + interface XcmV1Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { readonly assets: XcmV1MultiassetMultiAssets; @@ -2242,7 +2246,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV1Order (213) */ - export interface XcmV1Order extends Enum { + interface XcmV1Order extends Enum { readonly isNoop: boolean; readonly isDepositAsset: boolean; readonly asDepositAsset: { @@ -2292,7 +2296,7 @@ declare module '@polkadot/types/lookup' { } /** @name XcmV1Response (215) */ - export interface XcmV1Response extends Enum { + interface XcmV1Response extends Enum { readonly isAssets: boolean; readonly asAssets: XcmV1MultiassetMultiAssets; readonly isVersion: boolean; @@ -2301,10 +2305,10 @@ declare module '@polkadot/types/lookup' { } /** @name CumulusPalletXcmCall (229) */ - export type CumulusPalletXcmCall = Null; + type CumulusPalletXcmCall = Null; /** @name CumulusPalletDmpQueueCall (230) */ - export interface CumulusPalletDmpQueueCall extends Enum { + interface CumulusPalletDmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { readonly index: u64; @@ -2314,7 +2318,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletInflationCall (231) */ - export interface PalletInflationCall extends Enum { + interface PalletInflationCall extends Enum { readonly isStartInflation: boolean; readonly asStartInflation: { readonly inflationStartRelayBlock: u32; @@ -2323,7 +2327,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletUniqueCall (232) */ - export interface PalletUniqueCall extends Enum { + interface PalletUniqueCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { readonly collectionName: Vec; @@ -2481,7 +2485,7 @@ declare module '@polkadot/types/lookup' { } /** @name UpDataStructsCollectionMode (237) */ - export interface UpDataStructsCollectionMode extends Enum { + interface UpDataStructsCollectionMode extends Enum { readonly isNft: boolean; readonly isFungible: boolean; readonly asFungible: u8; @@ -2490,7 +2494,7 @@ declare module '@polkadot/types/lookup' { } /** @name UpDataStructsCreateCollectionData (238) */ - export interface UpDataStructsCreateCollectionData extends Struct { + interface UpDataStructsCreateCollectionData extends Struct { readonly mode: UpDataStructsCollectionMode; readonly access: Option; readonly name: Vec; @@ -2504,14 +2508,14 @@ declare module '@polkadot/types/lookup' { } /** @name UpDataStructsAccessMode (240) */ - export interface UpDataStructsAccessMode extends Enum { + interface UpDataStructsAccessMode extends Enum { readonly isNormal: boolean; readonly isAllowList: boolean; readonly type: 'Normal' | 'AllowList'; } /** @name UpDataStructsCollectionLimits (242) */ - export interface UpDataStructsCollectionLimits extends Struct { + interface UpDataStructsCollectionLimits extends Struct { readonly accountTokenOwnershipLimit: Option; readonly sponsoredDataSize: Option; readonly sponsoredDataRateLimit: Option; @@ -2524,7 +2528,7 @@ declare module '@polkadot/types/lookup' { } /** @name UpDataStructsSponsoringRateLimit (244) */ - export interface UpDataStructsSponsoringRateLimit extends Enum { + interface UpDataStructsSponsoringRateLimit extends Enum { readonly isSponsoringDisabled: boolean; readonly isBlocks: boolean; readonly asBlocks: u32; @@ -2532,43 +2536,43 @@ declare module '@polkadot/types/lookup' { } /** @name UpDataStructsCollectionPermissions (247) */ - export interface UpDataStructsCollectionPermissions extends Struct { + interface UpDataStructsCollectionPermissions extends Struct { readonly access: Option; readonly mintMode: Option; readonly nesting: Option; } /** @name UpDataStructsNestingPermissions (249) */ - export interface UpDataStructsNestingPermissions extends Struct { + interface UpDataStructsNestingPermissions extends Struct { readonly tokenOwner: bool; readonly collectionAdmin: bool; readonly restricted: Option; } /** @name UpDataStructsOwnerRestrictedSet (251) */ - export interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} + interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} /** @name UpDataStructsPropertyKeyPermission (256) */ - export interface UpDataStructsPropertyKeyPermission extends Struct { + interface UpDataStructsPropertyKeyPermission extends Struct { readonly key: Bytes; readonly permission: UpDataStructsPropertyPermission; } /** @name UpDataStructsPropertyPermission (257) */ - export interface UpDataStructsPropertyPermission extends Struct { + interface UpDataStructsPropertyPermission extends Struct { readonly mutable: bool; readonly collectionAdmin: bool; readonly tokenOwner: bool; } /** @name UpDataStructsProperty (260) */ - export interface UpDataStructsProperty extends Struct { + interface UpDataStructsProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } /** @name UpDataStructsCreateItemData (263) */ - export interface UpDataStructsCreateItemData extends Enum { + interface UpDataStructsCreateItemData extends Enum { readonly isNft: boolean; readonly asNft: UpDataStructsCreateNftData; readonly isFungible: boolean; @@ -2579,23 +2583,23 @@ declare module '@polkadot/types/lookup' { } /** @name UpDataStructsCreateNftData (264) */ - export interface UpDataStructsCreateNftData extends Struct { + interface UpDataStructsCreateNftData extends Struct { readonly properties: Vec; } /** @name UpDataStructsCreateFungibleData (265) */ - export interface UpDataStructsCreateFungibleData extends Struct { + interface UpDataStructsCreateFungibleData extends Struct { readonly value: u128; } /** @name UpDataStructsCreateReFungibleData (266) */ - export interface UpDataStructsCreateReFungibleData extends Struct { + interface UpDataStructsCreateReFungibleData extends Struct { readonly pieces: u128; readonly properties: Vec; } /** @name UpDataStructsCreateItemExData (269) */ - export interface UpDataStructsCreateItemExData extends Enum { + interface UpDataStructsCreateItemExData extends Enum { readonly isNft: boolean; readonly asNft: Vec; readonly isFungible: boolean; @@ -2608,26 +2612,26 @@ declare module '@polkadot/types/lookup' { } /** @name UpDataStructsCreateNftExData (271) */ - export interface UpDataStructsCreateNftExData extends Struct { + interface UpDataStructsCreateNftExData extends Struct { readonly properties: Vec; readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } /** @name UpDataStructsCreateRefungibleExSingleOwner (278) */ - export interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { + interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { readonly user: PalletEvmAccountBasicCrossAccountIdRepr; readonly pieces: u128; readonly properties: Vec; } /** @name UpDataStructsCreateRefungibleExMultipleOwners (280) */ - export interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { + interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { readonly users: BTreeMap; readonly properties: Vec; } /** @name PalletUniqueSchedulerCall (281) */ - export interface PalletUniqueSchedulerCall extends Enum { + interface PalletUniqueSchedulerCall extends Enum { readonly isScheduleNamed: boolean; readonly asScheduleNamed: { readonly id: U8aFixed; @@ -2652,7 +2656,7 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSupportScheduleMaybeHashed (283) */ - export interface FrameSupportScheduleMaybeHashed extends Enum { + interface FrameSupportScheduleMaybeHashed extends Enum { readonly isValue: boolean; readonly asValue: Call; readonly isHash: boolean; @@ -2661,7 +2665,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletConfigurationCall (284) */ - export interface PalletConfigurationCall extends Enum { + interface PalletConfigurationCall extends Enum { readonly isSetWeightToFeeCoefficientOverride: boolean; readonly asSetWeightToFeeCoefficientOverride: { readonly coeff: Option; @@ -2674,13 +2678,13 @@ declare module '@polkadot/types/lookup' { } /** @name PalletTemplateTransactionPaymentCall (285) */ - export type PalletTemplateTransactionPaymentCall = Null; + type PalletTemplateTransactionPaymentCall = Null; /** @name PalletStructureCall (286) */ - export type PalletStructureCall = Null; + type PalletStructureCall = Null; /** @name PalletRmrkCoreCall (287) */ - export interface PalletRmrkCoreCall extends Enum { + interface PalletRmrkCoreCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { readonly metadata: Bytes; @@ -2786,7 +2790,7 @@ declare module '@polkadot/types/lookup' { } /** @name RmrkTraitsResourceResourceTypes (293) */ - export interface RmrkTraitsResourceResourceTypes extends Enum { + interface RmrkTraitsResourceResourceTypes extends Enum { readonly isBasic: boolean; readonly asBasic: RmrkTraitsResourceBasicResource; readonly isComposable: boolean; @@ -2797,7 +2801,7 @@ declare module '@polkadot/types/lookup' { } /** @name RmrkTraitsResourceBasicResource (295) */ - export interface RmrkTraitsResourceBasicResource extends Struct { + interface RmrkTraitsResourceBasicResource extends Struct { readonly src: Option; readonly metadata: Option; readonly license: Option; @@ -2805,7 +2809,7 @@ declare module '@polkadot/types/lookup' { } /** @name RmrkTraitsResourceComposableResource (297) */ - export interface RmrkTraitsResourceComposableResource extends Struct { + interface RmrkTraitsResourceComposableResource extends Struct { readonly parts: Vec; readonly base: u32; readonly src: Option; @@ -2815,7 +2819,7 @@ declare module '@polkadot/types/lookup' { } /** @name RmrkTraitsResourceSlotResource (298) */ - export interface RmrkTraitsResourceSlotResource extends Struct { + interface RmrkTraitsResourceSlotResource extends Struct { readonly base: u32; readonly src: Option; readonly metadata: Option; @@ -2825,7 +2829,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletRmrkEquipCall (301) */ - export interface PalletRmrkEquipCall extends Enum { + interface PalletRmrkEquipCall extends Enum { readonly isCreateBase: boolean; readonly asCreateBase: { readonly baseType: Bytes; @@ -2847,7 +2851,7 @@ declare module '@polkadot/types/lookup' { } /** @name RmrkTraitsPartPartType (304) */ - export interface RmrkTraitsPartPartType extends Enum { + interface RmrkTraitsPartPartType extends Enum { readonly isFixedPart: boolean; readonly asFixedPart: RmrkTraitsPartFixedPart; readonly isSlotPart: boolean; @@ -2856,14 +2860,14 @@ declare module '@polkadot/types/lookup' { } /** @name RmrkTraitsPartFixedPart (306) */ - export interface RmrkTraitsPartFixedPart extends Struct { + interface RmrkTraitsPartFixedPart extends Struct { readonly id: u32; readonly z: u32; readonly src: Bytes; } /** @name RmrkTraitsPartSlotPart (307) */ - export interface RmrkTraitsPartSlotPart extends Struct { + interface RmrkTraitsPartSlotPart extends Struct { readonly id: u32; readonly equippable: RmrkTraitsPartEquippableList; readonly src: Bytes; @@ -2871,7 +2875,7 @@ declare module '@polkadot/types/lookup' { } /** @name RmrkTraitsPartEquippableList (308) */ - export interface RmrkTraitsPartEquippableList extends Enum { + interface RmrkTraitsPartEquippableList extends Enum { readonly isAll: boolean; readonly isEmpty: boolean; readonly isCustom: boolean; @@ -2880,20 +2884,20 @@ declare module '@polkadot/types/lookup' { } /** @name RmrkTraitsTheme (310) */ - export interface RmrkTraitsTheme extends Struct { + interface RmrkTraitsTheme extends Struct { readonly name: Bytes; readonly properties: Vec; readonly inherit: bool; } /** @name RmrkTraitsThemeThemeProperty (312) */ - export interface RmrkTraitsThemeThemeProperty extends Struct { + interface RmrkTraitsThemeThemeProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } /** @name PalletForeingAssetsModuleCall (314) */ - export interface PalletForeingAssetsModuleCall extends Enum { + interface PalletForeingAssetsModuleCall extends Enum { readonly isRegisterForeignAsset: boolean; readonly asRegisterForeignAsset: { readonly owner: AccountId32; @@ -2910,7 +2914,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletEvmCall (315) */ - export interface PalletEvmCall extends Enum { + interface PalletEvmCall extends Enum { readonly isWithdraw: boolean; readonly asWithdraw: { readonly address: H160; @@ -2955,7 +2959,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletEthereumCall (319) */ - export interface PalletEthereumCall extends Enum { + interface PalletEthereumCall extends Enum { readonly isTransact: boolean; readonly asTransact: { readonly transaction: EthereumTransactionTransactionV2; @@ -2964,7 +2968,7 @@ declare module '@polkadot/types/lookup' { } /** @name EthereumTransactionTransactionV2 (320) */ - export interface EthereumTransactionTransactionV2 extends Enum { + interface EthereumTransactionTransactionV2 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumTransactionLegacyTransaction; readonly isEip2930: boolean; @@ -2975,7 +2979,7 @@ declare module '@polkadot/types/lookup' { } /** @name EthereumTransactionLegacyTransaction (321) */ - export interface EthereumTransactionLegacyTransaction extends Struct { + interface EthereumTransactionLegacyTransaction extends Struct { readonly nonce: U256; readonly gasPrice: U256; readonly gasLimit: U256; @@ -2986,7 +2990,7 @@ declare module '@polkadot/types/lookup' { } /** @name EthereumTransactionTransactionAction (322) */ - export interface EthereumTransactionTransactionAction extends Enum { + interface EthereumTransactionTransactionAction extends Enum { readonly isCall: boolean; readonly asCall: H160; readonly isCreate: boolean; @@ -2994,14 +2998,14 @@ declare module '@polkadot/types/lookup' { } /** @name EthereumTransactionTransactionSignature (323) */ - export interface EthereumTransactionTransactionSignature extends Struct { + interface EthereumTransactionTransactionSignature extends Struct { readonly v: u64; readonly r: H256; readonly s: H256; } /** @name EthereumTransactionEip2930Transaction (325) */ - export interface EthereumTransactionEip2930Transaction extends Struct { + interface EthereumTransactionEip2930Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; readonly gasPrice: U256; @@ -3016,13 +3020,13 @@ declare module '@polkadot/types/lookup' { } /** @name EthereumTransactionAccessListItem (327) */ - export interface EthereumTransactionAccessListItem extends Struct { + interface EthereumTransactionAccessListItem extends Struct { readonly address: H160; readonly storageKeys: Vec; } /** @name EthereumTransactionEip1559Transaction (328) */ - export interface EthereumTransactionEip1559Transaction extends Struct { + interface EthereumTransactionEip1559Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; readonly maxPriorityFeePerGas: U256; @@ -3038,7 +3042,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletEvmMigrationCall (329) */ - export interface PalletEvmMigrationCall extends Enum { + interface PalletEvmMigrationCall extends Enum { readonly isBegin: boolean; readonly asBegin: { readonly address: H160; @@ -3057,13 +3061,13 @@ declare module '@polkadot/types/lookup' { } /** @name PalletSudoError (332) */ - export interface PalletSudoError extends Enum { + interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: 'RequireSudo'; } /** @name OrmlVestingModuleError (334) */ - export interface OrmlVestingModuleError extends Enum { + interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; readonly isInsufficientBalanceToLock: boolean; @@ -3074,7 +3078,7 @@ declare module '@polkadot/types/lookup' { } /** @name OrmlXtokensModuleError (335) */ - export interface OrmlXtokensModuleError extends Enum { + interface OrmlXtokensModuleError extends Enum { readonly isAssetHasNoReserve: boolean; readonly isNotCrossChainTransfer: boolean; readonly isInvalidDest: boolean; @@ -3098,26 +3102,26 @@ declare module '@polkadot/types/lookup' { } /** @name OrmlTokensBalanceLock (338) */ - export interface OrmlTokensBalanceLock extends Struct { + interface OrmlTokensBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; } /** @name OrmlTokensAccountData (340) */ - export interface OrmlTokensAccountData extends Struct { + interface OrmlTokensAccountData extends Struct { readonly free: u128; readonly reserved: u128; readonly frozen: u128; } /** @name OrmlTokensReserveData (342) */ - export interface OrmlTokensReserveData extends Struct { + interface OrmlTokensReserveData extends Struct { readonly id: Null; readonly amount: u128; } /** @name OrmlTokensModuleError (344) */ - export interface OrmlTokensModuleError extends Enum { + interface OrmlTokensModuleError extends Enum { readonly isBalanceTooLow: boolean; readonly isAmountIntoBalanceFailed: boolean; readonly isLiquidityRestrictions: boolean; @@ -3130,21 +3134,21 @@ declare module '@polkadot/types/lookup' { } /** @name CumulusPalletXcmpQueueInboundChannelDetails (346) */ - export interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { + interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } /** @name CumulusPalletXcmpQueueInboundState (347) */ - export interface CumulusPalletXcmpQueueInboundState extends Enum { + interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } /** @name PolkadotParachainPrimitivesXcmpMessageFormat (350) */ - export interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { + interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; readonly isSignals: boolean; @@ -3152,7 +3156,7 @@ declare module '@polkadot/types/lookup' { } /** @name CumulusPalletXcmpQueueOutboundChannelDetails (353) */ - export interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { + interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; readonly signalsExist: bool; @@ -3161,14 +3165,14 @@ declare module '@polkadot/types/lookup' { } /** @name CumulusPalletXcmpQueueOutboundState (354) */ - export interface CumulusPalletXcmpQueueOutboundState extends Enum { + interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } /** @name CumulusPalletXcmpQueueQueueConfigData (356) */ - export interface CumulusPalletXcmpQueueQueueConfigData extends Struct { + interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; readonly resumeThreshold: u32; @@ -3178,7 +3182,7 @@ declare module '@polkadot/types/lookup' { } /** @name CumulusPalletXcmpQueueError (358) */ - export interface CumulusPalletXcmpQueueError extends Enum { + interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; readonly isBadXcm: boolean; @@ -3188,7 +3192,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletXcmError (359) */ - export interface PalletXcmError extends Enum { + interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; readonly isFiltered: boolean; @@ -3206,29 +3210,29 @@ declare module '@polkadot/types/lookup' { } /** @name CumulusPalletXcmError (360) */ - export type CumulusPalletXcmError = Null; + type CumulusPalletXcmError = Null; /** @name CumulusPalletDmpQueueConfigData (361) */ - export interface CumulusPalletDmpQueueConfigData extends Struct { + interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: u64; } /** @name CumulusPalletDmpQueuePageIndexData (362) */ - export interface CumulusPalletDmpQueuePageIndexData extends Struct { + interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } /** @name CumulusPalletDmpQueueError (365) */ - export interface CumulusPalletDmpQueueError extends Enum { + interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } /** @name PalletUniqueError (369) */ - export interface PalletUniqueError extends Enum { + interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; readonly isEmptyArgument: boolean; @@ -3237,7 +3241,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletUniqueSchedulerScheduledV3 (372) */ - export interface PalletUniqueSchedulerScheduledV3 extends Struct { + interface PalletUniqueSchedulerScheduledV3 extends Struct { readonly maybeId: Option; readonly priority: u8; readonly call: FrameSupportScheduleMaybeHashed; @@ -3246,7 +3250,7 @@ declare module '@polkadot/types/lookup' { } /** @name OpalRuntimeOriginCaller (373) */ - export interface OpalRuntimeOriginCaller extends Enum { + interface OpalRuntimeOriginCaller extends Enum { readonly isSystem: boolean; readonly asSystem: FrameSupportDispatchRawOrigin; readonly isVoid: boolean; @@ -3260,7 +3264,7 @@ declare module '@polkadot/types/lookup' { } /** @name FrameSupportDispatchRawOrigin (374) */ - export interface FrameSupportDispatchRawOrigin extends Enum { + interface FrameSupportDispatchRawOrigin extends Enum { readonly isRoot: boolean; readonly isSigned: boolean; readonly asSigned: AccountId32; @@ -3269,7 +3273,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletXcmOrigin (375) */ - export interface PalletXcmOrigin extends Enum { + interface PalletXcmOrigin extends Enum { readonly isXcm: boolean; readonly asXcm: XcmV1MultiLocation; readonly isResponse: boolean; @@ -3278,7 +3282,7 @@ declare module '@polkadot/types/lookup' { } /** @name CumulusPalletXcmOrigin (376) */ - export interface CumulusPalletXcmOrigin extends Enum { + interface CumulusPalletXcmOrigin extends Enum { readonly isRelay: boolean; readonly isSiblingParachain: boolean; readonly asSiblingParachain: u32; @@ -3286,17 +3290,17 @@ declare module '@polkadot/types/lookup' { } /** @name PalletEthereumRawOrigin (377) */ - export interface PalletEthereumRawOrigin extends Enum { + interface PalletEthereumRawOrigin extends Enum { readonly isEthereumTransaction: boolean; readonly asEthereumTransaction: H160; readonly type: 'EthereumTransaction'; } /** @name SpCoreVoid (378) */ - export type SpCoreVoid = Null; + type SpCoreVoid = Null; /** @name PalletUniqueSchedulerError (379) */ - export interface PalletUniqueSchedulerError extends Enum { + interface PalletUniqueSchedulerError extends Enum { readonly isFailedToSchedule: boolean; readonly isNotFound: boolean; readonly isTargetBlockNumberInPast: boolean; @@ -3305,20 +3309,20 @@ declare module '@polkadot/types/lookup' { } /** @name UpDataStructsCollection (380) */ - export interface UpDataStructsCollection extends Struct { + interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; readonly name: Vec; readonly description: Vec; readonly tokenPrefix: Bytes; - readonly sponsorship: UpDataStructsSponsorshipState; + readonly sponsorship: UpDataStructsSponsorshipStateAccountId32; readonly limits: UpDataStructsCollectionLimits; readonly permissions: UpDataStructsCollectionPermissions; readonly externalCollection: bool; } - /** @name UpDataStructsSponsorshipState (381) */ - export interface UpDataStructsSponsorshipState extends Enum { + /** @name UpDataStructsSponsorshipStateAccountId32 (381) */ + interface UpDataStructsSponsorshipStateAccountId32 extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; readonly asUnconfirmed: AccountId32; @@ -3328,49 +3332,49 @@ declare module '@polkadot/types/lookup' { } /** @name UpDataStructsProperties (382) */ - export interface UpDataStructsProperties extends Struct { + interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } /** @name UpDataStructsPropertiesMapBoundedVec (383) */ - export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} + interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} /** @name UpDataStructsPropertiesMapPropertyPermission (388) */ - export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} + interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} /** @name UpDataStructsCollectionStats (395) */ - export interface UpDataStructsCollectionStats extends Struct { + interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } /** @name UpDataStructsTokenChild (396) */ - export interface UpDataStructsTokenChild extends Struct { + interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } /** @name PhantomTypeUpDataStructs (397) */ - export interface PhantomTypeUpDataStructs extends Vec> {} + interface PhantomTypeUpDataStructs extends Vec> {} /** @name UpDataStructsTokenData (399) */ - export interface UpDataStructsTokenData extends Struct { + interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } /** @name UpDataStructsRpcCollection (401) */ - export interface UpDataStructsRpcCollection extends Struct { + interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; readonly name: Vec; readonly description: Vec; readonly tokenPrefix: Bytes; - readonly sponsorship: UpDataStructsSponsorshipState; + readonly sponsorship: UpDataStructsSponsorshipStateAccountId32; readonly limits: UpDataStructsCollectionLimits; readonly permissions: UpDataStructsCollectionPermissions; readonly tokenPropertyPermissions: Vec; @@ -3379,7 +3383,7 @@ declare module '@polkadot/types/lookup' { } /** @name RmrkTraitsCollectionCollectionInfo (402) */ - export interface RmrkTraitsCollectionCollectionInfo extends Struct { + interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; readonly max: Option; @@ -3388,7 +3392,7 @@ declare module '@polkadot/types/lookup' { } /** @name RmrkTraitsNftNftInfo (403) */ - export interface RmrkTraitsNftNftInfo extends Struct { + interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; readonly metadata: Bytes; @@ -3397,13 +3401,13 @@ declare module '@polkadot/types/lookup' { } /** @name RmrkTraitsNftRoyaltyInfo (405) */ - export interface RmrkTraitsNftRoyaltyInfo extends Struct { + interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } /** @name RmrkTraitsResourceResourceInfo (406) */ - export interface RmrkTraitsResourceResourceInfo extends Struct { + interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; readonly pending: bool; @@ -3411,26 +3415,26 @@ declare module '@polkadot/types/lookup' { } /** @name RmrkTraitsPropertyPropertyInfo (407) */ - export interface RmrkTraitsPropertyPropertyInfo extends Struct { + interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } /** @name RmrkTraitsBaseBaseInfo (408) */ - export interface RmrkTraitsBaseBaseInfo extends Struct { + interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } /** @name RmrkTraitsNftNftChild (409) */ - export interface RmrkTraitsNftNftChild extends Struct { + interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } /** @name PalletCommonError (411) */ - export interface PalletCommonError extends Enum { + interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; readonly isNoPermission: boolean; @@ -3469,7 +3473,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletFungibleError (413) */ - export interface PalletFungibleError extends Enum { + interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; readonly isFungibleItemsDontHaveData: boolean; @@ -3479,12 +3483,12 @@ declare module '@polkadot/types/lookup' { } /** @name PalletRefungibleItemData (414) */ - export interface PalletRefungibleItemData extends Struct { + interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } /** @name PalletRefungibleError (419) */ - export interface PalletRefungibleError extends Enum { + interface PalletRefungibleError extends Enum { readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isWrongRefungiblePieces: boolean; readonly isRepartitionWhileNotOwningAllPieces: boolean; @@ -3494,20 +3498,19 @@ declare module '@polkadot/types/lookup' { } /** @name PalletNonfungibleItemData (420) */ - export interface PalletNonfungibleItemData extends Struct { + interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } /** @name UpDataStructsPropertyScope (422) */ - export interface UpDataStructsPropertyScope extends Enum { + interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; - readonly isEth: boolean; - readonly type: 'None' | 'Rmrk' | 'Eth'; + readonly type: 'None' | 'Rmrk'; } /** @name PalletNonfungibleError (424) */ - export interface PalletNonfungibleError extends Enum { + interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; readonly isCantBurnNftWithChildren: boolean; @@ -3515,7 +3518,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletStructureError (425) */ - export interface PalletStructureError extends Enum { + interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; readonly isBreadthLimit: boolean; @@ -3524,7 +3527,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletRmrkCoreError (426) */ - export interface PalletRmrkCoreError extends Enum { + interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; readonly isRmrkPropertyValueIsTooLong: boolean; @@ -3548,7 +3551,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletRmrkEquipError (428) */ - export interface PalletRmrkEquipError extends Enum { + interface PalletRmrkEquipError extends Enum { readonly isPermissionError: boolean; readonly isNoAvailableBaseId: boolean; readonly isNoAvailablePartId: boolean; @@ -3560,7 +3563,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletForeingAssetsModuleError (429) */ - export interface PalletForeingAssetsModuleError extends Enum { + interface PalletForeingAssetsModuleError extends Enum { readonly isBadLocation: boolean; readonly isMultiLocationExisted: boolean; readonly isAssetIdNotExists: boolean; @@ -3569,7 +3572,7 @@ declare module '@polkadot/types/lookup' { } /** @name PalletEvmError (432) */ - export interface PalletEvmError extends Enum { + interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; readonly isPaymentOverflow: boolean; @@ -3580,7 +3583,7 @@ declare module '@polkadot/types/lookup' { } /** @name FpRpcTransactionStatus (435) */ - export interface FpRpcTransactionStatus extends Struct { + interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; readonly from: H160; @@ -3591,10 +3594,10 @@ declare module '@polkadot/types/lookup' { } /** @name EthbloomBloom (437) */ - export interface EthbloomBloom extends U8aFixed {} + interface EthbloomBloom extends U8aFixed {} /** @name EthereumReceiptReceiptV3 (439) */ - export interface EthereumReceiptReceiptV3 extends Enum { + interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; readonly isEip2930: boolean; @@ -3605,7 +3608,7 @@ declare module '@polkadot/types/lookup' { } /** @name EthereumReceiptEip658ReceiptData (440) */ - export interface EthereumReceiptEip658ReceiptData extends Struct { + interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; readonly logsBloom: EthbloomBloom; @@ -3613,14 +3616,14 @@ declare module '@polkadot/types/lookup' { } /** @name EthereumBlock (441) */ - export interface EthereumBlock extends Struct { + interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } /** @name EthereumHeader (442) */ - export interface EthereumHeader extends Struct { + interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; readonly beneficiary: H160; @@ -3639,45 +3642,56 @@ declare module '@polkadot/types/lookup' { } /** @name EthereumTypesHashH64 (443) */ - export interface EthereumTypesHashH64 extends U8aFixed {} + interface EthereumTypesHashH64 extends U8aFixed {} /** @name PalletEthereumError (448) */ - export interface PalletEthereumError extends Enum { + interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } /** @name PalletEvmCoderSubstrateError (449) */ - export interface PalletEvmCoderSubstrateError extends Enum { + interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name PalletEvmContractHelpersSponsoringModeT (450) */ - export interface PalletEvmContractHelpersSponsoringModeT extends Enum { + /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (450) */ + interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum { + readonly isDisabled: boolean; + readonly isUnconfirmed: boolean; + readonly asUnconfirmed: PalletEvmAccountBasicCrossAccountIdRepr; + readonly isConfirmed: boolean; + readonly asConfirmed: PalletEvmAccountBasicCrossAccountIdRepr; + readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; + } + + /** @name PalletEvmContractHelpersSponsoringModeT (451) */ + interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; readonly isGenerous: boolean; readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (452) */ - export interface PalletEvmContractHelpersError extends Enum { + /** @name PalletEvmContractHelpersError (453) */ + interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; - readonly type: 'NoPermission'; + readonly isNoPendingSponsor: boolean; + readonly type: 'NoPermission' | 'NoPendingSponsor'; } - /** @name PalletEvmMigrationError (453) */ - export interface PalletEvmMigrationError extends Enum { + /** @name PalletEvmMigrationError (454) */ + interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (455) */ - export interface SpRuntimeMultiSignature extends Enum { + /** @name SpRuntimeMultiSignature (456) */ + interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; readonly isSr25519: boolean; @@ -3687,34 +3701,34 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (456) */ - export interface SpCoreEd25519Signature extends U8aFixed {} + /** @name SpCoreEd25519Signature (457) */ + interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (458) */ - export interface SpCoreSr25519Signature extends U8aFixed {} + /** @name SpCoreSr25519Signature (459) */ + interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (459) */ - export interface SpCoreEcdsaSignature extends U8aFixed {} + /** @name SpCoreEcdsaSignature (460) */ + interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (462) */ - export type FrameSystemExtensionsCheckSpecVersion = Null; + /** @name FrameSystemExtensionsCheckSpecVersion (463) */ + type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (463) */ - export type FrameSystemExtensionsCheckGenesis = Null; + /** @name FrameSystemExtensionsCheckGenesis (464) */ + type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (466) */ - export interface FrameSystemExtensionsCheckNonce extends Compact {} + /** @name FrameSystemExtensionsCheckNonce (467) */ + interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (467) */ - export type FrameSystemExtensionsCheckWeight = Null; + /** @name FrameSystemExtensionsCheckWeight (468) */ + type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (468) */ - export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (469) */ + interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (469) */ - export type OpalRuntimeRuntime = Null; + /** @name OpalRuntimeRuntime (470) */ + type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (470) */ - export type PalletEthereumFakeTransactionFinalizer = Null; + /** @name PalletEthereumFakeTransactionFinalizer (471) */ + type PalletEthereumFakeTransactionFinalizer = Null; } // declare module From 4c2d15438fb253354cac509120c4cb071d370ab5 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 1 Sep 2022 18:13:07 +0700 Subject: [PATCH 0662/1274] change trugger for xcm-tests --- .github/workflows/xcm-testnet-build.yml | 6 +++++- .github/workflows/xcm-tests.yml | 23 ++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 85e976a85d..610c11a6e6 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -144,12 +144,16 @@ jobs: - name: Build the stack run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . - - name: Push docker version image + - name: Push docker image version run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} - name: Push docker image latest run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest + - name: Clean Workspace + if: always() + uses: AutoModality/action-clean@v1.1.0 + - name: Remove builder cache if: always() # run this step always run: | diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index 581b0f2d41..29b5af44ff 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -7,14 +7,14 @@ on: workflows: ["xcm-testnet-build"] types: [requested] # Triggers the workflow on push or pull request events but only for the master branch - # pull_request: - # branches: - # - master - # types: - # - opened - # - reopened - # - synchronize #commit(s) pushed to the pull request - # - ready_for_review + pull_request: + branches: + - master + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + - ready_for_review # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -178,11 +178,12 @@ jobs: if: always() # run this step always run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down + - name: Clean Workspace + if: always() + uses: AutoModality/action-clean@v1.1.0 + - name: Remove builder cache if: always() # run this step always run: | docker system prune -a -f - - name: Clean Workspace - if: always() - uses: AutoModality/action-clean@v1.1.0 From 4e467ba1be94b795d1c68ec62d9e9e68dd63c472 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 1 Sep 2022 18:28:05 +0700 Subject: [PATCH 0663/1274] change trugger for xcm-tests --- .github/workflows/xcm-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index 29b5af44ff..7347ce252d 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -5,7 +5,8 @@ on: # Triggers the workflow after xcm-testnet-build workflow_run: workflows: ["xcm-testnet-build"] - types: [requested] + types: + - completed # Triggers the workflow on push or pull request events but only for the master branch pull_request: branches: From 33ed679d9290a8097a25f04020b4627575579e80 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Thu, 1 Sep 2022 18:46:52 +0700 Subject: [PATCH 0664/1274] fix lock and unstake logic --- pallets/app-promotion/src/lib.rs | 100 ++++++++++--------------------- 1 file changed, 32 insertions(+), 68 deletions(-) diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 6a4ed57612..cbe74fd8ac 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -59,7 +59,7 @@ pub use pallet::*; use pallet_evm::account::CrossAccountId; use sp_runtime::{ Perbill, - traits::{BlockNumberProvider, CheckedAdd, CheckedSub, AccountIdConversion}, + traits::{BlockNumberProvider, CheckedAdd, CheckedSub, AccountIdConversion, Zero}, ArithmeticError, }; @@ -169,6 +169,10 @@ pub mod pallet { Value = (BalanceOf, T::BlockNumber), QueryKind = ValueQuery, >; + /// Amount of stakes for an Account + #[pallet::storage] + pub type StakesPerAccount = + StorageMap<_, Blake2_128Concat, T::AccountId, u8, ValueQuery>; /// Amount of tokens pending unstake per user per block. #[pallet::storage] @@ -209,7 +213,7 @@ pub mod pallet { // consumed_weight += T::DbWeight::get().reads_writes(reads, writes); // consumed_weight += weight; // }; - + let current_relay_block = T::RelayBlockNumberProvider::current_block_number(); PendingUnstake::::iter() .filter_map(|((staker, block), amount)| { @@ -220,7 +224,7 @@ pub mod pallet { } }) .for_each(|(staker, block, amount)| { - Self::unlock_balance_unchecked(&staker, amount); + Self::unlock_balance_unchecked(&staker, amount); >::remove((staker, block)); }); @@ -314,11 +318,18 @@ pub mod pallet { pub fn stake(staker: OriginFor, amount: BalanceOf) -> DispatchResult { let staker_id = ensure_signed(staker)?; + ensure!( + StakesPerAccount::::get(&staker_id) < 10, + Error::::NoPermission + ); + ensure!( amount >= Into::>::into(100u128) * T::Nominal::get(), ArithmeticError::Underflow ); + let count = Staked::::iter_prefix((staker_id.clone(),)).count(); + let balance = <::Currency as Currency>::free_balance(&staker_id); @@ -353,6 +364,7 @@ pub mod pallet { .ok_or(ArithmeticError::Overflow)?, ); + StakesPerAccount::::mutate(&staker_id, |stakes| *stakes += 1); Ok(()) } @@ -364,11 +376,14 @@ pub mod pallet { let total_staked: BalanceOf = Staked::::drain_prefix((&staker_id,)) .map(|(_, (amount, _))| { - *&mut total_stakes += 1; + total_stakes += 1; amount }) .sum(); - + + if total_staked.is_zero() { + return Ok(None.into()); + } let block = T::RelayBlockNumberProvider::current_block_number() + T::PendingInterval::get(); >::insert( @@ -384,64 +399,9 @@ pub mod pallet { .ok_or(ArithmeticError::Underflow)?, ); // when error we should recover initial stake state for the staker - Ok(None.into()) + StakesPerAccount::::remove(&staker_id); - // let staker_id = ensure_signed(staker)?; - - // let mut stakes = Staked::::iter_prefix((&staker_id,)).collect::>(); - - // let total_staked = stakes - // .iter() - // .fold(>::default(), |acc, (_, amount)| acc + *amount); - - // ensure!(total_staked >= amount, ArithmeticError::Underflow); - - // >::set( - // >::get() - // .checked_sub(&amount) - // .ok_or(ArithmeticError::Underflow)?, - // ); - - // let block = - // T::RelayBlockNumberProvider::current_block_number() + T::PendingInterval::get(); - // >::insert( - // (&staker_id, block), - // >::get((&staker_id, block)) - // .checked_add(&amount) - // .ok_or(ArithmeticError::Overflow)?, - // ); - - // stakes.sort_by_key(|(block, _)| *block); - - // let mut acc_amount = amount; - // let new_state = stakes - // .into_iter() - // .map_while(|(block, balance_per_block)| { - // if acc_amount == >::default() { - // return None; - // } - // if acc_amount <= balance_per_block { - // let res = (block, balance_per_block - acc_amount, acc_amount); - // acc_amount = >::default(); - // return Some(res); - // } else { - // acc_amount -= balance_per_block; - // return Some((block, >::default(), acc_amount)); - // } - // }) - // .collect::>(); - - // new_state - // .into_iter() - // .for_each(|(block, to_staked, _to_pending)| { - // if to_staked == >::default() { - // >::remove((&staker_id, block)); - // } else { - // >::insert((&staker_id, block), to_staked); - // } - // }); - - // Ok(()) + Ok(None.into()) } #[pallet::weight(T::WeightInfo::sponsor_collection())] @@ -601,12 +561,16 @@ impl Pallet { } fn set_lock_unchecked(staker: &T::AccountId, amount: BalanceOf) { - >::set_lock( - LOCK_IDENTIFIER, - staker, - amount, - WithdrawReasons::all(), - ) + if amount.is_zero() { + >::remove_lock(LOCK_IDENTIFIER, &staker); + } else { + >::set_lock( + LOCK_IDENTIFIER, + staker, + amount, + WithdrawReasons::all(), + ) + } } pub fn get_locked_balance( From f8428bb9d7d3a5e382d8fd31b4c94a664b443016 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Thu, 1 Sep 2022 19:31:31 +0700 Subject: [PATCH 0665/1274] fix logic for payout_stakers --- pallets/app-promotion/src/lib.rs | 8 +++----- tests/src/app-promotion.test.ts | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index cbe74fd8ac..d9a695e0a7 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -328,8 +328,6 @@ pub mod pallet { ArithmeticError::Underflow ); - let count = Staked::::iter_prefix((staker_id.clone(),)).count(); - let balance = <::Currency as Currency>::free_balance(&staker_id); @@ -380,7 +378,7 @@ pub mod pallet { amount }) .sum(); - + if total_staked.is_zero() { return Ok(None.into()); } @@ -521,13 +519,13 @@ pub mod pallet { income_acc = BalanceOf::::default(); current_id = id; }; - if next_recalc_block_for_stake >= current_recalc_block { + if current_recalc_block >= next_recalc_block_for_stake { Self::recalculate_and_insert_stake( ¤t_id, staked_block, next_recalc_block, amount, - ((next_recalc_block_for_stake - current_recalc_block) + ((current_recalc_block - next_recalc_block_for_stake) / T::RecalculationInterval::get()) .into() + 1, &mut income_acc, diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 0740ce598c..f3194f9755 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -621,7 +621,7 @@ describe('app-promotion rewards', () => { await helper.staking.stake(staker, 100n * nominal); await helper.staking.stake(staker, 200n * nominal); - await waitForRelayBlock(helper.api!, 55); + await waitForRelayBlock(helper.api!, 40); await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(50)); const totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); @@ -663,7 +663,7 @@ describe('app-promotion rewards', () => { await waitForRelayBlock(helper.api!, 20); await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(50)); totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); - expect(totalStakedPerBlock).to.deep.equal([calculateIncome(10n * nominal, 10n, 2), calculateIncome(20n * nominal, 10n, 2), calculateIncome(30n * nominal, 10n, 2)]); + expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n, 2), calculateIncome(200n * nominal, 10n, 2), calculateIncome(300n * nominal, 10n, 2)]); }); }); From 081dbb6ae4fbabb2fc9ab4a4958ef1adbb5a49e1 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 1 Sep 2022 12:57:40 +0000 Subject: [PATCH 0666/1274] feat: Separate rpc calls to own group --- Cargo.lock | 22 ++++ client/rpc/Cargo.toml | 1 + client/rpc/src/lib.rs | 104 +++++++++++++----- node/cli/Cargo.toml | 1 + node/cli/src/service.rs | 3 + node/rpc/Cargo.toml | 1 + node/rpc/src/lib.rs | 6 + primitives/app_promotion_rpc/CHANGELOG.md | 5 + primitives/app_promotion_rpc/Cargo.toml | 29 +++++ primitives/app_promotion_rpc/src/lib.rs | 47 ++++++++ primitives/rpc/src/lib.rs | 6 - runtime/common/runtime_apis.rs | 34 +++++- runtime/opal/Cargo.toml | 2 + runtime/quartz/Cargo.toml | 3 + runtime/unique/Cargo.toml | 3 + .../interfaces/appPromotion/definitions.ts | 66 +++++++++++ tests/src/interfaces/appPromotion/index.ts | 4 + tests/src/interfaces/appPromotion/types.ts | 4 + tests/src/interfaces/augment-api-errors.ts | 8 +- tests/src/interfaces/augment-api-query.ts | 2 +- tests/src/interfaces/augment-api-rpc.ts | 42 +++---- tests/src/interfaces/augment-api-tx.ts | 15 ++- tests/src/interfaces/default/types.ts | 6 +- tests/src/interfaces/definitions.ts | 1 + tests/src/interfaces/lookup.ts | 6 +- tests/src/interfaces/types-lookup.ts | 6 +- tests/src/interfaces/types.ts | 1 + tests/src/interfaces/unique/definitions.ts | 25 ----- tests/src/substrate/substrate-api.ts | 1 + tests/src/util/playgrounds/unique.dev.ts | 1 + tests/src/util/playgrounds/unique.ts | 12 +- 31 files changed, 357 insertions(+), 110 deletions(-) create mode 100644 primitives/app_promotion_rpc/CHANGELOG.md create mode 100644 primitives/app_promotion_rpc/Cargo.toml create mode 100644 primitives/app_promotion_rpc/src/lib.rs create mode 100644 tests/src/interfaces/appPromotion/definitions.ts create mode 100644 tests/src/interfaces/appPromotion/index.ts create mode 100644 tests/src/interfaces/appPromotion/types.ts diff --git a/Cargo.lock b/Cargo.lock index 46b5c8f2a4..6abae7a21b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -112,6 +112,20 @@ version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "508b352bb5c066aac251f6daf6b36eccd03e8a88e8081cd44959ea277a3af9a8" +[[package]] +name = "app-promotion-rpc" +version = "0.1.0" +dependencies = [ + "pallet-common", + "pallet-evm", + "parity-scale-codec 3.1.5", + "sp-api", + "sp-core", + "sp-runtime", + "sp-std", + "up-data-structs", +] + [[package]] name = "approx" version = "0.5.1" @@ -5127,6 +5141,7 @@ checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" name = "opal-runtime" version = "0.9.27" dependencies = [ + "app-promotion-rpc", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -8358,6 +8373,7 @@ dependencies = [ name = "quartz-runtime" version = "0.9.27" dependencies = [ + "app-promotion-rpc", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -8381,6 +8397,7 @@ dependencies = [ "hex-literal", "log", "orml-vesting", + "pallet-app-promotion", "pallet-aura", "pallet-balances", "pallet-base-fee", @@ -12132,6 +12149,7 @@ name = "uc-rpc" version = "0.1.3" dependencies = [ "anyhow", + "app-promotion-rpc", "jsonrpsee", "pallet-common", "pallet-evm", @@ -12210,6 +12228,7 @@ checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" name = "unique-node" version = "0.9.27" dependencies = [ + "app-promotion-rpc", "clap", "cumulus-client-cli", "cumulus-client-collator", @@ -12298,6 +12317,7 @@ dependencies = [ name = "unique-rpc" version = "0.1.1" dependencies = [ + "app-promotion-rpc", "fc-db", "fc-mapping-sync", "fc-rpc", @@ -12347,6 +12367,7 @@ dependencies = [ name = "unique-runtime" version = "0.9.27" dependencies = [ + "app-promotion-rpc", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -12370,6 +12391,7 @@ dependencies = [ "hex-literal", "log", "orml-vesting", + "pallet-app-promotion", "pallet-aura", "pallet-balances", "pallet-base-fee", diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index 8ff392c5e7..fd60ee7183 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -8,6 +8,7 @@ edition = "2021" pallet-common = { default-features = false, path = '../../pallets/common' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } up-rpc = { path = "../../primitives/rpc" } +app-promotion-rpc = { path = "../../primitives/app_promotion_rpc"} rmrk-rpc = { path = "../../primitives/rmrk-rpc" } codec = { package = "parity-scale-codec", version = "3.1.2" } jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index 1b15b01dd9..5d24290e41 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -31,6 +31,7 @@ use up_data_structs::{ use sp_api::{BlockId, BlockT, ProvideRuntimeApi, ApiExt}; use sp_blockchain::HeaderBackend; use up_rpc::UniqueApi as UniqueRuntimeApi; +use app_promotion_rpc::AppPromotionApi as AppPromotionRuntimeApi; // RMRK use rmrk_rpc::RmrkApi as RmrkRuntimeApi; @@ -38,6 +39,7 @@ use up_data_structs::{ RmrkCollectionId, RmrkNftId, RmrkBaseId, RmrkNftChild, RmrkThemeName, RmrkResourceId, }; +pub use app_promotion_unique_rpc::AppPromotionApiServer; pub use rmrk_unique_rpc::RmrkApiServer; #[rpc(server)] @@ -244,39 +246,48 @@ pub trait UniqueApi { token_id: TokenId, at: Option, ) -> Result>; +} - /// Returns the total amount of staked tokens. - #[method(name = "unique_totalStaked")] - fn total_staked(&self, staker: Option, at: Option) - -> Result; +mod app_promotion_unique_rpc { + use super::*; + + #[rpc(server)] + #[async_trait] + pub trait AppPromotionApi { + /// Returns the total amount of staked tokens. + #[method(name = "appPromotion_totalStaked")] + fn total_staked(&self, staker: Option, at: Option) + -> Result; + + ///Returns the total amount of staked tokens per block when staked. + #[method(name = "appPromotion_totalStakedPerBlock")] + fn total_staked_per_block( + &self, + staker: CrossAccountId, + at: Option, + ) -> Result>; - ///Returns the total amount of staked tokens per block when staked. - #[method(name = "unique_totalStakedPerBlock")] - fn total_staked_per_block( - &self, - staker: CrossAccountId, - at: Option, - ) -> Result>; + /// Returns the total amount locked by staking tokens. + #[method(name = "appPromotion_totalStakingLocked")] + fn total_staking_locked(&self, staker: CrossAccountId, at: Option) + -> Result; - /// Returns the total amount locked by staking tokens. - #[method(name = "unique_totalStakingLocked")] - fn total_staking_locked(&self, staker: CrossAccountId, at: Option) - -> Result; + /// Returns the total amount of tokens pending withdrawal from staking. + #[method(name = "appPromotion_pendingUnstake")] + fn pending_unstake( + &self, + staker: Option, + at: Option, + ) -> Result; - /// Returns the total amount of tokens pending withdrawal from staking. - #[method(name = "unique_pendingUnstake")] - fn pending_unstake( - &self, - staker: Option, - at: Option, - ) -> Result; - /// Returns the total amount of tokens pending withdrawal from staking per block. - #[method(name = "unique_pendingUnstakePerBlock")] - fn pending_unstake_per_block( - &self, - staker: CrossAccountId, - at: Option, - ) -> Result>; + /// Returns the total amount of tokens pending withdrawal from staking per block. + #[method(name = "appPromotion_pendingUnstakePerBlock")] + fn pending_unstake_per_block( + &self, + staker: CrossAccountId, + at: Option, + ) -> Result>; + } } mod rmrk_unique_rpc { @@ -415,6 +426,20 @@ impl Unique { } } +pub struct AppPromotion { + client: Arc, + _marker: std::marker::PhantomData

, +} + +impl AppPromotion { + pub fn new(client: Arc) -> Self { + Self { + client, + _marker: Default::default(), + } + } +} + pub struct Rmrk { client: Arc, _marker: std::marker::PhantomData

, @@ -474,6 +499,12 @@ macro_rules! unique_api { }; } +macro_rules! app_promotion_api { + () => { + dyn AppPromotionRuntimeApi + }; +} + macro_rules! rmrk_api { () => { dyn RmrkRuntimeApi @@ -556,7 +587,20 @@ where pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option, unique_api); pass_method!(total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option => |o| o.map(|number| number.to_string()) , unique_api); pass_method!(token_owners(collection: CollectionId, token: TokenId) -> Vec, unique_api); - pass_method!(total_staked(staker: Option) -> String => |v| v.to_string(), unique_api); +} + +impl + app_promotion_unique_rpc::AppPromotionApiServer<::Hash, BlockNumber, CrossAccountId, AccountId> + for AppPromotion +where + Block: BlockT, + BlockNumber: Decode + Member + AtLeast32BitUnsigned, + AccountId: Decode, + C: 'static + ProvideRuntimeApi + HeaderBackend, + C::Api: AppPromotionRuntimeApi, + CrossAccountId: pallet_evm::account::CrossAccountId, +{ + pass_method!(total_staked(staker: Option) -> String => |v| v.to_string(), app_promotion_api); pass_method!(total_staked_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, String)> => |v| v .into_iter() diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index d32eed39b0..27563f1c71 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -318,6 +318,7 @@ fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-p pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } unique-rpc = { default-features = false, path = "../rpc" } +app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} rmrk-rpc = { path = "../../primitives/rmrk-rpc" } [features] diff --git a/node/cli/src/service.rs b/node/cli/src/service.rs index b19145569b..532c4e2752 100644 --- a/node/cli/src/service.rs +++ b/node/cli/src/service.rs @@ -364,6 +364,7 @@ where + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::ApiExt> + up_rpc::UniqueApi + + app_promotion_rpc::AppPromotionApi + rmrk_rpc::RmrkApi< Block, AccountId, @@ -665,6 +666,7 @@ where + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::ApiExt> + up_rpc::UniqueApi + + app_promotion_rpc::AppPromotionApi + rmrk_rpc::RmrkApi< Block, AccountId, @@ -809,6 +811,7 @@ where + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::ApiExt> + up_rpc::UniqueApi + + app_promotion_rpc::AppPromotionApi + rmrk_rpc::RmrkApi< Block, AccountId, diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index d8f4649fe6..f133e412cd 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -53,6 +53,7 @@ up-common = { path = "../../primitives/common" } pallet-unique = { path = "../../pallets/unique" } uc-rpc = { path = "../../client/rpc" } up-rpc = { path = "../../primitives/rpc" } +app-promotion-rpc = { path = "../../primitives/app_promotion_rpc"} rmrk-rpc = { path = "../../primitives/rmrk-rpc" } up-data-structs = { default-features = false, path = "../../primitives/data-structs" } diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index cdcae0b821..2a3c546390 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -38,6 +38,7 @@ use sp_api::ProvideRuntimeApi; use sp_block_builder::BlockBuilder; use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; use sc_service::TransactionPool; +use uc_rpc::AppPromotion; use std::{collections::BTreeMap, sync::Arc}; use up_common::types::opaque::{Hash, AccountId, RuntimeInstance, Index, Block, BlockNumber, Balance}; @@ -147,6 +148,7 @@ where C::Api: fp_rpc::ConvertTransactionRuntimeApi, C::Api: up_rpc::UniqueApi::CrossAccountId, AccountId>, + C::Api: app_promotion_rpc::AppPromotionApi::CrossAccountId, AccountId>, C::Api: rmrk_rpc::RmrkApi< Block, AccountId, @@ -171,6 +173,7 @@ where EthPubSubApiServer, EthSigner, Net, NetApiServer, Web3, Web3ApiServer, }; use uc_rpc::{UniqueApiServer, Unique}; + use uc_rpc::{AppPromotionApiServer, AppPromotion}; #[cfg(not(feature = "unique-runtime"))] use uc_rpc::{RmrkApiServer, Rmrk}; @@ -229,6 +232,9 @@ where io.merge(Unique::new(client.clone()).into_rpc())?; + // #[cfg(not(feature = "unique-runtime"))] + io.merge(AppPromotion::new(client.clone()).into_rpc())?; + #[cfg(not(feature = "unique-runtime"))] io.merge(Rmrk::new(client.clone()).into_rpc())?; diff --git a/primitives/app_promotion_rpc/CHANGELOG.md b/primitives/app_promotion_rpc/CHANGELOG.md new file mode 100644 index 0000000000..7c3c8c0c96 --- /dev/null +++ b/primitives/app_promotion_rpc/CHANGELOG.md @@ -0,0 +1,5 @@ +# Change Log + +All notable changes to this project will be documented in this file. + + diff --git a/primitives/app_promotion_rpc/Cargo.toml b/primitives/app_promotion_rpc/Cargo.toml new file mode 100644 index 0000000000..68b4a3e8b5 --- /dev/null +++ b/primitives/app_promotion_rpc/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "app-promotion-rpc" +version = "0.1.0" +license = "GPLv3" +edition = "2021" + +[dependencies] +pallet-common = { default-features = false, path = '../../pallets/common' } +up-data-structs = { default-features = false, path = '../data-structs' } +codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [ + "derive", +] } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } + +[features] +default = ["std"] +std = [ + "codec/std", + "sp-core/std", + "sp-std/std", + "sp-api/std", + "sp-runtime/std", + "pallet-common/std", + "up-data-structs/std", +] diff --git a/primitives/app_promotion_rpc/src/lib.rs b/primitives/app_promotion_rpc/src/lib.rs new file mode 100644 index 0000000000..1a6a119982 --- /dev/null +++ b/primitives/app_promotion_rpc/src/lib.rs @@ -0,0 +1,47 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +#![cfg_attr(not(feature = "std"), no_std)] + +use up_data_structs::{ + CollectionId, TokenId, RpcCollection, CollectionStats, CollectionLimits, Property, + PropertyKeyPermission, TokenData, TokenChild, +}; + +use sp_std::vec::Vec; +use codec::Decode; +use sp_runtime::{ + DispatchError, + traits::{AtLeast32BitUnsigned, Member}, +}; + +type Result = core::result::Result; + +sp_api::decl_runtime_apis! { + #[api_version(2)] + /// Trait for generate rpc. + pub trait AppPromotionApi where + BlockNumber: Decode + Member + AtLeast32BitUnsigned, + AccountId: Decode, + CrossAccountId: pallet_evm::account::CrossAccountId, + { + fn total_staked(staker: Option) -> Result; + fn total_staked_per_block(staker: CrossAccountId) -> Result>; + fn total_staking_locked(staker: CrossAccountId) -> Result; + fn pending_unstake(staker: Option) -> Result; + fn pending_unstake_per_block(staker: CrossAccountId) -> Result>; + } +} diff --git a/primitives/rpc/src/lib.rs b/primitives/rpc/src/lib.rs index d23493cf9f..9bb57b58ab 100644 --- a/primitives/rpc/src/lib.rs +++ b/primitives/rpc/src/lib.rs @@ -127,11 +127,5 @@ sp_api::decl_runtime_apis! { fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Result>; fn token_owners(collection: CollectionId, token: TokenId) -> Result>; - fn total_staked(staker: Option) -> Result; - fn total_staked_per_block(staker: CrossAccountId) -> Result>; - fn total_staking_locked(staker: CrossAccountId) -> Result; - fn pending_unstake(staker: Option) -> Result; - fn pending_unstake_per_block(staker: CrossAccountId) -> Result>; - } } diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index bec32e1393..ff261f03a4 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -187,25 +187,47 @@ macro_rules! impl_common_runtime_apis { fn total_pieces(collection: CollectionId, token_id: TokenId) -> Result, DispatchError> { dispatch_unique_runtime!(collection.total_pieces(token_id)) } + } + impl app_promotion_rpc::AppPromotionApi for Runtime { fn total_staked(staker: Option) -> Result { - Ok(>::cross_id_total_staked(staker).unwrap_or_default()) - } + #[cfg(not(feature = "app-promotion"))] + return unsupported!(); + #[cfg(feature = "app-promotion")] + return Ok(>::cross_id_total_staked(staker).unwrap_or_default()); + } + fn total_staked_per_block(staker: CrossAccountId) -> Result, DispatchError> { - Ok(>::cross_id_total_staked_per_block(staker)) + #[cfg(not(feature = "app-promotion"))] + return unsupported!(); + + #[cfg(feature = "app-promotion")] + return Ok(>::cross_id_total_staked_per_block(staker)); } fn total_staking_locked(staker: CrossAccountId) -> Result { - Ok(>::cross_id_locked_balance(staker)) + #[cfg(not(feature = "app-promotion"))] + return unsupported!(); + + #[cfg(feature = "app-promotion")] + return Ok(>::cross_id_locked_balance(staker)); } fn pending_unstake(staker: Option) -> Result { - Ok(>::cross_id_pending_unstake(staker)) + #[cfg(not(feature = "app-promotion"))] + return unsupported!(); + + #[cfg(feature = "app-promotion")] + return Ok(>::cross_id_pending_unstake(staker)); } fn pending_unstake_per_block(staker: CrossAccountId) -> Result, DispatchError> { - Ok(>::cross_id_pending_unstake_per_block(staker)) + #[cfg(not(feature = "app-promotion"))] + return unsupported!(); + + #[cfg(feature = "app-promotion")] + return Ok(>::cross_id_pending_unstake_per_block(staker)) } } diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index fd7163e2dd..3a9356679d 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -83,6 +83,7 @@ std = [ 'pallet-base-fee/std', 'fp-rpc/std', 'up-rpc/std', + 'app-promotion-rpc/std', 'fp-evm-mapping/std', 'fp-self-contained/std', 'parachain-info/std', @@ -414,6 +415,7 @@ scale-info = { version = "2.0.1", default-features = false, features = [ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } +app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false } fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 5c7cabad83..0413b40fab 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -82,6 +82,7 @@ std = [ 'pallet-base-fee/std', 'fp-rpc/std', 'up-rpc/std', + 'app-promotion-rpc/std', 'fp-evm-mapping/std', 'fp-self-contained/std', 'parachain-info/std', @@ -416,8 +417,10 @@ scale-info = { version = "2.0.1", default-features = false, features = [ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } +app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } +pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } pallet-configuration = { default-features = false, path = "../../pallets/configuration" } pallet-common = { default-features = false, path = "../../pallets/common" } diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 20eadb9523..8e169f56ec 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -83,6 +83,7 @@ std = [ 'pallet-base-fee/std', 'fp-rpc/std', 'up-rpc/std', + 'app-promotion-rpc/std', 'fp-evm-mapping/std', 'fp-self-contained/std', 'parachain-info/std', @@ -409,8 +410,10 @@ scale-info = { version = "2.0.1", default-features = false, features = [ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } +app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false } pallet-inflation = { path = '../../pallets/inflation', default-features = false } +pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } pallet-configuration = { default-features = false, path = "../../pallets/configuration" } pallet-common = { default-features = false, path = "../../pallets/common" } diff --git a/tests/src/interfaces/appPromotion/definitions.ts b/tests/src/interfaces/appPromotion/definitions.ts new file mode 100644 index 0000000000..b93df0e6f3 --- /dev/null +++ b/tests/src/interfaces/appPromotion/definitions.ts @@ -0,0 +1,66 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +type RpcParam = { + name: string; + type: string; + isOptional?: true; +}; + +const CROSS_ACCOUNT_ID_TYPE = 'PalletEvmAccountBasicCrossAccountIdRepr'; + +const collectionParam = {name: 'collection', type: 'u32'}; +const tokenParam = {name: 'tokenId', type: 'u32'}; +const propertyKeysParam = {name: 'propertyKeys', type: 'Vec', isOptional: true}; +const crossAccountParam = (name = 'account') => ({name, type: CROSS_ACCOUNT_ID_TYPE}); +const atParam = {name: 'at', type: 'Hash', isOptional: true}; + +const fun = (description: string, params: RpcParam[], type: string) => ({ + description, + params: [...params, atParam], + type, +}); + +export default { + types: {}, + rpc: { + totalStaked: fun( + 'Returns the total amount of staked tokens', + [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}], + 'u128', + ), + totalStakedPerBlock: fun( + 'Returns the total amount of staked tokens per block when staked', + [crossAccountParam('staker')], + 'Vec<(u32, u128)>', + ), + totalStakingLocked: fun( + 'Return the total amount locked by staking tokens', + [crossAccountParam('staker')], + 'u128', + ), + pendingUnstake: fun( + 'Returns the total amount of unstaked tokens', + [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}], + 'u128', + ), + pendingUnstakePerBlock: fun( + 'Returns the total amount of unstaked tokens per block', + [crossAccountParam('staker')], + 'Vec<(u32, u128)>', + ), + }, +}; diff --git a/tests/src/interfaces/appPromotion/index.ts b/tests/src/interfaces/appPromotion/index.ts new file mode 100644 index 0000000000..2d307291c3 --- /dev/null +++ b/tests/src/interfaces/appPromotion/index.ts @@ -0,0 +1,4 @@ +// Auto-generated via `yarn polkadot-types-from-defs`, do not edit +/* eslint-disable */ + +export * from './types'; diff --git a/tests/src/interfaces/appPromotion/types.ts b/tests/src/interfaces/appPromotion/types.ts new file mode 100644 index 0000000000..1aaf7f0000 --- /dev/null +++ b/tests/src/interfaces/appPromotion/types.ts @@ -0,0 +1,4 @@ +// Auto-generated via `yarn polkadot-types-from-defs`, do not edit +/* eslint-disable */ + +export type PHANTOM_APPPROMOTION = 'appPromotion'; diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 93ed1d8244..b6b3d5faec 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -269,7 +269,7 @@ declare module '@polkadot/api-base/types/errors' { **/ NoPendingSponsor: AugmentedError; /** - * This method is only executable by owner. + * This method is only executable by contract owner **/ NoPermission: AugmentedError; /** @@ -278,7 +278,13 @@ declare module '@polkadot/api-base/types/errors' { [key: string]: AugmentedError; }; evmMigration: { + /** + * Migration of this account is not yet started, or already finished. + **/ AccountIsNotMigrating: AugmentedError; + /** + * Can only migrate to empty address. + **/ AccountNotEmpty: AugmentedError; /** * Generic error diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index ff7f2e2405..3cd9c2e92c 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -335,7 +335,7 @@ declare module '@polkadot/api-base/types/storage' { * * Currently used to store RMRK data. **/ - tokenAuxProperties: AugmentedQuery Observable>, [u32, u32, UpDataStructsPropertyScope, Bytes]> & QueryableStorageEntry; + tokenAuxProperties: AugmentedQuery Observable>, [u32, u32, UpDataStructsPropertyScope, Bytes]> & QueryableStorageEntry; /** * Used to enumerate token's children. **/ diff --git a/tests/src/interfaces/augment-api-rpc.ts b/tests/src/interfaces/augment-api-rpc.ts index 3b71dca022..50027f8e8d 100644 --- a/tests/src/interfaces/augment-api-rpc.ts +++ b/tests/src/interfaces/augment-api-rpc.ts @@ -35,6 +35,28 @@ export type __AugmentedRpc = AugmentedRpc<() => unknown>; declare module '@polkadot/rpc-core/types/jsonrpc' { interface RpcInterface { + appPromotion: { + /** + * Returns the total amount of unstaked tokens + **/ + pendingUnstake: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; + /** + * Returns the total amount of unstaked tokens per block + **/ + pendingUnstakePerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>>; + /** + * Returns the total amount of staked tokens + **/ + totalStaked: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; + /** + * Returns the total amount of staked tokens per block when staked + **/ + totalStakedPerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>>; + /** + * Return the total amount locked by staking tokens + **/ + totalStakingLocked: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; + }; author: { /** * Returns true if the keystore has private keys for the given public key and key type. @@ -702,14 +724,6 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { * Get the number of blocks until sponsoring a transaction is available **/ nextSponsored: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, account: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; - /** - * Returns the total amount of unstaked tokens - **/ - pendingUnstake: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; - /** - * Returns the total amount of unstaked tokens per block - **/ - pendingUnstakePerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>>; /** * Get property permissions, optionally limited to the provided keys **/ @@ -746,18 +760,6 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { * Get the total amount of pieces of an RFT **/ totalPieces: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>; - /** - * Returns the total amount of staked tokens - **/ - totalStaked: AugmentedRpc<(staker?: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; - /** - * Returns the total amount of staked tokens per block when staked - **/ - totalStakedPerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>>; - /** - * Return the total amount locked by staking tokens - **/ - totalStakingLocked: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; /** * Get the amount of distinctive tokens present in a collection **/ diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index 11321f65c6..af54c7dc08 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -181,8 +181,21 @@ declare module '@polkadot/api-base/types/submittable' { [key: string]: SubmittableExtrinsicFunction; }; evmMigration: { + /** + * Start contract migration, inserts contract stub at target address, + * and marks account as pending, allowing to insert storage + **/ begin: AugmentedSubmittable<(address: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; + /** + * Finish contract migration, allows it to be called. + * It is not possible to alter contract storage via [`Self::set_data`] + * after this call. + **/ finish: AugmentedSubmittable<(address: H160 | string | Uint8Array, code: Bytes | string | Uint8Array) => SubmittableExtrinsic, [H160, Bytes]>; + /** + * Insert items into contract storage, this method can be called + * multiple times + **/ setData: AugmentedSubmittable<(address: H160 | string | Uint8Array, data: Vec> | ([H256 | string | Uint8Array, H256 | string | Uint8Array])[]) => SubmittableExtrinsic, [H160, Vec>]>; /** * Generic tx @@ -372,7 +385,7 @@ declare module '@polkadot/api-base/types/submittable' { stopAppPromotion: AugmentedSubmittable<() => SubmittableExtrinsic, []>; stopSponsoringCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; stopSponsoringContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; - unstake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; + unstake: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Generic tx **/ diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 8b254d6b35..2b5462a0e3 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -822,9 +822,6 @@ export interface PalletAppPromotionCall extends Enum { readonly amount: u128; } & Struct; readonly isUnstake: boolean; - readonly asUnstake: { - readonly amount: u128; - } & Struct; readonly isSponsorCollection: boolean; readonly asSponsorCollection: { readonly collectionId: u32; @@ -2639,8 +2636,7 @@ export interface UpDataStructsPropertyPermission extends Struct { export interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; - readonly isEth: boolean; - readonly type: 'None' | 'Rmrk' | 'Eth'; + readonly type: 'None' | 'Rmrk'; } /** @name UpDataStructsRpcCollection */ diff --git a/tests/src/interfaces/definitions.ts b/tests/src/interfaces/definitions.ts index fe782eaecc..3b01bbf892 100644 --- a/tests/src/interfaces/definitions.ts +++ b/tests/src/interfaces/definitions.ts @@ -15,5 +15,6 @@ // along with Unique Network. If not, see . export {default as unique} from './unique/definitions'; +export {default as appPromotion} from './appPromotion/definitions'; export {default as rmrk} from './rmrk/definitions'; export {default as default} from './default/definitions'; \ No newline at end of file diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 2c84a86389..f4ca3d987f 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -2467,9 +2467,7 @@ export default { stake: { amount: 'u128', }, - unstake: { - amount: 'u128', - }, + unstake: 'Null', sponsor_collection: { collectionId: 'u32', }, @@ -3078,7 +3076,7 @@ export default { * Lookup403: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { - _enum: ['None', 'Rmrk', 'Eth'] + _enum: ['None', 'Rmrk'] }, /** * Lookup405: pallet_nonfungible::pallet::Error diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 9a4b8e9d42..2356a482f0 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -2675,9 +2675,6 @@ declare module '@polkadot/types/lookup' { readonly amount: u128; } & Struct; readonly isUnstake: boolean; - readonly asUnstake: { - readonly amount: u128; - } & Struct; readonly isSponsorCollection: boolean; readonly asSponsorCollection: { readonly collectionId: u32; @@ -3238,8 +3235,7 @@ declare module '@polkadot/types/lookup' { interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; - readonly isEth: boolean; - readonly type: 'None' | 'Rmrk' | 'Eth'; + readonly type: 'None' | 'Rmrk'; } /** @name PalletNonfungibleError (405) */ diff --git a/tests/src/interfaces/types.ts b/tests/src/interfaces/types.ts index 7db708bdf0..17cdd49c05 100644 --- a/tests/src/interfaces/types.ts +++ b/tests/src/interfaces/types.ts @@ -2,5 +2,6 @@ /* eslint-disable */ export * from './unique/types'; +export * from './appPromotion/types'; export * from './rmrk/types'; export * from './default/types'; diff --git a/tests/src/interfaces/unique/definitions.ts b/tests/src/interfaces/unique/definitions.ts index d2dee8b6fc..29daa4c791 100644 --- a/tests/src/interfaces/unique/definitions.ts +++ b/tests/src/interfaces/unique/definitions.ts @@ -175,30 +175,5 @@ export default { [collectionParam, tokenParam], 'Option', ), - totalStaked: fun( - 'Returns the total amount of staked tokens', - [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}], - 'u128', - ), - totalStakedPerBlock: fun( - 'Returns the total amount of staked tokens per block when staked', - [crossAccountParam('staker')], - 'Vec<(u32, u128)>', - ), - totalStakingLocked: fun( - 'Return the total amount locked by staking tokens', - [crossAccountParam('staker')], - 'u128', - ), - pendingUnstake: fun( - 'Returns the total amount of unstaked tokens', - [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}], - 'u128', - ), - pendingUnstakePerBlock: fun( - 'Returns the total amount of unstaked tokens per block', - [crossAccountParam('staker')], - 'Vec<(u32, u128)>', - ), }, }; diff --git a/tests/src/substrate/substrate-api.ts b/tests/src/substrate/substrate-api.ts index cf6493cd73..1476095ae7 100644 --- a/tests/src/substrate/substrate-api.ts +++ b/tests/src/substrate/substrate-api.ts @@ -42,6 +42,7 @@ function defaultApiOptions(): ApiOptions { }, rpc: { unique: defs.unique.rpc, + appPromotion: defs.appPromotion.rpc, rmrk: defs.rmrk.rpc, eth: { feeHistory: { diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 5d9c79dae8..33912b196c 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -35,6 +35,7 @@ export class DevUniqueHelper extends UniqueHelper { }, rpc: { unique: defs.unique.rpc, + appPromotion: defs.appPromotion.rpc, rmrk: defs.rmrk.rpc, eth: { feeHistory: { diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 40fa1b07f3..2d20a3f2b3 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -2027,24 +2027,24 @@ class StakingGroup extends HelperGroup { } async getTotalStaked(address?: ICrossAccountId): Promise { - if (address) return (await this.helper.callRpc('api.rpc.unique.totalStaked', [address])).toBigInt(); - return (await this.helper.callRpc('api.rpc.unique.totalStaked')).toBigInt(); + if (address) return (await this.helper.callRpc('api.rpc.appPromotion.totalStaked', [address])).toBigInt(); + return (await this.helper.callRpc('api.rpc.appPromotion.totalStaked')).toBigInt(); } async getTotalStakingLocked(address: ICrossAccountId): Promise { - return (await this.helper.callRpc('api.rpc.unique.totalStakingLocked', [address])).toBigInt(); + return (await this.helper.callRpc('api.rpc.appPromotion.totalStakingLocked', [address])).toBigInt(); } async getTotalStakedPerBlock(address: ICrossAccountId): Promise { - return (await this.helper.callRpc('api.rpc.unique.totalStakedPerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]); + return (await this.helper.callRpc('api.rpc.appPromotion.totalStakedPerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]); } async getPendingUnstake(address: ICrossAccountId): Promise { - return (await this.helper.callRpc('api.rpc.unique.pendingUnstake', [address])).toBigInt(); + return (await this.helper.callRpc('api.rpc.appPromotion.pendingUnstake', [address])).toBigInt(); } async getPendingUnstakePerBlock(address: ICrossAccountId): Promise { - return (await this.helper.callRpc('api.rpc.unique.pendingUnstakePerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]); + return (await this.helper.callRpc('api.rpc.appPromotion.pendingUnstakePerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]); } } From 492b65108c1641448668a2cfd01626c905d30de9 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Thu, 1 Sep 2022 21:10:51 +0500 Subject: [PATCH 0667/1274] Tests up --- tests/src/app-promotion.test.ts | 113 ++++++++++++++--------- tests/src/util/playgrounds/types.ts | 17 ++++ tests/src/util/playgrounds/unique.dev.ts | 2 +- tests/src/util/playgrounds/unique.ts | 9 +- 4 files changed, 93 insertions(+), 48 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index f3194f9755..df0f299b05 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -63,36 +63,37 @@ after(async function () { }); describe('app-promotions.stake extrinsic', () => { - it('should "lock" some balance in system.account, add it to "staked" map, and increase "totalStaked" amount', async () => { + it('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async () => { await usingPlaygrounds(async (helper) => { const totalStakedBefore = await helper.staking.getTotalStaked(); const [staker, recepient] = await helper.arrange.createAccounts([400n, 0n], alice); - + // Minimum stake amount is 100: await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.eventually.rejected; await helper.staking.stake(staker, 100n * nominal); - // Staker balance is: miscFrozen: 100, feeFrozen: 100, reserved: 0n, free less than 300... + // Staker balance is: miscFrozen: 100, feeFrozen: 100, reserved: 0n... // ...so he can not transfer 300 expect (await helper.balance.getSubstrateFull(staker.address)).to.contain({miscFrozen: 100n * nominal, feeFrozen: 100n * nominal, reserved: 0n}); await expect(helper.balance.transferToSubstrate(staker, recepient.address, 300n * nominal)).to.be.rejected; + // 100 -> 24 locked 100; staked 0; 24 => locked 100 staked 100 expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(100n * nominal); - // TODO add helpers to assert bigints. Check balance close to 100 - expect(await helper.balance.getSubstrate(staker.address) - 99n * nominal >= (nominal / 2n)).to.be.true; + // TODO should be 0 expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(100n * nominal); + expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(399n); // it is potentially flaky test. Promotion can credited some tokens. Maybe we need to use closeTo? expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + 100n * nominal); // total tokens amount staked in app-promotion increased await helper.staking.stake(staker, 200n * nominal); - expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(300n * nominal); - const stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map((x) => x[1]); - expect(stakedPerBlock).to.be.deep.equal([100n * nominal, 200n * nominal]); + expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(300n * nominal); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(300n * nominal); + expect((await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map((x) => x[1])).to.be.deep.equal([100n * nominal, 200n * nominal]); }); }); - it('should reject transaction if stake amount is more than total free balance', async () => { + it('should reject transaction if stake amount is more than total free balance minus frozen', async () => { await usingPlaygrounds(async helper => { const [staker] = await helper.arrange.createAccounts([300n], alice); @@ -100,7 +101,7 @@ describe('app-promotions.stake extrinsic', () => { await expect(helper.staking.stake(staker, 300n * nominal)).to.be.eventually.rejected; await helper.staking.stake(staker, 150n * nominal); - // Can't stake 4 tkn because Alice has ~3 free tkn, and 7 locked + // Can't stake 150 tkn because Alice has Less than 150 free - frozen tokens; await expect(helper.staking.stake(staker, 150n * nominal)).to.be.eventually.rejected; expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(150n * nominal); }); @@ -117,9 +118,6 @@ describe('app-promotions.stake extrinsic', () => { expect(crowdStakes).to.deep.equal([100n * nominal, 100n * nominal, 100n * nominal, 100n * nominal]); }); }); - // TODO it('Staker stakes 5 times in one block with nonce'); - // TODO it('Staked balance appears as locked in the balance pallet'); - // TODO it('Alice stakes huge amount of tokens'); }); describe('unstake balance extrinsic', () => { @@ -130,6 +128,8 @@ describe('unstake balance extrinsic', () => { await helper.staking.stake(staker, 500n * nominal); await helper.staking.unstake(staker); + // balance state still + // Stakers balance now: {free: <100n, reserved: 500n, miscFrozen: 0, feeFrozen: 0}; // Staker can not transfer // TODO expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 500n * nominal, miscFrozen: 0n, feeFrozen: 0n}); @@ -138,11 +138,20 @@ describe('unstake balance extrinsic', () => { expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(500n * nominal); expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore); + }); + }); + + it('should unlock balance after unlocking period ends and subtract it from "pendingUnstake"', async () => { + await usingPlaygrounds(async (helper) => { + const [staker] = await helper.arrange.createAccounts([1000n], alice); + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.unstake(staker); + await waitForRelayBlock(helper.api!, 20); - // Wait for unstaking period. Balance now free ~600, and reserved, frozen, miscFrozeb 0n + // Wait for unstaking period. Balance now free ~1000; reserved, frozen, miscFrozeb: 0n await waitForRelayBlock(helper.api!, 20); expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n * nominal, miscFrozen: 0n, feeFrozen: 0n}); - expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(599n); + expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); }); }); @@ -215,17 +224,6 @@ describe('unstake balance extrinsic', () => { }); }); - it('should unlock balance after unlocking period ends and subtract it from "pendingUnstake"', async () => { - await usingPlaygrounds(async (helper) => { - const [staker] = await helper.arrange.createAccounts([1000n], alice); - await helper.staking.stake(staker, 100n * nominal); - await helper.staking.unstake(staker); - await waitForRelayBlock(helper.api!, 20); - // expect balance unlocked - expect.fail('Not implemented'); - }); - }); - it('should be possible for different accounts in one block', async () => { await usingPlaygrounds(async (helper) => { const stakers = await helper.arrange.createAccounts([200n, 200n, 200n, 200n, 200n], alice); @@ -375,14 +373,12 @@ describe('App-promotion collection sponsoring', () => { }); it('should reject transaction if collection doesn\'t exist', async () => { - await usingPlaygrounds(async (helper) => { - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(999999999))).to.be.eventually.rejected; - }); - }); - - it('should reject transaction if collection was burnt', async () => { await usingPlaygrounds(async (helper) => { const [collectionOwner] = await helper.arrange.createAccounts([10n], alice); + + // collection has never existed + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(999999999))).to.be.eventually.rejected; + // collection has been burned const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await collection.burn(collectionOwner); @@ -406,13 +402,20 @@ describe('app-promotion stopSponsoringCollection', () => { it('should set sponsoring as disabled', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner] = await helper.arrange.createAccounts([10n, 10n], alice); - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + const [collectionOwner, recepient] = await helper.arrange.createAccounts([10n, 0n], alice); + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits: {sponsorTransferTimeout: 0}}); + const token = await collection.mintToken(collectionOwner, {Substrate: collectionOwner.address}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.fulfilled; + await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId)); + await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsoringCollection(collection.collectionId)); expect((await collection.getData())?.raw.sponsorship).to.be.equal('Disabled'); + + // Transactions are not sponsored anymore: + const ownerBalanceBefore = await helper.balance.getSubstrate(collectionOwner.address); + await token.transfer(collectionOwner, {Substrate: recepient.address}); + const ownerBalanceAfter = await helper.balance.getSubstrate(collectionOwner.address); + expect(ownerBalanceAfter < ownerBalanceBefore).to.be.equal(true); }); }); @@ -615,39 +618,57 @@ describe('app-promotion stopSponsoringContract', () => { }); describe('app-promotion rewards', () => { + it('can not be called by non admin', async () => { + await usingPlaygrounds(async (helper) => { + const [nonAdmin] = await helper.arrange.createAccounts([10n], alice); + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.payoutStakers(50))).to.be.rejected; + }); + }); + it('should credit 0.05% for staking period', async () => { + // TODO flaky test await usingPlaygrounds(async helper => { const [staker] = await helper.arrange.createAccounts([5000n], alice); await helper.staking.stake(staker, 100n * nominal); await helper.staking.stake(staker, 200n * nominal); - await waitForRelayBlock(helper.api!, 40); + await waitForRelayBlock(helper.api!, 30); await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(50)); - + const totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); expect(totalStakedPerBlock).to.be.deep.equal([calculateIncome(100n * nominal, 10n), calculateIncome(200n * nominal, 10n)]); }); }); - it('can not be initialized by non admin', async () => { - await usingPlaygrounds(async (helper) => { - expect.fail('Test not implemented'); - }); - }); - it('shoud be paid for more than one period if payments was missed', async () => { await usingPlaygrounds(async (helper) => { - expect.fail('Test not implemented'); + const [staker] = await helper.arrange.createAccounts([400n], alice); + + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.stake(staker, 200n * nominal); + + await waitForRelayBlock(helper.api!, 55); + await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(50)); + const stakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(stakedPerBlock[0][1]).to.be.equal(calculateIncome(100n * nominal, 10n, 2)); + expect(stakedPerBlock[1][1]).to.be.equal(calculateIncome(200n * nominal, 10n, 2)); + + const stakerFullBalance = await helper.balance.getSubstrateFull(staker.address); + const frozenBalanceShouldBe = calculateIncome(300n * nominal, 10n, 2); + + expect(stakerFullBalance).to.contain({reserved: 0n, feeFrozen: frozenBalanceShouldBe, miscFrozen: frozenBalanceShouldBe}); }); }); it('should not be credited for unstaked (reserved) balance', async () => { + expect.fail('Test not implemented'); await usingPlaygrounds(async helper => { - expect.fail('Implement me after unstake method will be fixed'); + const staker = await helper.arrange.createAccounts([1000n], alice); }); }); it('should bring compound interest', async () => { + // TODO flaky test await usingPlaygrounds(async helper => { const [staker] = await helper.arrange.createAccounts([800n], alice); diff --git a/tests/src/util/playgrounds/types.ts b/tests/src/util/playgrounds/types.ts index de8fab3069..6e7b6dd9ae 100644 --- a/tests/src/util/playgrounds/types.ts +++ b/tests/src/util/playgrounds/types.ts @@ -101,6 +101,23 @@ export interface IToken { tokenId: number; } +export interface IBlock { + extrinsics: IExtrinsic[] + header: { + parentHash: string, + number: number, + }; +} + +export interface IExtrinsic { + isSigned: boolean, + method: { + method: string, + section: string, + args: any[] + } +} + export interface ICollectionCreationOptions { name: string | number[]; description: string | number[]; diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 33912b196c..551e480c22 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -198,4 +198,4 @@ class ArrangeGroup { }); return promise; } -} \ No newline at end of file +} diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 2d20a3f2b3..73f11a3984 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -9,7 +9,7 @@ import {ApiPromise, WsProvider, Keyring} from '@polkadot/api'; import {ApiInterfaceEvents} from '@polkadot/api/types'; import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; -import {IApiListeners, IChainEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; +import {IApiListeners, IBlock, IChainEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => { const address = {} as ICrossAccountId; @@ -1860,6 +1860,13 @@ class ChainGroup extends HelperGroup { return blockHash; } + // TODO add docs + async getBlock(blockHashOrNumber: string | number): Promise { + const blockHash = typeof blockHashOrNumber === 'string' ? blockHashOrNumber : await this.getBlockHashByNumber(blockHashOrNumber); + if (!blockHash) return null; + return (await this.helper.callRpc('api.rpc.chain.getBlock', [blockHash])).toHuman().block; + } + /** * Get account nonce * @param address substrate address From 11b9ea3bae3412836aa5b489c98084a8c1874250 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 1 Sep 2022 19:23:40 +0300 Subject: [PATCH 0668/1274] XCM XTokens: Min parachain fee increased --- runtime/opal/src/xcm_config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/opal/src/xcm_config.rs b/runtime/opal/src/xcm_config.rs index cbc3ca347e..44b49c2827 100644 --- a/runtime/opal/src/xcm_config.rs +++ b/runtime/opal/src/xcm_config.rs @@ -480,7 +480,7 @@ parameter_types! { parameter_type_with_key! { pub ParachainMinFee: |_location: MultiLocation| -> Option { - Some(100_000_000) + Some(100_000_000_000) }; } From 59a0f2f30328f6e8b759473c204fc5436bf292c0 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 1 Sep 2022 21:25:42 +0300 Subject: [PATCH 0669/1274] Opal integration tests are done --- tests/package.json | 2 +- tests/src/xcm/xcmOpal.test.ts | 489 ++++++++++++++++++++++++++++++++++ 2 files changed, 490 insertions(+), 1 deletion(-) create mode 100644 tests/src/xcm/xcmOpal.test.ts diff --git a/tests/package.json b/tests/package.json index 93c1b5e105..e140081d95 100644 --- a/tests/package.json +++ b/tests/package.json @@ -75,7 +75,7 @@ "testScheduler": "mocha --timeout 9999999 -r ts-node/register ./**/scheduler.test.ts", "testSchedulingEVM": "mocha --timeout 9999999 -r ts-node/register ./**/eth/scheduling.test.ts", "testXcmUnique": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmUnique.test.ts", - "testXcmTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransfer.test.ts", + "testXcmOpal": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmOpal.test.ts", "testXcmTransferAcala": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferAcala.test.ts acalaId=2000 uniqueId=5000", "testXcmTransferStatemine": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferStatemine.test.ts statemineId=1000 uniqueId=5000", "testXcmTransferMoonbeam": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferMoonbeam.test.ts moonbeamId=2000 uniqueId=5000", diff --git a/tests/src/xcm/xcmOpal.test.ts b/tests/src/xcm/xcmOpal.test.ts new file mode 100644 index 0000000000..35a1aa6091 --- /dev/null +++ b/tests/src/xcm/xcmOpal.test.ts @@ -0,0 +1,489 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; + +import {WsProvider} from '@polkadot/api'; +import {ApiOptions} from '@polkadot/api/types'; +import {IKeyringPair} from '@polkadot/types/types'; +import usingApi, {submitTransactionAsync} from './../substrate/substrate-api'; +import {getGenericResult, paraSiblingSovereignAccount} from './../util/helpers'; +import waitNewBlocks from './../substrate/wait-new-blocks'; +import {normalizeAccountId} from './../util/helpers'; +import getBalance from './../substrate/get-balance'; + + +chai.use(chaiAsPromised); +const expect = chai.expect; + +const STATEMINE_CHAIN = 1000; +const UNIQUE_CHAIN = 2095; + +const RELAY_PORT = '9844'; +const UNIQUE_PORT = '9944'; +const STATEMINE_PORT = '9946'; +const STATEMINE_PALLET_INSTANCE = 50; +const ASSET_ID = 100; +const ASSET_METADATA_DECIMALS = 18; +const ASSET_METADATA_NAME = 'USDT'; +const ASSET_METADATA_DESCRIPTION = 'USDT'; +const ASSET_METADATA_MINIMAL_BALANCE = 1; + +const TRANSFER_AMOUNT = 1_000_000_000_000_000_000n; + +// 10,000.00 (ten thousands) USDT +const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n; + +describe('Integration test: Exchanging USDT with Statemine', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + + let balanceStmnBefore: bigint; + let balanceStmnAfter: bigint; + + let balanceOpalBefore: bigint; + let balanceOpalAfter: bigint; + let balanceOpalFinal: bigint; + + let balanceBobBefore: bigint; + let balanceBobAfter: bigint; + let balanceBobFinal: bigint; + + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + alice = privateKeyWrapper('//Alice'); + bob = privateKeyWrapper('//Bob'); // funds donor + }); + + const statemineApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT), + }; + + const uniqueApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), + }; + + const relayApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + RELAY_PORT), + }; + + await usingApi(async (api) => { + + // 350.00 (three hundred fifty) DOT + const fundingAmount = 3_500_000_000_000; + + const tx = api.tx.assets.create(ASSET_ID, alice.addressRaw, ASSET_METADATA_MINIMAL_BALANCE); + const events = await submitTransactionAsync(alice, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + // set metadata + const tx2 = api.tx.assets.setMetadata(ASSET_ID, ASSET_METADATA_NAME, ASSET_METADATA_DESCRIPTION, ASSET_METADATA_DECIMALS); + const events2 = await submitTransactionAsync(alice, tx2); + const result2 = getGenericResult(events2); + expect(result2.success).to.be.true; + + // mint some amount of asset + const tx3 = api.tx.assets.mint(ASSET_ID, alice.addressRaw, ASSET_AMOUNT); + const events3 = await submitTransactionAsync(alice, tx3); + const result3 = getGenericResult(events3); + expect(result3.success).to.be.true; + + // funding parachain sovereing account (Parachain: 2095) + const parachainSovereingAccount = await paraSiblingSovereignAccount(UNIQUE_CHAIN); + const tx4 = api.tx.balances.transfer(parachainSovereingAccount, fundingAmount); + const events4 = await submitTransactionAsync(bob, tx4); + const result4 = getGenericResult(events4); + expect(result4.success).to.be.true; + + }, statemineApiOptions); + + + await usingApi(async (api) => { + + const location = { + V1: { + parents: 1, + interior: {X3: [ + { + Parachain: STATEMINE_CHAIN, + }, + { + PalletInstance: STATEMINE_PALLET_INSTANCE, + }, + { + GeneralIndex: ASSET_ID, + }, + ]}, + }, + }; + + const metadata = + { + name: ASSET_ID, + symbol: ASSET_METADATA_NAME, + decimals: ASSET_METADATA_DECIMALS, + minimalBalance: ASSET_METADATA_MINIMAL_BALANCE, + }; + //registerForeignAsset(owner, location, metadata) + const tx = api.tx.foreingAssets.registerForeignAsset(alice.addressRaw, location, metadata); + const sudoTx = api.tx.sudo.sudo(tx as any); + const events = await submitTransactionAsync(alice, sudoTx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceOpalBefore] = await getBalance(api, [alice.address]); + + }, uniqueApiOptions); + + + // Providing the relay currency to the unique sender account + await usingApi(async (api) => { + const destination = { + V1: { + parents: 0, + interior: {X1: { + Parachain: UNIQUE_CHAIN, + }, + }, + }}; + + const beneficiary = { + V1: { + parents: 0, + interior: {X1: { + AccountId32: { + network: 'Any', + id: alice.addressRaw, + }, + }}, + }, + }; + + const assets = { + V1: [ + { + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: 50_000_000_000_000_000n, + }, + }, + ], + }; + + const feeAssetItem = 0; + + const weightLimit = { + Limited: 5_000_000_000, + }; + + const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); + const events = await submitTransactionAsync(alice, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + }, relayApiOptions); + + }); + + it('Should connect and send USDT from Statemine to Unique', async () => { + + const statemineApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT), + }; + + const uniqueApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), + }; + + await usingApi(async (api) => { + + const dest = { + V1: { + parents: 1, + interior: {X1: { + Parachain: UNIQUE_CHAIN, + }, + }, + }}; + + const beneficiary = { + V1: { + parents: 0, + interior: {X1: { + AccountId32: { + network: 'Any', + id: alice.addressRaw, + }, + }}, + }, + }; + + const assets = { + V1: [ + { + id: { + Concrete: { + parents: 0, + interior: { + X2: [ + { + PalletInstance: STATEMINE_PALLET_INSTANCE, + }, + { + GeneralIndex: ASSET_ID, + }, + ]}, + }, + }, + fun: { + Fungible: TRANSFER_AMOUNT, + }, + }, + ], + }; + + const feeAssetItem = 0; + + const weightLimit = { + Limited: 5000000000, + }; + + [balanceStmnBefore] = await getBalance(api, [alice.address]); + + const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(dest, beneficiary, assets, feeAssetItem, weightLimit); + const events = await submitTransactionAsync(alice, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceStmnAfter] = await getBalance(api, [alice.address]); + + // common good parachain take commission in it native token + expect(balanceStmnBefore > balanceStmnAfter).to.be.true; + + }, statemineApiOptions); + + + // ensure that asset has been delivered + await usingApi(async (api) => { + await waitNewBlocks(api, 3); + // expext collection id will be with id 1 + const free = (await api.query.fungible.balance(1, normalizeAccountId(alice.address))).toBigInt(); + + [balanceOpalAfter] = await getBalance(api, [alice.address]); + + // commission has not paid in USDT token + expect(free == TRANSFER_AMOUNT).to.be.true; + // ... and parachain native token + expect(balanceOpalAfter == balanceOpalBefore).to.be.true; + + + }, uniqueApiOptions); + + }); + + it('Should connect and send USDT from Unique to Statemine back', async () => { + + const uniqueApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), + }; + + const statemineApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT), + }; + + await usingApi(async (api) => { + const destination = { + V1: { + parents: 1, + interior: {X2: [ + { + Parachain: STATEMINE_CHAIN, + }, + { + AccountId32: { + network: 'Any', + id: alice.addressRaw, + }, + }, + ]}, + }, + }; + + const currencies = [[ + { + ForeignAssetId: 0, + }, + //10_000_000_000_000_000n, + TRANSFER_AMOUNT, + ], + [ + { + NativeAssetId: 'Parent', + }, + 400_000_000_000_000n, + ]]; + + const feeItem = 1; + const destWeight = 500000000000; + + const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight); + const events = await submitTransactionAsync(alice, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + // the commission has been paid in parachain native token + [balanceOpalFinal] = await getBalance(api, [alice.address]); + expect(balanceOpalAfter > balanceOpalFinal).to.be.true; + }, uniqueApiOptions); + + await usingApi(async (api) => { + await waitNewBlocks(api, 3); + + // The USDT token never paid fees. Its amount not changed from begin value. + // Also check that xcm transfer has been succeeded + const free = ((await api.query.assets.account(100, alice.address)).toHuman()) as any; + expect(BigInt(free.balance.replace(/,/g, '')) == ASSET_AMOUNT).to.be.true; + }, statemineApiOptions); + }); + + it('Should connect and send Relay token to Unique', async () => { + + const uniqueApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), + }; + + const uniqueApiOptions2: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), + }; + + const relayApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + RELAY_PORT), + }; + + await usingApi(async (api) => { + [balanceBobBefore] = await getBalance(api, [alice.address]); + }, uniqueApiOptions); + + // Providing the relay currency to the unique sender account + await usingApi(async (api) => { + const destination = { + V1: { + parents: 0, + interior: {X1: { + Parachain: UNIQUE_CHAIN, + }, + }, + }}; + + const beneficiary = { + V1: { + parents: 0, + interior: {X1: { + AccountId32: { + network: 'Any', + id: bob.addressRaw, + }, + }}, + }, + }; + + const assets = { + V1: [ + { + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: 50_000_000_000_000_000n, + }, + }, + ], + }; + + const feeAssetItem = 0; + + const weightLimit = { + Limited: 5_000_000_000, + }; + + const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); + const events = await submitTransactionAsync(bob, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + }, relayApiOptions); + + + await usingApi(async (api) => { + await waitNewBlocks(api, 3); + + [balanceBobAfter] = await getBalance(api, [alice.address]); + expect(balanceBobBefore == balanceBobAfter).to.be.true; + }, uniqueApiOptions2); + + }); + + it('Should connect and send Relay token back', async () => { + + const uniqueApiOptions: ApiOptions = { + provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), + }; + + await usingApi(async (api) => { + const destination = { + V1: { + parents: 1, + interior: {X2: [ + { + Parachain: STATEMINE_CHAIN, + }, + { + AccountId32: { + network: 'Any', + id: bob.addressRaw, + }, + }, + ]}, + }, + }; + + const currencies = [ + [ + { + NativeAssetId: 'Parent', + }, + 50_000_000_000_000_000n, + ]]; + + const feeItem = 0; + const destWeight = 500000000000; + + const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight); + const events = await submitTransactionAsync(bob, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + }, uniqueApiOptions); + }); + +}); \ No newline at end of file From 7ef2a7f8cbd4c7be24c90b697593b523a6b7cc0c Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 2 Sep 2022 14:53:28 +0700 Subject: [PATCH 0670/1274] try another trigger for xcm workflows --- .github/workflows/xcm-testnet-build.yml | 11 +---------- .github/workflows/xcm-tests.yml | 10 +++++----- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 610c11a6e6..b78d1cc7df 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -1,16 +1,7 @@ name: xcm-testnet-build # Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review +on: [pull_request] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index 7347ce252d..bef204f8bb 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -2,11 +2,6 @@ name: xcm-tests # Controls when the action will run. on: - # Triggers the workflow after xcm-testnet-build - workflow_run: - workflows: ["xcm-testnet-build"] - types: - - completed # Triggers the workflow on push or pull request events but only for the master branch pull_request: branches: @@ -31,10 +26,15 @@ concurrency: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: + xcm-build: + uses: ./.github/workflows/xcm-testnet-build.yml + prepare-execution-marix: name: Prepare execution matrix + needs: [xcm-build] + runs-on: XL outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} From 3c3c01db390da8b80051d5319bf2816cbc9c7910 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 2 Sep 2022 14:57:30 +0700 Subject: [PATCH 0671/1274] Revert "try another trigger for xcm workflows" This reverts commit 7ef2a7f8cbd4c7be24c90b697593b523a6b7cc0c. --- .github/workflows/xcm-testnet-build.yml | 11 ++++++++++- .github/workflows/xcm-tests.yml | 10 +++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index b78d1cc7df..610c11a6e6 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -1,7 +1,16 @@ name: xcm-testnet-build # Controls when the action will run. -on: [pull_request] +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: + - master + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + - ready_for_review # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index bef204f8bb..7347ce252d 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -2,6 +2,11 @@ name: xcm-tests # Controls when the action will run. on: + # Triggers the workflow after xcm-testnet-build + workflow_run: + workflows: ["xcm-testnet-build"] + types: + - completed # Triggers the workflow on push or pull request events but only for the master branch pull_request: branches: @@ -26,15 +31,10 @@ concurrency: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - xcm-build: - uses: ./.github/workflows/xcm-testnet-build.yml - prepare-execution-marix: name: Prepare execution matrix - needs: [xcm-build] - runs-on: XL outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} From 58bdab80d979eaa76a561c07954ab8317a88709e Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 2 Sep 2022 16:47:48 +0700 Subject: [PATCH 0672/1274] another trigger for xcm tests workflows --- .github/workflows/xcm-testnet-build.yml | 23 +++++------------------ .github/workflows/xcm-tests.yml | 17 +++++++++-------- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 610c11a6e6..2dbf75175d 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -2,16 +2,8 @@ name: xcm-testnet-build # Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - + workflow_call: + # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -19,10 +11,6 @@ on: env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -72,11 +60,10 @@ jobs: matrix: include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} - steps: - #- name: Skip if pull request is in Draft - # if: github.event.pull_request.draft == true - # run: exit 1 + - name: Skip if pull request is in Draft + if: github.event.pull_request.draft == true + run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index 7347ce252d..8b6ec44646 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -2,11 +2,6 @@ name: xcm-tests # Controls when the action will run. on: - # Triggers the workflow after xcm-testnet-build - workflow_run: - workflows: ["xcm-testnet-build"] - types: - - completed # Triggers the workflow on push or pull request events but only for the master branch pull_request: branches: @@ -31,10 +26,16 @@ concurrency: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: + xcm-testnet-build: + uses: ./.github/workflows/xcm-testnet-build.yml + secrets: inherit + prepare-execution-marix: name: Prepare execution matrix + needs: [xcm-testnet-build] + runs-on: XL outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} @@ -78,9 +79,9 @@ jobs: steps: - # - name: Skip if pull request is in Draft - # if: github.event.pull_request.draft == true - # run: exit 1 + - name: Skip if pull request is in Draft + if: github.event.pull_request.draft == true + run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 From 36eb084b5562c2ff26a44b3b8aa755674997adcf Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 2 Sep 2022 13:08:54 +0300 Subject: [PATCH 0673/1274] convert workflows to re-usable format --- .github/workflows/ci-develop.yml | 42 ++++ .github/workflows/ci-master.yml | 42 ++++ .github/workflows/reusable/canary.yml | 12 ++ .../codestyle_v2.yml} | 13 +- .../dev-build-tests_v2.yml} | 19 +- .../workflows/reusable/execution-matrix.yml | 42 ++++ .../forkless-update-data_v2.yml} | 62 ++---- .../forkless-update-nodata_v2.yml} | 51 +---- .github/workflows/reusable/forkless.yml | 18 ++ .../reusable/generate-execution-matrix.yml | 45 ++++ .github/workflows/reusable/market-test_v2.yml | 195 ++++++++++++++++++ .../node-only-update_v2.yml} | 42 +--- .../workflows/reusable/test_codestyle_v2.yml | 20 ++ .../try-runtime_v2.yml} | 48 +---- .../unit-test_v2.yml} | 35 +--- .../{ => reusable}/xcm-testnet-build.yml | 0 .../xcm-tests_v2.yml} | 19 +- .github/workflows/reusable/xcm.yml | 19 ++ .github/workflows/tests_codestyle.yml | 49 ----- 19 files changed, 474 insertions(+), 299 deletions(-) create mode 100644 .github/workflows/ci-develop.yml create mode 100644 .github/workflows/ci-master.yml create mode 100644 .github/workflows/reusable/canary.yml rename .github/workflows/{codestyle.yml => reusable/codestyle_v2.yml} (93%) rename .github/workflows/{dev-build-tests.yml => reusable/dev-build-tests_v2.yml} (92%) create mode 100644 .github/workflows/reusable/execution-matrix.yml rename .github/workflows/{forkless-update-data.yml => reusable/forkless-update-data_v2.yml} (78%) rename .github/workflows/{forkless-update-nodata.yml => reusable/forkless-update-nodata_v2.yml} (78%) create mode 100644 .github/workflows/reusable/forkless.yml create mode 100644 .github/workflows/reusable/generate-execution-matrix.yml create mode 100644 .github/workflows/reusable/market-test_v2.yml rename .github/workflows/{nodes-only-update.yml => reusable/node-only-update_v2.yml} (86%) create mode 100644 .github/workflows/reusable/test_codestyle_v2.yml rename .github/workflows/{try-runtime.yml => reusable/try-runtime_v2.yml} (57%) rename .github/workflows/{unit-test.yml => reusable/unit-test_v2.yml} (54%) rename .github/workflows/{ => reusable}/xcm-testnet-build.yml (100%) rename .github/workflows/{xcm-tests.yml => reusable/xcm-tests_v2.yml} (92%) create mode 100644 .github/workflows/reusable/xcm.yml delete mode 100644 .github/workflows/tests_codestyle.yml diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml new file mode 100644 index 0000000000..0a67e4ad23 --- /dev/null +++ b/.github/workflows/ci-develop.yml @@ -0,0 +1,42 @@ +name: develop + +on: + pull_request: + branches: + - develop + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + - ready_for_review + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + + yarn-test-dev: + if: github.event.pull_request.draft == false + uses: ./.github/workflows/reusable/dev-build-tests_v2.yml + + unit-test: + if: github.event.pull_request.draft == false + uses: ./.github/workflows/reusable/unit-test_v2.yml + + forkless: + if: contains( github.event.pull_request.labels.*.name, 'forkless') + uses: ./.github/workflows/reusable/forkless.yml + + canary: + if: contains( github.event.pull_request.labels.*.name, 'canary') + uses: ./.github/workflows/reusable/canary.yml + secrets: inherit # pass all secrets + + + xcm: + if: contains( github.event.pull_request.labels.*.name, 'xcm') + uses: ./.github/workflows/reusable/xcm.yml + + codestyle: + uses: ./.github/workflows/reusable/codestyle_v2.yml \ No newline at end of file diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml new file mode 100644 index 0000000000..4fd3a676ff --- /dev/null +++ b/.github/workflows/ci-master.yml @@ -0,0 +1,42 @@ +name: master + +on: + pull_request: + branches: + - master + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + - ready_for_review + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + + unit-test: + if: github.event.pull_request.draft != true + uses: ./.github/workflows/reusable/unit-test_v2.yml + + node-only-update: + if: github.event.pull_request.draft == false + uses: ./.github/workflows/reusable/node-only-update_v2.yml + + forkless: + if: contains( github.event.pull_request.labels.*.name, 'forkless') + uses: ./.github/workflows/reusable/forkless.yml + + canary: + if: contains( github.event.pull_request.labels.*.name, 'canary') + uses: ./.github/workflows/reusable/canary.yml + secrets: inherit # pass all secrets + + xcm: + if: contains( github.event.pull_request.labels.*.name, 'xcm') + uses: ./.github/workflows/reusable/xcm.yml + + codestyle: + if: github.event.pull_request.draft == false + uses: ./.github/workflows/reusable/codestyle_v2.yml \ No newline at end of file diff --git a/.github/workflows/reusable/canary.yml b/.github/workflows/reusable/canary.yml new file mode 100644 index 0000000000..f659abcc45 --- /dev/null +++ b/.github/workflows/reusable/canary.yml @@ -0,0 +1,12 @@ +on: + workflow_call: + +jobs: + + market-e2e-test: + name: market e2e tests + uses: ./.github/workflows/market-test_v2.yml + secrets: inherit + + + diff --git a/.github/workflows/codestyle.yml b/.github/workflows/reusable/codestyle_v2.yml similarity index 93% rename from .github/workflows/codestyle.yml rename to .github/workflows/reusable/codestyle_v2.yml index f9c582e6ae..7b5a707b61 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/reusable/codestyle_v2.yml @@ -1,18 +1,7 @@ name: cargo fmt on: - pull_request: - branches: - - develop - types: - - opened - - reopened - - synchronize - - ready_for_review - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true + workflow_call: jobs: rustfmt: diff --git a/.github/workflows/dev-build-tests.yml b/.github/workflows/reusable/dev-build-tests_v2.yml similarity index 92% rename from .github/workflows/dev-build-tests.yml rename to .github/workflows/reusable/dev-build-tests_v2.yml index a8536f765e..eec9aef96f 100644 --- a/.github/workflows/dev-build-tests.yml +++ b/.github/workflows/reusable/dev-build-tests_v2.yml @@ -3,25 +3,16 @@ name: yarn test dev # Controls when the action will run. on: # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - develop - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + workflow_call: + #Define Workflow variables env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true +#concurrency: +# group: ${{ github.workflow }}-${{ github.head_ref }} +# cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: diff --git a/.github/workflows/reusable/execution-matrix.yml b/.github/workflows/reusable/execution-matrix.yml new file mode 100644 index 0000000000..d4c84df10d --- /dev/null +++ b/.github/workflows/reusable/execution-matrix.yml @@ -0,0 +1,42 @@ +name: Reusable workflow + +on: + workflow_call: + # Map the workflow outputs to job outputs + outputs: + matrix: + description: "The first output string" + value: ${{ jobs.create-matrix.outputs.matrix_output }} + +jobs: + + create-marix: + + name: Prepare execution matrix + + runs-on: self-hosted-ci + outputs: + matrix_output: ${{ steps.create_matrix.outputs.matrix }} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: CertainLach/create-matrix-action@v3 + id: create_matrix + with: + matrix: | + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} + network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} + network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} + diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/reusable/forkless-update-data_v2.yml similarity index 78% rename from .github/workflows/forkless-update-data.yml rename to .github/workflows/reusable/forkless-update-data_v2.yml index 95c872373a..876edce0fd 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/reusable/forkless-update-data_v2.yml @@ -1,34 +1,23 @@ -name: upgrade replica - # Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + workflow_call: + #Define Workflow variables env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true + +#concurrency: +# group: ${{ github.workflow }}-${{ github.head_ref }} +# cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - prepare-execution-marix: + execution-marix: - name: Prepare execution matrix + name: execution matrix runs-on: self-hosted-ci outputs: @@ -56,44 +45,21 @@ jobs: network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} - - forkless-update-data: - needs: prepare-execution-marix + needs: execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] timeout-minutes: 1380 - - - + name: ${{ matrix.network }} - - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - strategy: matrix: - include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + include: ${{fromJson(needs.execution-marix.outputs.matrix)}} + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 + steps: - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 @@ -201,4 +167,4 @@ jobs: - name: Stop running containers if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down --volumes diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/reusable/forkless-update-nodata_v2.yml similarity index 78% rename from .github/workflows/forkless-update-nodata.yml rename to .github/workflows/reusable/forkless-update-nodata_v2.yml index e666df9f62..cd8b851418 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/reusable/forkless-update-nodata_v2.yml @@ -1,32 +1,21 @@ -name: upgrade nodata + # Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + workflow_call: + #Define Workflow variables env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true +#concurrency: +# group: ${{ github.workflow }}-${{ github.head_ref }} +# cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - - prepare-execution-marix: + execution-marix: name: Prepare execution matrix @@ -57,14 +46,11 @@ jobs: network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} - forkless-update-nodata: - needs: prepare-execution-marix + needs: execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] - - timeout-minutes: 1380 name: ${{ matrix.network }} @@ -73,28 +59,9 @@ jobs: strategy: matrix: - include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} - + include: ${{fromJson(needs.execution-marix.outputs.matrix)}} steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 diff --git a/.github/workflows/reusable/forkless.yml b/.github/workflows/reusable/forkless.yml new file mode 100644 index 0000000000..819a4decfa --- /dev/null +++ b/.github/workflows/reusable/forkless.yml @@ -0,0 +1,18 @@ +name: Nesting Forkless + +on: + workflow_call: + +jobs: + + forkless-update-data: + name: with data + uses: ./.github/workflows/forkless-update-data_v2.yml + + forkless-update-no-data: + name: no data + uses: ./.github/workflows/forkless-update-nodata_v2.yml + + try-runtime: + name: try-runtime + uses: ./.github/workflows/try-runtime_v2.yml diff --git a/.github/workflows/reusable/generate-execution-matrix.yml b/.github/workflows/reusable/generate-execution-matrix.yml new file mode 100644 index 0000000000..48d7ae8e6f --- /dev/null +++ b/.github/workflows/reusable/generate-execution-matrix.yml @@ -0,0 +1,45 @@ +name: Prepare execution matrix + +on: + workflow_call: + # Map the workflow outputs to job outputs + outputs: + matrix_values: + description: "Matix output" + matrix: ${{ jobs.prepare-execution-matrix.outputs.matrix }} + + +#concurrency: +# group: ${{ github.workflow }}-${{ github.head_ref }} +# cancel-in-progress: true + + +jobs: + prepare-execution-matrix: + name: Generate output + runs-on: self-hosted-ci + # Map the job outputs to step outputs + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: CertainLach/create-matrix-action@v3 + id: create_matrix + with: + matrix: | + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} + network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} + network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} diff --git a/.github/workflows/reusable/market-test_v2.yml b/.github/workflows/reusable/market-test_v2.yml new file mode 100644 index 0000000000..f39c5b4315 --- /dev/null +++ b/.github/workflows/reusable/market-test_v2.yml @@ -0,0 +1,195 @@ +name: market api tests + +# Controls when the action will run. +on: + workflow_call: + + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + market_test: + # The type of runner that the job will run on + runs-on: [self-hosted-ci,large] + timeout-minutes: 1380 + + name: ${{ matrix.network }} + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: + - network: "opal" + features: "opal-runtime" + - network: "quartz" + features: "quartz-runtime" + - network: "unique" + features: "unique-runtime" + + steps: + + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout master repo + uses: actions/checkout@master + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Checkout Market e2e tests + uses: actions/checkout@v3 + with: + repository: 'UniqueNetwork/market-e2e-tests' + ssh-key: ${{ secrets.GH_PAT }} + path: 'qa-tests' + ref: 'QA-65_maxandreev' + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Copy qa-tests/.env.example to qa-tests/.env + working-directory: qa-tests + run: cp .env.docker .env + + - name: Show content of qa-test/.env + working-directory: qa-tests + run: cat .env + + - name: Read qa -test .env file + uses: xom9ikk/dotenv@v1.0.2 + with: + path: qa-tests/ + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: qa-tests/.docker/docker-compose.tmp-market.j2 + output_file: qa-tests/.docker/docker-compose.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + FEATURE=${{ matrix.features }} + BRANCH=${{ github.head_ref }} + + + - name: Show build configuration + working-directory: qa-tests + run: cat .docker/docker-compose.${{ matrix.network }}.yml + + - name: Start node-parachain + working-directory: qa-tests + run: docker-compose -f ".docker/docker-compose.market.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate node-parachain + + - name: Start nonce-app + working-directory: qa-tests + run: docker-compose -f ".docker/docker-compose.market.yml" up -d --build --remove-orphans --force-recreate nonce-app + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Setup TypeScript + working-directory: qa-tests + run: | + npm install + npm install -g ts-node + + - name: Copy qa-tests/.env.example to qa-tests/.env + working-directory: qa-tests + run: | + rm -rf .env + cp .env.example .env + + + - name: Show content of qa-test/.env + working-directory: qa-tests + run: cat .env + + + - name: Read qa -test .env file + uses: xom9ikk/dotenv@v1.0.2 + with: + path: qa-tests/ + + - name: Generate accounts + working-directory: qa-tests + run: ts-node ./src/scripts/create-market-accounts.ts + + - name: Deploy contracts + run: | + cd qa-tests + ts-node ./src/scripts/deploy-contract.ts + + - name: Import test data + working-directory: qa-tests + run: ts-node ./src/scripts/create-test-collections.ts + + - name: Show content of qa-test .env + working-directory: qa-tests + run: cat .env + + - name: Copy qa-tests/.env.example to qa-tests/.env + working-directory: qa-tests + run: | + rm -rf .env.docker + cp .env .env.docker + sed -i '/UNIQUE_WS_ENDPOINT/c UNIQUE_WS_ENDPOINT=ws://node-parachain:9944' .env.docker + + - name: Read qa -test .env file + uses: xom9ikk/dotenv@v1.0.2 + with: + path: qa-tests/ + + - name: local-market:start + run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" up -d --build + + - name: Wait for market readyness + working-directory: qa-tests + run: src/scripts/wait-market-ready.sh + shell: bash + + - name: Install dependecies + working-directory: qa-tests + run: | + npm ci + npm install -D @playwright/test + npx playwright install-deps + npx playwright install + + - name: + working-directory: qa-tests + run: | + npx playwright test --workers=8 --quiet .*.api.test.ts --reporter=github --config playwright.config.ts + + - name: Show env variables + if: success() || failure() + run: printenv + + - name: look up for report + if: success() || failure() + run: | + ls -la + ls -la qa-tests/ + + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f + docker system prune -f + + - name: Clean Workspace + if: always() + uses: AutoModality/action-clean@v1.1.0 + + + + diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/reusable/node-only-update_v2.yml similarity index 86% rename from .github/workflows/nodes-only-update.yml rename to .github/workflows/reusable/node-only-update_v2.yml index ae9779349f..c3cfd4c4ed 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/reusable/node-only-update_v2.yml @@ -2,33 +2,17 @@ name: nodes-only update # Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - + workflow_call: #Define Workflow variables env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - prepare-execution-marix: + execution-marix: - name: Prepare execution matrix + name: execution matrix runs-on: self-hosted-ci outputs: @@ -59,7 +43,7 @@ jobs: forkless-update-nodata: - needs: prepare-execution-marix + needs: execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] @@ -75,25 +59,7 @@ jobs: matrix: include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} - steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 diff --git a/.github/workflows/reusable/test_codestyle_v2.yml b/.github/workflows/reusable/test_codestyle_v2.yml new file mode 100644 index 0000000000..dc8eb63059 --- /dev/null +++ b/.github/workflows/reusable/test_codestyle_v2.yml @@ -0,0 +1,20 @@ +name: yarn eslint + +on: + workflow_call: + +jobs: + code_style: + runs-on: self-hosted-ci + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Install modules + run: cd tests && yarn + - name: Run ESLint + run: cd tests && yarn eslint --ext .ts,.js src/ diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/reusable/try-runtime_v2.yml similarity index 57% rename from .github/workflows/try-runtime.yml rename to .github/workflows/reusable/try-runtime_v2.yml index 52907787bc..b50a2505b3 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/reusable/try-runtime_v2.yml @@ -1,27 +1,5 @@ -name: try-runtime - -# Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -#Define Workflow variables -env: - REPO_URL: ${{ github.server_url }}/${{ github.repository }} - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true + workflow_call: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -37,34 +15,16 @@ jobs: matrix: include: - network: opal - features: try-runtime,opal-runtime + features: opal-runtime replica_from_address: wss://eu-ws-opal.unique.network:443 - network: quartz - features: try-runtime,quartz-runtime + features: quartz-runtime replica_from_address: wss://eu-ws-quartz.unique.network:443 - network: unique - features: try-runtime,unique-runtime + features: unique-runtime replica_from_address: wss://eu-ws.unique.network:443 steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 diff --git a/.github/workflows/unit-test.yml b/.github/workflows/reusable/unit-test_v2.yml similarity index 54% rename from .github/workflows/unit-test.yml rename to .github/workflows/reusable/unit-test_v2.yml index 1c56e04d25..7a586d10e1 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/reusable/unit-test_v2.yml @@ -3,22 +3,7 @@ name: unit tests # Controls when the action will run. on: # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - develop - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true + workflow_call: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -34,23 +19,6 @@ jobs: steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 @@ -70,7 +38,6 @@ jobs: output_file: .docker/docker-compose.unit.yml variables: | RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - FEATURE=${{ matrix.features }} - name: Show build configuration diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/reusable/xcm-testnet-build.yml similarity index 100% rename from .github/workflows/xcm-testnet-build.yml rename to .github/workflows/reusable/xcm-testnet-build.yml diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/reusable/xcm-tests_v2.yml similarity index 92% rename from .github/workflows/xcm-tests.yml rename to .github/workflows/reusable/xcm-tests_v2.yml index 8b6ec44646..09200c8c56 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/reusable/xcm-tests_v2.yml @@ -2,34 +2,17 @@ name: xcm-tests # Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + workflow_call: #Define Workflow variables env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - xcm-testnet-build: - uses: ./.github/workflows/xcm-testnet-build.yml - secrets: inherit - prepare-execution-marix: name: Prepare execution matrix diff --git a/.github/workflows/reusable/xcm.yml b/.github/workflows/reusable/xcm.yml new file mode 100644 index 0000000000..d4f7b31138 --- /dev/null +++ b/.github/workflows/reusable/xcm.yml @@ -0,0 +1,19 @@ +name: Nesting XCM + +on: + workflow_call: + + +jobs: + + xcm-testnet-build: + name: testnet build + uses: ./.github/workflows/reusable/xcm-testnet-build.yml + secrets: inherit + + xcm-tests: + name: tests + needs: [ xcm-testnet-build ] + uses: ./.github/workflows/reusable/xcm-tests_v2.yml + + diff --git a/.github/workflows/tests_codestyle.yml b/.github/workflows/tests_codestyle.yml deleted file mode 100644 index b3063d4fd7..0000000000 --- a/.github/workflows/tests_codestyle.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: yarn eslint - -on: - pull_request: - branches: - - develop - types: - - opened - - reopened - - synchronize - - ready_for_review - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -jobs: - code_style: - runs-on: self-hosted-ci - - steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Install modules - run: cd tests && yarn - - name: Run ESLint - run: cd tests && yarn eslint --ext .ts,.js src/ From d8a760018b85240ba126c1d745e6affbabc9588d Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 2 Sep 2022 13:15:40 +0300 Subject: [PATCH 0674/1274] fix: remove sub-directory from worrkflow working dir - not supported --- .github/workflows/{reusable => }/canary.yml | 0 .github/workflows/ci-develop.yml | 12 ++++++------ .github/workflows/ci-master.yml | 12 ++++++------ .github/workflows/{reusable => }/codestyle_v2.yml | 0 .../workflows/{reusable => }/dev-build-tests_v2.yml | 0 .../workflows/{reusable => }/execution-matrix.yml | 0 .../{reusable => }/forkless-update-data_v2.yml | 0 .../{reusable => }/forkless-update-nodata_v2.yml | 0 .github/workflows/{reusable => }/forkless.yml | 0 .../{reusable => }/generate-execution-matrix.yml | 0 .github/workflows/{reusable => }/market-test_v2.yml | 0 .../workflows/{reusable => }/node-only-update_v2.yml | 0 .../workflows/{reusable => }/test_codestyle_v2.yml | 0 .github/workflows/{reusable => }/try-runtime_v2.yml | 0 .github/workflows/{reusable => }/unit-test_v2.yml | 0 .../workflows/{reusable => }/xcm-testnet-build.yml | 0 .github/workflows/{reusable => }/xcm-tests_v2.yml | 0 .github/workflows/{reusable => }/xcm.yml | 0 18 files changed, 12 insertions(+), 12 deletions(-) rename .github/workflows/{reusable => }/canary.yml (100%) rename .github/workflows/{reusable => }/codestyle_v2.yml (100%) rename .github/workflows/{reusable => }/dev-build-tests_v2.yml (100%) rename .github/workflows/{reusable => }/execution-matrix.yml (100%) rename .github/workflows/{reusable => }/forkless-update-data_v2.yml (100%) rename .github/workflows/{reusable => }/forkless-update-nodata_v2.yml (100%) rename .github/workflows/{reusable => }/forkless.yml (100%) rename .github/workflows/{reusable => }/generate-execution-matrix.yml (100%) rename .github/workflows/{reusable => }/market-test_v2.yml (100%) rename .github/workflows/{reusable => }/node-only-update_v2.yml (100%) rename .github/workflows/{reusable => }/test_codestyle_v2.yml (100%) rename .github/workflows/{reusable => }/try-runtime_v2.yml (100%) rename .github/workflows/{reusable => }/unit-test_v2.yml (100%) rename .github/workflows/{reusable => }/xcm-testnet-build.yml (100%) rename .github/workflows/{reusable => }/xcm-tests_v2.yml (100%) rename .github/workflows/{reusable => }/xcm.yml (100%) diff --git a/.github/workflows/reusable/canary.yml b/.github/workflows/canary.yml similarity index 100% rename from .github/workflows/reusable/canary.yml rename to .github/workflows/canary.yml diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index 0a67e4ad23..ca0a5fa959 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -18,25 +18,25 @@ jobs: yarn-test-dev: if: github.event.pull_request.draft == false - uses: ./.github/workflows/reusable/dev-build-tests_v2.yml + uses: ./.github/workflows/dev-build-tests_v2.yml unit-test: if: github.event.pull_request.draft == false - uses: ./.github/workflows/reusable/unit-test_v2.yml + uses: ./.github/workflows/unit-test_v2.yml forkless: if: contains( github.event.pull_request.labels.*.name, 'forkless') - uses: ./.github/workflows/reusable/forkless.yml + uses: ./.github/workflows/forkless.yml canary: if: contains( github.event.pull_request.labels.*.name, 'canary') - uses: ./.github/workflows/reusable/canary.yml + uses: ./.github/workflows/canary.yml secrets: inherit # pass all secrets xcm: if: contains( github.event.pull_request.labels.*.name, 'xcm') - uses: ./.github/workflows/reusable/xcm.yml + uses: ./.github/workflows/xcm.yml codestyle: - uses: ./.github/workflows/reusable/codestyle_v2.yml \ No newline at end of file + uses: ./.github/workflows/codestyle_v2.yml \ No newline at end of file diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index 4fd3a676ff..cf8fd91a24 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -18,25 +18,25 @@ jobs: unit-test: if: github.event.pull_request.draft != true - uses: ./.github/workflows/reusable/unit-test_v2.yml + uses: ./.github/workflows/unit-test_v2.yml node-only-update: if: github.event.pull_request.draft == false - uses: ./.github/workflows/reusable/node-only-update_v2.yml + uses: ./.github/workflows/node-only-update_v2.yml forkless: if: contains( github.event.pull_request.labels.*.name, 'forkless') - uses: ./.github/workflows/reusable/forkless.yml + uses: ./.github/workflows/forkless.yml canary: if: contains( github.event.pull_request.labels.*.name, 'canary') - uses: ./.github/workflows/reusable/canary.yml + uses: ./.github/workflows/canary.yml secrets: inherit # pass all secrets xcm: if: contains( github.event.pull_request.labels.*.name, 'xcm') - uses: ./.github/workflows/reusable/xcm.yml + uses: ./.github/workflows/xcm.yml codestyle: if: github.event.pull_request.draft == false - uses: ./.github/workflows/reusable/codestyle_v2.yml \ No newline at end of file + uses: ./.github/workflows/codestyle_v2.yml \ No newline at end of file diff --git a/.github/workflows/reusable/codestyle_v2.yml b/.github/workflows/codestyle_v2.yml similarity index 100% rename from .github/workflows/reusable/codestyle_v2.yml rename to .github/workflows/codestyle_v2.yml diff --git a/.github/workflows/reusable/dev-build-tests_v2.yml b/.github/workflows/dev-build-tests_v2.yml similarity index 100% rename from .github/workflows/reusable/dev-build-tests_v2.yml rename to .github/workflows/dev-build-tests_v2.yml diff --git a/.github/workflows/reusable/execution-matrix.yml b/.github/workflows/execution-matrix.yml similarity index 100% rename from .github/workflows/reusable/execution-matrix.yml rename to .github/workflows/execution-matrix.yml diff --git a/.github/workflows/reusable/forkless-update-data_v2.yml b/.github/workflows/forkless-update-data_v2.yml similarity index 100% rename from .github/workflows/reusable/forkless-update-data_v2.yml rename to .github/workflows/forkless-update-data_v2.yml diff --git a/.github/workflows/reusable/forkless-update-nodata_v2.yml b/.github/workflows/forkless-update-nodata_v2.yml similarity index 100% rename from .github/workflows/reusable/forkless-update-nodata_v2.yml rename to .github/workflows/forkless-update-nodata_v2.yml diff --git a/.github/workflows/reusable/forkless.yml b/.github/workflows/forkless.yml similarity index 100% rename from .github/workflows/reusable/forkless.yml rename to .github/workflows/forkless.yml diff --git a/.github/workflows/reusable/generate-execution-matrix.yml b/.github/workflows/generate-execution-matrix.yml similarity index 100% rename from .github/workflows/reusable/generate-execution-matrix.yml rename to .github/workflows/generate-execution-matrix.yml diff --git a/.github/workflows/reusable/market-test_v2.yml b/.github/workflows/market-test_v2.yml similarity index 100% rename from .github/workflows/reusable/market-test_v2.yml rename to .github/workflows/market-test_v2.yml diff --git a/.github/workflows/reusable/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml similarity index 100% rename from .github/workflows/reusable/node-only-update_v2.yml rename to .github/workflows/node-only-update_v2.yml diff --git a/.github/workflows/reusable/test_codestyle_v2.yml b/.github/workflows/test_codestyle_v2.yml similarity index 100% rename from .github/workflows/reusable/test_codestyle_v2.yml rename to .github/workflows/test_codestyle_v2.yml diff --git a/.github/workflows/reusable/try-runtime_v2.yml b/.github/workflows/try-runtime_v2.yml similarity index 100% rename from .github/workflows/reusable/try-runtime_v2.yml rename to .github/workflows/try-runtime_v2.yml diff --git a/.github/workflows/reusable/unit-test_v2.yml b/.github/workflows/unit-test_v2.yml similarity index 100% rename from .github/workflows/reusable/unit-test_v2.yml rename to .github/workflows/unit-test_v2.yml diff --git a/.github/workflows/reusable/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml similarity index 100% rename from .github/workflows/reusable/xcm-testnet-build.yml rename to .github/workflows/xcm-testnet-build.yml diff --git a/.github/workflows/reusable/xcm-tests_v2.yml b/.github/workflows/xcm-tests_v2.yml similarity index 100% rename from .github/workflows/reusable/xcm-tests_v2.yml rename to .github/workflows/xcm-tests_v2.yml diff --git a/.github/workflows/reusable/xcm.yml b/.github/workflows/xcm.yml similarity index 100% rename from .github/workflows/reusable/xcm.yml rename to .github/workflows/xcm.yml From 9cab02825ca9084eda633d0bf2d6b1b8c8284a09 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 2 Sep 2022 13:18:13 +0300 Subject: [PATCH 0675/1274] fix: remove sub-directory from path to reusable workflows - not supported by github --- .github/workflows/xcm-tests_v2.yml | 2 +- .github/workflows/xcm.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/xcm-tests_v2.yml b/.github/workflows/xcm-tests_v2.yml index 09200c8c56..2ec9d26518 100644 --- a/.github/workflows/xcm-tests_v2.yml +++ b/.github/workflows/xcm-tests_v2.yml @@ -62,7 +62,7 @@ jobs: steps: - - name: Skip if pull request is in Draft + - name: Skip if pull request is in Draft if: github.event.pull_request.draft == true run: exit 1 diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index d4f7b31138..c662de8859 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -8,12 +8,12 @@ jobs: xcm-testnet-build: name: testnet build - uses: ./.github/workflows/reusable/xcm-testnet-build.yml + uses: ./.github/workflows/xcm-testnet-build.yml secrets: inherit xcm-tests: name: tests needs: [ xcm-testnet-build ] - uses: ./.github/workflows/reusable/xcm-tests_v2.yml + uses: ./.github/workflows/xcm-tests_v2.yml From 2fd0e86ac3cf0e67fdb6e5e112a779ebab90fc0b Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 2 Sep 2022 13:21:43 +0300 Subject: [PATCH 0676/1274] fix: remove needs from job definition. dependencies implemented by re-usable workflow --- .github/workflows/xcm-tests_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xcm-tests_v2.yml b/.github/workflows/xcm-tests_v2.yml index 2ec9d26518..ba6ac00060 100644 --- a/.github/workflows/xcm-tests_v2.yml +++ b/.github/workflows/xcm-tests_v2.yml @@ -17,7 +17,7 @@ jobs: name: Prepare execution matrix - needs: [xcm-testnet-build] +# needs: [xcm-testnet-build] runs-on: XL outputs: From d647f79b49a067fe3a23437e08c968324e37d980 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Fri, 2 Sep 2022 13:23:20 +0300 Subject: [PATCH 0677/1274] Tests: create test accounts before all tests to speed up --- tests/src/app-promotion.test.ts | 134 ++++++++++++++++++-------------- 1 file changed, 75 insertions(+), 59 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index df0f299b05..de4f341a6c 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -33,17 +33,16 @@ chai.use(chaiAsPromised); const expect = chai.expect; let alice: IKeyringPair; -let bob: IKeyringPair; let palletAdmin: IKeyringPair; let nominal: bigint; let promotionStartBlock: number | null = null; const palletAddress = calculatePalleteAddress('appstake'); +let accounts: IKeyringPair[] = []; before(async function () { await usingPlaygrounds(async (helper, privateKeyWrapper) => { if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); palletAdmin = privateKeyWrapper('//Charlie'); // TODO use custom address await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address}))); nominal = helper.balance.getOneTokenNominal(); @@ -53,6 +52,7 @@ before(async function () { promotionStartBlock = (await helper.api!.query.parachainSystem.lastRelayChainBlockNumber()).toNumber(); } await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.startAppPromotion(promotionStartBlock!))); + accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests }); }); @@ -65,51 +65,62 @@ after(async function () { describe('app-promotions.stake extrinsic', () => { it('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async () => { await usingPlaygrounds(async (helper) => { + const [staker, recepient] = [accounts.pop()!, accounts.pop()!]; const totalStakedBefore = await helper.staking.getTotalStaked(); - const [staker, recepient] = await helper.arrange.createAccounts([400n, 0n], alice); // Minimum stake amount is 100: await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.eventually.rejected; await helper.staking.stake(staker, 100n * nominal); // Staker balance is: miscFrozen: 100, feeFrozen: 100, reserved: 0n... - // ...so he can not transfer 300 + // ...so he can not transfer 900 expect (await helper.balance.getSubstrateFull(staker.address)).to.contain({miscFrozen: 100n * nominal, feeFrozen: 100n * nominal, reserved: 0n}); - await expect(helper.balance.transferToSubstrate(staker, recepient.address, 300n * nominal)).to.be.rejected; + await expect(helper.balance.transferToSubstrate(staker, recepient.address, 900n * nominal)).to.be.rejected; - // 100 -> 24 locked 100; staked 0; 24 => locked 100 staked 100 expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(100n * nominal); - // TODO should be 0 expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(100n * nominal); - expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(399n); + expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); // it is potentially flaky test. Promotion can credited some tokens. Maybe we need to use closeTo? expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + 100n * nominal); // total tokens amount staked in app-promotion increased - await helper.staking.stake(staker, 200n * nominal); + await helper.staking.stake(staker, 200n * nominal); expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(300n * nominal); expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(300n * nominal); expect((await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map((x) => x[1])).to.be.deep.equal([100n * nominal, 200n * nominal]); }); }); + + it('should allow to stake with nonce', async () => { + await usingPlaygrounds(async (helper) => { + const staker = accounts.pop()!; + const transactions = []; + for (let nonce = 0; nonce < 9; nonce++) { + transactions.push(helper.signTransaction(staker, helper.api?.tx.promotion.stake(100n * nominal), 'Staker stakes with nonce', {nonce})); + } + await Promise.allSettled(transactions); + + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(900n * nominal); + }); + }); it('should reject transaction if stake amount is more than total free balance minus frozen', async () => { await usingPlaygrounds(async helper => { - const [staker] = await helper.arrange.createAccounts([300n], alice); + const staker = accounts.pop()!; // Can't stake full balance because Alice needs to pay some fee - await expect(helper.staking.stake(staker, 300n * nominal)).to.be.eventually.rejected; - await helper.staking.stake(staker, 150n * nominal); + await expect(helper.staking.stake(staker, 1000n * nominal)).to.be.eventually.rejected; + await helper.staking.stake(staker, 500n * nominal); - // Can't stake 150 tkn because Alice has Less than 150 free - frozen tokens; - await expect(helper.staking.stake(staker, 150n * nominal)).to.be.eventually.rejected; - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(150n * nominal); + // Can't stake 500 tkn because Alice has Less than 500 transferable; + await expect(helper.staking.stake(staker, 500n * nominal)).to.be.eventually.rejected; + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(500n * nominal); }); }); it('for different accounts in one block is possible', async () => { await usingPlaygrounds(async helper => { - const crowd = await helper.arrange.createAccounts([1000n, 1000n, 1000n, 1000n], alice); + const crowd = [accounts.pop()!, accounts.pop()!, accounts.pop()!, accounts.pop()!]; const crowdStartsToStake = crowd.map(user => helper.staking.stake(user, 100n * nominal)); await expect(Promise.all(crowdStartsToStake)).to.be.eventually.fulfilled; @@ -118,24 +129,25 @@ describe('app-promotions.stake extrinsic', () => { expect(crowdStakes).to.deep.equal([100n * nominal, 100n * nominal, 100n * nominal, 100n * nominal]); }); }); + + it('should allow to create maximum 10 stakes for account', async () => { + + }); }); describe('unstake balance extrinsic', () => { - it('should change balance state to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => { + it('should change balance state from "frozen" to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => { await usingPlaygrounds(async helper => { + const [staker, recepient] = [accounts.pop()!, accounts.pop()!]; const totalStakedBefore = await helper.staking.getTotalStaked(); - const [staker, recepient] = await helper.arrange.createAccounts([600n, 0n], alice); - await helper.staking.stake(staker, 500n * nominal); + await helper.staking.stake(staker, 900n * nominal); await helper.staking.unstake(staker); - // balance state still - - // Stakers balance now: {free: <100n, reserved: 500n, miscFrozen: 0, feeFrozen: 0}; + // Right after unstake balance is reserved // Staker can not transfer - // TODO expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 500n * nominal, miscFrozen: 0n, feeFrozen: 0n}); + expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 900n * nominal, miscFrozen: 0n, feeFrozen: 0n}); await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejected; - - expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(500n * nominal); + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(900n * nominal); expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore); }); @@ -143,21 +155,24 @@ describe('unstake balance extrinsic', () => { it('should unlock balance after unlocking period ends and subtract it from "pendingUnstake"', async () => { await usingPlaygrounds(async (helper) => { - const [staker] = await helper.arrange.createAccounts([1000n], alice); + const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); await helper.staking.unstake(staker); - await waitForRelayBlock(helper.api!, 20); // Wait for unstaking period. Balance now free ~1000; reserved, frozen, miscFrozeb: 0n await waitForRelayBlock(helper.api!, 20); expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n * nominal, miscFrozen: 0n, feeFrozen: 0n}); expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); + + // staker can transfer: + await helper.balance.transferToSubstrate(staker, alice.address, 998n * nominal); + expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(1n); }); }); it('should successfully unstake multiple stakes', async () => { await usingPlaygrounds(async helper => { - const [staker] = await helper.arrange.createAccounts([1000n], alice); + const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); await helper.staking.stake(staker, 200n * nominal); await helper.staking.stake(staker, 300n * nominal); @@ -188,7 +203,7 @@ describe('unstake balance extrinsic', () => { it('should not have any effects if no active stakes', async () => { await usingPlaygrounds(async (helper) => { - const [staker] = await helper.arrange.createAccounts([1000n], alice); + const staker = accounts.pop()!; // unstake has no effect if no stakes at all await helper.staking.unstake(staker); @@ -211,7 +226,7 @@ describe('unstake balance extrinsic', () => { it('should keep different unlocking block for each unlocking stake', async () => { await usingPlaygrounds(async (helper) => { - const [staker] = await helper.arrange.createAccounts([1000n], alice); + const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); await helper.staking.unstake(staker); await helper.staking.stake(staker, 120n * nominal); @@ -226,7 +241,7 @@ describe('unstake balance extrinsic', () => { it('should be possible for different accounts in one block', async () => { await usingPlaygrounds(async (helper) => { - const stakers = await helper.arrange.createAccounts([200n, 200n, 200n, 200n, 200n], alice); + const stakers = [accounts.pop()!, accounts.pop()!, accounts.pop()!, accounts.pop()!, accounts.pop()!]; await Promise.all(stakers.map(staker => helper.staking.stake(staker, 100n * nominal))); await Promise.all(stakers.map(staker => helper.staking.unstake(staker))); @@ -244,9 +259,10 @@ describe('unstake balance extrinsic', () => { describe('Admin adress', () => { it('can be set by sudo only', async () => { await usingPlaygrounds(async (helper) => { - // Bob can not set admin not from himself nor as a sudo - await expect(helper.signTransaction(bob, helper.api!.tx.promotion.setAdminAddress({Substrate: bob.address}))).to.be.eventually.rejected; - await expect(helper.signTransaction(bob, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: bob.address})))).to.be.eventually.rejected; + const nonAdmin = accounts.pop()!; + // nonAdmin can not set admin not from himself nor as a sudo + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.eventually.rejected; + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.eventually.rejected; // Alice can await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled; @@ -257,21 +273,21 @@ describe('Admin adress', () => { // We are not going to set an eth address as a sponsor, // but we do want to check, it doesn't break anything; await usingPlaygrounds(async (helper) => { - const [charlie] = await helper.arrange.createAccounts([10n], alice); - const ethCharlie = helper.address.substrateToEth(charlie.address); + const account = accounts.pop()!; + const ethAccount = helper.address.substrateToEth(account.address); // Alice sets Ethereum address as a sudo. Then Substrate address back... - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Ethereum: ethCharlie})))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Ethereum: ethAccount})))).to.be.eventually.fulfilled; await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled; // ...It doesn't break anything; - const collection = await helper.nft.mintCollection(charlie, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(charlie, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; + const collection = await helper.nft.mintCollection(account, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + await expect(helper.signTransaction(account, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; }); }); it('can be reassigned', async () => { await usingPlaygrounds(async (helper) => { - const [oldAdmin, newAdmin, collectionOwner] = await helper.arrange.createAccounts([10n, 10n, 10n], alice); + const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.eventually.fulfilled; @@ -293,7 +309,7 @@ describe('App-promotion collection sponsoring', () => { it('should actually sponsor transactions', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner, tokenSender, receiver] = await helper.arrange.createAccounts([10n, 10n, 0n], alice); + const [collectionOwner, tokenSender, receiver] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'Name', description: 'Description', tokenPrefix: 'Prefix', limits: {sponsorTransferTimeout: 0}}); const token = await collection.mintToken(collectionOwner, {Substrate: tokenSender.address}); await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId)); @@ -303,15 +319,15 @@ describe('App-promotion collection sponsoring', () => { expect (await token.getOwner()).to.be.deep.equal({Substrate: receiver.address}); const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress); - // senders balance the same - expect (await helper.balance.getSubstrate(tokenSender.address)).to.be.equal(10n * nominal); + // senders balance the same, transaction has sponsored + expect (await helper.balance.getSubstrate(tokenSender.address)).to.be.equal(1000n * nominal); expect (palletBalanceBefore > palletBalanceAfter).to.be.true; }); }); it('can not be set by non admin', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner, nonAdmin] = await helper.arrange.createAccounts([10n, 10n], alice); + const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); @@ -322,7 +338,7 @@ describe('App-promotion collection sponsoring', () => { it('should set pallet address as confirmed admin', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner, oldSponsor] = await helper.arrange.createAccounts([20n, 20n], alice); + const [collectionOwner, oldSponsor] = [accounts.pop()!, accounts.pop()!]; // Can set sponsoring for collection without sponsor const collectionWithoutSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'No-sponsor', description: 'New Collection', tokenPrefix: 'Promotion'}); @@ -345,7 +361,7 @@ describe('App-promotion collection sponsoring', () => { it('can be overwritten by collection owner', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner, newSponsor] = await helper.arrange.createAccounts([20n, 0n], alice); + const [collectionOwner, newSponsor] = [accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); const collectionId = collection.collectionId; @@ -374,7 +390,7 @@ describe('App-promotion collection sponsoring', () => { it('should reject transaction if collection doesn\'t exist', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner] = await helper.arrange.createAccounts([10n], alice); + const collectionOwner = accounts.pop()!; // collection has never existed await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(999999999))).to.be.eventually.rejected; @@ -390,7 +406,7 @@ describe('App-promotion collection sponsoring', () => { describe('app-promotion stopSponsoringCollection', () => { it('can not be called by non-admin', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner, nonAdmin] = await helper.arrange.createAccounts([10n, 10n], alice); + const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; @@ -402,7 +418,7 @@ describe('app-promotion stopSponsoringCollection', () => { it('should set sponsoring as disabled', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner, recepient] = await helper.arrange.createAccounts([10n, 0n], alice); + const [collectionOwner, recepient] = [accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits: {sponsorTransferTimeout: 0}}); const token = await collection.mintToken(collectionOwner, {Substrate: collectionOwner.address}); @@ -421,7 +437,7 @@ describe('app-promotion stopSponsoringCollection', () => { it('should not affect collection which is not sponsored by pallete', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner] = await helper.arrange.createAccounts([10n, 10n], alice); + const collectionOwner = accounts.pop()!; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address}); await collection.confirmSponsorship(collectionOwner); @@ -433,7 +449,7 @@ describe('app-promotion stopSponsoringCollection', () => { it('should reject transaction if collection does not exist', async () => { await usingPlaygrounds(async (helper) => { - const [collectionOwner] = await helper.arrange.createAccounts([10n], alice); + const collectionOwner = accounts.pop()!; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await collection.burn(collectionOwner); @@ -515,7 +531,7 @@ describe('app-promotion contract sponsoring', () => { itWeb3('can not be set by non admin', async ({api, web3, privateKeyWrapper}) => { await usingPlaygrounds(async (helper) => { - const [nonAdmin] = await helper.arrange.createAccounts([50n], alice); + const nonAdmin = accounts.pop()!; const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); const flipper = await deployFlipper(web3, contractOwner); const contractMethods = contractHelpers(web3, contractOwner); @@ -595,7 +611,7 @@ describe('app-promotion stopSponsoringContract', () => { itWeb3('can not be called by non-admin', async ({api, web3, privateKeyWrapper}) => { await usingPlaygrounds(async (helper) => { - const [nonAdmin] = await helper.arrange.createAccounts([10n], alice); + const nonAdmin = accounts.pop()!; const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); const flipper = await deployFlipper(web3, contractOwner); @@ -606,7 +622,7 @@ describe('app-promotion stopSponsoringContract', () => { itWeb3('should not affect a contract which is not sponsored by pallete', async ({api, web3, privateKeyWrapper}) => { await usingPlaygrounds(async (helper) => { - const [nonAdmin] = await helper.arrange.createAccounts([10n], alice); + const nonAdmin = accounts.pop()!; const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); const flipper = await deployFlipper(web3, contractOwner); const contractHelper = contractHelpers(web3, contractOwner); @@ -620,7 +636,7 @@ describe('app-promotion stopSponsoringContract', () => { describe('app-promotion rewards', () => { it('can not be called by non admin', async () => { await usingPlaygrounds(async (helper) => { - const [nonAdmin] = await helper.arrange.createAccounts([10n], alice); + const nonAdmin = accounts.pop()!; await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.payoutStakers(50))).to.be.rejected; }); }); @@ -628,7 +644,7 @@ describe('app-promotion rewards', () => { it('should credit 0.05% for staking period', async () => { // TODO flaky test await usingPlaygrounds(async helper => { - const [staker] = await helper.arrange.createAccounts([5000n], alice); + const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); await helper.staking.stake(staker, 200n * nominal); @@ -642,7 +658,7 @@ describe('app-promotion rewards', () => { it('shoud be paid for more than one period if payments was missed', async () => { await usingPlaygrounds(async (helper) => { - const [staker] = await helper.arrange.createAccounts([400n], alice); + const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); await helper.staking.stake(staker, 200n * nominal); @@ -663,14 +679,14 @@ describe('app-promotion rewards', () => { it('should not be credited for unstaked (reserved) balance', async () => { expect.fail('Test not implemented'); await usingPlaygrounds(async helper => { - const staker = await helper.arrange.createAccounts([1000n], alice); + const staker = accounts.pop()!; }); }); it('should bring compound interest', async () => { // TODO flaky test await usingPlaygrounds(async helper => { - const [staker] = await helper.arrange.createAccounts([800n], alice); + const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); await helper.staking.stake(staker, 200n * nominal); From 0872731978a119905ddd509efc76573f1c6b680c Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 2 Sep 2022 13:27:42 +0300 Subject: [PATCH 0678/1274] fix: add secrets inheretance --- .github/workflows/ci-develop.yml | 1 + .github/workflows/ci-master.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index ca0a5fa959..b9cf524265 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -37,6 +37,7 @@ jobs: xcm: if: contains( github.event.pull_request.labels.*.name, 'xcm') uses: ./.github/workflows/xcm.yml + secrets: inherit # pass all secrets codestyle: uses: ./.github/workflows/codestyle_v2.yml \ No newline at end of file diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index cf8fd91a24..2e6abd6f85 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -36,6 +36,7 @@ jobs: xcm: if: contains( github.event.pull_request.labels.*.name, 'xcm') uses: ./.github/workflows/xcm.yml + secrets: inherit # pass all secrets codestyle: if: github.event.pull_request.draft == false From 9df3a53c8a16c16cd7cb2e3508dd357993859b95 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 2 Sep 2022 10:28:21 +0000 Subject: [PATCH 0679/1274] test(util): replace label with native error message + shift default amounts in functions to 1 --- tests/src/util/playgrounds/unique.ts | 561 +++++++++++++-------------- 1 file changed, 264 insertions(+), 297 deletions(-) diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 0c2aabe759..3ae6aa2707 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -91,9 +91,9 @@ class UniqueUtil { return encodeAddress(decodeAddress(address), ss58Format); } - static extractCollectionIdFromCreationResult(creationResult: ITransactionResult, label = 'new collection') { + static extractCollectionIdFromCreationResult(creationResult: ITransactionResult) { if (creationResult.status !== this.transactionStatus.SUCCESS) { - throw Error(`Unable to create collection for ${label}`); + throw Error('Unable to create collection!'); } let collectionId = null; @@ -104,15 +104,15 @@ class UniqueUtil { }); if (collectionId === null) { - throw Error(`No CollectionCreated event for ${label}`); + throw Error('No CollectionCreated event was found!'); } return collectionId; } - static extractTokensFromCreationResult(creationResult: ITransactionResult, label = 'new tokens') { + static extractTokensFromCreationResult(creationResult: ITransactionResult) { if (creationResult.status !== this.transactionStatus.SUCCESS) { - throw Error(`Unable to create tokens for ${label}`); + throw Error('Unable to create tokens!'); } let success = false; const tokens = [] as any; @@ -130,9 +130,9 @@ class UniqueUtil { return {success, tokens}; } - static extractTokensFromBurnResult(burnResult: ITransactionResult, label = 'burned tokens') { + static extractTokensFromBurnResult(burnResult: ITransactionResult) { if (burnResult.status !== this.transactionStatus.SUCCESS) { - throw Error(`Unable to burn tokens for ${label}`); + throw Error('Unable to burn tokens!'); } let success = false; const tokens = [] as any; @@ -150,7 +150,7 @@ class UniqueUtil { return {success, tokens}; } - static findCollectionInEvents(events: {event: IChainEvent}[], collectionId: number, expectedSection: string, expectedMethod: string, label?: string) { + static findCollectionInEvents(events: {event: IChainEvent}[], collectionId: number, expectedSection: string, expectedMethod: string) { let eventId = null; events.forEach(({event: {data, method, section}}) => { if ((section === expectedSection) && (method === expectedMethod)) { @@ -159,7 +159,7 @@ class UniqueUtil { }); if (eventId === null) { - throw Error(`No ${expectedMethod} event for ${label}`); + throw Error(`No ${expectedMethod} event was found!`); } return eventId === collectionId; } @@ -364,7 +364,7 @@ class ChainHelperBase { return call(...params); } - async executeExtrinsic(sender: TSigner, extrinsic: string, params: any[], expectSuccess=false, failureMessage='expected success') { + async executeExtrinsic(sender: TSigner, extrinsic: string, params: any[], expectSuccess=false/*, failureMessage='expected success'*/) { if(this.api === null) throw Error('API not initialized'); if(!extrinsic.startsWith('api.tx.')) throw Error(`${extrinsic} is not transaction`); @@ -396,7 +396,7 @@ class ChainHelperBase { this.chainLog.push(log); - if(expectSuccess && result.status !== this.transactionStatus.SUCCESS) throw Error(failureMessage); + if(expectSuccess && result.status !== this.transactionStatus.SUCCESS) throw Error(`${result.moduleError}`); return result; } @@ -556,19 +556,17 @@ class CollectionGroup extends HelperGroup { * * @param signer keyring of signer * @param collectionId ID of collection - * @param label extra label for log * @example await helper.collection.burn(aliceKeyring, 3); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async burn(signer: TSigner, collectionId: number, label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async burn(signer: TSigner, collectionId: number): Promise { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.destroyCollection', [collectionId], - true, `Unable to burn collection for ${label}`, + true, ); - return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionDestroyed', label); + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionDestroyed'); } /** @@ -577,19 +575,17 @@ class CollectionGroup extends HelperGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param sponsorAddress Sponsor substrate address - * @param label extra label for log * @example setSponsor(aliceKeyring, 10, "5DyN4Y92vZCjv38fg...") * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async setSponsor(signer: TSigner, collectionId: number, sponsorAddress: TSubstrateAccount, label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async setSponsor(signer: TSigner, collectionId: number, sponsorAddress: TSubstrateAccount): Promise { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.setCollectionSponsor', [collectionId, sponsorAddress], - true, `Unable to set collection sponsor for ${label}`, + true, ); - return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionSponsorSet', label); + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionSponsorSet'); } /** @@ -597,19 +593,17 @@ class CollectionGroup extends HelperGroup { * * @param signer keyring of signer * @param collectionId ID of collection - * @param label extra label for log * @example confirmSponsorship(aliceKeyring, 10) * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async confirmSponsorship(signer: TSigner, collectionId: number, label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async confirmSponsorship(signer: TSigner, collectionId: number): Promise { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.confirmSponsorship', [collectionId], - true, `Unable to confirm collection sponsorship for ${label}`, + true, ); - return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'SponsorshipConfirmed', label); + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'SponsorshipConfirmed'); } /** @@ -618,7 +612,6 @@ class CollectionGroup extends HelperGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param limits collection limits object - * @param label extra label for log * @example * await setLimits( * aliceKeyring, @@ -630,15 +623,14 @@ class CollectionGroup extends HelperGroup { * ) * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async setLimits(signer: TSigner, collectionId: number, limits: ICollectionLimits, label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async setLimits(signer: TSigner, collectionId: number, limits: ICollectionLimits): Promise { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.setCollectionLimits', [collectionId, limits], - true, `Unable to set collection limits for ${label}`, + true, ); - return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionLimitSet', label); + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionLimitSet'); } /** @@ -647,19 +639,17 @@ class CollectionGroup extends HelperGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param ownerAddress substrate address of new owner - * @param label extra label for log * @example changeOwner(aliceKeyring, 10, "5DyN4Y92vZCjv38fg...") * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async changeOwner(signer: TSigner, collectionId: number, ownerAddress: TSubstrateAccount, label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async changeOwner(signer: TSigner, collectionId: number, ownerAddress: TSubstrateAccount): Promise { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.changeCollectionOwner', [collectionId, ownerAddress], - true, `Unable to change collection owner for ${label}`, + true, ); - return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionOwnedChanged', label); + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionOwnedChanged'); } /** @@ -668,19 +658,36 @@ class CollectionGroup extends HelperGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param adminAddressObj Administrator address (substrate or ethereum) - * @param label extra label for log * @example addAdmin(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."}) * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async addAdmin(signer: TSigner, collectionId: number, adminAddressObj: ICrossAccountId, label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async addAdmin(signer: TSigner, collectionId: number, adminAddressObj: ICrossAccountId): Promise { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.addCollectionAdmin', [collectionId, adminAddressObj], - true, `Unable to add collection admin for ${label}`, + true, ); - return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionAdminAdded', label); + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionAdminAdded'); + } + + /** + * Removes a collection administrator. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param adminAddressObj Administrator address (substrate or ethereum) + * @example removeAdmin(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."}) + * @returns ```true``` if extrinsic success, otherwise ```false``` + */ + async removeAdmin(signer: TSigner, collectionId: number, adminAddressObj: ICrossAccountId): Promise { + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.removeCollectionAdmin', [collectionId, adminAddressObj], + true, + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionAdminRemoved'); } /** @@ -688,39 +695,34 @@ class CollectionGroup extends HelperGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param addressObj address to add to the allow list - * @param label extra label for log * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async addToAllowList(signer: TSigner, collectionId: number, addressObj: ICrossAccountId, label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async addToAllowList(signer: TSigner, collectionId: number, addressObj: ICrossAccountId): Promise { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.addToAllowList', [collectionId, addressObj], - true, `Unable to add address to allow list for ${label}`, + true, ); return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'AllowListAddressAdded'); } /** - * Removes a collection administrator. + * Removes an address from allow list * * @param signer keyring of signer * @param collectionId ID of collection - * @param adminAddressObj Administrator address (substrate or ethereum) - * @param label extra label for log - * @example removeAdmin(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."}) + * @param addressObj address to remove from the allow list * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async removeAdmin(signer: TSigner, collectionId: number, adminAddressObj: ICrossAccountId, label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async removeFromAllowList(signer: TSigner, collectionId: number, addressObj: ICrossAccountId): Promise { const result = await this.helper.executeExtrinsic( signer, - 'api.tx.unique.removeCollectionAdmin', [collectionId, adminAddressObj], - true, `Unable to remove collection admin for ${label}`, + 'api.tx.unique.removeFromAllowList', [collectionId, addressObj], + true, ); - return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionAdminRemoved', label); + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'AllowListAddressRemoved'); } /** @@ -729,19 +731,17 @@ class CollectionGroup extends HelperGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param permissions collection permissions object - * @param label extra label for log * @example setPermissions(aliceKeyring, 10, {access:'AllowList', mintMode: true, nesting: {collectionAdmin: true, tokenOwner: true}}); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async setPermissions(signer: TSigner, collectionId: number, permissions: ICollectionPermissions, label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async setPermissions(signer: TSigner, collectionId: number, permissions: ICollectionPermissions): Promise { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.setCollectionPermissions', [collectionId, permissions], - true, `Unable to set collection permissions for ${label}`, + true, ); - return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionPermissionSet', label); + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionPermissionSet'); } /** @@ -750,12 +750,11 @@ class CollectionGroup extends HelperGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param permissions nesting permissions object - * @param label extra label for log * @example enableNesting(aliceKeyring, 10, {collectionAdmin: true, tokenOwner: true}); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async enableNesting(signer: TSigner, collectionId: number, permissions: INestingPermissions, label?: string): Promise { - return await this.setPermissions(signer, collectionId, {nesting: permissions}, label); + async enableNesting(signer: TSigner, collectionId: number, permissions: INestingPermissions): Promise { + return await this.setPermissions(signer, collectionId, {nesting: permissions}); } /** @@ -763,12 +762,11 @@ class CollectionGroup extends HelperGroup { * * @param signer keyring of signer * @param collectionId ID of collection - * @param label extra label for log * @example disableNesting(aliceKeyring, 10); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async disableNesting(signer: TSigner, collectionId: number, label?: string): Promise { - return await this.setPermissions(signer, collectionId, {nesting: {tokenOwner: false, collectionAdmin: false}}, label); + async disableNesting(signer: TSigner, collectionId: number): Promise { + return await this.setPermissions(signer, collectionId, {nesting: {tokenOwner: false, collectionAdmin: false}}); } /** @@ -777,19 +775,17 @@ class CollectionGroup extends HelperGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param properties array of property objects - * @param label extra label for log * @example setProperties(aliceKeyring, 10, [{key: "gender", value: "male"}]); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async setProperties(signer: TSigner, collectionId: number, properties: IProperty[], label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async setProperties(signer: TSigner, collectionId: number, properties: IProperty[]): Promise { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.setCollectionProperties', [collectionId, properties], - true, `Unable to set collection properties for ${label}`, + true, ); - return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionPropertySet', label); + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionPropertySet'); } /** @@ -798,19 +794,17 @@ class CollectionGroup extends HelperGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param propertyKeys array of property keys to delete - * @param label * @example deleteProperties(aliceKeyring, 10, ["gender", "age"]); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async deleteProperties(signer: TSigner, collectionId: number, propertyKeys: string[], label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async deleteProperties(signer: TSigner, collectionId: number, propertyKeys: string[]): Promise { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.deleteCollectionProperties', [collectionId, propertyKeys], - true, `Unable to delete collection properties for ${label}`, + true, ); - return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionPropertyDeleted', label); + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionPropertyDeleted'); } /** @@ -828,7 +822,7 @@ class CollectionGroup extends HelperGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.transfer', [addressObj, collectionId, tokenId, amount], - true, `Unable to transfer token #${tokenId} from collection #${collectionId}`, + true, // `Unable to transfer token #${tokenId} from collection #${collectionId}`, ); return this.helper.util.isTokenTransferSuccess(result.result.events, collectionId, tokenId, {Substrate: typeof signer === 'string' ? signer : signer.address}, addressObj, amount); @@ -851,7 +845,7 @@ class CollectionGroup extends HelperGroup { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.transferFrom', [fromAddressObj, toAddressObj, collectionId, tokenId, amount], - true, `Unable to transfer token #${tokenId} from collection #${collectionId}`, + true, // `Unable to transfer token #${tokenId} from collection #${collectionId}`, ); return this.helper.util.isTokenTransferSuccess(result.result.events, collectionId, tokenId, fromAddressObj, toAddressObj, amount); } @@ -863,22 +857,20 @@ class CollectionGroup extends HelperGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token - * @param label * @param amount amount of tokens to be burned. For NFT must be set to 1n * @example burnToken(aliceKeyring, 10, 5); * @returns ```true``` and burnt token number is extrinsic success. Otherwise ```false``` and ```null``` */ - async burnToken(signer: TSigner, collectionId: number, tokenId: number, label?: string, amount=1n): Promise<{ + async burnToken(signer: TSigner, collectionId: number, tokenId: number, amount=1n): Promise<{ success: boolean, token: number | null }> { - if(typeof label === 'undefined') label = `collection #${collectionId}`; const burnResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.burnItem', [collectionId, tokenId, amount], - true, `Unable to burn token for ${label}`, + true, // `Unable to burn token for ${label}`, ); - const burnedTokens = this.helper.util.extractTokensFromBurnResult(burnResult, label); + const burnedTokens = this.helper.util.extractTokensFromBurnResult(burnResult); if (burnedTokens.tokens.length > 1) throw Error('Burned multiple tokens'); return {success: burnedTokens.success, token: burnedTokens.tokens.length > 0 ? burnedTokens.tokens[0] : null}; } @@ -890,19 +882,17 @@ class CollectionGroup extends HelperGroup { * @param collectionId ID of collection * @param fromAddressObj address on behalf of which the token will be burnt * @param tokenId ID of token - * @param label * @param amount amount of tokens to be burned. For NFT must be set to 1n * @example burnTokenFrom(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."}, 5, {Ethereum: "0x9F0583DbB85..."}) * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async burnTokenFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, tokenId: number, label?: string, amount=1n): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async burnTokenFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, tokenId: number, amount=1n): Promise { const burnResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.burnFrom', [collectionId, fromAddressObj, tokenId, amount], - true, `Unable to burn token from for ${label}`, + true, // `Unable to burn token from for ${label}`, ); - const burnedTokens = this.helper.util.extractTokensFromBurnResult(burnResult, label); + const burnedTokens = this.helper.util.extractTokensFromBurnResult(burnResult); return burnedTokens.success && burnedTokens.tokens.length > 0; } @@ -912,28 +902,27 @@ class CollectionGroup extends HelperGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token - * @param toAddressObj - * @param label + * @param toAddressObj Substrate or Ethereum address which gets approved use of the signer's tokens * @param amount amount of token to be approved. For NFT must be set to 1n * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string, amount=1n) { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, amount=1n) { const approveResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.approve', [toAddressObj, collectionId, tokenId, amount], - true, `Unable to approve token for ${label}`, + true, // `Unable to approve token for ${label}`, ); - return this.helper.util.findCollectionInEvents(approveResult.result.events, collectionId, 'common', 'Approved', label); + return this.helper.util.findCollectionInEvents(approveResult.result.events, collectionId, 'common', 'Approved'); } /** - * Get the amount of token pieces approved to transfer + * Get the amount of token pieces approved to transfer or burn. Normally 0. + * * @param collectionId ID of collection * @param tokenId ID of token - * @param toAccountObj - * @param fromAccountObj + * @param toAccountObj address which is approved to use token pieces + * @param fromAccountObj address which may have allowed the use of its owned tokens * @example getTokenApprovedPieces(10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, {Substrate: "5ERZNF88Mm7UGfPP3mdG..."}) * @returns number of approved to transfer pieces */ @@ -942,7 +931,8 @@ class CollectionGroup extends HelperGroup { } /** - * Get the last created token id + * Get the last created token ID in a collection + * * @param collectionId ID of collection * @example getLastTokenId(10); * @returns id of the last created token @@ -953,6 +943,7 @@ class CollectionGroup extends HelperGroup { /** * Check if token exists + * * @param collectionId ID of collection * @param tokenId ID of token * @example isTokenExists(10, 20); @@ -978,6 +969,7 @@ class NFTnRFT extends CollectionGroup { /** * Get token data + * * @param collectionId ID of collection * @param tokenId ID of token * @param blockHashAt @@ -1014,45 +1006,43 @@ class NFTnRFT extends CollectionGroup { /** * Set permissions to change token properties + * * @param signer keyring of signer * @param collectionId ID of collection * @param permissions permissions to change a property by the collection owner or admin - * @param label * @example setTokenPropertyPermissions( * aliceKeyring, 10, [{key: "gender", permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}] * ) * @returns true if extrinsic success otherwise false */ - async setTokenPropertyPermissions(signer: TSigner, collectionId: number, permissions: ITokenPropertyPermission[], label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async setTokenPropertyPermissions(signer: TSigner, collectionId: number, permissions: ITokenPropertyPermission[]): Promise { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.setTokenPropertyPermissions', [collectionId, permissions], - true, `Unable to set token property permissions for ${label}`, + true, ); - return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'PropertyPermissionSet', label); + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'PropertyPermissionSet'); } /** * Set token properties + * * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token * @param properties - * @param label * @example setTokenProperties(aliceKeyring, 10, 5, [{key: "gender", value: "female"}, {key: "age", value: "23"}]) * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async setTokenProperties(signer: TSigner, collectionId: number, tokenId: number, properties: IProperty[], label?: string): Promise { - if(typeof label === 'undefined') label = `token #${tokenId} from collection #${collectionId}`; + async setTokenProperties(signer: TSigner, collectionId: number, tokenId: number, properties: IProperty[]): Promise { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.setTokenProperties', [collectionId, tokenId, properties], - true, `Unable to set token properties for ${label}`, + true, ); - return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'TokenPropertySet', label); + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'TokenPropertySet'); } /** @@ -1061,31 +1051,29 @@ class NFTnRFT extends CollectionGroup { * @param collectionId ID of collection * @param tokenId ID of token * @param propertyKeys property keys to be deleted - * @param label * @example deleteTokenProperties(aliceKeyring, 10, 5, ["gender", "age"]) * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async deleteTokenProperties(signer: TSigner, collectionId: number, tokenId: number, propertyKeys: string[], label?: string): Promise { - if(typeof label === 'undefined') label = `token #${tokenId} from collection #${collectionId}`; + async deleteTokenProperties(signer: TSigner, collectionId: number, tokenId: number, propertyKeys: string[]): Promise { const result = await this.helper.executeExtrinsic( signer, 'api.tx.unique.deleteTokenProperties', [collectionId, tokenId, propertyKeys], - true, `Unable to delete token properties for ${label}`, + true, ); - return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'TokenPropertyDeleted', label); + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'TokenPropertyDeleted'); } /** * Mint new collection + * * @param signer keyring of signer * @param collectionOptions basic collection options and properties * @param mode NFT or RFT type of a collection - * @param errorLabel * @example mintCollection(aliceKeyring, {name: 'New', description: "New collection", tokenPrefix: "NEW"}, "NFT") * @returns object of the created collection */ - async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, mode: 'NFT' | 'RFT', errorLabel = 'Unable to mint collection'): Promise { + async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, mode: 'NFT' | 'RFT'): Promise { collectionOptions = JSON.parse(JSON.stringify(collectionOptions)) as ICollectionCreationOptions; // Clone object collectionOptions.mode = (mode === 'NFT') ? {nft: null} : {refungible: null}; for (const key of ['name', 'description', 'tokenPrefix']) { @@ -1094,9 +1082,9 @@ class NFTnRFT extends CollectionGroup { const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createCollectionEx', [collectionOptions], - true, errorLabel, + true, // errorLabel, ); - return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult, errorLabel)); + return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult)); } getCollectionObject(collectionId: number): any { @@ -1239,15 +1227,14 @@ class NFTGroup extends NFTnRFT { * @param signer keyring of signer * @param tokenObj token to be nested * @param rootTokenObj token to be parent - * @param label * @example nestToken(aliceKeyring, {collectionId: 10, tokenId: 5}, {collectionId: 10, tokenId: 4}); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async nestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, label='nest token'): Promise { + async nestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken): Promise { const rootTokenAddress = {Ethereum: this.helper.util.getNestingTokenAddress(rootTokenObj.collectionId, rootTokenObj.tokenId)}; const result = await this.transferToken(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress); if(!result) { - throw Error(`Unable to nest token for ${label}`); + throw Error('Unable to nest token!'); } return result; } @@ -1258,15 +1245,14 @@ class NFTGroup extends NFTnRFT { * @param tokenObj token to unnest * @param rootTokenObj parent of a token * @param toAddressObj address of a new token owner - * @param label * @example unnestToken(aliceKeyring, {collectionId: 10, tokenId: 5}, {collectionId: 10, tokenId: 4}, {Substrate: "5DyN4Y92vZCjv38fg..."}); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async unnestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, toAddressObj: ICrossAccountId, label='unnest token'): Promise { + async unnestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, toAddressObj: ICrossAccountId): Promise { const rootTokenAddress = {Ethereum: this.helper.util.getNestingTokenAddress(rootTokenObj.collectionId, rootTokenObj.tokenId)}; const result = await this.transferTokenFrom(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress, toAddressObj); if(!result) { - throw Error(`Unable to unnest token for ${label}`); + throw Error('Unable to unnest token!'); } return result; } @@ -1275,7 +1261,6 @@ class NFTGroup extends NFTnRFT { * Mint new collection * @param signer keyring of signer * @param collectionOptions Collection options - * @param label * @example * mintCollection(aliceKeyring, { * name: 'New', @@ -1284,19 +1269,17 @@ class NFTGroup extends NFTnRFT { * }) * @returns object of the created collection */ - async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, label = 'new collection'): Promise { - return await super.mintCollection(signer, collectionOptions, 'NFT', `Unable to mint NFT collection for ${label}`) as UniqueNFTCollection; + async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions): Promise { + return await super.mintCollection(signer, collectionOptions, 'NFT') as UniqueNFTCollection; } /** * Mint new token * @param signer keyring of signer * @param data token data - * @param label * @returns created token object */ - async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; properties?: IProperty[]; }, label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${data.collectionId}`; + async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; properties?: IProperty[]; }): Promise { const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createItem', [data.collectionId, (typeof data.owner === 'string') ? {Substrate: data.owner} : data.owner, { @@ -1304,9 +1287,9 @@ class NFTGroup extends NFTnRFT { properties: data.properties, }, }], - true, `Unable to mint NFT token for ${label}`, + true, ); - const createdTokens = this.helper.util.extractTokensFromCreationResult(creationResult, label); + const createdTokens = this.helper.util.extractTokensFromCreationResult(creationResult); if (createdTokens.tokens.length > 1) throw Error('Minted multiple tokens'); if (createdTokens.tokens.length < 1) throw Error('No tokens minted'); return this.getTokenObject(data.collectionId, createdTokens.tokens[0].tokenId); @@ -1317,7 +1300,6 @@ class NFTGroup extends NFTnRFT { * @param signer keyring of signer * @param collectionId ID of collection * @param tokens array of tokens with owner and properties - * @param label * @example * mintMultipleTokens(aliceKeyring, 10, [{ * owner: {Substrate: "5DyN4Y92vZCjv38fg..."}, @@ -1328,15 +1310,14 @@ class NFTGroup extends NFTnRFT { * }]); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[], label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[]): Promise { const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createMultipleItemsEx', [collectionId, {NFT: tokens}], - true, `Unable to mint NFT tokens for ${label}`, + true, ); const collection = this.getCollectionObject(collectionId); - return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); + return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); } /** @@ -1345,7 +1326,6 @@ class NFTGroup extends NFTnRFT { * @param collectionId ID of collection * @param owner tokens owner * @param tokens array of tokens with owner and properties - * @param label * @example * mintMultipleTokensWithOneOwner(aliceKeyring, 10, "5DyN4Y92vZCjv38fg...", [{ * properties: [{ @@ -1358,8 +1338,7 @@ class NFTGroup extends NFTnRFT { * }]); * @returns array of newly created tokens */ - async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {properties?: IProperty[]}[], label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {properties?: IProperty[]}[]): Promise { const rawTokens = []; for (const token of tokens) { const raw = {NFT: {properties: token.properties}}; @@ -1368,10 +1347,10 @@ class NFTGroup extends NFTnRFT { const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createMultipleItems', [collectionId, owner, rawTokens], - true, `Unable to mint NFT tokens for ${label}`, + true, ); const collection = this.getCollectionObject(collectionId); - return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); + return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); } /** @@ -1379,12 +1358,11 @@ class NFTGroup extends NFTnRFT { * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token - * @param label * @example burnToken(aliceKeyring, 10, 5); * @returns ```true``` and burnt token number is extrinsic success. Otherwise ```false``` and ```null``` */ - async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number, label?: string): Promise<{ success: boolean; token: number | null; }> { - return await super.burnToken(signer, collectionId, tokenId, label, 1n); + async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number): Promise<{ success: boolean; token: number | null; }> { + return await super.burnToken(signer, collectionId, tokenId, 1n); } /** @@ -1394,12 +1372,11 @@ class NFTGroup extends NFTnRFT { * @param collectionId ID of collection * @param tokenId ID of token * @param toAddressObj address to approve - * @param label * @example approveToken(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}) * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string) { - return super.approveToken(signer, collectionId, tokenId, toAddressObj, label, 1n); + async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId) { + return super.approveToken(signer, collectionId, tokenId, toAddressObj, 1n); } } @@ -1459,7 +1436,7 @@ class RFTGroup extends NFTnRFT { * @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, 2000n) * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId, amount=100n): Promise { + async transferToken(signer: TSigner, collectionId: number, tokenId: number, addressObj: ICrossAccountId, amount=1n): Promise { return await super.transferToken(signer, collectionId, tokenId, addressObj, amount); } @@ -1474,7 +1451,7 @@ class RFTGroup extends NFTnRFT { * @example transferTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, {Substrate: "5DfhbVfww7ThF8q6f3i..."}, 2000n) * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=100n): Promise { + async transferTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n): Promise { return await super.transferTokenFrom(signer, collectionId, tokenId, fromAddressObj, toAddressObj, amount); } @@ -1482,7 +1459,6 @@ class RFTGroup extends NFTnRFT { * Mint new collection * @param signer keyring of signer * @param collectionOptions Collection options - * @param label * @example * mintCollection(aliceKeyring, { * name: 'New', @@ -1491,20 +1467,18 @@ class RFTGroup extends NFTnRFT { * }) * @returns object of the created collection */ - async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, label = 'new collection'): Promise { - return await super.mintCollection(signer, collectionOptions, 'RFT', `Unable to mint RFT collection for ${label}`) as UniqueRFTCollection; + async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions): Promise { + return await super.mintCollection(signer, collectionOptions, 'RFT') as UniqueRFTCollection; } /** * Mint new token * @param signer keyring of signer * @param data token data - * @param label * @example mintToken(aliceKeyring, {collectionId: 10, owner: {Substrate: '5GHoZe9c73RYbVzq...'}, pieces: 10000n}); * @returns created token object */ - async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; pieces: bigint; properties?: IProperty[]; }, label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${data.collectionId}`; + async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; pieces: bigint; properties?: IProperty[]; }): Promise { const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createItem', [data.collectionId, (typeof data.owner === 'string') ? {Substrate: data.owner} : data.owner, { @@ -1513,24 +1487,23 @@ class RFTGroup extends NFTnRFT { properties: data.properties, }, }], - true, `Unable to mint RFT token for ${label}`, + true, ); - const createdTokens = this.helper.util.extractTokensFromCreationResult(creationResult, label); + const createdTokens = this.helper.util.extractTokensFromCreationResult(creationResult); if (createdTokens.tokens.length > 1) throw Error('Minted multiple tokens'); if (createdTokens.tokens.length < 1) throw Error('No tokens minted'); return this.getTokenObject(data.collectionId, createdTokens.tokens[0].tokenId); } - async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, pieces: bigint, properties?: IProperty[]}[], label?: string): Promise { + async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, pieces: bigint, properties?: IProperty[]}[]): Promise { throw Error('Not implemented'); - if(typeof label === 'undefined') label = `collection #${collectionId}`; const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createMultipleItemsEx', [collectionId, {RefungibleMultipleOwners: tokens}], - true, `Unable to mint RFT tokens for ${label}`, + true, // `Unable to mint RFT tokens for ${label}`, ); const collection = this.getCollectionObject(collectionId); - return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); + return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); } /** @@ -1539,12 +1512,10 @@ class RFTGroup extends NFTnRFT { * @param collectionId ID of collection * @param owner tokens owner * @param tokens array of tokens with properties and pieces - * @param label * @example mintMultipleTokensWithOneOwner(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, [{pieces: 100000n, properties: [{key: "gender", value: "male"}]}]); * @returns array of newly created RFT tokens */ - async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {pieces: bigint, properties?: IProperty[]}[], label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {pieces: bigint, properties?: IProperty[]}[]): Promise { const rawTokens = []; for (const token of tokens) { const raw = {ReFungible: {pieces: token.pieces, properties: token.properties}}; @@ -1553,10 +1524,10 @@ class RFTGroup extends NFTnRFT { const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createMultipleItems', [collectionId, owner, rawTokens], - true, `Unable to mint RFT tokens for ${label}`, + true, ); const collection = this.getCollectionObject(collectionId); - return this.helper.util.extractTokensFromCreationResult(creationResult, label).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); + return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); } /** @@ -1564,13 +1535,12 @@ class RFTGroup extends NFTnRFT { * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token - * @param label * @param amount number of pieces to be burnt * @example burnToken(aliceKeyring, 10, 5); * @returns ```true``` and burnt token number is extrinsic success. Otherwise ```false``` and ```null``` */ - async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number, label?: string, amount=100n): Promise<{ success: boolean; token: number | null; }> { - return await super.burnToken(signer, collectionId, tokenId, label, amount); + async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number, amount=1n): Promise<{ success: boolean; token: number | null; }> { + return await super.burnToken(signer, collectionId, tokenId, amount); } /** @@ -1580,13 +1550,12 @@ class RFTGroup extends NFTnRFT { * @param collectionId ID of collection * @param tokenId ID of token * @param toAddressObj address to approve - * @param label * @param amount number of pieces to be approved * @example approveToken(aliceKeyring, 10, 5, {Substrate: "5GHoZe9c73RYbVzq..."}, "", 10000n); * @returns true if the token success, otherwise false */ - async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string, amount=100n) { - return super.approveToken(signer, collectionId, tokenId, toAddressObj, label, amount); + async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, amount=1n) { + return super.approveToken(signer, collectionId, tokenId, toAddressObj, amount); } /** @@ -1606,20 +1575,18 @@ class RFTGroup extends NFTnRFT { * @param collectionId ID of collection * @param tokenId ID of token * @param amount new number of pieces - * @param label * @example repartitionToken(aliceKeyring, 10, 5, 12345n); * @returns true if the repartion was success, otherwise false */ - async repartitionToken(signer: TSigner, collectionId: number, tokenId: number, amount: bigint, label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async repartitionToken(signer: TSigner, collectionId: number, tokenId: number, amount: bigint): Promise { const currentAmount = await this.getTokenTotalPieces(collectionId, tokenId); const repartitionResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.repartition', [collectionId, tokenId, amount], - true, `Unable to repartition RFT token for ${label}`, + true, ); - if(currentAmount < amount) return this.helper.util.findCollectionInEvents(repartitionResult.result.events, collectionId, 'common', 'ItemCreated', label); - return this.helper.util.findCollectionInEvents(repartitionResult.result.events, collectionId, 'common', 'ItemDestroyed', label); + if(currentAmount < amount) return this.helper.util.findCollectionInEvents(repartitionResult.result.events, collectionId, 'common', 'ItemCreated'); + return this.helper.util.findCollectionInEvents(repartitionResult.result.events, collectionId, 'common', 'ItemDestroyed'); } } @@ -1640,7 +1607,6 @@ class FTGroup extends CollectionGroup { * @param signer keyring of signer * @param collectionOptions Collection options * @param decimalPoints number of token decimals - * @param errorLabel * @example * mintCollection(aliceKeyring, { * name: 'New', @@ -1649,7 +1615,7 @@ class FTGroup extends CollectionGroup { * }, 18) * @returns newly created fungible collection */ - async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, decimalPoints = 0, errorLabel = 'Unable to mint collection'): Promise { + async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, decimalPoints = 0): Promise { collectionOptions = JSON.parse(JSON.stringify(collectionOptions)) as ICollectionCreationOptions; // Clone object if(collectionOptions.tokenPropertyPermissions) throw Error('Fungible collections has no tokenPropertyPermissions'); collectionOptions.mode = {fungible: decimalPoints}; @@ -1659,9 +1625,9 @@ class FTGroup extends CollectionGroup { const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createCollectionEx', [collectionOptions], - true, errorLabel, + true, ); - return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult, errorLabel)); + return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult)); } /** @@ -1670,12 +1636,10 @@ class FTGroup extends CollectionGroup { * @param collectionId ID of collection * @param owner address owner of new tokens * @param amount amount of tokens to be meanted - * @param label * @example mintTokens(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq"}, 1000n); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async mintTokens(signer: TSigner, collectionId: number, owner: ICrossAccountId | string, amount: bigint, label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async mintTokens(signer: TSigner, collectionId: number, owner: ICrossAccountId | string, amount: bigint): Promise { const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createItem', [collectionId, (typeof owner === 'string') ? {Substrate: owner} : owner, { @@ -1683,9 +1647,9 @@ class FTGroup extends CollectionGroup { value: amount, }, }], - true, `Unable to mint fungible tokens for ${label}`, + true, // `Unable to mint fungible tokens for ${label}`, ); - return this.helper.util.findCollectionInEvents(creationResult.result.events, collectionId, 'common', 'ItemCreated', label); + return this.helper.util.findCollectionInEvents(creationResult.result.events, collectionId, 'common', 'ItemCreated'); } /** @@ -1694,11 +1658,9 @@ class FTGroup extends CollectionGroup { * @param collectionId ID of collection * @param owner tokens owner * @param tokens array of tokens with properties and pieces - * @param label * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {value: bigint}[], label?: string): Promise { - if(typeof label === 'undefined') label = `collection #${collectionId}`; + async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {value: bigint}[]): Promise { const rawTokens = []; for (const token of tokens) { const raw = {Fungible: {Value: token.value}}; @@ -1707,9 +1669,9 @@ class FTGroup extends CollectionGroup { const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createMultipleItems', [collectionId, owner, rawTokens], - true, `Unable to mint RFT tokens for ${label}`, + true, ); - return this.helper.util.findCollectionInEvents(creationResult.result.events, collectionId, 'common', 'ItemCreated', label); + return this.helper.util.findCollectionInEvents(creationResult.result.events, collectionId, 'common', 'ItemCreated'); } /** @@ -1742,7 +1704,7 @@ class FTGroup extends CollectionGroup { * @example transfer(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async transfer(signer: TSigner, collectionId: number, toAddressObj: ICrossAccountId, amount: bigint) { + async transfer(signer: TSigner, collectionId: number, toAddressObj: ICrossAccountId, amount=1n) { return await super.transferToken(signer, collectionId, 0, toAddressObj, amount); } @@ -1756,7 +1718,7 @@ class FTGroup extends CollectionGroup { * @example transferFrom(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, {Substrate: "5DfhbVfww7ThF8q6f3ij..."}, 10000n); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async transferFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount: bigint) { + async transferFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) { return await super.transferTokenFrom(signer, collectionId, 0, fromAddressObj, toAddressObj, amount); } @@ -1765,12 +1727,11 @@ class FTGroup extends CollectionGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param amount amount of tokens to be destroyed - * @param label * @example burnTokens(aliceKeyring, 10, 1000n); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async burnTokens(signer: IKeyringPair, collectionId: number, amount=100n, label?: string): Promise { - return (await super.burnToken(signer, collectionId, 0, label, amount)).success; + async burnTokens(signer: IKeyringPair, collectionId: number, amount=1n): Promise { + return (await super.burnToken(signer, collectionId, 0, amount)).success; } /** @@ -1779,12 +1740,11 @@ class FTGroup extends CollectionGroup { * @param collectionId ID of collection * @param fromAddressObj address on behalf of which tokens will be burnt * @param amount amount of tokens to be burnt - * @param label * @example burnTokensFrom(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async burnTokensFrom(signer: IKeyringPair, collectionId: number, fromAddressObj: ICrossAccountId, amount=100n, label?: string): Promise { - return await super.burnTokenFrom(signer, collectionId, fromAddressObj, 0, label, amount); + async burnTokensFrom(signer: IKeyringPair, collectionId: number, fromAddressObj: ICrossAccountId, amount=1n): Promise { + return await super.burnTokenFrom(signer, collectionId, fromAddressObj, 0, amount); } /** @@ -1803,12 +1763,11 @@ class FTGroup extends CollectionGroup { * @param collectionId ID of collection * @param toAddressObj address to be approved * @param amount amount of tokens to be approved - * @param label * @example approveTokens(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n) * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async approveTokens(signer: IKeyringPair, collectionId: number, toAddressObj: ICrossAccountId, amount=100n, label?: string) { - return super.approveToken(signer, collectionId, 0, toAddressObj, label, amount); + async approveTokens(signer: IKeyringPair, collectionId: number, toAddressObj: ICrossAccountId, amount=1n) { + return super.approveToken(signer, collectionId, 0, toAddressObj, amount); } /** @@ -1912,7 +1871,7 @@ class BalanceGroup extends HelperGroup { * @returns ```true``` if extrinsic success, otherwise ```false``` */ async transferToSubstrate(signer: TSigner, address: TSubstrateAccount, amount: bigint | string): Promise { - const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.transfer', [address, amount], true, `Unable to transfer balance from ${this.helper.getSignerAddress(signer)} to ${address}`); + const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.transfer', [address, amount], true/*, `Unable to transfer balance from ${this.helper.getSignerAddress(signer)} to ${address}`*/); let transfer = {from: null, to: null, amount: 0n} as any; result.result.events.forEach(({event: {data, method, section}}) => { @@ -2035,60 +1994,68 @@ class UniqueCollectionBase { return await this.helper.collection.getEffectiveLimits(this.collectionId); } - async setSponsor(signer: TSigner, sponsorAddress: TSubstrateAccount, label?: string) { - return await this.helper.collection.setSponsor(signer, this.collectionId, sponsorAddress, label); + async setSponsor(signer: TSigner, sponsorAddress: TSubstrateAccount) { + return await this.helper.collection.setSponsor(signer, this.collectionId, sponsorAddress); + } + + async confirmSponsorship(signer: TSigner) { + return await this.helper.collection.confirmSponsorship(signer, this.collectionId); + } + + async setLimits(signer: TSigner, limits: ICollectionLimits) { + return await this.helper.collection.setLimits(signer, this.collectionId, limits); } - async confirmSponsorship(signer: TSigner, label?: string) { - return await this.helper.collection.confirmSponsorship(signer, this.collectionId, label); + async changeOwner(signer: TSigner, ownerAddress: TSubstrateAccount) { + return await this.helper.collection.changeOwner(signer, this.collectionId, ownerAddress); } - async setLimits(signer: TSigner, limits: ICollectionLimits, label?: string) { - return await this.helper.collection.setLimits(signer, this.collectionId, limits, label); + async addAdmin(signer: TSigner, adminAddressObj: ICrossAccountId) { + return await this.helper.collection.addAdmin(signer, this.collectionId, adminAddressObj); } - async changeOwner(signer: TSigner, ownerAddress: TSubstrateAccount, label?: string) { - return await this.helper.collection.changeOwner(signer, this.collectionId, ownerAddress, label); + async enableAllowList(signer: TSigner, value = true/*: 'Normal' | 'AllowList' = 'AllowList'*/) { + return await this.setPermissions(signer, value ? {access: 'AllowList', mintMode: true} : {access: 'Normal'}); } - async addAdmin(signer: TSigner, adminAddressObj: ICrossAccountId, label?: string) { - return await this.helper.collection.addAdmin(signer, this.collectionId, adminAddressObj, label); + async addToAllowList(signer: TSigner, addressObj: ICrossAccountId) { + return await this.helper.collection.addToAllowList(signer, this.collectionId, addressObj); } - async addToAllowList(signer: TSigner, addressObj: ICrossAccountId, label?: string) { - return await this.helper.collection.addToAllowList(signer, this.collectionId, addressObj, label); + async removeFromAllowList(signer: TSigner, addressObj: ICrossAccountId) { + return await this.helper.collection.removeFromAllowList(signer, this.collectionId, addressObj); } - async removeAdmin(signer: TSigner, adminAddressObj: ICrossAccountId, label?: string) { - return await this.helper.collection.removeAdmin(signer, this.collectionId, adminAddressObj, label); + async removeAdmin(signer: TSigner, adminAddressObj: ICrossAccountId) { + return await this.helper.collection.removeAdmin(signer, this.collectionId, adminAddressObj); } - async setProperties(signer: TSigner, properties: IProperty[], label?: string) { - return await this.helper.collection.setProperties(signer, this.collectionId, properties, label); + async setProperties(signer: TSigner, properties: IProperty[]) { + return await this.helper.collection.setProperties(signer, this.collectionId, properties); } - async deleteProperties(signer: TSigner, propertyKeys: string[], label?: string) { - return await this.helper.collection.deleteProperties(signer, this.collectionId, propertyKeys, label); + async deleteProperties(signer: TSigner, propertyKeys: string[]) { + return await this.helper.collection.deleteProperties(signer, this.collectionId, propertyKeys); } async getTokenNextSponsored(tokenId: number, addressObj: ICrossAccountId) { return await this.helper.collection.getTokenNextSponsored(this.collectionId, tokenId, addressObj); } - async setPermissions(signer: TSigner, permissions: ICollectionPermissions, label?: string) { - return await this.helper.collection.setPermissions(signer, this.collectionId, permissions, label); + async setPermissions(signer: TSigner, permissions: ICollectionPermissions) { + return await this.helper.collection.setPermissions(signer, this.collectionId, permissions); } - async enableNesting(signer: TSigner, permissions: INestingPermissions, label?: string) { - return await this.helper.collection.enableNesting(signer, this.collectionId, permissions, label); + async enableNesting(signer: TSigner, permissions: INestingPermissions) { + return await this.helper.collection.enableNesting(signer, this.collectionId, permissions); } - async disableNesting(signer: TSigner, label?: string) { - return await this.helper.collection.disableNesting(signer, this.collectionId, label); + async disableNesting(signer: TSigner) { + return await this.helper.collection.disableNesting(signer, this.collectionId); } - async burn(signer: TSigner, label?: string) { - return await this.helper.collection.burn(signer, this.collectionId, label); + async burn(signer: TSigner) { + return await this.helper.collection.burn(signer, this.collectionId); } } @@ -2126,44 +2093,44 @@ class UniqueNFTCollection extends UniqueCollectionBase { return await this.helper.nft.transferTokenFrom(signer, this.collectionId, tokenId, fromAddressObj, toAddressObj); } - async approveToken(signer: TSigner, tokenId: number, toAddressObj: ICrossAccountId, label?: string) { - return await this.helper.nft.approveToken(signer, this.collectionId, tokenId, toAddressObj, label); + async approveToken(signer: TSigner, tokenId: number, toAddressObj: ICrossAccountId) { + return await this.helper.nft.approveToken(signer, this.collectionId, tokenId, toAddressObj); } async isTokenApproved(tokenId: number, toAddressObj: ICrossAccountId) { return await this.helper.nft.isTokenApproved(this.collectionId, tokenId, toAddressObj); } - async mintToken(signer: TSigner, owner: ICrossAccountId, properties?: IProperty[], label?: string) { - return await this.helper.nft.mintToken(signer, {collectionId: this.collectionId, owner, properties}, label); + async mintToken(signer: TSigner, owner: ICrossAccountId, properties?: IProperty[]) { + return await this.helper.nft.mintToken(signer, {collectionId: this.collectionId, owner, properties}); } - async mintMultipleTokens(signer: TSigner, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[], label?: string) { - return await this.helper.nft.mintMultipleTokens(signer, this.collectionId, tokens, label); + async mintMultipleTokens(signer: TSigner, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[]) { + return await this.helper.nft.mintMultipleTokens(signer, this.collectionId, tokens); } - async burnToken(signer: TSigner, tokenId: number, label?: string) { - return await this.helper.nft.burnToken(signer, this.collectionId, tokenId, label); + async burnToken(signer: TSigner, tokenId: number) { + return await this.helper.nft.burnToken(signer, this.collectionId, tokenId); } - async setTokenProperties(signer: TSigner, tokenId: number, properties: IProperty[], label?: string) { - return await this.helper.nft.setTokenProperties(signer, this.collectionId, tokenId, properties, label); + async setTokenProperties(signer: TSigner, tokenId: number, properties: IProperty[]) { + return await this.helper.nft.setTokenProperties(signer, this.collectionId, tokenId, properties); } - async deleteTokenProperties(signer: TSigner, tokenId: number, propertyKeys: string[], label?: string) { - return await this.helper.nft.deleteTokenProperties(signer, this.collectionId, tokenId, propertyKeys, label); + async deleteTokenProperties(signer: TSigner, tokenId: number, propertyKeys: string[]) { + return await this.helper.nft.deleteTokenProperties(signer, this.collectionId, tokenId, propertyKeys); } - async setTokenPropertyPermissions(signer: TSigner, permissions: ITokenPropertyPermission[], label?: string) { - return await this.helper.nft.setTokenPropertyPermissions(signer, this.collectionId, permissions, label); + async setTokenPropertyPermissions(signer: TSigner, permissions: ITokenPropertyPermission[]) { + return await this.helper.nft.setTokenPropertyPermissions(signer, this.collectionId, permissions); } - async nestToken(signer: TSigner, tokenId: number, toTokenObj: IToken, label?: string) { - return await this.helper.nft.nestToken(signer, {collectionId: this.collectionId, tokenId}, toTokenObj, label); + async nestToken(signer: TSigner, tokenId: number, toTokenObj: IToken) { + return await this.helper.nft.nestToken(signer, {collectionId: this.collectionId, tokenId}, toTokenObj); } - async unnestToken(signer: TSigner, tokenId: number, fromTokenObj: IToken, toAddressObj: ICrossAccountId, label?: string) { - return await this.helper.nft.unnestToken(signer, {collectionId: this.collectionId, tokenId}, fromTokenObj, toAddressObj, label); + async unnestToken(signer: TSigner, tokenId: number, fromTokenObj: IToken, toAddressObj: ICrossAccountId) { + return await this.helper.nft.unnestToken(signer, {collectionId: this.collectionId, tokenId}, fromTokenObj, toAddressObj); } } @@ -2189,59 +2156,59 @@ class UniqueRFTCollection extends UniqueCollectionBase { return await this.helper.rft.getTokenTotalPieces(this.collectionId, tokenId); } - async transferToken(signer: TSigner, tokenId: number, addressObj: ICrossAccountId, amount=100n) { + async transferToken(signer: TSigner, tokenId: number, addressObj: ICrossAccountId, amount=1n) { return await this.helper.rft.transferToken(signer, this.collectionId, tokenId, addressObj, amount); } - async transferTokenFrom(signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=100n) { + async transferTokenFrom(signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) { return await this.helper.rft.transferTokenFrom(signer, this.collectionId, tokenId, fromAddressObj, toAddressObj, amount); } - async approveToken(signer: TSigner, tokenId: number, toAddressObj: ICrossAccountId, amount=100n, label?: string) { - return await this.helper.rft.approveToken(signer, this.collectionId, tokenId, toAddressObj, label, amount); + async approveToken(signer: TSigner, tokenId: number, toAddressObj: ICrossAccountId, amount=1n) { + return await this.helper.rft.approveToken(signer, this.collectionId, tokenId, toAddressObj, amount); } async getTokenApprovedPieces(tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) { return await this.helper.rft.getTokenApprovedPieces(this.collectionId, tokenId, toAddressObj, fromAddressObj); } - async repartitionToken(signer: TSigner, tokenId: number, amount: bigint, label?: string) { - return await this.helper.rft.repartitionToken(signer, this.collectionId, tokenId, amount, label); + async repartitionToken(signer: TSigner, tokenId: number, amount: bigint) { + return await this.helper.rft.repartitionToken(signer, this.collectionId, tokenId, amount); } - async mintToken(signer: TSigner, owner: ICrossAccountId, pieces=100n, properties?: IProperty[], label?: string) { - return await this.helper.rft.mintToken(signer, {collectionId: this.collectionId, owner, pieces, properties}, label); + async mintToken(signer: TSigner, owner: ICrossAccountId, pieces=100n, properties?: IProperty[]) { + return await this.helper.rft.mintToken(signer, {collectionId: this.collectionId, owner, pieces, properties}); } - async mintMultipleTokens(signer: TSigner, tokens: {owner: ICrossAccountId, pieces: bigint, properties?: IProperty[]}[], label?: string) { - return await this.helper.rft.mintMultipleTokens(signer, this.collectionId, tokens, label); + async mintMultipleTokens(signer: TSigner, tokens: {owner: ICrossAccountId, pieces: bigint, properties?: IProperty[]}[]) { + return await this.helper.rft.mintMultipleTokens(signer, this.collectionId, tokens); } - async burnToken(signer: TSigner, tokenId: number, amount=100n, label?: string) { - return await this.helper.rft.burnToken(signer, this.collectionId, tokenId, label, amount); + async burnToken(signer: TSigner, tokenId: number, amount=1n) { + return await this.helper.rft.burnToken(signer, this.collectionId, tokenId, amount); } - async setTokenProperties(signer: TSigner, tokenId: number, properties: IProperty[], label?: string) { - return await this.helper.rft.setTokenProperties(signer, this.collectionId, tokenId, properties, label); + async setTokenProperties(signer: TSigner, tokenId: number, properties: IProperty[]) { + return await this.helper.rft.setTokenProperties(signer, this.collectionId, tokenId, properties); } - async deleteTokenProperties(signer: TSigner, tokenId: number, propertyKeys: string[], label?: string) { - return await this.helper.rft.deleteTokenProperties(signer, this.collectionId, tokenId, propertyKeys, label); + async deleteTokenProperties(signer: TSigner, tokenId: number, propertyKeys: string[]) { + return await this.helper.rft.deleteTokenProperties(signer, this.collectionId, tokenId, propertyKeys); } - async setTokenPropertyPermissions(signer: TSigner, permissions: ITokenPropertyPermission[], label?: string) { - return await this.helper.rft.setTokenPropertyPermissions(signer, this.collectionId, permissions, label); + async setTokenPropertyPermissions(signer: TSigner, permissions: ITokenPropertyPermission[]) { + return await this.helper.rft.setTokenPropertyPermissions(signer, this.collectionId, permissions); } } class UniqueFTCollection extends UniqueCollectionBase { - async mint(signer: TSigner, owner: ICrossAccountId, amount: bigint, label?: string) { - return await this.helper.ft.mintTokens(signer, this.collectionId, owner, amount, label); + async mint(signer: TSigner, owner: ICrossAccountId, amount: bigint) { + return await this.helper.ft.mintTokens(signer, this.collectionId, owner, amount); } - async mintWithOneOwner(signer: TSigner, owner: ICrossAccountId, tokens: {value: bigint}[], label?: string) { - return await this.helper.ft.mintMultipleTokensWithOneOwner(signer, this.collectionId, owner, tokens, label); + async mintWithOneOwner(signer: TSigner, owner: ICrossAccountId, tokens: {value: bigint}[]) { + return await this.helper.ft.mintMultipleTokensWithOneOwner(signer, this.collectionId, owner, tokens); } async getBalance(addressObj: ICrossAccountId) { @@ -2252,28 +2219,28 @@ class UniqueFTCollection extends UniqueCollectionBase { return await this.helper.ft.getTop10Owners(this.collectionId); } - async transfer(signer: TSigner, toAddressObj: ICrossAccountId, amount: bigint) { + async transfer(signer: TSigner, toAddressObj: ICrossAccountId, amount=1n) { return await this.helper.ft.transfer(signer, this.collectionId, toAddressObj, amount); } - async transferFrom(signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount: bigint) { + async transferFrom(signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) { return await this.helper.ft.transferFrom(signer, this.collectionId, fromAddressObj, toAddressObj, amount); } - async burnTokens(signer: TSigner, amount: bigint, label?: string) { - return await this.helper.ft.burnTokens(signer, this.collectionId, amount, label); + async burnTokens(signer: TSigner, amount=1n) { + return await this.helper.ft.burnTokens(signer, this.collectionId, amount); } - async burnTokensFrom(signer: TSigner, fromAddressObj: ICrossAccountId, amount: bigint, label?: string) { - return await this.helper.ft.burnTokensFrom(signer, this.collectionId, fromAddressObj, amount, label); + async burnTokensFrom(signer: TSigner, fromAddressObj: ICrossAccountId, amount=1n) { + return await this.helper.ft.burnTokensFrom(signer, this.collectionId, fromAddressObj, amount); } async getTotalPieces() { return await this.helper.ft.getTotalPieces(this.collectionId); } - async approveTokens(signer: TSigner, toAddressObj: ICrossAccountId, amount=100n, label?: string) { - return await this.helper.ft.approveTokens(signer, this.collectionId, toAddressObj, amount, label); + async approveTokens(signer: TSigner, toAddressObj: ICrossAccountId, amount=1n) { + return await this.helper.ft.approveTokens(signer, this.collectionId, toAddressObj, amount); } async getApprovedTokens(fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) { @@ -2297,12 +2264,12 @@ class UniqueTokenBase implements IToken { return await this.collection.getTokenNextSponsored(this.tokenId, addressObj); } - async setProperties(signer: TSigner, properties: IProperty[], label?: string) { - return await this.collection.setTokenProperties(signer, this.tokenId, properties, label); + async setProperties(signer: TSigner, properties: IProperty[]) { + return await this.collection.setTokenProperties(signer, this.tokenId, properties); } - async deleteProperties(signer: TSigner, propertyKeys: string[], label?: string) { - return await this.collection.deleteTokenProperties(signer, this.tokenId, propertyKeys, label); + async deleteProperties(signer: TSigner, propertyKeys: string[]) { + return await this.collection.deleteTokenProperties(signer, this.tokenId, propertyKeys); } } @@ -2331,12 +2298,12 @@ class UniqueNFTToken extends UniqueTokenBase { return await this.collection.getTokenChildren(this.tokenId, blockHashAt); } - async nest(signer: TSigner, toTokenObj: IToken, label?: string) { - return await this.collection.nestToken(signer, this.tokenId, toTokenObj, label); + async nest(signer: TSigner, toTokenObj: IToken) { + return await this.collection.nestToken(signer, this.tokenId, toTokenObj); } - async unnest(signer: TSigner, fromTokenObj: IToken, toAddressObj: ICrossAccountId, label?: string) { - return await this.collection.unnestToken(signer, this.tokenId, fromTokenObj, toAddressObj, label); + async unnest(signer: TSigner, fromTokenObj: IToken, toAddressObj: ICrossAccountId) { + return await this.collection.unnestToken(signer, this.tokenId, fromTokenObj, toAddressObj); } async transfer(signer: TSigner, addressObj: ICrossAccountId) { @@ -2347,16 +2314,16 @@ class UniqueNFTToken extends UniqueTokenBase { return await this.collection.transferTokenFrom(signer, this.tokenId, fromAddressObj, toAddressObj); } - async approve(signer: TSigner, toAddressObj: ICrossAccountId, label?: string) { - return await this.collection.approveToken(signer, this.tokenId, toAddressObj, label); + async approve(signer: TSigner, toAddressObj: ICrossAccountId) { + return await this.collection.approveToken(signer, this.tokenId, toAddressObj); } async isApproved(toAddressObj: ICrossAccountId) { return await this.collection.isTokenApproved(this.tokenId, toAddressObj); } - async burn(signer: TSigner, label?: string) { - return await this.collection.burnToken(signer, this.tokenId, label); + async burn(signer: TSigner) { + return await this.collection.burnToken(signer, this.tokenId); } } @@ -2380,27 +2347,27 @@ class UniqueRFTToken extends UniqueTokenBase { return await this.collection.getTokenTotalPieces(this.tokenId); } - async transfer(signer: TSigner, addressObj: ICrossAccountId, amount=100n) { + async transfer(signer: TSigner, addressObj: ICrossAccountId, amount=1n) { return await this.collection.transferToken(signer, this.tokenId, addressObj, amount); } - async transferFrom(signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=100n) { + async transferFrom(signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) { return await this.collection.transferTokenFrom(signer, this.tokenId, fromAddressObj, toAddressObj, amount); } - async approve(signer: TSigner, toAddressObj: ICrossAccountId, amount=100n, label?: string) { - return await this.collection.approveToken(signer, this.tokenId, toAddressObj, amount, label); + async approve(signer: TSigner, toAddressObj: ICrossAccountId, amount=1n) { + return await this.collection.approveToken(signer, this.tokenId, toAddressObj, amount); } async getApprovedPieces(fromAddressObj: ICrossAccountId, toAccountObj: ICrossAccountId) { return await this.collection.getTokenApprovedPieces(this.tokenId, fromAddressObj, toAccountObj); } - async repartition(signer: TSigner, amount: bigint, label?: string) { - return await this.collection.repartitionToken(signer, this.tokenId, amount, label); + async repartition(signer: TSigner, amount: bigint) { + return await this.collection.repartitionToken(signer, this.tokenId, amount); } - async burn(signer: TSigner, amount=100n, label?: string) { - return await this.collection.burnToken(signer, this.tokenId, amount, label); + async burn(signer: TSigner, amount=1n) { + return await this.collection.burnToken(signer, this.tokenId, amount); } } \ No newline at end of file From 97bc0a17e0b7637399cbf12ec84eaac1096dba9d Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 2 Sep 2022 10:46:13 +0000 Subject: [PATCH 0680/1274] test(util): addtional docs + minor refactoring --- tests/src/util/playgrounds/unique.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 3ae6aa2707..fc29c00c19 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -972,12 +972,12 @@ class NFTnRFT extends CollectionGroup { * * @param collectionId ID of collection * @param tokenId ID of token - * @param blockHashAt - * @param propertyKeys + * @param propertyKeys optionally filter the token properties to only these keys + * @param blockHashAt optionally query the data at some block with this hash * @example getToken(10, 5); * @returns human readable token data */ - async getToken(collectionId: number, tokenId: number, blockHashAt?: string, propertyKeys?: string[]): Promise<{ + async getToken(collectionId: number, tokenId: number, propertyKeys: string[] = [], blockHashAt?: string): Promise<{ properties: IProperty[]; owner: ICrossAccountId; normalizedOwner: ICrossAccountId; @@ -987,7 +987,7 @@ class NFTnRFT extends CollectionGroup { tokenData = await this.helper.callRpc('api.rpc.unique.tokenData', [collectionId, tokenId]); } else { - if(typeof propertyKeys === 'undefined') { + if(propertyKeys.length == 0) { const collection = (await this.helper.callRpc('api.rpc.unique.collectionById', [collectionId])).toHuman(); if(!collection) return null; propertyKeys = collection.tokenPropertyPermissions.map((x: ITokenPropertyPermission) => x.key); @@ -1031,7 +1031,7 @@ class NFTnRFT extends CollectionGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token - * @param properties + * @param properties key-value pairs of metadata which to add to a token. Keys must be permitted in the collection * @example setTokenProperties(aliceKeyring, 10, 5, [{key: "gender", value: "female"}, {key: "age", value: "23"}]) * @returns ```true``` if extrinsic success, otherwise ```false``` */ @@ -1123,7 +1123,7 @@ class NFTGroup extends NFTnRFT { * Get token's owner * @param collectionId ID of collection * @param tokenId ID of token - * @param blockHashAt + * @param blockHashAt optionally query the data at the block with this hash * @example getTokenOwner(10, 5); * @returns Address in CrossAccountId format, e.g. {Substrate: "5DnSF6RRjwteE3BrCj..."} */ @@ -1205,7 +1205,7 @@ class NFTGroup extends NFTnRFT { * Get tokens nested in the provided token * @param collectionId ID of collection * @param tokenId ID of token - * @param blockHashAt + * @param blockHashAt optionally query the data at the block with this hash * @example getTokenChildren(10, 5); * @returns tokens whose depth of nesting is <= 5 */ @@ -1699,7 +1699,7 @@ class FTGroup extends CollectionGroup { * Transfer tokens to address * @param signer keyring of signer * @param collectionId ID of collection - * @param toAddressObj address recepient + * @param toAddressObj address recipient * @param amount amount of tokens to be sent * @example transfer(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n); * @returns ```true``` if extrinsic success, otherwise ```false``` @@ -1865,7 +1865,7 @@ class BalanceGroup extends HelperGroup { /** * Transfer tokens to substrate address * @param signer keyring of signer - * @param address substrate address of a recepient + * @param address substrate address of a recipient * @param amount amount of tokens to be transfered * @example transferToSubstrate(aliceKeyring, "5GrwvaEF5zXb26Fz...", 100_000_000_000n); * @returns ```true``` if extrinsic success, otherwise ```false``` @@ -2070,7 +2070,7 @@ class UniqueNFTCollection extends UniqueCollectionBase { } async getToken(tokenId: number, blockHashAt?: string) { - return await this.helper.nft.getToken(this.collectionId, tokenId, blockHashAt); + return await this.helper.nft.getToken(this.collectionId, tokenId, [], blockHashAt); } async getTokenOwner(tokenId: number, blockHashAt?: string) { From 511167181f0cab6366b7272edf00d791e8dd6ee4 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 2 Sep 2022 13:54:31 +0300 Subject: [PATCH 0681/1274] fix: add try-runtime option to docker command --- .docker/Dockerfile-try-runtime | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index 58ffe7a41b..4622407a8d 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -47,4 +47,4 @@ RUN echo "Requested features: $FEATURE\n" && \ cargo build --features=$FEATURE --release -CMD cargo run --features=$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $REPLICA_FROM +CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $REPLICA_FROM From d2b5cc3bc7de3fea714eec2debf451e94a8fc971 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 2 Sep 2022 14:06:42 +0300 Subject: [PATCH 0682/1274] change format of trigger definition --- .github/workflows/ci-develop.yml | 9 ++------- .github/workflows/ci-master.yml | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index b9cf524265..7e865ac735 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -2,13 +2,8 @@ name: develop on: pull_request: - branches: - - develop - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review + branches: [ develop ] + types: [ opened, reopened, synchronize, ready_for_review ] concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index 2e6abd6f85..32d8cb8248 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -2,13 +2,8 @@ name: master on: pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review + branches: [ master ] + types: [ opened, reopened, synchronize, ready_for_review ] concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} From 5ab2859c2d33c173bdd67574f0dda5baa1db05de Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 2 Sep 2022 14:16:20 +0300 Subject: [PATCH 0683/1274] escaping branch name --- .github/workflows/ci-develop.yml | 2 +- .github/workflows/ci-master.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index 7e865ac735..e20d30f01a 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -2,7 +2,7 @@ name: develop on: pull_request: - branches: [ develop ] + branches: [ 'develop' ] types: [ opened, reopened, synchronize, ready_for_review ] concurrency: diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index 32d8cb8248..266ffd7fe8 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -2,7 +2,7 @@ name: master on: pull_request: - branches: [ master ] + branches: [ 'master' ] types: [ opened, reopened, synchronize, ready_for_review ] concurrency: From 834c75ed844b4f6dbc2ca83276dfc269e16024ac Mon Sep 17 00:00:00 2001 From: PraetorP Date: Fri, 2 Sep 2022 18:19:32 +0700 Subject: [PATCH 0684/1274] change unstake and on_initrialize logicc and + added `Reserved` --- client/rpc/src/lib.rs | 24 ++- node/rpc/src/lib.rs | 7 +- pallets/app-promotion/src/benchmarking.rs | 18 +- pallets/app-promotion/src/lib.rs | 244 ++++++++++++---------- pallets/app-promotion/src/tests.rs | 70 +++---- pallets/app-promotion/src/weights.rs | 82 +++----- runtime/common/runtime_apis.rs | 10 +- 7 files changed, 229 insertions(+), 226 deletions(-) diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index 5d24290e41..daa8af06cd 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -250,14 +250,17 @@ pub trait UniqueApi { mod app_promotion_unique_rpc { use super::*; - + #[rpc(server)] #[async_trait] pub trait AppPromotionApi { /// Returns the total amount of staked tokens. #[method(name = "appPromotion_totalStaked")] - fn total_staked(&self, staker: Option, at: Option) - -> Result; + fn total_staked( + &self, + staker: Option, + at: Option, + ) -> Result; ///Returns the total amount of staked tokens per block when staked. #[method(name = "appPromotion_totalStakedPerBlock")] @@ -269,8 +272,11 @@ mod app_promotion_unique_rpc { /// Returns the total amount locked by staking tokens. #[method(name = "appPromotion_totalStakingLocked")] - fn total_staking_locked(&self, staker: CrossAccountId, at: Option) - -> Result; + fn total_staking_locked( + &self, + staker: CrossAccountId, + at: Option, + ) -> Result; /// Returns the total amount of tokens pending withdrawal from staking. #[method(name = "appPromotion_pendingUnstake")] @@ -590,8 +596,12 @@ where } impl - app_promotion_unique_rpc::AppPromotionApiServer<::Hash, BlockNumber, CrossAccountId, AccountId> - for AppPromotion + app_promotion_unique_rpc::AppPromotionApiServer< + ::Hash, + BlockNumber, + CrossAccountId, + AccountId, + > for AppPromotion where Block: BlockT, BlockNumber: Decode + Member + AtLeast32BitUnsigned, diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index 2a3c546390..416878d159 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -148,7 +148,12 @@ where C::Api: fp_rpc::ConvertTransactionRuntimeApi, C::Api: up_rpc::UniqueApi::CrossAccountId, AccountId>, - C::Api: app_promotion_rpc::AppPromotionApi::CrossAccountId, AccountId>, + C::Api: app_promotion_rpc::AppPromotionApi< + Block, + BlockNumber, + ::CrossAccountId, + AccountId, + >, C::Api: rmrk_rpc::RmrkApi< Block, AccountId, diff --git a/pallets/app-promotion/src/benchmarking.rs b/pallets/app-promotion/src/benchmarking.rs index 591f1f07c2..17040fa74a 100644 --- a/pallets/app-promotion/src/benchmarking.rs +++ b/pallets/app-promotion/src/benchmarking.rs @@ -39,13 +39,13 @@ benchmarks! { T::BlockNumber: From + Into, <::Currency as Currency>::Balance: Sum + From } - start_app_promotion { + // start_app_promotion { - } : {PromototionPallet::::start_app_promotion(RawOrigin::Root.into(), None)?} + // } : {PromototionPallet::::start_app_promotion(RawOrigin::Root.into(), None)?} - stop_app_promotion{ - PromototionPallet::::start_app_promotion(RawOrigin::Root.into(), Some(25.into()))?; - } : {PromototionPallet::::stop_app_promotion(RawOrigin::Root.into())?} + // stop_app_promotion{ + // PromototionPallet::::start_app_promotion(RawOrigin::Root.into(), Some(25.into()))?; + // } : {PromototionPallet::::stop_app_promotion(RawOrigin::Root.into())?} set_admin_address { let pallet_admin = account::("admin", 0, SEED); @@ -58,6 +58,10 @@ benchmarks! { PromototionPallet::::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?; let _ = ::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); let staker: T::AccountId = account("caller", 0, SEED); + let stakers: Vec = (0..100).map(|index| account("staker", index, SEED)).collect(); + stakers.iter().for_each(|staker| { + ::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + }); let _ = ::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); let _ = PromototionPallet::::stake(RawOrigin::Signed(staker.clone()).into(), share * ::Currency::total_balance(&staker))?; } : {PromototionPallet::::payout_stakers(RawOrigin::Signed(pallet_admin.clone()).into(), Some(1))?} @@ -70,9 +74,9 @@ benchmarks! { unstake { let caller = account::("caller", 0, SEED); - let share = Perbill::from_rational(1u32, 10); + let share = Perbill::from_rational(1u32, 20); let _ = ::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); - let _ = PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller))?; + (0..10).map(|_| PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller))).collect::, _>>()?; } : {PromototionPallet::::unstake(RawOrigin::Signed(caller.clone()).into())?} diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index d9a695e0a7..407ca14f21 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -36,7 +36,12 @@ mod tests; pub mod types; pub mod weights; -use sp_std::{vec::Vec, iter::Sum, borrow::ToOwned}; +use sp_std::{ + vec::{Vec}, + vec, + iter::Sum, + borrow::ToOwned, +}; use sp_core::H160; use codec::EncodeLike; use pallet_balances::BalanceLock; @@ -63,6 +68,9 @@ use sp_runtime::{ ArithmeticError, }; +pub const LOCK_IDENTIFIER: [u8; 8] = *b"appstake"; +const PENDING_LIMIT_PER_BLOCK: u32 = 3; + type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; @@ -72,17 +80,19 @@ type BalanceOf = // const TWO_WEEK: u32 = 2 * WEEK; // const YEAR: u32 = DAY * 365; -pub const LOCK_IDENTIFIER: [u8; 8] = *b"appstake"; - #[frame_support::pallet] pub mod pallet { use super::*; - use frame_support::{Blake2_128Concat, Twox64Concat, pallet_prelude::*, storage::Key, PalletId}; + use frame_support::{ + Blake2_128Concat, Twox64Concat, pallet_prelude::*, storage::Key, PalletId, + traits::ReservableCurrency, + }; use frame_system::pallet_prelude::*; #[pallet::config] pub trait Config: frame_system::Config + pallet_evm::account::Config { - type Currency: ExtendedLockableCurrency; + type Currency: ExtendedLockableCurrency + + ReservableCurrency; type CollectionHandler: CollectionHandler< AccountId = Self::AccountId, @@ -149,6 +159,7 @@ pub mod pallet { NoPermission, /// Insufficient funds to perform an action NotSufficientFounds, + PendingForBlockOverflow, /// An error related to the fact that an invalid argument was passed to perform an action InvalidArgument, } @@ -175,25 +186,33 @@ pub mod pallet { StorageMap<_, Blake2_128Concat, T::AccountId, u8, ValueQuery>; /// Amount of tokens pending unstake per user per block. + // #[pallet::storage] + // pub type PendingUnstake = StorageNMap< + // Key = ( + // Key, + // Key, + // ), + // Value = BalanceOf, + // QueryKind = ValueQuery, + // >; #[pallet::storage] - pub type PendingUnstake = StorageNMap< - Key = ( - Key, - Key, - ), - Value = BalanceOf, - QueryKind = ValueQuery, + pub type PendingUnstake = StorageMap< + _, + Twox64Concat, + T::BlockNumber, + BoundedVec<(T::AccountId, BalanceOf), ConstU32>, + ValueQuery, >; /// A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`. #[pallet::storage] pub type StartBlock = StorageValue; - /// Next target block when interest is recalculated - #[pallet::storage] - #[pallet::getter(fn get_interest_block)] - pub type NextInterestBlock = - StorageValue; + // /// Next target block when interest is recalculated + // #[pallet::storage] + // #[pallet::getter(fn get_interest_block)] + // pub type NextInterestBlock = + // StorageValue; /// Stores hash a record for which the last revenue recalculation was performed. /// If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers. @@ -204,59 +223,26 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { - fn on_initialize(current_block: T::BlockNumber) -> Weight + fn on_initialize(current_block_number: T::BlockNumber) -> Weight where ::BlockNumber: From, { let mut consumed_weight = 0; - // let mut add_weight = |reads, writes, weight| { - // consumed_weight += T::DbWeight::get().reads_writes(reads, writes); - // consumed_weight += weight; - // }; - - let current_relay_block = T::RelayBlockNumberProvider::current_block_number(); - PendingUnstake::::iter() - .filter_map(|((staker, block), amount)| { - if block <= current_relay_block { - Some((staker, block, amount)) - } else { - None - } - }) - .for_each(|(staker, block, amount)| { - Self::unlock_balance_unchecked(&staker, amount); - >::remove((staker, block)); + let mut add_weight = |reads, writes, weight| { + consumed_weight += T::DbWeight::get().reads_writes(reads, writes); + consumed_weight += weight; + }; + + let block_pending = PendingUnstake::::take(current_block_number); + + add_weight(0, 1, 0); + + if !block_pending.is_empty() { + block_pending.into_iter().for_each(|(staker, amount)| { + >::unreserve(&staker, amount); }); + } - // let next_interest_block = Self::get_interest_block(); - // let current_relay_block = T::RelayBlockNumberProvider::current_block_number(); - // if next_interest_block != 0.into() && current_relay_block >= next_interest_block { - // let mut acc = >::default(); - // let mut base_acc = >::default(); - - // NextInterestBlock::::set( - // NextInterestBlock::::get() + T::RecalculationInterval::get(), - // ); - // add_weight(0, 1, 0); - - // Staked::::iter() - // .filter(|((_, block), _)| { - // *block + T::RecalculationInterval::get() <= current_relay_block - // }) - // .for_each(|((staker, block), amount)| { - // Self::recalculate_stake(&staker, block, amount, &mut acc); - // add_weight(0, 0, T::WeightInfo::recalculate_stake()); - // base_acc += amount; - // }); - // >::get() - // .checked_add(&acc) - // .map(|res| >::set(res)); - - // Self::deposit_event(Event::StakingRecalculation(base_acc, acc)); - // add_weight(0, 1, 0); - // } else { - // add_weight(1, 0, 0) - // }; consumed_weight } } @@ -275,44 +261,44 @@ pub mod pallet { Ok(()) } - #[pallet::weight(T::WeightInfo::start_app_promotion())] - pub fn start_app_promotion( - origin: OriginFor, - promotion_start_relay_block: Option, - ) -> DispatchResult - where - ::BlockNumber: From, - { - ensure_root(origin)?; - - // Start app-promotion mechanics if it has not been yet initialized - if >::get() == 0u32.into() { - let start_block = promotion_start_relay_block - .unwrap_or(T::RelayBlockNumberProvider::current_block_number()); - - // Set promotion global start block - >::set(start_block); - - >::set(start_block + T::RecalculationInterval::get()); - } - - Ok(()) - } - - #[pallet::weight(T::WeightInfo::stop_app_promotion())] - pub fn stop_app_promotion(origin: OriginFor) -> DispatchResult - where - ::BlockNumber: From, - { - ensure_root(origin)?; - - if >::get() != 0u32.into() { - >::set(T::BlockNumber::default()); - >::set(T::BlockNumber::default()); - } - - Ok(()) - } + // #[pallet::weight(T::WeightInfo::start_app_promotion())] + // pub fn start_app_promotion( + // origin: OriginFor, + // promotion_start_relay_block: Option, + // ) -> DispatchResult + // where + // ::BlockNumber: From, + // { + // ensure_root(origin)?; + + // // Start app-promotion mechanics if it has not been yet initialized + // if >::get() == 0u32.into() { + // let start_block = promotion_start_relay_block + // .unwrap_or(T::RelayBlockNumberProvider::current_block_number()); + + // // Set promotion global start block + // >::set(start_block); + + // >::set(start_block + T::RecalculationInterval::get()); + // } + + // Ok(()) + // } + + // #[pallet::weight(T::WeightInfo::stop_app_promotion())] + // pub fn stop_app_promotion(origin: OriginFor) -> DispatchResult + // where + // ::BlockNumber: From, + // { + // ensure_root(origin)?; + + // if >::get() != 0u32.into() { + // >::set(T::BlockNumber::default()); + // >::set(T::BlockNumber::default()); + // } + + // Ok(()) + // } #[pallet::weight(T::WeightInfo::stake())] pub fn stake(staker: OriginFor, amount: BalanceOf) -> DispatchResult { @@ -369,6 +355,10 @@ pub mod pallet { #[pallet::weight(T::WeightInfo::unstake())] pub fn unstake(staker: OriginFor) -> DispatchResultWithPostInfo { let staker_id = ensure_signed(staker)?; + let block = >::block_number() + T::PendingInterval::get(); + let mut pendings = >::get(block); + + ensure!(pendings.is_full(), Error::::PendingForBlockOverflow); let mut total_stakes = 0u64; @@ -382,14 +372,16 @@ pub mod pallet { if total_staked.is_zero() { return Ok(None.into()); } - let block = - T::RelayBlockNumberProvider::current_block_number() + T::PendingInterval::get(); - >::insert( - (&staker_id, block), - >::get((&staker_id, block)) - .checked_add(&total_staked) - .ok_or(ArithmeticError::Overflow)?, - ); + + pendings + .try_push((staker_id.clone(), total_staked)) + .map_err(|_| Error::::PendingForBlockOverflow)?; + + >::insert(block, pendings); + + Self::unlock_balance_unchecked(&staker_id, total_staked); + + >::reserve(&staker_id, total_staked)?; TotalStaked::::set( TotalStaked::::get() @@ -671,17 +663,37 @@ where <::Currency as Currency>::Balance: Sum, { pub fn cross_id_pending_unstake(staker: Option) -> BalanceOf { - staker.map_or(PendingUnstake::::iter_values().sum(), |s| { - PendingUnstake::::iter_prefix_values((s.as_sub(),)).sum() - }) + staker.map_or( + PendingUnstake::::iter_values() + .flat_map(|pendings| pendings.into_iter().map(|(_, amount)| amount)) + .sum(), + |s| { + PendingUnstake::::iter_values() + .flatten() + .filter_map(|(id, amount)| { + if id == *s.as_sub() { + Some(amount) + } else { + None + } + }) + .sum() + }, + ) } pub fn cross_id_pending_unstake_per_block( staker: T::CrossAccountId, ) -> Vec<(T::BlockNumber, BalanceOf)> { - let mut unsorted_res = PendingUnstake::::iter_prefix((staker.as_sub(),)) - .into_iter() - .collect::>(); + let mut unsorted_res = vec![]; + PendingUnstake::::iter().for_each(|(block, pendings)| { + pendings.into_iter().for_each(|(id, amount)| { + if id == *staker.as_sub() { + unsorted_res.push((block, amount)); + }; + }) + }); + unsorted_res.sort_by_key(|(block, _)| *block); unsorted_res } diff --git a/pallets/app-promotion/src/tests.rs b/pallets/app-promotion/src/tests.rs index eaec6f37a3..2eb43faba8 100644 --- a/pallets/app-promotion/src/tests.rs +++ b/pallets/app-promotion/src/tests.rs @@ -16,20 +16,20 @@ #![cfg(test)] #![allow(clippy::from_over_into)] -use crate as pallet_promotion; - -use frame_benchmarking::{add_benchmark, BenchmarkBatch}; -use frame_support::{ - assert_ok, parameter_types, - traits::{Currency, OnInitialize, Everything, ConstU32}, -}; -use frame_system::RawOrigin; -use sp_core::H256; -use sp_runtime::{ - traits::{BlakeTwo256, BlockNumberProvider, IdentityLookup}, - testing::Header, - Perbill, Perquintill, -}; +// use crate as pallet_promotion; + +// use frame_benchmarking::{add_benchmark, BenchmarkBatch}; +// use frame_support::{ +// assert_ok, parameter_types, +// traits::{Currency, OnInitialize, Everything, ConstU32}, +// }; +// use frame_system::RawOrigin; +// use sp_core::H256; +// use sp_runtime::{ +// traits::{BlakeTwo256, BlockNumberProvider, IdentityLookup}, +// testing::Header, +// Perbill, Perquintill, +// }; // type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; // type Block = frame_system::mocking::MockBlock; @@ -127,24 +127,24 @@ use sp_runtime::{ // } ) // } -#[test] -fn test_perbill() { - const ONE_UNIQE: u128 = 1_000_000_000_000_000_000; - const SECONDS_TO_BLOCK: u32 = 12; - const DAY: u32 = 60 * 60 * 24 / SECONDS_TO_BLOCK; - const RECALCULATION_INTERVAL: u32 = 10; - let day_rate = Perbill::from_rational(5u64, 10_000); - let interval_rate = - Perbill::from_rational::(RECALCULATION_INTERVAL.into(), DAY.into()) * day_rate; - println!("{:?}", interval_rate * ONE_UNIQE + ONE_UNIQE); - println!("{:?}", day_rate * ONE_UNIQE); - println!("{:?}", Perbill::one() * ONE_UNIQE); - println!("{:?}", ONE_UNIQE); - let mut next_iters = ONE_UNIQE + interval_rate * ONE_UNIQE; - next_iters += interval_rate * next_iters; - println!("{:?}", next_iters); - let day_income = day_rate * ONE_UNIQE; - let interval_income = interval_rate * ONE_UNIQE; - let ratio = day_income / interval_income; - println!("{:?} || {:?}", ratio, DAY / RECALCULATION_INTERVAL); -} +// #[test] +// fn test_perbill() { +// const ONE_UNIQE: u128 = 1_000_000_000_000_000_000; +// const SECONDS_TO_BLOCK: u32 = 12; +// const DAY: u32 = 60 * 60 * 24 / SECONDS_TO_BLOCK; +// const RECALCULATION_INTERVAL: u32 = 10; +// let day_rate = Perbill::from_rational(5u64, 10_000); +// let interval_rate = +// Perbill::from_rational::(RECALCULATION_INTERVAL.into(), DAY.into()) * day_rate; +// println!("{:?}", interval_rate * ONE_UNIQE + ONE_UNIQE); +// println!("{:?}", day_rate * ONE_UNIQE); +// println!("{:?}", Perbill::one() * ONE_UNIQE); +// println!("{:?}", ONE_UNIQE); +// let mut next_iters = ONE_UNIQE + interval_rate * ONE_UNIQE; +// next_iters += interval_rate * next_iters; +// println!("{:?}", next_iters); +// let day_income = day_rate * ONE_UNIQE; +// let interval_income = interval_rate * ONE_UNIQE; +// let ratio = day_income / interval_income; +// println!("{:?} || {:?}", ratio, DAY / RECALCULATION_INTERVAL); +// } diff --git a/pallets/app-promotion/src/weights.rs b/pallets/app-promotion/src/weights.rs index 84a0b3fa96..e446e21351 100644 --- a/pallets/app-promotion/src/weights.rs +++ b/pallets/app-promotion/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_app_promotion //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-08-31, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-09-01, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -34,8 +34,6 @@ use sp_std::marker::PhantomData; /// Weight functions needed for pallet_app_promotion. pub trait WeightInfo { - fn start_app_promotion() -> Weight; - fn stop_app_promotion() -> Weight; fn set_admin_address() -> Weight; fn payout_stakers() -> Weight; fn stake() -> Weight; @@ -49,24 +47,9 @@ pub trait WeightInfo { /// Weights for pallet_app_promotion using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - // Storage: Promotion StartBlock (r:1 w:1) - // Storage: ParachainSystem ValidationData (r:1 w:0) - // Storage: Promotion NextInterestBlock (r:0 w:1) - fn start_app_promotion() -> Weight { - (3_995_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - // Storage: Promotion StartBlock (r:1 w:1) - // Storage: Promotion NextInterestBlock (r:0 w:1) - fn stop_app_promotion() -> Weight { - (3_623_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } // Storage: Promotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - (1_203_000 as Weight) + (515_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) @@ -74,54 +57,56 @@ impl WeightInfo for SubstrateWeight { // Storage: Promotion NextCalculatedRecord (r:1 w:1) // Storage: Promotion Staked (r:2 w:0) fn payout_stakers() -> Weight { - (10_859_000 as Weight) + (8_475_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) + // Storage: Promotion StakesPerAccount (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: ParachainSystem ValidationData (r:1 w:0) // Storage: Promotion Staked (r:1 w:1) // Storage: Promotion TotalStaked (r:1 w:1) fn stake() -> Weight { - (14_789_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + (12_266_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) } // Storage: Promotion Staked (r:2 w:1) // Storage: ParachainSystem ValidationData (r:1 w:0) // Storage: Promotion PendingUnstake (r:1 w:1) // Storage: Promotion TotalStaked (r:1 w:1) + // Storage: Promotion StakesPerAccount (r:0 w:1) fn unstake() -> Weight { - (16_889_000 as Weight) + (10_663_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn sponsor_collection() -> Weight { - (18_377_000 as Weight) + (10_879_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn stop_sponsoring_collection() -> Weight { - (13_989_000 as Weight) + (10_548_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:0 w:1) fn sponsor_contract() -> Weight { - (4_162_000 as Weight) + (2_130_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:1 w:1) fn stop_sponsoring_contract() -> Weight { - (5_457_000 as Weight) + (3_509_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -129,24 +114,9 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { - // Storage: Promotion StartBlock (r:1 w:1) - // Storage: ParachainSystem ValidationData (r:1 w:0) - // Storage: Promotion NextInterestBlock (r:0 w:1) - fn start_app_promotion() -> Weight { - (3_995_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - } - // Storage: Promotion StartBlock (r:1 w:1) - // Storage: Promotion NextInterestBlock (r:0 w:1) - fn stop_app_promotion() -> Weight { - (3_623_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - } // Storage: Promotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - (1_203_000 as Weight) + (515_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) @@ -154,54 +124,56 @@ impl WeightInfo for () { // Storage: Promotion NextCalculatedRecord (r:1 w:1) // Storage: Promotion Staked (r:2 w:0) fn payout_stakers() -> Weight { - (10_859_000 as Weight) + (8_475_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) + // Storage: Promotion StakesPerAccount (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: ParachainSystem ValidationData (r:1 w:0) // Storage: Promotion Staked (r:1 w:1) // Storage: Promotion TotalStaked (r:1 w:1) fn stake() -> Weight { - (14_789_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + (12_266_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(6 as Weight)) + .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } // Storage: Promotion Staked (r:2 w:1) // Storage: ParachainSystem ValidationData (r:1 w:0) // Storage: Promotion PendingUnstake (r:1 w:1) // Storage: Promotion TotalStaked (r:1 w:1) + // Storage: Promotion StakesPerAccount (r:0 w:1) fn unstake() -> Weight { - (16_889_000 as Weight) + (10_663_000 as Weight) .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn sponsor_collection() -> Weight { - (18_377_000 as Weight) + (10_879_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn stop_sponsoring_collection() -> Weight { - (13_989_000 as Weight) + (10_548_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:0 w:1) fn sponsor_contract() -> Weight { - (4_162_000 as Weight) + (2_130_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: Promotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:1 w:1) fn stop_sponsoring_contract() -> Weight { - (5_457_000 as Weight) + (3_509_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index ff261f03a4..95a9278e91 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -197,11 +197,11 @@ macro_rules! impl_common_runtime_apis { #[cfg(feature = "app-promotion")] return Ok(>::cross_id_total_staked(staker).unwrap_or_default()); } - + fn total_staked_per_block(staker: CrossAccountId) -> Result, DispatchError> { #[cfg(not(feature = "app-promotion"))] return unsupported!(); - + #[cfg(feature = "app-promotion")] return Ok(>::cross_id_total_staked_per_block(staker)); } @@ -209,7 +209,7 @@ macro_rules! impl_common_runtime_apis { fn total_staking_locked(staker: CrossAccountId) -> Result { #[cfg(not(feature = "app-promotion"))] return unsupported!(); - + #[cfg(feature = "app-promotion")] return Ok(>::cross_id_locked_balance(staker)); } @@ -217,7 +217,7 @@ macro_rules! impl_common_runtime_apis { fn pending_unstake(staker: Option) -> Result { #[cfg(not(feature = "app-promotion"))] return unsupported!(); - + #[cfg(feature = "app-promotion")] return Ok(>::cross_id_pending_unstake(staker)); } @@ -225,7 +225,7 @@ macro_rules! impl_common_runtime_apis { fn pending_unstake_per_block(staker: CrossAccountId) -> Result, DispatchError> { #[cfg(not(feature = "app-promotion"))] return unsupported!(); - + #[cfg(feature = "app-promotion")] return Ok(>::cross_id_pending_unstake_per_block(staker)) } From 0525582f3c4188f6f944fe6c56d4002562953dae Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 2 Sep 2022 11:59:42 +0000 Subject: [PATCH 0685/1274] fix: some rpc fixes --- client/rpc/src/lib.rs | 62 ++++++++--------------- node/rpc/src/lib.rs | 3 +- tests/src/interfaces/augment-api-query.ts | 10 ++-- 3 files changed, 29 insertions(+), 46 deletions(-) diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index 5d24290e41..3fffcb9eff 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -412,47 +412,27 @@ mod rmrk_unique_rpc { } } -pub struct Unique { - client: Arc, - _marker: std::marker::PhantomData

, -} - -impl Unique { - pub fn new(client: Arc) -> Self { - Self { - client, - _marker: Default::default(), +macro_rules! define_struct_for_server_api { + ($name:ident) => { + pub struct $name { + client: Arc, + _marker: std::marker::PhantomData

, } - } -} - -pub struct AppPromotion { - client: Arc, - _marker: std::marker::PhantomData

, -} - -impl AppPromotion { - pub fn new(client: Arc) -> Self { - Self { - client, - _marker: Default::default(), + + impl $name { + pub fn new(client: Arc) -> Self { + Self { + client, + _marker: Default::default(), + } + } } - } -} - -pub struct Rmrk { - client: Arc, - _marker: std::marker::PhantomData

, + }; } -impl Rmrk { - pub fn new(client: Arc) -> Self { - Self { - client, - _marker: Default::default(), - } - } -} +define_struct_for_server_api!(Unique); +define_struct_for_server_api!(AppPromotion); +define_struct_for_server_api!(Rmrk); macro_rules! pass_method { ( @@ -605,14 +585,14 @@ where |v| v .into_iter() .map(|(b, a)| (b, a.to_string())) - .collect::>(), unique_api); - pass_method!(total_staking_locked(staker: CrossAccountId) -> String => |v| v.to_string(), unique_api); - pass_method!(pending_unstake(staker: Option) -> String => |v| v.to_string(), unique_api); + .collect::>(), app_promotion_api); + pass_method!(total_staking_locked(staker: CrossAccountId) -> String => |v| v.to_string(), app_promotion_api); + pass_method!(pending_unstake(staker: Option) -> String => |v| v.to_string(), app_promotion_api); pass_method!(pending_unstake_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, String)> => |v| v .into_iter() .map(|(b, a)| (b, a.to_string())) - .collect::>(), unique_api); + .collect::>(), app_promotion_api); } #[allow(deprecated)] diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index 2a3c546390..b782dbcb8e 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -38,7 +38,6 @@ use sp_api::ProvideRuntimeApi; use sp_block_builder::BlockBuilder; use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; use sc_service::TransactionPool; -use uc_rpc::AppPromotion; use std::{collections::BTreeMap, sync::Arc}; use up_common::types::opaque::{Hash, AccountId, RuntimeInstance, Index, Block, BlockNumber, Balance}; @@ -232,7 +231,7 @@ where io.merge(Unique::new(client.clone()).into_rpc())?; - // #[cfg(not(feature = "unique-runtime"))] + #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] io.merge(AppPromotion::new(client.clone()).into_rpc())?; #[cfg(not(feature = "unique-runtime"))] diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 3cd9c2e92c..82ada23e9b 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -6,7 +6,7 @@ import '@polkadot/api-base/types/storage'; import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types'; -import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec'; +import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime'; import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild } from '@polkadot/types/lookup'; @@ -513,10 +513,10 @@ declare module '@polkadot/api-base/types/storage' { promotion: { admin: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** - * Stores the address of the staker for which the last revenue recalculation was performed. + * Stores hash a record for which the last revenue recalculation was performed. * If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers. **/ - lastCalcucaltedStaker: AugmentedQuery Observable>, []> & QueryableStorageEntry; + nextCalculatedRecord: AugmentedQuery Observable>>, []> & QueryableStorageEntry; /** * Next target block when interest is recalculated **/ @@ -529,6 +529,10 @@ declare module '@polkadot/api-base/types/storage' { * Amount of tokens staked by account in the blocknumber. **/ staked: AugmentedQuery Observable>, [AccountId32, u32]> & QueryableStorageEntry; + /** + * Amount of stakes for an Account + **/ + stakesPerAccount: AugmentedQuery Observable, [AccountId32]> & QueryableStorageEntry; /** * A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`. **/ From 1021988cbcec27222008499823cf6110b7da4b7c Mon Sep 17 00:00:00 2001 From: Maksandre Date: Fri, 2 Sep 2022 15:45:31 +0300 Subject: [PATCH 0686/1274] Tests up: remove unused methods --- tests/src/app-promotion.test.ts | 67 ++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index de4f341a6c..000ff07c32 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -35,7 +35,6 @@ const expect = chai.expect; let alice: IKeyringPair; let palletAdmin: IKeyringPair; let nominal: bigint; -let promotionStartBlock: number | null = null; const palletAddress = calculatePalleteAddress('appstake'); let accounts: IKeyringPair[] = []; @@ -48,20 +47,10 @@ before(async function () { nominal = helper.balance.getOneTokenNominal(); await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal); await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal); - if (!promotionStartBlock) { - promotionStartBlock = (await helper.api!.query.parachainSystem.lastRelayChainBlockNumber()).toNumber(); - } - await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.startAppPromotion(promotionStartBlock!))); accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests }); }); -after(async function () { - await usingPlaygrounds(async (helper) => { - await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.stopAppPromotion())); - }); -}); - describe('app-promotions.stake extrinsic', () => { it('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async () => { await usingPlaygrounds(async (helper) => { @@ -91,16 +80,24 @@ describe('app-promotions.stake extrinsic', () => { }); }); - it('should allow to stake with nonce', async () => { + it('should allow to create maximum 10 stakes for account', async () => { await usingPlaygrounds(async (helper) => { - const staker = accounts.pop()!; - const transactions = []; - for (let nonce = 0; nonce < 9; nonce++) { - transactions.push(helper.signTransaction(staker, helper.api?.tx.promotion.stake(100n * nominal), 'Staker stakes with nonce', {nonce})); + const [staker] = await helper.arrange.createAccounts([2000n], alice); + console.log(staker.address); + for (let i = 0; i < 10; i++) { + await helper.staking.stake(staker, 100n * nominal); } - await Promise.allSettled(transactions); - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(900n * nominal); + // can have 10 stakes + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(1000n * nominal); + expect(await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).to.have.length(10); + + await expect(helper.staking.stake(staker, 100n * nominal)).to.be.rejected; + + // After unstake can stake again + await helper.staking.unstake(staker); + await helper.staking.stake(staker, 100n * nominal); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.equal(100n * nominal); }); }); @@ -129,10 +126,6 @@ describe('app-promotions.stake extrinsic', () => { expect(crowdStakes).to.deep.equal([100n * nominal, 100n * nominal, 100n * nominal, 100n * nominal]); }); }); - - it('should allow to create maximum 10 stakes for account', async () => { - - }); }); describe('unstake balance extrinsic', () => { @@ -153,7 +146,8 @@ describe('unstake balance extrinsic', () => { }); }); - it('should unlock balance after unlocking period ends and subtract it from "pendingUnstake"', async () => { + it('should unlock balance after unlocking period ends and remove it from "pendingUnstake"', async () => { + // TODO Flaky test await usingPlaygrounds(async (helper) => { const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); @@ -161,7 +155,7 @@ describe('unstake balance extrinsic', () => { // Wait for unstaking period. Balance now free ~1000; reserved, frozen, miscFrozeb: 0n await waitForRelayBlock(helper.api!, 20); - expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n * nominal, miscFrozen: 0n, feeFrozen: 0n}); + expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, miscFrozen: 0n, feeFrozen: 0n}); expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); // staker can transfer: @@ -194,7 +188,7 @@ describe('unstake balance extrinsic', () => { expect(stakedPerBlock).to.be.deep.equal([]); expect(unstakedPerBlock).to.be.deep.equal([600n * nominal]); - expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 600n * nominal, miscFrozen: 600n * nominal}); + expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 600n * nominal, feeFrozen: 0n, miscFrozen: 0n}); await waitForRelayBlock(helper.api!, 20); expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 0n, miscFrozen: 0n}); expect (await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); @@ -637,7 +631,7 @@ describe('app-promotion rewards', () => { it('can not be called by non admin', async () => { await usingPlaygrounds(async (helper) => { const nonAdmin = accounts.pop()!; - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.payoutStakers(50))).to.be.rejected; + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.payoutStakers(100))).to.be.rejected; }); }); @@ -649,7 +643,7 @@ describe('app-promotion rewards', () => { await helper.staking.stake(staker, 100n * nominal); await helper.staking.stake(staker, 200n * nominal); await waitForRelayBlock(helper.api!, 30); - await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(50)); + await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(100)); const totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); expect(totalStakedPerBlock).to.be.deep.equal([calculateIncome(100n * nominal, 10n), calculateIncome(200n * nominal, 10n)]); @@ -657,6 +651,7 @@ describe('app-promotion rewards', () => { }); it('shoud be paid for more than one period if payments was missed', async () => { + // TODO flaky test await usingPlaygrounds(async (helper) => { const staker = accounts.pop()!; @@ -664,7 +659,7 @@ describe('app-promotion rewards', () => { await helper.staking.stake(staker, 200n * nominal); await waitForRelayBlock(helper.api!, 55); - await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(50)); + await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(100)); const stakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); expect(stakedPerBlock[0][1]).to.be.equal(calculateIncome(100n * nominal, 10n, 2)); expect(stakedPerBlock[1][1]).to.be.equal(calculateIncome(200n * nominal, 10n, 2)); @@ -677,9 +672,19 @@ describe('app-promotion rewards', () => { }); it('should not be credited for unstaked (reserved) balance', async () => { - expect.fail('Test not implemented'); await usingPlaygrounds(async helper => { + // staker unstakes before rewards has been initialized const staker = accounts.pop()!; + await helper.staking.stake(staker, 100n * nominal); + await waitForRelayBlock(helper.api!, 40); + await helper.staking.unstake(staker); + + // so he did not receive any rewards + const totalBalanceBefore = await helper.balance.getSubstrate(staker.address); + await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(100)); + const totalBalanceAfter = await helper.balance.getSubstrate(staker.address); + + expect(totalBalanceBefore).to.be.equal(totalBalanceAfter); }); }); @@ -693,12 +698,12 @@ describe('app-promotion rewards', () => { await helper.staking.stake(staker, 300n * nominal); await waitForRelayBlock(helper.api!, 34); - await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(50)); + await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(100)); let totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n), calculateIncome(200n * nominal, 10n), calculateIncome(300n * nominal, 10n)]); await waitForRelayBlock(helper.api!, 20); - await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(50)); + await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(100)); totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n, 2), calculateIncome(200n * nominal, 10n, 2), calculateIncome(300n * nominal, 10n, 2)]); }); From 0d218a2237c36c819e1d30b3059e03bde0e7da4e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 2 Sep 2022 15:49:03 +0300 Subject: [PATCH 0687/1274] fix: as per documentation --- .github/workflows/ci-develop.yml | 10 ++++---- .github/workflows/ci-master.yml | 12 +++++----- .github/workflows/codestyle_v2.yml | 37 +----------------------------- 3 files changed, 12 insertions(+), 47 deletions(-) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index e20d30f01a..f4072c8c2c 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -12,25 +12,25 @@ concurrency: jobs: yarn-test-dev: - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == 'false' }} uses: ./.github/workflows/dev-build-tests_v2.yml unit-test: - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == 'false' }} uses: ./.github/workflows/unit-test_v2.yml forkless: - if: contains( github.event.pull_request.labels.*.name, 'forkless') + if: ${{ contains( github.event.pull_request.labels.*.name, 'forkless') }} uses: ./.github/workflows/forkless.yml canary: - if: contains( github.event.pull_request.labels.*.name, 'canary') + if: ${{ contains( github.event.pull_request.labels.*.name, 'canary') }} uses: ./.github/workflows/canary.yml secrets: inherit # pass all secrets xcm: - if: contains( github.event.pull_request.labels.*.name, 'xcm') + if: ${{ contains( github.event.pull_request.labels.*.name, 'xcm') }} uses: ./.github/workflows/xcm.yml secrets: inherit # pass all secrets diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index 266ffd7fe8..160e721369 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -12,27 +12,27 @@ concurrency: jobs: unit-test: - if: github.event.pull_request.draft != true + if: ${{ github.event.pull_request.draft != 'true' }} uses: ./.github/workflows/unit-test_v2.yml node-only-update: - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == 'false' }} uses: ./.github/workflows/node-only-update_v2.yml forkless: - if: contains( github.event.pull_request.labels.*.name, 'forkless') + if: ${{ contains( github.event.pull_request.labels.*.name, 'forkless') }} uses: ./.github/workflows/forkless.yml canary: - if: contains( github.event.pull_request.labels.*.name, 'canary') + if: ${{ contains( github.event.pull_request.labels.*.name, 'canary') }} uses: ./.github/workflows/canary.yml secrets: inherit # pass all secrets xcm: - if: contains( github.event.pull_request.labels.*.name, 'xcm') + if: ${{ contains( github.event.pull_request.labels.*.name, 'xcm') }} uses: ./.github/workflows/xcm.yml secrets: inherit # pass all secrets codestyle: - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == 'false' }} uses: ./.github/workflows/codestyle_v2.yml \ No newline at end of file diff --git a/.github/workflows/codestyle_v2.yml b/.github/workflows/codestyle_v2.yml index 7b5a707b61..3ecce37b21 100644 --- a/.github/workflows/codestyle_v2.yml +++ b/.github/workflows/codestyle_v2.yml @@ -8,24 +8,6 @@ jobs: runs-on: self-hosted-ci steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - uses: actions/checkout@v3 - name: Install latest nightly uses: actions-rs/toolchain@v1 @@ -46,24 +28,7 @@ jobs: runs-on: self-hosted-ci steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - + - uses: actions/checkout@v3 - name: Install substrate dependencies run: sudo apt-get install libssl-dev pkg-config libclang-dev clang From de3cc2908b884f5e10dec9ae42c6142af62eedba Mon Sep 17 00:00:00 2001 From: PraetorP Date: Fri, 2 Sep 2022 20:09:18 +0700 Subject: [PATCH 0688/1274] fix unstake --- pallets/app-promotion/src/lib.rs | 28 ++++++++++++++-------------- tests/src/app-promotion.test.ts | 4 +--- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 407ca14f21..a1d8e3ac81 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -358,7 +358,7 @@ pub mod pallet { let block = >::block_number() + T::PendingInterval::get(); let mut pendings = >::get(block); - ensure!(pendings.is_full(), Error::::PendingForBlockOverflow); + ensure!(!pendings.is_full(), Error::::PendingForBlockOverflow); let mut total_stakes = 0u64; @@ -370,7 +370,7 @@ pub mod pallet { .sum(); if total_staked.is_zero() { - return Ok(None.into()); + return Ok(None.into()); // TO-DO } pendings @@ -387,7 +387,7 @@ pub mod pallet { TotalStaked::::get() .checked_sub(&total_staked) .ok_or(ArithmeticError::Underflow)?, - ); // when error we should recover initial stake state for the staker + ); StakesPerAccount::::remove(&staker_id); @@ -474,46 +474,46 @@ pub mod pallet { let next_recalc_block = current_recalc_block + T::RecalculationInterval::get(); let mut storage_iterator = Self::get_next_calculated_key() - .map_or(Staked::::iter().skip(0), |key| { - Staked::::iter_from(key).skip(1) + .map_or(Staked::::iter(), |key| { + Staked::::iter_from(key) }); NextCalculatedRecord::::set(None); { let mut stakers_number = stakers_number.unwrap_or(20); - let mut current_id = admin_id; + let mut last_id = admin_id; let mut income_acc = BalanceOf::::default(); - while let Some(((id, staked_block), (amount, next_recalc_block_for_stake))) = + while let Some(((current_id, staked_block), (amount, next_recalc_block_for_stake))) = storage_iterator.next() { - if current_id != id { + if last_id != current_id { if income_acc != BalanceOf::::default() { >::transfer( &T::TreasuryAccountId::get(), - ¤t_id, + &last_id, income_acc, ExistenceRequirement::KeepAlive, ) - .and_then(|_| Self::add_lock_balance(¤t_id, income_acc))?; + .and_then(|_| Self::add_lock_balance(&last_id, income_acc))?; Self::deposit_event(Event::StakingRecalculation( - current_id, amount, income_acc, + last_id, amount, income_acc, )); } if stakers_number == 0 { - NextCalculatedRecord::::set(Some((id, staked_block))); + NextCalculatedRecord::::set(Some((current_id, staked_block))); break; } stakers_number -= 1; income_acc = BalanceOf::::default(); - current_id = id; + last_id = current_id; }; if current_recalc_block >= next_recalc_block_for_stake { Self::recalculate_and_insert_stake( - ¤t_id, + &last_id, staked_block, next_recalc_block, amount, diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index de4f341a6c..ac4d673c70 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -51,14 +51,12 @@ before(async function () { if (!promotionStartBlock) { promotionStartBlock = (await helper.api!.query.parachainSystem.lastRelayChainBlockNumber()).toNumber(); } - await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.startAppPromotion(promotionStartBlock!))); accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests }); }); after(async function () { await usingPlaygrounds(async (helper) => { - await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.stopAppPromotion())); }); }); @@ -241,7 +239,7 @@ describe('unstake balance extrinsic', () => { it('should be possible for different accounts in one block', async () => { await usingPlaygrounds(async (helper) => { - const stakers = [accounts.pop()!, accounts.pop()!, accounts.pop()!, accounts.pop()!, accounts.pop()!]; + const stakers = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; await Promise.all(stakers.map(staker => helper.staking.stake(staker, 100n * nominal))); await Promise.all(stakers.map(staker => helper.staking.unstake(staker))); From 7b07931fc69adc9d36a065d45533d5700e6131b9 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 2 Sep 2022 10:50:46 +0000 Subject: [PATCH 0689/1274] test(xcm): unique <-> moonbeam --- tests/src/xcm/xcmUnique.test.ts | 453 +++++++++++++++++++++++++++++--- 1 file changed, 412 insertions(+), 41 deletions(-) diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index c415816918..847a29b969 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -17,11 +17,13 @@ import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {WsProvider} from '@polkadot/api'; +import {WsProvider, Keyring} from '@polkadot/api'; import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; import {getGenericResult, generateKeyringPair} from '../util/helpers'; +import {MultiLocation} from '@polkadot/types/interfaces'; +import {blake2AsHex} from '@polkadot/util-crypto'; import waitNewBlocks from '../substrate/wait-new-blocks'; import getBalance from '../substrate/get-balance'; @@ -30,23 +32,39 @@ const expect = chai.expect; const UNIQUE_CHAIN = 2037; const ACALA_CHAIN = 2000; +const MOONBEAM_CHAIN = 2004; -const ACALA_PORT = '9946'; +const ACALA_PORT = 9946; +const MOONBEAM_PORT = 9947; const TRANSFER_AMOUNT = 2000000000000000000000000n; +function parachainApiOptions(port: number): ApiOptions { + return { + provider: new WsProvider('ws://127.0.0.1:' + port.toString()), + }; +} + +function acalaOptions(): ApiOptions { + return parachainApiOptions(ACALA_PORT); +} + +function moonbeamOptions(): ApiOptions { + return parachainApiOptions(MOONBEAM_PORT); +} + describe('Integration test: Exchanging UNQ with Acala', () => { let alice: IKeyringPair; let randomAccount: IKeyringPair; - let balanceUniqueTokenBefore: bigint; - let balanceUniqueTokenAfter: bigint; + let balanceUniqueTokenInit: bigint; + let balanceUniqueTokenMiddle: bigint; let balanceUniqueTokenFinal: bigint; - let balanceAcalaTokenBefore: bigint; - let balanceAcalaTokenAfter: bigint; + let balanceAcalaTokenInit: bigint; + let balanceAcalaTokenMiddle: bigint; let balanceAcalaTokenFinal: bigint; - let balanceUniqueForeignTokenAfter: bigint; - let balanceUniqueForeignTokenBefore: bigint; + let balanceUniqueForeignTokenInit: bigint; + let balanceUniqueForeignTokenMiddle: bigint; let balanceUniqueForeignTokenFinal: bigint; before(async () => { @@ -54,11 +72,7 @@ describe('Integration test: Exchanging UNQ with Acala', () => { alice = privateKeyWrapper('//Alice'); randomAccount = generateKeyringPair(); }); - - const acalaApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT), - }; - + // Acala side await usingApi( async (api) => { @@ -91,13 +105,13 @@ describe('Integration test: Exchanging UNQ with Acala', () => { const result1 = getGenericResult(events1); expect(result1.success).to.be.true; - [balanceAcalaTokenBefore] = await getBalance(api, [randomAccount.address]); + [balanceAcalaTokenInit] = await getBalance(api, [randomAccount.address]); { const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceUniqueForeignTokenBefore = BigInt(free); + balanceUniqueForeignTokenInit = BigInt(free); } }, - acalaApiOptions, + acalaOptions(), ); // Unique side @@ -107,7 +121,7 @@ describe('Integration test: Exchanging UNQ with Acala', () => { const result0 = getGenericResult(events0); expect(result0.success).to.be.true; - [balanceUniqueTokenBefore] = await getBalance(api, [randomAccount.address]); + [balanceUniqueTokenInit] = await getBalance(api, [randomAccount.address]); }); }); @@ -165,9 +179,9 @@ describe('Integration test: Exchanging UNQ with Acala', () => { const result = getGenericResult(events); expect(result.success).to.be.true; - [balanceUniqueTokenAfter] = await getBalance(api, [randomAccount.address]); + [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccount.address]); - const unqFees = balanceUniqueTokenBefore - balanceUniqueTokenAfter; + const unqFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle + TRANSFER_AMOUNT; console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', unqFees); expect(unqFees > 0n).to.be.true; }); @@ -175,24 +189,21 @@ describe('Integration test: Exchanging UNQ with Acala', () => { // Acala side await usingApi( async (api) => { - // todo do something about instant sealing, where there might not be any new blocks await waitNewBlocks(api, 3); const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceUniqueForeignTokenAfter = BigInt(free); + balanceUniqueForeignTokenMiddle = BigInt(free); - [balanceAcalaTokenAfter] = await getBalance(api, [randomAccount.address]); - - const acaFees = balanceAcalaTokenBefore - balanceAcalaTokenAfter; - const unqDiffAfterIncomeTransfer = balanceUniqueForeignTokenAfter - balanceUniqueForeignTokenBefore; + [balanceAcalaTokenMiddle] = await getBalance(api, [randomAccount.address]); - const unqFees = unqDiffAfterIncomeTransfer - TRANSFER_AMOUNT; + const acaFees = balanceAcalaTokenInit - balanceAcalaTokenMiddle; + const unqIncomeTransfer = balanceUniqueForeignTokenMiddle - balanceUniqueForeignTokenInit; console.log('[Unique -> Acala] transaction fees on Acala: %s ACA', acaFees); - console.log('[Unique -> Acala] transaction fees on Acala: %s UNQ', unqFees); + console.log('[Unique -> Acala] income %s UNQ', unqIncomeTransfer); expect(acaFees == 0n).to.be.true; - expect(unqFees == 0n).to.be.true; + expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true; }, - {provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT)}, + acalaOptions(), ); }); @@ -221,11 +232,10 @@ describe('Integration test: Exchanging UNQ with Acala', () => { const id = { ForeignAsset: 0, }; - - const amount = TRANSFER_AMOUNT; + const destWeight = 50000000; - const tx = api.tx.xTokens.transfer(id, amount, destination, destWeight); + const tx = api.tx.xTokens.transfer(id, TRANSFER_AMOUNT, destination, destWeight); const events = await submitTransactionAsync(randomAccount, tx); const result = getGenericResult(events); expect(result.success).to.be.true; @@ -236,28 +246,27 @@ describe('Integration test: Exchanging UNQ with Acala', () => { balanceUniqueForeignTokenFinal = BigInt(free); } - const acaFees = balanceAcalaTokenAfter - balanceAcalaTokenFinal; - const unqDiffAfterOutcomeTransfer = balanceUniqueForeignTokenAfter - TRANSFER_AMOUNT; - - const unqFees = unqDiffAfterOutcomeTransfer - balanceUniqueForeignTokenFinal; + const acaFees = balanceAcalaTokenMiddle - balanceAcalaTokenFinal; + const unqOutcomeTransfer = balanceUniqueForeignTokenMiddle - balanceUniqueForeignTokenFinal; console.log('[Acala -> Unique] transaction fees on Acala: %s ACA', acaFees); - console.log('[Acala -> Unique] transaction fees on Acala: %s UNQ', unqFees); + console.log('[Acala -> Unique] outcome %s UNQ', unqOutcomeTransfer); expect(acaFees > 0).to.be.true; - expect(unqFees == 0n).to.be.true; + expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; }, - {provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT)}, + acalaOptions(), ); // Unique side await usingApi(async (api) => { - // todo do something about instant sealing, where there might not be any new blocks await waitNewBlocks(api, 3); [balanceUniqueTokenFinal] = await getBalance(api, [randomAccount.address]); - const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenAfter; + const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle; expect(actuallyDelivered > 0).to.be.true; + + console.log('[Acala -> Unique] actually delivered %s UNQ', actuallyDelivered); const unqFees = TRANSFER_AMOUNT - actuallyDelivered; console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', unqFees); @@ -265,3 +274,365 @@ describe('Integration test: Exchanging UNQ with Acala', () => { }); }); }); + +describe('Integration test: Exchanging UNQ with Moonbeam', () => { + + // Unique constants + let uniqueAlice: IKeyringPair; + let uniqueAssetLocation; + + let randomAccountUnique: IKeyringPair; + let randomAccountMoonbeam: IKeyringPair; + + // Moonbeam constants + let assetId: string; + + const moonbeamKeyring = new Keyring({type: 'ethereum'}); + const alithPrivateKey = '0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133'; + const baltatharPrivateKey = '0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b'; + const dorothyPrivateKey = '0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68'; + + const alithAccount = moonbeamKeyring.addFromUri(alithPrivateKey, undefined, 'ethereum'); + const baltatharAccount = moonbeamKeyring.addFromUri(baltatharPrivateKey, undefined, 'ethereum'); + const dorothyAccount = moonbeamKeyring.addFromUri(dorothyPrivateKey, undefined, 'ethereum'); + + const councilVotingThreshold = 2; + const technicalCommitteeThreshold = 2; + const votingPeriod = 3; + const delayPeriod = 0; + + const uniqueAssetMetadata = { + name: 'xcUnique', + symbol: 'xcUNQ', + decimals: 18, + isFrozen: false, + minimalBalance: 1, + }; + + let balanceUniqueTokenInit: bigint; + let balanceUniqueTokenMiddle: bigint; + let balanceUniqueTokenFinal: bigint; + let balanceForeignUnqTokenInit: bigint; + let balanceForeignUnqTokenMiddle: bigint; + let balanceForeignUnqTokenFinal: bigint; + let balanceGlmrTokenInit: bigint; + let balanceGlmrTokenMiddle: bigint; + let balanceGlmrTokenFinal: bigint; + + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + uniqueAlice = privateKeyWrapper('//Alice'); + randomAccountUnique = generateKeyringPair(); + randomAccountMoonbeam = generateKeyringPair('ethereum'); + + balanceForeignUnqTokenInit = 0n; + }); + + await usingApi( + async (api) => { + + // >>> Sponsoring Dorothy >>> + console.log('Sponsoring Dorothy.......'); + const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n); + const events0 = await submitTransactionAsync(alithAccount, tx0); + const result0 = getGenericResult(events0); + expect(result0.success).to.be.true; + console.log('Sponsoring Dorothy.......DONE'); + // <<< Sponsoring Dorothy <<< + + const sourceLocation: MultiLocation = api.createType( + 'MultiLocation', + { + parents: 1, + interior: {X1: {Parachain: UNIQUE_CHAIN}}, + }, + ); + + uniqueAssetLocation = {XCM: sourceLocation}; + const existentialDeposit = 1; + const isSufficient = true; + const unitsPerSecond = '1'; + const numAssetsWeightHint = 0; + + const registerTx = api.tx.assetManager.registerForeignAsset( + uniqueAssetLocation, + uniqueAssetMetadata, + existentialDeposit, + isSufficient, + ); + console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || ''); + + const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond( + uniqueAssetLocation, + unitsPerSecond, + numAssetsWeightHint, + ); + console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || ''); + + const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]); + console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || ''); + + // >>> Note motion preimage >>> + console.log('Note motion preimage.......'); + const encodedProposal = batchCall?.method.toHex() || ''; + const proposalHash = blake2AsHex(encodedProposal); + console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal); + console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); + console.log('Encoded length %d', encodedProposal.length); + + const tx1 = api.tx.democracy.notePreimage(encodedProposal); + const events1 = await submitTransactionAsync(baltatharAccount, tx1); + const result1 = getGenericResult(events1); + expect(result1.success).to.be.true; + console.log('Note motion preimage.......DONE'); + // <<< Note motion preimage <<< + + // >>> Propose external motion through council >>> + console.log('Propose external motion through council.......'); + const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash); + const tx2 = api.tx.councilCollective.propose( + councilVotingThreshold, + externalMotion, + externalMotion.encodedLength, + ); + const events2 = await submitTransactionAsync(baltatharAccount, tx2); + const result2 = getGenericResult(events2); + expect(result2.success).to.be.true; + + const encodedMotion = externalMotion?.method.toHex() || ''; + const motionHash = blake2AsHex(encodedMotion); + console.log('Motion hash is %s', motionHash); + + const tx3 = api.tx.councilCollective.vote(motionHash, 0, true); + { + const events3 = await submitTransactionAsync(dorothyAccount, tx3); + const result3 = getGenericResult(events3); + expect(result3.success).to.be.true; + } + { + const events3 = await submitTransactionAsync(baltatharAccount, tx3); + const result3 = getGenericResult(events3); + expect(result3.success).to.be.true; + } + + const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength); + const events4 = await submitTransactionAsync(dorothyAccount, tx4); + const result4 = getGenericResult(events4); + expect(result4.success).to.be.true; + console.log('Propose external motion through council.......DONE'); + // <<< Propose external motion through council <<< + + // >>> Fast track proposal through technical committee >>> + console.log('Fast track proposal through technical committee.......'); + const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); + const tx5 = api.tx.techCommitteeCollective.propose( + technicalCommitteeThreshold, + fastTrack, + fastTrack.encodedLength, + ); + const events5 = await submitTransactionAsync(alithAccount, tx5); + const result5 = getGenericResult(events5); + expect(result5.success).to.be.true; + + const encodedFastTrack = fastTrack?.method.toHex() || ''; + const fastTrackHash = blake2AsHex(encodedFastTrack); + console.log('FastTrack hash is %s', fastTrackHash); + + const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1; + const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true); + { + const events6 = await submitTransactionAsync(baltatharAccount, tx6); + const result6 = getGenericResult(events6); + expect(result6.success).to.be.true; + } + { + const events6 = await submitTransactionAsync(alithAccount, tx6); + const result6 = getGenericResult(events6); + expect(result6.success).to.be.true; + } + + const tx7 = api.tx.techCommitteeCollective + .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength); + const events7 = await submitTransactionAsync(baltatharAccount, tx7); + const result7 = getGenericResult(events7); + expect(result7.success).to.be.true; + console.log('Fast track proposal through technical committee.......DONE'); + // <<< Fast track proposal through technical committee <<< + + // >>> Referendum voting >>> + console.log('Referendum voting.......'); + const tx8 = api.tx.democracy.vote( + 0, + {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}}, + ); + const events8 = await submitTransactionAsync(dorothyAccount, tx8); + const result8 = getGenericResult(events8); + expect(result8.success).to.be.true; + console.log('Referendum voting.......DONE'); + // <<< Referendum voting <<< + + // >>> Acquire Unique AssetId Info on Moonbeam >>> + console.log('Acquire Unique AssetId Info on Moonbeam.......'); + + // Wait for the democracy execute + await waitNewBlocks(api, 5); + + assetId = (await api.query.assetManager.assetTypeId({ + XCM: sourceLocation, + })).toString(); + + console.log('UNQ asset ID is %s', assetId); + console.log('Acquire Unique AssetId Info on Moonbeam.......DONE'); + // >>> Acquire Unique AssetId Info on Moonbeam >>> + + // >>> Sponsoring random Account >>> + console.log('Sponsoring random Account.......'); + const tx10 = api.tx.balances.transfer(randomAccountMoonbeam.address, 11_000_000_000_000_000_000n); + const events10 = await submitTransactionAsync(baltatharAccount, tx10); + const result10 = getGenericResult(events10); + expect(result10.success).to.be.true; + console.log('Sponsoring random Account.......DONE'); + // <<< Sponsoring random Account <<< + + [balanceGlmrTokenInit] = await getBalance(api, [randomAccountMoonbeam.address]); + }, + moonbeamOptions(), + ); + + await usingApi(async (api) => { + const tx0 = api.tx.balances.transfer(randomAccountUnique.address, 10n * TRANSFER_AMOUNT); + const events0 = await submitTransactionAsync(uniqueAlice, tx0); + const result0 = getGenericResult(events0); + expect(result0.success).to.be.true; + + [balanceUniqueTokenInit] = await getBalance(api, [randomAccountUnique.address]); + }); + }); + + it('Should connect and send UNQ to Moonbeam', async () => { + await usingApi(async (api) => { + const currencyId = { + NativeAssetId: 'Here', + }; + const dest = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: MOONBEAM_CHAIN}, + {AccountKey20: {network: 'Any', key: randomAccountMoonbeam.address}}, + ], + }, + }, + }; + const amount = TRANSFER_AMOUNT; + const destWeight = 850000000; + + const tx = api.tx.xTokens.transfer(currencyId, amount, dest, destWeight); + const events = await submitTransactionAsync(randomAccountUnique, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccountUnique.address]); + expect(balanceUniqueTokenMiddle < balanceUniqueTokenInit).to.be.true; + + const transactionFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle + TRANSFER_AMOUNT; + console.log('[Unique -> Moonbeam] transaction fees on Unique: %s UNQ', transactionFees); + expect(transactionFees > 0).to.be.true; + }); + + await usingApi( + async (api) => { + await waitNewBlocks(api, 3); + + [balanceGlmrTokenMiddle] = await getBalance(api, [randomAccountMoonbeam.address]); + + const glmrFees = balanceGlmrTokenInit - balanceGlmrTokenMiddle; + console.log('[Unique -> Moonbeam] transaction fees on Moonbeam: %s GLMR', glmrFees); + expect(glmrFees == 0n).to.be.true; + + const unqRandomAccountAsset = ( + await api.query.assets.account(assetId, randomAccountMoonbeam.address) + ).toJSON()! as any; + + balanceForeignUnqTokenMiddle = BigInt(unqRandomAccountAsset['balance']); + const unqIncomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenInit; + console.log('[Unique -> Moonbeam] income %s UNQ', unqIncomeTransfer); + expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true; + }, + moonbeamOptions(), + ); + }); + + it('Should connect to Moonbeam and send UNQ back', async () => { + await usingApi( + async (api) => { + const asset = { + V1: { + id: { + Concrete: { + parents: 1, + interior: { + X1: {Parachain: UNIQUE_CHAIN}, + }, + }, + }, + fun: { + Fungible: TRANSFER_AMOUNT, + }, + }, + }; + const destination = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: UNIQUE_CHAIN}, + {AccountId32: {network: 'Any', id: randomAccountUnique.addressRaw}}, + ], + }, + }, + }; + const destWeight = 50000000; + + const tx = api.tx.xTokens.transferMultiasset(asset, destination, destWeight); + const events = await submitTransactionAsync(randomAccountMoonbeam, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceGlmrTokenFinal] = await getBalance(api, [randomAccountMoonbeam.address]); + + const glmrFees = balanceGlmrTokenMiddle - balanceGlmrTokenFinal; + console.log('[Moonbeam -> Unique] transaction fees on Moonbeam: %s GLMR', glmrFees); + expect(glmrFees > 0).to.be.true; + + const unqRandomAccountAsset = ( + await api.query.assets.account(assetId, randomAccountMoonbeam.address) + ).toJSON()! as any; + + expect(unqRandomAccountAsset).to.be.null; + + balanceForeignUnqTokenFinal = 0n; + + const unqOutcomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenFinal; + console.log('[Unique -> Moonbeam] outcome %s UNQ', unqOutcomeTransfer); + expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; + }, + moonbeamOptions(), + ); + + await usingApi(async (api) => { + await waitNewBlocks(api, 3); + + [balanceUniqueTokenFinal] = await getBalance(api, [randomAccountUnique.address]); + const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle; + expect(actuallyDelivered > 0).to.be.true; + + console.log('[Moonbeam -> Unique] actually delivered %s UNQ', actuallyDelivered); + + const unqFees = TRANSFER_AMOUNT - actuallyDelivered; + console.log('[Moonbeam -> Unique] transaction fees on Unique: %s UNQ', unqFees); + expect(unqFees == 0n).to.be.true; + }); + }); +}); From c9cd7476b1006d5f1616268a78601d18052541f7 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 2 Sep 2022 13:27:58 +0000 Subject: [PATCH 0690/1274] feat(xcm): reenable xtokens on qtz/unq, allow moonbeam on unq --- runtime/common/construct_runtime/mod.rs | 2 +- runtime/opal/src/xcm_config.rs | 2 +- runtime/quartz/src/xcm_config.rs | 12 ++++----- runtime/unique/src/xcm_config.rs | 36 ++++++++++++++++++++++++- 4 files changed, 42 insertions(+), 10 deletions(-) diff --git a/runtime/common/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs index 264159a8e1..aad968e3a7 100644 --- a/runtime/common/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -42,7 +42,7 @@ macro_rules! construct_runtime { Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 34, Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event} = 35, Vesting: orml_vesting::{Pallet, Storage, Call, Event, Config} = 37, - #[runtimes(opal)] + XTokens: orml_xtokens = 38, Tokens: orml_tokens = 39, // Vesting: pallet_vesting::{Pallet, Call, Config, Storage, Event} = 37, diff --git a/runtime/opal/src/xcm_config.rs b/runtime/opal/src/xcm_config.rs index 44b49c2827..baa206138a 100644 --- a/runtime/opal/src/xcm_config.rs +++ b/runtime/opal/src/xcm_config.rs @@ -498,7 +498,7 @@ impl Convert for AccountIdToMultiLocation { impl orml_xtokens::Config for Runtime { type Event = Event; type Balance = Balance; - type CurrencyId = AssetIds; + type CurrencyId = CurrencyId; type CurrencyIdConvert = CurrencyIdConvert; type AccountIdToMultiLocation = AccountIdToMultiLocation; type SelfLocation = SelfLocation; diff --git a/runtime/quartz/src/xcm_config.rs b/runtime/quartz/src/xcm_config.rs index 3da2d875e8..b77604eee4 100644 --- a/runtime/quartz/src/xcm_config.rs +++ b/runtime/quartz/src/xcm_config.rs @@ -180,11 +180,10 @@ impl orml_tokens::Config for Runtime { type OnKilledTokenAccount = (); } -/* impl orml_xtokens::Config for Runtime { type Event = Event; type Balance = Balance; - type CurrencyId = AssetIds; + type CurrencyId = CurrencyId; type CurrencyIdConvert = CurrencyIdConvert; type AccountIdToMultiLocation = AccountIdToMultiLocation; type SelfLocation = SelfLocation; @@ -197,7 +196,7 @@ impl orml_xtokens::Config for Runtime { type MultiLocationsFilter = Everything; type ReserveProvider = AbsoluteReserveProvider; } - */ + parameter_type_with_key! { pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { @@ -218,7 +217,7 @@ impl Contains for DustRemovalWhitelist { } } -/* + pub struct CurrencyIdConvert; impl Convert> for CurrencyIdConvert { fn convert(id: AssetIds) -> Option { @@ -228,12 +227,11 @@ impl Convert> for CurrencyIdConvert { X1(Parachain(ParachainInfo::get().into())), )), AssetIds::NativeAssetId(NativeCurrency::Parent) => Some(MultiLocation::parent()), - AssetIds::ForeignAssetId(foreign_asset_id) => { - XcmForeignAssetIdMapping::::get_multi_location(foreign_asset_id) - } + AssetIds::ForeignAssetId(_) => None, } } } +/* impl Convert> for CurrencyIdConvert { fn convert(location: MultiLocation) -> Option { if location == MultiLocation::here() diff --git a/runtime/unique/src/xcm_config.rs b/runtime/unique/src/xcm_config.rs index c29ecab3f5..02e6ab5159 100644 --- a/runtime/unique/src/xcm_config.rs +++ b/runtime/unique/src/xcm_config.rs @@ -88,6 +88,8 @@ pub fn get_allowed_locations() -> Vec { MultiLocation { parents: 1, interior: Here }, // Karura/Acala location MultiLocation { parents: 1, interior: X1(Parachain(2000)) }, + // Moonbeam location + MultiLocation { parents: 1, interior: X1(Parachain(2004)) }, // Self parachain address MultiLocation { parents: 1, interior: X1(Parachain(ParachainInfo::get().into())) }, ] @@ -201,10 +203,42 @@ impl orml_tokens::Config for Runtime { type OnKilledTokenAccount = (); } +impl orml_xtokens::Config for Runtime { + type Event = Event; + type Balance = Balance; + type CurrencyId = CurrencyId; + type CurrencyIdConvert = CurrencyIdConvert; + type AccountIdToMultiLocation = AccountIdToMultiLocation; + type SelfLocation = SelfLocation; + type XcmExecutor = XcmExecutor>; + type Weigher = FixedWeightBounds; + type BaseXcmWeight = BaseXcmWeight; + type LocationInverter = LocationInverter; + type MaxAssetsForTransfer = MaxAssetsForTransfer; + type MinXcmFee = ParachainMinFee; + type MultiLocationsFilter = Everything; + type ReserveProvider = AbsoluteReserveProvider; +} + +pub struct CurrencyIdConvert; +impl Convert> for CurrencyIdConvert { + fn convert(id: AssetIds) -> Option { + match id { + AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new( + 1, + X1(Parachain(ParachainInfo::get().into())), + )), + _ => None, + } + } +} parameter_types! { pub const BaseXcmWeight: Weight = 100_000_000; // TODO: recheck this pub const MaxAssetsForTransfer: usize = 2; + + pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); + pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); } parameter_type_with_key! { @@ -223,4 +257,4 @@ impl Convert for AccountIdToMultiLocation { }) .into() } -} \ No newline at end of file +} From 299194463ad39e393e8868126d26a736ab2cf097 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 2 Sep 2022 13:30:00 +0000 Subject: [PATCH 0691/1274] fix: tx fees check in MB tests, run XCM tests only when env var set --- tests/package.json | 4 +-- tests/src/util/helpers.ts | 35 +++++++++++++++++++++ tests/src/xcm/xcmUnique.test.ts | 54 ++++++++++++++++++++++++++++++--- 3 files changed, 86 insertions(+), 7 deletions(-) diff --git a/tests/package.json b/tests/package.json index e140081d95..eb99f0c9e1 100644 --- a/tests/package.json +++ b/tests/package.json @@ -74,11 +74,11 @@ "testInflation": "mocha --timeout 9999999 -r ts-node/register ./**/inflation.test.ts", "testScheduler": "mocha --timeout 9999999 -r ts-node/register ./**/scheduler.test.ts", "testSchedulingEVM": "mocha --timeout 9999999 -r ts-node/register ./**/eth/scheduling.test.ts", - "testXcmUnique": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmUnique.test.ts", + "testXcmUnique": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmUnique.test.ts", "testXcmOpal": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmOpal.test.ts", "testXcmTransferAcala": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferAcala.test.ts acalaId=2000 uniqueId=5000", "testXcmTransferStatemine": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferStatemine.test.ts statemineId=1000 uniqueId=5000", - "testXcmTransferMoonbeam": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferMoonbeam.test.ts moonbeamId=2000 uniqueId=5000", + "testXcmTransferMoonbeam": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferMoonbeam.test.ts", "testPalletPresence": "mocha --timeout 9999999 -r ts-node/register ./**/pallet-presence.test.ts", "testBlockProduction": "mocha --timeout 9999999 -r ts-node/register ./**/block-production.test.ts", "testEnableDisableTransfers": "mocha --timeout 9999999 -r ts-node/register ./**/enableDisableTransfer.test.ts", diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index d8c349a809..4b3efaa6ba 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -1746,6 +1746,12 @@ export async function queryCollectionExpectSuccess(api: ApiPromise, collectionId return (await api.rpc.unique.collectionById(collectionId)).unwrap(); } +export const describe_xcm = ( + process.env.RUN_XCM_TESTS + ? describe + : describe.skip +); + export async function waitNewBlocks(blocksCount = 1): Promise { await usingApi(async (api) => { const promise = new Promise(async (resolve) => { @@ -1762,6 +1768,35 @@ export async function waitNewBlocks(blocksCount = 1): Promise { }); } +export async function waitEvent( + api: ApiPromise, + maxBlocksToWait: number, + eventSection: string, + eventMethod: string, +): Promise { + + const promise = new Promise(async (resolve) => { + const unsubscribe = await api.query.system.events(eventRecords => { + const neededEvent = eventRecords.find(r => { + return r.event.section == eventSection && r.event.method == eventMethod; + }); + + if (neededEvent) { + unsubscribe(); + resolve(neededEvent); + } + + if (maxBlocksToWait > 0) { + maxBlocksToWait--; + } else { + unsubscribe(); + resolve(null); + } + }); + }); + return promise; +} + export async function repartitionRFT( api: ApiPromise, collectionId: number, diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index 847a29b969..f6e31e31a9 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -21,7 +21,7 @@ import {WsProvider, Keyring} from '@polkadot/api'; import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {getGenericResult, generateKeyringPair} from '../util/helpers'; +import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm} from '../util/helpers'; import {MultiLocation} from '@polkadot/types/interfaces'; import {blake2AsHex} from '@polkadot/util-crypto'; import waitNewBlocks from '../substrate/wait-new-blocks'; @@ -53,7 +53,7 @@ function moonbeamOptions(): ApiOptions { return parachainApiOptions(MOONBEAM_PORT); } -describe('Integration test: Exchanging UNQ with Acala', () => { +describe_xcm('Integration test: Exchanging tokens with Acala', () => { let alice: IKeyringPair; let randomAccount: IKeyringPair; @@ -181,7 +181,7 @@ describe('Integration test: Exchanging UNQ with Acala', () => { [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccount.address]); - const unqFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle + TRANSFER_AMOUNT; + const unqFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT; console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', unqFees); expect(unqFees > 0n).to.be.true; }); @@ -273,9 +273,53 @@ describe('Integration test: Exchanging UNQ with Acala', () => { expect(unqFees == 0n).to.be.true; }); }); + + it('Unique rejects ACA tokens from Acala', async () => { + // This test is relevant only when the foreign asset pallet is disabled + + await usingApi(async (api) => { + const destination = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: UNIQUE_CHAIN}, + { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, + }, + }, + ], + }, + }, + }; + + const id = { + Token: 'ACA', + }; + + const destWeight = 50000000; + + const tx = api.tx.xTokens.transfer(id, 100_000_000_000, destination, destWeight); + const events = await submitTransactionAsync(alice, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + }, acalaOptions()); + + await usingApi(async api => { + const maxWaitBlocks = 3; + const xcmpQueueFailEvent = await waitEvent(api, maxWaitBlocks, 'xcmpQueue', 'Fail'); + + expect( + xcmpQueueFailEvent != null, + 'Only native token is supported when the Foreign-Assets pallet is not connected', + ).to.be.true; + }); + }); }); -describe('Integration test: Exchanging UNQ with Moonbeam', () => { +describe_xcm('Integration test: Exchanging UNQ with Moonbeam', () => { // Unique constants let uniqueAlice: IKeyringPair; @@ -536,7 +580,7 @@ describe('Integration test: Exchanging UNQ with Moonbeam', () => { [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccountUnique.address]); expect(balanceUniqueTokenMiddle < balanceUniqueTokenInit).to.be.true; - const transactionFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle + TRANSFER_AMOUNT; + const transactionFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT; console.log('[Unique -> Moonbeam] transaction fees on Unique: %s UNQ', transactionFees); expect(transactionFees > 0).to.be.true; }); From 56575de5acb6ae05fad7c7ebfc834d32ac0428f3 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 2 Sep 2022 13:33:52 +0000 Subject: [PATCH 0692/1274] refactor: Rename module in extrinsic --- primitives/app_promotion_rpc/src/lib.rs | 5 - runtime/common/construct_runtime/mod.rs | 2 +- tests/src/app-promotion.test.ts | 117 ++++++++++----------- tests/src/interfaces/augment-api-consts.ts | 48 ++++----- tests/src/interfaces/augment-api-errors.ts | 45 ++++---- tests/src/interfaces/augment-api-events.ts | 14 +-- tests/src/interfaces/augment-api-query.ts | 62 +++++------ tests/src/interfaces/augment-api-tx.ts | 30 +++--- tests/src/interfaces/default/types.ts | 10 +- tests/src/interfaces/lookup.ts | 58 +++++----- tests/src/interfaces/types-lookup.ts | 62 +++++------ tests/src/util/helpers.ts | 2 +- tests/src/util/playgrounds/unique.ts | 4 +- 13 files changed, 214 insertions(+), 245 deletions(-) diff --git a/primitives/app_promotion_rpc/src/lib.rs b/primitives/app_promotion_rpc/src/lib.rs index 1a6a119982..703fcff528 100644 --- a/primitives/app_promotion_rpc/src/lib.rs +++ b/primitives/app_promotion_rpc/src/lib.rs @@ -16,11 +16,6 @@ #![cfg_attr(not(feature = "std"), no_std)] -use up_data_structs::{ - CollectionId, TokenId, RpcCollection, CollectionStats, CollectionLimits, Property, - PropertyKeyPermission, TokenData, TokenChild, -}; - use sp_std::vec::Vec; use codec::Decode; use sp_runtime::{ diff --git a/runtime/common/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs index 5a87b0029f..b35708d38d 100644 --- a/runtime/common/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -78,7 +78,7 @@ macro_rules! construct_runtime { RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event} = 72, #[runtimes(opal)] - Promotion: pallet_app_promotion::{Pallet, Call, Storage, Event} = 73, + AppPromotion: pallet_app_promotion::{Pallet, Call, Storage, Event} = 73, // Frontier EVM: pallet_evm::{Pallet, Config, Call, Storage, Event} = 100, diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index ea652b053c..d9877c27aa 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -38,29 +38,20 @@ let nominal: bigint; const palletAddress = calculatePalleteAddress('appstake'); let accounts: IKeyringPair[] = []; -before(async function () { - await usingPlaygrounds(async (helper, privateKeyWrapper) => { - if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); - alice = privateKeyWrapper('//Alice'); - palletAdmin = privateKeyWrapper('//Charlie'); // TODO use custom address - await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address}))); - nominal = helper.balance.getOneTokenNominal(); - await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal); - await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal); - if (!promotionStartBlock) { - promotionStartBlock = (await helper.api!.query.parachainSystem.lastRelayChainBlockNumber()).toNumber(); - } - await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.startAppPromotion(promotionStartBlock!))); - accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests - }); -}); - -after(async function () { - await usingPlaygrounds(async (helper) => { +describe('app-promotions.stake extrinsic', () => { + before(async function () { + await usingPlaygrounds(async (helper, privateKeyWrapper) => { + if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); + alice = privateKeyWrapper('//Alice'); + palletAdmin = privateKeyWrapper('//Charlie'); // TODO use custom address + await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); + nominal = helper.balance.getOneTokenNominal(); + await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal); + await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal); + accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests + }); }); -}); -describe('app-promotions.stake extrinsic', () => { it('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async () => { await usingPlaygrounds(async (helper) => { const [staker, recepient] = [accounts.pop()!, accounts.pop()!]; @@ -264,11 +255,11 @@ describe('Admin adress', () => { await usingPlaygrounds(async (helper) => { const nonAdmin = accounts.pop()!; // nonAdmin can not set admin not from himself nor as a sudo - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.eventually.rejected; - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.eventually.rejected; + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.eventually.rejected; + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.eventually.rejected; // Alice can - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled; }); }); @@ -279,12 +270,12 @@ describe('Admin adress', () => { const account = accounts.pop()!; const ethAccount = helper.address.substrateToEth(account.address); // Alice sets Ethereum address as a sudo. Then Substrate address back... - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Ethereum: ethAccount})))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled; // ...It doesn't break anything; const collection = await helper.nft.mintCollection(account, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(account, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(account, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; }); }); @@ -293,11 +284,11 @@ describe('Admin adress', () => { const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(oldAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(oldAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; - await expect(helper.signTransaction(newAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(newAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; }); }); }); @@ -305,7 +296,7 @@ describe('Admin adress', () => { describe('App-promotion collection sponsoring', () => { before(async function () { await usingPlaygrounds(async (helper) => { - const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address})); + const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})); await helper.signTransaction(alice, tx); }); }); @@ -315,7 +306,7 @@ describe('App-promotion collection sponsoring', () => { const [collectionOwner, tokenSender, receiver] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'Name', description: 'Description', tokenPrefix: 'Prefix', limits: {sponsorTransferTimeout: 0}}); const token = await collection.mintToken(collectionOwner, {Substrate: tokenSender.address}); - await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId)); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId)); const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress); await token.transfer(tokenSender, {Substrate: receiver.address}); @@ -334,7 +325,7 @@ describe('App-promotion collection sponsoring', () => { const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; expect((await collection.getData())?.raw.sponsorship).to.equal('Disabled'); }); }); @@ -345,19 +336,19 @@ describe('App-promotion collection sponsoring', () => { // Can set sponsoring for collection without sponsor const collectionWithoutSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'No-sponsor', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.eventually.fulfilled; expect((await collectionWithoutSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); // Can set sponsoring for collection with unconfirmed sponsor const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.eventually.fulfilled; expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); // Can set sponsoring for collection with confirmed sponsor const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.eventually.fulfilled; expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); }); }); @@ -368,7 +359,7 @@ describe('App-promotion collection sponsoring', () => { const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); const collectionId = collection.collectionId; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; // Collection limits still can be changed by the owner expect(await collection.setLimits(collectionOwner, {sponsorTransferTimeout: 0})).to.be.true; @@ -386,7 +377,7 @@ describe('App-promotion collection sponsoring', () => { const limits = {ownerCanDestroy: true, ownerCanTransfer: true, sponsorTransferTimeout: 0}; const collectionWithLimits = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.eventually.fulfilled; expect((await collectionWithLimits.getData())?.raw.limits).to.be.deep.contain(limits); }); }); @@ -396,12 +387,12 @@ describe('App-promotion collection sponsoring', () => { const collectionOwner = accounts.pop()!; // collection has never existed - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(999999999))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(999999999))).to.be.eventually.rejected; // collection has been burned const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await collection.burn(collectionOwner); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; }); }); }); @@ -412,9 +403,9 @@ describe('app-promotion stopSponsoringCollection', () => { const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); }); }); @@ -425,8 +416,8 @@ describe('app-promotion stopSponsoringCollection', () => { const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits: {sponsorTransferTimeout: 0}}); const token = await collection.mintToken(collectionOwner, {Substrate: collectionOwner.address}); - await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId)); - await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsoringCollection(collection.collectionId)); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId)); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId)); expect((await collection.getData())?.raw.sponsorship).to.be.equal('Disabled'); @@ -444,7 +435,7 @@ describe('app-promotion stopSponsoringCollection', () => { const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address}); await collection.confirmSponsorship(collectionOwner); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: collectionOwner.address}); }); @@ -456,8 +447,8 @@ describe('app-promotion stopSponsoringCollection', () => { const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await collection.burn(collectionOwner); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsoringCollection(999999999))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(999999999))).to.be.eventually.rejected; }); }); }); @@ -469,7 +460,7 @@ describe('app-promotion contract sponsoring', () => { const flipper = await deployFlipper(web3, contractOwner); const contractMethods = contractHelpers(web3, contractOwner); - await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address)); + await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address)); expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true; expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); @@ -497,7 +488,7 @@ describe('app-promotion contract sponsoring', () => { }); // set promotion sponsoring - await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address)); + await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address)); // new sponsor is pallet address expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true; @@ -517,7 +508,7 @@ describe('app-promotion contract sponsoring', () => { const contractMethods = contractHelpers(web3, contractOwner); // contract sponsored by pallet - await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address)); + await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address)); // owner sets self sponsoring await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; @@ -542,7 +533,7 @@ describe('app-promotion contract sponsoring', () => { await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; // nonAdmin calls sponsorConract - await expect(helper.signTransaction(nonAdmin, api.tx.promotion.sponsorConract(flipper.options.address))).to.be.rejected; + await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address))).to.be.rejected; // contract still self-sponsored expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ @@ -569,7 +560,7 @@ describe('app-promotion contract sponsoring', () => { await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); await transferBalanceToEth(api, alice, flipper.options.address, 1000n); - await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address)); + await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address)); await flipper.methods.flip().send({from: caller}); expect(await flipper.methods.getValue().call()).to.be.true; @@ -591,8 +582,8 @@ describe('app-promotion stopSponsoringContract', () => { await transferBalanceToEth(api, alice, flipper.options.address); const contractHelper = contractHelpers(web3, contractOwner); await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); - await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address)); - await helper.signTransaction(palletAdmin, api.tx.promotion.stopSponsoringContract(flipper.options.address)); + await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address)); + await helper.signTransaction(palletAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address)); expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.false; expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); @@ -618,8 +609,8 @@ describe('app-promotion stopSponsoringContract', () => { const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); const flipper = await deployFlipper(web3, contractOwner); - await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address)); - await expect(helper.signTransaction(nonAdmin, api.tx.promotion.stopSponsoringContract(flipper.options.address))).to.be.rejected; + await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address)); + await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address))).to.be.rejected; }); }); @@ -631,7 +622,7 @@ describe('app-promotion stopSponsoringContract', () => { const contractHelper = contractHelpers(web3, contractOwner); await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; - await expect(helper.signTransaction(nonAdmin, api.tx.promotion.stopSponsoringContract(flipper.options.address))).to.be.rejected; + await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address))).to.be.rejected; }); }); }); @@ -640,7 +631,7 @@ describe('app-promotion rewards', () => { it('can not be called by non admin', async () => { await usingPlaygrounds(async (helper) => { const nonAdmin = accounts.pop()!; - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.payoutStakers(100))).to.be.rejected; + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.payoutStakers(100))).to.be.rejected; }); }); @@ -652,7 +643,7 @@ describe('app-promotion rewards', () => { await helper.staking.stake(staker, 100n * nominal); await helper.staking.stake(staker, 200n * nominal); await waitForRelayBlock(helper.api!, 30); - await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(100)); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); const totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); expect(totalStakedPerBlock).to.be.deep.equal([calculateIncome(100n * nominal, 10n), calculateIncome(200n * nominal, 10n)]); @@ -668,7 +659,7 @@ describe('app-promotion rewards', () => { await helper.staking.stake(staker, 200n * nominal); await waitForRelayBlock(helper.api!, 55); - await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(100)); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); const stakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); expect(stakedPerBlock[0][1]).to.be.equal(calculateIncome(100n * nominal, 10n, 2)); expect(stakedPerBlock[1][1]).to.be.equal(calculateIncome(200n * nominal, 10n, 2)); @@ -707,12 +698,12 @@ describe('app-promotion rewards', () => { await helper.staking.stake(staker, 300n * nominal); await waitForRelayBlock(helper.api!, 34); - await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(100)); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); let totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n), calculateIncome(200n * nominal, 10n), calculateIncome(300n * nominal, 10n)]); await waitForRelayBlock(helper.api!, 20); - await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(100)); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n, 2), calculateIncome(200n * nominal, 10n, 2), calculateIncome(300n * nominal, 10n, 2)]); }); diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index d4441be26c..6ef1317cc2 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -15,6 +15,30 @@ export type __AugmentedConst = AugmentedConst declare module '@polkadot/api-base/types/consts' { interface AugmentedConsts { + appPromotion: { + /** + * In chain blocks. + **/ + day: u32 & AugmentedConst; + intervalIncome: Perbill & AugmentedConst; + nominal: u128 & AugmentedConst; + /** + * The app's pallet id, used for deriving its sovereign account ID. + **/ + palletId: FrameSupportPalletId & AugmentedConst; + /** + * In relay blocks. + **/ + pendingInterval: u32 & AugmentedConst; + /** + * In relay blocks. + **/ + recalculationInterval: u32 & AugmentedConst; + /** + * Generic const + **/ + [key: string]: Codec; + }; balances: { /** * The minimum amount required to keep an account open. @@ -66,30 +90,6 @@ declare module '@polkadot/api-base/types/consts' { **/ [key: string]: Codec; }; - promotion: { - /** - * In chain blocks. - **/ - day: u32 & AugmentedConst; - intervalIncome: Perbill & AugmentedConst; - nominal: u128 & AugmentedConst; - /** - * The app's pallet id, used for deriving its sovereign account ID. - **/ - palletId: FrameSupportPalletId & AugmentedConst; - /** - * In relay blocks. - **/ - pendingInterval: u32 & AugmentedConst; - /** - * In relay blocks. - **/ - recalculationInterval: u32 & AugmentedConst; - /** - * Generic const - **/ - [key: string]: Codec; - }; scheduler: { /** * The maximum weight that may be scheduled per block for any dispatchables of less diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index b6b3d5faec..366675d9ca 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -11,6 +11,29 @@ export type __AugmentedError = AugmentedError declare module '@polkadot/api-base/types/errors' { interface AugmentedErrors { + appPromotion: { + /** + * Error due to action requiring admin to be set + **/ + AdminNotSet: AugmentedError; + /** + * An error related to the fact that an invalid argument was passed to perform an action + **/ + InvalidArgument: AugmentedError; + /** + * No permission to perform an action + **/ + NoPermission: AugmentedError; + /** + * Insufficient funds to perform an action + **/ + NotSufficientFounds: AugmentedError; + PendingForBlockOverflow: AugmentedError; + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; balances: { /** * Beneficiary account must pre-exist @@ -435,28 +458,6 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; - promotion: { - /** - * Error due to action requiring admin to be set - **/ - AdminNotSet: AugmentedError; - /** - * An error related to the fact that an invalid argument was passed to perform an action - **/ - InvalidArgument: AugmentedError; - /** - * No permission to perform an action - **/ - NoPermission: AugmentedError; - /** - * Insufficient funds to perform an action - **/ - NotSufficientFounds: AugmentedError; - /** - * Generic error - **/ - [key: string]: AugmentedError; - }; refungible: { /** * Not Refungible item data used to mint in Refungible collection. diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index 4172a0189e..765b8d68cc 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -15,6 +15,13 @@ export type __AugmentedEvent = AugmentedEvent declare module '@polkadot/api-base/types/events' { interface AugmentedEvents { + appPromotion: { + StakingRecalculation: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; balances: { /** * A balance was set by root. @@ -360,13 +367,6 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; - promotion: { - StakingRecalculation: AugmentedEvent; - /** - * Generic event - **/ - [key: string]: AugmentedEvent; - }; rmrkCore: { CollectionCreated: AugmentedEvent; CollectionDestroyed: AugmentedEvent; diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 82ada23e9b..b1b40a3c9b 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -17,6 +17,35 @@ export type __QueryableStorageEntry = QueryableStorage declare module '@polkadot/api-base/types/storage' { interface AugmentedQueries { + appPromotion: { + admin: AugmentedQuery Observable>, []> & QueryableStorageEntry; + /** + * Stores hash a record for which the last revenue recalculation was performed. + * If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers. + **/ + nextCalculatedRecord: AugmentedQuery Observable>>, []> & QueryableStorageEntry; + /** + * Amount of tokens pending unstake per user per block. + **/ + pendingUnstake: AugmentedQuery Observable>>, [u32]> & QueryableStorageEntry; + /** + * Amount of tokens staked by account in the blocknumber. + **/ + staked: AugmentedQuery Observable>, [AccountId32, u32]> & QueryableStorageEntry; + /** + * Amount of stakes for an Account + **/ + stakesPerAccount: AugmentedQuery Observable, [AccountId32]> & QueryableStorageEntry; + /** + * A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`. + **/ + startBlock: AugmentedQuery Observable, []> & QueryableStorageEntry; + totalStaked: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; balances: { /** * The Balances pallet example of storing the balance of an account. @@ -510,39 +539,6 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; - promotion: { - admin: AugmentedQuery Observable>, []> & QueryableStorageEntry; - /** - * Stores hash a record for which the last revenue recalculation was performed. - * If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers. - **/ - nextCalculatedRecord: AugmentedQuery Observable>>, []> & QueryableStorageEntry; - /** - * Next target block when interest is recalculated - **/ - nextInterestBlock: AugmentedQuery Observable, []> & QueryableStorageEntry; - /** - * Amount of tokens pending unstake per user per block. - **/ - pendingUnstake: AugmentedQuery Observable, [AccountId32, u32]> & QueryableStorageEntry; - /** - * Amount of tokens staked by account in the blocknumber. - **/ - staked: AugmentedQuery Observable>, [AccountId32, u32]> & QueryableStorageEntry; - /** - * Amount of stakes for an Account - **/ - stakesPerAccount: AugmentedQuery Observable, [AccountId32]> & QueryableStorageEntry; - /** - * A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`. - **/ - startBlock: AugmentedQuery Observable, []> & QueryableStorageEntry; - totalStaked: AugmentedQuery Observable, []> & QueryableStorageEntry; - /** - * Generic query - **/ - [key: string]: QueryableStorageEntry; - }; randomnessCollectiveFlip: { /** * Series of block headers from the last 81 blocks that acts as random seed material. This diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index af54c7dc08..ba086dc0a5 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -17,6 +17,20 @@ export type __SubmittableExtrinsicFunction = Submittab declare module '@polkadot/api-base/types/submittable' { interface AugmentedSubmittables { + appPromotion: { + payoutStakers: AugmentedSubmittable<(stakersNumber: Option | null | Uint8Array | u8 | AnyNumber) => SubmittableExtrinsic, [Option]>; + setAdminAddress: AugmentedSubmittable<(admin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic, [PalletEvmAccountBasicCrossAccountIdRepr]>; + sponsorCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; + sponsorConract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; + stake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; + stopSponsoringCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; + stopSponsoringContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; + unstake: AugmentedSubmittable<() => SubmittableExtrinsic, []>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; balances: { /** * Exactly as `transfer`, except the origin must be root and the source account may be @@ -375,22 +389,6 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; - promotion: { - payoutStakers: AugmentedSubmittable<(stakersNumber: Option | null | Uint8Array | u8 | AnyNumber) => SubmittableExtrinsic, [Option]>; - setAdminAddress: AugmentedSubmittable<(admin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic, [PalletEvmAccountBasicCrossAccountIdRepr]>; - sponsorCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; - sponsorConract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; - stake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; - startAppPromotion: AugmentedSubmittable<(promotionStartRelayBlock: Option | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic, [Option]>; - stopAppPromotion: AugmentedSubmittable<() => SubmittableExtrinsic, []>; - stopSponsoringCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; - stopSponsoringContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; - unstake: AugmentedSubmittable<() => SubmittableExtrinsic, []>; - /** - * Generic tx - **/ - [key: string]: SubmittableExtrinsicFunction; - }; rmrkCore: { /** * Accept an NFT sent from another account to self or an owned NFT. diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 2b5462a0e3..56a8c1d3d2 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -812,11 +812,6 @@ export interface PalletAppPromotionCall extends Enum { readonly asSetAdminAddress: { readonly admin: PalletEvmAccountBasicCrossAccountIdRepr; } & Struct; - readonly isStartAppPromotion: boolean; - readonly asStartAppPromotion: { - readonly promotionStartRelayBlock: Option; - } & Struct; - readonly isStopAppPromotion: boolean; readonly isStake: boolean; readonly asStake: { readonly amount: u128; @@ -842,7 +837,7 @@ export interface PalletAppPromotionCall extends Enum { readonly asPayoutStakers: { readonly stakersNumber: Option; } & Struct; - readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'StopAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorConract' | 'StopSponsoringContract' | 'PayoutStakers'; + readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorConract' | 'StopSponsoringContract' | 'PayoutStakers'; } /** @name PalletAppPromotionError */ @@ -850,8 +845,9 @@ export interface PalletAppPromotionError extends Enum { readonly isAdminNotSet: boolean; readonly isNoPermission: boolean; readonly isNotSufficientFounds: boolean; + readonly isPendingForBlockOverflow: boolean; readonly isInvalidArgument: boolean; - readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'InvalidArgument'; + readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'PendingForBlockOverflow' | 'InvalidArgument'; } /** @name PalletAppPromotionEvent */ diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index f4ca3d987f..35c9034af3 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -2460,10 +2460,6 @@ export default { set_admin_address: { admin: 'PalletEvmAccountBasicCrossAccountIdRepr', }, - start_app_promotion: { - promotionStartRelayBlock: 'Option', - }, - stop_app_promotion: 'Null', stake: { amount: 'u128', }, @@ -3103,19 +3099,19 @@ export default { _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] }, /** - * Lookup412: pallet_app_promotion::pallet::Error + * Lookup415: pallet_app_promotion::pallet::Error **/ PalletAppPromotionError: { - _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFounds', 'InvalidArgument'] + _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFounds', 'PendingForBlockOverflow', 'InvalidArgument'] }, /** - * Lookup415: pallet_evm::pallet::Error + * Lookup418: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup418: fp_rpc::TransactionStatus + * Lookup421: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -3127,11 +3123,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup420: ethbloom::Bloom + * Lookup423: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup422: ethereum::receipt::ReceiptV3 + * Lookup425: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -3141,7 +3137,7 @@ export default { } }, /** - * Lookup423: ethereum::receipt::EIP658ReceiptData + * Lookup426: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -3150,7 +3146,7 @@ export default { logs: 'Vec' }, /** - * Lookup424: ethereum::block::Block + * Lookup427: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -3158,7 +3154,7 @@ export default { ommers: 'Vec' }, /** - * Lookup425: ethereum::header::Header + * Lookup428: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -3178,23 +3174,23 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup426: ethereum_types::hash::H64 + * Lookup429: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup431: pallet_ethereum::pallet::Error + * Lookup434: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup432: pallet_evm_coder_substrate::pallet::Error + * Lookup435: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup433: up_data_structs::SponsorshipState> + * Lookup436: up_data_structs::SponsorshipState> **/ UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: { _enum: { @@ -3204,25 +3200,25 @@ export default { } }, /** - * Lookup434: pallet_evm_contract_helpers::SponsoringModeT + * Lookup437: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup436: pallet_evm_contract_helpers::pallet::Error + * Lookup439: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission', 'NoPendingSponsor'] }, /** - * Lookup437: pallet_evm_migration::pallet::Error + * Lookup440: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup439: sp_runtime::MultiSignature + * Lookup442: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3232,43 +3228,43 @@ export default { } }, /** - * Lookup440: sp_core::ed25519::Signature + * Lookup443: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup442: sp_core::sr25519::Signature + * Lookup445: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup443: sp_core::ecdsa::Signature + * Lookup446: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup446: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup449: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup447: frame_system::extensions::check_genesis::CheckGenesis + * Lookup450: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup450: frame_system::extensions::check_nonce::CheckNonce + * Lookup453: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup451: frame_system::extensions::check_weight::CheckWeight + * Lookup454: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup452: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup455: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup453: opal_runtime::Runtime + * Lookup456: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup454: pallet_ethereum::FakeTransactionFinalizer + * Lookup457: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 2356a482f0..0098707f61 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -2665,11 +2665,6 @@ declare module '@polkadot/types/lookup' { readonly asSetAdminAddress: { readonly admin: PalletEvmAccountBasicCrossAccountIdRepr; } & Struct; - readonly isStartAppPromotion: boolean; - readonly asStartAppPromotion: { - readonly promotionStartRelayBlock: Option; - } & Struct; - readonly isStopAppPromotion: boolean; readonly isStake: boolean; readonly asStake: { readonly amount: u128; @@ -2695,7 +2690,7 @@ declare module '@polkadot/types/lookup' { readonly asPayoutStakers: { readonly stakersNumber: Option; } & Struct; - readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'StopAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorConract' | 'StopSponsoringContract' | 'PayoutStakers'; + readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorConract' | 'StopSponsoringContract' | 'PayoutStakers'; } /** @name PalletEvmCall (306) */ @@ -3291,16 +3286,17 @@ declare module '@polkadot/types/lookup' { readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; } - /** @name PalletAppPromotionError (412) */ + /** @name PalletAppPromotionError (415) */ interface PalletAppPromotionError extends Enum { readonly isAdminNotSet: boolean; readonly isNoPermission: boolean; readonly isNotSufficientFounds: boolean; + readonly isPendingForBlockOverflow: boolean; readonly isInvalidArgument: boolean; - readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'InvalidArgument'; + readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'PendingForBlockOverflow' | 'InvalidArgument'; } - /** @name PalletEvmError (415) */ + /** @name PalletEvmError (418) */ interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; @@ -3311,7 +3307,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (418) */ + /** @name FpRpcTransactionStatus (421) */ interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; @@ -3322,10 +3318,10 @@ declare module '@polkadot/types/lookup' { readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (420) */ + /** @name EthbloomBloom (423) */ interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (422) */ + /** @name EthereumReceiptReceiptV3 (425) */ interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; @@ -3336,7 +3332,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (423) */ + /** @name EthereumReceiptEip658ReceiptData (426) */ interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; @@ -3344,14 +3340,14 @@ declare module '@polkadot/types/lookup' { readonly logs: Vec; } - /** @name EthereumBlock (424) */ + /** @name EthereumBlock (427) */ interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (425) */ + /** @name EthereumHeader (428) */ interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; @@ -3370,24 +3366,24 @@ declare module '@polkadot/types/lookup' { readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (426) */ + /** @name EthereumTypesHashH64 (429) */ interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (431) */ + /** @name PalletEthereumError (434) */ interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (432) */ + /** @name PalletEvmCoderSubstrateError (435) */ interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (433) */ + /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (436) */ interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3397,7 +3393,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name PalletEvmContractHelpersSponsoringModeT (434) */ + /** @name PalletEvmContractHelpersSponsoringModeT (437) */ interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; @@ -3405,21 +3401,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (436) */ + /** @name PalletEvmContractHelpersError (439) */ interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly isNoPendingSponsor: boolean; readonly type: 'NoPermission' | 'NoPendingSponsor'; } - /** @name PalletEvmMigrationError (437) */ + /** @name PalletEvmMigrationError (440) */ interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (439) */ + /** @name SpRuntimeMultiSignature (442) */ interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; @@ -3430,34 +3426,34 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (440) */ + /** @name SpCoreEd25519Signature (443) */ interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (442) */ + /** @name SpCoreSr25519Signature (445) */ interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (443) */ + /** @name SpCoreEcdsaSignature (446) */ interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (446) */ + /** @name FrameSystemExtensionsCheckSpecVersion (449) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (447) */ + /** @name FrameSystemExtensionsCheckGenesis (450) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (450) */ + /** @name FrameSystemExtensionsCheckNonce (453) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (451) */ + /** @name FrameSystemExtensionsCheckWeight (454) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (452) */ + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (455) */ interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (453) */ + /** @name OpalRuntimeRuntime (456) */ type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (454) */ + /** @name PalletEthereumFakeTransactionFinalizer (457) */ type PalletEthereumFakeTransactionFinalizer = Null; } // declare module diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index fde984045e..0be293c45f 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -48,7 +48,7 @@ export enum Pallets { Fungible = 'fungible', NFT = 'nonfungible', Scheduler = 'scheduler', - AppPromotion = 'promotion', + AppPromotion = 'apppromotion', } export async function isUnique(): Promise { diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 73f11a3984..3dcbb9352e 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -2008,7 +2008,7 @@ class StakingGroup extends HelperGroup { if(typeof label === 'undefined') label = `${signer.address} amount: ${amountToStake}`; const stakeResult = await this.helper.executeExtrinsic( signer, - 'api.tx.promotion.stake', [amountToStake], + 'api.tx.appPromotion.stake', [amountToStake], true, `stake failed for ${label}`, ); // TODO extract info from stakeResult @@ -2026,7 +2026,7 @@ class StakingGroup extends HelperGroup { if(typeof label === 'undefined') label = `${signer.address}`; const unstakeResult = await this.helper.executeExtrinsic( signer, - 'api.tx.promotion.unstake', [], + 'api.tx.appPromotion.unstake', [], true, `unstake failed for ${label}`, ); // TODO extract info from unstakeResult From 65cd3570f6ebcb9627f37dda3dc0f97207032d7c Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Fri, 2 Sep 2022 14:11:59 +0000 Subject: [PATCH 0693/1274] doc: Add doc to create separate rpc. --- doc/separate_rpc.md | 123 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 doc/separate_rpc.md diff --git a/doc/separate_rpc.md b/doc/separate_rpc.md new file mode 100644 index 0000000000..58d1066721 --- /dev/null +++ b/doc/separate_rpc.md @@ -0,0 +1,123 @@ +1. Create, in the `primitives` folder, a crate with a trait for RPC generation. + ```rust + sp_api::decl_runtime_apis! { + #[api_version(2)] + pub trait ModuleNameApi + where + CrossAccountId: pallet_evm::account::CrossAccountId, + { + fn method_name(user: Option) -> Result; + } + } + ``` + +2. client/rpc/src/lib.rs + * Add a trait with the required methods. Mark it with `#[rpc(server)]` and `#[async_trait]` directives. + ```rust + #[rpc(server)] + #[async_trait] + pub trait ModuleNameApi { + #[method(name = "moduleName_methodName")] + fn method_name(&self, user: Option, at: Option) + -> Result; + } + ``` + * Don't forget to write the correct method identifier in the form `moduleName_methodName`. + * Add a structure for which the server API interface will be implemented. + ```rust + define_struct_for_server_api!(ModuleName); + ``` + * Define a macro to be used in the implementation of the server API interface. + ```rust + macro_rules! module_api { + () => { + dyn ModuleNameRuntimeApi + }; + } + ``` + * Implement a server API interface. + ```rust + impl + ModuleNameApiServer<::Hash, CrossAccountId> for ModuleName + where + Block: BlockT, + C: 'static + ProvideRuntimeApi + HeaderBackend, + C::Api: AppPromotionRuntimeApi, + CrossAccountId: pallet_evm::account::CrossAccountId, + { + pass_method!(method_name(user: Option) -> String => |v| v.to_string(), app_promotion_api); + } + ``` + +3. runtime/common/runtime_apis.rs + * Implement the `ModuleNameApi` interface for `Runtime`. Optionally, you can mark a feature flag to disable the functionality. + ```rust + impl MethodApi for Runtime { + fn method_name(user: Option) -> Result { + #[cfg(not(feature = "module"))] + return unsupported!(); + + #[cfg(feature = "module")] + return Ok(0); + } + } + ``` + +4. node/cli/src/service.rs + * Set the `MethodApi` bound in the `start_node_impl`, `start_node`, `start_dev_node` methods. + +5. node/rpc/src/lib.rs + * Add `MethodApi` bound to `create_full` method. + * Enable RPC in the `create_full` method by adding `io.merge(ModuleName::new(client.clone()).into_rpc())?;` + +6. Add a new crate (see point 1) into dependencies. + * client/rpc/Cargo.toml + * node/rpc/Cargo.toml + * runtime/opal/Cargo.toml + * runtime/quartz/Cargo.toml + * runtime/unique/Cargo.toml + +7. Create tests/src/interfaces/ModuleName/definitions.ts and describe the necessary methods in it. + ```ts + type RpcParam = { + name: string; + type: string; + isOptional?: true; + }; + + const CROSS_ACCOUNT_ID_TYPE = 'PalletEvmAccountBasicCrossAccountIdRepr'; + + const fun = (description: string, params: RpcParam[], type: string) => ({ + description, + params: [...params, atParam], + type, + }); + + export default { + types: {}, + rpc: { + methodName: fun( + 'Documentation for method', + [{name: 'user', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}], + 'u128', + ), + }, + }; + ``` + +8. Describe definitions from paragraph 7 in tests/src/interfaces/definitions.ts. + ```ts + export {default as ModuleName} from './module/definitions'; + ``` + +9. tests/src/substrate/substrate-api.ts + * Set the RPC interface in the `defaultApiOptions` function, add an entry in the `rpc` parameter + ```ts + module: defs.module.rpc, + ``` + +10. tests/src/util/playgrounds/unique.dev.ts + * Specify RPC interface in `connect` function, add entry in `rpc` parameter + ```ts + module: defs.module.rpc, + ``` \ No newline at end of file From 61a184132bb01ad386b2484415a38c3ce8bbb717 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Fri, 2 Sep 2022 17:59:39 +0300 Subject: [PATCH 0694/1274] Fix tests Moved up before hook tx.promotion -> tx.appPromotion --- tests/src/app-promotion.test.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index d9877c27aa..53fe7ec9d1 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -38,20 +38,20 @@ let nominal: bigint; const palletAddress = calculatePalleteAddress('appstake'); let accounts: IKeyringPair[] = []; -describe('app-promotions.stake extrinsic', () => { - before(async function () { - await usingPlaygrounds(async (helper, privateKeyWrapper) => { - if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); - alice = privateKeyWrapper('//Alice'); - palletAdmin = privateKeyWrapper('//Charlie'); // TODO use custom address - await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); - nominal = helper.balance.getOneTokenNominal(); - await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal); - await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal); - accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests - }); +before(async function () { + await usingPlaygrounds(async (helper, privateKeyWrapper) => { + if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); + alice = privateKeyWrapper('//Alice'); + palletAdmin = privateKeyWrapper('//Charlie'); // TODO use custom address + await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); + nominal = helper.balance.getOneTokenNominal(); + await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal); + await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal); + accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests }); +}); +describe('app-promotions.stake extrinsic', () => { it('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async () => { await usingPlaygrounds(async (helper) => { const [staker, recepient] = [accounts.pop()!, accounts.pop()!]; @@ -681,7 +681,7 @@ describe('app-promotion rewards', () => { // so he did not receive any rewards const totalBalanceBefore = await helper.balance.getSubstrate(staker.address); - await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(100)); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); const totalBalanceAfter = await helper.balance.getSubstrate(staker.address); expect(totalBalanceBefore).to.be.equal(totalBalanceAfter); From 2afc567658579b5c82d9fb87842ed8c12d944f8e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 2 Sep 2022 18:06:27 +0300 Subject: [PATCH 0695/1274] fix: check tasks for develop and master workflows --- .github/workflows/ci-develop.yml | 12 ++++-------- .github/workflows/ci-master.yml | 3 --- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index f4072c8c2c..a496514af9 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -12,27 +12,23 @@ concurrency: jobs: yarn-test-dev: - if: ${{ github.event.pull_request.draft == 'false' }} uses: ./.github/workflows/dev-build-tests_v2.yml unit-test: - if: ${{ github.event.pull_request.draft == 'false' }} uses: ./.github/workflows/unit-test_v2.yml - forkless: - if: ${{ contains( github.event.pull_request.labels.*.name, 'forkless') }} - uses: ./.github/workflows/forkless.yml - canary: if: ${{ contains( github.event.pull_request.labels.*.name, 'canary') }} uses: ./.github/workflows/canary.yml secrets: inherit # pass all secrets - xcm: if: ${{ contains( github.event.pull_request.labels.*.name, 'xcm') }} uses: ./.github/workflows/xcm.yml secrets: inherit # pass all secrets codestyle: - uses: ./.github/workflows/codestyle_v2.yml \ No newline at end of file + uses: ./.github/workflows/codestyle_v2.yml + + yarn_eslint: + uses: ./.github/workflows/test_codestyle_v2.yml diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index 160e721369..6ef006e78d 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -12,11 +12,9 @@ concurrency: jobs: unit-test: - if: ${{ github.event.pull_request.draft != 'true' }} uses: ./.github/workflows/unit-test_v2.yml node-only-update: - if: ${{ github.event.pull_request.draft == 'false' }} uses: ./.github/workflows/node-only-update_v2.yml forkless: @@ -34,5 +32,4 @@ jobs: secrets: inherit # pass all secrets codestyle: - if: ${{ github.event.pull_request.draft == 'false' }} uses: ./.github/workflows/codestyle_v2.yml \ No newline at end of file From 97044329ec08b5693b48ffc43edf5b61d870a55d Mon Sep 17 00:00:00 2001 From: PraetorP Date: Fri, 2 Sep 2022 22:11:00 +0700 Subject: [PATCH 0696/1274] fix logic payout --- client/rpc/src/lib.rs | 2 +- pallets/app-promotion/src/lib.rs | 112 ++++++++++++++---- .../common/config/pallets/app_promotion.rs | 2 +- 3 files changed, 90 insertions(+), 26 deletions(-) diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index 4be2cc72e0..0aafe7e23d 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -424,7 +424,7 @@ macro_rules! define_struct_for_server_api { client: Arc, _marker: std::marker::PhantomData

, } - + impl $name { pub fn new(client: Arc) -> Self { Self { diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index a1d8e3ac81..acc96651b1 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -41,6 +41,7 @@ use sp_std::{ vec, iter::Sum, borrow::ToOwned, + cell::RefCell, }; use sp_core::H160; use codec::EncodeLike; @@ -474,58 +475,121 @@ pub mod pallet { let next_recalc_block = current_recalc_block + T::RecalculationInterval::get(); let mut storage_iterator = Self::get_next_calculated_key() - .map_or(Staked::::iter(), |key| { - Staked::::iter_from(key) - }); + .map_or(Staked::::iter(), |key| Staked::::iter_from(key)); NextCalculatedRecord::::set(None); + // { + // let mut stakers_number = stakers_number.unwrap_or(20); + // let mut last_id = admin_id; + // let mut income_acc = BalanceOf::::default(); + // let mut amount_acc = BalanceOf::::default(); + + // while let Some(( + // (current_id, staked_block), + // (amount, next_recalc_block_for_stake), + // )) = storage_iterator.next() + // { + // if last_id != current_id { + // if income_acc != BalanceOf::::default() { + // >::transfer( + // &T::TreasuryAccountId::get(), + // &last_id, + // income_acc, + // ExistenceRequirement::KeepAlive, + // ) + // .and_then(|_| Self::add_lock_balance(&last_id, income_acc))?; + + // Self::deposit_event(Event::StakingRecalculation( + // last_id, amount, income_acc, + // )); + // } + + // if stakers_number == 0 { + // NextCalculatedRecord::::set(Some((current_id, staked_block))); + // break; + // } + // stakers_number -= 1; + // income_acc = BalanceOf::::default(); + // last_id = current_id; + // }; + // if current_recalc_block >= next_recalc_block_for_stake { + // Self::recalculate_and_insert_stake( + // &last_id, + // staked_block, + // next_recalc_block, + // amount, + // ((current_recalc_block - next_recalc_block_for_stake) + // / T::RecalculationInterval::get()) + // .into() + 1, + // &mut income_acc, + // ); + // } + // } + // } + { let mut stakers_number = stakers_number.unwrap_or(20); - let mut last_id = admin_id; - let mut income_acc = BalanceOf::::default(); - - while let Some(((current_id, staked_block), (amount, next_recalc_block_for_stake))) = - storage_iterator.next() - { - if last_id != current_id { - if income_acc != BalanceOf::::default() { + let last_id = RefCell::new(None); + let income_acc = RefCell::new(BalanceOf::::default()); + let amount_acc = RefCell::new(BalanceOf::::default()); + + let flush_stake = || -> DispatchResult { + if let Some(last_id) = &*last_id.borrow() { + if !income_acc.borrow().is_zero() { >::transfer( &T::TreasuryAccountId::get(), - &last_id, - income_acc, + last_id, + *income_acc.borrow(), ExistenceRequirement::KeepAlive, ) - .and_then(|_| Self::add_lock_balance(&last_id, income_acc))?; + .and_then(|_| Self::add_lock_balance(last_id, *income_acc.borrow()))?; Self::deposit_event(Event::StakingRecalculation( - last_id, amount, income_acc, + last_id.clone(), + *amount_acc.borrow(), + *income_acc.borrow(), )); } - if stakers_number == 0 { - NextCalculatedRecord::::set(Some((current_id, staked_block))); - break; - } - stakers_number -= 1; - income_acc = BalanceOf::::default(); - last_id = current_id; + *income_acc.borrow_mut() = BalanceOf::::default(); + *amount_acc.borrow_mut() = BalanceOf::::default(); + } + Ok(()) + }; + + while let Some(( + (current_id, staked_block), + (amount, next_recalc_block_for_stake), + )) = storage_iterator.next() + { + if stakers_number == 0 { + NextCalculatedRecord::::set(Some((current_id, staked_block))); + break; + } + stakers_number -= 1; + if last_id.borrow().as_ref() != Some(¤t_id) { + flush_stake()?; }; + *last_id.borrow_mut() = Some(current_id.clone()); if current_recalc_block >= next_recalc_block_for_stake { + *amount_acc.borrow_mut() += amount; Self::recalculate_and_insert_stake( - &last_id, + ¤t_id, staked_block, next_recalc_block, amount, ((current_recalc_block - next_recalc_block_for_stake) / T::RecalculationInterval::get()) .into() + 1, - &mut income_acc, + &mut *income_acc.borrow_mut(), ); } } + flush_stake()?; } + Ok(()) } } diff --git a/runtime/common/config/pallets/app_promotion.rs b/runtime/common/config/pallets/app_promotion.rs index d551967b11..6155a24066 100644 --- a/runtime/common/config/pallets/app_promotion.rs +++ b/runtime/common/config/pallets/app_promotion.rs @@ -30,7 +30,7 @@ use up_common::{ parameter_types! { pub const AppPromotionId: PalletId = PalletId(*b"appstake"); pub const RecalculationInterval: BlockNumber = 20; - pub const PendingInterval: BlockNumber = 20; + pub const PendingInterval: BlockNumber = 10; pub const Nominal: Balance = UNIQUE; pub const Day: BlockNumber = DAYS; pub IntervalIncome: Perbill = Perbill::from_rational(RecalculationInterval::get(), RELAY_DAYS) * Perbill::from_rational(5u32, 10_000); From f132924443e8263b5781524799fffa8b79f663d5 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Sat, 3 Sep 2022 09:55:04 +0700 Subject: [PATCH 0697/1274] add right versions for parachains --- .env | 13 ++++++++++--- .github/workflows/xcm-testnet-build.yml | 20 ++++++++++---------- .github/workflows/xcm-tests_v2.yml | 1 + 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.env b/.env index 612d31aa0a..506d0da420 100644 --- a/.env +++ b/.env @@ -15,6 +15,13 @@ UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443 POLKADOT_LAUNCH_BRANCH=feature/rewrite-chain-id-in-spec -ACALA_BUILD_BRANCH=2.9.0 -MOONBEAM_BUILD_BRANCH=v0.25.0 -CUMULUS_BUILD_BRANCH=release-v0.9.230 +KARURA_BUILD_BRANCH=2.9.1 +ACALA_BUILD_BRANCH=2.9.2 + +MOONRIVER_BUILD_BRANCH=runtime-1701 +MOONBEAM_BUILD_BRANCH=runtime-1701 + +STATEMINE_BUILD_BRANCH=parachains-v9270 +STATEMINT_BUILD_BRANCH=release-parachains-v9230 +WESTMINT_BUILD_BRANCH=parachains-v9270 + diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 2dbf75175d..ae49f10970 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -18,7 +18,7 @@ jobs: name: Prepare execution matrix - runs-on: XL + runs-on: [XL] outputs: matrix: ${{ steps.create_matrix.outputs.matrix }} @@ -40,9 +40,9 @@ jobs: id: create_matrix with: matrix: | - network {opal}, runtime {opal}, features {opal-runtime} - network {quartz}, runtime {quartz}, features {quartz-runtime} - network {unique}, runtime {unique}, features {unique-runtime} + network {opal}, runtime {opal}, features {opal-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.WESTMINT_BUILD_BRANCH }}} + network {quartz}, runtime {quartz}, features {quartz-runtime}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONRIVER_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINE_BUILD_BRANCH }}} + network {unique}, runtime {unique}, features {unique-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINT_BUILD_BRANCH }}} xcm-build: @@ -89,9 +89,9 @@ jobs: FEATURE=${{ matrix.features }} RUNTIME=${{ matrix.runtime }} BRANCH=${{ github.head_ref }} - ACALA_BUILD_BRANCH=${{ env.ACALA_BUILD_BRANCH }} - MOONBEAM_BUILD_BRANCH=${{ env.MOONBEAM_BUILD_BRANCH }} - CUMULUS_BUILD_BRANCH=${{ env.CUMULUS_BUILD_BRANCH }} + ACALA_BUILD_BRANCH=${{ matrix.acala_version }} + MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }} + CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }} - name: Show build Dockerfile run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml @@ -114,13 +114,13 @@ jobs: password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - name: Pull acala docker image - run: docker pull uniquenetwork/builder-acala:${{ env.ACALA_BUILD_BRANCH }} + run: docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }} - name: Pull moonbeam docker image - run: docker pull uniquenetwork/builder-moonbeam:${{ env.MOONBEAM_BUILD_BRANCH }} + run: docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} - name: Pull cumulus docker image - run: docker pull uniquenetwork/builder-cumulus:${{ env.CUMULUS_BUILD_BRANCH }} + run: docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} - name: Pull polkadot docker image run: docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} diff --git a/.github/workflows/xcm-tests_v2.yml b/.github/workflows/xcm-tests_v2.yml index ba6ac00060..cb03f8eb19 100644 --- a/.github/workflows/xcm-tests_v2.yml +++ b/.github/workflows/xcm-tests_v2.yml @@ -146,6 +146,7 @@ jobs: run: | yarn install yarn add mochawesome + node scripts/readyness.js echo "Ready to start tests" NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW} From 4588bd211fe91c5fabd64738c3e1e9100f8cd37c Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Sat, 3 Sep 2022 22:43:06 +0700 Subject: [PATCH 0698/1274] setup port numbers for parachains in xcm tests --- tests/src/xcm/xcmOpal.test.ts | 2 +- tests/src/xcm/xcmTransferMoonbeam.test.ts | 2 +- tests/src/xcm/xcmTransferStatemine.test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/src/xcm/xcmOpal.test.ts b/tests/src/xcm/xcmOpal.test.ts index 35a1aa6091..7638723f5d 100644 --- a/tests/src/xcm/xcmOpal.test.ts +++ b/tests/src/xcm/xcmOpal.test.ts @@ -35,7 +35,7 @@ const UNIQUE_CHAIN = 2095; const RELAY_PORT = '9844'; const UNIQUE_PORT = '9944'; -const STATEMINE_PORT = '9946'; +const STATEMINE_PORT = '9948'; const STATEMINE_PALLET_INSTANCE = 50; const ASSET_ID = 100; const ASSET_METADATA_DECIMALS = 18; diff --git a/tests/src/xcm/xcmTransferMoonbeam.test.ts b/tests/src/xcm/xcmTransferMoonbeam.test.ts index 35b89b7812..e4d009e5a4 100644 --- a/tests/src/xcm/xcmTransferMoonbeam.test.ts +++ b/tests/src/xcm/xcmTransferMoonbeam.test.ts @@ -50,7 +50,7 @@ process.argv.forEach((val) => { }); const UNIQUE_PORT = '9944'; -const MOONBEAM_PORT = '9946'; +const MOONBEAM_PORT = '9947'; const TRANSFER_AMOUNT = 2000000000000000000000000n; describe('Integration test: Exchanging UNQ with Moonbeam', () => { diff --git a/tests/src/xcm/xcmTransferStatemine.test.ts b/tests/src/xcm/xcmTransferStatemine.test.ts index 59989a353d..6ba788d808 100644 --- a/tests/src/xcm/xcmTransferStatemine.test.ts +++ b/tests/src/xcm/xcmTransferStatemine.test.ts @@ -53,7 +53,7 @@ process.argv.forEach((val) => { const RELAY_PORT = '9844'; const UNIQUE_PORT = '9944'; -const STATEMINE_PORT = '9946'; +const STATEMINE_PORT = '9948'; const STATEMINE_PALLET_INSTANCE = 50; const ASSET_ID = 100; const ASSET_METADATA_DECIMALS = 18; From 8252400f6c73dfc3b0d1b140cd19bbf08888d04b Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Sun, 4 Sep 2022 02:02:48 +0700 Subject: [PATCH 0699/1274] disable readyness.js --- .github/workflows/xcm-tests_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xcm-tests_v2.yml b/.github/workflows/xcm-tests_v2.yml index cb03f8eb19..85690421aa 100644 --- a/.github/workflows/xcm-tests_v2.yml +++ b/.github/workflows/xcm-tests_v2.yml @@ -146,7 +146,7 @@ jobs: run: | yarn install yarn add mochawesome - node scripts/readyness.js + # node scripts/readyness.js echo "Ready to start tests" NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW} From c9f3344fa8b916ffa3ff795502f0c8fa782c0fbf Mon Sep 17 00:00:00 2001 From: Andrey Date: Sun, 4 Sep 2022 15:51:58 +0000 Subject: [PATCH 0700/1274] test: Initial eth playgrounds --- tests/package.json | 3 +- tests/src/eth/nesting/nest.test.ts | 399 ++++++++++--------- tests/src/eth/util/playgrounds/index.ts | 67 ++++ tests/src/eth/util/playgrounds/unique.dev.ts | 162 ++++++++ 4 files changed, 432 insertions(+), 199 deletions(-) create mode 100644 tests/src/eth/util/playgrounds/index.ts create mode 100644 tests/src/eth/util/playgrounds/unique.dev.ts diff --git a/tests/package.json b/tests/package.json index 804a2f9813..b8ded51d4b 100644 --- a/tests/package.json +++ b/tests/package.json @@ -79,7 +79,8 @@ "testBlockProduction": "mocha --timeout 9999999 -r ts-node/register ./**/block-production.test.ts", "testEnableDisableTransfers": "mocha --timeout 9999999 -r ts-node/register ./**/enableDisableTransfer.test.ts", "testLimits": "mocha --timeout 9999999 -r ts-node/register ./**/limits.test.ts", - "testEthCreateCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createCollection.test.ts", + "testEthCreateNFTCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createNFTCollection.test.ts", + "testEthCreateRFTCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createRFTCollection.test.ts", "testRFT": "mocha --timeout 9999999 -r ts-node/register ./**/refungible.test.ts", "testFT": "mocha --timeout 9999999 -r ts-node/register ./**/fungible.test.ts", "testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts", diff --git a/tests/src/eth/nesting/nest.test.ts b/tests/src/eth/nesting/nest.test.ts index b4d249ac17..62d31db507 100644 --- a/tests/src/eth/nesting/nest.test.ts +++ b/tests/src/eth/nesting/nest.test.ts @@ -1,217 +1,220 @@ -import {ApiPromise} from '@polkadot/api'; +import {IKeyringPair} from '@polkadot/types/types'; import {Contract} from 'web3-eth-contract'; -import {expect} from 'chai'; -import Web3 from 'web3'; -import {createEthAccountWithBalance, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, tokenIdToAddress} from '../../eth/util/helpers'; -import nonFungibleAbi from '../nonFungibleAbi.json'; + +import {itEth, EthUniqueHelper, usingEthPlaygrounds, expect} from '../util/playgrounds' const createNestingCollection = async ( - api: ApiPromise, - web3: Web3, + helper: EthUniqueHelper, owner: string, ): Promise<{ collectionId: number, collectionAddress: string, contract: Contract }> => { - const collectionHelper = evmCollectionHelpers(web3, owner); - - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress: collectionAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const contract = new web3.eth.Contract(nonFungibleAbi as any, collectionAddress, {from: owner, ...GAS_ARGS}); + const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await contract.methods.setCollectionNesting(true).send({from: owner}); return {collectionId, collectionAddress, contract}; }; -describe('Integration Test: EVM Nesting', () => { - itWeb3('NFT: allows an Owner to nest/unnest their token', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const {collectionId, contract} = await createNestingCollection(api, web3, owner); - - // Create a token to be nested - const targetNFTTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint( - owner, - targetNFTTokenId, - ).send({from: owner}); - - const targetNftTokenAddress = tokenIdToAddress(collectionId, targetNFTTokenId); - - // Create a nested token - const firstTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint( - targetNftTokenAddress, - firstTokenId, - ).send({from: owner}); - - expect(await contract.methods.ownerOf(firstTokenId).call()).to.be.equal(targetNftTokenAddress); - // Create a token to be nested and nest - const secondTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint( - owner, - secondTokenId, - ).send({from: owner}); +describe('EVM nesting tests group', () => { + let donor: IKeyringPair; - await contract.methods.transfer(targetNftTokenAddress, secondTokenId).send({from: owner}); - - expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(targetNftTokenAddress); - - // Unnest token back - await contract.methods.transferFrom(targetNftTokenAddress, owner, secondTokenId).send({from: owner}); - expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(owner); + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + }); }); - itWeb3('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - - const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(api, web3, owner); - const {collectionAddress: collectionAddressB, contract: contractB} = await createNestingCollection(api, web3, owner); - await contractA.methods.setCollectionNesting(true, [collectionAddressA, collectionAddressB]).send({from: owner}); - - // Create a token to nest into - const targetNftTokenId = await contractA.methods.nextTokenId().call(); - await contractA.methods.mint( - owner, - targetNftTokenId, - ).send({from: owner}); - const nftTokenAddressA1 = tokenIdToAddress(collectionIdA, targetNftTokenId); - - // Create a token for nesting in the same collection as the target - const nftTokenIdA = await contractA.methods.nextTokenId().call(); - await contractA.methods.mint( - owner, - nftTokenIdA, - ).send({from: owner}); - - // Create a token for nesting in a different collection - const nftTokenIdB = await contractB.methods.nextTokenId().call(); - await contractB.methods.mint( - owner, - nftTokenIdB, - ).send({from: owner}); - - // Nest - await contractA.methods.transfer(nftTokenAddressA1, nftTokenIdA).send({from: owner}); - expect(await contractA.methods.ownerOf(nftTokenIdA).call()).to.be.equal(nftTokenAddressA1); - - await contractB.methods.transfer(nftTokenAddressA1, nftTokenIdB).send({from: owner}); - expect(await contractB.methods.ownerOf(nftTokenIdB).call()).to.be.equal(nftTokenAddressA1); + describe('Integration Test: EVM Nesting', () => { + itEth('NFT: allows an Owner to nest/unnest their token', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionId, contract} = await createNestingCollection(helper, owner); + + // Create a token to be nested + const targetNFTTokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint( + owner, + targetNFTTokenId, + ).send({from: owner}); + + const targetNftTokenAddress = helper.ethAddress.fromTokenId(collectionId, targetNFTTokenId); + + // Create a nested token + const firstTokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint( + targetNftTokenAddress, + firstTokenId, + ).send({from: owner}); + + expect(await contract.methods.ownerOf(firstTokenId).call()).to.be.equal(targetNftTokenAddress); + + // Create a token to be nested and nest + const secondTokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint( + owner, + secondTokenId, + ).send({from: owner}); + + await contract.methods.transfer(targetNftTokenAddress, secondTokenId).send({from: owner}); + + expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(targetNftTokenAddress); + + // Unnest token back + await contract.methods.transferFrom(targetNftTokenAddress, owner, secondTokenId).send({from: owner}); + expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(owner); + }); + + itEth('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + + const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(helper, owner); + const {collectionAddress: collectionAddressB, contract: contractB} = await createNestingCollection(helper, owner); + await contractA.methods.setCollectionNesting(true, [collectionAddressA, collectionAddressB]).send({from: owner}); + + // Create a token to nest into + const targetNftTokenId = await contractA.methods.nextTokenId().call(); + await contractA.methods.mint( + owner, + targetNftTokenId, + ).send({from: owner}); + const nftTokenAddressA1 = helper.ethAddress.fromTokenId(collectionIdA, targetNftTokenId); + + // Create a token for nesting in the same collection as the target + const nftTokenIdA = await contractA.methods.nextTokenId().call(); + await contractA.methods.mint( + owner, + nftTokenIdA, + ).send({from: owner}); + + // Create a token for nesting in a different collection + const nftTokenIdB = await contractB.methods.nextTokenId().call(); + await contractB.methods.mint( + owner, + nftTokenIdB, + ).send({from: owner}); + + // Nest + await contractA.methods.transfer(nftTokenAddressA1, nftTokenIdA).send({from: owner}); + expect(await contractA.methods.ownerOf(nftTokenIdA).call()).to.be.equal(nftTokenAddressA1); + + await contractB.methods.transfer(nftTokenAddressA1, nftTokenIdB).send({from: owner}); + expect(await contractB.methods.ownerOf(nftTokenIdB).call()).to.be.equal(nftTokenAddressA1); + }); }); -}); - -describe('Negative Test: EVM Nesting', async() => { - itWeb3('NFT: disallows to nest token if nesting is disabled', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - - const {collectionId, contract} = await createNestingCollection(api, web3, owner); - await contract.methods.setCollectionNesting(false).send({from: owner}); - - // Create a token to nest into - const targetNftTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint( - owner, - targetNftTokenId, - ).send({from: owner}); - - const targetNftTokenAddress = tokenIdToAddress(collectionId, targetNftTokenId); - - // Create a token to nest - const nftTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint( - owner, - nftTokenId, - ).send({from: owner}); - - // Try to nest - await expect(contract.methods - .transfer(targetNftTokenAddress, nftTokenId) - .call({from: owner})).to.be.rejectedWith('UserIsNotAllowedToNest'); - }); - - itWeb3('NFT: disallows a non-Owner to nest someone else\'s token', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const malignant = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - - const {collectionId, contract} = await createNestingCollection(api, web3, owner); - - // Mint a token - const targetTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint( - owner, - targetTokenId, - ).send({from: owner}); - const targetTokenAddress = tokenIdToAddress(collectionId, targetTokenId); - - // Mint a token belonging to a different account - const tokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint( - malignant, - tokenId, - ).send({from: owner}); - - // Try to nest one token in another as a non-owner account - await expect(contract.methods - .transfer(targetTokenAddress, tokenId) - .call({from: malignant})).to.be.rejectedWith('UserIsNotAllowedToNest'); - }); - - itWeb3('NFT: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const malignant = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - - const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(api, web3, owner); - const {collectionAddress: collectionAddressB, contract: contractB} = await createNestingCollection(api, web3, owner); - - await contractA.methods.setCollectionNesting(true, [collectionAddressA, collectionAddressB]).send({from: owner}); - - // Create a token in one collection - const nftTokenIdA = await contractA.methods.nextTokenId().call(); - await contractA.methods.mint( - owner, - nftTokenIdA, - ).send({from: owner}); - const nftTokenAddressA = tokenIdToAddress(collectionIdA, nftTokenIdA); - - // Create a token in another collection belonging to someone else - const nftTokenIdB = await contractB.methods.nextTokenId().call(); - await contractB.methods.mint( - malignant, - nftTokenIdB, - ).send({from: owner}); - - // Try to drag someone else's token into the other collection and nest - await expect(contractB.methods - .transfer(nftTokenAddressA, nftTokenIdB) - .call({from: malignant})).to.be.rejectedWith('UserIsNotAllowedToNest'); - }); - - itWeb3('NFT: disallows to nest token in an unlisted collection', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - - const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(api, web3, owner); - const {contract: contractB} = await createNestingCollection(api, web3, owner); - - await contractA.methods.setCollectionNesting(true, [collectionAddressA]).send({from: owner}); - - // Create a token in one collection - const nftTokenIdA = await contractA.methods.nextTokenId().call(); - await contractA.methods.mint( - owner, - nftTokenIdA, - ).send({from: owner}); - const nftTokenAddressA = tokenIdToAddress(collectionIdA, nftTokenIdA); - - // Create a token in another collection - const nftTokenIdB = await contractB.methods.nextTokenId().call(); - await contractB.methods.mint( - owner, - nftTokenIdB, - ).send({from: owner}); - // Try to nest into a token in the other collection, disallowed in the first - await expect(contractB.methods - .transfer(nftTokenAddressA, nftTokenIdB) - .call()).to.be.rejectedWith('SourceCollectionIsNotAllowedToNest'); + describe('Negative Test: EVM Nesting', async() => { + itEth('NFT: disallows to nest token if nesting is disabled', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + + const {collectionId, contract} = await createNestingCollection(helper, owner); + await contract.methods.setCollectionNesting(false).send({from: owner}); + + // Create a token to nest into + const targetNftTokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint( + owner, + targetNftTokenId, + ).send({from: owner}); + + const targetNftTokenAddress = helper.ethAddress.fromTokenId(collectionId, targetNftTokenId); + + // Create a token to nest + const nftTokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint( + owner, + nftTokenId, + ).send({from: owner}); + + // Try to nest + await expect(contract.methods + .transfer(targetNftTokenAddress, nftTokenId) + .call({from: owner})).to.be.rejectedWith('UserIsNotAllowedToNest'); + }); + + itEth('NFT: disallows a non-Owner to nest someone else\'s token', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const malignant = await helper.eth.createAccountWithBalance(donor); + + const {collectionId, contract} = await createNestingCollection(helper, owner); + + // Mint a token + const targetTokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint( + owner, + targetTokenId, + ).send({from: owner}); + const targetTokenAddress = helper.ethAddress.fromTokenId(collectionId, targetTokenId); + + // Mint a token belonging to a different account + const tokenId = await contract.methods.nextTokenId().call(); + await contract.methods.mint( + malignant, + tokenId, + ).send({from: owner}); + + // Try to nest one token in another as a non-owner account + await expect(contract.methods + .transfer(targetTokenAddress, tokenId) + .call({from: malignant})).to.be.rejectedWith('UserIsNotAllowedToNest'); + }); + + itEth('NFT: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const malignant = await helper.eth.createAccountWithBalance(donor); + + const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(helper, owner); + const {collectionAddress: collectionAddressB, contract: contractB} = await createNestingCollection(helper, owner); + + await contractA.methods.setCollectionNesting(true, [collectionAddressA, collectionAddressB]).send({from: owner}); + + // Create a token in one collection + const nftTokenIdA = await contractA.methods.nextTokenId().call(); + await contractA.methods.mint( + owner, + nftTokenIdA, + ).send({from: owner}); + const nftTokenAddressA = helper.ethAddress.fromTokenId(collectionIdA, nftTokenIdA); + + // Create a token in another collection belonging to someone else + const nftTokenIdB = await contractB.methods.nextTokenId().call(); + await contractB.methods.mint( + malignant, + nftTokenIdB, + ).send({from: owner}); + + // Try to drag someone else's token into the other collection and nest + await expect(contractB.methods + .transfer(nftTokenAddressA, nftTokenIdB) + .call({from: malignant})).to.be.rejectedWith('UserIsNotAllowedToNest'); + }); + + itEth('NFT: disallows to nest token in an unlisted collection', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + + const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(helper, owner); + const {contract: contractB} = await createNestingCollection(helper, owner); + + await contractA.methods.setCollectionNesting(true, [collectionAddressA]).send({from: owner}); + + // Create a token in one collection + const nftTokenIdA = await contractA.methods.nextTokenId().call(); + await contractA.methods.mint( + owner, + nftTokenIdA, + ).send({from: owner}); + const nftTokenAddressA = helper.ethAddress.fromTokenId(collectionIdA, nftTokenIdA); + + // Create a token in another collection + const nftTokenIdB = await contractB.methods.nextTokenId().call(); + await contractB.methods.mint( + owner, + nftTokenIdB, + ).send({from: owner}); + + // Try to nest into a token in the other collection, disallowed in the first + await expect(contractB.methods + .transfer(nftTokenAddressA, nftTokenIdB) + .call()).to.be.rejectedWith('SourceCollectionIsNotAllowedToNest'); + }); }); }); diff --git a/tests/src/eth/util/playgrounds/index.ts b/tests/src/eth/util/playgrounds/index.ts new file mode 100644 index 0000000000..bda93ddebd --- /dev/null +++ b/tests/src/eth/util/playgrounds/index.ts @@ -0,0 +1,67 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +import {IKeyringPair} from '@polkadot/types/types'; + +import config from '../../../config'; + +import {EthUniqueHelper} from './unique.dev'; +import {SilentLogger} from '../../../util/playgrounds/unique.dev'; + +export {EthUniqueHelper} from './unique.dev'; + +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; +chai.use(chaiAsPromised); +export const expect = chai.expect; + +export const usingEthPlaygrounds = async (code: (helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { + // TODO: Remove, this is temporary: Filter unneeded API output + // (Jaco promised it will be removed in the next version) + const consoleErr = console.error; + const consoleLog = console.log; + const consoleWarn = console.warn; + + const outFn = (printer: any) => (...args: any[]) => { + for (const arg of args) { + if (typeof arg !== 'string') + continue; + if (arg.includes('1000:: Normal connection closure') || arg.includes('Not decorating unknown runtime apis: UniqueApi/2, RmrkApi/1') || arg.includes('RPC methods not decorated:') || arg === 'Normal connection closure') + return; + } + printer(...args); + }; + + console.error = outFn(consoleErr.bind(console)); + console.log = outFn(consoleLog.bind(console)); + console.warn = outFn(consoleWarn.bind(console)); + const helper = new EthUniqueHelper(new SilentLogger()); + + try { + await helper.connect(config.substrateUrl); + await helper.connectWeb3(config.substrateUrl); + const ss58Format = helper.chain.getChainProperties().ss58Format; + const privateKey = (seed: string) => helper.util.fromSeed(seed, ss58Format); + await code(helper, privateKey); + } + finally { + await helper.disconnect(); + await helper.disconnectWeb3(); + console.error = consoleErr; + console.log = consoleLog; + console.warn = consoleWarn; + } +} + +export async function itEth(name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean } = {}) { + let i: any = it; + if (opts.only) i = i.only; + else if (opts.skip) i = i.skip; + i(name, async () => { + await usingEthPlaygrounds(async (helper, privateKey) => { + await cb({helper, privateKey}); + }); + }); +} +itEth.only = (name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itEth(name, cb, {only: true}); +itEth.skip = (name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itEth(name, cb, {skip: true}); \ No newline at end of file diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts new file mode 100644 index 0000000000..bc83bb0099 --- /dev/null +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -0,0 +1,162 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +/* eslint-disable function-call-argument-newline */ + +import Web3 from 'web3'; +import {WebsocketProvider} from 'web3-core'; +import {Contract} from 'web3-eth-contract'; + +import {evmToAddress} from '@polkadot/util-crypto'; +import {IKeyringPair} from '@polkadot/types/types'; + +import {DevUniqueHelper} from '../../../util/playgrounds/unique.dev'; + +// Native contracts ABI +import collectionHelpersAbi from '../../collectionHelpersAbi.json'; +import fungibleAbi from '../../fungibleAbi.json'; +import nonFungibleAbi from '../../nonFungibleAbi.json'; +import refungibleAbi from '../../reFungibleAbi.json'; +import refungibleTokenAbi from '../../reFungibleTokenAbi.json'; +import contractHelpersAbi from './../contractHelpersAbi.json'; + +class EthGroupBase { + helper: EthUniqueHelper; + + constructor(helper: EthUniqueHelper) { + this.helper = helper; + } +} + + +class NativeContractGroup extends EthGroupBase { + DEFAULT_GAS = 2_500_000; + + contractHelpers(caller: string): Contract { + const web3 = this.helper.getWeb3(); + return new web3.eth.Contract(contractHelpersAbi as any, '0x842899ECF380553E8a4de75bF534cdf6fBF64049', {from: caller, gas: this.DEFAULT_GAS}); + } + + collectionHelpers(caller: string) { + const web3 = this.helper.getWeb3(); + return new web3.eth.Contract(collectionHelpersAbi as any, '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f', {from: caller, gas: this.DEFAULT_GAS}); + } + + collection(address: string, mode: 'nft' | 'rft' | 'ft', caller?: string): Contract { + const abi = { + 'nft': nonFungibleAbi, + 'rft': refungibleAbi, + 'ft': fungibleAbi + }[mode]; + const web3 = this.helper.getWeb3(); + return new web3.eth.Contract(abi as any, address, {gas: this.DEFAULT_GAS, ...(caller ? {from: caller} : {})}); + } + + rftTokenByAddress(address: string, caller?: string): Contract { + const web3 = this.helper.getWeb3(); + return new web3.eth.Contract(refungibleTokenAbi as any, address, {gas: this.DEFAULT_GAS, ...(caller ? {from: caller} : {})}); + } + + rftToken(collectionId: number, tokenId: number, caller?: string): Contract { + return this.rftTokenByAddress(this.helper.ethAddress.fromTokenId(collectionId, tokenId), caller); + } +} + + +class EthGroup extends EthGroupBase { + createAccount() { + const web3 = this.helper.getWeb3(); + const account = web3.eth.accounts.create(); + web3.eth.accounts.wallet.add(account.privateKey); + return account.address; + } + + async createAccountWithBalance(donor: IKeyringPair, amount=1000n) { + const account = this.createAccount(); + await this.transferBalanceFromSubstrate(donor, account, amount); + + return account; + } + + async transferBalanceFromSubstrate(donor: IKeyringPair, recepient: string, amount=1000n) { + return await this.helper.balance.transferToSubstrate(donor, evmToAddress(recepient), amount * this.helper.balance.getOneTokenNominal()); + } + + async createNonfungibleCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{collectionId: number, collectionAddress: string}> { + const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); + + const result = await collectionHelper.methods.createNonfungibleCollection(name, description, tokenPrefix).send(); + + const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); + const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress); + + return {collectionId, collectionAddress}; + } +} + + +class EthAddressGroup extends EthGroupBase { + extractCollectionId(address: string): number { + if (!(address.length === 42 || address.length === 40)) throw new Error('address wrong format'); + return parseInt(address.substr(address.length - 8), 16); + } + + fromCollectionId(collectionId: number): string { + if (collectionId >= 0xffffffff || collectionId < 0) throw new Error('collectionId overflow'); + return Web3.utils.toChecksumAddress(`0x17c4e6453cc49aaaaeaca894e6d9683e${collectionId.toString(16).padStart(8, '0')}`); + } + + extractTokenId(address: string): {collectionId: number, tokenId: number} { + if (!address.startsWith('0x')) + throw 'address not starts with "0x"'; + if (address.length > 42) + throw 'address length is more than 20 bytes'; + return { + collectionId: Number('0x' + address.substring(address.length - 16, address.length - 8)), + tokenId: Number('0x' + address.substring(address.length - 8)), + }; + } + + fromTokenId(collectionId: number, tokenId: number): string { + return this.helper.util.getNestingTokenAddress(collectionId, tokenId); + } + + normalizeAddress(address: string): string { + return '0x' + address.substring(address.length - 40); + } +} + + +export class EthUniqueHelper extends DevUniqueHelper { + web3: Web3 | null = null; + web3Provider: WebsocketProvider | null = null; + + eth: EthGroup; + ethAddress: EthAddressGroup; + ethNativeContract: NativeContractGroup; + + constructor(logger: { log: (msg: any, level: any) => void, level: any }) { + super(logger); + this.eth = new EthGroup(this); + this.ethAddress = new EthAddressGroup(this); + this.ethNativeContract = new NativeContractGroup(this); + } + + getWeb3(): Web3 { + if(this.web3 === null) throw Error('Web3 not connected'); + return this.web3; + } + + async connectWeb3(wsEndpoint: string) { + if(this.web3 !== null) return; + this.web3Provider = new Web3.providers.WebsocketProvider(wsEndpoint); + this.web3 = new Web3(this.web3Provider); + } + + async disconnectWeb3() { + if(this.web3 === null) return; + this.web3Provider?.connection.close(); + this.web3 = null; + } +} + \ No newline at end of file From a68b33eb81c54584fb5c89a9079bbc746d846824 Mon Sep 17 00:00:00 2001 From: Andrey Date: Sun, 4 Sep 2022 16:13:35 +0000 Subject: [PATCH 0701/1274] test: SilentConsole cls instead of multiple decorations --- tests/src/eth/util/playgrounds/index.ts | 26 ++---------- tests/src/substrate/substrate-api.ts | 27 +++---------- tests/src/util/playgrounds/index.ts | 34 ++-------------- tests/src/util/playgrounds/unique.dev.ts | 50 +++++++++++++++++++++++- 4 files changed, 62 insertions(+), 75 deletions(-) diff --git a/tests/src/eth/util/playgrounds/index.ts b/tests/src/eth/util/playgrounds/index.ts index bda93ddebd..ca67eee549 100644 --- a/tests/src/eth/util/playgrounds/index.ts +++ b/tests/src/eth/util/playgrounds/index.ts @@ -6,7 +6,7 @@ import {IKeyringPair} from '@polkadot/types/types'; import config from '../../../config'; import {EthUniqueHelper} from './unique.dev'; -import {SilentLogger} from '../../../util/playgrounds/unique.dev'; +import {SilentLogger, SilentConsole} from '../../../util/playgrounds/unique.dev'; export {EthUniqueHelper} from './unique.dev'; @@ -16,25 +16,9 @@ chai.use(chaiAsPromised); export const expect = chai.expect; export const usingEthPlaygrounds = async (code: (helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { - // TODO: Remove, this is temporary: Filter unneeded API output - // (Jaco promised it will be removed in the next version) - const consoleErr = console.error; - const consoleLog = console.log; - const consoleWarn = console.warn; + const silentConsole = new SilentConsole(); + silentConsole.enable(); - const outFn = (printer: any) => (...args: any[]) => { - for (const arg of args) { - if (typeof arg !== 'string') - continue; - if (arg.includes('1000:: Normal connection closure') || arg.includes('Not decorating unknown runtime apis: UniqueApi/2, RmrkApi/1') || arg.includes('RPC methods not decorated:') || arg === 'Normal connection closure') - return; - } - printer(...args); - }; - - console.error = outFn(consoleErr.bind(console)); - console.log = outFn(consoleLog.bind(console)); - console.warn = outFn(consoleWarn.bind(console)); const helper = new EthUniqueHelper(new SilentLogger()); try { @@ -47,9 +31,7 @@ export const usingEthPlaygrounds = async (code: (helper: EthUniqueHelper, privat finally { await helper.disconnect(); await helper.disconnectWeb3(); - console.error = consoleErr; - console.log = consoleLog; - console.warn = consoleWarn; + silentConsole.disable(); } } diff --git a/tests/src/substrate/substrate-api.ts b/tests/src/substrate/substrate-api.ts index cf6493cd73..6a33dda27d 100644 --- a/tests/src/substrate/substrate-api.ts +++ b/tests/src/substrate/substrate-api.ts @@ -25,6 +25,8 @@ import * as defs from '../interfaces/definitions'; import privateKey from './privateKey'; import promisifySubstrate from './promisify-substrate'; +import {SilentConsole} from '../util/playgrounds/unique.dev'; + function defaultApiOptions(): ApiOptions { @@ -75,25 +77,8 @@ export default async function usingApi(action: (api: ApiPromise, priva const api: ApiPromise = new ApiPromise(settings); let result: T = null as unknown as T; - // TODO: Remove, this is temporary: Filter unneeded API output - // (Jaco promised it will be removed in the next version) - const consoleErr = console.error; - const consoleLog = console.log; - const consoleWarn = console.warn; - - const outFn = (printer: any) => (...args: any[]) => { - for (const arg of args) { - if (typeof arg !== 'string') - continue; - if (arg.includes('1000:: Normal connection closure' || arg === 'Normal connection closure')) - return; - } - printer(...args); - }; - - console.error = outFn(consoleErr.bind(console)); - console.log = outFn(consoleLog.bind(console)); - console.warn = outFn(consoleWarn.bind(console)); + const silentConsole = new SilentConsole(); + silentConsole.enable(); try { await promisifySubstrate(api, async () => { @@ -106,9 +91,7 @@ export default async function usingApi(action: (api: ApiPromise, priva })(); } finally { await api.disconnect(); - console.error = consoleErr; - console.log = consoleLog; - console.warn = consoleWarn; + silentConsole.disable(); } return result as T; } diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index c2b59cc025..06e9e1c74f 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -4,37 +4,13 @@ import {IKeyringPair} from '@polkadot/types/types'; import config from '../../config'; import '../../interfaces/augment-api-events'; -import {DevUniqueHelper} from './unique.dev'; +import {DevUniqueHelper, SilentLogger, SilentConsole} from './unique.dev'; -class SilentLogger { - log(msg: any, level: any): void { } - level = { - ERROR: 'ERROR' as const, - WARNING: 'WARNING' as const, - INFO: 'INFO' as const, - }; -} export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { - // TODO: Remove, this is temporary: Filter unneeded API output - // (Jaco promised it will be removed in the next version) - const consoleErr = console.error; - const consoleLog = console.log; - const consoleWarn = console.warn; + const silentConsole = new SilentConsole(); + silentConsole.enable(); - const outFn = (printer: any) => (...args: any[]) => { - for (const arg of args) { - if (typeof arg !== 'string') - continue; - if (arg.includes('1000:: Normal connection closure' || arg === 'Normal connection closure')) - return; - } - printer(...args); - }; - - console.error = outFn(consoleErr.bind(console)); - console.log = outFn(consoleLog.bind(console)); - console.warn = outFn(consoleWarn.bind(console)); const helper = new DevUniqueHelper(new SilentLogger()); try { @@ -45,8 +21,6 @@ export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKe } finally { await helper.disconnect(); - console.error = consoleErr; - console.log = consoleLog; - console.warn = consoleWarn; + silentConsole.disable(); } }; \ No newline at end of file diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index f61437ea72..6717320a81 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -5,10 +5,58 @@ import {mnemonicGenerate} from '@polkadot/util-crypto'; import {UniqueHelper} from './unique'; import {ApiPromise, WsProvider} from '@polkadot/api'; import * as defs from '../../interfaces/definitions'; -import {TSigner} from './types'; import {IKeyringPair} from '@polkadot/types/types'; +export class SilentLogger { + log(msg: any, level: any): void { } + level = { + ERROR: 'ERROR' as const, + WARNING: 'WARNING' as const, + INFO: 'INFO' as const, + }; +} + + +export class SilentConsole { + // TODO: Remove, this is temporary: Filter unneeded API output + // (Jaco promised it will be removed in the next version) + consoleErr: any; + consoleLog: any; + consoleWarn: any; + + constructor() { + this.consoleErr = console.error; + this.consoleLog = console.log; + this.consoleWarn = console.warn; + } + + enable() { + const outFn = (printer: any) => (...args: any[]) => { + for (const arg of args) { + for (const arg of args) { + if (typeof arg !== 'string') + continue; + if (arg.includes('1000:: Normal connection closure') || arg.includes('Not decorating unknown runtime apis: UniqueApi/2, RmrkApi/1') || arg.includes('RPC methods not decorated:') || arg === 'Normal connection closure') + return; + } + } + printer(...args); + }; + + console.error = outFn(this.consoleErr.bind(console)); + console.log = outFn(this.consoleLog.bind(console)); + console.warn = outFn(this.consoleWarn.bind(console)); + } + + disable() { + console.error = this.consoleErr; + console.log = this.consoleLog; + console.warn = this.consoleWarn; + } +} + + export class DevUniqueHelper extends UniqueHelper { /** * Arrange methods for tests From e6b5df49e9b9670516ebd42e7df364961705d307 Mon Sep 17 00:00:00 2001 From: Andrey Date: Sun, 4 Sep 2022 17:48:21 +0000 Subject: [PATCH 0702/1274] test: ethContract group for eth-playgrounds --- tests/package.json | 1 + tests/src/eth/payable.test.ts | 108 ++++++++--------- tests/src/eth/util/playgrounds/types.ts | 9 ++ tests/src/eth/util/playgrounds/unique.dev.ts | 120 +++++++++++++++++-- tests/src/util/playgrounds/unique.ts | 1 + 5 files changed, 175 insertions(+), 64 deletions(-) create mode 100644 tests/src/eth/util/playgrounds/types.ts diff --git a/tests/package.json b/tests/package.json index b8ded51d4b..e2985a4954 100644 --- a/tests/package.json +++ b/tests/package.json @@ -30,6 +30,7 @@ "testEth": "mocha --timeout 9999999 -r ts-node/register './**/eth/**/*.test.ts'", "testEthMarketplace": "mocha --timeout 9999999 -r ts-node/register './**/eth/marketplace/**/*.test.ts'", "testEthNesting": "mocha --timeout 9999999 -r ts-node/register './**/eth/nesting/**/*.test.ts'", + "testEthPayable": "mocha --timeout 9999999 -r ts-node/register './**/eth/payable.test.ts'", "load": "mocha --timeout 9999999 -r ts-node/register './**/*.load.ts'", "loadTransfer": "ts-node src/transfer.nload.ts", "testCollision": "mocha --timeout 9999999 -r ts-node/register ./src/collision-tests/*.test.ts", diff --git a/tests/src/eth/payable.test.ts b/tests/src/eth/payable.test.ts index 61364dfc8d..147607710e 100644 --- a/tests/src/eth/payable.test.ts +++ b/tests/src/eth/payable.test.ts @@ -14,97 +14,91 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {expect} from 'chai'; -import {submitTransactionAsync} from '../substrate/substrate-api'; -import {createEthAccountWithBalance, deployCollector, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from './util/helpers'; -import {evmToAddress} from '@polkadot/util-crypto'; -import {getGenericResult, UNIQUE} from '../util/helpers'; -import {getBalanceSingle, transferBalanceExpectSuccess} from '../substrate/get-balance'; +import {IKeyringPair} from '@polkadot/types/types'; + +import {itEth, expect, usingEthPlaygrounds} from './util/playgrounds'; describe('EVM payable contracts', () => { - itWeb3('Evm contract can receive wei from eth account', async ({api, web3, privateKeyWrapper}) => { - const deployer = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const contract = await deployCollector(web3, deployer); + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); - await web3.eth.sendTransaction({from: deployer, to: contract.options.address, value: '10000', ...GAS_ARGS}); + itEth('Evm contract can receive wei from eth account', async ({helper}) => { + const deployer = await helper.eth.createAccountWithBalance(donor); + const contract = await helper.eth.deployCollectorContract(deployer); + + const web3 = helper.getWeb3(); + + await web3.eth.sendTransaction({from: deployer, to: contract.options.address, value: '10000', gas: helper.eth.DEFAULT_GAS}); expect(await contract.methods.getCollected().call()).to.be.equal('10000'); }); - itWeb3('Evm contract can receive wei from substrate account', async ({api, web3, privateKeyWrapper}) => { - const deployer = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const contract = await deployCollector(web3, deployer); - const alice = privateKeyWrapper('//Alice'); + itEth('Evm contract can receive wei from substrate account', async ({helper}) => { + const deployer = await helper.eth.createAccountWithBalance(donor); + const contract = await helper.eth.deployCollectorContract(deployer); + const [alice] = await helper.arrange.createAccounts([10n], donor); + + const weiCount = '10000'; // Transaction fee/value will be payed from subToEth(sender) evm balance, // which is backed by evmToAddress(subToEth(sender)) substrate balance - await transferBalanceToEth(api, alice, subToEth(alice.address)); + await helper.eth.transferBalanceFromSubstrate(alice, helper.address.substrateToEth(alice.address), 5n); - { - const tx = api.tx.evm.call( - subToEth(alice.address), - contract.options.address, - contract.methods.giveMoney().encodeABI(), - '10000', - GAS_ARGS.gas, - await web3.eth.getGasPrice(), - null, - null, - [], - ); - const events = await submitTransactionAsync(alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - } - expect(await contract.methods.getCollected().call()).to.be.equal('10000'); + await helper.eth.callEVM(alice, contract.options.address, contract.methods.giveMoney().encodeABI(), weiCount); + + expect(await contract.methods.getCollected().call()).to.be.equal(weiCount); }); // We can't handle sending balance to backing storage of evm balance, because evmToAddress operation is irreversible - itWeb3('Wei sent directly to backing storage of evm contract balance is unaccounted', async({api, web3, privateKeyWrapper}) => { - const deployer = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const contract = await deployCollector(web3, deployer); - const alice = privateKeyWrapper('//Alice'); + itEth('Wei sent directly to backing storage of evm contract balance is unaccounted', async({helper}) => { + const deployer = await helper.eth.createAccountWithBalance(donor); + const contract = await helper.eth.deployCollectorContract(deployer); + const [alice] = await helper.arrange.createAccounts([10n], donor); + + const weiCount = 10_000n; - await transferBalanceExpectSuccess(api, alice, evmToAddress(contract.options.address), '10000'); + await helper.eth.transferBalanceFromSubstrate(alice, contract.options.address, weiCount, false); - expect(await contract.methods.getUnaccounted().call()).to.be.equal('10000'); + expect(await contract.methods.getUnaccounted().call()).to.be.equal(weiCount.toString()); }); - itWeb3('Balance can be retrieved from evm contract', async({api, web3, privateKeyWrapper}) => { - const FEE_BALANCE = 1000n * UNIQUE; - const CONTRACT_BALANCE = 1n * UNIQUE; + itEth('Balance can be retrieved from evm contract', async({helper, privateKey}) => { + const FEE_BALANCE = 10n * helper.balance.getOneTokenNominal(); + const CONTRACT_BALANCE = 1n * helper.balance.getOneTokenNominal(); + + const deployer = await helper.eth.createAccountWithBalance(donor); + const contract = await helper.eth.deployCollectorContract(deployer); + const [alice] = await helper.arrange.createAccounts([20n], donor); - const deployer = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const contract = await deployCollector(web3, deployer); - const alice = privateKeyWrapper('//Alice'); + const web3 = helper.getWeb3(); - await web3.eth.sendTransaction({from: deployer, to: contract.options.address, value: CONTRACT_BALANCE.toString(), ...GAS_ARGS}); + await web3.eth.sendTransaction({from: deployer, to: contract.options.address, value: CONTRACT_BALANCE.toString(), gas: helper.eth.DEFAULT_GAS}); - const receiver = privateKeyWrapper(`//Receiver${Date.now()}`); + const receiver = privateKey(`//Receiver${Date.now()}`); // First receive balance on eth balance of bob { - const ethReceiver = subToEth(receiver.address); + const ethReceiver = helper.address.substrateToEth(receiver.address); expect(await web3.eth.getBalance(ethReceiver)).to.be.equal('0'); await contract.methods.withdraw(ethReceiver).send({from: deployer}); expect(await web3.eth.getBalance(ethReceiver)).to.be.equal(CONTRACT_BALANCE.toString()); } // Some balance is required to pay fee for evm.withdraw call - await transferBalanceExpectSuccess(api, alice, receiver.address, FEE_BALANCE.toString()); + await helper.balance.transferToSubstrate(alice, receiver.address, FEE_BALANCE); + // await transferBalanceExpectSuccess(api, alice, receiver.address, FEE_BALANCE.toString()); // Withdraw balance from eth to substrate { - const initialReceiverBalance = await getBalanceSingle(api, receiver.address); - const tx = api.tx.evm.withdraw( - subToEth(receiver.address), - CONTRACT_BALANCE.toString(), - ); - const events = await submitTransactionAsync(receiver, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - const finalReceiverBalance = await getBalanceSingle(api, receiver.address); + const initialReceiverBalance = await helper.balance.getSubstrate(receiver.address); + await helper.executeExtrinsic(receiver, 'api.tx.evm.withdraw', [helper.address.substrateToEth(receiver.address), CONTRACT_BALANCE.toString()], true); + const finalReceiverBalance = await helper.balance.getSubstrate(receiver.address); expect(finalReceiverBalance > initialReceiverBalance).to.be.true; } diff --git a/tests/src/eth/util/playgrounds/types.ts b/tests/src/eth/util/playgrounds/types.ts new file mode 100644 index 0000000000..e7aa9d3905 --- /dev/null +++ b/tests/src/eth/util/playgrounds/types.ts @@ -0,0 +1,9 @@ +export interface ContractImports { + solPath: string; + fsPath: string; +} + +export interface CompiledContract { + abi: any; + object: string; +} \ No newline at end of file diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index bc83bb0099..1dd1158423 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -3,15 +3,21 @@ /* eslint-disable function-call-argument-newline */ +import {readFile} from 'fs/promises'; + import Web3 from 'web3'; import {WebsocketProvider} from 'web3-core'; import {Contract} from 'web3-eth-contract'; +import * as solc from 'solc'; + import {evmToAddress} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; import {DevUniqueHelper} from '../../../util/playgrounds/unique.dev'; +import {ContractImports, CompiledContract} from './types'; + // Native contracts ABI import collectionHelpersAbi from '../../collectionHelpersAbi.json'; import fungibleAbi from '../../fungibleAbi.json'; @@ -27,19 +33,75 @@ class EthGroupBase { this.helper = helper; } } + + +class ContractGroup extends EthGroupBase { + async findImports(imports?: ContractImports[]){ + if(!imports) return function(path: string) { + return {error: 'File not found'}; + }; + const knownImports = {} as any; + for(let imp of imports) { + knownImports[imp.solPath] = (await readFile(imp.fsPath)).toString(); + } + + return function(path: string) { + if(knownImports.hasOwnProperty(path)) return {contents: knownImports[path]}; + return {error: 'File not found'}; + } + } + + async compile(name: string, src: string, imports?: ContractImports[]): Promise { + const out = JSON.parse(solc.compile(JSON.stringify({ + language: 'Solidity', + sources: { + [`${name}.sol`]: { + content: src, + }, + }, + settings: { + outputSelection: { + '*': { + '*': ['*'], + }, + }, + }, + }), {import: await this.findImports(imports)})).contracts[`${name}.sol`][name]; + + return { + abi: out.abi, + object: '0x' + out.evm.bytecode.object, + }; + } + + async deployByCode(signer: string, name: string, src: string, imports?: ContractImports[]): Promise { + const compiledContract = await this.compile(name, src, imports); + return this.deployByAbi(signer, compiledContract.abi, compiledContract.object); + } + + async deployByAbi(signer: string, abi: any, object: string): Promise { + const web3 = this.helper.getWeb3(); + const contract = new web3.eth.Contract(abi, undefined, { + data: object, + from: signer, + gas: this.helper.eth.DEFAULT_GAS + }); + return await contract.deploy({data: object}).send({from: signer}); + } + +} class NativeContractGroup extends EthGroupBase { - DEFAULT_GAS = 2_500_000; contractHelpers(caller: string): Contract { const web3 = this.helper.getWeb3(); - return new web3.eth.Contract(contractHelpersAbi as any, '0x842899ECF380553E8a4de75bF534cdf6fBF64049', {from: caller, gas: this.DEFAULT_GAS}); + return new web3.eth.Contract(contractHelpersAbi as any, '0x842899ECF380553E8a4de75bF534cdf6fBF64049', {from: caller, gas: this.helper.eth.DEFAULT_GAS}); } collectionHelpers(caller: string) { const web3 = this.helper.getWeb3(); - return new web3.eth.Contract(collectionHelpersAbi as any, '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f', {from: caller, gas: this.DEFAULT_GAS}); + return new web3.eth.Contract(collectionHelpersAbi as any, '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f', {from: caller, gas: this.helper.eth.DEFAULT_GAS}); } collection(address: string, mode: 'nft' | 'rft' | 'ft', caller?: string): Contract { @@ -49,12 +111,12 @@ class NativeContractGroup extends EthGroupBase { 'ft': fungibleAbi }[mode]; const web3 = this.helper.getWeb3(); - return new web3.eth.Contract(abi as any, address, {gas: this.DEFAULT_GAS, ...(caller ? {from: caller} : {})}); + return new web3.eth.Contract(abi as any, address, {gas: this.helper.eth.DEFAULT_GAS, ...(caller ? {from: caller} : {})}); } rftTokenByAddress(address: string, caller?: string): Contract { const web3 = this.helper.getWeb3(); - return new web3.eth.Contract(refungibleTokenAbi as any, address, {gas: this.DEFAULT_GAS, ...(caller ? {from: caller} : {})}); + return new web3.eth.Contract(refungibleTokenAbi as any, address, {gas: this.helper.eth.DEFAULT_GAS, ...(caller ? {from: caller} : {})}); } rftToken(collectionId: number, tokenId: number, caller?: string): Contract { @@ -64,6 +126,8 @@ class NativeContractGroup extends EthGroupBase { class EthGroup extends EthGroupBase { + DEFAULT_GAS = 2_500_000; + createAccount() { const web3 = this.helper.getWeb3(); const account = web3.eth.accounts.create(); @@ -78,8 +142,20 @@ class EthGroup extends EthGroupBase { return account; } - async transferBalanceFromSubstrate(donor: IKeyringPair, recepient: string, amount=1000n) { - return await this.helper.balance.transferToSubstrate(donor, evmToAddress(recepient), amount * this.helper.balance.getOneTokenNominal()); + async transferBalanceFromSubstrate(donor: IKeyringPair, recepient: string, amount=1000n, inTokens=true) { + return await this.helper.balance.transferToSubstrate(donor, evmToAddress(recepient), amount * (inTokens ? this.helper.balance.getOneTokenNominal() : 1n)); + } + + async callEVM(signer: IKeyringPair, contractAddress: string, abi: any, value: string, gasLimit?: number) { + if(!gasLimit) gasLimit = this.DEFAULT_GAS; + const web3 = this.helper.getWeb3(); + const gasPrice = await web3.eth.getGasPrice(); + // TODO: check execution status + await this.helper.executeExtrinsic( + signer, + 'api.tx.evm.call', [this.helper.address.substrateToEth(signer.address), contractAddress, abi, value, gasLimit, gasPrice, null, null, []], + true, `Unable to perform evm.call` + ); } async createNonfungibleCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{collectionId: number, collectionAddress: string}> { @@ -92,6 +168,34 @@ class EthGroup extends EthGroupBase { return {collectionId, collectionAddress}; } + + async deployCollectorContract(signer: string): Promise { + return await this.helper.ethContract.deployByCode(signer, 'Collector', ` + // SPDX-License-Identifier: UNLICENSED + pragma solidity ^0.8.6; + + contract Collector { + uint256 collected; + fallback() external payable { + giveMoney(); + } + function giveMoney() public payable { + collected += msg.value; + } + function getCollected() public view returns (uint256) { + return collected; + } + function getUnaccounted() public view returns (uint256) { + return address(this).balance - collected; + } + + function withdraw(address payable target) public { + target.transfer(collected); + collected = 0; + } + } + `); + } } @@ -134,12 +238,14 @@ export class EthUniqueHelper extends DevUniqueHelper { eth: EthGroup; ethAddress: EthAddressGroup; ethNativeContract: NativeContractGroup; + ethContract: ContractGroup; constructor(logger: { log: (msg: any, level: any) => void, level: any }) { super(logger); this.eth = new EthGroup(this); this.ethAddress = new EthAddressGroup(this); this.ethNativeContract = new NativeContractGroup(this); + this.ethContract = new ContractGroup(this); } getWeb3(): Web3 { diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 0c2aabe759..7f09252475 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -388,6 +388,7 @@ class ChainHelperBase { type: this.chainLogType.EXTRINSIC, status: result.status, call: extrinsic, + signer: this.getSignerAddress(sender), params, } as IUniqueHelperLog; From 025c29dfe1658dab206140f197208615552cc230 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 5 Sep 2022 10:59:28 +0300 Subject: [PATCH 0703/1274] Test: remove execution readyness check script --- .github/workflows/dev-build-tests_v2.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/dev-build-tests_v2.yml b/.github/workflows/dev-build-tests_v2.yml index eec9aef96f..0719488e57 100644 --- a/.github/workflows/dev-build-tests_v2.yml +++ b/.github/workflows/dev-build-tests_v2.yml @@ -37,23 +37,6 @@ jobs: features: "unique-runtime" steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 @@ -92,7 +75,6 @@ jobs: yarn install yarn add mochawesome echo "Ready to start tests" - node scripts/readyness.js NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ From af94a85a6f9baba1c2d81dba5695df655895dc19 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 5 Sep 2022 11:09:25 +0300 Subject: [PATCH 0704/1274] Square brackets --- .github/workflows/test_codestyle_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_codestyle_v2.yml b/.github/workflows/test_codestyle_v2.yml index dc8eb63059..a2b08d1c2e 100644 --- a/.github/workflows/test_codestyle_v2.yml +++ b/.github/workflows/test_codestyle_v2.yml @@ -5,7 +5,7 @@ on: jobs: code_style: - runs-on: self-hosted-ci + runs-on: [ self-hosted-ci ] steps: - uses: actions/checkout@v3 From 5def7d2ebca5f67d13a8767a4770b15dc009b751 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 5 Sep 2022 08:53:59 +0000 Subject: [PATCH 0705/1274] fix(tests): additional error info --- tests/src/substrate/substrate-api.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/src/substrate/substrate-api.ts b/tests/src/substrate/substrate-api.ts index f8c7252862..063a548f8b 100644 --- a/tests/src/substrate/substrate-api.ts +++ b/tests/src/substrate/substrate-api.ts @@ -169,13 +169,24 @@ submitTransactionAsync(sender: IKeyringPair, transaction: SubmittableExtrinsic { try { - await transaction.signAndSend(sender, ({events = [], status}) => { + await transaction.signAndSend(sender, ({events = [], status, dispatchError}) => { const transactionStatus = getTransactionStatus(events, status); if (transactionStatus === TransactionStatus.Success) { resolve(events); } else if (transactionStatus === TransactionStatus.Fail) { - console.log(`Something went wrong with transaction. Status: ${status}`); + let moduleError = null; + + if (dispatchError) { + if (dispatchError.isModule) { + const modErr = dispatchError.asModule; + const errorMeta = dispatchError.registry.findMetaError(modErr); + + moduleError = JSON.stringify(errorMeta, null, 4); + } + } + + console.log(`Something went wrong with transaction. Status: ${status}\nModule error: ${moduleError}`); reject(events); } }); From 78701e6cd9b8e41950924ee238aae3aac24f2d91 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 5 Sep 2022 10:01:13 +0000 Subject: [PATCH 0706/1274] test(xcm): qtz xcm tests --- tests/package.json | 1 + tests/src/xcm/xcmQuartz.test.ts | 682 ++++++++++++++++++++++++++++++++ 2 files changed, 683 insertions(+) create mode 100644 tests/src/xcm/xcmQuartz.test.ts diff --git a/tests/package.json b/tests/package.json index eb99f0c9e1..6d778d5fc9 100644 --- a/tests/package.json +++ b/tests/package.json @@ -75,6 +75,7 @@ "testScheduler": "mocha --timeout 9999999 -r ts-node/register ./**/scheduler.test.ts", "testSchedulingEVM": "mocha --timeout 9999999 -r ts-node/register ./**/eth/scheduling.test.ts", "testXcmUnique": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmUnique.test.ts", + "testXcmQuartz": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmQuartz.test.ts", "testXcmOpal": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmOpal.test.ts", "testXcmTransferAcala": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferAcala.test.ts acalaId=2000 uniqueId=5000", "testXcmTransferStatemine": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferStatemine.test.ts statemineId=1000 uniqueId=5000", diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts new file mode 100644 index 0000000000..923c375e43 --- /dev/null +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -0,0 +1,682 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; + +import {WsProvider, Keyring} from '@polkadot/api'; +import {ApiOptions} from '@polkadot/api/types'; +import {IKeyringPair} from '@polkadot/types/types'; +import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; +import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm} from '../util/helpers'; +import {MultiLocation} from '@polkadot/types/interfaces'; +import {blake2AsHex} from '@polkadot/util-crypto'; +import waitNewBlocks from '../substrate/wait-new-blocks'; +import getBalance from '../substrate/get-balance'; + +chai.use(chaiAsPromised); +const expect = chai.expect; + +const QUARTZ_CHAIN = 2095; +const KARURA_CHAIN = 2000; +const MOONRIVER_CHAIN = 2023; + +const KARURA_PORT = 9946; +const MOONRIVER_PORT = 9947; + +const TRANSFER_AMOUNT = 2000000000000000000000000n; + +function parachainApiOptions(port: number): ApiOptions { + return { + provider: new WsProvider('ws://127.0.0.1:' + port.toString()), + }; +} + +function karuraOptions(): ApiOptions { + return parachainApiOptions(KARURA_PORT); +} + +function moonriverOptions(): ApiOptions { + return parachainApiOptions(MOONRIVER_PORT); +} + +describe_xcm('Integration test: Exchanging tokens with Karura', () => { + let alice: IKeyringPair; + let randomAccount: IKeyringPair; + + let balanceQuartzTokenInit: bigint; + let balanceQuartzTokenMiddle: bigint; + let balanceQuartzTokenFinal: bigint; + let balanceKaruraTokenInit: bigint; + let balanceKaruraTokenMiddle: bigint; + let balanceKaruraTokenFinal: bigint; + let balanceQuartzForeignTokenInit: bigint; + let balanceQuartzForeignTokenMiddle: bigint; + let balanceQuartzForeignTokenFinal: bigint; + + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + alice = privateKeyWrapper('//Alice'); + randomAccount = generateKeyringPair(); + }); + + // Karura side + await usingApi( + async (api) => { + const destination = { + V0: { + X2: [ + 'Parent', + { + Parachain: QUARTZ_CHAIN, + }, + ], + }, + }; + + const metadata = { + name: 'QTZ', + symbol: 'QTZ', + decimals: 18, + minimalBalance: 1, + }; + + const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata); + const sudoTx = api.tx.sudo.sudo(tx as any); + const events = await submitTransactionAsync(alice, sudoTx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); + const events1 = await submitTransactionAsync(alice, tx1); + const result1 = getGenericResult(events1); + expect(result1.success).to.be.true; + + [balanceKaruraTokenInit] = await getBalance(api, [randomAccount.address]); + { + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceQuartzForeignTokenInit = BigInt(free); + } + }, + karuraOptions(), + ); + + // Quartz side + await usingApi(async (api) => { + const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); + const events0 = await submitTransactionAsync(alice, tx0); + const result0 = getGenericResult(events0); + expect(result0.success).to.be.true; + + [balanceQuartzTokenInit] = await getBalance(api, [randomAccount.address]); + }); + }); + + it('Should connect and send QTZ to Karura', async () => { + + // Quartz side + await usingApi(async (api) => { + + const destination = { + V0: { + X2: [ + 'Parent', + { + Parachain: KARURA_CHAIN, + }, + ], + }, + }; + + const beneficiary = { + V0: { + X1: { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, + }, + }, + }, + }; + + const assets = { + V1: [ + { + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: TRANSFER_AMOUNT, + }, + }, + ], + }; + + const feeAssetItem = 0; + + const weightLimit = { + Limited: 5000000000, + }; + + const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); + const events = await submitTransactionAsync(randomAccount, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccount.address]); + + const qtzFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT; + console.log('[Quartz -> Karura] transaction fees on Quartz: %s QTZ', qtzFees); + expect(qtzFees > 0n).to.be.true; + }); + + // Karura side + await usingApi( + async (api) => { + await waitNewBlocks(api, 3); + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceQuartzForeignTokenMiddle = BigInt(free); + + [balanceKaruraTokenMiddle] = await getBalance(api, [randomAccount.address]); + + const karFees = balanceKaruraTokenInit - balanceKaruraTokenMiddle; + const qtzIncomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenInit; + + console.log('[Quartz -> Karura] transaction fees on Karura: %s KAR', karFees); + console.log('[Quartz -> Karura] income %s QTZ', qtzIncomeTransfer); + expect(karFees == 0n).to.be.true; + expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true; + }, + karuraOptions(), + ); + }); + + it('Should connect to Karura and send QTZ back', async () => { + + // Karura side + await usingApi( + async (api) => { + const destination = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: QUARTZ_CHAIN}, + { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, + }, + }, + ], + }, + }, + }; + + const id = { + ForeignAsset: 0, + }; + + const destWeight = 50000000; + + const tx = api.tx.xTokens.transfer(id, TRANSFER_AMOUNT, destination, destWeight); + const events = await submitTransactionAsync(randomAccount, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceKaruraTokenFinal] = await getBalance(api, [randomAccount.address]); + { + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceQuartzForeignTokenFinal = BigInt(free); + } + + const karFees = balanceKaruraTokenMiddle - balanceKaruraTokenFinal; + const qtzOutcomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenFinal; + + console.log('[Karura -> Quartz] transaction fees on Karura: %s KAR', karFees); + console.log('[Karura -> Quartz] outcome %s QTZ', qtzOutcomeTransfer); + + expect(karFees > 0).to.be.true; + expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; + }, + karuraOptions(), + ); + + // Quartz side + await usingApi(async (api) => { + await waitNewBlocks(api, 3); + + [balanceQuartzTokenFinal] = await getBalance(api, [randomAccount.address]); + const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle; + expect(actuallyDelivered > 0).to.be.true; + + console.log('[Karura -> Quartz] actually delivered %s QTZ', actuallyDelivered); + + const qtzFees = TRANSFER_AMOUNT - actuallyDelivered; + console.log('[Karura -> Quartz] transaction fees on Quartz: %s QTZ', qtzFees); + expect(qtzFees == 0n).to.be.true; + }); + }); + + it('Quartz rejects KAR tokens from Karura', async () => { + // This test is relevant only when the foreign asset pallet is disabled + + await usingApi(async (api) => { + const destination = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: QUARTZ_CHAIN}, + { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, + }, + }, + ], + }, + }, + }; + + const id = { + Token: 'KAR', + }; + + const destWeight = 50000000; + + const tx = api.tx.xTokens.transfer(id, 100_000_000_000, destination, destWeight); + const events = await submitTransactionAsync(alice, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + }, karuraOptions()); + + await usingApi(async api => { + const maxWaitBlocks = 3; + const xcmpQueueFailEvent = await waitEvent(api, maxWaitBlocks, 'xcmpQueue', 'Fail'); + + expect( + xcmpQueueFailEvent != null, + 'Only native token is supported when the Foreign-Assets pallet is not connected', + ).to.be.true; + }); + }); +}); + +describe_xcm('Integration test: Exchanging QTZ with Moonriver', () => { + + // Quartz constants + let quartzAlice: IKeyringPair; + let quartzAssetLocation; + + let randomAccountQuartz: IKeyringPair; + let randomAccountMoonriver: IKeyringPair; + + // Moonriver constants + let assetId: string; + + const moonriverKeyring = new Keyring({type: 'ethereum'}); + const alithPrivateKey = '0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133'; + const baltatharPrivateKey = '0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b'; + const dorothyPrivateKey = '0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68'; + + const alithAccount = moonriverKeyring.addFromUri(alithPrivateKey, undefined, 'ethereum'); + const baltatharAccount = moonriverKeyring.addFromUri(baltatharPrivateKey, undefined, 'ethereum'); + const dorothyAccount = moonriverKeyring.addFromUri(dorothyPrivateKey, undefined, 'ethereum'); + + const councilVotingThreshold = 2; + const technicalCommitteeThreshold = 2; + const votingPeriod = 3; + const delayPeriod = 0; + + const quartzAssetMetadata = { + name: 'xcQuartz', + symbol: 'xcQTZ', + decimals: 18, + isFrozen: false, + minimalBalance: 1, + }; + + let balanceQuartzTokenInit: bigint; + let balanceQuartzTokenMiddle: bigint; + let balanceQuartzTokenFinal: bigint; + let balanceForeignQtzTokenInit: bigint; + let balanceForeignQtzTokenMiddle: bigint; + let balanceForeignQtzTokenFinal: bigint; + let balanceMovrTokenInit: bigint; + let balanceMovrTokenMiddle: bigint; + let balanceMovrTokenFinal: bigint; + + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + quartzAlice = privateKeyWrapper('//Alice'); + randomAccountQuartz = generateKeyringPair(); + randomAccountMoonriver = generateKeyringPair('ethereum'); + + balanceForeignQtzTokenInit = 0n; + }); + + await usingApi( + async (api) => { + + // >>> Sponsoring Dorothy >>> + console.log('Sponsoring Dorothy.......'); + const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n); + const events0 = await submitTransactionAsync(alithAccount, tx0); + const result0 = getGenericResult(events0); + expect(result0.success).to.be.true; + console.log('Sponsoring Dorothy.......DONE'); + // <<< Sponsoring Dorothy <<< + + const sourceLocation: MultiLocation = api.createType( + 'MultiLocation', + { + parents: 1, + interior: {X1: {Parachain: QUARTZ_CHAIN}}, + }, + ); + + quartzAssetLocation = {XCM: sourceLocation}; + const existentialDeposit = 1; + const isSufficient = true; + const unitsPerSecond = '1'; + const numAssetsWeightHint = 0; + + const registerTx = api.tx.assetManager.registerForeignAsset( + quartzAssetLocation, + quartzAssetMetadata, + existentialDeposit, + isSufficient, + ); + console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || ''); + + const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond( + quartzAssetLocation, + unitsPerSecond, + numAssetsWeightHint, + ); + console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || ''); + + const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]); + console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || ''); + + // >>> Note motion preimage >>> + console.log('Note motion preimage.......'); + const encodedProposal = batchCall?.method.toHex() || ''; + const proposalHash = blake2AsHex(encodedProposal); + console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal); + console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); + console.log('Encoded length %d', encodedProposal.length); + + const tx1 = api.tx.democracy.notePreimage(encodedProposal); + const events1 = await submitTransactionAsync(baltatharAccount, tx1); + const result1 = getGenericResult(events1); + expect(result1.success).to.be.true; + console.log('Note motion preimage.......DONE'); + // <<< Note motion preimage <<< + + // >>> Propose external motion through council >>> + console.log('Propose external motion through council.......'); + const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash); + const tx2 = api.tx.councilCollective.propose( + councilVotingThreshold, + externalMotion, + externalMotion.encodedLength, + ); + const events2 = await submitTransactionAsync(baltatharAccount, tx2); + const result2 = getGenericResult(events2); + expect(result2.success).to.be.true; + + const encodedMotion = externalMotion?.method.toHex() || ''; + const motionHash = blake2AsHex(encodedMotion); + console.log('Motion hash is %s', motionHash); + + const tx3 = api.tx.councilCollective.vote(motionHash, 0, true); + { + const events3 = await submitTransactionAsync(dorothyAccount, tx3); + const result3 = getGenericResult(events3); + expect(result3.success).to.be.true; + } + { + const events3 = await submitTransactionAsync(baltatharAccount, tx3); + const result3 = getGenericResult(events3); + expect(result3.success).to.be.true; + } + + const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength); + const events4 = await submitTransactionAsync(dorothyAccount, tx4); + const result4 = getGenericResult(events4); + expect(result4.success).to.be.true; + console.log('Propose external motion through council.......DONE'); + // <<< Propose external motion through council <<< + + // >>> Fast track proposal through technical committee >>> + console.log('Fast track proposal through technical committee.......'); + const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); + const tx5 = api.tx.techCommitteeCollective.propose( + technicalCommitteeThreshold, + fastTrack, + fastTrack.encodedLength, + ); + const events5 = await submitTransactionAsync(alithAccount, tx5); + const result5 = getGenericResult(events5); + expect(result5.success).to.be.true; + + const encodedFastTrack = fastTrack?.method.toHex() || ''; + const fastTrackHash = blake2AsHex(encodedFastTrack); + console.log('FastTrack hash is %s', fastTrackHash); + + const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1; + const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true); + { + const events6 = await submitTransactionAsync(baltatharAccount, tx6); + const result6 = getGenericResult(events6); + expect(result6.success).to.be.true; + } + { + const events6 = await submitTransactionAsync(alithAccount, tx6); + const result6 = getGenericResult(events6); + expect(result6.success).to.be.true; + } + + const tx7 = api.tx.techCommitteeCollective + .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength); + const events7 = await submitTransactionAsync(baltatharAccount, tx7); + const result7 = getGenericResult(events7); + expect(result7.success).to.be.true; + console.log('Fast track proposal through technical committee.......DONE'); + // <<< Fast track proposal through technical committee <<< + + // >>> Referendum voting >>> + console.log('Referendum voting.......'); + const tx8 = api.tx.democracy.vote( + 0, + {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}}, + ); + const events8 = await submitTransactionAsync(dorothyAccount, tx8); + const result8 = getGenericResult(events8); + expect(result8.success).to.be.true; + console.log('Referendum voting.......DONE'); + // <<< Referendum voting <<< + + // >>> Acquire Quartz AssetId Info on Moonriver >>> + console.log('Acquire Quartz AssetId Info on Moonriver.......'); + + // Wait for the democracy execute + await waitNewBlocks(api, 5); + + assetId = (await api.query.assetManager.assetTypeId({ + XCM: sourceLocation, + })).toString(); + + console.log('QTZ asset ID is %s', assetId); + console.log('Acquire Quartz AssetId Info on Moonriver.......DONE'); + // >>> Acquire Quartz AssetId Info on Moonriver >>> + + // >>> Sponsoring random Account >>> + console.log('Sponsoring random Account.......'); + const tx10 = api.tx.balances.transfer(randomAccountMoonriver.address, 11_000_000_000_000_000_000n); + const events10 = await submitTransactionAsync(baltatharAccount, tx10); + const result10 = getGenericResult(events10); + expect(result10.success).to.be.true; + console.log('Sponsoring random Account.......DONE'); + // <<< Sponsoring random Account <<< + + [balanceMovrTokenInit] = await getBalance(api, [randomAccountMoonriver.address]); + }, + moonriverOptions(), + ); + + await usingApi(async (api) => { + const tx0 = api.tx.balances.transfer(randomAccountQuartz.address, 10n * TRANSFER_AMOUNT); + const events0 = await submitTransactionAsync(quartzAlice, tx0); + const result0 = getGenericResult(events0); + expect(result0.success).to.be.true; + + [balanceQuartzTokenInit] = await getBalance(api, [randomAccountQuartz.address]); + }); + }); + + it('Should connect and send QTZ to Moonriver', async () => { + await usingApi(async (api) => { + const currencyId = { + NativeAssetId: 'Here', + }; + const dest = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: MOONRIVER_CHAIN}, + {AccountKey20: {network: 'Any', key: randomAccountMoonriver.address}}, + ], + }, + }, + }; + const amount = TRANSFER_AMOUNT; + const destWeight = 850000000; + + const tx = api.tx.xTokens.transfer(currencyId, amount, dest, destWeight); + const events = await submitTransactionAsync(randomAccountQuartz, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccountQuartz.address]); + expect(balanceQuartzTokenMiddle < balanceQuartzTokenInit).to.be.true; + + const transactionFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT; + console.log('[Quartz -> Moonriver] transaction fees on Quartz: %s QTZ', transactionFees); + expect(transactionFees > 0).to.be.true; + }); + + await usingApi( + async (api) => { + await waitNewBlocks(api, 3); + + [balanceMovrTokenMiddle] = await getBalance(api, [randomAccountMoonriver.address]); + + const movrFees = balanceMovrTokenInit - balanceMovrTokenMiddle; + console.log('[Quartz -> Moonriver] transaction fees on Moonriver: %s MOVR', movrFees); + expect(movrFees == 0n).to.be.true; + + const qtzRandomAccountAsset = ( + await api.query.assets.account(assetId, randomAccountMoonriver.address) + ).toJSON()! as any; + + balanceForeignQtzTokenMiddle = BigInt(qtzRandomAccountAsset['balance']); + const qtzIncomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenInit; + console.log('[Quartz -> Moonriver] income %s QTZ', qtzIncomeTransfer); + expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true; + }, + moonriverOptions(), + ); + }); + + it('Should connect to Moonriver and send QTZ back', async () => { + await usingApi( + async (api) => { + const asset = { + V1: { + id: { + Concrete: { + parents: 1, + interior: { + X1: {Parachain: QUARTZ_CHAIN}, + }, + }, + }, + fun: { + Fungible: TRANSFER_AMOUNT, + }, + }, + }; + const destination = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: QUARTZ_CHAIN}, + {AccountId32: {network: 'Any', id: randomAccountQuartz.addressRaw}}, + ], + }, + }, + }; + const destWeight = 50000000; + + const tx = api.tx.xTokens.transferMultiasset(asset, destination, destWeight); + const events = await submitTransactionAsync(randomAccountMoonriver, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + [balanceMovrTokenFinal] = await getBalance(api, [randomAccountMoonriver.address]); + + const movrFees = balanceMovrTokenMiddle - balanceMovrTokenFinal; + console.log('[Moonriver -> Quartz] transaction fees on Moonriver: %s MOVR', movrFees); + expect(movrFees > 0).to.be.true; + + const qtzRandomAccountAsset = ( + await api.query.assets.account(assetId, randomAccountMoonriver.address) + ).toJSON()! as any; + + expect(qtzRandomAccountAsset).to.be.null; + + balanceForeignQtzTokenFinal = 0n; + + const qtzOutcomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenFinal; + console.log('[Quartz -> Moonriver] outcome %s QTZ', qtzOutcomeTransfer); + expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; + }, + moonriverOptions(), + ); + + await usingApi(async (api) => { + await waitNewBlocks(api, 3); + + [balanceQuartzTokenFinal] = await getBalance(api, [randomAccountQuartz.address]); + const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle; + expect(actuallyDelivered > 0).to.be.true; + + console.log('[Moonriver -> Quartz] actually delivered %s QTZ', actuallyDelivered); + + const qtzFees = TRANSFER_AMOUNT - actuallyDelivered; + console.log('[Moonriver -> Quartz] transaction fees on Quartz: %s QTZ', qtzFees); + expect(qtzFees == 0n).to.be.true; + }); + }); +}); From ebc4cdb8a3c4566899e7d3ed37895eae4216a82e Mon Sep 17 00:00:00 2001 From: PraetorP Date: Mon, 5 Sep 2022 17:08:51 +0700 Subject: [PATCH 0707/1274] add force methods for collection in `Unique` , add events Stake, Unstake, SetAdmin --- Cargo.lock | 2 +- pallets/app-promotion/src/benchmarking.rs | 2 +- pallets/app-promotion/src/lib.rs | 78 ++++++------------- pallets/app-promotion/src/types.rs | 31 +------- pallets/unique/CHANGELOG.md | 23 ++++-- pallets/unique/Cargo.toml | 2 +- pallets/unique/src/lib.rs | 32 ++++++++ .../common/config/pallets/app_promotion.rs | 8 +- 8 files changed, 79 insertions(+), 99 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6abae7a21b..9dc0caaaf2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6473,7 +6473,7 @@ dependencies = [ [[package]] name = "pallet-unique" -version = "0.1.3" +version = "0.1.4" dependencies = [ "ethereum", "evm-coder", diff --git a/pallets/app-promotion/src/benchmarking.rs b/pallets/app-promotion/src/benchmarking.rs index 17040fa74a..9425cb4a88 100644 --- a/pallets/app-promotion/src/benchmarking.rs +++ b/pallets/app-promotion/src/benchmarking.rs @@ -54,7 +54,7 @@ benchmarks! { payout_stakers{ let pallet_admin = account::("admin", 0, SEED); - let share = Perbill::from_rational(1u32, 10); + let share = Perbill::from_rational(1u32, 100); PromototionPallet::::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?; let _ = ::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); let staker: T::AccountId = account("caller", 0, SEED); diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index acc96651b1..9d7aee0f8e 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -70,17 +70,12 @@ use sp_runtime::{ }; pub const LOCK_IDENTIFIER: [u8; 8] = *b"appstake"; + const PENDING_LIMIT_PER_BLOCK: u32 = 3; type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; -// const SECONDS_TO_BLOCK: u32 = 6; -// const DAY: u32 = 60 * 60 * 24 / SECONDS_TO_BLOCK; -// const WEEK: u32 = 7 * DAY; -// const TWO_WEEK: u32 = 2 * WEEK; -// const YEAR: u32 = DAY * 365; - #[frame_support::pallet] pub mod pallet { use super::*; @@ -115,9 +110,9 @@ pub mod pallet { #[pallet::constant] type PendingInterval: Get; - /// In chain blocks. - #[pallet::constant] - type Day: Get; // useless + // /// In chain blocks. + // #[pallet::constant] + // type Day: Get; // useless #[pallet::constant] type Nominal: Get>; @@ -150,6 +145,9 @@ pub mod pallet { /// Amount of accrued interest BalanceOf, ), + Stake(T::AccountId, BalanceOf), + Unstake(T::AccountId, BalanceOf), + SetAdmin(T::AccountId), } #[pallet::error] @@ -205,9 +203,9 @@ pub mod pallet { ValueQuery, >; - /// A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`. - #[pallet::storage] - pub type StartBlock = StorageValue; + // /// A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`. + // #[pallet::storage] + // pub type StartBlock = StorageValue; // /// Next target block when interest is recalculated // #[pallet::storage] @@ -257,50 +255,14 @@ pub mod pallet { #[pallet::weight(T::WeightInfo::set_admin_address())] pub fn set_admin_address(origin: OriginFor, admin: T::CrossAccountId) -> DispatchResult { ensure_root(origin)?; + >::set(Some(admin.as_sub().to_owned())); + Self::deposit_event(Event::SetAdmin(admin.as_sub().to_owned())); + Ok(()) } - // #[pallet::weight(T::WeightInfo::start_app_promotion())] - // pub fn start_app_promotion( - // origin: OriginFor, - // promotion_start_relay_block: Option, - // ) -> DispatchResult - // where - // ::BlockNumber: From, - // { - // ensure_root(origin)?; - - // // Start app-promotion mechanics if it has not been yet initialized - // if >::get() == 0u32.into() { - // let start_block = promotion_start_relay_block - // .unwrap_or(T::RelayBlockNumberProvider::current_block_number()); - - // // Set promotion global start block - // >::set(start_block); - - // >::set(start_block + T::RecalculationInterval::get()); - // } - - // Ok(()) - // } - - // #[pallet::weight(T::WeightInfo::stop_app_promotion())] - // pub fn stop_app_promotion(origin: OriginFor) -> DispatchResult - // where - // ::BlockNumber: From, - // { - // ensure_root(origin)?; - - // if >::get() != 0u32.into() { - // >::set(T::BlockNumber::default()); - // >::set(T::BlockNumber::default()); - // } - - // Ok(()) - // } - #[pallet::weight(T::WeightInfo::stake())] pub fn stake(staker: OriginFor, amount: BalanceOf) -> DispatchResult { let staker_id = ensure_signed(staker)?; @@ -350,6 +312,9 @@ pub mod pallet { ); StakesPerAccount::::mutate(&staker_id, |stakes| *stakes += 1); + + Self::deposit_event(Event::Stake(staker_id, amount)); + Ok(()) } @@ -392,6 +357,8 @@ pub mod pallet { StakesPerAccount::::remove(&staker_id); + Self::deposit_event(Event::Unstake(staker_id, total_staked)); + Ok(None.into()) } @@ -527,13 +494,13 @@ pub mod pallet { // } // } // } - + { let mut stakers_number = stakers_number.unwrap_or(20); - let last_id = RefCell::new(None); + let last_id = RefCell::new(None); let income_acc = RefCell::new(BalanceOf::::default()); let amount_acc = RefCell::new(BalanceOf::::default()); - + let flush_stake = || -> DispatchResult { if let Some(last_id) = &*last_id.borrow() { if !income_acc.borrow().is_zero() { @@ -573,7 +540,7 @@ pub mod pallet { }; *last_id.borrow_mut() = Some(current_id.clone()); if current_recalc_block >= next_recalc_block_for_stake { - *amount_acc.borrow_mut() += amount; + *amount_acc.borrow_mut() += amount; Self::recalculate_and_insert_stake( ¤t_id, staked_block, @@ -589,7 +556,6 @@ pub mod pallet { flush_stake()?; } - Ok(()) } } diff --git a/pallets/app-promotion/src/types.rs b/pallets/app-promotion/src/types.rs index 2abd5bc90a..e58f910c03 100644 --- a/pallets/app-promotion/src/types.rs +++ b/pallets/app-promotion/src/types.rs @@ -5,7 +5,7 @@ use frame_support::{ use pallet_balances::{BalanceLock, Config as BalancesConfig, Pallet as PalletBalances}; use pallet_common::CollectionHandle; -use pallet_unique::{Event as UniqueEvent, Error as UniqueError}; + use sp_runtime::DispatchError; use up_data_structs::{CollectionId, SponsorshipState}; use sp_std::borrow::ToOwned; @@ -53,36 +53,11 @@ impl CollectionHandler for pallet_unique::Pallet { sponsor_id: Self::AccountId, collection_id: Self::CollectionId, ) -> DispatchResult { - let mut target_collection = >::try_get(collection_id)?; - target_collection.check_is_internal()?; - target_collection.set_sponsor(sponsor_id.clone())?; - - Self::deposit_event(UniqueEvent::::CollectionSponsorSet( - collection_id, - sponsor_id.clone(), - )); - - ensure!( - target_collection.confirm_sponsorship(&sponsor_id)?, - UniqueError::::ConfirmUnsetSponsorFail - ); - - Self::deposit_event(UniqueEvent::::SponsorshipConfirmed( - collection_id, - sponsor_id, - )); - - target_collection.save() + Self::force_set_sponsor(sponsor_id, collection_id) } fn remove_collection_sponsor(collection_id: Self::CollectionId) -> DispatchResult { - let mut target_collection = >::try_get(collection_id)?; - target_collection.check_is_internal()?; - target_collection.sponsorship = SponsorshipState::Disabled; - - Self::deposit_event(UniqueEvent::::CollectionSponsorRemoved(collection_id)); - - target_collection.save() + Self::force_remove_collection_sponsor(collection_id) } fn get_sponsor( diff --git a/pallets/unique/CHANGELOG.md b/pallets/unique/CHANGELOG.md index 5e8beeffe9..82baf20ca8 100644 --- a/pallets/unique/CHANGELOG.md +++ b/pallets/unique/CHANGELOG.md @@ -3,22 +3,27 @@ All notable changes to this project will be documented in this file. + +## [v0.1.4] 2022-09-5 + +### Added + ## [v0.1.3] 2022-08-16 ### Other changes -- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a -- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 -- refactor: Remove `#[transactional]` from extrinsics 7fd36cea2f6e00c02c67ccc1de9649ae404efd31 +- refactor: Remove `#[transactional]` from extrinsics 7fd36cea2f6e00c02c67ccc1de9649ae404efd31 Every extrinsic now runs in transaction implicitly, and `#[transactional]` on pallet dispatchable is now meaningless Upstream-Change: https://github.com/paritytech/substrate/issues/10806 -- refactor: Switch to new prefix removal methods 26734e9567589d75cdd99e404eabf11d5a97d975 +- refactor: Switch to new prefix removal methods 26734e9567589d75cdd99e404eabf11d5a97d975 New methods allows to call `remove_prefix` with limit multiple times in the same block @@ -27,10 +32,12 @@ straightforward Upstream-Change: https://github.com/paritytech/substrate/pull/11490 -- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b ## [v0.1.1] - 2022-07-25 + ### Added -- Method for creating `ERC721Metadata` compatible NFT collection. -- Method for creating `ERC721Metadata` compatible ReFungible collection. -- Method for creating ReFungible collection. + +- Method for creating `ERC721Metadata` compatible NFT collection. +- Method for creating `ERC721Metadata` compatible ReFungible collection. +- Method for creating ReFungible collection. diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index 67fae52d66..8cadf6f034 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -9,7 +9,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'pallet-unique' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = "0.1.3" +version = "0.1.4" [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index 9940938474..ca0535808c 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -1103,3 +1103,35 @@ decl_module! { } } } + +impl Pallet { + pub fn force_set_sponsor(sponsor: T::AccountId, collection_id: CollectionId) -> DispatchResult { + let mut target_collection = >::try_get(collection_id)?; + target_collection.check_is_internal()?; + target_collection.set_sponsor(sponsor.clone())?; + + Self::deposit_event(Event::::CollectionSponsorSet( + collection_id, + sponsor.clone(), + )); + + ensure!( + target_collection.confirm_sponsorship(&sponsor)?, + Error::::ConfirmUnsetSponsorFail + ); + + Self::deposit_event(Event::::SponsorshipConfirmed(collection_id, sponsor)); + + target_collection.save() + } + + pub fn force_remove_collection_sponsor(collection_id: CollectionId) -> DispatchResult { + let mut target_collection = >::try_get(collection_id)?; + target_collection.check_is_internal()?; + target_collection.sponsorship = SponsorshipState::Disabled; + + Self::deposit_event(Event::::CollectionSponsorRemoved(collection_id)); + + target_collection.save() + } +} diff --git a/runtime/common/config/pallets/app_promotion.rs b/runtime/common/config/pallets/app_promotion.rs index 6155a24066..49454491a4 100644 --- a/runtime/common/config/pallets/app_promotion.rs +++ b/runtime/common/config/pallets/app_promotion.rs @@ -22,7 +22,7 @@ use crate::{ use frame_support::{parameter_types, PalletId}; use sp_arithmetic::Perbill; use up_common::{ - constants::{DAYS, UNIQUE, RELAY_DAYS}, + constants::{ UNIQUE, RELAY_DAYS}, types::Balance, }; @@ -32,7 +32,7 @@ parameter_types! { pub const RecalculationInterval: BlockNumber = 20; pub const PendingInterval: BlockNumber = 10; pub const Nominal: Balance = UNIQUE; - pub const Day: BlockNumber = DAYS; + // pub const Day: BlockNumber = DAYS; pub IntervalIncome: Perbill = Perbill::from_rational(RecalculationInterval::get(), RELAY_DAYS) * Perbill::from_rational(5u32, 10_000); } @@ -42,7 +42,7 @@ parameter_types! { pub const RecalculationInterval: BlockNumber = RELAY_DAYS; pub const PendingInterval: BlockNumber = 7 * RELAY_DAYS; pub const Nominal: Balance = UNIQUE; - pub const Day: BlockNumber = RELAY_DAYS; + // pub const Day: BlockNumber = RELAY_DAYS; pub IntervalIncome: Perbill = Perbill::from_rational(5u32, 10_000); } @@ -56,7 +56,7 @@ impl pallet_app_promotion::Config for Runtime { type RelayBlockNumberProvider = RelayChainBlockNumberProvider; type RecalculationInterval = RecalculationInterval; type PendingInterval = PendingInterval; - type Day = Day; + // type Day = Day; type Nominal = Nominal; type IntervalIncome = IntervalIncome; type Event = Event; From d190a670c95bd7e20b92d4027bbf632b7fbd4b03 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 5 Sep 2022 13:05:03 +0000 Subject: [PATCH 0708/1274] feat: Add events for set contract sponsoring. --- Cargo.lock | 1 + pallets/evm-contract-helpers/Cargo.toml | 1 + pallets/evm-contract-helpers/src/eth.rs | 39 +++++++++- pallets/evm-contract-helpers/src/lib.rs | 73 ++++++++++++++++++- runtime/common/config/ethereum.rs | 1 + .../common/config/pallets/app_promotion.rs | 2 +- runtime/common/construct_runtime/mod.rs | 2 +- 7 files changed, 110 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9dc0caaaf2..b3f5ef0d5c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5735,6 +5735,7 @@ dependencies = [ name = "pallet-evm-contract-helpers" version = "0.2.0" dependencies = [ + "ethereum", "evm-coder", "fp-evm-mapping", "frame-support", diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index a6dc361efb..26597d1452 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -9,6 +9,7 @@ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } log = { default-features = false, version = "0.4.14" } +ethereum = { version = "0.12.0", default-features = false } # Substrate frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 63a0a3ce6c..08cd198931 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -17,7 +17,9 @@ //! Implementation of magic contract use core::marker::PhantomData; -use evm_coder::{abi::AbiWriter, execution::Result, generate_stubgen, solidity_interface, types::*}; +use evm_coder::{ + abi::AbiWriter, execution::Result, generate_stubgen, solidity_interface, types::*, ToLog, +}; use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder, dispatch_to_evm}; use pallet_evm::{ ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure, PrecompileHandle, @@ -33,6 +35,37 @@ use frame_support::traits::Get; use up_sponsorship::SponsorshipHandler; use sp_std::vec::Vec; +/// Pallet events. +#[derive(ToLog)] +pub enum ContractHelpersEvents { + /// Contract sponsor was set. + ContractSponsorSet { + /// Contract address of the affected collection. + #[indexed] + contract: address, + /// New sponsor address. + #[indexed] + sponsor: address, + }, + + /// New sponsor was confirm. + ContractSponsorshipConfirmed { + /// Contract address of the affected collection. + #[indexed] + contract: address, + /// New sponsor address. + #[indexed] + sponsor: address, + }, + + /// Collection sponsor was removed. + ContractSponsorRemoved { + /// Contract address of the affected collection. + #[indexed] + contract: address, + }, +} + /// See [`ContractHelpersCall`] pub struct ContractHelpers(SubstrateRecorder); impl WithRecorder for ContractHelpers { @@ -46,7 +79,7 @@ impl WithRecorder for ContractHelpers { } /// @title Magic contract, which allows users to reconfigure other contracts -#[solidity_interface(name = ContractHelpers)] +#[solidity_interface(name = ContractHelpers, events(ContractHelpersEvents))] impl ContractHelpers where T::AccountId: AsRef<[u8; 32]>, @@ -91,7 +124,7 @@ where self.recorder().consume_sload()?; self.recorder().consume_sstore()?; - Pallet::::self_sponsored_enable(&T::CrossAccountId::from_eth(caller), contract_address) + Pallet::::force_set_sponsor(&T::CrossAccountId::from_eth(caller), contract_address) .map_err(dispatch_to_evm::)?; Ok(()) diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index f7069fef28..ed70113ea8 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -16,7 +16,7 @@ #![doc = include_str!("../README.md")] #![cfg_attr(not(feature = "std"), no_std)] -#![deny(missing_docs)] +#![warn(missing_docs)] use codec::{Decode, Encode, MaxEncodedLen}; pub use pallet::*; @@ -27,18 +27,24 @@ pub mod eth; #[frame_support::pallet] pub mod pallet { pub use super::*; + use crate::eth::ContractHelpersEvents; use frame_support::pallet_prelude::*; use pallet_evm_coder_substrate::DispatchResult; use sp_core::H160; - use pallet_evm::account::CrossAccountId; + use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; use up_data_structs::SponsorshipState; + use evm_coder::ToLog; #[pallet::config] pub trait Config: frame_system::Config + pallet_evm_coder_substrate::Config + pallet_evm::account::Config { + /// Overarching event type. + type Event: IsType<::Event> + From>; + /// Address, under which magic contract will be available type ContractAddress: Get; + /// In case of enabled sponsoring, but no sponsoring rate limit set, /// this value will be used implicitly type DefaultSponsoringRateLimit: Get; @@ -150,6 +156,32 @@ pub mod pallet { QueryKind = ValueQuery, >; + #[pallet::event] + #[pallet::generate_deposit(pub fn deposit_event)] + pub enum Event { + /// Contract sponsor was set. + ContractSponsorSet( + /// Contract address of the affected collection. + H160, + /// New sponsor address. + T::AccountId, + ), + + /// New sponsor was confirm. + ContractSponsorshipConfirmed( + /// Contract address of the affected collection. + H160, + /// New sponsor address. + T::AccountId, + ), + + /// Collection sponsor was removed. + ContractSponsorRemoved( + /// Contract address of the affected collection. + H160, + ), + } + impl Pallet { /// Get contract owner. pub fn contract_owner(contract: H160) -> H160 { @@ -169,13 +201,25 @@ pub mod pallet { contract, SponsorshipState::::Unconfirmed(sponsor.clone()), ); + + >::deposit_event(Event::::ContractSponsorSet( + contract, + sponsor.as_sub().clone(), + )); + >::deposit_log( + ContractHelpersEvents::ContractSponsorSet { + contract, + sponsor: *sponsor.as_eth(), + } + .to_log(contract), + ); Ok(()) } - /// Set `contract` as self sponsored. + /// Set sponsor as already confirmed. /// /// `sender` must be owner of contract. - pub fn self_sponsored_enable(sender: &T::CrossAccountId, contract: H160) -> DispatchResult { + pub fn force_set_sponsor(sender: &T::CrossAccountId, contract: H160) -> DispatchResult { Pallet::::ensure_owner(contract, *sender.as_eth())?; Sponsoring::::insert( contract, @@ -192,6 +236,12 @@ pub mod pallet { pub fn remove_sponsor(sender: &T::CrossAccountId, contract: H160) -> DispatchResult { Pallet::::ensure_owner(contract, *sender.as_eth())?; Sponsoring::::remove(contract); + + >::deposit_event(Event::::ContractSponsorRemoved(contract)); + >::deposit_log( + ContractHelpersEvents::ContractSponsorRemoved { contract }.to_log(contract), + ); + Ok(()) } @@ -202,10 +252,25 @@ pub mod pallet { match Sponsoring::::get(contract) { SponsorshipState::Unconfirmed(sponsor) => { ensure!(sponsor == *sender, Error::::NoPermission); + let eth_sponsor = *sponsor.as_eth(); + let sub_sponsor = sponsor.as_sub().clone(); Sponsoring::::insert( contract, SponsorshipState::::Confirmed(sponsor), ); + + >::deposit_event(Event::::ContractSponsorshipConfirmed( + contract, + sub_sponsor, + )); + >::deposit_log( + ContractHelpersEvents::ContractSponsorshipConfirmed { + contract, + sponsor: eth_sponsor, + } + .to_log(contract), + ); + Ok(()) } SponsorshipState::Disabled | SponsorshipState::Confirmed(_) => { diff --git a/runtime/common/config/ethereum.rs b/runtime/common/config/ethereum.rs index 26dee6bece..a713925428 100644 --- a/runtime/common/config/ethereum.rs +++ b/runtime/common/config/ethereum.rs @@ -112,6 +112,7 @@ parameter_types! { } impl pallet_evm_contract_helpers::Config for Runtime { + type Event = Event; type ContractAddress = HelpersContractAddress; type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; } diff --git a/runtime/common/config/pallets/app_promotion.rs b/runtime/common/config/pallets/app_promotion.rs index 49454491a4..114660af35 100644 --- a/runtime/common/config/pallets/app_promotion.rs +++ b/runtime/common/config/pallets/app_promotion.rs @@ -22,7 +22,7 @@ use crate::{ use frame_support::{parameter_types, PalletId}; use sp_arithmetic::Perbill; use up_common::{ - constants::{ UNIQUE, RELAY_DAYS}, + constants::{UNIQUE, RELAY_DAYS}, types::Balance, }; diff --git a/runtime/common/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs index b35708d38d..859e089602 100644 --- a/runtime/common/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -85,7 +85,7 @@ macro_rules! construct_runtime { Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101, EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150, - EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151, + EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage, Event} = 151, EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152, EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153, } From ec123decb7f325474e7295c166ec975f5f9ae89d Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 5 Sep 2022 13:17:41 +0000 Subject: [PATCH 0709/1274] fix: Events for contract sponsoring. --- pallets/evm-contract-helpers/src/eth.rs | 8 ++++-- pallets/evm-contract-helpers/src/lib.rs | 34 ++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 08cd198931..017e50fa6b 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -124,8 +124,12 @@ where self.recorder().consume_sload()?; self.recorder().consume_sstore()?; - Pallet::::force_set_sponsor(&T::CrossAccountId::from_eth(caller), contract_address) - .map_err(dispatch_to_evm::)?; + Pallet::::force_set_sponsor( + &T::CrossAccountId::from_eth(caller), + contract_address, + &T::CrossAccountId::from_eth(contract_address), + ) + .map_err(dispatch_to_evm::)?; Ok(()) } diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index ed70113ea8..05efc799a9 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -219,7 +219,11 @@ pub mod pallet { /// Set sponsor as already confirmed. /// /// `sender` must be owner of contract. - pub fn force_set_sponsor(sender: &T::CrossAccountId, contract: H160) -> DispatchResult { + pub fn force_set_sponsor( + sender: &T::CrossAccountId, + contract: H160, + sponsor: &T::CrossAccountId, + ) -> DispatchResult { Pallet::::ensure_owner(contract, *sender.as_eth())?; Sponsoring::::insert( contract, @@ -227,6 +231,34 @@ pub mod pallet { contract, )), ); + + let eth_sponsor = *sponsor.as_eth(); + let sub_sponsor = sponsor.as_sub().clone(); + + >::deposit_event(Event::::ContractSponsorSet( + contract, + sub_sponsor.clone(), + )); + >::deposit_log( + ContractHelpersEvents::ContractSponsorSet { + contract, + sponsor: eth_sponsor, + } + .to_log(contract), + ); + + >::deposit_event(Event::::ContractSponsorshipConfirmed( + contract, + sub_sponsor, + )); + >::deposit_log( + ContractHelpersEvents::ContractSponsorshipConfirmed { + contract, + sponsor: eth_sponsor, + } + .to_log(contract), + ); + Ok(()) } From 3d198cc268fc4a044f1f4462a7cc30ddb5978413 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 5 Sep 2022 14:15:45 +0000 Subject: [PATCH 0710/1274] fix: unify log create versions --- node/cli/Cargo.toml | 2 +- pallets/evm-contract-helpers/Cargo.toml | 2 +- pallets/foreing-assets/Cargo.toml | 2 +- pallets/scheduler/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index d32eed39b0..398fab6c5c 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -302,7 +302,7 @@ targets = ['x86_64-unknown-linux-gnu'] [dependencies] futures = '0.3.17' -log = '0.4.14' +log = '0.4.16' flexi_logger = "0.22.5" parking_lot = '0.12.1' clap = "3.1.2" diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index a6dc361efb..a88b6e7c42 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -log = { default-features = false, version = "0.4.14" } +log = { default-features = false, version = "0.4.16" } # Substrate frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } diff --git a/pallets/foreing-assets/Cargo.toml b/pallets/foreing-assets/Cargo.toml index 75f99dced0..71212dcf40 100644 --- a/pallets/foreing-assets/Cargo.toml +++ b/pallets/foreing-assets/Cargo.toml @@ -5,7 +5,7 @@ license = "GPLv3" edition = "2021" [dependencies] -log = { version = "0.4.14", default-features = false } +log = { version = "0.4.16", default-features = false } serde = { version = "1.0.136", optional = true } scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } diff --git a/pallets/scheduler/Cargo.toml b/pallets/scheduler/Cargo.toml index 9537aefa15..8ed3ebe8d6 100644 --- a/pallets/scheduler/Cargo.toml +++ b/pallets/scheduler/Cargo.toml @@ -25,7 +25,7 @@ sp-core = { default-features = false, git = 'https://github.com/paritytech/subst frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } -log = { version = "0.4.14", default-features = false } +log = { version = "0.4.16", default-features = false } [dev-dependencies] sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } From dbce17d9b0b2fbfc4be5955e6b90dd9b4fdb39f1 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Mon, 5 Sep 2022 14:16:30 +0000 Subject: [PATCH 0711/1274] test(eth): fix linting errors and warnings --- tests/src/eth/collectionAdmin.test.ts | 15 +++++++-------- tests/src/eth/collectionSponsoring.test.ts | 2 +- tests/src/eth/createNFTCollection.test.ts | 4 ++-- tests/src/eth/createRFTCollection.test.ts | 4 ++-- tests/src/eth/nesting/nest.test.ts | 2 +- tests/src/eth/reFungibleToken.test.ts | 2 +- tests/src/eth/util/playgrounds/index.ts | 2 +- tests/src/eth/util/playgrounds/unique.dev.ts | 16 ++++++++-------- 8 files changed, 23 insertions(+), 24 deletions(-) diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index e525dc4a98..5f5f5e9b37 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -15,7 +15,7 @@ import {expect} from 'chai'; import privateKey from '../substrate/privateKey'; -import { UNIQUE } from '../util/helpers'; +import {UNIQUE} from '../util/helpers'; import { createEthAccount, createEthAccountWithBalance, @@ -24,7 +24,6 @@ import { getCollectionAddressFromResult, itWeb3, recordEthFee, - subToEth, } from './util/helpers'; describe('Add collection admins', () => { @@ -37,7 +36,7 @@ describe('Add collection admins', () => { .send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const newAdmin = await createEthAccount(web3); + const newAdmin = createEthAccount(web3); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); await collectionEvm.methods.addCollectionAdmin(newAdmin).send(); const adminList = await api.rpc.unique.adminlist(collectionId); @@ -92,7 +91,7 @@ describe('Add collection admins', () => { const collectionEvm = evmCollection(web3, owner, collectionIdAddress); await collectionEvm.methods.addCollectionAdmin(admin).send(); - const user = await createEthAccount(web3); + const user = createEthAccount(web3); await expect(collectionEvm.methods.addCollectionAdmin(user).call({from: admin})) .to.be.rejectedWith('NoPermission'); @@ -114,7 +113,7 @@ describe('Add collection admins', () => { const notAdmin = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - const user = await createEthAccount(web3); + const user = createEthAccount(web3); await expect(collectionEvm.methods.addCollectionAdmin(user).call({from: notAdmin})) .to.be.rejectedWith('NoPermission'); @@ -175,7 +174,7 @@ describe('Remove collection admins', () => { .send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const newAdmin = await createEthAccount(web3); + const newAdmin = createEthAccount(web3); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); await collectionEvm.methods.addCollectionAdmin(newAdmin).send(); { @@ -226,7 +225,7 @@ describe('Remove collection admins', () => { const admin0 = await createEthAccountWithBalance(api, web3, privateKeyWrapper); await collectionEvm.methods.addCollectionAdmin(admin0).send(); - const admin1 = await createEthAccount(web3); + const admin1 = createEthAccount(web3); await collectionEvm.methods.addCollectionAdmin(admin1).send(); await expect(collectionEvm.methods.removeCollectionAdmin(admin1).call({from: admin0})) @@ -253,7 +252,7 @@ describe('Remove collection admins', () => { const admin = await createEthAccountWithBalance(api, web3, privateKeyWrapper); await collectionEvm.methods.addCollectionAdmin(admin).send(); - const notAdmin = await createEthAccount(web3); + const notAdmin = createEthAccount(web3); await expect(collectionEvm.methods.removeCollectionAdmin(admin).call({from: notAdmin})) .to.be.rejectedWith('NoPermission'); diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index e0295305ec..05757f5529 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -1,5 +1,5 @@ import {addToAllowListExpectSuccess, bigIntToSub, confirmSponsorshipExpectSuccess, createCollectionExpectSuccess, enablePublicMintingExpectSuccess, getDetailedCollectionInfo, setCollectionSponsorExpectSuccess} from '../util/helpers'; -import {itWeb3, createEthAccount, collectionIdToAddress, GAS_ARGS, normalizeEvents, createEthAccountWithBalance, evmCollectionHelpers, getCollectionAddressFromResult, evmCollection, ethBalanceViaSub, subToEth} from './util/helpers'; +import {itWeb3, createEthAccount, collectionIdToAddress, GAS_ARGS, normalizeEvents, createEthAccountWithBalance, evmCollectionHelpers, getCollectionAddressFromResult, evmCollection, ethBalanceViaSub} from './util/helpers'; import nonFungibleAbi from './nonFungibleAbi.json'; import {expect} from 'chai'; import {evmToAddress} from '@polkadot/util-crypto'; diff --git a/tests/src/eth/createNFTCollection.test.ts b/tests/src/eth/createNFTCollection.test.ts index 5557552fa5..81876aeb12 100644 --- a/tests/src/eth/createNFTCollection.test.ts +++ b/tests/src/eth/createNFTCollection.test.ts @@ -181,7 +181,7 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { }); itWeb3('(!negative test!) Create collection (no funds)', async ({web3}) => { - const owner = await createEthAccount(web3); + const owner = createEthAccount(web3); const helper = evmCollectionHelpers(web3, owner); const collectionName = 'A'; const description = 'A'; @@ -194,7 +194,7 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { itWeb3('(!negative test!) Check owner', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const notOwner = await createEthAccount(web3); + const notOwner = createEthAccount(web3); const collectionHelpers = evmCollectionHelpers(web3, owner); const result = await collectionHelpers.methods.createNonfungibleCollection('A', 'A', 'A').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts index 77a7b6dbbb..edb523b987 100644 --- a/tests/src/eth/createRFTCollection.test.ts +++ b/tests/src/eth/createRFTCollection.test.ts @@ -189,7 +189,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { }); itWeb3('(!negative test!) Create collection (no funds)', async ({web3}) => { - const owner = await createEthAccount(web3); + const owner = createEthAccount(web3); const helper = evmCollectionHelpers(web3, owner); const collectionName = 'A'; const description = 'A'; @@ -202,7 +202,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { itWeb3('(!negative test!) Check owner', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const notOwner = await createEthAccount(web3); + const notOwner = createEthAccount(web3); const collectionHelpers = evmCollectionHelpers(web3, owner); const result = await collectionHelpers.methods.createRefungibleCollection('A', 'A', 'A').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); diff --git a/tests/src/eth/nesting/nest.test.ts b/tests/src/eth/nesting/nest.test.ts index 62d31db507..5a8c6b72ca 100644 --- a/tests/src/eth/nesting/nest.test.ts +++ b/tests/src/eth/nesting/nest.test.ts @@ -1,7 +1,7 @@ import {IKeyringPair} from '@polkadot/types/types'; import {Contract} from 'web3-eth-contract'; -import {itEth, EthUniqueHelper, usingEthPlaygrounds, expect} from '../util/playgrounds' +import {itEth, EthUniqueHelper, usingEthPlaygrounds, expect} from '../util/playgrounds'; const createNestingCollection = async ( helper: EthUniqueHelper, diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 70c3bce0a6..c85fbacc87 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {approve, createCollection, createRefungibleToken, transfer, transferFrom, UNIQUE, requirePallets, Pallets} from '../util/helpers'; -import {collectionIdFromAddress, collectionIdToAddress, createEthAccount, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, evmCollection, evmCollectionHelpers, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from './util/helpers'; +import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, createRefungibleCollection, evmCollection, evmCollectionHelpers, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth, uniqueRefungible, uniqueRefungibleToken} from './util/helpers'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; diff --git a/tests/src/eth/util/playgrounds/index.ts b/tests/src/eth/util/playgrounds/index.ts index ca67eee549..c7cffe4fe5 100644 --- a/tests/src/eth/util/playgrounds/index.ts +++ b/tests/src/eth/util/playgrounds/index.ts @@ -33,7 +33,7 @@ export const usingEthPlaygrounds = async (code: (helper: EthUniqueHelper, privat await helper.disconnectWeb3(); silentConsole.disable(); } -} +}; export async function itEth(name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean } = {}) { let i: any = it; diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index 1dd1158423..0e4169fce1 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -38,18 +38,18 @@ class EthGroupBase { class ContractGroup extends EthGroupBase { async findImports(imports?: ContractImports[]){ if(!imports) return function(path: string) { - return {error: 'File not found'}; + return {error: `File not found: ${path}`}; }; const knownImports = {} as any; - for(let imp of imports) { + for(const imp of imports) { knownImports[imp.solPath] = (await readFile(imp.fsPath)).toString(); } return function(path: string) { - if(knownImports.hasOwnProperty(path)) return {contents: knownImports[path]}; - return {error: 'File not found'}; - } + if(knownImports.hasOwnPropertyDescriptor(path)) return {contents: knownImports[path]}; + return {error: `File not found: ${path}`}; + }; } async compile(name: string, src: string, imports?: ContractImports[]): Promise { @@ -85,7 +85,7 @@ class ContractGroup extends EthGroupBase { const contract = new web3.eth.Contract(abi, undefined, { data: object, from: signer, - gas: this.helper.eth.DEFAULT_GAS + gas: this.helper.eth.DEFAULT_GAS, }); return await contract.deploy({data: object}).send({from: signer}); } @@ -108,7 +108,7 @@ class NativeContractGroup extends EthGroupBase { const abi = { 'nft': nonFungibleAbi, 'rft': refungibleAbi, - 'ft': fungibleAbi + 'ft': fungibleAbi, }[mode]; const web3 = this.helper.getWeb3(); return new web3.eth.Contract(abi as any, address, {gas: this.helper.eth.DEFAULT_GAS, ...(caller ? {from: caller} : {})}); @@ -154,7 +154,7 @@ class EthGroup extends EthGroupBase { await this.helper.executeExtrinsic( signer, 'api.tx.evm.call', [this.helper.address.substrateToEth(signer.address), contractAddress, abi, value, gasLimit, gasPrice, null, null, []], - true, `Unable to perform evm.call` + true, 'Unable to perform evm.call', ); } From 5a5760e9d7e0ad345b604c22a78ef3c890ce0710 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Mon, 5 Sep 2022 14:17:13 +0000 Subject: [PATCH 0712/1274] test(util): fix linting warnings --- tests/src/util/playgrounds/unique.dev.ts | 19 +++++++++---------- tests/src/util/playgrounds/unique.ts | 5 +++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 6717320a81..e9d8bc9e3e 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -9,7 +9,7 @@ import {IKeyringPair} from '@polkadot/types/types'; export class SilentLogger { - log(msg: any, level: any): void { } + log(_msg: any, _level: any): void { } level = { ERROR: 'ERROR' as const, WARNING: 'WARNING' as const, @@ -34,12 +34,10 @@ export class SilentConsole { enable() { const outFn = (printer: any) => (...args: any[]) => { for (const arg of args) { - for (const arg of args) { - if (typeof arg !== 'string') - continue; - if (arg.includes('1000:: Normal connection closure') || arg.includes('Not decorating unknown runtime apis: UniqueApi/2, RmrkApi/1') || arg.includes('RPC methods not decorated:') || arg === 'Normal connection closure') - return; - } + if (typeof arg !== 'string') + continue; + if (arg.includes('1000:: Normal connection closure') || arg.includes('Not decorating unknown runtime apis: UniqueApi/2, RmrkApi/1') || arg.includes('RPC methods not decorated:') || arg === 'Normal connection closure') + return; } printer(...args); }; @@ -68,7 +66,7 @@ export class DevUniqueHelper extends UniqueHelper { this.arrange = new ArrangeGroup(this); } - async connect(wsEndpoint: string, listeners?: any): Promise { + async connect(wsEndpoint: string/*, listeners?: any*/): Promise { const wsProvider = new WsProvider(wsEndpoint); this.api = new ApiPromise({ provider: wsProvider, @@ -133,7 +131,7 @@ class ArrangeGroup { } } - await Promise.all(transactions).catch(e => {}); + await Promise.all(transactions).catch(_e => {}); //#region TODO remove this region, when nonce problem will be solved const checkBalances = async () => { @@ -162,13 +160,14 @@ class ArrangeGroup { return accounts; }; - + /** * Wait for specified bnumber of blocks * @param blocksCount number of blocks to wait * @returns */ async waitNewBlocks(blocksCount = 1): Promise { + // eslint-disable-next-line no-async-promise-executor const promise = new Promise(async (resolve) => { const unsubscribe = await this.helper.api!.rpc.chain.subscribeNewHeads(() => { if (blocksCount > 0) { diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 7f09252475..f7eb718246 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -317,6 +317,7 @@ class ChainHelperBase { if(options !== null) return transaction.signAndSend(sender, options, callback); return transaction.signAndSend(sender, callback); }; + // eslint-disable-next-line no-async-promise-executor return new Promise(async (resolve, reject) => { try { const unsub = await sign((result: any) => { @@ -1100,11 +1101,11 @@ class NFTnRFT extends CollectionGroup { return this.getCollectionObject(this.helper.util.extractCollectionIdFromCreationResult(creationResult, errorLabel)); } - getCollectionObject(collectionId: number): any { + getCollectionObject(_collectionId: number): any { return null; } - getTokenObject(collectionId: number, tokenId: number): any { + getTokenObject(_collectionId: number, _tokenId: number): any { return null; } } From 7803dcf348329b250d526f1025ee7138b961506b Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 5 Sep 2022 21:20:52 +0700 Subject: [PATCH 0713/1274] add launch-config-xcm-unique-rococo --- .../launch-config-xcm-unique-rococo.json | 202 ++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 .docker/xcm-config/launch-config-xcm-unique-rococo.json diff --git a/.docker/xcm-config/launch-config-xcm-unique-rococo.json b/.docker/xcm-config/launch-config-xcm-unique-rococo.json new file mode 100644 index 0000000000..81675e0eda --- /dev/null +++ b/.docker/xcm-config/launch-config-xcm-unique-rococo.json @@ -0,0 +1,202 @@ +{ + "relaychain": { + "bin": "/polkadot/target/release/polkadot", + "chain": "rococo-local", + "chainInitializer": [ + "chainql", + "--tla-code=spec=import '${spec}'", + "5validators.jsonnet" + ], + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + } + + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "/unique-chain/target/release/unique-collator", + "id": "2037", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "-lruntime=trace", + "-lxcm=trace", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + }, + { + "bin": "/acala/target/release/acala", + "id": "2000", + "chain": "acala-dev", + "balance": "1000000000000000000000", + "nodes": [ + { + "wsPort": 9946, + "port": 31202, + "name": "alice", + "flags": [ + "-lruntime=trace", + "-lxcm=trace", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + }, + { + "bin": "/moonbeam/target/release/moonbeam", + "id": "2004", + "balance": "1000000000000000000000", + "chain": "moonbeam-local", + "nodes": [ + { + "wsPort": 9947, + "port": 31203, + "name": "alice", + "flags": [ + "-lruntime=trace", + "-lxcm=trace", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "--", + "--execution=wasm" + ] + } + ] + }, + { + "bin": "/cumulus/target/release/cumulus", + "id": "1000", + "chain": "statemint-local", + "balance": "1000000000000000000000000", + "nodes": [ + { + "wsPort": 9948, + "port": 31204, + "name": "alice", + "flags": [ + "-lruntime=trace", + "-lxcm=trace", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [ + { + "sender": 2037, + "recipient": 2000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2000, + "recipient": 2037, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2037, + "recipient": 2004, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2004, + "recipient": 2037, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2037, + "recipient": 1000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 1000, + "recipient": 2037, + "maxCapacity": 8, + "maxMessageSize": 512 + } + ], + "finalization": false +} + From 45d665209f0764f085cb519c599bcaa16914c7ec Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Mon, 5 Sep 2022 14:39:20 +0000 Subject: [PATCH 0714/1274] test(util): refactor removing unused variable from signature --- tests/src/util/playgrounds/unique.dev.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 814efa539e..8a9ae099a5 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -66,7 +66,7 @@ export class DevUniqueHelper extends UniqueHelper { this.arrange = new ArrangeGroup(this); } - async connect(wsEndpoint: string/*, listeners?: any*/): Promise { + async connect(wsEndpoint: string, _listeners?: any): Promise { const wsProvider = new WsProvider(wsEndpoint); this.api = new ApiPromise({ provider: wsProvider, From 837c29c459b6244903097fbe8c7fcc3810f6ecf7 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 5 Sep 2022 14:57:13 +0000 Subject: [PATCH 0715/1274] fix: Rename event field name. test: Add eth test for contract sponsor events. --- pallets/evm-contract-helpers/src/eth.rs | 8 +- pallets/evm-contract-helpers/src/lib.rs | 44 ++++----- .../src/stubs/ContractHelpers.raw | Bin 1742 -> 1742 bytes .../src/stubs/ContractHelpers.sol | 12 ++- tests/src/eth/api/ContractHelpers.sol | 12 ++- tests/src/eth/contractSponsoring.test.ts | 90 ++++++++++++++++++ tests/src/eth/util/contractHelpersAbi.json | 51 ++++++++++ 7 files changed, 188 insertions(+), 29 deletions(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 017e50fa6b..dc0beca65a 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -42,9 +42,8 @@ pub enum ContractHelpersEvents { ContractSponsorSet { /// Contract address of the affected collection. #[indexed] - contract: address, + contract_address: address, /// New sponsor address. - #[indexed] sponsor: address, }, @@ -52,9 +51,8 @@ pub enum ContractHelpersEvents { ContractSponsorshipConfirmed { /// Contract address of the affected collection. #[indexed] - contract: address, + contract_address: address, /// New sponsor address. - #[indexed] sponsor: address, }, @@ -62,7 +60,7 @@ pub enum ContractHelpersEvents { ContractSponsorRemoved { /// Contract address of the affected collection. #[indexed] - contract: address, + contract_address: address, }, } diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index 05efc799a9..df014e82de 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -208,7 +208,7 @@ pub mod pallet { )); >::deposit_log( ContractHelpersEvents::ContractSponsorSet { - contract, + contract_address: contract, sponsor: *sponsor.as_eth(), } .to_log(contract), @@ -221,14 +221,14 @@ pub mod pallet { /// `sender` must be owner of contract. pub fn force_set_sponsor( sender: &T::CrossAccountId, - contract: H160, + contract_address: H160, sponsor: &T::CrossAccountId, ) -> DispatchResult { - Pallet::::ensure_owner(contract, *sender.as_eth())?; + Pallet::::ensure_owner(contract_address, *sender.as_eth())?; Sponsoring::::insert( - contract, + contract_address, SponsorshipState::::Confirmed(T::CrossAccountId::from_eth( - contract, + contract_address, )), ); @@ -236,27 +236,27 @@ pub mod pallet { let sub_sponsor = sponsor.as_sub().clone(); >::deposit_event(Event::::ContractSponsorSet( - contract, + contract_address, sub_sponsor.clone(), )); >::deposit_log( ContractHelpersEvents::ContractSponsorSet { - contract, + contract_address, sponsor: eth_sponsor, } - .to_log(contract), + .to_log(contract_address), ); >::deposit_event(Event::::ContractSponsorshipConfirmed( - contract, + contract_address, sub_sponsor, )); >::deposit_log( ContractHelpersEvents::ContractSponsorshipConfirmed { - contract, + contract_address, sponsor: eth_sponsor, } - .to_log(contract), + .to_log(contract_address), ); Ok(()) @@ -265,13 +265,13 @@ pub mod pallet { /// Remove sponsor for `contract`. /// /// `sender` must be owner of contract. - pub fn remove_sponsor(sender: &T::CrossAccountId, contract: H160) -> DispatchResult { - Pallet::::ensure_owner(contract, *sender.as_eth())?; - Sponsoring::::remove(contract); + pub fn remove_sponsor(sender: &T::CrossAccountId, contract_address: H160) -> DispatchResult { + Pallet::::ensure_owner(contract_address, *sender.as_eth())?; + Sponsoring::::remove(contract_address); - >::deposit_event(Event::::ContractSponsorRemoved(contract)); + >::deposit_event(Event::::ContractSponsorRemoved(contract_address)); >::deposit_log( - ContractHelpersEvents::ContractSponsorRemoved { contract }.to_log(contract), + ContractHelpersEvents::ContractSponsorRemoved { contract_address }.to_log(contract_address), ); Ok(()) @@ -280,27 +280,27 @@ pub mod pallet { /// Confirm sponsorship. /// /// `sender` must be same that set via [`set_sponsor`]. - pub fn confirm_sponsorship(sender: &T::CrossAccountId, contract: H160) -> DispatchResult { - match Sponsoring::::get(contract) { + pub fn confirm_sponsorship(sender: &T::CrossAccountId, contract_address: H160) -> DispatchResult { + match Sponsoring::::get(contract_address) { SponsorshipState::Unconfirmed(sponsor) => { ensure!(sponsor == *sender, Error::::NoPermission); let eth_sponsor = *sponsor.as_eth(); let sub_sponsor = sponsor.as_sub().clone(); Sponsoring::::insert( - contract, + contract_address, SponsorshipState::::Confirmed(sponsor), ); >::deposit_event(Event::::ContractSponsorshipConfirmed( - contract, + contract_address, sub_sponsor, )); >::deposit_log( ContractHelpersEvents::ContractSponsorshipConfirmed { - contract, + contract_address, sponsor: eth_sponsor, } - .to_log(contract), + .to_log(contract_address), ); Ok(()) diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw index b2a38a375eb4d0262dfea0ef0c44d978bed5db45..b8af457685e5b493010bd3137019db9e7e47de46 100644 GIT binary patch delta 44 zcmV+{0Mq}@4bBa)eFh*#&7}J0qc6(hXv5?Aue6`UG_mw;#g@R3+g+6Hk~5-{odz*E CG8tt6 delta 44 zcmV+{0Mq}@4bBa)eFh+jfLlx6@xR1jXv~I8S0SE5recY==WeiO_2z^C-N { @@ -36,6 +37,33 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; }); + itWeb3.only('Set self sponsored events', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + + const result = await helpers.methods.selfSponsoredEnable(flipper.options.address).send(); + const events = normalizeEvents(result.events); + expect(events).to.be.deep.equal([ + { + address: flipper.options.address, + event: 'ContractSponsorSet', + args: { + contractAddress: flipper.options.address, + sponsor: flipper.options.address, + }, + }, + { + address: flipper.options.address, + event: 'ContractSponsorshipConfirmed', + args: { + contractAddress: flipper.options.address, + sponsor: flipper.options.address, + }, + }, + ]); + }); + itWeb3('Self sponsored can not be set by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -75,6 +103,26 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.true; }); + itWeb3('Set sponsor event', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + + const result = await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); + const events = normalizeEvents(result.events); + expect(events).to.be.deep.equal([ + { + address: flipper.options.address, + event: 'ContractSponsorSet', + args: { + contractAddress: flipper.options.address, + sponsor: sponsor, + }, + }, + ]); + }); + itWeb3('Sponsor can not be set by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -97,6 +145,26 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; }); + itWeb3('Confirm sponsorship event', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected; + const result = await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); + const events = normalizeEvents(result.events); + expect(events).to.be.deep.equal([ + { + address: flipper.options.address, + event: 'ContractSponsorshipConfirmed', + args: { + contractAddress: flipper.options.address, + sponsor: sponsor, + }, + }, + ]); + }); + itWeb3('Sponsorship can not be confirmed by the address that not pending as sponsor', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -160,6 +228,28 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; }); + itWeb3('Remove sponsor event', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + + await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); + await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); + + const result = await helpers.methods.removeSponsor(flipper.options.address).send(); + const events = normalizeEvents(result.events); + expect(events).to.be.deep.equal([ + { + address: flipper.options.address, + event: 'ContractSponsorRemoved', + args: { + contractAddress: flipper.options.address, + }, + }, + ]); + }); + itWeb3('Sponsor can not be removed by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); diff --git a/tests/src/eth/util/contractHelpersAbi.json b/tests/src/eth/util/contractHelpersAbi.json index c3cd1fd091..fc3e92aa1e 100644 --- a/tests/src/eth/util/contractHelpersAbi.json +++ b/tests/src/eth/util/contractHelpersAbi.json @@ -1,4 +1,55 @@ [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "ContractSponsorRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sponsor", + "type": "address" + } + ], + "name": "ContractSponsorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sponsor", + "type": "address" + } + ], + "name": "ContractSponsorshipConfirmed", + "type": "event" + }, { "inputs": [ { From d561a49a78379480596bcd5b4f6e8a34374d425f Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Mon, 5 Sep 2022 15:09:31 +0000 Subject: [PATCH 0716/1274] test(util): fix extra message labeling --- tests/src/eth/util/playgrounds/unique.dev.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index 0e4169fce1..2d29128e66 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -154,7 +154,7 @@ class EthGroup extends EthGroupBase { await this.helper.executeExtrinsic( signer, 'api.tx.evm.call', [this.helper.address.substrateToEth(signer.address), contractAddress, abi, value, gasLimit, gasPrice, null, null, []], - true, 'Unable to perform evm.call', + true, ); } From 9d577f5d3aefe09a4a5c0a3b92f24372d18f3cd7 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 5 Sep 2022 19:29:19 +0300 Subject: [PATCH 0717/1274] test: autogenerate js types --- .github/workflows/autogen-js-types.yml | 93 ++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .github/workflows/autogen-js-types.yml diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml new file mode 100644 index 0000000000..eeb952f93c --- /dev/null +++ b/.github/workflows/autogen-js-types.yml @@ -0,0 +1,93 @@ +name: yarn autogetn JS types + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: + - develop + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + - ready_for_review + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +#Define Workflow variables +env: + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + autogen_js_types: + # The type of runner that the job will run on + runs-on: [self-hosted-ci,medium] + timeout-minutes: 1380 + + name: ${{ matrix.network }} + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: + - network: "opal" + features: "opal-runtime" + - network: "quartz" + features: "quartz-runtime" + - network: "unique" + features: "unique-runtime" + + steps: + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-dev.j2 + output_file: .docker/docker-compose.${{ matrix.network }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + FEATURE=${{ matrix.features }} + + + - name: Show build configuration + run: cat .docker/docker-compose.${{ matrix.network }}.yml + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Run tests + working-directory: tests + run: | + yarn polkadot-types + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Enumerate files after generation + working-directory: tests + run: ls -la + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From 9b8d38886a37b74f1d5f75097e4582c3716da3ac Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 5 Sep 2022 19:35:03 +0300 Subject: [PATCH 0718/1274] fix: yaml syntaxes --- .github/workflows/autogen-js-types.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml index eeb952f93c..5544269fc4 100644 --- a/.github/workflows/autogen-js-types.yml +++ b/.github/workflows/autogen-js-types.yml @@ -86,7 +86,8 @@ jobs: - name: Enumerate files after generation working-directory: tests - run: ls -la + run: | + ls -la - name: Stop running containers if: always() # run this step always From 62ab9ccd1b9ec2b85553df3af9e95279b009592e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 5 Sep 2022 19:38:06 +0300 Subject: [PATCH 0719/1274] change node-dev address for connection --- .github/workflows/autogen-js-types.yml | 2 -- tests/package.json | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml index 5544269fc4..8665c54e79 100644 --- a/.github/workflows/autogen-js-types.yml +++ b/.github/workflows/autogen-js-types.yml @@ -81,8 +81,6 @@ jobs: working-directory: tests run: | yarn polkadot-types - env: - RPC_URL: http://127.0.0.1:9933/ - name: Enumerate files after generation working-directory: tests diff --git a/tests/package.json b/tests/package.json index e2985a4954..47c03eed3c 100644 --- a/tests/package.json +++ b/tests/package.json @@ -85,7 +85,7 @@ "testRFT": "mocha --timeout 9999999 -r ts-node/register ./**/refungible.test.ts", "testFT": "mocha --timeout 9999999 -r ts-node/register ./**/fungible.test.ts", "testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts", - "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", + "polkadot-types-fetch-metadata": "curl -H 'Content-Type: application/json' -d '{\"id\":\"1\", \"jsonrpc\":\"2.0\", \"method\": \"state_getMetadata\", \"params\":[]}' http://127.0.0.1:9933 > src/interfaces/metadata.json", "polkadot-types-from-defs": "ts-node ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .", "polkadot-types-from-chain": "ts-node ./node_modules/.bin/polkadot-types-from-chain --endpoint src/interfaces/metadata.json --output src/interfaces/ --package .", "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" From 1eca7ea78e865b8c3b4f1b0bd3f2dce3da0d922c Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 5 Sep 2022 20:43:24 +0300 Subject: [PATCH 0720/1274] timeout before autogenerate js types. --- .github/workflows/autogen-js-types.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml index 8665c54e79..39922ef1ef 100644 --- a/.github/workflows/autogen-js-types.yml +++ b/.github/workflows/autogen-js-types.yml @@ -72,6 +72,9 @@ jobs: - name: Build the stack run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans + + - name: Wait untill node-dev started. + run: sleep 600s - uses: actions/setup-node@v3 with: From 06774c89f772bb4de94abe51c411c28d1d726512 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 5 Sep 2022 20:55:50 +0300 Subject: [PATCH 0721/1274] install npm_modules --- .github/workflows/autogen-js-types.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml index 39922ef1ef..09188dc878 100644 --- a/.github/workflows/autogen-js-types.yml +++ b/.github/workflows/autogen-js-types.yml @@ -83,6 +83,7 @@ jobs: - name: Run tests working-directory: tests run: | + yarn install yarn polkadot-types - name: Enumerate files after generation From 0d83ab5cbaa8365ae21b0fe1f2c83a58917d9fc5 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 5 Sep 2022 21:35:22 +0300 Subject: [PATCH 0722/1274] Sync and rename files --- .github/workflows/autogen-js-types.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml index 09188dc878..fd454132ad 100644 --- a/.github/workflows/autogen-js-types.yml +++ b/.github/workflows/autogen-js-types.yml @@ -80,14 +80,34 @@ jobs: with: node-version: 16 - - name: Run tests + - name: Generate working-directory: tests run: | yarn install yarn polkadot-types + - name: Checkou repo UniqueNetwork/unique-types-js + uses: actions/checkout@v3 + with: + repository: 'UniqueNetwork/unique-types-js' +# ssh-key: ${{ secrets.GH_PAT }} + path: 'unique-types-js' +# ref: 'QA-65_maxandreev' + + - name: Copy files + run: | + rsync -ar --exclude .gitignore src/interfaces/ unique-types-js + for file in unique-types-js/augment-* unique-types-js/**/types.ts unique-types-js/registry.ts; do + sed -i '1s;^;//@ts-nocheck\n;' $file + done + - name: Enumerate files after generation - working-directory: tests + working-directory: tests/unique-types-js + run: | + ls -la + + - name: Enumerate files after generation + working-directory: tests/ run: | ls -la From bda150321ea2368e52ac44a7c2fc9bc2692c960c Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 5 Sep 2022 22:06:02 +0300 Subject: [PATCH 0723/1274] specify working directory --- .github/workflows/autogen-js-types.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml index fd454132ad..64ef6a2da5 100644 --- a/.github/workflows/autogen-js-types.yml +++ b/.github/workflows/autogen-js-types.yml @@ -88,6 +88,7 @@ jobs: - name: Checkou repo UniqueNetwork/unique-types-js uses: actions/checkout@v3 + working-directory: tests with: repository: 'UniqueNetwork/unique-types-js' # ssh-key: ${{ secrets.GH_PAT }} @@ -95,6 +96,7 @@ jobs: # ref: 'QA-65_maxandreev' - name: Copy files + working-directory: tests run: | rsync -ar --exclude .gitignore src/interfaces/ unique-types-js for file in unique-types-js/augment-* unique-types-js/**/types.ts unique-types-js/registry.ts; do From 1000db62482864cb260c099b7e322a9e68d3f8de Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 5 Sep 2022 22:13:53 +0300 Subject: [PATCH 0724/1274] checkout path change --- .docker/docker-compose.opal.yml | 22 ++++++++++++++++++++++ .github/workflows/autogen-js-types.yml | 3 +-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 .docker/docker-compose.opal.yml diff --git a/.docker/docker-compose.opal.yml b/.docker/docker-compose.opal.yml new file mode 100644 index 0000000000..3d47f52c0f --- /dev/null +++ b/.docker/docker-compose.opal.yml @@ -0,0 +1,22 @@ +version: "3.5" + +services: + node-dev: + build: + args: + - "RUST_TOOLCHAIN=nightly-2022-07-24" + - "FEATURE=opal-runtime" + context: ../ + dockerfile: .docker/Dockerfile-chain-dev + expose: + - 9944 + - 9933 + ports: + - 127.0.0.1:9944:9944 + - 127.0.0.1:9933:9933 + logging: + options: + max-size: "1m" + max-file: "3" + command: cargo run --release --features=$FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external + diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml index 64ef6a2da5..b4e123090a 100644 --- a/.github/workflows/autogen-js-types.yml +++ b/.github/workflows/autogen-js-types.yml @@ -88,11 +88,10 @@ jobs: - name: Checkou repo UniqueNetwork/unique-types-js uses: actions/checkout@v3 - working-directory: tests with: repository: 'UniqueNetwork/unique-types-js' # ssh-key: ${{ secrets.GH_PAT }} - path: 'unique-types-js' + path: 'tests/unique-types-js' # ref: 'QA-65_maxandreev' - name: Copy files From fc5b26af3046ddf0e57d19b458c17ce8898af4d9 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Tue, 6 Sep 2022 14:15:54 +0700 Subject: [PATCH 0725/1274] fix runtime benchmarks, `payout_stakers` logic, bencmarkr for payout_stakers --- pallets/app-promotion/Cargo.toml | 19 ++- pallets/app-promotion/src/benchmarking.rs | 36 +++-- pallets/app-promotion/src/lib.rs | 98 +++++++++++++- pallets/app-promotion/src/types.rs | 4 +- pallets/app-promotion/src/weights.rs | 124 ++++++++++-------- pallets/common/Cargo.toml | 5 +- .../common/config/pallets/app_promotion.rs | 2 +- runtime/common/runtime_apis.rs | 4 +- tests/src/interfaces/augment-api-consts.ts | 4 - tests/src/interfaces/augment-api-errors.ts | 2 +- tests/src/interfaces/augment-api-events.ts | 3 + tests/src/interfaces/augment-api-query.ts | 4 - tests/src/interfaces/default/types.ts | 12 +- tests/src/interfaces/lookup.ts | 7 +- tests/src/interfaces/types-lookup.ts | 12 +- 15 files changed, 229 insertions(+), 107 deletions(-) diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index d5ab2b9325..82ed3b4479 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -20,18 +20,23 @@ runtime-benchmarks = [ 'frame-benchmarking', 'frame-support/runtime-benchmarks', 'frame-system/runtime-benchmarks', + # 'pallet-unique/runtime-benchmarks', ] std = [ 'codec/std', - 'serde/std', + 'frame-benchmarking/std', 'frame-support/std', 'frame-system/std', 'pallet-balances/std', 'pallet-timestamp/std', 'pallet-randomness-collective-flip/std', + 'pallet-evm/std', + 'sp-io/std', 'sp-std/std', 'sp-runtime/std', - 'frame-benchmarking/std', + 'sp-core/std', + 'serde/std', + ] ################################################################################ @@ -108,24 +113,24 @@ branch = "unique-polkadot-v0.9.27" # local dependencies [dependencies.up-data-structs] default-features = false -path = "../../primitives/data-structs" +path = "../../primitives/data-structs" [dependencies.pallet-common] default-features = false -path = "../common" +path = "../common" [dependencies.pallet-unique] default-features = false -path = "../unique" +path = "../unique" [dependencies.pallet-evm-contract-helpers] default-features = false -path = "../evm-contract-helpers" +path = "../evm-contract-helpers" [dev-dependencies] [dependencies.pallet-evm-migration] default-features = false -path = "../evm-migration" +path = "../evm-migration" ################################################################################ diff --git a/pallets/app-promotion/src/benchmarking.rs b/pallets/app-promotion/src/benchmarking.rs index 9425cb4a88..ba4f94b80f 100644 --- a/pallets/app-promotion/src/benchmarking.rs +++ b/pallets/app-promotion/src/benchmarking.rs @@ -28,11 +28,8 @@ use frame_system::{Origin, RawOrigin}; use pallet_unique::benchmarking::create_nft_collection; use pallet_evm_migration::Pallet as EvmMigrationPallet; -// trait BenchmarkingConfig: Config + pallet_unique::Config { } - -// impl BenchmarkingConfig for T { } - const SEED: u32 = 0; + benchmarks! { where_clause{ where T: Config + pallet_unique::Config + pallet_evm_migration::Config , @@ -53,18 +50,32 @@ benchmarks! { } : {PromototionPallet::::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin))?} payout_stakers{ + let b in 1..101; + let pallet_admin = account::("admin", 0, SEED); - let share = Perbill::from_rational(1u32, 100); + let share = Perbill::from_rational(1u32, 20); PromototionPallet::::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?; - let _ = ::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + ::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + let staker: T::AccountId = account("caller", 0, SEED); - let stakers: Vec = (0..100).map(|index| account("staker", index, SEED)).collect(); + ::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + let stakers: Vec = (0..b).map(|index| account("staker", index, SEED)).collect(); stakers.iter().for_each(|staker| { ::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); }); - let _ = ::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); - let _ = PromototionPallet::::stake(RawOrigin::Signed(staker.clone()).into(), share * ::Currency::total_balance(&staker))?; - } : {PromototionPallet::::payout_stakers(RawOrigin::Signed(pallet_admin.clone()).into(), Some(1))?} + (0..10).try_for_each(|_| { + stakers.iter() + .map(|staker| { + + PromototionPallet::::stake(RawOrigin::Signed(staker.clone()).into(), Into::>::into(100u128) * T::Nominal::get()) + }).collect::, _>>()?; + >::finalize(); + Result::<(), sp_runtime::DispatchError>::Ok(()) + })?; + + // let _ = ::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + // let _ = PromototionPallet::::stake(RawOrigin::Signed(staker.clone()).into(), share * ::Currency::total_balance(&staker))?; + } : {PromototionPallet::::payout_stakers(RawOrigin::Signed(pallet_admin.clone()).into(), Some(b as u8))?} stake { let caller = account::("caller", 0, SEED); @@ -76,7 +87,10 @@ benchmarks! { let caller = account::("caller", 0, SEED); let share = Perbill::from_rational(1u32, 20); let _ = ::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); - (0..10).map(|_| PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller))).collect::, _>>()?; + (0..10).map(|_| { + >::finalize(); + PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller)) + }).collect::, _>>()?; } : {PromototionPallet::::unstake(RawOrigin::Signed(caller.clone()).into())?} diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 9d7aee0f8e..01f92f0a2d 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -157,7 +157,7 @@ pub mod pallet { /// No permission to perform an action NoPermission, /// Insufficient funds to perform an action - NotSufficientFounds, + NotSufficientFunds, PendingForBlockOverflow, /// An error related to the fact that an invalid argument was passed to perform an action InvalidArgument, @@ -285,14 +285,23 @@ pub mod pallet { <::Currency as Currency>::ensure_can_withdraw( &staker_id, amount, - WithdrawReasons::all(), + WithdrawReasons::RESERVE, balance - amount, )?; Self::add_lock_balance(&staker_id, amount)?; let block_number = T::RelayBlockNumberProvider::current_block_number(); - let recalc_block = (block_number / T::RecalculationInterval::get() + 2u32.into()) + + let recalculate_after_interval: T::BlockNumber = + if block_number % T::RecalculationInterval::get() == 0u32.into() { + 1u32.into() + } else { + 2u32.into() + }; + + let recalc_block = (block_number / T::RecalculationInterval::get() + + recalculate_after_interval) * T::RecalculationInterval::get(); >::insert((&staker_id, block_number), { @@ -428,7 +437,7 @@ pub mod pallet { T::ContractHandler::remove_contract_sponsor(contract_id) } - #[pallet::weight(0)] + #[pallet::weight(T::WeightInfo::payout_stakers(stakers_number.unwrap_or(20) as u32))] pub fn payout_stakers(admin: OriginFor, stakers_number: Option) -> DispatchResult { let admin_id = ensure_signed(admin)?; @@ -495,6 +504,74 @@ pub mod pallet { // } // } + // { + // let mut stakers_number = stakers_number.unwrap_or(20); + // let last_id = RefCell::new(None); + // let income_acc = RefCell::new(BalanceOf::::default()); + // let amount_acc = RefCell::new(BalanceOf::::default()); + + // let flush_stake = || -> DispatchResult { + // if let Some(last_id) = &*last_id.borrow() { + // if !income_acc.borrow().is_zero() { + // >::transfer( + // &T::TreasuryAccountId::get(), + // last_id, + // *income_acc.borrow(), + // ExistenceRequirement::KeepAlive, + // ) + // .and_then(|_| { + // Self::add_lock_balance(last_id, *income_acc.borrow()); + // >::try_mutate(|staked| { + // staked + // .checked_add(&*income_acc.borrow()) + // .ok_or(ArithmeticError::Overflow.into()) + // }) + // })?; + + // Self::deposit_event(Event::StakingRecalculation( + // last_id.clone(), + // *amount_acc.borrow(), + // *income_acc.borrow(), + // )); + // } + + // *income_acc.borrow_mut() = BalanceOf::::default(); + // *amount_acc.borrow_mut() = BalanceOf::::default(); + // } + // Ok(()) + // }; + + // while let Some(( + // (current_id, staked_block), + // (amount, next_recalc_block_for_stake), + // )) = storage_iterator.next() + // { + // if stakers_number == 0 { + // NextCalculatedRecord::::set(Some((current_id, staked_block))); + // break; + // } + // stakers_number -= 1; + // if last_id.borrow().as_ref() != Some(¤t_id) { + // flush_stake()?; + // }; + // *last_id.borrow_mut() = Some(current_id.clone()); + // if current_recalc_block >= next_recalc_block_for_stake { + // *amount_acc.borrow_mut() += amount; + // Self::recalculate_and_insert_stake( + // ¤t_id, + // staked_block, + // next_recalc_block, + // amount, + // ((current_recalc_block - next_recalc_block_for_stake) + // / T::RecalculationInterval::get()) + // .into() + 1, + // &mut *income_acc.borrow_mut(), + // ); + // } + // } + // flush_stake()?; + // } + { let mut stakers_number = stakers_number.unwrap_or(20); let last_id = RefCell::new(None); @@ -510,7 +587,14 @@ pub mod pallet { *income_acc.borrow(), ExistenceRequirement::KeepAlive, ) - .and_then(|_| Self::add_lock_balance(last_id, *income_acc.borrow()))?; + .and_then(|_| { + Self::add_lock_balance(last_id, *income_acc.borrow())?; + >::try_mutate(|staked| { + staked + .checked_add(&*income_acc.borrow()) + .ok_or(ArithmeticError::Overflow.into()) + }) + })?; Self::deposit_event(Event::StakingRecalculation( last_id.clone(), @@ -534,11 +618,11 @@ pub mod pallet { NextCalculatedRecord::::set(Some((current_id, staked_block))); break; } - stakers_number -= 1; if last_id.borrow().as_ref() != Some(¤t_id) { flush_stake()?; + *last_id.borrow_mut() = Some(current_id.clone()); + stakers_number -= 1; }; - *last_id.borrow_mut() = Some(current_id.clone()); if current_recalc_block >= next_recalc_block_for_stake { *amount_acc.borrow_mut() += amount; Self::recalculate_and_insert_stake( diff --git a/pallets/app-promotion/src/types.rs b/pallets/app-promotion/src/types.rs index e58f910c03..1e7306c5b0 100644 --- a/pallets/app-promotion/src/types.rs +++ b/pallets/app-promotion/src/types.rs @@ -1,7 +1,5 @@ use codec::EncodeLike; -use frame_support::{ - traits::LockableCurrency, WeakBoundedVec, Parameter, dispatch::DispatchResult, ensure, -}; +use frame_support::{traits::LockableCurrency, WeakBoundedVec, Parameter, dispatch::DispatchResult}; use pallet_balances::{BalanceLock, Config as BalancesConfig, Pallet as PalletBalances}; use pallet_common::CollectionHandle; diff --git a/pallets/app-promotion/src/weights.rs b/pallets/app-promotion/src/weights.rs index e446e21351..4a0733a0b8 100644 --- a/pallets/app-promotion/src/weights.rs +++ b/pallets/app-promotion/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_app_promotion //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-01, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-09-06, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -35,7 +35,7 @@ use sp_std::marker::PhantomData; /// Weight functions needed for pallet_app_promotion. pub trait WeightInfo { fn set_admin_address() -> Weight; - fn payout_stakers() -> Weight; + fn payout_stakers(b: u32, ) -> Weight; fn stake() -> Weight; fn unstake() -> Weight; fn sponsor_collection() -> Weight; @@ -47,66 +47,70 @@ pub trait WeightInfo { /// Weights for pallet_app_promotion using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - // Storage: Promotion Admin (r:0 w:1) + // Storage: AppPromotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - (515_000 as Weight) + (5_297_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - // Storage: Promotion Admin (r:1 w:0) + // Storage: AppPromotion Admin (r:1 w:0) // Storage: ParachainSystem ValidationData (r:1 w:0) - // Storage: Promotion NextCalculatedRecord (r:1 w:1) - // Storage: Promotion Staked (r:2 w:0) - fn payout_stakers() -> Weight { - (8_475_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) + // Storage: AppPromotion NextCalculatedRecord (r:1 w:1) + // Storage: AppPromotion Staked (r:2 w:0) + fn payout_stakers(b: u32, ) -> Weight { + (8_045_000 as Weight) + // Standard Error: 19_000 + .saturating_add((4_778_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) - // Storage: Promotion StakesPerAccount (r:1 w:1) + // Storage: AppPromotion StakesPerAccount (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: ParachainSystem ValidationData (r:1 w:0) - // Storage: Promotion Staked (r:1 w:1) - // Storage: Promotion TotalStaked (r:1 w:1) + // Storage: AppPromotion Staked (r:1 w:1) + // Storage: AppPromotion TotalStaked (r:1 w:1) fn stake() -> Weight { - (12_266_000 as Weight) + (17_623_000 as Weight) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } - // Storage: Promotion Staked (r:2 w:1) - // Storage: ParachainSystem ValidationData (r:1 w:0) - // Storage: Promotion PendingUnstake (r:1 w:1) - // Storage: Promotion TotalStaked (r:1 w:1) - // Storage: Promotion StakesPerAccount (r:0 w:1) + // Storage: AppPromotion PendingUnstake (r:1 w:1) + // Storage: AppPromotion Staked (r:2 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: System Account (r:1 w:1) + // Storage: AppPromotion TotalStaked (r:1 w:1) + // Storage: AppPromotion StakesPerAccount (r:0 w:1) fn unstake() -> Weight { - (10_663_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + (27_190_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(6 as Weight)) } - // Storage: Promotion Admin (r:1 w:0) + // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn sponsor_collection() -> Weight { - (10_879_000 as Weight) + (11_351_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - // Storage: Promotion Admin (r:1 w:0) + // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn stop_sponsoring_collection() -> Weight { - (10_548_000 as Weight) + (10_687_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - // Storage: Promotion Admin (r:1 w:0) + // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:0 w:1) fn sponsor_contract() -> Weight { - (2_130_000 as Weight) + (2_332_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - // Storage: Promotion Admin (r:1 w:0) + // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:1 w:1) fn stop_sponsoring_contract() -> Weight { - (3_509_000 as Weight) + (3_712_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -114,66 +118,70 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { - // Storage: Promotion Admin (r:0 w:1) + // Storage: AppPromotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - (515_000 as Weight) + (5_297_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } - // Storage: Promotion Admin (r:1 w:0) + // Storage: AppPromotion Admin (r:1 w:0) // Storage: ParachainSystem ValidationData (r:1 w:0) - // Storage: Promotion NextCalculatedRecord (r:1 w:1) - // Storage: Promotion Staked (r:2 w:0) - fn payout_stakers() -> Weight { - (8_475_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + // Storage: AppPromotion NextCalculatedRecord (r:1 w:1) + // Storage: AppPromotion Staked (r:2 w:0) + fn payout_stakers(b: u32, ) -> Weight { + (8_045_000 as Weight) + // Standard Error: 19_000 + .saturating_add((4_778_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: System Account (r:1 w:1) - // Storage: Promotion StakesPerAccount (r:1 w:1) + // Storage: AppPromotion StakesPerAccount (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: ParachainSystem ValidationData (r:1 w:0) - // Storage: Promotion Staked (r:1 w:1) - // Storage: Promotion TotalStaked (r:1 w:1) + // Storage: AppPromotion Staked (r:1 w:1) + // Storage: AppPromotion TotalStaked (r:1 w:1) fn stake() -> Weight { - (12_266_000 as Weight) + (17_623_000 as Weight) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } - // Storage: Promotion Staked (r:2 w:1) - // Storage: ParachainSystem ValidationData (r:1 w:0) - // Storage: Promotion PendingUnstake (r:1 w:1) - // Storage: Promotion TotalStaked (r:1 w:1) - // Storage: Promotion StakesPerAccount (r:0 w:1) + // Storage: AppPromotion PendingUnstake (r:1 w:1) + // Storage: AppPromotion Staked (r:2 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: System Account (r:1 w:1) + // Storage: AppPromotion TotalStaked (r:1 w:1) + // Storage: AppPromotion StakesPerAccount (r:0 w:1) fn unstake() -> Weight { - (10_663_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + (27_190_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(6 as Weight)) + .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } - // Storage: Promotion Admin (r:1 w:0) + // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn sponsor_collection() -> Weight { - (10_879_000 as Weight) + (11_351_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } - // Storage: Promotion Admin (r:1 w:0) + // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn stop_sponsoring_collection() -> Weight { - (10_548_000 as Weight) + (10_687_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } - // Storage: Promotion Admin (r:1 w:0) + // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:0 w:1) fn sponsor_contract() -> Weight { - (2_130_000 as Weight) + (2_332_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } - // Storage: Promotion Admin (r:1 w:0) + // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:1 w:1) fn stop_sponsoring_contract() -> Weight { - (3_509_000 as Weight) + (3_712_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index 4d24c3db8d..64ef5be5d2 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -40,4 +40,7 @@ std = [ "up-data-structs/std", "pallet-evm/std", ] -runtime-benchmarks = ["frame-benchmarking"] +runtime-benchmarks = [ + "frame-benchmarking/runtime-benchmarks", + "up-data-structs/runtime-benchmarks", +] diff --git a/runtime/common/config/pallets/app_promotion.rs b/runtime/common/config/pallets/app_promotion.rs index 49454491a4..114660af35 100644 --- a/runtime/common/config/pallets/app_promotion.rs +++ b/runtime/common/config/pallets/app_promotion.rs @@ -22,7 +22,7 @@ use crate::{ use frame_support::{parameter_types, PalletId}; use sp_arithmetic::Perbill; use up_common::{ - constants::{ UNIQUE, RELAY_DAYS}, + constants::{UNIQUE, RELAY_DAYS}, types::Balance, }; diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index 95a9278e91..911d4b77af 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -680,7 +680,7 @@ macro_rules! impl_common_runtime_apis { list_benchmark!(list, extra, pallet_unique, Unique); list_benchmark!(list, extra, pallet_structure, Structure); list_benchmark!(list, extra, pallet_inflation, Inflation); - list_benchmark!(list, extra, pallet_app_promotion, Promotion); + list_benchmark!(list, extra, pallet_app_promotion, AppPromotion); list_benchmark!(list, extra, pallet_fungible, Fungible); list_benchmark!(list, extra, pallet_nonfungible, Nonfungible); @@ -736,7 +736,7 @@ macro_rules! impl_common_runtime_apis { add_benchmark!(params, batches, pallet_unique, Unique); add_benchmark!(params, batches, pallet_structure, Structure); add_benchmark!(params, batches, pallet_inflation, Inflation); - add_benchmark!(params, batches, pallet_app_promotion, Promotion); + add_benchmark!(params, batches, pallet_app_promotion, AppPromotion); add_benchmark!(params, batches, pallet_fungible, Fungible); add_benchmark!(params, batches, pallet_nonfungible, Nonfungible); diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index 6ef1317cc2..74a3db3476 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -16,10 +16,6 @@ export type __AugmentedConst = AugmentedConst declare module '@polkadot/api-base/types/consts' { interface AugmentedConsts { appPromotion: { - /** - * In chain blocks. - **/ - day: u32 & AugmentedConst; intervalIncome: Perbill & AugmentedConst; nominal: u128 & AugmentedConst; /** diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 366675d9ca..375b6bf248 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -27,7 +27,7 @@ declare module '@polkadot/api-base/types/errors' { /** * Insufficient funds to perform an action **/ - NotSufficientFounds: AugmentedError; + NotSufficientFunds: AugmentedError; PendingForBlockOverflow: AugmentedError; /** * Generic error diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index 765b8d68cc..88d99339dd 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -16,7 +16,10 @@ export type __AugmentedEvent = AugmentedEvent declare module '@polkadot/api-base/types/events' { interface AugmentedEvents { appPromotion: { + SetAdmin: AugmentedEvent; + Stake: AugmentedEvent; StakingRecalculation: AugmentedEvent; + Unstake: AugmentedEvent; /** * Generic event **/ diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index b1b40a3c9b..8b46e403bf 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -36,10 +36,6 @@ declare module '@polkadot/api-base/types/storage' { * Amount of stakes for an Account **/ stakesPerAccount: AugmentedQuery Observable, [AccountId32]> & QueryableStorageEntry; - /** - * A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`. - **/ - startBlock: AugmentedQuery Observable, []> & QueryableStorageEntry; totalStaked: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Generic query diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 56a8c1d3d2..7683839f8f 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -844,17 +844,23 @@ export interface PalletAppPromotionCall extends Enum { export interface PalletAppPromotionError extends Enum { readonly isAdminNotSet: boolean; readonly isNoPermission: boolean; - readonly isNotSufficientFounds: boolean; + readonly isNotSufficientFunds: boolean; readonly isPendingForBlockOverflow: boolean; readonly isInvalidArgument: boolean; - readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'PendingForBlockOverflow' | 'InvalidArgument'; + readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'InvalidArgument'; } /** @name PalletAppPromotionEvent */ export interface PalletAppPromotionEvent extends Enum { readonly isStakingRecalculation: boolean; readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>; - readonly type: 'StakingRecalculation'; + readonly isStake: boolean; + readonly asStake: ITuple<[AccountId32, u128]>; + readonly isUnstake: boolean; + readonly asUnstake: ITuple<[AccountId32, u128]>; + readonly isSetAdmin: boolean; + readonly asSetAdmin: AccountId32; + readonly type: 'StakingRecalculation' | 'Stake' | 'Unstake' | 'SetAdmin'; } /** @name PalletBalancesAccountData */ diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 35c9034af3..1108be8de7 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -1061,7 +1061,10 @@ export default { **/ PalletAppPromotionEvent: { _enum: { - StakingRecalculation: '(AccountId32,u128,u128)' + StakingRecalculation: '(AccountId32,u128,u128)', + Stake: '(AccountId32,u128)', + Unstake: '(AccountId32,u128)', + SetAdmin: 'AccountId32' } }, /** @@ -3102,7 +3105,7 @@ export default { * Lookup415: pallet_app_promotion::pallet::Error **/ PalletAppPromotionError: { - _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFounds', 'PendingForBlockOverflow', 'InvalidArgument'] + _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'InvalidArgument'] }, /** * Lookup418: pallet_evm::pallet::Error diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 0098707f61..13acb65fde 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1202,7 +1202,13 @@ declare module '@polkadot/types/lookup' { interface PalletAppPromotionEvent extends Enum { readonly isStakingRecalculation: boolean; readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>; - readonly type: 'StakingRecalculation'; + readonly isStake: boolean; + readonly asStake: ITuple<[AccountId32, u128]>; + readonly isUnstake: boolean; + readonly asUnstake: ITuple<[AccountId32, u128]>; + readonly isSetAdmin: boolean; + readonly asSetAdmin: AccountId32; + readonly type: 'StakingRecalculation' | 'Stake' | 'Unstake' | 'SetAdmin'; } /** @name PalletEvmEvent (104) */ @@ -3290,10 +3296,10 @@ declare module '@polkadot/types/lookup' { interface PalletAppPromotionError extends Enum { readonly isAdminNotSet: boolean; readonly isNoPermission: boolean; - readonly isNotSufficientFounds: boolean; + readonly isNotSufficientFunds: boolean; readonly isPendingForBlockOverflow: boolean; readonly isInvalidArgument: boolean; - readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'PendingForBlockOverflow' | 'InvalidArgument'; + readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'InvalidArgument'; } /** @name PalletEvmError (418) */ From bc6bdf753d8a148fc51ba82f51e0a473654abf66 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 6 Sep 2022 17:05:44 +0700 Subject: [PATCH 0726/1274] add rename spec for acala-dev --- .docker/xcm-config/launch-config-xcm-unique-rococo.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.docker/xcm-config/launch-config-xcm-unique-rococo.json b/.docker/xcm-config/launch-config-xcm-unique-rococo.json index 81675e0eda..505fa95c04 100644 --- a/.docker/xcm-config/launch-config-xcm-unique-rococo.json +++ b/.docker/xcm-config/launch-config-xcm-unique-rococo.json @@ -103,6 +103,11 @@ "id": "2000", "chain": "acala-dev", "balance": "1000000000000000000000", + "chainInitializer": [ + "chainql", + "-e", + "(import '${spec}') {id+: '-local'}" + ], "nodes": [ { "wsPort": 9946, From 48a39e9047631aa8fa41ff2a91456209d8c7b4c4 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 6 Sep 2022 13:37:23 +0300 Subject: [PATCH 0727/1274] push generated files into repo --- .github/workflows/autogen-js-types.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml index b4e123090a..0ee7f01fee 100644 --- a/.github/workflows/autogen-js-types.yml +++ b/.github/workflows/autogen-js-types.yml @@ -112,6 +112,15 @@ jobs: run: | ls -la + - name: Upload JS types to repo + working-directory: tests/unique-types-js + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git add . + git commit -m "chore: regenerate types" + git push + - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From 24fe71f1f2c96f6c0b5fec8f1e88d75634153f52 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 6 Sep 2022 17:46:03 +0700 Subject: [PATCH 0728/1274] add rename spec for acala-dev --- .docker/xcm-config/launch-config-xcm-unique.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.docker/xcm-config/launch-config-xcm-unique.json b/.docker/xcm-config/launch-config-xcm-unique.json index fcc465a031..2118e2ce08 100644 --- a/.docker/xcm-config/launch-config-xcm-unique.json +++ b/.docker/xcm-config/launch-config-xcm-unique.json @@ -101,6 +101,11 @@ "id": "2000", "chain": "acala-dev", "balance": "1000000000000000000000", + "chainInitializer": [ + "chainql", + "-e", + "(import '${spec}') {id+: '-local'}" + ], "nodes": [ { "wsPort": 9946, From 922312aaafe28e900bfb2404e4972afbc47c86c8 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 6 Sep 2022 14:17:36 +0300 Subject: [PATCH 0729/1274] add push action --- .github/workflows/autogen-js-types.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml index 0ee7f01fee..820213394a 100644 --- a/.github/workflows/autogen-js-types.yml +++ b/.github/workflows/autogen-js-types.yml @@ -119,7 +119,13 @@ jobs: git config user.email github-actions@github.com git add . git commit -m "chore: regenerate types" - git push + + - name: Push changes + working-directory: tests/unique-types-js + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} - name: Stop running containers if: always() # run this step always From 351e9a090844c43eae1cdc8dcc6f41f0ee631ab7 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 6 Sep 2022 14:20:15 +0300 Subject: [PATCH 0730/1274] Update autogen-js-types.yml --- .github/workflows/autogen-js-types.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml index 820213394a..b117a425e3 100644 --- a/.github/workflows/autogen-js-types.yml +++ b/.github/workflows/autogen-js-types.yml @@ -121,12 +121,12 @@ jobs: git commit -m "chore: regenerate types" - name: Push changes - working-directory: tests/unique-types-js uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} branch: ${{ github.ref }} - + ssh: true + - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down From 042e4c64ac0cf311121a8f70db2bf54440c7f215 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 6 Sep 2022 19:14:41 +0700 Subject: [PATCH 0731/1274] correct and enable tests/scripts/readyness.js for xcm tests workflow --- .github/workflows/xcm-tests_v2.yml | 2 +- tests/scripts/readyness.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/xcm-tests_v2.yml b/.github/workflows/xcm-tests_v2.yml index 85690421aa..cb03f8eb19 100644 --- a/.github/workflows/xcm-tests_v2.yml +++ b/.github/workflows/xcm-tests_v2.yml @@ -146,7 +146,7 @@ jobs: run: | yarn install yarn add mochawesome - # node scripts/readyness.js + node scripts/readyness.js echo "Ready to start tests" NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW} diff --git a/tests/scripts/readyness.js b/tests/scripts/readyness.js index 6543bfc7d2..a448def651 100644 --- a/tests/scripts/readyness.js +++ b/tests/scripts/readyness.js @@ -6,9 +6,9 @@ const connect = async () => { await api.isReadyOrError; const head = (await api.rpc.chain.getHeader()).number.toNumber(); + await api.disconnect(); if(head < 1) throw Error('No block #1'); - await api.disconnect(); } const sleep = time => { From 2f3fc1aafe4baad1758f35c12355c04d1afc1284 Mon Sep 17 00:00:00 2001 From: rkv Date: Tue, 6 Sep 2022 15:14:52 +0300 Subject: [PATCH 0732/1274] tests: adminTransferAndBurn migrated --- tests/package.json | 1 + tests/src/adminTransferAndBurn.test.ts | 51 +++++++++++++++++--------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/tests/package.json b/tests/package.json index 804a2f9813..511eca53db 100644 --- a/tests/package.json +++ b/tests/package.json @@ -48,6 +48,7 @@ "testRemoveCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionAdmin.test.ts", "testRemoveCollectionSponsor": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionSponsor.test.ts", "testRemoveFromAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/removeFromAllowList.test.ts", + "testAllowLists": "mocha --timeout 9999999 -r ts-node/register ./**/allowLists.test.ts", "testConnection": "mocha --timeout 9999999 -r ts-node/register ./**/connection.test.ts", "testContracts": "mocha --timeout 9999999 -r ts-node/register ./**/contracts.test.ts", "testCreateItem": "mocha --timeout 9999999 -r ts-node/register ./**/createItem.test.ts", diff --git a/tests/src/adminTransferAndBurn.test.ts b/tests/src/adminTransferAndBurn.test.ts index 73fdfda8cc..7d2cd56aa5 100644 --- a/tests/src/adminTransferAndBurn.test.ts +++ b/tests/src/adminTransferAndBurn.test.ts @@ -27,46 +27,63 @@ import { burnFromExpectSuccess, setCollectionLimitsExpectSuccess, } from './util/helpers'; +import { usingPlaygrounds } from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; +let donor: IKeyringPair; + +before(async () => { + await usingPlaygrounds(async (_, privateKeyWrapper) => { + donor = privateKeyWrapper('//Alice'); + }); +}); + describe('Integration Test: ownerCanTransfer allows admins to use only transferFrom/burnFrom:', () => { let alice: IKeyringPair; let bob: IKeyringPair; let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); it('admin transfers other user\'s token', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true}); - - const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', {Substrate: bob.address}); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); + const setLimitsResult = await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); + const limits = await helper.collection.getEffectiveLimits(collectionId); + expect(limits.ownerCanTransfer).to.be.true; - await transferExpectFailure(collectionId, tokenId, alice, charlie); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + await expect(transferResult()).to.be.rejected; - await transferFromExpectSuccess(collectionId, tokenId, alice, bob, charlie, 1); + const res = await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: bob.address}, {Substrate: charlie.address}); + const newTokenOwner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(newTokenOwner.Substrate).to.be.equal(charlie.address); }); }); it('admin burns other user\'s token', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true}); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); + + const setLimitsResult = await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); + const limits = await helper.collection.getEffectiveLimits(collectionId); + expect(limits.ownerCanTransfer).to.be.true; - const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', {Substrate: bob.address}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + const burnTxFailed = async () => helper.nft.burnToken(alice, collectionId, tokenId); - await burnItemExpectFailure(alice, collectionId, tokenId); + await expect(burnTxFailed()).to.be.rejected; - await burnFromExpectSuccess(alice, bob, collectionId, tokenId); + const burnResult = await helper.nft.burnToken(bob, collectionId, tokenId); + const token = await helper.nft.getToken(collectionId, tokenId); + expect(token).to.be.null; }); }); }); From b9b1dbe627587901b417bdd9037d7f5d9d2da99f Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 6 Sep 2022 13:20:56 +0000 Subject: [PATCH 0733/1274] test: Add checks for substrate events. --- tests/src/eth/contractSponsoring.test.ts | 34 ++++++++++++++++++++++-- tests/src/util/helpers.ts | 23 +++++++++++++++- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index 3f43a0fb98..ed7d9998cb 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -15,6 +15,7 @@ // along with Unique Network. If not, see . import {expect} from 'chai'; +import { expectSubstrateEventsAtBlock } from '../util/helpers'; import { contractHelpers, createEthAccountWithBalance, @@ -43,8 +44,9 @@ describe('Sponsoring EVM contracts', () => { const helpers = contractHelpers(web3, owner); const result = await helpers.methods.selfSponsoredEnable(flipper.options.address).send(); - const events = normalizeEvents(result.events); - expect(events).to.be.deep.equal([ + // console.log(result); + const ethEvents = normalizeEvents(result.events); + expect(ethEvents).to.be.deep.equal([ { address: flipper.options.address, event: 'ContractSponsorSet', @@ -62,6 +64,13 @@ describe('Sponsoring EVM contracts', () => { }, }, ]); + + await expectSubstrateEventsAtBlock( + api, + result.blockNumber, + 'evmContractHelpers', + ['ContractSponsorSet','ContractSponsorshipConfirmed'], + ); }); itWeb3('Self sponsored can not be set by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => { @@ -121,6 +130,13 @@ describe('Sponsoring EVM contracts', () => { }, }, ]); + + await expectSubstrateEventsAtBlock( + api, + result.blockNumber, + 'evmContractHelpers', + ['ContractSponsorSet'], + ); }); itWeb3('Sponsor can not be set by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => { @@ -163,6 +179,13 @@ describe('Sponsoring EVM contracts', () => { }, }, ]); + + await expectSubstrateEventsAtBlock( + api, + result.blockNumber, + 'evmContractHelpers', + ['ContractSponsorshipConfirmed'], + ); }); itWeb3('Sponsorship can not be confirmed by the address that not pending as sponsor', async ({api, web3, privateKeyWrapper}) => { @@ -248,6 +271,13 @@ describe('Sponsoring EVM contracts', () => { }, }, ]); + + await expectSubstrateEventsAtBlock( + api, + result.blockNumber, + 'evmContractHelpers', + ['ContractSponsorRemoved'], + ); }); itWeb3('Sponsor can not be removed by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => { diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index 0be293c45f..7df4cac32e 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -17,10 +17,11 @@ import '../interfaces/augment-api-rpc'; import '../interfaces/augment-api-query'; import {ApiPromise} from '@polkadot/api'; -import type {AccountId, EventRecord, Event} from '@polkadot/types/interfaces'; +import type {AccountId, EventRecord, Event, BlockNumber} from '@polkadot/types/interfaces'; import type {GenericEventData} from '@polkadot/types'; import {AnyTuple, IEvent, IKeyringPair} from '@polkadot/types/types'; import {evmToAddress} from '@polkadot/util-crypto'; +import {AnyNumber} from '@polkadot/types-codec/types'; import BN from 'bn.js'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; @@ -1780,3 +1781,23 @@ export async function itApi(name: string, cb: (apis: { api: ApiPromise, privateK itApi.only = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {only: true}); itApi.skip = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {skip: true}); + + +export async function expectSubstrateEventsAtBlock(api: ApiPromise, blockNumber: AnyNumber | BlockNumber, section: string, methods: string[], dryRun = false) { + const blockHash = await api.rpc.chain.getBlockHash(blockNumber); + const subEvents = (await api.query.system.events.at(blockHash)) + .filter(x => x.event.section === section) + .map((x) => x.toHuman()); + const events = methods.map((m) => { + return { + event: { + method: m, + section, + }, + }; + }); + if (!dryRun) { + expect(subEvents).to.be.like(events); + } + return subEvents; +} \ No newline at end of file From 187983df9dffb2384156b581e0fe7e2ef5856958 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 6 Sep 2022 17:02:00 +0300 Subject: [PATCH 0734/1274] define repository for js types --- .github/workflows/autogen-js-types.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml index 820213394a..d165e05fc5 100644 --- a/.github/workflows/autogen-js-types.yml +++ b/.github/workflows/autogen-js-types.yml @@ -126,6 +126,7 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} branch: ${{ github.ref }} + repository: 'UniqueNetwork/unique-types-js' - name: Stop running containers if: always() # run this step always From 3a6a58ff92184707d5acc872510646f9d7bc4f72 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Tue, 6 Sep 2022 21:16:26 +0700 Subject: [PATCH 0735/1274] fix UniqueApi generics, added events for contract + fix logic inside `evm-helper` methods, added correct wegihts for `on_initialize` --- client/rpc/src/lib.rs | 12 +- node/cli/src/service.rs | 6 +- node/rpc/src/lib.rs | 8 +- pallets/app-promotion/src/benchmarking.rs | 40 ++- pallets/app-promotion/src/lib.rs | 21 +- pallets/app-promotion/src/types.rs | 32 +- pallets/app-promotion/src/weights.rs | 61 ++-- pallets/evm-contract-helpers/src/eth.rs | 6 +- pallets/evm-contract-helpers/src/lib.rs | 34 +- primitives/rpc/src/lib.rs | 3 +- runtime/common/runtime_apis.rs | 2 +- tests/src/eth/contractSponsoring.test.ts | 2 +- tests/src/interfaces/augment-api-events.ts | 18 ++ tests/src/interfaces/augment-types.ts | 3 +- tests/src/interfaces/default/types.ts | 11 + tests/src/interfaces/lookup.ts | 356 ++++++++++---------- tests/src/interfaces/registry.ts | 3 +- tests/src/interfaces/types-lookup.ts | 357 +++++++++++---------- 18 files changed, 543 insertions(+), 432 deletions(-) diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index 0aafe7e23d..1aad1af827 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -44,7 +44,7 @@ pub use rmrk_unique_rpc::RmrkApiServer; #[rpc(server)] #[async_trait] -pub trait UniqueApi { +pub trait UniqueApi { /// Get tokens owned by account. #[method(name = "unique_accountTokens")] fn account_tokens( @@ -481,7 +481,7 @@ macro_rules! pass_method { macro_rules! unique_api { () => { - dyn UniqueRuntimeApi + dyn UniqueRuntimeApi }; } @@ -498,15 +498,13 @@ macro_rules! rmrk_api { } #[allow(deprecated)] -impl - UniqueApiServer<::Hash, BlockNumber, CrossAccountId, AccountId> - for Unique +impl + UniqueApiServer<::Hash, CrossAccountId, AccountId> for Unique where Block: BlockT, - BlockNumber: Decode + Member + AtLeast32BitUnsigned, AccountId: Decode, C: 'static + ProvideRuntimeApi + HeaderBackend, - C::Api: UniqueRuntimeApi, + C::Api: UniqueRuntimeApi, CrossAccountId: pallet_evm::account::CrossAccountId, { pass_method!( diff --git a/node/cli/src/service.rs b/node/cli/src/service.rs index 532c4e2752..5c32400af0 100644 --- a/node/cli/src/service.rs +++ b/node/cli/src/service.rs @@ -363,7 +363,7 @@ where + sp_block_builder::BlockBuilder + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::ApiExt> - + up_rpc::UniqueApi + + up_rpc::UniqueApi + app_promotion_rpc::AppPromotionApi + rmrk_rpc::RmrkApi< Block, @@ -665,7 +665,7 @@ where + sp_block_builder::BlockBuilder + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::ApiExt> - + up_rpc::UniqueApi + + up_rpc::UniqueApi + app_promotion_rpc::AppPromotionApi + rmrk_rpc::RmrkApi< Block, @@ -810,7 +810,7 @@ where + sp_block_builder::BlockBuilder + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::ApiExt> - + up_rpc::UniqueApi + + up_rpc::UniqueApi + app_promotion_rpc::AppPromotionApi + rmrk_rpc::RmrkApi< Block, diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index 65af828de3..76ed30dd51 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -100,8 +100,7 @@ where C: HeaderBackend + HeaderMetadata, C: Send + Sync + 'static, C::Api: fp_rpc::EthereumRuntimeRPCApi, - C::Api: - up_rpc::UniqueApi::CrossAccountId, AccountId>, + C::Api: up_rpc::UniqueApi::CrossAccountId, AccountId>, BE: Backend + 'static, BE::State: StateBackend, R: RuntimeInstance + Send + Sync + 'static, @@ -145,8 +144,7 @@ where C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: fp_rpc::EthereumRuntimeRPCApi, C::Api: fp_rpc::ConvertTransactionRuntimeApi, - C::Api: - up_rpc::UniqueApi::CrossAccountId, AccountId>, + C::Api: up_rpc::UniqueApi::CrossAccountId, AccountId>, C::Api: app_promotion_rpc::AppPromotionApi< Block, BlockNumber, @@ -236,7 +234,7 @@ where io.merge(Unique::new(client.clone()).into_rpc())?; - #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] + #[cfg(any(feature = "opal-runtime"))] io.merge(AppPromotion::new(client.clone()).into_rpc())?; #[cfg(not(feature = "unique-runtime"))] diff --git a/pallets/app-promotion/src/benchmarking.rs b/pallets/app-promotion/src/benchmarking.rs index ba4f94b80f..eeffe47bea 100644 --- a/pallets/app-promotion/src/benchmarking.rs +++ b/pallets/app-promotion/src/benchmarking.rs @@ -23,26 +23,52 @@ use sp_runtime::traits::Bounded; use sp_std::vec; use frame_benchmarking::{benchmarks, account}; - +use frame_support::traits::OnInitialize; use frame_system::{Origin, RawOrigin}; use pallet_unique::benchmarking::create_nft_collection; use pallet_evm_migration::Pallet as EvmMigrationPallet; const SEED: u32 = 0; +fn set_admin() -> DispatchResult +where + T: Config + pallet_unique::Config + pallet_evm_migration::Config, + T::BlockNumber: From + Into, + <::Currency as Currency>::Balance: Sum + From, +{ + let pallet_admin = account::("admin", 0, SEED); + + ::Currency::make_free_balance_be( + &pallet_admin, + Perbill::from_rational(1u32, 2) * BalanceOf::::max_value(), + ); + + PromototionPallet::::set_admin_address( + RawOrigin::Root.into(), + T::CrossAccountId::from_sub(pallet_admin.clone()), + ) +} + benchmarks! { where_clause{ where T: Config + pallet_unique::Config + pallet_evm_migration::Config , T::BlockNumber: From + Into, <::Currency as Currency>::Balance: Sum + From } - // start_app_promotion { - // } : {PromototionPallet::::start_app_promotion(RawOrigin::Root.into(), None)?} + on_initialize { + let b in 0..PENDING_LIMIT_PER_BLOCK; + set_admin::()?; - // stop_app_promotion{ - // PromototionPallet::::start_app_promotion(RawOrigin::Root.into(), Some(25.into()))?; - // } : {PromototionPallet::::stop_app_promotion(RawOrigin::Root.into())?} + (0..b).try_for_each(|index| { + let staker = account::("staker", index, SEED); + ::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); + PromototionPallet::::stake(RawOrigin::Signed(staker.clone()).into(), Into::>::into(100u128) * T::Nominal::get())?; + PromototionPallet::::unstake(RawOrigin::Signed(staker.clone()).into()).map_err(|e| e.error)?; + Result::<(), sp_runtime::DispatchError>::Ok(()) + })?; + let block_number = >::current_block_number() + T::PendingInterval::get(); + }: {PromototionPallet::::on_initialize(block_number)} set_admin_address { let pallet_admin = account::("admin", 0, SEED); @@ -66,7 +92,7 @@ benchmarks! { (0..10).try_for_each(|_| { stakers.iter() .map(|staker| { - + PromototionPallet::::stake(RawOrigin::Signed(staker.clone()).into(), Into::>::into(100u128) * T::Nominal::get()) }).collect::, _>>()?; >::finalize(); diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 01f92f0a2d..c78f4988dc 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -226,15 +226,15 @@ pub mod pallet { where ::BlockNumber: From, { - let mut consumed_weight = 0; - let mut add_weight = |reads, writes, weight| { - consumed_weight += T::DbWeight::get().reads_writes(reads, writes); - consumed_weight += weight; - }; + // let mut consumed_weight = 0; + // let mut add_weight = |reads, writes, weight| { + // consumed_weight += T::DbWeight::get().reads_writes(reads, writes); + // consumed_weight += weight; + // }; let block_pending = PendingUnstake::::take(current_block_number); - - add_weight(0, 1, 0); + let counter = block_pending.len() as u32; + // add_weight(0, 1, 0); if !block_pending.is_empty() { block_pending.into_iter().for_each(|(staker, amount)| { @@ -242,7 +242,8 @@ pub mod pallet { }); } - consumed_weight + T::WeightInfo::on_initialize(counter) + // consumed_weight } } @@ -280,7 +281,7 @@ pub mod pallet { let balance = <::Currency as Currency>::free_balance(&staker_id); - ensure!(balance >= amount, ArithmeticError::Underflow); + // ensure!(balance >= amount, ArithmeticError::Underflow); <::Currency as Currency>::ensure_can_withdraw( &staker_id, @@ -672,7 +673,7 @@ impl Pallet { LOCK_IDENTIFIER, staker, amount, - WithdrawReasons::all(), + WithdrawReasons::RESERVE, ) } } diff --git a/pallets/app-promotion/src/types.rs b/pallets/app-promotion/src/types.rs index 1e7306c5b0..347a43fca9 100644 --- a/pallets/app-promotion/src/types.rs +++ b/pallets/app-promotion/src/types.rs @@ -72,12 +72,16 @@ pub trait ContractHandler { type ContractId; type AccountId; - fn set_sponsor(sponsor_id: Self::AccountId, contract_id: Self::ContractId) -> DispatchResult; + fn set_sponsor( + sponsor_id: Self::AccountId, + contract_address: Self::ContractId, + ) -> DispatchResult; - fn remove_contract_sponsor(contract_id: Self::ContractId) -> DispatchResult; + fn remove_contract_sponsor(contract_address: Self::ContractId) -> DispatchResult; - fn get_sponsor(contract_id: Self::ContractId) - -> Result, DispatchError>; + fn get_sponsor( + contract_address: Self::ContractId, + ) -> Result, DispatchError>; } impl ContractHandler for EvmHelpersPallet { @@ -85,22 +89,20 @@ impl ContractHandler for EvmHelpersPallet { type AccountId = T::CrossAccountId; - fn set_sponsor(sponsor_id: Self::AccountId, contract_id: Self::ContractId) -> DispatchResult { - Sponsoring::::insert( - contract_id, - SponsorshipState::::Confirmed(sponsor_id), - ); - Ok(()) + fn set_sponsor( + sponsor_id: Self::AccountId, + contract_address: Self::ContractId, + ) -> DispatchResult { + Self::force_set_sponsor(contract_address, &sponsor_id) } - fn remove_contract_sponsor(contract_id: Self::ContractId) -> DispatchResult { - Sponsoring::::remove(contract_id); - Ok(()) + fn remove_contract_sponsor(contract_address: Self::ContractId) -> DispatchResult { + Self::force_remove_sponsor(contract_address) } fn get_sponsor( - contract_id: Self::ContractId, + contract_address: Self::ContractId, ) -> Result, DispatchError> { - Ok(Self::get_sponsor(contract_id)) + Ok(Self::get_sponsor(contract_address)) } } diff --git a/pallets/app-promotion/src/weights.rs b/pallets/app-promotion/src/weights.rs index 4a0733a0b8..641e2643c8 100644 --- a/pallets/app-promotion/src/weights.rs +++ b/pallets/app-promotion/src/weights.rs @@ -34,6 +34,7 @@ use sp_std::marker::PhantomData; /// Weight functions needed for pallet_app_promotion. pub trait WeightInfo { + fn on_initialize(b: u32, ) -> Weight; fn set_admin_address() -> Weight; fn payout_stakers(b: u32, ) -> Weight; fn stake() -> Weight; @@ -47,9 +48,19 @@ pub trait WeightInfo { /// Weights for pallet_app_promotion using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { + // Storage: AppPromotion PendingUnstake (r:1 w:0) + // Storage: System Account (r:1 w:1) + fn on_initialize(b: u32, ) -> Weight { + (2_461_000 as Weight) + // Standard Error: 87_000 + .saturating_add((6_006_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) + } // Storage: AppPromotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - (5_297_000 as Weight) + (5_467_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) @@ -57,9 +68,9 @@ impl WeightInfo for SubstrateWeight { // Storage: AppPromotion NextCalculatedRecord (r:1 w:1) // Storage: AppPromotion Staked (r:2 w:0) fn payout_stakers(b: u32, ) -> Weight { - (8_045_000 as Weight) - // Standard Error: 19_000 - .saturating_add((4_778_000 as Weight).saturating_mul(b as Weight)) + (4_946_000 as Weight) + // Standard Error: 5_000 + .saturating_add((4_599_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -71,7 +82,7 @@ impl WeightInfo for SubstrateWeight { // Storage: AppPromotion Staked (r:1 w:1) // Storage: AppPromotion TotalStaked (r:1 w:1) fn stake() -> Weight { - (17_623_000 as Weight) + (17_766_000 as Weight) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -82,35 +93,35 @@ impl WeightInfo for SubstrateWeight { // Storage: AppPromotion TotalStaked (r:1 w:1) // Storage: AppPromotion StakesPerAccount (r:0 w:1) fn unstake() -> Weight { - (27_190_000 as Weight) + (27_250_000 as Weight) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn sponsor_collection() -> Weight { - (11_351_000 as Weight) + (11_014_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn stop_sponsoring_collection() -> Weight { - (10_687_000 as Weight) + (10_494_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:0 w:1) fn sponsor_contract() -> Weight { - (2_332_000 as Weight) + (9_754_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:1 w:1) fn stop_sponsoring_contract() -> Weight { - (3_712_000 as Weight) + (10_063_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -118,9 +129,19 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { + // Storage: AppPromotion PendingUnstake (r:1 w:0) + // Storage: System Account (r:1 w:1) + fn on_initialize(b: u32, ) -> Weight { + (2_461_000 as Weight) + // Standard Error: 87_000 + .saturating_add((6_006_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) + .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) + } // Storage: AppPromotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - (5_297_000 as Weight) + (5_467_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) @@ -128,9 +149,9 @@ impl WeightInfo for () { // Storage: AppPromotion NextCalculatedRecord (r:1 w:1) // Storage: AppPromotion Staked (r:2 w:0) fn payout_stakers(b: u32, ) -> Weight { - (8_045_000 as Weight) - // Standard Error: 19_000 - .saturating_add((4_778_000 as Weight).saturating_mul(b as Weight)) + (4_946_000 as Weight) + // Standard Error: 5_000 + .saturating_add((4_599_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) @@ -142,7 +163,7 @@ impl WeightInfo for () { // Storage: AppPromotion Staked (r:1 w:1) // Storage: AppPromotion TotalStaked (r:1 w:1) fn stake() -> Weight { - (17_623_000 as Weight) + (17_766_000 as Weight) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -153,35 +174,35 @@ impl WeightInfo for () { // Storage: AppPromotion TotalStaked (r:1 w:1) // Storage: AppPromotion StakesPerAccount (r:0 w:1) fn unstake() -> Weight { - (27_190_000 as Weight) + (27_250_000 as Weight) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn sponsor_collection() -> Weight { - (11_351_000 as Weight) + (11_014_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn stop_sponsoring_collection() -> Weight { - (10_687_000 as Weight) + (10_494_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:0 w:1) fn sponsor_contract() -> Weight { - (2_332_000 as Weight) + (9_754_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:1 w:1) fn stop_sponsoring_contract() -> Weight { - (3_712_000 as Weight) + (10_063_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index dc0beca65a..de4ea9b474 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -122,8 +122,12 @@ where self.recorder().consume_sload()?; self.recorder().consume_sstore()?; + let caller = T::CrossAccountId::from_eth(caller); + + Pallet::::ensure_owner(contract_address, *caller.as_eth()) + .map_err(dispatch_to_evm::)?; + Pallet::::force_set_sponsor( - &T::CrossAccountId::from_eth(caller), contract_address, &T::CrossAccountId::from_eth(contract_address), ) diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index df014e82de..e2347bcaf8 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -216,20 +216,16 @@ pub mod pallet { Ok(()) } - /// Set sponsor as already confirmed. + /// TO-DO + /// /// - /// `sender` must be owner of contract. pub fn force_set_sponsor( - sender: &T::CrossAccountId, contract_address: H160, sponsor: &T::CrossAccountId, ) -> DispatchResult { - Pallet::::ensure_owner(contract_address, *sender.as_eth())?; Sponsoring::::insert( contract_address, - SponsorshipState::::Confirmed(T::CrossAccountId::from_eth( - contract_address, - )), + SponsorshipState::::Confirmed(sponsor.clone()), ); let eth_sponsor = *sponsor.as_eth(); @@ -265,13 +261,24 @@ pub mod pallet { /// Remove sponsor for `contract`. /// /// `sender` must be owner of contract. - pub fn remove_sponsor(sender: &T::CrossAccountId, contract_address: H160) -> DispatchResult { - Pallet::::ensure_owner(contract_address, *sender.as_eth())?; + pub fn remove_sponsor( + sender: &T::CrossAccountId, + contract_address: H160, + ) -> DispatchResult { + Self::ensure_owner(contract_address, *sender.as_eth())?; + Self::force_remove_sponsor(contract_address) + } + + /// TO-DO + /// + /// + pub fn force_remove_sponsor(contract_address: H160) -> DispatchResult { Sponsoring::::remove(contract_address); - >::deposit_event(Event::::ContractSponsorRemoved(contract_address)); + Self::deposit_event(Event::::ContractSponsorRemoved(contract_address)); >::deposit_log( - ContractHelpersEvents::ContractSponsorRemoved { contract_address }.to_log(contract_address), + ContractHelpersEvents::ContractSponsorRemoved { contract_address } + .to_log(contract_address), ); Ok(()) @@ -280,7 +287,10 @@ pub mod pallet { /// Confirm sponsorship. /// /// `sender` must be same that set via [`set_sponsor`]. - pub fn confirm_sponsorship(sender: &T::CrossAccountId, contract_address: H160) -> DispatchResult { + pub fn confirm_sponsorship( + sender: &T::CrossAccountId, + contract_address: H160, + ) -> DispatchResult { match Sponsoring::::get(contract_address) { SponsorshipState::Unconfirmed(sponsor) => { ensure!(sponsor == *sender, Error::::NoPermission); diff --git a/primitives/rpc/src/lib.rs b/primitives/rpc/src/lib.rs index 9bb57b58ab..e6a2471e13 100644 --- a/primitives/rpc/src/lib.rs +++ b/primitives/rpc/src/lib.rs @@ -33,8 +33,7 @@ type Result = core::result::Result; sp_api::decl_runtime_apis! { #[api_version(2)] /// Trait for generate rpc. - pub trait UniqueApi where - BlockNumber: Decode + Member + AtLeast32BitUnsigned, + pub trait UniqueApi where AccountId: Decode, CrossAccountId: pallet_evm::account::CrossAccountId, { diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index 911d4b77af..980223efa7 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -61,7 +61,7 @@ macro_rules! impl_common_runtime_apis { impl_runtime_apis! { $($($custom_apis)+)? - impl up_rpc::UniqueApi for Runtime { + impl up_rpc::UniqueApi for Runtime { fn account_tokens(collection: CollectionId, account: CrossAccountId) -> Result, DispatchError> { dispatch_unique_runtime!(collection.account_tokens(account)) } diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index 3f43a0fb98..f483b2936d 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -37,7 +37,7 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; }); - itWeb3.only('Set self sponsored events', async ({api, web3, privateKeyWrapper}) => { + itWeb3('Set self sponsored events', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const flipper = await deployFlipper(web3, owner); const helpers = contractHelpers(web3, owner); diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index 88d99339dd..f6f15f9190 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -218,6 +218,24 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; + evmContractHelpers: { + /** + * Collection sponsor was removed. + **/ + ContractSponsorRemoved: AugmentedEvent; + /** + * Contract sponsor was set. + **/ + ContractSponsorSet: AugmentedEvent; + /** + * New sponsor was confirm. + **/ + ContractSponsorshipConfirmed: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; parachainSystem: { /** * Downward messages were processed using the given weight. diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index 1a3a74f362..7400684155 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; @@ -835,6 +835,7 @@ declare module '@polkadot/types/types/registry' { PalletEvmCall: PalletEvmCall; PalletEvmCoderSubstrateError: PalletEvmCoderSubstrateError; PalletEvmContractHelpersError: PalletEvmContractHelpersError; + PalletEvmContractHelpersEvent: PalletEvmContractHelpersEvent; PalletEvmContractHelpersSponsoringModeT: PalletEvmContractHelpersSponsoringModeT; PalletEvmError: PalletEvmError; PalletEvmEvent: PalletEvmEvent; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 7683839f8f..7656b4e7c8 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -1188,6 +1188,17 @@ export interface PalletEvmContractHelpersError extends Enum { readonly type: 'NoPermission' | 'NoPendingSponsor'; } +/** @name PalletEvmContractHelpersEvent */ +export interface PalletEvmContractHelpersEvent extends Enum { + readonly isContractSponsorSet: boolean; + readonly asContractSponsorSet: ITuple<[H160, AccountId32]>; + readonly isContractSponsorshipConfirmed: boolean; + readonly asContractSponsorshipConfirmed: ITuple<[H160, AccountId32]>; + readonly isContractSponsorRemoved: boolean; + readonly asContractSponsorRemoved: H160; + readonly type: 'ContractSponsorSet' | 'ContractSponsorshipConfirmed' | 'ContractSponsorRemoved'; +} + /** @name PalletEvmContractHelpersSponsoringModeT */ export interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 1108be8de7..e8822a658a 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -1154,7 +1154,17 @@ export default { } }, /** - * Lookup117: frame_system::Phase + * Lookup117: pallet_evm_contract_helpers::pallet::Event + **/ + PalletEvmContractHelpersEvent: { + _enum: { + ContractSponsorSet: '(H160,AccountId32)', + ContractSponsorshipConfirmed: '(H160,AccountId32)', + ContractSponsorRemoved: 'H160' + } + }, + /** + * Lookup118: frame_system::Phase **/ FrameSystemPhase: { _enum: { @@ -1164,14 +1174,14 @@ export default { } }, /** - * Lookup119: frame_system::LastRuntimeUpgradeInfo + * Lookup120: frame_system::LastRuntimeUpgradeInfo **/ FrameSystemLastRuntimeUpgradeInfo: { specVersion: 'Compact', specName: 'Text' }, /** - * Lookup120: frame_system::pallet::Call + * Lookup121: frame_system::pallet::Call **/ FrameSystemCall: { _enum: { @@ -1209,7 +1219,7 @@ export default { } }, /** - * Lookup125: frame_system::limits::BlockWeights + * Lookup126: frame_system::limits::BlockWeights **/ FrameSystemLimitsBlockWeights: { baseBlock: 'u64', @@ -1217,7 +1227,7 @@ export default { perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass' }, /** - * Lookup126: frame_support::weights::PerDispatchClass + * Lookup127: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassWeightsPerClass: { normal: 'FrameSystemLimitsWeightsPerClass', @@ -1225,7 +1235,7 @@ export default { mandatory: 'FrameSystemLimitsWeightsPerClass' }, /** - * Lookup127: frame_system::limits::WeightsPerClass + * Lookup128: frame_system::limits::WeightsPerClass **/ FrameSystemLimitsWeightsPerClass: { baseExtrinsic: 'u64', @@ -1234,13 +1244,13 @@ export default { reserved: 'Option' }, /** - * Lookup129: frame_system::limits::BlockLength + * Lookup130: frame_system::limits::BlockLength **/ FrameSystemLimitsBlockLength: { max: 'FrameSupportWeightsPerDispatchClassU32' }, /** - * Lookup130: frame_support::weights::PerDispatchClass + * Lookup131: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassU32: { normal: 'u32', @@ -1248,14 +1258,14 @@ export default { mandatory: 'u32' }, /** - * Lookup131: frame_support::weights::RuntimeDbWeight + * Lookup132: frame_support::weights::RuntimeDbWeight **/ FrameSupportWeightsRuntimeDbWeight: { read: 'u64', write: 'u64' }, /** - * Lookup132: sp_version::RuntimeVersion + * Lookup133: sp_version::RuntimeVersion **/ SpVersionRuntimeVersion: { specName: 'Text', @@ -1268,13 +1278,13 @@ export default { stateVersion: 'u8' }, /** - * Lookup137: frame_system::pallet::Error + * Lookup138: frame_system::pallet::Error **/ FrameSystemError: { _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] }, /** - * Lookup138: polkadot_primitives::v2::PersistedValidationData + * Lookup139: polkadot_primitives::v2::PersistedValidationData **/ PolkadotPrimitivesV2PersistedValidationData: { parentHead: 'Bytes', @@ -1283,19 +1293,19 @@ export default { maxPovSize: 'u32' }, /** - * Lookup141: polkadot_primitives::v2::UpgradeRestriction + * Lookup142: polkadot_primitives::v2::UpgradeRestriction **/ PolkadotPrimitivesV2UpgradeRestriction: { _enum: ['Present'] }, /** - * Lookup142: sp_trie::storage_proof::StorageProof + * Lookup143: sp_trie::storage_proof::StorageProof **/ SpTrieStorageProof: { trieNodes: 'BTreeSet' }, /** - * Lookup144: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot + * Lookup145: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot **/ CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: { dmqMqcHead: 'H256', @@ -1304,7 +1314,7 @@ export default { egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>' }, /** - * Lookup147: polkadot_primitives::v2::AbridgedHrmpChannel + * Lookup148: polkadot_primitives::v2::AbridgedHrmpChannel **/ PolkadotPrimitivesV2AbridgedHrmpChannel: { maxCapacity: 'u32', @@ -1315,7 +1325,7 @@ export default { mqcHead: 'Option' }, /** - * Lookup148: polkadot_primitives::v2::AbridgedHostConfiguration + * Lookup149: polkadot_primitives::v2::AbridgedHostConfiguration **/ PolkadotPrimitivesV2AbridgedHostConfiguration: { maxCodeSize: 'u32', @@ -1329,14 +1339,14 @@ export default { validationUpgradeDelay: 'u32' }, /** - * Lookup154: polkadot_core_primitives::OutboundHrmpMessage + * Lookup155: polkadot_core_primitives::OutboundHrmpMessage **/ PolkadotCorePrimitivesOutboundHrmpMessage: { recipient: 'u32', data: 'Bytes' }, /** - * Lookup155: cumulus_pallet_parachain_system::pallet::Call + * Lookup156: cumulus_pallet_parachain_system::pallet::Call **/ CumulusPalletParachainSystemCall: { _enum: { @@ -1355,7 +1365,7 @@ export default { } }, /** - * Lookup156: cumulus_primitives_parachain_inherent::ParachainInherentData + * Lookup157: cumulus_primitives_parachain_inherent::ParachainInherentData **/ CumulusPrimitivesParachainInherentParachainInherentData: { validationData: 'PolkadotPrimitivesV2PersistedValidationData', @@ -1364,27 +1374,27 @@ export default { horizontalMessages: 'BTreeMap>' }, /** - * Lookup158: polkadot_core_primitives::InboundDownwardMessage + * Lookup159: polkadot_core_primitives::InboundDownwardMessage **/ PolkadotCorePrimitivesInboundDownwardMessage: { sentAt: 'u32', msg: 'Bytes' }, /** - * Lookup161: polkadot_core_primitives::InboundHrmpMessage + * Lookup162: polkadot_core_primitives::InboundHrmpMessage **/ PolkadotCorePrimitivesInboundHrmpMessage: { sentAt: 'u32', data: 'Bytes' }, /** - * Lookup164: cumulus_pallet_parachain_system::pallet::Error + * Lookup165: cumulus_pallet_parachain_system::pallet::Error **/ CumulusPalletParachainSystemError: { _enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized'] }, /** - * Lookup166: pallet_balances::BalanceLock + * Lookup167: pallet_balances::BalanceLock **/ PalletBalancesBalanceLock: { id: '[u8;8]', @@ -1392,26 +1402,26 @@ export default { reasons: 'PalletBalancesReasons' }, /** - * Lookup167: pallet_balances::Reasons + * Lookup168: pallet_balances::Reasons **/ PalletBalancesReasons: { _enum: ['Fee', 'Misc', 'All'] }, /** - * Lookup170: pallet_balances::ReserveData + * Lookup171: pallet_balances::ReserveData **/ PalletBalancesReserveData: { id: '[u8;16]', amount: 'u128' }, /** - * Lookup172: pallet_balances::Releases + * Lookup173: pallet_balances::Releases **/ PalletBalancesReleases: { _enum: ['V1_0_0', 'V2_0_0'] }, /** - * Lookup173: pallet_balances::pallet::Call + * Lookup174: pallet_balances::pallet::Call **/ PalletBalancesCall: { _enum: { @@ -1444,13 +1454,13 @@ export default { } }, /** - * Lookup176: pallet_balances::pallet::Error + * Lookup177: pallet_balances::pallet::Error **/ PalletBalancesError: { _enum: ['VestingBalance', 'LiquidityRestrictions', 'InsufficientBalance', 'ExistentialDeposit', 'KeepAlive', 'ExistingVestingSchedule', 'DeadAccount', 'TooManyReserves'] }, /** - * Lookup178: pallet_timestamp::pallet::Call + * Lookup179: pallet_timestamp::pallet::Call **/ PalletTimestampCall: { _enum: { @@ -1460,13 +1470,13 @@ export default { } }, /** - * Lookup180: pallet_transaction_payment::Releases + * Lookup181: pallet_transaction_payment::Releases **/ PalletTransactionPaymentReleases: { _enum: ['V1Ancient', 'V2'] }, /** - * Lookup181: pallet_treasury::Proposal + * Lookup182: pallet_treasury::Proposal **/ PalletTreasuryProposal: { proposer: 'AccountId32', @@ -1475,7 +1485,7 @@ export default { bond: 'u128' }, /** - * Lookup184: pallet_treasury::pallet::Call + * Lookup185: pallet_treasury::pallet::Call **/ PalletTreasuryCall: { _enum: { @@ -1499,17 +1509,17 @@ export default { } }, /** - * Lookup187: frame_support::PalletId + * Lookup188: frame_support::PalletId **/ FrameSupportPalletId: '[u8;8]', /** - * Lookup188: pallet_treasury::pallet::Error + * Lookup189: pallet_treasury::pallet::Error **/ PalletTreasuryError: { _enum: ['InsufficientProposersBalance', 'InvalidIndex', 'TooManyApprovals', 'InsufficientPermission', 'ProposalNotApproved'] }, /** - * Lookup189: pallet_sudo::pallet::Call + * Lookup190: pallet_sudo::pallet::Call **/ PalletSudoCall: { _enum: { @@ -1533,7 +1543,7 @@ export default { } }, /** - * Lookup191: orml_vesting::module::Call + * Lookup192: orml_vesting::module::Call **/ OrmlVestingModuleCall: { _enum: { @@ -1552,7 +1562,7 @@ export default { } }, /** - * Lookup193: cumulus_pallet_xcmp_queue::pallet::Call + * Lookup194: cumulus_pallet_xcmp_queue::pallet::Call **/ CumulusPalletXcmpQueueCall: { _enum: { @@ -1601,7 +1611,7 @@ export default { } }, /** - * Lookup194: pallet_xcm::pallet::Call + * Lookup195: pallet_xcm::pallet::Call **/ PalletXcmCall: { _enum: { @@ -1655,7 +1665,7 @@ export default { } }, /** - * Lookup195: xcm::VersionedXcm + * Lookup196: xcm::VersionedXcm **/ XcmVersionedXcm: { _enum: { @@ -1665,7 +1675,7 @@ export default { } }, /** - * Lookup196: xcm::v0::Xcm + * Lookup197: xcm::v0::Xcm **/ XcmV0Xcm: { _enum: { @@ -1719,7 +1729,7 @@ export default { } }, /** - * Lookup198: xcm::v0::order::Order + * Lookup199: xcm::v0::order::Order **/ XcmV0Order: { _enum: { @@ -1762,7 +1772,7 @@ export default { } }, /** - * Lookup200: xcm::v0::Response + * Lookup201: xcm::v0::Response **/ XcmV0Response: { _enum: { @@ -1770,7 +1780,7 @@ export default { } }, /** - * Lookup201: xcm::v1::Xcm + * Lookup202: xcm::v1::Xcm **/ XcmV1Xcm: { _enum: { @@ -1829,7 +1839,7 @@ export default { } }, /** - * Lookup203: xcm::v1::order::Order + * Lookup204: xcm::v1::order::Order **/ XcmV1Order: { _enum: { @@ -1874,7 +1884,7 @@ export default { } }, /** - * Lookup205: xcm::v1::Response + * Lookup206: xcm::v1::Response **/ XcmV1Response: { _enum: { @@ -1883,11 +1893,11 @@ export default { } }, /** - * Lookup219: cumulus_pallet_xcm::pallet::Call + * Lookup220: cumulus_pallet_xcm::pallet::Call **/ CumulusPalletXcmCall: 'Null', /** - * Lookup220: cumulus_pallet_dmp_queue::pallet::Call + * Lookup221: cumulus_pallet_dmp_queue::pallet::Call **/ CumulusPalletDmpQueueCall: { _enum: { @@ -1898,7 +1908,7 @@ export default { } }, /** - * Lookup221: pallet_inflation::pallet::Call + * Lookup222: pallet_inflation::pallet::Call **/ PalletInflationCall: { _enum: { @@ -1908,7 +1918,7 @@ export default { } }, /** - * Lookup222: pallet_unique::Call + * Lookup223: pallet_unique::Call **/ PalletUniqueCall: { _enum: { @@ -2040,7 +2050,7 @@ export default { } }, /** - * Lookup227: up_data_structs::CollectionMode + * Lookup228: up_data_structs::CollectionMode **/ UpDataStructsCollectionMode: { _enum: { @@ -2050,7 +2060,7 @@ export default { } }, /** - * Lookup228: up_data_structs::CreateCollectionData + * Lookup229: up_data_structs::CreateCollectionData **/ UpDataStructsCreateCollectionData: { mode: 'UpDataStructsCollectionMode', @@ -2065,13 +2075,13 @@ export default { properties: 'Vec' }, /** - * Lookup230: up_data_structs::AccessMode + * Lookup231: up_data_structs::AccessMode **/ UpDataStructsAccessMode: { _enum: ['Normal', 'AllowList'] }, /** - * Lookup232: up_data_structs::CollectionLimits + * Lookup233: up_data_structs::CollectionLimits **/ UpDataStructsCollectionLimits: { accountTokenOwnershipLimit: 'Option', @@ -2085,7 +2095,7 @@ export default { transfersEnabled: 'Option' }, /** - * Lookup234: up_data_structs::SponsoringRateLimit + * Lookup235: up_data_structs::SponsoringRateLimit **/ UpDataStructsSponsoringRateLimit: { _enum: { @@ -2094,7 +2104,7 @@ export default { } }, /** - * Lookup237: up_data_structs::CollectionPermissions + * Lookup238: up_data_structs::CollectionPermissions **/ UpDataStructsCollectionPermissions: { access: 'Option', @@ -2102,7 +2112,7 @@ export default { nesting: 'Option' }, /** - * Lookup239: up_data_structs::NestingPermissions + * Lookup240: up_data_structs::NestingPermissions **/ UpDataStructsNestingPermissions: { tokenOwner: 'bool', @@ -2110,18 +2120,18 @@ export default { restricted: 'Option' }, /** - * Lookup241: up_data_structs::OwnerRestrictedSet + * Lookup242: up_data_structs::OwnerRestrictedSet **/ UpDataStructsOwnerRestrictedSet: 'BTreeSet', /** - * Lookup246: up_data_structs::PropertyKeyPermission + * Lookup247: up_data_structs::PropertyKeyPermission **/ UpDataStructsPropertyKeyPermission: { key: 'Bytes', permission: 'UpDataStructsPropertyPermission' }, /** - * Lookup247: up_data_structs::PropertyPermission + * Lookup248: up_data_structs::PropertyPermission **/ UpDataStructsPropertyPermission: { mutable: 'bool', @@ -2129,14 +2139,14 @@ export default { tokenOwner: 'bool' }, /** - * Lookup250: up_data_structs::Property + * Lookup251: up_data_structs::Property **/ UpDataStructsProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup253: up_data_structs::CreateItemData + * Lookup254: up_data_structs::CreateItemData **/ UpDataStructsCreateItemData: { _enum: { @@ -2146,26 +2156,26 @@ export default { } }, /** - * Lookup254: up_data_structs::CreateNftData + * Lookup255: up_data_structs::CreateNftData **/ UpDataStructsCreateNftData: { properties: 'Vec' }, /** - * Lookup255: up_data_structs::CreateFungibleData + * Lookup256: up_data_structs::CreateFungibleData **/ UpDataStructsCreateFungibleData: { value: 'u128' }, /** - * Lookup256: up_data_structs::CreateReFungibleData + * Lookup257: up_data_structs::CreateReFungibleData **/ UpDataStructsCreateReFungibleData: { pieces: 'u128', properties: 'Vec' }, /** - * Lookup259: up_data_structs::CreateItemExData> + * Lookup260: up_data_structs::CreateItemExData> **/ UpDataStructsCreateItemExData: { _enum: { @@ -2176,14 +2186,14 @@ export default { } }, /** - * Lookup261: up_data_structs::CreateNftExData> + * Lookup262: up_data_structs::CreateNftExData> **/ UpDataStructsCreateNftExData: { properties: 'Vec', owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup268: up_data_structs::CreateRefungibleExSingleOwner> + * Lookup269: up_data_structs::CreateRefungibleExSingleOwner> **/ UpDataStructsCreateRefungibleExSingleOwner: { user: 'PalletEvmAccountBasicCrossAccountIdRepr', @@ -2191,14 +2201,14 @@ export default { properties: 'Vec' }, /** - * Lookup270: up_data_structs::CreateRefungibleExMultipleOwners> + * Lookup271: up_data_structs::CreateRefungibleExMultipleOwners> **/ UpDataStructsCreateRefungibleExMultipleOwners: { users: 'BTreeMap', properties: 'Vec' }, /** - * Lookup271: pallet_unique_scheduler::pallet::Call + * Lookup272: pallet_unique_scheduler::pallet::Call **/ PalletUniqueSchedulerCall: { _enum: { @@ -2222,7 +2232,7 @@ export default { } }, /** - * Lookup273: frame_support::traits::schedule::MaybeHashed + * Lookup274: frame_support::traits::schedule::MaybeHashed **/ FrameSupportScheduleMaybeHashed: { _enum: { @@ -2231,7 +2241,7 @@ export default { } }, /** - * Lookup274: pallet_configuration::pallet::Call + * Lookup275: pallet_configuration::pallet::Call **/ PalletConfigurationCall: { _enum: { @@ -2244,15 +2254,15 @@ export default { } }, /** - * Lookup275: pallet_template_transaction_payment::Call + * Lookup276: pallet_template_transaction_payment::Call **/ PalletTemplateTransactionPaymentCall: 'Null', /** - * Lookup276: pallet_structure::pallet::Call + * Lookup277: pallet_structure::pallet::Call **/ PalletStructureCall: 'Null', /** - * Lookup277: pallet_rmrk_core::pallet::Call + * Lookup278: pallet_rmrk_core::pallet::Call **/ PalletRmrkCoreCall: { _enum: { @@ -2343,7 +2353,7 @@ export default { } }, /** - * Lookup283: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup284: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceTypes: { _enum: { @@ -2353,7 +2363,7 @@ export default { } }, /** - * Lookup285: rmrk_traits::resource::BasicResource> + * Lookup286: rmrk_traits::resource::BasicResource> **/ RmrkTraitsResourceBasicResource: { src: 'Option', @@ -2362,7 +2372,7 @@ export default { thumb: 'Option' }, /** - * Lookup287: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup288: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceComposableResource: { parts: 'Vec', @@ -2373,7 +2383,7 @@ export default { thumb: 'Option' }, /** - * Lookup288: rmrk_traits::resource::SlotResource> + * Lookup289: rmrk_traits::resource::SlotResource> **/ RmrkTraitsResourceSlotResource: { base: 'u32', @@ -2384,7 +2394,7 @@ export default { thumb: 'Option' }, /** - * Lookup291: pallet_rmrk_equip::pallet::Call + * Lookup292: pallet_rmrk_equip::pallet::Call **/ PalletRmrkEquipCall: { _enum: { @@ -2405,7 +2415,7 @@ export default { } }, /** - * Lookup294: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup295: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPartPartType: { _enum: { @@ -2414,7 +2424,7 @@ export default { } }, /** - * Lookup296: rmrk_traits::part::FixedPart> + * Lookup297: rmrk_traits::part::FixedPart> **/ RmrkTraitsPartFixedPart: { id: 'u32', @@ -2422,7 +2432,7 @@ export default { src: 'Bytes' }, /** - * Lookup297: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup298: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPartSlotPart: { id: 'u32', @@ -2431,7 +2441,7 @@ export default { z: 'u32' }, /** - * Lookup298: rmrk_traits::part::EquippableList> + * Lookup299: rmrk_traits::part::EquippableList> **/ RmrkTraitsPartEquippableList: { _enum: { @@ -2441,7 +2451,7 @@ export default { } }, /** - * Lookup300: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> + * Lookup301: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> **/ RmrkTraitsTheme: { name: 'Bytes', @@ -2449,14 +2459,14 @@ export default { inherit: 'bool' }, /** - * Lookup302: rmrk_traits::theme::ThemeProperty> + * Lookup303: rmrk_traits::theme::ThemeProperty> **/ RmrkTraitsThemeThemeProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup304: pallet_app_promotion::pallet::Call + * Lookup305: pallet_app_promotion::pallet::Call **/ PalletAppPromotionCall: { _enum: { @@ -2485,7 +2495,7 @@ export default { } }, /** - * Lookup306: pallet_evm::pallet::Call + * Lookup307: pallet_evm::pallet::Call **/ PalletEvmCall: { _enum: { @@ -2528,7 +2538,7 @@ export default { } }, /** - * Lookup310: pallet_ethereum::pallet::Call + * Lookup311: pallet_ethereum::pallet::Call **/ PalletEthereumCall: { _enum: { @@ -2538,7 +2548,7 @@ export default { } }, /** - * Lookup311: ethereum::transaction::TransactionV2 + * Lookup312: ethereum::transaction::TransactionV2 **/ EthereumTransactionTransactionV2: { _enum: { @@ -2548,7 +2558,7 @@ export default { } }, /** - * Lookup312: ethereum::transaction::LegacyTransaction + * Lookup313: ethereum::transaction::LegacyTransaction **/ EthereumTransactionLegacyTransaction: { nonce: 'U256', @@ -2560,7 +2570,7 @@ export default { signature: 'EthereumTransactionTransactionSignature' }, /** - * Lookup313: ethereum::transaction::TransactionAction + * Lookup314: ethereum::transaction::TransactionAction **/ EthereumTransactionTransactionAction: { _enum: { @@ -2569,7 +2579,7 @@ export default { } }, /** - * Lookup314: ethereum::transaction::TransactionSignature + * Lookup315: ethereum::transaction::TransactionSignature **/ EthereumTransactionTransactionSignature: { v: 'u64', @@ -2577,7 +2587,7 @@ export default { s: 'H256' }, /** - * Lookup316: ethereum::transaction::EIP2930Transaction + * Lookup317: ethereum::transaction::EIP2930Transaction **/ EthereumTransactionEip2930Transaction: { chainId: 'u64', @@ -2593,14 +2603,14 @@ export default { s: 'H256' }, /** - * Lookup318: ethereum::transaction::AccessListItem + * Lookup319: ethereum::transaction::AccessListItem **/ EthereumTransactionAccessListItem: { address: 'H160', storageKeys: 'Vec' }, /** - * Lookup319: ethereum::transaction::EIP1559Transaction + * Lookup320: ethereum::transaction::EIP1559Transaction **/ EthereumTransactionEip1559Transaction: { chainId: 'u64', @@ -2617,7 +2627,7 @@ export default { s: 'H256' }, /** - * Lookup320: pallet_evm_migration::pallet::Call + * Lookup321: pallet_evm_migration::pallet::Call **/ PalletEvmMigrationCall: { _enum: { @@ -2635,19 +2645,19 @@ export default { } }, /** - * Lookup323: pallet_sudo::pallet::Error + * Lookup324: pallet_sudo::pallet::Error **/ PalletSudoError: { _enum: ['RequireSudo'] }, /** - * Lookup325: orml_vesting::module::Error + * Lookup326: orml_vesting::module::Error **/ OrmlVestingModuleError: { _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded'] }, /** - * Lookup327: cumulus_pallet_xcmp_queue::InboundChannelDetails + * Lookup328: cumulus_pallet_xcmp_queue::InboundChannelDetails **/ CumulusPalletXcmpQueueInboundChannelDetails: { sender: 'u32', @@ -2655,19 +2665,19 @@ export default { messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>' }, /** - * Lookup328: cumulus_pallet_xcmp_queue::InboundState + * Lookup329: cumulus_pallet_xcmp_queue::InboundState **/ CumulusPalletXcmpQueueInboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup331: polkadot_parachain::primitives::XcmpMessageFormat + * Lookup332: polkadot_parachain::primitives::XcmpMessageFormat **/ PolkadotParachainPrimitivesXcmpMessageFormat: { _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals'] }, /** - * Lookup334: cumulus_pallet_xcmp_queue::OutboundChannelDetails + * Lookup335: cumulus_pallet_xcmp_queue::OutboundChannelDetails **/ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: 'u32', @@ -2677,13 +2687,13 @@ export default { lastIndex: 'u16' }, /** - * Lookup335: cumulus_pallet_xcmp_queue::OutboundState + * Lookup336: cumulus_pallet_xcmp_queue::OutboundState **/ CumulusPalletXcmpQueueOutboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup337: cumulus_pallet_xcmp_queue::QueueConfigData + * Lookup338: cumulus_pallet_xcmp_queue::QueueConfigData **/ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: 'u32', @@ -2694,29 +2704,29 @@ export default { xcmpMaxIndividualWeight: 'u64' }, /** - * Lookup339: cumulus_pallet_xcmp_queue::pallet::Error + * Lookup340: cumulus_pallet_xcmp_queue::pallet::Error **/ CumulusPalletXcmpQueueError: { _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit'] }, /** - * Lookup340: pallet_xcm::pallet::Error + * Lookup341: pallet_xcm::pallet::Error **/ PalletXcmError: { _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed'] }, /** - * Lookup341: cumulus_pallet_xcm::pallet::Error + * Lookup342: cumulus_pallet_xcm::pallet::Error **/ CumulusPalletXcmError: 'Null', /** - * Lookup342: cumulus_pallet_dmp_queue::ConfigData + * Lookup343: cumulus_pallet_dmp_queue::ConfigData **/ CumulusPalletDmpQueueConfigData: { maxIndividual: 'u64' }, /** - * Lookup343: cumulus_pallet_dmp_queue::PageIndexData + * Lookup344: cumulus_pallet_dmp_queue::PageIndexData **/ CumulusPalletDmpQueuePageIndexData: { beginUsed: 'u32', @@ -2724,19 +2734,19 @@ export default { overweightCount: 'u64' }, /** - * Lookup346: cumulus_pallet_dmp_queue::pallet::Error + * Lookup347: cumulus_pallet_dmp_queue::pallet::Error **/ CumulusPalletDmpQueueError: { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup350: pallet_unique::Error + * Lookup351: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup353: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> + * Lookup354: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> **/ PalletUniqueSchedulerScheduledV3: { maybeId: 'Option<[u8;16]>', @@ -2746,7 +2756,7 @@ export default { origin: 'OpalRuntimeOriginCaller' }, /** - * Lookup354: opal_runtime::OriginCaller + * Lookup355: opal_runtime::OriginCaller **/ OpalRuntimeOriginCaller: { _enum: { @@ -2855,7 +2865,7 @@ export default { } }, /** - * Lookup355: frame_support::dispatch::RawOrigin + * Lookup356: frame_support::dispatch::RawOrigin **/ FrameSupportDispatchRawOrigin: { _enum: { @@ -2865,7 +2875,7 @@ export default { } }, /** - * Lookup356: pallet_xcm::pallet::Origin + * Lookup357: pallet_xcm::pallet::Origin **/ PalletXcmOrigin: { _enum: { @@ -2874,7 +2884,7 @@ export default { } }, /** - * Lookup357: cumulus_pallet_xcm::pallet::Origin + * Lookup358: cumulus_pallet_xcm::pallet::Origin **/ CumulusPalletXcmOrigin: { _enum: { @@ -2883,7 +2893,7 @@ export default { } }, /** - * Lookup358: pallet_ethereum::RawOrigin + * Lookup359: pallet_ethereum::RawOrigin **/ PalletEthereumRawOrigin: { _enum: { @@ -2891,17 +2901,17 @@ export default { } }, /** - * Lookup359: sp_core::Void + * Lookup360: sp_core::Void **/ SpCoreVoid: 'Null', /** - * Lookup360: pallet_unique_scheduler::pallet::Error + * Lookup361: pallet_unique_scheduler::pallet::Error **/ PalletUniqueSchedulerError: { _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] }, /** - * Lookup361: up_data_structs::Collection + * Lookup362: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -2915,7 +2925,7 @@ export default { externalCollection: 'bool' }, /** - * Lookup362: up_data_structs::SponsorshipState + * Lookup363: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipStateAccountId32: { _enum: { @@ -2925,7 +2935,7 @@ export default { } }, /** - * Lookup363: up_data_structs::Properties + * Lookup364: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -2933,15 +2943,15 @@ export default { spaceLimit: 'u32' }, /** - * Lookup364: up_data_structs::PropertiesMap> + * Lookup365: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** - * Lookup369: up_data_structs::PropertiesMap + * Lookup370: up_data_structs::PropertiesMap **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup376: up_data_structs::CollectionStats + * Lookup377: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -2949,18 +2959,18 @@ export default { alive: 'u32' }, /** - * Lookup377: up_data_structs::TokenChild + * Lookup378: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup378: PhantomType::up_data_structs + * Lookup379: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup380: up_data_structs::TokenData> + * Lookup381: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -2968,7 +2978,7 @@ export default { pieces: 'u128' }, /** - * Lookup382: up_data_structs::RpcCollection + * Lookup383: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -2984,7 +2994,7 @@ export default { readOnly: 'bool' }, /** - * Lookup383: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup384: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -2994,7 +3004,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup384: rmrk_traits::nft::NftInfo> + * Lookup385: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -3004,14 +3014,14 @@ export default { pending: 'bool' }, /** - * Lookup386: rmrk_traits::nft::RoyaltyInfo + * Lookup387: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup387: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup388: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -3020,14 +3030,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup388: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup389: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup389: rmrk_traits::base::BaseInfo> + * Lookup390: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -3035,86 +3045,86 @@ export default { symbol: 'Bytes' }, /** - * Lookup390: rmrk_traits::nft::NftChild + * Lookup391: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup392: pallet_common::pallet::Error + * Lookup393: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup394: pallet_fungible::pallet::Error + * Lookup395: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup395: pallet_refungible::ItemData + * Lookup396: pallet_refungible::ItemData **/ PalletRefungibleItemData: { constData: 'Bytes' }, /** - * Lookup400: pallet_refungible::pallet::Error + * Lookup401: pallet_refungible::pallet::Error **/ PalletRefungibleError: { _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup401: pallet_nonfungible::ItemData> + * Lookup402: pallet_nonfungible::ItemData> **/ PalletNonfungibleItemData: { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup403: up_data_structs::PropertyScope + * Lookup404: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { _enum: ['None', 'Rmrk'] }, /** - * Lookup405: pallet_nonfungible::pallet::Error + * Lookup406: pallet_nonfungible::pallet::Error **/ PalletNonfungibleError: { _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup406: pallet_structure::pallet::Error + * Lookup407: pallet_structure::pallet::Error **/ PalletStructureError: { _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup407: pallet_rmrk_core::pallet::Error + * Lookup408: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** - * Lookup409: pallet_rmrk_equip::pallet::Error + * Lookup410: pallet_rmrk_equip::pallet::Error **/ PalletRmrkEquipError: { _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] }, /** - * Lookup415: pallet_app_promotion::pallet::Error + * Lookup416: pallet_app_promotion::pallet::Error **/ PalletAppPromotionError: { _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'InvalidArgument'] }, /** - * Lookup418: pallet_evm::pallet::Error + * Lookup419: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup421: fp_rpc::TransactionStatus + * Lookup422: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -3126,11 +3136,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup423: ethbloom::Bloom + * Lookup424: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup425: ethereum::receipt::ReceiptV3 + * Lookup426: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -3140,7 +3150,7 @@ export default { } }, /** - * Lookup426: ethereum::receipt::EIP658ReceiptData + * Lookup427: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -3149,7 +3159,7 @@ export default { logs: 'Vec' }, /** - * Lookup427: ethereum::block::Block + * Lookup428: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -3157,7 +3167,7 @@ export default { ommers: 'Vec' }, /** - * Lookup428: ethereum::header::Header + * Lookup429: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -3177,23 +3187,23 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup429: ethereum_types::hash::H64 + * Lookup430: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup434: pallet_ethereum::pallet::Error + * Lookup435: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup435: pallet_evm_coder_substrate::pallet::Error + * Lookup436: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup436: up_data_structs::SponsorshipState> + * Lookup437: up_data_structs::SponsorshipState> **/ UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: { _enum: { @@ -3203,25 +3213,25 @@ export default { } }, /** - * Lookup437: pallet_evm_contract_helpers::SponsoringModeT + * Lookup438: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup439: pallet_evm_contract_helpers::pallet::Error + * Lookup440: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission', 'NoPendingSponsor'] }, /** - * Lookup440: pallet_evm_migration::pallet::Error + * Lookup441: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup442: sp_runtime::MultiSignature + * Lookup443: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3231,43 +3241,43 @@ export default { } }, /** - * Lookup443: sp_core::ed25519::Signature + * Lookup444: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup445: sp_core::sr25519::Signature + * Lookup446: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup446: sp_core::ecdsa::Signature + * Lookup447: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup449: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup450: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup450: frame_system::extensions::check_genesis::CheckGenesis + * Lookup451: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup453: frame_system::extensions::check_nonce::CheckNonce + * Lookup454: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup454: frame_system::extensions::check_weight::CheckWeight + * Lookup455: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup455: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup456: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup456: opal_runtime::Runtime + * Lookup457: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup457: pallet_ethereum::FakeTransactionFinalizer + * Lookup458: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index be526ecd7f..79ef1c3861 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { interface InterfaceTypes { @@ -106,6 +106,7 @@ declare module '@polkadot/types/types/registry' { PalletEvmCall: PalletEvmCall; PalletEvmCoderSubstrateError: PalletEvmCoderSubstrateError; PalletEvmContractHelpersError: PalletEvmContractHelpersError; + PalletEvmContractHelpersEvent: PalletEvmContractHelpersEvent; PalletEvmContractHelpersSponsoringModeT: PalletEvmContractHelpersSponsoringModeT; PalletEvmError: PalletEvmError; PalletEvmEvent: PalletEvmEvent; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 13acb65fde..0217b271f8 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1303,7 +1303,18 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; } - /** @name FrameSystemPhase (117) */ + /** @name PalletEvmContractHelpersEvent (117) */ + interface PalletEvmContractHelpersEvent extends Enum { + readonly isContractSponsorSet: boolean; + readonly asContractSponsorSet: ITuple<[H160, AccountId32]>; + readonly isContractSponsorshipConfirmed: boolean; + readonly asContractSponsorshipConfirmed: ITuple<[H160, AccountId32]>; + readonly isContractSponsorRemoved: boolean; + readonly asContractSponsorRemoved: H160; + readonly type: 'ContractSponsorSet' | 'ContractSponsorshipConfirmed' | 'ContractSponsorRemoved'; + } + + /** @name FrameSystemPhase (118) */ interface FrameSystemPhase extends Enum { readonly isApplyExtrinsic: boolean; readonly asApplyExtrinsic: u32; @@ -1312,13 +1323,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } - /** @name FrameSystemLastRuntimeUpgradeInfo (119) */ + /** @name FrameSystemLastRuntimeUpgradeInfo (120) */ interface FrameSystemLastRuntimeUpgradeInfo extends Struct { readonly specVersion: Compact; readonly specName: Text; } - /** @name FrameSystemCall (120) */ + /** @name FrameSystemCall (121) */ interface FrameSystemCall extends Enum { readonly isFillBlock: boolean; readonly asFillBlock: { @@ -1360,21 +1371,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent'; } - /** @name FrameSystemLimitsBlockWeights (125) */ + /** @name FrameSystemLimitsBlockWeights (126) */ interface FrameSystemLimitsBlockWeights extends Struct { readonly baseBlock: u64; readonly maxBlock: u64; readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; } - /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (126) */ + /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (127) */ interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { readonly normal: FrameSystemLimitsWeightsPerClass; readonly operational: FrameSystemLimitsWeightsPerClass; readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name FrameSystemLimitsWeightsPerClass (127) */ + /** @name FrameSystemLimitsWeightsPerClass (128) */ interface FrameSystemLimitsWeightsPerClass extends Struct { readonly baseExtrinsic: u64; readonly maxExtrinsic: Option; @@ -1382,25 +1393,25 @@ declare module '@polkadot/types/lookup' { readonly reserved: Option; } - /** @name FrameSystemLimitsBlockLength (129) */ + /** @name FrameSystemLimitsBlockLength (130) */ interface FrameSystemLimitsBlockLength extends Struct { readonly max: FrameSupportWeightsPerDispatchClassU32; } - /** @name FrameSupportWeightsPerDispatchClassU32 (130) */ + /** @name FrameSupportWeightsPerDispatchClassU32 (131) */ interface FrameSupportWeightsPerDispatchClassU32 extends Struct { readonly normal: u32; readonly operational: u32; readonly mandatory: u32; } - /** @name FrameSupportWeightsRuntimeDbWeight (131) */ + /** @name FrameSupportWeightsRuntimeDbWeight (132) */ interface FrameSupportWeightsRuntimeDbWeight extends Struct { readonly read: u64; readonly write: u64; } - /** @name SpVersionRuntimeVersion (132) */ + /** @name SpVersionRuntimeVersion (133) */ interface SpVersionRuntimeVersion extends Struct { readonly specName: Text; readonly implName: Text; @@ -1412,7 +1423,7 @@ declare module '@polkadot/types/lookup' { readonly stateVersion: u8; } - /** @name FrameSystemError (137) */ + /** @name FrameSystemError (138) */ interface FrameSystemError extends Enum { readonly isInvalidSpecName: boolean; readonly isSpecVersionNeedsToIncrease: boolean; @@ -1423,7 +1434,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name PolkadotPrimitivesV2PersistedValidationData (138) */ + /** @name PolkadotPrimitivesV2PersistedValidationData (139) */ interface PolkadotPrimitivesV2PersistedValidationData extends Struct { readonly parentHead: Bytes; readonly relayParentNumber: u32; @@ -1431,18 +1442,18 @@ declare module '@polkadot/types/lookup' { readonly maxPovSize: u32; } - /** @name PolkadotPrimitivesV2UpgradeRestriction (141) */ + /** @name PolkadotPrimitivesV2UpgradeRestriction (142) */ interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { readonly isPresent: boolean; readonly type: 'Present'; } - /** @name SpTrieStorageProof (142) */ + /** @name SpTrieStorageProof (143) */ interface SpTrieStorageProof extends Struct { readonly trieNodes: BTreeSet; } - /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (144) */ + /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (145) */ interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { readonly dmqMqcHead: H256; readonly relayDispatchQueueSize: ITuple<[u32, u32]>; @@ -1450,7 +1461,7 @@ declare module '@polkadot/types/lookup' { readonly egressChannels: Vec>; } - /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (147) */ + /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (148) */ interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { readonly maxCapacity: u32; readonly maxTotalSize: u32; @@ -1460,7 +1471,7 @@ declare module '@polkadot/types/lookup' { readonly mqcHead: Option; } - /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (148) */ + /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (149) */ interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { readonly maxCodeSize: u32; readonly maxHeadDataSize: u32; @@ -1473,13 +1484,13 @@ declare module '@polkadot/types/lookup' { readonly validationUpgradeDelay: u32; } - /** @name PolkadotCorePrimitivesOutboundHrmpMessage (154) */ + /** @name PolkadotCorePrimitivesOutboundHrmpMessage (155) */ interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { readonly recipient: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemCall (155) */ + /** @name CumulusPalletParachainSystemCall (156) */ interface CumulusPalletParachainSystemCall extends Enum { readonly isSetValidationData: boolean; readonly asSetValidationData: { @@ -1500,7 +1511,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade'; } - /** @name CumulusPrimitivesParachainInherentParachainInherentData (156) */ + /** @name CumulusPrimitivesParachainInherentParachainInherentData (157) */ interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { readonly validationData: PolkadotPrimitivesV2PersistedValidationData; readonly relayChainState: SpTrieStorageProof; @@ -1508,19 +1519,19 @@ declare module '@polkadot/types/lookup' { readonly horizontalMessages: BTreeMap>; } - /** @name PolkadotCorePrimitivesInboundDownwardMessage (158) */ + /** @name PolkadotCorePrimitivesInboundDownwardMessage (159) */ interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { readonly sentAt: u32; readonly msg: Bytes; } - /** @name PolkadotCorePrimitivesInboundHrmpMessage (161) */ + /** @name PolkadotCorePrimitivesInboundHrmpMessage (162) */ interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { readonly sentAt: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemError (164) */ + /** @name CumulusPalletParachainSystemError (165) */ interface CumulusPalletParachainSystemError extends Enum { readonly isOverlappingUpgrades: boolean; readonly isProhibitedByPolkadot: boolean; @@ -1533,14 +1544,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized'; } - /** @name PalletBalancesBalanceLock (166) */ + /** @name PalletBalancesBalanceLock (167) */ interface PalletBalancesBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; readonly reasons: PalletBalancesReasons; } - /** @name PalletBalancesReasons (167) */ + /** @name PalletBalancesReasons (168) */ interface PalletBalancesReasons extends Enum { readonly isFee: boolean; readonly isMisc: boolean; @@ -1548,20 +1559,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'Fee' | 'Misc' | 'All'; } - /** @name PalletBalancesReserveData (170) */ + /** @name PalletBalancesReserveData (171) */ interface PalletBalancesReserveData extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name PalletBalancesReleases (172) */ + /** @name PalletBalancesReleases (173) */ interface PalletBalancesReleases extends Enum { readonly isV100: boolean; readonly isV200: boolean; readonly type: 'V100' | 'V200'; } - /** @name PalletBalancesCall (173) */ + /** @name PalletBalancesCall (174) */ interface PalletBalancesCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1598,7 +1609,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; } - /** @name PalletBalancesError (176) */ + /** @name PalletBalancesError (177) */ interface PalletBalancesError extends Enum { readonly isVestingBalance: boolean; readonly isLiquidityRestrictions: boolean; @@ -1611,7 +1622,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves'; } - /** @name PalletTimestampCall (178) */ + /** @name PalletTimestampCall (179) */ interface PalletTimestampCall extends Enum { readonly isSet: boolean; readonly asSet: { @@ -1620,14 +1631,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Set'; } - /** @name PalletTransactionPaymentReleases (180) */ + /** @name PalletTransactionPaymentReleases (181) */ interface PalletTransactionPaymentReleases extends Enum { readonly isV1Ancient: boolean; readonly isV2: boolean; readonly type: 'V1Ancient' | 'V2'; } - /** @name PalletTreasuryProposal (181) */ + /** @name PalletTreasuryProposal (182) */ interface PalletTreasuryProposal extends Struct { readonly proposer: AccountId32; readonly value: u128; @@ -1635,7 +1646,7 @@ declare module '@polkadot/types/lookup' { readonly bond: u128; } - /** @name PalletTreasuryCall (184) */ + /** @name PalletTreasuryCall (185) */ interface PalletTreasuryCall extends Enum { readonly isProposeSpend: boolean; readonly asProposeSpend: { @@ -1662,10 +1673,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval'; } - /** @name FrameSupportPalletId (187) */ + /** @name FrameSupportPalletId (188) */ interface FrameSupportPalletId extends U8aFixed {} - /** @name PalletTreasuryError (188) */ + /** @name PalletTreasuryError (189) */ interface PalletTreasuryError extends Enum { readonly isInsufficientProposersBalance: boolean; readonly isInvalidIndex: boolean; @@ -1675,7 +1686,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved'; } - /** @name PalletSudoCall (189) */ + /** @name PalletSudoCall (190) */ interface PalletSudoCall extends Enum { readonly isSudo: boolean; readonly asSudo: { @@ -1698,7 +1709,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs'; } - /** @name OrmlVestingModuleCall (191) */ + /** @name OrmlVestingModuleCall (192) */ interface OrmlVestingModuleCall extends Enum { readonly isClaim: boolean; readonly isVestedTransfer: boolean; @@ -1718,7 +1729,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor'; } - /** @name CumulusPalletXcmpQueueCall (193) */ + /** @name CumulusPalletXcmpQueueCall (194) */ interface CumulusPalletXcmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { @@ -1754,7 +1765,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight'; } - /** @name PalletXcmCall (194) */ + /** @name PalletXcmCall (195) */ interface PalletXcmCall extends Enum { readonly isSend: boolean; readonly asSend: { @@ -1816,7 +1827,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets'; } - /** @name XcmVersionedXcm (195) */ + /** @name XcmVersionedXcm (196) */ interface XcmVersionedXcm extends Enum { readonly isV0: boolean; readonly asV0: XcmV0Xcm; @@ -1827,7 +1838,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1' | 'V2'; } - /** @name XcmV0Xcm (196) */ + /** @name XcmV0Xcm (197) */ interface XcmV0Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -1890,7 +1901,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom'; } - /** @name XcmV0Order (198) */ + /** @name XcmV0Order (199) */ interface XcmV0Order extends Enum { readonly isNull: boolean; readonly isDepositAsset: boolean; @@ -1938,14 +1949,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV0Response (200) */ + /** @name XcmV0Response (201) */ interface XcmV0Response extends Enum { readonly isAssets: boolean; readonly asAssets: Vec; readonly type: 'Assets'; } - /** @name XcmV1Xcm (201) */ + /** @name XcmV1Xcm (202) */ interface XcmV1Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -2014,7 +2025,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion'; } - /** @name XcmV1Order (203) */ + /** @name XcmV1Order (204) */ interface XcmV1Order extends Enum { readonly isNoop: boolean; readonly isDepositAsset: boolean; @@ -2064,7 +2075,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV1Response (205) */ + /** @name XcmV1Response (206) */ interface XcmV1Response extends Enum { readonly isAssets: boolean; readonly asAssets: XcmV1MultiassetMultiAssets; @@ -2073,10 +2084,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'Assets' | 'Version'; } - /** @name CumulusPalletXcmCall (219) */ + /** @name CumulusPalletXcmCall (220) */ type CumulusPalletXcmCall = Null; - /** @name CumulusPalletDmpQueueCall (220) */ + /** @name CumulusPalletDmpQueueCall (221) */ interface CumulusPalletDmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { @@ -2086,7 +2097,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight'; } - /** @name PalletInflationCall (221) */ + /** @name PalletInflationCall (222) */ interface PalletInflationCall extends Enum { readonly isStartInflation: boolean; readonly asStartInflation: { @@ -2095,7 +2106,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'StartInflation'; } - /** @name PalletUniqueCall (222) */ + /** @name PalletUniqueCall (223) */ interface PalletUniqueCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -2253,7 +2264,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; } - /** @name UpDataStructsCollectionMode (227) */ + /** @name UpDataStructsCollectionMode (228) */ interface UpDataStructsCollectionMode extends Enum { readonly isNft: boolean; readonly isFungible: boolean; @@ -2262,7 +2273,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateCollectionData (228) */ + /** @name UpDataStructsCreateCollectionData (229) */ interface UpDataStructsCreateCollectionData extends Struct { readonly mode: UpDataStructsCollectionMode; readonly access: Option; @@ -2276,14 +2287,14 @@ declare module '@polkadot/types/lookup' { readonly properties: Vec; } - /** @name UpDataStructsAccessMode (230) */ + /** @name UpDataStructsAccessMode (231) */ interface UpDataStructsAccessMode extends Enum { readonly isNormal: boolean; readonly isAllowList: boolean; readonly type: 'Normal' | 'AllowList'; } - /** @name UpDataStructsCollectionLimits (232) */ + /** @name UpDataStructsCollectionLimits (233) */ interface UpDataStructsCollectionLimits extends Struct { readonly accountTokenOwnershipLimit: Option; readonly sponsoredDataSize: Option; @@ -2296,7 +2307,7 @@ declare module '@polkadot/types/lookup' { readonly transfersEnabled: Option; } - /** @name UpDataStructsSponsoringRateLimit (234) */ + /** @name UpDataStructsSponsoringRateLimit (235) */ interface UpDataStructsSponsoringRateLimit extends Enum { readonly isSponsoringDisabled: boolean; readonly isBlocks: boolean; @@ -2304,43 +2315,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'SponsoringDisabled' | 'Blocks'; } - /** @name UpDataStructsCollectionPermissions (237) */ + /** @name UpDataStructsCollectionPermissions (238) */ interface UpDataStructsCollectionPermissions extends Struct { readonly access: Option; readonly mintMode: Option; readonly nesting: Option; } - /** @name UpDataStructsNestingPermissions (239) */ + /** @name UpDataStructsNestingPermissions (240) */ interface UpDataStructsNestingPermissions extends Struct { readonly tokenOwner: bool; readonly collectionAdmin: bool; readonly restricted: Option; } - /** @name UpDataStructsOwnerRestrictedSet (241) */ + /** @name UpDataStructsOwnerRestrictedSet (242) */ interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} - /** @name UpDataStructsPropertyKeyPermission (246) */ + /** @name UpDataStructsPropertyKeyPermission (247) */ interface UpDataStructsPropertyKeyPermission extends Struct { readonly key: Bytes; readonly permission: UpDataStructsPropertyPermission; } - /** @name UpDataStructsPropertyPermission (247) */ + /** @name UpDataStructsPropertyPermission (248) */ interface UpDataStructsPropertyPermission extends Struct { readonly mutable: bool; readonly collectionAdmin: bool; readonly tokenOwner: bool; } - /** @name UpDataStructsProperty (250) */ + /** @name UpDataStructsProperty (251) */ interface UpDataStructsProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name UpDataStructsCreateItemData (253) */ + /** @name UpDataStructsCreateItemData (254) */ interface UpDataStructsCreateItemData extends Enum { readonly isNft: boolean; readonly asNft: UpDataStructsCreateNftData; @@ -2351,23 +2362,23 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateNftData (254) */ + /** @name UpDataStructsCreateNftData (255) */ interface UpDataStructsCreateNftData extends Struct { readonly properties: Vec; } - /** @name UpDataStructsCreateFungibleData (255) */ + /** @name UpDataStructsCreateFungibleData (256) */ interface UpDataStructsCreateFungibleData extends Struct { readonly value: u128; } - /** @name UpDataStructsCreateReFungibleData (256) */ + /** @name UpDataStructsCreateReFungibleData (257) */ interface UpDataStructsCreateReFungibleData extends Struct { readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateItemExData (259) */ + /** @name UpDataStructsCreateItemExData (260) */ interface UpDataStructsCreateItemExData extends Enum { readonly isNft: boolean; readonly asNft: Vec; @@ -2380,26 +2391,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; } - /** @name UpDataStructsCreateNftExData (261) */ + /** @name UpDataStructsCreateNftExData (262) */ interface UpDataStructsCreateNftExData extends Struct { readonly properties: Vec; readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsCreateRefungibleExSingleOwner (268) */ + /** @name UpDataStructsCreateRefungibleExSingleOwner (269) */ interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { readonly user: PalletEvmAccountBasicCrossAccountIdRepr; readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateRefungibleExMultipleOwners (270) */ + /** @name UpDataStructsCreateRefungibleExMultipleOwners (271) */ interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { readonly users: BTreeMap; readonly properties: Vec; } - /** @name PalletUniqueSchedulerCall (271) */ + /** @name PalletUniqueSchedulerCall (272) */ interface PalletUniqueSchedulerCall extends Enum { readonly isScheduleNamed: boolean; readonly asScheduleNamed: { @@ -2424,7 +2435,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; } - /** @name FrameSupportScheduleMaybeHashed (273) */ + /** @name FrameSupportScheduleMaybeHashed (274) */ interface FrameSupportScheduleMaybeHashed extends Enum { readonly isValue: boolean; readonly asValue: Call; @@ -2433,7 +2444,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Value' | 'Hash'; } - /** @name PalletConfigurationCall (274) */ + /** @name PalletConfigurationCall (275) */ interface PalletConfigurationCall extends Enum { readonly isSetWeightToFeeCoefficientOverride: boolean; readonly asSetWeightToFeeCoefficientOverride: { @@ -2446,13 +2457,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride'; } - /** @name PalletTemplateTransactionPaymentCall (275) */ + /** @name PalletTemplateTransactionPaymentCall (276) */ type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletStructureCall (276) */ + /** @name PalletStructureCall (277) */ type PalletStructureCall = Null; - /** @name PalletRmrkCoreCall (277) */ + /** @name PalletRmrkCoreCall (278) */ interface PalletRmrkCoreCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -2558,7 +2569,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; } - /** @name RmrkTraitsResourceResourceTypes (283) */ + /** @name RmrkTraitsResourceResourceTypes (284) */ interface RmrkTraitsResourceResourceTypes extends Enum { readonly isBasic: boolean; readonly asBasic: RmrkTraitsResourceBasicResource; @@ -2569,7 +2580,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Basic' | 'Composable' | 'Slot'; } - /** @name RmrkTraitsResourceBasicResource (285) */ + /** @name RmrkTraitsResourceBasicResource (286) */ interface RmrkTraitsResourceBasicResource extends Struct { readonly src: Option; readonly metadata: Option; @@ -2577,7 +2588,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceComposableResource (287) */ + /** @name RmrkTraitsResourceComposableResource (288) */ interface RmrkTraitsResourceComposableResource extends Struct { readonly parts: Vec; readonly base: u32; @@ -2587,7 +2598,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceSlotResource (288) */ + /** @name RmrkTraitsResourceSlotResource (289) */ interface RmrkTraitsResourceSlotResource extends Struct { readonly base: u32; readonly src: Option; @@ -2597,7 +2608,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name PalletRmrkEquipCall (291) */ + /** @name PalletRmrkEquipCall (292) */ interface PalletRmrkEquipCall extends Enum { readonly isCreateBase: boolean; readonly asCreateBase: { @@ -2619,7 +2630,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; } - /** @name RmrkTraitsPartPartType (294) */ + /** @name RmrkTraitsPartPartType (295) */ interface RmrkTraitsPartPartType extends Enum { readonly isFixedPart: boolean; readonly asFixedPart: RmrkTraitsPartFixedPart; @@ -2628,14 +2639,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'FixedPart' | 'SlotPart'; } - /** @name RmrkTraitsPartFixedPart (296) */ + /** @name RmrkTraitsPartFixedPart (297) */ interface RmrkTraitsPartFixedPart extends Struct { readonly id: u32; readonly z: u32; readonly src: Bytes; } - /** @name RmrkTraitsPartSlotPart (297) */ + /** @name RmrkTraitsPartSlotPart (298) */ interface RmrkTraitsPartSlotPart extends Struct { readonly id: u32; readonly equippable: RmrkTraitsPartEquippableList; @@ -2643,7 +2654,7 @@ declare module '@polkadot/types/lookup' { readonly z: u32; } - /** @name RmrkTraitsPartEquippableList (298) */ + /** @name RmrkTraitsPartEquippableList (299) */ interface RmrkTraitsPartEquippableList extends Enum { readonly isAll: boolean; readonly isEmpty: boolean; @@ -2652,20 +2663,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'All' | 'Empty' | 'Custom'; } - /** @name RmrkTraitsTheme (300) */ + /** @name RmrkTraitsTheme (301) */ interface RmrkTraitsTheme extends Struct { readonly name: Bytes; readonly properties: Vec; readonly inherit: bool; } - /** @name RmrkTraitsThemeThemeProperty (302) */ + /** @name RmrkTraitsThemeThemeProperty (303) */ interface RmrkTraitsThemeThemeProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name PalletAppPromotionCall (304) */ + /** @name PalletAppPromotionCall (305) */ interface PalletAppPromotionCall extends Enum { readonly isSetAdminAddress: boolean; readonly asSetAdminAddress: { @@ -2699,7 +2710,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorConract' | 'StopSponsoringContract' | 'PayoutStakers'; } - /** @name PalletEvmCall (306) */ + /** @name PalletEvmCall (307) */ interface PalletEvmCall extends Enum { readonly isWithdraw: boolean; readonly asWithdraw: { @@ -2744,7 +2755,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name PalletEthereumCall (310) */ + /** @name PalletEthereumCall (311) */ interface PalletEthereumCall extends Enum { readonly isTransact: boolean; readonly asTransact: { @@ -2753,7 +2764,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transact'; } - /** @name EthereumTransactionTransactionV2 (311) */ + /** @name EthereumTransactionTransactionV2 (312) */ interface EthereumTransactionTransactionV2 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumTransactionLegacyTransaction; @@ -2764,7 +2775,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumTransactionLegacyTransaction (312) */ + /** @name EthereumTransactionLegacyTransaction (313) */ interface EthereumTransactionLegacyTransaction extends Struct { readonly nonce: U256; readonly gasPrice: U256; @@ -2775,7 +2786,7 @@ declare module '@polkadot/types/lookup' { readonly signature: EthereumTransactionTransactionSignature; } - /** @name EthereumTransactionTransactionAction (313) */ + /** @name EthereumTransactionTransactionAction (314) */ interface EthereumTransactionTransactionAction extends Enum { readonly isCall: boolean; readonly asCall: H160; @@ -2783,14 +2794,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Call' | 'Create'; } - /** @name EthereumTransactionTransactionSignature (314) */ + /** @name EthereumTransactionTransactionSignature (315) */ interface EthereumTransactionTransactionSignature extends Struct { readonly v: u64; readonly r: H256; readonly s: H256; } - /** @name EthereumTransactionEip2930Transaction (316) */ + /** @name EthereumTransactionEip2930Transaction (317) */ interface EthereumTransactionEip2930Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -2805,13 +2816,13 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name EthereumTransactionAccessListItem (318) */ + /** @name EthereumTransactionAccessListItem (319) */ interface EthereumTransactionAccessListItem extends Struct { readonly address: H160; readonly storageKeys: Vec; } - /** @name EthereumTransactionEip1559Transaction (319) */ + /** @name EthereumTransactionEip1559Transaction (320) */ interface EthereumTransactionEip1559Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -2827,7 +2838,7 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name PalletEvmMigrationCall (320) */ + /** @name PalletEvmMigrationCall (321) */ interface PalletEvmMigrationCall extends Enum { readonly isBegin: boolean; readonly asBegin: { @@ -2846,13 +2857,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Begin' | 'SetData' | 'Finish'; } - /** @name PalletSudoError (323) */ + /** @name PalletSudoError (324) */ interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: 'RequireSudo'; } - /** @name OrmlVestingModuleError (325) */ + /** @name OrmlVestingModuleError (326) */ interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; @@ -2863,21 +2874,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (327) */ + /** @name CumulusPalletXcmpQueueInboundChannelDetails (328) */ interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (328) */ + /** @name CumulusPalletXcmpQueueInboundState (329) */ interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (331) */ + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (332) */ interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; @@ -2885,7 +2896,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (334) */ + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (335) */ interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; @@ -2894,14 +2905,14 @@ declare module '@polkadot/types/lookup' { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (335) */ + /** @name CumulusPalletXcmpQueueOutboundState (336) */ interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (337) */ + /** @name CumulusPalletXcmpQueueQueueConfigData (338) */ interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; @@ -2911,7 +2922,7 @@ declare module '@polkadot/types/lookup' { readonly xcmpMaxIndividualWeight: u64; } - /** @name CumulusPalletXcmpQueueError (339) */ + /** @name CumulusPalletXcmpQueueError (340) */ interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; @@ -2921,7 +2932,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (340) */ + /** @name PalletXcmError (341) */ interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; @@ -2939,29 +2950,29 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (341) */ + /** @name CumulusPalletXcmError (342) */ type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (342) */ + /** @name CumulusPalletDmpQueueConfigData (343) */ interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: u64; } - /** @name CumulusPalletDmpQueuePageIndexData (343) */ + /** @name CumulusPalletDmpQueuePageIndexData (344) */ interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (346) */ + /** @name CumulusPalletDmpQueueError (347) */ interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (350) */ + /** @name PalletUniqueError (351) */ interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; @@ -2970,7 +2981,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name PalletUniqueSchedulerScheduledV3 (353) */ + /** @name PalletUniqueSchedulerScheduledV3 (354) */ interface PalletUniqueSchedulerScheduledV3 extends Struct { readonly maybeId: Option; readonly priority: u8; @@ -2979,7 +2990,7 @@ declare module '@polkadot/types/lookup' { readonly origin: OpalRuntimeOriginCaller; } - /** @name OpalRuntimeOriginCaller (354) */ + /** @name OpalRuntimeOriginCaller (355) */ interface OpalRuntimeOriginCaller extends Enum { readonly isSystem: boolean; readonly asSystem: FrameSupportDispatchRawOrigin; @@ -2993,7 +3004,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; } - /** @name FrameSupportDispatchRawOrigin (355) */ + /** @name FrameSupportDispatchRawOrigin (356) */ interface FrameSupportDispatchRawOrigin extends Enum { readonly isRoot: boolean; readonly isSigned: boolean; @@ -3002,7 +3013,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Root' | 'Signed' | 'None'; } - /** @name PalletXcmOrigin (356) */ + /** @name PalletXcmOrigin (357) */ interface PalletXcmOrigin extends Enum { readonly isXcm: boolean; readonly asXcm: XcmV1MultiLocation; @@ -3011,7 +3022,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Xcm' | 'Response'; } - /** @name CumulusPalletXcmOrigin (357) */ + /** @name CumulusPalletXcmOrigin (358) */ interface CumulusPalletXcmOrigin extends Enum { readonly isRelay: boolean; readonly isSiblingParachain: boolean; @@ -3019,17 +3030,17 @@ declare module '@polkadot/types/lookup' { readonly type: 'Relay' | 'SiblingParachain'; } - /** @name PalletEthereumRawOrigin (358) */ + /** @name PalletEthereumRawOrigin (359) */ interface PalletEthereumRawOrigin extends Enum { readonly isEthereumTransaction: boolean; readonly asEthereumTransaction: H160; readonly type: 'EthereumTransaction'; } - /** @name SpCoreVoid (359) */ + /** @name SpCoreVoid (360) */ type SpCoreVoid = Null; - /** @name PalletUniqueSchedulerError (360) */ + /** @name PalletUniqueSchedulerError (361) */ interface PalletUniqueSchedulerError extends Enum { readonly isFailedToSchedule: boolean; readonly isNotFound: boolean; @@ -3038,7 +3049,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; } - /** @name UpDataStructsCollection (361) */ + /** @name UpDataStructsCollection (362) */ interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3051,7 +3062,7 @@ declare module '@polkadot/types/lookup' { readonly externalCollection: bool; } - /** @name UpDataStructsSponsorshipStateAccountId32 (362) */ + /** @name UpDataStructsSponsorshipStateAccountId32 (363) */ interface UpDataStructsSponsorshipStateAccountId32 extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3061,43 +3072,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (363) */ + /** @name UpDataStructsProperties (364) */ interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (364) */ + /** @name UpDataStructsPropertiesMapBoundedVec (365) */ interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (369) */ + /** @name UpDataStructsPropertiesMapPropertyPermission (370) */ interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (376) */ + /** @name UpDataStructsCollectionStats (377) */ interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (377) */ + /** @name UpDataStructsTokenChild (378) */ interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (378) */ + /** @name PhantomTypeUpDataStructs (379) */ interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (380) */ + /** @name UpDataStructsTokenData (381) */ interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (382) */ + /** @name UpDataStructsRpcCollection (383) */ interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3112,7 +3123,7 @@ declare module '@polkadot/types/lookup' { readonly readOnly: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (383) */ + /** @name RmrkTraitsCollectionCollectionInfo (384) */ interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; @@ -3121,7 +3132,7 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (384) */ + /** @name RmrkTraitsNftNftInfo (385) */ interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; @@ -3130,13 +3141,13 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (386) */ + /** @name RmrkTraitsNftRoyaltyInfo (387) */ interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (387) */ + /** @name RmrkTraitsResourceResourceInfo (388) */ interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; @@ -3144,26 +3155,26 @@ declare module '@polkadot/types/lookup' { readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (388) */ + /** @name RmrkTraitsPropertyPropertyInfo (389) */ interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (389) */ + /** @name RmrkTraitsBaseBaseInfo (390) */ interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (390) */ + /** @name RmrkTraitsNftNftChild (391) */ interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (392) */ + /** @name PalletCommonError (393) */ interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; @@ -3202,7 +3213,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (394) */ + /** @name PalletFungibleError (395) */ interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; @@ -3212,12 +3223,12 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (395) */ + /** @name PalletRefungibleItemData (396) */ interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } - /** @name PalletRefungibleError (400) */ + /** @name PalletRefungibleError (401) */ interface PalletRefungibleError extends Enum { readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isWrongRefungiblePieces: boolean; @@ -3227,19 +3238,19 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletNonfungibleItemData (401) */ + /** @name PalletNonfungibleItemData (402) */ interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (403) */ + /** @name UpDataStructsPropertyScope (404) */ interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; readonly type: 'None' | 'Rmrk'; } - /** @name PalletNonfungibleError (405) */ + /** @name PalletNonfungibleError (406) */ interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; @@ -3247,7 +3258,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (406) */ + /** @name PalletStructureError (407) */ interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; @@ -3256,7 +3267,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletRmrkCoreError (407) */ + /** @name PalletRmrkCoreError (408) */ interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; @@ -3280,7 +3291,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } - /** @name PalletRmrkEquipError (409) */ + /** @name PalletRmrkEquipError (410) */ interface PalletRmrkEquipError extends Enum { readonly isPermissionError: boolean; readonly isNoAvailableBaseId: boolean; @@ -3292,7 +3303,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; } - /** @name PalletAppPromotionError (415) */ + /** @name PalletAppPromotionError (416) */ interface PalletAppPromotionError extends Enum { readonly isAdminNotSet: boolean; readonly isNoPermission: boolean; @@ -3302,7 +3313,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'InvalidArgument'; } - /** @name PalletEvmError (418) */ + /** @name PalletEvmError (419) */ interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; @@ -3313,7 +3324,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (421) */ + /** @name FpRpcTransactionStatus (422) */ interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; @@ -3324,10 +3335,10 @@ declare module '@polkadot/types/lookup' { readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (423) */ + /** @name EthbloomBloom (424) */ interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (425) */ + /** @name EthereumReceiptReceiptV3 (426) */ interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; @@ -3338,7 +3349,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (426) */ + /** @name EthereumReceiptEip658ReceiptData (427) */ interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; @@ -3346,14 +3357,14 @@ declare module '@polkadot/types/lookup' { readonly logs: Vec; } - /** @name EthereumBlock (427) */ + /** @name EthereumBlock (428) */ interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (428) */ + /** @name EthereumHeader (429) */ interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; @@ -3372,24 +3383,24 @@ declare module '@polkadot/types/lookup' { readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (429) */ + /** @name EthereumTypesHashH64 (430) */ interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (434) */ + /** @name PalletEthereumError (435) */ interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (435) */ + /** @name PalletEvmCoderSubstrateError (436) */ interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (436) */ + /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (437) */ interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3399,7 +3410,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name PalletEvmContractHelpersSponsoringModeT (437) */ + /** @name PalletEvmContractHelpersSponsoringModeT (438) */ interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; @@ -3407,21 +3418,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (439) */ + /** @name PalletEvmContractHelpersError (440) */ interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly isNoPendingSponsor: boolean; readonly type: 'NoPermission' | 'NoPendingSponsor'; } - /** @name PalletEvmMigrationError (440) */ + /** @name PalletEvmMigrationError (441) */ interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (442) */ + /** @name SpRuntimeMultiSignature (443) */ interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; @@ -3432,34 +3443,34 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (443) */ + /** @name SpCoreEd25519Signature (444) */ interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (445) */ + /** @name SpCoreSr25519Signature (446) */ interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (446) */ + /** @name SpCoreEcdsaSignature (447) */ interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (449) */ + /** @name FrameSystemExtensionsCheckSpecVersion (450) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (450) */ + /** @name FrameSystemExtensionsCheckGenesis (451) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (453) */ + /** @name FrameSystemExtensionsCheckNonce (454) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (454) */ + /** @name FrameSystemExtensionsCheckWeight (455) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (455) */ + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (456) */ interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (456) */ + /** @name OpalRuntimeRuntime (457) */ type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (457) */ + /** @name PalletEthereumFakeTransactionFinalizer (458) */ type PalletEthereumFakeTransactionFinalizer = Null; } // declare module From 28d7737590e57f5f38c1826ba3bf38c431e72ec2 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 6 Sep 2022 17:44:48 +0300 Subject: [PATCH 0736/1274] Transaction commisions displayed --- tests/src/xcm/xcmOpal.test.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/src/xcm/xcmOpal.test.ts b/tests/src/xcm/xcmOpal.test.ts index 35a1aa6091..0176e8b364 100644 --- a/tests/src/xcm/xcmOpal.test.ts +++ b/tests/src/xcm/xcmOpal.test.ts @@ -48,7 +48,7 @@ const TRANSFER_AMOUNT = 1_000_000_000_000_000_000n; // 10,000.00 (ten thousands) USDT const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n; -describe('Integration test: Exchanging USDT with Statemine', () => { +describe('Integration test: Exchanging USDT with Westmint', () => { let alice: IKeyringPair; let bob: IKeyringPair; @@ -61,7 +61,6 @@ describe('Integration test: Exchanging USDT with Statemine', () => { let balanceBobBefore: bigint; let balanceBobAfter: bigint; - let balanceBobFinal: bigint; before(async () => { await usingApi(async (api, privateKeyWrapper) => { @@ -204,7 +203,7 @@ describe('Integration test: Exchanging USDT with Statemine', () => { }); - it('Should connect and send USDT from Statemine to Unique', async () => { + it('Should connect and send USDT from Westmint to Opal', async () => { const statemineApiOptions: ApiOptions = { provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT), @@ -277,6 +276,7 @@ describe('Integration test: Exchanging USDT with Statemine', () => { [balanceStmnAfter] = await getBalance(api, [alice.address]); // common good parachain take commission in it native token + console.log('Opal to Westmint transaction fees on Westmint: %s WND', balanceStmnBefore - balanceStmnAfter); expect(balanceStmnBefore > balanceStmnAfter).to.be.true; }, statemineApiOptions); @@ -292,9 +292,10 @@ describe('Integration test: Exchanging USDT with Statemine', () => { // commission has not paid in USDT token expect(free == TRANSFER_AMOUNT).to.be.true; + console.log('Opal to Westmint transaction fees on Opal: %s USDT', TRANSFER_AMOUNT - free); // ... and parachain native token expect(balanceOpalAfter == balanceOpalBefore).to.be.true; - + console.log('Opal to Westmint transaction fees on Opal: %s WND', balanceOpalAfter - balanceOpalBefore); }, uniqueApiOptions); @@ -440,6 +441,8 @@ describe('Integration test: Exchanging USDT with Statemine', () => { [balanceBobAfter] = await getBalance(api, [alice.address]); expect(balanceBobBefore == balanceBobAfter).to.be.true; + console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobBefore); + }, uniqueApiOptions2); }); From 20c3f3560630479a2a80a14fb1f9fdb3eabeab2b Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 6 Sep 2022 18:17:06 +0300 Subject: [PATCH 0737/1274] get branch from strategy matrix --- .github/workflows/autogen-js-types.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml index 33af9898df..2a23f03aa6 100644 --- a/.github/workflows/autogen-js-types.yml +++ b/.github/workflows/autogen-js-types.yml @@ -40,10 +40,13 @@ jobs: include: - network: "opal" features: "opal-runtime" + branch: "opal-testnet" - network: "quartz" features: "quartz-runtime" + branch: "quartz-mainnet" - network: "unique" features: "unique-runtime" + branch: "master" steps: - name: Clean Workspace @@ -124,7 +127,7 @@ jobs: uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.ref }} + branch: ${{ matrix.branch }} repository: 'UniqueNetwork/unique-types-js' ssh: true From 0cad1649d94ecef4db11a06aa85438de753d5b9e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 6 Sep 2022 19:19:19 +0300 Subject: [PATCH 0738/1274] try --- .github/workflows/autogen-js-types.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml index 2a23f03aa6..99c285e067 100644 --- a/.github/workflows/autogen-js-types.yml +++ b/.github/workflows/autogen-js-types.yml @@ -89,7 +89,7 @@ jobs: yarn install yarn polkadot-types - - name: Checkou repo UniqueNetwork/unique-types-js + - name: Checkout repo UniqueNetwork/unique-types-js uses: actions/checkout@v3 with: repository: 'UniqueNetwork/unique-types-js' @@ -123,13 +123,14 @@ jobs: git add . git commit -m "chore: regenerate types" + - name: Push changes uses: ad-m/github-push-action@master with: - github_token: ${{ secrets.GITHUB_TOKEN }} +# github_token: ${{ secrets.GITHUB_TOKEN }} branch: ${{ matrix.branch }} repository: 'UniqueNetwork/unique-types-js' - ssh: true +# ssh: true - name: Stop running containers if: always() # run this step always From 6396c5b10d34b47f75ab3c3cd9804a486a607327 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 6 Sep 2022 20:42:16 +0300 Subject: [PATCH 0739/1274] Test logs --- tests/src/xcm/xcmOpal.test.ts | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/tests/src/xcm/xcmOpal.test.ts b/tests/src/xcm/xcmOpal.test.ts index b5aea8e5ca..9ac8a73f28 100644 --- a/tests/src/xcm/xcmOpal.test.ts +++ b/tests/src/xcm/xcmOpal.test.ts @@ -35,7 +35,7 @@ const UNIQUE_CHAIN = 2095; const RELAY_PORT = '9844'; const UNIQUE_PORT = '9944'; -const STATEMINE_PORT = '9948'; +const STATEMINE_PORT = '9946'; const STATEMINE_PALLET_INSTANCE = 50; const ASSET_ID = 100; const ASSET_METADATA_DECIMALS = 18; @@ -61,6 +61,11 @@ describe('Integration test: Exchanging USDT with Westmint', () => { let balanceBobBefore: bigint; let balanceBobAfter: bigint; + let balanceBobFinal: bigint; + + let balanceBobRelayTokenBefore: bigint; + let balanceBobRelayTokenAfter: bigint; + before(async () => { await usingApi(async (api, privateKeyWrapper) => { @@ -380,8 +385,12 @@ describe('Integration test: Exchanging USDT with Westmint', () => { provider: new WsProvider('ws://127.0.0.1:' + RELAY_PORT), }; + const TRANSFER_AMOUNT_RELAY = 50_000_000_000_000_000n; + await usingApi(async (api) => { - [balanceBobBefore] = await getBalance(api, [alice.address]); + [balanceBobBefore] = await getBalance(api, [bob.address]); + balanceBobRelayTokenBefore = BigInt(((await api.query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free); + }, uniqueApiOptions); // Providing the relay currency to the unique sender account @@ -417,7 +426,7 @@ describe('Integration test: Exchanging USDT with Westmint', () => { }, }, fun: { - Fungible: 50_000_000_000_000_000n, + Fungible: TRANSFER_AMOUNT_RELAY, }, }, ], @@ -439,16 +448,18 @@ describe('Integration test: Exchanging USDT with Westmint', () => { await usingApi(async (api) => { await waitNewBlocks(api, 3); - [balanceBobAfter] = await getBalance(api, [alice.address]); - expect(balanceBobBefore == balanceBobAfter).to.be.true; + [balanceBobAfter] = await getBalance(api, [bob.address]); + balanceBobRelayTokenAfter = BigInt(((await api.query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free); + const wndFee = balanceBobRelayTokenAfter - TRANSFER_AMOUNT_RELAY - balanceBobRelayTokenBefore; console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobBefore); - + console.log('Relay (Westend) to Opal transaction fees: %s WND', wndFee); + expect(balanceBobBefore == balanceBobAfter).to.be.true; + expect(balanceBobRelayTokenBefore < balanceBobRelayTokenAfter).to.be.true; }, uniqueApiOptions2); }); it('Should connect and send Relay token back', async () => { - const uniqueApiOptions: ApiOptions = { provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), }; @@ -486,6 +497,10 @@ describe('Integration test: Exchanging USDT with Westmint', () => { const events = await submitTransactionAsync(bob, tx); const result = getGenericResult(events); expect(result.success).to.be.true; + + [balanceBobFinal] = await getBalance(api, [bob.address]); + console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobFinal); + }, uniqueApiOptions); }); From 82145c6382049d36b0d3f076c4fd312e487e7252 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 6 Sep 2022 21:58:16 +0300 Subject: [PATCH 0740/1274] ssh key + deploy key --- .github/workflows/autogen-js-types.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml index 99c285e067..25e0e0bce1 100644 --- a/.github/workflows/autogen-js-types.yml +++ b/.github/workflows/autogen-js-types.yml @@ -127,10 +127,13 @@ jobs: - name: Push changes uses: ad-m/github-push-action@master with: -# github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.GH_MAK }} branch: ${{ matrix.branch }} - repository: 'UniqueNetwork/unique-types-js' -# ssh: true + repository: 'lzadjsf/unique-types-js.git' + ssh: true + + + - name: Stop running containers if: always() # run this step always From c37bc7e07103a10fead675be0923e3fdc593a305 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 6 Sep 2022 22:21:16 +0300 Subject: [PATCH 0741/1274] change github action --- .github/workflows/autogen-js-types.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml index 25e0e0bce1..8f00010ed4 100644 --- a/.github/workflows/autogen-js-types.yml +++ b/.github/workflows/autogen-js-types.yml @@ -122,17 +122,17 @@ jobs: git config user.email github-actions@github.com git add . git commit -m "chore: regenerate types" - - - name: Push changes - uses: ad-m/github-push-action@master + - name: Pushes to another repository + id: push_directory + uses: cpina/github-action-push-to-another-repository@main + env: + SSH_DEPLOY_KEY: ${{ secrets.GH_MAK }} with: - github_token: ${{ secrets.GH_MAK }} - branch: ${{ matrix.branch }} - repository: 'lzadjsf/unique-types-js.git' - ssh: true - - + source-directory: tests/unique-types-js + destination-repository-name: 'lzadjsf/unique-types-js' + commit-message: 'chore: regenerate types' + target-branch: ${{ matrix.branch }} - name: Stop running containers From 8c9b07c4c9bd1449e6f50a935ae12fbc758b913b Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 29 Aug 2022 15:28:27 +0000 Subject: [PATCH 0742/1274] feat(xcm): move DenyThenTry to common, add DenyTransact --- runtime/common/config/xcm.rs | 56 ++++++++++++++++++++++++++++---- runtime/opal/src/xcm_config.rs | 17 ++++++---- runtime/quartz/src/xcm_config.rs | 24 +------------- runtime/unique/src/xcm_config.rs | 22 +------------ 4 files changed, 61 insertions(+), 58 deletions(-) diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs index 8cd90fb669..3c3edcf8b6 100644 --- a/runtime/common/config/xcm.rs +++ b/runtime/common/config/xcm.rs @@ -34,6 +34,7 @@ use xcm::latest::{ AssetId::{Concrete}, Fungibility::Fungible as XcmFungible, MultiAsset, Error as XcmError, + Instruction, Xcm, }; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, @@ -45,6 +46,7 @@ use xcm_builder::{ use xcm_executor::{Config, XcmExecutor, Assets}; use xcm_executor::traits::{ Convert as ConvertXcm, JustTry, MatchesFungible, WeightTrader, FilterAssetLocation, + ShouldExecute, }; use pallet_foreing_assets::{ AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, FreeForAll, @@ -171,13 +173,53 @@ match_types! { }; } -/* -pub type Barrier = ( - TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, - // ^^^ Parent & its unit plurality gets free execution -); - */ +pub struct DenyTransact; +impl ShouldExecute for DenyTransact { + fn should_execute( + _origin: &MultiLocation, + message: &mut Xcm, + _max_weight: Weight, + _weight_credit: &mut Weight, + ) -> Result<(), ()> { + let transact_inst = message.0.iter() + .find(|inst| matches![inst, Instruction::Transact { .. }]); + + match transact_inst { + Some(_) => { + log::warn!( + target: "xcm::barrier", + "transact XCM rejected" + ); + + Err(()) + }, + None => Ok(()) + } + } +} + +/// Deny executing the XCM if it matches any of the Deny filter regardless of anything else. +/// If it passes the Deny, and matches one of the Allow cases then it is let through. +pub struct DenyThenTry(PhantomData, PhantomData) + where + Deny: ShouldExecute, + Allow: ShouldExecute; + +impl ShouldExecute for DenyThenTry + where + Deny: ShouldExecute, + Allow: ShouldExecute, +{ + fn should_execute( + origin: &MultiLocation, + message: &mut Xcm, + max_weight: Weight, + weight_credit: &mut Weight, + ) -> Result<(), ()> { + Deny::should_execute(origin, message, max_weight, weight_credit)?; + Allow::should_execute(origin, message, max_weight, weight_credit) + } +} pub struct UsingOnlySelfCurrencyComponents< WeightToFee: WeightToFeePolynomial, diff --git a/runtime/opal/src/xcm_config.rs b/runtime/opal/src/xcm_config.rs index baa206138a..a9c6d56e0d 100644 --- a/runtime/opal/src/xcm_config.rs +++ b/runtime/opal/src/xcm_config.rs @@ -301,13 +301,16 @@ impl ShouldExecute for AllowAllDebug { } } -pub type Barrier = ( - TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, - AllowUnpaidExecutionFrom, - // ^^^ Parent & its unit plurality gets free execution - AllowAllDebug, -); +pub type Barrier = DenyThenTry< + DenyTransact, + ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + AllowUnpaidExecutionFrom, + // ^^^ Parent & its unit plurality gets free execution + AllowAllDebug, + ) +>; pub struct AllAsset; impl FilterAssetLocation for AllAsset { diff --git a/runtime/quartz/src/xcm_config.rs b/runtime/quartz/src/xcm_config.rs index b77604eee4..7dc29d7927 100644 --- a/runtime/quartz/src/xcm_config.rs +++ b/runtime/quartz/src/xcm_config.rs @@ -76,29 +76,6 @@ match_types! { }; } -/// Deny executing the XCM if it matches any of the Deny filter regardless of anything else. -/// If it passes the Deny, and matches one of the Allow cases then it is let through. -pub struct DenyThenTry(PhantomData, PhantomData) - where - Deny: ShouldExecute, - Allow: ShouldExecute; - -impl ShouldExecute for DenyThenTry - where - Deny: ShouldExecute, - Allow: ShouldExecute, -{ - fn should_execute( - origin: &MultiLocation, - message: &mut Xcm, - max_weight: Weight, - weight_credit: &mut Weight, - ) -> Result<(), ()> { - Deny::should_execute(origin, message, max_weight, weight_credit)?; - Allow::should_execute(origin, message, max_weight, weight_credit) - } -} - pub fn get_allowed_locations() -> Vec { vec![ // Self location @@ -151,6 +128,7 @@ impl ShouldExecute for DenyExchangeWithUnknownLocation { pub type Barrier = DenyThenTry< DenyExchangeWithUnknownLocation, ( + DenyTransact, TakeWeightCredit, AllowTopLevelPaidExecutionFrom, // Parent and its exec plurality get free execution diff --git a/runtime/unique/src/xcm_config.rs b/runtime/unique/src/xcm_config.rs index 02e6ab5159..4640b8c390 100644 --- a/runtime/unique/src/xcm_config.rs +++ b/runtime/unique/src/xcm_config.rs @@ -69,6 +69,7 @@ pub type Amount = i128; pub type Barrier = DenyThenTry< DenyExchangeWithUnknownLocation, ( + DenyTransact, TakeWeightCredit, AllowTopLevelPaidExecutionFrom, // Parent and its exec plurality get free execution @@ -95,27 +96,6 @@ pub fn get_allowed_locations() -> Vec { ] } -pub struct DenyThenTry(PhantomData, PhantomData) - where - Deny: ShouldExecute, - Allow: ShouldExecute; - -impl ShouldExecute for DenyThenTry - where - Deny: ShouldExecute, - Allow: ShouldExecute, -{ - fn should_execute( - origin: &MultiLocation, - message: &mut Xcm, - max_weight: Weight, - weight_credit: &mut Weight, - ) -> Result<(), ()> { - Deny::should_execute(origin, message, max_weight, weight_credit)?; - Allow::should_execute(origin, message, max_weight, weight_credit) - } -} - // Allow xcm exchange only with locations in list pub struct DenyExchangeWithUnknownLocation; impl ShouldExecute for DenyExchangeWithUnknownLocation { From b7be9a60893bbf903b62d17d305ef4c23e12d733 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 29 Aug 2022 15:30:34 +0000 Subject: [PATCH 0743/1274] test(xcm): add transact barrier test --- runtime/common/mod.rs | 3 ++ runtime/common/tests/mod.rs | 17 ++++++++ runtime/common/tests/xcm.rs | 86 +++++++++++++++++++++++++++++++++++++ runtime/opal/Cargo.toml | 6 +++ runtime/quartz/Cargo.toml | 6 +++ runtime/unique/Cargo.toml | 6 +++ 6 files changed, 124 insertions(+) create mode 100644 runtime/common/tests/mod.rs create mode 100644 runtime/common/tests/xcm.rs diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index ac2aca2b33..7bd093628b 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -24,6 +24,9 @@ pub mod scheduler; pub mod sponsoring; pub mod weights; +#[cfg(test)] +mod tests; + use sp_core::H160; use frame_support::traits::{Currency, OnUnbalanced, Imbalance}; use sp_runtime::{ diff --git a/runtime/common/tests/mod.rs b/runtime/common/tests/mod.rs new file mode 100644 index 0000000000..2b25704059 --- /dev/null +++ b/runtime/common/tests/mod.rs @@ -0,0 +1,17 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +mod xcm; diff --git a/runtime/common/tests/xcm.rs b/runtime/common/tests/xcm.rs new file mode 100644 index 0000000000..4db8357441 --- /dev/null +++ b/runtime/common/tests/xcm.rs @@ -0,0 +1,86 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use xcm_executor::traits::ShouldExecute; +use xcm::latest::prelude::*; +use logtest::Logger; +use crate::{ + Call, + xcm_config::Barrier, +}; + +fn catch_xcm_barrier_log(logger: &mut Logger, expected_msg: &str) { + for record in logger { + if record.target() == "xcm::barrier" + && record.args() == expected_msg { + return; + } + } + + panic!("the expected XCM barrier log `{}` is not found", expected_msg); +} + +#[test] +fn xcm_barrier_does_not_allow_transact() { + // We have a `AllowTopLevelPaidExecutionFrom` barrier, + // so an XCM program should start from one of the following commands: + // * `WithdrawAsset` + // * `ReceiveTeleportedAsset` + // * `ReserveAssetDeposited` + // * `ClaimAsset` + // We use the `WithdrawAsset` in this test + + let location = MultiLocation { + parents: 0, + interior: Junctions::Here, + }; + + // let id = AssetId::Concrete(location.clone()); + // let fun = Fungibility::Fungible(42); + // let multiasset = MultiAsset { + // id, + // fun, + // }; + // let withdraw_inst = WithdrawAsset(multiasset.into()); + + // We will never decode this "call", + // so it is irrelevant what we are passing to the `transact` cmd. + let fake_encoded_call = vec![0u8]; + + let transact_inst = Transact { + origin_type: OriginKind::Superuser, + require_weight_at_most: 0, + call: fake_encoded_call.into(), + }; + + let mut xcm_program = Xcm::(vec![transact_inst]); + + let mut logger = Logger::start(); + + let max_weight = 100_000; + let mut weight_credit = 0; + + let result = Barrier::should_execute( + &location, + &mut xcm_program, + max_weight, + &mut weight_credit + ); + + assert!(result.is_err(), "the barrier should disallow the XCM transact cmd"); + + catch_xcm_barrier_log(&mut logger, "transact XCM rejected"); +} diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 561d6367a3..328e5d743e 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -462,6 +462,12 @@ evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } pallet-foreing-assets = { default-features = false, path = "../../pallets/foreing-assets" } +################################################################################ +# Dev Dependencies + +[dev-dependencies.logtest] +version = "2.0.0" + ################################################################################ # Build Dependencies diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 41107a323f..74319012d2 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -470,6 +470,12 @@ evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } pallet-foreing-assets = { default-features = false, path = "../../pallets/foreing-assets" } +################################################################################ +# Dev Dependencies + +[dev-dependencies.logtest] +version = "2.0.0" + ################################################################################ # Build Dependencies diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index b3c9b3729a..10d3decda2 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -462,6 +462,12 @@ evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } pallet-foreing-assets = { default-features = false, path = "../../pallets/foreing-assets" } +################################################################################ +# Dev Dependencies + +[dev-dependencies.logtest] +version = "2.0.0" + ################################################################################ # Build Dependencies From 247c0b0762fa660fcd058780ab8eb2deeee95005 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 29 Aug 2022 16:54:49 +0000 Subject: [PATCH 0744/1274] fix(build): use default-members instead of exclude --- Cargo.toml | 5 ++++- runtime/common/config/xcm.rs | 41 ++++++++++++++++++------------------ 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7ad47bb458..1381cc613f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,9 +6,12 @@ members = [ 'client/*', 'primitives/*', 'crates/*', + 'runtime/opal', + 'runtime/quartz', + 'runtime/unique', 'runtime/tests', ] -exclude = ["runtime/unique", "runtime/quartz"] +default-members = ['node/*', 'runtime/opal'] [profile.release] panic = 'unwind' diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs index 3c3edcf8b6..1641e336d9 100644 --- a/runtime/common/config/xcm.rs +++ b/runtime/common/config/xcm.rs @@ -33,8 +33,7 @@ use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*}; use xcm::latest::{ AssetId::{Concrete}, Fungibility::Fungible as XcmFungible, - MultiAsset, Error as XcmError, - Instruction, Xcm, + MultiAsset, Error as XcmError, Instruction, Xcm, }; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, @@ -181,7 +180,9 @@ impl ShouldExecute for DenyTransact { _max_weight: Weight, _weight_credit: &mut Weight, ) -> Result<(), ()> { - let transact_inst = message.0.iter() + let transact_inst = message + .0 + .iter() .find(|inst| matches![inst, Instruction::Transact { .. }]); match transact_inst { @@ -192,8 +193,8 @@ impl ShouldExecute for DenyTransact { ); Err(()) - }, - None => Ok(()) + } + None => Ok(()), } } } @@ -201,24 +202,24 @@ impl ShouldExecute for DenyTransact { /// Deny executing the XCM if it matches any of the Deny filter regardless of anything else. /// If it passes the Deny, and matches one of the Allow cases then it is let through. pub struct DenyThenTry(PhantomData, PhantomData) - where - Deny: ShouldExecute, - Allow: ShouldExecute; +where + Deny: ShouldExecute, + Allow: ShouldExecute; impl ShouldExecute for DenyThenTry - where - Deny: ShouldExecute, - Allow: ShouldExecute, +where + Deny: ShouldExecute, + Allow: ShouldExecute, { - fn should_execute( - origin: &MultiLocation, - message: &mut Xcm, - max_weight: Weight, - weight_credit: &mut Weight, - ) -> Result<(), ()> { - Deny::should_execute(origin, message, max_weight, weight_credit)?; - Allow::should_execute(origin, message, max_weight, weight_credit) - } + fn should_execute( + origin: &MultiLocation, + message: &mut Xcm, + max_weight: Weight, + weight_credit: &mut Weight, + ) -> Result<(), ()> { + Deny::should_execute(origin, message, max_weight, weight_credit)?; + Allow::should_execute(origin, message, max_weight, weight_credit) + } } pub struct UsingOnlySelfCurrencyComponents< From 5a619a936664de6d8e6c0f3fd9b8d085651f8603 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 30 Aug 2022 08:57:52 +0000 Subject: [PATCH 0745/1274] fix(xcm): improve denythentry, deny transact xcm --- Cargo.lock | 18 ++++++++++++++++- runtime/common/config/xcm.rs | 33 +++++++++++++++++++++++++------- runtime/common/tests/xcm.rs | 2 +- runtime/opal/Cargo.toml | 5 +++++ runtime/quartz/Cargo.toml | 5 +++++ runtime/quartz/src/xcm_config.rs | 12 ++++++------ runtime/unique/Cargo.toml | 5 +++++ runtime/unique/src/xcm_config.rs | 12 ++++++------ 8 files changed, 71 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fc39521072..547ecbb0d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4571,6 +4571,16 @@ dependencies = [ "value-bag", ] +[[package]] +name = "logtest" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3e43a8657c1d64516dcc9db8ca03826a4aceaf89d5ce1b37b59f6ff0e43026" +dependencies = [ + "lazy_static", + "log", +] + [[package]] name = "lru" version = "0.6.6" @@ -5148,7 +5158,9 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "hex-literal", + "impl-trait-for-tuples", "log", + "logtest", "orml-tokens", "orml-traits", "orml-vesting", @@ -8466,7 +8478,9 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "hex-literal", + "impl-trait-for-tuples", "log", + "logtest", "orml-tokens", "orml-traits", "orml-vesting", @@ -12206,7 +12220,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "digest 0.10.3", "rand 0.8.5", "static_assertions", @@ -12459,7 +12473,9 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "hex-literal", + "impl-trait-for-tuples", "log", + "logtest", "orml-tokens", "orml-traits", "orml-vesting", diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs index 1641e336d9..2eb79a5fd8 100644 --- a/runtime/common/config/xcm.rs +++ b/runtime/common/config/xcm.rs @@ -172,13 +172,32 @@ match_types! { }; } +pub trait TryPass { + fn try_pass( + origin: &MultiLocation, + message: &mut Xcm, + ) -> Result<(), ()>; +} + +#[impl_trait_for_tuples::impl_for_tuples(30)] +impl TryPass for Tuple { + fn try_pass( + origin: &MultiLocation, + message: &mut Xcm, + ) -> Result<(), ()> { + for_tuples!( #( + Tuple::try_pass(origin, message)?; + )* ); + + Ok(()) + } +} + pub struct DenyTransact; -impl ShouldExecute for DenyTransact { - fn should_execute( +impl TryPass for DenyTransact { + fn try_pass( _origin: &MultiLocation, message: &mut Xcm, - _max_weight: Weight, - _weight_credit: &mut Weight, ) -> Result<(), ()> { let transact_inst = message .0 @@ -203,12 +222,12 @@ impl ShouldExecute for DenyTransact { /// If it passes the Deny, and matches one of the Allow cases then it is let through. pub struct DenyThenTry(PhantomData, PhantomData) where - Deny: ShouldExecute, + Deny: TryPass, Allow: ShouldExecute; impl ShouldExecute for DenyThenTry where - Deny: ShouldExecute, + Deny: TryPass, Allow: ShouldExecute, { fn should_execute( @@ -217,7 +236,7 @@ where max_weight: Weight, weight_credit: &mut Weight, ) -> Result<(), ()> { - Deny::should_execute(origin, message, max_weight, weight_credit)?; + Deny::try_pass(origin, message)?; Allow::should_execute(origin, message, max_weight, weight_credit) } } diff --git a/runtime/common/tests/xcm.rs b/runtime/common/tests/xcm.rs index 4db8357441..c61073cc05 100644 --- a/runtime/common/tests/xcm.rs +++ b/runtime/common/tests/xcm.rs @@ -34,7 +34,7 @@ fn catch_xcm_barrier_log(logger: &mut Logger, expected_msg: &str) { } #[test] -fn xcm_barrier_does_not_allow_transact() { +fn xcm_barrier_denies_transact() { // We have a `AllowTopLevelPaidExecutionFrom` barrier, // so an XCM program should start from one of the following commands: // * `WithdrawAsset` diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 328e5d743e..17d45fd5d3 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -462,6 +462,11 @@ evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } pallet-foreing-assets = { default-features = false, path = "../../pallets/foreing-assets" } +################################################################################ +# Other Dependencies + +impl-trait-for-tuples = "0.2.2" + ################################################################################ # Dev Dependencies diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 74319012d2..07937755ef 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -470,6 +470,11 @@ evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } pallet-foreing-assets = { default-features = false, path = "../../pallets/foreing-assets" } +################################################################################ +# Other Dependencies + +impl-trait-for-tuples = "0.2.2" + ################################################################################ # Dev Dependencies diff --git a/runtime/quartz/src/xcm_config.rs b/runtime/quartz/src/xcm_config.rs index 7dc29d7927..e336c4d43f 100644 --- a/runtime/quartz/src/xcm_config.rs +++ b/runtime/quartz/src/xcm_config.rs @@ -41,7 +41,7 @@ use xcm_builder::{ }; use xcm_executor::{ {Config, XcmExecutor}, - traits::{Convert as ConvertXcm, FilterAssetLocation, JustTry, MatchesFungible, ShouldExecute}, + traits::{Convert as ConvertXcm, FilterAssetLocation, JustTry, MatchesFungible}, }; use up_common::{ @@ -93,12 +93,10 @@ pub fn get_allowed_locations() -> Vec { // Allow xcm exchange only with locations in list pub struct DenyExchangeWithUnknownLocation; -impl ShouldExecute for DenyExchangeWithUnknownLocation { - fn should_execute( +impl TryPass for DenyExchangeWithUnknownLocation { + fn try_pass( origin: &MultiLocation, message: &mut Xcm, - _max_weight: Weight, - _weight_credit: &mut Weight, ) -> Result<(), ()> { // Check if deposit or transfer belongs to allowed parachains @@ -126,9 +124,11 @@ impl ShouldExecute for DenyExchangeWithUnknownLocation { } pub type Barrier = DenyThenTry< - DenyExchangeWithUnknownLocation, ( DenyTransact, + DenyExchangeWithUnknownLocation, + ), + ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, // Parent and its exec plurality get free execution diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 10d3decda2..626c376581 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -462,6 +462,11 @@ evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } pallet-foreing-assets = { default-features = false, path = "../../pallets/foreing-assets" } +################################################################################ +# Other Dependencies + +impl-trait-for-tuples = "0.2.2" + ################################################################################ # Dev Dependencies diff --git a/runtime/unique/src/xcm_config.rs b/runtime/unique/src/xcm_config.rs index 4640b8c390..892b8c8c97 100644 --- a/runtime/unique/src/xcm_config.rs +++ b/runtime/unique/src/xcm_config.rs @@ -41,7 +41,7 @@ use xcm_builder::{ }; use xcm_executor::{ {Config, XcmExecutor}, - traits::{Convert as ConvertXcm, FilterAssetLocation, JustTry, MatchesFungible, ShouldExecute}, + traits::{Convert as ConvertXcm, FilterAssetLocation, JustTry, MatchesFungible}, }; use up_common::{ @@ -67,9 +67,11 @@ pub type Amount = i128; pub type Barrier = DenyThenTry< - DenyExchangeWithUnknownLocation, ( DenyTransact, + DenyExchangeWithUnknownLocation, + ), + ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, // Parent and its exec plurality get free execution @@ -98,12 +100,10 @@ pub fn get_allowed_locations() -> Vec { // Allow xcm exchange only with locations in list pub struct DenyExchangeWithUnknownLocation; -impl ShouldExecute for DenyExchangeWithUnknownLocation { - fn should_execute( +impl TryPass for DenyExchangeWithUnknownLocation { + fn try_pass( origin: &MultiLocation, message: &mut Xcm, - _max_weight: Weight, - _weight_credit: &mut Weight, ) -> Result<(), ()> { // Check if deposit or transfer belongs to allowed parachains From f8304b7ec440e26e4c1b838ca8dc0adf388e7bf7 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 5 Sep 2022 11:32:26 +0000 Subject: [PATCH 0746/1274] test(xcm): make barrier unit tests cleaner --- runtime/common/mod.rs | 2 +- runtime/common/tests/mod.rs | 33 +++++- runtime/common/tests/xcm.rs | 147 ++++++++++++++++++++----- runtime/opal/src/lib.rs | 3 + runtime/opal/src/tests/logcapture.rs | 25 +++++ runtime/opal/src/tests/mod.rs | 18 +++ runtime/opal/src/tests/xcm.rs | 32 ++++++ runtime/quartz/src/lib.rs | 3 + runtime/quartz/src/tests/logcapture.rs | 25 +++++ runtime/quartz/src/tests/mod.rs | 18 +++ runtime/quartz/src/tests/xcm.rs | 32 ++++++ runtime/unique/src/lib.rs | 3 + runtime/unique/src/tests/logcapture.rs | 25 +++++ runtime/unique/src/tests/mod.rs | 18 +++ runtime/unique/src/tests/xcm.rs | 32 ++++++ 15 files changed, 384 insertions(+), 32 deletions(-) create mode 100644 runtime/opal/src/tests/logcapture.rs create mode 100644 runtime/opal/src/tests/mod.rs create mode 100644 runtime/opal/src/tests/xcm.rs create mode 100644 runtime/quartz/src/tests/logcapture.rs create mode 100644 runtime/quartz/src/tests/mod.rs create mode 100644 runtime/quartz/src/tests/xcm.rs create mode 100644 runtime/unique/src/tests/logcapture.rs create mode 100644 runtime/unique/src/tests/mod.rs create mode 100644 runtime/unique/src/tests/xcm.rs diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index 7bd093628b..f7df786a63 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -25,7 +25,7 @@ pub mod sponsoring; pub mod weights; #[cfg(test)] -mod tests; +pub mod tests; use sp_core::H160; use frame_support::traits::{Currency, OnUnbalanced, Imbalance}; diff --git a/runtime/common/tests/mod.rs b/runtime/common/tests/mod.rs index 2b25704059..bc39d3bfdd 100644 --- a/runtime/common/tests/mod.rs +++ b/runtime/common/tests/mod.rs @@ -14,4 +14,35 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -mod xcm; +use sp_runtime::BuildStorage; +use sp_core::{Public, Pair}; +use sp_std::vec; +use up_common::types::AuraId; +use crate::{GenesisConfig, ParachainInfoConfig, AuraConfig}; + +pub mod xcm; + +fn get_from_seed(seed: &str) -> ::Public { + TPublic::Pair::from_string(&format!("//{}", seed), None) + .expect("static values are valid; qed") + .public() +} + +fn new_test_ext(para_id: u32) -> sp_io::TestExternalities { + let cfg = GenesisConfig { + aura: AuraConfig { + authorities: vec![ + get_from_seed::("Alice"), + get_from_seed::("Bob"), + ], + }, + parachain_info: ParachainInfoConfig { + parachain_id: para_id.into(), + }, + ..GenesisConfig::default() + }; + + cfg.build_storage() + .unwrap() + .into() +} diff --git a/runtime/common/tests/xcm.rs b/runtime/common/tests/xcm.rs index c61073cc05..27e2f142fb 100644 --- a/runtime/common/tests/xcm.rs +++ b/runtime/common/tests/xcm.rs @@ -17,45 +17,31 @@ use xcm_executor::traits::ShouldExecute; use xcm::latest::prelude::*; use logtest::Logger; -use crate::{ - Call, - xcm_config::Barrier, -}; +use crate::Call; +use super::new_test_ext; -fn catch_xcm_barrier_log(logger: &mut Logger, expected_msg: &str) { +fn catch_xcm_barrier_log( + logger: &mut Logger, + expected_msg: &str +) -> Result<(), String> { for record in logger { if record.target() == "xcm::barrier" && record.args() == expected_msg { - return; + return Ok(()); } } - panic!("the expected XCM barrier log `{}` is not found", expected_msg); + Err(format!("the expected XCM barrier log `{}` is not found", expected_msg)) } -#[test] -fn xcm_barrier_denies_transact() { - // We have a `AllowTopLevelPaidExecutionFrom` barrier, - // so an XCM program should start from one of the following commands: - // * `WithdrawAsset` - // * `ReceiveTeleportedAsset` - // * `ReserveAssetDeposited` - // * `ClaimAsset` - // We use the `WithdrawAsset` in this test - +/// WARNING: Uses log capturing +/// See https://docs.rs/logtest/latest/logtest/index.html#constraints +pub fn barrier_denies_transact(logger: &mut Logger) { let location = MultiLocation { parents: 0, interior: Junctions::Here, }; - // let id = AssetId::Concrete(location.clone()); - // let fun = Fungibility::Fungible(42); - // let multiasset = MultiAsset { - // id, - // fun, - // }; - // let withdraw_inst = WithdrawAsset(multiasset.into()); - // We will never decode this "call", // so it is irrelevant what we are passing to the `transact` cmd. let fake_encoded_call = vec![0u8]; @@ -68,12 +54,10 @@ fn xcm_barrier_denies_transact() { let mut xcm_program = Xcm::(vec![transact_inst]); - let mut logger = Logger::start(); - let max_weight = 100_000; - let mut weight_credit = 0; + let mut weight_credit = 100_000_000; - let result = Barrier::should_execute( + let result = B::should_execute( &location, &mut xcm_program, max_weight, @@ -82,5 +66,108 @@ fn xcm_barrier_denies_transact() { assert!(result.is_err(), "the barrier should disallow the XCM transact cmd"); - catch_xcm_barrier_log(&mut logger, "transact XCM rejected"); + catch_xcm_barrier_log(logger, "transact XCM rejected").unwrap(); +} + +fn xcm_execute( + self_para_id: u32, + location: &MultiLocation, + xcm: &mut Xcm +) -> Result<(), ()> { + new_test_ext(self_para_id).execute_with(|| { + let max_weight = 100_000; + let mut weight_credit = 100_000_000; + + B::should_execute( + &location, + xcm, + max_weight, + &mut weight_credit + ) + }) +} + +fn make_multiassets(location: &MultiLocation) -> MultiAssets { + let id = AssetId::Concrete(location.clone()); + let fun = Fungibility::Fungible(42); + let multiasset = MultiAsset { + id, + fun, + }; + + multiasset.into() +} + +fn make_transfer_reserve_asset(location: &MultiLocation) -> Xcm { + let assets = make_multiassets(location); + let inst = TransferReserveAsset { + assets, + dest: location.clone(), + xcm: Xcm(vec![]), + }; + + Xcm::(vec![inst]) +} + +fn make_deposit_reserve_asset(location: &MultiLocation) -> Xcm { + let assets = make_multiassets(location); + let inst = DepositReserveAsset { + assets: assets.into(), + max_assets: 42, + dest: location.clone(), + xcm: Xcm(vec![]), + }; + + Xcm::(vec![inst]) +} + +fn expect_transfer_location_denied( + logger: &mut Logger, + self_para_id: u32, + location: &MultiLocation, + xcm: &mut Xcm +) -> Result<(), String> { + let result = xcm_execute::(self_para_id, location, xcm); + + if result.is_ok() { + return Err("the barrier should deny the unknown location".into()); + } + + catch_xcm_barrier_log(logger, "Unexpected deposit or transfer location") +} + +/// WARNING: Uses log capturing +/// See https://docs.rs/logtest/latest/logtest/index.html#constraints +pub fn barrier_denies_transfer_from_unknown_location( + logger: &mut Logger, + self_para_id: u32, +) -> Result<(), String> +where + B: ShouldExecute +{ + const UNKNOWN_PARACHAIN_ID: u32 = 4057; + + let unknown_location = MultiLocation { + parents: 1, + interior: X1(Parachain(UNKNOWN_PARACHAIN_ID)), + }; + + let mut transfer_reserve_asset = make_transfer_reserve_asset(&unknown_location); + let mut deposit_reserve_asset = make_deposit_reserve_asset(&unknown_location); + + expect_transfer_location_denied::( + logger, + self_para_id, + &unknown_location, + &mut transfer_reserve_asset + )?; + + expect_transfer_location_denied::( + logger, + self_para_id, + &unknown_location, + &mut deposit_reserve_asset + )?; + + Ok(()) } diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 5f7fa119d5..9f1a2bef92 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -37,6 +37,9 @@ mod runtime_common; pub mod xcm_config; +#[cfg(test)] +mod tests; + pub use runtime_common::*; pub const RUNTIME_NAME: &str = "opal"; diff --git a/runtime/opal/src/tests/logcapture.rs b/runtime/opal/src/tests/logcapture.rs new file mode 100644 index 0000000000..72e37816ad --- /dev/null +++ b/runtime/opal/src/tests/logcapture.rs @@ -0,0 +1,25 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use logtest::Logger; +use super::xcm::opal_xcm_tests; + +#[test] +fn opal_log_capture_tests() { + let mut logger = Logger::start(); + + opal_xcm_tests(&mut logger); +} diff --git a/runtime/opal/src/tests/mod.rs b/runtime/opal/src/tests/mod.rs new file mode 100644 index 0000000000..09df4a7f65 --- /dev/null +++ b/runtime/opal/src/tests/mod.rs @@ -0,0 +1,18 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +mod xcm; +mod logcapture; diff --git a/runtime/opal/src/tests/xcm.rs b/runtime/opal/src/tests/xcm.rs new file mode 100644 index 0000000000..54a30f49aa --- /dev/null +++ b/runtime/opal/src/tests/xcm.rs @@ -0,0 +1,32 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use logtest::Logger; +use crate::{ + runtime_common::tests::xcm::*, + xcm_config::Barrier, +}; + +const OPAL_PARA_ID: u32 = 2095; // Same as Quartz + +pub fn opal_xcm_tests(logger: &mut Logger) { + barrier_denies_transact::(logger); + + barrier_denies_transfer_from_unknown_location::( + logger, + OPAL_PARA_ID, + ).expect_err("opal runtime allows any location"); +} diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index a735564e6f..be3539d679 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -37,6 +37,9 @@ mod runtime_common; pub mod xcm_config; +#[cfg(test)] +mod tests; + pub use runtime_common::*; pub const RUNTIME_NAME: &str = "quartz"; diff --git a/runtime/quartz/src/tests/logcapture.rs b/runtime/quartz/src/tests/logcapture.rs new file mode 100644 index 0000000000..e59a0024d6 --- /dev/null +++ b/runtime/quartz/src/tests/logcapture.rs @@ -0,0 +1,25 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use logtest::Logger; +use super::xcm::quartz_xcm_tests; + +#[test] +fn quartz_log_capture_tests() { + let mut logger = Logger::start(); + + quartz_xcm_tests(&mut logger); +} diff --git a/runtime/quartz/src/tests/mod.rs b/runtime/quartz/src/tests/mod.rs new file mode 100644 index 0000000000..09df4a7f65 --- /dev/null +++ b/runtime/quartz/src/tests/mod.rs @@ -0,0 +1,18 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +mod xcm; +mod logcapture; diff --git a/runtime/quartz/src/tests/xcm.rs b/runtime/quartz/src/tests/xcm.rs new file mode 100644 index 0000000000..7e854e1e47 --- /dev/null +++ b/runtime/quartz/src/tests/xcm.rs @@ -0,0 +1,32 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use logtest::Logger; +use crate::{ + runtime_common::tests::xcm::*, + xcm_config::Barrier, +}; + +const QUARTZ_PARA_ID: u32 = 2095; + +pub fn quartz_xcm_tests(logger: &mut Logger) { + barrier_denies_transact::(logger); + + barrier_denies_transfer_from_unknown_location::( + logger, + QUARTZ_PARA_ID, + ).expect("quartz runtime denies an unknown location"); +} diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index 5ed7157523..c4bc4c54e6 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -37,6 +37,9 @@ mod runtime_common; pub mod xcm_config; +#[cfg(test)] +mod tests; + pub use runtime_common::*; pub const RUNTIME_NAME: &str = "unique"; diff --git a/runtime/unique/src/tests/logcapture.rs b/runtime/unique/src/tests/logcapture.rs new file mode 100644 index 0000000000..399c883ea3 --- /dev/null +++ b/runtime/unique/src/tests/logcapture.rs @@ -0,0 +1,25 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use logtest::Logger; +use super::xcm::unique_xcm_tests; + +#[test] +fn unique_log_capture_tests() { + let mut logger = Logger::start(); + + unique_xcm_tests(&mut logger); +} diff --git a/runtime/unique/src/tests/mod.rs b/runtime/unique/src/tests/mod.rs new file mode 100644 index 0000000000..09df4a7f65 --- /dev/null +++ b/runtime/unique/src/tests/mod.rs @@ -0,0 +1,18 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +mod xcm; +mod logcapture; diff --git a/runtime/unique/src/tests/xcm.rs b/runtime/unique/src/tests/xcm.rs new file mode 100644 index 0000000000..58affddc0f --- /dev/null +++ b/runtime/unique/src/tests/xcm.rs @@ -0,0 +1,32 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use logtest::Logger; +use crate::{ + runtime_common::tests::xcm::*, + xcm_config::Barrier, +}; + +const UNIQUE_PARA_ID: u32 = 2037; + +pub fn unique_xcm_tests(logger: &mut Logger) { + barrier_denies_transact::(logger); + + barrier_denies_transfer_from_unknown_location::( + logger, + UNIQUE_PARA_ID, + ).expect("unique runtime denies an unknown location"); +} From ecb82c0bbb4a0f79696a362e713ca1e7163a8fd9 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 5 Sep 2022 11:49:54 +0000 Subject: [PATCH 0747/1274] fix: get rid of unneeded comments in xcm configs --- runtime/opal/src/xcm_config.rs | 250 ------------------------------- runtime/quartz/src/xcm_config.rs | 27 ---- 2 files changed, 277 deletions(-) diff --git a/runtime/opal/src/xcm_config.rs b/runtime/opal/src/xcm_config.rs index a9c6d56e0d..964bd45da5 100644 --- a/runtime/opal/src/xcm_config.rs +++ b/runtime/opal/src/xcm_config.rs @@ -65,28 +65,6 @@ use pallet_foreing_assets::{ // Signed version of balance pub type Amount = i128; -/* -parameter_types! { - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; -} - -impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; - type SelfParaId = parachain_info::Pallet; - type OnSystemEvent = (); - type OutboundXcmpMessageSource = XcmpQueue; - type DmpMessageHandler = DmpQueue; - type ReservedDmpWeight = ReservedDmpWeight; - type ReservedXcmpWeight = ReservedXcmpWeight; - type XcmpMessageHandler = XcmpQueue; -} - -impl parachain_info::Config for Runtime {} - -impl cumulus_pallet_aura_ext::Config for Runtime {} - */ - parameter_types! { pub const RelayLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Polkadot; @@ -95,155 +73,6 @@ parameter_types! { pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); } -/* -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. -pub type LocationToAccountId = ( - // The parent (Relay-chain) origin converts to the default `AccountId`. - ParentIsPreset, - // Sibling parachain origins convert to AccountId via the `ParaId::into`. - SiblingParachainConvertsVia, - // Straight up local `AccountId32` origins just alias directly to `AccountId`. - AccountId32Aliases, -); - -pub struct OnlySelfCurrency; - -impl> MatchesFungible for OnlySelfCurrency { - fn matches_fungible(a: &MultiAsset) -> Option { - match (&a.id, &a.fun) { - (Concrete(_), XcmFungible(ref amount)) => CheckedConversion::checked_from(*amount), - _ => None, - } - } -} - -/// Means for transacting assets on this chain. -pub type LocalAssetTransactor = CurrencyAdapter< - // Use this currency: - Balances, - // Use this currency when it is a fungible asset matching the given location or name: - OnlySelfCurrency, - // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We don't track any teleports. - (), ->; - - */ - -/* -parameter_types! { - pub CheckingAccount: AccountId = PolkadotXcm::check_account(); -} - -/// Allow checking in assets that have issuance > 0. -pub struct NonZeroIssuance(PhantomData<(AccountId, ForeingAssets)>); -impl Contains<>::AssetId> - for NonZeroIssuance -where - ForeingAssets: fungibles::Inspect, -{ - fn contains(id: &>::AssetId) -> bool { - !ForeingAssets::total_issuance(*id).is_zero() - } -} - -pub struct AsInnerId(PhantomData<(AssetId, ConvertAssetId)>); -impl> - ConvertXcm for AsInnerId -where - AssetId: Borrow, - AssetId: TryAsForeing, - AssetIds: Borrow, -{ - fn convert_ref(id: impl Borrow) -> Result { - let id = id.borrow(); - - log::trace!( - target: "xcm::AsInnerId::Convert", - "AsInnerId {:?}", - id - ); - - let parent = MultiLocation::parent(); - let here = MultiLocation::here(); - let self_location = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); - - if *id == parent { - return ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Parent)); - } - - if *id == here || *id == self_location { - return ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Here)); - } - - match XcmForeignAssetIdMapping::::get_currency_id(id.clone()) { - Some(AssetIds::ForeignAssetId(foreign_asset_id)) => { - ConvertAssetId::convert_ref(AssetIds::ForeignAssetId(foreign_asset_id)) - } - _ => ConvertAssetId::convert_ref(AssetIds::ForeignAssetId(0)), - } - } - - fn reverse_ref(what: impl Borrow) -> Result { - log::trace!( - target: "xcm::AsInnerId::Reverse", - "AsInnerId", - ); - - let asset_id = what.borrow(); - - let parent_id = - ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Parent)).unwrap(); - let here_id = - ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Here)).unwrap(); - - if asset_id.clone() == parent_id { - return Ok(MultiLocation::parent()); - } - - if asset_id.clone() == here_id { - return Ok(MultiLocation::new( - 1, - X1(Parachain(ParachainInfo::get().into())), - )); - } - - match >::try_as_foreing(asset_id.clone()) { - Some(fid) => match XcmForeignAssetIdMapping::::get_multi_location(fid) { - Some(location) => Ok(location), - None => Err(()), - }, - None => Err(()), - } - } -} - -/// Means for transacting assets besides the native currency on this chain. -pub type FungiblesTransactor = FungiblesAdapter< - // Use this fungibles implementation: - ForeingAssets, - // Use this currency when it is a fungible asset matching the given location or name: - ConvertedConcreteAssetId, JustTry>, - // Convert an XCM MultiLocation into a local account id: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We only want to allow teleports of known assets. We use non-zero issuance as an indication - // that this asset is known. - NonZeroIssuance, - // The account to use for tracking teleports. - CheckingAccount, ->; - -/// Means for transacting assets on this chain. -pub type AssetTransactors = FungiblesTransactor; - */ - /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, /// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can /// biases the kind of local `Origin` it will become. @@ -319,85 +148,6 @@ impl FilterAssetLocation for AllAsset { } } -/* /// CHANGEME!!! -pub struct XcmConfig; -impl Config for XcmConfig { - type Call = Call; - type XcmSender = XcmRouter; - // How to withdraw and deposit an asset. - type AssetTransactor = AssetTransactors; - type OriginConverter = XcmOriginToTransactDispatchOrigin; - type IsReserve = AllAsset; //NativeAsset; - type IsTeleporter = (); // Teleportation is disabled - type LocationInverter = LocationInverter; - type Barrier = Barrier; - type Weigher = FixedWeightBounds; - type Trader = - FreeForAll, RelayLocation, AccountId, Balances, ()>; - type ResponseHandler = (); // Don't handle responses for now. - type SubscriptionService = PolkadotXcm; - type AssetTrap = PolkadotXcm; - type AssetClaims = PolkadotXcm; -} - */ - -/* -/// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = (SignedToAccountId32,); - -/// The means for routing XCM messages which are not for local execution into the right message -/// queues. -pub type XcmRouter = ( - // Two routers - use UMP to communicate with the relay chain: - cumulus_primitives_utility::ParentAsUmp, - // ..and XCMP to communicate with the sibling chains. - XcmpQueue, -); - */ - -/* -impl pallet_xcm::Config for Runtime { - type Event = Event; - type SendXcmOrigin = EnsureXcmOrigin; - type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; - type XcmExecuteFilter = Everything; - type XcmExecutor = XcmExecutor>; - type XcmTeleportFilter = Everything; - type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; - type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; - const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; - type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; -} - */ - -/* -impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor; -} - -impl cumulus_pallet_xcmp_queue::Config for Runtime { - type WeightInfo = (); - type Event = Event; - type XcmExecutor = XcmExecutor; - type ChannelInfo = ParachainSystem; - type VersionWrapper = (); - type ExecuteOverweightOrigin = frame_system::EnsureRoot; - type ControllerOrigin = EnsureRoot; - type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; -} - -impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor; - type ExecuteOverweightOrigin = frame_system::EnsureRoot; -} - */ - pub struct CurrencyIdConvert; impl Convert> for CurrencyIdConvert { fn convert(id: AssetIds) -> Option { diff --git a/runtime/quartz/src/xcm_config.rs b/runtime/quartz/src/xcm_config.rs index e336c4d43f..0592daaff6 100644 --- a/runtime/quartz/src/xcm_config.rs +++ b/runtime/quartz/src/xcm_config.rs @@ -175,7 +175,6 @@ impl orml_xtokens::Config for Runtime { type ReserveProvider = AbsoluteReserveProvider; } - parameter_type_with_key! { pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { match currency_id { @@ -195,7 +194,6 @@ impl Contains for DustRemovalWhitelist { } } - pub struct CurrencyIdConvert; impl Convert> for CurrencyIdConvert { fn convert(id: AssetIds) -> Option { @@ -209,31 +207,6 @@ impl Convert> for CurrencyIdConvert { } } } -/* -impl Convert> for CurrencyIdConvert { - fn convert(location: MultiLocation) -> Option { - if location == MultiLocation::here() - || location == MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))) - { - return Some(AssetIds::NativeAssetId(NativeCurrency::Here)); - } - - if location == MultiLocation::parent() { - return Some(AssetIds::NativeAssetId(NativeCurrency::Parent)); - } - - if let Some(currency_id) = - XcmForeignAssetIdMapping::::get_currency_id(location.clone()) - { - return Some(currency_id); - } - - None - } -} - - */ - parameter_types! { pub const BaseXcmWeight: Weight = 100_000_000; // TODO: recheck this From 25b276d53c1868b8861856e4ae982e0b3d055424 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 6 Sep 2022 11:16:23 +0000 Subject: [PATCH 0748/1274] fix(xcm): get rid of xcm warns, fix quartz CurrencyIdConvert --- pallets/foreing-assets/src/lib.rs | 6 +- runtime/common/config/xcm.rs | 493 --------------------- runtime/common/config/xcm/foreignassets.rs | 160 +++++++ runtime/common/config/xcm/mod.rs | 232 ++++++++++ runtime/common/config/xcm/nativeassets.rs | 129 ++++++ runtime/common/tests/mod.rs | 30 +- runtime/common/tests/xcm.rs | 211 +++++---- runtime/opal/src/tests/logcapture.rs | 6 +- runtime/opal/src/tests/mod.rs | 2 +- runtime/opal/src/tests/xcm.rs | 13 +- runtime/opal/src/xcm_config.rs | 213 ++++----- runtime/quartz/src/tests/logcapture.rs | 6 +- runtime/quartz/src/tests/mod.rs | 2 +- runtime/quartz/src/tests/xcm.rs | 13 +- runtime/quartz/src/xcm_config.rs | 270 ++++++----- runtime/unique/src/tests/logcapture.rs | 6 +- runtime/unique/src/tests/mod.rs | 2 +- runtime/unique/src/tests/xcm.rs | 13 +- runtime/unique/src/xcm_config.rs | 297 ++++++------- 19 files changed, 1003 insertions(+), 1101 deletions(-) delete mode 100644 runtime/common/config/xcm.rs create mode 100644 runtime/common/config/xcm/foreignassets.rs create mode 100644 runtime/common/config/xcm/mod.rs create mode 100644 runtime/common/config/xcm/nativeassets.rs diff --git a/pallets/foreing-assets/src/lib.rs b/pallets/foreing-assets/src/lib.rs index b9e94fdf09..8cc5cf9d9d 100644 --- a/pallets/foreing-assets/src/lib.rs +++ b/pallets/foreing-assets/src/lib.rs @@ -54,7 +54,7 @@ use up_data_structs::{CollectionId, TokenId, CreateCollectionData}; // NOTE:v1::MultiLocation is used in storages, we would need to do migration if upgrade the // MultiLocation in the future. -use xcm::opaque::latest::{prelude::XcmError, MultiAsset}; +use xcm::opaque::latest::prelude::XcmError; use xcm::{v1::MultiLocation, VersionedMultiLocation}; use xcm_executor::{traits::WeightTrader, Assets}; @@ -445,8 +445,6 @@ impl Pallet { } } -use sp_runtime::SaturatedConversion; -use sp_runtime::traits::Saturating; pub use frame_support::{ traits::{ fungibles::{Balanced, CreditOf}, @@ -456,8 +454,6 @@ pub use frame_support::{ weights::{WeightToFeePolynomial, WeightToFee}, }; -use xcm::latest::{Fungibility::Fungible as XcmFungible}; - pub struct FreeForAll< WeightToFee: WeightToFeePolynomial, AssetId: Get, diff --git a/runtime/common/config/xcm.rs b/runtime/common/config/xcm.rs deleted file mode 100644 index 2eb79a5fd8..0000000000 --- a/runtime/common/config/xcm.rs +++ /dev/null @@ -1,493 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -use frame_support::{ - traits::{ - Contains, tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Get, - Everything, fungibles, - }, - weights::{Weight, WeightToFeePolynomial, WeightToFee}, - parameter_types, match_types, -}; -use frame_system::EnsureRoot; -use sp_runtime::{ - traits::{Saturating, CheckedConversion, Zero}, - SaturatedConversion, -}; -use pallet_xcm::XcmPassthrough; -use polkadot_parachain::primitives::Sibling; -use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*}; -use xcm::latest::{ - AssetId::{Concrete}, - Fungibility::Fungible as XcmFungible, - MultiAsset, Error as XcmError, Instruction, Xcm, -}; -use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, - FixedWeightBounds, FungiblesAdapter, LocationInverter, NativeAsset, ParentAsSuperuser, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - ParentIsPreset, ConvertedConcreteAssetId, -}; -use xcm_executor::{Config, XcmExecutor, Assets}; -use xcm_executor::traits::{ - Convert as ConvertXcm, JustTry, MatchesFungible, WeightTrader, FilterAssetLocation, - ShouldExecute, -}; -use pallet_foreing_assets::{ - AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, FreeForAll, - TryAsForeing, ForeignAssetId, -}; -use sp_std::{borrow::Borrow, marker::PhantomData, vec, vec::Vec}; -use crate::{ - Runtime, Call, Event, Origin, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue, - xcm_config::Barrier, -}; -#[cfg(feature = "foreign-assets")] -use crate::ForeingAssets; - -use up_common::{ - types::{AccountId, Balance}, - constants::*, -}; - -parameter_types! { - pub const RelayLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); - pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); -} - -/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. -pub type LocationToAccountId = ( - // The parent (Relay-chain) origin converts to the default `AccountId`. - ParentIsPreset, - // Sibling parachain origins convert to AccountId via the `ParaId::into`. - SiblingParachainConvertsVia, - // Straight up local `AccountId32` origins just alias directly to `AccountId`. - AccountId32Aliases, -); - -pub struct OnlySelfCurrency; -impl> MatchesFungible for OnlySelfCurrency { - fn matches_fungible(a: &MultiAsset) -> Option { - let paraid = Parachain(ParachainInfo::parachain_id().into()); - match (&a.id, &a.fun) { - ( - Concrete(MultiLocation { - parents: 1, - interior: X1(loc), - }), - XcmFungible(ref amount), - ) if paraid == *loc => CheckedConversion::checked_from(*amount), - ( - Concrete(MultiLocation { - parents: 0, - interior: Here, - }), - XcmFungible(ref amount), - ) => CheckedConversion::checked_from(*amount), - _ => None, - } - } -} - -/// Means for transacting assets on this chain. -pub type LocalAssetTransactor = CurrencyAdapter< - // Use this currency: - Balances, - // Use this currency when it is a fungible asset matching the given location or name: - OnlySelfCurrency, - // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We don't track any teleports. - (), ->; - -/// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = (SignedToAccountId32,); - -/// The means for routing XCM messages which are not for local execution into the right message -/// queues. -pub type XcmRouter = ( - // Two routers - use UMP to communicate with the relay chain: - cumulus_primitives_utility::ParentAsUmp, - // ..and XCMP to communicate with the sibling chains. - XcmpQueue, -); - -/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. -pub type XcmOriginToTransactDispatchOrigin = ( - // Sovereign account converter; this attempts to derive an `AccountId` from the origin location - // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for - // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, - // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when - // recognised. - RelayChainAsNative, - // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when - // recognised. - SiblingParachainAsNative, - // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a - // transaction from the Root origin. - ParentAsSuperuser, - // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, - // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, -); - -parameter_types! { - // One XCM operation is 1_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000; - // 1200 UNIQUEs buy 1 second of weight. - pub const WeightPrice: (MultiLocation, u128) = (MultiLocation::parent(), 1_200 * UNIQUE); - pub const MaxInstructions: u32 = 100; -} - -match_types! { - pub type ParentOrParentsUnitPlurality: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) } - }; -} - -pub trait TryPass { - fn try_pass( - origin: &MultiLocation, - message: &mut Xcm, - ) -> Result<(), ()>; -} - -#[impl_trait_for_tuples::impl_for_tuples(30)] -impl TryPass for Tuple { - fn try_pass( - origin: &MultiLocation, - message: &mut Xcm, - ) -> Result<(), ()> { - for_tuples!( #( - Tuple::try_pass(origin, message)?; - )* ); - - Ok(()) - } -} - -pub struct DenyTransact; -impl TryPass for DenyTransact { - fn try_pass( - _origin: &MultiLocation, - message: &mut Xcm, - ) -> Result<(), ()> { - let transact_inst = message - .0 - .iter() - .find(|inst| matches![inst, Instruction::Transact { .. }]); - - match transact_inst { - Some(_) => { - log::warn!( - target: "xcm::barrier", - "transact XCM rejected" - ); - - Err(()) - } - None => Ok(()), - } - } -} - -/// Deny executing the XCM if it matches any of the Deny filter regardless of anything else. -/// If it passes the Deny, and matches one of the Allow cases then it is let through. -pub struct DenyThenTry(PhantomData, PhantomData) -where - Deny: TryPass, - Allow: ShouldExecute; - -impl ShouldExecute for DenyThenTry -where - Deny: TryPass, - Allow: ShouldExecute, -{ - fn should_execute( - origin: &MultiLocation, - message: &mut Xcm, - max_weight: Weight, - weight_credit: &mut Weight, - ) -> Result<(), ()> { - Deny::try_pass(origin, message)?; - Allow::should_execute(origin, message, max_weight, weight_credit) - } -} - -pub struct UsingOnlySelfCurrencyComponents< - WeightToFee: WeightToFeePolynomial, - AssetId: Get, - AccountId, - Currency: CurrencyT, - OnUnbalanced: OnUnbalancedT, ->( - Weight, - Currency::Balance, - PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>, -); -impl< - WeightToFee: WeightToFeePolynomial, - AssetId: Get, - AccountId, - Currency: CurrencyT, - OnUnbalanced: OnUnbalancedT, - > WeightTrader - for UsingOnlySelfCurrencyComponents -{ - fn new() -> Self { - Self(0, Zero::zero(), PhantomData) - } - - fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result { - Ok(payment) - } -} -impl< - WeightToFee: WeightToFeePolynomial, - AssetId: Get, - AccountId, - Currency: CurrencyT, - OnUnbalanced: OnUnbalancedT, - > Drop - for UsingOnlySelfCurrencyComponents -{ - fn drop(&mut self) { - OnUnbalanced::on_unbalanced(Currency::issue(self.1)); - } -} - -parameter_types! { - pub CheckingAccount: AccountId = PolkadotXcm::check_account(); -} -/// Allow checking in assets that have issuance > 0. -#[cfg(feature = "foreign-assets")] -pub struct NonZeroIssuance(PhantomData<(AccountId, ForeingAssets)>); - -#[cfg(feature = "foreign-assets")] -impl Contains<>::AssetId> - for NonZeroIssuance -where - ForeingAssets: fungibles::Inspect, -{ - fn contains(id: &>::AssetId) -> bool { - !ForeingAssets::total_issuance(*id).is_zero() - } -} - -#[cfg(feature = "foreign-assets")] -pub struct AsInnerId(PhantomData<(AssetId, ConvertAssetId)>); -#[cfg(feature = "foreign-assets")] -impl> - ConvertXcm for AsInnerId -where - AssetId: Borrow, - AssetId: TryAsForeing, - AssetIds: Borrow, -{ - fn convert_ref(id: impl Borrow) -> Result { - let id = id.borrow(); - - log::trace!( - target: "xcm::AsInnerId::Convert", - "AsInnerId {:?}", - id - ); - - let parent = MultiLocation::parent(); - let here = MultiLocation::here(); - let self_location = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); - - if *id == parent { - return ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Parent)); - } - - if *id == here || *id == self_location { - return ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Here)); - } - - match XcmForeignAssetIdMapping::::get_currency_id(id.clone()) { - Some(AssetIds::ForeignAssetId(foreign_asset_id)) => { - ConvertAssetId::convert_ref(AssetIds::ForeignAssetId(foreign_asset_id)) - } - _ => ConvertAssetId::convert_ref(AssetIds::ForeignAssetId(0)), - } - } - - fn reverse_ref(what: impl Borrow) -> Result { - log::trace!( - target: "xcm::AsInnerId::Reverse", - "AsInnerId", - ); - - let asset_id = what.borrow(); - - let parent_id = - ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Parent)).unwrap(); - let here_id = - ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Here)).unwrap(); - - if asset_id.clone() == parent_id { - return Ok(MultiLocation::parent()); - } - - if asset_id.clone() == here_id { - return Ok(MultiLocation::new( - 1, - X1(Parachain(ParachainInfo::get().into())), - )); - } - - match >::try_as_foreing(asset_id.clone()) { - Some(fid) => match XcmForeignAssetIdMapping::::get_multi_location(fid) { - Some(location) => Ok(location), - None => Err(()), - }, - None => Err(()), - } - } -} - -/// Means for transacting assets besides the native currency on this chain. -#[cfg(feature = "foreign-assets")] -pub type FungiblesTransactor = FungiblesAdapter< - // Use this fungibles implementation: - ForeingAssets, - // Use this currency when it is a fungible asset matching the given location or name: - ConvertedConcreteAssetId, JustTry>, - // Convert an XCM MultiLocation into a local account id: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We only want to allow teleports of known assets. We use non-zero issuance as an indication - // that this asset is known. - NonZeroIssuance, - // The account to use for tracking teleports. - CheckingAccount, ->; - -/// Means for transacting assets on this chain. -#[cfg(feature = "foreign-assets")] -pub type AssetTransactors = FungiblesTransactor; - -#[cfg(not(feature = "foreign-assets"))] -pub type AssetTransactors = LocalAssetTransactor; - -#[cfg(feature = "foreign-assets")] -pub struct AllAsset; -#[cfg(feature = "foreign-assets")] -impl FilterAssetLocation for AllAsset { - fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool { - true - } -} - -#[cfg(feature = "foreign-assets")] -pub type IsReserve = AllAsset; -#[cfg(not(feature = "foreign-assets"))] -pub type IsReserve = NativeAsset; - -#[cfg(feature = "foreign-assets")] -type Trader = FreeForAll< - pallet_configuration::WeightToFee, - RelayLocation, - AccountId, - Balances, - (), ->; -#[cfg(not(feature = "foreign-assets"))] -type Trader = UsingOnlySelfCurrencyComponents< - pallet_configuration::WeightToFee, - RelayLocation, - AccountId, - Balances, - (), ->; - -pub struct XcmConfig(PhantomData); -impl Config for XcmConfig -where - T: pallet_configuration::Config, -{ - type Call = Call; - type XcmSender = XcmRouter; - // How to withdraw and deposit an asset. - type AssetTransactor = AssetTransactors; - type OriginConverter = XcmOriginToTransactDispatchOrigin; - type IsReserve = IsReserve; - type IsTeleporter = (); // Teleportation is disabled - type LocationInverter = LocationInverter; - type Barrier = Barrier; - type Weigher = FixedWeightBounds; - type Trader = Trader; - type ResponseHandler = (); // Don't handle responses for now. - type SubscriptionService = PolkadotXcm; - - type AssetTrap = PolkadotXcm; - type AssetClaims = PolkadotXcm; -} - -impl pallet_xcm::Config for Runtime { - type Event = Event; - type SendXcmOrigin = EnsureXcmOrigin; - type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; - type XcmExecuteFilter = Everything; - type XcmExecutor = XcmExecutor>; - type XcmTeleportFilter = Everything; - type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; - type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; - const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; - type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; -} - -impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor>; -} - -impl cumulus_pallet_xcmp_queue::Config for Runtime { - type WeightInfo = (); - type Event = Event; - type XcmExecutor = XcmExecutor>; - type ChannelInfo = ParachainSystem; - type VersionWrapper = (); - type ExecuteOverweightOrigin = frame_system::EnsureRoot; - type ControllerOrigin = EnsureRoot; - type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; -} - -impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor>; - type ExecuteOverweightOrigin = frame_system::EnsureRoot; -} diff --git a/runtime/common/config/xcm/foreignassets.rs b/runtime/common/config/xcm/foreignassets.rs new file mode 100644 index 0000000000..586e023791 --- /dev/null +++ b/runtime/common/config/xcm/foreignassets.rs @@ -0,0 +1,160 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use frame_support::{ + traits::{Contains, Get, fungibles}, + parameter_types, +}; +use sp_runtime::traits::Zero; +use xcm::v1::{Junction::*, MultiLocation, Junctions::*}; +use xcm::latest::MultiAsset; +use xcm_builder::{FungiblesAdapter, ConvertedConcreteAssetId}; +use xcm_executor::traits::{Convert as ConvertXcm, JustTry, FilterAssetLocation}; +use pallet_foreing_assets::{ + AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, NativeCurrency, FreeForAll, TryAsForeing, + ForeignAssetId, +}; +use sp_std::{borrow::Borrow, marker::PhantomData}; +use crate::{Runtime, Balances, ParachainInfo, PolkadotXcm, ForeingAssets}; + +use super::{LocationToAccountId, RelayLocation}; + +use up_common::types::{AccountId, Balance}; + +parameter_types! { + pub CheckingAccount: AccountId = PolkadotXcm::check_account(); +} + +/// Allow checking in assets that have issuance > 0. +pub struct NonZeroIssuance(PhantomData<(AccountId, ForeingAssets)>); + +impl Contains<>::AssetId> + for NonZeroIssuance +where + ForeingAssets: fungibles::Inspect, +{ + fn contains(id: &>::AssetId) -> bool { + !ForeingAssets::total_issuance(*id).is_zero() + } +} + +pub struct AsInnerId(PhantomData<(AssetId, ConvertAssetId)>); +impl> + ConvertXcm for AsInnerId +where + AssetId: Borrow, + AssetId: TryAsForeing, + AssetIds: Borrow, +{ + fn convert_ref(id: impl Borrow) -> Result { + let id = id.borrow(); + + log::trace!( + target: "xcm::AsInnerId::Convert", + "AsInnerId {:?}", + id + ); + + let parent = MultiLocation::parent(); + let here = MultiLocation::here(); + let self_location = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); + + if *id == parent { + return ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Parent)); + } + + if *id == here || *id == self_location { + return ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Here)); + } + + match XcmForeignAssetIdMapping::::get_currency_id(id.clone()) { + Some(AssetIds::ForeignAssetId(foreign_asset_id)) => { + ConvertAssetId::convert_ref(AssetIds::ForeignAssetId(foreign_asset_id)) + } + _ => ConvertAssetId::convert_ref(AssetIds::ForeignAssetId(0)), + } + } + + fn reverse_ref(what: impl Borrow) -> Result { + log::trace!( + target: "xcm::AsInnerId::Reverse", + "AsInnerId", + ); + + let asset_id = what.borrow(); + + let parent_id = + ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Parent)).unwrap(); + let here_id = + ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Here)).unwrap(); + + if asset_id.clone() == parent_id { + return Ok(MultiLocation::parent()); + } + + if asset_id.clone() == here_id { + return Ok(MultiLocation::new( + 1, + X1(Parachain(ParachainInfo::get().into())), + )); + } + + match >::try_as_foreing(asset_id.clone()) { + Some(fid) => match XcmForeignAssetIdMapping::::get_multi_location(fid) { + Some(location) => Ok(location), + None => Err(()), + }, + None => Err(()), + } + } +} + +/// Means for transacting assets besides the native currency on this chain. +pub type FungiblesTransactor = FungiblesAdapter< + // Use this fungibles implementation: + ForeingAssets, + // Use this currency when it is a fungible asset matching the given location or name: + ConvertedConcreteAssetId, JustTry>, + // Convert an XCM MultiLocation into a local account id: + LocationToAccountId, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // We only want to allow teleports of known assets. We use non-zero issuance as an indication + // that this asset is known. + NonZeroIssuance, + // The account to use for tracking teleports. + CheckingAccount, +>; + +/// Means for transacting assets on this chain. +pub type AssetTransactors = FungiblesTransactor; + +pub struct AllAsset; +impl FilterAssetLocation for AllAsset { + fn filter_asset_location(_asset: &MultiAsset, _origin: &MultiLocation) -> bool { + true + } +} + +pub type IsReserve = AllAsset; + +pub type Trader = FreeForAll< + pallet_configuration::WeightToFee, + RelayLocation, + AccountId, + Balances, + (), +>; diff --git a/runtime/common/config/xcm/mod.rs b/runtime/common/config/xcm/mod.rs new file mode 100644 index 0000000000..aa8de7b685 --- /dev/null +++ b/runtime/common/config/xcm/mod.rs @@ -0,0 +1,232 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use frame_support::{traits::Everything, weights::Weight, parameter_types}; +use frame_system::EnsureRoot; +use pallet_xcm::XcmPassthrough; +use polkadot_parachain::primitives::Sibling; +use xcm::v1::{Junction::*, MultiLocation, NetworkId}; +use xcm::latest::{Instruction, Xcm}; +use xcm_builder::{ + AccountId32Aliases, EnsureXcmOrigin, FixedWeightBounds, LocationInverter, ParentAsSuperuser, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, ParentIsPreset, +}; +use xcm_executor::{Config, XcmExecutor, traits::ShouldExecute}; +use sp_std::marker::PhantomData; +use crate::{ + Runtime, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue, + xcm_config::Barrier, +}; + +use up_common::types::AccountId; + +#[cfg(feature = "foreign-assets")] +mod foreignassets; + +#[cfg(not(feature = "foreign-assets"))] +mod nativeassets; + +#[cfg(feature = "foreign-assets")] +use foreignassets as xcm_assets; + +#[cfg(not(feature = "foreign-assets"))] +use nativeassets as xcm_assets; + +use xcm_assets::{AssetTransactors, IsReserve, Trader}; + +parameter_types! { + pub const RelayLocation: MultiLocation = MultiLocation::parent(); + pub const RelayNetwork: NetworkId = NetworkId::Polkadot; + pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); +} + +/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used +/// when determining ownership of accounts for asset transacting and when attempting to use XCM +/// `Transact` in order to determine the dispatch Origin. +pub type LocationToAccountId = ( + // The parent (Relay-chain) origin converts to the default `AccountId`. + ParentIsPreset, + // Sibling parachain origins convert to AccountId via the `ParaId::into`. + SiblingParachainConvertsVia, + // Straight up local `AccountId32` origins just alias directly to `AccountId`. + AccountId32Aliases, +); + +/// No local origins on this chain are allowed to dispatch XCM sends/executions. +pub type LocalOriginToLocation = (SignedToAccountId32,); + +/// The means for routing XCM messages which are not for local execution into the right message +/// queues. +pub type XcmRouter = ( + // Two routers - use UMP to communicate with the relay chain: + cumulus_primitives_utility::ParentAsUmp, + // ..and XCMP to communicate with the sibling chains. + XcmpQueue, +); + +/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, +/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can +/// biases the kind of local `Origin` it will become. +pub type XcmOriginToTransactDispatchOrigin = ( + // Sovereign account converter; this attempts to derive an `AccountId` from the origin location + // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for + // foreign chains who want to have a local sovereign account on this chain which they control. + SovereignSignedViaLocation, + // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when + // recognised. + RelayChainAsNative, + // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when + // recognised. + SiblingParachainAsNative, + // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a + // transaction from the Root origin. + ParentAsSuperuser, + // Native signed account converter; this just converts an `AccountId32` origin into a normal + // `Origin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, + // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. + XcmPassthrough, +); + +parameter_types! { + // One XCM operation is 1_000_000 weight - almost certainly a conservative estimate. + pub UnitWeightCost: Weight = 1_000_000; + pub const MaxInstructions: u32 = 100; +} + +pub trait TryPass { + fn try_pass(origin: &MultiLocation, message: &mut Xcm) -> Result<(), ()>; +} + +#[impl_trait_for_tuples::impl_for_tuples(30)] +impl TryPass for Tuple { + fn try_pass(origin: &MultiLocation, message: &mut Xcm) -> Result<(), ()> { + for_tuples!( #( + Tuple::try_pass(origin, message)?; + )* ); + + Ok(()) + } +} + +pub struct DenyTransact; +impl TryPass for DenyTransact { + fn try_pass(_origin: &MultiLocation, message: &mut Xcm) -> Result<(), ()> { + let transact_inst = message + .0 + .iter() + .find(|inst| matches![inst, Instruction::Transact { .. }]); + + match transact_inst { + Some(_) => { + log::warn!( + target: "xcm::barrier", + "transact XCM rejected" + ); + + Err(()) + } + None => Ok(()), + } + } +} + +/// Deny executing the XCM if it matches any of the Deny filter regardless of anything else. +/// If it passes the Deny, and matches one of the Allow cases then it is let through. +pub struct DenyThenTry(PhantomData, PhantomData) +where + Deny: TryPass, + Allow: ShouldExecute; + +impl ShouldExecute for DenyThenTry +where + Deny: TryPass, + Allow: ShouldExecute, +{ + fn should_execute( + origin: &MultiLocation, + message: &mut Xcm, + max_weight: Weight, + weight_credit: &mut Weight, + ) -> Result<(), ()> { + Deny::try_pass(origin, message)?; + Allow::should_execute(origin, message, max_weight, weight_credit) + } +} + +pub struct XcmConfig(PhantomData); +impl Config for XcmConfig +where + T: pallet_configuration::Config, +{ + type Call = Call; + type XcmSender = XcmRouter; + // How to withdraw and deposit an asset. + type AssetTransactor = AssetTransactors; + type OriginConverter = XcmOriginToTransactDispatchOrigin; + type IsReserve = IsReserve; + type IsTeleporter = (); // Teleportation is disabled + type LocationInverter = LocationInverter; + type Barrier = Barrier; + type Weigher = FixedWeightBounds; + type Trader = Trader; + type ResponseHandler = (); // Don't handle responses for now. + type SubscriptionService = PolkadotXcm; + + type AssetTrap = PolkadotXcm; + type AssetClaims = PolkadotXcm; +} + +impl pallet_xcm::Config for Runtime { + type Event = Event; + type SendXcmOrigin = EnsureXcmOrigin; + type XcmRouter = XcmRouter; + type ExecuteXcmOrigin = EnsureXcmOrigin; + type XcmExecuteFilter = Everything; + type XcmExecutor = XcmExecutor>; + type XcmTeleportFilter = Everything; + type XcmReserveTransferFilter = Everything; + type Weigher = FixedWeightBounds; + type LocationInverter = LocationInverter; + type Origin = Origin; + type Call = Call; + const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; + type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; +} + +impl cumulus_pallet_xcm::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor>; +} + +impl cumulus_pallet_xcmp_queue::Config for Runtime { + type WeightInfo = (); + type Event = Event; + type XcmExecutor = XcmExecutor>; + type ChannelInfo = ParachainSystem; + type VersionWrapper = (); + type ExecuteOverweightOrigin = frame_system::EnsureRoot; + type ControllerOrigin = EnsureRoot; + type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; +} + +impl cumulus_pallet_dmp_queue::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor>; + type ExecuteOverweightOrigin = frame_system::EnsureRoot; +} diff --git a/runtime/common/config/xcm/nativeassets.rs b/runtime/common/config/xcm/nativeassets.rs new file mode 100644 index 0000000000..c5d5a44a28 --- /dev/null +++ b/runtime/common/config/xcm/nativeassets.rs @@ -0,0 +1,129 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use frame_support::{ + traits::{tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Get}, + weights::{Weight, WeightToFeePolynomial}, +}; +use sp_runtime::traits::{CheckedConversion, Zero}; +use xcm::v1::{Junction::*, MultiLocation, Junctions::*}; +use xcm::latest::{ + AssetId::{Concrete}, + Fungibility::Fungible as XcmFungible, + MultiAsset, Error as XcmError, +}; +use xcm_builder::{CurrencyAdapter, NativeAsset}; +use xcm_executor::{ + Assets, + traits::{MatchesFungible, WeightTrader}, +}; +use sp_std::marker::PhantomData; +use crate::{Balances, ParachainInfo}; +use super::{LocationToAccountId, RelayLocation}; + +use up_common::types::{AccountId, Balance}; + +pub struct OnlySelfCurrency; +impl> MatchesFungible for OnlySelfCurrency { + fn matches_fungible(a: &MultiAsset) -> Option { + let paraid = Parachain(ParachainInfo::parachain_id().into()); + match (&a.id, &a.fun) { + ( + Concrete(MultiLocation { + parents: 1, + interior: X1(loc), + }), + XcmFungible(ref amount), + ) if paraid == *loc => CheckedConversion::checked_from(*amount), + ( + Concrete(MultiLocation { + parents: 0, + interior: Here, + }), + XcmFungible(ref amount), + ) => CheckedConversion::checked_from(*amount), + _ => None, + } + } +} + +/// Means for transacting assets on this chain. +pub type LocalAssetTransactor = CurrencyAdapter< + // Use this currency: + Balances, + // Use this currency when it is a fungible asset matching the given location or name: + OnlySelfCurrency, + // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID: + LocationToAccountId, + // Our chain's account ID type (we can't get away without mentioning it explicitly): + AccountId, + // We don't track any teleports. + (), +>; + +pub type AssetTransactors = LocalAssetTransactor; + +pub type IsReserve = NativeAsset; + +pub struct UsingOnlySelfCurrencyComponents< + WeightToFee: WeightToFeePolynomial, + AssetId: Get, + AccountId, + Currency: CurrencyT, + OnUnbalanced: OnUnbalancedT, +>( + Weight, + Currency::Balance, + PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>, +); +impl< + WeightToFee: WeightToFeePolynomial, + AssetId: Get, + AccountId, + Currency: CurrencyT, + OnUnbalanced: OnUnbalancedT, + > WeightTrader + for UsingOnlySelfCurrencyComponents +{ + fn new() -> Self { + Self(0, Zero::zero(), PhantomData) + } + + fn buy_weight(&mut self, _weight: Weight, payment: Assets) -> Result { + Ok(payment) + } +} +impl< + WeightToFee: WeightToFeePolynomial, + AssetId: Get, + AccountId, + Currency: CurrencyT, + OnUnbalanced: OnUnbalancedT, + > Drop + for UsingOnlySelfCurrencyComponents +{ + fn drop(&mut self) { + OnUnbalanced::on_unbalanced(Currency::issue(self.1)); + } +} + +pub type Trader = UsingOnlySelfCurrencyComponents< + pallet_configuration::WeightToFee, + RelayLocation, + AccountId, + Balances, + (), +>; diff --git a/runtime/common/tests/mod.rs b/runtime/common/tests/mod.rs index bc39d3bfdd..887da689af 100644 --- a/runtime/common/tests/mod.rs +++ b/runtime/common/tests/mod.rs @@ -29,20 +29,18 @@ fn get_from_seed(seed: &str) -> ::Public } fn new_test_ext(para_id: u32) -> sp_io::TestExternalities { - let cfg = GenesisConfig { - aura: AuraConfig { - authorities: vec![ - get_from_seed::("Alice"), - get_from_seed::("Bob"), - ], - }, - parachain_info: ParachainInfoConfig { - parachain_id: para_id.into(), - }, - ..GenesisConfig::default() - }; - - cfg.build_storage() - .unwrap() - .into() + let cfg = GenesisConfig { + aura: AuraConfig { + authorities: vec![ + get_from_seed::("Alice"), + get_from_seed::("Bob"), + ], + }, + parachain_info: ParachainInfoConfig { + parachain_id: para_id.into(), + }, + ..GenesisConfig::default() + }; + + cfg.build_storage().unwrap().into() } diff --git a/runtime/common/tests/xcm.rs b/runtime/common/tests/xcm.rs index 27e2f142fb..ef9efe1d51 100644 --- a/runtime/common/tests/xcm.rs +++ b/runtime/common/tests/xcm.rs @@ -20,154 +20,143 @@ use logtest::Logger; use crate::Call; use super::new_test_ext; -fn catch_xcm_barrier_log( - logger: &mut Logger, - expected_msg: &str -) -> Result<(), String> { - for record in logger { - if record.target() == "xcm::barrier" - && record.args() == expected_msg { - return Ok(()); - } - } - - Err(format!("the expected XCM barrier log `{}` is not found", expected_msg)) +fn catch_xcm_barrier_log(logger: &mut Logger, expected_msg: &str) -> Result<(), String> { + for record in logger { + if record.target() == "xcm::barrier" && record.args() == expected_msg { + return Ok(()); + } + } + + Err(format!( + "the expected XCM barrier log `{}` is not found", + expected_msg + )) } /// WARNING: Uses log capturing /// See https://docs.rs/logtest/latest/logtest/index.html#constraints pub fn barrier_denies_transact(logger: &mut Logger) { - let location = MultiLocation { - parents: 0, - interior: Junctions::Here, - }; + let location = MultiLocation { + parents: 0, + interior: Junctions::Here, + }; - // We will never decode this "call", - // so it is irrelevant what we are passing to the `transact` cmd. - let fake_encoded_call = vec![0u8]; + // We will never decode this "call", + // so it is irrelevant what we are passing to the `transact` cmd. + let fake_encoded_call = vec![0u8]; - let transact_inst = Transact { - origin_type: OriginKind::Superuser, - require_weight_at_most: 0, - call: fake_encoded_call.into(), - }; + let transact_inst = Transact { + origin_type: OriginKind::Superuser, + require_weight_at_most: 0, + call: fake_encoded_call.into(), + }; - let mut xcm_program = Xcm::(vec![transact_inst]); + let mut xcm_program = Xcm::(vec![transact_inst]); - let max_weight = 100_000; - let mut weight_credit = 100_000_000; + let max_weight = 100_000; + let mut weight_credit = 100_000_000; - let result = B::should_execute( - &location, - &mut xcm_program, - max_weight, - &mut weight_credit - ); + let result = B::should_execute(&location, &mut xcm_program, max_weight, &mut weight_credit); - assert!(result.is_err(), "the barrier should disallow the XCM transact cmd"); + assert!( + result.is_err(), + "the barrier should disallow the XCM transact cmd" + ); - catch_xcm_barrier_log(logger, "transact XCM rejected").unwrap(); + catch_xcm_barrier_log(logger, "transact XCM rejected").unwrap(); } fn xcm_execute( - self_para_id: u32, - location: &MultiLocation, - xcm: &mut Xcm + self_para_id: u32, + location: &MultiLocation, + xcm: &mut Xcm, ) -> Result<(), ()> { - new_test_ext(self_para_id).execute_with(|| { - let max_weight = 100_000; - let mut weight_credit = 100_000_000; - - B::should_execute( - &location, - xcm, - max_weight, - &mut weight_credit - ) - }) + new_test_ext(self_para_id).execute_with(|| { + let max_weight = 100_000; + let mut weight_credit = 100_000_000; + + B::should_execute(&location, xcm, max_weight, &mut weight_credit) + }) } fn make_multiassets(location: &MultiLocation) -> MultiAssets { - let id = AssetId::Concrete(location.clone()); - let fun = Fungibility::Fungible(42); - let multiasset = MultiAsset { - id, - fun, - }; - - multiasset.into() + let id = AssetId::Concrete(location.clone()); + let fun = Fungibility::Fungible(42); + let multiasset = MultiAsset { id, fun }; + + multiasset.into() } fn make_transfer_reserve_asset(location: &MultiLocation) -> Xcm { - let assets = make_multiassets(location); - let inst = TransferReserveAsset { - assets, - dest: location.clone(), - xcm: Xcm(vec![]), - }; - - Xcm::(vec![inst]) + let assets = make_multiassets(location); + let inst = TransferReserveAsset { + assets, + dest: location.clone(), + xcm: Xcm(vec![]), + }; + + Xcm::(vec![inst]) } fn make_deposit_reserve_asset(location: &MultiLocation) -> Xcm { - let assets = make_multiassets(location); - let inst = DepositReserveAsset { - assets: assets.into(), - max_assets: 42, - dest: location.clone(), - xcm: Xcm(vec![]), - }; - - Xcm::(vec![inst]) + let assets = make_multiassets(location); + let inst = DepositReserveAsset { + assets: assets.into(), + max_assets: 42, + dest: location.clone(), + xcm: Xcm(vec![]), + }; + + Xcm::(vec![inst]) } fn expect_transfer_location_denied( - logger: &mut Logger, - self_para_id: u32, - location: &MultiLocation, - xcm: &mut Xcm + logger: &mut Logger, + self_para_id: u32, + location: &MultiLocation, + xcm: &mut Xcm, ) -> Result<(), String> { - let result = xcm_execute::(self_para_id, location, xcm); + let result = xcm_execute::(self_para_id, location, xcm); - if result.is_ok() { - return Err("the barrier should deny the unknown location".into()); - } + if result.is_ok() { + return Err("the barrier should deny the unknown location".into()); + } - catch_xcm_barrier_log(logger, "Unexpected deposit or transfer location") + catch_xcm_barrier_log(logger, "Unexpected deposit or transfer location") } /// WARNING: Uses log capturing /// See https://docs.rs/logtest/latest/logtest/index.html#constraints pub fn barrier_denies_transfer_from_unknown_location( - logger: &mut Logger, - self_para_id: u32, + logger: &mut Logger, + self_para_id: u32, ) -> Result<(), String> where - B: ShouldExecute + B: ShouldExecute, { - const UNKNOWN_PARACHAIN_ID: u32 = 4057; - - let unknown_location = MultiLocation { - parents: 1, - interior: X1(Parachain(UNKNOWN_PARACHAIN_ID)), - }; - - let mut transfer_reserve_asset = make_transfer_reserve_asset(&unknown_location); - let mut deposit_reserve_asset = make_deposit_reserve_asset(&unknown_location); - - expect_transfer_location_denied::( - logger, - self_para_id, - &unknown_location, - &mut transfer_reserve_asset - )?; - - expect_transfer_location_denied::( - logger, - self_para_id, - &unknown_location, - &mut deposit_reserve_asset - )?; - - Ok(()) + const UNKNOWN_PARACHAIN_ID: u32 = 4057; + + let unknown_location = MultiLocation { + parents: 1, + interior: X1(Parachain(UNKNOWN_PARACHAIN_ID)), + }; + + let mut transfer_reserve_asset = make_transfer_reserve_asset(&unknown_location); + let mut deposit_reserve_asset = make_deposit_reserve_asset(&unknown_location); + + expect_transfer_location_denied::( + logger, + self_para_id, + &unknown_location, + &mut transfer_reserve_asset, + )?; + + expect_transfer_location_denied::( + logger, + self_para_id, + &unknown_location, + &mut deposit_reserve_asset, + )?; + + Ok(()) } diff --git a/runtime/opal/src/tests/logcapture.rs b/runtime/opal/src/tests/logcapture.rs index 72e37816ad..da0a310310 100644 --- a/runtime/opal/src/tests/logcapture.rs +++ b/runtime/opal/src/tests/logcapture.rs @@ -19,7 +19,7 @@ use super::xcm::opal_xcm_tests; #[test] fn opal_log_capture_tests() { - let mut logger = Logger::start(); - - opal_xcm_tests(&mut logger); + let mut logger = Logger::start(); + + opal_xcm_tests(&mut logger); } diff --git a/runtime/opal/src/tests/mod.rs b/runtime/opal/src/tests/mod.rs index 09df4a7f65..587524b3c9 100644 --- a/runtime/opal/src/tests/mod.rs +++ b/runtime/opal/src/tests/mod.rs @@ -14,5 +14,5 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -mod xcm; mod logcapture; +mod xcm; diff --git a/runtime/opal/src/tests/xcm.rs b/runtime/opal/src/tests/xcm.rs index 54a30f49aa..fd58e50638 100644 --- a/runtime/opal/src/tests/xcm.rs +++ b/runtime/opal/src/tests/xcm.rs @@ -15,18 +15,13 @@ // along with Unique Network. If not, see . use logtest::Logger; -use crate::{ - runtime_common::tests::xcm::*, - xcm_config::Barrier, -}; +use crate::{runtime_common::tests::xcm::*, xcm_config::Barrier}; const OPAL_PARA_ID: u32 = 2095; // Same as Quartz pub fn opal_xcm_tests(logger: &mut Logger) { - barrier_denies_transact::(logger); + barrier_denies_transact::(logger); - barrier_denies_transfer_from_unknown_location::( - logger, - OPAL_PARA_ID, - ).expect_err("opal runtime allows any location"); + barrier_denies_transfer_from_unknown_location::(logger, OPAL_PARA_ID) + .expect_err("opal runtime allows any location"); } diff --git a/runtime/opal/src/xcm_config.rs b/runtime/opal/src/xcm_config.rs index 964bd45da5..a087f0a23d 100644 --- a/runtime/opal/src/xcm_config.rs +++ b/runtime/opal/src/xcm_config.rs @@ -14,98 +14,41 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use cumulus_pallet_xcm; use frame_support::{ {match_types, parameter_types, weights::Weight}, pallet_prelude::Get, - traits::{Contains, Everything, fungibles}, + traits::{Contains, Everything}, }; -use frame_system::EnsureRoot; use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; -use pallet_xcm::XcmPassthrough; -use polkadot_parachain::primitives::Sibling; -use sp_runtime::traits::{AccountIdConversion, CheckedConversion, Convert, Zero}; -use sp_std::{borrow::Borrow, marker::PhantomData, vec, vec::Vec}; +use sp_runtime::traits::{AccountIdConversion, Convert}; +use sp_std::{vec, vec::Vec}; use xcm::{ - latest::{MultiAsset, Xcm}, - prelude::{Concrete, Fungible as XcmFungible}, + latest::Xcm, v1::{BodyId, Junction::*, Junctions::*, MultiLocation, NetworkId}, }; use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, EnsureXcmOrigin, - FixedWeightBounds, FungiblesAdapter, LocationInverter, ParentAsSuperuser, ParentIsPreset, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - ConvertedConcreteAssetId, -}; -use xcm_executor::{ - {Config, XcmExecutor}, - traits::{Convert as ConvertXcm, FilterAssetLocation, JustTry, MatchesFungible, ShouldExecute}, -}; - -use up_common::{ - constants::{MAXIMUM_BLOCK_WEIGHT, UNIQUE}, - types::{AccountId, Balance}, + AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, FixedWeightBounds, LocationInverter, + TakeWeightCredit, }; +use xcm_executor::{XcmExecutor, traits::ShouldExecute}; +use up_common::types::{AccountId, Balance}; use crate::{ - Balances, Call, DmpQueue, Event, ForeingAssets, Origin, ParachainInfo, ParachainSystem, - PolkadotXcm, Runtime, XcmpQueue, + Call, Event, ParachainInfo, Runtime, + runtime_common::config::{ + substrate::{TreasuryModuleId, MaxLocks, MaxReserves}, + pallets::TreasuryAccountId, + xcm::*, + }, }; -use crate::runtime_common::config::substrate::{TreasuryModuleId, MaxLocks, MaxReserves}; -use crate::runtime_common::config::pallets::TreasuryAccountId; -use crate::runtime_common::config::xcm::*; -use crate::*; use pallet_foreing_assets::{ - AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, FreeForAll, - TryAsForeing, ForeignAssetId, + AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, }; // Signed version of balance pub type Amount = i128; -parameter_types! { - pub const RelayLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); - pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); - pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); -} - -/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. -pub type XcmOriginToTransactDispatchOrigin = ( - // Sovereign account converter; this attempts to derive an `AccountId` from the origin location - // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for - // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, - // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when - // recognised. - RelayChainAsNative, - // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when - // recognised. - SiblingParachainAsNative, - // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a - // transaction from the Root origin. - ParentAsSuperuser, - // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, - // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, -); - -parameter_types! { - // One XCM operation is 1_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000; - // 1200 UNIQUEs buy 1 second of weight. - pub const WeightPrice: (MultiLocation, u128) = (MultiLocation::parent(), 1_200 * UNIQUE); - pub const MaxInstructions: u32 = 100; - pub const MaxAuthorities: u32 = 100_000; -} - match_types! { pub type ParentOrParentsUnitPlurality: impl Contains = { MultiLocation { parents: 1, interior: Here } | @@ -123,8 +66,8 @@ impl ShouldExecute for AllowAllDebug { fn should_execute( _origin: &MultiLocation, _message: &mut Xcm, - max_weight: Weight, - weight_credit: &mut Weight, + _max_weight: Weight, + _weight_credit: &mut Weight, ) -> Result<(), ()> { Ok(()) } @@ -138,31 +81,9 @@ pub type Barrier = DenyThenTry< AllowUnpaidExecutionFrom, // ^^^ Parent & its unit plurality gets free execution AllowAllDebug, - ) + ), >; -pub struct AllAsset; -impl FilterAssetLocation for AllAsset { - fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool { - true - } -} - -pub struct CurrencyIdConvert; -impl Convert> for CurrencyIdConvert { - fn convert(id: AssetIds) -> Option { - match id { - AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new( - 1, - X1(Parachain(ParachainInfo::get().into())), - )), - AssetIds::NativeAssetId(NativeCurrency::Parent) => Some(MultiLocation::parent()), - AssetIds::ForeignAssetId(foreign_asset_id) => { - XcmForeignAssetIdMapping::::get_multi_location(foreign_asset_id) - } - } - } -} impl Convert> for CurrencyIdConvert { fn convert(location: MultiLocation) -> Option { if location == MultiLocation::here() @@ -185,29 +106,6 @@ impl Convert> for CurrencyIdConvert { } } -pub fn get_all_module_accounts() -> Vec { - vec![TreasuryModuleId::get().into_account_truncating()] -} - -pub struct DustRemovalWhitelist; -impl Contains for DustRemovalWhitelist { - fn contains(a: &AccountId) -> bool { - get_all_module_accounts().contains(a) - } -} - -parameter_type_with_key! { - pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { - match currency_id { - CurrencyId::NativeAssetId(symbol) => match symbol { - NativeCurrency::Here => 0, - NativeCurrency::Parent=> 0, - }, - _ => 100_000 - } - }; -} - impl orml_tokens::Config for Runtime { type Event = Event; type Balance = Balance; @@ -226,9 +124,64 @@ impl orml_tokens::Config for Runtime { type OnKilledTokenAccount = (); } +impl orml_xtokens::Config for Runtime { + type Event = Event; + type Balance = Balance; + type CurrencyId = CurrencyId; + type CurrencyIdConvert = CurrencyIdConvert; + type AccountIdToMultiLocation = AccountIdToMultiLocation; + type SelfLocation = SelfLocation; + type XcmExecutor = XcmExecutor>; + type Weigher = FixedWeightBounds; + type BaseXcmWeight = BaseXcmWeight; + type LocationInverter = LocationInverter; + type MaxAssetsForTransfer = MaxAssetsForTransfer; + type MinXcmFee = ParachainMinFee; + type MultiLocationsFilter = Everything; + type ReserveProvider = AbsoluteReserveProvider; +} + +parameter_type_with_key! { + pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { + match currency_id { + CurrencyId::NativeAssetId(symbol) => match symbol { + NativeCurrency::Here => 0, + NativeCurrency::Parent=> 0, + }, + _ => 100_000 + } + }; +} + +pub struct DustRemovalWhitelist; +impl Contains for DustRemovalWhitelist { + fn contains(a: &AccountId) -> bool { + get_all_module_accounts().contains(a) + } +} + +pub struct CurrencyIdConvert; +impl Convert> for CurrencyIdConvert { + fn convert(id: AssetIds) -> Option { + match id { + AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new( + 1, + X1(Parachain(ParachainInfo::get().into())), + )), + AssetIds::NativeAssetId(NativeCurrency::Parent) => Some(MultiLocation::parent()), + AssetIds::ForeignAssetId(foreign_asset_id) => { + XcmForeignAssetIdMapping::::get_multi_location(foreign_asset_id) + } + } + } +} + parameter_types! { pub const BaseXcmWeight: Weight = 100_000_000; // TODO: recheck this pub const MaxAssetsForTransfer: usize = 2; + + pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); + pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); } parameter_type_with_key! { @@ -237,6 +190,9 @@ parameter_type_with_key! { }; } +pub fn get_all_module_accounts() -> Vec { + vec![TreasuryModuleId::get().into_account_truncating()] +} pub struct AccountIdToMultiLocation; impl Convert for AccountIdToMultiLocation { fn convert(account: AccountId) -> MultiLocation { @@ -247,20 +203,3 @@ impl Convert for AccountIdToMultiLocation { .into() } } - -impl orml_xtokens::Config for Runtime { - type Event = Event; - type Balance = Balance; - type CurrencyId = CurrencyId; - type CurrencyIdConvert = CurrencyIdConvert; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type SelfLocation = SelfLocation; - type XcmExecutor = XcmExecutor>; - type Weigher = FixedWeightBounds; - type BaseXcmWeight = BaseXcmWeight; - type LocationInverter = LocationInverter; - type MaxAssetsForTransfer = MaxAssetsForTransfer; - type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; - type ReserveProvider = AbsoluteReserveProvider; -} diff --git a/runtime/quartz/src/tests/logcapture.rs b/runtime/quartz/src/tests/logcapture.rs index e59a0024d6..97cecd289b 100644 --- a/runtime/quartz/src/tests/logcapture.rs +++ b/runtime/quartz/src/tests/logcapture.rs @@ -19,7 +19,7 @@ use super::xcm::quartz_xcm_tests; #[test] fn quartz_log_capture_tests() { - let mut logger = Logger::start(); - - quartz_xcm_tests(&mut logger); + let mut logger = Logger::start(); + + quartz_xcm_tests(&mut logger); } diff --git a/runtime/quartz/src/tests/mod.rs b/runtime/quartz/src/tests/mod.rs index 09df4a7f65..587524b3c9 100644 --- a/runtime/quartz/src/tests/mod.rs +++ b/runtime/quartz/src/tests/mod.rs @@ -14,5 +14,5 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -mod xcm; mod logcapture; +mod xcm; diff --git a/runtime/quartz/src/tests/xcm.rs b/runtime/quartz/src/tests/xcm.rs index 7e854e1e47..719df55755 100644 --- a/runtime/quartz/src/tests/xcm.rs +++ b/runtime/quartz/src/tests/xcm.rs @@ -15,18 +15,13 @@ // along with Unique Network. If not, see . use logtest::Logger; -use crate::{ - runtime_common::tests::xcm::*, - xcm_config::Barrier, -}; +use crate::{runtime_common::tests::xcm::*, xcm_config::Barrier}; const QUARTZ_PARA_ID: u32 = 2095; pub fn quartz_xcm_tests(logger: &mut Logger) { - barrier_denies_transact::(logger); + barrier_denies_transact::(logger); - barrier_denies_transfer_from_unknown_location::( - logger, - QUARTZ_PARA_ID, - ).expect("quartz runtime denies an unknown location"); + barrier_denies_transfer_from_unknown_location::(logger, QUARTZ_PARA_ID) + .expect("quartz runtime denies an unknown location"); } diff --git a/runtime/quartz/src/xcm_config.rs b/runtime/quartz/src/xcm_config.rs index 0592daaff6..e7efba0e40 100644 --- a/runtime/quartz/src/xcm_config.rs +++ b/runtime/quartz/src/xcm_config.rs @@ -14,53 +14,31 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use cumulus_pallet_xcm; use frame_support::{ - {match_types, parameter_types, weights::Weight}, - pallet_prelude::Get, - traits::{Contains, Everything, fungibles}, + {match_types, parameter_types, weights::Weight}, + pallet_prelude::Get, + traits::{Contains, Everything}, }; -use frame_system::EnsureRoot; use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; -use pallet_xcm::XcmPassthrough; -use polkadot_parachain::primitives::Sibling; -use sp_runtime::traits::{AccountIdConversion, CheckedConversion, Convert, Zero}; -use sp_std::{borrow::Borrow, marker::PhantomData, vec, vec::Vec}; +use sp_runtime::traits::{AccountIdConversion, Convert}; +use sp_std::{vec, vec::Vec}; use xcm::{ - latest::{MultiAsset, Xcm}, - prelude::{Concrete, Fungible as XcmFungible}, - v1::{BodyId, Junction::*, Junctions::*, MultiLocation, NetworkId}, + latest::Xcm, + v1::{BodyId, Junction::*, Junctions::*, MultiLocation, NetworkId}, }; use xcm_builder::{ - AllowKnownQueryResponses, AllowSubscriptionsFrom, - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, - EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter, LocationInverter, ParentAsSuperuser, - ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - ConvertedConcreteAssetId, -}; -use xcm_executor::{ - {Config, XcmExecutor}, - traits::{Convert as ConvertXcm, FilterAssetLocation, JustTry, MatchesFungible}, + AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, + AllowUnpaidExecutionFrom, FixedWeightBounds, LocationInverter, TakeWeightCredit, }; +use xcm_executor::XcmExecutor; -use up_common::{ - constants::{MAXIMUM_BLOCK_WEIGHT, UNIQUE}, - types::{AccountId, Balance}, -}; -use pallet_foreing_assets::{ - AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, - FreeForAll, TryAsForeing, ForeignAssetId, -}; -use crate::{ - Balances, Call, DmpQueue, Event, Origin, ParachainInfo, - ParachainSystem, PolkadotXcm, Runtime, XcmpQueue, -}; +use up_common::types::{AccountId, Balance}; +use pallet_foreing_assets::{AssetIds, CurrencyId, NativeCurrency}; +use crate::{Call, Event, ParachainInfo, PolkadotXcm, Runtime}; use crate::runtime_common::config::substrate::{TreasuryModuleId, MaxLocks, MaxReserves}; use crate::runtime_common::config::pallets::TreasuryAccountId; use crate::runtime_common::config::xcm::*; -use crate::*; -use xcm::opaque::latest::prelude::{ DepositReserveAsset, DepositAsset, TransferAsset, TransferReserveAsset }; +use xcm::opaque::latest::prelude::{DepositReserveAsset, TransferReserveAsset}; // Signed version of balance pub type Amount = i128; @@ -76,103 +54,113 @@ match_types! { }; } +pub type Barrier = DenyThenTry< + (DenyTransact, DenyExchangeWithUnknownLocation), + ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + // Parent and its exec plurality get free execution + AllowUnpaidExecutionFrom, + // Expected responses are OK. + AllowKnownQueryResponses, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), +>; + pub fn get_allowed_locations() -> Vec { - vec![ - // Self location - MultiLocation { parents: 0, interior: Here }, - // Parent location - MultiLocation { parents: 1, interior: Here }, - // Karura/Acala location - MultiLocation { parents: 1, interior: X1(Parachain(2000)) }, - // Moonriver location - MultiLocation { parents: 1, interior: X1(Parachain(2023)) }, - // Self parachain address - MultiLocation { parents: 1, interior: X1(Parachain(ParachainInfo::get().into())) }, - ] + vec![ + // Self location + MultiLocation { + parents: 0, + interior: Here, + }, + // Parent location + MultiLocation { + parents: 1, + interior: Here, + }, + // Karura/Acala location + MultiLocation { + parents: 1, + interior: X1(Parachain(2000)), + }, + // Moonriver location + MultiLocation { + parents: 1, + interior: X1(Parachain(2023)), + }, + // Self parachain address + MultiLocation { + parents: 1, + interior: X1(Parachain(ParachainInfo::get().into())), + }, + ] } // Allow xcm exchange only with locations in list pub struct DenyExchangeWithUnknownLocation; impl TryPass for DenyExchangeWithUnknownLocation { - fn try_pass( - origin: &MultiLocation, - message: &mut Xcm, - ) -> Result<(), ()> { - - // Check if deposit or transfer belongs to allowed parachains - let mut allowed = get_allowed_locations().contains(origin); - - message.0.iter().for_each(|inst| { - match inst { - DepositReserveAsset { dest: dst, .. } => { allowed |= get_allowed_locations().contains(dst); } - TransferReserveAsset { dest: dst, .. } => { allowed |= get_allowed_locations().contains(dst); } - _ => {} - } - }); - - if allowed { - return Ok(()); - } - - log::warn!( + fn try_pass(origin: &MultiLocation, message: &mut Xcm) -> Result<(), ()> { + // Check if deposit or transfer belongs to allowed parachains + let mut allowed = get_allowed_locations().contains(origin); + + message.0.iter().for_each(|inst| match inst { + DepositReserveAsset { dest: dst, .. } => { + allowed |= get_allowed_locations().contains(dst); + } + TransferReserveAsset { dest: dst, .. } => { + allowed |= get_allowed_locations().contains(dst); + } + _ => {} + }); + + if allowed { + return Ok(()); + } + + log::warn!( target: "xcm::barrier", "Unexpected deposit or transfer location" ); - // Deny - Err(()) - } + // Deny + Err(()) + } } -pub type Barrier = DenyThenTry< - ( - DenyTransact, - DenyExchangeWithUnknownLocation, - ), - ( - TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, - // Parent and its exec plurality get free execution - AllowUnpaidExecutionFrom, - // Expected responses are OK. - AllowKnownQueryResponses, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, - ), ->; - impl orml_tokens::Config for Runtime { - type Event = Event; - type Balance = Balance; - type Amount = Amount; - type CurrencyId = CurrencyId; - type WeightInfo = (); - type ExistentialDeposits = ExistentialDeposits; - type OnDust = orml_tokens::TransferDust; - type MaxLocks = MaxLocks; - type MaxReserves = MaxReserves; - // TODO: Add all module accounts - type DustRemovalWhitelist = DustRemovalWhitelist; - /// The id type for named reserves. - type ReserveIdentifier = (); - type OnNewTokenAccount = (); - type OnKilledTokenAccount = (); + type Event = Event; + type Balance = Balance; + type Amount = Amount; + type CurrencyId = CurrencyId; + type WeightInfo = (); + type ExistentialDeposits = ExistentialDeposits; + type OnDust = orml_tokens::TransferDust; + type MaxLocks = MaxLocks; + type MaxReserves = MaxReserves; + // TODO: Add all module accounts + type DustRemovalWhitelist = DustRemovalWhitelist; + /// The id type for named reserves. + type ReserveIdentifier = (); + type OnNewTokenAccount = (); + type OnKilledTokenAccount = (); } impl orml_xtokens::Config for Runtime { - type Event = Event; - type Balance = Balance; - type CurrencyId = CurrencyId; - type CurrencyIdConvert = CurrencyIdConvert; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type SelfLocation = SelfLocation; - type XcmExecutor = XcmExecutor>; - type Weigher = FixedWeightBounds; - type BaseXcmWeight = BaseXcmWeight; - type LocationInverter = LocationInverter; - type MaxAssetsForTransfer = MaxAssetsForTransfer; - type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; - type ReserveProvider = AbsoluteReserveProvider; + type Event = Event; + type Balance = Balance; + type CurrencyId = CurrencyId; + type CurrencyIdConvert = CurrencyIdConvert; + type AccountIdToMultiLocation = AccountIdToMultiLocation; + type SelfLocation = SelfLocation; + type XcmExecutor = XcmExecutor>; + type Weigher = FixedWeightBounds; + type BaseXcmWeight = BaseXcmWeight; + type LocationInverter = LocationInverter; + type MaxAssetsForTransfer = MaxAssetsForTransfer; + type MinXcmFee = ParachainMinFee; + type MultiLocationsFilter = Everything; + type ReserveProvider = AbsoluteReserveProvider; } parameter_type_with_key! { @@ -189,34 +177,28 @@ parameter_type_with_key! { pub struct DustRemovalWhitelist; impl Contains for DustRemovalWhitelist { - fn contains(a: &AccountId) -> bool { - get_all_module_accounts().contains(a) - } + fn contains(a: &AccountId) -> bool { + get_all_module_accounts().contains(a) + } } pub struct CurrencyIdConvert; impl Convert> for CurrencyIdConvert { - fn convert(id: AssetIds) -> Option { - match id { - AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new( - 1, - X1(Parachain(ParachainInfo::get().into())), - )), - AssetIds::NativeAssetId(NativeCurrency::Parent) => Some(MultiLocation::parent()), - AssetIds::ForeignAssetId(_) => None, - } - } + fn convert(id: AssetIds) -> Option { + match id { + AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new( + 1, + X1(Parachain(ParachainInfo::get().into())), + )), + _ => None, + } + } } parameter_types! { pub const BaseXcmWeight: Weight = 100_000_000; // TODO: recheck this pub const MaxAssetsForTransfer: usize = 2; -} -parameter_types! { - pub const RelayLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); } @@ -228,16 +210,16 @@ parameter_type_with_key! { } pub fn get_all_module_accounts() -> Vec { - vec![TreasuryModuleId::get().into_account_truncating()] + vec![TreasuryModuleId::get().into_account_truncating()] } pub struct AccountIdToMultiLocation; impl Convert for AccountIdToMultiLocation { - fn convert(account: AccountId) -> MultiLocation { - X1(AccountId32 { - network: NetworkId::Any, - id: account.into(), - }) - .into() - } + fn convert(account: AccountId) -> MultiLocation { + X1(AccountId32 { + network: NetworkId::Any, + id: account.into(), + }) + .into() + } } diff --git a/runtime/unique/src/tests/logcapture.rs b/runtime/unique/src/tests/logcapture.rs index 399c883ea3..ab7308513c 100644 --- a/runtime/unique/src/tests/logcapture.rs +++ b/runtime/unique/src/tests/logcapture.rs @@ -19,7 +19,7 @@ use super::xcm::unique_xcm_tests; #[test] fn unique_log_capture_tests() { - let mut logger = Logger::start(); - - unique_xcm_tests(&mut logger); + let mut logger = Logger::start(); + + unique_xcm_tests(&mut logger); } diff --git a/runtime/unique/src/tests/mod.rs b/runtime/unique/src/tests/mod.rs index 09df4a7f65..587524b3c9 100644 --- a/runtime/unique/src/tests/mod.rs +++ b/runtime/unique/src/tests/mod.rs @@ -14,5 +14,5 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -mod xcm; mod logcapture; +mod xcm; diff --git a/runtime/unique/src/tests/xcm.rs b/runtime/unique/src/tests/xcm.rs index 58affddc0f..297ca92d04 100644 --- a/runtime/unique/src/tests/xcm.rs +++ b/runtime/unique/src/tests/xcm.rs @@ -15,18 +15,13 @@ // along with Unique Network. If not, see . use logtest::Logger; -use crate::{ - runtime_common::tests::xcm::*, - xcm_config::Barrier, -}; +use crate::{runtime_common::tests::xcm::*, xcm_config::Barrier}; const UNIQUE_PARA_ID: u32 = 2037; pub fn unique_xcm_tests(logger: &mut Logger) { - barrier_denies_transact::(logger); + barrier_denies_transact::(logger); - barrier_denies_transfer_from_unknown_location::( - logger, - UNIQUE_PARA_ID, - ).expect("unique runtime denies an unknown location"); + barrier_denies_transfer_from_unknown_location::(logger, UNIQUE_PARA_ID) + .expect("unique runtime denies an unknown location"); } diff --git a/runtime/unique/src/xcm_config.rs b/runtime/unique/src/xcm_config.rs index 892b8c8c97..34e6b22aab 100644 --- a/runtime/unique/src/xcm_config.rs +++ b/runtime/unique/src/xcm_config.rs @@ -14,143 +14,153 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use cumulus_pallet_xcm; use frame_support::{ - {match_types, parameter_types, weights::Weight}, - pallet_prelude::Get, - traits::{Contains, Everything, fungibles}, + {match_types, parameter_types, weights::Weight}, + pallet_prelude::Get, + traits::{Contains, Everything}, }; -use frame_system::EnsureRoot; use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; -use pallet_xcm::XcmPassthrough; -use polkadot_parachain::primitives::Sibling; -use sp_runtime::traits::{AccountIdConversion, CheckedConversion, Convert, Zero}; -use sp_std::{borrow::Borrow, marker::PhantomData, vec, vec::Vec}; +use sp_runtime::traits::{AccountIdConversion, Convert}; +use sp_std::{vec, vec::Vec}; use xcm::{ - latest::{MultiAsset, Xcm}, - prelude::{Concrete, Fungible as XcmFungible}, - v1::{BodyId, Junction::*, Junctions::*, MultiLocation, NetworkId}, + latest::Xcm, + v1::{BodyId, Junction::*, Junctions::*, MultiLocation, NetworkId}, }; use xcm_builder::{ - AllowKnownQueryResponses, AllowSubscriptionsFrom, - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, - EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter, LocationInverter, ParentAsSuperuser, - ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - ConvertedConcreteAssetId, -}; -use xcm_executor::{ - {Config, XcmExecutor}, - traits::{Convert as ConvertXcm, FilterAssetLocation, JustTry, MatchesFungible}, + AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, + AllowUnpaidExecutionFrom, FixedWeightBounds, LocationInverter, TakeWeightCredit, }; +use xcm_executor::XcmExecutor; -use up_common::{ - constants::{MAXIMUM_BLOCK_WEIGHT, UNIQUE}, - types::{AccountId, Balance}, -}; -use pallet_foreing_assets::{ - AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, - FreeForAll, TryAsForeing, ForeignAssetId, -}; -use crate::{ - Balances, Call, DmpQueue, Event, Origin, ParachainInfo, - ParachainSystem, PolkadotXcm, Runtime, XcmpQueue, -}; +use up_common::types::{AccountId, Balance}; +use pallet_foreing_assets::{AssetIds, CurrencyId, NativeCurrency}; +use crate::{Call, Event, ParachainInfo, PolkadotXcm, Runtime}; use crate::runtime_common::config::substrate::{TreasuryModuleId, MaxLocks, MaxReserves}; use crate::runtime_common::config::pallets::TreasuryAccountId; use crate::runtime_common::config::xcm::*; -use crate::*; -use xcm::opaque::latest::prelude::{ DepositReserveAsset, DepositAsset, TransferAsset, TransferReserveAsset }; +use xcm::opaque::latest::prelude::{DepositReserveAsset, TransferReserveAsset}; // Signed version of balance pub type Amount = i128; +match_types! { + pub type ParentOrParentsExecutivePlurality: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } + }; + pub type ParentOrSiblings: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(_) } + }; +} pub type Barrier = DenyThenTry< - ( - DenyTransact, - DenyExchangeWithUnknownLocation, - ), - ( - TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, - // Parent and its exec plurality get free execution - AllowUnpaidExecutionFrom, - // Expected responses are OK. - AllowKnownQueryResponses, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, - ), + (DenyTransact, DenyExchangeWithUnknownLocation), + ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + // Parent and its exec plurality get free execution + AllowUnpaidExecutionFrom, + // Expected responses are OK. + AllowKnownQueryResponses, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), >; pub fn get_allowed_locations() -> Vec { - vec![ - // Self location - MultiLocation { parents: 0, interior: Here }, - // Parent location - MultiLocation { parents: 1, interior: Here }, - // Karura/Acala location - MultiLocation { parents: 1, interior: X1(Parachain(2000)) }, - // Moonbeam location - MultiLocation { parents: 1, interior: X1(Parachain(2004)) }, - // Self parachain address - MultiLocation { parents: 1, interior: X1(Parachain(ParachainInfo::get().into())) }, - ] + vec![ + // Self location + MultiLocation { + parents: 0, + interior: Here, + }, + // Parent location + MultiLocation { + parents: 1, + interior: Here, + }, + // Karura/Acala location + MultiLocation { + parents: 1, + interior: X1(Parachain(2000)), + }, + // Moonbeam location + MultiLocation { + parents: 1, + interior: X1(Parachain(2004)), + }, + // Self parachain address + MultiLocation { + parents: 1, + interior: X1(Parachain(ParachainInfo::get().into())), + }, + ] } // Allow xcm exchange only with locations in list pub struct DenyExchangeWithUnknownLocation; impl TryPass for DenyExchangeWithUnknownLocation { - fn try_pass( - origin: &MultiLocation, - message: &mut Xcm, - ) -> Result<(), ()> { - - // Check if deposit or transfer belongs to allowed parachains - let mut allowed = get_allowed_locations().contains(origin); - - message.0.iter().for_each(|inst| { - match inst { - DepositReserveAsset { dest: dst, .. } => { allowed |= get_allowed_locations().contains(dst); } - TransferReserveAsset { dest: dst, .. } => { allowed |= get_allowed_locations().contains(dst); } - _ => {} - } - }); - - if allowed { - return Ok(()); - } - - log::warn!( + fn try_pass(origin: &MultiLocation, message: &mut Xcm) -> Result<(), ()> { + // Check if deposit or transfer belongs to allowed parachains + let mut allowed = get_allowed_locations().contains(origin); + + message.0.iter().for_each(|inst| match inst { + DepositReserveAsset { dest: dst, .. } => { + allowed |= get_allowed_locations().contains(dst); + } + TransferReserveAsset { dest: dst, .. } => { + allowed |= get_allowed_locations().contains(dst); + } + _ => {} + }); + + if allowed { + return Ok(()); + } + + log::warn!( target: "xcm::barrier", "Unexpected deposit or transfer location" ); - // Deny - Err(()) - } -} - - -match_types! { - pub type ParentOrParentsExecutivePlurality: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } - }; - pub type ParentOrSiblings: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(_) } - }; + // Deny + Err(()) + } } -pub fn get_all_module_accounts() -> Vec { - vec![TreasuryModuleId::get().into_account_truncating()] +impl orml_tokens::Config for Runtime { + type Event = Event; + type Balance = Balance; + type Amount = Amount; + type CurrencyId = CurrencyId; + type WeightInfo = (); + type ExistentialDeposits = ExistentialDeposits; + type OnDust = orml_tokens::TransferDust; + type MaxLocks = MaxLocks; + type MaxReserves = MaxReserves; + // TODO: Add all module accounts + type DustRemovalWhitelist = DustRemovalWhitelist; + /// The id type for named reserves. + type ReserveIdentifier = (); + type OnNewTokenAccount = (); + type OnKilledTokenAccount = (); } -pub struct DustRemovalWhitelist; -impl Contains for DustRemovalWhitelist { - fn contains(a: &AccountId) -> bool { - get_all_module_accounts().contains(a) - } +impl orml_xtokens::Config for Runtime { + type Event = Event; + type Balance = Balance; + type CurrencyId = CurrencyId; + type CurrencyIdConvert = CurrencyIdConvert; + type AccountIdToMultiLocation = AccountIdToMultiLocation; + type SelfLocation = SelfLocation; + type XcmExecutor = XcmExecutor>; + type Weigher = FixedWeightBounds; + type BaseXcmWeight = BaseXcmWeight; + type LocationInverter = LocationInverter; + type MaxAssetsForTransfer = MaxAssetsForTransfer; + type MinXcmFee = ParachainMinFee; + type MultiLocationsFilter = Everything; + type ReserveProvider = AbsoluteReserveProvider; } parameter_type_with_key! { @@ -165,60 +175,32 @@ parameter_type_with_key! { }; } -impl orml_tokens::Config for Runtime { - type Event = Event; - type Balance = Balance; - type Amount = Amount; - type CurrencyId = CurrencyId; - type WeightInfo = (); - type ExistentialDeposits = ExistentialDeposits; - type OnDust = orml_tokens::TransferDust; - type MaxLocks = MaxLocks; - type MaxReserves = MaxReserves; - // TODO: Add all module accounts - type DustRemovalWhitelist = DustRemovalWhitelist; - /// The id type for named reserves. - type ReserveIdentifier = (); - type OnNewTokenAccount = (); - type OnKilledTokenAccount = (); -} - -impl orml_xtokens::Config for Runtime { - type Event = Event; - type Balance = Balance; - type CurrencyId = CurrencyId; - type CurrencyIdConvert = CurrencyIdConvert; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type SelfLocation = SelfLocation; - type XcmExecutor = XcmExecutor>; - type Weigher = FixedWeightBounds; - type BaseXcmWeight = BaseXcmWeight; - type LocationInverter = LocationInverter; - type MaxAssetsForTransfer = MaxAssetsForTransfer; - type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; - type ReserveProvider = AbsoluteReserveProvider; +pub struct DustRemovalWhitelist; +impl Contains for DustRemovalWhitelist { + fn contains(a: &AccountId) -> bool { + get_all_module_accounts().contains(a) + } } pub struct CurrencyIdConvert; impl Convert> for CurrencyIdConvert { - fn convert(id: AssetIds) -> Option { - match id { - AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new( - 1, - X1(Parachain(ParachainInfo::get().into())), - )), - _ => None, - } - } + fn convert(id: AssetIds) -> Option { + match id { + AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new( + 1, + X1(Parachain(ParachainInfo::get().into())), + )), + _ => None, + } + } } parameter_types! { pub const BaseXcmWeight: Weight = 100_000_000; // TODO: recheck this pub const MaxAssetsForTransfer: usize = 2; - pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); - pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); + pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); + pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); } parameter_type_with_key! { @@ -227,14 +209,17 @@ parameter_type_with_key! { }; } +pub fn get_all_module_accounts() -> Vec { + vec![TreasuryModuleId::get().into_account_truncating()] +} pub struct AccountIdToMultiLocation; impl Convert for AccountIdToMultiLocation { - fn convert(account: AccountId) -> MultiLocation { - X1(AccountId32 { - network: NetworkId::Any, - id: account.into(), - }) - .into() - } + fn convert(account: AccountId) -> MultiLocation { + X1(AccountId32 { + network: NetworkId::Any, + id: account.into(), + }) + .into() + } } From 568279d1cd8f0c76909e226ea0ef866fe1e1fb9b Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 6 Sep 2022 12:41:08 +0000 Subject: [PATCH 0749/1274] refactor: move common xcm parts to common --- runtime/common/config/orml.rs | 107 +++++++++++- runtime/common/config/xcm/foreignassets.rs | 42 ++++- runtime/common/config/xcm/mod.rs | 65 +++++-- runtime/common/config/xcm/nativeassets.rs | 16 +- runtime/opal/src/xcm_config.rs | 154 +---------------- runtime/quartz/src/xcm_config.rs | 190 +++------------------ runtime/unique/src/xcm_config.rs | 190 +++------------------ 7 files changed, 271 insertions(+), 493 deletions(-) diff --git a/runtime/common/config/orml.rs b/runtime/common/config/orml.rs index e8babbd39f..d5bd4f569b 100644 --- a/runtime/common/config/orml.rs +++ b/runtime/common/config/orml.rs @@ -14,17 +14,85 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use frame_support::parameter_types; +use frame_support::{ + parameter_types, + traits::{Contains, Everything}, + weights::Weight, +}; use frame_system::EnsureSigned; -use crate::{Runtime, Event, RelayChainBlockNumberProvider}; +use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; +use sp_runtime::traits::Convert; +use xcm::v1::{Junction::*, Junctions::*, MultiLocation, NetworkId}; +use xcm_builder::LocationInverter; +use xcm_executor::XcmExecutor; +use sp_std::{vec, vec::Vec}; +use pallet_foreing_assets::{CurrencyId, NativeCurrency}; +use crate::{ + Runtime, Event, RelayChainBlockNumberProvider, + runtime_common::config::{ + xcm::{ + SelfLocation, Weigher, XcmConfig, Ancestry, + xcm_assets::{CurrencyIdConvert}, + }, + pallets::TreasuryAccountId, + substrate::{MaxLocks, MaxReserves}, + }, +}; + use up_common::{ types::{AccountId, Balance}, constants::*, }; +// Signed version of balance +pub type Amount = i128; + parameter_types! { pub const MinVestedTransfer: Balance = 10 * UNIQUE; pub const MaxVestingSchedules: u32 = 28; + + pub const BaseXcmWeight: Weight = 100_000_000; // TODO: recheck this + pub const MaxAssetsForTransfer: usize = 2; +} + +parameter_type_with_key! { + pub ParachainMinFee: |_location: MultiLocation| -> Option { + Some(100_000_000_000) + }; +} + +parameter_type_with_key! { + pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { + match currency_id { + CurrencyId::NativeAssetId(symbol) => match symbol { + NativeCurrency::Here => 0, + NativeCurrency::Parent=> 0, + }, + _ => 100_000 + } + }; +} + +pub fn get_all_module_accounts() -> Vec { + vec![TreasuryAccountId::get()] +} + +pub struct DustRemovalWhitelist; +impl Contains for DustRemovalWhitelist { + fn contains(a: &AccountId) -> bool { + get_all_module_accounts().contains(a) + } +} + +pub struct AccountIdToMultiLocation; +impl Convert for AccountIdToMultiLocation { + fn convert(account: AccountId) -> MultiLocation { + X1(AccountId32 { + network: NetworkId::Any, + id: account.into(), + }) + .into() + } } impl orml_vesting::Config for Runtime { @@ -36,3 +104,38 @@ impl orml_vesting::Config for Runtime { type MaxVestingSchedules = MaxVestingSchedules; type BlockNumberProvider = RelayChainBlockNumberProvider; } + +impl orml_tokens::Config for Runtime { + type Event = Event; + type Balance = Balance; + type Amount = Amount; + type CurrencyId = CurrencyId; + type WeightInfo = (); + type ExistentialDeposits = ExistentialDeposits; + type OnDust = orml_tokens::TransferDust; + type MaxLocks = MaxLocks; + type MaxReserves = MaxReserves; + // TODO: Add all module accounts + type DustRemovalWhitelist = DustRemovalWhitelist; + /// The id type for named reserves. + type ReserveIdentifier = (); + type OnNewTokenAccount = (); + type OnKilledTokenAccount = (); +} + +impl orml_xtokens::Config for Runtime { + type Event = Event; + type Balance = Balance; + type CurrencyId = CurrencyId; + type CurrencyIdConvert = CurrencyIdConvert; + type AccountIdToMultiLocation = AccountIdToMultiLocation; + type SelfLocation = SelfLocation; + type XcmExecutor = XcmExecutor>; + type Weigher = Weigher; + type BaseXcmWeight = BaseXcmWeight; + type LocationInverter = LocationInverter; + type MaxAssetsForTransfer = MaxAssetsForTransfer; + type MinXcmFee = ParachainMinFee; + type MultiLocationsFilter = Everything; + type ReserveProvider = AbsoluteReserveProvider; +} diff --git a/runtime/common/config/xcm/foreignassets.rs b/runtime/common/config/xcm/foreignassets.rs index 586e023791..246e55e001 100644 --- a/runtime/common/config/xcm/foreignassets.rs +++ b/runtime/common/config/xcm/foreignassets.rs @@ -18,14 +18,14 @@ use frame_support::{ traits::{Contains, Get, fungibles}, parameter_types, }; -use sp_runtime::traits::Zero; +use sp_runtime::traits::{Zero, Convert}; use xcm::v1::{Junction::*, MultiLocation, Junctions::*}; use xcm::latest::MultiAsset; use xcm_builder::{FungiblesAdapter, ConvertedConcreteAssetId}; use xcm_executor::traits::{Convert as ConvertXcm, JustTry, FilterAssetLocation}; use pallet_foreing_assets::{ AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, NativeCurrency, FreeForAll, TryAsForeing, - ForeignAssetId, + ForeignAssetId, CurrencyId, }; use sp_std::{borrow::Borrow, marker::PhantomData}; use crate::{Runtime, Balances, ParachainInfo, PolkadotXcm, ForeingAssets}; @@ -158,3 +158,41 @@ pub type Trader = FreeForAll< Balances, (), >; + +pub struct CurrencyIdConvert; +impl Convert> for CurrencyIdConvert { + fn convert(id: AssetIds) -> Option { + match id { + AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new( + 1, + X1(Parachain(ParachainInfo::get().into())), + )), + AssetIds::NativeAssetId(NativeCurrency::Parent) => Some(MultiLocation::parent()), + AssetIds::ForeignAssetId(foreign_asset_id) => { + XcmForeignAssetIdMapping::::get_multi_location(foreign_asset_id) + } + } + } +} + +impl Convert> for CurrencyIdConvert { + fn convert(location: MultiLocation) -> Option { + if location == MultiLocation::here() + || location == MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))) + { + return Some(AssetIds::NativeAssetId(NativeCurrency::Here)); + } + + if location == MultiLocation::parent() { + return Some(AssetIds::NativeAssetId(NativeCurrency::Parent)); + } + + if let Some(currency_id) = + XcmForeignAssetIdMapping::::get_currency_id(location.clone()) + { + return Some(currency_id); + } + + None + } +} diff --git a/runtime/common/config/xcm/mod.rs b/runtime/common/config/xcm/mod.rs index aa8de7b685..628b02c234 100644 --- a/runtime/common/config/xcm/mod.rs +++ b/runtime/common/config/xcm/mod.rs @@ -14,19 +14,23 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use frame_support::{traits::Everything, weights::Weight, parameter_types}; +use frame_support::{ + traits::{Everything, Get}, + weights::Weight, + parameter_types, +}; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; use xcm::v1::{Junction::*, MultiLocation, NetworkId}; -use xcm::latest::{Instruction, Xcm}; +use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, EnsureXcmOrigin, FixedWeightBounds, LocationInverter, ParentAsSuperuser, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, ParentIsPreset, }; use xcm_executor::{Config, XcmExecutor, traits::ShouldExecute}; -use sp_std::marker::PhantomData; +use sp_std::{marker::PhantomData, vec::Vec}; use crate::{ Runtime, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue, xcm_config::Barrier, @@ -35,16 +39,16 @@ use crate::{ use up_common::types::AccountId; #[cfg(feature = "foreign-assets")] -mod foreignassets; +pub mod foreignassets; #[cfg(not(feature = "foreign-assets"))] -mod nativeassets; +pub mod nativeassets; #[cfg(feature = "foreign-assets")] -use foreignassets as xcm_assets; +pub use foreignassets as xcm_assets; #[cfg(not(feature = "foreign-assets"))] -use nativeassets as xcm_assets; +pub use nativeassets as xcm_assets; use xcm_assets::{AssetTransactors, IsReserve, Trader}; @@ -53,6 +57,11 @@ parameter_types! { pub const RelayNetwork: NetworkId = NetworkId::Polkadot; pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); + pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); + + // One XCM operation is 1_000_000 weight - almost certainly a conservative estimate. + pub UnitWeightCost: Weight = 1_000_000; + pub const MaxInstructions: u32 = 100; } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used @@ -103,12 +112,6 @@ pub type XcmOriginToTransactDispatchOrigin = ( XcmPassthrough, ); -parameter_types! { - // One XCM operation is 1_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000; - pub const MaxInstructions: u32 = 100; -} - pub trait TryPass { fn try_pass(origin: &MultiLocation, message: &mut Xcm) -> Result<(), ()>; } @@ -169,6 +172,40 @@ where } } +// Allow xcm exchange only with locations in list +pub struct DenyExchangeWithUnknownLocation(PhantomData); +impl>> TryPass for DenyExchangeWithUnknownLocation { + fn try_pass(origin: &MultiLocation, message: &mut Xcm) -> Result<(), ()> { + let allowed_locations = T::get(); + + // Check if deposit or transfer belongs to allowed parachains + let mut allowed = allowed_locations.contains(origin); + + message.0.iter().for_each(|inst| match inst { + DepositReserveAsset { dest: dst, .. } => { + allowed |= allowed_locations.contains(dst); + } + TransferReserveAsset { dest: dst, .. } => { + allowed |= allowed_locations.contains(dst); + } + _ => {} + }); + + if allowed { + return Ok(()); + } + + log::warn!( + target: "xcm::barrier", + "Unexpected deposit or transfer location" + ); + // Deny + Err(()) + } +} + +pub type Weigher = FixedWeightBounds; + pub struct XcmConfig(PhantomData); impl Config for XcmConfig where @@ -183,7 +220,7 @@ where type IsTeleporter = (); // Teleportation is disabled type LocationInverter = LocationInverter; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = Weigher; type Trader = Trader; type ResponseHandler = (); // Don't handle responses for now. type SubscriptionService = PolkadotXcm; diff --git a/runtime/common/config/xcm/nativeassets.rs b/runtime/common/config/xcm/nativeassets.rs index c5d5a44a28..94ec034e2e 100644 --- a/runtime/common/config/xcm/nativeassets.rs +++ b/runtime/common/config/xcm/nativeassets.rs @@ -18,7 +18,7 @@ use frame_support::{ traits::{tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Get}, weights::{Weight, WeightToFeePolynomial}, }; -use sp_runtime::traits::{CheckedConversion, Zero}; +use sp_runtime::traits::{CheckedConversion, Zero, Convert}; use xcm::v1::{Junction::*, MultiLocation, Junctions::*}; use xcm::latest::{ AssetId::{Concrete}, @@ -30,6 +30,7 @@ use xcm_executor::{ Assets, traits::{MatchesFungible, WeightTrader}, }; +use pallet_foreing_assets::{AssetIds, NativeCurrency}; use sp_std::marker::PhantomData; use crate::{Balances, ParachainInfo}; use super::{LocationToAccountId, RelayLocation}; @@ -127,3 +128,16 @@ pub type Trader = UsingOnlySelfCurrencyComponents< Balances, (), >; + +pub struct CurrencyIdConvert; +impl Convert> for CurrencyIdConvert { + fn convert(id: AssetIds) -> Option { + match id { + AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new( + 1, + X1(Parachain(ParachainInfo::get().into())), + )), + _ => None, + } + } +} diff --git a/runtime/opal/src/xcm_config.rs b/runtime/opal/src/xcm_config.rs index a087f0a23d..56eff3adfc 100644 --- a/runtime/opal/src/xcm_config.rs +++ b/runtime/opal/src/xcm_config.rs @@ -15,39 +15,17 @@ // along with Unique Network. If not, see . use frame_support::{ - {match_types, parameter_types, weights::Weight}, - pallet_prelude::Get, - traits::{Contains, Everything}, + {match_types, weights::Weight}, + traits::Everything, }; -use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; -use sp_runtime::traits::{AccountIdConversion, Convert}; -use sp_std::{vec, vec::Vec}; use xcm::{ latest::Xcm, - v1::{BodyId, Junction::*, Junctions::*, MultiLocation, NetworkId}, -}; -use xcm_builder::{ - AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, FixedWeightBounds, LocationInverter, - TakeWeightCredit, -}; -use xcm_executor::{XcmExecutor, traits::ShouldExecute}; - -use up_common::types::{AccountId, Balance}; -use crate::{ - Call, Event, ParachainInfo, Runtime, - runtime_common::config::{ - substrate::{TreasuryModuleId, MaxLocks, MaxReserves}, - pallets::TreasuryAccountId, - xcm::*, - }, -}; - -use pallet_foreing_assets::{ - AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency, + v1::{BodyId, Junction::*, Junctions::*, MultiLocation}, }; +use xcm_builder::{AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, TakeWeightCredit}; +use xcm_executor::traits::ShouldExecute; -// Signed version of balance -pub type Amount = i128; +use crate::runtime_common::config::xcm::{DenyThenTry, DenyTransact}; match_types! { pub type ParentOrParentsUnitPlurality: impl Contains = { @@ -83,123 +61,3 @@ pub type Barrier = DenyThenTry< AllowAllDebug, ), >; - -impl Convert> for CurrencyIdConvert { - fn convert(location: MultiLocation) -> Option { - if location == MultiLocation::here() - || location == MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))) - { - return Some(AssetIds::NativeAssetId(NativeCurrency::Here)); - } - - if location == MultiLocation::parent() { - return Some(AssetIds::NativeAssetId(NativeCurrency::Parent)); - } - - if let Some(currency_id) = - XcmForeignAssetIdMapping::::get_currency_id(location.clone()) - { - return Some(currency_id); - } - - None - } -} - -impl orml_tokens::Config for Runtime { - type Event = Event; - type Balance = Balance; - type Amount = Amount; - type CurrencyId = CurrencyId; - type WeightInfo = (); - type ExistentialDeposits = ExistentialDeposits; - type OnDust = orml_tokens::TransferDust; - type MaxLocks = MaxLocks; - type MaxReserves = MaxReserves; - // TODO: Add all module accounts - type DustRemovalWhitelist = DustRemovalWhitelist; - /// The id type for named reserves. - type ReserveIdentifier = (); - type OnNewTokenAccount = (); - type OnKilledTokenAccount = (); -} - -impl orml_xtokens::Config for Runtime { - type Event = Event; - type Balance = Balance; - type CurrencyId = CurrencyId; - type CurrencyIdConvert = CurrencyIdConvert; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type SelfLocation = SelfLocation; - type XcmExecutor = XcmExecutor>; - type Weigher = FixedWeightBounds; - type BaseXcmWeight = BaseXcmWeight; - type LocationInverter = LocationInverter; - type MaxAssetsForTransfer = MaxAssetsForTransfer; - type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; - type ReserveProvider = AbsoluteReserveProvider; -} - -parameter_type_with_key! { - pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { - match currency_id { - CurrencyId::NativeAssetId(symbol) => match symbol { - NativeCurrency::Here => 0, - NativeCurrency::Parent=> 0, - }, - _ => 100_000 - } - }; -} - -pub struct DustRemovalWhitelist; -impl Contains for DustRemovalWhitelist { - fn contains(a: &AccountId) -> bool { - get_all_module_accounts().contains(a) - } -} - -pub struct CurrencyIdConvert; -impl Convert> for CurrencyIdConvert { - fn convert(id: AssetIds) -> Option { - match id { - AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new( - 1, - X1(Parachain(ParachainInfo::get().into())), - )), - AssetIds::NativeAssetId(NativeCurrency::Parent) => Some(MultiLocation::parent()), - AssetIds::ForeignAssetId(foreign_asset_id) => { - XcmForeignAssetIdMapping::::get_multi_location(foreign_asset_id) - } - } - } -} - -parameter_types! { - pub const BaseXcmWeight: Weight = 100_000_000; // TODO: recheck this - pub const MaxAssetsForTransfer: usize = 2; - - pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); - pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); -} - -parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { - Some(100_000_000_000) - }; -} - -pub fn get_all_module_accounts() -> Vec { - vec![TreasuryModuleId::get().into_account_truncating()] -} -pub struct AccountIdToMultiLocation; -impl Convert for AccountIdToMultiLocation { - fn convert(account: AccountId) -> MultiLocation { - X1(AccountId32 { - network: NetworkId::Any, - id: account.into(), - }) - .into() - } -} diff --git a/runtime/quartz/src/xcm_config.rs b/runtime/quartz/src/xcm_config.rs index e7efba0e40..9b78621ce0 100644 --- a/runtime/quartz/src/xcm_config.rs +++ b/runtime/quartz/src/xcm_config.rs @@ -15,33 +15,20 @@ // along with Unique Network. If not, see . use frame_support::{ - {match_types, parameter_types, weights::Weight}, - pallet_prelude::Get, - traits::{Contains, Everything}, + match_types, parameter_types, + traits::{Everything, Get}, }; -use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; -use sp_runtime::traits::{AccountIdConversion, Convert}; use sp_std::{vec, vec::Vec}; -use xcm::{ - latest::Xcm, - v1::{BodyId, Junction::*, Junctions::*, MultiLocation, NetworkId}, -}; +use xcm::v1::{BodyId, Junction::*, Junctions::*, MultiLocation}; use xcm_builder::{ AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, - AllowUnpaidExecutionFrom, FixedWeightBounds, LocationInverter, TakeWeightCredit, + AllowUnpaidExecutionFrom, TakeWeightCredit, }; -use xcm_executor::XcmExecutor; - -use up_common::types::{AccountId, Balance}; -use pallet_foreing_assets::{AssetIds, CurrencyId, NativeCurrency}; -use crate::{Call, Event, ParachainInfo, PolkadotXcm, Runtime}; -use crate::runtime_common::config::substrate::{TreasuryModuleId, MaxLocks, MaxReserves}; -use crate::runtime_common::config::pallets::TreasuryAccountId; -use crate::runtime_common::config::xcm::*; -use xcm::opaque::latest::prelude::{DepositReserveAsset, TransferReserveAsset}; -// Signed version of balance -pub type Amount = i128; +use crate::{ + ParachainInfo, PolkadotXcm, + runtime_common::config::xcm::{DenyThenTry, DenyTransact, DenyExchangeWithUnknownLocation}, +}; match_types! { pub type ParentOrParentsExecutivePlurality: impl Contains = { @@ -54,22 +41,8 @@ match_types! { }; } -pub type Barrier = DenyThenTry< - (DenyTransact, DenyExchangeWithUnknownLocation), - ( - TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, - // Parent and its exec plurality get free execution - AllowUnpaidExecutionFrom, - // Expected responses are OK. - AllowKnownQueryResponses, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, - ), ->; - -pub fn get_allowed_locations() -> Vec { - vec![ +parameter_types! { + pub QuartzAllowedLocations: Vec = vec![ // Self location MultiLocation { parents: 0, @@ -95,131 +68,22 @@ pub fn get_allowed_locations() -> Vec { parents: 1, interior: X1(Parachain(ParachainInfo::get().into())), }, - ] -} - -// Allow xcm exchange only with locations in list -pub struct DenyExchangeWithUnknownLocation; -impl TryPass for DenyExchangeWithUnknownLocation { - fn try_pass(origin: &MultiLocation, message: &mut Xcm) -> Result<(), ()> { - // Check if deposit or transfer belongs to allowed parachains - let mut allowed = get_allowed_locations().contains(origin); - - message.0.iter().for_each(|inst| match inst { - DepositReserveAsset { dest: dst, .. } => { - allowed |= get_allowed_locations().contains(dst); - } - TransferReserveAsset { dest: dst, .. } => { - allowed |= get_allowed_locations().contains(dst); - } - _ => {} - }); - - if allowed { - return Ok(()); - } - - log::warn!( - target: "xcm::barrier", - "Unexpected deposit or transfer location" - ); - // Deny - Err(()) - } -} - -impl orml_tokens::Config for Runtime { - type Event = Event; - type Balance = Balance; - type Amount = Amount; - type CurrencyId = CurrencyId; - type WeightInfo = (); - type ExistentialDeposits = ExistentialDeposits; - type OnDust = orml_tokens::TransferDust; - type MaxLocks = MaxLocks; - type MaxReserves = MaxReserves; - // TODO: Add all module accounts - type DustRemovalWhitelist = DustRemovalWhitelist; - /// The id type for named reserves. - type ReserveIdentifier = (); - type OnNewTokenAccount = (); - type OnKilledTokenAccount = (); -} - -impl orml_xtokens::Config for Runtime { - type Event = Event; - type Balance = Balance; - type CurrencyId = CurrencyId; - type CurrencyIdConvert = CurrencyIdConvert; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type SelfLocation = SelfLocation; - type XcmExecutor = XcmExecutor>; - type Weigher = FixedWeightBounds; - type BaseXcmWeight = BaseXcmWeight; - type LocationInverter = LocationInverter; - type MaxAssetsForTransfer = MaxAssetsForTransfer; - type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; - type ReserveProvider = AbsoluteReserveProvider; -} - -parameter_type_with_key! { - pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { - match currency_id { - CurrencyId::NativeAssetId(symbol) => match symbol { - NativeCurrency::Here => 0, - NativeCurrency::Parent=> 0, - }, - _ => 100_000 - } - }; + ]; } -pub struct DustRemovalWhitelist; -impl Contains for DustRemovalWhitelist { - fn contains(a: &AccountId) -> bool { - get_all_module_accounts().contains(a) - } -} - -pub struct CurrencyIdConvert; -impl Convert> for CurrencyIdConvert { - fn convert(id: AssetIds) -> Option { - match id { - AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new( - 1, - X1(Parachain(ParachainInfo::get().into())), - )), - _ => None, - } - } -} - -parameter_types! { - pub const BaseXcmWeight: Weight = 100_000_000; // TODO: recheck this - pub const MaxAssetsForTransfer: usize = 2; - - pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); - pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); -} - -parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { - Some(100_000_000) - }; -} - -pub fn get_all_module_accounts() -> Vec { - vec![TreasuryModuleId::get().into_account_truncating()] -} - -pub struct AccountIdToMultiLocation; -impl Convert for AccountIdToMultiLocation { - fn convert(account: AccountId) -> MultiLocation { - X1(AccountId32 { - network: NetworkId::Any, - id: account.into(), - }) - .into() - } -} +pub type Barrier = DenyThenTry< + ( + DenyTransact, + DenyExchangeWithUnknownLocation, + ), + ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + // Parent and its exec plurality get free execution + AllowUnpaidExecutionFrom, + // Expected responses are OK. + AllowKnownQueryResponses, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), +>; diff --git a/runtime/unique/src/xcm_config.rs b/runtime/unique/src/xcm_config.rs index 34e6b22aab..0cef67adcc 100644 --- a/runtime/unique/src/xcm_config.rs +++ b/runtime/unique/src/xcm_config.rs @@ -15,33 +15,20 @@ // along with Unique Network. If not, see . use frame_support::{ - {match_types, parameter_types, weights::Weight}, - pallet_prelude::Get, - traits::{Contains, Everything}, + match_types, parameter_types, + traits::{Everything, Get}, }; -use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; -use sp_runtime::traits::{AccountIdConversion, Convert}; use sp_std::{vec, vec::Vec}; -use xcm::{ - latest::Xcm, - v1::{BodyId, Junction::*, Junctions::*, MultiLocation, NetworkId}, -}; +use xcm::v1::{BodyId, Junction::*, Junctions::*, MultiLocation}; use xcm_builder::{ AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, - AllowUnpaidExecutionFrom, FixedWeightBounds, LocationInverter, TakeWeightCredit, + AllowUnpaidExecutionFrom, TakeWeightCredit, }; -use xcm_executor::XcmExecutor; - -use up_common::types::{AccountId, Balance}; -use pallet_foreing_assets::{AssetIds, CurrencyId, NativeCurrency}; -use crate::{Call, Event, ParachainInfo, PolkadotXcm, Runtime}; -use crate::runtime_common::config::substrate::{TreasuryModuleId, MaxLocks, MaxReserves}; -use crate::runtime_common::config::pallets::TreasuryAccountId; -use crate::runtime_common::config::xcm::*; -use xcm::opaque::latest::prelude::{DepositReserveAsset, TransferReserveAsset}; -// Signed version of balance -pub type Amount = i128; +use crate::{ + ParachainInfo, PolkadotXcm, + runtime_common::config::xcm::{DenyThenTry, DenyTransact, DenyExchangeWithUnknownLocation}, +}; match_types! { pub type ParentOrParentsExecutivePlurality: impl Contains = { @@ -54,22 +41,8 @@ match_types! { }; } -pub type Barrier = DenyThenTry< - (DenyTransact, DenyExchangeWithUnknownLocation), - ( - TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, - // Parent and its exec plurality get free execution - AllowUnpaidExecutionFrom, - // Expected responses are OK. - AllowKnownQueryResponses, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, - ), ->; - -pub fn get_allowed_locations() -> Vec { - vec![ +parameter_types! { + pub UniqueAllowedLocations: Vec = vec![ // Self location MultiLocation { parents: 0, @@ -95,131 +68,22 @@ pub fn get_allowed_locations() -> Vec { parents: 1, interior: X1(Parachain(ParachainInfo::get().into())), }, - ] -} - -// Allow xcm exchange only with locations in list -pub struct DenyExchangeWithUnknownLocation; -impl TryPass for DenyExchangeWithUnknownLocation { - fn try_pass(origin: &MultiLocation, message: &mut Xcm) -> Result<(), ()> { - // Check if deposit or transfer belongs to allowed parachains - let mut allowed = get_allowed_locations().contains(origin); - - message.0.iter().for_each(|inst| match inst { - DepositReserveAsset { dest: dst, .. } => { - allowed |= get_allowed_locations().contains(dst); - } - TransferReserveAsset { dest: dst, .. } => { - allowed |= get_allowed_locations().contains(dst); - } - _ => {} - }); - - if allowed { - return Ok(()); - } - - log::warn!( - target: "xcm::barrier", - "Unexpected deposit or transfer location" - ); - // Deny - Err(()) - } -} - -impl orml_tokens::Config for Runtime { - type Event = Event; - type Balance = Balance; - type Amount = Amount; - type CurrencyId = CurrencyId; - type WeightInfo = (); - type ExistentialDeposits = ExistentialDeposits; - type OnDust = orml_tokens::TransferDust; - type MaxLocks = MaxLocks; - type MaxReserves = MaxReserves; - // TODO: Add all module accounts - type DustRemovalWhitelist = DustRemovalWhitelist; - /// The id type for named reserves. - type ReserveIdentifier = (); - type OnNewTokenAccount = (); - type OnKilledTokenAccount = (); -} - -impl orml_xtokens::Config for Runtime { - type Event = Event; - type Balance = Balance; - type CurrencyId = CurrencyId; - type CurrencyIdConvert = CurrencyIdConvert; - type AccountIdToMultiLocation = AccountIdToMultiLocation; - type SelfLocation = SelfLocation; - type XcmExecutor = XcmExecutor>; - type Weigher = FixedWeightBounds; - type BaseXcmWeight = BaseXcmWeight; - type LocationInverter = LocationInverter; - type MaxAssetsForTransfer = MaxAssetsForTransfer; - type MinXcmFee = ParachainMinFee; - type MultiLocationsFilter = Everything; - type ReserveProvider = AbsoluteReserveProvider; -} - -parameter_type_with_key! { - pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { - match currency_id { - CurrencyId::NativeAssetId(symbol) => match symbol { - NativeCurrency::Here => 0, - NativeCurrency::Parent=> 0, - }, - _ => 100_000 - } - }; + ]; } -pub struct DustRemovalWhitelist; -impl Contains for DustRemovalWhitelist { - fn contains(a: &AccountId) -> bool { - get_all_module_accounts().contains(a) - } -} - -pub struct CurrencyIdConvert; -impl Convert> for CurrencyIdConvert { - fn convert(id: AssetIds) -> Option { - match id { - AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new( - 1, - X1(Parachain(ParachainInfo::get().into())), - )), - _ => None, - } - } -} - -parameter_types! { - pub const BaseXcmWeight: Weight = 100_000_000; // TODO: recheck this - pub const MaxAssetsForTransfer: usize = 2; - - pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); - pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); -} - -parameter_type_with_key! { - pub ParachainMinFee: |_location: MultiLocation| -> Option { - Some(100_000_000) - }; -} - -pub fn get_all_module_accounts() -> Vec { - vec![TreasuryModuleId::get().into_account_truncating()] -} - -pub struct AccountIdToMultiLocation; -impl Convert for AccountIdToMultiLocation { - fn convert(account: AccountId) -> MultiLocation { - X1(AccountId32 { - network: NetworkId::Any, - id: account.into(), - }) - .into() - } -} +pub type Barrier = DenyThenTry< + ( + DenyTransact, + DenyExchangeWithUnknownLocation, + ), + ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + // Parent and its exec plurality get free execution + AllowUnpaidExecutionFrom, + // Expected responses are OK. + AllowKnownQueryResponses, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), +>; From e0c98a46d28ef67ef796194f71a1c8a0dfcfe2c8 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 6 Sep 2022 12:44:30 +0000 Subject: [PATCH 0750/1274] fix(xcm): remove AllowTopLevelPaidExecutionFrom --- runtime/quartz/src/xcm_config.rs | 9 ++------- runtime/unique/src/xcm_config.rs | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/runtime/quartz/src/xcm_config.rs b/runtime/quartz/src/xcm_config.rs index 9b78621ce0..b261b28b8f 100644 --- a/runtime/quartz/src/xcm_config.rs +++ b/runtime/quartz/src/xcm_config.rs @@ -14,15 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use frame_support::{ - match_types, parameter_types, - traits::{Everything, Get}, -}; +use frame_support::{match_types, parameter_types, traits::Get}; use sp_std::{vec, vec::Vec}; use xcm::v1::{BodyId, Junction::*, Junctions::*, MultiLocation}; use xcm_builder::{ - AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, - AllowUnpaidExecutionFrom, TakeWeightCredit, + AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowUnpaidExecutionFrom, TakeWeightCredit, }; use crate::{ @@ -78,7 +74,6 @@ pub type Barrier = DenyThenTry< ), ( TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, // Parent and its exec plurality get free execution AllowUnpaidExecutionFrom, // Expected responses are OK. diff --git a/runtime/unique/src/xcm_config.rs b/runtime/unique/src/xcm_config.rs index 0cef67adcc..cf922796d4 100644 --- a/runtime/unique/src/xcm_config.rs +++ b/runtime/unique/src/xcm_config.rs @@ -14,15 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use frame_support::{ - match_types, parameter_types, - traits::{Everything, Get}, -}; +use frame_support::{match_types, parameter_types, traits::Get}; use sp_std::{vec, vec::Vec}; use xcm::v1::{BodyId, Junction::*, Junctions::*, MultiLocation}; use xcm_builder::{ - AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, - AllowUnpaidExecutionFrom, TakeWeightCredit, + AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowUnpaidExecutionFrom, TakeWeightCredit, }; use crate::{ @@ -78,7 +74,6 @@ pub type Barrier = DenyThenTry< ), ( TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, // Parent and its exec plurality get free execution AllowUnpaidExecutionFrom, // Expected responses are OK. From 64ecfc595eff547d20e956d5744117573e6263f7 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 6 Sep 2022 12:48:22 +0000 Subject: [PATCH 0751/1274] refactor: rename local xcm_config to xcm_barrier --- runtime/common/config/xcm/mod.rs | 2 +- runtime/opal/src/lib.rs | 2 +- runtime/opal/src/tests/xcm.rs | 2 +- runtime/opal/src/{xcm_config.rs => xcm_barrier.rs} | 0 runtime/quartz/src/lib.rs | 2 +- runtime/quartz/src/{xcm_config.rs => xcm_barrier.rs} | 0 runtime/unique/src/lib.rs | 2 +- runtime/unique/src/{xcm_config.rs => xcm_barrier.rs} | 0 8 files changed, 5 insertions(+), 5 deletions(-) rename runtime/opal/src/{xcm_config.rs => xcm_barrier.rs} (100%) rename runtime/quartz/src/{xcm_config.rs => xcm_barrier.rs} (100%) rename runtime/unique/src/{xcm_config.rs => xcm_barrier.rs} (100%) diff --git a/runtime/common/config/xcm/mod.rs b/runtime/common/config/xcm/mod.rs index 628b02c234..a922ef5bbe 100644 --- a/runtime/common/config/xcm/mod.rs +++ b/runtime/common/config/xcm/mod.rs @@ -33,7 +33,7 @@ use xcm_executor::{Config, XcmExecutor, traits::ShouldExecute}; use sp_std::{marker::PhantomData, vec::Vec}; use crate::{ Runtime, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue, - xcm_config::Barrier, + xcm_barrier::Barrier, }; use up_common::types::AccountId; diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 9f1a2bef92..c6d97d1afb 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -35,7 +35,7 @@ use up_common::types::*; #[path = "../../common/mod.rs"] mod runtime_common; -pub mod xcm_config; +pub mod xcm_barrier; #[cfg(test)] mod tests; diff --git a/runtime/opal/src/tests/xcm.rs b/runtime/opal/src/tests/xcm.rs index fd58e50638..39ce4e3fd3 100644 --- a/runtime/opal/src/tests/xcm.rs +++ b/runtime/opal/src/tests/xcm.rs @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . use logtest::Logger; -use crate::{runtime_common::tests::xcm::*, xcm_config::Barrier}; +use crate::{runtime_common::tests::xcm::*, xcm_barrier::Barrier}; const OPAL_PARA_ID: u32 = 2095; // Same as Quartz diff --git a/runtime/opal/src/xcm_config.rs b/runtime/opal/src/xcm_barrier.rs similarity index 100% rename from runtime/opal/src/xcm_config.rs rename to runtime/opal/src/xcm_barrier.rs diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index be3539d679..c3b387260b 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -35,7 +35,7 @@ use up_common::types::*; #[path = "../../common/mod.rs"] mod runtime_common; -pub mod xcm_config; +pub mod xcm_barrier; #[cfg(test)] mod tests; diff --git a/runtime/quartz/src/xcm_config.rs b/runtime/quartz/src/xcm_barrier.rs similarity index 100% rename from runtime/quartz/src/xcm_config.rs rename to runtime/quartz/src/xcm_barrier.rs diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index c4bc4c54e6..101812f11c 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -35,7 +35,7 @@ use up_common::types::*; #[path = "../../common/mod.rs"] mod runtime_common; -pub mod xcm_config; +pub mod xcm_barrier; #[cfg(test)] mod tests; diff --git a/runtime/unique/src/xcm_config.rs b/runtime/unique/src/xcm_barrier.rs similarity index 100% rename from runtime/unique/src/xcm_config.rs rename to runtime/unique/src/xcm_barrier.rs From a6f37fbe53317e8e0d5c0391a65700fabb54a13d Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 6 Sep 2022 12:56:03 +0000 Subject: [PATCH 0752/1274] fix: typo foreing -> foreign --- Cargo.lock | 8 +++--- README.md | 2 +- .../Cargo.toml | 2 +- .../src/impl_fungibles.rs | 20 +++++++------- .../src/lib.rs | 14 +++++----- .../src/weights.rs | 0 runtime/common/config/orml.rs | 2 +- .../common/config/pallets/foreign_asset.rs | 2 +- runtime/common/config/xcm/foreignassets.rs | 26 +++++++++---------- runtime/common/config/xcm/nativeassets.rs | 2 +- runtime/common/construct_runtime/mod.rs | 2 +- runtime/opal/Cargo.toml | 4 +-- runtime/quartz/Cargo.toml | 4 +-- runtime/unique/Cargo.toml | 4 +-- 14 files changed, 46 insertions(+), 46 deletions(-) rename pallets/{foreing-assets => foreign-assets}/Cargo.toml (98%) rename pallets/{foreing-assets => foreign-assets}/src/impl_fungibles.rs (96%) rename pallets/{foreing-assets => foreign-assets}/src/lib.rs (97%) rename pallets/{foreing-assets => foreign-assets}/src/weights.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 547ecbb0d2..28cd7d0ed7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5176,7 +5176,7 @@ dependencies = [ "pallet-evm-contract-helpers", "pallet-evm-migration", "pallet-evm-transaction-payment", - "pallet-foreing-assets", + "pallet-foreign-assets", "pallet-fungible", "pallet-inflation", "pallet-nonfungible", @@ -5846,7 +5846,7 @@ dependencies = [ ] [[package]] -name = "pallet-foreing-assets" +name = "pallet-foreign-assets" version = "0.1.0" dependencies = [ "frame-support", @@ -8496,7 +8496,7 @@ dependencies = [ "pallet-evm-contract-helpers", "pallet-evm-migration", "pallet-evm-transaction-payment", - "pallet-foreing-assets", + "pallet-foreign-assets", "pallet-fungible", "pallet-inflation", "pallet-nonfungible", @@ -12491,7 +12491,7 @@ dependencies = [ "pallet-evm-contract-helpers", "pallet-evm-migration", "pallet-evm-transaction-payment", - "pallet-foreing-assets", + "pallet-foreign-assets", "pallet-fungible", "pallet-inflation", "pallet-nonfungible", diff --git a/README.md b/README.md index 9381de7d6b..8034ea29bd 100644 --- a/README.md +++ b/README.md @@ -195,7 +195,7 @@ tokens -> accounts xtokens -> transfer currencyId: - ForeingAsset + ForeignAsset amount: diff --git a/pallets/foreing-assets/Cargo.toml b/pallets/foreign-assets/Cargo.toml similarity index 98% rename from pallets/foreing-assets/Cargo.toml rename to pallets/foreign-assets/Cargo.toml index 71212dcf40..4a9a0c14fd 100644 --- a/pallets/foreing-assets/Cargo.toml +++ b/pallets/foreign-assets/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "pallet-foreing-assets" +name = "pallet-foreign-assets" version = "0.1.0" license = "GPLv3" edition = "2021" diff --git a/pallets/foreing-assets/src/impl_fungibles.rs b/pallets/foreign-assets/src/impl_fungibles.rs similarity index 96% rename from pallets/foreing-assets/src/impl_fungibles.rs rename to pallets/foreign-assets/src/impl_fungibles.rs index dd7460e19a..8d83863d3f 100644 --- a/pallets/foreing-assets/src/impl_fungibles.rs +++ b/pallets/foreign-assets/src/impl_fungibles.rs @@ -34,7 +34,7 @@ where type Balance = BalanceOf; fn total_issuance(asset: Self::AssetId) -> Self::Balance { - log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible total_issuance"); + log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible total_issuance"); match asset { AssetIds::NativeAssetId(NativeCurrency::Here) => { @@ -88,7 +88,7 @@ where } fn minimum_balance(asset: Self::AssetId) -> Self::Balance { - log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible minimum_balance"); + log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible minimum_balance"); match asset { AssetIds::NativeAssetId(NativeCurrency::Here) => { let parent_amount = as fungible::Inspect< @@ -134,7 +134,7 @@ where } fn balance(asset: Self::AssetId, who: &::AccountId) -> Self::Balance { - log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible balance"); + log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible balance"); match asset { AssetIds::NativeAssetId(NativeCurrency::Here) => { let parent_amount = @@ -193,7 +193,7 @@ where who: &::AccountId, keep_alive: bool, ) -> Self::Balance { - log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible reducible_balance"); + log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible reducible_balance"); match asset { AssetIds::NativeAssetId(NativeCurrency::Here) => { @@ -243,7 +243,7 @@ where amount: Self::Balance, mint: bool, ) -> DepositConsequence { - log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible can_deposit"); + log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible can_deposit"); let value: u128 = match amount.try_into() { Ok(val) => val, @@ -312,7 +312,7 @@ where who: &::AccountId, amount: Self::Balance, ) -> WithdrawConsequence { - log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible can_withdraw"); + log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible can_withdraw"); let value: u128 = match amount.try_into() { Ok(val) => val, Err(_) => return WithdrawConsequence::UnknownAsset, @@ -380,7 +380,7 @@ where amount: Self::Balance, ) -> DispatchResult { //Self::do_mint(asset, who, amount, None) - log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible mint_into {:?}", asset); + log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible mint_into {:?}", asset); let value: u128 = match amount.try_into() { Ok(val) => val, @@ -452,7 +452,7 @@ where amount: Self::Balance, ) -> Result { // let f = DebitFlags { keep_alive: false, best_effort: false }; - log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible burn_from"); + log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible burn_from"); let value: u128 = match amount.try_into() { Ok(val) => val, @@ -525,7 +525,7 @@ where amount: Self::Balance, ) -> Result { // let f = DebitFlags { keep_alive: false, best_effort: true }; - log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible slash"); + log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible slash"); Self::burn_from(asset, who, amount)?; Ok(amount) } @@ -543,7 +543,7 @@ where keep_alive: bool, ) -> Result { // let f = TransferFlags { keep_alive, best_effort: false, burn_dust: false }; - log::trace!(target: "fassets::impl_foreing_assets", "impl_fungible transfer"); + log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible transfer"); let value: u128 = match amount.try_into() { Ok(val) => val, diff --git a/pallets/foreing-assets/src/lib.rs b/pallets/foreign-assets/src/lib.rs similarity index 97% rename from pallets/foreing-assets/src/lib.rs rename to pallets/foreign-assets/src/lib.rs index 8cc5cf9d9d..dfbb519adb 100644 --- a/pallets/foreing-assets/src/lib.rs +++ b/pallets/foreign-assets/src/lib.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -//! # Foreing assets +//! # Foreign assets //! //! - [`Config`] //! - [`Call`] @@ -22,7 +22,7 @@ //! //! ## Overview //! -//! The foreing assests pallet provides functions for: +//! The foreign assests pallet provides functions for: //! //! - Local and foreign assets management. The foreign assets can be updated without runtime upgrade. //! - Bounds between asset and target collection for cross chain transfer and inner transfers. @@ -105,12 +105,12 @@ pub enum AssetIds { NativeAssetId(NativeCurrency), } -pub trait TryAsForeing { - fn try_as_foreing(asset: T) -> Option; +pub trait TryAsForeign { + fn try_as_foreign(asset: T) -> Option; } -impl TryAsForeing for AssetIds { - fn try_as_foreing(asset: AssetIds) -> Option { +impl TryAsForeign for AssetIds { + fn try_as_foreign(asset: AssetIds) -> Option { match asset { AssetIds::ForeignAssetId(id) => Some(id), _ => None, @@ -296,7 +296,7 @@ pub mod module { let md = metadata.clone(); let name: Vec = md.name.into_iter().map(|x| x as u16).collect::>(); - let mut description: Vec = "Foreing assets collection for " + let mut description: Vec = "Foreign assets collection for " .encode_utf16() .collect::>(); description.append(&mut name.clone()); diff --git a/pallets/foreing-assets/src/weights.rs b/pallets/foreign-assets/src/weights.rs similarity index 100% rename from pallets/foreing-assets/src/weights.rs rename to pallets/foreign-assets/src/weights.rs diff --git a/runtime/common/config/orml.rs b/runtime/common/config/orml.rs index d5bd4f569b..8138325eaa 100644 --- a/runtime/common/config/orml.rs +++ b/runtime/common/config/orml.rs @@ -26,7 +26,7 @@ use xcm::v1::{Junction::*, Junctions::*, MultiLocation, NetworkId}; use xcm_builder::LocationInverter; use xcm_executor::XcmExecutor; use sp_std::{vec, vec::Vec}; -use pallet_foreing_assets::{CurrencyId, NativeCurrency}; +use pallet_foreign_assets::{CurrencyId, NativeCurrency}; use crate::{ Runtime, Event, RelayChainBlockNumberProvider, runtime_common::config::{ diff --git a/runtime/common/config/pallets/foreign_asset.rs b/runtime/common/config/pallets/foreign_asset.rs index c333241d17..881f5396da 100644 --- a/runtime/common/config/pallets/foreign_asset.rs +++ b/runtime/common/config/pallets/foreign_asset.rs @@ -1,7 +1,7 @@ use crate::{Runtime, Event, Balances}; use up_common::types::AccountId; -impl pallet_foreing_assets::Config for Runtime { +impl pallet_foreign_assets::Config for Runtime { type Event = Event; type Currency = Balances; type RegisterOrigin = frame_system::EnsureRoot; diff --git a/runtime/common/config/xcm/foreignassets.rs b/runtime/common/config/xcm/foreignassets.rs index 246e55e001..4e6a299a02 100644 --- a/runtime/common/config/xcm/foreignassets.rs +++ b/runtime/common/config/xcm/foreignassets.rs @@ -23,12 +23,12 @@ use xcm::v1::{Junction::*, MultiLocation, Junctions::*}; use xcm::latest::MultiAsset; use xcm_builder::{FungiblesAdapter, ConvertedConcreteAssetId}; use xcm_executor::traits::{Convert as ConvertXcm, JustTry, FilterAssetLocation}; -use pallet_foreing_assets::{ - AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, NativeCurrency, FreeForAll, TryAsForeing, +use pallet_foreign_assets::{ + AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, NativeCurrency, FreeForAll, TryAsForeign, ForeignAssetId, CurrencyId, }; use sp_std::{borrow::Borrow, marker::PhantomData}; -use crate::{Runtime, Balances, ParachainInfo, PolkadotXcm, ForeingAssets}; +use crate::{Runtime, Balances, ParachainInfo, PolkadotXcm, ForeignAssets}; use super::{LocationToAccountId, RelayLocation}; @@ -39,15 +39,15 @@ parameter_types! { } /// Allow checking in assets that have issuance > 0. -pub struct NonZeroIssuance(PhantomData<(AccountId, ForeingAssets)>); +pub struct NonZeroIssuance(PhantomData<(AccountId, ForeignAssets)>); -impl Contains<>::AssetId> - for NonZeroIssuance +impl Contains<>::AssetId> + for NonZeroIssuance where - ForeingAssets: fungibles::Inspect, + ForeignAssets: fungibles::Inspect, { - fn contains(id: &>::AssetId) -> bool { - !ForeingAssets::total_issuance(*id).is_zero() + fn contains(id: &>::AssetId) -> bool { + !ForeignAssets::total_issuance(*id).is_zero() } } @@ -56,7 +56,7 @@ impl> ConvertXcm for AsInnerId where AssetId: Borrow, - AssetId: TryAsForeing, + AssetId: TryAsForeign, AssetIds: Borrow, { fn convert_ref(id: impl Borrow) -> Result { @@ -112,7 +112,7 @@ where )); } - match >::try_as_foreing(asset_id.clone()) { + match >::try_as_foreign(asset_id.clone()) { Some(fid) => match XcmForeignAssetIdMapping::::get_multi_location(fid) { Some(location) => Ok(location), None => Err(()), @@ -125,7 +125,7 @@ where /// Means for transacting assets besides the native currency on this chain. pub type FungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation: - ForeingAssets, + ForeignAssets, // Use this currency when it is a fungible asset matching the given location or name: ConvertedConcreteAssetId, JustTry>, // Convert an XCM MultiLocation into a local account id: @@ -134,7 +134,7 @@ pub type FungiblesTransactor = FungiblesAdapter< AccountId, // We only want to allow teleports of known assets. We use non-zero issuance as an indication // that this asset is known. - NonZeroIssuance, + NonZeroIssuance, // The account to use for tracking teleports. CheckingAccount, >; diff --git a/runtime/common/config/xcm/nativeassets.rs b/runtime/common/config/xcm/nativeassets.rs index 94ec034e2e..d67a464a07 100644 --- a/runtime/common/config/xcm/nativeassets.rs +++ b/runtime/common/config/xcm/nativeassets.rs @@ -30,7 +30,7 @@ use xcm_executor::{ Assets, traits::{MatchesFungible, WeightTrader}, }; -use pallet_foreing_assets::{AssetIds, NativeCurrency}; +use pallet_foreign_assets::{AssetIds, NativeCurrency}; use sp_std::marker::PhantomData; use crate::{Balances, ParachainInfo}; use super::{LocationToAccountId, RelayLocation}; diff --git a/runtime/common/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs index aad968e3a7..c330a402a5 100644 --- a/runtime/common/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -81,7 +81,7 @@ macro_rules! construct_runtime { RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event} = 72, #[runtimes(opal)] - ForeingAssets: pallet_foreing_assets::{Pallet, Call, Storage, Event} = 80, + ForeignAssets: pallet_foreign_assets::{Pallet, Call, Storage, Event} = 80, // Frontier EVM: pallet_evm::{Pallet, Config, Call, Storage, Event} = 100, diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 17d45fd5d3..1bd64324f7 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -123,7 +123,7 @@ std = [ "orml-tokens/std", "orml-xtokens/std", "orml-traits/std", - "pallet-foreing-assets/std" + "pallet-foreign-assets/std" ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] opal-runtime = ['refungible', 'scheduler', 'rmrk', 'foreign-assets'] @@ -460,7 +460,7 @@ fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/fro fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } -pallet-foreing-assets = { default-features = false, path = "../../pallets/foreing-assets" } +pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" } ################################################################################ # Other Dependencies diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 07937755ef..490da10319 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -123,7 +123,7 @@ std = [ "orml-tokens/std", "orml-xtokens/std", "orml-traits/std", - "pallet-foreing-assets/std" + "pallet-foreign-assets/std" ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] quartz-runtime = [] @@ -468,7 +468,7 @@ fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/fro fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } -pallet-foreing-assets = { default-features = false, path = "../../pallets/foreing-assets" } +pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" } ################################################################################ # Other Dependencies diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 626c376581..d52b7a5b7d 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -124,7 +124,7 @@ std = [ "orml-tokens/std", "orml-xtokens/std", "orml-traits/std", - "pallet-foreing-assets/std" + "pallet-foreign-assets/std" ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] unique-runtime = [] @@ -460,7 +460,7 @@ fp-self-contained = { default-features = false, git = "https://github.com/unique fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } -pallet-foreing-assets = { default-features = false, path = "../../pallets/foreing-assets" } +pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" } ################################################################################ # Other Dependencies From 6876d14fc8710ccaf958b1433ce8ac246c40f28f Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 6 Sep 2022 13:04:07 +0000 Subject: [PATCH 0753/1274] chore: regenerate test types --- tests/src/interfaces/augment-api-consts.ts | 16 - tests/src/interfaces/augment-api-errors.ts | 189 ---- tests/src/interfaces/augment-api-events.ts | 104 +- tests/src/interfaces/augment-api-query.ts | 131 +-- tests/src/interfaces/augment-api-tx.ts | 388 +------ tests/src/interfaces/augment-types.ts | 32 +- tests/src/interfaces/default/types.ts | 540 +--------- tests/src/interfaces/lookup.ts | 1098 ++++++-------------- tests/src/interfaces/registry.ts | 32 +- tests/src/interfaces/types-lookup.ts | 1049 +++++-------------- 10 files changed, 645 insertions(+), 2934 deletions(-) diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index a005e0d69e..eebb09af90 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -66,22 +66,6 @@ declare module '@polkadot/api-base/types/consts' { **/ [key: string]: Codec; }; - scheduler: { - /** - * The maximum weight that may be scheduled per block for any dispatchables of less - * priority than `schedule::HARD_DEADLINE`. - **/ - maximumWeight: u64 & AugmentedConst; - /** - * The maximum number of scheduled calls in the queue for a single block. - * Not strictly enforced, but used for weight estimation. - **/ - maxScheduledPerBlock: u32 & AugmentedConst; - /** - * Generic const - **/ - [key: string]: Codec; - }; system: { /** * Maximum number of block number to block hash mappings to keep (oldest pruned first). diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 7380d0aa4f..c099322ec2 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -291,29 +291,6 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; - foreingAssets: { - /** - * AssetId exists - **/ - AssetIdExisted: AugmentedError; - /** - * AssetId not exists - **/ - AssetIdNotExists: AugmentedError; - /** - * The given location could not be used (e.g. because it cannot be expressed in the - * desired version of XCM). - **/ - BadLocation: AugmentedError; - /** - * MultiLocation existed - **/ - MultiLocationExisted: AugmentedError; - /** - * Generic error - **/ - [key: string]: AugmentedError; - }; fungible: { /** * Fungible token does not support nesting. @@ -458,172 +435,6 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; - refungible: { - /** - * Not Refungible item data used to mint in Refungible collection. - **/ - NotRefungibleDataUsedToMintFungibleCollectionToken: AugmentedError; - /** - * Refungible token can't nest other tokens. - **/ - RefungibleDisallowsNesting: AugmentedError; - /** - * Refungible token can't be repartitioned by user who isn't owns all pieces. - **/ - RepartitionWhileNotOwningAllPieces: AugmentedError; - /** - * Setting item properties is not allowed. - **/ - SettingPropertiesNotAllowed: AugmentedError; - /** - * Maximum refungibility exceeded. - **/ - WrongRefungiblePieces: AugmentedError; - /** - * Generic error - **/ - [key: string]: AugmentedError; - }; - rmrkCore: { - /** - * Not the target owner of the sent NFT. - **/ - CannotAcceptNonOwnedNft: AugmentedError; - /** - * Not the target owner of the sent NFT. - **/ - CannotRejectNonOwnedNft: AugmentedError; - /** - * NFT was not sent and is not pending. - **/ - CannotRejectNonPendingNft: AugmentedError; - /** - * If an NFT is sent to a descendant, that would form a nesting loop, an ouroboros. - * Sending to self is redundant. - **/ - CannotSendToDescendentOrSelf: AugmentedError; - /** - * Too many tokens created in the collection, no new ones are allowed. - **/ - CollectionFullOrLocked: AugmentedError; - /** - * Only destroying collections without tokens is allowed. - **/ - CollectionNotEmpty: AugmentedError; - /** - * Collection does not exist, has a wrong type, or does not map to a Unique ID. - **/ - CollectionUnknown: AugmentedError; - /** - * Property of the type of RMRK collection could not be read successfully. - **/ - CorruptedCollectionType: AugmentedError; - /** - * Could not find an ID for a collection. It is likely there were too many collections created on the chain, causing an overflow. - **/ - NoAvailableCollectionId: AugmentedError; - /** - * Token does not exist, or there is no suitable ID for it, likely too many tokens were created in a collection, causing an overflow. - **/ - NoAvailableNftId: AugmentedError; - /** - * Could not find an ID for the resource. It is likely there were too many resources created on an NFT, causing an overflow. - **/ - NoAvailableResourceId: AugmentedError; - /** - * Token is marked as non-transferable, and thus cannot be transferred. - **/ - NonTransferable: AugmentedError; - /** - * No permission to perform action. - **/ - NoPermission: AugmentedError; - /** - * No such resource found. - **/ - ResourceDoesntExist: AugmentedError; - /** - * Resource is not pending for the operation. - **/ - ResourceNotPending: AugmentedError; - /** - * Could not find a property by the supplied key. - **/ - RmrkPropertyIsNotFound: AugmentedError; - /** - * Too many symbols supplied as the property key. The maximum is [256](up_data_structs::MAX_PROPERTY_KEY_LENGTH). - **/ - RmrkPropertyKeyIsTooLong: AugmentedError; - /** - * Too many bytes supplied as the property value. The maximum is [32768](up_data_structs::MAX_PROPERTY_VALUE_LENGTH). - **/ - RmrkPropertyValueIsTooLong: AugmentedError; - /** - * Something went wrong when decoding encoded data from the storage. - * Perhaps, there was a wrong key supplied for the type, or the data was improperly stored. - **/ - UnableToDecodeRmrkData: AugmentedError; - /** - * Generic error - **/ - [key: string]: AugmentedError; - }; - rmrkEquip: { - /** - * Base collection linked to this ID does not exist. - **/ - BaseDoesntExist: AugmentedError; - /** - * No Theme named "default" is associated with the Base. - **/ - NeedsDefaultThemeFirst: AugmentedError; - /** - * Could not find an ID for a Base collection. It is likely there were too many collections created on the chain, causing an overflow. - **/ - NoAvailableBaseId: AugmentedError; - /** - * Could not find a suitable ID for a Part, likely too many Part tokens were created in the Base, causing an overflow - **/ - NoAvailablePartId: AugmentedError; - /** - * Cannot assign equippables to a fixed Part. - **/ - NoEquippableOnFixedPart: AugmentedError; - /** - * Part linked to this ID does not exist. - **/ - PartDoesntExist: AugmentedError; - /** - * No permission to perform action. - **/ - PermissionError: AugmentedError; - /** - * Generic error - **/ - [key: string]: AugmentedError; - }; - scheduler: { - /** - * Failed to schedule a call - **/ - FailedToSchedule: AugmentedError; - /** - * Cannot find the scheduled call. - **/ - NotFound: AugmentedError; - /** - * Reschedule failed because it does not change scheduled time. - **/ - RescheduleNoChange: AugmentedError; - /** - * Given target block number is in the past. - **/ - TargetBlockNumberInPast: AugmentedError; - /** - * Generic error - **/ - [key: string]: AugmentedError; - }; structure: { /** * While nesting, reached the breadth limit of nesting, exceeding the provided budget. diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index b5ab5d9a07..d8ab92fbcf 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -6,10 +6,9 @@ import '@polkadot/api-base/types/events'; import type { ApiTypes, AugmentedEvent } from '@polkadot/api-base/types'; -import type { Bytes, Null, Option, Result, U256, U8aFixed, bool, u128, u32, u64, u8 } from '@polkadot/types-codec'; -import type { ITuple } from '@polkadot/types-codec/types'; +import type { Bytes, Null, Option, Result, U256, U8aFixed, u128, u32, u64, u8 } from '@polkadot/types-codec'; import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime'; -import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetMultiAssets, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; +import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, SpRuntimeDispatchError, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetMultiAssets, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; export type __AugmentedEvent = AugmentedEvent; @@ -208,28 +207,6 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; - foreingAssets: { - /** - * The asset registered. - **/ - AssetRegistered: AugmentedEvent; - /** - * The asset updated. - **/ - AssetUpdated: AugmentedEvent; - /** - * The foreign asset registered. - **/ - ForeignAssetRegistered: AugmentedEvent; - /** - * The foreign asset updated. - **/ - ForeignAssetUpdated: AugmentedEvent; - /** - * Generic event - **/ - [key: string]: AugmentedEvent; - }; parachainSystem: { /** * Downward messages were processed using the given weight. @@ -382,57 +359,6 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; - rmrkCore: { - CollectionCreated: AugmentedEvent; - CollectionDestroyed: AugmentedEvent; - CollectionLocked: AugmentedEvent; - IssuerChanged: AugmentedEvent; - NFTAccepted: AugmentedEvent; - NFTBurned: AugmentedEvent; - NftMinted: AugmentedEvent; - NFTRejected: AugmentedEvent; - NFTSent: AugmentedEvent; - PrioritySet: AugmentedEvent; - PropertySet: AugmentedEvent, key: Bytes, value: Bytes], { collectionId: u32, maybeNftId: Option, key: Bytes, value: Bytes }>; - ResourceAccepted: AugmentedEvent; - ResourceAdded: AugmentedEvent; - ResourceRemoval: AugmentedEvent; - ResourceRemovalAccepted: AugmentedEvent; - /** - * Generic event - **/ - [key: string]: AugmentedEvent; - }; - rmrkEquip: { - BaseCreated: AugmentedEvent; - EquippablesUpdated: AugmentedEvent; - /** - * Generic event - **/ - [key: string]: AugmentedEvent; - }; - scheduler: { - /** - * The call for the provided hash was not found so the task has been aborted. - **/ - CallLookupFailed: AugmentedEvent, id: Option, error: FrameSupportScheduleLookupError], { task: ITuple<[u32, u32]>, id: Option, error: FrameSupportScheduleLookupError }>; - /** - * Canceled some task. - **/ - Canceled: AugmentedEvent; - /** - * Dispatched some task. - **/ - Dispatched: AugmentedEvent, id: Option, result: Result], { task: ITuple<[u32, u32]>, id: Option, result: Result }>; - /** - * Scheduled some task. - **/ - Scheduled: AugmentedEvent; - /** - * Generic event - **/ - [key: string]: AugmentedEvent; - }; structure: { /** * Executed call on behalf of the token. @@ -495,57 +421,57 @@ declare module '@polkadot/api-base/types/events' { /** * A balance was set by root. **/ - BalanceSet: AugmentedEvent; + BalanceSet: AugmentedEvent; /** * Deposited some balance into an account **/ - Deposited: AugmentedEvent; + Deposited: AugmentedEvent; /** * An account was removed whose balance was non-zero but below * ExistentialDeposit, resulting in an outright loss. **/ - DustLost: AugmentedEvent; + DustLost: AugmentedEvent; /** * An account was created with some free balance. **/ - Endowed: AugmentedEvent; + Endowed: AugmentedEvent; /** * Some locked funds were unlocked **/ - LockRemoved: AugmentedEvent; + LockRemoved: AugmentedEvent; /** * Some funds are locked **/ - LockSet: AugmentedEvent; + LockSet: AugmentedEvent; /** * Some balance was reserved (moved from free to reserved). **/ - Reserved: AugmentedEvent; + Reserved: AugmentedEvent; /** * Some reserved balance was repatriated (moved from reserved to * another account). **/ - ReserveRepatriated: AugmentedEvent; + ReserveRepatriated: AugmentedEvent; /** * Some balances were slashed (e.g. due to mis-behavior) **/ - Slashed: AugmentedEvent; + Slashed: AugmentedEvent; /** * The total issuance of an currency has been set **/ - TotalIssuanceSet: AugmentedEvent; + TotalIssuanceSet: AugmentedEvent; /** * Transfer succeeded. **/ - Transfer: AugmentedEvent; + Transfer: AugmentedEvent; /** * Some balance was unreserved (moved from reserved to free). **/ - Unreserved: AugmentedEvent; + Unreserved: AugmentedEvent; /** * Some balances were withdrawn (e.g. pay for transaction fee) **/ - Withdrawn: AugmentedEvent; + Withdrawn: AugmentedEvent; /** * Generic event **/ diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index dfebb7ecd8..782f4f50de 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -6,10 +6,10 @@ import '@polkadot/api-base/types/storage'; import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types'; -import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec'; +import type { BTreeMap, Bytes, Option, U256, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime'; -import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeignAssetsAssetIds, PalletNonfungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild } from '@polkadot/types/lookup'; import type { Observable } from '@polkadot/types/types'; export type __AugmentedQuery = AugmentedQuery unknown>; @@ -267,41 +267,6 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; - foreingAssets: { - /** - * The storages for assets to fungible collection binding - * - **/ - assetBinding: AugmentedQuery Observable>, [u32]> & QueryableStorageEntry; - /** - * The storages for AssetMetadatas. - * - * AssetMetadatas: map AssetIds => Option - **/ - assetMetadatas: AugmentedQuery Observable>, [PalletForeingAssetsAssetIds]> & QueryableStorageEntry; - /** - * The storages for MultiLocations. - * - * ForeignAssetLocations: map ForeignAssetId => Option - **/ - foreignAssetLocations: AugmentedQuery Observable>, [u32]> & QueryableStorageEntry; - /** - * The storages for CurrencyIds. - * - * LocationToCurrencyIds: map MultiLocation => Option - **/ - locationToCurrencyIds: AugmentedQuery Observable>, [XcmV1MultiLocation]> & QueryableStorageEntry; - /** - * Next available Foreign AssetId ID. - * - * NextForeignAssetId: ForeignAssetId - **/ - nextForeignAssetId: AugmentedQuery Observable, []> & QueryableStorageEntry; - /** - * Generic query - **/ - [key: string]: QueryableStorageEntry; - }; fungible: { /** * Storage for assets delegated to a limited extent to other users. @@ -561,90 +526,6 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; - refungible: { - /** - * Amount of tokens (not pieces) partially owned by an account within a collection. - **/ - accountBalance: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; - /** - * Allowance set by a token owner for another user to perform one of certain transactions on a number of pieces of a token. - **/ - allowance: AugmentedQuery Observable, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; - /** - * Amount of token pieces owned by account. - **/ - balance: AugmentedQuery Observable, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; - /** - * Used to enumerate tokens owned by account. - **/ - owned: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]> & QueryableStorageEntry; - /** - * Token data, used to partially describe a token. - **/ - tokenData: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; - /** - * Amount of pieces a refungible token is split into. - **/ - tokenProperties: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; - /** - * Amount of tokens burnt in a collection. - **/ - tokensBurnt: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; - /** - * Total amount of minted tokens in a collection. - **/ - tokensMinted: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; - /** - * Total amount of pieces for token - **/ - totalSupply: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; - /** - * Generic query - **/ - [key: string]: QueryableStorageEntry; - }; - rmrkCore: { - /** - * Latest yet-unused collection ID. - **/ - collectionIndex: AugmentedQuery Observable, []> & QueryableStorageEntry; - /** - * Mapping from RMRK collection ID to Unique's. - **/ - uniqueCollectionId: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; - /** - * Generic query - **/ - [key: string]: QueryableStorageEntry; - }; - rmrkEquip: { - /** - * Checkmark that a Base has a Theme NFT named "default". - **/ - baseHasDefaultTheme: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; - /** - * Map of a Base ID and a Part ID to an NFT in the Base collection serving as the Part. - **/ - inernalPartId: AugmentedQuery Observable>, [u32, u32]> & QueryableStorageEntry; - /** - * Generic query - **/ - [key: string]: QueryableStorageEntry; - }; - scheduler: { - /** - * Items to be executed, indexed by the block number that they should be executed on. - **/ - agenda: AugmentedQuery Observable>>, [u32]> & QueryableStorageEntry; - /** - * Lookup from identity to the block number and index of the task. - **/ - lookup: AugmentedQuery Observable>>, [U8aFixed]> & QueryableStorageEntry; - /** - * Generic query - **/ - [key: string]: QueryableStorageEntry; - }; structure: { /** * Generic query @@ -770,20 +651,20 @@ declare module '@polkadot/api-base/types/storage' { * NOTE: This is only used in the case that this module is used to store * balances. **/ - accounts: AugmentedQuery Observable, [AccountId32, PalletForeingAssetsAssetIds]> & QueryableStorageEntry; + accounts: AugmentedQuery Observable, [AccountId32, PalletForeignAssetsAssetIds]> & QueryableStorageEntry; /** * Any liquidity locks of a token type under an account. * NOTE: Should only be accessed when setting, changing and freeing a lock. **/ - locks: AugmentedQuery Observable>, [AccountId32, PalletForeingAssetsAssetIds]> & QueryableStorageEntry; + locks: AugmentedQuery Observable>, [AccountId32, PalletForeignAssetsAssetIds]> & QueryableStorageEntry; /** * Named reserves on some account balances. **/ - reserves: AugmentedQuery Observable>, [AccountId32, PalletForeingAssetsAssetIds]> & QueryableStorageEntry; + reserves: AugmentedQuery Observable>, [AccountId32, PalletForeignAssetsAssetIds]> & QueryableStorageEntry; /** * The total issuance of a token type. **/ - totalIssuance: AugmentedQuery Observable, [PalletForeingAssetsAssetIds]> & QueryableStorageEntry; + totalIssuance: AugmentedQuery Observable, [PalletForeignAssetsAssetIds]> & QueryableStorageEntry; /** * Generic query **/ diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index d54c667633..63dece89fd 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -6,10 +6,10 @@ import '@polkadot/api-base/types/submittable'; import type { ApiTypes, AugmentedSubmittable, SubmittableExtrinsic, SubmittableExtrinsicFunction } from '@polkadot/api-base/types'; -import type { Bytes, Compact, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; +import type { Bytes, Compact, Option, U256, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec'; import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types'; -import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; -import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, FrameSupportScheduleMaybeHashed, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartEquippableList, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { AccountId32, Call, H160, H256, MultiAddress, Perbill } from '@polkadot/types/interfaces/runtime'; +import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; export type __AugmentedSubmittable = AugmentedSubmittable<() => unknown>; export type __SubmittableExtrinsic = SubmittableExtrinsic; @@ -202,14 +202,6 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; - foreingAssets: { - registerForeignAsset: AugmentedSubmittable<(owner: AccountId32 | string | Uint8Array, location: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, metadata: PalletForeingAssetsModuleAssetMetadata | { name?: any; symbol?: any; decimals?: any; minimalBalance?: any } | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, XcmVersionedMultiLocation, PalletForeingAssetsModuleAssetMetadata]>; - updateForeignAsset: AugmentedSubmittable<(foreignAssetId: u32 | AnyNumber | Uint8Array, location: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, metadata: PalletForeingAssetsModuleAssetMetadata | { name?: any; symbol?: any; decimals?: any; minimalBalance?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, XcmVersionedMultiLocation, PalletForeingAssetsModuleAssetMetadata]>; - /** - * Generic tx - **/ - [key: string]: SubmittableExtrinsicFunction; - }; inflation: { /** * This method sets the inflation start date. Can be only called once. @@ -383,364 +375,6 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; - rmrkCore: { - /** - * Accept an NFT sent from another account to self or an owned NFT. - * - * The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first. - * - * # Permissions: - * - Token-owner-to-be - * - * # Arguments: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: RMRK collection ID of the NFT to be accepted. - * - `rmrk_nft_id`: ID of the NFT to be accepted. - * - `new_owner`: Either the sender's account ID or a sender-owned NFT, - * whichever the accepted NFT was sent to. - **/ - acceptNft: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple | { AccountId: any } | { CollectionAndNftTuple: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsNftAccountIdOrCollectionNftTuple]>; - /** - * Accept the addition of a newly created pending resource to an existing NFT. - * - * This transaction is needed when a resource is created and assigned to an NFT - * by a non-owner, i.e. the collection issuer, with one of the - * [`add_...` transactions](Pallet::add_basic_resource). - * - * # Permissions: - * - Token owner - * - * # Arguments: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: RMRK collection ID of the NFT. - * - `rmrk_nft_id`: ID of the NFT with a pending resource to be accepted. - * - `resource_id`: ID of the newly created pending resource. - * accept the addition of a new resource to an existing NFT - **/ - acceptResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, resourceId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; - /** - * Accept the removal of a removal-pending resource from an NFT. - * - * This transaction is needed when a non-owner, i.e. the collection issuer, - * requests a [removal](`Pallet::remove_resource`) of a resource from an NFT. - * - * # Permissions: - * - Token owner - * - * # Arguments: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: RMRK collection ID of the NFT. - * - `rmrk_nft_id`: ID of the NFT with a resource to be removed. - * - `resource_id`: ID of the removal-pending resource. - **/ - acceptResourceRemoval: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, resourceId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; - /** - * Create and set/propose a basic resource for an NFT. - * - * A basic resource is the simplest, lacking a Base and anything that comes with it. - * See RMRK docs for more information and examples. - * - * # Permissions: - * - Collection issuer - if not the token owner, adding the resource will warrant - * the owner's [acceptance](Pallet::accept_resource). - * - * # Arguments: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: RMRK collection ID of the NFT. - * - `nft_id`: ID of the NFT to assign a resource to. - * - `resource`: Data of the resource to be created. - **/ - addBasicResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resource: RmrkTraitsResourceBasicResource | { src?: any; metadata?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsResourceBasicResource]>; - /** - * Create and set/propose a composable resource for an NFT. - * - * A composable resource links to a Base and has a subset of its Parts it is composed of. - * See RMRK docs for more information and examples. - * - * # Permissions: - * - Collection issuer - if not the token owner, adding the resource will warrant - * the owner's [acceptance](Pallet::accept_resource). - * - * # Arguments: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: RMRK collection ID of the NFT. - * - `nft_id`: ID of the NFT to assign a resource to. - * - `resource`: Data of the resource to be created. - **/ - addComposableResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resource: RmrkTraitsResourceComposableResource | { parts?: any; base?: any; src?: any; metadata?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsResourceComposableResource]>; - /** - * Create and set/propose a slot resource for an NFT. - * - * A slot resource links to a Base and a slot ID in it which it can fit into. - * See RMRK docs for more information and examples. - * - * # Permissions: - * - Collection issuer - if not the token owner, adding the resource will warrant - * the owner's [acceptance](Pallet::accept_resource). - * - * # Arguments: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: RMRK collection ID of the NFT. - * - `nft_id`: ID of the NFT to assign a resource to. - * - `resource`: Data of the resource to be created. - **/ - addSlotResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resource: RmrkTraitsResourceSlotResource | { base?: any; src?: any; metadata?: any; slot?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsResourceSlotResource]>; - /** - * Burn an NFT, destroying it and its nested tokens up to the specified limit. - * If the burning budget is exceeded, the transaction is reverted. - * - * This is the way to burn a nested token as well. - * - * For more information, see [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively). - * - * # Permissions: - * * Token owner - * - * # Arguments: - * - `origin`: sender of the transaction - * - `collection_id`: RMRK ID of the collection in which the NFT to burn belongs to. - * - `nft_id`: ID of the NFT to be destroyed. - * - `max_burns`: Maximum number of tokens to burn, assuming nesting. The transaction - * is reverted if there are more tokens to burn in the nesting tree than this number. - * This is primarily a mechanism of transaction weight control. - **/ - burnNft: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, maxBurns: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; - /** - * Change the issuer of a collection. Analogous to Unique's collection's [`owner`](up_data_structs::Collection). - * - * # Permissions: - * * Collection issuer - * - * # Arguments: - * - `origin`: sender of the transaction - * - `collection_id`: RMRK collection ID to change the issuer of. - * - `new_issuer`: Collection's new issuer. - **/ - changeCollectionIssuer: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newIssuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, MultiAddress]>; - /** - * Create a new collection of NFTs. - * - * # Permissions: - * * Anyone - will be assigned as the issuer of the collection. - * - * # Arguments: - * - `origin`: sender of the transaction - * - `metadata`: Metadata describing the collection, e.g. IPFS hash. Cannot be changed. - * - `max`: Optional maximum number of tokens. - * - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs. - * Analogous to Unique's [`token_prefix`](up_data_structs::Collection). Cannot be changed. - **/ - createCollection: AugmentedSubmittable<(metadata: Bytes | string | Uint8Array, max: Option | null | Uint8Array | u32 | AnyNumber, symbol: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes, Option, Bytes]>; - /** - * Destroy a collection. - * - * Only empty collections can be destroyed. If it has any tokens, they must be burned first. - * - * # Permissions: - * * Collection issuer - * - * # Arguments: - * - `origin`: sender of the transaction - * - `collection_id`: RMRK ID of the collection to destroy. - **/ - destroyCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; - /** - * "Lock" the collection and prevent new token creation. Cannot be undone. - * - * # Permissions: - * * Collection issuer - * - * # Arguments: - * - `origin`: sender of the transaction - * - `collection_id`: RMRK ID of the collection to lock. - **/ - lockCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; - /** - * Mint an NFT in a specified collection. - * - * # Permissions: - * * Collection issuer - * - * # Arguments: - * - `origin`: sender of the transaction - * - `owner`: Owner account of the NFT. If set to None, defaults to the sender (collection issuer). - * - `collection_id`: RMRK collection ID for the NFT to be minted within. Cannot be changed. - * - `recipient`: Receiver account of the royalty. Has no effect if the `royalty_amount` is not set. Cannot be changed. - * - `royalty_amount`: Optional permillage reward from each trade for the `recipient`. Cannot be changed. - * - `metadata`: Arbitrary data about an NFT, e.g. IPFS hash. Cannot be changed. - * - `transferable`: Can this NFT be transferred? Cannot be changed. - * - `resources`: Resource data to be added to the NFT immediately after minting. - **/ - mintNft: AugmentedSubmittable<(owner: Option | null | Uint8Array | AccountId32 | string, collectionId: u32 | AnyNumber | Uint8Array, recipient: Option | null | Uint8Array | AccountId32 | string, royaltyAmount: Option | null | Uint8Array | Permill | AnyNumber, metadata: Bytes | string | Uint8Array, transferable: bool | boolean | Uint8Array, resources: Option> | null | Uint8Array | Vec | (RmrkTraitsResourceResourceTypes | { Basic: any } | { Composable: any } | { Slot: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Option, u32, Option, Option, Bytes, bool, Option>]>; - /** - * Reject an NFT sent from another account to self or owned NFT. - * The NFT in question will not be sent back and burnt instead. - * - * The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first. - * - * # Permissions: - * - Token-owner-to-be-not - * - * # Arguments: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: RMRK ID of the NFT to be rejected. - * - `rmrk_nft_id`: ID of the NFT to be rejected. - **/ - rejectNft: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32]>; - /** - * Remove and erase a resource from an NFT. - * - * If the sender does not own the NFT, then it will be pending confirmation, - * and will have to be [accepted](Pallet::accept_resource_removal) by the token owner. - * - * # Permissions - * - Collection issuer - * - * # Arguments - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to. - * - `nft_id`: ID of the NFT with a resource to be removed. - * - `resource_id`: ID of the resource to be removed. - **/ - removeResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resourceId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; - /** - * Transfer an NFT from an account/NFT A to another account/NFT B. - * The token must be transferable. Nesting cannot occur deeper than the [`NESTING_BUDGET`]. - * - * If the target owner is an NFT owned by another account, then the NFT will enter - * the pending state and will have to be accepted by the other account. - * - * # Permissions: - * - Token owner - * - * # Arguments: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: RMRK ID of the collection of the NFT to be transferred. - * - `rmrk_nft_id`: ID of the NFT to be transferred. - * - `new_owner`: New owner of the nft which can be either an account or a NFT. - **/ - send: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple | { AccountId: any } | { CollectionAndNftTuple: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsNftAccountIdOrCollectionNftTuple]>; - /** - * Set a different order of resource priorities for an NFT. Priorities can be used, - * for example, for order of rendering. - * - * Note that the priorities are not updated automatically, and are an empty vector - * by default. There is no pre-set definition for the order to be particular, - * it can be interpreted arbitrarily use-case by use-case. - * - * # Permissions: - * - Token owner - * - * # Arguments: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: RMRK collection ID of the NFT. - * - `rmrk_nft_id`: ID of the NFT to rearrange resource priorities for. - * - `priorities`: Ordered vector of resource IDs. - **/ - setPriority: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, priorities: Vec | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic, [u32, u32, Vec]>; - /** - * Add or edit a custom user property, a key-value pair, describing the metadata - * of a token or a collection, on either one of these. - * - * Note that in this proxy implementation many details regarding RMRK are stored - * as scoped properties prefixed with "rmrk:", normally inaccessible - * to external transactions and RPCs. - * - * # Permissions: - * - Collection issuer - in case of collection property - * - Token owner - in case of NFT property - * - * # Arguments: - * - `origin`: sender of the transaction - * - `rmrk_collection_id`: RMRK collection ID. - * - `maybe_nft_id`: Optional ID of the NFT. If left empty, then the property is set for the collection. - * - `key`: Key of the custom property to be referenced by. - * - `value`: Value of the custom property to be stored. - **/ - setProperty: AugmentedSubmittable<(rmrkCollectionId: Compact | AnyNumber | Uint8Array, maybeNftId: Option | null | Uint8Array | u32 | AnyNumber, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Option, Bytes, Bytes]>; - /** - * Generic tx - **/ - [key: string]: SubmittableExtrinsicFunction; - }; - rmrkEquip: { - /** - * Create a new Base. - * - * Modeled after the [Base interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/base.md) - * - * # Permissions - * - Anyone - will be assigned as the issuer of the Base. - * - * # Arguments: - * - `origin`: Caller, will be assigned as the issuer of the Base - * - `base_type`: Arbitrary media type, e.g. "svg". - * - `symbol`: Arbitrary client-chosen symbol. - * - `parts`: Array of Fixed and Slot Parts composing the Base, - * confined in length by [`RmrkPartsLimit`](up_data_structs::RmrkPartsLimit). - **/ - createBase: AugmentedSubmittable<(baseType: Bytes | string | Uint8Array, symbol: Bytes | string | Uint8Array, parts: Vec | (RmrkTraitsPartPartType | { FixedPart: any } | { SlotPart: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Bytes, Bytes, Vec]>; - /** - * Update the array of Collections allowed to be equipped to a Base's specified Slot Part. - * - * Modeled after [equippable interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/equippable.md). - * - * # Permissions: - * - Base issuer - * - * # Arguments: - * - `origin`: sender of the transaction - * - `base_id`: Base containing the Slot Part to be updated. - * - `slot_id`: Slot Part whose Equippable List is being updated . - * - `equippables`: List of equippables that will override the current Equippables list. - **/ - equippable: AugmentedSubmittable<(baseId: u32 | AnyNumber | Uint8Array, slotId: u32 | AnyNumber | Uint8Array, equippables: RmrkTraitsPartEquippableList | { All: any } | { Empty: any } | { Custom: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsPartEquippableList]>; - /** - * Add a Theme to a Base. - * A Theme named "default" is required prior to adding other Themes. - * - * Modeled after [Themeadd interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/themeadd.md). - * - * # Permissions: - * - Base issuer - * - * # Arguments: - * - `origin`: sender of the transaction - * - `base_id`: Base ID containing the Theme to be updated. - * - `theme`: Theme to add to the Base. A Theme has a name and properties, which are an - * array of [key, value, inherit]. - * - `key`: Arbitrary BoundedString, defined by client. - * - `value`: Arbitrary BoundedString, defined by client. - * - `inherit`: Optional bool. - **/ - themeAdd: AugmentedSubmittable<(baseId: u32 | AnyNumber | Uint8Array, theme: RmrkTraitsTheme | { name?: any; properties?: any; inherit?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, RmrkTraitsTheme]>; - /** - * Generic tx - **/ - [key: string]: SubmittableExtrinsicFunction; - }; - scheduler: { - /** - * Cancel a named scheduled task. - **/ - cancelNamed: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed]>; - /** - * Schedule a named task. - **/ - scheduleNamed: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; - /** - * Schedule a named task after a delay. - * - * # - * Same as [`schedule_named`](Self::schedule_named). - * # - **/ - scheduleNamedAfter: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; - /** - * Generic tx - **/ - [key: string]: SubmittableExtrinsicFunction; - }; structure: { /** * Generic tx @@ -911,7 +545,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `currency_id`: currency type. * - `amount`: free balance amount to tranfer. **/ - forceTransfer: AugmentedSubmittable<(source: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [MultiAddress, MultiAddress, PalletForeingAssetsAssetIds, Compact]>; + forceTransfer: AugmentedSubmittable<(source: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [MultiAddress, MultiAddress, PalletForeignAssetsAssetIds, Compact]>; /** * Set the balances of a given account. * @@ -922,7 +556,7 @@ declare module '@polkadot/api-base/types/submittable' { * * The dispatch origin for this call is `root`. **/ - setBalance: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, newFree: Compact | AnyNumber | Uint8Array, newReserved: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [MultiAddress, PalletForeingAssetsAssetIds, Compact, Compact]>; + setBalance: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, newFree: Compact | AnyNumber | Uint8Array, newReserved: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [MultiAddress, PalletForeignAssetsAssetIds, Compact, Compact]>; /** * Transfer some liquid free balance to another account. * @@ -938,7 +572,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `currency_id`: currency type. * - `amount`: free balance amount to tranfer. **/ - transfer: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [MultiAddress, PalletForeingAssetsAssetIds, Compact]>; + transfer: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [MultiAddress, PalletForeignAssetsAssetIds, Compact]>; /** * Transfer all remaining balance to the given account. * @@ -960,7 +594,7 @@ declare module '@polkadot/api-base/types/submittable' { * except at least the existential deposit, which will guarantee to * keep the sender account alive (true). **/ - transferAll: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, keepAlive: bool | boolean | Uint8Array) => SubmittableExtrinsic, [MultiAddress, PalletForeingAssetsAssetIds, bool]>; + transferAll: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, keepAlive: bool | boolean | Uint8Array) => SubmittableExtrinsic, [MultiAddress, PalletForeignAssetsAssetIds, bool]>; /** * Same as the [`transfer`] call, but with a check that the transfer * will not kill the origin account. @@ -974,7 +608,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `currency_id`: currency type. * - `amount`: free balance amount to tranfer. **/ - transferKeepAlive: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [MultiAddress, PalletForeingAssetsAssetIds, Compact]>; + transferKeepAlive: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [MultiAddress, PalletForeignAssetsAssetIds, Compact]>; /** * Generic tx **/ @@ -1655,7 +1289,7 @@ declare module '@polkadot/api-base/types/submittable' { * by the network, and if the receiving chain would handle * messages correctly. **/ - transfer: AugmentedSubmittable<(currencyId: PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [PalletForeingAssetsAssetIds, u128, XcmVersionedMultiLocation, u64]>; + transfer: AugmentedSubmittable<(currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [PalletForeignAssetsAssetIds, u128, XcmVersionedMultiLocation, u64]>; /** * Transfer `MultiAsset`. * @@ -1730,7 +1364,7 @@ declare module '@polkadot/api-base/types/submittable' { * by the network, and if the receiving chain would handle * messages correctly. **/ - transferMulticurrencies: AugmentedSubmittable<(currencies: Vec> | ([PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, u128 | AnyNumber | Uint8Array])[], feeItem: u32 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec>, u32, XcmVersionedMultiLocation, u64]>; + transferMulticurrencies: AugmentedSubmittable<(currencies: Vec> | ([PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, u128 | AnyNumber | Uint8Array])[], feeItem: u32 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec>, u32, XcmVersionedMultiLocation, u64]>; /** * Transfer native currencies specifying the fee and amount as * separate. @@ -1754,7 +1388,7 @@ declare module '@polkadot/api-base/types/submittable' { * by the network, and if the receiving chain would handle * messages correctly. **/ - transferWithFee: AugmentedSubmittable<(currencyId: PalletForeingAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, fee: u128 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [PalletForeingAssetsAssetIds, u128, u128, XcmVersionedMultiLocation, u64]>; + transferWithFee: AugmentedSubmittable<(currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, fee: u128 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [PalletForeignAssetsAssetIds, u128, u128, XcmVersionedMultiLocation, u64]>; /** * Generic tx **/ diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index 5ea0a97ece..73aa349e72 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, PalletForeingAssetsModuleCall, PalletForeingAssetsModuleError, PalletForeingAssetsModuleEvent, PalletForeingAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UniqueRuntimeRuntime, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; @@ -325,7 +325,6 @@ declare module '@polkadot/types/types/registry' { CumulusPalletXcmCall: CumulusPalletXcmCall; CumulusPalletXcmError: CumulusPalletXcmError; CumulusPalletXcmEvent: CumulusPalletXcmEvent; - CumulusPalletXcmOrigin: CumulusPalletXcmOrigin; CumulusPalletXcmpQueueCall: CumulusPalletXcmpQueueCall; CumulusPalletXcmpQueueError: CumulusPalletXcmpQueueError; CumulusPalletXcmpQueueEvent: CumulusPalletXcmpQueueEvent; @@ -515,10 +514,7 @@ declare module '@polkadot/types/types/registry' { ForkTreePendingChange: ForkTreePendingChange; ForkTreePendingChangeNode: ForkTreePendingChangeNode; FpRpcTransactionStatus: FpRpcTransactionStatus; - FrameSupportDispatchRawOrigin: FrameSupportDispatchRawOrigin; FrameSupportPalletId: FrameSupportPalletId; - FrameSupportScheduleLookupError: FrameSupportScheduleLookupError; - FrameSupportScheduleMaybeHashed: FrameSupportScheduleMaybeHashed; FrameSupportTokensMiscBalanceStatus: FrameSupportTokensMiscBalanceStatus; FrameSupportWeightsDispatchClass: FrameSupportWeightsDispatchClass; FrameSupportWeightsDispatchInfo: FrameSupportWeightsDispatchInfo; @@ -770,8 +766,6 @@ declare module '@polkadot/types/types/registry' { OffenceDetails: OffenceDetails; Offender: Offender; OldV1SessionInfo: OldV1SessionInfo; - OpalRuntimeOriginCaller: OpalRuntimeOriginCaller; - OpalRuntimeRuntime: OpalRuntimeRuntime; OpaqueCall: OpaqueCall; OpaqueKeyOwnershipProof: OpaqueKeyOwnershipProof; OpaqueMetadata: OpaqueMetadata; @@ -834,7 +828,6 @@ declare module '@polkadot/types/types/registry' { PalletEthereumError: PalletEthereumError; PalletEthereumEvent: PalletEthereumEvent; PalletEthereumFakeTransactionFinalizer: PalletEthereumFakeTransactionFinalizer; - PalletEthereumRawOrigin: PalletEthereumRawOrigin; PalletEventMetadataLatest: PalletEventMetadataLatest; PalletEventMetadataV14: PalletEventMetadataV14; PalletEvmAccountBasicCrossAccountIdRepr: PalletEvmAccountBasicCrossAccountIdRepr; @@ -846,12 +839,8 @@ declare module '@polkadot/types/types/registry' { PalletEvmEvent: PalletEvmEvent; PalletEvmMigrationCall: PalletEvmMigrationCall; PalletEvmMigrationError: PalletEvmMigrationError; - PalletForeingAssetsAssetIds: PalletForeingAssetsAssetIds; - PalletForeingAssetsModuleAssetMetadata: PalletForeingAssetsModuleAssetMetadata; - PalletForeingAssetsModuleCall: PalletForeingAssetsModuleCall; - PalletForeingAssetsModuleError: PalletForeingAssetsModuleError; - PalletForeingAssetsModuleEvent: PalletForeingAssetsModuleEvent; - PalletForeingAssetsNativeCurrency: PalletForeingAssetsNativeCurrency; + PalletForeignAssetsAssetIds: PalletForeignAssetsAssetIds; + PalletForeignAssetsNativeCurrency: PalletForeignAssetsNativeCurrency; PalletFungibleError: PalletFungibleError; PalletId: PalletId; PalletInflationCall: PalletInflationCall; @@ -859,14 +848,6 @@ declare module '@polkadot/types/types/registry' { PalletMetadataV14: PalletMetadataV14; PalletNonfungibleError: PalletNonfungibleError; PalletNonfungibleItemData: PalletNonfungibleItemData; - PalletRefungibleError: PalletRefungibleError; - PalletRefungibleItemData: PalletRefungibleItemData; - PalletRmrkCoreCall: PalletRmrkCoreCall; - PalletRmrkCoreError: PalletRmrkCoreError; - PalletRmrkCoreEvent: PalletRmrkCoreEvent; - PalletRmrkEquipCall: PalletRmrkEquipCall; - PalletRmrkEquipError: PalletRmrkEquipError; - PalletRmrkEquipEvent: PalletRmrkEquipEvent; PalletsOrigin: PalletsOrigin; PalletStorageMetadataLatest: PalletStorageMetadataLatest; PalletStorageMetadataV14: PalletStorageMetadataV14; @@ -888,15 +869,10 @@ declare module '@polkadot/types/types/registry' { PalletUniqueCall: PalletUniqueCall; PalletUniqueError: PalletUniqueError; PalletUniqueRawEvent: PalletUniqueRawEvent; - PalletUniqueSchedulerCall: PalletUniqueSchedulerCall; - PalletUniqueSchedulerError: PalletUniqueSchedulerError; - PalletUniqueSchedulerEvent: PalletUniqueSchedulerEvent; - PalletUniqueSchedulerScheduledV3: PalletUniqueSchedulerScheduledV3; PalletVersion: PalletVersion; PalletXcmCall: PalletXcmCall; PalletXcmError: PalletXcmError; PalletXcmEvent: PalletXcmEvent; - PalletXcmOrigin: PalletXcmOrigin; ParachainDispatchOrigin: ParachainDispatchOrigin; ParachainInherentData: ParachainInherentData; ParachainProposal: ParachainProposal; @@ -1170,7 +1146,6 @@ declare module '@polkadot/types/types/registry' { SpCoreEcdsaSignature: SpCoreEcdsaSignature; SpCoreEd25519Signature: SpCoreEd25519Signature; SpCoreSr25519Signature: SpCoreSr25519Signature; - SpCoreVoid: SpCoreVoid; SpecVersion: SpecVersion; SpRuntimeArithmeticError: SpRuntimeArithmeticError; SpRuntimeDigest: SpRuntimeDigest; @@ -1280,6 +1255,7 @@ declare module '@polkadot/types/types/registry' { UnappliedSlash: UnappliedSlash; UnappliedSlashOther: UnappliedSlashOther; UncleEntryItem: UncleEntryItem; + UniqueRuntimeRuntime: UniqueRuntimeRuntime; UnknownTransaction: UnknownTransaction; UnlockChunk: UnlockChunk; UnrewardedRelayer: UnrewardedRelayer; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index c462d8411b..1a2d23b8cb 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -153,14 +153,6 @@ export interface CumulusPalletXcmEvent extends Enum { readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; } -/** @name CumulusPalletXcmOrigin */ -export interface CumulusPalletXcmOrigin extends Enum { - readonly isRelay: boolean; - readonly isSiblingParachain: boolean; - readonly asSiblingParachain: u32; - readonly type: 'Relay' | 'SiblingParachain'; -} - /** @name CumulusPalletXcmpQueueCall */ export interface CumulusPalletXcmpQueueCall extends Enum { readonly isServiceOverweight: boolean; @@ -501,34 +493,9 @@ export interface FpRpcTransactionStatus extends Struct { readonly logsBloom: EthbloomBloom; } -/** @name FrameSupportDispatchRawOrigin */ -export interface FrameSupportDispatchRawOrigin extends Enum { - readonly isRoot: boolean; - readonly isSigned: boolean; - readonly asSigned: AccountId32; - readonly isNone: boolean; - readonly type: 'Root' | 'Signed' | 'None'; -} - /** @name FrameSupportPalletId */ export interface FrameSupportPalletId extends U8aFixed {} -/** @name FrameSupportScheduleLookupError */ -export interface FrameSupportScheduleLookupError extends Enum { - readonly isUnknown: boolean; - readonly isBadFormat: boolean; - readonly type: 'Unknown' | 'BadFormat'; -} - -/** @name FrameSupportScheduleMaybeHashed */ -export interface FrameSupportScheduleMaybeHashed extends Enum { - readonly isValue: boolean; - readonly asValue: Call; - readonly isHash: boolean; - readonly asHash: H256; - readonly type: 'Value' | 'Hash'; -} - /** @name FrameSupportTokensMiscBalanceStatus */ export interface FrameSupportTokensMiscBalanceStatus extends Enum { readonly isFree: boolean; @@ -729,24 +696,6 @@ export interface FrameSystemPhase extends Enum { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } -/** @name OpalRuntimeOriginCaller */ -export interface OpalRuntimeOriginCaller extends Enum { - readonly isSystem: boolean; - readonly asSystem: FrameSupportDispatchRawOrigin; - readonly isVoid: boolean; - readonly asVoid: SpCoreVoid; - readonly isPolkadotXcm: boolean; - readonly asPolkadotXcm: PalletXcmOrigin; - readonly isCumulusXcm: boolean; - readonly asCumulusXcm: CumulusPalletXcmOrigin; - readonly isEthereum: boolean; - readonly asEthereum: PalletEthereumRawOrigin; - readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; -} - -/** @name OpalRuntimeRuntime */ -export interface OpalRuntimeRuntime extends Null {} - /** @name OrmlTokensAccountData */ export interface OrmlTokensAccountData extends Struct { readonly free: u128; @@ -765,32 +714,32 @@ export interface OrmlTokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { readonly dest: MultiAddress; - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly amount: Compact; } & Struct; readonly isTransferAll: boolean; readonly asTransferAll: { readonly dest: MultiAddress; - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly keepAlive: bool; } & Struct; readonly isTransferKeepAlive: boolean; readonly asTransferKeepAlive: { readonly dest: MultiAddress; - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly amount: Compact; } & Struct; readonly isForceTransfer: boolean; readonly asForceTransfer: { readonly source: MultiAddress; readonly dest: MultiAddress; - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly amount: Compact; } & Struct; readonly isSetBalance: boolean; readonly asSetBalance: { readonly who: MultiAddress; - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly newFree: Compact; readonly newReserved: Compact; } & Struct; @@ -814,38 +763,38 @@ export interface OrmlTokensModuleError extends Enum { export interface OrmlTokensModuleEvent extends Enum { readonly isEndowed: boolean; readonly asEndowed: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly amount: u128; } & Struct; readonly isDustLost: boolean; readonly asDustLost: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly amount: u128; } & Struct; readonly isTransfer: boolean; readonly asTransfer: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly from: AccountId32; readonly to: AccountId32; readonly amount: u128; } & Struct; readonly isReserved: boolean; readonly asReserved: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly amount: u128; } & Struct; readonly isUnreserved: boolean; readonly asUnreserved: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly amount: u128; } & Struct; readonly isReserveRepatriated: boolean; readonly asReserveRepatriated: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly from: AccountId32; readonly to: AccountId32; readonly amount: u128; @@ -853,46 +802,46 @@ export interface OrmlTokensModuleEvent extends Enum { } & Struct; readonly isBalanceSet: boolean; readonly asBalanceSet: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly free: u128; readonly reserved: u128; } & Struct; readonly isTotalIssuanceSet: boolean; readonly asTotalIssuanceSet: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly amount: u128; } & Struct; readonly isWithdrawn: boolean; readonly asWithdrawn: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly amount: u128; } & Struct; readonly isSlashed: boolean; readonly asSlashed: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly freeAmount: u128; readonly reservedAmount: u128; } & Struct; readonly isDeposited: boolean; readonly asDeposited: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly amount: u128; } & Struct; readonly isLockSet: boolean; readonly asLockSet: { readonly lockId: U8aFixed; - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly amount: u128; } & Struct; readonly isLockRemoved: boolean; readonly asLockRemoved: { readonly lockId: U8aFixed; - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; } & Struct; readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'BalanceSet' | 'TotalIssuanceSet' | 'Withdrawn' | 'Slashed' | 'Deposited' | 'LockSet' | 'LockRemoved'; @@ -967,7 +916,7 @@ export interface OrmlVestingVestingSchedule extends Struct { export interface OrmlXtokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly amount: u128; readonly dest: XcmVersionedMultiLocation; readonly destWeight: u64; @@ -980,7 +929,7 @@ export interface OrmlXtokensModuleCall extends Enum { } & Struct; readonly isTransferWithFee: boolean; readonly asTransferWithFee: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly amount: u128; readonly fee: u128; readonly dest: XcmVersionedMultiLocation; @@ -995,7 +944,7 @@ export interface OrmlXtokensModuleCall extends Enum { } & Struct; readonly isTransferMulticurrencies: boolean; readonly asTransferMulticurrencies: { - readonly currencies: Vec>; + readonly currencies: Vec>; readonly feeItem: u32; readonly dest: XcmVersionedMultiLocation; readonly destWeight: u64; @@ -1296,13 +1245,6 @@ export interface PalletEthereumEvent extends Enum { /** @name PalletEthereumFakeTransactionFinalizer */ export interface PalletEthereumFakeTransactionFinalizer extends Null {} -/** @name PalletEthereumRawOrigin */ -export interface PalletEthereumRawOrigin extends Enum { - readonly isEthereumTransaction: boolean; - readonly asEthereumTransaction: H160; - readonly type: 'EthereumTransaction'; -} - /** @name PalletEvmAccountBasicCrossAccountIdRepr */ export interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { readonly isSubstrate: boolean; @@ -1435,78 +1377,17 @@ export interface PalletEvmMigrationError extends Enum { readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } -/** @name PalletForeingAssetsAssetIds */ -export interface PalletForeingAssetsAssetIds extends Enum { +/** @name PalletForeignAssetsAssetIds */ +export interface PalletForeignAssetsAssetIds extends Enum { readonly isForeignAssetId: boolean; readonly asForeignAssetId: u32; readonly isNativeAssetId: boolean; - readonly asNativeAssetId: PalletForeingAssetsNativeCurrency; + readonly asNativeAssetId: PalletForeignAssetsNativeCurrency; readonly type: 'ForeignAssetId' | 'NativeAssetId'; } -/** @name PalletForeingAssetsModuleAssetMetadata */ -export interface PalletForeingAssetsModuleAssetMetadata extends Struct { - readonly name: Bytes; - readonly symbol: Bytes; - readonly decimals: u8; - readonly minimalBalance: u128; -} - -/** @name PalletForeingAssetsModuleCall */ -export interface PalletForeingAssetsModuleCall extends Enum { - readonly isRegisterForeignAsset: boolean; - readonly asRegisterForeignAsset: { - readonly owner: AccountId32; - readonly location: XcmVersionedMultiLocation; - readonly metadata: PalletForeingAssetsModuleAssetMetadata; - } & Struct; - readonly isUpdateForeignAsset: boolean; - readonly asUpdateForeignAsset: { - readonly foreignAssetId: u32; - readonly location: XcmVersionedMultiLocation; - readonly metadata: PalletForeingAssetsModuleAssetMetadata; - } & Struct; - readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset'; -} - -/** @name PalletForeingAssetsModuleError */ -export interface PalletForeingAssetsModuleError extends Enum { - readonly isBadLocation: boolean; - readonly isMultiLocationExisted: boolean; - readonly isAssetIdNotExists: boolean; - readonly isAssetIdExisted: boolean; - readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted'; -} - -/** @name PalletForeingAssetsModuleEvent */ -export interface PalletForeingAssetsModuleEvent extends Enum { - readonly isForeignAssetRegistered: boolean; - readonly asForeignAssetRegistered: { - readonly assetId: u32; - readonly assetAddress: XcmV1MultiLocation; - readonly metadata: PalletForeingAssetsModuleAssetMetadata; - } & Struct; - readonly isForeignAssetUpdated: boolean; - readonly asForeignAssetUpdated: { - readonly assetId: u32; - readonly assetAddress: XcmV1MultiLocation; - readonly metadata: PalletForeingAssetsModuleAssetMetadata; - } & Struct; - readonly isAssetRegistered: boolean; - readonly asAssetRegistered: { - readonly assetId: PalletForeingAssetsAssetIds; - readonly metadata: PalletForeingAssetsModuleAssetMetadata; - } & Struct; - readonly isAssetUpdated: boolean; - readonly asAssetUpdated: { - readonly assetId: PalletForeingAssetsAssetIds; - readonly metadata: PalletForeingAssetsModuleAssetMetadata; - } & Struct; - readonly type: 'ForeignAssetRegistered' | 'ForeignAssetUpdated' | 'AssetRegistered' | 'AssetUpdated'; -} - -/** @name PalletForeingAssetsNativeCurrency */ -export interface PalletForeingAssetsNativeCurrency extends Enum { +/** @name PalletForeignAssetsNativeCurrency */ +export interface PalletForeignAssetsNativeCurrency extends Enum { readonly isHere: boolean; readonly isParent: boolean; readonly type: 'Here' | 'Parent'; @@ -1544,290 +1425,6 @@ export interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } -/** @name PalletRefungibleError */ -export interface PalletRefungibleError extends Enum { - readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; - readonly isWrongRefungiblePieces: boolean; - readonly isRepartitionWhileNotOwningAllPieces: boolean; - readonly isRefungibleDisallowsNesting: boolean; - readonly isSettingPropertiesNotAllowed: boolean; - readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; -} - -/** @name PalletRefungibleItemData */ -export interface PalletRefungibleItemData extends Struct { - readonly constData: Bytes; -} - -/** @name PalletRmrkCoreCall */ -export interface PalletRmrkCoreCall extends Enum { - readonly isCreateCollection: boolean; - readonly asCreateCollection: { - readonly metadata: Bytes; - readonly max: Option; - readonly symbol: Bytes; - } & Struct; - readonly isDestroyCollection: boolean; - readonly asDestroyCollection: { - readonly collectionId: u32; - } & Struct; - readonly isChangeCollectionIssuer: boolean; - readonly asChangeCollectionIssuer: { - readonly collectionId: u32; - readonly newIssuer: MultiAddress; - } & Struct; - readonly isLockCollection: boolean; - readonly asLockCollection: { - readonly collectionId: u32; - } & Struct; - readonly isMintNft: boolean; - readonly asMintNft: { - readonly owner: Option; - readonly collectionId: u32; - readonly recipient: Option; - readonly royaltyAmount: Option; - readonly metadata: Bytes; - readonly transferable: bool; - readonly resources: Option>; - } & Struct; - readonly isBurnNft: boolean; - readonly asBurnNft: { - readonly collectionId: u32; - readonly nftId: u32; - readonly maxBurns: u32; - } & Struct; - readonly isSend: boolean; - readonly asSend: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; - } & Struct; - readonly isAcceptNft: boolean; - readonly asAcceptNft: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; - } & Struct; - readonly isRejectNft: boolean; - readonly asRejectNft: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - } & Struct; - readonly isAcceptResource: boolean; - readonly asAcceptResource: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isAcceptResourceRemoval: boolean; - readonly asAcceptResourceRemoval: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isSetProperty: boolean; - readonly asSetProperty: { - readonly rmrkCollectionId: Compact; - readonly maybeNftId: Option; - readonly key: Bytes; - readonly value: Bytes; - } & Struct; - readonly isSetPriority: boolean; - readonly asSetPriority: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly priorities: Vec; - } & Struct; - readonly isAddBasicResource: boolean; - readonly asAddBasicResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resource: RmrkTraitsResourceBasicResource; - } & Struct; - readonly isAddComposableResource: boolean; - readonly asAddComposableResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resource: RmrkTraitsResourceComposableResource; - } & Struct; - readonly isAddSlotResource: boolean; - readonly asAddSlotResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resource: RmrkTraitsResourceSlotResource; - } & Struct; - readonly isRemoveResource: boolean; - readonly asRemoveResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resourceId: u32; - } & Struct; - readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; -} - -/** @name PalletRmrkCoreError */ -export interface PalletRmrkCoreError extends Enum { - readonly isCorruptedCollectionType: boolean; - readonly isRmrkPropertyKeyIsTooLong: boolean; - readonly isRmrkPropertyValueIsTooLong: boolean; - readonly isRmrkPropertyIsNotFound: boolean; - readonly isUnableToDecodeRmrkData: boolean; - readonly isCollectionNotEmpty: boolean; - readonly isNoAvailableCollectionId: boolean; - readonly isNoAvailableNftId: boolean; - readonly isCollectionUnknown: boolean; - readonly isNoPermission: boolean; - readonly isNonTransferable: boolean; - readonly isCollectionFullOrLocked: boolean; - readonly isResourceDoesntExist: boolean; - readonly isCannotSendToDescendentOrSelf: boolean; - readonly isCannotAcceptNonOwnedNft: boolean; - readonly isCannotRejectNonOwnedNft: boolean; - readonly isCannotRejectNonPendingNft: boolean; - readonly isResourceNotPending: boolean; - readonly isNoAvailableResourceId: boolean; - readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; -} - -/** @name PalletRmrkCoreEvent */ -export interface PalletRmrkCoreEvent extends Enum { - readonly isCollectionCreated: boolean; - readonly asCollectionCreated: { - readonly issuer: AccountId32; - readonly collectionId: u32; - } & Struct; - readonly isCollectionDestroyed: boolean; - readonly asCollectionDestroyed: { - readonly issuer: AccountId32; - readonly collectionId: u32; - } & Struct; - readonly isIssuerChanged: boolean; - readonly asIssuerChanged: { - readonly oldIssuer: AccountId32; - readonly newIssuer: AccountId32; - readonly collectionId: u32; - } & Struct; - readonly isCollectionLocked: boolean; - readonly asCollectionLocked: { - readonly issuer: AccountId32; - readonly collectionId: u32; - } & Struct; - readonly isNftMinted: boolean; - readonly asNftMinted: { - readonly owner: AccountId32; - readonly collectionId: u32; - readonly nftId: u32; - } & Struct; - readonly isNftBurned: boolean; - readonly asNftBurned: { - readonly owner: AccountId32; - readonly nftId: u32; - } & Struct; - readonly isNftSent: boolean; - readonly asNftSent: { - readonly sender: AccountId32; - readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; - readonly collectionId: u32; - readonly nftId: u32; - readonly approvalRequired: bool; - } & Struct; - readonly isNftAccepted: boolean; - readonly asNftAccepted: { - readonly sender: AccountId32; - readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; - readonly collectionId: u32; - readonly nftId: u32; - } & Struct; - readonly isNftRejected: boolean; - readonly asNftRejected: { - readonly sender: AccountId32; - readonly collectionId: u32; - readonly nftId: u32; - } & Struct; - readonly isPropertySet: boolean; - readonly asPropertySet: { - readonly collectionId: u32; - readonly maybeNftId: Option; - readonly key: Bytes; - readonly value: Bytes; - } & Struct; - readonly isResourceAdded: boolean; - readonly asResourceAdded: { - readonly nftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isResourceRemoval: boolean; - readonly asResourceRemoval: { - readonly nftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isResourceAccepted: boolean; - readonly asResourceAccepted: { - readonly nftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isResourceRemovalAccepted: boolean; - readonly asResourceRemovalAccepted: { - readonly nftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isPrioritySet: boolean; - readonly asPrioritySet: { - readonly collectionId: u32; - readonly nftId: u32; - } & Struct; - readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; -} - -/** @name PalletRmrkEquipCall */ -export interface PalletRmrkEquipCall extends Enum { - readonly isCreateBase: boolean; - readonly asCreateBase: { - readonly baseType: Bytes; - readonly symbol: Bytes; - readonly parts: Vec; - } & Struct; - readonly isThemeAdd: boolean; - readonly asThemeAdd: { - readonly baseId: u32; - readonly theme: RmrkTraitsTheme; - } & Struct; - readonly isEquippable: boolean; - readonly asEquippable: { - readonly baseId: u32; - readonly slotId: u32; - readonly equippables: RmrkTraitsPartEquippableList; - } & Struct; - readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; -} - -/** @name PalletRmrkEquipError */ -export interface PalletRmrkEquipError extends Enum { - readonly isPermissionError: boolean; - readonly isNoAvailableBaseId: boolean; - readonly isNoAvailablePartId: boolean; - readonly isBaseDoesntExist: boolean; - readonly isNeedsDefaultThemeFirst: boolean; - readonly isPartDoesntExist: boolean; - readonly isNoEquippableOnFixedPart: boolean; - readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; -} - -/** @name PalletRmrkEquipEvent */ -export interface PalletRmrkEquipEvent extends Enum { - readonly isBaseCreated: boolean; - readonly asBaseCreated: { - readonly issuer: AccountId32; - readonly baseId: u32; - } & Struct; - readonly isEquippablesUpdated: boolean; - readonly asEquippablesUpdated: { - readonly baseId: u32; - readonly slotId: u32; - } & Struct; - readonly type: 'BaseCreated' | 'EquippablesUpdated'; -} - /** @name PalletStructureCall */ export interface PalletStructureCall extends Null {} @@ -2205,76 +1802,6 @@ export interface PalletUniqueRawEvent extends Enum { readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet'; } -/** @name PalletUniqueSchedulerCall */ -export interface PalletUniqueSchedulerCall extends Enum { - readonly isScheduleNamed: boolean; - readonly asScheduleNamed: { - readonly id: U8aFixed; - readonly when: u32; - readonly maybePeriodic: Option>; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; - } & Struct; - readonly isCancelNamed: boolean; - readonly asCancelNamed: { - readonly id: U8aFixed; - } & Struct; - readonly isScheduleNamedAfter: boolean; - readonly asScheduleNamedAfter: { - readonly id: U8aFixed; - readonly after: u32; - readonly maybePeriodic: Option>; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; - } & Struct; - readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; -} - -/** @name PalletUniqueSchedulerError */ -export interface PalletUniqueSchedulerError extends Enum { - readonly isFailedToSchedule: boolean; - readonly isNotFound: boolean; - readonly isTargetBlockNumberInPast: boolean; - readonly isRescheduleNoChange: boolean; - readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; -} - -/** @name PalletUniqueSchedulerEvent */ -export interface PalletUniqueSchedulerEvent extends Enum { - readonly isScheduled: boolean; - readonly asScheduled: { - readonly when: u32; - readonly index: u32; - } & Struct; - readonly isCanceled: boolean; - readonly asCanceled: { - readonly when: u32; - readonly index: u32; - } & Struct; - readonly isDispatched: boolean; - readonly asDispatched: { - readonly task: ITuple<[u32, u32]>; - readonly id: Option; - readonly result: Result; - } & Struct; - readonly isCallLookupFailed: boolean; - readonly asCallLookupFailed: { - readonly task: ITuple<[u32, u32]>; - readonly id: Option; - readonly error: FrameSupportScheduleLookupError; - } & Struct; - readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; -} - -/** @name PalletUniqueSchedulerScheduledV3 */ -export interface PalletUniqueSchedulerScheduledV3 extends Struct { - readonly maybeId: Option; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; - readonly maybePeriodic: Option>; - readonly origin: OpalRuntimeOriginCaller; -} - /** @name PalletXcmCall */ export interface PalletXcmCall extends Enum { readonly isSend: boolean; @@ -2392,15 +1919,6 @@ export interface PalletXcmEvent extends Enum { readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail'; } -/** @name PalletXcmOrigin */ -export interface PalletXcmOrigin extends Enum { - readonly isXcm: boolean; - readonly asXcm: XcmV1MultiLocation; - readonly isResponse: boolean; - readonly asResponse: XcmV1MultiLocation; - readonly type: 'Xcm' | 'Response'; -} - /** @name PhantomTypeUpDataStructs */ export interface PhantomTypeUpDataStructs extends Vec> {} @@ -2621,9 +2139,6 @@ export interface SpCoreEd25519Signature extends U8aFixed {} /** @name SpCoreSr25519Signature */ export interface SpCoreSr25519Signature extends U8aFixed {} -/** @name SpCoreVoid */ -export interface SpCoreVoid extends Null {} - /** @name SpRuntimeArithmeticError */ export interface SpRuntimeArithmeticError extends Enum { readonly isUnderflow: boolean; @@ -2723,6 +2238,9 @@ export interface SpVersionRuntimeVersion extends Struct { readonly stateVersion: u8; } +/** @name UniqueRuntimeRuntime */ +export interface UniqueRuntimeRuntime extends Null {} + /** @name UpDataStructsAccessMode */ export interface UpDataStructsAccessMode extends Enum { readonly isNormal: boolean; diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 9a4c914a19..d166acb300 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -54,7 +54,7 @@ export default { } }, /** - * Lookup16: frame_system::EventRecord + * Lookup16: frame_system::EventRecord **/ FrameSystemEventRecord: { phase: 'FrameSystemPhase', @@ -483,90 +483,90 @@ export default { OrmlTokensModuleEvent: { _enum: { Endowed: { - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', who: 'AccountId32', amount: 'u128', }, DustLost: { - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', who: 'AccountId32', amount: 'u128', }, Transfer: { - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', from: 'AccountId32', to: 'AccountId32', amount: 'u128', }, Reserved: { - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', who: 'AccountId32', amount: 'u128', }, Unreserved: { - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', who: 'AccountId32', amount: 'u128', }, ReserveRepatriated: { - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', from: 'AccountId32', to: 'AccountId32', amount: 'u128', status: 'FrameSupportTokensMiscBalanceStatus', }, BalanceSet: { - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', who: 'AccountId32', free: 'u128', reserved: 'u128', }, TotalIssuanceSet: { - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', amount: 'u128', }, Withdrawn: { - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', who: 'AccountId32', amount: 'u128', }, Slashed: { - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', who: 'AccountId32', freeAmount: 'u128', reservedAmount: 'u128', }, Deposited: { - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', who: 'AccountId32', amount: 'u128', }, LockSet: { lockId: '[u8;8]', - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', who: 'AccountId32', amount: 'u128', }, LockRemoved: { lockId: '[u8;8]', - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', who: 'AccountId32' } } }, /** - * Lookup59: pallet_foreing_assets::AssetIds + * Lookup59: pallet_foreign_assets::AssetIds **/ - PalletForeingAssetsAssetIds: { + PalletForeignAssetsAssetIds: { _enum: { ForeignAssetId: 'u32', - NativeAssetId: 'PalletForeingAssetsNativeCurrency' + NativeAssetId: 'PalletForeignAssetsNativeCurrency' } }, /** - * Lookup60: pallet_foreing_assets::NativeCurrency + * Lookup60: pallet_foreign_assets::NativeCurrency **/ - PalletForeingAssetsNativeCurrency: { + PalletForeignAssetsNativeCurrency: { _enum: ['Here', 'Parent'] }, /** @@ -1004,38 +1004,7 @@ export default { } }, /** - * Lookup92: pallet_unique_scheduler::pallet::Event - **/ - PalletUniqueSchedulerEvent: { - _enum: { - Scheduled: { - when: 'u32', - index: 'u32', - }, - Canceled: { - when: 'u32', - index: 'u32', - }, - Dispatched: { - task: '(u32,u32)', - id: 'Option<[u8;16]>', - result: 'Result', - }, - CallLookupFailed: { - task: '(u32,u32)', - id: 'Option<[u8;16]>', - error: 'FrameSupportScheduleLookupError' - } - } - }, - /** - * Lookup95: frame_support::traits::schedule::LookupError - **/ - FrameSupportScheduleLookupError: { - _enum: ['Unknown', 'BadFormat'] - }, - /** - * Lookup96: pallet_common::pallet::Event + * Lookup92: pallet_common::pallet::Event **/ PalletCommonEvent: { _enum: { @@ -1053,7 +1022,7 @@ export default { } }, /** - * Lookup99: pallet_structure::pallet::Event + * Lookup95: pallet_structure::pallet::Event **/ PalletStructureEvent: { _enum: { @@ -1061,142 +1030,7 @@ export default { } }, /** - * Lookup100: pallet_rmrk_core::pallet::Event - **/ - PalletRmrkCoreEvent: { - _enum: { - CollectionCreated: { - issuer: 'AccountId32', - collectionId: 'u32', - }, - CollectionDestroyed: { - issuer: 'AccountId32', - collectionId: 'u32', - }, - IssuerChanged: { - oldIssuer: 'AccountId32', - newIssuer: 'AccountId32', - collectionId: 'u32', - }, - CollectionLocked: { - issuer: 'AccountId32', - collectionId: 'u32', - }, - NftMinted: { - owner: 'AccountId32', - collectionId: 'u32', - nftId: 'u32', - }, - NFTBurned: { - owner: 'AccountId32', - nftId: 'u32', - }, - NFTSent: { - sender: 'AccountId32', - recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', - collectionId: 'u32', - nftId: 'u32', - approvalRequired: 'bool', - }, - NFTAccepted: { - sender: 'AccountId32', - recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', - collectionId: 'u32', - nftId: 'u32', - }, - NFTRejected: { - sender: 'AccountId32', - collectionId: 'u32', - nftId: 'u32', - }, - PropertySet: { - collectionId: 'u32', - maybeNftId: 'Option', - key: 'Bytes', - value: 'Bytes', - }, - ResourceAdded: { - nftId: 'u32', - resourceId: 'u32', - }, - ResourceRemoval: { - nftId: 'u32', - resourceId: 'u32', - }, - ResourceAccepted: { - nftId: 'u32', - resourceId: 'u32', - }, - ResourceRemovalAccepted: { - nftId: 'u32', - resourceId: 'u32', - }, - PrioritySet: { - collectionId: 'u32', - nftId: 'u32' - } - } - }, - /** - * Lookup101: rmrk_traits::nft::AccountIdOrCollectionNftTuple - **/ - RmrkTraitsNftAccountIdOrCollectionNftTuple: { - _enum: { - AccountId: 'AccountId32', - CollectionAndNftTuple: '(u32,u32)' - } - }, - /** - * Lookup106: pallet_rmrk_equip::pallet::Event - **/ - PalletRmrkEquipEvent: { - _enum: { - BaseCreated: { - issuer: 'AccountId32', - baseId: 'u32', - }, - EquippablesUpdated: { - baseId: 'u32', - slotId: 'u32' - } - } - }, - /** - * Lookup107: pallet_foreing_assets::module::Event - **/ - PalletForeingAssetsModuleEvent: { - _enum: { - ForeignAssetRegistered: { - assetId: 'u32', - assetAddress: 'XcmV1MultiLocation', - metadata: 'PalletForeingAssetsModuleAssetMetadata', - }, - ForeignAssetUpdated: { - assetId: 'u32', - assetAddress: 'XcmV1MultiLocation', - metadata: 'PalletForeingAssetsModuleAssetMetadata', - }, - AssetRegistered: { - assetId: 'PalletForeingAssetsAssetIds', - metadata: 'PalletForeingAssetsModuleAssetMetadata', - }, - AssetUpdated: { - assetId: 'PalletForeingAssetsAssetIds', - metadata: 'PalletForeingAssetsModuleAssetMetadata' - } - } - }, - /** - * Lookup108: pallet_foreing_assets::module::AssetMetadata - **/ - PalletForeingAssetsModuleAssetMetadata: { - name: 'Bytes', - symbol: 'Bytes', - decimals: 'u8', - minimalBalance: 'u128' - }, - /** - * Lookup109: pallet_evm::pallet::Event + * Lookup96: pallet_evm::pallet::Event **/ PalletEvmEvent: { _enum: { @@ -1210,7 +1044,7 @@ export default { } }, /** - * Lookup110: ethereum::log::Log + * Lookup97: ethereum::log::Log **/ EthereumLog: { address: 'H160', @@ -1218,7 +1052,7 @@ export default { data: 'Bytes' }, /** - * Lookup114: pallet_ethereum::pallet::Event + * Lookup101: pallet_ethereum::pallet::Event **/ PalletEthereumEvent: { _enum: { @@ -1226,7 +1060,7 @@ export default { } }, /** - * Lookup115: evm_core::error::ExitReason + * Lookup102: evm_core::error::ExitReason **/ EvmCoreErrorExitReason: { _enum: { @@ -1237,13 +1071,13 @@ export default { } }, /** - * Lookup116: evm_core::error::ExitSucceed + * Lookup103: evm_core::error::ExitSucceed **/ EvmCoreErrorExitSucceed: { _enum: ['Stopped', 'Returned', 'Suicided'] }, /** - * Lookup117: evm_core::error::ExitError + * Lookup104: evm_core::error::ExitError **/ EvmCoreErrorExitError: { _enum: { @@ -1265,13 +1099,13 @@ export default { } }, /** - * Lookup120: evm_core::error::ExitRevert + * Lookup107: evm_core::error::ExitRevert **/ EvmCoreErrorExitRevert: { _enum: ['Reverted'] }, /** - * Lookup121: evm_core::error::ExitFatal + * Lookup108: evm_core::error::ExitFatal **/ EvmCoreErrorExitFatal: { _enum: { @@ -1282,7 +1116,7 @@ export default { } }, /** - * Lookup122: frame_system::Phase + * Lookup109: frame_system::Phase **/ FrameSystemPhase: { _enum: { @@ -1292,14 +1126,14 @@ export default { } }, /** - * Lookup124: frame_system::LastRuntimeUpgradeInfo + * Lookup112: frame_system::LastRuntimeUpgradeInfo **/ FrameSystemLastRuntimeUpgradeInfo: { specVersion: 'Compact', specName: 'Text' }, /** - * Lookup125: frame_system::pallet::Call + * Lookup114: frame_system::pallet::Call **/ FrameSystemCall: { _enum: { @@ -1337,7 +1171,7 @@ export default { } }, /** - * Lookup130: frame_system::limits::BlockWeights + * Lookup119: frame_system::limits::BlockWeights **/ FrameSystemLimitsBlockWeights: { baseBlock: 'u64', @@ -1345,7 +1179,7 @@ export default { perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass' }, /** - * Lookup131: frame_support::weights::PerDispatchClass + * Lookup120: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassWeightsPerClass: { normal: 'FrameSystemLimitsWeightsPerClass', @@ -1353,7 +1187,7 @@ export default { mandatory: 'FrameSystemLimitsWeightsPerClass' }, /** - * Lookup132: frame_system::limits::WeightsPerClass + * Lookup121: frame_system::limits::WeightsPerClass **/ FrameSystemLimitsWeightsPerClass: { baseExtrinsic: 'u64', @@ -1362,13 +1196,13 @@ export default { reserved: 'Option' }, /** - * Lookup134: frame_system::limits::BlockLength + * Lookup123: frame_system::limits::BlockLength **/ FrameSystemLimitsBlockLength: { max: 'FrameSupportWeightsPerDispatchClassU32' }, /** - * Lookup135: frame_support::weights::PerDispatchClass + * Lookup124: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassU32: { normal: 'u32', @@ -1376,14 +1210,14 @@ export default { mandatory: 'u32' }, /** - * Lookup136: frame_support::weights::RuntimeDbWeight + * Lookup125: frame_support::weights::RuntimeDbWeight **/ FrameSupportWeightsRuntimeDbWeight: { read: 'u64', write: 'u64' }, /** - * Lookup137: sp_version::RuntimeVersion + * Lookup126: sp_version::RuntimeVersion **/ SpVersionRuntimeVersion: { specName: 'Text', @@ -1396,13 +1230,13 @@ export default { stateVersion: 'u8' }, /** - * Lookup142: frame_system::pallet::Error + * Lookup131: frame_system::pallet::Error **/ FrameSystemError: { _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] }, /** - * Lookup143: polkadot_primitives::v2::PersistedValidationData + * Lookup132: polkadot_primitives::v2::PersistedValidationData **/ PolkadotPrimitivesV2PersistedValidationData: { parentHead: 'Bytes', @@ -1411,19 +1245,19 @@ export default { maxPovSize: 'u32' }, /** - * Lookup146: polkadot_primitives::v2::UpgradeRestriction + * Lookup135: polkadot_primitives::v2::UpgradeRestriction **/ PolkadotPrimitivesV2UpgradeRestriction: { _enum: ['Present'] }, /** - * Lookup147: sp_trie::storage_proof::StorageProof + * Lookup136: sp_trie::storage_proof::StorageProof **/ SpTrieStorageProof: { trieNodes: 'BTreeSet' }, /** - * Lookup149: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot + * Lookup138: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot **/ CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: { dmqMqcHead: 'H256', @@ -1432,7 +1266,7 @@ export default { egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>' }, /** - * Lookup152: polkadot_primitives::v2::AbridgedHrmpChannel + * Lookup141: polkadot_primitives::v2::AbridgedHrmpChannel **/ PolkadotPrimitivesV2AbridgedHrmpChannel: { maxCapacity: 'u32', @@ -1443,7 +1277,7 @@ export default { mqcHead: 'Option' }, /** - * Lookup153: polkadot_primitives::v2::AbridgedHostConfiguration + * Lookup142: polkadot_primitives::v2::AbridgedHostConfiguration **/ PolkadotPrimitivesV2AbridgedHostConfiguration: { maxCodeSize: 'u32', @@ -1457,14 +1291,14 @@ export default { validationUpgradeDelay: 'u32' }, /** - * Lookup159: polkadot_core_primitives::OutboundHrmpMessage + * Lookup148: polkadot_core_primitives::OutboundHrmpMessage **/ PolkadotCorePrimitivesOutboundHrmpMessage: { recipient: 'u32', data: 'Bytes' }, /** - * Lookup160: cumulus_pallet_parachain_system::pallet::Call + * Lookup149: cumulus_pallet_parachain_system::pallet::Call **/ CumulusPalletParachainSystemCall: { _enum: { @@ -1483,7 +1317,7 @@ export default { } }, /** - * Lookup161: cumulus_primitives_parachain_inherent::ParachainInherentData + * Lookup150: cumulus_primitives_parachain_inherent::ParachainInherentData **/ CumulusPrimitivesParachainInherentParachainInherentData: { validationData: 'PolkadotPrimitivesV2PersistedValidationData', @@ -1492,27 +1326,27 @@ export default { horizontalMessages: 'BTreeMap>' }, /** - * Lookup163: polkadot_core_primitives::InboundDownwardMessage + * Lookup152: polkadot_core_primitives::InboundDownwardMessage **/ PolkadotCorePrimitivesInboundDownwardMessage: { sentAt: 'u32', msg: 'Bytes' }, /** - * Lookup166: polkadot_core_primitives::InboundHrmpMessage + * Lookup155: polkadot_core_primitives::InboundHrmpMessage **/ PolkadotCorePrimitivesInboundHrmpMessage: { sentAt: 'u32', data: 'Bytes' }, /** - * Lookup169: cumulus_pallet_parachain_system::pallet::Error + * Lookup158: cumulus_pallet_parachain_system::pallet::Error **/ CumulusPalletParachainSystemError: { _enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized'] }, /** - * Lookup171: pallet_balances::BalanceLock + * Lookup160: pallet_balances::BalanceLock **/ PalletBalancesBalanceLock: { id: '[u8;8]', @@ -1520,26 +1354,26 @@ export default { reasons: 'PalletBalancesReasons' }, /** - * Lookup172: pallet_balances::Reasons + * Lookup161: pallet_balances::Reasons **/ PalletBalancesReasons: { _enum: ['Fee', 'Misc', 'All'] }, /** - * Lookup175: pallet_balances::ReserveData + * Lookup164: pallet_balances::ReserveData **/ PalletBalancesReserveData: { id: '[u8;16]', amount: 'u128' }, /** - * Lookup177: pallet_balances::Releases + * Lookup166: pallet_balances::Releases **/ PalletBalancesReleases: { _enum: ['V1_0_0', 'V2_0_0'] }, /** - * Lookup178: pallet_balances::pallet::Call + * Lookup167: pallet_balances::pallet::Call **/ PalletBalancesCall: { _enum: { @@ -1572,13 +1406,13 @@ export default { } }, /** - * Lookup181: pallet_balances::pallet::Error + * Lookup170: pallet_balances::pallet::Error **/ PalletBalancesError: { _enum: ['VestingBalance', 'LiquidityRestrictions', 'InsufficientBalance', 'ExistentialDeposit', 'KeepAlive', 'ExistingVestingSchedule', 'DeadAccount', 'TooManyReserves'] }, /** - * Lookup183: pallet_timestamp::pallet::Call + * Lookup172: pallet_timestamp::pallet::Call **/ PalletTimestampCall: { _enum: { @@ -1588,13 +1422,13 @@ export default { } }, /** - * Lookup185: pallet_transaction_payment::Releases + * Lookup174: pallet_transaction_payment::Releases **/ PalletTransactionPaymentReleases: { _enum: ['V1Ancient', 'V2'] }, /** - * Lookup186: pallet_treasury::Proposal + * Lookup175: pallet_treasury::Proposal **/ PalletTreasuryProposal: { proposer: 'AccountId32', @@ -1603,7 +1437,7 @@ export default { bond: 'u128' }, /** - * Lookup189: pallet_treasury::pallet::Call + * Lookup178: pallet_treasury::pallet::Call **/ PalletTreasuryCall: { _enum: { @@ -1627,17 +1461,17 @@ export default { } }, /** - * Lookup192: frame_support::PalletId + * Lookup181: frame_support::PalletId **/ FrameSupportPalletId: '[u8;8]', /** - * Lookup193: pallet_treasury::pallet::Error + * Lookup182: pallet_treasury::pallet::Error **/ PalletTreasuryError: { _enum: ['InsufficientProposersBalance', 'InvalidIndex', 'TooManyApprovals', 'InsufficientPermission', 'ProposalNotApproved'] }, /** - * Lookup194: pallet_sudo::pallet::Call + * Lookup183: pallet_sudo::pallet::Call **/ PalletSudoCall: { _enum: { @@ -1661,7 +1495,7 @@ export default { } }, /** - * Lookup196: orml_vesting::module::Call + * Lookup185: orml_vesting::module::Call **/ OrmlVestingModuleCall: { _enum: { @@ -1680,12 +1514,12 @@ export default { } }, /** - * Lookup198: orml_xtokens::module::Call + * Lookup187: orml_xtokens::module::Call **/ OrmlXtokensModuleCall: { _enum: { transfer: { - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', amount: 'u128', dest: 'XcmVersionedMultiLocation', destWeight: 'u64', @@ -1696,7 +1530,7 @@ export default { destWeight: 'u64', }, transfer_with_fee: { - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', amount: 'u128', fee: 'u128', dest: 'XcmVersionedMultiLocation', @@ -1709,7 +1543,7 @@ export default { destWeight: 'u64', }, transfer_multicurrencies: { - currencies: 'Vec<(PalletForeingAssetsAssetIds,u128)>', + currencies: 'Vec<(PalletForeignAssetsAssetIds,u128)>', feeItem: 'u32', dest: 'XcmVersionedMultiLocation', destWeight: 'u64', @@ -1723,7 +1557,7 @@ export default { } }, /** - * Lookup199: xcm::VersionedMultiAsset + * Lookup188: xcm::VersionedMultiAsset **/ XcmVersionedMultiAsset: { _enum: { @@ -1732,41 +1566,41 @@ export default { } }, /** - * Lookup202: orml_tokens::module::Call + * Lookup191: orml_tokens::module::Call **/ OrmlTokensModuleCall: { _enum: { transfer: { dest: 'MultiAddress', - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', amount: 'Compact', }, transfer_all: { dest: 'MultiAddress', - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', keepAlive: 'bool', }, transfer_keep_alive: { dest: 'MultiAddress', - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', amount: 'Compact', }, force_transfer: { source: 'MultiAddress', dest: 'MultiAddress', - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', amount: 'Compact', }, set_balance: { who: 'MultiAddress', - currencyId: 'PalletForeingAssetsAssetIds', + currencyId: 'PalletForeignAssetsAssetIds', newFree: 'Compact', newReserved: 'Compact' } } }, /** - * Lookup203: cumulus_pallet_xcmp_queue::pallet::Call + * Lookup192: cumulus_pallet_xcmp_queue::pallet::Call **/ CumulusPalletXcmpQueueCall: { _enum: { @@ -1815,7 +1649,7 @@ export default { } }, /** - * Lookup204: pallet_xcm::pallet::Call + * Lookup193: pallet_xcm::pallet::Call **/ PalletXcmCall: { _enum: { @@ -1869,7 +1703,7 @@ export default { } }, /** - * Lookup205: xcm::VersionedXcm + * Lookup194: xcm::VersionedXcm **/ XcmVersionedXcm: { _enum: { @@ -1879,7 +1713,7 @@ export default { } }, /** - * Lookup206: xcm::v0::Xcm + * Lookup195: xcm::v0::Xcm **/ XcmV0Xcm: { _enum: { @@ -1933,7 +1767,7 @@ export default { } }, /** - * Lookup208: xcm::v0::order::Order + * Lookup197: xcm::v0::order::Order **/ XcmV0Order: { _enum: { @@ -1976,7 +1810,7 @@ export default { } }, /** - * Lookup210: xcm::v0::Response + * Lookup199: xcm::v0::Response **/ XcmV0Response: { _enum: { @@ -1984,7 +1818,7 @@ export default { } }, /** - * Lookup211: xcm::v1::Xcm + * Lookup200: xcm::v1::Xcm **/ XcmV1Xcm: { _enum: { @@ -2043,7 +1877,7 @@ export default { } }, /** - * Lookup213: xcm::v1::order::Order + * Lookup202: xcm::v1::order::Order **/ XcmV1Order: { _enum: { @@ -2088,7 +1922,7 @@ export default { } }, /** - * Lookup215: xcm::v1::Response + * Lookup204: xcm::v1::Response **/ XcmV1Response: { _enum: { @@ -2097,11 +1931,11 @@ export default { } }, /** - * Lookup229: cumulus_pallet_xcm::pallet::Call + * Lookup219: cumulus_pallet_xcm::pallet::Call **/ CumulusPalletXcmCall: 'Null', /** - * Lookup230: cumulus_pallet_dmp_queue::pallet::Call + * Lookup220: cumulus_pallet_dmp_queue::pallet::Call **/ CumulusPalletDmpQueueCall: { _enum: { @@ -2112,7 +1946,7 @@ export default { } }, /** - * Lookup231: pallet_inflation::pallet::Call + * Lookup221: pallet_inflation::pallet::Call **/ PalletInflationCall: { _enum: { @@ -2122,7 +1956,7 @@ export default { } }, /** - * Lookup232: pallet_unique::Call + * Lookup222: pallet_unique::Call **/ PalletUniqueCall: { _enum: { @@ -2254,7 +2088,7 @@ export default { } }, /** - * Lookup237: up_data_structs::CollectionMode + * Lookup227: up_data_structs::CollectionMode **/ UpDataStructsCollectionMode: { _enum: { @@ -2264,7 +2098,7 @@ export default { } }, /** - * Lookup238: up_data_structs::CreateCollectionData + * Lookup228: up_data_structs::CreateCollectionData **/ UpDataStructsCreateCollectionData: { mode: 'UpDataStructsCollectionMode', @@ -2279,13 +2113,13 @@ export default { properties: 'Vec' }, /** - * Lookup240: up_data_structs::AccessMode + * Lookup230: up_data_structs::AccessMode **/ UpDataStructsAccessMode: { _enum: ['Normal', 'AllowList'] }, /** - * Lookup242: up_data_structs::CollectionLimits + * Lookup232: up_data_structs::CollectionLimits **/ UpDataStructsCollectionLimits: { accountTokenOwnershipLimit: 'Option', @@ -2299,7 +2133,7 @@ export default { transfersEnabled: 'Option' }, /** - * Lookup244: up_data_structs::SponsoringRateLimit + * Lookup234: up_data_structs::SponsoringRateLimit **/ UpDataStructsSponsoringRateLimit: { _enum: { @@ -2308,7 +2142,7 @@ export default { } }, /** - * Lookup247: up_data_structs::CollectionPermissions + * Lookup237: up_data_structs::CollectionPermissions **/ UpDataStructsCollectionPermissions: { access: 'Option', @@ -2316,7 +2150,7 @@ export default { nesting: 'Option' }, /** - * Lookup249: up_data_structs::NestingPermissions + * Lookup239: up_data_structs::NestingPermissions **/ UpDataStructsNestingPermissions: { tokenOwner: 'bool', @@ -2324,18 +2158,18 @@ export default { restricted: 'Option' }, /** - * Lookup251: up_data_structs::OwnerRestrictedSet + * Lookup241: up_data_structs::OwnerRestrictedSet **/ UpDataStructsOwnerRestrictedSet: 'BTreeSet', /** - * Lookup256: up_data_structs::PropertyKeyPermission + * Lookup246: up_data_structs::PropertyKeyPermission **/ UpDataStructsPropertyKeyPermission: { key: 'Bytes', permission: 'UpDataStructsPropertyPermission' }, /** - * Lookup257: up_data_structs::PropertyPermission + * Lookup247: up_data_structs::PropertyPermission **/ UpDataStructsPropertyPermission: { mutable: 'bool', @@ -2343,14 +2177,14 @@ export default { tokenOwner: 'bool' }, /** - * Lookup260: up_data_structs::Property + * Lookup250: up_data_structs::Property **/ UpDataStructsProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup263: up_data_structs::CreateItemData + * Lookup253: up_data_structs::CreateItemData **/ UpDataStructsCreateItemData: { _enum: { @@ -2360,26 +2194,26 @@ export default { } }, /** - * Lookup264: up_data_structs::CreateNftData + * Lookup254: up_data_structs::CreateNftData **/ UpDataStructsCreateNftData: { properties: 'Vec' }, /** - * Lookup265: up_data_structs::CreateFungibleData + * Lookup255: up_data_structs::CreateFungibleData **/ UpDataStructsCreateFungibleData: { value: 'u128' }, /** - * Lookup266: up_data_structs::CreateReFungibleData + * Lookup256: up_data_structs::CreateReFungibleData **/ UpDataStructsCreateReFungibleData: { pieces: 'u128', properties: 'Vec' }, /** - * Lookup269: up_data_structs::CreateItemExData> + * Lookup259: up_data_structs::CreateItemExData> **/ UpDataStructsCreateItemExData: { _enum: { @@ -2390,14 +2224,14 @@ export default { } }, /** - * Lookup271: up_data_structs::CreateNftExData> + * Lookup261: up_data_structs::CreateNftExData> **/ UpDataStructsCreateNftExData: { properties: 'Vec', owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup278: up_data_structs::CreateRefungibleExSingleOwner> + * Lookup268: up_data_structs::CreateRefungibleExSingleOwner> **/ UpDataStructsCreateRefungibleExSingleOwner: { user: 'PalletEvmAccountBasicCrossAccountIdRepr', @@ -2405,47 +2239,14 @@ export default { properties: 'Vec' }, /** - * Lookup280: up_data_structs::CreateRefungibleExMultipleOwners> + * Lookup270: up_data_structs::CreateRefungibleExMultipleOwners> **/ UpDataStructsCreateRefungibleExMultipleOwners: { users: 'BTreeMap', properties: 'Vec' }, /** - * Lookup281: pallet_unique_scheduler::pallet::Call - **/ - PalletUniqueSchedulerCall: { - _enum: { - schedule_named: { - id: '[u8;16]', - when: 'u32', - maybePeriodic: 'Option<(u32,u32)>', - priority: 'u8', - call: 'FrameSupportScheduleMaybeHashed', - }, - cancel_named: { - id: '[u8;16]', - }, - schedule_named_after: { - id: '[u8;16]', - after: 'u32', - maybePeriodic: 'Option<(u32,u32)>', - priority: 'u8', - call: 'FrameSupportScheduleMaybeHashed' - } - } - }, - /** - * Lookup283: frame_support::traits::schedule::MaybeHashed - **/ - FrameSupportScheduleMaybeHashed: { - _enum: { - Value: 'Call', - Hash: 'H256' - } - }, - /** - * Lookup284: pallet_configuration::pallet::Call + * Lookup271: pallet_configuration::pallet::Call **/ PalletConfigurationCall: { _enum: { @@ -2458,236 +2259,15 @@ export default { } }, /** - * Lookup285: pallet_template_transaction_payment::Call + * Lookup272: pallet_template_transaction_payment::Call **/ PalletTemplateTransactionPaymentCall: 'Null', /** - * Lookup286: pallet_structure::pallet::Call + * Lookup273: pallet_structure::pallet::Call **/ PalletStructureCall: 'Null', /** - * Lookup287: pallet_rmrk_core::pallet::Call - **/ - PalletRmrkCoreCall: { - _enum: { - create_collection: { - metadata: 'Bytes', - max: 'Option', - symbol: 'Bytes', - }, - destroy_collection: { - collectionId: 'u32', - }, - change_collection_issuer: { - collectionId: 'u32', - newIssuer: 'MultiAddress', - }, - lock_collection: { - collectionId: 'u32', - }, - mint_nft: { - owner: 'Option', - collectionId: 'u32', - recipient: 'Option', - royaltyAmount: 'Option', - metadata: 'Bytes', - transferable: 'bool', - resources: 'Option>', - }, - burn_nft: { - collectionId: 'u32', - nftId: 'u32', - maxBurns: 'u32', - }, - send: { - rmrkCollectionId: 'u32', - rmrkNftId: 'u32', - newOwner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', - }, - accept_nft: { - rmrkCollectionId: 'u32', - rmrkNftId: 'u32', - newOwner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', - }, - reject_nft: { - rmrkCollectionId: 'u32', - rmrkNftId: 'u32', - }, - accept_resource: { - rmrkCollectionId: 'u32', - rmrkNftId: 'u32', - resourceId: 'u32', - }, - accept_resource_removal: { - rmrkCollectionId: 'u32', - rmrkNftId: 'u32', - resourceId: 'u32', - }, - set_property: { - rmrkCollectionId: 'Compact', - maybeNftId: 'Option', - key: 'Bytes', - value: 'Bytes', - }, - set_priority: { - rmrkCollectionId: 'u32', - rmrkNftId: 'u32', - priorities: 'Vec', - }, - add_basic_resource: { - rmrkCollectionId: 'u32', - nftId: 'u32', - resource: 'RmrkTraitsResourceBasicResource', - }, - add_composable_resource: { - rmrkCollectionId: 'u32', - nftId: 'u32', - resource: 'RmrkTraitsResourceComposableResource', - }, - add_slot_resource: { - rmrkCollectionId: 'u32', - nftId: 'u32', - resource: 'RmrkTraitsResourceSlotResource', - }, - remove_resource: { - rmrkCollectionId: 'u32', - nftId: 'u32', - resourceId: 'u32' - } - } - }, - /** - * Lookup293: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> - **/ - RmrkTraitsResourceResourceTypes: { - _enum: { - Basic: 'RmrkTraitsResourceBasicResource', - Composable: 'RmrkTraitsResourceComposableResource', - Slot: 'RmrkTraitsResourceSlotResource' - } - }, - /** - * Lookup295: rmrk_traits::resource::BasicResource> - **/ - RmrkTraitsResourceBasicResource: { - src: 'Option', - metadata: 'Option', - license: 'Option', - thumb: 'Option' - }, - /** - * Lookup297: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> - **/ - RmrkTraitsResourceComposableResource: { - parts: 'Vec', - base: 'u32', - src: 'Option', - metadata: 'Option', - license: 'Option', - thumb: 'Option' - }, - /** - * Lookup298: rmrk_traits::resource::SlotResource> - **/ - RmrkTraitsResourceSlotResource: { - base: 'u32', - src: 'Option', - metadata: 'Option', - slot: 'u32', - license: 'Option', - thumb: 'Option' - }, - /** - * Lookup301: pallet_rmrk_equip::pallet::Call - **/ - PalletRmrkEquipCall: { - _enum: { - create_base: { - baseType: 'Bytes', - symbol: 'Bytes', - parts: 'Vec', - }, - theme_add: { - baseId: 'u32', - theme: 'RmrkTraitsTheme', - }, - equippable: { - baseId: 'u32', - slotId: 'u32', - equippables: 'RmrkTraitsPartEquippableList' - } - } - }, - /** - * Lookup304: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> - **/ - RmrkTraitsPartPartType: { - _enum: { - FixedPart: 'RmrkTraitsPartFixedPart', - SlotPart: 'RmrkTraitsPartSlotPart' - } - }, - /** - * Lookup306: rmrk_traits::part::FixedPart> - **/ - RmrkTraitsPartFixedPart: { - id: 'u32', - z: 'u32', - src: 'Bytes' - }, - /** - * Lookup307: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> - **/ - RmrkTraitsPartSlotPart: { - id: 'u32', - equippable: 'RmrkTraitsPartEquippableList', - src: 'Bytes', - z: 'u32' - }, - /** - * Lookup308: rmrk_traits::part::EquippableList> - **/ - RmrkTraitsPartEquippableList: { - _enum: { - All: 'Null', - Empty: 'Null', - Custom: 'Vec' - } - }, - /** - * Lookup310: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> - **/ - RmrkTraitsTheme: { - name: 'Bytes', - properties: 'Vec', - inherit: 'bool' - }, - /** - * Lookup312: rmrk_traits::theme::ThemeProperty> - **/ - RmrkTraitsThemeThemeProperty: { - key: 'Bytes', - value: 'Bytes' - }, - /** - * Lookup314: pallet_foreing_assets::module::Call - **/ - PalletForeingAssetsModuleCall: { - _enum: { - register_foreign_asset: { - owner: 'AccountId32', - location: 'XcmVersionedMultiLocation', - metadata: 'PalletForeingAssetsModuleAssetMetadata', - }, - update_foreign_asset: { - foreignAssetId: 'u32', - location: 'XcmVersionedMultiLocation', - metadata: 'PalletForeingAssetsModuleAssetMetadata' - } - } - }, - /** - * Lookup315: pallet_evm::pallet::Call + * Lookup274: pallet_evm::pallet::Call **/ PalletEvmCall: { _enum: { @@ -2730,7 +2310,7 @@ export default { } }, /** - * Lookup319: pallet_ethereum::pallet::Call + * Lookup278: pallet_ethereum::pallet::Call **/ PalletEthereumCall: { _enum: { @@ -2740,7 +2320,7 @@ export default { } }, /** - * Lookup320: ethereum::transaction::TransactionV2 + * Lookup279: ethereum::transaction::TransactionV2 **/ EthereumTransactionTransactionV2: { _enum: { @@ -2750,7 +2330,7 @@ export default { } }, /** - * Lookup321: ethereum::transaction::LegacyTransaction + * Lookup280: ethereum::transaction::LegacyTransaction **/ EthereumTransactionLegacyTransaction: { nonce: 'U256', @@ -2762,7 +2342,7 @@ export default { signature: 'EthereumTransactionTransactionSignature' }, /** - * Lookup322: ethereum::transaction::TransactionAction + * Lookup281: ethereum::transaction::TransactionAction **/ EthereumTransactionTransactionAction: { _enum: { @@ -2771,7 +2351,7 @@ export default { } }, /** - * Lookup323: ethereum::transaction::TransactionSignature + * Lookup282: ethereum::transaction::TransactionSignature **/ EthereumTransactionTransactionSignature: { v: 'u64', @@ -2779,7 +2359,7 @@ export default { s: 'H256' }, /** - * Lookup325: ethereum::transaction::EIP2930Transaction + * Lookup284: ethereum::transaction::EIP2930Transaction **/ EthereumTransactionEip2930Transaction: { chainId: 'u64', @@ -2795,14 +2375,14 @@ export default { s: 'H256' }, /** - * Lookup327: ethereum::transaction::AccessListItem + * Lookup286: ethereum::transaction::AccessListItem **/ EthereumTransactionAccessListItem: { address: 'H160', storageKeys: 'Vec' }, /** - * Lookup328: ethereum::transaction::EIP1559Transaction + * Lookup287: ethereum::transaction::EIP1559Transaction **/ EthereumTransactionEip1559Transaction: { chainId: 'u64', @@ -2819,7 +2399,7 @@ export default { s: 'H256' }, /** - * Lookup329: pallet_evm_migration::pallet::Call + * Lookup288: pallet_evm_migration::pallet::Call **/ PalletEvmMigrationCall: { _enum: { @@ -2837,32 +2417,32 @@ export default { } }, /** - * Lookup332: pallet_sudo::pallet::Error + * Lookup291: pallet_sudo::pallet::Error **/ PalletSudoError: { _enum: ['RequireSudo'] }, /** - * Lookup334: orml_vesting::module::Error + * Lookup293: orml_vesting::module::Error **/ OrmlVestingModuleError: { _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded'] }, /** - * Lookup335: orml_xtokens::module::Error + * Lookup294: orml_xtokens::module::Error **/ OrmlXtokensModuleError: { _enum: ['AssetHasNoReserve', 'NotCrossChainTransfer', 'InvalidDest', 'NotCrossChainTransferableCurrency', 'UnweighableMessage', 'XcmExecutionFailed', 'CannotReanchor', 'InvalidAncestry', 'InvalidAsset', 'DestinationNotInvertible', 'BadVersion', 'DistinctReserveForAssetAndFee', 'ZeroFee', 'ZeroAmount', 'TooManyAssetsBeingSent', 'AssetIndexNonExistent', 'FeeNotEnough', 'NotSupportedMultiLocation', 'MinXcmFeeNotDefined'] }, /** - * Lookup338: orml_tokens::BalanceLock + * Lookup297: orml_tokens::BalanceLock **/ OrmlTokensBalanceLock: { id: '[u8;8]', amount: 'u128' }, /** - * Lookup340: orml_tokens::AccountData + * Lookup299: orml_tokens::AccountData **/ OrmlTokensAccountData: { free: 'u128', @@ -2870,20 +2450,20 @@ export default { frozen: 'u128' }, /** - * Lookup342: orml_tokens::ReserveData + * Lookup301: orml_tokens::ReserveData **/ OrmlTokensReserveData: { id: 'Null', amount: 'u128' }, /** - * Lookup344: orml_tokens::module::Error + * Lookup303: orml_tokens::module::Error **/ OrmlTokensModuleError: { _enum: ['BalanceTooLow', 'AmountIntoBalanceFailed', 'LiquidityRestrictions', 'MaxLocksExceeded', 'KeepAlive', 'ExistentialDeposit', 'DeadAccount', 'TooManyReserves'] }, /** - * Lookup346: cumulus_pallet_xcmp_queue::InboundChannelDetails + * Lookup305: cumulus_pallet_xcmp_queue::InboundChannelDetails **/ CumulusPalletXcmpQueueInboundChannelDetails: { sender: 'u32', @@ -2891,19 +2471,19 @@ export default { messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>' }, /** - * Lookup347: cumulus_pallet_xcmp_queue::InboundState + * Lookup306: cumulus_pallet_xcmp_queue::InboundState **/ CumulusPalletXcmpQueueInboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup350: polkadot_parachain::primitives::XcmpMessageFormat + * Lookup309: polkadot_parachain::primitives::XcmpMessageFormat **/ PolkadotParachainPrimitivesXcmpMessageFormat: { _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals'] }, /** - * Lookup353: cumulus_pallet_xcmp_queue::OutboundChannelDetails + * Lookup312: cumulus_pallet_xcmp_queue::OutboundChannelDetails **/ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: 'u32', @@ -2913,13 +2493,13 @@ export default { lastIndex: 'u16' }, /** - * Lookup354: cumulus_pallet_xcmp_queue::OutboundState + * Lookup313: cumulus_pallet_xcmp_queue::OutboundState **/ CumulusPalletXcmpQueueOutboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup356: cumulus_pallet_xcmp_queue::QueueConfigData + * Lookup315: cumulus_pallet_xcmp_queue::QueueConfigData **/ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: 'u32', @@ -2930,29 +2510,29 @@ export default { xcmpMaxIndividualWeight: 'u64' }, /** - * Lookup358: cumulus_pallet_xcmp_queue::pallet::Error + * Lookup317: cumulus_pallet_xcmp_queue::pallet::Error **/ CumulusPalletXcmpQueueError: { _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit'] }, /** - * Lookup359: pallet_xcm::pallet::Error + * Lookup318: pallet_xcm::pallet::Error **/ PalletXcmError: { _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed'] }, /** - * Lookup360: cumulus_pallet_xcm::pallet::Error + * Lookup319: cumulus_pallet_xcm::pallet::Error **/ CumulusPalletXcmError: 'Null', /** - * Lookup361: cumulus_pallet_dmp_queue::ConfigData + * Lookup320: cumulus_pallet_dmp_queue::ConfigData **/ CumulusPalletDmpQueueConfigData: { maxIndividual: 'u64' }, /** - * Lookup362: cumulus_pallet_dmp_queue::PageIndexData + * Lookup321: cumulus_pallet_dmp_queue::PageIndexData **/ CumulusPalletDmpQueuePageIndexData: { beginUsed: 'u32', @@ -2960,184 +2540,19 @@ export default { overweightCount: 'u64' }, /** - * Lookup365: cumulus_pallet_dmp_queue::pallet::Error + * Lookup324: cumulus_pallet_dmp_queue::pallet::Error **/ CumulusPalletDmpQueueError: { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup369: pallet_unique::Error + * Lookup328: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup372: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> - **/ - PalletUniqueSchedulerScheduledV3: { - maybeId: 'Option<[u8;16]>', - priority: 'u8', - call: 'FrameSupportScheduleMaybeHashed', - maybePeriodic: 'Option<(u32,u32)>', - origin: 'OpalRuntimeOriginCaller' - }, - /** - * Lookup373: opal_runtime::OriginCaller - **/ - OpalRuntimeOriginCaller: { - _enum: { - system: 'FrameSupportDispatchRawOrigin', - __Unused1: 'Null', - __Unused2: 'Null', - __Unused3: 'Null', - Void: 'SpCoreVoid', - __Unused5: 'Null', - __Unused6: 'Null', - __Unused7: 'Null', - __Unused8: 'Null', - __Unused9: 'Null', - __Unused10: 'Null', - __Unused11: 'Null', - __Unused12: 'Null', - __Unused13: 'Null', - __Unused14: 'Null', - __Unused15: 'Null', - __Unused16: 'Null', - __Unused17: 'Null', - __Unused18: 'Null', - __Unused19: 'Null', - __Unused20: 'Null', - __Unused21: 'Null', - __Unused22: 'Null', - __Unused23: 'Null', - __Unused24: 'Null', - __Unused25: 'Null', - __Unused26: 'Null', - __Unused27: 'Null', - __Unused28: 'Null', - __Unused29: 'Null', - __Unused30: 'Null', - __Unused31: 'Null', - __Unused32: 'Null', - __Unused33: 'Null', - __Unused34: 'Null', - __Unused35: 'Null', - __Unused36: 'Null', - __Unused37: 'Null', - __Unused38: 'Null', - __Unused39: 'Null', - __Unused40: 'Null', - __Unused41: 'Null', - __Unused42: 'Null', - __Unused43: 'Null', - __Unused44: 'Null', - __Unused45: 'Null', - __Unused46: 'Null', - __Unused47: 'Null', - __Unused48: 'Null', - __Unused49: 'Null', - __Unused50: 'Null', - PolkadotXcm: 'PalletXcmOrigin', - CumulusXcm: 'CumulusPalletXcmOrigin', - __Unused53: 'Null', - __Unused54: 'Null', - __Unused55: 'Null', - __Unused56: 'Null', - __Unused57: 'Null', - __Unused58: 'Null', - __Unused59: 'Null', - __Unused60: 'Null', - __Unused61: 'Null', - __Unused62: 'Null', - __Unused63: 'Null', - __Unused64: 'Null', - __Unused65: 'Null', - __Unused66: 'Null', - __Unused67: 'Null', - __Unused68: 'Null', - __Unused69: 'Null', - __Unused70: 'Null', - __Unused71: 'Null', - __Unused72: 'Null', - __Unused73: 'Null', - __Unused74: 'Null', - __Unused75: 'Null', - __Unused76: 'Null', - __Unused77: 'Null', - __Unused78: 'Null', - __Unused79: 'Null', - __Unused80: 'Null', - __Unused81: 'Null', - __Unused82: 'Null', - __Unused83: 'Null', - __Unused84: 'Null', - __Unused85: 'Null', - __Unused86: 'Null', - __Unused87: 'Null', - __Unused88: 'Null', - __Unused89: 'Null', - __Unused90: 'Null', - __Unused91: 'Null', - __Unused92: 'Null', - __Unused93: 'Null', - __Unused94: 'Null', - __Unused95: 'Null', - __Unused96: 'Null', - __Unused97: 'Null', - __Unused98: 'Null', - __Unused99: 'Null', - __Unused100: 'Null', - Ethereum: 'PalletEthereumRawOrigin' - } - }, - /** - * Lookup374: frame_support::dispatch::RawOrigin - **/ - FrameSupportDispatchRawOrigin: { - _enum: { - Root: 'Null', - Signed: 'AccountId32', - None: 'Null' - } - }, - /** - * Lookup375: pallet_xcm::pallet::Origin - **/ - PalletXcmOrigin: { - _enum: { - Xcm: 'XcmV1MultiLocation', - Response: 'XcmV1MultiLocation' - } - }, - /** - * Lookup376: cumulus_pallet_xcm::pallet::Origin - **/ - CumulusPalletXcmOrigin: { - _enum: { - Relay: 'Null', - SiblingParachain: 'u32' - } - }, - /** - * Lookup377: pallet_ethereum::RawOrigin - **/ - PalletEthereumRawOrigin: { - _enum: { - EthereumTransaction: 'H160' - } - }, - /** - * Lookup378: sp_core::Void - **/ - SpCoreVoid: 'Null', - /** - * Lookup379: pallet_unique_scheduler::pallet::Error - **/ - PalletUniqueSchedulerError: { - _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] - }, - /** - * Lookup380: up_data_structs::Collection + * Lookup329: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -3151,7 +2566,7 @@ export default { externalCollection: 'bool' }, /** - * Lookup381: up_data_structs::SponsorshipState + * Lookup330: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipStateAccountId32: { _enum: { @@ -3161,7 +2576,7 @@ export default { } }, /** - * Lookup382: up_data_structs::Properties + * Lookup331: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -3169,15 +2584,15 @@ export default { spaceLimit: 'u32' }, /** - * Lookup383: up_data_structs::PropertiesMap> + * Lookup332: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** - * Lookup388: up_data_structs::PropertiesMap + * Lookup337: up_data_structs::PropertiesMap **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup395: up_data_structs::CollectionStats + * Lookup344: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -3185,18 +2600,18 @@ export default { alive: 'u32' }, /** - * Lookup396: up_data_structs::TokenChild + * Lookup345: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup397: PhantomType::up_data_structs + * Lookup346: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup399: up_data_structs::TokenData> + * Lookup348: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -3204,7 +2619,7 @@ export default { pieces: 'u128' }, /** - * Lookup401: up_data_structs::RpcCollection + * Lookup350: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -3220,7 +2635,7 @@ export default { readOnly: 'bool' }, /** - * Lookup402: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup351: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -3230,7 +2645,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup403: rmrk_traits::nft::NftInfo> + * Lookup354: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -3240,14 +2655,23 @@ export default { pending: 'bool' }, /** - * Lookup405: rmrk_traits::nft::RoyaltyInfo + * Lookup355: rmrk_traits::nft::AccountIdOrCollectionNftTuple + **/ + RmrkTraitsNftAccountIdOrCollectionNftTuple: { + _enum: { + AccountId: 'AccountId32', + CollectionAndNftTuple: '(u32,u32)' + } + }, + /** + * Lookup357: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup406: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup358: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -3256,14 +2680,55 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup407: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup360: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> + **/ + RmrkTraitsResourceResourceTypes: { + _enum: { + Basic: 'RmrkTraitsResourceBasicResource', + Composable: 'RmrkTraitsResourceComposableResource', + Slot: 'RmrkTraitsResourceSlotResource' + } + }, + /** + * Lookup361: rmrk_traits::resource::BasicResource> + **/ + RmrkTraitsResourceBasicResource: { + src: 'Option', + metadata: 'Option', + license: 'Option', + thumb: 'Option' + }, + /** + * Lookup363: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> + **/ + RmrkTraitsResourceComposableResource: { + parts: 'Vec', + base: 'u32', + src: 'Option', + metadata: 'Option', + license: 'Option', + thumb: 'Option' + }, + /** + * Lookup364: rmrk_traits::resource::SlotResource> + **/ + RmrkTraitsResourceSlotResource: { + base: 'u32', + src: 'Option', + metadata: 'Option', + slot: 'u32', + license: 'Option', + thumb: 'Option' + }, + /** + * Lookup365: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup408: rmrk_traits::base::BaseInfo> + * Lookup368: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -3271,86 +2736,107 @@ export default { symbol: 'Bytes' }, /** - * Lookup409: rmrk_traits::nft::NftChild + * Lookup369: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> **/ - RmrkTraitsNftNftChild: { - collectionId: 'u32', - nftId: 'u32' + RmrkTraitsPartPartType: { + _enum: { + FixedPart: 'RmrkTraitsPartFixedPart', + SlotPart: 'RmrkTraitsPartSlotPart' + } }, /** - * Lookup411: pallet_common::pallet::Error + * Lookup371: rmrk_traits::part::FixedPart> **/ - PalletCommonError: { - _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] + RmrkTraitsPartFixedPart: { + id: 'u32', + z: 'u32', + src: 'Bytes' }, /** - * Lookup413: pallet_fungible::pallet::Error + * Lookup372: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> **/ - PalletFungibleError: { - _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] + RmrkTraitsPartSlotPart: { + id: 'u32', + equippable: 'RmrkTraitsPartEquippableList', + src: 'Bytes', + z: 'u32' }, /** - * Lookup414: pallet_refungible::ItemData + * Lookup373: rmrk_traits::part::EquippableList> **/ - PalletRefungibleItemData: { - constData: 'Bytes' + RmrkTraitsPartEquippableList: { + _enum: { + All: 'Null', + Empty: 'Null', + Custom: 'Vec' + } }, /** - * Lookup419: pallet_refungible::pallet::Error + * Lookup374: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> **/ - PalletRefungibleError: { - _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] + RmrkTraitsTheme: { + name: 'Bytes', + properties: 'Vec', + inherit: 'bool' }, /** - * Lookup420: pallet_nonfungible::ItemData> + * Lookup376: rmrk_traits::theme::ThemeProperty> **/ - PalletNonfungibleItemData: { - owner: 'PalletEvmAccountBasicCrossAccountIdRepr' + RmrkTraitsThemeThemeProperty: { + key: 'Bytes', + value: 'Bytes' }, /** - * Lookup422: up_data_structs::PropertyScope + * Lookup378: rmrk_traits::nft::NftChild **/ - UpDataStructsPropertyScope: { - _enum: ['None', 'Rmrk'] + RmrkTraitsNftNftChild: { + collectionId: 'u32', + nftId: 'u32' }, /** - * Lookup424: pallet_nonfungible::pallet::Error + * Lookup380: pallet_common::pallet::Error **/ - PalletNonfungibleError: { - _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] + PalletCommonError: { + _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup425: pallet_structure::pallet::Error + * Lookup382: pallet_fungible::pallet::Error **/ - PalletStructureError: { - _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] + PalletFungibleError: { + _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] + }, + /** + * Lookup383: pallet_nonfungible::ItemData> + **/ + PalletNonfungibleItemData: { + owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup426: pallet_rmrk_core::pallet::Error + * Lookup385: up_data_structs::PropertyScope **/ - PalletRmrkCoreError: { - _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] + UpDataStructsPropertyScope: { + _enum: ['None', 'Rmrk'] }, /** - * Lookup428: pallet_rmrk_equip::pallet::Error + * Lookup389: pallet_nonfungible::pallet::Error **/ - PalletRmrkEquipError: { - _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] + PalletNonfungibleError: { + _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup429: pallet_foreing_assets::module::Error + * Lookup390: pallet_structure::pallet::Error **/ - PalletForeingAssetsModuleError: { - _enum: ['BadLocation', 'MultiLocationExisted', 'AssetIdNotExists', 'AssetIdExisted'] + PalletStructureError: { + _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup432: pallet_evm::pallet::Error + * Lookup393: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup435: fp_rpc::TransactionStatus + * Lookup396: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -3362,11 +2848,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup437: ethbloom::Bloom + * Lookup398: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup439: ethereum::receipt::ReceiptV3 + * Lookup400: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -3376,7 +2862,7 @@ export default { } }, /** - * Lookup440: ethereum::receipt::EIP658ReceiptData + * Lookup401: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -3385,7 +2871,7 @@ export default { logs: 'Vec' }, /** - * Lookup441: ethereum::block::Block + * Lookup402: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -3393,7 +2879,7 @@ export default { ommers: 'Vec' }, /** - * Lookup442: ethereum::header::Header + * Lookup403: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -3413,23 +2899,23 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup443: ethereum_types::hash::H64 + * Lookup404: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup448: pallet_ethereum::pallet::Error + * Lookup409: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup449: pallet_evm_coder_substrate::pallet::Error + * Lookup410: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup450: up_data_structs::SponsorshipState> + * Lookup411: up_data_structs::SponsorshipState> **/ UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: { _enum: { @@ -3439,25 +2925,25 @@ export default { } }, /** - * Lookup451: pallet_evm_contract_helpers::SponsoringModeT + * Lookup412: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup453: pallet_evm_contract_helpers::pallet::Error + * Lookup414: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission', 'NoPendingSponsor'] }, /** - * Lookup454: pallet_evm_migration::pallet::Error + * Lookup415: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup456: sp_runtime::MultiSignature + * Lookup417: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3467,43 +2953,43 @@ export default { } }, /** - * Lookup457: sp_core::ed25519::Signature + * Lookup418: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup459: sp_core::sr25519::Signature + * Lookup420: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup460: sp_core::ecdsa::Signature + * Lookup421: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup463: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup424: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup464: frame_system::extensions::check_genesis::CheckGenesis + * Lookup425: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup467: frame_system::extensions::check_nonce::CheckNonce + * Lookup428: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup468: frame_system::extensions::check_weight::CheckWeight + * Lookup429: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup469: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup430: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup470: opal_runtime::Runtime + * Lookup431: unique_runtime::Runtime **/ - OpalRuntimeRuntime: 'Null', + UniqueRuntimeRuntime: 'Null', /** - * Lookup471: pallet_ethereum::FakeTransactionFinalizer + * Lookup432: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index c24acc4bdc..cf02ba1d62 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeingAssetsAssetIds, PalletForeingAssetsModuleAssetMetadata, PalletForeingAssetsModuleCall, PalletForeingAssetsModuleError, PalletForeingAssetsModuleEvent, PalletForeingAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UniqueRuntimeRuntime, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { interface InterfaceTypes { @@ -21,7 +21,6 @@ declare module '@polkadot/types/types/registry' { CumulusPalletXcmCall: CumulusPalletXcmCall; CumulusPalletXcmError: CumulusPalletXcmError; CumulusPalletXcmEvent: CumulusPalletXcmEvent; - CumulusPalletXcmOrigin: CumulusPalletXcmOrigin; CumulusPalletXcmpQueueCall: CumulusPalletXcmpQueueCall; CumulusPalletXcmpQueueError: CumulusPalletXcmpQueueError; CumulusPalletXcmpQueueEvent: CumulusPalletXcmpQueueEvent; @@ -51,10 +50,7 @@ declare module '@polkadot/types/types/registry' { EvmCoreErrorExitRevert: EvmCoreErrorExitRevert; EvmCoreErrorExitSucceed: EvmCoreErrorExitSucceed; FpRpcTransactionStatus: FpRpcTransactionStatus; - FrameSupportDispatchRawOrigin: FrameSupportDispatchRawOrigin; FrameSupportPalletId: FrameSupportPalletId; - FrameSupportScheduleLookupError: FrameSupportScheduleLookupError; - FrameSupportScheduleMaybeHashed: FrameSupportScheduleMaybeHashed; FrameSupportTokensMiscBalanceStatus: FrameSupportTokensMiscBalanceStatus; FrameSupportWeightsDispatchClass: FrameSupportWeightsDispatchClass; FrameSupportWeightsDispatchInfo: FrameSupportWeightsDispatchInfo; @@ -77,8 +73,6 @@ declare module '@polkadot/types/types/registry' { FrameSystemLimitsBlockWeights: FrameSystemLimitsBlockWeights; FrameSystemLimitsWeightsPerClass: FrameSystemLimitsWeightsPerClass; FrameSystemPhase: FrameSystemPhase; - OpalRuntimeOriginCaller: OpalRuntimeOriginCaller; - OpalRuntimeRuntime: OpalRuntimeRuntime; OrmlTokensAccountData: OrmlTokensAccountData; OrmlTokensBalanceLock: OrmlTokensBalanceLock; OrmlTokensModuleCall: OrmlTokensModuleCall; @@ -107,7 +101,6 @@ declare module '@polkadot/types/types/registry' { PalletEthereumError: PalletEthereumError; PalletEthereumEvent: PalletEthereumEvent; PalletEthereumFakeTransactionFinalizer: PalletEthereumFakeTransactionFinalizer; - PalletEthereumRawOrigin: PalletEthereumRawOrigin; PalletEvmAccountBasicCrossAccountIdRepr: PalletEvmAccountBasicCrossAccountIdRepr; PalletEvmCall: PalletEvmCall; PalletEvmCoderSubstrateError: PalletEvmCoderSubstrateError; @@ -117,24 +110,12 @@ declare module '@polkadot/types/types/registry' { PalletEvmEvent: PalletEvmEvent; PalletEvmMigrationCall: PalletEvmMigrationCall; PalletEvmMigrationError: PalletEvmMigrationError; - PalletForeingAssetsAssetIds: PalletForeingAssetsAssetIds; - PalletForeingAssetsModuleAssetMetadata: PalletForeingAssetsModuleAssetMetadata; - PalletForeingAssetsModuleCall: PalletForeingAssetsModuleCall; - PalletForeingAssetsModuleError: PalletForeingAssetsModuleError; - PalletForeingAssetsModuleEvent: PalletForeingAssetsModuleEvent; - PalletForeingAssetsNativeCurrency: PalletForeingAssetsNativeCurrency; + PalletForeignAssetsAssetIds: PalletForeignAssetsAssetIds; + PalletForeignAssetsNativeCurrency: PalletForeignAssetsNativeCurrency; PalletFungibleError: PalletFungibleError; PalletInflationCall: PalletInflationCall; PalletNonfungibleError: PalletNonfungibleError; PalletNonfungibleItemData: PalletNonfungibleItemData; - PalletRefungibleError: PalletRefungibleError; - PalletRefungibleItemData: PalletRefungibleItemData; - PalletRmrkCoreCall: PalletRmrkCoreCall; - PalletRmrkCoreError: PalletRmrkCoreError; - PalletRmrkCoreEvent: PalletRmrkCoreEvent; - PalletRmrkEquipCall: PalletRmrkEquipCall; - PalletRmrkEquipError: PalletRmrkEquipError; - PalletRmrkEquipEvent: PalletRmrkEquipEvent; PalletStructureCall: PalletStructureCall; PalletStructureError: PalletStructureError; PalletStructureEvent: PalletStructureEvent; @@ -153,14 +134,9 @@ declare module '@polkadot/types/types/registry' { PalletUniqueCall: PalletUniqueCall; PalletUniqueError: PalletUniqueError; PalletUniqueRawEvent: PalletUniqueRawEvent; - PalletUniqueSchedulerCall: PalletUniqueSchedulerCall; - PalletUniqueSchedulerError: PalletUniqueSchedulerError; - PalletUniqueSchedulerEvent: PalletUniqueSchedulerEvent; - PalletUniqueSchedulerScheduledV3: PalletUniqueSchedulerScheduledV3; PalletXcmCall: PalletXcmCall; PalletXcmError: PalletXcmError; PalletXcmEvent: PalletXcmEvent; - PalletXcmOrigin: PalletXcmOrigin; PhantomTypeUpDataStructs: PhantomTypeUpDataStructs; PolkadotCorePrimitivesInboundDownwardMessage: PolkadotCorePrimitivesInboundDownwardMessage; PolkadotCorePrimitivesInboundHrmpMessage: PolkadotCorePrimitivesInboundHrmpMessage; @@ -191,7 +167,6 @@ declare module '@polkadot/types/types/registry' { SpCoreEcdsaSignature: SpCoreEcdsaSignature; SpCoreEd25519Signature: SpCoreEd25519Signature; SpCoreSr25519Signature: SpCoreSr25519Signature; - SpCoreVoid: SpCoreVoid; SpRuntimeArithmeticError: SpRuntimeArithmeticError; SpRuntimeDigest: SpRuntimeDigest; SpRuntimeDigestDigestItem: SpRuntimeDigestDigestItem; @@ -202,6 +177,7 @@ declare module '@polkadot/types/types/registry' { SpRuntimeTransactionalError: SpRuntimeTransactionalError; SpTrieStorageProof: SpTrieStorageProof; SpVersionRuntimeVersion: SpVersionRuntimeVersion; + UniqueRuntimeRuntime: UniqueRuntimeRuntime; UpDataStructsAccessMode: UpDataStructsAccessMode; UpDataStructsCollection: UpDataStructsCollection; UpDataStructsCollectionLimits: UpDataStructsCollectionLimits; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 72d07d97ad..ce003cc17b 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -523,38 +523,38 @@ declare module '@polkadot/types/lookup' { interface OrmlTokensModuleEvent extends Enum { readonly isEndowed: boolean; readonly asEndowed: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly amount: u128; } & Struct; readonly isDustLost: boolean; readonly asDustLost: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly amount: u128; } & Struct; readonly isTransfer: boolean; readonly asTransfer: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly from: AccountId32; readonly to: AccountId32; readonly amount: u128; } & Struct; readonly isReserved: boolean; readonly asReserved: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly amount: u128; } & Struct; readonly isUnreserved: boolean; readonly asUnreserved: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly amount: u128; } & Struct; readonly isReserveRepatriated: boolean; readonly asReserveRepatriated: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly from: AccountId32; readonly to: AccountId32; readonly amount: u128; @@ -562,62 +562,62 @@ declare module '@polkadot/types/lookup' { } & Struct; readonly isBalanceSet: boolean; readonly asBalanceSet: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly free: u128; readonly reserved: u128; } & Struct; readonly isTotalIssuanceSet: boolean; readonly asTotalIssuanceSet: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly amount: u128; } & Struct; readonly isWithdrawn: boolean; readonly asWithdrawn: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly amount: u128; } & Struct; readonly isSlashed: boolean; readonly asSlashed: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly freeAmount: u128; readonly reservedAmount: u128; } & Struct; readonly isDeposited: boolean; readonly asDeposited: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly amount: u128; } & Struct; readonly isLockSet: boolean; readonly asLockSet: { readonly lockId: U8aFixed; - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; readonly amount: u128; } & Struct; readonly isLockRemoved: boolean; readonly asLockRemoved: { readonly lockId: U8aFixed; - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly who: AccountId32; } & Struct; readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'BalanceSet' | 'TotalIssuanceSet' | 'Withdrawn' | 'Slashed' | 'Deposited' | 'LockSet' | 'LockRemoved'; } - /** @name PalletForeingAssetsAssetIds (59) */ - interface PalletForeingAssetsAssetIds extends Enum { + /** @name PalletForeignAssetsAssetIds (59) */ + interface PalletForeignAssetsAssetIds extends Enum { readonly isForeignAssetId: boolean; readonly asForeignAssetId: u32; readonly isNativeAssetId: boolean; - readonly asNativeAssetId: PalletForeingAssetsNativeCurrency; + readonly asNativeAssetId: PalletForeignAssetsNativeCurrency; readonly type: 'ForeignAssetId' | 'NativeAssetId'; } - /** @name PalletForeingAssetsNativeCurrency (60) */ - interface PalletForeingAssetsNativeCurrency extends Enum { + /** @name PalletForeignAssetsNativeCurrency (60) */ + interface PalletForeignAssetsNativeCurrency extends Enum { readonly isHere: boolean; readonly isParent: boolean; readonly type: 'Here' | 'Parent'; @@ -1132,41 +1132,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Substrate' | 'Ethereum'; } - /** @name PalletUniqueSchedulerEvent (92) */ - interface PalletUniqueSchedulerEvent extends Enum { - readonly isScheduled: boolean; - readonly asScheduled: { - readonly when: u32; - readonly index: u32; - } & Struct; - readonly isCanceled: boolean; - readonly asCanceled: { - readonly when: u32; - readonly index: u32; - } & Struct; - readonly isDispatched: boolean; - readonly asDispatched: { - readonly task: ITuple<[u32, u32]>; - readonly id: Option; - readonly result: Result; - } & Struct; - readonly isCallLookupFailed: boolean; - readonly asCallLookupFailed: { - readonly task: ITuple<[u32, u32]>; - readonly id: Option; - readonly error: FrameSupportScheduleLookupError; - } & Struct; - readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; - } - - /** @name FrameSupportScheduleLookupError (95) */ - interface FrameSupportScheduleLookupError extends Enum { - readonly isUnknown: boolean; - readonly isBadFormat: boolean; - readonly type: 'Unknown' | 'BadFormat'; - } - - /** @name PalletCommonEvent (96) */ + /** @name PalletCommonEvent (92) */ interface PalletCommonEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; @@ -1193,163 +1159,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; } - /** @name PalletStructureEvent (99) */ + /** @name PalletStructureEvent (95) */ interface PalletStructureEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: Result; readonly type: 'Executed'; } - /** @name PalletRmrkCoreEvent (100) */ - interface PalletRmrkCoreEvent extends Enum { - readonly isCollectionCreated: boolean; - readonly asCollectionCreated: { - readonly issuer: AccountId32; - readonly collectionId: u32; - } & Struct; - readonly isCollectionDestroyed: boolean; - readonly asCollectionDestroyed: { - readonly issuer: AccountId32; - readonly collectionId: u32; - } & Struct; - readonly isIssuerChanged: boolean; - readonly asIssuerChanged: { - readonly oldIssuer: AccountId32; - readonly newIssuer: AccountId32; - readonly collectionId: u32; - } & Struct; - readonly isCollectionLocked: boolean; - readonly asCollectionLocked: { - readonly issuer: AccountId32; - readonly collectionId: u32; - } & Struct; - readonly isNftMinted: boolean; - readonly asNftMinted: { - readonly owner: AccountId32; - readonly collectionId: u32; - readonly nftId: u32; - } & Struct; - readonly isNftBurned: boolean; - readonly asNftBurned: { - readonly owner: AccountId32; - readonly nftId: u32; - } & Struct; - readonly isNftSent: boolean; - readonly asNftSent: { - readonly sender: AccountId32; - readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; - readonly collectionId: u32; - readonly nftId: u32; - readonly approvalRequired: bool; - } & Struct; - readonly isNftAccepted: boolean; - readonly asNftAccepted: { - readonly sender: AccountId32; - readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; - readonly collectionId: u32; - readonly nftId: u32; - } & Struct; - readonly isNftRejected: boolean; - readonly asNftRejected: { - readonly sender: AccountId32; - readonly collectionId: u32; - readonly nftId: u32; - } & Struct; - readonly isPropertySet: boolean; - readonly asPropertySet: { - readonly collectionId: u32; - readonly maybeNftId: Option; - readonly key: Bytes; - readonly value: Bytes; - } & Struct; - readonly isResourceAdded: boolean; - readonly asResourceAdded: { - readonly nftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isResourceRemoval: boolean; - readonly asResourceRemoval: { - readonly nftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isResourceAccepted: boolean; - readonly asResourceAccepted: { - readonly nftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isResourceRemovalAccepted: boolean; - readonly asResourceRemovalAccepted: { - readonly nftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isPrioritySet: boolean; - readonly asPrioritySet: { - readonly collectionId: u32; - readonly nftId: u32; - } & Struct; - readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; - } - - /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (101) */ - interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { - readonly isAccountId: boolean; - readonly asAccountId: AccountId32; - readonly isCollectionAndNftTuple: boolean; - readonly asCollectionAndNftTuple: ITuple<[u32, u32]>; - readonly type: 'AccountId' | 'CollectionAndNftTuple'; - } - - /** @name PalletRmrkEquipEvent (106) */ - interface PalletRmrkEquipEvent extends Enum { - readonly isBaseCreated: boolean; - readonly asBaseCreated: { - readonly issuer: AccountId32; - readonly baseId: u32; - } & Struct; - readonly isEquippablesUpdated: boolean; - readonly asEquippablesUpdated: { - readonly baseId: u32; - readonly slotId: u32; - } & Struct; - readonly type: 'BaseCreated' | 'EquippablesUpdated'; - } - - /** @name PalletForeingAssetsModuleEvent (107) */ - interface PalletForeingAssetsModuleEvent extends Enum { - readonly isForeignAssetRegistered: boolean; - readonly asForeignAssetRegistered: { - readonly assetId: u32; - readonly assetAddress: XcmV1MultiLocation; - readonly metadata: PalletForeingAssetsModuleAssetMetadata; - } & Struct; - readonly isForeignAssetUpdated: boolean; - readonly asForeignAssetUpdated: { - readonly assetId: u32; - readonly assetAddress: XcmV1MultiLocation; - readonly metadata: PalletForeingAssetsModuleAssetMetadata; - } & Struct; - readonly isAssetRegistered: boolean; - readonly asAssetRegistered: { - readonly assetId: PalletForeingAssetsAssetIds; - readonly metadata: PalletForeingAssetsModuleAssetMetadata; - } & Struct; - readonly isAssetUpdated: boolean; - readonly asAssetUpdated: { - readonly assetId: PalletForeingAssetsAssetIds; - readonly metadata: PalletForeingAssetsModuleAssetMetadata; - } & Struct; - readonly type: 'ForeignAssetRegistered' | 'ForeignAssetUpdated' | 'AssetRegistered' | 'AssetUpdated'; - } - - /** @name PalletForeingAssetsModuleAssetMetadata (108) */ - interface PalletForeingAssetsModuleAssetMetadata extends Struct { - readonly name: Bytes; - readonly symbol: Bytes; - readonly decimals: u8; - readonly minimalBalance: u128; - } - - /** @name PalletEvmEvent (109) */ + /** @name PalletEvmEvent (96) */ interface PalletEvmEvent extends Enum { readonly isLog: boolean; readonly asLog: EthereumLog; @@ -1368,21 +1185,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; } - /** @name EthereumLog (110) */ + /** @name EthereumLog (97) */ interface EthereumLog extends Struct { readonly address: H160; readonly topics: Vec; readonly data: Bytes; } - /** @name PalletEthereumEvent (114) */ + /** @name PalletEthereumEvent (101) */ interface PalletEthereumEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; readonly type: 'Executed'; } - /** @name EvmCoreErrorExitReason (115) */ + /** @name EvmCoreErrorExitReason (102) */ interface EvmCoreErrorExitReason extends Enum { readonly isSucceed: boolean; readonly asSucceed: EvmCoreErrorExitSucceed; @@ -1395,7 +1212,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; } - /** @name EvmCoreErrorExitSucceed (116) */ + /** @name EvmCoreErrorExitSucceed (103) */ interface EvmCoreErrorExitSucceed extends Enum { readonly isStopped: boolean; readonly isReturned: boolean; @@ -1403,7 +1220,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Stopped' | 'Returned' | 'Suicided'; } - /** @name EvmCoreErrorExitError (117) */ + /** @name EvmCoreErrorExitError (104) */ interface EvmCoreErrorExitError extends Enum { readonly isStackUnderflow: boolean; readonly isStackOverflow: boolean; @@ -1424,13 +1241,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; } - /** @name EvmCoreErrorExitRevert (120) */ + /** @name EvmCoreErrorExitRevert (107) */ interface EvmCoreErrorExitRevert extends Enum { readonly isReverted: boolean; readonly type: 'Reverted'; } - /** @name EvmCoreErrorExitFatal (121) */ + /** @name EvmCoreErrorExitFatal (108) */ interface EvmCoreErrorExitFatal extends Enum { readonly isNotSupported: boolean; readonly isUnhandledInterrupt: boolean; @@ -1441,7 +1258,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; } - /** @name FrameSystemPhase (122) */ + /** @name FrameSystemPhase (109) */ interface FrameSystemPhase extends Enum { readonly isApplyExtrinsic: boolean; readonly asApplyExtrinsic: u32; @@ -1450,13 +1267,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } - /** @name FrameSystemLastRuntimeUpgradeInfo (124) */ + /** @name FrameSystemLastRuntimeUpgradeInfo (112) */ interface FrameSystemLastRuntimeUpgradeInfo extends Struct { readonly specVersion: Compact; readonly specName: Text; } - /** @name FrameSystemCall (125) */ + /** @name FrameSystemCall (114) */ interface FrameSystemCall extends Enum { readonly isFillBlock: boolean; readonly asFillBlock: { @@ -1498,21 +1315,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent'; } - /** @name FrameSystemLimitsBlockWeights (130) */ + /** @name FrameSystemLimitsBlockWeights (119) */ interface FrameSystemLimitsBlockWeights extends Struct { readonly baseBlock: u64; readonly maxBlock: u64; readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; } - /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (131) */ + /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (120) */ interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { readonly normal: FrameSystemLimitsWeightsPerClass; readonly operational: FrameSystemLimitsWeightsPerClass; readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name FrameSystemLimitsWeightsPerClass (132) */ + /** @name FrameSystemLimitsWeightsPerClass (121) */ interface FrameSystemLimitsWeightsPerClass extends Struct { readonly baseExtrinsic: u64; readonly maxExtrinsic: Option; @@ -1520,25 +1337,25 @@ declare module '@polkadot/types/lookup' { readonly reserved: Option; } - /** @name FrameSystemLimitsBlockLength (134) */ + /** @name FrameSystemLimitsBlockLength (123) */ interface FrameSystemLimitsBlockLength extends Struct { readonly max: FrameSupportWeightsPerDispatchClassU32; } - /** @name FrameSupportWeightsPerDispatchClassU32 (135) */ + /** @name FrameSupportWeightsPerDispatchClassU32 (124) */ interface FrameSupportWeightsPerDispatchClassU32 extends Struct { readonly normal: u32; readonly operational: u32; readonly mandatory: u32; } - /** @name FrameSupportWeightsRuntimeDbWeight (136) */ + /** @name FrameSupportWeightsRuntimeDbWeight (125) */ interface FrameSupportWeightsRuntimeDbWeight extends Struct { readonly read: u64; readonly write: u64; } - /** @name SpVersionRuntimeVersion (137) */ + /** @name SpVersionRuntimeVersion (126) */ interface SpVersionRuntimeVersion extends Struct { readonly specName: Text; readonly implName: Text; @@ -1550,7 +1367,7 @@ declare module '@polkadot/types/lookup' { readonly stateVersion: u8; } - /** @name FrameSystemError (142) */ + /** @name FrameSystemError (131) */ interface FrameSystemError extends Enum { readonly isInvalidSpecName: boolean; readonly isSpecVersionNeedsToIncrease: boolean; @@ -1561,7 +1378,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name PolkadotPrimitivesV2PersistedValidationData (143) */ + /** @name PolkadotPrimitivesV2PersistedValidationData (132) */ interface PolkadotPrimitivesV2PersistedValidationData extends Struct { readonly parentHead: Bytes; readonly relayParentNumber: u32; @@ -1569,18 +1386,18 @@ declare module '@polkadot/types/lookup' { readonly maxPovSize: u32; } - /** @name PolkadotPrimitivesV2UpgradeRestriction (146) */ + /** @name PolkadotPrimitivesV2UpgradeRestriction (135) */ interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { readonly isPresent: boolean; readonly type: 'Present'; } - /** @name SpTrieStorageProof (147) */ + /** @name SpTrieStorageProof (136) */ interface SpTrieStorageProof extends Struct { readonly trieNodes: BTreeSet; } - /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (149) */ + /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (138) */ interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { readonly dmqMqcHead: H256; readonly relayDispatchQueueSize: ITuple<[u32, u32]>; @@ -1588,7 +1405,7 @@ declare module '@polkadot/types/lookup' { readonly egressChannels: Vec>; } - /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (152) */ + /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (141) */ interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { readonly maxCapacity: u32; readonly maxTotalSize: u32; @@ -1598,7 +1415,7 @@ declare module '@polkadot/types/lookup' { readonly mqcHead: Option; } - /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (153) */ + /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (142) */ interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { readonly maxCodeSize: u32; readonly maxHeadDataSize: u32; @@ -1611,13 +1428,13 @@ declare module '@polkadot/types/lookup' { readonly validationUpgradeDelay: u32; } - /** @name PolkadotCorePrimitivesOutboundHrmpMessage (159) */ + /** @name PolkadotCorePrimitivesOutboundHrmpMessage (148) */ interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { readonly recipient: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemCall (160) */ + /** @name CumulusPalletParachainSystemCall (149) */ interface CumulusPalletParachainSystemCall extends Enum { readonly isSetValidationData: boolean; readonly asSetValidationData: { @@ -1638,7 +1455,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade'; } - /** @name CumulusPrimitivesParachainInherentParachainInherentData (161) */ + /** @name CumulusPrimitivesParachainInherentParachainInherentData (150) */ interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { readonly validationData: PolkadotPrimitivesV2PersistedValidationData; readonly relayChainState: SpTrieStorageProof; @@ -1646,19 +1463,19 @@ declare module '@polkadot/types/lookup' { readonly horizontalMessages: BTreeMap>; } - /** @name PolkadotCorePrimitivesInboundDownwardMessage (163) */ + /** @name PolkadotCorePrimitivesInboundDownwardMessage (152) */ interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { readonly sentAt: u32; readonly msg: Bytes; } - /** @name PolkadotCorePrimitivesInboundHrmpMessage (166) */ + /** @name PolkadotCorePrimitivesInboundHrmpMessage (155) */ interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { readonly sentAt: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemError (169) */ + /** @name CumulusPalletParachainSystemError (158) */ interface CumulusPalletParachainSystemError extends Enum { readonly isOverlappingUpgrades: boolean; readonly isProhibitedByPolkadot: boolean; @@ -1671,14 +1488,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized'; } - /** @name PalletBalancesBalanceLock (171) */ + /** @name PalletBalancesBalanceLock (160) */ interface PalletBalancesBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; readonly reasons: PalletBalancesReasons; } - /** @name PalletBalancesReasons (172) */ + /** @name PalletBalancesReasons (161) */ interface PalletBalancesReasons extends Enum { readonly isFee: boolean; readonly isMisc: boolean; @@ -1686,20 +1503,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'Fee' | 'Misc' | 'All'; } - /** @name PalletBalancesReserveData (175) */ + /** @name PalletBalancesReserveData (164) */ interface PalletBalancesReserveData extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name PalletBalancesReleases (177) */ + /** @name PalletBalancesReleases (166) */ interface PalletBalancesReleases extends Enum { readonly isV100: boolean; readonly isV200: boolean; readonly type: 'V100' | 'V200'; } - /** @name PalletBalancesCall (178) */ + /** @name PalletBalancesCall (167) */ interface PalletBalancesCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1736,7 +1553,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; } - /** @name PalletBalancesError (181) */ + /** @name PalletBalancesError (170) */ interface PalletBalancesError extends Enum { readonly isVestingBalance: boolean; readonly isLiquidityRestrictions: boolean; @@ -1749,7 +1566,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves'; } - /** @name PalletTimestampCall (183) */ + /** @name PalletTimestampCall (172) */ interface PalletTimestampCall extends Enum { readonly isSet: boolean; readonly asSet: { @@ -1758,14 +1575,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Set'; } - /** @name PalletTransactionPaymentReleases (185) */ + /** @name PalletTransactionPaymentReleases (174) */ interface PalletTransactionPaymentReleases extends Enum { readonly isV1Ancient: boolean; readonly isV2: boolean; readonly type: 'V1Ancient' | 'V2'; } - /** @name PalletTreasuryProposal (186) */ + /** @name PalletTreasuryProposal (175) */ interface PalletTreasuryProposal extends Struct { readonly proposer: AccountId32; readonly value: u128; @@ -1773,7 +1590,7 @@ declare module '@polkadot/types/lookup' { readonly bond: u128; } - /** @name PalletTreasuryCall (189) */ + /** @name PalletTreasuryCall (178) */ interface PalletTreasuryCall extends Enum { readonly isProposeSpend: boolean; readonly asProposeSpend: { @@ -1800,10 +1617,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval'; } - /** @name FrameSupportPalletId (192) */ + /** @name FrameSupportPalletId (181) */ interface FrameSupportPalletId extends U8aFixed {} - /** @name PalletTreasuryError (193) */ + /** @name PalletTreasuryError (182) */ interface PalletTreasuryError extends Enum { readonly isInsufficientProposersBalance: boolean; readonly isInvalidIndex: boolean; @@ -1813,7 +1630,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved'; } - /** @name PalletSudoCall (194) */ + /** @name PalletSudoCall (183) */ interface PalletSudoCall extends Enum { readonly isSudo: boolean; readonly asSudo: { @@ -1836,7 +1653,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs'; } - /** @name OrmlVestingModuleCall (196) */ + /** @name OrmlVestingModuleCall (185) */ interface OrmlVestingModuleCall extends Enum { readonly isClaim: boolean; readonly isVestedTransfer: boolean; @@ -1856,11 +1673,11 @@ declare module '@polkadot/types/lookup' { readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor'; } - /** @name OrmlXtokensModuleCall (198) */ + /** @name OrmlXtokensModuleCall (187) */ interface OrmlXtokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly amount: u128; readonly dest: XcmVersionedMultiLocation; readonly destWeight: u64; @@ -1873,7 +1690,7 @@ declare module '@polkadot/types/lookup' { } & Struct; readonly isTransferWithFee: boolean; readonly asTransferWithFee: { - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly amount: u128; readonly fee: u128; readonly dest: XcmVersionedMultiLocation; @@ -1888,7 +1705,7 @@ declare module '@polkadot/types/lookup' { } & Struct; readonly isTransferMulticurrencies: boolean; readonly asTransferMulticurrencies: { - readonly currencies: Vec>; + readonly currencies: Vec>; readonly feeItem: u32; readonly dest: XcmVersionedMultiLocation; readonly destWeight: u64; @@ -1903,7 +1720,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'TransferMultiasset' | 'TransferWithFee' | 'TransferMultiassetWithFee' | 'TransferMulticurrencies' | 'TransferMultiassets'; } - /** @name XcmVersionedMultiAsset (199) */ + /** @name XcmVersionedMultiAsset (188) */ interface XcmVersionedMultiAsset extends Enum { readonly isV0: boolean; readonly asV0: XcmV0MultiAsset; @@ -1912,44 +1729,44 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1'; } - /** @name OrmlTokensModuleCall (202) */ + /** @name OrmlTokensModuleCall (191) */ interface OrmlTokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { readonly dest: MultiAddress; - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly amount: Compact; } & Struct; readonly isTransferAll: boolean; readonly asTransferAll: { readonly dest: MultiAddress; - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly keepAlive: bool; } & Struct; readonly isTransferKeepAlive: boolean; readonly asTransferKeepAlive: { readonly dest: MultiAddress; - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly amount: Compact; } & Struct; readonly isForceTransfer: boolean; readonly asForceTransfer: { readonly source: MultiAddress; readonly dest: MultiAddress; - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly amount: Compact; } & Struct; readonly isSetBalance: boolean; readonly asSetBalance: { readonly who: MultiAddress; - readonly currencyId: PalletForeingAssetsAssetIds; + readonly currencyId: PalletForeignAssetsAssetIds; readonly newFree: Compact; readonly newReserved: Compact; } & Struct; readonly type: 'Transfer' | 'TransferAll' | 'TransferKeepAlive' | 'ForceTransfer' | 'SetBalance'; } - /** @name CumulusPalletXcmpQueueCall (203) */ + /** @name CumulusPalletXcmpQueueCall (192) */ interface CumulusPalletXcmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { @@ -1985,7 +1802,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight'; } - /** @name PalletXcmCall (204) */ + /** @name PalletXcmCall (193) */ interface PalletXcmCall extends Enum { readonly isSend: boolean; readonly asSend: { @@ -2047,7 +1864,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets'; } - /** @name XcmVersionedXcm (205) */ + /** @name XcmVersionedXcm (194) */ interface XcmVersionedXcm extends Enum { readonly isV0: boolean; readonly asV0: XcmV0Xcm; @@ -2058,7 +1875,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1' | 'V2'; } - /** @name XcmV0Xcm (206) */ + /** @name XcmV0Xcm (195) */ interface XcmV0Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -2121,7 +1938,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom'; } - /** @name XcmV0Order (208) */ + /** @name XcmV0Order (197) */ interface XcmV0Order extends Enum { readonly isNull: boolean; readonly isDepositAsset: boolean; @@ -2169,14 +1986,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV0Response (210) */ + /** @name XcmV0Response (199) */ interface XcmV0Response extends Enum { readonly isAssets: boolean; readonly asAssets: Vec; readonly type: 'Assets'; } - /** @name XcmV1Xcm (211) */ + /** @name XcmV1Xcm (200) */ interface XcmV1Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -2245,7 +2062,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion'; } - /** @name XcmV1Order (213) */ + /** @name XcmV1Order (202) */ interface XcmV1Order extends Enum { readonly isNoop: boolean; readonly isDepositAsset: boolean; @@ -2295,7 +2112,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV1Response (215) */ + /** @name XcmV1Response (204) */ interface XcmV1Response extends Enum { readonly isAssets: boolean; readonly asAssets: XcmV1MultiassetMultiAssets; @@ -2304,10 +2121,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'Assets' | 'Version'; } - /** @name CumulusPalletXcmCall (229) */ + /** @name CumulusPalletXcmCall (219) */ type CumulusPalletXcmCall = Null; - /** @name CumulusPalletDmpQueueCall (230) */ + /** @name CumulusPalletDmpQueueCall (220) */ interface CumulusPalletDmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { @@ -2317,7 +2134,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight'; } - /** @name PalletInflationCall (231) */ + /** @name PalletInflationCall (221) */ interface PalletInflationCall extends Enum { readonly isStartInflation: boolean; readonly asStartInflation: { @@ -2326,7 +2143,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'StartInflation'; } - /** @name PalletUniqueCall (232) */ + /** @name PalletUniqueCall (222) */ interface PalletUniqueCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -2484,7 +2301,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; } - /** @name UpDataStructsCollectionMode (237) */ + /** @name UpDataStructsCollectionMode (227) */ interface UpDataStructsCollectionMode extends Enum { readonly isNft: boolean; readonly isFungible: boolean; @@ -2493,7 +2310,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateCollectionData (238) */ + /** @name UpDataStructsCreateCollectionData (228) */ interface UpDataStructsCreateCollectionData extends Struct { readonly mode: UpDataStructsCollectionMode; readonly access: Option; @@ -2507,14 +2324,14 @@ declare module '@polkadot/types/lookup' { readonly properties: Vec; } - /** @name UpDataStructsAccessMode (240) */ + /** @name UpDataStructsAccessMode (230) */ interface UpDataStructsAccessMode extends Enum { readonly isNormal: boolean; readonly isAllowList: boolean; readonly type: 'Normal' | 'AllowList'; } - /** @name UpDataStructsCollectionLimits (242) */ + /** @name UpDataStructsCollectionLimits (232) */ interface UpDataStructsCollectionLimits extends Struct { readonly accountTokenOwnershipLimit: Option; readonly sponsoredDataSize: Option; @@ -2527,7 +2344,7 @@ declare module '@polkadot/types/lookup' { readonly transfersEnabled: Option; } - /** @name UpDataStructsSponsoringRateLimit (244) */ + /** @name UpDataStructsSponsoringRateLimit (234) */ interface UpDataStructsSponsoringRateLimit extends Enum { readonly isSponsoringDisabled: boolean; readonly isBlocks: boolean; @@ -2535,43 +2352,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'SponsoringDisabled' | 'Blocks'; } - /** @name UpDataStructsCollectionPermissions (247) */ + /** @name UpDataStructsCollectionPermissions (237) */ interface UpDataStructsCollectionPermissions extends Struct { readonly access: Option; readonly mintMode: Option; readonly nesting: Option; } - /** @name UpDataStructsNestingPermissions (249) */ + /** @name UpDataStructsNestingPermissions (239) */ interface UpDataStructsNestingPermissions extends Struct { readonly tokenOwner: bool; readonly collectionAdmin: bool; readonly restricted: Option; } - /** @name UpDataStructsOwnerRestrictedSet (251) */ + /** @name UpDataStructsOwnerRestrictedSet (241) */ interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} - /** @name UpDataStructsPropertyKeyPermission (256) */ + /** @name UpDataStructsPropertyKeyPermission (246) */ interface UpDataStructsPropertyKeyPermission extends Struct { readonly key: Bytes; readonly permission: UpDataStructsPropertyPermission; } - /** @name UpDataStructsPropertyPermission (257) */ + /** @name UpDataStructsPropertyPermission (247) */ interface UpDataStructsPropertyPermission extends Struct { readonly mutable: bool; readonly collectionAdmin: bool; readonly tokenOwner: bool; } - /** @name UpDataStructsProperty (260) */ + /** @name UpDataStructsProperty (250) */ interface UpDataStructsProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name UpDataStructsCreateItemData (263) */ + /** @name UpDataStructsCreateItemData (253) */ interface UpDataStructsCreateItemData extends Enum { readonly isNft: boolean; readonly asNft: UpDataStructsCreateNftData; @@ -2582,23 +2399,23 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateNftData (264) */ + /** @name UpDataStructsCreateNftData (254) */ interface UpDataStructsCreateNftData extends Struct { readonly properties: Vec; } - /** @name UpDataStructsCreateFungibleData (265) */ + /** @name UpDataStructsCreateFungibleData (255) */ interface UpDataStructsCreateFungibleData extends Struct { readonly value: u128; } - /** @name UpDataStructsCreateReFungibleData (266) */ + /** @name UpDataStructsCreateReFungibleData (256) */ interface UpDataStructsCreateReFungibleData extends Struct { readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateItemExData (269) */ + /** @name UpDataStructsCreateItemExData (259) */ interface UpDataStructsCreateItemExData extends Enum { readonly isNft: boolean; readonly asNft: Vec; @@ -2611,60 +2428,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; } - /** @name UpDataStructsCreateNftExData (271) */ + /** @name UpDataStructsCreateNftExData (261) */ interface UpDataStructsCreateNftExData extends Struct { readonly properties: Vec; readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsCreateRefungibleExSingleOwner (278) */ + /** @name UpDataStructsCreateRefungibleExSingleOwner (268) */ interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { readonly user: PalletEvmAccountBasicCrossAccountIdRepr; readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateRefungibleExMultipleOwners (280) */ + /** @name UpDataStructsCreateRefungibleExMultipleOwners (270) */ interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { readonly users: BTreeMap; readonly properties: Vec; } - /** @name PalletUniqueSchedulerCall (281) */ - interface PalletUniqueSchedulerCall extends Enum { - readonly isScheduleNamed: boolean; - readonly asScheduleNamed: { - readonly id: U8aFixed; - readonly when: u32; - readonly maybePeriodic: Option>; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; - } & Struct; - readonly isCancelNamed: boolean; - readonly asCancelNamed: { - readonly id: U8aFixed; - } & Struct; - readonly isScheduleNamedAfter: boolean; - readonly asScheduleNamedAfter: { - readonly id: U8aFixed; - readonly after: u32; - readonly maybePeriodic: Option>; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; - } & Struct; - readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; - } - - /** @name FrameSupportScheduleMaybeHashed (283) */ - interface FrameSupportScheduleMaybeHashed extends Enum { - readonly isValue: boolean; - readonly asValue: Call; - readonly isHash: boolean; - readonly asHash: H256; - readonly type: 'Value' | 'Hash'; - } - - /** @name PalletConfigurationCall (284) */ + /** @name PalletConfigurationCall (271) */ interface PalletConfigurationCall extends Enum { readonly isSetWeightToFeeCoefficientOverride: boolean; readonly asSetWeightToFeeCoefficientOverride: { @@ -2677,243 +2460,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride'; } - /** @name PalletTemplateTransactionPaymentCall (285) */ + /** @name PalletTemplateTransactionPaymentCall (272) */ type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletStructureCall (286) */ + /** @name PalletStructureCall (273) */ type PalletStructureCall = Null; - /** @name PalletRmrkCoreCall (287) */ - interface PalletRmrkCoreCall extends Enum { - readonly isCreateCollection: boolean; - readonly asCreateCollection: { - readonly metadata: Bytes; - readonly max: Option; - readonly symbol: Bytes; - } & Struct; - readonly isDestroyCollection: boolean; - readonly asDestroyCollection: { - readonly collectionId: u32; - } & Struct; - readonly isChangeCollectionIssuer: boolean; - readonly asChangeCollectionIssuer: { - readonly collectionId: u32; - readonly newIssuer: MultiAddress; - } & Struct; - readonly isLockCollection: boolean; - readonly asLockCollection: { - readonly collectionId: u32; - } & Struct; - readonly isMintNft: boolean; - readonly asMintNft: { - readonly owner: Option; - readonly collectionId: u32; - readonly recipient: Option; - readonly royaltyAmount: Option; - readonly metadata: Bytes; - readonly transferable: bool; - readonly resources: Option>; - } & Struct; - readonly isBurnNft: boolean; - readonly asBurnNft: { - readonly collectionId: u32; - readonly nftId: u32; - readonly maxBurns: u32; - } & Struct; - readonly isSend: boolean; - readonly asSend: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; - } & Struct; - readonly isAcceptNft: boolean; - readonly asAcceptNft: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; - } & Struct; - readonly isRejectNft: boolean; - readonly asRejectNft: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - } & Struct; - readonly isAcceptResource: boolean; - readonly asAcceptResource: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isAcceptResourceRemoval: boolean; - readonly asAcceptResourceRemoval: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly resourceId: u32; - } & Struct; - readonly isSetProperty: boolean; - readonly asSetProperty: { - readonly rmrkCollectionId: Compact; - readonly maybeNftId: Option; - readonly key: Bytes; - readonly value: Bytes; - } & Struct; - readonly isSetPriority: boolean; - readonly asSetPriority: { - readonly rmrkCollectionId: u32; - readonly rmrkNftId: u32; - readonly priorities: Vec; - } & Struct; - readonly isAddBasicResource: boolean; - readonly asAddBasicResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resource: RmrkTraitsResourceBasicResource; - } & Struct; - readonly isAddComposableResource: boolean; - readonly asAddComposableResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resource: RmrkTraitsResourceComposableResource; - } & Struct; - readonly isAddSlotResource: boolean; - readonly asAddSlotResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resource: RmrkTraitsResourceSlotResource; - } & Struct; - readonly isRemoveResource: boolean; - readonly asRemoveResource: { - readonly rmrkCollectionId: u32; - readonly nftId: u32; - readonly resourceId: u32; - } & Struct; - readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; - } - - /** @name RmrkTraitsResourceResourceTypes (293) */ - interface RmrkTraitsResourceResourceTypes extends Enum { - readonly isBasic: boolean; - readonly asBasic: RmrkTraitsResourceBasicResource; - readonly isComposable: boolean; - readonly asComposable: RmrkTraitsResourceComposableResource; - readonly isSlot: boolean; - readonly asSlot: RmrkTraitsResourceSlotResource; - readonly type: 'Basic' | 'Composable' | 'Slot'; - } - - /** @name RmrkTraitsResourceBasicResource (295) */ - interface RmrkTraitsResourceBasicResource extends Struct { - readonly src: Option; - readonly metadata: Option; - readonly license: Option; - readonly thumb: Option; - } - - /** @name RmrkTraitsResourceComposableResource (297) */ - interface RmrkTraitsResourceComposableResource extends Struct { - readonly parts: Vec; - readonly base: u32; - readonly src: Option; - readonly metadata: Option; - readonly license: Option; - readonly thumb: Option; - } - - /** @name RmrkTraitsResourceSlotResource (298) */ - interface RmrkTraitsResourceSlotResource extends Struct { - readonly base: u32; - readonly src: Option; - readonly metadata: Option; - readonly slot: u32; - readonly license: Option; - readonly thumb: Option; - } - - /** @name PalletRmrkEquipCall (301) */ - interface PalletRmrkEquipCall extends Enum { - readonly isCreateBase: boolean; - readonly asCreateBase: { - readonly baseType: Bytes; - readonly symbol: Bytes; - readonly parts: Vec; - } & Struct; - readonly isThemeAdd: boolean; - readonly asThemeAdd: { - readonly baseId: u32; - readonly theme: RmrkTraitsTheme; - } & Struct; - readonly isEquippable: boolean; - readonly asEquippable: { - readonly baseId: u32; - readonly slotId: u32; - readonly equippables: RmrkTraitsPartEquippableList; - } & Struct; - readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; - } - - /** @name RmrkTraitsPartPartType (304) */ - interface RmrkTraitsPartPartType extends Enum { - readonly isFixedPart: boolean; - readonly asFixedPart: RmrkTraitsPartFixedPart; - readonly isSlotPart: boolean; - readonly asSlotPart: RmrkTraitsPartSlotPart; - readonly type: 'FixedPart' | 'SlotPart'; - } - - /** @name RmrkTraitsPartFixedPart (306) */ - interface RmrkTraitsPartFixedPart extends Struct { - readonly id: u32; - readonly z: u32; - readonly src: Bytes; - } - - /** @name RmrkTraitsPartSlotPart (307) */ - interface RmrkTraitsPartSlotPart extends Struct { - readonly id: u32; - readonly equippable: RmrkTraitsPartEquippableList; - readonly src: Bytes; - readonly z: u32; - } - - /** @name RmrkTraitsPartEquippableList (308) */ - interface RmrkTraitsPartEquippableList extends Enum { - readonly isAll: boolean; - readonly isEmpty: boolean; - readonly isCustom: boolean; - readonly asCustom: Vec; - readonly type: 'All' | 'Empty' | 'Custom'; - } - - /** @name RmrkTraitsTheme (310) */ - interface RmrkTraitsTheme extends Struct { - readonly name: Bytes; - readonly properties: Vec; - readonly inherit: bool; - } - - /** @name RmrkTraitsThemeThemeProperty (312) */ - interface RmrkTraitsThemeThemeProperty extends Struct { - readonly key: Bytes; - readonly value: Bytes; - } - - /** @name PalletForeingAssetsModuleCall (314) */ - interface PalletForeingAssetsModuleCall extends Enum { - readonly isRegisterForeignAsset: boolean; - readonly asRegisterForeignAsset: { - readonly owner: AccountId32; - readonly location: XcmVersionedMultiLocation; - readonly metadata: PalletForeingAssetsModuleAssetMetadata; - } & Struct; - readonly isUpdateForeignAsset: boolean; - readonly asUpdateForeignAsset: { - readonly foreignAssetId: u32; - readonly location: XcmVersionedMultiLocation; - readonly metadata: PalletForeingAssetsModuleAssetMetadata; - } & Struct; - readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset'; - } - - /** @name PalletEvmCall (315) */ + /** @name PalletEvmCall (274) */ interface PalletEvmCall extends Enum { readonly isWithdraw: boolean; readonly asWithdraw: { @@ -2958,7 +2511,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name PalletEthereumCall (319) */ + /** @name PalletEthereumCall (278) */ interface PalletEthereumCall extends Enum { readonly isTransact: boolean; readonly asTransact: { @@ -2967,7 +2520,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transact'; } - /** @name EthereumTransactionTransactionV2 (320) */ + /** @name EthereumTransactionTransactionV2 (279) */ interface EthereumTransactionTransactionV2 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumTransactionLegacyTransaction; @@ -2978,7 +2531,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumTransactionLegacyTransaction (321) */ + /** @name EthereumTransactionLegacyTransaction (280) */ interface EthereumTransactionLegacyTransaction extends Struct { readonly nonce: U256; readonly gasPrice: U256; @@ -2989,7 +2542,7 @@ declare module '@polkadot/types/lookup' { readonly signature: EthereumTransactionTransactionSignature; } - /** @name EthereumTransactionTransactionAction (322) */ + /** @name EthereumTransactionTransactionAction (281) */ interface EthereumTransactionTransactionAction extends Enum { readonly isCall: boolean; readonly asCall: H160; @@ -2997,14 +2550,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Call' | 'Create'; } - /** @name EthereumTransactionTransactionSignature (323) */ + /** @name EthereumTransactionTransactionSignature (282) */ interface EthereumTransactionTransactionSignature extends Struct { readonly v: u64; readonly r: H256; readonly s: H256; } - /** @name EthereumTransactionEip2930Transaction (325) */ + /** @name EthereumTransactionEip2930Transaction (284) */ interface EthereumTransactionEip2930Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -3019,13 +2572,13 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name EthereumTransactionAccessListItem (327) */ + /** @name EthereumTransactionAccessListItem (286) */ interface EthereumTransactionAccessListItem extends Struct { readonly address: H160; readonly storageKeys: Vec; } - /** @name EthereumTransactionEip1559Transaction (328) */ + /** @name EthereumTransactionEip1559Transaction (287) */ interface EthereumTransactionEip1559Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -3041,7 +2594,7 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name PalletEvmMigrationCall (329) */ + /** @name PalletEvmMigrationCall (288) */ interface PalletEvmMigrationCall extends Enum { readonly isBegin: boolean; readonly asBegin: { @@ -3060,13 +2613,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Begin' | 'SetData' | 'Finish'; } - /** @name PalletSudoError (332) */ + /** @name PalletSudoError (291) */ interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: 'RequireSudo'; } - /** @name OrmlVestingModuleError (334) */ + /** @name OrmlVestingModuleError (293) */ interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; @@ -3077,7 +2630,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name OrmlXtokensModuleError (335) */ + /** @name OrmlXtokensModuleError (294) */ interface OrmlXtokensModuleError extends Enum { readonly isAssetHasNoReserve: boolean; readonly isNotCrossChainTransfer: boolean; @@ -3101,26 +2654,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined'; } - /** @name OrmlTokensBalanceLock (338) */ + /** @name OrmlTokensBalanceLock (297) */ interface OrmlTokensBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name OrmlTokensAccountData (340) */ + /** @name OrmlTokensAccountData (299) */ interface OrmlTokensAccountData extends Struct { readonly free: u128; readonly reserved: u128; readonly frozen: u128; } - /** @name OrmlTokensReserveData (342) */ + /** @name OrmlTokensReserveData (301) */ interface OrmlTokensReserveData extends Struct { readonly id: Null; readonly amount: u128; } - /** @name OrmlTokensModuleError (344) */ + /** @name OrmlTokensModuleError (303) */ interface OrmlTokensModuleError extends Enum { readonly isBalanceTooLow: boolean; readonly isAmountIntoBalanceFailed: boolean; @@ -3133,21 +2686,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (346) */ + /** @name CumulusPalletXcmpQueueInboundChannelDetails (305) */ interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (347) */ + /** @name CumulusPalletXcmpQueueInboundState (306) */ interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (350) */ + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (309) */ interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; @@ -3155,7 +2708,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (353) */ + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (312) */ interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; @@ -3164,14 +2717,14 @@ declare module '@polkadot/types/lookup' { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (354) */ + /** @name CumulusPalletXcmpQueueOutboundState (313) */ interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (356) */ + /** @name CumulusPalletXcmpQueueQueueConfigData (315) */ interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; @@ -3181,7 +2734,7 @@ declare module '@polkadot/types/lookup' { readonly xcmpMaxIndividualWeight: u64; } - /** @name CumulusPalletXcmpQueueError (358) */ + /** @name CumulusPalletXcmpQueueError (317) */ interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; @@ -3191,7 +2744,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (359) */ + /** @name PalletXcmError (318) */ interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; @@ -3209,29 +2762,29 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (360) */ + /** @name CumulusPalletXcmError (319) */ type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (361) */ + /** @name CumulusPalletDmpQueueConfigData (320) */ interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: u64; } - /** @name CumulusPalletDmpQueuePageIndexData (362) */ + /** @name CumulusPalletDmpQueuePageIndexData (321) */ interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (365) */ + /** @name CumulusPalletDmpQueueError (324) */ interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (369) */ + /** @name PalletUniqueError (328) */ interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; @@ -3240,75 +2793,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name PalletUniqueSchedulerScheduledV3 (372) */ - interface PalletUniqueSchedulerScheduledV3 extends Struct { - readonly maybeId: Option; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; - readonly maybePeriodic: Option>; - readonly origin: OpalRuntimeOriginCaller; - } - - /** @name OpalRuntimeOriginCaller (373) */ - interface OpalRuntimeOriginCaller extends Enum { - readonly isSystem: boolean; - readonly asSystem: FrameSupportDispatchRawOrigin; - readonly isVoid: boolean; - readonly isPolkadotXcm: boolean; - readonly asPolkadotXcm: PalletXcmOrigin; - readonly isCumulusXcm: boolean; - readonly asCumulusXcm: CumulusPalletXcmOrigin; - readonly isEthereum: boolean; - readonly asEthereum: PalletEthereumRawOrigin; - readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; - } - - /** @name FrameSupportDispatchRawOrigin (374) */ - interface FrameSupportDispatchRawOrigin extends Enum { - readonly isRoot: boolean; - readonly isSigned: boolean; - readonly asSigned: AccountId32; - readonly isNone: boolean; - readonly type: 'Root' | 'Signed' | 'None'; - } - - /** @name PalletXcmOrigin (375) */ - interface PalletXcmOrigin extends Enum { - readonly isXcm: boolean; - readonly asXcm: XcmV1MultiLocation; - readonly isResponse: boolean; - readonly asResponse: XcmV1MultiLocation; - readonly type: 'Xcm' | 'Response'; - } - - /** @name CumulusPalletXcmOrigin (376) */ - interface CumulusPalletXcmOrigin extends Enum { - readonly isRelay: boolean; - readonly isSiblingParachain: boolean; - readonly asSiblingParachain: u32; - readonly type: 'Relay' | 'SiblingParachain'; - } - - /** @name PalletEthereumRawOrigin (377) */ - interface PalletEthereumRawOrigin extends Enum { - readonly isEthereumTransaction: boolean; - readonly asEthereumTransaction: H160; - readonly type: 'EthereumTransaction'; - } - - /** @name SpCoreVoid (378) */ - type SpCoreVoid = Null; - - /** @name PalletUniqueSchedulerError (379) */ - interface PalletUniqueSchedulerError extends Enum { - readonly isFailedToSchedule: boolean; - readonly isNotFound: boolean; - readonly isTargetBlockNumberInPast: boolean; - readonly isRescheduleNoChange: boolean; - readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; - } - - /** @name UpDataStructsCollection (380) */ + /** @name UpDataStructsCollection (329) */ interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3321,7 +2806,7 @@ declare module '@polkadot/types/lookup' { readonly externalCollection: bool; } - /** @name UpDataStructsSponsorshipStateAccountId32 (381) */ + /** @name UpDataStructsSponsorshipStateAccountId32 (330) */ interface UpDataStructsSponsorshipStateAccountId32 extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3331,43 +2816,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (382) */ + /** @name UpDataStructsProperties (331) */ interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (383) */ + /** @name UpDataStructsPropertiesMapBoundedVec (332) */ interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (388) */ + /** @name UpDataStructsPropertiesMapPropertyPermission (337) */ interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (395) */ + /** @name UpDataStructsCollectionStats (344) */ interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (396) */ + /** @name UpDataStructsTokenChild (345) */ interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (397) */ + /** @name PhantomTypeUpDataStructs (346) */ interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (399) */ + /** @name UpDataStructsTokenData (348) */ interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (401) */ + /** @name UpDataStructsRpcCollection (350) */ interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3382,7 +2867,7 @@ declare module '@polkadot/types/lookup' { readonly readOnly: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (402) */ + /** @name RmrkTraitsCollectionCollectionInfo (351) */ interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; @@ -3391,7 +2876,7 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (403) */ + /** @name RmrkTraitsNftNftInfo (354) */ interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; @@ -3400,13 +2885,22 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (405) */ + /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (355) */ + interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { + readonly isAccountId: boolean; + readonly asAccountId: AccountId32; + readonly isCollectionAndNftTuple: boolean; + readonly asCollectionAndNftTuple: ITuple<[u32, u32]>; + readonly type: 'AccountId' | 'CollectionAndNftTuple'; + } + + /** @name RmrkTraitsNftRoyaltyInfo (357) */ interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (406) */ + /** @name RmrkTraitsResourceResourceInfo (358) */ interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; @@ -3414,26 +2908,111 @@ declare module '@polkadot/types/lookup' { readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (407) */ + /** @name RmrkTraitsResourceResourceTypes (360) */ + interface RmrkTraitsResourceResourceTypes extends Enum { + readonly isBasic: boolean; + readonly asBasic: RmrkTraitsResourceBasicResource; + readonly isComposable: boolean; + readonly asComposable: RmrkTraitsResourceComposableResource; + readonly isSlot: boolean; + readonly asSlot: RmrkTraitsResourceSlotResource; + readonly type: 'Basic' | 'Composable' | 'Slot'; + } + + /** @name RmrkTraitsResourceBasicResource (361) */ + interface RmrkTraitsResourceBasicResource extends Struct { + readonly src: Option; + readonly metadata: Option; + readonly license: Option; + readonly thumb: Option; + } + + /** @name RmrkTraitsResourceComposableResource (363) */ + interface RmrkTraitsResourceComposableResource extends Struct { + readonly parts: Vec; + readonly base: u32; + readonly src: Option; + readonly metadata: Option; + readonly license: Option; + readonly thumb: Option; + } + + /** @name RmrkTraitsResourceSlotResource (364) */ + interface RmrkTraitsResourceSlotResource extends Struct { + readonly base: u32; + readonly src: Option; + readonly metadata: Option; + readonly slot: u32; + readonly license: Option; + readonly thumb: Option; + } + + /** @name RmrkTraitsPropertyPropertyInfo (365) */ interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (408) */ + /** @name RmrkTraitsBaseBaseInfo (368) */ interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (409) */ + /** @name RmrkTraitsPartPartType (369) */ + interface RmrkTraitsPartPartType extends Enum { + readonly isFixedPart: boolean; + readonly asFixedPart: RmrkTraitsPartFixedPart; + readonly isSlotPart: boolean; + readonly asSlotPart: RmrkTraitsPartSlotPart; + readonly type: 'FixedPart' | 'SlotPart'; + } + + /** @name RmrkTraitsPartFixedPart (371) */ + interface RmrkTraitsPartFixedPart extends Struct { + readonly id: u32; + readonly z: u32; + readonly src: Bytes; + } + + /** @name RmrkTraitsPartSlotPart (372) */ + interface RmrkTraitsPartSlotPart extends Struct { + readonly id: u32; + readonly equippable: RmrkTraitsPartEquippableList; + readonly src: Bytes; + readonly z: u32; + } + + /** @name RmrkTraitsPartEquippableList (373) */ + interface RmrkTraitsPartEquippableList extends Enum { + readonly isAll: boolean; + readonly isEmpty: boolean; + readonly isCustom: boolean; + readonly asCustom: Vec; + readonly type: 'All' | 'Empty' | 'Custom'; + } + + /** @name RmrkTraitsTheme (374) */ + interface RmrkTraitsTheme extends Struct { + readonly name: Bytes; + readonly properties: Vec; + readonly inherit: bool; + } + + /** @name RmrkTraitsThemeThemeProperty (376) */ + interface RmrkTraitsThemeThemeProperty extends Struct { + readonly key: Bytes; + readonly value: Bytes; + } + + /** @name RmrkTraitsNftNftChild (378) */ interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (411) */ + /** @name PalletCommonError (380) */ interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; @@ -3472,7 +3051,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (413) */ + /** @name PalletFungibleError (382) */ interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; @@ -3482,34 +3061,19 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (414) */ - interface PalletRefungibleItemData extends Struct { - readonly constData: Bytes; - } - - /** @name PalletRefungibleError (419) */ - interface PalletRefungibleError extends Enum { - readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; - readonly isWrongRefungiblePieces: boolean; - readonly isRepartitionWhileNotOwningAllPieces: boolean; - readonly isRefungibleDisallowsNesting: boolean; - readonly isSettingPropertiesNotAllowed: boolean; - readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; - } - - /** @name PalletNonfungibleItemData (420) */ + /** @name PalletNonfungibleItemData (383) */ interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (422) */ + /** @name UpDataStructsPropertyScope (385) */ interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; readonly type: 'None' | 'Rmrk'; } - /** @name PalletNonfungibleError (424) */ + /** @name PalletNonfungibleError (389) */ interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; @@ -3517,7 +3081,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (425) */ + /** @name PalletStructureError (390) */ interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; @@ -3526,52 +3090,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletRmrkCoreError (426) */ - interface PalletRmrkCoreError extends Enum { - readonly isCorruptedCollectionType: boolean; - readonly isRmrkPropertyKeyIsTooLong: boolean; - readonly isRmrkPropertyValueIsTooLong: boolean; - readonly isRmrkPropertyIsNotFound: boolean; - readonly isUnableToDecodeRmrkData: boolean; - readonly isCollectionNotEmpty: boolean; - readonly isNoAvailableCollectionId: boolean; - readonly isNoAvailableNftId: boolean; - readonly isCollectionUnknown: boolean; - readonly isNoPermission: boolean; - readonly isNonTransferable: boolean; - readonly isCollectionFullOrLocked: boolean; - readonly isResourceDoesntExist: boolean; - readonly isCannotSendToDescendentOrSelf: boolean; - readonly isCannotAcceptNonOwnedNft: boolean; - readonly isCannotRejectNonOwnedNft: boolean; - readonly isCannotRejectNonPendingNft: boolean; - readonly isResourceNotPending: boolean; - readonly isNoAvailableResourceId: boolean; - readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; - } - - /** @name PalletRmrkEquipError (428) */ - interface PalletRmrkEquipError extends Enum { - readonly isPermissionError: boolean; - readonly isNoAvailableBaseId: boolean; - readonly isNoAvailablePartId: boolean; - readonly isBaseDoesntExist: boolean; - readonly isNeedsDefaultThemeFirst: boolean; - readonly isPartDoesntExist: boolean; - readonly isNoEquippableOnFixedPart: boolean; - readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; - } - - /** @name PalletForeingAssetsModuleError (429) */ - interface PalletForeingAssetsModuleError extends Enum { - readonly isBadLocation: boolean; - readonly isMultiLocationExisted: boolean; - readonly isAssetIdNotExists: boolean; - readonly isAssetIdExisted: boolean; - readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted'; - } - - /** @name PalletEvmError (432) */ + /** @name PalletEvmError (393) */ interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; @@ -3582,7 +3101,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (435) */ + /** @name FpRpcTransactionStatus (396) */ interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; @@ -3593,10 +3112,10 @@ declare module '@polkadot/types/lookup' { readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (437) */ + /** @name EthbloomBloom (398) */ interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (439) */ + /** @name EthereumReceiptReceiptV3 (400) */ interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; @@ -3607,7 +3126,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (440) */ + /** @name EthereumReceiptEip658ReceiptData (401) */ interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; @@ -3615,14 +3134,14 @@ declare module '@polkadot/types/lookup' { readonly logs: Vec; } - /** @name EthereumBlock (441) */ + /** @name EthereumBlock (402) */ interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (442) */ + /** @name EthereumHeader (403) */ interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; @@ -3641,24 +3160,24 @@ declare module '@polkadot/types/lookup' { readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (443) */ + /** @name EthereumTypesHashH64 (404) */ interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (448) */ + /** @name PalletEthereumError (409) */ interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (449) */ + /** @name PalletEvmCoderSubstrateError (410) */ interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (450) */ + /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (411) */ interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3668,7 +3187,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name PalletEvmContractHelpersSponsoringModeT (451) */ + /** @name PalletEvmContractHelpersSponsoringModeT (412) */ interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; @@ -3676,21 +3195,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (453) */ + /** @name PalletEvmContractHelpersError (414) */ interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly isNoPendingSponsor: boolean; readonly type: 'NoPermission' | 'NoPendingSponsor'; } - /** @name PalletEvmMigrationError (454) */ + /** @name PalletEvmMigrationError (415) */ interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (456) */ + /** @name SpRuntimeMultiSignature (417) */ interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; @@ -3701,34 +3220,34 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (457) */ + /** @name SpCoreEd25519Signature (418) */ interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (459) */ + /** @name SpCoreSr25519Signature (420) */ interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (460) */ + /** @name SpCoreEcdsaSignature (421) */ interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (463) */ + /** @name FrameSystemExtensionsCheckSpecVersion (424) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (464) */ + /** @name FrameSystemExtensionsCheckGenesis (425) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (467) */ + /** @name FrameSystemExtensionsCheckNonce (428) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (468) */ + /** @name FrameSystemExtensionsCheckWeight (429) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (469) */ + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (430) */ interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (470) */ - type OpalRuntimeRuntime = Null; + /** @name UniqueRuntimeRuntime (431) */ + type UniqueRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (471) */ + /** @name PalletEthereumFakeTransactionFinalizer (432) */ type PalletEthereumFakeTransactionFinalizer = Null; } // declare module From afdd4f39294f737ada7e3838a50c21ea3db427f2 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 6 Sep 2022 13:06:16 +0000 Subject: [PATCH 0754/1274] fix: qtz/unq xcm unit tests --- runtime/quartz/src/tests/xcm.rs | 2 +- runtime/unique/src/tests/xcm.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/quartz/src/tests/xcm.rs b/runtime/quartz/src/tests/xcm.rs index 719df55755..1244b03796 100644 --- a/runtime/quartz/src/tests/xcm.rs +++ b/runtime/quartz/src/tests/xcm.rs @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . use logtest::Logger; -use crate::{runtime_common::tests::xcm::*, xcm_config::Barrier}; +use crate::{runtime_common::tests::xcm::*, xcm_barrier::Barrier}; const QUARTZ_PARA_ID: u32 = 2095; diff --git a/runtime/unique/src/tests/xcm.rs b/runtime/unique/src/tests/xcm.rs index 297ca92d04..0a6cff931e 100644 --- a/runtime/unique/src/tests/xcm.rs +++ b/runtime/unique/src/tests/xcm.rs @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . use logtest::Logger; -use crate::{runtime_common::tests::xcm::*, xcm_config::Barrier}; +use crate::{runtime_common::tests::xcm::*, xcm_barrier::Barrier}; const UNIQUE_PARA_ID: u32 = 2037; From 1a6fe8be0e1f60427073b3a456b6a9c2af1484c8 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 6 Sep 2022 16:06:06 +0000 Subject: [PATCH 0755/1274] fix(xcm): restore AllowTopLevelPaidExecutionFrom --- runtime/quartz/src/xcm_barrier.rs | 7 ++++++- runtime/unique/src/xcm_barrier.rs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/runtime/quartz/src/xcm_barrier.rs b/runtime/quartz/src/xcm_barrier.rs index b261b28b8f..d789724d19 100644 --- a/runtime/quartz/src/xcm_barrier.rs +++ b/runtime/quartz/src/xcm_barrier.rs @@ -14,11 +14,15 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use frame_support::{match_types, parameter_types, traits::Get}; +use frame_support::{ + match_types, parameter_types, + traits::{Get, Everything}, +}; use sp_std::{vec, vec::Vec}; use xcm::v1::{BodyId, Junction::*, Junctions::*, MultiLocation}; use xcm_builder::{ AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowUnpaidExecutionFrom, TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, }; use crate::{ @@ -74,6 +78,7 @@ pub type Barrier = DenyThenTry< ), ( TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, // Parent and its exec plurality get free execution AllowUnpaidExecutionFrom, // Expected responses are OK. diff --git a/runtime/unique/src/xcm_barrier.rs b/runtime/unique/src/xcm_barrier.rs index cf922796d4..36a382a8fa 100644 --- a/runtime/unique/src/xcm_barrier.rs +++ b/runtime/unique/src/xcm_barrier.rs @@ -14,11 +14,15 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use frame_support::{match_types, parameter_types, traits::Get}; +use frame_support::{ + match_types, parameter_types, + traits::{Get, Everything}, +}; use sp_std::{vec, vec::Vec}; use xcm::v1::{BodyId, Junction::*, Junctions::*, MultiLocation}; use xcm_builder::{ AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowUnpaidExecutionFrom, TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, }; use crate::{ @@ -74,6 +78,7 @@ pub type Barrier = DenyThenTry< ), ( TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, // Parent and its exec plurality get free execution AllowUnpaidExecutionFrom, // Expected responses are OK. From a865df5a2540646edd48b406dd43e2b0528201fc Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 6 Sep 2022 16:28:55 +0000 Subject: [PATCH 0756/1274] fix: parse bitint to decimals --- tests/src/util/helpers.ts | 18 ++++++++++++++++ tests/src/xcm/xcmOpal.test.ts | 31 +++++++++++++++++++++------ tests/src/xcm/xcmQuartz.test.ts | 38 ++++++++++++++++++++------------- tests/src/xcm/xcmUnique.test.ts | 38 ++++++++++++++++++++------------- 4 files changed, 88 insertions(+), 37 deletions(-) diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index 4b3efaa6ba..ac697c8738 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -103,6 +103,24 @@ export function bigIntToSub(api: ApiPromise, number: bigint) { return api.registry.createType('AccountId', '0x' + number.toString(16).padStart(64, '0')).toJSON(); } +export function bigIntToDecimals(number: bigint, decimals = 18): string { + let numberStr = number.toString(); + console.log('[0] str = ', numberStr); + + // Get rid of `n` at the end + numberStr = numberStr.substring(0, numberStr.length - 1); + console.log('[1] str = ', numberStr); + + const dotPos = numberStr.length - decimals; + if (dotPos <= 0) { + return '0.' + numberStr; + } else { + const intPart = numberStr.substring(0, dotPos); + const fractPart = numberStr.substring(dotPos); + return intPart + '.' + fractPart; + } +} + export function normalizeAccountId(input: string | AccountId | CrossAccountId | IKeyringPair): CrossAccountId { if (typeof input === 'string') { if (input.length >= 47) { diff --git a/tests/src/xcm/xcmOpal.test.ts b/tests/src/xcm/xcmOpal.test.ts index 9ac8a73f28..8b6e10cf23 100644 --- a/tests/src/xcm/xcmOpal.test.ts +++ b/tests/src/xcm/xcmOpal.test.ts @@ -21,7 +21,7 @@ import {WsProvider} from '@polkadot/api'; import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; import usingApi, {submitTransactionAsync} from './../substrate/substrate-api'; -import {getGenericResult, paraSiblingSovereignAccount} from './../util/helpers'; +import {bigIntToDecimals, getGenericResult, paraSiblingSovereignAccount} from './../util/helpers'; import waitNewBlocks from './../substrate/wait-new-blocks'; import {normalizeAccountId} from './../util/helpers'; import getBalance from './../substrate/get-balance'; @@ -43,6 +43,8 @@ const ASSET_METADATA_NAME = 'USDT'; const ASSET_METADATA_DESCRIPTION = 'USDT'; const ASSET_METADATA_MINIMAL_BALANCE = 1; +const WESTMINT_DECIMALS = 12; + const TRANSFER_AMOUNT = 1_000_000_000_000_000_000n; // 10,000.00 (ten thousands) USDT @@ -281,7 +283,10 @@ describe('Integration test: Exchanging USDT with Westmint', () => { [balanceStmnAfter] = await getBalance(api, [alice.address]); // common good parachain take commission in it native token - console.log('Opal to Westmint transaction fees on Westmint: %s WND', balanceStmnBefore - balanceStmnAfter); + console.log( + 'Opal to Westmint transaction fees on Westmint: %s WND', + bigIntToDecimals(balanceStmnBefore - balanceStmnAfter, WESTMINT_DECIMALS), + ); expect(balanceStmnBefore > balanceStmnAfter).to.be.true; }, statemineApiOptions); @@ -297,10 +302,16 @@ describe('Integration test: Exchanging USDT with Westmint', () => { // commission has not paid in USDT token expect(free == TRANSFER_AMOUNT).to.be.true; - console.log('Opal to Westmint transaction fees on Opal: %s USDT', TRANSFER_AMOUNT - free); + console.log( + 'Opal to Westmint transaction fees on Opal: %s USDT', + bigIntToDecimals(TRANSFER_AMOUNT - free), + ); // ... and parachain native token expect(balanceOpalAfter == balanceOpalBefore).to.be.true; - console.log('Opal to Westmint transaction fees on Opal: %s WND', balanceOpalAfter - balanceOpalBefore); + console.log( + 'Opal to Westmint transaction fees on Opal: %s WND', + bigIntToDecimals(balanceOpalAfter - balanceOpalBefore, WESTMINT_DECIMALS), + ); }, uniqueApiOptions); @@ -451,8 +462,14 @@ describe('Integration test: Exchanging USDT with Westmint', () => { [balanceBobAfter] = await getBalance(api, [bob.address]); balanceBobRelayTokenAfter = BigInt(((await api.query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free); const wndFee = balanceBobRelayTokenAfter - TRANSFER_AMOUNT_RELAY - balanceBobRelayTokenBefore; - console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobBefore); - console.log('Relay (Westend) to Opal transaction fees: %s WND', wndFee); + console.log( + 'Relay (Westend) to Opal transaction fees: %s OPL', + bigIntToDecimals(balanceBobAfter - balanceBobBefore), + ); + console.log( + 'Relay (Westend) to Opal transaction fees: %s WND', + bigIntToDecimals(wndFee, WESTMINT_DECIMALS), + ); expect(balanceBobBefore == balanceBobAfter).to.be.true; expect(balanceBobRelayTokenBefore < balanceBobRelayTokenAfter).to.be.true; }, uniqueApiOptions2); @@ -504,4 +521,4 @@ describe('Integration test: Exchanging USDT with Westmint', () => { }, uniqueApiOptions); }); -}); \ No newline at end of file +}); diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index 923c375e43..a21a7b826d 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -21,7 +21,7 @@ import {WsProvider, Keyring} from '@polkadot/api'; import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm} from '../util/helpers'; +import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../util/helpers'; import {MultiLocation} from '@polkadot/types/interfaces'; import {blake2AsHex} from '@polkadot/util-crypto'; import waitNewBlocks from '../substrate/wait-new-blocks'; @@ -37,6 +37,8 @@ const MOONRIVER_CHAIN = 2023; const KARURA_PORT = 9946; const MOONRIVER_PORT = 9947; +const KARURA_DECIMALS = 12; + const TRANSFER_AMOUNT = 2000000000000000000000000n; function parachainApiOptions(port: number): ApiOptions { @@ -182,7 +184,7 @@ describe_xcm('Integration test: Exchanging tokens with Karura', () => { [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccount.address]); const qtzFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT; - console.log('[Quartz -> Karura] transaction fees on Quartz: %s QTZ', qtzFees); + console.log('[Quartz -> Karura] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees)); expect(qtzFees > 0n).to.be.true; }); @@ -198,8 +200,11 @@ describe_xcm('Integration test: Exchanging tokens with Karura', () => { const karFees = balanceKaruraTokenInit - balanceKaruraTokenMiddle; const qtzIncomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenInit; - console.log('[Quartz -> Karura] transaction fees on Karura: %s KAR', karFees); - console.log('[Quartz -> Karura] income %s QTZ', qtzIncomeTransfer); + console.log(' + [Quartz -> Karura] transaction fees on Karura: %s KAR', + bigIntToDecimals(karFees, KARURA_DECIMALS), + ); + console.log('[Quartz -> Karura] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer)); expect(karFees == 0n).to.be.true; expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true; }, @@ -249,8 +254,11 @@ describe_xcm('Integration test: Exchanging tokens with Karura', () => { const karFees = balanceKaruraTokenMiddle - balanceKaruraTokenFinal; const qtzOutcomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenFinal; - console.log('[Karura -> Quartz] transaction fees on Karura: %s KAR', karFees); - console.log('[Karura -> Quartz] outcome %s QTZ', qtzOutcomeTransfer); + console.log( + '[Karura -> Quartz] transaction fees on Karura: %s KAR', + bigIntToDecimals(karFees, KARURA_DECIMALS), + ); + console.log('[Karura -> Quartz] outcome %s QTZ', bigIntToDecimals(qtzOutcomeTransfer)); expect(karFees > 0).to.be.true; expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; @@ -266,10 +274,10 @@ describe_xcm('Integration test: Exchanging tokens with Karura', () => { const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle; expect(actuallyDelivered > 0).to.be.true; - console.log('[Karura -> Quartz] actually delivered %s QTZ', actuallyDelivered); + console.log('[Karura -> Quartz] actually delivered %s QTZ', bigIntToDecimals(actuallyDelivered)); const qtzFees = TRANSFER_AMOUNT - actuallyDelivered; - console.log('[Karura -> Quartz] transaction fees on Quartz: %s QTZ', qtzFees); + console.log('[Karura -> Quartz] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees)); expect(qtzFees == 0n).to.be.true; }); }); @@ -581,7 +589,7 @@ describe_xcm('Integration test: Exchanging QTZ with Moonriver', () => { expect(balanceQuartzTokenMiddle < balanceQuartzTokenInit).to.be.true; const transactionFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT; - console.log('[Quartz -> Moonriver] transaction fees on Quartz: %s QTZ', transactionFees); + console.log('[Quartz -> Moonriver] transaction fees on Quartz: %s QTZ', bigIntToDecimals(transactionFees)); expect(transactionFees > 0).to.be.true; }); @@ -592,7 +600,7 @@ describe_xcm('Integration test: Exchanging QTZ with Moonriver', () => { [balanceMovrTokenMiddle] = await getBalance(api, [randomAccountMoonriver.address]); const movrFees = balanceMovrTokenInit - balanceMovrTokenMiddle; - console.log('[Quartz -> Moonriver] transaction fees on Moonriver: %s MOVR', movrFees); + console.log('[Quartz -> Moonriver] transaction fees on Moonriver: %s MOVR',bigIntToDecimals(movrFees)); expect(movrFees == 0n).to.be.true; const qtzRandomAccountAsset = ( @@ -601,7 +609,7 @@ describe_xcm('Integration test: Exchanging QTZ with Moonriver', () => { balanceForeignQtzTokenMiddle = BigInt(qtzRandomAccountAsset['balance']); const qtzIncomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenInit; - console.log('[Quartz -> Moonriver] income %s QTZ', qtzIncomeTransfer); + console.log('[Quartz -> Moonriver] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer)); expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true; }, moonriverOptions(), @@ -647,7 +655,7 @@ describe_xcm('Integration test: Exchanging QTZ with Moonriver', () => { [balanceMovrTokenFinal] = await getBalance(api, [randomAccountMoonriver.address]); const movrFees = balanceMovrTokenMiddle - balanceMovrTokenFinal; - console.log('[Moonriver -> Quartz] transaction fees on Moonriver: %s MOVR', movrFees); + console.log('[Moonriver -> Quartz] transaction fees on Moonriver: %s MOVR', bigIntToDecimals(movrFees)); expect(movrFees > 0).to.be.true; const qtzRandomAccountAsset = ( @@ -659,7 +667,7 @@ describe_xcm('Integration test: Exchanging QTZ with Moonriver', () => { balanceForeignQtzTokenFinal = 0n; const qtzOutcomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenFinal; - console.log('[Quartz -> Moonriver] outcome %s QTZ', qtzOutcomeTransfer); + console.log('[Quartz -> Moonriver] outcome %s QTZ', bigIntToDecimals(qtzOutcomeTransfer)); expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; }, moonriverOptions(), @@ -672,10 +680,10 @@ describe_xcm('Integration test: Exchanging QTZ with Moonriver', () => { const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle; expect(actuallyDelivered > 0).to.be.true; - console.log('[Moonriver -> Quartz] actually delivered %s QTZ', actuallyDelivered); + console.log('[Moonriver -> Quartz] actually delivered %s QTZ', bigIntToDecimals(actuallyDelivered)); const qtzFees = TRANSFER_AMOUNT - actuallyDelivered; - console.log('[Moonriver -> Quartz] transaction fees on Quartz: %s QTZ', qtzFees); + console.log('[Moonriver -> Quartz] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees)); expect(qtzFees == 0n).to.be.true; }); }); diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index f6e31e31a9..581c0ba464 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -21,7 +21,7 @@ import {WsProvider, Keyring} from '@polkadot/api'; import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm} from '../util/helpers'; +import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../util/helpers'; import {MultiLocation} from '@polkadot/types/interfaces'; import {blake2AsHex} from '@polkadot/util-crypto'; import waitNewBlocks from '../substrate/wait-new-blocks'; @@ -37,6 +37,8 @@ const MOONBEAM_CHAIN = 2004; const ACALA_PORT = 9946; const MOONBEAM_PORT = 9947; +const ACALA_DECIMALS = 12; + const TRANSFER_AMOUNT = 2000000000000000000000000n; function parachainApiOptions(port: number): ApiOptions { @@ -182,7 +184,7 @@ describe_xcm('Integration test: Exchanging tokens with Acala', () => { [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccount.address]); const unqFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT; - console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', unqFees); + console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees)); expect(unqFees > 0n).to.be.true; }); @@ -198,8 +200,11 @@ describe_xcm('Integration test: Exchanging tokens with Acala', () => { const acaFees = balanceAcalaTokenInit - balanceAcalaTokenMiddle; const unqIncomeTransfer = balanceUniqueForeignTokenMiddle - balanceUniqueForeignTokenInit; - console.log('[Unique -> Acala] transaction fees on Acala: %s ACA', acaFees); - console.log('[Unique -> Acala] income %s UNQ', unqIncomeTransfer); + console.log( + '[Unique -> Acala] transaction fees on Acala: %s ACA', + bigIntToDecimals(acaFees, ACALA_DECIMALS), + ); + console.log('[Unique -> Acala] income %s UNQ', bigIntToDecimals(unqIncomeTransfer)); expect(acaFees == 0n).to.be.true; expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true; }, @@ -249,8 +254,11 @@ describe_xcm('Integration test: Exchanging tokens with Acala', () => { const acaFees = balanceAcalaTokenMiddle - balanceAcalaTokenFinal; const unqOutcomeTransfer = balanceUniqueForeignTokenMiddle - balanceUniqueForeignTokenFinal; - console.log('[Acala -> Unique] transaction fees on Acala: %s ACA', acaFees); - console.log('[Acala -> Unique] outcome %s UNQ', unqOutcomeTransfer); + console.log( + '[Acala -> Unique] transaction fees on Acala: %s ACA', + bigIntToDecimals(acaFees, ACALA_DECIMALS), + ); + console.log('[Acala -> Unique] outcome %s UNQ', bigIntToDecimals(unqOutcomeTransfer)); expect(acaFees > 0).to.be.true; expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; @@ -266,10 +274,10 @@ describe_xcm('Integration test: Exchanging tokens with Acala', () => { const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle; expect(actuallyDelivered > 0).to.be.true; - console.log('[Acala -> Unique] actually delivered %s UNQ', actuallyDelivered); + console.log('[Acala -> Unique] actually delivered %s UNQ', bigIntToDecimals(actuallyDelivered)); const unqFees = TRANSFER_AMOUNT - actuallyDelivered; - console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', unqFees); + console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees)); expect(unqFees == 0n).to.be.true; }); }); @@ -581,7 +589,7 @@ describe_xcm('Integration test: Exchanging UNQ with Moonbeam', () => { expect(balanceUniqueTokenMiddle < balanceUniqueTokenInit).to.be.true; const transactionFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT; - console.log('[Unique -> Moonbeam] transaction fees on Unique: %s UNQ', transactionFees); + console.log('[Unique -> Moonbeam] transaction fees on Unique: %s UNQ', bigIntToDecimals(transactionFees)); expect(transactionFees > 0).to.be.true; }); @@ -592,7 +600,7 @@ describe_xcm('Integration test: Exchanging UNQ with Moonbeam', () => { [balanceGlmrTokenMiddle] = await getBalance(api, [randomAccountMoonbeam.address]); const glmrFees = balanceGlmrTokenInit - balanceGlmrTokenMiddle; - console.log('[Unique -> Moonbeam] transaction fees on Moonbeam: %s GLMR', glmrFees); + console.log('[Unique -> Moonbeam] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees)); expect(glmrFees == 0n).to.be.true; const unqRandomAccountAsset = ( @@ -601,7 +609,7 @@ describe_xcm('Integration test: Exchanging UNQ with Moonbeam', () => { balanceForeignUnqTokenMiddle = BigInt(unqRandomAccountAsset['balance']); const unqIncomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenInit; - console.log('[Unique -> Moonbeam] income %s UNQ', unqIncomeTransfer); + console.log('[Unique -> Moonbeam] income %s UNQ', bigIntToDecimals(unqIncomeTransfer)); expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true; }, moonbeamOptions(), @@ -647,7 +655,7 @@ describe_xcm('Integration test: Exchanging UNQ with Moonbeam', () => { [balanceGlmrTokenFinal] = await getBalance(api, [randomAccountMoonbeam.address]); const glmrFees = balanceGlmrTokenMiddle - balanceGlmrTokenFinal; - console.log('[Moonbeam -> Unique] transaction fees on Moonbeam: %s GLMR', glmrFees); + console.log('[Moonbeam -> Unique] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees)); expect(glmrFees > 0).to.be.true; const unqRandomAccountAsset = ( @@ -659,7 +667,7 @@ describe_xcm('Integration test: Exchanging UNQ with Moonbeam', () => { balanceForeignUnqTokenFinal = 0n; const unqOutcomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenFinal; - console.log('[Unique -> Moonbeam] outcome %s UNQ', unqOutcomeTransfer); + console.log('[Unique -> Moonbeam] outcome %s UNQ', bigIntToDecimals(unqOutcomeTransfer)); expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; }, moonbeamOptions(), @@ -672,10 +680,10 @@ describe_xcm('Integration test: Exchanging UNQ with Moonbeam', () => { const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle; expect(actuallyDelivered > 0).to.be.true; - console.log('[Moonbeam -> Unique] actually delivered %s UNQ', actuallyDelivered); + console.log('[Moonbeam -> Unique] actually delivered %s UNQ', bigIntToDecimals(actuallyDelivered)); const unqFees = TRANSFER_AMOUNT - actuallyDelivered; - console.log('[Moonbeam -> Unique] transaction fees on Unique: %s UNQ', unqFees); + console.log('[Moonbeam -> Unique] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees)); expect(unqFees == 0n).to.be.true; }); }); From 5c119a6b10e0de6f35d484da139955dc2baf39e2 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 6 Sep 2022 22:22:55 +0000 Subject: [PATCH 0757/1274] chore: regenerate test types --- tests/src/interfaces/augment-api-consts.ts | 16 + tests/src/interfaces/augment-api-errors.ts | 189 ++++ tests/src/interfaces/augment-api-events.ts | 78 +- tests/src/interfaces/augment-api-query.ts | 123 ++- tests/src/interfaces/augment-api-tx.ts | 372 ++++++- tests/src/interfaces/augment-types.ts | 28 +- tests/src/interfaces/default/types.ts | 488 ++++++++- tests/src/interfaces/lookup.ts | 1046 +++++++++++++++----- tests/src/interfaces/registry.ts | 28 +- tests/src/interfaces/types-lookup.ts | 997 ++++++++++++++----- 10 files changed, 2827 insertions(+), 538 deletions(-) diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index eebb09af90..a005e0d69e 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -66,6 +66,22 @@ declare module '@polkadot/api-base/types/consts' { **/ [key: string]: Codec; }; + scheduler: { + /** + * The maximum weight that may be scheduled per block for any dispatchables of less + * priority than `schedule::HARD_DEADLINE`. + **/ + maximumWeight: u64 & AugmentedConst; + /** + * The maximum number of scheduled calls in the queue for a single block. + * Not strictly enforced, but used for weight estimation. + **/ + maxScheduledPerBlock: u32 & AugmentedConst; + /** + * Generic const + **/ + [key: string]: Codec; + }; system: { /** * Maximum number of block number to block hash mappings to keep (oldest pruned first). diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index c099322ec2..1ca5d24599 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -291,6 +291,29 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; + foreignAssets: { + /** + * AssetId exists + **/ + AssetIdExisted: AugmentedError; + /** + * AssetId not exists + **/ + AssetIdNotExists: AugmentedError; + /** + * The given location could not be used (e.g. because it cannot be expressed in the + * desired version of XCM). + **/ + BadLocation: AugmentedError; + /** + * MultiLocation existed + **/ + MultiLocationExisted: AugmentedError; + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; fungible: { /** * Fungible token does not support nesting. @@ -435,6 +458,172 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; + refungible: { + /** + * Not Refungible item data used to mint in Refungible collection. + **/ + NotRefungibleDataUsedToMintFungibleCollectionToken: AugmentedError; + /** + * Refungible token can't nest other tokens. + **/ + RefungibleDisallowsNesting: AugmentedError; + /** + * Refungible token can't be repartitioned by user who isn't owns all pieces. + **/ + RepartitionWhileNotOwningAllPieces: AugmentedError; + /** + * Setting item properties is not allowed. + **/ + SettingPropertiesNotAllowed: AugmentedError; + /** + * Maximum refungibility exceeded. + **/ + WrongRefungiblePieces: AugmentedError; + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; + rmrkCore: { + /** + * Not the target owner of the sent NFT. + **/ + CannotAcceptNonOwnedNft: AugmentedError; + /** + * Not the target owner of the sent NFT. + **/ + CannotRejectNonOwnedNft: AugmentedError; + /** + * NFT was not sent and is not pending. + **/ + CannotRejectNonPendingNft: AugmentedError; + /** + * If an NFT is sent to a descendant, that would form a nesting loop, an ouroboros. + * Sending to self is redundant. + **/ + CannotSendToDescendentOrSelf: AugmentedError; + /** + * Too many tokens created in the collection, no new ones are allowed. + **/ + CollectionFullOrLocked: AugmentedError; + /** + * Only destroying collections without tokens is allowed. + **/ + CollectionNotEmpty: AugmentedError; + /** + * Collection does not exist, has a wrong type, or does not map to a Unique ID. + **/ + CollectionUnknown: AugmentedError; + /** + * Property of the type of RMRK collection could not be read successfully. + **/ + CorruptedCollectionType: AugmentedError; + /** + * Could not find an ID for a collection. It is likely there were too many collections created on the chain, causing an overflow. + **/ + NoAvailableCollectionId: AugmentedError; + /** + * Token does not exist, or there is no suitable ID for it, likely too many tokens were created in a collection, causing an overflow. + **/ + NoAvailableNftId: AugmentedError; + /** + * Could not find an ID for the resource. It is likely there were too many resources created on an NFT, causing an overflow. + **/ + NoAvailableResourceId: AugmentedError; + /** + * Token is marked as non-transferable, and thus cannot be transferred. + **/ + NonTransferable: AugmentedError; + /** + * No permission to perform action. + **/ + NoPermission: AugmentedError; + /** + * No such resource found. + **/ + ResourceDoesntExist: AugmentedError; + /** + * Resource is not pending for the operation. + **/ + ResourceNotPending: AugmentedError; + /** + * Could not find a property by the supplied key. + **/ + RmrkPropertyIsNotFound: AugmentedError; + /** + * Too many symbols supplied as the property key. The maximum is [256](up_data_structs::MAX_PROPERTY_KEY_LENGTH). + **/ + RmrkPropertyKeyIsTooLong: AugmentedError; + /** + * Too many bytes supplied as the property value. The maximum is [32768](up_data_structs::MAX_PROPERTY_VALUE_LENGTH). + **/ + RmrkPropertyValueIsTooLong: AugmentedError; + /** + * Something went wrong when decoding encoded data from the storage. + * Perhaps, there was a wrong key supplied for the type, or the data was improperly stored. + **/ + UnableToDecodeRmrkData: AugmentedError; + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; + rmrkEquip: { + /** + * Base collection linked to this ID does not exist. + **/ + BaseDoesntExist: AugmentedError; + /** + * No Theme named "default" is associated with the Base. + **/ + NeedsDefaultThemeFirst: AugmentedError; + /** + * Could not find an ID for a Base collection. It is likely there were too many collections created on the chain, causing an overflow. + **/ + NoAvailableBaseId: AugmentedError; + /** + * Could not find a suitable ID for a Part, likely too many Part tokens were created in the Base, causing an overflow + **/ + NoAvailablePartId: AugmentedError; + /** + * Cannot assign equippables to a fixed Part. + **/ + NoEquippableOnFixedPart: AugmentedError; + /** + * Part linked to this ID does not exist. + **/ + PartDoesntExist: AugmentedError; + /** + * No permission to perform action. + **/ + PermissionError: AugmentedError; + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; + scheduler: { + /** + * Failed to schedule a call + **/ + FailedToSchedule: AugmentedError; + /** + * Cannot find the scheduled call. + **/ + NotFound: AugmentedError; + /** + * Reschedule failed because it does not change scheduled time. + **/ + RescheduleNoChange: AugmentedError; + /** + * Given target block number is in the past. + **/ + TargetBlockNumberInPast: AugmentedError; + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; structure: { /** * While nesting, reached the breadth limit of nesting, exceeding the provided budget. diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index d8ab92fbcf..d1f03aeba7 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -6,9 +6,10 @@ import '@polkadot/api-base/types/events'; import type { ApiTypes, AugmentedEvent } from '@polkadot/api-base/types'; -import type { Bytes, Null, Option, Result, U256, U8aFixed, u128, u32, u64, u8 } from '@polkadot/types-codec'; +import type { Bytes, Null, Option, Result, U256, U8aFixed, bool, u128, u32, u64, u8 } from '@polkadot/types-codec'; +import type { ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime'; -import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, SpRuntimeDispatchError, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetMultiAssets, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; +import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetMultiAssets, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; export type __AugmentedEvent = AugmentedEvent; @@ -207,6 +208,28 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; + foreignAssets: { + /** + * The asset registered. + **/ + AssetRegistered: AugmentedEvent; + /** + * The asset updated. + **/ + AssetUpdated: AugmentedEvent; + /** + * The foreign asset registered. + **/ + ForeignAssetRegistered: AugmentedEvent; + /** + * The foreign asset updated. + **/ + ForeignAssetUpdated: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; parachainSystem: { /** * Downward messages were processed using the given weight. @@ -359,6 +382,57 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; + rmrkCore: { + CollectionCreated: AugmentedEvent; + CollectionDestroyed: AugmentedEvent; + CollectionLocked: AugmentedEvent; + IssuerChanged: AugmentedEvent; + NFTAccepted: AugmentedEvent; + NFTBurned: AugmentedEvent; + NftMinted: AugmentedEvent; + NFTRejected: AugmentedEvent; + NFTSent: AugmentedEvent; + PrioritySet: AugmentedEvent; + PropertySet: AugmentedEvent, key: Bytes, value: Bytes], { collectionId: u32, maybeNftId: Option, key: Bytes, value: Bytes }>; + ResourceAccepted: AugmentedEvent; + ResourceAdded: AugmentedEvent; + ResourceRemoval: AugmentedEvent; + ResourceRemovalAccepted: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; + rmrkEquip: { + BaseCreated: AugmentedEvent; + EquippablesUpdated: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; + scheduler: { + /** + * The call for the provided hash was not found so the task has been aborted. + **/ + CallLookupFailed: AugmentedEvent, id: Option, error: FrameSupportScheduleLookupError], { task: ITuple<[u32, u32]>, id: Option, error: FrameSupportScheduleLookupError }>; + /** + * Canceled some task. + **/ + Canceled: AugmentedEvent; + /** + * Dispatched some task. + **/ + Dispatched: AugmentedEvent, id: Option, result: Result], { task: ITuple<[u32, u32]>, id: Option, result: Result }>; + /** + * Scheduled some task. + **/ + Scheduled: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; structure: { /** * Executed call on behalf of the token. diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 782f4f50de..725de2258c 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -6,10 +6,10 @@ import '@polkadot/api-base/types/storage'; import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types'; -import type { BTreeMap, Bytes, Option, U256, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec'; +import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime'; -import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeignAssetsAssetIds, PalletNonfungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup'; import type { Observable } from '@polkadot/types/types'; export type __AugmentedQuery = AugmentedQuery unknown>; @@ -267,6 +267,41 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; + foreignAssets: { + /** + * The storages for assets to fungible collection binding + * + **/ + assetBinding: AugmentedQuery Observable>, [u32]> & QueryableStorageEntry; + /** + * The storages for AssetMetadatas. + * + * AssetMetadatas: map AssetIds => Option + **/ + assetMetadatas: AugmentedQuery Observable>, [PalletForeignAssetsAssetIds]> & QueryableStorageEntry; + /** + * The storages for MultiLocations. + * + * ForeignAssetLocations: map ForeignAssetId => Option + **/ + foreignAssetLocations: AugmentedQuery Observable>, [u32]> & QueryableStorageEntry; + /** + * The storages for CurrencyIds. + * + * LocationToCurrencyIds: map MultiLocation => Option + **/ + locationToCurrencyIds: AugmentedQuery Observable>, [XcmV1MultiLocation]> & QueryableStorageEntry; + /** + * Next available Foreign AssetId ID. + * + * NextForeignAssetId: ForeignAssetId + **/ + nextForeignAssetId: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; fungible: { /** * Storage for assets delegated to a limited extent to other users. @@ -526,6 +561,90 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; + refungible: { + /** + * Amount of tokens (not pieces) partially owned by an account within a collection. + **/ + accountBalance: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; + /** + * Allowance set by a token owner for another user to perform one of certain transactions on a number of pieces of a token. + **/ + allowance: AugmentedQuery Observable, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; + /** + * Amount of token pieces owned by account. + **/ + balance: AugmentedQuery Observable, [u32, u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; + /** + * Used to enumerate tokens owned by account. + **/ + owned: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr, u32]> & QueryableStorageEntry; + /** + * Token data, used to partially describe a token. + **/ + tokenData: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; + /** + * Amount of pieces a refungible token is split into. + **/ + tokenProperties: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; + /** + * Amount of tokens burnt in a collection. + **/ + tokensBurnt: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; + /** + * Total amount of minted tokens in a collection. + **/ + tokensMinted: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; + /** + * Total amount of pieces for token + **/ + totalSupply: AugmentedQuery Observable, [u32, u32]> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; + rmrkCore: { + /** + * Latest yet-unused collection ID. + **/ + collectionIndex: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Mapping from RMRK collection ID to Unique's. + **/ + uniqueCollectionId: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; + rmrkEquip: { + /** + * Checkmark that a Base has a Theme NFT named "default". + **/ + baseHasDefaultTheme: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; + /** + * Map of a Base ID and a Part ID to an NFT in the Base collection serving as the Part. + **/ + inernalPartId: AugmentedQuery Observable>, [u32, u32]> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; + scheduler: { + /** + * Items to be executed, indexed by the block number that they should be executed on. + **/ + agenda: AugmentedQuery Observable>>, [u32]> & QueryableStorageEntry; + /** + * Lookup from identity to the block number and index of the task. + **/ + lookup: AugmentedQuery Observable>>, [U8aFixed]> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; structure: { /** * Generic query diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index 63dece89fd..a45296b428 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -6,10 +6,10 @@ import '@polkadot/api-base/types/submittable'; import type { ApiTypes, AugmentedSubmittable, SubmittableExtrinsic, SubmittableExtrinsicFunction } from '@polkadot/api-base/types'; -import type { Bytes, Compact, Option, U256, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec'; +import type { Bytes, Compact, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types'; -import type { AccountId32, Call, H160, H256, MultiAddress, Perbill } from '@polkadot/types/interfaces/runtime'; -import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; +import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, FrameSupportScheduleMaybeHashed, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartEquippableList, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; export type __AugmentedSubmittable = AugmentedSubmittable<() => unknown>; export type __SubmittableExtrinsic = SubmittableExtrinsic; @@ -202,6 +202,14 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; + foreignAssets: { + registerForeignAsset: AugmentedSubmittable<(owner: AccountId32 | string | Uint8Array, location: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, metadata: PalletForeignAssetsModuleAssetMetadata | { name?: any; symbol?: any; decimals?: any; minimalBalance?: any } | string | Uint8Array) => SubmittableExtrinsic, [AccountId32, XcmVersionedMultiLocation, PalletForeignAssetsModuleAssetMetadata]>; + updateForeignAsset: AugmentedSubmittable<(foreignAssetId: u32 | AnyNumber | Uint8Array, location: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, metadata: PalletForeignAssetsModuleAssetMetadata | { name?: any; symbol?: any; decimals?: any; minimalBalance?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, XcmVersionedMultiLocation, PalletForeignAssetsModuleAssetMetadata]>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; inflation: { /** * This method sets the inflation start date. Can be only called once. @@ -375,6 +383,364 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; + rmrkCore: { + /** + * Accept an NFT sent from another account to self or an owned NFT. + * + * The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first. + * + * # Permissions: + * - Token-owner-to-be + * + * # Arguments: + * - `origin`: sender of the transaction + * - `rmrk_collection_id`: RMRK collection ID of the NFT to be accepted. + * - `rmrk_nft_id`: ID of the NFT to be accepted. + * - `new_owner`: Either the sender's account ID or a sender-owned NFT, + * whichever the accepted NFT was sent to. + **/ + acceptNft: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple | { AccountId: any } | { CollectionAndNftTuple: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsNftAccountIdOrCollectionNftTuple]>; + /** + * Accept the addition of a newly created pending resource to an existing NFT. + * + * This transaction is needed when a resource is created and assigned to an NFT + * by a non-owner, i.e. the collection issuer, with one of the + * [`add_...` transactions](Pallet::add_basic_resource). + * + * # Permissions: + * - Token owner + * + * # Arguments: + * - `origin`: sender of the transaction + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `rmrk_nft_id`: ID of the NFT with a pending resource to be accepted. + * - `resource_id`: ID of the newly created pending resource. + * accept the addition of a new resource to an existing NFT + **/ + acceptResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, resourceId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; + /** + * Accept the removal of a removal-pending resource from an NFT. + * + * This transaction is needed when a non-owner, i.e. the collection issuer, + * requests a [removal](`Pallet::remove_resource`) of a resource from an NFT. + * + * # Permissions: + * - Token owner + * + * # Arguments: + * - `origin`: sender of the transaction + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `rmrk_nft_id`: ID of the NFT with a resource to be removed. + * - `resource_id`: ID of the removal-pending resource. + **/ + acceptResourceRemoval: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, resourceId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; + /** + * Create and set/propose a basic resource for an NFT. + * + * A basic resource is the simplest, lacking a Base and anything that comes with it. + * See RMRK docs for more information and examples. + * + * # Permissions: + * - Collection issuer - if not the token owner, adding the resource will warrant + * the owner's [acceptance](Pallet::accept_resource). + * + * # Arguments: + * - `origin`: sender of the transaction + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `nft_id`: ID of the NFT to assign a resource to. + * - `resource`: Data of the resource to be created. + **/ + addBasicResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resource: RmrkTraitsResourceBasicResource | { src?: any; metadata?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsResourceBasicResource]>; + /** + * Create and set/propose a composable resource for an NFT. + * + * A composable resource links to a Base and has a subset of its Parts it is composed of. + * See RMRK docs for more information and examples. + * + * # Permissions: + * - Collection issuer - if not the token owner, adding the resource will warrant + * the owner's [acceptance](Pallet::accept_resource). + * + * # Arguments: + * - `origin`: sender of the transaction + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `nft_id`: ID of the NFT to assign a resource to. + * - `resource`: Data of the resource to be created. + **/ + addComposableResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resource: RmrkTraitsResourceComposableResource | { parts?: any; base?: any; src?: any; metadata?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsResourceComposableResource]>; + /** + * Create and set/propose a slot resource for an NFT. + * + * A slot resource links to a Base and a slot ID in it which it can fit into. + * See RMRK docs for more information and examples. + * + * # Permissions: + * - Collection issuer - if not the token owner, adding the resource will warrant + * the owner's [acceptance](Pallet::accept_resource). + * + * # Arguments: + * - `origin`: sender of the transaction + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `nft_id`: ID of the NFT to assign a resource to. + * - `resource`: Data of the resource to be created. + **/ + addSlotResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resource: RmrkTraitsResourceSlotResource | { base?: any; src?: any; metadata?: any; slot?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsResourceSlotResource]>; + /** + * Burn an NFT, destroying it and its nested tokens up to the specified limit. + * If the burning budget is exceeded, the transaction is reverted. + * + * This is the way to burn a nested token as well. + * + * For more information, see [`burn_recursively`](pallet_nonfungible::pallet::Pallet::burn_recursively). + * + * # Permissions: + * * Token owner + * + * # Arguments: + * - `origin`: sender of the transaction + * - `collection_id`: RMRK ID of the collection in which the NFT to burn belongs to. + * - `nft_id`: ID of the NFT to be destroyed. + * - `max_burns`: Maximum number of tokens to burn, assuming nesting. The transaction + * is reverted if there are more tokens to burn in the nesting tree than this number. + * This is primarily a mechanism of transaction weight control. + **/ + burnNft: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, maxBurns: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; + /** + * Change the issuer of a collection. Analogous to Unique's collection's [`owner`](up_data_structs::Collection). + * + * # Permissions: + * * Collection issuer + * + * # Arguments: + * - `origin`: sender of the transaction + * - `collection_id`: RMRK collection ID to change the issuer of. + * - `new_issuer`: Collection's new issuer. + **/ + changeCollectionIssuer: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, newIssuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, MultiAddress]>; + /** + * Create a new collection of NFTs. + * + * # Permissions: + * * Anyone - will be assigned as the issuer of the collection. + * + * # Arguments: + * - `origin`: sender of the transaction + * - `metadata`: Metadata describing the collection, e.g. IPFS hash. Cannot be changed. + * - `max`: Optional maximum number of tokens. + * - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs. + * Analogous to Unique's [`token_prefix`](up_data_structs::Collection). Cannot be changed. + **/ + createCollection: AugmentedSubmittable<(metadata: Bytes | string | Uint8Array, max: Option | null | Uint8Array | u32 | AnyNumber, symbol: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes, Option, Bytes]>; + /** + * Destroy a collection. + * + * Only empty collections can be destroyed. If it has any tokens, they must be burned first. + * + * # Permissions: + * * Collection issuer + * + * # Arguments: + * - `origin`: sender of the transaction + * - `collection_id`: RMRK ID of the collection to destroy. + **/ + destroyCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; + /** + * "Lock" the collection and prevent new token creation. Cannot be undone. + * + * # Permissions: + * * Collection issuer + * + * # Arguments: + * - `origin`: sender of the transaction + * - `collection_id`: RMRK ID of the collection to lock. + **/ + lockCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; + /** + * Mint an NFT in a specified collection. + * + * # Permissions: + * * Collection issuer + * + * # Arguments: + * - `origin`: sender of the transaction + * - `owner`: Owner account of the NFT. If set to None, defaults to the sender (collection issuer). + * - `collection_id`: RMRK collection ID for the NFT to be minted within. Cannot be changed. + * - `recipient`: Receiver account of the royalty. Has no effect if the `royalty_amount` is not set. Cannot be changed. + * - `royalty_amount`: Optional permillage reward from each trade for the `recipient`. Cannot be changed. + * - `metadata`: Arbitrary data about an NFT, e.g. IPFS hash. Cannot be changed. + * - `transferable`: Can this NFT be transferred? Cannot be changed. + * - `resources`: Resource data to be added to the NFT immediately after minting. + **/ + mintNft: AugmentedSubmittable<(owner: Option | null | Uint8Array | AccountId32 | string, collectionId: u32 | AnyNumber | Uint8Array, recipient: Option | null | Uint8Array | AccountId32 | string, royaltyAmount: Option | null | Uint8Array | Permill | AnyNumber, metadata: Bytes | string | Uint8Array, transferable: bool | boolean | Uint8Array, resources: Option> | null | Uint8Array | Vec | (RmrkTraitsResourceResourceTypes | { Basic: any } | { Composable: any } | { Slot: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Option, u32, Option, Option, Bytes, bool, Option>]>; + /** + * Reject an NFT sent from another account to self or owned NFT. + * The NFT in question will not be sent back and burnt instead. + * + * The NFT in question must be pending, and, thus, be [sent](`Pallet::send`) first. + * + * # Permissions: + * - Token-owner-to-be-not + * + * # Arguments: + * - `origin`: sender of the transaction + * - `rmrk_collection_id`: RMRK ID of the NFT to be rejected. + * - `rmrk_nft_id`: ID of the NFT to be rejected. + **/ + rejectNft: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32]>; + /** + * Remove and erase a resource from an NFT. + * + * If the sender does not own the NFT, then it will be pending confirmation, + * and will have to be [accepted](Pallet::accept_resource_removal) by the token owner. + * + * # Permissions + * - Collection issuer + * + * # Arguments + * - `origin`: sender of the transaction + * - `rmrk_collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to. + * - `nft_id`: ID of the NFT with a resource to be removed. + * - `resource_id`: ID of the resource to be removed. + **/ + removeResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resourceId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32, u32, u32]>; + /** + * Transfer an NFT from an account/NFT A to another account/NFT B. + * The token must be transferable. Nesting cannot occur deeper than the [`NESTING_BUDGET`]. + * + * If the target owner is an NFT owned by another account, then the NFT will enter + * the pending state and will have to be accepted by the other account. + * + * # Permissions: + * - Token owner + * + * # Arguments: + * - `origin`: sender of the transaction + * - `rmrk_collection_id`: RMRK ID of the collection of the NFT to be transferred. + * - `rmrk_nft_id`: ID of the NFT to be transferred. + * - `new_owner`: New owner of the nft which can be either an account or a NFT. + **/ + send: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple | { AccountId: any } | { CollectionAndNftTuple: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsNftAccountIdOrCollectionNftTuple]>; + /** + * Set a different order of resource priorities for an NFT. Priorities can be used, + * for example, for order of rendering. + * + * Note that the priorities are not updated automatically, and are an empty vector + * by default. There is no pre-set definition for the order to be particular, + * it can be interpreted arbitrarily use-case by use-case. + * + * # Permissions: + * - Token owner + * + * # Arguments: + * - `origin`: sender of the transaction + * - `rmrk_collection_id`: RMRK collection ID of the NFT. + * - `rmrk_nft_id`: ID of the NFT to rearrange resource priorities for. + * - `priorities`: Ordered vector of resource IDs. + **/ + setPriority: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, rmrkNftId: u32 | AnyNumber | Uint8Array, priorities: Vec | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic, [u32, u32, Vec]>; + /** + * Add or edit a custom user property, a key-value pair, describing the metadata + * of a token or a collection, on either one of these. + * + * Note that in this proxy implementation many details regarding RMRK are stored + * as scoped properties prefixed with "rmrk:", normally inaccessible + * to external transactions and RPCs. + * + * # Permissions: + * - Collection issuer - in case of collection property + * - Token owner - in case of NFT property + * + * # Arguments: + * - `origin`: sender of the transaction + * - `rmrk_collection_id`: RMRK collection ID. + * - `maybe_nft_id`: Optional ID of the NFT. If left empty, then the property is set for the collection. + * - `key`: Key of the custom property to be referenced by. + * - `value`: Value of the custom property to be stored. + **/ + setProperty: AugmentedSubmittable<(rmrkCollectionId: Compact | AnyNumber | Uint8Array, maybeNftId: Option | null | Uint8Array | u32 | AnyNumber, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Compact, Option, Bytes, Bytes]>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; + rmrkEquip: { + /** + * Create a new Base. + * + * Modeled after the [Base interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/base.md) + * + * # Permissions + * - Anyone - will be assigned as the issuer of the Base. + * + * # Arguments: + * - `origin`: Caller, will be assigned as the issuer of the Base + * - `base_type`: Arbitrary media type, e.g. "svg". + * - `symbol`: Arbitrary client-chosen symbol. + * - `parts`: Array of Fixed and Slot Parts composing the Base, + * confined in length by [`RmrkPartsLimit`](up_data_structs::RmrkPartsLimit). + **/ + createBase: AugmentedSubmittable<(baseType: Bytes | string | Uint8Array, symbol: Bytes | string | Uint8Array, parts: Vec | (RmrkTraitsPartPartType | { FixedPart: any } | { SlotPart: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Bytes, Bytes, Vec]>; + /** + * Update the array of Collections allowed to be equipped to a Base's specified Slot Part. + * + * Modeled after [equippable interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/equippable.md). + * + * # Permissions: + * - Base issuer + * + * # Arguments: + * - `origin`: sender of the transaction + * - `base_id`: Base containing the Slot Part to be updated. + * - `slot_id`: Slot Part whose Equippable List is being updated . + * - `equippables`: List of equippables that will override the current Equippables list. + **/ + equippable: AugmentedSubmittable<(baseId: u32 | AnyNumber | Uint8Array, slotId: u32 | AnyNumber | Uint8Array, equippables: RmrkTraitsPartEquippableList | { All: any } | { Empty: any } | { Custom: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, u32, RmrkTraitsPartEquippableList]>; + /** + * Add a Theme to a Base. + * A Theme named "default" is required prior to adding other Themes. + * + * Modeled after [Themeadd interaction](https://github.com/rmrk-team/rmrk-spec/blob/master/standards/rmrk2.0.0/interactions/themeadd.md). + * + * # Permissions: + * - Base issuer + * + * # Arguments: + * - `origin`: sender of the transaction + * - `base_id`: Base ID containing the Theme to be updated. + * - `theme`: Theme to add to the Base. A Theme has a name and properties, which are an + * array of [key, value, inherit]. + * - `key`: Arbitrary BoundedString, defined by client. + * - `value`: Arbitrary BoundedString, defined by client. + * - `inherit`: Optional bool. + **/ + themeAdd: AugmentedSubmittable<(baseId: u32 | AnyNumber | Uint8Array, theme: RmrkTraitsTheme | { name?: any; properties?: any; inherit?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, RmrkTraitsTheme]>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; + scheduler: { + /** + * Cancel a named scheduled task. + **/ + cancelNamed: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed]>; + /** + * Schedule a named task. + **/ + scheduleNamed: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + /** + * Schedule a named task after a delay. + * + * # + * Same as [`schedule_named`](Self::schedule_named). + * # + **/ + scheduleNamedAfter: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; structure: { /** * Generic tx diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index 73aa349e72..ee9aaef743 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UniqueRuntimeRuntime, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; @@ -325,6 +325,7 @@ declare module '@polkadot/types/types/registry' { CumulusPalletXcmCall: CumulusPalletXcmCall; CumulusPalletXcmError: CumulusPalletXcmError; CumulusPalletXcmEvent: CumulusPalletXcmEvent; + CumulusPalletXcmOrigin: CumulusPalletXcmOrigin; CumulusPalletXcmpQueueCall: CumulusPalletXcmpQueueCall; CumulusPalletXcmpQueueError: CumulusPalletXcmpQueueError; CumulusPalletXcmpQueueEvent: CumulusPalletXcmpQueueEvent; @@ -514,7 +515,10 @@ declare module '@polkadot/types/types/registry' { ForkTreePendingChange: ForkTreePendingChange; ForkTreePendingChangeNode: ForkTreePendingChangeNode; FpRpcTransactionStatus: FpRpcTransactionStatus; + FrameSupportDispatchRawOrigin: FrameSupportDispatchRawOrigin; FrameSupportPalletId: FrameSupportPalletId; + FrameSupportScheduleLookupError: FrameSupportScheduleLookupError; + FrameSupportScheduleMaybeHashed: FrameSupportScheduleMaybeHashed; FrameSupportTokensMiscBalanceStatus: FrameSupportTokensMiscBalanceStatus; FrameSupportWeightsDispatchClass: FrameSupportWeightsDispatchClass; FrameSupportWeightsDispatchInfo: FrameSupportWeightsDispatchInfo; @@ -766,6 +770,8 @@ declare module '@polkadot/types/types/registry' { OffenceDetails: OffenceDetails; Offender: Offender; OldV1SessionInfo: OldV1SessionInfo; + OpalRuntimeOriginCaller: OpalRuntimeOriginCaller; + OpalRuntimeRuntime: OpalRuntimeRuntime; OpaqueCall: OpaqueCall; OpaqueKeyOwnershipProof: OpaqueKeyOwnershipProof; OpaqueMetadata: OpaqueMetadata; @@ -828,6 +834,7 @@ declare module '@polkadot/types/types/registry' { PalletEthereumError: PalletEthereumError; PalletEthereumEvent: PalletEthereumEvent; PalletEthereumFakeTransactionFinalizer: PalletEthereumFakeTransactionFinalizer; + PalletEthereumRawOrigin: PalletEthereumRawOrigin; PalletEventMetadataLatest: PalletEventMetadataLatest; PalletEventMetadataV14: PalletEventMetadataV14; PalletEvmAccountBasicCrossAccountIdRepr: PalletEvmAccountBasicCrossAccountIdRepr; @@ -840,6 +847,10 @@ declare module '@polkadot/types/types/registry' { PalletEvmMigrationCall: PalletEvmMigrationCall; PalletEvmMigrationError: PalletEvmMigrationError; PalletForeignAssetsAssetIds: PalletForeignAssetsAssetIds; + PalletForeignAssetsModuleAssetMetadata: PalletForeignAssetsModuleAssetMetadata; + PalletForeignAssetsModuleCall: PalletForeignAssetsModuleCall; + PalletForeignAssetsModuleError: PalletForeignAssetsModuleError; + PalletForeignAssetsModuleEvent: PalletForeignAssetsModuleEvent; PalletForeignAssetsNativeCurrency: PalletForeignAssetsNativeCurrency; PalletFungibleError: PalletFungibleError; PalletId: PalletId; @@ -848,6 +859,14 @@ declare module '@polkadot/types/types/registry' { PalletMetadataV14: PalletMetadataV14; PalletNonfungibleError: PalletNonfungibleError; PalletNonfungibleItemData: PalletNonfungibleItemData; + PalletRefungibleError: PalletRefungibleError; + PalletRefungibleItemData: PalletRefungibleItemData; + PalletRmrkCoreCall: PalletRmrkCoreCall; + PalletRmrkCoreError: PalletRmrkCoreError; + PalletRmrkCoreEvent: PalletRmrkCoreEvent; + PalletRmrkEquipCall: PalletRmrkEquipCall; + PalletRmrkEquipError: PalletRmrkEquipError; + PalletRmrkEquipEvent: PalletRmrkEquipEvent; PalletsOrigin: PalletsOrigin; PalletStorageMetadataLatest: PalletStorageMetadataLatest; PalletStorageMetadataV14: PalletStorageMetadataV14; @@ -869,10 +888,15 @@ declare module '@polkadot/types/types/registry' { PalletUniqueCall: PalletUniqueCall; PalletUniqueError: PalletUniqueError; PalletUniqueRawEvent: PalletUniqueRawEvent; + PalletUniqueSchedulerCall: PalletUniqueSchedulerCall; + PalletUniqueSchedulerError: PalletUniqueSchedulerError; + PalletUniqueSchedulerEvent: PalletUniqueSchedulerEvent; + PalletUniqueSchedulerScheduledV3: PalletUniqueSchedulerScheduledV3; PalletVersion: PalletVersion; PalletXcmCall: PalletXcmCall; PalletXcmError: PalletXcmError; PalletXcmEvent: PalletXcmEvent; + PalletXcmOrigin: PalletXcmOrigin; ParachainDispatchOrigin: ParachainDispatchOrigin; ParachainInherentData: ParachainInherentData; ParachainProposal: ParachainProposal; @@ -1146,6 +1170,7 @@ declare module '@polkadot/types/types/registry' { SpCoreEcdsaSignature: SpCoreEcdsaSignature; SpCoreEd25519Signature: SpCoreEd25519Signature; SpCoreSr25519Signature: SpCoreSr25519Signature; + SpCoreVoid: SpCoreVoid; SpecVersion: SpecVersion; SpRuntimeArithmeticError: SpRuntimeArithmeticError; SpRuntimeDigest: SpRuntimeDigest; @@ -1255,7 +1280,6 @@ declare module '@polkadot/types/types/registry' { UnappliedSlash: UnappliedSlash; UnappliedSlashOther: UnappliedSlashOther; UncleEntryItem: UncleEntryItem; - UniqueRuntimeRuntime: UniqueRuntimeRuntime; UnknownTransaction: UnknownTransaction; UnlockChunk: UnlockChunk; UnrewardedRelayer: UnrewardedRelayer; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 1a2d23b8cb..56a108c069 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -153,6 +153,14 @@ export interface CumulusPalletXcmEvent extends Enum { readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; } +/** @name CumulusPalletXcmOrigin */ +export interface CumulusPalletXcmOrigin extends Enum { + readonly isRelay: boolean; + readonly isSiblingParachain: boolean; + readonly asSiblingParachain: u32; + readonly type: 'Relay' | 'SiblingParachain'; +} + /** @name CumulusPalletXcmpQueueCall */ export interface CumulusPalletXcmpQueueCall extends Enum { readonly isServiceOverweight: boolean; @@ -493,9 +501,34 @@ export interface FpRpcTransactionStatus extends Struct { readonly logsBloom: EthbloomBloom; } +/** @name FrameSupportDispatchRawOrigin */ +export interface FrameSupportDispatchRawOrigin extends Enum { + readonly isRoot: boolean; + readonly isSigned: boolean; + readonly asSigned: AccountId32; + readonly isNone: boolean; + readonly type: 'Root' | 'Signed' | 'None'; +} + /** @name FrameSupportPalletId */ export interface FrameSupportPalletId extends U8aFixed {} +/** @name FrameSupportScheduleLookupError */ +export interface FrameSupportScheduleLookupError extends Enum { + readonly isUnknown: boolean; + readonly isBadFormat: boolean; + readonly type: 'Unknown' | 'BadFormat'; +} + +/** @name FrameSupportScheduleMaybeHashed */ +export interface FrameSupportScheduleMaybeHashed extends Enum { + readonly isValue: boolean; + readonly asValue: Call; + readonly isHash: boolean; + readonly asHash: H256; + readonly type: 'Value' | 'Hash'; +} + /** @name FrameSupportTokensMiscBalanceStatus */ export interface FrameSupportTokensMiscBalanceStatus extends Enum { readonly isFree: boolean; @@ -696,6 +729,24 @@ export interface FrameSystemPhase extends Enum { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } +/** @name OpalRuntimeOriginCaller */ +export interface OpalRuntimeOriginCaller extends Enum { + readonly isSystem: boolean; + readonly asSystem: FrameSupportDispatchRawOrigin; + readonly isVoid: boolean; + readonly asVoid: SpCoreVoid; + readonly isPolkadotXcm: boolean; + readonly asPolkadotXcm: PalletXcmOrigin; + readonly isCumulusXcm: boolean; + readonly asCumulusXcm: CumulusPalletXcmOrigin; + readonly isEthereum: boolean; + readonly asEthereum: PalletEthereumRawOrigin; + readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; +} + +/** @name OpalRuntimeRuntime */ +export interface OpalRuntimeRuntime extends Null {} + /** @name OrmlTokensAccountData */ export interface OrmlTokensAccountData extends Struct { readonly free: u128; @@ -1245,6 +1296,13 @@ export interface PalletEthereumEvent extends Enum { /** @name PalletEthereumFakeTransactionFinalizer */ export interface PalletEthereumFakeTransactionFinalizer extends Null {} +/** @name PalletEthereumRawOrigin */ +export interface PalletEthereumRawOrigin extends Enum { + readonly isEthereumTransaction: boolean; + readonly asEthereumTransaction: H160; + readonly type: 'EthereumTransaction'; +} + /** @name PalletEvmAccountBasicCrossAccountIdRepr */ export interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { readonly isSubstrate: boolean; @@ -1386,6 +1444,67 @@ export interface PalletForeignAssetsAssetIds extends Enum { readonly type: 'ForeignAssetId' | 'NativeAssetId'; } +/** @name PalletForeignAssetsModuleAssetMetadata */ +export interface PalletForeignAssetsModuleAssetMetadata extends Struct { + readonly name: Bytes; + readonly symbol: Bytes; + readonly decimals: u8; + readonly minimalBalance: u128; +} + +/** @name PalletForeignAssetsModuleCall */ +export interface PalletForeignAssetsModuleCall extends Enum { + readonly isRegisterForeignAsset: boolean; + readonly asRegisterForeignAsset: { + readonly owner: AccountId32; + readonly location: XcmVersionedMultiLocation; + readonly metadata: PalletForeignAssetsModuleAssetMetadata; + } & Struct; + readonly isUpdateForeignAsset: boolean; + readonly asUpdateForeignAsset: { + readonly foreignAssetId: u32; + readonly location: XcmVersionedMultiLocation; + readonly metadata: PalletForeignAssetsModuleAssetMetadata; + } & Struct; + readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset'; +} + +/** @name PalletForeignAssetsModuleError */ +export interface PalletForeignAssetsModuleError extends Enum { + readonly isBadLocation: boolean; + readonly isMultiLocationExisted: boolean; + readonly isAssetIdNotExists: boolean; + readonly isAssetIdExisted: boolean; + readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted'; +} + +/** @name PalletForeignAssetsModuleEvent */ +export interface PalletForeignAssetsModuleEvent extends Enum { + readonly isForeignAssetRegistered: boolean; + readonly asForeignAssetRegistered: { + readonly assetId: u32; + readonly assetAddress: XcmV1MultiLocation; + readonly metadata: PalletForeignAssetsModuleAssetMetadata; + } & Struct; + readonly isForeignAssetUpdated: boolean; + readonly asForeignAssetUpdated: { + readonly assetId: u32; + readonly assetAddress: XcmV1MultiLocation; + readonly metadata: PalletForeignAssetsModuleAssetMetadata; + } & Struct; + readonly isAssetRegistered: boolean; + readonly asAssetRegistered: { + readonly assetId: PalletForeignAssetsAssetIds; + readonly metadata: PalletForeignAssetsModuleAssetMetadata; + } & Struct; + readonly isAssetUpdated: boolean; + readonly asAssetUpdated: { + readonly assetId: PalletForeignAssetsAssetIds; + readonly metadata: PalletForeignAssetsModuleAssetMetadata; + } & Struct; + readonly type: 'ForeignAssetRegistered' | 'ForeignAssetUpdated' | 'AssetRegistered' | 'AssetUpdated'; +} + /** @name PalletForeignAssetsNativeCurrency */ export interface PalletForeignAssetsNativeCurrency extends Enum { readonly isHere: boolean; @@ -1425,6 +1544,290 @@ export interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } +/** @name PalletRefungibleError */ +export interface PalletRefungibleError extends Enum { + readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; + readonly isWrongRefungiblePieces: boolean; + readonly isRepartitionWhileNotOwningAllPieces: boolean; + readonly isRefungibleDisallowsNesting: boolean; + readonly isSettingPropertiesNotAllowed: boolean; + readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; +} + +/** @name PalletRefungibleItemData */ +export interface PalletRefungibleItemData extends Struct { + readonly constData: Bytes; +} + +/** @name PalletRmrkCoreCall */ +export interface PalletRmrkCoreCall extends Enum { + readonly isCreateCollection: boolean; + readonly asCreateCollection: { + readonly metadata: Bytes; + readonly max: Option; + readonly symbol: Bytes; + } & Struct; + readonly isDestroyCollection: boolean; + readonly asDestroyCollection: { + readonly collectionId: u32; + } & Struct; + readonly isChangeCollectionIssuer: boolean; + readonly asChangeCollectionIssuer: { + readonly collectionId: u32; + readonly newIssuer: MultiAddress; + } & Struct; + readonly isLockCollection: boolean; + readonly asLockCollection: { + readonly collectionId: u32; + } & Struct; + readonly isMintNft: boolean; + readonly asMintNft: { + readonly owner: Option; + readonly collectionId: u32; + readonly recipient: Option; + readonly royaltyAmount: Option; + readonly metadata: Bytes; + readonly transferable: bool; + readonly resources: Option>; + } & Struct; + readonly isBurnNft: boolean; + readonly asBurnNft: { + readonly collectionId: u32; + readonly nftId: u32; + readonly maxBurns: u32; + } & Struct; + readonly isSend: boolean; + readonly asSend: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; + } & Struct; + readonly isAcceptNft: boolean; + readonly asAcceptNft: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; + } & Struct; + readonly isRejectNft: boolean; + readonly asRejectNft: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + } & Struct; + readonly isAcceptResource: boolean; + readonly asAcceptResource: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly resourceId: u32; + } & Struct; + readonly isAcceptResourceRemoval: boolean; + readonly asAcceptResourceRemoval: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly resourceId: u32; + } & Struct; + readonly isSetProperty: boolean; + readonly asSetProperty: { + readonly rmrkCollectionId: Compact; + readonly maybeNftId: Option; + readonly key: Bytes; + readonly value: Bytes; + } & Struct; + readonly isSetPriority: boolean; + readonly asSetPriority: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly priorities: Vec; + } & Struct; + readonly isAddBasicResource: boolean; + readonly asAddBasicResource: { + readonly rmrkCollectionId: u32; + readonly nftId: u32; + readonly resource: RmrkTraitsResourceBasicResource; + } & Struct; + readonly isAddComposableResource: boolean; + readonly asAddComposableResource: { + readonly rmrkCollectionId: u32; + readonly nftId: u32; + readonly resource: RmrkTraitsResourceComposableResource; + } & Struct; + readonly isAddSlotResource: boolean; + readonly asAddSlotResource: { + readonly rmrkCollectionId: u32; + readonly nftId: u32; + readonly resource: RmrkTraitsResourceSlotResource; + } & Struct; + readonly isRemoveResource: boolean; + readonly asRemoveResource: { + readonly rmrkCollectionId: u32; + readonly nftId: u32; + readonly resourceId: u32; + } & Struct; + readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; +} + +/** @name PalletRmrkCoreError */ +export interface PalletRmrkCoreError extends Enum { + readonly isCorruptedCollectionType: boolean; + readonly isRmrkPropertyKeyIsTooLong: boolean; + readonly isRmrkPropertyValueIsTooLong: boolean; + readonly isRmrkPropertyIsNotFound: boolean; + readonly isUnableToDecodeRmrkData: boolean; + readonly isCollectionNotEmpty: boolean; + readonly isNoAvailableCollectionId: boolean; + readonly isNoAvailableNftId: boolean; + readonly isCollectionUnknown: boolean; + readonly isNoPermission: boolean; + readonly isNonTransferable: boolean; + readonly isCollectionFullOrLocked: boolean; + readonly isResourceDoesntExist: boolean; + readonly isCannotSendToDescendentOrSelf: boolean; + readonly isCannotAcceptNonOwnedNft: boolean; + readonly isCannotRejectNonOwnedNft: boolean; + readonly isCannotRejectNonPendingNft: boolean; + readonly isResourceNotPending: boolean; + readonly isNoAvailableResourceId: boolean; + readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; +} + +/** @name PalletRmrkCoreEvent */ +export interface PalletRmrkCoreEvent extends Enum { + readonly isCollectionCreated: boolean; + readonly asCollectionCreated: { + readonly issuer: AccountId32; + readonly collectionId: u32; + } & Struct; + readonly isCollectionDestroyed: boolean; + readonly asCollectionDestroyed: { + readonly issuer: AccountId32; + readonly collectionId: u32; + } & Struct; + readonly isIssuerChanged: boolean; + readonly asIssuerChanged: { + readonly oldIssuer: AccountId32; + readonly newIssuer: AccountId32; + readonly collectionId: u32; + } & Struct; + readonly isCollectionLocked: boolean; + readonly asCollectionLocked: { + readonly issuer: AccountId32; + readonly collectionId: u32; + } & Struct; + readonly isNftMinted: boolean; + readonly asNftMinted: { + readonly owner: AccountId32; + readonly collectionId: u32; + readonly nftId: u32; + } & Struct; + readonly isNftBurned: boolean; + readonly asNftBurned: { + readonly owner: AccountId32; + readonly nftId: u32; + } & Struct; + readonly isNftSent: boolean; + readonly asNftSent: { + readonly sender: AccountId32; + readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; + readonly collectionId: u32; + readonly nftId: u32; + readonly approvalRequired: bool; + } & Struct; + readonly isNftAccepted: boolean; + readonly asNftAccepted: { + readonly sender: AccountId32; + readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; + readonly collectionId: u32; + readonly nftId: u32; + } & Struct; + readonly isNftRejected: boolean; + readonly asNftRejected: { + readonly sender: AccountId32; + readonly collectionId: u32; + readonly nftId: u32; + } & Struct; + readonly isPropertySet: boolean; + readonly asPropertySet: { + readonly collectionId: u32; + readonly maybeNftId: Option; + readonly key: Bytes; + readonly value: Bytes; + } & Struct; + readonly isResourceAdded: boolean; + readonly asResourceAdded: { + readonly nftId: u32; + readonly resourceId: u32; + } & Struct; + readonly isResourceRemoval: boolean; + readonly asResourceRemoval: { + readonly nftId: u32; + readonly resourceId: u32; + } & Struct; + readonly isResourceAccepted: boolean; + readonly asResourceAccepted: { + readonly nftId: u32; + readonly resourceId: u32; + } & Struct; + readonly isResourceRemovalAccepted: boolean; + readonly asResourceRemovalAccepted: { + readonly nftId: u32; + readonly resourceId: u32; + } & Struct; + readonly isPrioritySet: boolean; + readonly asPrioritySet: { + readonly collectionId: u32; + readonly nftId: u32; + } & Struct; + readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; +} + +/** @name PalletRmrkEquipCall */ +export interface PalletRmrkEquipCall extends Enum { + readonly isCreateBase: boolean; + readonly asCreateBase: { + readonly baseType: Bytes; + readonly symbol: Bytes; + readonly parts: Vec; + } & Struct; + readonly isThemeAdd: boolean; + readonly asThemeAdd: { + readonly baseId: u32; + readonly theme: RmrkTraitsTheme; + } & Struct; + readonly isEquippable: boolean; + readonly asEquippable: { + readonly baseId: u32; + readonly slotId: u32; + readonly equippables: RmrkTraitsPartEquippableList; + } & Struct; + readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; +} + +/** @name PalletRmrkEquipError */ +export interface PalletRmrkEquipError extends Enum { + readonly isPermissionError: boolean; + readonly isNoAvailableBaseId: boolean; + readonly isNoAvailablePartId: boolean; + readonly isBaseDoesntExist: boolean; + readonly isNeedsDefaultThemeFirst: boolean; + readonly isPartDoesntExist: boolean; + readonly isNoEquippableOnFixedPart: boolean; + readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; +} + +/** @name PalletRmrkEquipEvent */ +export interface PalletRmrkEquipEvent extends Enum { + readonly isBaseCreated: boolean; + readonly asBaseCreated: { + readonly issuer: AccountId32; + readonly baseId: u32; + } & Struct; + readonly isEquippablesUpdated: boolean; + readonly asEquippablesUpdated: { + readonly baseId: u32; + readonly slotId: u32; + } & Struct; + readonly type: 'BaseCreated' | 'EquippablesUpdated'; +} + /** @name PalletStructureCall */ export interface PalletStructureCall extends Null {} @@ -1802,6 +2205,76 @@ export interface PalletUniqueRawEvent extends Enum { readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet'; } +/** @name PalletUniqueSchedulerCall */ +export interface PalletUniqueSchedulerCall extends Enum { + readonly isScheduleNamed: boolean; + readonly asScheduleNamed: { + readonly id: U8aFixed; + readonly when: u32; + readonly maybePeriodic: Option>; + readonly priority: u8; + readonly call: FrameSupportScheduleMaybeHashed; + } & Struct; + readonly isCancelNamed: boolean; + readonly asCancelNamed: { + readonly id: U8aFixed; + } & Struct; + readonly isScheduleNamedAfter: boolean; + readonly asScheduleNamedAfter: { + readonly id: U8aFixed; + readonly after: u32; + readonly maybePeriodic: Option>; + readonly priority: u8; + readonly call: FrameSupportScheduleMaybeHashed; + } & Struct; + readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; +} + +/** @name PalletUniqueSchedulerError */ +export interface PalletUniqueSchedulerError extends Enum { + readonly isFailedToSchedule: boolean; + readonly isNotFound: boolean; + readonly isTargetBlockNumberInPast: boolean; + readonly isRescheduleNoChange: boolean; + readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; +} + +/** @name PalletUniqueSchedulerEvent */ +export interface PalletUniqueSchedulerEvent extends Enum { + readonly isScheduled: boolean; + readonly asScheduled: { + readonly when: u32; + readonly index: u32; + } & Struct; + readonly isCanceled: boolean; + readonly asCanceled: { + readonly when: u32; + readonly index: u32; + } & Struct; + readonly isDispatched: boolean; + readonly asDispatched: { + readonly task: ITuple<[u32, u32]>; + readonly id: Option; + readonly result: Result; + } & Struct; + readonly isCallLookupFailed: boolean; + readonly asCallLookupFailed: { + readonly task: ITuple<[u32, u32]>; + readonly id: Option; + readonly error: FrameSupportScheduleLookupError; + } & Struct; + readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; +} + +/** @name PalletUniqueSchedulerScheduledV3 */ +export interface PalletUniqueSchedulerScheduledV3 extends Struct { + readonly maybeId: Option; + readonly priority: u8; + readonly call: FrameSupportScheduleMaybeHashed; + readonly maybePeriodic: Option>; + readonly origin: OpalRuntimeOriginCaller; +} + /** @name PalletXcmCall */ export interface PalletXcmCall extends Enum { readonly isSend: boolean; @@ -1919,6 +2392,15 @@ export interface PalletXcmEvent extends Enum { readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail'; } +/** @name PalletXcmOrigin */ +export interface PalletXcmOrigin extends Enum { + readonly isXcm: boolean; + readonly asXcm: XcmV1MultiLocation; + readonly isResponse: boolean; + readonly asResponse: XcmV1MultiLocation; + readonly type: 'Xcm' | 'Response'; +} + /** @name PhantomTypeUpDataStructs */ export interface PhantomTypeUpDataStructs extends Vec> {} @@ -2139,6 +2621,9 @@ export interface SpCoreEd25519Signature extends U8aFixed {} /** @name SpCoreSr25519Signature */ export interface SpCoreSr25519Signature extends U8aFixed {} +/** @name SpCoreVoid */ +export interface SpCoreVoid extends Null {} + /** @name SpRuntimeArithmeticError */ export interface SpRuntimeArithmeticError extends Enum { readonly isUnderflow: boolean; @@ -2238,9 +2723,6 @@ export interface SpVersionRuntimeVersion extends Struct { readonly stateVersion: u8; } -/** @name UniqueRuntimeRuntime */ -export interface UniqueRuntimeRuntime extends Null {} - /** @name UpDataStructsAccessMode */ export interface UpDataStructsAccessMode extends Enum { readonly isNormal: boolean; diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index d166acb300..f3a4ca711a 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -54,7 +54,7 @@ export default { } }, /** - * Lookup16: frame_system::EventRecord + * Lookup16: frame_system::EventRecord **/ FrameSystemEventRecord: { phase: 'FrameSystemPhase', @@ -1004,7 +1004,38 @@ export default { } }, /** - * Lookup92: pallet_common::pallet::Event + * Lookup92: pallet_unique_scheduler::pallet::Event + **/ + PalletUniqueSchedulerEvent: { + _enum: { + Scheduled: { + when: 'u32', + index: 'u32', + }, + Canceled: { + when: 'u32', + index: 'u32', + }, + Dispatched: { + task: '(u32,u32)', + id: 'Option<[u8;16]>', + result: 'Result', + }, + CallLookupFailed: { + task: '(u32,u32)', + id: 'Option<[u8;16]>', + error: 'FrameSupportScheduleLookupError' + } + } + }, + /** + * Lookup95: frame_support::traits::schedule::LookupError + **/ + FrameSupportScheduleLookupError: { + _enum: ['Unknown', 'BadFormat'] + }, + /** + * Lookup96: pallet_common::pallet::Event **/ PalletCommonEvent: { _enum: { @@ -1022,7 +1053,7 @@ export default { } }, /** - * Lookup95: pallet_structure::pallet::Event + * Lookup99: pallet_structure::pallet::Event **/ PalletStructureEvent: { _enum: { @@ -1030,7 +1061,142 @@ export default { } }, /** - * Lookup96: pallet_evm::pallet::Event + * Lookup100: pallet_rmrk_core::pallet::Event + **/ + PalletRmrkCoreEvent: { + _enum: { + CollectionCreated: { + issuer: 'AccountId32', + collectionId: 'u32', + }, + CollectionDestroyed: { + issuer: 'AccountId32', + collectionId: 'u32', + }, + IssuerChanged: { + oldIssuer: 'AccountId32', + newIssuer: 'AccountId32', + collectionId: 'u32', + }, + CollectionLocked: { + issuer: 'AccountId32', + collectionId: 'u32', + }, + NftMinted: { + owner: 'AccountId32', + collectionId: 'u32', + nftId: 'u32', + }, + NFTBurned: { + owner: 'AccountId32', + nftId: 'u32', + }, + NFTSent: { + sender: 'AccountId32', + recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', + collectionId: 'u32', + nftId: 'u32', + approvalRequired: 'bool', + }, + NFTAccepted: { + sender: 'AccountId32', + recipient: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', + collectionId: 'u32', + nftId: 'u32', + }, + NFTRejected: { + sender: 'AccountId32', + collectionId: 'u32', + nftId: 'u32', + }, + PropertySet: { + collectionId: 'u32', + maybeNftId: 'Option', + key: 'Bytes', + value: 'Bytes', + }, + ResourceAdded: { + nftId: 'u32', + resourceId: 'u32', + }, + ResourceRemoval: { + nftId: 'u32', + resourceId: 'u32', + }, + ResourceAccepted: { + nftId: 'u32', + resourceId: 'u32', + }, + ResourceRemovalAccepted: { + nftId: 'u32', + resourceId: 'u32', + }, + PrioritySet: { + collectionId: 'u32', + nftId: 'u32' + } + } + }, + /** + * Lookup101: rmrk_traits::nft::AccountIdOrCollectionNftTuple + **/ + RmrkTraitsNftAccountIdOrCollectionNftTuple: { + _enum: { + AccountId: 'AccountId32', + CollectionAndNftTuple: '(u32,u32)' + } + }, + /** + * Lookup106: pallet_rmrk_equip::pallet::Event + **/ + PalletRmrkEquipEvent: { + _enum: { + BaseCreated: { + issuer: 'AccountId32', + baseId: 'u32', + }, + EquippablesUpdated: { + baseId: 'u32', + slotId: 'u32' + } + } + }, + /** + * Lookup107: pallet_foreign_assets::module::Event + **/ + PalletForeignAssetsModuleEvent: { + _enum: { + ForeignAssetRegistered: { + assetId: 'u32', + assetAddress: 'XcmV1MultiLocation', + metadata: 'PalletForeignAssetsModuleAssetMetadata', + }, + ForeignAssetUpdated: { + assetId: 'u32', + assetAddress: 'XcmV1MultiLocation', + metadata: 'PalletForeignAssetsModuleAssetMetadata', + }, + AssetRegistered: { + assetId: 'PalletForeignAssetsAssetIds', + metadata: 'PalletForeignAssetsModuleAssetMetadata', + }, + AssetUpdated: { + assetId: 'PalletForeignAssetsAssetIds', + metadata: 'PalletForeignAssetsModuleAssetMetadata' + } + } + }, + /** + * Lookup108: pallet_foreign_assets::module::AssetMetadata + **/ + PalletForeignAssetsModuleAssetMetadata: { + name: 'Bytes', + symbol: 'Bytes', + decimals: 'u8', + minimalBalance: 'u128' + }, + /** + * Lookup109: pallet_evm::pallet::Event **/ PalletEvmEvent: { _enum: { @@ -1044,7 +1210,7 @@ export default { } }, /** - * Lookup97: ethereum::log::Log + * Lookup110: ethereum::log::Log **/ EthereumLog: { address: 'H160', @@ -1052,7 +1218,7 @@ export default { data: 'Bytes' }, /** - * Lookup101: pallet_ethereum::pallet::Event + * Lookup114: pallet_ethereum::pallet::Event **/ PalletEthereumEvent: { _enum: { @@ -1060,7 +1226,7 @@ export default { } }, /** - * Lookup102: evm_core::error::ExitReason + * Lookup115: evm_core::error::ExitReason **/ EvmCoreErrorExitReason: { _enum: { @@ -1071,13 +1237,13 @@ export default { } }, /** - * Lookup103: evm_core::error::ExitSucceed + * Lookup116: evm_core::error::ExitSucceed **/ EvmCoreErrorExitSucceed: { _enum: ['Stopped', 'Returned', 'Suicided'] }, /** - * Lookup104: evm_core::error::ExitError + * Lookup117: evm_core::error::ExitError **/ EvmCoreErrorExitError: { _enum: { @@ -1099,13 +1265,13 @@ export default { } }, /** - * Lookup107: evm_core::error::ExitRevert + * Lookup120: evm_core::error::ExitRevert **/ EvmCoreErrorExitRevert: { _enum: ['Reverted'] }, /** - * Lookup108: evm_core::error::ExitFatal + * Lookup121: evm_core::error::ExitFatal **/ EvmCoreErrorExitFatal: { _enum: { @@ -1116,7 +1282,7 @@ export default { } }, /** - * Lookup109: frame_system::Phase + * Lookup122: frame_system::Phase **/ FrameSystemPhase: { _enum: { @@ -1126,14 +1292,14 @@ export default { } }, /** - * Lookup112: frame_system::LastRuntimeUpgradeInfo + * Lookup124: frame_system::LastRuntimeUpgradeInfo **/ FrameSystemLastRuntimeUpgradeInfo: { specVersion: 'Compact', specName: 'Text' }, /** - * Lookup114: frame_system::pallet::Call + * Lookup125: frame_system::pallet::Call **/ FrameSystemCall: { _enum: { @@ -1171,7 +1337,7 @@ export default { } }, /** - * Lookup119: frame_system::limits::BlockWeights + * Lookup130: frame_system::limits::BlockWeights **/ FrameSystemLimitsBlockWeights: { baseBlock: 'u64', @@ -1179,7 +1345,7 @@ export default { perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass' }, /** - * Lookup120: frame_support::weights::PerDispatchClass + * Lookup131: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassWeightsPerClass: { normal: 'FrameSystemLimitsWeightsPerClass', @@ -1187,7 +1353,7 @@ export default { mandatory: 'FrameSystemLimitsWeightsPerClass' }, /** - * Lookup121: frame_system::limits::WeightsPerClass + * Lookup132: frame_system::limits::WeightsPerClass **/ FrameSystemLimitsWeightsPerClass: { baseExtrinsic: 'u64', @@ -1196,13 +1362,13 @@ export default { reserved: 'Option' }, /** - * Lookup123: frame_system::limits::BlockLength + * Lookup134: frame_system::limits::BlockLength **/ FrameSystemLimitsBlockLength: { max: 'FrameSupportWeightsPerDispatchClassU32' }, /** - * Lookup124: frame_support::weights::PerDispatchClass + * Lookup135: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassU32: { normal: 'u32', @@ -1210,14 +1376,14 @@ export default { mandatory: 'u32' }, /** - * Lookup125: frame_support::weights::RuntimeDbWeight + * Lookup136: frame_support::weights::RuntimeDbWeight **/ FrameSupportWeightsRuntimeDbWeight: { read: 'u64', write: 'u64' }, /** - * Lookup126: sp_version::RuntimeVersion + * Lookup137: sp_version::RuntimeVersion **/ SpVersionRuntimeVersion: { specName: 'Text', @@ -1230,13 +1396,13 @@ export default { stateVersion: 'u8' }, /** - * Lookup131: frame_system::pallet::Error + * Lookup142: frame_system::pallet::Error **/ FrameSystemError: { _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] }, /** - * Lookup132: polkadot_primitives::v2::PersistedValidationData + * Lookup143: polkadot_primitives::v2::PersistedValidationData **/ PolkadotPrimitivesV2PersistedValidationData: { parentHead: 'Bytes', @@ -1245,19 +1411,19 @@ export default { maxPovSize: 'u32' }, /** - * Lookup135: polkadot_primitives::v2::UpgradeRestriction + * Lookup146: polkadot_primitives::v2::UpgradeRestriction **/ PolkadotPrimitivesV2UpgradeRestriction: { _enum: ['Present'] }, /** - * Lookup136: sp_trie::storage_proof::StorageProof + * Lookup147: sp_trie::storage_proof::StorageProof **/ SpTrieStorageProof: { trieNodes: 'BTreeSet' }, /** - * Lookup138: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot + * Lookup149: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot **/ CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: { dmqMqcHead: 'H256', @@ -1266,7 +1432,7 @@ export default { egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>' }, /** - * Lookup141: polkadot_primitives::v2::AbridgedHrmpChannel + * Lookup152: polkadot_primitives::v2::AbridgedHrmpChannel **/ PolkadotPrimitivesV2AbridgedHrmpChannel: { maxCapacity: 'u32', @@ -1277,7 +1443,7 @@ export default { mqcHead: 'Option' }, /** - * Lookup142: polkadot_primitives::v2::AbridgedHostConfiguration + * Lookup153: polkadot_primitives::v2::AbridgedHostConfiguration **/ PolkadotPrimitivesV2AbridgedHostConfiguration: { maxCodeSize: 'u32', @@ -1291,14 +1457,14 @@ export default { validationUpgradeDelay: 'u32' }, /** - * Lookup148: polkadot_core_primitives::OutboundHrmpMessage + * Lookup159: polkadot_core_primitives::OutboundHrmpMessage **/ PolkadotCorePrimitivesOutboundHrmpMessage: { recipient: 'u32', data: 'Bytes' }, /** - * Lookup149: cumulus_pallet_parachain_system::pallet::Call + * Lookup160: cumulus_pallet_parachain_system::pallet::Call **/ CumulusPalletParachainSystemCall: { _enum: { @@ -1317,7 +1483,7 @@ export default { } }, /** - * Lookup150: cumulus_primitives_parachain_inherent::ParachainInherentData + * Lookup161: cumulus_primitives_parachain_inherent::ParachainInherentData **/ CumulusPrimitivesParachainInherentParachainInherentData: { validationData: 'PolkadotPrimitivesV2PersistedValidationData', @@ -1326,27 +1492,27 @@ export default { horizontalMessages: 'BTreeMap>' }, /** - * Lookup152: polkadot_core_primitives::InboundDownwardMessage + * Lookup163: polkadot_core_primitives::InboundDownwardMessage **/ PolkadotCorePrimitivesInboundDownwardMessage: { sentAt: 'u32', msg: 'Bytes' }, /** - * Lookup155: polkadot_core_primitives::InboundHrmpMessage + * Lookup166: polkadot_core_primitives::InboundHrmpMessage **/ PolkadotCorePrimitivesInboundHrmpMessage: { sentAt: 'u32', data: 'Bytes' }, /** - * Lookup158: cumulus_pallet_parachain_system::pallet::Error + * Lookup169: cumulus_pallet_parachain_system::pallet::Error **/ CumulusPalletParachainSystemError: { _enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized'] }, /** - * Lookup160: pallet_balances::BalanceLock + * Lookup171: pallet_balances::BalanceLock **/ PalletBalancesBalanceLock: { id: '[u8;8]', @@ -1354,26 +1520,26 @@ export default { reasons: 'PalletBalancesReasons' }, /** - * Lookup161: pallet_balances::Reasons + * Lookup172: pallet_balances::Reasons **/ PalletBalancesReasons: { _enum: ['Fee', 'Misc', 'All'] }, /** - * Lookup164: pallet_balances::ReserveData + * Lookup175: pallet_balances::ReserveData **/ PalletBalancesReserveData: { id: '[u8;16]', amount: 'u128' }, /** - * Lookup166: pallet_balances::Releases + * Lookup177: pallet_balances::Releases **/ PalletBalancesReleases: { _enum: ['V1_0_0', 'V2_0_0'] }, /** - * Lookup167: pallet_balances::pallet::Call + * Lookup178: pallet_balances::pallet::Call **/ PalletBalancesCall: { _enum: { @@ -1406,13 +1572,13 @@ export default { } }, /** - * Lookup170: pallet_balances::pallet::Error + * Lookup181: pallet_balances::pallet::Error **/ PalletBalancesError: { _enum: ['VestingBalance', 'LiquidityRestrictions', 'InsufficientBalance', 'ExistentialDeposit', 'KeepAlive', 'ExistingVestingSchedule', 'DeadAccount', 'TooManyReserves'] }, /** - * Lookup172: pallet_timestamp::pallet::Call + * Lookup183: pallet_timestamp::pallet::Call **/ PalletTimestampCall: { _enum: { @@ -1422,13 +1588,13 @@ export default { } }, /** - * Lookup174: pallet_transaction_payment::Releases + * Lookup185: pallet_transaction_payment::Releases **/ PalletTransactionPaymentReleases: { _enum: ['V1Ancient', 'V2'] }, /** - * Lookup175: pallet_treasury::Proposal + * Lookup186: pallet_treasury::Proposal **/ PalletTreasuryProposal: { proposer: 'AccountId32', @@ -1437,7 +1603,7 @@ export default { bond: 'u128' }, /** - * Lookup178: pallet_treasury::pallet::Call + * Lookup189: pallet_treasury::pallet::Call **/ PalletTreasuryCall: { _enum: { @@ -1461,17 +1627,17 @@ export default { } }, /** - * Lookup181: frame_support::PalletId + * Lookup192: frame_support::PalletId **/ FrameSupportPalletId: '[u8;8]', /** - * Lookup182: pallet_treasury::pallet::Error + * Lookup193: pallet_treasury::pallet::Error **/ PalletTreasuryError: { _enum: ['InsufficientProposersBalance', 'InvalidIndex', 'TooManyApprovals', 'InsufficientPermission', 'ProposalNotApproved'] }, /** - * Lookup183: pallet_sudo::pallet::Call + * Lookup194: pallet_sudo::pallet::Call **/ PalletSudoCall: { _enum: { @@ -1495,7 +1661,7 @@ export default { } }, /** - * Lookup185: orml_vesting::module::Call + * Lookup196: orml_vesting::module::Call **/ OrmlVestingModuleCall: { _enum: { @@ -1514,7 +1680,7 @@ export default { } }, /** - * Lookup187: orml_xtokens::module::Call + * Lookup198: orml_xtokens::module::Call **/ OrmlXtokensModuleCall: { _enum: { @@ -1557,7 +1723,7 @@ export default { } }, /** - * Lookup188: xcm::VersionedMultiAsset + * Lookup199: xcm::VersionedMultiAsset **/ XcmVersionedMultiAsset: { _enum: { @@ -1566,7 +1732,7 @@ export default { } }, /** - * Lookup191: orml_tokens::module::Call + * Lookup202: orml_tokens::module::Call **/ OrmlTokensModuleCall: { _enum: { @@ -1600,7 +1766,7 @@ export default { } }, /** - * Lookup192: cumulus_pallet_xcmp_queue::pallet::Call + * Lookup203: cumulus_pallet_xcmp_queue::pallet::Call **/ CumulusPalletXcmpQueueCall: { _enum: { @@ -1649,7 +1815,7 @@ export default { } }, /** - * Lookup193: pallet_xcm::pallet::Call + * Lookup204: pallet_xcm::pallet::Call **/ PalletXcmCall: { _enum: { @@ -1703,7 +1869,7 @@ export default { } }, /** - * Lookup194: xcm::VersionedXcm + * Lookup205: xcm::VersionedXcm **/ XcmVersionedXcm: { _enum: { @@ -1713,7 +1879,7 @@ export default { } }, /** - * Lookup195: xcm::v0::Xcm + * Lookup206: xcm::v0::Xcm **/ XcmV0Xcm: { _enum: { @@ -1767,7 +1933,7 @@ export default { } }, /** - * Lookup197: xcm::v0::order::Order + * Lookup208: xcm::v0::order::Order **/ XcmV0Order: { _enum: { @@ -1810,7 +1976,7 @@ export default { } }, /** - * Lookup199: xcm::v0::Response + * Lookup210: xcm::v0::Response **/ XcmV0Response: { _enum: { @@ -1818,7 +1984,7 @@ export default { } }, /** - * Lookup200: xcm::v1::Xcm + * Lookup211: xcm::v1::Xcm **/ XcmV1Xcm: { _enum: { @@ -1877,7 +2043,7 @@ export default { } }, /** - * Lookup202: xcm::v1::order::Order + * Lookup213: xcm::v1::order::Order **/ XcmV1Order: { _enum: { @@ -1922,7 +2088,7 @@ export default { } }, /** - * Lookup204: xcm::v1::Response + * Lookup215: xcm::v1::Response **/ XcmV1Response: { _enum: { @@ -1931,11 +2097,11 @@ export default { } }, /** - * Lookup219: cumulus_pallet_xcm::pallet::Call + * Lookup229: cumulus_pallet_xcm::pallet::Call **/ CumulusPalletXcmCall: 'Null', /** - * Lookup220: cumulus_pallet_dmp_queue::pallet::Call + * Lookup230: cumulus_pallet_dmp_queue::pallet::Call **/ CumulusPalletDmpQueueCall: { _enum: { @@ -1946,7 +2112,7 @@ export default { } }, /** - * Lookup221: pallet_inflation::pallet::Call + * Lookup231: pallet_inflation::pallet::Call **/ PalletInflationCall: { _enum: { @@ -1956,7 +2122,7 @@ export default { } }, /** - * Lookup222: pallet_unique::Call + * Lookup232: pallet_unique::Call **/ PalletUniqueCall: { _enum: { @@ -2088,7 +2254,7 @@ export default { } }, /** - * Lookup227: up_data_structs::CollectionMode + * Lookup237: up_data_structs::CollectionMode **/ UpDataStructsCollectionMode: { _enum: { @@ -2098,7 +2264,7 @@ export default { } }, /** - * Lookup228: up_data_structs::CreateCollectionData + * Lookup238: up_data_structs::CreateCollectionData **/ UpDataStructsCreateCollectionData: { mode: 'UpDataStructsCollectionMode', @@ -2113,13 +2279,13 @@ export default { properties: 'Vec' }, /** - * Lookup230: up_data_structs::AccessMode + * Lookup240: up_data_structs::AccessMode **/ UpDataStructsAccessMode: { _enum: ['Normal', 'AllowList'] }, /** - * Lookup232: up_data_structs::CollectionLimits + * Lookup242: up_data_structs::CollectionLimits **/ UpDataStructsCollectionLimits: { accountTokenOwnershipLimit: 'Option', @@ -2133,7 +2299,7 @@ export default { transfersEnabled: 'Option' }, /** - * Lookup234: up_data_structs::SponsoringRateLimit + * Lookup244: up_data_structs::SponsoringRateLimit **/ UpDataStructsSponsoringRateLimit: { _enum: { @@ -2142,7 +2308,7 @@ export default { } }, /** - * Lookup237: up_data_structs::CollectionPermissions + * Lookup247: up_data_structs::CollectionPermissions **/ UpDataStructsCollectionPermissions: { access: 'Option', @@ -2150,7 +2316,7 @@ export default { nesting: 'Option' }, /** - * Lookup239: up_data_structs::NestingPermissions + * Lookup249: up_data_structs::NestingPermissions **/ UpDataStructsNestingPermissions: { tokenOwner: 'bool', @@ -2158,18 +2324,18 @@ export default { restricted: 'Option' }, /** - * Lookup241: up_data_structs::OwnerRestrictedSet + * Lookup251: up_data_structs::OwnerRestrictedSet **/ UpDataStructsOwnerRestrictedSet: 'BTreeSet', /** - * Lookup246: up_data_structs::PropertyKeyPermission + * Lookup256: up_data_structs::PropertyKeyPermission **/ UpDataStructsPropertyKeyPermission: { key: 'Bytes', permission: 'UpDataStructsPropertyPermission' }, /** - * Lookup247: up_data_structs::PropertyPermission + * Lookup257: up_data_structs::PropertyPermission **/ UpDataStructsPropertyPermission: { mutable: 'bool', @@ -2177,14 +2343,14 @@ export default { tokenOwner: 'bool' }, /** - * Lookup250: up_data_structs::Property + * Lookup260: up_data_structs::Property **/ UpDataStructsProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup253: up_data_structs::CreateItemData + * Lookup263: up_data_structs::CreateItemData **/ UpDataStructsCreateItemData: { _enum: { @@ -2194,26 +2360,26 @@ export default { } }, /** - * Lookup254: up_data_structs::CreateNftData + * Lookup264: up_data_structs::CreateNftData **/ UpDataStructsCreateNftData: { properties: 'Vec' }, /** - * Lookup255: up_data_structs::CreateFungibleData + * Lookup265: up_data_structs::CreateFungibleData **/ UpDataStructsCreateFungibleData: { value: 'u128' }, /** - * Lookup256: up_data_structs::CreateReFungibleData + * Lookup266: up_data_structs::CreateReFungibleData **/ UpDataStructsCreateReFungibleData: { pieces: 'u128', properties: 'Vec' }, /** - * Lookup259: up_data_structs::CreateItemExData> + * Lookup269: up_data_structs::CreateItemExData> **/ UpDataStructsCreateItemExData: { _enum: { @@ -2224,14 +2390,14 @@ export default { } }, /** - * Lookup261: up_data_structs::CreateNftExData> + * Lookup271: up_data_structs::CreateNftExData> **/ UpDataStructsCreateNftExData: { properties: 'Vec', owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup268: up_data_structs::CreateRefungibleExSingleOwner> + * Lookup278: up_data_structs::CreateRefungibleExSingleOwner> **/ UpDataStructsCreateRefungibleExSingleOwner: { user: 'PalletEvmAccountBasicCrossAccountIdRepr', @@ -2239,14 +2405,47 @@ export default { properties: 'Vec' }, /** - * Lookup270: up_data_structs::CreateRefungibleExMultipleOwners> + * Lookup280: up_data_structs::CreateRefungibleExMultipleOwners> **/ UpDataStructsCreateRefungibleExMultipleOwners: { users: 'BTreeMap', properties: 'Vec' }, /** - * Lookup271: pallet_configuration::pallet::Call + * Lookup281: pallet_unique_scheduler::pallet::Call + **/ + PalletUniqueSchedulerCall: { + _enum: { + schedule_named: { + id: '[u8;16]', + when: 'u32', + maybePeriodic: 'Option<(u32,u32)>', + priority: 'u8', + call: 'FrameSupportScheduleMaybeHashed', + }, + cancel_named: { + id: '[u8;16]', + }, + schedule_named_after: { + id: '[u8;16]', + after: 'u32', + maybePeriodic: 'Option<(u32,u32)>', + priority: 'u8', + call: 'FrameSupportScheduleMaybeHashed' + } + } + }, + /** + * Lookup283: frame_support::traits::schedule::MaybeHashed + **/ + FrameSupportScheduleMaybeHashed: { + _enum: { + Value: 'Call', + Hash: 'H256' + } + }, + /** + * Lookup284: pallet_configuration::pallet::Call **/ PalletConfigurationCall: { _enum: { @@ -2259,15 +2458,236 @@ export default { } }, /** - * Lookup272: pallet_template_transaction_payment::Call + * Lookup285: pallet_template_transaction_payment::Call **/ PalletTemplateTransactionPaymentCall: 'Null', /** - * Lookup273: pallet_structure::pallet::Call + * Lookup286: pallet_structure::pallet::Call **/ PalletStructureCall: 'Null', /** - * Lookup274: pallet_evm::pallet::Call + * Lookup287: pallet_rmrk_core::pallet::Call + **/ + PalletRmrkCoreCall: { + _enum: { + create_collection: { + metadata: 'Bytes', + max: 'Option', + symbol: 'Bytes', + }, + destroy_collection: { + collectionId: 'u32', + }, + change_collection_issuer: { + collectionId: 'u32', + newIssuer: 'MultiAddress', + }, + lock_collection: { + collectionId: 'u32', + }, + mint_nft: { + owner: 'Option', + collectionId: 'u32', + recipient: 'Option', + royaltyAmount: 'Option', + metadata: 'Bytes', + transferable: 'bool', + resources: 'Option>', + }, + burn_nft: { + collectionId: 'u32', + nftId: 'u32', + maxBurns: 'u32', + }, + send: { + rmrkCollectionId: 'u32', + rmrkNftId: 'u32', + newOwner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', + }, + accept_nft: { + rmrkCollectionId: 'u32', + rmrkNftId: 'u32', + newOwner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', + }, + reject_nft: { + rmrkCollectionId: 'u32', + rmrkNftId: 'u32', + }, + accept_resource: { + rmrkCollectionId: 'u32', + rmrkNftId: 'u32', + resourceId: 'u32', + }, + accept_resource_removal: { + rmrkCollectionId: 'u32', + rmrkNftId: 'u32', + resourceId: 'u32', + }, + set_property: { + rmrkCollectionId: 'Compact', + maybeNftId: 'Option', + key: 'Bytes', + value: 'Bytes', + }, + set_priority: { + rmrkCollectionId: 'u32', + rmrkNftId: 'u32', + priorities: 'Vec', + }, + add_basic_resource: { + rmrkCollectionId: 'u32', + nftId: 'u32', + resource: 'RmrkTraitsResourceBasicResource', + }, + add_composable_resource: { + rmrkCollectionId: 'u32', + nftId: 'u32', + resource: 'RmrkTraitsResourceComposableResource', + }, + add_slot_resource: { + rmrkCollectionId: 'u32', + nftId: 'u32', + resource: 'RmrkTraitsResourceSlotResource', + }, + remove_resource: { + rmrkCollectionId: 'u32', + nftId: 'u32', + resourceId: 'u32' + } + } + }, + /** + * Lookup293: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> + **/ + RmrkTraitsResourceResourceTypes: { + _enum: { + Basic: 'RmrkTraitsResourceBasicResource', + Composable: 'RmrkTraitsResourceComposableResource', + Slot: 'RmrkTraitsResourceSlotResource' + } + }, + /** + * Lookup295: rmrk_traits::resource::BasicResource> + **/ + RmrkTraitsResourceBasicResource: { + src: 'Option', + metadata: 'Option', + license: 'Option', + thumb: 'Option' + }, + /** + * Lookup297: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> + **/ + RmrkTraitsResourceComposableResource: { + parts: 'Vec', + base: 'u32', + src: 'Option', + metadata: 'Option', + license: 'Option', + thumb: 'Option' + }, + /** + * Lookup298: rmrk_traits::resource::SlotResource> + **/ + RmrkTraitsResourceSlotResource: { + base: 'u32', + src: 'Option', + metadata: 'Option', + slot: 'u32', + license: 'Option', + thumb: 'Option' + }, + /** + * Lookup301: pallet_rmrk_equip::pallet::Call + **/ + PalletRmrkEquipCall: { + _enum: { + create_base: { + baseType: 'Bytes', + symbol: 'Bytes', + parts: 'Vec', + }, + theme_add: { + baseId: 'u32', + theme: 'RmrkTraitsTheme', + }, + equippable: { + baseId: 'u32', + slotId: 'u32', + equippables: 'RmrkTraitsPartEquippableList' + } + } + }, + /** + * Lookup304: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> + **/ + RmrkTraitsPartPartType: { + _enum: { + FixedPart: 'RmrkTraitsPartFixedPart', + SlotPart: 'RmrkTraitsPartSlotPart' + } + }, + /** + * Lookup306: rmrk_traits::part::FixedPart> + **/ + RmrkTraitsPartFixedPart: { + id: 'u32', + z: 'u32', + src: 'Bytes' + }, + /** + * Lookup307: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> + **/ + RmrkTraitsPartSlotPart: { + id: 'u32', + equippable: 'RmrkTraitsPartEquippableList', + src: 'Bytes', + z: 'u32' + }, + /** + * Lookup308: rmrk_traits::part::EquippableList> + **/ + RmrkTraitsPartEquippableList: { + _enum: { + All: 'Null', + Empty: 'Null', + Custom: 'Vec' + } + }, + /** + * Lookup310: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> + **/ + RmrkTraitsTheme: { + name: 'Bytes', + properties: 'Vec', + inherit: 'bool' + }, + /** + * Lookup312: rmrk_traits::theme::ThemeProperty> + **/ + RmrkTraitsThemeThemeProperty: { + key: 'Bytes', + value: 'Bytes' + }, + /** + * Lookup314: pallet_foreign_assets::module::Call + **/ + PalletForeignAssetsModuleCall: { + _enum: { + register_foreign_asset: { + owner: 'AccountId32', + location: 'XcmVersionedMultiLocation', + metadata: 'PalletForeignAssetsModuleAssetMetadata', + }, + update_foreign_asset: { + foreignAssetId: 'u32', + location: 'XcmVersionedMultiLocation', + metadata: 'PalletForeignAssetsModuleAssetMetadata' + } + } + }, + /** + * Lookup315: pallet_evm::pallet::Call **/ PalletEvmCall: { _enum: { @@ -2310,7 +2730,7 @@ export default { } }, /** - * Lookup278: pallet_ethereum::pallet::Call + * Lookup319: pallet_ethereum::pallet::Call **/ PalletEthereumCall: { _enum: { @@ -2320,7 +2740,7 @@ export default { } }, /** - * Lookup279: ethereum::transaction::TransactionV2 + * Lookup320: ethereum::transaction::TransactionV2 **/ EthereumTransactionTransactionV2: { _enum: { @@ -2330,7 +2750,7 @@ export default { } }, /** - * Lookup280: ethereum::transaction::LegacyTransaction + * Lookup321: ethereum::transaction::LegacyTransaction **/ EthereumTransactionLegacyTransaction: { nonce: 'U256', @@ -2342,7 +2762,7 @@ export default { signature: 'EthereumTransactionTransactionSignature' }, /** - * Lookup281: ethereum::transaction::TransactionAction + * Lookup322: ethereum::transaction::TransactionAction **/ EthereumTransactionTransactionAction: { _enum: { @@ -2351,7 +2771,7 @@ export default { } }, /** - * Lookup282: ethereum::transaction::TransactionSignature + * Lookup323: ethereum::transaction::TransactionSignature **/ EthereumTransactionTransactionSignature: { v: 'u64', @@ -2359,7 +2779,7 @@ export default { s: 'H256' }, /** - * Lookup284: ethereum::transaction::EIP2930Transaction + * Lookup325: ethereum::transaction::EIP2930Transaction **/ EthereumTransactionEip2930Transaction: { chainId: 'u64', @@ -2375,14 +2795,14 @@ export default { s: 'H256' }, /** - * Lookup286: ethereum::transaction::AccessListItem + * Lookup327: ethereum::transaction::AccessListItem **/ EthereumTransactionAccessListItem: { address: 'H160', storageKeys: 'Vec' }, /** - * Lookup287: ethereum::transaction::EIP1559Transaction + * Lookup328: ethereum::transaction::EIP1559Transaction **/ EthereumTransactionEip1559Transaction: { chainId: 'u64', @@ -2399,7 +2819,7 @@ export default { s: 'H256' }, /** - * Lookup288: pallet_evm_migration::pallet::Call + * Lookup329: pallet_evm_migration::pallet::Call **/ PalletEvmMigrationCall: { _enum: { @@ -2417,32 +2837,32 @@ export default { } }, /** - * Lookup291: pallet_sudo::pallet::Error + * Lookup332: pallet_sudo::pallet::Error **/ PalletSudoError: { _enum: ['RequireSudo'] }, /** - * Lookup293: orml_vesting::module::Error + * Lookup334: orml_vesting::module::Error **/ OrmlVestingModuleError: { _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded'] }, /** - * Lookup294: orml_xtokens::module::Error + * Lookup335: orml_xtokens::module::Error **/ OrmlXtokensModuleError: { _enum: ['AssetHasNoReserve', 'NotCrossChainTransfer', 'InvalidDest', 'NotCrossChainTransferableCurrency', 'UnweighableMessage', 'XcmExecutionFailed', 'CannotReanchor', 'InvalidAncestry', 'InvalidAsset', 'DestinationNotInvertible', 'BadVersion', 'DistinctReserveForAssetAndFee', 'ZeroFee', 'ZeroAmount', 'TooManyAssetsBeingSent', 'AssetIndexNonExistent', 'FeeNotEnough', 'NotSupportedMultiLocation', 'MinXcmFeeNotDefined'] }, /** - * Lookup297: orml_tokens::BalanceLock + * Lookup338: orml_tokens::BalanceLock **/ OrmlTokensBalanceLock: { id: '[u8;8]', amount: 'u128' }, /** - * Lookup299: orml_tokens::AccountData + * Lookup340: orml_tokens::AccountData **/ OrmlTokensAccountData: { free: 'u128', @@ -2450,20 +2870,20 @@ export default { frozen: 'u128' }, /** - * Lookup301: orml_tokens::ReserveData + * Lookup342: orml_tokens::ReserveData **/ OrmlTokensReserveData: { id: 'Null', amount: 'u128' }, /** - * Lookup303: orml_tokens::module::Error + * Lookup344: orml_tokens::module::Error **/ OrmlTokensModuleError: { _enum: ['BalanceTooLow', 'AmountIntoBalanceFailed', 'LiquidityRestrictions', 'MaxLocksExceeded', 'KeepAlive', 'ExistentialDeposit', 'DeadAccount', 'TooManyReserves'] }, /** - * Lookup305: cumulus_pallet_xcmp_queue::InboundChannelDetails + * Lookup346: cumulus_pallet_xcmp_queue::InboundChannelDetails **/ CumulusPalletXcmpQueueInboundChannelDetails: { sender: 'u32', @@ -2471,19 +2891,19 @@ export default { messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>' }, /** - * Lookup306: cumulus_pallet_xcmp_queue::InboundState + * Lookup347: cumulus_pallet_xcmp_queue::InboundState **/ CumulusPalletXcmpQueueInboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup309: polkadot_parachain::primitives::XcmpMessageFormat + * Lookup350: polkadot_parachain::primitives::XcmpMessageFormat **/ PolkadotParachainPrimitivesXcmpMessageFormat: { _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals'] }, /** - * Lookup312: cumulus_pallet_xcmp_queue::OutboundChannelDetails + * Lookup353: cumulus_pallet_xcmp_queue::OutboundChannelDetails **/ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: 'u32', @@ -2493,13 +2913,13 @@ export default { lastIndex: 'u16' }, /** - * Lookup313: cumulus_pallet_xcmp_queue::OutboundState + * Lookup354: cumulus_pallet_xcmp_queue::OutboundState **/ CumulusPalletXcmpQueueOutboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup315: cumulus_pallet_xcmp_queue::QueueConfigData + * Lookup356: cumulus_pallet_xcmp_queue::QueueConfigData **/ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: 'u32', @@ -2510,29 +2930,29 @@ export default { xcmpMaxIndividualWeight: 'u64' }, /** - * Lookup317: cumulus_pallet_xcmp_queue::pallet::Error + * Lookup358: cumulus_pallet_xcmp_queue::pallet::Error **/ CumulusPalletXcmpQueueError: { _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit'] }, /** - * Lookup318: pallet_xcm::pallet::Error + * Lookup359: pallet_xcm::pallet::Error **/ PalletXcmError: { _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed'] }, /** - * Lookup319: cumulus_pallet_xcm::pallet::Error + * Lookup360: cumulus_pallet_xcm::pallet::Error **/ CumulusPalletXcmError: 'Null', /** - * Lookup320: cumulus_pallet_dmp_queue::ConfigData + * Lookup361: cumulus_pallet_dmp_queue::ConfigData **/ CumulusPalletDmpQueueConfigData: { maxIndividual: 'u64' }, /** - * Lookup321: cumulus_pallet_dmp_queue::PageIndexData + * Lookup362: cumulus_pallet_dmp_queue::PageIndexData **/ CumulusPalletDmpQueuePageIndexData: { beginUsed: 'u32', @@ -2540,19 +2960,184 @@ export default { overweightCount: 'u64' }, /** - * Lookup324: cumulus_pallet_dmp_queue::pallet::Error + * Lookup365: cumulus_pallet_dmp_queue::pallet::Error **/ CumulusPalletDmpQueueError: { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup328: pallet_unique::Error + * Lookup369: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup329: up_data_structs::Collection + * Lookup372: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> + **/ + PalletUniqueSchedulerScheduledV3: { + maybeId: 'Option<[u8;16]>', + priority: 'u8', + call: 'FrameSupportScheduleMaybeHashed', + maybePeriodic: 'Option<(u32,u32)>', + origin: 'OpalRuntimeOriginCaller' + }, + /** + * Lookup373: opal_runtime::OriginCaller + **/ + OpalRuntimeOriginCaller: { + _enum: { + system: 'FrameSupportDispatchRawOrigin', + __Unused1: 'Null', + __Unused2: 'Null', + __Unused3: 'Null', + Void: 'SpCoreVoid', + __Unused5: 'Null', + __Unused6: 'Null', + __Unused7: 'Null', + __Unused8: 'Null', + __Unused9: 'Null', + __Unused10: 'Null', + __Unused11: 'Null', + __Unused12: 'Null', + __Unused13: 'Null', + __Unused14: 'Null', + __Unused15: 'Null', + __Unused16: 'Null', + __Unused17: 'Null', + __Unused18: 'Null', + __Unused19: 'Null', + __Unused20: 'Null', + __Unused21: 'Null', + __Unused22: 'Null', + __Unused23: 'Null', + __Unused24: 'Null', + __Unused25: 'Null', + __Unused26: 'Null', + __Unused27: 'Null', + __Unused28: 'Null', + __Unused29: 'Null', + __Unused30: 'Null', + __Unused31: 'Null', + __Unused32: 'Null', + __Unused33: 'Null', + __Unused34: 'Null', + __Unused35: 'Null', + __Unused36: 'Null', + __Unused37: 'Null', + __Unused38: 'Null', + __Unused39: 'Null', + __Unused40: 'Null', + __Unused41: 'Null', + __Unused42: 'Null', + __Unused43: 'Null', + __Unused44: 'Null', + __Unused45: 'Null', + __Unused46: 'Null', + __Unused47: 'Null', + __Unused48: 'Null', + __Unused49: 'Null', + __Unused50: 'Null', + PolkadotXcm: 'PalletXcmOrigin', + CumulusXcm: 'CumulusPalletXcmOrigin', + __Unused53: 'Null', + __Unused54: 'Null', + __Unused55: 'Null', + __Unused56: 'Null', + __Unused57: 'Null', + __Unused58: 'Null', + __Unused59: 'Null', + __Unused60: 'Null', + __Unused61: 'Null', + __Unused62: 'Null', + __Unused63: 'Null', + __Unused64: 'Null', + __Unused65: 'Null', + __Unused66: 'Null', + __Unused67: 'Null', + __Unused68: 'Null', + __Unused69: 'Null', + __Unused70: 'Null', + __Unused71: 'Null', + __Unused72: 'Null', + __Unused73: 'Null', + __Unused74: 'Null', + __Unused75: 'Null', + __Unused76: 'Null', + __Unused77: 'Null', + __Unused78: 'Null', + __Unused79: 'Null', + __Unused80: 'Null', + __Unused81: 'Null', + __Unused82: 'Null', + __Unused83: 'Null', + __Unused84: 'Null', + __Unused85: 'Null', + __Unused86: 'Null', + __Unused87: 'Null', + __Unused88: 'Null', + __Unused89: 'Null', + __Unused90: 'Null', + __Unused91: 'Null', + __Unused92: 'Null', + __Unused93: 'Null', + __Unused94: 'Null', + __Unused95: 'Null', + __Unused96: 'Null', + __Unused97: 'Null', + __Unused98: 'Null', + __Unused99: 'Null', + __Unused100: 'Null', + Ethereum: 'PalletEthereumRawOrigin' + } + }, + /** + * Lookup374: frame_support::dispatch::RawOrigin + **/ + FrameSupportDispatchRawOrigin: { + _enum: { + Root: 'Null', + Signed: 'AccountId32', + None: 'Null' + } + }, + /** + * Lookup375: pallet_xcm::pallet::Origin + **/ + PalletXcmOrigin: { + _enum: { + Xcm: 'XcmV1MultiLocation', + Response: 'XcmV1MultiLocation' + } + }, + /** + * Lookup376: cumulus_pallet_xcm::pallet::Origin + **/ + CumulusPalletXcmOrigin: { + _enum: { + Relay: 'Null', + SiblingParachain: 'u32' + } + }, + /** + * Lookup377: pallet_ethereum::RawOrigin + **/ + PalletEthereumRawOrigin: { + _enum: { + EthereumTransaction: 'H160' + } + }, + /** + * Lookup378: sp_core::Void + **/ + SpCoreVoid: 'Null', + /** + * Lookup379: pallet_unique_scheduler::pallet::Error + **/ + PalletUniqueSchedulerError: { + _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] + }, + /** + * Lookup380: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -2566,7 +3151,7 @@ export default { externalCollection: 'bool' }, /** - * Lookup330: up_data_structs::SponsorshipState + * Lookup381: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipStateAccountId32: { _enum: { @@ -2576,7 +3161,7 @@ export default { } }, /** - * Lookup331: up_data_structs::Properties + * Lookup382: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -2584,15 +3169,15 @@ export default { spaceLimit: 'u32' }, /** - * Lookup332: up_data_structs::PropertiesMap> + * Lookup383: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** - * Lookup337: up_data_structs::PropertiesMap + * Lookup388: up_data_structs::PropertiesMap **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup344: up_data_structs::CollectionStats + * Lookup395: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -2600,18 +3185,18 @@ export default { alive: 'u32' }, /** - * Lookup345: up_data_structs::TokenChild + * Lookup396: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup346: PhantomType::up_data_structs + * Lookup397: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup348: up_data_structs::TokenData> + * Lookup399: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -2619,7 +3204,7 @@ export default { pieces: 'u128' }, /** - * Lookup350: up_data_structs::RpcCollection + * Lookup401: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -2635,7 +3220,7 @@ export default { readOnly: 'bool' }, /** - * Lookup351: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup402: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -2645,7 +3230,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup354: rmrk_traits::nft::NftInfo> + * Lookup403: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -2655,23 +3240,14 @@ export default { pending: 'bool' }, /** - * Lookup355: rmrk_traits::nft::AccountIdOrCollectionNftTuple - **/ - RmrkTraitsNftAccountIdOrCollectionNftTuple: { - _enum: { - AccountId: 'AccountId32', - CollectionAndNftTuple: '(u32,u32)' - } - }, - /** - * Lookup357: rmrk_traits::nft::RoyaltyInfo + * Lookup405: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup358: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup406: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -2680,55 +3256,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup360: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> - **/ - RmrkTraitsResourceResourceTypes: { - _enum: { - Basic: 'RmrkTraitsResourceBasicResource', - Composable: 'RmrkTraitsResourceComposableResource', - Slot: 'RmrkTraitsResourceSlotResource' - } - }, - /** - * Lookup361: rmrk_traits::resource::BasicResource> - **/ - RmrkTraitsResourceBasicResource: { - src: 'Option', - metadata: 'Option', - license: 'Option', - thumb: 'Option' - }, - /** - * Lookup363: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> - **/ - RmrkTraitsResourceComposableResource: { - parts: 'Vec', - base: 'u32', - src: 'Option', - metadata: 'Option', - license: 'Option', - thumb: 'Option' - }, - /** - * Lookup364: rmrk_traits::resource::SlotResource> - **/ - RmrkTraitsResourceSlotResource: { - base: 'u32', - src: 'Option', - metadata: 'Option', - slot: 'u32', - license: 'Option', - thumb: 'Option' - }, - /** - * Lookup365: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup407: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup368: rmrk_traits::base::BaseInfo> + * Lookup408: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -2736,107 +3271,86 @@ export default { symbol: 'Bytes' }, /** - * Lookup369: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> - **/ - RmrkTraitsPartPartType: { - _enum: { - FixedPart: 'RmrkTraitsPartFixedPart', - SlotPart: 'RmrkTraitsPartSlotPart' - } - }, - /** - * Lookup371: rmrk_traits::part::FixedPart> - **/ - RmrkTraitsPartFixedPart: { - id: 'u32', - z: 'u32', - src: 'Bytes' - }, - /** - * Lookup372: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> - **/ - RmrkTraitsPartSlotPart: { - id: 'u32', - equippable: 'RmrkTraitsPartEquippableList', - src: 'Bytes', - z: 'u32' - }, - /** - * Lookup373: rmrk_traits::part::EquippableList> - **/ - RmrkTraitsPartEquippableList: { - _enum: { - All: 'Null', - Empty: 'Null', - Custom: 'Vec' - } - }, - /** - * Lookup374: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> - **/ - RmrkTraitsTheme: { - name: 'Bytes', - properties: 'Vec', - inherit: 'bool' - }, - /** - * Lookup376: rmrk_traits::theme::ThemeProperty> - **/ - RmrkTraitsThemeThemeProperty: { - key: 'Bytes', - value: 'Bytes' - }, - /** - * Lookup378: rmrk_traits::nft::NftChild + * Lookup409: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup380: pallet_common::pallet::Error + * Lookup411: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup382: pallet_fungible::pallet::Error + * Lookup413: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup383: pallet_nonfungible::ItemData> + * Lookup414: pallet_refungible::ItemData + **/ + PalletRefungibleItemData: { + constData: 'Bytes' + }, + /** + * Lookup419: pallet_refungible::pallet::Error + **/ + PalletRefungibleError: { + _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] + }, + /** + * Lookup420: pallet_nonfungible::ItemData> **/ PalletNonfungibleItemData: { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup385: up_data_structs::PropertyScope + * Lookup422: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { _enum: ['None', 'Rmrk'] }, /** - * Lookup389: pallet_nonfungible::pallet::Error + * Lookup424: pallet_nonfungible::pallet::Error **/ PalletNonfungibleError: { _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup390: pallet_structure::pallet::Error + * Lookup425: pallet_structure::pallet::Error **/ PalletStructureError: { _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup393: pallet_evm::pallet::Error + * Lookup426: pallet_rmrk_core::pallet::Error + **/ + PalletRmrkCoreError: { + _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] + }, + /** + * Lookup428: pallet_rmrk_equip::pallet::Error + **/ + PalletRmrkEquipError: { + _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] + }, + /** + * Lookup429: pallet_foreign_assets::module::Error + **/ + PalletForeignAssetsModuleError: { + _enum: ['BadLocation', 'MultiLocationExisted', 'AssetIdNotExists', 'AssetIdExisted'] + }, + /** + * Lookup432: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup396: fp_rpc::TransactionStatus + * Lookup435: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -2848,11 +3362,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup398: ethbloom::Bloom + * Lookup437: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup400: ethereum::receipt::ReceiptV3 + * Lookup439: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -2862,7 +3376,7 @@ export default { } }, /** - * Lookup401: ethereum::receipt::EIP658ReceiptData + * Lookup440: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -2871,7 +3385,7 @@ export default { logs: 'Vec' }, /** - * Lookup402: ethereum::block::Block + * Lookup441: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -2879,7 +3393,7 @@ export default { ommers: 'Vec' }, /** - * Lookup403: ethereum::header::Header + * Lookup442: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -2899,23 +3413,23 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup404: ethereum_types::hash::H64 + * Lookup443: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup409: pallet_ethereum::pallet::Error + * Lookup448: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup410: pallet_evm_coder_substrate::pallet::Error + * Lookup449: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup411: up_data_structs::SponsorshipState> + * Lookup450: up_data_structs::SponsorshipState> **/ UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: { _enum: { @@ -2925,25 +3439,25 @@ export default { } }, /** - * Lookup412: pallet_evm_contract_helpers::SponsoringModeT + * Lookup451: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup414: pallet_evm_contract_helpers::pallet::Error + * Lookup453: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission', 'NoPendingSponsor'] }, /** - * Lookup415: pallet_evm_migration::pallet::Error + * Lookup454: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup417: sp_runtime::MultiSignature + * Lookup456: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -2953,43 +3467,43 @@ export default { } }, /** - * Lookup418: sp_core::ed25519::Signature + * Lookup457: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup420: sp_core::sr25519::Signature + * Lookup459: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup421: sp_core::ecdsa::Signature + * Lookup460: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup424: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup463: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup425: frame_system::extensions::check_genesis::CheckGenesis + * Lookup464: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup428: frame_system::extensions::check_nonce::CheckNonce + * Lookup467: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup429: frame_system::extensions::check_weight::CheckWeight + * Lookup468: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup430: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup469: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup431: unique_runtime::Runtime + * Lookup470: opal_runtime::Runtime **/ - UniqueRuntimeRuntime: 'Null', + OpalRuntimeRuntime: 'Null', /** - * Lookup432: pallet_ethereum::FakeTransactionFinalizer + * Lookup471: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index cf02ba1d62..81be0b8175 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UniqueRuntimeRuntime, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { interface InterfaceTypes { @@ -21,6 +21,7 @@ declare module '@polkadot/types/types/registry' { CumulusPalletXcmCall: CumulusPalletXcmCall; CumulusPalletXcmError: CumulusPalletXcmError; CumulusPalletXcmEvent: CumulusPalletXcmEvent; + CumulusPalletXcmOrigin: CumulusPalletXcmOrigin; CumulusPalletXcmpQueueCall: CumulusPalletXcmpQueueCall; CumulusPalletXcmpQueueError: CumulusPalletXcmpQueueError; CumulusPalletXcmpQueueEvent: CumulusPalletXcmpQueueEvent; @@ -50,7 +51,10 @@ declare module '@polkadot/types/types/registry' { EvmCoreErrorExitRevert: EvmCoreErrorExitRevert; EvmCoreErrorExitSucceed: EvmCoreErrorExitSucceed; FpRpcTransactionStatus: FpRpcTransactionStatus; + FrameSupportDispatchRawOrigin: FrameSupportDispatchRawOrigin; FrameSupportPalletId: FrameSupportPalletId; + FrameSupportScheduleLookupError: FrameSupportScheduleLookupError; + FrameSupportScheduleMaybeHashed: FrameSupportScheduleMaybeHashed; FrameSupportTokensMiscBalanceStatus: FrameSupportTokensMiscBalanceStatus; FrameSupportWeightsDispatchClass: FrameSupportWeightsDispatchClass; FrameSupportWeightsDispatchInfo: FrameSupportWeightsDispatchInfo; @@ -73,6 +77,8 @@ declare module '@polkadot/types/types/registry' { FrameSystemLimitsBlockWeights: FrameSystemLimitsBlockWeights; FrameSystemLimitsWeightsPerClass: FrameSystemLimitsWeightsPerClass; FrameSystemPhase: FrameSystemPhase; + OpalRuntimeOriginCaller: OpalRuntimeOriginCaller; + OpalRuntimeRuntime: OpalRuntimeRuntime; OrmlTokensAccountData: OrmlTokensAccountData; OrmlTokensBalanceLock: OrmlTokensBalanceLock; OrmlTokensModuleCall: OrmlTokensModuleCall; @@ -101,6 +107,7 @@ declare module '@polkadot/types/types/registry' { PalletEthereumError: PalletEthereumError; PalletEthereumEvent: PalletEthereumEvent; PalletEthereumFakeTransactionFinalizer: PalletEthereumFakeTransactionFinalizer; + PalletEthereumRawOrigin: PalletEthereumRawOrigin; PalletEvmAccountBasicCrossAccountIdRepr: PalletEvmAccountBasicCrossAccountIdRepr; PalletEvmCall: PalletEvmCall; PalletEvmCoderSubstrateError: PalletEvmCoderSubstrateError; @@ -111,11 +118,23 @@ declare module '@polkadot/types/types/registry' { PalletEvmMigrationCall: PalletEvmMigrationCall; PalletEvmMigrationError: PalletEvmMigrationError; PalletForeignAssetsAssetIds: PalletForeignAssetsAssetIds; + PalletForeignAssetsModuleAssetMetadata: PalletForeignAssetsModuleAssetMetadata; + PalletForeignAssetsModuleCall: PalletForeignAssetsModuleCall; + PalletForeignAssetsModuleError: PalletForeignAssetsModuleError; + PalletForeignAssetsModuleEvent: PalletForeignAssetsModuleEvent; PalletForeignAssetsNativeCurrency: PalletForeignAssetsNativeCurrency; PalletFungibleError: PalletFungibleError; PalletInflationCall: PalletInflationCall; PalletNonfungibleError: PalletNonfungibleError; PalletNonfungibleItemData: PalletNonfungibleItemData; + PalletRefungibleError: PalletRefungibleError; + PalletRefungibleItemData: PalletRefungibleItemData; + PalletRmrkCoreCall: PalletRmrkCoreCall; + PalletRmrkCoreError: PalletRmrkCoreError; + PalletRmrkCoreEvent: PalletRmrkCoreEvent; + PalletRmrkEquipCall: PalletRmrkEquipCall; + PalletRmrkEquipError: PalletRmrkEquipError; + PalletRmrkEquipEvent: PalletRmrkEquipEvent; PalletStructureCall: PalletStructureCall; PalletStructureError: PalletStructureError; PalletStructureEvent: PalletStructureEvent; @@ -134,9 +153,14 @@ declare module '@polkadot/types/types/registry' { PalletUniqueCall: PalletUniqueCall; PalletUniqueError: PalletUniqueError; PalletUniqueRawEvent: PalletUniqueRawEvent; + PalletUniqueSchedulerCall: PalletUniqueSchedulerCall; + PalletUniqueSchedulerError: PalletUniqueSchedulerError; + PalletUniqueSchedulerEvent: PalletUniqueSchedulerEvent; + PalletUniqueSchedulerScheduledV3: PalletUniqueSchedulerScheduledV3; PalletXcmCall: PalletXcmCall; PalletXcmError: PalletXcmError; PalletXcmEvent: PalletXcmEvent; + PalletXcmOrigin: PalletXcmOrigin; PhantomTypeUpDataStructs: PhantomTypeUpDataStructs; PolkadotCorePrimitivesInboundDownwardMessage: PolkadotCorePrimitivesInboundDownwardMessage; PolkadotCorePrimitivesInboundHrmpMessage: PolkadotCorePrimitivesInboundHrmpMessage; @@ -167,6 +191,7 @@ declare module '@polkadot/types/types/registry' { SpCoreEcdsaSignature: SpCoreEcdsaSignature; SpCoreEd25519Signature: SpCoreEd25519Signature; SpCoreSr25519Signature: SpCoreSr25519Signature; + SpCoreVoid: SpCoreVoid; SpRuntimeArithmeticError: SpRuntimeArithmeticError; SpRuntimeDigest: SpRuntimeDigest; SpRuntimeDigestDigestItem: SpRuntimeDigestDigestItem; @@ -177,7 +202,6 @@ declare module '@polkadot/types/types/registry' { SpRuntimeTransactionalError: SpRuntimeTransactionalError; SpTrieStorageProof: SpTrieStorageProof; SpVersionRuntimeVersion: SpVersionRuntimeVersion; - UniqueRuntimeRuntime: UniqueRuntimeRuntime; UpDataStructsAccessMode: UpDataStructsAccessMode; UpDataStructsCollection: UpDataStructsCollection; UpDataStructsCollectionLimits: UpDataStructsCollectionLimits; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index ce003cc17b..6615b40df5 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1132,7 +1132,41 @@ declare module '@polkadot/types/lookup' { readonly type: 'Substrate' | 'Ethereum'; } - /** @name PalletCommonEvent (92) */ + /** @name PalletUniqueSchedulerEvent (92) */ + interface PalletUniqueSchedulerEvent extends Enum { + readonly isScheduled: boolean; + readonly asScheduled: { + readonly when: u32; + readonly index: u32; + } & Struct; + readonly isCanceled: boolean; + readonly asCanceled: { + readonly when: u32; + readonly index: u32; + } & Struct; + readonly isDispatched: boolean; + readonly asDispatched: { + readonly task: ITuple<[u32, u32]>; + readonly id: Option; + readonly result: Result; + } & Struct; + readonly isCallLookupFailed: boolean; + readonly asCallLookupFailed: { + readonly task: ITuple<[u32, u32]>; + readonly id: Option; + readonly error: FrameSupportScheduleLookupError; + } & Struct; + readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; + } + + /** @name FrameSupportScheduleLookupError (95) */ + interface FrameSupportScheduleLookupError extends Enum { + readonly isUnknown: boolean; + readonly isBadFormat: boolean; + readonly type: 'Unknown' | 'BadFormat'; + } + + /** @name PalletCommonEvent (96) */ interface PalletCommonEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; @@ -1159,14 +1193,163 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; } - /** @name PalletStructureEvent (95) */ + /** @name PalletStructureEvent (99) */ interface PalletStructureEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: Result; readonly type: 'Executed'; } - /** @name PalletEvmEvent (96) */ + /** @name PalletRmrkCoreEvent (100) */ + interface PalletRmrkCoreEvent extends Enum { + readonly isCollectionCreated: boolean; + readonly asCollectionCreated: { + readonly issuer: AccountId32; + readonly collectionId: u32; + } & Struct; + readonly isCollectionDestroyed: boolean; + readonly asCollectionDestroyed: { + readonly issuer: AccountId32; + readonly collectionId: u32; + } & Struct; + readonly isIssuerChanged: boolean; + readonly asIssuerChanged: { + readonly oldIssuer: AccountId32; + readonly newIssuer: AccountId32; + readonly collectionId: u32; + } & Struct; + readonly isCollectionLocked: boolean; + readonly asCollectionLocked: { + readonly issuer: AccountId32; + readonly collectionId: u32; + } & Struct; + readonly isNftMinted: boolean; + readonly asNftMinted: { + readonly owner: AccountId32; + readonly collectionId: u32; + readonly nftId: u32; + } & Struct; + readonly isNftBurned: boolean; + readonly asNftBurned: { + readonly owner: AccountId32; + readonly nftId: u32; + } & Struct; + readonly isNftSent: boolean; + readonly asNftSent: { + readonly sender: AccountId32; + readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; + readonly collectionId: u32; + readonly nftId: u32; + readonly approvalRequired: bool; + } & Struct; + readonly isNftAccepted: boolean; + readonly asNftAccepted: { + readonly sender: AccountId32; + readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple; + readonly collectionId: u32; + readonly nftId: u32; + } & Struct; + readonly isNftRejected: boolean; + readonly asNftRejected: { + readonly sender: AccountId32; + readonly collectionId: u32; + readonly nftId: u32; + } & Struct; + readonly isPropertySet: boolean; + readonly asPropertySet: { + readonly collectionId: u32; + readonly maybeNftId: Option; + readonly key: Bytes; + readonly value: Bytes; + } & Struct; + readonly isResourceAdded: boolean; + readonly asResourceAdded: { + readonly nftId: u32; + readonly resourceId: u32; + } & Struct; + readonly isResourceRemoval: boolean; + readonly asResourceRemoval: { + readonly nftId: u32; + readonly resourceId: u32; + } & Struct; + readonly isResourceAccepted: boolean; + readonly asResourceAccepted: { + readonly nftId: u32; + readonly resourceId: u32; + } & Struct; + readonly isResourceRemovalAccepted: boolean; + readonly asResourceRemovalAccepted: { + readonly nftId: u32; + readonly resourceId: u32; + } & Struct; + readonly isPrioritySet: boolean; + readonly asPrioritySet: { + readonly collectionId: u32; + readonly nftId: u32; + } & Struct; + readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; + } + + /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (101) */ + interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { + readonly isAccountId: boolean; + readonly asAccountId: AccountId32; + readonly isCollectionAndNftTuple: boolean; + readonly asCollectionAndNftTuple: ITuple<[u32, u32]>; + readonly type: 'AccountId' | 'CollectionAndNftTuple'; + } + + /** @name PalletRmrkEquipEvent (106) */ + interface PalletRmrkEquipEvent extends Enum { + readonly isBaseCreated: boolean; + readonly asBaseCreated: { + readonly issuer: AccountId32; + readonly baseId: u32; + } & Struct; + readonly isEquippablesUpdated: boolean; + readonly asEquippablesUpdated: { + readonly baseId: u32; + readonly slotId: u32; + } & Struct; + readonly type: 'BaseCreated' | 'EquippablesUpdated'; + } + + /** @name PalletForeignAssetsModuleEvent (107) */ + interface PalletForeignAssetsModuleEvent extends Enum { + readonly isForeignAssetRegistered: boolean; + readonly asForeignAssetRegistered: { + readonly assetId: u32; + readonly assetAddress: XcmV1MultiLocation; + readonly metadata: PalletForeignAssetsModuleAssetMetadata; + } & Struct; + readonly isForeignAssetUpdated: boolean; + readonly asForeignAssetUpdated: { + readonly assetId: u32; + readonly assetAddress: XcmV1MultiLocation; + readonly metadata: PalletForeignAssetsModuleAssetMetadata; + } & Struct; + readonly isAssetRegistered: boolean; + readonly asAssetRegistered: { + readonly assetId: PalletForeignAssetsAssetIds; + readonly metadata: PalletForeignAssetsModuleAssetMetadata; + } & Struct; + readonly isAssetUpdated: boolean; + readonly asAssetUpdated: { + readonly assetId: PalletForeignAssetsAssetIds; + readonly metadata: PalletForeignAssetsModuleAssetMetadata; + } & Struct; + readonly type: 'ForeignAssetRegistered' | 'ForeignAssetUpdated' | 'AssetRegistered' | 'AssetUpdated'; + } + + /** @name PalletForeignAssetsModuleAssetMetadata (108) */ + interface PalletForeignAssetsModuleAssetMetadata extends Struct { + readonly name: Bytes; + readonly symbol: Bytes; + readonly decimals: u8; + readonly minimalBalance: u128; + } + + /** @name PalletEvmEvent (109) */ interface PalletEvmEvent extends Enum { readonly isLog: boolean; readonly asLog: EthereumLog; @@ -1185,21 +1368,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; } - /** @name EthereumLog (97) */ + /** @name EthereumLog (110) */ interface EthereumLog extends Struct { readonly address: H160; readonly topics: Vec; readonly data: Bytes; } - /** @name PalletEthereumEvent (101) */ + /** @name PalletEthereumEvent (114) */ interface PalletEthereumEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; readonly type: 'Executed'; } - /** @name EvmCoreErrorExitReason (102) */ + /** @name EvmCoreErrorExitReason (115) */ interface EvmCoreErrorExitReason extends Enum { readonly isSucceed: boolean; readonly asSucceed: EvmCoreErrorExitSucceed; @@ -1212,7 +1395,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; } - /** @name EvmCoreErrorExitSucceed (103) */ + /** @name EvmCoreErrorExitSucceed (116) */ interface EvmCoreErrorExitSucceed extends Enum { readonly isStopped: boolean; readonly isReturned: boolean; @@ -1220,7 +1403,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Stopped' | 'Returned' | 'Suicided'; } - /** @name EvmCoreErrorExitError (104) */ + /** @name EvmCoreErrorExitError (117) */ interface EvmCoreErrorExitError extends Enum { readonly isStackUnderflow: boolean; readonly isStackOverflow: boolean; @@ -1241,13 +1424,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; } - /** @name EvmCoreErrorExitRevert (107) */ + /** @name EvmCoreErrorExitRevert (120) */ interface EvmCoreErrorExitRevert extends Enum { readonly isReverted: boolean; readonly type: 'Reverted'; } - /** @name EvmCoreErrorExitFatal (108) */ + /** @name EvmCoreErrorExitFatal (121) */ interface EvmCoreErrorExitFatal extends Enum { readonly isNotSupported: boolean; readonly isUnhandledInterrupt: boolean; @@ -1258,7 +1441,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; } - /** @name FrameSystemPhase (109) */ + /** @name FrameSystemPhase (122) */ interface FrameSystemPhase extends Enum { readonly isApplyExtrinsic: boolean; readonly asApplyExtrinsic: u32; @@ -1267,13 +1450,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } - /** @name FrameSystemLastRuntimeUpgradeInfo (112) */ + /** @name FrameSystemLastRuntimeUpgradeInfo (124) */ interface FrameSystemLastRuntimeUpgradeInfo extends Struct { readonly specVersion: Compact; readonly specName: Text; } - /** @name FrameSystemCall (114) */ + /** @name FrameSystemCall (125) */ interface FrameSystemCall extends Enum { readonly isFillBlock: boolean; readonly asFillBlock: { @@ -1315,21 +1498,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent'; } - /** @name FrameSystemLimitsBlockWeights (119) */ + /** @name FrameSystemLimitsBlockWeights (130) */ interface FrameSystemLimitsBlockWeights extends Struct { readonly baseBlock: u64; readonly maxBlock: u64; readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; } - /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (120) */ + /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (131) */ interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { readonly normal: FrameSystemLimitsWeightsPerClass; readonly operational: FrameSystemLimitsWeightsPerClass; readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name FrameSystemLimitsWeightsPerClass (121) */ + /** @name FrameSystemLimitsWeightsPerClass (132) */ interface FrameSystemLimitsWeightsPerClass extends Struct { readonly baseExtrinsic: u64; readonly maxExtrinsic: Option; @@ -1337,25 +1520,25 @@ declare module '@polkadot/types/lookup' { readonly reserved: Option; } - /** @name FrameSystemLimitsBlockLength (123) */ + /** @name FrameSystemLimitsBlockLength (134) */ interface FrameSystemLimitsBlockLength extends Struct { readonly max: FrameSupportWeightsPerDispatchClassU32; } - /** @name FrameSupportWeightsPerDispatchClassU32 (124) */ + /** @name FrameSupportWeightsPerDispatchClassU32 (135) */ interface FrameSupportWeightsPerDispatchClassU32 extends Struct { readonly normal: u32; readonly operational: u32; readonly mandatory: u32; } - /** @name FrameSupportWeightsRuntimeDbWeight (125) */ + /** @name FrameSupportWeightsRuntimeDbWeight (136) */ interface FrameSupportWeightsRuntimeDbWeight extends Struct { readonly read: u64; readonly write: u64; } - /** @name SpVersionRuntimeVersion (126) */ + /** @name SpVersionRuntimeVersion (137) */ interface SpVersionRuntimeVersion extends Struct { readonly specName: Text; readonly implName: Text; @@ -1367,7 +1550,7 @@ declare module '@polkadot/types/lookup' { readonly stateVersion: u8; } - /** @name FrameSystemError (131) */ + /** @name FrameSystemError (142) */ interface FrameSystemError extends Enum { readonly isInvalidSpecName: boolean; readonly isSpecVersionNeedsToIncrease: boolean; @@ -1378,7 +1561,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name PolkadotPrimitivesV2PersistedValidationData (132) */ + /** @name PolkadotPrimitivesV2PersistedValidationData (143) */ interface PolkadotPrimitivesV2PersistedValidationData extends Struct { readonly parentHead: Bytes; readonly relayParentNumber: u32; @@ -1386,18 +1569,18 @@ declare module '@polkadot/types/lookup' { readonly maxPovSize: u32; } - /** @name PolkadotPrimitivesV2UpgradeRestriction (135) */ + /** @name PolkadotPrimitivesV2UpgradeRestriction (146) */ interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { readonly isPresent: boolean; readonly type: 'Present'; } - /** @name SpTrieStorageProof (136) */ + /** @name SpTrieStorageProof (147) */ interface SpTrieStorageProof extends Struct { readonly trieNodes: BTreeSet; } - /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (138) */ + /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (149) */ interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { readonly dmqMqcHead: H256; readonly relayDispatchQueueSize: ITuple<[u32, u32]>; @@ -1405,7 +1588,7 @@ declare module '@polkadot/types/lookup' { readonly egressChannels: Vec>; } - /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (141) */ + /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (152) */ interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { readonly maxCapacity: u32; readonly maxTotalSize: u32; @@ -1415,7 +1598,7 @@ declare module '@polkadot/types/lookup' { readonly mqcHead: Option; } - /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (142) */ + /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (153) */ interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { readonly maxCodeSize: u32; readonly maxHeadDataSize: u32; @@ -1428,13 +1611,13 @@ declare module '@polkadot/types/lookup' { readonly validationUpgradeDelay: u32; } - /** @name PolkadotCorePrimitivesOutboundHrmpMessage (148) */ + /** @name PolkadotCorePrimitivesOutboundHrmpMessage (159) */ interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { readonly recipient: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemCall (149) */ + /** @name CumulusPalletParachainSystemCall (160) */ interface CumulusPalletParachainSystemCall extends Enum { readonly isSetValidationData: boolean; readonly asSetValidationData: { @@ -1455,7 +1638,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade'; } - /** @name CumulusPrimitivesParachainInherentParachainInherentData (150) */ + /** @name CumulusPrimitivesParachainInherentParachainInherentData (161) */ interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { readonly validationData: PolkadotPrimitivesV2PersistedValidationData; readonly relayChainState: SpTrieStorageProof; @@ -1463,19 +1646,19 @@ declare module '@polkadot/types/lookup' { readonly horizontalMessages: BTreeMap>; } - /** @name PolkadotCorePrimitivesInboundDownwardMessage (152) */ + /** @name PolkadotCorePrimitivesInboundDownwardMessage (163) */ interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { readonly sentAt: u32; readonly msg: Bytes; } - /** @name PolkadotCorePrimitivesInboundHrmpMessage (155) */ + /** @name PolkadotCorePrimitivesInboundHrmpMessage (166) */ interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { readonly sentAt: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemError (158) */ + /** @name CumulusPalletParachainSystemError (169) */ interface CumulusPalletParachainSystemError extends Enum { readonly isOverlappingUpgrades: boolean; readonly isProhibitedByPolkadot: boolean; @@ -1488,14 +1671,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized'; } - /** @name PalletBalancesBalanceLock (160) */ + /** @name PalletBalancesBalanceLock (171) */ interface PalletBalancesBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; readonly reasons: PalletBalancesReasons; } - /** @name PalletBalancesReasons (161) */ + /** @name PalletBalancesReasons (172) */ interface PalletBalancesReasons extends Enum { readonly isFee: boolean; readonly isMisc: boolean; @@ -1503,20 +1686,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'Fee' | 'Misc' | 'All'; } - /** @name PalletBalancesReserveData (164) */ + /** @name PalletBalancesReserveData (175) */ interface PalletBalancesReserveData extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name PalletBalancesReleases (166) */ + /** @name PalletBalancesReleases (177) */ interface PalletBalancesReleases extends Enum { readonly isV100: boolean; readonly isV200: boolean; readonly type: 'V100' | 'V200'; } - /** @name PalletBalancesCall (167) */ + /** @name PalletBalancesCall (178) */ interface PalletBalancesCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1553,7 +1736,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; } - /** @name PalletBalancesError (170) */ + /** @name PalletBalancesError (181) */ interface PalletBalancesError extends Enum { readonly isVestingBalance: boolean; readonly isLiquidityRestrictions: boolean; @@ -1566,7 +1749,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves'; } - /** @name PalletTimestampCall (172) */ + /** @name PalletTimestampCall (183) */ interface PalletTimestampCall extends Enum { readonly isSet: boolean; readonly asSet: { @@ -1575,14 +1758,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Set'; } - /** @name PalletTransactionPaymentReleases (174) */ + /** @name PalletTransactionPaymentReleases (185) */ interface PalletTransactionPaymentReleases extends Enum { readonly isV1Ancient: boolean; readonly isV2: boolean; readonly type: 'V1Ancient' | 'V2'; } - /** @name PalletTreasuryProposal (175) */ + /** @name PalletTreasuryProposal (186) */ interface PalletTreasuryProposal extends Struct { readonly proposer: AccountId32; readonly value: u128; @@ -1590,7 +1773,7 @@ declare module '@polkadot/types/lookup' { readonly bond: u128; } - /** @name PalletTreasuryCall (178) */ + /** @name PalletTreasuryCall (189) */ interface PalletTreasuryCall extends Enum { readonly isProposeSpend: boolean; readonly asProposeSpend: { @@ -1617,10 +1800,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval'; } - /** @name FrameSupportPalletId (181) */ + /** @name FrameSupportPalletId (192) */ interface FrameSupportPalletId extends U8aFixed {} - /** @name PalletTreasuryError (182) */ + /** @name PalletTreasuryError (193) */ interface PalletTreasuryError extends Enum { readonly isInsufficientProposersBalance: boolean; readonly isInvalidIndex: boolean; @@ -1630,7 +1813,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved'; } - /** @name PalletSudoCall (183) */ + /** @name PalletSudoCall (194) */ interface PalletSudoCall extends Enum { readonly isSudo: boolean; readonly asSudo: { @@ -1653,7 +1836,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs'; } - /** @name OrmlVestingModuleCall (185) */ + /** @name OrmlVestingModuleCall (196) */ interface OrmlVestingModuleCall extends Enum { readonly isClaim: boolean; readonly isVestedTransfer: boolean; @@ -1673,7 +1856,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor'; } - /** @name OrmlXtokensModuleCall (187) */ + /** @name OrmlXtokensModuleCall (198) */ interface OrmlXtokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1720,7 +1903,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'TransferMultiasset' | 'TransferWithFee' | 'TransferMultiassetWithFee' | 'TransferMulticurrencies' | 'TransferMultiassets'; } - /** @name XcmVersionedMultiAsset (188) */ + /** @name XcmVersionedMultiAsset (199) */ interface XcmVersionedMultiAsset extends Enum { readonly isV0: boolean; readonly asV0: XcmV0MultiAsset; @@ -1729,7 +1912,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1'; } - /** @name OrmlTokensModuleCall (191) */ + /** @name OrmlTokensModuleCall (202) */ interface OrmlTokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1766,7 +1949,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'TransferAll' | 'TransferKeepAlive' | 'ForceTransfer' | 'SetBalance'; } - /** @name CumulusPalletXcmpQueueCall (192) */ + /** @name CumulusPalletXcmpQueueCall (203) */ interface CumulusPalletXcmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { @@ -1802,7 +1985,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight'; } - /** @name PalletXcmCall (193) */ + /** @name PalletXcmCall (204) */ interface PalletXcmCall extends Enum { readonly isSend: boolean; readonly asSend: { @@ -1864,7 +2047,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets'; } - /** @name XcmVersionedXcm (194) */ + /** @name XcmVersionedXcm (205) */ interface XcmVersionedXcm extends Enum { readonly isV0: boolean; readonly asV0: XcmV0Xcm; @@ -1875,7 +2058,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1' | 'V2'; } - /** @name XcmV0Xcm (195) */ + /** @name XcmV0Xcm (206) */ interface XcmV0Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -1938,7 +2121,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom'; } - /** @name XcmV0Order (197) */ + /** @name XcmV0Order (208) */ interface XcmV0Order extends Enum { readonly isNull: boolean; readonly isDepositAsset: boolean; @@ -1986,14 +2169,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV0Response (199) */ + /** @name XcmV0Response (210) */ interface XcmV0Response extends Enum { readonly isAssets: boolean; readonly asAssets: Vec; readonly type: 'Assets'; } - /** @name XcmV1Xcm (200) */ + /** @name XcmV1Xcm (211) */ interface XcmV1Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -2062,7 +2245,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion'; } - /** @name XcmV1Order (202) */ + /** @name XcmV1Order (213) */ interface XcmV1Order extends Enum { readonly isNoop: boolean; readonly isDepositAsset: boolean; @@ -2112,7 +2295,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV1Response (204) */ + /** @name XcmV1Response (215) */ interface XcmV1Response extends Enum { readonly isAssets: boolean; readonly asAssets: XcmV1MultiassetMultiAssets; @@ -2121,10 +2304,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'Assets' | 'Version'; } - /** @name CumulusPalletXcmCall (219) */ + /** @name CumulusPalletXcmCall (229) */ type CumulusPalletXcmCall = Null; - /** @name CumulusPalletDmpQueueCall (220) */ + /** @name CumulusPalletDmpQueueCall (230) */ interface CumulusPalletDmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { @@ -2134,7 +2317,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight'; } - /** @name PalletInflationCall (221) */ + /** @name PalletInflationCall (231) */ interface PalletInflationCall extends Enum { readonly isStartInflation: boolean; readonly asStartInflation: { @@ -2143,7 +2326,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'StartInflation'; } - /** @name PalletUniqueCall (222) */ + /** @name PalletUniqueCall (232) */ interface PalletUniqueCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -2301,7 +2484,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; } - /** @name UpDataStructsCollectionMode (227) */ + /** @name UpDataStructsCollectionMode (237) */ interface UpDataStructsCollectionMode extends Enum { readonly isNft: boolean; readonly isFungible: boolean; @@ -2310,7 +2493,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateCollectionData (228) */ + /** @name UpDataStructsCreateCollectionData (238) */ interface UpDataStructsCreateCollectionData extends Struct { readonly mode: UpDataStructsCollectionMode; readonly access: Option; @@ -2324,14 +2507,14 @@ declare module '@polkadot/types/lookup' { readonly properties: Vec; } - /** @name UpDataStructsAccessMode (230) */ + /** @name UpDataStructsAccessMode (240) */ interface UpDataStructsAccessMode extends Enum { readonly isNormal: boolean; readonly isAllowList: boolean; readonly type: 'Normal' | 'AllowList'; } - /** @name UpDataStructsCollectionLimits (232) */ + /** @name UpDataStructsCollectionLimits (242) */ interface UpDataStructsCollectionLimits extends Struct { readonly accountTokenOwnershipLimit: Option; readonly sponsoredDataSize: Option; @@ -2344,7 +2527,7 @@ declare module '@polkadot/types/lookup' { readonly transfersEnabled: Option; } - /** @name UpDataStructsSponsoringRateLimit (234) */ + /** @name UpDataStructsSponsoringRateLimit (244) */ interface UpDataStructsSponsoringRateLimit extends Enum { readonly isSponsoringDisabled: boolean; readonly isBlocks: boolean; @@ -2352,43 +2535,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'SponsoringDisabled' | 'Blocks'; } - /** @name UpDataStructsCollectionPermissions (237) */ + /** @name UpDataStructsCollectionPermissions (247) */ interface UpDataStructsCollectionPermissions extends Struct { readonly access: Option; readonly mintMode: Option; readonly nesting: Option; } - /** @name UpDataStructsNestingPermissions (239) */ + /** @name UpDataStructsNestingPermissions (249) */ interface UpDataStructsNestingPermissions extends Struct { readonly tokenOwner: bool; readonly collectionAdmin: bool; readonly restricted: Option; } - /** @name UpDataStructsOwnerRestrictedSet (241) */ + /** @name UpDataStructsOwnerRestrictedSet (251) */ interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} - /** @name UpDataStructsPropertyKeyPermission (246) */ + /** @name UpDataStructsPropertyKeyPermission (256) */ interface UpDataStructsPropertyKeyPermission extends Struct { readonly key: Bytes; readonly permission: UpDataStructsPropertyPermission; } - /** @name UpDataStructsPropertyPermission (247) */ + /** @name UpDataStructsPropertyPermission (257) */ interface UpDataStructsPropertyPermission extends Struct { readonly mutable: bool; readonly collectionAdmin: bool; readonly tokenOwner: bool; } - /** @name UpDataStructsProperty (250) */ + /** @name UpDataStructsProperty (260) */ interface UpDataStructsProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name UpDataStructsCreateItemData (253) */ + /** @name UpDataStructsCreateItemData (263) */ interface UpDataStructsCreateItemData extends Enum { readonly isNft: boolean; readonly asNft: UpDataStructsCreateNftData; @@ -2399,23 +2582,23 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateNftData (254) */ + /** @name UpDataStructsCreateNftData (264) */ interface UpDataStructsCreateNftData extends Struct { readonly properties: Vec; } - /** @name UpDataStructsCreateFungibleData (255) */ + /** @name UpDataStructsCreateFungibleData (265) */ interface UpDataStructsCreateFungibleData extends Struct { readonly value: u128; } - /** @name UpDataStructsCreateReFungibleData (256) */ + /** @name UpDataStructsCreateReFungibleData (266) */ interface UpDataStructsCreateReFungibleData extends Struct { readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateItemExData (259) */ + /** @name UpDataStructsCreateItemExData (269) */ interface UpDataStructsCreateItemExData extends Enum { readonly isNft: boolean; readonly asNft: Vec; @@ -2428,26 +2611,60 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; } - /** @name UpDataStructsCreateNftExData (261) */ + /** @name UpDataStructsCreateNftExData (271) */ interface UpDataStructsCreateNftExData extends Struct { readonly properties: Vec; readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsCreateRefungibleExSingleOwner (268) */ + /** @name UpDataStructsCreateRefungibleExSingleOwner (278) */ interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { readonly user: PalletEvmAccountBasicCrossAccountIdRepr; readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateRefungibleExMultipleOwners (270) */ + /** @name UpDataStructsCreateRefungibleExMultipleOwners (280) */ interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { readonly users: BTreeMap; readonly properties: Vec; } - /** @name PalletConfigurationCall (271) */ + /** @name PalletUniqueSchedulerCall (281) */ + interface PalletUniqueSchedulerCall extends Enum { + readonly isScheduleNamed: boolean; + readonly asScheduleNamed: { + readonly id: U8aFixed; + readonly when: u32; + readonly maybePeriodic: Option>; + readonly priority: u8; + readonly call: FrameSupportScheduleMaybeHashed; + } & Struct; + readonly isCancelNamed: boolean; + readonly asCancelNamed: { + readonly id: U8aFixed; + } & Struct; + readonly isScheduleNamedAfter: boolean; + readonly asScheduleNamedAfter: { + readonly id: U8aFixed; + readonly after: u32; + readonly maybePeriodic: Option>; + readonly priority: u8; + readonly call: FrameSupportScheduleMaybeHashed; + } & Struct; + readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; + } + + /** @name FrameSupportScheduleMaybeHashed (283) */ + interface FrameSupportScheduleMaybeHashed extends Enum { + readonly isValue: boolean; + readonly asValue: Call; + readonly isHash: boolean; + readonly asHash: H256; + readonly type: 'Value' | 'Hash'; + } + + /** @name PalletConfigurationCall (284) */ interface PalletConfigurationCall extends Enum { readonly isSetWeightToFeeCoefficientOverride: boolean; readonly asSetWeightToFeeCoefficientOverride: { @@ -2460,13 +2677,243 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride'; } - /** @name PalletTemplateTransactionPaymentCall (272) */ + /** @name PalletTemplateTransactionPaymentCall (285) */ type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletStructureCall (273) */ + /** @name PalletStructureCall (286) */ type PalletStructureCall = Null; - /** @name PalletEvmCall (274) */ + /** @name PalletRmrkCoreCall (287) */ + interface PalletRmrkCoreCall extends Enum { + readonly isCreateCollection: boolean; + readonly asCreateCollection: { + readonly metadata: Bytes; + readonly max: Option; + readonly symbol: Bytes; + } & Struct; + readonly isDestroyCollection: boolean; + readonly asDestroyCollection: { + readonly collectionId: u32; + } & Struct; + readonly isChangeCollectionIssuer: boolean; + readonly asChangeCollectionIssuer: { + readonly collectionId: u32; + readonly newIssuer: MultiAddress; + } & Struct; + readonly isLockCollection: boolean; + readonly asLockCollection: { + readonly collectionId: u32; + } & Struct; + readonly isMintNft: boolean; + readonly asMintNft: { + readonly owner: Option; + readonly collectionId: u32; + readonly recipient: Option; + readonly royaltyAmount: Option; + readonly metadata: Bytes; + readonly transferable: bool; + readonly resources: Option>; + } & Struct; + readonly isBurnNft: boolean; + readonly asBurnNft: { + readonly collectionId: u32; + readonly nftId: u32; + readonly maxBurns: u32; + } & Struct; + readonly isSend: boolean; + readonly asSend: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; + } & Struct; + readonly isAcceptNft: boolean; + readonly asAcceptNft: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple; + } & Struct; + readonly isRejectNft: boolean; + readonly asRejectNft: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + } & Struct; + readonly isAcceptResource: boolean; + readonly asAcceptResource: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly resourceId: u32; + } & Struct; + readonly isAcceptResourceRemoval: boolean; + readonly asAcceptResourceRemoval: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly resourceId: u32; + } & Struct; + readonly isSetProperty: boolean; + readonly asSetProperty: { + readonly rmrkCollectionId: Compact; + readonly maybeNftId: Option; + readonly key: Bytes; + readonly value: Bytes; + } & Struct; + readonly isSetPriority: boolean; + readonly asSetPriority: { + readonly rmrkCollectionId: u32; + readonly rmrkNftId: u32; + readonly priorities: Vec; + } & Struct; + readonly isAddBasicResource: boolean; + readonly asAddBasicResource: { + readonly rmrkCollectionId: u32; + readonly nftId: u32; + readonly resource: RmrkTraitsResourceBasicResource; + } & Struct; + readonly isAddComposableResource: boolean; + readonly asAddComposableResource: { + readonly rmrkCollectionId: u32; + readonly nftId: u32; + readonly resource: RmrkTraitsResourceComposableResource; + } & Struct; + readonly isAddSlotResource: boolean; + readonly asAddSlotResource: { + readonly rmrkCollectionId: u32; + readonly nftId: u32; + readonly resource: RmrkTraitsResourceSlotResource; + } & Struct; + readonly isRemoveResource: boolean; + readonly asRemoveResource: { + readonly rmrkCollectionId: u32; + readonly nftId: u32; + readonly resourceId: u32; + } & Struct; + readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; + } + + /** @name RmrkTraitsResourceResourceTypes (293) */ + interface RmrkTraitsResourceResourceTypes extends Enum { + readonly isBasic: boolean; + readonly asBasic: RmrkTraitsResourceBasicResource; + readonly isComposable: boolean; + readonly asComposable: RmrkTraitsResourceComposableResource; + readonly isSlot: boolean; + readonly asSlot: RmrkTraitsResourceSlotResource; + readonly type: 'Basic' | 'Composable' | 'Slot'; + } + + /** @name RmrkTraitsResourceBasicResource (295) */ + interface RmrkTraitsResourceBasicResource extends Struct { + readonly src: Option; + readonly metadata: Option; + readonly license: Option; + readonly thumb: Option; + } + + /** @name RmrkTraitsResourceComposableResource (297) */ + interface RmrkTraitsResourceComposableResource extends Struct { + readonly parts: Vec; + readonly base: u32; + readonly src: Option; + readonly metadata: Option; + readonly license: Option; + readonly thumb: Option; + } + + /** @name RmrkTraitsResourceSlotResource (298) */ + interface RmrkTraitsResourceSlotResource extends Struct { + readonly base: u32; + readonly src: Option; + readonly metadata: Option; + readonly slot: u32; + readonly license: Option; + readonly thumb: Option; + } + + /** @name PalletRmrkEquipCall (301) */ + interface PalletRmrkEquipCall extends Enum { + readonly isCreateBase: boolean; + readonly asCreateBase: { + readonly baseType: Bytes; + readonly symbol: Bytes; + readonly parts: Vec; + } & Struct; + readonly isThemeAdd: boolean; + readonly asThemeAdd: { + readonly baseId: u32; + readonly theme: RmrkTraitsTheme; + } & Struct; + readonly isEquippable: boolean; + readonly asEquippable: { + readonly baseId: u32; + readonly slotId: u32; + readonly equippables: RmrkTraitsPartEquippableList; + } & Struct; + readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; + } + + /** @name RmrkTraitsPartPartType (304) */ + interface RmrkTraitsPartPartType extends Enum { + readonly isFixedPart: boolean; + readonly asFixedPart: RmrkTraitsPartFixedPart; + readonly isSlotPart: boolean; + readonly asSlotPart: RmrkTraitsPartSlotPart; + readonly type: 'FixedPart' | 'SlotPart'; + } + + /** @name RmrkTraitsPartFixedPart (306) */ + interface RmrkTraitsPartFixedPart extends Struct { + readonly id: u32; + readonly z: u32; + readonly src: Bytes; + } + + /** @name RmrkTraitsPartSlotPart (307) */ + interface RmrkTraitsPartSlotPart extends Struct { + readonly id: u32; + readonly equippable: RmrkTraitsPartEquippableList; + readonly src: Bytes; + readonly z: u32; + } + + /** @name RmrkTraitsPartEquippableList (308) */ + interface RmrkTraitsPartEquippableList extends Enum { + readonly isAll: boolean; + readonly isEmpty: boolean; + readonly isCustom: boolean; + readonly asCustom: Vec; + readonly type: 'All' | 'Empty' | 'Custom'; + } + + /** @name RmrkTraitsTheme (310) */ + interface RmrkTraitsTheme extends Struct { + readonly name: Bytes; + readonly properties: Vec; + readonly inherit: bool; + } + + /** @name RmrkTraitsThemeThemeProperty (312) */ + interface RmrkTraitsThemeThemeProperty extends Struct { + readonly key: Bytes; + readonly value: Bytes; + } + + /** @name PalletForeignAssetsModuleCall (314) */ + interface PalletForeignAssetsModuleCall extends Enum { + readonly isRegisterForeignAsset: boolean; + readonly asRegisterForeignAsset: { + readonly owner: AccountId32; + readonly location: XcmVersionedMultiLocation; + readonly metadata: PalletForeignAssetsModuleAssetMetadata; + } & Struct; + readonly isUpdateForeignAsset: boolean; + readonly asUpdateForeignAsset: { + readonly foreignAssetId: u32; + readonly location: XcmVersionedMultiLocation; + readonly metadata: PalletForeignAssetsModuleAssetMetadata; + } & Struct; + readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset'; + } + + /** @name PalletEvmCall (315) */ interface PalletEvmCall extends Enum { readonly isWithdraw: boolean; readonly asWithdraw: { @@ -2511,7 +2958,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name PalletEthereumCall (278) */ + /** @name PalletEthereumCall (319) */ interface PalletEthereumCall extends Enum { readonly isTransact: boolean; readonly asTransact: { @@ -2520,7 +2967,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transact'; } - /** @name EthereumTransactionTransactionV2 (279) */ + /** @name EthereumTransactionTransactionV2 (320) */ interface EthereumTransactionTransactionV2 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumTransactionLegacyTransaction; @@ -2531,7 +2978,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumTransactionLegacyTransaction (280) */ + /** @name EthereumTransactionLegacyTransaction (321) */ interface EthereumTransactionLegacyTransaction extends Struct { readonly nonce: U256; readonly gasPrice: U256; @@ -2542,7 +2989,7 @@ declare module '@polkadot/types/lookup' { readonly signature: EthereumTransactionTransactionSignature; } - /** @name EthereumTransactionTransactionAction (281) */ + /** @name EthereumTransactionTransactionAction (322) */ interface EthereumTransactionTransactionAction extends Enum { readonly isCall: boolean; readonly asCall: H160; @@ -2550,14 +2997,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Call' | 'Create'; } - /** @name EthereumTransactionTransactionSignature (282) */ + /** @name EthereumTransactionTransactionSignature (323) */ interface EthereumTransactionTransactionSignature extends Struct { readonly v: u64; readonly r: H256; readonly s: H256; } - /** @name EthereumTransactionEip2930Transaction (284) */ + /** @name EthereumTransactionEip2930Transaction (325) */ interface EthereumTransactionEip2930Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -2572,13 +3019,13 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name EthereumTransactionAccessListItem (286) */ + /** @name EthereumTransactionAccessListItem (327) */ interface EthereumTransactionAccessListItem extends Struct { readonly address: H160; readonly storageKeys: Vec; } - /** @name EthereumTransactionEip1559Transaction (287) */ + /** @name EthereumTransactionEip1559Transaction (328) */ interface EthereumTransactionEip1559Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -2594,7 +3041,7 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name PalletEvmMigrationCall (288) */ + /** @name PalletEvmMigrationCall (329) */ interface PalletEvmMigrationCall extends Enum { readonly isBegin: boolean; readonly asBegin: { @@ -2613,13 +3060,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Begin' | 'SetData' | 'Finish'; } - /** @name PalletSudoError (291) */ + /** @name PalletSudoError (332) */ interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: 'RequireSudo'; } - /** @name OrmlVestingModuleError (293) */ + /** @name OrmlVestingModuleError (334) */ interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; @@ -2630,7 +3077,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name OrmlXtokensModuleError (294) */ + /** @name OrmlXtokensModuleError (335) */ interface OrmlXtokensModuleError extends Enum { readonly isAssetHasNoReserve: boolean; readonly isNotCrossChainTransfer: boolean; @@ -2654,26 +3101,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined'; } - /** @name OrmlTokensBalanceLock (297) */ + /** @name OrmlTokensBalanceLock (338) */ interface OrmlTokensBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name OrmlTokensAccountData (299) */ + /** @name OrmlTokensAccountData (340) */ interface OrmlTokensAccountData extends Struct { readonly free: u128; readonly reserved: u128; readonly frozen: u128; } - /** @name OrmlTokensReserveData (301) */ + /** @name OrmlTokensReserveData (342) */ interface OrmlTokensReserveData extends Struct { readonly id: Null; readonly amount: u128; } - /** @name OrmlTokensModuleError (303) */ + /** @name OrmlTokensModuleError (344) */ interface OrmlTokensModuleError extends Enum { readonly isBalanceTooLow: boolean; readonly isAmountIntoBalanceFailed: boolean; @@ -2686,21 +3133,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (305) */ + /** @name CumulusPalletXcmpQueueInboundChannelDetails (346) */ interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (306) */ + /** @name CumulusPalletXcmpQueueInboundState (347) */ interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (309) */ + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (350) */ interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; @@ -2708,7 +3155,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (312) */ + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (353) */ interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; @@ -2717,14 +3164,14 @@ declare module '@polkadot/types/lookup' { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (313) */ + /** @name CumulusPalletXcmpQueueOutboundState (354) */ interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (315) */ + /** @name CumulusPalletXcmpQueueQueueConfigData (356) */ interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; @@ -2734,7 +3181,7 @@ declare module '@polkadot/types/lookup' { readonly xcmpMaxIndividualWeight: u64; } - /** @name CumulusPalletXcmpQueueError (317) */ + /** @name CumulusPalletXcmpQueueError (358) */ interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; @@ -2744,7 +3191,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (318) */ + /** @name PalletXcmError (359) */ interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; @@ -2762,29 +3209,29 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (319) */ + /** @name CumulusPalletXcmError (360) */ type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (320) */ + /** @name CumulusPalletDmpQueueConfigData (361) */ interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: u64; } - /** @name CumulusPalletDmpQueuePageIndexData (321) */ + /** @name CumulusPalletDmpQueuePageIndexData (362) */ interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (324) */ + /** @name CumulusPalletDmpQueueError (365) */ interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (328) */ + /** @name PalletUniqueError (369) */ interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; @@ -2793,7 +3240,75 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name UpDataStructsCollection (329) */ + /** @name PalletUniqueSchedulerScheduledV3 (372) */ + interface PalletUniqueSchedulerScheduledV3 extends Struct { + readonly maybeId: Option; + readonly priority: u8; + readonly call: FrameSupportScheduleMaybeHashed; + readonly maybePeriodic: Option>; + readonly origin: OpalRuntimeOriginCaller; + } + + /** @name OpalRuntimeOriginCaller (373) */ + interface OpalRuntimeOriginCaller extends Enum { + readonly isSystem: boolean; + readonly asSystem: FrameSupportDispatchRawOrigin; + readonly isVoid: boolean; + readonly isPolkadotXcm: boolean; + readonly asPolkadotXcm: PalletXcmOrigin; + readonly isCumulusXcm: boolean; + readonly asCumulusXcm: CumulusPalletXcmOrigin; + readonly isEthereum: boolean; + readonly asEthereum: PalletEthereumRawOrigin; + readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; + } + + /** @name FrameSupportDispatchRawOrigin (374) */ + interface FrameSupportDispatchRawOrigin extends Enum { + readonly isRoot: boolean; + readonly isSigned: boolean; + readonly asSigned: AccountId32; + readonly isNone: boolean; + readonly type: 'Root' | 'Signed' | 'None'; + } + + /** @name PalletXcmOrigin (375) */ + interface PalletXcmOrigin extends Enum { + readonly isXcm: boolean; + readonly asXcm: XcmV1MultiLocation; + readonly isResponse: boolean; + readonly asResponse: XcmV1MultiLocation; + readonly type: 'Xcm' | 'Response'; + } + + /** @name CumulusPalletXcmOrigin (376) */ + interface CumulusPalletXcmOrigin extends Enum { + readonly isRelay: boolean; + readonly isSiblingParachain: boolean; + readonly asSiblingParachain: u32; + readonly type: 'Relay' | 'SiblingParachain'; + } + + /** @name PalletEthereumRawOrigin (377) */ + interface PalletEthereumRawOrigin extends Enum { + readonly isEthereumTransaction: boolean; + readonly asEthereumTransaction: H160; + readonly type: 'EthereumTransaction'; + } + + /** @name SpCoreVoid (378) */ + type SpCoreVoid = Null; + + /** @name PalletUniqueSchedulerError (379) */ + interface PalletUniqueSchedulerError extends Enum { + readonly isFailedToSchedule: boolean; + readonly isNotFound: boolean; + readonly isTargetBlockNumberInPast: boolean; + readonly isRescheduleNoChange: boolean; + readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; + } + + /** @name UpDataStructsCollection (380) */ interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -2806,7 +3321,7 @@ declare module '@polkadot/types/lookup' { readonly externalCollection: bool; } - /** @name UpDataStructsSponsorshipStateAccountId32 (330) */ + /** @name UpDataStructsSponsorshipStateAccountId32 (381) */ interface UpDataStructsSponsorshipStateAccountId32 extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -2816,43 +3331,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (331) */ + /** @name UpDataStructsProperties (382) */ interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (332) */ + /** @name UpDataStructsPropertiesMapBoundedVec (383) */ interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (337) */ + /** @name UpDataStructsPropertiesMapPropertyPermission (388) */ interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (344) */ + /** @name UpDataStructsCollectionStats (395) */ interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (345) */ + /** @name UpDataStructsTokenChild (396) */ interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (346) */ + /** @name PhantomTypeUpDataStructs (397) */ interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (348) */ + /** @name UpDataStructsTokenData (399) */ interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (350) */ + /** @name UpDataStructsRpcCollection (401) */ interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -2867,7 +3382,7 @@ declare module '@polkadot/types/lookup' { readonly readOnly: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (351) */ + /** @name RmrkTraitsCollectionCollectionInfo (402) */ interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; @@ -2876,7 +3391,7 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (354) */ + /** @name RmrkTraitsNftNftInfo (403) */ interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; @@ -2885,22 +3400,13 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (355) */ - interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { - readonly isAccountId: boolean; - readonly asAccountId: AccountId32; - readonly isCollectionAndNftTuple: boolean; - readonly asCollectionAndNftTuple: ITuple<[u32, u32]>; - readonly type: 'AccountId' | 'CollectionAndNftTuple'; - } - - /** @name RmrkTraitsNftRoyaltyInfo (357) */ + /** @name RmrkTraitsNftRoyaltyInfo (405) */ interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (358) */ + /** @name RmrkTraitsResourceResourceInfo (406) */ interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; @@ -2908,111 +3414,26 @@ declare module '@polkadot/types/lookup' { readonly pendingRemoval: bool; } - /** @name RmrkTraitsResourceResourceTypes (360) */ - interface RmrkTraitsResourceResourceTypes extends Enum { - readonly isBasic: boolean; - readonly asBasic: RmrkTraitsResourceBasicResource; - readonly isComposable: boolean; - readonly asComposable: RmrkTraitsResourceComposableResource; - readonly isSlot: boolean; - readonly asSlot: RmrkTraitsResourceSlotResource; - readonly type: 'Basic' | 'Composable' | 'Slot'; - } - - /** @name RmrkTraitsResourceBasicResource (361) */ - interface RmrkTraitsResourceBasicResource extends Struct { - readonly src: Option; - readonly metadata: Option; - readonly license: Option; - readonly thumb: Option; - } - - /** @name RmrkTraitsResourceComposableResource (363) */ - interface RmrkTraitsResourceComposableResource extends Struct { - readonly parts: Vec; - readonly base: u32; - readonly src: Option; - readonly metadata: Option; - readonly license: Option; - readonly thumb: Option; - } - - /** @name RmrkTraitsResourceSlotResource (364) */ - interface RmrkTraitsResourceSlotResource extends Struct { - readonly base: u32; - readonly src: Option; - readonly metadata: Option; - readonly slot: u32; - readonly license: Option; - readonly thumb: Option; - } - - /** @name RmrkTraitsPropertyPropertyInfo (365) */ + /** @name RmrkTraitsPropertyPropertyInfo (407) */ interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (368) */ + /** @name RmrkTraitsBaseBaseInfo (408) */ interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsPartPartType (369) */ - interface RmrkTraitsPartPartType extends Enum { - readonly isFixedPart: boolean; - readonly asFixedPart: RmrkTraitsPartFixedPart; - readonly isSlotPart: boolean; - readonly asSlotPart: RmrkTraitsPartSlotPart; - readonly type: 'FixedPart' | 'SlotPart'; - } - - /** @name RmrkTraitsPartFixedPart (371) */ - interface RmrkTraitsPartFixedPart extends Struct { - readonly id: u32; - readonly z: u32; - readonly src: Bytes; - } - - /** @name RmrkTraitsPartSlotPart (372) */ - interface RmrkTraitsPartSlotPart extends Struct { - readonly id: u32; - readonly equippable: RmrkTraitsPartEquippableList; - readonly src: Bytes; - readonly z: u32; - } - - /** @name RmrkTraitsPartEquippableList (373) */ - interface RmrkTraitsPartEquippableList extends Enum { - readonly isAll: boolean; - readonly isEmpty: boolean; - readonly isCustom: boolean; - readonly asCustom: Vec; - readonly type: 'All' | 'Empty' | 'Custom'; - } - - /** @name RmrkTraitsTheme (374) */ - interface RmrkTraitsTheme extends Struct { - readonly name: Bytes; - readonly properties: Vec; - readonly inherit: bool; - } - - /** @name RmrkTraitsThemeThemeProperty (376) */ - interface RmrkTraitsThemeThemeProperty extends Struct { - readonly key: Bytes; - readonly value: Bytes; - } - - /** @name RmrkTraitsNftNftChild (378) */ + /** @name RmrkTraitsNftNftChild (409) */ interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (380) */ + /** @name PalletCommonError (411) */ interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; @@ -3051,7 +3472,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (382) */ + /** @name PalletFungibleError (413) */ interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; @@ -3061,19 +3482,34 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletNonfungibleItemData (383) */ + /** @name PalletRefungibleItemData (414) */ + interface PalletRefungibleItemData extends Struct { + readonly constData: Bytes; + } + + /** @name PalletRefungibleError (419) */ + interface PalletRefungibleError extends Enum { + readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; + readonly isWrongRefungiblePieces: boolean; + readonly isRepartitionWhileNotOwningAllPieces: boolean; + readonly isRefungibleDisallowsNesting: boolean; + readonly isSettingPropertiesNotAllowed: boolean; + readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; + } + + /** @name PalletNonfungibleItemData (420) */ interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (385) */ + /** @name UpDataStructsPropertyScope (422) */ interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; readonly type: 'None' | 'Rmrk'; } - /** @name PalletNonfungibleError (389) */ + /** @name PalletNonfungibleError (424) */ interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; @@ -3081,7 +3517,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (390) */ + /** @name PalletStructureError (425) */ interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; @@ -3090,7 +3526,52 @@ declare module '@polkadot/types/lookup' { readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletEvmError (393) */ + /** @name PalletRmrkCoreError (426) */ + interface PalletRmrkCoreError extends Enum { + readonly isCorruptedCollectionType: boolean; + readonly isRmrkPropertyKeyIsTooLong: boolean; + readonly isRmrkPropertyValueIsTooLong: boolean; + readonly isRmrkPropertyIsNotFound: boolean; + readonly isUnableToDecodeRmrkData: boolean; + readonly isCollectionNotEmpty: boolean; + readonly isNoAvailableCollectionId: boolean; + readonly isNoAvailableNftId: boolean; + readonly isCollectionUnknown: boolean; + readonly isNoPermission: boolean; + readonly isNonTransferable: boolean; + readonly isCollectionFullOrLocked: boolean; + readonly isResourceDoesntExist: boolean; + readonly isCannotSendToDescendentOrSelf: boolean; + readonly isCannotAcceptNonOwnedNft: boolean; + readonly isCannotRejectNonOwnedNft: boolean; + readonly isCannotRejectNonPendingNft: boolean; + readonly isResourceNotPending: boolean; + readonly isNoAvailableResourceId: boolean; + readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; + } + + /** @name PalletRmrkEquipError (428) */ + interface PalletRmrkEquipError extends Enum { + readonly isPermissionError: boolean; + readonly isNoAvailableBaseId: boolean; + readonly isNoAvailablePartId: boolean; + readonly isBaseDoesntExist: boolean; + readonly isNeedsDefaultThemeFirst: boolean; + readonly isPartDoesntExist: boolean; + readonly isNoEquippableOnFixedPart: boolean; + readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; + } + + /** @name PalletForeignAssetsModuleError (429) */ + interface PalletForeignAssetsModuleError extends Enum { + readonly isBadLocation: boolean; + readonly isMultiLocationExisted: boolean; + readonly isAssetIdNotExists: boolean; + readonly isAssetIdExisted: boolean; + readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted'; + } + + /** @name PalletEvmError (432) */ interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; @@ -3101,7 +3582,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (396) */ + /** @name FpRpcTransactionStatus (435) */ interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; @@ -3112,10 +3593,10 @@ declare module '@polkadot/types/lookup' { readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (398) */ + /** @name EthbloomBloom (437) */ interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (400) */ + /** @name EthereumReceiptReceiptV3 (439) */ interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; @@ -3126,7 +3607,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (401) */ + /** @name EthereumReceiptEip658ReceiptData (440) */ interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; @@ -3134,14 +3615,14 @@ declare module '@polkadot/types/lookup' { readonly logs: Vec; } - /** @name EthereumBlock (402) */ + /** @name EthereumBlock (441) */ interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (403) */ + /** @name EthereumHeader (442) */ interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; @@ -3160,24 +3641,24 @@ declare module '@polkadot/types/lookup' { readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (404) */ + /** @name EthereumTypesHashH64 (443) */ interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (409) */ + /** @name PalletEthereumError (448) */ interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (410) */ + /** @name PalletEvmCoderSubstrateError (449) */ interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (411) */ + /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (450) */ interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3187,7 +3668,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name PalletEvmContractHelpersSponsoringModeT (412) */ + /** @name PalletEvmContractHelpersSponsoringModeT (451) */ interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; @@ -3195,21 +3676,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (414) */ + /** @name PalletEvmContractHelpersError (453) */ interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly isNoPendingSponsor: boolean; readonly type: 'NoPermission' | 'NoPendingSponsor'; } - /** @name PalletEvmMigrationError (415) */ + /** @name PalletEvmMigrationError (454) */ interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (417) */ + /** @name SpRuntimeMultiSignature (456) */ interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; @@ -3220,34 +3701,34 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (418) */ + /** @name SpCoreEd25519Signature (457) */ interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (420) */ + /** @name SpCoreSr25519Signature (459) */ interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (421) */ + /** @name SpCoreEcdsaSignature (460) */ interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (424) */ + /** @name FrameSystemExtensionsCheckSpecVersion (463) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (425) */ + /** @name FrameSystemExtensionsCheckGenesis (464) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (428) */ + /** @name FrameSystemExtensionsCheckNonce (467) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (429) */ + /** @name FrameSystemExtensionsCheckWeight (468) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (430) */ + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (469) */ interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name UniqueRuntimeRuntime (431) */ - type UniqueRuntimeRuntime = Null; + /** @name OpalRuntimeRuntime (470) */ + type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (432) */ + /** @name PalletEthereumFakeTransactionFinalizer (471) */ type PalletEthereumFakeTransactionFinalizer = Null; } // declare module From 6c9f876cf2d54ddfc9a5f046b3e38956654e41e0 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 6 Sep 2022 22:50:14 +0000 Subject: [PATCH 0758/1274] fix(xcm): opal tests --- tests/src/xcm/xcmOpal.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/xcm/xcmOpal.test.ts b/tests/src/xcm/xcmOpal.test.ts index 8b6e10cf23..e9c39753f7 100644 --- a/tests/src/xcm/xcmOpal.test.ts +++ b/tests/src/xcm/xcmOpal.test.ts @@ -35,7 +35,7 @@ const UNIQUE_CHAIN = 2095; const RELAY_PORT = '9844'; const UNIQUE_PORT = '9944'; -const STATEMINE_PORT = '9946'; +const STATEMINE_PORT = '9948'; const STATEMINE_PALLET_INSTANCE = 50; const ASSET_ID = 100; const ASSET_METADATA_DECIMALS = 18; @@ -146,7 +146,7 @@ describe('Integration test: Exchanging USDT with Westmint', () => { minimalBalance: ASSET_METADATA_MINIMAL_BALANCE, }; //registerForeignAsset(owner, location, metadata) - const tx = api.tx.foreingAssets.registerForeignAsset(alice.addressRaw, location, metadata); + const tx = api.tx.foreignAssets.registerForeignAsset(alice.addressRaw, location, metadata); const sudoTx = api.tx.sudo.sudo(tx as any); const events = await submitTransactionAsync(alice, sudoTx); const result = getGenericResult(events); From 503028ebb65c189aba06e0991a9a7f5e52790194 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 6 Sep 2022 22:51:10 +0000 Subject: [PATCH 0759/1274] test(xcm): qtz/unq rejects relay tokens --- tests/src/util/helpers.ts | 29 +++++--- tests/src/xcm/xcmQuartz.test.ts | 116 ++++++++++++++++++++++++++++++-- tests/src/xcm/xcmUnique.test.ts | 112 ++++++++++++++++++++++++++++-- 3 files changed, 236 insertions(+), 21 deletions(-) diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index ac697c8738..c30d40f6fa 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -104,14 +104,9 @@ export function bigIntToSub(api: ApiPromise, number: bigint) { } export function bigIntToDecimals(number: bigint, decimals = 18): string { - let numberStr = number.toString(); - console.log('[0] str = ', numberStr); - - // Get rid of `n` at the end - numberStr = numberStr.substring(0, numberStr.length - 1); - console.log('[1] str = ', numberStr); - + const numberStr = number.toString(); const dotPos = numberStr.length - decimals; + if (dotPos <= 0) { return '0.' + numberStr; } else { @@ -1794,19 +1789,31 @@ export async function waitEvent( ): Promise { const promise = new Promise(async (resolve) => { - const unsubscribe = await api.query.system.events(eventRecords => { + const unsubscribe = await api.rpc.chain.subscribeNewHeads(async header => { + const blockNumber = header.number.toHuman(); + const blockHash = header.hash; + const eventIdStr = `${eventSection}.${eventMethod}`; + const waitLimitStr = `wait blocks remaining: ${maxBlocksToWait}`; + + console.log(`[Block #${blockNumber}] Waiting for event \`${eventIdStr}\` (${waitLimitStr})`); + + const apiAt = await api.at(blockHash); + const eventRecords = await apiAt.query.system.events(); + const neededEvent = eventRecords.find(r => { return r.event.section == eventSection && r.event.method == eventMethod; }); if (neededEvent) { + console.log(`Event \`${eventIdStr}\` is found`); + unsubscribe(); resolve(neededEvent); - } - - if (maxBlocksToWait > 0) { + } else if (maxBlocksToWait > 0) { maxBlocksToWait--; } else { + console.log(`Event \`${eventIdStr}\` is NOT found`); + unsubscribe(); resolve(null); } diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index a21a7b826d..5268e3c58d 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -26,6 +26,7 @@ import {MultiLocation} from '@polkadot/types/interfaces'; import {blake2AsHex} from '@polkadot/util-crypto'; import waitNewBlocks from '../substrate/wait-new-blocks'; import getBalance from '../substrate/get-balance'; +import {XcmV2TraitsOutcome, XcmV2TraitsError} from '../interfaces'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -34,6 +35,7 @@ const QUARTZ_CHAIN = 2095; const KARURA_CHAIN = 2000; const MOONRIVER_CHAIN = 2023; +const RELAY_PORT = 9844; const KARURA_PORT = 9946; const MOONRIVER_PORT = 9947; @@ -55,6 +57,10 @@ function moonriverOptions(): ApiOptions { return parachainApiOptions(MOONRIVER_PORT); } +function relayOptions(): ApiOptions { + return parachainApiOptions(RELAY_PORT); +} + describe_xcm('Integration test: Exchanging tokens with Karura', () => { let alice: IKeyringPair; let randomAccount: IKeyringPair; @@ -200,8 +206,8 @@ describe_xcm('Integration test: Exchanging tokens with Karura', () => { const karFees = balanceKaruraTokenInit - balanceKaruraTokenMiddle; const qtzIncomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenInit; - console.log(' - [Quartz -> Karura] transaction fees on Karura: %s KAR', + console.log( + '[Quartz -> Karura] transaction fees on Karura: %s KAR', bigIntToDecimals(karFees, KARURA_DECIMALS), ); console.log('[Quartz -> Karura] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer)); @@ -281,10 +287,100 @@ describe_xcm('Integration test: Exchanging tokens with Karura', () => { expect(qtzFees == 0n).to.be.true; }); }); +}); - it('Quartz rejects KAR tokens from Karura', async () => { - // This test is relevant only when the foreign asset pallet is disabled +// These tests are relevant only when the foreign asset pallet is disabled +describe('Integration test: Quartz rejects non-native tokens', () => { + let alice: IKeyringPair; + + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + alice = privateKeyWrapper('//Alice'); + }); + }); + + it('Quartz rejects tokens from the Relay', async () => { + await usingApi(async (api) => { + const destination = { + V1: { + parents: 0, + interior: {X1: { + Parachain: QUARTZ_CHAIN, + }, + }, + }}; + + const beneficiary = { + V1: { + parents: 0, + interior: {X1: { + AccountId32: { + network: 'Any', + id: alice.addressRaw, + }, + }}, + }, + }; + + const assets = { + V1: [ + { + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: 50_000_000_000_000_000n, + }, + }, + ], + }; + + const feeAssetItem = 0; + + const weightLimit = { + Limited: 5_000_000_000, + }; + + const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); + const events = await submitTransactionAsync(alice, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + }, relayOptions()); + + await usingApi(async api => { + const maxWaitBlocks = 3; + const dmpQueueExecutedDownward = await waitEvent( + api, + maxWaitBlocks, + 'dmpQueue', + 'ExecutedDownward', + ); + expect( + dmpQueueExecutedDownward != null, + '[Relay] dmpQueue.ExecutedDownward event is expected', + ).to.be.true; + + const event = dmpQueueExecutedDownward!.event; + const outcome = event.data[1] as XcmV2TraitsOutcome; + + expect( + outcome.isIncomplete, + '[Relay] The outcome of the XCM should be `Incomplete`', + ).to.be.true; + + const incomplete = outcome.asIncomplete; + expect( + incomplete[1].toString() == 'AssetNotFound', + '[Relay] The XCM error should be `AssetNotFound`', + ).to.be.true; + }); + }); + + it('Quartz rejects KAR tokens from Karura', async () => { await usingApi(async (api) => { const destination = { V1: { @@ -295,7 +391,7 @@ describe_xcm('Integration test: Exchanging tokens with Karura', () => { { AccountId32: { network: 'Any', - id: randomAccount.addressRaw, + id: alice.addressRaw, }, }, ], @@ -321,7 +417,15 @@ describe_xcm('Integration test: Exchanging tokens with Karura', () => { expect( xcmpQueueFailEvent != null, - 'Only native token is supported when the Foreign-Assets pallet is not connected', + '[Karura] xcmpQueue.FailEvent event is expected', + ).to.be.true; + + const event = xcmpQueueFailEvent!.event; + const outcome = event.data[1] as XcmV2TraitsError; + + expect( + outcome.isUntrustedReserveLocation, + '[Karura] The XCM error should be `UntrustedReserveLocation`', ).to.be.true; }); }); diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index 581c0ba464..e5be072b90 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -26,6 +26,7 @@ import {MultiLocation} from '@polkadot/types/interfaces'; import {blake2AsHex} from '@polkadot/util-crypto'; import waitNewBlocks from '../substrate/wait-new-blocks'; import getBalance from '../substrate/get-balance'; +import {XcmV2TraitsError, XcmV2TraitsOutcome} from '../interfaces'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -34,6 +35,7 @@ const UNIQUE_CHAIN = 2037; const ACALA_CHAIN = 2000; const MOONBEAM_CHAIN = 2004; +const RELAY_PORT = 9844; const ACALA_PORT = 9946; const MOONBEAM_PORT = 9947; @@ -55,6 +57,10 @@ function moonbeamOptions(): ApiOptions { return parachainApiOptions(MOONBEAM_PORT); } +function relayOptions(): ApiOptions { + return parachainApiOptions(RELAY_PORT); +} + describe_xcm('Integration test: Exchanging tokens with Acala', () => { let alice: IKeyringPair; let randomAccount: IKeyringPair; @@ -281,10 +287,100 @@ describe_xcm('Integration test: Exchanging tokens with Acala', () => { expect(unqFees == 0n).to.be.true; }); }); +}); - it('Unique rejects ACA tokens from Acala', async () => { - // This test is relevant only when the foreign asset pallet is disabled +// These tests are relevant only when the foreign asset pallet is disabled +describe('Integration test: Unique rejects non-native tokens', () => { + let alice: IKeyringPair; + before(async () => { + await usingApi(async (api, privateKeyWrapper) => { + alice = privateKeyWrapper('//Alice'); + }); + }); + + it('Unique rejects tokens from the Relay', async () => { + await usingApi(async (api) => { + const destination = { + V1: { + parents: 0, + interior: {X1: { + Parachain: UNIQUE_CHAIN, + }, + }, + }}; + + const beneficiary = { + V1: { + parents: 0, + interior: {X1: { + AccountId32: { + network: 'Any', + id: alice.addressRaw, + }, + }}, + }, + }; + + const assets = { + V1: [ + { + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: 50_000_000_000_000_000n, + }, + }, + ], + }; + + const feeAssetItem = 0; + + const weightLimit = { + Limited: 5_000_000_000, + }; + + const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); + const events = await submitTransactionAsync(alice, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + }, relayOptions()); + + await usingApi(async api => { + const maxWaitBlocks = 3; + const dmpQueueExecutedDownward = await waitEvent( + api, + maxWaitBlocks, + 'dmpQueue', + 'ExecutedDownward', + ); + + expect( + dmpQueueExecutedDownward != null, + '[Relay] dmpQueue.ExecutedDownward event is expected', + ).to.be.true; + + const event = dmpQueueExecutedDownward!.event; + const outcome = event.data[1] as XcmV2TraitsOutcome; + + expect( + outcome.isIncomplete, + '[Relay] The outcome of the XCM should be `Incomplete`', + ).to.be.true; + + const incomplete = outcome.asIncomplete; + expect( + incomplete[1].toString() == 'AssetNotFound', + '[Relay] The XCM error should be `AssetNotFound`', + ).to.be.true; + }); + }); + + it('Unique rejects ACA tokens from Acala', async () => { await usingApi(async (api) => { const destination = { V1: { @@ -295,7 +391,7 @@ describe_xcm('Integration test: Exchanging tokens with Acala', () => { { AccountId32: { network: 'Any', - id: randomAccount.addressRaw, + id: alice.addressRaw, }, }, ], @@ -321,7 +417,15 @@ describe_xcm('Integration test: Exchanging tokens with Acala', () => { expect( xcmpQueueFailEvent != null, - 'Only native token is supported when the Foreign-Assets pallet is not connected', + '[Acala] xcmpQueue.FailEvent event is expected', + ).to.be.true; + + const event = xcmpQueueFailEvent!.event; + const outcome = event.data[1] as XcmV2TraitsError; + + expect( + outcome.isUntrustedReserveLocation, + '[Acala] The XCM error should be `UntrustedReserveLocation`', ).to.be.true; }); }); From 0335e511ccbfe3f268bfc3359fc4fbd3feb03a65 Mon Sep 17 00:00:00 2001 From: rkv Date: Tue, 6 Sep 2022 15:14:52 +0300 Subject: [PATCH 0760/1274] tests: adminTransferAndBurn migrated --- tests/package.json | 1 + tests/src/adminTransferAndBurn.test.ts | 51 +++++++++++++++++--------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/tests/package.json b/tests/package.json index 804a2f9813..511eca53db 100644 --- a/tests/package.json +++ b/tests/package.json @@ -48,6 +48,7 @@ "testRemoveCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionAdmin.test.ts", "testRemoveCollectionSponsor": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionSponsor.test.ts", "testRemoveFromAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/removeFromAllowList.test.ts", + "testAllowLists": "mocha --timeout 9999999 -r ts-node/register ./**/allowLists.test.ts", "testConnection": "mocha --timeout 9999999 -r ts-node/register ./**/connection.test.ts", "testContracts": "mocha --timeout 9999999 -r ts-node/register ./**/contracts.test.ts", "testCreateItem": "mocha --timeout 9999999 -r ts-node/register ./**/createItem.test.ts", diff --git a/tests/src/adminTransferAndBurn.test.ts b/tests/src/adminTransferAndBurn.test.ts index 73fdfda8cc..3dee38f6bc 100644 --- a/tests/src/adminTransferAndBurn.test.ts +++ b/tests/src/adminTransferAndBurn.test.ts @@ -27,46 +27,63 @@ import { burnFromExpectSuccess, setCollectionLimitsExpectSuccess, } from './util/helpers'; +import { usingPlaygrounds } from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; +let donor: IKeyringPair; + +before(async () => { + await usingPlaygrounds(async (_, privateKeyWrapper) => { + donor = privateKeyWrapper('//Alice'); + }); +}); + describe('Integration Test: ownerCanTransfer allows admins to use only transferFrom/burnFrom:', () => { let alice: IKeyringPair; let bob: IKeyringPair; let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); }); it('admin transfers other user\'s token', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true}); - - const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', {Substrate: bob.address}); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); + const setLimitsResult = await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); + const limits = await helper.collection.getEffectiveLimits(collectionId); + expect(limits.ownerCanTransfer).to.be.true; - await transferExpectFailure(collectionId, tokenId, alice, charlie); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + await expect(transferResult()).to.be.rejected; - await transferFromExpectSuccess(collectionId, tokenId, alice, bob, charlie, 1); + const res = await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: bob.address}, {Substrate: charlie.address}); + const newTokenOwner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(newTokenOwner.Substrate).to.be.equal(charlie.address); }); }); it('admin burns other user\'s token', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true}); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); + + const setLimitsResult = await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); + const limits = await helper.collection.getEffectiveLimits(collectionId); + expect(limits.ownerCanTransfer).to.be.true; - const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', {Substrate: bob.address}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + const burnTxFailed = async () => helper.nft.burnToken(alice, collectionId, tokenId); - await burnItemExpectFailure(alice, collectionId, tokenId); + await expect(burnTxFailed()).to.be.rejected; - await burnFromExpectSuccess(alice, bob, collectionId, tokenId); + const burnResult = await helper.nft.burnToken(bob, collectionId, tokenId); + const token = await helper.nft.getToken(collectionId, tokenId); + expect(token).to.be.null; }); }); }); From b1123c37498facd6f39810fc152f657ef1ddab6f Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 7 Sep 2022 11:38:58 +0300 Subject: [PATCH 0761/1274] allowLists migrated --- tests/src/allowLists.test.ts | 463 +++++++++++++++++++++-------------- 1 file changed, 274 insertions(+), 189 deletions(-) diff --git a/tests/src/allowLists.test.ts b/tests/src/allowLists.test.ts index 893822581f..639cf1e488 100644 --- a/tests/src/allowLists.test.ts +++ b/tests/src/allowLists.test.ts @@ -17,31 +17,19 @@ import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import usingApi, {submitTransactionExpectFailAsync} from './substrate/substrate-api'; -import { - addToAllowListExpectSuccess, - createCollectionExpectSuccess, - createItemExpectSuccess, - destroyCollectionExpectSuccess, - enableAllowListExpectSuccess, - normalizeAccountId, - addCollectionAdminExpectSuccess, - addToAllowListExpectFail, - removeFromAllowListExpectSuccess, - removeFromAllowListExpectFailure, - addToAllowListAgainExpectSuccess, - transferExpectFailure, - approveExpectSuccess, - approveExpectFail, - transferExpectSuccess, - transferFromExpectSuccess, - setMintPermissionExpectSuccess, - createItemExpectFailure, -} from './util/helpers'; +import { usingPlaygrounds } from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; +let donor: IKeyringPair; + +before(async () => { + await usingPlaygrounds(async (_, privateKeyWrapper) => { + donor = privateKeyWrapper('//Alice'); + }); +}); + let alice: IKeyringPair; let bob: IKeyringPair; let charlie: IKeyringPair; @@ -49,266 +37,363 @@ let charlie: IKeyringPair; describe('Integration Test ext. Allow list tests', () => { before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); }); it('Owner can add address to allow list', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addToAllowListExpectSuccess(alice, collectionId, bob.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + const allowList = await helper.nft.getAllowList(collectionId); + expect(allowList).to.be.deep.contains({Substrate: bob.address}); + }); }); it('Admin can add address to allow list', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await addToAllowListExpectSuccess(bob, collectionId, charlie.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address}); + + await helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}); + const allowList = await helper.nft.getAllowList(collectionId); + expect(allowList).to.be.deep.contains({Substrate: charlie.address}); + }); }); it('Non-privileged user cannot add address to allow list', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addToAllowListExpectFail(bob, collectionId, charlie.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const addToAllowListTx = async () => helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}); + expect(addToAllowListTx()).to.be.rejected; + }); }); it('Nobody can add address to allow list of non-existing collection', async () => { const collectionId = (1<<32) - 1; - await addToAllowListExpectFail(alice, collectionId, bob.address); + await usingPlaygrounds(async (helper) => { + const addToAllowListTx = async () => helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}); + expect(addToAllowListTx()).to.be.rejected; + }); }); it('Nobody can add address to allow list of destroyed collection', async () => { - const collectionId = await createCollectionExpectSuccess(); - await destroyCollectionExpectSuccess(collectionId, '//Alice'); - await addToAllowListExpectFail(alice, collectionId, bob.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.collection.burn(alice, collectionId); + const addToAllowListTx = async () => helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + expect(addToAllowListTx()).to.be.rejected; + }); }); it('If address is already added to allow list, nothing happens', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addToAllowListExpectSuccess(alice, collectionId, bob.address); - await addToAllowListAgainExpectSuccess(alice, collectionId, bob.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + const allowList = await helper.nft.getAllowList(collectionId); + expect(allowList).to.be.deep.contains({Substrate: bob.address}); + }); }); it('Owner can remove address from allow list', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addToAllowListExpectSuccess(alice, collectionId, bob.address); - await removeFromAllowListExpectSuccess(alice, collectionId, normalizeAccountId(bob)); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + + //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. + await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: bob.address}).signAndSend(alice); + + const allowList = await helper.nft.getAllowList(collectionId); + + expect(allowList).to.be.not.deep.contains({Substrate: bob.address}); + }); }); it('Admin can remove address from allow list', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await addToAllowListExpectSuccess(alice, collectionId, charlie.address); - await removeFromAllowListExpectSuccess(bob, collectionId, normalizeAccountId(charlie)); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addAdmin(alice, collectionId, {Substrate: charlie.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. + await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: bob.address}).signAndSend(charlie); + + const allowList = await helper.nft.getAllowList(collectionId); + + expect(allowList).to.be.not.deep.contains({Substrate: bob.address}); + }); }); it('Non-privileged user cannot remove address from allow list', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addToAllowListExpectSuccess(alice, collectionId, charlie.address); - await removeFromAllowListExpectFailure(bob, collectionId, normalizeAccountId(charlie)); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. + await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: charlie.address}).signAndSend(bob); + + const allowList = await helper.nft.getAllowList(collectionId); + + expect(allowList).to.be.deep.contains({Substrate: charlie.address}); + }); }); it('Nobody can remove address from allow list of non-existing collection', async () => { const collectionId = (1<<32) - 1; - await removeFromAllowListExpectFailure(alice, collectionId, normalizeAccountId(charlie)); + await usingPlaygrounds(async (helper) => { + //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. + await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: charlie.address}).signAndSend(bob); + + const allowList = await helper.nft.getAllowList(collectionId); + + expect(allowList).to.be.not.deep.contains({Substrate: charlie.address}); + }); }); it('Nobody can remove address from allow list of deleted collection', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addToAllowListExpectSuccess(alice, collectionId, charlie.address); - await destroyCollectionExpectSuccess(collectionId, '//Alice'); - await removeFromAllowListExpectFailure(alice, collectionId, normalizeAccountId(charlie)); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + await helper.collection.burn(alice, collectionId); + + //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. + const removeTx = async () => helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: bob.address}).signAndSend(alice); + + expect(removeTx()).to.be.rejected; + }); }); it('If address is already removed from allow list, nothing happens', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addToAllowListExpectSuccess(alice, collectionId, charlie.address); - await removeFromAllowListExpectSuccess(alice, collectionId, normalizeAccountId(charlie)); - await removeFromAllowListExpectSuccess(alice, collectionId, normalizeAccountId(charlie)); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + + //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. + await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: bob.address}).signAndSend(alice); + const allowListBefore = await helper.nft.getAllowList(collectionId); + expect(allowListBefore).to.be.not.deep.contains({Substrate: bob.address}); + + await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: bob.address}).signAndSend(alice); + + const allowListAfter = await helper.nft.getAllowList(collectionId); + expect(allowListAfter).to.be.not.deep.contains({Substrate: bob.address}); + }); }); it('If Public Access mode is set to AllowList, tokens can’t be transferred from a non-allowlisted address with transfer or transferFrom. Test1', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address); - await enableAllowListExpectSuccess(alice, collectionId); - await addToAllowListExpectSuccess(alice, collectionId, charlie.address); - - await transferExpectFailure( - collectionId, - itemId, - alice, - charlie, - 1, - ); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + + const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + expect(transferResult()).to.be.rejected; + }); }); it('If Public Access mode is set to AllowList, tokens can’t be transferred from a non-allowlisted address with transfer or transferFrom. Test2', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address); - await enableAllowListExpectSuccess(alice, collectionId); - await addToAllowListExpectSuccess(alice, collectionId, alice.address); - await addToAllowListExpectSuccess(alice, collectionId, charlie.address); - await approveExpectSuccess(collectionId, itemId, alice, charlie.address); - await removeFromAllowListExpectSuccess(alice, collectionId, normalizeAccountId(alice)); - - await transferExpectFailure( - collectionId, - itemId, - alice, - charlie, - 1, - ); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + + //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. + await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: alice.address}).signAndSend(alice); + + const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + expect(transferResult()).to.be.rejected; + }); }); it('If Public Access mode is set to AllowList, tokens can’t be transferred to a non-allowlisted address with transfer or transferFrom. Test1', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address); - await enableAllowListExpectSuccess(alice, collectionId); - await addToAllowListExpectSuccess(alice, collectionId, alice.address); - - await transferExpectFailure( - collectionId, - itemId, - alice, - charlie, - 1, - ); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + + const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + expect(transferResult()).to.be.rejected; + }); }); it('If Public Access mode is set to AllowList, tokens can’t be transferred to a non-allowlisted address with transfer or transferFrom. Test2', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address); - await enableAllowListExpectSuccess(alice, collectionId); - await addToAllowListExpectSuccess(alice, collectionId, alice.address); - await addToAllowListExpectSuccess(alice, collectionId, charlie.address); - await approveExpectSuccess(collectionId, itemId, alice, charlie.address); - await removeFromAllowListExpectSuccess(alice, collectionId, normalizeAccountId(alice)); - - await transferExpectFailure( - collectionId, - itemId, - alice, - charlie, - 1, - ); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + + //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. + await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: alice.address}).signAndSend(alice); + + const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + expect(transferResult()).to.be.rejected; + }); }); it('If Public Access mode is set to AllowList, tokens can’t be destroyed by a non-allowlisted address (even if it owned them before enabling AllowList mode)', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address); - await enableAllowListExpectSuccess(alice, collectionId); - - await usingApi(async (api) => { - const tx = api.tx.unique.burnItem(collectionId, itemId, /*normalizeAccountId(Alice.address),*/ 11); - const badTransaction = async function () { - await submitTransactionExpectFailAsync(alice, tx); - }; - await expect(badTransaction()).to.be.rejected; + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + const burnTx = async () => helper.nft.burnToken(bob, collectionId, tokenId); + expect(burnTx()).to.be.rejected; }); }); it('If Public Access mode is set to AllowList, token transfers can’t be Approved by a non-allowlisted address (see Approve method)', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address); - await enableAllowListExpectSuccess(alice, collectionId); - await approveExpectFail(collectionId, itemId, alice, bob); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + const approveTx = async () => helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + await expect(approveTx()).to.be.rejected; + }); }); it('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transfer.', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address); - await enableAllowListExpectSuccess(alice, collectionId); - await addToAllowListExpectSuccess(alice, collectionId, alice.address); - await addToAllowListExpectSuccess(alice, collectionId, charlie.address); - await transferExpectSuccess(collectionId, itemId, alice, charlie, 1, 'NFT'); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(charlie.address); + }); }); - it('If Public Access mode is set to AllowList, tokens can be transferred to a alowlisted address with transferFrom.', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address); - await enableAllowListExpectSuccess(alice, collectionId); - await addToAllowListExpectSuccess(alice, collectionId, alice.address); - await addToAllowListExpectSuccess(alice, collectionId, charlie.address); - await approveExpectSuccess(collectionId, itemId, alice, charlie.address); - await transferFromExpectSuccess(collectionId, itemId, alice, alice, charlie, 1, 'NFT'); + it('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transferFrom.', async () => { + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + + await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(charlie.address); + }); }); it('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transfer', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address); - await enableAllowListExpectSuccess(alice, collectionId); - await addToAllowListExpectSuccess(alice, collectionId, alice.address); - await addToAllowListExpectSuccess(alice, collectionId, charlie.address); - await transferExpectSuccess(collectionId, itemId, alice, charlie, 1, 'NFT'); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + + await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(charlie.address); + }); }); it('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transferFrom', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address); - await enableAllowListExpectSuccess(alice, collectionId); - await addToAllowListExpectSuccess(alice, collectionId, alice.address); - await addToAllowListExpectSuccess(alice, collectionId, charlie.address); - await approveExpectSuccess(collectionId, itemId, alice, charlie.address); - await transferFromExpectSuccess(collectionId, itemId, alice, alice, charlie, 1, 'NFT'); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + + await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(charlie.address); + }); }); it('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens can be created by owner', async () => { - const collectionId = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, false); - await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + const token = await helper.nft.getToken(collectionId, tokenId); + expect(token).to.be.not.null; + }); }); it('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens can be created by admin', async () => { - const collectionId = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, false); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await createItemExpectSuccess(bob, collectionId, 'NFT', bob.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); + await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); + const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); + const token = await helper.nft.getToken(collectionId, tokenId); + expect(token).to.be.not.null; + }); }); it('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens cannot be created by non-privileged and allow-listed address', async () => { - const collectionId = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, false); - await addToAllowListExpectSuccess(alice, collectionId, bob.address); - await createItemExpectFailure(bob, collectionId, 'NFT', bob.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); + await helper.collection.addToAllowList(alice, collectionId, {Substrate: bob.address}); + const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); + await expect(mintTokenTx()).to.be.rejected; + }); }); it('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens cannot be created by non-privileged and non-allow listed address', async () => { - const collectionId = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, false); - await createItemExpectFailure(bob, collectionId, 'NFT', bob.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); + const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); + await expect(mintTokenTx()).to.be.rejected; + }); }); it('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by owner', async () => { - const collectionId = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, true); - await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(alice.address); + }); }); it('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by admin', async () => { - const collectionId = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, true); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await createItemExpectSuccess(bob, collectionId, 'NFT', bob.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); + await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address}); + const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(bob.address); + }); }); it('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens cannot be created by non-privileged and non-allow listed address', async () => { - const collectionId = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, true); - await createItemExpectFailure(bob, collectionId, 'NFT', bob.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); + const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); + await expect(mintTokenTx()).to.be.rejected; + }); }); it('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by non-privileged and allow listed address', async () => { - const collectionId = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, true); - await addToAllowListExpectSuccess(alice, collectionId, bob.address); - await createItemExpectSuccess(bob, collectionId, 'NFT', bob.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(bob.address); + }); }); }); From d83ab4fde4e870139a34545b193320bd4c13739e Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 7 Sep 2022 16:09:22 +0700 Subject: [PATCH 0762/1274] fix appPromotion RPC diasbling, refactor benchmarks, fix `WithdrawReasons`, rename `get_sponsor` to `sponsor` in hadlers traits + change their behavior in impl's blocks --- node/rpc/src/lib.rs | 2 +- pallets/app-promotion/src/benchmarking.rs | 39 ++++++--------- pallets/app-promotion/src/lib.rs | 18 ++----- pallets/app-promotion/src/types.rs | 13 +++-- pallets/app-promotion/src/weights.rs | 58 +++++++++++------------ tests/src/app-promotion.test.ts | 16 +++---- tests/src/interfaces/augment-api-tx.ts | 2 +- tests/src/interfaces/default/types.ts | 6 +-- tests/src/interfaces/lookup.ts | 2 +- tests/src/interfaces/types-lookup.ts | 6 +-- tests/src/pallet-presence.test.ts | 2 +- 11 files changed, 72 insertions(+), 92 deletions(-) diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index 76ed30dd51..f43e3e1d36 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -234,7 +234,7 @@ where io.merge(Unique::new(client.clone()).into_rpc())?; - #[cfg(any(feature = "opal-runtime"))] + #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] io.merge(AppPromotion::new(client.clone()).into_rpc())?; #[cfg(not(feature = "unique-runtime"))] diff --git a/pallets/app-promotion/src/benchmarking.rs b/pallets/app-promotion/src/benchmarking.rs index eeffe47bea..ae2e235bd6 100644 --- a/pallets/app-promotion/src/benchmarking.rs +++ b/pallets/app-promotion/src/benchmarking.rs @@ -30,7 +30,7 @@ use pallet_evm_migration::Pallet as EvmMigrationPallet; const SEED: u32 = 0; -fn set_admin() -> DispatchResult +fn set_admin() -> Result where T: Config + pallet_unique::Config + pallet_evm_migration::Config, T::BlockNumber: From + Into, @@ -46,7 +46,9 @@ where PromototionPallet::::set_admin_address( RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()), - ) + )?; + + Ok(pallet_admin) } benchmarks! { @@ -73,12 +75,12 @@ benchmarks! { set_admin_address { let pallet_admin = account::("admin", 0, SEED); let _ = ::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); - } : {PromototionPallet::::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin))?} + } : _(RawOrigin::Root, T::CrossAccountId::from_sub(pallet_admin)) payout_stakers{ let b in 1..101; - let pallet_admin = account::("admin", 0, SEED); + let pallet_admin = account::("admin", 1, SEED); let share = Perbill::from_rational(1u32, 20); PromototionPallet::::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?; ::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); @@ -92,22 +94,18 @@ benchmarks! { (0..10).try_for_each(|_| { stakers.iter() .map(|staker| { - PromototionPallet::::stake(RawOrigin::Signed(staker.clone()).into(), Into::>::into(100u128) * T::Nominal::get()) }).collect::, _>>()?; >::finalize(); Result::<(), sp_runtime::DispatchError>::Ok(()) })?; - - // let _ = ::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); - // let _ = PromototionPallet::::stake(RawOrigin::Signed(staker.clone()).into(), share * ::Currency::total_balance(&staker))?; - } : {PromototionPallet::::payout_stakers(RawOrigin::Signed(pallet_admin.clone()).into(), Some(b as u8))?} + } : _(RawOrigin::Signed(pallet_admin.clone()), Some(b as u8)) stake { let caller = account::("caller", 0, SEED); let share = Perbill::from_rational(1u32, 10); let _ = ::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); - } : {PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller))?} + } : _(RawOrigin::Signed(caller.clone()), share * ::Currency::total_balance(&caller)) unstake { let caller = account::("caller", 0, SEED); @@ -118,16 +116,7 @@ benchmarks! { PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller)) }).collect::, _>>()?; - } : {PromototionPallet::::unstake(RawOrigin::Signed(caller.clone()).into())?} - - // recalculate_and_insert_stake{ - // let caller = account::("caller", 0, SEED); - // let share = Perbill::from_rational(1u32, 10); - // let _ = ::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); - // let _ = PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller))?; - // let block = ::current_block_number(); - // let mut acc = >::default(); - // } : {PromototionPallet::::recalculate_and_insert_stake(&caller, block, share * ::Currency::total_balance(&caller), &mut acc)} + } : _(RawOrigin::Signed(caller.clone())) sponsor_collection { let pallet_admin = account::("admin", 0, SEED); @@ -136,7 +125,7 @@ benchmarks! { let caller: T::AccountId = account("caller", 0, SEED); let _ = ::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); let collection = create_nft_collection::(caller.clone())?; - } : {PromototionPallet::::sponsor_collection(RawOrigin::Signed(pallet_admin.clone()).into(), collection)?} + } : _(RawOrigin::Signed(pallet_admin.clone()), collection) stop_sponsoring_collection { let pallet_admin = account::("admin", 0, SEED); @@ -146,7 +135,7 @@ benchmarks! { let _ = ::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); let collection = create_nft_collection::(caller.clone())?; PromototionPallet::::sponsor_collection(RawOrigin::Signed(pallet_admin.clone()).into(), collection)?; - } : {PromototionPallet::::stop_sponsoring_collection(RawOrigin::Signed(pallet_admin.clone()).into(), collection)?} + } : _(RawOrigin::Signed(pallet_admin.clone()), collection) sponsor_contract { let pallet_admin = account::("admin", 0, SEED); @@ -157,7 +146,7 @@ benchmarks! { let data: Vec = (0..20 as u8).collect(); >::begin(RawOrigin::Root.into(), address)?; >::finish(RawOrigin::Root.into(), address, data)?; - } : {PromototionPallet::::sponsor_conract(RawOrigin::Signed(pallet_admin.clone()).into(), address)?} + } : _(RawOrigin::Signed(pallet_admin.clone()), address) stop_sponsoring_contract { let pallet_admin = account::("admin", 0, SEED); @@ -168,6 +157,6 @@ benchmarks! { let data: Vec = (0..20 as u8).collect(); >::begin(RawOrigin::Root.into(), address)?; >::finish(RawOrigin::Root.into(), address, data)?; - PromototionPallet::::sponsor_conract(RawOrigin::Signed(pallet_admin.clone()).into(), address)?; - } : {PromototionPallet::::stop_sponsoring_contract(RawOrigin::Signed(pallet_admin.clone()).into(), address)?} + PromototionPallet::::sponsor_contract(RawOrigin::Signed(pallet_admin.clone()).into(), address)?; + } : _(RawOrigin::Signed(pallet_admin.clone()), address) } diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index c78f4988dc..ec5f364032 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -226,12 +226,6 @@ pub mod pallet { where ::BlockNumber: From, { - // let mut consumed_weight = 0; - // let mut add_weight = |reads, writes, weight| { - // consumed_weight += T::DbWeight::get().reads_writes(reads, writes); - // consumed_weight += weight; - // }; - let block_pending = PendingUnstake::::take(current_block_number); let counter = block_pending.len() as u32; // add_weight(0, 1, 0); @@ -243,7 +237,6 @@ pub mod pallet { } T::WeightInfo::on_initialize(counter) - // consumed_weight } } @@ -286,7 +279,7 @@ pub mod pallet { <::Currency as Currency>::ensure_can_withdraw( &staker_id, amount, - WithdrawReasons::RESERVE, + WithdrawReasons::all(), balance - amount, )?; @@ -398,8 +391,7 @@ pub mod pallet { ); ensure!( - T::CollectionHandler::get_sponsor(collection_id)? - .ok_or(>::InvalidArgument)? + T::CollectionHandler::sponsor(collection_id)?.ok_or(>::InvalidArgument)? == Self::account_id(), >::NoPermission ); @@ -407,7 +399,7 @@ pub mod pallet { } #[pallet::weight(T::WeightInfo::sponsor_contract())] - pub fn sponsor_conract(admin: OriginFor, contract_id: H160) -> DispatchResult { + pub fn sponsor_contract(admin: OriginFor, contract_id: H160) -> DispatchResult { let admin_id = ensure_signed(admin)?; ensure!( @@ -431,7 +423,7 @@ pub mod pallet { ); ensure!( - T::ContractHandler::get_sponsor(contract_id)?.ok_or(>::InvalidArgument)? + T::ContractHandler::sponsor(contract_id)?.ok_or(>::InvalidArgument)? == T::CrossAccountId::from_sub(Self::account_id()), >::NoPermission ); @@ -673,7 +665,7 @@ impl Pallet { LOCK_IDENTIFIER, staker, amount, - WithdrawReasons::RESERVE, + WithdrawReasons::all(), ) } } diff --git a/pallets/app-promotion/src/types.rs b/pallets/app-promotion/src/types.rs index 347a43fca9..5da8ab8eb0 100644 --- a/pallets/app-promotion/src/types.rs +++ b/pallets/app-promotion/src/types.rs @@ -37,9 +37,8 @@ pub trait CollectionHandler { fn remove_collection_sponsor(collection_id: Self::CollectionId) -> DispatchResult; - fn get_sponsor( - collection_id: Self::CollectionId, - ) -> Result, DispatchError>; + fn sponsor(collection_id: Self::CollectionId) + -> Result, DispatchError>; } impl CollectionHandler for pallet_unique::Pallet { @@ -58,12 +57,12 @@ impl CollectionHandler for pallet_unique::Pallet { Self::force_remove_collection_sponsor(collection_id) } - fn get_sponsor( + fn sponsor( collection_id: Self::CollectionId, ) -> Result, DispatchError> { Ok(>::try_get(collection_id)? .sponsorship - .pending_sponsor() + .sponsor() .map(|acc| acc.to_owned())) } } @@ -79,7 +78,7 @@ pub trait ContractHandler { fn remove_contract_sponsor(contract_address: Self::ContractId) -> DispatchResult; - fn get_sponsor( + fn sponsor( contract_address: Self::ContractId, ) -> Result, DispatchError>; } @@ -100,7 +99,7 @@ impl ContractHandler for EvmHelpersPallet { Self::force_remove_sponsor(contract_address) } - fn get_sponsor( + fn sponsor( contract_address: Self::ContractId, ) -> Result, DispatchError> { Ok(Self::get_sponsor(contract_address)) diff --git a/pallets/app-promotion/src/weights.rs b/pallets/app-promotion/src/weights.rs index 641e2643c8..276aac5a46 100644 --- a/pallets/app-promotion/src/weights.rs +++ b/pallets/app-promotion/src/weights.rs @@ -3,7 +3,7 @@ //! Autogenerated weights for pallet_app_promotion //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-06, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-09-07, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: @@ -51,16 +51,16 @@ impl WeightInfo for SubstrateWeight { // Storage: AppPromotion PendingUnstake (r:1 w:0) // Storage: System Account (r:1 w:1) fn on_initialize(b: u32, ) -> Weight { - (2_461_000 as Weight) - // Standard Error: 87_000 - .saturating_add((6_006_000 as Weight).saturating_mul(b as Weight)) + (2_651_000 as Weight) + // Standard Error: 103_000 + .saturating_add((6_024_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) } // Storage: AppPromotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - (5_467_000 as Weight) + (7_117_000 as Weight) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) @@ -68,21 +68,21 @@ impl WeightInfo for SubstrateWeight { // Storage: AppPromotion NextCalculatedRecord (r:1 w:1) // Storage: AppPromotion Staked (r:2 w:0) fn payout_stakers(b: u32, ) -> Weight { - (4_946_000 as Weight) - // Standard Error: 5_000 - .saturating_add((4_599_000 as Weight).saturating_mul(b as Weight)) + (9_958_000 as Weight) + // Standard Error: 8_000 + .saturating_add((4_406_000 as Weight).saturating_mul(b as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } - // Storage: System Account (r:1 w:1) // Storage: AppPromotion StakesPerAccount (r:1 w:1) + // Storage: System Account (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: ParachainSystem ValidationData (r:1 w:0) // Storage: AppPromotion Staked (r:1 w:1) // Storage: AppPromotion TotalStaked (r:1 w:1) fn stake() -> Weight { - (17_766_000 as Weight) + (20_574_000 as Weight) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -93,35 +93,35 @@ impl WeightInfo for SubstrateWeight { // Storage: AppPromotion TotalStaked (r:1 w:1) // Storage: AppPromotion StakesPerAccount (r:0 w:1) fn unstake() -> Weight { - (27_250_000 as Weight) + (31_703_000 as Weight) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(6 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn sponsor_collection() -> Weight { - (11_014_000 as Weight) + (12_932_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn stop_sponsoring_collection() -> Weight { - (10_494_000 as Weight) + (12_453_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:0 w:1) fn sponsor_contract() -> Weight { - (9_754_000 as Weight) + (11_952_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:1 w:1) fn stop_sponsoring_contract() -> Weight { - (10_063_000 as Weight) + (12_538_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -132,16 +132,16 @@ impl WeightInfo for () { // Storage: AppPromotion PendingUnstake (r:1 w:0) // Storage: System Account (r:1 w:1) fn on_initialize(b: u32, ) -> Weight { - (2_461_000 as Weight) - // Standard Error: 87_000 - .saturating_add((6_006_000 as Weight).saturating_mul(b as Weight)) + (2_651_000 as Weight) + // Standard Error: 103_000 + .saturating_add((6_024_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) } // Storage: AppPromotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - (5_467_000 as Weight) + (7_117_000 as Weight) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) @@ -149,21 +149,21 @@ impl WeightInfo for () { // Storage: AppPromotion NextCalculatedRecord (r:1 w:1) // Storage: AppPromotion Staked (r:2 w:0) fn payout_stakers(b: u32, ) -> Weight { - (4_946_000 as Weight) - // Standard Error: 5_000 - .saturating_add((4_599_000 as Weight).saturating_mul(b as Weight)) + (9_958_000 as Weight) + // Standard Error: 8_000 + .saturating_add((4_406_000 as Weight).saturating_mul(b as Weight)) .saturating_add(RocksDbWeight::get().reads(4 as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } - // Storage: System Account (r:1 w:1) // Storage: AppPromotion StakesPerAccount (r:1 w:1) + // Storage: System Account (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: ParachainSystem ValidationData (r:1 w:0) // Storage: AppPromotion Staked (r:1 w:1) // Storage: AppPromotion TotalStaked (r:1 w:1) fn stake() -> Weight { - (17_766_000 as Weight) + (20_574_000 as Weight) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(5 as Weight)) } @@ -174,35 +174,35 @@ impl WeightInfo for () { // Storage: AppPromotion TotalStaked (r:1 w:1) // Storage: AppPromotion StakesPerAccount (r:0 w:1) fn unstake() -> Weight { - (27_250_000 as Weight) + (31_703_000 as Weight) .saturating_add(RocksDbWeight::get().reads(6 as Weight)) .saturating_add(RocksDbWeight::get().writes(6 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn sponsor_collection() -> Weight { - (11_014_000 as Weight) + (12_932_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn stop_sponsoring_collection() -> Weight { - (10_494_000 as Weight) + (12_453_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:0 w:1) fn sponsor_contract() -> Weight { - (9_754_000 as Weight) + (11_952_000 as Weight) .saturating_add(RocksDbWeight::get().reads(1 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:1 w:1) fn stop_sponsoring_contract() -> Weight { - (10_063_000 as Weight) + (12_538_000 as Weight) .saturating_add(RocksDbWeight::get().reads(2 as Weight)) .saturating_add(RocksDbWeight::get().writes(1 as Weight)) } diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 53fe7ec9d1..291e41d8d6 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -460,7 +460,7 @@ describe('app-promotion contract sponsoring', () => { const flipper = await deployFlipper(web3, contractOwner); const contractMethods = contractHelpers(web3, contractOwner); - await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address)); + await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address)); expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true; expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); @@ -488,7 +488,7 @@ describe('app-promotion contract sponsoring', () => { }); // set promotion sponsoring - await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address)); + await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address)); // new sponsor is pallet address expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true; @@ -508,7 +508,7 @@ describe('app-promotion contract sponsoring', () => { const contractMethods = contractHelpers(web3, contractOwner); // contract sponsored by pallet - await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address)); + await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address)); // owner sets self sponsoring await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; @@ -532,8 +532,8 @@ describe('app-promotion contract sponsoring', () => { await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; - // nonAdmin calls sponsorConract - await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address))).to.be.rejected; + // nonAdmin calls sponsorContract + await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address))).to.be.rejected; // contract still self-sponsored expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ @@ -560,7 +560,7 @@ describe('app-promotion contract sponsoring', () => { await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); await transferBalanceToEth(api, alice, flipper.options.address, 1000n); - await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address)); + await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address)); await flipper.methods.flip().send({from: caller}); expect(await flipper.methods.getValue().call()).to.be.true; @@ -582,7 +582,7 @@ describe('app-promotion stopSponsoringContract', () => { await transferBalanceToEth(api, alice, flipper.options.address); const contractHelper = contractHelpers(web3, contractOwner); await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); - await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address)); + await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address)); await helper.signTransaction(palletAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address)); expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.false; @@ -609,7 +609,7 @@ describe('app-promotion stopSponsoringContract', () => { const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); const flipper = await deployFlipper(web3, contractOwner); - await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address)); + await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address)); await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address))).to.be.rejected; }); }); diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index ba086dc0a5..9dfd1d8eb2 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -21,7 +21,7 @@ declare module '@polkadot/api-base/types/submittable' { payoutStakers: AugmentedSubmittable<(stakersNumber: Option | null | Uint8Array | u8 | AnyNumber) => SubmittableExtrinsic, [Option]>; setAdminAddress: AugmentedSubmittable<(admin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic, [PalletEvmAccountBasicCrossAccountIdRepr]>; sponsorCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; - sponsorConract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; + sponsorContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; stake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; stopSponsoringCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; stopSponsoringContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 7656b4e7c8..eaa79dc296 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -825,8 +825,8 @@ export interface PalletAppPromotionCall extends Enum { readonly asStopSponsoringCollection: { readonly collectionId: u32; } & Struct; - readonly isSponsorConract: boolean; - readonly asSponsorConract: { + readonly isSponsorContract: boolean; + readonly asSponsorContract: { readonly contractId: H160; } & Struct; readonly isStopSponsoringContract: boolean; @@ -837,7 +837,7 @@ export interface PalletAppPromotionCall extends Enum { readonly asPayoutStakers: { readonly stakersNumber: Option; } & Struct; - readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorConract' | 'StopSponsoringContract' | 'PayoutStakers'; + readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers'; } /** @name PalletAppPromotionError */ diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index e8822a658a..fe4c2401f5 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -2483,7 +2483,7 @@ export default { stop_sponsoring_collection: { collectionId: 'u32', }, - sponsor_conract: { + sponsor_contract: { contractId: 'H160', }, stop_sponsoring_contract: { diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 0217b271f8..6f86e7f156 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -2695,8 +2695,8 @@ declare module '@polkadot/types/lookup' { readonly asStopSponsoringCollection: { readonly collectionId: u32; } & Struct; - readonly isSponsorConract: boolean; - readonly asSponsorConract: { + readonly isSponsorContract: boolean; + readonly asSponsorContract: { readonly contractId: H160; } & Struct; readonly isStopSponsoringContract: boolean; @@ -2707,7 +2707,7 @@ declare module '@polkadot/types/lookup' { readonly asPayoutStakers: { readonly stakersNumber: Option; } & Struct; - readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorConract' | 'StopSponsoringContract' | 'PayoutStakers'; + readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers'; } /** @name PalletEvmCall (307) */ diff --git a/tests/src/pallet-presence.test.ts b/tests/src/pallet-presence.test.ts index 457dcf9f47..41366291c9 100644 --- a/tests/src/pallet-presence.test.ts +++ b/tests/src/pallet-presence.test.ts @@ -68,7 +68,7 @@ describe('Pallet presence', () => { const refungible = 'refungible'; const scheduler = 'scheduler'; const rmrkPallets = ['rmrkcore', 'rmrkequip']; - const appPromotion = 'promotion'; + const appPromotion = 'apppromotion'; if (chain.eq('OPAL by UNIQUE')) { requiredPallets.push(refungible, scheduler, appPromotion, ...rmrkPallets); From d79c091d7b6d99b5755ed97418909e3296103b9f Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 7 Sep 2022 16:47:13 +0700 Subject: [PATCH 0763/1274] fix stake logic --- pallets/app-promotion/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index ec5f364032..0220a8e7dd 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -280,7 +280,9 @@ pub mod pallet { &staker_id, amount, WithdrawReasons::all(), - balance - amount, + balance + .checked_sub(&amount) + .ok_or(ArithmeticError::Underflow)?, )?; Self::add_lock_balance(&staker_id, amount)?; From 66bfedeb84cc13eefeb6e8c07136d5105097dc6f Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 7 Sep 2022 13:12:23 +0300 Subject: [PATCH 0764/1274] add more tokens to accounts --- tests/src/allowLists.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/allowLists.test.ts b/tests/src/allowLists.test.ts index 639cf1e488..bd6d68c398 100644 --- a/tests/src/allowLists.test.ts +++ b/tests/src/allowLists.test.ts @@ -38,7 +38,7 @@ describe('Integration Test ext. Allow list tests', () => { before(async () => { await usingPlaygrounds(async (helper) => { - [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); From 075102296b91c6b7ab3801b66affc43787a8bafa Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 7 Sep 2022 10:32:43 +0000 Subject: [PATCH 0765/1274] fix: run Opal XCM tests only when needed --- tests/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/package.json b/tests/package.json index 6d778d5fc9..313c567b3f 100644 --- a/tests/package.json +++ b/tests/package.json @@ -76,7 +76,7 @@ "testSchedulingEVM": "mocha --timeout 9999999 -r ts-node/register ./**/eth/scheduling.test.ts", "testXcmUnique": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmUnique.test.ts", "testXcmQuartz": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmQuartz.test.ts", - "testXcmOpal": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmOpal.test.ts", + "testXcmOpal": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmOpal.test.ts", "testXcmTransferAcala": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferAcala.test.ts acalaId=2000 uniqueId=5000", "testXcmTransferStatemine": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferStatemine.test.ts statemineId=1000 uniqueId=5000", "testXcmTransferMoonbeam": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferMoonbeam.test.ts", From 943ea22b919849a89fd079ee6b33d1fe5d8caf4d Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 7 Sep 2022 10:33:02 +0000 Subject: [PATCH 0766/1274] fix: pallets presence test --- tests/src/pallet-presence.test.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/src/pallet-presence.test.ts b/tests/src/pallet-presence.test.ts index 7421c0d0ad..48a5b66fce 100644 --- a/tests/src/pallet-presence.test.ts +++ b/tests/src/pallet-presence.test.ts @@ -51,6 +51,8 @@ const requiredPallets = [ 'nonfungible', 'charging', 'configuration', + 'tokens', + 'xtokens', ]; // Pallets that depend on consensus and governance configuration @@ -67,10 +69,16 @@ describe('Pallet presence', () => { const refungible = 'refungible'; const scheduler = 'scheduler'; + const foreignAssets = 'foreignassets'; const rmrkPallets = ['rmrkcore', 'rmrkequip']; if (chain.eq('OPAL by UNIQUE')) { - requiredPallets.push(refungible, scheduler, ...rmrkPallets); + requiredPallets.push( + refungible, + scheduler, + foreignAssets, + ...rmrkPallets, + ); } else if (chain.eq('QUARTZ by UNIQUE')) { // Insert Quartz additional pallets here } else if (chain.eq('UNIQUE')) { From 4e863a28e4ae8c27d37e6f2054b701b27170e1a1 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 7 Sep 2022 10:33:33 +0000 Subject: [PATCH 0767/1274] fix: don't fail on tx retraction --- tests/src/substrate/substrate-api.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/src/substrate/substrate-api.ts b/tests/src/substrate/substrate-api.ts index 063a548f8b..58fca01622 100644 --- a/tests/src/substrate/substrate-api.ts +++ b/tests/src/substrate/substrate-api.ts @@ -126,6 +126,9 @@ function getTransactionStatus(events: EventRecord[], status: ExtrinsicStatus): T if (status.isBroadcast) { return TransactionStatus.NotReady; } + if (status.isRetracted) { + return TransactionStatus.NotReady; + } if (status.isInBlock || status.isFinalized) { if(events.filter(e => e.event.data.method === 'ExtrinsicFailed').length > 0) { return TransactionStatus.Fail; From 622f2e6d27f91af1c6a295e510626aba7cae200b Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 7 Sep 2022 10:34:19 +0000 Subject: [PATCH 0768/1274] fix: remove outdated xcm tests --- tests/src/xcm/xcmTransfer.test.ts | 186 ---------- tests/src/xcm/xcmTransferAcala.test.ts | 265 -------------- tests/src/xcm/xcmTransferMoonbeam.test.ts | 382 --------------------- tests/src/xcm/xcmTransferStatemine.test.ts | 360 ------------------- 4 files changed, 1193 deletions(-) delete mode 100644 tests/src/xcm/xcmTransfer.test.ts delete mode 100644 tests/src/xcm/xcmTransferAcala.test.ts delete mode 100644 tests/src/xcm/xcmTransferMoonbeam.test.ts delete mode 100644 tests/src/xcm/xcmTransferStatemine.test.ts diff --git a/tests/src/xcm/xcmTransfer.test.ts b/tests/src/xcm/xcmTransfer.test.ts deleted file mode 100644 index 904ebb64ab..0000000000 --- a/tests/src/xcm/xcmTransfer.test.ts +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; - -import {WsProvider} from '@polkadot/api'; -import {ApiOptions} from '@polkadot/api/types'; -import {IKeyringPair} from '@polkadot/types/types'; -import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; -import {getGenericResult} from './util/helpers'; -import waitNewBlocks from './substrate/wait-new-blocks'; -import getBalance from './substrate/get-balance'; - -chai.use(chaiAsPromised); -const expect = chai.expect; - -const UNIQUE_CHAIN = 1000; -const KARURA_CHAIN = 2000; -const KARURA_PORT = '9946'; -const TRANSFER_AMOUNT = 2000000000000000000000000n; - -describe.skip('Integration test: Exchanging QTZ with Karura', () => { - let alice: IKeyringPair; - - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - }); - - const karuraApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT), - }; - - await usingApi(async (api) => { - const destination = { - V0: { - X2: [ - 'Parent', - { - Parachain: UNIQUE_CHAIN, - }, - ], - }, - }; - - const metadata = - { - name: 'QTZ', - symbol: 'QTZ', - decimals: 18, - minimalBalance: 1, - }; - - const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata); - const sudoTx = api.tx.sudo.sudo(tx as any); - const events = await submitTransactionAsync(alice, sudoTx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - }, karuraApiOptions); - }); - - it('Should connect and send QTZ to Karura', async () => { - let balanceOnKaruraBefore: bigint; - - await usingApi(async (api) => { - const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceOnKaruraBefore = free; - }, {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)}); - - await usingApi(async (api) => { - const destination = { - V0: { - X2: [ - 'Parent', - { - Parachain: KARURA_CHAIN, - }, - ], - }, - }; - - const beneficiary = { - V0: { - X1: { - AccountId32: { - network: 'Any', - id: alice.addressRaw, - }, - }, - }, - }; - - const assets = { - V1: [ - { - id: { - Concrete: { - parents: 0, - interior: 'Here', - }, - }, - fun: { - Fungible: TRANSFER_AMOUNT, - }, - }, - ], - }; - - const feeAssetItem = 0; - - const weightLimit = { - Limited: 5000000000, - }; - - const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); - const events = await submitTransactionAsync(alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - }); - - await usingApi(async (api) => { - // todo do something about instant sealing, where there might not be any new blocks - await waitNewBlocks(api, 3); - const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any; - expect(free > balanceOnKaruraBefore).to.be.true; - }, {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)}); - }); - - it('Should connect to Karura and send QTZ back', async () => { - let balanceBefore: bigint; - - await usingApi(async (api) => { - [balanceBefore] = await getBalance(api, [alice.address]); - }); - - await usingApi(async (api) => { - const destination = { - V1: { - parents: 1, - interior: { - X2: [ - {Parachain: UNIQUE_CHAIN}, - {AccountId32: { - network: 'Any', - id: alice.addressRaw, - }}, - ], - }, - }, - }; - - const id = { - ForeignAsset: 0, - }; - - const amount = TRANSFER_AMOUNT; - const destWeight = 50000000; - - const tx = api.tx.xTokens.transfer(id, amount, destination, destWeight); - const events = await submitTransactionAsync(alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - }, {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)}); - - await usingApi(async (api) => { - // todo do something about instant sealing, where there might not be any new blocks - await waitNewBlocks(api, 3); - const [balanceAfter] = await getBalance(api, [alice.address]); - expect(balanceAfter > balanceBefore).to.be.true; - }); - }); -}); diff --git a/tests/src/xcm/xcmTransferAcala.test.ts b/tests/src/xcm/xcmTransferAcala.test.ts deleted file mode 100644 index dad199c06c..0000000000 --- a/tests/src/xcm/xcmTransferAcala.test.ts +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; - -import {WsProvider} from '@polkadot/api'; -import {ApiOptions} from '@polkadot/api/types'; -import {IKeyringPair} from '@polkadot/types/types'; -import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; -import {getGenericResult, generateKeyringPair} from './util/helpers'; -import waitNewBlocks from './substrate/wait-new-blocks'; -import getBalance from './substrate/get-balance'; - -chai.use(chaiAsPromised); -const expect = chai.expect; - -let UNIQUE_CHAIN = 0; -let ACALA_CHAIN = 0; - -// parse parachain id numbers -process.argv.forEach((val) => { - - const ai = val.indexOf('acalaId='); - const ui = val.indexOf('uniqueId='); - if (ai != -1) - { - ACALA_CHAIN = Number(val.substring('acalaId='.length)); - } - if (ui != -1) - { - UNIQUE_CHAIN = Number(val.substring('uniqueId='.length)); - } -}); - -const ACALA_PORT = '9946'; -const TRANSFER_AMOUNT = 2000000000000000000000000n; - -describe('Integration test: Exchanging UNQ with Acala', () => { - let alice: IKeyringPair; - let randomAccount: IKeyringPair; - - let balanceUniqueTokenBefore: bigint; - let balanceUniqueTokenAfter: bigint; - let balanceUniqueTokenFinal: bigint; - let balanceAcalaTokenBefore: bigint; - let balanceAcalaTokenAfter: bigint; - let balanceAcalaTokenFinal: bigint; - let balanceUniqueForeignTokenAfter: bigint; - let balanceUniqueForeignTokenBefore: bigint; - let balanceUniqueForeignTokenFinal: bigint; - - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - randomAccount = generateKeyringPair(); - }); - - const acalaApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT), - }; - - await usingApi( - async (api) => { - const destination = { - V0: { - X2: [ - 'Parent', - { - Parachain: UNIQUE_CHAIN, - }, - ], - }, - }; - - const metadata = { - name: 'UNQ', - symbol: 'UNQ', - decimals: 18, - minimalBalance: 1, - }; - - const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata); - const sudoTx = api.tx.sudo.sudo(tx as any); - const events = await submitTransactionAsync(alice, sudoTx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); - const events1 = await submitTransactionAsync(alice, tx1); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; - - [balanceAcalaTokenBefore] = await getBalance(api, [randomAccount.address]); - { - const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceUniqueForeignTokenBefore = BigInt(free); - } - }, - acalaApiOptions, - ); - - await usingApi(async (api) => { - const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); - const events0 = await submitTransactionAsync(alice, tx0); - const result0 = getGenericResult(events0); - expect(result0.success).to.be.true; - - [balanceUniqueTokenBefore] = await getBalance(api, [randomAccount.address]); - }); - }); - - it('Should connect and send UNQ to Acala', async () => { - - await usingApi(async (api) => { - - const destination = { - V0: { - X2: [ - 'Parent', - { - Parachain: ACALA_CHAIN, - }, - ], - }, - }; - - const beneficiary = { - V0: { - X1: { - AccountId32: { - network: 'Any', - id: randomAccount.addressRaw, - }, - }, - }, - }; - - const assets = { - V1: [ - { - id: { - Concrete: { - parents: 0, - interior: 'Here', - }, - }, - fun: { - Fungible: TRANSFER_AMOUNT, - }, - }, - ], - }; - - const feeAssetItem = 0; - - const weightLimit = { - Limited: 5000000000, - }; - - const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); - const events = await submitTransactionAsync(randomAccount, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - [balanceUniqueTokenAfter] = await getBalance(api, [randomAccount.address]); - - expect((balanceUniqueTokenBefore - balanceUniqueTokenAfter) > 0n).to.be.true; - }); - - await usingApi( - async (api) => { - // todo do something about instant sealing, where there might not be any new blocks - await waitNewBlocks(api, 3); - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceUniqueForeignTokenAfter = BigInt(free); - - [balanceAcalaTokenAfter] = await getBalance(api, [randomAccount.address]); - const acaFees = balanceAcalaTokenBefore - balanceAcalaTokenAfter; - const unqFees = balanceUniqueForeignTokenBefore - balanceUniqueForeignTokenAfter; - console.log('Unique to Acala transaction fees on Acala: %s ACA', acaFees); - console.log('Unique to Acala transaction fees on Acala: %s UNQ', unqFees); - expect(acaFees == 0n).to.be.true; - expect(unqFees == 0n).to.be.true; - }, - {provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT)}, - ); - }); - - it('Should connect to Acala and send UNQ back', async () => { - - await usingApi( - async (api) => { - const destination = { - V1: { - parents: 1, - interior: { - X2: [ - {Parachain: UNIQUE_CHAIN}, - { - AccountId32: { - network: 'Any', - id: randomAccount.addressRaw, - }, - }, - ], - }, - }, - }; - - const id = { - ForeignAsset: 0, - }; - - const amount = TRANSFER_AMOUNT; - const destWeight = 50000000; - - const tx = api.tx.xTokens.transfer(id, amount, destination, destWeight); - const events = await submitTransactionAsync(randomAccount, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - [balanceAcalaTokenFinal] = await getBalance(api, [randomAccount.address]); - { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceUniqueForeignTokenFinal = BigInt(free); - } - - const acaFees = balanceAcalaTokenFinal - balanceAcalaTokenAfter; - const unqFees = balanceUniqueForeignTokenFinal - balanceUniqueForeignTokenAfter; - console.log('Acala to Unique transaction fees on Acala: %s ACA', acaFees); - console.log('Acala to Unique transaction fees on Acala: %s UNQ', unqFees); - expect(acaFees > 0).to.be.true; - expect(unqFees == 0n).to.be.true; - }, - {provider: new WsProvider('ws://127.0.0.1:' + ACALA_PORT)}, - ); - - await usingApi(async (api) => { - // todo do something about instant sealing, where there might not be any new blocks - await waitNewBlocks(api, 3); - - [balanceUniqueTokenFinal] = await getBalance(api, [randomAccount.address]); - const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenAfter; - expect(actuallyDelivered > 0).to.be.true; - - const unqFees = TRANSFER_AMOUNT - actuallyDelivered; - console.log('Acala to Unique transaction fees on Unique: %s UNQ', unqFees); - expect(unqFees > 0).to.be.true; - }); - }); -}); \ No newline at end of file diff --git a/tests/src/xcm/xcmTransferMoonbeam.test.ts b/tests/src/xcm/xcmTransferMoonbeam.test.ts deleted file mode 100644 index e4d009e5a4..0000000000 --- a/tests/src/xcm/xcmTransferMoonbeam.test.ts +++ /dev/null @@ -1,382 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; - -import {Keyring, WsProvider} from '@polkadot/api'; -import {ApiOptions} from '@polkadot/api/types'; -import {IKeyringPair} from '@polkadot/types/types'; -import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; -import {getGenericResult, generateKeyringPair} from './util/helpers'; -import {MultiLocation} from '@polkadot/types/interfaces'; -import {blake2AsHex} from '@polkadot/util-crypto'; -import getBalance from './substrate/get-balance'; -import waitNewBlocks from './substrate/wait-new-blocks'; - -chai.use(chaiAsPromised); -const expect = chai.expect; - - -let UNIQUE_CHAIN = 0; -let MOONBEAM_CHAIN = 0; - -// parse parachain id numbers -process.argv.forEach((val) => { - - const ai = val.indexOf('moonbeamId='); - const ui = val.indexOf('uniqueId='); - if (ai != -1) - { - MOONBEAM_CHAIN = Number(val.substring('moonbeamId='.length)); - } - if (ui != -1) - { - UNIQUE_CHAIN = Number(val.substring('uniqueId='.length)); - } -}); - -const UNIQUE_PORT = '9944'; -const MOONBEAM_PORT = '9947'; -const TRANSFER_AMOUNT = 2000000000000000000000000n; - -describe('Integration test: Exchanging UNQ with Moonbeam', () => { - - // Unique constants - let uniqueAlice: IKeyringPair; - let uniqueAssetLocation; - - let randomAccountUnique: IKeyringPair; - let randomAccountMoonbeam: IKeyringPair; - - // Moonbeam constants - let assetId: Uint8Array; - - const moonbeamKeyring = new Keyring({type: 'ethereum'}); - const alithPrivateKey = '0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133'; - const baltatharPrivateKey = '0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b'; - const dorothyPrivateKey = '0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68'; - - const alithAccount = moonbeamKeyring.addFromUri(alithPrivateKey, undefined, 'ethereum'); - const baltatharAccount = moonbeamKeyring.addFromUri(baltatharPrivateKey, undefined, 'ethereum'); - const dorothyAccount = moonbeamKeyring.addFromUri(dorothyPrivateKey, undefined, 'ethereum'); - - const councilVotingThreshold = 2; - const technicalCommitteeThreshold = 2; - const votingPeriod = 3; - const delayPeriod = 0; - - const uniqueAssetMetadata = { - name: 'xcUnique', - symbol: 'xcUNQ', - decimals: 18, - isFrozen: false, - minimalBalance: 1, - }; - - // let actuallySent1: bigint; - // let actuallySent2: bigint; - - // let balanceUnique1: bigint; - // let balanceUnique2: bigint; - // let balanceUnique3: bigint; - - // let balanceMoonbeamGlmr1: bigint; - // let balanceMoonbeamGlmr2: bigint; - // let balanceMoonbeamGlmr3: bigint; - - let balanceUniqueTokenBefore: bigint; - let balanceUniqueTokenAfter: bigint; - let balanceUniqueTokenFinal: bigint; - let balanceGlmrTokenBefore: bigint; - let balanceGlmrTokenAfter: bigint; - let balanceGlmrTokenFinal: bigint; - - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - uniqueAlice = privateKeyWrapper('//Alice'); - randomAccountUnique = generateKeyringPair(); - randomAccountMoonbeam = generateKeyringPair('ethereum'); - }); - - const moonbeamApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + MOONBEAM_PORT), - }; - - await usingApi( - async (api) => { - - // >>> Sponsoring Dorothy >>> - const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n); - const events0 = await submitTransactionAsync(alithAccount, tx0); - const result0 = getGenericResult(events0); - expect(result0.success).to.be.true; - // <<< Sponsoring Dorothy <<< - - const sourceLocation: MultiLocation = api.createType( - 'MultiLocation', - { - parents: 1, - interior: {X1: {Parachain: UNIQUE_CHAIN}}, - }, - ); - - assetId = api.registry.hash(sourceLocation.toU8a()).slice(0, 16).reverse(); - console.log('Internal asset ID is %s', assetId); - uniqueAssetLocation = {XCM: sourceLocation}; - const existentialDeposit = 1; - const isSufficient = true; - const unitsPerSecond = '1'; - const numAssetsWeightHint = 0; - - const registerTx = api.tx.assetManager.registerForeignAsset( - uniqueAssetLocation, - uniqueAssetMetadata, - existentialDeposit, - isSufficient, - ); - console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || ''); - - const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond( - uniqueAssetLocation, - unitsPerSecond, - numAssetsWeightHint, - ); - console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || ''); - - const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]); - console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || ''); - - // >>> Note motion preimage >>> - const encodedProposal = batchCall?.method.toHex() || ''; - const proposalHash = blake2AsHex(encodedProposal); - console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal); - console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); - console.log('Encoded length %d', encodedProposal.length); - - const tx1 = api.tx.democracy.notePreimage(encodedProposal); - const events1 = await submitTransactionAsync(baltatharAccount, tx1); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; - // <<< Note motion preimage <<< - - // >>> Propose external motion through council >>> - const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash); - const tx2 = api.tx.councilCollective.propose( - councilVotingThreshold, - externalMotion, - externalMotion.encodedLength, - ); - const events2 = await submitTransactionAsync(baltatharAccount, tx2); - const result2 = getGenericResult(events2); - expect(result2.success).to.be.true; - - const encodedMotion = externalMotion?.method.toHex() || ''; - const motionHash = blake2AsHex(encodedMotion); - console.log('Motion hash is %s', motionHash); - - const tx3 = api.tx.councilCollective.vote(motionHash, 0, true); - { - const events3 = await submitTransactionAsync(dorothyAccount, tx3); - const result3 = getGenericResult(events3); - expect(result3.success).to.be.true; - } - { - const events3 = await submitTransactionAsync(baltatharAccount, tx3); - const result3 = getGenericResult(events3); - expect(result3.success).to.be.true; - } - - const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength); - const events4 = await submitTransactionAsync(dorothyAccount, tx4); - const result4 = getGenericResult(events4); - expect(result4.success).to.be.true; - // <<< Propose external motion through council <<< - - // >>> Fast track proposal through technical committee >>> - const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); - const tx5 = api.tx.techCommitteeCollective.propose( - technicalCommitteeThreshold, - fastTrack, - fastTrack.encodedLength, - ); - const events5 = await submitTransactionAsync(alithAccount, tx5); - const result5 = getGenericResult(events5); - expect(result5.success).to.be.true; - - const encodedFastTrack = fastTrack?.method.toHex() || ''; - const fastTrackHash = blake2AsHex(encodedFastTrack); - console.log('FastTrack hash is %s', fastTrackHash); - - const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1; - const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true); - { - const events6 = await submitTransactionAsync(baltatharAccount, tx6); - const result6 = getGenericResult(events6); - expect(result6.success).to.be.true; - } - { - const events6 = await submitTransactionAsync(alithAccount, tx6); - const result6 = getGenericResult(events6); - expect(result6.success).to.be.true; - } - - const tx7 = api.tx.techCommitteeCollective - .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength); - const events7 = await submitTransactionAsync(baltatharAccount, tx7); - const result7 = getGenericResult(events7); - expect(result7.success).to.be.true; - // <<< Fast track proposal through technical committee <<< - - // >>> Referendum voting >>> - const tx8 = api.tx.democracy.vote( - 0, - {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}}, - ); - const events8 = await submitTransactionAsync(dorothyAccount, tx8); - const result8 = getGenericResult(events8); - expect(result8.success).to.be.true; - // <<< Referendum voting <<< - - // >>> Sponsoring random Account >>> - const tx9 = api.tx.balances.transfer(randomAccountMoonbeam.address, 11_000_000_000_000_000_000n); - const events9 = await submitTransactionAsync(baltatharAccount, tx9); - const result9 = getGenericResult(events9); - expect(result9.success).to.be.true; - // <<< Sponsoring random Account <<< - - [balanceGlmrTokenBefore] = await getBalance(api, [randomAccountMoonbeam.address]); - }, - moonbeamApiOptions, - ); - - await usingApi(async (api) => { - const tx0 = api.tx.balances.transfer(randomAccountUnique.address, 10n * TRANSFER_AMOUNT); - const events0 = await submitTransactionAsync(uniqueAlice, tx0); - const result0 = getGenericResult(events0); - expect(result0.success).to.be.true; - - [balanceUniqueTokenBefore] = await getBalance(api, [randomAccountUnique.address]); - }); - }); - - it('Should connect and send UNQ to Moonbeam', async () => { - await usingApi(async (api) => { - const currencyId = { - NativeAssetId: 'Here', - }; - const dest = { - V1: { - parents: 1, - interior: { - X2: [ - {Parachain: MOONBEAM_CHAIN}, - {AccountKey20: {network: 'Any', key: randomAccountMoonbeam.address}}, - ], - }, - }, - }; - const amount = TRANSFER_AMOUNT; - const destWeight = 50000000; - - const tx = api.tx.xTokens.transfer(currencyId, amount, dest, destWeight); - const events = await submitTransactionAsync(uniqueAlice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - [balanceUniqueTokenAfter] = await getBalance(api, [randomAccountUnique.address]); - expect(balanceUniqueTokenAfter < balanceUniqueTokenBefore).to.be.true; - - const transactionFees = balanceUniqueTokenBefore - balanceUniqueTokenAfter - TRANSFER_AMOUNT; - console.log('Unique to Moonbeam transaction fees on Unique: %s UNQ', transactionFees); - expect(transactionFees > 0).to.be.true; - }); - - await usingApi( - async (api) => { - // todo do something about instant sealing, where there might not be any new blocks - await waitNewBlocks(api, 3); - - [balanceGlmrTokenAfter] = await getBalance(api, [randomAccountMoonbeam.address]); - - const glmrFees = balanceGlmrTokenBefore - balanceGlmrTokenAfter; - console.log('Unique to Moonbeam transaction fees on Moonbeam: %s GLMR', glmrFees); - expect(glmrFees == 0n).to.be.true; - }, - {provider: new WsProvider('ws://127.0.0.1:' + MOONBEAM_PORT)}, - ); - }); - - it('Should connect to Moonbeam and send UNQ back', async () => { - await usingApi( - async (api) => { - const amount = TRANSFER_AMOUNT / 2n; - const asset = { - V1: { - id: { - Concrete: { - parents: 1, - interior: { - X1: {Parachain: UNIQUE_CHAIN}, - }, - }, - }, - fun: { - Fungible: amount, - }, - }, - }; - const destination = { - V1: { - parents: 1, - interior: { - X2: [ - {Parachain: UNIQUE_CHAIN}, - {AccountId32: {network: 'Any', id: randomAccountUnique.addressRaw}}, - ], - }, - }, - }; - const destWeight = 50000000; - - const tx = api.tx.xTokens.transferMultiasset(asset, destination, destWeight); - const events = await submitTransactionAsync(randomAccountMoonbeam, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - [balanceGlmrTokenFinal] = await getBalance(api, [randomAccountMoonbeam.address]); - - const glmrFees = balanceGlmrTokenAfter - balanceGlmrTokenFinal; - console.log('Moonbeam to Unique transaction fees on Moonbeam: %s GLMR', glmrFees); - expect(glmrFees > 0).to.be.true; - }, - {provider: new WsProvider('ws://127.0.0.1:' + MOONBEAM_PORT)}, - ); - - await usingApi(async (api) => { - // todo do something about instant sealing, where there might not be any new blocks - await waitNewBlocks(api, 3); - - [balanceUniqueTokenFinal] = await getBalance(api, [randomAccountUnique.address]); - const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenAfter; - expect(actuallyDelivered > 0).to.be.true; - - const unqFees = TRANSFER_AMOUNT - actuallyDelivered; - console.log('Moonbeam to Unique transaction fees on Unique: %s UNQ', unqFees); - expect(unqFees > 0).to.be.true; - }); - }); -}); diff --git a/tests/src/xcm/xcmTransferStatemine.test.ts b/tests/src/xcm/xcmTransferStatemine.test.ts deleted file mode 100644 index 6ba788d808..0000000000 --- a/tests/src/xcm/xcmTransferStatemine.test.ts +++ /dev/null @@ -1,360 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; - -import {WsProvider} from '@polkadot/api'; -import {ApiOptions} from '@polkadot/api/types'; -import {IKeyringPair} from '@polkadot/types/types'; -import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; -import {getGenericResult} from './util/helpers'; -import waitNewBlocks from './substrate/wait-new-blocks'; -import {normalizeAccountId} from './util/helpers'; -import getBalance from './substrate/get-balance'; - - -chai.use(chaiAsPromised); -const expect = chai.expect; - -// const STATEMINE_CHAIN = 1000; -// const UNIQUE_CHAIN = 2037; - -let UNIQUE_CHAIN = 0; -let STATEMINE_CHAIN = 0; - -// parse parachain id numbers -process.argv.forEach((val) => { - - const ai = val.indexOf('statemineId='); - const ui = val.indexOf('uniqueId='); - if (ai != -1) - { - STATEMINE_CHAIN = Number(val.substring('statemineId='.length)); - } - if (ui != -1) - { - UNIQUE_CHAIN = Number(val.substring('uniqueId='.length)); - } -}); - -const RELAY_PORT = '9844'; -const UNIQUE_PORT = '9944'; -const STATEMINE_PORT = '9948'; -const STATEMINE_PALLET_INSTANCE = 50; -const ASSET_ID = 100; -const ASSET_METADATA_DECIMALS = 18; -const ASSET_METADATA_NAME = 'USDT'; -const ASSET_METADATA_DESCRIPTION = 'USDT'; -const ASSET_METADATA_MINIMAL_BALANCE = 1; - -const TRANSFER_AMOUNT = 1_000_000_000_000_000_000n; -const TRANSFER_AMOUNT2 = 10_000_000_000_000_000n; - -describe('Integration test: Exchanging USDT with Statemine', () => { - let alice: IKeyringPair; - let bob: IKeyringPair; - - let balanceStmnBefore: bigint; - let balanceStmnAfter: bigint; - let balanceStmnFinal: bigint; - - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); // funds donor - }); - - const statemineApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT), - }; - - const uniqueApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), - }; - - const relayApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + RELAY_PORT), - }; - - await usingApi(async (api) => { - - // 10,000.00 (ten thousands) USDT - const assetAmount = 1_000_000_000_000_000_000_000n; - // 350.00 (three hundred fifty) DOT - const fundingAmount = 3_500_000_000_000; - - const tx = api.tx.assets.create(ASSET_ID, alice.addressRaw, ASSET_METADATA_MINIMAL_BALANCE); - const events = await submitTransactionAsync(alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - // set metadata - const tx2 = api.tx.assets.setMetadata(ASSET_ID, ASSET_METADATA_NAME, ASSET_METADATA_DESCRIPTION, ASSET_METADATA_DECIMALS); - const events2 = await submitTransactionAsync(alice, tx2); - const result2 = getGenericResult(events2); - expect(result2.success).to.be.true; - - // mint some amount of asset - const tx3 = api.tx.assets.mint(ASSET_ID, alice.addressRaw, assetAmount); - const events3 = await submitTransactionAsync(alice, tx3); - const result3 = getGenericResult(events3); - expect(result3.success).to.be.true; - - // funding parachain sovereing account (Parachain: 2037) - //const parachainSovereingAccount = '0x70617261f5070000000000000000000000000000000000000000000000000000'; - const parachainSovereingAccount = '0x7369626cf5070000000000000000000000000000000000000000000000000000'; - const tx4 = api.tx.balances.transfer(parachainSovereingAccount, fundingAmount); - const events4 = await submitTransactionAsync(bob, tx4); - const result4 = getGenericResult(events4); - expect(result4.success).to.be.true; - - }, statemineApiOptions); - - - await usingApi(async (api) => { - - const location = { - V1: { - parents: 1, - interior: {X3: [ - { - Parachain: STATEMINE_CHAIN, - }, - { - PalletInstance: STATEMINE_PALLET_INSTANCE, - }, - { - GeneralIndex: ASSET_ID, - }, - ]}, - }, - }; - - const metadata = - { - name: ASSET_ID, - symbol: ASSET_METADATA_NAME, - decimals: ASSET_METADATA_DECIMALS, - minimalBalance: ASSET_METADATA_MINIMAL_BALANCE, - }; - //registerForeignAsset(owner, location, metadata) - const tx = api.tx.foreingAssets.registerForeignAsset(alice.addressRaw, location, metadata); - const sudoTx = api.tx.sudo.sudo(tx as any); - const events = await submitTransactionAsync(alice, sudoTx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - }, uniqueApiOptions); - - - // Providing the relay currency to the unique sender account - await usingApi(async (api) => { - const destination = { - V1: { - parents: 0, - interior: {X1: { - Parachain: UNIQUE_CHAIN, - }, - }, - }}; - - const beneficiary = { - V1: { - parents: 0, - interior: {X1: { - AccountId32: { - network: 'Any', - id: alice.addressRaw, - }, - }}, - }, - }; - - const assets = { - V1: [ - { - id: { - Concrete: { - parents: 0, - interior: 'Here', - }, - }, - fun: { - Fungible: 50_000_000_000_000_000n, - }, - }, - ], - }; - - const feeAssetItem = 0; - - const weightLimit = { - Limited: 5_000_000_000, - }; - - const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); - const events = await submitTransactionAsync(alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - }, relayApiOptions); - - }); - - it('Should connect and send USDT from Statemine to Unique', async () => { - - const statemineApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT), - }; - - const uniqueApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), - }; - - await usingApi(async (api) => { - - const dest = { - V1: { - parents: 1, - interior: {X1: { - Parachain: UNIQUE_CHAIN, - }, - }, - }}; - - const beneficiary = { - V1: { - parents: 0, - interior: {X1: { - AccountId32: { - network: 'Any', - id: alice.addressRaw, - }, - }}, - }, - }; - - const assets = { - V1: [ - { - id: { - Concrete: { - parents: 0, - interior: { - X2: [ - { - PalletInstance: STATEMINE_PALLET_INSTANCE, - }, - { - GeneralIndex: ASSET_ID, - }, - ]}, - }, - }, - fun: { - Fungible: TRANSFER_AMOUNT, - }, - }, - ], - }; - - const feeAssetItem = 0; - - const weightLimit = { - Limited: 5000000000, - }; - - [balanceStmnBefore] = await getBalance(api, [alice.address]); - - const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(dest, beneficiary, assets, feeAssetItem, weightLimit); - const events = await submitTransactionAsync(alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - [balanceStmnAfter] = await getBalance(api, [alice.address]); - expect(balanceStmnBefore > balanceStmnAfter).to.be.true; - - }, statemineApiOptions); - - - // ensure that asset has been delivered - await usingApi(async (api) => { - await waitNewBlocks(api, 3); - // expext collection id will be with id 1 - const free = (await api.query.fungible.balance(1, normalizeAccountId(alice.address))).toBigInt(); - expect(free == TRANSFER_AMOUNT).to.be.true; - - }, uniqueApiOptions); - }); - - it('Should connect and send USDT from Unique to Statemine back', async () => { - let balanceBefore: bigint; - const uniqueApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), - }; - - await usingApi(async (api) => { - balanceBefore = (await api.query.fungible.balance(1, normalizeAccountId(alice.address))).toBigInt(); - - const destination = { - V1: { - parents: 1, - interior: {X2: [ - { - Parachain: STATEMINE_CHAIN, - }, - { - AccountId32: { - network: 'Any', - id: alice.addressRaw, - }, - }, - ]}, - }, - }; - - const currencies = [[ - { - ForeignAssetId: 0, - }, - 10_000_000_000_000_000n, - ], - [ - { - NativeAssetId: 'Parent', - }, - 400_000_000_000_000n, - ]]; - - const feeItem = 1; - const destWeight = 500000000000; - - const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight); - const events = await submitTransactionAsync(alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - - [balanceStmnFinal] = await getBalance(api, [alice.address]); - expect(balanceStmnFinal > balanceStmnBefore).to.be.true; - - // todo do something about instant sealing, where there might not be any new blocks - await waitNewBlocks(api, 3); - const balanceAfter = (await api.query.fungible.balance(1, normalizeAccountId(alice.address))).toBigInt(); - expect(balanceAfter < balanceBefore).to.be.true; - }, uniqueApiOptions); - }); -}); \ No newline at end of file From 492866af2f539210a91070fbd23254367d056fea Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 7 Sep 2022 10:35:04 +0000 Subject: [PATCH 0769/1274] fix: xcm tests ts errors --- tests/src/xcm/xcmOpal.test.ts | 37 ++++++++++++++++++--------------- tests/src/xcm/xcmQuartz.test.ts | 10 ++++----- tests/src/xcm/xcmUnique.test.ts | 10 ++++----- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/tests/src/xcm/xcmOpal.test.ts b/tests/src/xcm/xcmOpal.test.ts index e9c39753f7..bab3ce77bb 100644 --- a/tests/src/xcm/xcmOpal.test.ts +++ b/tests/src/xcm/xcmOpal.test.ts @@ -21,7 +21,7 @@ import {WsProvider} from '@polkadot/api'; import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; import usingApi, {submitTransactionAsync} from './../substrate/substrate-api'; -import {bigIntToDecimals, getGenericResult, paraSiblingSovereignAccount} from './../util/helpers'; +import {bigIntToDecimals, describe_xcm, getGenericResult, paraSiblingSovereignAccount} from './../util/helpers'; import waitNewBlocks from './../substrate/wait-new-blocks'; import {normalizeAccountId} from './../util/helpers'; import getBalance from './../substrate/get-balance'; @@ -50,7 +50,7 @@ const TRANSFER_AMOUNT = 1_000_000_000_000_000_000n; // 10,000.00 (ten thousands) USDT const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n; -describe('Integration test: Exchanging USDT with Westmint', () => { +describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { let alice: IKeyringPair; let bob: IKeyringPair; @@ -345,19 +345,21 @@ describe('Integration test: Exchanging USDT with Westmint', () => { }, }; - const currencies = [[ - { - ForeignAssetId: 0, - }, - //10_000_000_000_000_000n, - TRANSFER_AMOUNT, - ], - [ - { - NativeAssetId: 'Parent', - }, - 400_000_000_000_000n, - ]]; + const currencies: [any, bigint][] = [ + [ + { + ForeignAssetId: 0, + }, + //10_000_000_000_000_000n, + TRANSFER_AMOUNT, + ], + [ + { + NativeAssetId: 'Parent', + }, + 400_000_000_000_000n, + ], + ]; const feeItem = 1; const destWeight = 500000000000; @@ -499,13 +501,14 @@ describe('Integration test: Exchanging USDT with Westmint', () => { }, }; - const currencies = [ + const currencies: any = [ [ { NativeAssetId: 'Parent', }, 50_000_000_000_000_000n, - ]]; + ], + ]; const feeItem = 0; const destWeight = 500000000000; diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index 5268e3c58d..98df8f3797 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -61,7 +61,7 @@ function relayOptions(): ApiOptions { return parachainApiOptions(RELAY_PORT); } -describe_xcm('Integration test: Exchanging tokens with Karura', () => { +describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { let alice: IKeyringPair; let randomAccount: IKeyringPair; @@ -246,7 +246,7 @@ describe_xcm('Integration test: Exchanging tokens with Karura', () => { const destWeight = 50000000; - const tx = api.tx.xTokens.transfer(id, TRANSFER_AMOUNT, destination, destWeight); + const tx = api.tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight); const events = await submitTransactionAsync(randomAccount, tx); const result = getGenericResult(events); expect(result.success).to.be.true; @@ -290,7 +290,7 @@ describe_xcm('Integration test: Exchanging tokens with Karura', () => { }); // These tests are relevant only when the foreign asset pallet is disabled -describe('Integration test: Quartz rejects non-native tokens', () => { +describe_xcm('[XCM] Integration test: Quartz rejects non-native tokens', () => { let alice: IKeyringPair; before(async () => { @@ -405,7 +405,7 @@ describe('Integration test: Quartz rejects non-native tokens', () => { const destWeight = 50000000; - const tx = api.tx.xTokens.transfer(id, 100_000_000_000, destination, destWeight); + const tx = api.tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight); const events = await submitTransactionAsync(alice, tx); const result = getGenericResult(events); expect(result.success).to.be.true; @@ -431,7 +431,7 @@ describe('Integration test: Quartz rejects non-native tokens', () => { }); }); -describe_xcm('Integration test: Exchanging QTZ with Moonriver', () => { +describe_xcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { // Quartz constants let quartzAlice: IKeyringPair; diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index e5be072b90..e85e599329 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -61,7 +61,7 @@ function relayOptions(): ApiOptions { return parachainApiOptions(RELAY_PORT); } -describe_xcm('Integration test: Exchanging tokens with Acala', () => { +describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { let alice: IKeyringPair; let randomAccount: IKeyringPair; @@ -246,7 +246,7 @@ describe_xcm('Integration test: Exchanging tokens with Acala', () => { const destWeight = 50000000; - const tx = api.tx.xTokens.transfer(id, TRANSFER_AMOUNT, destination, destWeight); + const tx = api.tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight); const events = await submitTransactionAsync(randomAccount, tx); const result = getGenericResult(events); expect(result.success).to.be.true; @@ -290,7 +290,7 @@ describe_xcm('Integration test: Exchanging tokens with Acala', () => { }); // These tests are relevant only when the foreign asset pallet is disabled -describe('Integration test: Unique rejects non-native tokens', () => { +describe_xcm('[XCM] Integration test: Unique rejects non-native tokens', () => { let alice: IKeyringPair; before(async () => { @@ -405,7 +405,7 @@ describe('Integration test: Unique rejects non-native tokens', () => { const destWeight = 50000000; - const tx = api.tx.xTokens.transfer(id, 100_000_000_000, destination, destWeight); + const tx = api.tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight); const events = await submitTransactionAsync(alice, tx); const result = getGenericResult(events); expect(result.success).to.be.true; @@ -431,7 +431,7 @@ describe('Integration test: Unique rejects non-native tokens', () => { }); }); -describe_xcm('Integration test: Exchanging UNQ with Moonbeam', () => { +describe_xcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { // Unique constants let uniqueAlice: IKeyringPair; From 2469ee725ca59c2308967c26c77389d3efb874b0 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 6 Sep 2022 19:14:41 +0700 Subject: [PATCH 0770/1274] correct and enable tests/scripts/readyness.js --- .github/workflows/autogen-js-types.yml | 140 ------------------------- .github/workflows/dev-build-tests.yml | 4 +- tests/scripts/readyness.js | 2 +- 3 files changed, 4 insertions(+), 142 deletions(-) delete mode 100644 .github/workflows/autogen-js-types.yml diff --git a/.github/workflows/autogen-js-types.yml b/.github/workflows/autogen-js-types.yml deleted file mode 100644 index 8f00010ed4..0000000000 --- a/.github/workflows/autogen-js-types.yml +++ /dev/null @@ -1,140 +0,0 @@ -name: yarn autogetn JS types - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - develop - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -#Define Workflow variables -env: - REPO_URL: ${{ github.server_url }}/${{ github.repository }} - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - autogen_js_types: - # The type of runner that the job will run on - runs-on: [self-hosted-ci,medium] - timeout-minutes: 1380 - - name: ${{ matrix.network }} - - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - - strategy: - matrix: - include: - - network: "opal" - features: "opal-runtime" - branch: "opal-testnet" - - network: "quartz" - features: "quartz-runtime" - branch: "quartz-mainnet" - - network: "unique" - features: "unique-runtime" - branch: "master" - - steps: - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Generate ENV related extend file for docker-compose - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/docker-compose.tmp-dev.j2 - output_file: .docker/docker-compose.${{ matrix.network }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - FEATURE=${{ matrix.features }} - - - - name: Show build configuration - run: cat .docker/docker-compose.${{ matrix.network }}.yml - - - name: Build the stack - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans - - - name: Wait untill node-dev started. - run: sleep 600s - - - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Generate - working-directory: tests - run: | - yarn install - yarn polkadot-types - - - name: Checkout repo UniqueNetwork/unique-types-js - uses: actions/checkout@v3 - with: - repository: 'UniqueNetwork/unique-types-js' -# ssh-key: ${{ secrets.GH_PAT }} - path: 'tests/unique-types-js' -# ref: 'QA-65_maxandreev' - - - name: Copy files - working-directory: tests - run: | - rsync -ar --exclude .gitignore src/interfaces/ unique-types-js - for file in unique-types-js/augment-* unique-types-js/**/types.ts unique-types-js/registry.ts; do - sed -i '1s;^;//@ts-nocheck\n;' $file - done - - - name: Enumerate files after generation - working-directory: tests/unique-types-js - run: | - ls -la - - - name: Enumerate files after generation - working-directory: tests/ - run: | - ls -la - - - name: Upload JS types to repo - working-directory: tests/unique-types-js - run: | - git config user.name github-actions - git config user.email github-actions@github.com - git add . - git commit -m "chore: regenerate types" - - - name: Pushes to another repository - id: push_directory - uses: cpina/github-action-push-to-another-repository@main - env: - SSH_DEPLOY_KEY: ${{ secrets.GH_MAK }} - with: - source-directory: tests/unique-types-js - destination-repository-name: 'lzadjsf/unique-types-js' - commit-message: 'chore: regenerate types' - target-branch: ${{ matrix.branch }} - - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down diff --git a/.github/workflows/dev-build-tests.yml b/.github/workflows/dev-build-tests.yml index a8536f765e..7dd215aa3e 100644 --- a/.github/workflows/dev-build-tests.yml +++ b/.github/workflows/dev-build-tests.yml @@ -96,10 +96,12 @@ jobs: node-version: 16 - name: Run tests + working-directory: tests run: | - cd tests yarn install yarn add mochawesome + yarn polkadot-types + echo "Ready to start tests" node scripts/readyness.js NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} diff --git a/tests/scripts/readyness.js b/tests/scripts/readyness.js index 6543bfc7d2..a448def651 100644 --- a/tests/scripts/readyness.js +++ b/tests/scripts/readyness.js @@ -6,9 +6,9 @@ const connect = async () => { await api.isReadyOrError; const head = (await api.rpc.chain.getHeader()).number.toNumber(); + await api.disconnect(); if(head < 1) throw Error('No block #1'); - await api.disconnect(); } const sleep = time => { From ebe86446c569144f525fe3505ca9b2a2537bfd63 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 7 Sep 2022 14:02:34 +0300 Subject: [PATCH 0771/1274] add autogeneration js types before tests and enable readyness.js script --- .github/workflows/nodes-only-update.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index ae9779349f..0b5b194c81 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -195,6 +195,8 @@ jobs: run: | yarn install yarn add mochawesome + yarm polkadot-types + node scripts/readyness.js echo "Ready to start tests" NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: @@ -270,6 +272,8 @@ jobs: run: | yarn install yarn add mochawesome + yarn polkadot-types + node scripts/readyness.js echo "Ready to start tests" NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: From 3fcefa3e9092f8ef31af0fd2f570e810aaa2a72b Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 7 Sep 2022 14:10:26 +0300 Subject: [PATCH 0772/1274] re-order --- .github/workflows/dev-build-tests.yml | 3 +-- .github/workflows/nodes-only-update.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev-build-tests.yml b/.github/workflows/dev-build-tests.yml index 7dd215aa3e..f079badbf4 100644 --- a/.github/workflows/dev-build-tests.yml +++ b/.github/workflows/dev-build-tests.yml @@ -100,10 +100,9 @@ jobs: run: | yarn install yarn add mochawesome - yarn polkadot-types - echo "Ready to start tests" node scripts/readyness.js + yarn polkadot-types NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index 0b5b194c81..246fb4fee8 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -272,9 +272,9 @@ jobs: run: | yarn install yarn add mochawesome - yarn polkadot-types node scripts/readyness.js echo "Ready to start tests" + yarn polkadot-types NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ From 25c961748e58bdcd7c0c8da1cd814cc2c8031dda Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 7 Sep 2022 11:17:04 +0000 Subject: [PATCH 0773/1274] remove: getTotalStakingLocked from RPC. --- client/rpc/src/lib.rs | 9 --------- primitives/app_promotion_rpc/src/lib.rs | 1 - runtime/common/runtime_apis.rs | 8 -------- tests/src/interfaces/appPromotion/definitions.ts | 8 -------- tests/src/interfaces/augment-api-rpc.ts | 4 ---- 5 files changed, 30 deletions(-) diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index 1aad1af827..e94a7e5ade 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -270,14 +270,6 @@ mod app_promotion_unique_rpc { at: Option, ) -> Result>; - /// Returns the total amount locked by staking tokens. - #[method(name = "appPromotion_totalStakingLocked")] - fn total_staking_locked( - &self, - staker: CrossAccountId, - at: Option, - ) -> Result; - /// Returns the total amount of tokens pending withdrawal from staking. #[method(name = "appPromotion_pendingUnstake")] fn pending_unstake( @@ -594,7 +586,6 @@ where .into_iter() .map(|(b, a)| (b, a.to_string())) .collect::>(), app_promotion_api); - pass_method!(total_staking_locked(staker: CrossAccountId) -> String => |v| v.to_string(), app_promotion_api); pass_method!(pending_unstake(staker: Option) -> String => |v| v.to_string(), app_promotion_api); pass_method!(pending_unstake_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, String)> => |v| v diff --git a/primitives/app_promotion_rpc/src/lib.rs b/primitives/app_promotion_rpc/src/lib.rs index 703fcff528..e381ed36d4 100644 --- a/primitives/app_promotion_rpc/src/lib.rs +++ b/primitives/app_promotion_rpc/src/lib.rs @@ -35,7 +35,6 @@ sp_api::decl_runtime_apis! { { fn total_staked(staker: Option) -> Result; fn total_staked_per_block(staker: CrossAccountId) -> Result>; - fn total_staking_locked(staker: CrossAccountId) -> Result; fn pending_unstake(staker: Option) -> Result; fn pending_unstake_per_block(staker: CrossAccountId) -> Result>; } diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index 980223efa7..edc2f0ef53 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -206,14 +206,6 @@ macro_rules! impl_common_runtime_apis { return Ok(>::cross_id_total_staked_per_block(staker)); } - fn total_staking_locked(staker: CrossAccountId) -> Result { - #[cfg(not(feature = "app-promotion"))] - return unsupported!(); - - #[cfg(feature = "app-promotion")] - return Ok(>::cross_id_locked_balance(staker)); - } - fn pending_unstake(staker: Option) -> Result { #[cfg(not(feature = "app-promotion"))] return unsupported!(); diff --git a/tests/src/interfaces/appPromotion/definitions.ts b/tests/src/interfaces/appPromotion/definitions.ts index b93df0e6f3..87e1e6d8a0 100644 --- a/tests/src/interfaces/appPromotion/definitions.ts +++ b/tests/src/interfaces/appPromotion/definitions.ts @@ -22,9 +22,6 @@ type RpcParam = { const CROSS_ACCOUNT_ID_TYPE = 'PalletEvmAccountBasicCrossAccountIdRepr'; -const collectionParam = {name: 'collection', type: 'u32'}; -const tokenParam = {name: 'tokenId', type: 'u32'}; -const propertyKeysParam = {name: 'propertyKeys', type: 'Vec', isOptional: true}; const crossAccountParam = (name = 'account') => ({name, type: CROSS_ACCOUNT_ID_TYPE}); const atParam = {name: 'at', type: 'Hash', isOptional: true}; @@ -47,11 +44,6 @@ export default { [crossAccountParam('staker')], 'Vec<(u32, u128)>', ), - totalStakingLocked: fun( - 'Return the total amount locked by staking tokens', - [crossAccountParam('staker')], - 'u128', - ), pendingUnstake: fun( 'Returns the total amount of unstaked tokens', [{name: 'staker', type: CROSS_ACCOUNT_ID_TYPE, isOptional: true}], diff --git a/tests/src/interfaces/augment-api-rpc.ts b/tests/src/interfaces/augment-api-rpc.ts index 50027f8e8d..bbcff3420f 100644 --- a/tests/src/interfaces/augment-api-rpc.ts +++ b/tests/src/interfaces/augment-api-rpc.ts @@ -52,10 +52,6 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { * Returns the total amount of staked tokens per block when staked **/ totalStakedPerBlock: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>>>; - /** - * Return the total amount locked by staking tokens - **/ - totalStakingLocked: AugmentedRpc<(staker: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; }; author: { /** From c52f33f18ea336342445a1aabffe18befac7c22a Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Wed, 7 Sep 2022 11:31:50 +0000 Subject: [PATCH 0774/1274] Tests: fix flakyness --- tests/src/app-promotion.test.ts | 43 +++++++++++++---------- tests/src/util/playgrounds/unique.dev.ts | 44 ++++++++++++++++++++---- tests/src/util/playgrounds/unique.ts | 14 +++----- 3 files changed, 66 insertions(+), 35 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 291e41d8d6..e76461e7c2 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -37,6 +37,9 @@ let palletAdmin: IKeyringPair; let nominal: bigint; const palletAddress = calculatePalleteAddress('appstake'); let accounts: IKeyringPair[] = []; +const LOCKING_PERIOD = 20n; // 20 blocks of relay +const UNLOCKING_PERIOD = 10n; // 20 blocks of parachain +const rewardAvailableInBlock = (stakedInBlock: bigint) => (stakedInBlock - stakedInBlock % LOCKING_PERIOD) + (LOCKING_PERIOD * 2n); before(async function () { await usingPlaygrounds(async (helper, privateKeyWrapper) => { @@ -66,7 +69,6 @@ describe('app-promotions.stake extrinsic', () => { expect (await helper.balance.getSubstrateFull(staker.address)).to.contain({miscFrozen: 100n * nominal, feeFrozen: 100n * nominal, reserved: 0n}); await expect(helper.balance.transferToSubstrate(staker, recepient.address, 900n * nominal)).to.be.rejected; - expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(100n * nominal); expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(100n * nominal); expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); // it is potentially flaky test. Promotion can credited some tokens. Maybe we need to use closeTo? @@ -74,7 +76,6 @@ describe('app-promotions.stake extrinsic', () => { await helper.staking.stake(staker, 200n * nominal); - expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(300n * nominal); expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(300n * nominal); expect((await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map((x) => x[1])).to.be.deep.equal([100n * nominal, 200n * nominal]); }); @@ -83,7 +84,6 @@ describe('app-promotions.stake extrinsic', () => { it('should allow to create maximum 10 stakes for account', async () => { await usingPlaygrounds(async (helper) => { const [staker] = await helper.arrange.createAccounts([2000n], alice); - console.log(staker.address); for (let i = 0; i < 10; i++) { await helper.staking.stake(staker, 100n * nominal); } @@ -147,14 +147,14 @@ describe('unstake balance extrinsic', () => { }); it('should unlock balance after unlocking period ends and remove it from "pendingUnstake"', async () => { - // TODO Flaky test await usingPlaygrounds(async (helper) => { const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); await helper.staking.unstake(staker); + const unstakedInBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}))[0][0]; // Wait for unstaking period. Balance now free ~1000; reserved, frozen, miscFrozeb: 0n - await waitForRelayBlock(helper.api!, 20); + await helper.wait.forParachainBlockNumber(unstakedInBlock); expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, miscFrozen: 0n, feeFrozen: 0n}); expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); @@ -181,6 +181,7 @@ describe('unstake balance extrinsic', () => { // Can unstake multiple stakes await helper.staking.unstake(staker); + const unstakingBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}))[0][0]; pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]); stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]); @@ -189,7 +190,7 @@ describe('unstake balance extrinsic', () => { expect(unstakedPerBlock).to.be.deep.equal([600n * nominal]); expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 600n * nominal, feeFrozen: 0n, miscFrozen: 0n}); - await waitForRelayBlock(helper.api!, 20); + await helper.wait.forParachainBlockNumber(unstakingBlock); expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 0n, miscFrozen: 0n}); expect (await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); }); @@ -202,7 +203,6 @@ describe('unstake balance extrinsic', () => { // unstake has no effect if no stakes at all await helper.staking.unstake(staker); expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(0n); - expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(0n); expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); // TODO bigint closeTo helper // TODO stake() unstake() waitUnstaked() unstake(); @@ -213,7 +213,6 @@ describe('unstake balance extrinsic', () => { await helper.staking.unstake(staker); expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal); - expect(await helper.staking.getTotalStakingLocked({Substrate: staker.address})).to.be.equal(100n * nominal); expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); }); }); @@ -246,8 +245,6 @@ describe('unstake balance extrinsic', () => { })); }); }); - - // TODO for different accounts in one block is possible }); describe('Admin adress', () => { @@ -636,13 +633,16 @@ describe('app-promotion rewards', () => { }); it('should credit 0.05% for staking period', async () => { - // TODO flaky test await usingPlaygrounds(async helper => { const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); await helper.staking.stake(staker, 200n * nominal); - await waitForRelayBlock(helper.api!, 30); + + // wair rewards are available: + const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[1][0]; + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock)); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); const totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); @@ -651,21 +651,20 @@ describe('app-promotion rewards', () => { }); it('shoud be paid for more than one period if payments was missed', async () => { - // TODO flaky test await usingPlaygrounds(async (helper) => { const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); - await helper.staking.stake(staker, 200n * nominal); + // wait for two rewards are available: + const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0]; + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock) + LOCKING_PERIOD); - await waitForRelayBlock(helper.api!, 55); await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); const stakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - expect(stakedPerBlock[0][1]).to.be.equal(calculateIncome(100n * nominal, 10n, 2)); - expect(stakedPerBlock[1][1]).to.be.equal(calculateIncome(200n * nominal, 10n, 2)); + const frozenBalanceShouldBe = calculateIncome(100n * nominal, 10n, 2); + expect(stakedPerBlock[0][1]).to.be.equal(frozenBalanceShouldBe); const stakerFullBalance = await helper.balance.getSubstrateFull(staker.address); - const frozenBalanceShouldBe = calculateIncome(300n * nominal, 10n, 2); expect(stakerFullBalance).to.contain({reserved: 0n, feeFrozen: frozenBalanceShouldBe, miscFrozen: frozenBalanceShouldBe}); }); @@ -673,7 +672,7 @@ describe('app-promotion rewards', () => { it('should not be credited for unstaked (reserved) balance', async () => { await usingPlaygrounds(async helper => { - // staker unstakes before rewards has been initialized + // staker unstakes before rewards has been payed const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); await waitForRelayBlock(helper.api!, 40); @@ -709,6 +708,12 @@ describe('app-promotion rewards', () => { }); }); + it('can be paid 1000 rewards in a time', async () => { + await usingPlaygrounds(async (helper) => { + expect.fail('Test not implemented'); + }); + }); + it.skip('can handle 40.000 rewards', async () => { await usingPlaygrounds(async (helper) => { const [donor] = await helper.arrange.createAccounts([7_000_000n], alice); diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 4d0114db8d..130064ee45 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -17,7 +17,6 @@ export class SilentLogger { }; } - export class SilentConsole { // TODO: Remove, this is temporary: Filter unneeded API output // (Jaco promised it will be removed in the next version) @@ -60,10 +59,12 @@ export class DevUniqueHelper extends UniqueHelper { * Arrange methods for tests */ arrange: ArrangeGroup; + wait: WaitGroup; constructor(logger: { log: (msg: any, level: any) => void, level: any }) { super(logger); this.arrange = new ArrangeGroup(this); + this.wait = new WaitGroup(this); } async connect(wsEndpoint: string, _listeners?: any): Promise { @@ -152,7 +153,7 @@ class ArrangeGroup { for (let index = 0; index < 5; index++) { accountsCreated = await checkBalances(); if(accountsCreated) break; - await this.waitNewBlocks(1); + } if (!accountsCreated) throw Error('Accounts generation failed'); @@ -162,11 +163,10 @@ class ArrangeGroup { }; // TODO combine this method and createAccounts into one - createCrowd = async (accountsToCreate: number, withBalance: bigint, donor: IKeyringPair): Promise => { - let transactions: any = []; - const accounts: IKeyringPair[] = []; - + createCrowd = async (accountsToCreate: number, withBalance: bigint, donor: IKeyringPair): Promise => { const createAsManyAsCan = async () => { + let transactions: any = []; + const accounts: IKeyringPair[] = []; let nonce = await this.helper.chain.getNonce(donor.address); const tokenNominal = this.helper.balance.getOneTokenNominal(); for (let i = 0; i < accountsToCreate; i++) { @@ -226,13 +226,21 @@ class ArrangeGroup { const block2date = await findCreationDate(block2); if(block2date! - block1date! < 9000) return true; }; +} + +class WaitGroup { + helper: UniqueHelper; + + constructor(helper: UniqueHelper) { + this.helper = helper; + } /** * Wait for specified bnumber of blocks * @param blocksCount number of blocks to wait * @returns */ - async waitNewBlocks(blocksCount = 1): Promise { + async newBlocks(blocksCount = 1): Promise { // eslint-disable-next-line no-async-promise-executor const promise = new Promise(async (resolve) => { const unsubscribe = await this.helper.api!.rpc.chain.subscribeNewHeads(() => { @@ -246,4 +254,26 @@ class ArrangeGroup { }); return promise; } + + async forParachainBlockNumber(blockNumber: bigint) { + return new Promise(async (resolve) => { + const unsubscribe = await this.helper.api!.rpc.chain.subscribeNewHeads(async (data: any) => { + if (data.number.toNumber() >= blockNumber) { + unsubscribe(); + resolve(); + } + }); + }); + } + + async forRelayBlockNumber(blockNumber: bigint) { + return new Promise(async (resolve) => { + const unsubscribe = await this.helper.api!.query.parachainSystem.validationData(async (data: any) => { + if (data.value.relayParentNumber.toNumber() >= blockNumber) { + unsubscribe(); + resolve(); + } + }); + }); + } } diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 360a349289..7d95b8b63f 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -1980,16 +1980,16 @@ class StakingGroup extends HelperGroup { * @param signer keyring of signer * @param amountToUnstake amount of tokens to unstake * @param label extra label for log - * @returns + * @returns block number where balances will be unlocked */ - async unstake(signer: TSigner, label?: string): Promise { + async unstake(signer: TSigner, label?: string): Promise { if(typeof label === 'undefined') label = `${signer.address}`; const unstakeResult = await this.helper.executeExtrinsic( signer, 'api.tx.appPromotion.unstake', [], true, ); - // TODO extract info from unstakeResult - return true; + // TODO extract block number fron events + return 1; } async getTotalStaked(address?: ICrossAccountId): Promise { @@ -1997,10 +1997,6 @@ class StakingGroup extends HelperGroup { return (await this.helper.callRpc('api.rpc.appPromotion.totalStaked')).toBigInt(); } - async getTotalStakingLocked(address: ICrossAccountId): Promise { - return (await this.helper.callRpc('api.rpc.appPromotion.totalStakingLocked', [address])).toBigInt(); - } - async getTotalStakedPerBlock(address: ICrossAccountId): Promise { return (await this.helper.callRpc('api.rpc.appPromotion.totalStakedPerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]); } @@ -2447,4 +2443,4 @@ class UniqueRFTToken extends UniqueTokenBase { async burn(signer: TSigner, amount=1n) { return await this.collection.burnToken(signer, this.tokenId, amount); } -} \ No newline at end of file +} From 89c06ef129bd9f9be463c0a11ffd4706ff307b80 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 7 Sep 2022 14:39:26 +0300 Subject: [PATCH 0775/1274] change 127.0.0.1 -> localhost --- tests/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/package.json b/tests/package.json index 47c03eed3c..e2985a4954 100644 --- a/tests/package.json +++ b/tests/package.json @@ -85,7 +85,7 @@ "testRFT": "mocha --timeout 9999999 -r ts-node/register ./**/refungible.test.ts", "testFT": "mocha --timeout 9999999 -r ts-node/register ./**/fungible.test.ts", "testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts", - "polkadot-types-fetch-metadata": "curl -H 'Content-Type: application/json' -d '{\"id\":\"1\", \"jsonrpc\":\"2.0\", \"method\": \"state_getMetadata\", \"params\":[]}' http://127.0.0.1:9933 > src/interfaces/metadata.json", + "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", "polkadot-types-from-defs": "ts-node ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .", "polkadot-types-from-chain": "ts-node ./node_modules/.bin/polkadot-types-from-chain --endpoint src/interfaces/metadata.json --output src/interfaces/ --package .", "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" From 6bf45f651a5271ed82b94ead772e229711a04b31 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 7 Sep 2022 14:40:24 +0300 Subject: [PATCH 0776/1274] remove un-needed file --- .docker/docker-compose.opal.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .docker/docker-compose.opal.yml diff --git a/.docker/docker-compose.opal.yml b/.docker/docker-compose.opal.yml deleted file mode 100644 index 3d47f52c0f..0000000000 --- a/.docker/docker-compose.opal.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: "3.5" - -services: - node-dev: - build: - args: - - "RUST_TOOLCHAIN=nightly-2022-07-24" - - "FEATURE=opal-runtime" - context: ../ - dockerfile: .docker/Dockerfile-chain-dev - expose: - - 9944 - - 9933 - ports: - - 127.0.0.1:9944:9944 - - 127.0.0.1:9933:9933 - logging: - options: - max-size: "1m" - max-file: "3" - command: cargo run --release --features=$FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external - From 6c3625540f0f3f57820342421df8d9e05e823eba Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 7 Sep 2022 12:01:06 +0000 Subject: [PATCH 0777/1274] fix: remove AllowUnpaidExecutionFrom from barrier --- runtime/opal/src/xcm_barrier.rs | 21 +++------------------ runtime/quartz/src/xcm_barrier.rs | 10 ++-------- runtime/unique/src/xcm_barrier.rs | 10 ++-------- 3 files changed, 7 insertions(+), 34 deletions(-) diff --git a/runtime/opal/src/xcm_barrier.rs b/runtime/opal/src/xcm_barrier.rs index 56eff3adfc..7f7edb127c 100644 --- a/runtime/opal/src/xcm_barrier.rs +++ b/runtime/opal/src/xcm_barrier.rs @@ -14,26 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use frame_support::{ - {match_types, weights::Weight}, - traits::Everything, -}; -use xcm::{ - latest::Xcm, - v1::{BodyId, Junction::*, Junctions::*, MultiLocation}, -}; -use xcm_builder::{AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, TakeWeightCredit}; +use frame_support::{weights::Weight, traits::Everything}; +use xcm::{latest::Xcm, v1::MultiLocation}; +use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit}; use xcm_executor::traits::ShouldExecute; use crate::runtime_common::config::xcm::{DenyThenTry, DenyTransact}; -match_types! { - pub type ParentOrParentsUnitPlurality: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) } - }; -} - /// Execution barrier that just takes `max_weight` from `weight_credit`. /// /// Useful to allow XCM execution by local chain users via extrinsics. @@ -56,8 +43,6 @@ pub type Barrier = DenyThenTry< ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, - AllowUnpaidExecutionFrom, - // ^^^ Parent & its unit plurality gets free execution AllowAllDebug, ), >; diff --git a/runtime/quartz/src/xcm_barrier.rs b/runtime/quartz/src/xcm_barrier.rs index d789724d19..3ecfc254a4 100644 --- a/runtime/quartz/src/xcm_barrier.rs +++ b/runtime/quartz/src/xcm_barrier.rs @@ -19,9 +19,9 @@ use frame_support::{ traits::{Get, Everything}, }; use sp_std::{vec, vec::Vec}; -use xcm::v1::{BodyId, Junction::*, Junctions::*, MultiLocation}; +use xcm::v1::{Junction::*, Junctions::*, MultiLocation}; use xcm_builder::{ - AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowUnpaidExecutionFrom, TakeWeightCredit, + AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit, AllowTopLevelPaidExecutionFrom, }; @@ -31,10 +31,6 @@ use crate::{ }; match_types! { - pub type ParentOrParentsExecutivePlurality: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } - }; pub type ParentOrSiblings: impl Contains = { MultiLocation { parents: 1, interior: Here } | MultiLocation { parents: 1, interior: X1(_) } @@ -79,8 +75,6 @@ pub type Barrier = DenyThenTry< ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, - // Parent and its exec plurality get free execution - AllowUnpaidExecutionFrom, // Expected responses are OK. AllowKnownQueryResponses, // Subscriptions for version tracking are OK. diff --git a/runtime/unique/src/xcm_barrier.rs b/runtime/unique/src/xcm_barrier.rs index 36a382a8fa..8fa2d25534 100644 --- a/runtime/unique/src/xcm_barrier.rs +++ b/runtime/unique/src/xcm_barrier.rs @@ -19,9 +19,9 @@ use frame_support::{ traits::{Get, Everything}, }; use sp_std::{vec, vec::Vec}; -use xcm::v1::{BodyId, Junction::*, Junctions::*, MultiLocation}; +use xcm::v1::{Junction::*, Junctions::*, MultiLocation}; use xcm_builder::{ - AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowUnpaidExecutionFrom, TakeWeightCredit, + AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit, AllowTopLevelPaidExecutionFrom, }; @@ -31,10 +31,6 @@ use crate::{ }; match_types! { - pub type ParentOrParentsExecutivePlurality: impl Contains = { - MultiLocation { parents: 1, interior: Here } | - MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } - }; pub type ParentOrSiblings: impl Contains = { MultiLocation { parents: 1, interior: Here } | MultiLocation { parents: 1, interior: X1(_) } @@ -79,8 +75,6 @@ pub type Barrier = DenyThenTry< ( TakeWeightCredit, AllowTopLevelPaidExecutionFrom, - // Parent and its exec plurality get free execution - AllowUnpaidExecutionFrom, // Expected responses are OK. AllowKnownQueryResponses, // Subscriptions for version tracking are OK. From 8c250ff538af82999da1a459237a20ceefc72abe Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Wed, 7 Sep 2022 12:16:10 +0000 Subject: [PATCH 0778/1274] Fix tests: ignore ts error --- tests/src/util/playgrounds/unique.dev.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 130064ee45..e7b3621abd 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -270,6 +270,7 @@ class WaitGroup { return new Promise(async (resolve) => { const unsubscribe = await this.helper.api!.query.parachainSystem.validationData(async (data: any) => { if (data.value.relayParentNumber.toNumber() >= blockNumber) { + // @ts-ignore unsubscribe(); resolve(); } From 95510b917c0645f70a10473d0688da00cdbe0128 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 7 Sep 2022 20:06:39 +0700 Subject: [PATCH 0779/1274] code refactor --- pallets/app-promotion/Cargo.toml | 114 +++++------------------- pallets/app-promotion/src/lib.rs | 42 ++------- pallets/app-promotion/src/types.rs | 4 +- pallets/evm-contract-helpers/src/lib.rs | 2 +- 4 files changed, 34 insertions(+), 128 deletions(-) diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index 82ed3b4479..d264c07184 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -15,7 +15,7 @@ version = '0.1.0' targets = ['x86_64-unknown-linux-gnu'] [features] -default = ['std',] +default = ['std'] runtime-benchmarks = [ 'frame-benchmarking', 'frame-support/runtime-benchmarks', @@ -38,104 +38,36 @@ std = [ 'serde/std', ] - +[dependencies] +scale-info = { version = "2.0.1", default-features = false, features = [ + "derive", +] } ################################################################################ # Substrate Dependencies -[dependencies.codec] -default-features = false -features = ['derive'] -package = 'parity-scale-codec' -version = '3.1.2' - -[dependencies.frame-benchmarking] -default-features = false -optional = true -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" - -[dependencies.frame-support] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" - -[dependencies.frame-system] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" - -[dependencies.pallet-balances] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" - -[dependencies.pallet-timestamp] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" - -[dependencies.pallet-randomness-collective-flip] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" - -[dependencies.sp-std] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" - -[dependencies.serde] -default-features = false -features = ['derive'] -version = '1.0.130' - -[dependencies.sp-runtime] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" - -[dependencies.sp-core] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" - -[dependencies.sp-io] -default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" - -[dependencies.pallet-evm] -default-features = false -git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.27" +codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = '3.1.2' } +frame-benchmarking = {default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-system ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-balances ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-timestamp ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-randomness-collective-flip ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-evm ={ default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +sp-std ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-io ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +serde = { default-features = false, features = ['derive'], version = '1.0.130' } ################################################################################ # local dependencies -[dependencies.up-data-structs] -default-features = false -path = "../../primitives/data-structs" - -[dependencies.pallet-common] -default-features = false -path = "../common" - -[dependencies.pallet-unique] -default-features = false -path = "../unique" -[dependencies.pallet-evm-contract-helpers] -default-features = false -path = "../evm-contract-helpers" +up-data-structs ={ default-features = false, path = "../../primitives/data-structs" } +pallet-common ={ default-features = false, path = "../common" } +pallet-unique ={ default-features = false, path = "../unique" } +pallet-evm-contract-helpers ={ default-features = false, path = "../evm-contract-helpers" } [dev-dependencies] -[dependencies.pallet-evm-migration] -default-features = false -path = "../evm-migration" - +pallet-evm-migration ={ default-features = false, path = "../evm-migration" } ################################################################################ - -[dependencies] -scale-info = { version = "2.0.1", default-features = false, features = [ - "derive", -] } diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 0220a8e7dd..834ade8bad 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -110,10 +110,6 @@ pub mod pallet { #[pallet::constant] type PendingInterval: Get; - // /// In chain blocks. - // #[pallet::constant] - // type Day: Get; // useless - #[pallet::constant] type Nominal: Get>; @@ -160,7 +156,7 @@ pub mod pallet { NotSufficientFunds, PendingForBlockOverflow, /// An error related to the fact that an invalid argument was passed to perform an action - InvalidArgument, + SponsorNotSet, } #[pallet::storage] @@ -184,16 +180,6 @@ pub mod pallet { pub type StakesPerAccount = StorageMap<_, Blake2_128Concat, T::AccountId, u8, ValueQuery>; - /// Amount of tokens pending unstake per user per block. - // #[pallet::storage] - // pub type PendingUnstake = StorageNMap< - // Key = ( - // Key, - // Key, - // ), - // Value = BalanceOf, - // QueryKind = ValueQuery, - // >; #[pallet::storage] pub type PendingUnstake = StorageMap< _, @@ -203,16 +189,6 @@ pub mod pallet { ValueQuery, >; - // /// A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`. - // #[pallet::storage] - // pub type StartBlock = StorageValue; - - // /// Next target block when interest is recalculated - // #[pallet::storage] - // #[pallet::getter(fn get_interest_block)] - // pub type NextInterestBlock = - // StorageValue; - /// Stores hash a record for which the last revenue recalculation was performed. /// If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers. #[pallet::storage] @@ -228,7 +204,6 @@ pub mod pallet { { let block_pending = PendingUnstake::::take(current_block_number); let counter = block_pending.len() as u32; - // add_weight(0, 1, 0); if !block_pending.is_empty() { block_pending.into_iter().for_each(|(staker, amount)| { @@ -393,7 +368,7 @@ pub mod pallet { ); ensure!( - T::CollectionHandler::sponsor(collection_id)?.ok_or(>::InvalidArgument)? + T::CollectionHandler::sponsor(collection_id)?.ok_or(>::SponsorNotSet)? == Self::account_id(), >::NoPermission ); @@ -425,7 +400,7 @@ pub mod pallet { ); ensure!( - T::ContractHandler::sponsor(contract_id)?.ok_or(>::InvalidArgument)? + T::ContractHandler::sponsor(contract_id)?.ok_or(>::SponsorNotSet)? == T::CrossAccountId::from_sub(Self::account_id()), >::NoPermission ); @@ -712,14 +687,13 @@ impl Pallet { staker.map_or(Some(>::get()), |s| { Self::total_staked_by_id(s.as_sub()) }) - // Self::total_staked_by_id(staker.as_sub()) } - pub fn cross_id_locked_balance(staker: T::CrossAccountId) -> BalanceOf { - Self::get_locked_balance(staker.as_sub()) - .map(|l| l.amount) - .unwrap_or_default() - } + // pub fn cross_id_locked_balance(staker: T::CrossAccountId) -> BalanceOf { + // Self::get_locked_balance(staker.as_sub()) + // .map(|l| l.amount) + // .unwrap_or_default() + // } pub fn cross_id_total_staked_per_block( staker: T::CrossAccountId, diff --git a/pallets/app-promotion/src/types.rs b/pallets/app-promotion/src/types.rs index 5da8ab8eb0..3ee316d000 100644 --- a/pallets/app-promotion/src/types.rs +++ b/pallets/app-promotion/src/types.rs @@ -5,9 +5,9 @@ use pallet_balances::{BalanceLock, Config as BalancesConfig, Pallet as PalletBal use pallet_common::CollectionHandle; use sp_runtime::DispatchError; -use up_data_structs::{CollectionId, SponsorshipState}; +use up_data_structs::{CollectionId}; use sp_std::borrow::ToOwned; -use pallet_evm_contract_helpers::{Pallet as EvmHelpersPallet, Config as EvmHelpersConfig, Sponsoring}; +use pallet_evm_contract_helpers::{Pallet as EvmHelpersPallet, Config as EvmHelpersConfig}; pub trait ExtendedLockableCurrency: LockableCurrency { fn locks(who: KArg) -> WeakBoundedVec, Self::MaxLocks> diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index e2347bcaf8..dffc1a45c3 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -81,7 +81,7 @@ pub mod pallet { /// * **Key** - contract address. /// * **Value** - sponsorship state. #[pallet::storage] - pub type Sponsoring = StorageMap< + pub(super) type Sponsoring = StorageMap< Hasher = Twox64Concat, Key = H160, Value = SponsorshipState, From 4bcecc1a2d37d9d4badddc75d73a83ba69dad74e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 7 Sep 2022 16:09:59 +0300 Subject: [PATCH 0780/1274] tests: add autogenerate JS types before start tests --- .github/workflows/dev-build-tests_v2.yml | 4 +++- .github/workflows/node-only-update_v2.yml | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev-build-tests_v2.yml b/.github/workflows/dev-build-tests_v2.yml index 0719488e57..64f41b390c 100644 --- a/.github/workflows/dev-build-tests_v2.yml +++ b/.github/workflows/dev-build-tests_v2.yml @@ -70,11 +70,13 @@ jobs: node-version: 16 - name: Run tests + working-directory: tests run: | - cd tests yarn install yarn add mochawesome + node scripts/readyness.js echo "Ready to start tests" + yarn polkadot-types NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index c3cfd4c4ed..09836dc5af 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -161,7 +161,9 @@ jobs: run: | yarn install yarn add mochawesome + node scripts/readyness.js echo "Ready to start tests" + yarn polkadot-types NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ @@ -236,7 +238,9 @@ jobs: run: | yarn install yarn add mochawesome + node scripts/readyness.js echo "Ready to start tests" + yarn polkadot-types NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ From 2c288b082d41376c94e7dc7e663560af7459b542 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 7 Sep 2022 13:32:46 +0000 Subject: [PATCH 0781/1274] fix(tests): keyring/logs/decimals parsing/comments --- tests/src/util/helpers.ts | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index c30d40f6fa..d3f3bb02cb 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -108,7 +108,7 @@ export function bigIntToDecimals(number: bigint, decimals = 18): string { const dotPos = numberStr.length - decimals; if (dotPos <= 0) { - return '0.' + numberStr; + return '0.' + '0'.repeat(Math.abs(dotPos)) + numberStr; } else { const intPart = numberStr.substring(0, dotPos); const fractPart = numberStr.substring(dotPos); @@ -1115,7 +1115,10 @@ getFreeBalance(account: IKeyringPair): Promise { export async function paraSiblingSovereignAccount(paraid: number): Promise { return usingApi(async api => { + // We are getting a *sibling* parachain sovereign account, + // so we need a sibling prefix: encoded(b"sibl") == 0x7369626c const siblingPrefix = '0x7369626c'; + const encodedParaId = api.createType('u32', paraid).toHex(true).substring(2); const suffix = '000000000000000000000000000000000000000000000000'; @@ -1805,8 +1808,6 @@ export async function waitEvent( }); if (neededEvent) { - console.log(`Event \`${eventIdStr}\` is found`); - unsubscribe(); resolve(neededEvent); } else if (maxBlocksToWait > 0) { @@ -1852,16 +1853,7 @@ itApi.skip = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (ac let accountSeed = 10000; -const keyringEth = new Keyring({type: 'ethereum'}); -const keyringEd25519 = new Keyring({type: 'ed25519'}); -const keyringSr25519 = new Keyring({type: 'sr25519'}); - -export function generateKeyringPair(type: 'ethereum' | 'sr25519' | 'ed25519' = 'sr25519') { +export function generateKeyringPair(keyring: Keyring) { const privateKey = `0xDEADBEEF${(accountSeed++).toString(16).padStart(56, '0')}`; - if (type == 'sr25519') { - return keyringSr25519.addFromUri(privateKey); - } else if (type == 'ed25519') { - return keyringEd25519.addFromUri(privateKey); - } - return keyringEth.addFromUri(privateKey); + return keyring.addFromUri(privateKey); } From e379082d34c2ea8c291f9ee964cea18c7f3c7b6f Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 7 Sep 2022 13:34:30 +0000 Subject: [PATCH 0782/1274] fix(xcm-tests): use executeTransaction --- tests/src/xcm/xcmOpal.test.ts | 22 +++++++++++----------- tests/src/xcm/xcmQuartz.test.ts | 11 ++++++++--- tests/src/xcm/xcmUnique.test.ts | 11 ++++++++--- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/tests/src/xcm/xcmOpal.test.ts b/tests/src/xcm/xcmOpal.test.ts index bab3ce77bb..d8765a5939 100644 --- a/tests/src/xcm/xcmOpal.test.ts +++ b/tests/src/xcm/xcmOpal.test.ts @@ -20,7 +20,7 @@ import chaiAsPromised from 'chai-as-promised'; import {WsProvider} from '@polkadot/api'; import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; -import usingApi, {submitTransactionAsync} from './../substrate/substrate-api'; +import usingApi, {executeTransaction} from './../substrate/substrate-api'; import {bigIntToDecimals, describe_xcm, getGenericResult, paraSiblingSovereignAccount} from './../util/helpers'; import waitNewBlocks from './../substrate/wait-new-blocks'; import {normalizeAccountId} from './../util/helpers'; @@ -93,26 +93,26 @@ describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { const fundingAmount = 3_500_000_000_000; const tx = api.tx.assets.create(ASSET_ID, alice.addressRaw, ASSET_METADATA_MINIMAL_BALANCE); - const events = await submitTransactionAsync(alice, tx); + const events = await executeTransaction(api, alice, tx); const result = getGenericResult(events); expect(result.success).to.be.true; // set metadata const tx2 = api.tx.assets.setMetadata(ASSET_ID, ASSET_METADATA_NAME, ASSET_METADATA_DESCRIPTION, ASSET_METADATA_DECIMALS); - const events2 = await submitTransactionAsync(alice, tx2); + const events2 = await executeTransaction(api, alice, tx2); const result2 = getGenericResult(events2); expect(result2.success).to.be.true; // mint some amount of asset const tx3 = api.tx.assets.mint(ASSET_ID, alice.addressRaw, ASSET_AMOUNT); - const events3 = await submitTransactionAsync(alice, tx3); + const events3 = await executeTransaction(api, alice, tx3); const result3 = getGenericResult(events3); expect(result3.success).to.be.true; // funding parachain sovereing account (Parachain: 2095) const parachainSovereingAccount = await paraSiblingSovereignAccount(UNIQUE_CHAIN); const tx4 = api.tx.balances.transfer(parachainSovereingAccount, fundingAmount); - const events4 = await submitTransactionAsync(bob, tx4); + const events4 = await executeTransaction(api, bob, tx4); const result4 = getGenericResult(events4); expect(result4.success).to.be.true; @@ -148,7 +148,7 @@ describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { //registerForeignAsset(owner, location, metadata) const tx = api.tx.foreignAssets.registerForeignAsset(alice.addressRaw, location, metadata); const sudoTx = api.tx.sudo.sudo(tx as any); - const events = await submitTransactionAsync(alice, sudoTx); + const events = await executeTransaction(api, alice, sudoTx); const result = getGenericResult(events); expect(result.success).to.be.true; @@ -203,7 +203,7 @@ describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { }; const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); - const events = await submitTransactionAsync(alice, tx); + const events = await executeTransaction(api, alice, tx); const result = getGenericResult(events); expect(result.success).to.be.true; }, relayApiOptions); @@ -276,7 +276,7 @@ describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { [balanceStmnBefore] = await getBalance(api, [alice.address]); const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(dest, beneficiary, assets, feeAssetItem, weightLimit); - const events = await submitTransactionAsync(alice, tx); + const events = await executeTransaction(api, alice, tx); const result = getGenericResult(events); expect(result.success).to.be.true; @@ -365,7 +365,7 @@ describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { const destWeight = 500000000000; const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight); - const events = await submitTransactionAsync(alice, tx); + const events = await executeTransaction(api, alice, tx); const result = getGenericResult(events); expect(result.success).to.be.true; @@ -452,7 +452,7 @@ describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { }; const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); - const events = await submitTransactionAsync(bob, tx); + const events = await executeTransaction(api, bob, tx); const result = getGenericResult(events); expect(result.success).to.be.true; }, relayApiOptions); @@ -514,7 +514,7 @@ describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { const destWeight = 500000000000; const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight); - const events = await submitTransactionAsync(bob, tx); + const events = await executeTransaction(api, bob, tx); const result = getGenericResult(events); expect(result.success).to.be.true; diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index 98df8f3797..972fea2d44 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -77,8 +77,10 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { before(async () => { await usingApi(async (api, privateKeyWrapper) => { + const keyringSr25519 = new Keyring({type: 'sr25519'}); + alice = privateKeyWrapper('//Alice'); - randomAccount = generateKeyringPair(); + randomAccount = generateKeyringPair(keyringSr25519); }); // Karura side @@ -477,9 +479,12 @@ describe_xcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { before(async () => { await usingApi(async (api, privateKeyWrapper) => { + const keyringEth = new Keyring({type: 'ethereum'}); + const keyringSr25519 = new Keyring({type: 'sr25519'}); + quartzAlice = privateKeyWrapper('//Alice'); - randomAccountQuartz = generateKeyringPair(); - randomAccountMoonriver = generateKeyringPair('ethereum'); + randomAccountQuartz = generateKeyringPair(keyringSr25519); + randomAccountMoonriver = generateKeyringPair(keyringEth); balanceForeignQtzTokenInit = 0n; }); diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index e85e599329..b86bf08b2b 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -77,8 +77,10 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { before(async () => { await usingApi(async (api, privateKeyWrapper) => { + const keyringSr25519 = new Keyring({type: 'sr25519'}); + alice = privateKeyWrapper('//Alice'); - randomAccount = generateKeyringPair(); + randomAccount = generateKeyringPair(keyringSr25519); }); // Acala side @@ -477,9 +479,12 @@ describe_xcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { before(async () => { await usingApi(async (api, privateKeyWrapper) => { + const keyringEth = new Keyring({type: 'ethereum'}); + const keyringSr25519 = new Keyring({type: 'sr25519'}); + uniqueAlice = privateKeyWrapper('//Alice'); - randomAccountUnique = generateKeyringPair(); - randomAccountMoonbeam = generateKeyringPair('ethereum'); + randomAccountUnique = generateKeyringPair(keyringSr25519); + randomAccountMoonbeam = generateKeyringPair(keyringEth); balanceForeignUnqTokenInit = 0n; }); From 0a696c21cbc28b53bb4f7fe48e14551bec10dea9 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 7 Sep 2022 13:43:14 +0000 Subject: [PATCH 0783/1274] fix: remove 'transactional' from foreign-assets --- pallets/foreign-assets/src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pallets/foreign-assets/src/lib.rs b/pallets/foreign-assets/src/lib.rs index dfbb519adb..8212740535 100644 --- a/pallets/foreign-assets/src/lib.rs +++ b/pallets/foreign-assets/src/lib.rs @@ -39,7 +39,7 @@ use frame_support::{ ensure, pallet_prelude::*, traits::{fungible, fungibles, Currency, EnsureOrigin}, - transactional, RuntimeDebug, + RuntimeDebug, }; use frame_system::pallet_prelude::*; use up_data_structs::{CollectionMode}; @@ -281,7 +281,6 @@ pub mod module { #[pallet::call] impl Pallet { #[pallet::weight(::WeightInfo::register_foreign_asset())] - #[transactional] pub fn register_foreign_asset( origin: OriginFor, owner: T::AccountId, @@ -324,7 +323,6 @@ pub mod module { } #[pallet::weight(::WeightInfo::update_foreign_asset())] - #[transactional] pub fn update_foreign_asset( origin: OriginFor, foreign_asset_id: ForeignAssetId, From 4654b7c7fee5530fa48ffcc7f806f1b650e994e1 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 7 Sep 2022 13:56:08 +0000 Subject: [PATCH 0784/1274] fix(foreign-assets): use map_err --- pallets/foreign-assets/src/impl_fungibles.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pallets/foreign-assets/src/impl_fungibles.rs b/pallets/foreign-assets/src/impl_fungibles.rs index 8d83863d3f..ac84979544 100644 --- a/pallets/foreign-assets/src/impl_fungibles.rs +++ b/pallets/foreign-assets/src/impl_fungibles.rs @@ -461,14 +461,10 @@ where match asset { AssetIds::NativeAssetId(NativeCurrency::Here) => { - let this_amount: ::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => { - return Err(DispatchError::Other( - "Bad amount to this parachain value conversion", - )) - } - }; + let this_amount: ::Balance = + value.try_into().map_err(|_| { + DispatchError::Other("Bad amount to this parachain value conversion") + })?; match as fungible::Mutate>::burn_from( who, From 179c572db75bc0e14a373faca359073883b4ff63 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 7 Sep 2022 13:56:27 +0000 Subject: [PATCH 0785/1274] fix(foreign-assets): formatting --- pallets/foreign-assets/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pallets/foreign-assets/src/lib.rs b/pallets/foreign-assets/src/lib.rs index 8212740535..7617b40115 100644 --- a/pallets/foreign-assets/src/lib.rs +++ b/pallets/foreign-assets/src/lib.rs @@ -482,12 +482,12 @@ impl< } } impl< - WeightToFee: WeightToFeePolynomial, - AssetId: Get, - AccountId, - Currency: CurrencyT, - OnUnbalanced: OnUnbalancedT, - > Drop for FreeForAll + WeightToFee: WeightToFeePolynomial, + AssetId: Get, + AccountId, + Currency: CurrencyT, + OnUnbalanced: OnUnbalancedT, +> Drop for FreeForAll { fn drop(&mut self) { OnUnbalanced::on_unbalanced(Currency::issue(self.1)); From c5483212115f468c61c3a2209fc7739817a10602 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 7 Sep 2022 13:56:48 +0000 Subject: [PATCH 0786/1274] fix(xcm): use is_some in transact barrier --- runtime/common/config/xcm/mod.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/runtime/common/config/xcm/mod.rs b/runtime/common/config/xcm/mod.rs index a922ef5bbe..21faa1ec38 100644 --- a/runtime/common/config/xcm/mod.rs +++ b/runtime/common/config/xcm/mod.rs @@ -135,16 +135,15 @@ impl TryPass for DenyTransact { .iter() .find(|inst| matches![inst, Instruction::Transact { .. }]); - match transact_inst { - Some(_) => { - log::warn!( - target: "xcm::barrier", - "transact XCM rejected" - ); - - Err(()) - } - None => Ok(()), + if transact_inst.is_some() { + log::warn!( + target: "xcm::barrier", + "transact XCM rejected" + ); + + Err(()) + } else { + Ok(()) } } } From 10a3e17b41ca3ceedea20bc2114cc161d7e95495 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 7 Sep 2022 13:57:13 +0000 Subject: [PATCH 0787/1274] fix: remove unneeded comment from construct_runtime --- runtime/common/construct_runtime/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/common/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs index c330a402a5..8da85a9927 100644 --- a/runtime/common/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -45,7 +45,6 @@ macro_rules! construct_runtime { XTokens: orml_xtokens = 38, Tokens: orml_tokens = 39, - // Vesting: pallet_vesting::{Pallet, Call, Config, Storage, Event} = 37, // Contracts: pallet_contracts::{Pallet, Call, Storage, Event} = 38, // XCM helpers. From 46304da0336fd1c914dcb5504a033ba410d359a6 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 7 Sep 2022 13:57:53 +0000 Subject: [PATCH 0788/1274] fix: close connection is finally clause --- tests/scripts/readyness.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/scripts/readyness.js b/tests/scripts/readyness.js index a448def651..27e0f1c4d7 100644 --- a/tests/scripts/readyness.js +++ b/tests/scripts/readyness.js @@ -1,21 +1,23 @@ const { ApiPromise, WsProvider } = require('@polkadot/api'); const connect = async () => { - const wsEndpoint = 'ws://127.0.0.1:9944' + const wsEndpoint = 'ws://127.0.0.1:9944'; const api = new ApiPromise({provider: new WsProvider(wsEndpoint)}); await api.isReadyOrError; - const head = (await api.rpc.chain.getHeader()).number.toNumber(); - await api.disconnect(); - if(head < 1) throw Error('No block #1'); - -} + try { + const head = (await api.rpc.chain.getHeader()).number.toNumber(); + if(head < 1) throw Error('No block #1'); + } finally { + await api.disconnect(); + } +}; const sleep = time => { - return new Promise(resolve => { - setTimeout(() => resolve(), time); - }); -} + return new Promise(resolve => { + setTimeout(() => resolve(), time); + }); +}; const main = async () => { while(true) { From fd44216cfcd66ba49c1b3d7e25941c450e61856c Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 7 Sep 2022 17:23:37 +0300 Subject: [PATCH 0789/1274] approve migrated --- tests/src/approve.test.ts | 638 +++++++++++++++++++++++--------------- 1 file changed, 394 insertions(+), 244 deletions(-) diff --git a/tests/src/approve.test.ts b/tests/src/approve.test.ts index 12af29d023..e95e84f65d 100644 --- a/tests/src/approve.test.ts +++ b/tests/src/approve.test.ts @@ -35,8 +35,18 @@ import { requirePallets, Pallets, } from './util/helpers'; +import { usingPlaygrounds } from './util/playgrounds'; + +let donor: IKeyringPair; + +before(async () => { + await usingPlaygrounds(async (_, privateKeyWrapper) => { + donor = privateKeyWrapper('//Alice'); + }); +}); chai.use(chaiAsPromised); +const expect = chai.expect; describe('Integration Test approve(spender, collection_id, item_id, amount):', () => { let alice: IKeyringPair; @@ -44,63 +54,88 @@ describe('Integration Test approve(spender, collection_id, item_id, amount):', ( let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); it('[nft] Execute the extrinsic and check approvedList', async () => { - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true; + }); }); it('[fungible] Execute the extrinsic and check approvedList', async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, alice.address, 10n); + const tokenId = await helper.ft.getLastTokenId(collectionId); + await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + const amount = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amount).to.be.equal(BigInt(1)); + }); }); it('[refungible] Execute the extrinsic and check approvedList', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const reFungibleCollectionId = - await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); + await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + const amount = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amount).to.be.equal(BigInt(100)); + }); }); it('[nft] Remove approval by using 0 amount', async () => { - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address, 1); - await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address, 0); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true; + await helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0).signAndSend(alice); + expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.false; + }); }); it('[fungible] Remove approval by using 0 amount', async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address, 1); - await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address, 0); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, alice.address, 10n); + const tokenId = await helper.ft.getLastTokenId(collectionId); + await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + const amountBefore = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountBefore).to.be.equal(BigInt(1)); + + await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 0n); + const amountAfter = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountAfter).to.be.equal(BigInt(0)); + }); }); it('[refungible] Remove approval by using 0 amount', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const reFungibleCollectionId = - await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 1); - await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 0); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); + await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + const amountBefore = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountBefore).to.be.equal(BigInt(100)); + + await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 0n); + const amountAfter = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountAfter).to.be.equal(BigInt(0)); + }); }); it('can`t be called by collection owner on non-owned item when OwnerCanTransfer == false', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address); - - await adminApproveFromExpectFail(collectionId, itemId, alice, bob.address, charlie.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + const approveTokenTx = async () => helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + await expect(approveTokenTx()).to.be.rejected; + }); }); }); @@ -110,31 +145,39 @@ describe('Normal user can approve other users to transfer:', () => { let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); - }); + }); it('NFT', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address); - await approveExpectSuccess(collectionId, itemId, bob, charlie.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + await helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: charlie.address})).to.be.true; + }); }); it('Fungible up to an approved amount', async () => { - const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}}); - const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', bob.address); - await approveExpectSuccess(collectionId, itemId, bob, charlie.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, bob.address, 10n); + const tokenId = await helper.ft.getLastTokenId(collectionId); + await helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + const amount = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: charlie.address}, {Substrate: bob.address}); + expect(amount).to.be.equal(BigInt(1)); + }); }); it('ReFungible up to an approved amount', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}}); - const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', bob.address); - await approveExpectSuccess(collectionId, itemId, bob, charlie.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: bob.address, pieces: 100n}); + await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + const amount = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: charlie.address}, {Substrate: bob.address}); + expect(amount).to.be.equal(BigInt(100)); + }); }); }); @@ -144,34 +187,45 @@ describe('Approved users can transferFrom up to approved amount:', () => { let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); - }); + }); it('NFT', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address); - await approveExpectSuccess(collectionId, itemId, bob, charlie.address); - await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'NFT'); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + await helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + await helper.nft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(alice.address); + }); }); it('Fungible up to an approved amount', async () => { - const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}}); - const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', bob.address); - await approveExpectSuccess(collectionId, itemId, bob, charlie.address); - await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'Fungible'); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, bob.address, 10n); + const tokenId = await helper.ft.getLastTokenId(collectionId); + await helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + const before = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); + await helper.ft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 1n); + const after = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); + expect(after - before).to.be.equal(BigInt(1)); + }); }); it('ReFungible up to an approved amount', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}}); - const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', bob.address); - await approveExpectSuccess(collectionId, itemId, bob, charlie.address); - await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'ReFungible'); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: bob.address, pieces: 100n}); + await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + const before = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); + await helper.rft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 1n); + const after = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); + expect(after - before).to.be.equal(BigInt(1)); + }); }); }); @@ -181,37 +235,52 @@ describe('Approved users cannot use transferFrom to repeat transfers if approved let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); - }); + }); it('NFT', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address); - await approveExpectSuccess(collectionId, itemId, bob, charlie.address); - await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'NFT'); - await transferFromExpectFail(collectionId, itemId, charlie, bob, alice, 1); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + await helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + await helper.nft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(alice.address); + const transferTokenFromTx = async () => helper.nft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + await expect(transferTokenFromTx()).to.be.rejected; + }); }); it('Fungible up to an approved amount', async () => { - const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}}); - const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', bob.address); - await approveExpectSuccess(collectionId, itemId, bob, charlie.address); - await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'Fungible'); - await transferFromExpectFail(collectionId, itemId, charlie, bob, alice, 1); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, bob.address, 10n); + const tokenId = await helper.ft.getLastTokenId(collectionId); + await helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + const before = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); + await helper.ft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 1n); + const after = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); + expect(after - before).to.be.equal(BigInt(1)); + + const transferTokenFromTx = async () => helper.ft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 1n); + await expect(transferTokenFromTx()).to.be.rejected; + }); }); it('ReFungible up to an approved amount', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}}); - const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', bob.address); - await approveExpectSuccess(collectionId, itemId, bob, charlie.address); - await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'ReFungible'); - await transferFromExpectFail(collectionId, itemId, charlie, bob, alice, 1); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: bob.address, pieces: 100n}); + await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + const before = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); + await helper.rft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 100n); + const after = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); + expect(after - before).to.be.equal(BigInt(100)); + const transferTokenFromTx = async () => helper.rft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 100n); + await expect(transferTokenFromTx()).to.be.rejected; + }); }); }); @@ -222,20 +291,28 @@ describe('Approved amount decreases by the transferred amount.:', () => { let dave: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); - dave = privateKeyWrapper('//Dave'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie, dave] = await helper.arrange.createAccounts([100n, 100n, 100n, 100n], donor); }); - }); + }); it('If a user B is approved to transfer 10 Fungible tokens from user A, they can transfer 2 tokens to user C, which will result in decreasing approval from 10 to 8. Then user B can transfer 8 tokens to user D.', async () => { - const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}}); - const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', alice.address); - await approveExpectSuccess(collectionId, itemId, alice, bob.address, 10); - await transferFromExpectSuccess(collectionId, itemId, bob, alice, charlie, 2, 'Fungible'); - await transferFromExpectSuccess(collectionId, itemId, bob, alice, dave, 8, 'Fungible'); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, alice.address, 10n); + const tokenId = await helper.ft.getLastTokenId(collectionId); + await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 10n); + + const charlieBefore = await helper.ft.getBalance(collectionId, {Substrate: charlie.address}); + await helper.ft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address}, 2n); + const charlieAfter = await helper.ft.getBalance(collectionId, {Substrate: charlie.address}); + expect(charlieAfter - charlieBefore).to.be.equal(BigInt(2)); + + const daveBefore = await helper.ft.getBalance(collectionId, {Substrate: dave.address}); + await helper.ft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: alice.address}, {Substrate: dave.address}, 8n); + const daveAfter = await helper.ft.getBalance(collectionId, {Substrate: dave.address}); + expect(daveAfter - daveBefore).to.be.equal(BigInt(8)); + }); }); }); @@ -245,38 +322,57 @@ describe('User may clear the approvals to approving for 0 amount:', () => { let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); it('NFT', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT'); - await approveExpectSuccess(collectionId, itemId, alice, bob.address, 1); - await approveExpectSuccess(collectionId, itemId, alice, bob.address, 0); - await transferFromExpectFail(collectionId, itemId, bob, bob, charlie, 1); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true; + await helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0).signAndSend(alice); + expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.false; + const transferTokenFromTx = async () => helper.nft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: bob.address}, {Substrate: bob.address}); + await expect(transferTokenFromTx()).to.be.rejected; + }); }); it('Fungible', async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address, 1); - await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address, 0); - await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, bob, charlie, 1); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, alice.address, 10n); + const tokenId = await helper.ft.getLastTokenId(collectionId); + await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + const amountBefore = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountBefore).to.be.equal(BigInt(1)); + + await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 0n); + const amountAfter = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountAfter).to.be.equal(BigInt(0)); + + const transferTokenFromTx = async () => helper.ft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: bob.address}, {Substrate: charlie.address}, 1n); + await expect(transferTokenFromTx()).to.be.rejected; + }); }); it('ReFungible', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const reFungibleCollectionId = - await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 1); - await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 0); - await transferFromExpectFail(reFungibleCollectionId, newReFungibleTokenId, bob, bob, charlie, 1); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); + await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + const amountBefore = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountBefore).to.be.equal(BigInt(100)); + + await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 0n); + const amountAfter = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountAfter).to.be.equal(BigInt(0)); + + const transferTokenFromTx = async () => helper.rft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: bob.address}, {Substrate: charlie.address}, 100n); + await expect(transferTokenFromTx()).to.be.rejected; + }); }); }); @@ -286,31 +382,37 @@ describe('User cannot approve for the amount greater than they own:', () => { let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); it('1 for NFT', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address); - await approveExpectFail(collectionId, itemId, bob, charlie, 2); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + await helper.api?.tx.unique.approve({Substrate: charlie.address}, collectionId, tokenId, 2).signAndSend(bob); + expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: charlie.address})).to.be.false; + }); }); it('Fungible', async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await approveExpectFail(fungibleCollectionId, newFungibleTokenId, bob, charlie, 11); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, alice.address, 10n); + const tokenId = await helper.ft.getLastTokenId(collectionId); + const approveTx = async () => helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 11n); + await expect(approveTx()).to.be.rejected; + }); }); it('ReFungible', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await approveExpectFail(reFungibleCollectionId, newReFungibleTokenId, bob, charlie, 101); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); + const approveTx = async () => helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 101n); + await expect(approveTx()).to.be.rejected; + }); }); }); @@ -321,41 +423,67 @@ describe('Administrator and collection owner do not need approval in order to ex let dave: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); - dave = privateKeyWrapper('//Dave'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie, dave] = await helper.arrange.createAccounts([100n, 100n, 100n, 100n], donor); }); - }); + }); it('NFT', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true}); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', charlie.address); - await transferFromExpectSuccess(collectionId, itemId, alice, charlie, dave, 1, 'NFT'); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await transferFromExpectSuccess(collectionId, itemId, bob, dave, alice, 1, 'NFT'); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: charlie.address}); + + await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: charlie.address}, {Substrate: dave.address}); + const owner1 = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner1.Substrate).to.be.equal(dave.address); + + await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); + await helper.nft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: dave.address}, {Substrate: alice.address}); + const owner2 = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner2.Substrate).to.be.equal(alice.address); + }); }); it('Fungible up to an approved amount', async () => { - const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true}); - const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', charlie.address); - await transferFromExpectSuccess(collectionId, itemId, alice, charlie, dave, 1, 'Fungible'); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await transferFromExpectSuccess(collectionId, itemId, bob, dave, alice, 1, 'Fungible'); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); + await helper.ft.mintTokens(alice, collectionId, charlie.address, 10n); + const tokenId = await helper.ft.getLastTokenId(collectionId); + + const daveBalanceBefore = await helper.ft.getBalance(collectionId, {Substrate: dave.address}); + await helper.ft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: charlie.address}, {Substrate: dave.address}, 1n); + const daveBalanceAfter = await helper.ft.getBalance(collectionId, {Substrate: dave.address}); + expect(daveBalanceAfter - daveBalanceBefore).to.be.equal(BigInt(1)); + + await helper.collection.addAdmin(alice ,collectionId, {Substrate: bob.address}); + + const aliceBalanceBefore = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); + await helper.ft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: dave.address}, {Substrate: alice.address}, 1n); + const aliceBalanceAfter = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); + expect(aliceBalanceAfter - aliceBalanceBefore).to.be.equal(BigInt(1)); + }); }); it('ReFungible up to an approved amount', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true}); - const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', charlie.address); - await transferFromExpectSuccess(collectionId, itemId, alice, charlie, dave, 1, 'ReFungible'); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await transferFromExpectSuccess(collectionId, itemId, bob, dave, alice, 1, 'ReFungible'); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: charlie.address, pieces: 100n}); + + const daveBefore = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: dave.address}); + await helper.rft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: charlie.address}, {Substrate: dave.address}, 1n); + const daveAfter = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: dave.address}); + expect(daveAfter - daveBefore).to.be.equal(BigInt(1)); + + await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); + + const aliceBefore = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); + await helper.rft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: dave.address}, {Substrate: alice.address}, 1n); + const aliceAfter = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); + expect(aliceAfter - aliceBefore).to.be.equal(BigInt(1)); + }); }); }); @@ -366,13 +494,10 @@ describe('Repeated approvals add up', () => { let dave: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); - dave = privateKeyWrapper('//Dave'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie, dave] = await helper.arrange.createAccounts([100n, 100n, 100n, 100n], donor); }); - }); + }); it.skip('Owned 10, approval 1: 1, approval 2: 1, resulting approved value: 2. Fungible', async () => { const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}}); @@ -417,19 +542,19 @@ describe('Integration Test approve(spender, collection_id, item_id, amount) with let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); it('can be called by collection admin on non-owned item', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address); - - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await adminApproveFromExpectFail(collectionId, itemId, bob, alice.address, charlie.address); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); + const approveTx = async () => helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + await expect(approveTx()).to.be.rejected; + }); }); }); @@ -439,114 +564,139 @@ describe('Negative Integration Test approve(spender, collection_id, item_id, amo let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); it('[nft] Approve for a collection that does not exist', async () => { - await usingApi(async (api: ApiPromise) => { - const nftCollectionCount = await getCreatedCollectionCount(api); - await approveExpectFail(nftCollectionCount + 1, 1, alice, bob); + await usingPlaygrounds(async (helper) => { + const collectionId = 1 << 32 - 1; + const approveTx = async () => helper.nft.approveToken(bob, collectionId, 1, {Substrate: charlie.address}); + await expect(approveTx()).to.be.rejected; }); }); it('[fungible] Approve for a collection that does not exist', async () => { - await usingApi(async (api: ApiPromise) => { - const fungibleCollectionCount = await getCreatedCollectionCount(api); - await approveExpectFail(fungibleCollectionCount + 1, 0, alice, bob); + await usingPlaygrounds(async (helper) => { + const collectionId = 1 << 32 - 1; + const approveTx = async () => helper.ft.approveToken(bob, collectionId, 1, {Substrate: charlie.address}); + await expect(approveTx()).to.be.rejected; }); }); it('[refungible] Approve for a collection that does not exist', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await usingApi(async (api: ApiPromise) => { - const reFungibleCollectionCount = await getCreatedCollectionCount(api); - await approveExpectFail(reFungibleCollectionCount + 1, 1, alice, bob); + await usingPlaygrounds(async (helper) => { + const collectionId = 1 << 32 - 1; + const approveTx = async () => helper.rft.approveToken(bob, collectionId, 1, {Substrate: charlie.address}); + await expect(approveTx()).to.be.rejected; }); }); it('[nft] Approve for a collection that was destroyed', async () => { - const nftCollectionId = await createCollectionExpectSuccess(); - await destroyCollectionExpectSuccess(nftCollectionId); - await approveExpectFail(nftCollectionId, 1, alice, bob); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.burn(alice, collectionId); + const approveTx = async () => helper.nft.approveToken(alice, collectionId, 1, {Substrate: bob.address}); + await expect(approveTx()).to.be.rejected; + }); }); - it('Approve for a collection that was destroyed', async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - await destroyCollectionExpectSuccess(fungibleCollectionId); - await approveExpectFail(fungibleCollectionId, 0, alice, bob); + it('[fungible] Approve for a collection that was destroyed', async () => { + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.ft.burn(alice, collectionId); + const approveTx = async () => helper.ft.approveToken(alice, collectionId, 1, {Substrate: bob.address}); + await expect(approveTx()).to.be.rejected; + }); }); it('[refungible] Approve for a collection that was destroyed', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const reFungibleCollectionId = - await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await destroyCollectionExpectSuccess(reFungibleCollectionId); - await approveExpectFail(reFungibleCollectionId, 1, alice, bob); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.rft.burn(alice, collectionId); + const approveTx = async () => helper.rft.approveToken(alice, collectionId, 1, {Substrate: bob.address}); + await expect(approveTx()).to.be.rejected; + }); }); it('[nft] Approve transfer of a token that does not exist', async () => { - const nftCollectionId = await createCollectionExpectSuccess(); - await approveExpectFail(nftCollectionId, 2, alice, bob); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const approveTx = async () => helper.nft.approveToken(alice, collectionId, 2, {Substrate: bob.address}); + await expect(approveTx()).to.be.rejected; + }); }); it('[refungible] Approve transfer of a token that does not exist', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const reFungibleCollectionId = - await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await approveExpectFail(reFungibleCollectionId, 2, alice, bob); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const approveTx = async () => helper.rft.approveToken(alice, collectionId, 2, {Substrate: bob.address}); + await expect(approveTx()).to.be.rejected; + }); }); it('[nft] Approve using the address that does not own the approved token', async () => { - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - await approveExpectFail(nftCollectionId, newNftTokenId, bob, alice); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + const approveTx = async () => helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}); + await expect(approveTx()).to.be.rejected; + }); }); it('[fungible] Approve using the address that does not own the approved token', async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await approveExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.ft.mintTokens(alice, collectionId, alice.address, 10n); + const tokenId = await helper.ft.getLastTokenId(collectionId); + const approveTx = async () => helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}); + await expect(approveTx()).to.be.rejected; + }); }); it('[refungible] Approve using the address that does not own the approved token', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const reFungibleCollectionId = - await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await approveExpectFail(reFungibleCollectionId, newReFungibleTokenId, bob, alice); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); + const approveTx = async () => helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}); + await expect(approveTx()).to.be.rejected; + }); }); it('should fail if approved more ReFungibles than owned', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const nftCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'ReFungible'); - await transferExpectSuccess(nftCollectionId, newNftTokenId, alice, bob, 100, 'ReFungible'); - await approveExpectSuccess(nftCollectionId, newNftTokenId, bob, alice.address, 100); - await approveExpectFail(nftCollectionId, newNftTokenId, bob, alice, 101); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); + await helper.rft.transferToken(alice, collectionId, tokenId, {Substrate: bob.address}, 100n); + await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, undefined, 100n); + + const approveTx = async () => helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, undefined, 101n); + await expect(approveTx()).to.be.rejected; + }); }); it('should fail if approved more Fungibles than owned', async () => { - const nftCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'Fungible'); - await transferExpectSuccess(nftCollectionId, newNftTokenId, alice, bob, 10, 'Fungible'); - await approveExpectSuccess(nftCollectionId, newNftTokenId, bob, alice.address, 10); - await approveExpectFail(nftCollectionId, newNftTokenId, bob, alice, 11); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.ft.mintTokens(alice, collectionId, alice.address, 10n); + const tokenId = await helper.ft.getLastTokenId(collectionId); + + await helper.ft.transferToken(alice, collectionId, tokenId, {Substrate: bob.address}, 10n); + await helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, undefined, 10n); + const approveTx = async () => helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, undefined, 11n); + await expect(approveTx()).to.be.rejected; + }); }); it('fails when called by collection owner on non-owned item when OwnerCanTransfer == false', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address); - await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: false}); + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: false}); - await approveExpectFail(collectionId, itemId, alice, charlie); + const approveTx = async () => helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + await expect(approveTx()).to.be.rejected; + }); }); }); From 8e6f8da8dbcff0b79568f6b08b14ae17b6786df0 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 7 Sep 2022 14:32:20 +0000 Subject: [PATCH 0790/1274] fix: make submitTransactionAsync deprecated --- tests/src/substrate/substrate-api.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/src/substrate/substrate-api.ts b/tests/src/substrate/substrate-api.ts index 288a976dff..316c62889c 100644 --- a/tests/src/substrate/substrate-api.ts +++ b/tests/src/substrate/substrate-api.ts @@ -150,6 +150,9 @@ export function executeTransaction(api: ApiPromise, sender: IKeyringPair, transa }); } +/** + * @deprecated use `executeTransaction` instead + */ export function submitTransactionAsync(sender: IKeyringPair, transaction: SubmittableExtrinsic): Promise { /* eslint no-async-promise-executor: "off" */ From f9806160e7169697a077d1f6dc8918786a711d06 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Wed, 7 Sep 2022 19:48:47 +0000 Subject: [PATCH 0791/1274] Tests: skip test for 1000 rewards --- tests/src/app-promotion.test.ts | 47 +++++++++++++++------------------ 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index e76461e7c2..c2f11b5f83 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -27,7 +27,6 @@ import {usingPlaygrounds} from './util/playgrounds'; import {encodeAddress} from '@polkadot/util-crypto'; import {stringToU8a} from '@polkadot/util'; -import {ApiPromise} from '@polkadot/api'; import {SponsoringMode, contractHelpers, createEthAccountWithBalance, deployFlipper, itWeb3, transferBalanceToEth} from './eth/util/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -42,10 +41,10 @@ const UNLOCKING_PERIOD = 10n; // 20 blocks of parachain const rewardAvailableInBlock = (stakedInBlock: bigint) => (stakedInBlock - stakedInBlock % LOCKING_PERIOD) + (LOCKING_PERIOD * 2n); before(async function () { - await usingPlaygrounds(async (helper, privateKeyWrapper) => { + await usingPlaygrounds(async (helper, privateKey) => { if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); - alice = privateKeyWrapper('//Alice'); - palletAdmin = privateKeyWrapper('//Charlie'); // TODO use custom address + alice = privateKey('//Alice'); + palletAdmin = privateKey('//Charlie'); // TODO use custom address await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); nominal = helper.balance.getOneTokenNominal(); await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal); @@ -675,7 +674,8 @@ describe('app-promotion rewards', () => { // staker unstakes before rewards has been payed const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); - await waitForRelayBlock(helper.api!, 40); + const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0]; + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock) + LOCKING_PERIOD); await helper.staking.unstake(staker); // so he did not receive any rewards @@ -693,24 +693,32 @@ describe('app-promotion rewards', () => { const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); - await helper.staking.stake(staker, 200n * nominal); - await helper.staking.stake(staker, 300n * nominal); + + const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0]; + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock)); - await waitForRelayBlock(helper.api!, 34); await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); let totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); - expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n), calculateIncome(200n * nominal, 10n), calculateIncome(300n * nominal, 10n)]); + expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n)]); - await waitForRelayBlock(helper.api!, 20); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock) + LOCKING_PERIOD); await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); - expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n, 2), calculateIncome(200n * nominal, 10n, 2), calculateIncome(300n * nominal, 10n, 2)]); + expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n, 2)]); }); }); - it('can be paid 1000 rewards in a time', async () => { + it.skip('can be paid 1000 rewards in a time', async () => { + // all other stakes should be unstaked await usingPlaygrounds(async (helper) => { - expect.fail('Test not implemented'); + const oneHundredStakers = await helper.arrange.createCrowd(100, 1050n, alice); + + // stakers stakes 10 times each + for (let i = 0; i < 10; i++) { + await Promise.all(oneHundredStakers.map(staker => helper.staking.stake(staker, 100n * nominal))); + } + await helper.wait.newBlocks(40); + const result = await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); }); }); @@ -734,19 +742,6 @@ describe('app-promotion rewards', () => { }); }); -async function waitForRelayBlock(api: ApiPromise, blocks = 1): Promise { - const current_block = (await api.query.parachainSystem.lastRelayChainBlockNumber()).toNumber(); - return new Promise(async (resolve, reject) => { - const unsubscribe = await api.query.parachainSystem.validationData(async (data) => { - // console.log(`${current_block} || ${data.value.relayParentNumber.toNumber()}`); - if (data.value.relayParentNumber.toNumber() - current_block >= blocks) { - unsubscribe(); - resolve(); - } - }); - }); -} - function calculatePalleteAddress(palletId: any) { const address = stringToU8a(('modl' + palletId).padEnd(32, '\0')); return encodeAddress(address); From 4cc1096094ca96524c09f7496d1b8102773cde55 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 8 Sep 2022 11:09:44 +0300 Subject: [PATCH 0792/1274] feat(evm-coder): conditional inheritance Add new configuration option for #[solidity_interface] is attribute: if($expr) This expression will be executed during ERC165 supports_interface call, and during normal call execution (but not during parsing), allowing to conditionally disable some inherited interfaces based on contract data Signed-off-by: Yaroslav Bolyukin --- .../procedural/src/solidity_interface.rs | 99 ++++++++++++++----- crates/evm-coder/src/abi.rs | 2 +- crates/evm-coder/src/lib.rs | 8 +- crates/evm-coder/tests/conditional_is.rs | 44 +++++++++ crates/evm-coder/tests/generics.rs | 2 +- crates/evm-coder/tests/random.rs | 2 +- crates/evm-coder/tests/solidity_generation.rs | 2 +- pallets/common/src/erc.rs | 6 +- pallets/fungible/src/erc.rs | 2 +- pallets/nonfungible/src/erc.rs | 2 +- pallets/refungible/src/erc.rs | 2 +- 11 files changed, 133 insertions(+), 38 deletions(-) create mode 100644 crates/evm-coder/tests/conditional_is.rs diff --git a/crates/evm-coder/procedural/src/solidity_interface.rs b/crates/evm-coder/procedural/src/solidity_interface.rs index fe206e76e6..eee69967e3 100644 --- a/crates/evm-coder/procedural/src/solidity_interface.rs +++ b/crates/evm-coder/procedural/src/solidity_interface.rs @@ -42,6 +42,7 @@ struct Is { pascal_call_name: Ident, snake_call_name: Ident, via: Option<(Type, Ident)>, + condition: Option, } impl Is { fn expand_call_def(&self, gen_ref: &proc_macro2::TokenStream) -> proc_macro2::TokenStream { @@ -64,8 +65,13 @@ impl Is { generics: &proc_macro2::TokenStream, ) -> proc_macro2::TokenStream { let pascal_call_name = &self.pascal_call_name; + let condition = self.condition.as_ref().map(|condition| { + quote! { + (#condition) && + } + }); quote! { - <#pascal_call_name #generics>::supports_interface(interface_id) + #condition <#pascal_call_name #generics>::supports_interface(this, interface_id) } } @@ -93,8 +99,13 @@ impl Is { .as_ref() .map(|(_, i)| quote! {.#i()}) .unwrap_or_default(); + let condition = self.condition.as_ref().map(|condition| { + quote! { + if ({let this = &self; (#condition)}) + } + }); quote! { - #call_name::#name(call) => return <#via_typ as ::evm_coder::Callable<#pascal_call_name #generics>>::call(self #via_map, Msg { + #call_name::#name(call) #condition => return <#via_typ as ::evm_coder::Callable<#pascal_call_name #generics>>::call(self #via_map, Msg { call, caller: c.caller, value: c.value, @@ -138,17 +149,52 @@ impl Parse for IsList { } let name = input.parse::()?; let lookahead = input.lookahead1(); - let via = if lookahead.peek(syn::token::Paren) { + + let mut condition: Option = None; + let mut via: Option<(Type, Ident)> = None; + + if lookahead.peek(syn::token::Paren) { let contents; parenthesized!(contents in input); - let method = contents.parse::()?; - contents.parse::()?; - let ty = contents.parse::()?; - Some((ty, method)) - } else if lookahead.peek(Token![,]) { - None - } else if input.is_empty() { - None + let input = contents; + + loop { + let lookahead = input.lookahead1(); + if lookahead.peek(Token![if]) { + input.parse::()?; + let contents; + parenthesized!(contents in input); + let contents = contents.parse::()?; + + if condition.replace(contents).is_some() { + return Err(syn::Error::new(input.span(), "condition is already set")); + } + } else if lookahead.peek(kw::via) { + input.parse::()?; + let contents; + parenthesized!(contents in input); + + let method = contents.parse::()?; + contents.parse::()?; + let ty = contents.parse::()?; + + if via.replace((ty, method)).is_some() { + return Err(syn::Error::new(input.span(), "via is already set")); + } + } else if input.is_empty() { + break; + } else { + return Err(lookahead.error()); + } + + if input.peek(Token![,]) { + input.parse::()?; + } else { + break; + } + } + } else if lookahead.peek(Token![,]) || input.is_empty() { + // Pass } else { return Err(lookahead.error()); }; @@ -157,6 +203,7 @@ impl Parse for IsList { snake_call_name: pascal_ident_to_snake_call(&name), name, via, + condition, }); if input.peek(Token![,]) { input.parse::()?; @@ -996,16 +1043,6 @@ impl SolidityInterface { #(#inline_interface_id)* u32::to_be_bytes(interface_id) } - /// Is this contract implements specified ERC165 selector - pub fn supports_interface(interface_id: ::evm_coder::types::bytes4) -> bool { - interface_id != u32::to_be_bytes(0xffffff) && ( - interface_id == ::evm_coder::ERC165Call::INTERFACE_ID || - interface_id == Self::interface_id() - #( - || #supports_interface - )* - ) - } /// Generate solidity definitions for methods described in this interface pub fn generate_solidity_interface(tc: &evm_coder::solidity::TypeCollector, is_impl: bool) { use evm_coder::solidity::*; @@ -1024,7 +1061,7 @@ impl SolidityInterface { )*), }; - let mut out = string::new(); + let mut out = ::evm_coder::types::string::new(); if #solidity_name.starts_with("Inline") { out.push_str("/// @dev inlined interface\n"); } @@ -1062,6 +1099,20 @@ impl SolidityInterface { return Ok(None); } } + impl #generics #call_name #gen_ref + #gen_where + { + /// Is this contract implements specified ERC165 selector + pub fn supports_interface(this: &#name, interface_id: ::evm_coder::types::bytes4) -> bool { + interface_id != u32::to_be_bytes(0xffffff) && ( + interface_id == ::evm_coder::ERC165Call::INTERFACE_ID || + interface_id == Self::interface_id() + #( + || #supports_interface + )* + ) + } + } impl #generics ::evm_coder::Weighted for #call_name #gen_ref #gen_where { @@ -1091,7 +1142,7 @@ impl SolidityInterface { )* #call_name::ERC165Call(::evm_coder::ERC165Call::SupportsInterface {interface_id}, _) => { let mut writer = ::evm_coder::abi::AbiWriter::default(); - writer.bool(&<#call_name #gen_ref>::supports_interface(interface_id)); + writer.bool(&<#call_name #gen_ref>::supports_interface(self, interface_id)); return Ok(writer.into()); } _ => {}, @@ -1101,7 +1152,7 @@ impl SolidityInterface { #( #call_variants_this, )* - _ => unreachable!() + _ => Err(::evm_coder::execution::Error::from("method is not available").into()), } } } diff --git a/crates/evm-coder/src/abi.rs b/crates/evm-coder/src/abi.rs index daaf93a8b2..e1114333cb 100644 --- a/crates/evm-coder/src/abi.rs +++ b/crates/evm-coder/src/abi.rs @@ -313,7 +313,7 @@ impl AbiWriter { /// Finish writer, concatenating all internal buffers pub fn finish(mut self) -> Vec { for (static_offset, part) in self.dynamic_part { - let part_offset = self.static_part.len() - self.had_call.then(|| 4).unwrap_or(0); + let part_offset = self.static_part.len() - if self.had_call { 4 } else { 0 }; let encoded_dynamic_offset = usize::to_be_bytes(part_offset); self.static_part[static_offset + ABI_ALIGNMENT - encoded_dynamic_offset.len() diff --git a/crates/evm-coder/src/lib.rs b/crates/evm-coder/src/lib.rs index 3e254296d0..eabb69403c 100644 --- a/crates/evm-coder/src/lib.rs +++ b/crates/evm-coder/src/lib.rs @@ -74,10 +74,10 @@ pub mod execution; /// #[solidity_interface(name = MyContract, is(SuperContract), inline_is(InlineContract))] /// impl Contract { /// /// Multiply two numbers -/// /// @param a First number -/// /// @param b Second number -/// /// @return uint32 Product of two passed numbers -/// /// @dev This function returns error in case of overflow +/// /// @param a First number +/// /// @param b Second number +/// /// @return uint32 Product of two passed numbers +/// /// @dev This function returns error in case of overflow /// #[weight(200 + a + b)] /// #[solidity_interface(rename_selector = "mul")] /// fn mul(&mut self, a: uint32, b: uint32) -> Result { diff --git a/crates/evm-coder/tests/conditional_is.rs b/crates/evm-coder/tests/conditional_is.rs new file mode 100644 index 0000000000..17183d9266 --- /dev/null +++ b/crates/evm-coder/tests/conditional_is.rs @@ -0,0 +1,44 @@ +use evm_coder::{types::*, solidity_interface, execution::Result, Call}; + +pub struct Contract(bool); + +#[solidity_interface(name = A)] +impl Contract { + fn method_a() -> Result { + Ok(()) + } +} + +#[solidity_interface(name = B)] +impl Contract { + fn method_b() -> Result { + Ok(()) + } +} + +#[solidity_interface(name = Contract, is( + A(if(this.0)), + B(if(!this.0)), +))] +impl Contract {} + +#[test] +fn conditional_erc165() { + assert!(ContractCall::supports_interface( + &Contract(true), + ACall::METHOD_A + )); + assert!(!ContractCall::supports_interface( + &Contract(false), + ACall::METHOD_A + )); + + assert!(ContractCall::supports_interface( + &Contract(false), + BCall::METHOD_B + )); + assert!(!ContractCall::supports_interface( + &Contract(true), + BCall::METHOD_B + )); +} diff --git a/crates/evm-coder/tests/generics.rs b/crates/evm-coder/tests/generics.rs index 34b2238aec..ab5cac9f82 100644 --- a/crates/evm-coder/tests/generics.rs +++ b/crates/evm-coder/tests/generics.rs @@ -17,7 +17,7 @@ use std::marker::PhantomData; use evm_coder::{execution::Result, generate_stubgen, solidity_interface, types::*}; -struct Generic(PhantomData); +pub struct Generic(PhantomData); #[solidity_interface(name = GenericIs)] impl Generic { diff --git a/crates/evm-coder/tests/random.rs b/crates/evm-coder/tests/random.rs index 6655db534c..47acff7280 100644 --- a/crates/evm-coder/tests/random.rs +++ b/crates/evm-coder/tests/random.rs @@ -18,7 +18,7 @@ use evm_coder::{ToLog, execution::Result, solidity_interface, types::*, solidity, weight}; -struct Impls; +pub struct Impls; #[solidity_interface(name = OurInterface)] impl Impls { diff --git a/crates/evm-coder/tests/solidity_generation.rs b/crates/evm-coder/tests/solidity_generation.rs index 6653070195..7ddc8ea500 100644 --- a/crates/evm-coder/tests/solidity_generation.rs +++ b/crates/evm-coder/tests/solidity_generation.rs @@ -16,7 +16,7 @@ use evm_coder::{execution::Result, generate_stubgen, solidity_interface, types::*}; -struct ERC20; +pub struct ERC20; #[solidity_interface(name = ERC20)] impl ERC20 { diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 416d410410..b7c91ea863 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -374,9 +374,9 @@ where true => { let mut bv = OwnerRestrictedSet::new(); for i in collections { - bv.try_insert(crate::eth::map_eth_to_id(&i).ok_or(Error::Revert( - "Can't convert address into collection id".into(), - ))?) + bv.try_insert(crate::eth::map_eth_to_id(&i).ok_or_else(|| { + Error::Revert("Can't convert address into collection id".into()) + })?) .map_err(|_| "too many collections")?; } let mut nesting = permissions.nesting().clone(); diff --git a/pallets/fungible/src/erc.rs b/pallets/fungible/src/erc.rs index 92e970c3f7..ac86b9d7ed 100644 --- a/pallets/fungible/src/erc.rs +++ b/pallets/fungible/src/erc.rs @@ -199,7 +199,7 @@ impl FungibleHandle { ERC20, ERC20Mintable, ERC20UniqueExtensions, - Collection(common_mut, CollectionHandle), + Collection(via(common_mut, CollectionHandle)), ) )] impl FungibleHandle where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {} diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 8da82496d4..ddd9271b75 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -736,7 +736,7 @@ impl NonfungibleHandle { ERC721UniqueExtensions, ERC721Mintable, ERC721Burnable, - Collection(common_mut, CollectionHandle), + Collection(via(common_mut, CollectionHandle)), TokenProperties, ) )] diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 16629643e5..e4696240f6 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -785,7 +785,7 @@ impl RefungibleHandle { ERC721UniqueExtensions, ERC721Mintable, ERC721Burnable, - Collection(common_mut, CollectionHandle), + Collection(via(common_mut, CollectionHandle)), TokenProperties, ) )] From 93e757afede1bc23f7ae203418edf2fea62d2513 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 8 Sep 2022 09:13:42 +0000 Subject: [PATCH 0793/1274] fix: add create_multiple_items_common --- pallets/fungible/src/lib.rs | 109 +++++++++++++----------------------- 1 file changed, 40 insertions(+), 69 deletions(-) diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index 6de15a96f4..078de7ec82 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -428,31 +428,14 @@ impl Pallet { } /// Minting tokens for multiple IDs. - /// See [`create_item`][`Pallet::create_item`] for more details. - pub fn create_multiple_items( + /// It is a utility function used in [`create_multiple_items`][`Pallet::create_multiple_items`] + /// and [`create_multiple_items_foreign`][`Pallet::create_multiple_items_foreign`] + pub fn create_multiple_items_common( collection: &FungibleHandle, sender: &T::CrossAccountId, data: BTreeMap, nesting_budget: &dyn Budget, ) -> DispatchResult { - // Foreign collection check - ensure!( - !>::get(collection.id), - >::NoPermission - ); - - if !collection.is_owner_or_admin(sender) { - ensure!( - collection.permissions.mint_mode(), - >::PublicMintingNotAllowed - ); - collection.check_allowlist(sender)?; - - for (owner, _) in data.iter() { - collection.check_allowlist(owner)?; - } - } - let total_supply = data .iter() .map(|(_, v)| *v) @@ -511,65 +494,53 @@ impl Pallet { } /// Minting tokens for multiple IDs. - /// See [`create_item_foreign`][`Pallet::create_item_foreign`] for more details. - pub fn create_multiple_items_foreign( + /// See [`create_item`][`Pallet::create_item`] for more details. + pub fn create_multiple_items( collection: &FungibleHandle, sender: &T::CrossAccountId, data: BTreeMap, nesting_budget: &dyn Budget, ) -> DispatchResult { - let total_supply = data - .iter() - .map(|(_, v)| *v) - .try_fold(>::get(collection.id), |acc, v| { - acc.checked_add(v) - }) - .ok_or(ArithmeticError::Overflow)?; + // Foreign collection check + ensure!( + !>::get(collection.id), + >::NoPermission + ); - let mut balances = data; - for (k, v) in balances.iter_mut() { - *v = >::get((collection.id, &k)) - .checked_add(*v) - .ok_or(ArithmeticError::Overflow)?; - } + if !collection.is_owner_or_admin(sender) { + ensure!( + collection.permissions.mint_mode(), + >::PublicMintingNotAllowed + ); + collection.check_allowlist(sender)?; - for (to, _) in balances.iter() { - >::check_nesting( - sender.clone(), - to, - collection.id, - TokenId::default(), - nesting_budget, - )?; + for (owner, _) in data.iter() { + collection.check_allowlist(owner)?; + } } - // ========= - - >::insert(collection.id, total_supply); - for (user, amount) in balances { - >::insert((collection.id, &user), amount); - >::nest_if_sent_to_token_unchecked( - &user, - collection.id, - TokenId::default(), - ); - >::deposit_log( - ERC20Events::Transfer { - from: H160::default(), - to: *user.as_eth(), - value: amount.into(), - } - .to_log(collection_id_to_address(collection.id)), - ); - >::deposit_event(CommonEvent::ItemCreated( - collection.id, - TokenId::default(), - user.clone(), - amount, - )); - } + Self::create_multiple_items_common( + collection, + sender, + data, + nesting_budget, + ) + } - Ok(()) + /// Minting tokens for multiple IDs. + /// See [`create_item_foreign`][`Pallet::create_item_foreign`] for more details. + pub fn create_multiple_items_foreign( + collection: &FungibleHandle, + sender: &T::CrossAccountId, + data: BTreeMap, + nesting_budget: &dyn Budget, + ) -> DispatchResult { + Self::create_multiple_items_common( + collection, + sender, + data, + nesting_budget, + ) } fn set_allowance_unchecked( From eba9da942ea301db883e855e60df799d8b07ce3f Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Thu, 8 Sep 2022 09:30:07 +0000 Subject: [PATCH 0794/1274] test(util-playgrounds): modifications and additions of all stripes --- tests/package.json | 2 +- tests/src/util/playgrounds/index.ts | 37 ++++++++++ tests/src/util/playgrounds/types.ts | 6 +- tests/src/util/playgrounds/unique.dev.ts | 7 +- tests/src/util/playgrounds/unique.ts | 87 +++++++++++++++++------- 5 files changed, 109 insertions(+), 30 deletions(-) diff --git a/tests/package.json b/tests/package.json index e2985a4954..2f0a5439d5 100644 --- a/tests/package.json +++ b/tests/package.json @@ -64,6 +64,7 @@ "testBurnItem": "mocha --timeout 9999999 -r ts-node/register ./**/burnItem.test.ts", "testAdminTransferAndBurn": "mocha --timeout 9999999 -r ts-node/register ./**/adminTransferAndBurn.test.ts", "testSetMintPermission": "mocha --timeout 9999999 -r ts-node/register ./**/setMintPermission.test.ts", + "testSetPublicAccessMode": "mocha --timeout 9999999 -r ts-node/register ./**/setPublicAccessMode.test.ts", "testCreditFeesToTreasury": "mocha --timeout 9999999 -r ts-node/register ./**/creditFeesToTreasury.test.ts", "testContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/contractSponsoring.test.ts", "testEnableContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/enableContractSponsoring.test.ts", @@ -71,7 +72,6 @@ "testSetContractSponsoringRateLimit": "mocha --timeout 9999999 -r ts-node/register ./**/setContractSponsoringRateLimit.test.ts", "testSetOffchainSchema": "mocha --timeout 9999999 -r ts-node/register ./**/setOffchainSchema.test.ts", "testOverflow": "mocha --timeout 9999999 -r ts-node/register ./**/overflow.test.ts", - "testSetVariableMetadataSponsoringRateLimit": "mocha --timeout 9999999 -r ts-node/register ./**/setVariableMetadataSponsoringRateLimit.test.ts", "testInflation": "mocha --timeout 9999999 -r ts-node/register ./**/inflation.test.ts", "testScheduler": "mocha --timeout 9999999 -r ts-node/register ./**/scheduler.test.ts", "testSchedulingEVM": "mocha --timeout 9999999 -r ts-node/register ./**/eth/scheduling.test.ts", diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index d58c7d98e3..b0a8e4efd1 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import {IKeyringPair} from '@polkadot/types/types'; +import {Context} from 'mocha'; import config from '../../config'; import '../../interfaces/augment-api-events'; import {DevUniqueHelper, SilentLogger, SilentConsole} from './unique.dev'; @@ -24,3 +25,39 @@ export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKe silentConsole.disable(); } }; + +export enum Pallets { + Inflation = 'inflation', + RmrkCore = 'rmrkcore', + RmrkEquip = 'rmrkequip', + ReFungible = 'refungible', + Fungible = 'fungible', + NFT = 'nonfungible', + Scheduler = 'scheduler', +} + +export function requirePalletsOrSkip(test: Context, helper: DevUniqueHelper, requiredPallets: string[]) { + const missingPallets = helper.fetchMissingPalletNames(requiredPallets); + + if (missingPallets.length > 0) { + const skipMsg = `\tSkipping test '${test.test?.title}'.\n\tThe following pallets are missing:\n\t- ${missingPallets.join('\n\t- ')}`; + console.warn('\x1b[38:5:208m%s\x1b[0m', skipMsg); + test.skip(); + } +} + +export async function itSub(name: string, cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean, requiredPallets?: string[] } = {}) { + (opts.only ? it.only : + opts.skip ? it.skip : it)(name, async function () { + await usingPlaygrounds(async (helper, privateKey) => { + if (opts.requiredPallets) { + requirePalletsOrSkip(this, helper, opts.requiredPallets); + } + + await cb({helper, privateKey}); + }); + }); +} +itSub.only = (name: string, cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSub(name, cb, {only: true}); +itSub.skip = (name: string, cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSub(name, cb, {skip: true}); +itSub.ifWithPallets = (name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSub(name, cb, {requiredPallets: required}); diff --git a/tests/src/util/playgrounds/types.ts b/tests/src/util/playgrounds/types.ts index d6633d1f58..dbbf78a98a 100644 --- a/tests/src/util/playgrounds/types.ts +++ b/tests/src/util/playgrounds/types.ts @@ -102,9 +102,9 @@ export interface IToken { } export interface ICollectionCreationOptions { - name: string | number[]; - description: string | number[]; - tokenPrefix: string | number[]; + name?: string | number[]; + description?: string | number[]; + tokenPrefix?: string | number[]; mode?: { nft?: null; refungible?: null; diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 8a9ae099a5..d086c2fc41 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -118,14 +118,15 @@ class ArrangeGroup { */ createAccounts = async (balances: bigint[], donor: IKeyringPair): Promise => { let nonce = await this.helper.chain.getNonce(donor.address); + const ss58Format = this.helper.chain.getChainProperties().ss58Format; const tokenNominal = this.helper.balance.getOneTokenNominal(); const transactions = []; const accounts: IKeyringPair[] = []; for (const balance of balances) { - const recepient = this.helper.util.fromSeed(mnemonicGenerate()); - accounts.push(recepient); + const recipient = this.helper.util.fromSeed(mnemonicGenerate(), ss58Format); + accounts.push(recipient); if (balance !== 0n) { - const tx = this.helper.constructApiCall('api.tx.balances.transfer', [{Id: recepient.address}, balance * tokenNominal]); + const tx = this.helper.constructApiCall('api.tx.balances.transfer', [{Id: recipient.address}, balance * tokenNominal]); transactions.push(this.helper.signTransaction(donor, tx, 'account generation', {nonce})); nonce++; } diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 0e4ec709fe..8196002c53 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -11,14 +11,13 @@ import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} f import {IKeyringPair} from '@polkadot/types/types'; import {IApiListeners, IChainEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; -const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => { +export const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => { const address = {} as ICrossAccountId; if(lowerAddress.substrate) address.Substrate = lowerAddress.substrate; if(lowerAddress.ethereum) address.Ethereum = lowerAddress.ethereum; return address; }; - const nesting = { toChecksumAddress(address: string): string { if (typeof address === 'undefined') return ''; @@ -440,6 +439,16 @@ class ChainHelperBase { if(typeof signer === 'string') return signer; return signer.address; } + + fetchAllPalletNames(): string[] { + if(this.api === null) throw Error('API not initialized'); + return this.api.runtimeMetadata.asLatest.pallets.map(m => m.name.toString().toLowerCase()); + } + + fetchMissingPalletNames(requiredPallets: string[]): string[] { + const palletNames = this.fetchAllPalletNames(); + return requiredPallets.filter(p => !palletNames.includes(p)); + } } @@ -476,7 +485,9 @@ class CollectionGroup extends HelperGroup { } /** - * Get information about the collection with additional data, including the number of tokens it contains, its administrators, the normalized address of the collection's owner, and decoded name and description. + * Get information about the collection with additional data, + * including the number of tokens it contains, its administrators, + * the normalized address of the collection's owner, and decoded name and description. * * @param collectionId ID of collection * @example await getData(2) @@ -504,42 +515,50 @@ class CollectionGroup extends HelperGroup { collectionData[key] = this.helper.util.vec2str(humanCollection[key]); } - collectionData.tokensCount = (['RFT', 'NFT'].includes(humanCollection.mode)) ? await this.helper[humanCollection.mode.toLocaleLowerCase() as 'nft' | 'rft'].getLastTokenId(collectionId) : 0; + collectionData.tokensCount = (['RFT', 'NFT'].includes(humanCollection.mode)) + ? await this.helper[humanCollection.mode.toLocaleLowerCase() as 'nft' | 'rft'].getLastTokenId(collectionId) + : 0; collectionData.admins = await this.getAdmins(collectionId); return collectionData; } /** - * Get the normalized addresses of the collection's administrators. + * Get the addresses of the collection's administrators, optionally normalized. * * @param collectionId ID of collection + * @param normalize whether to normalize the addresses to the default ss58 format * @example await getAdmins(1) * @returns array of administrators */ - async getAdmins(collectionId: number): Promise { - const normalized = []; - for(const admin of (await this.helper.callRpc('api.rpc.unique.adminlist', [collectionId])).toHuman()) { - if(admin.Substrate) normalized.push({Substrate: this.helper.address.normalizeSubstrate(admin.Substrate)}); - else normalized.push(admin); - } - return normalized; + async getAdmins(collectionId: number, normalize = false): Promise { + const admins = (await this.helper.callRpc('api.rpc.unique.adminlist', [collectionId])).toHuman(); + + return normalize + ? admins.map((address: any) => { + return address.Substrate + ? {Substrate: this.helper.address.normalizeSubstrate(address.Substrate)} + : address; + }) + : admins; } /** - * Get the normalized addresses added to the collection allow-list. + * Get the addresses added to the collection allow-list, optionally normalized. * @param collectionId ID of collection + * @param normalize whether to normalize the addresses to the default ss58 format * @example await getAllowList(1) * @returns array of allow-listed addresses */ - async getAllowList(collectionId: number): Promise { - const normalized = []; + async getAllowList(collectionId: number, normalize = false): Promise { const allowListed = (await this.helper.callRpc('api.rpc.unique.allowlist', [collectionId])).toHuman(); - for (const address of allowListed) { - if (address.Substrate) normalized.push({Substrate: this.helper.address.normalizeSubstrate(address.Substrate)}); - else normalized.push(address); - } - return normalized; + return normalize + ? allowListed.map((address: any) => { + return address.Substrate + ? {Substrate: this.helper.address.normalizeSubstrate(address.Substrate)} + : address; + }) + : allowListed; } /** @@ -572,7 +591,7 @@ class CollectionGroup extends HelperGroup { } /** - * Sets the sponsor for the collection (Requires the Substrate address). + * Sets the sponsor for the collection (Requires the Substrate address). Needs confirmation by the sponsor. * * @param signer keyring of signer * @param collectionId ID of collection @@ -608,6 +627,24 @@ class CollectionGroup extends HelperGroup { return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'SponsorshipConfirmed'); } + /** + * Removes the sponsor of a collection, regardless if it consented or not. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @example removeSponsor(aliceKeyring, 10) + * @returns ```true``` if extrinsic success, otherwise ```false``` + */ + async removeSponsor(signer: TSigner, collectionId: number): Promise { + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.removeCollectionSponsor', [collectionId], + true, + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionSponsorRemoved'); + } + /** * Sets the limits of the collection. At least one limit must be specified for a correct call. * @@ -2004,6 +2041,10 @@ class UniqueCollectionBase { return await this.helper.collection.confirmSponsorship(signer, this.collectionId); } + async removeSponsor(signer: TSigner) { + return await this.helper.collection.removeSponsor(signer, this.collectionId); + } + async setLimits(signer: TSigner, limits: ICollectionLimits) { return await this.helper.collection.setLimits(signer, this.collectionId, limits); } @@ -2016,8 +2057,8 @@ class UniqueCollectionBase { return await this.helper.collection.addAdmin(signer, this.collectionId, adminAddressObj); } - async enableAllowList(signer: TSigner, value = true/*: 'Normal' | 'AllowList' = 'AllowList'*/) { - return await this.setPermissions(signer, value ? {access: 'AllowList', mintMode: true} : {access: 'Normal'}); + async enableCertainPermissions(signer: TSigner, accessMode: 'AllowList' | 'Normal' | undefined = 'AllowList', mintMode: boolean | undefined = true) { + return await this.setPermissions(signer, {access: accessMode, mintMode: mintMode}); } async addToAllowList(signer: TSigner, addressObj: ICrossAccountId) { From 838ab9f77970cbe51b6186458fc3b31d4601c111 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 8 Sep 2022 09:38:57 +0000 Subject: [PATCH 0795/1274] fix: formatting --- pallets/foreign-assets/src/lib.rs | 6 +++--- pallets/fungible/src/lib.rs | 14 ++------------ 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/pallets/foreign-assets/src/lib.rs b/pallets/foreign-assets/src/lib.rs index 7617b40115..fc9eac1d65 100644 --- a/pallets/foreign-assets/src/lib.rs +++ b/pallets/foreign-assets/src/lib.rs @@ -481,13 +481,13 @@ impl< Ok(payment) } } -impl< +impl Drop + for FreeForAll +where WeightToFee: WeightToFeePolynomial, AssetId: Get, - AccountId, Currency: CurrencyT, OnUnbalanced: OnUnbalancedT, -> Drop for FreeForAll { fn drop(&mut self) { OnUnbalanced::on_unbalanced(Currency::issue(self.1)); diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index 078de7ec82..fb4cf263f1 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -519,12 +519,7 @@ impl Pallet { } } - Self::create_multiple_items_common( - collection, - sender, - data, - nesting_budget, - ) + Self::create_multiple_items_common(collection, sender, data, nesting_budget) } /// Minting tokens for multiple IDs. @@ -535,12 +530,7 @@ impl Pallet { data: BTreeMap, nesting_budget: &dyn Budget, ) -> DispatchResult { - Self::create_multiple_items_common( - collection, - sender, - data, - nesting_budget, - ) + Self::create_multiple_items_common(collection, sender, data, nesting_budget) } fn set_allowance_unchecked( From fe3acb0e9993eed0a30db8611320657859dcb5ab Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 8 Sep 2022 14:01:27 +0300 Subject: [PATCH 0796/1274] doc: add description of sponsoring flow Signed-off-by: Yaroslav Bolyukin --- doc/sponsoring-flow.svg | 3 +++ doc/sponsoring.md | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 doc/sponsoring-flow.svg create mode 100644 doc/sponsoring.md diff --git a/doc/sponsoring-flow.svg b/doc/sponsoring-flow.svg new file mode 100644 index 0000000000..3b1a8e8803 --- /dev/null +++ b/doc/sponsoring-flow.svg @@ -0,0 +1,3 @@ + + +
EVM calls
EVM calls
Extrinsics
Extrinsics
User
User
Substrate
Substrate
Ethereum
Ethereum
pallet_evm::
TransactionValidityHack
pallet_evm::...

pallet_charge_evm_transaction::
Config::SponsorshipHandler

pallet_charge_evm_tr...
pallet_charge_evm_transaction::
BridgeSponsorshipHandler
pallet_charge_evm_transaction::...
pallet_sponsoring::
ChargeTransactionPayment
pallet_sponsoring::...
tx.others
tx.others
tx.evm.call
tx.evm.call
pallet_sponsoring::
Config::SponsorshipHandler
pallet_sponsoring::...
SponsorshipHandler<H160, (H160, Vec<u8>), CallContext>
SponsorshipHandler<H160, (H160, Vec<u8>), CallContext>
SponsorshipHandler<AccountId, Call, ()>
SponsorshipHandler<AccountId, Call, ()>
Viewer does not support full SVG 1.1
\ No newline at end of file diff --git a/doc/sponsoring.md b/doc/sponsoring.md new file mode 100644 index 0000000000..2bc1b41949 --- /dev/null +++ b/doc/sponsoring.md @@ -0,0 +1,16 @@ +# Sponsoring + + +![Sponsoring flow](./sponsoring-flow.svg) + +## Implementation + +If you need to add sponsoring for pallet call, you should implement `SponsorshipHandler` + +If you need to add sponsoring for EVM contract call, you should implement `SponsorshipHandler), CallContext>` + +For both examples, you can take a look at `UniqueSponsorshipHandler` struct inside of common runtime + +## EVM bridging + +In case if Ethereum call is being called using substrate `evm.call` extrinsic, `BridgeSponsorshipHandler` is used to convert between two different `SponsorshipHandler` types From 35da4ee40eea67e6d3b2b80d7529498df26350f5 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Thu, 8 Sep 2022 18:41:21 +0700 Subject: [PATCH 0797/1274] code refactor & comments --- Cargo.lock | 2 +- client/rpc/CHANGELOG.md | 12 +- client/rpc/Cargo.toml | 2 +- pallets/app-promotion/src/lib.rs | 156 +++++++++------------ pallets/unique/CHANGELOG.md | 2 + tests/src/interfaces/augment-api-consts.ts | 8 +- tests/src/interfaces/augment-api-errors.ts | 17 ++- tests/src/interfaces/augment-api-events.ts | 28 ++++ tests/src/interfaces/augment-api-query.ts | 5 +- tests/src/interfaces/default/types.ts | 5 +- tests/src/interfaces/lookup.ts | 2 +- tests/src/interfaces/types-lookup.ts | 5 +- 12 files changed, 134 insertions(+), 110 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3f5ef0d5c..6bf10da49c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12147,7 +12147,7 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "uc-rpc" -version = "0.1.3" +version = "0.1.4" dependencies = [ "anyhow", "app-promotion-rpc", diff --git a/client/rpc/CHANGELOG.md b/client/rpc/CHANGELOG.md index d51554c30b..75b2f96aae 100644 --- a/client/rpc/CHANGELOG.md +++ b/client/rpc/CHANGELOG.md @@ -3,15 +3,21 @@ All notable changes to this project will be documented in this file. + +## [v0.1.4] 2022-09-08 + +### Added +- Support RPC for `AppPromotion` pallet. + ## [v0.1.3] 2022-08-16 ### Other changes -- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a -- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 -- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b ## [0.1.2] - 2022-08-12 diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index fd60ee7183..a26f44588f 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uc-rpc" -version = "0.1.3" +version = "0.1.4" license = "GPLv3" edition = "2021" diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 834ade8bad..1863eaa6df 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -22,9 +22,6 @@ //! //! ### Dispatchable Functions //! -//! * `start_inflation` - This method sets the inflation start date. Can be only called once. -//! Inflation start block can be backdated and will catch up. The method will create Treasury -//! account if it does not exist and perform the first inflation deposit. // #![recursion_limit = "1024"] #![cfg_attr(not(feature = "std"), no_std)] @@ -48,7 +45,6 @@ use codec::EncodeLike; use pallet_balances::BalanceLock; pub use types::*; -// use up_common::constants::{DAYS, UNIQUE}; use up_data_structs::CollectionId; use frame_support::{ @@ -87,16 +83,20 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config + pallet_evm::account::Config { + /// Type to interact with the native token type Currency: ExtendedLockableCurrency + ReservableCurrency; + /// Type for interacting with collections type CollectionHandler: CollectionHandler< AccountId = Self::AccountId, CollectionId = CollectionId, >; + /// Type for interacting with conrtacts type ContractHandler: ContractHandler; + /// ID for treasury type TreasuryAccountId: Get; /// The app's pallet id, used for deriving its sovereign account ID. @@ -106,15 +106,18 @@ pub mod pallet { /// In relay blocks. #[pallet::constant] type RecalculationInterval: Get; - /// In relay blocks. + + /// In parachain blocks. #[pallet::constant] type PendingInterval: Get; + /// Rate of return for interval in blocks defined in `RecalculationInterval`. #[pallet::constant] - type Nominal: Get>; + type IntervalIncome: Get; + /// Decimals for the `Currency`. #[pallet::constant] - type IntervalIncome: Get; + type Nominal: Get>; /// Weight information for extrinsics in this pallet. type WeightInfo: WeightInfo; @@ -133,6 +136,12 @@ pub mod pallet { #[pallet::event] #[pallet::generate_deposit(fn deposit_event)] pub enum Event { + /// Staking recalculation was performed + /// + /// # Arguments + /// * AccountId: ID of the staker. + /// * Balance : recalculation base + /// * Balance : total income StakingRecalculation( /// An recalculated staker T::AccountId, @@ -141,22 +150,42 @@ pub mod pallet { /// Amount of accrued interest BalanceOf, ), + + /// Staking was performed + /// + /// # Arguments + /// * AccountId: ID of the staker + /// * Balance : staking amount Stake(T::AccountId, BalanceOf), + + /// Unstaking was performed + /// + /// # Arguments + /// * AccountId: ID of the staker + /// * Balance : unstaking amount Unstake(T::AccountId, BalanceOf), + + /// The admin was set + /// + /// # Arguments + /// * AccountId: ID of the admin SetAdmin(T::AccountId), } #[pallet::error] pub enum Error { - /// Error due to action requiring admin to be set + /// Error due to action requiring admin to be set. AdminNotSet, - /// No permission to perform an action + /// No permission to perform an action. NoPermission, - /// Insufficient funds to perform an action + /// Insufficient funds to perform an action. NotSufficientFunds, + /// Occurs when a pending unstake cannot be added in this block. PENDING_LIMIT_PER_BLOCK` limits exceeded. PendingForBlockOverflow, - /// An error related to the fact that an invalid argument was passed to perform an action + /// The error is due to the fact that the collection/contract must already be sponsored in order to perform the action. SponsorNotSet, + /// Errors caused by incorrect actions with a locked balance. + IncorrectLockedBalanceOperation, } #[pallet::storage] @@ -189,7 +218,7 @@ pub mod pallet { ValueQuery, >; - /// Stores hash a record for which the last revenue recalculation was performed. + /// Stores a key for record for which the next revenue recalculation would be performed. /// If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers. #[pallet::storage] #[pallet::getter(fn get_next_calculated_record)] @@ -198,6 +227,9 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { + /// Block overflow is impossible due to the fact that the unstake algorithm in on_initialize + /// implies the execution of a strictly limited number of relatively lightweight operations. + /// A separate benchmark has been implemented to scale the weight depending on the number of pendings. fn on_initialize(current_block_number: T::BlockNumber) -> Weight where ::BlockNumber: From, @@ -242,15 +274,13 @@ pub mod pallet { ); ensure!( - amount >= Into::>::into(100u128) * T::Nominal::get(), + amount >= >::from(100u128) * T::Nominal::get(), ArithmeticError::Underflow ); let balance = <::Currency as Currency>::free_balance(&staker_id); - // ensure!(balance >= amount, ArithmeticError::Underflow); - <::Currency as Currency>::ensure_can_withdraw( &staker_id, amount, @@ -325,7 +355,7 @@ pub mod pallet { >::insert(block, pendings); - Self::unlock_balance_unchecked(&staker_id, total_staked); + Self::unlock_balance(&staker_id, total_staked)?; >::reserve(&staker_id, total_staked)?; @@ -400,8 +430,9 @@ pub mod pallet { ); ensure!( - T::ContractHandler::sponsor(contract_id)?.ok_or(>::SponsorNotSet)? - == T::CrossAccountId::from_sub(Self::account_id()), + T::ContractHandler::sponsor(contract_id)? + .ok_or(>::SponsorNotSet)? + .as_sub() == &Self::account_id(), >::NoPermission ); T::ContractHandler::remove_contract_sponsor(contract_id) @@ -474,74 +505,6 @@ pub mod pallet { // } // } - // { - // let mut stakers_number = stakers_number.unwrap_or(20); - // let last_id = RefCell::new(None); - // let income_acc = RefCell::new(BalanceOf::::default()); - // let amount_acc = RefCell::new(BalanceOf::::default()); - - // let flush_stake = || -> DispatchResult { - // if let Some(last_id) = &*last_id.borrow() { - // if !income_acc.borrow().is_zero() { - // >::transfer( - // &T::TreasuryAccountId::get(), - // last_id, - // *income_acc.borrow(), - // ExistenceRequirement::KeepAlive, - // ) - // .and_then(|_| { - // Self::add_lock_balance(last_id, *income_acc.borrow()); - // >::try_mutate(|staked| { - // staked - // .checked_add(&*income_acc.borrow()) - // .ok_or(ArithmeticError::Overflow.into()) - // }) - // })?; - - // Self::deposit_event(Event::StakingRecalculation( - // last_id.clone(), - // *amount_acc.borrow(), - // *income_acc.borrow(), - // )); - // } - - // *income_acc.borrow_mut() = BalanceOf::::default(); - // *amount_acc.borrow_mut() = BalanceOf::::default(); - // } - // Ok(()) - // }; - - // while let Some(( - // (current_id, staked_block), - // (amount, next_recalc_block_for_stake), - // )) = storage_iterator.next() - // { - // if stakers_number == 0 { - // NextCalculatedRecord::::set(Some((current_id, staked_block))); - // break; - // } - // stakers_number -= 1; - // if last_id.borrow().as_ref() != Some(¤t_id) { - // flush_stake()?; - // }; - // *last_id.borrow_mut() = Some(current_id.clone()); - // if current_recalc_block >= next_recalc_block_for_stake { - // *amount_acc.borrow_mut() += amount; - // Self::recalculate_and_insert_stake( - // ¤t_id, - // staked_block, - // next_recalc_block, - // amount, - // ((current_recalc_block - next_recalc_block_for_stake) - // / T::RecalculationInterval::get()) - // .into() + 1, - // &mut *income_acc.borrow_mut(), - // ); - // } - // } - // flush_stake()?; - // } - { let mut stakers_number = stakers_number.unwrap_or(20); let last_id = RefCell::new(None); @@ -620,10 +583,20 @@ impl Pallet { T::PalletId::get().into_account_truncating() } - fn unlock_balance_unchecked(staker: &T::AccountId, amount: BalanceOf) { - let mut locked_balance = Self::get_locked_balance(staker).map(|l| l.amount).unwrap(); - locked_balance -= amount; - Self::set_lock_unchecked(staker, locked_balance); + fn unlock_balance(staker: &T::AccountId, amount: BalanceOf) -> DispatchResult { + let locked_balance = Self::get_locked_balance(staker) + .map(|l| l.amount) + .ok_or(>::IncorrectLockedBalanceOperation)?; + + // It is understood that we cannot unlock more funds than were locked by staking. + // Therefore, if implemented correctly, this error should not occur. + Self::set_lock_unchecked( + staker, + locked_balance + .checked_sub(&amount) + .ok_or(ArithmeticError::Underflow)?, + ); + Ok(()) } fn add_lock_balance(staker: &T::AccountId, amount: BalanceOf) -> DispatchResult { @@ -745,6 +718,9 @@ impl Pallet where <::Currency as Currency>::Balance: Sum, { + /// Since user funds are not transferred anywhere by staking, overflow protection is provided + /// at the level of the associated type `Balance` of `Currency` trait. In order to overflow, + /// the staker must have more funds on his account than the maximum set for `Balance` type. pub fn cross_id_pending_unstake(staker: Option) -> BalanceOf { staker.map_or( PendingUnstake::::iter_values() diff --git a/pallets/unique/CHANGELOG.md b/pallets/unique/CHANGELOG.md index 82baf20ca8..db2ed76690 100644 --- a/pallets/unique/CHANGELOG.md +++ b/pallets/unique/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file. ### Added +- Methods `force_set_sponsor` , `force_remove_collection_sponsor` to be able to administer sponsorships with other pallets. Added to implement `AppPromotion` pallet logic. + ## [v0.1.3] 2022-08-16 ### Other changes diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index 74a3db3476..043a2ce8a2 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -16,14 +16,20 @@ export type __AugmentedConst = AugmentedConst declare module '@polkadot/api-base/types/consts' { interface AugmentedConsts { appPromotion: { + /** + * Rate of return for interval in blocks defined in `RecalculationInterval`. + **/ intervalIncome: Perbill & AugmentedConst; + /** + * Decimals for the `Currency`. + **/ nominal: u128 & AugmentedConst; /** * The app's pallet id, used for deriving its sovereign account ID. **/ palletId: FrameSupportPalletId & AugmentedConst; /** - * In relay blocks. + * In parachain blocks. **/ pendingInterval: u32 & AugmentedConst; /** diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 375b6bf248..4db1feeadd 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -13,22 +13,29 @@ declare module '@polkadot/api-base/types/errors' { interface AugmentedErrors { appPromotion: { /** - * Error due to action requiring admin to be set + * Error due to action requiring admin to be set. **/ AdminNotSet: AugmentedError; /** - * An error related to the fact that an invalid argument was passed to perform an action + * Errors caused by incorrect actions with a locked balance. **/ - InvalidArgument: AugmentedError; + IncorrectLockedBalanceOperation: AugmentedError; /** - * No permission to perform an action + * No permission to perform an action. **/ NoPermission: AugmentedError; /** - * Insufficient funds to perform an action + * Insufficient funds to perform an action. **/ NotSufficientFunds: AugmentedError; + /** + * Occurs when a pending unstake cannot be added in this block. PENDING_LIMIT_PER_BLOCK` limits exceeded. + **/ PendingForBlockOverflow: AugmentedError; + /** + * The error is due to the fact that the collection/contract must already be sponsored in order to perform the action. + **/ + SponsorNotSet: AugmentedError; /** * Generic error **/ diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index f6f15f9190..e47d3ef277 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -16,9 +16,37 @@ export type __AugmentedEvent = AugmentedEvent declare module '@polkadot/api-base/types/events' { interface AugmentedEvents { appPromotion: { + /** + * The admin was set + * + * # Arguments + * * AccountId: ID of the admin + **/ SetAdmin: AugmentedEvent; + /** + * Staking was performed + * + * # Arguments + * * AccountId: ID of the staker + * * Balance : staking amount + **/ Stake: AugmentedEvent; + /** + * Staking recalculation was performed + * + * # Arguments + * * AccountId: ID of the staker. + * * Balance : recalculation base + * * Balance : total income + **/ StakingRecalculation: AugmentedEvent; + /** + * Unstaking was performed + * + * # Arguments + * * AccountId: ID of the staker + * * Balance : unstaking amount + **/ Unstake: AugmentedEvent; /** * Generic event diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 8b46e403bf..fc861137cc 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -20,13 +20,10 @@ declare module '@polkadot/api-base/types/storage' { appPromotion: { admin: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** - * Stores hash a record for which the last revenue recalculation was performed. + * Stores a key for record for which the next revenue recalculation would be performed. * If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers. **/ nextCalculatedRecord: AugmentedQuery Observable>>, []> & QueryableStorageEntry; - /** - * Amount of tokens pending unstake per user per block. - **/ pendingUnstake: AugmentedQuery Observable>>, [u32]> & QueryableStorageEntry; /** * Amount of tokens staked by account in the blocknumber. diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index eaa79dc296..880f05235f 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -846,8 +846,9 @@ export interface PalletAppPromotionError extends Enum { readonly isNoPermission: boolean; readonly isNotSufficientFunds: boolean; readonly isPendingForBlockOverflow: boolean; - readonly isInvalidArgument: boolean; - readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'InvalidArgument'; + readonly isSponsorNotSet: boolean; + readonly isIncorrectLockedBalanceOperation: boolean; + readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'IncorrectLockedBalanceOperation'; } /** @name PalletAppPromotionEvent */ diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index fe4c2401f5..1764664dbf 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -3115,7 +3115,7 @@ export default { * Lookup416: pallet_app_promotion::pallet::Error **/ PalletAppPromotionError: { - _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'InvalidArgument'] + _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'SponsorNotSet', 'IncorrectLockedBalanceOperation'] }, /** * Lookup419: pallet_evm::pallet::Error diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 6f86e7f156..b88ce34b65 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -3309,8 +3309,9 @@ declare module '@polkadot/types/lookup' { readonly isNoPermission: boolean; readonly isNotSufficientFunds: boolean; readonly isPendingForBlockOverflow: boolean; - readonly isInvalidArgument: boolean; - readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'InvalidArgument'; + readonly isSponsorNotSet: boolean; + readonly isIncorrectLockedBalanceOperation: boolean; + readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'IncorrectLockedBalanceOperation'; } /** @name PalletEvmError (419) */ From 76541c4e15e0cf3964bc7b76f8d139263d29d7fa Mon Sep 17 00:00:00 2001 From: PraetorP Date: Thu, 8 Sep 2022 19:01:44 +0700 Subject: [PATCH 0798/1274] fix test --- pallets/app-promotion/src/lib.rs | 3 +- pallets/app-promotion/src/tests.rs | 150 ----------------------------- 2 files changed, 1 insertion(+), 152 deletions(-) delete mode 100644 pallets/app-promotion/src/tests.rs diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 1863eaa6df..23172648c9 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -28,8 +28,7 @@ #[cfg(feature = "runtime-benchmarks")] mod benchmarking; -#[cfg(test)] -mod tests; + pub mod types; pub mod weights; diff --git a/pallets/app-promotion/src/tests.rs b/pallets/app-promotion/src/tests.rs deleted file mode 100644 index 2eb43faba8..0000000000 --- a/pallets/app-promotion/src/tests.rs +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -#![cfg(test)] -#![allow(clippy::from_over_into)] -// use crate as pallet_promotion; - -// use frame_benchmarking::{add_benchmark, BenchmarkBatch}; -// use frame_support::{ -// assert_ok, parameter_types, -// traits::{Currency, OnInitialize, Everything, ConstU32}, -// }; -// use frame_system::RawOrigin; -// use sp_core::H256; -// use sp_runtime::{ -// traits::{BlakeTwo256, BlockNumberProvider, IdentityLookup}, -// testing::Header, -// Perbill, Perquintill, -// }; - -// type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; -// type Block = frame_system::mocking::MockBlock; - -// parameter_types! { -// pub const BlockHashCount: u64 = 250; -// pub BlockWeights: frame_system::limits::BlockWeights = -// frame_system::limits::BlockWeights::simple_max(1024); -// pub const SS58Prefix: u8 = 42; -// pub TreasuryAccountId: u64 = 1234; -// pub const InflationBlockInterval: u32 = 100; // every time per how many blocks inflation is applied -// pub static MockBlockNumberProvider: u64 = 0; -// pub const ExistentialDeposit: u64 = 1; -// pub const MaxLocks: u32 = 50; -// } - -// impl BlockNumberProvider for MockBlockNumberProvider { -// type BlockNumber = u64; - -// fn current_block_number() -> Self::BlockNumber { -// Self::get() -// } -// } - -// frame_support::construct_runtime!( -// pub enum Test where -// Block = Block, -// NodeBlock = Block, -// UncheckedExtrinsic = UncheckedExtrinsic, -// { -// Balances: pallet_balances::{Pallet, Call, Storage}, -// System: frame_system::{Pallet, Call, Config, Storage, Event}, -// Promotion: pallet_promotion::{Pallet, Call, Storage} -// } -// ); - -// impl frame_system::Config for Test { -// type BaseCallFilter = Everything; -// type BlockWeights = (); -// type BlockLength = (); -// type DbWeight = (); -// type Origin = Origin; -// type Call = Call; -// type Index = u64; -// type BlockNumber = u64; -// type Hash = H256; -// type Hashing = BlakeTwo256; -// type AccountId = u64; -// type Lookup = IdentityLookup; -// type Header = Header; -// type Event = (); -// type BlockHashCount = BlockHashCount; -// type Version = (); -// type PalletInfo = PalletInfo; -// type AccountData = pallet_balances::AccountData; -// type OnNewAccount = (); -// type OnKilledAccount = (); -// type SystemWeightInfo = (); -// type SS58Prefix = SS58Prefix; -// type OnSetCode = (); -// type MaxConsumers = ConstU32<16>; -// } - -// impl pallet_balances::Config for Test { -// type AccountStore = System; -// type Balance = u64; -// type DustRemoval = (); -// type Event = (); -// type ExistentialDeposit = ExistentialDeposit; -// type WeightInfo = (); -// type MaxLocks = MaxLocks; -// type MaxReserves = (); -// type ReserveIdentifier = [u8; 8]; -// } - -// impl pallet_promotion::Config for Test { -// type Currency = Balances; - -// type TreasuryAccountId = TreasuryAccountId; - -// type BlockNumberProvider = MockBlockNumberProvider; -// } - -// pub fn new_test_ext() -> sp_io::TestExternalities { -// frame_system::GenesisConfig::default() -// .build_storage::() -// .unwrap() -// .into() -// } - -// #[test] -// fn test_benchmark() { -// new_test_ext().execute_with(|| { -// test_benchmark_stake::(); -// } ) -// } - -// #[test] -// fn test_perbill() { -// const ONE_UNIQE: u128 = 1_000_000_000_000_000_000; -// const SECONDS_TO_BLOCK: u32 = 12; -// const DAY: u32 = 60 * 60 * 24 / SECONDS_TO_BLOCK; -// const RECALCULATION_INTERVAL: u32 = 10; -// let day_rate = Perbill::from_rational(5u64, 10_000); -// let interval_rate = -// Perbill::from_rational::(RECALCULATION_INTERVAL.into(), DAY.into()) * day_rate; -// println!("{:?}", interval_rate * ONE_UNIQE + ONE_UNIQE); -// println!("{:?}", day_rate * ONE_UNIQE); -// println!("{:?}", Perbill::one() * ONE_UNIQE); -// println!("{:?}", ONE_UNIQE); -// let mut next_iters = ONE_UNIQE + interval_rate * ONE_UNIQE; -// next_iters += interval_rate * next_iters; -// println!("{:?}", next_iters); -// let day_income = day_rate * ONE_UNIQE; -// let interval_income = interval_rate * ONE_UNIQE; -// let ratio = day_income / interval_income; -// println!("{:?} || {:?}", ratio, DAY / RECALCULATION_INTERVAL); -// } From 048106f0de2d3eb13396021feb45cb29f129b190 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Thu, 8 Sep 2022 19:05:10 +0700 Subject: [PATCH 0799/1274] fix format --- pallets/app-promotion/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 23172648c9..ce3b9e9d4f 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -149,21 +149,21 @@ pub mod pallet { /// Amount of accrued interest BalanceOf, ), - + /// Staking was performed /// /// # Arguments /// * AccountId: ID of the staker /// * Balance : staking amount Stake(T::AccountId, BalanceOf), - + /// Unstaking was performed /// /// # Arguments /// * AccountId: ID of the staker /// * Balance : unstaking amount Unstake(T::AccountId, BalanceOf), - + /// The admin was set /// /// # Arguments From 2842dae99c18a57e77b40a6f0efac6cb4547dcf5 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 8 Sep 2022 15:51:08 +0300 Subject: [PATCH 0800/1274] doc: evm config associated type is EvmSponsorshipHandler Signed-off-by: Yaroslav Bolyukin --- doc/sponsoring-flow.drawio.svg | 297 +++++++++++++++++++++++++++++++++ doc/sponsoring-flow.svg | 3 - doc/sponsoring.md | 3 +- 3 files changed, 298 insertions(+), 5 deletions(-) create mode 100644 doc/sponsoring-flow.drawio.svg delete mode 100644 doc/sponsoring-flow.svg diff --git a/doc/sponsoring-flow.drawio.svg b/doc/sponsoring-flow.drawio.svg new file mode 100644 index 0000000000..9ab46811fd --- /dev/null +++ b/doc/sponsoring-flow.drawio.svg @@ -0,0 +1,297 @@ + + + + + + + +
+
+
+ EVM calls +
+
+
+
+ + EVM calls + +
+
+ + + + +
+
+
+
+ Extrinsics +
+
+
+
+
+ + Extrinsics + +
+
+ + + + + + + + +
+
+
+
+ User +
+
+
+
+
+ + User + +
+
+ + + + + + +
+
+
+
+ Substrate +
+
+
+
+
+ + Substrate + +
+
+ + + + + + +
+
+
+
+ Ethereum +
+
+
+
+
+ + Ethereum + +
+
+ + + + + + +
+
+
+ pallet_evm:: +
+ TransactionValidityHack +
+
+
+
+ + pallet_evm::... + +
+
+ + + + + + +
+
+
+

+ + pallet_charge_evm_transaction:: +
+ Config::EvmSponsorshipHandler +
+
+

+
+
+
+
+ + pallet_charge_evm_tr... + +
+
+ + + + + + +
+
+
+ pallet_charge_evm_transaction:: +
+ BridgeSponsorshipHandler +
+
+
+
+ + pallet_charge_evm_transaction::... + +
+
+ + + + + + +
+
+
+ pallet_sponsoring:: +
+ ChargeTransactionPayment +
+
+
+
+
+ + pallet_sponsoring::... + +
+
+ + + + + +
+
+
+ tx.others +
+
+
+
+ + tx.others + +
+
+ + + + + +
+
+
+
+ tx.evm.call +
+
+
+
+
+ + tx.evm.call + +
+
+ + + + +
+
+
+
+ pallet_sponsoring:: +
+ Config::SponsorshipHandler +
+
+
+
+
+ + pallet_sponsoring::... + +
+
+ + + + +
+
+
+ SponsorshipHandler<H160, (H160, Vec<u8>), CallContext> +
+
+
+
+ + SponsorshipHandler<H160, (H160, Vec<u8>), CallContext> + +
+
+ + + + +
+
+
+ SponsorshipHandler<AccountId, Call, ()> +
+
+
+
+ + SponsorshipHandler<AccountId, Call, ()> + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
diff --git a/doc/sponsoring-flow.svg b/doc/sponsoring-flow.svg deleted file mode 100644 index 3b1a8e8803..0000000000 --- a/doc/sponsoring-flow.svg +++ /dev/null @@ -1,3 +0,0 @@ - - -
EVM calls
EVM calls
Extrinsics
Extrinsics
User
User
Substrate
Substrate
Ethereum
Ethereum
pallet_evm::
TransactionValidityHack
pallet_evm::...

pallet_charge_evm_transaction::
Config::SponsorshipHandler

pallet_charge_evm_tr...
pallet_charge_evm_transaction::
BridgeSponsorshipHandler
pallet_charge_evm_transaction::...
pallet_sponsoring::
ChargeTransactionPayment
pallet_sponsoring::...
tx.others
tx.others
tx.evm.call
tx.evm.call
pallet_sponsoring::
Config::SponsorshipHandler
pallet_sponsoring::...
SponsorshipHandler<H160, (H160, Vec<u8>), CallContext>
SponsorshipHandler<H160, (H160, Vec<u8>), CallContext>
SponsorshipHandler<AccountId, Call, ()>
SponsorshipHandler<AccountId, Call, ()>
Viewer does not support full SVG 1.1
\ No newline at end of file diff --git a/doc/sponsoring.md b/doc/sponsoring.md index 2bc1b41949..d433073852 100644 --- a/doc/sponsoring.md +++ b/doc/sponsoring.md @@ -1,7 +1,6 @@ # Sponsoring - -![Sponsoring flow](./sponsoring-flow.svg) +![Sponsoring flow](./sponsoring-flow.drawio.svg) ## Implementation From 4c8a7ebee4f62b8eeba553a291cdef63bdb0dafc Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 8 Sep 2022 16:07:19 +0300 Subject: [PATCH 0801/1274] doc: fix sponsor type for ethereum Signed-off-by: Yaroslav Bolyukin --- doc/sponsoring-flow.drawio.svg | 24 ++++++++++++++++-------- doc/sponsoring.md | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/doc/sponsoring-flow.drawio.svg b/doc/sponsoring-flow.drawio.svg index 9ab46811fd..2a8298df95 100644 --- a/doc/sponsoring-flow.drawio.svg +++ b/doc/sponsoring-flow.drawio.svg @@ -1,6 +1,14 @@ - - - + + + + + + + + + + + @@ -251,20 +259,20 @@ - + -
+
- SponsorshipHandler<H160, (H160, Vec<u8>), CallContext> + SponsorshipHandler<CrossAccountId, (H160, Vec<u8>), CallContext>
- - SponsorshipHandler<H160, (H160, Vec<u8>), CallContext> + + SponsorshipHandler<CrossAccountId, (H160, Vec<u8>), CallContext> diff --git a/doc/sponsoring.md b/doc/sponsoring.md index d433073852..2ee70b0b89 100644 --- a/doc/sponsoring.md +++ b/doc/sponsoring.md @@ -6,7 +6,7 @@ If you need to add sponsoring for pallet call, you should implement `SponsorshipHandler` -If you need to add sponsoring for EVM contract call, you should implement `SponsorshipHandler), CallContext>` +If you need to add sponsoring for EVM contract call, you should implement `SponsorshipHandler), CallContext>` For both examples, you can take a look at `UniqueSponsorshipHandler` struct inside of common runtime From 1dbc0313421341c6e0fedeeb8d693af57051b2ec Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Thu, 8 Sep 2022 13:30:37 +0000 Subject: [PATCH 0802/1274] Fix tests Add waiter function Remove global before script Remove useless logs Fix refungible tests --- tests/src/app-promotion.test.ts | 52 +++++++++++++++++++++--- tests/src/refungible.test.ts | 8 ++-- tests/src/util/playgrounds/unique.dev.ts | 2 +- 3 files changed, 52 insertions(+), 10 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index c2f11b5f83..5787071468 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -28,6 +28,7 @@ import {usingPlaygrounds} from './util/playgrounds'; import {encodeAddress} from '@polkadot/util-crypto'; import {stringToU8a} from '@polkadot/util'; import {SponsoringMode, contractHelpers, createEthAccountWithBalance, deployFlipper, itWeb3, transferBalanceToEth} from './eth/util/helpers'; +import {DevUniqueHelper} from './util/playgrounds/unique.dev'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -40,9 +41,9 @@ const LOCKING_PERIOD = 20n; // 20 blocks of relay const UNLOCKING_PERIOD = 10n; // 20 blocks of parachain const rewardAvailableInBlock = (stakedInBlock: bigint) => (stakedInBlock - stakedInBlock % LOCKING_PERIOD) + (LOCKING_PERIOD * 2n); -before(async function () { +const beforeEach = async (context: Mocha.Context) => { await usingPlaygrounds(async (helper, privateKey) => { - if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); + if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) context.skip(); alice = privateKey('//Alice'); palletAdmin = privateKey('//Charlie'); // TODO use custom address await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); @@ -51,9 +52,13 @@ before(async function () { await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal); accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests }); -}); +}; describe('app-promotions.stake extrinsic', () => { + before(async function () { + await beforeEach(this); + }); + it('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async () => { await usingPlaygrounds(async (helper) => { const [staker, recepient] = [accounts.pop()!, accounts.pop()!]; @@ -128,6 +133,10 @@ describe('app-promotions.stake extrinsic', () => { }); describe('unstake balance extrinsic', () => { + before(async function () { + await beforeEach(this); + }); + it('should change balance state from "frozen" to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => { await usingPlaygrounds(async helper => { const [staker, recepient] = [accounts.pop()!, accounts.pop()!]; @@ -247,6 +256,10 @@ describe('unstake balance extrinsic', () => { }); describe('Admin adress', () => { + before(async function () { + await beforeEach(this); + }); + it('can be set by sudo only', async () => { await usingPlaygrounds(async (helper) => { const nonAdmin = accounts.pop()!; @@ -291,6 +304,7 @@ describe('Admin adress', () => { describe('App-promotion collection sponsoring', () => { before(async function () { + await beforeEach(this); await usingPlaygrounds(async (helper) => { const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})); await helper.signTransaction(alice, tx); @@ -394,6 +408,10 @@ describe('App-promotion collection sponsoring', () => { }); describe('app-promotion stopSponsoringCollection', () => { + before(async function () { + await beforeEach(this); + }); + it('can not be called by non-admin', async () => { await usingPlaygrounds(async (helper) => { const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!]; @@ -450,6 +468,10 @@ describe('app-promotion stopSponsoringCollection', () => { }); describe('app-promotion contract sponsoring', () => { + before(async function () { + await beforeEach(this); + }); + itWeb3('should set palletes address as a sponsor', async ({api, web3, privateKeyWrapper}) => { await usingPlaygrounds(async (helper) => { const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); @@ -570,6 +592,10 @@ describe('app-promotion contract sponsoring', () => { }); describe('app-promotion stopSponsoringContract', () => { + before(async function () { + await beforeEach(this); + }); + itWeb3('should remove pallet address from contract sponsors', async ({api, web3, privateKeyWrapper}) => { await usingPlaygrounds(async (helper) => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -624,6 +650,10 @@ describe('app-promotion stopSponsoringContract', () => { }); describe('app-promotion rewards', () => { + before(async function () { + await beforeEach(this); + }); + it('can not be called by non admin', async () => { await usingPlaygrounds(async (helper) => { const nonAdmin = accounts.pop()!; @@ -634,11 +664,13 @@ describe('app-promotion rewards', () => { it('should credit 0.05% for staking period', async () => { await usingPlaygrounds(async helper => { const staker = accounts.pop()!; + + await waitPromotionPeriodDoesntEnd(helper); await helper.staking.stake(staker, 100n * nominal); await helper.staking.stake(staker, 200n * nominal); - // wair rewards are available: + // wait rewards are available: const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[1][0]; await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock)); @@ -688,7 +720,6 @@ describe('app-promotion rewards', () => { }); it('should bring compound interest', async () => { - // TODO flaky test await usingPlaygrounds(async helper => { const staker = accounts.pop()!; @@ -756,3 +787,14 @@ function calculateIncome(base: bigint, calcPeriod: bigint, iter = 0): bigint { return calculateIncome(income, calcPeriod, iter - 1); } else return income; } + +// Wait while promotion period less than specified block, to avoid boundary cases +// 0 if this should be the beginning of the period. +async function waitPromotionPeriodDoesntEnd(helper: DevUniqueHelper, waitBlockLessThan = LOCKING_PERIOD / 3n) { + const relayBlockNumber = (await helper.api!.query.parachainSystem.validationData()).value.relayParentNumber.toNumber(); // await helper.chain.getLatestBlockNumber(); + const currentPeriodBlock = BigInt(relayBlockNumber) % LOCKING_PERIOD; + + if (currentPeriodBlock > waitBlockLessThan) { + await helper.wait.forRelayBlockNumber(BigInt(relayBlockNumber) + LOCKING_PERIOD - currentPeriodBlock); + } +} diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 0a79499bd9..57af9d8fae 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -245,8 +245,8 @@ describe('integration test: Refungible functionality:', async () => { section: 'common', index: '0x4202', data: [ - collection.collectionId.toString(), - token.tokenId.toString(), + helper.api!.createType('u32', collection.collectionId).toHuman(), + helper.api!.createType('u32', token.tokenId).toHuman(), {Substrate: alice.address}, '100', ], @@ -265,8 +265,8 @@ describe('integration test: Refungible functionality:', async () => { section: 'common', index: '0x4203', data: [ - collection.collectionId.toString(), - token.tokenId.toString(), + helper.api!.createType('u32', collection.collectionId).toHuman(), + helper.api!.createType('u32', token.tokenId).toHuman(), {Substrate: alice.address}, '50', ], diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index e7b3621abd..4f669f82f4 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -35,7 +35,7 @@ export class SilentConsole { for (const arg of args) { if (typeof arg !== 'string') continue; - if (arg.includes('1000:: Normal connection closure') || arg.includes('Not decorating unknown runtime apis: UniqueApi/2, RmrkApi/1') || arg.includes('RPC methods not decorated:') || arg === 'Normal connection closure') + if (arg.includes('1000:: Normal connection closure') || arg.includes('Not decorating unknown runtime apis:') || arg.includes('RPC methods not decorated:') || arg === 'Normal connection closure') return; } printer(...args); From b0804803ce7e81c3b73f66f6189665172c3ae687 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 8 Sep 2022 17:28:56 +0300 Subject: [PATCH 0803/1274] re-create branch --- .github/workflows/canary.yml | 12 + .github/workflows/ci-develop.yml | 34 +++ .github/workflows/ci-master.yml | 35 +++ .github/workflows/codestyle_v2.yml | 43 ++++ ...build-tests.yml => dev-build-tests_v2.yml} | 37 +-- .github/workflows/execution-matrix.yml | 42 ++++ ...e-data.yml => forkless-update-data_v2.yml} | 59 +---- ...data.yml => forkless-update-nodata_v2.yml} | 49 +--- .github/workflows/forkless.yml | 18 ++ .../workflows/generate-execution-matrix.yml | 45 ++++ .github/workflows/market-test.yml | 227 ++++++++++++++++++ .github/workflows/market-test_v2.yml | 211 ++++++++++++++++ ...nly-update.yml => node-only-update_v2.yml} | 44 +--- .github/workflows/test_codestyle_v2.yml | 20 ++ .github/workflows/tests_codestyle.yml | 49 ---- .../{try-runtime.yml => try-runtime_v2.yml} | 47 +--- .../{unit-test.yml => unit-test_v2.yml} | 35 +-- .github/workflows/xcm-testnet-build.yml | 151 ++++++++++++ .github/workflows/xcm-tests_v2.yml | 175 ++++++++++++++ .github/workflows/xcm.yml | 19 ++ 20 files changed, 1064 insertions(+), 288 deletions(-) create mode 100644 .github/workflows/canary.yml create mode 100644 .github/workflows/ci-develop.yml create mode 100644 .github/workflows/ci-master.yml create mode 100644 .github/workflows/codestyle_v2.yml rename .github/workflows/{dev-build-tests.yml => dev-build-tests_v2.yml} (68%) create mode 100644 .github/workflows/execution-matrix.yml rename .github/workflows/{forkless-update-data.yml => forkless-update-data_v2.yml} (78%) rename .github/workflows/{forkless-update-nodata.yml => forkless-update-nodata_v2.yml} (78%) create mode 100644 .github/workflows/forkless.yml create mode 100644 .github/workflows/generate-execution-matrix.yml create mode 100644 .github/workflows/market-test.yml create mode 100644 .github/workflows/market-test_v2.yml rename .github/workflows/{nodes-only-update.yml => node-only-update_v2.yml} (86%) create mode 100644 .github/workflows/test_codestyle_v2.yml delete mode 100644 .github/workflows/tests_codestyle.yml rename .github/workflows/{try-runtime.yml => try-runtime_v2.yml} (58%) rename .github/workflows/{unit-test.yml => unit-test_v2.yml} (54%) create mode 100644 .github/workflows/xcm-testnet-build.yml create mode 100644 .github/workflows/xcm-tests_v2.yml create mode 100644 .github/workflows/xcm.yml diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml new file mode 100644 index 0000000000..f659abcc45 --- /dev/null +++ b/.github/workflows/canary.yml @@ -0,0 +1,12 @@ +on: + workflow_call: + +jobs: + + market-e2e-test: + name: market e2e tests + uses: ./.github/workflows/market-test_v2.yml + secrets: inherit + + + diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml new file mode 100644 index 0000000000..a496514af9 --- /dev/null +++ b/.github/workflows/ci-develop.yml @@ -0,0 +1,34 @@ +name: develop + +on: + pull_request: + branches: [ 'develop' ] + types: [ opened, reopened, synchronize, ready_for_review ] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + + yarn-test-dev: + uses: ./.github/workflows/dev-build-tests_v2.yml + + unit-test: + uses: ./.github/workflows/unit-test_v2.yml + + canary: + if: ${{ contains( github.event.pull_request.labels.*.name, 'canary') }} + uses: ./.github/workflows/canary.yml + secrets: inherit # pass all secrets + + xcm: + if: ${{ contains( github.event.pull_request.labels.*.name, 'xcm') }} + uses: ./.github/workflows/xcm.yml + secrets: inherit # pass all secrets + + codestyle: + uses: ./.github/workflows/codestyle_v2.yml + + yarn_eslint: + uses: ./.github/workflows/test_codestyle_v2.yml diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml new file mode 100644 index 0000000000..6ef006e78d --- /dev/null +++ b/.github/workflows/ci-master.yml @@ -0,0 +1,35 @@ +name: master + +on: + pull_request: + branches: [ 'master' ] + types: [ opened, reopened, synchronize, ready_for_review ] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + + unit-test: + uses: ./.github/workflows/unit-test_v2.yml + + node-only-update: + uses: ./.github/workflows/node-only-update_v2.yml + + forkless: + if: ${{ contains( github.event.pull_request.labels.*.name, 'forkless') }} + uses: ./.github/workflows/forkless.yml + + canary: + if: ${{ contains( github.event.pull_request.labels.*.name, 'canary') }} + uses: ./.github/workflows/canary.yml + secrets: inherit # pass all secrets + + xcm: + if: ${{ contains( github.event.pull_request.labels.*.name, 'xcm') }} + uses: ./.github/workflows/xcm.yml + secrets: inherit # pass all secrets + + codestyle: + uses: ./.github/workflows/codestyle_v2.yml \ No newline at end of file diff --git a/.github/workflows/codestyle_v2.yml b/.github/workflows/codestyle_v2.yml new file mode 100644 index 0000000000..3ecce37b21 --- /dev/null +++ b/.github/workflows/codestyle_v2.yml @@ -0,0 +1,43 @@ +name: cargo fmt + +on: + workflow_call: + +jobs: + rustfmt: + runs-on: self-hosted-ci + + steps: + - uses: actions/checkout@v3 + - name: Install latest nightly + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + default: true + target: wasm32-unknown-unknown + components: rustfmt, clippy + - name: Run cargo fmt + run: cargo fmt -- --check # In that mode it returns only exit code. + - name: Cargo fmt state + if: success() + run: echo "Nothing to do. Command 'cargo fmt -- --check' returned exit code 0." + + + clippy: + if: ${{ false }} + runs-on: self-hosted-ci + + steps: + + - uses: actions/checkout@v3 + - name: Install substrate dependencies + run: sudo apt-get install libssl-dev pkg-config libclang-dev clang + - name: Install latest nightly + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + default: true + target: wasm32-unknown-unknown + components: rustfmt, clippy + - name: Run cargo check + run: cargo clippy -- -Dwarnings diff --git a/.github/workflows/dev-build-tests.yml b/.github/workflows/dev-build-tests_v2.yml similarity index 68% rename from .github/workflows/dev-build-tests.yml rename to .github/workflows/dev-build-tests_v2.yml index a8536f765e..ba84fc4ae7 100644 --- a/.github/workflows/dev-build-tests.yml +++ b/.github/workflows/dev-build-tests_v2.yml @@ -3,25 +3,13 @@ name: yarn test dev # Controls when the action will run. on: # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - develop - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + workflow_call: + #Define Workflow variables env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -46,23 +34,6 @@ jobs: features: "unique-runtime" steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 @@ -96,12 +67,14 @@ jobs: node-version: 16 - name: Run tests + working-directory: tests run: | - cd tests yarn install yarn add mochawesome echo "Ready to start tests" node scripts/readyness.js + echo "Ready to start tests" + yarn polkadot-types NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ diff --git a/.github/workflows/execution-matrix.yml b/.github/workflows/execution-matrix.yml new file mode 100644 index 0000000000..d4c84df10d --- /dev/null +++ b/.github/workflows/execution-matrix.yml @@ -0,0 +1,42 @@ +name: Reusable workflow + +on: + workflow_call: + # Map the workflow outputs to job outputs + outputs: + matrix: + description: "The first output string" + value: ${{ jobs.create-matrix.outputs.matrix_output }} + +jobs: + + create-marix: + + name: Prepare execution matrix + + runs-on: self-hosted-ci + outputs: + matrix_output: ${{ steps.create_matrix.outputs.matrix }} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: CertainLach/create-matrix-action@v3 + id: create_matrix + with: + matrix: | + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} + network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} + network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} + diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data_v2.yml similarity index 78% rename from .github/workflows/forkless-update-data.yml rename to .github/workflows/forkless-update-data_v2.yml index 95c872373a..f096e8c8d8 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data_v2.yml @@ -1,34 +1,18 @@ -name: upgrade replica - # Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + workflow_call: + #Define Workflow variables env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - prepare-execution-marix: + execution-marix: - name: Prepare execution matrix + name: execution matrix runs-on: self-hosted-ci outputs: @@ -56,44 +40,21 @@ jobs: network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} - - forkless-update-data: - needs: prepare-execution-marix + needs: execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] timeout-minutes: 1380 - - - + name: ${{ matrix.network }} - - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - strategy: matrix: - include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + include: ${{fromJson(needs.execution-marix.outputs.matrix)}} + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 + steps: - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 @@ -201,4 +162,4 @@ jobs: - name: Stop running containers if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down --volumes diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata_v2.yml similarity index 78% rename from .github/workflows/forkless-update-nodata.yml rename to .github/workflows/forkless-update-nodata_v2.yml index e666df9f62..b0d7298559 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata_v2.yml @@ -1,32 +1,17 @@ -name: upgrade nodata + # Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + workflow_call: + #Define Workflow variables env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - - prepare-execution-marix: + execution-marix: name: Prepare execution matrix @@ -57,14 +42,11 @@ jobs: network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} - forkless-update-nodata: - needs: prepare-execution-marix + needs: execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] - - timeout-minutes: 1380 name: ${{ matrix.network }} @@ -73,28 +55,9 @@ jobs: strategy: matrix: - include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} - + include: ${{fromJson(needs.execution-marix.outputs.matrix)}} steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 diff --git a/.github/workflows/forkless.yml b/.github/workflows/forkless.yml new file mode 100644 index 0000000000..819a4decfa --- /dev/null +++ b/.github/workflows/forkless.yml @@ -0,0 +1,18 @@ +name: Nesting Forkless + +on: + workflow_call: + +jobs: + + forkless-update-data: + name: with data + uses: ./.github/workflows/forkless-update-data_v2.yml + + forkless-update-no-data: + name: no data + uses: ./.github/workflows/forkless-update-nodata_v2.yml + + try-runtime: + name: try-runtime + uses: ./.github/workflows/try-runtime_v2.yml diff --git a/.github/workflows/generate-execution-matrix.yml b/.github/workflows/generate-execution-matrix.yml new file mode 100644 index 0000000000..48d7ae8e6f --- /dev/null +++ b/.github/workflows/generate-execution-matrix.yml @@ -0,0 +1,45 @@ +name: Prepare execution matrix + +on: + workflow_call: + # Map the workflow outputs to job outputs + outputs: + matrix_values: + description: "Matix output" + matrix: ${{ jobs.prepare-execution-matrix.outputs.matrix }} + + +#concurrency: +# group: ${{ github.workflow }}-${{ github.head_ref }} +# cancel-in-progress: true + + +jobs: + prepare-execution-matrix: + name: Generate output + runs-on: self-hosted-ci + # Map the job outputs to step outputs + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: CertainLach/create-matrix-action@v3 + id: create_matrix + with: + matrix: | + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} + network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} + network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} diff --git a/.github/workflows/market-test.yml b/.github/workflows/market-test.yml new file mode 100644 index 0000000000..e1fae8137c --- /dev/null +++ b/.github/workflows/market-test.yml @@ -0,0 +1,227 @@ +name: market api tests + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: + - master + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + - ready_for_review + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + market_test: + # The type of runner that the job will run on + runs-on: [self-hosted-ci,large] + timeout-minutes: 1380 + + strategy: + matrix: + include: + - network: "opal" + features: "opal-runtime" + - network: "quartz" + features: "quartz-runtime" + - network: "unique" + features: "unique-runtime" + + name: draft job + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + + steps: +# - name: Skip if pull request is in Draft + # `if: github.event.pull_request.draft == true` should be kept here, at + # the step level, rather than at the job level. The latter is not + # recommended because when the PR is moved from "Draft" to "Ready to + # review" the workflow will immediately be passing (since it was skipped), + # even though it hasn't actually ran, since it takes a few seconds for + # the workflow to start. This is also disclosed in: + # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 + # That scenario would open an opportunity for the check to be bypassed: + # 1. Get your PR approved + # 2. Move it to Draft + # 3. Push whatever commits you want + # 4. Move it to "Ready for review"; now the workflow is passing (it was + # skipped) and "Check reviews" is also passing (it won't be updated + # until the workflow is finished) +# if: github.event.pull_request.draft == true +# run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout master repo + uses: actions/checkout@master + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Checkout Market e2e tests + uses: actions/checkout@v3 + with: + repository: 'UniqueNetwork/market-e2e-tests' + ssh-key: '${{ secrets.GH_PAT }}' + path: 'qa-tests' + ref: 'QA-65_maxandreev' + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Copy qa-tests/.env.example to qa-tests/.env + working-directory: qa-tests + run: cp .env.docker .env + + - name: Show content of qa-test/.env + working-directory: qa-tests + run: cat .env + + - name: Read qa -test .env file + uses: xom9ikk/dotenv@v1.0.2 + with: + path: qa-tests/ + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: qa-tests/.docker/docker-compose.tmp-market.j2 + output_file: qa-tests/.docker/docker-compose.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + FEATURE=${{ matrix.features }} + BRANCH=${{ github.head_ref }} + + + - name: Show build configuration + working-directory: qa-tests + run: cat .docker/docker-compose.${{ matrix.network }}.yml + + - name: Start node-parachain + working-directory: qa-tests + run: docker-compose -f ".docker/docker-compose.market.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate node-parachain + + - name: Start nonce-app + working-directory: qa-tests + run: docker-compose -f ".docker/docker-compose.market.yml" up -d --build --remove-orphans --force-recreate nonce-app + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Setup TypeScript + working-directory: qa-tests + run: | + npm install + npm install -g ts-node + + - name: Copy qa-tests/.env.example to qa-tests/.env + working-directory: qa-tests + run: | + rm -rf .env + cp .env.example .env + + + - name: Show content of qa-test/.env + working-directory: qa-tests + run: cat .env + + + - name: Read qa -test .env file + uses: xom9ikk/dotenv@v1.0.2 + with: + path: qa-tests/ + + - name: Generate accounts + working-directory: qa-tests + run: ts-node ./src/scripts/create-market-accounts.ts + + - name: Deploy contracts + run: | + cd qa-tests + ts-node ./src/scripts/deploy-contract.ts + + - name: Import test data + working-directory: qa-tests + run: ts-node ./src/scripts/create-test-collections.ts + + - name: Show content of qa-test .env + working-directory: qa-tests + run: cat .env + + - name: Copy qa-tests/.env.example to qa-tests/.env + working-directory: qa-tests + run: | + rm -rf .env.docker + cp .env .env.docker + sed -i '/UNIQUE_WS_ENDPOINT/c UNIQUE_WS_ENDPOINT=ws://node-parachain:9944' .env.docker + + - name: Read qa -test .env file + uses: xom9ikk/dotenv@v1.0.2 + with: + path: qa-tests/ + + - name: local-market:start + run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" up -d --build + + - name: Wait for market readyness + working-directory: qa-tests + run: src/scripts/wait-market-ready.sh + shell: bash + + - name: Install dependecies + working-directory: qa-tests + run: | + npm ci + npm install -D @playwright/test + npx playwright install-deps + npx playwright install + + - name: + working-directory: qa-tests + run: | + npx playwright test --workers=8 --quiet .*.api.test.ts --reporter=github --config playwright.config.ts + + - name: Show env variables + if: success() || failure() + run: printenv + + - name: look up for report + if: success() || failure() + run: | + ls -la + ls -la qa-tests/ + + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f + docker system prune -f + + - name: Clean Workspace + if: always() + uses: AutoModality/action-clean@v1.1.0 + + + + diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml new file mode 100644 index 0000000000..37b5286306 --- /dev/null +++ b/.github/workflows/market-test_v2.yml @@ -0,0 +1,211 @@ +name: market api tests + +# Controls when the action will run. +on: + workflow_call: + + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + market_test: + # The type of runner that the job will run on + runs-on: [self-hosted-ci,large] + timeout-minutes: 1380 + + name: ${{ matrix.network }} + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: + - network: "opal" + features: "opal-runtime" + - network: "quartz" + features: "quartz-runtime" + - network: "unique" + features: "unique-runtime" + + steps: + + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout master repo + uses: actions/checkout@master + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Checkout Market e2e tests + uses: actions/checkout@v3 + with: + repository: 'UniqueNetwork/market-e2e-tests' + ssh-key: ${{ secrets.GH_PAT }} + path: 'qa-tests' +# ref: 'CI-37-core-ci-step-3' + ref: 'ci_test_v2' + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Copy qa-tests/.env.example to qa-tests/.env + working-directory: qa-tests + run: cp .env.docker .env + + - name: Show content of qa-test/.env + working-directory: qa-tests + run: cat .env + + - name: Read qa -test .env file + uses: xom9ikk/dotenv@v1.0.2 + with: + path: qa-tests/ + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: qa-tests/.docker/docker-compose.tmp-market.j2 + output_file: qa-tests/.docker/docker-compose.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + FEATURE=${{ matrix.features }} + BRANCH=${{ github.head_ref }} + + + - name: Show build configuration + working-directory: qa-tests + run: cat .docker/docker-compose.${{ matrix.network }}.yml + + - name: Start node-parachain + working-directory: qa-tests + run: docker-compose -f ".docker/docker-compose.market.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate node-parachain + + - name: Start nonce-app + working-directory: qa-tests + run: docker-compose -f ".docker/docker-compose.market.yml" up -d --build --remove-orphans --force-recreate nonce-app + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Setup TypeScript + working-directory: qa-tests + run: | + npm install + npm install -g ts-node + + - name: Copy qa-tests/.env.example to qa-tests/.env + working-directory: qa-tests + run: | + rm -rf .env + cp .env.example .env + + + - name: Show content of qa-test/.env + working-directory: qa-tests + run: cat .env + + + - name: Read qa -test .env file + uses: xom9ikk/dotenv@v1.0.2 + with: + path: qa-tests/ + + - name: Generate accounts + working-directory: qa-tests + run: ts-node ./src/scripts/create-market-accounts.ts + + - name: Get chain logs + if: always() # run this step always + run: | + docker run node-parachain cat /polkadot-launch/9944.log + docker run node-parachain cat /polkadot-launch/9945.log + docker run node-parachain cat /polkadot-launch/alice.log + docker run node-parachain cat /polkadot-launch/eve.log + docker run node-parachain cat /polkadot-launch/dave.log + docker run node-parachain cat /polkadot-launch/charlie.log + + - name: Deploy contracts + run: | + cd qa-tests + ts-node ./src/scripts/deploy-contract.ts + + - name: Timeout for debug + if: failure() + run: sleep 900s + + - name: Import test data + working-directory: qa-tests + run: ts-node ./src/scripts/create-test-collections.ts + + - name: Show content of qa-test .env + working-directory: qa-tests + run: cat .env + + - name: Copy qa-tests/.env.example to qa-tests/.env.docker + working-directory: qa-tests + run: | + rm -rf .env.docker + cp .env .env.docker + sed -i '/UNIQUE_WS_ENDPOINT/c UNIQUE_WS_ENDPOINT=ws://node-parachain:9944' .env.docker + + - name: Read qa -test .env file Before market start + uses: xom9ikk/dotenv@v1.0.2 + with: + path: qa-tests/ + + - name: local-market:start + run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" up -d --build + + - name: Wait for market readyness + working-directory: qa-tests + run: src/scripts/wait-market-ready.sh + shell: bash + + - name: Install dependecies + working-directory: qa-tests + run: | + npm ci + npm install -D @playwright/test + npx playwright install-deps + npx playwright install + + - name: + working-directory: qa-tests + run: | + npx playwright test --workers=8 --quiet .*.api.test.ts --reporter=github --config playwright.config.ts + + - name: Show env variables + if: success() || failure() + run: printenv + + - name: look up for report + if: success() || failure() + run: | + ls -la + ls -la qa-tests/ + + + - name: Stop running containers + if: always() # run this step always +# run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes + run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down + +# - name: Remove builder cache +# if: always() # run this step always +# run: | +# docker builder prune -f +# docker system prune -f + + - name: Clean Workspace + if: always() + uses: AutoModality/action-clean@v1.1.0 + + + + diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/node-only-update_v2.yml similarity index 86% rename from .github/workflows/nodes-only-update.yml rename to .github/workflows/node-only-update_v2.yml index ae9779349f..fda5d95d27 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -2,33 +2,17 @@ name: nodes-only update # Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - + workflow_call: #Define Workflow variables env: REPO_URL: ${{ github.server_url }}/${{ github.repository }} -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - prepare-execution-marix: + execution-marix: - name: Prepare execution matrix + name: execution matrix runs-on: self-hosted-ci outputs: @@ -59,7 +43,7 @@ jobs: forkless-update-nodata: - needs: prepare-execution-marix + needs: execution-marix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] @@ -75,25 +59,7 @@ jobs: matrix: include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} - steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 @@ -195,6 +161,7 @@ jobs: run: | yarn install yarn add mochawesome + node scripts/readyness.js echo "Ready to start tests" NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: @@ -270,6 +237,7 @@ jobs: run: | yarn install yarn add mochawesome + node scripts/readyness.js echo "Ready to start tests" NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: diff --git a/.github/workflows/test_codestyle_v2.yml b/.github/workflows/test_codestyle_v2.yml new file mode 100644 index 0000000000..a2b08d1c2e --- /dev/null +++ b/.github/workflows/test_codestyle_v2.yml @@ -0,0 +1,20 @@ +name: yarn eslint + +on: + workflow_call: + +jobs: + code_style: + runs-on: [ self-hosted-ci ] + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Install modules + run: cd tests && yarn + - name: Run ESLint + run: cd tests && yarn eslint --ext .ts,.js src/ diff --git a/.github/workflows/tests_codestyle.yml b/.github/workflows/tests_codestyle.yml deleted file mode 100644 index b3063d4fd7..0000000000 --- a/.github/workflows/tests_codestyle.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: yarn eslint - -on: - pull_request: - branches: - - develop - types: - - opened - - reopened - - synchronize - - ready_for_review - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -jobs: - code_style: - runs-on: self-hosted-ci - - steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Install modules - run: cd tests && yarn - - name: Run ESLint - run: cd tests && yarn eslint --ext .ts,.js src/ diff --git a/.github/workflows/try-runtime.yml b/.github/workflows/try-runtime_v2.yml similarity index 58% rename from .github/workflows/try-runtime.yml rename to .github/workflows/try-runtime_v2.yml index 52907787bc..3dcda940e0 100644 --- a/.github/workflows/try-runtime.yml +++ b/.github/workflows/try-runtime_v2.yml @@ -1,27 +1,6 @@ -name: try-runtime - -# Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + workflow_call: -#Define Workflow variables -env: - REPO_URL: ${{ github.server_url }}/${{ github.repository }} - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -37,34 +16,16 @@ jobs: matrix: include: - network: opal - features: try-runtime,opal-runtime + features: opal-runtime replica_from_address: wss://eu-ws-opal.unique.network:443 - network: quartz - features: try-runtime,quartz-runtime + features: quartz-runtime replica_from_address: wss://eu-ws-quartz.unique.network:443 - network: unique - features: try-runtime,unique-runtime + features: unique-runtime replica_from_address: wss://eu-ws.unique.network:443 steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test_v2.yml similarity index 54% rename from .github/workflows/unit-test.yml rename to .github/workflows/unit-test_v2.yml index 1c56e04d25..7a586d10e1 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test_v2.yml @@ -3,22 +3,7 @@ name: unit tests # Controls when the action will run. on: # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - develop - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true + workflow_call: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -34,23 +19,6 @@ jobs: steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 @@ -70,7 +38,6 @@ jobs: output_file: .docker/docker-compose.unit.yml variables: | RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - FEATURE=${{ matrix.features }} - name: Show build configuration diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml new file mode 100644 index 0000000000..ae49f10970 --- /dev/null +++ b/.github/workflows/xcm-testnet-build.yml @@ -0,0 +1,151 @@ +name: xcm-testnet-build + +# Controls when the action will run. +on: + workflow_call: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +#Define Workflow variables +env: + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + prepare-execution-marix: + + name: Prepare execution matrix + + runs-on: [XL] + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: fabiocaccamo/create-matrix-action@v2 + id: create_matrix + with: + matrix: | + network {opal}, runtime {opal}, features {opal-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.WESTMINT_BUILD_BRANCH }}} + network {quartz}, runtime {quartz}, features {quartz-runtime}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONRIVER_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINE_BUILD_BRANCH }}} + network {unique}, runtime {unique}, features {unique-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINT_BUILD_BRANCH }}} + + xcm-build: + + needs: prepare-execution-marix + # The type of runner that the job will run on + runs-on: [XL] + + timeout-minutes: 600 + + name: ${{ matrix.network }} + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + + steps: + - name: Skip if pull request is in Draft + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend Dockerfile file + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-xcm.j2 + output_file: .docker/Dockerfile-xcm.${{ matrix.network }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + NETWORK=${{ matrix.network }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + BRANCH=${{ github.head_ref }} + ACALA_BUILD_BRANCH=${{ matrix.acala_version }} + MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }} + CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }} + + - name: Show build Dockerfile + run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml + + - name: Show launch-config-xcm-${{ matrix.network }} configuration + run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json + + - name: Run find-and-replace to remove slashes from branch name + uses: mad9000/actions-find-and-replace-string@2 + id: branchname + with: + source: ${{ github.head_ref }} + find: '/' + replace: '-' + + - name: Log in to Docker Hub + uses: docker/login-action@v2.0.0 + with: + username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + + - name: Pull acala docker image + run: docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }} + + - name: Pull moonbeam docker image + run: docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} + + - name: Pull cumulus docker image + run: docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} + + - name: Pull polkadot docker image + run: docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} + + - name: Pull chainql docker image + run: docker pull uniquenetwork/builder-chainql:latest + + - name: Build the stack + run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . + + - name: Push docker image version + run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} + + - name: Push docker image latest + run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest + + - name: Clean Workspace + if: always() + uses: AutoModality/action-clean@v1.1.0 + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f + docker system prune -f + + + diff --git a/.github/workflows/xcm-tests_v2.yml b/.github/workflows/xcm-tests_v2.yml new file mode 100644 index 0000000000..cb03f8eb19 --- /dev/null +++ b/.github/workflows/xcm-tests_v2.yml @@ -0,0 +1,175 @@ +name: xcm-tests + +# Controls when the action will run. +on: + # Allows you to run this workflow manually from the Actions tab + workflow_call: + +#Define Workflow variables +env: + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + prepare-execution-marix: + + name: Prepare execution matrix + +# needs: [xcm-testnet-build] + + runs-on: XL + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: fabiocaccamo/create-matrix-action@v2 + id: create_matrix + with: + matrix: | + network {opal}, runtime {opal}, features {opal-runtime}, runtest {testXcmOpal} + network {quartz}, runtime {quartz}, features {quartz-runtime}, runtest {testXcmQuartz} + network {unique}, runtime {unique}, features {unique-runtime}, runtest {testXcmUnique} + + xcm-tests: + needs: prepare-execution-marix + # The type of runner that the job will run on + runs-on: [XL] + + timeout-minutes: 600 + + name: ${{ matrix.network }} + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + + + steps: + - name: Skip if pull request is in Draft + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-xcm-tests.j2 + output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml + variables: | + NETWORK=${{ matrix.network }} + + - name: Show build configuration + run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300 + + # 🚀 POLKADOT LAUNCH COMPLETE 🚀 + - name: Check if docker logs consist messages related to testing of xcm tests + if: success() + run: | + counter=160 + function check_container_status { + docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local + } + function do_docker_logs { + docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1 + } + function is_started { + if [ "$(check_container_status)" == "true" ]; then + echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING"; + echo "Check Docker logs" + DOCKER_LOGS=$(do_docker_logs) + if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then + echo "🚀 POLKADOT LAUNCH COMPLETE 🚀" + return 0 + else + echo "Message not found in logs output, repeating..." + return 1 + fi + else + echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING" + echo "Halting all future checks" + exit 1 + fi + echo "something goes wrong" + exit 1 + } + while ! is_started; do + echo "Waiting for special message in log files " + sleep 30s + counter=$(( $counter - 1 )) + echo "Counter: $counter" + if [ "$counter" -gt "0" ]; then + continue + else + break + fi + done + echo "Halting script" + exit 0 + shell: bash + + - name: Run XCM tests + working-directory: tests + run: | + yarn install + yarn add mochawesome + node scripts/readyness.js + echo "Ready to start tests" + NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW} + + - name: XCM Test Report + uses: phoenix-actions/test-reporting@v8 + id: test-report + if: success() || failure() # run this step even if previous step failed + with: + name: XCM Tests ${{ matrix.network }} # Name of the check run which will be created + path: tests/mochawesome-report/test-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down + + - name: Clean Workspace + if: always() + uses: AutoModality/action-clean@v1.1.0 + + - name: Remove builder cache + if: always() # run this step always + run: | + docker system prune -a -f + diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml new file mode 100644 index 0000000000..c662de8859 --- /dev/null +++ b/.github/workflows/xcm.yml @@ -0,0 +1,19 @@ +name: Nesting XCM + +on: + workflow_call: + + +jobs: + + xcm-testnet-build: + name: testnet build + uses: ./.github/workflows/xcm-testnet-build.yml + secrets: inherit + + xcm-tests: + name: tests + needs: [ xcm-testnet-build ] + uses: ./.github/workflows/xcm-tests_v2.yml + + From cb827be899fb26e460b4a56f02578b141a3f4868 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 8 Sep 2022 18:08:52 +0300 Subject: [PATCH 0804/1274] add test for chain up and running --- .github/workflows/market-test_v2.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index 37b5286306..79370c4af1 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -116,6 +116,13 @@ jobs: with: path: qa-tests/ + - name: Wait for chain up and running + working-directory: tests + run: | + yarn install + node scripts/readyness.js + echo "Ready to start tests" + - name: Generate accounts working-directory: qa-tests run: ts-node ./src/scripts/create-market-accounts.ts From ea8167500201c11bf7aaa90c6930986e4d5db41f Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 8 Sep 2022 18:31:46 +0300 Subject: [PATCH 0805/1274] add cat for .env files before account creation --- .github/workflows/market-test_v2.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index 79370c4af1..d88b9d211c 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -123,19 +123,24 @@ jobs: node scripts/readyness.js echo "Ready to start tests" - - name: Generate accounts + - name: WShow content of .env file and Generate accounts working-directory: qa-tests - run: ts-node ./src/scripts/create-market-accounts.ts + run: | + cat .env + cat .env.example + cat .env.docker + cat .env.example.ci + ts-node ./src/scripts/create-market-accounts.ts - name: Get chain logs if: always() # run this step always run: | - docker run node-parachain cat /polkadot-launch/9944.log - docker run node-parachain cat /polkadot-launch/9945.log - docker run node-parachain cat /polkadot-launch/alice.log - docker run node-parachain cat /polkadot-launch/eve.log - docker run node-parachain cat /polkadot-launch/dave.log - docker run node-parachain cat /polkadot-launch/charlie.log + docker exec node-parachain cat /polkadot-launch/9944.log + docker exec node-parachain cat /polkadot-launch/9945.log + docker exec node-parachain cat /polkadot-launch/alice.log + docker exec node-parachain cat /polkadot-launch/eve.log + docker exec node-parachain cat /polkadot-launch/dave.log + docker exec node-parachain cat /polkadot-launch/charlie.log - name: Deploy contracts run: | From 63d6b97356629832ef06d2e71f0ba525659d8f49 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 8 Sep 2022 21:33:39 +0300 Subject: [PATCH 0806/1274] Debug: step by step. --- .github/workflows/market-test_v2.yml | 144 +++++++++++++-------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index d88b9d211c..4f3a6fe4b8 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -22,10 +22,10 @@ jobs: include: - network: "opal" features: "opal-runtime" - - network: "quartz" - features: "quartz-runtime" - - network: "unique" - features: "unique-runtime" +# - network: "quartz" +# features: "quartz-runtime" +# - network: "unique" +# features: "unique-runtime" steps: @@ -48,21 +48,21 @@ jobs: # ref: 'CI-37-core-ci-step-3' ref: 'ci_test_v2' - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 +# - name: Read .env file +# uses: xom9ikk/dotenv@v1.0.2 - name: Copy qa-tests/.env.example to qa-tests/.env working-directory: qa-tests run: cp .env.docker .env - - name: Show content of qa-test/.env - working-directory: qa-tests - run: cat .env - - - name: Read qa -test .env file - uses: xom9ikk/dotenv@v1.0.2 - with: - path: qa-tests/ +# - name: Show content of qa-test/.env +# working-directory: qa-tests +# run: cat .env +# +# - name: Read qa -test .env file +# uses: xom9ikk/dotenv@v1.0.2 +# with: +# path: qa-tests/ - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 @@ -85,36 +85,36 @@ jobs: working-directory: qa-tests run: docker-compose -f ".docker/docker-compose.market.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate node-parachain - - name: Start nonce-app - working-directory: qa-tests - run: docker-compose -f ".docker/docker-compose.market.yml" up -d --build --remove-orphans --force-recreate nonce-app +# - name: Start nonce-app +# working-directory: qa-tests +# run: docker-compose -f ".docker/docker-compose.market.yml" up -d --build --remove-orphans --force-recreate nonce-app - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 16.17 - name: Setup TypeScript working-directory: qa-tests run: | - npm install npm install -g ts-node + npm install - - name: Copy qa-tests/.env.example to qa-tests/.env + - name: Copy qa-tests/.env.docker to qa-tests/.env working-directory: qa-tests run: | rm -rf .env - cp .env.example .env + cp .env.docker .env - - name: Show content of qa-test/.env - working-directory: qa-tests - run: cat .env +# - name: Show content of qa-test/.env +# working-directory: qa-tests +# run: cat .env - - name: Read qa -test .env file - uses: xom9ikk/dotenv@v1.0.2 - with: - path: qa-tests/ +# - name: Read qa -test .env file +# uses: xom9ikk/dotenv@v1.0.2 +# with: +# path: qa-tests/ - name: Wait for chain up and running working-directory: tests @@ -127,9 +127,9 @@ jobs: working-directory: qa-tests run: | cat .env - cat .env.example - cat .env.docker - cat .env.example.ci +# cat .env.example +# cat .env.docker +# cat .env.example.ci ts-node ./src/scripts/create-market-accounts.ts - name: Get chain logs @@ -151,56 +151,56 @@ jobs: if: failure() run: sleep 900s - - name: Import test data - working-directory: qa-tests - run: ts-node ./src/scripts/create-test-collections.ts +# - name: Import test data +# working-directory: qa-tests +# run: ts-node ./src/scripts/create-test-collections.ts - - name: Show content of qa-test .env - working-directory: qa-tests - run: cat .env +# - name: Show content of qa-test .env +# working-directory: qa-tests +# run: cat .env - - name: Copy qa-tests/.env.example to qa-tests/.env.docker - working-directory: qa-tests - run: | - rm -rf .env.docker - cp .env .env.docker - sed -i '/UNIQUE_WS_ENDPOINT/c UNIQUE_WS_ENDPOINT=ws://node-parachain:9944' .env.docker +# - name: Copy qa-tests/.env.example to qa-tests/.env.docker +# working-directory: qa-tests +# run: | +# rm -rf .env.docker +# cp .env .env.docker +# sed -i '/UNIQUE_WS_ENDPOINT/c UNIQUE_WS_ENDPOINT=ws://node-parachain:9944' .env.docker - - name: Read qa -test .env file Before market start - uses: xom9ikk/dotenv@v1.0.2 - with: - path: qa-tests/ +# - name: Read qa -test .env file Before market start +# uses: xom9ikk/dotenv@v1.0.2 +# with: +# path: qa-tests/ - - name: local-market:start - run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" up -d --build +# - name: local-market:start +# run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" up -d --build - - name: Wait for market readyness - working-directory: qa-tests - run: src/scripts/wait-market-ready.sh - shell: bash +# - name: Wait for market readyness +# working-directory: qa-tests +# run: src/scripts/wait-market-ready.sh +# shell: bash - - name: Install dependecies - working-directory: qa-tests - run: | - npm ci - npm install -D @playwright/test - npx playwright install-deps - npx playwright install +# - name: Install dependecies +# working-directory: qa-tests +# run: | +# npm ci +# npm install -D @playwright/test +# npx playwright install-deps +# npx playwright install - - name: - working-directory: qa-tests - run: | - npx playwright test --workers=8 --quiet .*.api.test.ts --reporter=github --config playwright.config.ts +# - name: +# working-directory: qa-tests +# run: | +# npx playwright test --workers=8 --quiet .*.api.test.ts --reporter=github --config playwright.config.ts - - name: Show env variables - if: success() || failure() - run: printenv +# - name: Show env variables +# if: success() || failure() +# run: printenv - - name: look up for report - if: success() || failure() - run: | - ls -la - ls -la qa-tests/ +# - name: look up for report +# if: success() || failure() +# run: | +# ls -la +# ls -la qa-tests/ - name: Stop running containers From e6a17a2033b4a71067eeb08d744aec1556fd96ca Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 8 Sep 2022 21:35:49 +0300 Subject: [PATCH 0807/1274] Remove commented strings --- .github/workflows/market-test_v2.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index 4f3a6fe4b8..a9ff69dbf7 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -127,9 +127,6 @@ jobs: working-directory: qa-tests run: | cat .env -# cat .env.example -# cat .env.docker -# cat .env.example.ci ts-node ./src/scripts/create-market-accounts.ts - name: Get chain logs From effb507bcaf48f7c078112b8db4b46c9e6e2784f Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 8 Sep 2022 21:48:56 +0300 Subject: [PATCH 0808/1274] read .env from unique-chain repo --- .github/workflows/market-test_v2.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index a9ff69dbf7..a7754d06bb 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -48,8 +48,8 @@ jobs: # ref: 'CI-37-core-ci-step-3' ref: 'ci_test_v2' -# - name: Read .env file -# uses: xom9ikk/dotenv@v1.0.2 + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 - name: Copy qa-tests/.env.example to qa-tests/.env working-directory: qa-tests @@ -60,7 +60,7 @@ jobs: # run: cat .env # # - name: Read qa -test .env file -# uses: xom9ikk/dotenv@v1.0.2 +# uses: xom9ikk/dotenv@v1.0.2 # with: # path: qa-tests/ From 4eb5e79b9de49a7c405c4563768b700495d411d5 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 8 Sep 2022 21:59:06 +0300 Subject: [PATCH 0809/1274] debug: enable market startup --- .github/workflows/market-test_v2.yml | 46 ++++++++++++++++------------ 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index a7754d06bb..fe1bde8f5e 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -129,6 +129,12 @@ jobs: cat .env ts-node ./src/scripts/create-market-accounts.ts + - name: Copy qa-tests/.env to qa-tests/.env.docker + working-directory: qa-tests + run: | + rm -rf .env.docker + cp .env .env.docker + - name: Get chain logs if: always() # run this step always run: | @@ -148,9 +154,9 @@ jobs: if: failure() run: sleep 900s -# - name: Import test data -# working-directory: qa-tests -# run: ts-node ./src/scripts/create-test-collections.ts + - name: Import test data + working-directory: qa-tests + run: ts-node ./src/scripts/create-test-collections.ts # - name: Show content of qa-test .env # working-directory: qa-tests @@ -168,26 +174,26 @@ jobs: # with: # path: qa-tests/ -# - name: local-market:start -# run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" up -d --build + - name: local-market:start + run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" up -d --build -# - name: Wait for market readyness -# working-directory: qa-tests -# run: src/scripts/wait-market-ready.sh -# shell: bash + - name: Wait for market readyness + working-directory: qa-tests + run: src/scripts/wait-market-ready.sh + shell: bash -# - name: Install dependecies -# working-directory: qa-tests -# run: | -# npm ci -# npm install -D @playwright/test -# npx playwright install-deps -# npx playwright install + - name: Install dependecies + working-directory: qa-tests + run: | + npm ci + npm install -D @playwright/test + npx playwright install-deps + npx playwright install -# - name: -# working-directory: qa-tests -# run: | -# npx playwright test --workers=8 --quiet .*.api.test.ts --reporter=github --config playwright.config.ts + - name: + working-directory: qa-tests + run: | + npx playwright test --workers=8 --quiet .*.api.test.ts --reporter=github --config playwright.config.ts # - name: Show env variables # if: success() || failure() From a615132faa4e3f74ad926949662b13b99645843b Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 8 Sep 2022 22:11:57 +0300 Subject: [PATCH 0810/1274] add read .env in qa-tests --- .github/workflows/market-test_v2.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index fe1bde8f5e..4a3206548d 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -123,7 +123,7 @@ jobs: node scripts/readyness.js echo "Ready to start tests" - - name: WShow content of .env file and Generate accounts + - name: Show content of .env file and Generate accounts working-directory: qa-tests run: | cat .env @@ -158,9 +158,9 @@ jobs: working-directory: qa-tests run: ts-node ./src/scripts/create-test-collections.ts -# - name: Show content of qa-test .env -# working-directory: qa-tests -# run: cat .env + - name: Show content of qa-test .env + working-directory: qa-tests + run: cat .env # - name: Copy qa-tests/.env.example to qa-tests/.env.docker # working-directory: qa-tests @@ -169,10 +169,11 @@ jobs: # cp .env .env.docker # sed -i '/UNIQUE_WS_ENDPOINT/c UNIQUE_WS_ENDPOINT=ws://node-parachain:9944' .env.docker -# - name: Read qa -test .env file Before market start -# uses: xom9ikk/dotenv@v1.0.2 -# with: -# path: qa-tests/ + - name: Read qa -test .env file Before market start + uses: xom9ikk/dotenv@v1.0.2 + with: + path: qa-tests/ + - name: local-market:start run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" up -d --build From d87f22338bac68a88889c165825583816577a655 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 8 Sep 2022 23:04:36 +0300 Subject: [PATCH 0811/1274] enable all networks --- .github/workflows/market-test_v2.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index 4a3206548d..be977391bb 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -22,10 +22,10 @@ jobs: include: - network: "opal" features: "opal-runtime" -# - network: "quartz" -# features: "quartz-runtime" -# - network: "unique" -# features: "unique-runtime" + - network: "quartz" + features: "quartz-runtime" + - network: "unique" + features: "unique-runtime" steps: From e18129475dab67b21ab7009e30414bf899177ea9 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 8 Sep 2022 23:06:36 +0300 Subject: [PATCH 0812/1274] enable clean up at the end --- .github/workflows/market-test_v2.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index be977391bb..e565d00e66 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -209,14 +209,14 @@ jobs: - name: Stop running containers if: always() # run this step always -# run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes - run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down + run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes +# run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down -# - name: Remove builder cache -# if: always() # run this step always -# run: | -# docker builder prune -f -# docker system prune -f + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f + docker system prune -f - name: Clean Workspace if: always() From 1f22fe8b2e1ed1506782f4ecfd2967fc0556d7cd Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 9 Sep 2022 12:50:59 +0700 Subject: [PATCH 0813/1274] add saparate build for xcm parachains --- .docker/Dockerfile-acala.j2 | 41 +++++++ .docker/Dockerfile-cumulus.j2 | 40 +++++++ .docker/Dockerfile-moonbeam.j2 | 41 +++++++ .docker/Dockerfile-polkadot.j2 | 40 +++++++ .github/workflows/xcm-testnet-build.yml | 149 +++++++++++++++++++++--- 5 files changed, 293 insertions(+), 18 deletions(-) create mode 100644 .docker/Dockerfile-acala.j2 create mode 100644 .docker/Dockerfile-cumulus.j2 create mode 100644 .docker/Dockerfile-moonbeam.j2 create mode 100644 .docker/Dockerfile-polkadot.j2 diff --git a/.docker/Dockerfile-acala.j2 b/.docker/Dockerfile-acala.j2 new file mode 100644 index 0000000000..b4f5a36772 --- /dev/null +++ b/.docker/Dockerfile-acala.j2 @@ -0,0 +1,41 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install {{ RUST_TOOLCHAIN }} && \ + rustup default {{ RUST_TOOLCHAIN }} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD ACALA ===== +FROM rust-builder as builder-acala-bin + +WORKDIR /unique_parachain + +RUN git clone -b {{ ACALA_BUILD_BRANCH }} --depth 1 https://github.com/AcalaNetwork/Acala.git && \ + cd Acala && \ + make init && \ + make build-release + +# ===== BIN ====== + +FROM ubuntu:20.04 as builder-acala + +COPY --from=builder-acala-bin /unique_parachain/Acala/target/production/acala /unique_parachain/Acala/target/production/acala diff --git a/.docker/Dockerfile-cumulus.j2 b/.docker/Dockerfile-cumulus.j2 new file mode 100644 index 0000000000..522e6ab8b8 --- /dev/null +++ b/.docker/Dockerfile-cumulus.j2 @@ -0,0 +1,40 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install {{ RUST_TOOLCHAIN }} && \ + rustup default {{ RUST_TOOLCHAIN }} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD CUMULUS ===== +FROM rust-builder as builder-cumulus-bin + +WORKDIR /unique_parachain + +RUN git clone -b {{ CUMULUS_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/cumulus.git && \ + cd cumulus && \ + cargo build --release + +# ===== BIN ====== + +FROM ubuntu:20.04 as builder-cumulus + +COPY --from=builder-cumulus-bin /unique_parachain/cumulus/target/release/polkadot-parachain /unique_parachain/cumulus/target/release/polkadot-parachain diff --git a/.docker/Dockerfile-moonbeam.j2 b/.docker/Dockerfile-moonbeam.j2 new file mode 100644 index 0000000000..c5ef2a6865 --- /dev/null +++ b/.docker/Dockerfile-moonbeam.j2 @@ -0,0 +1,41 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install {{ RUST_TOOLCHAIN }} && \ + rustup default {{ RUST_TOOLCHAIN }} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + + +# ===== BUILD MOONBEAM ===== +FROM rust-builder as builder-moonbeam-bin + +WORKDIR /unique_parachain + +RUN git clone -b {{ MOONBEAM_BUILD_BRANCH }} --depth 1 https://github.com/PureStake/moonbeam.git && \ + cd moonbeam && \ + cargo build --release + +# ===== BIN ====== + +FROM ubuntu:20.04 as builder-moonbeam + +COPY --from=builder-moonbeam-bin /unique_parachain/moonbeam/target/release/moonbeam /unique_parachain/moonbeam/target/release/moonbeam \ No newline at end of file diff --git a/.docker/Dockerfile-polkadot.j2 b/.docker/Dockerfile-polkadot.j2 new file mode 100644 index 0000000000..8a071ab339 --- /dev/null +++ b/.docker/Dockerfile-polkadot.j2 @@ -0,0 +1,40 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install {{ RUST_TOOLCHAIN }} && \ + rustup default {{ RUST_TOOLCHAIN }} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD POLKADOT ===== +FROM rust-builder as builder-polkadot-bin + +WORKDIR /unique_parachain + +RUN git clone -b {{ POLKADOT_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/polkadot.git && \ + cd polkadot && \ + cargo build --release + +# ===== BIN ====== + +FROM ubuntu:20.04 as builder-polkadot + +COPY --from=builder-polkadot-bin /unique_parachain/polkadot/target/release/polkadot /unique_parachain/polkadot/target/release/polkadot diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index ae49f10970..5a67f23e57 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -76,6 +76,137 @@ jobs: - name: Read .env file uses: xom9ikk/dotenv@v1.0.2 + - name: Log in to Docker Hub + uses: docker/login-action@v2.0.0 + with: + username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + + - name: Get autorization token from DOCKERHUB + run: | + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export $TOKEN + + # Check POLKADOT version and build it if it doesn't exist in repository + - name: Generate ENV related extend Dockerfile file for POLKADOT + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-polkadot.j2 + output_file: .docker/Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + + - name: Check if the dockerhub repository contains the needed version POLKADOT + run: | + # Get TAGS from DOCKERHUB repository + POLKADOT_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadot/tags/?page_size=100 | jq -r '."results"[]["name"]') + # Show TAGS + echo "POLKADOT TAGS:" + echo $POLKADOT_TAGS + # Check correct version POLKADOT and build it if it doesn't exist in POLKADOT TAGS + if [[ ${POLKADOT_TAGS[*]} =~ (^|[[:space:]])"${{ env.POLKADOT_BUILD_BRANCH }}"($|[[:space:]]) ]]; then + echo "Repository has needed POLKADOT version"; + docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} + else + echo "Repository has not needed POLKADOT version, so build it"; + cd .docker/ && docker build --no-cache --file ./Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml --tag uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} . + echo "Push needed POLKADOT version to the repository"; + docker push uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} + fi + shell: bash + + # Check ACALA version and build it if it doesn't exist in repository + - name: Generate ENV related extend Dockerfile file for ACALA + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-acala.j2 + output_file: .docker/Dockerfile-acala.${{ matrix.acala_version }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + ACALA_BUILD_BRANCH=${{ matrix.acala_version }} + + - name: Check if the dockerhub repository contains the needed ACALA version + run: | + # Get TAGS from DOCKERHUB repository + ACALA_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-acala/tags/?page_size=100 | jq -r '."results"[]["name"]') + # Show TAGS + echo "ACALA TAGS:" + echo $ACALA_TAGS + # Check correct version ACALA and build it if it doesn't exist in ACALA TAGS + if [[ ${ACALA_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.acala_version }}"($|[[:space:]]) ]]; then + echo "Repository has needed ACALA version"; + docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }} + else + echo "Repository has not needed ACALA version, so build it"; + cd .docker/ && docker build --no-cache --file ./Dockerfile-acala.${{ matrix.acala_version }}.yml --tag uniquenetwork/builder-acala:${{ matrix.acala_version }} . + echo "Push needed ACALA version to the repository"; + docker push uniquenetwork/builder-acala:${{ matrix.acala_version }} + fi + shell: bash + + # Check MOONBEAM version and build it if it doesn't exist in repository + - name: Generate ENV related extend Dockerfile file for MOONBEAM + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-moonbeam.j2 + output_file: .docker/Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }} + + - name: Check if the dockerhub repository contains the needed MOONBEAM version + run: | + # Get TAGS from DOCKERHUB repository + MOONBEAM_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-moonbeam/tags/?page_size=100 | jq -r '."results"[]["name"]') + # Show TAGS + echo "MOONBEAM TAGS:" + echo $MOONBEAM_TAGS + # Check correct version MOONBEAM and build it if it doesn't exist in MOONBEAM TAGS + if [[ ${MOONBEAM_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.moonbeam_version }}"($|[[:space:]]) ]]; then + echo "Repository has needed MOONBEAM version"; + docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} + else + echo "Repository has not needed MOONBEAM version, so build it"; + cd .docker/ && docker build --no-cache --file ./Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml --tag uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} . + echo "Push needed MOONBEAM version to the repository"; + docker push uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} + fi + shell: bash + + + # Check CUMULUS version and build it if it doesn't exist in repository + - name: Generate ENV related extend Dockerfile file for CUMULUS + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-cumulus.j2 + output_file: .docker/Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }} + + - name: Check if the dockerhub repository contains the needed CUMULUS version + run: | + # Get TAGS from DOCKERHUB repository + CUMULUS_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-cumulus/tags/?page_size=100 | jq -r '."results"[]["name"]') + # Show TAGS + echo "CUMULUS TAGS:" + echo $CUMULUS_TAGS + # Check correct version CUMULUS and build it if it doesn't exist in CUMULUS TAGS + if [[ ${CUMULUS_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.cumulus_version }}"($|[[:space:]]) ]]; then + echo "Repository has needed CUMULUS version"; + docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} + else + echo "Repository has not needed CUMULUS version, so build it"; + cd .docker/ && docker build --no-cache --file ./Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml --tag uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} . + echo "Push needed CUMULUS version to the repository"; + docker push uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} + fi + shell: bash + + + # Build main image for XCM - name: Generate ENV related extend Dockerfile file uses: cuchi/jinja2-action@v1.2.0 with: @@ -107,24 +238,6 @@ jobs: find: '/' replace: '-' - - name: Log in to Docker Hub - uses: docker/login-action@v2.0.0 - with: - username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} - password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - - name: Pull acala docker image - run: docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }} - - - name: Pull moonbeam docker image - run: docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} - - - name: Pull cumulus docker image - run: docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} - - - name: Pull polkadot docker image - run: docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} - - name: Pull chainql docker image run: docker pull uniquenetwork/builder-chainql:latest From 76f68f9b074254d5499cc8e3468923f6e553d7ed Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 9 Sep 2022 12:58:26 +0700 Subject: [PATCH 0814/1274] fix xcm workflow --- .github/workflows/xcm-testnet-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 5a67f23e57..011d02b1d4 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -84,9 +84,9 @@ jobs: - name: Get autorization token from DOCKERHUB run: | - # aquire token - TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export $TOKEN + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export $TOKEN # Check POLKADOT version and build it if it doesn't exist in repository - name: Generate ENV related extend Dockerfile file for POLKADOT From 2207e6fe61e67c37270d26f3a266f58e39e9217e Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 9 Sep 2022 13:15:58 +0700 Subject: [PATCH 0815/1274] fix xcm workflow --- .github/workflows/xcm-testnet-build.yml | 3 +++ .github/workflows/xcm-tests_v2.yml | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 011d02b1d4..76b312f6cc 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -82,6 +82,9 @@ jobs: username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + - name: Install jq + run: sudo apt install jq -y + - name: Get autorization token from DOCKERHUB run: | # aquire token diff --git a/.github/workflows/xcm-tests_v2.yml b/.github/workflows/xcm-tests_v2.yml index cb03f8eb19..c257f575a0 100644 --- a/.github/workflows/xcm-tests_v2.yml +++ b/.github/workflows/xcm-tests_v2.yml @@ -17,7 +17,7 @@ jobs: name: Prepare execution matrix -# needs: [xcm-testnet-build] + #needs: [xcm-testnet-build] runs-on: XL outputs: @@ -60,7 +60,6 @@ jobs: matrix: include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} - steps: - name: Skip if pull request is in Draft if: github.event.pull_request.draft == true From b1dcf5455519fd782a8cd3b3b5de42acf91811da Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 9 Sep 2022 09:22:54 +0300 Subject: [PATCH 0816/1274] remove garbage from workflow --- .github/workflows/market-test_v2.yml | 70 ++++++---------------------- 1 file changed, 14 insertions(+), 56 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index e565d00e66..98998c404c 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -22,10 +22,10 @@ jobs: include: - network: "opal" features: "opal-runtime" - - network: "quartz" - features: "quartz-runtime" - - network: "unique" - features: "unique-runtime" +# - network: "quartz" +# features: "quartz-runtime" +# - network: "unique" +# features: "unique-runtime" steps: @@ -45,7 +45,6 @@ jobs: repository: 'UniqueNetwork/market-e2e-tests' ssh-key: ${{ secrets.GH_PAT }} path: 'qa-tests' -# ref: 'CI-37-core-ci-step-3' ref: 'ci_test_v2' - name: Read .env file @@ -54,15 +53,6 @@ jobs: - name: Copy qa-tests/.env.example to qa-tests/.env working-directory: qa-tests run: cp .env.docker .env - -# - name: Show content of qa-test/.env -# working-directory: qa-tests -# run: cat .env -# -# - name: Read qa -test .env file -# uses: xom9ikk/dotenv@v1.0.2 -# with: -# path: qa-tests/ - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 @@ -84,10 +74,6 @@ jobs: - name: Start node-parachain working-directory: qa-tests run: docker-compose -f ".docker/docker-compose.market.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate node-parachain - -# - name: Start nonce-app -# working-directory: qa-tests -# run: docker-compose -f ".docker/docker-compose.market.yml" up -d --build --remove-orphans --force-recreate nonce-app - uses: actions/setup-node@v3 with: @@ -104,17 +90,6 @@ jobs: run: | rm -rf .env cp .env.docker .env - - -# - name: Show content of qa-test/.env -# working-directory: qa-tests -# run: cat .env - - -# - name: Read qa -test .env file -# uses: xom9ikk/dotenv@v1.0.2 -# with: -# path: qa-tests/ - name: Wait for chain up and running working-directory: tests @@ -162,13 +137,6 @@ jobs: working-directory: qa-tests run: cat .env -# - name: Copy qa-tests/.env.example to qa-tests/.env.docker -# working-directory: qa-tests -# run: | -# rm -rf .env.docker -# cp .env .env.docker -# sed -i '/UNIQUE_WS_ENDPOINT/c UNIQUE_WS_ENDPOINT=ws://node-parachain:9944' .env.docker - - name: Read qa -test .env file Before market start uses: xom9ikk/dotenv@v1.0.2 with: @@ -196,31 +164,21 @@ jobs: run: | npx playwright test --workers=8 --quiet .*.api.test.ts --reporter=github --config playwright.config.ts -# - name: Show env variables -# if: success() || failure() -# run: printenv - -# - name: look up for report -# if: success() || failure() -# run: | -# ls -la -# ls -la qa-tests/ - - name: Stop running containers if: always() # run this step always - run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes -# run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down +# run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes + run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down - - name: Remove builder cache - if: always() # run this step always - run: | - docker builder prune -f - docker system prune -f +# - name: Remove builder cache +# if: always() # run this step always +# run: | +# docker builder prune -f +# docker system prune -f - - name: Clean Workspace - if: always() - uses: AutoModality/action-clean@v1.1.0 +# - name: Clean Workspace +# if: always() +# uses: AutoModality/action-clean@v1.1.0 From e30b14aa6f29b888b8e91563c93d04723c0a47bc Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 9 Sep 2022 13:27:01 +0700 Subject: [PATCH 0817/1274] fix xcm workflow --- .github/workflows/xcm-testnet-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 76b312f6cc..1c84a05fa6 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -89,7 +89,7 @@ jobs: run: | # aquire token TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export $TOKEN + export TOKEN=$TOKEN # Check POLKADOT version and build it if it doesn't exist in repository - name: Generate ENV related extend Dockerfile file for POLKADOT From b023ed9c7fffbfb199347ce0ed130bced62ca975 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 9 Sep 2022 13:32:26 +0700 Subject: [PATCH 0818/1274] fix xcm workflow --- .github/workflows/xcm-testnet-build.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 1c84a05fa6..348173ea4b 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -85,11 +85,11 @@ jobs: - name: Install jq run: sudo apt install jq -y - - name: Get autorization token from DOCKERHUB - run: | - # aquire token - TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export TOKEN=$TOKEN + # - name: Get autorization token from DOCKERHUB + # run: | + # # aquire token + # TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + # export TOKEN=$TOKEN # Check POLKADOT version and build it if it doesn't exist in repository - name: Generate ENV related extend Dockerfile file for POLKADOT @@ -102,8 +102,12 @@ jobs: POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} - name: Check if the dockerhub repository contains the needed version POLKADOT - run: | - # Get TAGS from DOCKERHUB repository + run: | + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export TOKEN=$TOKEN + + # Get TAGS from DOCKERHUB POLKADOT repository POLKADOT_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadot/tags/?page_size=100 | jq -r '."results"[]["name"]') # Show TAGS echo "POLKADOT TAGS:" From 43324b61b1fbad7c2b978d500dc7b543a7d5afb1 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 9 Sep 2022 13:41:27 +0700 Subject: [PATCH 0819/1274] fix xcm workflow --- .github/workflows/xcm-testnet-build.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 348173ea4b..9578217543 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -135,7 +135,11 @@ jobs: ACALA_BUILD_BRANCH=${{ matrix.acala_version }} - name: Check if the dockerhub repository contains the needed ACALA version - run: | + run: | + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export TOKEN=$TOKEN + # Get TAGS from DOCKERHUB repository ACALA_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-acala/tags/?page_size=100 | jq -r '."results"[]["name"]') # Show TAGS @@ -164,7 +168,11 @@ jobs: MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }} - name: Check if the dockerhub repository contains the needed MOONBEAM version - run: | + run: | + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export TOKEN=$TOKEN + # Get TAGS from DOCKERHUB repository MOONBEAM_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-moonbeam/tags/?page_size=100 | jq -r '."results"[]["name"]') # Show TAGS @@ -195,6 +203,10 @@ jobs: - name: Check if the dockerhub repository contains the needed CUMULUS version run: | + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export TOKEN=$TOKEN + # Get TAGS from DOCKERHUB repository CUMULUS_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-cumulus/tags/?page_size=100 | jq -r '."results"[]["name"]') # Show TAGS From 6069e8a874a9eb2de88d8d6e2e06590a5e7ea6b0 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 9 Sep 2022 08:15:41 +0000 Subject: [PATCH 0820/1274] tests: upgrade part of them in ascending naming order to use playgrounds --- tests/src/addCollectionAdmin.test.ts | 155 +++-- tests/src/eth/nesting/nest.test.ts | 2 +- tests/src/eth/payable.test.ts | 2 +- tests/src/fungible.test.ts | 199 +++---- tests/src/overflow.test.ts | 1 + tests/src/pallet-presence.test.ts | 35 +- tests/src/refungible.test.ts | 400 ++++++------- tests/src/removeCollectionAdmin.test.ts | 149 +++-- tests/src/removeCollectionSponsor.test.ts | 169 +++--- tests/src/removeFromAllowList.test.ts | 151 +++-- tests/src/removeFromContractAllowList.test.ts | 1 + tests/src/rpc.test.ts | 88 +-- tests/src/scheduler.test.ts | 1 + tests/src/setChainLimits.test.ts | 1 + tests/src/setCollectionLimits.test.ts | 297 +++++----- tests/src/setCollectionSponsor.test.ts | 134 +++-- .../setContractSponsoringRateLimit.test.ts | 1 + tests/src/setMintPermission.test.ts | 130 ++--- tests/src/setPublicAccessMode.test.ts | 129 ++--- tests/src/toggleContractAllowList.test.ts | 1 + tests/src/transfer.test.ts | 546 ++++++++---------- tests/src/transferFrom.test.ts | 509 ++++++++-------- tests/src/util/playgrounds/unique.ts | 4 - tests/src/xcmTransfer.test.ts | 1 + 24 files changed, 1445 insertions(+), 1661 deletions(-) diff --git a/tests/src/addCollectionAdmin.test.ts b/tests/src/addCollectionAdmin.test.ts index 398df41c8c..ec990b7c72 100644 --- a/tests/src/addCollectionAdmin.test.ts +++ b/tests/src/addCollectionAdmin.test.ts @@ -17,119 +17,114 @@ import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {usingPlaygrounds} from './util/playgrounds'; +import {itSub, usingPlaygrounds} from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; -let donor: IKeyringPair; +describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => { + let donor: IKeyringPair; -before(async () => { - await usingPlaygrounds(async (_, privateKeyWrapper) => { - donor = privateKeyWrapper('//Alice'); + before(async () => { + await usingPlaygrounds(async (_, privateKeyWrapper) => { + donor = privateKeyWrapper('//Alice'); + }); }); -}); -describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => { - it('Add collection admin.', async () => { - await usingPlaygrounds(async (helper) => { - const [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); + itSub('Add collection admin.', async ({helper}) => { + const [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); - const collection = await helper.collection.getData(collectionId); - expect(collection!.normalizedOwner!).to.be.equal(alice.address); + const collection = await helper.collection.getData(collectionId); + expect(collection!.normalizedOwner!).to.be.equal(helper.address.normalizeSubstrate(alice.address)); - await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address}); + await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address}); - const adminListAfterAddAdmin = await helper.collection.getAdmins(collectionId); - expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: bob.address}); - }); + const adminListAfterAddAdmin = await helper.collection.getAdmins(collectionId); + expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: bob.address}); }); }); describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => { - it("Not owner can't add collection admin.", async () => { - await usingPlaygrounds(async (helper) => { - const [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); - - const collection = await helper.collection.getData(collectionId); - expect(collection?.normalizedOwner).to.be.equal(alice.address); - - const changeAdminTxBob = async () => helper.collection.addAdmin(bob, collectionId, {Substrate: bob.address}); - const changeAdminTxCharlie = async () => helper.collection.addAdmin(bob, collectionId, {Substrate: charlie.address}); - await expect(changeAdminTxCharlie()).to.be.rejected; - await expect(changeAdminTxBob()).to.be.rejected; - - const adminListAfterAddAdmin = await helper.collection.getAdmins(collectionId); - expect(adminListAfterAddAdmin).to.be.not.deep.contains({Substrate: charlie.address}); - expect(adminListAfterAddAdmin).to.be.not.deep.contains({Substrate: bob.address}); + let donor: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (_, privateKeyWrapper) => { + donor = privateKeyWrapper('//Alice'); }); }); - it("Admin can't add collection admin.", async () => { - await usingPlaygrounds(async (helper) => { - const [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); - const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); + itSub("Not owner can't add collection admin.", async ({helper}) => { + const [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); - await collection.addAdmin(alice, {Substrate: bob.address}); + const collection = await helper.collection.getData(collectionId); + expect(collection?.normalizedOwner).to.be.equal(helper.address.normalizeSubstrate(alice.address)); - const adminListAfterAddAdmin = await collection.getAdmins(); - expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: bob.address}); + const changeAdminTxBob = async () => helper.collection.addAdmin(bob, collectionId, {Substrate: bob.address}); + const changeAdminTxCharlie = async () => helper.collection.addAdmin(bob, collectionId, {Substrate: charlie.address}); + await expect(changeAdminTxCharlie()).to.be.rejectedWith(/common\.NoPermission/); + await expect(changeAdminTxBob()).to.be.rejectedWith(/common\.NoPermission/); - const changeAdminTxCharlie = async () => collection.addAdmin(bob, {Substrate: charlie.address}); - await expect(changeAdminTxCharlie()).to.be.rejected; + const adminListAfterAddAdmin = await helper.collection.getAdmins(collectionId); + expect(adminListAfterAddAdmin).to.be.not.deep.contains({Substrate: charlie.address}); + expect(adminListAfterAddAdmin).to.be.not.deep.contains({Substrate: bob.address}); + }); - const adminListAfterAddNewAdmin = await collection.getAdmins(); - expect(adminListAfterAddNewAdmin).to.be.deep.contains({Substrate: bob.address}); - expect(adminListAfterAddNewAdmin).to.be.not.deep.contains({Substrate: charlie.address}); - }); + itSub("Admin can't add collection admin.", async ({helper}) => { + const [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); + const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); + + await collection.addAdmin(alice, {Substrate: bob.address}); + + const adminListAfterAddAdmin = await collection.getAdmins(); + expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: bob.address}); + + const changeAdminTxCharlie = async () => collection.addAdmin(bob, {Substrate: charlie.address}); + await expect(changeAdminTxCharlie()).to.be.rejectedWith(/common\.NoPermission/); + + const adminListAfterAddNewAdmin = await collection.getAdmins(); + expect(adminListAfterAddNewAdmin).to.be.deep.contains({Substrate: bob.address}); + expect(adminListAfterAddNewAdmin).to.be.not.deep.contains({Substrate: charlie.address}); }); - it("Can't add collection admin of not existing collection.", async () => { - await usingPlaygrounds(async (helper) => { - const [alice, bob] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); - // tslint:disable-next-line: no-bitwise - const collectionId = (1 << 32) - 1; + itSub("Can't add collection admin of not existing collection.", async ({helper}) => { + const [alice, bob] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); + const collectionId = (1 << 32) - 1; - const addAdminTx = async () => helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); - await expect(addAdminTx()).to.be.rejected; + const addAdminTx = async () => helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); + await expect(addAdminTx()).to.be.rejectedWith(/common\.CollectionNotFound/); - // Verifying that nothing bad happened (network is live, new collections can be created, etc.) - await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); - }); + // Verifying that nothing bad happened (network is live, new collections can be created, etc.) + await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); }); - it("Can't add an admin to a destroyed collection.", async () => { - await usingPlaygrounds(async (helper) => { - const [alice, bob] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); - const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); + itSub("Can't add an admin to a destroyed collection.", async ({helper}) => { + const [alice, bob] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); + const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); - await collection.burn(alice); - const addAdminTx = async () => collection.addAdmin(alice, {Substrate: bob.address}); - await expect(addAdminTx()).to.be.rejected; + await collection.burn(alice); + const addAdminTx = async () => collection.addAdmin(alice, {Substrate: bob.address}); + await expect(addAdminTx()).to.be.rejectedWith(/common\.CollectionNotFound/); - // Verifying that nothing bad happened (network is live, new collections can be created, etc.) - await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); - }); + // Verifying that nothing bad happened (network is live, new collections can be created, etc.) + await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); }); - it('Add an admin to a collection that has reached the maximum number of admins limit', async () => { - await usingPlaygrounds(async (helper) => { - const [alice, ...accounts] = await helper.arrange.createAccounts([10n, 0n, 0n, 0n, 0n, 0n, 0n, 0n], donor); - const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); + itSub('Add an admin to a collection that has reached the maximum number of admins limit', async ({helper}) => { + const [alice, ...accounts] = await helper.arrange.createAccounts([10n, 0n, 0n, 0n, 0n, 0n, 0n, 0n], donor); + const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); - const chainAdminLimit = (helper.api!.consts.common.collectionAdminsLimit as any).toNumber(); - expect(chainAdminLimit).to.be.equal(5); + const chainAdminLimit = (helper.api!.consts.common.collectionAdminsLimit as any).toNumber(); + expect(chainAdminLimit).to.be.equal(5); - for (let i = 0; i < chainAdminLimit; i++) { - await collection.addAdmin(alice, {Substrate: accounts[i].address}); - const adminListAfterAddAdmin = await collection.getAdmins(); - expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: accounts[i].address}); - } + for (let i = 0; i < chainAdminLimit; i++) { + await collection.addAdmin(alice, {Substrate: accounts[i].address}); + const adminListAfterAddAdmin = await collection.getAdmins(); + expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: accounts[i].address}); + } - const addExtraAdminTx = async () => collection.addAdmin(alice, {Substrate: accounts[chainAdminLimit].address}); - await expect(addExtraAdminTx()).to.be.rejected; - }); + const addExtraAdminTx = async () => collection.addAdmin(alice, {Substrate: accounts[chainAdminLimit].address}); + await expect(addExtraAdminTx()).to.be.rejectedWith(/common\.CollectionAdminCountExceeded/); }); }); diff --git a/tests/src/eth/nesting/nest.test.ts b/tests/src/eth/nesting/nest.test.ts index 5a8c6b72ca..10709d7864 100644 --- a/tests/src/eth/nesting/nest.test.ts +++ b/tests/src/eth/nesting/nest.test.ts @@ -20,7 +20,7 @@ describe('EVM nesting tests group', () => { let donor: IKeyringPair; before(async function() { - await usingEthPlaygrounds(async (helper, privateKey) => { + await usingEthPlaygrounds(async (_, privateKey) => { donor = privateKey('//Alice'); }); }); diff --git a/tests/src/eth/payable.test.ts b/tests/src/eth/payable.test.ts index 147607710e..01f264b417 100644 --- a/tests/src/eth/payable.test.ts +++ b/tests/src/eth/payable.test.ts @@ -22,7 +22,7 @@ describe('EVM payable contracts', () => { let donor: IKeyringPair; before(async function() { - await usingEthPlaygrounds(async (helper, privateKey) => { + await usingEthPlaygrounds(async (_, privateKey) => { donor = privateKey('//Alice'); }); }); diff --git a/tests/src/fungible.test.ts b/tests/src/fungible.test.ts index 13bd850017..5fb4c7ab8b 100644 --- a/tests/src/fungible.test.ts +++ b/tests/src/fungible.test.ts @@ -16,11 +16,10 @@ import {IKeyringPair} from '@polkadot/types/types'; import {U128_MAX} from './util/helpers'; - -import {usingPlaygrounds} from './util/playgrounds'; - +import {itSub, usingPlaygrounds} from './util/playgrounds'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; + chai.use(chaiAsPromised); const expect = chai.expect; @@ -35,131 +34,117 @@ describe('integration test: Fungible functionality:', () => { }); }); - it('Create fungible collection and token', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'trest'}); - const defaultTokenId = await collection.getLastTokenId(); - expect(defaultTokenId).to.be.equal(0); + itSub('Create fungible collection and token', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'trest'}); + const defaultTokenId = await collection.getLastTokenId(); + expect(defaultTokenId).to.be.equal(0); - await collection.mint(alice, {Substrate: alice.address}, U128_MAX); - const aliceBalance = await collection.getBalance({Substrate: alice.address}); - const itemCountAfter = await collection.getLastTokenId(); + await collection.mint(alice, {Substrate: alice.address}, U128_MAX); + const aliceBalance = await collection.getBalance({Substrate: alice.address}); + const itemCountAfter = await collection.getLastTokenId(); - expect(itemCountAfter).to.be.equal(defaultTokenId); - expect(aliceBalance).to.be.equal(U128_MAX); - }); + expect(itemCountAfter).to.be.equal(defaultTokenId); + expect(aliceBalance).to.be.equal(U128_MAX); }); - it('RPC method tokenOnewrs for fungible collection and token', async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; - const facelessCrowd = Array(7).fill(0).map((_, i) => ({Substrate: privateKey(`//Alice+${i}`).address})); - - const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - - await collection.mint(alice, {Substrate: alice.address}, U128_MAX); - - await collection.transfer(alice, {Substrate: bob.address}, 1000n); - await collection.transfer(alice, ethAcc, 900n); - - for (let i = 0; i < 7; i++) { - await collection.transfer(alice, facelessCrowd[i], 1n); - } - - const owners = await collection.getTop10Owners(); - - // What to expect - expect(owners).to.deep.include.members([{Substrate: alice.address}, ethAcc, {Substrate: bob.address}, ...facelessCrowd]); - expect(owners.length).to.be.equal(10); - - const eleven = privateKey('//ALice+11'); - expect(await collection.transfer(alice, {Substrate: eleven.address}, 10n)).to.be.true; - expect((await collection.getTop10Owners()).length).to.be.equal(10); - }); + itSub('RPC method tokenOnewrs for fungible collection and token', async ({helper, privateKey}) => { + const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; + const facelessCrowd = Array(7).fill(0).map((_, i) => ({Substrate: privateKey(`//Alice+${i}`).address})); + + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + + await collection.mint(alice, {Substrate: alice.address}, U128_MAX); + + await collection.transfer(alice, {Substrate: bob.address}, 1000n); + await collection.transfer(alice, ethAcc, 900n); + + for (let i = 0; i < 7; i++) { + await collection.transfer(alice, facelessCrowd[i], 1n); + } + + const owners = await collection.getTop10Owners(); + + // What to expect + expect(owners).to.deep.include.members([{Substrate: alice.address}, ethAcc, {Substrate: bob.address}, ...facelessCrowd]); + expect(owners.length).to.be.equal(10); + + const eleven = privateKey('//ALice+11'); + expect(await collection.transfer(alice, {Substrate: eleven.address}, 10n)).to.be.true; + expect((await collection.getTop10Owners()).length).to.be.equal(10); }); - it('Transfer token', async () => { - await usingPlaygrounds(async helper => { - const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; - const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - await collection.mint(alice, {Substrate: alice.address}, 500n); + itSub('Transfer token', async ({helper}) => { + const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + await collection.mint(alice, {Substrate: alice.address}, 500n); - expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(500n); - expect(await collection.transfer(alice, {Substrate: bob.address}, 60n)).to.be.true; - expect(await collection.transfer(alice, ethAcc, 140n)).to.be.true; + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(500n); + expect(await collection.transfer(alice, {Substrate: bob.address}, 60n)).to.be.true; + expect(await collection.transfer(alice, ethAcc, 140n)).to.be.true; - expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(300n); - expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(60n); - expect(await collection.getBalance(ethAcc)).to.be.equal(140n); + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(300n); + expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(60n); + expect(await collection.getBalance(ethAcc)).to.be.equal(140n); - await expect(collection.transfer(alice, {Substrate: bob.address}, 350n)).to.eventually.be.rejected; - }); + await expect(collection.transfer(alice, {Substrate: bob.address}, 350n)).to.eventually.be.rejected; }); - it('Tokens multiple creation', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + itSub('Tokens multiple creation', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - await collection.mintWithOneOwner(alice, {Substrate: alice.address}, [ - {value: 500n}, - {value: 400n}, - {value: 300n}, - ]); + await collection.mintWithOneOwner(alice, {Substrate: alice.address}, [ + {value: 500n}, + {value: 400n}, + {value: 300n}, + ]); - expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(1200n); - }); + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(1200n); }); - it('Burn some tokens ', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - await collection.mint(alice, {Substrate: alice.address}, 500n); + itSub('Burn some tokens ', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + await collection.mint(alice, {Substrate: alice.address}, 500n); - expect(await collection.isTokenExists(0)).to.be.true; - expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(500n); - expect(await collection.burnTokens(alice, 499n)).to.be.true; - expect(await collection.isTokenExists(0)).to.be.true; - expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(1n); - }); + expect(await collection.isTokenExists(0)).to.be.true; + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(500n); + expect(await collection.burnTokens(alice, 499n)).to.be.true; + expect(await collection.isTokenExists(0)).to.be.true; + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(1n); }); - it('Burn all tokens ', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - await collection.mint(alice, {Substrate: alice.address}, 500n); + itSub('Burn all tokens ', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + await collection.mint(alice, {Substrate: alice.address}, 500n); - expect(await collection.isTokenExists(0)).to.be.true; - expect(await collection.burnTokens(alice, 500n)).to.be.true; - expect(await collection.isTokenExists(0)).to.be.true; + expect(await collection.isTokenExists(0)).to.be.true; + expect(await collection.burnTokens(alice, 500n)).to.be.true; + expect(await collection.isTokenExists(0)).to.be.true; - expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(0n); - expect(await collection.getTotalPieces()).to.be.equal(0n); - }); + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(0n); + expect(await collection.getTotalPieces()).to.be.equal(0n); }); - it('Set allowance for token', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; - await collection.mint(alice, {Substrate: alice.address}, 100n); - - expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(100n); - - expect(await collection.approveTokens(alice, {Substrate: bob.address}, 60n)).to.be.true; - expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(60n); - expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(0n); - - expect(await collection.transferFrom(bob, {Substrate: alice.address}, {Substrate: bob.address}, 20n)).to.be.true; - expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(80n); - expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(20n); - expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(40n); - - await collection.burnTokensFrom(bob, {Substrate: alice.address}, 10n); - - expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(70n); - expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(30n); - expect(await collection.transferFrom(bob, {Substrate: alice.address}, ethAcc, 10n)).to.be.true; - expect(await collection.getBalance(ethAcc)).to.be.equal(10n); - }); + itSub('Set allowance for token', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; + await collection.mint(alice, {Substrate: alice.address}, 100n); + + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(100n); + + expect(await collection.approveTokens(alice, {Substrate: bob.address}, 60n)).to.be.true; + expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(60n); + expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(0n); + + expect(await collection.transferFrom(bob, {Substrate: alice.address}, {Substrate: bob.address}, 20n)).to.be.true; + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(80n); + expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(20n); + expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(40n); + + await collection.burnTokensFrom(bob, {Substrate: alice.address}, 10n); + + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(70n); + expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(30n); + expect(await collection.transferFrom(bob, {Substrate: alice.address}, ethAcc, 10n)).to.be.true; + expect(await collection.getBalance(ethAcc)).to.be.equal(10n); }); }); diff --git a/tests/src/overflow.test.ts b/tests/src/overflow.test.ts index 7147d6b114..ada2d1742c 100644 --- a/tests/src/overflow.test.ts +++ b/tests/src/overflow.test.ts @@ -23,6 +23,7 @@ import {approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemE chai.use(chaiAsPromised); const expect = chai.expect; +// todo:playgrounds skipped ~ postponed describe.skip('Integration Test fungible overflows', () => { let alice: IKeyringPair; let bob: IKeyringPair; diff --git a/tests/src/pallet-presence.test.ts b/tests/src/pallet-presence.test.ts index 41366291c9..11ceaba252 100644 --- a/tests/src/pallet-presence.test.ts +++ b/tests/src/pallet-presence.test.ts @@ -14,13 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {ApiPromise} from '@polkadot/api'; import {expect} from 'chai'; -import usingApi from './substrate/substrate-api'; - -function getModuleNames(api: ApiPromise): string[] { - return api.runtimeMetadata.asLatest.pallets.map(m => m.name.toString().toLowerCase()); -} +import {itSub, usingPlaygrounds} from './util/playgrounds'; // Pallets that must always be present const requiredPallets = [ @@ -62,8 +57,8 @@ const consensusPallets = [ describe('Pallet presence', () => { before(async () => { - await usingApi(async api => { - const chain = await api.rpc.system.chain(); + await usingPlaygrounds(async helper => { + const chain = await helper.api!.rpc.system.chain(); const refungible = 'refungible'; const scheduler = 'scheduler'; @@ -80,23 +75,15 @@ describe('Pallet presence', () => { }); }); - it('Required pallets are present', async () => { - await usingApi(async api => { - for (let i=0; i { + expect(helper.fetchAllPalletNames()).to.contain.members([...requiredPallets]); }); - it('Governance and consensus pallets are present', async () => { - await usingApi(async api => { - for (let i=0; i { + expect(helper.fetchAllPalletNames()).to.contain.members([...consensusPallets]); }); - it('No extra pallets are included', async () => { - await usingApi(async api => { - expect(getModuleNames(api).sort()).to.be.deep.equal([...requiredPallets, ...consensusPallets].sort()); - }); + + itSub('No extra pallets are included', async ({helper}) => { + expect(helper.fetchAllPalletNames().sort()).to.be.deep.equal([...requiredPallets, ...consensusPallets].sort()); }); }); diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 57af9d8fae..d04aed46a9 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -15,13 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; - -import {usingPlaygrounds} from './util/playgrounds'; -import { - getModuleNames, - Pallets, - requirePallets, -} from './util/helpers'; +import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util/playgrounds'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; @@ -34,255 +28,231 @@ const MAX_REFUNGIBLE_PIECES = 1_000_000_000_000_000_000_000n; describe('integration test: Refungible functionality:', async () => { before(async function() { - await requirePallets(this, [Pallets.ReFungible]); - await usingPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + alice = privateKey('//Alice'); bob = privateKey('//Bob'); - if (!getModuleNames(helper.api!).includes(Pallets.ReFungible)) this.skip(); }); }); - it('Create refungible collection and token', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - - const itemCountBefore = await collection.getLastTokenId(); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); - - const itemCountAfter = await collection.getLastTokenId(); - - // What to expect - expect(token?.tokenId).to.be.gte(itemCountBefore); - expect(itemCountAfter).to.be.equal(itemCountBefore + 1); - expect(itemCountAfter.toString()).to.be.equal(token?.tokenId.toString()); - }); + itSub('Create refungible collection and token', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + + const itemCountBefore = await collection.getLastTokenId(); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + + const itemCountAfter = await collection.getLastTokenId(); + + // What to expect + expect(token?.tokenId).to.be.gte(itemCountBefore); + expect(itemCountAfter).to.be.equal(itemCountBefore + 1); + expect(itemCountAfter.toString()).to.be.equal(token?.tokenId.toString()); }); - it('Checking RPC methods when interacting with maximum allowed values (MAX_REFUNGIBLE_PIECES)', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - - const token = await collection.mintToken(alice, {Substrate: alice.address}, MAX_REFUNGIBLE_PIECES); - - expect(await collection.getTokenBalance(token.tokenId, {Substrate: alice.address})).to.be.equal(MAX_REFUNGIBLE_PIECES); - - await collection.transferToken(alice, token.tokenId, {Substrate: bob.address}, MAX_REFUNGIBLE_PIECES); - expect(await collection.getTokenBalance(token.tokenId, {Substrate: bob.address})).to.be.equal(MAX_REFUNGIBLE_PIECES); - expect(await token.getTotalPieces()).to.be.equal(MAX_REFUNGIBLE_PIECES); - - await expect(collection.mintToken(alice, {Substrate: alice.address}, MAX_REFUNGIBLE_PIECES + 1n)).to.eventually.be.rejected; - }); + itSub('Checking RPC methods when interacting with maximum allowed values (MAX_REFUNGIBLE_PIECES)', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + + const token = await collection.mintToken(alice, {Substrate: alice.address}, MAX_REFUNGIBLE_PIECES); + + expect(await collection.getTokenBalance(token.tokenId, {Substrate: alice.address})).to.be.equal(MAX_REFUNGIBLE_PIECES); + + await collection.transferToken(alice, token.tokenId, {Substrate: bob.address}, MAX_REFUNGIBLE_PIECES); + expect(await collection.getTokenBalance(token.tokenId, {Substrate: bob.address})).to.be.equal(MAX_REFUNGIBLE_PIECES); + expect(await token.getTotalPieces()).to.be.equal(MAX_REFUNGIBLE_PIECES); + + await expect(collection.mintToken(alice, {Substrate: alice.address}, MAX_REFUNGIBLE_PIECES + 1n)) + .to.eventually.be.rejectedWith(/refungible\.WrongRefungiblePieces/); }); - it('RPC method tokenOnewrs for refungible collection and token', async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; - const facelessCrowd = Array(7).fill(0).map((_, i) => ({Substrate: privateKey(`//Alice+${i}`).address})); - - const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - - const token = await collection.mintToken(alice, {Substrate: alice.address}, 10_000n); - - await token.transfer(alice, {Substrate: bob.address}, 1000n); - await token.transfer(alice, ethAcc, 900n); - - for (let i = 0; i < 7; i++) { - await token.transfer(alice, facelessCrowd[i], 50n * BigInt(i + 1)); - } - - const owners = await token.getTop10Owners(); - - // What to expect - expect(owners).to.deep.include.members([{Substrate: alice.address}, ethAcc, {Substrate: bob.address}, ...facelessCrowd]); - expect(owners.length).to.be.equal(10); - - const eleven = privateKey('//ALice+11'); - expect(await token.transfer(alice, {Substrate: eleven.address}, 10n)).to.be.true; - expect((await token.getTop10Owners()).length).to.be.equal(10); - }); + itSub('RPC method tokenOnewrs for refungible collection and token', async ({helper, privateKey}) => { + const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; + const facelessCrowd = Array(7).fill(0).map((_, i) => ({Substrate: privateKey(`//Alice+${i}`).address})); + + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + + const token = await collection.mintToken(alice, {Substrate: alice.address}, 10_000n); + + await token.transfer(alice, {Substrate: bob.address}, 1000n); + await token.transfer(alice, ethAcc, 900n); + + for (let i = 0; i < 7; i++) { + await token.transfer(alice, facelessCrowd[i], 50n * BigInt(i + 1)); + } + + const owners = await token.getTop10Owners(); + + // What to expect + expect(owners).to.deep.include.members([{Substrate: alice.address}, ethAcc, {Substrate: bob.address}, ...facelessCrowd]); + expect(owners.length).to.be.equal(10); + + const eleven = privateKey('//ALice+11'); + expect(await token.transfer(alice, {Substrate: eleven.address}, 10n)).to.be.true; + expect((await token.getTop10Owners()).length).to.be.equal(10); }); - it('Transfer token pieces', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); - - expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); - expect(await token.transfer(alice, {Substrate: bob.address}, 60n)).to.be.true; - - expect(await token.getBalance({Substrate: alice.address})).to.be.equal(40n); - expect(await token.getBalance({Substrate: bob.address})).to.be.equal(60n); - - await expect(token.transfer(alice, {Substrate: bob.address}, 41n)).to.eventually.be.rejected; - }); + itSub('Transfer token pieces', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); + expect(await token.transfer(alice, {Substrate: bob.address}, 60n)).to.be.true; + + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(40n); + expect(await token.getBalance({Substrate: bob.address})).to.be.equal(60n); + + await expect(token.transfer(alice, {Substrate: bob.address}, 41n)) + .to.eventually.be.rejectedWith(/common\.TokenValueTooLow/); }); - it('Create multiple tokens', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - // TODO: fix mintMultipleTokens - // await collection.mintMultipleTokens(alice, [ - // {owner: {Substrate: alice.address}, pieces: 1n}, - // {owner: {Substrate: alice.address}, pieces: 2n}, - // {owner: {Substrate: alice.address}, pieces: 100n}, - // ]); - await helper.rft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, [ - {pieces: 1n}, - {pieces: 2n}, - {pieces: 100n}, - ]); - const lastTokenId = await collection.getLastTokenId(); - expect(lastTokenId).to.be.equal(3); - expect(await collection.getTokenBalance(lastTokenId, {Substrate: alice.address})).to.be.equal(100n); - }); + itSub('Create multiple tokens', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + // TODO: fix mintMultipleTokens + // await collection.mintMultipleTokens(alice, [ + // {owner: {Substrate: alice.address}, pieces: 1n}, + // {owner: {Substrate: alice.address}, pieces: 2n}, + // {owner: {Substrate: alice.address}, pieces: 100n}, + // ]); + await helper.rft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, [ + {pieces: 1n}, + {pieces: 2n}, + {pieces: 100n}, + ]); + const lastTokenId = await collection.getLastTokenId(); + expect(lastTokenId).to.be.equal(3); + expect(await collection.getTokenBalance(lastTokenId, {Substrate: alice.address})).to.be.equal(100n); }); - it('Burn some pieces', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); - expect(await collection.isTokenExists(token.tokenId)).to.be.true; - expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); - expect((await token.burn(alice, 99n)).success).to.be.true; - expect(await collection.isTokenExists(token.tokenId)).to.be.true; - expect(await token.getBalance({Substrate: alice.address})).to.be.equal(1n); - }); + itSub('Burn some pieces', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + expect(await collection.isTokenExists(token.tokenId)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); + expect((await token.burn(alice, 99n)).success).to.be.true; + expect(await collection.isTokenExists(token.tokenId)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(1n); }); - it('Burn all pieces', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); - - expect(await collection.isTokenExists(token.tokenId)).to.be.true; - expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); + itSub('Burn all pieces', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + + expect(await collection.isTokenExists(token.tokenId)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); - expect((await token.burn(alice, 100n)).success).to.be.true; - expect(await collection.isTokenExists(token.tokenId)).to.be.false; - }); + expect((await token.burn(alice, 100n)).success).to.be.true; + expect(await collection.isTokenExists(token.tokenId)).to.be.false; }); - it('Burn some pieces for multiple users', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + itSub('Burn some pieces for multiple users', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); - expect(await collection.isTokenExists(token.tokenId)).to.be.true; - - expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); - expect(await token.transfer(alice, {Substrate: bob.address}, 60n)).to.be.true; + expect(await collection.isTokenExists(token.tokenId)).to.be.true; + + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); + expect(await token.transfer(alice, {Substrate: bob.address}, 60n)).to.be.true; - expect(await token.getBalance({Substrate: alice.address})).to.be.equal(40n); - expect(await token.getBalance({Substrate: bob.address})).to.be.equal(60n); + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(40n); + expect(await token.getBalance({Substrate: bob.address})).to.be.equal(60n); - expect((await token.burn(alice, 40n)).success).to.be.true; + expect((await token.burn(alice, 40n)).success).to.be.true; - expect(await collection.isTokenExists(token.tokenId)).to.be.true; - expect(await token.getBalance({Substrate: alice.address})).to.be.equal(0n); + expect(await collection.isTokenExists(token.tokenId)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(0n); - expect((await token.burn(bob, 59n)).success).to.be.true; + expect((await token.burn(bob, 59n)).success).to.be.true; - expect(await token.getBalance({Substrate: bob.address})).to.be.equal(1n); - expect(await collection.isTokenExists(token.tokenId)).to.be.true; + expect(await token.getBalance({Substrate: bob.address})).to.be.equal(1n); + expect(await collection.isTokenExists(token.tokenId)).to.be.true; - expect((await token.burn(bob, 1n)).success).to.be.true; + expect((await token.burn(bob, 1n)).success).to.be.true; - expect(await collection.isTokenExists(token.tokenId)).to.be.false; - }); + expect(await collection.isTokenExists(token.tokenId)).to.be.false; }); - it('Set allowance for token', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); - - expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); + itSub('Set allowance for token', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); - expect(await token.approve(alice, {Substrate: bob.address}, 60n)).to.be.true; - expect(await token.getApprovedPieces({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(60n); + expect(await token.approve(alice, {Substrate: bob.address}, 60n)).to.be.true; + expect(await token.getApprovedPieces({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(60n); - expect(await token.transferFrom(bob, {Substrate: alice.address}, {Substrate: bob.address}, 20n)).to.be.true; - expect(await token.getBalance({Substrate: alice.address})).to.be.equal(80n); - expect(await token.getBalance({Substrate: bob.address})).to.be.equal(20n); - expect(await token.getApprovedPieces({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(40n); - }); + expect(await token.transferFrom(bob, {Substrate: alice.address}, {Substrate: bob.address}, 20n)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(80n); + expect(await token.getBalance({Substrate: bob.address})).to.be.equal(20n); + expect(await token.getApprovedPieces({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(40n); }); - it('Repartition', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); - - expect(await token.repartition(alice, 200n)).to.be.true; - expect(await token.getBalance({Substrate: alice.address})).to.be.equal(200n); - expect(await token.getTotalPieces()).to.be.equal(200n); - - expect(await token.transfer(alice, {Substrate: bob.address}, 110n)).to.be.true; - expect(await token.getBalance({Substrate: alice.address})).to.be.equal(90n); - expect(await token.getBalance({Substrate: bob.address})).to.be.equal(110n); - - await expect(token.repartition(alice, 80n)).to.eventually.be.rejected; - - expect(await token.transfer(alice, {Substrate: bob.address}, 90n)).to.be.true; - expect(await token.getBalance({Substrate: alice.address})).to.be.equal(0n); - expect(await token.getBalance({Substrate: bob.address})).to.be.equal(200n); - - expect(await token.repartition(bob, 150n)).to.be.true; - await expect(token.transfer(bob, {Substrate: alice.address}, 160n)).to.eventually.be.rejected; - - }); + itSub('Repartition', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + + expect(await token.repartition(alice, 200n)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(200n); + expect(await token.getTotalPieces()).to.be.equal(200n); + + expect(await token.transfer(alice, {Substrate: bob.address}, 110n)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(90n); + expect(await token.getBalance({Substrate: bob.address})).to.be.equal(110n); + + await expect(token.repartition(alice, 80n)) + .to.eventually.be.rejectedWith(/refungible\.RepartitionWhileNotOwningAllPieces/); + + expect(await token.transfer(alice, {Substrate: bob.address}, 90n)).to.be.true; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(0n); + expect(await token.getBalance({Substrate: bob.address})).to.be.equal(200n); + + expect(await token.repartition(bob, 150n)).to.be.true; + await expect(token.transfer(bob, {Substrate: alice.address}, 160n)) + .to.eventually.be.rejectedWith(/common\.TokenValueTooLow/); }); - it('Repartition with increased amount', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); - await token.repartition(alice, 200n); - const chainEvents = helper.chainLog.slice(-1)[0].events.map((x: any) => x.event); - expect(chainEvents).to.include.deep.members([{ - method: 'ItemCreated', - section: 'common', - index: '0x4202', - data: [ - helper.api!.createType('u32', collection.collectionId).toHuman(), - helper.api!.createType('u32', token.tokenId).toHuman(), - {Substrate: alice.address}, - '100', - ], - }]); - }); + itSub('Repartition with increased amount', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + await token.repartition(alice, 200n); + const chainEvents = helper.chainLog.slice(-1)[0].events.map((x: any) => x.event); + expect(chainEvents).to.include.deep.members([{ + method: 'ItemCreated', + section: 'common', + index: '0x4202', + data: [ + helper.api!.createType('u32', collection.collectionId).toHuman(), + helper.api!.createType('u32', token.tokenId).toHuman(), + {Substrate: alice.address}, + '100', + ], + }]); }); - it('Repartition with decreased amount', async () => { - await usingPlaygrounds(async helper => { - const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); - await token.repartition(alice, 50n); - const chainEvents = helper.chainLog.slice(-1)[0].events.map((x: any) => x.event); - expect(chainEvents).to.include.deep.members([{ - method: 'ItemDestroyed', - section: 'common', - index: '0x4203', - data: [ - helper.api!.createType('u32', collection.collectionId).toHuman(), - helper.api!.createType('u32', token.tokenId).toHuman(), - {Substrate: alice.address}, - '50', - ], - }]); - }); + itSub('Repartition with decreased amount', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + await token.repartition(alice, 50n); + const chainEvents = helper.chainLog.slice(-1)[0].events.map((x: any) => x.event); + expect(chainEvents).to.include.deep.members([{ + method: 'ItemDestroyed', + section: 'common', + index: '0x4203', + data: [ + helper.api!.createType('u32', collection.collectionId).toHuman(), + helper.api!.createType('u32', token.tokenId).toHuman(), + {Substrate: alice.address}, + '50', + ], + }]); }); - it('Create new collection with properties', async () => { - await usingPlaygrounds(async helper => { - const properties = [{key: 'key1', value: 'val1'}]; - const tokenPropertyPermissions = [{key: 'key1', permission: {tokenOwner: true, mutable: false, collectionAdmin: true}}]; - const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test', properties, tokenPropertyPermissions}); - const info = await collection.getData(); - expect(info?.raw.properties).to.be.deep.equal(properties); - expect(info?.raw.tokenPropertyPermissions).to.be.deep.equal(tokenPropertyPermissions); - }); + itSub('Create new collection with properties', async ({helper}) => { + const properties = [{key: 'key1', value: 'val1'}]; + const tokenPropertyPermissions = [{key: 'key1', permission: {tokenOwner: true, mutable: false, collectionAdmin: true}}]; + const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test', properties, tokenPropertyPermissions}); + const info = await collection.getData(); + expect(info?.raw.properties).to.be.deep.equal(properties); + expect(info?.raw.tokenPropertyPermissions).to.be.deep.equal(tokenPropertyPermissions); }); }); diff --git a/tests/src/removeCollectionAdmin.test.ts b/tests/src/removeCollectionAdmin.test.ts index d9b2a23a3a..943b6f6712 100644 --- a/tests/src/removeCollectionAdmin.test.ts +++ b/tests/src/removeCollectionAdmin.test.ts @@ -16,113 +16,102 @@ import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {usingPlaygrounds} from './util/playgrounds'; +import {IKeyringPair} from '@polkadot/types/types'; +import {itSub, usingPlaygrounds} from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; describe('Integration Test removeCollectionAdmin(collection_id, account_id):', () => { - it('Remove collection admin.', async () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + + before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const alice = privateKey('//Alice'); - const bob = privateKey('//Bob'); - const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - - const collectionInfo = await collection.getData(); - expect(collectionInfo?.raw.owner.toString()).to.be.deep.eq(alice.address); - // first - add collection admin Bob - await collection.addAdmin(alice, {Substrate: bob.address}); - - const adminListAfterAddAdmin = await collection.getAdmins(); - expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: helper.address.normalizeSubstrate(bob.address)}); - - // then remove bob from admins of collection - await collection.removeAdmin(alice, {Substrate: bob.address}); - - const adminListAfterRemoveAdmin = await collection.getAdmins(); - expect(adminListAfterRemoveAdmin).not.to.be.deep.contains({Substrate: helper.address.normalizeSubstrate(bob.address)}); + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([20n, 10n], donor); }); }); - it('Remove admin from collection that has no admins', async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const alice = privateKey('//Alice'); - const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + itSub('Remove collection admin', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionAdmin-1', tokenPrefix: 'RCA'}); + const collectionInfo = await collection.getData(); + expect(collectionInfo?.raw.owner.toString()).to.be.deep.eq(alice.address); + // first - add collection admin Bob + await collection.addAdmin(alice, {Substrate: bob.address}); - const adminListBeforeAddAdmin = await collection.getAdmins(); - expect(adminListBeforeAddAdmin).to.have.lengthOf(0); + const adminListAfterAddAdmin = await collection.getAdmins(); + expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: bob.address}); - // await expect(collection.removeAdmin(alice, {Substrate: alice.address})).to.be.rejectedWith('Unable to remove collection admin'); - await collection.removeAdmin(alice, {Substrate: alice.address}); - }); + // then remove bob from admins of collection + await collection.removeAdmin(alice, {Substrate: bob.address}); + + const adminListAfterRemoveAdmin = await collection.getAdmins(); + expect(adminListAfterRemoveAdmin).not.to.be.deep.contains({Substrate: bob.address}); + }); + + itSub('Remove admin from collection that has no admins', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionAdmin-2', tokenPrefix: 'RCA'}); + + const adminListBeforeAddAdmin = await collection.getAdmins(); + expect(adminListBeforeAddAdmin).to.have.lengthOf(0); + + await collection.removeAdmin(alice, {Substrate: alice.address}); }); }); describe('Negative Integration Test removeCollectionAdmin(collection_id, account_id):', () => { - it('Can\'t remove collection admin from not existing collection', async () => { - await usingPlaygrounds(async (helper, privateKey) => { - // tslint:disable-next-line: no-bitwise - const collectionId = (1 << 32) - 1; - const alice = privateKey('//Alice'); - const bob = privateKey('//Bob'); + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; - await expect(helper.collection.removeAdmin(alice, collectionId, {Substrate: bob.address})).to.be.rejected; - - // Verifying that nothing bad happened (network is live, new collections can be created, etc.) - await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([20n, 10n, 10n], donor); }); }); - it('Can\'t remove collection admin from deleted collection', async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const alice = privateKey('//Alice'); - const bob = privateKey('//Bob'); - const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + itSub('Can\'t remove collection admin from not existing collection', async ({helper}) => { + const collectionId = (1 << 32) - 1; - expect(await collection.burn(alice)).to.be.true; + await expect(helper.collection.removeAdmin(alice, collectionId, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.CollectionNotFound/); + }); - await expect(helper.collection.removeAdmin(alice, collection.collectionId, {Substrate: bob.address})).to.be.rejected; + itSub('Can\'t remove collection admin from deleted collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionAdmin-Neg-2', tokenPrefix: 'RCA'}); - // Verifying that nothing bad happened (network is live, new collections can be created, etc.) - await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - }); - }); + expect(await collection.burn(alice)).to.be.true; - it('Regular user can\'t remove collection admin', async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const alice = privateKey('//Alice'); - const bob = privateKey('//Bob'); - const charlie = privateKey('//Charlie'); - const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + await expect(helper.collection.removeAdmin(alice, collection.collectionId, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.CollectionNotFound/); + }); - await collection.addAdmin(alice, {Substrate: bob.address}); + itSub('Regular user can\'t remove collection admin', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionAdmin-Neg-3', tokenPrefix: 'RCA'}); - await expect(collection.removeAdmin(charlie, {Substrate: bob.address})).to.be.rejected; + await collection.addAdmin(alice, {Substrate: bob.address}); - // Verifying that nothing bad happened (network is live, new collections can be created, etc.) - await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - }); + await expect(collection.removeAdmin(charlie, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.NoPermission/); }); - it('Admin can\'t remove collection admin.', async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const alice = privateKey('//Alice'); - const bob = privateKey('//Bob'); - const charlie = privateKey('//Charlie'); - const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - - await collection.addAdmin(alice, {Substrate: bob.address}); - await collection.addAdmin(alice, {Substrate: charlie.address}); - - const adminListAfterAddAdmin = await collection.getAdmins(); - expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: helper.address.normalizeSubstrate(bob.address)}); - expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: helper.address.normalizeSubstrate(charlie.address)}); - - await expect(collection.removeAdmin(charlie, {Substrate: bob.address})).to.be.rejected; - - const adminListAfterRemoveAdmin = await collection.getAdmins(); - expect(adminListAfterRemoveAdmin).to.be.deep.contains({Substrate: helper.address.normalizeSubstrate(bob.address)}); - expect(adminListAfterRemoveAdmin).to.be.deep.contains({Substrate: helper.address.normalizeSubstrate(charlie.address)}); - }); + itSub('Admin can\'t remove collection admin.', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionAdmin-Neg-4', tokenPrefix: 'RCA'}); + + await collection.addAdmin(alice, {Substrate: bob.address}); + await collection.addAdmin(alice, {Substrate: charlie.address}); + + const adminListAfterAddAdmin = await collection.getAdmins(); + expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: bob.address}); + expect(adminListAfterAddAdmin).to.be.deep.contains({Substrate: charlie.address}); + + await expect(collection.removeAdmin(charlie, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.NoPermission/); + + const adminListAfterRemoveAdmin = await collection.getAdmins(); + expect(adminListAfterRemoveAdmin).to.be.deep.contains({Substrate: bob.address}); + expect(adminListAfterRemoveAdmin).to.be.deep.contains({Substrate: charlie.address}); }); }); diff --git a/tests/src/removeCollectionSponsor.test.ts b/tests/src/removeCollectionSponsor.test.ts index c0e0788e79..c3ffb7c38f 100644 --- a/tests/src/removeCollectionSponsor.test.ts +++ b/tests/src/removeCollectionSponsor.test.ts @@ -16,136 +16,115 @@ import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi, submitTransactionExpectFailAsync} from './substrate/substrate-api'; -import { - createCollectionExpectSuccess, - setCollectionSponsorExpectSuccess, - destroyCollectionExpectSuccess, - confirmSponsorshipExpectSuccess, - confirmSponsorshipExpectFailure, - createItemExpectSuccess, - findUnusedAddress, - removeCollectionSponsorExpectSuccess, - removeCollectionSponsorExpectFailure, - normalizeAccountId, - addCollectionAdminExpectSuccess, - getCreatedCollectionCount, -} from './util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; +import {itSub, usingPlaygrounds} from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; -let alice: IKeyringPair; -let bob: IKeyringPair; - describe('integration test: ext. removeCollectionSponsor():', () => { + let donor: IKeyringPair; + let alice: IKeyringPair; + let bob: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); }); }); - it('Removing NFT collection sponsor stops sponsorship', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); - await removeCollectionSponsorExpectSuccess(collectionId); - - await usingApi(async (api, privateKeyWrapper) => { - // Find unused address - const zeroBalance = await findUnusedAddress(api, privateKeyWrapper); - - // Mint token for unused address - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', zeroBalance.address); - - // Transfer this tokens from unused address to Alice - should fail - const sponsorBalanceBefore = (await api.query.system.account(bob.address)).data.free.toBigInt(); - const zeroToAlice = api.tx.unique.transfer(normalizeAccountId(alice.address), collectionId, itemId, 0); - const badTransaction = async function () { - await submitTransactionExpectFailAsync(zeroBalance, zeroToAlice); - }; - await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees'); - const sponsorBalanceAfter = (await api.query.system.account(bob.address)).data.free.toBigInt(); - - expect(sponsorBalanceAfter).to.be.equal(sponsorBalanceBefore); - }); + itSub('Removing NFT collection sponsor stops sponsorship', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-1', tokenPrefix: 'RCS'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + await collection.removeSponsor(alice); + + // Find unused address + const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); + + // Mint token for unused address + const token = await collection.mintToken(alice, {Substrate: zeroBalance.address}); + + // Transfer this tokens from unused address to Alice - should fail + const sponsorBalanceBefore = await helper.balance.getSubstrate(bob.address); + await expect(token.transfer(zeroBalance, {Substrate: alice.address})) + .to.be.rejectedWith('Inability to pay some fees'); + const sponsorBalanceAfter = await helper.balance.getSubstrate(bob.address); + + expect(sponsorBalanceAfter).to.be.equal(sponsorBalanceBefore); }); - it('Remove a sponsor after it was already removed', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); - await removeCollectionSponsorExpectSuccess(collectionId); - await removeCollectionSponsorExpectSuccess(collectionId); + itSub('Remove a sponsor after it was already removed', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-2', tokenPrefix: 'RCS'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + await expect(collection.removeSponsor(alice)).to.not.be.rejected; + await expect(collection.removeSponsor(alice)).to.not.be.rejected; }); - it('Remove sponsor in a collection that never had the sponsor set', async () => { - const collectionId = await createCollectionExpectSuccess(); - await removeCollectionSponsorExpectSuccess(collectionId); + itSub('Remove sponsor in a collection that never had the sponsor set', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-3', tokenPrefix: 'RCS'}); + await expect(collection.removeSponsor(alice)).to.not.be.rejected; }); - it('Remove sponsor for a collection that had the sponsor set, but not confirmed', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await removeCollectionSponsorExpectSuccess(collectionId); + itSub('Remove sponsor for a collection that had the sponsor set, but not confirmed', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-4', tokenPrefix: 'RCS'}); + await collection.setSponsor(alice, bob.address); + await expect(collection.removeSponsor(alice)).to.not.be.rejected; }); }); describe('(!negative test!) integration test: ext. removeCollectionSponsor():', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([20n, 10n, 10n], donor); }); }); - it('(!negative test!) Remove sponsor for a collection that never existed', async () => { - // Find the collection that never existed - let collectionId = 0; - await usingApi(async (api) => { - collectionId = await getCreatedCollectionCount(api) + 1; - }); - - await removeCollectionSponsorExpectFailure(collectionId); + itSub('(!negative test!) Remove sponsor for a collection that never existed', async ({helper}) => { + const collectionId = (1 << 32) - 1; + await expect(helper.collection.removeSponsor(alice, collectionId)).to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('(!negative test!) Remove sponsor for a collection with collection admin permissions', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await removeCollectionSponsorExpectFailure(collectionId, '//Bob'); + itSub('(!negative test!) Remove sponsor for a collection with collection admin permissions', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-Neg-1', tokenPrefix: 'RCS'}); + await collection.setSponsor(alice, bob.address); + await collection.addAdmin(alice, {Substrate: charlie.address}); + await expect(collection.removeSponsor(charlie)).to.be.rejectedWith(/common\.NoPermission/); }); - it('(!negative test!) Remove sponsor for a collection by regular user', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await removeCollectionSponsorExpectFailure(collectionId, '//Bob'); + itSub('(!negative test!) Remove sponsor for a collection by regular user', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-Neg-2', tokenPrefix: 'RCS'}); + await collection.setSponsor(alice, bob.address); + await expect(collection.removeSponsor(charlie)).to.be.rejectedWith(/common\.NoPermission/); }); - it('(!negative test!) Remove sponsor in a destroyed collection', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await destroyCollectionExpectSuccess(collectionId); - await removeCollectionSponsorExpectFailure(collectionId); + itSub('(!negative test!) Remove sponsor in a destroyed collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-Neg-3', tokenPrefix: 'RCS'}); + await collection.setSponsor(alice, bob.address); + await collection.burn(alice); + await expect(collection.removeSponsor(alice)).to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('Set - remove - confirm: fails', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await removeCollectionSponsorExpectSuccess(collectionId); - await confirmSponsorshipExpectFailure(collectionId, '//Bob'); + itSub('Set - remove - confirm: fails', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-Neg-4', tokenPrefix: 'RCS'}); + await collection.setSponsor(alice, bob.address); + await collection.removeSponsor(alice); + await expect(collection.confirmSponsorship(bob)).to.be.rejectedWith(/unique\.ConfirmUnsetSponsorFail/); }); - it('Set - confirm - remove - confirm: Sponsor cannot come back', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); - await removeCollectionSponsorExpectSuccess(collectionId); - await confirmSponsorshipExpectFailure(collectionId, '//Bob'); + itSub('Set - confirm - remove - confirm: Sponsor cannot come back', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-Neg-5', tokenPrefix: 'RCS'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + await collection.removeSponsor(alice); + await expect(collection.confirmSponsorship(bob)).to.be.rejectedWith(/unique\.ConfirmUnsetSponsorFail/); }); - }); diff --git a/tests/src/removeFromAllowList.test.ts b/tests/src/removeFromAllowList.test.ts index f788309d66..f9c91f8b78 100644 --- a/tests/src/removeFromAllowList.test.ts +++ b/tests/src/removeFromAllowList.test.ts @@ -16,21 +16,8 @@ import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi} from './substrate/substrate-api'; -import { - createCollectionExpectSuccess, - destroyCollectionExpectSuccess, - enableAllowListExpectSuccess, - addToAllowListExpectSuccess, - removeFromAllowListExpectSuccess, - isAllowlisted, - findNotExistingCollection, - removeFromAllowListExpectFailure, - disableAllowListExpectSuccess, - normalizeAccountId, - addCollectionAdminExpectSuccess, -} from './util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; +import {itSub, usingPlaygrounds} from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -40,32 +27,37 @@ describe('Integration Test removeFromAllowList', () => { let bob: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); }); }); - it('ensure bob is not in allowlist after removal', async () => { - await usingApi(async api => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await enableAllowListExpectSuccess(alice, collectionId); - await addToAllowListExpectSuccess(alice, collectionId, bob.address); + itSub('ensure bob is not in allowlist after removal', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-1', tokenPrefix: 'RFAL'}); - await removeFromAllowListExpectSuccess(alice, collectionId, normalizeAccountId(bob.address)); - expect(await isAllowlisted(api, collectionId, bob.address)).to.be.false; - }); + const collectionInfo = await collection.getData(); + expect(collectionInfo!.raw.permissions.access).to.not.equal('AllowList'); + + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await collection.addToAllowList(alice, {Substrate: bob.address}); + expect(await collection.getAllowList()).to.deep.contains({Substrate: bob.address}); + + await collection.removeFromAllowList(alice, {Substrate: bob.address}); + expect(await collection.getAllowList()).to.be.empty; }); - it('allows removal from collection with unset allowlist status', async () => { - await usingApi(async () => { - const collectionWithoutAllowlistId = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionWithoutAllowlistId); - await addToAllowListExpectSuccess(alice, collectionWithoutAllowlistId, bob.address); - await disableAllowListExpectSuccess(alice, collectionWithoutAllowlistId); + itSub('allows removal from collection with unset allowlist status', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-2', tokenPrefix: 'RFAL'}); - await removeFromAllowListExpectSuccess(alice, collectionWithoutAllowlistId, normalizeAccountId(bob.address)); - }); + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await collection.addToAllowList(alice, {Substrate: bob.address}); + expect(await collection.getAllowList()).to.deep.contains({Substrate: bob.address}); + + await collection.setPermissions(alice, {access: 'Normal'}); + + await collection.removeFromAllowList(alice, {Substrate: bob.address}); + expect(await collection.getAllowList()).to.be.empty; }); }); @@ -74,29 +66,26 @@ describe('Negative Integration Test removeFromAllowList', () => { let bob: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); }); }); - it('fails on removal from not existing collection', async () => { - await usingApi(async (api) => { - const collectionId = await findNotExistingCollection(api); - - await removeFromAllowListExpectFailure(alice, collectionId, normalizeAccountId(bob.address)); - }); + itSub('fails on removal from not existing collection', async ({helper}) => { + const nonExistentCollectionId = (1 << 32) - 1; + await expect(helper.collection.removeFromAllowList(alice, nonExistentCollectionId, {Substrate: alice.address})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('fails on removal from removed collection', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionId); - await addToAllowListExpectSuccess(alice, collectionId, bob.address); - await destroyCollectionExpectSuccess(collectionId); + itSub('fails on removal from removed collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-3', tokenPrefix: 'RFAL'}); + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await collection.addToAllowList(alice, {Substrate: bob.address}); - await removeFromAllowListExpectFailure(alice, collectionId, normalizeAccountId(bob.address)); - }); + await collection.burn(alice); + await expect(collection.removeFromAllowList(alice, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); }); @@ -106,41 +95,45 @@ describe('Integration Test removeFromAllowList with collection admin permissions let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); }); - it('ensure address is not in allowlist after removal', async () => { - await usingApi(async api => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await enableAllowListExpectSuccess(alice, collectionId); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await addToAllowListExpectSuccess(alice, collectionId, charlie.address); - await removeFromAllowListExpectSuccess(bob, collectionId, normalizeAccountId(charlie.address)); - expect(await isAllowlisted(api, collectionId, charlie.address)).to.be.false; - }); + itSub('ensure address is not in allowlist after removal', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-4', tokenPrefix: 'RFAL'}); + + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await collection.addAdmin(alice, {Substrate: bob.address}); + + await collection.addToAllowList(bob, {Substrate: charlie.address}); + await collection.removeFromAllowList(bob, {Substrate: charlie.address}); + + expect(await collection.getAllowList()).to.be.empty; }); - it('Collection admin allowed to remove from allowlist with unset allowlist status', async () => { - await usingApi(async () => { - const collectionWithoutAllowlistId = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionWithoutAllowlistId); - await addCollectionAdminExpectSuccess(alice, collectionWithoutAllowlistId, bob.address); - await addToAllowListExpectSuccess(alice, collectionWithoutAllowlistId, charlie.address); - await disableAllowListExpectSuccess(alice, collectionWithoutAllowlistId); - await removeFromAllowListExpectSuccess(bob, collectionWithoutAllowlistId, normalizeAccountId(charlie.address)); - }); + itSub('Collection admin allowed to remove from allowlist with unset allowlist status', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-5', tokenPrefix: 'RFAL'}); + + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await collection.addAdmin(alice, {Substrate: bob.address}); + await collection.addToAllowList(alice, {Substrate: charlie.address}); + + await collection.setPermissions(bob, {access: 'Normal'}); + await collection.removeFromAllowList(bob, {Substrate: charlie.address}); + + expect(await collection.getAllowList()).to.be.empty; }); - it('Regular user can`t remove from allowlist', async () => { - await usingApi(async () => { - const collectionWithoutAllowlistId = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionWithoutAllowlistId); - await addToAllowListExpectSuccess(alice, collectionWithoutAllowlistId, charlie.address); - await removeFromAllowListExpectFailure(bob, collectionWithoutAllowlistId, normalizeAccountId(charlie.address)); - }); + itSub('Regular user can`t remove from allowlist', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-6', tokenPrefix: 'RFAL'}); + + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await collection.addToAllowList(alice, {Substrate: charlie.address}); + + await expect(collection.removeFromAllowList(bob, {Substrate: charlie.address})) + .to.be.rejectedWith(/common\.NoPermission/); + expect(await collection.getAllowList()).to.deep.contain({Substrate: charlie.address}); }); }); diff --git a/tests/src/removeFromContractAllowList.test.ts b/tests/src/removeFromContractAllowList.test.ts index adf7afe8e8..8365dd5f5c 100644 --- a/tests/src/removeFromContractAllowList.test.ts +++ b/tests/src/removeFromContractAllowList.test.ts @@ -20,6 +20,7 @@ import {addToContractAllowListExpectSuccess, isAllowlistedInContract, removeFrom import {IKeyringPair} from '@polkadot/types/types'; import {expect} from 'chai'; +// todo:playgrounds skipped again describe.skip('Integration Test removeFromContractAllowList', () => { let bob: IKeyringPair; diff --git a/tests/src/rpc.test.ts b/tests/src/rpc.test.ts index d76cc574d7..3487958519 100644 --- a/tests/src/rpc.test.ts +++ b/tests/src/rpc.test.ts @@ -1,57 +1,57 @@ import {IKeyringPair} from '@polkadot/types/types'; -import {expect} from 'chai'; -import usingApi from './substrate/substrate-api'; -import {createCollection, createCollectionExpectSuccess, createFungibleItemExpectSuccess, CrossAccountId, getTokenOwner, normalizeAccountId, transfer, U128_MAX} from './util/helpers'; - -let alice: IKeyringPair; -let bob: IKeyringPair; +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; +import {usingPlaygrounds, itSub} from './util/playgrounds'; +import {crossAccountIdFromLower} from './util/playgrounds/unique'; +chai.use(chaiAsPromised); +const expect = chai.expect; describe('integration test: RPC methods', () => { + let donor: IKeyringPair; + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([20n, 10n], donor); }); }); - - it('returns None for fungible collection', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - await expect(getTokenOwner(api, collection, 0)).to.be.rejectedWith(/^owner == null$/); - }); + itSub('returns None for fungible collection', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'RPC-1', tokenPrefix: 'RPC'}); + const owner = (await helper.callRpc('api.rpc.unique.tokenOwner', [collection.collectionId, 0])).toJSON() as any; + expect(owner).to.be.null; }); - it('RPC method tokenOwners for fungible collection and token', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; - const facelessCrowd = Array.from(Array(7).keys()).map(i => normalizeAccountId(privateKeyWrapper(i.toString()))); - - const createCollectionResult = await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}}); - const collectionId = createCollectionResult.collectionId; - const aliceTokenId = await createFungibleItemExpectSuccess(alice, collectionId, {Value: U128_MAX}, alice.address); - - await transfer(api, collectionId, aliceTokenId, alice, bob, 1000n); - await transfer(api, collectionId, aliceTokenId, alice, ethAcc, 900n); - - for (let i = 0; i < 7; i++) { - await transfer(api, collectionId, aliceTokenId, alice, facelessCrowd[i], 1); - } - - const owners = await api.rpc.unique.tokenOwners(collectionId, aliceTokenId); - const ids = (owners.toJSON() as CrossAccountId[]).map(s => normalizeAccountId(s)); - const aliceID = normalizeAccountId(alice); - const bobId = normalizeAccountId(bob); + itSub('RPC method tokenOwners for fungible collection and token', async ({helper}) => { + // Set-up a few token owners of all stripes + const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; + const facelessCrowd = (await helper.arrange.createAccounts([0n, 0n, 0n, 0n, 0n, 0n, 0n], donor)) + .map(i => {return {Substrate: i.address};}); + + const collection = await helper.ft.mintCollection(alice, {name: 'RPC-2', tokenPrefix: 'RPC'}); + // mint some maximum (u128) amounts of tokens possible + await collection.mint(alice, {Substrate: alice.address}, (1n << 128n) - 1n); + + await collection.transfer(alice, {Substrate: bob.address}, 1000n); + await collection.transfer(alice, ethAcc, 900n); + + for (let i = 0; i < facelessCrowd.length; i++) { + await collection.transfer(alice, facelessCrowd[i], 1n); + } + // Set-up over - // What to expect - // tslint:disable-next-line:no-unused-expression - expect(ids).to.deep.include.members([aliceID, ethAcc, bobId, ...facelessCrowd]); - expect(owners.length == 10).to.be.true; - - const eleven = privateKeyWrapper('11'); - expect(await transfer(api, collectionId, aliceTokenId, alice, eleven, 10n)).to.be.true; - expect((await api.rpc.unique.tokenOwners(collectionId, aliceTokenId)).length).to.be.equal(10); - }); + const owners = await helper.callRpc('api.rpc.unique.tokenOwners', [collection.collectionId, 0]); + const ids = (owners.toJSON() as any[]).map(crossAccountIdFromLower); + + expect(ids).to.deep.include.members([{Substrate: alice.address}, ethAcc, {Substrate: bob.address}, ...facelessCrowd]); + expect(owners.length == 10).to.be.true; + + // Make sure only 10 results are returned with this RPC + const [eleven] = await helper.arrange.createAccounts([0n], donor); + expect(await collection.transfer(alice, {Substrate: eleven.address}, 10n)).to.be.true; + expect((await helper.callRpc('api.rpc.unique.tokenOwners', [collection.collectionId, 0])).length).to.be.equal(10); }); }); \ No newline at end of file diff --git a/tests/src/scheduler.test.ts b/tests/src/scheduler.test.ts index 429c906101..fd870593f6 100644 --- a/tests/src/scheduler.test.ts +++ b/tests/src/scheduler.test.ts @@ -44,6 +44,7 @@ import {IKeyringPair} from '@polkadot/types/types'; chai.use(chaiAsPromised); +// todo:playgrounds skipped ~ postponed describe.skip('Scheduling token and balance transfers', () => { let alice: IKeyringPair; let bob: IKeyringPair; diff --git a/tests/src/setChainLimits.test.ts b/tests/src/setChainLimits.test.ts index 314b3a031b..39da831ec0 100644 --- a/tests/src/setChainLimits.test.ts +++ b/tests/src/setChainLimits.test.ts @@ -23,6 +23,7 @@ import { IChainLimits, } from './util/helpers'; +// todo:playgrounds skipped ~ postponed describe.skip('Negative Integration Test setChainLimits', () => { let alice: IKeyringPair; let bob: IKeyringPair; diff --git a/tests/src/setCollectionLimits.test.ts b/tests/src/setCollectionLimits.test.ts index e765ab6c93..7d7f3c1de0 100644 --- a/tests/src/setCollectionLimits.test.ts +++ b/tests/src/setCollectionLimits.test.ts @@ -15,224 +15,191 @@ // along with Unique Network. If not, see . // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import usingApi, {submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api'; -import { - createCollectionExpectSuccess, getCreatedCollectionCount, - getCreateItemResult, - setCollectionLimitsExpectFailure, - setCollectionLimitsExpectSuccess, - addCollectionAdminExpectSuccess, - queryCollectionExpectSuccess, -} from './util/helpers'; +import {itSub, usingPlaygrounds} from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; -let alice: IKeyringPair; -let bob: IKeyringPair; -let collectionIdForTesting: number; - const accountTokenOwnershipLimit = 0; const sponsoredDataSize = 0; const sponsorTransferTimeout = 1; const tokenLimit = 10; describe('setCollectionLimits positive', () => { - let tx; + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - collectionIdForTesting = await createCollectionExpectSuccess({name: 'A', description: 'B', tokenPrefix: 'C', mode: {type: 'NFT'}}); - }); - }); - it('execute setCollectionLimits with predefined params ', async () => { - await usingApi(async (api: ApiPromise) => { - tx = api.tx.unique.setCollectionLimits( - collectionIdForTesting, - { - accountTokenOwnershipLimit: accountTokenOwnershipLimit, - sponsoredDataSize: sponsoredDataSize, - tokenLimit: tokenLimit, - sponsorTransferTimeout, - ownerCanTransfer: true, - ownerCanDestroy: true, - }, - ); - const events = await submitTransactionAsync(alice, tx); - const result = getCreateItemResult(events); - - // get collection limits defined previously - const collectionInfo = await queryCollectionExpectSuccess(api, collectionIdForTesting); - - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.true; - expect(collectionInfo.limits.accountTokenOwnershipLimit.unwrap().toNumber()).to.be.equal(accountTokenOwnershipLimit); - expect(collectionInfo.limits.sponsoredDataSize.unwrap().toNumber()).to.be.equal(sponsoredDataSize); - expect(collectionInfo.limits.tokenLimit.unwrap().toNumber()).to.be.equal(tokenLimit); - expect(collectionInfo.limits.sponsorTransferTimeout.unwrap().toNumber()).to.be.equal(sponsorTransferTimeout); - expect(collectionInfo.limits.ownerCanTransfer.unwrap().toJSON()).to.be.true; - expect(collectionInfo.limits.ownerCanDestroy.unwrap().toJSON()).to.be.true; + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([20n, 10n], donor); }); }); - it('Set the same token limit twice', async () => { - await usingApi(async (api: ApiPromise) => { + itSub('execute setCollectionLimits with predefined params', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetCollectionLimits-1', tokenPrefix: 'SCL'}); - const collectionLimits = { - accountTokenOwnershipLimit: accountTokenOwnershipLimit, - sponsoredMintSize: sponsoredDataSize, - tokenLimit: tokenLimit, + await collection.setLimits( + alice, + { + accountTokenOwnershipLimit, + sponsoredDataSize, + tokenLimit, sponsorTransferTimeout, ownerCanTransfer: true, ownerCanDestroy: true, - }; - - // The first time - const tx1 = api.tx.unique.setCollectionLimits( - collectionIdForTesting, - collectionLimits, - ); - const events1 = await submitTransactionAsync(alice, tx1); - const result1 = getCreateItemResult(events1); - expect(result1.success).to.be.true; - const collectionInfo1 = await queryCollectionExpectSuccess(api, collectionIdForTesting); - expect(collectionInfo1.limits.tokenLimit.unwrap().toNumber()).to.be.equal(tokenLimit); - - // The second time - const tx2 = api.tx.unique.setCollectionLimits( - collectionIdForTesting, - collectionLimits, - ); - const events2 = await submitTransactionAsync(alice, tx2); - const result2 = getCreateItemResult(events2); - expect(result2.success).to.be.true; - const collectionInfo2 = await queryCollectionExpectSuccess(api, collectionIdForTesting); - expect(collectionInfo2.limits.tokenLimit.unwrap().toNumber()).to.be.equal(tokenLimit); - }); + }, + ); + + // get collection limits defined previously + const collectionInfo = await collection.getEffectiveLimits(); + + expect(collectionInfo.accountTokenOwnershipLimit).to.be.equal(accountTokenOwnershipLimit); + expect(collectionInfo.sponsoredDataSize).to.be.equal(sponsoredDataSize); + expect(collectionInfo.tokenLimit).to.be.equal(tokenLimit); + expect(collectionInfo.sponsorTransferTimeout).to.be.equal(sponsorTransferTimeout); + expect(collectionInfo.ownerCanTransfer).to.be.true; + expect(collectionInfo.ownerCanDestroy).to.be.true; }); - it('execute setCollectionLimits from admin collection', async () => { - await addCollectionAdminExpectSuccess(alice, collectionIdForTesting, bob.address); - await usingApi(async (api: ApiPromise) => { - tx = api.tx.unique.setCollectionLimits( - collectionIdForTesting, - { - accountTokenOwnershipLimit, - sponsoredDataSize, - // sponsoredMintSize, - tokenLimit, - }, - ); - await expect(submitTransactionAsync(bob, tx)).to.be.not.rejected; - }); + itSub('Set the same token limit twice', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetCollectionLimits-2', tokenPrefix: 'SCL'}); + + const collectionLimits = { + accountTokenOwnershipLimit, + sponsoredDataSize, + tokenLimit, + sponsorTransferTimeout, + ownerCanTransfer: true, + ownerCanDestroy: true, + }; + + await collection.setLimits(alice, collectionLimits); + + const collectionInfo1 = await collection.getEffectiveLimits(); + + expect(collectionInfo1.tokenLimit).to.be.equal(tokenLimit); + + await collection.setLimits(alice, collectionLimits); + const collectionInfo2 = await collection.getEffectiveLimits(); + expect(collectionInfo2.tokenLimit).to.be.equal(tokenLimit); + }); + + itSub('execute setCollectionLimits from admin collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetCollectionLimits-3', tokenPrefix: 'SCL'}); + await collection.addAdmin(alice, {Substrate: bob.address}); + + const collectionLimits = { + accountTokenOwnershipLimit, + sponsoredDataSize, + // sponsoredMintSize, + tokenLimit, + }; + + await expect(collection.setLimits(alice, collectionLimits)).to.not.be.rejected; }); }); describe('setCollectionLimits negative', () => { - let tx; + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - collectionIdForTesting = await createCollectionExpectSuccess({name: 'A', description: 'B', tokenPrefix: 'C', mode: {type: 'NFT'}}); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([20n, 10n], donor); }); }); - it('execute setCollectionLimits for not exists collection', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionCount = await getCreatedCollectionCount(api); - const nonExistedCollectionId = collectionCount + 1; - tx = api.tx.unique.setCollectionLimits( - nonExistedCollectionId, - { - accountTokenOwnershipLimit, - sponsoredDataSize, - // sponsoredMintSize, - tokenLimit, - }, - ); - await expect(submitTransactionExpectFailAsync(alice, tx)).to.be.rejected; - }); + + itSub('execute setCollectionLimits for not exists collection', async ({helper}) => { + const nonExistentCollectionId = (1 << 32) - 1; + await expect(helper.collection.setLimits( + alice, + nonExistentCollectionId, + { + accountTokenOwnershipLimit, + sponsoredDataSize, + // sponsoredMintSize, + tokenLimit, + }, + )).to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('execute setCollectionLimits from user who is not owner of this collection', async () => { - await usingApi(async (api: ApiPromise) => { - tx = api.tx.unique.setCollectionLimits( - collectionIdForTesting, - { - accountTokenOwnershipLimit, - sponsoredDataSize, - // sponsoredMintSize, - tokenLimit, - }, - ); - await expect(submitTransactionExpectFailAsync(bob, tx)).to.be.rejected; - }); + + itSub('execute setCollectionLimits from user who is not owner of this collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetCollectionLimits-Neg-1', tokenPrefix: 'SCL'}); + + await expect(collection.setLimits(bob, { + accountTokenOwnershipLimit, + sponsoredDataSize, + // sponsoredMintSize, + tokenLimit, + })).to.be.rejectedWith(/common\.NoPermission/); }); - it('fails when trying to enable OwnerCanTransfer after it was disabled', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionLimitsExpectSuccess(alice, collectionId, { - accountTokenOwnershipLimit: accountTokenOwnershipLimit, - sponsoredMintSize: sponsoredDataSize, - tokenLimit: tokenLimit, + itSub('fails when trying to enable OwnerCanTransfer after it was disabled', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetCollectionLimits-Neg-2', tokenPrefix: 'SCL'}); + + await collection.setLimits(alice, { + accountTokenOwnershipLimit, + sponsoredDataSize, + tokenLimit, sponsorTransferTimeout, ownerCanTransfer: false, ownerCanDestroy: true, }); - await setCollectionLimitsExpectFailure(alice, collectionId, { - accountTokenOwnershipLimit: accountTokenOwnershipLimit, - sponsoredMintSize: sponsoredDataSize, - tokenLimit: tokenLimit, + + await expect(collection.setLimits(alice, { + accountTokenOwnershipLimit, + sponsoredDataSize, + tokenLimit, sponsorTransferTimeout, ownerCanTransfer: true, ownerCanDestroy: true, - }); + })).to.be.rejectedWith(/common\.OwnerPermissionsCantBeReverted/); }); - it('fails when trying to enable OwnerCanDestroy after it was disabled', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionLimitsExpectSuccess(alice, collectionId, { - accountTokenOwnershipLimit: accountTokenOwnershipLimit, - sponsoredMintSize: sponsoredDataSize, - tokenLimit: tokenLimit, + itSub('fails when trying to enable OwnerCanDestroy after it was disabled', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetCollectionLimits-Neg-3', tokenPrefix: 'SCL'}); + + await collection.setLimits(alice, { + accountTokenOwnershipLimit, + sponsoredDataSize, + tokenLimit, sponsorTransferTimeout, ownerCanTransfer: true, ownerCanDestroy: false, }); - await setCollectionLimitsExpectFailure(alice, collectionId, { + + await expect(collection.setLimits(alice, { + accountTokenOwnershipLimit, + sponsoredDataSize, + tokenLimit, + sponsorTransferTimeout, + ownerCanTransfer: true, + ownerCanDestroy: true, + })).to.be.rejectedWith(/common\.OwnerPermissionsCantBeReverted/); + }); + + itSub('Setting the higher token limit fails', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetCollectionLimits-Neg-4', tokenPrefix: 'SCL'}); + + const collectionLimits = { accountTokenOwnershipLimit: accountTokenOwnershipLimit, sponsoredMintSize: sponsoredDataSize, tokenLimit: tokenLimit, sponsorTransferTimeout, ownerCanTransfer: true, ownerCanDestroy: true, - }); - }); - - it('Setting the higher token limit fails', async () => { - await usingApi(async () => { + }; - const collectionId = await createCollectionExpectSuccess(); - const collectionLimits = { - accountTokenOwnershipLimit: accountTokenOwnershipLimit, - sponsoredMintSize: sponsoredDataSize, - tokenLimit: tokenLimit, - sponsorTransferTimeout, - ownerCanTransfer: true, - ownerCanDestroy: true, - }; + // The first time + await collection.setLimits(alice, collectionLimits); - // The first time - await setCollectionLimitsExpectSuccess(alice, collectionId, collectionLimits); - - // The second time - higher token limit - collectionLimits.tokenLimit += 1; - await setCollectionLimitsExpectFailure(alice, collectionId, collectionLimits); - }); + // The second time - higher token limit + collectionLimits.tokenLimit += 1; + await expect(collection.setLimits(alice, collectionLimits)).to.be.rejectedWith(/common\.CollectionTokenLimitExceeded/); }); - }); diff --git a/tests/src/setCollectionSponsor.test.ts b/tests/src/setCollectionSponsor.test.ts index ec4b27b002..c77a227a4b 100644 --- a/tests/src/setCollectionSponsor.test.ts +++ b/tests/src/setCollectionSponsor.test.ts @@ -16,91 +16,109 @@ import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi} from './substrate/substrate-api'; -import {createCollectionExpectSuccess, - setCollectionSponsorExpectSuccess, - destroyCollectionExpectSuccess, - setCollectionSponsorExpectFailure, - addCollectionAdminExpectSuccess, - getCreatedCollectionCount, - requirePallets, - Pallets, -} from './util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; +import {itSub, usingPlaygrounds, Pallets} from './util/playgrounds'; chai.use(chaiAsPromised); - -let alice: IKeyringPair; -let bob: IKeyringPair; -let charlie: IKeyringPair; +const expect = chai.expect; describe('integration test: ext. setCollectionSponsor():', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([20n, 10n, 10n], donor); }); }); - it('Set NFT collection sponsor', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); + itSub('Set NFT collection sponsor', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetCollectionSponsor-1-NFT', tokenPrefix: 'SCS'}); + await expect(collection.setSponsor(alice, bob.address)).to.be.not.rejected; + + expect((await collection.getData())?.raw.sponsorship).to.deep.equal({ + Unconfirmed: bob.address, + }); }); - it('Set Fungible collection sponsor', async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); + + itSub('Set Fungible collection sponsor', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'SetCollectionSponsor-1-FT', tokenPrefix: 'SCS'}); + await expect(collection.setSponsor(alice, bob.address)).to.be.not.rejected; + + expect((await collection.getData())?.raw.sponsorship).to.deep.equal({ + Unconfirmed: bob.address, + }); }); - it('Set ReFungible collection sponsor', async function() { - await requirePallets(this, [Pallets.ReFungible]); - const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); + itSub.ifWithPallets('Set ReFungible collection sponsor', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'SetCollectionSponsor-1-RFT', tokenPrefix: 'SCS'}); + await expect(collection.setSponsor(alice, bob.address)).to.be.not.rejected; + + expect((await collection.getData())?.raw.sponsorship).to.deep.equal({ + Unconfirmed: bob.address, + }); }); - it('Set the same sponsor repeatedly', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); + itSub('Set the same sponsor repeatedly', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetCollectionSponsor-2', tokenPrefix: 'SCS'}); + await expect(collection.setSponsor(alice, bob.address)).to.be.not.rejected; + await expect(collection.setSponsor(alice, bob.address)).to.be.not.rejected; + + expect((await collection.getData())?.raw.sponsorship).to.deep.equal({ + Unconfirmed: bob.address, + }); }); - it('Replace collection sponsor', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await setCollectionSponsorExpectSuccess(collectionId, charlie.address); + + itSub('Replace collection sponsor', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetCollectionSponsor-3', tokenPrefix: 'SCS'}); + await expect(collection.setSponsor(alice, bob.address)).to.be.not.rejected; + await expect(collection.setSponsor(alice, charlie.address)).to.be.not.rejected; + + expect((await collection.getData())?.raw.sponsorship).to.deep.equal({ + Unconfirmed: charlie.address, + }); }); - it('Collection admin add sponsor', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await setCollectionSponsorExpectSuccess(collectionId, charlie.address, '//Bob'); + + itSub('Collection admin add sponsor', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetCollectionSponsor-4', tokenPrefix: 'SCS'}); + await collection.addAdmin(alice, {Substrate: bob.address}); + await expect(collection.setSponsor(bob, charlie.address)).to.be.not.rejected; + + expect((await collection.getData())?.raw.sponsorship).to.deep.equal({ + Unconfirmed: charlie.address, + }); }); }); describe('(!negative test!) integration test: ext. setCollectionSponsor():', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([10n, 5n], donor); }); }); - it('(!negative test!) Add sponsor with a non-owner', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectFailure(collectionId, bob.address, '//Bob'); + itSub('(!negative test!) Add sponsor with a non-owner', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetCollectionSponsor-Neg-1', tokenPrefix: 'SCS'}); + await expect(collection.setSponsor(bob, bob.address)) + .to.be.rejectedWith(/common\.NoPermission/); }); - it('(!negative test!) Add sponsor to a collection that never existed', async () => { - // Find the collection that never existed - let collectionId = 0; - await usingApi(async (api) => { - collectionId = await getCreatedCollectionCount(api) + 1; - }); - await setCollectionSponsorExpectFailure(collectionId, bob.address); + itSub('(!negative test!) Add sponsor to a collection that never existed', async ({helper}) => { + const collectionId = (1 << 32) - 1; + await expect(helper.collection.setSponsor(alice, collectionId, bob.address)) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('(!negative test!) Add sponsor to a collection that was destroyed', async () => { - const collectionId = await createCollectionExpectSuccess(); - await destroyCollectionExpectSuccess(collectionId); - await setCollectionSponsorExpectFailure(collectionId, bob.address); + + itSub('(!negative test!) Add sponsor to a collection that was destroyed', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetCollectionSponsor-Neg-2', tokenPrefix: 'SCS'}); + await collection.burn(alice); + await expect(collection.setSponsor(alice, bob.address)) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); }); diff --git a/tests/src/setContractSponsoringRateLimit.test.ts b/tests/src/setContractSponsoringRateLimit.test.ts index 4f0bc7f410..77e830d557 100644 --- a/tests/src/setContractSponsoringRateLimit.test.ts +++ b/tests/src/setContractSponsoringRateLimit.test.ts @@ -25,6 +25,7 @@ import { setContractSponsoringRateLimitExpectSuccess, } from './util/helpers'; +// todo:playgrounds postponed skipped test describe.skip('Integration Test setContractSponsoringRateLimit', () => { it('ensure sponsored contract can\'t be called twice without pause for free', async () => { await usingApi(async (api, privateKeyWrapper) => { diff --git a/tests/src/setMintPermission.test.ts b/tests/src/setMintPermission.test.ts index d5332bef14..6f48656be5 100644 --- a/tests/src/setMintPermission.test.ts +++ b/tests/src/setMintPermission.test.ts @@ -15,65 +15,62 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import usingApi from './substrate/substrate-api'; -import { - addToAllowListExpectSuccess, - createCollectionExpectSuccess, - createItemExpectFailure, - createItemExpectSuccess, - destroyCollectionExpectSuccess, - enableAllowListExpectSuccess, - findNotExistingCollection, - setMintPermissionExpectFailure, - setMintPermissionExpectSuccess, - addCollectionAdminExpectSuccess, -} from './util/helpers'; +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; +import {itSub, usingPlaygrounds} from './util/playgrounds'; + +chai.use(chaiAsPromised); +const expect = chai.expect; describe('Integration Test setMintPermission', () => { let alice: IKeyringPair; let bob: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); }); }); - it('ensure allow-listed non-privileged address can mint tokens', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, true); - await addToAllowListExpectSuccess(alice, collectionId, bob.address); + itSub('ensure allow-listed non-privileged address can mint tokens', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-1', description: '', tokenPrefix: 'SMP'}); + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await collection.addToAllowList(alice, {Substrate: bob.address}); - await createItemExpectSuccess(bob, collectionId, 'NFT'); - }); + await expect(collection.mintToken(bob, {Substrate: bob.address})).to.not.be.rejected; }); - it('can be enabled twice', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setMintPermissionExpectSuccess(alice, collectionId, true); - await setMintPermissionExpectSuccess(alice, collectionId, true); - }); + itSub('can be enabled twice', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-2', description: '', tokenPrefix: 'SMP'}); + expect((await collection.getData())?.raw.permissions.access).to.not.equal('AllowList'); + + await collection.setPermissions(alice, {mintMode: true}); + await collection.setPermissions(alice, {mintMode: true}); + expect((await collection.getData())?.raw.permissions.mintMode).to.be.true; }); - it('can be disabled twice', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setMintPermissionExpectSuccess(alice, collectionId, true); - await setMintPermissionExpectSuccess(alice, collectionId, false); - await setMintPermissionExpectSuccess(alice, collectionId, false); - }); + itSub('can be disabled twice', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-3', description: '', tokenPrefix: 'SMP'}); + expect((await collection.getData())?.raw.permissions.access).to.equal('Normal'); + + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); + expect((await collection.getData())?.raw.permissions.access).to.equal('AllowList'); + expect((await collection.getData())?.raw.permissions.mintMode).to.equal(true); + + await collection.setPermissions(alice, {access: 'Normal', mintMode: false}); + await collection.setPermissions(alice, {access: 'Normal', mintMode: false}); + expect((await collection.getData())?.raw.permissions.access).to.equal('Normal'); + expect((await collection.getData())?.raw.permissions.mintMode).to.equal(false); }); - it('Collection admin success on set', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await setMintPermissionExpectSuccess(bob, collectionId, true); - }); + itSub('Collection admin success on set', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-4', description: '', tokenPrefix: 'SMP'}); + await collection.addAdmin(alice, {Substrate: bob.address}); + await collection.setPermissions(bob, {access: 'AllowList', mintMode: true}); + + expect((await collection.getData())?.raw.permissions.access).to.equal('AllowList'); + expect((await collection.getData())?.raw.permissions.mintMode).to.equal(true); }); }); @@ -82,41 +79,38 @@ describe('Negative Integration Test setMintPermission', () => { let bob: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); }); }); - it('fails on not existing collection', async () => { - await usingApi(async (api) => { - const nonExistingCollection = await findNotExistingCollection(api); - await setMintPermissionExpectFailure(alice, nonExistingCollection, true); - }); + itSub('fails on not existing collection', async ({helper}) => { + const collectionId = (1 << 32) - 1; + await expect(helper.collection.setPermissions(alice, collectionId, {mintMode: true})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('fails on removed collection', async () => { - await usingApi(async () => { - const removedCollectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await destroyCollectionExpectSuccess(removedCollectionId); + itSub('fails on removed collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-Neg-1', tokenPrefix: 'SMP'}); + await collection.burn(alice); - await setMintPermissionExpectFailure(alice, removedCollectionId, true); - }); + await expect(collection.setPermissions(alice, {mintMode: true})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('fails when not collection owner tries to set mint status', async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectFailure(bob, collectionId, true); + itSub('fails when non-owner tries to set mint status', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-Neg-2', tokenPrefix: 'SMP'}); + + await expect(collection.setPermissions(bob, {mintMode: true})) + .to.be.rejectedWith(/common\.NoPermission/); }); - it('ensure non-allow-listed non-privileged address can\'t mint tokens', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, true); + itSub('ensure non-allow-listed non-privileged address can\'t mint tokens', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-Neg-3', tokenPrefix: 'SMP'}); + await collection.setPermissions(alice, {mintMode: true}); - await createItemExpectFailure(bob, collectionId, 'NFT'); - }); + await expect(collection.mintToken(bob, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.AddressNotInAllowlist/); }); }); diff --git a/tests/src/setPublicAccessMode.test.ts b/tests/src/setPublicAccessMode.test.ts index d71a812dfe..9a2071c28c 100644 --- a/tests/src/setPublicAccessMode.test.ts +++ b/tests/src/setPublicAccessMode.test.ts @@ -15,111 +15,84 @@ // along with Unique Network. If not, see . // https://unique-network.readthedocs.io/en/latest/jsapi.html#setschemaversion -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import usingApi, {submitTransactionExpectFailAsync} from './substrate/substrate-api'; -import { - addToAllowListExpectSuccess, - createCollectionExpectSuccess, - createItemExpectSuccess, - destroyCollectionExpectSuccess, - enablePublicMintingExpectSuccess, - enableAllowListExpectSuccess, - normalizeAccountId, - addCollectionAdminExpectSuccess, - getCreatedCollectionCount, -} from './util/helpers'; +import {itSub, usingPlaygrounds} from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; -let alice: IKeyringPair; -let bob: IKeyringPair; - describe('Integration Test setPublicAccessMode(): ', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); }); }); - it('Run extrinsic with collection id parameters, set the allowlist mode for the collection', async () => { - await usingApi(async () => { - const collectionId: number = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionId); - await enablePublicMintingExpectSuccess(alice, collectionId); - await addToAllowListExpectSuccess(alice, collectionId, bob.address); - await createItemExpectSuccess(bob, collectionId, 'NFT', bob.address); - }); + itSub('Runs extrinsic with collection id parameters, sets the allowlist mode for the collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-1', tokenPrefix: 'TF'}); + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await collection.addToAllowList(alice, {Substrate: bob.address}); + + await expect(collection.mintToken(bob, {Substrate: bob.address})).to.be.not.rejected; }); - it('Allowlisted collection limits', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionId = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionId); - await enablePublicMintingExpectSuccess(alice, collectionId); - const tx = api.tx.unique.createItem(collectionId, normalizeAccountId(bob.address), 'NFT'); - await expect(submitTransactionExpectFailAsync(bob, tx)).to.be.rejected; - }); + itSub('Allowlisted collection limits', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-2', tokenPrefix: 'TF'}); + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); + + await expect(collection.mintToken(bob, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.AddressNotInAllowlist/); + }); + + itSub('setPublicAccessMode by collection admin', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-4', tokenPrefix: 'TF'}); + await collection.addAdmin(alice, {Substrate: bob.address}); + + await expect(collection.setPermissions(bob, {access: 'AllowList'})).to.be.not.rejected; }); }); describe('Negative Integration Test ext. setPublicAccessMode(): ', () => { - it('Set a non-existent collection', async () => { - await usingApi(async (api: ApiPromise) => { - // tslint:disable-next-line: radix - const collectionId = await getCreatedCollectionCount(api) + 1; - const tx = api.tx.unique.setCollectionPermissions(collectionId, {access: 'AllowList'}); - await expect(submitTransactionExpectFailAsync(alice, tx)).to.be.rejected; + let alice: IKeyringPair; + let bob: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); }); }); - it('Set the collection that has been deleted', async () => { - await usingApi(async (api: ApiPromise) => { - // tslint:disable-next-line: no-bitwise - const collectionId = await createCollectionExpectSuccess(); - await destroyCollectionExpectSuccess(collectionId); - const tx = api.tx.unique.setCollectionPermissions(collectionId, {access: 'AllowList'}); - await expect(submitTransactionExpectFailAsync(alice, tx)).to.be.rejected; - }); + itSub('Sets a non-existent collection', async ({helper}) => { + const collectionId = (1 << 32) - 1; + await expect(helper.collection.setPermissions(alice, collectionId, {access: 'AllowList'})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('Re-set the list mode already set in quantity', async () => { - await usingApi(async () => { - const collectionId: number = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionId); - await enableAllowListExpectSuccess(alice, collectionId); - }); - }); + itSub('Sets the collection that has been deleted', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-1', tokenPrefix: 'TF'}); + await collection.burn(alice); - it('Execute method not on behalf of the collection owner', async () => { - await usingApi(async (api: ApiPromise) => { - // tslint:disable-next-line: no-bitwise - const collectionId = await createCollectionExpectSuccess(); - const tx = api.tx.unique.setCollectionPermissions(collectionId, {access: 'AllowList'}); - await expect(submitTransactionExpectFailAsync(bob, tx)).to.be.rejected; - }); + await expect(collection.setPermissions(alice, {access: 'AllowList'})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('setPublicAccessMode by collection admin', async () => { - await usingApi(async (api: ApiPromise) => { - // tslint:disable-next-line: no-bitwise - const collectionId = await createCollectionExpectSuccess(); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - const tx = api.tx.unique.setCollectionPermissions(collectionId, {access: 'AllowList'}); - await expect(submitTransactionExpectFailAsync(bob, tx)).to.be.not.rejected; - }); + itSub('Re-sets the list mode already set in quantity', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-2', tokenPrefix: 'TF'}); + await collection.setPermissions(alice, {access: 'AllowList'}); + await collection.setPermissions(alice, {access: 'AllowList'}); }); -}); -describe('Negative Integration Test ext. collection admin setPublicAccessMode(): ', () => { - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - }); + itSub('Executes method as a malefactor', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-3', tokenPrefix: 'TF'}); + + await expect(collection.setPermissions(bob, {access: 'AllowList'})) + .to.be.rejectedWith(/common\.NoPermission/); }); }); diff --git a/tests/src/toggleContractAllowList.test.ts b/tests/src/toggleContractAllowList.test.ts index 379144fc45..64a01474b3 100644 --- a/tests/src/toggleContractAllowList.test.ts +++ b/tests/src/toggleContractAllowList.test.ts @@ -31,6 +31,7 @@ const expect = chai.expect; const value = 0; const gasLimit = 3000n * 1000000n; +// todo:playgrounds skipped ~ postpone describe.skip('Integration Test toggleContractAllowList', () => { it('Enable allow list contract mode', async () => { diff --git a/tests/src/transfer.test.ts b/tests/src/transfer.test.ts index d698053086..8fe7a5f58b 100644 --- a/tests/src/transfer.test.ts +++ b/tests/src/transfer.test.ts @@ -14,387 +14,319 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import {expect} from 'chai'; -import getBalance from './substrate/get-balance'; -import {default as usingApi, submitTransactionAsync} from './substrate/substrate-api'; -import { - burnItemExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess, - destroyCollectionExpectSuccess, - findUnusedAddress, - getCreateCollectionResult, - getCreateItemResult, - transferExpectFailure, - transferExpectSuccess, - addCollectionAdminExpectSuccess, - getCreatedCollectionCount, - toSubstrateAddress, - getTokenOwner, - normalizeAccountId, - getBalance as getTokenBalance, - transferFromExpectSuccess, - transferFromExpectFail, - requirePallets, - Pallets, -} from './util/helpers'; -import { - subToEth, - itWeb3, -} from './eth/util/helpers'; -import {request} from 'https'; - -let alice: IKeyringPair; -let bob: IKeyringPair; -let charlie: IKeyringPair; - -describe('Integration Test Transfer(recipient, collection_id, item_id, value)', () => { +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; +import {itEth, usingEthPlaygrounds} from './eth/util/playgrounds'; +import {itSub, Pallets, usingPlaygrounds} from './util/playgrounds'; + +chai.use(chaiAsPromised); +const expect = chai.expect; + +describe.skip('Integration Test Transfer(recipient, collection_id, item_id, value)', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); }); }); - it('Balance transfers and check balance', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alice.address, bob.address]); - - const transfer = api.tx.balances.transfer(bob.address, 1n); - const events = await submitTransactionAsync(alice, transfer); - const result = getCreateItemResult(events); - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.true; - - const [alicesBalanceAfter, bobsBalanceAfter] = await getBalance(api, [alice.address, bob.address]); - - // tslint:disable-next-line:no-unused-expression - expect(alicesBalanceAfter < alicesBalanceBefore).to.be.true; - // tslint:disable-next-line:no-unused-expression - expect(bobsBalanceAfter > bobsBalanceBefore).to.be.true; - }); + itSub('Balance transfers and check balance', async ({helper}) => { + const alicesBalanceBefore = await helper.balance.getSubstrate(alice.address); + const bobsBalanceBefore = await helper.balance.getSubstrate(bob.address); + + expect(await helper.balance.transferToSubstrate(alice, bob.address, 1n)).to.be.true; + + const alicesBalanceAfter = await helper.balance.getSubstrate(alice.address); + const bobsBalanceAfter = await helper.balance.getSubstrate(bob.address); + + expect(alicesBalanceAfter < alicesBalanceBefore).to.be.true; + expect(bobsBalanceAfter > bobsBalanceBefore).to.be.true; }); - it('Inability to pay fees error message is correct', async () => { - await usingApi(async (api, privateKeyWrapper) => { - // Find unused address - const pk = await findUnusedAddress(api, privateKeyWrapper); - - const badTransfer = api.tx.balances.transfer(bob.address, 1n); - // const events = await submitTransactionAsync(pk, badTransfer); - const badTransaction = async () => { - const events = await submitTransactionAsync(pk, badTransfer); - const result = getCreateCollectionResult(events); - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.false; - }; - await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees , e.g. account balance too low'); - }); + itSub('Inability to pay fees error message is correct', async ({helper, privateKey}) => { + const donor = privateKey('//Alice'); + const [zero] = await helper.arrange.createAccounts([0n], donor); + + // console.error = () => {}; + // The following operation throws an error into the console and the logs. Pay it no heed as long as the test succeeds. + await expect(helper.balance.transferToSubstrate(zero, donor.address, 1n)) + .to.be.rejectedWith('Inability to pay some fees , e.g. account balance too low'); }); - it('[nft] User can transfer owned token', async () => { - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - await transferExpectSuccess(nftCollectionId, newNftTokenId, alice, bob, 1, 'NFT'); + itSub('[nft] User can transfer owned token', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'Transfer-1-NFT', description: '', tokenPrefix: 'T'}); + const nft = await collection.mintToken(alice, {Substrate: alice.address}); + + await nft.transfer(alice, {Substrate: bob.address}); + expect(await nft.getOwner()).to.be.deep.equal({Substrate: bob.address}); }); - it('[fungible] User can transfer owned token', async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await transferExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob, 1, 'Fungible'); + itSub('[fungible] User can transfer owned token', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'Transfer-1-FT', description: '', tokenPrefix: 'T'}); + await collection.mint(alice, {Substrate: alice.address}, 10n); + + await collection.transfer(alice, {Substrate: bob.address}, 9n); + expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(9n); + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(1n); }); - it('[refungible] User can transfer owned token', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await transferExpectSuccess( - reFungibleCollectionId, - newReFungibleTokenId, - alice, - bob, - 100, - 'ReFungible', - ); + itSub.ifWithPallets('[refungible] User can transfer owned token', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'Transfer-1-RFT', description: '', tokenPrefix: 'T'}); + const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); + + await rft.transfer(alice, {Substrate: bob.address}, 9n); + expect(await rft.getBalance({Substrate: bob.address})).to.be.equal(9n); + expect(await rft.getBalance({Substrate: alice.address})).to.be.equal(1n); }); - it('[nft] Collection admin can transfer owned token', async () => { - const nftCollectionId = await createCollectionExpectSuccess(); - await addCollectionAdminExpectSuccess(alice, nftCollectionId, bob.address); - const newNftTokenId = await createItemExpectSuccess(bob, nftCollectionId, 'NFT', bob.address); - await transferExpectSuccess(nftCollectionId, newNftTokenId, bob, alice, 1, 'NFT'); + itSub('[nft] Collection admin can transfer owned token', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'Transfer-2-NFT', description: '', tokenPrefix: 'T'}); + await collection.addAdmin(alice, {Substrate: bob.address}); + + const nft = await collection.mintToken(bob, {Substrate: bob.address}); + await nft.transfer(bob, {Substrate: alice.address}); + + expect(await nft.getOwner()).to.be.deep.equal({Substrate: alice.address}); }); - it('[fungible] Collection admin can transfer owned token', async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - await addCollectionAdminExpectSuccess(alice, fungibleCollectionId, bob.address); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible', bob.address); - await transferExpectSuccess(fungibleCollectionId, newFungibleTokenId, bob, alice, 1, 'Fungible'); + itSub('[fungible] Collection admin can transfer owned token', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'Transfer-2-FT', description: '', tokenPrefix: 'T'}); + await collection.addAdmin(alice, {Substrate: bob.address}); + + await collection.mint(bob, {Substrate: bob.address}, 10n); + await collection.transfer(bob, {Substrate: alice.address}, 1n); + + expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(9n); + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(1n); }); - it('[refungible] Collection admin can transfer owned token', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await addCollectionAdminExpectSuccess(alice, reFungibleCollectionId, bob.address); - const newReFungibleTokenId = await createItemExpectSuccess(bob, reFungibleCollectionId, 'ReFungible', bob.address); - await transferExpectSuccess( - reFungibleCollectionId, - newReFungibleTokenId, - bob, - alice, - 100, - 'ReFungible', - ); + itSub.ifWithPallets('[refungible] Collection admin can transfer owned token', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'Transfer-2-RFT', description: '', tokenPrefix: 'T'}); + await collection.addAdmin(alice, {Substrate: bob.address}); + + const rft = await collection.mintToken(bob, {Substrate: bob.address}, 10n); + await rft.transfer(bob, {Substrate: alice.address}, 1n); + + expect(await rft.getBalance({Substrate: bob.address})).to.be.equal(9n); + expect(await rft.getBalance({Substrate: alice.address})).to.be.equal(1n); }); }); -describe('Negative Integration Test Transfer(recipient, collection_id, item_id, value)', () => { +describe.skip('Negative Integration Test Transfer(recipient, collection_id, item_id, value)', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); }); }); - it('[nft] Transfer with not existed collection_id', async () => { - await usingApi(async (api) => { - const nftCollectionCount = await getCreatedCollectionCount(api); - await transferExpectFailure(nftCollectionCount + 1, 1, alice, bob, 1); - }); + itSub('[nft] Transfer with not existed collection_id', async ({helper}) => { + const collectionId = (1 << 32) - 1; + await expect(helper.nft.transferToken(alice, collectionId, 1, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('[fungible] Transfer with not existed collection_id', async () => { - await usingApi(async (api) => { - const fungibleCollectionCount = await getCreatedCollectionCount(api); - await transferExpectFailure(fungibleCollectionCount + 1, 0, alice, bob, 1); - }); + itSub('[fungible] Transfer with not existed collection_id', async ({helper}) => { + const collectionId = (1 << 32) - 1; + await expect(helper.ft.transfer(alice, collectionId, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('[refungible] Transfer with not existed collection_id', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await usingApi(async (api) => { - const reFungibleCollectionCount = await getCreatedCollectionCount(api); - await transferExpectFailure(reFungibleCollectionCount + 1, 1, alice, bob, 1); - }); + itSub.ifWithPallets('[refungible] Transfer with not existed collection_id', [Pallets.ReFungible], async ({helper}) => { + const collectionId = (1 << 32) - 1; + await expect(helper.rft.transferToken(alice, collectionId, 1, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('[nft] Transfer with deleted collection_id', async () => { - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - await burnItemExpectSuccess(alice, nftCollectionId, newNftTokenId); - await destroyCollectionExpectSuccess(nftCollectionId); - await transferExpectFailure(nftCollectionId, newNftTokenId, alice, bob, 1); - }); + itSub('[nft] Transfer with deleted collection_id', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'Transfer-Neg-1-NFT', description: '', tokenPrefix: 'T'}); + const nft = await collection.mintToken(alice, {Substrate: alice.address}); - it('[fungible] Transfer with deleted collection_id', async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await burnItemExpectSuccess(alice, fungibleCollectionId, newFungibleTokenId, 10); - await destroyCollectionExpectSuccess(fungibleCollectionId); - await transferExpectFailure(fungibleCollectionId, newFungibleTokenId, alice, bob, 1); - }); + await nft.burn(alice); + await collection.burn(alice); - it('[refungible] Transfer with deleted collection_id', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const reFungibleCollectionId = await - createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await burnItemExpectSuccess(alice, reFungibleCollectionId, newReFungibleTokenId, 100); - await destroyCollectionExpectSuccess(reFungibleCollectionId); - await transferExpectFailure( - reFungibleCollectionId, - newReFungibleTokenId, - alice, - bob, - 1, - ); + await expect(nft.transfer(alice, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('[nft] Transfer with not existed item_id', async () => { - const nftCollectionId = await createCollectionExpectSuccess(); - await transferExpectFailure(nftCollectionId, 2, alice, bob, 1); - }); + itSub('[fungible] Transfer with deleted collection_id', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'Transfer-Neg-1-FT', description: '', tokenPrefix: 'T'}); + await collection.mint(alice, {Substrate: alice.address}, 10n); - it('[fungible] Transfer with not existed item_id', async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - await transferExpectFailure(fungibleCollectionId, 2, alice, bob, 1); - }); + await collection.burnTokens(alice, 10n); + await collection.burn(alice); - it('[refungible] Transfer with not existed item_id', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await transferExpectFailure( - reFungibleCollectionId, - 2, - alice, - bob, - 1, - ); + await expect(collection.transfer(alice, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); + + itSub.ifWithPallets('[refungible] Transfer with deleted collection_id', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'Transfer-Neg-1-RFT', description: '', tokenPrefix: 'T'}); + const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); - it('[nft] Transfer with deleted item_id', async () => { - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - await burnItemExpectSuccess(alice, nftCollectionId, newNftTokenId, 1); - await transferExpectFailure(nftCollectionId, newNftTokenId, alice, bob, 1); - }); + await rft.burn(alice, 10n); + await collection.burn(alice); - it('[fungible] Transfer with deleted item_id', async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await burnItemExpectSuccess(alice, fungibleCollectionId, newFungibleTokenId, 10); - await transferExpectFailure(fungibleCollectionId, newFungibleTokenId, alice, bob, 1); + await expect(rft.transfer(alice, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('[refungible] Transfer with deleted item_id', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const reFungibleCollectionId = await - createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await burnItemExpectSuccess(alice, reFungibleCollectionId, newReFungibleTokenId, 100); - await transferExpectFailure( - reFungibleCollectionId, - newReFungibleTokenId, - alice, - bob, - 1, - ); + itSub('[nft] Transfer with not existed item_id', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'Transfer-Neg-2-NFT', description: '', tokenPrefix: 'T'}); + await expect(collection.transferToken(alice, 1, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.TokenNotFound/); }); - it('[nft] Transfer with recipient that is not owner', async () => { - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - await transferExpectFailure(nftCollectionId, newNftTokenId, charlie, bob, 1); + itSub('[fungible] Transfer with not existed item_id', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'Transfer-Neg-2-FT', description: '', tokenPrefix: 'T'}); + await expect(collection.transfer(alice, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.TokenValueTooLow/); }); - it('[fungible] Transfer with recipient that is not owner', async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await transferExpectFailure(fungibleCollectionId, newFungibleTokenId, charlie, bob, 1); + itSub.ifWithPallets('[refungible] Transfer with not existed item_id', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'Transfer-Neg-2-RFT', description: '', tokenPrefix: 'T'}); + await expect(collection.transferToken(alice, 1, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.TokenValueTooLow/); }); - it('[refungible] Transfer with recipient that is not owner', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await transferExpectFailure( - reFungibleCollectionId, - newReFungibleTokenId, - charlie, - bob, - 1, - ); - }); -}); + itSub('[nft] Transfer with deleted item_id', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'Transfer-Neg-3-NFT', description: '', tokenPrefix: 'T'}); + const nft = await collection.mintToken(alice, {Substrate: alice.address}); -describe('Zero value transfer(From)', () => { - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - }); + await nft.burn(alice); + + await expect(nft.transfer(alice, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.TokenNotFound/); }); - it('NFT', async () => { - await usingApi(async (api: ApiPromise) => { - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); + itSub('[fungible] Transfer with deleted item_id', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'Transfer-Neg-3-FT', description: '', tokenPrefix: 'T'}); + await collection.mint(alice, {Substrate: alice.address}, 10n); - const transferTx = api.tx.unique.transfer(normalizeAccountId(bob), nftCollectionId, newNftTokenId, 0); - await submitTransactionAsync(alice, transferTx); - const address = normalizeAccountId(await getTokenOwner(api, nftCollectionId, newNftTokenId)); + await collection.burnTokens(alice, 10n); - expect(toSubstrateAddress(address)).to.be.equal(alice.address); - }); + await expect(collection.transfer(alice, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.TokenValueTooLow/); }); - it('RFT', async function() { - await requirePallets(this, [Pallets.ReFungible]); + itSub.ifWithPallets('[refungible] Transfer with deleted item_id', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'Transfer-Neg-3-RFT', description: '', tokenPrefix: 'T'}); + const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); - await usingApi(async (api: ApiPromise) => { - const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - const balanceBeforeAlice = await getTokenBalance(api, reFungibleCollectionId, normalizeAccountId(alice), newReFungibleTokenId); - const balanceBeforeBob = await getTokenBalance(api, reFungibleCollectionId, normalizeAccountId(bob), newReFungibleTokenId); + await rft.burn(alice, 10n); - const transferTx = api.tx.unique.transfer(normalizeAccountId(bob), reFungibleCollectionId, newReFungibleTokenId, 0); - await submitTransactionAsync(alice, transferTx); + await expect(rft.transfer(alice, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.TokenValueTooLow/); + }); - const balanceAfterAlice = await getTokenBalance(api, reFungibleCollectionId, normalizeAccountId(alice), newReFungibleTokenId); - const balanceAfterBob = await getTokenBalance(api, reFungibleCollectionId, normalizeAccountId(bob), newReFungibleTokenId); + itSub('[nft] Transfer with recipient that is not owner', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'Transfer-Neg-4-NFT', description: '', tokenPrefix: 'T'}); + const nft = await collection.mintToken(alice, {Substrate: alice.address}); - expect((balanceBeforeAlice)).to.be.equal(balanceAfterAlice); - expect((balanceBeforeBob)).to.be.equal(balanceAfterBob); - }); + await expect(nft.transfer(bob, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.NoPermission/); + expect(await nft.getOwner()).to.be.deep.equal({Substrate: alice.address}); }); - it('Fungible', async () => { - await usingApi(async (api: ApiPromise) => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - const balanceBeforeAlice = await getTokenBalance(api, fungibleCollectionId, normalizeAccountId(alice), newFungibleTokenId); - const balanceBeforeBob = await getTokenBalance(api, fungibleCollectionId, normalizeAccountId(bob), newFungibleTokenId); + itSub('[fungible] Transfer with recipient that is not owner', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'Transfer-Neg-4-FT', description: '', tokenPrefix: 'T'}); + await collection.mint(alice, {Substrate: alice.address}, 10n); - const transferTx = api.tx.unique.transfer(normalizeAccountId(bob), fungibleCollectionId, newFungibleTokenId, 0); - await submitTransactionAsync(alice, transferTx); + await expect(collection.transfer(bob, {Substrate: bob.address}, 9n)) + .to.be.rejectedWith(/common\.TokenValueTooLow/); + expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(0n); + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(10n); + }); - const balanceAfterAlice = await getTokenBalance(api, fungibleCollectionId, normalizeAccountId(alice), newFungibleTokenId); - const balanceAfterBob = await getTokenBalance(api, fungibleCollectionId, normalizeAccountId(bob), newFungibleTokenId); + itSub.ifWithPallets('[refungible] Transfer with recipient that is not owner', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'Transfer-1-RFT', description: '', tokenPrefix: 'T'}); + const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); - expect((balanceBeforeAlice)).to.be.equal(balanceAfterAlice); - expect((balanceBeforeBob)).to.be.equal(balanceAfterBob); - }); + await expect(rft.transfer(bob, {Substrate: bob.address}, 9n)) + .to.be.rejectedWith(/common\.TokenValueTooLow/); + expect(await rft.getBalance({Substrate: bob.address})).to.be.equal(0n); + expect(await rft.getBalance({Substrate: alice.address})).to.be.equal(10n); }); }); describe('Transfers to self (potentially over substrate-evm boundary)', () => { - itWeb3('Transfers to self. In case of same frontend', async ({api, privateKeyWrapper}) => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const aliceProxy = subToEth(alice.address); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address}); - await transferExpectSuccess(collectionId, tokenId, alice, {Ethereum: aliceProxy}, 10, 'Fungible'); - const balanceAliceBefore = await getTokenBalance(api, collectionId, {Ethereum: aliceProxy}, tokenId); - await transferFromExpectSuccess(collectionId, tokenId, alice, {Ethereum: aliceProxy}, {Ethereum: aliceProxy}, 10, 'Fungible'); - const balanceAliceAfter = await getTokenBalance(api, collectionId, {Ethereum: aliceProxy}, tokenId); - expect(balanceAliceBefore).to.be.eq(balanceAliceAfter); + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_, privateKey) => { + donor = privateKey('//Alice'); + }); }); + + itEth('Transfers to self. In case of same frontend', async ({helper}) => { + const [owner] = await helper.arrange.createAccounts([10n], donor); + const collection = await helper.ft.mintCollection(owner, {}); + await collection.mint(owner, {Substrate: owner.address}, 100n); + + const ownerProxy = helper.address.substrateToEth(owner.address); + + // transfer to own proxy + await collection.transfer(owner, {Ethereum: ownerProxy}, 10n); + expect(await collection.getBalance({Substrate: owner.address})).to.be.equal(90n); + expect(await collection.getBalance({Ethereum: ownerProxy})).to.be.equal(10n); - itWeb3('Transfers to self. In case of substrate-evm boundary', async ({api, privateKeyWrapper}) => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const aliceProxy = subToEth(alice.address); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address}); - const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId); - await transferExpectSuccess(collectionId, tokenId, alice, {Ethereum: aliceProxy} , 10, 'Fungible'); - await transferFromExpectSuccess(collectionId, tokenId, alice, {Ethereum: aliceProxy}, alice, 10, 'Fungible'); - const balanceAliceAfter = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId); - expect(balanceAliceBefore).to.be.eq(balanceAliceAfter); + // transfer-from own proxy to own proxy again + await collection.transferFrom(owner, {Ethereum: ownerProxy}, {Ethereum: ownerProxy}, 5n); + expect(await collection.getBalance({Substrate: owner.address})).to.be.equal(90n); + expect(await collection.getBalance({Ethereum: ownerProxy})).to.be.equal(10n); }); - itWeb3('Transfers to self. In case of inside substrate-evm', async ({api, privateKeyWrapper}) => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address}); - const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId); - await transferExpectSuccess(collectionId, tokenId, alice, alice , 10, 'Fungible'); - await transferFromExpectSuccess(collectionId, tokenId, alice, alice, alice, 10, 'Fungible'); - const balanceAliceAfter = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId); - expect(balanceAliceBefore).to.be.eq(balanceAliceAfter); + itEth('Transfers to self. In case of substrate-evm boundary', async ({helper}) => { + const [owner] = await helper.arrange.createAccounts([10n], donor); + const collection = await helper.ft.mintCollection(owner, {}); + await collection.mint(owner, {Substrate: owner.address}, 100n); + + const ownerProxy = helper.address.substrateToEth(owner.address); + + // transfer to own proxy + await collection.transfer(owner, {Ethereum: ownerProxy}, 10n); + expect(await collection.getBalance({Substrate: owner.address})).to.be.equal(90n); + expect(await collection.getBalance({Ethereum: ownerProxy})).to.be.equal(10n); + + // transfer-from own proxy to self + await collection.transferFrom(owner, {Ethereum: ownerProxy}, {Substrate: owner.address}, 5n); + expect(await collection.getBalance({Substrate: owner.address})).to.be.equal(95n); + expect(await collection.getBalance({Ethereum: ownerProxy})).to.be.equal(5n); }); - itWeb3('Transfers to self. In case of inside substrate-evm when not enought "Fungibles"', async ({api, privateKeyWrapper}) => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address}); - const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId); - await transferExpectFailure(collectionId, tokenId, alice, alice , 11); - await transferFromExpectFail(collectionId, tokenId, alice, alice, alice, 11); - const balanceAliceAfter = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId); - expect(balanceAliceBefore).to.be.eq(balanceAliceAfter); + itEth('Transfers to self. In case of inside substrate-evm', async ({helper}) => { + const [owner] = await helper.arrange.createAccounts([10n], donor); + const collection = await helper.ft.mintCollection(owner, {}); + await collection.mint(owner, {Substrate: owner.address}, 100n); + + // transfer to self again + await collection.transfer(owner, {Substrate: owner.address}, 10n); + expect(await collection.getBalance({Substrate: owner.address})).to.be.equal(100n); + + // transfer-from self to self again + await collection.transferFrom(owner, {Substrate: owner.address}, {Substrate: owner.address}, 5n); + expect(await collection.getBalance({Substrate: owner.address})).to.be.equal(100n); + }); + + itEth('Transfers to self. In case of inside substrate-evm when not enought "Fungibles"', async ({helper}) => { + const [owner] = await helper.arrange.createAccounts([10n], donor); + const collection = await helper.ft.mintCollection(owner, {}); + await collection.mint(owner, {Substrate: owner.address}, 10n); + + // transfer to self again + await expect(collection.transfer(owner, {Substrate: owner.address}, 11n)) + .to.be.rejectedWith(/common\.TokenValueTooLow/); + + // transfer-from self to self again + await expect(collection.transferFrom(owner, {Substrate: owner.address}, {Substrate: owner.address}, 12n)) + .to.be.rejectedWith(/common\.TokenValueTooLow/); + expect(await collection.getBalance({Substrate: owner.address})).to.be.equal(10n); }); }); diff --git a/tests/src/transferFrom.test.ts b/tests/src/transferFrom.test.ts index 6fb6bbce6d..99bc9d7abf 100644 --- a/tests/src/transferFrom.test.ts +++ b/tests/src/transferFrom.test.ts @@ -14,26 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi} from './substrate/substrate-api'; -import { - approveExpectFail, - approveExpectSuccess, - createCollectionExpectSuccess, - createFungibleItemExpectSuccess, - createItemExpectSuccess, - getAllowance, - transferFromExpectFail, - transferFromExpectSuccess, - burnItemExpectSuccess, - setCollectionLimitsExpectSuccess, - getCreatedCollectionCount, - requirePallets, - Pallets, -} from './util/helpers'; +import {itSub, Pallets, usingPlaygrounds} from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -44,67 +28,64 @@ describe('Integration Test transferFrom(from, recipient, collection_id, item_id, let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([20n, 10n, 10n], donor); }); }); - it('[nft] Execute the extrinsic and check nftItemList - owner of token', async () => { - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address); + itSub('[nft] Execute the extrinsic and check nftItemList - owner of token', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'TransferFrom-1', description: '', tokenPrefix: 'TF'}); + const nft = await collection.mintToken(alice, {Substrate: alice.address}); + await nft.approve(alice, {Substrate: bob.address}); + expect(await nft.isApproved({Substrate: bob.address})).to.be.true; - await transferFromExpectSuccess(nftCollectionId, newNftTokenId, bob, alice, charlie, 1, 'NFT'); + await nft.transferFrom(bob, {Substrate: alice.address}, {Substrate: charlie.address}); + expect(await nft.getOwner()).to.be.deep.equal({Substrate: charlie.address}); }); - it('[fungible] Execute the extrinsic and check nftItemList - owner of token', async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address); - await transferFromExpectSuccess(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 1, 'Fungible'); + itSub('[fungible] Execute the extrinsic and check nftItemList - owner of token', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'TransferFrom-2', description: '', tokenPrefix: 'TF'}); + await collection.mint(alice, {Substrate: alice.address}, 10n); + await collection.approveTokens(alice, {Substrate: bob.address}, 7n); + expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(7n); + + await collection.transferFrom(bob, {Substrate: alice.address}, {Substrate: charlie.address}, 6n); + expect(await collection.getBalance({Substrate: charlie.address})).to.be.equal(6n); + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(4n); + expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(1n); }); - it('[refungible] Execute the extrinsic and check nftItemList - owner of token', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 100); - await transferFromExpectSuccess( - reFungibleCollectionId, - newReFungibleTokenId, - bob, - alice, - charlie, - 100, - 'ReFungible', - ); + itSub.ifWithPallets('[refungible] Execute the extrinsic and check nftItemList - owner of token', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'TransferFrom-3', description: '', tokenPrefix: 'TF'}); + const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); + await rft.approve(alice, {Substrate: bob.address}, 7n); + expect(await rft.getApprovedPieces({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(7n); + + await rft.transferFrom(bob, {Substrate: alice.address}, {Substrate: charlie.address}, 6n); + expect(await rft.getBalance({Substrate: charlie.address})).to.be.equal(6n); + expect(await rft.getBalance({Substrate: alice.address})).to.be.equal(4n); + expect(await rft.getApprovedPieces({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(1n); }); - it('Should reduce allowance if value is big', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - - // fungible - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createFungibleItemExpectSuccess(alice, fungibleCollectionId, {Value: 500000n}); + itSub('Should reduce allowance if value is big', async ({helper}) => { + // fungible + const collection = await helper.ft.mintCollection(alice, {name: 'TransferFrom-4', description: '', tokenPrefix: 'TF'}); + await collection.mint(alice, {Substrate: alice.address}, 500000n); - await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address, 500000n); - await transferFromExpectSuccess(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 500000n, 'Fungible'); - expect(await getAllowance(api, fungibleCollectionId, alice.address, bob.address, newFungibleTokenId)).to.equal(0n); - }); + await collection.approveTokens(alice, {Substrate: bob.address}, 500000n); + expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(500000n); + await collection.transferFrom(bob, {Substrate: alice.address}, {Substrate: charlie.address}, 500000n); + expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(0n); }); - it('can be called by collection owner on non-owned item when OwnerCanTransfer == true', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true}); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address); + itSub('can be called by collection owner on non-owned item when OwnerCanTransfer == true', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'TransferFrom-5', description: '', tokenPrefix: 'TF'}); + await collection.setLimits(alice, {ownerCanTransfer: true}); - await transferFromExpectSuccess(collectionId, itemId, alice, bob, charlie); + const nft = await collection.mintToken(alice, {Substrate: bob.address}); + await nft.transferFrom(alice, {Substrate: bob.address}, {Substrate: charlie.address}); + expect(await nft.getOwner()).to.be.deep.equal({Substrate: charlie.address}); }); }); @@ -114,245 +95,263 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([50n, 10n, 10n], donor); }); }); - it('[nft] transferFrom for a collection that does not exist', async () => { - await usingApi(async (api: ApiPromise) => { - const nftCollectionCount = await getCreatedCollectionCount(api); - await approveExpectFail(nftCollectionCount + 1, 1, alice, bob); + itSub('transferFrom for a collection that does not exist', async ({helper}) => { + const collectionId = (1 << 32) - 1; + await expect(helper.collection.approveToken(alice, collectionId, 0, {Substrate: bob.address}, 1n)) + .to.be.rejectedWith(/common\.CollectionNotFound/); + await expect(helper.collection.transferTokenFrom(bob, collectionId, 0, {Substrate: alice.address}, {Substrate: bob.address}, 1n)) + .to.be.rejectedWith(/common\.CollectionNotFound/); + }); - await transferFromExpectFail(nftCollectionCount + 1, 1, bob, alice, charlie, 1); - }); + /* itSub('transferFrom for a collection that was destroyed', async ({helper}) => { + this test copies approve negative test + }); */ + + /* itSub('transferFrom a token that does not exist', async ({helper}) => { + this test copies approve negative test + }); */ + + /* itSub('transferFrom a token that was deleted', async ({helper}) => { + this test copies approve negative test + }); */ + + itSub('[nft] transferFrom for not approved address', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'TransferFrom-Neg-1', description: '', tokenPrefix: 'TF'}); + const nft = await collection.mintToken(alice, {Substrate: alice.address}); + + await expect(nft.transferFrom(bob, {Substrate: alice.address}, {Substrate: charlie.address})) + .to.be.rejectedWith(/common\.ApprovedValueTooLow/); + expect(await nft.getOwner()).to.be.deep.equal({Substrate: alice.address}); }); - it('[fungible] transferFrom for a collection that does not exist', async () => { - await usingApi(async (api: ApiPromise) => { - const fungibleCollectionCount = await getCreatedCollectionCount(api); - await approveExpectFail(fungibleCollectionCount + 1, 0, alice, bob); + itSub('[fungible] transferFrom for not approved address', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'TransferFrom-Neg-1', description: '', tokenPrefix: 'TF'}); + await collection.mint(alice, {Substrate: alice.address}, 10n); - await transferFromExpectFail(fungibleCollectionCount + 1, 0, bob, alice, charlie, 1); - }); + await expect(collection.transferFrom(bob, {Substrate: alice.address}, {Substrate: charlie.address}, 5n)) + .to.be.rejectedWith(/common\.ApprovedValueTooLow/); + expect(await collection.getBalance({Substrate: alice.address})).to.be.deep.equal(10n); + expect(await collection.getBalance({Substrate: bob.address})).to.be.deep.equal(0n); + expect(await collection.getBalance({Substrate: charlie.address})).to.be.deep.equal(0n); }); - it('[refungible] transferFrom for a collection that does not exist', async function() { - await requirePallets(this, [Pallets.ReFungible]); + itSub.ifWithPallets('[refungible] transferFrom for not approved address', [Pallets.ReFungible], async({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'TransferFrom-Neg-3', description: '', tokenPrefix: 'TF'}); + const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); - await usingApi(async (api: ApiPromise) => { - const reFungibleCollectionCount = await getCreatedCollectionCount(api); - await approveExpectFail(reFungibleCollectionCount + 1, 1, alice, bob); + await expect(rft.transferFrom(bob, {Substrate: alice.address}, {Substrate: charlie.address})) + .to.be.rejectedWith(/common\.ApprovedValueTooLow/); + expect(await rft.getBalance({Substrate: alice.address})).to.be.deep.equal(10n); + expect(await rft.getBalance({Substrate: bob.address})).to.be.deep.equal(0n); + expect(await rft.getBalance({Substrate: charlie.address})).to.be.deep.equal(0n); + }); - await transferFromExpectFail(reFungibleCollectionCount + 1, 1, bob, alice, charlie, 1); - }); + itSub('[nft] transferFrom incorrect token count', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'TransferFrom-Neg-4', description: '', tokenPrefix: 'TF'}); + const nft = await collection.mintToken(alice, {Substrate: alice.address}); + + await nft.approve(alice, {Substrate: bob.address}); + expect(await nft.isApproved({Substrate: bob.address})).to.be.true; + + await expect(helper.collection.transferTokenFrom( + bob, + collection.collectionId, + nft.tokenId, + {Substrate: alice.address}, + {Substrate: charlie.address}, + 2n, + )).to.be.rejectedWith(/nonfungible\.NonfungibleItemsHaveNoAmount/); + expect(await nft.getOwner()).to.be.deep.equal({Substrate: alice.address}); }); - /* it('transferFrom for a collection that was destroyed', async () => { - await usingApi(async (api: ApiPromise) => { - this test copies approve negative test - }); - }); */ + itSub('[fungible] transferFrom incorrect token count', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'TransferFrom-Neg-5', description: '', tokenPrefix: 'TF'}); + await collection.mint(alice, {Substrate: alice.address}, 10n); - /* it('transferFrom a token that does not exist', async () => { - await usingApi(async (api: ApiPromise) => { - this test copies approve negative test - }); - }); */ + await collection.approveTokens(alice, {Substrate: bob.address}, 2n); + expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.eq(2n); - /* it('transferFrom a token that was deleted', async () => { - await usingApi(async (api: ApiPromise) => { - this test copies approve negative test - }); - }); */ + await expect(collection.transferFrom(bob, {Substrate: alice.address}, {Substrate: charlie.address}, 5n)) + .to.be.rejectedWith(/common\.ApprovedValueTooLow/); + expect(await collection.getBalance({Substrate: alice.address})).to.be.deep.equal(10n); + expect(await collection.getBalance({Substrate: bob.address})).to.be.deep.equal(0n); + expect(await collection.getBalance({Substrate: charlie.address})).to.be.deep.equal(0n); + }); - it('[nft] transferFrom for not approved address', async () => { - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); + itSub.ifWithPallets('[refungible] transferFrom incorrect token count', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'TransferFrom-Neg-6', description: '', tokenPrefix: 'TF'}); + const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); - await transferFromExpectFail(nftCollectionId, newNftTokenId, bob, alice, charlie, 1); - }); + await rft.approve(alice, {Substrate: bob.address}, 5n); + expect(await rft.getApprovedPieces({Substrate: alice.address}, {Substrate: bob.address})).to.be.eq(5n); - it('[fungible] transferFrom for not approved address', async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 1); + await expect(rft.transferFrom(bob, {Substrate: alice.address}, {Substrate: charlie.address}, 7n)) + .to.be.rejectedWith(/common\.ApprovedValueTooLow/); + expect(await rft.getBalance({Substrate: alice.address})).to.be.deep.equal(10n); + expect(await rft.getBalance({Substrate: bob.address})).to.be.deep.equal(0n); + expect(await rft.getBalance({Substrate: charlie.address})).to.be.deep.equal(0n); }); - it('[refungible] transferFrom for not approved address', async function() { - await requirePallets(this, [Pallets.ReFungible]); + itSub('[nft] execute transferFrom from account that is not owner of collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'TransferFrom-Neg-7', description: '', tokenPrefix: 'TF'}); + const nft = await collection.mintToken(alice, {Substrate: alice.address}); - const reFungibleCollectionId = await - createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await transferFromExpectFail( - reFungibleCollectionId, - newReFungibleTokenId, - bob, - alice, + await expect(nft.approve(charlie, {Substrate: bob.address})).to.be.rejectedWith(/common\.CantApproveMoreThanOwned/); + expect(await nft.isApproved({Substrate: bob.address})).to.be.false; + + await expect(nft.transferFrom( charlie, - 1, - ); + {Substrate: alice.address}, + {Substrate: charlie.address}, + )).to.be.rejectedWith(/common\.ApprovedValueTooLow/); + expect(await nft.getOwner()).to.be.deep.equal({Substrate: alice.address}); }); - it('[nft] transferFrom incorrect token count', async () => { - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address); + itSub('[fungible] execute transferFrom from account that is not owner of collection', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'TransferFrom-Neg-8', description: '', tokenPrefix: 'TF'}); + await collection.mint(alice, {Substrate: alice.address}, 10000n); - await transferFromExpectFail(nftCollectionId, newNftTokenId, bob, alice, charlie, 2); - }); + await expect(collection.approveTokens(charlie, {Substrate: bob.address}, 1n)).to.be.rejectedWith(/common\.CantApproveMoreThanOwned/); + expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.eq(0n); + expect(await collection.getApprovedTokens({Substrate: charlie.address}, {Substrate: bob.address})).to.be.eq(0n); - it('[fungible] transferFrom incorrect token count', async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address); - await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 2); + await expect(collection.transferFrom( + charlie, + {Substrate: alice.address}, + {Substrate: charlie.address}, + )).to.be.rejectedWith(/common\.ApprovedValueTooLow/); + expect(await collection.getBalance({Substrate: alice.address})).to.be.deep.equal(10000n); + expect(await collection.getBalance({Substrate: bob.address})).to.be.deep.equal(0n); + expect(await collection.getBalance({Substrate: charlie.address})).to.be.deep.equal(0n); }); - it('[refungible] transferFrom incorrect token count', async function() { - await requirePallets(this, [Pallets.ReFungible]); + itSub.ifWithPallets('[refungible] execute transferFrom from account that is not owner of collection', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'TransferFrom-Neg-9', description: '', tokenPrefix: 'TF'}); + const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10000n); - const reFungibleCollectionId = await - createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address); - await transferFromExpectFail( - reFungibleCollectionId, - newReFungibleTokenId, - bob, - alice, + await expect(rft.approve(charlie, {Substrate: bob.address}, 1n)).to.be.rejectedWith(/common\.CantApproveMoreThanOwned/); + expect(await rft.getApprovedPieces({Substrate: alice.address}, {Substrate: bob.address})).to.be.eq(0n); + expect(await rft.getApprovedPieces({Substrate: charlie.address}, {Substrate: bob.address})).to.be.eq(0n); + + await expect(rft.transferFrom( charlie, - 2, - ); + {Substrate: alice.address}, + {Substrate: charlie.address}, + )).to.be.rejectedWith(/common\.ApprovedValueTooLow/); + expect(await rft.getBalance({Substrate: alice.address})).to.be.deep.equal(10000n); + expect(await rft.getBalance({Substrate: bob.address})).to.be.deep.equal(0n); + expect(await rft.getBalance({Substrate: charlie.address})).to.be.deep.equal(0n); }); - it('[nft] execute transferFrom from account that is not owner of collection', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const dave = privateKeyWrapper('//Dave'); - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - try { - await approveExpectFail(nftCollectionId, newNftTokenId, dave, bob); - await transferFromExpectFail(nftCollectionId, newNftTokenId, dave, alice, charlie, 1); - } catch (e) { - // tslint:disable-next-line:no-unused-expression - expect(e).to.be.exist; - } - - // await transferFromExpectFail(nftCollectionId, newNftTokenId, Dave, Alice, Charlie, 1); - }); - }); + itSub('transferFrom burnt token before approve NFT', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'TransferFrom-Neg-10', description: '', tokenPrefix: 'TF'}); + await collection.setLimits(alice, {ownerCanTransfer: true}); + const nft = await collection.mintToken(alice, {Substrate: alice.address}); - it('[fungible] execute transferFrom from account that is not owner of collection', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const dave = privateKeyWrapper('//Dave'); - - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - try { - await approveExpectFail(fungibleCollectionId, newFungibleTokenId, dave, bob); - await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, dave, alice, charlie, 1); - } catch (e) { - // tslint:disable-next-line:no-unused-expression - expect(e).to.be.exist; - } - }); - }); + await nft.burn(alice); + await expect(nft.approve(alice, {Substrate: bob.address})).to.be.rejectedWith(/common\.TokenNotFound/); - it('[refungible] execute transferFrom from account that is not owner of collection', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await usingApi(async (api, privateKeyWrapper) => { - const dave = privateKeyWrapper('//Dave'); - const reFungibleCollectionId = await - createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - try { - await approveExpectFail(reFungibleCollectionId, newReFungibleTokenId, dave, bob); - await transferFromExpectFail(reFungibleCollectionId, newReFungibleTokenId, dave, alice, charlie, 1); - } catch (e) { - // tslint:disable-next-line:no-unused-expression - expect(e).to.be.exist; - } - }); - }); - it('transferFrom burnt token before approve NFT', async () => { - await usingApi(async () => { - // nft - const nftCollectionId = await createCollectionExpectSuccess(); - await setCollectionLimitsExpectSuccess(alice, nftCollectionId, {ownerCanTransfer: true}); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - await burnItemExpectSuccess(alice, nftCollectionId, newNftTokenId, 1); - await approveExpectFail(nftCollectionId, newNftTokenId, alice, bob); - await transferFromExpectFail(nftCollectionId, newNftTokenId, bob, alice, charlie, 1); - }); + await expect(nft.transferFrom( + bob, + {Substrate: alice.address}, + {Substrate: charlie.address}, + )).to.be.rejectedWith(/common\.ApprovedValueTooLow/); }); - it('transferFrom burnt token before approve Fungible', async () => { - await usingApi(async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - await setCollectionLimitsExpectSuccess(alice, fungibleCollectionId, {ownerCanTransfer: true}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await burnItemExpectSuccess(alice, fungibleCollectionId, newFungibleTokenId, 10); - await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address); - await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 1); - }); + itSub('transferFrom burnt token before approve Fungible', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'TransferFrom-Neg-11', description: '', tokenPrefix: 'TF'}); + await collection.setLimits(alice, {ownerCanTransfer: true}); + await collection.mint(alice, {Substrate: alice.address}, 10n); + + await collection.burnTokens(alice, 10n); + await expect(collection.approveTokens(alice, {Substrate: bob.address})).to.be.not.rejected; + + await expect(collection.transferFrom( + alice, + {Substrate: alice.address}, + {Substrate: charlie.address}, + )).to.be.rejectedWith(/common\.TokenValueTooLow/); }); - it('transferFrom burnt token before approve ReFungible', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await usingApi(async () => { - const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await setCollectionLimitsExpectSuccess(alice, reFungibleCollectionId, {ownerCanTransfer: true}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await burnItemExpectSuccess(alice, reFungibleCollectionId, newReFungibleTokenId, 100); - await approveExpectFail(reFungibleCollectionId, newReFungibleTokenId, alice, bob); - await transferFromExpectFail(reFungibleCollectionId, newReFungibleTokenId, bob, alice, charlie, 1); + itSub.ifWithPallets('transferFrom burnt token before approve ReFungible', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'TransferFrom-Neg-12', description: '', tokenPrefix: 'TF'}); + await collection.setLimits(alice, {ownerCanTransfer: true}); + const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); - }); + await rft.burn(alice, 10n); + await expect(rft.approve(alice, {Substrate: bob.address})).to.be.rejectedWith(/common\.CantApproveMoreThanOwned/); + + await expect(rft.transferFrom( + alice, + {Substrate: alice.address}, + {Substrate: charlie.address}, + )).to.be.rejectedWith(/common\.TokenValueTooLow/); }); - it('transferFrom burnt token after approve NFT', async () => { - await usingApi(async () => { - // nft - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address); - await burnItemExpectSuccess(alice, nftCollectionId, newNftTokenId, 1); - await transferFromExpectFail(nftCollectionId, newNftTokenId, bob, alice, charlie, 1); - }); + itSub('transferFrom burnt token after approve NFT', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'TransferFrom-Neg-13', description: '', tokenPrefix: 'TF'}); + const nft = await collection.mintToken(alice, {Substrate: alice.address}); + + await nft.approve(alice, {Substrate: bob.address}); + expect(await nft.isApproved({Substrate: bob.address})).to.be.true; + + await nft.burn(alice); + + await expect(nft.transferFrom( + bob, + {Substrate: alice.address}, + {Substrate: charlie.address}, + )).to.be.rejectedWith(/common\.ApprovedValueTooLow/); }); - it('transferFrom burnt token after approve Fungible', async () => { - await usingApi(async () => { - const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible'); - await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address); - await burnItemExpectSuccess(alice, fungibleCollectionId, newFungibleTokenId, 10); - await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 1); - }); + itSub('transferFrom burnt token after approve Fungible', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'TransferFrom-Neg-14', description: '', tokenPrefix: 'TF'}); + await collection.mint(alice, {Substrate: alice.address}, 10n); + + await collection.approveTokens(alice, {Substrate: bob.address}); + expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.eq(1n); + + await collection.burnTokens(alice, 10n); + + await expect(collection.transferFrom( + bob, + {Substrate: alice.address}, + {Substrate: charlie.address}, + )).to.be.rejectedWith(/common\.TokenValueTooLow/); }); - it('transferFrom burnt token after approve ReFungible', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await usingApi(async () => { - const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible'); - await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address); - await burnItemExpectSuccess(alice, reFungibleCollectionId, newReFungibleTokenId, 100); - await transferFromExpectFail(reFungibleCollectionId, newReFungibleTokenId, bob, alice, charlie, 1); + itSub.ifWithPallets('transferFrom burnt token after approve ReFungible', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'TransferFrom-Neg-15', description: '', tokenPrefix: 'TF'}); + const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); - }); + await rft.approve(alice, {Substrate: bob.address}, 10n); + expect(await rft.getApprovedPieces({Substrate: alice.address}, {Substrate: bob.address})).to.be.eq(10n); + + await rft.burn(alice, 10n); + + await expect(rft.transferFrom( + bob, + {Substrate: alice.address}, + {Substrate: charlie.address}, + )).to.be.rejectedWith(/common\.ApprovedValueTooLow/); }); - it('fails when called by collection owner on non-owned item when OwnerCanTransfer == false', async () => { - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address); - await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: false}); + itSub('fails when called by collection owner on non-owned item when OwnerCanTransfer == false', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'TransferFrom-Neg-16', description: '', tokenPrefix: 'TF'}); + const nft = await collection.mintToken(alice, {Substrate: bob.address}); - await transferFromExpectFail(collectionId, itemId, alice, bob, charlie); + await collection.setLimits(alice, {ownerCanTransfer: false}); + + await expect(nft.transferFrom( + alice, + {Substrate: bob.address}, + {Substrate: charlie.address}, + )).to.be.rejectedWith(/common\.ApprovedValueTooLow/); }); }); diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 72f6a617a3..4aa63230cd 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -2128,10 +2128,6 @@ class UniqueCollectionBase { return await this.helper.collection.addAdmin(signer, this.collectionId, adminAddressObj); } - async enableCertainPermissions(signer: TSigner, accessMode: 'AllowList' | 'Normal' | undefined = 'AllowList', mintMode: boolean | undefined = true) { - return await this.setPermissions(signer, {access: accessMode, mintMode: mintMode}); - } - async addToAllowList(signer: TSigner, addressObj: ICrossAccountId) { return await this.helper.collection.addToAllowList(signer, this.collectionId, addressObj); } diff --git a/tests/src/xcmTransfer.test.ts b/tests/src/xcmTransfer.test.ts index 904ebb64ab..ea93bd4a71 100644 --- a/tests/src/xcmTransfer.test.ts +++ b/tests/src/xcmTransfer.test.ts @@ -33,6 +33,7 @@ const KARURA_CHAIN = 2000; const KARURA_PORT = '9946'; const TRANSFER_AMOUNT = 2000000000000000000000000n; +// todo:playgrounds refit when XCM drops describe.skip('Integration test: Exchanging QTZ with Karura', () => { let alice: IKeyringPair; From e1baaf9b07693047e73e04effec96153ad2fffc6 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 9 Sep 2022 08:35:04 +0000 Subject: [PATCH 0821/1274] tests: fix solc has any + revert skipping in transfer --- tests/src/eth/util/playgrounds/unique.dev.d.ts | 17 +++++++++++++++++ tests/src/eth/util/playgrounds/unique.dev.ts | 2 ++ tests/src/transfer.test.ts | 4 ++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 tests/src/eth/util/playgrounds/unique.dev.d.ts diff --git a/tests/src/eth/util/playgrounds/unique.dev.d.ts b/tests/src/eth/util/playgrounds/unique.dev.d.ts new file mode 100644 index 0000000000..c5f9582541 --- /dev/null +++ b/tests/src/eth/util/playgrounds/unique.dev.d.ts @@ -0,0 +1,17 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +declare module 'solc'; \ No newline at end of file diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index 2d29128e66..552c62d7c6 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 /* eslint-disable function-call-argument-newline */ +// eslint-disable-next-line @typescript-eslint/triple-slash-reference +/// import {readFile} from 'fs/promises'; diff --git a/tests/src/transfer.test.ts b/tests/src/transfer.test.ts index 8fe7a5f58b..a38db5a16f 100644 --- a/tests/src/transfer.test.ts +++ b/tests/src/transfer.test.ts @@ -23,7 +23,7 @@ import {itSub, Pallets, usingPlaygrounds} from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; -describe.skip('Integration Test Transfer(recipient, collection_id, item_id, value)', () => { +describe('Integration Test Transfer(recipient, collection_id, item_id, value)', () => { let alice: IKeyringPair; let bob: IKeyringPair; @@ -116,7 +116,7 @@ describe.skip('Integration Test Transfer(recipient, collection_id, item_id, valu }); }); -describe.skip('Negative Integration Test Transfer(recipient, collection_id, item_id, value)', () => { +describe('Negative Integration Test Transfer(recipient, collection_id, item_id, value)', () => { let alice: IKeyringPair; let bob: IKeyringPair; From a41d8f4a8579a59efdaaccbac2fdba3fc9c97645 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 9 Sep 2022 11:38:20 +0300 Subject: [PATCH 0822/1274] fix:typo, order --- .github/workflows/nodes-only-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodes-only-update.yml b/.github/workflows/nodes-only-update.yml index 246fb4fee8..3a80a2200a 100644 --- a/.github/workflows/nodes-only-update.yml +++ b/.github/workflows/nodes-only-update.yml @@ -195,9 +195,9 @@ jobs: run: | yarn install yarn add mochawesome - yarm polkadot-types node scripts/readyness.js echo "Ready to start tests" + yarn polkadot-types NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ From 3f7f6aa6cd8e345131a4788cedd9ae63d16394a4 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 9 Sep 2022 08:56:59 +0000 Subject: [PATCH 0823/1274] tests: displace chai-expect header copypasta --- tests/src/addCollectionAdmin.test.ts | 7 +------ tests/src/fungible.test.ts | 8 ++------ tests/src/pallet-presence.test.ts | 3 +-- tests/src/refungible.test.ts | 7 +------ tests/src/removeCollectionAdmin.test.ts | 7 +------ tests/src/removeCollectionSponsor.test.ts | 7 +------ tests/src/removeFromAllowList.test.ts | 7 +------ tests/src/rpc.test.ts | 23 +++++++++++++++++------ tests/src/setCollectionLimits.test.ts | 7 +------ tests/src/setCollectionSponsor.test.ts | 7 +------ tests/src/setMintPermission.test.ts | 7 +------ tests/src/setPublicAccessMode.test.ts | 7 +------ tests/src/transfer.test.ts | 7 +------ tests/src/transferFrom.test.ts | 7 +------ tests/src/util/playgrounds/index.ts | 5 +++++ 15 files changed, 36 insertions(+), 80 deletions(-) diff --git a/tests/src/addCollectionAdmin.test.ts b/tests/src/addCollectionAdmin.test.ts index ec990b7c72..3d6a4e92e0 100644 --- a/tests/src/addCollectionAdmin.test.ts +++ b/tests/src/addCollectionAdmin.test.ts @@ -15,12 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {itSub, usingPlaygrounds} from './util/playgrounds'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => { let donor: IKeyringPair; diff --git a/tests/src/fungible.test.ts b/tests/src/fungible.test.ts index 5fb4c7ab8b..d3bc3a00b7 100644 --- a/tests/src/fungible.test.ts +++ b/tests/src/fungible.test.ts @@ -16,13 +16,9 @@ import {IKeyringPair} from '@polkadot/types/types'; import {U128_MAX} from './util/helpers'; -import {itSub, usingPlaygrounds} from './util/playgrounds'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; +// todo:playgrounds get rid of globals let alice: IKeyringPair; let bob: IKeyringPair; diff --git a/tests/src/pallet-presence.test.ts b/tests/src/pallet-presence.test.ts index 11ceaba252..899c342c0e 100644 --- a/tests/src/pallet-presence.test.ts +++ b/tests/src/pallet-presence.test.ts @@ -14,8 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {expect} from 'chai'; -import {itSub, usingPlaygrounds} from './util/playgrounds'; +import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; // Pallets that must always be present const requiredPallets = [ diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index d04aed46a9..63b3c01e91 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -15,12 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util/playgrounds'; - -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from './util/playgrounds'; let alice: IKeyringPair; let bob: IKeyringPair; diff --git a/tests/src/removeCollectionAdmin.test.ts b/tests/src/removeCollectionAdmin.test.ts index 943b6f6712..88b9cc2240 100644 --- a/tests/src/removeCollectionAdmin.test.ts +++ b/tests/src/removeCollectionAdmin.test.ts @@ -14,13 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds} from './util/playgrounds'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; describe('Integration Test removeCollectionAdmin(collection_id, account_id):', () => { let alice: IKeyringPair; diff --git a/tests/src/removeCollectionSponsor.test.ts b/tests/src/removeCollectionSponsor.test.ts index c3ffb7c38f..326b160dfd 100644 --- a/tests/src/removeCollectionSponsor.test.ts +++ b/tests/src/removeCollectionSponsor.test.ts @@ -14,13 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds} from './util/playgrounds'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; describe('integration test: ext. removeCollectionSponsor():', () => { let donor: IKeyringPair; diff --git a/tests/src/removeFromAllowList.test.ts b/tests/src/removeFromAllowList.test.ts index f9c91f8b78..e037bcba2d 100644 --- a/tests/src/removeFromAllowList.test.ts +++ b/tests/src/removeFromAllowList.test.ts @@ -14,13 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds} from './util/playgrounds'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; describe('Integration Test removeFromAllowList', () => { let alice: IKeyringPair; diff --git a/tests/src/rpc.test.ts b/tests/src/rpc.test.ts index 3487958519..a0119bbc38 100644 --- a/tests/src/rpc.test.ts +++ b/tests/src/rpc.test.ts @@ -1,12 +1,23 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {usingPlaygrounds, itSub} from './util/playgrounds'; +import {usingPlaygrounds, itSub, expect} from './util/playgrounds'; import {crossAccountIdFromLower} from './util/playgrounds/unique'; -chai.use(chaiAsPromised); -const expect = chai.expect; - describe('integration test: RPC methods', () => { let donor: IKeyringPair; let alice: IKeyringPair; diff --git a/tests/src/setCollectionLimits.test.ts b/tests/src/setCollectionLimits.test.ts index 7d7f3c1de0..7cb7919b68 100644 --- a/tests/src/setCollectionLimits.test.ts +++ b/tests/src/setCollectionLimits.test.ts @@ -16,12 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {itSub, usingPlaygrounds} from './util/playgrounds'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; const accountTokenOwnershipLimit = 0; const sponsoredDataSize = 0; diff --git a/tests/src/setCollectionSponsor.test.ts b/tests/src/setCollectionSponsor.test.ts index c77a227a4b..46a804cbb5 100644 --- a/tests/src/setCollectionSponsor.test.ts +++ b/tests/src/setCollectionSponsor.test.ts @@ -14,13 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, Pallets} from './util/playgrounds'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itSub, usingPlaygrounds, expect, Pallets} from './util/playgrounds'; describe('integration test: ext. setCollectionSponsor():', () => { let alice: IKeyringPair; diff --git a/tests/src/setMintPermission.test.ts b/tests/src/setMintPermission.test.ts index 6f48656be5..be136a4636 100644 --- a/tests/src/setMintPermission.test.ts +++ b/tests/src/setMintPermission.test.ts @@ -15,12 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {itSub, usingPlaygrounds} from './util/playgrounds'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; describe('Integration Test setMintPermission', () => { let alice: IKeyringPair; diff --git a/tests/src/setPublicAccessMode.test.ts b/tests/src/setPublicAccessMode.test.ts index 9a2071c28c..ed645e141e 100644 --- a/tests/src/setPublicAccessMode.test.ts +++ b/tests/src/setPublicAccessMode.test.ts @@ -16,12 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setschemaversion import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {itSub, usingPlaygrounds} from './util/playgrounds'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; describe('Integration Test setPublicAccessMode(): ', () => { let alice: IKeyringPair; diff --git a/tests/src/transfer.test.ts b/tests/src/transfer.test.ts index a38db5a16f..fd33641ca6 100644 --- a/tests/src/transfer.test.ts +++ b/tests/src/transfer.test.ts @@ -15,13 +15,8 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; import {itEth, usingEthPlaygrounds} from './eth/util/playgrounds'; -import {itSub, Pallets, usingPlaygrounds} from './util/playgrounds'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itSub, Pallets, usingPlaygrounds, expect} from './util/playgrounds'; describe('Integration Test Transfer(recipient, collection_id, item_id, value)', () => { let alice: IKeyringPair; diff --git a/tests/src/transferFrom.test.ts b/tests/src/transferFrom.test.ts index 99bc9d7abf..f569d1b912 100644 --- a/tests/src/transferFrom.test.ts +++ b/tests/src/transferFrom.test.ts @@ -15,12 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {itSub, Pallets, usingPlaygrounds} from './util/playgrounds'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itSub, Pallets, usingPlaygrounds, expect} from './util/playgrounds'; describe('Integration Test transferFrom(from, recipient, collection_id, item_id, value):', () => { let alice: IKeyringPair; diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index b0a8e4efd1..6b5c60e4f9 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -2,12 +2,17 @@ // SPDX-License-Identifier: Apache-2.0 import {IKeyringPair} from '@polkadot/types/types'; +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; import {Context} from 'mocha'; import config from '../../config'; import '../../interfaces/augment-api-events'; import {DevUniqueHelper, SilentLogger, SilentConsole} from './unique.dev'; +chai.use(chaiAsPromised); +export const expect = chai.expect; + export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { const silentConsole = new SilentConsole(); silentConsole.enable(); From 48638492add97421cf6bb88684e4f4edc34615e3 Mon Sep 17 00:00:00 2001 From: rkv Date: Fri, 9 Sep 2022 12:00:41 +0300 Subject: [PATCH 0824/1274] add removeFromAllowList in playgrounds --- tests/src/allowLists.test.ts | 61 +++----- tests/src/util/playgrounds/unique.ts | 213 +++++++++++++++------------ 2 files changed, 142 insertions(+), 132 deletions(-) diff --git a/tests/src/allowLists.test.ts b/tests/src/allowLists.test.ts index bd6d68c398..6e3bd195d3 100644 --- a/tests/src/allowLists.test.ts +++ b/tests/src/allowLists.test.ts @@ -17,7 +17,7 @@ import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import { usingPlaygrounds } from './util/playgrounds'; +import {usingPlaygrounds} from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -25,8 +25,8 @@ const expect = chai.expect; let donor: IKeyringPair; before(async () => { - await usingPlaygrounds(async (_, privateKeyWrapper) => { - donor = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (_, privateKey) => { + donor = privateKey('//Alice'); }); }); @@ -66,7 +66,7 @@ describe('Integration Test ext. Allow list tests', () => { await usingPlaygrounds(async (helper) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const addToAllowListTx = async () => helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}); - expect(addToAllowListTx()).to.be.rejected; + await expect(addToAllowListTx()).to.be.rejected; }); }); @@ -74,7 +74,7 @@ describe('Integration Test ext. Allow list tests', () => { const collectionId = (1<<32) - 1; await usingPlaygrounds(async (helper) => { const addToAllowListTx = async () => helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}); - expect(addToAllowListTx()).to.be.rejected; + await expect(addToAllowListTx()).to.be.rejected; }); }); @@ -83,7 +83,7 @@ describe('Integration Test ext. Allow list tests', () => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await helper.collection.burn(alice, collectionId); const addToAllowListTx = async () => helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - expect(addToAllowListTx()).to.be.rejected; + await expect(addToAllowListTx()).to.be.rejected; }); }); @@ -102,8 +102,7 @@ describe('Integration Test ext. Allow list tests', () => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. - await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: bob.address}).signAndSend(alice); + await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); const allowList = await helper.nft.getAllowList(collectionId); @@ -116,8 +115,7 @@ describe('Integration Test ext. Allow list tests', () => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await helper.nft.addAdmin(alice, collectionId, {Substrate: charlie.address}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. - await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: bob.address}).signAndSend(charlie); + await helper.collection.removeFromAllowList(charlie, collectionId, {Substrate: bob.address}); const allowList = await helper.nft.getAllowList(collectionId); @@ -129,9 +127,8 @@ describe('Integration Test ext. Allow list tests', () => { await usingPlaygrounds(async (helper) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); - //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. - await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: charlie.address}).signAndSend(bob); - + const removeTx = async () => helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address}); + await expect(removeTx()).to.be.rejected; const allowList = await helper.nft.getAllowList(collectionId); expect(allowList).to.be.deep.contains({Substrate: charlie.address}); @@ -141,12 +138,8 @@ describe('Integration Test ext. Allow list tests', () => { it('Nobody can remove address from allow list of non-existing collection', async () => { const collectionId = (1<<32) - 1; await usingPlaygrounds(async (helper) => { - //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. - await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: charlie.address}).signAndSend(bob); - - const allowList = await helper.nft.getAllowList(collectionId); - - expect(allowList).to.be.not.deep.contains({Substrate: charlie.address}); + const removeTx = async () => helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address}); + await expect(removeTx()).to.be.rejected; }); }); @@ -155,11 +148,9 @@ describe('Integration Test ext. Allow list tests', () => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); await helper.collection.burn(alice, collectionId); + const removeTx = async () => helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); - //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. - const removeTx = async () => helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: bob.address}).signAndSend(alice); - - expect(removeTx()).to.be.rejected; + await expect(removeTx()).to.be.rejected; }); }); @@ -167,13 +158,11 @@ describe('Integration Test ext. Allow list tests', () => { await usingPlaygrounds(async (helper) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - - //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. - await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: bob.address}).signAndSend(alice); + await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); const allowListBefore = await helper.nft.getAllowList(collectionId); expect(allowListBefore).to.be.not.deep.contains({Substrate: bob.address}); - await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: bob.address}).signAndSend(alice); + await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); const allowListAfter = await helper.nft.getAllowList(collectionId); expect(allowListAfter).to.be.not.deep.contains({Substrate: bob.address}); @@ -188,7 +177,7 @@ describe('Integration Test ext. Allow list tests', () => { await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - expect(transferResult()).to.be.rejected; + await expect(transferResult()).to.be.rejected; }); }); @@ -200,12 +189,10 @@ describe('Integration Test ext. Allow list tests', () => { await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - - //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. - await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: alice.address}).signAndSend(alice); + await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address}); const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - expect(transferResult()).to.be.rejected; + await expect(transferResult()).to.be.rejected; }); }); @@ -217,7 +204,7 @@ describe('Integration Test ext. Allow list tests', () => { await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - expect(transferResult()).to.be.rejected; + await expect(transferResult()).to.be.rejected; }); }); @@ -230,12 +217,10 @@ describe('Integration Test ext. Allow list tests', () => { await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - - //FIXME: removeFromAllowList doesn't not implemented in unique helpers yet. Change to helper later. - await helper.api?.tx.unique.removeFromAllowList(collectionId, {Substrate: alice.address}).signAndSend(alice); + await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address}); const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - expect(transferResult()).to.be.rejected; + await expect(transferResult()).to.be.rejected; }); }); @@ -245,7 +230,7 @@ describe('Integration Test ext. Allow list tests', () => { const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); const burnTx = async () => helper.nft.burnToken(bob, collectionId, tokenId); - expect(burnTx()).to.be.rejected; + await expect(burnTx()).to.be.rejected; }); }); diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 0c2aabe759..20d290b7a9 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -256,9 +256,9 @@ class ChainHelperBase { return network; } - static async createConnection(wsEndpoint: string, listeners?: IApiListeners, network?: TUniqueNetworks | null): Promise<{ - api: ApiPromise; - network: TUniqueNetworks; + static async createConnection(wsEndpoint: string, listeners?: IApiListeners, network?: TUniqueNetworks | null): Promise<{ + api: ApiPromise; + network: TUniqueNetworks; }> { if(typeof network === 'undefined' || network === null) network = 'opal'; const supportedRPC = { @@ -466,7 +466,7 @@ class CollectionGroup extends HelperGroup { /** * Get the number of created collections. - * + * * @returns number of created collections */ async getTotalCount(): Promise { @@ -475,7 +475,7 @@ class CollectionGroup extends HelperGroup { /** * Get information about the collection with additional data, including the number of tokens it contains, its administrators, the normalized address of the collection's owner, and decoded name and description. - * + * * @param collectionId ID of collection * @example await getData(2) * @returns collection information object @@ -510,7 +510,7 @@ class CollectionGroup extends HelperGroup { /** * Get the normalized addresses of the collection's administrators. - * + * * @param collectionId ID of collection * @example await getAdmins(1) * @returns array of administrators @@ -542,7 +542,7 @@ class CollectionGroup extends HelperGroup { /** * Get the effective limits of the collection instead of null for default values - * + * * @param collectionId ID of collection * @example await getEffectiveLimits(2) * @returns object of collection limits @@ -553,7 +553,7 @@ class CollectionGroup extends HelperGroup { /** * Burns the collection if the signer has sufficient permissions and collection is empty. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param label extra label for log @@ -573,7 +573,7 @@ class CollectionGroup extends HelperGroup { /** * Sets the sponsor for the collection (Requires the Substrate address). - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param sponsorAddress Sponsor substrate address @@ -594,7 +594,7 @@ class CollectionGroup extends HelperGroup { /** * Confirms consent to sponsor the collection on behalf of the signer. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param label extra label for log @@ -614,7 +614,7 @@ class CollectionGroup extends HelperGroup { /** * Sets the limits of the collection. At least one limit must be specified for a correct call. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param limits collection limits object @@ -643,7 +643,7 @@ class CollectionGroup extends HelperGroup { /** * Changes the owner of the collection to the new Substrate address. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param ownerAddress substrate address of new owner @@ -663,8 +663,8 @@ class CollectionGroup extends HelperGroup { } /** - * Adds a collection administrator. - * + * Adds a collection administrator. + * * @param signer keyring of signer * @param collectionId ID of collection * @param adminAddressObj Administrator address (substrate or ethereum) @@ -684,7 +684,7 @@ class CollectionGroup extends HelperGroup { } /** - * Adds an address to allow list + * Adds an address to allow list * @param signer keyring of signer * @param collectionId ID of collection * @param addressObj address to add to the allow list @@ -702,9 +702,30 @@ class CollectionGroup extends HelperGroup { return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'AllowListAddressAdded'); } + /** + * Removes an address from allow list. + * + * @param signer keyring of signer + * @param collectionId ID of collection + * @param addressObj address to be removed from allow list (substrate or ethereum) + * @param label extra label for log + * @example removeFromAllowList(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."}) + * @returns ```true``` if extrinsic success, otherwise ```false``` + */ + async removeFromAllowList(signer: TSigner, collectionId: number, addressObj: ICrossAccountId, label?: string): Promise { + if(typeof label === 'undefined') label = `collection #${collectionId}`; + const result = await this.helper.executeExtrinsic( + signer, + 'api.tx.unique.removeFromAllowList', [collectionId, addressObj], + true, `Unable to remove address from allow list for ${label}`, + ); + + return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'AllowListAddressRemoved', label); + } + /** * Removes a collection administrator. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param adminAddressObj Administrator address (substrate or ethereum) @@ -725,7 +746,7 @@ class CollectionGroup extends HelperGroup { /** * Sets onchain permissions for selected collection. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param permissions collection permissions object @@ -746,7 +767,7 @@ class CollectionGroup extends HelperGroup { /** * Enables nesting for selected collection. If `restricted` set, you can nest only tokens from specified collections. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param permissions nesting permissions object @@ -760,7 +781,7 @@ class CollectionGroup extends HelperGroup { /** * Disables nesting for selected collection. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param label extra label for log @@ -773,7 +794,7 @@ class CollectionGroup extends HelperGroup { /** * Sets onchain properties to the collection. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param properties array of property objects @@ -794,7 +815,7 @@ class CollectionGroup extends HelperGroup { /** * Deletes onchain properties from the collection. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param propertyKeys array of property keys to delete @@ -815,7 +836,7 @@ class CollectionGroup extends HelperGroup { /** * Changes the owner of the token. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token @@ -835,9 +856,9 @@ class CollectionGroup extends HelperGroup { } /** - * - * Change ownership of a token(s) on behalf of the owner. - * + * + * Change ownership of a token(s) on behalf of the owner. + * * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token @@ -857,13 +878,13 @@ class CollectionGroup extends HelperGroup { } /** - * + * * Destroys a concrete instance of NFT/RFT or burns a specified amount of fungible tokens. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token - * @param label + * @param label * @param amount amount of tokens to be burned. For NFT must be set to 1n * @example burnToken(aliceKeyring, 10, 5); * @returns ```true``` and burnt token number is extrinsic success. Otherwise ```false``` and ```null``` @@ -885,12 +906,12 @@ class CollectionGroup extends HelperGroup { /** * Destroys a concrete instance of NFT on behalf of the owner - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param fromAddressObj address on behalf of which the token will be burnt * @param tokenId ID of token - * @param label + * @param label * @param amount amount of tokens to be burned. For NFT must be set to 1n * @example burnTokenFrom(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."}, 5, {Ethereum: "0x9F0583DbB85..."}) * @returns ```true``` if extrinsic success, otherwise ```false``` @@ -908,19 +929,19 @@ class CollectionGroup extends HelperGroup { /** * Set, change, or remove approved address to transfer the ownership of the NFT. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token - * @param toAddressObj - * @param label + * @param toAddressObj + * @param label * @param amount amount of token to be approved. For NFT must be set to 1n * @returns ```true``` if extrinsic success, otherwise ```false``` */ async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string, amount=1n) { if(typeof label === 'undefined') label = `collection #${collectionId}`; const approveResult = await this.helper.executeExtrinsic( - signer, + signer, 'api.tx.unique.approve', [toAddressObj, collectionId, tokenId, amount], true, `Unable to approve token for ${label}`, ); @@ -932,7 +953,7 @@ class CollectionGroup extends HelperGroup { * Get the amount of token pieces approved to transfer * @param collectionId ID of collection * @param tokenId ID of token - * @param toAccountObj + * @param toAccountObj * @param fromAccountObj * @example getTokenApprovedPieces(10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, {Substrate: "5ERZNF88Mm7UGfPP3mdG..."}) * @returns number of approved to transfer pieces @@ -966,7 +987,7 @@ class CollectionGroup extends HelperGroup { class NFTnRFT extends CollectionGroup { /** * Get tokens owned by account - * + * * @param collectionId ID of collection * @param addressObj tokens owner * @example getTokensByAddress(10, {Substrate: "5DyN4Y92vZCjv38fg..."}) @@ -980,10 +1001,10 @@ class NFTnRFT extends CollectionGroup { * Get token data * @param collectionId ID of collection * @param tokenId ID of token - * @param blockHashAt + * @param blockHashAt * @param propertyKeys * @example getToken(10, 5); - * @returns human readable token data + * @returns human readable token data */ async getToken(collectionId: number, tokenId: number, blockHashAt?: string, propertyKeys?: string[]): Promise<{ properties: IProperty[]; @@ -1017,7 +1038,7 @@ class NFTnRFT extends CollectionGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param permissions permissions to change a property by the collection owner or admin - * @param label + * @param label * @example setTokenPropertyPermissions( * aliceKeyring, 10, [{key: "gender", permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}] * ) @@ -1039,8 +1060,8 @@ class NFTnRFT extends CollectionGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token - * @param properties - * @param label + * @param properties + * @param label * @example setTokenProperties(aliceKeyring, 10, 5, [{key: "gender", value: "female"}, {key: "age", value: "23"}]) * @returns ```true``` if extrinsic success, otherwise ```false``` */ @@ -1060,8 +1081,8 @@ class NFTnRFT extends CollectionGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token - * @param propertyKeys property keys to be deleted - * @param label + * @param propertyKeys property keys to be deleted + * @param label * @example deleteTokenProperties(aliceKeyring, 10, 5, ["gender", "age"]) * @returns ```true``` if extrinsic success, otherwise ```false``` */ @@ -1079,9 +1100,9 @@ class NFTnRFT extends CollectionGroup { /** * Mint new collection * @param signer keyring of signer - * @param collectionOptions basic collection options and properties + * @param collectionOptions basic collection options and properties * @param mode NFT or RFT type of a collection - * @param errorLabel + * @param errorLabel * @example mintCollection(aliceKeyring, {name: 'New', description: "New collection", tokenPrefix: "NEW"}, "NFT") * @returns object of the created collection */ @@ -1135,7 +1156,7 @@ class NFTGroup extends NFTnRFT { * Get token's owner * @param collectionId ID of collection * @param tokenId ID of token - * @param blockHashAt + * @param blockHashAt * @example getTokenOwner(10, 5); * @returns Address in CrossAccountId format, e.g. {Substrate: "5DnSF6RRjwteE3BrCj..."} */ @@ -1162,7 +1183,7 @@ class NFTGroup extends NFTnRFT { /** * Changes the owner of the token. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token @@ -1175,9 +1196,9 @@ class NFTGroup extends NFTnRFT { } /** - * - * Change ownership of a NFT on behalf of the owner. - * + * + * Change ownership of a NFT on behalf of the owner. + * * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token @@ -1194,7 +1215,7 @@ class NFTGroup extends NFTnRFT { * Recursively find the address that owns the token * @param collectionId ID of collection * @param tokenId ID of token - * @param blockHashAt + * @param blockHashAt * @example getTokenTopmostOwner(10, 5); * @returns address in CrossAccountId format, e.g. {Substrate: "5DyN4Y92vZCjv38fg..."} */ @@ -1217,9 +1238,9 @@ class NFTGroup extends NFTnRFT { * Get tokens nested in the provided token * @param collectionId ID of collection * @param tokenId ID of token - * @param blockHashAt + * @param blockHashAt * @example getTokenChildren(10, 5); - * @returns tokens whose depth of nesting is <= 5 + * @returns tokens whose depth of nesting is <= 5 */ async getTokenChildren(collectionId: number, tokenId: number, blockHashAt?: string): Promise { let children; @@ -1239,7 +1260,7 @@ class NFTGroup extends NFTnRFT { * @param signer keyring of signer * @param tokenObj token to be nested * @param rootTokenObj token to be parent - * @param label + * @param label * @example nestToken(aliceKeyring, {collectionId: 10, tokenId: 5}, {collectionId: 10, tokenId: 4}); * @returns ```true``` if extrinsic success, otherwise ```false``` */ @@ -1257,8 +1278,8 @@ class NFTGroup extends NFTnRFT { * @param signer keyring of signer * @param tokenObj token to unnest * @param rootTokenObj parent of a token - * @param toAddressObj address of a new token owner - * @param label + * @param toAddressObj address of a new token owner + * @param label * @example unnestToken(aliceKeyring, {collectionId: 10, tokenId: 5}, {collectionId: 10, tokenId: 4}, {Substrate: "5DyN4Y92vZCjv38fg..."}); * @returns ```true``` if extrinsic success, otherwise ```false``` */ @@ -1275,8 +1296,8 @@ class NFTGroup extends NFTnRFT { * Mint new collection * @param signer keyring of signer * @param collectionOptions Collection options - * @param label - * @example + * @param label + * @example * mintCollection(aliceKeyring, { * name: 'New', * description: 'New collection', @@ -1292,7 +1313,7 @@ class NFTGroup extends NFTnRFT { * Mint new token * @param signer keyring of signer * @param data token data - * @param label + * @param label * @returns created token object */ async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; properties?: IProperty[]; }, label?: string): Promise { @@ -1317,8 +1338,8 @@ class NFTGroup extends NFTnRFT { * @param signer keyring of signer * @param collectionId ID of collection * @param tokens array of tokens with owner and properties - * @param label - * @example + * @param label + * @example * mintMultipleTokens(aliceKeyring, 10, [{ * owner: {Substrate: "5DyN4Y92vZCjv38fg..."}, * properties: [{key: "gender", value: "male"},{key: "age", value: "45"}], @@ -1345,7 +1366,7 @@ class NFTGroup extends NFTnRFT { * @param collectionId ID of collection * @param owner tokens owner * @param tokens array of tokens with owner and properties - * @param label + * @param label * @example * mintMultipleTokensWithOneOwner(aliceKeyring, 10, "5DyN4Y92vZCjv38fg...", [{ * properties: [{ @@ -1379,7 +1400,7 @@ class NFTGroup extends NFTnRFT { * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token - * @param label + * @param label * @example burnToken(aliceKeyring, 10, 5); * @returns ```true``` and burnt token number is extrinsic success. Otherwise ```false``` and ```null``` */ @@ -1389,12 +1410,12 @@ class NFTGroup extends NFTnRFT { /** * Set, change, or remove approved address to transfer the ownership of the NFT. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token * @param toAddressObj address to approve - * @param label + * @param label * @example approveToken(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}) * @returns ```true``` if extrinsic success, otherwise ```false``` */ @@ -1427,7 +1448,7 @@ class RFTGroup extends NFTnRFT { } /** - * Get top 10 token owners with the largest number of pieces + * Get top 10 token owners with the largest number of pieces * @param collectionId ID of collection * @param tokenId ID of token * @example getTokenTop10Owners(10, 5); @@ -1464,7 +1485,7 @@ class RFTGroup extends NFTnRFT { } /** - * Change ownership of some pieces of RFT on behalf of the owner. + * Change ownership of some pieces of RFT on behalf of the owner. * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token @@ -1482,7 +1503,7 @@ class RFTGroup extends NFTnRFT { * Mint new collection * @param signer keyring of signer * @param collectionOptions Collection options - * @param label + * @param label * @example * mintCollection(aliceKeyring, { * name: 'New', @@ -1499,7 +1520,7 @@ class RFTGroup extends NFTnRFT { * Mint new token * @param signer keyring of signer * @param data token data - * @param label + * @param label * @example mintToken(aliceKeyring, {collectionId: 10, owner: {Substrate: '5GHoZe9c73RYbVzq...'}, pieces: 10000n}); * @returns created token object */ @@ -1539,7 +1560,7 @@ class RFTGroup extends NFTnRFT { * @param collectionId ID of collection * @param owner tokens owner * @param tokens array of tokens with properties and pieces - * @param label + * @param label * @example mintMultipleTokensWithOneOwner(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, [{pieces: 100000n, properties: [{key: "gender", value: "male"}]}]); * @returns array of newly created RFT tokens */ @@ -1564,7 +1585,7 @@ class RFTGroup extends NFTnRFT { * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token - * @param label + * @param label * @param amount number of pieces to be burnt * @example burnToken(aliceKeyring, 10, 5); * @returns ```true``` and burnt token number is extrinsic success. Otherwise ```false``` and ```null``` @@ -1575,12 +1596,12 @@ class RFTGroup extends NFTnRFT { /** * Set, change, or remove approved address to transfer the ownership of the RFT. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param tokenId ID of token * @param toAddressObj address to approve - * @param label + * @param label * @param amount number of pieces to be approved * @example approveToken(aliceKeyring, 10, 5, {Substrate: "5GHoZe9c73RYbVzq..."}, "", 10000n); * @returns true if the token success, otherwise false @@ -1606,7 +1627,7 @@ class RFTGroup extends NFTnRFT { * @param collectionId ID of collection * @param tokenId ID of token * @param amount new number of pieces - * @param label + * @param label * @example repartitionToken(aliceKeyring, 10, 5, 12345n); * @returns true if the repartion was success, otherwise false */ @@ -1639,8 +1660,8 @@ class FTGroup extends CollectionGroup { * Mint new fungible collection * @param signer keyring of signer * @param collectionOptions Collection options - * @param decimalPoints number of token decimals - * @param errorLabel + * @param decimalPoints number of token decimals + * @param errorLabel * @example * mintCollection(aliceKeyring, { * name: 'New', @@ -1670,9 +1691,9 @@ class FTGroup extends CollectionGroup { * @param collectionId ID of collection * @param owner address owner of new tokens * @param amount amount of tokens to be meanted - * @param label + * @param label * @example mintTokens(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq"}, 1000n); - * @returns ```true``` if extrinsic success, otherwise ```false``` + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async mintTokens(signer: TSigner, collectionId: number, owner: ICrossAccountId | string, amount: bigint, label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -1694,8 +1715,8 @@ class FTGroup extends CollectionGroup { * @param collectionId ID of collection * @param owner tokens owner * @param tokens array of tokens with properties and pieces - * @param label - * @returns ```true``` if extrinsic success, otherwise ```false``` + * @param label + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {value: bigint}[], label?: string): Promise { if(typeof label === 'undefined') label = `collection #${collectionId}`; @@ -1713,7 +1734,7 @@ class FTGroup extends CollectionGroup { } /** - * Get the top 10 owners with the largest balance for the Fungible collection + * Get the top 10 owners with the largest balance for the Fungible collection * @param collectionId ID of collection * @example getTop10Owners(10); * @returns array of ```ICrossAccountId``` @@ -1740,7 +1761,7 @@ class FTGroup extends CollectionGroup { * @param toAddressObj address recepient * @param amount amount of tokens to be sent * @example transfer(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n); - * @returns ```true``` if extrinsic success, otherwise ```false``` + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async transfer(signer: TSigner, collectionId: number, toAddressObj: ICrossAccountId, amount: bigint) { return await super.transferToken(signer, collectionId, 0, toAddressObj, amount); @@ -1754,7 +1775,7 @@ class FTGroup extends CollectionGroup { * @param toAddressObj address where token to be sent * @param amount number of tokens to be sent * @example transferFrom(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, {Substrate: "5DfhbVfww7ThF8q6f3ij..."}, 10000n); - * @returns ```true``` if extrinsic success, otherwise ```false``` + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async transferFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount: bigint) { return await super.transferTokenFrom(signer, collectionId, 0, fromAddressObj, toAddressObj, amount); @@ -1765,9 +1786,9 @@ class FTGroup extends CollectionGroup { * @param signer keyring of signer * @param collectionId ID of collection * @param amount amount of tokens to be destroyed - * @param label + * @param label * @example burnTokens(aliceKeyring, 10, 1000n); - * @returns ```true``` if extrinsic success, otherwise ```false``` + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async burnTokens(signer: IKeyringPair, collectionId: number, amount=100n, label?: string): Promise { return (await super.burnToken(signer, collectionId, 0, label, amount)).success; @@ -1779,9 +1800,9 @@ class FTGroup extends CollectionGroup { * @param collectionId ID of collection * @param fromAddressObj address on behalf of which tokens will be burnt * @param amount amount of tokens to be burnt - * @param label + * @param label * @example burnTokensFrom(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n); - * @returns ```true``` if extrinsic success, otherwise ```false``` + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async burnTokensFrom(signer: IKeyringPair, collectionId: number, fromAddressObj: ICrossAccountId, amount=100n, label?: string): Promise { return await super.burnTokenFrom(signer, collectionId, fromAddressObj, 0, label, amount); @@ -1789,8 +1810,8 @@ class FTGroup extends CollectionGroup { /** * Get total collection supply - * @param collectionId - * @returns + * @param collectionId + * @returns */ async getTotalPieces(collectionId: number): Promise { return (await this.helper.callRpc('api.rpc.unique.totalPieces', [collectionId, 0])).unwrap().toBigInt(); @@ -1798,14 +1819,14 @@ class FTGroup extends CollectionGroup { /** * Set, change, or remove approved address to transfer tokens. - * + * * @param signer keyring of signer * @param collectionId ID of collection * @param toAddressObj address to be approved * @param amount amount of tokens to be approved - * @param label + * @param label * @example approveTokens(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, 1000n) - * @returns ```true``` if extrinsic success, otherwise ```false``` + * @returns ```true``` if extrinsic success, otherwise ```false``` */ async approveTokens(signer: IKeyringPair, collectionId: number, toAddressObj: ICrossAccountId, amount=100n, label?: string) { return super.approveToken(signer, collectionId, 0, toAddressObj, label, amount); @@ -1998,7 +2019,7 @@ export class UniqueHelper extends ChainHelperBase { this.nft = new NFTGroup(this); this.rft = new RFTGroup(this); this.ft = new FTGroup(this); - } + } } @@ -2059,6 +2080,10 @@ class UniqueCollectionBase { return await this.helper.collection.addToAllowList(signer, this.collectionId, addressObj, label); } + async removeFromAllowList(signer: TSigner, addressObj: ICrossAccountId, label?: string) { + return await this.helper.collection.removeFromAllowList(signer, this.collectionId, addressObj, label); + } + async removeAdmin(signer: TSigner, adminAddressObj: ICrossAccountId, label?: string) { return await this.helper.collection.removeAdmin(signer, this.collectionId, adminAddressObj, label); } @@ -2403,4 +2428,4 @@ class UniqueRFTToken extends UniqueTokenBase { async burn(signer: TSigner, amount=100n, label?: string) { return await this.collection.burnToken(signer, this.tokenId, amount, label); } -} \ No newline at end of file +} From 2c4a2768a281b314345bba4a32a3adb1576bd618 Mon Sep 17 00:00:00 2001 From: rkv Date: Fri, 9 Sep 2022 12:11:35 +0300 Subject: [PATCH 0825/1274] add amount to approveToken in unique playgrounds --- tests/src/approve.test.ts | 25 +++++++------------------ tests/src/util/playgrounds/unique.ts | 4 ++-- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/tests/src/approve.test.ts b/tests/src/approve.test.ts index e95e84f65d..1c012f7058 100644 --- a/tests/src/approve.test.ts +++ b/tests/src/approve.test.ts @@ -15,33 +15,21 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {ApiPromise} from '@polkadot/api'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi} from './substrate/substrate-api'; import { approveExpectFail, approveExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess, - destroyCollectionExpectSuccess, - setCollectionLimitsExpectSuccess, - transferExpectSuccess, - addCollectionAdminExpectSuccess, - adminApproveFromExpectFail, - getCreatedCollectionCount, - transferFromExpectSuccess, - transferFromExpectFail, - requirePallets, - Pallets, } from './util/helpers'; -import { usingPlaygrounds } from './util/playgrounds'; +import {usingPlaygrounds} from './util/playgrounds'; let donor: IKeyringPair; before(async () => { - await usingPlaygrounds(async (_, privateKeyWrapper) => { - donor = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (_, privateKey) => { + donor = privateKey('//Alice'); }); }); @@ -95,7 +83,7 @@ describe('Integration Test approve(spender, collection_id, item_id, amount):', ( const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true; - await helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0).signAndSend(alice); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 0n); expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.false; }); }); @@ -333,7 +321,7 @@ describe('User may clear the approvals to approving for 0 amount:', () => { const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true; - await helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0).signAndSend(alice); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, undefined, 0n); expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.false; const transferTokenFromTx = async () => helper.nft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: bob.address}, {Substrate: bob.address}); await expect(transferTokenFromTx()).to.be.rejected; @@ -391,7 +379,8 @@ describe('User cannot approve for the amount greater than they own:', () => { await usingPlaygrounds(async (helper) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); - await helper.api?.tx.unique.approve({Substrate: charlie.address}, collectionId, tokenId, 2).signAndSend(bob); + const approveTx = async () => helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}, undefined, 2n); + await expect(approveTx()).to.be.rejected; expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: charlie.address})).to.be.false; }); }); diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 20d290b7a9..21208f790c 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -1419,8 +1419,8 @@ class NFTGroup extends NFTnRFT { * @example approveToken(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}) * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string) { - return super.approveToken(signer, collectionId, tokenId, toAddressObj, label, 1n); + async approveToken(signer: IKeyringPair, collectionId: number, tokenId: number, toAddressObj: ICrossAccountId, label?: string, amount=1n) { + return super.approveToken(signer, collectionId, tokenId, toAddressObj, label, amount); } } From 16ab55f38ef521f27f706fc66f58db76ea59cbed Mon Sep 17 00:00:00 2001 From: rkv Date: Fri, 9 Sep 2022 12:11:56 +0300 Subject: [PATCH 0826/1274] eslint fixes --- tests/src/adminTransferAndBurn.test.ts | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/tests/src/adminTransferAndBurn.test.ts b/tests/src/adminTransferAndBurn.test.ts index 3dee38f6bc..9f8be3cafb 100644 --- a/tests/src/adminTransferAndBurn.test.ts +++ b/tests/src/adminTransferAndBurn.test.ts @@ -17,17 +17,7 @@ import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi} from './substrate/substrate-api'; -import { - createCollectionExpectSuccess, - createItemExpectSuccess, - transferExpectFailure, - transferFromExpectSuccess, - burnItemExpectFailure, - burnFromExpectSuccess, - setCollectionLimitsExpectSuccess, -} from './util/helpers'; -import { usingPlaygrounds } from './util/playgrounds'; +import {usingPlaygrounds} from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -35,8 +25,8 @@ const expect = chai.expect; let donor: IKeyringPair; before(async () => { - await usingPlaygrounds(async (_, privateKeyWrapper) => { - donor = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (_, privateKey) => { + donor = privateKey('//Alice'); }); }); @@ -54,7 +44,7 @@ describe('Integration Test: ownerCanTransfer allows admins to use only transferF it('admin transfers other user\'s token', async () => { await usingPlaygrounds(async (helper) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); - const setLimitsResult = await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); + await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); const limits = await helper.collection.getEffectiveLimits(collectionId); expect(limits.ownerCanTransfer).to.be.true; @@ -62,7 +52,7 @@ describe('Integration Test: ownerCanTransfer allows admins to use only transferF const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); await expect(transferResult()).to.be.rejected; - const res = await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: bob.address}, {Substrate: charlie.address}); + await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: bob.address}, {Substrate: charlie.address}); const newTokenOwner = await helper.nft.getTokenOwner(collectionId, tokenId); expect(newTokenOwner.Substrate).to.be.equal(charlie.address); }); @@ -72,7 +62,7 @@ describe('Integration Test: ownerCanTransfer allows admins to use only transferF await usingPlaygrounds(async (helper) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); - const setLimitsResult = await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); + await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); const limits = await helper.collection.getEffectiveLimits(collectionId); expect(limits.ownerCanTransfer).to.be.true; @@ -81,7 +71,7 @@ describe('Integration Test: ownerCanTransfer allows admins to use only transferF await expect(burnTxFailed()).to.be.rejected; - const burnResult = await helper.nft.burnToken(bob, collectionId, tokenId); + await helper.nft.burnToken(bob, collectionId, tokenId); const token = await helper.nft.getToken(collectionId, tokenId); expect(token).to.be.null; }); From 837dcd6dcc35340775809e446abaa9d5abb40291 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 9 Sep 2022 12:59:24 +0300 Subject: [PATCH 0827/1274] add timeout for debug and cat .env file --- .github/workflows/market-test_v2.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index 98998c404c..2401536d44 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -137,10 +137,10 @@ jobs: working-directory: qa-tests run: cat .env - - name: Read qa -test .env file Before market start - uses: xom9ikk/dotenv@v1.0.2 - with: - path: qa-tests/ +# - name: Read qa -test .env file Before market start +# uses: xom9ikk/dotenv@v1.0.2 +# with: +# path: qa-tests/ - name: local-market:start @@ -158,12 +158,19 @@ jobs: npm install -D @playwright/test npx playwright install-deps npx playwright install + + - name: Show content of qa-test .env + working-directory: qa-tests + run: cat .env - name: working-directory: qa-tests run: | npx playwright test --workers=8 --quiet .*.api.test.ts --reporter=github --config playwright.config.ts + - name: Timeout for debug + if: failure() + run: sleep 900s - name: Stop running containers if: always() # run this step always From a041946b9df391d7972ae0c681925fff3a0db877 Mon Sep 17 00:00:00 2001 From: rkv Date: Fri, 9 Sep 2022 13:07:15 +0300 Subject: [PATCH 0828/1274] approve fixes --- tests/src/approve.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/src/approve.test.ts b/tests/src/approve.test.ts index 59112fb987..65a31935ad 100644 --- a/tests/src/approve.test.ts +++ b/tests/src/approve.test.ts @@ -73,7 +73,7 @@ describe('Integration Test approve(spender, collection_id, item_id, amount):', ( const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); const amount = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - expect(amount).to.be.equal(BigInt(100)); + expect(amount).to.be.equal(BigInt(1)); }); }); @@ -110,7 +110,7 @@ describe('Integration Test approve(spender, collection_id, item_id, amount):', ( const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); const amountBefore = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - expect(amountBefore).to.be.equal(BigInt(100)); + expect(amountBefore).to.be.equal(BigInt(1)); await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 0n); const amountAfter = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); @@ -163,9 +163,9 @@ describe('Normal user can approve other users to transfer:', () => { await usingPlaygrounds(async (helper) => { const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: bob.address, pieces: 100n}); - await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}, 100n); const amount = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: charlie.address}, {Substrate: bob.address}); - expect(amount).to.be.equal(BigInt(100)); + expect(amount).to.be.equal(BigInt(100n)); }); }); }); @@ -353,7 +353,7 @@ describe('User may clear the approvals to approving for 0 amount:', () => { const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); const amountBefore = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - expect(amountBefore).to.be.equal(BigInt(100)); + expect(amountBefore).to.be.equal(BigInt(1)); await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 0n); const amountAfter = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); From 496350ebeb73153e560d22741d34def3a422f67a Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 9 Sep 2022 13:29:52 +0300 Subject: [PATCH 0829/1274] enable read of .env file before market up --- .github/workflows/market-test_v2.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index 2401536d44..5c65effdc1 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -137,10 +137,10 @@ jobs: working-directory: qa-tests run: cat .env -# - name: Read qa -test .env file Before market start -# uses: xom9ikk/dotenv@v1.0.2 -# with: -# path: qa-tests/ + - name: Read qa -test .env file Before market start + uses: xom9ikk/dotenv@v1.0.2 + with: + path: qa-tests/ - name: local-market:start From 5401624d5b2282b335be66f38533933c87c1f63f Mon Sep 17 00:00:00 2001 From: rkv Date: Fri, 9 Sep 2022 13:53:58 +0300 Subject: [PATCH 0830/1274] change signAndSend to signTransaction --- tests/src/approve.test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/src/approve.test.ts b/tests/src/approve.test.ts index 65a31935ad..59be3a3d31 100644 --- a/tests/src/approve.test.ts +++ b/tests/src/approve.test.ts @@ -84,7 +84,7 @@ describe('Integration Test approve(spender, collection_id, item_id, amount):', ( const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true; - await helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0).signAndSend(alice); + await helper.signTransaction(alice, helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0)); expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.false; }); }); @@ -262,7 +262,7 @@ describe('Approved users cannot use transferFrom to repeat transfers if approved await usingPlaygrounds(async (helper) => { const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: bob.address, pieces: 100n}); - await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}, 100n); const before = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); await helper.rft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 100n); const after = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); @@ -322,7 +322,7 @@ describe('User may clear the approvals to approving for 0 amount:', () => { const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true; - await helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0).signAndSend(alice); + await helper.signTransaction(alice, helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0)); expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.false; const transferTokenFromTx = async () => helper.nft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: bob.address}, {Substrate: bob.address}); await expect(transferTokenFromTx()).to.be.rejected; @@ -380,7 +380,8 @@ describe('User cannot approve for the amount greater than they own:', () => { await usingPlaygrounds(async (helper) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); - await helper.api?.tx.unique.approve({Substrate: charlie.address}, collectionId, tokenId, 2).signAndSend(bob); + const approveTx = async () => helper.signTransaction(bob, helper.api?.tx.unique.approve({Substrate: charlie.address}, collectionId, tokenId, 2)); + await expect(approveTx()).to.be.rejected; expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: charlie.address})).to.be.false; }); }); From d7a8c2c451e8048bbf411a3e5ee04517645a9363 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 9 Sep 2022 14:14:49 +0300 Subject: [PATCH 0831/1274] enable cleanup --- .github/workflows/market-test_v2.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index 5c65effdc1..5d0aa4a201 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -174,18 +174,18 @@ jobs: - name: Stop running containers if: always() # run this step always -# run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes - run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down - -# - name: Remove builder cache -# if: always() # run this step always -# run: | -# docker builder prune -f -# docker system prune -f - -# - name: Clean Workspace -# if: always() -# uses: AutoModality/action-clean@v1.1.0 + run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes +# run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f + docker system prune -f + + - name: Clean Workspace + if: always() + uses: AutoModality/action-clean@v1.1.0 From ad65cb1c7785320ac1d820ad19be2e286dfa4188 Mon Sep 17 00:00:00 2001 From: rkv Date: Fri, 9 Sep 2022 16:28:20 +0300 Subject: [PATCH 0832/1274] change-collection-owner migrated --- tests/src/change-collection-owner.test.ts | 279 +++++++++------------- 1 file changed, 115 insertions(+), 164 deletions(-) diff --git a/tests/src/change-collection-owner.test.ts b/tests/src/change-collection-owner.test.ts index 92f4ad2872..71ff3d4e19 100644 --- a/tests/src/change-collection-owner.test.ts +++ b/tests/src/change-collection-owner.test.ts @@ -14,231 +14,182 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api'; -import {createCollectionExpectSuccess, - addCollectionAdminExpectSuccess, - setCollectionSponsorExpectSuccess, - confirmSponsorshipExpectSuccess, - removeCollectionSponsorExpectSuccess, - enableAllowListExpectSuccess, - setMintPermissionExpectSuccess, - destroyCollectionExpectSuccess, - setCollectionSponsorExpectFailure, - confirmSponsorshipExpectFailure, - removeCollectionSponsorExpectFailure, - enableAllowListExpectFail, - setMintPermissionExpectFailure, - destroyCollectionExpectFailure, - setPublicAccessModeExpectSuccess, - queryCollectionExpectSuccess, -} from './util/helpers'; +import {usingPlaygrounds} from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; -describe('Integration Test changeCollectionOwner(collection_id, new_owner):', () => { - it('Changing owner changes owner address', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess(); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); +let donor: IKeyringPair; + +before(async () => { + await usingPlaygrounds(async (_, privateKey) => { + donor = privateKey('//Alice'); + }); +}); - const collection =await queryCollectionExpectSuccess(api, collectionId); - expect(collection.owner.toString()).to.be.deep.eq(alice.address); +describe('Integration Test changeCollectionOwner(collection_id, new_owner):', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; - const changeOwnerTx = api.tx.unique.changeCollectionOwner(collectionId, bob.address); - await submitTransactionAsync(alice, changeOwnerTx); + before(async () => { + await usingPlaygrounds(async (helper) => { + [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); + }); + }); - const collectionAfterOwnerChange = await queryCollectionExpectSuccess(api, collectionId); - expect(collectionAfterOwnerChange.owner.toString()).to.be.deep.eq(bob.address); + it('Changing owner changes owner address', async () => { + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const beforeChanging = await helper.collection.getData(collection.collectionId); + expect(beforeChanging?.normalizedOwner).to.be.equal(alice.address); + + await collection.changeOwner(alice, bob.address); + const afterChanging = await helper.collection.getData(collection.collectionId); + expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); }); }); }); describe('Integration Test changeCollectionOwner(collection_id, new_owner) special checks for exOwner:', () => { - it('Changing the owner of the collection is not allowed for the former owner', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess(); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; - const collection = await queryCollectionExpectSuccess(api, collectionId); - expect(collection.owner.toString()).to.be.deep.eq(alice.address); + before(async () => { + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); + }); + }); - const changeOwnerTx = api.tx.unique.changeCollectionOwner(collectionId, bob.address); - await submitTransactionAsync(alice, changeOwnerTx); + it('Changing the owner of the collection is not allowed for the former owner', async () => { + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + + await collection.changeOwner(alice, bob.address); - const badChangeOwnerTx = api.tx.unique.changeCollectionOwner(collectionId, alice.address); - await expect(submitTransactionExpectFailAsync(alice, badChangeOwnerTx)).to.be.rejected; + const changeOwnerTx = async () => collection.changeOwner(alice, alice.address); + await expect(changeOwnerTx()).to.be.rejected; - const collectionAfterOwnerChange = await queryCollectionExpectSuccess(api, collectionId); - expect(collectionAfterOwnerChange.owner.toString()).to.be.deep.eq(bob.address); + const afterChanging = await helper.collection.getData(collection.collectionId); + expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); }); }); it('New collectionOwner has access to sponsorship management operations in the collection', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess(); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - - const collection = await queryCollectionExpectSuccess(api, collectionId); - expect(collection.owner.toString()).to.be.deep.eq(alice.address); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.changeOwner(alice, bob.address); - const changeOwnerTx = api.tx.unique.changeCollectionOwner(collectionId, bob.address); - await submitTransactionAsync(alice, changeOwnerTx); + const afterChanging = await helper.collection.getData(collection.collectionId); + expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); - const collectionAfterOwnerChange = await queryCollectionExpectSuccess(api, collectionId); - expect(collectionAfterOwnerChange.owner.toString()).to.be.deep.eq(bob.address); - - // After changing the owner of the collection, all privileged methods are available to the new owner - // The new owner of the collection has access to sponsorship management operations in the collection - await setCollectionSponsorExpectSuccess(collectionId, charlie.address, '//Bob'); - await confirmSponsorshipExpectSuccess(collectionId, '//Charlie'); - await removeCollectionSponsorExpectSuccess(collectionId, '//Bob'); - - // The new owner of the collection has access to operations for managing the collection parameters - const collectionLimits = { + await collection.setSponsor(bob, charlie.address); + await collection.confirmSponsorship(charlie); + await collection.removeSponsor(bob); + const limits = { accountTokenOwnershipLimit: 1, - sponsoredMintSize: 1, tokenLimit: 1, sponsorTransferTimeout: 1, - ownerCanTransfer: true, ownerCanDestroy: true, + ownerCanTransfer: true, }; - const tx1 = api.tx.unique.setCollectionLimits( - collectionId, - collectionLimits, - ); - await submitTransactionAsync(bob, tx1); - - await setPublicAccessModeExpectSuccess(bob, collectionId, 'AllowList'); - await enableAllowListExpectSuccess(bob, collectionId); - await setMintPermissionExpectSuccess(bob, collectionId, true); - await destroyCollectionExpectSuccess(collectionId, '//Bob'); - }); - }); - - it('New collectionOwner has access to changeCollectionOwner', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess(); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - const collection = await queryCollectionExpectSuccess(api, collectionId); - expect(collection.owner.toString()).to.be.deep.eq(alice.address); + await collection.setLimits(bob, limits); + const gotLimits = await collection.getEffectiveLimits(); + expect(gotLimits).to.be.deep.contains(limits); - const changeOwnerTx = api.tx.unique.changeCollectionOwner(collectionId, bob.address); - await submitTransactionAsync(alice, changeOwnerTx); + await collection.setPermissions(bob, {access: 'AllowList', mintMode: true}); - const collectionAfterOwnerChange = await queryCollectionExpectSuccess(api, collectionId); - expect(collectionAfterOwnerChange.owner.toString()).to.be.deep.eq(bob.address); - - const changeOwnerTx2 = api.tx.unique.changeCollectionOwner(collectionId, charlie.address); - await submitTransactionAsync(bob, changeOwnerTx2); + await collection.burn(bob); + const collectionData = await helper.collection.getData(collection.collectionId); + expect(collectionData).to.be.null; + }); + }); - // ownership lost - const collectionAfterOwnerChange2 = await queryCollectionExpectSuccess(api, collectionId); - expect(collectionAfterOwnerChange2.owner.toString()).to.be.deep.eq(charlie.address); + it('New collectionOwner has access to changeCollectionOwner', async () => { + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.changeOwner(alice, bob.address); + await collection.changeOwner(bob, charlie.address); + const collectionData = await collection.getData(); + expect(collectionData?.normalizedOwner).to.be.equal(charlie.address); }); }); }); describe('Negative Integration Test changeCollectionOwner(collection_id, new_owner):', () => { - it('Not owner can\'t change owner.', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess(); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - - const changeOwnerTx = api.tx.unique.changeCollectionOwner(collectionId, bob.address); - await expect(submitTransactionExpectFailAsync(bob, changeOwnerTx)).to.be.rejected; + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; - const collectionAfterOwnerChange = await queryCollectionExpectSuccess(api, collectionId); - expect(collectionAfterOwnerChange.owner.toString()).to.be.deep.eq(alice.address); + before(async () => { + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); + }); + }); - // Verifying that nothing bad happened (network is live, new collections can be created, etc.) - await createCollectionExpectSuccess(); + it('Not owner can\'t change owner.', async () => { + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const changeOwnerTx = async () => collection.changeOwner(bob, bob.address); + await expect(changeOwnerTx()).to.be.rejected; }); }); it('Collection admin can\'t change owner.', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess(); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - - const changeOwnerTx = api.tx.unique.changeCollectionOwner(collectionId, bob.address); - await expect(submitTransactionExpectFailAsync(bob, changeOwnerTx)).to.be.rejected; - - const collectionAfterOwnerChange = await queryCollectionExpectSuccess(api, collectionId); - expect(collectionAfterOwnerChange.owner.toString()).to.be.deep.eq(alice.address); - - // Verifying that nothing bad happened (network is live, new collections can be created, etc.) - await createCollectionExpectSuccess(); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.addAdmin(alice, {Substrate: bob.address}); + const changeOwnerTx = async () => collection.changeOwner(bob, bob.address); + await expect(changeOwnerTx()).to.be.rejected; }); }); it('Can\'t change owner of a non-existing collection.', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = (1<<32) - 1; - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - - const changeOwnerTx = api.tx.unique.changeCollectionOwner(collectionId, bob.address); - await expect(submitTransactionExpectFailAsync(alice, changeOwnerTx)).to.be.rejected; - - // Verifying that nothing bad happened (network is live, new collections can be created, etc.) - await createCollectionExpectSuccess(); + await usingPlaygrounds(async (helper) => { + const collectionId = (1 << 32) - 1; + const changeOwnerTx = async () => helper.collection.changeOwner(bob, collectionId, bob.address); + await expect(changeOwnerTx()).to.be.rejected; }); }); it('Former collectionOwner not allowed to sponsorship management operations in the collection', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess(); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - - const collection = await queryCollectionExpectSuccess(api, collectionId); - expect(collection.owner.toString()).to.be.deep.eq(alice.address); - - const changeOwnerTx = api.tx.unique.changeCollectionOwner(collectionId, bob.address); - await submitTransactionAsync(alice, changeOwnerTx); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.changeOwner(alice, bob.address); - const badChangeOwnerTx = api.tx.unique.changeCollectionOwner(collectionId, alice.address); - await expect(submitTransactionExpectFailAsync(alice, badChangeOwnerTx)).to.be.rejected; + const changeOwnerTx = async () => collection.changeOwner(alice, alice.address); + await expect(changeOwnerTx()).to.be.rejected; - const collectionAfterOwnerChange = await queryCollectionExpectSuccess(api, collectionId); - expect(collectionAfterOwnerChange.owner.toString()).to.be.deep.eq(bob.address); + const afterChanging = await helper.collection.getData(collection.collectionId); + expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); - await setCollectionSponsorExpectFailure(collectionId, charlie.address, '//Alice'); - await confirmSponsorshipExpectFailure(collectionId, '//Alice'); - await removeCollectionSponsorExpectFailure(collectionId, '//Alice'); + const setSponsorTx = async () => collection.setSponsor(alice, charlie.address); + const confirmSponsorshipTx = async () => collection.confirmSponsorship(alice); + const removeSponsorTx = async () => collection.removeSponsor(alice); + await expect(setSponsorTx()).to.be.rejected; + await expect(confirmSponsorshipTx()).to.be.rejected; + await expect(removeSponsorTx()).to.be.rejected; - const collectionLimits = { + const limits = { accountTokenOwnershipLimit: 1, - sponsoredMintSize: 1, tokenLimit: 1, sponsorTransferTimeout: 1, - ownerCanTransfer: true, ownerCanDestroy: true, + ownerCanTransfer: true, }; - const tx1 = api.tx.unique.setCollectionLimits( - collectionId, - collectionLimits, - ); - await expect(submitTransactionExpectFailAsync(alice, tx1)).to.be.rejected; - - await enableAllowListExpectFail(alice, collectionId); - await setMintPermissionExpectFailure(alice, collectionId, true); - await destroyCollectionExpectFailure(collectionId, '//Alice'); + + const setLimitsTx = async () => collection.setLimits(alice, limits); + await expect(setLimitsTx()).to.be.rejected; + + const setPermissionTx = async () => collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await expect(setPermissionTx()).to.be.rejected; + + const burnTx = async () => collection.burn(alice); + await expect(burnTx()).to.be.rejected; }); }); }); From b1fdfb5da5b75bef6a445c80e683867488d05522 Mon Sep 17 00:00:00 2001 From: rkv Date: Fri, 9 Sep 2022 17:34:46 +0300 Subject: [PATCH 0833/1274] WIP: migrating confirmSponsorship --- tests/package.json | 1 + tests/src/confirmSponsorship.test.ts | 344 +++++++++------------------ 2 files changed, 114 insertions(+), 231 deletions(-) diff --git a/tests/package.json b/tests/package.json index d7212e40f2..a144dc6611 100644 --- a/tests/package.json +++ b/tests/package.json @@ -44,6 +44,7 @@ "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts", "testSetSchemaVersion": "mocha --timeout 9999999 -r ts-node/register ./**/setSchemaVersion.test.ts", "testSetCollectionLimits": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionLimits.test.ts", + "testChangeCollectionOwner": "mocha --timeout 9999999 -r ts-node/register ./**/change-collection-owner.test.ts", "testSetCollectionSponsor": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionSponsor.test.ts", "testConfirmSponsorship": "mocha --timeout 9999999 -r ts-node/register ./**/confirmSponsorship.test.ts", "testRemoveCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionAdmin.test.ts", diff --git a/tests/src/confirmSponsorship.test.ts b/tests/src/confirmSponsorship.test.ts index 65e666d2de..8b51199bd1 100644 --- a/tests/src/confirmSponsorship.test.ts +++ b/tests/src/confirmSponsorship.test.ts @@ -37,10 +37,19 @@ import { Pallets, } from './util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; +import {usingPlaygrounds} from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; +let donor: IKeyringPair; + +before(async () => { + await usingPlaygrounds(async (_, privateKey) => { + donor = privateKey('//Alice'); + }); +}); + let alice: IKeyringPair; let bob: IKeyringPair; let charlie: IKeyringPair; @@ -48,289 +57,162 @@ let charlie: IKeyringPair; describe('integration test: ext. confirmSponsorship():', () => { before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 0n], donor); }); }); it('Confirm collection sponsorship', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + }); }); + it('Add sponsor to a collection after the same sponsor was already added and confirmed', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + await collection.setSponsor(alice, bob.address); + }); }); it('Add new sponsor to a collection after another sponsor was already added and confirmed', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); - await setCollectionSponsorExpectSuccess(collectionId, charlie.address); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(charlie); + }); }); it('NFT: Transfer fees are paid by the sponsor after confirmation', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); - - await usingApi(async (api, privateKeyWrapper) => { - const sponsorBalanceBefore = (await api.query.system.account(bob.address)).data.free.toBigInt(); - - // Find unused address - const zeroBalance = await findUnusedAddress(api, privateKeyWrapper); - - // Mint token for unused address - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', zeroBalance.address); - - // Transfer this tokens from unused address to Alice - const zeroToAlice = api.tx.unique.transfer(normalizeAccountId(zeroBalance.address), collectionId, itemId, 0); - const events = await submitTransactionAsync(zeroBalance, zeroToAlice); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - const sponsorBalanceAfter = (await api.query.system.account(bob.address)).data.free.toBigInt(); - - expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); + const token = await collection.mintToken(alice, {Substrate: charlie.address}); + await token.transfer(charlie, {Substrate: alice.address}); + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); + expect(bobBalanceAfter < bobBalanceBefore).to.be.true; }); - }); it('Fungible: Transfer fees are paid by the sponsor after confirmation', async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); - - await usingApi(async (api, privateKeyWrapper) => { - const sponsorBalanceBefore = (await api.query.system.account(bob.address)).data.free.toBigInt(); - - // Find unused address - const zeroBalance = await findUnusedAddress(api, privateKeyWrapper); - - // Mint token for unused address - const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', zeroBalance.address); - - // Transfer this tokens from unused address to Alice - const zeroToAlice = api.tx.unique.transfer(normalizeAccountId(zeroBalance.address), collectionId, itemId, 1); - const events1 = await submitTransactionAsync(zeroBalance, zeroToAlice); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; - - const sponsorBalanceAfter = (await api.query.system.account(bob.address)).data.free.toBigInt(); - - expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; + await usingPlaygrounds(async (helper) => { + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); + await collection.mint(alice, {Substrate: charlie.address}, 100n); + await collection.transfer(charlie, {Substrate: alice.address}, 1n); + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); + expect(bobBalanceAfter < bobBalanceBefore).to.be.true; }); }); it('ReFungible: Transfer fees are paid by the sponsor after confirmation', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); - - await usingApi(async (api, privateKeyWrapper) => { - const sponsorBalanceBefore = (await api.query.system.account(bob.address)).data.free.toBigInt(); - - // Find unused address - const zeroBalance = await findUnusedAddress(api, privateKeyWrapper); - - // Mint token for unused address - const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', zeroBalance.address); - - // Transfer this tokens from unused address to Alice - const zeroToAlice = api.tx.unique.transfer(normalizeAccountId(zeroBalance.address), collectionId, itemId, 1); - const events1 = await submitTransactionAsync(zeroBalance, zeroToAlice); - const result1 = getGenericResult(events1); - - const sponsorBalanceAfter = (await api.query.system.account(bob.address)).data.free.toBigInt(); - - expect(result1.success).to.be.true; - expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; + await usingPlaygrounds(async (helper) => { + const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); + const token = await collection.mintToken(alice, {Substrate: charlie.address}, 100n); + await token.transfer(charlie, {Substrate: alice.address}, 1n); + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); + expect(bobBalanceAfter < bobBalanceBefore).to.be.true; }); }); it('CreateItem fees are paid by the sponsor after confirmation', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); - - // Enable collection allow list - await enableAllowListExpectSuccess(alice, collectionId); - - // Enable public minting - await enablePublicMintingExpectSuccess(alice, collectionId); - - // Create Item - await usingApi(async (api, privateKeyWrapper) => { - const sponsorBalanceBefore = (await api.query.system.account(bob.address)).data.free.toBigInt(); - - // Find unused address - const zeroBalance = await findUnusedAddress(api, privateKeyWrapper); - - // Add zeroBalance address to allow list - await addToAllowListExpectSuccess(alice, collectionId, zeroBalance.address); - - // Mint token using unused address as signer - await createItemExpectSuccess(zeroBalance, collectionId, 'NFT', zeroBalance.address); - - const sponsorBalanceAfter = (await api.query.system.account(bob.address)).data.free.toBigInt(); - - expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await collection.addToAllowList(alice, {Substrate: charlie.address}); + + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); + await collection.mintToken(charlie, {Substrate: charlie.address}); + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); + + expect(bobBalanceAfter < bobBalanceBefore).to.be.true; }); }); it('NFT: Sponsoring of transfers is rate limited', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); - - await usingApi(async (api, privateKeyWrapper) => { - // Find unused address - const zeroBalance = await findUnusedAddress(api, privateKeyWrapper); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); - // Mint token for alice - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address); + const token = await collection.mintToken(alice, {Substrate: alice.address}); + await token.transfer(alice, {Substrate: charlie.address}); + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - // Transfer this token from Alice to unused address and back - // Alice to Zero gets sponsored - const aliceToZero = api.tx.unique.transfer(normalizeAccountId(zeroBalance.address), collectionId, itemId, 0); - const events1 = await submitTransactionAsync(alice, aliceToZero); - const result1 = getGenericResult(events1); + const transferTx = async () => token.transfer(charlie, {Substrate: alice.address}); + await expect(transferTx()).to.be.rejectedWith('Inability to pay some fees'); + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); - // Second transfer should fail - const sponsorBalanceBefore = (await api.query.system.account(bob.address)).data.free.toBigInt(); - const zeroToAlice = api.tx.unique.transfer(normalizeAccountId(alice.address), collectionId, itemId, 0); - const badTransaction = async function () { - await submitTransactionExpectFailAsync(zeroBalance, zeroToAlice); - }; - await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees'); - const sponsorBalanceAfter = (await api.query.system.account(bob.address)).data.free.toBigInt(); - - // Try again after Zero gets some balance - now it should succeed - const balancetx = api.tx.balances.transfer(zeroBalance.address, 1n * UNIQUE); - await submitTransactionAsync(alice, balancetx); - const events2 = await submitTransactionAsync(zeroBalance, zeroToAlice); - const result2 = getGenericResult(events2); - - expect(result1.success).to.be.true; - expect(result2.success).to.be.true; - expect(sponsorBalanceAfter).to.be.equal(sponsorBalanceBefore); + expect(bobBalanceAfter === bobBalanceBefore).to.be.true; }); }); it('Fungible: Sponsoring is rate limited', async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); - - await usingApi(async (api, privateKeyWrapper) => { - // Find unused address - const zeroBalance = await findUnusedAddress(api, privateKeyWrapper); - - // Mint token for unused address - const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', zeroBalance.address); + await usingPlaygrounds(async (helper) => { + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); - // Transfer this tokens in parts from unused address to Alice - const zeroToAlice = api.tx.unique.transfer(normalizeAccountId(zeroBalance.address), collectionId, itemId, 1); - const events1 = await submitTransactionAsync(zeroBalance, zeroToAlice); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; + await collection.mint(alice, {Substrate: charlie.address}, 100n); + await collection.transfer(charlie, {Substrate: charlie.address}, 1n); + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - const sponsorBalanceBefore = (await api.query.system.account(bob.address)).data.free.toBigInt(); - await expect(submitTransactionExpectFailAsync(zeroBalance, zeroToAlice)).to.be.rejected; - const sponsorBalanceAfter = (await api.query.system.account(bob.address)).data.free.toBigInt(); + const transferTx = async () => collection.transfer(charlie, {Substrate: charlie.address}); + await expect(transferTx()).to.be.rejected; + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); - // Try again after Zero gets some balance - now it should succeed - const balancetx = api.tx.balances.transfer(zeroBalance.address, 1n * UNIQUE); - await submitTransactionAsync(alice, balancetx); - const events2 = await submitTransactionAsync(zeroBalance, zeroToAlice); - const result2 = getGenericResult(events2); - expect(result2.success).to.be.true; - - expect(sponsorBalanceAfter).to.be.equal(sponsorBalanceBefore); + expect(bobBalanceAfter === bobBalanceBefore).to.be.true; }); }); it('ReFungible: Sponsoring is rate limited', async function() { - await requirePallets(this, [Pallets.ReFungible]); + await usingPlaygrounds(async (helper) => { + const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); - const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); + const token = await collection.mintToken(alice, {Substrate: charlie.address}, 100n); + await token.transfer(charlie, {Substrate: alice.address}); - await usingApi(async (api, privateKeyWrapper) => { - // Find unused address - const zeroBalance = await findUnusedAddress(api, privateKeyWrapper); - - // Mint token for alice - const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', zeroBalance.address); - - const zeroToAlice = api.tx.unique.transfer(normalizeAccountId(alice.address), collectionId, itemId, 1); - - // Zero to alice gets sponsored - const events1 = await submitTransactionAsync(zeroBalance, zeroToAlice); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; - - // Second transfer should fail - const sponsorBalanceBefore = (await api.query.system.account(bob.address)).data.free.toBigInt(); - await expect(submitTransactionExpectFailAsync(zeroBalance, zeroToAlice)).to.be.rejectedWith('Inability to pay some fees'); - const sponsorBalanceAfter = (await api.query.system.account(bob.address)).data.free.toBigInt(); - expect(sponsorBalanceAfter).to.be.equal(sponsorBalanceBefore); - - // Try again after Zero gets some balance - now it should succeed - const balancetx = api.tx.balances.transfer(zeroBalance.address, 1n * UNIQUE); - await submitTransactionAsync(alice, balancetx); - const events2 = await submitTransactionAsync(zeroBalance, zeroToAlice); - const result2 = getGenericResult(events2); - expect(result2.success).to.be.true; + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); + const transferTx = async () => token.transfer(charlie, {Substrate: alice.address}); + await expect(transferTx()).to.be.rejectedWith('Inability to pay some fees'); + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); + + expect(bobBalanceAfter === bobBalanceBefore).to.be.true; }); }); it('NFT: Sponsoring of createItem is rate limited', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); - - // Enable collection allow list - await enableAllowListExpectSuccess(alice, collectionId); - - // Enable public minting - await enablePublicMintingExpectSuccess(alice, collectionId); - - await usingApi(async (api, privateKeyWrapper) => { - // Find unused address - const zeroBalance = await findUnusedAddress(api, privateKeyWrapper); - - // Add zeroBalance address to allow list - await addToAllowListExpectSuccess(alice, collectionId, zeroBalance.address); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + await collection.setPermissions(alice, {mintMode: true, access: 'AllowList'}); + await collection.addToAllowList(alice, {Substrate: charlie.address}); - // Mint token using unused address as signer - gets sponsored - await createItemExpectSuccess(zeroBalance, collectionId, 'NFT', zeroBalance.address); + await collection.mintToken(charlie, {Substrate: charlie.address}); - // Second mint should fail - const sponsorBalanceBefore = (await api.query.system.account(bob.address)).data.free.toBigInt(); + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); + const mintTx = async () => collection.mintToken(charlie, {Substrate: charlie.address}); + await expect(mintTx()).to.be.rejectedWith('Inability to pay some fees'); + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); - const badTransaction = async function () { - await createItemExpectSuccess(zeroBalance, collectionId, 'NFT', zeroBalance.address); - }; - await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees'); - const sponsorBalanceAfter = (await api.query.system.account(bob.address)).data.free.toBigInt(); - - // Try again after Zero gets some balance - now it should succeed - const balancetx = api.tx.balances.transfer(zeroBalance.address, 1n * UNIQUE); - await submitTransactionAsync(alice, balancetx); - await createItemExpectSuccess(zeroBalance, collectionId, 'NFT', zeroBalance.address); - - expect(sponsorBalanceAfter).to.be.equal(sponsorBalanceBefore); + expect(bobBalanceAfter === bobBalanceBefore).to.be.true; }); }); - }); describe('(!negative test!) integration test: ext. confirmSponsorship():', () => { From d2c56f6f2cbafca3966a610f3e7970c89b01737a Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 9 Sep 2022 17:44:13 +0300 Subject: [PATCH 0834/1274] name step with api test run --- .github/workflows/market-test_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index 5d0aa4a201..e71185f822 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -163,7 +163,7 @@ jobs: working-directory: qa-tests run: cat .env - - name: + - name: Test API interface working-directory: qa-tests run: | npx playwright test --workers=8 --quiet .*.api.test.ts --reporter=github --config playwright.config.ts From f007f1a1cad413ace9bbf81f29a835dcc611de20 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 9 Sep 2022 15:20:40 +0000 Subject: [PATCH 0835/1274] tests: fix package version warnings + lint errors --- tests/package.json | 2 +- tests/src/eth/contractSponsoring.test.ts | 2 +- tests/src/util/playgrounds/unique.dev.ts | 2 + tests/yarn.lock | 1036 ++++++++++------------ 4 files changed, 479 insertions(+), 563 deletions(-) diff --git a/tests/package.json b/tests/package.json index 16949097cf..65e5d90e65 100644 --- a/tests/package.json +++ b/tests/package.json @@ -97,7 +97,7 @@ "dependencies": { "@polkadot/api": "9.2.2", "@polkadot/api-contract": "9.2.2", - "@polkadot/util-crypto": "10.1.1", + "@polkadot/util-crypto": "10.1.4", "bignumber.js": "^9.0.2", "chai-as-promised": "^7.1.1", "chai-like": "^1.1.1", diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index c600b1a323..630bac0ac9 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {expect} from 'chai'; -import { expectSubstrateEventsAtBlock } from '../util/helpers'; +import {expectSubstrateEventsAtBlock} from '../util/helpers'; import { contractHelpers, createEthAccountWithBalance, diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 380d333438..714a7e570d 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -257,6 +257,7 @@ class WaitGroup { } async forParachainBlockNumber(blockNumber: bigint) { + // eslint-disable-next-line no-async-promise-executor return new Promise(async (resolve) => { const unsubscribe = await this.helper.api!.rpc.chain.subscribeNewHeads(async (data: any) => { if (data.number.toNumber() >= blockNumber) { @@ -268,6 +269,7 @@ class WaitGroup { } async forRelayBlockNumber(blockNumber: bigint) { + // eslint-disable-next-line no-async-promise-executor return new Promise(async (resolve) => { const unsubscribe = await this.helper.api!.query.parachainSystem.validationData(async (data: any) => { if (data.value.relayParentNumber.toNumber() >= blockNumber) { diff --git a/tests/yarn.lock b/tests/yarn.lock index 29f45253d8..4951f3ac39 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -17,47 +17,47 @@ dependencies: "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.18.8": - version "7.18.8" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.18.8.tgz#2483f565faca607b8535590e84e7de323f27764d" - integrity sha512-HSmX4WZPPK3FUxYp7g2T6EyO8j96HlZJlxmKPSh6KAcqwyDrfx7hKjXpAW/0FhFfTJsR0Yt4lAjLI2coMptIHQ== +"@babel/compat-data@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.19.0.tgz#2a592fd89bacb1fcde68de31bee4f2f2dacb0e86" + integrity sha512-y5rqgTTPTmaF5e2nVhOxw+Ur9HDJLsWb6U/KpgUzRZEdPfE6VOubXBKLdbcUTijzRptednSBDQbYZBOSqJxpJw== "@babel/core@^7.18.10": - version "7.18.10" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.10.tgz#39ad504991d77f1f3da91be0b8b949a5bc466fb8" - integrity sha512-JQM6k6ENcBFKVtWvLavlvi/mPcpYZ3+R+2EySDEMSMbp7Mn4FexlbbJVrx2R7Ijhr01T8gyqrOaABWIOgxeUyw== + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.0.tgz#d2f5f4f2033c00de8096be3c9f45772563e150c3" + integrity sha512-reM4+U7B9ss148rh2n1Qs9ASS+w94irYXga7c2jaQv9RVzpS7Mv1a9rnYYwuDa45G+DkORt9g6An2k/V4d9LbQ== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.18.10" - "@babel/helper-compilation-targets" "^7.18.9" - "@babel/helper-module-transforms" "^7.18.9" - "@babel/helpers" "^7.18.9" - "@babel/parser" "^7.18.10" + "@babel/generator" "^7.19.0" + "@babel/helper-compilation-targets" "^7.19.0" + "@babel/helper-module-transforms" "^7.19.0" + "@babel/helpers" "^7.19.0" + "@babel/parser" "^7.19.0" "@babel/template" "^7.18.10" - "@babel/traverse" "^7.18.10" - "@babel/types" "^7.18.10" + "@babel/traverse" "^7.19.0" + "@babel/types" "^7.19.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.1" semver "^6.3.0" -"@babel/generator@^7.18.10": - version "7.18.12" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.12.tgz#fa58daa303757bd6f5e4bbca91b342040463d9f4" - integrity sha512-dfQ8ebCN98SvyL7IxNMCUtZQSq5R7kxgN+r8qYTGDmmSion1hX2C0zq2yo1bsCDhXixokv1SAWTZUMYbO/V5zg== +"@babel/generator@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.0.tgz#785596c06425e59334df2ccee63ab166b738419a" + integrity sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg== dependencies: - "@babel/types" "^7.18.10" + "@babel/types" "^7.19.0" "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" -"@babel/helper-compilation-targets@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.9.tgz#69e64f57b524cde3e5ff6cc5a9f4a387ee5563bf" - integrity sha512-tzLCyVmqUiFlcFoAPLA/gL9TeYrF61VLNtb+hvkuVaB5SUjW7jcfrglBIX1vUIoT7CLP3bBlIMeyEsIl2eFQNg== +"@babel/helper-compilation-targets@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.0.tgz#537ec8339d53e806ed422f1e06c8f17d55b96bb0" + integrity sha512-Ai5bNWXIvwDvWM7njqsG3feMlL9hCVQsPYXodsZyLwshYkZVJt59Gftau4VrE8S9IT9asd2uSP1hG6wCNw+sXA== dependencies: - "@babel/compat-data" "^7.18.8" + "@babel/compat-data" "^7.19.0" "@babel/helper-validator-option" "^7.18.6" browserslist "^4.20.2" semver "^6.3.0" @@ -67,13 +67,13 @@ resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== -"@babel/helper-function-name@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.18.9.tgz#940e6084a55dee867d33b4e487da2676365e86b0" - integrity sha512-fJgWlZt7nxGksJS9a0XdSaI4XvpExnNIgRP+rVefWh5U7BL8pPuir6SJUmFKRfjWQ51OtWSzwOxhaH/EBWWc0A== +"@babel/helper-function-name@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" + integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== dependencies: - "@babel/template" "^7.18.6" - "@babel/types" "^7.18.9" + "@babel/template" "^7.18.10" + "@babel/types" "^7.19.0" "@babel/helper-hoist-variables@^7.18.6": version "7.18.6" @@ -89,19 +89,19 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.18.9.tgz#5a1079c005135ed627442df31a42887e80fcb712" - integrity sha512-KYNqY0ICwfv19b31XzvmI/mfcylOzbLtowkw+mfvGPAQ3kfCnMLYbED3YecL5tPd8nAYFQFAd6JHp2LxZk/J1g== +"@babel/helper-module-transforms@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz#309b230f04e22c58c6a2c0c0c7e50b216d350c30" + integrity sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ== dependencies: "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-module-imports" "^7.18.6" "@babel/helper-simple-access" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" "@babel/helper-validator-identifier" "^7.18.6" - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.9" - "@babel/types" "^7.18.9" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.19.0" + "@babel/types" "^7.19.0" "@babel/helper-simple-access@^7.18.6": version "7.18.6" @@ -132,14 +132,14 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== -"@babel/helpers@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.18.9.tgz#4bef3b893f253a1eced04516824ede94dcfe7ff9" - integrity sha512-Jf5a+rbrLoR4eNdUmnFu8cN5eNJT6qdTdOg5IHIzq87WwyRw9PwguLFOWYgktN/60IP4fgDUawJvs7PjQIzELQ== +"@babel/helpers@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.19.0.tgz#f30534657faf246ae96551d88dd31e9d1fa1fc18" + integrity sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg== dependencies: - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.9" - "@babel/types" "^7.18.9" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.19.0" + "@babel/types" "^7.19.0" "@babel/highlight@^7.18.6": version "7.18.6" @@ -150,10 +150,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.18.10", "@babel/parser@^7.18.11": - version "7.18.11" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.11.tgz#68bb07ab3d380affa9a3f96728df07969645d2d9" - integrity sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ== +"@babel/parser@^7.18.10", "@babel/parser@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.0.tgz#497fcafb1d5b61376959c1c338745ef0577aa02c" + integrity sha512-74bEXKX2h+8rrfQUfsBfuZZHzsEs6Eql4pqy/T4Nn6Y9wNPggQOqD6z6pn5Bl8ZfysKouFZT/UXEH94ummEeQw== "@babel/register@^7.18.9": version "7.18.9" @@ -167,13 +167,13 @@ source-map-support "^0.5.16" "@babel/runtime@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" - integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.19.0.tgz#22b11c037b094d27a8a2504ea4dcff00f50e2259" + integrity sha512-eR8Lo9hnDS7tqkO7NsV+mKvCmv5boaXFSZ70DnfhcgiEne8hv9oCEd36Klw74EtizEqLsy4YnW8UWwpBVolHZA== dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.18.10", "@babel/template@^7.18.6": +"@babel/template@^7.18.10": version "7.18.10" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71" integrity sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA== @@ -182,26 +182,26 @@ "@babel/parser" "^7.18.10" "@babel/types" "^7.18.10" -"@babel/traverse@^7.18.10", "@babel/traverse@^7.18.9": - version "7.18.11" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.11.tgz#3d51f2afbd83ecf9912bcbb5c4d94e3d2ddaa16f" - integrity sha512-TG9PiM2R/cWCAy6BPJKeHzNbu4lPzOSZpeMfeNErskGpTJx6trEvFaVCbDvpcxwy49BKWmEPwiW8mrysNiDvIQ== +"@babel/traverse@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.0.tgz#eb9c561c7360005c592cc645abafe0c3c4548eed" + integrity sha512-4pKpFRDh+utd2mbRC8JLnlsMUii3PMHjpL6a0SZ4NMZy7YFP9aXORxEhdMVOc9CpWtDF09IkciQLEhK7Ml7gRA== dependencies: "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.18.10" + "@babel/generator" "^7.19.0" "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.18.11" - "@babel/types" "^7.18.10" + "@babel/parser" "^7.19.0" + "@babel/types" "^7.19.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9": - version "7.18.10" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.10.tgz#4908e81b6b339ca7c6b7a555a5fc29446f26dde6" - integrity sha512-MJvnbEiiNkpjo+LknnmRrqbY1GPUUggjv+wQVjetM/AONoupqRALB7I6jGqNUAZsKcRIEu2J6FRFvsczljjsaQ== +"@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.19.0.tgz#75f21d73d73dc0351f3368d28db73465f4814600" + integrity sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA== dependencies: "@babel/helper-string-parser" "^7.18.10" "@babel/helper-validator-identifier" "^7.18.6" @@ -214,14 +214,14 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@eslint/eslintrc@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.0.tgz#29f92c30bb3e771e4a2048c95fa6855392dfac4f" - integrity sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw== +"@eslint/eslintrc@^1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.1.tgz#de0807bfeffc37b964a7d0400e0c348ce5a2543d" + integrity sha512-OhSY22oQQdw3zgPOOwdoj01l/Dzl1Z+xyUP33tkSN+aqyEhymJCcPHyXt+ylW8FSe0TfRC2VG+ROQOapD0aZSQ== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.3.2" + espree "^9.4.0" globals "^13.15.0" ignore "^5.2.0" import-fresh "^3.2.1" @@ -246,180 +246,181 @@ ethereumjs-util "^7.1.5" "@ethersproject/abi@^5.6.3": - version "5.6.4" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.4.tgz#f6e01b6ed391a505932698ecc0d9e7a99ee60362" - integrity sha512-TTeZUlCeIHG6527/2goZA6gW5F8Emoc7MrZDC7hhP84aRGvW3TEdTnZR08Ls88YXM1m2SuK42Osw/jSi3uO8gg== - dependencies: - "@ethersproject/address" "^5.6.1" - "@ethersproject/bignumber" "^5.6.2" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/constants" "^5.6.1" - "@ethersproject/hash" "^5.6.1" - "@ethersproject/keccak256" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/strings" "^5.6.1" - -"@ethersproject/abstract-provider@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.6.1.tgz#02ddce150785caf0c77fe036a0ebfcee61878c59" - integrity sha512-BxlIgogYJtp1FS8Muvj8YfdClk3unZH0vRMVX791Z9INBNT/kuACZ9GzaY1Y4yFq+YSy6/w4gzj3HCRKrK9hsQ== - dependencies: - "@ethersproject/bignumber" "^5.6.2" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/networks" "^5.6.3" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/transactions" "^5.6.2" - "@ethersproject/web" "^5.6.1" - -"@ethersproject/abstract-signer@^5.6.2": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.6.2.tgz#491f07fc2cbd5da258f46ec539664713950b0b33" - integrity sha512-n1r6lttFBG0t2vNiI3HoWaS/KdOt8xyDjzlP2cuevlWLG6EX0OwcKLyG/Kp/cuwNxdy/ous+R/DEMdTUwWQIjQ== - dependencies: - "@ethersproject/abstract-provider" "^5.6.1" - "@ethersproject/bignumber" "^5.6.2" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - -"@ethersproject/address@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.6.1.tgz#ab57818d9aefee919c5721d28cd31fd95eff413d" - integrity sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q== - dependencies: - "@ethersproject/bignumber" "^5.6.2" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/keccak256" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/rlp" "^5.6.1" - -"@ethersproject/base64@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.6.1.tgz#2c40d8a0310c9d1606c2c37ae3092634b41d87cb" - integrity sha512-qB76rjop6a0RIYYMiB4Eh/8n+Hxu2NIZm8S/Q7kNo5pmZfXhHGHmS4MinUainiBC54SCyRnwzL+KZjj8zbsSsw== - dependencies: - "@ethersproject/bytes" "^5.6.1" - -"@ethersproject/bignumber@^5.6.2": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.6.2.tgz#72a0717d6163fab44c47bcc82e0c550ac0315d66" - integrity sha512-v7+EEUbhGqT3XJ9LMPsKvXYHFc8eHxTowFCG/HgJErmq4XHJ2WR7aeyICg3uTOAQ7Icn0GFHAohXEhxQHq4Ubw== - dependencies: - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/logger" "^5.6.0" + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" + integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/abstract-provider@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" + integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + +"@ethersproject/abstract-signer@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" + integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/address@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" + integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + +"@ethersproject/base64@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" + integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + +"@ethersproject/bignumber@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" + integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" bn.js "^5.2.1" -"@ethersproject/bytes@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.6.1.tgz#24f916e411f82a8a60412344bf4a813b917eefe7" - integrity sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g== - dependencies: - "@ethersproject/logger" "^5.6.0" - -"@ethersproject/constants@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.6.1.tgz#e2e974cac160dd101cf79fdf879d7d18e8cb1370" - integrity sha512-QSq9WVnZbxXYFftrjSjZDUshp6/eKp6qrtdBtUCm0QxCV5z1fG/w3kdlcsjMCQuQHUnAclKoK7XpXMezhRDOLg== - dependencies: - "@ethersproject/bignumber" "^5.6.2" - -"@ethersproject/hash@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.6.1.tgz#224572ea4de257f05b4abf8ae58b03a67e99b0f4" - integrity sha512-L1xAHurbaxG8VVul4ankNX5HgQ8PNCTrnVXEiFnE9xoRnaUcgfD12tZINtDinSllxPLCtGwguQxJ5E6keE84pA== - dependencies: - "@ethersproject/abstract-signer" "^5.6.2" - "@ethersproject/address" "^5.6.1" - "@ethersproject/bignumber" "^5.6.2" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/keccak256" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/strings" "^5.6.1" - -"@ethersproject/keccak256@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.6.1.tgz#b867167c9b50ba1b1a92bccdd4f2d6bd168a91cc" - integrity sha512-bB7DQHCTRDooZZdL3lk9wpL0+XuG3XLGHLh3cePnybsO3V0rdCAOQGpn/0R3aODmnTOOkCATJiD2hnL+5bwthA== - dependencies: - "@ethersproject/bytes" "^5.6.1" +"@ethersproject/bytes@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" + integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/constants@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" + integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + +"@ethersproject/hash@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" + integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/keccak256@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" + integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== + dependencies: + "@ethersproject/bytes" "^5.7.0" js-sha3 "0.8.0" -"@ethersproject/logger@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.6.0.tgz#d7db1bfcc22fd2e4ab574cba0bb6ad779a9a3e7a" - integrity sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg== +"@ethersproject/logger@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" + integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== -"@ethersproject/networks@^5.6.3": - version "5.6.4" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.4.tgz#51296d8fec59e9627554f5a8a9c7791248c8dc07" - integrity sha512-KShHeHPahHI2UlWdtDMn2lJETcbtaJge4k7XSjDR9h79QTd6yQJmv6Cp2ZA4JdqWnhszAOLSuJEd9C0PRw7hSQ== +"@ethersproject/networks@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.0.tgz#df72a392f1a63a57f87210515695a31a245845ad" + integrity sha512-MG6oHSQHd4ebvJrleEQQ4HhVu8Ichr0RDYEfHzsVAVjHNM+w36x9wp9r+hf1JstMXtseXDtkiVoARAG6M959AA== dependencies: - "@ethersproject/logger" "^5.6.0" + "@ethersproject/logger" "^5.7.0" -"@ethersproject/properties@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.6.0.tgz#38904651713bc6bdd5bdd1b0a4287ecda920fa04" - integrity sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg== +"@ethersproject/properties@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" + integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== dependencies: - "@ethersproject/logger" "^5.6.0" + "@ethersproject/logger" "^5.7.0" -"@ethersproject/rlp@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.6.1.tgz#df8311e6f9f24dcb03d59a2bac457a28a4fe2bd8" - integrity sha512-uYjmcZx+DKlFUk7a5/W9aQVaoEC7+1MOBgNtvNg13+RnuUwT4F0zTovC0tmay5SmRslb29V1B7Y5KCri46WhuQ== +"@ethersproject/rlp@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" + integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== dependencies: - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/logger" "^5.6.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" -"@ethersproject/signing-key@^5.6.2": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.6.2.tgz#8a51b111e4d62e5a62aee1da1e088d12de0614a3" - integrity sha512-jVbu0RuP7EFpw82vHcL+GP35+KaNruVAZM90GxgQnGqB6crhBqW/ozBfFvdeImtmb4qPko0uxXjn8l9jpn0cwQ== +"@ethersproject/signing-key@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" + integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== dependencies: - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" bn.js "^5.2.1" elliptic "6.5.4" hash.js "1.1.7" -"@ethersproject/strings@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.6.1.tgz#dbc1b7f901db822b5cafd4ebf01ca93c373f8952" - integrity sha512-2X1Lgk6Jyfg26MUnsHiT456U9ijxKUybz8IM1Vih+NJxYtXhmvKBcHOmvGqpFSVJ0nQ4ZCoIViR8XlRw1v/+Cw== - dependencies: - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/constants" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - -"@ethersproject/transactions@^5.6.2": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.6.2.tgz#793a774c01ced9fe7073985bb95a4b4e57a6370b" - integrity sha512-BuV63IRPHmJvthNkkt9G70Ullx6AcM+SDc+a8Aw/8Yew6YwT51TcBKEp1P4oOQ/bP25I18JJr7rcFRgFtU9B2Q== - dependencies: - "@ethersproject/address" "^5.6.1" - "@ethersproject/bignumber" "^5.6.2" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/constants" "^5.6.1" - "@ethersproject/keccak256" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/rlp" "^5.6.1" - "@ethersproject/signing-key" "^5.6.2" - -"@ethersproject/web@^5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.6.1.tgz#6e2bd3ebadd033e6fe57d072db2b69ad2c9bdf5d" - integrity sha512-/vSyzaQlNXkO1WV+RneYKqCJwualcUdx/Z3gseVovZP0wIlOFcCE1hkRhKBH8ImKbGQbMl9EAAyJFrJu7V0aqA== - dependencies: - "@ethersproject/base64" "^5.6.1" - "@ethersproject/bytes" "^5.6.1" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/strings" "^5.6.1" +"@ethersproject/strings@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" + integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/transactions@^5.6.2", "@ethersproject/transactions@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" + integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + +"@ethersproject/web@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.0.tgz#40850c05260edad8b54827923bbad23d96aac0bc" + integrity sha512-ApHcbbj+muRASVDSCl/tgxaH2LBkRMEYfLOLVa0COipx0+nlu0QKet7U2lEg0vdkh8XRSLf2nd1f1Uk9SrVSGA== + dependencies: + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" "@humanwhocodes/config-array@^0.10.4": version "0.10.4" @@ -435,6 +436,11 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz#316b0a63b91c10e53f242efb4ace5c3b34e8728d" integrity sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA== +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + "@humanwhocodes/object-schema@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" @@ -597,24 +603,15 @@ rxjs "^7.5.6" "@polkadot/keyring@^10.1.4": - version "10.1.4" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-10.1.4.tgz#7c60002cb442d2a160ee215b21c1319e85d97eaf" - integrity sha512-dCMejp5heZwKSFeO+1vCHFoo1h1KgNvu4AaKQdNxpyr/3eCINrCFI74/qT9XGypblxd61caOpJcMl8B1R/UWFA== + version "10.1.7" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-10.1.7.tgz#d51be1dc5807c961889847d8f0e10e4bbdd19d3f" + integrity sha512-lArwaAS3hDs+HHupDIC4r2mFaAfmNQV2YzwL2wM5zhOqB2RugN03BFrgwNll0y9/Bg8rYDqM3Y5BvVMzgMZ6XA== dependencies: "@babel/runtime" "^7.18.9" - "@polkadot/util" "10.1.4" - "@polkadot/util-crypto" "10.1.4" + "@polkadot/util" "10.1.7" + "@polkadot/util-crypto" "10.1.7" -"@polkadot/networks@10.1.1": - version "10.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.1.1.tgz#d3deeff5c4cfad8c1eec85732351d80d1b2d0934" - integrity sha512-upM8r0mrsCVA+vPVbJUjtnkAfdleBMHB+Fbxvy3xtbK1IFpzQTUhSOQb6lBnBAPBFGyxMtQ3TytnInckAdYZeg== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/util" "10.1.1" - "@substrate/ss58-registry" "^1.24.0" - -"@polkadot/networks@10.1.4", "@polkadot/networks@^10.1.4": +"@polkadot/networks@10.1.4": version "10.1.4" resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.1.4.tgz#d8b375aad8f858f611165d8288eb5eab7275ca24" integrity sha512-5wMwqD+DeVMh29OZZBVkA4DQE9EBsUj5FjmUS2CloA8RzE6SV0qL34zhTwOdq95KJV1OoDbp9aGjCBqhEuozKw== @@ -623,6 +620,15 @@ "@polkadot/util" "10.1.4" "@substrate/ss58-registry" "^1.25.0" +"@polkadot/networks@10.1.7", "@polkadot/networks@^10.1.4": + version "10.1.7" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.1.7.tgz#33b38d70409e2daf0990ef18ff150c6718ffb700" + integrity sha512-ol864SZ/GwAF72GQOPRy+Y9r6NtgJJjMBlDLESvV5VK64eEB0MRSSyiOdd7y/4SumR9crrrNimx3ynACFgxZ8A== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/util" "10.1.7" + "@substrate/ss58-registry" "^1.28.0" + "@polkadot/rpc-augment@9.2.2": version "9.2.2" resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-9.2.2.tgz#7246e6a43536296ad19be8460a81e434d718ff4c" @@ -758,24 +764,7 @@ "@polkadot/util-crypto" "^10.1.4" rxjs "^7.5.6" -"@polkadot/util-crypto@10.1.1": - version "10.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.1.1.tgz#c6e16e626e55402fdb44c8bb20ce4a9d7c50b9db" - integrity sha512-R0V++xXbL2pvnCFIuXnKc/TlNhBkyxcno1u8rmjYNuH9S5GOmi2jY/8cNhbrwk6wafBsi+xMPHrEbUnduk82Ag== - dependencies: - "@babel/runtime" "^7.18.9" - "@noble/hashes" "1.1.2" - "@noble/secp256k1" "1.6.3" - "@polkadot/networks" "10.1.1" - "@polkadot/util" "10.1.1" - "@polkadot/wasm-crypto" "^6.3.1" - "@polkadot/x-bigint" "10.1.1" - "@polkadot/x-randomvalues" "10.1.1" - "@scure/base" "1.1.1" - ed2curve "^0.3.0" - tweetnacl "^1.0.3" - -"@polkadot/util-crypto@10.1.4", "@polkadot/util-crypto@^10.1.4": +"@polkadot/util-crypto@10.1.4": version "10.1.4" resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.1.4.tgz#1d65a9b3d979f1cb078636a413cdf664db760a8b" integrity sha512-6rdUwCdbwmQ0PBWBNYh55RsXAcFjhco/TGLuM7GJ7YufrN9qqv1sr40HlneLbtpiZnfukZ3q/qOpj0h7Hrw2JQ== @@ -792,20 +781,24 @@ ed2curve "^0.3.0" tweetnacl "^1.0.3" -"@polkadot/util@10.1.1": - version "10.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.1.1.tgz#5aa20eac03806e70dc21e618a7f8cd767dac0fd0" - integrity sha512-/g0sEqOOXfiNmQnWcFK3H1+wKBjbJEfGj6lTmbQ0xnL4TS5mFFQ7ZZEvxD60EkoXVMuCmSSh9E54goNLzh+Zyg== +"@polkadot/util-crypto@10.1.7", "@polkadot/util-crypto@^10.1.4": + version "10.1.7" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.1.7.tgz#fe5ea006bf23ae19319f3ac9236905a984a65e2f" + integrity sha512-zGmSU7a0wdWfpDtfc+Q7fUuW+extu9o1Uh4JpkuwwZ/dxmyW5xlfqVsIScM1pdPyjJsyamX8KwsKiVsW4slasg== dependencies: "@babel/runtime" "^7.18.9" - "@polkadot/x-bigint" "10.1.1" - "@polkadot/x-global" "10.1.1" - "@polkadot/x-textdecoder" "10.1.1" - "@polkadot/x-textencoder" "10.1.1" - "@types/bn.js" "^5.1.0" - bn.js "^5.2.1" + "@noble/hashes" "1.1.2" + "@noble/secp256k1" "1.6.3" + "@polkadot/networks" "10.1.7" + "@polkadot/util" "10.1.7" + "@polkadot/wasm-crypto" "^6.3.1" + "@polkadot/x-bigint" "10.1.7" + "@polkadot/x-randomvalues" "10.1.7" + "@scure/base" "1.1.1" + ed2curve "^0.3.0" + tweetnacl "^1.0.3" -"@polkadot/util@10.1.4", "@polkadot/util@^10.1.4": +"@polkadot/util@10.1.4": version "10.1.4" resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.1.4.tgz#29654dd52d5028fd9ca175e9cebad605fa79396c" integrity sha512-MHz1UxYXuV+XxPl+GR++yOUE0OCiVd+eJBqLgpjpVJNRkudbAmfGAbB2TNR0+76M0fevIeHj4DGEd0gY6vqKLw== @@ -818,6 +811,19 @@ "@types/bn.js" "^5.1.0" bn.js "^5.2.1" +"@polkadot/util@10.1.7", "@polkadot/util@^10.1.4": + version "10.1.7" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.1.7.tgz#c54ca2a5b29cb834b40d8a876baefa3a0efb93af" + integrity sha512-s7gDLdNb4HUpoe3faXwoO6HwiUp8pi66voYKiUYRh1kEtW1o9vGBgyZPHPGC/FBgILzTJKii/9XxnSex60zBTA== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/x-bigint" "10.1.7" + "@polkadot/x-global" "10.1.7" + "@polkadot/x-textdecoder" "10.1.7" + "@polkadot/x-textencoder" "10.1.7" + "@types/bn.js" "^5.1.1" + bn.js "^5.2.1" + "@polkadot/wasm-bridge@6.3.1": version "6.3.1" resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-6.3.1.tgz#439fa78e80947a7cb695443e1f64b25c30bb1487" @@ -869,15 +875,7 @@ dependencies: "@babel/runtime" "^7.18.9" -"@polkadot/x-bigint@10.1.1": - version "10.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.1.1.tgz#c084cfdfe48633da07423f4d9916563882947563" - integrity sha512-YNYN64N4icKyqiDIw0tcGyWwz3g/282Kk0ozfcA5TM0wGRe2BwmoB4gYrZ7pJDxvsHnRPR6Dw0r9Xxh8DNIzHQ== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.1" - -"@polkadot/x-bigint@10.1.4", "@polkadot/x-bigint@^10.1.4": +"@polkadot/x-bigint@10.1.4": version "10.1.4" resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.1.4.tgz#a084a9d2f80f25ffd529faafdf95cd6c3044ef74" integrity sha512-qgLetTukFhkxNxNcUWMmnrfE9bp4TNbrqNoVBVH7wqSuEVpDPITBXsQ/78LbaaZGWD80Ew0wGxcZ/rqX+dLVUA== @@ -885,37 +883,37 @@ "@babel/runtime" "^7.18.9" "@polkadot/x-global" "10.1.4" -"@polkadot/x-fetch@^10.1.4": - version "10.1.4" - resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-10.1.4.tgz#72db88007c74f3aee47f72091a33d553f7ca241a" - integrity sha512-hVhLpOvx+ys6klkqWJnINi9FU/JcDnc+6cyU9fa+Dum3mqO1XnngOYDO9mpf5HODIwrFNFmohll9diRP+TW0yQ== +"@polkadot/x-bigint@10.1.7", "@polkadot/x-bigint@^10.1.4": + version "10.1.7" + resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.1.7.tgz#1338689476ffdbb9f9cb243df1954ae8186134b9" + integrity sha512-uaClHpI6cnDumIfejUKvNTkB43JleEb0V6OIufDKJ/e1aCLE3f/Ws9ggwL8ea05lQP5k5xqOzbPdizi/UvrgKQ== dependencies: "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.4" - "@types/node-fetch" "^2.6.2" - node-fetch "^3.2.10" + "@polkadot/x-global" "10.1.7" -"@polkadot/x-global@10.1.1": - version "10.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.1.1.tgz#d0d90ef71fd94f59605e8c73dcd1aa3e3dd4fc37" - integrity sha512-wB3rZTTNN14umLSfR2GLL0dJrlGM1YRUNw7XvbA+3B8jxGCIOmjSyAkdZBeiCxg2XIbJD3EkB0hBhga2mNuS6g== +"@polkadot/x-fetch@^10.1.4": + version "10.1.7" + resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-10.1.7.tgz#1b76051a495563403a20ef235a8558c6d91b11a6" + integrity sha512-NL+xrlqUoCLwCIAvQLwOA189gSUgeSGOFjCmZ9uMkBqf35KXeZoHWse6YaoseTSlnAal3dQOGbXnYWZ4Ck2OSA== dependencies: "@babel/runtime" "^7.18.9" + "@polkadot/x-global" "10.1.7" + "@types/node-fetch" "^2.6.2" + node-fetch "^3.2.10" -"@polkadot/x-global@10.1.4", "@polkadot/x-global@^10.1.4": +"@polkadot/x-global@10.1.4": version "10.1.4" resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.1.4.tgz#657f7054fe07a7c027b4d18fcfa3438d2ffaef07" integrity sha512-67f53H872wHvmjmL96DvhC3dG7gKRG1ghEbHXeFIGwkix+9zGEMV9krYW1+OAvGAuCQZqUIUGiJ7lad4Zjb7wQ== dependencies: "@babel/runtime" "^7.18.9" -"@polkadot/x-randomvalues@10.1.1": - version "10.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.1.1.tgz#3b1f590e6641e322e3a28bb4f17f0a53005d9ada" - integrity sha512-opVFNEnzCir7cWsFfyDqNlrGazkpjnL+JpkxE/b9WmSco6y0IUzn/Q7rL3EaBzBEvxY0/J8KeSGGs3W+mf6tBQ== +"@polkadot/x-global@10.1.7", "@polkadot/x-global@^10.1.4": + version "10.1.7" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.1.7.tgz#91a472ac2f83fd0858dcd0df528844a5b650790e" + integrity sha512-k2ZUZyBVgDnP/Ysxapa0mthn63j6gsN2V0kZejEQPyOfCHtQQkse3jFvAWdslpWoR8j2k8SN5O6reHc0F4f7mA== dependencies: "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.1" "@polkadot/x-randomvalues@10.1.4": version "10.1.4" @@ -925,13 +923,13 @@ "@babel/runtime" "^7.18.9" "@polkadot/x-global" "10.1.4" -"@polkadot/x-textdecoder@10.1.1": - version "10.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.1.1.tgz#536d0093749fcc14a60d4ae29c35f699dea7e651" - integrity sha512-a52ah/sUS+aGZcCCL7BhrytAeV/7kiqu1zbuCoZtIzxP6x34a2vcic3bLPoyynLcX2ruzvLKFhJDGOJ4Bq5lcA== +"@polkadot/x-randomvalues@10.1.7": + version "10.1.7" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.1.7.tgz#d537f1f7bf3fb03e6c08ae6e6ac36e069c1f9844" + integrity sha512-3er4UYOlozLGgFYWwcbmcFslmO8m82u4cAGR4AaEag0VdV7jLO/M5lTmivT/3rtLSww6sjkEfr522GM2Q5lmFg== dependencies: "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.1" + "@polkadot/x-global" "10.1.7" "@polkadot/x-textdecoder@10.1.4": version "10.1.4" @@ -941,13 +939,13 @@ "@babel/runtime" "^7.18.9" "@polkadot/x-global" "10.1.4" -"@polkadot/x-textencoder@10.1.1": - version "10.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.1.1.tgz#c1a86b3d0fe0ca65d30c8ce5c6f75c4035e95847" - integrity sha512-prTzUXXW9OxFyf17EwGSBxe2GvVFG60cmKV8goC50nghhNMl1y0GdGpvKNQTFG6hIk5fIon9/pBpWsas4iAf+Q== +"@polkadot/x-textdecoder@10.1.7": + version "10.1.7" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.1.7.tgz#1dd4e6141b1669acdd321a4da1fc6fdc271b7908" + integrity sha512-iAFOHludmZFOyVL8sQFv4TDqbcqQU5gwwYv74duTA+WQBgbSITJrBahSCV/rXOjUqds9pzQO3qBFzziznNnkiQ== dependencies: "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.1" + "@polkadot/x-global" "10.1.7" "@polkadot/x-textencoder@10.1.4": version "10.1.4" @@ -957,13 +955,21 @@ "@babel/runtime" "^7.18.9" "@polkadot/x-global" "10.1.4" +"@polkadot/x-textencoder@10.1.7": + version "10.1.7" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.1.7.tgz#b208601f33b936c7a059f126dbb6b26a87f45864" + integrity sha512-GzjaWZDbgzZ0IQT60xuZ7cZ0wnlNVYMqpfI9KvBc58X9dPI3TIMwzbXDVzZzpjY1SAqJGs4hJse9HMWZazfhew== + dependencies: + "@babel/runtime" "^7.18.9" + "@polkadot/x-global" "10.1.7" + "@polkadot/x-ws@^10.1.4": - version "10.1.4" - resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-10.1.4.tgz#b3fa515598bc6f8e85d92754d5f1c4be19ca44a1" - integrity sha512-hi7hBRRCLlHgqVW2p5TkoJuTxV7sVprl+aAnmcIpPU4J8Ai6PKQvXR+fLK01T8moBYmH5ztHrBWvY/XRzmQ8Vg== + version "10.1.7" + resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-10.1.7.tgz#b1fbfe3e16fa809f35f24ef47fde145b018d8cdc" + integrity sha512-aNkotxHx3qPVjiItD9lbNONs4GNzqeeZ98wHtCjd9JWl/g+xNkOVF3xQ8++1qSHPBEYSwKh9URjQH2+CD2XlvQ== dependencies: "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.4" + "@polkadot/x-global" "10.1.7" "@types/websocket" "^1.0.5" websocket "^1.0.34" @@ -972,7 +978,7 @@ resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA== -"@sindresorhus/is@^4.6.0": +"@sindresorhus/is@^4.0.0", "@sindresorhus/is@^4.6.0": version "4.6.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== @@ -999,10 +1005,17 @@ pako "^2.0.4" websocket "^1.0.32" -"@substrate/ss58-registry@^1.24.0", "@substrate/ss58-registry@^1.25.0": - version "1.25.0" - resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.25.0.tgz#0fcd8c9c0e53963a88fbed41f2cbd8a1a5c74cde" - integrity sha512-LmCH4QJRdHaeLsLTPSgJaXguMoIW+Ig9fA9LRPpeya9HefVAJ7gZuUYinldv+QmX7evNm5CL0rspNUS8l1DvXg== +"@substrate/ss58-registry@^1.25.0", "@substrate/ss58-registry@^1.28.0": + version "1.29.0" + resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.29.0.tgz#0dea078271b5318c5eff7176e1df1f9b2c27e43f" + integrity sha512-KTqwZgTjtWPhCAUJJx9qswP/p9cRKUU9GOHYUDKNdISFDiFafWmpI54JHfYLkgjvkSKEUgRZnvLpe0LMF1fXvw== + +"@szmarczak/http-timer@^4.0.5": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807" + integrity sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w== + dependencies: + defer-to-connect "^2.0.0" "@szmarczak/http-timer@^5.0.1": version "5.0.1" @@ -1031,14 +1044,14 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== -"@types/bn.js@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" - integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== +"@types/bn.js@^5.1.0", "@types/bn.js@^5.1.1": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" + integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== dependencies: "@types/node" "*" -"@types/cacheable-request@^6.0.2": +"@types/cacheable-request@^6.0.1", "@types/cacheable-request@^6.0.2": version "6.0.2" resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.2.tgz#c324da0197de0a98a2312156536ae262429ff6b9" integrity sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA== @@ -1097,11 +1110,6 @@ resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== -"@types/json-buffer@~3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/json-buffer/-/json-buffer-3.0.0.tgz#85c1ff0f0948fc159810d4b5be35bf8c20875f64" - integrity sha512-3YP80IxxFJB4b5tYC2SUPwkg0XQLiu0nWvhRgEatgjf+29IcWO9X1k8xRv5DGssJ/lCrjYTjQPcobJr2yWIVuQ== - "@types/json-schema@^7.0.9": version "7.0.11" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" @@ -1128,9 +1136,9 @@ form-data "^3.0.0" "@types/node@*": - version "18.7.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.5.tgz#f1c1d4b7d8231c0278962347163656f9c36f3e83" - integrity sha512-NcKK6Ts+9LqdHJaW6HQmgr7dT/i3GOHG+pt6BiWv++5SnjtRd4NXeiuN2kA153SjhXPR/AhHIPHPbrsbpUVOww== + version "18.7.16" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.16.tgz#0eb3cce1e37c79619943d2fd903919fc30850601" + integrity sha512-EQHhixfu+mkqHMZl1R2Ovuvn47PUw18azMJOTwSZr9/fhzHNGXAJ0ma0dayRVchprpCj0Kc1K1xKoWaATWF1qg== "@types/node@^12.12.6": version "12.20.55" @@ -1171,13 +1179,13 @@ "@types/node" "*" "@typescript-eslint/eslint-plugin@^5.26.0": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.33.1.tgz#c0a480d05211660221eda963cc844732fe9b1714" - integrity sha512-S1iZIxrTvKkU3+m63YUOxYPKaP+yWDQrdhxTglVDVEVBf+aCSw85+BmJnyUaQQsk5TXFG/LpBu9fa+LrAQ91fQ== + version "5.36.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.36.2.tgz#6df092a20e0f9ec748b27f293a12cb39d0c1fe4d" + integrity sha512-OwwR8LRwSnI98tdc2z7mJYgY60gf7I9ZfGjN5EjCwwns9bdTuQfAXcsjSB2wSQ/TVNYSGKf4kzVXbNGaZvwiXw== dependencies: - "@typescript-eslint/scope-manager" "5.33.1" - "@typescript-eslint/type-utils" "5.33.1" - "@typescript-eslint/utils" "5.33.1" + "@typescript-eslint/scope-manager" "5.36.2" + "@typescript-eslint/type-utils" "5.36.2" + "@typescript-eslint/utils" "5.36.2" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -1186,68 +1194,69 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5.26.0": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.33.1.tgz#e4b253105b4d2a4362cfaa4e184e2d226c440ff3" - integrity sha512-IgLLtW7FOzoDlmaMoXdxG8HOCByTBXrB1V2ZQYSEV1ggMmJfAkMWTwUjjzagS6OkfpySyhKFkBw7A9jYmcHpZA== + version "5.36.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.36.2.tgz#3ddf323d3ac85a25295a55fcb9c7a49ab4680ddd" + integrity sha512-qS/Kb0yzy8sR0idFspI9Z6+t7mqk/oRjnAYfewG+VN73opAUvmYL3oPIMmgOX6CnQS6gmVIXGshlb5RY/R22pA== dependencies: - "@typescript-eslint/scope-manager" "5.33.1" - "@typescript-eslint/types" "5.33.1" - "@typescript-eslint/typescript-estree" "5.33.1" + "@typescript-eslint/scope-manager" "5.36.2" + "@typescript-eslint/types" "5.36.2" + "@typescript-eslint/typescript-estree" "5.36.2" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.33.1": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.33.1.tgz#8d31553e1b874210018ca069b3d192c6d23bc493" - integrity sha512-8ibcZSqy4c5m69QpzJn8XQq9NnqAToC8OdH/W6IXPXv83vRyEDPYLdjAlUx8h/rbusq6MkW4YdQzURGOqsn3CA== +"@typescript-eslint/scope-manager@5.36.2": + version "5.36.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.36.2.tgz#a75eb588a3879ae659514780831370642505d1cd" + integrity sha512-cNNP51L8SkIFSfce8B1NSUBTJTu2Ts4nWeWbFrdaqjmn9yKrAaJUBHkyTZc0cL06OFHpb+JZq5AUHROS398Orw== dependencies: - "@typescript-eslint/types" "5.33.1" - "@typescript-eslint/visitor-keys" "5.33.1" + "@typescript-eslint/types" "5.36.2" + "@typescript-eslint/visitor-keys" "5.36.2" -"@typescript-eslint/type-utils@5.33.1": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.33.1.tgz#1a14e94650a0ae39f6e3b77478baff002cec4367" - integrity sha512-X3pGsJsD8OiqhNa5fim41YtlnyiWMF/eKsEZGsHID2HcDqeSC5yr/uLOeph8rNF2/utwuI0IQoAK3fpoxcLl2g== +"@typescript-eslint/type-utils@5.36.2": + version "5.36.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.36.2.tgz#752373f4babf05e993adf2cd543a763632826391" + integrity sha512-rPQtS5rfijUWLouhy6UmyNquKDPhQjKsaKH0WnY6hl/07lasj8gPaH2UD8xWkePn6SC+jW2i9c2DZVDnL+Dokw== dependencies: - "@typescript-eslint/utils" "5.33.1" + "@typescript-eslint/typescript-estree" "5.36.2" + "@typescript-eslint/utils" "5.36.2" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.33.1": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.33.1.tgz#3faef41793d527a519e19ab2747c12d6f3741ff7" - integrity sha512-7K6MoQPQh6WVEkMrMW5QOA5FO+BOwzHSNd0j3+BlBwd6vtzfZceJ8xJ7Um2XDi/O3umS8/qDX6jdy2i7CijkwQ== +"@typescript-eslint/types@5.36.2": + version "5.36.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.36.2.tgz#a5066e500ebcfcee36694186ccc57b955c05faf9" + integrity sha512-9OJSvvwuF1L5eS2EQgFUbECb99F0mwq501w0H0EkYULkhFa19Qq7WFbycdw1PexAc929asupbZcgjVIe6OK/XQ== -"@typescript-eslint/typescript-estree@5.33.1": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.1.tgz#a573bd360790afdcba80844e962d8b2031984f34" - integrity sha512-JOAzJ4pJ+tHzA2pgsWQi4804XisPHOtbvwUyqsuuq8+y5B5GMZs7lI1xDWs6V2d7gE/Ez5bTGojSK12+IIPtXA== +"@typescript-eslint/typescript-estree@5.36.2": + version "5.36.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.36.2.tgz#0c93418b36c53ba0bc34c61fe9405c4d1d8fe560" + integrity sha512-8fyH+RfbKc0mTspfuEjlfqA4YywcwQK2Amcf6TDOwaRLg7Vwdu4bZzyvBZp4bjt1RRjQ5MDnOZahxMrt2l5v9w== dependencies: - "@typescript-eslint/types" "5.33.1" - "@typescript-eslint/visitor-keys" "5.33.1" + "@typescript-eslint/types" "5.36.2" + "@typescript-eslint/visitor-keys" "5.36.2" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.33.1": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.33.1.tgz#171725f924fe1fe82bb776522bb85bc034e88575" - integrity sha512-uphZjkMaZ4fE8CR4dU7BquOV6u0doeQAr8n6cQenl/poMaIyJtBu8eys5uk6u5HiDH01Mj5lzbJ5SfeDz7oqMQ== +"@typescript-eslint/utils@5.36.2": + version "5.36.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.36.2.tgz#b01a76f0ab244404c7aefc340c5015d5ce6da74c" + integrity sha512-uNcopWonEITX96v9pefk9DC1bWMdkweeSsewJ6GeC7L6j2t0SJywisgkr9wUTtXk90fi2Eljj90HSHm3OGdGRg== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.33.1" - "@typescript-eslint/types" "5.33.1" - "@typescript-eslint/typescript-estree" "5.33.1" + "@typescript-eslint/scope-manager" "5.36.2" + "@typescript-eslint/types" "5.36.2" + "@typescript-eslint/typescript-estree" "5.36.2" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.33.1": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.1.tgz#0155c7571c8cd08956580b880aea327d5c34a18b" - integrity sha512-nwIxOK8Z2MPWltLKMLOEZwmfBZReqUdbEoHQXeCpa+sRVARe5twpJGHCB4dk9903Yaf0nMAlGbQfaAH92F60eg== +"@typescript-eslint/visitor-keys@5.36.2": + version "5.36.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.36.2.tgz#2f8f78da0a3bad3320d2ac24965791ac39dace5a" + integrity sha512-BtRvSR6dEdrNt7Net2/XDjbYKU5Ml6GqJgVfXT0CxTCJlnIqK7rAGreuWKMT2t8cFUT2Msv5oxw0GMRD7T5J7A== dependencies: - "@typescript-eslint/types" "5.33.1" + "@typescript-eslint/types" "5.36.2" eslint-visitor-keys "^3.3.0" "@ungap/promise-all-settled@1.1.2": @@ -1621,6 +1630,11 @@ bytes@3.1.2: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== +cacheable-lookup@^5.0.3: + version "5.0.4" + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" + integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== + cacheable-lookup@^6.0.4: version "6.1.0" resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-6.1.0.tgz#0330a543471c61faa4e9035db583aad753b36385" @@ -1658,9 +1672,9 @@ camelcase@^6.0.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001370: - version "1.0.30001377" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001377.tgz#fa446cef27f25decb0c7420759c9ea17a2221a70" - integrity sha512-I5XeHI1x/mRSGl96LFOaSk528LA/yZG3m3iQgImGujjO8gotd/DL8QaI1R1h1dg5ATeI2jqPblMpKq4Tr5iKfQ== + version "1.0.30001393" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001393.tgz#1aa161e24fe6af2e2ccda000fc2b94be0b0db356" + integrity sha512-N/od11RX+Gsk+1qY/jbPa0R6zJupEa0lxeBG598EbrtblxVCTJsQwbRBm6+V+rxpc5lHKdsXb9RY83cZIPLseA== caseless@~0.12.0: version "0.12.0" @@ -1834,14 +1848,6 @@ commondir@^1.0.1: resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== -compress-brotli@^1.3.8: - version "1.3.8" - resolved "https://registry.yarnpkg.com/compress-brotli/-/compress-brotli-1.3.8.tgz#0c0a60c97a989145314ec381e84e26682e7b38db" - integrity sha512-lVcQsjhxhIXsuupfy9fmZUFtAIdBmXA7EGY6GBdgZ++qkM9zG4YFT8iU7FoBxzryNDMOpD1HIFHUSX4D87oqhQ== - dependencies: - "@types/json-buffer" "~3.0.0" - json-buffer "~3.0.1" - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -2016,13 +2022,6 @@ decode-uri-component@^0.2.0: resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og== -decompress-response@^3.2.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" - integrity sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA== - dependencies: - mimic-response "^1.0.0" - decompress-response@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" @@ -2042,7 +2041,7 @@ deep-is@^0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== -defer-to-connect@^2.0.1: +defer-to-connect@^2.0.0, defer-to-connect@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== @@ -2116,11 +2115,6 @@ dom-walk@^0.1.0: resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== -duplexer3@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.5.tgz#0b5e4d7bad5de8901ea4440624c8e1d20099217e" - integrity sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA== - ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -2142,9 +2136,9 @@ ee-first@1.1.1: integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== electron-to-chromium@^1.4.202: - version "1.4.221" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.221.tgz#1ff8425d257a8bfc8269d552a426993c5b525471" - integrity sha512-aWg2mYhpxZ6Q6Xvyk7B2ziBca4YqrCDlXzmcD7wuRs65pVEVkMT1u2ifdjpAQais2O2o0rW964ZWWWYRlAL/kw== + version "1.4.246" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.246.tgz#802132d1bbd3ff32ce82fcd6a6ed6ab59b4366dc" + integrity sha512-/wFCHUE+Hocqr/LlVGsuKLIw4P2lBWwFIDcNMDpJGzyIysQV4aycpoOitAs32FT94EHKnNqDR/CVZJFbXEufJA== elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.3, elliptic@^6.5.4: version "6.5.4" @@ -2177,15 +2171,15 @@ end-of-stream@^1.1.0: once "^1.4.0" es-abstract@^1.19.0, es-abstract@^1.19.5, es-abstract@^1.20.0: - version "1.20.1" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.1.tgz#027292cd6ef44bd12b1913b828116f54787d1814" - integrity sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA== + version "1.20.2" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.2.tgz#8495a07bc56d342a3b8ea3ab01bd986700c2ccb3" + integrity sha512-XxXQuVNrySBNlEkTYJoDNFe5+s2yIOpzq80sUHEdPdQr0S5nTLz4ZPPPswNIpKseDDUS5yghX1gfLIHQZ1iNuQ== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" function-bind "^1.1.1" function.prototype.name "^1.1.5" - get-intrinsic "^1.1.1" + get-intrinsic "^1.1.2" get-symbol-description "^1.0.0" has "^1.0.3" has-property-descriptors "^1.0.0" @@ -2197,9 +2191,9 @@ es-abstract@^1.19.0, es-abstract@^1.19.5, es-abstract@^1.20.0: is-shared-array-buffer "^1.0.2" is-string "^1.0.7" is-weakref "^1.0.2" - object-inspect "^1.12.0" + object-inspect "^1.12.2" object-keys "^1.1.1" - object.assign "^4.1.2" + object.assign "^4.1.4" regexp.prototype.flags "^1.4.3" string.prototype.trimend "^1.0.5" string.prototype.trimstart "^1.0.5" @@ -2299,13 +2293,14 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.16.0: - version "8.22.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.22.0.tgz#78fcb044196dfa7eef30a9d65944f6f980402c48" - integrity sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA== + version "8.23.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.23.0.tgz#a184918d288820179c6041bb3ddcc99ce6eea040" + integrity sha512-pBG/XOn0MsJcKcTRLr27S5HpzQo4kLr+HjLQIyK4EiCsijDl/TB+h5uEuJU6bQ8Edvwz1XWOjpaP2qgnXGpTcA== dependencies: - "@eslint/eslintrc" "^1.3.0" + "@eslint/eslintrc" "^1.3.1" "@humanwhocodes/config-array" "^0.10.4" "@humanwhocodes/gitignore-to-minimatch" "^1.0.2" + "@humanwhocodes/module-importer" "^1.0.1" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -2315,7 +2310,7 @@ eslint@^8.16.0: eslint-scope "^7.1.1" eslint-utils "^3.0.0" eslint-visitor-keys "^3.3.0" - espree "^9.3.3" + espree "^9.4.0" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -2341,12 +2336,11 @@ eslint@^8.16.0: strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" - v8-compile-cache "^2.0.3" -espree@^9.3.2, espree@^9.3.3: - version "9.3.3" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.3.tgz#2dd37c4162bb05f433ad3c1a52ddf8a49dc08e9d" - integrity sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng== +espree@^9.4.0: + version "9.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.0.tgz#cd4bc3d6e9336c433265fc0aa016fc1aaf182f8a" + integrity sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw== dependencies: acorn "^8.8.0" acorn-jsx "^5.3.2" @@ -2518,11 +2512,11 @@ express@^4.14.0: vary "~1.1.2" ext@^1.1.2: - version "1.6.0" - resolved "https://registry.yarnpkg.com/ext/-/ext-1.6.0.tgz#3871d50641e874cc172e2b53f919842d19db4c52" - integrity sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg== + version "1.7.0" + resolved "https://registry.yarnpkg.com/ext/-/ext-1.7.0.tgz#0ea4383c0103d60e70be99e9a7f11027a33c4f5f" + integrity sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw== dependencies: - type "^2.5.0" + type "^2.7.2" extend@~3.0.2: version "3.0.2" @@ -2545,9 +2539,9 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-glob@^3.2.9: - version "3.2.11" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" - integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== + version "3.2.12" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" + integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" @@ -2654,9 +2648,9 @@ flat@^5.0.2: integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== flatted@^3.1.0: - version "3.2.6" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.6.tgz#022e9218c637f9f3fc9c35ab9c9193f05add60b2" - integrity sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ== + version "3.2.7" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" + integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== follow-redirects@^1.12.1: version "1.15.1" @@ -2781,7 +2775,7 @@ get-func-name@^2.0.0: resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.2.tgz#336975123e05ad0b7ba41f152ee4aadbea6cf598" integrity sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA== @@ -2790,11 +2784,6 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: has "^1.0.3" has-symbols "^1.0.3" -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ== - get-stream@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" @@ -2911,25 +2900,22 @@ got@12.1.0: p-cancelable "^3.0.0" responselike "^2.0.0" -got@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" - integrity sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw== - dependencies: - decompress-response "^3.2.0" - duplexer3 "^0.1.4" - get-stream "^3.0.0" - is-plain-obj "^1.1.0" - is-retry-allowed "^1.0.0" - is-stream "^1.0.0" - isurl "^1.0.0-alpha5" - lowercase-keys "^1.0.0" - p-cancelable "^0.3.0" - p-timeout "^1.1.1" - safe-buffer "^5.0.1" - timed-out "^4.0.0" - url-parse-lax "^1.0.0" - url-to-options "^1.0.1" +got@^11.8.5: + version "11.8.5" + resolved "https://registry.yarnpkg.com/got/-/got-11.8.5.tgz#ce77d045136de56e8f024bebb82ea349bc730046" + integrity sha512-o0Je4NvQObAuZPHLFoRSkdG2lTgtcynqymzg2Vupdx6PorhaT5MCbIyXG6d4D94kk8ZG57QeosgdiqfJWhEhlQ== + dependencies: + "@sindresorhus/is" "^4.0.0" + "@szmarczak/http-timer" "^4.0.5" + "@types/cacheable-request" "^6.0.1" + "@types/responselike" "^1.0.0" + cacheable-lookup "^5.0.3" + cacheable-request "^7.0.2" + decompress-response "^6.0.0" + http2-wrapper "^1.0.0-beta.5.2" + lowercase-keys "^2.0.0" + p-cancelable "^2.0.0" + responselike "^2.0.0" graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.2.10" @@ -2988,23 +2974,11 @@ has-property-descriptors@^1.0.0: dependencies: get-intrinsic "^1.1.1" -has-symbol-support-x@^1.4.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" - integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== - has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== -has-to-string-tag-x@^1.2.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" - integrity sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw== - dependencies: - has-symbol-support-x "^1.4.1" - has-tostringtag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" @@ -3080,6 +3054,14 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" +http2-wrapper@^1.0.0-beta.5.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" + integrity sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg== + dependencies: + quick-lru "^5.1.1" + resolve-alpn "^1.0.0" + http2-wrapper@^2.1.10: version "2.1.11" resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-2.1.11.tgz#d7c980c7ffb85be3859b6a96c800b2951ae257ef" @@ -3245,16 +3227,6 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-object@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" - integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA== - -is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== - is-plain-obj@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" @@ -3275,11 +3247,6 @@ is-regex@^1.1.4: call-bind "^1.0.2" has-tostringtag "^1.0.0" -is-retry-allowed@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" - integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg== - is-shared-array-buffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" @@ -3287,11 +3254,6 @@ is-shared-array-buffer@^1.0.2: dependencies: call-bind "^1.0.2" -is-stream@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== - is-string@^1.0.5, is-string@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" @@ -3349,14 +3311,6 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== -isurl@^1.0.0-alpha5: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" - integrity sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w== - dependencies: - has-to-string-tag-x "^1.2.0" - is-object "^1.0.1" - js-sha3@0.8.0, js-sha3@^0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" @@ -3389,7 +3343,7 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -json-buffer@3.0.1, json-buffer@~3.0.1: +json-buffer@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== @@ -3446,11 +3400,10 @@ keccak@^3.0.0: readable-stream "^3.6.0" keyv@^4.0.0: - version "4.3.3" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.3.3.tgz#6c1bcda6353a9e96fc1b4e1aeb803a6e35090ba9" - integrity sha512-AcysI17RvakTh8ir03+a3zJr5r0ovnAH/XTXei/4HIv3bL2K/jzvgivLK9UuI/JbU1aJjM3NSAnVvVVd3n+4DQ== + version "4.5.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.0.tgz#dbce9ade79610b6e641a9a65f2f6499ba06b9bc6" + integrity sha512-2YvuMsA+jnFGtBareKqgANOEKe1mk3HKiXu2fRmAfyxG0MJAywNhi5ttWA3PMjl4NmpyjZNbFifR2vNjW1znfA== dependencies: - compress-brotli "^1.3.8" json-buffer "3.0.1" kind-of@^6.0.2: @@ -3506,11 +3459,6 @@ loupe@^2.3.1: dependencies: get-func-name "^2.0.0" -lowercase-keys@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" - integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== - lowercase-keys@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" @@ -3885,7 +3833,7 @@ object-assign@^4, object-assign@^4.1.0, object-assign@^4.1.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-inspect@^1.12.0, object-inspect@^1.9.0: +object-inspect@^1.12.2, object-inspect@^1.9.0: version "1.12.2" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== @@ -3895,10 +3843,10 @@ object-keys@^1.1.1: resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== -object.assign@^4.1.2: - version "4.1.3" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.3.tgz#d36b7700ddf0019abb6b1df1bb13f6445f79051f" - integrity sha512-ZFJnX3zltyjcYJL0RoCJuzb+11zWGyaDbjgxZbdV7rFEcHQuYxrZqhow67aA7xpes6LhojyFDaBKAFfogQrikA== +object.assign@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" + integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" @@ -3943,21 +3891,16 @@ os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== -p-cancelable@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" - integrity sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw== +p-cancelable@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" + integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== p-cancelable@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-3.0.0.tgz#63826694b54d61ca1c20ebcb6d3ecf5e14cd8050" integrity sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw== -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== - p-limit@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -3986,13 +3929,6 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" -p-timeout@^1.1.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" - integrity sha512-gb0ryzr+K2qFqFv6qi3khoeqMZF/+ajxQipEF6NteZVnvz9tzdsfAVj3lYtn1gAXvH5lfLwfxEII799gt/mRIA== - dependencies: - p-finally "^1.0.0" - p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -4114,11 +4050,6 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prepend-http@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - integrity sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg== - process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" @@ -4299,7 +4230,7 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== -resolve-alpn@^1.2.0: +resolve-alpn@^1.0.0, resolve-alpn@^1.2.0: version "1.2.1" resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== @@ -4641,15 +4572,15 @@ supports-color@^7.1.0: has-flag "^4.0.0" swarm-js@^0.1.40: - version "0.1.40" - resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.40.tgz#b1bc7b6dcc76061f6c772203e004c11997e06b99" - integrity sha512-yqiOCEoA4/IShXkY3WKwP5PvZhmoOOD8clsKA7EEcRILMkTEYHCQ21HDCAcVpmIxZq4LyZvWeRJ6quIyHk1caA== + version "0.1.42" + resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.42.tgz#497995c62df6696f6e22372f457120e43e727979" + integrity sha512-BV7c/dVlA3R6ya1lMlSSNPLYrntt0LUq4YMgy3iwpCIc6rZnS5W2wUoctarZ5pXlpKtxDDf9hNziEkcfrxdhqQ== dependencies: bluebird "^3.5.0" buffer "^5.0.5" eth-lib "^0.1.26" fs-extra "^4.0.2" - got "^7.1.0" + got "^11.8.5" mime-types "^2.1.16" mkdirp-promise "^5.0.1" mock-fs "^4.1.0" @@ -4675,7 +4606,7 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== -timed-out@^4.0.0, timed-out@^4.0.1: +timed-out@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" integrity sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA== @@ -4800,7 +4731,7 @@ type@^1.0.1: resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== -type@^2.5.0: +type@^2.7.2: version "2.7.2" resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== @@ -4813,14 +4744,14 @@ typedarray-to-buffer@^3.1.5: is-typedarray "^1.0.0" typescript@^4.7.2: - version "4.7.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" - integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== + version "4.8.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.3.tgz#d59344522c4bc464a65a730ac695007fdb66dd88" + integrity sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig== uglify-js@^3.1.4: - version "3.16.3" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.16.3.tgz#94c7a63337ee31227a18d03b8a3041c210fd1f1d" - integrity sha512-uVbFqx9vvLhQg0iBaau9Z75AxWJ8tqM9AV890dIZCLApF4rTcyHwmAvLeEdYRs+BzYWu8Iw81F79ah0EfTXbaw== + version "3.17.0" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.0.tgz#55bd6e9d19ce5eef0d5ad17cd1f587d85b180a85" + integrity sha512-aTeNPVmgIMPpm1cxXr2Q/nEbvkmV8yq66F3om7X3P/cvOXQ0TMQ64Wk63iyT1gPlmdmGzjGpyLh1f3y8MZWXGg== ultron@~1.1.0: version "1.1.1" @@ -4848,9 +4779,9 @@ unpipe@1.0.0, unpipe@~1.0.0: integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== update-browserslist-db@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.5.tgz#be06a5eedd62f107b7c19eb5bcefb194411abf38" - integrity sha512-dteFFpCyvuDdr9S/ff1ISkKt/9YZxKjI9WlRR99c180GaztJtRa/fn18FdxGVKVsnPY7/a/FDN68mcvUmP4U7Q== + version "1.0.7" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.7.tgz#16279639cff1d0f800b14792de43d97df2d11b7d" + integrity sha512-iN/XYesmZ2RmmWAiI4Z5rq0YqSiv0brj9Ce9CfhNE4xIW2h+MFxcgkxIzZ+ShkFPUkjU3gQ+3oypadD3RAMtrg== dependencies: escalade "^3.1.1" picocolors "^1.0.0" @@ -4862,23 +4793,11 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -url-parse-lax@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" - integrity sha512-BVA4lR5PIviy2PMseNd2jbFQ+jwSwQGdJejf5ctd1rEXt0Ypd7yanUK9+lYechVlN5VaTJGsu2U/3MDDu6KgBA== - dependencies: - prepend-http "^1.0.1" - url-set-query@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339" integrity sha512-3AChu4NiXquPfeckE5R5cGdiHCMWJx1dwCWOmWIL4KHAziJNOFIYJlpGFeKDvwLPHovZRCxK3cYlwzqI9Vp+Gg== -url-to-options@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" - integrity sha512-0kQLIzG4fdk/G5NONku64rSH/x32NOA39LVQqlK8Le6lvTF6GGRJpqaQFGgU+CLwySIqBSMdwYM0sYcW9f6P4A== - utf-8-validate@^5.0.2: version "5.0.9" resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.9.tgz#ba16a822fbeedff1a58918f2a6a6b36387493ea3" @@ -4928,11 +4847,6 @@ v8-compile-cache-lib@^3.0.1: resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== -v8-compile-cache@^2.0.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" - integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== - varint@^5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" From c06769863b129dd717f124bbe6254e5ecfba2903 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 9 Sep 2022 20:38:32 +0000 Subject: [PATCH 0836/1274] tests: fix package versions again properly --- tests/package.json | 3 +- tests/yarn.lock | 80 +--------------------------------------------- 2 files changed, 3 insertions(+), 80 deletions(-) diff --git a/tests/package.json b/tests/package.json index 65e5d90e65..b4486632f9 100644 --- a/tests/package.json +++ b/tests/package.json @@ -71,6 +71,7 @@ "testRemoveFromContractAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/removeFromContractAllowList.test.ts", "testSetContractSponsoringRateLimit": "mocha --timeout 9999999 -r ts-node/register ./**/setContractSponsoringRateLimit.test.ts", "testSetOffchainSchema": "mocha --timeout 9999999 -r ts-node/register ./**/setOffchainSchema.test.ts", + "testNextSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/nextSponsoring.test.ts", "testOverflow": "mocha --timeout 9999999 -r ts-node/register ./**/overflow.test.ts", "testInflation": "mocha --timeout 9999999 -r ts-node/register ./**/inflation.test.ts", "testScheduler": "mocha --timeout 9999999 -r ts-node/register ./**/scheduler.test.ts", @@ -97,7 +98,7 @@ "dependencies": { "@polkadot/api": "9.2.2", "@polkadot/api-contract": "9.2.2", - "@polkadot/util-crypto": "10.1.4", + "@polkadot/util-crypto": "10.1.7", "bignumber.js": "^9.0.2", "chai-as-promised": "^7.1.1", "chai-like": "^1.1.1", diff --git a/tests/yarn.lock b/tests/yarn.lock index 4951f3ac39..e260dc1ea4 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -611,15 +611,6 @@ "@polkadot/util" "10.1.7" "@polkadot/util-crypto" "10.1.7" -"@polkadot/networks@10.1.4": - version "10.1.4" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.1.4.tgz#d8b375aad8f858f611165d8288eb5eab7275ca24" - integrity sha512-5wMwqD+DeVMh29OZZBVkA4DQE9EBsUj5FjmUS2CloA8RzE6SV0qL34zhTwOdq95KJV1OoDbp9aGjCBqhEuozKw== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/util" "10.1.4" - "@substrate/ss58-registry" "^1.25.0" - "@polkadot/networks@10.1.7", "@polkadot/networks@^10.1.4": version "10.1.7" resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.1.7.tgz#33b38d70409e2daf0990ef18ff150c6718ffb700" @@ -764,23 +755,6 @@ "@polkadot/util-crypto" "^10.1.4" rxjs "^7.5.6" -"@polkadot/util-crypto@10.1.4": - version "10.1.4" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.1.4.tgz#1d65a9b3d979f1cb078636a413cdf664db760a8b" - integrity sha512-6rdUwCdbwmQ0PBWBNYh55RsXAcFjhco/TGLuM7GJ7YufrN9qqv1sr40HlneLbtpiZnfukZ3q/qOpj0h7Hrw2JQ== - dependencies: - "@babel/runtime" "^7.18.9" - "@noble/hashes" "1.1.2" - "@noble/secp256k1" "1.6.3" - "@polkadot/networks" "10.1.4" - "@polkadot/util" "10.1.4" - "@polkadot/wasm-crypto" "^6.3.1" - "@polkadot/x-bigint" "10.1.4" - "@polkadot/x-randomvalues" "10.1.4" - "@scure/base" "1.1.1" - ed2curve "^0.3.0" - tweetnacl "^1.0.3" - "@polkadot/util-crypto@10.1.7", "@polkadot/util-crypto@^10.1.4": version "10.1.7" resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.1.7.tgz#fe5ea006bf23ae19319f3ac9236905a984a65e2f" @@ -798,19 +772,6 @@ ed2curve "^0.3.0" tweetnacl "^1.0.3" -"@polkadot/util@10.1.4": - version "10.1.4" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.1.4.tgz#29654dd52d5028fd9ca175e9cebad605fa79396c" - integrity sha512-MHz1UxYXuV+XxPl+GR++yOUE0OCiVd+eJBqLgpjpVJNRkudbAmfGAbB2TNR0+76M0fevIeHj4DGEd0gY6vqKLw== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-bigint" "10.1.4" - "@polkadot/x-global" "10.1.4" - "@polkadot/x-textdecoder" "10.1.4" - "@polkadot/x-textencoder" "10.1.4" - "@types/bn.js" "^5.1.0" - bn.js "^5.2.1" - "@polkadot/util@10.1.7", "@polkadot/util@^10.1.4": version "10.1.7" resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.1.7.tgz#c54ca2a5b29cb834b40d8a876baefa3a0efb93af" @@ -875,14 +836,6 @@ dependencies: "@babel/runtime" "^7.18.9" -"@polkadot/x-bigint@10.1.4": - version "10.1.4" - resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.1.4.tgz#a084a9d2f80f25ffd529faafdf95cd6c3044ef74" - integrity sha512-qgLetTukFhkxNxNcUWMmnrfE9bp4TNbrqNoVBVH7wqSuEVpDPITBXsQ/78LbaaZGWD80Ew0wGxcZ/rqX+dLVUA== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.4" - "@polkadot/x-bigint@10.1.7", "@polkadot/x-bigint@^10.1.4": version "10.1.7" resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.1.7.tgz#1338689476ffdbb9f9cb243df1954ae8186134b9" @@ -901,13 +854,6 @@ "@types/node-fetch" "^2.6.2" node-fetch "^3.2.10" -"@polkadot/x-global@10.1.4": - version "10.1.4" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.1.4.tgz#657f7054fe07a7c027b4d18fcfa3438d2ffaef07" - integrity sha512-67f53H872wHvmjmL96DvhC3dG7gKRG1ghEbHXeFIGwkix+9zGEMV9krYW1+OAvGAuCQZqUIUGiJ7lad4Zjb7wQ== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global@10.1.7", "@polkadot/x-global@^10.1.4": version "10.1.7" resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.1.7.tgz#91a472ac2f83fd0858dcd0df528844a5b650790e" @@ -915,14 +861,6 @@ dependencies: "@babel/runtime" "^7.18.9" -"@polkadot/x-randomvalues@10.1.4": - version "10.1.4" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.1.4.tgz#de337a046826223081697e6fc1991c547f685787" - integrity sha512-sfYz3GmyG739anj07Y+8PUX+95upO1zlsADAEfK1w1mMpTw97xEoMZf66CduAQOe43gEwQXc/JuKq794C/Hr7Q== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.4" - "@polkadot/x-randomvalues@10.1.7": version "10.1.7" resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.1.7.tgz#d537f1f7bf3fb03e6c08ae6e6ac36e069c1f9844" @@ -931,14 +869,6 @@ "@babel/runtime" "^7.18.9" "@polkadot/x-global" "10.1.7" -"@polkadot/x-textdecoder@10.1.4": - version "10.1.4" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.1.4.tgz#d85028f6fcd00adc1e3581ab97668a61299270f9" - integrity sha512-B8XcAmJLnuppSr4RUNPevh5MH3tWZBwBR0wUsSdIyiGXuncgnkj9jmpbGLgV1tSn+BGxX3SNsRho3/4CNmndWQ== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.4" - "@polkadot/x-textdecoder@10.1.7": version "10.1.7" resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.1.7.tgz#1dd4e6141b1669acdd321a4da1fc6fdc271b7908" @@ -947,14 +877,6 @@ "@babel/runtime" "^7.18.9" "@polkadot/x-global" "10.1.7" -"@polkadot/x-textencoder@10.1.4": - version "10.1.4" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.1.4.tgz#253e828bb571eb2a92a8377acd57d9bfcbe52fe8" - integrity sha512-vDpo0rVV4jBmr0L2tCZPZzxmzV2vZhpH1Dw9H7MpmZSPePz4ZF+o4RBJz/ocwQh3+1qV1SKQm7+fj4lPwUZdEw== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.4" - "@polkadot/x-textencoder@10.1.7": version "10.1.7" resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.1.7.tgz#b208601f33b936c7a059f126dbb6b26a87f45864" @@ -1005,7 +927,7 @@ pako "^2.0.4" websocket "^1.0.32" -"@substrate/ss58-registry@^1.25.0", "@substrate/ss58-registry@^1.28.0": +"@substrate/ss58-registry@^1.28.0": version "1.29.0" resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.29.0.tgz#0dea078271b5318c5eff7176e1df1f9b2c27e43f" integrity sha512-KTqwZgTjtWPhCAUJJx9qswP/p9cRKUU9GOHYUDKNdISFDiFafWmpI54JHfYLkgjvkSKEUgRZnvLpe0LMF1fXvw== From f5b44a97b52087c4b1b49a073896f474d544c43b Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 9 Sep 2022 20:49:50 +0000 Subject: [PATCH 0837/1274] tests: refactorr playgrounds' minting signature for shorter mint for self --- tests/src/fungible.test.ts | 14 +- tests/src/limits.test.ts | 369 +++++++++++++-------------- tests/src/nextSponsoring.test.ts | 122 ++++----- tests/src/refungible.test.ts | 24 +- tests/src/rpc.test.ts | 2 +- tests/src/transfer.test.ts | 36 +-- tests/src/transferFrom.test.ts | 38 +-- tests/src/util/playgrounds/unique.ts | 18 +- 8 files changed, 300 insertions(+), 323 deletions(-) diff --git a/tests/src/fungible.test.ts b/tests/src/fungible.test.ts index d3bc3a00b7..89bd4e0304 100644 --- a/tests/src/fungible.test.ts +++ b/tests/src/fungible.test.ts @@ -35,7 +35,7 @@ describe('integration test: Fungible functionality:', () => { const defaultTokenId = await collection.getLastTokenId(); expect(defaultTokenId).to.be.equal(0); - await collection.mint(alice, {Substrate: alice.address}, U128_MAX); + await collection.mint(alice, U128_MAX); const aliceBalance = await collection.getBalance({Substrate: alice.address}); const itemCountAfter = await collection.getLastTokenId(); @@ -49,7 +49,7 @@ describe('integration test: Fungible functionality:', () => { const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - await collection.mint(alice, {Substrate: alice.address}, U128_MAX); + await collection.mint(alice, U128_MAX); await collection.transfer(alice, {Substrate: bob.address}, 1000n); await collection.transfer(alice, ethAcc, 900n); @@ -72,7 +72,7 @@ describe('integration test: Fungible functionality:', () => { itSub('Transfer token', async ({helper}) => { const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - await collection.mint(alice, {Substrate: alice.address}, 500n); + await collection.mint(alice, 500n); expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(500n); expect(await collection.transfer(alice, {Substrate: bob.address}, 60n)).to.be.true; @@ -88,7 +88,7 @@ describe('integration test: Fungible functionality:', () => { itSub('Tokens multiple creation', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - await collection.mintWithOneOwner(alice, {Substrate: alice.address}, [ + await collection.mintWithOneOwner(alice, [ {value: 500n}, {value: 400n}, {value: 300n}, @@ -99,7 +99,7 @@ describe('integration test: Fungible functionality:', () => { itSub('Burn some tokens ', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - await collection.mint(alice, {Substrate: alice.address}, 500n); + await collection.mint(alice, 500n); expect(await collection.isTokenExists(0)).to.be.true; expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(500n); @@ -110,7 +110,7 @@ describe('integration test: Fungible functionality:', () => { itSub('Burn all tokens ', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - await collection.mint(alice, {Substrate: alice.address}, 500n); + await collection.mint(alice, 500n); expect(await collection.isTokenExists(0)).to.be.true; expect(await collection.burnTokens(alice, 500n)).to.be.true; @@ -123,7 +123,7 @@ describe('integration test: Fungible functionality:', () => { itSub('Set allowance for token', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; - await collection.mint(alice, {Substrate: alice.address}, 100n); + await collection.mint(alice, 100n); expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(100n); diff --git a/tests/src/limits.test.ts b/tests/src/limits.test.ts index 1909785482..14c2c4ed9e 100644 --- a/tests/src/limits.test.ts +++ b/tests/src/limits.test.ts @@ -15,54 +15,41 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import usingApi from './substrate/substrate-api'; -import { - createCollectionExpectSuccess, - destroyCollectionExpectSuccess, - setCollectionLimitsExpectSuccess, - setCollectionSponsorExpectSuccess, - confirmSponsorshipExpectSuccess, - createItemExpectSuccess, - createItemExpectFailure, - transferExpectSuccess, - getFreeBalance, - waitNewBlocks, burnItemExpectSuccess, - requirePallets, - Pallets, -} from './util/helpers'; -import {expect} from 'chai'; +import {expect, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util/playgrounds'; describe('Number of tokens per address (NFT)', () => { let alice: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); }); }); - it.skip('Collection limits allow greater number than chain limits, chain limits are enforced', async () => { - - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {accountTokenOwnershipLimit: 20}); + itSub.skip('Collection limits allow greater number than chain limits, chain limits are enforced', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {}); + await collection.setLimits(alice, {accountTokenOwnershipLimit: 20}); + for(let i = 0; i < 10; i++){ - await createItemExpectSuccess(alice, collectionId, 'NFT'); + await expect(collection.mintToken(alice)).to.be.not.rejected; } - await createItemExpectFailure(alice, collectionId, 'NFT'); + await expect(collection.mintToken(alice)).to.be.rejectedWith(/common\.AccountTokenLimitExceeded/); for(let i = 1; i < 11; i++) { - await burnItemExpectSuccess(alice, collectionId, i); + await expect(collection.burnToken(alice, i)).to.be.not.rejected; } - await destroyCollectionExpectSuccess(collectionId); + await collection.burn(alice); }); - - it('Collection limits allow lower number than chain limits, collection limits are enforced', async () => { - - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {accountTokenOwnershipLimit: 1}); - await createItemExpectSuccess(alice, collectionId, 'NFT'); - await createItemExpectFailure(alice, collectionId, 'NFT'); - await burnItemExpectSuccess(alice, collectionId, 1); - await destroyCollectionExpectSuccess(collectionId); + + itSub('Collection limits allow lower number than chain limits, collection limits are enforced', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {}); + await collection.setLimits(alice, {accountTokenOwnershipLimit: 1}); + + await collection.mintToken(alice); + await expect(collection.mintToken(alice)).to.be.rejectedWith(/common\.AccountTokenLimitExceeded/); + + await collection.burnToken(alice, 1); + await expect(collection.burn(alice)).to.be.not.rejected; }); }); @@ -70,38 +57,43 @@ describe('Number of tokens per address (ReFungible)', () => { let alice: IKeyringPair; before(async function() { - await requirePallets(this, [Pallets.ReFungible]); + await usingPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); + const donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); }); }); - it.skip('Collection limits allow greater number than chain limits, chain limits are enforced', async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {accountTokenOwnershipLimit: 20}); + itSub.skip('Collection limits allow greater number than chain limits, chain limits are enforced', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {}); + await collection.setLimits(alice, {accountTokenOwnershipLimit: 20}); + for(let i = 0; i < 10; i++){ - await createItemExpectSuccess(alice, collectionId, 'ReFungible'); + await expect(collection.mintToken(alice, 10n)).to.be.not.rejected; } - await createItemExpectFailure(alice, collectionId, 'ReFungible'); + await expect(collection.mintToken(alice, 10n)).to.be.rejectedWith(/common\.AccountTokenLimitExceeded/); for(let i = 1; i < 11; i++) { - await burnItemExpectSuccess(alice, collectionId, i, 100); + await expect(collection.burnToken(alice, i, 10n)).to.be.not.rejected; } - await destroyCollectionExpectSuccess(collectionId); + await collection.burn(alice); }); - it('Collection limits allow lower number than chain limits, collection limits are enforced', async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {accountTokenOwnershipLimit: 1}); - await createItemExpectSuccess(alice, collectionId, 'ReFungible'); - await createItemExpectFailure(alice, collectionId, 'ReFungible'); - await burnItemExpectSuccess(alice, collectionId, 1, 100); - await destroyCollectionExpectSuccess(collectionId); + itSub('Collection limits allow lower number than chain limits, collection limits are enforced', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {}); + await collection.setLimits(alice, {accountTokenOwnershipLimit: 1}); + + await collection.mintToken(alice); + await expect(collection.mintToken(alice)).to.be.rejectedWith(/common\.AccountTokenLimitExceeded/); + + await collection.burnToken(alice, 1); + await expect(collection.burn(alice)).to.be.not.rejected; }); }); +// todo:playgrounds skipped ~ postponed describe.skip('Sponsor timeout (NFT) (only for special chain limits test)', () => { - let alice: IKeyringPair; + /*let alice: IKeyringPair; let bob: IKeyringPair; let charlie: IKeyringPair; @@ -113,7 +105,7 @@ describe.skip('Sponsor timeout (NFT) (only for special chain limits test)', () = }); }); - it.skip('Collection limits have greater timeout value than chain limits, collection limits are enforced', async () => { + itSub.skip('Collection limits have greater timeout value than chain limits, collection limits are enforced', async ({helper}) => { const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsorTransferTimeout: 7}); const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT'); @@ -137,7 +129,7 @@ describe.skip('Sponsor timeout (NFT) (only for special chain limits test)', () = await destroyCollectionExpectSuccess(collectionId); }); - it('Collection limits have lower timeout value than chain limits, chain limits are enforced', async () => { + itSub('Collection limits have lower timeout value than chain limits, chain limits are enforced', async ({helper}) => { const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsorTransferTimeout: 1}); @@ -176,7 +168,7 @@ describe.skip('Sponsor timeout (Fungible) (only for special chain limits test)', }); }); - it('Collection limits have greater timeout value than chain limits, collection limits are enforced', async () => { + itSub('Collection limits have greater timeout value than chain limits, collection limits are enforced', async ({helper}) => { const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsorTransferTimeout: 7}); const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible'); @@ -202,7 +194,7 @@ describe.skip('Sponsor timeout (Fungible) (only for special chain limits test)', await destroyCollectionExpectSuccess(collectionId); }); - it('Collection limits have lower timeout value than chain limits, chain limits are enforced', async () => { + itSub('Collection limits have lower timeout value than chain limits, chain limits are enforced', async ({helper}) => { const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsorTransferTimeout: 1}); @@ -243,7 +235,7 @@ describe.skip('Sponsor timeout (ReFungible) (only for special chain limits test) }); }); - it('Collection limits have greater timeout value than chain limits, collection limits are enforced', async () => { + itSub('Collection limits have greater timeout value than chain limits, collection limits are enforced', async ({helper}) => { const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsorTransferTimeout: 7}); const tokenId = await createItemExpectSuccess(alice, collectionId, 'ReFungible'); @@ -267,7 +259,7 @@ describe.skip('Sponsor timeout (ReFungible) (only for special chain limits test) await destroyCollectionExpectSuccess(collectionId); }); - it('Collection limits have lower timeout value than chain limits, chain limits are enforced', async () => { + itSub('Collection limits have lower timeout value than chain limits, chain limits are enforced', async ({helper}) => { const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsorTransferTimeout: 1}); @@ -290,7 +282,7 @@ describe.skip('Sponsor timeout (ReFungible) (only for special chain limits test) expect(aliceBalanceAfterSponsoredTransaction < aliceBalanceBefore).to.be.true; //expect(aliceBalanceAfterSponsoredTransaction).to.be.lessThan(aliceBalanceBefore); await destroyCollectionExpectSuccess(collectionId); - }); + });*/ }); describe('Collection zero limits (NFT)', () => { @@ -299,38 +291,38 @@ describe('Collection zero limits (NFT)', () => { let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); }); - it.skip('Limits have 0 in tokens per address field, the chain limits are applied', async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {accountTokenOwnershipLimit: 0}); + itSub.skip('Limits have 0 in tokens per address field, the chain limits are applied', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {}); + await collection.setLimits(alice, {accountTokenOwnershipLimit: 0}); + for(let i = 0; i < 10; i++){ - await createItemExpectSuccess(alice, collectionId, 'NFT'); + await collection.mintToken(alice); } - await createItemExpectFailure(alice, collectionId, 'NFT'); + await expect(collection.mintToken(alice)).to.be.rejectedWith(/common\.AccountTokenLimitExceeded/); }); - it('Limits have 0 in sponsor timeout, no limits are applied', async () => { + itSub('Limits have 0 in sponsor timeout, no limits are applied', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {}); + await collection.setLimits(alice, {sponsorTransferTimeout: 0}); + const token = await collection.mintToken(alice); - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsorTransferTimeout: 0}); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT'); - await setCollectionSponsorExpectSuccess(collectionId, alice.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Alice'); - await transferExpectSuccess(collectionId, tokenId, alice, bob); - const aliceBalanceBefore = await getFreeBalance(alice); + await collection.setSponsor(alice, alice.address); + await collection.confirmSponsorship(alice); + + await token.transfer(alice, {Substrate: bob.address}); + const aliceBalanceBefore = await helper.balance.getSubstrate(alice.address); // check setting SponsorTimeout = 0, success with next block - await waitNewBlocks(1); - await transferExpectSuccess(collectionId, tokenId, bob, charlie); - const aliceBalanceAfterSponsoredTransaction1 = await getFreeBalance(alice); + await helper.wait.newBlocks(1); + await token.transfer(bob, {Substrate: charlie.address}); + const aliceBalanceAfterSponsoredTransaction1 = await helper.balance.getSubstrate(alice.address); expect(aliceBalanceAfterSponsoredTransaction1 < aliceBalanceBefore).to.be.true; - //expect(aliceBalanceAfterSponsoredTransaction1).to.be.lessThan(aliceBalanceBefore); }); }); @@ -340,29 +332,28 @@ describe('Collection zero limits (Fungible)', () => { let charlie: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); }); - it('Limits have 0 in sponsor timeout, no limits are applied', async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsorTransferTimeout: 0}); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible'); - await setCollectionSponsorExpectSuccess(collectionId, alice.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Alice'); - await transferExpectSuccess(collectionId, tokenId, alice, bob, 10, 'Fungible'); - const aliceBalanceBefore = await getFreeBalance(alice); - await transferExpectSuccess(collectionId, tokenId, bob, charlie, 2, 'Fungible'); + itSub('Limits have 0 in sponsor timeout, no limits are applied', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {}); + await collection.setLimits(alice, {sponsorTransferTimeout: 0}); + await collection.mint(alice, 3n); + + await collection.setSponsor(alice, alice.address); + await collection.confirmSponsorship(alice); + + await collection.transfer(alice, {Substrate: bob.address}, 2n); + const aliceBalanceBefore = await helper.balance.getSubstrate(alice.address); // check setting SponsorTimeout = 0, success with next block - await waitNewBlocks(1); - await transferExpectSuccess(collectionId, tokenId, bob, charlie, 2, 'Fungible'); - const aliceBalanceAfterSponsoredTransaction1 = await getFreeBalance(alice); + await helper.wait.newBlocks(1); + await collection.transfer(bob, {Substrate: charlie.address}); + const aliceBalanceAfterSponsoredTransaction1 = await helper.balance.getSubstrate(alice.address); expect(aliceBalanceAfterSponsoredTransaction1 < aliceBalanceBefore).to.be.true; - //expect(aliceBalanceAfterSponsoredTransaction1).to.be.lessThan(aliceBalanceBefore); }); }); @@ -372,110 +363,112 @@ describe('Collection zero limits (ReFungible)', () => { let charlie: IKeyringPair; before(async function() { - await requirePallets(this, [Pallets.ReFungible]); + await usingPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); }); - it.skip('Limits have 0 in tokens per address field, the chain limits are applied', async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {accountTokenOwnershipLimit: 0}); + itSub.skip('Limits have 0 in tokens per address field, the chain limits are applied', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {}); + await collection.setLimits(alice, {accountTokenOwnershipLimit: 0}); for(let i = 0; i < 10; i++){ - await createItemExpectSuccess(alice, collectionId, 'ReFungible'); + await collection.mintToken(alice); } - await createItemExpectFailure(alice, collectionId, 'ReFungible'); + await expect(collection.mintToken(alice)).to.be.rejectedWith(/common\.AccountTokenLimitExceeded/); }); - it('Limits have 0 in sponsor timeout, no limits are applied', async () => { + itSub('Limits have 0 in sponsor timeout, no limits are applied', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {}); + await collection.setLimits(alice, {sponsorTransferTimeout: 0}); + const token = await collection.mintToken(alice, 3n); - const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsorTransferTimeout: 0}); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'ReFungible'); - await setCollectionSponsorExpectSuccess(collectionId, alice.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Alice'); - await transferExpectSuccess(collectionId, tokenId, alice, bob, 100, 'ReFungible'); - await transferExpectSuccess(collectionId, tokenId, bob, charlie, 20, 'ReFungible'); - const aliceBalanceBefore = await getFreeBalance(alice); + await collection.setSponsor(alice, alice.address); + await collection.confirmSponsorship(alice); + + await token.transfer(alice, {Substrate: bob.address}, 2n); + const aliceBalanceBefore = await helper.balance.getSubstrate(alice.address); // check setting SponsorTimeout = 0, success with next block - await waitNewBlocks(1); - await transferExpectSuccess(collectionId, tokenId, bob, charlie, 20, 'ReFungible'); - const aliceBalanceAfterSponsoredTransaction1 = await getFreeBalance(alice); + await helper.wait.newBlocks(1); + await token.transfer(bob, {Substrate: charlie.address}); + const aliceBalanceAfterSponsoredTransaction1 = await helper.balance.getSubstrate(alice.address); expect(aliceBalanceAfterSponsoredTransaction1 < aliceBalanceBefore).to.be.true; - //expect(aliceBalanceAfterSponsoredTransaction1).to.be.lessThan(aliceBalanceBefore); }); - - it('Effective collection limits', async () => { - await usingApi(async (api) => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true}); - - { // Check that limits is undefined - const collection = await api.rpc.unique.collectionById(collectionId); - expect(collection.isSome).to.be.true; - const limits = collection.unwrap().limits; - expect(limits).to.be.any; - - expect(limits.accountTokenOwnershipLimit.toHuman()).to.be.null; - expect(limits.sponsoredDataSize.toHuman()).to.be.null; - expect(limits.sponsoredDataRateLimit.toHuman()).to.be.null; - expect(limits.tokenLimit.toHuman()).to.be.null; - expect(limits.sponsorTransferTimeout.toHuman()).to.be.null; - expect(limits.sponsorApproveTimeout.toHuman()).to.be.null; - expect(limits.ownerCanTransfer.toHuman()).to.be.true; - expect(limits.ownerCanDestroy.toHuman()).to.be.null; - expect(limits.transfersEnabled.toHuman()).to.be.null; - } - - { // Check that limits is undefined for non-existent collection - const limits = await api.rpc.unique.effectiveCollectionLimits(11111); - expect(limits.toHuman()).to.be.null; - } - - { // Check that default values defined for collection limits - const limitsOpt = await api.rpc.unique.effectiveCollectionLimits(collectionId); - expect(limitsOpt.isNone).to.be.false; - const limits = limitsOpt.unwrap(); - - expect(limits.accountTokenOwnershipLimit.toHuman()).to.be.eq('100,000'); - expect(limits.sponsoredDataSize.toHuman()).to.be.eq('2,048'); - expect(limits.sponsoredDataRateLimit.toHuman()).to.be.eq('SponsoringDisabled'); - expect(limits.tokenLimit.toHuman()).to.be.eq('4,294,967,295'); - expect(limits.sponsorTransferTimeout.toHuman()).to.be.eq('5'); - expect(limits.sponsorApproveTimeout.toHuman()).to.be.eq('5'); - expect(limits.ownerCanTransfer.toHuman()).to.be.true; - expect(limits.ownerCanDestroy.toHuman()).to.be.true; - expect(limits.transfersEnabled.toHuman()).to.be.true; - } - - { //Check the values for collection limits - await setCollectionLimitsExpectSuccess(alice, collectionId, { - accountTokenOwnershipLimit: 99_999, - sponsoredDataSize: 1024, - tokenLimit: 123, - transfersEnabled: false, - }); - - const limitsOpt = await api.rpc.unique.effectiveCollectionLimits(collectionId); - expect(limitsOpt.isNone).to.be.false; - const limits = limitsOpt.unwrap(); - - expect(limits.accountTokenOwnershipLimit.toHuman()).to.be.eq('99,999'); - expect(limits.sponsoredDataSize.toHuman()).to.be.eq('1,024'); - expect(limits.sponsoredDataRateLimit.toHuman()).to.be.eq('SponsoringDisabled'); - expect(limits.tokenLimit.toHuman()).to.be.eq('123'); - expect(limits.sponsorTransferTimeout.toHuman()).to.be.eq('5'); - expect(limits.sponsorApproveTimeout.toHuman()).to.be.eq('5'); - expect(limits.ownerCanTransfer.toHuman()).to.be.true; - expect(limits.ownerCanDestroy.toHuman()).to.be.true; - expect(limits.transfersEnabled.toHuman()).to.be.false; - } +}); + +describe('Effective collection limits (NFT)', () => { + let alice: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); }); }); -}); + + itSub('Effective collection limits', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {}); + await collection.setLimits(alice, {ownerCanTransfer: true}); + + { + // Check that limits are undefined + const collectionInfo = await collection.getData(); + const limits = collectionInfo?.raw.limits; + expect(limits).to.be.any; + + expect(limits.accountTokenOwnershipLimit).to.be.null; + expect(limits.sponsoredDataSize).to.be.null; + expect(limits.sponsoredDataRateLimit).to.be.null; + expect(limits.tokenLimit).to.be.null; + expect(limits.sponsorTransferTimeout).to.be.null; + expect(limits.sponsorApproveTimeout).to.be.null; + expect(limits.ownerCanTransfer).to.be.true; + expect(limits.ownerCanDestroy).to.be.null; + expect(limits.transfersEnabled).to.be.null; + } + + { // Check that limits is undefined for non-existent collection + const limits = await helper.collection.getEffectiveLimits(999999); + expect(limits).to.be.null; + } + { // Check that default values defined for collection limits + const limits = await collection.getEffectiveLimits(); + + expect(limits.accountTokenOwnershipLimit).to.be.eq(100000); + expect(limits.sponsoredDataSize).to.be.eq(2048); + expect(limits.sponsoredDataRateLimit).to.be.deep.eq({sponsoringDisabled: null}); + expect(limits.tokenLimit).to.be.eq(4294967295); + expect(limits.sponsorTransferTimeout).to.be.eq(5); + expect(limits.sponsorApproveTimeout).to.be.eq(5); + expect(limits.ownerCanTransfer).to.be.true; + expect(limits.ownerCanDestroy).to.be.true; + expect(limits.transfersEnabled).to.be.true; + } + { + // Check the values for collection limits + await collection.setLimits(alice, { + accountTokenOwnershipLimit: 99_999, + sponsoredDataSize: 1024, + tokenLimit: 123, + transfersEnabled: false, + }); + + const limits = await collection.getEffectiveLimits(); + + expect(limits.accountTokenOwnershipLimit).to.be.eq(99999); + expect(limits.sponsoredDataSize).to.be.eq(1024); + expect(limits.sponsoredDataRateLimit).to.be.deep.eq({sponsoringDisabled: null}); + expect(limits.tokenLimit).to.be.eq(123); + expect(limits.sponsorTransferTimeout).to.be.eq(5); + expect(limits.sponsorApproveTimeout).to.be.eq(5); + expect(limits.ownerCanTransfer).to.be.true; + expect(limits.ownerCanDestroy).to.be.true; + expect(limits.transfersEnabled).to.be.false; + } + }); +}); diff --git a/tests/src/nextSponsoring.test.ts b/tests/src/nextSponsoring.test.ts index 9ac234eff6..e66e67d6bb 100644 --- a/tests/src/nextSponsoring.test.ts +++ b/tests/src/nextSponsoring.test.ts @@ -14,100 +14,84 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi} from './substrate/substrate-api'; -import { - createCollectionExpectSuccess, - setCollectionSponsorExpectSuccess, - confirmSponsorshipExpectSuccess, - createItemExpectSuccess, - transferExpectSuccess, - normalizeAccountId, - getNextSponsored, - requirePallets, - Pallets, -} from './util/helpers'; - -chai.use(chaiAsPromised); -const expect = chai.expect; - +import {expect, itSub, Pallets, usingPlaygrounds} from './util/playgrounds'; +const SPONSORING_TIMEOUT = 5; describe('Integration Test getNextSponsored(collection_id, owner, item_id):', () => { let alice: IKeyringPair; let bob: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([20n, 10n], donor); }); }); - it('NFT', async () => { - await usingApi(async (api: ApiPromise) => { - - // Not existing collection - expect(await getNextSponsored(api, 0, normalizeAccountId(alice), 0)).to.be.equal(-1); + itSub('NFT', async ({helper}) => { + // Non-existing collection + expect(await helper.collection.getTokenNextSponsored(0, 0, {Substrate: alice.address})).to.be.null; - const collectionId = await createCollectionExpectSuccess(); - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address); + const collection = await helper.nft.mintCollection(alice, {}); + const token = await collection.mintToken(alice); - // Check with Disabled sponsoring state - expect(await getNextSponsored(api, collectionId, normalizeAccountId(alice), itemId)).to.be.equal(-1); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); + // Check with Disabled sponsoring state + expect(await token.getNextSponsored({Substrate: alice.address})).to.be.null; + + // Check with Unconfirmed sponsoring state + await collection.setSponsor(alice, bob.address); + expect(await token.getNextSponsored({Substrate: alice.address})).to.be.null; - // Check with Unconfirmed sponsoring state - expect(await getNextSponsored(api, collectionId, normalizeAccountId(alice), itemId)).to.be.equal(-1); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); + // Check with Confirmed sponsoring state + await collection.confirmSponsorship(bob); + expect(await token.getNextSponsored({Substrate: alice.address})).to.be.equal(0); - // Check with Confirmed sponsoring state - expect(await getNextSponsored(api, collectionId, normalizeAccountId(alice), itemId)).to.be.equal(0); + // Check after transfer + await token.transfer(alice, {Substrate: bob.address}); + expect(await token.getNextSponsored({Substrate: alice.address})).to.be.lessThanOrEqual(SPONSORING_TIMEOUT); - // After transfer - await transferExpectSuccess(collectionId, itemId, alice, bob, 1); - expect(await getNextSponsored(api, collectionId, normalizeAccountId(alice), itemId)).to.be.lessThanOrEqual(5); - - // Not existing token - expect(await getNextSponsored(api, collectionId, normalizeAccountId(alice), itemId+1)).to.be.equal(-1); - }); + // Non-existing token + expect(await collection.getTokenNextSponsored(0, {Substrate: alice.address})).to.be.null; }); - it('Fungible', async () => { - await usingApi(async (api: ApiPromise) => { + itSub('Fungible', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {}); + await collection.mint(alice, 10n); - const createMode = 'Fungible'; - const funCollectionId = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}}); - await createItemExpectSuccess(alice, funCollectionId, createMode); - await setCollectionSponsorExpectSuccess(funCollectionId, bob.address); - await confirmSponsorshipExpectSuccess(funCollectionId, '//Bob'); - expect(await getNextSponsored(api, funCollectionId, normalizeAccountId(alice), 0)).to.be.equal(0); + // Check with Disabled sponsoring state + expect(await collection.getTokenNextSponsored(0, {Substrate: alice.address})).to.be.null; - await transferExpectSuccess(funCollectionId, 0, alice, bob, 10, 'Fungible'); - expect(await getNextSponsored(api, funCollectionId, normalizeAccountId(alice), 0)).to.be.lessThanOrEqual(5); - }); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + + // Check with Confirmed sponsoring state + expect(await collection.getTokenNextSponsored(0, {Substrate: alice.address})).to.be.equal(0); + + // Check after transfer + await collection.transfer(alice, {Substrate: bob.address}); + expect(await collection.getTokenNextSponsored(0, {Substrate: alice.address})).to.be.lessThanOrEqual(SPONSORING_TIMEOUT); }); - it('ReFungible', async function() { - await requirePallets(this, [Pallets.ReFungible]); + itSub.ifWithPallets('ReFungible', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {}); + const token = await collection.mintToken(alice, 10n); - await usingApi(async (api: ApiPromise) => { + // Check with Disabled sponsoring state + expect(await token.getNextSponsored({Substrate: alice.address})).to.be.null; - const createMode = 'ReFungible'; - const refunCollectionId = await createCollectionExpectSuccess({mode: {type: createMode}}); - const refunItemId = await createItemExpectSuccess(alice, refunCollectionId, createMode); - await setCollectionSponsorExpectSuccess(refunCollectionId, bob.address); - await confirmSponsorshipExpectSuccess(refunCollectionId, '//Bob'); - expect(await getNextSponsored(api, refunCollectionId, normalizeAccountId(alice), refunItemId)).to.be.equal(0); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); - await transferExpectSuccess(refunCollectionId, refunItemId, alice, bob, 10, 'ReFungible'); - expect(await getNextSponsored(api, refunCollectionId, normalizeAccountId(alice), refunItemId)).to.be.lessThanOrEqual(5); + // Check with Confirmed sponsoring state + expect(await token.getNextSponsored({Substrate: alice.address})).to.be.equal(0); - // Not existing token - expect(await getNextSponsored(api, refunCollectionId, normalizeAccountId(alice), refunItemId+1)).to.be.equal(-1); - }); + // Check after transfer + await token.transfer(alice, {Substrate: bob.address}); + expect(await token.getNextSponsored({Substrate: alice.address})).to.be.lessThanOrEqual(SPONSORING_TIMEOUT); + + // Non-existing token + expect(await collection.getTokenNextSponsored(0, {Substrate: alice.address})).to.be.null; }); }); diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 63b3c01e91..62c4c23b81 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -35,7 +35,7 @@ describe('integration test: Refungible functionality:', async () => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); const itemCountBefore = await collection.getLastTokenId(); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + const token = await collection.mintToken(alice, 100n); const itemCountAfter = await collection.getLastTokenId(); @@ -48,7 +48,7 @@ describe('integration test: Refungible functionality:', async () => { itSub('Checking RPC methods when interacting with maximum allowed values (MAX_REFUNGIBLE_PIECES)', async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, MAX_REFUNGIBLE_PIECES); + const token = await collection.mintToken(alice, MAX_REFUNGIBLE_PIECES); expect(await collection.getTokenBalance(token.tokenId, {Substrate: alice.address})).to.be.equal(MAX_REFUNGIBLE_PIECES); @@ -56,7 +56,7 @@ describe('integration test: Refungible functionality:', async () => { expect(await collection.getTokenBalance(token.tokenId, {Substrate: bob.address})).to.be.equal(MAX_REFUNGIBLE_PIECES); expect(await token.getTotalPieces()).to.be.equal(MAX_REFUNGIBLE_PIECES); - await expect(collection.mintToken(alice, {Substrate: alice.address}, MAX_REFUNGIBLE_PIECES + 1n)) + await expect(collection.mintToken(alice, MAX_REFUNGIBLE_PIECES + 1n)) .to.eventually.be.rejectedWith(/refungible\.WrongRefungiblePieces/); }); @@ -66,7 +66,7 @@ describe('integration test: Refungible functionality:', async () => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 10_000n); + const token = await collection.mintToken(alice, 10_000n); await token.transfer(alice, {Substrate: bob.address}, 1000n); await token.transfer(alice, ethAcc, 900n); @@ -88,7 +88,7 @@ describe('integration test: Refungible functionality:', async () => { itSub('Transfer token pieces', async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + const token = await collection.mintToken(alice, 100n); expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); expect(await token.transfer(alice, {Substrate: bob.address}, 60n)).to.be.true; @@ -120,7 +120,7 @@ describe('integration test: Refungible functionality:', async () => { itSub('Burn some pieces', async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + const token = await collection.mintToken(alice, 100n); expect(await collection.isTokenExists(token.tokenId)).to.be.true; expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); expect((await token.burn(alice, 99n)).success).to.be.true; @@ -130,7 +130,7 @@ describe('integration test: Refungible functionality:', async () => { itSub('Burn all pieces', async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + const token = await collection.mintToken(alice, 100n); expect(await collection.isTokenExists(token.tokenId)).to.be.true; expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); @@ -141,7 +141,7 @@ describe('integration test: Refungible functionality:', async () => { itSub('Burn some pieces for multiple users', async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + const token = await collection.mintToken(alice, 100n); expect(await collection.isTokenExists(token.tokenId)).to.be.true; @@ -168,7 +168,7 @@ describe('integration test: Refungible functionality:', async () => { itSub('Set allowance for token', async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + const token = await collection.mintToken(alice, 100n); expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); @@ -183,7 +183,7 @@ describe('integration test: Refungible functionality:', async () => { itSub('Repartition', async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + const token = await collection.mintToken(alice, 100n); expect(await token.repartition(alice, 200n)).to.be.true; expect(await token.getBalance({Substrate: alice.address})).to.be.equal(200n); @@ -207,7 +207,7 @@ describe('integration test: Refungible functionality:', async () => { itSub('Repartition with increased amount', async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + const token = await collection.mintToken(alice, 100n); await token.repartition(alice, 200n); const chainEvents = helper.chainLog.slice(-1)[0].events.map((x: any) => x.event); expect(chainEvents).to.include.deep.members([{ @@ -225,7 +225,7 @@ describe('integration test: Refungible functionality:', async () => { itSub('Repartition with decreased amount', async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const token = await collection.mintToken(alice, {Substrate: alice.address}, 100n); + const token = await collection.mintToken(alice, 100n); await token.repartition(alice, 50n); const chainEvents = helper.chainLog.slice(-1)[0].events.map((x: any) => x.event); expect(chainEvents).to.include.deep.members([{ diff --git a/tests/src/rpc.test.ts b/tests/src/rpc.test.ts index a0119bbc38..291f3f86c2 100644 --- a/tests/src/rpc.test.ts +++ b/tests/src/rpc.test.ts @@ -44,7 +44,7 @@ describe('integration test: RPC methods', () => { const collection = await helper.ft.mintCollection(alice, {name: 'RPC-2', tokenPrefix: 'RPC'}); // mint some maximum (u128) amounts of tokens possible - await collection.mint(alice, {Substrate: alice.address}, (1n << 128n) - 1n); + await collection.mint(alice, (1n << 128n) - 1n); await collection.transfer(alice, {Substrate: bob.address}, 1000n); await collection.transfer(alice, ethAcc, 900n); diff --git a/tests/src/transfer.test.ts b/tests/src/transfer.test.ts index fd33641ca6..19bf353685 100644 --- a/tests/src/transfer.test.ts +++ b/tests/src/transfer.test.ts @@ -54,7 +54,7 @@ describe('Integration Test Transfer(recipient, collection_id, item_id, value)', itSub('[nft] User can transfer owned token', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'Transfer-1-NFT', description: '', tokenPrefix: 'T'}); - const nft = await collection.mintToken(alice, {Substrate: alice.address}); + const nft = await collection.mintToken(alice); await nft.transfer(alice, {Substrate: bob.address}); expect(await nft.getOwner()).to.be.deep.equal({Substrate: bob.address}); @@ -62,7 +62,7 @@ describe('Integration Test Transfer(recipient, collection_id, item_id, value)', itSub('[fungible] User can transfer owned token', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'Transfer-1-FT', description: '', tokenPrefix: 'T'}); - await collection.mint(alice, {Substrate: alice.address}, 10n); + await collection.mint(alice, 10n); await collection.transfer(alice, {Substrate: bob.address}, 9n); expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(9n); @@ -71,7 +71,7 @@ describe('Integration Test Transfer(recipient, collection_id, item_id, value)', itSub.ifWithPallets('[refungible] User can transfer owned token', [Pallets.ReFungible], async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'Transfer-1-RFT', description: '', tokenPrefix: 'T'}); - const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); + const rft = await collection.mintToken(alice, 10n); await rft.transfer(alice, {Substrate: bob.address}, 9n); expect(await rft.getBalance({Substrate: bob.address})).to.be.equal(9n); @@ -92,7 +92,7 @@ describe('Integration Test Transfer(recipient, collection_id, item_id, value)', const collection = await helper.ft.mintCollection(alice, {name: 'Transfer-2-FT', description: '', tokenPrefix: 'T'}); await collection.addAdmin(alice, {Substrate: bob.address}); - await collection.mint(bob, {Substrate: bob.address}, 10n); + await collection.mint(bob, 10n, {Substrate: bob.address}); await collection.transfer(bob, {Substrate: alice.address}, 1n); expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(9n); @@ -103,7 +103,7 @@ describe('Integration Test Transfer(recipient, collection_id, item_id, value)', const collection = await helper.rft.mintCollection(alice, {name: 'Transfer-2-RFT', description: '', tokenPrefix: 'T'}); await collection.addAdmin(alice, {Substrate: bob.address}); - const rft = await collection.mintToken(bob, {Substrate: bob.address}, 10n); + const rft = await collection.mintToken(bob, 10n, {Substrate: bob.address}); await rft.transfer(bob, {Substrate: alice.address}, 1n); expect(await rft.getBalance({Substrate: bob.address})).to.be.equal(9n); @@ -142,7 +142,7 @@ describe('Negative Integration Test Transfer(recipient, collection_id, item_id, itSub('[nft] Transfer with deleted collection_id', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'Transfer-Neg-1-NFT', description: '', tokenPrefix: 'T'}); - const nft = await collection.mintToken(alice, {Substrate: alice.address}); + const nft = await collection.mintToken(alice); await nft.burn(alice); await collection.burn(alice); @@ -153,7 +153,7 @@ describe('Negative Integration Test Transfer(recipient, collection_id, item_id, itSub('[fungible] Transfer with deleted collection_id', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'Transfer-Neg-1-FT', description: '', tokenPrefix: 'T'}); - await collection.mint(alice, {Substrate: alice.address}, 10n); + await collection.mint(alice, 10n); await collection.burnTokens(alice, 10n); await collection.burn(alice); @@ -164,7 +164,7 @@ describe('Negative Integration Test Transfer(recipient, collection_id, item_id, itSub.ifWithPallets('[refungible] Transfer with deleted collection_id', [Pallets.ReFungible], async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'Transfer-Neg-1-RFT', description: '', tokenPrefix: 'T'}); - const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); + const rft = await collection.mintToken(alice, 10n); await rft.burn(alice, 10n); await collection.burn(alice); @@ -193,7 +193,7 @@ describe('Negative Integration Test Transfer(recipient, collection_id, item_id, itSub('[nft] Transfer with deleted item_id', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'Transfer-Neg-3-NFT', description: '', tokenPrefix: 'T'}); - const nft = await collection.mintToken(alice, {Substrate: alice.address}); + const nft = await collection.mintToken(alice); await nft.burn(alice); @@ -203,7 +203,7 @@ describe('Negative Integration Test Transfer(recipient, collection_id, item_id, itSub('[fungible] Transfer with deleted item_id', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'Transfer-Neg-3-FT', description: '', tokenPrefix: 'T'}); - await collection.mint(alice, {Substrate: alice.address}, 10n); + await collection.mint(alice, 10n); await collection.burnTokens(alice, 10n); @@ -213,7 +213,7 @@ describe('Negative Integration Test Transfer(recipient, collection_id, item_id, itSub.ifWithPallets('[refungible] Transfer with deleted item_id', [Pallets.ReFungible], async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'Transfer-Neg-3-RFT', description: '', tokenPrefix: 'T'}); - const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); + const rft = await collection.mintToken(alice, 10n); await rft.burn(alice, 10n); @@ -223,7 +223,7 @@ describe('Negative Integration Test Transfer(recipient, collection_id, item_id, itSub('[nft] Transfer with recipient that is not owner', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'Transfer-Neg-4-NFT', description: '', tokenPrefix: 'T'}); - const nft = await collection.mintToken(alice, {Substrate: alice.address}); + const nft = await collection.mintToken(alice); await expect(nft.transfer(bob, {Substrate: bob.address})) .to.be.rejectedWith(/common\.NoPermission/); @@ -232,7 +232,7 @@ describe('Negative Integration Test Transfer(recipient, collection_id, item_id, itSub('[fungible] Transfer with recipient that is not owner', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'Transfer-Neg-4-FT', description: '', tokenPrefix: 'T'}); - await collection.mint(alice, {Substrate: alice.address}, 10n); + await collection.mint(alice, 10n); await expect(collection.transfer(bob, {Substrate: bob.address}, 9n)) .to.be.rejectedWith(/common\.TokenValueTooLow/); @@ -242,7 +242,7 @@ describe('Negative Integration Test Transfer(recipient, collection_id, item_id, itSub.ifWithPallets('[refungible] Transfer with recipient that is not owner', [Pallets.ReFungible], async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'Transfer-1-RFT', description: '', tokenPrefix: 'T'}); - const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); + const rft = await collection.mintToken(alice, 10n); await expect(rft.transfer(bob, {Substrate: bob.address}, 9n)) .to.be.rejectedWith(/common\.TokenValueTooLow/); @@ -263,7 +263,7 @@ describe('Transfers to self (potentially over substrate-evm boundary)', () => { itEth('Transfers to self. In case of same frontend', async ({helper}) => { const [owner] = await helper.arrange.createAccounts([10n], donor); const collection = await helper.ft.mintCollection(owner, {}); - await collection.mint(owner, {Substrate: owner.address}, 100n); + await collection.mint(owner, 100n); const ownerProxy = helper.address.substrateToEth(owner.address); @@ -281,7 +281,7 @@ describe('Transfers to self (potentially over substrate-evm boundary)', () => { itEth('Transfers to self. In case of substrate-evm boundary', async ({helper}) => { const [owner] = await helper.arrange.createAccounts([10n], donor); const collection = await helper.ft.mintCollection(owner, {}); - await collection.mint(owner, {Substrate: owner.address}, 100n); + await collection.mint(owner, 100n); const ownerProxy = helper.address.substrateToEth(owner.address); @@ -299,7 +299,7 @@ describe('Transfers to self (potentially over substrate-evm boundary)', () => { itEth('Transfers to self. In case of inside substrate-evm', async ({helper}) => { const [owner] = await helper.arrange.createAccounts([10n], donor); const collection = await helper.ft.mintCollection(owner, {}); - await collection.mint(owner, {Substrate: owner.address}, 100n); + await collection.mint(owner, 100n); // transfer to self again await collection.transfer(owner, {Substrate: owner.address}, 10n); @@ -313,7 +313,7 @@ describe('Transfers to self (potentially over substrate-evm boundary)', () => { itEth('Transfers to self. In case of inside substrate-evm when not enought "Fungibles"', async ({helper}) => { const [owner] = await helper.arrange.createAccounts([10n], donor); const collection = await helper.ft.mintCollection(owner, {}); - await collection.mint(owner, {Substrate: owner.address}, 10n); + await collection.mint(owner, 10n); // transfer to self again await expect(collection.transfer(owner, {Substrate: owner.address}, 11n)) diff --git a/tests/src/transferFrom.test.ts b/tests/src/transferFrom.test.ts index f569d1b912..011cf9a260 100644 --- a/tests/src/transferFrom.test.ts +++ b/tests/src/transferFrom.test.ts @@ -31,7 +31,7 @@ describe('Integration Test transferFrom(from, recipient, collection_id, item_id, itSub('[nft] Execute the extrinsic and check nftItemList - owner of token', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'TransferFrom-1', description: '', tokenPrefix: 'TF'}); - const nft = await collection.mintToken(alice, {Substrate: alice.address}); + const nft = await collection.mintToken(alice); await nft.approve(alice, {Substrate: bob.address}); expect(await nft.isApproved({Substrate: bob.address})).to.be.true; @@ -41,7 +41,7 @@ describe('Integration Test transferFrom(from, recipient, collection_id, item_id, itSub('[fungible] Execute the extrinsic and check nftItemList - owner of token', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'TransferFrom-2', description: '', tokenPrefix: 'TF'}); - await collection.mint(alice, {Substrate: alice.address}, 10n); + await collection.mint(alice, 10n); await collection.approveTokens(alice, {Substrate: bob.address}, 7n); expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(7n); @@ -53,7 +53,7 @@ describe('Integration Test transferFrom(from, recipient, collection_id, item_id, itSub.ifWithPallets('[refungible] Execute the extrinsic and check nftItemList - owner of token', [Pallets.ReFungible], async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'TransferFrom-3', description: '', tokenPrefix: 'TF'}); - const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); + const rft = await collection.mintToken(alice, 10n); await rft.approve(alice, {Substrate: bob.address}, 7n); expect(await rft.getApprovedPieces({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(7n); @@ -66,7 +66,7 @@ describe('Integration Test transferFrom(from, recipient, collection_id, item_id, itSub('Should reduce allowance if value is big', async ({helper}) => { // fungible const collection = await helper.ft.mintCollection(alice, {name: 'TransferFrom-4', description: '', tokenPrefix: 'TF'}); - await collection.mint(alice, {Substrate: alice.address}, 500000n); + await collection.mint(alice, 500000n); await collection.approveTokens(alice, {Substrate: bob.address}, 500000n); expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.equal(500000n); @@ -118,7 +118,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, itSub('[nft] transferFrom for not approved address', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'TransferFrom-Neg-1', description: '', tokenPrefix: 'TF'}); - const nft = await collection.mintToken(alice, {Substrate: alice.address}); + const nft = await collection.mintToken(alice); await expect(nft.transferFrom(bob, {Substrate: alice.address}, {Substrate: charlie.address})) .to.be.rejectedWith(/common\.ApprovedValueTooLow/); @@ -127,7 +127,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, itSub('[fungible] transferFrom for not approved address', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'TransferFrom-Neg-1', description: '', tokenPrefix: 'TF'}); - await collection.mint(alice, {Substrate: alice.address}, 10n); + await collection.mint(alice, 10n); await expect(collection.transferFrom(bob, {Substrate: alice.address}, {Substrate: charlie.address}, 5n)) .to.be.rejectedWith(/common\.ApprovedValueTooLow/); @@ -138,7 +138,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, itSub.ifWithPallets('[refungible] transferFrom for not approved address', [Pallets.ReFungible], async({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'TransferFrom-Neg-3', description: '', tokenPrefix: 'TF'}); - const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); + const rft = await collection.mintToken(alice, 10n); await expect(rft.transferFrom(bob, {Substrate: alice.address}, {Substrate: charlie.address})) .to.be.rejectedWith(/common\.ApprovedValueTooLow/); @@ -149,7 +149,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, itSub('[nft] transferFrom incorrect token count', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'TransferFrom-Neg-4', description: '', tokenPrefix: 'TF'}); - const nft = await collection.mintToken(alice, {Substrate: alice.address}); + const nft = await collection.mintToken(alice); await nft.approve(alice, {Substrate: bob.address}); expect(await nft.isApproved({Substrate: bob.address})).to.be.true; @@ -167,7 +167,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, itSub('[fungible] transferFrom incorrect token count', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'TransferFrom-Neg-5', description: '', tokenPrefix: 'TF'}); - await collection.mint(alice, {Substrate: alice.address}, 10n); + await collection.mint(alice, 10n); await collection.approveTokens(alice, {Substrate: bob.address}, 2n); expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.eq(2n); @@ -181,7 +181,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, itSub.ifWithPallets('[refungible] transferFrom incorrect token count', [Pallets.ReFungible], async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'TransferFrom-Neg-6', description: '', tokenPrefix: 'TF'}); - const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); + const rft = await collection.mintToken(alice, 10n); await rft.approve(alice, {Substrate: bob.address}, 5n); expect(await rft.getApprovedPieces({Substrate: alice.address}, {Substrate: bob.address})).to.be.eq(5n); @@ -195,7 +195,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, itSub('[nft] execute transferFrom from account that is not owner of collection', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'TransferFrom-Neg-7', description: '', tokenPrefix: 'TF'}); - const nft = await collection.mintToken(alice, {Substrate: alice.address}); + const nft = await collection.mintToken(alice); await expect(nft.approve(charlie, {Substrate: bob.address})).to.be.rejectedWith(/common\.CantApproveMoreThanOwned/); expect(await nft.isApproved({Substrate: bob.address})).to.be.false; @@ -210,7 +210,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, itSub('[fungible] execute transferFrom from account that is not owner of collection', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'TransferFrom-Neg-8', description: '', tokenPrefix: 'TF'}); - await collection.mint(alice, {Substrate: alice.address}, 10000n); + await collection.mint(alice, 10000n); await expect(collection.approveTokens(charlie, {Substrate: bob.address}, 1n)).to.be.rejectedWith(/common\.CantApproveMoreThanOwned/); expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.eq(0n); @@ -228,7 +228,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, itSub.ifWithPallets('[refungible] execute transferFrom from account that is not owner of collection', [Pallets.ReFungible], async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'TransferFrom-Neg-9', description: '', tokenPrefix: 'TF'}); - const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10000n); + const rft = await collection.mintToken(alice, 10000n); await expect(rft.approve(charlie, {Substrate: bob.address}, 1n)).to.be.rejectedWith(/common\.CantApproveMoreThanOwned/); expect(await rft.getApprovedPieces({Substrate: alice.address}, {Substrate: bob.address})).to.be.eq(0n); @@ -247,7 +247,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, itSub('transferFrom burnt token before approve NFT', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'TransferFrom-Neg-10', description: '', tokenPrefix: 'TF'}); await collection.setLimits(alice, {ownerCanTransfer: true}); - const nft = await collection.mintToken(alice, {Substrate: alice.address}); + const nft = await collection.mintToken(alice); await nft.burn(alice); await expect(nft.approve(alice, {Substrate: bob.address})).to.be.rejectedWith(/common\.TokenNotFound/); @@ -262,7 +262,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, itSub('transferFrom burnt token before approve Fungible', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'TransferFrom-Neg-11', description: '', tokenPrefix: 'TF'}); await collection.setLimits(alice, {ownerCanTransfer: true}); - await collection.mint(alice, {Substrate: alice.address}, 10n); + await collection.mint(alice, 10n); await collection.burnTokens(alice, 10n); await expect(collection.approveTokens(alice, {Substrate: bob.address})).to.be.not.rejected; @@ -277,7 +277,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, itSub.ifWithPallets('transferFrom burnt token before approve ReFungible', [Pallets.ReFungible], async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'TransferFrom-Neg-12', description: '', tokenPrefix: 'TF'}); await collection.setLimits(alice, {ownerCanTransfer: true}); - const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); + const rft = await collection.mintToken(alice, 10n); await rft.burn(alice, 10n); await expect(rft.approve(alice, {Substrate: bob.address})).to.be.rejectedWith(/common\.CantApproveMoreThanOwned/); @@ -291,7 +291,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, itSub('transferFrom burnt token after approve NFT', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'TransferFrom-Neg-13', description: '', tokenPrefix: 'TF'}); - const nft = await collection.mintToken(alice, {Substrate: alice.address}); + const nft = await collection.mintToken(alice); await nft.approve(alice, {Substrate: bob.address}); expect(await nft.isApproved({Substrate: bob.address})).to.be.true; @@ -307,7 +307,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, itSub('transferFrom burnt token after approve Fungible', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'TransferFrom-Neg-14', description: '', tokenPrefix: 'TF'}); - await collection.mint(alice, {Substrate: alice.address}, 10n); + await collection.mint(alice, 10n); await collection.approveTokens(alice, {Substrate: bob.address}); expect(await collection.getApprovedTokens({Substrate: alice.address}, {Substrate: bob.address})).to.be.eq(1n); @@ -323,7 +323,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, itSub.ifWithPallets('transferFrom burnt token after approve ReFungible', [Pallets.ReFungible], async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'TransferFrom-Neg-15', description: '', tokenPrefix: 'TF'}); - const rft = await collection.mintToken(alice, {Substrate: alice.address}, 10n); + const rft = await collection.mintToken(alice, 10n); await rft.approve(alice, {Substrate: bob.address}, 10n); expect(await rft.getApprovedPieces({Substrate: alice.address}, {Substrate: bob.address})).to.be.eq(10n); diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 4aa63230cd..f84800e472 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -1678,7 +1678,7 @@ class FTGroup extends CollectionGroup { * @example mintTokens(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq"}, 1000n); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async mintTokens(signer: TSigner, collectionId: number, owner: ICrossAccountId | string, amount: bigint): Promise { + async mintTokens(signer: TSigner, collectionId: number, amount: bigint, owner: ICrossAccountId | string): Promise { const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createItem', [collectionId, (typeof owner === 'string') ? {Substrate: owner} : owner, { @@ -1699,7 +1699,7 @@ class FTGroup extends CollectionGroup { * @param tokens array of tokens with properties and pieces * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {value: bigint}[]): Promise { + async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, tokens: {value: bigint}[], owner: ICrossAccountId): Promise { const rawTokens = []; for (const token of tokens) { const raw = {Fungible: {Value: token.value}}; @@ -2211,7 +2211,7 @@ class UniqueNFTCollection extends UniqueCollectionBase { return await this.helper.nft.isTokenApproved(this.collectionId, tokenId, toAddressObj); } - async mintToken(signer: TSigner, owner: ICrossAccountId, properties?: IProperty[]) { + async mintToken(signer: TSigner, owner: ICrossAccountId = {Substrate: signer.address}, properties?: IProperty[]) { return await this.helper.nft.mintToken(signer, {collectionId: this.collectionId, owner, properties}); } @@ -2286,11 +2286,11 @@ class UniqueRFTCollection extends UniqueCollectionBase { return await this.helper.rft.repartitionToken(signer, this.collectionId, tokenId, amount); } - async mintToken(signer: TSigner, owner: ICrossAccountId, pieces=100n, properties?: IProperty[]) { + async mintToken(signer: TSigner, pieces=1n, owner: ICrossAccountId = {Substrate: signer.address}, properties?: IProperty[]) { return await this.helper.rft.mintToken(signer, {collectionId: this.collectionId, owner, pieces, properties}); } - async mintMultipleTokens(signer: TSigner, tokens: {owner: ICrossAccountId, pieces: bigint, properties?: IProperty[]}[]) { + async mintMultipleTokens(signer: TSigner, tokens: {pieces: bigint, owner: ICrossAccountId, properties?: IProperty[]}[]) { return await this.helper.rft.mintMultipleTokens(signer, this.collectionId, tokens); } @@ -2313,12 +2313,12 @@ class UniqueRFTCollection extends UniqueCollectionBase { class UniqueFTCollection extends UniqueCollectionBase { - async mint(signer: TSigner, owner: ICrossAccountId, amount: bigint) { - return await this.helper.ft.mintTokens(signer, this.collectionId, owner, amount); + async mint(signer: TSigner, amount=1n, owner: ICrossAccountId = {Substrate: signer.address}) { + return await this.helper.ft.mintTokens(signer, this.collectionId, amount, owner); } - async mintWithOneOwner(signer: TSigner, owner: ICrossAccountId, tokens: {value: bigint}[]) { - return await this.helper.ft.mintMultipleTokensWithOneOwner(signer, this.collectionId, owner, tokens); + async mintWithOneOwner(signer: TSigner, tokens: {value: bigint}[], owner: ICrossAccountId = {Substrate: signer.address}) { + return await this.helper.ft.mintMultipleTokensWithOneOwner(signer, this.collectionId, tokens, owner); } async getBalance(addressObj: ICrossAccountId) { From 0982b02171d4b11d23bbc3c8386fa364b2d0998a Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Sun, 11 Sep 2022 19:56:47 +0300 Subject: [PATCH 0838/1274] doc: sponsoring for unique is implemented via different structs Signed-off-by: Yaroslav Bolyukin --- doc/sponsoring.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/sponsoring.md b/doc/sponsoring.md index 2ee70b0b89..9910d19f48 100644 --- a/doc/sponsoring.md +++ b/doc/sponsoring.md @@ -4,11 +4,9 @@ ## Implementation -If you need to add sponsoring for pallet call, you should implement `SponsorshipHandler` +If you need to add sponsoring for pallet call, you should implement `SponsorshipHandler`, see `UniqueSponsorshipHandler` for example. -If you need to add sponsoring for EVM contract call, you should implement `SponsorshipHandler), CallContext>` - -For both examples, you can take a look at `UniqueSponsorshipHandler` struct inside of common runtime +If you need to add sponsoring for EVM contract call, you should implement `SponsorshipHandler), CallContext>`, see `UniqueEthSponsorshipHandler` for example. ## EVM bridging From 012988d1206de95e4a89d8e79e1f71c85aa3bdf7 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 12 Sep 2022 15:30:58 +0700 Subject: [PATCH 0839/1274] deleted unnecessary files for xcm and testnet build --- .docker/Dockerfile-testnet | 96 ------------ .docker/Dockerfile-testnet.j2 | 96 ------------ .docker/Dockerfile-xcm | 146 ------------------ .docker/docker-compose-testnet.yml | 17 -- .docker/docker-compose-xcm.yml | 23 --- .docker/docker-compose.tmp-testnet.j2 | 18 --- .docker/docker-compose.tmp-xcm-quartz.yml | 25 --- .docker/docker-compose.tmp-xcm-unique.yml | 27 ---- .docker/docker-compose.tmp-xcm.j2 | 21 --- .../testnet-config/launch-config-testnet.json | 121 --------------- .github/workflows/xcm-testnet-build.yml | 6 - 11 files changed, 596 deletions(-) delete mode 100644 .docker/Dockerfile-testnet delete mode 100644 .docker/Dockerfile-testnet.j2 delete mode 100644 .docker/Dockerfile-xcm delete mode 100644 .docker/docker-compose-testnet.yml delete mode 100644 .docker/docker-compose-xcm.yml delete mode 100644 .docker/docker-compose.tmp-testnet.j2 delete mode 100644 .docker/docker-compose.tmp-xcm-quartz.yml delete mode 100644 .docker/docker-compose.tmp-xcm-unique.yml delete mode 100644 .docker/docker-compose.tmp-xcm.j2 delete mode 100644 .docker/testnet-config/launch-config-testnet.json diff --git a/.docker/Dockerfile-testnet b/.docker/Dockerfile-testnet deleted file mode 100644 index 91b4e3bd07..0000000000 --- a/.docker/Dockerfile-testnet +++ /dev/null @@ -1,96 +0,0 @@ -# ===== Rust builder ===== -FROM ubuntu:20.04 as rust-builder -LABEL maintainer="Unique.Network" - -ARG RUST_TOOLCHAIN= - -ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ - apt-get clean && \ - rm -r /var/lib/apt/lists/* - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - -RUN rustup toolchain uninstall $(rustup toolchain list) && \ - rustup toolchain install $RUST_TOOLCHAIN && \ - rustup default $RUST_TOOLCHAIN && \ - rustup target list --installed && \ - rustup show -RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - - -# ===== BUILD ====== -FROM rust-builder as builder-unique - -ARG PROFILE=release -ARG FEATURE= -ARG BRANCH= - - -WORKDIR /unique_parachain - -RUN git clone -b $BRANCH https://github.com/UniqueNetwork/unique-chain.git && \ - cd unique-chain && \ - cargo build --features=$FEATURE --$PROFILE - -# ===== BUILD POLKADOT ===== -FROM rust-builder as builder-polkadot - -ARG POLKADOT_BUILD_BRANCH= -ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH - - -WORKDIR /unique_parachain - -RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ - cd polkadot && \ - cargo build --release - -# ===== RUN ====== - -FROM ubuntu:20.04 - -ARG POLKADOT_LAUNCH_BRANCH= -ENV POLKADOT_LAUNCH_BRANCH $POLKADOT_LAUNCH_BRANCH - -RUN apt-get -y update && \ - apt-get -y install curl git && \ - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v16.16.0 && \ - nvm use v16.16.0 - -RUN git clone https://github.com/uniquenetwork/polkadot-launch -b $POLKADOT_LAUNCH_BRANCH - -RUN export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - npm install --global yarn && \ - yarn install - -COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ - -EXPOSE 9844 -EXPOSE 9944 -EXPOSE 9933 -EXPOSE 9833 -EXPOSE 40333 -EXPOSE 30333 - -CMD export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - yarn start launch-config.json - - diff --git a/.docker/Dockerfile-testnet.j2 b/.docker/Dockerfile-testnet.j2 deleted file mode 100644 index 83407229a9..0000000000 --- a/.docker/Dockerfile-testnet.j2 +++ /dev/null @@ -1,96 +0,0 @@ -# ===== Rust builder ===== -FROM ubuntu:20.04 as rust-builder -LABEL maintainer="Unique.Network" - -#ARG RUST_TOOLCHAIN= - -#ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ - apt-get clean && \ - rm -r /var/lib/apt/lists/* - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - -RUN rustup toolchain uninstall $(rustup toolchain list) && \ - rustup toolchain install {{ RUST_TOOLCHAIN }} && \ - rustup default {{ RUST_TOOLCHAIN }} && \ - rustup target list --installed && \ - rustup show -RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - - -# ===== BUILD ====== -FROM rust-builder as builder-unique - -ARG PROFILE=release -#ARG FEATURE= -#ARG BRANCH= - - -WORKDIR /unique_parachain - -RUN git clone -b {{ BRANCH }} https://github.com/UniqueNetwork/unique-chain.git && \ - cd unique-chain && \ - cargo build --features={{ FEATURE }} --$PROFILE - -# ===== BUILD POLKADOT ===== -FROM rust-builder as builder-polkadot - -#ARG POLKADOT_BUILD_BRANCH= -#ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH - - -WORKDIR /unique_parachain - -RUN git clone -b {{ POLKADOT_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/polkadot.git && \ - cd polkadot && \ - cargo build --release - -# ===== RUN ====== - -FROM ubuntu:20.04 - -#ARG POLKADOT_LAUNCH_BRANCH= -#ENV POLKADOT_LAUNCH_BRANCH $POLKADOT_LAUNCH_BRANCH - -RUN apt-get -y update && \ - apt-get -y install curl git && \ - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v16.16.0 && \ - nvm use v16.16.0 - -RUN git clone https://github.com/uniquenetwork/polkadot-launch -b {{ POLKADOT_LAUNCH_BRANCH }} - -RUN export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - npm install --global yarn && \ - yarn install - -COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ - -EXPOSE 9844 -EXPOSE 9944 -EXPOSE 9933 -EXPOSE 9833 -EXPOSE 40333 -EXPOSE 30333 - -CMD export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - yarn start launch-config.json - - diff --git a/.docker/Dockerfile-xcm b/.docker/Dockerfile-xcm deleted file mode 100644 index c17a9c3ee8..0000000000 --- a/.docker/Dockerfile-xcm +++ /dev/null @@ -1,146 +0,0 @@ -# ===== Rust builder ===== -FROM ubuntu:20.04 as rust-builder -LABEL maintainer="Unique.Network" - -ARG RUST_TOOLCHAIN= - -ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ - apt-get clean && \ - rm -r /var/lib/apt/lists/* - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - -RUN rustup toolchain uninstall $(rustup toolchain list) && \ - rustup toolchain install $RUST_TOOLCHAIN && \ - rustup default $RUST_TOOLCHAIN && \ - rustup target list --installed && \ - rustup show -RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - - -# ===== BUILD ====== -FROM rust-builder as builder-unique - -ARG PROFILE=release -ARG FEATURE= -ARG BRANCH= - - -WORKDIR /unique_parachain - -RUN git clone -b $BRANCH https://github.com/UniqueNetwork/unique-chain.git && \ - cd unique-chain && \ - cargo build --features=$FEATURE --$PROFILE - -# ===== BUILD POLKADOT ===== -FROM rust-builder as builder-polkadot - -ARG POLKADOT_BUILD_BRANCH= -ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH - - -WORKDIR /unique_parachain - -RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ - cd polkadot && \ - cargo build --release - -# ===== BUILD ACALA ===== -FROM rust-builder as builder-acala - -ARG ACALA_BUILD_BRANCH= -ENV ACALA_BUILD_BRANCH $ACALA_BUILD_BRANCH - - -WORKDIR /unique_parachain - -RUN git clone -b $ACALA_BUILD_BRANCH --depth 1 https://github.com/AcalaNetwork/Acala.git && \ - cd Acala && \ - make init && \ - make build-release - -# ===== BUILD MOONBEAM ===== -FROM rust-builder as builder-moonbeam - -ARG MOONBEAM_BUILD_BRANCH= -ENV MOONBEAM_BUILD_BRANCH $MOONBEAM_BUILD_BRANCH - - -WORKDIR /unique_parachain - -RUN git clone -b $MOONBEAM_BUILD_BRANCH --depth 1 https://github.com/PureStake/moonbeam.git && \ - cd moonbeam && \ - cargo build --release - -# ===== BUILD CUMULUS ===== -FROM rust-builder as builder-cumulus - -ARG CUMULUS_BUILD_BRANCH= -ENV CUMULUS_BUILD_BRANCH $CUMULUS_BUILD_BRANCH - - -WORKDIR /unique_parachain - -RUN git clone -b $CUMULUS_BUILD_BRANCH --depth 1 https://github.com/paritytech/cumulus.git && \ - cd cumulus && \ - cargo build --release - -# ===== BUILD CHAINQL ===== -FROM rust-builder as builder-chainql - -RUN mkdir chainql -WORKDIR /chainql - -RUN git clone -b v0.1.0 --depth 1 https://github.com/CertainLach/chainql.git . && \ - cargo build --release - -# ===== RUN ====== - -FROM ubuntu:20.04 - -ARG POLKADOT_LAUNCH_BRANCH= -ENV POLKADOT_LAUNCH_BRANCH $POLKADOT_LAUNCH_BRANCH - -RUN apt-get -y update && \ - apt-get -y install curl git jsonnet && \ - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v16.16.0 && \ - nvm use v16.16.0 - -RUN git clone https://github.com/uniquenetwork/polkadot-launch -b $POLKADOT_LAUNCH_BRANCH - -RUN export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - npm install --global yarn && \ - yarn install - -COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=builder-moonbeam /unique_parachain/moonbeam/target/release/moonbeam /moonbeam/target/release/ -COPY --from=builder-cumulus /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus -COPY --from=builder-acala /unique_parachain/Acala/target/production/acala /acala/target/release/ -COPY --from=builder-chainql /chainql/target/release/chainql /chainql/target/release/ - -EXPOSE 9844 -EXPOSE 9944 -EXPOSE 9946 -EXPOSE 9947 -EXPOSE 9948 - -CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - yarn start launch-config.json diff --git a/.docker/docker-compose-testnet.yml b/.docker/docker-compose-testnet.yml deleted file mode 100644 index 34f6e9258a..0000000000 --- a/.docker/docker-compose-testnet.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: "3.5" - -services: - xcm_nodes: - build: - context: ../ - dockerfile: .docker/Dockerfile-testnet - expose: - - 9844 - - 9944 - ports: - - 127.0.0.1:9844:9844 - - 127.0.0.1:9944:9944 - logging: - options: - max-size: "1m" - max-file: "3" diff --git a/.docker/docker-compose-xcm.yml b/.docker/docker-compose-xcm.yml deleted file mode 100644 index d34f2c4f8f..0000000000 --- a/.docker/docker-compose-xcm.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: "3.5" - -services: - xcm_nodes: - build: - context: ../ - dockerfile: .docker/Dockerfile-xcm - expose: - - 9844 - - 9944 - - 9946 - - 9947 - - 9948 - ports: - - 127.0.0.1:9844:9844 - - 127.0.0.1:9944:9944 - - 127.0.0.1:9946:9946 - - 127.0.0.1:9947:9947 - - 127.0.0.1:9948:9948 - logging: - options: - max-size: "1m" - max-file: "3" diff --git a/.docker/docker-compose.tmp-testnet.j2 b/.docker/docker-compose.tmp-testnet.j2 deleted file mode 100644 index 6f237e758b..0000000000 --- a/.docker/docker-compose.tmp-testnet.j2 +++ /dev/null @@ -1,18 +0,0 @@ -version: "3.5" - -services: - xcm_nodes: - build: - args: - - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - - "BRANCH={{ BRANCH }}" - - "FEATURE={{ FEATURE }}" - - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - - "POLKADOT_LAUNCH_BRANCH={{ POLKADOT_LAUNCH_BRANCH }}" - image: testnet_node_{{ NETWORK }} - container_name: testnet_node_{{ NETWORK }} - volumes: - - type: bind - source: ./testnet-config/launch-config-testnet.json - target: /polkadot-launch/launch-config.json - read_only: true diff --git a/.docker/docker-compose.tmp-xcm-quartz.yml b/.docker/docker-compose.tmp-xcm-quartz.yml deleted file mode 100644 index ee1eedb95e..0000000000 --- a/.docker/docker-compose.tmp-xcm-quartz.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: "3.5" - -services: - xcm_nodes: - build: - args: - - "RUST_TOOLCHAIN=nightly-2022-07-24" - - "BRANCH=release-v927020" - - "FEATURE=quartz-runtime" - - "POLKADOT_BUILD_BRANCH=release-v0.9.27" - - "ACALA_BUILD_BRANCH=2.9.0" - - "MOONBEAM_BUILD_BRANCH=v0.25.0" - - "CUMULUS_BUILD_BRANCH=release-v0.9.230" - - "POLKADOT_LAUNCH_BRANCH=feature/rewrite-chain-id-in-spec" - image: xcm_nodes_quartz - container_name: xcm_nodes_quartz - volumes: - - type: bind - source: ./xcm-config/launch-config-xcm-quartz.json - target: /polkadot-launch/launch-config.json - read_only: true - - type: bind - source: ./xcm-config/5validators.jsonnet - target: /polkadot-launch/5validators.jsonnet - read_only: true diff --git a/.docker/docker-compose.tmp-xcm-unique.yml b/.docker/docker-compose.tmp-xcm-unique.yml deleted file mode 100644 index 5533f04c20..0000000000 --- a/.docker/docker-compose.tmp-xcm-unique.yml +++ /dev/null @@ -1,27 +0,0 @@ -version: "3.5" - -services: - xcm_nodes: - build: - args: - - "RUST_TOOLCHAIN=nightly-2022-07-24" - - "BRANCH=release-v927020" - - "REPO_URL=https://github.com/UniqueNetwork/unique-chain.git" - - "FEATURE=unique-runtime" - - "POLKADOT_BUILD_BRANCH=release-v0.9.27" - - "ACALA_BUILD_BRANCH=2.9.0" - - "MOONBEAM_BUILD_BRANCH=v0.25.0" - - "CUMULUS_BUILD_BRANCH=release-v0.9.230" - - "POLKADOT_LAUNCH_BRANCH=feature/rewrite-chain-id-in-spec" - image: xcm_nodes_unique - container_name: xcm_nodes_unique - volumes: - - type: bind - source: ./xcm-config/launch-config-xcm-unique.json - target: /polkadot-launch/launch-config.json - read_only: true - - type: bind - source: ./xcm-config/5validators.jsonnet - target: /polkadot-launch/5validators.jsonnet - read_only: true - diff --git a/.docker/docker-compose.tmp-xcm.j2 b/.docker/docker-compose.tmp-xcm.j2 deleted file mode 100644 index e7f0181631..0000000000 --- a/.docker/docker-compose.tmp-xcm.j2 +++ /dev/null @@ -1,21 +0,0 @@ -version: "3.5" - -services: - xcm_nodes: - build: - args: - - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}" - - "BRANCH={{ BRANCH }}" - - "FEATURE={{ FEATURE }}" - - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}" - - "ACALA_BUILD_BRANCH={{ ACALA_BUILD_BRANCH }}" - - "MOONBEAM_BUILD_BRANCH={{ MOONBEAM_BUILD_BRANCH }}" - - "CUMULUS_BUILD_BRANCH={{ CUMULUS_BUILD_BRANCH }}" - - "POLKADOT_LAUNCH_BRANCH={{ POLKADOT_LAUNCH_BRANCH }}" - image: xcm_nodes_{{ NETWORK }} - container_name: xcm_nodes_{{ NETWORK }} - volumes: - - type: bind - source: ./xcm-config/launch-config-xcm-{{ NETWORK }}.json - target: /polkadot-launch/launch-config.json - read_only: true diff --git a/.docker/testnet-config/launch-config-testnet.json b/.docker/testnet-config/launch-config-testnet.json deleted file mode 100644 index 65a83f6620..0000000000 --- a/.docker/testnet-config/launch-config-testnet.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "relaychain": { - "bin": "../polkadot/target/release/polkadot", - "chain": "rococo-local", - "nodes": [ - { - "name": "alice", - "wsPort": 9844, - "rpcPort": 9843, - "port": 30444, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "bob", - "wsPort": 9855, - "rpcPort": 9854, - "port": 30555, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "charlie", - "wsPort": 9866, - "rpcPort": 9865, - "port": 30666, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "dave", - "wsPort": 9877, - "rpcPort": 9876, - "port": 30777, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "eve", - "wsPort": 9888, - "rpcPort": 9887, - "port": 30888, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - } - ], - "genesis": { - "runtime": { - "runtime_genesis_config": { - "parachainsConfiguration": { - "config": { - "validation_upgrade_frequency": 1, - "validation_upgrade_delay": 1 - } - } - } - } - } - }, - "parachains": [ - { - "bin": "../unique-chain/target/release/unique-collator", - "id": "1000", - "balance": "1000000000000000000000000", - "nodes": [ - { - "port": 31200, - "wsPort": 9944, - "rpcPort": 9933, - "name": "alice", - "flags": [ - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external", - "-lxcm=trace" - ] - }, - { - "port": 31201, - "wsPort": 9945, - "rpcPort": 9934, - "name": "bob", - "flags": [ - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external", - "-lxcm=trace" - ] - } - ] - } - ], - "simpleParachains": [], - "hrmpChannels": [], - "finalization": false -} diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index 9578217543..834929c075 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -85,12 +85,6 @@ jobs: - name: Install jq run: sudo apt install jq -y - # - name: Get autorization token from DOCKERHUB - # run: | - # # aquire token - # TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - # export TOKEN=$TOKEN - # Check POLKADOT version and build it if it doesn't exist in repository - name: Generate ENV related extend Dockerfile file for POLKADOT uses: cuchi/jinja2-action@v1.2.0 From c10aeb9bb7f16848d840b7f16bbb5c61ca2b4384 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 12 Sep 2022 12:53:05 +0300 Subject: [PATCH 0840/1274] adjust debug timeout --- .github/workflows/market-test_v2.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index e71185f822..5d04130fea 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -127,7 +127,7 @@ jobs: - name: Timeout for debug if: failure() - run: sleep 900s + run: sleep 300s - name: Import test data working-directory: qa-tests @@ -170,7 +170,7 @@ jobs: - name: Timeout for debug if: failure() - run: sleep 900s + run: sleep 300s - name: Stop running containers if: always() # run this step always From 8df20582629976b352482440e47f83a4e1232627 Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 12 Sep 2022 13:16:15 +0300 Subject: [PATCH 0841/1274] confirmSponsorship migrated --- tests/src/confirmSponsorship.test.ts | 170 ++++++++++++--------------- 1 file changed, 76 insertions(+), 94 deletions(-) diff --git a/tests/src/confirmSponsorship.test.ts b/tests/src/confirmSponsorship.test.ts index 8b51199bd1..34894a1a8a 100644 --- a/tests/src/confirmSponsorship.test.ts +++ b/tests/src/confirmSponsorship.test.ts @@ -16,26 +16,6 @@ import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api'; -import { - createCollectionExpectSuccess, - setCollectionSponsorExpectSuccess, - destroyCollectionExpectSuccess, - confirmSponsorshipExpectSuccess, - confirmSponsorshipExpectFailure, - createItemExpectSuccess, - findUnusedAddress, - getGenericResult, - enableAllowListExpectSuccess, - enablePublicMintingExpectSuccess, - addToAllowListExpectSuccess, - normalizeAccountId, - addCollectionAdminExpectSuccess, - getCreatedCollectionCount, - UNIQUE, - requirePallets, - Pallets, -} from './util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; import {usingPlaygrounds} from './util/playgrounds'; @@ -58,7 +38,7 @@ describe('integration test: ext. confirmSponsorship():', () => { before(async () => { await usingPlaygrounds(async (helper) => { - [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 0n], donor); + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); @@ -82,18 +62,20 @@ describe('integration test: ext. confirmSponsorship():', () => { await usingPlaygrounds(async (helper) => { const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(charlie); + await collection.confirmSponsorship(bob); + await collection.setSponsor(alice, charlie.address); }); }); it('NFT: Transfer fees are paid by the sponsor after confirmation', async () => { await usingPlaygrounds(async (helper) => { + const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await collection.setSponsor(alice, bob.address); await collection.confirmSponsorship(bob); const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - const token = await collection.mintToken(alice, {Substrate: charlie.address}); - await token.transfer(charlie, {Substrate: alice.address}); + const token = await collection.mintToken(alice, {Substrate: zeroBalance.address}); + await token.transfer(zeroBalance, {Substrate: alice.address}); const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); expect(bobBalanceAfter < bobBalanceBefore).to.be.true; }); @@ -101,12 +83,13 @@ describe('integration test: ext. confirmSponsorship():', () => { it('Fungible: Transfer fees are paid by the sponsor after confirmation', async () => { await usingPlaygrounds(async (helper) => { + const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); await collection.setSponsor(alice, bob.address); await collection.confirmSponsorship(bob); const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - await collection.mint(alice, {Substrate: charlie.address}, 100n); - await collection.transfer(charlie, {Substrate: alice.address}, 1n); + await collection.mint(alice, {Substrate: zeroBalance.address}, 100n); + await collection.transfer(zeroBalance, {Substrate: alice.address}, 1n); const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); expect(bobBalanceAfter < bobBalanceBefore).to.be.true; }); @@ -114,12 +97,13 @@ describe('integration test: ext. confirmSponsorship():', () => { it('ReFungible: Transfer fees are paid by the sponsor after confirmation', async function() { await usingPlaygrounds(async (helper) => { + const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await collection.setSponsor(alice, bob.address); await collection.confirmSponsorship(bob); const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - const token = await collection.mintToken(alice, {Substrate: charlie.address}, 100n); - await token.transfer(charlie, {Substrate: alice.address}, 1n); + const token = await collection.mintToken(alice, {Substrate: zeroBalance.address}, 100n); + await token.transfer(zeroBalance, {Substrate: alice.address}, 1n); const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); expect(bobBalanceAfter < bobBalanceBefore).to.be.true; }); @@ -127,14 +111,15 @@ describe('integration test: ext. confirmSponsorship():', () => { it('CreateItem fees are paid by the sponsor after confirmation', async () => { await usingPlaygrounds(async (helper) => { + const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await collection.setSponsor(alice, bob.address); await collection.confirmSponsorship(bob); await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); - await collection.addToAllowList(alice, {Substrate: charlie.address}); + await collection.addToAllowList(alice, {Substrate: zeroBalance.address}); const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - await collection.mintToken(charlie, {Substrate: charlie.address}); + await collection.mintToken(zeroBalance, {Substrate: zeroBalance.address}); const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); expect(bobBalanceAfter < bobBalanceBefore).to.be.true; @@ -143,15 +128,16 @@ describe('integration test: ext. confirmSponsorship():', () => { it('NFT: Sponsoring of transfers is rate limited', async () => { await usingPlaygrounds(async (helper) => { + const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await collection.setSponsor(alice, bob.address); await collection.confirmSponsorship(bob); const token = await collection.mintToken(alice, {Substrate: alice.address}); - await token.transfer(alice, {Substrate: charlie.address}); + await token.transfer(alice, {Substrate: zeroBalance.address}); const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - const transferTx = async () => token.transfer(charlie, {Substrate: alice.address}); + const transferTx = async () => token.transfer(zeroBalance, {Substrate: alice.address}); await expect(transferTx()).to.be.rejectedWith('Inability to pay some fees'); const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); @@ -161,15 +147,16 @@ describe('integration test: ext. confirmSponsorship():', () => { it('Fungible: Sponsoring is rate limited', async () => { await usingPlaygrounds(async (helper) => { + const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await collection.setSponsor(alice, bob.address); await collection.confirmSponsorship(bob); - await collection.mint(alice, {Substrate: charlie.address}, 100n); - await collection.transfer(charlie, {Substrate: charlie.address}, 1n); + await collection.mint(alice, {Substrate: zeroBalance.address}, 100n); + await collection.transfer(zeroBalance, {Substrate: zeroBalance.address}, 1n); const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - const transferTx = async () => collection.transfer(charlie, {Substrate: charlie.address}); + const transferTx = async () => collection.transfer(zeroBalance, {Substrate: zeroBalance.address}); await expect(transferTx()).to.be.rejected; const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); @@ -179,15 +166,16 @@ describe('integration test: ext. confirmSponsorship():', () => { it('ReFungible: Sponsoring is rate limited', async function() { await usingPlaygrounds(async (helper) => { + const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await collection.setSponsor(alice, bob.address); await collection.confirmSponsorship(bob); - const token = await collection.mintToken(alice, {Substrate: charlie.address}, 100n); - await token.transfer(charlie, {Substrate: alice.address}); + const token = await collection.mintToken(alice, {Substrate: zeroBalance.address}, 100n); + await token.transfer(zeroBalance, {Substrate: alice.address}); const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - const transferTx = async () => token.transfer(charlie, {Substrate: alice.address}); + const transferTx = async () => token.transfer(zeroBalance, {Substrate: alice.address}); await expect(transferTx()).to.be.rejectedWith('Inability to pay some fees'); const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); @@ -197,16 +185,17 @@ describe('integration test: ext. confirmSponsorship():', () => { it('NFT: Sponsoring of createItem is rate limited', async () => { await usingPlaygrounds(async (helper) => { + const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await collection.setSponsor(alice, bob.address); await collection.confirmSponsorship(bob); await collection.setPermissions(alice, {mintMode: true, access: 'AllowList'}); - await collection.addToAllowList(alice, {Substrate: charlie.address}); + await collection.addToAllowList(alice, {Substrate: zeroBalance.address}); - await collection.mintToken(charlie, {Substrate: charlie.address}); + await collection.mintToken(zeroBalance, {Substrate: zeroBalance.address}); const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - const mintTx = async () => collection.mintToken(charlie, {Substrate: charlie.address}); + const mintTx = async () => collection.mintToken(zeroBalance, {Substrate: zeroBalance.address}); await expect(mintTx()).to.be.rejectedWith('Inability to pay some fees'); const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); @@ -217,83 +206,76 @@ describe('integration test: ext. confirmSponsorship():', () => { describe('(!negative test!) integration test: ext. confirmSponsorship():', () => { before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper) => { + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); it('(!negative test!) Confirm sponsorship for a collection that never existed', async () => { - // Find the collection that never existed - let collectionId = 0; - await usingApi(async (api) => { - collectionId = await getCreatedCollectionCount(api) + 1; + await usingPlaygrounds(async (helper) => { + const collectionId = 1 << 32 - 1; + const confirmSponsorshipTx = async () => helper.collection.confirmSponsorship(bob, collectionId); + await expect(confirmSponsorshipTx()).to.be.rejected; }); - - await confirmSponsorshipExpectFailure(collectionId, '//Bob'); }); it('(!negative test!) Confirm sponsorship using a non-sponsor address', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - - await usingApi(async (api) => { - const transfer = api.tx.balances.transfer(charlie.address, 1e15); - await submitTransactionAsync(alice, transfer); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + const confirmSponsorshipTx = async () => collection.confirmSponsorship(charlie); + await expect(confirmSponsorshipTx()).to.be.rejected; }); - - await confirmSponsorshipExpectFailure(collectionId, '//Charlie'); }); it('(!negative test!) Confirm sponsorship using owner address', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectFailure(collectionId, '//Alice'); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + const confirmSponsorshipTx = async () => collection.confirmSponsorship(alice); + await expect(confirmSponsorshipTx()).to.be.rejected; + }); }); it('(!negative test!) Confirm sponsorship by collection admin', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await addCollectionAdminExpectSuccess(alice, collectionId, charlie.address); - await confirmSponsorshipExpectFailure(collectionId, '//Charlie'); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.addAdmin(alice, {Substrate: charlie.address}); + const confirmSponsorshipTx = async () => collection.confirmSponsorship(charlie); + await expect(confirmSponsorshipTx()).to.be.rejected; + }); }); it('(!negative test!) Confirm sponsorship without sponsor being set with setCollectionSponsor', async () => { - const collectionId = await createCollectionExpectSuccess(); - await confirmSponsorshipExpectFailure(collectionId, '//Bob'); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const confirmSponsorshipTx = async () => collection.confirmSponsorship(charlie); + await expect(confirmSponsorshipTx()).to.be.rejected; + }); }); it('(!negative test!) Confirm sponsorship in a collection that was destroyed', async () => { - const collectionId = await createCollectionExpectSuccess(); - await destroyCollectionExpectSuccess(collectionId); - await confirmSponsorshipExpectFailure(collectionId, '//Bob'); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.burn(alice); + const confirmSponsorshipTx = async () => collection.confirmSponsorship(charlie); + await expect(confirmSponsorshipTx()).to.be.rejected; + }); }); it('(!negative test!) Transfer fees are not paid by the sponsor if the transfer failed', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collectionId, bob.address); - await confirmSponsorshipExpectSuccess(collectionId, '//Bob'); - - await usingApi(async (api, privateKeyWrapper) => { - // Find unused address - const ownerZeroBalance = await findUnusedAddress(api, privateKeyWrapper); - - // Find another unused address - const senderZeroBalance = await findUnusedAddress(api, privateKeyWrapper); - - // Mint token for an unused address - const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', ownerZeroBalance.address); - - const sponsorBalanceBeforeTx = (await api.query.system.account(bob.address)).data.free.toBigInt(); - - // Try to transfer this token from an unsponsored unused adress to Alice - const zeroToAlice = api.tx.unique.transfer(normalizeAccountId(alice.address), collectionId, itemId, 0); - await expect(submitTransactionExpectFailAsync(senderZeroBalance, zeroToAlice)).to.be.rejected; - - const sponsorBalanceAfterTx = (await api.query.system.account(bob.address)).data.free.toBigInt(); - - expect(sponsorBalanceAfterTx).to.equal(sponsorBalanceBeforeTx); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + const [ownerZeroBalance, senderZeroBalance] = await helper.arrange.createAccounts([0n, 0n], donor); + const token = await collection.mintToken(alice, {Substrate: ownerZeroBalance.address}); + const sponsorBalanceBefore = await helper.balance.getSubstrate(bob.address); + const transferTx = async () => token.transfer(senderZeroBalance, {Substrate: alice.address}); + await expect(transferTx()).to.be.rejected; + const sponsorBalanceAfter = await helper.balance.getSubstrate(bob.address); + expect(sponsorBalanceAfter).to.equal(sponsorBalanceBefore); }); }); }); From 792a004ac69cd78a5db4d722b9a084bfdde6a328 Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 12 Sep 2022 14:06:09 +0300 Subject: [PATCH 0842/1274] createCollection migrated --- tests/src/createCollection.test.ts | 169 ++++++++++++++++------------- 1 file changed, 92 insertions(+), 77 deletions(-) diff --git a/tests/src/createCollection.test.ts b/tests/src/createCollection.test.ts index 0cddcd7c61..ac62c78865 100644 --- a/tests/src/createCollection.test.ts +++ b/tests/src/createCollection.test.ts @@ -14,130 +14,145 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {expect} from 'chai'; -import usingApi, {executeTransaction, submitTransactionAsync} from './substrate/substrate-api'; -import {createCollectionWithPropsExpectFailure, createCollectionExpectFailure, createCollectionExpectSuccess, getCreateCollectionResult, getDetailedCollectionInfo, createCollectionWithPropsExpectSuccess, requirePallets, Pallets} from './util/helpers'; +import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; +import {usingPlaygrounds} from './util/playgrounds'; +import {IKeyringPair} from '@polkadot/types/types'; +import {IProperty} from './util/playgrounds/types'; + +chai.use(chaiAsPromised); +const expect = chai.expect; + +let donor: IKeyringPair; + +before(async () => { + await usingPlaygrounds(async (_, privateKey) => { + donor = privateKey('//Alice'); + }); +}); + +let alice: IKeyringPair; describe('integration test: ext. createCollection():', () => { + before(async () => { + await usingPlaygrounds(async (helper) => { + [alice] = await helper.arrange.createAccounts([100n], donor); + }); + }); it('Create new NFT collection', async () => { - await createCollectionExpectSuccess({name: 'A', description: 'B', tokenPrefix: 'C', mode: {type: 'NFT'}}); + await usingPlaygrounds(async (helper) => { + await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + }); }); it('Create new NFT collection whith collection_name of maximum length (64 bytes)', async () => { - await createCollectionExpectSuccess({name: 'A'.repeat(64)}); + await usingPlaygrounds(async (helper) => { + await helper.nft.mintCollection(alice, {name: 'A'.repeat(64), description: 'descr', tokenPrefix: 'COL'}); + }); }); it('Create new NFT collection whith collection_description of maximum length (256 bytes)', async () => { - await createCollectionExpectSuccess({description: 'A'.repeat(256)}); + await usingPlaygrounds(async (helper) => { + await helper.nft.mintCollection(alice, {name: 'name', description: 'A'.repeat(256), tokenPrefix: 'COL'}); + }); }); it('Create new NFT collection whith token_prefix of maximum length (16 bytes)', async () => { - await createCollectionExpectSuccess({tokenPrefix: 'A'.repeat(16)}); + await usingPlaygrounds(async (helper) => { + await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'A'.repeat(16)}); + }); }); it('Create new Fungible collection', async () => { - await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); + await usingPlaygrounds(async (helper) => { + await helper.ft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 0); + }); }); it('Create new ReFungible collection', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - }); - - it('create new collection with properties #1', async () => { - await createCollectionWithPropsExpectSuccess({name: 'A', description: 'B', tokenPrefix: 'C', mode: {type: 'NFT'}, - properties: [{key: 'key1', value: 'val1'}], - propPerm: [{key: 'key1', permission: {tokenOwner: true, mutable: false, collectionAdmin: true}}]}); - }); - - it('create new collection with properties #2', async () => { - await createCollectionWithPropsExpectSuccess({name: 'A', description: 'B', tokenPrefix: 'C', mode: {type: 'NFT'}, - properties: [{key: 'key1', value: 'val1'}], - propPerm: [{key: 'key1', permission: {tokenOwner: true, mutable: false, collectionAdmin: true}}]}); + await usingPlaygrounds(async (helper) => { + await helper.rft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); + }); }); - it('create new collection with properties #3', async () => { - await createCollectionWithPropsExpectSuccess({name: 'A', description: 'B', tokenPrefix: 'C', mode: {type: 'NFT'}, - properties: [{key: 'key1', value: 'val1'}], - propPerm: [{key: 'key1', permission: {tokenOwner: true, mutable: false, collectionAdmin: true}}]}); + it('create new collection with properties', async () => { + await usingPlaygrounds(async (helper) => { + await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', + properties: [{key: 'key1', value: 'val1'}], + tokenPropertyPermissions: [{key: 'key1', permission: {tokenOwner: true, mutable: false, collectionAdmin: true}}], + }); + }); }); it('Create new collection with extra fields', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const tx = api.tx.unique.createCollectionEx({ - mode: {Fungible: 8}, - permissions: { - access: 'AllowList', - }, - name: [1], - description: [2], - tokenPrefix: '0x000000', - pendingSponsor: bob.address, - limits: { - accountTokenOwnershipLimit: 3, - }, - }); - const events = await submitTransactionAsync(alice, tx); - const result = getCreateCollectionResult(events); - - const collection = (await getDetailedCollectionInfo(api, result.collectionId))!; - expect(collection.owner.toString()).to.equal(alice.address); - expect(collection.mode.asFungible.toNumber()).to.equal(8); - expect(collection.permissions.access.toHuman()).to.equal('AllowList'); - expect(collection.name.map(v => v.toNumber())).to.deep.equal([1]); - expect(collection.description.map(v => v.toNumber())).to.deep.equal([2]); - expect(collection.tokenPrefix.toString()).to.equal('0x000000'); - expect(collection.sponsorship.asUnconfirmed.toString()).to.equal(bob.address); - expect(collection.limits.accountTokenOwnershipLimit.unwrap().toNumber()).to.equal(3); + await usingPlaygrounds(async (helper) => { + const collection = await helper.ft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 8); + await collection.setPermissions(alice, {access: 'AllowList'}); + await collection.setLimits(alice, {accountTokenOwnershipLimit: 3}); + const data = await collection.getData(); + const limits = await collection.getEffectiveLimits(); + const raw = data?.raw; + + expect(data?.normalizedOwner).to.be.equal(alice.address); + expect(data?.name).to.be.equal('name'); + expect(data?.description).to.be.equal('descr'); + expect(raw.permissions.access).to.be.equal('AllowList'); + expect(raw.mode).to.be.deep.equal({Fungible: '8'}); + expect(limits.accountTokenOwnershipLimit).to.be.equal(3); }); }); it('New collection is not external', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const tx = api.tx.unique.createCollectionEx({ }); - const events = await submitTransactionAsync(alice, tx); - const result = getCreateCollectionResult(events); - - const collection = (await getDetailedCollectionInfo(api, result.collectionId))!; - expect(collection.readOnly.toHuman()).to.be.false; + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); + const data = await collection.getData(); + expect(data?.raw.readOnly).to.be.false; }); }); }); describe('(!negative test!) integration test: ext. createCollection():', () => { it('(!negative test!) create new NFT collection whith incorrect data (collection_name)', async () => { - await createCollectionExpectFailure({name: 'A'.repeat(65), mode: {type: 'NFT'}}); + await usingPlaygrounds(async (helper) => { + const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'A'.repeat(65), description: 'descr', tokenPrefix: 'COL'}); + await expect(mintCollectionTx()).to.be.rejected; + }); }); it('(!negative test!) create new NFT collection whith incorrect data (collection_description)', async () => { - await createCollectionExpectFailure({description: 'A'.repeat(257), mode: {type: 'NFT'}}); + await usingPlaygrounds(async (helper) => { + const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'A'.repeat(257), tokenPrefix: 'COL'}); + await expect(mintCollectionTx()).to.be.rejected; + }); }); it('(!negative test!) create new NFT collection whith incorrect data (token_prefix)', async () => { - await createCollectionExpectFailure({tokenPrefix: 'A'.repeat(17), mode: {type: 'NFT'}}); + await usingPlaygrounds(async (helper) => { + const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'A'.repeat(17)}); + await expect(mintCollectionTx()).to.be.rejected; + }); }); - it('fails when bad limits are set', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const tx = api.tx.unique.createCollectionEx({mode: 'NFT', limits: {tokenLimit: 0}}); - await expect(executeTransaction(api, alice, tx)).to.be.rejectedWith(/^common.CollectionTokenLimitExceeded$/); + it('(!negative test!) fails when bad limits are set', async () => { + await usingPlaygrounds(async (helper) => { + const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', limits: {tokenLimit: 0}}); + await expect(mintCollectionTx()).to.be.rejected; }); }); it('(!negative test!) create collection with incorrect property limit (64 elements)', async () => { - const props = []; + const props: IProperty[] = []; for (let i = 0; i < 65; i++) { props.push({key: `key${i}`, value: `value${i}`}); } - - await createCollectionWithPropsExpectFailure({name: 'A', description: 'B', tokenPrefix: 'C', mode: {type: 'NFT'}, properties: props}); + await usingPlaygrounds(async (helper) => { + const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', properties: props}); + await expect(mintCollectionTx()).to.be.rejected; + }); }); it('(!negative test!) create collection with incorrect property limit (40 kb)', async () => { - const props = []; + const props: IProperty[] = []; for (let i = 0; i < 32; i++) { props.push({key: `key${i}`.repeat(80), value: `value${i}`.repeat(80)}); } - - await createCollectionWithPropsExpectFailure({name: 'A', description: 'B', tokenPrefix: 'C', mode: {type: 'NFT'}, properties: props}); + await usingPlaygrounds(async (helper) => { + const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', properties: props}); + await expect(mintCollectionTx()).to.be.rejected; + }); }); }); From e336581882804dfa9639b67bad493c8a76ce562e Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 12 Sep 2022 15:02:40 +0300 Subject: [PATCH 0843/1274] remove depricated workflows. change branch for canary tests --- .github/workflows/codestyle.yml | 89 ----------- .github/workflows/market-test.yml | 227 --------------------------- .github/workflows/market-test_v2.yml | 11 +- 3 files changed, 5 insertions(+), 322 deletions(-) delete mode 100644 .github/workflows/codestyle.yml delete mode 100644 .github/workflows/market-test.yml diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml deleted file mode 100644 index f9c582e6ae..0000000000 --- a/.github/workflows/codestyle.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: cargo fmt - -on: - pull_request: - branches: - - develop - types: - - opened - - reopened - - synchronize - - ready_for_review - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -jobs: - rustfmt: - runs-on: self-hosted-ci - - steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - - uses: actions/checkout@v3 - - name: Install latest nightly - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - default: true - target: wasm32-unknown-unknown - components: rustfmt, clippy - - name: Run cargo fmt - run: cargo fmt -- --check # In that mode it returns only exit code. - - name: Cargo fmt state - if: success() - run: echo "Nothing to do. Command 'cargo fmt -- --check' returned exit code 0." - - - clippy: - if: ${{ false }} - runs-on: self-hosted-ci - - steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - - uses: actions/checkout@v3 - - name: Install substrate dependencies - run: sudo apt-get install libssl-dev pkg-config libclang-dev clang - - name: Install latest nightly - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - default: true - target: wasm32-unknown-unknown - components: rustfmt, clippy - - name: Run cargo check - run: cargo clippy -- -Dwarnings diff --git a/.github/workflows/market-test.yml b/.github/workflows/market-test.yml deleted file mode 100644 index e1fae8137c..0000000000 --- a/.github/workflows/market-test.yml +++ /dev/null @@ -1,227 +0,0 @@ -name: market api tests - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - market_test: - # The type of runner that the job will run on - runs-on: [self-hosted-ci,large] - timeout-minutes: 1380 - - strategy: - matrix: - include: - - network: "opal" - features: "opal-runtime" - - network: "quartz" - features: "quartz-runtime" - - network: "unique" - features: "unique-runtime" - - name: draft job - - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - - - steps: -# - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) -# if: github.event.pull_request.draft == true -# run: exit 1 - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout master repo - uses: actions/checkout@master - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Checkout Market e2e tests - uses: actions/checkout@v3 - with: - repository: 'UniqueNetwork/market-e2e-tests' - ssh-key: '${{ secrets.GH_PAT }}' - path: 'qa-tests' - ref: 'QA-65_maxandreev' - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Copy qa-tests/.env.example to qa-tests/.env - working-directory: qa-tests - run: cp .env.docker .env - - - name: Show content of qa-test/.env - working-directory: qa-tests - run: cat .env - - - name: Read qa -test .env file - uses: xom9ikk/dotenv@v1.0.2 - with: - path: qa-tests/ - - - name: Generate ENV related extend file for docker-compose - uses: cuchi/jinja2-action@v1.2.0 - with: - template: qa-tests/.docker/docker-compose.tmp-market.j2 - output_file: qa-tests/.docker/docker-compose.${{ matrix.network }}.yml - variables: | - REPO_URL=${{ github.server_url }}/${{ github.repository }}.git - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} - FEATURE=${{ matrix.features }} - BRANCH=${{ github.head_ref }} - - - - name: Show build configuration - working-directory: qa-tests - run: cat .docker/docker-compose.${{ matrix.network }}.yml - - - name: Start node-parachain - working-directory: qa-tests - run: docker-compose -f ".docker/docker-compose.market.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate node-parachain - - - name: Start nonce-app - working-directory: qa-tests - run: docker-compose -f ".docker/docker-compose.market.yml" up -d --build --remove-orphans --force-recreate nonce-app - - - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Setup TypeScript - working-directory: qa-tests - run: | - npm install - npm install -g ts-node - - - name: Copy qa-tests/.env.example to qa-tests/.env - working-directory: qa-tests - run: | - rm -rf .env - cp .env.example .env - - - - name: Show content of qa-test/.env - working-directory: qa-tests - run: cat .env - - - - name: Read qa -test .env file - uses: xom9ikk/dotenv@v1.0.2 - with: - path: qa-tests/ - - - name: Generate accounts - working-directory: qa-tests - run: ts-node ./src/scripts/create-market-accounts.ts - - - name: Deploy contracts - run: | - cd qa-tests - ts-node ./src/scripts/deploy-contract.ts - - - name: Import test data - working-directory: qa-tests - run: ts-node ./src/scripts/create-test-collections.ts - - - name: Show content of qa-test .env - working-directory: qa-tests - run: cat .env - - - name: Copy qa-tests/.env.example to qa-tests/.env - working-directory: qa-tests - run: | - rm -rf .env.docker - cp .env .env.docker - sed -i '/UNIQUE_WS_ENDPOINT/c UNIQUE_WS_ENDPOINT=ws://node-parachain:9944' .env.docker - - - name: Read qa -test .env file - uses: xom9ikk/dotenv@v1.0.2 - with: - path: qa-tests/ - - - name: local-market:start - run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" up -d --build - - - name: Wait for market readyness - working-directory: qa-tests - run: src/scripts/wait-market-ready.sh - shell: bash - - - name: Install dependecies - working-directory: qa-tests - run: | - npm ci - npm install -D @playwright/test - npx playwright install-deps - npx playwright install - - - name: - working-directory: qa-tests - run: | - npx playwright test --workers=8 --quiet .*.api.test.ts --reporter=github --config playwright.config.ts - - - name: Show env variables - if: success() || failure() - run: printenv - - - name: look up for report - if: success() || failure() - run: | - ls -la - ls -la qa-tests/ - - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes - - - name: Remove builder cache - if: always() # run this step always - run: | - docker builder prune -f - docker system prune -f - - - name: Clean Workspace - if: always() - uses: AutoModality/action-clean@v1.1.0 - - - - diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index 5d04130fea..db8e7a5c7d 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -22,10 +22,10 @@ jobs: include: - network: "opal" features: "opal-runtime" -# - network: "quartz" -# features: "quartz-runtime" -# - network: "unique" -# features: "unique-runtime" + - network: "quartz" + features: "quartz-runtime" + - network: "unique" + features: "unique-runtime" steps: @@ -45,7 +45,7 @@ jobs: repository: 'UniqueNetwork/market-e2e-tests' ssh-key: ${{ secrets.GH_PAT }} path: 'qa-tests' - ref: 'ci_test_v2' + ref: 'master' - name: Read .env file uses: xom9ikk/dotenv@v1.0.2 @@ -175,7 +175,6 @@ jobs: - name: Stop running containers if: always() # run this step always run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes -# run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down - name: Remove builder cache if: always() # run this step always From d856e8716cfdab055c27823a9aa6bf3052f0f952 Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 12 Sep 2022 15:51:32 +0300 Subject: [PATCH 0844/1274] createItem migrated --- tests/src/createItem.test.ts | 335 +++++++++++++++++------------------ 1 file changed, 163 insertions(+), 172 deletions(-) diff --git a/tests/src/createItem.test.ts b/tests/src/createItem.test.ts index 720b72a53b..4cdbb57561 100644 --- a/tests/src/createItem.test.ts +++ b/tests/src/createItem.test.ts @@ -14,52 +14,57 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {default as usingApi, executeTransaction} from './substrate/substrate-api'; import chai from 'chai'; +import chaiAsPromised from 'chai-as-promised'; import {IKeyringPair} from '@polkadot/types/types'; import { - createCollectionExpectSuccess, - createItemExpectSuccess, - addCollectionAdminExpectSuccess, - createCollectionWithPropsExpectSuccess, - createItemWithPropsExpectSuccess, - createItemWithPropsExpectFailure, createCollection, - transferExpectSuccess, itApi, normalizeAccountId, getCreateItemResult, - requirePallets, - Pallets, } from './util/helpers'; +import {usingPlaygrounds} from './util/playgrounds'; +import {IProperty} from './util/playgrounds/types'; +import {executeTransaction} from './substrate/substrate-api'; +chai.use(chaiAsPromised); const expect = chai.expect; + +let donor: IKeyringPair; + +before(async () => { + await usingPlaygrounds(async (_, privateKey) => { + donor = privateKey('//Alice'); + }); +}); + let alice: IKeyringPair; let bob: IKeyringPair; describe('integration test: ext. ():', () => { before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper) => { + [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); it('Create new item in NFT collection', async () => { - const createMode = 'NFT'; - const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}}); - await createItemExpectSuccess(alice, newCollectionID, createMode); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.mintToken(alice, {Substrate: alice.address}); + }); }); it('Create new item in Fungible collection', async () => { - const createMode = 'Fungible'; - const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}}); - await createItemExpectSuccess(alice, newCollectionID, createMode); + await usingPlaygrounds(async (helper) => { + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await collection.mint(alice, {Substrate: alice.address}, 10n); + }); }); - itApi('Check events on create new item in Fungible collection', async ({api}) => { + itApi.skip('Check events on create new item in Fungible collection', async ({api}) => { const createMode = 'Fungible'; - + const newCollectionID = (await createCollection(api, alice, {mode: {type: createMode, decimalPoints: 0}})).collectionId; - + const to = normalizeAccountId(alice); { const createData = {fungible: {value: 100}}; @@ -82,240 +87,226 @@ describe('integration test: ext. ():', () => { }); it('Create new item in ReFungible collection', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const createMode = 'ReFungible'; - const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}}); - await createItemExpectSuccess(alice, newCollectionID, createMode); + await usingPlaygrounds(async (helper) => { + const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.mintToken(alice, {Substrate: alice.address}, 100n); + }); }); it('Create new item in NFT collection with collection admin permissions', async () => { - const createMode = 'NFT'; - const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}}); - await addCollectionAdminExpectSuccess(alice, newCollectionID, bob.address); - await createItemExpectSuccess(bob, newCollectionID, createMode); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.addAdmin(alice, {Substrate: bob.address}); + await collection.mintToken(bob, {Substrate: alice.address}); + }); }); it('Create new item in Fungible collection with collection admin permissions', async () => { - const createMode = 'Fungible'; - const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}}); - await addCollectionAdminExpectSuccess(alice, newCollectionID, bob.address); - await createItemExpectSuccess(bob, newCollectionID, createMode); + await usingPlaygrounds(async (helper) => { + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await collection.addAdmin(alice, {Substrate: bob.address}); + await collection.mint(bob, {Substrate: alice.address}, 10n); + }); }); it('Create new item in ReFungible collection with collection admin permissions', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const createMode = 'ReFungible'; - const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}}); - await addCollectionAdminExpectSuccess(alice, newCollectionID, bob.address); - await createItemExpectSuccess(bob, newCollectionID, createMode); + await usingPlaygrounds(async (helper) => { + const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.addAdmin(alice, {Substrate: bob.address}); + await collection.mintToken(bob, {Substrate: alice.address}, 100n); + }); }); it('Set property Admin', async () => { - const createMode = 'NFT'; - const newCollectionID = await createCollectionWithPropsExpectSuccess({mode: {type: createMode}, - propPerm: [{key: 'k', permission: {mutable: true, collectionAdmin: true, tokenOwner: false}}]}); - - await createItemWithPropsExpectSuccess(alice, newCollectionID, createMode, [{key: 'k', value: 't2'}]); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', + properties: [{key: 'k', value: 'v'}], + tokenPropertyPermissions: [{key: 'k', permission: {tokenOwner: false, mutable: true, collectionAdmin: true}}], + }); + await collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); + }); }); it('Set property AdminConst', async () => { - const createMode = 'NFT'; - const newCollectionID = await createCollectionWithPropsExpectSuccess({mode: {type: createMode}, - propPerm: [{key: 'key1', permission: {mutable: false, collectionAdmin: true, tokenOwner: false}}]}); - - await createItemWithPropsExpectSuccess(alice, newCollectionID, createMode, [{key: 'key1', value: 'val1'}]); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', + properties: [{key: 'k', value: 'v'}], + tokenPropertyPermissions: [{key: 'k', permission: {tokenOwner: false, mutable: false, collectionAdmin: true}}], + }); + await collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); + }); }); it('Set property itemOwnerOrAdmin', async () => { - const createMode = 'NFT'; - const newCollectionID = await createCollectionWithPropsExpectSuccess({mode: {type: createMode}, - propPerm: [{key: 'key1', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}]}); - - await createItemWithPropsExpectSuccess(alice, newCollectionID, createMode, [{key: 'key1', value: 'val1'}]); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', + properties: [{key: 'k', value: 'v'}], + tokenPropertyPermissions: [{key: 'k', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}], + }); + await collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); + }); }); it('Check total pieces of Fungible token', async () => { - await usingApi(async api => { - const createMode = 'Fungible'; - const collectionId = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}}); - const amountPieces = 10n; - const tokenId = await createItemExpectSuccess(alice, collectionId, createMode, bob.address); + await usingPlaygrounds(async (helper) => { + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + const amount = 10n; + await collection.mint(alice, {Substrate: bob.address}, amount); { - const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); - expect(totalPieces.isSome).to.be.true; - expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); + const totalPieces = await collection.getTotalPieces(); + expect(totalPieces).to.be.equal(amount); } - - await transferExpectSuccess(collectionId, tokenId, bob, alice, 1, createMode); + await collection.transfer(bob, {Substrate: alice.address}, 1n); { - const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); - expect(totalPieces.isSome).to.be.true; - expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); + const totalPieces = await collection.getTotalPieces(); + expect(totalPieces).to.be.equal(amount); } - - const totalPieces = (await api.rpc.unique.tokenData(collectionId, tokenId, [])).pieces; - expect(totalPieces.toBigInt()).to.be.eq(amountPieces); }); }); it('Check total pieces of NFT token', async () => { - await usingApi(async api => { - const createMode = 'NFT'; - const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}}); - const amountPieces = 1n; - const tokenId = await createItemExpectSuccess(alice, collectionId, createMode, bob.address); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const amount = 1n; + const token = await collection.mintToken(alice, {Substrate: bob.address}); { - const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); - expect(totalPieces.isSome).to.be.true; - expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); + const totalPieces = await helper.api?.rpc.unique.totalPieces(collection.collectionId, token.tokenId); + expect(totalPieces?.unwrap().toBigInt()).to.be.equal(amount); } - - await transferExpectSuccess(collectionId, tokenId, bob, alice, 1, createMode); + await token.transfer(bob, {Substrate: alice.address}); { - const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); - expect(totalPieces.isSome).to.be.true; - expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); + const totalPieces = await helper.api?.rpc.unique.totalPieces(collection.collectionId, token.tokenId); + expect(totalPieces?.unwrap().toBigInt()).to.be.equal(amount); } - - const totalPieces = (await api.rpc.unique.tokenData(collectionId, tokenId, [])).pieces; - expect(totalPieces.toBigInt()).to.be.eq(amountPieces); }); }); it('Check total pieces of ReFungible token', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await usingApi(async api => { - const createMode = 'ReFungible'; - const createCollectionResult = await createCollection(api, alice, {mode: {type: createMode}}); - const collectionId = createCollectionResult.collectionId; - const amountPieces = 100n; - const tokenId = await createItemExpectSuccess(alice, collectionId, createMode, bob.address); + await usingPlaygrounds(async (helper) => { + const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const amount = 100n; + const token = await collection.mintToken(alice, {Substrate: bob.address}, amount); { - const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); - expect(totalPieces.isSome).to.be.true; - expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); + const totalPieces = await token.getTotalPieces(); + expect(totalPieces).to.be.equal(amount); } - - await transferExpectSuccess(collectionId, tokenId, bob, alice, 60n, createMode); + await token.transfer(bob, {Substrate: alice.address}, 60n); { - const totalPieces = await api.rpc.unique.totalPieces(collectionId, tokenId); - expect(totalPieces.isSome).to.be.true; - expect(totalPieces.unwrap().toBigInt()).to.be.eq(amountPieces); + const totalPieces = await token.getTotalPieces(); + expect(totalPieces).to.be.equal(amount); } - - const totalPieces = (await api.rpc.unique.tokenData(collectionId, tokenId, [])).pieces; - expect(totalPieces.toBigInt()).to.be.eq(amountPieces); }); }); }); describe('Negative integration test: ext. createItem():', () => { before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper) => { + [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); it('Regular user cannot create new item in NFT collection', async () => { - const createMode = 'NFT'; - const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}}); - await expect(createItemExpectSuccess(bob, newCollectionID, createMode)).to.be.rejected; + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const mintTx = async () => collection.mintToken(bob, {Substrate: bob.address}); + await expect(mintTx()).to.be.rejected; + }); }); it('Regular user cannot create new item in Fungible collection', async () => { - const createMode = 'Fungible'; - const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}}); - await expect(createItemExpectSuccess(bob, newCollectionID, createMode)).to.be.rejected; + await usingPlaygrounds(async (helper) => { + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + const mintTx = async () => collection.mint(bob, {Substrate: bob.address}, 10n); + await expect(mintTx()).to.be.rejected; + }); }); - it('Regular user cannot create new item in ReFungible collection', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const createMode = 'ReFungible'; - const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}}); - await expect(createItemExpectSuccess(bob, newCollectionID, createMode)).to.be.rejected; + it('Regular user cannot create new item in ReFungible collection', async () => { + await usingPlaygrounds(async (helper) => { + const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const mintTx = async () => collection.mintToken(bob, {Substrate: bob.address}); + await expect(mintTx()).to.be.rejected; + }); }); it('No editing rights', async () => { - await usingApi(async () => { - const createMode = 'NFT'; - const newCollectionID = await createCollectionWithPropsExpectSuccess({mode: {type: createMode}, - propPerm: [{key: 'key1', permission: {mutable: false, collectionAdmin: false, tokenOwner: false}}]}); - await addCollectionAdminExpectSuccess(alice, newCollectionID, bob.address); - - await createItemWithPropsExpectFailure(bob, newCollectionID, 'NFT', [{key: 'key1', value: 'v'}]); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL', + tokenPropertyPermissions: [{key: 'k', permission: {mutable: false, collectionAdmin: false, tokenOwner: false}}], + }); + const mintTx = async () => collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); + await expect(mintTx()).to.be.rejected; }); }); it('User doesnt have editing rights', async () => { - await usingApi(async () => { - const newCollectionID = await createCollectionWithPropsExpectSuccess({propPerm: [{key: 'key1', permission: {mutable: true, collectionAdmin: false, tokenOwner: false}}]}); - await createItemWithPropsExpectFailure(bob, newCollectionID, 'NFT', [{key: 'key1', value: 'v'}]); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL', + tokenPropertyPermissions: [{key: 'k', permission: {mutable: true, collectionAdmin: false, tokenOwner: false}}], + }); + const mintTx = async () => collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); + await expect(mintTx()).to.be.rejected; }); }); it('Adding property without access rights', async () => { - await usingApi(async () => { - const newCollectionID = await createCollectionWithPropsExpectSuccess(); - await addCollectionAdminExpectSuccess(alice, newCollectionID, bob.address); - - await createItemWithPropsExpectFailure(bob, newCollectionID, 'NFT', [{key: 'k', value: 'v'}]); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const mintTx = async () => collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); + await expect(mintTx()).to.be.rejected; }); }); it('Adding more than 64 prps', async () => { - await usingApi(async () => { - const prps = []; + const props: IProperty[] = []; - for (let i = 0; i < 65; i++) { - prps.push({key: `key${i}`, value: `value${i}`}); - } + for (let i = 0; i < 65; i++) { + props.push({key: `key${i}`, value: `value${i}`}); + } - const newCollectionID = await createCollectionWithPropsExpectSuccess(); - - await createItemWithPropsExpectFailure(alice, newCollectionID, 'NFT', prps); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const mintTx = async () => collection.mintToken(alice, {Substrate: bob.address}, props); + await expect(mintTx()).to.be.rejected; }); }); it('Trying to add bigger property than allowed', async () => { - await usingApi(async () => { - const newCollectionID = await createCollectionWithPropsExpectSuccess(); - - await createItemWithPropsExpectFailure(alice, newCollectionID, 'NFT', [{key: 'k', value: 'vvvvvv'.repeat(5000)}, {key: 'k2', value: 'vvv'.repeat(5000)}]); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'k1', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}, + {key: 'k2', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}, + ], + }); + const mintTx = async () => collection.mintToken(alice, {Substrate: bob.address}, [ + {key: 'k1', value: 'vvvvvv'.repeat(5000)}, + {key: 'k2', value: 'vvv'.repeat(5000)}, + ]); + await expect(mintTx()).to.be.rejected; }); }); it('Check total pieces for invalid Fungible token', async () => { - await usingApi(async api => { - const createCollectionResult = await createCollection(api, alice, {mode: {type: 'Fungible', decimalPoints: 0}}); - const collectionId = createCollectionResult.collectionId; - const invalidTokenId = 1000_000; - - expect((await api.rpc.unique.totalPieces(collectionId, invalidTokenId)).isNone).to.be.true; - expect((await api.rpc.unique.tokenData(collectionId, invalidTokenId, [])).pieces.toBigInt()).to.be.eq(0n); + await usingPlaygrounds(async (helper) => { + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + const invalidTokenId = 1_000_000; + expect((await helper.api?.rpc.unique.totalPieces(collection.collectionId, invalidTokenId))?.isNone).to.be.true; + expect((await helper.api?.rpc.unique.tokenData(collection.collectionId, invalidTokenId))?.pieces.toBigInt()).to.be.equal(0n); }); }); it('Check total pieces for invalid NFT token', async () => { - await usingApi(async api => { - const createCollectionResult = await createCollection(api, alice, {mode: {type: 'NFT'}}); - const collectionId = createCollectionResult.collectionId; - const invalidTokenId = 1000_000; - - expect((await api.rpc.unique.totalPieces(collectionId, invalidTokenId)).isNone).to.be.true; - expect((await api.rpc.unique.tokenData(collectionId, invalidTokenId, [])).pieces.toBigInt()).to.be.eq(0n); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const invalidTokenId = 1_000_000; + expect((await helper.api?.rpc.unique.totalPieces(collection.collectionId, invalidTokenId))?.isNone).to.be.true; + expect((await helper.api?.rpc.unique.tokenData(collection.collectionId, invalidTokenId))?.pieces.toBigInt()).to.be.equal(0n); }); }); it('Check total pieces for invalid Refungible token', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await usingApi(async api => { - const createCollectionResult = await createCollection(api, alice, {mode: {type: 'ReFungible'}}); - const collectionId = createCollectionResult.collectionId; - const invalidTokenId = 1000_000; - - expect((await api.rpc.unique.totalPieces(collectionId, invalidTokenId)).isNone).to.be.true; - expect((await api.rpc.unique.tokenData(collectionId, invalidTokenId, [])).pieces.toBigInt()).to.be.eq(0n); + await usingPlaygrounds(async (helper) => { + const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const invalidTokenId = 1_000_000; + expect((await helper.api?.rpc.unique.totalPieces(collection.collectionId, invalidTokenId))?.isNone).to.be.true; + expect((await helper.api?.rpc.unique.tokenData(collection.collectionId, invalidTokenId))?.pieces.toBigInt()).to.be.equal(0n); }); }); }); From 5b62d1ef1d28131176070fe032179d23f67a8319 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Mon, 12 Sep 2022 20:31:10 +0700 Subject: [PATCH 0845/1274] added `doc` to app promotion --- Cargo.lock | 4 +- node/cli/CHANGELOG.md | 6 + node/rpc/CHANGELOG.md | 5 + node/rpc/Cargo.toml | 2 +- pallets/app-promotion/src/benchmarking.rs | 1 + pallets/app-promotion/src/lib.rs | 236 +- pallets/app-promotion/src/types.rs | 29 +- pallets/evm-contract-helpers/CHANGELOG.md | 26 +- pallets/evm-contract-helpers/Cargo.toml | 2 +- pallets/evm-contract-helpers/src/lib.rs | 10 +- pallets/unique/CHANGELOG.md | 2 +- pallets/unique/src/lib.rs | 17 + primitives/common/CHANGELOG.md | 5 + runtime/opal/CHANGELOG.md | 15 +- runtime/quartz/CHANGELOG.md | 16 +- runtime/quartz/Cargo.lock | 11721 ++++++++++++++++++++ runtime/unique/CHANGELOG.md | 15 +- 17 files changed, 12020 insertions(+), 92 deletions(-) create mode 100644 runtime/quartz/Cargo.lock diff --git a/Cargo.lock b/Cargo.lock index 6bf10da49c..f537815251 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5733,7 +5733,7 @@ dependencies = [ [[package]] name = "pallet-evm-contract-helpers" -version = "0.2.0" +version = "0.3.0" dependencies = [ "ethereum", "evm-coder", @@ -12316,7 +12316,7 @@ dependencies = [ [[package]] name = "unique-rpc" -version = "0.1.1" +version = "0.1.2" dependencies = [ "app-promotion-rpc", "fc-db", diff --git a/node/cli/CHANGELOG.md b/node/cli/CHANGELOG.md index e6007e524a..b2c7754574 100644 --- a/node/cli/CHANGELOG.md +++ b/node/cli/CHANGELOG.md @@ -1,4 +1,10 @@ + +## [v0.9.27] 2022-09-08 + +### Added +- Support RPC for `AppPromotion` pallet. + ## [v0.9.27] 2022-08-16 ### Other changes diff --git a/node/rpc/CHANGELOG.md b/node/rpc/CHANGELOG.md index 732ab15dc7..3bdb41378c 100644 --- a/node/rpc/CHANGELOG.md +++ b/node/rpc/CHANGELOG.md @@ -1,4 +1,9 @@ +## [v0.1.2] 2022-09-08 + +### Added +- Support RPC for `AppPromotion` pallet. + ## [v0.1.1] 2022-08-16 ### Other changes diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index f133e412cd..85240d994d 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unique-rpc" -version = "0.1.1" +version = "0.1.2" authors = ['Unique Network '] license = 'GPLv3' edition = "2021" diff --git a/pallets/app-promotion/src/benchmarking.rs b/pallets/app-promotion/src/benchmarking.rs index ae2e235bd6..9e76433e4a 100644 --- a/pallets/app-promotion/src/benchmarking.rs +++ b/pallets/app-promotion/src/benchmarking.rs @@ -112,6 +112,7 @@ benchmarks! { let share = Perbill::from_rational(1u32, 20); let _ = ::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::::max_value()); (0..10).map(|_| { + // used to change block number >::finalize(); PromototionPallet::::stake(RawOrigin::Signed(caller.clone()).into(), share * ::Currency::total_balance(&caller)) }).collect::, _>>()?; diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index ce3b9e9d4f..7cef751c7a 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -14,13 +14,34 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -//! # App promotion +//! # App Promotion pallet //! -//! The app promotion pallet is designed to ... . +//! The pallet implements the mechanics of staking and sponsoring collections/contracts. +//! +//! - [`Config`] +//! - [`Pallet`] +//! - [`Error`] +//! - [`Event`] +//! +//! ## Overview +//! The App Promotion pallet allows fund holders to stake at a certain daily rate of return. +//! The mechanics implemented in the pallet allow it to act as a sponsor for collections / contracts, +//! the list of which is set by the pallet administrator. +//! //! //! ## Interface +//! The pallet provides interfaces for funds, collection/contract operations (see [types] module). + //! //! ### Dispatchable Functions +//! - [`set_admin_address`][`Pallet::set_admin_address`] - sets an address as the the admin. +//! - [`stake`][`Pallet::stake`] - stakes the amount of native tokens. +//! - [`unstake`][`Pallet::unstake`] - unstakes all stakes. +//! - [`sponsor_collection`][`Pallet::sponsor_collection`] - sets the pallet to be the sponsor for the collection. +//! - [`stop_sponsoring_collection`][`Pallet::stop_sponsoring_collection`] - removes the pallet as the sponsor for the collection. +//! - [`sponsor_contract`][`Pallet::sponsor_contract`] - sets the pallet to be the sponsor for the contract. +//! - [`stop_sponsoring_contract`][`Pallet::stop_sponsoring_contract`] - removes the pallet as the sponsor for the contract. +//! - [`payout_stakers`][`Pallet::payout_stakers`] - recalculates interest for the specified number of stakers. //! // #![recursion_limit = "1024"] @@ -187,13 +208,20 @@ pub mod pallet { IncorrectLockedBalanceOperation, } + /// Stores the total staked amount. #[pallet::storage] pub type TotalStaked = StorageValue, QueryKind = ValueQuery>; + /// Stores the `admin` ID. Some extrinsics can only be executed if they were signed by `admin`. #[pallet::storage] pub type Admin = StorageValue; - /// Amount of tokens staked by account in the blocknumber. + /// Stores the amount of tokens staked by account in the blocknumber. + /// + /// * **Key1** - Staker ID. + /// * **Key2** - Relay block number when the stake was made. + /// * **(Balance, BlockNumber)** - Balance of the stake. + /// The number of the relay block in which we must perform the interest recalculation #[pallet::storage] pub type Staked = StorageNMap< Key = ( @@ -203,11 +231,19 @@ pub mod pallet { Value = (BalanceOf, T::BlockNumber), QueryKind = ValueQuery, >; - /// Amount of stakes for an Account + + /// Stores amount of stakes for an `Account`. + /// + /// * **Key** - Staker ID. + /// * **Value** - Amount of stakes. #[pallet::storage] pub type StakesPerAccount = StorageMap<_, Blake2_128Concat, T::AccountId, u8, ValueQuery>; + /// Stores amount of stakes for an `Account`. + /// + /// * **Key** - Staker ID. + /// * **Value** - Amount of stakes. #[pallet::storage] pub type PendingUnstake = StorageMap< _, @@ -252,6 +288,15 @@ pub mod pallet { T::BlockNumber: From + Into, <::Currency as Currency>::Balance: Sum + From, { + /// Sets an address as the the admin. + /// + /// # Permissions + /// + /// * Sudo + /// + /// # Arguments + /// + /// * `admin`: ID of the new admin. #[pallet::weight(T::WeightInfo::set_admin_address())] pub fn set_admin_address(origin: OriginFor, admin: T::CrossAccountId) -> DispatchResult { ensure_root(origin)?; @@ -263,6 +308,13 @@ pub mod pallet { Ok(()) } + /// Stakes the amount of native tokens. + /// Sets `amount` to the locked state. + /// The maximum number of stakes for a staker is 10. + /// + /// # Arguments + /// + /// * `amount`: in native tokens. #[pallet::weight(T::WeightInfo::stake())] pub fn stake(staker: OriginFor, amount: BalanceOf) -> DispatchResult { let staker_id = ensure_signed(staker)?; @@ -280,6 +332,7 @@ pub mod pallet { let balance = <::Currency as Currency>::free_balance(&staker_id); + // cheks that we can lock `amount` on the `staker` account. <::Currency as Currency>::ensure_can_withdraw( &staker_id, amount, @@ -293,6 +346,8 @@ pub mod pallet { let block_number = T::RelayBlockNumberProvider::current_block_number(); + // Calculation of the number of recalculation periods, + // after how much the first interest calculation should be performed for the stake let recalculate_after_interval: T::BlockNumber = if block_number % T::RecalculationInterval::get() == 0u32.into() { 1u32.into() @@ -300,6 +355,8 @@ pub mod pallet { 2u32.into() }; + // Сalculation of the number of the relay block + // in which it is necessary to accrue remuneration for the stake. let recalc_block = (block_number / T::RecalculationInterval::get() + recalculate_after_interval) * T::RecalculationInterval::get(); @@ -327,12 +384,20 @@ pub mod pallet { Ok(()) } + /// Unstakes all stakes. + /// Moves the sum of all stakes to the `reserved` state. + /// After the end of `PendingInterval` this sum becomes completely + /// free for further use. #[pallet::weight(T::WeightInfo::unstake())] pub fn unstake(staker: OriginFor) -> DispatchResultWithPostInfo { let staker_id = ensure_signed(staker)?; + + // calculate block number where the sum would be free let block = >::block_number() + T::PendingInterval::get(); + let mut pendings = >::get(block); + // checks that we can do unreserve stakes in the block ensure!(!pendings.is_full(), Error::::PendingForBlockOverflow); let mut total_stakes = 0u64; @@ -371,6 +436,15 @@ pub mod pallet { Ok(None.into()) } + /// Sets the pallet to be the sponsor for the collection. + /// + /// # Permissions + /// + /// * Pallet admin + /// + /// # Arguments + /// + /// * `collection_id`: ID of the collection that will be sponsored by `pallet_id` #[pallet::weight(T::WeightInfo::sponsor_collection())] pub fn sponsor_collection( admin: OriginFor, @@ -384,6 +458,18 @@ pub mod pallet { T::CollectionHandler::set_sponsor(Self::account_id(), collection_id) } + + /// Removes the pallet as the sponsor for the collection. + /// Returns [`NoPermission`][`Error::NoPermission`] + /// if the pallet wasn't the sponsor. + /// + /// # Permissions + /// + /// * Pallet admin + /// + /// # Arguments + /// + /// * `collection_id`: ID of the collection that is sponsored by `pallet_id` #[pallet::weight(T::WeightInfo::stop_sponsoring_collection())] pub fn stop_sponsoring_collection( admin: OriginFor, @@ -404,6 +490,15 @@ pub mod pallet { T::CollectionHandler::remove_collection_sponsor(collection_id) } + /// Sets the pallet to be the sponsor for the contract. + /// + /// # Permissions + /// + /// * Pallet admin + /// + /// # Arguments + /// + /// * `contract_id`: ID of the contract that will be sponsored by `pallet_id` #[pallet::weight(T::WeightInfo::sponsor_contract())] pub fn sponsor_contract(admin: OriginFor, contract_id: H160) -> DispatchResult { let admin_id = ensure_signed(admin)?; @@ -419,6 +514,17 @@ pub mod pallet { ) } + /// Removes the pallet as the sponsor for the contract. + /// Returns [`NoPermission`][`Error::NoPermission`] + /// if the pallet wasn't the sponsor. + /// + /// # Permissions + /// + /// * Pallet admin + /// + /// # Arguments + /// + /// * `contract_id`: ID of the contract that is sponsored by `pallet_id` #[pallet::weight(T::WeightInfo::stop_sponsoring_contract())] pub fn stop_sponsoring_contract(admin: OriginFor, contract_id: H160) -> DispatchResult { let admin_id = ensure_signed(admin)?; @@ -437,6 +543,18 @@ pub mod pallet { T::ContractHandler::remove_contract_sponsor(contract_id) } + /// Recalculates interest for the specified number of stakers. + /// If all stakers are not recalculated, the next call of the extrinsic + /// will continue the recalculation, from those stakers for whom this + /// was not perform in last call. + /// + /// # Permissions + /// + /// * Pallet admin + /// + /// # Arguments + /// + /// * `stakers_number`: the number of stakers for which recalculation will be performed #[pallet::weight(T::WeightInfo::payout_stakers(stakers_number.unwrap_or(20) as u32))] pub fn payout_stakers(admin: OriginFor, stakers_number: Option) -> DispatchResult { let admin_id = ensure_signed(admin)?; @@ -446,8 +564,13 @@ pub mod pallet { Error::::NoPermission ); + // calculate the number of the current recalculation block, + // this is necessary in order to understand which stakers we should calculate interest let current_recalc_block = Self::get_current_recalc_block(T::RelayBlockNumberProvider::current_block_number()); + + // calculate the number of the next recalculation block, + // this value is set for the stakers to whom the recalculation will be performed let next_recalc_block = current_recalc_block + T::RecalculationInterval::get(); let mut storage_iterator = Self::get_next_calculated_key() @@ -455,61 +578,14 @@ pub mod pallet { NextCalculatedRecord::::set(None); - // { - // let mut stakers_number = stakers_number.unwrap_or(20); - // let mut last_id = admin_id; - // let mut income_acc = BalanceOf::::default(); - // let mut amount_acc = BalanceOf::::default(); - - // while let Some(( - // (current_id, staked_block), - // (amount, next_recalc_block_for_stake), - // )) = storage_iterator.next() - // { - // if last_id != current_id { - // if income_acc != BalanceOf::::default() { - // >::transfer( - // &T::TreasuryAccountId::get(), - // &last_id, - // income_acc, - // ExistenceRequirement::KeepAlive, - // ) - // .and_then(|_| Self::add_lock_balance(&last_id, income_acc))?; - - // Self::deposit_event(Event::StakingRecalculation( - // last_id, amount, income_acc, - // )); - // } - - // if stakers_number == 0 { - // NextCalculatedRecord::::set(Some((current_id, staked_block))); - // break; - // } - // stakers_number -= 1; - // income_acc = BalanceOf::::default(); - // last_id = current_id; - // }; - // if current_recalc_block >= next_recalc_block_for_stake { - // Self::recalculate_and_insert_stake( - // &last_id, - // staked_block, - // next_recalc_block, - // amount, - // ((current_recalc_block - next_recalc_block_for_stake) - // / T::RecalculationInterval::get()) - // .into() + 1, - // &mut income_acc, - // ); - // } - // } - // } - { let mut stakers_number = stakers_number.unwrap_or(20); let last_id = RefCell::new(None); let income_acc = RefCell::new(BalanceOf::::default()); let amount_acc = RefCell::new(BalanceOf::::default()); + // this closure is uded to perform some of the actions if we break the loop because we reached the number of stakers for recalculation, + // but there were unrecalculated records in the storage. let flush_stake = || -> DispatchResult { if let Some(last_id) = &*last_id.borrow() { if !income_acc.borrow().is_zero() { @@ -578,10 +654,18 @@ pub mod pallet { } impl Pallet { + /// The account ID of the app promotion pot. + /// + /// This actually does computation. If you need to keep using it, then make sure you cache the + /// value and only call this once. pub fn account_id() -> T::AccountId { T::PalletId::get().into_account_truncating() } + /// Unlocks the balance that was locked by the pallet. + /// + /// - `staker`: staker ID. + /// - `amount`: amount of unlocked funds. fn unlock_balance(staker: &T::AccountId, amount: BalanceOf) -> DispatchResult { let locked_balance = Self::get_locked_balance(staker) .map(|l| l.amount) @@ -598,6 +682,10 @@ impl Pallet { Ok(()) } + /// Adds the balance to locked by the pallet. + /// + /// - `staker`: staker ID. + /// - `amount`: amount of added locked funds. fn add_lock_balance(staker: &T::AccountId, amount: BalanceOf) -> DispatchResult { Self::get_locked_balance(staker) .map_or(>::default(), |l| l.amount) @@ -606,6 +694,10 @@ impl Pallet { .ok_or(ArithmeticError::Overflow.into()) } + /// Sets the new state of a balance locked by the pallet. + /// + /// - `staker`: staker ID. + /// - `amount`: amount of locked funds. fn set_lock_unchecked(staker: &T::AccountId, amount: BalanceOf) { if amount.is_zero() { >::remove_lock(LOCK_IDENTIFIER, &staker); @@ -619,6 +711,9 @@ impl Pallet { } } + /// Returns the balance locked by the pallet for the staker. + /// + /// - `staker`: staker ID. pub fn get_locked_balance( staker: impl EncodeLike, ) -> Option>> { @@ -627,6 +722,9 @@ impl Pallet { .find(|l| l.id == LOCK_IDENTIFIER) } + /// Returns the total staked balance for the staker. + /// + /// - `staker`: staker ID. pub fn total_staked_by_id(staker: impl EncodeLike) -> Option> { let staked = Staked::::iter_prefix((staker,)) .into_iter() @@ -640,6 +738,10 @@ impl Pallet { } } + /// Returns all relay block numbers when stake was made, + /// the amount of the stake. + /// + /// - `staker`: staker ID. pub fn total_staked_by_id_per_block( staker: impl EncodeLike, ) -> Option)>> { @@ -655,6 +757,11 @@ impl Pallet { } } + /// Returns the total staked balance for the staker. + /// If `staker` is `None`, returns the total amount staked. + /// - `staker`: staker ID. + /// + /// **Note**: This `fn` has been added to implement RPC pub fn cross_id_total_staked(staker: Option) -> Option> { staker.map_or(Some(>::get()), |s| { Self::total_staked_by_id(s.as_sub()) @@ -667,6 +774,12 @@ impl Pallet { // .unwrap_or_default() // } + /// Returns all relay block numbers when stake was made, + /// the amount of the stake. + /// + /// - `staker`: staker ID. + /// + /// **Note**: This `fn` has been added to implement RPC pub fn cross_id_total_staked_per_block( staker: T::CrossAccountId, ) -> Vec<(T::BlockNumber, BalanceOf)> { @@ -704,10 +817,6 @@ impl Pallet { (current_relay_block / T::RecalculationInterval::get()) * T::RecalculationInterval::get() } - // fn get_next_recalc_block(current_relay_block: T::BlockNumber) -> T::BlockNumber { - // Self::get_current_recalc_block(current_relay_block) + T::RecalculationInterval::get() - // } - fn get_next_calculated_key() -> Option> { Self::get_next_calculated_record().map(|key| Staked::::hashed_key_for(key)) } @@ -717,9 +826,16 @@ impl Pallet where <::Currency as Currency>::Balance: Sum, { + /// Returns the amount reserved by the pending. + /// If `staker` is `None`, returns the total pending. + /// + /// -`staker`: staker ID. + /// /// Since user funds are not transferred anywhere by staking, overflow protection is provided /// at the level of the associated type `Balance` of `Currency` trait. In order to overflow, /// the staker must have more funds on his account than the maximum set for `Balance` type. + /// + /// **Note**: This `fn` has been added to implement RPC pub fn cross_id_pending_unstake(staker: Option) -> BalanceOf { staker.map_or( PendingUnstake::::iter_values() @@ -740,6 +856,12 @@ where ) } + /// Returns all parachain block numbers when unreserve is expected, + /// the amount of the unreserved funds. + /// + /// - `staker`: staker ID. + /// + /// **Note**: This `fn` has been added to implement RPC pub fn cross_id_pending_unstake_per_block( staker: T::CrossAccountId, ) -> Vec<(T::BlockNumber, BalanceOf)> { diff --git a/pallets/app-promotion/src/types.rs b/pallets/app-promotion/src/types.rs index 3ee316d000..83027c87d2 100644 --- a/pallets/app-promotion/src/types.rs +++ b/pallets/app-promotion/src/types.rs @@ -9,7 +9,10 @@ use up_data_structs::{CollectionId}; use sp_std::borrow::ToOwned; use pallet_evm_contract_helpers::{Pallet as EvmHelpersPallet, Config as EvmHelpersConfig}; +/// This trait was defined because `LockableCurrency` +/// has no way to know the state of the lock for an account. pub trait ExtendedLockableCurrency: LockableCurrency { + /// Returns lock balance for ID. Allows to determine the cause of the lock. fn locks(who: KArg) -> WeakBoundedVec, Self::MaxLocks> where KArg: EncodeLike; @@ -25,18 +28,28 @@ impl, I: 'static> ExtendedLockableCurrency Self::locks(who) } } - +/// Trait for interacting with collections. pub trait CollectionHandler { type CollectionId; type AccountId; + /// Sets sponsor for a collection. + /// + /// - `sponsor_id`: ID of the account of the sponsor-to-be. + /// - `collection_id`: ID of the modified collection. fn set_sponsor( sponsor_id: Self::AccountId, collection_id: Self::CollectionId, ) -> DispatchResult; + /// Removes sponsor for a collection. + /// + /// - `collection_id`: ID of the modified collection. fn remove_collection_sponsor(collection_id: Self::CollectionId) -> DispatchResult; + /// Retuns the current sponsor for a collection if one is set. + /// + /// - `collection_id`: ID of the collection. fn sponsor(collection_id: Self::CollectionId) -> Result, DispatchError>; } @@ -66,18 +79,28 @@ impl CollectionHandler for pallet_unique::Pallet { .map(|acc| acc.to_owned())) } } - +/// Trait for interacting with contracts. pub trait ContractHandler { type ContractId; type AccountId; + /// Sets sponsor for a contract. + /// + /// - `sponsor_id`: ID of the account of the sponsor-to-be. + /// - `contract_address`: ID of the modified contract. fn set_sponsor( sponsor_id: Self::AccountId, contract_address: Self::ContractId, ) -> DispatchResult; - + + /// Removes sponsor for a contract. + /// + /// - `contract_address`: ID of the modified contract. fn remove_contract_sponsor(contract_address: Self::ContractId) -> DispatchResult; + /// Retuns the current sponsor for a contract if one is set. + /// + /// - `contract_address`: ID of the contract. fn sponsor( contract_address: Self::ContractId, ) -> Result, DispatchError>; diff --git a/pallets/evm-contract-helpers/CHANGELOG.md b/pallets/evm-contract-helpers/CHANGELOG.md index 436a2ce9f0..2c86325fb0 100644 --- a/pallets/evm-contract-helpers/CHANGELOG.md +++ b/pallets/evm-contract-helpers/CHANGELOG.md @@ -2,29 +2,35 @@ All notable changes to this project will be documented in this file. +## [v0.3.0] 2022-09-05 + +### Added + +- Methods `force_set_sponsor` , `force_remove_sponsor` to be able to administer sponsorships with other pallets. Added to implement `AppPromotion` pallet logic. + ## [v0.2.0] - 2022-08-19 ### Added - - Set arbitrary evm address as contract sponsor. - - Ability to remove current sponsor. +- Set arbitrary evm address as contract sponsor. +- Ability to remove current sponsor. ### Removed - - Remove methods - + sponsoring_enabled - + toggle_sponsoring - ### Changed +- Remove methods + - sponsoring_enabled + - toggle_sponsoring - - Change `toggle_sponsoring` to `self_sponsored_enable`. +### Changed +- Change `toggle_sponsoring` to `self_sponsored_enable`. ## [v0.1.2] 2022-08-16 ### Other changes -- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a -- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 -- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b \ No newline at end of file +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index 26597d1452..f669c48326 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-evm-contract-helpers" -version = "0.2.0" +version = "0.3.0" license = "GPLv3" edition = "2021" diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index dffc1a45c3..b8a5d6732c 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -216,9 +216,10 @@ pub mod pallet { Ok(()) } - /// TO-DO - /// + /// Force set `sponsor` for `contract`. /// + /// Differs from `set_sponsor` in that confirmation + /// from the sponsor is not required. pub fn force_set_sponsor( contract_address: H160, sponsor: &T::CrossAccountId, @@ -269,9 +270,10 @@ pub mod pallet { Self::force_remove_sponsor(contract_address) } - /// TO-DO - /// + /// Force remove `sponsor` for `contract`. /// + /// Differs from `remove_sponsor` in that + /// it doesn't require consent from the `owner` of the contract. pub fn force_remove_sponsor(contract_address: H160) -> DispatchResult { Sponsoring::::remove(contract_address); diff --git a/pallets/unique/CHANGELOG.md b/pallets/unique/CHANGELOG.md index db2ed76690..da5f1c2f6d 100644 --- a/pallets/unique/CHANGELOG.md +++ b/pallets/unique/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. -## [v0.1.4] 2022-09-5 +## [v0.1.4] 2022-09-05 ### Added diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index ca0535808c..8f257c3389 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -1105,6 +1105,15 @@ decl_module! { } impl Pallet { + /// Force set `sponsor` for `collection`. + /// + /// Differs from [`set_collection_sponsor`][`Pallet::set_collection_sponsor`] in that confirmation + /// from the `sponsor` is not required. + /// + /// # Arguments + /// + /// * `sponsor`: ID of the account of the sponsor-to-be. + /// * `collection_id`: ID of the modified collection. pub fn force_set_sponsor(sponsor: T::AccountId, collection_id: CollectionId) -> DispatchResult { let mut target_collection = >::try_get(collection_id)?; target_collection.check_is_internal()?; @@ -1125,6 +1134,14 @@ impl Pallet { target_collection.save() } + /// Force remove `sponsor` for `collection`. + /// + /// Differs from `remove_sponsor` in that + /// it doesn't require consent from the `owner` of the collection. + /// + /// # Arguments + /// + /// * `collection_id`: ID of the modified collection. pub fn force_remove_collection_sponsor(collection_id: CollectionId) -> DispatchResult { let mut target_collection = >::try_get(collection_id)?; target_collection.check_is_internal()?; diff --git a/primitives/common/CHANGELOG.md b/primitives/common/CHANGELOG.md index 8c560e7fd1..44524383d6 100644 --- a/primitives/common/CHANGELOG.md +++ b/primitives/common/CHANGELOG.md @@ -1,4 +1,9 @@ +## [v0.9.27] 2022-09-08 + +### Added +- Relay block constants. In particular, it is necessary to add the `AppPromotion` pallet at runtime. + ## [v0.9.25] 2022-08-16 ### Other changes diff --git a/runtime/opal/CHANGELOG.md b/runtime/opal/CHANGELOG.md index 574592dbcf..f28cd71f83 100644 --- a/runtime/opal/CHANGELOG.md +++ b/runtime/opal/CHANGELOG.md @@ -3,16 +3,23 @@ All notable changes to this project will be documented in this file. + +## [v0.9.27] 2022-09-08 + +### Added + +- `AppPromotion` pallet to runtime. + ## [v0.9.27] 2022-08-16 ### Bugfixes -- Add missing config keys 74f532ac28dce15c15e7d576c074a58eba658c08 +- Add missing config keys 74f532ac28dce15c15e7d576c074a58eba658c08 ### Other changes -- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a -- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 -- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b diff --git a/runtime/quartz/CHANGELOG.md b/runtime/quartz/CHANGELOG.md index 31f9693ada..f28cd71f83 100644 --- a/runtime/quartz/CHANGELOG.md +++ b/runtime/quartz/CHANGELOG.md @@ -3,17 +3,23 @@ All notable changes to this project will be documented in this file. + +## [v0.9.27] 2022-09-08 + +### Added + +- `AppPromotion` pallet to runtime. + ## [v0.9.27] 2022-08-16 ### Bugfixes -- Add missing config keys 74f532ac28dce15c15e7d576c074a58eba658c08 +- Add missing config keys 74f532ac28dce15c15e7d576c074a58eba658c08 ### Other changes -- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a - -- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a -- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b diff --git a/runtime/quartz/Cargo.lock b/runtime/quartz/Cargo.lock new file mode 100644 index 0000000000..886826b5d3 --- /dev/null +++ b/runtime/quartz/Cargo.lock @@ -0,0 +1,11721 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array 0.14.6", +] + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if 1.0.0", + "cipher", + "cpufeatures", + "opaque-debug 0.3.0", +] + +[[package]] +name = "aes-gcm" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.7", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +dependencies = [ + "memchr", +] + +[[package]] +name = "always-assert" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf688625d06217d5b1bb0ea9d9c44a1635fd0ee3534466388d18203174f4d11" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9a8f622bcf6ff3df478e9deba3e03e4e04b300f8e6a139e192c05fa3490afc7" + +[[package]] +name = "app-promotion-rpc" +version = "0.1.0" +dependencies = [ + "pallet-common", + "pallet-evm", + "parity-scale-codec 3.1.5", + "sp-api", + "sp-core", + "sp-runtime", + "sp-std", + "up-data-structs", +] + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +dependencies = [ + "nodrop", +] + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "asn1_der" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22d1f4b888c298a027c99dc9048015fac177587de20fc30232a057dfbe24a21" + +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + +[[package]] +name = "async-attributes" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "async-channel" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "once_cell", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0da5b41ee986eed3f524c380e6d64965aea573882a8907682ad100f7859305ca" +dependencies = [ + "async-channel", + "async-executor", + "async-io", + "async-lock", + "blocking", + "futures-lite", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83e21f3a490c72b3b0cf44962180e60045de2925d8dff97918f7ee43c8f637c7" +dependencies = [ + "autocfg", + "concurrent-queue", + "futures-lite", + "libc", + "log", + "once_cell", + "parking", + "polling", + "slab", + "socket2", + "waker-fn", + "winapi", +] + +[[package]] +name = "async-lock" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-process" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02111fd8655a613c25069ea89fc8d9bb89331fa77486eb3bc059ee757cfa481c" +dependencies = [ + "async-io", + "autocfg", + "blocking", + "cfg-if 1.0.0", + "event-listener", + "futures-lite", + "libc", + "once_cell", + "signal-hook", + "winapi", +] + +[[package]] +name = "async-std" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +dependencies = [ + "async-attributes", + "async-channel", + "async-global-executor", + "async-io", + "async-lock", + "async-process", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite 0.2.9", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-std-resolver" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f2f8a4a203be3325981310ab243a28e6e4ea55b6519bffce05d41ab60e09ad8" +dependencies = [ + "async-std", + "async-trait", + "futures-io", + "futures-util", + "pin-utils", + "socket2", + "trust-dns-resolver", +] + +[[package]] +name = "async-task" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" + +[[package]] +name = "async-trait" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "asynchronous-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0de5164e5edbf51c45fb8c2d9664ae1c095cce1b265ecf7569093c0d66ef690" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite 0.2.9", +] + +[[package]] +name = "atomic-waker" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "auto_impl" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object 0.29.0", + "rustc-demangle", +] + +[[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + +[[package]] +name = "base58" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +dependencies = [ + "serde", +] + +[[package]] +name = "beefy-gadget" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "beefy-primitives", + "fnv", + "futures", + "futures-timer", + "hex", + "log", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "sc-chain-spec", + "sc-client-api", + "sc-finality-grandpa", + "sc-keystore", + "sc-network", + "sc-network-gossip", + "sc-utils", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-keystore", + "sp-mmr-primitives", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", + "wasm-timer", +] + +[[package]] +name = "beefy-gadget-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "beefy-gadget", + "beefy-primitives", + "futures", + "jsonrpsee", + "log", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "sc-rpc", + "sc-utils", + "serde", + "sp-core", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "beefy-merkle-tree" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "beefy-primitives", + "sp-api", +] + +[[package]] +name = "beefy-primitives" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "parity-scale-codec 3.1.5", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "bimap" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0455254eb5c6964c4545d8bac815e1a1be4f3afe0ae695ea539c12d728d44b" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bindgen" +version = "0.59.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9cf849ee05b2ee5fba5e36f97ff8ec2533916700fc0758d40d92136a42f3388" +dependencies = [ + "digest 0.10.3", +] + +[[package]] +name = "blake2-rfc" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" +dependencies = [ + "arrayvec 0.4.12", + "constant_time_eq", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72936ee4afc7f8f736d1c38383b56480b5497b4617b4a77bdbf1d2ababc76127" +dependencies = [ + "arrayref", + "arrayvec 0.7.2", + "constant_time_eq", +] + +[[package]] +name = "blake2s_simd" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db539cc2b5f6003621f1cd9ef92d7ded8ea5232c7de0f9faa2de251cd98730d4" +dependencies = [ + "arrayref", + "arrayvec 0.7.2", + "constant_time_eq", +] + +[[package]] +name = "blake3" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" +dependencies = [ + "arrayref", + "arrayvec 0.7.2", + "cc", + "cfg-if 1.0.0", + "constant_time_eq", + "digest 0.10.3", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding 0.1.5", + "byte-tools", + "byteorder", + "generic-array 0.12.4", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "block-padding 0.2.1", + "generic-array 0.14.6", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array 0.14.6", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "blocking" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" +dependencies = [ + "async-channel", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", + "once_cell", +] + +[[package]] +name = "bounded-vec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3372be4090bf9d4da36bd8ba7ce6ca1669503d0cf6e667236c6df7f053153eb6" +dependencies = [ + "thiserror", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bstr" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +dependencies = [ + "memchr", +] + +[[package]] +name = "build-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" +dependencies = [ + "semver 0.6.0", +] + +[[package]] +name = "bumpalo" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" + +[[package]] +name = "byte-slice-cast" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87c5fdd0166095e1d463fc6cc01aa8ce547ad77a4e84d42eb6762b084e28067e" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "cache-padded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" + +[[package]] +name = "camino" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.13", + "serde", + "serde_json", +] + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "chacha20" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" +dependencies = [ + "cfg-if 1.0.0", + "cipher", + "cpufeatures", + "zeroize", +] + +[[package]] +name = "chacha20poly1305" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" +dependencies = [ + "aead", + "chacha20", + "cipher", + "poly1305", + "zeroize", +] + +[[package]] +name = "chrono" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-integer", + "num-traits", + "time", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "cid" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" +dependencies = [ + "core2", + "multibase", + "multihash", + "serde", + "unsigned-varint", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array 0.14.6", +] + +[[package]] +name = "ckb-merkle-mountain-range" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f061f97d64fd1822664bdfb722f7ae5469a97b77567390f7442be5b5dc82a5b" +dependencies = [ + "cfg-if 0.1.10", +] + +[[package]] +name = "clang-sys" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b" +dependencies = [ + "glob", + "libc", + "libloading 0.7.3", +] + +[[package]] +name = "clap" +version = "3.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b71c3ce99b7611011217b366d923f1d0a7e07a92bb2dbf1e84508c673ca3bd" +dependencies = [ + "atty", + "bitflags", + "clap_derive", + "clap_lex", + "indexmap", + "once_cell", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_derive" +version = "3.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "cmake" +version = "0.1.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +dependencies = [ + "cc", +] + +[[package]] +name = "coarsetime" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "454038500439e141804c655b4cd1bc6a70bcb95cd2bc9463af5661b6956f0e46" +dependencies = [ + "libc", + "once_cell", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "comfy-table" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85914173c2f558d61613bfbbf1911f14e630895087a7ed2fafc0f5319e1536e7" +dependencies = [ + "strum", + "strum_macros", + "unicode-width", +] + +[[package]] +name = "concurrent-queue" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" +dependencies = [ + "cache-padded", +] + +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + +[[package]] +name = "cpp_demangle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "cranelift-bforest" +version = "0.85.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "749d0d6022c9038dccf480bdde2a38d435937335bf2bb0f14e815d94517cdce8" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-codegen" +version = "0.85.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94370cc7b37bf652ccd8bb8f09bd900997f7ccf97520edfc75554bb5c4abbea" +dependencies = [ + "cranelift-bforest", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-entity", + "cranelift-isle", + "gimli", + "log", + "regalloc2", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.85.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a3cea8fdab90e44018c5b9a1dfd460d8ee265ac354337150222a354628bdb6" +dependencies = [ + "cranelift-codegen-shared", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.85.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ac72f76f2698598951ab26d8c96eaa854810e693e7dd52523958b5909fde6b2" + +[[package]] +name = "cranelift-entity" +version = "0.85.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09eaeacfcd2356fe0e66b295e8f9d59fdd1ac3ace53ba50de14d628ec902f72d" +dependencies = [ + "serde", +] + +[[package]] +name = "cranelift-frontend" +version = "0.85.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dba69c9980d5ffd62c18a2bde927855fcd7c8dc92f29feaf8636052662cbd99c" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.85.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2920dc1e05cac40304456ed3301fde2c09bd6a9b0210bcfa2f101398d628d5b" + +[[package]] +name = "cranelift-native" +version = "0.85.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04dfa45f9b2a6f587c564d6b63388e00cd6589d2df6ea2758cf79e1a13285e6" +dependencies = [ + "cranelift-codegen", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-wasm" +version = "0.85.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31a46513ae6f26f3f267d8d75b5373d555fbbd1e68681f348d99df43f747ec54" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "itertools", + "log", + "smallvec", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" +dependencies = [ + "autocfg", + "cfg-if 1.0.0", + "crossbeam-utils", + "memoffset", + "once_cell", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd42583b04998a5363558e5f9291ee5a5ff6b49944332103f251e7479a82aa7" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" +dependencies = [ + "generic-array 0.14.6", + "rand_core 0.6.3", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array 0.14.6", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array 0.14.6", + "subtle", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array 0.14.6", + "subtle", +] + +[[package]] +name = "ctor" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "ctr" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +dependencies = [ + "cipher", +] + +[[package]] +name = "cuckoofilter" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b810a8449931679f64cd7eef1bbd0fa315801b6d5d9cdc1ace2804d6529eee18" +dependencies = [ + "byteorder", + "fnv", + "rand 0.7.3", +] + +[[package]] +name = "cumulus-pallet-aura-ext" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +dependencies = [ + "frame-executive", + "frame-support", + "frame-system", + "pallet-aura", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-application-crypto", + "sp-consensus-aura", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "cumulus-pallet-dmp-queue" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "cumulus-pallet-parachain-system" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +dependencies = [ + "cumulus-pallet-parachain-system-proc-macro", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "environmental", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-balances", + "parity-scale-codec 3.1.5", + "polkadot-parachain", + "scale-info", + "serde", + "sp-core", + "sp-externalities", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", + "sp-version", + "xcm", +] + +[[package]] +name = "cumulus-pallet-parachain-system-proc-macro" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cumulus-pallet-xcm" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", +] + +[[package]] +name = "cumulus-pallet-xcmp-queue" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.1.5", + "rand_chacha 0.3.1", + "scale-info", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "cumulus-primitives-core" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +dependencies = [ + "frame-support", + "parity-scale-codec 3.1.5", + "polkadot-core-primitives", + "polkadot-parachain", + "polkadot-primitives", + "sp-api", + "sp-runtime", + "sp-std", + "sp-trie", +] + +[[package]] +name = "cumulus-primitives-parachain-inherent" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "cumulus-test-relay-sproof-builder", + "parity-scale-codec 3.1.5", + "sc-client-api", + "scale-info", + "sp-api", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-storage", + "sp-trie", + "tracing", +] + +[[package]] +name = "cumulus-primitives-timestamp" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +dependencies = [ + "cumulus-primitives-core", + "futures", + "parity-scale-codec 3.1.5", + "sp-inherents", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "cumulus-primitives-utility" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "parity-scale-codec 3.1.5", + "polkadot-core-primitives", + "polkadot-parachain", + "polkadot-primitives", + "sp-runtime", + "sp-std", + "sp-trie", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "cumulus-relay-chain-interface" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "derive_more", + "futures", + "jsonrpsee-core", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "polkadot-overseer", + "polkadot-service", + "sc-client-api", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-runtime", + "sp-state-machine", + "thiserror", +] + +[[package]] +name = "cumulus-test-relay-sproof-builder" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +dependencies = [ + "cumulus-primitives-core", + "parity-scale-codec 3.1.5", + "polkadot-primitives", + "sp-runtime", + "sp-state-machine", + "sp-std", +] + +[[package]] +name = "curve25519-dalek" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" +dependencies = [ + "byteorder", + "digest 0.8.1", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "4.0.0-pre.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4033478fbf70d6acf2655ac70da91ee65852d69daf7a67bf7a2f518fb47aafcf" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.6.3", + "subtle", + "zeroize", +] + +[[package]] +name = "data-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" + +[[package]] +name = "data-encoding-macro" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86927b7cd2fe88fa698b87404b287ab98d1a0063a34071d92e575b72d3029aca" +dependencies = [ + "data-encoding", + "data-encoding-macro-internal", +] + +[[package]] +name = "data-encoding-macro-internal" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" +dependencies = [ + "data-encoding", + "syn", +] + +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version 0.4.0", + "syn", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.6", +] + +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer 0.10.3", + "crypto-common", + "subtle", +] + +[[package]] +name = "directories" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "directories-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dns-parser" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4d33be9473d06f75f58220f71f7a9317aca647dc061dbd3c361b0bef505fbea" +dependencies = [ + "byteorder", + "quick-error", +] + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "dtoa" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6053ff46b5639ceb91756a85a4c8914668393a03170efd79c8884a529d80656" + +[[package]] +name = "dyn-clonable" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" +dependencies = [ + "dyn-clonable-impl", + "dyn-clone", +] + +[[package]] +name = "dyn-clonable-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dyn-clone" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2" + +[[package]] +name = "ecdsa" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" +dependencies = [ + "der", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek 3.2.0", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "either" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" + +[[package]] +name = "elliptic-curve" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" +dependencies = [ + "base16ct", + "crypto-bigint", + "der", + "ff", + "generic-array 0.14.6", + "group", + "rand_core 0.6.3", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "enum-as-inner" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "enumflags2" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e75d4cd21b95383444831539909fbb14b9dc3fdceb2a6f5d36577329a1f55ccb" +dependencies = [ + "enumflags2_derive", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "enumn" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038b1afa59052df211f9efd58f8b1d84c242935ede1c3dbaed26b018a9e06ae2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "env_logger" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "environmental" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" + +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "ethbloom" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11da94e443c60508eb62cf256243a64da87304c2802ac2528847f79d750007ef" +dependencies = [ + "crunchy", + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "scale-info", + "tiny-keccak", +] + +[[package]] +name = "ethereum" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23750149fe8834c0e24bb9adcbacbe06c45b9861f15df53e09f26cb7c4ab91ef" +dependencies = [ + "bytes", + "ethereum-types", + "hash-db", + "hash256-std-hasher", + "parity-scale-codec 3.1.5", + "rlp", + "rlp-derive", + "scale-info", + "serde", + "sha3 0.10.4", + "triehash", +] + +[[package]] +name = "ethereum-types" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2827b94c556145446fcce834ca86b7abf0c39a805883fe20e72c5bfdb5a0dc6" +dependencies = [ + "ethbloom", + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "primitive-types", + "scale-info", + "uint", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "evm" +version = "0.35.0" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" +dependencies = [ + "auto_impl", + "environmental", + "ethereum", + "evm-core", + "evm-gasometer", + "evm-runtime", + "log", + "parity-scale-codec 3.1.5", + "primitive-types", + "rlp", + "scale-info", + "serde", + "sha3 0.10.4", +] + +[[package]] +name = "evm-coder" +version = "0.1.3" +dependencies = [ + "ethereum", + "evm-coder-procedural", + "evm-core", + "impl-trait-for-tuples", + "primitive-types", + "sp-std", +] + +[[package]] +name = "evm-coder-procedural" +version = "0.2.0" +dependencies = [ + "Inflector", + "hex", + "proc-macro2", + "quote", + "sha3 0.10.4", + "syn", +] + +[[package]] +name = "evm-core" +version = "0.35.0" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" +dependencies = [ + "parity-scale-codec 3.1.5", + "primitive-types", + "scale-info", + "serde", +] + +[[package]] +name = "evm-gasometer" +version = "0.35.0" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" +dependencies = [ + "environmental", + "evm-core", + "evm-runtime", + "primitive-types", +] + +[[package]] +name = "evm-runtime" +version = "0.35.0" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" +dependencies = [ + "auto_impl", + "environmental", + "evm-core", + "primitive-types", + "sha3 0.10.4", +] + +[[package]] +name = "exit-future" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" +dependencies = [ + "futures", +] + +[[package]] +name = "expander" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a718c0675c555c5f976fff4ea9e2c150fa06cefa201cadef87cfbf9324075881" +dependencies = [ + "blake3", + "fs-err", + "proc-macro2", + "quote", +] + +[[package]] +name = "expander" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3774182a5df13c3d1690311ad32fbe913feef26baba609fa2dd5f72042bd2ab6" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + +[[package]] +name = "fatality" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ad875162843b0d046276327afe0136e9ed3a23d5a754210fb6f1f33610d39ab" +dependencies = [ + "fatality-proc-macro", + "thiserror", +] + +[[package]] +name = "fatality-proc-macro" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5aa1e3ae159e592ad222dc90c5acbad632b527779ba88486abe92782ab268bd" +dependencies = [ + "expander 0.0.4", + "indexmap", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", + "thiserror", +] + +[[package]] +name = "fdlimit" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c4c9e43643f5a3be4ca5b67d26b98031ff9db6806c3440ae32e02e3ceac3f1b" +dependencies = [ + "libc", +] + +[[package]] +name = "ff" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" +dependencies = [ + "rand_core 0.6.3", + "subtle", +] + +[[package]] +name = "file-per-thread-logger" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21e16290574b39ee41c71aeb90ae960c504ebaf1e2a1c87bd52aa56ed6e1a02f" +dependencies = [ + "env_logger", + "log", +] + +[[package]] +name = "filetime" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "windows-sys", +] + +[[package]] +name = "finality-grandpa" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b22349c6a11563a202d95772a68e0fcf56119e74ea8a2a19cf2301460fcd0df5" +dependencies = [ + "either", + "futures", + "futures-timer", + "log", + "num-traits", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "scale-info", +] + +[[package]] +name = "fixed-hash" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +dependencies = [ + "crc32fast", + "libz-sys", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fork-tree" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "parity-scale-codec 3.1.5", +] + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fp-consensus" +version = "2.0.0-dev" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +dependencies = [ + "ethereum", + "parity-scale-codec 3.1.5", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "fp-evm" +version = "3.0.0-dev" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +dependencies = [ + "evm", + "frame-support", + "impl-trait-for-tuples", + "parity-scale-codec 3.1.5", + "serde", + "sp-core", + "sp-std", +] + +[[package]] +name = "fp-evm-mapping" +version = "0.1.0" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +dependencies = [ + "frame-support", + "sp-core", +] + +[[package]] +name = "fp-rpc" +version = "3.0.0-dev" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +dependencies = [ + "ethereum", + "ethereum-types", + "fp-evm", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-api", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "fp-self-contained" +version = "1.0.0-dev" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +dependencies = [ + "ethereum", + "frame-support", + "parity-scale-codec 3.1.5", + "parity-util-mem", + "scale-info", + "serde", + "sp-debug-derive", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "fp-storage" +version = "2.0.0" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +dependencies = [ + "parity-scale-codec 3.1.5", +] + +[[package]] +name = "frame-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "linregress", + "log", + "parity-scale-codec 3.1.5", + "paste", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-io", + "sp-runtime", + "sp-runtime-interface", + "sp-std", + "sp-storage", +] + +[[package]] +name = "frame-benchmarking-cli" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "Inflector", + "chrono", + "clap", + "comfy-table", + "frame-benchmarking", + "frame-support", + "frame-system", + "gethostname", + "handlebars", + "hash-db", + "hex", + "itertools", + "kvdb", + "lazy_static", + "linked-hash-map", + "log", + "memory-db", + "parity-scale-codec 3.1.5", + "rand 0.8.5", + "rand_pcg 0.3.1", + "sc-block-builder", + "sc-cli", + "sc-client-api", + "sc-client-db", + "sc-executor", + "sc-service", + "sc-sysinfo", + "serde", + "serde_json", + "serde_nanos", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-database", + "sp-externalities", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "sp-state-machine", + "sp-storage", + "sp-trie", + "tempfile", + "thiserror", + "thousands", +] + +[[package]] +name = "frame-election-provider-solution-type" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "frame-election-provider-support" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-election-provider-solution-type", + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-arithmetic", + "sp-npos-elections", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "frame-executive" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", +] + +[[package]] +name = "frame-metadata" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d" +dependencies = [ + "cfg-if 1.0.0", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", +] + +[[package]] +name = "frame-support" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "bitflags", + "frame-metadata", + "frame-support-procedural", + "impl-trait-for-tuples", + "k256", + "log", + "once_cell", + "parity-scale-codec 3.1.5", + "paste", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic", + "sp-core", + "sp-core-hashing-proc-macro", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-state-machine", + "sp-std", + "sp-tracing", + "tt-call", +] + +[[package]] +name = "frame-support-procedural" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "Inflector", + "frame-support-procedural-tools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support-procedural-tools-derive", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "frame-support-procedural-tools-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "frame-system" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-version", +] + +[[package]] +name = "frame-system-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "frame-system-rpc-runtime-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "parity-scale-codec 3.1.5", + "sp-api", +] + +[[package]] +name = "frame-try-runtime" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "sp-api", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "fs-err" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64db3e262960f0662f43a6366788d5f10f7f244b8f7d7d987f560baf5ded5c50" + +[[package]] +name = "fs-swap" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" +dependencies = [ + "lazy_static", + "libc", + "libloading 0.5.2", + "winapi", +] + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "fs_extra" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" + +[[package]] +name = "futures-executor" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" + +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite 0.2.9", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-rustls" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" +dependencies = [ + "futures-io", + "rustls", + "webpki", +] + +[[package]] +name = "futures-sink" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" + +[[package]] +name = "futures-task" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" + +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + +[[package]] +name = "futures-util" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite 0.2.9", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "ghash" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" +dependencies = [ + "opaque-debug 0.3.0", + "polyval", +] + +[[package]] +name = "gimli" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +dependencies = [ + "fallible-iterator", + "indexmap", + "stable_deref_trait", +] + +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + +[[package]] +name = "globset" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" +dependencies = [ + "aho-corasick", + "bstr", + "fnv", + "log", + "regex", +] + +[[package]] +name = "gloo-timers" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "group" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" +dependencies = [ + "ff", + "rand_core 0.6.3", + "subtle", +] + +[[package]] +name = "h2" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "handlebars" +version = "4.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56b224eaa4987c03c30b251de7ef0c15a6a59f34222905850dbc3026dfb24d5f" +dependencies = [ + "log", + "pest", + "pest_derive", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "hash-db" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" + +[[package]] +name = "hex_fmt" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", + "digest 0.9.0", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array 0.14.6", + "hmac 0.8.1", +] + +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa 1.0.3", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite 0.2.9", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa 1.0.3", + "pin-project-lite 0.2.9", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" +dependencies = [ + "http", + "hyper", + "log", + "rustls", + "rustls-native-certs", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c495f162af0bf17656d0014a0eded5f3cd2f365fdd204548c2869db89359dc7" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "js-sys", + "once_cell", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "if-addrs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "if-watch" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "015a7df1eb6dda30df37f34b63ada9b7b352984b0e84de2a20ed526345000791" +dependencies = [ + "async-io", + "core-foundation", + "fnv", + "futures", + "if-addrs", + "ipnet", + "log", + "rtnetlink", + "system-configuration", + "windows", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec 3.1.5", +] + +[[package]] +name = "impl-rlp" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +dependencies = [ + "rlp", +] + +[[package]] +name = "impl-serde" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "indexmap" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "integer-encoding" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" + +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + +[[package]] +name = "io-lifetimes" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec58677acfea8a15352d42fc87d11d63596ade9239e0a7c9352914417515dbe6" + +[[package]] +name = "io-lifetimes" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ea37f355c05dde75b84bba2d767906ad522e97cd9e2eef2be7a4ab7fb442c06" + +[[package]] +name = "ip_network" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2f047c0a98b2f299aa5d6d7088443570faae494e9ae1305e48be000c9e0eb1" + +[[package]] +name = "ipconfig" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723519edce41262b05d4143ceb95050e4c614f483e78e9fd9e39a8275a84ad98" +dependencies = [ + "socket2", + "widestring", + "winapi", + "winreg", +] + +[[package]] +name = "ipnet" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" + +[[package]] +name = "jobserver" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonrpsee" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11e017217fcd18da0a25296d3693153dd19c8a6aadab330b3595285d075385d1" +dependencies = [ + "jsonrpsee-core", + "jsonrpsee-http-server", + "jsonrpsee-proc-macros", + "jsonrpsee-types", + "jsonrpsee-ws-server", + "tracing", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16efcd4477de857d4a2195a45769b2fe9ebb54f3ef5a4221d3b014a4fe33ec0b" +dependencies = [ + "anyhow", + "arrayvec 0.7.2", + "async-trait", + "beef", + "futures-channel", + "futures-util", + "globset", + "hyper", + "jsonrpsee-types", + "lazy_static", + "parking_lot 0.12.1", + "rand 0.8.5", + "rustc-hash", + "serde", + "serde_json", + "soketto", + "thiserror", + "tokio", + "tracing", + "unicase", +] + +[[package]] +name = "jsonrpsee-http-server" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdd69efeb3ce2cba767f126872f4eeb4624038a29098e75d77608b2b4345ad03" +dependencies = [ + "futures-channel", + "futures-util", + "hyper", + "jsonrpsee-core", + "jsonrpsee-types", + "serde", + "serde_json", + "tokio", + "tracing", +] + +[[package]] +name = "jsonrpsee-proc-macros" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "874cf3f6a027cebf36cae767feca9aa2e8a8f799880e49eb5540819fcbd8eada" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bcf76cd316f5d3ad48138085af1f45e2c58c98e02f0779783dbb034d43f7c86" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "jsonrpsee-ws-server" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd2e4d266774a671f8def3794255b28eddd09b18d76e0b913fa439f34588c0a" +dependencies = [ + "futures-channel", + "futures-util", + "jsonrpsee-core", + "jsonrpsee-types", + "serde_json", + "soketto", + "tokio", + "tokio-stream", + "tokio-util", + "tracing", +] + +[[package]] +name = "k256" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" +dependencies = [ + "cfg-if 1.0.0", + "ecdsa", + "elliptic-curve", + "sec1", +] + +[[package]] +name = "keccak" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" + +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + +[[package]] +name = "kvdb" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a301d8ecb7989d4a6e2c57a49baca77d353bdbf879909debe3f375fe25d61f86" +dependencies = [ + "parity-util-mem", + "smallvec", +] + +[[package]] +name = "kvdb-memorydb" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ece7e668abd21387aeb6628130a6f4c802787f014fa46bc83221448322250357" +dependencies = [ + "kvdb", + "parity-util-mem", + "parking_lot 0.12.1", +] + +[[package]] +name = "kvdb-rocksdb" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca7fbdfd71cd663dceb0faf3367a99f8cf724514933e9867cec4995b6027cbc1" +dependencies = [ + "fs-swap", + "kvdb", + "log", + "num_cpus", + "owning_ref", + "parity-util-mem", + "parking_lot 0.12.1", + "regex", + "rocksdb", + "smallvec", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.132" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" + +[[package]] +name = "libloading" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" +dependencies = [ + "cc", + "winapi", +] + +[[package]] +name = "libloading" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +dependencies = [ + "cfg-if 1.0.0", + "winapi", +] + +[[package]] +name = "libm" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565" + +[[package]] +name = "libp2p" +version = "0.46.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81327106887e42d004fbdab1fef93675be2e2e07c1b95fce45e2cc813485611d" +dependencies = [ + "bytes", + "futures", + "futures-timer", + "getrandom 0.2.7", + "instant", + "lazy_static", + "libp2p-autonat", + "libp2p-core", + "libp2p-deflate", + "libp2p-dns", + "libp2p-floodsub", + "libp2p-gossipsub", + "libp2p-identify", + "libp2p-kad", + "libp2p-mdns", + "libp2p-metrics", + "libp2p-mplex", + "libp2p-noise", + "libp2p-ping", + "libp2p-plaintext", + "libp2p-pnet", + "libp2p-relay", + "libp2p-rendezvous", + "libp2p-request-response", + "libp2p-swarm", + "libp2p-swarm-derive", + "libp2p-tcp", + "libp2p-uds", + "libp2p-wasm-ext", + "libp2p-websocket", + "libp2p-yamux", + "multiaddr", + "parking_lot 0.12.1", + "pin-project", + "rand 0.7.3", + "smallvec", +] + +[[package]] +name = "libp2p-autonat" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4decc51f3573653a9f4ecacb31b1b922dd20c25a6322bb15318ec04287ec46f9" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-request-response", + "libp2p-swarm", + "log", + "prost", + "prost-build", + "rand 0.8.5", +] + +[[package]] +name = "libp2p-core" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf9b94cefab7599b2d3dff2f93bee218c6621d68590b23ede4485813cbcece6" +dependencies = [ + "asn1_der", + "bs58", + "ed25519-dalek", + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "lazy_static", + "libsecp256k1", + "log", + "multiaddr", + "multihash", + "multistream-select", + "parking_lot 0.12.1", + "pin-project", + "prost", + "prost-build", + "rand 0.8.5", + "ring", + "rw-stream-sink", + "sha2 0.10.5", + "smallvec", + "thiserror", + "unsigned-varint", + "void", + "zeroize", +] + +[[package]] +name = "libp2p-deflate" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0183dc2a3da1fbbf85e5b6cf51217f55b14f5daea0c455a9536eef646bfec71" +dependencies = [ + "flate2", + "futures", + "libp2p-core", +] + +[[package]] +name = "libp2p-dns" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cbf54723250fa5d521383be789bf60efdabe6bacfb443f87da261019a49b4b5" +dependencies = [ + "async-std-resolver", + "futures", + "libp2p-core", + "log", + "parking_lot 0.12.1", + "smallvec", + "trust-dns-resolver", +] + +[[package]] +name = "libp2p-floodsub" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98a4b6ffd53e355775d24b76f583fdda54b3284806f678499b57913adb94f231" +dependencies = [ + "cuckoofilter", + "fnv", + "futures", + "libp2p-core", + "libp2p-swarm", + "log", + "prost", + "prost-build", + "rand 0.7.3", + "smallvec", +] + +[[package]] +name = "libp2p-gossipsub" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74b4b888cfbeb1f5551acd3aa1366e01bf88ede26cc3c4645d0d2d004d5ca7b0" +dependencies = [ + "asynchronous-codec", + "base64", + "byteorder", + "bytes", + "fnv", + "futures", + "hex_fmt", + "instant", + "libp2p-core", + "libp2p-swarm", + "log", + "prometheus-client", + "prost", + "prost-build", + "rand 0.7.3", + "regex", + "sha2 0.10.5", + "smallvec", + "unsigned-varint", + "wasm-timer", +] + +[[package]] +name = "libp2p-identify" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c50b585518f8efd06f93ac2f976bd672e17cdac794644b3117edd078e96bda06" +dependencies = [ + "asynchronous-codec", + "futures", + "futures-timer", + "libp2p-core", + "libp2p-swarm", + "log", + "lru 0.7.8", + "prost", + "prost-build", + "prost-codec", + "smallvec", + "thiserror", + "void", +] + +[[package]] +name = "libp2p-kad" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "740862893bb5f06ac24acc9d49bdeadc3a5e52e51818a30a25c1f3519da2c851" +dependencies = [ + "arrayvec 0.7.2", + "asynchronous-codec", + "bytes", + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-swarm", + "log", + "prost", + "prost-build", + "rand 0.7.3", + "sha2 0.10.5", + "smallvec", + "thiserror", + "uint", + "unsigned-varint", + "void", +] + +[[package]] +name = "libp2p-mdns" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66e5e5919509603281033fd16306c61df7a4428ce274b67af5e14b07de5cdcb2" +dependencies = [ + "async-io", + "data-encoding", + "dns-parser", + "futures", + "if-watch", + "lazy_static", + "libp2p-core", + "libp2p-swarm", + "log", + "rand 0.8.5", + "smallvec", + "socket2", + "void", +] + +[[package]] +name = "libp2p-metrics" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef8aff4a1abef42328fbb30b17c853fff9be986dc39af17ee39f9c5f755c5e0c" +dependencies = [ + "libp2p-core", + "libp2p-gossipsub", + "libp2p-identify", + "libp2p-kad", + "libp2p-ping", + "libp2p-relay", + "libp2p-swarm", + "prometheus-client", +] + +[[package]] +name = "libp2p-mplex" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61fd1b20638ec209c5075dfb2e8ce6a7ea4ec3cd3ad7b77f7a477c06d53322e2" +dependencies = [ + "asynchronous-codec", + "bytes", + "futures", + "libp2p-core", + "log", + "nohash-hasher", + "parking_lot 0.12.1", + "rand 0.7.3", + "smallvec", + "unsigned-varint", +] + +[[package]] +name = "libp2p-noise" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "762408cb5d84b49a600422d7f9a42c18012d8da6ebcd570f9a4a4290ba41fb6f" +dependencies = [ + "bytes", + "curve25519-dalek 3.2.0", + "futures", + "lazy_static", + "libp2p-core", + "log", + "prost", + "prost-build", + "rand 0.8.5", + "sha2 0.10.5", + "snow", + "static_assertions", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "libp2p-ping" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "100a6934ae1dbf8a693a4e7dd1d730fd60b774dafc45688ed63b554497c6c925" +dependencies = [ + "futures", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-swarm", + "log", + "rand 0.7.3", + "void", +] + +[[package]] +name = "libp2p-plaintext" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be27bf0820a6238a4e06365b096d428271cce85a129cf16f2fe9eb1610c4df86" +dependencies = [ + "asynchronous-codec", + "bytes", + "futures", + "libp2p-core", + "log", + "prost", + "prost-build", + "unsigned-varint", + "void", +] + +[[package]] +name = "libp2p-pnet" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f1a458bbda880107b5b36fcb9b5a1ef0c329685da0e203ed692a8ebe64cc92c" +dependencies = [ + "futures", + "log", + "pin-project", + "rand 0.7.3", + "salsa20", + "sha3 0.9.1", +] + +[[package]] +name = "libp2p-relay" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4931547ee0cce03971ccc1733ff05bb0c4349fd89120a39e9861e2bbe18843c3" +dependencies = [ + "asynchronous-codec", + "bytes", + "either", + "futures", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-swarm", + "log", + "pin-project", + "prost", + "prost-build", + "prost-codec", + "rand 0.8.5", + "smallvec", + "static_assertions", + "thiserror", + "void", +] + +[[package]] +name = "libp2p-rendezvous" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9511c9672ba33284838e349623319c8cad2d18cfad243ae46c6b7e8a2982ea4e" +dependencies = [ + "asynchronous-codec", + "bimap", + "futures", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-swarm", + "log", + "prost", + "prost-build", + "rand 0.8.5", + "sha2 0.10.5", + "thiserror", + "unsigned-varint", + "void", +] + +[[package]] +name = "libp2p-request-response" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "508a189e2795d892c8f5c1fa1e9e0b1845d32d7b0b249dbf7b05b18811361843" +dependencies = [ + "async-trait", + "bytes", + "futures", + "instant", + "libp2p-core", + "libp2p-swarm", + "log", + "rand 0.7.3", + "smallvec", + "unsigned-varint", +] + +[[package]] +name = "libp2p-swarm" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ac5be6c2de2d1ff3f7693fda6faf8a827b1f3e808202277783fea9f527d114" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-core", + "log", + "pin-project", + "rand 0.7.3", + "smallvec", + "thiserror", + "void", +] + +[[package]] +name = "libp2p-swarm-derive" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f54a64b6957249e0ce782f8abf41d97f69330d02bf229f0672d864f0650cc76" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "libp2p-tcp" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a6771dc19aa3c65d6af9a8c65222bfc8fcd446630ddca487acd161fa6096f3b" +dependencies = [ + "async-io", + "futures", + "futures-timer", + "if-watch", + "ipnet", + "libc", + "libp2p-core", + "log", + "socket2", +] + +[[package]] +name = "libp2p-uds" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d125e3e5f0d58f3c6ac21815b20cf4b6a88b8db9dc26368ea821838f4161fd4d" +dependencies = [ + "async-std", + "futures", + "libp2p-core", + "log", +] + +[[package]] +name = "libp2p-wasm-ext" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec894790eec3c1608f8d1a8a0bdf0dbeb79ed4de2dce964222011c2896dfa05a" +dependencies = [ + "futures", + "js-sys", + "libp2p-core", + "parity-send-wrapper", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "libp2p-websocket" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9808e57e81be76ff841c106b4c5974fb4d41a233a7bdd2afbf1687ac6def3818" +dependencies = [ + "either", + "futures", + "futures-rustls", + "libp2p-core", + "log", + "parking_lot 0.12.1", + "quicksink", + "rw-stream-sink", + "soketto", + "url", + "webpki-roots", +] + +[[package]] +name = "libp2p-yamux" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6dea686217a06072033dc025631932810e2f6ad784e4fafa42e27d311c7a81c" +dependencies = [ + "futures", + "libp2p-core", + "parking_lot 0.12.1", + "thiserror", + "yamux", +] + +[[package]] +name = "librocksdb-sys" +version = "0.6.1+6.28.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bc587013734dadb7cf23468e531aa120788b87243648be42e2d3a072186291" +dependencies = [ + "bindgen", + "bzip2-sys", + "cc", + "glob", + "libc", + "libz-sys", + "tikv-jemalloc-sys", +] + +[[package]] +name = "libsecp256k1" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" +dependencies = [ + "arrayref", + "base64", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.8.5", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libz-sys" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linked_hash_set" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "linregress" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6c601a85f5ecd1aba625247bca0031585fb1c446461b142878a16f8245ddeb8" +dependencies = [ + "nalgebra", + "statrs", +] + +[[package]] +name = "linux-raw-sys" +version = "0.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5284f00d480e1c39af34e72f8ad60b94f47007e3481cd3b731c1d67190ddc7b7" + +[[package]] +name = "linux-raw-sys" +version = "0.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" + +[[package]] +name = "lock_api" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if 1.0.0", + "value-bag", +] + +[[package]] +name = "lru" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ea2d928b485416e8908cff2d97d621db22b27f7b3b6729e438bcf42c671ba91" +dependencies = [ + "hashbrown 0.11.2", +] + +[[package]] +name = "lru" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" +dependencies = [ + "hashbrown 0.12.3", +] + +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "lz4" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +dependencies = [ + "libc", + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "matchers" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "matrixmultiply" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add85d4dd35074e6fedc608f8c8f513a3548619a9024b751949ef0e8e45a4d84" +dependencies = [ + "rawpointer", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memfd" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6627dc657574b49d6ad27105ed671822be56e0d2547d413bfbf3e8d8fa92e7a" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95af15f345b17af2efc8ead6080fb8bc376f8cec1b35277b935637595fe77498" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memory-db" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" +dependencies = [ + "hash-db", + "hashbrown 0.12.3", + "parity-util-mem", +] + +[[package]] +name = "memory-lru" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beeb98b3d1ed2c0054bd81b5ba949a0243c3ccad751d45ea898fa8059fa2860a" +dependencies = [ + "lru 0.6.6", +] + +[[package]] +name = "memory_units" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" + +[[package]] +name = "merlin" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "mick-jaeger" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532" +dependencies = [ + "futures", + "rand 0.8.5", + "thrift", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys", +] + +[[package]] +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + +[[package]] +name = "multiaddr" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c580bfdd8803cce319b047d239559a22f809094aaea4ac13902a1fdcfcd4261" +dependencies = [ + "arrayref", + "bs58", + "byteorder", + "data-encoding", + "multihash", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint", + "url", +] + +[[package]] +name = "multibase" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", +] + +[[package]] +name = "multihash" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c346cf9999c631f002d8f977c4eaeaa0e6386f16007202308d0b3757522c2cc" +dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", + "core2", + "digest 0.10.3", + "multihash-derive", + "sha2 0.10.5", + "sha3 0.10.4", + "unsigned-varint", +] + +[[package]] +name = "multihash-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" +dependencies = [ + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "multistream-select" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "363a84be6453a70e63513660f4894ef815daf88e3356bffcda9ca27d810ce83b" +dependencies = [ + "bytes", + "futures", + "log", + "pin-project", + "smallvec", + "unsigned-varint", +] + +[[package]] +name = "nalgebra" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "462fffe4002f4f2e1f6a9dcf12cc1a6fc0e15989014efc02a941d3e0f5dc2120" +dependencies = [ + "approx", + "matrixmultiply", + "nalgebra-macros", + "num-complex", + "num-rational 0.4.1", + "num-traits", + "rand 0.8.5", + "rand_distr", + "simba", + "typenum", +] + +[[package]] +name = "nalgebra-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "names" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7d66043b25d4a6cccb23619d10c19c25304b355a7dccd4a8e11423dd2382146" +dependencies = [ + "rand 0.8.5", +] + +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" + +[[package]] +name = "netlink-packet-core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" +dependencies = [ + "anyhow", + "byteorder", + "libc", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" +dependencies = [ + "anyhow", + "bitflags", + "byteorder", + "libc", + "netlink-packet-core", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-utils" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25af9cf0dc55498b7bd94a1508af7a78706aa0ab715a73c5169273e03c84845e" +dependencies = [ + "anyhow", + "byteorder", + "paste", + "thiserror", +] + +[[package]] +name = "netlink-proto" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" +dependencies = [ + "bytes", + "futures", + "log", + "netlink-packet-core", + "netlink-sys", + "thiserror", + "tokio", +] + +[[package]] +name = "netlink-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92b654097027250401127914afb37cb1f311df6610a9891ff07a757e94199027" +dependencies = [ + "async-io", + "bytes", + "futures", + "libc", + "log", +] + +[[package]] +name = "nix" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "libc", +] + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nom" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-format" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bafe4179722c2894288ee77a9f044f02811c86af699344c498b0840c698a2465" +dependencies = [ + "arrayvec 0.4.12", + "itoa 0.4.8", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.28.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" +dependencies = [ + "crc32fast", + "hashbrown 0.11.2", + "indexmap", + "memchr", +] + +[[package]] +name = "object" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "orchestra" +version = "0.0.1" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "async-trait", + "dyn-clonable", + "futures", + "futures-timer", + "orchestra-proc-macro", + "pin-project", + "prioritized-metered-channel", + "thiserror", + "tracing", +] + +[[package]] +name = "orchestra-proc-macro" +version = "0.0.1" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "expander 0.0.6", + "itertools", + "petgraph", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ordered-float" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7" +dependencies = [ + "num-traits", +] + +[[package]] +name = "orml-vesting" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "os_str_bytes" +version = "6.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" + +[[package]] +name = "owning_ref" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "pallet-app-promotion" +version = "0.1.0" +dependencies = [ + "frame-support", + "frame-system", + "pallet-balances", + "pallet-common", + "pallet-evm", + "pallet-evm-contract-helpers", + "pallet-randomness-collective-flip", + "pallet-timestamp", + "pallet-unique", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "up-data-structs", +] + +[[package]] +name = "pallet-aura" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "pallet-timestamp", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-application-crypto", + "sp-consensus-aura", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-authority-discovery" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "pallet-session", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-application-crypto", + "sp-authority-discovery", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-authorship" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-authorship", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-babe" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "pallet-timestamp", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-application-crypto", + "sp-consensus-babe", + "sp-consensus-vrf", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-bags-list" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-balances" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-base-fee" +version = "1.0.0" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +dependencies = [ + "fp-evm", + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "pallet-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "beefy-primitives", + "frame-support", + "frame-system", + "pallet-session", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-beefy-mmr" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "beefy-merkle-tree", + "beefy-primitives", + "frame-support", + "frame-system", + "hex", + "log", + "pallet-beefy", + "pallet-mmr", + "pallet-session", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-bounties" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "log", + "pallet-treasury", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-child-bounties" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "log", + "pallet-bounties", + "pallet-treasury", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-collective" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-common" +version = "0.1.8" +dependencies = [ + "ethereum", + "evm-coder", + "fp-evm-mapping", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-evm", + "pallet-evm-coder-substrate", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", + "up-data-structs", +] + +[[package]] +name = "pallet-configuration" +version = "0.1.1" +dependencies = [ + "fp-evm", + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "smallvec", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-democracy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-election-provider-multi-phase" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.1.5", + "rand 0.7.3", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-std", + "static_assertions", + "strum", +] + +[[package]] +name = "pallet-elections-phragmen" +version = "5.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-ethereum" +version = "4.0.0-dev" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +dependencies = [ + "ethereum", + "ethereum-types", + "evm", + "fp-consensus", + "fp-evm", + "fp-evm-mapping", + "fp-rpc", + "fp-self-contained", + "fp-storage", + "frame-support", + "frame-system", + "log", + "pallet-evm", + "pallet-timestamp", + "parity-scale-codec 3.1.5", + "rlp", + "scale-info", + "serde", + "sha3 0.10.4", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-evm" +version = "6.0.0-dev" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +dependencies = [ + "evm", + "fp-evm", + "fp-evm-mapping", + "frame-benchmarking", + "frame-support", + "frame-system", + "hex", + "impl-trait-for-tuples", + "log", + "pallet-timestamp", + "parity-scale-codec 3.1.5", + "primitive-types", + "rlp", + "scale-info", + "serde", + "sha3 0.10.4", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-evm-coder-substrate" +version = "0.1.3" +dependencies = [ + "ethereum", + "evm-coder", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-ethereum", + "pallet-evm", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-std", + "up-data-structs", +] + +[[package]] +name = "pallet-evm-contract-helpers" +version = "0.3.0" +dependencies = [ + "ethereum", + "evm-coder", + "fp-evm-mapping", + "frame-support", + "frame-system", + "log", + "pallet-common", + "pallet-evm", + "pallet-evm-coder-substrate", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", + "up-data-structs", + "up-sponsorship", +] + +[[package]] +name = "pallet-evm-migration" +version = "0.1.1" +dependencies = [ + "fp-evm", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-evm", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-evm-transaction-payment" +version = "0.1.1" +dependencies = [ + "fp-evm", + "fp-evm-mapping", + "frame-support", + "frame-system", + "pallet-ethereum", + "pallet-evm", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "up-sponsorship", +] + +[[package]] +name = "pallet-fungible" +version = "0.1.5" +dependencies = [ + "ethereum", + "evm-coder", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-common", + "pallet-evm", + "pallet-evm-coder-substrate", + "pallet-structure", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", + "up-data-structs", +] + +[[package]] +name = "pallet-grandpa" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-application-crypto", + "sp-core", + "sp-finality-grandpa", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-identity" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "enumflags2", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-im-online" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-indices" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-io", + "sp-keyring", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-inflation" +version = "0.1.1" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-balances", + "pallet-randomness-collective-flip", + "pallet-timestamp", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-membership" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-mmr" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "ckb-merkle-mountain-range", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-mmr-rpc" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "jsonrpsee", + "parity-scale-codec 3.1.5", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-mmr-primitives", + "sp-runtime", +] + +[[package]] +name = "pallet-multisig" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-nonfungible" +version = "0.1.5" +dependencies = [ + "ethereum", + "evm-coder", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-common", + "pallet-evm", + "pallet-evm-coder-substrate", + "pallet-structure", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", + "struct-versioning", + "up-data-structs", +] + +[[package]] +name = "pallet-offences" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "log", + "pallet-balances", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-preimage" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-proxy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-randomness-collective-flip" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "safe-mix", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-refungible" +version = "0.2.4" +dependencies = [ + "derivative", + "ethereum", + "evm-coder", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-common", + "pallet-evm", + "pallet-evm-coder-substrate", + "pallet-structure", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", + "struct-versioning", + "up-data-structs", +] + +[[package]] +name = "pallet-rmrk-core" +version = "0.1.2" +dependencies = [ + "derivative", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-common", + "pallet-evm", + "pallet-nonfungible", + "pallet-structure", + "parity-scale-codec 3.1.5", + "rmrk-traits", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", + "up-data-structs", +] + +[[package]] +name = "pallet-rmrk-equip" +version = "0.1.2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-common", + "pallet-evm", + "pallet-nonfungible", + "pallet-rmrk-core", + "parity-scale-codec 3.1.5", + "rmrk-traits", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", + "up-data-structs", +] + +[[package]] +name = "pallet-scheduler" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-session" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-timestamp", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-trie", +] + +[[package]] +name = "pallet-staking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-application-crypto", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-staking-reward-curve" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pallet-structure" +version = "0.1.2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-common", + "pallet-evm", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-std", + "up-data-structs", +] + +[[package]] +name = "pallet-sudo" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-template-transaction-payment" +version = "3.0.0" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-balances", + "pallet-transaction-payment", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "up-sponsorship", +] + +[[package]] +name = "pallet-timestamp" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "pallet-tips" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "log", + "pallet-treasury", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-transaction-payment" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-transaction-payment-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "jsonrpsee", + "pallet-transaction-payment-rpc-runtime-api", + "parity-scale-codec 3.1.5", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-rpc", + "sp-runtime", +] + +[[package]] +name = "pallet-transaction-payment-rpc-runtime-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "pallet-transaction-payment", + "parity-scale-codec 3.1.5", + "sp-api", + "sp-runtime", +] + +[[package]] +name = "pallet-treasury" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "pallet-balances", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-unique" +version = "0.1.4" +dependencies = [ + "ethereum", + "evm-coder", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-common", + "pallet-evm", + "pallet-evm-coder-substrate", + "pallet-nonfungible", + "pallet-refungible", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "up-data-structs", +] + +[[package]] +name = "pallet-unique-scheduler" +version = "0.1.1" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "up-sponsorship", +] + +[[package]] +name = "pallet-utility" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-vesting" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-xcm" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "parachain-info" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", +] + +[[package]] +name = "parity-db" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c8fdb726a43661fa54b43e7114e6b88b2289cae388eb3ad766d9d1754d83fce" +dependencies = [ + "blake2-rfc", + "crc32fast", + "fs2", + "hex", + "libc", + "log", + "lz4", + "memmap2", + "parking_lot 0.12.1", + "rand 0.8.5", + "snap", +] + +[[package]] +name = "parity-scale-codec" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" +dependencies = [ + "arrayvec 0.7.2", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive 2.3.1", +] + +[[package]] +name = "parity-scale-codec" +version = "3.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9182e4a71cae089267ab03e67c99368db7cd877baf50f931e5d6d4b71e195ac0" +dependencies = [ + "arrayvec 0.7.2", + "bitvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive 3.1.3", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "parity-send-wrapper" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" + +[[package]] +name = "parity-util-mem" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" +dependencies = [ + "cfg-if 1.0.0", + "ethereum-types", + "hashbrown 0.12.3", + "impl-trait-for-tuples", + "lru 0.7.8", + "parity-util-mem-derive", + "parking_lot 0.12.1", + "primitive-types", + "smallvec", + "winapi", +] + +[[package]] +name = "parity-util-mem-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" +dependencies = [ + "proc-macro2", + "syn", + "synstructure", +] + +[[package]] +name = "parity-wasm" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16ad52817c4d343339b3bc2e26861bd21478eda0b7509acf83505727000512ac" +dependencies = [ + "byteorder", +] + +[[package]] +name = "parity-wasm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" + +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.5", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.3", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + +[[package]] +name = "paste" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac 0.8.0", +] + +[[package]] +name = "pbkdf2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +dependencies = [ + "crypto-mac 0.11.1", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pest" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb779fcf4bb850fbbb0edc96ff6cf34fd90c4b1a112ce042653280d9a7364048" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502b62a6d0245378b04ffe0a7fb4f4419a4815fce813bd8a0ec89a56e07d67b1" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "451e629bf49b750254da26132f1a5a9d11fd8a95a3df51d15c4abd1ba154cb6c" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pest_meta" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcec162c71c45e269dfc3fc2916eaeb97feab22993a21bcce4721d08cd7801a6" +dependencies = [ + "once_cell", + "pest", + "sha1", +] + +[[package]] +name = "petgraph" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" + +[[package]] +name = "polkadot-approval-distribution" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "futures", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-bitfield-distribution" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "futures", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-distribution" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "derive_more", + "fatality", + "futures", + "lru 0.7.8", + "parity-scale-codec 3.1.5", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "sp-core", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-recovery" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "fatality", + "futures", + "lru 0.7.8", + "parity-scale-codec 3.1.5", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "sc-network", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-client" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "beefy-primitives", + "frame-benchmarking", + "frame-benchmarking-cli", + "frame-system", + "frame-system-rpc-runtime-api", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "polkadot-core-primitives", + "polkadot-node-core-parachains-inherent", + "polkadot-primitives", + "polkadot-runtime", + "polkadot-runtime-common", + "sc-client-api", + "sc-consensus", + "sc-executor", + "sc-service", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-core", + "sp-finality-grandpa", + "sp-inherents", + "sp-keyring", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-storage", + "sp-timestamp", + "sp-transaction-pool", +] + +[[package]] +name = "polkadot-collator-protocol" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "always-assert", + "fatality", + "futures", + "futures-timer", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-core", + "sp-keystore", + "sp-runtime", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-core-primitives" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "parity-scale-codec 3.1.5", + "parity-util-mem", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "polkadot-dispute-distribution" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "derive_more", + "fatality", + "futures", + "lru 0.7.8", + "parity-scale-codec 3.1.5", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sc-network", + "sp-application-crypto", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-erasure-coding" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "parity-scale-codec 3.1.5", + "polkadot-node-primitives", + "polkadot-primitives", + "reed-solomon-novelpoly", + "sp-core", + "sp-trie", + "thiserror", +] + +[[package]] +name = "polkadot-gossip-support" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "futures", + "futures-timer", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "rand_chacha 0.3.1", + "sc-network", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "tracing-gum", +] + +[[package]] +name = "polkadot-network-bridge" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "always-assert", + "async-trait", + "bytes", + "fatality", + "futures", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sc-network", + "sp-consensus", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-collation-generation" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "futures", + "parity-scale-codec 3.1.5", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-core", + "sp-maybe-compressed-blob", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-approval-voting" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "bitvec", + "derive_more", + "futures", + "futures-timer", + "kvdb", + "lru 0.7.8", + "merlin", + "parity-scale-codec 3.1.5", + "polkadot-node-jaeger", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sc-keystore", + "schnorrkel", + "sp-application-crypto", + "sp-consensus", + "sp-consensus-slots", + "sp-runtime", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-av-store" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "bitvec", + "futures", + "futures-timer", + "kvdb", + "parity-scale-codec 3.1.5", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-backing" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "bitvec", + "fatality", + "futures", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "polkadot-statement-table", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-bitfield-signing" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "futures", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-keystore", + "thiserror", + "tracing-gum", + "wasm-timer", +] + +[[package]] +name = "polkadot-node-core-candidate-validation" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "async-trait", + "futures", + "parity-scale-codec 3.1.5", + "polkadot-node-core-pvf", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-parachain", + "polkadot-primitives", + "sp-maybe-compressed-blob", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-chain-api" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "futures", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sc-client-api", + "sc-consensus-babe", + "sp-blockchain", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-chain-selection" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "futures", + "futures-timer", + "kvdb", + "parity-scale-codec 3.1.5", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-dispute-coordinator" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "fatality", + "futures", + "kvdb", + "lru 0.7.8", + "parity-scale-codec 3.1.5", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sc-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-parachains-inherent" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "polkadot-node-subsystem", + "polkadot-primitives", + "sp-blockchain", + "sp-inherents", + "sp-runtime", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-provisioner" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "bitvec", + "fatality", + "futures", + "futures-timer", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-pvf" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "always-assert", + "assert_matches", + "async-process", + "async-std", + "futures", + "futures-timer", + "parity-scale-codec 3.1.5", + "pin-project", + "polkadot-core-primitives", + "polkadot-node-subsystem-util", + "polkadot-parachain", + "rand 0.8.5", + "rayon", + "sc-executor", + "sc-executor-common", + "sc-executor-wasmtime", + "slotmap", + "sp-core", + "sp-externalities", + "sp-io", + "sp-maybe-compressed-blob", + "sp-tracing", + "sp-wasm-interface", + "tempfile", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-pvf-checker" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "futures", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-runtime-api" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "futures", + "memory-lru", + "parity-util-mem", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-consensus-babe", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-jaeger" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "async-std", + "lazy_static", + "log", + "mick-jaeger", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "polkadot-node-primitives", + "polkadot-primitives", + "sc-network", + "sp-core", + "thiserror", +] + +[[package]] +name = "polkadot-node-metrics" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "bs58", + "futures", + "futures-timer", + "log", + "parity-scale-codec 3.1.5", + "polkadot-primitives", + "prioritized-metered-channel", + "sc-cli", + "sc-service", + "sc-tracing", + "substrate-prometheus-endpoint", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-network-protocol" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "async-trait", + "derive_more", + "fatality", + "futures", + "parity-scale-codec 3.1.5", + "polkadot-node-jaeger", + "polkadot-node-primitives", + "polkadot-primitives", + "rand 0.8.5", + "sc-authority-discovery", + "sc-network", + "strum", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-primitives" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "bounded-vec", + "futures", + "parity-scale-codec 3.1.5", + "polkadot-parachain", + "polkadot-primitives", + "schnorrkel", + "serde", + "sp-application-crypto", + "sp-consensus-babe", + "sp-consensus-vrf", + "sp-core", + "sp-keystore", + "sp-maybe-compressed-blob", + "thiserror", + "zstd", +] + +[[package]] +name = "polkadot-node-subsystem" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "polkadot-node-jaeger", + "polkadot-node-subsystem-types", + "polkadot-overseer", +] + +[[package]] +name = "polkadot-node-subsystem-types" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "async-trait", + "derive_more", + "futures", + "orchestra", + "polkadot-node-jaeger", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-primitives", + "polkadot-statement-table", + "sc-network", + "smallvec", + "sp-api", + "sp-authority-discovery", + "sp-consensus-babe", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "polkadot-node-subsystem-util" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "async-trait", + "derive_more", + "fatality", + "futures", + "itertools", + "kvdb", + "lru 0.7.8", + "parity-db", + "parity-scale-codec 3.1.5", + "parity-util-mem", + "parking_lot 0.11.2", + "pin-project", + "polkadot-node-jaeger", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "prioritized-metered-channel", + "rand 0.8.5", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-overseer" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "lru 0.7.8", + "orchestra", + "parity-util-mem", + "parking_lot 0.12.1", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem-types", + "polkadot-primitives", + "sc-client-api", + "sp-api", + "sp-core", + "tracing-gum", +] + +[[package]] +name = "polkadot-parachain" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "derive_more", + "frame-support", + "parity-scale-codec 3.1.5", + "parity-util-mem", + "polkadot-core-primitives", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "polkadot-primitives" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "bitvec", + "frame-system", + "hex-literal", + "parity-scale-codec 3.1.5", + "parity-util-mem", + "polkadot-core-primitives", + "polkadot-parachain", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-authority-discovery", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-staking", + "sp-std", + "sp-trie", + "sp-version", +] + +[[package]] +name = "polkadot-rpc" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "beefy-gadget", + "beefy-gadget-rpc", + "jsonrpsee", + "pallet-mmr-rpc", + "pallet-transaction-payment-rpc", + "polkadot-primitives", + "sc-chain-spec", + "sc-client-api", + "sc-consensus-babe", + "sc-consensus-babe-rpc", + "sc-consensus-epochs", + "sc-finality-grandpa", + "sc-finality-grandpa-rpc", + "sc-rpc", + "sc-sync-state-rpc", + "sc-transaction-pool-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-keystore", + "sp-runtime", + "substrate-frame-rpc-system", + "substrate-state-trie-migration-rpc", +] + +[[package]] +name = "polkadot-runtime" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "beefy-primitives", + "bitvec", + "frame-election-provider-support", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-bags-list", + "pallet-balances", + "pallet-bounties", + "pallet-child-bounties", + "pallet-collective", + "pallet-democracy", + "pallet-election-provider-multi-phase", + "pallet-elections-phragmen", + "pallet-grandpa", + "pallet-identity", + "pallet-im-online", + "pallet-indices", + "pallet-membership", + "pallet-multisig", + "pallet-offences", + "pallet-preimage", + "pallet-proxy", + "pallet-scheduler", + "pallet-session", + "pallet-staking", + "pallet-staking-reward-curve", + "pallet-timestamp", + "pallet-tips", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-xcm", + "parity-scale-codec 3.1.5", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-constants", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info", + "serde", + "serde_derive", + "smallvec", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-core", + "sp-inherents", + "sp-io", + "sp-mmr-primitives", + "sp-npos-elections", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-transaction-pool", + "sp-version", + "static_assertions", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "polkadot-runtime-common" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "beefy-primitives", + "bitvec", + "frame-election-provider-support", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "libsecp256k1", + "log", + "pallet-authorship", + "pallet-bags-list", + "pallet-balances", + "pallet-beefy-mmr", + "pallet-election-provider-multi-phase", + "pallet-session", + "pallet-staking", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-treasury", + "pallet-vesting", + "parity-scale-codec 3.1.5", + "polkadot-primitives", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info", + "serde", + "serde_derive", + "slot-range-helper", + "sp-api", + "sp-core", + "sp-inherents", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "static_assertions", + "xcm", +] + +[[package]] +name = "polkadot-runtime-constants" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", + "smallvec", + "sp-runtime", +] + +[[package]] +name = "polkadot-runtime-metrics" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "bs58", + "parity-scale-codec 3.1.5", + "polkadot-primitives", + "sp-std", + "sp-tracing", +] + +[[package]] +name = "polkadot-runtime-parachains" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "bitflags", + "bitvec", + "derive_more", + "frame-support", + "frame-system", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-session", + "pallet-staking", + "pallet-timestamp", + "pallet-vesting", + "parity-scale-codec 3.1.5", + "polkadot-primitives", + "polkadot-runtime-metrics", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rustc-hex", + "scale-info", + "serde", + "sp-api", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "polkadot-service" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "async-trait", + "beefy-gadget", + "beefy-primitives", + "frame-system-rpc-runtime-api", + "futures", + "hex-literal", + "kvdb", + "kvdb-rocksdb", + "lru 0.7.8", + "pallet-babe", + "pallet-im-online", + "pallet-staking", + "pallet-transaction-payment-rpc-runtime-api", + "parity-db", + "polkadot-approval-distribution", + "polkadot-availability-bitfield-distribution", + "polkadot-availability-distribution", + "polkadot-availability-recovery", + "polkadot-client", + "polkadot-collator-protocol", + "polkadot-dispute-distribution", + "polkadot-gossip-support", + "polkadot-network-bridge", + "polkadot-node-collation-generation", + "polkadot-node-core-approval-voting", + "polkadot-node-core-av-store", + "polkadot-node-core-backing", + "polkadot-node-core-bitfield-signing", + "polkadot-node-core-candidate-validation", + "polkadot-node-core-chain-api", + "polkadot-node-core-chain-selection", + "polkadot-node-core-dispute-coordinator", + "polkadot-node-core-parachains-inherent", + "polkadot-node-core-provisioner", + "polkadot-node-core-pvf-checker", + "polkadot-node-core-runtime-api", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-rpc", + "polkadot-runtime", + "polkadot-runtime-constants", + "polkadot-runtime-parachains", + "polkadot-statement-distribution", + "sc-authority-discovery", + "sc-basic-authorship", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-consensus-babe", + "sc-consensus-slots", + "sc-consensus-uncles", + "sc-executor", + "sc-finality-grandpa", + "sc-keystore", + "sc-network", + "sc-offchain", + "sc-service", + "sc-sync-state-rpc", + "sc-sysinfo", + "sc-telemetry", + "sc-transaction-pool", + "serde", + "serde_json", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-core", + "sp-finality-grandpa", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-state-machine", + "sp-storage", + "sp-timestamp", + "sp-transaction-pool", + "sp-trie", + "substrate-prometheus-endpoint", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-statement-distribution" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "arrayvec 0.5.2", + "fatality", + "futures", + "indexmap", + "parity-scale-codec 3.1.5", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-keystore", + "sp-staking", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-statement-table" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "parity-scale-codec 3.1.5", + "polkadot-primitives", + "sp-core", +] + +[[package]] +name = "polling" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899b00b9c8ab553c743b3e11e87c5c7d423b2a2de229ba95b24a756344748011" +dependencies = [ + "autocfg", + "cfg-if 1.0.0", + "libc", + "log", + "wepoll-ffi", + "winapi", +] + +[[package]] +name = "poly1305" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" +dependencies = [ + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash", +] + +[[package]] +name = "polyval" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "primitive-types" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" +dependencies = [ + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "scale-info", + "uint", +] + +[[package]] +name = "prioritized-metered-channel" +version = "0.2.0" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "coarsetime", + "crossbeam-queue", + "derive_more", + "futures", + "futures-timer", + "nanorand", + "thiserror", + "tracing", +] + +[[package]] +name = "proc-macro-crate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +dependencies = [ + "once_cell", + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prometheus" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45c8babc29389186697fe5a2a4859d697825496b83db5d0b65271cdc0488e88c" +dependencies = [ + "cfg-if 1.0.0", + "fnv", + "lazy_static", + "memchr", + "parking_lot 0.12.1", + "thiserror", +] + +[[package]] +name = "prometheus-client" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1abe0255c04d15f571427a2d1e00099016506cf3297b53853acd2b7eb87825" +dependencies = [ + "dtoa", + "itoa 1.0.3", + "owning_ref", + "prometheus-client-derive-text-encode", +] + +[[package]] +name = "prometheus-client-derive-text-encode" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8e12d01b9d66ad9eb4529c57666b6263fc1993cb30261d83ead658fdd932652" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab" +dependencies = [ + "bytes", + "cfg-if 1.0.0", + "cmake", + "heck", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph", + "prost", + "prost-types", + "regex", + "tempfile", + "which", +] + +[[package]] +name = "prost-codec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00af1e92c33b4813cc79fda3f2dbf56af5169709be0202df730e9ebc3e4cd007" +dependencies = [ + "asynchronous-codec", + "bytes", + "prost", + "thiserror", + "unsigned-varint", +] + +[[package]] +name = "prost-derive" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-types" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" +dependencies = [ + "bytes", + "prost", +] + +[[package]] +name = "psm" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f446d0a6efba22928558c4fb4ce0b3fd6c89b0061343e390bf01a703742b8125" +dependencies = [ + "cc", +] + +[[package]] +name = "quartz-runtime" +version = "0.9.27" +dependencies = [ + "app-promotion-rpc", + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-timestamp", + "cumulus-primitives-utility", + "derivative", + "evm-coder", + "fp-evm-mapping", + "fp-rpc", + "fp-self-contained", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "log", + "orml-vesting", + "pallet-app-promotion", + "pallet-aura", + "pallet-balances", + "pallet-base-fee", + "pallet-common", + "pallet-configuration", + "pallet-ethereum", + "pallet-evm", + "pallet-evm-coder-substrate", + "pallet-evm-contract-helpers", + "pallet-evm-migration", + "pallet-evm-transaction-payment", + "pallet-fungible", + "pallet-inflation", + "pallet-nonfungible", + "pallet-randomness-collective-flip", + "pallet-refungible", + "pallet-rmrk-core", + "pallet-rmrk-equip", + "pallet-structure", + "pallet-sudo", + "pallet-template-transaction-payment", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-unique", + "pallet-unique-scheduler", + "pallet-xcm", + "parachain-info", + "parity-scale-codec 3.1.5", + "polkadot-parachain", + "rmrk-rpc", + "scale-info", + "serde", + "smallvec", + "sp-api", + "sp-arithmetic", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-io", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-version", + "substrate-wasm-builder", + "up-common", + "up-data-structs", + "up-rpc", + "up-sponsorship", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quicksink" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858" +dependencies = [ + "futures-core", + "futures-sink", + "pin-project-lite 0.1.12", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg 0.2.1", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.3", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.3", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom 0.2.7", +] + +[[package]] +name = "rand_distr" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" +dependencies = [ + "rand_core 0.6.3", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rayon" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +dependencies = [ + "autocfg", + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.7", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "reed-solomon-novelpoly" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bd8f48b2066e9f69ab192797d66da804d1935bf22763204ed3675740cb0f221" +dependencies = [ + "derive_more", + "fs-err", + "itertools", + "static_init", + "thiserror", +] + +[[package]] +name = "ref-cast" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed13bcd201494ab44900a96490291651d200730904221832b9547d24a87d332b" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5234cd6063258a5e32903b53b1b6ac043a0541c8adc1f610f67b0326c7a578fa" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regalloc2" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a8d23b35d7177df3b9d31ed8a9ab4bf625c668be77a319d4f5efd4a5257701c" +dependencies = [ + "fxhash", + "log", + "slice-group-by", + "smallvec", +] + +[[package]] +name = "regex" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" + +[[package]] +name = "region" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0" +dependencies = [ + "bitflags", + "libc", + "mach", + "winapi", +] + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "resolv-conf" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +dependencies = [ + "hostname", + "quick-error", +] + +[[package]] +name = "retain_mut" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" + +[[package]] +name = "rfc6979" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" +dependencies = [ + "crypto-bigint", + "hmac 0.11.0", + "zeroize", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rlp" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "999508abb0ae792aabed2460c45b89106d97fe4adac593bdaef433c2605847b5" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "rlp-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "rmrk-rpc" +version = "0.0.2" +dependencies = [ + "parity-scale-codec 2.3.1", + "rmrk-traits", + "serde", + "sp-api", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "rmrk-traits" +version = "0.1.0" +dependencies = [ + "parity-scale-codec 3.1.5", + "scale-info", + "serde", +] + +[[package]] +name = "rocksdb" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "620f4129485ff1a7128d184bc687470c21c7951b64779ebc9cfdad3dcd920290" +dependencies = [ + "libc", + "librocksdb-sys", +] + +[[package]] +name = "rpassword" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "rtnetlink" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" +dependencies = [ + "async-global-executor", + "futures", + "log", + "netlink-packet-route", + "netlink-proto", + "nix", + "thiserror", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.13", +] + +[[package]] +name = "rustix" +version = "0.33.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938a344304321a9da4973b9ff4f9f8db9caf4597dfd9dda6a60b523340a0fff0" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes 0.5.3", + "libc", + "linux-raw-sys 0.0.42", + "winapi", +] + +[[package]] +name = "rustix" +version = "0.35.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c825b8aa8010eb9ee99b75f05e10180b9278d161583034d7574c9d617aeada" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes 0.7.3", + "libc", + "linux-raw-sys 0.0.46", + "windows-sys", +] + +[[package]] +name = "rustls" +version = "0.20.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" +dependencies = [ + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +dependencies = [ + "base64", +] + +[[package]] +name = "rustversion" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" + +[[package]] +name = "rw-stream-sink" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" +dependencies = [ + "futures", + "pin-project", + "static_assertions", +] + +[[package]] +name = "ryu" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + +[[package]] +name = "safe-mix" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d3d055a2582e6b00ed7a31c1524040aa391092bf636328350813f3a0605215c" +dependencies = [ + "rustc_version 0.2.3", +] + +[[package]] +name = "salsa20" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0fbb5f676da676c260ba276a8f43a8dc67cf02d1438423aeb1c677a7212686" +dependencies = [ + "cipher", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "sc-allocator" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "log", + "sp-core", + "sp-wasm-interface", + "thiserror", +] + +[[package]] +name = "sc-authority-discovery" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "ip_network", + "libp2p", + "log", + "parity-scale-codec 3.1.5", + "prost", + "prost-build", + "rand 0.7.3", + "sc-client-api", + "sc-network", + "sp-api", + "sp-authority-discovery", + "sp-blockchain", + "sp-core", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-basic-authorship" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "futures", + "futures-timer", + "log", + "parity-scale-codec 3.1.5", + "sc-block-builder", + "sc-client-api", + "sc-proposer-metrics", + "sc-telemetry", + "sc-transaction-pool-api", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-inherents", + "sp-runtime", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-block-builder" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "parity-scale-codec 3.1.5", + "sc-client-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", +] + +[[package]] +name = "sc-chain-spec" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "impl-trait-for-tuples", + "memmap2", + "parity-scale-codec 3.1.5", + "sc-chain-spec-derive", + "sc-network", + "sc-telemetry", + "serde", + "serde_json", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "sc-chain-spec-derive" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sc-cli" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "chrono", + "clap", + "fdlimit", + "futures", + "hex", + "libp2p", + "log", + "names", + "parity-scale-codec 3.1.5", + "rand 0.7.3", + "regex", + "rpassword", + "sc-client-api", + "sc-client-db", + "sc-keystore", + "sc-network", + "sc-service", + "sc-telemetry", + "sc-tracing", + "sc-utils", + "serde", + "serde_json", + "sp-blockchain", + "sp-core", + "sp-keyring", + "sp-keystore", + "sp-panic-handler", + "sp-runtime", + "sp-version", + "thiserror", + "tiny-bip39", + "tokio", +] + +[[package]] +name = "sc-client-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "fnv", + "futures", + "hash-db", + "log", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "sc-executor", + "sc-transaction-pool-api", + "sc-utils", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-database", + "sp-externalities", + "sp-keystore", + "sp-runtime", + "sp-state-machine", + "sp-storage", + "sp-trie", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-client-db" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "hash-db", + "kvdb", + "kvdb-memorydb", + "kvdb-rocksdb", + "linked-hash-map", + "log", + "parity-db", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "sc-client-api", + "sc-state-db", + "sp-arithmetic", + "sp-blockchain", + "sp-core", + "sp-database", + "sp-runtime", + "sp-state-machine", + "sp-trie", +] + +[[package]] +name = "sc-consensus" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "libp2p", + "log", + "parking_lot 0.12.1", + "sc-client-api", + "sc-utils", + "serde", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "sp-state-machine", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-babe" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "async-trait", + "fork-tree", + "futures", + "log", + "merlin", + "num-bigint", + "num-rational 0.2.4", + "num-traits", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "rand 0.7.3", + "retain_mut", + "sc-client-api", + "sc-consensus", + "sc-consensus-epochs", + "sc-consensus-slots", + "sc-keystore", + "sc-telemetry", + "schnorrkel", + "serde", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-slots", + "sp-consensus-vrf", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-version", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-babe-rpc" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "futures", + "jsonrpsee", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-rpc-api", + "serde", + "sp-api", + "sp-application-crypto", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-core", + "sp-keystore", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-consensus-epochs" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "fork-tree", + "parity-scale-codec 3.1.5", + "sc-client-api", + "sc-consensus", + "sp-blockchain", + "sp-runtime", +] + +[[package]] +name = "sc-consensus-slots" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "log", + "parity-scale-codec 3.1.5", + "sc-client-api", + "sc-consensus", + "sc-telemetry", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "sp-timestamp", + "thiserror", +] + +[[package]] +name = "sc-consensus-uncles" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "sc-client-api", + "sp-authorship", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-executor" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "lazy_static", + "lru 0.7.8", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "sc-executor-common", + "sc-executor-wasmi", + "sp-api", + "sp-core", + "sp-core-hashing-proc-macro", + "sp-externalities", + "sp-io", + "sp-panic-handler", + "sp-runtime-interface", + "sp-tasks", + "sp-trie", + "sp-version", + "sp-wasm-interface", + "tracing", + "wasmi", +] + +[[package]] +name = "sc-executor-common" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "environmental", + "parity-scale-codec 3.1.5", + "sc-allocator", + "sp-maybe-compressed-blob", + "sp-sandbox", + "sp-serializer", + "sp-wasm-interface", + "thiserror", + "wasm-instrument", + "wasmi", +] + +[[package]] +name = "sc-executor-wasmi" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "log", + "parity-scale-codec 3.1.5", + "sc-allocator", + "sc-executor-common", + "sp-runtime-interface", + "sp-sandbox", + "sp-wasm-interface", + "wasmi", +] + +[[package]] +name = "sc-executor-wasmtime" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "log", + "once_cell", + "parity-scale-codec 3.1.5", + "parity-wasm 0.42.2", + "rustix 0.35.9", + "sc-allocator", + "sc-executor-common", + "sp-runtime-interface", + "sp-sandbox", + "sp-wasm-interface", + "wasmtime", +] + +[[package]] +name = "sc-finality-grandpa" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "ahash", + "async-trait", + "dyn-clone", + "finality-grandpa", + "fork-tree", + "futures", + "futures-timer", + "hex", + "log", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "rand 0.8.5", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-consensus", + "sc-keystore", + "sc-network", + "sc-network-common", + "sc-network-gossip", + "sc-telemetry", + "sc-utils", + "serde_json", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-finality-grandpa", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-finality-grandpa-rpc" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "finality-grandpa", + "futures", + "jsonrpsee", + "log", + "parity-scale-codec 3.1.5", + "sc-client-api", + "sc-finality-grandpa", + "sc-rpc", + "serde", + "serde_json", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-informant" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "ansi_term", + "futures", + "futures-timer", + "log", + "parity-util-mem", + "sc-client-api", + "sc-network", + "sc-transaction-pool-api", + "sp-blockchain", + "sp-runtime", +] + +[[package]] +name = "sc-keystore" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "async-trait", + "hex", + "parking_lot 0.12.1", + "serde_json", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "thiserror", +] + +[[package]] +name = "sc-network" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "async-trait", + "asynchronous-codec", + "bitflags", + "bytes", + "cid", + "either", + "fnv", + "fork-tree", + "futures", + "futures-timer", + "hex", + "ip_network", + "libp2p", + "linked-hash-map", + "linked_hash_set", + "log", + "lru 0.7.8", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "pin-project", + "prost", + "prost-build", + "rand 0.7.3", + "sc-block-builder", + "sc-client-api", + "sc-consensus", + "sc-network-common", + "sc-peerset", + "sc-utils", + "serde", + "serde_json", + "smallvec", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", + "unsigned-varint", + "void", + "zeroize", +] + +[[package]] +name = "sc-network-common" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "bitflags", + "futures", + "libp2p", + "parity-scale-codec 3.1.5", + "prost-build", + "sc-consensus", + "sc-peerset", + "smallvec", + "sp-consensus", + "sp-finality-grandpa", + "sp-runtime", +] + +[[package]] +name = "sc-network-gossip" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "ahash", + "futures", + "futures-timer", + "libp2p", + "log", + "lru 0.7.8", + "sc-network", + "sp-runtime", + "substrate-prometheus-endpoint", + "tracing", +] + +[[package]] +name = "sc-network-light" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "futures", + "libp2p", + "log", + "parity-scale-codec 3.1.5", + "prost", + "prost-build", + "sc-client-api", + "sc-network-common", + "sc-peerset", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-network-sync" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "fork-tree", + "futures", + "libp2p", + "log", + "lru 0.7.8", + "parity-scale-codec 3.1.5", + "prost", + "prost-build", + "sc-client-api", + "sc-consensus", + "sc-network-common", + "sc-peerset", + "smallvec", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-finality-grandpa", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-offchain" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "bytes", + "fnv", + "futures", + "futures-timer", + "hex", + "hyper", + "hyper-rustls", + "num_cpus", + "once_cell", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "rand 0.7.3", + "sc-client-api", + "sc-network", + "sc-utils", + "sp-api", + "sp-core", + "sp-offchain", + "sp-runtime", + "threadpool", + "tracing", +] + +[[package]] +name = "sc-peerset" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "futures", + "libp2p", + "log", + "sc-utils", + "serde_json", + "wasm-timer", +] + +[[package]] +name = "sc-proposer-metrics" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "log", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "futures", + "hash-db", + "jsonrpsee", + "log", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-rpc-api", + "sc-tracing", + "sc-transaction-pool-api", + "sc-utils", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-keystore", + "sp-offchain", + "sp-rpc", + "sp-runtime", + "sp-session", + "sp-version", +] + +[[package]] +name = "sc-rpc-api" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "futures", + "jsonrpsee", + "log", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "sc-chain-spec", + "sc-transaction-pool-api", + "scale-info", + "serde", + "serde_json", + "sp-core", + "sp-rpc", + "sp-runtime", + "sp-tracing", + "sp-version", + "thiserror", +] + +[[package]] +name = "sc-rpc-server" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "futures", + "jsonrpsee", + "log", + "serde_json", + "substrate-prometheus-endpoint", + "tokio", +] + +[[package]] +name = "sc-service" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "async-trait", + "directories", + "exit-future", + "futures", + "futures-timer", + "hash-db", + "jsonrpsee", + "log", + "parity-scale-codec 3.1.5", + "parity-util-mem", + "parking_lot 0.12.1", + "pin-project", + "rand 0.7.3", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-executor", + "sc-informant", + "sc-keystore", + "sc-network", + "sc-network-common", + "sc-network-light", + "sc-network-sync", + "sc-offchain", + "sc-rpc", + "sc-rpc-server", + "sc-sysinfo", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "sc-transaction-pool-api", + "sc-utils", + "serde", + "serde_json", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-externalities", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "sp-session", + "sp-state-machine", + "sp-storage", + "sp-tracing", + "sp-transaction-pool", + "sp-transaction-storage-proof", + "sp-trie", + "sp-version", + "substrate-prometheus-endpoint", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "sc-state-db" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "log", + "parity-scale-codec 3.1.5", + "parity-util-mem", + "parity-util-mem-derive", + "parking_lot 0.12.1", + "sc-client-api", + "sp-core", +] + +[[package]] +name = "sc-sync-state-rpc" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "jsonrpsee", + "parity-scale-codec 3.1.5", + "sc-chain-spec", + "sc-client-api", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-finality-grandpa", + "serde", + "serde_json", + "sp-blockchain", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-sysinfo" +version = "6.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "futures", + "libc", + "log", + "rand 0.7.3", + "rand_pcg 0.2.1", + "regex", + "sc-telemetry", + "serde", + "serde_json", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sc-telemetry" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "chrono", + "futures", + "libp2p", + "log", + "parking_lot 0.12.1", + "pin-project", + "rand 0.7.3", + "serde", + "serde_json", + "thiserror", + "wasm-timer", +] + +[[package]] +name = "sc-tracing" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "ansi_term", + "atty", + "chrono", + "lazy_static", + "libc", + "log", + "once_cell", + "parking_lot 0.12.1", + "regex", + "rustc-hash", + "sc-client-api", + "sc-rpc-server", + "sc-tracing-proc-macro", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-rpc", + "sp-runtime", + "sp-tracing", + "thiserror", + "tracing", + "tracing-log", + "tracing-subscriber", +] + +[[package]] +name = "sc-tracing-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sc-transaction-pool" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "futures", + "futures-timer", + "linked-hash-map", + "log", + "parity-scale-codec 3.1.5", + "parity-util-mem", + "parking_lot 0.12.1", + "retain_mut", + "sc-client-api", + "sc-transaction-pool-api", + "sc-utils", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-runtime", + "sp-tracing", + "sp-transaction-pool", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-transaction-pool-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "futures", + "log", + "serde", + "sp-blockchain", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-utils" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "futures", + "futures-timer", + "lazy_static", + "log", + "parking_lot 0.12.1", + "prometheus", +] + +[[package]] +name = "scale-info" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c46be926081c9f4dd5dd9b6f1d3e3229f2360bc6502dd8836f84a93b7c75e99a" +dependencies = [ + "bitvec", + "cfg-if 1.0.0", + "derive_more", + "parity-scale-codec 3.1.5", + "scale-info-derive", + "serde", +] + +[[package]] +name = "scale-info-derive" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e334bb10a245e28e5fd755cabcafd96cfcd167c99ae63a46924ca8d8703a3c" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys", +] + +[[package]] +name = "schnorrkel" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "curve25519-dalek 2.1.3", + "getrandom 0.1.16", + "merlin", + "rand 0.7.3", + "rand_core 0.5.1", + "sha2 0.8.2", + "subtle", + "zeroize", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "sec1" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" +dependencies = [ + "der", + "generic-array 0.14.6", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7649a0b3ffb32636e60c7ce0d70511eda9c52c658cd0634e194d5a19943aeff" +dependencies = [ + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7058dc8eaf3f2810d7828680320acda0b25a288f6d288e19278e249bbf74226b" +dependencies = [ + "cc", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" +dependencies = [ + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +dependencies = [ + "itoa 1.0.3", + "ryu", + "serde", +] + +[[package]] +name = "serde_nanos" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e44969a61f5d316be20a42ff97816efb3b407a924d06824c3d8a49fa8450de0e" +dependencies = [ + "serde", +] + +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha1" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "006769ba83e921b3085caa8334186b00cf92b4cb1a6cf4632fbccc8eff5c7549" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.3", +] + +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha2" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9db03534dff993187064c4e0c05a5708d2a9728ace9a8959b77bedf415dac5" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.3", +] + +[[package]] +name = "sha3" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "keccak", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha3" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaedf34ed289ea47c2b741bb72e5357a209512d67bcd4bda44359e5bf0470f56" +dependencies = [ + "digest 0.10.3", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" + +[[package]] +name = "signal-hook" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" +dependencies = [ + "digest 0.9.0", + "rand_core 0.6.3", +] + +[[package]] +name = "simba" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e82063457853d00243beda9952e910b82593e4b07ae9f721b9278a99a0d3d5c" +dependencies = [ + "approx", + "num-complex", + "num-traits", + "paste", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "slice-group-by" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" + +[[package]] +name = "slot-range-helper" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "enumn", + "parity-scale-codec 3.1.5", + "paste", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "slotmap" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" + +[[package]] +name = "snap" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45456094d1983e2ee2a18fdfebce3189fa451699d0502cb8e3b49dba5ba41451" + +[[package]] +name = "snow" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "774d05a3edae07ce6d68ea6984f3c05e9bba8927e3dd591e3b479e5b03213d0d" +dependencies = [ + "aes-gcm", + "blake2", + "chacha20poly1305", + "curve25519-dalek 4.0.0-pre.1", + "rand_core 0.6.3", + "ring", + "rustc_version 0.4.0", + "sha2 0.10.5", + "subtle", +] + +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64", + "bytes", + "flate2", + "futures", + "httparse", + "log", + "rand 0.8.5", + "sha-1", +] + +[[package]] +name = "sp-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec 3.1.5", + "sp-api-proc-macro", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-version", + "thiserror", +] + +[[package]] +name = "sp-api-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "blake2", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-application-crypto" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sp-arithmetic" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-debug-derive", + "sp-std", + "static_assertions", +] + +[[package]] +name = "sp-authority-discovery" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "parity-scale-codec 3.1.5", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-authorship" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "async-trait", + "parity-scale-codec 3.1.5", + "sp-inherents", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-block-builder" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "parity-scale-codec 3.1.5", + "sp-api", + "sp-inherents", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-blockchain" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "futures", + "log", + "lru 0.7.8", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "sp-api", + "sp-consensus", + "sp-database", + "sp-runtime", + "sp-state-machine", + "thiserror", +] + +[[package]] +name = "sp-consensus" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "log", + "parity-scale-codec 3.1.5", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-version", + "thiserror", +] + +[[package]] +name = "sp-consensus-aura" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "async-trait", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-consensus", + "sp-consensus-slots", + "sp-inherents", + "sp-runtime", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "sp-consensus-babe" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "async-trait", + "merlin", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-consensus", + "sp-consensus-slots", + "sp-consensus-vrf", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "sp-consensus-slots" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-arithmetic", + "sp-runtime", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "sp-consensus-vrf" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "parity-scale-codec 3.1.5", + "scale-info", + "schnorrkel", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-core" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "base58", + "bitflags", + "blake2-rfc", + "byteorder", + "dyn-clonable", + "ed25519-dalek", + "futures", + "hash-db", + "hash256-std-hasher", + "hex", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin", + "num-traits", + "parity-scale-codec 3.1.5", + "parity-util-mem", + "parking_lot 0.12.1", + "primitive-types", + "rand 0.7.3", + "regex", + "scale-info", + "schnorrkel", + "secp256k1", + "secrecy", + "serde", + "sp-core-hashing", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", + "ss58-registry", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "wasmi", + "zeroize", +] + +[[package]] +name = "sp-core-hashing" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "blake2", + "byteorder", + "digest 0.10.3", + "sha2 0.10.5", + "sha3 0.10.4", + "sp-std", + "twox-hash", +] + +[[package]] +name = "sp-core-hashing-proc-macro" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "proc-macro2", + "quote", + "sp-core-hashing", + "syn", +] + +[[package]] +name = "sp-database" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "kvdb", + "parking_lot 0.12.1", +] + +[[package]] +name = "sp-debug-derive" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-externalities" +version = "0.12.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "environmental", + "parity-scale-codec 3.1.5", + "sp-std", + "sp-storage", +] + +[[package]] +name = "sp-finality-grandpa" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "finality-grandpa", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-inherents" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec 3.1.5", + "sp-core", + "sp-runtime", + "sp-std", + "thiserror", +] + +[[package]] +name = "sp-io" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "futures", + "hash-db", + "libsecp256k1", + "log", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "secp256k1", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-trie", + "sp-wasm-interface", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-keyring" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "lazy_static", + "sp-core", + "sp-runtime", + "strum", +] + +[[package]] +name = "sp-keystore" +version = "0.12.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "async-trait", + "futures", + "merlin", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "schnorrkel", + "serde", + "sp-core", + "sp-externalities", + "thiserror", +] + +[[package]] +name = "sp-maybe-compressed-blob" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "thiserror", + "zstd", +] + +[[package]] +name = "sp-mmr-primitives" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "log", + "parity-scale-codec 3.1.5", + "serde", + "sp-api", + "sp-core", + "sp-debug-derive", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-npos-elections" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "parity-scale-codec 3.1.5", + "scale-info", + "serde", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-offchain" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "sp-api", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "sp-panic-handler" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "backtrace", + "lazy_static", + "regex", +] + +[[package]] +name = "sp-rpc" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "rustc-hash", + "serde", + "sp-core", +] + +[[package]] +name = "sp-runtime" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec 3.1.5", + "parity-util-mem", + "paste", + "rand 0.7.3", + "scale-info", + "serde", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sp-runtime-interface" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec 3.1.5", + "primitive-types", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "Inflector", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-sandbox" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "log", + "parity-scale-codec 3.1.5", + "sp-core", + "sp-io", + "sp-std", + "sp-wasm-interface", + "wasmi", +] + +[[package]] +name = "sp-serializer" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "sp-session" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "parity-scale-codec 3.1.5", + "scale-info", + "sp-api", + "sp-core", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "sp-staking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "parity-scale-codec 3.1.5", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-state-machine" +version = "0.12.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "hash-db", + "log", + "num-traits", + "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", + "rand 0.7.3", + "smallvec", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-std", + "sp-trie", + "thiserror", + "tracing", + "trie-root", +] + +[[package]] +name = "sp-std" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" + +[[package]] +name = "sp-storage" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "impl-serde", + "parity-scale-codec 3.1.5", + "ref-cast", + "serde", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "sp-tasks" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "log", + "sp-core", + "sp-externalities", + "sp-io", + "sp-runtime-interface", + "sp-std", +] + +[[package]] +name = "sp-timestamp" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "async-trait", + "futures-timer", + "log", + "parity-scale-codec 3.1.5", + "sp-api", + "sp-inherents", + "sp-runtime", + "sp-std", + "thiserror", +] + +[[package]] +name = "sp-tracing" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "parity-scale-codec 3.1.5", + "sp-std", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-transaction-pool" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "sp-api", + "sp-runtime", +] + +[[package]] +name = "sp-transaction-storage-proof" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "async-trait", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-std", + "sp-trie", +] + +[[package]] +name = "sp-trie" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "hash-db", + "memory-db", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-core", + "sp-std", + "thiserror", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-version" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "impl-serde", + "parity-scale-codec 3.1.5", + "parity-wasm 0.42.2", + "scale-info", + "serde", + "sp-core-hashing-proc-macro", + "sp-runtime", + "sp-std", + "sp-version-proc-macro", + "thiserror", +] + +[[package]] +name = "sp-version-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "parity-scale-codec 3.1.5", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-wasm-interface" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "impl-trait-for-tuples", + "log", + "parity-scale-codec 3.1.5", + "sp-std", + "wasmi", + "wasmtime", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "ss58-registry" +version = "1.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0837b5d62f42082c9d56cd946495ae273a3c68083b637b9153341d5e465146d" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "static_init" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11b73400442027c4adedda20a9f9b7945234a5bd8d5f7e86da22bd5d0622369c" +dependencies = [ + "cfg_aliases", + "libc", + "parking_lot 0.11.2", + "static_init_macro", +] + +[[package]] +name = "static_init_macro" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2261c91034a1edc3fc4d1b80e89d82714faede0515c14a75da10cb941546bbf" +dependencies = [ + "cfg_aliases", + "memchr", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "statrs" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05bdbb8e4e78216a85785a85d3ec3183144f98d0097b9281802c019bb07a6f05" +dependencies = [ + "approx", + "lazy_static", + "nalgebra", + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "struct-versioning" +version = "0.1.0" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + +[[package]] +name = "substrate-bip39" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" +dependencies = [ + "hmac 0.11.0", + "pbkdf2 0.8.0", + "schnorrkel", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "substrate-frame-rpc-system" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "frame-system-rpc-runtime-api", + "futures", + "jsonrpsee", + "log", + "parity-scale-codec 3.1.5", + "sc-client-api", + "sc-rpc-api", + "sc-transaction-pool-api", + "serde_json", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "substrate-prometheus-endpoint" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "futures-util", + "hyper", + "log", + "prometheus", + "thiserror", + "tokio", +] + +[[package]] +name = "substrate-state-trie-migration-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "jsonrpsee", + "log", + "parity-scale-codec 3.1.5", + "sc-client-api", + "sc-rpc-api", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", + "trie-db", +] + +[[package]] +name = "substrate-wasm-builder" +version = "5.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +dependencies = [ + "ansi_term", + "build-helper", + "cargo_metadata", + "filetime", + "sp-maybe-compressed-blob", + "strum", + "tempfile", + "toml", + "walkdir", + "wasm-gc-api", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "system-configuration" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" +dependencies = [ + "bitflags", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "target-lexicon" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02424087780c9b71cc96799eaeddff35af2bc513278cda5c99fc1f5d026d3c1" + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if 1.0.0", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" + +[[package]] +name = "thiserror" +version = "1.0.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1b05ca9d106ba7d2e31a9dab4a64e7be2cce415321966ea3132c49a656e252" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8f2591983642de85c921015f3f070c665a197ed69e417af436115e3a1407487" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thousands" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" + +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "thrift" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b82ca8f46f95b3ce96081fe3dd89160fdea970c254bb72925255d1b62aae692e" +dependencies = [ + "byteorder", + "integer-encoding", + "log", + "ordered-float", + "threadpool", +] + +[[package]] +name = "tikv-jemalloc-sys" +version = "0.4.3+5.2.1-patched.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1792ccb507d955b46af42c123ea8863668fae24d03721e40cad6a41773dbb49" +dependencies = [ + "cc", + "fs_extra", + "libc", +] + +[[package]] +name = "time" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +dependencies = [ + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2 0.4.0", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89797afd69d206ccd11fb0ea560a44bbb87731d020670e79416d442919257d42" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "once_cell", + "parking_lot 0.12.1", + "pin-project-lite 0.2.9", + "signal-hook-registry", + "socket2", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-stream" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" +dependencies = [ + "futures-core", + "pin-project-lite 0.2.9", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite 0.2.9", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +dependencies = [ + "serde", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" +dependencies = [ + "cfg-if 1.0.0", + "pin-project-lite 0.2.9", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-gum" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "polkadot-node-jaeger", + "polkadot-primitives", + "tracing", + "tracing-gum-proc-macro", +] + +[[package]] +name = "tracing-gum-proc-macro" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "expander 0.0.6", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "ansi_term", + "chrono", + "lazy_static", + "matchers", + "parking_lot 0.11.2", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", +] + +[[package]] +name = "trie-db" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32d034c0d3db64b43c31de38e945f15b40cd4ca6d2dcfc26d4798ce8de4ab83" +dependencies = [ + "hash-db", + "hashbrown 0.12.3", + "log", + "rustc-hex", + "smallvec", +] + +[[package]] +name = "trie-root" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" +dependencies = [ + "hash-db", +] + +[[package]] +name = "triehash" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" +dependencies = [ + "hash-db", + "rlp", +] + +[[package]] +name = "trust-dns-proto" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" +dependencies = [ + "async-trait", + "cfg-if 1.0.0", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.2.3", + "ipnet", + "lazy_static", + "log", + "rand 0.8.5", + "smallvec", + "thiserror", + "tinyvec", + "url", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" +dependencies = [ + "cfg-if 1.0.0", + "futures-util", + "ipconfig", + "lazy_static", + "log", + "lru-cache", + "parking_lot 0.12.1", + "resolv-conf", + "smallvec", + "thiserror", + "trust-dns-proto", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "tt-call" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e66dcbec4290c69dd03c57e76c2469ea5c7ce109c6dd4351c13055cf71ea055" + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if 1.0.0", + "digest 0.10.3", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + +[[package]] +name = "uint" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" + +[[package]] +name = "unicode-normalization" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" + +[[package]] +name = "unicode-xid" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" + +[[package]] +name = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array 0.14.6", + "subtle", +] + +[[package]] +name = "unsigned-varint" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +dependencies = [ + "asynchronous-codec", + "bytes", + "futures-io", + "futures-util", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "up-common" +version = "0.9.27" +dependencies = [ + "fp-rpc", + "frame-support", + "pallet-evm", + "sp-consensus-aura", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "up-data-structs" +version = "0.2.2" +dependencies = [ + "derivative", + "frame-support", + "frame-system", + "pallet-evm", + "parity-scale-codec 3.1.5", + "rmrk-traits", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", + "struct-versioning", +] + +[[package]] +name = "up-rpc" +version = "0.1.3" +dependencies = [ + "pallet-common", + "pallet-evm", + "parity-scale-codec 3.1.5", + "sp-api", + "sp-core", + "sp-runtime", + "sp-std", + "up-data-structs", +] + +[[package]] +name = "up-sponsorship" +version = "0.1.0" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04" +dependencies = [ + "impl-trait-for-tuples", +] + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna 0.3.0", + "percent-encoding", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "value-bag" +version = "1.0.0-alpha.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" +dependencies = [ + "ctor", + "version_check", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" + +[[package]] +name = "wasm-gc-api" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0c32691b6c7e6c14e7f8fd55361a9088b507aa49620fcd06c09b3a1082186b9" +dependencies = [ + "log", + "parity-wasm 0.32.0", + "rustc-demangle", +] + +[[package]] +name = "wasm-instrument" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "962e5b0401bbb6c887f54e69b8c496ea36f704df65db73e81fd5ff8dc3e63a9f" +dependencies = [ + "parity-wasm 0.42.2", +] + +[[package]] +name = "wasm-timer" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca00c5147c319a8ec91ec1a0edbec31e566ce2c9cc93b3f9bb86a9efd0eb795d" +dependencies = [ + "downcast-rs", + "libc", + "libm", + "memory_units", + "num-rational 0.2.4", + "num-traits", + "parity-wasm 0.42.2", + "wasmi-validation", +] + +[[package]] +name = "wasmi-validation" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "165343ecd6c018fc09ebcae280752702c9a2ef3e6f8d02f1cfcbdb53ef6d7937" +dependencies = [ + "parity-wasm 0.42.2", +] + +[[package]] +name = "wasmparser" +version = "0.85.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "570460c58b21e9150d2df0eaaedbb7816c34bcec009ae0dcc976e40ba81463e7" +dependencies = [ + "indexmap", +] + +[[package]] +name = "wasmtime" +version = "0.38.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f50eadf868ab6a04b7b511460233377d0bfbb92e417b2f6a98b98fef2e098f5" +dependencies = [ + "anyhow", + "backtrace", + "bincode", + "cfg-if 1.0.0", + "indexmap", + "lazy_static", + "libc", + "log", + "object 0.28.4", + "once_cell", + "paste", + "psm", + "rayon", + "region", + "serde", + "target-lexicon", + "wasmparser", + "wasmtime-cache", + "wasmtime-cranelift", + "wasmtime-environ", + "wasmtime-jit", + "wasmtime-runtime", + "winapi", +] + +[[package]] +name = "wasmtime-cache" +version = "0.38.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1df23c642e1376892f3b72f311596976979cbf8b85469680cdd3a8a063d12a2" +dependencies = [ + "anyhow", + "base64", + "bincode", + "directories-next", + "file-per-thread-logger", + "log", + "rustix 0.33.7", + "serde", + "sha2 0.9.9", + "toml", + "winapi", + "zstd", +] + +[[package]] +name = "wasmtime-cranelift" +version = "0.38.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f264ff6b4df247d15584f2f53d009fbc90032cfdc2605b52b961bffc71b6eccd" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli", + "log", + "more-asserts", + "object 0.28.4", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-environ" +version = "0.38.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "839d2820e4b830f4b9e7aa08d4c0acabf4a5036105d639f6dfa1c6891c73bdc6" +dependencies = [ + "anyhow", + "cranelift-entity", + "gimli", + "indexmap", + "log", + "more-asserts", + "object 0.28.4", + "serde", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "wasmtime-jit" +version = "0.38.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef0a0bcbfa18b946d890078ba0e1bc76bcc53eccfb40806c0020ec29dcd1bd49" +dependencies = [ + "addr2line", + "anyhow", + "bincode", + "cfg-if 1.0.0", + "cpp_demangle", + "gimli", + "log", + "object 0.28.4", + "region", + "rustc-demangle", + "rustix 0.33.7", + "serde", + "target-lexicon", + "thiserror", + "wasmtime-environ", + "wasmtime-jit-debug", + "wasmtime-runtime", + "winapi", +] + +[[package]] +name = "wasmtime-jit-debug" +version = "0.38.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f4779d976206c458edd643d1ac622b6c37e4a0800a8b1d25dfbf245ac2f2cac" +dependencies = [ + "lazy_static", + "object 0.28.4", + "rustix 0.33.7", +] + +[[package]] +name = "wasmtime-runtime" +version = "0.38.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7eb6ffa169eb5dcd18ac9473c817358cd57bc62c244622210566d473397954a" +dependencies = [ + "anyhow", + "backtrace", + "cc", + "cfg-if 1.0.0", + "indexmap", + "libc", + "log", + "mach", + "memfd", + "memoffset", + "more-asserts", + "rand 0.8.5", + "region", + "rustix 0.33.7", + "thiserror", + "wasmtime-environ", + "wasmtime-jit-debug", + "winapi", +] + +[[package]] +name = "wasmtime-types" +version = "0.38.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d932b0ac5336f7308d869703dd225610a6a3aeaa8e968c52b43eed96cefb1c2" +dependencies = [ + "cranelift-entity", + "serde", + "thiserror", + "wasmparser", +] + +[[package]] +name = "web-sys" +version = "0.3.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1c760f0d366a6c24a02ed7816e23e691f5d92291f94d15e836006fd11b04daf" +dependencies = [ + "webpki", +] + +[[package]] +name = "wepoll-ffi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +dependencies = [ + "cc", +] + +[[package]] +name = "which" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" +dependencies = [ + "either", + "libc", + "once_cell", +] + +[[package]] +name = "widestring" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f" +dependencies = [ + "windows_aarch64_msvc 0.34.0", + "windows_i686_gnu 0.34.0", + "windows_i686_msvc 0.34.0", + "windows_x86_64_gnu 0.34.0", + "windows_x86_64_msvc 0.34.0", +] + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "winreg" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +dependencies = [ + "winapi", +] + +[[package]] +name = "wyz" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b31594f29d27036c383b53b59ed3476874d518f0efb151b27a4c275141390e" +dependencies = [ + "tap", +] + +[[package]] +name = "x25519-dalek" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" +dependencies = [ + "curve25519-dalek 3.2.0", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "xcm" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "derivative", + "impl-trait-for-tuples", + "log", + "parity-scale-codec 3.1.5", + "scale-info", + "sp-runtime", + "xcm-procedural", +] + +[[package]] +name = "xcm-builder" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "frame-support", + "frame-system", + "log", + "pallet-transaction-payment", + "parity-scale-codec 3.1.5", + "polkadot-parachain", + "scale-info", + "sp-arithmetic", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "xcm-executor" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "frame-support", + "impl-trait-for-tuples", + "log", + "parity-scale-codec 3.1.5", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", +] + +[[package]] +name = "xcm-procedural" +version = "0.9.27" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "yamux" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" +dependencies = [ + "futures", + "log", + "nohash-hasher", + "parking_lot 0.12.1", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "zeroize" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.1+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" +dependencies = [ + "cc", + "libc", +] diff --git a/runtime/unique/CHANGELOG.md b/runtime/unique/CHANGELOG.md index 574592dbcf..f28cd71f83 100644 --- a/runtime/unique/CHANGELOG.md +++ b/runtime/unique/CHANGELOG.md @@ -3,16 +3,23 @@ All notable changes to this project will be documented in this file. + +## [v0.9.27] 2022-09-08 + +### Added + +- `AppPromotion` pallet to runtime. + ## [v0.9.27] 2022-08-16 ### Bugfixes -- Add missing config keys 74f532ac28dce15c15e7d576c074a58eba658c08 +- Add missing config keys 74f532ac28dce15c15e7d576c074a58eba658c08 ### Other changes -- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a +- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a -- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 +- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8 -- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b +- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b From 66f5308c33e3b8244820408da07cd822d0075889 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Mon, 12 Sep 2022 20:33:37 +0700 Subject: [PATCH 0846/1274] fmt --- pallets/app-promotion/src/types.rs | 2 +- pallets/evm-contract-helpers/src/lib.rs | 2 +- pallets/unique/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pallets/app-promotion/src/types.rs b/pallets/app-promotion/src/types.rs index 83027c87d2..96acb91a70 100644 --- a/pallets/app-promotion/src/types.rs +++ b/pallets/app-promotion/src/types.rs @@ -92,7 +92,7 @@ pub trait ContractHandler { sponsor_id: Self::AccountId, contract_address: Self::ContractId, ) -> DispatchResult; - + /// Removes sponsor for a contract. /// /// - `contract_address`: ID of the modified contract. diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index b8a5d6732c..6ecc6764b9 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -272,7 +272,7 @@ pub mod pallet { /// Force remove `sponsor` for `contract`. /// - /// Differs from `remove_sponsor` in that + /// Differs from `remove_sponsor` in that /// it doesn't require consent from the `owner` of the contract. pub fn force_remove_sponsor(contract_address: H160) -> DispatchResult { Sponsoring::::remove(contract_address); diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index 8f257c3389..7c2cbcf785 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -1138,7 +1138,7 @@ impl Pallet { /// /// Differs from `remove_sponsor` in that /// it doesn't require consent from the `owner` of the collection. - /// + /// /// # Arguments /// /// * `collection_id`: ID of the modified collection. From 352edb7eb51e68e98cd99b2015ab858c33420e67 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 12 Sep 2022 16:37:59 +0300 Subject: [PATCH 0847/1274] disable quartz and unique --- .github/workflows/market-test_v2.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index db8e7a5c7d..297b0ffe5b 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -22,10 +22,10 @@ jobs: include: - network: "opal" features: "opal-runtime" - - network: "quartz" - features: "quartz-runtime" - - network: "unique" - features: "unique-runtime" +# - network: "quartz" +# features: "quartz-runtime" +# - network: "unique" +# features: "unique-runtime" steps: From 31a5766563f763ad02e6b6f98ae4e10bb36c7da8 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Mon, 12 Sep 2022 20:38:32 +0700 Subject: [PATCH 0848/1274] del Cargo.lock --- runtime/quartz/Cargo.lock | 11721 ------------------------------------ 1 file changed, 11721 deletions(-) delete mode 100644 runtime/quartz/Cargo.lock diff --git a/runtime/quartz/Cargo.lock b/runtime/quartz/Cargo.lock deleted file mode 100644 index 886826b5d3..0000000000 --- a/runtime/quartz/Cargo.lock +++ /dev/null @@ -1,11721 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - -[[package]] -name = "addr2line" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aead" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" -dependencies = [ - "generic-array 0.14.6", -] - -[[package]] -name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if 1.0.0", - "cipher", - "cpufeatures", - "opaque-debug 0.3.0", -] - -[[package]] -name = "aes-gcm" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "ghash", - "subtle", -] - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom 0.2.7", - "once_cell", - "version_check", -] - -[[package]] -name = "aho-corasick" -version = "0.7.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" -dependencies = [ - "memchr", -] - -[[package]] -name = "always-assert" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf688625d06217d5b1bb0ea9d9c44a1635fd0ee3534466388d18203174f4d11" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - -[[package]] -name = "anyhow" -version = "1.0.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9a8f622bcf6ff3df478e9deba3e03e4e04b300f8e6a139e192c05fa3490afc7" - -[[package]] -name = "app-promotion-rpc" -version = "0.1.0" -dependencies = [ - "pallet-common", - "pallet-evm", - "parity-scale-codec 3.1.5", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std", - "up-data-structs", -] - -[[package]] -name = "approx" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" -dependencies = [ - "num-traits", -] - -[[package]] -name = "arrayref" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" - -[[package]] -name = "arrayvec" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" -dependencies = [ - "nodrop", -] - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "asn1_der" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22d1f4b888c298a027c99dc9048015fac177587de20fc30232a057dfbe24a21" - -[[package]] -name = "assert_matches" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" - -[[package]] -name = "async-attributes" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "async-channel" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" -dependencies = [ - "concurrent-queue", - "event-listener", - "futures-core", -] - -[[package]] -name = "async-executor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "once_cell", - "slab", -] - -[[package]] -name = "async-global-executor" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da5b41ee986eed3f524c380e6d64965aea573882a8907682ad100f7859305ca" -dependencies = [ - "async-channel", - "async-executor", - "async-io", - "async-lock", - "blocking", - "futures-lite", - "once_cell", -] - -[[package]] -name = "async-io" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e21f3a490c72b3b0cf44962180e60045de2925d8dff97918f7ee43c8f637c7" -dependencies = [ - "autocfg", - "concurrent-queue", - "futures-lite", - "libc", - "log", - "once_cell", - "parking", - "polling", - "slab", - "socket2", - "waker-fn", - "winapi", -] - -[[package]] -name = "async-lock" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" -dependencies = [ - "event-listener", -] - -[[package]] -name = "async-process" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02111fd8655a613c25069ea89fc8d9bb89331fa77486eb3bc059ee757cfa481c" -dependencies = [ - "async-io", - "autocfg", - "blocking", - "cfg-if 1.0.0", - "event-listener", - "futures-lite", - "libc", - "once_cell", - "signal-hook", - "winapi", -] - -[[package]] -name = "async-std" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-attributes", - "async-channel", - "async-global-executor", - "async-io", - "async-lock", - "async-process", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite 0.2.9", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[package]] -name = "async-std-resolver" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2f8a4a203be3325981310ab243a28e6e4ea55b6519bffce05d41ab60e09ad8" -dependencies = [ - "async-std", - "async-trait", - "futures-io", - "futures-util", - "pin-utils", - "socket2", - "trust-dns-resolver", -] - -[[package]] -name = "async-task" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" - -[[package]] -name = "async-trait" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "asynchronous-codec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0de5164e5edbf51c45fb8c2d9664ae1c095cce1b265ecf7569093c0d66ef690" -dependencies = [ - "bytes", - "futures-sink", - "futures-util", - "memchr", - "pin-project-lite 0.2.9", -] - -[[package]] -name = "atomic-waker" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "auto_impl" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "backtrace" -version = "0.3.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" -dependencies = [ - "addr2line", - "cc", - "cfg-if 1.0.0", - "libc", - "miniz_oxide", - "object 0.29.0", - "rustc-demangle", -] - -[[package]] -name = "base-x" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" - -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - -[[package]] -name = "base58" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" - -[[package]] -name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - -[[package]] -name = "beef" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" -dependencies = [ - "serde", -] - -[[package]] -name = "beefy-gadget" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "beefy-primitives", - "fnv", - "futures", - "futures-timer", - "hex", - "log", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "sc-chain-spec", - "sc-client-api", - "sc-finality-grandpa", - "sc-keystore", - "sc-network", - "sc-network-gossip", - "sc-utils", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-keystore", - "sp-mmr-primitives", - "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", - "wasm-timer", -] - -[[package]] -name = "beefy-gadget-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "beefy-gadget", - "beefy-primitives", - "futures", - "jsonrpsee", - "log", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "sc-rpc", - "sc-utils", - "serde", - "sp-core", - "sp-runtime", - "thiserror", -] - -[[package]] -name = "beefy-merkle-tree" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "beefy-primitives", - "sp-api", -] - -[[package]] -name = "beefy-primitives" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "parity-scale-codec 3.1.5", - "scale-info", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "bimap" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0455254eb5c6964c4545d8bac815e1a1be4f3afe0ae695ea539c12d728d44b" - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bindgen" -version = "0.59.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "peeking_take_while", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9cf849ee05b2ee5fba5e36f97ff8ec2533916700fc0758d40d92136a42f3388" -dependencies = [ - "digest 0.10.3", -] - -[[package]] -name = "blake2-rfc" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" -dependencies = [ - "arrayvec 0.4.12", - "constant_time_eq", -] - -[[package]] -name = "blake2b_simd" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72936ee4afc7f8f736d1c38383b56480b5497b4617b4a77bdbf1d2ababc76127" -dependencies = [ - "arrayref", - "arrayvec 0.7.2", - "constant_time_eq", -] - -[[package]] -name = "blake2s_simd" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db539cc2b5f6003621f1cd9ef92d7ded8ea5232c7de0f9faa2de251cd98730d4" -dependencies = [ - "arrayref", - "arrayvec 0.7.2", - "constant_time_eq", -] - -[[package]] -name = "blake3" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" -dependencies = [ - "arrayref", - "arrayvec 0.7.2", - "cc", - "cfg-if 1.0.0", - "constant_time_eq", - "digest 0.10.3", -] - -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding 0.1.5", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "block-padding 0.2.1", - "generic-array 0.14.6", -] - -[[package]] -name = "block-buffer" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" -dependencies = [ - "generic-array 0.14.6", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", -] - -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - -[[package]] -name = "blocking" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" -dependencies = [ - "async-channel", - "async-task", - "atomic-waker", - "fastrand", - "futures-lite", - "once_cell", -] - -[[package]] -name = "bounded-vec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3372be4090bf9d4da36bd8ba7ce6ca1669503d0cf6e667236c6df7f053153eb6" -dependencies = [ - "thiserror", -] - -[[package]] -name = "bs58" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" - -[[package]] -name = "bstr" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" -dependencies = [ - "memchr", -] - -[[package]] -name = "build-helper" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" -dependencies = [ - "semver 0.6.0", -] - -[[package]] -name = "bumpalo" -version = "3.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" - -[[package]] -name = "byte-slice-cast" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c5fdd0166095e1d463fc6cc01aa8ce547ad77a4e84d42eb6762b084e28067e" - -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - -[[package]] -name = "cache-padded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" - -[[package]] -name = "camino" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" -dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.13", - "serde", - "serde_json", -] - -[[package]] -name = "cc" -version = "1.0.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" -dependencies = [ - "jobserver", -] - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - -[[package]] -name = "chacha20" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" -dependencies = [ - "cfg-if 1.0.0", - "cipher", - "cpufeatures", - "zeroize", -] - -[[package]] -name = "chacha20poly1305" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" -dependencies = [ - "aead", - "chacha20", - "cipher", - "poly1305", - "zeroize", -] - -[[package]] -name = "chrono" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" -dependencies = [ - "iana-time-zone", - "js-sys", - "num-integer", - "num-traits", - "time", - "wasm-bindgen", - "winapi", -] - -[[package]] -name = "cid" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" -dependencies = [ - "core2", - "multibase", - "multihash", - "serde", - "unsigned-varint", -] - -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array 0.14.6", -] - -[[package]] -name = "ckb-merkle-mountain-range" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f061f97d64fd1822664bdfb722f7ae5469a97b77567390f7442be5b5dc82a5b" -dependencies = [ - "cfg-if 0.1.10", -] - -[[package]] -name = "clang-sys" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b" -dependencies = [ - "glob", - "libc", - "libloading 0.7.3", -] - -[[package]] -name = "clap" -version = "3.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b71c3ce99b7611011217b366d923f1d0a7e07a92bb2dbf1e84508c673ca3bd" -dependencies = [ - "atty", - "bitflags", - "clap_derive", - "clap_lex", - "indexmap", - "once_cell", - "strsim", - "termcolor", - "textwrap", -] - -[[package]] -name = "clap_derive" -version = "3.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - -[[package]] -name = "cmake" -version = "0.1.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" -dependencies = [ - "cc", -] - -[[package]] -name = "coarsetime" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "454038500439e141804c655b4cd1bc6a70bcb95cd2bc9463af5661b6956f0e46" -dependencies = [ - "libc", - "once_cell", - "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", -] - -[[package]] -name = "comfy-table" -version = "6.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85914173c2f558d61613bfbbf1911f14e630895087a7ed2fafc0f5319e1536e7" -dependencies = [ - "strum", - "strum_macros", - "unicode-width", -] - -[[package]] -name = "concurrent-queue" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" -dependencies = [ - "cache-padded", -] - -[[package]] -name = "const-oid" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" - -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" - -[[package]] -name = "core2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" -dependencies = [ - "memchr", -] - -[[package]] -name = "cpp_demangle" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "cranelift-bforest" -version = "0.85.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "749d0d6022c9038dccf480bdde2a38d435937335bf2bb0f14e815d94517cdce8" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.85.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94370cc7b37bf652ccd8bb8f09bd900997f7ccf97520edfc75554bb5c4abbea" -dependencies = [ - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "cranelift-isle", - "gimli", - "log", - "regalloc2", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.85.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a3cea8fdab90e44018c5b9a1dfd460d8ee265ac354337150222a354628bdb6" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.85.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ac72f76f2698598951ab26d8c96eaa854810e693e7dd52523958b5909fde6b2" - -[[package]] -name = "cranelift-entity" -version = "0.85.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09eaeacfcd2356fe0e66b295e8f9d59fdd1ac3ace53ba50de14d628ec902f72d" -dependencies = [ - "serde", -] - -[[package]] -name = "cranelift-frontend" -version = "0.85.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba69c9980d5ffd62c18a2bde927855fcd7c8dc92f29feaf8636052662cbd99c" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-isle" -version = "0.85.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2920dc1e05cac40304456ed3301fde2c09bd6a9b0210bcfa2f101398d628d5b" - -[[package]] -name = "cranelift-native" -version = "0.85.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04dfa45f9b2a6f587c564d6b63388e00cd6589d2df6ea2758cf79e1a13285e6" -dependencies = [ - "cranelift-codegen", - "libc", - "target-lexicon", -] - -[[package]] -name = "cranelift-wasm" -version = "0.85.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31a46513ae6f26f3f267d8d75b5373d555fbbd1e68681f348d99df43f747ec54" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "itertools", - "log", - "smallvec", - "wasmparser", - "wasmtime-types", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" -dependencies = [ - "autocfg", - "cfg-if 1.0.0", - "crossbeam-utils", - "memoffset", - "once_cell", - "scopeguard", -] - -[[package]] -name = "crossbeam-queue" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd42583b04998a5363558e5f9291ee5a5ff6b49944332103f251e7479a82aa7" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" -dependencies = [ - "cfg-if 1.0.0", - "once_cell", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-bigint" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" -dependencies = [ - "generic-array 0.14.6", - "rand_core 0.6.3", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array 0.14.6", - "typenum", -] - -[[package]] -name = "crypto-mac" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" -dependencies = [ - "generic-array 0.14.6", - "subtle", -] - -[[package]] -name = "crypto-mac" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" -dependencies = [ - "generic-array 0.14.6", - "subtle", -] - -[[package]] -name = "ctor" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "ctr" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" -dependencies = [ - "cipher", -] - -[[package]] -name = "cuckoofilter" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b810a8449931679f64cd7eef1bbd0fa315801b6d5d9cdc1ace2804d6529eee18" -dependencies = [ - "byteorder", - "fnv", - "rand 0.7.3", -] - -[[package]] -name = "cumulus-pallet-aura-ext" -version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" -dependencies = [ - "frame-executive", - "frame-support", - "frame-system", - "pallet-aura", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-application-crypto", - "sp-consensus-aura", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "cumulus-pallet-dmp-queue" -version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" -dependencies = [ - "cumulus-primitives-core", - "frame-support", - "frame-system", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-io", - "sp-runtime", - "sp-std", - "xcm", - "xcm-executor", -] - -[[package]] -name = "cumulus-pallet-parachain-system" -version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" -dependencies = [ - "cumulus-pallet-parachain-system-proc-macro", - "cumulus-primitives-core", - "cumulus-primitives-parachain-inherent", - "environmental", - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "pallet-balances", - "parity-scale-codec 3.1.5", - "polkadot-parachain", - "scale-info", - "serde", - "sp-core", - "sp-externalities", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-trie", - "sp-version", - "xcm", -] - -[[package]] -name = "cumulus-pallet-parachain-system-proc-macro" -version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "cumulus-pallet-xcm" -version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" -dependencies = [ - "cumulus-primitives-core", - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-io", - "sp-runtime", - "sp-std", - "xcm", -] - -[[package]] -name = "cumulus-pallet-xcmp-queue" -version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" -dependencies = [ - "cumulus-primitives-core", - "frame-support", - "frame-system", - "log", - "parity-scale-codec 3.1.5", - "rand_chacha 0.3.1", - "scale-info", - "sp-runtime", - "sp-std", - "xcm", - "xcm-executor", -] - -[[package]] -name = "cumulus-primitives-core" -version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" -dependencies = [ - "frame-support", - "parity-scale-codec 3.1.5", - "polkadot-core-primitives", - "polkadot-parachain", - "polkadot-primitives", - "sp-api", - "sp-runtime", - "sp-std", - "sp-trie", -] - -[[package]] -name = "cumulus-primitives-parachain-inherent" -version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" -dependencies = [ - "async-trait", - "cumulus-primitives-core", - "cumulus-relay-chain-interface", - "cumulus-test-relay-sproof-builder", - "parity-scale-codec 3.1.5", - "sc-client-api", - "scale-info", - "sp-api", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-storage", - "sp-trie", - "tracing", -] - -[[package]] -name = "cumulus-primitives-timestamp" -version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" -dependencies = [ - "cumulus-primitives-core", - "futures", - "parity-scale-codec 3.1.5", - "sp-inherents", - "sp-std", - "sp-timestamp", -] - -[[package]] -name = "cumulus-primitives-utility" -version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" -dependencies = [ - "cumulus-primitives-core", - "frame-support", - "parity-scale-codec 3.1.5", - "polkadot-core-primitives", - "polkadot-parachain", - "polkadot-primitives", - "sp-runtime", - "sp-std", - "sp-trie", - "xcm", - "xcm-builder", - "xcm-executor", -] - -[[package]] -name = "cumulus-relay-chain-interface" -version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" -dependencies = [ - "async-trait", - "cumulus-primitives-core", - "derive_more", - "futures", - "jsonrpsee-core", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "polkadot-overseer", - "polkadot-service", - "sc-client-api", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-runtime", - "sp-state-machine", - "thiserror", -] - -[[package]] -name = "cumulus-test-relay-sproof-builder" -version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" -dependencies = [ - "cumulus-primitives-core", - "parity-scale-codec 3.1.5", - "polkadot-primitives", - "sp-runtime", - "sp-state-machine", - "sp-std", -] - -[[package]] -name = "curve25519-dalek" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" -dependencies = [ - "byteorder", - "digest 0.8.1", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek" -version = "4.0.0-pre.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4033478fbf70d6acf2655ac70da91ee65852d69daf7a67bf7a2f518fb47aafcf" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.6.3", - "subtle", - "zeroize", -] - -[[package]] -name = "data-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" - -[[package]] -name = "data-encoding-macro" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86927b7cd2fe88fa698b87404b287ab98d1a0063a34071d92e575b72d3029aca" -dependencies = [ - "data-encoding", - "data-encoding-macro-internal", -] - -[[package]] -name = "data-encoding-macro-internal" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" -dependencies = [ - "data-encoding", - "syn", -] - -[[package]] -name = "der" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" -dependencies = [ - "const-oid", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "rustc_version 0.4.0", - "syn", -] - -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.4", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array 0.14.6", -] - -[[package]] -name = "digest" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" -dependencies = [ - "block-buffer 0.10.3", - "crypto-common", - "subtle", -] - -[[package]] -name = "directories" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "directories-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" -dependencies = [ - "cfg-if 1.0.0", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dns-parser" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4d33be9473d06f75f58220f71f7a9317aca647dc061dbd3c361b0bef505fbea" -dependencies = [ - "byteorder", - "quick-error", -] - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "dtoa" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6053ff46b5639ceb91756a85a4c8914668393a03170efd79c8884a529d80656" - -[[package]] -name = "dyn-clonable" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" -dependencies = [ - "dyn-clonable-impl", - "dyn-clone", -] - -[[package]] -name = "dyn-clonable-impl" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "dyn-clone" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2" - -[[package]] -name = "ecdsa" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" -dependencies = [ - "der", - "elliptic-curve", - "rfc6979", - "signature", -] - -[[package]] -name = "ed25519" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" -dependencies = [ - "signature", -] - -[[package]] -name = "ed25519-dalek" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" -dependencies = [ - "curve25519-dalek 3.2.0", - "ed25519", - "rand 0.7.3", - "serde", - "sha2 0.9.9", - "zeroize", -] - -[[package]] -name = "either" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" - -[[package]] -name = "elliptic-curve" -version = "0.11.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" -dependencies = [ - "base16ct", - "crypto-bigint", - "der", - "ff", - "generic-array 0.14.6", - "group", - "rand_core 0.6.3", - "sec1", - "subtle", - "zeroize", -] - -[[package]] -name = "enum-as-inner" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "enumflags2" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e75d4cd21b95383444831539909fbb14b9dc3fdceb2a6f5d36577329a1f55ccb" -dependencies = [ - "enumflags2_derive", -] - -[[package]] -name = "enumflags2_derive" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "enumn" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038b1afa59052df211f9efd58f8b1d84c242935ede1c3dbaed26b018a9e06ae2" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "env_logger" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "environmental" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" - -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "ethbloom" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11da94e443c60508eb62cf256243a64da87304c2802ac2528847f79d750007ef" -dependencies = [ - "crunchy", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", - "tiny-keccak", -] - -[[package]] -name = "ethereum" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23750149fe8834c0e24bb9adcbacbe06c45b9861f15df53e09f26cb7c4ab91ef" -dependencies = [ - "bytes", - "ethereum-types", - "hash-db", - "hash256-std-hasher", - "parity-scale-codec 3.1.5", - "rlp", - "rlp-derive", - "scale-info", - "serde", - "sha3 0.10.4", - "triehash", -] - -[[package]] -name = "ethereum-types" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2827b94c556145446fcce834ca86b7abf0c39a805883fe20e72c5bfdb5a0dc6" -dependencies = [ - "ethbloom", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "primitive-types", - "scale-info", - "uint", -] - -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "evm" -version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" -dependencies = [ - "auto_impl", - "environmental", - "ethereum", - "evm-core", - "evm-gasometer", - "evm-runtime", - "log", - "parity-scale-codec 3.1.5", - "primitive-types", - "rlp", - "scale-info", - "serde", - "sha3 0.10.4", -] - -[[package]] -name = "evm-coder" -version = "0.1.3" -dependencies = [ - "ethereum", - "evm-coder-procedural", - "evm-core", - "impl-trait-for-tuples", - "primitive-types", - "sp-std", -] - -[[package]] -name = "evm-coder-procedural" -version = "0.2.0" -dependencies = [ - "Inflector", - "hex", - "proc-macro2", - "quote", - "sha3 0.10.4", - "syn", -] - -[[package]] -name = "evm-core" -version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" -dependencies = [ - "parity-scale-codec 3.1.5", - "primitive-types", - "scale-info", - "serde", -] - -[[package]] -name = "evm-gasometer" -version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" -dependencies = [ - "environmental", - "evm-core", - "evm-runtime", - "primitive-types", -] - -[[package]] -name = "evm-runtime" -version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" -dependencies = [ - "auto_impl", - "environmental", - "evm-core", - "primitive-types", - "sha3 0.10.4", -] - -[[package]] -name = "exit-future" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" -dependencies = [ - "futures", -] - -[[package]] -name = "expander" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a718c0675c555c5f976fff4ea9e2c150fa06cefa201cadef87cfbf9324075881" -dependencies = [ - "blake3", - "fs-err", - "proc-macro2", - "quote", -] - -[[package]] -name = "expander" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3774182a5df13c3d1690311ad32fbe913feef26baba609fa2dd5f72042bd2ab6" -dependencies = [ - "blake2", - "fs-err", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - -[[package]] -name = "fastrand" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] - -[[package]] -name = "fatality" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ad875162843b0d046276327afe0136e9ed3a23d5a754210fb6f1f33610d39ab" -dependencies = [ - "fatality-proc-macro", - "thiserror", -] - -[[package]] -name = "fatality-proc-macro" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5aa1e3ae159e592ad222dc90c5acbad632b527779ba88486abe92782ab268bd" -dependencies = [ - "expander 0.0.4", - "indexmap", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", - "thiserror", -] - -[[package]] -name = "fdlimit" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c4c9e43643f5a3be4ca5b67d26b98031ff9db6806c3440ae32e02e3ceac3f1b" -dependencies = [ - "libc", -] - -[[package]] -name = "ff" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" -dependencies = [ - "rand_core 0.6.3", - "subtle", -] - -[[package]] -name = "file-per-thread-logger" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e16290574b39ee41c71aeb90ae960c504ebaf1e2a1c87bd52aa56ed6e1a02f" -dependencies = [ - "env_logger", - "log", -] - -[[package]] -name = "filetime" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall", - "windows-sys", -] - -[[package]] -name = "finality-grandpa" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22349c6a11563a202d95772a68e0fcf56119e74ea8a2a19cf2301460fcd0df5" -dependencies = [ - "either", - "futures", - "futures-timer", - "log", - "num-traits", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "scale-info", -] - -[[package]] -name = "fixed-hash" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" -dependencies = [ - "byteorder", - "rand 0.8.5", - "rustc-hex", - "static_assertions", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "flate2" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" -dependencies = [ - "crc32fast", - "libz-sys", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "fork-tree" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "parity-scale-codec 3.1.5", -] - -[[package]] -name = "form_urlencoded" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "fp-consensus" -version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" -dependencies = [ - "ethereum", - "parity-scale-codec 3.1.5", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "fp-evm" -version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" -dependencies = [ - "evm", - "frame-support", - "impl-trait-for-tuples", - "parity-scale-codec 3.1.5", - "serde", - "sp-core", - "sp-std", -] - -[[package]] -name = "fp-evm-mapping" -version = "0.1.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" -dependencies = [ - "frame-support", - "sp-core", -] - -[[package]] -name = "fp-rpc" -version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" -dependencies = [ - "ethereum", - "ethereum-types", - "fp-evm", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-api", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "fp-self-contained" -version = "1.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" -dependencies = [ - "ethereum", - "frame-support", - "parity-scale-codec 3.1.5", - "parity-util-mem", - "scale-info", - "serde", - "sp-debug-derive", - "sp-io", - "sp-runtime", -] - -[[package]] -name = "fp-storage" -version = "2.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" -dependencies = [ - "parity-scale-codec 3.1.5", -] - -[[package]] -name = "frame-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "linregress", - "log", - "parity-scale-codec 3.1.5", - "paste", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-io", - "sp-runtime", - "sp-runtime-interface", - "sp-std", - "sp-storage", -] - -[[package]] -name = "frame-benchmarking-cli" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "Inflector", - "chrono", - "clap", - "comfy-table", - "frame-benchmarking", - "frame-support", - "frame-system", - "gethostname", - "handlebars", - "hash-db", - "hex", - "itertools", - "kvdb", - "lazy_static", - "linked-hash-map", - "log", - "memory-db", - "parity-scale-codec 3.1.5", - "rand 0.8.5", - "rand_pcg 0.3.1", - "sc-block-builder", - "sc-cli", - "sc-client-api", - "sc-client-db", - "sc-executor", - "sc-service", - "sc-sysinfo", - "serde", - "serde_json", - "serde_nanos", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-database", - "sp-externalities", - "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "sp-storage", - "sp-trie", - "tempfile", - "thiserror", - "thousands", -] - -[[package]] -name = "frame-election-provider-solution-type" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "frame-election-provider-support" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-election-provider-solution-type", - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-arithmetic", - "sp-npos-elections", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "frame-executive" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "sp-tracing", -] - -[[package]] -name = "frame-metadata" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d" -dependencies = [ - "cfg-if 1.0.0", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", -] - -[[package]] -name = "frame-support" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "bitflags", - "frame-metadata", - "frame-support-procedural", - "impl-trait-for-tuples", - "k256", - "log", - "once_cell", - "parity-scale-codec 3.1.5", - "paste", - "scale-info", - "serde", - "smallvec", - "sp-arithmetic", - "sp-core", - "sp-core-hashing-proc-macro", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-state-machine", - "sp-std", - "sp-tracing", - "tt-call", -] - -[[package]] -name = "frame-support-procedural" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "Inflector", - "frame-support-procedural-tools", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "frame-support-procedural-tools" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support-procedural-tools-derive", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "frame-support-procedural-tools-derive" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "frame-system" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "sp-version", -] - -[[package]] -name = "frame-system-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "frame-system-rpc-runtime-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "parity-scale-codec 3.1.5", - "sp-api", -] - -[[package]] -name = "frame-try-runtime" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "sp-api", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "fs-err" -version = "2.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64db3e262960f0662f43a6366788d5f10f7f244b8f7d7d987f560baf5ded5c50" - -[[package]] -name = "fs-swap" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" -dependencies = [ - "lazy_static", - "libc", - "libloading 0.5.2", - "winapi", -] - -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "fs_extra" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" - -[[package]] -name = "futures-executor" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", - "num_cpus", -] - -[[package]] -name = "futures-io" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" - -[[package]] -name = "futures-lite" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite 0.2.9", - "waker-fn", -] - -[[package]] -name = "futures-macro" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-rustls" -version = "0.22.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" -dependencies = [ - "futures-io", - "rustls", - "webpki", -] - -[[package]] -name = "futures-sink" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" - -[[package]] -name = "futures-task" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" - -[[package]] -name = "futures-timer" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" - -[[package]] -name = "futures-util" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite 0.2.9", - "pin-utils", - "slab", -] - -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - -[[package]] -name = "generic-array" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "gethostname" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", - "wasm-bindgen", -] - -[[package]] -name = "getrandom" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "ghash" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" -dependencies = [ - "opaque-debug 0.3.0", - "polyval", -] - -[[package]] -name = "gimli" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] - -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" - -[[package]] -name = "globset" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" -dependencies = [ - "aho-corasick", - "bstr", - "fnv", - "log", - "regex", -] - -[[package]] -name = "gloo-timers" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "group" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" -dependencies = [ - "ff", - "rand_core 0.6.3", - "subtle", -] - -[[package]] -name = "h2" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "handlebars" -version = "4.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56b224eaa4987c03c30b251de7ef0c15a6a59f34222905850dbc3026dfb24d5f" -dependencies = [ - "log", - "pest", - "pest_derive", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "hash-db" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" - -[[package]] -name = "hash256-std-hasher" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" -dependencies = [ - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash", -] - -[[package]] -name = "heck" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" - -[[package]] -name = "hex_fmt" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" - -[[package]] -name = "hmac" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" -dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", -] - -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac 0.11.1", - "digest 0.9.0", -] - -[[package]] -name = "hmac-drbg" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" -dependencies = [ - "digest 0.9.0", - "generic-array 0.14.6", - "hmac 0.8.1", -] - -[[package]] -name = "hostname" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" -dependencies = [ - "libc", - "match_cfg", - "winapi", -] - -[[package]] -name = "http" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" -dependencies = [ - "bytes", - "fnv", - "itoa 1.0.3", -] - -[[package]] -name = "http-body" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" -dependencies = [ - "bytes", - "http", - "pin-project-lite 0.2.9", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "hyper" -version = "0.14.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa 1.0.3", - "pin-project-lite 0.2.9", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" -dependencies = [ - "http", - "hyper", - "log", - "rustls", - "rustls-native-certs", - "tokio", - "tokio-rustls", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c495f162af0bf17656d0014a0eded5f3cd2f365fdd204548c2869db89359dc7" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "js-sys", - "once_cell", - "wasm-bindgen", - "winapi", -] - -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "idna" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "if-addrs" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "if-watch" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "015a7df1eb6dda30df37f34b63ada9b7b352984b0e84de2a20ed526345000791" -dependencies = [ - "async-io", - "core-foundation", - "fnv", - "futures", - "if-addrs", - "ipnet", - "log", - "rtnetlink", - "system-configuration", - "windows", -] - -[[package]] -name = "impl-codec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" -dependencies = [ - "parity-scale-codec 3.1.5", -] - -[[package]] -name = "impl-rlp" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" -dependencies = [ - "rlp", -] - -[[package]] -name = "impl-serde" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" -dependencies = [ - "serde", -] - -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "indexmap" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "integer-encoding" -version = "3.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" - -[[package]] -name = "integer-sqrt" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" -dependencies = [ - "num-traits", -] - -[[package]] -name = "io-lifetimes" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec58677acfea8a15352d42fc87d11d63596ade9239e0a7c9352914417515dbe6" - -[[package]] -name = "io-lifetimes" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ea37f355c05dde75b84bba2d767906ad522e97cd9e2eef2be7a4ab7fb442c06" - -[[package]] -name = "ip_network" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2f047c0a98b2f299aa5d6d7088443570faae494e9ae1305e48be000c9e0eb1" - -[[package]] -name = "ipconfig" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723519edce41262b05d4143ceb95050e4c614f483e78e9fd9e39a8275a84ad98" -dependencies = [ - "socket2", - "widestring", - "winapi", - "winreg", -] - -[[package]] -name = "ipnet" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" - -[[package]] -name = "itertools" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[package]] -name = "itoa" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" - -[[package]] -name = "jobserver" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.59" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "jsonrpsee" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11e017217fcd18da0a25296d3693153dd19c8a6aadab330b3595285d075385d1" -dependencies = [ - "jsonrpsee-core", - "jsonrpsee-http-server", - "jsonrpsee-proc-macros", - "jsonrpsee-types", - "jsonrpsee-ws-server", - "tracing", -] - -[[package]] -name = "jsonrpsee-core" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16efcd4477de857d4a2195a45769b2fe9ebb54f3ef5a4221d3b014a4fe33ec0b" -dependencies = [ - "anyhow", - "arrayvec 0.7.2", - "async-trait", - "beef", - "futures-channel", - "futures-util", - "globset", - "hyper", - "jsonrpsee-types", - "lazy_static", - "parking_lot 0.12.1", - "rand 0.8.5", - "rustc-hash", - "serde", - "serde_json", - "soketto", - "thiserror", - "tokio", - "tracing", - "unicase", -] - -[[package]] -name = "jsonrpsee-http-server" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdd69efeb3ce2cba767f126872f4eeb4624038a29098e75d77608b2b4345ad03" -dependencies = [ - "futures-channel", - "futures-util", - "hyper", - "jsonrpsee-core", - "jsonrpsee-types", - "serde", - "serde_json", - "tokio", - "tracing", -] - -[[package]] -name = "jsonrpsee-proc-macros" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874cf3f6a027cebf36cae767feca9aa2e8a8f799880e49eb5540819fcbd8eada" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "jsonrpsee-types" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcf76cd316f5d3ad48138085af1f45e2c58c98e02f0779783dbb034d43f7c86" -dependencies = [ - "anyhow", - "beef", - "serde", - "serde_json", - "thiserror", - "tracing", -] - -[[package]] -name = "jsonrpsee-ws-server" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2e4d266774a671f8def3794255b28eddd09b18d76e0b913fa439f34588c0a" -dependencies = [ - "futures-channel", - "futures-util", - "jsonrpsee-core", - "jsonrpsee-types", - "serde_json", - "soketto", - "tokio", - "tokio-stream", - "tokio-util", - "tracing", -] - -[[package]] -name = "k256" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" -dependencies = [ - "cfg-if 1.0.0", - "ecdsa", - "elliptic-curve", - "sec1", -] - -[[package]] -name = "keccak" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" - -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - -[[package]] -name = "kvdb" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a301d8ecb7989d4a6e2c57a49baca77d353bdbf879909debe3f375fe25d61f86" -dependencies = [ - "parity-util-mem", - "smallvec", -] - -[[package]] -name = "kvdb-memorydb" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece7e668abd21387aeb6628130a6f4c802787f014fa46bc83221448322250357" -dependencies = [ - "kvdb", - "parity-util-mem", - "parking_lot 0.12.1", -] - -[[package]] -name = "kvdb-rocksdb" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca7fbdfd71cd663dceb0faf3367a99f8cf724514933e9867cec4995b6027cbc1" -dependencies = [ - "fs-swap", - "kvdb", - "log", - "num_cpus", - "owning_ref", - "parity-util-mem", - "parking_lot 0.12.1", - "regex", - "rocksdb", - "smallvec", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - -[[package]] -name = "libc" -version = "0.2.132" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" - -[[package]] -name = "libloading" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -dependencies = [ - "cc", - "winapi", -] - -[[package]] -name = "libloading" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" -dependencies = [ - "cfg-if 1.0.0", - "winapi", -] - -[[package]] -name = "libm" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565" - -[[package]] -name = "libp2p" -version = "0.46.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81327106887e42d004fbdab1fef93675be2e2e07c1b95fce45e2cc813485611d" -dependencies = [ - "bytes", - "futures", - "futures-timer", - "getrandom 0.2.7", - "instant", - "lazy_static", - "libp2p-autonat", - "libp2p-core", - "libp2p-deflate", - "libp2p-dns", - "libp2p-floodsub", - "libp2p-gossipsub", - "libp2p-identify", - "libp2p-kad", - "libp2p-mdns", - "libp2p-metrics", - "libp2p-mplex", - "libp2p-noise", - "libp2p-ping", - "libp2p-plaintext", - "libp2p-pnet", - "libp2p-relay", - "libp2p-rendezvous", - "libp2p-request-response", - "libp2p-swarm", - "libp2p-swarm-derive", - "libp2p-tcp", - "libp2p-uds", - "libp2p-wasm-ext", - "libp2p-websocket", - "libp2p-yamux", - "multiaddr", - "parking_lot 0.12.1", - "pin-project", - "rand 0.7.3", - "smallvec", -] - -[[package]] -name = "libp2p-autonat" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4decc51f3573653a9f4ecacb31b1b922dd20c25a6322bb15318ec04287ec46f9" -dependencies = [ - "async-trait", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-request-response", - "libp2p-swarm", - "log", - "prost", - "prost-build", - "rand 0.8.5", -] - -[[package]] -name = "libp2p-core" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf9b94cefab7599b2d3dff2f93bee218c6621d68590b23ede4485813cbcece6" -dependencies = [ - "asn1_der", - "bs58", - "ed25519-dalek", - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "lazy_static", - "libsecp256k1", - "log", - "multiaddr", - "multihash", - "multistream-select", - "parking_lot 0.12.1", - "pin-project", - "prost", - "prost-build", - "rand 0.8.5", - "ring", - "rw-stream-sink", - "sha2 0.10.5", - "smallvec", - "thiserror", - "unsigned-varint", - "void", - "zeroize", -] - -[[package]] -name = "libp2p-deflate" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0183dc2a3da1fbbf85e5b6cf51217f55b14f5daea0c455a9536eef646bfec71" -dependencies = [ - "flate2", - "futures", - "libp2p-core", -] - -[[package]] -name = "libp2p-dns" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cbf54723250fa5d521383be789bf60efdabe6bacfb443f87da261019a49b4b5" -dependencies = [ - "async-std-resolver", - "futures", - "libp2p-core", - "log", - "parking_lot 0.12.1", - "smallvec", - "trust-dns-resolver", -] - -[[package]] -name = "libp2p-floodsub" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98a4b6ffd53e355775d24b76f583fdda54b3284806f678499b57913adb94f231" -dependencies = [ - "cuckoofilter", - "fnv", - "futures", - "libp2p-core", - "libp2p-swarm", - "log", - "prost", - "prost-build", - "rand 0.7.3", - "smallvec", -] - -[[package]] -name = "libp2p-gossipsub" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b4b888cfbeb1f5551acd3aa1366e01bf88ede26cc3c4645d0d2d004d5ca7b0" -dependencies = [ - "asynchronous-codec", - "base64", - "byteorder", - "bytes", - "fnv", - "futures", - "hex_fmt", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "prometheus-client", - "prost", - "prost-build", - "rand 0.7.3", - "regex", - "sha2 0.10.5", - "smallvec", - "unsigned-varint", - "wasm-timer", -] - -[[package]] -name = "libp2p-identify" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50b585518f8efd06f93ac2f976bd672e17cdac794644b3117edd078e96bda06" -dependencies = [ - "asynchronous-codec", - "futures", - "futures-timer", - "libp2p-core", - "libp2p-swarm", - "log", - "lru 0.7.8", - "prost", - "prost-build", - "prost-codec", - "smallvec", - "thiserror", - "void", -] - -[[package]] -name = "libp2p-kad" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740862893bb5f06ac24acc9d49bdeadc3a5e52e51818a30a25c1f3519da2c851" -dependencies = [ - "arrayvec 0.7.2", - "asynchronous-codec", - "bytes", - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "prost", - "prost-build", - "rand 0.7.3", - "sha2 0.10.5", - "smallvec", - "thiserror", - "uint", - "unsigned-varint", - "void", -] - -[[package]] -name = "libp2p-mdns" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66e5e5919509603281033fd16306c61df7a4428ce274b67af5e14b07de5cdcb2" -dependencies = [ - "async-io", - "data-encoding", - "dns-parser", - "futures", - "if-watch", - "lazy_static", - "libp2p-core", - "libp2p-swarm", - "log", - "rand 0.8.5", - "smallvec", - "socket2", - "void", -] - -[[package]] -name = "libp2p-metrics" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef8aff4a1abef42328fbb30b17c853fff9be986dc39af17ee39f9c5f755c5e0c" -dependencies = [ - "libp2p-core", - "libp2p-gossipsub", - "libp2p-identify", - "libp2p-kad", - "libp2p-ping", - "libp2p-relay", - "libp2p-swarm", - "prometheus-client", -] - -[[package]] -name = "libp2p-mplex" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61fd1b20638ec209c5075dfb2e8ce6a7ea4ec3cd3ad7b77f7a477c06d53322e2" -dependencies = [ - "asynchronous-codec", - "bytes", - "futures", - "libp2p-core", - "log", - "nohash-hasher", - "parking_lot 0.12.1", - "rand 0.7.3", - "smallvec", - "unsigned-varint", -] - -[[package]] -name = "libp2p-noise" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "762408cb5d84b49a600422d7f9a42c18012d8da6ebcd570f9a4a4290ba41fb6f" -dependencies = [ - "bytes", - "curve25519-dalek 3.2.0", - "futures", - "lazy_static", - "libp2p-core", - "log", - "prost", - "prost-build", - "rand 0.8.5", - "sha2 0.10.5", - "snow", - "static_assertions", - "x25519-dalek", - "zeroize", -] - -[[package]] -name = "libp2p-ping" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "100a6934ae1dbf8a693a4e7dd1d730fd60b774dafc45688ed63b554497c6c925" -dependencies = [ - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "rand 0.7.3", - "void", -] - -[[package]] -name = "libp2p-plaintext" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be27bf0820a6238a4e06365b096d428271cce85a129cf16f2fe9eb1610c4df86" -dependencies = [ - "asynchronous-codec", - "bytes", - "futures", - "libp2p-core", - "log", - "prost", - "prost-build", - "unsigned-varint", - "void", -] - -[[package]] -name = "libp2p-pnet" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1a458bbda880107b5b36fcb9b5a1ef0c329685da0e203ed692a8ebe64cc92c" -dependencies = [ - "futures", - "log", - "pin-project", - "rand 0.7.3", - "salsa20", - "sha3 0.9.1", -] - -[[package]] -name = "libp2p-relay" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4931547ee0cce03971ccc1733ff05bb0c4349fd89120a39e9861e2bbe18843c3" -dependencies = [ - "asynchronous-codec", - "bytes", - "either", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "pin-project", - "prost", - "prost-build", - "prost-codec", - "rand 0.8.5", - "smallvec", - "static_assertions", - "thiserror", - "void", -] - -[[package]] -name = "libp2p-rendezvous" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9511c9672ba33284838e349623319c8cad2d18cfad243ae46c6b7e8a2982ea4e" -dependencies = [ - "asynchronous-codec", - "bimap", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "prost", - "prost-build", - "rand 0.8.5", - "sha2 0.10.5", - "thiserror", - "unsigned-varint", - "void", -] - -[[package]] -name = "libp2p-request-response" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "508a189e2795d892c8f5c1fa1e9e0b1845d32d7b0b249dbf7b05b18811361843" -dependencies = [ - "async-trait", - "bytes", - "futures", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "rand 0.7.3", - "smallvec", - "unsigned-varint", -] - -[[package]] -name = "libp2p-swarm" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ac5be6c2de2d1ff3f7693fda6faf8a827b1f3e808202277783fea9f527d114" -dependencies = [ - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "log", - "pin-project", - "rand 0.7.3", - "smallvec", - "thiserror", - "void", -] - -[[package]] -name = "libp2p-swarm-derive" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f54a64b6957249e0ce782f8abf41d97f69330d02bf229f0672d864f0650cc76" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "libp2p-tcp" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a6771dc19aa3c65d6af9a8c65222bfc8fcd446630ddca487acd161fa6096f3b" -dependencies = [ - "async-io", - "futures", - "futures-timer", - "if-watch", - "ipnet", - "libc", - "libp2p-core", - "log", - "socket2", -] - -[[package]] -name = "libp2p-uds" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d125e3e5f0d58f3c6ac21815b20cf4b6a88b8db9dc26368ea821838f4161fd4d" -dependencies = [ - "async-std", - "futures", - "libp2p-core", - "log", -] - -[[package]] -name = "libp2p-wasm-ext" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec894790eec3c1608f8d1a8a0bdf0dbeb79ed4de2dce964222011c2896dfa05a" -dependencies = [ - "futures", - "js-sys", - "libp2p-core", - "parity-send-wrapper", - "wasm-bindgen", - "wasm-bindgen-futures", -] - -[[package]] -name = "libp2p-websocket" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9808e57e81be76ff841c106b4c5974fb4d41a233a7bdd2afbf1687ac6def3818" -dependencies = [ - "either", - "futures", - "futures-rustls", - "libp2p-core", - "log", - "parking_lot 0.12.1", - "quicksink", - "rw-stream-sink", - "soketto", - "url", - "webpki-roots", -] - -[[package]] -name = "libp2p-yamux" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6dea686217a06072033dc025631932810e2f6ad784e4fafa42e27d311c7a81c" -dependencies = [ - "futures", - "libp2p-core", - "parking_lot 0.12.1", - "thiserror", - "yamux", -] - -[[package]] -name = "librocksdb-sys" -version = "0.6.1+6.28.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc587013734dadb7cf23468e531aa120788b87243648be42e2d3a072186291" -dependencies = [ - "bindgen", - "bzip2-sys", - "cc", - "glob", - "libc", - "libz-sys", - "tikv-jemalloc-sys", -] - -[[package]] -name = "libsecp256k1" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" -dependencies = [ - "arrayref", - "base64", - "digest 0.9.0", - "hmac-drbg", - "libsecp256k1-core", - "libsecp256k1-gen-ecmult", - "libsecp256k1-gen-genmult", - "rand 0.8.5", - "serde", - "sha2 0.9.9", - "typenum", -] - -[[package]] -name = "libsecp256k1-core" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" -dependencies = [ - "crunchy", - "digest 0.9.0", - "subtle", -] - -[[package]] -name = "libsecp256k1-gen-ecmult" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" -dependencies = [ - "libsecp256k1-core", -] - -[[package]] -name = "libsecp256k1-gen-genmult" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" -dependencies = [ - "libsecp256k1-core", -] - -[[package]] -name = "libz-sys" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" -dependencies = [ - "cc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - -[[package]] -name = "linked_hash_set" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "linregress" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c601a85f5ecd1aba625247bca0031585fb1c446461b142878a16f8245ddeb8" -dependencies = [ - "nalgebra", - "statrs", -] - -[[package]] -name = "linux-raw-sys" -version = "0.0.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5284f00d480e1c39af34e72f8ad60b94f47007e3481cd3b731c1d67190ddc7b7" - -[[package]] -name = "linux-raw-sys" -version = "0.0.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" - -[[package]] -name = "lock_api" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if 1.0.0", - "value-bag", -] - -[[package]] -name = "lru" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ea2d928b485416e8908cff2d97d621db22b27f7b3b6729e438bcf42c671ba91" -dependencies = [ - "hashbrown 0.11.2", -] - -[[package]] -name = "lru" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" -dependencies = [ - "hashbrown 0.12.3", -] - -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "lz4" -version = "1.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" -dependencies = [ - "libc", - "lz4-sys", -] - -[[package]] -name = "lz4-sys" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - -[[package]] -name = "match_cfg" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" - -[[package]] -name = "matchers" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" -dependencies = [ - "regex-automata", -] - -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" - -[[package]] -name = "matrixmultiply" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add85d4dd35074e6fedc608f8c8f513a3548619a9024b751949ef0e8e45a4d84" -dependencies = [ - "rawpointer", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memfd" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6627dc657574b49d6ad27105ed671822be56e0d2547d413bfbf3e8d8fa92e7a" -dependencies = [ - "libc", -] - -[[package]] -name = "memmap2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95af15f345b17af2efc8ead6080fb8bc376f8cec1b35277b935637595fe77498" -dependencies = [ - "libc", -] - -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memory-db" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" -dependencies = [ - "hash-db", - "hashbrown 0.12.3", - "parity-util-mem", -] - -[[package]] -name = "memory-lru" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beeb98b3d1ed2c0054bd81b5ba949a0243c3ccad751d45ea898fa8059fa2860a" -dependencies = [ - "lru 0.6.6", -] - -[[package]] -name = "memory_units" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" - -[[package]] -name = "merlin" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" -dependencies = [ - "byteorder", - "keccak", - "rand_core 0.5.1", - "zeroize", -] - -[[package]] -name = "mick-jaeger" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532" -dependencies = [ - "futures", - "rand 0.8.5", - "thrift", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" -dependencies = [ - "libc", - "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", -] - -[[package]] -name = "more-asserts" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" - -[[package]] -name = "multiaddr" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c580bfdd8803cce319b047d239559a22f809094aaea4ac13902a1fdcfcd4261" -dependencies = [ - "arrayref", - "bs58", - "byteorder", - "data-encoding", - "multihash", - "percent-encoding", - "serde", - "static_assertions", - "unsigned-varint", - "url", -] - -[[package]] -name = "multibase" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" -dependencies = [ - "base-x", - "data-encoding", - "data-encoding-macro", -] - -[[package]] -name = "multihash" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c346cf9999c631f002d8f977c4eaeaa0e6386f16007202308d0b3757522c2cc" -dependencies = [ - "blake2b_simd", - "blake2s_simd", - "blake3", - "core2", - "digest 0.10.3", - "multihash-derive", - "sha2 0.10.5", - "sha3 0.10.4", - "unsigned-varint", -] - -[[package]] -name = "multihash-derive" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" -dependencies = [ - "proc-macro-crate", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - -[[package]] -name = "multistream-select" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "363a84be6453a70e63513660f4894ef815daf88e3356bffcda9ca27d810ce83b" -dependencies = [ - "bytes", - "futures", - "log", - "pin-project", - "smallvec", - "unsigned-varint", -] - -[[package]] -name = "nalgebra" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "462fffe4002f4f2e1f6a9dcf12cc1a6fc0e15989014efc02a941d3e0f5dc2120" -dependencies = [ - "approx", - "matrixmultiply", - "nalgebra-macros", - "num-complex", - "num-rational 0.4.1", - "num-traits", - "rand 0.8.5", - "rand_distr", - "simba", - "typenum", -] - -[[package]] -name = "nalgebra-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "names" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d66043b25d4a6cccb23619d10c19c25304b355a7dccd4a8e11423dd2382146" -dependencies = [ - "rand 0.8.5", -] - -[[package]] -name = "nanorand" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" - -[[package]] -name = "netlink-packet-core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" -dependencies = [ - "anyhow", - "byteorder", - "libc", - "netlink-packet-utils", -] - -[[package]] -name = "netlink-packet-route" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" -dependencies = [ - "anyhow", - "bitflags", - "byteorder", - "libc", - "netlink-packet-core", - "netlink-packet-utils", -] - -[[package]] -name = "netlink-packet-utils" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25af9cf0dc55498b7bd94a1508af7a78706aa0ab715a73c5169273e03c84845e" -dependencies = [ - "anyhow", - "byteorder", - "paste", - "thiserror", -] - -[[package]] -name = "netlink-proto" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" -dependencies = [ - "bytes", - "futures", - "log", - "netlink-packet-core", - "netlink-sys", - "thiserror", - "tokio", -] - -[[package]] -name = "netlink-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92b654097027250401127914afb37cb1f311df6610a9891ff07a757e94199027" -dependencies = [ - "async-io", - "bytes", - "futures", - "libc", - "log", -] - -[[package]] -name = "nix" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "libc", -] - -[[package]] -name = "nodrop" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" - -[[package]] -name = "nohash-hasher" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" - -[[package]] -name = "nom" -version = "7.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "num-bigint" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-format" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bafe4179722c2894288ee77a9f044f02811c86af699344c498b0840c698a2465" -dependencies = [ - "arrayvec 0.4.12", - "itoa 0.4.8", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "object" -version = "0.28.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" -dependencies = [ - "crc32fast", - "hashbrown 0.11.2", - "indexmap", - "memchr", -] - -[[package]] -name = "object" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" - -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "orchestra" -version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "async-trait", - "dyn-clonable", - "futures", - "futures-timer", - "orchestra-proc-macro", - "pin-project", - "prioritized-metered-channel", - "thiserror", - "tracing", -] - -[[package]] -name = "orchestra-proc-macro" -version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "expander 0.0.6", - "itertools", - "petgraph", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "ordered-float" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7" -dependencies = [ - "num-traits", -] - -[[package]] -name = "orml-vesting" -version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "os_str_bytes" -version = "6.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" - -[[package]] -name = "owning_ref" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" -dependencies = [ - "stable_deref_trait", -] - -[[package]] -name = "pallet-app-promotion" -version = "0.1.0" -dependencies = [ - "frame-support", - "frame-system", - "pallet-balances", - "pallet-common", - "pallet-evm", - "pallet-evm-contract-helpers", - "pallet-randomness-collective-flip", - "pallet-timestamp", - "pallet-unique", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "up-data-structs", -] - -[[package]] -name = "pallet-aura" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "pallet-timestamp", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-application-crypto", - "sp-consensus-aura", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-authority-discovery" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "pallet-session", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-application-crypto", - "sp-authority-discovery", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-authorship", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-babe" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "pallet-session", - "pallet-timestamp", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-application-crypto", - "sp-consensus-babe", - "sp-consensus-vrf", - "sp-io", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", -] - -[[package]] -name = "pallet-bags-list" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-election-provider-support", - "frame-support", - "frame-system", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-balances" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-base-fee" -version = "1.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" -dependencies = [ - "fp-evm", - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-runtime", -] - -[[package]] -name = "pallet-beefy" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "beefy-primitives", - "frame-support", - "frame-system", - "pallet-session", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-beefy-mmr" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "beefy-merkle-tree", - "beefy-primitives", - "frame-support", - "frame-system", - "hex", - "log", - "pallet-beefy", - "pallet-mmr", - "pallet-session", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-bounties" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "log", - "pallet-treasury", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-child-bounties" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "log", - "pallet-bounties", - "pallet-treasury", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-collective" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-common" -version = "0.1.8" -dependencies = [ - "ethereum", - "evm-coder", - "fp-evm-mapping", - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-evm", - "pallet-evm-coder-substrate", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-runtime", - "sp-std", - "up-data-structs", -] - -[[package]] -name = "pallet-configuration" -version = "0.1.1" -dependencies = [ - "fp-evm", - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "smallvec", - "sp-arithmetic", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-democracy" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-election-provider-multi-phase" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-benchmarking", - "frame-election-provider-support", - "frame-support", - "frame-system", - "log", - "parity-scale-codec 3.1.5", - "rand 0.7.3", - "scale-info", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-npos-elections", - "sp-runtime", - "sp-std", - "static_assertions", - "strum", -] - -[[package]] -name = "pallet-elections-phragmen" -version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-io", - "sp-npos-elections", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-ethereum" -version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" -dependencies = [ - "ethereum", - "ethereum-types", - "evm", - "fp-consensus", - "fp-evm", - "fp-evm-mapping", - "fp-rpc", - "fp-self-contained", - "fp-storage", - "frame-support", - "frame-system", - "log", - "pallet-evm", - "pallet-timestamp", - "parity-scale-codec 3.1.5", - "rlp", - "scale-info", - "serde", - "sha3 0.10.4", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-evm" -version = "6.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" -dependencies = [ - "evm", - "fp-evm", - "fp-evm-mapping", - "frame-benchmarking", - "frame-support", - "frame-system", - "hex", - "impl-trait-for-tuples", - "log", - "pallet-timestamp", - "parity-scale-codec 3.1.5", - "primitive-types", - "rlp", - "scale-info", - "serde", - "sha3 0.10.4", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-evm-coder-substrate" -version = "0.1.3" -dependencies = [ - "ethereum", - "evm-coder", - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-ethereum", - "pallet-evm", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-std", - "up-data-structs", -] - -[[package]] -name = "pallet-evm-contract-helpers" -version = "0.3.0" -dependencies = [ - "ethereum", - "evm-coder", - "fp-evm-mapping", - "frame-support", - "frame-system", - "log", - "pallet-common", - "pallet-evm", - "pallet-evm-coder-substrate", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std", - "up-data-structs", - "up-sponsorship", -] - -[[package]] -name = "pallet-evm-migration" -version = "0.1.1" -dependencies = [ - "fp-evm", - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-evm", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-evm-transaction-payment" -version = "0.1.1" -dependencies = [ - "fp-evm", - "fp-evm-mapping", - "frame-support", - "frame-system", - "pallet-ethereum", - "pallet-evm", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "up-sponsorship", -] - -[[package]] -name = "pallet-fungible" -version = "0.1.5" -dependencies = [ - "ethereum", - "evm-coder", - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-common", - "pallet-evm", - "pallet-evm-coder-substrate", - "pallet-structure", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std", - "up-data-structs", -] - -[[package]] -name = "pallet-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "pallet-session", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-application-crypto", - "sp-core", - "sp-finality-grandpa", - "sp-io", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", -] - -[[package]] -name = "pallet-identity" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "enumflags2", - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-im-online" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-std", -] - -[[package]] -name = "pallet-indices" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-io", - "sp-keyring", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-inflation" -version = "0.1.1" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-balances", - "pallet-randomness-collective-flip", - "pallet-timestamp", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-membership" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-mmr" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "ckb-merkle-mountain-range", - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-io", - "sp-mmr-primitives", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-mmr-rpc" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "jsonrpsee", - "parity-scale-codec 3.1.5", - "serde", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-mmr-primitives", - "sp-runtime", -] - -[[package]] -name = "pallet-multisig" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-nonfungible" -version = "0.1.5" -dependencies = [ - "ethereum", - "evm-coder", - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-common", - "pallet-evm", - "pallet-evm-coder-substrate", - "pallet-structure", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std", - "struct-versioning", - "up-data-structs", -] - -[[package]] -name = "pallet-offences" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "log", - "pallet-balances", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-runtime", - "sp-staking", - "sp-std", -] - -[[package]] -name = "pallet-preimage" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-proxy" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-randomness-collective-flip" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "safe-mix", - "scale-info", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-refungible" -version = "0.2.4" -dependencies = [ - "derivative", - "ethereum", - "evm-coder", - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-common", - "pallet-evm", - "pallet-evm-coder-substrate", - "pallet-structure", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std", - "struct-versioning", - "up-data-structs", -] - -[[package]] -name = "pallet-rmrk-core" -version = "0.1.2" -dependencies = [ - "derivative", - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-common", - "pallet-evm", - "pallet-nonfungible", - "pallet-structure", - "parity-scale-codec 3.1.5", - "rmrk-traits", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std", - "up-data-structs", -] - -[[package]] -name = "pallet-rmrk-equip" -version = "0.1.2" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-common", - "pallet-evm", - "pallet-nonfungible", - "pallet-rmrk-core", - "parity-scale-codec 3.1.5", - "rmrk-traits", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std", - "up-data-structs", -] - -[[package]] -name = "pallet-scheduler" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-session" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "pallet-timestamp", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "sp-trie", -] - -[[package]] -name = "pallet-staking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-election-provider-support", - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "pallet-session", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-application-crypto", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-std", -] - -[[package]] -name = "pallet-staking-reward-curve" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pallet-structure" -version = "0.1.2" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-common", - "pallet-evm", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-std", - "up-data-structs", -] - -[[package]] -name = "pallet-sudo" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-template-transaction-payment" -version = "3.0.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-balances", - "pallet-transaction-payment", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "up-sponsorship", -] - -[[package]] -name = "pallet-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-std", - "sp-timestamp", -] - -[[package]] -name = "pallet-tips" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "log", - "pallet-treasury", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-transaction-payment" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-transaction-payment-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "jsonrpsee", - "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec 3.1.5", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-rpc", - "sp-runtime", -] - -[[package]] -name = "pallet-transaction-payment-rpc-runtime-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "pallet-transaction-payment", - "parity-scale-codec 3.1.5", - "sp-api", - "sp-runtime", -] - -[[package]] -name = "pallet-treasury" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "pallet-balances", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-unique" -version = "0.1.4" -dependencies = [ - "ethereum", - "evm-coder", - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-common", - "pallet-evm", - "pallet-evm-coder-substrate", - "pallet-nonfungible", - "pallet-refungible", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "up-data-structs", -] - -[[package]] -name = "pallet-unique-scheduler" -version = "0.1.1" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "up-sponsorship", -] - -[[package]] -name = "pallet-utility" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-vesting" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-support", - "frame-system", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-xcm" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "frame-support", - "frame-system", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-runtime", - "sp-std", - "xcm", - "xcm-executor", -] - -[[package]] -name = "parachain-info" -version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" -dependencies = [ - "cumulus-primitives-core", - "frame-support", - "frame-system", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", -] - -[[package]] -name = "parity-db" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8fdb726a43661fa54b43e7114e6b88b2289cae388eb3ad766d9d1754d83fce" -dependencies = [ - "blake2-rfc", - "crc32fast", - "fs2", - "hex", - "libc", - "log", - "lz4", - "memmap2", - "parking_lot 0.12.1", - "rand 0.8.5", - "snap", -] - -[[package]] -name = "parity-scale-codec" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" -dependencies = [ - "arrayvec 0.7.2", - "byte-slice-cast", - "impl-trait-for-tuples", - "parity-scale-codec-derive 2.3.1", -] - -[[package]] -name = "parity-scale-codec" -version = "3.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9182e4a71cae089267ab03e67c99368db7cd877baf50f931e5d6d4b71e195ac0" -dependencies = [ - "arrayvec 0.7.2", - "bitvec", - "byte-slice-cast", - "impl-trait-for-tuples", - "parity-scale-codec-derive 3.1.3", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "3.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "parity-send-wrapper" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" - -[[package]] -name = "parity-util-mem" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" -dependencies = [ - "cfg-if 1.0.0", - "ethereum-types", - "hashbrown 0.12.3", - "impl-trait-for-tuples", - "lru 0.7.8", - "parity-util-mem-derive", - "parking_lot 0.12.1", - "primitive-types", - "smallvec", - "winapi", -] - -[[package]] -name = "parity-util-mem-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" -dependencies = [ - "proc-macro2", - "syn", - "synstructure", -] - -[[package]] -name = "parity-wasm" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ad52817c4d343339b3bc2e26861bd21478eda0b7509acf83505727000512ac" -dependencies = [ - "byteorder", -] - -[[package]] -name = "parity-wasm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" - -[[package]] -name = "parking" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" - -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.5", -] - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core 0.9.3", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" -dependencies = [ - "cfg-if 1.0.0", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall", - "smallvec", - "windows-sys", -] - -[[package]] -name = "paste" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" - -[[package]] -name = "pbkdf2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" -dependencies = [ - "crypto-mac 0.8.0", -] - -[[package]] -name = "pbkdf2" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" -dependencies = [ - "crypto-mac 0.11.1", -] - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - -[[package]] -name = "percent-encoding" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" - -[[package]] -name = "pest" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb779fcf4bb850fbbb0edc96ff6cf34fd90c4b1a112ce042653280d9a7364048" -dependencies = [ - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "502b62a6d0245378b04ffe0a7fb4f4419a4815fce813bd8a0ec89a56e07d67b1" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451e629bf49b750254da26132f1a5a9d11fd8a95a3df51d15c4abd1ba154cb6c" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pest_meta" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcec162c71c45e269dfc3fc2916eaeb97feab22993a21bcce4721d08cd7801a6" -dependencies = [ - "once_cell", - "pest", - "sha1", -] - -[[package]] -name = "petgraph" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[package]] -name = "pin-project" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pin-project-lite" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" - -[[package]] -name = "polkadot-approval-distribution" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "futures", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "rand 0.8.5", - "tracing-gum", -] - -[[package]] -name = "polkadot-availability-bitfield-distribution" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "futures", - "polkadot-node-network-protocol", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "rand 0.8.5", - "tracing-gum", -] - -[[package]] -name = "polkadot-availability-distribution" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "derive_more", - "fatality", - "futures", - "lru 0.7.8", - "parity-scale-codec 3.1.5", - "polkadot-erasure-coding", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "rand 0.8.5", - "sp-core", - "sp-keystore", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-availability-recovery" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "fatality", - "futures", - "lru 0.7.8", - "parity-scale-codec 3.1.5", - "polkadot-erasure-coding", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "rand 0.8.5", - "sc-network", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-client" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "beefy-primitives", - "frame-benchmarking", - "frame-benchmarking-cli", - "frame-system", - "frame-system-rpc-runtime-api", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "polkadot-core-primitives", - "polkadot-node-core-parachains-inherent", - "polkadot-primitives", - "polkadot-runtime", - "polkadot-runtime-common", - "sc-client-api", - "sc-consensus", - "sc-executor", - "sc-service", - "sp-api", - "sp-authority-discovery", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-core", - "sp-finality-grandpa", - "sp-inherents", - "sp-keyring", - "sp-mmr-primitives", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-storage", - "sp-timestamp", - "sp-transaction-pool", -] - -[[package]] -name = "polkadot-collator-protocol" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "always-assert", - "fatality", - "futures", - "futures-timer", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-core", - "sp-keystore", - "sp-runtime", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-core-primitives" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "parity-scale-codec 3.1.5", - "parity-util-mem", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "polkadot-dispute-distribution" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "derive_more", - "fatality", - "futures", - "lru 0.7.8", - "parity-scale-codec 3.1.5", - "polkadot-erasure-coding", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sc-network", - "sp-application-crypto", - "sp-keystore", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-erasure-coding" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "parity-scale-codec 3.1.5", - "polkadot-node-primitives", - "polkadot-primitives", - "reed-solomon-novelpoly", - "sp-core", - "sp-trie", - "thiserror", -] - -[[package]] -name = "polkadot-gossip-support" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "futures", - "futures-timer", - "polkadot-node-network-protocol", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "rand 0.8.5", - "rand_chacha 0.3.1", - "sc-network", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "tracing-gum", -] - -[[package]] -name = "polkadot-network-bridge" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "always-assert", - "async-trait", - "bytes", - "fatality", - "futures", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "polkadot-node-network-protocol", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-overseer", - "polkadot-primitives", - "sc-network", - "sp-consensus", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-collation-generation" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "futures", - "parity-scale-codec 3.1.5", - "polkadot-erasure-coding", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-core", - "sp-maybe-compressed-blob", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-core-approval-voting" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "bitvec", - "derive_more", - "futures", - "futures-timer", - "kvdb", - "lru 0.7.8", - "merlin", - "parity-scale-codec 3.1.5", - "polkadot-node-jaeger", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-overseer", - "polkadot-primitives", - "sc-keystore", - "schnorrkel", - "sp-application-crypto", - "sp-consensus", - "sp-consensus-slots", - "sp-runtime", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-core-av-store" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "bitvec", - "futures", - "futures-timer", - "kvdb", - "parity-scale-codec 3.1.5", - "polkadot-erasure-coding", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-overseer", - "polkadot-primitives", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-core-backing" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "bitvec", - "fatality", - "futures", - "polkadot-erasure-coding", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "polkadot-statement-table", - "sp-keystore", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-core-bitfield-signing" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "futures", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-keystore", - "thiserror", - "tracing-gum", - "wasm-timer", -] - -[[package]] -name = "polkadot-node-core-candidate-validation" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "async-trait", - "futures", - "parity-scale-codec 3.1.5", - "polkadot-node-core-pvf", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-parachain", - "polkadot-primitives", - "sp-maybe-compressed-blob", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-core-chain-api" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "futures", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sc-client-api", - "sc-consensus-babe", - "sp-blockchain", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-core-chain-selection" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "futures", - "futures-timer", - "kvdb", - "parity-scale-codec 3.1.5", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-core-dispute-coordinator" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "fatality", - "futures", - "kvdb", - "lru 0.7.8", - "parity-scale-codec 3.1.5", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sc-keystore", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-core-parachains-inherent" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "async-trait", - "futures", - "futures-timer", - "polkadot-node-subsystem", - "polkadot-primitives", - "sp-blockchain", - "sp-inherents", - "sp-runtime", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-core-provisioner" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "bitvec", - "fatality", - "futures", - "futures-timer", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "rand 0.8.5", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-core-pvf" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "always-assert", - "assert_matches", - "async-process", - "async-std", - "futures", - "futures-timer", - "parity-scale-codec 3.1.5", - "pin-project", - "polkadot-core-primitives", - "polkadot-node-subsystem-util", - "polkadot-parachain", - "rand 0.8.5", - "rayon", - "sc-executor", - "sc-executor-common", - "sc-executor-wasmtime", - "slotmap", - "sp-core", - "sp-externalities", - "sp-io", - "sp-maybe-compressed-blob", - "sp-tracing", - "sp-wasm-interface", - "tempfile", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-core-pvf-checker" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "futures", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-overseer", - "polkadot-primitives", - "sp-keystore", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-core-runtime-api" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "futures", - "memory-lru", - "parity-util-mem", - "polkadot-node-subsystem", - "polkadot-node-subsystem-types", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-consensus-babe", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-jaeger" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "async-std", - "lazy_static", - "log", - "mick-jaeger", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "polkadot-node-primitives", - "polkadot-primitives", - "sc-network", - "sp-core", - "thiserror", -] - -[[package]] -name = "polkadot-node-metrics" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "bs58", - "futures", - "futures-timer", - "log", - "parity-scale-codec 3.1.5", - "polkadot-primitives", - "prioritized-metered-channel", - "sc-cli", - "sc-service", - "sc-tracing", - "substrate-prometheus-endpoint", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-network-protocol" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "async-trait", - "derive_more", - "fatality", - "futures", - "parity-scale-codec 3.1.5", - "polkadot-node-jaeger", - "polkadot-node-primitives", - "polkadot-primitives", - "rand 0.8.5", - "sc-authority-discovery", - "sc-network", - "strum", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-node-primitives" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "bounded-vec", - "futures", - "parity-scale-codec 3.1.5", - "polkadot-parachain", - "polkadot-primitives", - "schnorrkel", - "serde", - "sp-application-crypto", - "sp-consensus-babe", - "sp-consensus-vrf", - "sp-core", - "sp-keystore", - "sp-maybe-compressed-blob", - "thiserror", - "zstd", -] - -[[package]] -name = "polkadot-node-subsystem" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "polkadot-node-jaeger", - "polkadot-node-subsystem-types", - "polkadot-overseer", -] - -[[package]] -name = "polkadot-node-subsystem-types" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "async-trait", - "derive_more", - "futures", - "orchestra", - "polkadot-node-jaeger", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-primitives", - "polkadot-statement-table", - "sc-network", - "smallvec", - "sp-api", - "sp-authority-discovery", - "sp-consensus-babe", - "substrate-prometheus-endpoint", - "thiserror", -] - -[[package]] -name = "polkadot-node-subsystem-util" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "async-trait", - "derive_more", - "fatality", - "futures", - "itertools", - "kvdb", - "lru 0.7.8", - "parity-db", - "parity-scale-codec 3.1.5", - "parity-util-mem", - "parking_lot 0.11.2", - "pin-project", - "polkadot-node-jaeger", - "polkadot-node-metrics", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-overseer", - "polkadot-primitives", - "prioritized-metered-channel", - "rand 0.8.5", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-overseer" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "async-trait", - "futures", - "futures-timer", - "lru 0.7.8", - "orchestra", - "parity-util-mem", - "parking_lot 0.12.1", - "polkadot-node-metrics", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem-types", - "polkadot-primitives", - "sc-client-api", - "sp-api", - "sp-core", - "tracing-gum", -] - -[[package]] -name = "polkadot-parachain" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "derive_more", - "frame-support", - "parity-scale-codec 3.1.5", - "parity-util-mem", - "polkadot-core-primitives", - "scale-info", - "serde", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "polkadot-primitives" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "bitvec", - "frame-system", - "hex-literal", - "parity-scale-codec 3.1.5", - "parity-util-mem", - "polkadot-core-primitives", - "polkadot-parachain", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-authority-discovery", - "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-staking", - "sp-std", - "sp-trie", - "sp-version", -] - -[[package]] -name = "polkadot-rpc" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "beefy-gadget", - "beefy-gadget-rpc", - "jsonrpsee", - "pallet-mmr-rpc", - "pallet-transaction-payment-rpc", - "polkadot-primitives", - "sc-chain-spec", - "sc-client-api", - "sc-consensus-babe", - "sc-consensus-babe-rpc", - "sc-consensus-epochs", - "sc-finality-grandpa", - "sc-finality-grandpa-rpc", - "sc-rpc", - "sc-sync-state-rpc", - "sc-transaction-pool-api", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-keystore", - "sp-runtime", - "substrate-frame-rpc-system", - "substrate-state-trie-migration-rpc", -] - -[[package]] -name = "polkadot-runtime" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "beefy-primitives", - "bitvec", - "frame-election-provider-support", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "log", - "pallet-authority-discovery", - "pallet-authorship", - "pallet-babe", - "pallet-bags-list", - "pallet-balances", - "pallet-bounties", - "pallet-child-bounties", - "pallet-collective", - "pallet-democracy", - "pallet-election-provider-multi-phase", - "pallet-elections-phragmen", - "pallet-grandpa", - "pallet-identity", - "pallet-im-online", - "pallet-indices", - "pallet-membership", - "pallet-multisig", - "pallet-offences", - "pallet-preimage", - "pallet-proxy", - "pallet-scheduler", - "pallet-session", - "pallet-staking", - "pallet-staking-reward-curve", - "pallet-timestamp", - "pallet-tips", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-treasury", - "pallet-utility", - "pallet-vesting", - "pallet-xcm", - "parity-scale-codec 3.1.5", - "polkadot-primitives", - "polkadot-runtime-common", - "polkadot-runtime-constants", - "polkadot-runtime-parachains", - "rustc-hex", - "scale-info", - "serde", - "serde_derive", - "smallvec", - "sp-api", - "sp-authority-discovery", - "sp-block-builder", - "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-io", - "sp-mmr-primitives", - "sp-npos-elections", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "sp-transaction-pool", - "sp-version", - "static_assertions", - "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", -] - -[[package]] -name = "polkadot-runtime-common" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "beefy-primitives", - "bitvec", - "frame-election-provider-support", - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "libsecp256k1", - "log", - "pallet-authorship", - "pallet-bags-list", - "pallet-balances", - "pallet-beefy-mmr", - "pallet-election-provider-multi-phase", - "pallet-session", - "pallet-staking", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-treasury", - "pallet-vesting", - "parity-scale-codec 3.1.5", - "polkadot-primitives", - "polkadot-runtime-parachains", - "rustc-hex", - "scale-info", - "serde", - "serde_derive", - "slot-range-helper", - "sp-api", - "sp-core", - "sp-inherents", - "sp-io", - "sp-npos-elections", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "static_assertions", - "xcm", -] - -[[package]] -name = "polkadot-runtime-constants" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "frame-support", - "polkadot-primitives", - "polkadot-runtime-common", - "smallvec", - "sp-runtime", -] - -[[package]] -name = "polkadot-runtime-metrics" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "bs58", - "parity-scale-codec 3.1.5", - "polkadot-primitives", - "sp-std", - "sp-tracing", -] - -[[package]] -name = "polkadot-runtime-parachains" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "bitflags", - "bitvec", - "derive_more", - "frame-support", - "frame-system", - "log", - "pallet-authority-discovery", - "pallet-authorship", - "pallet-babe", - "pallet-balances", - "pallet-session", - "pallet-staking", - "pallet-timestamp", - "pallet-vesting", - "parity-scale-codec 3.1.5", - "polkadot-primitives", - "polkadot-runtime-metrics", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rustc-hex", - "scale-info", - "serde", - "sp-api", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "xcm", - "xcm-executor", -] - -[[package]] -name = "polkadot-service" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "async-trait", - "beefy-gadget", - "beefy-primitives", - "frame-system-rpc-runtime-api", - "futures", - "hex-literal", - "kvdb", - "kvdb-rocksdb", - "lru 0.7.8", - "pallet-babe", - "pallet-im-online", - "pallet-staking", - "pallet-transaction-payment-rpc-runtime-api", - "parity-db", - "polkadot-approval-distribution", - "polkadot-availability-bitfield-distribution", - "polkadot-availability-distribution", - "polkadot-availability-recovery", - "polkadot-client", - "polkadot-collator-protocol", - "polkadot-dispute-distribution", - "polkadot-gossip-support", - "polkadot-network-bridge", - "polkadot-node-collation-generation", - "polkadot-node-core-approval-voting", - "polkadot-node-core-av-store", - "polkadot-node-core-backing", - "polkadot-node-core-bitfield-signing", - "polkadot-node-core-candidate-validation", - "polkadot-node-core-chain-api", - "polkadot-node-core-chain-selection", - "polkadot-node-core-dispute-coordinator", - "polkadot-node-core-parachains-inherent", - "polkadot-node-core-provisioner", - "polkadot-node-core-pvf-checker", - "polkadot-node-core-runtime-api", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-types", - "polkadot-node-subsystem-util", - "polkadot-overseer", - "polkadot-parachain", - "polkadot-primitives", - "polkadot-rpc", - "polkadot-runtime", - "polkadot-runtime-constants", - "polkadot-runtime-parachains", - "polkadot-statement-distribution", - "sc-authority-discovery", - "sc-basic-authorship", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-client-db", - "sc-consensus", - "sc-consensus-babe", - "sc-consensus-slots", - "sc-consensus-uncles", - "sc-executor", - "sc-finality-grandpa", - "sc-keystore", - "sc-network", - "sc-offchain", - "sc-service", - "sc-sync-state-rpc", - "sc-sysinfo", - "sc-telemetry", - "sc-transaction-pool", - "serde", - "serde_json", - "sp-api", - "sp-authority-discovery", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-core", - "sp-finality-grandpa", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-state-machine", - "sp-storage", - "sp-timestamp", - "sp-transaction-pool", - "sp-trie", - "substrate-prometheus-endpoint", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-statement-distribution" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "arrayvec 0.5.2", - "fatality", - "futures", - "indexmap", - "parity-scale-codec 3.1.5", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-keystore", - "sp-staking", - "thiserror", - "tracing-gum", -] - -[[package]] -name = "polkadot-statement-table" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "parity-scale-codec 3.1.5", - "polkadot-primitives", - "sp-core", -] - -[[package]] -name = "polling" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899b00b9c8ab553c743b3e11e87c5c7d423b2a2de229ba95b24a756344748011" -dependencies = [ - "autocfg", - "cfg-if 1.0.0", - "libc", - "log", - "wepoll-ffi", - "winapi", -] - -[[package]] -name = "poly1305" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" -dependencies = [ - "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash", -] - -[[package]] -name = "polyval" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" - -[[package]] -name = "primitive-types" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" -dependencies = [ - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", - "uint", -] - -[[package]] -name = "prioritized-metered-channel" -version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "coarsetime", - "crossbeam-queue", - "derive_more", - "futures", - "futures-timer", - "nanorand", - "thiserror", - "tracing", -] - -[[package]] -name = "proc-macro-crate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" -dependencies = [ - "once_cell", - "thiserror", - "toml", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prometheus" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c8babc29389186697fe5a2a4859d697825496b83db5d0b65271cdc0488e88c" -dependencies = [ - "cfg-if 1.0.0", - "fnv", - "lazy_static", - "memchr", - "parking_lot 0.12.1", - "thiserror", -] - -[[package]] -name = "prometheus-client" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1abe0255c04d15f571427a2d1e00099016506cf3297b53853acd2b7eb87825" -dependencies = [ - "dtoa", - "itoa 1.0.3", - "owning_ref", - "prometheus-client-derive-text-encode", -] - -[[package]] -name = "prometheus-client-derive-text-encode" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8e12d01b9d66ad9eb4529c57666b6263fc1993cb30261d83ead658fdd932652" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "prost" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab" -dependencies = [ - "bytes", - "cfg-if 1.0.0", - "cmake", - "heck", - "itertools", - "lazy_static", - "log", - "multimap", - "petgraph", - "prost", - "prost-types", - "regex", - "tempfile", - "which", -] - -[[package]] -name = "prost-codec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00af1e92c33b4813cc79fda3f2dbf56af5169709be0202df730e9ebc3e4cd007" -dependencies = [ - "asynchronous-codec", - "bytes", - "prost", - "thiserror", - "unsigned-varint", -] - -[[package]] -name = "prost-derive" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "prost-types" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" -dependencies = [ - "bytes", - "prost", -] - -[[package]] -name = "psm" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f446d0a6efba22928558c4fb4ce0b3fd6c89b0061343e390bf01a703742b8125" -dependencies = [ - "cc", -] - -[[package]] -name = "quartz-runtime" -version = "0.9.27" -dependencies = [ - "app-promotion-rpc", - "cumulus-pallet-aura-ext", - "cumulus-pallet-dmp-queue", - "cumulus-pallet-parachain-system", - "cumulus-pallet-xcm", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core", - "cumulus-primitives-timestamp", - "cumulus-primitives-utility", - "derivative", - "evm-coder", - "fp-evm-mapping", - "fp-rpc", - "fp-self-contained", - "frame-benchmarking", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "hex-literal", - "log", - "orml-vesting", - "pallet-app-promotion", - "pallet-aura", - "pallet-balances", - "pallet-base-fee", - "pallet-common", - "pallet-configuration", - "pallet-ethereum", - "pallet-evm", - "pallet-evm-coder-substrate", - "pallet-evm-contract-helpers", - "pallet-evm-migration", - "pallet-evm-transaction-payment", - "pallet-fungible", - "pallet-inflation", - "pallet-nonfungible", - "pallet-randomness-collective-flip", - "pallet-refungible", - "pallet-rmrk-core", - "pallet-rmrk-equip", - "pallet-structure", - "pallet-sudo", - "pallet-template-transaction-payment", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-treasury", - "pallet-unique", - "pallet-unique-scheduler", - "pallet-xcm", - "parachain-info", - "parity-scale-codec 3.1.5", - "polkadot-parachain", - "rmrk-rpc", - "scale-info", - "serde", - "smallvec", - "sp-api", - "sp-arithmetic", - "sp-block-builder", - "sp-consensus-aura", - "sp-core", - "sp-inherents", - "sp-io", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-std", - "sp-transaction-pool", - "sp-version", - "substrate-wasm-builder", - "up-common", - "up-data-structs", - "up-rpc", - "up-sponsorship", - "xcm", - "xcm-builder", - "xcm-executor", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quicksink" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858" -dependencies = [ - "futures-core", - "futures-sink", - "pin-project-lite 0.1.12", -] - -[[package]] -name = "quote" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", - "rand_pcg 0.2.1", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.3", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.3", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_core" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -dependencies = [ - "getrandom 0.2.7", -] - -[[package]] -name = "rand_distr" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_pcg" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_pcg" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" -dependencies = [ - "rand_core 0.6.3", -] - -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - -[[package]] -name = "rayon" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" -dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "num_cpus", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_users" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" -dependencies = [ - "getrandom 0.2.7", - "redox_syscall", - "thiserror", -] - -[[package]] -name = "reed-solomon-novelpoly" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd8f48b2066e9f69ab192797d66da804d1935bf22763204ed3675740cb0f221" -dependencies = [ - "derive_more", - "fs-err", - "itertools", - "static_init", - "thiserror", -] - -[[package]] -name = "ref-cast" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed13bcd201494ab44900a96490291651d200730904221832b9547d24a87d332b" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5234cd6063258a5e32903b53b1b6ac043a0541c8adc1f610f67b0326c7a578fa" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "regalloc2" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a8d23b35d7177df3b9d31ed8a9ab4bf625c668be77a319d4f5efd4a5257701c" -dependencies = [ - "fxhash", - "log", - "slice-group-by", - "smallvec", -] - -[[package]] -name = "regex" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" - -[[package]] -name = "region" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0" -dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", -] - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - -[[package]] -name = "resolv-conf" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" -dependencies = [ - "hostname", - "quick-error", -] - -[[package]] -name = "retain_mut" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" - -[[package]] -name = "rfc6979" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" -dependencies = [ - "crypto-bigint", - "hmac 0.11.0", - "zeroize", -] - -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin", - "untrusted", - "web-sys", - "winapi", -] - -[[package]] -name = "rlp" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "999508abb0ae792aabed2460c45b89106d97fe4adac593bdaef433c2605847b5" -dependencies = [ - "bytes", - "rustc-hex", -] - -[[package]] -name = "rlp-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "rmrk-rpc" -version = "0.0.2" -dependencies = [ - "parity-scale-codec 2.3.1", - "rmrk-traits", - "serde", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "rmrk-traits" -version = "0.1.0" -dependencies = [ - "parity-scale-codec 3.1.5", - "scale-info", - "serde", -] - -[[package]] -name = "rocksdb" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620f4129485ff1a7128d184bc687470c21c7951b64779ebc9cfdad3dcd920290" -dependencies = [ - "libc", - "librocksdb-sys", -] - -[[package]] -name = "rpassword" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "rtnetlink" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" -dependencies = [ - "async-global-executor", - "futures", - "log", - "netlink-packet-route", - "netlink-proto", - "nix", - "thiserror", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver 1.0.13", -] - -[[package]] -name = "rustix" -version = "0.33.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938a344304321a9da4973b9ff4f9f8db9caf4597dfd9dda6a60b523340a0fff0" -dependencies = [ - "bitflags", - "errno", - "io-lifetimes 0.5.3", - "libc", - "linux-raw-sys 0.0.42", - "winapi", -] - -[[package]] -name = "rustix" -version = "0.35.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c825b8aa8010eb9ee99b75f05e10180b9278d161583034d7574c9d617aeada" -dependencies = [ - "bitflags", - "errno", - "io-lifetimes 0.7.3", - "libc", - "linux-raw-sys 0.0.46", - "windows-sys", -] - -[[package]] -name = "rustls" -version = "0.20.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" -dependencies = [ - "log", - "ring", - "sct", - "webpki", -] - -[[package]] -name = "rustls-native-certs" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" -dependencies = [ - "openssl-probe", - "rustls-pemfile", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" -dependencies = [ - "base64", -] - -[[package]] -name = "rustversion" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" - -[[package]] -name = "rw-stream-sink" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" -dependencies = [ - "futures", - "pin-project", - "static_assertions", -] - -[[package]] -name = "ryu" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" - -[[package]] -name = "safe-mix" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3d055a2582e6b00ed7a31c1524040aa391092bf636328350813f3a0605215c" -dependencies = [ - "rustc_version 0.2.3", -] - -[[package]] -name = "salsa20" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0fbb5f676da676c260ba276a8f43a8dc67cf02d1438423aeb1c677a7212686" -dependencies = [ - "cipher", -] - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "sc-allocator" -version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "log", - "sp-core", - "sp-wasm-interface", - "thiserror", -] - -[[package]] -name = "sc-authority-discovery" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "async-trait", - "futures", - "futures-timer", - "ip_network", - "libp2p", - "log", - "parity-scale-codec 3.1.5", - "prost", - "prost-build", - "rand 0.7.3", - "sc-client-api", - "sc-network", - "sp-api", - "sp-authority-discovery", - "sp-blockchain", - "sp-core", - "sp-keystore", - "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", -] - -[[package]] -name = "sc-basic-authorship" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "futures", - "futures-timer", - "log", - "parity-scale-codec 3.1.5", - "sc-block-builder", - "sc-client-api", - "sc-proposer-metrics", - "sc-telemetry", - "sc-transaction-pool-api", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-inherents", - "sp-runtime", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "sc-block-builder" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "parity-scale-codec 3.1.5", - "sc-client-api", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", -] - -[[package]] -name = "sc-chain-spec" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "impl-trait-for-tuples", - "memmap2", - "parity-scale-codec 3.1.5", - "sc-chain-spec-derive", - "sc-network", - "sc-telemetry", - "serde", - "serde_json", - "sp-core", - "sp-runtime", -] - -[[package]] -name = "sc-chain-spec-derive" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sc-cli" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "chrono", - "clap", - "fdlimit", - "futures", - "hex", - "libp2p", - "log", - "names", - "parity-scale-codec 3.1.5", - "rand 0.7.3", - "regex", - "rpassword", - "sc-client-api", - "sc-client-db", - "sc-keystore", - "sc-network", - "sc-service", - "sc-telemetry", - "sc-tracing", - "sc-utils", - "serde", - "serde_json", - "sp-blockchain", - "sp-core", - "sp-keyring", - "sp-keystore", - "sp-panic-handler", - "sp-runtime", - "sp-version", - "thiserror", - "tiny-bip39", - "tokio", -] - -[[package]] -name = "sc-client-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "fnv", - "futures", - "hash-db", - "log", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "sc-executor", - "sc-transaction-pool-api", - "sc-utils", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-database", - "sp-externalities", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "sp-storage", - "sp-trie", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "sc-client-db" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "hash-db", - "kvdb", - "kvdb-memorydb", - "kvdb-rocksdb", - "linked-hash-map", - "log", - "parity-db", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "sc-client-api", - "sc-state-db", - "sp-arithmetic", - "sp-blockchain", - "sp-core", - "sp-database", - "sp-runtime", - "sp-state-machine", - "sp-trie", -] - -[[package]] -name = "sc-consensus" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "async-trait", - "futures", - "futures-timer", - "libp2p", - "log", - "parking_lot 0.12.1", - "sc-client-api", - "sc-utils", - "serde", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-runtime", - "sp-state-machine", - "substrate-prometheus-endpoint", - "thiserror", -] - -[[package]] -name = "sc-consensus-babe" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "async-trait", - "fork-tree", - "futures", - "log", - "merlin", - "num-bigint", - "num-rational 0.2.4", - "num-traits", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "rand 0.7.3", - "retain_mut", - "sc-client-api", - "sc-consensus", - "sc-consensus-epochs", - "sc-consensus-slots", - "sc-keystore", - "sc-telemetry", - "schnorrkel", - "serde", - "sp-api", - "sp-application-crypto", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-consensus-slots", - "sp-consensus-vrf", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-version", - "substrate-prometheus-endpoint", - "thiserror", -] - -[[package]] -name = "sc-consensus-babe-rpc" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "futures", - "jsonrpsee", - "sc-consensus-babe", - "sc-consensus-epochs", - "sc-rpc-api", - "serde", - "sp-api", - "sp-application-crypto", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-core", - "sp-keystore", - "sp-runtime", - "thiserror", -] - -[[package]] -name = "sc-consensus-epochs" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "fork-tree", - "parity-scale-codec 3.1.5", - "sc-client-api", - "sc-consensus", - "sp-blockchain", - "sp-runtime", -] - -[[package]] -name = "sc-consensus-slots" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "async-trait", - "futures", - "futures-timer", - "log", - "parity-scale-codec 3.1.5", - "sc-client-api", - "sc-consensus", - "sc-telemetry", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", - "sp-timestamp", - "thiserror", -] - -[[package]] -name = "sc-consensus-uncles" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "sc-client-api", - "sp-authorship", - "sp-runtime", - "thiserror", -] - -[[package]] -name = "sc-executor" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "lazy_static", - "lru 0.7.8", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "sc-executor-common", - "sc-executor-wasmi", - "sp-api", - "sp-core", - "sp-core-hashing-proc-macro", - "sp-externalities", - "sp-io", - "sp-panic-handler", - "sp-runtime-interface", - "sp-tasks", - "sp-trie", - "sp-version", - "sp-wasm-interface", - "tracing", - "wasmi", -] - -[[package]] -name = "sc-executor-common" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "environmental", - "parity-scale-codec 3.1.5", - "sc-allocator", - "sp-maybe-compressed-blob", - "sp-sandbox", - "sp-serializer", - "sp-wasm-interface", - "thiserror", - "wasm-instrument", - "wasmi", -] - -[[package]] -name = "sc-executor-wasmi" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "log", - "parity-scale-codec 3.1.5", - "sc-allocator", - "sc-executor-common", - "sp-runtime-interface", - "sp-sandbox", - "sp-wasm-interface", - "wasmi", -] - -[[package]] -name = "sc-executor-wasmtime" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "log", - "once_cell", - "parity-scale-codec 3.1.5", - "parity-wasm 0.42.2", - "rustix 0.35.9", - "sc-allocator", - "sc-executor-common", - "sp-runtime-interface", - "sp-sandbox", - "sp-wasm-interface", - "wasmtime", -] - -[[package]] -name = "sc-finality-grandpa" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "ahash", - "async-trait", - "dyn-clone", - "finality-grandpa", - "fork-tree", - "futures", - "futures-timer", - "hex", - "log", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "rand 0.8.5", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-consensus", - "sc-keystore", - "sc-network", - "sc-network-common", - "sc-network-gossip", - "sc-telemetry", - "sc-utils", - "serde_json", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-finality-grandpa", - "sp-keystore", - "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", -] - -[[package]] -name = "sc-finality-grandpa-rpc" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "finality-grandpa", - "futures", - "jsonrpsee", - "log", - "parity-scale-codec 3.1.5", - "sc-client-api", - "sc-finality-grandpa", - "sc-rpc", - "serde", - "serde_json", - "sp-blockchain", - "sp-core", - "sp-runtime", - "thiserror", -] - -[[package]] -name = "sc-informant" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "ansi_term", - "futures", - "futures-timer", - "log", - "parity-util-mem", - "sc-client-api", - "sc-network", - "sc-transaction-pool-api", - "sp-blockchain", - "sp-runtime", -] - -[[package]] -name = "sc-keystore" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "async-trait", - "hex", - "parking_lot 0.12.1", - "serde_json", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "thiserror", -] - -[[package]] -name = "sc-network" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "async-trait", - "asynchronous-codec", - "bitflags", - "bytes", - "cid", - "either", - "fnv", - "fork-tree", - "futures", - "futures-timer", - "hex", - "ip_network", - "libp2p", - "linked-hash-map", - "linked_hash_set", - "log", - "lru 0.7.8", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "pin-project", - "prost", - "prost-build", - "rand 0.7.3", - "sc-block-builder", - "sc-client-api", - "sc-consensus", - "sc-network-common", - "sc-peerset", - "sc-utils", - "serde", - "serde_json", - "smallvec", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", - "unsigned-varint", - "void", - "zeroize", -] - -[[package]] -name = "sc-network-common" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "bitflags", - "futures", - "libp2p", - "parity-scale-codec 3.1.5", - "prost-build", - "sc-consensus", - "sc-peerset", - "smallvec", - "sp-consensus", - "sp-finality-grandpa", - "sp-runtime", -] - -[[package]] -name = "sc-network-gossip" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "ahash", - "futures", - "futures-timer", - "libp2p", - "log", - "lru 0.7.8", - "sc-network", - "sp-runtime", - "substrate-prometheus-endpoint", - "tracing", -] - -[[package]] -name = "sc-network-light" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "futures", - "libp2p", - "log", - "parity-scale-codec 3.1.5", - "prost", - "prost-build", - "sc-client-api", - "sc-network-common", - "sc-peerset", - "sp-blockchain", - "sp-core", - "sp-runtime", - "thiserror", -] - -[[package]] -name = "sc-network-sync" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "fork-tree", - "futures", - "libp2p", - "log", - "lru 0.7.8", - "parity-scale-codec 3.1.5", - "prost", - "prost-build", - "sc-client-api", - "sc-consensus", - "sc-network-common", - "sc-peerset", - "smallvec", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-finality-grandpa", - "sp-runtime", - "thiserror", -] - -[[package]] -name = "sc-offchain" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "bytes", - "fnv", - "futures", - "futures-timer", - "hex", - "hyper", - "hyper-rustls", - "num_cpus", - "once_cell", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "rand 0.7.3", - "sc-client-api", - "sc-network", - "sc-utils", - "sp-api", - "sp-core", - "sp-offchain", - "sp-runtime", - "threadpool", - "tracing", -] - -[[package]] -name = "sc-peerset" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "futures", - "libp2p", - "log", - "sc-utils", - "serde_json", - "wasm-timer", -] - -[[package]] -name = "sc-proposer-metrics" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "log", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "sc-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "futures", - "hash-db", - "jsonrpsee", - "log", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-rpc-api", - "sc-tracing", - "sc-transaction-pool-api", - "sc-utils", - "serde_json", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-keystore", - "sp-offchain", - "sp-rpc", - "sp-runtime", - "sp-session", - "sp-version", -] - -[[package]] -name = "sc-rpc-api" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "futures", - "jsonrpsee", - "log", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "sc-chain-spec", - "sc-transaction-pool-api", - "scale-info", - "serde", - "serde_json", - "sp-core", - "sp-rpc", - "sp-runtime", - "sp-tracing", - "sp-version", - "thiserror", -] - -[[package]] -name = "sc-rpc-server" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "futures", - "jsonrpsee", - "log", - "serde_json", - "substrate-prometheus-endpoint", - "tokio", -] - -[[package]] -name = "sc-service" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "async-trait", - "directories", - "exit-future", - "futures", - "futures-timer", - "hash-db", - "jsonrpsee", - "log", - "parity-scale-codec 3.1.5", - "parity-util-mem", - "parking_lot 0.12.1", - "pin-project", - "rand 0.7.3", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-client-db", - "sc-consensus", - "sc-executor", - "sc-informant", - "sc-keystore", - "sc-network", - "sc-network-common", - "sc-network-light", - "sc-network-sync", - "sc-offchain", - "sc-rpc", - "sc-rpc-server", - "sc-sysinfo", - "sc-telemetry", - "sc-tracing", - "sc-transaction-pool", - "sc-transaction-pool-api", - "sc-utils", - "serde", - "serde_json", - "sp-api", - "sp-application-crypto", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-externalities", - "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-session", - "sp-state-machine", - "sp-storage", - "sp-tracing", - "sp-transaction-pool", - "sp-transaction-storage-proof", - "sp-trie", - "sp-version", - "substrate-prometheus-endpoint", - "tempfile", - "thiserror", - "tokio", - "tracing", - "tracing-futures", -] - -[[package]] -name = "sc-state-db" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "log", - "parity-scale-codec 3.1.5", - "parity-util-mem", - "parity-util-mem-derive", - "parking_lot 0.12.1", - "sc-client-api", - "sp-core", -] - -[[package]] -name = "sc-sync-state-rpc" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "jsonrpsee", - "parity-scale-codec 3.1.5", - "sc-chain-spec", - "sc-client-api", - "sc-consensus-babe", - "sc-consensus-epochs", - "sc-finality-grandpa", - "serde", - "serde_json", - "sp-blockchain", - "sp-runtime", - "thiserror", -] - -[[package]] -name = "sc-sysinfo" -version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "futures", - "libc", - "log", - "rand 0.7.3", - "rand_pcg 0.2.1", - "regex", - "sc-telemetry", - "serde", - "serde_json", - "sp-core", - "sp-io", - "sp-std", -] - -[[package]] -name = "sc-telemetry" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "chrono", - "futures", - "libp2p", - "log", - "parking_lot 0.12.1", - "pin-project", - "rand 0.7.3", - "serde", - "serde_json", - "thiserror", - "wasm-timer", -] - -[[package]] -name = "sc-tracing" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "ansi_term", - "atty", - "chrono", - "lazy_static", - "libc", - "log", - "once_cell", - "parking_lot 0.12.1", - "regex", - "rustc-hash", - "sc-client-api", - "sc-rpc-server", - "sc-tracing-proc-macro", - "serde", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-rpc", - "sp-runtime", - "sp-tracing", - "thiserror", - "tracing", - "tracing-log", - "tracing-subscriber", -] - -[[package]] -name = "sc-tracing-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sc-transaction-pool" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "futures", - "futures-timer", - "linked-hash-map", - "log", - "parity-scale-codec 3.1.5", - "parity-util-mem", - "parking_lot 0.12.1", - "retain_mut", - "sc-client-api", - "sc-transaction-pool-api", - "sc-utils", - "serde", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-runtime", - "sp-tracing", - "sp-transaction-pool", - "substrate-prometheus-endpoint", - "thiserror", -] - -[[package]] -name = "sc-transaction-pool-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "futures", - "log", - "serde", - "sp-blockchain", - "sp-runtime", - "thiserror", -] - -[[package]] -name = "sc-utils" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "futures", - "futures-timer", - "lazy_static", - "log", - "parking_lot 0.12.1", - "prometheus", -] - -[[package]] -name = "scale-info" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c46be926081c9f4dd5dd9b6f1d3e3229f2360bc6502dd8836f84a93b7c75e99a" -dependencies = [ - "bitvec", - "cfg-if 1.0.0", - "derive_more", - "parity-scale-codec 3.1.5", - "scale-info-derive", - "serde", -] - -[[package]] -name = "scale-info-derive" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e334bb10a245e28e5fd755cabcafd96cfcd167c99ae63a46924ca8d8703a3c" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "schannel" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" -dependencies = [ - "lazy_static", - "windows-sys", -] - -[[package]] -name = "schnorrkel" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "curve25519-dalek 2.1.3", - "getrandom 0.1.16", - "merlin", - "rand 0.7.3", - "rand_core 0.5.1", - "sha2 0.8.2", - "subtle", - "zeroize", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "sec1" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" -dependencies = [ - "der", - "generic-array 0.14.6", - "subtle", - "zeroize", -] - -[[package]] -name = "secp256k1" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7649a0b3ffb32636e60c7ce0d70511eda9c52c658cd0634e194d5a19943aeff" -dependencies = [ - "secp256k1-sys", -] - -[[package]] -name = "secp256k1-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7058dc8eaf3f2810d7828680320acda0b25a288f6d288e19278e249bbf74226b" -dependencies = [ - "cc", -] - -[[package]] -name = "secrecy" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" -dependencies = [ - "zeroize", -] - -[[package]] -name = "security-framework" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "semver" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" -dependencies = [ - "serde", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - -[[package]] -name = "serde" -version = "1.0.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" -dependencies = [ - "itoa 1.0.3", - "ryu", - "serde", -] - -[[package]] -name = "serde_nanos" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e44969a61f5d316be20a42ff97816efb3b407a924d06824c3d8a49fa8450de0e" -dependencies = [ - "serde", -] - -[[package]] -name = "sha-1" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sha1" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006769ba83e921b3085caa8334186b00cf92b4cb1a6cf4632fbccc8eff5c7549" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.3", -] - -[[package]] -name = "sha2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sha2" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9db03534dff993187064c4e0c05a5708d2a9728ace9a8959b77bedf415dac5" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.3", -] - -[[package]] -name = "sha3" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" -dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "keccak", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sha3" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaedf34ed289ea47c2b741bb72e5357a209512d67bcd4bda44359e5bf0470f56" -dependencies = [ - "digest 0.10.3", - "keccak", -] - -[[package]] -name = "sharded-slab" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "shlex" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" - -[[package]] -name = "signal-hook" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" -dependencies = [ - "libc", -] - -[[package]] -name = "signature" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" -dependencies = [ - "digest 0.9.0", - "rand_core 0.6.3", -] - -[[package]] -name = "simba" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e82063457853d00243beda9952e910b82593e4b07ae9f721b9278a99a0d3d5c" -dependencies = [ - "approx", - "num-complex", - "num-traits", - "paste", -] - -[[package]] -name = "slab" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" -dependencies = [ - "autocfg", -] - -[[package]] -name = "slice-group-by" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" - -[[package]] -name = "slot-range-helper" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "enumn", - "parity-scale-codec 3.1.5", - "paste", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "slotmap" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" -dependencies = [ - "version_check", -] - -[[package]] -name = "smallvec" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" - -[[package]] -name = "snap" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45456094d1983e2ee2a18fdfebce3189fa451699d0502cb8e3b49dba5ba41451" - -[[package]] -name = "snow" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774d05a3edae07ce6d68ea6984f3c05e9bba8927e3dd591e3b479e5b03213d0d" -dependencies = [ - "aes-gcm", - "blake2", - "chacha20poly1305", - "curve25519-dalek 4.0.0-pre.1", - "rand_core 0.6.3", - "ring", - "rustc_version 0.4.0", - "sha2 0.10.5", - "subtle", -] - -[[package]] -name = "socket2" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "soketto" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" -dependencies = [ - "base64", - "bytes", - "flate2", - "futures", - "httparse", - "log", - "rand 0.8.5", - "sha-1", -] - -[[package]] -name = "sp-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "hash-db", - "log", - "parity-scale-codec 3.1.5", - "sp-api-proc-macro", - "sp-core", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-version", - "thiserror", -] - -[[package]] -name = "sp-api-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "blake2", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sp-application-crypto" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-std", -] - -[[package]] -name = "sp-arithmetic" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "integer-sqrt", - "num-traits", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-debug-derive", - "sp-std", - "static_assertions", -] - -[[package]] -name = "sp-authority-discovery" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "parity-scale-codec 3.1.5", - "scale-info", - "sp-api", - "sp-application-crypto", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "sp-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "async-trait", - "parity-scale-codec 3.1.5", - "sp-inherents", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "sp-block-builder" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "parity-scale-codec 3.1.5", - "sp-api", - "sp-inherents", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "sp-blockchain" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "futures", - "log", - "lru 0.7.8", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "sp-api", - "sp-consensus", - "sp-database", - "sp-runtime", - "sp-state-machine", - "thiserror", -] - -[[package]] -name = "sp-consensus" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "async-trait", - "futures", - "futures-timer", - "log", - "parity-scale-codec 3.1.5", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-version", - "thiserror", -] - -[[package]] -name = "sp-consensus-aura" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "async-trait", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-api", - "sp-application-crypto", - "sp-consensus", - "sp-consensus-slots", - "sp-inherents", - "sp-runtime", - "sp-std", - "sp-timestamp", -] - -[[package]] -name = "sp-consensus-babe" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "async-trait", - "merlin", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-consensus", - "sp-consensus-slots", - "sp-consensus-vrf", - "sp-core", - "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-std", - "sp-timestamp", -] - -[[package]] -name = "sp-consensus-slots" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-arithmetic", - "sp-runtime", - "sp-std", - "sp-timestamp", -] - -[[package]] -name = "sp-consensus-vrf" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "parity-scale-codec 3.1.5", - "scale-info", - "schnorrkel", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "sp-core" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "base58", - "bitflags", - "blake2-rfc", - "byteorder", - "dyn-clonable", - "ed25519-dalek", - "futures", - "hash-db", - "hash256-std-hasher", - "hex", - "impl-serde", - "lazy_static", - "libsecp256k1", - "log", - "merlin", - "num-traits", - "parity-scale-codec 3.1.5", - "parity-util-mem", - "parking_lot 0.12.1", - "primitive-types", - "rand 0.7.3", - "regex", - "scale-info", - "schnorrkel", - "secp256k1", - "secrecy", - "serde", - "sp-core-hashing", - "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", - "sp-std", - "sp-storage", - "ss58-registry", - "substrate-bip39", - "thiserror", - "tiny-bip39", - "wasmi", - "zeroize", -] - -[[package]] -name = "sp-core-hashing" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "blake2", - "byteorder", - "digest 0.10.3", - "sha2 0.10.5", - "sha3 0.10.4", - "sp-std", - "twox-hash", -] - -[[package]] -name = "sp-core-hashing-proc-macro" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "proc-macro2", - "quote", - "sp-core-hashing", - "syn", -] - -[[package]] -name = "sp-database" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "kvdb", - "parking_lot 0.12.1", -] - -[[package]] -name = "sp-debug-derive" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sp-externalities" -version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "environmental", - "parity-scale-codec 3.1.5", - "sp-std", - "sp-storage", -] - -[[package]] -name = "sp-finality-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "finality-grandpa", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "sp-inherents" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "async-trait", - "impl-trait-for-tuples", - "parity-scale-codec 3.1.5", - "sp-core", - "sp-runtime", - "sp-std", - "thiserror", -] - -[[package]] -name = "sp-io" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "futures", - "hash-db", - "libsecp256k1", - "log", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "secp256k1", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", - "sp-std", - "sp-tracing", - "sp-trie", - "sp-wasm-interface", - "tracing", - "tracing-core", -] - -[[package]] -name = "sp-keyring" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "lazy_static", - "sp-core", - "sp-runtime", - "strum", -] - -[[package]] -name = "sp-keystore" -version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "async-trait", - "futures", - "merlin", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "schnorrkel", - "serde", - "sp-core", - "sp-externalities", - "thiserror", -] - -[[package]] -name = "sp-maybe-compressed-blob" -version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "thiserror", - "zstd", -] - -[[package]] -name = "sp-mmr-primitives" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "log", - "parity-scale-codec 3.1.5", - "serde", - "sp-api", - "sp-core", - "sp-debug-derive", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "sp-npos-elections" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "parity-scale-codec 3.1.5", - "scale-info", - "serde", - "sp-arithmetic", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "sp-offchain" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "sp-api", - "sp-core", - "sp-runtime", -] - -[[package]] -name = "sp-panic-handler" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "backtrace", - "lazy_static", - "regex", -] - -[[package]] -name = "sp-rpc" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "rustc-hash", - "serde", - "sp-core", -] - -[[package]] -name = "sp-runtime" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "parity-scale-codec 3.1.5", - "parity-util-mem", - "paste", - "rand 0.7.3", - "scale-info", - "serde", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-std", -] - -[[package]] -name = "sp-runtime-interface" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec 3.1.5", - "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", - "static_assertions", -] - -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "Inflector", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sp-sandbox" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "log", - "parity-scale-codec 3.1.5", - "sp-core", - "sp-io", - "sp-std", - "sp-wasm-interface", - "wasmi", -] - -[[package]] -name = "sp-serializer" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "sp-session" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "parity-scale-codec 3.1.5", - "scale-info", - "sp-api", - "sp-core", - "sp-runtime", - "sp-staking", - "sp-std", -] - -[[package]] -name = "sp-staking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "parity-scale-codec 3.1.5", - "scale-info", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "sp-state-machine" -version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "hash-db", - "log", - "num-traits", - "parity-scale-codec 3.1.5", - "parking_lot 0.12.1", - "rand 0.7.3", - "smallvec", - "sp-core", - "sp-externalities", - "sp-panic-handler", - "sp-std", - "sp-trie", - "thiserror", - "tracing", - "trie-root", -] - -[[package]] -name = "sp-std" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" - -[[package]] -name = "sp-storage" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "impl-serde", - "parity-scale-codec 3.1.5", - "ref-cast", - "serde", - "sp-debug-derive", - "sp-std", -] - -[[package]] -name = "sp-tasks" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "log", - "sp-core", - "sp-externalities", - "sp-io", - "sp-runtime-interface", - "sp-std", -] - -[[package]] -name = "sp-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "async-trait", - "futures-timer", - "log", - "parity-scale-codec 3.1.5", - "sp-api", - "sp-inherents", - "sp-runtime", - "sp-std", - "thiserror", -] - -[[package]] -name = "sp-tracing" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "parity-scale-codec 3.1.5", - "sp-std", - "tracing", - "tracing-core", - "tracing-subscriber", -] - -[[package]] -name = "sp-transaction-pool" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "sp-api", - "sp-runtime", -] - -[[package]] -name = "sp-transaction-storage-proof" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "async-trait", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-std", - "sp-trie", -] - -[[package]] -name = "sp-trie" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "hash-db", - "memory-db", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-core", - "sp-std", - "thiserror", - "trie-db", - "trie-root", -] - -[[package]] -name = "sp-version" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "impl-serde", - "parity-scale-codec 3.1.5", - "parity-wasm 0.42.2", - "scale-info", - "serde", - "sp-core-hashing-proc-macro", - "sp-runtime", - "sp-std", - "sp-version-proc-macro", - "thiserror", -] - -[[package]] -name = "sp-version-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "parity-scale-codec 3.1.5", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sp-wasm-interface" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "impl-trait-for-tuples", - "log", - "parity-scale-codec 3.1.5", - "sp-std", - "wasmi", - "wasmtime", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "ss58-registry" -version = "1.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0837b5d62f42082c9d56cd946495ae273a3c68083b637b9153341d5e465146d" -dependencies = [ - "Inflector", - "num-format", - "proc-macro2", - "quote", - "serde", - "serde_json", - "unicode-xid", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "static_init" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11b73400442027c4adedda20a9f9b7945234a5bd8d5f7e86da22bd5d0622369c" -dependencies = [ - "cfg_aliases", - "libc", - "parking_lot 0.11.2", - "static_init_macro", -] - -[[package]] -name = "static_init_macro" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2261c91034a1edc3fc4d1b80e89d82714faede0515c14a75da10cb941546bbf" -dependencies = [ - "cfg_aliases", - "memchr", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "statrs" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05bdbb8e4e78216a85785a85d3ec3183144f98d0097b9281802c019bb07a6f05" -dependencies = [ - "approx", - "lazy_static", - "nalgebra", - "num-traits", - "rand 0.8.5", -] - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "struct-versioning" -version = "0.1.0" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn", -] - -[[package]] -name = "substrate-bip39" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" -dependencies = [ - "hmac 0.11.0", - "pbkdf2 0.8.0", - "schnorrkel", - "sha2 0.9.9", - "zeroize", -] - -[[package]] -name = "substrate-frame-rpc-system" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "frame-system-rpc-runtime-api", - "futures", - "jsonrpsee", - "log", - "parity-scale-codec 3.1.5", - "sc-client-api", - "sc-rpc-api", - "sc-transaction-pool-api", - "serde_json", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-core", - "sp-runtime", -] - -[[package]] -name = "substrate-prometheus-endpoint" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "futures-util", - "hyper", - "log", - "prometheus", - "thiserror", - "tokio", -] - -[[package]] -name = "substrate-state-trie-migration-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "jsonrpsee", - "log", - "parity-scale-codec 3.1.5", - "sc-client-api", - "sc-rpc-api", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-trie", - "trie-db", -] - -[[package]] -name = "substrate-wasm-builder" -version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "ansi_term", - "build-helper", - "cargo_metadata", - "filetime", - "sp-maybe-compressed-blob", - "strum", - "tempfile", - "toml", - "walkdir", - "wasm-gc-api", -] - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "syn" -version = "1.0.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "unicode-xid", -] - -[[package]] -name = "system-configuration" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "target-lexicon" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02424087780c9b71cc96799eaeddff35af2bc513278cda5c99fc1f5d026d3c1" - -[[package]] -name = "tempfile" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if 1.0.0", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", -] - -[[package]] -name = "termcolor" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "textwrap" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" - -[[package]] -name = "thiserror" -version = "1.0.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1b05ca9d106ba7d2e31a9dab4a64e7be2cce415321966ea3132c49a656e252" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8f2591983642de85c921015f3f070c665a197ed69e417af436115e3a1407487" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thousands" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" - -[[package]] -name = "thread_local" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" -dependencies = [ - "once_cell", -] - -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", -] - -[[package]] -name = "thrift" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b82ca8f46f95b3ce96081fe3dd89160fdea970c254bb72925255d1b62aae692e" -dependencies = [ - "byteorder", - "integer-encoding", - "log", - "ordered-float", - "threadpool", -] - -[[package]] -name = "tikv-jemalloc-sys" -version = "0.4.3+5.2.1-patched.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1792ccb507d955b46af42c123ea8863668fae24d03721e40cad6a41773dbb49" -dependencies = [ - "cc", - "fs_extra", - "libc", -] - -[[package]] -name = "time" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "tiny-bip39" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" -dependencies = [ - "anyhow", - "hmac 0.8.1", - "once_cell", - "pbkdf2 0.4.0", - "rand 0.7.3", - "rustc-hash", - "sha2 0.9.9", - "thiserror", - "unicode-normalization", - "wasm-bindgen", - "zeroize", -] - -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - -[[package]] -name = "tokio" -version = "1.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89797afd69d206ccd11fb0ea560a44bbb87731d020670e79416d442919257d42" -dependencies = [ - "autocfg", - "bytes", - "libc", - "memchr", - "mio", - "num_cpus", - "once_cell", - "parking_lot 0.12.1", - "pin-project-lite 0.2.9", - "signal-hook-registry", - "socket2", - "tokio-macros", - "winapi", -] - -[[package]] -name = "tokio-macros" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls", - "tokio", - "webpki", -] - -[[package]] -name = "tokio-stream" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" -dependencies = [ - "futures-core", - "pin-project-lite 0.2.9", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" -dependencies = [ - "bytes", - "futures-core", - "futures-io", - "futures-sink", - "pin-project-lite 0.2.9", - "tokio", - "tracing", -] - -[[package]] -name = "toml" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" -dependencies = [ - "serde", -] - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" -dependencies = [ - "cfg-if 1.0.0", - "pin-project-lite 0.2.9", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - -[[package]] -name = "tracing-gum" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "polkadot-node-jaeger", - "polkadot-primitives", - "tracing", - "tracing-gum-proc-macro", -] - -[[package]] -name = "tracing-gum-proc-macro" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "expander 0.0.6", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-log" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" -dependencies = [ - "lazy_static", - "log", - "tracing-core", -] - -[[package]] -name = "tracing-serde" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" -dependencies = [ - "serde", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "ansi_term", - "chrono", - "lazy_static", - "matchers", - "parking_lot 0.11.2", - "regex", - "serde", - "serde_json", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", - "tracing-serde", -] - -[[package]] -name = "trie-db" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32d034c0d3db64b43c31de38e945f15b40cd4ca6d2dcfc26d4798ce8de4ab83" -dependencies = [ - "hash-db", - "hashbrown 0.12.3", - "log", - "rustc-hex", - "smallvec", -] - -[[package]] -name = "trie-root" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" -dependencies = [ - "hash-db", -] - -[[package]] -name = "triehash" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" -dependencies = [ - "hash-db", - "rlp", -] - -[[package]] -name = "trust-dns-proto" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" -dependencies = [ - "async-trait", - "cfg-if 1.0.0", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.3", - "ipnet", - "lazy_static", - "log", - "rand 0.8.5", - "smallvec", - "thiserror", - "tinyvec", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" -dependencies = [ - "cfg-if 1.0.0", - "futures-util", - "ipconfig", - "lazy_static", - "log", - "lru-cache", - "parking_lot 0.12.1", - "resolv-conf", - "smallvec", - "thiserror", - "trust-dns-proto", -] - -[[package]] -name = "try-lock" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" - -[[package]] -name = "tt-call" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e66dcbec4290c69dd03c57e76c2469ea5c7ce109c6dd4351c13055cf71ea055" - -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if 1.0.0", - "digest 0.10.3", - "rand 0.8.5", - "static_assertions", -] - -[[package]] -name = "typenum" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" - -[[package]] -name = "ucd-trie" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" - -[[package]] -name = "uint" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" - -[[package]] -name = "unicode-ident" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" - -[[package]] -name = "unicode-normalization" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-width" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" - -[[package]] -name = "unicode-xid" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" - -[[package]] -name = "universal-hash" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" -dependencies = [ - "generic-array 0.14.6", - "subtle", -] - -[[package]] -name = "unsigned-varint" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" -dependencies = [ - "asynchronous-codec", - "bytes", - "futures-io", - "futures-util", -] - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - -[[package]] -name = "up-common" -version = "0.9.27" -dependencies = [ - "fp-rpc", - "frame-support", - "pallet-evm", - "sp-consensus-aura", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "up-data-structs" -version = "0.2.2" -dependencies = [ - "derivative", - "frame-support", - "frame-system", - "pallet-evm", - "parity-scale-codec 3.1.5", - "rmrk-traits", - "scale-info", - "serde", - "sp-core", - "sp-runtime", - "sp-std", - "struct-versioning", -] - -[[package]] -name = "up-rpc" -version = "0.1.3" -dependencies = [ - "pallet-common", - "pallet-evm", - "parity-scale-codec 3.1.5", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std", - "up-data-structs", -] - -[[package]] -name = "up-sponsorship" -version = "0.1.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04" -dependencies = [ - "impl-trait-for-tuples", -] - -[[package]] -name = "url" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" -dependencies = [ - "form_urlencoded", - "idna 0.3.0", - "percent-encoding", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "value-bag" -version = "1.0.0-alpha.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" -dependencies = [ - "ctor", - "version_check", -] - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "waker-fn" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" - -[[package]] -name = "walkdir" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] - -[[package]] -name = "want" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" -dependencies = [ - "log", - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" -dependencies = [ - "cfg-if 1.0.0", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" - -[[package]] -name = "wasm-gc-api" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c32691b6c7e6c14e7f8fd55361a9088b507aa49620fcd06c09b3a1082186b9" -dependencies = [ - "log", - "parity-wasm 0.32.0", - "rustc-demangle", -] - -[[package]] -name = "wasm-instrument" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "962e5b0401bbb6c887f54e69b8c496ea36f704df65db73e81fd5ff8dc3e63a9f" -dependencies = [ - "parity-wasm 0.42.2", -] - -[[package]] -name = "wasm-timer" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" -dependencies = [ - "futures", - "js-sys", - "parking_lot 0.11.2", - "pin-utils", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "wasmi" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca00c5147c319a8ec91ec1a0edbec31e566ce2c9cc93b3f9bb86a9efd0eb795d" -dependencies = [ - "downcast-rs", - "libc", - "libm", - "memory_units", - "num-rational 0.2.4", - "num-traits", - "parity-wasm 0.42.2", - "wasmi-validation", -] - -[[package]] -name = "wasmi-validation" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "165343ecd6c018fc09ebcae280752702c9a2ef3e6f8d02f1cfcbdb53ef6d7937" -dependencies = [ - "parity-wasm 0.42.2", -] - -[[package]] -name = "wasmparser" -version = "0.85.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "570460c58b21e9150d2df0eaaedbb7816c34bcec009ae0dcc976e40ba81463e7" -dependencies = [ - "indexmap", -] - -[[package]] -name = "wasmtime" -version = "0.38.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f50eadf868ab6a04b7b511460233377d0bfbb92e417b2f6a98b98fef2e098f5" -dependencies = [ - "anyhow", - "backtrace", - "bincode", - "cfg-if 1.0.0", - "indexmap", - "lazy_static", - "libc", - "log", - "object 0.28.4", - "once_cell", - "paste", - "psm", - "rayon", - "region", - "serde", - "target-lexicon", - "wasmparser", - "wasmtime-cache", - "wasmtime-cranelift", - "wasmtime-environ", - "wasmtime-jit", - "wasmtime-runtime", - "winapi", -] - -[[package]] -name = "wasmtime-cache" -version = "0.38.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1df23c642e1376892f3b72f311596976979cbf8b85469680cdd3a8a063d12a2" -dependencies = [ - "anyhow", - "base64", - "bincode", - "directories-next", - "file-per-thread-logger", - "log", - "rustix 0.33.7", - "serde", - "sha2 0.9.9", - "toml", - "winapi", - "zstd", -] - -[[package]] -name = "wasmtime-cranelift" -version = "0.38.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f264ff6b4df247d15584f2f53d009fbc90032cfdc2605b52b961bffc71b6eccd" -dependencies = [ - "anyhow", - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "cranelift-native", - "cranelift-wasm", - "gimli", - "log", - "more-asserts", - "object 0.28.4", - "target-lexicon", - "thiserror", - "wasmparser", - "wasmtime-environ", -] - -[[package]] -name = "wasmtime-environ" -version = "0.38.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "839d2820e4b830f4b9e7aa08d4c0acabf4a5036105d639f6dfa1c6891c73bdc6" -dependencies = [ - "anyhow", - "cranelift-entity", - "gimli", - "indexmap", - "log", - "more-asserts", - "object 0.28.4", - "serde", - "target-lexicon", - "thiserror", - "wasmparser", - "wasmtime-types", -] - -[[package]] -name = "wasmtime-jit" -version = "0.38.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef0a0bcbfa18b946d890078ba0e1bc76bcc53eccfb40806c0020ec29dcd1bd49" -dependencies = [ - "addr2line", - "anyhow", - "bincode", - "cfg-if 1.0.0", - "cpp_demangle", - "gimli", - "log", - "object 0.28.4", - "region", - "rustc-demangle", - "rustix 0.33.7", - "serde", - "target-lexicon", - "thiserror", - "wasmtime-environ", - "wasmtime-jit-debug", - "wasmtime-runtime", - "winapi", -] - -[[package]] -name = "wasmtime-jit-debug" -version = "0.38.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4779d976206c458edd643d1ac622b6c37e4a0800a8b1d25dfbf245ac2f2cac" -dependencies = [ - "lazy_static", - "object 0.28.4", - "rustix 0.33.7", -] - -[[package]] -name = "wasmtime-runtime" -version = "0.38.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7eb6ffa169eb5dcd18ac9473c817358cd57bc62c244622210566d473397954a" -dependencies = [ - "anyhow", - "backtrace", - "cc", - "cfg-if 1.0.0", - "indexmap", - "libc", - "log", - "mach", - "memfd", - "memoffset", - "more-asserts", - "rand 0.8.5", - "region", - "rustix 0.33.7", - "thiserror", - "wasmtime-environ", - "wasmtime-jit-debug", - "winapi", -] - -[[package]] -name = "wasmtime-types" -version = "0.38.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d932b0ac5336f7308d869703dd225610a6a3aeaa8e968c52b43eed96cefb1c2" -dependencies = [ - "cranelift-entity", - "serde", - "thiserror", - "wasmparser", -] - -[[package]] -name = "web-sys" -version = "0.3.59" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1c760f0d366a6c24a02ed7816e23e691f5d92291f94d15e836006fd11b04daf" -dependencies = [ - "webpki", -] - -[[package]] -name = "wepoll-ffi" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" -dependencies = [ - "cc", -] - -[[package]] -name = "which" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" -dependencies = [ - "either", - "libc", - "once_cell", -] - -[[package]] -name = "widestring" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f" -dependencies = [ - "windows_aarch64_msvc 0.34.0", - "windows_i686_gnu 0.34.0", - "windows_i686_msvc 0.34.0", - "windows_x86_64_gnu 0.34.0", - "windows_x86_64_msvc 0.34.0", -] - -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", -] - -[[package]] -name = "windows_aarch64_msvc" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - -[[package]] -name = "windows_i686_gnu" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" - -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - -[[package]] -name = "windows_i686_msvc" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" - -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - -[[package]] -name = "winreg" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" -dependencies = [ - "winapi", -] - -[[package]] -name = "wyz" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b31594f29d27036c383b53b59ed3476874d518f0efb151b27a4c275141390e" -dependencies = [ - "tap", -] - -[[package]] -name = "x25519-dalek" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" -dependencies = [ - "curve25519-dalek 3.2.0", - "rand_core 0.5.1", - "zeroize", -] - -[[package]] -name = "xcm" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "derivative", - "impl-trait-for-tuples", - "log", - "parity-scale-codec 3.1.5", - "scale-info", - "sp-runtime", - "xcm-procedural", -] - -[[package]] -name = "xcm-builder" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "frame-support", - "frame-system", - "log", - "pallet-transaction-payment", - "parity-scale-codec 3.1.5", - "polkadot-parachain", - "scale-info", - "sp-arithmetic", - "sp-io", - "sp-runtime", - "sp-std", - "xcm", - "xcm-executor", -] - -[[package]] -name = "xcm-executor" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "frame-support", - "impl-trait-for-tuples", - "log", - "parity-scale-codec 3.1.5", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "xcm", -] - -[[package]] -name = "xcm-procedural" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" -dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "yamux" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" -dependencies = [ - "futures", - "log", - "nohash-hasher", - "parking_lot 0.12.1", - "rand 0.8.5", - "static_assertions", -] - -[[package]] -name = "zeroize" -version = "1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.1+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" -dependencies = [ - "cc", - "libc", -] From 817617dab415a99767091d3c03df1a19d68e4734 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 12 Sep 2022 16:39:43 +0300 Subject: [PATCH 0849/1274] test changes in marke-e2e-tests --- .github/workflows/market-test_v2.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index 297b0ffe5b..990404c6b4 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -45,7 +45,8 @@ jobs: repository: 'UniqueNetwork/market-e2e-tests' ssh-key: ${{ secrets.GH_PAT }} path: 'qa-tests' - ref: 'master' +# ref: 'master' + ref: 'ci_test_v2' - name: Read .env file uses: xom9ikk/dotenv@v1.0.2 From 340447083f1b55174936923e1e5d69716b4ab280 Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 12 Sep 2022 17:46:41 +0300 Subject: [PATCH 0850/1274] WIP: migrating createMultipleItems --- tests/src/createMultipleItems.test.ts | 424 +++++++++++++------------- 1 file changed, 207 insertions(+), 217 deletions(-) diff --git a/tests/src/createMultipleItems.test.ts b/tests/src/createMultipleItems.test.ts index 8c1236e313..31906ed0e7 100644 --- a/tests/src/createMultipleItems.test.ts +++ b/tests/src/createMultipleItems.test.ts @@ -37,184 +37,174 @@ import { Pallets, checkPalletsPresence, } from './util/helpers'; +import {usingPlaygrounds} from './util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; +let donor: IKeyringPair; + +before(async () => { + await usingPlaygrounds(async (_, privateKey) => { + donor = privateKey('//Alice'); + }); +}); + +let alice: IKeyringPair; +let bob: IKeyringPair; + describe('Integration Test createMultipleItems(collection_id, owner, items_data):', () => { - it('Create 0x31, 0x32, 0x33 items in active NFT collection and verify tokens data in chain', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess(); - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - expect(itemsListIndexBefore).to.be.equal(0); + before(async () => { + await usingPlaygrounds(async (helper) => { + [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); + }); + }); - const alice = privateKeyWrapper('//Alice'); - await submitTransactionAsync( - alice, - api.tx.unique.setTokenPropertyPermissions(collectionId, [{key: 'data', permission: {tokenOwner: true}}]), - ); - + it('Create 0x31, 0x32, 0x33 items in active NFT collection and verify tokens data in chain', async () => { + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: true, mutable: false, collectionAdmin: false}}, + ], + }); const args = [ - {NFT: {properties: [{key: 'data', value: '1'}]}}, - {NFT: {properties: [{key: 'data', value: '2'}]}}, - {NFT: {properties: [{key: 'data', value: '3'}]}}, + {properties: [{key: 'data', value: '1'}]}, + {properties: [{key: 'data', value: '2'}]}, + {properties: [{key: 'data', value: '3'}]}, ]; - const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args); - await submitTransactionAsync(alice, createMultipleItemsTx); - const itemsListIndexAfter = await getLastTokenId(api, collectionId); - expect(itemsListIndexAfter).to.be.equal(3); - - expect(await getTokenOwner(api, collectionId, 1)).to.be.deep.equal(normalizeAccountId(alice.address)); - expect(await getTokenOwner(api, collectionId, 2)).to.be.deep.equal(normalizeAccountId(alice.address)); - expect(await getTokenOwner(api, collectionId, 3)).to.be.deep.equal(normalizeAccountId(alice.address)); - - expect((await getTokenProperties(api, collectionId, 1, ['data']))[0].value).to.be.equal('1'); - expect((await getTokenProperties(api, collectionId, 2, ['data']))[0].value).to.be.equal('2'); - expect((await getTokenProperties(api, collectionId, 3, ['data']))[0].value).to.be.equal('3'); + const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + for (const [i, token] of tokens.entries()) { + const tokenData = await token.getData(); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); + } }); }); it('Create 0x01, 0x02, 0x03 items in active Fungible collection and verify tokens data in chain', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - expect(itemsListIndexBefore).to.be.equal(0); - const alice = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (helper) => { + const collection = await helper.ft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + }); const args = [ - {Fungible: {value: 1}}, - {Fungible: {value: 2}}, - {Fungible: {value: 3}}, + {value: 1n}, + {value: 2n}, + {value: 3n}, ]; - const createMultipleItemsTx = api.tx.unique - .createMultipleItems(collectionId, normalizeAccountId(alice.address), args); - await submitTransactionAsync(alice, createMultipleItemsTx); - const token1Data = await getBalance(api, collectionId, alice.address, 0); - - expect(token1Data).to.be.equal(6n); // 1 + 2 + 3 + await helper.ft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(6n); }); }); it('Create 0x31, 0x32, 0x33 items in active ReFungible collection and verify tokens data in chain', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - expect(itemsListIndexBefore).to.be.equal(0); - const alice = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (helper) => { + const collection = await helper.rft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + }); const args = [ - {ReFungible: {pieces: 1}}, - {ReFungible: {pieces: 2}}, - {ReFungible: {pieces: 3}}, + {pieces: 1n}, + {pieces: 2n}, + {pieces: 3n}, ]; - const createMultipleItemsTx = api.tx.unique - .createMultipleItems(collectionId, normalizeAccountId(alice.address), args); - await submitTransactionAsync(alice, createMultipleItemsTx); - const itemsListIndexAfter = await getLastTokenId(api, collectionId); - expect(itemsListIndexAfter).to.be.equal(3); + const tokens = await helper.rft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); - expect(await getBalance(api, collectionId, alice.address, 1)).to.be.equal(1n); - expect(await getBalance(api, collectionId, alice.address, 2)).to.be.equal(2n); - expect(await getBalance(api, collectionId, alice.address, 3)).to.be.equal(3n); + for (const [i, token] of tokens.entries()) { + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(BigInt(i + 1)); + } }); }); it('Can mint amount of items equals to collection limits', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - - const collectionId = await createCollectionExpectSuccess(); - await setCollectionLimitsExpectSuccess(alice, collectionId, { - tokenLimit: 2, + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + limits: { + tokenLimit: 2, + }, }); - const args = [ - {NFT: {}}, - {NFT: {}}, - ]; - const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args); - const events = await submitTransactionAsync(alice, createMultipleItemsTx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + const args = [{}, {}]; + await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); }); }); it('Create 0x31, 0x32, 0x33 items in active NFT with property Admin', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionWithPropsExpectSuccess({propPerm: [{key: 'k', permission: {mutable: true, collectionAdmin: true, tokenOwner: false}}]}); - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - expect(itemsListIndexBefore).to.be.equal(0); - const alice = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: false, mutable: true, collectionAdmin: true}}, + ], + }); const args = [ - {NFT: {properties: [{key: 'k', value: 'v1'}]}}, - {NFT: {properties: [{key: 'k', value: 'v2'}]}}, - {NFT: {properties: [{key: 'k', value: 'v3'}]}}, + {properties: [{key: 'data', value: '1'}]}, + {properties: [{key: 'data', value: '2'}]}, + {properties: [{key: 'data', value: '3'}]}, ]; - - await createMultipleItemsWithPropsExpectSuccess(alice, collectionId, args); - const itemsListIndexAfter = await getLastTokenId(api, collectionId); - expect(itemsListIndexAfter).to.be.equal(3); - - expect(await getTokenOwner(api, collectionId, 1)).to.be.deep.equal(normalizeAccountId(alice.address)); - expect(await getTokenOwner(api, collectionId, 2)).to.be.deep.equal(normalizeAccountId(alice.address)); - expect(await getTokenOwner(api, collectionId, 3)).to.be.deep.equal(normalizeAccountId(alice.address)); - - expect((await getTokenProperties(api, collectionId, 1, ['k']))[0].value).to.be.equal('v1'); - expect((await getTokenProperties(api, collectionId, 2, ['k']))[0].value).to.be.equal('v2'); - expect((await getTokenProperties(api, collectionId, 3, ['k']))[0].value).to.be.equal('v3'); + const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + for (const [i, token] of tokens.entries()) { + const tokenData = await token.getData(); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); + } }); }); it('Create 0x31, 0x32, 0x33 items in active NFT with property AdminConst', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionWithPropsExpectSuccess({propPerm: [{key: 'k', permission: {mutable: false, collectionAdmin: true, tokenOwner: false}}]}); - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - expect(itemsListIndexBefore).to.be.equal(0); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: false, mutable: false, collectionAdmin: true}}, + ], + }); const args = [ - {NFT: {properties: [{key: 'k', value: 'v1'}]}}, - {NFT: {properties: [{key: 'k', value: 'v2'}]}}, - {NFT: {properties: [{key: 'k', value: 'v3'}]}}, + {properties: [{key: 'data', value: '1'}]}, + {properties: [{key: 'data', value: '2'}]}, + {properties: [{key: 'data', value: '3'}]}, ]; - - await createMultipleItemsWithPropsExpectSuccess(alice, collectionId, args); - const itemsListIndexAfter = await getLastTokenId(api, collectionId); - expect(itemsListIndexAfter).to.be.equal(3); - - expect(await getTokenOwner(api, collectionId, 1)).to.be.deep.equal(normalizeAccountId(alice.address)); - expect(await getTokenOwner(api, collectionId, 2)).to.be.deep.equal(normalizeAccountId(alice.address)); - expect(await getTokenOwner(api, collectionId, 3)).to.be.deep.equal(normalizeAccountId(alice.address)); - - expect((await getTokenProperties(api, collectionId, 1, ['k']))[0].value).to.be.equal('v1'); - expect((await getTokenProperties(api, collectionId, 2, ['k']))[0].value).to.be.equal('v2'); - expect((await getTokenProperties(api, collectionId, 3, ['k']))[0].value).to.be.equal('v3'); + const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + for (const [i, token] of tokens.entries()) { + const tokenData = await token.getData(); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); + } }); }); it('Create 0x31, 0x32, 0x33 items in active NFT with property itemOwnerOrAdmin', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionWithPropsExpectSuccess({propPerm: [{key: 'k', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}]}); - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - expect(itemsListIndexBefore).to.be.equal(0); - const alice = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}, + ], + }); const args = [ - {NFT: {properties: [{key: 'k', value: 'v1'}]}}, - {NFT: {properties: [{key: 'k', value: 'v2'}]}}, - {NFT: {properties: [{key: 'k', value: 'v3'}]}}, + {properties: [{key: 'data', value: '1'}]}, + {properties: [{key: 'data', value: '2'}]}, + {properties: [{key: 'data', value: '3'}]}, ]; - - await createMultipleItemsWithPropsExpectSuccess(alice, collectionId, args); - const itemsListIndexAfter = await getLastTokenId(api, collectionId); - expect(itemsListIndexAfter).to.be.equal(3); - - expect(await getTokenOwner(api, collectionId, 1)).to.be.deep.equal(normalizeAccountId(alice.address)); - expect(await getTokenOwner(api, collectionId, 2)).to.be.deep.equal(normalizeAccountId(alice.address)); - expect(await getTokenOwner(api, collectionId, 3)).to.be.deep.equal(normalizeAccountId(alice.address)); - - expect((await getTokenProperties(api, collectionId, 1, ['k']))[0].value).to.be.equal('v1'); - expect((await getTokenProperties(api, collectionId, 2, ['k']))[0].value).to.be.equal('v2'); - expect((await getTokenProperties(api, collectionId, 3, ['k']))[0].value).to.be.equal('v3'); + const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + for (const [i, token] of tokens.entries()) { + const tokenData = await token.getData(); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); + } }); }); }); @@ -308,125 +298,125 @@ describe('Negative Integration Test createMultipleItems(collection_id, owner, it let bob: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper) => { + [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); it('Regular user cannot create items in active NFT collection', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionId = await createCollectionExpectSuccess(); - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - expect(itemsListIndexBefore).to.be.equal(0); - const args = [{NFT: {}}, - {NFT: {}}, - {NFT: {}}]; - const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args); - await expect(executeTransaction(api, bob, createMultipleItemsTx)).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + }); + const args = [ + {}, + {}, + ]; + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(bob, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); }); }); it('Regular user cannot create items in active Fungible collection', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - expect(itemsListIndexBefore).to.be.equal(0); + await usingPlaygrounds(async (helper) => { + const collection = await helper.ft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + }); const args = [ - {Fungible: {value: 1}}, - {Fungible: {value: 2}}, - {Fungible: {value: 3}}, + {value: 1n}, + {value: 2n}, + {value: 3n}, ]; - const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args); - await expect(executeTransaction(api, bob, createMultipleItemsTx)).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); + const mintTx = async () => helper.ft.mintMultipleTokensWithOneOwner(bob, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); }); }); it('Regular user cannot create items in active ReFungible collection', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await usingApi(async (api: ApiPromise) => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - expect(itemsListIndexBefore).to.be.equal(0); + await usingPlaygrounds(async (helper) => { + const collection = await helper.rft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + }); const args = [ - {ReFungible: {pieces: 1}}, - {ReFungible: {pieces: 1}}, - {ReFungible: {pieces: 1}}, + {pieces: 1n}, + {pieces: 1n}, + {pieces: 1n}, ]; - const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args); - await expect(executeTransaction(api, bob, createMultipleItemsTx)).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); + const mintTx = async () => helper.rft.mintMultipleTokensWithOneOwner(bob, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); }); }); it('Create token in not existing collection', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionId = await getCreatedCollectionCount(api) + 1; - const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), ['NFT', 'NFT', 'NFT']); - await expect(executeTransaction(api, alice, createMultipleItemsTx)).to.be.rejectedWith(/common\.CollectionNotFound/); + await usingPlaygrounds(async (helper) => { + const collectionId = 1_000_000; + const args = [ + {}, + {}, + ]; + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(bob, collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejectedWith(/common\.CollectionNotFound/); }); }); it('Create NFTs that has reached the maximum data limit', async function() { - await usingApi(async (api, privateKeyWrapper) => { - const collectionId = await createCollectionWithPropsExpectSuccess({ - propPerm: [{key: 'key', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}], + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}, + ], }); - const alice = privateKeyWrapper('//Alice'); const args = [ - {NFT: {properties: [{key: 'key', value: 'A'.repeat(32769)}]}}, - {NFT: {properties: [{key: 'key', value: 'B'.repeat(32769)}]}}, - {NFT: {properties: [{key: 'key', value: 'C'.repeat(32769)}]}}, + {properties: [{key: 'data', value: 'A'.repeat(32769)}]}, + {properties: [{key: 'data', value: 'B'.repeat(32769)}]}, + {properties: [{key: 'data', value: 'C'.repeat(32769)}]}, ]; - const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args); - await expect(submitTransactionExpectFailAsync(alice, createMultipleItemsTx)).to.be.rejected; + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejected; }); }); it('Create Refungible tokens that has reached the maximum data limit', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await usingApi(async api => { - const collectionIdReFungible = - await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - { - const argsReFungible = [ - {ReFungible: [10, [['key', 'A'.repeat(32769)]]]}, - {ReFungible: [10, [['key', 'B'.repeat(32769)]]]}, - {ReFungible: [10, [['key', 'C'.repeat(32769)]]]}, - ]; - const createMultipleItemsTxFungible = api.tx.unique - .createMultipleItems(collectionIdReFungible, normalizeAccountId(alice.address), argsReFungible); - await expect(submitTransactionExpectFailAsync(alice, createMultipleItemsTxFungible)).to.be.rejected; - } - { - const argsReFungible = [ - {ReFungible: {properties: [{key: 'key', value: 'A'.repeat(32769)}]}}, - {ReFungible: {properties: [{key: 'key', value: 'B'.repeat(32769)}]}}, - {ReFungible: {properties: [{key: 'key', value: 'C'.repeat(32769)}]}}, - ]; - const createMultipleItemsTxFungible = api.tx.unique - .createMultipleItems(collectionIdReFungible, normalizeAccountId(alice.address), argsReFungible); - await expect(submitTransactionExpectFailAsync(alice, createMultipleItemsTxFungible)).to.be.rejected; - } + await usingPlaygrounds(async (helper) => { + const collection = await helper.rft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}, + ], + }); + const args = [ + {pieces: 10n, properties: [{key: 'data', value: 'A'.repeat(32769)}]}, + {pieces: 10n, properties: [{key: 'data', value: 'B'.repeat(32769)}]}, + {pieces: 10n, properties: [{key: 'data', value: 'C'.repeat(32769)}]}, + ]; + const mintTx = async () => helper.rft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejected; }); }); it('Create tokens with different types', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionId = await createCollectionExpectSuccess(); - - const types = ['NFT', 'Fungible']; - - if (await checkPalletsPresence([Pallets.ReFungible])) { - types.push('ReFungible'); - } + await usingPlaygrounds(async (helper) => { + const {collectionId} = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + }); - const createMultipleItemsTx = api.tx.unique - .createMultipleItems(collectionId, normalizeAccountId(alice.address), types); - await expect(executeTransaction(api, alice, createMultipleItemsTx)).to.be.rejectedWith(/nonfungible\.NotNonfungibleDataUsedToMintFungibleCollectionToken/); - // garbage collection :-D // lol - await destroyCollectionExpectSuccess(collectionId); + //FIXME: + const types = ['NFT', 'Fungible', 'ReFungible']; + const mintTx = helper.api?.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), types); + await expect(helper.signTransaction(alice, mintTx)).to.be.rejected; }); }); From a6179b86a28f9e7c51acaf605872db00bb3985fc Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 13 Sep 2022 00:10:30 +0300 Subject: [PATCH 0851/1274] Foreign assets benchmark --- Makefile | 6 +- pallets/foreign-assets/Cargo.toml | 4 +- pallets/foreign-assets/src/benchmarking.rs | 76 ++++++++++++++++++++++ pallets/foreign-assets/src/lib.rs | 5 +- runtime/common/runtime_apis.rs | 7 ++ runtime/opal/Cargo.toml | 1 + runtime/quartz/Cargo.toml | 1 + runtime/unique/Cargo.toml | 1 + 8 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 pallets/foreign-assets/src/benchmarking.rs diff --git a/Makefile b/Makefile index f468a410aa..7cb10d872a 100644 --- a/Makefile +++ b/Makefile @@ -128,5 +128,9 @@ bench-rmrk-core: bench-rmrk-equip: make _bench PALLET=proxy-rmrk-equip +.PHONY: bench-foreign-assets +bench-foreign-assets: + make _bench PALLET=foreign-assets + .PHONY: bench -bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler bench-rmrk-core bench-rmrk-equip +bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler bench-rmrk-core bench-rmrk-equip bench-foreign-assets diff --git a/pallets/foreign-assets/Cargo.toml b/pallets/foreign-assets/Cargo.toml index 4a9a0c14fd..860ef7599c 100644 --- a/pallets/foreign-assets/Cargo.toml +++ b/pallets/foreign-assets/Cargo.toml @@ -22,8 +22,7 @@ xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "releas xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false } #orml-tokens = { git = 'https://github.com/UniqueNetwork/open-runtime-module-library', branch = 'unique-polkadot-v0.9.24', version = "0.4.1-dev", default-features = false } orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.27", version = "0.4.1-dev", default-features = false } -#git = "https://github.com/open-web3-stack/open-runtime-module-library" -#branch = "polkadot-v0.9.27" +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } [dev-dependencies] serde_json = "1.0.68" @@ -51,3 +50,4 @@ std = [ "orml-tokens/std" ] try-runtime = ["frame-support/try-runtime"] +runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks'] \ No newline at end of file diff --git a/pallets/foreign-assets/src/benchmarking.rs b/pallets/foreign-assets/src/benchmarking.rs new file mode 100644 index 0000000000..e40ea3e387 --- /dev/null +++ b/pallets/foreign-assets/src/benchmarking.rs @@ -0,0 +1,76 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +#![allow(missing_docs)] + +use super::{Config, Pallet}; +use frame_benchmarking::{benchmarks, account}; +use frame_system::RawOrigin; +use crate::AssetMetadata; +use crate::Pallet as ForeignAssets; +use xcm::opaque::latest::Junction::Parachain; +use xcm::VersionedMultiLocation; +use frame_support::{ + traits::{Currency}, +}; +use sp_std::boxed::Box; + +benchmarks! { + register_foreign_asset { + let origin: RawOrigin = frame_system::RawOrigin::Root; + let owner: T::AccountId = account("user", 0, 1); + let location: VersionedMultiLocation = VersionedMultiLocation::from(Parachain(1000).into()); + let metadata: AssetMetadata<<::Currency as Currency<::AccountId>>::Balance> = AssetMetadata{ + name: "name".into(), + symbol: "symbol".into(), + decimals: 18, + minimal_balance: 1u32.into() + }; + let mut balance: <::Currency as Currency<::AccountId>>::Balance = + 4_000_000_000u32.into(); + balance = balance * balance; + ::Currency::make_free_balance_be(&owner, + balance); + }: { + ForeignAssets::::register_foreign_asset(origin.into(), owner, Box::new(location), Box::new(metadata))? + } + + update_foreign_asset { + let origin: RawOrigin = frame_system::RawOrigin::Root; + let owner: T::AccountId = account("user", 0, 1); + let location: VersionedMultiLocation = VersionedMultiLocation::from(Parachain(2000).into()); + let metadata: AssetMetadata<<::Currency as Currency<::AccountId>>::Balance> = AssetMetadata{ + name: "name".into(), + symbol: "symbol".into(), + decimals: 18, + minimal_balance: 1u32.into() + }; + let metadata2: AssetMetadata<<::Currency as Currency<::AccountId>>::Balance> = AssetMetadata{ + name: "name2".into(), + symbol: "symbol2".into(), + decimals: 18, + minimal_balance: 1u32.into() + }; + let mut balance: <::Currency as Currency<::AccountId>>::Balance = + 4_000_000_000u32.into(); + balance = balance * balance; + ::Currency::make_free_balance_be(&owner, balance); + ForeignAssets::::register_foreign_asset(origin.clone().into(), owner, Box::new(location.clone()), Box::new(metadata))?; + + }: { + ForeignAssets::::update_foreign_asset(origin.into(), 0, Box::new(location), Box::new(metadata2))? + } +} diff --git a/pallets/foreign-assets/src/lib.rs b/pallets/foreign-assets/src/lib.rs index fc9eac1d65..f9933793c6 100644 --- a/pallets/foreign-assets/src/lib.rs +++ b/pallets/foreign-assets/src/lib.rs @@ -124,6 +124,9 @@ pub type CurrencyId = AssetIds; mod impl_fungibles; mod weights; +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; + pub use module::*; pub use weights::WeightInfo; @@ -303,7 +306,7 @@ pub mod module { let data: CreateCollectionData = CreateCollectionData { name: name.try_into().unwrap(), description: description.try_into().unwrap(), - mode: CollectionMode::Fungible(18), + mode: CollectionMode::Fungible(md.decimals), ..Default::default() }; diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index 33bebf4d1e..a2ced6a23c 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -653,6 +653,10 @@ macro_rules! impl_common_runtime_apis { #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] list_benchmark!(list, extra, pallet_proxy_rmrk_equip, RmrkEquip); + #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] + list_benchmark!(list, extra, pallet_foreign_assets, ForeignAssets); + + // list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate); let storage_info = AllPalletsReversedWithSystemFirst::storage_info(); @@ -708,6 +712,9 @@ macro_rules! impl_common_runtime_apis { #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] add_benchmark!(params, batches, pallet_proxy_rmrk_equip, RmrkEquip); + #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] + add_benchmark!(params, batches, pallet_foreign_assets, ForeignAssets); + // add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 1bd64324f7..4856631912 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -35,6 +35,7 @@ runtime-benchmarks = [ 'pallet-nonfungible/runtime-benchmarks', 'pallet-proxy-rmrk-core/runtime-benchmarks', 'pallet-proxy-rmrk-equip/runtime-benchmarks', + 'pallet-foreign-assets/runtime-benchmarks', 'pallet-unique/runtime-benchmarks', 'pallet-inflation/runtime-benchmarks', 'pallet-unique-scheduler/runtime-benchmarks', diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 490da10319..feccecbe9b 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -36,6 +36,7 @@ runtime-benchmarks = [ 'pallet-proxy-rmrk-core/runtime-benchmarks', 'pallet-proxy-rmrk-equip/runtime-benchmarks', 'pallet-unique/runtime-benchmarks', + 'pallet-foreign-assets/runtime-benchmarks', 'pallet-inflation/runtime-benchmarks', 'pallet-unique-scheduler/runtime-benchmarks', 'pallet-xcm/runtime-benchmarks', diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index d52b7a5b7d..8ef5db54e9 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -36,6 +36,7 @@ runtime-benchmarks = [ 'pallet-proxy-rmrk-core/runtime-benchmarks', 'pallet-proxy-rmrk-equip/runtime-benchmarks', 'pallet-unique/runtime-benchmarks', + 'pallet-foreign-assets/runtime-benchmarks', 'pallet-inflation/runtime-benchmarks', 'pallet-unique-scheduler/runtime-benchmarks', 'pallet-xcm/runtime-benchmarks', From 8ab1370518c05bf1c78f805265c16c7d3a0594f7 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Tue, 13 Sep 2022 13:38:15 +0700 Subject: [PATCH 0852/1274] fix typos , teminology --- pallets/app-promotion/src/lib.rs | 54 ++++++++++++++---------------- pallets/app-promotion/src/types.rs | 12 +++---- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 7cef751c7a..a99ff88d61 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -116,10 +116,10 @@ pub mod pallet { /// Type for interacting with conrtacts type ContractHandler: ContractHandler; - /// ID for treasury + /// `AccountId` for treasury type TreasuryAccountId: Get; - /// The app's pallet id, used for deriving its sovereign account ID. + /// The app's pallet id, used for deriving its sovereign account address. #[pallet::constant] type PalletId: Get; @@ -159,7 +159,7 @@ pub mod pallet { /// Staking recalculation was performed /// /// # Arguments - /// * AccountId: ID of the staker. + /// * AccountId: account of the staker. /// * Balance : recalculation base /// * Balance : total income StakingRecalculation( @@ -174,21 +174,21 @@ pub mod pallet { /// Staking was performed /// /// # Arguments - /// * AccountId: ID of the staker + /// * AccountId: account of the staker /// * Balance : staking amount Stake(T::AccountId, BalanceOf), /// Unstaking was performed /// /// # Arguments - /// * AccountId: ID of the staker + /// * AccountId: account of the staker /// * Balance : unstaking amount Unstake(T::AccountId, BalanceOf), /// The admin was set /// /// # Arguments - /// * AccountId: ID of the admin + /// * AccountId: account address of the admin SetAdmin(T::AccountId), } @@ -212,13 +212,13 @@ pub mod pallet { #[pallet::storage] pub type TotalStaked = StorageValue, QueryKind = ValueQuery>; - /// Stores the `admin` ID. Some extrinsics can only be executed if they were signed by `admin`. + /// Stores the `admin` account. Some extrinsics can only be executed if they were signed by `admin`. #[pallet::storage] pub type Admin = StorageValue; /// Stores the amount of tokens staked by account in the blocknumber. /// - /// * **Key1** - Staker ID. + /// * **Key1** - Staker account. /// * **Key2** - Relay block number when the stake was made. /// * **(Balance, BlockNumber)** - Balance of the stake. /// The number of the relay block in which we must perform the interest recalculation @@ -234,7 +234,7 @@ pub mod pallet { /// Stores amount of stakes for an `Account`. /// - /// * **Key** - Staker ID. + /// * **Key** - Staker account. /// * **Value** - Amount of stakes. #[pallet::storage] pub type StakesPerAccount = @@ -242,7 +242,7 @@ pub mod pallet { /// Stores amount of stakes for an `Account`. /// - /// * **Key** - Staker ID. + /// * **Key** - Staker account. /// * **Value** - Amount of stakes. #[pallet::storage] pub type PendingUnstake = StorageMap< @@ -296,7 +296,7 @@ pub mod pallet { /// /// # Arguments /// - /// * `admin`: ID of the new admin. + /// * `admin`: account of the new admin. #[pallet::weight(T::WeightInfo::set_admin_address())] pub fn set_admin_address(origin: OriginFor, admin: T::CrossAccountId) -> DispatchResult { ensure_root(origin)?; @@ -332,7 +332,7 @@ pub mod pallet { let balance = <::Currency as Currency>::free_balance(&staker_id); - // cheks that we can lock `amount` on the `staker` account. + // checks that we can lock `amount` on the `staker` account. <::Currency as Currency>::ensure_can_withdraw( &staker_id, amount, @@ -498,7 +498,7 @@ pub mod pallet { /// /// # Arguments /// - /// * `contract_id`: ID of the contract that will be sponsored by `pallet_id` + /// * `contract_id`: the contract address that will be sponsored by `pallet_id` #[pallet::weight(T::WeightInfo::sponsor_contract())] pub fn sponsor_contract(admin: OriginFor, contract_id: H160) -> DispatchResult { let admin_id = ensure_signed(admin)?; @@ -524,7 +524,7 @@ pub mod pallet { /// /// # Arguments /// - /// * `contract_id`: ID of the contract that is sponsored by `pallet_id` + /// * `contract_id`: the contract address that is sponsored by `pallet_id` #[pallet::weight(T::WeightInfo::stop_sponsoring_contract())] pub fn stop_sponsoring_contract(admin: OriginFor, contract_id: H160) -> DispatchResult { let admin_id = ensure_signed(admin)?; @@ -584,7 +584,7 @@ pub mod pallet { let income_acc = RefCell::new(BalanceOf::::default()); let amount_acc = RefCell::new(BalanceOf::::default()); - // this closure is uded to perform some of the actions if we break the loop because we reached the number of stakers for recalculation, + // this closure is used to perform some of the actions if we break the loop because we reached the number of stakers for recalculation, // but there were unrecalculated records in the storage. let flush_stake = || -> DispatchResult { if let Some(last_id) = &*last_id.borrow() { @@ -654,7 +654,7 @@ pub mod pallet { } impl Pallet { - /// The account ID of the app promotion pot. + /// The account address of the app promotion pot. /// /// This actually does computation. If you need to keep using it, then make sure you cache the /// value and only call this once. @@ -664,7 +664,7 @@ impl Pallet { /// Unlocks the balance that was locked by the pallet. /// - /// - `staker`: staker ID. + /// - `staker`: staker account. /// - `amount`: amount of unlocked funds. fn unlock_balance(staker: &T::AccountId, amount: BalanceOf) -> DispatchResult { let locked_balance = Self::get_locked_balance(staker) @@ -684,7 +684,7 @@ impl Pallet { /// Adds the balance to locked by the pallet. /// - /// - `staker`: staker ID. + /// - `staker`: staker account. /// - `amount`: amount of added locked funds. fn add_lock_balance(staker: &T::AccountId, amount: BalanceOf) -> DispatchResult { Self::get_locked_balance(staker) @@ -696,7 +696,7 @@ impl Pallet { /// Sets the new state of a balance locked by the pallet. /// - /// - `staker`: staker ID. + /// - `staker`: staker account. /// - `amount`: amount of locked funds. fn set_lock_unchecked(staker: &T::AccountId, amount: BalanceOf) { if amount.is_zero() { @@ -713,7 +713,7 @@ impl Pallet { /// Returns the balance locked by the pallet for the staker. /// - /// - `staker`: staker ID. + /// - `staker`: staker account. pub fn get_locked_balance( staker: impl EncodeLike, ) -> Option>> { @@ -724,7 +724,7 @@ impl Pallet { /// Returns the total staked balance for the staker. /// - /// - `staker`: staker ID. + /// - `staker`: staker account. pub fn total_staked_by_id(staker: impl EncodeLike) -> Option> { let staked = Staked::::iter_prefix((staker,)) .into_iter() @@ -741,7 +741,7 @@ impl Pallet { /// Returns all relay block numbers when stake was made, /// the amount of the stake. /// - /// - `staker`: staker ID. + /// - `staker`: staker account. pub fn total_staked_by_id_per_block( staker: impl EncodeLike, ) -> Option)>> { @@ -759,9 +759,8 @@ impl Pallet { /// Returns the total staked balance for the staker. /// If `staker` is `None`, returns the total amount staked. - /// - `staker`: staker ID. + /// - `staker`: staker account. /// - /// **Note**: This `fn` has been added to implement RPC pub fn cross_id_total_staked(staker: Option) -> Option> { staker.map_or(Some(>::get()), |s| { Self::total_staked_by_id(s.as_sub()) @@ -777,9 +776,8 @@ impl Pallet { /// Returns all relay block numbers when stake was made, /// the amount of the stake. /// - /// - `staker`: staker ID. + /// - `staker`: staker account. /// - /// **Note**: This `fn` has been added to implement RPC pub fn cross_id_total_staked_per_block( staker: T::CrossAccountId, ) -> Vec<(T::BlockNumber, BalanceOf)> { @@ -829,7 +827,7 @@ where /// Returns the amount reserved by the pending. /// If `staker` is `None`, returns the total pending. /// - /// -`staker`: staker ID. + /// -`staker`: staker account. /// /// Since user funds are not transferred anywhere by staking, overflow protection is provided /// at the level of the associated type `Balance` of `Currency` trait. In order to overflow, @@ -859,7 +857,7 @@ where /// Returns all parachain block numbers when unreserve is expected, /// the amount of the unreserved funds. /// - /// - `staker`: staker ID. + /// - `staker`: staker account. /// /// **Note**: This `fn` has been added to implement RPC pub fn cross_id_pending_unstake_per_block( diff --git a/pallets/app-promotion/src/types.rs b/pallets/app-promotion/src/types.rs index 96acb91a70..37029d0988 100644 --- a/pallets/app-promotion/src/types.rs +++ b/pallets/app-promotion/src/types.rs @@ -12,7 +12,7 @@ use pallet_evm_contract_helpers::{Pallet as EvmHelpersPallet, Config as EvmHelpe /// This trait was defined because `LockableCurrency` /// has no way to know the state of the lock for an account. pub trait ExtendedLockableCurrency: LockableCurrency { - /// Returns lock balance for ID. Allows to determine the cause of the lock. + /// Returns lock balance for an account. Allows to determine the cause of the lock. fn locks(who: KArg) -> WeakBoundedVec, Self::MaxLocks> where KArg: EncodeLike; @@ -35,7 +35,7 @@ pub trait CollectionHandler { /// Sets sponsor for a collection. /// - /// - `sponsor_id`: ID of the account of the sponsor-to-be. + /// - `sponsor_id`: the account of the sponsor-to-be. /// - `collection_id`: ID of the modified collection. fn set_sponsor( sponsor_id: Self::AccountId, @@ -86,8 +86,8 @@ pub trait ContractHandler { /// Sets sponsor for a contract. /// - /// - `sponsor_id`: ID of the account of the sponsor-to-be. - /// - `contract_address`: ID of the modified contract. + /// - `sponsor_id`: the account of the sponsor-to-be. + /// - `contract_address`: the address of the modified contract. fn set_sponsor( sponsor_id: Self::AccountId, contract_address: Self::ContractId, @@ -95,12 +95,12 @@ pub trait ContractHandler { /// Removes sponsor for a contract. /// - /// - `contract_address`: ID of the modified contract. + /// - `contract_address`: the address of the modified contract. fn remove_contract_sponsor(contract_address: Self::ContractId) -> DispatchResult; /// Retuns the current sponsor for a contract if one is set. /// - /// - `contract_address`: ID of the contract. + /// - `contract_address`: the contract address. fn sponsor( contract_address: Self::ContractId, ) -> Result, DispatchError>; From 9424634ab7eddccca9e13986e5da9a7db130c6c6 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Tue, 13 Sep 2022 07:16:51 +0000 Subject: [PATCH 0853/1274] test(approve): fix with updated playgrounds --- tests/src/approve.test.ts | 779 +++++++++++++++++--------------------- 1 file changed, 346 insertions(+), 433 deletions(-) diff --git a/tests/src/approve.test.ts b/tests/src/approve.test.ts index 59be3a3d31..9c8eceac98 100644 --- a/tests/src/approve.test.ts +++ b/tests/src/approve.test.ts @@ -15,26 +15,8 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import { - approveExpectFail, - approveExpectSuccess, - createCollectionExpectSuccess, - createItemExpectSuccess, -} from './util/helpers'; -import {usingPlaygrounds} from './util/playgrounds'; - -let donor: IKeyringPair; - -before(async () => { - await usingPlaygrounds(async (_, privateKey) => { - donor = privateKey('//Alice'); - }); -}); +import {expect, itSub, Pallets, usingPlaygrounds} from './util/playgrounds'; -chai.use(chaiAsPromised); -const expect = chai.expect; describe('Integration Test approve(spender, collection_id, item_id, amount):', () => { let alice: IKeyringPair; @@ -42,89 +24,76 @@ describe('Integration Test approve(spender, collection_id, item_id, amount):', ( let charlie: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); - it('[nft] Execute the extrinsic and check approvedList', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); - expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true; - }); + itSub('[nft] Execute the extrinsic and check approvedList', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true; }); - it('[fungible] Execute the extrinsic and check approvedList', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - await helper.ft.mintTokens(alice, collectionId, alice.address, 10n); - const tokenId = await helper.ft.getLastTokenId(collectionId); - await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); - const amount = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - expect(amount).to.be.equal(BigInt(1)); - }); + itSub('[fungible] Execute the extrinsic and check approvedList', async ({helper}) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, 10n, {Substrate: alice.address}); + const tokenId = await helper.ft.getLastTokenId(collectionId); + await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + const amount = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amount).to.be.equal(BigInt(1)); }); - it('[refungible] Execute the extrinsic and check approvedList', async function() { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); - await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); - const amount = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - expect(amount).to.be.equal(BigInt(1)); - }); + itSub.ifWithPallets('[refungible] Execute the extrinsic and check approvedList', [Pallets.ReFungible], async ({helper}) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); + await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + const amount = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amount).to.be.equal(BigInt(1)); }); - it('[nft] Remove approval by using 0 amount', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const collectionId = collection.collectionId; - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); - expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true; - await helper.signTransaction(alice, helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0)); - expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.false; - }); + itSub('[nft] Remove approval by using 0 amount', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const collectionId = collection.collectionId; + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true; + await helper.signTransaction(alice, helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0)); + expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.false; }); - it('[fungible] Remove approval by using 0 amount', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - await helper.ft.mintTokens(alice, collectionId, alice.address, 10n); - const tokenId = await helper.ft.getLastTokenId(collectionId); - await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); - const amountBefore = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - expect(amountBefore).to.be.equal(BigInt(1)); + itSub('[fungible] Remove approval by using 0 amount', async ({helper}) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, 10n, {Substrate: alice.address}); + const tokenId = await helper.ft.getLastTokenId(collectionId); + await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + const amountBefore = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountBefore).to.be.equal(BigInt(1)); - await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 0n); - const amountAfter = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - expect(amountAfter).to.be.equal(BigInt(0)); - }); + await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 0n); + const amountAfter = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountAfter).to.be.equal(BigInt(0)); }); - it('[refungible] Remove approval by using 0 amount', async function() { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); - await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); - const amountBefore = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - expect(amountBefore).to.be.equal(BigInt(1)); + itSub.ifWithPallets('[refungible] Remove approval by using 0 amount', [Pallets.ReFungible], async ({helper}) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); + await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + const amountBefore = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountBefore).to.be.equal(BigInt(1)); - await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 0n); - const amountAfter = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - expect(amountAfter).to.be.equal(BigInt(0)); - }); + await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 0n); + const amountAfter = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountAfter).to.be.equal(BigInt(0)); }); - it('can`t be called by collection owner on non-owned item when OwnerCanTransfer == false', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); - const approveTokenTx = async () => helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - await expect(approveTokenTx()).to.be.rejected; - }); + itSub('can`t be called by collection owner on non-owned item when OwnerCanTransfer == false', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + const approveTokenTx = async () => helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + await expect(approveTokenTx()).to.be.rejected; }); }); @@ -134,39 +103,34 @@ describe('Normal user can approve other users to transfer:', () => { let charlie: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); - it('NFT', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); - await helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); - expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: charlie.address})).to.be.true; - }); + itSub('NFT', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + await helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: charlie.address})).to.be.true; }); - it('Fungible up to an approved amount', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - await helper.ft.mintTokens(alice, collectionId, bob.address, 10n); - const tokenId = await helper.ft.getLastTokenId(collectionId); - await helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); - const amount = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: charlie.address}, {Substrate: bob.address}); - expect(amount).to.be.equal(BigInt(1)); - }); + itSub('Fungible up to an approved amount', async ({helper}) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, 10n, bob.address); + const tokenId = await helper.ft.getLastTokenId(collectionId); + await helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + const amount = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: charlie.address}, {Substrate: bob.address}); + expect(amount).to.be.equal(BigInt(1)); }); - it('ReFungible up to an approved amount', async function() { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: bob.address, pieces: 100n}); - await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}, 100n); - const amount = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: charlie.address}, {Substrate: bob.address}); - expect(amount).to.be.equal(BigInt(100n)); - }); + itSub.ifWithPallets('ReFungible up to an approved amount', [Pallets.ReFungible], async ({helper}) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: bob.address, pieces: 100n}); + await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}, 100n); + const amount = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: charlie.address}, {Substrate: bob.address}); + expect(amount).to.be.equal(BigInt(100n)); }); }); @@ -176,45 +140,40 @@ describe('Approved users can transferFrom up to approved amount:', () => { let charlie: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); - it('NFT', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); - await helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); - await helper.nft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - const owner = await helper.nft.getTokenOwner(collectionId, tokenId); - expect(owner.Substrate).to.be.equal(alice.address); - }); + itSub('NFT', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + await helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + await helper.nft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(alice.address); }); - it('Fungible up to an approved amount', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - await helper.ft.mintTokens(alice, collectionId, bob.address, 10n); - const tokenId = await helper.ft.getLastTokenId(collectionId); - await helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); - const before = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); - await helper.ft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 1n); - const after = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); - expect(after - before).to.be.equal(BigInt(1)); - }); + itSub('Fungible up to an approved amount', async ({helper}) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, 10n, bob.address); + const tokenId = await helper.ft.getLastTokenId(collectionId); + await helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + const before = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); + await helper.ft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 1n); + const after = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); + expect(after - before).to.be.equal(BigInt(1)); }); - it('ReFungible up to an approved amount', async function() { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: bob.address, pieces: 100n}); - await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); - const before = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); - await helper.rft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 1n); - const after = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); - expect(after - before).to.be.equal(BigInt(1)); - }); + itSub.ifWithPallets('ReFungible up to an approved amount', [Pallets.ReFungible], async ({helper}) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: bob.address, pieces: 100n}); + await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + const before = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); + await helper.rft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 1n); + const after = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); + expect(after - before).to.be.equal(BigInt(1)); }); }); @@ -224,52 +183,47 @@ describe('Approved users cannot use transferFrom to repeat transfers if approved let charlie: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); - it('NFT', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); - await helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); - await helper.nft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - const owner = await helper.nft.getTokenOwner(collectionId, tokenId); - expect(owner.Substrate).to.be.equal(alice.address); - const transferTokenFromTx = async () => helper.nft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - await expect(transferTokenFromTx()).to.be.rejected; - }); + itSub('NFT', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + await helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + await helper.nft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(alice.address); + const transferTokenFromTx = async () => helper.nft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + await expect(transferTokenFromTx()).to.be.rejected; }); - it('Fungible up to an approved amount', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - await helper.ft.mintTokens(alice, collectionId, bob.address, 10n); - const tokenId = await helper.ft.getLastTokenId(collectionId); - await helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); - const before = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); - await helper.ft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 1n); - const after = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); - expect(after - before).to.be.equal(BigInt(1)); + itSub('Fungible up to an approved amount', async ({helper}) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, 10n, bob.address); + const tokenId = await helper.ft.getLastTokenId(collectionId); + await helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + const before = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); + await helper.ft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 1n); + const after = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); + expect(after - before).to.be.equal(BigInt(1)); - const transferTokenFromTx = async () => helper.ft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 1n); - await expect(transferTokenFromTx()).to.be.rejected; - }); + const transferTokenFromTx = async () => helper.ft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 1n); + await expect(transferTokenFromTx()).to.be.rejected; }); - it('ReFungible up to an approved amount', async function() { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: bob.address, pieces: 100n}); - await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}, 100n); - const before = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); - await helper.rft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 100n); - const after = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); - expect(after - before).to.be.equal(BigInt(100)); - const transferTokenFromTx = async () => helper.rft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 100n); - await expect(transferTokenFromTx()).to.be.rejected; - }); + itSub.ifWithPallets('ReFungible up to an approved amount', [Pallets.ReFungible], async ({helper}) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: bob.address, pieces: 100n}); + await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}, 100n); + const before = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); + await helper.rft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 100n); + const after = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); + expect(after - before).to.be.equal(BigInt(100)); + const transferTokenFromTx = async () => helper.rft.transferTokenFrom(charlie, collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}, 100n); + await expect(transferTokenFromTx()).to.be.rejected; }); }); @@ -280,28 +234,27 @@ describe('Approved amount decreases by the transferred amount.:', () => { let dave: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob, charlie, dave] = await helper.arrange.createAccounts([100n, 100n, 100n, 100n], donor); }); }); - it('If a user B is approved to transfer 10 Fungible tokens from user A, they can transfer 2 tokens to user C, which will result in decreasing approval from 10 to 8. Then user B can transfer 8 tokens to user D.', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - await helper.ft.mintTokens(alice, collectionId, alice.address, 10n); - const tokenId = await helper.ft.getLastTokenId(collectionId); - await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 10n); + itSub('If a user B is approved to transfer 10 Fungible tokens from user A, they can transfer 2 tokens to user C, which will result in decreasing approval from 10 to 8. Then user B can transfer 8 tokens to user D.', async ({helper}) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, 10n, alice.address); + const tokenId = await helper.ft.getLastTokenId(collectionId); + await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 10n); - const charlieBefore = await helper.ft.getBalance(collectionId, {Substrate: charlie.address}); - await helper.ft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address}, 2n); - const charlieAfter = await helper.ft.getBalance(collectionId, {Substrate: charlie.address}); - expect(charlieAfter - charlieBefore).to.be.equal(BigInt(2)); + const charlieBefore = await helper.ft.getBalance(collectionId, {Substrate: charlie.address}); + await helper.ft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address}, 2n); + const charlieAfter = await helper.ft.getBalance(collectionId, {Substrate: charlie.address}); + expect(charlieAfter - charlieBefore).to.be.equal(BigInt(2)); - const daveBefore = await helper.ft.getBalance(collectionId, {Substrate: dave.address}); - await helper.ft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: alice.address}, {Substrate: dave.address}, 8n); - const daveAfter = await helper.ft.getBalance(collectionId, {Substrate: dave.address}); - expect(daveAfter - daveBefore).to.be.equal(BigInt(8)); - }); + const daveBefore = await helper.ft.getBalance(collectionId, {Substrate: dave.address}); + await helper.ft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: alice.address}, {Substrate: dave.address}, 8n); + const daveAfter = await helper.ft.getBalance(collectionId, {Substrate: dave.address}); + expect(daveAfter - daveBefore).to.be.equal(BigInt(8)); }); }); @@ -311,57 +264,52 @@ describe('User may clear the approvals to approving for 0 amount:', () => { let charlie: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); - it('NFT', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); - expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true; - await helper.signTransaction(alice, helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0)); - expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.false; - const transferTokenFromTx = async () => helper.nft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: bob.address}, {Substrate: bob.address}); - await expect(transferTokenFromTx()).to.be.rejected; - }); + itSub('NFT', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true; + await helper.signTransaction(alice, helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0)); + expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.false; + const transferTokenFromTx = async () => helper.nft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: bob.address}, {Substrate: bob.address}); + await expect(transferTokenFromTx()).to.be.rejected; }); - it('Fungible', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - await helper.ft.mintTokens(alice, collectionId, alice.address, 10n); - const tokenId = await helper.ft.getLastTokenId(collectionId); - await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); - const amountBefore = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - expect(amountBefore).to.be.equal(BigInt(1)); + itSub('Fungible', async ({helper}) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, 10n, alice.address); + const tokenId = await helper.ft.getLastTokenId(collectionId); + await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + const amountBefore = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountBefore).to.be.equal(BigInt(1)); - await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 0n); - const amountAfter = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - expect(amountAfter).to.be.equal(BigInt(0)); + await helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 0n); + const amountAfter = await helper.ft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountAfter).to.be.equal(BigInt(0)); - const transferTokenFromTx = async () => helper.ft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: bob.address}, {Substrate: charlie.address}, 1n); - await expect(transferTokenFromTx()).to.be.rejected; - }); + const transferTokenFromTx = async () => helper.ft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: bob.address}, {Substrate: charlie.address}, 1n); + await expect(transferTokenFromTx()).to.be.rejected; }); - it('ReFungible', async function() { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); - await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); - const amountBefore = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - expect(amountBefore).to.be.equal(BigInt(1)); + itSub.ifWithPallets('ReFungible', [Pallets.ReFungible], async ({helper}) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); + await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + const amountBefore = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountBefore).to.be.equal(BigInt(1)); - await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 0n); - const amountAfter = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); - expect(amountAfter).to.be.equal(BigInt(0)); + await helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 0n); + const amountAfter = await helper.rft.getTokenApprovedPieces(collectionId, tokenId, {Substrate: bob.address}, {Substrate: alice.address}); + expect(amountAfter).to.be.equal(BigInt(0)); - const transferTokenFromTx = async () => helper.rft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: bob.address}, {Substrate: charlie.address}, 100n); - await expect(transferTokenFromTx()).to.be.rejected; - }); + const transferTokenFromTx = async () => helper.rft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: bob.address}, {Substrate: charlie.address}, 100n); + await expect(transferTokenFromTx()).to.be.rejected; }); }); @@ -371,38 +319,33 @@ describe('User cannot approve for the amount greater than they own:', () => { let charlie: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); - it('1 for NFT', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); - const approveTx = async () => helper.signTransaction(bob, helper.api?.tx.unique.approve({Substrate: charlie.address}, collectionId, tokenId, 2)); - await expect(approveTx()).to.be.rejected; - expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: charlie.address})).to.be.false; - }); + itSub('1 for NFT', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + const approveTx = async () => helper.signTransaction(bob, helper.api?.tx.unique.approve({Substrate: charlie.address}, collectionId, tokenId, 2)); + await expect(approveTx()).to.be.rejected; + expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: charlie.address})).to.be.false; }); - it('Fungible', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - await helper.ft.mintTokens(alice, collectionId, alice.address, 10n); - const tokenId = await helper.ft.getLastTokenId(collectionId); - const approveTx = async () => helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 11n); - await expect(approveTx()).to.be.rejected; - }); + itSub('Fungible', async ({helper}) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.ft.mintTokens(alice, collectionId, 10n, alice.address); + const tokenId = await helper.ft.getLastTokenId(collectionId); + const approveTx = async () => helper.ft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 11n); + await expect(approveTx()).to.be.rejected; }); - it('ReFungible', async function() { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); - const approveTx = async () => helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 101n); - await expect(approveTx()).to.be.rejected; - }); + itSub.ifWithPallets('ReFungible', [Pallets.ReFungible], async ({helper}) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); + const approveTx = async () => helper.rft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}, 101n); + await expect(approveTx()).to.be.rejected; }); }); @@ -413,67 +356,62 @@ describe('Administrator and collection owner do not need approval in order to ex let dave: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob, charlie, dave] = await helper.arrange.createAccounts([100n, 100n, 100n, 100n], donor); }); }); - it('NFT', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: charlie.address}); + itSub('NFT', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: charlie.address}); - await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: charlie.address}, {Substrate: dave.address}); - const owner1 = await helper.nft.getTokenOwner(collectionId, tokenId); - expect(owner1.Substrate).to.be.equal(dave.address); + await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: charlie.address}, {Substrate: dave.address}); + const owner1 = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner1.Substrate).to.be.equal(dave.address); - await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); - await helper.nft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: dave.address}, {Substrate: alice.address}); - const owner2 = await helper.nft.getTokenOwner(collectionId, tokenId); - expect(owner2.Substrate).to.be.equal(alice.address); - }); + await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); + await helper.nft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: dave.address}, {Substrate: alice.address}); + const owner2 = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner2.Substrate).to.be.equal(alice.address); }); - it('Fungible up to an approved amount', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); - await helper.ft.mintTokens(alice, collectionId, charlie.address, 10n); - const tokenId = await helper.ft.getLastTokenId(collectionId); + itSub('Fungible up to an approved amount', async ({helper}) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); + await helper.ft.mintTokens(alice, collectionId, 10n, charlie.address); + const tokenId = await helper.ft.getLastTokenId(collectionId); - const daveBalanceBefore = await helper.ft.getBalance(collectionId, {Substrate: dave.address}); - await helper.ft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: charlie.address}, {Substrate: dave.address}, 1n); - const daveBalanceAfter = await helper.ft.getBalance(collectionId, {Substrate: dave.address}); - expect(daveBalanceAfter - daveBalanceBefore).to.be.equal(BigInt(1)); + const daveBalanceBefore = await helper.ft.getBalance(collectionId, {Substrate: dave.address}); + await helper.ft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: charlie.address}, {Substrate: dave.address}, 1n); + const daveBalanceAfter = await helper.ft.getBalance(collectionId, {Substrate: dave.address}); + expect(daveBalanceAfter - daveBalanceBefore).to.be.equal(BigInt(1)); - await helper.collection.addAdmin(alice ,collectionId, {Substrate: bob.address}); + await helper.collection.addAdmin(alice ,collectionId, {Substrate: bob.address}); - const aliceBalanceBefore = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); - await helper.ft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: dave.address}, {Substrate: alice.address}, 1n); - const aliceBalanceAfter = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); - expect(aliceBalanceAfter - aliceBalanceBefore).to.be.equal(BigInt(1)); - }); + const aliceBalanceBefore = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); + await helper.ft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: dave.address}, {Substrate: alice.address}, 1n); + const aliceBalanceAfter = await helper.ft.getBalance(collectionId, {Substrate: alice.address}); + expect(aliceBalanceAfter - aliceBalanceBefore).to.be.equal(BigInt(1)); }); - it('ReFungible up to an approved amount', async function() { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); - const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: charlie.address, pieces: 100n}); + itSub.ifWithPallets('ReFungible up to an approved amount', [Pallets.ReFungible], async ({helper}) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: charlie.address, pieces: 100n}); - const daveBefore = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: dave.address}); - await helper.rft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: charlie.address}, {Substrate: dave.address}, 1n); - const daveAfter = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: dave.address}); - expect(daveAfter - daveBefore).to.be.equal(BigInt(1)); + const daveBefore = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: dave.address}); + await helper.rft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: charlie.address}, {Substrate: dave.address}, 1n); + const daveAfter = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: dave.address}); + expect(daveAfter - daveBefore).to.be.equal(BigInt(1)); - await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); + await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); - const aliceBefore = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); - await helper.rft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: dave.address}, {Substrate: alice.address}, 1n); - const aliceAfter = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); - expect(aliceAfter - aliceBefore).to.be.equal(BigInt(1)); - }); + const aliceBefore = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); + await helper.rft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: dave.address}, {Substrate: alice.address}, 1n); + const aliceAfter = await helper.rft.getTokenBalance(collectionId, tokenId, {Substrate: alice.address}); + expect(aliceAfter - aliceBefore).to.be.equal(BigInt(1)); }); }); @@ -484,45 +422,48 @@ describe('Repeated approvals add up', () => { let dave: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob, charlie, dave] = await helper.arrange.createAccounts([100n, 100n, 100n, 100n], donor); }); }); - it.skip('Owned 10, approval 1: 1, approval 2: 1, resulting approved value: 2. Fungible', async () => { - const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}}); - await createItemExpectSuccess(alice, collectionId, 'Fungible', alice.address); - await approveExpectSuccess(collectionId, 0, alice, bob.address, 1); - await approveExpectSuccess(collectionId, 0, alice, charlie.address, 1); + itSub.skip('Owned 10, approval 1: 1, approval 2: 1, resulting approved value: 2. Fungible', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {}); + await collection.mint(alice, 10n); + await collection.approveTokens(alice, {Substrate: bob.address}, 1n); + await collection.approveTokens(alice, {Substrate: charlie.address}, 1n); // const allowances1 = await getAllowance(collectionId, 0, Alice.address, Bob.address); // const allowances2 = await getAllowance(collectionId, 0, Alice.address, Charlie.address); // expect(allowances1 + allowances2).to.be.eq(BigInt(2)); }); - it.skip('Owned 10, approval 1: 1, approval 2: 1, resulting approved value: 2. ReFungible', async () => { - const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}}); - const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', alice.address); - await approveExpectSuccess(collectionId, itemId, alice, bob.address, 1); - await approveExpectSuccess(collectionId, itemId, alice, charlie.address, 1); + itSub.skip('Owned 10, approval 1: 1, approval 2: 1, resulting approved value: 2. ReFungible', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {}); + const token = await collection.mintToken(alice, 10n); + await token.approve(alice, {Substrate: bob.address}, 1n); + await token.approve(alice, {Substrate: charlie.address}, 1n); // const allowances1 = await getAllowance(collectionId, itemId, Alice.address, Bob.address); // const allowances2 = await getAllowance(collectionId, itemId, Alice.address, Charlie.address); // expect(allowances1 + allowances2).to.be.eq(BigInt(2)); }); // Canceled by changing approve logic - it.skip('Cannot approve for more than total user`s amount (owned: 10, approval 1: 5 - should succeed, approval 2: 6 - should fail). Fungible', async () => { - const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}}); - await createItemExpectSuccess(alice, collectionId, 'Fungible', dave.address); - await approveExpectSuccess(collectionId, 0, dave, bob.address, 5); - await approveExpectFail(collectionId, 0, dave, charlie, 6); + itSub.skip('Cannot approve for more than total user\'s amount (owned: 10, approval 1: 5 - should succeed, approval 2: 6 - should fail). Fungible', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {}); + await collection.mint(alice, 10n, {Substrate: dave.address}); + await collection.approveTokens(dave, {Substrate: bob.address}, 5n); + await expect(collection.approveTokens(dave, {Substrate: charlie.address}, 6n)) + .to.be.rejectedWith('this test would fail (since it is skipped), replace this expecting message with what would have been received'); }); // Canceled by changing approve logic - it.skip('Cannot approve for more than total users amount (owned: 100, approval 1: 50 - should succeed, approval 2: 51 - should fail). ReFungible', async () => { - const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}}); - const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', dave.address); - await approveExpectSuccess(collectionId, itemId, dave, bob.address, 50); - await approveExpectFail(collectionId, itemId, dave, charlie, 51); + itSub.skip('Cannot approve for more than total user\'s amount (owned: 100, approval 1: 50 - should succeed, approval 2: 51 - should fail). ReFungible', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {}); + const token = await collection.mintToken(alice, 100n, {Substrate: dave.address}); + await token.approve(dave, {Substrate: bob.address}, 50n); + await expect(token.approve(dave, {Substrate: charlie.address}, 51n)) + .to.be.rejectedWith('this test would fail (since it is skipped), replace this expecting message with what would have been received'); }); }); @@ -532,19 +473,18 @@ describe('Integration Test approve(spender, collection_id, item_id, amount) with let charlie: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); - it('can be called by collection admin on non-owned item', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); - const approveTx = async () => helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); - await expect(approveTx()).to.be.rejected; - }); + itSub('can be called by collection admin on non-owned item', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); + const approveTx = async () => helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: charlie.address}); + await expect(approveTx()).to.be.rejected; }); }); @@ -554,139 +494,112 @@ describe('Negative Integration Test approve(spender, collection_id, item_id, amo let charlie: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); - it('[nft] Approve for a collection that does not exist', async () => { - await usingPlaygrounds(async (helper) => { - const collectionId = 1 << 32 - 1; - const approveTx = async () => helper.nft.approveToken(bob, collectionId, 1, {Substrate: charlie.address}); - await expect(approveTx()).to.be.rejected; - }); + itSub('[nft] Approve for a collection that does not exist', async ({helper}) => { + const collectionId = 1 << 32 - 1; + const approveTx = async () => helper.nft.approveToken(bob, collectionId, 1, {Substrate: charlie.address}); + await expect(approveTx()).to.be.rejected; }); - it('[fungible] Approve for a collection that does not exist', async () => { - await usingPlaygrounds(async (helper) => { - const collectionId = 1 << 32 - 1; - const approveTx = async () => helper.ft.approveToken(bob, collectionId, 1, {Substrate: charlie.address}); - await expect(approveTx()).to.be.rejected; - }); + itSub('[fungible] Approve for a collection that does not exist', async ({helper}) => { + const collectionId = 1 << 32 - 1; + const approveTx = async () => helper.ft.approveToken(bob, collectionId, 1, {Substrate: charlie.address}); + await expect(approveTx()).to.be.rejected; }); - it('[refungible] Approve for a collection that does not exist', async function() { - await usingPlaygrounds(async (helper) => { - const collectionId = 1 << 32 - 1; - const approveTx = async () => helper.rft.approveToken(bob, collectionId, 1, {Substrate: charlie.address}); - await expect(approveTx()).to.be.rejected; - }); + itSub.ifWithPallets('[refungible] Approve for a collection that does not exist', [Pallets.ReFungible], async ({helper}) => { + const collectionId = 1 << 32 - 1; + const approveTx = async () => helper.rft.approveToken(bob, collectionId, 1, {Substrate: charlie.address}); + await expect(approveTx()).to.be.rejected; }); - it('[nft] Approve for a collection that was destroyed', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.burn(alice, collectionId); - const approveTx = async () => helper.nft.approveToken(alice, collectionId, 1, {Substrate: bob.address}); - await expect(approveTx()).to.be.rejected; - }); + itSub('[nft] Approve for a collection that was destroyed', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.burn(alice, collectionId); + const approveTx = async () => helper.nft.approveToken(alice, collectionId, 1, {Substrate: bob.address}); + await expect(approveTx()).to.be.rejected; }); - it('[fungible] Approve for a collection that was destroyed', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.ft.burn(alice, collectionId); - const approveTx = async () => helper.ft.approveToken(alice, collectionId, 1, {Substrate: bob.address}); - await expect(approveTx()).to.be.rejected; - }); + itSub('[fungible] Approve for a collection that was destroyed', async ({helper}) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.ft.burn(alice, collectionId); + const approveTx = async () => helper.ft.approveToken(alice, collectionId, 1, {Substrate: bob.address}); + await expect(approveTx()).to.be.rejected; }); - it('[refungible] Approve for a collection that was destroyed', async function() { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.rft.burn(alice, collectionId); - const approveTx = async () => helper.rft.approveToken(alice, collectionId, 1, {Substrate: bob.address}); - await expect(approveTx()).to.be.rejected; - }); + itSub.ifWithPallets('[refungible] Approve for a collection that was destroyed', [Pallets.ReFungible], async ({helper}) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.rft.burn(alice, collectionId); + const approveTx = async () => helper.rft.approveToken(alice, collectionId, 1, {Substrate: bob.address}); + await expect(approveTx()).to.be.rejected; }); - - it('[nft] Approve transfer of a token that does not exist', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const approveTx = async () => helper.nft.approveToken(alice, collectionId, 2, {Substrate: bob.address}); - await expect(approveTx()).to.be.rejected; - }); + + itSub('[nft] Approve transfer of a token that does not exist', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const approveTx = async () => helper.nft.approveToken(alice, collectionId, 2, {Substrate: bob.address}); + await expect(approveTx()).to.be.rejected; }); - it('[refungible] Approve transfer of a token that does not exist', async function() { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const approveTx = async () => helper.rft.approveToken(alice, collectionId, 2, {Substrate: bob.address}); - await expect(approveTx()).to.be.rejected; - }); + itSub.ifWithPallets('[refungible] Approve transfer of a token that does not exist', [Pallets.ReFungible], async ({helper}) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const approveTx = async () => helper.rft.approveToken(alice, collectionId, 2, {Substrate: bob.address}); + await expect(approveTx()).to.be.rejected; }); - it('[nft] Approve using the address that does not own the approved token', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - const approveTx = async () => helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}); - await expect(approveTx()).to.be.rejected; - }); + itSub('[nft] Approve using the address that does not own the approved token', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + const approveTx = async () => helper.nft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}); + await expect(approveTx()).to.be.rejected; }); - it('[fungible] Approve using the address that does not own the approved token', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.ft.mintTokens(alice, collectionId, alice.address, 10n); - const tokenId = await helper.ft.getLastTokenId(collectionId); - const approveTx = async () => helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}); - await expect(approveTx()).to.be.rejected; - }); + itSub('[fungible] Approve using the address that does not own the approved token', async ({helper}) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.ft.mintTokens(alice, collectionId, 10n, alice.address); + const tokenId = await helper.ft.getLastTokenId(collectionId); + const approveTx = async () => helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}); + await expect(approveTx()).to.be.rejected; }); - it('[refungible] Approve using the address that does not own the approved token', async function() { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); - const approveTx = async () => helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}); - await expect(approveTx()).to.be.rejected; - }); + itSub.ifWithPallets('[refungible] Approve using the address that does not own the approved token', [Pallets.ReFungible], async ({helper}) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); + const approveTx = async () => helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}); + await expect(approveTx()).to.be.rejected; }); - it('should fail if approved more ReFungibles than owned', async function() { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); - await helper.rft.transferToken(alice, collectionId, tokenId, {Substrate: bob.address}, 100n); - await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, 100n); + itSub.ifWithPallets('should fail if approved more ReFungibles than owned', [Pallets.ReFungible], async ({helper}) => { + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.rft.mintToken(alice, {collectionId: collectionId, owner: alice.address, pieces: 100n}); + await helper.rft.transferToken(alice, collectionId, tokenId, {Substrate: bob.address}, 100n); + await helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, 100n); - const approveTx = async () => helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, 101n); - await expect(approveTx()).to.be.rejected; - }); + const approveTx = async () => helper.rft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, 101n); + await expect(approveTx()).to.be.rejected; }); - it('should fail if approved more Fungibles than owned', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.ft.mintTokens(alice, collectionId, alice.address, 10n); - const tokenId = await helper.ft.getLastTokenId(collectionId); + itSub('should fail if approved more Fungibles than owned', async ({helper}) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.ft.mintTokens(alice, collectionId, 10n, alice.address); + const tokenId = await helper.ft.getLastTokenId(collectionId); - await helper.ft.transferToken(alice, collectionId, tokenId, {Substrate: bob.address}, 10n); - await helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, 10n); - const approveTx = async () => helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, 11n); - await expect(approveTx()).to.be.rejected; - }); + await helper.ft.transferToken(alice, collectionId, tokenId, {Substrate: bob.address}, 10n); + await helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, 10n); + const approveTx = async () => helper.ft.approveToken(bob, collectionId, tokenId, {Substrate: alice.address}, 11n); + await expect(approveTx()).to.be.rejected; }); - it('fails when called by collection owner on non-owned item when OwnerCanTransfer == false', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); - await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: false}); + itSub('fails when called by collection owner on non-owned item when OwnerCanTransfer == false', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: false}); - const approveTx = async () => helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - await expect(approveTx()).to.be.rejected; - }); + const approveTx = async () => helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + await expect(approveTx()).to.be.rejected; }); }); From a94c6b63634a20f9267d0f31a6ccfd825e5fed5c Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 13 Sep 2022 07:37:27 +0000 Subject: [PATCH 0854/1274] feat: add sponsoring fee limit --- Cargo.lock | 154 ++++++++++----- client/rpc/Cargo.toml | 2 +- node/cli/Cargo.toml | 14 +- node/rpc/Cargo.toml | 14 +- pallets/common/Cargo.toml | 4 +- pallets/configuration/Cargo.toml | 2 +- pallets/evm-coder-substrate/Cargo.toml | 4 +- pallets/evm-contract-helpers/Cargo.toml | 6 +- pallets/evm-contract-helpers/src/eth.rs | 37 +++- pallets/evm-contract-helpers/src/lib.rs | 17 ++ .../src/stubs/ContractHelpers.sol | 24 +++ pallets/evm-migration/Cargo.toml | 4 +- pallets/evm-transaction-payment/Cargo.toml | 10 +- pallets/evm-transaction-payment/src/lib.rs | 31 ++- pallets/fungible/Cargo.toml | 2 +- pallets/nonfungible/Cargo.toml | 2 +- pallets/proxy-rmrk-core/Cargo.toml | 2 +- pallets/proxy-rmrk-equip/Cargo.toml | 2 +- pallets/refungible/Cargo.toml | 2 +- pallets/scheduler/Cargo.toml | 2 +- pallets/structure/Cargo.toml | 2 +- pallets/unique/Cargo.toml | 2 +- primitives/common/Cargo.toml | 4 +- primitives/data-structs/Cargo.toml | 2 +- primitives/rpc/Cargo.toml | 2 +- runtime/common/config/ethereum.rs | 7 +- runtime/common/config/sponsoring.rs | 1 + runtime/common/ethereum/sponsoring.rs | 8 +- runtime/common/runtime_apis.rs | 3 +- runtime/common/sponsoring.rs | 4 +- runtime/opal/Cargo.toml | 16 +- runtime/quartz/Cargo.toml | 16 +- runtime/tests/Cargo.toml | 8 +- runtime/unique/Cargo.toml | 16 +- tests/src/eth/api/ContractHelpers.sol | 12 ++ tests/src/eth/contractSponsoring.test.ts | 178 ++++++++++++++++++ tests/src/eth/util/contractHelpersAbi.json | 27 +++ 37 files changed, 501 insertions(+), 142 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6bf10da49c..9aee48998a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -117,7 +117,7 @@ name = "app-promotion-rpc" version = "0.1.0" dependencies = [ "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "parity-scale-codec 3.1.5", "sp-api", "sp-core", @@ -2324,7 +2324,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" dependencies = [ "async-trait", "fc-db", @@ -2343,7 +2343,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -2359,7 +2359,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" dependencies = [ "fc-db", "fp-consensus", @@ -2376,7 +2376,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" dependencies = [ "ethereum", "ethereum-types", @@ -2416,7 +2416,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" dependencies = [ "ethereum", "ethereum-types", @@ -2557,7 +2557,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" dependencies = [ "ethereum", "parity-scale-codec 3.1.5", @@ -2580,6 +2580,20 @@ dependencies = [ "sp-std", ] +[[package]] +name = "fp-evm" +version = "3.0.0-dev" +source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +dependencies = [ + "evm", + "frame-support", + "impl-trait-for-tuples", + "parity-scale-codec 3.1.5", + "serde", + "sp-core", + "sp-std", +] + [[package]] name = "fp-evm-mapping" version = "0.1.0" @@ -2589,14 +2603,23 @@ dependencies = [ "sp-core", ] +[[package]] +name = "fp-evm-mapping" +version = "0.1.0" +source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +dependencies = [ + "frame-support", + "sp-core", +] + [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" dependencies = [ "ethereum", "ethereum-types", - "fp-evm", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "parity-scale-codec 3.1.5", "scale-info", "sp-api", @@ -2609,7 +2632,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" dependencies = [ "ethereum", "frame-support", @@ -2625,7 +2648,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" dependencies = [ "parity-scale-codec 3.1.5", ] @@ -5152,7 +5175,7 @@ dependencies = [ "cumulus-primitives-utility", "derivative", "evm-coder", - "fp-evm-mapping", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "fp-rpc", "fp-self-contained", "frame-benchmarking", @@ -5172,7 +5195,7 @@ dependencies = [ "pallet-common", "pallet-configuration", "pallet-ethereum", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "pallet-evm-coder-substrate", "pallet-evm-contract-helpers", "pallet-evm-migration", @@ -5320,7 +5343,7 @@ dependencies = [ "frame-system", "pallet-balances", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", "pallet-evm-contract-helpers", "pallet-evm-migration", "pallet-randomness-collective-flip", @@ -5445,9 +5468,9 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" dependencies = [ - "fp-evm", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "frame-support", "frame-system", "parity-scale-codec 3.1.5", @@ -5556,11 +5579,11 @@ version = "0.1.8" dependencies = [ "ethereum", "evm-coder", - "fp-evm-mapping", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "frame-benchmarking", "frame-support", "frame-system", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "pallet-evm-coder-substrate", "parity-scale-codec 3.1.5", "scale-info", @@ -5575,7 +5598,7 @@ dependencies = [ name = "pallet-configuration" version = "0.1.1" dependencies = [ - "fp-evm", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "frame-support", "frame-system", "parity-scale-codec 3.1.5", @@ -5660,21 +5683,21 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" +source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" dependencies = [ "ethereum", "ethereum-types", "evm", "fp-consensus", - "fp-evm", - "fp-evm-mapping", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "fp-rpc", "fp-self-contained", "fp-storage", "frame-support", "frame-system", "log", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "pallet-timestamp", "parity-scale-codec 3.1.5", "rlp", @@ -5692,8 +5715,35 @@ version = "6.0.0-dev" source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" dependencies = [ "evm", - "fp-evm", - "fp-evm-mapping", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "frame-benchmarking", + "frame-support", + "frame-system", + "hex", + "impl-trait-for-tuples", + "log", + "pallet-timestamp", + "parity-scale-codec 3.1.5", + "primitive-types", + "rlp", + "scale-info", + "serde", + "sha3 0.10.2", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-evm" +version = "6.0.0-dev" +source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +dependencies = [ + "evm", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "frame-benchmarking", "frame-support", "frame-system", @@ -5723,7 +5773,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-ethereum", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "parity-scale-codec 3.1.5", "scale-info", "sp-core", @@ -5737,12 +5787,12 @@ version = "0.2.0" dependencies = [ "ethereum", "evm-coder", - "fp-evm-mapping", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "frame-support", "frame-system", "log", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "pallet-evm-coder-substrate", "parity-scale-codec 3.1.5", "scale-info", @@ -5757,11 +5807,11 @@ dependencies = [ name = "pallet-evm-migration" version = "0.1.1" dependencies = [ - "fp-evm", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "frame-benchmarking", "frame-support", "frame-system", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "parity-scale-codec 3.1.5", "scale-info", "sp-core", @@ -5774,12 +5824,12 @@ dependencies = [ name = "pallet-evm-transaction-payment" version = "0.1.1" dependencies = [ - "fp-evm", - "fp-evm-mapping", + "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "frame-support", "frame-system", "pallet-ethereum", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "parity-scale-codec 3.1.5", "scale-info", "sp-core", @@ -5799,7 +5849,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "pallet-evm-coder-substrate", "pallet-structure", "parity-scale-codec 3.1.5", @@ -6041,7 +6091,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "pallet-evm-coder-substrate", "pallet-structure", "parity-scale-codec 3.1.5", @@ -6164,7 +6214,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "pallet-evm-coder-substrate", "pallet-structure", "parity-scale-codec 3.1.5", @@ -6185,7 +6235,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "pallet-nonfungible", "pallet-structure", "parity-scale-codec 3.1.5", @@ -6205,7 +6255,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "pallet-nonfungible", "pallet-rmrk-core", "parity-scale-codec 3.1.5", @@ -6335,7 +6385,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "parity-scale-codec 3.1.5", "scale-info", "sp-std", @@ -6359,7 +6409,7 @@ dependencies = [ [[package]] name = "pallet-template-transaction-payment" version = "3.0.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?rev=a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3#a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" dependencies = [ "frame-benchmarking", "frame-support", @@ -6482,7 +6532,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "pallet-evm-coder-substrate", "pallet-nonfungible", "pallet-refungible", @@ -8385,7 +8435,7 @@ dependencies = [ "cumulus-primitives-utility", "derivative", "evm-coder", - "fp-evm-mapping", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "fp-rpc", "fp-self-contained", "frame-benchmarking", @@ -8405,7 +8455,7 @@ dependencies = [ "pallet-common", "pallet-configuration", "pallet-ethereum", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "pallet-evm-coder-substrate", "pallet-evm-contract-helpers", "pallet-evm-migration", @@ -11650,13 +11700,13 @@ name = "tests" version = "0.1.1" dependencies = [ "evm-coder", - "fp-evm-mapping", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "frame-support", "frame-system", "pallet-balances", "pallet-common", "pallet-ethereum", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "pallet-evm-coder-substrate", "pallet-fungible", "pallet-nonfungible", @@ -12153,7 +12203,7 @@ dependencies = [ "app-promotion-rpc", "jsonrpsee", "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "parity-scale-codec 3.1.5", "rmrk-rpc", "sp-api", @@ -12379,7 +12429,7 @@ dependencies = [ "cumulus-primitives-utility", "derivative", "evm-coder", - "fp-evm-mapping", + "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "fp-rpc", "fp-self-contained", "frame-benchmarking", @@ -12399,7 +12449,7 @@ dependencies = [ "pallet-common", "pallet-configuration", "pallet-ethereum", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "pallet-evm-coder-substrate", "pallet-evm-contract-helpers", "pallet-evm-migration", @@ -12485,7 +12535,7 @@ version = "0.9.27" dependencies = [ "fp-rpc", "frame-support", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "sp-consensus-aura", "sp-core", "sp-runtime", @@ -12499,7 +12549,7 @@ dependencies = [ "derivative", "frame-support", "frame-system", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "parity-scale-codec 3.1.5", "rmrk-traits", "scale-info", @@ -12515,7 +12565,7 @@ name = "up-rpc" version = "0.1.3" dependencies = [ "pallet-common", - "pallet-evm", + "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "parity-scale-codec 3.1.5", "sp-api", "sp-core", @@ -12527,7 +12577,7 @@ dependencies = [ [[package]] name = "up-sponsorship" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?rev=a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3#a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" dependencies = [ "impl-trait-for-tuples", ] diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index a26f44588f..fb69d3dbf4 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -19,4 +19,4 @@ sp-blockchain = { default-features = false, git = "https://github.com/paritytech sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 27563f1c71..2f86e2e9ab 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -309,13 +309,13 @@ clap = "3.1.2" jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } tokio = { version = "1.19.2", features = ["time"] } -fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fc-consensus = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fc-rpc = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fc-db = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-rpc = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } unique-rpc = { default-features = false, path = "../rpc" } app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index f133e412cd..847f783101 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -40,13 +40,13 @@ sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } tokio = { version = "1.19.2", features = ["macros", "sync"] } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } pallet-common = { default-features = false, path = "../../pallets/common" } up-common = { path = "../../primitives/common" } diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index 64ef5be5d2..cdb62b13c9 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -17,12 +17,12 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } ethereum = { version = "0.12.0", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } serde = { version = "1.0.130", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/configuration/Cargo.toml b/pallets/configuration/Cargo.toml index 8169a27735..2fe2c88173 100644 --- a/pallets/configuration/Cargo.toml +++ b/pallets/configuration/Cargo.toml @@ -16,7 +16,7 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } smallvec = "1.6.1" [features] diff --git a/pallets/evm-coder-substrate/Cargo.toml b/pallets/evm-coder-substrate/Cargo.toml index 94fa572dfa..7d80b785b8 100644 --- a/pallets/evm-coder-substrate/Cargo.toml +++ b/pallets/evm-coder-substrate/Cargo.toml @@ -12,8 +12,8 @@ sp-std = { default-features = false, git = "https://github.com/paritytech/substr sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } ethereum = { version = "0.12.0", default-features = false } evm-coder = { default-features = false, path = "../../crates/evm-coder" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index 26597d1452..e716d67377 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -19,9 +19,9 @@ sp-std = { default-features = false, git = "https://github.com/paritytech/substr sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } # Unique -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" } # Locals evm-coder = { default-features = false, path = '../../crates/evm-coder' } diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index de4ea9b474..8e901011bb 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -25,11 +25,11 @@ use pallet_evm::{ ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure, PrecompileHandle, account::CrossAccountId, }; -use sp_core::H160; +use sp_core::{H160, U256}; use up_data_structs::SponsorshipState; use crate::{ - AllowlistEnabled, Config, Owner, Pallet, SponsorBasket, SponsoringRateLimit, SponsoringModeT, - Sponsoring, + AllowlistEnabled, Config, Owner, Pallet, SponsorBasket, SponsoringFeeLimit, + SponsoringRateLimit, SponsoringModeT, Sponsoring, }; use frame_support::traits::Get; use up_sponsorship::SponsorshipHandler; @@ -250,6 +250,23 @@ where Ok(()) } + fn set_sponsoring_fee_limit( + &mut self, + caller: caller, + contract_address: address, + fee_limit: uint128, + ) -> Result { + >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; + >::set_sponsoring_fee_limit(contract_address, fee_limit.into()); + Ok(()) + } + + fn get_sponsoring_fee_limit(&self, contract_address: address) -> Result { + Ok(>::get(contract_address) + .try_into() + .map_err(|_| "fee limit > u128::MAX")?) + } + /// Is specified user present in contract allow list /// @dev Contract owner always implicitly included /// @param contractAddress Contract to check allowlist of @@ -363,10 +380,14 @@ impl OnCreate for HelpersOnCreate { /// Bridge to pallet-sponsoring pub struct HelpersContractSponsoring(PhantomData<*const T>); -impl SponsorshipHandler)> +impl SponsorshipHandler), u128> for HelpersContractSponsoring { - fn get_sponsor(who: &T::CrossAccountId, call: &(H160, Vec)) -> Option { + fn get_sponsor( + who: &T::CrossAccountId, + call: &(H160, Vec), + fee_limit: &u128, + ) -> Option { let (contract_address, _) = call; let mode = >::sponsoring_mode(*contract_address); if mode == SponsoringModeT::Disabled { @@ -394,6 +415,12 @@ impl SponsorshipHandler)> } } + let sponsored_fee_limit = >::get(contract_address); + + if *fee_limit > sponsored_fee_limit { + return None; + } + >::insert(contract_address, who.as_eth(), block_number); Some(sponsor) diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index dffc1a45c3..7a37089166 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -48,6 +48,9 @@ pub mod pallet { /// In case of enabled sponsoring, but no sponsoring rate limit set, /// this value will be used implicitly type DefaultSponsoringRateLimit: Get; + /// In case of enabled sponsoring, but no sponsoring fee limit set, + /// this value will be used implicitly + type DefaultSponsoringFeeLimit: Get; } #[pallet::error] @@ -117,6 +120,15 @@ pub mod pallet { /// * **Key1** - contract address. /// * **Key2** - sponsored user address. /// * **Value** - last sponsored block number. + #[pallet::storage] + pub(super) type SponsoringFeeLimit = StorageMap< + Hasher = Twox128, + Key = H160, + Value = u128, + QueryKind = ValueQuery, + OnEmpty = T::DefaultSponsoringFeeLimit, + >; + #[pallet::storage] pub(super) type SponsorBasket = StorageDoubleMap< Hasher1 = Twox128, @@ -353,6 +365,11 @@ pub mod pallet { >::insert(contract, rate_limit); } + /// Set maximum for gas limit of transaction + pub fn set_sponsoring_fee_limit(contract: H160, fee_limit: u128) { + >::insert(contract, fee_limit); + } + /// Is user added to allowlist, or he is owner of specified contract pub fn allowed(contract: H160, user: H160) -> bool { >::get(&contract, &user) || >::get(&contract) == user diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol index 4c7df2580a..47ae6980c1 100644 --- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol +++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol @@ -203,6 +203,30 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { dummy = 0; } + /// @dev EVM selector for this function is: 0x1c362eb4, + /// or in textual repr: setSponsoringFeeLimit(address,uint128) + function setSponsoringFeeLimit(address contractAddress, uint128 feeLimit) + public + { + require(false, stub_error); + contractAddress; + feeLimit; + dummy = 0; + } + + /// @dev EVM selector for this function is: 0xc3fdc9ee, + /// or in textual repr: getSponsoringFeeLimit(address) + function getSponsoringFeeLimit(address contractAddress) + public + view + returns (uint128) + { + require(false, stub_error); + contractAddress; + dummy; + return 0; + } + /// Is specified user present in contract allow list /// @dev Contract owner always implicitly included /// @param contractAddress Contract to check allowlist of diff --git a/pallets/evm-migration/Cargo.toml b/pallets/evm-migration/Cargo.toml index 86645e8201..195b5420ac 100644 --- a/pallets/evm-migration/Cargo.toml +++ b/pallets/evm-migration/Cargo.toml @@ -15,8 +15,8 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } [dependencies.codec] default-features = false diff --git a/pallets/evm-transaction-payment/Cargo.toml b/pallets/evm-transaction-payment/Cargo.toml index 3ec89bd4e5..322f52dcf0 100644 --- a/pallets/evm-transaction-payment/Cargo.toml +++ b/pallets/evm-transaction-payment/Cargo.toml @@ -14,11 +14,11 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev = "a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } [dependencies.codec] default-features = false diff --git a/pallets/evm-transaction-payment/src/lib.rs b/pallets/evm-transaction-payment/src/lib.rs index eee7b20df1..036d0524b7 100644 --- a/pallets/evm-transaction-payment/src/lib.rs +++ b/pallets/evm-transaction-payment/src/lib.rs @@ -22,8 +22,8 @@ use core::marker::PhantomData; use fp_evm::WithdrawReason; use frame_support::traits::IsSubType; pub use pallet::*; -use pallet_evm::{EnsureAddressOrigin, account::CrossAccountId}; -use sp_core::H160; +use pallet_evm::{account::CrossAccountId, EnsureAddressOrigin, FeeCalculator}; +use sp_core::{H160, U256}; use sp_runtime::{TransactionOutcome, DispatchError}; use up_sponsorship::SponsorshipHandler; @@ -36,7 +36,7 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config + pallet_evm::account::Config { /// Loosly-coupled handlers for evm call sponsoring - type EvmSponsorshipHandler: SponsorshipHandler)>; + type EvmSponsorshipHandler: SponsorshipHandler), u128>; } #[pallet::pallet] @@ -47,11 +47,19 @@ pub mod pallet { /// Implements [`fp_evm::TransactionValidityHack`], which provides sponsor address to pallet-evm pub struct TransactionValidityHack(PhantomData<*const T>); impl fp_evm::TransactionValidityHack for TransactionValidityHack { - fn who_pays_fee(origin: H160, reason: &WithdrawReason) -> Option { + fn who_pays_fee( + origin: H160, + max_fee: U256, + reason: &WithdrawReason, + ) -> Option { match reason { WithdrawReason::Call { target, input } => { let origin_sub = T::CrossAccountId::from_eth(origin); - T::EvmSponsorshipHandler::get_sponsor(&origin_sub, &(*target, input.clone())) + T::EvmSponsorshipHandler::get_sponsor( + &origin_sub, + &(*target, input.clone()), + &max_fee.as_u128(), + ) } _ => None, } @@ -60,17 +68,19 @@ impl fp_evm::TransactionValidityHack for Transacti /// Implements sponsoring for evm calls performed from pallet-evm (via api.tx.ethereum.transact/api.tx.evm.call) pub struct BridgeSponsorshipHandler(PhantomData); -impl SponsorshipHandler for BridgeSponsorshipHandler +impl SponsorshipHandler for BridgeSponsorshipHandler where T: Config + pallet_evm::Config, C: IsSubType>, { - fn get_sponsor(who: &T::AccountId, call: &C) -> Option { + fn get_sponsor(who: &T::AccountId, call: &C, _fee_limit: &u128) -> Option { match call.is_sub_type()? { pallet_evm::Call::call { source, target, input, + gas_limit, + max_fee_per_gas, .. } => { let _ = T::CallOrigin::ensure_address_origin( @@ -79,11 +89,16 @@ where ) .ok()?; let who = T::CrossAccountId::from_sub(who.clone()); + let max_fee = max_fee_per_gas.saturating_mul((*gas_limit).into()); // Effects from EvmSponsorshipHandler are applied by pallet_evm::runner // TODO: Should we implement simulation mode (test, but do not apply effects) in `up-sponsorship`? let sponsor = frame_support::storage::with_transaction(|| { TransactionOutcome::Rollback(Ok::<_, DispatchError>( - T::EvmSponsorshipHandler::get_sponsor(&who, &(*target, input.clone())), + T::EvmSponsorshipHandler::get_sponsor( + &who, + &(*target, input.clone()), + &max_fee.try_into().unwrap(), + ), )) }) // FIXME: it may fail with DispatchError in case of depth limit diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index 0a0176cd70..6b2a48bcdd 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -23,7 +23,7 @@ evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' } ethereum = { version = "0.12.0", default-features = false } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index e7ea92b9c7..a5176a0d00 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -16,7 +16,7 @@ frame-system = { default-features = false, git = "https://github.com/paritytech/ sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } diff --git a/pallets/proxy-rmrk-core/Cargo.toml b/pallets/proxy-rmrk-core/Cargo.toml index e47c36f131..7b5b68ef37 100644 --- a/pallets/proxy-rmrk-core/Cargo.toml +++ b/pallets/proxy-rmrk-core/Cargo.toml @@ -20,7 +20,7 @@ pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } pallet-structure = { default-features = false, path = "../../pallets/structure" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/proxy-rmrk-equip/Cargo.toml b/pallets/proxy-rmrk-equip/Cargo.toml index 71e4ed60bd..bfe53bfdea 100644 --- a/pallets/proxy-rmrk-equip/Cargo.toml +++ b/pallets/proxy-rmrk-equip/Cargo.toml @@ -19,7 +19,7 @@ sp-core = { default-features = false, git = "https://github.com/paritytech/subst pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index 921b28e2b4..57b5b3bd9a 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -16,7 +16,7 @@ frame-system = { default-features = false, git = "https://github.com/paritytech/ sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } pallet-common = { default-features = false, path = '../common' } diff --git a/pallets/scheduler/Cargo.toml b/pallets/scheduler/Cargo.toml index 9537aefa15..2c5c7cc57f 100644 --- a/pallets/scheduler/Cargo.toml +++ b/pallets/scheduler/Cargo.toml @@ -24,7 +24,7 @@ sp-io = { default-features = false, git = "https://github.com/paritytech/substra sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.27' } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" } log = { version = "0.4.14", default-features = false } [dev-dependencies] diff --git a/pallets/structure/Cargo.toml b/pallets/structure/Cargo.toml index 466289836d..65d509134d 100644 --- a/pallets/structure/Cargo.toml +++ b/pallets/structure/Cargo.toml @@ -16,7 +16,7 @@ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } up-data-structs = { path = "../../primitives/data-structs", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } [features] default = ["std"] diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index 8cadf6f034..9494d359e7 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -98,7 +98,7 @@ up-data-structs = { default-features = false, path = "../../primitives/data-stru scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } pallet-common = { default-features = false, path = "../common" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } diff --git a/primitives/common/Cargo.toml b/primitives/common/Cargo.toml index df2f7986fa..6f4e8f227f 100644 --- a/primitives/common/Cargo.toml +++ b/primitives/common/Cargo.toml @@ -48,9 +48,9 @@ branch = "polkadot-v0.9.27" [dependencies.fp-rpc] default-features = false git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.27" +rev = "89a37c5a489f426cc7a42d7b94019974093a052d" [dependencies.pallet-evm] default-features = false git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.27" +rev = "89a37c5a489f426cc7a42d7b94019974093a052d" diff --git a/primitives/data-structs/Cargo.toml b/primitives/data-structs/Cargo.toml index e8c94f47d0..1fea189663 100644 --- a/primitives/data-structs/Cargo.toml +++ b/primitives/data-structs/Cargo.toml @@ -25,7 +25,7 @@ sp-std = { default-features = false, git = "https://github.com/paritytech/substr sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } derivative = { version = "2.2.0", features = ["use_core"] } struct-versioning = { path = "../../crates/struct-versioning" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } rmrk-traits = { default-features = false, path = "../rmrk-traits" } [features] diff --git a/primitives/rpc/Cargo.toml b/primitives/rpc/Cargo.toml index afe081658d..fbee5c61a7 100644 --- a/primitives/rpc/Cargo.toml +++ b/primitives/rpc/Cargo.toml @@ -14,7 +14,7 @@ sp-core = { default-features = false, git = "https://github.com/paritytech/subst sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } [features] default = ["std"] diff --git a/runtime/common/config/ethereum.rs b/runtime/common/config/ethereum.rs index a713925428..55c189042f 100644 --- a/runtime/common/config/ethereum.rs +++ b/runtime/common/config/ethereum.rs @@ -7,8 +7,10 @@ use frame_support::{ use sp_runtime::{RuntimeAppPublic, Perbill}; use crate::{ runtime_common::{ - dispatch::CollectionDispatchT, ethereum::sponsoring::EvmSponsorshipHandler, - config::sponsoring::DefaultSponsoringRateLimit, DealWithFees, + dispatch::CollectionDispatchT, + ethereum::sponsoring::EvmSponsorshipHandler, + config::sponsoring::{DefaultSponsoringFeeLimit, DefaultSponsoringRateLimit}, + DealWithFees, }, Runtime, Aura, Balances, Event, ChainId, }; @@ -115,6 +117,7 @@ impl pallet_evm_contract_helpers::Config for Runtime { type Event = Event; type ContractAddress = HelpersContractAddress; type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; + type DefaultSponsoringFeeLimit = DefaultSponsoringFeeLimit; } impl pallet_evm_coder_substrate::Config for Runtime {} diff --git a/runtime/common/config/sponsoring.rs b/runtime/common/config/sponsoring.rs index 709633ac5a..b9c2ae8603 100644 --- a/runtime/common/config/sponsoring.rs +++ b/runtime/common/config/sponsoring.rs @@ -23,6 +23,7 @@ use up_common::{types::BlockNumber, constants::*}; parameter_types! { pub const DefaultSponsoringRateLimit: BlockNumber = 1 * DAYS; + pub const DefaultSponsoringFeeLimit: u128 = u128::MAX; } type SponsorshipHandler = ( diff --git a/runtime/common/ethereum/sponsoring.rs b/runtime/common/ethereum/sponsoring.rs index b7d0d89fad..f2aa07bb5c 100644 --- a/runtime/common/ethereum/sponsoring.rs +++ b/runtime/common/ethereum/sponsoring.rs @@ -44,9 +44,13 @@ pub type EvmSponsorshipHandler = ( pub struct UniqueEthSponsorshipHandler(PhantomData<*const T>); impl - SponsorshipHandler)> for UniqueEthSponsorshipHandler + SponsorshipHandler), u128> for UniqueEthSponsorshipHandler { - fn get_sponsor(who: &T::CrossAccountId, call: &(H160, Vec)) -> Option { + fn get_sponsor( + who: &T::CrossAccountId, + call: &(H160, Vec), + _fee_limit: &u128, + ) -> Option { let collection_id = map_eth_to_id(&call.0)?; let collection = >::new(collection_id)?; let sponsor = collection.sponsorship.sponsor()?.clone(); diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index edc2f0ef53..61dfddf767 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -48,7 +48,8 @@ macro_rules! impl_common_runtime_apis { }; use pallet_evm::{ Runner, account::CrossAccountId as _, - Account as EVMAccount, FeeCalculator, + Account as EVMAccount, + FeeCalculator }; use runtime_common::{ sponsoring::{SponsorshipPredict, UniqueSponsorshipPredict}, diff --git a/runtime/common/sponsoring.rs b/runtime/common/sponsoring.rs index 62452a9d29..ba3f71d61c 100644 --- a/runtime/common/sponsoring.rs +++ b/runtime/common/sponsoring.rs @@ -224,12 +224,12 @@ fn load(id: CollectionId) -> Option<(T::AccountId, CollectionHa } pub struct UniqueSponsorshipHandler(PhantomData); -impl SponsorshipHandler for UniqueSponsorshipHandler +impl SponsorshipHandler for UniqueSponsorshipHandler where T: Config, C: IsSubType>, { - fn get_sponsor(who: &T::AccountId, call: &C) -> Option { + fn get_sponsor(who: &T::AccountId, call: &C, _fee_limit: &u128) -> Option { match IsSubType::>::is_sub_type(call)? { UniqueCall::set_token_properties { collection_id, diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 3a9356679d..526edcdac1 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -417,7 +417,7 @@ pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } @@ -431,18 +431,18 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" } ################################################################################ # Build Dependencies diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 0413b40fab..41236bb94a 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -418,7 +418,7 @@ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } @@ -432,18 +432,18 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" } ################################################################################ # Build Dependencies diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index 0a7d259288..a13bcea87d 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -16,7 +16,7 @@ sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } @@ -25,8 +25,8 @@ pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "p pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } pallet-common = { path = '../../pallets/common' } pallet-structure = { path = '../../pallets/structure' } @@ -43,4 +43,4 @@ parity-scale-codec = { version = "3.1.2", default-features = false, features = [ scale-info = "*" evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" } diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 8e169f56ec..0aa24948d8 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -425,19 +425,19 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" } ################################################################################ # Build Dependencies diff --git a/tests/src/eth/api/ContractHelpers.sol b/tests/src/eth/api/ContractHelpers.sol index 5a7d00c65a..cee54dd135 100644 --- a/tests/src/eth/api/ContractHelpers.sol +++ b/tests/src/eth/api/ContractHelpers.sol @@ -131,6 +131,18 @@ interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents { function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) external; + /// @dev EVM selector for this function is: 0x1c362eb4, + /// or in textual repr: setSponsoringFeeLimit(address,uint128) + function setSponsoringFeeLimit(address contractAddress, uint128 feeLimit) + external; + + /// @dev EVM selector for this function is: 0xc3fdc9ee, + /// or in textual repr: getSponsoringFeeLimit(address) + function getSponsoringFeeLimit(address contractAddress) + external + view + returns (uint128); + /// Is specified user present in contract allow list /// @dev Contract owner always implicitly included /// @param contractAddress Contract to check allowlist of diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index 630bac0ac9..6c8f666b89 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -14,8 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +import * as solc from 'solc'; import {expect} from 'chai'; import {expectSubstrateEventsAtBlock} from '../util/helpers'; +import Web3 from 'web3'; + import { contractHelpers, createEthAccountWithBalance, @@ -26,7 +29,11 @@ import { createEthAccount, ethBalanceViaSub, normalizeEvents, + CompiledContract, + GAS_ARGS, + subToEth, } from './util/helpers'; +import { submitTransactionAsync } from '../substrate/substrate-api'; describe('Sponsoring EVM contracts', () => { itWeb3('Self sponsored can be set by the address that deployed the contract', async ({api, web3, privateKeyWrapper}) => { @@ -478,3 +485,174 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.getSponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200'); }); }); + +describe('Sponsoring Fee Limit', () => { + + let testContract: CompiledContract; + + function compileTestContract() { + if (!testContract) { + const input = { + language: 'Solidity', + sources: { + ['TestContract.sol']: { + content: + ` + // SPDX-License-Identifier: MIT + pragma solidity ^0.8.0; + + contract TestContract { + event Result(bool); + function test1() public { + uint256 counter = 0; + while(true) { + counter ++; + } + emit Result(true); + } + + function test2() public { + uint256 counter = 0; + while(true) { + counter ++; + if (counter > 1){ + break; + } + } + emit Result(true); + } + } + `, + }, + }, + settings: { + outputSelection: { + '*': { + '*': ['*'], + }, + }, + }, + }; + const json = JSON.parse(solc.compile(JSON.stringify(input))); + const out = json.contracts['TestContract.sol']['TestContract']; + + testContract = { + abi: out.abi, + object: '0x' + out.evm.bytecode.object, + }; + } + return testContract; + } + + async function deployTestContract(web3: Web3, owner: string) { + const compiled = compileTestContract(); + const testContract = new web3.eth.Contract(compiled.abi, undefined, { + data: compiled.object, + from: owner, + ...GAS_ARGS, + }); + return await testContract.deploy({data: compiled.object}).send({from: owner}); + } + + itWeb3('Default fee limit', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('340282366920938463463374607431768211455'); + }); + + itWeb3('Set fee limit', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + await helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send(); + expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100'); + }); + + itWeb3('Negative test - set fee limit by non-owner', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const stranger = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const flipper = await deployFlipper(web3, owner); + const helpers = contractHelpers(web3, owner); + await expect(helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send({from: stranger})).to.be.rejected; + }); + + itWeb3('Negative test - check that eth transactions exceeding fee limit are not executed', async ({api, web3, privateKeyWrapper}) => { + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const user = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const testContract = await deployTestContract(web3, owner); + const helpers = contractHelpers(web3, owner); + + await helpers.methods.setSponsoringMode(testContract.options.address, SponsoringMode.Generous).send({from: owner}); + await helpers.methods.setSponsoringRateLimit(testContract.options.address, 0).send({from: owner}); + + await helpers.methods.setSponsor(testContract.options.address, sponsor).send(); + await helpers.methods.confirmSponsorship(testContract.options.address).send({from: sponsor}); + + const gasPrice = BigInt(await web3.eth.getGasPrice()); + + await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 30000n * gasPrice).send(); + + const originalUserBalance = await web3.eth.getBalance(user); + await testContract.methods.test2().send({from: user, gas: 30000}); + expect(await web3.eth.getBalance(user)).to.be.equal(originalUserBalance); + + await testContract.methods.test2().send({from: user, gas: 40000}); + expect(await web3.eth.getBalance(user)).to.not.be.equal(originalUserBalance); + }); + + itWeb3('Negative test - check that evm.call transactions exceeding fee limit are not executed', async ({api, web3, privateKeyWrapper}) => { + const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + const testContract = await deployTestContract(web3, owner); + const helpers = contractHelpers(web3, owner); + + await helpers.methods.setSponsoringMode(testContract.options.address, SponsoringMode.Generous).send({from: owner}); + await helpers.methods.setSponsoringRateLimit(testContract.options.address, 0).send({from: owner}); + + await helpers.methods.setSponsor(testContract.options.address, sponsor).send(); + await helpers.methods.confirmSponsorship(testContract.options.address).send({from: sponsor}); + + const gasPrice = BigInt(await web3.eth.getGasPrice()); + + await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 30000n * gasPrice).send(); + + const alice = privateKeyWrapper('//Alice'); + const originalAliceBalance = (await api.query.system.account(alice.address)).data.free.toBigInt(); + + await submitTransactionAsync( + alice, + api.tx.evm.call( + subToEth(alice.address), + testContract.options.address, + testContract.methods.test2().encodeABI(), + Uint8Array.from([]), + 30000n, + gasPrice, + null, + null, + [], + ), + ); + expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.be.equal(originalAliceBalance); + + await submitTransactionAsync( + alice, + api.tx.evm.call( + subToEth(alice.address), + testContract.options.address, + testContract.methods.test2().encodeABI(), + Uint8Array.from([]), + 40000n, + gasPrice, + null, + null, + [], + ), + ); + expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.not.be.equal(originalAliceBalance); + }); +}); diff --git a/tests/src/eth/util/contractHelpersAbi.json b/tests/src/eth/util/contractHelpersAbi.json index fc3e92aa1e..db542feda7 100644 --- a/tests/src/eth/util/contractHelpersAbi.json +++ b/tests/src/eth/util/contractHelpersAbi.json @@ -126,6 +126,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "getSponsoringFeeLimit", + "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -205,6 +218,20 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { "internalType": "uint128", "name": "feeLimit", "type": "uint128" } + ], + "name": "setSponsoringFeeLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { From bfcf3ca7e01cde4cc83711f0c6b7ac528b7902c7 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 13 Sep 2022 07:37:27 +0000 Subject: [PATCH 0855/1274] chore: replace u128 with CallContext --- Cargo.lock | 5 ++- pallets/evm-contract-helpers/Cargo.toml | 3 +- pallets/evm-contract-helpers/src/eth.rs | 19 +++++----- pallets/evm-contract-helpers/src/lib.rs | 8 ++-- .../src/stubs/ContractHelpers.raw | Bin 1742 -> 1848 bytes .../src/stubs/ContractHelpers.sol | 10 ++--- pallets/evm-transaction-payment/Cargo.toml | 2 +- pallets/evm-transaction-payment/src/lib.rs | 24 +++++++++--- pallets/scheduler/Cargo.toml | 2 +- runtime/common/config/sponsoring.rs | 7 ++-- runtime/common/ethereum/sponsoring.rs | 35 ++++++++++-------- runtime/common/sponsoring.rs | 4 +- runtime/opal/Cargo.toml | 4 +- runtime/quartz/Cargo.toml | 4 +- runtime/tests/Cargo.toml | 2 +- runtime/unique/Cargo.toml | 4 +- tests/src/eth/api/ContractHelpers.sol | 10 ++--- tests/src/eth/contractSponsoring.test.ts | 2 +- tests/src/eth/util/contractHelpersAbi.json | 4 +- 19 files changed, 84 insertions(+), 65 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9aee48998a..fdec00235b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5794,6 +5794,7 @@ dependencies = [ "pallet-common", "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", "pallet-evm-coder-substrate", + "pallet-evm-transaction-payment", "parity-scale-codec 3.1.5", "scale-info", "sp-core", @@ -6409,7 +6410,7 @@ dependencies = [ [[package]] name = "pallet-template-transaction-payment" version = "3.0.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?rev=a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3#a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?rev=9ee7d6e57e03a2575cbab79431774b56f170018e#9ee7d6e57e03a2575cbab79431774b56f170018e" dependencies = [ "frame-benchmarking", "frame-support", @@ -12577,7 +12578,7 @@ dependencies = [ [[package]] name = "up-sponsorship" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?rev=a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3#a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?rev=9ee7d6e57e03a2575cbab79431774b56f170018e#9ee7d6e57e03a2575cbab79431774b56f170018e" dependencies = [ "impl-trait-for-tuples", ] diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index e716d67377..8c1eedfb63 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -21,12 +21,13 @@ sp-core = { default-features = false, git = "https://github.com/paritytech/subst # Unique pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e" } # Locals evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-common = { default-features = false, path = '../../pallets/common' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } +pallet-evm-transaction-payment = { default-features = false, path = '../../pallets/evm-transaction-payment' } up-data-structs = { default-features = false, path = '../../primitives/data-structs', features = [ 'serde1', ] } diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 8e901011bb..313cbce3fe 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -20,12 +20,13 @@ use core::marker::PhantomData; use evm_coder::{ abi::AbiWriter, execution::Result, generate_stubgen, solidity_interface, types::*, ToLog, }; -use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder, dispatch_to_evm}; use pallet_evm::{ ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure, PrecompileHandle, account::CrossAccountId, }; -use sp_core::{H160, U256}; +use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder, dispatch_to_evm}; +use pallet_evm_transaction_payment::CallContext; +use sp_core::H160; use up_data_structs::SponsorshipState; use crate::{ AllowlistEnabled, Config, Owner, Pallet, SponsorBasket, SponsoringFeeLimit, @@ -254,17 +255,15 @@ where &mut self, caller: caller, contract_address: address, - fee_limit: uint128, + fee_limit: uint256, ) -> Result { >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; >::set_sponsoring_fee_limit(contract_address, fee_limit.into()); Ok(()) } - fn get_sponsoring_fee_limit(&self, contract_address: address) -> Result { - Ok(>::get(contract_address) - .try_into() - .map_err(|_| "fee limit > u128::MAX")?) + fn get_sponsoring_fee_limit(&self, contract_address: address) -> Result { + Ok(>::get(contract_address)) } /// Is specified user present in contract allow list @@ -380,13 +379,13 @@ impl OnCreate for HelpersOnCreate { /// Bridge to pallet-sponsoring pub struct HelpersContractSponsoring(PhantomData<*const T>); -impl SponsorshipHandler), u128> +impl SponsorshipHandler), CallContext> for HelpersContractSponsoring { fn get_sponsor( who: &T::CrossAccountId, call: &(H160, Vec), - fee_limit: &u128, + call_context: &CallContext, ) -> Option { let (contract_address, _) = call; let mode = >::sponsoring_mode(*contract_address); @@ -417,7 +416,7 @@ impl SponsorshipHandler), u128> let sponsored_fee_limit = >::get(contract_address); - if *fee_limit > sponsored_fee_limit { + if call_context.max_fee > sponsored_fee_limit { return None; } diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index 7a37089166..14389df7f4 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -30,7 +30,7 @@ pub mod pallet { use crate::eth::ContractHelpersEvents; use frame_support::pallet_prelude::*; use pallet_evm_coder_substrate::DispatchResult; - use sp_core::H160; + use sp_core::{H160, U256}; use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; use up_data_structs::SponsorshipState; use evm_coder::ToLog; @@ -50,7 +50,7 @@ pub mod pallet { type DefaultSponsoringRateLimit: Get; /// In case of enabled sponsoring, but no sponsoring fee limit set, /// this value will be used implicitly - type DefaultSponsoringFeeLimit: Get; + type DefaultSponsoringFeeLimit: Get; } #[pallet::error] @@ -124,7 +124,7 @@ pub mod pallet { pub(super) type SponsoringFeeLimit = StorageMap< Hasher = Twox128, Key = H160, - Value = u128, + Value = U256, QueryKind = ValueQuery, OnEmpty = T::DefaultSponsoringFeeLimit, >; @@ -366,7 +366,7 @@ pub mod pallet { } /// Set maximum for gas limit of transaction - pub fn set_sponsoring_fee_limit(contract: H160, fee_limit: u128) { + pub fn set_sponsoring_fee_limit(contract: H160, fee_limit: U256) { >::insert(contract, fee_limit); } diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw index b8af457685e5b493010bd3137019db9e7e47de46..d669299fc5e7f7f4c1a86cca633836ccf0a8671d 100644 GIT binary patch delta 1140 zcmZXSUr19?9LINd?wu0;nX)ZJ%d3)B4}#VViD(HLLCAHjUE&I!!}Ki(EimX|_qt7x zEbewJA0p_Xh=?Q=!U`$zLB#&}6ci;=5)suZ5+RWFJ9qcaRl6_W-=EL-eDAq?Q9M)P zCaWY6B=tno^`Jou$|v11gwC=tR2QvLh{I1-tF*|u!wcVw z@gvb;Y+2rY>Of}Of{(hMRY8VdKyV3LQIK81$>Sg|f$Z+n`#?^EBn@w=WkZX8&w`w@ zGoZ}kZK&&E3s1b_KqttS6=@x0M5)yxtq-T#K=&)Ec``+<6zy*z0(HI%tJHah%{eQg zl%j6l!+Uw}N?3KM6y=(|(9B_YoL9No6tAvXmV8D6T?D~%qY@iQpB^L)XyFe+3< z@viJRX~>+?NFbKr7(SHkQ``}wxFoEO5s4WL`I#)krsmhYUhZPy`Q)HYYFRQVQ+%07 zaYS(_tQvAkPGt{+h@ECee8)x#hRnmbor940uo-2+o-W7DX$lNih?D?B2*&NdkN~ej zOcH%jq0rhF%Ki%g`*~4?W_$CXy-B1P@|&O7yd@!&-O!TqR_@#-2?I8NVT&&U1Cp_5 zHYZk>O)DfC^QB}p5p(O93d`(=SXca2AqZ|z#0nJ~S&hrnAU5)J7y19dkcdMa*4I5&lU+qh}0xMgiFYZEY4B850~)145gr;La=YU+iimM zq1(=kK3Hjqfshy#6&OO+GHMWgibAA_LMVe0Ns#s2yE}EY`|^99=lAE?^FG>?DRGlI z5)6^;MAfvAL4`XLZXKawvmg1R8)V`Nkhv-~(%qasP)c3HvKkqiav^}{ZCF9M0)XiY z3uh`QItp;%VvA&Vf7U!P0hU8|<=Y4WSPPcwijs2#!4!;o9?ld2Tmsm)^!~1`y}Ccz zi!GE&|*O zu<7x=7F%#ocwGfhkrkFkk)NVybtB;^HyBnZS07eLu-))@v=9-Ih1DcBekl|kp{SMd zmMz|iu;PLysF@h=g61j(AF`^Rbu;iG2)>&>Y$UzRn6K+m|dcv~7 zB{?3&UY&B8u#%K0-bTbYqTGB~F{G4~vMknuakH)9(lMs6++2jjdzoJcn?@CiyW(t| z0>f@1Ccx0PkCC8NIrdV@vR~Wiy0g*fe;a|pdge=q`PN|)QAYuIt>SE!T?5aXKMJ;p zMK+Ny%_EXk(oUhK^sr2#x;G^$3Eiz>%6FNH;P>k?L2x?$noRj=h|gB`dSjuu$3qHy zF*G1S*Blbc%lN0Vc03+KAtQl|K6tGW^Mz0=w!XQ&{PkA-t52t%ef~3k|Hky5iQi|R T4@?;!I{Lq-b`P6{g$;iJ%`juD diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol index 47ae6980c1..16072f7924 100644 --- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol +++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol @@ -32,7 +32,7 @@ contract ContractHelpersEvents { } /// @title Magic contract, which allows users to reconfigure other contracts -/// @dev the ERC-165 identifier for this interface is 0xd77fab70 +/// @dev the ERC-165 identifier for this interface is 0x172cb4fb contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// Get user, which deployed specified contract /// @dev May return zero address in case if contract is deployed @@ -203,9 +203,9 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { dummy = 0; } - /// @dev EVM selector for this function is: 0x1c362eb4, - /// or in textual repr: setSponsoringFeeLimit(address,uint128) - function setSponsoringFeeLimit(address contractAddress, uint128 feeLimit) + /// @dev EVM selector for this function is: 0x03aed665, + /// or in textual repr: setSponsoringFeeLimit(address,uint256) + function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) public { require(false, stub_error); @@ -219,7 +219,7 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { function getSponsoringFeeLimit(address contractAddress) public view - returns (uint128) + returns (uint256) { require(false, stub_error); contractAddress; diff --git a/pallets/evm-transaction-payment/Cargo.toml b/pallets/evm-transaction-payment/Cargo.toml index 322f52dcf0..310b7661a8 100644 --- a/pallets/evm-transaction-payment/Cargo.toml +++ b/pallets/evm-transaction-payment/Cargo.toml @@ -17,7 +17,7 @@ sp-core = { default-features = false, git = "https://github.com/paritytech/subst pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev = "a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev = "9ee7d6e57e03a2575cbab79431774b56f170018e" } fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } [dependencies.codec] diff --git a/pallets/evm-transaction-payment/src/lib.rs b/pallets/evm-transaction-payment/src/lib.rs index 036d0524b7..b50e268d79 100644 --- a/pallets/evm-transaction-payment/src/lib.rs +++ b/pallets/evm-transaction-payment/src/lib.rs @@ -22,7 +22,7 @@ use core::marker::PhantomData; use fp_evm::WithdrawReason; use frame_support::traits::IsSubType; pub use pallet::*; -use pallet_evm::{account::CrossAccountId, EnsureAddressOrigin, FeeCalculator}; +use pallet_evm::{account::CrossAccountId, EnsureAddressOrigin}; use sp_core::{H160, U256}; use sp_runtime::{TransactionOutcome, DispatchError}; use up_sponsorship::SponsorshipHandler; @@ -33,10 +33,20 @@ pub mod pallet { use sp_std::vec::Vec; + /// Contains call data + pub struct CallContext { + /// Max fee for transaction - gasLimit * gasPrice + pub max_fee: U256, + } + #[pallet::config] pub trait Config: frame_system::Config + pallet_evm::account::Config { /// Loosly-coupled handlers for evm call sponsoring - type EvmSponsorshipHandler: SponsorshipHandler), u128>; + type EvmSponsorshipHandler: SponsorshipHandler< + Self::CrossAccountId, + (H160, Vec), + CallContext, + >; } #[pallet::pallet] @@ -55,10 +65,11 @@ impl fp_evm::TransactionValidityHack for Transacti match reason { WithdrawReason::Call { target, input } => { let origin_sub = T::CrossAccountId::from_eth(origin); + let call_context = CallContext { max_fee }; T::EvmSponsorshipHandler::get_sponsor( &origin_sub, &(*target, input.clone()), - &max_fee.as_u128(), + &call_context, ) } _ => None, @@ -68,12 +79,12 @@ impl fp_evm::TransactionValidityHack for Transacti /// Implements sponsoring for evm calls performed from pallet-evm (via api.tx.ethereum.transact/api.tx.evm.call) pub struct BridgeSponsorshipHandler(PhantomData); -impl SponsorshipHandler for BridgeSponsorshipHandler +impl SponsorshipHandler for BridgeSponsorshipHandler where T: Config + pallet_evm::Config, C: IsSubType>, { - fn get_sponsor(who: &T::AccountId, call: &C, _fee_limit: &u128) -> Option { + fn get_sponsor(who: &T::AccountId, call: &C, _call_context: &()) -> Option { match call.is_sub_type()? { pallet_evm::Call::call { source, @@ -90,6 +101,7 @@ where .ok()?; let who = T::CrossAccountId::from_sub(who.clone()); let max_fee = max_fee_per_gas.saturating_mul((*gas_limit).into()); + let call_context = CallContext { max_fee }; // Effects from EvmSponsorshipHandler are applied by pallet_evm::runner // TODO: Should we implement simulation mode (test, but do not apply effects) in `up-sponsorship`? let sponsor = frame_support::storage::with_transaction(|| { @@ -97,7 +109,7 @@ where T::EvmSponsorshipHandler::get_sponsor( &who, &(*target, input.clone()), - &max_fee.try_into().unwrap(), + &call_context, ), )) }) diff --git a/pallets/scheduler/Cargo.toml b/pallets/scheduler/Cargo.toml index 2c5c7cc57f..65f44bdd11 100644 --- a/pallets/scheduler/Cargo.toml +++ b/pallets/scheduler/Cargo.toml @@ -24,7 +24,7 @@ sp-io = { default-features = false, git = "https://github.com/paritytech/substra sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.27' } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e" } log = { version = "0.4.14", default-features = false } [dev-dependencies] diff --git a/runtime/common/config/sponsoring.rs b/runtime/common/config/sponsoring.rs index b9c2ae8603..be421b40d3 100644 --- a/runtime/common/config/sponsoring.rs +++ b/runtime/common/config/sponsoring.rs @@ -14,16 +14,17 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use frame_support::parameter_types; use crate::{ runtime_common::{sponsoring::UniqueSponsorshipHandler}, Runtime, }; -use up_common::{types::BlockNumber, constants::*}; +use frame_support::parameter_types; +use sp_core::U256; +use up_common::{constants::*, types::BlockNumber}; parameter_types! { pub const DefaultSponsoringRateLimit: BlockNumber = 1 * DAYS; - pub const DefaultSponsoringFeeLimit: u128 = u128::MAX; + pub const DefaultSponsoringFeeLimit: U256 = U256::MAX; } type SponsorshipHandler = ( diff --git a/runtime/common/ethereum/sponsoring.rs b/runtime/common/ethereum/sponsoring.rs index f2aa07bb5c..e83a87351a 100644 --- a/runtime/common/ethereum/sponsoring.rs +++ b/runtime/common/ethereum/sponsoring.rs @@ -16,27 +16,31 @@ //! Implements EVM sponsoring logic via TransactionValidityHack +use core::{convert::TryInto, marker::PhantomData}; use evm_coder::{Call, abi::AbiReader}; use pallet_common::{CollectionHandle, eth::map_eth_to_id}; +use pallet_evm::account::CrossAccountId; +use pallet_evm_transaction_payment::CallContext; +use pallet_nonfungible::{ + Config as NonfungibleConfig, + erc::{ + UniqueNFTCall, ERC721UniqueExtensionsCall, ERC721MintableCall, ERC721Call, + TokenPropertiesCall, + }, +}; +use pallet_fungible::{ + Config as FungibleConfig, + erc::{UniqueFungibleCall, ERC20Call}, +}; +use pallet_refungible::Config as RefungibleConfig; +use pallet_unique::Config as UniqueConfig; use sp_core::H160; use sp_std::prelude::*; +use up_data_structs::{CollectionMode, CreateItemData, CreateNftData, TokenId}; use up_sponsorship::SponsorshipHandler; -use core::marker::PhantomData; -use core::convert::TryInto; -use pallet_evm::account::CrossAccountId; -use up_data_structs::{TokenId, CreateItemData, CreateNftData, CollectionMode}; -use pallet_unique::Config as UniqueConfig; use crate::{Runtime, runtime_common::sponsoring::*}; -use pallet_nonfungible::erc::{ - UniqueNFTCall, ERC721UniqueExtensionsCall, ERC721MintableCall, ERC721Call, TokenPropertiesCall, -}; -use pallet_fungible::erc::{UniqueFungibleCall, ERC20Call}; -use pallet_fungible::Config as FungibleConfig; -use pallet_nonfungible::Config as NonfungibleConfig; -use pallet_refungible::Config as RefungibleConfig; - pub type EvmSponsorshipHandler = ( UniqueEthSponsorshipHandler, pallet_evm_contract_helpers::HelpersContractSponsoring, @@ -44,12 +48,13 @@ pub type EvmSponsorshipHandler = ( pub struct UniqueEthSponsorshipHandler(PhantomData<*const T>); impl - SponsorshipHandler), u128> for UniqueEthSponsorshipHandler + SponsorshipHandler), CallContext> + for UniqueEthSponsorshipHandler { fn get_sponsor( who: &T::CrossAccountId, call: &(H160, Vec), - _fee_limit: &u128, + _fee_limit: &CallContext, ) -> Option { let collection_id = map_eth_to_id(&call.0)?; let collection = >::new(collection_id)?; diff --git a/runtime/common/sponsoring.rs b/runtime/common/sponsoring.rs index ba3f71d61c..d40e0a92e1 100644 --- a/runtime/common/sponsoring.rs +++ b/runtime/common/sponsoring.rs @@ -224,12 +224,12 @@ fn load(id: CollectionId) -> Option<(T::AccountId, CollectionHa } pub struct UniqueSponsorshipHandler(PhantomData); -impl SponsorshipHandler for UniqueSponsorshipHandler +impl SponsorshipHandler for UniqueSponsorshipHandler where T: Config, C: IsSubType>, { - fn get_sponsor(who: &T::AccountId, call: &C, _fee_limit: &u128) -> Option { + fn get_sponsor(who: &T::AccountId, call: &C, _call_context: &()) -> Option { match IsSubType::>::is_sub_type(call)? { UniqueCall::set_token_properties { collection_id, diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 526edcdac1..9a96bd7063 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -431,7 +431,7 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } @@ -442,7 +442,7 @@ pallet-base-fee = { default-features = false, git = "https://github.com/uniquene fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e" } ################################################################################ # Build Dependencies diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 41236bb94a..05b4801204 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -432,7 +432,7 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } @@ -443,7 +443,7 @@ pallet-base-fee = { default-features = false, git = "https://github.com/uniquene fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e" } ################################################################################ # Build Dependencies diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index a13bcea87d..645672e22b 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -43,4 +43,4 @@ parity-scale-codec = { version = "3.1.2", default-features = false, features = [ scale-info = "*" evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e" } diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 0aa24948d8..80635660a1 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -425,7 +425,7 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } @@ -437,7 +437,7 @@ fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/fro fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="a8ec4bf8d5ded662d96da6d8fb211b0bbf6617b3" } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e" } ################################################################################ # Build Dependencies diff --git a/tests/src/eth/api/ContractHelpers.sol b/tests/src/eth/api/ContractHelpers.sol index cee54dd135..a478c0681f 100644 --- a/tests/src/eth/api/ContractHelpers.sol +++ b/tests/src/eth/api/ContractHelpers.sol @@ -23,7 +23,7 @@ interface ContractHelpersEvents { } /// @title Magic contract, which allows users to reconfigure other contracts -/// @dev the ERC-165 identifier for this interface is 0xd77fab70 +/// @dev the ERC-165 identifier for this interface is 0x172cb4fb interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// Get user, which deployed specified contract /// @dev May return zero address in case if contract is deployed @@ -131,9 +131,9 @@ interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents { function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) external; - /// @dev EVM selector for this function is: 0x1c362eb4, - /// or in textual repr: setSponsoringFeeLimit(address,uint128) - function setSponsoringFeeLimit(address contractAddress, uint128 feeLimit) + /// @dev EVM selector for this function is: 0x03aed665, + /// or in textual repr: setSponsoringFeeLimit(address,uint256) + function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) external; /// @dev EVM selector for this function is: 0xc3fdc9ee, @@ -141,7 +141,7 @@ interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents { function getSponsoringFeeLimit(address contractAddress) external view - returns (uint128); + returns (uint256); /// Is specified user present in contract allow list /// @dev Contract owner always implicitly included diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index 6c8f666b89..b8c0cc1edf 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -558,7 +558,7 @@ describe('Sponsoring Fee Limit', () => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const flipper = await deployFlipper(web3, owner); const helpers = contractHelpers(web3, owner); - expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('340282366920938463463374607431768211455'); + expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935'); }); itWeb3('Set fee limit', async ({api, web3, privateKeyWrapper}) => { diff --git a/tests/src/eth/util/contractHelpersAbi.json b/tests/src/eth/util/contractHelpersAbi.json index db542feda7..a4686d431c 100644 --- a/tests/src/eth/util/contractHelpersAbi.json +++ b/tests/src/eth/util/contractHelpersAbi.json @@ -135,7 +135,7 @@ } ], "name": "getSponsoringFeeLimit", - "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, @@ -225,7 +225,7 @@ "name": "contractAddress", "type": "address" }, - { "internalType": "uint128", "name": "feeLimit", "type": "uint128" } + { "internalType": "uint256", "name": "feeLimit", "type": "uint256" } ], "name": "setSponsoringFeeLimit", "outputs": [], From f5580aaa87063d094d6834e7f00d8cb43318c6a9 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 13 Sep 2022 07:37:27 +0000 Subject: [PATCH 0856/1274] chore: fix merge --- Cargo.lock | 128 +++++++---------------- client/rpc/src/lib.rs | 2 +- pallets/app-promotion/Cargo.toml | 2 +- primitives/app_promotion_rpc/Cargo.toml | 2 +- runtime/common/runtime_apis.rs | 3 +- tests/src/eth/contractSponsoring.test.ts | 2 +- 6 files changed, 44 insertions(+), 95 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fdec00235b..5f529ed28d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -117,7 +117,7 @@ name = "app-promotion-rpc" version = "0.1.0" dependencies = [ "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "parity-scale-codec 3.1.5", "sp-api", "sp-core", @@ -2566,20 +2566,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "fp-evm" -version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" -dependencies = [ - "evm", - "frame-support", - "impl-trait-for-tuples", - "parity-scale-codec 3.1.5", - "serde", - "sp-core", - "sp-std", -] - [[package]] name = "fp-evm" version = "3.0.0-dev" @@ -2594,15 +2580,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "fp-evm-mapping" -version = "0.1.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" -dependencies = [ - "frame-support", - "sp-core", -] - [[package]] name = "fp-evm-mapping" version = "0.1.0" @@ -2619,7 +2596,7 @@ source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a4 dependencies = [ "ethereum", "ethereum-types", - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm", "parity-scale-codec 3.1.5", "scale-info", "sp-api", @@ -5175,7 +5152,7 @@ dependencies = [ "cumulus-primitives-utility", "derivative", "evm-coder", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm-mapping", "fp-rpc", "fp-self-contained", "frame-benchmarking", @@ -5195,7 +5172,7 @@ dependencies = [ "pallet-common", "pallet-configuration", "pallet-ethereum", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-evm-contract-helpers", "pallet-evm-migration", @@ -5343,7 +5320,7 @@ dependencies = [ "frame-system", "pallet-balances", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", + "pallet-evm", "pallet-evm-contract-helpers", "pallet-evm-migration", "pallet-randomness-collective-flip", @@ -5470,7 +5447,7 @@ name = "pallet-base-fee" version = "1.0.0" source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" dependencies = [ - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm", "frame-support", "frame-system", "parity-scale-codec 3.1.5", @@ -5579,11 +5556,11 @@ version = "0.1.8" dependencies = [ "ethereum", "evm-coder", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm-mapping", "frame-benchmarking", "frame-support", "frame-system", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "pallet-evm-coder-substrate", "parity-scale-codec 3.1.5", "scale-info", @@ -5598,7 +5575,7 @@ dependencies = [ name = "pallet-configuration" version = "0.1.1" dependencies = [ - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm", "frame-support", "frame-system", "parity-scale-codec 3.1.5", @@ -5689,15 +5666,15 @@ dependencies = [ "ethereum-types", "evm", "fp-consensus", - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm", + "fp-evm-mapping", "fp-rpc", "fp-self-contained", "fp-storage", "frame-support", "frame-system", "log", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "pallet-timestamp", "parity-scale-codec 3.1.5", "rlp", @@ -5709,41 +5686,14 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-evm" -version = "6.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27#69945f20e8dc06ab9e0dd636848a8db6a408c71c" -dependencies = [ - "evm", - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27)", - "frame-benchmarking", - "frame-support", - "frame-system", - "hex", - "impl-trait-for-tuples", - "log", - "pallet-timestamp", - "parity-scale-codec 3.1.5", - "primitive-types", - "rlp", - "scale-info", - "serde", - "sha3 0.10.2", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - [[package]] name = "pallet-evm" version = "6.0.0-dev" source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" dependencies = [ "evm", - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm", + "fp-evm-mapping", "frame-benchmarking", "frame-support", "frame-system", @@ -5773,7 +5723,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-ethereum", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "parity-scale-codec 3.1.5", "scale-info", "sp-core", @@ -5787,12 +5737,12 @@ version = "0.2.0" dependencies = [ "ethereum", "evm-coder", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm-mapping", "frame-support", "frame-system", "log", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-evm-transaction-payment", "parity-scale-codec 3.1.5", @@ -5808,11 +5758,11 @@ dependencies = [ name = "pallet-evm-migration" version = "0.1.1" dependencies = [ - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm", "frame-benchmarking", "frame-support", "frame-system", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "parity-scale-codec 3.1.5", "scale-info", "sp-core", @@ -5825,12 +5775,12 @@ dependencies = [ name = "pallet-evm-transaction-payment" version = "0.1.1" dependencies = [ - "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm", + "fp-evm-mapping", "frame-support", "frame-system", "pallet-ethereum", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "parity-scale-codec 3.1.5", "scale-info", "sp-core", @@ -5850,7 +5800,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-structure", "parity-scale-codec 3.1.5", @@ -6092,7 +6042,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-structure", "parity-scale-codec 3.1.5", @@ -6215,7 +6165,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-structure", "parity-scale-codec 3.1.5", @@ -6236,7 +6186,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "pallet-nonfungible", "pallet-structure", "parity-scale-codec 3.1.5", @@ -6256,7 +6206,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "pallet-nonfungible", "pallet-rmrk-core", "parity-scale-codec 3.1.5", @@ -6386,7 +6336,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "parity-scale-codec 3.1.5", "scale-info", "sp-std", @@ -6533,7 +6483,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-nonfungible", "pallet-refungible", @@ -8436,7 +8386,7 @@ dependencies = [ "cumulus-primitives-utility", "derivative", "evm-coder", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm-mapping", "fp-rpc", "fp-self-contained", "frame-benchmarking", @@ -8456,7 +8406,7 @@ dependencies = [ "pallet-common", "pallet-configuration", "pallet-ethereum", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-evm-contract-helpers", "pallet-evm-migration", @@ -11701,13 +11651,13 @@ name = "tests" version = "0.1.1" dependencies = [ "evm-coder", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm-mapping", "frame-support", "frame-system", "pallet-balances", "pallet-common", "pallet-ethereum", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-fungible", "pallet-nonfungible", @@ -12204,7 +12154,7 @@ dependencies = [ "app-promotion-rpc", "jsonrpsee", "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "parity-scale-codec 3.1.5", "rmrk-rpc", "sp-api", @@ -12430,7 +12380,7 @@ dependencies = [ "cumulus-primitives-utility", "derivative", "evm-coder", - "fp-evm-mapping 0.1.0 (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "fp-evm-mapping", "fp-rpc", "fp-self-contained", "frame-benchmarking", @@ -12450,7 +12400,7 @@ dependencies = [ "pallet-common", "pallet-configuration", "pallet-ethereum", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "pallet-evm-coder-substrate", "pallet-evm-contract-helpers", "pallet-evm-migration", @@ -12536,7 +12486,7 @@ version = "0.9.27" dependencies = [ "fp-rpc", "frame-support", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "sp-consensus-aura", "sp-core", "sp-runtime", @@ -12550,7 +12500,7 @@ dependencies = [ "derivative", "frame-support", "frame-system", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "parity-scale-codec 3.1.5", "rmrk-traits", "scale-info", @@ -12566,7 +12516,7 @@ name = "up-rpc" version = "0.1.3" dependencies = [ "pallet-common", - "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d)", + "pallet-evm", "parity-scale-codec 3.1.5", "sp-api", "sp-core", diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index e94a7e5ade..d6e3663201 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -577,8 +577,8 @@ where BlockNumber: Decode + Member + AtLeast32BitUnsigned, AccountId: Decode, C: 'static + ProvideRuntimeApi + HeaderBackend, - C::Api: AppPromotionRuntimeApi, CrossAccountId: pallet_evm::account::CrossAccountId, + C::Api: AppPromotionRuntimeApi, { pass_method!(total_staked(staker: Option) -> String => |v| v.to_string(), app_promotion_api); pass_method!(total_staked_per_block(staker: CrossAccountId) -> Vec<(BlockNumber, String)> => diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index d264c07184..d387306914 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -52,7 +52,7 @@ frame-system ={ default-features = false, git = "https://github.com/paritytech/s pallet-balances ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } pallet-timestamp ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } pallet-randomness-collective-flip ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm ={ default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm ={ default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } sp-std ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } diff --git a/primitives/app_promotion_rpc/Cargo.toml b/primitives/app_promotion_rpc/Cargo.toml index 68b4a3e8b5..41931376a6 100644 --- a/primitives/app_promotion_rpc/Cargo.toml +++ b/primitives/app_promotion_rpc/Cargo.toml @@ -14,7 +14,7 @@ sp-core = { default-features = false, git = "https://github.com/paritytech/subst sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } [features] default = ["std"] diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index 61dfddf767..edc2f0ef53 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -48,8 +48,7 @@ macro_rules! impl_common_runtime_apis { }; use pallet_evm::{ Runner, account::CrossAccountId as _, - Account as EVMAccount, - FeeCalculator + Account as EVMAccount, FeeCalculator, }; use runtime_common::{ sponsoring::{SponsorshipPredict, UniqueSponsorshipPredict}, diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index b8c0cc1edf..71f4f9c2ea 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -33,7 +33,7 @@ import { GAS_ARGS, subToEth, } from './util/helpers'; -import { submitTransactionAsync } from '../substrate/substrate-api'; +import {submitTransactionAsync} from '../substrate/substrate-api'; describe('Sponsoring EVM contracts', () => { itWeb3('Self sponsored can be set by the address that deployed the contract', async ({api, web3, privateKeyWrapper}) => { From 0707cc7cb0a89fa1f720b462ae500fd5168fed9b Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 13 Sep 2022 07:37:27 +0000 Subject: [PATCH 0857/1274] chore: move contract address and transaction data to call context --- Cargo.lock | 4 +-- pallets/evm-contract-helpers/Cargo.toml | 2 +- pallets/evm-contract-helpers/src/eth.rs | 11 +++---- pallets/evm-transaction-payment/Cargo.toml | 2 +- pallets/evm-transaction-payment/src/lib.rs | 38 +++++++++++----------- pallets/scheduler/Cargo.toml | 2 +- pallets/unique/src/eth/mod.rs | 8 ++--- runtime/common/ethereum/sponsoring.rs | 11 +++---- runtime/common/sponsoring.rs | 4 +-- runtime/opal/Cargo.toml | 4 +-- runtime/quartz/Cargo.toml | 4 +-- runtime/tests/Cargo.toml | 2 +- runtime/unique/Cargo.toml | 4 +-- 13 files changed, 45 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5f529ed28d..b06eda768b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6360,7 +6360,7 @@ dependencies = [ [[package]] name = "pallet-template-transaction-payment" version = "3.0.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?rev=9ee7d6e57e03a2575cbab79431774b56f170018e#9ee7d6e57e03a2575cbab79431774b56f170018e" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04" dependencies = [ "frame-benchmarking", "frame-support", @@ -12528,7 +12528,7 @@ dependencies = [ [[package]] name = "up-sponsorship" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?rev=9ee7d6e57e03a2575cbab79431774b56f170018e#9ee7d6e57e03a2575cbab79431774b56f170018e" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04" dependencies = [ "impl-trait-for-tuples", ] diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index 8c1eedfb63..f94c91fd65 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -21,7 +21,7 @@ sp-core = { default-features = false, git = "https://github.com/paritytech/subst # Unique pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } # Locals evm-coder = { default-features = false, path = '../../crates/evm-coder' } diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 313cbce3fe..4ef4848bf7 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -379,27 +379,26 @@ impl OnCreate for HelpersOnCreate { /// Bridge to pallet-sponsoring pub struct HelpersContractSponsoring(PhantomData<*const T>); -impl SponsorshipHandler), CallContext> +impl SponsorshipHandler for HelpersContractSponsoring { fn get_sponsor( who: &T::CrossAccountId, - call: &(H160, Vec), call_context: &CallContext, ) -> Option { - let (contract_address, _) = call; - let mode = >::sponsoring_mode(*contract_address); + let contract_address = call_context.contract_address; + let mode = >::sponsoring_mode(contract_address); if mode == SponsoringModeT::Disabled { return None; } - let sponsor = match >::get_sponsor(*contract_address) { + let sponsor = match >::get_sponsor(contract_address) { Some(sponsor) => sponsor, None => return None, }; if mode == SponsoringModeT::Allowlisted - && !>::allowed(*contract_address, *who.as_eth()) + && !>::allowed(contract_address, *who.as_eth()) { return None; } diff --git a/pallets/evm-transaction-payment/Cargo.toml b/pallets/evm-transaction-payment/Cargo.toml index 310b7661a8..b65cc7c028 100644 --- a/pallets/evm-transaction-payment/Cargo.toml +++ b/pallets/evm-transaction-payment/Cargo.toml @@ -17,7 +17,7 @@ sp-core = { default-features = false, git = "https://github.com/paritytech/subst pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev = "9ee7d6e57e03a2575cbab79431774b56f170018e" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } [dependencies.codec] diff --git a/pallets/evm-transaction-payment/src/lib.rs b/pallets/evm-transaction-payment/src/lib.rs index b50e268d79..5aca441ba2 100644 --- a/pallets/evm-transaction-payment/src/lib.rs +++ b/pallets/evm-transaction-payment/src/lib.rs @@ -35,6 +35,10 @@ pub mod pallet { /// Contains call data pub struct CallContext { + /// Contract address + pub contract_address: H160, + /// Transaction data + pub input: Vec, /// Max fee for transaction - gasLimit * gasPrice pub max_fee: U256, } @@ -42,11 +46,7 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config + pallet_evm::account::Config { /// Loosly-coupled handlers for evm call sponsoring - type EvmSponsorshipHandler: SponsorshipHandler< - Self::CrossAccountId, - (H160, Vec), - CallContext, - >; + type EvmSponsorshipHandler: SponsorshipHandler; } #[pallet::pallet] @@ -65,12 +65,12 @@ impl fp_evm::TransactionValidityHack for Transacti match reason { WithdrawReason::Call { target, input } => { let origin_sub = T::CrossAccountId::from_eth(origin); - let call_context = CallContext { max_fee }; - T::EvmSponsorshipHandler::get_sponsor( - &origin_sub, - &(*target, input.clone()), - &call_context, - ) + let call_context = CallContext { + contract_address: *target, + input: input.clone(), + max_fee, + }; + T::EvmSponsorshipHandler::get_sponsor(&origin_sub, &call_context) } _ => None, } @@ -79,12 +79,12 @@ impl fp_evm::TransactionValidityHack for Transacti /// Implements sponsoring for evm calls performed from pallet-evm (via api.tx.ethereum.transact/api.tx.evm.call) pub struct BridgeSponsorshipHandler(PhantomData); -impl SponsorshipHandler for BridgeSponsorshipHandler +impl SponsorshipHandler for BridgeSponsorshipHandler where T: Config + pallet_evm::Config, C: IsSubType>, { - fn get_sponsor(who: &T::AccountId, call: &C, _call_context: &()) -> Option { + fn get_sponsor(who: &T::AccountId, call: &C) -> Option { match call.is_sub_type()? { pallet_evm::Call::call { source, @@ -101,16 +101,16 @@ where .ok()?; let who = T::CrossAccountId::from_sub(who.clone()); let max_fee = max_fee_per_gas.saturating_mul((*gas_limit).into()); - let call_context = CallContext { max_fee }; + let call_context = CallContext { + contract_address: *target, + input: input.clone(), + max_fee, + }; // Effects from EvmSponsorshipHandler are applied by pallet_evm::runner // TODO: Should we implement simulation mode (test, but do not apply effects) in `up-sponsorship`? let sponsor = frame_support::storage::with_transaction(|| { TransactionOutcome::Rollback(Ok::<_, DispatchError>( - T::EvmSponsorshipHandler::get_sponsor( - &who, - &(*target, input.clone()), - &call_context, - ), + T::EvmSponsorshipHandler::get_sponsor(&who, &call_context), )) }) // FIXME: it may fail with DispatchError in case of depth limit diff --git a/pallets/scheduler/Cargo.toml b/pallets/scheduler/Cargo.toml index 65f44bdd11..9537aefa15 100644 --- a/pallets/scheduler/Cargo.toml +++ b/pallets/scheduler/Cargo.toml @@ -24,7 +24,7 @@ sp-io = { default-features = false, git = "https://github.com/paritytech/substra sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.27' } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } log = { version = "0.4.14", default-features = false } [dev-dependencies] diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 268aa0c69a..bb44e9711f 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -21,25 +21,23 @@ use ethereum as _; use evm_coder::{execution::*, generate_stubgen, solidity_interface, solidity, weight, types::*}; use frame_support::traits::Get; use pallet_common::{ - CollectionById, CollectionHandle, + CollectionById, dispatch::CollectionDispatch, erc::{ CollectionHelpersEvents, static_property::{key, value as property_value}, }, - Pallet as PalletCommon, }; use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder}; use pallet_evm::{account::CrossAccountId, OnMethodCall, PrecompileHandle, PrecompileResult}; -use pallet_evm_coder_substrate::dispatch_to_evm; use up_data_structs::{ CollectionName, CollectionDescription, CollectionTokenPrefix, CreateCollectionData, - CollectionMode, PropertyKeyPermission, PropertyPermission, PropertyScope, PropertyValue, + CollectionMode, PropertyValue, }; use crate::{Config, SelfWeightOf, weights::WeightInfo}; -use sp_std::{vec, vec::Vec}; +use sp_std::vec::Vec; use alloc::format; /// See [`CollectionHelpersCall`] diff --git a/runtime/common/ethereum/sponsoring.rs b/runtime/common/ethereum/sponsoring.rs index e83a87351a..89080eb5fb 100644 --- a/runtime/common/ethereum/sponsoring.rs +++ b/runtime/common/ethereum/sponsoring.rs @@ -34,7 +34,6 @@ use pallet_fungible::{ }; use pallet_refungible::Config as RefungibleConfig; use pallet_unique::Config as UniqueConfig; -use sp_core::H160; use sp_std::prelude::*; use up_data_structs::{CollectionMode, CreateItemData, CreateNftData, TokenId}; use up_sponsorship::SponsorshipHandler; @@ -48,18 +47,16 @@ pub type EvmSponsorshipHandler = ( pub struct UniqueEthSponsorshipHandler(PhantomData<*const T>); impl - SponsorshipHandler), CallContext> - for UniqueEthSponsorshipHandler + SponsorshipHandler for UniqueEthSponsorshipHandler { fn get_sponsor( who: &T::CrossAccountId, - call: &(H160, Vec), - _fee_limit: &CallContext, + call_context: &CallContext, ) -> Option { - let collection_id = map_eth_to_id(&call.0)?; + let collection_id = map_eth_to_id(&call_context.contract_address)?; let collection = >::new(collection_id)?; let sponsor = collection.sponsorship.sponsor()?.clone(); - let (method_id, mut reader) = AbiReader::new_call(&call.1).ok()?; + let (method_id, mut reader) = AbiReader::new_call(&call_context.input).ok()?; Some(T::CrossAccountId::from_sub(match &collection.mode { CollectionMode::NFT => { let call = >::parse(method_id, &mut reader).ok()??; diff --git a/runtime/common/sponsoring.rs b/runtime/common/sponsoring.rs index d40e0a92e1..62452a9d29 100644 --- a/runtime/common/sponsoring.rs +++ b/runtime/common/sponsoring.rs @@ -224,12 +224,12 @@ fn load(id: CollectionId) -> Option<(T::AccountId, CollectionHa } pub struct UniqueSponsorshipHandler(PhantomData); -impl SponsorshipHandler for UniqueSponsorshipHandler +impl SponsorshipHandler for UniqueSponsorshipHandler where T: Config, C: IsSubType>, { - fn get_sponsor(who: &T::AccountId, call: &C, _call_context: &()) -> Option { + fn get_sponsor(who: &T::AccountId, call: &C) -> Option { match IsSubType::>::is_sub_type(call)? { UniqueCall::set_token_properties { collection_id, diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 9a96bd7063..e0ba39bfe2 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -431,7 +431,7 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } @@ -442,7 +442,7 @@ pallet-base-fee = { default-features = false, git = "https://github.com/uniquene fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e" } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } ################################################################################ # Build Dependencies diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 05b4801204..8d7b5cdcde 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -432,7 +432,7 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } @@ -443,7 +443,7 @@ pallet-base-fee = { default-features = false, git = "https://github.com/uniquene fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e" } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } ################################################################################ # Build Dependencies diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index 645672e22b..b6cf1fd0f1 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -43,4 +43,4 @@ parity-scale-codec = { version = "3.1.2", default-features = false, features = [ scale-info = "*" evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e" } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 80635660a1..bbe09abe3a 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -425,7 +425,7 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } @@ -437,7 +437,7 @@ fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/fro fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", rev="9ee7d6e57e03a2575cbab79431774b56f170018e" } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } ################################################################################ # Build Dependencies From 98cf2b17a00ff794dc01a27cc0d7377552fb1ab5 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 13 Sep 2022 07:37:27 +0000 Subject: [PATCH 0858/1274] chore: refactor tests --- tests/src/eth/contractSponsoring.test.ts | 27 +++++++++--------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index 71f4f9c2ea..cedb1f411c 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -503,19 +503,12 @@ describe('Sponsoring Fee Limit', () => { contract TestContract { event Result(bool); - function test1() public { - uint256 counter = 0; - while(true) { - counter ++; - } - emit Result(true); - } - function test2() public { + function test(uint32 cycles) public { uint256 counter = 0; while(true) { counter ++; - if (counter > 1){ + if (counter > cycles){ break; } } @@ -593,13 +586,13 @@ describe('Sponsoring Fee Limit', () => { const gasPrice = BigInt(await web3.eth.getGasPrice()); - await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 30000n * gasPrice).send(); + await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 2_000_000n * gasPrice).send(); const originalUserBalance = await web3.eth.getBalance(user); - await testContract.methods.test2().send({from: user, gas: 30000}); + await testContract.methods.test(100).send({from: user, gas: 2_000_000}); expect(await web3.eth.getBalance(user)).to.be.equal(originalUserBalance); - await testContract.methods.test2().send({from: user, gas: 40000}); + await testContract.methods.test(100).send({from: user, gas: 2_100_000}); expect(await web3.eth.getBalance(user)).to.not.be.equal(originalUserBalance); }); @@ -618,7 +611,7 @@ describe('Sponsoring Fee Limit', () => { const gasPrice = BigInt(await web3.eth.getGasPrice()); - await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 30000n * gasPrice).send(); + await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 2_000_000n * gasPrice).send(); const alice = privateKeyWrapper('//Alice'); const originalAliceBalance = (await api.query.system.account(alice.address)).data.free.toBigInt(); @@ -628,9 +621,9 @@ describe('Sponsoring Fee Limit', () => { api.tx.evm.call( subToEth(alice.address), testContract.options.address, - testContract.methods.test2().encodeABI(), + testContract.methods.test(100).encodeABI(), Uint8Array.from([]), - 30000n, + 2_000_000n, gasPrice, null, null, @@ -644,9 +637,9 @@ describe('Sponsoring Fee Limit', () => { api.tx.evm.call( subToEth(alice.address), testContract.options.address, - testContract.methods.test2().encodeABI(), + testContract.methods.test(100).encodeABI(), Uint8Array.from([]), - 40000n, + 2_100_000n, gasPrice, null, null, From 011d236d75c628d65e64bfc35a3687f97a713bb0 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 13 Sep 2022 10:42:48 +0300 Subject: [PATCH 0859/1274] change job name --- .github/workflows/node-only-update_v2.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 09836dc5af..98abc53a55 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -10,7 +10,7 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - execution-marix: + execution-matrix: name: execution matrix @@ -42,8 +42,8 @@ jobs: - forkless-update-nodata: - needs: execution-marix + nodes-only-update: + needs: execution-matrix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] @@ -263,8 +263,9 @@ jobs: - name: Remove builder cache if: always() # run this step always run: | - docker builder prune -f + docker builder prune -f -a docker system prune -f + docker image prune -f -a - name: Clean Workspace if: always() From 5969a58a8b5a0845019dd7ba36009e9aca2500e2 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 13 Sep 2022 12:01:58 +0300 Subject: [PATCH 0860/1274] rename dependant job, move try-runtime option from build ARGs to Dockerfile --- .docker/Dockerfile-try-runtime | 2 +- .github/workflows/node-only-update_v2.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index 58ffe7a41b..4622407a8d 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -47,4 +47,4 @@ RUN echo "Requested features: $FEATURE\n" && \ cargo build --features=$FEATURE --release -CMD cargo run --features=$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $REPLICA_FROM +CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $REPLICA_FROM diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 98abc53a55..69eea99c68 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -10,7 +10,7 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - execution-matrix: + nodes-execution-matrix: name: execution matrix @@ -43,7 +43,7 @@ jobs: nodes-only-update: - needs: execution-matrix + needs: nodes-execution-matrix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] From 7e9e8858b43321eb3b26b9d3ea941be138161c39 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 13 Sep 2022 09:03:56 +0000 Subject: [PATCH 0861/1274] chore: add posibility to define different limits for methods in the future --- pallets/evm-contract-helpers/src/eth.rs | 4 ++-- pallets/evm-contract-helpers/src/lib.rs | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 4ef4848bf7..85ebb162b6 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -263,7 +263,7 @@ where } fn get_sponsoring_fee_limit(&self, contract_address: address) -> Result { - Ok(>::get(contract_address)) + Ok(>::get(contract_address, 0xffffffff)) } /// Is specified user present in contract allow list @@ -413,7 +413,7 @@ impl SponsorshipHandler } } - let sponsored_fee_limit = >::get(contract_address); + let sponsored_fee_limit = >::get(contract_address, 0xffffffff); if call_context.max_fee > sponsored_fee_limit { return None; diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index 14389df7f4..3e3ff5ca23 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -121,9 +121,11 @@ pub mod pallet { /// * **Key2** - sponsored user address. /// * **Value** - last sponsored block number. #[pallet::storage] - pub(super) type SponsoringFeeLimit = StorageMap< - Hasher = Twox128, - Key = H160, + pub(super) type SponsoringFeeLimit = StorageDoubleMap< + Hasher1 = Twox128, + Key1 = H160, + Hasher2 = Blake2_128Concat, + Key2 = u32, Value = U256, QueryKind = ValueQuery, OnEmpty = T::DefaultSponsoringFeeLimit, @@ -367,7 +369,7 @@ pub mod pallet { /// Set maximum for gas limit of transaction pub fn set_sponsoring_fee_limit(contract: H160, fee_limit: U256) { - >::insert(contract, fee_limit); + >::insert(contract, 0xffffffff, fee_limit); } /// Is user added to allowlist, or he is owner of specified contract From a2b946bbd86eafc2837ba48ca8cbb7289538ce1d Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 13 Sep 2022 12:08:45 +0300 Subject: [PATCH 0862/1274] change needs --- .github/workflows/node-only-update_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 69eea99c68..4fe20f3743 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -57,7 +57,7 @@ jobs: strategy: matrix: - include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + include: ${{fromJson(needs.nodes-execution-matrix.outputs.matrix)}} steps: From bee4854e1405f19e3c6478fcc35ee52bad07e24b Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 8 Sep 2022 10:46:24 +0000 Subject: [PATCH 0863/1274] feat: Add some collection methods to eth. --- pallets/common/src/erc.rs | 67 ++++++++++++- pallets/common/src/eth.rs | 16 +++- pallets/evm-contract-helpers/src/eth.rs | 9 +- pallets/fungible/src/stubs/UniqueFungible.raw | Bin 3305 -> 3349 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 48 +++++++++- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4453 -> 4497 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 48 +++++++++- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4464 -> 4508 bytes .../refungible/src/stubs/UniqueRefungible.sol | 48 +++++++++- tests/src/eth/allowlist.test.ts | 90 +++++++++++++++++- tests/src/eth/api/UniqueFungible.sol | 31 +++++- tests/src/eth/api/UniqueNFT.sol | 31 +++++- tests/src/eth/api/UniqueRefungible.sol | 31 +++++- tests/src/eth/fungibleAbi.json | 44 +++++++++ tests/src/eth/nonFungibleAbi.json | 44 +++++++++ tests/src/eth/reFungibleAbi.json | 44 +++++++++ tests/src/util/helpers.ts | 2 +- 17 files changed, 531 insertions(+), 22 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 416d410410..b3961177ce 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -32,7 +32,10 @@ use alloc::format; use crate::{ Pallet, CollectionHandle, Config, CollectionProperties, - eth::{convert_cross_account_to_uint256, convert_uint256_to_cross_account}, + eth::{ + convert_cross_account_to_uint256, convert_uint256_to_cross_account, + convert_cross_account_to_tuple, + }, }; /// Events for ethereum collection helper. @@ -146,7 +149,7 @@ where save(self) } - // /// Whether there is a pending sponsor. + /// Whether there is a pending sponsor. fn has_collection_pending_sponsor(&self) -> Result { Ok(matches!( self.collection.sponsorship, @@ -275,7 +278,7 @@ where } /// Get contract address. - fn contract_address(&self, _caller: caller) -> Result
{ + fn contract_address(&self) -> Result
{ Ok(crate::eth::collection_id_to_address(self.id)) } @@ -420,6 +423,16 @@ where save(self) } + /// Checks that user allowed to operate with collection. + /// + /// @param user User address to check. + fn allowed(&self, user: address) -> Result { + Ok(Pallet::::allowed( + self.id, + T::CrossAccountId::from_eth(user), + )) + } + /// Add the user to the allowed list. /// /// @param user Address of a trusted user. @@ -430,6 +443,20 @@ where Ok(()) } + /// Add substrate user to allowed list. + /// + /// @param user User substrate address. + fn add_to_collection_allow_list_substrate( + &mut self, + caller: caller, + user: uint256, + ) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let user = convert_uint256_to_cross_account::(user); + Pallet::::toggle_allowlist(self, &caller, &user, true).map_err(dispatch_to_evm::)?; + Ok(()) + } + /// Remove the user from the allowed list. /// /// @param user Address of a removed user. @@ -440,6 +467,20 @@ where Ok(()) } + /// Remove substrate user from allowed list. + /// + /// @param user User substrate address. + fn remove_from_collection_allow_list_substrate( + &mut self, + caller: caller, + user: uint256, + ) -> Result { + let caller = T::CrossAccountId::from_eth(caller); + let user = convert_uint256_to_cross_account::(user); + Pallet::::toggle_allowlist(self, &caller, &user, false).map_err(dispatch_to_evm::)?; + Ok(()) + } + /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -481,7 +522,7 @@ where /// Returns collection type /// /// @return `Fungible` or `NFT` or `ReFungible` - fn unique_collection_type(&mut self) -> Result { + fn unique_collection_type(&self) -> Result { let mode = match self.collection.mode { CollectionMode::Fungible(_) => "Fungible", CollectionMode::NFT => "NFT", @@ -490,6 +531,16 @@ where Ok(mode.into()) } + /// Get collection owner. + /// + /// @return Tuble with sponsor address and his substrate mirror. + /// If address is canonical then substrate mirror is zero and vice versa. + fn collection_owner(&self) -> Result<(address, uint256)> { + Ok(convert_cross_account_to_tuple::( + &T::CrossAccountId::from_sub(self.owner.clone()), + )) + } + /// Changes collection owner to another account /// /// @dev Owner can be changed only by current owner @@ -511,6 +562,14 @@ where self.set_owner_internal(caller, new_owner) .map_err(dispatch_to_evm::) } + + // TODO: need implement AbiWriter for &Vec + // fn collection_admins(&self) -> Result> { + // let result = pallet_common::IsAdmin::::iter_prefix((self.id,)) + // .map(|(admin, _)| pallet_common::eth::convert_cross_account_to_tuple::(&admin)) + // .collect(); + // Ok(result) + // } } fn check_is_owner_or_admin( diff --git a/pallets/common/src/eth.rs b/pallets/common/src/eth.rs index fbcc12ddba..433357007c 100644 --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -16,7 +16,7 @@ //! The module contains a number of functions for converting and checking ethereum identifiers. -use evm_coder::types::uint256; +use evm_coder::types::{uint256, address}; pub use pallet_evm::account::{Config, CrossAccountId}; use sp_core::H160; use up_data_structs::CollectionId; @@ -69,3 +69,17 @@ where let account_id = T::AccountId::from(new_admin_arr); T::CrossAccountId::from_sub(account_id) } + +/// Convert `CrossAccountId` to `(address, uint256)`. +pub fn convert_cross_account_to_tuple(cross_account_id: &T::CrossAccountId) -> (address, uint256) +where + T::AccountId: AsRef<[u8; 32]> +{ + if cross_account_id.is_canonical_substrate() { + let sub = convert_cross_account_to_uint256::(cross_account_id); + (Default::default(), sub) + } else { + let eth = *cross_account_id.as_eth(); + (eth, Default::default()) + } +} \ No newline at end of file diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index de4ea9b474..711f304197 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -171,14 +171,7 @@ where fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> { let sponsor = Pallet::::get_sponsor(contract_address).ok_or("Contract has no sponsor")?; - let result: (address, uint256) = if sponsor.is_canonical_substrate() { - let sponsor = pallet_common::eth::convert_cross_account_to_uint256::(&sponsor); - (Default::default(), sponsor) - } else { - let sponsor = *sponsor.as_eth(); - (sponsor, Default::default()) - }; - Ok(result) + Ok(pallet_common::eth::convert_cross_account_to_tuple::(&sponsor)) } /// Check tat contract has confirmed sponsor. diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index ebe29b3712a96cbcc6e60406f8f4425e351a48aa..12fbd065ea176476291e940409fd589ad555e0f5 100644 GIT binary patch literal 3349 zcmaJ@dyHIF8NX-eJ%a4)?hG!oW^cNL{y}(DoK|dwsZwbo)jN~!+{PR0IXi8)3+;Ao zHz2Kq`<&g{hvOlC;^-n&1J7=JjWxkEyKUWOx<7O7rtvXlCIYS## z*taW2_4DiZeT84jbEVAJ@@Sb~&y_iYGt27p?VJhuA)P;L=jxilRlC!QfaB=xTFY8m zTHV(w2Jg2s~34|dlBj0?}~ z7G3ikRx-HK%Of>E-`AVt%=7ctdV|nA2R+4Wg6^&5>V_?mu?O|Z8Y|g@Q!blAUhB+v zfs$F4>C986n-6o95d!^$&%5V434twL7WDX!ekmABvHChCU5 z2&FTu3y-es6dil8D)38vW_4`ZUXc;3q?^^5uI_JUgz{^U=RP-h3gkpc_K1#Of;|7p zM>0JkG6VAB(B(UNMD%Kquk3zkHMlQ=oIUxhlR(X3eW`Y_P^4O{xH@f$(@FeF1~TP6k$gWLh`u=|BKLgU-(A6CHK3+}z2 zSo<=_NsyzF8y*8m4TMu;R>?TlH)Cs!_Sd~~%d8gH|L+};l)U2UYkEVBYn?CM1McRg zZsw+SwT$Rk11TaQ^;MAFPZkRygpcH|z6kP7aIbsmra|aNK@ObS4Q`|hS%F9B03I;j@n8d715W` zmC@A|LjiMIbexdPIbwbp=b>2gvspS4jA*kS@!ytmv?)5C7tyatA<^;ux-VioiPx|e5+7^VPrQLuWMxyI&-?XUyNv@fhy{Pi&F$LB2Ntc4 z)2fMcv1Do;?ahXX2v9d;NKLovE!n$>y~ueHJw^#JOLlN;P3I#LW&_tw!(t7;QD$M( zNM4eXEv-@>7u=?A#40+_3YOvigQZ0w)0J2n`fUF9{PjE%5oID;K@HM_vLI9`+~mp! zN%0TbL@wN~KdQ~j{(?8S@^Pz?Q}SmPOf(5@mh(Yp29rR6mK*8Hiss1UIYItGi!ELN&H4A7W} zt-xI@4b~U~Uf$n}0l;z|!+_Bm_#!PT@}$5hR~_bx*m6QH9U`}Zzc2s<&5Mpl;A7tn z!N;C*M9i!hQ(QghA7q7tOJg|K79|O`kIA;-ip2UB8=epUtc-1UUYiy1td6gUVN_!# z__Bx?rVN4P-cS54h~L!|4-?)piWw~8+aR$`N@zTm#|b8*NVypV7Iy-?cA=$)`6}Ya z1GWRt7W2AA{CfezEQt8CBK|X5#P30O#`BoW$Y;Fn*Yh@WnD1E3pK!>;#XzIsvW8*1 zomr7suJfY1pYj?1FKt@5f)WuCdkdBlS9vnAR@tqwLJj3a!xfR@2Bxep;;&YWBZp~@ z;*TOQ5d?Q@WGr!a;7KGj)Dt;xXdj)%&(Dd`PBhN4Ls+ve_E1T3f$*}(^ix#VOi{xv8 z8X710R;zKSXJU(bW|C@=3gchsnbb;Mq?QL|wadhp?U2gh)E)}Dp%rEeYHCy9b4gRD zc7+k7_IY+K$S&?6DrTWd2T_KeIurtazYL~kf=z32)TtMmmjCG5XgjLg6kQErtA=Gy z{VNb#f-9W}wbR}0xI}uHtR~%+vU!7IwxUem(Nw!TxRdHyQ-#_-IOMqM+>I7zw$+CY za&o3fKY+))lWS;(=in_b(o?OcyjSMIOWvC^CTh$3`_fMwf<$$Nc@65_nrX>aNl8-J&|Kf*#p9wqxtgt)t^xx2Pkd>ZlkWxqs{b0kyuLB>(^b literal 3305 zcmaJ@d2Afj9iF$lGkee$+p(9Jwd5g*P%jFEE|f#<8fY6S9J5<{2X#Vu&zs;Fh?5eF z7E+oy*9nMrcI{lHl_Dx7h5o_O2w4=hO%D)mA*%8RkvN*F4Hc;>ia?MyHSYI&GrL|} z5nk>3d%yd72S3S66@D?d9j6kGDxdfrKX^4~K+3An#qaA?%lM+*2XvXq6?@(?Miut6 zs#UvX-HvbblLf9+_z+K3_!_RvTbw!0KKfN^!eVO+0w5$_q(upua^E`x2yk@VxH>x^*5Ao42&Y#8*d zT27fWd`g9+BTb(%A#euYtEv{#=yLFr^@l;YxoY|Nw;N&THXro5kx4JO>ky0&&+Jmu z2s~D{xYEy)^{_C|pXV$H3l{_<&^r!2C1?fRU(YuzS4PI}H+R)p*&Uhj*$nF1V4;sF z*=>k2a4B}S-<%3qS=!wd7WkPwOgkf#fMGzxDX?$^xrp=5Lsi)^W0iLYZ-xfKLu*C-U@;8!+HZ)6UmEz3OE3`?Vx)(;9Y?CtuB2bHgo@<#zMeDE!|7gU%3;t zc?nWO-t9L5J`zLdt_3tN(>@1CnQWX|y%(?qIOgB_R%~%|<5LQ#w{%(r>wQRFe%+}t zuo8gR8E-!TNP(5s{qH}3WU+Mg{Qk~px-a=^y;~%@z#<6NO@J$&EEQvCEAyXx1Ms(? zUU=-15x^6Gt7q>e>RWLLqwEJhmZZuSUOEgY0M&<%27tQ(wfQ%bfK_kvJey zw2w<=k+2(~P=|=vGNRs1tCk;i53T0fR;5j-b!uogcCOM|r+)f5tdhBwK3@nM`A!>m z$Rrm1W!83TXVx!SP0*?p=TgaRKk??`LPSxwa>!10>Mi3v4PNpIk=jB9vCD3B5*;ig zWtdGIB~6Dl!)ArWSsxI|*QwajD%Ek(ZFYf-eb`Qx;Y@?2B`MP}S04RZ;bnfRfI_60 zNPQMP$bCjOggS-OS@}3A{&7sCV7tt%U|jH{yQ~r}dV{MFClxs*e|FKvko1bw6VYTw zr@I0zKiShKQb!}QNX@w-^`oja-IRwlqH9U~Es}7G2#Mj6N%lK=GB_8}aX*x8AF;^e zU#J(ExGVzZuyWmF2#pC<#rY}?))_;*e6SyfI?D$Pmxj^A7iG~=Cj~~i?lE7a&Qj#k zA!-}>ixWW7yyOKGy!!n(cy-DX>TuPX;retq&5F~@a!?Ojx?G+Yg(?~1#SHuJ27x2 zl(>nTGZfmhRcqf~x*PFF8Q4gI`*kvwE<~P0dW|n_G!2nn%k=;QfethbcxA=VXwrvt z+o@8V=?x~nvO*%gl@I!|*eH}tE;L-H;&~n;NiXu_x->dhQ5Ag;bJiYYmxirJq<=`orpTO)+Uiz_F2^Br8oPE+ zG!5-E+o5JZANgE1)Y%*246?TdZau0l&LC=Lu|^wFrk)*-13p&;v+*;;S(kMFmyu2-P>+wMM@=e1EJiO0EZgcy29#nYrIuGWpsXFt}B%L{UY~})! z9>yZ~s3~&Tt$YD*UAN-*_2Eo$*_O18SZcs8^$`zBF$G7XXtrL^?irS{nwZ?QQ6HbsC&c9V HeVhIdZ8(6r diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index cb99e1917a..5b4e29c991 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -22,7 +22,7 @@ contract ERC165 is Dummy { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0xe54be640 +/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -255,6 +255,18 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Checks that user allowed to operate with collection. + /// + /// @param user User address to check. + /// @dev EVM selector for this function is: 0xd63a8e11, + /// or in textual repr: allowed(address) + function allowed(address user) public view returns (bool) { + require(false, stub_error); + user; + dummy; + return false; + } + /// Add the user to the allowed list. /// /// @param user Address of a trusted user. @@ -266,6 +278,17 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Add substrate user to allowed list. + /// + /// @param user User substrate address. + /// @dev EVM selector for this function is: 0xd06ad267, + /// or in textual repr: addToCollectionAllowListSubstrate(uint256) + function addToCollectionAllowListSubstrate(uint256 user) public { + require(false, stub_error); + user; + dummy = 0; + } + /// Remove the user from the allowed list. /// /// @param user Address of a removed user. @@ -277,6 +300,17 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Remove substrate user from allowed list. + /// + /// @param user User substrate address. + /// @dev EVM selector for this function is: 0xa31913ed, + /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) + function removeFromCollectionAllowListSubstrate(uint256 user) public { + require(false, stub_error); + user; + dummy = 0; + } + /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -325,6 +359,18 @@ contract Collection is Dummy, ERC165 { return ""; } + /// Get collection owner. + /// + /// @return Tuble with sponsor address and his substrate mirror. + /// If address is canonical then substrate mirror is zero and vice versa. + /// @dev EVM selector for this function is: 0xdf727d3b, + /// or in textual repr: collectionOwner() + function collectionOwner() public view returns (Tuple6 memory) { + require(false, stub_error); + dummy; + return Tuple6(0x0000000000000000000000000000000000000000, 0); + } + /// Changes collection owner to another account /// /// @dev Owner can be changed only by current owner diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index a428c0703df3a1ea56bf0c801875b60b604cb5ba..586c74d785a03bcbc766f9aed028191392d456ef 100644 GIT binary patch literal 4497 zcmai23vg7`8NSC&Hk*AVo5w<2Y*t{bj`FZ{V=Z)C&{D>Vxx12GJ6GvBNf5##B19cT z#{1X@50Sf@fMKkb!I>gDS_fz+6-vukM5iJO9cTwZ`jTOsYNxavbO`i2_uRX=iMCC$ zo9~|UzhCF<(sMMKrZ-Sk)6!y$GL?oEN;GYPsYg}NcV_8RdbA`fG_Kcc9;_HyH`l}pms~RC zj6z%W2-kB8dSDEVYjN6|C$xHkMrgcH&-eCZWfg?hs!kwV)2#IqSzYU(gn;BA43=g7 z$|zcj68t7(9?cScDGP#2c-@v!;6}ZMx7yqSEX>a+IsDrIGvX?3H6rk&3A^)POb(jK zw5*&rNJ^nn3-uJt*o2lSC3!P8F5dyZ6X28bj?pcJXi3p6%gCDS`T|Mm9RoQsfVh^3 znS+(&eps2;x$R^yTg;P`C3n3UqnDx(t#xn*WEmV)R7KgU7q0Q}Q0gq$#$o$1ATg=;QGiR`R&f(?e<9QHN zFSa!P&8FI2{iFSWv$49Tp>d0~YE`J(wdUQ$Cj2d9tNfSFBY@0?plS!)`upc*19C$L zBd;HUa2|#2GoN|`aHFG_i?KDVUH8d**y;tHmvyY~#Uu06zho zlbad_+~V+Z^YQ!&w%Qg<_X7R`aF%@G3BZbzwF`IcjWACNTjQglGk|d$f{Mp(;*@8< z0Mq~{4Xr}0K!e&ft>%u00H1f1aWQ!21rnL^-2!sPZEpN&GJ#cI1>@2u*8)E1FjOD+ zC{VT;TO8U+_Oi$afS0i99X{&;11}rj_=d}XF`KuOJd?8(kgM`4;oVn{1K3C#)@N3hsz`%u>{n3R1Tq-^-((xEU2oeV=i8t1EVW z6@RVb=BRzg{p7C}{K7?{$#K}P2}&Lamqyq;5|q)l1q$xHz-~OjHe2>6zTiD>nZZFf zACJn2zR-+OQn>dBYIP4!i4|fVUl;ji{&d<=Ix1M9QLcxhpsaq4c~|lzs3~2XM#zJe zg))wlvPQ~gIZehSB%E{`VVPSoDa7?x5**$oo~*LLNtf!J8#_w>8bg|@2=h)sMT9@F zYJgV}4rqy=hyRU={;y4Vpz1_Vqm=O$*GbwOkpopG4lAyd>r)dd3K(a{tD--|0WX0o z=V@qW-rtC2<~^!2@ADa@zige?u+E|QSWsvQt9H-DJS|$33p^^;-4_Yh^#eAVxGnJC zBtP_Zy?$IXt7*&P#k^N|AkwC2iB_G^R-Ck7rtSuHw?l1PuG3b7G_aa=qs+2&K>jvx zY_m96&2HRdEXn9zRx=Bi5G|dfaic&;1f&OT0W^+FOxz&1QKjaa5wTi zQZ=6ndOcB+Ik^ajt=AV2o6I*ZuNRsTxO43}=DQwCl`Q$576!-(D@>}e zZU-W7<;qSz3dV8A_e;m(w+!a%&nN>l-f#AkME{ul`|SK%6~YO*5Q)-Ufk&mbN{BHM zWke-65)~C!NLD-1R#H2)Xsj1u>6dA;KoCShahGj3t4$U3qC0YO+18~}HD9!pJtBy6 zqheoMbd>ZLbz8}REVJ63xT~V`P}F5Sz0TEIPbEAZq||;g?YfE|E3qM6P^s=&>y$z0 z$6^y@P&tJl_-BsbLpdG2%qR5#pLurw+dUlmP>_wW%FaIvU2$8*!XZBUtiW0WK@9!M ztPS5}>kNOxDK<9?&lCRaAs5a##6Qeilcry0;T6^>6H|yLt%*UYtEqX&!uH*sg`ca; zK^_8D>MLI( z^S^fc@)!mt8b-l>^ReUDb)4Aqmj4z#Rlf|mEiF257 zoRI}SN$QqlwFNnTv&j>417UUT8O0#zc|{)BJ}6p-=j_VP?w*wot-gO^Lwwe$7n-kY zN^kG<+%lN`wUT|b|E0TcOkGnwB(=Rfbm~`s?q2=y@~%52U%fP=Z%NPUc-O5ccYzMjVx{RcH3;T8Y@ literal 4453 zcmai23vg6d8NR2RZ1$aONCI>j*+MD4DAc+XrYH+7$`lJXJ7l+dl{qJYhG2L{Mu^CL z?gkjj-A#D5&d^e=b;hAZ>@ZD7r&2^l>I1A+tCTXeh;_zs7!f;7<9F`4cXOAbW*_;^ zIsg0r&wtKcdWmLp^e(DuTF&m2lJn`2xs(7&Q*0gIf6OcLr`1-VSp_PoBZ}N9k?-b} zuBD6nH_}TfD&^<`T9>1DQfWk?MAIhOdYcOR&H~+`x0Pjuru8N*fElCU=bBRGlFPQ7 zSLkFt$@TmWdSDDqYiT;!BD8*zMrgX&#Mh1&WEF(YtWF?X)13JW1zqc)gn;BnFj$uP zC$DJjl;D+31vE$WjRFX6;B#MIfg4R4zQX2mOgx-dO#IskGtw%ZY$V}H3sx7y7!#Vw z%z|tgq+OxXL>egCsYw&tD6#C+c&h_^7r-Z3p3xJFZDmDwEF)VB14YuVcMO?i2yrbF z+k}|BHT}(3R`+yggbeshI zh6`I*;17UTt*fV7SpBa6ub+7H1R$62-bnw#7FIV^=n`VE^c^gndAPeBOGg2J)}Q|q zW={bA^3IX9fIsmVp8Dj8RZw;nOB`aU7x3BoCx*e>3V6JE++J7A3txSy1q9nXUT(f? z-NEE@XRsuL;n4j%UIbj>QGIReL-XJycc*{*yT1U;yAV_h0k^Mw3GM`50klrv{&UA2 zwX5=WCnSz}#>HSfA5>eWX76^Xww~*@0b4y~YvwF?0~$_(ibH4^2e>Y9*HKVC4!Gfn zeh+5v0NnJ^Q_}%wdb~U_p!ye=G_TE?#{B_ zb5{Uoxe&Z>0LsHlcL4I>7G?!M0m!q_mAm63@b~YYL@owPU07PUzjw7u_29EZD*#{h zsOHI6w?RV%R2*W7yOUk~{=Z#@?8}W40iVb00^=)R0Q|AX%WcMZBbH|Neff)kI{;@d zpA`h$<57iIJoAGj3rxe(_}p*%p={KJpt=WeLR%bV`Z<0H5GecD-x?zEZ%BM>}MJ!z{3GHmzg9A~tFLJ9$OIJ7$$}BI zhitpu+R8fw;aDvP>}w7kUmO$CaEy;Gv*2`xg$0JoHVfU)Cr4b7p{34})7g%s0(QC0 zkqT13pwKsKM%;|5rJ++8)qTEd*RA-&GyNRlZ`F)`FZhLvLX+okq(e~hK=?Gm=CPpE z+7|tie=WKlBiQE3uHlQN{W4>{em)+RF@5od8YzzVms$O1cuJfQ^Z5G6S&gWgV8v@( zkN*{v^*Rea$djP9>*9n#9-J&xa70uzQn4#Ja#KPQEnJ6ZgfQ0|#U1@#f)o9mazvyD zr&oLD=TfiIKc|qUI>Lek6_NP1QvjQej?^nWeF163z_4yBB*v`%vNm>j6G zaR70pT%VdzQNS%MsEHjY4s8isW}vy11rLg87JL%n*_c-bE6y1V>pY4V1%;MzYWGqq zFi~sc0-qG~{>y>yN&y>f+yMA1%MWs0ZyMjq8X^UJSnxa#M9vmlVzN%?WSpKKrk(@p zIUcoZxlSh=q?t9e*O=w#fc!P!SmSW8hV8hUIFhk@Swj;p7Fy1vX`@I;5~LMZ08Qg! zk~YYFR4Vg33o=#CRl|S-+pu_~8r(xs&y;0OF2dpIeNzZy4ewfd5!$kOr7X)8x#HZB zB&}UFkuK-r!$PS7u1OZrNPE#B$R6lNakFq@4&#tg#DlxpW)WPMYP3P}#LObl6~_?z}QY(}VUP$qe3<|B#!1 zr$RU(7a~z=7I{=cuM06orh=%LV^L9YEo7nVu9EO=C1XH@Wl*NsB0&%xitq&2ZWf+a z)Jy)z$rV?ZN>!`Gm4z1xVzVapVZ~F@UD918L$b`mTX6rx&O=dGFfzGXXH>?hLa95l z<;uSD5K?uMXW`?X*kRKN5EpWm7mG7O5oF;mxcN))x|I_Co8Z)|W;(7$0w@ zS5Rps)K`g@S~H6rb>}iH@&b!Iud~Rf(9+zEL+i0EQYbuJg*9UDGPp6X2@cC5ih+wW zi!Lsx84I^|7WoHX(ngdbQTGH;&Sd8}tT(u`EZWF|f5|HYI>~6co%k+suITjYdS>r# zzEPc>r0*s<+04o1BEg$QaFEIB0e;iwf7MOqb*yNwFbf@Pw5C=0%0Frg8Wuey%Aap) z)mOicIX@IcCc215isM-Hr(#0Qu;_29A>xlcPIPo)5Zgd>26%L$*939JBo#$B5uRAG zU}W?hpTP5k&7wEZpZDG5g>Q4kGOm%a&yM91HoCRvWt5v5bN9c08~NOg?eHWG815eU zu)DFR1yR-AnCm~>jh*^`?#3?P!d(`-AuRWK9lKJqTjIA1zOmiH{fWEJtt>vT+E8&a zIgPh#6n{=)<9WfW`g^Tc2Jy{e5oJ(4g&=sRm}T*OrjEVLJM|FndG7vq_i+5VTUzDj zpT*Dntzz-Fc<*xp>of$>^sBu#KH}<31ifPOv+z9O?KZi@$35bEEvM5A$}F+KX=S|o zqRnQVjzOt!Q}d7|+&eZ)tgrS#9v6RibG=JE=IJV2voHA~CQf(nQ09ZX+r1hjP|9zQ7t6BJ-no z&en5gYb)B9PWH=UR@%)u>@?2EBJU)P^9tH>lizGCV(%oZacW*M2==@p4;?xvwhYhN z2T!f++3@J*N2WBV=WeTi=j5d$B;DJ$x@U8`YyG;uO{}Xg4cxPKL+`4!tJd|cTAA)ymtM#EdbX_k58yDwb^rhX diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index bff0092436..dbeb6ae210 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -99,7 +99,7 @@ contract TokenProperties is Dummy, ERC165 { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0xe54be640 +/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -332,6 +332,18 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Checks that user allowed to operate with collection. + /// + /// @param user User address to check. + /// @dev EVM selector for this function is: 0xd63a8e11, + /// or in textual repr: allowed(address) + function allowed(address user) public view returns (bool) { + require(false, stub_error); + user; + dummy; + return false; + } + /// Add the user to the allowed list. /// /// @param user Address of a trusted user. @@ -343,6 +355,17 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Add substrate user to allowed list. + /// + /// @param user User substrate address. + /// @dev EVM selector for this function is: 0xd06ad267, + /// or in textual repr: addToCollectionAllowListSubstrate(uint256) + function addToCollectionAllowListSubstrate(uint256 user) public { + require(false, stub_error); + user; + dummy = 0; + } + /// Remove the user from the allowed list. /// /// @param user Address of a removed user. @@ -354,6 +377,17 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Remove substrate user from allowed list. + /// + /// @param user User substrate address. + /// @dev EVM selector for this function is: 0xa31913ed, + /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) + function removeFromCollectionAllowListSubstrate(uint256 user) public { + require(false, stub_error); + user; + dummy = 0; + } + /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -402,6 +436,18 @@ contract Collection is Dummy, ERC165 { return ""; } + /// Get collection owner. + /// + /// @return Tuble with sponsor address and his substrate mirror. + /// If address is canonical then substrate mirror is zero and vice versa. + /// @dev EVM selector for this function is: 0xdf727d3b, + /// or in textual repr: collectionOwner() + function collectionOwner() public view returns (Tuple17 memory) { + require(false, stub_error); + dummy; + return Tuple17(0x0000000000000000000000000000000000000000, 0); + } + /// Changes collection owner to another account /// /// @dev Owner can be changed only by current owner diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index f60f02ce7ea959994e8c904f35f8f41158772912..d89a40340703d19fd465afc48fe685175645f7b1 100644 GIT binary patch literal 4508 zcmai23vg6d8Q$Y2o6WwG4P&tQJpnJ>5N%5+KhwOUL)0(plv`wH9bvhI-VYtkU8k z&!@Ak^XK(^hhBJ2gcBZmZ0?}q2*&WLKFFFzP3N3s2~)xI)Q9W6Z7XXy4Fky0m%^< ztSJ0RXSF6u@M(y9H6i+H1_W2}+@H>38`T=VDsu}l@klzG!+)D$Mna|aMie_4jn#QD zCI`)AYDO^)(v+p1I_k|^@v(I=N=z$0#%u=PIq-Q*$LP9ztdP}(Wn@F9FHf5E=7Ag; zfL{y5%E3yq2v(Xpx1H?B^qQne$nCS@^lA*EwPwBnMFEEvCss4|!m5tItK=Z{%%q+V zZ%`F+LtvPv+Kvk?n_kVlzrZL-FO5}OR}>a!!wc<<50H1ek=3+4Bxe}fHl{~_C1aQ<(8#wP(8<0Q@>I@NKyIFR4)7e8 z^2DpAkb*{mF3P-TnD^v#TE={bQQN*d(pe8CFEj67#N9H~Glfkbi{hBD36-kv@#d zk27Bn4~g2O%VP>r5iu#^oGEIgXcbdLhNq-f7+4yGxyDj}Bm3n@qzw+erk1(!H|XEu z2vZqhz8T1f2u^c5i*QzZ_|f>^sObM%gw3i>^b}GVUkRP0tYJA&W#Qc7O1VBYsUm@K zj2x7;CC_>fxN_c_TIPFGPBY(mo%wLF=r4++8`e1#|CAJ3QsnNXxVKJ=ae?RMy!%e! zx{1I>3l|6eY2fF-u2+w#WfhGXJglOUJ0fMtlBm}St;eDJY3engUgJ>Pmg}_MAT_L_ zZ-iMw2juSo#~#7KDh}XEBP64GS;bdzAJI}dnlSQ&L_vDO7C;lY&m;_TKlK#&RfiO; zLaO8job!gsJymf{((B2B!pWsOY`y-NTx9-nrk;nk$I{t?q7;>)xLSF%CN+m}iTe`s zr!q95nM5N^d4nK&g!!lALLz();}BB#gKslt65O(sA|ALZfmHIq?_7J1`6pqj6ea(5 zX@HUxZc?RnyWx2eD?9i|7-u{F*By(`7|g#bogJWweyg7(`)`TA-;Te?5KhR2cqq-~ zxmPNyq!=SvgjaIIUQuzIWR;U`C6zOKjXvp?euXyV37jY?7T9*P$|ZTd*X=o_XzNm` zYW50c8zpgWgzqbhj*?xyx~*hDQCQ^*xVED5kkmzt4so?&RKVy2rS`~Didzc<2-U4S z8+628fwQr12noR7CZdHAlArzMLLtsqcHnLdzJ;~vWoh2wofNXEwvfny@G3LX}$C5Exb@gCFxs8 zO39^^LZ09s3s$38)b0F&&i_h9=5(x}eS<{Dx;dg%xzay)T$;{;r)B!{qE=n`E6n-3 zB+8+SXe2+11&8E>nq;A1$wmBaNq9#m2C)oyr;mFl^m$2K%#mVN&%r&Rc^MLG(pU|&Ok-_~6 z3!N4vBD0$|h)kr^l`KN^6^HRgslIqqa#xL=`QbZk((nYsF11g4H9SWWmAo4Mx}1Pl z!|eZgHLObF5ng5CZPGz5=Z0~aa0NVUx4_||f1N~MSpL-i9eA);g4(s z-7Ve8wn$ViBHK!bT`h}Dv;{}*&FN?v{6HAst<`Qbw!5-id+mD=_cC)yg5jpBmp1PG%c6db1z+sbHs8OP8W6`XQn93qI@SB1W zD=Jyjz)uRSDqi|U!Aw#4gMvAf?adPdC6OQ+-jAzhWca&0tD2u-RT~hJn|M9fQ@Pq& zv@e}(Q{=2?3+J#BI3x4ClT@wCXbW@vW@8d-GhtPW(^-R{=CjJcGdpC-aA)3lwyk6B zvUQ8b)g)ef@WsEbynFC){gs^?2mVktG5?P@4!?VM;newxbCZs>@A_8Tx;34x4|@F7 ro_o7jbgWCXu36pP#ag=)z#XgBcDAo-U)|l_mgrcWSk1aS*0=u~2s`lP literal 4464 zcmaJ_4RBP&9e?X3m;25K$srsy*Wf^BRG_wpAEna+)KaYSa*{ipN1fe-08t1u1Smy@ z_i=X#P~qJrAQYKNQA(X!YL&JOQZ3_vwpAISqfRZzOvMiE*p5TT(nz4c-F@%!g0(r` z@!Q@1*Z#kD-_dh4ouN~xZWtN6U8$c>hwh*RNNKT6eE&JCsbAHbfM(>VqK{~5yFz}F z)jIB1dfv;eGAtvt2YI*#(8D=DP+HBQhCyiL02V?Tk zOs415f<;<2s!X81qMevDAx=rbPK+G zN8At?rqnrcp;a^MnD23nQuN#;y<>6TJVQU0JE5=VE&#b7)iRBI=vr#V#XUtekiCS7HZ+&=p~XgCZi4x!;@z;54^r$F^% zz*R%$moa-MV9%FcnF`2L3H2ibgK-^}mgX0H=xA70iYb`A!KIpB^Nl6-?7CM#H77qU z2FL)_7w_K$IKzS9{TEHKcn`!}2iTGM;tj&1j$SSXRNYvbvvc_}hvBYg z1|J4|7qbhNzy4Ri4_y;xsTaNvWqYy2A(r^g((^9=$Kg#MtDOLN6tlCf?|d8Z_bx9t zA7dVk>Ai~{0^9;PbKwj>;4YUc`0#-j>Y0ykXME=E4S*pBf@&7v_3l-cu4m%p!$+kR(Tq?Qxy90m+xRfo&3VI<`=ywC0h9hFbc%GV-PFXJ1>smP`Rt2=jxUZ1sX4+&A2I)}f`$1`lx!Bb2a{C+ zM`Yk3u_T(@P{L=I;zBA&y@CShYNKKU+>DB)fj7ClOvSGM#UH%W%MnELALS2zAo=AM zr6za7Au1`kBSty6&7)2kYg@R}yB6-p2(~%0$M8jN^2&^?8#6lVl_K@Ik%_J!BUAX| zBUYW|0TK@9-X1kJipK6Sc8u#{wO-2DB8;l{F#iG`61~-wM-QSRVp7K0Q8q}~E@y}n z9#^e2&>abll>oPNQvA%m+(z6;#}afa^8DS@Z2t7qm9b||D^euZkl!Dn^;X#4iEF6 z;f~1IvLu>KLYr}rewKPJsOP%Wj^!q8wnzi3Sv1Bhp#$>QfMbo|U^V@?rU=QXURIO9 z9mB}vY0@eZQV-I-jsTj(9VKaz+o)3F*B4TP*15W%!hHyeIM4>caJ=R~L>45Dl3=vY z>X&XAP-(hI;6zC=*|D1iXB5poujkaVqf4iHp^qyIs**TA#`nP`u9BWU(@`?0sw`;W zDvHWOQkOB>&ee)h38TG~IwM;x?1Ziv+-25YX zolFV-TXLEeGsRXzF-Kr%V$pJT3THr|>x__lZ}+AVeC-qw_h=}a!y^)0rPT>!D=#7* zR$T@p)az>5=$egdGIY37q%A*`R7M~2tBG^cQAHOeA^ z#KW!FAodoE8*@%_6beMMaEE5$2XcCEP-+i1bd~0Pry?rY$R8dLhR+3Tk8MRa-_{Tyx$W;9ae(C0al_GOHR@k{` zqGMeh)2ck_AKoKPXW^%1`tzdJJ^3rl`K=_%ql*}%IF5zik`sE0h2O8Zh`#{|@0i3Q zwgvC>bMJ(&NaAvylr=LC_e3V;tdyDI6L__-S;U9_yyKc(c#12Mc8rXCYc!Uy(aAkG zqTJMoQ~%yF5`|hRo(O;4;8&l>&VtC`0hL9b79}FHo2Er3QtC+-A^L>Nc&bugyeWCB z#>xE1$1drx<&@fIy&8>6qKa3eQ{@D_8b$6oiT62PjV_eLW4y|uk4Oi3oEzmAuF-xM zbz0zPQS!Y-_c;bf4_5j%4nWc0JFenSeUM?crDu*2ef9eR1)#OdI z41ORC^499K8OLF<7D+bNs@Ux=^Icx6SnL7bVufQx-;rlarKQJKx@_NbbK1+|aYk&n zOS$h_O4;ENH4BGLexX5$X-q=1w&FUAox<+~R=lig1q(kDu-HEk}) zp5JT=#NJF;?X;|B5!Ae<4({G1ONKl1%D%;2tCp;Ou%#jS^4p*82sdaeSFZb0v}fCy zsb3h^@{eE7UN*nDZD{{X!@sz^c=gKV9dngHo${65WnHV29V@$gdss(r61Z!{s^y(4 UI=g#27bm;AlijShYi;L$0l}clg#Z8m diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index 21eb96d345..92fa860b68 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -99,7 +99,7 @@ contract TokenProperties is Dummy, ERC165 { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0xe54be640 +/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -332,6 +332,18 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Checks that user allowed to operate with collection. + /// + /// @param user User address to check. + /// @dev EVM selector for this function is: 0xd63a8e11, + /// or in textual repr: allowed(address) + function allowed(address user) public view returns (bool) { + require(false, stub_error); + user; + dummy; + return false; + } + /// Add the user to the allowed list. /// /// @param user Address of a trusted user. @@ -343,6 +355,17 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Add substrate user to allowed list. + /// + /// @param user User substrate address. + /// @dev EVM selector for this function is: 0xd06ad267, + /// or in textual repr: addToCollectionAllowListSubstrate(uint256) + function addToCollectionAllowListSubstrate(uint256 user) public { + require(false, stub_error); + user; + dummy = 0; + } + /// Remove the user from the allowed list. /// /// @param user Address of a removed user. @@ -354,6 +377,17 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Remove substrate user from allowed list. + /// + /// @param user User substrate address. + /// @dev EVM selector for this function is: 0xa31913ed, + /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) + function removeFromCollectionAllowListSubstrate(uint256 user) public { + require(false, stub_error); + user; + dummy = 0; + } + /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -402,6 +436,18 @@ contract Collection is Dummy, ERC165 { return ""; } + /// Get collection owner. + /// + /// @return Tuble with sponsor address and his substrate mirror. + /// If address is canonical then substrate mirror is zero and vice versa. + /// @dev EVM selector for this function is: 0xdf727d3b, + /// or in textual repr: collectionOwner() + function collectionOwner() public view returns (Tuple17 memory) { + require(false, stub_error); + dummy; + return Tuple17(0x0000000000000000000000000000000000000000, 0); + } + /// Changes collection owner to another account /// /// @dev Owner can be changed only by current owner diff --git a/tests/src/eth/allowlist.test.ts b/tests/src/eth/allowlist.test.ts index 14c4414979..092c98fabb 100644 --- a/tests/src/eth/allowlist.test.ts +++ b/tests/src/eth/allowlist.test.ts @@ -15,9 +15,19 @@ // along with Unique Network. If not, see . import {expect} from 'chai'; -import {contractHelpers, createEthAccountWithBalance, deployFlipper, itWeb3} from './util/helpers'; +import {isAllowlisted} from '../util/helpers'; +import { + contractHelpers, + createEthAccount, + createEthAccountWithBalance, + deployFlipper, + evmCollection, + evmCollectionHelpers, + getCollectionAddressFromResult, + itWeb3, +} from './util/helpers'; -describe('EVM allowlist', () => { +describe('EVM contract allowlist', () => { itWeb3('Contract allowlist can be toggled', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const flipper = await deployFlipper(web3, owner); @@ -58,3 +68,79 @@ describe('EVM allowlist', () => { expect(await flipper.methods.getValue().call()).to.be.false; }); }); + +describe('EVM collection allowlist', () => { + itWeb3('Collection allowlist can be added and removed by [eth] address', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const user = createEthAccount(web3); + + const collectionHelpers = evmCollectionHelpers(web3, owner); + const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + + expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; + await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner}); + expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.true; + + await collectionEvm.methods.removeFromCollectionAllowList(user).send({from: owner}); + expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; + }); + + itWeb3('Collection allowlist can be added and removed by [sub] address', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const user = privateKeyWrapper('//Alice'); + + const collectionHelpers = evmCollectionHelpers(web3, owner); + const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + + expect(await isAllowlisted(api, collectionId, user)).to.be.false; + await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); + expect(await isAllowlisted(api, collectionId, user)).to.be.true; + + await collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); + expect(await isAllowlisted(api, collectionId, user)).to.be.false; + }); + + itWeb3('Collection allowlist can not be add and remove [eth] address by not owner', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const user = createEthAccount(web3); + + const collectionHelpers = evmCollectionHelpers(web3, owner); + const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + + expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; + await expect(collectionEvm.methods.addToCollectionAllowList(user).call({from: notOwner})).to.be.rejectedWith('NoPermission'); + expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; + await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner}); + + expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.true; + await expect(collectionEvm.methods.removeFromCollectionAllowList(user).call({from: notOwner})).to.be.rejectedWith('NoPermission'); + expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.true; + }); + + itWeb3('Collection allowlist can not be add and remove [sub] address by not owner', async ({api, web3, privateKeyWrapper}) => { + const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const user = privateKeyWrapper('//Alice'); + + const collectionHelpers = evmCollectionHelpers(web3, owner); + const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + + expect(await isAllowlisted(api, collectionId, user)).to.be.false; + await expect(collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); + expect(await isAllowlisted(api, collectionId, user)).to.be.false; + await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); + + expect(await isAllowlisted(api, collectionId, user)).to.be.true; + await expect(collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); + expect(await isAllowlisted(api, collectionId, user)).to.be.true; + }); +}); diff --git a/tests/src/eth/api/UniqueFungible.sol b/tests/src/eth/api/UniqueFungible.sol index 65a4610b76..e6e5886eab 100644 --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -13,7 +13,7 @@ interface ERC165 is Dummy { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0xe54be640 +/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0 interface Collection is Dummy, ERC165 { /// Set collection property. /// @@ -164,6 +164,13 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: setCollectionAccess(uint8) function setCollectionAccess(uint8 mode) external; + /// Checks that user allowed to operate with collection. + /// + /// @param user User address to check. + /// @dev EVM selector for this function is: 0xd63a8e11, + /// or in textual repr: allowed(address) + function allowed(address user) external view returns (bool); + /// Add the user to the allowed list. /// /// @param user Address of a trusted user. @@ -171,6 +178,13 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: addToCollectionAllowList(address) function addToCollectionAllowList(address user) external; + /// Add substrate user to allowed list. + /// + /// @param user User substrate address. + /// @dev EVM selector for this function is: 0xd06ad267, + /// or in textual repr: addToCollectionAllowListSubstrate(uint256) + function addToCollectionAllowListSubstrate(uint256 user) external; + /// Remove the user from the allowed list. /// /// @param user Address of a removed user. @@ -178,6 +192,13 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: removeFromCollectionAllowList(address) function removeFromCollectionAllowList(address user) external; + /// Remove substrate user from allowed list. + /// + /// @param user User substrate address. + /// @dev EVM selector for this function is: 0xa31913ed, + /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) + function removeFromCollectionAllowListSubstrate(uint256 user) external; + /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -208,6 +229,14 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: uniqueCollectionType() function uniqueCollectionType() external returns (string memory); + /// Get collection owner. + /// + /// @return Tuble with sponsor address and his substrate mirror. + /// If address is canonical then substrate mirror is zero and vice versa. + /// @dev EVM selector for this function is: 0xdf727d3b, + /// or in textual repr: collectionOwner() + function collectionOwner() external view returns (Tuple6 memory); + /// Changes collection owner to another account /// /// @dev Owner can be changed only by current owner diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index 8339e4e2d0..2a40c7e390 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -65,7 +65,7 @@ interface TokenProperties is Dummy, ERC165 { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0xe54be640 +/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0 interface Collection is Dummy, ERC165 { /// Set collection property. /// @@ -216,6 +216,13 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: setCollectionAccess(uint8) function setCollectionAccess(uint8 mode) external; + /// Checks that user allowed to operate with collection. + /// + /// @param user User address to check. + /// @dev EVM selector for this function is: 0xd63a8e11, + /// or in textual repr: allowed(address) + function allowed(address user) external view returns (bool); + /// Add the user to the allowed list. /// /// @param user Address of a trusted user. @@ -223,6 +230,13 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: addToCollectionAllowList(address) function addToCollectionAllowList(address user) external; + /// Add substrate user to allowed list. + /// + /// @param user User substrate address. + /// @dev EVM selector for this function is: 0xd06ad267, + /// or in textual repr: addToCollectionAllowListSubstrate(uint256) + function addToCollectionAllowListSubstrate(uint256 user) external; + /// Remove the user from the allowed list. /// /// @param user Address of a removed user. @@ -230,6 +244,13 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: removeFromCollectionAllowList(address) function removeFromCollectionAllowList(address user) external; + /// Remove substrate user from allowed list. + /// + /// @param user User substrate address. + /// @dev EVM selector for this function is: 0xa31913ed, + /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) + function removeFromCollectionAllowListSubstrate(uint256 user) external; + /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -260,6 +281,14 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: uniqueCollectionType() function uniqueCollectionType() external returns (string memory); + /// Get collection owner. + /// + /// @return Tuble with sponsor address and his substrate mirror. + /// If address is canonical then substrate mirror is zero and vice versa. + /// @dev EVM selector for this function is: 0xdf727d3b, + /// or in textual repr: collectionOwner() + function collectionOwner() external view returns (Tuple17 memory); + /// Changes collection owner to another account /// /// @dev Owner can be changed only by current owner diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index 94d7884f88..300518fb45 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -65,7 +65,7 @@ interface TokenProperties is Dummy, ERC165 { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0xe54be640 +/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0 interface Collection is Dummy, ERC165 { /// Set collection property. /// @@ -216,6 +216,13 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: setCollectionAccess(uint8) function setCollectionAccess(uint8 mode) external; + /// Checks that user allowed to operate with collection. + /// + /// @param user User address to check. + /// @dev EVM selector for this function is: 0xd63a8e11, + /// or in textual repr: allowed(address) + function allowed(address user) external view returns (bool); + /// Add the user to the allowed list. /// /// @param user Address of a trusted user. @@ -223,6 +230,13 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: addToCollectionAllowList(address) function addToCollectionAllowList(address user) external; + /// Add substrate user to allowed list. + /// + /// @param user User substrate address. + /// @dev EVM selector for this function is: 0xd06ad267, + /// or in textual repr: addToCollectionAllowListSubstrate(uint256) + function addToCollectionAllowListSubstrate(uint256 user) external; + /// Remove the user from the allowed list. /// /// @param user Address of a removed user. @@ -230,6 +244,13 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: removeFromCollectionAllowList(address) function removeFromCollectionAllowList(address user) external; + /// Remove substrate user from allowed list. + /// + /// @param user User substrate address. + /// @dev EVM selector for this function is: 0xa31913ed, + /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) + function removeFromCollectionAllowListSubstrate(uint256 user) external; + /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -260,6 +281,14 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: uniqueCollectionType() function uniqueCollectionType() external returns (string memory); + /// Get collection owner. + /// + /// @return Tuble with sponsor address and his substrate mirror. + /// If address is canonical then substrate mirror is zero and vice versa. + /// @dev EVM selector for this function is: 0xdf727d3b, + /// or in textual repr: collectionOwner() + function collectionOwner() external view returns (Tuple17 memory); + /// Changes collection owner to another account /// /// @dev Owner can be changed only by current owner diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index a3ee287023..6c80caf1fb 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -76,6 +76,15 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "user", "type": "uint256" } + ], + "name": "addToCollectionAllowListSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, @@ -86,6 +95,15 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "allowed", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, @@ -115,6 +133,23 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "collectionOwner", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "field_0", "type": "address" }, + { "internalType": "uint256", "name": "field_1", "type": "uint256" } + ], + "internalType": "struct Tuple6", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], "name": "collectionProperty", @@ -260,6 +295,15 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "user", "type": "uint256" } + ], + "name": "removeFromCollectionAllowListSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [{ "internalType": "uint8", "name": "mode", "type": "uint8" }], "name": "setCollectionAccess", diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index 9b3c870c21..5a0d6ee990 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -107,6 +107,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "user", "type": "uint256" } + ], + "name": "addToCollectionAllowListSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "allowed", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "approved", "type": "address" }, @@ -145,6 +163,23 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "collectionOwner", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "field_0", "type": "address" }, + { "internalType": "uint256", "name": "field_1", "type": "uint256" } + ], + "internalType": "struct Tuple17", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], "name": "collectionProperty", @@ -374,6 +409,15 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "user", "type": "uint256" } + ], + "name": "removeFromCollectionAllowListSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index 1633b7a4ed..3e5f9d84c3 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -107,6 +107,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "user", "type": "uint256" } + ], + "name": "addToCollectionAllowListSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "allowed", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "approved", "type": "address" }, @@ -145,6 +163,23 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "collectionOwner", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "field_0", "type": "address" }, + { "internalType": "uint256", "name": "field_1", "type": "uint256" } + ], + "internalType": "struct Tuple17", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [{ "internalType": "string", "name": "key", "type": "string" }], "name": "collectionProperty", @@ -374,6 +409,15 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "user", "type": "uint256" } + ], + "name": "removeFromCollectionAllowListSubstrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index 7df4cac32e..ca395f399e 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -1651,7 +1651,7 @@ export async function setChainLimitsExpectFailure(sender: IKeyringPair, limits: }); } -export async function isAllowlisted(api: ApiPromise, collectionId: number, address: string | CrossAccountId) { +export async function isAllowlisted(api: ApiPromise, collectionId: number, address: string | CrossAccountId | IKeyringPair) { return (await api.rpc.unique.allowed(collectionId, normalizeAccountId(address))).toJSON(); } From 294c410fd86dbbf445fd5e591cc19632217d756c Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 8 Sep 2022 12:49:18 +0000 Subject: [PATCH 0864/1274] fix: Add weights to common collection eth methods. --- pallets/common/src/erc.rs | 49 +++++++++++++++++++++++++++++++++++++-- pallets/common/src/lib.rs | 22 +++++++++++++++++- 2 files changed, 68 insertions(+), 3 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index b3961177ce..118050cbeb 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -78,6 +78,8 @@ where key: string, value: bytes, ) -> Result { + self.consume_store_reads_and_writes(1, 1)?; + let caller = T::CrossAccountId::from_eth(caller); let key = >::from(key) .try_into() @@ -92,6 +94,8 @@ where /// /// @param key Property key. fn delete_collection_property(&mut self, caller: caller, key: string) -> Result<()> { + self.consume_store_reads_and_writes(1, 1)?; + let caller = T::CrossAccountId::from_eth(caller); let key = >::from(key) .try_into() @@ -123,6 +127,8 @@ where /// /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. fn set_collection_sponsor(&mut self, caller: caller, sponsor: address) -> Result { + self.consume_store_reads_and_writes(1, 1)?; + check_is_owner_or_admin(caller, self)?; let sponsor = T::CrossAccountId::from_eth(sponsor); @@ -141,6 +147,8 @@ where caller: caller, sponsor: uint256, ) -> Result { + self.consume_store_reads_and_writes(1, 1)?; + check_is_owner_or_admin(caller, self)?; let sponsor = convert_uint256_to_cross_account::(sponsor); @@ -161,6 +169,8 @@ where /// /// @dev After setting the sponsor for the collection, it must be confirmed with this function. fn confirm_collection_sponsorship(&mut self, caller: caller) -> Result { + self.consume_store_writes(1)?; + let caller = T::CrossAccountId::from_eth(caller); if !self .confirm_sponsorship(caller.as_sub()) @@ -173,6 +183,7 @@ where /// Remove collection sponsor. fn remove_collection_sponsor(&mut self, caller: caller) -> Result { + self.consume_store_reads_and_writes(1, 1)?; check_is_owner_or_admin(caller, self)?; self.remove_sponsor().map_err(dispatch_to_evm::)?; save(self) @@ -209,6 +220,8 @@ where /// @param value Value of the limit. #[solidity(rename_selector = "setCollectionLimit")] fn set_int_limit(&mut self, caller: caller, limit: string, value: uint32) -> Result { + self.consume_store_reads_and_writes(1, 1)?; + check_is_owner_or_admin(caller, self)?; let mut limits = self.limits.clone(); @@ -252,6 +265,8 @@ where /// @param value Value of the limit. #[solidity(rename_selector = "setCollectionLimit")] fn set_bool_limit(&mut self, caller: caller, limit: string, value: bool) -> Result { + self.consume_store_reads_and_writes(1, 1)?; + check_is_owner_or_admin(caller, self)?; let mut limits = self.limits.clone(); @@ -289,6 +304,8 @@ where caller: caller, new_admin: uint256, ) -> Result { + self.consume_store_writes(2)?; + let caller = T::CrossAccountId::from_eth(caller); let new_admin = convert_uint256_to_cross_account::(new_admin); >::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::)?; @@ -302,6 +319,8 @@ where caller: caller, admin: uint256, ) -> Result { + self.consume_store_writes(2)?; + let caller = T::CrossAccountId::from_eth(caller); let admin = convert_uint256_to_cross_account::(admin); >::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::)?; @@ -311,6 +330,8 @@ where /// Add collection admin. /// @param newAdmin Address of the added administrator. fn add_collection_admin(&mut self, caller: caller, new_admin: address) -> Result { + self.consume_store_writes(2)?; + let caller = T::CrossAccountId::from_eth(caller); let new_admin = T::CrossAccountId::from_eth(new_admin); >::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::)?; @@ -321,6 +342,8 @@ where /// /// @param admin Address of the removed administrator. fn remove_collection_admin(&mut self, caller: caller, admin: address) -> Result { + self.consume_store_writes(2)?; + let caller = T::CrossAccountId::from_eth(caller); let admin = T::CrossAccountId::from_eth(admin); >::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::)?; @@ -332,6 +355,8 @@ where /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' #[solidity(rename_selector = "setCollectionNesting")] fn set_nesting_bool(&mut self, caller: caller, enable: bool) -> Result { + self.consume_store_reads_and_writes(1, 1)?; + check_is_owner_or_admin(caller, self)?; let mut permissions = self.collection.permissions.clone(); @@ -361,6 +386,8 @@ where enable: bool, collections: Vec
, ) -> Result { + self.consume_store_reads_and_writes(1, 1)?; + if collections.is_empty() { return Err("no addresses provided".into()); } @@ -404,6 +431,8 @@ where /// 0 for Normal /// 1 for AllowList fn set_collection_access(&mut self, caller: caller, mode: uint8) -> Result { + self.consume_store_reads_and_writes(1, 1)?; + check_is_owner_or_admin(caller, self)?; let permissions = CollectionPermissions { access: Some(match mode { @@ -437,6 +466,8 @@ where /// /// @param user Address of a trusted user. fn add_to_collection_allow_list(&mut self, caller: caller, user: address) -> Result { + self.consume_store_writes(1)?; + let caller = T::CrossAccountId::from_eth(caller); let user = T::CrossAccountId::from_eth(user); >::toggle_allowlist(self, &caller, &user, true).map_err(dispatch_to_evm::)?; @@ -451,6 +482,8 @@ where caller: caller, user: uint256, ) -> Result { + self.consume_store_writes(1)?; + let caller = T::CrossAccountId::from_eth(caller); let user = convert_uint256_to_cross_account::(user); Pallet::::toggle_allowlist(self, &caller, &user, true).map_err(dispatch_to_evm::)?; @@ -461,6 +494,8 @@ where /// /// @param user Address of a removed user. fn remove_from_collection_allow_list(&mut self, caller: caller, user: address) -> Result { + self.consume_store_writes(1)?; + let caller = T::CrossAccountId::from_eth(caller); let user = T::CrossAccountId::from_eth(user); >::toggle_allowlist(self, &caller, &user, false).map_err(dispatch_to_evm::)?; @@ -475,6 +510,8 @@ where caller: caller, user: uint256, ) -> Result { + self.consume_store_writes(1)?; + let caller = T::CrossAccountId::from_eth(caller); let user = convert_uint256_to_cross_account::(user); Pallet::::toggle_allowlist(self, &caller, &user, false).map_err(dispatch_to_evm::)?; @@ -485,6 +522,8 @@ where /// /// @param mode Enable if "true". fn set_collection_mint_mode(&mut self, caller: caller, mode: bool) -> Result { + self.consume_store_reads_and_writes(1, 1)?; + check_is_owner_or_admin(caller, self)?; let permissions = CollectionPermissions { mint_mode: Some(mode), @@ -546,6 +585,8 @@ where /// @dev Owner can be changed only by current owner /// @param newOwner new owner account fn set_owner(&mut self, caller: caller, new_owner: address) -> Result { + self.consume_store_writes(1)?; + let caller = T::CrossAccountId::from_eth(caller); let new_owner = T::CrossAccountId::from_eth(new_owner); self.set_owner_internal(caller, new_owner) @@ -557,6 +598,8 @@ where /// @dev Owner can be changed only by current owner /// @param newOwner new owner substrate account fn set_owner_substrate(&mut self, caller: caller, new_owner: uint256) -> Result { + self.consume_store_writes(1)?; + let caller = T::CrossAccountId::from_eth(caller); let new_owner = convert_uint256_to_cross_account::(new_owner); self.set_owner_internal(caller, new_owner) @@ -572,6 +615,8 @@ where // } } +/// ### Note +/// Do not forget to add: `self.consume_store_reads(1)?;` fn check_is_owner_or_admin( caller: caller, collection: &CollectionHandle, @@ -583,9 +628,9 @@ fn check_is_owner_or_admin( Ok(caller) } +/// ### Note +/// Do not forget to add: `self.consume_store_writes(1)?;` fn save(collection: &CollectionHandle) -> Result { - // TODO possibly delete for the lack of transaction - collection.consume_store_writes(1)?; collection .check_is_internal() .map_err(dispatch_to_evm::)?; diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 7f912fb8dc..f3a64ff4de 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -112,7 +112,6 @@ use up_data_structs::{ RmrkBoundedTheme, RmrkNftChild, CollectionPermissions, - SchemaVersion, }; pub use pallet::*; @@ -202,6 +201,21 @@ impl CollectionHandle { )) } + /// Consume gas for reading and writing. + pub fn consume_store_reads_and_writes( + &self, + reads: u64, + writes: u64, + ) -> evm_coder::execution::Result<()> { + let weight = ::DbWeight::get(); + let reads = weight.read.saturating_mul(reads); + let writes = weight.read.saturating_mul(writes); + self.recorder + .consume_gas(T::GasWeightMapping::weight_to_gas( + reads.saturating_add(writes), + )) + } + /// Save collection to storage. pub fn save(&self) -> DispatchResult { >::insert(self.id, &self.collection); @@ -310,6 +324,8 @@ impl CollectionHandle { } /// Changes collection owner to another account + /// #### Store read/writes + /// 1 writes fn set_owner_internal( &mut self, caller: T::CrossAccountId, @@ -1292,6 +1308,8 @@ impl Pallet { } /// Toggle `user` participation in the `collection`'s allow list. + /// #### Store read/writes + /// 1 writes pub fn toggle_allowlist( collection: &CollectionHandle, sender: &T::CrossAccountId, @@ -1312,6 +1330,8 @@ impl Pallet { } /// Toggle `user` participation in the `collection`'s admin list. + /// #### Store read/writes + /// 2 writes pub fn toggle_admin( collection: &CollectionHandle, sender: &T::CrossAccountId, From 5a7505aa2f8fc598aeef85ba6a691b4ad1f414cc Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Thu, 8 Sep 2022 15:05:29 +0000 Subject: [PATCH 0865/1274] refactor: Move tests to playgrounds. --- tests/src/eth/allowlist.test.ts | 80 ++++++++++++++-------------- tests/src/util/playgrounds/unique.ts | 12 +++++ 2 files changed, 53 insertions(+), 39 deletions(-) diff --git a/tests/src/eth/allowlist.test.ts b/tests/src/eth/allowlist.test.ts index 092c98fabb..6a354deaa6 100644 --- a/tests/src/eth/allowlist.test.ts +++ b/tests/src/eth/allowlist.test.ts @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +import {IKeyringPair} from '@polkadot/types/types'; import {expect} from 'chai'; -import {isAllowlisted} from '../util/helpers'; +import {isAllowlisted, normalizeAccountId} from '../util/helpers'; import { contractHelpers, createEthAccount, @@ -26,6 +27,7 @@ import { getCollectionAddressFromResult, itWeb3, } from './util/helpers'; +import {itEth, usingEthPlaygrounds} from './util/playgrounds'; describe('EVM contract allowlist', () => { itWeb3('Contract allowlist can be toggled', async ({api, web3, privateKeyWrapper}) => { @@ -70,14 +72,20 @@ describe('EVM contract allowlist', () => { }); describe('EVM collection allowlist', () => { - itWeb3('Collection allowlist can be added and removed by [eth] address', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const user = createEthAccount(web3); + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); + + itEth('Collection allowlist can be added and removed by [eth] address', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const user = helper.eth.createAccount(); - const collectionHelpers = evmCollectionHelpers(web3, owner); - const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner}); @@ -87,32 +95,28 @@ describe('EVM collection allowlist', () => { expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; }); - itWeb3('Collection allowlist can be added and removed by [sub] address', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const user = privateKeyWrapper('//Alice'); + itEth('Collection allowlist can be added and removed by [sub] address', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const user = donor; - const collectionHelpers = evmCollectionHelpers(web3, owner); - const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - expect(await isAllowlisted(api, collectionId, user)).to.be.false; + expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); - expect(await isAllowlisted(api, collectionId, user)).to.be.true; - + expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; + await collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); - expect(await isAllowlisted(api, collectionId, user)).to.be.false; + expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; }); - itWeb3('Collection allowlist can not be add and remove [eth] address by not owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const user = createEthAccount(web3); + itEth('Collection allowlist can not be add and remove [eth] address by not owner', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const notOwner = await helper.eth.createAccountWithBalance(donor); + const user = helper.eth.createAccount(); - const collectionHelpers = evmCollectionHelpers(web3, owner); - const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; await expect(collectionEvm.methods.addToCollectionAllowList(user).call({from: notOwner})).to.be.rejectedWith('NoPermission'); @@ -124,23 +128,21 @@ describe('EVM collection allowlist', () => { expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.true; }); - itWeb3('Collection allowlist can not be add and remove [sub] address by not owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const user = privateKeyWrapper('//Alice'); + itEth('Collection allowlist can not be add and remove [sub] address by not owner', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const notOwner = await helper.eth.createAccountWithBalance(donor); + const user = donor; - const collectionHelpers = evmCollectionHelpers(web3, owner); - const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - expect(await isAllowlisted(api, collectionId, user)).to.be.false; + expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; await expect(collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); - expect(await isAllowlisted(api, collectionId, user)).to.be.false; + expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); - expect(await isAllowlisted(api, collectionId, user)).to.be.true; + expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; await expect(collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); - expect(await isAllowlisted(api, collectionId, user)).to.be.true; + expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; }); }); diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 9cad24860a..497914f156 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -729,6 +729,18 @@ class CollectionGroup extends HelperGroup { return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'unique', 'CollectionAdminRemoved'); } + /** + * Check if user is in allow list. + * + * @param collectionId ID of collection + * @param user Account to check + * @example await getAdmins(1) + * @returns is user in allow list + */ + async allowed(collectionId: number, user: ICrossAccountId): Promise { + return (await this.helper.callRpc('api.rpc.unique.allowed', [collectionId, user])).toJSON(); + } + /** * Adds an address to allow list * @param signer keyring of signer From b5cee7d587c688639541215f70832d0f4ff77549 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 12 Sep 2022 14:49:42 +0000 Subject: [PATCH 0866/1274] fix: refactor weght calculation. --- pallets/common/src/erc.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 118050cbeb..31fbc0dd91 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -20,6 +20,7 @@ use evm_coder::{ solidity_interface, solidity, ToLog, types::*, execution::{Result, Error}, + weight, }; pub use pallet_evm::{PrecompileOutput, PrecompileResult, PrecompileHandle, account::CrossAccountId}; use pallet_evm_coder_substrate::dispatch_to_evm; @@ -31,11 +32,12 @@ use up_data_structs::{ use alloc::format; use crate::{ - Pallet, CollectionHandle, Config, CollectionProperties, + Pallet, CollectionHandle, Config, CollectionProperties, SelfWeightOf, eth::{ convert_cross_account_to_uint256, convert_uint256_to_cross_account, convert_cross_account_to_tuple, }, + weights::WeightInfo, }; /// Events for ethereum collection helper. @@ -72,14 +74,13 @@ where /// /// @param key Property key. /// @param value Propery value. + #[weight(>::set_collection_properties(1_u32))] fn set_collection_property( &mut self, caller: caller, key: string, value: bytes, ) -> Result { - self.consume_store_reads_and_writes(1, 1)?; - let caller = T::CrossAccountId::from_eth(caller); let key = >::from(key) .try_into() @@ -93,6 +94,7 @@ where /// Delete collection property. /// /// @param key Property key. + #[weight(>::delete_collection_properties(1_u32))] fn delete_collection_property(&mut self, caller: caller, key: string) -> Result<()> { self.consume_store_reads_and_writes(1, 1)?; From d8d2ace0dfbaf2e8b561b02c41bea6a47a82751d Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 13 Sep 2022 09:29:16 +0000 Subject: [PATCH 0867/1274] fmt --- pallets/common/src/erc.rs | 4 ++-- pallets/common/src/eth.rs | 8 +++++--- pallets/evm-contract-helpers/src/eth.rs | 4 +++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index 31fbc0dd91..ebf65ae6d7 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -74,7 +74,7 @@ where /// /// @param key Property key. /// @param value Propery value. - #[weight(>::set_collection_properties(1_u32))] + #[weight(>::set_collection_properties(1))] fn set_collection_property( &mut self, caller: caller, @@ -94,7 +94,7 @@ where /// Delete collection property. /// /// @param key Property key. - #[weight(>::delete_collection_properties(1_u32))] + #[weight(>::delete_collection_properties(1))] fn delete_collection_property(&mut self, caller: caller, key: string) -> Result<()> { self.consume_store_reads_and_writes(1, 1)?; diff --git a/pallets/common/src/eth.rs b/pallets/common/src/eth.rs index 433357007c..f25c65a6f4 100644 --- a/pallets/common/src/eth.rs +++ b/pallets/common/src/eth.rs @@ -71,9 +71,11 @@ where } /// Convert `CrossAccountId` to `(address, uint256)`. -pub fn convert_cross_account_to_tuple(cross_account_id: &T::CrossAccountId) -> (address, uint256) +pub fn convert_cross_account_to_tuple( + cross_account_id: &T::CrossAccountId, +) -> (address, uint256) where - T::AccountId: AsRef<[u8; 32]> + T::AccountId: AsRef<[u8; 32]>, { if cross_account_id.is_canonical_substrate() { let sub = convert_cross_account_to_uint256::(cross_account_id); @@ -82,4 +84,4 @@ where let eth = *cross_account_id.as_eth(); (eth, Default::default()) } -} \ No newline at end of file +} diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 711f304197..ab4ae5033b 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -171,7 +171,9 @@ where fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> { let sponsor = Pallet::::get_sponsor(contract_address).ok_or("Contract has no sponsor")?; - Ok(pallet_common::eth::convert_cross_account_to_tuple::(&sponsor)) + Ok(pallet_common::eth::convert_cross_account_to_tuple::( + &sponsor, + )) } /// Check tat contract has confirmed sponsor. From 11a57bd3fcf7975de259cb4800bebc0a5ab076bc Mon Sep 17 00:00:00 2001 From: PraetorP Date: Tue, 13 Sep 2022 16:45:12 +0700 Subject: [PATCH 0868/1274] fix rpc , empty strings --- pallets/app-promotion/src/lib.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index a99ff88d61..c1ed4b6a56 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -760,7 +760,6 @@ impl Pallet { /// Returns the total staked balance for the staker. /// If `staker` is `None`, returns the total amount staked. /// - `staker`: staker account. - /// pub fn cross_id_total_staked(staker: Option) -> Option> { staker.map_or(Some(>::get()), |s| { Self::total_staked_by_id(s.as_sub()) @@ -777,7 +776,6 @@ impl Pallet { /// the amount of the stake. /// /// - `staker`: staker account. - /// pub fn cross_id_total_staked_per_block( staker: T::CrossAccountId, ) -> Vec<(T::BlockNumber, BalanceOf)> { @@ -832,8 +830,6 @@ where /// Since user funds are not transferred anywhere by staking, overflow protection is provided /// at the level of the associated type `Balance` of `Currency` trait. In order to overflow, /// the staker must have more funds on his account than the maximum set for `Balance` type. - /// - /// **Note**: This `fn` has been added to implement RPC pub fn cross_id_pending_unstake(staker: Option) -> BalanceOf { staker.map_or( PendingUnstake::::iter_values() @@ -858,8 +854,6 @@ where /// the amount of the unreserved funds. /// /// - `staker`: staker account. - /// - /// **Note**: This `fn` has been added to implement RPC pub fn cross_id_pending_unstake_per_block( staker: T::CrossAccountId, ) -> Vec<(T::BlockNumber, BalanceOf)> { From 6804826993dd82f11ebfc50ca20eca627e33c518 Mon Sep 17 00:00:00 2001 From: rkv Date: Tue, 13 Sep 2022 13:00:24 +0300 Subject: [PATCH 0869/1274] createMultipeItems migrated --- tests/src/createMultipleItems.test.ts | 249 +++++++------------------- 1 file changed, 69 insertions(+), 180 deletions(-) diff --git a/tests/src/createMultipleItems.test.ts b/tests/src/createMultipleItems.test.ts index 31906ed0e7..ef9aaf6dee 100644 --- a/tests/src/createMultipleItems.test.ts +++ b/tests/src/createMultipleItems.test.ts @@ -14,28 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync, executeTransaction} from './substrate/substrate-api'; import { - createCollectionExpectSuccess, - destroyCollectionExpectSuccess, - getGenericResult, normalizeAccountId, - setCollectionLimitsExpectSuccess, - addCollectionAdminExpectSuccess, - getBalance, - getTokenOwner, - getLastTokenId, - getCreatedCollectionCount, - createCollectionWithPropsExpectSuccess, - createMultipleItemsWithPropsExpectSuccess, - getTokenProperties, - requirePallets, - Pallets, - checkPalletsPresence, } from './util/helpers'; import {usingPlaygrounds} from './util/playgrounds'; @@ -50,13 +33,12 @@ before(async () => { }); }); -let alice: IKeyringPair; -let bob: IKeyringPair; - describe('Integration Test createMultipleItems(collection_id, owner, items_data):', () => { + let alice: IKeyringPair; + before(async () => { await usingPlaygrounds(async (helper) => { - [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); + [alice] = await helper.arrange.createAccounts([100n], donor); }); }); @@ -209,90 +191,6 @@ describe('Integration Test createMultipleItems(collection_id, owner, items_data) }); }); -describe('Integration Test createMultipleItems(collection_id, owner, items_data) with collection admin permissions:', () => { - let alice: IKeyringPair; - let bob: IKeyringPair; - - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - }); - }); - - it('Create 0x31, 0x32, 0x33 items in active NFT collection and verify tokens data in chain', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionId = await createCollectionWithPropsExpectSuccess({propPerm: [{key: 'data', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}]}); - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - expect(itemsListIndexBefore).to.be.equal(0); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - const args = [ - {NFT: {properties: [{key: 'data', value: 'v1'}]}}, - {NFT: {properties: [{key: 'data', value: 'v2'}]}}, - {NFT: {properties: [{key: 'data', value: 'v3'}]}}, - ]; - const createMultipleItemsTx = api.tx.unique - .createMultipleItems(collectionId, normalizeAccountId(bob.address), args); - await submitTransactionAsync(bob, createMultipleItemsTx); - const itemsListIndexAfter = await getLastTokenId(api, collectionId); - expect(itemsListIndexAfter).to.be.equal(3); - - expect(await getTokenOwner(api, collectionId, 1)).to.be.deep.equal(normalizeAccountId(bob.address)); - expect(await getTokenOwner(api, collectionId, 2)).to.be.deep.equal(normalizeAccountId(bob.address)); - expect(await getTokenOwner(api, collectionId, 3)).to.be.deep.equal(normalizeAccountId(bob.address)); - - expect((await getTokenProperties(api, collectionId, 1, ['data']))[0].value).to.be.equal('v1'); - expect((await getTokenProperties(api, collectionId, 2, ['data']))[0].value).to.be.equal('v2'); - expect((await getTokenProperties(api, collectionId, 3, ['data']))[0].value).to.be.equal('v3'); - }); - }); - - it('Create 0x01, 0x02, 0x03 items in active Fungible collection and verify tokens data in chain', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - expect(itemsListIndexBefore).to.be.equal(0); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - const args = [ - {Fungible: {value: 1}}, - {Fungible: {value: 2}}, - {Fungible: {value: 3}}, - ]; - const createMultipleItemsTx = api.tx.unique - .createMultipleItems(collectionId, normalizeAccountId(bob.address), args); - await submitTransactionAsync(bob, createMultipleItemsTx); - const token1Data = await getBalance(api, collectionId, bob.address, 0); - - expect(token1Data).to.be.equal(6n); // 1 + 2 + 3 - }); - }); - - it('Create 0x31, 0x32, 0x33 items in active ReFungible collection and verify tokens data in chain', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await usingApi(async (api: ApiPromise) => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - expect(itemsListIndexBefore).to.be.equal(0); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - const args = [ - {ReFungible: {pieces: 1}}, - {ReFungible: {pieces: 2}}, - {ReFungible: {pieces: 3}}, - ]; - const createMultipleItemsTx = api.tx.unique - .createMultipleItems(collectionId, normalizeAccountId(bob.address), args); - await submitTransactionAsync(bob, createMultipleItemsTx); - const itemsListIndexAfter = await getLastTokenId(api, collectionId); - expect(itemsListIndexAfter).to.be.equal(3); - - expect(await getBalance(api, collectionId, bob.address, 1)).to.be.equal(1n); - expect(await getBalance(api, collectionId, bob.address, 2)).to.be.equal(2n); - expect(await getBalance(api, collectionId, bob.address, 3)).to.be.equal(3n); - }); - }); -}); - describe('Negative Integration Test createMultipleItems(collection_id, owner, items_data):', () => { let alice: IKeyringPair; let bob: IKeyringPair; @@ -421,84 +319,92 @@ describe('Negative Integration Test createMultipleItems(collection_id, owner, it }); it('Create tokens with different data limits <> maximum data limit', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionId = await createCollectionWithPropsExpectSuccess({ - propPerm: [{key: 'key', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}], + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}, + ], }); const args = [ - {NFT: {properties: [{key: 'key', value: 'A'}]}}, - {NFT: {properties: [{key: 'key', value: 'B'.repeat(32769)}]}}, + {properties: [{key: 'data', value: 'A'}]}, + {properties: [{key: 'data', value: 'B'.repeat(32769)}]}, ]; - const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args); - await expect(submitTransactionExpectFailAsync(alice, createMultipleItemsTx)).to.be.rejected; + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejected; }); }); it('Fails when minting tokens exceeds collectionLimits amount', async () => { - await usingApi(async (api) => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionLimitsExpectSuccess(alice, collectionId, { - tokenLimit: 1, + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}, + ], + limits: { + tokenLimit: 1, + }, }); const args = [ - {NFT: {}}, - {NFT: {}}, + {}, + {}, ]; - const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args); - await expect(executeTransaction(api, alice, createMultipleItemsTx)).to.be.rejectedWith(/common\.CollectionTokenLimitExceeded/); + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejected; }); }); it('User doesnt have editing rights', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionId = await createCollectionWithPropsExpectSuccess({ - propPerm: [{key: 'key1', permission: {mutable: true, collectionAdmin: false, tokenOwner: false}}], + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: false, mutable: true, collectionAdmin: false}}, + ], }); - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - expect(itemsListIndexBefore).to.be.equal(0); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); const args = [ - {NFT: {properties: [{key: 'key1', value: 'v2'}]}}, - {NFT: {}}, - {NFT: {}}, + {properties: [{key: 'data', value: 'A'}]}, ]; - - const tx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(bob.address), args); - await expect(executeTransaction(api, bob, tx)).to.be.rejectedWith(/common\.NoPermission/); + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejected; }); }); it('Adding property without access rights', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionId = await createCollectionWithPropsExpectSuccess({properties: [{key: 'k', value: 'v1'}]}); - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - expect(itemsListIndexBefore).to.be.equal(0); - const args = [{NFT: {properties: [{key: 'k', value: 'v'}]}}, - {NFT: {}}, - {NFT: {}}]; - - const tx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(bob.address), args); - await expect(executeTransaction(api, bob, tx)).to.be.rejectedWith(/common\.NoPermission/); + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + properties: [ + { + key: 'data', + value: 'v', + }, + ], + }); + const args = [ + {properties: [{key: 'data', value: 'A'}]}, + ]; + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejected; }); }); it('Adding more than 64 prps', async () => { - await usingApi(async (api: ApiPromise) => { - const propPerms = [{key: 'key', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}]; - for (let i = 0; i < 65; i++) { - propPerms.push({key: `key${i}`, permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}); - } - - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - - const tx1 = api.tx.unique.setTokenPropertyPermissions(collectionId, propPerms); - await expect(executeTransaction(api, alice, tx1)).to.be.rejectedWith(/common\.PropertyLimitReached/); - - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - expect(itemsListIndexBefore).to.be.equal(0); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - + await usingPlaygrounds(async (helper) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + }); const prps = []; for (let i = 0; i < 65; i++) { @@ -506,30 +412,13 @@ describe('Negative Integration Test createMultipleItems(collection_id, owner, it } const args = [ - {NFT: {properties: prps}}, - {NFT: {properties: prps}}, - {NFT: {properties: prps}}, + {properties: prps}, + {properties: prps}, + {properties: prps}, ]; - // there are no permissions, but will fail anyway because of too much weight for a block - const tx2 = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args); - await expect(submitTransactionExpectFailAsync(alice, tx2)).to.be.rejected; - }); - }); - - it('Trying to add bigger property than allowed', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionId = await createCollectionWithPropsExpectSuccess({ - propPerm: [{key: 'k', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}], - }); - const itemsListIndexBefore = await getLastTokenId(api, collectionId); - expect(itemsListIndexBefore).to.be.equal(0); - const args = [{NFT: {properties: [{key: 'k', value: 'vvvvvv'.repeat(5000)}, {key: 'k2', value: 'vvv'.repeat(5000)}]}}, - {NFT: {properties: [{key: 'k', value: 'vvvvvv'.repeat(5000)}, {key: 'k2', value: 'vvv'.repeat(5000)}]}}, - {NFT: {properties: [{key: 'k', value: 'vvvvvv'.repeat(5000)}, {key: 'k2', value: 'vvv'.repeat(5000)}]}}]; - - const tx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args); - await expect(executeTransaction(api, alice, tx)).to.be.rejectedWith(/common\.NoPermission/); + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejected; }); }); }); From d78c2fedc38003cba38670cec9a0241403884e53 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 13 Sep 2022 13:05:04 +0000 Subject: [PATCH 0870/1274] chore: store limits in BTreeMap --- pallets/evm-contract-helpers/src/eth.rs | 16 +++++++++---- pallets/evm-contract-helpers/src/lib.rs | 30 +++++++++++++++---------- runtime/common/config/ethereum.rs | 7 ++---- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 85ebb162b6..f48542e0fd 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -26,7 +26,7 @@ use pallet_evm::{ }; use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder, dispatch_to_evm}; use pallet_evm_transaction_payment::CallContext; -use sp_core::H160; +use sp_core::{H160, U256}; use up_data_structs::SponsorshipState; use crate::{ AllowlistEnabled, Config, Owner, Pallet, SponsorBasket, SponsoringFeeLimit, @@ -258,12 +258,13 @@ where fee_limit: uint256, ) -> Result { >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; - >::set_sponsoring_fee_limit(contract_address, fee_limit.into()); + >::set_sponsoring_fee_limit(contract_address, fee_limit.into()) + .map_err(dispatch_to_evm::)?; Ok(()) } fn get_sponsoring_fee_limit(&self, contract_address: address) -> Result { - Ok(>::get(contract_address, 0xffffffff)) + Ok(get_sponsoring_fee_limit::(contract_address)) } /// Is specified user present in contract allow list @@ -413,7 +414,7 @@ impl SponsorshipHandler } } - let sponsored_fee_limit = >::get(contract_address, 0xffffffff); + let sponsored_fee_limit = get_sponsoring_fee_limit::(contract_address); if call_context.max_fee > sponsored_fee_limit { return None; @@ -425,5 +426,12 @@ impl SponsorshipHandler } } +fn get_sponsoring_fee_limit(contract_address: address) -> uint256 { + >::get(contract_address) + .get(&0xffffffff) + .cloned() + .unwrap_or(U256::MAX) +} + generate_stubgen!(contract_helpers_impl, ContractHelpersCall<()>, true); generate_stubgen!(contract_helpers_iface, ContractHelpersCall<()>, false); diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index 3e3ff5ca23..d680c9f837 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -22,8 +22,12 @@ use codec::{Decode, Encode, MaxEncodedLen}; pub use pallet::*; pub use eth::*; use scale_info::TypeInfo; +use frame_support::storage::bounded_btree_map::BoundedBTreeMap; pub mod eth; +/// Maximum number of methods per contract that could have fee limit +pub const MAX_FEE_LIMITED_METHODS: u32 = 5; + #[frame_support::pallet] pub mod pallet { pub use super::*; @@ -48,9 +52,6 @@ pub mod pallet { /// In case of enabled sponsoring, but no sponsoring rate limit set, /// this value will be used implicitly type DefaultSponsoringRateLimit: Get; - /// In case of enabled sponsoring, but no sponsoring fee limit set, - /// this value will be used implicitly - type DefaultSponsoringFeeLimit: Get; } #[pallet::error] @@ -60,6 +61,9 @@ pub mod pallet { /// No pending sponsor for contract. NoPendingSponsor, + + /// Number of methods that sponsored limit is defined for exceeds maximum. + TooManyMethodsHaveSponsoredLimit, } #[pallet::pallet] @@ -121,14 +125,11 @@ pub mod pallet { /// * **Key2** - sponsored user address. /// * **Value** - last sponsored block number. #[pallet::storage] - pub(super) type SponsoringFeeLimit = StorageDoubleMap< - Hasher1 = Twox128, - Key1 = H160, - Hasher2 = Blake2_128Concat, - Key2 = u32, - Value = U256, + pub(super) type SponsoringFeeLimit = StorageMap< + Hasher = Twox128, + Key = H160, + Value = BoundedBTreeMap>, QueryKind = ValueQuery, - OnEmpty = T::DefaultSponsoringFeeLimit, >; #[pallet::storage] @@ -368,8 +369,13 @@ pub mod pallet { } /// Set maximum for gas limit of transaction - pub fn set_sponsoring_fee_limit(contract: H160, fee_limit: U256) { - >::insert(contract, 0xffffffff, fee_limit); + pub fn set_sponsoring_fee_limit(contract: H160, fee_limit: U256) -> DispatchResult { + >::try_mutate(contract, |limits_map| { + limits_map + .try_insert(0xffffffff, fee_limit) + .map_err(|_| >::TooManyMethodsHaveSponsoredLimit) + })?; + Ok(()) } /// Is user added to allowlist, or he is owner of specified contract diff --git a/runtime/common/config/ethereum.rs b/runtime/common/config/ethereum.rs index 55c189042f..a713925428 100644 --- a/runtime/common/config/ethereum.rs +++ b/runtime/common/config/ethereum.rs @@ -7,10 +7,8 @@ use frame_support::{ use sp_runtime::{RuntimeAppPublic, Perbill}; use crate::{ runtime_common::{ - dispatch::CollectionDispatchT, - ethereum::sponsoring::EvmSponsorshipHandler, - config::sponsoring::{DefaultSponsoringFeeLimit, DefaultSponsoringRateLimit}, - DealWithFees, + dispatch::CollectionDispatchT, ethereum::sponsoring::EvmSponsorshipHandler, + config::sponsoring::DefaultSponsoringRateLimit, DealWithFees, }, Runtime, Aura, Balances, Event, ChainId, }; @@ -117,7 +115,6 @@ impl pallet_evm_contract_helpers::Config for Runtime { type Event = Event; type ContractAddress = HelpersContractAddress; type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; - type DefaultSponsoringFeeLimit = DefaultSponsoringFeeLimit; } impl pallet_evm_coder_substrate::Config for Runtime {} From 781ae2a84f7703695872da9a0fcc069efc67096c Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 13 Sep 2022 13:17:42 +0000 Subject: [PATCH 0871/1274] chore: add sload/sstore and doucumentation --- pallets/evm-contract-helpers/src/eth.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index f48542e0fd..ba9898df79 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -223,9 +223,11 @@ where } /// Get current contract sponsoring rate limit - /// @param contractAddress Contract to get sponsoring mode of + /// @param contractAddress Contract to get sponsoring rate limit of /// @return uint32 Amount of blocks between two sponsored transactions fn get_sponsoring_rate_limit(&self, contract_address: address) -> Result { + self.recorder().consume_sload()?; + Ok(>::get(contract_address) .try_into() .map_err(|_| "rate limit > u32::MAX")?) @@ -251,19 +253,34 @@ where Ok(()) } + /// Set contract sponsoring fee limit + /// @dev Sponsoring fee limit - is maximum fee that could be spent by + /// single transaction + /// @param contractAddress Contract to change sponsoring fee limit of + /// @param feeLimit Fee limit + /// @dev Only contract owner can change this setting fn set_sponsoring_fee_limit( &mut self, caller: caller, contract_address: address, fee_limit: uint256, ) -> Result { + self.recorder().consume_sload()?; + self.recorder().consume_sstore()?; + >::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::)?; >::set_sponsoring_fee_limit(contract_address, fee_limit.into()) .map_err(dispatch_to_evm::)?; Ok(()) } + /// Get current contract sponsoring fee limit + /// @param contractAddress Contract to get sponsoring fee limit of + /// @return uint256 Maximum amount of fee that could be spent by single + /// transaction fn get_sponsoring_fee_limit(&self, contract_address: address) -> Result { + self.recorder().consume_sload()?; + Ok(get_sponsoring_fee_limit::(contract_address)) } From dd68ddac660b7f819507a901b6cc4366cee57eaa Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 13 Sep 2022 13:23:02 +0000 Subject: [PATCH 0872/1274] chore: update evm stubs --- .../src/stubs/ContractHelpers.raw | Bin 1848 -> 1848 bytes .../src/stubs/ContractHelpers.sol | 12 +++++++++++- tests/src/eth/api/ContractHelpers.sol | 12 +++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw index d669299fc5e7f7f4c1a86cca633836ccf0a8671d..5f09ed3ccefeedd55c814717b83102017087e30d 100644 GIT binary patch delta 44 zcmV+{0Mq}t4!91m=LR4(-L-&+L9nt%R}`a=;B4MOK4zXfeS2L|9a*_oX-p%N2M002 C8WLUr delta 44 zcmV+{0Mq}t4!91m=LR68WZE*jfL}8}GUHa3?^(YO3LQq|iRR+CNy~-*5X-%j2M00G C9~9mI diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol index 16072f7924..93e2a23b86 100644 --- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol +++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol @@ -171,7 +171,7 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { } /// Get current contract sponsoring rate limit - /// @param contractAddress Contract to get sponsoring mode of + /// @param contractAddress Contract to get sponsoring rate limit of /// @return uint32 Amount of blocks between two sponsored transactions /// @dev EVM selector for this function is: 0x610cfabd, /// or in textual repr: getSponsoringRateLimit(address) @@ -203,6 +203,12 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { dummy = 0; } + /// Set contract sponsoring fee limit + /// @dev Sponsoring fee limit - is maximum fee that could be spent by + /// single transaction + /// @param contractAddress Contract to change sponsoring fee limit of + /// @param feeLimit Fee limit + /// @dev Only contract owner can change this setting /// @dev EVM selector for this function is: 0x03aed665, /// or in textual repr: setSponsoringFeeLimit(address,uint256) function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) @@ -214,6 +220,10 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { dummy = 0; } + /// Get current contract sponsoring fee limit + /// @param contractAddress Contract to get sponsoring fee limit of + /// @return uint256 Maximum amount of fee that could be spent by single + /// transaction /// @dev EVM selector for this function is: 0xc3fdc9ee, /// or in textual repr: getSponsoringFeeLimit(address) function getSponsoringFeeLimit(address contractAddress) diff --git a/tests/src/eth/api/ContractHelpers.sol b/tests/src/eth/api/ContractHelpers.sol index a478c0681f..c6c1fce6ee 100644 --- a/tests/src/eth/api/ContractHelpers.sol +++ b/tests/src/eth/api/ContractHelpers.sol @@ -111,7 +111,7 @@ interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents { function setSponsoringMode(address contractAddress, uint8 mode) external; /// Get current contract sponsoring rate limit - /// @param contractAddress Contract to get sponsoring mode of + /// @param contractAddress Contract to get sponsoring rate limit of /// @return uint32 Amount of blocks between two sponsored transactions /// @dev EVM selector for this function is: 0x610cfabd, /// or in textual repr: getSponsoringRateLimit(address) @@ -131,11 +131,21 @@ interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents { function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) external; + /// Set contract sponsoring fee limit + /// @dev Sponsoring fee limit - is maximum fee that could be spent by + /// single transaction + /// @param contractAddress Contract to change sponsoring fee limit of + /// @param feeLimit Fee limit + /// @dev Only contract owner can change this setting /// @dev EVM selector for this function is: 0x03aed665, /// or in textual repr: setSponsoringFeeLimit(address,uint256) function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) external; + /// Get current contract sponsoring fee limit + /// @param contractAddress Contract to get sponsoring fee limit of + /// @return uint256 Maximum amount of fee that could be spent by single + /// transaction /// @dev EVM selector for this function is: 0xc3fdc9ee, /// or in textual repr: getSponsoringFeeLimit(address) function getSponsoringFeeLimit(address contractAddress) From 8c337cff2bc85b885c6f684119fde3728286fa96 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 13 Sep 2022 10:26:33 +0000 Subject: [PATCH 0873/1274] refactor: rename function --- pallets/unique/src/eth/mod.rs | 1 + .../src/eth/stubs/CollectionHelpers.raw | Bin 1488 -> 1488 bytes .../src/eth/stubs/CollectionHelpers.sol | 8 +- tests/src/eth/api/CollectionHelpers.sol | 8 +- tests/src/eth/collectionHelpersAbi.json | 2 +- tests/src/eth/createRFTCollection.test.ts | 22 ++-- .../src/eth/fractionalizer/Fractionalizer.sol | 102 +++++++++++------- .../eth/fractionalizer/fractionalizer.test.ts | 14 +-- tests/src/eth/reFungible.test.ts | 28 ++--- tests/src/eth/reFungibleToken.test.ts | 6 +- tests/src/eth/util/helpers.ts | 4 +- 11 files changed, 109 insertions(+), 86 deletions(-) diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 268aa0c69a..62ab2e5763 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -245,6 +245,7 @@ where } #[weight(>::create_collection())] + #[solidity(rename_selector = "createRFTCollection")] fn create_refungible_collection( &mut self, caller: caller, diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index 220e733ff87501f767eca64356b648b00545b171..e2746106a0745a4c1ca24c1ae86abbac76ed44b2 100644 GIT binary patch delta 387 zcmcb>eSv$!8Ag+(k;xq*i46VW4av()mi~k?SBskj0GV5XqKEH^OaU?v1DTJ#GF(8S zlb8}1D>f%G@iW#pBs8?PGYg3(GCmAXU}*Ro-C~;l9|{_p1cBl|A>xTltR2mrjERhP zVbN0q5)|4QO(zC`RWM1zRH(yMObJMEKvH1~Q{f3$F*zV1p`EcFZb&>tNkAe~PJ2@a z#GZ)(0h6XqoDwi8AS@c_xCDlTgqAjtW0`s(s+-Xq%d`|`(Z=>>s3Ab7D6}CQdmN_X zGDyYbgUlk_FX2{yoBV)Tbn+sWy9$#hoM$Urc;bB1(s}=G%scpBc2m@vNvgIgr)sn_ N@0x@@nLMA>5CBl6nu!1a delta 358 zcmcb>eSv$!8AcPAWnEWA5*hl#8iw0T@ zLJh6$AeS&@LR7b)xrC_^W>4?rIm{AVi(%aLllK9+M`7HHlOHfk$UTQ}fmVKLZ-TlT zWaZR}Q-JnPp2zY~;e1r>mX)(l|F|r}AyXTadzSC@mqV8u=2q!!w2V(^Y4n>spVbfm DD=?8* diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.sol b/pallets/unique/src/eth/stubs/CollectionHelpers.sol index afe228fd64..96eddb44c4 100644 --- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol +++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol @@ -30,7 +30,7 @@ contract CollectionHelpersEvents { } /// @title Contract, which allows users to operate with collections -/// @dev the ERC-165 identifier for this interface is 0x675f3074 +/// @dev the ERC-165 identifier for this interface is 0x88ee8ef1 contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { /// Create an NFT collection /// @param name Name of the collection @@ -69,9 +69,9 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { return 0x0000000000000000000000000000000000000000; } - /// @dev EVM selector for this function is: 0x44a68ad5, - /// or in textual repr: createRefungibleCollection(string,string,string) - function createRefungibleCollection( + /// @dev EVM selector for this function is: 0xab173450, + /// or in textual repr: createRFTCollection(string,string,string) + function createRFTCollection( string memory name, string memory description, string memory tokenPrefix diff --git a/tests/src/eth/api/CollectionHelpers.sol b/tests/src/eth/api/CollectionHelpers.sol index 8df752e7dd..5db4f9302e 100644 --- a/tests/src/eth/api/CollectionHelpers.sol +++ b/tests/src/eth/api/CollectionHelpers.sol @@ -21,7 +21,7 @@ interface CollectionHelpersEvents { } /// @title Contract, which allows users to operate with collections -/// @dev the ERC-165 identifier for this interface is 0x675f3074 +/// @dev the ERC-165 identifier for this interface is 0x88ee8ef1 interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { /// Create an NFT collection /// @param name Name of the collection @@ -45,9 +45,9 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory baseUri ) external returns (address); - /// @dev EVM selector for this function is: 0x44a68ad5, - /// or in textual repr: createRefungibleCollection(string,string,string) - function createRefungibleCollection( + /// @dev EVM selector for this function is: 0xab173450, + /// or in textual repr: createRFTCollection(string,string,string) + function createRFTCollection( string memory name, string memory description, string memory tokenPrefix diff --git a/tests/src/eth/collectionHelpersAbi.json b/tests/src/eth/collectionHelpersAbi.json index 6bc7199af6..b2d1aa6d04 100644 --- a/tests/src/eth/collectionHelpersAbi.json +++ b/tests/src/eth/collectionHelpersAbi.json @@ -59,7 +59,7 @@ { "internalType": "string", "name": "description", "type": "string" }, { "internalType": "string", "name": "tokenPrefix", "type": "string" } ], - "name": "createRefungibleCollection", + "name": "createRFTCollection", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "nonpayable", "type": "function" diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts index edb523b987..b911273700 100644 --- a/tests/src/eth/createRFTCollection.test.ts +++ b/tests/src/eth/createRFTCollection.test.ts @@ -41,7 +41,7 @@ describe('Create RFT collection from EVM', () => { const collectionCountBefore = await getCreatedCollectionCount(api); const result = await collectionHelper.methods - .createRefungibleCollection(collectionName, description, tokenPrefix) + .createRFTCollection(collectionName, description, tokenPrefix) .send(); const collectionCountAfter = await getCreatedCollectionCount(api); @@ -65,7 +65,7 @@ describe('Create RFT collection from EVM', () => { .call()).to.be.false; await collectionHelpers.methods - .createRefungibleCollection('A', 'A', 'A') + .createRFTCollection('A', 'A', 'A') .send(); expect(await collectionHelpers.methods @@ -76,7 +76,7 @@ describe('Create RFT collection from EVM', () => { itWeb3('Set sponsorship', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelpers = evmCollectionHelpers(web3, owner); - let result = await collectionHelpers.methods.createRefungibleCollection('Sponsor collection', '1', '1').send(); + let result = await collectionHelpers.methods.createRFTCollection('Sponsor collection', '1', '1').send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionEvm = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); @@ -96,7 +96,7 @@ describe('Create RFT collection from EVM', () => { itWeb3('Set limits', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelpers = evmCollectionHelpers(web3, owner); - const result = await collectionHelpers.methods.createRefungibleCollection('Const collection', '5', '5').send(); + const result = await collectionHelpers.methods.createRFTCollection('Const collection', '5', '5').send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const limits = { accountTokenOwnershipLimit: 1000, @@ -141,7 +141,7 @@ describe('Create RFT collection from EVM', () => { .isCollectionExist(collectionAddressForNonexistentCollection).call()) .to.be.false; - const result = await collectionHelpers.methods.createRefungibleCollection('Collection address exist', '7', '7').send(); + const result = await collectionHelpers.methods.createRFTCollection('Collection address exist', '7', '7').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); expect(await collectionHelpers.methods .isCollectionExist(collectionIdAddress).call()) @@ -164,7 +164,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { const tokenPrefix = 'A'; await expect(helper.methods - .createRefungibleCollection(collectionName, description, tokenPrefix) + .createRFTCollection(collectionName, description, tokenPrefix) .call()).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGHT); } @@ -174,7 +174,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { const description = 'A'.repeat(MAX_DESCRIPTION_LENGHT + 1); const tokenPrefix = 'A'; await expect(helper.methods - .createRefungibleCollection(collectionName, description, tokenPrefix) + .createRFTCollection(collectionName, description, tokenPrefix) .call()).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGHT); } { @@ -183,7 +183,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { const description = 'A'; const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGHT + 1); await expect(helper.methods - .createRefungibleCollection(collectionName, description, tokenPrefix) + .createRFTCollection(collectionName, description, tokenPrefix) .call()).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGHT); } }); @@ -196,7 +196,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { const tokenPrefix = 'A'; await expect(helper.methods - .createRefungibleCollection(collectionName, description, tokenPrefix) + .createRFTCollection(collectionName, description, tokenPrefix) .call()).to.be.rejectedWith('NotSufficientFounds'); }); @@ -204,7 +204,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const notOwner = createEthAccount(web3); const collectionHelpers = evmCollectionHelpers(web3, owner); - const result = await collectionHelpers.methods.createRefungibleCollection('A', 'A', 'A').send(); + const result = await collectionHelpers.methods.createRFTCollection('A', 'A', 'A').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const contractEvmFromNotOwner = evmCollection(web3, notOwner, collectionIdAddress, {type: 'ReFungible'}); const EXPECTED_ERROR = 'NoPermission'; @@ -229,7 +229,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { itWeb3('(!negative test!) Set limits', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelpers = evmCollectionHelpers(web3, owner); - const result = await collectionHelpers.methods.createRefungibleCollection('Schema collection', 'A', 'A').send(); + const result = await collectionHelpers.methods.createRFTCollection('Schema collection', 'A', 'A').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); await expect(collectionEvm.methods diff --git a/tests/src/eth/fractionalizer/Fractionalizer.sol b/tests/src/eth/fractionalizer/Fractionalizer.sol index d6ac7c093e..d385fa8ba9 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.sol +++ b/tests/src/eth/fractionalizer/Fractionalizer.sol @@ -25,7 +25,9 @@ contract Fractionalizer { /// @dev Method modifier to only allow contract owner to call it. modifier onlyOwner() { address contracthelpersAddress = 0x842899ECF380553E8a4de75bF534cdf6fBF64049; - ContractHelpers contractHelpers = ContractHelpers(contracthelpersAddress); + ContractHelpers contractHelpers = ContractHelpers( + contracthelpersAddress + ); address contractOwner = contractHelpers.contractOwner(address(this)); require(msg.sender == contractOwner, "Only owner can"); _; @@ -38,10 +40,19 @@ contract Fractionalizer { event AllowListSet(address _collection, bool _status); /// @dev This emits when NFT token is fractionalized by contract. - event Fractionalized(address _collection, uint256 _tokenId, address _rftToken, uint128 _amount); + event Fractionalized( + address _collection, + uint256 _tokenId, + address _rftToken, + uint128 _amount + ); /// @dev This emits when NFT token is defractionalized by contract. - event Defractionalized(address _rftToken, address _nftCollection, uint256 _nftTokenId); + event Defractionalized( + address _rftToken, + address _nftCollection, + uint256 _nftTokenId + ); /// Set RFT collection that contract will work with. RFT tokens for fractionalized NFT tokens /// would be created in this collection. @@ -52,13 +63,11 @@ contract Fractionalizer { /// Can only be called by contract owner. /// @param _collection address of RFT collection. function setRFTCollection(address _collection) public onlyOwner { - require( - rftCollection == address(0), - "RFT collection is already set" - ); + require(rftCollection == address(0), "RFT collection is already set"); UniqueRefungible refungibleContract = UniqueRefungible(_collection); - string memory collectionType = refungibleContract.uniqueCollectionType(); - + string memory collectionType = refungibleContract + .uniqueCollectionType(); + require( keccak256(bytes(collectionType)) == refungibleCollectionType, "Wrong collection type. Collection is not refungible." @@ -78,13 +87,15 @@ contract Fractionalizer { /// @param _name name for created RFT collection. /// @param _description description for created RFT collection. /// @param _tokenPrefix token prefix for created RFT collection. - function createAndSetRFTCollection(string calldata _name, string calldata _description, string calldata _tokenPrefix) public onlyOwner { - require( - rftCollection == address(0), - "RFT collection is already set" - ); + function createAndSetRFTCollection( + string calldata _name, + string calldata _description, + string calldata _tokenPrefix + ) public onlyOwner { + require(rftCollection == address(0), "RFT collection is already set"); address collectionHelpers = 0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F; - rftCollection = CollectionHelpers(collectionHelpers).createRefungibleCollection(_name, _description, _tokenPrefix); + rftCollection = CollectionHelpers(collectionHelpers) + .createRFTCollection(_name, _description, _tokenPrefix); emit RFTCollectionSet(rftCollection); } @@ -92,7 +103,10 @@ contract Fractionalizer { /// @dev Can only be called by contract owner. /// @param collection NFT token address. /// @param status `true` to allow and `false` to disallow NFT token. - function setNftCollectionIsAllowed(address collection, bool status) public onlyOwner { + function setNftCollectionIsAllowed(address collection, bool status) + public + onlyOwner + { nftCollectionAllowList[collection] = status; emit AllowListSet(collection, status); } @@ -107,12 +121,15 @@ contract Fractionalizer { /// @param _collection NFT collection address /// @param _token id of NFT token to be fractionalized /// @param _pieces number of pieces new RFT token would have - function nft2rft(address _collection, uint256 _token, uint128 _pieces) public { - require( - rftCollection != address(0), - "RFT collection is not set" + function nft2rft( + address _collection, + uint256 _token, + uint128 _pieces + ) public { + require(rftCollection != address(0), "RFT collection is not set"); + UniqueRefungible rftCollectionContract = UniqueRefungible( + rftCollection ); - UniqueRefungible rftCollectionContract = UniqueRefungible(rftCollection); require( nftCollectionAllowList[_collection] == true, "Fractionalization of this collection is not allowed by admin" @@ -121,25 +138,25 @@ contract Fractionalizer { UniqueNFT(_collection).ownerOf(_token) == msg.sender, "Only token owner could fractionalize it" ); - UniqueNFT(_collection).transferFrom( - msg.sender, - address(this), - _token - ); + UniqueNFT(_collection).transferFrom(msg.sender, address(this), _token); uint256 rftTokenId; address rftTokenAddress; UniqueRefungibleToken rftTokenContract; if (nft2rftMapping[_collection][_token] == 0) { rftTokenId = rftCollectionContract.nextTokenId(); rftCollectionContract.mint(address(this), rftTokenId); - rftTokenAddress = rftCollectionContract.tokenContractAddress(rftTokenId); + rftTokenAddress = rftCollectionContract.tokenContractAddress( + rftTokenId + ); nft2rftMapping[_collection][_token] = rftTokenId; rft2nftMapping[rftTokenAddress] = Token(_collection, _token); rftTokenContract = UniqueRefungibleToken(rftTokenAddress); } else { rftTokenId = nft2rftMapping[_collection][_token]; - rftTokenAddress = rftCollectionContract.tokenContractAddress(rftTokenId); + rftTokenAddress = rftCollectionContract.tokenContractAddress( + rftTokenId + ); rftTokenContract = UniqueRefungibleToken(rftTokenAddress); } rftTokenContract.repartition(_pieces); @@ -157,24 +174,25 @@ contract Fractionalizer { /// @param _collection RFT collection address /// @param _token id of RFT token function rft2nft(address _collection, uint256 _token) public { - require( - rftCollection != address(0), - "RFT collection is not set" + require(rftCollection != address(0), "RFT collection is not set"); + require(rftCollection == _collection, "Wrong RFT collection"); + UniqueRefungible rftCollectionContract = UniqueRefungible( + rftCollection ); - require( - rftCollection == _collection, - "Wrong RFT collection" + address rftTokenAddress = rftCollectionContract.tokenContractAddress( + _token ); - UniqueRefungible rftCollectionContract = UniqueRefungible(rftCollection); - address rftTokenAddress = rftCollectionContract.tokenContractAddress(_token); Token memory nftToken = rft2nftMapping[rftTokenAddress]; require( nftToken._collection != address(0), "No corresponding NFT token found" ); - UniqueRefungibleToken rftTokenContract = UniqueRefungibleToken(rftTokenAddress); + UniqueRefungibleToken rftTokenContract = UniqueRefungibleToken( + rftTokenAddress + ); require( - rftTokenContract.balanceOf(msg.sender) == rftTokenContract.totalSupply(), + rftTokenContract.balanceOf(msg.sender) == + rftTokenContract.totalSupply(), "Not all pieces are owned by the caller" ); rftCollectionContract.transferFrom(msg.sender, address(this), _token); @@ -183,6 +201,10 @@ contract Fractionalizer { msg.sender, nftToken._tokenId ); - emit Defractionalized(rftTokenAddress, nftToken._collection, nftToken._tokenId); + emit Defractionalized( + rftTokenAddress, + nftToken._collection, + nftToken._tokenId + ); } -} \ No newline at end of file +} diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index c2c0e129da..f43df017c4 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -21,7 +21,7 @@ import {evmToAddress} from '@polkadot/util-crypto'; import {readFile} from 'fs/promises'; import {executeTransaction, submitTransactionAsync} from '../../substrate/substrate-api'; import {getCreateCollectionResult, getCreateItemResult, UNIQUE, requirePallets, Pallets} from '../../util/helpers'; -import {collectionIdToAddress, CompiledContract, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers'; +import {collectionIdToAddress, CompiledContract, createEthAccountWithBalance, createNonfungibleCollection, createRFTCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers'; import {Contract} from 'web3-eth-contract'; import * as solc from 'solc'; @@ -123,7 +123,7 @@ describe('Fractionalizer contract usage', () => { itWeb3('Set RFT collection', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const fractionalizer = await deployFractionalizer(web3, owner); - const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner); + const {collectionIdAddress} = await createRFTCollection(api, web3, owner); const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner); await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send(); const result = await fractionalizer.methods.setRFTCollection(collectionIdAddress).send(); @@ -256,7 +256,7 @@ describe('Negative Integration Tests for fractionalizer', () => { itWeb3('call setRFTCollection twice', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner); + const {collectionIdAddress} = await createRFTCollection(api, web3, owner); const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner); const fractionalizer = await deployFractionalizer(web3, owner); @@ -282,7 +282,7 @@ describe('Negative Integration Tests for fractionalizer', () => { itWeb3('call setRFTCollection while not collection admin', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const fractionalizer = await deployFractionalizer(web3, owner); - const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner); + const {collectionIdAddress} = await createRFTCollection(api, web3, owner); await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) .to.be.rejectedWith(/Fractionalizer contract should be an admin of the collection$/g); @@ -368,7 +368,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const fractionalizer = await deployFractionalizer(web3, owner); - const {collectionIdAddress: rftCollectionAddress} = await createRefungibleCollection(api, web3, owner); + const {collectionIdAddress: rftCollectionAddress} = await createRFTCollection(api, web3, owner); const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner); const rftTokenId = await refungibleContract.methods.nextTokenId().call(); await refungibleContract.methods.mint(owner, rftTokenId).send(); @@ -381,7 +381,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); - const {collectionIdAddress: rftCollectionAddress} = await createRefungibleCollection(api, web3, owner); + const {collectionIdAddress: rftCollectionAddress} = await createRFTCollection(api, web3, owner); const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner); const rftTokenId = await refungibleContract.methods.nextTokenId().call(); await refungibleContract.methods.mint(owner, rftTokenId).send(); @@ -392,7 +392,7 @@ describe('Negative Integration Tests for fractionalizer', () => { itWeb3('call rft2nft for RFT token that was not minted by fractionalizer contract', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const {collectionIdAddress: rftCollectionAddress} = await createRefungibleCollection(api, web3, owner); + const {collectionIdAddress: rftCollectionAddress} = await createRFTCollection(api, web3, owner); const fractionalizer = await deployFractionalizer(web3, owner); const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner); diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index c895913c1e..4729cdb541 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -26,7 +26,7 @@ describe('Refungible: Information getting', () => { itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); const nextTokenId = await contract.methods.nextTokenId().call(); @@ -38,7 +38,7 @@ describe('Refungible: Information getting', () => { itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); @@ -63,7 +63,7 @@ describe('Refungible: Information getting', () => { itWeb3('ownerOf', async ({api, web3, privateKeyWrapper}) => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); @@ -79,7 +79,7 @@ describe('Refungible: Information getting', () => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const receiver = createEthAccount(web3); const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); @@ -103,7 +103,7 @@ describe('Refungible: Information getting', () => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const receiver = createEthAccount(web3); const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); @@ -130,7 +130,7 @@ describe('Refungible: Plain calls', () => { itWeb3('Can perform mint()', async ({web3, api, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, owner); - let result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + let result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const receiver = createEthAccount(web3); const contract = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); @@ -163,7 +163,7 @@ describe('Refungible: Plain calls', () => { itWeb3('Can perform mintBulk()', async ({web3, api, privateKeyWrapper}) => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); @@ -221,7 +221,7 @@ describe('Refungible: Plain calls', () => { itWeb3('Can perform burn()', async ({web3, api, privateKeyWrapper}) => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); @@ -247,7 +247,7 @@ describe('Refungible: Plain calls', () => { itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); @@ -304,7 +304,7 @@ describe('Refungible: Plain calls', () => { itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); @@ -344,7 +344,7 @@ describe('Refungible: Plain calls', () => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const receiver = createEthAccount(web3); const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); @@ -376,7 +376,7 @@ describe('Refungible: Plain calls', () => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const receiver = createEthAccount(web3); const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); @@ -413,7 +413,7 @@ describe('RFT: Fees', () => { itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); @@ -430,7 +430,7 @@ describe('RFT: Fees', () => { itWeb3('transfer() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index c85fbacc87..9acdf25341 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {approve, createCollection, createRefungibleToken, transfer, transferFrom, UNIQUE, requirePallets, Pallets} from '../util/helpers'; -import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, createRefungibleCollection, evmCollection, evmCollectionHelpers, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth, uniqueRefungible, uniqueRefungibleToken} from './util/helpers'; +import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, createRFTCollection, evmCollection, evmCollectionHelpers, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth, uniqueRefungible, uniqueRefungibleToken} from './util/helpers'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; @@ -458,7 +458,7 @@ describe('Refungible: Plain calls', () => { const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const receiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send(); + const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); @@ -658,7 +658,7 @@ describe('ERC 1633 implementation', () => { itWeb3('Default parent token address and id', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const {collectionIdAddress, collectionId} = await createRefungibleCollection(api, web3, owner); + const {collectionIdAddress, collectionId} = await createRFTCollection(api, web3, owner); const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner); const refungibleTokenId = await refungibleContract.methods.nextTokenId().call(); await refungibleContract.methods.mint(owner, refungibleTokenId).send(); diff --git a/tests/src/eth/util/helpers.ts b/tests/src/eth/util/helpers.ts index 401a329613..533307b740 100644 --- a/tests/src/eth/util/helpers.ts +++ b/tests/src/eth/util/helpers.ts @@ -141,10 +141,10 @@ export async function transferBalanceToEth(api: ApiPromise, source: IKeyringPair expect(result.success).to.be.true; } -export async function createRefungibleCollection(api: ApiPromise, web3: Web3, owner: string) { +export async function createRFTCollection(api: ApiPromise, web3: Web3, owner: string) { const collectionHelper = evmCollectionHelpers(web3, owner); const result = await collectionHelper.methods - .createRefungibleCollection('A', 'B', 'C') + .createRFTCollection('A', 'B', 'C') .send(); return await getCollectionAddressFromResult(api, result); } From 8e1a9b3c3bc4b54c81344e8bf52648449db468dc Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 13 Sep 2022 12:59:04 +0000 Subject: [PATCH 0874/1274] misk: add prettier configuration for solidity files --- .maintain/scripts/generate_sol.sh | 7 +- .prettierignore | 1 + .prettierrc | 16 + .../src/eth/stubs/CollectionHelpers.raw | Bin 1488 -> 1488 bytes .../src/eth/stubs/CollectionHelpers.sol | 17 +- tests/src/eth/api/CollectionHelpers.sol | 10 +- .../src/eth/fractionalizer/Fractionalizer.sol | 325 ++++++++---------- 7 files changed, 169 insertions(+), 207 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc diff --git a/.maintain/scripts/generate_sol.sh b/.maintain/scripts/generate_sol.sh index 5ce3460805..cae2134fa5 100755 --- a/.maintain/scripts/generate_sol.sh +++ b/.maintain/scripts/generate_sol.sh @@ -1,11 +1,16 @@ #!/bin/sh set -eu +PRETTIER_CONFIG="$(pwd)""/.prettierrc" + tmp=$(mktemp) cargo test --package $PACKAGE -- $NAME --exact --nocapture --ignored | tee $tmp raw=$(mktemp --suffix .sol) sed -n '/=== SNIP START ===/, /=== SNIP END ===/{ /=== SNIP START ===/! { /=== SNIP END ===/! p } }' $tmp > $raw + formatted=$(mktemp) -prettier --use-tabs $raw > $formatted +echo $raw +echo $formatted +prettier --config $PRETTIER_CONFIG $raw > $formatted mv $formatted $OUTPUT diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..dc0b79cafb --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +!**/*.sol diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..e97f200459 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,16 @@ +{ + "useTabs": true, + "tabWidth": 2, + "singleQuote": true, + "trailingComma": "all", + "overrides": [ + { + "files": "*.sol", + "options": { + "singleQuote": false, + "printWidth": 120, + "explicitTypes": "always" + } + } + ] +} \ No newline at end of file diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index e2746106a0745a4c1ca24c1ae86abbac76ed44b2..c7f9a59c2311260fcae79aff5cce5569abe20804 100644 GIT binary patch delta 44 zcmV+{0Mq}_3(yO&e+3}h2t|&e%kN~y;`C bool) nftCollectionAllowList; - mapping(address => mapping(uint256 => uint256)) public nft2rftMapping; - mapping(address => Token) public rft2nftMapping; - bytes32 refungibleCollectionType = keccak256(bytes("ReFungible")); + struct Token { + address _collection; + uint256 _tokenId; + } + address rftCollection; + mapping(address => bool) nftCollectionAllowList; + mapping(address => mapping(uint256 => uint256)) public nft2rftMapping; + mapping(address => Token) public rft2nftMapping; + bytes32 refungibleCollectionType = keccak256(bytes("ReFungible")); - receive() external payable onlyOwner {} + receive() external payable onlyOwner {} - /// @dev Method modifier to only allow contract owner to call it. - modifier onlyOwner() { - address contracthelpersAddress = 0x842899ECF380553E8a4de75bF534cdf6fBF64049; - ContractHelpers contractHelpers = ContractHelpers( - contracthelpersAddress - ); - address contractOwner = contractHelpers.contractOwner(address(this)); - require(msg.sender == contractOwner, "Only owner can"); - _; - } + /// @dev Method modifier to only allow contract owner to call it. + modifier onlyOwner() { + address contracthelpersAddress = 0x842899ECF380553E8a4de75bF534cdf6fBF64049; + ContractHelpers contractHelpers = ContractHelpers(contracthelpersAddress); + address contractOwner = contractHelpers.contractOwner(address(this)); + require(msg.sender == contractOwner, "Only owner can"); + _; + } - /// @dev This emits when RFT collection setting is changed. - event RFTCollectionSet(address _collection); + /// @dev This emits when RFT collection setting is changed. + event RFTCollectionSet(address _collection); - /// @dev This emits when NFT collection is allowed or disallowed. - event AllowListSet(address _collection, bool _status); + /// @dev This emits when NFT collection is allowed or disallowed. + event AllowListSet(address _collection, bool _status); - /// @dev This emits when NFT token is fractionalized by contract. - event Fractionalized( - address _collection, - uint256 _tokenId, - address _rftToken, - uint128 _amount - ); + /// @dev This emits when NFT token is fractionalized by contract. + event Fractionalized(address _collection, uint256 _tokenId, address _rftToken, uint128 _amount); - /// @dev This emits when NFT token is defractionalized by contract. - event Defractionalized( - address _rftToken, - address _nftCollection, - uint256 _nftTokenId - ); + /// @dev This emits when NFT token is defractionalized by contract. + event Defractionalized(address _rftToken, address _nftCollection, uint256 _nftTokenId); - /// Set RFT collection that contract will work with. RFT tokens for fractionalized NFT tokens - /// would be created in this collection. - /// @dev Throws if RFT collection is already configured for this contract. - /// Throws if collection of wrong type (NFT, Fungible) is provided instead - /// of RFT collection. - /// Throws if `msg.sender` is not owner or admin of provided RFT collection. - /// Can only be called by contract owner. - /// @param _collection address of RFT collection. - function setRFTCollection(address _collection) public onlyOwner { - require(rftCollection == address(0), "RFT collection is already set"); - UniqueRefungible refungibleContract = UniqueRefungible(_collection); - string memory collectionType = refungibleContract - .uniqueCollectionType(); + /// Set RFT collection that contract will work with. RFT tokens for fractionalized NFT tokens + /// would be created in this collection. + /// @dev Throws if RFT collection is already configured for this contract. + /// Throws if collection of wrong type (NFT, Fungible) is provided instead + /// of RFT collection. + /// Throws if `msg.sender` is not owner or admin of provided RFT collection. + /// Can only be called by contract owner. + /// @param _collection address of RFT collection. + function setRFTCollection(address _collection) public onlyOwner { + require(rftCollection == address(0), "RFT collection is already set"); + UniqueRefungible refungibleContract = UniqueRefungible(_collection); + string memory collectionType = refungibleContract.uniqueCollectionType(); - require( - keccak256(bytes(collectionType)) == refungibleCollectionType, - "Wrong collection type. Collection is not refungible." - ); - require( - refungibleContract.isOwnerOrAdmin(address(this)), - "Fractionalizer contract should be an admin of the collection" - ); - rftCollection = _collection; - emit RFTCollectionSet(rftCollection); - } + require( + keccak256(bytes(collectionType)) == refungibleCollectionType, + "Wrong collection type. Collection is not refungible." + ); + require( + refungibleContract.isOwnerOrAdmin(address(this)), + "Fractionalizer contract should be an admin of the collection" + ); + rftCollection = _collection; + emit RFTCollectionSet(rftCollection); + } - /// Creates and sets RFT collection that contract will work with. RFT tokens for fractionalized NFT tokens - /// would be created in this collection. - /// @dev Throws if RFT collection is already configured for this contract. - /// Can only be called by contract owner. - /// @param _name name for created RFT collection. - /// @param _description description for created RFT collection. - /// @param _tokenPrefix token prefix for created RFT collection. - function createAndSetRFTCollection( - string calldata _name, - string calldata _description, - string calldata _tokenPrefix - ) public onlyOwner { - require(rftCollection == address(0), "RFT collection is already set"); - address collectionHelpers = 0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F; - rftCollection = CollectionHelpers(collectionHelpers) - .createRFTCollection(_name, _description, _tokenPrefix); - emit RFTCollectionSet(rftCollection); - } + /// Creates and sets RFT collection that contract will work with. RFT tokens for fractionalized NFT tokens + /// would be created in this collection. + /// @dev Throws if RFT collection is already configured for this contract. + /// Can only be called by contract owner. + /// @param _name name for created RFT collection. + /// @param _description description for created RFT collection. + /// @param _tokenPrefix token prefix for created RFT collection. + function createAndSetRFTCollection( + string calldata _name, + string calldata _description, + string calldata _tokenPrefix + ) public onlyOwner { + require(rftCollection == address(0), "RFT collection is already set"); + address collectionHelpers = 0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F; + rftCollection = CollectionHelpers(collectionHelpers).createRFTCollection(_name, _description, _tokenPrefix); + emit RFTCollectionSet(rftCollection); + } - /// Allow or disallow NFT collection tokens from being fractionalized by this contract. - /// @dev Can only be called by contract owner. - /// @param collection NFT token address. - /// @param status `true` to allow and `false` to disallow NFT token. - function setNftCollectionIsAllowed(address collection, bool status) - public - onlyOwner - { - nftCollectionAllowList[collection] = status; - emit AllowListSet(collection, status); - } + /// Allow or disallow NFT collection tokens from being fractionalized by this contract. + /// @dev Can only be called by contract owner. + /// @param collection NFT token address. + /// @param status `true` to allow and `false` to disallow NFT token. + function setNftCollectionIsAllowed(address collection, bool status) public onlyOwner { + nftCollectionAllowList[collection] = status; + emit AllowListSet(collection, status); + } - /// Fractionilize NFT token. - /// @dev Takes NFT token from `msg.sender` and transfers RFT token to `msg.sender` - /// instead. Creates new RFT token if provided NFT token never was fractionalized - /// by this contract or existing RFT token if it was. - /// Throws if RFT collection isn't configured for this contract. - /// Throws if fractionalization of provided NFT token is not allowed - /// Throws if `msg.sender` is not owner of provided NFT token - /// @param _collection NFT collection address - /// @param _token id of NFT token to be fractionalized - /// @param _pieces number of pieces new RFT token would have - function nft2rft( - address _collection, - uint256 _token, - uint128 _pieces - ) public { - require(rftCollection != address(0), "RFT collection is not set"); - UniqueRefungible rftCollectionContract = UniqueRefungible( - rftCollection - ); - require( - nftCollectionAllowList[_collection] == true, - "Fractionalization of this collection is not allowed by admin" - ); - require( - UniqueNFT(_collection).ownerOf(_token) == msg.sender, - "Only token owner could fractionalize it" - ); - UniqueNFT(_collection).transferFrom(msg.sender, address(this), _token); - uint256 rftTokenId; - address rftTokenAddress; - UniqueRefungibleToken rftTokenContract; - if (nft2rftMapping[_collection][_token] == 0) { - rftTokenId = rftCollectionContract.nextTokenId(); - rftCollectionContract.mint(address(this), rftTokenId); - rftTokenAddress = rftCollectionContract.tokenContractAddress( - rftTokenId - ); - nft2rftMapping[_collection][_token] = rftTokenId; - rft2nftMapping[rftTokenAddress] = Token(_collection, _token); + /// Fractionilize NFT token. + /// @dev Takes NFT token from `msg.sender` and transfers RFT token to `msg.sender` + /// instead. Creates new RFT token if provided NFT token never was fractionalized + /// by this contract or existing RFT token if it was. + /// Throws if RFT collection isn't configured for this contract. + /// Throws if fractionalization of provided NFT token is not allowed + /// Throws if `msg.sender` is not owner of provided NFT token + /// @param _collection NFT collection address + /// @param _token id of NFT token to be fractionalized + /// @param _pieces number of pieces new RFT token would have + function nft2rft( + address _collection, + uint256 _token, + uint128 _pieces + ) public { + require(rftCollection != address(0), "RFT collection is not set"); + UniqueRefungible rftCollectionContract = UniqueRefungible(rftCollection); + require( + nftCollectionAllowList[_collection] == true, + "Fractionalization of this collection is not allowed by admin" + ); + require(UniqueNFT(_collection).ownerOf(_token) == msg.sender, "Only token owner could fractionalize it"); + UniqueNFT(_collection).transferFrom(msg.sender, address(this), _token); + uint256 rftTokenId; + address rftTokenAddress; + UniqueRefungibleToken rftTokenContract; + if (nft2rftMapping[_collection][_token] == 0) { + rftTokenId = rftCollectionContract.nextTokenId(); + rftCollectionContract.mint(address(this), rftTokenId); + rftTokenAddress = rftCollectionContract.tokenContractAddress(rftTokenId); + nft2rftMapping[_collection][_token] = rftTokenId; + rft2nftMapping[rftTokenAddress] = Token(_collection, _token); - rftTokenContract = UniqueRefungibleToken(rftTokenAddress); - } else { - rftTokenId = nft2rftMapping[_collection][_token]; - rftTokenAddress = rftCollectionContract.tokenContractAddress( - rftTokenId - ); - rftTokenContract = UniqueRefungibleToken(rftTokenAddress); - } - rftTokenContract.repartition(_pieces); - rftTokenContract.transfer(msg.sender, _pieces); - emit Fractionalized(_collection, _token, rftTokenAddress, _pieces); - } + rftTokenContract = UniqueRefungibleToken(rftTokenAddress); + } else { + rftTokenId = nft2rftMapping[_collection][_token]; + rftTokenAddress = rftCollectionContract.tokenContractAddress(rftTokenId); + rftTokenContract = UniqueRefungibleToken(rftTokenAddress); + } + rftTokenContract.repartition(_pieces); + rftTokenContract.transfer(msg.sender, _pieces); + emit Fractionalized(_collection, _token, rftTokenAddress, _pieces); + } - /// Defrationalize NFT token. - /// @dev Takes RFT token from `msg.sender` and transfers corresponding NFT token - /// to `msg.sender` instead. - /// Throws if RFT collection isn't configured for this contract. - /// Throws if provided RFT token is no from configured RFT collection. - /// Throws if RFT token was not created by this contract. - /// Throws if `msg.sender` isn't owner of all RFT token pieces. - /// @param _collection RFT collection address - /// @param _token id of RFT token - function rft2nft(address _collection, uint256 _token) public { - require(rftCollection != address(0), "RFT collection is not set"); - require(rftCollection == _collection, "Wrong RFT collection"); - UniqueRefungible rftCollectionContract = UniqueRefungible( - rftCollection - ); - address rftTokenAddress = rftCollectionContract.tokenContractAddress( - _token - ); - Token memory nftToken = rft2nftMapping[rftTokenAddress]; - require( - nftToken._collection != address(0), - "No corresponding NFT token found" - ); - UniqueRefungibleToken rftTokenContract = UniqueRefungibleToken( - rftTokenAddress - ); - require( - rftTokenContract.balanceOf(msg.sender) == - rftTokenContract.totalSupply(), - "Not all pieces are owned by the caller" - ); - rftCollectionContract.transferFrom(msg.sender, address(this), _token); - UniqueNFT(nftToken._collection).transferFrom( - address(this), - msg.sender, - nftToken._tokenId - ); - emit Defractionalized( - rftTokenAddress, - nftToken._collection, - nftToken._tokenId - ); - } + /// Defrationalize NFT token. + /// @dev Takes RFT token from `msg.sender` and transfers corresponding NFT token + /// to `msg.sender` instead. + /// Throws if RFT collection isn't configured for this contract. + /// Throws if provided RFT token is no from configured RFT collection. + /// Throws if RFT token was not created by this contract. + /// Throws if `msg.sender` isn't owner of all RFT token pieces. + /// @param _collection RFT collection address + /// @param _token id of RFT token + function rft2nft(address _collection, uint256 _token) public { + require(rftCollection != address(0), "RFT collection is not set"); + require(rftCollection == _collection, "Wrong RFT collection"); + UniqueRefungible rftCollectionContract = UniqueRefungible(rftCollection); + address rftTokenAddress = rftCollectionContract.tokenContractAddress(_token); + Token memory nftToken = rft2nftMapping[rftTokenAddress]; + require(nftToken._collection != address(0), "No corresponding NFT token found"); + UniqueRefungibleToken rftTokenContract = UniqueRefungibleToken(rftTokenAddress); + require( + rftTokenContract.balanceOf(msg.sender) == rftTokenContract.totalSupply(), + "Not all pieces are owned by the caller" + ); + rftCollectionContract.transferFrom(msg.sender, address(this), _token); + UniqueNFT(nftToken._collection).transferFrom(address(this), msg.sender, nftToken._tokenId); + emit Defractionalized(rftTokenAddress, nftToken._collection, nftToken._tokenId); + } } From ec75937b1fb5851d688403ef80a1216f0dfbca27 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 13 Sep 2022 13:05:59 +0000 Subject: [PATCH 0875/1274] misk: up version --- pallets/unique/CHANGELOG.md | 5 +++++ pallets/unique/Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pallets/unique/CHANGELOG.md b/pallets/unique/CHANGELOG.md index da5f1c2f6d..1a70f7d02d 100644 --- a/pallets/unique/CHANGELOG.md +++ b/pallets/unique/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. +## [v0.2.0] 2022-09-13 + +### Changes +- Change **collectionHelper** method `createRefungibleCollection` to `createRFTCollection`, + ## [v0.1.4] 2022-09-05 ### Added diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index 8cadf6f034..033a7157a1 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -9,7 +9,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'pallet-unique' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = "0.1.4" +version = "0.2.0" [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] From be1cd69da14c17e68931c809701c997c49f7c028 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Tue, 13 Sep 2022 13:30:39 +0000 Subject: [PATCH 0876/1274] fix: remove artifacts --- .maintain/scripts/generate_sol.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/.maintain/scripts/generate_sol.sh b/.maintain/scripts/generate_sol.sh index cae2134fa5..c84086a04b 100755 --- a/.maintain/scripts/generate_sol.sh +++ b/.maintain/scripts/generate_sol.sh @@ -9,8 +9,6 @@ raw=$(mktemp --suffix .sol) sed -n '/=== SNIP START ===/, /=== SNIP END ===/{ /=== SNIP START ===/! { /=== SNIP END ===/! p } }' $tmp > $raw formatted=$(mktemp) -echo $raw -echo $formatted prettier --config $PRETTIER_CONFIG $raw > $formatted mv $formatted $OUTPUT From 3ae89155b16d220b785da131813e491da8ee799a Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 13 Sep 2022 17:58:14 +0300 Subject: [PATCH 0877/1274] define additional step for checkout repo at mainnet branch --- .github/workflows/node-only-update_v2.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 4fe20f3743..dc8559f2af 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -156,8 +156,15 @@ jobs: exit 0 shell: bash + - name: Checkout at '${{ matrix.mainnet_branch }}' branch + uses: actions/checkout@master + with: + ref: ${{ matrix.mainnet_branch }} #Checking out head commit + path: ${{ matrix.mainnet_branch }} + + - name: Run tests before Node Parachain upgrade - working-directory: tests + working-directory: ${{ matrix.mainnet_branch }}/tests run: | yarn install yarn add mochawesome From 2169733a1876463039c3787ac1c00379967ca415 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 13 Sep 2022 19:59:59 +0300 Subject: [PATCH 0878/1274] remove readyness check from this step --- .github/workflows/node-only-update_v2.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index dc8559f2af..b3dcb8e057 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -168,7 +168,6 @@ jobs: run: | yarn install yarn add mochawesome - node scripts/readyness.js echo "Ready to start tests" yarn polkadot-types NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} From 353eeb95787508e6b05496853258858b465db90c Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 13 Sep 2022 20:47:31 +0300 Subject: [PATCH 0879/1274] Update node-only-update_v2.yml --- .github/workflows/node-only-update_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index b3dcb8e057..5c46d0641f 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -180,7 +180,7 @@ jobs: if: success() || failure() # run this step even if previous step failed with: name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created - path: tests/mochawesome-report/test-*.json # Path to test results + path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' From feed42593483d7731c03bf456034fe1d63cde240 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 13 Sep 2022 23:53:27 +0300 Subject: [PATCH 0880/1274] Foreign assets pallet fixes --- pallets/foreign-assets/src/impl_fungibles.rs | 288 +++++------------- pallets/foreign-assets/src/lib.rs | 2 +- pallets/foreign-assets/src/weights.rs | 6 +- .../common/config/pallets/foreign_asset.rs | 2 +- 4 files changed, 73 insertions(+), 225 deletions(-) diff --git a/pallets/foreign-assets/src/impl_fungibles.rs b/pallets/foreign-assets/src/impl_fungibles.rs index ac84979544..e1c3730925 100644 --- a/pallets/foreign-assets/src/impl_fungibles.rs +++ b/pallets/foreign-assets/src/impl_fungibles.rs @@ -26,9 +26,20 @@ use pallet_common::CommonCollectionOperations; use up_data_structs::budget::Unlimited; use sp_runtime::traits::{CheckedAdd, CheckedSub}; +// type BalanceSelf = +// <::Currency as Currency<::AccountId>>::Balance; +type BalanceRelay = + <::Currency as Currency<::AccountId>>::Balance; + impl fungibles::Inspect<::AccountId> for Pallet where T: orml_tokens::Config, + BalanceRelay: From>, + BalanceOf: From>, + BalanceRelay: From<::Balance>, + BalanceOf: From<::Balance>, + ::Balance: From>, + ::Balance: From>, { type AssetId = AssetIds; type Balance = BalanceOf; @@ -38,39 +49,14 @@ where match asset { AssetIds::NativeAssetId(NativeCurrency::Here) => { - let parent_amount = as fungible::Inspect< - T::AccountId, - >>::total_issuance(); - - let value: u128 = match parent_amount.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - let ti: Self::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - ti + as fungible::Inspect>::total_issuance() + .into() } AssetIds::NativeAssetId(NativeCurrency::Parent) => { - let amount = - as fungibles::Inspect>::total_issuance( - AssetIds::NativeAssetId(NativeCurrency::Parent), - ); - - let value: u128 = match amount.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - let ti: Self::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - ti + as fungibles::Inspect>::total_issuance( + AssetIds::NativeAssetId(NativeCurrency::Parent), + ) + .into() } AssetIds::ForeignAssetId(fid) => { let target_collection_id = match >::get(fid) { @@ -91,39 +77,14 @@ where log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible minimum_balance"); match asset { AssetIds::NativeAssetId(NativeCurrency::Here) => { - let parent_amount = as fungible::Inspect< - T::AccountId, - >>::minimum_balance(); - - let value: u128 = match parent_amount.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - let ti: Self::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - ti + as fungible::Inspect>::minimum_balance() + .into() } AssetIds::NativeAssetId(NativeCurrency::Parent) => { - let amount = - as fungibles::Inspect>::minimum_balance( - AssetIds::NativeAssetId(NativeCurrency::Parent), - ); - - let value: u128 = match amount.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - let ti: Self::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - ti + as fungibles::Inspect>::minimum_balance( + AssetIds::NativeAssetId(NativeCurrency::Parent), + ) + .into() } AssetIds::ForeignAssetId(fid) => { AssetMetadatas::::get(AssetIds::ForeignAssetId(fid)) @@ -137,38 +98,14 @@ where log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible balance"); match asset { AssetIds::NativeAssetId(NativeCurrency::Here) => { - let parent_amount = - as fungible::Inspect>::balance(who); - - let value: u128 = match parent_amount.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - let ti: Self::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - ti + as fungible::Inspect>::balance(who).into() } AssetIds::NativeAssetId(NativeCurrency::Parent) => { - let amount = as fungibles::Inspect>::balance( + as fungibles::Inspect>::balance( AssetIds::NativeAssetId(NativeCurrency::Parent), who, - ); - - let value: u128 = match amount.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - let ti: Self::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - ti + ) + .into() } AssetIds::ForeignAssetId(fid) => { let target_collection_id = match >::get(fid) { @@ -197,41 +134,18 @@ where match asset { AssetIds::NativeAssetId(NativeCurrency::Here) => { - let parent_amount = as fungible::Inspect< - T::AccountId, - >>::reducible_balance(who, keep_alive); - - let value: u128 = match parent_amount.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - let ti: Self::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - ti + as fungible::Inspect>::reducible_balance( + who, keep_alive, + ) + .into() } AssetIds::NativeAssetId(NativeCurrency::Parent) => { - let amount = - as fungibles::Inspect>::reducible_balance( - AssetIds::NativeAssetId(NativeCurrency::Parent), - who, - keep_alive, - ); - - let value: u128 = match amount.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - let ti: Self::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => return Zero::zero(), - }; - - ti + as fungibles::Inspect>::reducible_balance( + AssetIds::NativeAssetId(NativeCurrency::Parent), + who, + keep_alive, + ) + .into() } _ => Self::balance(asset, who), } @@ -245,36 +159,19 @@ where ) -> DepositConsequence { log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible can_deposit"); - let value: u128 = match amount.try_into() { - Ok(val) => val, - Err(_) => return DepositConsequence::CannotCreate, - }; - match asset { AssetIds::NativeAssetId(NativeCurrency::Here) => { - let this_amount: ::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => { - return DepositConsequence::CannotCreate; - } - }; as fungible::Inspect>::can_deposit( who, - this_amount, + amount.into(), mint, ) } AssetIds::NativeAssetId(NativeCurrency::Parent) => { - let parent_amount: ::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => { - return DepositConsequence::CannotCreate; - } - }; as fungibles::Inspect>::can_deposit( AssetIds::NativeAssetId(NativeCurrency::Parent), who, - parent_amount, + amount.into(), mint, ) } @@ -373,6 +270,13 @@ where impl fungibles::Mutate<::AccountId> for Pallet where T: orml_tokens::Config, + BalanceRelay: From>, + BalanceOf: From>, + BalanceRelay: From<::Balance>, + BalanceOf: From<::Balance>, + ::Balance: From>, + ::Balance: From>, + u128: From>, { fn mint_into( asset: Self::AssetId, @@ -382,42 +286,21 @@ where //Self::do_mint(asset, who, amount, None) log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible mint_into {:?}", asset); - let value: u128 = match amount.try_into() { - Ok(val) => val, - Err(_) => return Err(DispatchError::Other("Bad amount to value conversion")), - }; - match asset { AssetIds::NativeAssetId(NativeCurrency::Here) => { - let this_amount: ::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => { - return Err(DispatchError::Other( - "Bad amount to this parachain value conversion", - )) - } - }; - as fungible::Mutate>::mint_into( who, - this_amount, + amount.into(), ) + .into() } AssetIds::NativeAssetId(NativeCurrency::Parent) => { - let parent_amount: ::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => { - return Err(DispatchError::Other( - "Bad amount to relay chain value conversion", - )) - } - }; - as fungibles::Mutate>::mint_into( AssetIds::NativeAssetId(NativeCurrency::Parent), who, - parent_amount, + amount.into(), ) + .into() } AssetIds::ForeignAssetId(fid) => { let target_collection_id = match >::get(fid) { @@ -432,7 +315,8 @@ where FungibleHandle::cast(>::try_get(target_collection_id)?); let account = T::CrossAccountId::from_sub(who.clone()); - let amount_data: pallet_fungible::CreateItemData = (account.clone(), value); + let amount_data: pallet_fungible::CreateItemData = + (account.clone(), amount.into()); pallet_fungible::Pallet::::create_item_foreign( &collection, @@ -454,42 +338,23 @@ where // let f = DebitFlags { keep_alive: false, best_effort: false }; log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible burn_from"); - let value: u128 = match amount.try_into() { - Ok(val) => val, - Err(_) => return Err(DispatchError::Other("Bad amount to value conversion")), - }; - match asset { AssetIds::NativeAssetId(NativeCurrency::Here) => { - let this_amount: ::Balance = - value.try_into().map_err(|_| { - DispatchError::Other("Bad amount to this parachain value conversion") - })?; - match as fungible::Mutate>::burn_from( who, - this_amount, + amount.into(), ) { - Ok(_) => Ok(amount), + Ok(v) => Ok(v.into()), Err(e) => Err(e), } } AssetIds::NativeAssetId(NativeCurrency::Parent) => { - let parent_amount: ::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => { - return Err(DispatchError::Other( - "Bad amount to relay chain value conversion", - )) - } - }; - match as fungibles::Mutate>::burn_from( AssetIds::NativeAssetId(NativeCurrency::Parent), who, - parent_amount, + amount.into(), ) { - Ok(_) => Ok(amount), + Ok(v) => Ok(v.into()), Err(e) => Err(e), } } @@ -507,7 +372,7 @@ where pallet_fungible::Pallet::::burn_foreign( &collection, &T::CrossAccountId::from_sub(who.clone()), - value, + amount.into(), )?; Ok(amount) @@ -522,14 +387,20 @@ where ) -> Result { // let f = DebitFlags { keep_alive: false, best_effort: true }; log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible slash"); - Self::burn_from(asset, who, amount)?; - Ok(amount) + Ok(Self::burn_from(asset, who, amount)?) } } impl fungibles::Transfer for Pallet where T: orml_tokens::Config, + BalanceRelay: From>, + BalanceOf: From>, + BalanceRelay: From<::Balance>, + BalanceOf: From<::Balance>, + ::Balance: From>, + ::Balance: From>, + u128: From>, { fn transfer( asset: Self::AssetId, @@ -541,26 +412,12 @@ where // let f = TransferFlags { keep_alive, best_effort: false, burn_dust: false }; log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible transfer"); - let value: u128 = match amount.try_into() { - Ok(val) => val, - Err(_) => return Err(DispatchError::Other("Bad amount to value conversion")), - }; - match asset { AssetIds::NativeAssetId(NativeCurrency::Here) => { - let this_amount: ::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => { - return Err(DispatchError::Other( - "Bad amount to this parachain value conversion", - )) - } - }; - match as fungible::Transfer>::transfer( source, dest, - this_amount, + amount.into(), keep_alive, ) { Ok(_) => Ok(amount), @@ -570,20 +427,11 @@ where } } AssetIds::NativeAssetId(NativeCurrency::Parent) => { - let parent_amount: ::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => { - return Err(DispatchError::Other( - "Bad amount to relay chain value conversion", - )) - } - }; - match as fungibles::Transfer>::transfer( AssetIds::NativeAssetId(NativeCurrency::Parent), source, dest, - parent_amount, + amount.into(), keep_alive, ) { Ok(_) => Ok(amount), @@ -606,7 +454,7 @@ where &collection, &T::CrossAccountId::from_sub(source.clone()), &T::CrossAccountId::from_sub(dest.clone()), - value, + amount.into(), &Unlimited, )?; diff --git a/pallets/foreign-assets/src/lib.rs b/pallets/foreign-assets/src/lib.rs index f9933793c6..9b8d320a24 100644 --- a/pallets/foreign-assets/src/lib.rs +++ b/pallets/foreign-assets/src/lib.rs @@ -122,7 +122,7 @@ pub type ForeignAssetId = u32; pub type CurrencyId = AssetIds; mod impl_fungibles; -mod weights; +pub mod weights; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; diff --git a/pallets/foreign-assets/src/weights.rs b/pallets/foreign-assets/src/weights.rs index 03c861b562..7942196cf9 100644 --- a/pallets/foreign-assets/src/weights.rs +++ b/pallets/foreign-assets/src/weights.rs @@ -13,9 +13,9 @@ pub trait WeightInfo { fn update_foreign_asset() -> Weight; } -/// Weights for module_asset_registry using the Acala node and recommended hardware. -pub struct AcalaWeight(PhantomData); -impl WeightInfo for AcalaWeight { +/// Weights for pallet_fungible using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { fn register_foreign_asset() -> Weight { (29_819_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) diff --git a/runtime/common/config/pallets/foreign_asset.rs b/runtime/common/config/pallets/foreign_asset.rs index 881f5396da..b83c188b0f 100644 --- a/runtime/common/config/pallets/foreign_asset.rs +++ b/runtime/common/config/pallets/foreign_asset.rs @@ -5,5 +5,5 @@ impl pallet_foreign_assets::Config for Runtime { type Event = Event; type Currency = Balances; type RegisterOrigin = frame_system::EnsureRoot; - type WeightInfo = (); + type WeightInfo = pallet_foreign_assets::weights::SubstrateWeight; } From 5964f586c6c6898a72162164fa7e308607815f41 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 13 Sep 2022 22:05:03 +0000 Subject: [PATCH 0881/1274] build: switch frontier dependency to a branch Signed-off-by: Yaroslav Bolyukin --- Cargo.lock | 28 +++++++++++----------- client/rpc/Cargo.toml | 2 +- node/cli/Cargo.toml | 14 +++++------ node/rpc/Cargo.toml | 14 +++++------ pallets/app-promotion/Cargo.toml | 2 +- pallets/common/Cargo.toml | 4 ++-- pallets/configuration/Cargo.toml | 2 +- pallets/evm-coder-substrate/Cargo.toml | 4 ++-- pallets/evm-contract-helpers/Cargo.toml | 4 ++-- pallets/evm-migration/Cargo.toml | 4 ++-- pallets/evm-transaction-payment/Cargo.toml | 8 +++---- pallets/fungible/Cargo.toml | 2 +- pallets/nonfungible/Cargo.toml | 2 +- pallets/proxy-rmrk-core/Cargo.toml | 2 +- pallets/proxy-rmrk-equip/Cargo.toml | 2 +- pallets/refungible/Cargo.toml | 2 +- pallets/structure/Cargo.toml | 2 +- pallets/unique/Cargo.toml | 2 +- primitives/app_promotion_rpc/Cargo.toml | 2 +- primitives/common/Cargo.toml | 4 ++-- primitives/data-structs/Cargo.toml | 2 +- primitives/rpc/Cargo.toml | 2 +- runtime/opal/Cargo.toml | 12 +++++----- runtime/quartz/Cargo.toml | 12 +++++----- runtime/tests/Cargo.toml | 6 ++--- runtime/unique/Cargo.toml | 12 +++++----- 26 files changed, 76 insertions(+), 76 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b06eda768b..1168fa9e9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2324,7 +2324,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" dependencies = [ "async-trait", "fc-db", @@ -2343,7 +2343,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -2359,7 +2359,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" dependencies = [ "fc-db", "fp-consensus", @@ -2376,7 +2376,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" dependencies = [ "ethereum", "ethereum-types", @@ -2416,7 +2416,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" dependencies = [ "ethereum", "ethereum-types", @@ -2557,7 +2557,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" dependencies = [ "ethereum", "parity-scale-codec 3.1.5", @@ -2569,7 +2569,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" dependencies = [ "evm", "frame-support", @@ -2583,7 +2583,7 @@ dependencies = [ [[package]] name = "fp-evm-mapping" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" dependencies = [ "frame-support", "sp-core", @@ -2592,7 +2592,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" dependencies = [ "ethereum", "ethereum-types", @@ -2609,7 +2609,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" dependencies = [ "ethereum", "frame-support", @@ -2625,7 +2625,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" dependencies = [ "parity-scale-codec 3.1.5", ] @@ -5445,7 +5445,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" dependencies = [ "fp-evm", "frame-support", @@ -5660,7 +5660,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" dependencies = [ "ethereum", "ethereum-types", @@ -5689,7 +5689,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?rev=89a37c5a489f426cc7a42d7b94019974093a052d#89a37c5a489f426cc7a42d7b94019974093a052d" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" dependencies = [ "evm", "fp-evm", diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index fb69d3dbf4..91298c33da 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -19,4 +19,4 @@ sp-blockchain = { default-features = false, git = "https://github.com/paritytech sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 2f86e2e9ab..86491b1ea5 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -309,13 +309,13 @@ clap = "3.1.2" jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } tokio = { version = "1.19.2", features = ["time"] } -fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fc-consensus = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fc-rpc = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fc-db = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fp-rpc = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } unique-rpc = { default-features = false, path = "../rpc" } app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index 847f783101..b820c9def3 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -40,13 +40,13 @@ sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } tokio = { version = "1.19.2", features = ["macros", "sync"] } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } pallet-common = { default-features = false, path = "../../pallets/common" } up-common = { path = "../../primitives/common" } diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index d387306914..8845d2be14 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -52,7 +52,7 @@ frame-system ={ default-features = false, git = "https://github.com/paritytech/s pallet-balances ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } pallet-timestamp ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } pallet-randomness-collective-flip ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm ={ default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm ={ default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } sp-std ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index cdb62b13c9..341c25ffa3 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -17,12 +17,12 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } ethereum = { version = "0.12.0", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } serde = { version = "1.0.130", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/configuration/Cargo.toml b/pallets/configuration/Cargo.toml index 2fe2c88173..4aa7619fd3 100644 --- a/pallets/configuration/Cargo.toml +++ b/pallets/configuration/Cargo.toml @@ -16,7 +16,7 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } smallvec = "1.6.1" [features] diff --git a/pallets/evm-coder-substrate/Cargo.toml b/pallets/evm-coder-substrate/Cargo.toml index 7d80b785b8..c1e2bde6c3 100644 --- a/pallets/evm-coder-substrate/Cargo.toml +++ b/pallets/evm-coder-substrate/Cargo.toml @@ -12,8 +12,8 @@ sp-std = { default-features = false, git = "https://github.com/paritytech/substr sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } ethereum = { version = "0.12.0", default-features = false } evm-coder = { default-features = false, path = "../../crates/evm-coder" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index f94c91fd65..4ac2c47edf 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -19,8 +19,8 @@ sp-std = { default-features = false, git = "https://github.com/paritytech/substr sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } # Unique -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } # Locals diff --git a/pallets/evm-migration/Cargo.toml b/pallets/evm-migration/Cargo.toml index 195b5420ac..d6252f1162 100644 --- a/pallets/evm-migration/Cargo.toml +++ b/pallets/evm-migration/Cargo.toml @@ -15,8 +15,8 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } [dependencies.codec] default-features = false diff --git a/pallets/evm-transaction-payment/Cargo.toml b/pallets/evm-transaction-payment/Cargo.toml index b65cc7c028..5abdcc528b 100644 --- a/pallets/evm-transaction-payment/Cargo.toml +++ b/pallets/evm-transaction-payment/Cargo.toml @@ -14,11 +14,11 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } [dependencies.codec] default-features = false diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index 6b2a48bcdd..0ed6712684 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -23,7 +23,7 @@ evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' } ethereum = { version = "0.12.0", default-features = false } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index a5176a0d00..46494ef23a 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -16,7 +16,7 @@ frame-system = { default-features = false, git = "https://github.com/paritytech/ sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } diff --git a/pallets/proxy-rmrk-core/Cargo.toml b/pallets/proxy-rmrk-core/Cargo.toml index 7b5b68ef37..c5b4cb4e9e 100644 --- a/pallets/proxy-rmrk-core/Cargo.toml +++ b/pallets/proxy-rmrk-core/Cargo.toml @@ -20,7 +20,7 @@ pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } pallet-structure = { default-features = false, path = "../../pallets/structure" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/proxy-rmrk-equip/Cargo.toml b/pallets/proxy-rmrk-equip/Cargo.toml index bfe53bfdea..fd33dc71b7 100644 --- a/pallets/proxy-rmrk-equip/Cargo.toml +++ b/pallets/proxy-rmrk-equip/Cargo.toml @@ -19,7 +19,7 @@ sp-core = { default-features = false, git = "https://github.com/paritytech/subst pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index 57b5b3bd9a..31fb156c5d 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -16,7 +16,7 @@ frame-system = { default-features = false, git = "https://github.com/paritytech/ sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } pallet-common = { default-features = false, path = '../common' } diff --git a/pallets/structure/Cargo.toml b/pallets/structure/Cargo.toml index 65d509134d..1022e92501 100644 --- a/pallets/structure/Cargo.toml +++ b/pallets/structure/Cargo.toml @@ -16,7 +16,7 @@ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } up-data-structs = { path = "../../primitives/data-structs", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } [features] default = ["std"] diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index 9494d359e7..f773bbd7b4 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -98,7 +98,7 @@ up-data-structs = { default-features = false, path = "../../primitives/data-stru scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } pallet-common = { default-features = false, path = "../common" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } diff --git a/primitives/app_promotion_rpc/Cargo.toml b/primitives/app_promotion_rpc/Cargo.toml index 41931376a6..a1b9fcf35c 100644 --- a/primitives/app_promotion_rpc/Cargo.toml +++ b/primitives/app_promotion_rpc/Cargo.toml @@ -14,7 +14,7 @@ sp-core = { default-features = false, git = "https://github.com/paritytech/subst sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } [features] default = ["std"] diff --git a/primitives/common/Cargo.toml b/primitives/common/Cargo.toml index 6f4e8f227f..d692cd3143 100644 --- a/primitives/common/Cargo.toml +++ b/primitives/common/Cargo.toml @@ -48,9 +48,9 @@ branch = "polkadot-v0.9.27" [dependencies.fp-rpc] default-features = false git = "https://github.com/uniquenetwork/frontier" -rev = "89a37c5a489f426cc7a42d7b94019974093a052d" +branch = "unique-polkadot-v0.9.27-fee-limit" [dependencies.pallet-evm] default-features = false git = "https://github.com/uniquenetwork/frontier" -rev = "89a37c5a489f426cc7a42d7b94019974093a052d" +branch = "unique-polkadot-v0.9.27-fee-limit" diff --git a/primitives/data-structs/Cargo.toml b/primitives/data-structs/Cargo.toml index 1fea189663..b0162fc187 100644 --- a/primitives/data-structs/Cargo.toml +++ b/primitives/data-structs/Cargo.toml @@ -25,7 +25,7 @@ sp-std = { default-features = false, git = "https://github.com/paritytech/substr sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } derivative = { version = "2.2.0", features = ["use_core"] } struct-versioning = { path = "../../crates/struct-versioning" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } rmrk-traits = { default-features = false, path = "../rmrk-traits" } [features] diff --git a/primitives/rpc/Cargo.toml b/primitives/rpc/Cargo.toml index fbee5c61a7..57add7153d 100644 --- a/primitives/rpc/Cargo.toml +++ b/primitives/rpc/Cargo.toml @@ -14,7 +14,7 @@ sp-core = { default-features = false, git = "https://github.com/paritytech/subst sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } [features] default = ["std"] diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index e0ba39bfe2..08b45698a2 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -417,7 +417,7 @@ pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } @@ -436,11 +436,11 @@ pallet-evm-migration = { path = '../../pallets/evm-migration', default-features pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 8d7b5cdcde..71e3ce848e 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -418,7 +418,7 @@ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } @@ -437,11 +437,11 @@ pallet-evm-migration = { path = '../../pallets/evm-migration', default-features pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index b6cf1fd0f1..95b5ae12be 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -16,7 +16,7 @@ sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } @@ -25,8 +25,8 @@ pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "p pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } pallet-common = { path = '../../pallets/common' } pallet-structure = { path = '../../pallets/structure' } diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index bbe09abe3a..7286847fdd 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -430,12 +430,12 @@ pallet-evm-migration = { path = '../../pallets/evm-migration', default-features pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", rev = "89a37c5a489f426cc7a42d7b94019974093a052d" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } From 4f6c04115e1fa126db5b7fa6918c7ca83965c179 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 14 Sep 2022 09:44:57 +0300 Subject: [PATCH 0882/1274] remove symbols related to merge conflicts --- .github/workflows/dev-build-tests_v2.yml | 3 --- .github/workflows/market-test_v2.yml | 1 - .github/workflows/xcm-tests_v2.yml | 4 ---- 3 files changed, 8 deletions(-) diff --git a/.github/workflows/dev-build-tests_v2.yml b/.github/workflows/dev-build-tests_v2.yml index ba65c59117..585d35196e 100644 --- a/.github/workflows/dev-build-tests_v2.yml +++ b/.github/workflows/dev-build-tests_v2.yml @@ -72,10 +72,7 @@ jobs: yarn install yarn add mochawesome node scripts/readyness.js -<<<<<<< HEAD:.github/workflows/dev-build-tests_v2.yml echo "Ready to start tests" -======= ->>>>>>> develop:.github/workflows/dev-build-tests_v2.yml yarn polkadot-types NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index 25025623e7..a2a6e365ed 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -174,7 +174,6 @@ jobs: - name: Stop running containers if: always() # run this step always run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes -# run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down - name: Remove builder cache if: always() # run this step always diff --git a/.github/workflows/xcm-tests_v2.yml b/.github/workflows/xcm-tests_v2.yml index 43f19b3040..6f0b8d9f43 100644 --- a/.github/workflows/xcm-tests_v2.yml +++ b/.github/workflows/xcm-tests_v2.yml @@ -60,10 +60,6 @@ jobs: matrix: include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} -<<<<<<< HEAD -======= - ->>>>>>> develop steps: - name: Skip if pull request is in Draft if: github.event.pull_request.draft == true From 6871479081cfbe6a7de1ba40dace853b9cbcf8ba Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 14 Sep 2022 10:41:04 +0300 Subject: [PATCH 0883/1274] add debug for step results --- .github/workflows/xcm.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index c662de8859..3dcf7e5200 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -11,6 +11,9 @@ jobs: uses: ./.github/workflows/xcm-testnet-build.yml secrets: inherit + xcm-build-results: + run: echo ${{needs.xcm-testnet-build.result}} + xcm-tests: name: tests needs: [ xcm-testnet-build ] From 55a65262f8cd864d6070468d580b578120fc0205 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 14 Sep 2022 10:43:11 +0300 Subject: [PATCH 0884/1274] add steps definition to a job --- .github/workflows/xcm.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index 3dcf7e5200..b178864cf3 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -12,7 +12,9 @@ jobs: secrets: inherit xcm-build-results: - run: echo ${{needs.xcm-testnet-build.result}} + steps: + - name: print previous job results + run: echo ${{needs.xcm-testnet-build.result}} xcm-tests: name: tests From 69b0e70d5d1e16fdcec2e00e482f8e180d8482de Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 14 Sep 2022 10:45:28 +0300 Subject: [PATCH 0885/1274] try to move debug into existing workflow --- .github/workflows/xcm-tests_v2.yml | 5 +++++ .github/workflows/xcm.yml | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/xcm-tests_v2.yml b/.github/workflows/xcm-tests_v2.yml index cb03f8eb19..d176c6975e 100644 --- a/.github/workflows/xcm-tests_v2.yml +++ b/.github/workflows/xcm-tests_v2.yml @@ -13,6 +13,11 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: + xcm-build-results: + steps: + - name: print previous job results + run: echo ${{needs.xcm-testnet-build.result}} + prepare-execution-marix: name: Prepare execution matrix diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index b178864cf3..c662de8859 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -11,11 +11,6 @@ jobs: uses: ./.github/workflows/xcm-testnet-build.yml secrets: inherit - xcm-build-results: - steps: - - name: print previous job results - run: echo ${{needs.xcm-testnet-build.result}} - xcm-tests: name: tests needs: [ xcm-testnet-build ] From 2a07d1ea2c77638e8557771d70364a1c1a231c3a Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 14 Sep 2022 10:47:33 +0300 Subject: [PATCH 0886/1274] add runs_on --- .github/workflows/xcm-tests_v2.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/xcm-tests_v2.yml b/.github/workflows/xcm-tests_v2.yml index d176c6975e..f849848183 100644 --- a/.github/workflows/xcm-tests_v2.yml +++ b/.github/workflows/xcm-tests_v2.yml @@ -14,6 +14,7 @@ env: jobs: xcm-build-results: + runs-on: medium steps: - name: print previous job results run: echo ${{needs.xcm-testnet-build.result}} From 5832750a83691173cdccd98d21698bf85d826e65 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 14 Sep 2022 11:19:16 +0300 Subject: [PATCH 0887/1274] remove labels for relase CI workflow --- .github/workflows/ci-master.yml | 3 - .github/workflows/codestyle.yml | 89 ------------ .github/workflows/market-test.yml | 227 ------------------------------ 3 files changed, 319 deletions(-) delete mode 100644 .github/workflows/codestyle.yml delete mode 100644 .github/workflows/market-test.yml diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index 6ef006e78d..9e704cf3f3 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -18,16 +18,13 @@ jobs: uses: ./.github/workflows/node-only-update_v2.yml forkless: - if: ${{ contains( github.event.pull_request.labels.*.name, 'forkless') }} uses: ./.github/workflows/forkless.yml canary: - if: ${{ contains( github.event.pull_request.labels.*.name, 'canary') }} uses: ./.github/workflows/canary.yml secrets: inherit # pass all secrets xcm: - if: ${{ contains( github.event.pull_request.labels.*.name, 'xcm') }} uses: ./.github/workflows/xcm.yml secrets: inherit # pass all secrets diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml deleted file mode 100644 index f9c582e6ae..0000000000 --- a/.github/workflows/codestyle.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: cargo fmt - -on: - pull_request: - branches: - - develop - types: - - opened - - reopened - - synchronize - - ready_for_review - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -jobs: - rustfmt: - runs-on: self-hosted-ci - - steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - - uses: actions/checkout@v3 - - name: Install latest nightly - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - default: true - target: wasm32-unknown-unknown - components: rustfmt, clippy - - name: Run cargo fmt - run: cargo fmt -- --check # In that mode it returns only exit code. - - name: Cargo fmt state - if: success() - run: echo "Nothing to do. Command 'cargo fmt -- --check' returned exit code 0." - - - clippy: - if: ${{ false }} - runs-on: self-hosted-ci - - steps: - - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) - if: github.event.pull_request.draft == true - run: exit 1 - - - uses: actions/checkout@v3 - - name: Install substrate dependencies - run: sudo apt-get install libssl-dev pkg-config libclang-dev clang - - name: Install latest nightly - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - default: true - target: wasm32-unknown-unknown - components: rustfmt, clippy - - name: Run cargo check - run: cargo clippy -- -Dwarnings diff --git a/.github/workflows/market-test.yml b/.github/workflows/market-test.yml deleted file mode 100644 index e1fae8137c..0000000000 --- a/.github/workflows/market-test.yml +++ /dev/null @@ -1,227 +0,0 @@ -name: market api tests - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - pull_request: - branches: - - master - types: - - opened - - reopened - - synchronize #commit(s) pushed to the pull request - - ready_for_review - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - market_test: - # The type of runner that the job will run on - runs-on: [self-hosted-ci,large] - timeout-minutes: 1380 - - strategy: - matrix: - include: - - network: "opal" - features: "opal-runtime" - - network: "quartz" - features: "quartz-runtime" - - network: "unique" - features: "unique-runtime" - - name: draft job - - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - - - steps: -# - name: Skip if pull request is in Draft - # `if: github.event.pull_request.draft == true` should be kept here, at - # the step level, rather than at the job level. The latter is not - # recommended because when the PR is moved from "Draft" to "Ready to - # review" the workflow will immediately be passing (since it was skipped), - # even though it hasn't actually ran, since it takes a few seconds for - # the workflow to start. This is also disclosed in: - # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17 - # That scenario would open an opportunity for the check to be bypassed: - # 1. Get your PR approved - # 2. Move it to Draft - # 3. Push whatever commits you want - # 4. Move it to "Ready for review"; now the workflow is passing (it was - # skipped) and "Check reviews" is also passing (it won't be updated - # until the workflow is finished) -# if: github.event.pull_request.draft == true -# run: exit 1 - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout master repo - uses: actions/checkout@master - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Checkout Market e2e tests - uses: actions/checkout@v3 - with: - repository: 'UniqueNetwork/market-e2e-tests' - ssh-key: '${{ secrets.GH_PAT }}' - path: 'qa-tests' - ref: 'QA-65_maxandreev' - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Copy qa-tests/.env.example to qa-tests/.env - working-directory: qa-tests - run: cp .env.docker .env - - - name: Show content of qa-test/.env - working-directory: qa-tests - run: cat .env - - - name: Read qa -test .env file - uses: xom9ikk/dotenv@v1.0.2 - with: - path: qa-tests/ - - - name: Generate ENV related extend file for docker-compose - uses: cuchi/jinja2-action@v1.2.0 - with: - template: qa-tests/.docker/docker-compose.tmp-market.j2 - output_file: qa-tests/.docker/docker-compose.${{ matrix.network }}.yml - variables: | - REPO_URL=${{ github.server_url }}/${{ github.repository }}.git - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} - FEATURE=${{ matrix.features }} - BRANCH=${{ github.head_ref }} - - - - name: Show build configuration - working-directory: qa-tests - run: cat .docker/docker-compose.${{ matrix.network }}.yml - - - name: Start node-parachain - working-directory: qa-tests - run: docker-compose -f ".docker/docker-compose.market.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate node-parachain - - - name: Start nonce-app - working-directory: qa-tests - run: docker-compose -f ".docker/docker-compose.market.yml" up -d --build --remove-orphans --force-recreate nonce-app - - - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Setup TypeScript - working-directory: qa-tests - run: | - npm install - npm install -g ts-node - - - name: Copy qa-tests/.env.example to qa-tests/.env - working-directory: qa-tests - run: | - rm -rf .env - cp .env.example .env - - - - name: Show content of qa-test/.env - working-directory: qa-tests - run: cat .env - - - - name: Read qa -test .env file - uses: xom9ikk/dotenv@v1.0.2 - with: - path: qa-tests/ - - - name: Generate accounts - working-directory: qa-tests - run: ts-node ./src/scripts/create-market-accounts.ts - - - name: Deploy contracts - run: | - cd qa-tests - ts-node ./src/scripts/deploy-contract.ts - - - name: Import test data - working-directory: qa-tests - run: ts-node ./src/scripts/create-test-collections.ts - - - name: Show content of qa-test .env - working-directory: qa-tests - run: cat .env - - - name: Copy qa-tests/.env.example to qa-tests/.env - working-directory: qa-tests - run: | - rm -rf .env.docker - cp .env .env.docker - sed -i '/UNIQUE_WS_ENDPOINT/c UNIQUE_WS_ENDPOINT=ws://node-parachain:9944' .env.docker - - - name: Read qa -test .env file - uses: xom9ikk/dotenv@v1.0.2 - with: - path: qa-tests/ - - - name: local-market:start - run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" up -d --build - - - name: Wait for market readyness - working-directory: qa-tests - run: src/scripts/wait-market-ready.sh - shell: bash - - - name: Install dependecies - working-directory: qa-tests - run: | - npm ci - npm install -D @playwright/test - npx playwright install-deps - npx playwright install - - - name: - working-directory: qa-tests - run: | - npx playwright test --workers=8 --quiet .*.api.test.ts --reporter=github --config playwright.config.ts - - - name: Show env variables - if: success() || failure() - run: printenv - - - name: look up for report - if: success() || failure() - run: | - ls -la - ls -la qa-tests/ - - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes - - - name: Remove builder cache - if: always() # run this step always - run: | - docker builder prune -f - docker system prune -f - - - name: Clean Workspace - if: always() - uses: AutoModality/action-clean@v1.1.0 - - - - From d8e349d7a95fc25f7166e2052198b9c9c735ffd8 Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 14 Sep 2022 11:32:32 +0300 Subject: [PATCH 0888/1274] impl_fungibles refactored --- pallets/foreign-assets/src/impl_fungibles.rs | 33 +++++++------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/pallets/foreign-assets/src/impl_fungibles.rs b/pallets/foreign-assets/src/impl_fungibles.rs index e1c3730925..c5aeb0e266 100644 --- a/pallets/foreign-assets/src/impl_fungibles.rs +++ b/pallets/foreign-assets/src/impl_fungibles.rs @@ -26,20 +26,13 @@ use pallet_common::CommonCollectionOperations; use up_data_structs::budget::Unlimited; use sp_runtime::traits::{CheckedAdd, CheckedSub}; -// type BalanceSelf = -// <::Currency as Currency<::AccountId>>::Balance; -type BalanceRelay = - <::Currency as Currency<::AccountId>>::Balance; - impl fungibles::Inspect<::AccountId> for Pallet where T: orml_tokens::Config, - BalanceRelay: From>, - BalanceOf: From>, - BalanceRelay: From<::Balance>, + BalanceOf: From<::Balance>, BalanceOf: From<::Balance>, - ::Balance: From>, - ::Balance: From>, + ::Balance: From>, + ::Balance: From>, { type AssetId = AssetIds; type Balance = BalanceOf; @@ -270,13 +263,11 @@ where impl fungibles::Mutate<::AccountId> for Pallet where T: orml_tokens::Config, - BalanceRelay: From>, - BalanceOf: From>, - BalanceRelay: From<::Balance>, + BalanceOf: From<::Balance>, BalanceOf: From<::Balance>, - ::Balance: From>, - ::Balance: From>, - u128: From>, + ::Balance: From>, + ::Balance: From>, + u128: From>, { fn mint_into( asset: Self::AssetId, @@ -394,13 +385,11 @@ where impl fungibles::Transfer for Pallet where T: orml_tokens::Config, - BalanceRelay: From>, - BalanceOf: From>, - BalanceRelay: From<::Balance>, + BalanceOf: From<::Balance>, BalanceOf: From<::Balance>, - ::Balance: From>, - ::Balance: From>, - u128: From>, + ::Balance: From>, + ::Balance: From>, + u128: From>, { fn transfer( asset: Self::AssetId, From 3fb50d2df5157966b0e2a98db1f70d7baf8515c3 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 14 Sep 2022 14:17:24 +0300 Subject: [PATCH 0889/1274] fix: small make up --- .github/workflows/ci-master.yml | 3 --- .github/workflows/market-test_v2.yml | 3 +-- .github/workflows/xcm-tests_v2.yml | 6 ------ 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index 6ef006e78d..9e704cf3f3 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -18,16 +18,13 @@ jobs: uses: ./.github/workflows/node-only-update_v2.yml forkless: - if: ${{ contains( github.event.pull_request.labels.*.name, 'forkless') }} uses: ./.github/workflows/forkless.yml canary: - if: ${{ contains( github.event.pull_request.labels.*.name, 'canary') }} uses: ./.github/workflows/canary.yml secrets: inherit # pass all secrets xcm: - if: ${{ contains( github.event.pull_request.labels.*.name, 'xcm') }} uses: ./.github/workflows/xcm.yml secrets: inherit # pass all secrets diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index 990404c6b4..297b0ffe5b 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -45,8 +45,7 @@ jobs: repository: 'UniqueNetwork/market-e2e-tests' ssh-key: ${{ secrets.GH_PAT }} path: 'qa-tests' -# ref: 'master' - ref: 'ci_test_v2' + ref: 'master' - name: Read .env file uses: xom9ikk/dotenv@v1.0.2 diff --git a/.github/workflows/xcm-tests_v2.yml b/.github/workflows/xcm-tests_v2.yml index f849848183..cb03f8eb19 100644 --- a/.github/workflows/xcm-tests_v2.yml +++ b/.github/workflows/xcm-tests_v2.yml @@ -13,12 +13,6 @@ env: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - xcm-build-results: - runs-on: medium - steps: - - name: print previous job results - run: echo ${{needs.xcm-testnet-build.result}} - prepare-execution-marix: name: Prepare execution matrix From 3d71464e6bed209218b29e72f98359187f6fa613 Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 14 Sep 2022 14:37:52 +0300 Subject: [PATCH 0890/1274] fix: allowLists code style --- tests/src/allowLists.test.ts | 521 +++++++++++++++-------------------- 1 file changed, 224 insertions(+), 297 deletions(-) diff --git a/tests/src/allowLists.test.ts b/tests/src/allowLists.test.ts index 6e3bd195d3..edee51140a 100644 --- a/tests/src/allowLists.test.ts +++ b/tests/src/allowLists.test.ts @@ -1,12 +1,12 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // This file is part of Unique Network. -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by +// Unique Network is free software: you can redistribute itSub and/or modify +// itSub under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Unique Network is distributed in the hope that it will be useful, +// Unique Network is distributed in the hope that itSub will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. @@ -15,370 +15,297 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {usingPlaygrounds} from './util/playgrounds'; - -chai.use(chaiAsPromised); -const expect = chai.expect; - -let donor: IKeyringPair; - -before(async () => { - await usingPlaygrounds(async (_, privateKey) => { - donor = privateKey('//Alice'); - }); -}); - -let alice: IKeyringPair; -let bob: IKeyringPair; -let charlie: IKeyringPair; +import {usingPlaygrounds, expect, itSub} from './util/playgrounds'; describe('Integration Test ext. Allow list tests', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); - it('Owner can add address to allow list', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - const allowList = await helper.nft.getAllowList(collectionId); - expect(allowList).to.be.deep.contains({Substrate: bob.address}); - }); + itSub('Owner can add address to allow list', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + const allowList = await helper.nft.getAllowList(collectionId); + expect(allowList).to.be.deep.contains({Substrate: bob.address}); }); - it('Admin can add address to allow list', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address}); + itSub('Admin can add address to allow list', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address}); - await helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}); - const allowList = await helper.nft.getAllowList(collectionId); - expect(allowList).to.be.deep.contains({Substrate: charlie.address}); - }); + await helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}); + const allowList = await helper.nft.getAllowList(collectionId); + expect(allowList).to.be.deep.contains({Substrate: charlie.address}); }); - it('Non-privileged user cannot add address to allow list', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const addToAllowListTx = async () => helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}); - await expect(addToAllowListTx()).to.be.rejected; - }); + itSub('Non-privileged user cannot add address to allow list', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const addToAllowListTx = async () => helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}); + await expect(addToAllowListTx()).to.be.rejectedWith(/common\.NoPermission/); }); - it('Nobody can add address to allow list of non-existing collection', async () => { + itSub('Nobody can add address to allow list of non-existing collection', async ({helper}) => { const collectionId = (1<<32) - 1; - await usingPlaygrounds(async (helper) => { - const addToAllowListTx = async () => helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}); - await expect(addToAllowListTx()).to.be.rejected; - }); + const addToAllowListTx = async () => helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}); + await expect(addToAllowListTx()).to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('Nobody can add address to allow list of destroyed collection', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.collection.burn(alice, collectionId); - const addToAllowListTx = async () => helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - await expect(addToAllowListTx()).to.be.rejected; - }); + itSub('Nobody can add address to allow list of destroyed collection', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.collection.burn(alice, collectionId); + const addToAllowListTx = async () => helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + await expect(addToAllowListTx()).to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('If address is already added to allow list, nothing happens', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - const allowList = await helper.nft.getAllowList(collectionId); - expect(allowList).to.be.deep.contains({Substrate: bob.address}); - }); + itSub('If address is already added to allow list, nothing happens', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + const allowList = await helper.nft.getAllowList(collectionId); + expect(allowList).to.be.deep.contains({Substrate: bob.address}); }); - it('Owner can remove address from allow list', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + itSub('Owner can remove address from allow list', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); + await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); - const allowList = await helper.nft.getAllowList(collectionId); + const allowList = await helper.nft.getAllowList(collectionId); - expect(allowList).to.be.not.deep.contains({Substrate: bob.address}); - }); + expect(allowList).to.be.not.deep.contains({Substrate: bob.address}); }); - it('Admin can remove address from allow list', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.addAdmin(alice, collectionId, {Substrate: charlie.address}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - await helper.collection.removeFromAllowList(charlie, collectionId, {Substrate: bob.address}); + itSub('Admin can remove address from allow list', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addAdmin(alice, collectionId, {Substrate: charlie.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + await helper.collection.removeFromAllowList(charlie, collectionId, {Substrate: bob.address}); - const allowList = await helper.nft.getAllowList(collectionId); + const allowList = await helper.nft.getAllowList(collectionId); - expect(allowList).to.be.not.deep.contains({Substrate: bob.address}); - }); + expect(allowList).to.be.not.deep.contains({Substrate: bob.address}); }); - it('Non-privileged user cannot remove address from allow list', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); - const removeTx = async () => helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address}); - await expect(removeTx()).to.be.rejected; - const allowList = await helper.nft.getAllowList(collectionId); + itSub('Non-privileged user cannot remove address from allow list', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + const removeTx = async () => helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address}); + await expect(removeTx()).to.be.rejectedWith(/common\.NoPermission/); + const allowList = await helper.nft.getAllowList(collectionId); - expect(allowList).to.be.deep.contains({Substrate: charlie.address}); - }); + expect(allowList).to.be.deep.contains({Substrate: charlie.address}); }); - it('Nobody can remove address from allow list of non-existing collection', async () => { + itSub('Nobody can remove address from allow list of non-existing collection', async ({helper}) => { const collectionId = (1<<32) - 1; - await usingPlaygrounds(async (helper) => { - const removeTx = async () => helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address}); - await expect(removeTx()).to.be.rejected; - }); + const removeTx = async () => helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address}); + await expect(removeTx()).to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('Nobody can remove address from allow list of deleted collection', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - await helper.collection.burn(alice, collectionId); - const removeTx = async () => helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); + itSub('Nobody can remove address from allow list of deleted collection', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + await helper.collection.burn(alice, collectionId); + const removeTx = async () => helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); - await expect(removeTx()).to.be.rejected; - }); + await expect(removeTx()).to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('If address is already removed from allow list, nothing happens', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); - const allowListBefore = await helper.nft.getAllowList(collectionId); - expect(allowListBefore).to.be.not.deep.contains({Substrate: bob.address}); + itSub('If address is already removed from allow list, nothing happens', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); + const allowListBefore = await helper.nft.getAllowList(collectionId); + expect(allowListBefore).to.be.not.deep.contains({Substrate: bob.address}); - await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); + await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); - const allowListAfter = await helper.nft.getAllowList(collectionId); - expect(allowListAfter).to.be.not.deep.contains({Substrate: bob.address}); - }); + const allowListAfter = await helper.nft.getAllowList(collectionId); + expect(allowListAfter).to.be.not.deep.contains({Substrate: bob.address}); }); - it('If Public Access mode is set to AllowList, tokens can’t be transferred from a non-allowlisted address with transfer or transferFrom. Test1', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + itSub('If Public Access mode is set to AllowList, tokens can’t be transferred from a non-allowlisted address with transfer or transferFrom. Test1', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); - const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - await expect(transferResult()).to.be.rejected; - }); - }); - - it('If Public Access mode is set to AllowList, tokens can’t be transferred from a non-allowlisted address with transfer or transferFrom. Test2', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); - await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address}); - - const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - await expect(transferResult()).to.be.rejected; - }); + const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + await expect(transferResult()).to.be.rejectedWith(/common\.AddressNotInAllowlist/); }); - it('If Public Access mode is set to AllowList, tokens can’t be transferred to a non-allowlisted address with transfer or transferFrom. Test1', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + itSub('If Public Access mode is set to AllowList, tokens can’t be transferred from a non-allowlisted address with transfer or transferFrom. Test2', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address}); - const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - await expect(transferResult()).to.be.rejected; - }); + const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + await expect(transferResult()).to.be.rejectedWith(/common\.AddressNotInAllowlist/); }); - it('If Public Access mode is set to AllowList, tokens can’t be transferred to a non-allowlisted address with transfer or transferFrom. Test2', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); - - await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address}); + itSub('If Public Access mode is set to AllowList, tokens can’t be transferred to a non-allowlisted address with transfer or transferFrom. Test1', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); - const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - await expect(transferResult()).to.be.rejected; - }); + const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + await expect(transferResult()).to.be.rejectedWith(/common\.AddressNotInAllowlist/); }); - it('If Public Access mode is set to AllowList, tokens can’t be destroyed by a non-allowlisted address (even if it owned them before enabling AllowList mode)', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); - const burnTx = async () => helper.nft.burnToken(bob, collectionId, tokenId); - await expect(burnTx()).to.be.rejected; - }); - }); + itSub('If Public Access mode is set to AllowList, tokens can’t be transferred to a non-allowlisted address with transfer or transferFrom. Test2', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); - it('If Public Access mode is set to AllowList, token transfers can’t be Approved by a non-allowlisted address (see Approve method)', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); - const approveTx = async () => helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); - await expect(approveTx()).to.be.rejected; - }); - }); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address}); - it('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transfer.', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); - await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - const owner = await helper.nft.getTokenOwner(collectionId, tokenId); - expect(owner.Substrate).to.be.equal(charlie.address); - }); + const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + await expect(transferResult()).to.be.rejectedWith(/common\.AddressNotInAllowlist/); }); - it('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transferFrom.', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); - await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - - await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address}); - const owner = await helper.nft.getTokenOwner(collectionId, tokenId); - expect(owner.Substrate).to.be.equal(charlie.address); - }); + itSub('If Public Access mode is set to AllowList, tokens can’t be destroyed by a non-allowlisted address (even if itSub owned them before enabling AllowList mode)', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + const burnTx = async () => helper.nft.burnToken(bob, collectionId, tokenId); + await expect(burnTx()).to.be.rejectedWith(/common\.NoPermission/); }); - it('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transfer', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); - - await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - const owner = await helper.nft.getTokenOwner(collectionId, tokenId); - expect(owner.Substrate).to.be.equal(charlie.address); - }); + itSub('If Public Access mode is set to AllowList, token transfers can’t be Approved by a non-allowlisted address (see Approve method)', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + const approveTx = async () => helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); + await expect(approveTx()).to.be.rejectedWith(/common\.AddressNotInAllowlist/); }); - it('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transferFrom', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); - await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - - await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address}); - const owner = await helper.nft.getTokenOwner(collectionId, tokenId); - expect(owner.Substrate).to.be.equal(charlie.address); - }); + itSub('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transfer.', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(charlie.address); }); - it('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens can be created by owner', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - const token = await helper.nft.getToken(collectionId, tokenId); - expect(token).to.be.not.null; - }); - }); + itSub('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transferFrom.', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - it('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens can be created by admin', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); - await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); - const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); - const token = await helper.nft.getToken(collectionId, tokenId); - expect(token).to.be.not.null; - }); + await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(charlie.address); }); - it('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens cannot be created by non-privileged and allow-listed address', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); - await helper.collection.addToAllowList(alice, collectionId, {Substrate: bob.address}); - const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); - await expect(mintTokenTx()).to.be.rejected; - }); - }); + itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transfer', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); - it('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens cannot be created by non-privileged and non-allow listed address', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); - const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); - await expect(mintTokenTx()).to.be.rejected; - }); + await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(charlie.address); }); - it('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by owner', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - const owner = await helper.nft.getTokenOwner(collectionId, tokenId); - expect(owner.Substrate).to.be.equal(alice.address); - }); + itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transferFrom', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + + await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(charlie.address); + }); + + itSub('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens can be created by owner', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + const token = await helper.nft.getToken(collectionId, tokenId); + expect(token).to.be.not.null; + }); + + itSub('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens can be created by admin', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); + await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); + const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); + const token = await helper.nft.getToken(collectionId, tokenId); + expect(token).to.be.not.null; }); - it('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by admin', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); - await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address}); - const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); - const owner = await helper.nft.getTokenOwner(collectionId, tokenId); - expect(owner.Substrate).to.be.equal(bob.address); - }); - }); - - it('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens cannot be created by non-privileged and non-allow listed address', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); - const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); - await expect(mintTokenTx()).to.be.rejected; - }); - }); - - it('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by non-privileged and allow listed address', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); - const owner = await helper.nft.getTokenOwner(collectionId, tokenId); - expect(owner.Substrate).to.be.equal(bob.address); - }); + itSub('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens cannot be created by non-privileged and allow-listed address', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); + await helper.collection.addToAllowList(alice, collectionId, {Substrate: bob.address}); + const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); + await expect(mintTokenTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); + }); + + itSub('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens cannot be created by non-privileged and non-allow listed address', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); + const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); + await expect(mintTokenTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); + }); + + itSub('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by owner', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(alice.address); + }); + + itSub('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by admin', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); + await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address}); + const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(bob.address); + }); + + itSub('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens cannot be created by non-privileged and non-allow listed address', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); + const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); + await expect(mintTokenTx()).to.be.rejectedWith(/common\.AddressNotInAllowlist/); + }); + + itSub('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by non-privileged and allow listed address', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); + const owner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(owner.Substrate).to.be.equal(bob.address); }); }); From ad75a1ed05061787afe500ed04115d8e1853f0f7 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Wed, 14 Sep 2022 18:10:14 +0700 Subject: [PATCH 0891/1274] change runtime version to 927030 --- runtime/opal/src/lib.rs | 2 +- runtime/quartz/src/lib.rs | 2 +- runtime/unique/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 9aa6279049..315edffb3b 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -45,7 +45,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 927020, + spec_version: 927030, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index cc196963c0..3bdd6db13a 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -45,7 +45,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 927020, + spec_version: 927030, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index eca71fc905..c1f7465f94 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -45,7 +45,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 927020, + spec_version: 927030, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, From e71bc9c49324e172df0a2af9762585021ff19ffa Mon Sep 17 00:00:00 2001 From: Greg Zaitsev Date: Wed, 14 Sep 2022 15:52:18 +0300 Subject: [PATCH 0892/1274] Re-add CheckTxVersion signed extension and a test --- runtime/common/mod.rs | 2 +- tests/src/tx-version-presence.test.ts | 32 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 tests/src/tx-version-presence.test.ts diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index ac2aca2b33..ed04f448cc 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -79,7 +79,7 @@ pub type ChargeTransactionPayment = pallet_charge_transaction::ChargeTransaction pub type SignedExtra = ( frame_system::CheckSpecVersion, - // system::CheckTxVersion, + frame_system::CheckTxVersion, frame_system::CheckGenesis, frame_system::CheckEra, frame_system::CheckNonce, diff --git a/tests/src/tx-version-presence.test.ts b/tests/src/tx-version-presence.test.ts new file mode 100644 index 0000000000..09e1b14aab --- /dev/null +++ b/tests/src/tx-version-presence.test.ts @@ -0,0 +1,32 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import { Metadata } from '@polkadot/types'; +import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; + +let metadata: Metadata; + +describe('TxVersion is present', () => { + before(async () => { + await usingPlaygrounds(async helper => { + metadata = await helper.api!.rpc.state.getMetadata(); + }); + }); + + itSub('Signed extension CheckTxVersion is present', async () => { + expect(metadata.asLatest.extrinsic.signedExtensions.map(se => se.identifier.toString())).to.include('CheckTxVersion'); + }); +}); From 96cdb9b3ccba231b11acbaa5e9dd4509c5031500 Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 14 Sep 2022 16:33:13 +0300 Subject: [PATCH 0893/1274] fix: code style --- tests/src/adminTransferAndBurn.test.ts | 66 +-- tests/src/change-collection-owner.test.ts | 218 ++++---- tests/src/confirmSponsorship.test.ts | 360 ++++++------- tests/src/createCollection.test.ts | 182 +++---- tests/src/createItem.test.ts | 347 ++++++------ tests/src/createMultipleItems.test.ts | 613 ++++++++++------------ 6 files changed, 787 insertions(+), 999 deletions(-) diff --git a/tests/src/adminTransferAndBurn.test.ts b/tests/src/adminTransferAndBurn.test.ts index 9f8be3cafb..a5cd6a2574 100644 --- a/tests/src/adminTransferAndBurn.test.ts +++ b/tests/src/adminTransferAndBurn.test.ts @@ -15,20 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {usingPlaygrounds} from './util/playgrounds'; - -chai.use(chaiAsPromised); -const expect = chai.expect; - -let donor: IKeyringPair; - -before(async () => { - await usingPlaygrounds(async (_, privateKey) => { - donor = privateKey('//Alice'); - }); -}); +import {usingPlaygrounds, expect, itSub} from './util/playgrounds'; describe('Integration Test: ownerCanTransfer allows admins to use only transferFrom/burnFrom:', () => { let alice: IKeyringPair; @@ -36,44 +23,41 @@ describe('Integration Test: ownerCanTransfer allows admins to use only transferF let charlie: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); }); - it('admin transfers other user\'s token', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); - await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); - const limits = await helper.collection.getEffectiveLimits(collectionId); - expect(limits.ownerCanTransfer).to.be.true; + itSub('admin transfers other user\'s token', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); + await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); + const limits = await helper.collection.getEffectiveLimits(collectionId); + expect(limits.ownerCanTransfer).to.be.true; - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); - const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - await expect(transferResult()).to.be.rejected; + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + await expect(transferResult()).to.be.rejected; - await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: bob.address}, {Substrate: charlie.address}); - const newTokenOwner = await helper.nft.getTokenOwner(collectionId, tokenId); - expect(newTokenOwner.Substrate).to.be.equal(charlie.address); - }); + await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: bob.address}, {Substrate: charlie.address}); + const newTokenOwner = await helper.nft.getTokenOwner(collectionId, tokenId); + expect(newTokenOwner.Substrate).to.be.equal(charlie.address); }); - it('admin burns other user\'s token', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); + itSub('admin burns other user\'s token', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); - await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); - const limits = await helper.collection.getEffectiveLimits(collectionId); - expect(limits.ownerCanTransfer).to.be.true; + await helper.collection.setLimits(alice, collectionId, {ownerCanTransfer: true}); + const limits = await helper.collection.getEffectiveLimits(collectionId); + expect(limits.ownerCanTransfer).to.be.true; - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); - const burnTxFailed = async () => helper.nft.burnToken(alice, collectionId, tokenId); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); + const burnTxFailed = async () => helper.nft.burnToken(alice, collectionId, tokenId); - await expect(burnTxFailed()).to.be.rejected; + await expect(burnTxFailed()).to.be.rejected; - await helper.nft.burnToken(bob, collectionId, tokenId); - const token = await helper.nft.getToken(collectionId, tokenId); - expect(token).to.be.null; - }); + await helper.nft.burnToken(bob, collectionId, tokenId); + const token = await helper.nft.getToken(collectionId, tokenId); + expect(token).to.be.null; }); }); diff --git a/tests/src/change-collection-owner.test.ts b/tests/src/change-collection-owner.test.ts index 71ff3d4e19..caec444727 100644 --- a/tests/src/change-collection-owner.test.ts +++ b/tests/src/change-collection-owner.test.ts @@ -1,12 +1,12 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // This file is part of Unique Network. -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by +// Unique Network is free software: you can redistribute itSub and/or modify +// itSub under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Unique Network is distributed in the hope that it will be useful, +// Unique Network is distributed in the hope that itSub will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. @@ -15,41 +15,27 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {usingPlaygrounds} from './util/playgrounds'; - -chai.use(chaiAsPromised); -const expect = chai.expect; - -let donor: IKeyringPair; - -before(async () => { - await usingPlaygrounds(async (_, privateKey) => { - donor = privateKey('//Alice'); - }); -}); +import {usingPlaygrounds, expect, itSub} from './util/playgrounds'; describe('Integration Test changeCollectionOwner(collection_id, new_owner):', () => { let alice: IKeyringPair; let bob: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); - it('Changing owner changes owner address', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const beforeChanging = await helper.collection.getData(collection.collectionId); - expect(beforeChanging?.normalizedOwner).to.be.equal(alice.address); + itSub('Changing owner changes owner address', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const beforeChanging = await helper.collection.getData(collection.collectionId); + expect(beforeChanging?.normalizedOwner).to.be.equal(alice.address); - await collection.changeOwner(alice, bob.address); - const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); - }); + await collection.changeOwner(alice, bob.address); + const afterChanging = await helper.collection.getData(collection.collectionId); + expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); }); }); @@ -59,64 +45,59 @@ describe('Integration Test changeCollectionOwner(collection_id, new_owner) speci let charlie: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); - it('Changing the owner of the collection is not allowed for the former owner', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + itSub('Changing the owner of the collection is not allowed for the former owner', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.changeOwner(alice, bob.address); + await collection.changeOwner(alice, bob.address); - const changeOwnerTx = async () => collection.changeOwner(alice, alice.address); - await expect(changeOwnerTx()).to.be.rejected; + const changeOwnerTx = async () => collection.changeOwner(alice, alice.address); + await expect(changeOwnerTx()).to.be.rejectedWith(/common\.NoPermission/); - const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); - }); + const afterChanging = await helper.collection.getData(collection.collectionId); + expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); }); - it('New collectionOwner has access to sponsorship management operations in the collection', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.changeOwner(alice, bob.address); - - const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); - - await collection.setSponsor(bob, charlie.address); - await collection.confirmSponsorship(charlie); - await collection.removeSponsor(bob); - const limits = { - accountTokenOwnershipLimit: 1, - tokenLimit: 1, - sponsorTransferTimeout: 1, - ownerCanDestroy: true, - ownerCanTransfer: true, - }; - - await collection.setLimits(bob, limits); - const gotLimits = await collection.getEffectiveLimits(); - expect(gotLimits).to.be.deep.contains(limits); - - await collection.setPermissions(bob, {access: 'AllowList', mintMode: true}); - - await collection.burn(bob); - const collectionData = await helper.collection.getData(collection.collectionId); - expect(collectionData).to.be.null; - }); + itSub('New collectionOwner has access to sponsorship management operations in the collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.changeOwner(alice, bob.address); + + const afterChanging = await helper.collection.getData(collection.collectionId); + expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); + + await collection.setSponsor(bob, charlie.address); + await collection.confirmSponsorship(charlie); + await collection.removeSponsor(bob); + const limits = { + accountTokenOwnershipLimit: 1, + tokenLimit: 1, + sponsorTransferTimeout: 1, + ownerCanDestroy: true, + ownerCanTransfer: true, + }; + + await collection.setLimits(bob, limits); + const gotLimits = await collection.getEffectiveLimits(); + expect(gotLimits).to.be.deep.contains(limits); + + await collection.setPermissions(bob, {access: 'AllowList', mintMode: true}); + + await collection.burn(bob); + const collectionData = await helper.collection.getData(collection.collectionId); + expect(collectionData).to.be.null; }); - it('New collectionOwner has access to changeCollectionOwner', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.changeOwner(alice, bob.address); - await collection.changeOwner(bob, charlie.address); - const collectionData = await collection.getData(); - expect(collectionData?.normalizedOwner).to.be.equal(charlie.address); - }); + itSub('New collectionOwner has access to changeCollectionOwner', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.changeOwner(alice, bob.address); + await collection.changeOwner(bob, charlie.address); + const collectionData = await collection.getData(); + expect(collectionData?.normalizedOwner).to.be.equal(charlie.address); }); }); @@ -126,70 +107,63 @@ describe('Negative Integration Test changeCollectionOwner(collection_id, new_own let charlie: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); - it('Not owner can\'t change owner.', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const changeOwnerTx = async () => collection.changeOwner(bob, bob.address); - await expect(changeOwnerTx()).to.be.rejected; - }); + itSub('Not owner can\'t change owner.', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const changeOwnerTx = async () => collection.changeOwner(bob, bob.address); + await expect(changeOwnerTx()).to.be.rejectedWith(/common\.NoPermission/); }); - it('Collection admin can\'t change owner.', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.addAdmin(alice, {Substrate: bob.address}); - const changeOwnerTx = async () => collection.changeOwner(bob, bob.address); - await expect(changeOwnerTx()).to.be.rejected; - }); + itSub('Collection admin can\'t change owner.', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.addAdmin(alice, {Substrate: bob.address}); + const changeOwnerTx = async () => collection.changeOwner(bob, bob.address); + await expect(changeOwnerTx()).to.be.rejectedWith(/common\.NoPermission/); }); - it('Can\'t change owner of a non-existing collection.', async () => { - await usingPlaygrounds(async (helper) => { - const collectionId = (1 << 32) - 1; - const changeOwnerTx = async () => helper.collection.changeOwner(bob, collectionId, bob.address); - await expect(changeOwnerTx()).to.be.rejected; - }); + itSub('Can\'t change owner of a non-existing collection.', async ({helper}) => { + const collectionId = (1 << 32) - 1; + const changeOwnerTx = async () => helper.collection.changeOwner(bob, collectionId, bob.address); + await expect(changeOwnerTx()).to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('Former collectionOwner not allowed to sponsorship management operations in the collection', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.changeOwner(alice, bob.address); + itSub('Former collectionOwner not allowed to sponsorship management operations in the collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.changeOwner(alice, bob.address); - const changeOwnerTx = async () => collection.changeOwner(alice, alice.address); - await expect(changeOwnerTx()).to.be.rejected; + const changeOwnerTx = async () => collection.changeOwner(alice, alice.address); + await expect(changeOwnerTx()).to.be.rejectedWith(/common\.NoPermission/); - const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); + const afterChanging = await helper.collection.getData(collection.collectionId); + expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); - const setSponsorTx = async () => collection.setSponsor(alice, charlie.address); - const confirmSponsorshipTx = async () => collection.confirmSponsorship(alice); - const removeSponsorTx = async () => collection.removeSponsor(alice); - await expect(setSponsorTx()).to.be.rejected; - await expect(confirmSponsorshipTx()).to.be.rejected; - await expect(removeSponsorTx()).to.be.rejected; + const setSponsorTx = async () => collection.setSponsor(alice, charlie.address); + const confirmSponsorshipTx = async () => collection.confirmSponsorship(alice); + const removeSponsorTx = async () => collection.removeSponsor(alice); + await expect(setSponsorTx()).to.be.rejectedWith(/common\.NoPermission/); + await expect(confirmSponsorshipTx()).to.be.rejectedWith(/unique\.ConfirmUnsetSponsorFail/); + await expect(removeSponsorTx()).to.be.rejectedWith(/common\.NoPermission/); - const limits = { - accountTokenOwnershipLimit: 1, - tokenLimit: 1, - sponsorTransferTimeout: 1, - ownerCanDestroy: true, - ownerCanTransfer: true, - }; + const limits = { + accountTokenOwnershipLimit: 1, + tokenLimit: 1, + sponsorTransferTimeout: 1, + ownerCanDestroy: true, + ownerCanTransfer: true, + }; - const setLimitsTx = async () => collection.setLimits(alice, limits); - await expect(setLimitsTx()).to.be.rejected; + const setLimitsTx = async () => collection.setLimits(alice, limits); + await expect(setLimitsTx()).to.be.rejectedWith(/common\.NoPermission/); - const setPermissionTx = async () => collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); - await expect(setPermissionTx()).to.be.rejected; + const setPermissionTx = async () => collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await expect(setPermissionTx()).to.be.rejectedWith(/common\.NoPermission/); - const burnTx = async () => collection.burn(alice); - await expect(burnTx()).to.be.rejected; - }); + const burnTx = async () => collection.burn(alice); + await expect(burnTx()).to.be.rejectedWith(/common\.NoPermission/); }); }); diff --git a/tests/src/confirmSponsorship.test.ts b/tests/src/confirmSponsorship.test.ts index 34894a1a8a..007653e021 100644 --- a/tests/src/confirmSponsorship.test.ts +++ b/tests/src/confirmSponsorship.test.ts @@ -1,12 +1,12 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // This file is part of Unique Network. -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by +// Unique Network is free software: you can redistribute itSub and/or modify +// itSub under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Unique Network is distributed in the hope that it will be useful, +// Unique Network is distributed in the hope that itSub will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. @@ -14,268 +14,218 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds} from './util/playgrounds'; - -chai.use(chaiAsPromised); -const expect = chai.expect; - -let donor: IKeyringPair; - -before(async () => { - await usingPlaygrounds(async (_, privateKey) => { - donor = privateKey('//Alice'); - }); -}); - -let alice: IKeyringPair; -let bob: IKeyringPair; -let charlie: IKeyringPair; +import {usingPlaygrounds, expect, itSub, Pallets} from './util/playgrounds'; describe('integration test: ext. confirmSponsorship():', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; + let zeroBalance: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { - [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie, zeroBalance] = await helper.arrange.createAccounts([100n, 100n, 100n, 0n], donor); }); }); - it('Confirm collection sponsorship', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(bob); - }); + itSub('Confirm collection sponsorship', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); }); - it('Add sponsor to a collection after the same sponsor was already added and confirmed', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(bob); - await collection.setSponsor(alice, bob.address); - }); + itSub('Add sponsor to a collection after the same sponsor was already added and confirmed', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + await collection.setSponsor(alice, bob.address); }); - it('Add new sponsor to a collection after another sponsor was already added and confirmed', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(bob); - await collection.setSponsor(alice, charlie.address); - }); + itSub('Add new sponsor to a collection after another sponsor was already added and confirmed', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + await collection.setSponsor(alice, charlie.address); }); - it('NFT: Transfer fees are paid by the sponsor after confirmation', async () => { - await usingPlaygrounds(async (helper) => { - const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(bob); - const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - const token = await collection.mintToken(alice, {Substrate: zeroBalance.address}); - await token.transfer(zeroBalance, {Substrate: alice.address}); - const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); - expect(bobBalanceAfter < bobBalanceBefore).to.be.true; - }); + itSub('NFT: Transfer fees are paid by the sponsor after confirmation', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); + const token = await collection.mintToken(alice, {Substrate: zeroBalance.address}); + await token.transfer(zeroBalance, {Substrate: alice.address}); + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); + expect(bobBalanceAfter < bobBalanceBefore).to.be.true; }); - it('Fungible: Transfer fees are paid by the sponsor after confirmation', async () => { - await usingPlaygrounds(async (helper) => { - const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); - const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(bob); - const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - await collection.mint(alice, {Substrate: zeroBalance.address}, 100n); - await collection.transfer(zeroBalance, {Substrate: alice.address}, 1n); - const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); - expect(bobBalanceAfter < bobBalanceBefore).to.be.true; - }); + itSub('Fungible: Transfer fees are paid by the sponsor after confirmation', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); + await collection.mint(alice, 100n, {Substrate: zeroBalance.address}); + await collection.transfer(zeroBalance, {Substrate: alice.address}, 1n); + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); + expect(bobBalanceAfter < bobBalanceBefore).to.be.true; }); - it('ReFungible: Transfer fees are paid by the sponsor after confirmation', async function() { - await usingPlaygrounds(async (helper) => { - const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); - const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(bob); - const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - const token = await collection.mintToken(alice, {Substrate: zeroBalance.address}, 100n); - await token.transfer(zeroBalance, {Substrate: alice.address}, 1n); - const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); - expect(bobBalanceAfter < bobBalanceBefore).to.be.true; - }); + itSub.ifWithPallets('ReFungible: Transfer fees are paid by the sponsor after confirmation', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); + const token = await collection.mintToken(alice, 100n, {Substrate: zeroBalance.address}); + await token.transfer(zeroBalance, {Substrate: alice.address}, 1n); + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); + expect(bobBalanceAfter < bobBalanceBefore).to.be.true; }); - it('CreateItem fees are paid by the sponsor after confirmation', async () => { - await usingPlaygrounds(async (helper) => { - const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(bob); - await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); - await collection.addToAllowList(alice, {Substrate: zeroBalance.address}); + itSub('CreateItem fees are paid by the sponsor after confirmation', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await collection.addToAllowList(alice, {Substrate: zeroBalance.address}); - const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - await collection.mintToken(zeroBalance, {Substrate: zeroBalance.address}); - const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); + await collection.mintToken(zeroBalance, {Substrate: zeroBalance.address}); + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); - expect(bobBalanceAfter < bobBalanceBefore).to.be.true; - }); + expect(bobBalanceAfter < bobBalanceBefore).to.be.true; }); - it('NFT: Sponsoring of transfers is rate limited', async () => { - await usingPlaygrounds(async (helper) => { - const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(bob); + itSub('NFT: Sponsoring of transfers is rate limited', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); - const token = await collection.mintToken(alice, {Substrate: alice.address}); - await token.transfer(alice, {Substrate: zeroBalance.address}); - const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); + const token = await collection.mintToken(alice, {Substrate: alice.address}); + await token.transfer(alice, {Substrate: zeroBalance.address}); + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - const transferTx = async () => token.transfer(zeroBalance, {Substrate: alice.address}); - await expect(transferTx()).to.be.rejectedWith('Inability to pay some fees'); - const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); + const transferTx = async () => token.transfer(zeroBalance, {Substrate: alice.address}); + await expect(transferTx()).to.be.rejectedWith('Inability to pay some fees'); + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); - expect(bobBalanceAfter === bobBalanceBefore).to.be.true; - }); + expect(bobBalanceAfter === bobBalanceBefore).to.be.true; }); - it('Fungible: Sponsoring is rate limited', async () => { - await usingPlaygrounds(async (helper) => { - const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); - const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(bob); + itSub('Fungible: Sponsoring is rate limited', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); - await collection.mint(alice, {Substrate: zeroBalance.address}, 100n); - await collection.transfer(zeroBalance, {Substrate: zeroBalance.address}, 1n); - const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); + await collection.mint(alice, 100n, {Substrate: zeroBalance.address}); + await collection.transfer(zeroBalance, {Substrate: zeroBalance.address}, 1n); + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - const transferTx = async () => collection.transfer(zeroBalance, {Substrate: zeroBalance.address}); - await expect(transferTx()).to.be.rejected; - const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); + const transferTx = async () => collection.transfer(zeroBalance, {Substrate: zeroBalance.address}); + await expect(transferTx()).to.be.rejected; + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); - expect(bobBalanceAfter === bobBalanceBefore).to.be.true; - }); + expect(bobBalanceAfter === bobBalanceBefore).to.be.true; }); - it('ReFungible: Sponsoring is rate limited', async function() { - await usingPlaygrounds(async (helper) => { - const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); - const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(bob); + itSub.ifWithPallets('ReFungible: Sponsoring is rate limited', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); - const token = await collection.mintToken(alice, {Substrate: zeroBalance.address}, 100n); - await token.transfer(zeroBalance, {Substrate: alice.address}); + const token = await collection.mintToken(alice, 100n, {Substrate: zeroBalance.address}); + await token.transfer(zeroBalance, {Substrate: alice.address}); - const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - const transferTx = async () => token.transfer(zeroBalance, {Substrate: alice.address}); - await expect(transferTx()).to.be.rejectedWith('Inability to pay some fees'); - const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); + const transferTx = async () => token.transfer(zeroBalance, {Substrate: alice.address}); + await expect(transferTx()).to.be.rejectedWith('Inability to pay some fees'); + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); - expect(bobBalanceAfter === bobBalanceBefore).to.be.true; - }); + expect(bobBalanceAfter === bobBalanceBefore).to.be.true; }); - it('NFT: Sponsoring of createItem is rate limited', async () => { - await usingPlaygrounds(async (helper) => { - const [zeroBalance] = await helper.arrange.createAccounts([0n], donor); - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(bob); - await collection.setPermissions(alice, {mintMode: true, access: 'AllowList'}); - await collection.addToAllowList(alice, {Substrate: zeroBalance.address}); + itSub('NFT: Sponsoring of createItem is rate limited', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + await collection.setPermissions(alice, {mintMode: true, access: 'AllowList'}); + await collection.addToAllowList(alice, {Substrate: zeroBalance.address}); - await collection.mintToken(zeroBalance, {Substrate: zeroBalance.address}); + await collection.mintToken(zeroBalance, {Substrate: zeroBalance.address}); - const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - const mintTx = async () => collection.mintToken(zeroBalance, {Substrate: zeroBalance.address}); - await expect(mintTx()).to.be.rejectedWith('Inability to pay some fees'); - const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); + const mintTx = async () => collection.mintToken(zeroBalance, {Substrate: zeroBalance.address}); + await expect(mintTx()).to.be.rejectedWith('Inability to pay some fees'); + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); - expect(bobBalanceAfter === bobBalanceBefore).to.be.true; - }); + expect(bobBalanceAfter === bobBalanceBefore).to.be.true; }); }); describe('(!negative test!) integration test: ext. confirmSponsorship():', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; + let ownerZeroBalance: IKeyringPair; + let senderZeroBalance: IKeyringPair; + before(async () => { - await usingPlaygrounds(async (helper) => { - [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie, ownerZeroBalance, senderZeroBalance] = await helper.arrange.createAccounts([100n, 100n, 100n, 0n, 0n], donor); }); }); - it('(!negative test!) Confirm sponsorship for a collection that never existed', async () => { - await usingPlaygrounds(async (helper) => { - const collectionId = 1 << 32 - 1; - const confirmSponsorshipTx = async () => helper.collection.confirmSponsorship(bob, collectionId); - await expect(confirmSponsorshipTx()).to.be.rejected; - }); + itSub('(!negative test!) Confirm sponsorship for a collection that never existed', async ({helper}) => { + const collectionId = 1_000_000; + const confirmSponsorshipTx = async () => helper.collection.confirmSponsorship(bob, collectionId); + await expect(confirmSponsorshipTx()).to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('(!negative test!) Confirm sponsorship using a non-sponsor address', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - const confirmSponsorshipTx = async () => collection.confirmSponsorship(charlie); - await expect(confirmSponsorshipTx()).to.be.rejected; - }); + itSub('(!negative test!) Confirm sponsorship using a non-sponsor address', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + const confirmSponsorshipTx = async () => collection.confirmSponsorship(charlie); + await expect(confirmSponsorshipTx()).to.be.rejectedWith(/unique\.ConfirmUnsetSponsorFail/); }); - it('(!negative test!) Confirm sponsorship using owner address', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - const confirmSponsorshipTx = async () => collection.confirmSponsorship(alice); - await expect(confirmSponsorshipTx()).to.be.rejected; - }); + itSub('(!negative test!) Confirm sponsorship using owner address', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + const confirmSponsorshipTx = async () => collection.confirmSponsorship(alice); + await expect(confirmSponsorshipTx()).to.be.rejectedWith(/unique\.ConfirmUnsetSponsorFail/); }); - it('(!negative test!) Confirm sponsorship by collection admin', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - await collection.addAdmin(alice, {Substrate: charlie.address}); - const confirmSponsorshipTx = async () => collection.confirmSponsorship(charlie); - await expect(confirmSponsorshipTx()).to.be.rejected; - }); + itSub('(!negative test!) Confirm sponsorship by collection admin', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.addAdmin(alice, {Substrate: charlie.address}); + const confirmSponsorshipTx = async () => collection.confirmSponsorship(charlie); + await expect(confirmSponsorshipTx()).to.be.rejectedWith(/unique\.ConfirmUnsetSponsorFail/); }); - it('(!negative test!) Confirm sponsorship without sponsor being set with setCollectionSponsor', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const confirmSponsorshipTx = async () => collection.confirmSponsorship(charlie); - await expect(confirmSponsorshipTx()).to.be.rejected; - }); + itSub('(!negative test!) Confirm sponsorship without sponsor being set with setCollectionSponsor', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const confirmSponsorshipTx = async () => collection.confirmSponsorship(charlie); + await expect(confirmSponsorshipTx()).to.be.rejectedWith(/unique\.ConfirmUnsetSponsorFail/); }); - it('(!negative test!) Confirm sponsorship in a collection that was destroyed', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.burn(alice); - const confirmSponsorshipTx = async () => collection.confirmSponsorship(charlie); - await expect(confirmSponsorshipTx()).to.be.rejected; - }); + itSub('(!negative test!) Confirm sponsorship in a collection that was destroyed', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.burn(alice); + const confirmSponsorshipTx = async () => collection.confirmSponsorship(charlie); + await expect(confirmSponsorshipTx()).to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('(!negative test!) Transfer fees are not paid by the sponsor if the transfer failed', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(bob); - const [ownerZeroBalance, senderZeroBalance] = await helper.arrange.createAccounts([0n, 0n], donor); - const token = await collection.mintToken(alice, {Substrate: ownerZeroBalance.address}); - const sponsorBalanceBefore = await helper.balance.getSubstrate(bob.address); - const transferTx = async () => token.transfer(senderZeroBalance, {Substrate: alice.address}); - await expect(transferTx()).to.be.rejected; - const sponsorBalanceAfter = await helper.balance.getSubstrate(bob.address); - expect(sponsorBalanceAfter).to.equal(sponsorBalanceBefore); - }); + itSub('(!negative test!) Transfer fees are not paid by the sponsor if the transfer failed', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setSponsor(alice, bob.address); + await collection.confirmSponsorship(bob); + const token = await collection.mintToken(alice, {Substrate: ownerZeroBalance.address}); + const sponsorBalanceBefore = await helper.balance.getSubstrate(bob.address); + const transferTx = async () => token.transfer(senderZeroBalance, {Substrate: alice.address}); + await expect(transferTx()).to.be.rejectedWith('Inability to pay some fees'); + const sponsorBalanceAfter = await helper.balance.getSubstrate(bob.address); + expect(sponsorBalanceAfter).to.equal(sponsorBalanceBefore); }); }); diff --git a/tests/src/createCollection.test.ts b/tests/src/createCollection.test.ts index ac62c78865..7e43c6df5e 100644 --- a/tests/src/createCollection.test.ts +++ b/tests/src/createCollection.test.ts @@ -1,12 +1,12 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // This file is part of Unique Network. -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by +// Unique Network is free software: you can redistribute itSub and/or modify +// itSub under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Unique Network is distributed in the hope that it will be useful, +// Unique Network is distributed in the hope that itSub will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. @@ -14,145 +14,125 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {usingPlaygrounds} from './util/playgrounds'; +import {usingPlaygrounds, expect, itSub, Pallets} from './util/playgrounds'; import {IKeyringPair} from '@polkadot/types/types'; import {IProperty} from './util/playgrounds/types'; -chai.use(chaiAsPromised); -const expect = chai.expect; - -let donor: IKeyringPair; - -before(async () => { - await usingPlaygrounds(async (_, privateKey) => { - donor = privateKey('//Alice'); - }); -}); - -let alice: IKeyringPair; - describe('integration test: ext. createCollection():', () => { + let alice: IKeyringPair; + before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice] = await helper.arrange.createAccounts([100n], donor); }); }); - it('Create new NFT collection', async () => { - await usingPlaygrounds(async (helper) => { - await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - }); + itSub('Create new NFT collection', async ({helper}) => { + + await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); }); - it('Create new NFT collection whith collection_name of maximum length (64 bytes)', async () => { - await usingPlaygrounds(async (helper) => { - await helper.nft.mintCollection(alice, {name: 'A'.repeat(64), description: 'descr', tokenPrefix: 'COL'}); - }); + itSub('Create new NFT collection whith collection_name of maximum length (64 bytes)', async ({helper}) => { + + await helper.nft.mintCollection(alice, {name: 'A'.repeat(64), description: 'descr', tokenPrefix: 'COL'}); }); - it('Create new NFT collection whith collection_description of maximum length (256 bytes)', async () => { - await usingPlaygrounds(async (helper) => { - await helper.nft.mintCollection(alice, {name: 'name', description: 'A'.repeat(256), tokenPrefix: 'COL'}); - }); + itSub('Create new NFT collection whith collection_description of maximum length (256 bytes)', async ({helper}) => { + + await helper.nft.mintCollection(alice, {name: 'name', description: 'A'.repeat(256), tokenPrefix: 'COL'}); }); - it('Create new NFT collection whith token_prefix of maximum length (16 bytes)', async () => { - await usingPlaygrounds(async (helper) => { - await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'A'.repeat(16)}); - }); + itSub('Create new NFT collection whith token_prefix of maximum length (16 bytes)', async ({helper}) => { + + await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'A'.repeat(16)}); }); - it('Create new Fungible collection', async () => { - await usingPlaygrounds(async (helper) => { - await helper.ft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 0); - }); + itSub('Create new Fungible collection', async ({helper}) => { + + await helper.ft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 0); }); - it('Create new ReFungible collection', async function() { - await usingPlaygrounds(async (helper) => { - await helper.rft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); - }); + itSub.ifWithPallets('Create new ReFungible collection', [Pallets.ReFungible], async ({helper}) => { + + await helper.rft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); }); - it('create new collection with properties', async () => { - await usingPlaygrounds(async (helper) => { - await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', - properties: [{key: 'key1', value: 'val1'}], - tokenPropertyPermissions: [{key: 'key1', permission: {tokenOwner: true, mutable: false, collectionAdmin: true}}], - }); + itSub('create new collection with properties', async ({helper}) => { + + await helper.nft.mintCollection(alice, { + name: 'name', description: 'descr', tokenPrefix: 'COL', + properties: [{key: 'key1', value: 'val1'}], + tokenPropertyPermissions: [{key: 'key1', permission: {tokenOwner: true, mutable: false, collectionAdmin: true}}], }); }); - it('Create new collection with extra fields', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.ft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 8); - await collection.setPermissions(alice, {access: 'AllowList'}); - await collection.setLimits(alice, {accountTokenOwnershipLimit: 3}); - const data = await collection.getData(); - const limits = await collection.getEffectiveLimits(); - const raw = data?.raw; - - expect(data?.normalizedOwner).to.be.equal(alice.address); - expect(data?.name).to.be.equal('name'); - expect(data?.description).to.be.equal('descr'); - expect(raw.permissions.access).to.be.equal('AllowList'); - expect(raw.mode).to.be.deep.equal({Fungible: '8'}); - expect(limits.accountTokenOwnershipLimit).to.be.equal(3); - }); + itSub('Create new collection with extra fields', async ({helper}) => { + + const collection = await helper.ft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 8); + await collection.setPermissions(alice, {access: 'AllowList'}); + await collection.setLimits(alice, {accountTokenOwnershipLimit: 3}); + const data = await collection.getData(); + const limits = await collection.getEffectiveLimits(); + const raw = data?.raw; + + expect(data?.normalizedOwner).to.be.equal(alice.address); + expect(data?.name).to.be.equal('name'); + expect(data?.description).to.be.equal('descr'); + expect(raw.permissions.access).to.be.equal('AllowList'); + expect(raw.mode).to.be.deep.equal({Fungible: '8'}); + expect(limits.accountTokenOwnershipLimit).to.be.equal(3); }); - it('New collection is not external', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); - const data = await collection.getData(); - expect(data?.raw.readOnly).to.be.false; - }); + itSub('New collection is not external', async ({helper}) => { + + const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); + const data = await collection.getData(); + expect(data?.raw.readOnly).to.be.false; }); }); describe('(!negative test!) integration test: ext. createCollection():', () => { - it('(!negative test!) create new NFT collection whith incorrect data (collection_name)', async () => { - await usingPlaygrounds(async (helper) => { - const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'A'.repeat(65), description: 'descr', tokenPrefix: 'COL'}); - await expect(mintCollectionTx()).to.be.rejected; + let alice: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([100n], donor); }); }); - it('(!negative test!) create new NFT collection whith incorrect data (collection_description)', async () => { - await usingPlaygrounds(async (helper) => { - const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'A'.repeat(257), tokenPrefix: 'COL'}); - await expect(mintCollectionTx()).to.be.rejected; - }); + + itSub('(!negative test!) create new NFT collection whith incorrect data (collection_name)', async ({helper}) => { + const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'A'.repeat(65), description: 'descr', tokenPrefix: 'COL'}); + await expect(mintCollectionTx()).to.be.rejectedWith('Verification Error'); }); - it('(!negative test!) create new NFT collection whith incorrect data (token_prefix)', async () => { - await usingPlaygrounds(async (helper) => { - const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'A'.repeat(17)}); - await expect(mintCollectionTx()).to.be.rejected; - }); + itSub('(!negative test!) create new NFT collection whith incorrect data (collection_description)', async ({helper}) => { + const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'A'.repeat(257), tokenPrefix: 'COL'}); + await expect(mintCollectionTx()).to.be.rejectedWith('Verification Error'); }); - it('(!negative test!) fails when bad limits are set', async () => { - await usingPlaygrounds(async (helper) => { - const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', limits: {tokenLimit: 0}}); - await expect(mintCollectionTx()).to.be.rejected; - }); + itSub('(!negative test!) create new NFT collection whith incorrect data (token_prefix)', async ({helper}) => { + + const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'A'.repeat(17)}); + await expect(mintCollectionTx()).to.be.rejectedWith('Verification Error'); }); + itSub('(!negative test!) fails when bad limits are set', async ({helper}) => { - it('(!negative test!) create collection with incorrect property limit (64 elements)', async () => { + const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', limits: {tokenLimit: 0}}); + await expect(mintCollectionTx()).to.be.rejectedWith(/common\.CollectionTokenLimitExceeded/); + }); + + itSub('(!negative test!) create collection with incorrect property limit (64 elements)', async ({helper}) => { const props: IProperty[] = []; for (let i = 0; i < 65; i++) { props.push({key: `key${i}`, value: `value${i}`}); } - await usingPlaygrounds(async (helper) => { - const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', properties: props}); - await expect(mintCollectionTx()).to.be.rejected; - }); + const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', properties: props}); + await expect(mintCollectionTx()).to.be.rejectedWith('Verification Error'); }); - it('(!negative test!) create collection with incorrect property limit (40 kb)', async () => { + itSub('(!negative test!) create collection with incorrect property limit (40 kb)', async ({helper}) => { const props: IProperty[] = []; for (let i = 0; i < 32; i++) { props.push({key: `key${i}`.repeat(80), value: `value${i}`.repeat(80)}); } - await usingPlaygrounds(async (helper) => { - const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', properties: props}); - await expect(mintCollectionTx()).to.be.rejected; - }); + + const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', properties: props}); + await expect(mintCollectionTx()).to.be.rejectedWith('Verification Error'); }); }); diff --git a/tests/src/createItem.test.ts b/tests/src/createItem.test.ts index 4cdbb57561..b5e37d5c9b 100644 --- a/tests/src/createItem.test.ts +++ b/tests/src/createItem.test.ts @@ -1,12 +1,12 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // This file is part of Unique Network. -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by +// Unique Network is free software: you can redistribute itSub and/or modify +// itSub under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Unique Network is distributed in the hope that it will be useful, +// Unique Network is distributed in the hope that itSub will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. @@ -14,51 +14,38 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; import {IKeyringPair} from '@polkadot/types/types'; + import { createCollection, itApi, normalizeAccountId, getCreateItemResult, } from './util/helpers'; -import {usingPlaygrounds} from './util/playgrounds'; + +import {usingPlaygrounds, expect, itSub, Pallets} from './util/playgrounds'; import {IProperty} from './util/playgrounds/types'; import {executeTransaction} from './substrate/substrate-api'; -chai.use(chaiAsPromised); -const expect = chai.expect; - -let donor: IKeyringPair; - -before(async () => { - await usingPlaygrounds(async (_, privateKey) => { - donor = privateKey('//Alice'); - }); -}); - -let alice: IKeyringPair; -let bob: IKeyringPair; describe('integration test: ext. ():', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); - it('Create new item in NFT collection', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.mintToken(alice, {Substrate: alice.address}); - }); + itSub('Create new item in NFT collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.mintToken(alice, {Substrate: alice.address}); }); - it('Create new item in Fungible collection', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - await collection.mint(alice, {Substrate: alice.address}, 10n); - }); + itSub('Create new item in Fungible collection', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await collection.mint(alice, 10n, {Substrate: alice.address}); }); itApi.skip('Check events on create new item in Fungible collection', async ({api}) => { const createMode = 'Fungible'; @@ -84,229 +71,191 @@ describe('integration test: ext. ():', () => { expect(result.collectionId).to.be.equal(newCollectionID); expect(result.recipient).to.be.deep.equal(to); } - }); - it('Create new item in ReFungible collection', async function() { - await usingPlaygrounds(async (helper) => { - const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.mintToken(alice, {Substrate: alice.address}, 100n); - }); + itSub.ifWithPallets('Create new item in ReFungible collection', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.mintToken(alice, 100n, {Substrate: alice.address}); }); - it('Create new item in NFT collection with collection admin permissions', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.addAdmin(alice, {Substrate: bob.address}); - await collection.mintToken(bob, {Substrate: alice.address}); - }); + itSub('Create new item in NFT collection with collection admin permissions', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.addAdmin(alice, {Substrate: bob.address}); + await collection.mintToken(bob, {Substrate: alice.address}); }); - it('Create new item in Fungible collection with collection admin permissions', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - await collection.addAdmin(alice, {Substrate: bob.address}); - await collection.mint(bob, {Substrate: alice.address}, 10n); - }); + itSub('Create new item in Fungible collection with collection admin permissions', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + await collection.addAdmin(alice, {Substrate: bob.address}); + await collection.mint(bob, 10n, {Substrate: alice.address}); }); - it('Create new item in ReFungible collection with collection admin permissions', async function() { - await usingPlaygrounds(async (helper) => { - const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.addAdmin(alice, {Substrate: bob.address}); - await collection.mintToken(bob, {Substrate: alice.address}, 100n); - }); + itSub.ifWithPallets('Create new item in ReFungible collection with collection admin permissions', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.addAdmin(alice, {Substrate: bob.address}); + await collection.mintToken(bob, 100n, {Substrate: alice.address}); }); - it('Set property Admin', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', - properties: [{key: 'k', value: 'v'}], - tokenPropertyPermissions: [{key: 'k', permission: {tokenOwner: false, mutable: true, collectionAdmin: true}}], - }); - await collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); + itSub('Set property Admin', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', + properties: [{key: 'k', value: 'v'}], + tokenPropertyPermissions: [{key: 'k', permission: {tokenOwner: false, mutable: true, collectionAdmin: true}}], }); + await collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); }); - it('Set property AdminConst', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', - properties: [{key: 'k', value: 'v'}], - tokenPropertyPermissions: [{key: 'k', permission: {tokenOwner: false, mutable: false, collectionAdmin: true}}], - }); - await collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); + itSub('Set property AdminConst', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', + properties: [{key: 'k', value: 'v'}], + tokenPropertyPermissions: [{key: 'k', permission: {tokenOwner: false, mutable: false, collectionAdmin: true}}], }); + await collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); }); - it('Set property itemOwnerOrAdmin', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', - properties: [{key: 'k', value: 'v'}], - tokenPropertyPermissions: [{key: 'k', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}], - }); - await collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); + itSub('Set property itemOwnerOrAdmin', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', + properties: [{key: 'k', value: 'v'}], + tokenPropertyPermissions: [{key: 'k', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}], }); + await collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); }); - it('Check total pieces of Fungible token', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - const amount = 10n; - await collection.mint(alice, {Substrate: bob.address}, amount); - { - const totalPieces = await collection.getTotalPieces(); - expect(totalPieces).to.be.equal(amount); - } - await collection.transfer(bob, {Substrate: alice.address}, 1n); - { - const totalPieces = await collection.getTotalPieces(); - expect(totalPieces).to.be.equal(amount); - } - }); + itSub('Check total pieces of Fungible token', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + const amount = 10n; + await collection.mint(alice, amount, {Substrate: bob.address}); + { + const totalPieces = await collection.getTotalPieces(); + expect(totalPieces).to.be.equal(amount); + } + await collection.transfer(bob, {Substrate: alice.address}, 1n); + { + const totalPieces = await collection.getTotalPieces(); + expect(totalPieces).to.be.equal(amount); + } }); - it('Check total pieces of NFT token', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const amount = 1n; - const token = await collection.mintToken(alice, {Substrate: bob.address}); - { - const totalPieces = await helper.api?.rpc.unique.totalPieces(collection.collectionId, token.tokenId); - expect(totalPieces?.unwrap().toBigInt()).to.be.equal(amount); - } - await token.transfer(bob, {Substrate: alice.address}); - { - const totalPieces = await helper.api?.rpc.unique.totalPieces(collection.collectionId, token.tokenId); - expect(totalPieces?.unwrap().toBigInt()).to.be.equal(amount); - } - }); + itSub('Check total pieces of NFT token', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const amount = 1n; + const token = await collection.mintToken(alice, {Substrate: bob.address}); + { + const totalPieces = await helper.api?.rpc.unique.totalPieces(collection.collectionId, token.tokenId); + expect(totalPieces?.unwrap().toBigInt()).to.be.equal(amount); + } + await token.transfer(bob, {Substrate: alice.address}); + { + const totalPieces = await helper.api?.rpc.unique.totalPieces(collection.collectionId, token.tokenId); + expect(totalPieces?.unwrap().toBigInt()).to.be.equal(amount); + } }); - it('Check total pieces of ReFungible token', async function() { - await usingPlaygrounds(async (helper) => { - const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const amount = 100n; - const token = await collection.mintToken(alice, {Substrate: bob.address}, amount); - { - const totalPieces = await token.getTotalPieces(); - expect(totalPieces).to.be.equal(amount); - } - await token.transfer(bob, {Substrate: alice.address}, 60n); - { - const totalPieces = await token.getTotalPieces(); - expect(totalPieces).to.be.equal(amount); - } - }); + itSub.ifWithPallets('Check total pieces of ReFungible token', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const amount = 100n; + const token = await collection.mintToken(alice, amount, {Substrate: bob.address}); + { + const totalPieces = await token.getTotalPieces(); + expect(totalPieces).to.be.equal(amount); + } + await token.transfer(bob, {Substrate: alice.address}, 60n); + { + const totalPieces = await token.getTotalPieces(); + expect(totalPieces).to.be.equal(amount); + } }); }); describe('Negative integration test: ext. createItem():', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); - it('Regular user cannot create new item in NFT collection', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const mintTx = async () => collection.mintToken(bob, {Substrate: bob.address}); - await expect(mintTx()).to.be.rejected; - }); + itSub('Regular user cannot create new item in NFT collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const mintTx = async () => collection.mintToken(bob, {Substrate: bob.address}); + await expect(mintTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); }); - it('Regular user cannot create new item in Fungible collection', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - const mintTx = async () => collection.mint(bob, {Substrate: bob.address}, 10n); - await expect(mintTx()).to.be.rejected; - }); + itSub('Regular user cannot create new item in Fungible collection', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + const mintTx = async () => collection.mint(bob, 10n, {Substrate: bob.address}); + await expect(mintTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); }); - it('Regular user cannot create new item in ReFungible collection', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const mintTx = async () => collection.mintToken(bob, {Substrate: bob.address}); - await expect(mintTx()).to.be.rejected; - }); + itSub('Regular user cannot create new item in ReFungible collection', async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const mintTx = async () => collection.mintToken(bob, 100n, {Substrate: bob.address}); + await expect(mintTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); }); - it('No editing rights', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL', - tokenPropertyPermissions: [{key: 'k', permission: {mutable: false, collectionAdmin: false, tokenOwner: false}}], - }); - const mintTx = async () => collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); - await expect(mintTx()).to.be.rejected; + itSub('No editing rights', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL', + tokenPropertyPermissions: [{key: 'k', permission: {mutable: false, collectionAdmin: false, tokenOwner: false}}], }); + const mintTx = async () => collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); + await expect(mintTx()).to.be.rejectedWith(/common\.NoPermission/); }); - it('User doesnt have editing rights', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL', - tokenPropertyPermissions: [{key: 'k', permission: {mutable: true, collectionAdmin: false, tokenOwner: false}}], - }); - const mintTx = async () => collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); - await expect(mintTx()).to.be.rejected; + itSub('User doesnt have editing rights', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL', + tokenPropertyPermissions: [{key: 'k', permission: {mutable: true, collectionAdmin: false, tokenOwner: false}}], }); + const mintTx = async () => collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); + await expect(mintTx()).to.be.rejectedWith(/common\.NoPermission/); }); - it('Adding property without access rights', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const mintTx = async () => collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); - await expect(mintTx()).to.be.rejected; - }); + itSub('Adding property without access rights', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const mintTx = async () => collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); + await expect(mintTx()).to.be.rejectedWith(/common\.NoPermission/); }); - it('Adding more than 64 prps', async () => { + itSub('Adding more than 64 prps', async ({helper}) => { const props: IProperty[] = []; for (let i = 0; i < 65; i++) { props.push({key: `key${i}`, value: `value${i}`}); } - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const mintTx = async () => collection.mintToken(alice, {Substrate: bob.address}, props); - await expect(mintTx()).to.be.rejected; - }); + + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const mintTx = async () => collection.mintToken(alice, {Substrate: bob.address}, props); + await expect(mintTx()).to.be.rejectedWith('Verification Error'); }); - it('Trying to add bigger property than allowed', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL', - tokenPropertyPermissions: [ - {key: 'k1', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}, - {key: 'k2', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}, - ], - }); - const mintTx = async () => collection.mintToken(alice, {Substrate: bob.address}, [ - {key: 'k1', value: 'vvvvvv'.repeat(5000)}, - {key: 'k2', value: 'vvv'.repeat(5000)}, - ]); - await expect(mintTx()).to.be.rejected; + itSub('Trying to add bigger property than allowed', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'k1', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}, + {key: 'k2', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}, + ], }); + const mintTx = async () => collection.mintToken(alice, {Substrate: bob.address}, [ + {key: 'k1', value: 'vvvvvv'.repeat(5000)}, + {key: 'k2', value: 'vvv'.repeat(5000)}, + ]); + await expect(mintTx()).to.be.rejectedWith(/common\.NoSpaceForProperty/); }); - it('Check total pieces for invalid Fungible token', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - const invalidTokenId = 1_000_000; - expect((await helper.api?.rpc.unique.totalPieces(collection.collectionId, invalidTokenId))?.isNone).to.be.true; - expect((await helper.api?.rpc.unique.tokenData(collection.collectionId, invalidTokenId))?.pieces.toBigInt()).to.be.equal(0n); - }); + itSub('Check total pieces for invalid Fungible token', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + const invalidTokenId = 1_000_000; + expect((await helper.api?.rpc.unique.totalPieces(collection.collectionId, invalidTokenId))?.isNone).to.be.true; + expect((await helper.api?.rpc.unique.tokenData(collection.collectionId, invalidTokenId))?.pieces.toBigInt()).to.be.equal(0n); }); - it('Check total pieces for invalid NFT token', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const invalidTokenId = 1_000_000; - expect((await helper.api?.rpc.unique.totalPieces(collection.collectionId, invalidTokenId))?.isNone).to.be.true; - expect((await helper.api?.rpc.unique.tokenData(collection.collectionId, invalidTokenId))?.pieces.toBigInt()).to.be.equal(0n); - }); + itSub('Check total pieces for invalid NFT token', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const invalidTokenId = 1_000_000; + expect((await helper.api?.rpc.unique.totalPieces(collection.collectionId, invalidTokenId))?.isNone).to.be.true; + expect((await helper.api?.rpc.unique.tokenData(collection.collectionId, invalidTokenId))?.pieces.toBigInt()).to.be.equal(0n); }); - it('Check total pieces for invalid Refungible token', async function() { - await usingPlaygrounds(async (helper) => { - const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const invalidTokenId = 1_000_000; - expect((await helper.api?.rpc.unique.totalPieces(collection.collectionId, invalidTokenId))?.isNone).to.be.true; - expect((await helper.api?.rpc.unique.tokenData(collection.collectionId, invalidTokenId))?.pieces.toBigInt()).to.be.equal(0n); - }); + itSub.ifWithPallets('Check total pieces for invalid Refungible token', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const invalidTokenId = 1_000_000; + expect((await helper.api?.rpc.unique.totalPieces(collection.collectionId, invalidTokenId))?.isNone).to.be.true; + expect((await helper.api?.rpc.unique.tokenData(collection.collectionId, invalidTokenId))?.pieces.toBigInt()).to.be.equal(0n); }); }); diff --git a/tests/src/createMultipleItems.test.ts b/tests/src/createMultipleItems.test.ts index ef9aaf6dee..ad39ed8f81 100644 --- a/tests/src/createMultipleItems.test.ts +++ b/tests/src/createMultipleItems.test.ts @@ -1,12 +1,12 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // This file is part of Unique Network. -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by +// Unique Network is free software: you can redistribute itSub and/or modify +// itSub under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Unique Network is distributed in the hope that it will be useful, +// Unique Network is distributed in the hope that itSub will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. @@ -15,179 +15,154 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; import { normalizeAccountId, } from './util/helpers'; -import {usingPlaygrounds} from './util/playgrounds'; +import {usingPlaygrounds, expect, Pallets, itSub} from './util/playgrounds'; -chai.use(chaiAsPromised); -const expect = chai.expect; - -let donor: IKeyringPair; - -before(async () => { - await usingPlaygrounds(async (_, privateKey) => { - donor = privateKey('//Alice'); - }); -}); describe('Integration Test createMultipleItems(collection_id, owner, items_data):', () => { let alice: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice] = await helper.arrange.createAccounts([100n], donor); }); }); - it('Create 0x31, 0x32, 0x33 items in active NFT collection and verify tokens data in chain', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - tokenPropertyPermissions: [ - {key: 'data', permission: {tokenOwner: true, mutable: false, collectionAdmin: false}}, - ], - }); - const args = [ - {properties: [{key: 'data', value: '1'}]}, - {properties: [{key: 'data', value: '2'}]}, - {properties: [{key: 'data', value: '3'}]}, - ]; - const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); - for (const [i, token] of tokens.entries()) { - const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); - expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); - } + itSub('Create 0x31, 0x32, 0x33 items in active NFT collection and verify tokens data in chain', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: true, mutable: false, collectionAdmin: false}}, + ], }); + const args = [ + {properties: [{key: 'data', value: '1'}]}, + {properties: [{key: 'data', value: '2'}]}, + {properties: [{key: 'data', value: '3'}]}, + ]; + const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + for (const [i, token] of tokens.entries()) { + const tokenData = await token.getData(); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); + } }); - it('Create 0x01, 0x02, 0x03 items in active Fungible collection and verify tokens data in chain', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.ft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - }); - const args = [ - {value: 1n}, - {value: 2n}, - {value: 3n}, - ]; - await helper.ft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); - expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(6n); + itSub('Create 0x01, 0x02, 0x03 items in active Fungible collection and verify tokens data in chain', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', }); + const args = [ + {value: 1n}, + {value: 2n}, + {value: 3n}, + ]; + await helper.ft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, args, {Substrate: alice.address}); + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(6n); }); - it('Create 0x31, 0x32, 0x33 items in active ReFungible collection and verify tokens data in chain', async function() { - await usingPlaygrounds(async (helper) => { - const collection = await helper.rft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - }); - const args = [ - {pieces: 1n}, - {pieces: 2n}, - {pieces: 3n}, - ]; - const tokens = await helper.rft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); - - for (const [i, token] of tokens.entries()) { - expect(await token.getBalance({Substrate: alice.address})).to.be.equal(BigInt(i + 1)); - } + itSub.ifWithPallets('Create 0x31, 0x32, 0x33 items in active ReFungible collection and verify tokens data in chain', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', }); + const args = [ + {pieces: 1n}, + {pieces: 2n}, + {pieces: 3n}, + ]; + const tokens = await helper.rft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + + for (const [i, token] of tokens.entries()) { + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(BigInt(i + 1)); + } }); - it('Can mint amount of items equals to collection limits', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - limits: { - tokenLimit: 2, - }, - }); - const args = [{}, {}]; - await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + itSub('Can mint amount of items equals to collection limits', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + limits: { + tokenLimit: 2, + }, }); + const args = [{}, {}]; + await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); }); - it('Create 0x31, 0x32, 0x33 items in active NFT with property Admin', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - tokenPropertyPermissions: [ - {key: 'data', permission: {tokenOwner: false, mutable: true, collectionAdmin: true}}, - ], - }); - const args = [ - {properties: [{key: 'data', value: '1'}]}, - {properties: [{key: 'data', value: '2'}]}, - {properties: [{key: 'data', value: '3'}]}, - ]; - const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); - for (const [i, token] of tokens.entries()) { - const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); - expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); - } + itSub('Create 0x31, 0x32, 0x33 items in active NFT with property Admin', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: false, mutable: true, collectionAdmin: true}}, + ], }); + const args = [ + {properties: [{key: 'data', value: '1'}]}, + {properties: [{key: 'data', value: '2'}]}, + {properties: [{key: 'data', value: '3'}]}, + ]; + const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + for (const [i, token] of tokens.entries()) { + const tokenData = await token.getData(); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); + } }); - it('Create 0x31, 0x32, 0x33 items in active NFT with property AdminConst', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - tokenPropertyPermissions: [ - {key: 'data', permission: {tokenOwner: false, mutable: false, collectionAdmin: true}}, - ], - }); - const args = [ - {properties: [{key: 'data', value: '1'}]}, - {properties: [{key: 'data', value: '2'}]}, - {properties: [{key: 'data', value: '3'}]}, - ]; - const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); - for (const [i, token] of tokens.entries()) { - const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); - expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); - } + itSub('Create 0x31, 0x32, 0x33 items in active NFT with property AdminConst', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: false, mutable: false, collectionAdmin: true}}, + ], }); + const args = [ + {properties: [{key: 'data', value: '1'}]}, + {properties: [{key: 'data', value: '2'}]}, + {properties: [{key: 'data', value: '3'}]}, + ]; + const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + for (const [i, token] of tokens.entries()) { + const tokenData = await token.getData(); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); + } }); - it('Create 0x31, 0x32, 0x33 items in active NFT with property itemOwnerOrAdmin', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - tokenPropertyPermissions: [ - {key: 'data', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}, - ], - }); - const args = [ - {properties: [{key: 'data', value: '1'}]}, - {properties: [{key: 'data', value: '2'}]}, - {properties: [{key: 'data', value: '3'}]}, - ]; - const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); - for (const [i, token] of tokens.entries()) { - const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); - expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); - } + itSub('Create 0x31, 0x32, 0x33 items in active NFT with property itemOwnerOrAdmin', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}, + ], }); + const args = [ + {properties: [{key: 'data', value: '1'}]}, + {properties: [{key: 'data', value: '2'}]}, + {properties: [{key: 'data', value: '3'}]}, + ]; + const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + for (const [i, token] of tokens.entries()) { + const tokenData = await token.getData(); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); + } }); }); @@ -196,229 +171,205 @@ describe('Negative Integration Test createMultipleItems(collection_id, owner, it let bob: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); - it('Regular user cannot create items in active NFT collection', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - }); - const args = [ - {}, - {}, - ]; - const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(bob, collection.collectionId, {Substrate: alice.address}, args); - await expect(mintTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); + itSub('Regular user cannot create items in active NFT collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', }); + const args = [ + {}, + {}, + ]; + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(bob, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); }); - it('Regular user cannot create items in active Fungible collection', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.ft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - }); - const args = [ - {value: 1n}, - {value: 2n}, - {value: 3n}, - ]; - const mintTx = async () => helper.ft.mintMultipleTokensWithOneOwner(bob, collection.collectionId, {Substrate: alice.address}, args); - await expect(mintTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); + itSub('Regular user cannot create items in active Fungible collection', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', }); + const args = [ + {value: 1n}, + {value: 2n}, + {value: 3n}, + ]; + const mintTx = async () => helper.ft.mintMultipleTokensWithOneOwner(bob, collection.collectionId, args, {Substrate: alice.address}); + await expect(mintTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); }); - it('Regular user cannot create items in active ReFungible collection', async function() { - await usingPlaygrounds(async (helper) => { - const collection = await helper.rft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - }); - const args = [ - {pieces: 1n}, - {pieces: 1n}, - {pieces: 1n}, - ]; - const mintTx = async () => helper.rft.mintMultipleTokensWithOneOwner(bob, collection.collectionId, {Substrate: alice.address}, args); - await expect(mintTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); + itSub.ifWithPallets('Regular user cannot create items in active ReFungible collection', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', }); + const args = [ + {pieces: 1n}, + {pieces: 1n}, + {pieces: 1n}, + ]; + const mintTx = async () => helper.rft.mintMultipleTokensWithOneOwner(bob, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); }); - it('Create token in not existing collection', async () => { - await usingPlaygrounds(async (helper) => { - const collectionId = 1_000_000; - const args = [ - {}, - {}, - ]; - const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(bob, collectionId, {Substrate: alice.address}, args); - await expect(mintTx()).to.be.rejectedWith(/common\.CollectionNotFound/); - }); + itSub('Create token in not existing collection', async ({helper}) => { + const collectionId = 1_000_000; + const args = [ + {}, + {}, + ]; + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(bob, collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('Create NFTs that has reached the maximum data limit', async function() { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - tokenPropertyPermissions: [ - {key: 'data', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}, - ], - }); - const args = [ - {properties: [{key: 'data', value: 'A'.repeat(32769)}]}, - {properties: [{key: 'data', value: 'B'.repeat(32769)}]}, - {properties: [{key: 'data', value: 'C'.repeat(32769)}]}, - ]; - const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); - await expect(mintTx()).to.be.rejected; + itSub('Create NFTs that has reached the maximum data limit', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}, + ], }); + const args = [ + {properties: [{key: 'data', value: 'A'.repeat(32769)}]}, + {properties: [{key: 'data', value: 'B'.repeat(32769)}]}, + {properties: [{key: 'data', value: 'C'.repeat(32769)}]}, + ]; + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejectedWith('Verification Error'); }); - it('Create Refungible tokens that has reached the maximum data limit', async function() { - await usingPlaygrounds(async (helper) => { - const collection = await helper.rft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - tokenPropertyPermissions: [ - {key: 'data', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}, - ], - }); - const args = [ - {pieces: 10n, properties: [{key: 'data', value: 'A'.repeat(32769)}]}, - {pieces: 10n, properties: [{key: 'data', value: 'B'.repeat(32769)}]}, - {pieces: 10n, properties: [{key: 'data', value: 'C'.repeat(32769)}]}, - ]; - const mintTx = async () => helper.rft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); - await expect(mintTx()).to.be.rejected; + itSub.ifWithPallets('Create Refungible tokens that has reached the maximum data limit', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}, + ], }); + const args = [ + {pieces: 10n, properties: [{key: 'data', value: 'A'.repeat(32769)}]}, + {pieces: 10n, properties: [{key: 'data', value: 'B'.repeat(32769)}]}, + {pieces: 10n, properties: [{key: 'data', value: 'C'.repeat(32769)}]}, + ]; + const mintTx = async () => helper.rft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejectedWith('Verification Error'); }); - it('Create tokens with different types', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - }); - - //FIXME: - const types = ['NFT', 'Fungible', 'ReFungible']; - const mintTx = helper.api?.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), types); - await expect(helper.signTransaction(alice, mintTx)).to.be.rejected; + itSub.ifWithPallets('Create tokens with different types', [Pallets.ReFungible], async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', }); + + const types = ['NFT', 'Fungible', 'ReFungible']; + const mintTx = helper.api?.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), types); + await expect(helper.signTransaction(alice, mintTx)).to.be.rejected; }); - it('Create tokens with different data limits <> maximum data limit', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - tokenPropertyPermissions: [ - {key: 'data', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}, - ], - }); - const args = [ - {properties: [{key: 'data', value: 'A'}]}, - {properties: [{key: 'data', value: 'B'.repeat(32769)}]}, - ]; - const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); - await expect(mintTx()).to.be.rejected; + itSub('Create tokens with different data limits <> maximum data limit', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}, + ], }); + const args = [ + {properties: [{key: 'data', value: 'A'}]}, + {properties: [{key: 'data', value: 'B'.repeat(32769)}]}, + ]; + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejectedWith('Verification Error'); }); - it('Fails when minting tokens exceeds collectionLimits amount', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - tokenPropertyPermissions: [ - {key: 'data', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}, - ], - limits: { - tokenLimit: 1, - }, - }); - const args = [ - {}, - {}, - ]; - const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); - await expect(mintTx()).to.be.rejected; + itSub('Fails when minting tokens exceeds collectionLimits amount', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}, + ], + limits: { + tokenLimit: 1, + }, }); + const args = [ + {}, + {}, + ]; + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejectedWith(/common\.CollectionTokenLimitExceeded/); }); - it('User doesnt have editing rights', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - tokenPropertyPermissions: [ - {key: 'data', permission: {tokenOwner: false, mutable: true, collectionAdmin: false}}, - ], - }); - const args = [ - {properties: [{key: 'data', value: 'A'}]}, - ]; - const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); - await expect(mintTx()).to.be.rejected; + itSub('User doesnt have editing rights', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'data', permission: {tokenOwner: false, mutable: true, collectionAdmin: false}}, + ], }); + const args = [ + {properties: [{key: 'data', value: 'A'}]}, + ]; + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejectedWith(/common\.NoPermission/); }); - it('Adding property without access rights', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - properties: [ - { - key: 'data', - value: 'v', - }, - ], - }); - const args = [ - {properties: [{key: 'data', value: 'A'}]}, - ]; - const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); - await expect(mintTx()).to.be.rejected; + itSub('Adding property without access rights', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + properties: [ + { + key: 'data', + value: 'v', + }, + ], }); + const args = [ + {properties: [{key: 'data', value: 'A'}]}, + ]; + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejectedWith(/common\.NoPermission/); }); - it('Adding more than 64 prps', async () => { - await usingPlaygrounds(async (helper) => { - const collection = await helper.nft.mintCollection(alice, { - name: 'name', - description: 'descr', - tokenPrefix: 'COL', - }); - const prps = []; - - for (let i = 0; i < 65; i++) { - prps.push({key: `key${i}`, value: `value${i}`}); - } - - const args = [ - {properties: prps}, - {properties: prps}, - {properties: prps}, - ]; - - const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); - await expect(mintTx()).to.be.rejected; + itSub('Adding more than 64 prps', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', }); + const prps = []; + + for (let i = 0; i < 65; i++) { + prps.push({key: `key${i}`, value: `value${i}`}); + } + + const args = [ + {properties: prps}, + {properties: prps}, + {properties: prps}, + ]; + + const mintTx = async () => helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); + await expect(mintTx()).to.be.rejectedWith('Verification Error'); }); }); From ceb5947d3722dd70b2297c6422c20c281a83c494 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Wed, 14 Sep 2022 13:54:39 +0000 Subject: [PATCH 0894/1274] Test: getTotalStaked increased after payoutStakers --- tests/src/app-promotion.test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 5787071468..1ee83a5520 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -661,6 +661,24 @@ describe('app-promotion rewards', () => { }); }); + it.only('should increase total staked', async() => { + await usingPlaygrounds(async (helper) => { + const staker = accounts.pop()!; + const totalStakedBefore = await helper.staking.getTotalStaked(); + + await helper.staking.stake(staker, 100n * nominal); + + const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0]; + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock)); + + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + const totalStakedAfter = await helper.staking.getTotalStaked(); + + console.log(totalStakedBefore + calculateIncome(100n * nominal, 10n)); + expect(totalStakedBefore + calculateIncome(100n * nominal, 10n)).to.be.equal(totalStakedAfter); + }); + }); + it('should credit 0.05% for staking period', async () => { await usingPlaygrounds(async helper => { const staker = accounts.pop()!; From d729c2f6bbf41cf804992c68371fdb1658a93bff Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 14 Sep 2022 17:55:31 +0300 Subject: [PATCH 0895/1274] createMultipleItemsEx migrated --- tests/src/createMultipleItemsEx.test.ts | 533 +++++++++++++----------- 1 file changed, 294 insertions(+), 239 deletions(-) diff --git a/tests/src/createMultipleItemsEx.test.ts b/tests/src/createMultipleItemsEx.test.ts index e76d2f0497..0a555fcc6e 100644 --- a/tests/src/createMultipleItemsEx.test.ts +++ b/tests/src/createMultipleItemsEx.test.ts @@ -14,121 +14,166 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {expect} from 'chai'; +import {IKeyringPair} from '@polkadot/types/types'; +import {usingPlaygrounds, expect, Pallets, itSub} from './util/playgrounds'; import usingApi, {executeTransaction} from './substrate/substrate-api'; -import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, createCollectionWithPropsExpectSuccess, getBalance, getLastTokenId, getTokenProperties, requirePallets, Pallets} from './util/helpers'; +import {createCollectionExpectSuccess, getBalance, getLastTokenId, getTokenProperties, requirePallets} from './util/helpers'; +import {IProperty} from './util/playgrounds/types'; describe('Integration Test: createMultipleItemsEx', () => { - it('can initialize multiple NFT with different owners', async () => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - const data = [ - { - owner: {substrate: alice.address}, - }, { - owner: {substrate: bob.address}, - }, { - owner: {substrate: charlie.address}, - }, - ]; + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); + }); + }); - await executeTransaction(api, alice, api.tx.unique.createMultipleItemsEx(collection, { - NFT: data, - })); - const tokens = await api.query.nonfungible.tokenData.entries(collection); - const json = tokens.map(([, token]) => token.toJSON()); - expect(json).to.be.deep.equal(data); + itSub('can initialize multiple NFT with different owners', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', }); + const args = [ + { + owner: {Substrate: alice.address}, + }, + { + owner: {Substrate: bob.address}, + }, + { + owner: {Substrate: charlie.address}, + }, + ]; + + const tokens = await collection.mintMultipleTokens(alice, args); + for (const [i, token] of tokens.entries()) { + expect(await token.getOwner()).to.be.deep.equal(args[i].owner); + } }); - it('createMultipleItemsEx with property Admin', async () => { - const collection = await createCollectionWithPropsExpectSuccess({mode: {type: 'NFT'}, propPerm: [{key: 'k', permission: {mutable: true, collectionAdmin: true, tokenOwner: false}}]}); - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - const data = [ + itSub('createMultipleItemsEx with property Admin', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ { - owner: {substrate: alice.address}, - properties: [{key: 'k', value: 'v1'}], - }, { - owner: {substrate: bob.address}, - properties: [{key: 'k', value: 'v2'}], - }, { - owner: {substrate: charlie.address}, - properties: [{key: 'k', value: 'v3'}], + key: 'k', + permission: { + mutable: true, + collectionAdmin: true, + tokenOwner: false, + }, }, - ]; - - await executeTransaction(api, alice, api.tx.unique.createMultipleItemsEx(collection, { - NFT: data, - })); - for (let i = 1; i < 4; i++) { - expect(await api.rpc.unique.tokenProperties(collection, i)).not.to.be.empty; - } + ], }); + + const args = [ + { + owner: {Substrate: alice.address}, + properties: [{key: 'k', value: 'v1'}], + }, + { + owner: {Substrate: bob.address}, + properties: [{key: 'k', value: 'v2'}], + }, + { + owner: {Substrate: charlie.address}, + properties: [{key: 'k', value: 'v3'}], + }, + ]; + + const tokens = await collection.mintMultipleTokens(alice, args); + for (const [i, token] of tokens.entries()) { + expect(await token.getOwner()).to.be.deep.equal(args[i].owner); + expect(await token.getData()).to.not.be.empty; + } }); - it('createMultipleItemsEx with property AdminConst', async () => { - const collection = await createCollectionWithPropsExpectSuccess({mode: {type: 'NFT'}, propPerm: [{key: 'k', permission: {mutable: false, collectionAdmin: true, tokenOwner: false}}]}); - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - const data = [ + itSub('createMultipleItemsEx with property AdminConst', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ { - owner: {substrate: alice.address}, - properties: [{key: 'k', value: 'v1'}], - }, { - owner: {substrate: bob.address}, - properties: [{key: 'k', value: 'v2'}], - }, { - owner: {substrate: charlie.address}, - properties: [{key: 'k', value: 'v3'}], + key: 'k', + permission: { + mutable: false, + collectionAdmin: true, + tokenOwner: false, + }, }, - ]; - - await executeTransaction(api, alice, api.tx.unique.createMultipleItemsEx(collection, { - NFT: data, - })); - for (let i = 1; i < 4; i++) { - expect(await api.rpc.unique.tokenProperties(collection, i)).not.to.be.empty; - } + ], }); + + const args = [ + { + owner: {Substrate: alice.address}, + properties: [{key: 'k', value: 'v1'}], + }, + { + owner: {Substrate: bob.address}, + properties: [{key: 'k', value: 'v2'}], + }, + { + owner: {Substrate: charlie.address}, + properties: [{key: 'k', value: 'v3'}], + }, + ]; + + const tokens = await collection.mintMultipleTokens(alice, args); + for (const [i, token] of tokens.entries()) { + expect(await token.getOwner()).to.be.deep.equal(args[i].owner); + expect(await token.getData()).to.not.be.empty; + } }); - it('createMultipleItemsEx with property itemOwnerOrAdmin', async () => { - const collection = await createCollectionWithPropsExpectSuccess({mode: {type: 'NFT'}, propPerm: [{key: 'k', permission: {mutable: false, collectionAdmin: true, tokenOwner: true}}]}); - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - const data = [ + itSub('createMultipleItemsEx with property itemOwnerOrAdmin', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ { - owner: {substrate: alice.address}, - properties: [{key: 'k', value: 'v1'}], - }, { - owner: {substrate: bob.address}, - properties: [{key: 'k', value: 'v2'}], - }, { - owner: {substrate: charlie.address}, - properties: [{key: 'k', value: 'v3'}], + key: 'k', + permission: { + mutable: false, + collectionAdmin: true, + tokenOwner: true, + }, }, - ]; - - await executeTransaction(api, alice, api.tx.unique.createMultipleItemsEx(collection, { - NFT: data, - })); - for (let i = 1; i < 4; i++) { - expect(await api.rpc.unique.tokenProperties(collection, i)).not.to.be.empty; - } + ], }); + + const args = [ + { + owner: {Substrate: alice.address}, + properties: [{key: 'k', value: 'v1'}], + }, + { + owner: {Substrate: bob.address}, + properties: [{key: 'k', value: 'v2'}], + }, + { + owner: {Substrate: charlie.address}, + properties: [{key: 'k', value: 'v3'}], + }, + ]; + + const tokens = await collection.mintMultipleTokens(alice, args); + for (const [i, token] of tokens.entries()) { + expect(await token.getOwner()).to.be.deep.equal(args[i].owner); + expect(await token.getData()).to.not.be.empty; + } }); - it('can initialize fungible with multiple owners', async () => { + it.skip('can initialize fungible with multiple owners', async () => { const collection = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); await usingApi(async (api, privateKeyWrapper) => { const alice = privateKeyWrapper('//Alice'); @@ -146,7 +191,7 @@ describe('Integration Test: createMultipleItemsEx', () => { }); }); - it('can initialize an RFT with multiple owners', async function() { + it.skip('can initialize an RFT with multiple owners', async function() { await requirePallets(this, [Pallets.ReFungible]); await usingApi(async (api, privateKeyWrapper) => { @@ -180,7 +225,7 @@ describe('Integration Test: createMultipleItemsEx', () => { }); }); - it('can initialize multiple RFTs with the same owner', async function() { + it.skip('can initialize multiple RFTs with the same owner', async function() { await requirePallets(this, [Pallets.ReFungible]); await usingApi(async (api, privateKeyWrapper) => { @@ -221,175 +266,185 @@ describe('Integration Test: createMultipleItemsEx', () => { }); describe('Negative test: createMultipleItemsEx', () => { - it('No editing rights', async () => { - const collection = await createCollectionWithPropsExpectSuccess({properties: [{key: 'key1', value: 'v'}], - propPerm: [{key: 'key1', permission: {mutable: true, collectionAdmin: false, tokenOwner: false}}]}); - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - const data = [ - { - owner: {substrate: alice.address}, - properties: [{key: 'key1', value: 'v2'}], - }, { - owner: {substrate: bob.address}, - properties: [{key: 'key1', value: 'v2'}], - }, { - owner: {substrate: charlie.address}, - properties: [{key: 'key1', value: 'v2'}], - }, - ]; - - const tx = api.tx.unique.createMultipleItemsEx(collection, {NFT: data}); - // await executeTransaction(api, alice, tx); - - //await submitTransactionExpectFailAsync(alice, tx); - await expect(executeTransaction(api, alice, tx)).to.be.rejectedWith(/common\.NoPermission/); + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); - it('User doesnt have editing rights', async () => { - const collection = await createCollectionWithPropsExpectSuccess({properties: [{key: 'key1', value: 'v'}], - propPerm: [{key: 'key1', permission: {mutable: false, collectionAdmin: false, tokenOwner: false}}]}); - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - const data = [ + itSub('No editing rights', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ { - owner: {substrate: alice.address}, - properties: [{key: 'key1', value: 'v2'}], - }, { - owner: {substrate: alice.address}, - properties: [{key: 'key1', value: 'v2'}], - }, { - owner: {substrate: alice.address}, - properties: [{key: 'key1', value: 'v2'}], + key: 'k', + permission: { + mutable: true, + collectionAdmin: false, + tokenOwner: false, + }, }, - ]; - - const tx = api.tx.unique.createMultipleItemsEx(collection, {NFT: data}); - // await executeTransaction(api, alice, tx); - - //await submitTransactionExpectFailAsync(alice, tx); - await expect(executeTransaction(api, alice, tx)).to.be.rejectedWith(/common\.NoPermission/); + ], }); + + const args = [ + { + owner: {Substrate: alice.address}, + properties: [{key: 'k', value: 'v1'}], + }, + { + owner: {Substrate: bob.address}, + properties: [{key: 'k', value: 'v2'}], + }, + { + owner: {Substrate: charlie.address}, + properties: [{key: 'k', value: 'v3'}], + }, + ]; + + await expect(collection.mintMultipleTokens(alice, args)).to.be.rejectedWith(/common\.NoPermission/); }); - it('Adding property without access rights', async () => { - const collection = await createCollectionWithPropsExpectSuccess({properties: [{key: 'key1', value: 'v'}]}); - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - const data = [ + itSub('User doesnt have editing rights', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ { - owner: {substrate: alice.address}, - properties: [{key: 'key1', value: 'v2'}], - }, { - owner: {substrate: bob.address}, - properties: [{key: 'key1', value: 'v2'}], - }, { - owner: {substrate: charlie.address}, - properties: [{key: 'key1', value: 'v2'}], + key: 'k', + permission: { + mutable: false, + collectionAdmin: false, + tokenOwner: false, + }, }, - ]; - - const tx = api.tx.unique.createMultipleItemsEx(collection, {NFT: data}); - - await expect(executeTransaction(api, alice, tx)).to.be.rejectedWith(/common\.NoPermission/); - //await submitTransactionExpectFailAsync(alice, tx); + ], }); - }); - it('Adding more than 64 properties', async () => { - const propPerms = [{key: 'key', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}]; - - for (let i = 0; i < 65; i++) { - propPerms.push({key: `key${i}`, permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}); - } + const args = [ + { + owner: {Substrate: alice.address}, + properties: [{key: 'k', value: 'v1'}], + }, + { + owner: {Substrate: bob.address}, + properties: [{key: 'k', value: 'v2'}], + }, + { + owner: {Substrate: charlie.address}, + properties: [{key: 'k', value: 'v3'}], + }, + ]; + + await expect(collection.mintMultipleTokens(alice, args)).to.be.rejectedWith(/common\.NoPermission/); + }); - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - await expect(executeTransaction(api, alice, api.tx.unique.setTokenPropertyPermissions(collection, propPerms))).to.be.rejectedWith(/common\.PropertyLimitReached/); + itSub('Adding property without access rights', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', }); + + const args = [ + { + owner: {Substrate: alice.address}, + properties: [{key: 'k', value: 'v1'}], + }, + { + owner: {Substrate: bob.address}, + properties: [{key: 'k', value: 'v2'}], + }, + { + owner: {Substrate: charlie.address}, + properties: [{key: 'k', value: 'v3'}], + }, + ]; + + await expect(collection.mintMultipleTokens(alice, args)).to.be.rejectedWith(/common\.NoPermission/); }); - it('Trying to add bigger property than allowed', async () => { - const collection = await createCollectionWithPropsExpectSuccess({propPerm: [{key: 'k', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}]}); - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - const data = [ + itSub('Adding more than 64 properties', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ { - owner: {substrate: alice.address}, properties: [{key: 'k', value: 'vvvvvv'.repeat(5000)}, {key: 'k2', value: 'vvv'.repeat(5000)}], - }, { - owner: {substrate: bob.address}, properties: [{key: 'k', value: 'vvvvvv'.repeat(5000)}, {key: 'k2', value: 'vvv'.repeat(5000)}], - }, { - owner: {substrate: charlie.address}, properties: [{key: 'k', value: 'vvvvvv'.repeat(5000)}, {key: 'k2', value: 'vvv'.repeat(5000)}], + key: 'k', + permission: { + mutable: true, + collectionAdmin: true, + tokenOwner: true, + }, }, - ]; - - const tx = api.tx.unique.createMultipleItemsEx(collection, {NFT: data}); - - //await submitTransactionExpectFailAsync(alice, tx); - await expect(executeTransaction(api, alice, tx)).to.be.rejectedWith(/common\.NoPermission/); + ], }); - }); - it('can initialize multiple NFT with different owners', async () => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - const data = [ - { - owner: {substrate: alice.address}, - }, { - owner: {substrate: bob.address}, - }, { - owner: {substrate: charlie.address}, - }, - ]; + const properties: IProperty[] = []; - await executeTransaction(api, alice, api.tx.unique.createMultipleItemsEx(collection, { - NFT: data, - })); - const tokens = await api.query.nonfungible.tokenData.entries(collection); - const json = tokens.map(([, token]) => token.toJSON()); - expect(json).to.be.deep.equal(data); - }); + for (let i = 0; i < 65; i++) { + properties.push({key: `k${i}`, value: `v${i}`}); + } + + const args = [ + { + owner: {Substrate: alice.address}, + properties: properties, + }, + { + owner: {Substrate: bob.address}, + properties: properties, + }, + { + owner: {Substrate: charlie.address}, + properties: properties, + }, + ]; + + await expect(collection.mintMultipleTokens(alice, args)).to.be.rejectedWith('Verification Error'); }); - it('can initialize multiple NFT with different owners', async () => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - const data = [ + itSub('Trying to add bigger property than allowed', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ { - owner: {substrate: alice.address}, - }, { - owner: {substrate: bob.address}, - }, { - owner: {substrate: charlie.address}, + key: 'k', + permission: { + mutable: true, + collectionAdmin: true, + tokenOwner: true, + }, }, - ]; - - await executeTransaction(api, alice, api.tx.unique.createMultipleItemsEx(collection, { - NFT: data, - })); - const tokens = await api.query.nonfungible.tokenData.entries(collection); - const json = tokens.map(([, token]) => token.toJSON()); - expect(json).to.be.deep.equal(data); + ], }); + + const args = [ + { + owner: {Substrate: alice.address}, + properties: [{key: 'k', value: 'A'.repeat(32769)}], + }, + { + owner: {Substrate: bob.address}, + properties: [{key: 'k', value: 'A'.repeat(32769)}], + }, + { + owner: {Substrate: charlie.address}, + properties: [{key: 'k', value: 'A'.repeat(32769)}], + }, + ]; + + await expect(collection.mintMultipleTokens(alice, args)).to.be.rejectedWith('Verification Error'); }); }); From 03847552476a233562df570f4b9dfae882ad660b Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Wed, 14 Sep 2022 14:58:50 +0000 Subject: [PATCH 0896/1274] Fix test --- tests/src/app-promotion.test.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 1ee83a5520..f8fbfaf885 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -665,17 +665,20 @@ describe('app-promotion rewards', () => { await usingPlaygrounds(async (helper) => { const staker = accounts.pop()!; const totalStakedBefore = await helper.staking.getTotalStaked(); - await helper.staking.stake(staker, 100n * nominal); - + + // Wait for rewards and pay const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0]; await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock)); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + const totalStakedAfter = await helper.staking.getTotalStaked(); + const stakersStakedBalance = totalStakedBefore + calculateIncome(100n * nominal, 10n); + expect(totalStakedAfter >= stakersStakedBalance).to.be.true; - console.log(totalStakedBefore + calculateIncome(100n * nominal, 10n)); - expect(totalStakedBefore + calculateIncome(100n * nominal, 10n)).to.be.equal(totalStakedAfter); + // staker can unstake + await helper.staking.unstake(staker); + expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedAfter - stakersStakedBalance); }); }); From 7d1c4da161ca429e2cd5c6d46b83167d89e17bd6 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Wed, 14 Sep 2022 22:22:09 +0700 Subject: [PATCH 0897/1274] fix totalstaked calc bug --- Cargo.lock | 2 +- pallets/app-promotion/src/lib.rs | 16 ++++++++-------- tests/src/app-promotion.test.ts | 7 +++---- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bce3434a64..10ae3eba01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6475,7 +6475,7 @@ dependencies = [ [[package]] name = "pallet-unique" -version = "0.1.4" +version = "0.2.0" dependencies = [ "ethereum", "evm-coder", diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index c1ed4b6a56..65064ce82a 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -594,14 +594,14 @@ pub mod pallet { last_id, *income_acc.borrow(), ExistenceRequirement::KeepAlive, - ) - .and_then(|_| { - Self::add_lock_balance(last_id, *income_acc.borrow())?; - >::try_mutate(|staked| { - staked - .checked_add(&*income_acc.borrow()) - .ok_or(ArithmeticError::Overflow.into()) - }) + )?; + + Self::add_lock_balance(last_id, *income_acc.borrow())?; + >::try_mutate(|staked| -> DispatchResult { + *staked = staked + .checked_add(&*income_acc.borrow()) + .ok_or(ArithmeticError::Overflow)?; + Ok(()) })?; Self::deposit_event(Event::StakingRecalculation( diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index f8fbfaf885..6f440656cf 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -661,7 +661,7 @@ describe('app-promotion rewards', () => { }); }); - it.only('should increase total staked', async() => { + it('should increase total staked', async() => { await usingPlaygrounds(async (helper) => { const staker = accounts.pop()!; const totalStakedBefore = await helper.staking.getTotalStaked(); @@ -673,12 +673,11 @@ describe('app-promotion rewards', () => { await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); const totalStakedAfter = await helper.staking.getTotalStaked(); - const stakersStakedBalance = totalStakedBefore + calculateIncome(100n * nominal, 10n); - expect(totalStakedAfter >= stakersStakedBalance).to.be.true; + expect(totalStakedAfter >= totalStakedBefore + calculateIncome(100n * nominal, 10n)).to.be.true; // staker can unstake await helper.staking.unstake(staker); - expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedAfter - stakersStakedBalance); + expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedAfter - calculateIncome(100n * nominal, 10n)); }); }); From bbf501e6dfeb2db4e3568637092493a1fcd06cd3 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Wed, 14 Sep 2022 19:25:41 +0000 Subject: [PATCH 0898/1274] Return (un)staking info in more convinient view - Refactor getTotalStakedPerBlock getPendingUnstakePerBlock methods. - Add docs --- tests/src/app-promotion.test.ts | 82 +++++++++++++++------------- tests/src/util/playgrounds/types.ts | 5 ++ tests/src/util/playgrounds/unique.ts | 43 +++++++++++++-- 3 files changed, 86 insertions(+), 44 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 6f440656cf..d2d644d355 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -81,7 +81,9 @@ describe('app-promotions.stake extrinsic', () => { await helper.staking.stake(staker, 200n * nominal); expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(300n * nominal); - expect((await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map((x) => x[1])).to.be.deep.equal([100n * nominal, 200n * nominal]); + const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(totalStakedPerBlock[0].amount).to.equal(100n * nominal); + expect(totalStakedPerBlock[1].amount).to.equal(200n * nominal); }); }); @@ -159,10 +161,10 @@ describe('unstake balance extrinsic', () => { const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); await helper.staking.unstake(staker); - const unstakedInBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}))[0][0]; + const [pendingUnstake] = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); // Wait for unstaking period. Balance now free ~1000; reserved, frozen, miscFrozeb: 0n - await helper.wait.forParachainBlockNumber(unstakedInBlock); + await helper.wait.forParachainBlockNumber(pendingUnstake.block); expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, miscFrozen: 0n, feeFrozen: 0n}); expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); @@ -180,25 +182,26 @@ describe('unstake balance extrinsic', () => { await helper.staking.stake(staker, 300n * nominal); // staked: [100, 200, 300]; unstaked: 0 - let pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); - let unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]); - let stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]); - expect(pendingUnstake).to.be.deep.equal(0n); - expect(unstakedPerBlock).to.be.deep.equal([]); - expect(stakedPerBlock).to.be.deep.equal([100n * nominal, 200n * nominal, 300n * nominal]); + let totalPendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); + let pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); + let stakes = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(totalPendingUnstake).to.be.deep.equal(0n); + expect(pendingUnstake).to.be.deep.equal([]); + expect(stakes[0].amount).to.equal(100n * nominal); + expect(stakes[1].amount).to.equal(200n * nominal); + expect(stakes[2].amount).to.equal(300n * nominal); // Can unstake multiple stakes await helper.staking.unstake(staker); - const unstakingBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}))[0][0]; - pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); - unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]); - stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]); - expect(pendingUnstake).to.be.equal(600n * nominal); - expect(stakedPerBlock).to.be.deep.equal([]); - expect(unstakedPerBlock).to.be.deep.equal([600n * nominal]); + pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); + totalPendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); + stakes = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(totalPendingUnstake).to.be.equal(600n * nominal); + expect(stakes).to.be.deep.equal([]); + expect(pendingUnstake[0].amount).to.equal(600n * nominal); expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 600n * nominal, feeFrozen: 0n, miscFrozen: 0n}); - await helper.wait.forParachainBlockNumber(unstakingBlock); + await helper.wait.forParachainBlockNumber(pendingUnstake[0].block); expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 0n, miscFrozen: 0n}); expect (await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); }); @@ -235,8 +238,8 @@ describe('unstake balance extrinsic', () => { const unstakingPerBlock = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); expect(unstakingPerBlock).has.length(2); - expect(unstakingPerBlock[0][1]).to.equal(100n * nominal); - expect(unstakingPerBlock[1][1]).to.equal(120n * nominal); + expect(unstakingPerBlock[0].amount).to.equal(100n * nominal); + expect(unstakingPerBlock[1].amount).to.equal(120n * nominal); }); }); @@ -661,15 +664,15 @@ describe('app-promotion rewards', () => { }); }); - it('should increase total staked', async() => { + it('should increase total staked', async () => { await usingPlaygrounds(async (helper) => { const staker = accounts.pop()!; const totalStakedBefore = await helper.staking.getTotalStaked(); await helper.staking.stake(staker, 100n * nominal); // Wait for rewards and pay - const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0]; - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock)); + const [stakedInBlock] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock.block)); await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); const totalStakedAfter = await helper.staking.getTotalStaked(); @@ -691,13 +694,14 @@ describe('app-promotion rewards', () => { await helper.staking.stake(staker, 200n * nominal); // wait rewards are available: - const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[1][0]; - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock)); + const [_, stake2] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake2.block)); await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); - const totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); - expect(totalStakedPerBlock).to.be.deep.equal([calculateIncome(100n * nominal, 10n), calculateIncome(200n * nominal, 10n)]); + const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(totalStakedPerBlock[0].amount).to.equal(calculateIncome(100n * nominal, 10n)); + expect(totalStakedPerBlock[1].amount).to.equal(calculateIncome(200n * nominal, 10n)); }); }); @@ -707,13 +711,13 @@ describe('app-promotion rewards', () => { await helper.staking.stake(staker, 100n * nominal); // wait for two rewards are available: - const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0]; - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock) + LOCKING_PERIOD); + let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); - const stakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); const frozenBalanceShouldBe = calculateIncome(100n * nominal, 10n, 2); - expect(stakedPerBlock[0][1]).to.be.equal(frozenBalanceShouldBe); + expect(stake.amount).to.be.equal(frozenBalanceShouldBe); const stakerFullBalance = await helper.balance.getSubstrateFull(staker.address); @@ -726,8 +730,8 @@ describe('app-promotion rewards', () => { // staker unstakes before rewards has been payed const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); - const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0]; - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock) + LOCKING_PERIOD); + const [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); await helper.staking.unstake(staker); // so he did not receive any rewards @@ -745,17 +749,17 @@ describe('app-promotion rewards', () => { await helper.staking.stake(staker, 100n * nominal); - const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0]; - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock)); + let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block)); await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); - let totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); - expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n)]); + [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n)); - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock) + LOCKING_PERIOD); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); - totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]); - expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n, 2)]); + [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n, 2)); }); }); diff --git a/tests/src/util/playgrounds/types.ts b/tests/src/util/playgrounds/types.ts index a088cc8755..b3acfb1af1 100644 --- a/tests/src/util/playgrounds/types.ts +++ b/tests/src/util/playgrounds/types.ts @@ -147,6 +147,11 @@ export interface ISubstrateBalance { feeFrozen: bigint } +export interface IStakingInfo { + block: bigint, + amount: bigint, +} + export type TSubstrateAccount = string; export type TEthereumAccount = string; export type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated'; diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 497914f156..ea4743339b 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -9,7 +9,7 @@ import {ApiPromise, WsProvider, Keyring} from '@polkadot/api'; import {ApiInterfaceEvents} from '@polkadot/api/types'; import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; -import {IApiListeners, IBlock, IChainEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; +import {IApiListeners, IBlock, IChainEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; export const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => { const address = {} as ICrossAccountId; @@ -2029,21 +2029,54 @@ class StakingGroup extends HelperGroup { return 1; } + /** + * Get total staked amount for address + * @param address substrate or ethereum address + * @returns total staked amount + */ async getTotalStaked(address?: ICrossAccountId): Promise { if (address) return (await this.helper.callRpc('api.rpc.appPromotion.totalStaked', [address])).toBigInt(); return (await this.helper.callRpc('api.rpc.appPromotion.totalStaked')).toBigInt(); } - async getTotalStakedPerBlock(address: ICrossAccountId): Promise { - return (await this.helper.callRpc('api.rpc.appPromotion.totalStakedPerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]); + /** + * Get total staked per block + * @param address substrate or ethereum address + * @returns array of stakes. `block` – the number of the block in which the stake was made. `amount` - the number of tokens staked in the block + */ + async getTotalStakedPerBlock(address: ICrossAccountId): Promise { + const rawTotalStakerdPerBlock = await this.helper.callRpc('api.rpc.appPromotion.totalStakedPerBlock', [address]); + return rawTotalStakerdPerBlock.map(([block, amount]: any[]) => { + return { + block: block.toBigInt(), + amount: amount.toBigInt(), + }; + }); } + /** + * Get total pending unstake amount for address + * @param address substrate or ethereum address + * @returns total pending unstake amount + */ async getPendingUnstake(address: ICrossAccountId): Promise { return (await this.helper.callRpc('api.rpc.appPromotion.pendingUnstake', [address])).toBigInt(); } - async getPendingUnstakePerBlock(address: ICrossAccountId): Promise { - return (await this.helper.callRpc('api.rpc.appPromotion.pendingUnstakePerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]); + /** + * Get pending unstake amount per block for address + * @param address substrate or ethereum address + * @returns array of pending stakes. `block` – the number of the block in which the unstake was made. `amount` - the number of tokens unstaked in the block + */ + async getPendingUnstakePerBlock(address: ICrossAccountId): Promise { + const rawUnstakedPerBlock = await this.helper.callRpc('api.rpc.appPromotion.pendingUnstakePerBlock', [address]); + const result = rawUnstakedPerBlock.map(([block, amount]: any[]) => { + return { + block: block.toBigInt(), + amount: amount.toBigInt(), + }; + }); + return result; } } From 0c093d5c3f30a379f396d0a98881be71262e3c19 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Wed, 14 Sep 2022 19:39:51 +0000 Subject: [PATCH 0899/1274] use itSub --- tests/src/app-promotion.test.ts | 762 +++++++++++++++----------------- 1 file changed, 350 insertions(+), 412 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index d2d644d355..f080003f1f 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -23,7 +23,7 @@ import { import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {usingPlaygrounds} from './util/playgrounds'; +import {itSub, usingPlaygrounds} from './util/playgrounds'; import {encodeAddress} from '@polkadot/util-crypto'; import {stringToU8a} from '@polkadot/util'; @@ -59,78 +59,70 @@ describe('app-promotions.stake extrinsic', () => { await beforeEach(this); }); - it('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async () => { - await usingPlaygrounds(async (helper) => { - const [staker, recepient] = [accounts.pop()!, accounts.pop()!]; - const totalStakedBefore = await helper.staking.getTotalStaked(); + itSub('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async ({helper}) => { + const [staker, recepient] = [accounts.pop()!, accounts.pop()!]; + const totalStakedBefore = await helper.staking.getTotalStaked(); - // Minimum stake amount is 100: - await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.eventually.rejected; - await helper.staking.stake(staker, 100n * nominal); + // Minimum stake amount is 100: + await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.eventually.rejected; + await helper.staking.stake(staker, 100n * nominal); - // Staker balance is: miscFrozen: 100, feeFrozen: 100, reserved: 0n... - // ...so he can not transfer 900 - expect (await helper.balance.getSubstrateFull(staker.address)).to.contain({miscFrozen: 100n * nominal, feeFrozen: 100n * nominal, reserved: 0n}); - await expect(helper.balance.transferToSubstrate(staker, recepient.address, 900n * nominal)).to.be.rejected; - - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(100n * nominal); - expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); - // it is potentially flaky test. Promotion can credited some tokens. Maybe we need to use closeTo? - expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + 100n * nominal); // total tokens amount staked in app-promotion increased + // Staker balance is: miscFrozen: 100, feeFrozen: 100, reserved: 0n... + // ...so he can not transfer 900 + expect (await helper.balance.getSubstrateFull(staker.address)).to.contain({miscFrozen: 100n * nominal, feeFrozen: 100n * nominal, reserved: 0n}); + await expect(helper.balance.transferToSubstrate(staker, recepient.address, 900n * nominal)).to.be.rejected; + + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(100n * nominal); + expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); + // it is potentially flaky test. Promotion can credited some tokens. Maybe we need to use closeTo? + expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + 100n * nominal); // total tokens amount staked in app-promotion increased - - await helper.staking.stake(staker, 200n * nominal); - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(300n * nominal); - const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - expect(totalStakedPerBlock[0].amount).to.equal(100n * nominal); - expect(totalStakedPerBlock[1].amount).to.equal(200n * nominal); - }); + + await helper.staking.stake(staker, 200n * nominal); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(300n * nominal); + const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(totalStakedPerBlock[0].amount).to.equal(100n * nominal); + expect(totalStakedPerBlock[1].amount).to.equal(200n * nominal); }); - it('should allow to create maximum 10 stakes for account', async () => { - await usingPlaygrounds(async (helper) => { - const [staker] = await helper.arrange.createAccounts([2000n], alice); - for (let i = 0; i < 10; i++) { - await helper.staking.stake(staker, 100n * nominal); - } + itSub('should allow to create maximum 10 stakes for account', async ({helper}) => { + const [staker] = await helper.arrange.createAccounts([2000n], alice); + for (let i = 0; i < 10; i++) { + await helper.staking.stake(staker, 100n * nominal); + } - // can have 10 stakes - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(1000n * nominal); - expect(await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).to.have.length(10); + // can have 10 stakes + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(1000n * nominal); + expect(await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).to.have.length(10); - await expect(helper.staking.stake(staker, 100n * nominal)).to.be.rejected; + await expect(helper.staking.stake(staker, 100n * nominal)).to.be.rejected; - // After unstake can stake again - await helper.staking.unstake(staker); - await helper.staking.stake(staker, 100n * nominal); - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.equal(100n * nominal); - }); + // After unstake can stake again + await helper.staking.unstake(staker); + await helper.staking.stake(staker, 100n * nominal); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.equal(100n * nominal); }); - it('should reject transaction if stake amount is more than total free balance minus frozen', async () => { - await usingPlaygrounds(async helper => { - const staker = accounts.pop()!; + itSub('should reject transaction if stake amount is more than total free balance minus frozen', async ({helper}) => { + const staker = accounts.pop()!; - // Can't stake full balance because Alice needs to pay some fee - await expect(helper.staking.stake(staker, 1000n * nominal)).to.be.eventually.rejected; - await helper.staking.stake(staker, 500n * nominal); + // Can't stake full balance because Alice needs to pay some fee + await expect(helper.staking.stake(staker, 1000n * nominal)).to.be.eventually.rejected; + await helper.staking.stake(staker, 500n * nominal); - // Can't stake 500 tkn because Alice has Less than 500 transferable; - await expect(helper.staking.stake(staker, 500n * nominal)).to.be.eventually.rejected; - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(500n * nominal); - }); + // Can't stake 500 tkn because Alice has Less than 500 transferable; + await expect(helper.staking.stake(staker, 500n * nominal)).to.be.eventually.rejected; + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(500n * nominal); }); - it('for different accounts in one block is possible', async () => { - await usingPlaygrounds(async helper => { - const crowd = [accounts.pop()!, accounts.pop()!, accounts.pop()!, accounts.pop()!]; + itSub('for different accounts in one block is possible', async ({helper}) => { + const crowd = [accounts.pop()!, accounts.pop()!, accounts.pop()!, accounts.pop()!]; - const crowdStartsToStake = crowd.map(user => helper.staking.stake(user, 100n * nominal)); - await expect(Promise.all(crowdStartsToStake)).to.be.eventually.fulfilled; + const crowdStartsToStake = crowd.map(user => helper.staking.stake(user, 100n * nominal)); + await expect(Promise.all(crowdStartsToStake)).to.be.eventually.fulfilled; - const crowdStakes = await Promise.all(crowd.map(address => helper.staking.getTotalStaked({Substrate: address.address}))); - expect(crowdStakes).to.deep.equal([100n * nominal, 100n * nominal, 100n * nominal, 100n * nominal]); - }); + const crowdStakes = await Promise.all(crowd.map(address => helper.staking.getTotalStaked({Substrate: address.address}))); + expect(crowdStakes).to.deep.equal([100n * nominal, 100n * nominal, 100n * nominal, 100n * nominal]); }); }); @@ -139,122 +131,110 @@ describe('unstake balance extrinsic', () => { await beforeEach(this); }); - it('should change balance state from "frozen" to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => { - await usingPlaygrounds(async helper => { - const [staker, recepient] = [accounts.pop()!, accounts.pop()!]; - const totalStakedBefore = await helper.staking.getTotalStaked(); - await helper.staking.stake(staker, 900n * nominal); - await helper.staking.unstake(staker); - - // Right after unstake balance is reserved - // Staker can not transfer - expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 900n * nominal, miscFrozen: 0n, feeFrozen: 0n}); - await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejected; - expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(900n * nominal); - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); - expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore); - }); - }); - - it('should unlock balance after unlocking period ends and remove it from "pendingUnstake"', async () => { - await usingPlaygrounds(async (helper) => { - const staker = accounts.pop()!; - await helper.staking.stake(staker, 100n * nominal); - await helper.staking.unstake(staker); - const [pendingUnstake] = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); - - // Wait for unstaking period. Balance now free ~1000; reserved, frozen, miscFrozeb: 0n - await helper.wait.forParachainBlockNumber(pendingUnstake.block); - expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, miscFrozen: 0n, feeFrozen: 0n}); - expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); - - // staker can transfer: - await helper.balance.transferToSubstrate(staker, alice.address, 998n * nominal); - expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(1n); - }); - }); - - it('should successfully unstake multiple stakes', async () => { - await usingPlaygrounds(async helper => { - const staker = accounts.pop()!; - await helper.staking.stake(staker, 100n * nominal); - await helper.staking.stake(staker, 200n * nominal); - await helper.staking.stake(staker, 300n * nominal); - - // staked: [100, 200, 300]; unstaked: 0 - let totalPendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); - let pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); - let stakes = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - expect(totalPendingUnstake).to.be.deep.equal(0n); - expect(pendingUnstake).to.be.deep.equal([]); - expect(stakes[0].amount).to.equal(100n * nominal); - expect(stakes[1].amount).to.equal(200n * nominal); - expect(stakes[2].amount).to.equal(300n * nominal); + itSub('should change balance state from "frozen" to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async ({helper}) => { + const [staker, recepient] = [accounts.pop()!, accounts.pop()!]; + const totalStakedBefore = await helper.staking.getTotalStaked(); + await helper.staking.stake(staker, 900n * nominal); + await helper.staking.unstake(staker); + + // Right after unstake balance is reserved + // Staker can not transfer + expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 900n * nominal, miscFrozen: 0n, feeFrozen: 0n}); + await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejected; + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(900n * nominal); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); + expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore); + }); + + itSub('should unlock balance after unlocking period ends and remove it from "pendingUnstake"', async ({helper}) => { + const staker = accounts.pop()!; + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.unstake(staker); + const [pendingUnstake] = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); + + // Wait for unstaking period. Balance now free ~1000; reserved, frozen, miscFrozeb: 0n + await helper.wait.forParachainBlockNumber(pendingUnstake.block); + expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, miscFrozen: 0n, feeFrozen: 0n}); + expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); + + // staker can transfer: + await helper.balance.transferToSubstrate(staker, alice.address, 998n * nominal); + expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(1n); + }); + + itSub('should successfully unstake multiple stakes', async ({helper}) => { + const staker = accounts.pop()!; + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.stake(staker, 200n * nominal); + await helper.staking.stake(staker, 300n * nominal); + + // staked: [100, 200, 300]; unstaked: 0 + let totalPendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); + let pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); + let stakes = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(totalPendingUnstake).to.be.deep.equal(0n); + expect(pendingUnstake).to.be.deep.equal([]); + expect(stakes[0].amount).to.equal(100n * nominal); + expect(stakes[1].amount).to.equal(200n * nominal); + expect(stakes[2].amount).to.equal(300n * nominal); - // Can unstake multiple stakes - await helper.staking.unstake(staker); - pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); - totalPendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); - stakes = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - expect(totalPendingUnstake).to.be.equal(600n * nominal); - expect(stakes).to.be.deep.equal([]); - expect(pendingUnstake[0].amount).to.equal(600n * nominal); - - expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 600n * nominal, feeFrozen: 0n, miscFrozen: 0n}); - await helper.wait.forParachainBlockNumber(pendingUnstake[0].block); - expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 0n, miscFrozen: 0n}); - expect (await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); - }); - }); - - it('should not have any effects if no active stakes', async () => { - await usingPlaygrounds(async (helper) => { - const staker = accounts.pop()!; + // Can unstake multiple stakes + await helper.staking.unstake(staker); + pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); + totalPendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); + stakes = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(totalPendingUnstake).to.be.equal(600n * nominal); + expect(stakes).to.be.deep.equal([]); + expect(pendingUnstake[0].amount).to.equal(600n * nominal); + + expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 600n * nominal, feeFrozen: 0n, miscFrozen: 0n}); + await helper.wait.forParachainBlockNumber(pendingUnstake[0].block); + expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 0n, miscFrozen: 0n}); + expect (await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); + }); + + itSub('should not have any effects if no active stakes', async ({helper}) => { + const staker = accounts.pop()!; - // unstake has no effect if no stakes at all - await helper.staking.unstake(staker); - expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(0n); - expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); // TODO bigint closeTo helper + // unstake has no effect if no stakes at all + await helper.staking.unstake(staker); + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(0n); + expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); // TODO bigint closeTo helper - // TODO stake() unstake() waitUnstaked() unstake(); + // TODO stake() unstake() waitUnstaked() unstake(); - // can't unstake if there are only pendingUnstakes - await helper.staking.stake(staker, 100n * nominal); - await helper.staking.unstake(staker); - await helper.staking.unstake(staker); + // can't unstake if there are only pendingUnstakes + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.unstake(staker); + await helper.staking.unstake(staker); - expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal); - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); - }); + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); }); - it('should keep different unlocking block for each unlocking stake', async () => { - await usingPlaygrounds(async (helper) => { - const staker = accounts.pop()!; - await helper.staking.stake(staker, 100n * nominal); - await helper.staking.unstake(staker); - await helper.staking.stake(staker, 120n * nominal); - await helper.staking.unstake(staker); - - const unstakingPerBlock = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); - expect(unstakingPerBlock).has.length(2); - expect(unstakingPerBlock[0].amount).to.equal(100n * nominal); - expect(unstakingPerBlock[1].amount).to.equal(120n * nominal); - }); + itSub('should keep different unlocking block for each unlocking stake', async ({helper}) => { + const staker = accounts.pop()!; + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.unstake(staker); + await helper.staking.stake(staker, 120n * nominal); + await helper.staking.unstake(staker); + + const unstakingPerBlock = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); + expect(unstakingPerBlock).has.length(2); + expect(unstakingPerBlock[0].amount).to.equal(100n * nominal); + expect(unstakingPerBlock[1].amount).to.equal(120n * nominal); }); - it('should be possible for different accounts in one block', async () => { - await usingPlaygrounds(async (helper) => { - const stakers = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; + itSub('should be possible for different accounts in one block', async ({helper}) => { + const stakers = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; - await Promise.all(stakers.map(staker => helper.staking.stake(staker, 100n * nominal))); - await Promise.all(stakers.map(staker => helper.staking.unstake(staker))); + await Promise.all(stakers.map(staker => helper.staking.stake(staker, 100n * nominal))); + await Promise.all(stakers.map(staker => helper.staking.unstake(staker))); - await Promise.all(stakers.map(async (staker) => { - expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal); - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); - })); - }); + await Promise.all(stakers.map(async (staker) => { + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); + })); }); }); @@ -263,45 +243,39 @@ describe('Admin adress', () => { await beforeEach(this); }); - it('can be set by sudo only', async () => { - await usingPlaygrounds(async (helper) => { - const nonAdmin = accounts.pop()!; - // nonAdmin can not set admin not from himself nor as a sudo - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.eventually.rejected; - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.eventually.rejected; + itSub('can be set by sudo only', async ({helper}) => { + const nonAdmin = accounts.pop()!; + // nonAdmin can not set admin not from himself nor as a sudo + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.eventually.rejected; + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.eventually.rejected; - // Alice can - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled; - }); + // Alice can + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled; }); - it('can be any valid CrossAccountId', async () => { + itSub('can be any valid CrossAccountId', async ({helper}) => { // We are not going to set an eth address as a sponsor, // but we do want to check, it doesn't break anything; - await usingPlaygrounds(async (helper) => { - const account = accounts.pop()!; - const ethAccount = helper.address.substrateToEth(account.address); - // Alice sets Ethereum address as a sudo. Then Substrate address back... - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled; + const account = accounts.pop()!; + const ethAccount = helper.address.substrateToEth(account.address); + // Alice sets Ethereum address as a sudo. Then Substrate address back... + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled; - // ...It doesn't break anything; - const collection = await helper.nft.mintCollection(account, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(account, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; - }); + // ...It doesn't break anything; + const collection = await helper.nft.mintCollection(account, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + await expect(helper.signTransaction(account, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; }); - it('can be reassigned', async () => { - await usingPlaygrounds(async (helper) => { - const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + itSub('can be reassigned', async ({helper}) => { + const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(oldAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(oldAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; - await expect(helper.signTransaction(newAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; - }); + await expect(helper.signTransaction(newAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; }); }); @@ -314,99 +288,87 @@ describe('App-promotion collection sponsoring', () => { }); }); - it('should actually sponsor transactions', async () => { - await usingPlaygrounds(async (helper) => { - const [collectionOwner, tokenSender, receiver] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'Name', description: 'Description', tokenPrefix: 'Prefix', limits: {sponsorTransferTimeout: 0}}); - const token = await collection.mintToken(collectionOwner, {Substrate: tokenSender.address}); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId)); - const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress); - - await token.transfer(tokenSender, {Substrate: receiver.address}); - expect (await token.getOwner()).to.be.deep.equal({Substrate: receiver.address}); - const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress); - - // senders balance the same, transaction has sponsored - expect (await helper.balance.getSubstrate(tokenSender.address)).to.be.equal(1000n * nominal); - expect (palletBalanceBefore > palletBalanceAfter).to.be.true; - }); - }); + itSub('should actually sponsor transactions', async ({helper}) => { + const [collectionOwner, tokenSender, receiver] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'Name', description: 'Description', tokenPrefix: 'Prefix', limits: {sponsorTransferTimeout: 0}}); + const token = await collection.mintToken(collectionOwner, {Substrate: tokenSender.address}); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId)); + const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress); - it('can not be set by non admin', async () => { - await usingPlaygrounds(async (helper) => { - const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!]; + await token.transfer(tokenSender, {Substrate: receiver.address}); + expect (await token.getOwner()).to.be.deep.equal({Substrate: receiver.address}); + const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress); - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; - expect((await collection.getData())?.raw.sponsorship).to.equal('Disabled'); - }); + // senders balance the same, transaction has sponsored + expect (await helper.balance.getSubstrate(tokenSender.address)).to.be.equal(1000n * nominal); + expect (palletBalanceBefore > palletBalanceAfter).to.be.true; }); - it('should set pallet address as confirmed admin', async () => { - await usingPlaygrounds(async (helper) => { - const [collectionOwner, oldSponsor] = [accounts.pop()!, accounts.pop()!]; + itSub('can not be set by non admin', async ({helper}) => { + const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!]; + + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - // Can set sponsoring for collection without sponsor - const collectionWithoutSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'No-sponsor', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.eventually.fulfilled; - expect((await collectionWithoutSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); - - // Can set sponsoring for collection with unconfirmed sponsor - const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); - expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.eventually.fulfilled; - expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); - - // Can set sponsoring for collection with confirmed sponsor - const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); - await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.eventually.fulfilled; - expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); - }); + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; + expect((await collection.getData())?.raw.sponsorship).to.equal('Disabled'); }); - it('can be overwritten by collection owner', async () => { - await usingPlaygrounds(async (helper) => { - const [collectionOwner, newSponsor] = [accounts.pop()!, accounts.pop()!]; - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - const collectionId = collection.collectionId; + itSub('should set pallet address as confirmed admin', async ({helper}) => { + const [collectionOwner, oldSponsor] = [accounts.pop()!, accounts.pop()!]; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; + // Can set sponsoring for collection without sponsor + const collectionWithoutSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'No-sponsor', description: 'New Collection', tokenPrefix: 'Promotion'}); + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.eventually.fulfilled; + expect((await collectionWithoutSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); + + // Can set sponsoring for collection with unconfirmed sponsor + const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); + expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address}); + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.eventually.fulfilled; + expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); + + // Can set sponsoring for collection with confirmed sponsor + const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); + await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor); + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.eventually.fulfilled; + expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); + }); + + itSub('can be overwritten by collection owner', async ({helper}) => { + const [collectionOwner, newSponsor] = [accounts.pop()!, accounts.pop()!]; + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + const collectionId = collection.collectionId; - // Collection limits still can be changed by the owner - expect(await collection.setLimits(collectionOwner, {sponsorTransferTimeout: 0})).to.be.true; - expect((await collection.getData())?.raw.limits.sponsorTransferTimeout).to.be.equal(0); - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); - - // Collection sponsor can be changed too - expect((await collection.setSponsor(collectionOwner, newSponsor.address))).to.be.true; - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: newSponsor.address}); - }); + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; + + // Collection limits still can be changed by the owner + expect(await collection.setLimits(collectionOwner, {sponsorTransferTimeout: 0})).to.be.true; + expect((await collection.getData())?.raw.limits.sponsorTransferTimeout).to.be.equal(0); + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); + + // Collection sponsor can be changed too + expect((await collection.setSponsor(collectionOwner, newSponsor.address))).to.be.true; + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: newSponsor.address}); }); - it('should not overwrite collection limits set by the owner earlier', async () => { - await usingPlaygrounds(async (helper) => { - const limits = {ownerCanDestroy: true, ownerCanTransfer: true, sponsorTransferTimeout: 0}; - const collectionWithLimits = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits}); + itSub('should not overwrite collection limits set by the owner earlier', async ({helper}) => { + const limits = {ownerCanDestroy: true, ownerCanTransfer: true, sponsorTransferTimeout: 0}; + const collectionWithLimits = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.eventually.fulfilled; - expect((await collectionWithLimits.getData())?.raw.limits).to.be.deep.contain(limits); - }); + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.eventually.fulfilled; + expect((await collectionWithLimits.getData())?.raw.limits).to.be.deep.contain(limits); }); - it('should reject transaction if collection doesn\'t exist', async () => { - await usingPlaygrounds(async (helper) => { - const collectionOwner = accounts.pop()!; + itSub('should reject transaction if collection doesn\'t exist', async ({helper}) => { + const collectionOwner = accounts.pop()!; - // collection has never existed - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(999999999))).to.be.eventually.rejected; - // collection has been burned - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await collection.burn(collectionOwner); + // collection has never existed + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(999999999))).to.be.eventually.rejected; + // collection has been burned + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + await collection.burn(collectionOwner); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; - }); + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; }); }); @@ -415,58 +377,50 @@ describe('app-promotion stopSponsoringCollection', () => { await beforeEach(this); }); - it('can not be called by non-admin', async () => { - await usingPlaygrounds(async (helper) => { - const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!]; - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + itSub('can not be called by non-admin', async ({helper}) => { + const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!]; + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); - }); + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); }); - it('should set sponsoring as disabled', async () => { - await usingPlaygrounds(async (helper) => { - const [collectionOwner, recepient] = [accounts.pop()!, accounts.pop()!]; - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits: {sponsorTransferTimeout: 0}}); - const token = await collection.mintToken(collectionOwner, {Substrate: collectionOwner.address}); + itSub('should set sponsoring as disabled', async ({helper}) => { + const [collectionOwner, recepient] = [accounts.pop()!, accounts.pop()!]; + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits: {sponsorTransferTimeout: 0}}); + const token = await collection.mintToken(collectionOwner, {Substrate: collectionOwner.address}); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId)); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId)); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId)); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId)); - expect((await collection.getData())?.raw.sponsorship).to.be.equal('Disabled'); + expect((await collection.getData())?.raw.sponsorship).to.be.equal('Disabled'); - // Transactions are not sponsored anymore: - const ownerBalanceBefore = await helper.balance.getSubstrate(collectionOwner.address); - await token.transfer(collectionOwner, {Substrate: recepient.address}); - const ownerBalanceAfter = await helper.balance.getSubstrate(collectionOwner.address); - expect(ownerBalanceAfter < ownerBalanceBefore).to.be.equal(true); - }); + // Transactions are not sponsored anymore: + const ownerBalanceBefore = await helper.balance.getSubstrate(collectionOwner.address); + await token.transfer(collectionOwner, {Substrate: recepient.address}); + const ownerBalanceAfter = await helper.balance.getSubstrate(collectionOwner.address); + expect(ownerBalanceAfter < ownerBalanceBefore).to.be.equal(true); }); - it('should not affect collection which is not sponsored by pallete', async () => { - await usingPlaygrounds(async (helper) => { - const collectionOwner = accounts.pop()!; - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address}); - await collection.confirmSponsorship(collectionOwner); + itSub('should not affect collection which is not sponsored by pallete', async ({helper}) => { + const collectionOwner = accounts.pop()!; + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address}); + await collection.confirmSponsorship(collectionOwner); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: collectionOwner.address}); - }); + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: collectionOwner.address}); }); - it('should reject transaction if collection does not exist', async () => { - await usingPlaygrounds(async (helper) => { - const collectionOwner = accounts.pop()!; - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + itSub('should reject transaction if collection does not exist', async ({helper}) => { + const collectionOwner = accounts.pop()!; + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await collection.burn(collectionOwner); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(999999999))).to.be.eventually.rejected; - }); + await collection.burn(collectionOwner); + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(999999999))).to.be.eventually.rejected; }); }); @@ -657,143 +611,127 @@ describe('app-promotion rewards', () => { await beforeEach(this); }); - it('can not be called by non admin', async () => { - await usingPlaygrounds(async (helper) => { - const nonAdmin = accounts.pop()!; - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.payoutStakers(100))).to.be.rejected; - }); + itSub('can not be called by non admin', async ({helper}) => { + const nonAdmin = accounts.pop()!; + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.payoutStakers(100))).to.be.rejected; }); - it('should increase total staked', async () => { - await usingPlaygrounds(async (helper) => { - const staker = accounts.pop()!; - const totalStakedBefore = await helper.staking.getTotalStaked(); - await helper.staking.stake(staker, 100n * nominal); + itSub('should increase total staked', async ({helper}) => { + const staker = accounts.pop()!; + const totalStakedBefore = await helper.staking.getTotalStaked(); + await helper.staking.stake(staker, 100n * nominal); - // Wait for rewards and pay - const [stakedInBlock] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock.block)); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + // Wait for rewards and pay + const [stakedInBlock] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock.block)); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); - const totalStakedAfter = await helper.staking.getTotalStaked(); - expect(totalStakedAfter >= totalStakedBefore + calculateIncome(100n * nominal, 10n)).to.be.true; + const totalStakedAfter = await helper.staking.getTotalStaked(); + expect(totalStakedAfter >= totalStakedBefore + calculateIncome(100n * nominal, 10n)).to.be.true; - // staker can unstake - await helper.staking.unstake(staker); - expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedAfter - calculateIncome(100n * nominal, 10n)); - }); + // staker can unstake + await helper.staking.unstake(staker); + expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedAfter - calculateIncome(100n * nominal, 10n)); }); - it('should credit 0.05% for staking period', async () => { - await usingPlaygrounds(async helper => { - const staker = accounts.pop()!; + itSub('should credit 0.05% for staking period', async ({helper}) => { + const staker = accounts.pop()!; - await waitPromotionPeriodDoesntEnd(helper); + await waitPromotionPeriodDoesntEnd(helper); - await helper.staking.stake(staker, 100n * nominal); - await helper.staking.stake(staker, 200n * nominal); + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.stake(staker, 200n * nominal); - // wait rewards are available: - const [_, stake2] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake2.block)); + // wait rewards are available: + const [_, stake2] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake2.block)); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); - const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - expect(totalStakedPerBlock[0].amount).to.equal(calculateIncome(100n * nominal, 10n)); - expect(totalStakedPerBlock[1].amount).to.equal(calculateIncome(200n * nominal, 10n)); - }); + const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(totalStakedPerBlock[0].amount).to.equal(calculateIncome(100n * nominal, 10n)); + expect(totalStakedPerBlock[1].amount).to.equal(calculateIncome(200n * nominal, 10n)); }); - it('shoud be paid for more than one period if payments was missed', async () => { - await usingPlaygrounds(async (helper) => { - const staker = accounts.pop()!; + itSub('shoud be paid for more than one period if payments was missed', async ({helper}) => { + const staker = accounts.pop()!; - await helper.staking.stake(staker, 100n * nominal); - // wait for two rewards are available: - let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); + await helper.staking.stake(staker, 100n * nominal); + // wait for two rewards are available: + let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); - [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - const frozenBalanceShouldBe = calculateIncome(100n * nominal, 10n, 2); - expect(stake.amount).to.be.equal(frozenBalanceShouldBe); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + const frozenBalanceShouldBe = calculateIncome(100n * nominal, 10n, 2); + expect(stake.amount).to.be.equal(frozenBalanceShouldBe); - const stakerFullBalance = await helper.balance.getSubstrateFull(staker.address); + const stakerFullBalance = await helper.balance.getSubstrateFull(staker.address); - expect(stakerFullBalance).to.contain({reserved: 0n, feeFrozen: frozenBalanceShouldBe, miscFrozen: frozenBalanceShouldBe}); - }); + expect(stakerFullBalance).to.contain({reserved: 0n, feeFrozen: frozenBalanceShouldBe, miscFrozen: frozenBalanceShouldBe}); }); - it('should not be credited for unstaked (reserved) balance', async () => { - await usingPlaygrounds(async helper => { - // staker unstakes before rewards has been payed - const staker = accounts.pop()!; - await helper.staking.stake(staker, 100n * nominal); - const [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); - await helper.staking.unstake(staker); + itSub('should not be credited for unstaked (reserved) balance', async ({helper}) => { + // staker unstakes before rewards has been payed + const staker = accounts.pop()!; + await helper.staking.stake(staker, 100n * nominal); + const [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); + await helper.staking.unstake(staker); - // so he did not receive any rewards - const totalBalanceBefore = await helper.balance.getSubstrate(staker.address); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); - const totalBalanceAfter = await helper.balance.getSubstrate(staker.address); + // so he did not receive any rewards + const totalBalanceBefore = await helper.balance.getSubstrate(staker.address); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + const totalBalanceAfter = await helper.balance.getSubstrate(staker.address); - expect(totalBalanceBefore).to.be.equal(totalBalanceAfter); - }); + expect(totalBalanceBefore).to.be.equal(totalBalanceAfter); }); - it('should bring compound interest', async () => { - await usingPlaygrounds(async helper => { - const staker = accounts.pop()!; + itSub('should bring compound interest', async ({helper}) => { + const staker = accounts.pop()!; - await helper.staking.stake(staker, 100n * nominal); + await helper.staking.stake(staker, 100n * nominal); - let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block)); + let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block)); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); - [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n)); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n)); - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); - [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n, 2)); - }); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n, 2)); }); - it.skip('can be paid 1000 rewards in a time', async () => { + itSub.skip('can be paid 1000 rewards in a time', async ({helper}) => { // all other stakes should be unstaked - await usingPlaygrounds(async (helper) => { - const oneHundredStakers = await helper.arrange.createCrowd(100, 1050n, alice); - - // stakers stakes 10 times each - for (let i = 0; i < 10; i++) { - await Promise.all(oneHundredStakers.map(staker => helper.staking.stake(staker, 100n * nominal))); - } - await helper.wait.newBlocks(40); - const result = await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); - }); - }); - - it.skip('can handle 40.000 rewards', async () => { - await usingPlaygrounds(async (helper) => { - const [donor] = await helper.arrange.createAccounts([7_000_000n], alice); - const crowdStakes = async () => { - // each account in the crowd stakes 2 times - const crowd = await helper.arrange.createCrowd(500, 300n, donor); - await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal))); - await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal))); - // - }; - - for (let i = 0; i < 40; i++) { - await crowdStakes(); - } - - // TODO pay rewards for some period - }); + const oneHundredStakers = await helper.arrange.createCrowd(100, 1050n, alice); + + // stakers stakes 10 times each + for (let i = 0; i < 10; i++) { + await Promise.all(oneHundredStakers.map(staker => helper.staking.stake(staker, 100n * nominal))); + } + await helper.wait.newBlocks(40); + const result = await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + }); + + itSub.skip('can handle 40.000 rewards', async ({helper}) => { + const [donor] = await helper.arrange.createAccounts([7_000_000n], alice); + const crowdStakes = async () => { + // each account in the crowd stakes 2 times + const crowd = await helper.arrange.createCrowd(500, 300n, donor); + await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal))); + await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal))); + // + }; + + for (let i = 0; i < 40; i++) { + await crowdStakes(); + } + + // TODO pay rewards for some period }); }); From 7586abb798e7ee4810fa6da518d7e81227f43da8 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Thu, 15 Sep 2022 06:19:07 +0000 Subject: [PATCH 0900/1274] Use itEth --- tests/src/app-promotion.test.ts | 331 +++++++++---------- tests/src/eth/util/playgrounds/unique.dev.ts | 17 +- 2 files changed, 178 insertions(+), 170 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index f080003f1f..1459de846d 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -27,8 +27,9 @@ import {itSub, usingPlaygrounds} from './util/playgrounds'; import {encodeAddress} from '@polkadot/util-crypto'; import {stringToU8a} from '@polkadot/util'; -import {SponsoringMode, contractHelpers, createEthAccountWithBalance, deployFlipper, itWeb3, transferBalanceToEth} from './eth/util/helpers'; +import {SponsoringMode} from './eth/util/helpers'; import {DevUniqueHelper} from './util/playgrounds/unique.dev'; +import {itEth} from './eth/util/playgrounds'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -38,7 +39,7 @@ let nominal: bigint; const palletAddress = calculatePalleteAddress('appstake'); let accounts: IKeyringPair[] = []; const LOCKING_PERIOD = 20n; // 20 blocks of relay -const UNLOCKING_PERIOD = 10n; // 20 blocks of parachain +const UNLOCKING_PERIOD = 10n; // 10 blocks of parachain const rewardAvailableInBlock = (stakedInBlock: bigint) => (stakedInBlock - stakedInBlock % LOCKING_PERIOD) + (LOCKING_PERIOD * 2n); const beforeEach = async (context: Mocha.Context) => { @@ -64,13 +65,13 @@ describe('app-promotions.stake extrinsic', () => { const totalStakedBefore = await helper.staking.getTotalStaked(); // Minimum stake amount is 100: - await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.eventually.rejected; + await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.rejected; await helper.staking.stake(staker, 100n * nominal); // Staker balance is: miscFrozen: 100, feeFrozen: 100, reserved: 0n... // ...so he can not transfer 900 expect (await helper.balance.getSubstrateFull(staker.address)).to.contain({miscFrozen: 100n * nominal, feeFrozen: 100n * nominal, reserved: 0n}); - await expect(helper.balance.transferToSubstrate(staker, recepient.address, 900n * nominal)).to.be.rejected; + await expect(helper.balance.transferToSubstrate(staker, recepient.address, 900n * nominal)).to.be.rejectedWith('balances.LiquidityRestrictions'); expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(100n * nominal); expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); @@ -95,7 +96,7 @@ describe('app-promotions.stake extrinsic', () => { expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(1000n * nominal); expect(await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).to.have.length(10); - await expect(helper.staking.stake(staker, 100n * nominal)).to.be.rejected; + await expect(helper.staking.stake(staker, 100n * nominal)).to.be.rejectedWith('appPromotion.NoPermission'); // After unstake can stake again await helper.staking.unstake(staker); @@ -107,11 +108,11 @@ describe('app-promotions.stake extrinsic', () => { const staker = accounts.pop()!; // Can't stake full balance because Alice needs to pay some fee - await expect(helper.staking.stake(staker, 1000n * nominal)).to.be.eventually.rejected; + await expect(helper.staking.stake(staker, 1000n * nominal)).to.be.rejected; await helper.staking.stake(staker, 500n * nominal); // Can't stake 500 tkn because Alice has Less than 500 transferable; - await expect(helper.staking.stake(staker, 500n * nominal)).to.be.eventually.rejected; + await expect(helper.staking.stake(staker, 500n * nominal)).to.be.rejectedWith('balances.LiquidityRestrictions'); expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(500n * nominal); }); @@ -119,7 +120,7 @@ describe('app-promotions.stake extrinsic', () => { const crowd = [accounts.pop()!, accounts.pop()!, accounts.pop()!, accounts.pop()!]; const crowdStartsToStake = crowd.map(user => helper.staking.stake(user, 100n * nominal)); - await expect(Promise.all(crowdStartsToStake)).to.be.eventually.fulfilled; + await expect(Promise.all(crowdStartsToStake)).to.be.fulfilled; const crowdStakes = await Promise.all(crowd.map(address => helper.staking.getTotalStaked({Substrate: address.address}))); expect(crowdStakes).to.deep.equal([100n * nominal, 100n * nominal, 100n * nominal, 100n * nominal]); @@ -140,7 +141,7 @@ describe('unstake balance extrinsic', () => { // Right after unstake balance is reserved // Staker can not transfer expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 900n * nominal, miscFrozen: 0n, feeFrozen: 0n}); - await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejected; + await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejectedWith('balances.InsufficientBalance'); expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(900n * nominal); expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore); @@ -246,11 +247,11 @@ describe('Admin adress', () => { itSub('can be set by sudo only', async ({helper}) => { const nonAdmin = accounts.pop()!; // nonAdmin can not set admin not from himself nor as a sudo - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.eventually.rejected; - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.eventually.rejected; + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.rejected; + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.rejected; // Alice can - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; }); itSub('can be any valid CrossAccountId', async ({helper}) => { @@ -259,23 +260,23 @@ describe('Admin adress', () => { const account = accounts.pop()!; const ethAccount = helper.address.substrateToEth(account.address); // Alice sets Ethereum address as a sudo. Then Substrate address back... - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; // ...It doesn't break anything; const collection = await helper.nft.mintCollection(account, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(account, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(account, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; }); itSub('can be reassigned', async ({helper}) => { const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.eventually.fulfilled; - await expect(helper.signTransaction(oldAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.fulfilled; + await expect(helper.signTransaction(oldAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; - await expect(helper.signTransaction(newAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(newAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled; }); }); @@ -309,7 +310,7 @@ describe('App-promotion collection sponsoring', () => { const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; expect((await collection.getData())?.raw.sponsorship).to.equal('Disabled'); }); @@ -318,19 +319,19 @@ describe('App-promotion collection sponsoring', () => { // Can set sponsoring for collection without sponsor const collectionWithoutSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'No-sponsor', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.fulfilled; expect((await collectionWithoutSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); // Can set sponsoring for collection with unconfirmed sponsor const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.fulfilled; expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); // Can set sponsoring for collection with confirmed sponsor const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.fulfilled; expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); }); @@ -339,7 +340,7 @@ describe('App-promotion collection sponsoring', () => { const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); const collectionId = collection.collectionId; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionId))).to.be.fulfilled; // Collection limits still can be changed by the owner expect(await collection.setLimits(collectionOwner, {sponsorTransferTimeout: 0})).to.be.true; @@ -355,7 +356,7 @@ describe('App-promotion collection sponsoring', () => { const limits = {ownerCanDestroy: true, ownerCanTransfer: true, sponsorTransferTimeout: 0}; const collectionWithLimits = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.fulfilled; expect((await collectionWithLimits.getData())?.raw.limits).to.be.deep.contain(limits); }); @@ -363,12 +364,12 @@ describe('App-promotion collection sponsoring', () => { const collectionOwner = accounts.pop()!; // collection has never existed - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(999999999))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(999999999))).to.be.rejected; // collection has been burned const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await collection.burn(collectionOwner); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; }); }); @@ -381,9 +382,9 @@ describe('app-promotion stopSponsoringCollection', () => { const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled; - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected; expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); }); @@ -409,7 +410,7 @@ describe('app-promotion stopSponsoringCollection', () => { const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address}); await collection.confirmSponsorship(collectionOwner); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected; expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: collectionOwner.address}); }); @@ -419,8 +420,8 @@ describe('app-promotion stopSponsoringCollection', () => { const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await collection.burn(collectionOwner); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(999999999))).to.be.eventually.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected; + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(999999999))).to.be.rejected; }); }); @@ -429,122 +430,119 @@ describe('app-promotion contract sponsoring', () => { await beforeEach(this); }); - itWeb3('should set palletes address as a sponsor', async ({api, web3, privateKeyWrapper}) => { - await usingPlaygrounds(async (helper) => { - const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); - const flipper = await deployFlipper(web3, contractOwner); - const contractMethods = contractHelpers(web3, contractOwner); + itEth('should set palletes address as a sponsor', async ({helper}) => { + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); + const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); - await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address)); - - expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true; - expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); - expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ - confirmed: { - substrate: palletAddress, - }, - }); + await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address]); + + expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true; + expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); + expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + confirmed: { + substrate: palletAddress, + }, }); }); - itWeb3('should overwrite sponsoring mode and existed sponsor', async ({api, web3, privateKeyWrapper}) => { - await usingPlaygrounds(async (helper) => { - const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); - const flipper = await deployFlipper(web3, contractOwner); - const contractMethods = contractHelpers(web3, contractOwner); - - await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; - - // Contract is self sponsored - expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.be.deep.equal({ - confirmed: { - ethereum: flipper.options.address.toLowerCase(), - }, - }); - - // set promotion sponsoring - await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address)); - - // new sponsor is pallet address - expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true; - expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); - expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ - confirmed: { - substrate: palletAddress, - }, - }); - }); - }); + itEth('should overwrite sponsoring mode and existed sponsor', async ({helper}) => { + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); + const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); - itWeb3('can be overwritten by contract owner', async ({api, web3, privateKeyWrapper}) => { - await usingPlaygrounds(async (helper) => { - const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); - const flipper = await deployFlipper(web3, contractOwner); - const contractMethods = contractHelpers(web3, contractOwner); + await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled; - // contract sponsored by pallet - await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address)); + // Contract is self sponsored + expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.be.deep.equal({ + confirmed: { + ethereum: flipper.options.address.toLowerCase(), + }, + }); - // owner sets self sponsoring - await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; + // set promotion sponsoring + await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true); - expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true; - expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); - expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ - confirmed: { - ethereum: flipper.options.address.toLowerCase(), - }, - }); + // new sponsor is pallet address + expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true; + expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); + expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + confirmed: { + substrate: palletAddress, + }, }); }); - itWeb3('can not be set by non admin', async ({api, web3, privateKeyWrapper}) => { - await usingPlaygrounds(async (helper) => { - const nonAdmin = accounts.pop()!; - const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); - const flipper = await deployFlipper(web3, contractOwner); - const contractMethods = contractHelpers(web3, contractOwner); + itEth('can be overwritten by contract owner', async ({helper}) => { + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); + const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); - await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; + // contract sponsored by pallet + await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true); - // nonAdmin calls sponsorContract - await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address))).to.be.rejected; + // owner sets self sponsoring + await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; - // contract still self-sponsored - expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ - confirmed: { - ethereum: flipper.options.address.toLowerCase(), - }, - }); + expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true; + expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); + expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + confirmed: { + ethereum: flipper.options.address.toLowerCase(), + }, }); + }); + + itEth('can not be set by non admin', async ({helper}) => { + const nonAdmin = accounts.pop()!; + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); + const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); - itWeb3('should be rejected for non-contract address', async ({api, web3, privateKeyWrapper}) => { - await usingPlaygrounds(async (helper) => { + await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled; - }); + // nonAdmin calls sponsorContract + await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true)).to.be.rejectedWith('appPromotion.NoPermission'); + + // contract still self-sponsored + expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + confirmed: { + ethereum: flipper.options.address.toLowerCase(), + }, }); }); - itWeb3('should actually sponsor transactions', async ({api, web3, privateKeyWrapper}) => { - await usingPlaygrounds(async (helper) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); - const flipper = await deployFlipper(web3, contractOwner); - const contractHelper = contractHelpers(web3, contractOwner); - await contractHelper.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: contractOwner}); - await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); - await transferBalanceToEth(api, alice, flipper.options.address, 1000n); + itEth('should actually sponsor transactions', async ({helper}) => { + // Contract caller + const caller = await helper.eth.createAccountWithBalance(alice, 1000n); + const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress); + + // Deploy flipper + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); + const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); + + // Owner sets to sponsor every tx + await contractHelper.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: contractOwner}); + await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); + await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address, 1000n); // transferBalanceToEth(api, alice, flipper.options.address, 1000n); - await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address)); - await flipper.methods.flip().send({from: caller}); - expect(await flipper.methods.getValue().call()).to.be.true; + // Set promotion to the Flipper + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorContract(flipper.options.address)); - const callerBalance = await helper.balance.getEthereum(caller); - const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address); + // Caller calls Flipper + await flipper.methods.flip().send({from: caller}); + expect(await flipper.methods.getValue().call()).to.be.true; - expect(callerBalance).to.be.equal(1000n * nominal); - expect(1000n * nominal > contractBalanceAfter).to.be.true; - }); + // The contracts and caller balances have not changed + const callerBalance = await helper.balance.getEthereum(caller); + const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address); + expect(callerBalance).to.be.equal(1000n * nominal); + expect(1000n * nominal === contractBalanceAfter).to.be.true; + + // The pallet balance has decreased + const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress); + expect(palletBalanceAfter < palletBalanceBefore).to.be.true; }); }); @@ -553,56 +551,53 @@ describe('app-promotion stopSponsoringContract', () => { await beforeEach(this); }); - itWeb3('should remove pallet address from contract sponsors', async ({api, web3, privateKeyWrapper}) => { - await usingPlaygrounds(async (helper) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); - const flipper = await deployFlipper(web3, contractOwner); - await transferBalanceToEth(api, alice, flipper.options.address); - const contractHelper = contractHelpers(web3, contractOwner); - await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); - await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address)); - await helper.signTransaction(palletAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address)); - - expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.false; - expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); - expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ - disabled: null, - }); - - await flipper.methods.flip().send({from: caller}); - expect(await flipper.methods.getValue().call()).to.be.true; - - const callerBalance = await helper.balance.getEthereum(caller); - const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address); - - // caller payed for call - expect(1000n * nominal > callerBalance).to.be.true; - expect(contractBalanceAfter).to.be.equal(1000n * nominal); + itEth('should remove pallet address from contract sponsors', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(alice, 1000n); + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); + await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address); + const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); + + await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); + await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true); + await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address], true); + + expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.false; + expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); + expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + disabled: null, }); + + await flipper.methods.flip().send({from: caller}); + expect(await flipper.methods.getValue().call()).to.be.true; + + const callerBalance = await helper.balance.getEthereum(caller); + const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address); + + // caller payed for call + expect(1000n * nominal > callerBalance).to.be.true; + expect(contractBalanceAfter).to.be.equal(1000n * nominal); }); - itWeb3('can not be called by non-admin', async ({api, web3, privateKeyWrapper}) => { - await usingPlaygrounds(async (helper) => { - const nonAdmin = accounts.pop()!; - const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); - const flipper = await deployFlipper(web3, contractOwner); + itEth('can not be called by non-admin', async ({helper}) => { + const nonAdmin = accounts.pop()!; + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); - await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address)); - await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address))).to.be.rejected; - }); + await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address]); + const stopSponsoringResult = await helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address]); + expect(stopSponsoringResult.status).to.equal('Fail'); + expect(stopSponsoringResult.moduleError).to.equal('appPromotion.NoPermission'); }); - itWeb3('should not affect a contract which is not sponsored by pallete', async ({api, web3, privateKeyWrapper}) => { - await usingPlaygrounds(async (helper) => { - const nonAdmin = accounts.pop()!; - const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase(); - const flipper = await deployFlipper(web3, contractOwner); - const contractHelper = contractHelpers(web3, contractOwner); - await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; + itEth('should not affect a contract which is not sponsored by pallete', async ({helper}) => { + const nonAdmin = accounts.pop()!; + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); + const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); + await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled; - await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address))).to.be.rejected; - }); + await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address], true)).to.be.rejectedWith('appPromotion.NoPermission'); }); }); diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index 552c62d7c6..b4fcede617 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -198,8 +198,21 @@ class EthGroup extends EthGroupBase { } `); } -} - + + async deployFlipper(signer: string): Promise { + return await this.helper.ethContract.deployByCode(signer, 'Flipper', ` + contract Flipper { + bool value = false; + function flip() public { + value = !value; + } + function getValue() public view returns (bool) { + return value; + } + } + `); + } +} class EthAddressGroup extends EthGroupBase { extractCollectionId(address: string): number { From b75ceadca458670ab558ad6621e59e0f14668e18 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Thu, 15 Sep 2022 07:49:03 +0000 Subject: [PATCH 0901/1274] Add helper to get total payout --- tests/src/app-promotion.test.ts | 6 +++--- tests/src/util/playgrounds/unique.dev.ts | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 1459de846d..dfce7e89fd 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -619,11 +619,11 @@ describe('app-promotion rewards', () => { // Wait for rewards and pay const [stakedInBlock] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock.block)); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + // await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + const totalPayout = (await helper.sudo.payoutStakers(palletAdmin, 100)).reduce((prev, payout) => prev + payout.payout, 0n); const totalStakedAfter = await helper.staking.getTotalStaked(); - expect(totalStakedAfter >= totalStakedBefore + calculateIncome(100n * nominal, 10n)).to.be.true; - + expect(totalStakedAfter).to.equal(totalStakedBefore + (100n * nominal) + totalPayout); // staker can unstake await helper.staking.unstake(staker); expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedAfter - calculateIncome(100n * nominal, 10n)); diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 714a7e570d..c69e3f7993 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -60,11 +60,13 @@ export class DevUniqueHelper extends UniqueHelper { */ arrange: ArrangeGroup; wait: WaitGroup; + sudo: SudoGroup; constructor(logger: { log: (msg: any, level: any) => void, level: any }) { super(logger); this.arrange = new ArrangeGroup(this); this.wait = new WaitGroup(this); + this.sudo = new SudoGroup(this); } async connect(wsEndpoint: string, _listeners?: any): Promise { @@ -281,3 +283,22 @@ class WaitGroup { }); } } + +class SudoGroup { + helper: UniqueHelper; + + constructor(helper: UniqueHelper) { + this.helper = helper; + } + + async payoutStakers(signer: IKeyringPair, stakersToPayout: number) { + const payoutResult = await this.helper.executeExtrinsic(signer, 'api.tx.appPromotion.payoutStakers', [stakersToPayout], true); + return payoutResult.result.events.filter(e => e.event.method === 'StakingRecalculation').map(e => { + return { + staker: e.event.data[0].toString(), + stake: e.event.data[1].toBigInt(), + payout: e.event.data[2].toBigInt(), + }; + }); + } +} \ No newline at end of file From 464a23ef439ad99ca3b2ecefee8969baa7384be6 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 15 Sep 2022 14:58:02 +0700 Subject: [PATCH 0902/1274] add build additional build images for xcm --- .github/workflows/xcm-testnet-build.yml | 170 +++++++++++++++++++++--- .github/workflows/xcm-tests_v2.yml | 4 +- 2 files changed, 153 insertions(+), 21 deletions(-) diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml index ae49f10970..849a428a46 100644 --- a/.github/workflows/xcm-testnet-build.yml +++ b/.github/workflows/xcm-testnet-build.yml @@ -76,6 +76,156 @@ jobs: - name: Read .env file uses: xom9ikk/dotenv@v1.0.2 + - name: Log in to Docker Hub + uses: docker/login-action@v2.0.0 + with: + username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + + - name: Install jq + run: sudo apt install jq -y + + # - name: Get autorization token from DOCKERHUB + # run: | + # # aquire token + # TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + # export TOKEN=$TOKEN + + # Check POLKADOT version and build it if it doesn't exist in repository + - name: Generate ENV related extend Dockerfile file for POLKADOT + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-polkadot.j2 + output_file: .docker/Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + + - name: Check if the dockerhub repository contains the needed version POLKADOT + run: | + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export TOKEN=$TOKEN + + # Get TAGS from DOCKERHUB POLKADOT repository + POLKADOT_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadot/tags/?page_size=100 | jq -r '."results"[]["name"]') + # Show TAGS + echo "POLKADOT TAGS:" + echo $POLKADOT_TAGS + # Check correct version POLKADOT and build it if it doesn't exist in POLKADOT TAGS + if [[ ${POLKADOT_TAGS[*]} =~ (^|[[:space:]])"${{ env.POLKADOT_BUILD_BRANCH }}"($|[[:space:]]) ]]; then + echo "Repository has needed POLKADOT version"; + docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} + else + echo "Repository has not needed POLKADOT version, so build it"; + cd .docker/ && docker build --no-cache --file ./Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml --tag uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} . + echo "Push needed POLKADOT version to the repository"; + docker push uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} + fi + shell: bash + + # Check ACALA version and build it if it doesn't exist in repository + - name: Generate ENV related extend Dockerfile file for ACALA + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-acala.j2 + output_file: .docker/Dockerfile-acala.${{ matrix.acala_version }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + ACALA_BUILD_BRANCH=${{ matrix.acala_version }} + + - name: Check if the dockerhub repository contains the needed ACALA version + run: | + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export TOKEN=$TOKEN + + # Get TAGS from DOCKERHUB repository + ACALA_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-acala/tags/?page_size=100 | jq -r '."results"[]["name"]') + # Show TAGS + echo "ACALA TAGS:" + echo $ACALA_TAGS + # Check correct version ACALA and build it if it doesn't exist in ACALA TAGS + if [[ ${ACALA_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.acala_version }}"($|[[:space:]]) ]]; then + echo "Repository has needed ACALA version"; + docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }} + else + echo "Repository has not needed ACALA version, so build it"; + cd .docker/ && docker build --no-cache --file ./Dockerfile-acala.${{ matrix.acala_version }}.yml --tag uniquenetwork/builder-acala:${{ matrix.acala_version }} . + echo "Push needed ACALA version to the repository"; + docker push uniquenetwork/builder-acala:${{ matrix.acala_version }} + fi + shell: bash + + # Check MOONBEAM version and build it if it doesn't exist in repository + - name: Generate ENV related extend Dockerfile file for MOONBEAM + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-moonbeam.j2 + output_file: .docker/Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }} + + - name: Check if the dockerhub repository contains the needed MOONBEAM version + run: | + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export TOKEN=$TOKEN + + # Get TAGS from DOCKERHUB repository + MOONBEAM_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-moonbeam/tags/?page_size=100 | jq -r '."results"[]["name"]') + # Show TAGS + echo "MOONBEAM TAGS:" + echo $MOONBEAM_TAGS + # Check correct version MOONBEAM and build it if it doesn't exist in MOONBEAM TAGS + if [[ ${MOONBEAM_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.moonbeam_version }}"($|[[:space:]]) ]]; then + echo "Repository has needed MOONBEAM version"; + docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} + else + echo "Repository has not needed MOONBEAM version, so build it"; + cd .docker/ && docker build --no-cache --file ./Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml --tag uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} . + echo "Push needed MOONBEAM version to the repository"; + docker push uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} + fi + shell: bash + + + # Check CUMULUS version and build it if it doesn't exist in repository + - name: Generate ENV related extend Dockerfile file for CUMULUS + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-cumulus.j2 + output_file: .docker/Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }} + + - name: Check if the dockerhub repository contains the needed CUMULUS version + run: | + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export TOKEN=$TOKEN + + # Get TAGS from DOCKERHUB repository + CUMULUS_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-cumulus/tags/?page_size=100 | jq -r '."results"[]["name"]') + # Show TAGS + echo "CUMULUS TAGS:" + echo $CUMULUS_TAGS + # Check correct version CUMULUS and build it if it doesn't exist in CUMULUS TAGS + if [[ ${CUMULUS_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.cumulus_version }}"($|[[:space:]]) ]]; then + echo "Repository has needed CUMULUS version"; + docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} + else + echo "Repository has not needed CUMULUS version, so build it"; + cd .docker/ && docker build --no-cache --file ./Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml --tag uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} . + echo "Push needed CUMULUS version to the repository"; + docker push uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} + fi + shell: bash + + + # Build main image for XCM - name: Generate ENV related extend Dockerfile file uses: cuchi/jinja2-action@v1.2.0 with: @@ -107,24 +257,6 @@ jobs: find: '/' replace: '-' - - name: Log in to Docker Hub - uses: docker/login-action@v2.0.0 - with: - username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} - password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - - name: Pull acala docker image - run: docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }} - - - name: Pull moonbeam docker image - run: docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} - - - name: Pull cumulus docker image - run: docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} - - - name: Pull polkadot docker image - run: docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} - - name: Pull chainql docker image run: docker pull uniquenetwork/builder-chainql:latest @@ -147,5 +279,3 @@ jobs: docker builder prune -f docker system prune -f - - diff --git a/.github/workflows/xcm-tests_v2.yml b/.github/workflows/xcm-tests_v2.yml index 6f0b8d9f43..d9203fa58a 100644 --- a/.github/workflows/xcm-tests_v2.yml +++ b/.github/workflows/xcm-tests_v2.yml @@ -17,7 +17,7 @@ jobs: name: Prepare execution matrix -# needs: [xcm-testnet-build] + #needs: [xcm-testnet-build] runs-on: XL outputs: @@ -172,3 +172,5 @@ jobs: run: | docker system prune -a -f + + From 1a380aec13c296eb70b84a20c52f9ba686919f2d Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Thu, 15 Sep 2022 08:02:43 +0000 Subject: [PATCH 0903/1274] Add more checks for payouts --- tests/src/app-promotion.test.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index dfce7e89fd..2f643e8058 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -20,18 +20,12 @@ import { getModuleNames, Pallets, } from './util/helpers'; - -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; import {itSub, usingPlaygrounds} from './util/playgrounds'; - import {encodeAddress} from '@polkadot/util-crypto'; import {stringToU8a} from '@polkadot/util'; import {SponsoringMode} from './eth/util/helpers'; import {DevUniqueHelper} from './util/playgrounds/unique.dev'; -import {itEth} from './eth/util/playgrounds'; -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itEth, expect} from './eth/util/playgrounds'; let alice: IKeyringPair; let palletAdmin: IKeyringPair; @@ -619,7 +613,6 @@ describe('app-promotion rewards', () => { // Wait for rewards and pay const [stakedInBlock] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock.block)); - // await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); const totalPayout = (await helper.sudo.payoutStakers(palletAdmin, 100)).reduce((prev, payout) => prev + payout.payout, 0n); const totalStakedAfter = await helper.staking.getTotalStaked(); @@ -641,7 +634,8 @@ describe('app-promotion rewards', () => { const [_, stake2] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake2.block)); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + const payoutToStaker = (await helper.sudo.payoutStakers(palletAdmin, 100)).find((payout) => payout.staker === staker.address)?.payout; + expect(payoutToStaker + 300n * nominal).to.equal(calculateIncome(300n * nominal, 10n)); const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); expect(totalStakedPerBlock[0].amount).to.equal(calculateIncome(100n * nominal, 10n)); From 3cd4026bbce32c8e5d6b156e387cc591f78c4689 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 15 Sep 2022 15:37:20 +0700 Subject: [PATCH 0904/1274] merge files for workflow xcm in one --- .github/workflows/xcm-testnet-build.yml | 281 ----------------- .github/workflows/xcm-tests_v2.yml | 176 ----------- .github/workflows/xcm.yml | 394 +++++++++++++++++++++++- 3 files changed, 386 insertions(+), 465 deletions(-) delete mode 100644 .github/workflows/xcm-testnet-build.yml delete mode 100644 .github/workflows/xcm-tests_v2.yml diff --git a/.github/workflows/xcm-testnet-build.yml b/.github/workflows/xcm-testnet-build.yml deleted file mode 100644 index 849a428a46..0000000000 --- a/.github/workflows/xcm-testnet-build.yml +++ /dev/null @@ -1,281 +0,0 @@ -name: xcm-testnet-build - -# Controls when the action will run. -on: - workflow_call: - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -#Define Workflow variables -env: - REPO_URL: ${{ github.server_url }}/${{ github.repository }} - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - prepare-execution-marix: - - name: Prepare execution matrix - - runs-on: [XL] - outputs: - matrix: ${{ steps.create_matrix.outputs.matrix }} - - steps: - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Create Execution matrix - uses: fabiocaccamo/create-matrix-action@v2 - id: create_matrix - with: - matrix: | - network {opal}, runtime {opal}, features {opal-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.WESTMINT_BUILD_BRANCH }}} - network {quartz}, runtime {quartz}, features {quartz-runtime}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONRIVER_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINE_BUILD_BRANCH }}} - network {unique}, runtime {unique}, features {unique-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINT_BUILD_BRANCH }}} - - xcm-build: - - needs: prepare-execution-marix - # The type of runner that the job will run on - runs-on: [XL] - - timeout-minutes: 600 - - name: ${{ matrix.network }} - - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - - strategy: - matrix: - include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} - - steps: - - name: Skip if pull request is in Draft - if: github.event.pull_request.draft == true - run: exit 1 - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Log in to Docker Hub - uses: docker/login-action@v2.0.0 - with: - username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} - password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} - - - name: Install jq - run: sudo apt install jq -y - - # - name: Get autorization token from DOCKERHUB - # run: | - # # aquire token - # TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - # export TOKEN=$TOKEN - - # Check POLKADOT version and build it if it doesn't exist in repository - - name: Generate ENV related extend Dockerfile file for POLKADOT - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/Dockerfile-polkadot.j2 - output_file: .docker/Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} - - - name: Check if the dockerhub repository contains the needed version POLKADOT - run: | - # aquire token - TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export TOKEN=$TOKEN - - # Get TAGS from DOCKERHUB POLKADOT repository - POLKADOT_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadot/tags/?page_size=100 | jq -r '."results"[]["name"]') - # Show TAGS - echo "POLKADOT TAGS:" - echo $POLKADOT_TAGS - # Check correct version POLKADOT and build it if it doesn't exist in POLKADOT TAGS - if [[ ${POLKADOT_TAGS[*]} =~ (^|[[:space:]])"${{ env.POLKADOT_BUILD_BRANCH }}"($|[[:space:]]) ]]; then - echo "Repository has needed POLKADOT version"; - docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} - else - echo "Repository has not needed POLKADOT version, so build it"; - cd .docker/ && docker build --no-cache --file ./Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml --tag uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} . - echo "Push needed POLKADOT version to the repository"; - docker push uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} - fi - shell: bash - - # Check ACALA version and build it if it doesn't exist in repository - - name: Generate ENV related extend Dockerfile file for ACALA - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/Dockerfile-acala.j2 - output_file: .docker/Dockerfile-acala.${{ matrix.acala_version }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - ACALA_BUILD_BRANCH=${{ matrix.acala_version }} - - - name: Check if the dockerhub repository contains the needed ACALA version - run: | - # aquire token - TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export TOKEN=$TOKEN - - # Get TAGS from DOCKERHUB repository - ACALA_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-acala/tags/?page_size=100 | jq -r '."results"[]["name"]') - # Show TAGS - echo "ACALA TAGS:" - echo $ACALA_TAGS - # Check correct version ACALA and build it if it doesn't exist in ACALA TAGS - if [[ ${ACALA_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.acala_version }}"($|[[:space:]]) ]]; then - echo "Repository has needed ACALA version"; - docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }} - else - echo "Repository has not needed ACALA version, so build it"; - cd .docker/ && docker build --no-cache --file ./Dockerfile-acala.${{ matrix.acala_version }}.yml --tag uniquenetwork/builder-acala:${{ matrix.acala_version }} . - echo "Push needed ACALA version to the repository"; - docker push uniquenetwork/builder-acala:${{ matrix.acala_version }} - fi - shell: bash - - # Check MOONBEAM version and build it if it doesn't exist in repository - - name: Generate ENV related extend Dockerfile file for MOONBEAM - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/Dockerfile-moonbeam.j2 - output_file: .docker/Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }} - - - name: Check if the dockerhub repository contains the needed MOONBEAM version - run: | - # aquire token - TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export TOKEN=$TOKEN - - # Get TAGS from DOCKERHUB repository - MOONBEAM_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-moonbeam/tags/?page_size=100 | jq -r '."results"[]["name"]') - # Show TAGS - echo "MOONBEAM TAGS:" - echo $MOONBEAM_TAGS - # Check correct version MOONBEAM and build it if it doesn't exist in MOONBEAM TAGS - if [[ ${MOONBEAM_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.moonbeam_version }}"($|[[:space:]]) ]]; then - echo "Repository has needed MOONBEAM version"; - docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} - else - echo "Repository has not needed MOONBEAM version, so build it"; - cd .docker/ && docker build --no-cache --file ./Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml --tag uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} . - echo "Push needed MOONBEAM version to the repository"; - docker push uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} - fi - shell: bash - - - # Check CUMULUS version and build it if it doesn't exist in repository - - name: Generate ENV related extend Dockerfile file for CUMULUS - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/Dockerfile-cumulus.j2 - output_file: .docker/Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }} - - - name: Check if the dockerhub repository contains the needed CUMULUS version - run: | - # aquire token - TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) - export TOKEN=$TOKEN - - # Get TAGS from DOCKERHUB repository - CUMULUS_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-cumulus/tags/?page_size=100 | jq -r '."results"[]["name"]') - # Show TAGS - echo "CUMULUS TAGS:" - echo $CUMULUS_TAGS - # Check correct version CUMULUS and build it if it doesn't exist in CUMULUS TAGS - if [[ ${CUMULUS_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.cumulus_version }}"($|[[:space:]]) ]]; then - echo "Repository has needed CUMULUS version"; - docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} - else - echo "Repository has not needed CUMULUS version, so build it"; - cd .docker/ && docker build --no-cache --file ./Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml --tag uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} . - echo "Push needed CUMULUS version to the repository"; - docker push uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} - fi - shell: bash - - - # Build main image for XCM - - name: Generate ENV related extend Dockerfile file - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/Dockerfile-xcm.j2 - output_file: .docker/Dockerfile-xcm.${{ matrix.network }}.yml - variables: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - NETWORK=${{ matrix.network }} - POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} - POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} - FEATURE=${{ matrix.features }} - RUNTIME=${{ matrix.runtime }} - BRANCH=${{ github.head_ref }} - ACALA_BUILD_BRANCH=${{ matrix.acala_version }} - MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }} - CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }} - - - name: Show build Dockerfile - run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml - - - name: Show launch-config-xcm-${{ matrix.network }} configuration - run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json - - - name: Run find-and-replace to remove slashes from branch name - uses: mad9000/actions-find-and-replace-string@2 - id: branchname - with: - source: ${{ github.head_ref }} - find: '/' - replace: '-' - - - name: Pull chainql docker image - run: docker pull uniquenetwork/builder-chainql:latest - - - name: Build the stack - run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . - - - name: Push docker image version - run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} - - - name: Push docker image latest - run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest - - - name: Clean Workspace - if: always() - uses: AutoModality/action-clean@v1.1.0 - - - name: Remove builder cache - if: always() # run this step always - run: | - docker builder prune -f - docker system prune -f - diff --git a/.github/workflows/xcm-tests_v2.yml b/.github/workflows/xcm-tests_v2.yml deleted file mode 100644 index d9203fa58a..0000000000 --- a/.github/workflows/xcm-tests_v2.yml +++ /dev/null @@ -1,176 +0,0 @@ -name: xcm-tests - -# Controls when the action will run. -on: - # Allows you to run this workflow manually from the Actions tab - workflow_call: - -#Define Workflow variables -env: - REPO_URL: ${{ github.server_url }}/${{ github.repository }} - - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - prepare-execution-marix: - - name: Prepare execution matrix - - #needs: [xcm-testnet-build] - - runs-on: XL - outputs: - matrix: ${{ steps.create_matrix.outputs.matrix }} - - steps: - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Create Execution matrix - uses: fabiocaccamo/create-matrix-action@v2 - id: create_matrix - with: - matrix: | - network {opal}, runtime {opal}, features {opal-runtime}, runtest {testXcmOpal} - network {quartz}, runtime {quartz}, features {quartz-runtime}, runtest {testXcmQuartz} - network {unique}, runtime {unique}, features {unique-runtime}, runtest {testXcmUnique} - - xcm-tests: - needs: prepare-execution-marix - # The type of runner that the job will run on - runs-on: [XL] - - timeout-minutes: 600 - - name: ${{ matrix.network }} - - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - - strategy: - matrix: - include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} - - steps: - - name: Skip if pull request is in Draft - if: github.event.pull_request.draft == true - run: exit 1 - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Generate ENV related extend file for docker-compose - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/docker-compose.tmp-xcm-tests.j2 - output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml - variables: | - NETWORK=${{ matrix.network }} - - - name: Show build configuration - run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml - - - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Build the stack - run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300 - - # 🚀 POLKADOT LAUNCH COMPLETE 🚀 - - name: Check if docker logs consist messages related to testing of xcm tests - if: success() - run: | - counter=160 - function check_container_status { - docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local - } - function do_docker_logs { - docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1 - } - function is_started { - if [ "$(check_container_status)" == "true" ]; then - echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING"; - echo "Check Docker logs" - DOCKER_LOGS=$(do_docker_logs) - if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then - echo "🚀 POLKADOT LAUNCH COMPLETE 🚀" - return 0 - else - echo "Message not found in logs output, repeating..." - return 1 - fi - else - echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING" - echo "Halting all future checks" - exit 1 - fi - echo "something goes wrong" - exit 1 - } - while ! is_started; do - echo "Waiting for special message in log files " - sleep 30s - counter=$(( $counter - 1 )) - echo "Counter: $counter" - if [ "$counter" -gt "0" ]; then - continue - else - break - fi - done - echo "Halting script" - exit 0 - shell: bash - - - name: Run XCM tests - working-directory: tests - run: | - yarn install - yarn add mochawesome - node scripts/readyness.js - echo "Ready to start tests" - NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW} - - - name: XCM Test Report - uses: phoenix-actions/test-reporting@v8 - id: test-report - if: success() || failure() # run this step even if previous step failed - with: - name: XCM Tests ${{ matrix.network }} # Name of the check run which will be created - path: tests/mochawesome-report/test-*.json # Path to test results - reporter: mochawesome-json - fail-on-error: 'false' - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down - - - name: Clean Workspace - if: always() - uses: AutoModality/action-clean@v1.1.0 - - - name: Remove builder cache - if: always() # run this step always - run: | - docker system prune -a -f - - - diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index c662de8859..b330338f5d 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -1,19 +1,397 @@ -name: Nesting XCM +name: xcm-testnet-build +# Controls when the action will run. on: workflow_call: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: +#Define Workflow variables +env: + REPO_URL: ${{ github.server_url }}/${{ github.repository }} +# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - xcm-testnet-build: - name: testnet build - uses: ./.github/workflows/xcm-testnet-build.yml - secrets: inherit + prepare-execution-marix: + + name: Prepare execution matrix + + runs-on: [XL] + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: fabiocaccamo/create-matrix-action@v2 + id: create_matrix + with: + matrix: | + network {opal}, runtime {opal}, features {opal-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.WESTMINT_BUILD_BRANCH }}}, runtest {testXcmOpal} + network {quartz}, runtime {quartz}, features {quartz-runtime}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONRIVER_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINE_BUILD_BRANCH }}}, runtest {testXcmQuartz} + network {unique}, runtime {unique}, features {unique-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINT_BUILD_BRANCH }}}, runtest {testXcmUnique} + + xcm-build: + + needs: prepare-execution-marix + # The type of runner that the job will run on + runs-on: [XL] + + timeout-minutes: 600 + + name: ${{ matrix.network }} + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + + steps: + - name: Skip if pull request is in Draft + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Log in to Docker Hub + uses: docker/login-action@v2.0.0 + with: + username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + + - name: Install jq + run: sudo apt install jq -y + + # Check POLKADOT version and build it if it doesn't exist in repository + - name: Generate ENV related extend Dockerfile file for POLKADOT + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-polkadot.j2 + output_file: .docker/Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + + - name: Check if the dockerhub repository contains the needed version POLKADOT + run: | + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export TOKEN=$TOKEN + + # Get TAGS from DOCKERHUB POLKADOT repository + POLKADOT_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadot/tags/?page_size=100 | jq -r '."results"[]["name"]') + # Show TAGS + echo "POLKADOT TAGS:" + echo $POLKADOT_TAGS + # Check correct version POLKADOT and build it if it doesn't exist in POLKADOT TAGS + if [[ ${POLKADOT_TAGS[*]} =~ (^|[[:space:]])"${{ env.POLKADOT_BUILD_BRANCH }}"($|[[:space:]]) ]]; then + echo "Repository has needed POLKADOT version"; + docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} + else + echo "Repository has not needed POLKADOT version, so build it"; + cd .docker/ && docker build --no-cache --file ./Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml --tag uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} . + echo "Push needed POLKADOT version to the repository"; + docker push uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} + fi + shell: bash + + # Check ACALA version and build it if it doesn't exist in repository + - name: Generate ENV related extend Dockerfile file for ACALA + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-acala.j2 + output_file: .docker/Dockerfile-acala.${{ matrix.acala_version }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + ACALA_BUILD_BRANCH=${{ matrix.acala_version }} + + - name: Check if the dockerhub repository contains the needed ACALA version + run: | + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export TOKEN=$TOKEN + + # Get TAGS from DOCKERHUB repository + ACALA_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-acala/tags/?page_size=100 | jq -r '."results"[]["name"]') + # Show TAGS + echo "ACALA TAGS:" + echo $ACALA_TAGS + # Check correct version ACALA and build it if it doesn't exist in ACALA TAGS + if [[ ${ACALA_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.acala_version }}"($|[[:space:]]) ]]; then + echo "Repository has needed ACALA version"; + docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }} + else + echo "Repository has not needed ACALA version, so build it"; + cd .docker/ && docker build --no-cache --file ./Dockerfile-acala.${{ matrix.acala_version }}.yml --tag uniquenetwork/builder-acala:${{ matrix.acala_version }} . + echo "Push needed ACALA version to the repository"; + docker push uniquenetwork/builder-acala:${{ matrix.acala_version }} + fi + shell: bash + + # Check MOONBEAM version and build it if it doesn't exist in repository + - name: Generate ENV related extend Dockerfile file for MOONBEAM + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-moonbeam.j2 + output_file: .docker/Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }} + + - name: Check if the dockerhub repository contains the needed MOONBEAM version + run: | + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export TOKEN=$TOKEN + + # Get TAGS from DOCKERHUB repository + MOONBEAM_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-moonbeam/tags/?page_size=100 | jq -r '."results"[]["name"]') + # Show TAGS + echo "MOONBEAM TAGS:" + echo $MOONBEAM_TAGS + # Check correct version MOONBEAM and build it if it doesn't exist in MOONBEAM TAGS + if [[ ${MOONBEAM_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.moonbeam_version }}"($|[[:space:]]) ]]; then + echo "Repository has needed MOONBEAM version"; + docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} + else + echo "Repository has not needed MOONBEAM version, so build it"; + cd .docker/ && docker build --no-cache --file ./Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml --tag uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} . + echo "Push needed MOONBEAM version to the repository"; + docker push uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} + fi + shell: bash + + + # Check CUMULUS version and build it if it doesn't exist in repository + - name: Generate ENV related extend Dockerfile file for CUMULUS + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-cumulus.j2 + output_file: .docker/Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }} + + - name: Check if the dockerhub repository contains the needed CUMULUS version + run: | + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export TOKEN=$TOKEN + + # Get TAGS from DOCKERHUB repository + CUMULUS_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-cumulus/tags/?page_size=100 | jq -r '."results"[]["name"]') + # Show TAGS + echo "CUMULUS TAGS:" + echo $CUMULUS_TAGS + # Check correct version CUMULUS and build it if it doesn't exist in CUMULUS TAGS + if [[ ${CUMULUS_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.cumulus_version }}"($|[[:space:]]) ]]; then + echo "Repository has needed CUMULUS version"; + docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} + else + echo "Repository has not needed CUMULUS version, so build it"; + cd .docker/ && docker build --no-cache --file ./Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml --tag uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} . + echo "Push needed CUMULUS version to the repository"; + docker push uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} + fi + shell: bash + + + # Build main image for XCM + - name: Generate ENV related extend Dockerfile file + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-xcm.j2 + output_file: .docker/Dockerfile-xcm.${{ matrix.network }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + NETWORK=${{ matrix.network }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + BRANCH=${{ github.head_ref }} + ACALA_BUILD_BRANCH=${{ matrix.acala_version }} + MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }} + CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }} + + - name: Show build Dockerfile + run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml + + - name: Show launch-config-xcm-${{ matrix.network }} configuration + run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json + + - name: Run find-and-replace to remove slashes from branch name + uses: mad9000/actions-find-and-replace-string@2 + id: branchname + with: + source: ${{ github.head_ref }} + find: '/' + replace: '-' + + - name: Pull chainql docker image + run: docker pull uniquenetwork/builder-chainql:latest + + - name: Build the stack + run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest . + + - name: Push docker image version + run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} + + - name: Push docker image latest + run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f + docker system prune -f xcm-tests: - name: tests - needs: [ xcm-testnet-build ] - uses: ./.github/workflows/xcm-tests_v2.yml + needs: xcm-build + # The type of runner that the job will run on + runs-on: [XL] + + timeout-minutes: 600 + + name: ${{ matrix.network }} + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + + steps: + - name: Skip if pull request is in Draft + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-xcm-tests.j2 + output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml + variables: | + NETWORK=${{ matrix.network }} + + - name: Show build configuration + run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300 + + # 🚀 POLKADOT LAUNCH COMPLETE 🚀 + - name: Check if docker logs consist messages related to testing of xcm tests + if: success() + run: | + counter=160 + function check_container_status { + docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local + } + function do_docker_logs { + docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1 + } + function is_started { + if [ "$(check_container_status)" == "true" ]; then + echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING"; + echo "Check Docker logs" + DOCKER_LOGS=$(do_docker_logs) + if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then + echo "🚀 POLKADOT LAUNCH COMPLETE 🚀" + return 0 + else + echo "Message not found in logs output, repeating..." + return 1 + fi + else + echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING" + echo "Halting all future checks" + exit 1 + fi + echo "something goes wrong" + exit 1 + } + while ! is_started; do + echo "Waiting for special message in log files " + sleep 30s + counter=$(( $counter - 1 )) + echo "Counter: $counter" + if [ "$counter" -gt "0" ]; then + continue + else + break + fi + done + echo "Halting script" + exit 0 + shell: bash + + - name: Run XCM tests + working-directory: tests + run: | + yarn install + yarn add mochawesome + node scripts/readyness.js + echo "Ready to start tests" + NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW} + + - name: XCM Test Report + uses: phoenix-actions/test-reporting@v8 + id: test-report + if: success() || failure() # run this step even if previous step failed + with: + name: XCM Tests ${{ matrix.network }} # Name of the check run which will be created + path: tests/mochawesome-report/test-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down + - name: Clean Workspace + if: always() + uses: AutoModality/action-clean@v1.1.0 + - name: Remove builder cache + if: always() # run this step always + run: | + docker system prune -a -f From 343d804c01f9068b9280825d9c10861068f6e57b Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Thu, 15 Sep 2022 09:01:25 +0000 Subject: [PATCH 0905/1274] Fix: review --- tests/src/app-promotion.test.ts | 24 ++++++++++---------- tests/src/eth/util/playgrounds/unique.dev.ts | 3 +++ tests/src/util/playgrounds/unique.dev.ts | 8 +++---- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 2f643e8058..7733695dc4 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -414,8 +414,8 @@ describe('app-promotion stopSponsoringCollection', () => { const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await collection.burn(collectionOwner); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(999999999))).to.be.rejected; + await expect(helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringCollection', [collection.collectionId], true)).to.be.rejectedWith('common.CollectionNotFound'); + await expect(helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringCollection', [999_999_999], true)).to.be.rejectedWith('common.CollectionNotFound'); }); }); @@ -459,8 +459,8 @@ describe('app-promotion contract sponsoring', () => { // new sponsor is pallet address expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true; - expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); - expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner); + expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.deep.equal({ confirmed: { substrate: palletAddress, }, @@ -602,7 +602,7 @@ describe('app-promotion rewards', () => { itSub('can not be called by non admin', async ({helper}) => { const nonAdmin = accounts.pop()!; - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.payoutStakers(100))).to.be.rejected; + await expect(helper.admin.payoutStakers(nonAdmin, 100)).to.be.rejectedWith('appPromotion.NoPermission'); }); itSub('should increase total staked', async ({helper}) => { @@ -613,7 +613,7 @@ describe('app-promotion rewards', () => { // Wait for rewards and pay const [stakedInBlock] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock.block)); - const totalPayout = (await helper.sudo.payoutStakers(palletAdmin, 100)).reduce((prev, payout) => prev + payout.payout, 0n); + const totalPayout = (await helper.admin.payoutStakers(palletAdmin, 100)).reduce((prev, payout) => prev + payout.payout, 0n); const totalStakedAfter = await helper.staking.getTotalStaked(); expect(totalStakedAfter).to.equal(totalStakedBefore + (100n * nominal) + totalPayout); @@ -634,7 +634,7 @@ describe('app-promotion rewards', () => { const [_, stake2] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake2.block)); - const payoutToStaker = (await helper.sudo.payoutStakers(palletAdmin, 100)).find((payout) => payout.staker === staker.address)?.payout; + const payoutToStaker = (await helper.admin.payoutStakers(palletAdmin, 100)).find((payout) => payout.staker === staker.address)?.payout; expect(payoutToStaker + 300n * nominal).to.equal(calculateIncome(300n * nominal, 10n)); const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); @@ -650,7 +650,7 @@ describe('app-promotion rewards', () => { let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + await helper.admin.payoutStakers(palletAdmin, 100); [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); const frozenBalanceShouldBe = calculateIncome(100n * nominal, 10n, 2); expect(stake.amount).to.be.equal(frozenBalanceShouldBe); @@ -670,7 +670,7 @@ describe('app-promotion rewards', () => { // so he did not receive any rewards const totalBalanceBefore = await helper.balance.getSubstrate(staker.address); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + await helper.admin.payoutStakers(palletAdmin, 100); const totalBalanceAfter = await helper.balance.getSubstrate(staker.address); expect(totalBalanceBefore).to.be.equal(totalBalanceAfter); @@ -684,12 +684,12 @@ describe('app-promotion rewards', () => { let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block)); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + await helper.admin.payoutStakers(palletAdmin, 100); [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n)); await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + await helper.admin.payoutStakers(palletAdmin, 100); [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n, 2)); }); @@ -703,7 +703,7 @@ describe('app-promotion rewards', () => { await Promise.all(oneHundredStakers.map(staker => helper.staking.stake(staker, 100n * nominal))); } await helper.wait.newBlocks(40); - const result = await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100)); + await helper.admin.payoutStakers(palletAdmin, 100); }); itSub.skip('can handle 40.000 rewards', async ({helper}) => { diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index b4fcede617..097aaf7438 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -201,6 +201,9 @@ class EthGroup extends EthGroupBase { async deployFlipper(signer: string): Promise { return await this.helper.ethContract.deployByCode(signer, 'Flipper', ` + // SPDX-License-Identifier: UNLICENSED + pragma solidity ^0.8.6; + contract Flipper { bool value = false; function flip() public { diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index c69e3f7993..9e8bce1e21 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -60,13 +60,13 @@ export class DevUniqueHelper extends UniqueHelper { */ arrange: ArrangeGroup; wait: WaitGroup; - sudo: SudoGroup; + admin: AdminGroup; constructor(logger: { log: (msg: any, level: any) => void, level: any }) { super(logger); this.arrange = new ArrangeGroup(this); this.wait = new WaitGroup(this); - this.sudo = new SudoGroup(this); + this.admin = new AdminGroup(this); } async connect(wsEndpoint: string, _listeners?: any): Promise { @@ -284,7 +284,7 @@ class WaitGroup { } } -class SudoGroup { +class AdminGroup { helper: UniqueHelper; constructor(helper: UniqueHelper) { @@ -301,4 +301,4 @@ class SudoGroup { }; }); } -} \ No newline at end of file +} From 80f537761af91fa45bfe55f08d0ec1af4fe28df0 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 15 Sep 2022 16:23:02 +0700 Subject: [PATCH 0906/1274] fix needs for xcm --- .github/workflows/xcm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index b330338f5d..06f2945f9c 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -270,7 +270,7 @@ jobs: docker system prune -f xcm-tests: - needs: xcm-build + needs: [prepare-execution-marix, xcm-build] # The type of runner that the job will run on runs-on: [XL] From 71ddca25c9233f68e8653b611e1b3c470f67ab89 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 15 Sep 2022 18:18:25 +0700 Subject: [PATCH 0907/1274] fix polkadot-types for xcm --- .github/workflows/xcm.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index 06f2945f9c..e94899d6f4 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -369,6 +369,7 @@ jobs: run: | yarn install yarn add mochawesome + yarn polkadot-types node scripts/readyness.js echo "Ready to start tests" NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW} From 5fb293eff7dc39a889ffed109453ba5bdb317b0c Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Thu, 15 Sep 2022 13:13:40 +0000 Subject: [PATCH 0908/1274] Fix test: fix create accounts script for devnode - add waiter for create accounts script - wrap promotion tests in global describe to avoid accounts creation for each describe --- tests/src/app-promotion.test.ts | 1275 +++++++++++----------- tests/src/util/playgrounds/unique.dev.ts | 3 +- 2 files changed, 626 insertions(+), 652 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 7733695dc4..03bc71384a 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -36,691 +36,664 @@ const LOCKING_PERIOD = 20n; // 20 blocks of relay const UNLOCKING_PERIOD = 10n; // 10 blocks of parachain const rewardAvailableInBlock = (stakedInBlock: bigint) => (stakedInBlock - stakedInBlock % LOCKING_PERIOD) + (LOCKING_PERIOD * 2n); -const beforeEach = async (context: Mocha.Context) => { - await usingPlaygrounds(async (helper, privateKey) => { - if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) context.skip(); - alice = privateKey('//Alice'); - palletAdmin = privateKey('//Charlie'); // TODO use custom address - await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); - nominal = helper.balance.getOneTokenNominal(); - await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal); - await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal); - accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests - }); -}; - -describe('app-promotions.stake extrinsic', () => { +describe('App promotion', () => { before(async function () { - await beforeEach(this); + await usingPlaygrounds(async (helper, privateKey) => { + if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); + alice = privateKey('//Alice'); + palletAdmin = privateKey('//Charlie'); // TODO use custom address + await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); + nominal = helper.balance.getOneTokenNominal(); + await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal); + await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal); + accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests + }); }); - itSub('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async ({helper}) => { - const [staker, recepient] = [accounts.pop()!, accounts.pop()!]; - const totalStakedBefore = await helper.staking.getTotalStaked(); - - // Minimum stake amount is 100: - await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.rejected; - await helper.staking.stake(staker, 100n * nominal); - - // Staker balance is: miscFrozen: 100, feeFrozen: 100, reserved: 0n... - // ...so he can not transfer 900 - expect (await helper.balance.getSubstrateFull(staker.address)).to.contain({miscFrozen: 100n * nominal, feeFrozen: 100n * nominal, reserved: 0n}); - await expect(helper.balance.transferToSubstrate(staker, recepient.address, 900n * nominal)).to.be.rejectedWith('balances.LiquidityRestrictions'); + describe('stake extrinsic', () => { + itSub('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async ({helper}) => { + const [staker, recepient] = [accounts.pop()!, accounts.pop()!]; + const totalStakedBefore = await helper.staking.getTotalStaked(); + + // Minimum stake amount is 100: + await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.rejected; + await helper.staking.stake(staker, 100n * nominal); + + // Staker balance is: miscFrozen: 100, feeFrozen: 100, reserved: 0n... + // ...so he can not transfer 900 + expect (await helper.balance.getSubstrateFull(staker.address)).to.contain({miscFrozen: 100n * nominal, feeFrozen: 100n * nominal, reserved: 0n}); + await expect(helper.balance.transferToSubstrate(staker, recepient.address, 900n * nominal)).to.be.rejectedWith('balances.LiquidityRestrictions'); + + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(100n * nominal); + expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); + // it is potentially flaky test. Promotion can credited some tokens. Maybe we need to use closeTo? + expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + 100n * nominal); // total tokens amount staked in app-promotion increased + + + await helper.staking.stake(staker, 200n * nominal); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(300n * nominal); + const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(totalStakedPerBlock[0].amount).to.equal(100n * nominal); + expect(totalStakedPerBlock[1].amount).to.equal(200n * nominal); + }); + + itSub('should allow to create maximum 10 stakes for account', async ({helper}) => { + const [staker] = await helper.arrange.createAccounts([2000n], alice); + for (let i = 0; i < 10; i++) { + await helper.staking.stake(staker, 100n * nominal); + } + + // can have 10 stakes + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(1000n * nominal); + expect(await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).to.have.length(10); + + await expect(helper.staking.stake(staker, 100n * nominal)).to.be.rejectedWith('appPromotion.NoPermission'); + + // After unstake can stake again + await helper.staking.unstake(staker); + await helper.staking.stake(staker, 100n * nominal); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.equal(100n * nominal); + }); - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(100n * nominal); - expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); - // it is potentially flaky test. Promotion can credited some tokens. Maybe we need to use closeTo? - expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + 100n * nominal); // total tokens amount staked in app-promotion increased - + itSub('should reject transaction if stake amount is more than total free balance minus frozen', async ({helper}) => { + const staker = accounts.pop()!; + + // Can't stake full balance because Alice needs to pay some fee + await expect(helper.staking.stake(staker, 1000n * nominal)).to.be.rejected; + await helper.staking.stake(staker, 500n * nominal); + + // Can't stake 500 tkn because Alice has Less than 500 transferable; + await expect(helper.staking.stake(staker, 500n * nominal)).to.be.rejectedWith('balances.LiquidityRestrictions'); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(500n * nominal); + }); - await helper.staking.stake(staker, 200n * nominal); - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(300n * nominal); - const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - expect(totalStakedPerBlock[0].amount).to.equal(100n * nominal); - expect(totalStakedPerBlock[1].amount).to.equal(200n * nominal); + itSub('for different accounts in one block is possible', async ({helper}) => { + const crowd = [accounts.pop()!, accounts.pop()!, accounts.pop()!, accounts.pop()!]; + + const crowdStartsToStake = crowd.map(user => helper.staking.stake(user, 100n * nominal)); + await expect(Promise.all(crowdStartsToStake)).to.be.fulfilled; + + const crowdStakes = await Promise.all(crowd.map(address => helper.staking.getTotalStaked({Substrate: address.address}))); + expect(crowdStakes).to.deep.equal([100n * nominal, 100n * nominal, 100n * nominal, 100n * nominal]); + }); }); - - itSub('should allow to create maximum 10 stakes for account', async ({helper}) => { - const [staker] = await helper.arrange.createAccounts([2000n], alice); - for (let i = 0; i < 10; i++) { + + describe('unstake extrinsic', () => { + itSub('should change balance state from "frozen" to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async ({helper}) => { + const [staker, recepient] = [accounts.pop()!, accounts.pop()!]; + const totalStakedBefore = await helper.staking.getTotalStaked(); + await helper.staking.stake(staker, 900n * nominal); + await helper.staking.unstake(staker); + + // Right after unstake balance is reserved + // Staker can not transfer + expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 900n * nominal, miscFrozen: 0n, feeFrozen: 0n}); + await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejectedWith('balances.InsufficientBalance'); + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(900n * nominal); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); + expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore); + }); + + itSub('should unlock balance after unlocking period ends and remove it from "pendingUnstake"', async ({helper}) => { + const staker = accounts.pop()!; await helper.staking.stake(staker, 100n * nominal); - } - - // can have 10 stakes - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(1000n * nominal); - expect(await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).to.have.length(10); - - await expect(helper.staking.stake(staker, 100n * nominal)).to.be.rejectedWith('appPromotion.NoPermission'); - - // After unstake can stake again - await helper.staking.unstake(staker); - await helper.staking.stake(staker, 100n * nominal); - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.equal(100n * nominal); - }); + await helper.staking.unstake(staker); + const [pendingUnstake] = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); - itSub('should reject transaction if stake amount is more than total free balance minus frozen', async ({helper}) => { - const staker = accounts.pop()!; - - // Can't stake full balance because Alice needs to pay some fee - await expect(helper.staking.stake(staker, 1000n * nominal)).to.be.rejected; - await helper.staking.stake(staker, 500n * nominal); - - // Can't stake 500 tkn because Alice has Less than 500 transferable; - await expect(helper.staking.stake(staker, 500n * nominal)).to.be.rejectedWith('balances.LiquidityRestrictions'); - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(500n * nominal); - }); + // Wait for unstaking period. Balance now free ~1000; reserved, frozen, miscFrozeb: 0n + await helper.wait.forParachainBlockNumber(pendingUnstake.block); + expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, miscFrozen: 0n, feeFrozen: 0n}); + expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); + + // staker can transfer: + await helper.balance.transferToSubstrate(staker, alice.address, 998n * nominal); + expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(1n); + }); + + itSub('should successfully unstake multiple stakes', async ({helper}) => { + const staker = accounts.pop()!; + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.stake(staker, 200n * nominal); + await helper.staking.stake(staker, 300n * nominal); + + // staked: [100, 200, 300]; unstaked: 0 + let totalPendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); + let pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); + let stakes = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(totalPendingUnstake).to.be.deep.equal(0n); + expect(pendingUnstake).to.be.deep.equal([]); + expect(stakes[0].amount).to.equal(100n * nominal); + expect(stakes[1].amount).to.equal(200n * nominal); + expect(stakes[2].amount).to.equal(300n * nominal); + + // Can unstake multiple stakes + await helper.staking.unstake(staker); + pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); + totalPendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); + stakes = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(totalPendingUnstake).to.be.equal(600n * nominal); + expect(stakes).to.be.deep.equal([]); + expect(pendingUnstake[0].amount).to.equal(600n * nominal); + + expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 600n * nominal, feeFrozen: 0n, miscFrozen: 0n}); + await helper.wait.forParachainBlockNumber(pendingUnstake[0].block); + expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 0n, miscFrozen: 0n}); + expect (await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); + }); + + itSub('should not have any effects if no active stakes', async ({helper}) => { + const staker = accounts.pop()!; + + // unstake has no effect if no stakes at all + await helper.staking.unstake(staker); + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(0n); + expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); // TODO bigint closeTo helper + + // TODO stake() unstake() waitUnstaked() unstake(); + + // can't unstake if there are only pendingUnstakes + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.unstake(staker); + await helper.staking.unstake(staker); - itSub('for different accounts in one block is possible', async ({helper}) => { - const crowd = [accounts.pop()!, accounts.pop()!, accounts.pop()!, accounts.pop()!]; - - const crowdStartsToStake = crowd.map(user => helper.staking.stake(user, 100n * nominal)); - await expect(Promise.all(crowdStartsToStake)).to.be.fulfilled; - - const crowdStakes = await Promise.all(crowd.map(address => helper.staking.getTotalStaked({Substrate: address.address}))); - expect(crowdStakes).to.deep.equal([100n * nominal, 100n * nominal, 100n * nominal, 100n * nominal]); - }); -}); - -describe('unstake balance extrinsic', () => { - before(async function () { - await beforeEach(this); - }); - - itSub('should change balance state from "frozen" to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async ({helper}) => { - const [staker, recepient] = [accounts.pop()!, accounts.pop()!]; - const totalStakedBefore = await helper.staking.getTotalStaked(); - await helper.staking.stake(staker, 900n * nominal); - await helper.staking.unstake(staker); - - // Right after unstake balance is reserved - // Staker can not transfer - expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 900n * nominal, miscFrozen: 0n, feeFrozen: 0n}); - await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejectedWith('balances.InsufficientBalance'); - expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(900n * nominal); - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); - expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore); - }); - - itSub('should unlock balance after unlocking period ends and remove it from "pendingUnstake"', async ({helper}) => { - const staker = accounts.pop()!; - await helper.staking.stake(staker, 100n * nominal); - await helper.staking.unstake(staker); - const [pendingUnstake] = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); - - // Wait for unstaking period. Balance now free ~1000; reserved, frozen, miscFrozeb: 0n - await helper.wait.forParachainBlockNumber(pendingUnstake.block); - expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, miscFrozen: 0n, feeFrozen: 0n}); - expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); - - // staker can transfer: - await helper.balance.transferToSubstrate(staker, alice.address, 998n * nominal); - expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(1n); - }); - - itSub('should successfully unstake multiple stakes', async ({helper}) => { - const staker = accounts.pop()!; - await helper.staking.stake(staker, 100n * nominal); - await helper.staking.stake(staker, 200n * nominal); - await helper.staking.stake(staker, 300n * nominal); - - // staked: [100, 200, 300]; unstaked: 0 - let totalPendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); - let pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); - let stakes = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - expect(totalPendingUnstake).to.be.deep.equal(0n); - expect(pendingUnstake).to.be.deep.equal([]); - expect(stakes[0].amount).to.equal(100n * nominal); - expect(stakes[1].amount).to.equal(200n * nominal); - expect(stakes[2].amount).to.equal(300n * nominal); - - // Can unstake multiple stakes - await helper.staking.unstake(staker); - pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); - totalPendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address}); - stakes = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - expect(totalPendingUnstake).to.be.equal(600n * nominal); - expect(stakes).to.be.deep.equal([]); - expect(pendingUnstake[0].amount).to.equal(600n * nominal); - - expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 600n * nominal, feeFrozen: 0n, miscFrozen: 0n}); - await helper.wait.forParachainBlockNumber(pendingUnstake[0].block); - expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 0n, miscFrozen: 0n}); - expect (await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); - }); - - itSub('should not have any effects if no active stakes', async ({helper}) => { - const staker = accounts.pop()!; - - // unstake has no effect if no stakes at all - await helper.staking.unstake(staker); - expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(0n); - expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); // TODO bigint closeTo helper - - // TODO stake() unstake() waitUnstaked() unstake(); - - // can't unstake if there are only pendingUnstakes - await helper.staking.stake(staker, 100n * nominal); - await helper.staking.unstake(staker); - await helper.staking.unstake(staker); - - expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal); - expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); - }); - - itSub('should keep different unlocking block for each unlocking stake', async ({helper}) => { - const staker = accounts.pop()!; - await helper.staking.stake(staker, 100n * nominal); - await helper.staking.unstake(staker); - await helper.staking.stake(staker, 120n * nominal); - await helper.staking.unstake(staker); - - const unstakingPerBlock = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); - expect(unstakingPerBlock).has.length(2); - expect(unstakingPerBlock[0].amount).to.equal(100n * nominal); - expect(unstakingPerBlock[1].amount).to.equal(120n * nominal); - }); - - itSub('should be possible for different accounts in one block', async ({helper}) => { - const stakers = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; - - await Promise.all(stakers.map(staker => helper.staking.stake(staker, 100n * nominal))); - await Promise.all(stakers.map(staker => helper.staking.unstake(staker))); - - await Promise.all(stakers.map(async (staker) => { expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal); expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); - })); - }); -}); - -describe('Admin adress', () => { - before(async function () { - await beforeEach(this); - }); - - itSub('can be set by sudo only', async ({helper}) => { - const nonAdmin = accounts.pop()!; - // nonAdmin can not set admin not from himself nor as a sudo - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.rejected; - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.rejected; - - // Alice can - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; - }); + }); - itSub('can be any valid CrossAccountId', async ({helper}) => { - // We are not going to set an eth address as a sponsor, - // but we do want to check, it doesn't break anything; - const account = accounts.pop()!; - const ethAccount = helper.address.substrateToEth(account.address); - // Alice sets Ethereum address as a sudo. Then Substrate address back... - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.fulfilled; - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; - - // ...It doesn't break anything; - const collection = await helper.nft.mintCollection(account, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(account, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; - }); - - itSub('can be reassigned', async ({helper}) => { - const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.fulfilled; - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.fulfilled; - await expect(helper.signTransaction(oldAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; - - await expect(helper.signTransaction(newAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled; - }); -}); - -describe('App-promotion collection sponsoring', () => { - before(async function () { - await beforeEach(this); - await usingPlaygrounds(async (helper) => { - const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})); - await helper.signTransaction(alice, tx); + itSub('should keep different unlocking block for each unlocking stake', async ({helper}) => { + const staker = accounts.pop()!; + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.unstake(staker); + await helper.staking.stake(staker, 120n * nominal); + await helper.staking.unstake(staker); + + const unstakingPerBlock = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}); + expect(unstakingPerBlock).has.length(2); + expect(unstakingPerBlock[0].amount).to.equal(100n * nominal); + expect(unstakingPerBlock[1].amount).to.equal(120n * nominal); }); - }); - - itSub('should actually sponsor transactions', async ({helper}) => { - const [collectionOwner, tokenSender, receiver] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'Name', description: 'Description', tokenPrefix: 'Prefix', limits: {sponsorTransferTimeout: 0}}); - const token = await collection.mintToken(collectionOwner, {Substrate: tokenSender.address}); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId)); - const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress); - - await token.transfer(tokenSender, {Substrate: receiver.address}); - expect (await token.getOwner()).to.be.deep.equal({Substrate: receiver.address}); - const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress); - - // senders balance the same, transaction has sponsored - expect (await helper.balance.getSubstrate(tokenSender.address)).to.be.equal(1000n * nominal); - expect (palletBalanceBefore > palletBalanceAfter).to.be.true; - }); - - itSub('can not be set by non admin', async ({helper}) => { - const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!]; - - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; - expect((await collection.getData())?.raw.sponsorship).to.equal('Disabled'); - }); - - itSub('should set pallet address as confirmed admin', async ({helper}) => { - const [collectionOwner, oldSponsor] = [accounts.pop()!, accounts.pop()!]; - - // Can set sponsoring for collection without sponsor - const collectionWithoutSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'No-sponsor', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.fulfilled; - expect((await collectionWithoutSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); - - // Can set sponsoring for collection with unconfirmed sponsor - const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); - expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.fulfilled; - expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); - - // Can set sponsoring for collection with confirmed sponsor - const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); - await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.fulfilled; - expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); - }); - - itSub('can be overwritten by collection owner', async ({helper}) => { - const [collectionOwner, newSponsor] = [accounts.pop()!, accounts.pop()!]; - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - const collectionId = collection.collectionId; - - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionId))).to.be.fulfilled; - - // Collection limits still can be changed by the owner - expect(await collection.setLimits(collectionOwner, {sponsorTransferTimeout: 0})).to.be.true; - expect((await collection.getData())?.raw.limits.sponsorTransferTimeout).to.be.equal(0); - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); - - // Collection sponsor can be changed too - expect((await collection.setSponsor(collectionOwner, newSponsor.address))).to.be.true; - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: newSponsor.address}); - }); - itSub('should not overwrite collection limits set by the owner earlier', async ({helper}) => { - const limits = {ownerCanDestroy: true, ownerCanTransfer: true, sponsorTransferTimeout: 0}; - const collectionWithLimits = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits}); - - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.fulfilled; - expect((await collectionWithLimits.getData())?.raw.limits).to.be.deep.contain(limits); - }); + itSub('should be possible for different accounts in one block', async ({helper}) => { + const stakers = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; - itSub('should reject transaction if collection doesn\'t exist', async ({helper}) => { - const collectionOwner = accounts.pop()!; - - // collection has never existed - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(999999999))).to.be.rejected; - // collection has been burned - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await collection.burn(collectionOwner); - - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; - }); -}); - -describe('app-promotion stopSponsoringCollection', () => { - before(async function () { - await beforeEach(this); - }); - - itSub('can not be called by non-admin', async ({helper}) => { - const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!]; - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled; - - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected; - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); - }); - - itSub('should set sponsoring as disabled', async ({helper}) => { - const [collectionOwner, recepient] = [accounts.pop()!, accounts.pop()!]; - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits: {sponsorTransferTimeout: 0}}); - const token = await collection.mintToken(collectionOwner, {Substrate: collectionOwner.address}); - - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId)); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId)); - - expect((await collection.getData())?.raw.sponsorship).to.be.equal('Disabled'); - - // Transactions are not sponsored anymore: - const ownerBalanceBefore = await helper.balance.getSubstrate(collectionOwner.address); - await token.transfer(collectionOwner, {Substrate: recepient.address}); - const ownerBalanceAfter = await helper.balance.getSubstrate(collectionOwner.address); - expect(ownerBalanceAfter < ownerBalanceBefore).to.be.equal(true); - }); - - itSub('should not affect collection which is not sponsored by pallete', async ({helper}) => { - const collectionOwner = accounts.pop()!; - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address}); - await collection.confirmSponsorship(collectionOwner); - - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected; - - expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: collectionOwner.address}); - }); - - itSub('should reject transaction if collection does not exist', async ({helper}) => { - const collectionOwner = accounts.pop()!; - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - - await collection.burn(collectionOwner); - await expect(helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringCollection', [collection.collectionId], true)).to.be.rejectedWith('common.CollectionNotFound'); - await expect(helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringCollection', [999_999_999], true)).to.be.rejectedWith('common.CollectionNotFound'); - }); -}); - -describe('app-promotion contract sponsoring', () => { - before(async function () { - await beforeEach(this); + await Promise.all(stakers.map(staker => helper.staking.stake(staker, 100n * nominal))); + await Promise.all(stakers.map(staker => helper.staking.unstake(staker))); + + await Promise.all(stakers.map(async (staker) => { + expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal); + expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n); + })); + }); }); - - itEth('should set palletes address as a sponsor', async ({helper}) => { - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); - const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); - const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); - - await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address]); + + describe('admin adress', () => { + itSub('can be set by sudo only', async ({helper}) => { + const nonAdmin = accounts.pop()!; + // nonAdmin can not set admin not from himself nor as a sudo + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.rejected; + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.rejected; + + // Alice can + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; + }); - expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true; - expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); - expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ - confirmed: { - substrate: palletAddress, - }, + itSub('can be any valid CrossAccountId', async ({helper}) => { + // We are not going to set an eth address as a sponsor, + // but we do want to check, it doesn't break anything; + const account = accounts.pop()!; + const ethAccount = helper.address.substrateToEth(account.address); + // Alice sets Ethereum address as a sudo. Then Substrate address back... + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; + + // ...It doesn't break anything; + const collection = await helper.nft.mintCollection(account, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + await expect(helper.signTransaction(account, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; + }); + + itSub('can be reassigned', async ({helper}) => { + const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.fulfilled; + await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.fulfilled; + await expect(helper.signTransaction(oldAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; + + await expect(helper.signTransaction(newAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled; }); }); - - itEth('should overwrite sponsoring mode and existed sponsor', async ({helper}) => { - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); - const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); - const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); - - await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled; - - // Contract is self sponsored - expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.be.deep.equal({ - confirmed: { - ethereum: flipper.options.address.toLowerCase(), - }, + + describe('collection sponsoring', () => { + before(async function () { + await usingPlaygrounds(async (helper) => { + const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})); + await helper.signTransaction(alice, tx); + }); }); - - // set promotion sponsoring - await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true); - - // new sponsor is pallet address - expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true; - expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner); - expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.deep.equal({ - confirmed: { - substrate: palletAddress, - }, + + itSub('should actually sponsor transactions', async ({helper}) => { + const [collectionOwner, tokenSender, receiver] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'Name', description: 'Description', tokenPrefix: 'Prefix', limits: {sponsorTransferTimeout: 0}}); + const token = await collection.mintToken(collectionOwner, {Substrate: tokenSender.address}); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId)); + const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress); + + await token.transfer(tokenSender, {Substrate: receiver.address}); + expect (await token.getOwner()).to.be.deep.equal({Substrate: receiver.address}); + const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress); + + // senders balance the same, transaction has sponsored + expect (await helper.balance.getSubstrate(tokenSender.address)).to.be.equal(1000n * nominal); + expect (palletBalanceBefore > palletBalanceAfter).to.be.true; }); - }); - - itEth('can be overwritten by contract owner', async ({helper}) => { - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); - const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); - const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); - - // contract sponsored by pallet - await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true); - - // owner sets self sponsoring - await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; - - expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true; - expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); - expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ - confirmed: { - ethereum: flipper.options.address.toLowerCase(), - }, + + itSub('can not be set by non admin', async ({helper}) => { + const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!]; + + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; + expect((await collection.getData())?.raw.sponsorship).to.equal('Disabled'); }); - }); - - itEth('can not be set by non admin', async ({helper}) => { - const nonAdmin = accounts.pop()!; - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); - const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); - const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); - - await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled; - - // nonAdmin calls sponsorContract - await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true)).to.be.rejectedWith('appPromotion.NoPermission'); - - // contract still self-sponsored - expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ - confirmed: { - ethereum: flipper.options.address.toLowerCase(), - }, + + itSub('should set pallet address as confirmed admin', async ({helper}) => { + const [collectionOwner, oldSponsor] = [accounts.pop()!, accounts.pop()!]; + + // Can set sponsoring for collection without sponsor + const collectionWithoutSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'No-sponsor', description: 'New Collection', tokenPrefix: 'Promotion'}); + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.fulfilled; + expect((await collectionWithoutSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); + + // Can set sponsoring for collection with unconfirmed sponsor + const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); + expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address}); + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.fulfilled; + expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); + + // Can set sponsoring for collection with confirmed sponsor + const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); + await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor); + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.fulfilled; + expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); }); - }); - - itEth('should actually sponsor transactions', async ({helper}) => { - // Contract caller - const caller = await helper.eth.createAccountWithBalance(alice, 1000n); - const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress); + + itSub('can be overwritten by collection owner', async ({helper}) => { + const [collectionOwner, newSponsor] = [accounts.pop()!, accounts.pop()!]; + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + const collectionId = collection.collectionId; + + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionId))).to.be.fulfilled; - // Deploy flipper - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); - const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); - const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); + // Collection limits still can be changed by the owner + expect(await collection.setLimits(collectionOwner, {sponsorTransferTimeout: 0})).to.be.true; + expect((await collection.getData())?.raw.limits.sponsorTransferTimeout).to.be.equal(0); + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); + + // Collection sponsor can be changed too + expect((await collection.setSponsor(collectionOwner, newSponsor.address))).to.be.true; + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: newSponsor.address}); + }); - // Owner sets to sponsor every tx - await contractHelper.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: contractOwner}); - await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); - await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address, 1000n); // transferBalanceToEth(api, alice, flipper.options.address, 1000n); - - // Set promotion to the Flipper - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorContract(flipper.options.address)); - - // Caller calls Flipper - await flipper.methods.flip().send({from: caller}); - expect(await flipper.methods.getValue().call()).to.be.true; - - // The contracts and caller balances have not changed - const callerBalance = await helper.balance.getEthereum(caller); - const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address); - expect(callerBalance).to.be.equal(1000n * nominal); - expect(1000n * nominal === contractBalanceAfter).to.be.true; - - // The pallet balance has decreased - const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress); - expect(palletBalanceAfter < palletBalanceBefore).to.be.true; - }); -}); - -describe('app-promotion stopSponsoringContract', () => { - before(async function () { - await beforeEach(this); - }); - - itEth('should remove pallet address from contract sponsors', async ({helper}) => { - const caller = await helper.eth.createAccountWithBalance(alice, 1000n); - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); - const flipper = await helper.eth.deployFlipper(contractOwner); - await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address); - const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); - - await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); - await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true); - await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address], true); - - expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.false; - expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); - expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ - disabled: null, + itSub('should not overwrite collection limits set by the owner earlier', async ({helper}) => { + const limits = {ownerCanDestroy: true, ownerCanTransfer: true, sponsorTransferTimeout: 0}; + const collectionWithLimits = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits}); + + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.fulfilled; + expect((await collectionWithLimits.getData())?.raw.limits).to.be.deep.contain(limits); + }); + + itSub('should reject transaction if collection doesn\'t exist', async ({helper}) => { + const collectionOwner = accounts.pop()!; + + // collection has never existed + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(999999999))).to.be.rejected; + // collection has been burned + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + await collection.burn(collectionOwner); + + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; }); - - await flipper.methods.flip().send({from: caller}); - expect(await flipper.methods.getValue().call()).to.be.true; - - const callerBalance = await helper.balance.getEthereum(caller); - const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address); - - // caller payed for call - expect(1000n * nominal > callerBalance).to.be.true; - expect(contractBalanceAfter).to.be.equal(1000n * nominal); - }); - - itEth('can not be called by non-admin', async ({helper}) => { - const nonAdmin = accounts.pop()!; - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); - const flipper = await helper.eth.deployFlipper(contractOwner); - - await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address]); - const stopSponsoringResult = await helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address]); - expect(stopSponsoringResult.status).to.equal('Fail'); - expect(stopSponsoringResult.moduleError).to.equal('appPromotion.NoPermission'); - }); - - itEth('should not affect a contract which is not sponsored by pallete', async ({helper}) => { - const nonAdmin = accounts.pop()!; - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); - const flipper = await helper.eth.deployFlipper(contractOwner); - const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); - await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled; - - await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address], true)).to.be.rejectedWith('appPromotion.NoPermission'); - }); -}); - -describe('app-promotion rewards', () => { - before(async function () { - await beforeEach(this); - }); - - itSub('can not be called by non admin', async ({helper}) => { - const nonAdmin = accounts.pop()!; - await expect(helper.admin.payoutStakers(nonAdmin, 100)).to.be.rejectedWith('appPromotion.NoPermission'); - }); - - itSub('should increase total staked', async ({helper}) => { - const staker = accounts.pop()!; - const totalStakedBefore = await helper.staking.getTotalStaked(); - await helper.staking.stake(staker, 100n * nominal); - - // Wait for rewards and pay - const [stakedInBlock] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock.block)); - const totalPayout = (await helper.admin.payoutStakers(palletAdmin, 100)).reduce((prev, payout) => prev + payout.payout, 0n); - - const totalStakedAfter = await helper.staking.getTotalStaked(); - expect(totalStakedAfter).to.equal(totalStakedBefore + (100n * nominal) + totalPayout); - // staker can unstake - await helper.staking.unstake(staker); - expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedAfter - calculateIncome(100n * nominal, 10n)); - }); - - itSub('should credit 0.05% for staking period', async ({helper}) => { - const staker = accounts.pop()!; - - await waitPromotionPeriodDoesntEnd(helper); - - await helper.staking.stake(staker, 100n * nominal); - await helper.staking.stake(staker, 200n * nominal); - - // wait rewards are available: - const [_, stake2] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake2.block)); - - const payoutToStaker = (await helper.admin.payoutStakers(palletAdmin, 100)).find((payout) => payout.staker === staker.address)?.payout; - expect(payoutToStaker + 300n * nominal).to.equal(calculateIncome(300n * nominal, 10n)); - - const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - expect(totalStakedPerBlock[0].amount).to.equal(calculateIncome(100n * nominal, 10n)); - expect(totalStakedPerBlock[1].amount).to.equal(calculateIncome(200n * nominal, 10n)); - }); - - itSub('shoud be paid for more than one period if payments was missed', async ({helper}) => { - const staker = accounts.pop()!; - - await helper.staking.stake(staker, 100n * nominal); - // wait for two rewards are available: - let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); - - await helper.admin.payoutStakers(palletAdmin, 100); - [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - const frozenBalanceShouldBe = calculateIncome(100n * nominal, 10n, 2); - expect(stake.amount).to.be.equal(frozenBalanceShouldBe); - - const stakerFullBalance = await helper.balance.getSubstrateFull(staker.address); - - expect(stakerFullBalance).to.contain({reserved: 0n, feeFrozen: frozenBalanceShouldBe, miscFrozen: frozenBalanceShouldBe}); }); - itSub('should not be credited for unstaked (reserved) balance', async ({helper}) => { - // staker unstakes before rewards has been payed - const staker = accounts.pop()!; - await helper.staking.stake(staker, 100n * nominal); - const [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); - await helper.staking.unstake(staker); - - // so he did not receive any rewards - const totalBalanceBefore = await helper.balance.getSubstrate(staker.address); - await helper.admin.payoutStakers(palletAdmin, 100); - const totalBalanceAfter = await helper.balance.getSubstrate(staker.address); - - expect(totalBalanceBefore).to.be.equal(totalBalanceAfter); + describe('stopSponsoringCollection', () => { + itSub('can not be called by non-admin', async ({helper}) => { + const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!]; + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled; + + await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected; + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); + }); + + itSub('should set sponsoring as disabled', async ({helper}) => { + const [collectionOwner, recepient] = [accounts.pop()!, accounts.pop()!]; + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits: {sponsorTransferTimeout: 0}}); + const token = await collection.mintToken(collectionOwner, {Substrate: collectionOwner.address}); + + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId)); + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId)); + + expect((await collection.getData())?.raw.sponsorship).to.be.equal('Disabled'); + + // Transactions are not sponsored anymore: + const ownerBalanceBefore = await helper.balance.getSubstrate(collectionOwner.address); + await token.transfer(collectionOwner, {Substrate: recepient.address}); + const ownerBalanceAfter = await helper.balance.getSubstrate(collectionOwner.address); + expect(ownerBalanceAfter < ownerBalanceBefore).to.be.equal(true); + }); + + itSub('should not affect collection which is not sponsored by pallete', async ({helper}) => { + const collectionOwner = accounts.pop()!; + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address}); + await collection.confirmSponsorship(collectionOwner); + + await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected; + + expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: collectionOwner.address}); + }); + + itSub('should reject transaction if collection does not exist', async ({helper}) => { + const collectionOwner = accounts.pop()!; + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + + await collection.burn(collectionOwner); + await expect(helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringCollection', [collection.collectionId], true)).to.be.rejectedWith('common.CollectionNotFound'); + await expect(helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringCollection', [999_999_999], true)).to.be.rejectedWith('common.CollectionNotFound'); + }); }); - itSub('should bring compound interest', async ({helper}) => { - const staker = accounts.pop()!; - - await helper.staking.stake(staker, 100n * nominal); - - let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block)); + describe('contract sponsoring', () => { + itEth('should set palletes address as a sponsor', async ({helper}) => { + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); + const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); + + await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address]); - await helper.admin.payoutStakers(palletAdmin, 100); - [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n)); + expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true; + expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); + expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + confirmed: { + substrate: palletAddress, + }, + }); + }); + + itEth('should overwrite sponsoring mode and existed sponsor', async ({helper}) => { + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); + const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); + + await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled; + + // Contract is self sponsored + expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.be.deep.equal({ + confirmed: { + ethereum: flipper.options.address.toLowerCase(), + }, + }); + + // set promotion sponsoring + await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true); + + // new sponsor is pallet address + expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true; + expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner); + expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.deep.equal({ + confirmed: { + substrate: palletAddress, + }, + }); + }); + + itEth('can be overwritten by contract owner', async ({helper}) => { + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); + const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); + + // contract sponsored by pallet + await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true); + + // owner sets self sponsoring + await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; + + expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true; + expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); + expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + confirmed: { + ethereum: flipper.options.address.toLowerCase(), + }, + }); + }); + + itEth('can not be set by non admin', async ({helper}) => { + const nonAdmin = accounts.pop()!; + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); + const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); + + await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled; + + // nonAdmin calls sponsorContract + await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true)).to.be.rejectedWith('appPromotion.NoPermission'); + + // contract still self-sponsored + expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + confirmed: { + ethereum: flipper.options.address.toLowerCase(), + }, + }); + }); + + itEth('should actually sponsor transactions', async ({helper}) => { + // Contract caller + const caller = await helper.eth.createAccountWithBalance(alice, 1000n); + const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress); + + // Deploy flipper + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); + const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); - await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); - await helper.admin.payoutStakers(palletAdmin, 100); - [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); - expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n, 2)); + // Owner sets to sponsor every tx + await contractHelper.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: contractOwner}); + await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); + await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address, 1000n); // transferBalanceToEth(api, alice, flipper.options.address, 1000n); + + // Set promotion to the Flipper + await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorContract(flipper.options.address)); + + // Caller calls Flipper + await flipper.methods.flip().send({from: caller}); + expect(await flipper.methods.getValue().call()).to.be.true; + + // The contracts and caller balances have not changed + const callerBalance = await helper.balance.getEthereum(caller); + const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address); + expect(callerBalance).to.be.equal(1000n * nominal); + expect(1000n * nominal === contractBalanceAfter).to.be.true; + + // The pallet balance has decreased + const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress); + expect(palletBalanceAfter < palletBalanceBefore).to.be.true; + }); }); - - itSub.skip('can be paid 1000 rewards in a time', async ({helper}) => { - // all other stakes should be unstaked - const oneHundredStakers = await helper.arrange.createCrowd(100, 1050n, alice); - - // stakers stakes 10 times each - for (let i = 0; i < 10; i++) { - await Promise.all(oneHundredStakers.map(staker => helper.staking.stake(staker, 100n * nominal))); - } - await helper.wait.newBlocks(40); - await helper.admin.payoutStakers(palletAdmin, 100); + + describe('stopSponsoringContract', () => { + itEth('should remove pallet address from contract sponsors', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(alice, 1000n); + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); + await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address); + const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); + + await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); + await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true); + await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address], true); + + expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.false; + expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); + expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + disabled: null, + }); + + await flipper.methods.flip().send({from: caller}); + expect(await flipper.methods.getValue().call()).to.be.true; + + const callerBalance = await helper.balance.getEthereum(caller); + const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address); + + // caller payed for call + expect(1000n * nominal > callerBalance).to.be.true; + expect(contractBalanceAfter).to.be.equal(1000n * nominal); + }); + + itEth('can not be called by non-admin', async ({helper}) => { + const nonAdmin = accounts.pop()!; + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); + + await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address]); + const stopSponsoringResult = await helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address]); + expect(stopSponsoringResult.status).to.equal('Fail'); + expect(stopSponsoringResult.moduleError).to.equal('appPromotion.NoPermission'); + }); + + itEth('should not affect a contract which is not sponsored by pallete', async ({helper}) => { + const nonAdmin = accounts.pop()!; + const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const flipper = await helper.eth.deployFlipper(contractOwner); + const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); + await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled; + + await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address], true)).to.be.rejectedWith('appPromotion.NoPermission'); + }); }); - - itSub.skip('can handle 40.000 rewards', async ({helper}) => { - const [donor] = await helper.arrange.createAccounts([7_000_000n], alice); - const crowdStakes = async () => { - // each account in the crowd stakes 2 times - const crowd = await helper.arrange.createCrowd(500, 300n, donor); - await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal))); - await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal))); - // - }; - - for (let i = 0; i < 40; i++) { - await crowdStakes(); - } - - // TODO pay rewards for some period + + describe('rewards', () => { + itSub('can not be called by non admin', async ({helper}) => { + const nonAdmin = accounts.pop()!; + await expect(helper.admin.payoutStakers(nonAdmin, 100)).to.be.rejectedWith('appPromotion.NoPermission'); + }); + + itSub('should increase total staked', async ({helper}) => { + const staker = accounts.pop()!; + const totalStakedBefore = await helper.staking.getTotalStaked(); + await helper.staking.stake(staker, 100n * nominal); + + // Wait for rewards and pay + const [stakedInBlock] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock.block)); + const totalPayout = (await helper.admin.payoutStakers(palletAdmin, 100)).reduce((prev, payout) => prev + payout.payout, 0n); + + const totalStakedAfter = await helper.staking.getTotalStaked(); + expect(totalStakedAfter).to.equal(totalStakedBefore + (100n * nominal) + totalPayout); + // staker can unstake + await helper.staking.unstake(staker); + expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedAfter - calculateIncome(100n * nominal, 10n)); + }); + + itSub('should credit 0.05% for staking period', async ({helper}) => { + const staker = accounts.pop()!; + + await waitPromotionPeriodDoesntEnd(helper); + + await helper.staking.stake(staker, 100n * nominal); + await helper.staking.stake(staker, 200n * nominal); + + // wait rewards are available: + const [_, stake2] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake2.block)); + + const payoutToStaker = (await helper.admin.payoutStakers(palletAdmin, 100)).find((payout) => payout.staker === staker.address)?.payout; + expect(payoutToStaker + 300n * nominal).to.equal(calculateIncome(300n * nominal, 10n)); + + const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(totalStakedPerBlock[0].amount).to.equal(calculateIncome(100n * nominal, 10n)); + expect(totalStakedPerBlock[1].amount).to.equal(calculateIncome(200n * nominal, 10n)); + }); + + itSub('shoud be paid for more than one period if payments was missed', async ({helper}) => { + const staker = accounts.pop()!; + + await helper.staking.stake(staker, 100n * nominal); + // wait for two rewards are available: + let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); + + await helper.admin.payoutStakers(palletAdmin, 100); + [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + const frozenBalanceShouldBe = calculateIncome(100n * nominal, 10n, 2); + expect(stake.amount).to.be.equal(frozenBalanceShouldBe); + + const stakerFullBalance = await helper.balance.getSubstrateFull(staker.address); + + expect(stakerFullBalance).to.contain({reserved: 0n, feeFrozen: frozenBalanceShouldBe, miscFrozen: frozenBalanceShouldBe}); + }); + + itSub('should not be credited for unstaked (reserved) balance', async ({helper}) => { + // staker unstakes before rewards has been payed + const staker = accounts.pop()!; + await helper.staking.stake(staker, 100n * nominal); + const [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); + await helper.staking.unstake(staker); + + // so he did not receive any rewards + const totalBalanceBefore = await helper.balance.getSubstrate(staker.address); + await helper.admin.payoutStakers(palletAdmin, 100); + const totalBalanceAfter = await helper.balance.getSubstrate(staker.address); + + expect(totalBalanceBefore).to.be.equal(totalBalanceAfter); + }); + + itSub('should bring compound interest', async ({helper}) => { + const staker = accounts.pop()!; + + await helper.staking.stake(staker, 100n * nominal); + + let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block)); + + await helper.admin.payoutStakers(palletAdmin, 100); + [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n)); + + await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD); + await helper.admin.payoutStakers(palletAdmin, 100); + [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n, 2)); + }); + + itSub.skip('can be paid 1000 rewards in a time', async ({helper}) => { + // all other stakes should be unstaked + const oneHundredStakers = await helper.arrange.createCrowd(100, 1050n, alice); + + // stakers stakes 10 times each + for (let i = 0; i < 10; i++) { + await Promise.all(oneHundredStakers.map(staker => helper.staking.stake(staker, 100n * nominal))); + } + await helper.wait.newBlocks(40); + await helper.admin.payoutStakers(palletAdmin, 100); + }); + + itSub.skip('can handle 40.000 rewards', async ({helper}) => { + const [donor] = await helper.arrange.createAccounts([7_000_000n], alice); + const crowdStakes = async () => { + // each account in the crowd stakes 2 times + const crowd = await helper.arrange.createCrowd(500, 300n, donor); + await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal))); + await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal))); + // + }; + + for (let i = 0; i < 40; i++) { + await crowdStakes(); + } + + // TODO pay rewards for some period + }); }); }); diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 9e8bce1e21..9f116c67e2 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -122,6 +122,7 @@ class ArrangeGroup { */ createAccounts = async (balances: bigint[], donor: IKeyringPair): Promise => { let nonce = await this.helper.chain.getNonce(donor.address); + const wait = new WaitGroup(this.helper); const ss58Format = this.helper.chain.getChainProperties().ss58Format; const tokenNominal = this.helper.balance.getOneTokenNominal(); const transactions = []; @@ -156,7 +157,7 @@ class ArrangeGroup { for (let index = 0; index < 5; index++) { accountsCreated = await checkBalances(); if(accountsCreated) break; - + await wait.newBlocks(1); } if (!accountsCreated) throw Error('Accounts generation failed'); From 73dffe8a2518e5733d62bab6cc61b77a07a1e072 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 15 Sep 2022 20:14:08 +0700 Subject: [PATCH 0909/1274] expose 9933 rpc port for xcm tests --- .docker/Dockerfile-xcm.j2 | 1 + .docker/docker-compose.tmp-xcm-tests.j2 | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.docker/Dockerfile-xcm.j2 b/.docker/Dockerfile-xcm.j2 index 1827542d1e..5631546a48 100644 --- a/.docker/Dockerfile-xcm.j2 +++ b/.docker/Dockerfile-xcm.j2 @@ -72,6 +72,7 @@ COPY --from=uniquenetwork/builder-acala:{{ ACALA_BUILD_BRANCH }} /unique_paracha COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/ EXPOSE 9844 +EXPOSE 9933 EXPOSE 9944 EXPOSE 9946 EXPOSE 9947 diff --git a/.docker/docker-compose.tmp-xcm-tests.j2 b/.docker/docker-compose.tmp-xcm-tests.j2 index ede212ea9e..7458da0db7 100644 --- a/.docker/docker-compose.tmp-xcm-tests.j2 +++ b/.docker/docker-compose.tmp-xcm-tests.j2 @@ -6,12 +6,14 @@ services: container_name: xcm-{{ NETWORK }}-testnet-local expose: - 9844 + - 9933 - 9944 - 9946 - 9947 - 9948 ports: - 127.0.0.1:9844:9844 + - 127.0.0.1:9933:9933 - 127.0.0.1:9944:9944 - 127.0.0.1:9946:9946 - 127.0.0.1:9947:9947 From 6ca126943701a178cc455e404bd96073aa473d26 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Thu, 15 Sep 2022 21:15:41 +0700 Subject: [PATCH 0910/1274] fix cargo.toml --- pallets/app-promotion/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index 8845d2be14..82e51ce0bc 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -66,8 +66,8 @@ up-data-structs ={ default-features = false, path = "../../primitives/data-struc pallet-common ={ default-features = false, path = "../common" } pallet-unique ={ default-features = false, path = "../unique" } pallet-evm-contract-helpers ={ default-features = false, path = "../evm-contract-helpers" } - -[dev-dependencies] pallet-evm-migration ={ default-features = false, path = "../evm-migration" } +# [dev-dependencies] + ################################################################################ From 416575c2c6182eb8c16a20b6b520abe7157a051f Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 15 Sep 2022 21:17:29 +0700 Subject: [PATCH 0911/1274] fix rpc port for xcm tests --- .github/workflows/xcm.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index e94899d6f4..ac77d00ad6 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -369,10 +369,12 @@ jobs: run: | yarn install yarn add mochawesome - yarn polkadot-types node scripts/readyness.js echo "Ready to start tests" + yarn polkadot-types NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW} + env: + RPC_URL: http://127.0.0.1:9933/ - name: XCM Test Report uses: phoenix-actions/test-reporting@v8 From 979ed451c458c7a2f25b3b76a8337527c1c7c491 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 16 Sep 2022 11:45:04 +0300 Subject: [PATCH 0912/1274] add echo for debug. aditional build envieroment cleanup --- .docker/Dockerfile-chain-dev | 1 + .github/workflows/dev-build-tests_v2.yml | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/.docker/Dockerfile-chain-dev b/.docker/Dockerfile-chain-dev index af07fec2fa..64630a2124 100644 --- a/.docker/Dockerfile-chain-dev +++ b/.docker/Dockerfile-chain-dev @@ -24,5 +24,6 @@ COPY . /dev_chain WORKDIR /dev_chain RUN cargo build --release +RUN echo "$FEATURE" CMD cargo run --release --features=$FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external diff --git a/.github/workflows/dev-build-tests_v2.yml b/.github/workflows/dev-build-tests_v2.yml index 78e76975a4..63406508cd 100644 --- a/.github/workflows/dev-build-tests_v2.yml +++ b/.github/workflows/dev-build-tests_v2.yml @@ -95,3 +95,14 @@ jobs: - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f -a + docker system prune -f + docker image prune -f -a + + - name: Clean Workspace + if: always() + uses: AutoModality/action-clean@v1.1.0 \ No newline at end of file From 1d4b417ff771f75b16d923cc31b2b0a508da632d Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 16 Sep 2022 11:48:08 +0300 Subject: [PATCH 0913/1274] add variable definition --- .docker/Dockerfile-chain-dev | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.docker/Dockerfile-chain-dev b/.docker/Dockerfile-chain-dev index 64630a2124..f9d25d0fd5 100644 --- a/.docker/Dockerfile-chain-dev +++ b/.docker/Dockerfile-chain-dev @@ -13,6 +13,8 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none ARG RUST_TOOLCHAIN= ARG FEATURE= +ENV FEATURE $FEATURE + RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup toolchain install $RUST_TOOLCHAIN && \ rustup default $RUST_TOOLCHAIN && \ From 3445c72d9c12dd0bd73c14e5aa31c2661669be48 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 16 Sep 2022 12:22:16 +0300 Subject: [PATCH 0914/1274] add equal sign into Dockerfile. Remove Workspace cleanup --- .docker/Dockerfile-chain-dev | 2 +- .github/workflows/dev-build-tests_v2.yml | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.docker/Dockerfile-chain-dev b/.docker/Dockerfile-chain-dev index f9d25d0fd5..65f6b0f795 100644 --- a/.docker/Dockerfile-chain-dev +++ b/.docker/Dockerfile-chain-dev @@ -13,7 +13,7 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none ARG RUST_TOOLCHAIN= ARG FEATURE= -ENV FEATURE $FEATURE +ENV FEATURE=$FEATURE RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup toolchain install $RUST_TOOLCHAIN && \ diff --git a/.github/workflows/dev-build-tests_v2.yml b/.github/workflows/dev-build-tests_v2.yml index 63406508cd..46c2f468c5 100644 --- a/.github/workflows/dev-build-tests_v2.yml +++ b/.github/workflows/dev-build-tests_v2.yml @@ -101,8 +101,4 @@ jobs: run: | docker builder prune -f -a docker system prune -f - docker image prune -f -a - - - name: Clean Workspace - if: always() - uses: AutoModality/action-clean@v1.1.0 \ No newline at end of file + docker image prune -f -a \ No newline at end of file From 0b16c5c25c9be799a14905f5d5a33862f1c11b1a Mon Sep 17 00:00:00 2001 From: rkv Date: Fri, 16 Sep 2022 13:16:38 +0300 Subject: [PATCH 0915/1274] creditFeesToTreasury migrated --- tests/src/creditFeesToTreasury.test.ts | 181 +++++++++++-------------- 1 file changed, 82 insertions(+), 99 deletions(-) diff --git a/tests/src/creditFeesToTreasury.test.ts b/tests/src/creditFeesToTreasury.test.ts index a9487fa26b..d52c20aa33 100644 --- a/tests/src/creditFeesToTreasury.test.ts +++ b/tests/src/creditFeesToTreasury.test.ts @@ -15,32 +15,20 @@ // along with Unique Network. If not, see . import './interfaces/augment-api-consts'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api'; import {IKeyringPair} from '@polkadot/types/types'; import { - createCollectionExpectSuccess, - createItemExpectSuccess, - getGenericResult, - transferExpectSuccess, UNIQUE, } from './util/helpers'; import {default as waitNewBlocks} from './substrate/wait-new-blocks'; import {ApiPromise} from '@polkadot/api'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {usingPlaygrounds, expect, itSub} from './util/playgrounds'; const TREASURY = '5EYCAe5ijiYfyeZ2JJCGq56LmPyNRAKzpG4QkoQkkQNB5e6Z'; const saneMinimumFee = 0.05; const saneMaximumFee = 0.5; const createCollectionDeposit = 100; -let alice: IKeyringPair; -let bob: IKeyringPair; - // Skip the inflation block pauses if the block is close to inflation block // until the inflation happens /*eslint no-async-promise-executor: "off"*/ @@ -62,129 +50,124 @@ function skipInflationBlock(api: ApiPromise): Promise { } describe('integration test: Fees must be credited to Treasury:', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); - it('Total issuance does not change', async () => { - await usingApi(async (api) => { - await skipInflationBlock(api); - await waitNewBlocks(api, 1); - - const totalBefore = (await api.query.balances.totalIssuance()).toBigInt(); + itSub('Total issuance does not change', async ({helper}) => { + const api = helper.api!; + await skipInflationBlock(api); + await waitNewBlocks(api, 1); - const amount = 1n; - const transfer = api.tx.balances.transfer(bob.address, amount); + const totalBefore = (await api.query.balances.totalIssuance()).toBigInt(); - const result = getGenericResult(await submitTransactionAsync(alice, transfer)); + await helper.balance.transferToSubstrate(alice, bob.address, 1n); - const totalAfter = (await api.query.balances.totalIssuance()).toBigInt(); + const totalAfter = (await api.query.balances.totalIssuance()).toBigInt(); - expect(result.success).to.be.true; - expect(totalAfter).to.be.equal(totalBefore); - }); + expect(totalAfter).to.be.equal(totalBefore); }); - it('Sender balance decreased by fee+sent amount, Treasury balance increased by fee', async () => { - await usingApi(async (api) => { - await skipInflationBlock(api); - await waitNewBlocks(api, 1); + itSub('Sender balance decreased by fee+sent amount, Treasury balance increased by fee', async ({helper}) => { + const api = helper.api!; + await skipInflationBlock(api); + await waitNewBlocks(api, 1); - const treasuryBalanceBefore: bigint = (await api.query.system.account(TREASURY)).data.free.toBigInt(); - const aliceBalanceBefore: bigint = (await api.query.system.account(alice.address)).data.free.toBigInt(); + const treasuryBalanceBefore = await helper.balance.getSubstrate(TREASURY); + const aliceBalanceBefore = await helper.balance.getSubstrate(alice.address); - const amount = 1n; - const transfer = api.tx.balances.transfer(bob.address, amount); - const result = getGenericResult(await submitTransactionAsync(alice, transfer)); + const amount = 1n; + await helper.balance.transferToSubstrate(alice, bob.address, amount); - const treasuryBalanceAfter: bigint = (await api.query.system.account(TREASURY)).data.free.toBigInt(); - const aliceBalanceAfter: bigint = (await api.query.system.account(alice.address)).data.free.toBigInt(); - const fee = aliceBalanceBefore - aliceBalanceAfter - amount; - const treasuryIncrease = treasuryBalanceAfter - treasuryBalanceBefore; + const treasuryBalanceAfter = await helper.balance.getSubstrate(TREASURY); + const aliceBalanceAfter = await helper.balance.getSubstrate(alice.address); - expect(result.success).to.be.true; - expect(treasuryIncrease).to.be.equal(fee); - }); + const fee = aliceBalanceBefore - aliceBalanceAfter - amount; + const treasuryIncrease = treasuryBalanceAfter - treasuryBalanceBefore; + + expect(treasuryIncrease).to.be.equal(fee); }); - it('Treasury balance increased by failed tx fee', async () => { - await usingApi(async (api) => { - //await skipInflationBlock(api); - await waitNewBlocks(api, 1); + itSub('Treasury balance increased by failed tx fee', async ({helper}) => { + const api = helper.api!; + await waitNewBlocks(api, 1); - const treasuryBalanceBefore = (await api.query.system.account(TREASURY)).data.free.toBigInt(); - const bobBalanceBefore = (await api.query.system.account(bob.address)).data.free.toBigInt(); + const treasuryBalanceBefore = await helper.balance.getSubstrate(TREASURY); + const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); - const badTx = api.tx.balances.setBalance(alice.address, 0, 0); - await expect(submitTransactionExpectFailAsync(bob, badTx)).to.be.rejected; + await expect(helper.signTransaction(bob, api.tx.balances.setBalance(alice.address, 0, 0))).to.be.rejected; - const treasuryBalanceAfter = (await api.query.system.account(TREASURY)).data.free.toBigInt(); - const bobBalanceAfter = (await api.query.system.account(bob.address)).data.free.toBigInt(); - const fee = bobBalanceBefore - bobBalanceAfter; - const treasuryIncrease = treasuryBalanceAfter - treasuryBalanceBefore; + const treasuryBalanceAfter = await helper.balance.getSubstrate(TREASURY); + const bobBalanceAfter = await helper.balance.getSubstrate(bob.address); - expect(treasuryIncrease).to.be.equal(fee); - }); + const fee = bobBalanceBefore - bobBalanceAfter; + const treasuryIncrease = treasuryBalanceAfter - treasuryBalanceBefore; + + expect(treasuryIncrease).to.be.equal(fee); }); - it('NFT Transactions also send fees to Treasury', async () => { - await usingApi(async (api) => { - await skipInflationBlock(api); - await waitNewBlocks(api, 1); + itSub('NFT Transactions also send fees to Treasury', async ({helper}) => { + const api = helper.api!; + await skipInflationBlock(api); + await waitNewBlocks(api, 1); - const treasuryBalanceBefore = (await api.query.system.account(TREASURY)).data.free.toBigInt(); - const aliceBalanceBefore = (await api.query.system.account(alice.address)).data.free.toBigInt(); + const treasuryBalanceBefore = await helper.balance.getSubstrate(TREASURY); + const aliceBalanceBefore = await helper.balance.getSubstrate(alice.address); - await createCollectionExpectSuccess(); + await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const treasuryBalanceAfter = (await api.query.system.account(TREASURY)).data.free.toBigInt(); - const aliceBalanceAfter = (await api.query.system.account(alice.address)).data.free.toBigInt(); - const fee = aliceBalanceBefore - aliceBalanceAfter; - const treasuryIncrease = treasuryBalanceAfter - treasuryBalanceBefore; + const treasuryBalanceAfter = await helper.balance.getSubstrate(TREASURY); + const aliceBalanceAfter = await helper.balance.getSubstrate(alice.address); + const fee = aliceBalanceBefore - aliceBalanceAfter; + const treasuryIncrease = treasuryBalanceAfter - treasuryBalanceBefore; - expect(treasuryIncrease).to.be.equal(fee); - }); + expect(treasuryIncrease).to.be.equal(fee); }); - it('Fees are sane', async () => { - await usingApi(async (api) => { - await skipInflationBlock(api); - await waitNewBlocks(api, 1); + itSub('Fees are sane', async ({helper}) => { + const api = helper.api!; + await skipInflationBlock(api); + await waitNewBlocks(api, 1); - const aliceBalanceBefore: bigint = (await api.query.system.account(alice.address)).data.free.toBigInt(); + const aliceBalanceBefore = await helper.balance.getSubstrate(alice.address); - await createCollectionExpectSuccess(); + await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const aliceBalanceAfter: bigint = (await api.query.system.account(alice.address)).data.free.toBigInt(); - const fee = aliceBalanceBefore - aliceBalanceAfter; + const aliceBalanceAfter = await helper.balance.getSubstrate(alice.address); + const fee = aliceBalanceBefore - aliceBalanceAfter; - expect(fee / UNIQUE < BigInt(Math.ceil(saneMaximumFee + createCollectionDeposit))).to.be.true; - expect(fee / UNIQUE < BigInt(Math.ceil(saneMinimumFee + createCollectionDeposit))).to.be.true; - }); + expect(fee / UNIQUE < BigInt(Math.ceil(saneMaximumFee + createCollectionDeposit))).to.be.true; + expect(fee / UNIQUE < BigInt(Math.ceil(saneMinimumFee + createCollectionDeposit))).to.be.true; }); - it('NFT Transfer fee is close to 0.1 Unique', async () => { - await usingApi(async (api) => { - await skipInflationBlock(api); - await waitNewBlocks(api, 1); + itSub('NFT Transfer fee is close to 0.1 Unique', async ({helper}) => { + const api = helper.api!; + await skipInflationBlock(api); + await waitNewBlocks(api, 1); - const collectionId = await createCollectionExpectSuccess(); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT'); + const collection = await helper.nft.mintCollection(alice, { + name: 'test', + description: 'test', + tokenPrefix: 'test', + }); + // const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT'); + const token = await collection.mintToken(alice, {Substrate: alice.address}); - const aliceBalanceBefore: bigint = (await api.query.system.account(alice.address)).data.free.toBigInt(); - await transferExpectSuccess(collectionId, tokenId, alice, bob, 1, 'NFT'); - const aliceBalanceAfter: bigint = (await api.query.system.account(alice.address)).data.free.toBigInt(); + const aliceBalanceBefore = await helper.balance.getSubstrate(alice.address); + await token.transfer(alice, {Substrate: bob.address}); + const aliceBalanceAfter = await helper.balance.getSubstrate(alice.address); - const fee = Number(aliceBalanceBefore - aliceBalanceAfter) / Number(UNIQUE); - const expectedTransferFee = 0.1; - // fee drifts because of NextFeeMultiplier - const tolerance = 0.001; + const fee = Number(aliceBalanceBefore - aliceBalanceAfter) / Number(UNIQUE); + const expectedTransferFee = 0.1; + // fee drifts because of NextFeeMultiplier + const tolerance = 0.001; - expect(Math.abs(fee - expectedTransferFee)).to.be.lessThan(tolerance); - }); + expect(Math.abs(fee - expectedTransferFee)).to.be.lessThan(tolerance); }); - }); From e8717651bb50c4032a92791c9aafd4d044331b7f Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 16 Sep 2022 13:29:38 +0300 Subject: [PATCH 0916/1274] add env variable into generation step --- .docker/Dockerfile-chain-dev | 14 ++++++-------- .docker/docker-compose.tmp-dev.j2 | 2 ++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.docker/Dockerfile-chain-dev b/.docker/Dockerfile-chain-dev index 65f6b0f795..31e4aebf8b 100644 --- a/.docker/Dockerfile-chain-dev +++ b/.docker/Dockerfile-chain-dev @@ -1,19 +1,17 @@ FROM ubuntu:20.04 +ARG RUST_TOOLCHAIN= +ARG FEATURE= + ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Etc/UTC - -RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake - +ENV FEATURE=$FEATURE ENV CARGO_HOME="/cargo-home" ENV PATH="/cargo-home/bin:$PATH" -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - -ARG RUST_TOOLCHAIN= -ARG FEATURE= +RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake -ENV FEATURE=$FEATURE +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup toolchain install $RUST_TOOLCHAIN && \ diff --git a/.docker/docker-compose.tmp-dev.j2 b/.docker/docker-compose.tmp-dev.j2 index 27ac397661..cf98d171cb 100644 --- a/.docker/docker-compose.tmp-dev.j2 +++ b/.docker/docker-compose.tmp-dev.j2 @@ -8,6 +8,8 @@ services: - "FEATURE={{ FEATURE }}" context: ../ dockerfile: .docker/Dockerfile-chain-dev + environment: + - FEATURE={{ FEATURE }} expose: - 9944 - 9933 From ff1beacfa78e771aab4670c4c4e770f952d313e4 Mon Sep 17 00:00:00 2001 From: rkv Date: Fri, 16 Sep 2022 13:30:49 +0300 Subject: [PATCH 0917/1274] destroyCollection migrated --- tests/src/destroyCollection.test.ts | 137 +++++++++++++++++----------- 1 file changed, 82 insertions(+), 55 deletions(-) diff --git a/tests/src/destroyCollection.test.ts b/tests/src/destroyCollection.test.ts index ccf134cc7d..c432819f0d 100644 --- a/tests/src/destroyCollection.test.ts +++ b/tests/src/destroyCollection.test.ts @@ -15,36 +15,47 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi} from './substrate/substrate-api'; -import {createCollectionExpectSuccess, - destroyCollectionExpectSuccess, - destroyCollectionExpectFailure, - setCollectionLimitsExpectSuccess, - addCollectionAdminExpectSuccess, - getCreatedCollectionCount, - createItemExpectSuccess, - requirePallets, +import { Pallets, } from './util/helpers'; - -chai.use(chaiAsPromised); +import {itSub, expect, usingPlaygrounds} from './util/playgrounds'; describe('integration test: ext. destroyCollection():', () => { - it('NFT collection can be destroyed', async () => { - const collectionId = await createCollectionExpectSuccess(); - await destroyCollectionExpectSuccess(collectionId); - }); - it('Fungible collection can be destroyed', async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - await destroyCollectionExpectSuccess(collectionId); + let alice: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([100n], donor); + }); }); - it('ReFungible collection can be destroyed', async function() { - await requirePallets(this, [Pallets.ReFungible]); - const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await destroyCollectionExpectSuccess(collectionId); + itSub('NFT collection can be destroyed', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'test', + description: 'test', + tokenPrefix: 'test', + }); + await collection.burn(alice); + expect(await collection.getData()).to.be.null; + }); + itSub('Fungible collection can be destroyed', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, { + name: 'test', + description: 'test', + tokenPrefix: 'test', + }, 0); + await collection.burn(alice); + expect(await collection.getData()).to.be.null; + }); + itSub.ifWithPallets('ReFungible collection can be destroyed', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, { + name: 'test', + description: 'test', + tokenPrefix: 'test', + }); + await collection.burn(alice); + expect(await collection.getData()).to.be.null; }); }); @@ -53,44 +64,60 @@ describe('(!negative test!) integration test: ext. destroyCollection():', () => let bob: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); - it('(!negative test!) Destroy a collection that never existed', async () => { - await usingApi(async (api) => { - // Find the collection that never existed - const collectionId = await getCreatedCollectionCount(api) + 1; - await destroyCollectionExpectFailure(collectionId); - }); + itSub('(!negative test!) Destroy a collection that never existed', async ({helper}) => { + const collectionId = 1_000_000; + await expect(helper.collection.burn(alice, collectionId)).to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('(!negative test!) Destroy a collection that has already been destroyed', async () => { - const collectionId = await createCollectionExpectSuccess(); - await destroyCollectionExpectSuccess(collectionId); - await destroyCollectionExpectFailure(collectionId); + itSub('(!negative test!) Destroy a collection that has already been destroyed', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'test', + description: 'test', + tokenPrefix: 'test', + }); + await collection.burn(alice); + await expect(collection.burn(alice)).to.be.rejectedWith(/common\.CollectionNotFound/); }); - it('(!negative test!) Destroy a collection using non-owner account', async () => { - const collectionId = await createCollectionExpectSuccess(); - await destroyCollectionExpectFailure(collectionId, '//Bob'); - await destroyCollectionExpectSuccess(collectionId, '//Alice'); + itSub('(!negative test!) Destroy a collection using non-owner account', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'test', + description: 'test', + tokenPrefix: 'test', + }); + await expect(collection.burn(bob)).to.be.rejectedWith(/common\.NoPermission/); }); - it('(!negative test!) Destroy a collection using collection admin account', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await destroyCollectionExpectFailure(collectionId, '//Bob'); + itSub('(!negative test!) Destroy a collection using collection admin account', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'test', + description: 'test', + tokenPrefix: 'test', + }); + await collection.addAdmin(alice, {Substrate: bob.address}); + await expect(collection.burn(bob)).to.be.rejectedWith(/common\.NoPermission/); }); - it('fails when OwnerCanDestroy == false', async () => { - const collectionId = await createCollectionExpectSuccess(); - await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanDestroy: false}); - - await destroyCollectionExpectFailure(collectionId, '//Alice'); + itSub('fails when OwnerCanDestroy == false', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'test', + description: 'test', + tokenPrefix: 'test', + limits: { + ownerCanDestroy: false, + }, + }); + await expect(collection.burn(alice)).to.be.rejectedWith(/common\.NoPermission/); }); - it('fails when a collection still has a token', async () => { - const collectionId = await createCollectionExpectSuccess(); - await createItemExpectSuccess(alice, collectionId, 'NFT'); - - await destroyCollectionExpectFailure(collectionId, '//Alice'); + itSub('fails when a collection still has a token', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'test', + description: 'test', + tokenPrefix: 'test', + }); + await collection.mintToken(alice, {Substrate: alice.address}); + await expect(collection.burn(alice)).to.be.rejectedWith(/common\.CantDestroyNotEmptyCollection/); }); }); From bc53a7e6ed12c28785503d9eb8a264886e61bd5d Mon Sep 17 00:00:00 2001 From: rkv Date: Fri, 16 Sep 2022 13:50:07 +0300 Subject: [PATCH 0918/1274] enableDisableTransfer migrated --- tests/src/enableDisableTransfer.test.ts | 92 ++++++++++++++----------- 1 file changed, 50 insertions(+), 42 deletions(-) diff --git a/tests/src/enableDisableTransfer.test.ts b/tests/src/enableDisableTransfer.test.ts index ac644c462d..4f88cfc291 100644 --- a/tests/src/enableDisableTransfer.test.ts +++ b/tests/src/enableDisableTransfer.test.ts @@ -14,61 +14,69 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import usingApi from './substrate/substrate-api'; -import { - createItemExpectSuccess, - createCollectionExpectSuccess, - transferExpectSuccess, - transferExpectFailure, - setTransferFlagExpectSuccess, - setTransferFlagExpectFailure, -} from './util/helpers'; - -chai.use(chaiAsPromised); +import {IKeyringPair} from '@polkadot/types/types'; +import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; describe('Enable/Disable Transfers', () => { - it('User can transfer token with enabled transfer flag', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - // nft - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - - // explicitely set transfer flag - await setTransferFlagExpectSuccess(alice, nftCollectionId, true); + let alice: IKeyringPair; + let bob: IKeyringPair; - await transferExpectSuccess(nftCollectionId, newNftTokenId, alice, bob, 1); + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); - it('User can\'n transfer token with disabled transfer flag', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - // nft - const nftCollectionId = await createCollectionExpectSuccess(); - const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT'); - - // explicitely set transfer flag - await setTransferFlagExpectSuccess(alice, nftCollectionId, false); + itSub('User can transfer token with enabled transfer flag', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'test', + description: 'test', + tokenPrefix: 'test', + limits: { + transfersEnabled: true, + }, + }); + const token = await collection.mintToken(alice, {Substrate: alice.address}); + await token.transfer(alice, {Substrate: bob.address}); + expect(await token.getOwner()).to.be.deep.equal({Substrate: bob.address}); + }); - await transferExpectFailure(nftCollectionId, newNftTokenId, alice, bob, 1); + itSub('User can\'n transfer token with disabled transfer flag', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'test', + description: 'test', + tokenPrefix: 'test', + limits: { + transfersEnabled: false, + }, }); + const token = await collection.mintToken(alice, {Substrate: alice.address}); + await expect(token.transfer(alice, {Substrate: bob.address})).to.be.rejectedWith(/common\.TransferNotAllowed/); }); }); describe('Negative Enable/Disable Transfers', () => { - it('Non-owner cannot change transfer flag', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const bob = privateKeyWrapper('//Bob'); - // nft - const nftCollectionId = await createCollectionExpectSuccess(); + let alice: IKeyringPair; + let bob: IKeyringPair; - // Change transfer flag - await setTransferFlagExpectFailure(bob, nftCollectionId, false); + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); + + itSub('Non-owner cannot change transfer flag', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, { + name: 'test', + description: 'test', + tokenPrefix: 'test', + limits: { + transfersEnabled: true, + }, + }); + + await expect(collection.setLimits(bob, {transfersEnabled: false})).to.be.rejectedWith(/common\.NoPermission/); + }); }); From 112418ce20dcf673f55fb11dea1b047f33e2e4d0 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 16 Sep 2022 14:01:28 +0300 Subject: [PATCH 0919/1274] edit docker compose --- .docker/Dockerfile-chain-dev | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.docker/Dockerfile-chain-dev b/.docker/Dockerfile-chain-dev index 31e4aebf8b..cf6018446a 100644 --- a/.docker/Dockerfile-chain-dev +++ b/.docker/Dockerfile-chain-dev @@ -9,6 +9,8 @@ ENV FEATURE=$FEATURE ENV CARGO_HOME="/cargo-home" ENV PATH="/cargo-home/bin:$PATH" +RUN echo "$FEATURE\n" && echo "$RUST_TOOLCHAIN\n" + RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none From d71880efbb96d2a830761dc75864424c65e28e8c Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 16 Sep 2022 14:04:05 +0300 Subject: [PATCH 0920/1274] escaping env variable substitution --- .docker/docker-compose.tmp-dev.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/docker-compose.tmp-dev.j2 b/.docker/docker-compose.tmp-dev.j2 index cf98d171cb..691fbb093c 100644 --- a/.docker/docker-compose.tmp-dev.j2 +++ b/.docker/docker-compose.tmp-dev.j2 @@ -20,4 +20,4 @@ services: options: max-size: "1m" max-file: "3" - command: cargo run --release --features=$FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external + command: cargo run --release --features=$${FEATURE} -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external From fb3fa28b0be899495f092c856cd4e0e896c63b52 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 16 Sep 2022 14:27:49 +0300 Subject: [PATCH 0921/1274] replace variable by Jinja substitution --- .docker/docker-compose.tmp-dev.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/docker-compose.tmp-dev.j2 b/.docker/docker-compose.tmp-dev.j2 index 691fbb093c..1d4c391f64 100644 --- a/.docker/docker-compose.tmp-dev.j2 +++ b/.docker/docker-compose.tmp-dev.j2 @@ -20,4 +20,4 @@ services: options: max-size: "1m" max-file: "3" - command: cargo run --release --features=$${FEATURE} -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external + command: cargo run --release --features={{ FEATURE }} -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external From e0d3e40ea06ed185decf0d59017e8c00fbd2b502 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Fri, 16 Sep 2022 12:46:04 +0000 Subject: [PATCH 0922/1274] Fix tests for quartz and unique: remove global before --- tests/src/adminTransferAndBurn.test.ts | 9 ++------- tests/src/allowLists.test.ts | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/tests/src/adminTransferAndBurn.test.ts b/tests/src/adminTransferAndBurn.test.ts index 9f8be3cafb..6c962e26bd 100644 --- a/tests/src/adminTransferAndBurn.test.ts +++ b/tests/src/adminTransferAndBurn.test.ts @@ -24,19 +24,14 @@ const expect = chai.expect; let donor: IKeyringPair; -before(async () => { - await usingPlaygrounds(async (_, privateKey) => { - donor = privateKey('//Alice'); - }); -}); - describe('Integration Test: ownerCanTransfer allows admins to use only transferFrom/burnFrom:', () => { let alice: IKeyringPair; let bob: IKeyringPair; let charlie: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); }); diff --git a/tests/src/allowLists.test.ts b/tests/src/allowLists.test.ts index 6e3bd195d3..cd0a72d973 100644 --- a/tests/src/allowLists.test.ts +++ b/tests/src/allowLists.test.ts @@ -24,12 +24,6 @@ const expect = chai.expect; let donor: IKeyringPair; -before(async () => { - await usingPlaygrounds(async (_, privateKey) => { - donor = privateKey('//Alice'); - }); -}); - let alice: IKeyringPair; let bob: IKeyringPair; let charlie: IKeyringPair; @@ -37,7 +31,8 @@ let charlie: IKeyringPair; describe('Integration Test ext. Allow list tests', () => { before(async () => { - await usingPlaygrounds(async (helper) => { + await usingPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); From d26c12552b25351990b03b45d84d5a77430770a5 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 16 Sep 2022 16:16:44 +0300 Subject: [PATCH 0923/1274] remove env from docker-compose extend file --- .docker/docker-compose.tmp-dev.j2 | 2 -- 1 file changed, 2 deletions(-) diff --git a/.docker/docker-compose.tmp-dev.j2 b/.docker/docker-compose.tmp-dev.j2 index 1d4c391f64..6f706be8df 100644 --- a/.docker/docker-compose.tmp-dev.j2 +++ b/.docker/docker-compose.tmp-dev.j2 @@ -8,8 +8,6 @@ services: - "FEATURE={{ FEATURE }}" context: ../ dockerfile: .docker/Dockerfile-chain-dev - environment: - - FEATURE={{ FEATURE }} expose: - 9944 - 9933 From 40cdf2739a9d769d82201350dbeec565cfd89d7d Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 16 Sep 2022 15:04:03 +0000 Subject: [PATCH 0924/1274] refactor: move foreign flag to collection struct Signed-off-by: Yaroslav Bolyukin --- Cargo.lock | 24 +++++++++++++- pallets/common/src/lib.rs | 22 +++++++------ pallets/fungible/src/lib.rs | 32 ++++++++----------- pallets/nonfungible/src/lib.rs | 17 +++++++--- pallets/refungible/src/lib.rs | 10 +++--- primitives/data-structs/Cargo.toml | 1 + primitives/data-structs/src/bondrewd_codec.rs | 31 ++++++++++++++++++ primitives/data-structs/src/lib.rs | 25 +++++++++++++-- primitives/data-structs/src/migration.rs | 23 +++++++++++++ 9 files changed, 142 insertions(+), 43 deletions(-) create mode 100644 primitives/data-structs/src/bondrewd_codec.rs diff --git a/Cargo.lock b/Cargo.lock index dad0003480..ef4c43d730 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -696,6 +696,26 @@ dependencies = [ "once_cell", ] +[[package]] +name = "bondrewd" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1660fac8d3acced44dac64453fafedf5aab2de196b932c727e63e4ae42d1cc" +dependencies = [ + "bondrewd-derive", +] + +[[package]] +name = "bondrewd-derive" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723da0dee1eef38edc021b0793f892bdc024500c6a5b0727a2efe16f0e0a6977" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "bounded-vec" version = "0.6.0" @@ -5892,6 +5912,7 @@ dependencies = [ name = "pallet-foreign-assets" version = "0.1.0" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "hex", @@ -6600,7 +6621,7 @@ dependencies = [ [[package]] name = "pallet-unique" -version = "0.1.4" +version = "0.2.0" dependencies = [ "ethereum", "evm-coder", @@ -12634,6 +12655,7 @@ dependencies = [ name = "up-data-structs" version = "0.2.2" dependencies = [ + "bondrewd", "derivative", "frame-support", "frame-system", diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index f3a64ff4de..e0a4e9df7f 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -70,6 +70,7 @@ use up_data_structs::{ COLLECTION_NUMBER_LIMIT, Collection, RpcCollection, + CollectionFlags, CollectionId, CreateItemData, MAX_TOKEN_PREFIX_LENGTH, @@ -252,9 +253,9 @@ impl CollectionHandle { } /// Checks that the collection was created with, and must be operated upon through **Unique API**. - /// Now check only the `external_collection` flag and if it's **true**, then return [`Error::CollectionIsExternal`] error. + /// Now check only the `external` flag and if it's **true**, then return [`Error::CollectionIsExternal`] error. pub fn check_is_internal(&self) -> DispatchResult { - if self.external_collection { + if self.flags.external { return Err(>::CollectionIsExternal)?; } @@ -262,9 +263,9 @@ impl CollectionHandle { } /// Checks that the collection was created with, and must be operated upon through an **assimilated API**. - /// Now check only the `external_collection` flag and if it's **false**, then return [`Error::CollectionIsInternal`] error. + /// Now check only the `external` flag and if it's **false**, then return [`Error::CollectionIsInternal`] error. pub fn check_is_external(&self) -> DispatchResult { - if !self.external_collection { + if !self.flags.external { return Err(>::CollectionIsInternal)?; } @@ -345,7 +346,7 @@ pub mod pallet { use frame_support::{Blake2_128Concat, pallet_prelude::*, storage::Key, traits::StorageVersion}; use frame_system::pallet_prelude::*; use frame_support::traits::Currency; - use up_data_structs::{TokenId, mapping::TokenAddressMapping}; + use up_data_structs::{TokenId, mapping::TokenAddressMapping, CollectionFlags}; use scale_info::TypeInfo; use weights::WeightInfo; @@ -792,7 +793,7 @@ impl Pallet { sponsorship, limits, permissions, - external_collection, + flags, } = >::get(collection)?; let token_property_permissions = >::get(collection) @@ -822,7 +823,8 @@ impl Pallet { permissions, token_property_permissions, properties, - read_only: external_collection, + read_only: flags.external, + foreign: flags.foreign, }) } } @@ -861,11 +863,11 @@ impl Pallet { /// /// * `owner` - The owner of the collection. /// * `data` - Description of the created collection. - /// * `is_external` - Marks that collection managet by not "Unique network". + /// * `flags` - Extra flags to store. pub fn init_collection( owner: T::CrossAccountId, data: CreateCollectionData, - is_external: bool, + flags: CollectionFlags, ) -> Result { { ensure!( @@ -909,7 +911,7 @@ impl Pallet { Self::clamp_permissions(data.mode.clone(), &Default::default(), permissions) }) .unwrap_or_else(|| Ok(CollectionPermissions::default()))?, - external_collection: is_external, + flags, }; let mut collection_properties = up_data_structs::CollectionProperties::get(); diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index fb4cf263f1..edb122278f 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -83,8 +83,8 @@ use evm_coder::ToLog; use frame_support::{ensure}; use pallet_evm::account::CrossAccountId; use up_data_structs::{ - AccessMode, CollectionId, TokenId, CreateCollectionData, mapping::TokenAddressMapping, - budget::Budget, + AccessMode, CollectionId, CollectionFlags, TokenId, CreateCollectionData, + mapping::TokenAddressMapping, budget::Budget, }; use pallet_common::{ Error as CommonError, Event as CommonEvent, Pallet as PalletCommon, @@ -167,11 +167,6 @@ pub mod pallet { Value = u128, QueryKind = ValueQuery, >; - - /// Foreign collection flag - #[pallet::storage] - pub type ForeignCollection = - StorageMap; } /// Wrapper around untyped collection handle, asserting inner collection is of fungible type. @@ -217,7 +212,7 @@ impl Pallet { owner: T::CrossAccountId, data: CreateCollectionData, ) -> Result { - >::init_collection(owner, data, false) + >::init_collection(owner, data, CollectionFlags::default()) } /// Initializes the collection with ForeignCollection flag. Returns [CollectionId] on success, [DispatchError] otherwise. @@ -225,8 +220,14 @@ impl Pallet { owner: T::CrossAccountId, data: CreateCollectionData, ) -> Result { - let id = >::init_collection(owner, data, false)?; - >::insert(id, true); + let id = >::init_collection( + owner, + data, + CollectionFlags { + foreign: true, + ..Default::default() + }, + )?; Ok(id) } @@ -245,7 +246,6 @@ impl Pallet { PalletCommon::destroy_collection(collection.0, sender)?; - >::remove(id); >::remove(id); let _ = >::clear_prefix((id,), u32::MAX, None); let _ = >::clear_prefix((id,), u32::MAX, None); @@ -274,10 +274,7 @@ impl Pallet { .ok_or(>::TokenValueTooLow)?; // Foreign collection check - ensure!( - !>::get(collection.id), - >::NoPermission - ); + ensure!(!collection.flags.foreign, >::NoPermission); if collection.permissions.access() == AccessMode::AllowList { collection.check_allowlist(owner)?; @@ -502,10 +499,7 @@ impl Pallet { nesting_budget: &dyn Budget, ) -> DispatchResult { // Foreign collection check - ensure!( - !>::get(collection.id), - >::NoPermission - ); + ensure!(!collection.flags.foreign, >::NoPermission); if !collection.is_owner_or_admin(sender) { ensure!( diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 23041d44cd..204b20dde7 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -100,10 +100,10 @@ use frame_support::{ weights::{PostDispatchInfo, Pays}, }; use up_data_structs::{ - AccessMode, CollectionId, CustomDataLimit, TokenId, CreateCollectionData, CreateNftExData, - mapping::TokenAddressMapping, budget::Budget, Property, PropertyPermission, PropertyKey, - PropertyValue, PropertyKeyPermission, Properties, PropertyScope, TrySetProperty, TokenChild, - AuxPropertyValue, + AccessMode, CollectionId, CollectionFlags, CustomDataLimit, TokenId, CreateCollectionData, + CreateNftExData, mapping::TokenAddressMapping, budget::Budget, Property, PropertyPermission, + PropertyKey, PropertyValue, PropertyKeyPermission, Properties, PropertyScope, TrySetProperty, + TokenChild, AuxPropertyValue, }; use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; use pallet_common::{ @@ -408,7 +408,14 @@ impl Pallet { data: CreateCollectionData, is_external: bool, ) -> Result { - >::init_collection(owner, data, is_external) + >::init_collection( + owner, + data, + CollectionFlags { + external: is_external, + ..Default::default() + }, + ) } /// Destroy NFT collection diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 5f14f89584..b9bf5b9054 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -112,10 +112,10 @@ use sp_core::H160; use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome}; use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap}; use up_data_structs::{ - AccessMode, budget::Budget, CollectionId, CollectionMode, CollectionPropertiesVec, - CreateCollectionData, CustomDataLimit, mapping::TokenAddressMapping, MAX_ITEMS_PER_BATCH, - MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission, PropertyPermission, - PropertyScope, PropertyValue, TokenId, TrySetProperty, + AccessMode, budget::Budget, CollectionId, CollectionMode, CollectionFlags, + CollectionPropertiesVec, CreateCollectionData, CustomDataLimit, mapping::TokenAddressMapping, + MAX_ITEMS_PER_BATCH, MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission, + PropertyPermission, PropertyScope, PropertyValue, TokenId, TrySetProperty, }; use frame_support::BoundedBTreeMap; use derivative::Derivative; @@ -375,7 +375,7 @@ impl Pallet { owner: T::CrossAccountId, data: CreateCollectionData, ) -> Result { - >::init_collection(owner, data, false) + >::init_collection(owner, data, CollectionFlags::default()) } /// Destroy RFT collection diff --git a/primitives/data-structs/Cargo.toml b/primitives/data-structs/Cargo.toml index b0162fc187..e86d25fe1b 100644 --- a/primitives/data-structs/Cargo.toml +++ b/primitives/data-structs/Cargo.toml @@ -27,6 +27,7 @@ derivative = { version = "2.2.0", features = ["use_core"] } struct-versioning = { path = "../../crates/struct-versioning" } pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } rmrk-traits = { default-features = false, path = "../rmrk-traits" } +bondrewd = { version = "0.1.14", features = ["derive"], default-features = false } [features] default = ["std"] diff --git a/primitives/data-structs/src/bondrewd_codec.rs b/primitives/data-structs/src/bondrewd_codec.rs new file mode 100644 index 0000000000..94bd4655e2 --- /dev/null +++ b/primitives/data-structs/src/bondrewd_codec.rs @@ -0,0 +1,31 @@ +//! Integration between bondrewd and parity scale codec +//! Maybe we can move it to scale-codec itself in future? + +#[macro_export] +macro_rules! bondrewd_codec { + ($T:ty) => { + impl Encode for $T { + fn encode_to(&self, dest: &mut O) { + dest.write(&self.into_bytes()) + } + } + impl codec::Decode for $T { + fn decode(from: &mut I) -> Result { + let mut bytes = [0; Self::BYTE_SIZE]; + from.read(&mut bytes)?; + Ok(Self::from_bytes(bytes)) + } + } + impl MaxEncodedLen for $T { + fn max_encoded_len() -> usize { + Self::BYTE_SIZE + } + } + impl TypeInfo for $T { + type Identity = [u8; Self::BYTE_SIZE]; + fn type_info() -> scale_info::Type { + <[u8; Self::BYTE_SIZE] as TypeInfo>::type_info() + } + } + }; +} diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 9180f3d050..4158279598 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -36,6 +36,7 @@ use serde::{Serialize, Deserialize}; use sp_core::U256; use sp_runtime::{ArithmeticError, sp_std::prelude::Vec, Permill}; use codec::{Decode, Encode, EncodeLike, MaxEncodedLen}; +use bondrewd::Bitfields; use frame_support::{BoundedVec, traits::ConstU32}; use derivative::Derivative; use scale_info::TypeInfo; @@ -54,6 +55,7 @@ pub use rmrk_traits::{ FixedPart as RmrkFixedPart, SlotPart as RmrkSlotPart, }; +mod bondrewd_codec; mod bounded; pub mod budget; pub mod mapping; @@ -357,6 +359,21 @@ pub type CollectionName = BoundedVec>; pub type CollectionDescription = BoundedVec>; pub type CollectionTokenPrefix = BoundedVec>; +#[derive(Bitfields, Clone, Copy, PartialEq, Eq, Debug, Default)] +#[bondrewd(enforce_bytes = 1)] +pub struct CollectionFlags { + /// Tokens in foreign collections can be transferred, but not burnt + #[bondrewd(bits = "0..1")] + pub foreign: bool, + /// External collections can't be managed using `unique` api + #[bondrewd(bits = "7..8")] + pub external: bool, + + #[bondrewd(reserve, bits = "1..7")] + pub reserved: u8, +} +bondrewd_codec!(CollectionFlags); + /// Base structure for represent collection. /// /// Used to provide basic functionality for all types of collections. @@ -404,9 +421,8 @@ pub struct Collection { #[version(2.., upper(Default::default()))] pub permissions: CollectionPermissions, - /// Marks that this collection is not "unique", and managed from external. - #[version(2.., upper(false))] - pub external_collection: bool, + #[version(2.., upper(Default::default()))] + pub flags: CollectionFlags, #[version(..2)] pub variable_on_chain_schema: BoundedVec>, @@ -454,6 +470,9 @@ pub struct RpcCollection { /// Is collection read only. pub read_only: bool, + + /// Is collection is foreign. + pub foreign: bool, } /// Data used for create collection. diff --git a/primitives/data-structs/src/migration.rs b/primitives/data-structs/src/migration.rs index ab9fdc689f..cbcdbf43cc 100644 --- a/primitives/data-structs/src/migration.rs +++ b/primitives/data-structs/src/migration.rs @@ -38,3 +38,26 @@ fn sponsoring_rate_limit_has_same_encoding_as_option_u32() { test_to_option(SponsoringRateLimit::SponsoringDisabled); test_to_option(SponsoringRateLimit::Blocks(10)); } + +#[test] +fn collection_flags_have_same_encoding_as_bool() { + use crate::CollectionFlags; + use codec::Encode; + + assert_eq!( + true.encode(), + CollectionFlags { + external: true, + ..Default::default() + } + .encode() + ); + assert_eq!( + false.encode(), + CollectionFlags { + external: false, + ..Default::default() + } + .encode() + ); +} From 0141b6c776f1032859c698026a1e41298f684517 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 16 Sep 2022 15:06:21 +0000 Subject: [PATCH 0925/1274] fix: limit nesting for XCM transfers Signed-off-by: Yaroslav Bolyukin --- pallets/foreign-assets/src/impl_fungibles.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pallets/foreign-assets/src/impl_fungibles.rs b/pallets/foreign-assets/src/impl_fungibles.rs index c5aeb0e266..6980ff1f61 100644 --- a/pallets/foreign-assets/src/impl_fungibles.rs +++ b/pallets/foreign-assets/src/impl_fungibles.rs @@ -23,7 +23,7 @@ use frame_support::traits::tokens::{DepositConsequence, WithdrawConsequence}; use pallet_common::CollectionHandle; use pallet_fungible::FungibleHandle; use pallet_common::CommonCollectionOperations; -use up_data_structs::budget::Unlimited; +use up_data_structs::budget::Value; use sp_runtime::traits::{CheckedAdd, CheckedSub}; impl fungibles::Inspect<::AccountId> for Pallet @@ -313,7 +313,7 @@ where &collection, &account, amount_data, - &Unlimited, + &Value::new(0), )?; Ok(()) @@ -444,7 +444,7 @@ where &T::CrossAccountId::from_sub(source.clone()), &T::CrossAccountId::from_sub(dest.clone()), amount.into(), - &Unlimited, + &Value::new(0), )?; Ok(amount) From 0a85bcfdec34d11bb5d0212801724cdf030ebc6e Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 16 Sep 2022 15:44:43 +0000 Subject: [PATCH 0926/1274] fix(foreign-assets): make benchmarks do updates Signed-off-by: Yaroslav Bolyukin --- pallets/app-promotion/Cargo.toml | 2 - pallets/app-promotion/src/benchmarking.rs | 3 +- pallets/common/src/benchmarking.rs | 6 +- pallets/common/src/lib.rs | 2 +- pallets/foreign-assets/src/benchmarking.rs | 16 ++--- pallets/foreign-assets/src/weights.rs | 81 ++++++++++++++++++---- 6 files changed, 75 insertions(+), 35 deletions(-) diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index 8845d2be14..b78c2fe778 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -66,8 +66,6 @@ up-data-structs ={ default-features = false, path = "../../primitives/data-struc pallet-common ={ default-features = false, path = "../common" } pallet-unique ={ default-features = false, path = "../unique" } pallet-evm-contract-helpers ={ default-features = false, path = "../evm-contract-helpers" } - -[dev-dependencies] pallet-evm-migration ={ default-features = false, path = "../evm-migration" } ################################################################################ diff --git a/pallets/app-promotion/src/benchmarking.rs b/pallets/app-promotion/src/benchmarking.rs index 9e76433e4a..b9e9c7f0d8 100644 --- a/pallets/app-promotion/src/benchmarking.rs +++ b/pallets/app-promotion/src/benchmarking.rs @@ -20,11 +20,10 @@ use super::*; use crate::Pallet as PromototionPallet; use sp_runtime::traits::Bounded; -use sp_std::vec; use frame_benchmarking::{benchmarks, account}; use frame_support::traits::OnInitialize; -use frame_system::{Origin, RawOrigin}; +use frame_system::RawOrigin; use pallet_unique::benchmarking::create_nft_collection; use pallet_evm_migration::Pallet as EvmMigrationPallet; diff --git a/pallets/common/src/benchmarking.rs b/pallets/common/src/benchmarking.rs index a07b3a9a69..58466792f1 100644 --- a/pallets/common/src/benchmarking.rs +++ b/pallets/common/src/benchmarking.rs @@ -19,8 +19,8 @@ use crate::{Config, CollectionHandle, Pallet}; use pallet_evm::account::CrossAccountId; use frame_benchmarking::{benchmarks, account}; use up_data_structs::{ - CollectionMode, CreateCollectionData, CollectionId, Property, PropertyKey, PropertyValue, - CollectionPermissions, NestingPermissions, MAX_COLLECTION_NAME_LENGTH, + CollectionMode, CollectionFlags, CreateCollectionData, CollectionId, Property, PropertyKey, + PropertyValue, CollectionPermissions, NestingPermissions, MAX_COLLECTION_NAME_LENGTH, MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH, MAX_PROPERTIES_PER_ITEM, }; use frame_support::{ @@ -116,7 +116,7 @@ fn create_collection( create_collection_raw( owner, CollectionMode::NFT, - |owner, data| >::init_collection(owner, data, true), + |owner, data| >::init_collection(owner, data, CollectionFlags::default()), |h| h, ) } diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index e0a4e9df7f..cb7c49e5e6 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -346,7 +346,7 @@ pub mod pallet { use frame_support::{Blake2_128Concat, pallet_prelude::*, storage::Key, traits::StorageVersion}; use frame_system::pallet_prelude::*; use frame_support::traits::Currency; - use up_data_structs::{TokenId, mapping::TokenAddressMapping, CollectionFlags}; + use up_data_structs::{TokenId, mapping::TokenAddressMapping}; use scale_info::TypeInfo; use weights::WeightInfo; diff --git a/pallets/foreign-assets/src/benchmarking.rs b/pallets/foreign-assets/src/benchmarking.rs index e40ea3e387..1317ed2f0d 100644 --- a/pallets/foreign-assets/src/benchmarking.rs +++ b/pallets/foreign-assets/src/benchmarking.rs @@ -16,11 +16,10 @@ #![allow(missing_docs)] -use super::{Config, Pallet}; +use super::{Config, Pallet, Call}; use frame_benchmarking::{benchmarks, account}; use frame_system::RawOrigin; use crate::AssetMetadata; -use crate::Pallet as ForeignAssets; use xcm::opaque::latest::Junction::Parachain; use xcm::VersionedMultiLocation; use frame_support::{ @@ -30,7 +29,6 @@ use sp_std::boxed::Box; benchmarks! { register_foreign_asset { - let origin: RawOrigin = frame_system::RawOrigin::Root; let owner: T::AccountId = account("user", 0, 1); let location: VersionedMultiLocation = VersionedMultiLocation::from(Parachain(1000).into()); let metadata: AssetMetadata<<::Currency as Currency<::AccountId>>::Balance> = AssetMetadata{ @@ -44,12 +42,9 @@ benchmarks! { balance = balance * balance; ::Currency::make_free_balance_be(&owner, balance); - }: { - ForeignAssets::::register_foreign_asset(origin.into(), owner, Box::new(location), Box::new(metadata))? - } + }: _(RawOrigin::Root, owner, Box::new(location), Box::new(metadata)) update_foreign_asset { - let origin: RawOrigin = frame_system::RawOrigin::Root; let owner: T::AccountId = account("user", 0, 1); let location: VersionedMultiLocation = VersionedMultiLocation::from(Parachain(2000).into()); let metadata: AssetMetadata<<::Currency as Currency<::AccountId>>::Balance> = AssetMetadata{ @@ -68,9 +63,6 @@ benchmarks! { 4_000_000_000u32.into(); balance = balance * balance; ::Currency::make_free_balance_be(&owner, balance); - ForeignAssets::::register_foreign_asset(origin.clone().into(), owner, Box::new(location.clone()), Box::new(metadata))?; - - }: { - ForeignAssets::::update_foreign_asset(origin.into(), 0, Box::new(location), Box::new(metadata2))? - } + Pallet::::register_foreign_asset(RawOrigin::Root.into(), owner, Box::new(location.clone()), Box::new(metadata))?; + }: _(RawOrigin::Root, 0, Box::new(location), Box::new(metadata2)) } diff --git a/pallets/foreign-assets/src/weights.rs b/pallets/foreign-assets/src/weights.rs index 7942196cf9..cfcde0d5a8 100644 --- a/pallets/foreign-assets/src/weights.rs +++ b/pallets/foreign-assets/src/weights.rs @@ -1,43 +1,94 @@ +// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs + +//! Autogenerated weights for pallet_foreign_assets +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-09-16, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 + +// Executed Command: +// target/release/unique-collator +// benchmark +// pallet +// --pallet +// pallet-foreign-assets +// --wasm-execution +// compiled +// --extrinsic +// * +// --template +// .maintain/frame-weight-template.hbs +// --steps=50 +// --repeat=80 +// --heap-pages=4096 +// --output=./pallets/foreign-assets/src/weights.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] +#![allow(missing_docs)] #![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; -/// Weight functions needed for module_asset_registry. +/// Weight functions needed for pallet_foreign_assets. pub trait WeightInfo { fn register_foreign_asset() -> Weight; fn update_foreign_asset() -> Weight; } -/// Weights for pallet_fungible using the Substrate node and recommended hardware. +/// Weights for pallet_foreign_assets using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { + // Storage: Common CreatedCollectionCount (r:1 w:1) + // Storage: Common DestroyedCollectionCount (r:1 w:0) + // Storage: System Account (r:2 w:2) + // Storage: ForeignAssets NextForeignAssetId (r:1 w:1) + // Storage: ForeignAssets LocationToCurrencyIds (r:1 w:1) + // Storage: ForeignAssets ForeignAssetLocations (r:1 w:1) + // Storage: ForeignAssets AssetMetadatas (r:1 w:1) + // Storage: ForeignAssets AssetBinding (r:1 w:1) + // Storage: Common CollectionPropertyPermissions (r:0 w:1) + // Storage: Common CollectionProperties (r:0 w:1) + // Storage: Common CollectionById (r:0 w:1) fn register_foreign_asset() -> Weight { - (29_819_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + (52_161_000 as Weight) + .saturating_add(T::DbWeight::get().reads(9 as Weight)) + .saturating_add(T::DbWeight::get().writes(11 as Weight)) } + // Storage: ForeignAssets ForeignAssetLocations (r:1 w:1) + // Storage: ForeignAssets AssetMetadatas (r:1 w:1) fn update_foreign_asset() -> Weight { - (25_119_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + (19_111_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) } } // For backwards compatibility and tests impl WeightInfo for () { + // Storage: Common CreatedCollectionCount (r:1 w:1) + // Storage: Common DestroyedCollectionCount (r:1 w:0) + // Storage: System Account (r:2 w:2) + // Storage: ForeignAssets NextForeignAssetId (r:1 w:1) + // Storage: ForeignAssets LocationToCurrencyIds (r:1 w:1) + // Storage: ForeignAssets ForeignAssetLocations (r:1 w:1) + // Storage: ForeignAssets AssetMetadatas (r:1 w:1) + // Storage: ForeignAssets AssetBinding (r:1 w:1) + // Storage: Common CollectionPropertyPermissions (r:0 w:1) + // Storage: Common CollectionProperties (r:0 w:1) + // Storage: Common CollectionById (r:0 w:1) fn register_foreign_asset() -> Weight { - (29_819_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + (52_161_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(9 as Weight)) + .saturating_add(RocksDbWeight::get().writes(11 as Weight)) } + // Storage: ForeignAssets ForeignAssetLocations (r:1 w:1) + // Storage: ForeignAssets AssetMetadatas (r:1 w:1) fn update_foreign_asset() -> Weight { - (25_119_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + (19_111_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) } -} \ No newline at end of file +} From 4072e104889fb8539270976a107d71a564426b28 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 16 Sep 2022 15:48:38 +0000 Subject: [PATCH 0927/1274] test: regenerate types Signed-off-by: Yaroslav Bolyukin --- tests/src/interfaces/augment-api-consts.ts | 4 +- tests/src/interfaces/augment-api-errors.ts | 4 + tests/src/interfaces/augment-api-events.ts | 44 +- tests/src/interfaces/augment-api-query.ts | 47 +- tests/src/interfaces/augment-api-tx.ts | 88 ++++ tests/src/interfaces/augment-types.ts | 5 +- tests/src/interfaces/default/types.ts | 6 +- tests/src/interfaces/lookup.ts | 459 ++++++++++---------- tests/src/interfaces/registry.ts | 9 +- tests/src/interfaces/types-lookup.ts | 472 ++++++++++----------- 10 files changed, 617 insertions(+), 521 deletions(-) diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index 891142d9fa..85db5313f3 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -8,7 +8,7 @@ import '@polkadot/api-base/types/consts'; import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types'; import type { Option, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { Codec } from '@polkadot/types-codec/types'; -import type { Permill, Perbill } from '@polkadot/types/interfaces/runtime'; +import type { Perbill, Permill } from '@polkadot/types/interfaces/runtime'; import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion, XcmV1MultiLocation } from '@polkadot/types/lookup'; export type __AugmentedConst = AugmentedConst; @@ -25,7 +25,7 @@ declare module '@polkadot/api-base/types/consts' { **/ nominal: u128 & AugmentedConst; /** - * The app's pallet id, used for deriving its sovereign account ID. + * The app's pallet id, used for deriving its sovereign account address. **/ palletId: FrameSupportPalletId & AugmentedConst; /** diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 12934b8e1c..08a2157a7a 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -302,6 +302,10 @@ declare module '@polkadot/api-base/types/errors' { * This method is only executable by contract owner **/ NoPermission: AugmentedError; + /** + * Number of methods that sponsored limit is defined for exceeds maximum. + **/ + TooManyMethodsHaveSponsoredLimit: AugmentedError; /** * Generic error **/ diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index 5942a42343..88b44476eb 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -20,14 +20,14 @@ declare module '@polkadot/api-base/types/events' { * The admin was set * * # Arguments - * * AccountId: ID of the admin + * * AccountId: account address of the admin **/ SetAdmin: AugmentedEvent; /** * Staking was performed * * # Arguments - * * AccountId: ID of the staker + * * AccountId: account of the staker * * Balance : staking amount **/ Stake: AugmentedEvent; @@ -35,7 +35,7 @@ declare module '@polkadot/api-base/types/events' { * Staking recalculation was performed * * # Arguments - * * AccountId: ID of the staker. + * * AccountId: account of the staker. * * Balance : recalculation base * * Balance : total income **/ @@ -44,7 +44,7 @@ declare module '@polkadot/api-base/types/events' { * Unstaking was performed * * # Arguments - * * AccountId: ID of the staker + * * AccountId: account of the staker * * Balance : unstaking amount **/ Unstake: AugmentedEvent; @@ -246,6 +246,24 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; + evmContractHelpers: { + /** + * Collection sponsor was removed. + **/ + ContractSponsorRemoved: AugmentedEvent; + /** + * Contract sponsor was set. + **/ + ContractSponsorSet: AugmentedEvent; + /** + * New sponsor was confirm. + **/ + ContractSponsorshipConfirmed: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; foreignAssets: { /** * The asset registered. @@ -267,24 +285,6 @@ declare module '@polkadot/api-base/types/events' { * Generic event **/ [key: string]: AugmentedEvent; - }, - evmContractHelpers: { - /** - * Collection sponsor was removed. - **/ - ContractSponsorRemoved: AugmentedEvent; - /** - * Contract sponsor was set. - **/ - ContractSponsorSet: AugmentedEvent; - /** - * New sponsor was confirm. - **/ - ContractSponsorshipConfirmed: AugmentedEvent; - /** - * Generic event - **/ - [key: string]: AugmentedEvent; }; parachainSystem: { /** diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index 1a244331b2..a51dfbea7e 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -5,13 +5,11 @@ // this is required to allow for ambient/previous definitions import '@polkadot/api-base/types/storage'; - - import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types'; import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime'; -import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, PalletForeignAssetsAssetIds, XcmV1MultiLocation, PalletForeignAssetsModuleAssetMetadata, OrmlTokensAccountData, OrmlTokensReserveData } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup'; import type { Observable } from '@polkadot/types/types'; export type __AugmentedQuery = AugmentedQuery unknown>; @@ -20,21 +18,41 @@ export type __QueryableStorageEntry = QueryableStorage declare module '@polkadot/api-base/types/storage' { interface AugmentedQueries { appPromotion: { + /** + * Stores the `admin` account. Some extrinsics can only be executed if they were signed by `admin`. + **/ admin: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Stores a key for record for which the next revenue recalculation would be performed. * If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers. **/ nextCalculatedRecord: AugmentedQuery Observable>>, []> & QueryableStorageEntry; + /** + * Stores amount of stakes for an `Account`. + * + * * **Key** - Staker account. + * * **Value** - Amount of stakes. + **/ pendingUnstake: AugmentedQuery Observable>>, [u32]> & QueryableStorageEntry; /** - * Amount of tokens staked by account in the blocknumber. + * Stores the amount of tokens staked by account in the blocknumber. + * + * * **Key1** - Staker account. + * * **Key2** - Relay block number when the stake was made. + * * **(Balance, BlockNumber)** - Balance of the stake. + * The number of the relay block in which we must perform the interest recalculation **/ staked: AugmentedQuery Observable>, [AccountId32, u32]> & QueryableStorageEntry; /** - * Amount of stakes for an Account + * Stores amount of stakes for an `Account`. + * + * * **Key** - Staker account. + * * **Value** - Amount of stakes. **/ stakesPerAccount: AugmentedQuery Observable, [AccountId32]> & QueryableStorageEntry; + /** + * Stores the total staked amount. + **/ totalStaked: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Generic query @@ -247,13 +265,6 @@ declare module '@polkadot/api-base/types/storage' { **/ owner: AugmentedQuery Observable, [H160]> & QueryableStorageEntry; selfSponsoring: AugmentedQuery Observable, [H160]> & QueryableStorageEntry; - /** - * Storage for last sponsored block. - * - * * **Key1** - contract address. - * * **Key2** - sponsored user address. - * * **Value** - last sponsored block number. - **/ sponsorBasket: AugmentedQuery Observable>, [H160, H160]> & QueryableStorageEntry; /** * Store for contract sponsorship state. @@ -262,6 +273,14 @@ declare module '@polkadot/api-base/types/storage' { * * **Value** - sponsorship state. **/ sponsoring: AugmentedQuery Observable, [H160]> & QueryableStorageEntry; + /** + * Storage for last sponsored block. + * + * * **Key1** - contract address. + * * **Key2** - sponsored user address. + * * **Value** - last sponsored block number. + **/ + sponsoringFeeLimit: AugmentedQuery Observable>, [H160]> & QueryableStorageEntry; /** * Store for sponsoring mode. * @@ -335,10 +354,6 @@ declare module '@polkadot/api-base/types/storage' { * Amount of tokens owned by an account inside a collection. **/ balance: AugmentedQuery Observable, [u32, PalletEvmAccountBasicCrossAccountIdRepr]> & QueryableStorageEntry; - /** - * Foreign collection flag - **/ - foreignCollection: AugmentedQuery Observable, [u32]> & QueryableStorageEntry; /** * Total amount of fungible tokens inside a collection. **/ diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index ab86d78daf..f37ca55a43 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -18,13 +18,101 @@ export type __SubmittableExtrinsicFunction = Submittab declare module '@polkadot/api-base/types/submittable' { interface AugmentedSubmittables { appPromotion: { + /** + * Recalculates interest for the specified number of stakers. + * If all stakers are not recalculated, the next call of the extrinsic + * will continue the recalculation, from those stakers for whom this + * was not perform in last call. + * + * # Permissions + * + * * Pallet admin + * + * # Arguments + * + * * `stakers_number`: the number of stakers for which recalculation will be performed + **/ payoutStakers: AugmentedSubmittable<(stakersNumber: Option | null | Uint8Array | u8 | AnyNumber) => SubmittableExtrinsic, [Option]>; + /** + * Sets an address as the the admin. + * + * # Permissions + * + * * Sudo + * + * # Arguments + * + * * `admin`: account of the new admin. + **/ setAdminAddress: AugmentedSubmittable<(admin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic, [PalletEvmAccountBasicCrossAccountIdRepr]>; + /** + * Sets the pallet to be the sponsor for the collection. + * + * # Permissions + * + * * Pallet admin + * + * # Arguments + * + * * `collection_id`: ID of the collection that will be sponsored by `pallet_id` + **/ sponsorCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; + /** + * Sets the pallet to be the sponsor for the contract. + * + * # Permissions + * + * * Pallet admin + * + * # Arguments + * + * * `contract_id`: the contract address that will be sponsored by `pallet_id` + **/ sponsorContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; + /** + * Stakes the amount of native tokens. + * Sets `amount` to the locked state. + * The maximum number of stakes for a staker is 10. + * + * # Arguments + * + * * `amount`: in native tokens. + **/ stake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; + /** + * Removes the pallet as the sponsor for the collection. + * Returns [`NoPermission`][`Error::NoPermission`] + * if the pallet wasn't the sponsor. + * + * # Permissions + * + * * Pallet admin + * + * # Arguments + * + * * `collection_id`: ID of the collection that is sponsored by `pallet_id` + **/ stopSponsoringCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; + /** + * Removes the pallet as the sponsor for the contract. + * Returns [`NoPermission`][`Error::NoPermission`] + * if the pallet wasn't the sponsor. + * + * # Permissions + * + * * Pallet admin + * + * # Arguments + * + * * `contract_id`: the contract address that is sponsored by `pallet_id` + **/ stopSponsoringContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic, [H160]>; + /** + * Unstakes all stakes. + * Moves the sum of all stakes to the `reserved` state. + * After the end of `PendingInterval` this sum becomes completely + * free for further use. + **/ unstake: AugmentedSubmittable<() => SubmittableExtrinsic, []>; /** * Generic tx diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index 57ac449b9b..fc21f21948 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -5,10 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; - -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm, - OrmlTokensAccountData,OrmlTokensBalanceLock,OrmlTokensModuleCall,OrmlTokensModuleError,OrmlTokensModuleEvent,OrmlTokensReserveData,OrmlXtokensModuleCall,OrmlXtokensModuleError,OrmlXtokensModuleEvent, - PalletForeignAssetsAssetIds,PalletForeignAssetsModuleAssetMetadata,PalletForeignAssetsModuleCall,PalletForeignAssetsModuleError,PalletForeignAssetsModuleEvent,PalletForeignAssetsNativeCurrency, XcmVersionedMultiAsset } from './default'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index ac042abb45..38f5af1a5e 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -1426,7 +1426,8 @@ export interface PalletEvmCoderSubstrateError extends Enum { export interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly isNoPendingSponsor: boolean; - readonly type: 'NoPermission' | 'NoPendingSponsor'; + readonly isTooManyMethodsHaveSponsoredLimit: boolean; + readonly type: 'NoPermission' | 'NoPendingSponsor' | 'TooManyMethodsHaveSponsoredLimit'; } /** @name PalletEvmContractHelpersEvent */ @@ -2809,7 +2810,7 @@ export interface UpDataStructsCollection extends Struct { readonly sponsorship: UpDataStructsSponsorshipStateAccountId32; readonly limits: UpDataStructsCollectionLimits; readonly permissions: UpDataStructsCollectionPermissions; - readonly externalCollection: bool; + readonly flags: U8aFixed; } /** @name UpDataStructsCollectionLimits */ @@ -2983,6 +2984,7 @@ export interface UpDataStructsRpcCollection extends Struct { readonly tokenPropertyPermissions: Vec; readonly properties: Vec; readonly readOnly: bool; + readonly foreign: bool; } /** @name UpDataStructsSponsoringRateLimit */ diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index d129130f7c..adfff5ceab 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -1162,7 +1162,18 @@ export default { } }, /** - * Lookup107: pallet_foreign_assets::module::Event + * Lookup107: pallet_app_promotion::pallet::Event + **/ + PalletAppPromotionEvent: { + _enum: { + StakingRecalculation: '(AccountId32,u128,u128)', + Stake: '(AccountId32,u128)', + Unstake: '(AccountId32,u128)', + SetAdmin: 'AccountId32' + } + }, + /** + * Lookup108: pallet_foreign_assets::module::Event **/ PalletForeignAssetsModuleEvent: { _enum: { @@ -1187,7 +1198,7 @@ export default { } }, /** - * Lookup108: pallet_foreign_assets::module::AssetMetadata + * Lookup109: pallet_foreign_assets::module::AssetMetadata **/ PalletForeignAssetsModuleAssetMetadata: { name: 'Bytes', @@ -1196,19 +1207,7 @@ export default { minimalBalance: 'u128' }, /** - * Lookup109: pallet_evm::pallet::Event - * Lookup103: pallet_app_promotion::pallet::Event - **/ - PalletAppPromotionEvent: { - _enum: { - StakingRecalculation: '(AccountId32,u128,u128)', - Stake: '(AccountId32,u128)', - Unstake: '(AccountId32,u128)', - SetAdmin: 'AccountId32' - } - }, - /** - * Lookup104: pallet_evm::pallet::Event + * Lookup110: pallet_evm::pallet::Event **/ PalletEvmEvent: { _enum: { @@ -1222,7 +1221,7 @@ export default { } }, /** - * Lookup105: ethereum::log::Log + * Lookup111: ethereum::log::Log **/ EthereumLog: { address: 'H160', @@ -1230,7 +1229,7 @@ export default { data: 'Bytes' }, /** - * Lookup109: pallet_ethereum::pallet::Event + * Lookup115: pallet_ethereum::pallet::Event **/ PalletEthereumEvent: { _enum: { @@ -1238,7 +1237,7 @@ export default { } }, /** - * Lookup110: evm_core::error::ExitReason + * Lookup116: evm_core::error::ExitReason **/ EvmCoreErrorExitReason: { _enum: { @@ -1249,13 +1248,13 @@ export default { } }, /** - * Lookup111: evm_core::error::ExitSucceed + * Lookup117: evm_core::error::ExitSucceed **/ EvmCoreErrorExitSucceed: { _enum: ['Stopped', 'Returned', 'Suicided'] }, /** - * Lookup112: evm_core::error::ExitError + * Lookup118: evm_core::error::ExitError **/ EvmCoreErrorExitError: { _enum: { @@ -1277,13 +1276,13 @@ export default { } }, /** - * Lookup115: evm_core::error::ExitRevert + * Lookup121: evm_core::error::ExitRevert **/ EvmCoreErrorExitRevert: { _enum: ['Reverted'] }, /** - * Lookup116: evm_core::error::ExitFatal + * Lookup122: evm_core::error::ExitFatal **/ EvmCoreErrorExitFatal: { _enum: { @@ -1294,7 +1293,7 @@ export default { } }, /** - * Lookup117: pallet_evm_contract_helpers::pallet::Event + * Lookup123: pallet_evm_contract_helpers::pallet::Event **/ PalletEvmContractHelpersEvent: { _enum: { @@ -1304,7 +1303,7 @@ export default { } }, /** - * Lookup118: frame_system::Phase + * Lookup124: frame_system::Phase **/ FrameSystemPhase: { _enum: { @@ -1314,14 +1313,14 @@ export default { } }, /** - * Lookup120: frame_system::LastRuntimeUpgradeInfo + * Lookup126: frame_system::LastRuntimeUpgradeInfo **/ FrameSystemLastRuntimeUpgradeInfo: { specVersion: 'Compact', specName: 'Text' }, /** - * Lookup121: frame_system::pallet::Call + * Lookup127: frame_system::pallet::Call **/ FrameSystemCall: { _enum: { @@ -1359,7 +1358,7 @@ export default { } }, /** - * Lookup126: frame_system::limits::BlockWeights + * Lookup132: frame_system::limits::BlockWeights **/ FrameSystemLimitsBlockWeights: { baseBlock: 'u64', @@ -1367,7 +1366,7 @@ export default { perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass' }, /** - * Lookup127: frame_support::weights::PerDispatchClass + * Lookup133: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassWeightsPerClass: { normal: 'FrameSystemLimitsWeightsPerClass', @@ -1375,7 +1374,7 @@ export default { mandatory: 'FrameSystemLimitsWeightsPerClass' }, /** - * Lookup128: frame_system::limits::WeightsPerClass + * Lookup134: frame_system::limits::WeightsPerClass **/ FrameSystemLimitsWeightsPerClass: { baseExtrinsic: 'u64', @@ -1384,13 +1383,13 @@ export default { reserved: 'Option' }, /** - * Lookup130: frame_system::limits::BlockLength + * Lookup136: frame_system::limits::BlockLength **/ FrameSystemLimitsBlockLength: { max: 'FrameSupportWeightsPerDispatchClassU32' }, /** - * Lookup131: frame_support::weights::PerDispatchClass + * Lookup137: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassU32: { normal: 'u32', @@ -1398,14 +1397,14 @@ export default { mandatory: 'u32' }, /** - * Lookup132: frame_support::weights::RuntimeDbWeight + * Lookup138: frame_support::weights::RuntimeDbWeight **/ FrameSupportWeightsRuntimeDbWeight: { read: 'u64', write: 'u64' }, /** - * Lookup133: sp_version::RuntimeVersion + * Lookup139: sp_version::RuntimeVersion **/ SpVersionRuntimeVersion: { specName: 'Text', @@ -1418,13 +1417,13 @@ export default { stateVersion: 'u8' }, /** - * Lookup138: frame_system::pallet::Error + * Lookup144: frame_system::pallet::Error **/ FrameSystemError: { _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] }, /** - * Lookup139: polkadot_primitives::v2::PersistedValidationData + * Lookup145: polkadot_primitives::v2::PersistedValidationData **/ PolkadotPrimitivesV2PersistedValidationData: { parentHead: 'Bytes', @@ -1433,19 +1432,19 @@ export default { maxPovSize: 'u32' }, /** - * Lookup142: polkadot_primitives::v2::UpgradeRestriction + * Lookup148: polkadot_primitives::v2::UpgradeRestriction **/ PolkadotPrimitivesV2UpgradeRestriction: { _enum: ['Present'] }, /** - * Lookup143: sp_trie::storage_proof::StorageProof + * Lookup149: sp_trie::storage_proof::StorageProof **/ SpTrieStorageProof: { trieNodes: 'BTreeSet' }, /** - * Lookup145: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot + * Lookup151: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot **/ CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: { dmqMqcHead: 'H256', @@ -1454,7 +1453,7 @@ export default { egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>' }, /** - * Lookup148: polkadot_primitives::v2::AbridgedHrmpChannel + * Lookup154: polkadot_primitives::v2::AbridgedHrmpChannel **/ PolkadotPrimitivesV2AbridgedHrmpChannel: { maxCapacity: 'u32', @@ -1465,7 +1464,7 @@ export default { mqcHead: 'Option' }, /** - * Lookup149: polkadot_primitives::v2::AbridgedHostConfiguration + * Lookup155: polkadot_primitives::v2::AbridgedHostConfiguration **/ PolkadotPrimitivesV2AbridgedHostConfiguration: { maxCodeSize: 'u32', @@ -1479,14 +1478,14 @@ export default { validationUpgradeDelay: 'u32' }, /** - * Lookup155: polkadot_core_primitives::OutboundHrmpMessage + * Lookup161: polkadot_core_primitives::OutboundHrmpMessage **/ PolkadotCorePrimitivesOutboundHrmpMessage: { recipient: 'u32', data: 'Bytes' }, /** - * Lookup156: cumulus_pallet_parachain_system::pallet::Call + * Lookup162: cumulus_pallet_parachain_system::pallet::Call **/ CumulusPalletParachainSystemCall: { _enum: { @@ -1505,7 +1504,7 @@ export default { } }, /** - * Lookup157: cumulus_primitives_parachain_inherent::ParachainInherentData + * Lookup163: cumulus_primitives_parachain_inherent::ParachainInherentData **/ CumulusPrimitivesParachainInherentParachainInherentData: { validationData: 'PolkadotPrimitivesV2PersistedValidationData', @@ -1514,27 +1513,27 @@ export default { horizontalMessages: 'BTreeMap>' }, /** - * Lookup159: polkadot_core_primitives::InboundDownwardMessage + * Lookup165: polkadot_core_primitives::InboundDownwardMessage **/ PolkadotCorePrimitivesInboundDownwardMessage: { sentAt: 'u32', msg: 'Bytes' }, /** - * Lookup162: polkadot_core_primitives::InboundHrmpMessage + * Lookup168: polkadot_core_primitives::InboundHrmpMessage **/ PolkadotCorePrimitivesInboundHrmpMessage: { sentAt: 'u32', data: 'Bytes' }, /** - * Lookup165: cumulus_pallet_parachain_system::pallet::Error + * Lookup171: cumulus_pallet_parachain_system::pallet::Error **/ CumulusPalletParachainSystemError: { _enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized'] }, /** - * Lookup167: pallet_balances::BalanceLock + * Lookup173: pallet_balances::BalanceLock **/ PalletBalancesBalanceLock: { id: '[u8;8]', @@ -1542,26 +1541,26 @@ export default { reasons: 'PalletBalancesReasons' }, /** - * Lookup168: pallet_balances::Reasons + * Lookup174: pallet_balances::Reasons **/ PalletBalancesReasons: { _enum: ['Fee', 'Misc', 'All'] }, /** - * Lookup171: pallet_balances::ReserveData + * Lookup177: pallet_balances::ReserveData **/ PalletBalancesReserveData: { id: '[u8;16]', amount: 'u128' }, /** - * Lookup173: pallet_balances::Releases + * Lookup179: pallet_balances::Releases **/ PalletBalancesReleases: { _enum: ['V1_0_0', 'V2_0_0'] }, /** - * Lookup174: pallet_balances::pallet::Call + * Lookup180: pallet_balances::pallet::Call **/ PalletBalancesCall: { _enum: { @@ -1594,13 +1593,13 @@ export default { } }, /** - * Lookup177: pallet_balances::pallet::Error + * Lookup183: pallet_balances::pallet::Error **/ PalletBalancesError: { _enum: ['VestingBalance', 'LiquidityRestrictions', 'InsufficientBalance', 'ExistentialDeposit', 'KeepAlive', 'ExistingVestingSchedule', 'DeadAccount', 'TooManyReserves'] }, /** - * Lookup179: pallet_timestamp::pallet::Call + * Lookup185: pallet_timestamp::pallet::Call **/ PalletTimestampCall: { _enum: { @@ -1610,13 +1609,13 @@ export default { } }, /** - * Lookup181: pallet_transaction_payment::Releases + * Lookup187: pallet_transaction_payment::Releases **/ PalletTransactionPaymentReleases: { _enum: ['V1Ancient', 'V2'] }, /** - * Lookup182: pallet_treasury::Proposal + * Lookup188: pallet_treasury::Proposal **/ PalletTreasuryProposal: { proposer: 'AccountId32', @@ -1625,7 +1624,7 @@ export default { bond: 'u128' }, /** - * Lookup185: pallet_treasury::pallet::Call + * Lookup191: pallet_treasury::pallet::Call **/ PalletTreasuryCall: { _enum: { @@ -1649,17 +1648,17 @@ export default { } }, /** - * Lookup188: frame_support::PalletId + * Lookup194: frame_support::PalletId **/ FrameSupportPalletId: '[u8;8]', /** - * Lookup189: pallet_treasury::pallet::Error + * Lookup195: pallet_treasury::pallet::Error **/ PalletTreasuryError: { _enum: ['InsufficientProposersBalance', 'InvalidIndex', 'TooManyApprovals', 'InsufficientPermission', 'ProposalNotApproved'] }, /** - * Lookup190: pallet_sudo::pallet::Call + * Lookup196: pallet_sudo::pallet::Call **/ PalletSudoCall: { _enum: { @@ -1683,7 +1682,7 @@ export default { } }, /** - * Lookup192: orml_vesting::module::Call + * Lookup198: orml_vesting::module::Call **/ OrmlVestingModuleCall: { _enum: { @@ -1702,7 +1701,7 @@ export default { } }, /** - * Lookup198: orml_xtokens::module::Call + * Lookup200: orml_xtokens::module::Call **/ OrmlXtokensModuleCall: { _enum: { @@ -1745,7 +1744,7 @@ export default { } }, /** - * Lookup199: xcm::VersionedMultiAsset + * Lookup201: xcm::VersionedMultiAsset **/ XcmVersionedMultiAsset: { _enum: { @@ -1754,7 +1753,7 @@ export default { } }, /** - * Lookup202: orml_tokens::module::Call + * Lookup204: orml_tokens::module::Call **/ OrmlTokensModuleCall: { _enum: { @@ -1788,7 +1787,7 @@ export default { } }, /** - * Lookup203: cumulus_pallet_xcmp_queue::pallet::Call + * Lookup205: cumulus_pallet_xcmp_queue::pallet::Call **/ CumulusPalletXcmpQueueCall: { _enum: { @@ -1837,7 +1836,7 @@ export default { } }, /** - * Lookup195: pallet_xcm::pallet::Call + * Lookup206: pallet_xcm::pallet::Call **/ PalletXcmCall: { _enum: { @@ -1891,7 +1890,7 @@ export default { } }, /** - * Lookup196: xcm::VersionedXcm + * Lookup207: xcm::VersionedXcm **/ XcmVersionedXcm: { _enum: { @@ -1901,7 +1900,7 @@ export default { } }, /** - * Lookup197: xcm::v0::Xcm + * Lookup208: xcm::v0::Xcm **/ XcmV0Xcm: { _enum: { @@ -1955,7 +1954,7 @@ export default { } }, /** - * Lookup199: xcm::v0::order::Order + * Lookup210: xcm::v0::order::Order **/ XcmV0Order: { _enum: { @@ -1998,7 +1997,7 @@ export default { } }, /** - * Lookup201: xcm::v0::Response + * Lookup212: xcm::v0::Response **/ XcmV0Response: { _enum: { @@ -2006,7 +2005,7 @@ export default { } }, /** - * Lookup202: xcm::v1::Xcm + * Lookup213: xcm::v1::Xcm **/ XcmV1Xcm: { _enum: { @@ -2065,7 +2064,7 @@ export default { } }, /** - * Lookup204: xcm::v1::order::Order + * Lookup215: xcm::v1::order::Order **/ XcmV1Order: { _enum: { @@ -2110,7 +2109,7 @@ export default { } }, /** - * Lookup206: xcm::v1::Response + * Lookup217: xcm::v1::Response **/ XcmV1Response: { _enum: { @@ -2119,11 +2118,11 @@ export default { } }, /** - * Lookup220: cumulus_pallet_xcm::pallet::Call + * Lookup231: cumulus_pallet_xcm::pallet::Call **/ CumulusPalletXcmCall: 'Null', /** - * Lookup221: cumulus_pallet_dmp_queue::pallet::Call + * Lookup232: cumulus_pallet_dmp_queue::pallet::Call **/ CumulusPalletDmpQueueCall: { _enum: { @@ -2134,7 +2133,7 @@ export default { } }, /** - * Lookup222: pallet_inflation::pallet::Call + * Lookup233: pallet_inflation::pallet::Call **/ PalletInflationCall: { _enum: { @@ -2144,7 +2143,7 @@ export default { } }, /** - * Lookup223: pallet_unique::Call + * Lookup234: pallet_unique::Call **/ PalletUniqueCall: { _enum: { @@ -2276,7 +2275,7 @@ export default { } }, /** - * Lookup228: up_data_structs::CollectionMode + * Lookup239: up_data_structs::CollectionMode **/ UpDataStructsCollectionMode: { _enum: { @@ -2286,7 +2285,7 @@ export default { } }, /** - * Lookup229: up_data_structs::CreateCollectionData + * Lookup240: up_data_structs::CreateCollectionData **/ UpDataStructsCreateCollectionData: { mode: 'UpDataStructsCollectionMode', @@ -2301,13 +2300,13 @@ export default { properties: 'Vec' }, /** - * Lookup231: up_data_structs::AccessMode + * Lookup242: up_data_structs::AccessMode **/ UpDataStructsAccessMode: { _enum: ['Normal', 'AllowList'] }, /** - * Lookup233: up_data_structs::CollectionLimits + * Lookup244: up_data_structs::CollectionLimits **/ UpDataStructsCollectionLimits: { accountTokenOwnershipLimit: 'Option', @@ -2321,7 +2320,7 @@ export default { transfersEnabled: 'Option' }, /** - * Lookup235: up_data_structs::SponsoringRateLimit + * Lookup246: up_data_structs::SponsoringRateLimit **/ UpDataStructsSponsoringRateLimit: { _enum: { @@ -2330,7 +2329,7 @@ export default { } }, /** - * Lookup238: up_data_structs::CollectionPermissions + * Lookup249: up_data_structs::CollectionPermissions **/ UpDataStructsCollectionPermissions: { access: 'Option', @@ -2338,7 +2337,7 @@ export default { nesting: 'Option' }, /** - * Lookup240: up_data_structs::NestingPermissions + * Lookup251: up_data_structs::NestingPermissions **/ UpDataStructsNestingPermissions: { tokenOwner: 'bool', @@ -2346,18 +2345,18 @@ export default { restricted: 'Option' }, /** - * Lookup242: up_data_structs::OwnerRestrictedSet + * Lookup253: up_data_structs::OwnerRestrictedSet **/ UpDataStructsOwnerRestrictedSet: 'BTreeSet', /** - * Lookup247: up_data_structs::PropertyKeyPermission + * Lookup258: up_data_structs::PropertyKeyPermission **/ UpDataStructsPropertyKeyPermission: { key: 'Bytes', permission: 'UpDataStructsPropertyPermission' }, /** - * Lookup248: up_data_structs::PropertyPermission + * Lookup259: up_data_structs::PropertyPermission **/ UpDataStructsPropertyPermission: { mutable: 'bool', @@ -2365,14 +2364,14 @@ export default { tokenOwner: 'bool' }, /** - * Lookup251: up_data_structs::Property + * Lookup262: up_data_structs::Property **/ UpDataStructsProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup254: up_data_structs::CreateItemData + * Lookup265: up_data_structs::CreateItemData **/ UpDataStructsCreateItemData: { _enum: { @@ -2382,26 +2381,26 @@ export default { } }, /** - * Lookup255: up_data_structs::CreateNftData + * Lookup266: up_data_structs::CreateNftData **/ UpDataStructsCreateNftData: { properties: 'Vec' }, /** - * Lookup256: up_data_structs::CreateFungibleData + * Lookup267: up_data_structs::CreateFungibleData **/ UpDataStructsCreateFungibleData: { value: 'u128' }, /** - * Lookup257: up_data_structs::CreateReFungibleData + * Lookup268: up_data_structs::CreateReFungibleData **/ UpDataStructsCreateReFungibleData: { pieces: 'u128', properties: 'Vec' }, /** - * Lookup260: up_data_structs::CreateItemExData> + * Lookup271: up_data_structs::CreateItemExData> **/ UpDataStructsCreateItemExData: { _enum: { @@ -2412,14 +2411,14 @@ export default { } }, /** - * Lookup262: up_data_structs::CreateNftExData> + * Lookup273: up_data_structs::CreateNftExData> **/ UpDataStructsCreateNftExData: { properties: 'Vec', owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup269: up_data_structs::CreateRefungibleExSingleOwner> + * Lookup280: up_data_structs::CreateRefungibleExSingleOwner> **/ UpDataStructsCreateRefungibleExSingleOwner: { user: 'PalletEvmAccountBasicCrossAccountIdRepr', @@ -2427,14 +2426,14 @@ export default { properties: 'Vec' }, /** - * Lookup271: up_data_structs::CreateRefungibleExMultipleOwners> + * Lookup282: up_data_structs::CreateRefungibleExMultipleOwners> **/ UpDataStructsCreateRefungibleExMultipleOwners: { users: 'BTreeMap', properties: 'Vec' }, /** - * Lookup272: pallet_unique_scheduler::pallet::Call + * Lookup283: pallet_unique_scheduler::pallet::Call **/ PalletUniqueSchedulerCall: { _enum: { @@ -2458,7 +2457,7 @@ export default { } }, /** - * Lookup274: frame_support::traits::schedule::MaybeHashed + * Lookup285: frame_support::traits::schedule::MaybeHashed **/ FrameSupportScheduleMaybeHashed: { _enum: { @@ -2467,7 +2466,7 @@ export default { } }, /** - * Lookup275: pallet_configuration::pallet::Call + * Lookup286: pallet_configuration::pallet::Call **/ PalletConfigurationCall: { _enum: { @@ -2480,15 +2479,15 @@ export default { } }, /** - * Lookup276: pallet_template_transaction_payment::Call + * Lookup287: pallet_template_transaction_payment::Call **/ PalletTemplateTransactionPaymentCall: 'Null', /** - * Lookup277: pallet_structure::pallet::Call + * Lookup288: pallet_structure::pallet::Call **/ PalletStructureCall: 'Null', /** - * Lookup278: pallet_rmrk_core::pallet::Call + * Lookup289: pallet_rmrk_core::pallet::Call **/ PalletRmrkCoreCall: { _enum: { @@ -2579,7 +2578,7 @@ export default { } }, /** - * Lookup284: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup295: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceTypes: { _enum: { @@ -2589,7 +2588,7 @@ export default { } }, /** - * Lookup286: rmrk_traits::resource::BasicResource> + * Lookup297: rmrk_traits::resource::BasicResource> **/ RmrkTraitsResourceBasicResource: { src: 'Option', @@ -2598,7 +2597,7 @@ export default { thumb: 'Option' }, /** - * Lookup288: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup299: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceComposableResource: { parts: 'Vec', @@ -2609,7 +2608,7 @@ export default { thumb: 'Option' }, /** - * Lookup289: rmrk_traits::resource::SlotResource> + * Lookup300: rmrk_traits::resource::SlotResource> **/ RmrkTraitsResourceSlotResource: { base: 'u32', @@ -2620,7 +2619,7 @@ export default { thumb: 'Option' }, /** - * Lookup292: pallet_rmrk_equip::pallet::Call + * Lookup303: pallet_rmrk_equip::pallet::Call **/ PalletRmrkEquipCall: { _enum: { @@ -2641,7 +2640,7 @@ export default { } }, /** - * Lookup295: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup306: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPartPartType: { _enum: { @@ -2650,7 +2649,7 @@ export default { } }, /** - * Lookup297: rmrk_traits::part::FixedPart> + * Lookup308: rmrk_traits::part::FixedPart> **/ RmrkTraitsPartFixedPart: { id: 'u32', @@ -2658,7 +2657,7 @@ export default { src: 'Bytes' }, /** - * Lookup298: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup309: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPartSlotPart: { id: 'u32', @@ -2667,7 +2666,7 @@ export default { z: 'u32' }, /** - * Lookup299: rmrk_traits::part::EquippableList> + * Lookup310: rmrk_traits::part::EquippableList> **/ RmrkTraitsPartEquippableList: { _enum: { @@ -2677,7 +2676,7 @@ export default { } }, /** - * Lookup301: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> + * Lookup312: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> **/ RmrkTraitsTheme: { name: 'Bytes', @@ -2685,31 +2684,14 @@ export default { inherit: 'bool' }, /** - * Lookup303: rmrk_traits::theme::ThemeProperty> + * Lookup314: rmrk_traits::theme::ThemeProperty> **/ RmrkTraitsThemeThemeProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup314: pallet_foreign_assets::module::Call - **/ - PalletForeignAssetsModuleCall: { - _enum: { - register_foreign_asset: { - owner: 'AccountId32', - location: 'XcmVersionedMultiLocation', - metadata: 'PalletForeignAssetsModuleAssetMetadata', - }, - update_foreign_asset: { - foreignAssetId: 'u32', - location: 'XcmVersionedMultiLocation', - metadata: 'PalletForeignAssetsModuleAssetMetadata' - } - } - }, - /** - * Lookup305: pallet_app_promotion::pallet::Call + * Lookup316: pallet_app_promotion::pallet::Call **/ PalletAppPromotionCall: { _enum: { @@ -2738,7 +2720,24 @@ export default { } }, /** - * Lookup307: pallet_evm::pallet::Call + * Lookup318: pallet_foreign_assets::module::Call + **/ + PalletForeignAssetsModuleCall: { + _enum: { + register_foreign_asset: { + owner: 'AccountId32', + location: 'XcmVersionedMultiLocation', + metadata: 'PalletForeignAssetsModuleAssetMetadata', + }, + update_foreign_asset: { + foreignAssetId: 'u32', + location: 'XcmVersionedMultiLocation', + metadata: 'PalletForeignAssetsModuleAssetMetadata' + } + } + }, + /** + * Lookup319: pallet_evm::pallet::Call **/ PalletEvmCall: { _enum: { @@ -2781,7 +2780,7 @@ export default { } }, /** - * Lookup311: pallet_ethereum::pallet::Call + * Lookup323: pallet_ethereum::pallet::Call **/ PalletEthereumCall: { _enum: { @@ -2791,7 +2790,7 @@ export default { } }, /** - * Lookup312: ethereum::transaction::TransactionV2 + * Lookup324: ethereum::transaction::TransactionV2 **/ EthereumTransactionTransactionV2: { _enum: { @@ -2801,7 +2800,7 @@ export default { } }, /** - * Lookup313: ethereum::transaction::LegacyTransaction + * Lookup325: ethereum::transaction::LegacyTransaction **/ EthereumTransactionLegacyTransaction: { nonce: 'U256', @@ -2813,7 +2812,7 @@ export default { signature: 'EthereumTransactionTransactionSignature' }, /** - * Lookup314: ethereum::transaction::TransactionAction + * Lookup326: ethereum::transaction::TransactionAction **/ EthereumTransactionTransactionAction: { _enum: { @@ -2822,7 +2821,7 @@ export default { } }, /** - * Lookup315: ethereum::transaction::TransactionSignature + * Lookup327: ethereum::transaction::TransactionSignature **/ EthereumTransactionTransactionSignature: { v: 'u64', @@ -2830,7 +2829,7 @@ export default { s: 'H256' }, /** - * Lookup317: ethereum::transaction::EIP2930Transaction + * Lookup329: ethereum::transaction::EIP2930Transaction **/ EthereumTransactionEip2930Transaction: { chainId: 'u64', @@ -2846,14 +2845,14 @@ export default { s: 'H256' }, /** - * Lookup319: ethereum::transaction::AccessListItem + * Lookup331: ethereum::transaction::AccessListItem **/ EthereumTransactionAccessListItem: { address: 'H160', storageKeys: 'Vec' }, /** - * Lookup320: ethereum::transaction::EIP1559Transaction + * Lookup332: ethereum::transaction::EIP1559Transaction **/ EthereumTransactionEip1559Transaction: { chainId: 'u64', @@ -2870,7 +2869,7 @@ export default { s: 'H256' }, /** - * Lookup321: pallet_evm_migration::pallet::Call + * Lookup333: pallet_evm_migration::pallet::Call **/ PalletEvmMigrationCall: { _enum: { @@ -2888,32 +2887,32 @@ export default { } }, /** - * Lookup324: pallet_sudo::pallet::Error + * Lookup336: pallet_sudo::pallet::Error **/ PalletSudoError: { _enum: ['RequireSudo'] }, /** - * Lookup326: orml_vesting::module::Error + * Lookup338: orml_vesting::module::Error **/ OrmlVestingModuleError: { _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded'] }, /** - * Lookup335: orml_xtokens::module::Error + * Lookup339: orml_xtokens::module::Error **/ OrmlXtokensModuleError: { _enum: ['AssetHasNoReserve', 'NotCrossChainTransfer', 'InvalidDest', 'NotCrossChainTransferableCurrency', 'UnweighableMessage', 'XcmExecutionFailed', 'CannotReanchor', 'InvalidAncestry', 'InvalidAsset', 'DestinationNotInvertible', 'BadVersion', 'DistinctReserveForAssetAndFee', 'ZeroFee', 'ZeroAmount', 'TooManyAssetsBeingSent', 'AssetIndexNonExistent', 'FeeNotEnough', 'NotSupportedMultiLocation', 'MinXcmFeeNotDefined'] }, /** - * Lookup338: orml_tokens::BalanceLock + * Lookup342: orml_tokens::BalanceLock **/ OrmlTokensBalanceLock: { id: '[u8;8]', amount: 'u128' }, /** - * Lookup340: orml_tokens::AccountData + * Lookup344: orml_tokens::AccountData **/ OrmlTokensAccountData: { free: 'u128', @@ -2921,20 +2920,20 @@ export default { frozen: 'u128' }, /** - * Lookup342: orml_tokens::ReserveData + * Lookup346: orml_tokens::ReserveData **/ OrmlTokensReserveData: { id: 'Null', amount: 'u128' }, /** - * Lookup344: orml_tokens::module::Error + * Lookup348: orml_tokens::module::Error **/ OrmlTokensModuleError: { _enum: ['BalanceTooLow', 'AmountIntoBalanceFailed', 'LiquidityRestrictions', 'MaxLocksExceeded', 'KeepAlive', 'ExistentialDeposit', 'DeadAccount', 'TooManyReserves'] }, /** - * Lookup346: cumulus_pallet_xcmp_queue::InboundChannelDetails + * Lookup350: cumulus_pallet_xcmp_queue::InboundChannelDetails **/ CumulusPalletXcmpQueueInboundChannelDetails: { sender: 'u32', @@ -2942,19 +2941,19 @@ export default { messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>' }, /** - * Lookup329: cumulus_pallet_xcmp_queue::InboundState + * Lookup351: cumulus_pallet_xcmp_queue::InboundState **/ CumulusPalletXcmpQueueInboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup332: polkadot_parachain::primitives::XcmpMessageFormat + * Lookup354: polkadot_parachain::primitives::XcmpMessageFormat **/ PolkadotParachainPrimitivesXcmpMessageFormat: { _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals'] }, /** - * Lookup335: cumulus_pallet_xcmp_queue::OutboundChannelDetails + * Lookup357: cumulus_pallet_xcmp_queue::OutboundChannelDetails **/ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: 'u32', @@ -2964,13 +2963,13 @@ export default { lastIndex: 'u16' }, /** - * Lookup336: cumulus_pallet_xcmp_queue::OutboundState + * Lookup358: cumulus_pallet_xcmp_queue::OutboundState **/ CumulusPalletXcmpQueueOutboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup338: cumulus_pallet_xcmp_queue::QueueConfigData + * Lookup360: cumulus_pallet_xcmp_queue::QueueConfigData **/ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: 'u32', @@ -2981,29 +2980,29 @@ export default { xcmpMaxIndividualWeight: 'u64' }, /** - * Lookup340: cumulus_pallet_xcmp_queue::pallet::Error + * Lookup362: cumulus_pallet_xcmp_queue::pallet::Error **/ CumulusPalletXcmpQueueError: { _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit'] }, /** - * Lookup341: pallet_xcm::pallet::Error + * Lookup363: pallet_xcm::pallet::Error **/ PalletXcmError: { _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed'] }, /** - * Lookup342: cumulus_pallet_xcm::pallet::Error + * Lookup364: cumulus_pallet_xcm::pallet::Error **/ CumulusPalletXcmError: 'Null', /** - * Lookup343: cumulus_pallet_dmp_queue::ConfigData + * Lookup365: cumulus_pallet_dmp_queue::ConfigData **/ CumulusPalletDmpQueueConfigData: { maxIndividual: 'u64' }, /** - * Lookup344: cumulus_pallet_dmp_queue::PageIndexData + * Lookup366: cumulus_pallet_dmp_queue::PageIndexData **/ CumulusPalletDmpQueuePageIndexData: { beginUsed: 'u32', @@ -3011,19 +3010,19 @@ export default { overweightCount: 'u64' }, /** - * Lookup347: cumulus_pallet_dmp_queue::pallet::Error + * Lookup369: cumulus_pallet_dmp_queue::pallet::Error **/ CumulusPalletDmpQueueError: { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup351: pallet_unique::Error + * Lookup373: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup354: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> + * Lookup376: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> **/ PalletUniqueSchedulerScheduledV3: { maybeId: 'Option<[u8;16]>', @@ -3033,7 +3032,7 @@ export default { origin: 'OpalRuntimeOriginCaller' }, /** - * Lookup355: opal_runtime::OriginCaller + * Lookup377: opal_runtime::OriginCaller **/ OpalRuntimeOriginCaller: { _enum: { @@ -3142,7 +3141,7 @@ export default { } }, /** - * Lookup356: frame_support::dispatch::RawOrigin + * Lookup378: frame_support::dispatch::RawOrigin **/ FrameSupportDispatchRawOrigin: { _enum: { @@ -3152,7 +3151,7 @@ export default { } }, /** - * Lookup357: pallet_xcm::pallet::Origin + * Lookup379: pallet_xcm::pallet::Origin **/ PalletXcmOrigin: { _enum: { @@ -3161,7 +3160,7 @@ export default { } }, /** - * Lookup358: cumulus_pallet_xcm::pallet::Origin + * Lookup380: cumulus_pallet_xcm::pallet::Origin **/ CumulusPalletXcmOrigin: { _enum: { @@ -3170,7 +3169,7 @@ export default { } }, /** - * Lookup359: pallet_ethereum::RawOrigin + * Lookup381: pallet_ethereum::RawOrigin **/ PalletEthereumRawOrigin: { _enum: { @@ -3178,17 +3177,17 @@ export default { } }, /** - * Lookup360: sp_core::Void + * Lookup382: sp_core::Void **/ SpCoreVoid: 'Null', /** - * Lookup361: pallet_unique_scheduler::pallet::Error + * Lookup383: pallet_unique_scheduler::pallet::Error **/ PalletUniqueSchedulerError: { _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] }, /** - * Lookup362: up_data_structs::Collection + * Lookup384: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -3199,10 +3198,10 @@ export default { sponsorship: 'UpDataStructsSponsorshipStateAccountId32', limits: 'UpDataStructsCollectionLimits', permissions: 'UpDataStructsCollectionPermissions', - externalCollection: 'bool' + flags: '[u8;1]' }, /** - * Lookup363: up_data_structs::SponsorshipState + * Lookup385: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipStateAccountId32: { _enum: { @@ -3212,7 +3211,7 @@ export default { } }, /** - * Lookup364: up_data_structs::Properties + * Lookup387: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -3220,15 +3219,15 @@ export default { spaceLimit: 'u32' }, /** - * Lookup365: up_data_structs::PropertiesMap> + * Lookup388: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** - * Lookup370: up_data_structs::PropertiesMap + * Lookup393: up_data_structs::PropertiesMap **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup377: up_data_structs::CollectionStats + * Lookup400: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -3236,18 +3235,18 @@ export default { alive: 'u32' }, /** - * Lookup378: up_data_structs::TokenChild + * Lookup401: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup379: PhantomType::up_data_structs + * Lookup402: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup381: up_data_structs::TokenData> + * Lookup404: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -3255,7 +3254,7 @@ export default { pieces: 'u128' }, /** - * Lookup383: up_data_structs::RpcCollection + * Lookup406: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -3268,10 +3267,11 @@ export default { permissions: 'UpDataStructsCollectionPermissions', tokenPropertyPermissions: 'Vec', properties: 'Vec', - readOnly: 'bool' + readOnly: 'bool', + foreign: 'bool' }, /** - * Lookup384: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup407: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -3281,7 +3281,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup385: rmrk_traits::nft::NftInfo> + * Lookup408: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -3291,14 +3291,14 @@ export default { pending: 'bool' }, /** - * Lookup387: rmrk_traits::nft::RoyaltyInfo + * Lookup410: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup388: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup411: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -3307,14 +3307,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup389: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup412: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup390: rmrk_traits::base::BaseInfo> + * Lookup413: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -3322,93 +3322,92 @@ export default { symbol: 'Bytes' }, /** - * Lookup391: rmrk_traits::nft::NftChild + * Lookup414: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup393: pallet_common::pallet::Error + * Lookup416: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup395: pallet_fungible::pallet::Error + * Lookup418: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup396: pallet_refungible::ItemData + * Lookup419: pallet_refungible::ItemData **/ PalletRefungibleItemData: { constData: 'Bytes' }, /** - * Lookup401: pallet_refungible::pallet::Error + * Lookup424: pallet_refungible::pallet::Error **/ PalletRefungibleError: { _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup402: pallet_nonfungible::ItemData> + * Lookup425: pallet_nonfungible::ItemData> **/ PalletNonfungibleItemData: { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup404: up_data_structs::PropertyScope + * Lookup427: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { _enum: ['None', 'Rmrk'] }, /** - * Lookup406: pallet_nonfungible::pallet::Error + * Lookup429: pallet_nonfungible::pallet::Error **/ PalletNonfungibleError: { _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup407: pallet_structure::pallet::Error + * Lookup430: pallet_structure::pallet::Error **/ PalletStructureError: { _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup408: pallet_rmrk_core::pallet::Error + * Lookup431: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** - * Lookup410: pallet_rmrk_equip::pallet::Error + * Lookup433: pallet_rmrk_equip::pallet::Error **/ PalletRmrkEquipError: { _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] }, /** - * Lookup429: pallet_foreign_assets::module::Error + * Lookup439: pallet_app_promotion::pallet::Error **/ - PalletForeignAssetsModuleError: { - _enum: ['BadLocation', 'MultiLocationExisted', 'AssetIdNotExists', 'AssetIdExisted'] + PalletAppPromotionError: { + _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'SponsorNotSet', 'IncorrectLockedBalanceOperation'] }, /** - * Lookup432: pallet_evm::pallet::Error - * Lookup416: pallet_app_promotion::pallet::Error + * Lookup440: pallet_foreign_assets::module::Error **/ - PalletAppPromotionError: { - _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'SponsorNotSet', 'IncorrectLockedBalanceOperation'] + PalletForeignAssetsModuleError: { + _enum: ['BadLocation', 'MultiLocationExisted', 'AssetIdNotExists', 'AssetIdExisted'] }, /** - * Lookup419: pallet_evm::pallet::Error + * Lookup443: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup422: fp_rpc::TransactionStatus + * Lookup446: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -3420,11 +3419,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup424: ethbloom::Bloom + * Lookup448: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup426: ethereum::receipt::ReceiptV3 + * Lookup450: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -3434,7 +3433,7 @@ export default { } }, /** - * Lookup427: ethereum::receipt::EIP658ReceiptData + * Lookup451: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -3443,7 +3442,7 @@ export default { logs: 'Vec' }, /** - * Lookup428: ethereum::block::Block + * Lookup452: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -3451,7 +3450,7 @@ export default { ommers: 'Vec' }, /** - * Lookup429: ethereum::header::Header + * Lookup453: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -3471,23 +3470,23 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup430: ethereum_types::hash::H64 + * Lookup454: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup435: pallet_ethereum::pallet::Error + * Lookup459: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup436: pallet_evm_coder_substrate::pallet::Error + * Lookup460: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup437: up_data_structs::SponsorshipState> + * Lookup461: up_data_structs::SponsorshipState> **/ UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: { _enum: { @@ -3497,25 +3496,25 @@ export default { } }, /** - * Lookup438: pallet_evm_contract_helpers::SponsoringModeT + * Lookup462: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup440: pallet_evm_contract_helpers::pallet::Error + * Lookup468: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { - _enum: ['NoPermission', 'NoPendingSponsor'] + _enum: ['NoPermission', 'NoPendingSponsor', 'TooManyMethodsHaveSponsoredLimit'] }, /** - * Lookup441: pallet_evm_migration::pallet::Error + * Lookup469: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup443: sp_runtime::MultiSignature + * Lookup471: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3525,43 +3524,43 @@ export default { } }, /** - * Lookup444: sp_core::ed25519::Signature + * Lookup472: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup446: sp_core::sr25519::Signature + * Lookup474: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup447: sp_core::ecdsa::Signature + * Lookup475: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup450: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup478: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup451: frame_system::extensions::check_genesis::CheckGenesis + * Lookup479: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup454: frame_system::extensions::check_nonce::CheckNonce + * Lookup482: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup455: frame_system::extensions::check_weight::CheckWeight + * Lookup483: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup456: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup484: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup457: opal_runtime::Runtime + * Lookup485: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup458: pallet_ethereum::FakeTransactionFinalizer + * Lookup486: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index abfb79f587..24e02077cb 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -5,14 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; - - - import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, - CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, - CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, OrmlXtokensModuleCall, OrmlXtokensModuleError, - OrmlXtokensModuleEvent, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, - XcmVersionedMultiAsset, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, - CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { interface InterfaceTypes { diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 44d9f9080f..014d26efae 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1314,7 +1314,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'BaseCreated' | 'EquippablesUpdated'; } - /** @name PalletForeignAssetsModuleEvent (107) */ + /** @name PalletAppPromotionEvent (107) */ + interface PalletAppPromotionEvent extends Enum { + readonly isStakingRecalculation: boolean; + readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>; + readonly isStake: boolean; + readonly asStake: ITuple<[AccountId32, u128]>; + readonly isUnstake: boolean; + readonly asUnstake: ITuple<[AccountId32, u128]>; + readonly isSetAdmin: boolean; + readonly asSetAdmin: AccountId32; + readonly type: 'StakingRecalculation' | 'Stake' | 'Unstake' | 'SetAdmin'; + } + + /** @name PalletForeignAssetsModuleEvent (108) */ interface PalletForeignAssetsModuleEvent extends Enum { readonly isForeignAssetRegistered: boolean; readonly asForeignAssetRegistered: { @@ -1341,7 +1354,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ForeignAssetRegistered' | 'ForeignAssetUpdated' | 'AssetRegistered' | 'AssetUpdated'; } - /** @name PalletForeignAssetsModuleAssetMetadata (108) */ + /** @name PalletForeignAssetsModuleAssetMetadata (109) */ interface PalletForeignAssetsModuleAssetMetadata extends Struct { readonly name: Bytes; readonly symbol: Bytes; @@ -1349,21 +1362,7 @@ declare module '@polkadot/types/lookup' { readonly minimalBalance: u128; } - /** @name PalletEvmEvent (109) */ - /** @name PalletAppPromotionEvent (103) */ - interface PalletAppPromotionEvent extends Enum { - readonly isStakingRecalculation: boolean; - readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>; - readonly isStake: boolean; - readonly asStake: ITuple<[AccountId32, u128]>; - readonly isUnstake: boolean; - readonly asUnstake: ITuple<[AccountId32, u128]>; - readonly isSetAdmin: boolean; - readonly asSetAdmin: AccountId32; - readonly type: 'StakingRecalculation' | 'Stake' | 'Unstake' | 'SetAdmin'; - } - - /** @name PalletEvmEvent (104) */ + /** @name PalletEvmEvent (110) */ interface PalletEvmEvent extends Enum { readonly isLog: boolean; readonly asLog: EthereumLog; @@ -1382,21 +1381,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; } - /** @name EthereumLog (105) */ + /** @name EthereumLog (111) */ interface EthereumLog extends Struct { readonly address: H160; readonly topics: Vec; readonly data: Bytes; } - /** @name PalletEthereumEvent (109) */ + /** @name PalletEthereumEvent (115) */ interface PalletEthereumEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; readonly type: 'Executed'; } - /** @name EvmCoreErrorExitReason (110) */ + /** @name EvmCoreErrorExitReason (116) */ interface EvmCoreErrorExitReason extends Enum { readonly isSucceed: boolean; readonly asSucceed: EvmCoreErrorExitSucceed; @@ -1409,7 +1408,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; } - /** @name EvmCoreErrorExitSucceed (111) */ + /** @name EvmCoreErrorExitSucceed (117) */ interface EvmCoreErrorExitSucceed extends Enum { readonly isStopped: boolean; readonly isReturned: boolean; @@ -1417,7 +1416,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Stopped' | 'Returned' | 'Suicided'; } - /** @name EvmCoreErrorExitError (112) */ + /** @name EvmCoreErrorExitError (118) */ interface EvmCoreErrorExitError extends Enum { readonly isStackUnderflow: boolean; readonly isStackOverflow: boolean; @@ -1438,13 +1437,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; } - /** @name EvmCoreErrorExitRevert (115) */ + /** @name EvmCoreErrorExitRevert (121) */ interface EvmCoreErrorExitRevert extends Enum { readonly isReverted: boolean; readonly type: 'Reverted'; } - /** @name EvmCoreErrorExitFatal (116) */ + /** @name EvmCoreErrorExitFatal (122) */ interface EvmCoreErrorExitFatal extends Enum { readonly isNotSupported: boolean; readonly isUnhandledInterrupt: boolean; @@ -1455,8 +1454,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; } - /** @name FrameSystemPhase (122) */ - /** @name PalletEvmContractHelpersEvent (117) */ + /** @name PalletEvmContractHelpersEvent (123) */ interface PalletEvmContractHelpersEvent extends Enum { readonly isContractSponsorSet: boolean; readonly asContractSponsorSet: ITuple<[H160, AccountId32]>; @@ -1467,7 +1465,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ContractSponsorSet' | 'ContractSponsorshipConfirmed' | 'ContractSponsorRemoved'; } - /** @name FrameSystemPhase (118) */ + /** @name FrameSystemPhase (124) */ interface FrameSystemPhase extends Enum { readonly isApplyExtrinsic: boolean; readonly asApplyExtrinsic: u32; @@ -1476,13 +1474,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } - /** @name FrameSystemLastRuntimeUpgradeInfo (120) */ + /** @name FrameSystemLastRuntimeUpgradeInfo (126) */ interface FrameSystemLastRuntimeUpgradeInfo extends Struct { readonly specVersion: Compact; readonly specName: Text; } - /** @name FrameSystemCall (121) */ + /** @name FrameSystemCall (127) */ interface FrameSystemCall extends Enum { readonly isFillBlock: boolean; readonly asFillBlock: { @@ -1524,21 +1522,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent'; } - /** @name FrameSystemLimitsBlockWeights (126) */ + /** @name FrameSystemLimitsBlockWeights (132) */ interface FrameSystemLimitsBlockWeights extends Struct { readonly baseBlock: u64; readonly maxBlock: u64; readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; } - /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (127) */ + /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (133) */ interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { readonly normal: FrameSystemLimitsWeightsPerClass; readonly operational: FrameSystemLimitsWeightsPerClass; readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name FrameSystemLimitsWeightsPerClass (128) */ + /** @name FrameSystemLimitsWeightsPerClass (134) */ interface FrameSystemLimitsWeightsPerClass extends Struct { readonly baseExtrinsic: u64; readonly maxExtrinsic: Option; @@ -1546,25 +1544,25 @@ declare module '@polkadot/types/lookup' { readonly reserved: Option; } - /** @name FrameSystemLimitsBlockLength (130) */ + /** @name FrameSystemLimitsBlockLength (136) */ interface FrameSystemLimitsBlockLength extends Struct { readonly max: FrameSupportWeightsPerDispatchClassU32; } - /** @name FrameSupportWeightsPerDispatchClassU32 (131) */ + /** @name FrameSupportWeightsPerDispatchClassU32 (137) */ interface FrameSupportWeightsPerDispatchClassU32 extends Struct { readonly normal: u32; readonly operational: u32; readonly mandatory: u32; } - /** @name FrameSupportWeightsRuntimeDbWeight (132) */ + /** @name FrameSupportWeightsRuntimeDbWeight (138) */ interface FrameSupportWeightsRuntimeDbWeight extends Struct { readonly read: u64; readonly write: u64; } - /** @name SpVersionRuntimeVersion (133) */ + /** @name SpVersionRuntimeVersion (139) */ interface SpVersionRuntimeVersion extends Struct { readonly specName: Text; readonly implName: Text; @@ -1576,7 +1574,7 @@ declare module '@polkadot/types/lookup' { readonly stateVersion: u8; } - /** @name FrameSystemError (138) */ + /** @name FrameSystemError (144) */ interface FrameSystemError extends Enum { readonly isInvalidSpecName: boolean; readonly isSpecVersionNeedsToIncrease: boolean; @@ -1587,7 +1585,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name PolkadotPrimitivesV2PersistedValidationData (139) */ + /** @name PolkadotPrimitivesV2PersistedValidationData (145) */ interface PolkadotPrimitivesV2PersistedValidationData extends Struct { readonly parentHead: Bytes; readonly relayParentNumber: u32; @@ -1595,18 +1593,18 @@ declare module '@polkadot/types/lookup' { readonly maxPovSize: u32; } - /** @name PolkadotPrimitivesV2UpgradeRestriction (142) */ + /** @name PolkadotPrimitivesV2UpgradeRestriction (148) */ interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { readonly isPresent: boolean; readonly type: 'Present'; } - /** @name SpTrieStorageProof (143) */ + /** @name SpTrieStorageProof (149) */ interface SpTrieStorageProof extends Struct { readonly trieNodes: BTreeSet; } - /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (145) */ + /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (151) */ interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { readonly dmqMqcHead: H256; readonly relayDispatchQueueSize: ITuple<[u32, u32]>; @@ -1614,7 +1612,7 @@ declare module '@polkadot/types/lookup' { readonly egressChannels: Vec>; } - /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (148) */ + /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (154) */ interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { readonly maxCapacity: u32; readonly maxTotalSize: u32; @@ -1624,7 +1622,7 @@ declare module '@polkadot/types/lookup' { readonly mqcHead: Option; } - /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (149) */ + /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (155) */ interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { readonly maxCodeSize: u32; readonly maxHeadDataSize: u32; @@ -1637,13 +1635,13 @@ declare module '@polkadot/types/lookup' { readonly validationUpgradeDelay: u32; } - /** @name PolkadotCorePrimitivesOutboundHrmpMessage (155) */ + /** @name PolkadotCorePrimitivesOutboundHrmpMessage (161) */ interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { readonly recipient: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemCall (156) */ + /** @name CumulusPalletParachainSystemCall (162) */ interface CumulusPalletParachainSystemCall extends Enum { readonly isSetValidationData: boolean; readonly asSetValidationData: { @@ -1664,7 +1662,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade'; } - /** @name CumulusPrimitivesParachainInherentParachainInherentData (157) */ + /** @name CumulusPrimitivesParachainInherentParachainInherentData (163) */ interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { readonly validationData: PolkadotPrimitivesV2PersistedValidationData; readonly relayChainState: SpTrieStorageProof; @@ -1672,19 +1670,19 @@ declare module '@polkadot/types/lookup' { readonly horizontalMessages: BTreeMap>; } - /** @name PolkadotCorePrimitivesInboundDownwardMessage (159) */ + /** @name PolkadotCorePrimitivesInboundDownwardMessage (165) */ interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { readonly sentAt: u32; readonly msg: Bytes; } - /** @name PolkadotCorePrimitivesInboundHrmpMessage (162) */ + /** @name PolkadotCorePrimitivesInboundHrmpMessage (168) */ interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { readonly sentAt: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemError (165) */ + /** @name CumulusPalletParachainSystemError (171) */ interface CumulusPalletParachainSystemError extends Enum { readonly isOverlappingUpgrades: boolean; readonly isProhibitedByPolkadot: boolean; @@ -1697,14 +1695,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized'; } - /** @name PalletBalancesBalanceLock (167) */ + /** @name PalletBalancesBalanceLock (173) */ interface PalletBalancesBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; readonly reasons: PalletBalancesReasons; } - /** @name PalletBalancesReasons (168) */ + /** @name PalletBalancesReasons (174) */ interface PalletBalancesReasons extends Enum { readonly isFee: boolean; readonly isMisc: boolean; @@ -1712,20 +1710,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'Fee' | 'Misc' | 'All'; } - /** @name PalletBalancesReserveData (171) */ + /** @name PalletBalancesReserveData (177) */ interface PalletBalancesReserveData extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name PalletBalancesReleases (173) */ + /** @name PalletBalancesReleases (179) */ interface PalletBalancesReleases extends Enum { readonly isV100: boolean; readonly isV200: boolean; readonly type: 'V100' | 'V200'; } - /** @name PalletBalancesCall (174) */ + /** @name PalletBalancesCall (180) */ interface PalletBalancesCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1762,7 +1760,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; } - /** @name PalletBalancesError (177) */ + /** @name PalletBalancesError (183) */ interface PalletBalancesError extends Enum { readonly isVestingBalance: boolean; readonly isLiquidityRestrictions: boolean; @@ -1775,7 +1773,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves'; } - /** @name PalletTimestampCall (179) */ + /** @name PalletTimestampCall (185) */ interface PalletTimestampCall extends Enum { readonly isSet: boolean; readonly asSet: { @@ -1784,14 +1782,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Set'; } - /** @name PalletTransactionPaymentReleases (181) */ + /** @name PalletTransactionPaymentReleases (187) */ interface PalletTransactionPaymentReleases extends Enum { readonly isV1Ancient: boolean; readonly isV2: boolean; readonly type: 'V1Ancient' | 'V2'; } - /** @name PalletTreasuryProposal (182) */ + /** @name PalletTreasuryProposal (188) */ interface PalletTreasuryProposal extends Struct { readonly proposer: AccountId32; readonly value: u128; @@ -1799,7 +1797,7 @@ declare module '@polkadot/types/lookup' { readonly bond: u128; } - /** @name PalletTreasuryCall (185) */ + /** @name PalletTreasuryCall (191) */ interface PalletTreasuryCall extends Enum { readonly isProposeSpend: boolean; readonly asProposeSpend: { @@ -1826,10 +1824,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval'; } - /** @name FrameSupportPalletId (188) */ + /** @name FrameSupportPalletId (194) */ interface FrameSupportPalletId extends U8aFixed {} - /** @name PalletTreasuryError (189) */ + /** @name PalletTreasuryError (195) */ interface PalletTreasuryError extends Enum { readonly isInsufficientProposersBalance: boolean; readonly isInvalidIndex: boolean; @@ -1839,7 +1837,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved'; } - /** @name PalletSudoCall (190) */ + /** @name PalletSudoCall (196) */ interface PalletSudoCall extends Enum { readonly isSudo: boolean; readonly asSudo: { @@ -1862,7 +1860,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs'; } - /** @name OrmlVestingModuleCall (192) */ + /** @name OrmlVestingModuleCall (198) */ interface OrmlVestingModuleCall extends Enum { readonly isClaim: boolean; readonly isVestedTransfer: boolean; @@ -1882,7 +1880,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor'; } - /** @name OrmlXtokensModuleCall (198) */ + /** @name OrmlXtokensModuleCall (200) */ interface OrmlXtokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1929,7 +1927,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'TransferMultiasset' | 'TransferWithFee' | 'TransferMultiassetWithFee' | 'TransferMulticurrencies' | 'TransferMultiassets'; } - /** @name XcmVersionedMultiAsset (199) */ + /** @name XcmVersionedMultiAsset (201) */ interface XcmVersionedMultiAsset extends Enum { readonly isV0: boolean; readonly asV0: XcmV0MultiAsset; @@ -1938,7 +1936,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1'; } - /** @name OrmlTokensModuleCall (202) */ + /** @name OrmlTokensModuleCall (204) */ interface OrmlTokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1975,7 +1973,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'TransferAll' | 'TransferKeepAlive' | 'ForceTransfer' | 'SetBalance'; } - /** @name CumulusPalletXcmpQueueCall (203) */ + /** @name CumulusPalletXcmpQueueCall (205) */ interface CumulusPalletXcmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { @@ -2011,7 +2009,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight'; } - /** @name PalletXcmCall (195) */ + /** @name PalletXcmCall (206) */ interface PalletXcmCall extends Enum { readonly isSend: boolean; readonly asSend: { @@ -2073,7 +2071,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets'; } - /** @name XcmVersionedXcm (196) */ + /** @name XcmVersionedXcm (207) */ interface XcmVersionedXcm extends Enum { readonly isV0: boolean; readonly asV0: XcmV0Xcm; @@ -2084,7 +2082,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1' | 'V2'; } - /** @name XcmV0Xcm (197) */ + /** @name XcmV0Xcm (208) */ interface XcmV0Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -2147,7 +2145,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom'; } - /** @name XcmV0Order (199) */ + /** @name XcmV0Order (210) */ interface XcmV0Order extends Enum { readonly isNull: boolean; readonly isDepositAsset: boolean; @@ -2195,14 +2193,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV0Response (201) */ + /** @name XcmV0Response (212) */ interface XcmV0Response extends Enum { readonly isAssets: boolean; readonly asAssets: Vec; readonly type: 'Assets'; } - /** @name XcmV1Xcm (202) */ + /** @name XcmV1Xcm (213) */ interface XcmV1Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -2271,7 +2269,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion'; } - /** @name XcmV1Order (204) */ + /** @name XcmV1Order (215) */ interface XcmV1Order extends Enum { readonly isNoop: boolean; readonly isDepositAsset: boolean; @@ -2321,7 +2319,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV1Response (206) */ + /** @name XcmV1Response (217) */ interface XcmV1Response extends Enum { readonly isAssets: boolean; readonly asAssets: XcmV1MultiassetMultiAssets; @@ -2330,10 +2328,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'Assets' | 'Version'; } - /** @name CumulusPalletXcmCall (220) */ + /** @name CumulusPalletXcmCall (231) */ type CumulusPalletXcmCall = Null; - /** @name CumulusPalletDmpQueueCall (221) */ + /** @name CumulusPalletDmpQueueCall (232) */ interface CumulusPalletDmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { @@ -2343,7 +2341,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight'; } - /** @name PalletInflationCall (222) */ + /** @name PalletInflationCall (233) */ interface PalletInflationCall extends Enum { readonly isStartInflation: boolean; readonly asStartInflation: { @@ -2352,7 +2350,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'StartInflation'; } - /** @name PalletUniqueCall (223) */ + /** @name PalletUniqueCall (234) */ interface PalletUniqueCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -2510,7 +2508,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; } - /** @name UpDataStructsCollectionMode (228) */ + /** @name UpDataStructsCollectionMode (239) */ interface UpDataStructsCollectionMode extends Enum { readonly isNft: boolean; readonly isFungible: boolean; @@ -2519,7 +2517,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateCollectionData (229) */ + /** @name UpDataStructsCreateCollectionData (240) */ interface UpDataStructsCreateCollectionData extends Struct { readonly mode: UpDataStructsCollectionMode; readonly access: Option; @@ -2533,14 +2531,14 @@ declare module '@polkadot/types/lookup' { readonly properties: Vec; } - /** @name UpDataStructsAccessMode (231) */ + /** @name UpDataStructsAccessMode (242) */ interface UpDataStructsAccessMode extends Enum { readonly isNormal: boolean; readonly isAllowList: boolean; readonly type: 'Normal' | 'AllowList'; } - /** @name UpDataStructsCollectionLimits (233) */ + /** @name UpDataStructsCollectionLimits (244) */ interface UpDataStructsCollectionLimits extends Struct { readonly accountTokenOwnershipLimit: Option; readonly sponsoredDataSize: Option; @@ -2553,7 +2551,7 @@ declare module '@polkadot/types/lookup' { readonly transfersEnabled: Option; } - /** @name UpDataStructsSponsoringRateLimit (235) */ + /** @name UpDataStructsSponsoringRateLimit (246) */ interface UpDataStructsSponsoringRateLimit extends Enum { readonly isSponsoringDisabled: boolean; readonly isBlocks: boolean; @@ -2561,43 +2559,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'SponsoringDisabled' | 'Blocks'; } - /** @name UpDataStructsCollectionPermissions (238) */ + /** @name UpDataStructsCollectionPermissions (249) */ interface UpDataStructsCollectionPermissions extends Struct { readonly access: Option; readonly mintMode: Option; readonly nesting: Option; } - /** @name UpDataStructsNestingPermissions (240) */ + /** @name UpDataStructsNestingPermissions (251) */ interface UpDataStructsNestingPermissions extends Struct { readonly tokenOwner: bool; readonly collectionAdmin: bool; readonly restricted: Option; } - /** @name UpDataStructsOwnerRestrictedSet (242) */ + /** @name UpDataStructsOwnerRestrictedSet (253) */ interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} - /** @name UpDataStructsPropertyKeyPermission (247) */ + /** @name UpDataStructsPropertyKeyPermission (258) */ interface UpDataStructsPropertyKeyPermission extends Struct { readonly key: Bytes; readonly permission: UpDataStructsPropertyPermission; } - /** @name UpDataStructsPropertyPermission (248) */ + /** @name UpDataStructsPropertyPermission (259) */ interface UpDataStructsPropertyPermission extends Struct { readonly mutable: bool; readonly collectionAdmin: bool; readonly tokenOwner: bool; } - /** @name UpDataStructsProperty (251) */ + /** @name UpDataStructsProperty (262) */ interface UpDataStructsProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name UpDataStructsCreateItemData (254) */ + /** @name UpDataStructsCreateItemData (265) */ interface UpDataStructsCreateItemData extends Enum { readonly isNft: boolean; readonly asNft: UpDataStructsCreateNftData; @@ -2608,23 +2606,23 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateNftData (255) */ + /** @name UpDataStructsCreateNftData (266) */ interface UpDataStructsCreateNftData extends Struct { readonly properties: Vec; } - /** @name UpDataStructsCreateFungibleData (256) */ + /** @name UpDataStructsCreateFungibleData (267) */ interface UpDataStructsCreateFungibleData extends Struct { readonly value: u128; } - /** @name UpDataStructsCreateReFungibleData (257) */ + /** @name UpDataStructsCreateReFungibleData (268) */ interface UpDataStructsCreateReFungibleData extends Struct { readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateItemExData (260) */ + /** @name UpDataStructsCreateItemExData (271) */ interface UpDataStructsCreateItemExData extends Enum { readonly isNft: boolean; readonly asNft: Vec; @@ -2637,26 +2635,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; } - /** @name UpDataStructsCreateNftExData (262) */ + /** @name UpDataStructsCreateNftExData (273) */ interface UpDataStructsCreateNftExData extends Struct { readonly properties: Vec; readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsCreateRefungibleExSingleOwner (269) */ + /** @name UpDataStructsCreateRefungibleExSingleOwner (280) */ interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { readonly user: PalletEvmAccountBasicCrossAccountIdRepr; readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateRefungibleExMultipleOwners (271) */ + /** @name UpDataStructsCreateRefungibleExMultipleOwners (282) */ interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { readonly users: BTreeMap; readonly properties: Vec; } - /** @name PalletUniqueSchedulerCall (272) */ + /** @name PalletUniqueSchedulerCall (283) */ interface PalletUniqueSchedulerCall extends Enum { readonly isScheduleNamed: boolean; readonly asScheduleNamed: { @@ -2681,7 +2679,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; } - /** @name FrameSupportScheduleMaybeHashed (274) */ + /** @name FrameSupportScheduleMaybeHashed (285) */ interface FrameSupportScheduleMaybeHashed extends Enum { readonly isValue: boolean; readonly asValue: Call; @@ -2690,7 +2688,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Value' | 'Hash'; } - /** @name PalletConfigurationCall (275) */ + /** @name PalletConfigurationCall (286) */ interface PalletConfigurationCall extends Enum { readonly isSetWeightToFeeCoefficientOverride: boolean; readonly asSetWeightToFeeCoefficientOverride: { @@ -2703,13 +2701,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride'; } - /** @name PalletTemplateTransactionPaymentCall (276) */ + /** @name PalletTemplateTransactionPaymentCall (287) */ type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletStructureCall (277) */ + /** @name PalletStructureCall (288) */ type PalletStructureCall = Null; - /** @name PalletRmrkCoreCall (278) */ + /** @name PalletRmrkCoreCall (289) */ interface PalletRmrkCoreCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -2815,7 +2813,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; } - /** @name RmrkTraitsResourceResourceTypes (284) */ + /** @name RmrkTraitsResourceResourceTypes (295) */ interface RmrkTraitsResourceResourceTypes extends Enum { readonly isBasic: boolean; readonly asBasic: RmrkTraitsResourceBasicResource; @@ -2826,7 +2824,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Basic' | 'Composable' | 'Slot'; } - /** @name RmrkTraitsResourceBasicResource (286) */ + /** @name RmrkTraitsResourceBasicResource (297) */ interface RmrkTraitsResourceBasicResource extends Struct { readonly src: Option; readonly metadata: Option; @@ -2834,7 +2832,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceComposableResource (288) */ + /** @name RmrkTraitsResourceComposableResource (299) */ interface RmrkTraitsResourceComposableResource extends Struct { readonly parts: Vec; readonly base: u32; @@ -2844,7 +2842,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceSlotResource (289) */ + /** @name RmrkTraitsResourceSlotResource (300) */ interface RmrkTraitsResourceSlotResource extends Struct { readonly base: u32; readonly src: Option; @@ -2854,7 +2852,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name PalletRmrkEquipCall (292) */ + /** @name PalletRmrkEquipCall (303) */ interface PalletRmrkEquipCall extends Enum { readonly isCreateBase: boolean; readonly asCreateBase: { @@ -2876,7 +2874,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; } - /** @name RmrkTraitsPartPartType (295) */ + /** @name RmrkTraitsPartPartType (306) */ interface RmrkTraitsPartPartType extends Enum { readonly isFixedPart: boolean; readonly asFixedPart: RmrkTraitsPartFixedPart; @@ -2885,14 +2883,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'FixedPart' | 'SlotPart'; } - /** @name RmrkTraitsPartFixedPart (297) */ + /** @name RmrkTraitsPartFixedPart (308) */ interface RmrkTraitsPartFixedPart extends Struct { readonly id: u32; readonly z: u32; readonly src: Bytes; } - /** @name RmrkTraitsPartSlotPart (298) */ + /** @name RmrkTraitsPartSlotPart (309) */ interface RmrkTraitsPartSlotPart extends Struct { readonly id: u32; readonly equippable: RmrkTraitsPartEquippableList; @@ -2900,7 +2898,7 @@ declare module '@polkadot/types/lookup' { readonly z: u32; } - /** @name RmrkTraitsPartEquippableList (299) */ + /** @name RmrkTraitsPartEquippableList (310) */ interface RmrkTraitsPartEquippableList extends Enum { readonly isAll: boolean; readonly isEmpty: boolean; @@ -2909,38 +2907,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'All' | 'Empty' | 'Custom'; } - /** @name RmrkTraitsTheme (301) */ + /** @name RmrkTraitsTheme (312) */ interface RmrkTraitsTheme extends Struct { readonly name: Bytes; readonly properties: Vec; readonly inherit: bool; } - /** @name RmrkTraitsThemeThemeProperty (303) */ + /** @name RmrkTraitsThemeThemeProperty (314) */ interface RmrkTraitsThemeThemeProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name PalletForeignAssetsModuleCall (314) */ - interface PalletForeignAssetsModuleCall extends Enum { - readonly isRegisterForeignAsset: boolean; - readonly asRegisterForeignAsset: { - readonly owner: AccountId32; - readonly location: XcmVersionedMultiLocation; - readonly metadata: PalletForeignAssetsModuleAssetMetadata; - } & Struct; - readonly isUpdateForeignAsset: boolean; - readonly asUpdateForeignAsset: { - readonly foreignAssetId: u32; - readonly location: XcmVersionedMultiLocation; - readonly metadata: PalletForeignAssetsModuleAssetMetadata; - } & Struct; - readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset'; - } - - /** @name PalletEvmCall (315) */ - /** @name PalletAppPromotionCall (305) */ + /** @name PalletAppPromotionCall (316) */ interface PalletAppPromotionCall extends Enum { readonly isSetAdminAddress: boolean; readonly asSetAdminAddress: { @@ -2974,7 +2954,24 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers'; } - /** @name PalletEvmCall (307) */ + /** @name PalletForeignAssetsModuleCall (318) */ + interface PalletForeignAssetsModuleCall extends Enum { + readonly isRegisterForeignAsset: boolean; + readonly asRegisterForeignAsset: { + readonly owner: AccountId32; + readonly location: XcmVersionedMultiLocation; + readonly metadata: PalletForeignAssetsModuleAssetMetadata; + } & Struct; + readonly isUpdateForeignAsset: boolean; + readonly asUpdateForeignAsset: { + readonly foreignAssetId: u32; + readonly location: XcmVersionedMultiLocation; + readonly metadata: PalletForeignAssetsModuleAssetMetadata; + } & Struct; + readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset'; + } + + /** @name PalletEvmCall (319) */ interface PalletEvmCall extends Enum { readonly isWithdraw: boolean; readonly asWithdraw: { @@ -3019,7 +3016,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name PalletEthereumCall (311) */ + /** @name PalletEthereumCall (323) */ interface PalletEthereumCall extends Enum { readonly isTransact: boolean; readonly asTransact: { @@ -3028,7 +3025,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transact'; } - /** @name EthereumTransactionTransactionV2 (312) */ + /** @name EthereumTransactionTransactionV2 (324) */ interface EthereumTransactionTransactionV2 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumTransactionLegacyTransaction; @@ -3039,7 +3036,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumTransactionLegacyTransaction (313) */ + /** @name EthereumTransactionLegacyTransaction (325) */ interface EthereumTransactionLegacyTransaction extends Struct { readonly nonce: U256; readonly gasPrice: U256; @@ -3050,7 +3047,7 @@ declare module '@polkadot/types/lookup' { readonly signature: EthereumTransactionTransactionSignature; } - /** @name EthereumTransactionTransactionAction (314) */ + /** @name EthereumTransactionTransactionAction (326) */ interface EthereumTransactionTransactionAction extends Enum { readonly isCall: boolean; readonly asCall: H160; @@ -3058,14 +3055,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Call' | 'Create'; } - /** @name EthereumTransactionTransactionSignature (315) */ + /** @name EthereumTransactionTransactionSignature (327) */ interface EthereumTransactionTransactionSignature extends Struct { readonly v: u64; readonly r: H256; readonly s: H256; } - /** @name EthereumTransactionEip2930Transaction (317) */ + /** @name EthereumTransactionEip2930Transaction (329) */ interface EthereumTransactionEip2930Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -3080,13 +3077,13 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name EthereumTransactionAccessListItem (319) */ + /** @name EthereumTransactionAccessListItem (331) */ interface EthereumTransactionAccessListItem extends Struct { readonly address: H160; readonly storageKeys: Vec; } - /** @name EthereumTransactionEip1559Transaction (320) */ + /** @name EthereumTransactionEip1559Transaction (332) */ interface EthereumTransactionEip1559Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -3102,7 +3099,7 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name PalletEvmMigrationCall (321) */ + /** @name PalletEvmMigrationCall (333) */ interface PalletEvmMigrationCall extends Enum { readonly isBegin: boolean; readonly asBegin: { @@ -3121,13 +3118,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Begin' | 'SetData' | 'Finish'; } - /** @name PalletSudoError (324) */ + /** @name PalletSudoError (336) */ interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: 'RequireSudo'; } - /** @name OrmlVestingModuleError (326) */ + /** @name OrmlVestingModuleError (338) */ interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; @@ -3138,7 +3135,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name OrmlXtokensModuleError (335) */ + /** @name OrmlXtokensModuleError (339) */ interface OrmlXtokensModuleError extends Enum { readonly isAssetHasNoReserve: boolean; readonly isNotCrossChainTransfer: boolean; @@ -3162,26 +3159,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined'; } - /** @name OrmlTokensBalanceLock (338) */ + /** @name OrmlTokensBalanceLock (342) */ interface OrmlTokensBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name OrmlTokensAccountData (340) */ + /** @name OrmlTokensAccountData (344) */ interface OrmlTokensAccountData extends Struct { readonly free: u128; readonly reserved: u128; readonly frozen: u128; } - /** @name OrmlTokensReserveData (342) */ + /** @name OrmlTokensReserveData (346) */ interface OrmlTokensReserveData extends Struct { readonly id: Null; readonly amount: u128; } - /** @name OrmlTokensModuleError (344) */ + /** @name OrmlTokensModuleError (348) */ interface OrmlTokensModuleError extends Enum { readonly isBalanceTooLow: boolean; readonly isAmountIntoBalanceFailed: boolean; @@ -3194,21 +3191,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (346) */ + /** @name CumulusPalletXcmpQueueInboundChannelDetails (350) */ interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (329) */ + /** @name CumulusPalletXcmpQueueInboundState (351) */ interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (332) */ + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (354) */ interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; @@ -3216,7 +3213,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (335) */ + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (357) */ interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; @@ -3225,14 +3222,14 @@ declare module '@polkadot/types/lookup' { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (336) */ + /** @name CumulusPalletXcmpQueueOutboundState (358) */ interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (338) */ + /** @name CumulusPalletXcmpQueueQueueConfigData (360) */ interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; @@ -3242,7 +3239,7 @@ declare module '@polkadot/types/lookup' { readonly xcmpMaxIndividualWeight: u64; } - /** @name CumulusPalletXcmpQueueError (340) */ + /** @name CumulusPalletXcmpQueueError (362) */ interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; @@ -3252,7 +3249,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (341) */ + /** @name PalletXcmError (363) */ interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; @@ -3270,29 +3267,29 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (342) */ + /** @name CumulusPalletXcmError (364) */ type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (343) */ + /** @name CumulusPalletDmpQueueConfigData (365) */ interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: u64; } - /** @name CumulusPalletDmpQueuePageIndexData (344) */ + /** @name CumulusPalletDmpQueuePageIndexData (366) */ interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (347) */ + /** @name CumulusPalletDmpQueueError (369) */ interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (351) */ + /** @name PalletUniqueError (373) */ interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; @@ -3301,7 +3298,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name PalletUniqueSchedulerScheduledV3 (354) */ + /** @name PalletUniqueSchedulerScheduledV3 (376) */ interface PalletUniqueSchedulerScheduledV3 extends Struct { readonly maybeId: Option; readonly priority: u8; @@ -3310,7 +3307,7 @@ declare module '@polkadot/types/lookup' { readonly origin: OpalRuntimeOriginCaller; } - /** @name OpalRuntimeOriginCaller (355) */ + /** @name OpalRuntimeOriginCaller (377) */ interface OpalRuntimeOriginCaller extends Enum { readonly isSystem: boolean; readonly asSystem: FrameSupportDispatchRawOrigin; @@ -3324,7 +3321,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; } - /** @name FrameSupportDispatchRawOrigin (356) */ + /** @name FrameSupportDispatchRawOrigin (378) */ interface FrameSupportDispatchRawOrigin extends Enum { readonly isRoot: boolean; readonly isSigned: boolean; @@ -3333,7 +3330,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Root' | 'Signed' | 'None'; } - /** @name PalletXcmOrigin (357) */ + /** @name PalletXcmOrigin (379) */ interface PalletXcmOrigin extends Enum { readonly isXcm: boolean; readonly asXcm: XcmV1MultiLocation; @@ -3342,7 +3339,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Xcm' | 'Response'; } - /** @name CumulusPalletXcmOrigin (358) */ + /** @name CumulusPalletXcmOrigin (380) */ interface CumulusPalletXcmOrigin extends Enum { readonly isRelay: boolean; readonly isSiblingParachain: boolean; @@ -3350,17 +3347,17 @@ declare module '@polkadot/types/lookup' { readonly type: 'Relay' | 'SiblingParachain'; } - /** @name PalletEthereumRawOrigin (359) */ + /** @name PalletEthereumRawOrigin (381) */ interface PalletEthereumRawOrigin extends Enum { readonly isEthereumTransaction: boolean; readonly asEthereumTransaction: H160; readonly type: 'EthereumTransaction'; } - /** @name SpCoreVoid (360) */ + /** @name SpCoreVoid (382) */ type SpCoreVoid = Null; - /** @name PalletUniqueSchedulerError (361) */ + /** @name PalletUniqueSchedulerError (383) */ interface PalletUniqueSchedulerError extends Enum { readonly isFailedToSchedule: boolean; readonly isNotFound: boolean; @@ -3369,7 +3366,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; } - /** @name UpDataStructsCollection (362) */ + /** @name UpDataStructsCollection (384) */ interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3379,10 +3376,10 @@ declare module '@polkadot/types/lookup' { readonly sponsorship: UpDataStructsSponsorshipStateAccountId32; readonly limits: UpDataStructsCollectionLimits; readonly permissions: UpDataStructsCollectionPermissions; - readonly externalCollection: bool; + readonly flags: U8aFixed; } - /** @name UpDataStructsSponsorshipStateAccountId32 (363) */ + /** @name UpDataStructsSponsorshipStateAccountId32 (385) */ interface UpDataStructsSponsorshipStateAccountId32 extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3392,43 +3389,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (364) */ + /** @name UpDataStructsProperties (387) */ interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (365) */ + /** @name UpDataStructsPropertiesMapBoundedVec (388) */ interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (370) */ + /** @name UpDataStructsPropertiesMapPropertyPermission (393) */ interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (377) */ + /** @name UpDataStructsCollectionStats (400) */ interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (378) */ + /** @name UpDataStructsTokenChild (401) */ interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (379) */ + /** @name PhantomTypeUpDataStructs (402) */ interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (381) */ + /** @name UpDataStructsTokenData (404) */ interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (383) */ + /** @name UpDataStructsRpcCollection (406) */ interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3441,9 +3438,10 @@ declare module '@polkadot/types/lookup' { readonly tokenPropertyPermissions: Vec; readonly properties: Vec; readonly readOnly: bool; + readonly foreign: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (384) */ + /** @name RmrkTraitsCollectionCollectionInfo (407) */ interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; @@ -3452,7 +3450,7 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (385) */ + /** @name RmrkTraitsNftNftInfo (408) */ interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; @@ -3461,13 +3459,13 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (387) */ + /** @name RmrkTraitsNftRoyaltyInfo (410) */ interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (388) */ + /** @name RmrkTraitsResourceResourceInfo (411) */ interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; @@ -3475,26 +3473,26 @@ declare module '@polkadot/types/lookup' { readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (389) */ + /** @name RmrkTraitsPropertyPropertyInfo (412) */ interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (390) */ + /** @name RmrkTraitsBaseBaseInfo (413) */ interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (391) */ + /** @name RmrkTraitsNftNftChild (414) */ interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (393) */ + /** @name PalletCommonError (416) */ interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; @@ -3533,7 +3531,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (395) */ + /** @name PalletFungibleError (418) */ interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; @@ -3543,12 +3541,12 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (396) */ + /** @name PalletRefungibleItemData (419) */ interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } - /** @name PalletRefungibleError (401) */ + /** @name PalletRefungibleError (424) */ interface PalletRefungibleError extends Enum { readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isWrongRefungiblePieces: boolean; @@ -3558,19 +3556,19 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletNonfungibleItemData (402) */ + /** @name PalletNonfungibleItemData (425) */ interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (404) */ + /** @name UpDataStructsPropertyScope (427) */ interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; readonly type: 'None' | 'Rmrk'; } - /** @name PalletNonfungibleError (406) */ + /** @name PalletNonfungibleError (429) */ interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; @@ -3578,7 +3576,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (407) */ + /** @name PalletStructureError (430) */ interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; @@ -3587,7 +3585,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletRmrkCoreError (408) */ + /** @name PalletRmrkCoreError (431) */ interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; @@ -3611,7 +3609,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } - /** @name PalletRmrkEquipError (410) */ + /** @name PalletRmrkEquipError (433) */ interface PalletRmrkEquipError extends Enum { readonly isPermissionError: boolean; readonly isNoAvailableBaseId: boolean; @@ -3623,17 +3621,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; } - /** @name PalletForeignAssetsModuleError (429) */ - interface PalletForeignAssetsModuleError extends Enum { - readonly isBadLocation: boolean; - readonly isMultiLocationExisted: boolean; - readonly isAssetIdNotExists: boolean; - readonly isAssetIdExisted: boolean; - readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted'; - } - - /** @name PalletEvmError (432) */ - /** @name PalletAppPromotionError (416) */ + /** @name PalletAppPromotionError (439) */ interface PalletAppPromotionError extends Enum { readonly isAdminNotSet: boolean; readonly isNoPermission: boolean; @@ -3644,7 +3632,16 @@ declare module '@polkadot/types/lookup' { readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'IncorrectLockedBalanceOperation'; } - /** @name PalletEvmError (419) */ + /** @name PalletForeignAssetsModuleError (440) */ + interface PalletForeignAssetsModuleError extends Enum { + readonly isBadLocation: boolean; + readonly isMultiLocationExisted: boolean; + readonly isAssetIdNotExists: boolean; + readonly isAssetIdExisted: boolean; + readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted'; + } + + /** @name PalletEvmError (443) */ interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; @@ -3655,7 +3652,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (422) */ + /** @name FpRpcTransactionStatus (446) */ interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; @@ -3666,10 +3663,10 @@ declare module '@polkadot/types/lookup' { readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (424) */ + /** @name EthbloomBloom (448) */ interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (426) */ + /** @name EthereumReceiptReceiptV3 (450) */ interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; @@ -3680,7 +3677,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (427) */ + /** @name EthereumReceiptEip658ReceiptData (451) */ interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; @@ -3688,14 +3685,14 @@ declare module '@polkadot/types/lookup' { readonly logs: Vec; } - /** @name EthereumBlock (428) */ + /** @name EthereumBlock (452) */ interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (429) */ + /** @name EthereumHeader (453) */ interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; @@ -3714,24 +3711,24 @@ declare module '@polkadot/types/lookup' { readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (430) */ + /** @name EthereumTypesHashH64 (454) */ interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (435) */ + /** @name PalletEthereumError (459) */ interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (436) */ + /** @name PalletEvmCoderSubstrateError (460) */ interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (437) */ + /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (461) */ interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3741,7 +3738,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name PalletEvmContractHelpersSponsoringModeT (438) */ + /** @name PalletEvmContractHelpersSponsoringModeT (462) */ interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; @@ -3749,21 +3746,22 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (440) */ + /** @name PalletEvmContractHelpersError (468) */ interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly isNoPendingSponsor: boolean; - readonly type: 'NoPermission' | 'NoPendingSponsor'; + readonly isTooManyMethodsHaveSponsoredLimit: boolean; + readonly type: 'NoPermission' | 'NoPendingSponsor' | 'TooManyMethodsHaveSponsoredLimit'; } - /** @name PalletEvmMigrationError (441) */ + /** @name PalletEvmMigrationError (469) */ interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (443) */ + /** @name SpRuntimeMultiSignature (471) */ interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; @@ -3774,34 +3772,34 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (444) */ + /** @name SpCoreEd25519Signature (472) */ interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (446) */ + /** @name SpCoreSr25519Signature (474) */ interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (447) */ + /** @name SpCoreEcdsaSignature (475) */ interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (450) */ + /** @name FrameSystemExtensionsCheckSpecVersion (478) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (451) */ + /** @name FrameSystemExtensionsCheckGenesis (479) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (454) */ + /** @name FrameSystemExtensionsCheckNonce (482) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (455) */ + /** @name FrameSystemExtensionsCheckWeight (483) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (456) */ + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (484) */ interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (457) */ + /** @name OpalRuntimeRuntime (485) */ type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (458) */ + /** @name PalletEthereumFakeTransactionFinalizer (486) */ type PalletEthereumFakeTransactionFinalizer = Null; } // declare module From 6ca971af28d8d9e59571a5707463c9450ec35f6c Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 16 Sep 2022 16:30:50 +0000 Subject: [PATCH 0928/1274] test: return missing generateKeyringPair Signed-off-by: Yaroslav Bolyukin --- tests/src/util/helpers.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index e58a804ccf..6623aec132 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -1853,6 +1853,11 @@ export async function itApi(name: string, cb: (apis: { api: ApiPromise, privateK itApi.only = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {only: true}); itApi.skip = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {skip: true}); +let accountSeed = 10000; +export function generateKeyringPair(keyring: Keyring) { + const privateKey = `0xDEADBEEF${(Date.now() + (accountSeed++)).toString(16)}`.padStart(64, '0'); + return keyring.addFromUri(privateKey); +} export async function expectSubstrateEventsAtBlock(api: ApiPromise, blockNumber: AnyNumber | BlockNumber, section: string, methods: string[], dryRun = false) { const blockHash = await api.rpc.chain.getBlockHash(blockNumber); From 48c1587fa96f4a5f9a3479c4305ff686b917fc8e Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 16 Sep 2022 16:33:21 +0000 Subject: [PATCH 0929/1274] test: fix pallet-tokens field name change Signed-off-by: Yaroslav Bolyukin --- tests/src/util/helpers.ts | 30 +++++++-------- tests/src/xcm/xcmQuartz.test.ts | 66 ++++++++++++++++----------------- tests/src/xcm/xcmUnique.test.ts | 66 ++++++++++++++++----------------- tests/src/xcmTransfer.test.ts | 6 +-- 4 files changed, 84 insertions(+), 84 deletions(-) diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index 6623aec132..f6f48ec5a0 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -63,14 +63,14 @@ export async function isUnique(): Promise { export async function isQuartz(): Promise { return usingApi(async api => { const chain = await api.rpc.system.chain(); - + return chain.eq('QUARTZ'); }); } let modulesNames: any; export function getModuleNames(api: ApiPromise): string[] { - if (typeof modulesNames === 'undefined') + if (typeof modulesNames === 'undefined') modulesNames = api.runtimeMetadata.asLatest.pallets.map(m => m.name.toString().toLowerCase()); return modulesNames; } @@ -304,7 +304,7 @@ export function getCreateCollectionResult(events: EventRecord[]): CreateCollecti export function getCreateItemsResult(events: EventRecord[]): CreateItemResult[] { const results: CreateItemResult[] = []; - + const genericResult = getGenericResult(events, 'common', 'ItemCreated', (data) => { const collectionId = parseInt(data[0].toString(), 10); const itemId = parseInt(data[1].toString(), 10); @@ -329,15 +329,15 @@ export function getCreateItemsResult(events: EventRecord[]): CreateItemResult[] export function getCreateItemResult(events: EventRecord[]): CreateItemResult { const genericResult = getGenericResult(events, 'common', 'ItemCreated', (data) => data.map(function(value) { return value.toJSON(); })); - - if (genericResult.data == null) + + if (genericResult.data == null) return { success: genericResult.success, collectionId: 0, itemId: 0, amount: 0, }; - else + else return { success: genericResult.success, collectionId: genericResult.data[0] as number, @@ -349,7 +349,7 @@ export function getCreateItemResult(events: EventRecord[]): CreateItemResult { export function getDestroyItemsResult(events: EventRecord[]): DestroyItemResult[] { const results: DestroyItemResult[] = []; - + const genericResult = getGenericResult(events, 'common', 'ItemDestroyed', (data) => { const collectionId = parseInt(data[0].toString(), 10); const itemId = parseInt(data[1].toString(), 10); @@ -1151,9 +1151,9 @@ scheduleExpectSuccess( expect(blockNumber).to.be.greaterThan(0); const scheduleTx = api.tx.scheduler.scheduleNamed( // schedule scheduledId, - expectedBlockNumber, - repetitions > 1 ? [period, repetitions] : null, - 0, + expectedBlockNumber, + repetitions > 1 ? [period, repetitions] : null, + 0, {Value: operationTx as any}, ); @@ -1178,13 +1178,13 @@ scheduleExpectFailure( expect(blockNumber).to.be.greaterThan(0); const scheduleTx = api.tx.scheduler.scheduleNamed( // schedule scheduledId, - expectedBlockNumber, - repetitions <= 1 ? null : [period, repetitions], - 0, + expectedBlockNumber, + repetitions <= 1 ? null : [period, repetitions], + 0, {Value: operationTx as any}, ); - //const events = + //const events = await expect(submitTransactionExpectFailAsync(sender, scheduleTx)).to.be.rejected; //expect(getGenericResult(events).success).to.be.false; }); @@ -1248,7 +1248,7 @@ scheduleTransferFundsPeriodicExpectSuccess( const transferTx = api.tx.balances.transfer(recipient.address, amount); const balanceBefore = await getFreeBalance(recipient); - + await scheduleExpectSuccess(transferTx, sender, blockSchedule, scheduledId, period, repetitions); expect(await getFreeBalance(recipient)).to.be.equal(balanceBefore); diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index 972fea2d44..33b0584ebe 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -64,7 +64,7 @@ function relayOptions(): ApiOptions { describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { let alice: IKeyringPair; let randomAccount: IKeyringPair; - + let balanceQuartzTokenInit: bigint; let balanceQuartzTokenMiddle: bigint; let balanceQuartzTokenFinal: bigint; @@ -74,7 +74,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { let balanceQuartzForeignTokenInit: bigint; let balanceQuartzForeignTokenMiddle: bigint; let balanceQuartzForeignTokenFinal: bigint; - + before(async () => { await usingApi(async (api, privateKeyWrapper) => { const keyringSr25519 = new Keyring({type: 'sr25519'}); @@ -96,50 +96,50 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { ], }, }; - + const metadata = { name: 'QTZ', symbol: 'QTZ', decimals: 18, minimalBalance: 1, }; - + const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata); const sudoTx = api.tx.sudo.sudo(tx as any); const events = await submitTransactionAsync(alice, sudoTx); const result = getGenericResult(events); expect(result.success).to.be.true; - + const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); const events1 = await submitTransactionAsync(alice, tx1); const result1 = getGenericResult(events1); expect(result1.success).to.be.true; - + [balanceKaruraTokenInit] = await getBalance(api, [randomAccount.address]); { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAssetId: 0})).toJSON() as any; balanceQuartzForeignTokenInit = BigInt(free); } }, karuraOptions(), ); - + // Quartz side await usingApi(async (api) => { const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); const events0 = await submitTransactionAsync(alice, tx0); const result0 = getGenericResult(events0); expect(result0.success).to.be.true; - + [balanceQuartzTokenInit] = await getBalance(api, [randomAccount.address]); }); }); - + it('Should connect and send QTZ to Karura', async () => { - + // Quartz side await usingApi(async (api) => { - + const destination = { V0: { X2: [ @@ -150,7 +150,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { ], }, }; - + const beneficiary = { V0: { X1: { @@ -161,7 +161,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { }, }, }; - + const assets = { V1: [ { @@ -177,32 +177,32 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { }, ], }; - + const feeAssetItem = 0; - + const weightLimit = { Limited: 5000000000, }; - + const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); const events = await submitTransactionAsync(randomAccount, tx); const result = getGenericResult(events); expect(result.success).to.be.true; - + [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccount.address]); - + const qtzFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT; console.log('[Quartz -> Karura] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees)); expect(qtzFees > 0n).to.be.true; }); - + // Karura side await usingApi( async (api) => { await waitNewBlocks(api, 3); - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAssetId: 0})).toJSON() as any; balanceQuartzForeignTokenMiddle = BigInt(free); - + [balanceKaruraTokenMiddle] = await getBalance(api, [randomAccount.address]); const karFees = balanceKaruraTokenInit - balanceKaruraTokenMiddle; @@ -219,9 +219,9 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { karuraOptions(), ); }); - + it('Should connect to Karura and send QTZ back', async () => { - + // Karura side await usingApi( async (api) => { @@ -241,24 +241,24 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { }, }, }; - + const id = { - ForeignAsset: 0, + ForeignAssetId: 0, }; const destWeight = 50000000; - + const tx = api.tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight); const events = await submitTransactionAsync(randomAccount, tx); const result = getGenericResult(events); expect(result.success).to.be.true; - + [balanceKaruraTokenFinal] = await getBalance(api, [randomAccount.address]); { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAssetId: 0})).toJSON() as any; balanceQuartzForeignTokenFinal = BigInt(free); } - + const karFees = balanceKaruraTokenMiddle - balanceKaruraTokenFinal; const qtzOutcomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenFinal; @@ -277,13 +277,13 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { // Quartz side await usingApi(async (api) => { await waitNewBlocks(api, 3); - + [balanceQuartzTokenFinal] = await getBalance(api, [randomAccount.address]); const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle; expect(actuallyDelivered > 0).to.be.true; console.log('[Karura -> Quartz] actually delivered %s QTZ', bigIntToDecimals(actuallyDelivered)); - + const qtzFees = TRANSFER_AMOUNT - actuallyDelivered; console.log('[Karura -> Quartz] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees)); expect(qtzFees == 0n).to.be.true; @@ -300,7 +300,7 @@ describe_xcm('[XCM] Integration test: Quartz rejects non-native tokens', () => { alice = privateKeyWrapper('//Alice'); }); }); - + it('Quartz rejects tokens from the Relay', async () => { await usingApi(async (api) => { const destination = { diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index b86bf08b2b..d09c7a644b 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -64,7 +64,7 @@ function relayOptions(): ApiOptions { describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { let alice: IKeyringPair; let randomAccount: IKeyringPair; - + let balanceUniqueTokenInit: bigint; let balanceUniqueTokenMiddle: bigint; let balanceUniqueTokenFinal: bigint; @@ -74,7 +74,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { let balanceUniqueForeignTokenInit: bigint; let balanceUniqueForeignTokenMiddle: bigint; let balanceUniqueForeignTokenFinal: bigint; - + before(async () => { await usingApi(async (api, privateKeyWrapper) => { const keyringSr25519 = new Keyring({type: 'sr25519'}); @@ -96,50 +96,50 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { ], }, }; - + const metadata = { name: 'UNQ', symbol: 'UNQ', decimals: 18, minimalBalance: 1, }; - + const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata); const sudoTx = api.tx.sudo.sudo(tx as any); const events = await submitTransactionAsync(alice, sudoTx); const result = getGenericResult(events); expect(result.success).to.be.true; - + const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); const events1 = await submitTransactionAsync(alice, tx1); const result1 = getGenericResult(events1); expect(result1.success).to.be.true; - + [balanceAcalaTokenInit] = await getBalance(api, [randomAccount.address]); { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAssetId: 0})).toJSON() as any; balanceUniqueForeignTokenInit = BigInt(free); } }, acalaOptions(), ); - + // Unique side await usingApi(async (api) => { const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); const events0 = await submitTransactionAsync(alice, tx0); const result0 = getGenericResult(events0); expect(result0.success).to.be.true; - + [balanceUniqueTokenInit] = await getBalance(api, [randomAccount.address]); }); }); - + it('Should connect and send UNQ to Acala', async () => { - + // Unique side await usingApi(async (api) => { - + const destination = { V0: { X2: [ @@ -150,7 +150,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { ], }, }; - + const beneficiary = { V0: { X1: { @@ -161,7 +161,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { }, }, }; - + const assets = { V1: [ { @@ -177,32 +177,32 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { }, ], }; - + const feeAssetItem = 0; - + const weightLimit = { Limited: 5000000000, }; - + const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); const events = await submitTransactionAsync(randomAccount, tx); const result = getGenericResult(events); expect(result.success).to.be.true; - + [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccount.address]); - + const unqFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT; console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees)); expect(unqFees > 0n).to.be.true; }); - + // Acala side await usingApi( async (api) => { await waitNewBlocks(api, 3); - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAssetId: 0})).toJSON() as any; balanceUniqueForeignTokenMiddle = BigInt(free); - + [balanceAcalaTokenMiddle] = await getBalance(api, [randomAccount.address]); const acaFees = balanceAcalaTokenInit - balanceAcalaTokenMiddle; @@ -219,9 +219,9 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { acalaOptions(), ); }); - + it('Should connect to Acala and send UNQ back', async () => { - + // Acala side await usingApi( async (api) => { @@ -241,24 +241,24 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { }, }, }; - + const id = { - ForeignAsset: 0, + ForeignAssetId: 0, }; const destWeight = 50000000; - + const tx = api.tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight); const events = await submitTransactionAsync(randomAccount, tx); const result = getGenericResult(events); expect(result.success).to.be.true; - + [balanceAcalaTokenFinal] = await getBalance(api, [randomAccount.address]); { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAssetId: 0})).toJSON() as any; balanceUniqueForeignTokenFinal = BigInt(free); } - + const acaFees = balanceAcalaTokenMiddle - balanceAcalaTokenFinal; const unqOutcomeTransfer = balanceUniqueForeignTokenMiddle - balanceUniqueForeignTokenFinal; @@ -277,13 +277,13 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { // Unique side await usingApi(async (api) => { await waitNewBlocks(api, 3); - + [balanceUniqueTokenFinal] = await getBalance(api, [randomAccount.address]); const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle; expect(actuallyDelivered > 0).to.be.true; console.log('[Acala -> Unique] actually delivered %s UNQ', bigIntToDecimals(actuallyDelivered)); - + const unqFees = TRANSFER_AMOUNT - actuallyDelivered; console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees)); expect(unqFees == 0n).to.be.true; @@ -300,7 +300,7 @@ describe_xcm('[XCM] Integration test: Unique rejects non-native tokens', () => { alice = privateKeyWrapper('//Alice'); }); }); - + it('Unique rejects tokens from the Relay', async () => { await usingApi(async (api) => { const destination = { diff --git a/tests/src/xcmTransfer.test.ts b/tests/src/xcmTransfer.test.ts index ea93bd4a71..774e1da60a 100644 --- a/tests/src/xcmTransfer.test.ts +++ b/tests/src/xcmTransfer.test.ts @@ -78,7 +78,7 @@ describe.skip('Integration test: Exchanging QTZ with Karura', () => { let balanceOnKaruraBefore: bigint; await usingApi(async (api) => { - const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any; + const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAssetId: 0})).toJSON() as any; balanceOnKaruraBefore = free; }, {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)}); @@ -136,7 +136,7 @@ describe.skip('Integration test: Exchanging QTZ with Karura', () => { await usingApi(async (api) => { // todo do something about instant sealing, where there might not be any new blocks await waitNewBlocks(api, 3); - const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any; + const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAssetId: 0})).toJSON() as any; expect(free > balanceOnKaruraBefore).to.be.true; }, {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)}); }); @@ -165,7 +165,7 @@ describe.skip('Integration test: Exchanging QTZ with Karura', () => { }; const id = { - ForeignAsset: 0, + ForeignAssetId: 0, }; const amount = TRANSFER_AMOUNT; From fdbfc23b0c240f549f0683295df1b9f0a7ce0ab0 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Sat, 17 Sep 2022 08:50:08 +0000 Subject: [PATCH 0930/1274] test: fix random key padding Signed-off-by: Yaroslav Bolyukin --- tests/src/util/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/util/helpers.ts b/tests/src/util/helpers.ts index f6f48ec5a0..ac998ea567 100644 --- a/tests/src/util/helpers.ts +++ b/tests/src/util/helpers.ts @@ -1855,7 +1855,7 @@ itApi.skip = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (ac let accountSeed = 10000; export function generateKeyringPair(keyring: Keyring) { - const privateKey = `0xDEADBEEF${(Date.now() + (accountSeed++)).toString(16)}`.padStart(64, '0'); + const privateKey = `0xDEADBEEF${(Date.now() + (accountSeed++)).toString(16).padStart(64 - 8, '0')}`; return keyring.addFromUri(privateKey); } From a4e0aaad0e43de8c3dd5721e8e985ad63b718ebc Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 19 Sep 2022 09:42:41 +0000 Subject: [PATCH 0931/1274] fix: use foreignasset for acala/karura --- tests/src/xcm/xcmQuartz.test.ts | 8 ++++---- tests/src/xcm/xcmUnique.test.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index 33b0584ebe..cb05f94396 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -117,7 +117,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { [balanceKaruraTokenInit] = await getBalance(api, [randomAccount.address]); { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAssetId: 0})).toJSON() as any; + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; balanceQuartzForeignTokenInit = BigInt(free); } }, @@ -200,7 +200,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { await usingApi( async (api) => { await waitNewBlocks(api, 3); - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAssetId: 0})).toJSON() as any; + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; balanceQuartzForeignTokenMiddle = BigInt(free); [balanceKaruraTokenMiddle] = await getBalance(api, [randomAccount.address]); @@ -243,7 +243,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { }; const id = { - ForeignAssetId: 0, + ForeignAsset: 0, }; const destWeight = 50000000; @@ -255,7 +255,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { [balanceKaruraTokenFinal] = await getBalance(api, [randomAccount.address]); { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAssetId: 0})).toJSON() as any; + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, id)).toJSON() as any; balanceQuartzForeignTokenFinal = BigInt(free); } diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index d09c7a644b..91ba806fa6 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -117,7 +117,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { [balanceAcalaTokenInit] = await getBalance(api, [randomAccount.address]); { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAssetId: 0})).toJSON() as any; + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; balanceUniqueForeignTokenInit = BigInt(free); } }, @@ -200,7 +200,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { await usingApi( async (api) => { await waitNewBlocks(api, 3); - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAssetId: 0})).toJSON() as any; + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; balanceUniqueForeignTokenMiddle = BigInt(free); [balanceAcalaTokenMiddle] = await getBalance(api, [randomAccount.address]); @@ -243,7 +243,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { }; const id = { - ForeignAssetId: 0, + ForeignAsset: 0, }; const destWeight = 50000000; @@ -255,7 +255,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { [balanceAcalaTokenFinal] = await getBalance(api, [randomAccount.address]); { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAssetId: 0})).toJSON() as any; + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, id)).toJSON() as any; balanceUniqueForeignTokenFinal = BigInt(free); } From b85120ee5b8de50e9dc09d6ad36f60ebf728d969 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 19 Sep 2022 10:18:51 +0000 Subject: [PATCH 0932/1274] fix: rename method to collectionSponsor --- pallets/common/src/erc.rs | 2 +- .../src/stubs/ContractHelpers.raw | Bin 1848 -> 1848 bytes .../src/stubs/ContractHelpers.sol | 67 +++------------ pallets/fungible/src/stubs/UniqueFungible.raw | Bin 3349 -> 3349 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 54 ++++-------- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4497 -> 4497 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 79 +++++------------- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4508 -> 4508 bytes .../refungible/src/stubs/UniqueRefungible.sol | 79 +++++------------- .../src/stubs/UniqueRefungibleToken.raw | Bin 1556 -> 1556 bytes .../src/stubs/UniqueRefungibleToken.sol | 26 +----- .../src/eth/stubs/CollectionHelpers.raw | Bin 1488 -> 1488 bytes tests/src/eth/api/ContractHelpers.sol | 51 +++-------- tests/src/eth/api/UniqueFungible.sol | 42 +++------- tests/src/eth/api/UniqueNFT.sol | 63 ++++---------- tests/src/eth/api/UniqueRefungible.sol | 68 ++++----------- tests/src/eth/api/UniqueRefungibleToken.sol | 19 +---- tests/src/eth/collectionSponsoring.test.ts | 4 +- tests/src/eth/fungibleAbi.json | 36 ++++---- tests/src/eth/nonFungibleAbi.json | 36 ++++---- tests/src/eth/reFungibleAbi.json | 36 ++++---- 21 files changed, 186 insertions(+), 476 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index ebf65ae6d7..04296075b4 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -194,7 +194,7 @@ where /// Get current sponsor. /// /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - fn get_collection_sponsor(&self) -> Result<(address, uint256)> { + fn collection_sponsor(&self) -> Result<(address, uint256)> { let sponsor = match self.collection.sponsorship.sponsor() { Some(sponsor) => sponsor, None => return Ok(Default::default()), diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw index 5f09ed3ccefeedd55c814717b83102017087e30d..67dda44777d5733dee28067035a8df00fcc6c617 100644 GIT binary patch delta 44 zcmV+{0Mq}t4!91m=LR5r{Dtr{W|CT~9TkpASzq)2aFQc5pJqHhi=Xt@Z9G|%2M00F CI1{@7 delta 44 zcmV+{0Mq}t4!91m=LR4(-L-&+L9nt%R}`a=;B4MOK4zXfeS2L|9a*_oX-p%N2M002 C8WLUr diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol index 93e2a23b86..8090e536d5 100644 --- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol +++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol @@ -10,11 +10,7 @@ contract Dummy { } contract ERC165 is Dummy { - function supportsInterface(bytes4 interfaceID) - external - view - returns (bool) - { + function supportsInterface(bytes4 interfaceID) external view returns (bool) { require(false, stub_error); interfaceID; return true; @@ -24,10 +20,7 @@ contract ERC165 is Dummy { /// @dev inlined interface contract ContractHelpersEvents { event ContractSponsorSet(address indexed contractAddress, address sponsor); - event ContractSponsorshipConfirmed( - address indexed contractAddress, - address sponsor - ); + event ContractSponsorshipConfirmed(address indexed contractAddress, address sponsor); event ContractSponsorRemoved(address indexed contractAddress); } @@ -43,11 +36,7 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// @return address Owner of contract /// @dev EVM selector for this function is: 0x5152b14c, /// or in textual repr: contractOwner(address) - function contractOwner(address contractAddress) - public - view - returns (address) - { + function contractOwner(address contractAddress) public view returns (address) { require(false, stub_error); contractAddress; dummy; @@ -107,11 +96,7 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. /// @dev EVM selector for this function is: 0x743fc745, /// or in textual repr: getSponsor(address) - function getSponsor(address contractAddress) - public - view - returns (Tuple0 memory) - { + function getSponsor(address contractAddress) public view returns (Tuple0 memory) { require(false, stub_error); contractAddress; dummy; @@ -137,11 +122,7 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// @return **true** if contract has pending sponsor. /// @dev EVM selector for this function is: 0x39b9b242, /// or in textual repr: hasPendingSponsor(address) - function hasPendingSponsor(address contractAddress) - public - view - returns (bool) - { + function hasPendingSponsor(address contractAddress) public view returns (bool) { require(false, stub_error); contractAddress; dummy; @@ -150,11 +131,7 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// @dev EVM selector for this function is: 0x6027dc61, /// or in textual repr: sponsoringEnabled(address) - function sponsoringEnabled(address contractAddress) - public - view - returns (bool) - { + function sponsoringEnabled(address contractAddress) public view returns (bool) { require(false, stub_error); contractAddress; dummy; @@ -175,11 +152,7 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// @return uint32 Amount of blocks between two sponsored transactions /// @dev EVM selector for this function is: 0x610cfabd, /// or in textual repr: getSponsoringRateLimit(address) - function getSponsoringRateLimit(address contractAddress) - public - view - returns (uint32) - { + function getSponsoringRateLimit(address contractAddress) public view returns (uint32) { require(false, stub_error); contractAddress; dummy; @@ -194,9 +167,7 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// @dev Only contract owner can change this setting /// @dev EVM selector for this function is: 0x77b6c908, /// or in textual repr: setSponsoringRateLimit(address,uint32) - function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) - public - { + function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) public { require(false, stub_error); contractAddress; rateLimit; @@ -211,9 +182,7 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// @dev Only contract owner can change this setting /// @dev EVM selector for this function is: 0x03aed665, /// or in textual repr: setSponsoringFeeLimit(address,uint256) - function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) - public - { + function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) public { require(false, stub_error); contractAddress; feeLimit; @@ -226,11 +195,7 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// transaction /// @dev EVM selector for this function is: 0xc3fdc9ee, /// or in textual repr: getSponsoringFeeLimit(address) - function getSponsoringFeeLimit(address contractAddress) - public - view - returns (uint256) - { + function getSponsoringFeeLimit(address contractAddress) public view returns (uint256) { require(false, stub_error); contractAddress; dummy; @@ -244,11 +209,7 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// @return bool Is specified users exists in contract allowlist /// @dev EVM selector for this function is: 0x5c658165, /// or in textual repr: allowed(address,address) - function allowed(address contractAddress, address user) - public - view - returns (bool) - { + function allowed(address contractAddress, address user) public view returns (bool) { require(false, stub_error); contractAddress; user; @@ -284,11 +245,7 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// @return bool Is specified contract has allowlist access enabled /// @dev EVM selector for this function is: 0xc772ef6c, /// or in textual repr: allowlistEnabled(address) - function allowlistEnabled(address contractAddress) - public - view - returns (bool) - { + function allowlistEnabled(address contractAddress) public view returns (bool) { require(false, stub_error); contractAddress; dummy; diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index 12fbd065ea176476291e940409fd589ad555e0f5..f22b157cf2bb0010cbe5f62cf3e3ce86ada3685d 100644 GIT binary patch delta 243 zcmbO#HC1ZEEk^#l11moYCNc(wHzcoQowIxLOGXusdqB?Jq_=h=i7dQ8=KZ2tYmr3e zX+Y+;E%&zoMWunvUw^BeL=u@EgeNdG{Edd_2J$Zfr8Wr(_X9NqOb%tz6mC5#bsA`a zC{P^41ZkPv#-v~bvSg-p{Vt%wH$diMN#VC3Juu@y?t)rcu%O8h$UHRp29pBgh0QF? zK1@u^^Cow(YEKSiHQ&62Re)V#U+F}fFLS^BU9)LY;*ts diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index 5b4e29c991..d78818db87 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -10,11 +10,7 @@ contract Dummy { } contract ERC165 is Dummy { - function supportsInterface(bytes4 interfaceID) - external - view - returns (bool) - { + function supportsInterface(bytes4 interfaceID) external view returns (bool) { require(false, stub_error); interfaceID; return true; @@ -22,7 +18,7 @@ contract ERC165 is Dummy { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0 +/// @dev the ERC-165 identifier for this interface is 0x47dbc105 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -30,9 +26,7 @@ contract Collection is Dummy, ERC165 { /// @param value Propery value. /// @dev EVM selector for this function is: 0x2f073f66, /// or in textual repr: setCollectionProperty(string,bytes) - function setCollectionProperty(string memory key, bytes memory value) - public - { + function setCollectionProperty(string memory key, bytes memory value) public { require(false, stub_error); key; value; @@ -58,11 +52,7 @@ contract Collection is Dummy, ERC165 { /// @return bytes The property corresponding to the key. /// @dev EVM selector for this function is: 0xcf24fd6d, /// or in textual repr: collectionProperty(string) - function collectionProperty(string memory key) - public - view - returns (bytes memory) - { + function collectionProperty(string memory key) public view returns (bytes memory) { require(false, stub_error); key; dummy; @@ -95,6 +85,7 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Whether there is a pending sponsor. /// @dev EVM selector for this function is: 0x058ac185, /// or in textual repr: hasCollectionPendingSponsor() function hasCollectionPendingSponsor() public view returns (bool) { @@ -124,9 +115,9 @@ contract Collection is Dummy, ERC165 { /// Get current sponsor. /// /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - /// @dev EVM selector for this function is: 0xb66bbc14, - /// or in textual repr: getCollectionSponsor() - function getCollectionSponsor() public view returns (Tuple6 memory) { + /// @dev EVM selector for this function is: 0x6ec0a9f1, + /// or in textual repr: collectionSponsor() + function collectionSponsor() public view returns (Tuple6 memory) { require(false, stub_error); dummy; return Tuple6(0x0000000000000000000000000000000000000000, 0); @@ -234,9 +225,7 @@ contract Collection is Dummy, ERC165 { /// @param collections Addresses of collections that will be available for nesting. /// @dev EVM selector for this function is: 0x64872396, /// or in textual repr: setCollectionNesting(bool,address[]) - function setCollectionNesting(bool enable, address[] memory collections) - public - { + function setCollectionNesting(bool enable, address[] memory collections) public { require(false, stub_error); enable; collections; @@ -353,9 +342,9 @@ contract Collection is Dummy, ERC165 { /// @return `Fungible` or `NFT` or `ReFungible` /// @dev EVM selector for this function is: 0xd34b55b8, /// or in textual repr: uniqueCollectionType() - function uniqueCollectionType() public returns (string memory) { + function uniqueCollectionType() public view returns (string memory) { require(false, stub_error); - dummy = 0; + dummy; return ""; } @@ -450,11 +439,7 @@ contract ERC20Mintable is Dummy, ERC165 { /// @dev inlined interface contract ERC20Events { event Transfer(address indexed from, address indexed to, uint256 value); - event Approval( - address indexed owner, - address indexed spender, - uint256 value - ); + event Approval(address indexed owner, address indexed spender, uint256 value); } /// @dev the ERC-165 identifier for this interface is 0x942e8b22 @@ -537,11 +522,7 @@ contract ERC20 is Dummy, ERC165, ERC20Events { /// @dev EVM selector for this function is: 0xdd62ed3e, /// or in textual repr: allowance(address,address) - function allowance(address owner, address spender) - public - view - returns (uint256) - { + function allowance(address owner, address spender) public view returns (uint256) { require(false, stub_error); owner; spender; @@ -550,11 +531,4 @@ contract ERC20 is Dummy, ERC165, ERC20Events { } } -contract UniqueFungible is - Dummy, - ERC165, - ERC20, - ERC20Mintable, - ERC20UniqueExtensions, - Collection -{} +contract UniqueFungible is Dummy, ERC165, ERC20, ERC20Mintable, ERC20UniqueExtensions, Collection {} diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 586c74d785a03bcbc766f9aed028191392d456ef..0f113339e4dee6673004d2f148e7409d8686db9b 100644 GIT binary patch delta 362 zcmbQJJW+YWQ%07V*7dt4zhqQl^qtJd6ezPIJb|I%Z*)WQCL!T|!9<3a;Si=sBFp*7 z)l8cHAoU`NtlNO%i*&Z60+~mE%*B$zZ$V0c%$2Njb_1D?FoVjJ9rOef87BdyT8~Pd z1~L<&OrR?N$uF1`^5B+&)Ph8T3M$W}PXHU!kX&8+`W(=nSwPX+ls#KS5}7~149`2T z@*~j1b3iE&6R64;$ShdUWC&zd0+~e`ht+}1b|AB~(#r;DV)o`n<~C*~*3ijG>{`Ms z#fi+<%o119vn03ay)D}IYH160R1h8RR910 delta 376 zcmbQJJW+YWQ%06WI$KgFzhqQlTsE1HDNv>+Jb|I%Z*)WQw(LD3f{6?-!y!zOMAl`K ztC=+GLF$2=89?#HlEQCA5?RgznJZc6>;^I&fy_-p!u?=Ts6mxy(kBQeGEM?YO?r}a z9LP+BGJ&f6fy}8lW;+6zY(VA=!41cOhSva@Gp*})0hwJe_kfH6s)_?yQC<7`98fL~ z$gEA-vqdD4`2&#IdQ|E(*hr|w1q+%Cfwr9kN`aU_4Zc8Tk;Y+lATt`sEUomi0cyww zGRu@5^gwzyH!`;|Pc~*3V$7WE#_q<%x^6NjyOtvJu|(#BW(h2bd=6pJi7b4HteGGl zM-_~>c`f^7P6eCm^F(Duf@UT$>&ys05FK7Rd4-ooAQS5j2D4Q=uJ3<5IYH1604L&! AH2?qr diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index dbeb6ae210..03947adab2 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -10,11 +10,7 @@ contract Dummy { } contract ERC165 is Dummy { - function supportsInterface(bytes4 interfaceID) - external - view - returns (bool) - { + function supportsInterface(bytes4 interfaceID) external view returns (bool) { require(false, stub_error); interfaceID; return true; @@ -85,11 +81,7 @@ contract TokenProperties is Dummy, ERC165 { /// @return Property value bytes /// @dev EVM selector for this function is: 0x7228c327, /// or in textual repr: property(uint256,string) - function property(uint256 tokenId, string memory key) - public - view - returns (bytes memory) - { + function property(uint256 tokenId, string memory key) public view returns (bytes memory) { require(false, stub_error); tokenId; key; @@ -99,7 +91,7 @@ contract TokenProperties is Dummy, ERC165 { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0 +/// @dev the ERC-165 identifier for this interface is 0x47dbc105 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -107,9 +99,7 @@ contract Collection is Dummy, ERC165 { /// @param value Propery value. /// @dev EVM selector for this function is: 0x2f073f66, /// or in textual repr: setCollectionProperty(string,bytes) - function setCollectionProperty(string memory key, bytes memory value) - public - { + function setCollectionProperty(string memory key, bytes memory value) public { require(false, stub_error); key; value; @@ -135,11 +125,7 @@ contract Collection is Dummy, ERC165 { /// @return bytes The property corresponding to the key. /// @dev EVM selector for this function is: 0xcf24fd6d, /// or in textual repr: collectionProperty(string) - function collectionProperty(string memory key) - public - view - returns (bytes memory) - { + function collectionProperty(string memory key) public view returns (bytes memory) { require(false, stub_error); key; dummy; @@ -172,6 +158,7 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Whether there is a pending sponsor. /// @dev EVM selector for this function is: 0x058ac185, /// or in textual repr: hasCollectionPendingSponsor() function hasCollectionPendingSponsor() public view returns (bool) { @@ -201,9 +188,9 @@ contract Collection is Dummy, ERC165 { /// Get current sponsor. /// /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - /// @dev EVM selector for this function is: 0xb66bbc14, - /// or in textual repr: getCollectionSponsor() - function getCollectionSponsor() public view returns (Tuple17 memory) { + /// @dev EVM selector for this function is: 0x6ec0a9f1, + /// or in textual repr: collectionSponsor() + function collectionSponsor() public view returns (Tuple17 memory) { require(false, stub_error); dummy; return Tuple17(0x0000000000000000000000000000000000000000, 0); @@ -311,9 +298,7 @@ contract Collection is Dummy, ERC165 { /// @param collections Addresses of collections that will be available for nesting. /// @dev EVM selector for this function is: 0x64872396, /// or in textual repr: setCollectionNesting(bool,address[]) - function setCollectionNesting(bool enable, address[] memory collections) - public - { + function setCollectionNesting(bool enable, address[] memory collections) public { require(false, stub_error); enable; collections; @@ -430,9 +415,9 @@ contract Collection is Dummy, ERC165 { /// @return `Fungible` or `NFT` or `ReFungible` /// @dev EVM selector for this function is: 0xd34b55b8, /// or in textual repr: uniqueCollectionType() - function uniqueCollectionType() public returns (string memory) { + function uniqueCollectionType() public view returns (string memory) { require(false, stub_error); - dummy = 0; + dummy; return ""; } @@ -605,10 +590,7 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { /// @param tokenIds IDs of the minted NFTs /// @dev EVM selector for this function is: 0x44a9945e, /// or in textual repr: mintBulk(address,uint256[]) - function mintBulk(address to, uint256[] memory tokenIds) - public - returns (bool) - { + function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) { require(false, stub_error); to; tokenIds; @@ -623,10 +605,7 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { /// @param tokens array of pairs of token ID and token URI for minted tokens /// @dev EVM selector for this function is: 0x36543006, /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) - function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) - public - returns (bool) - { + function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) public returns (bool) { require(false, stub_error); to; tokens; @@ -661,11 +640,7 @@ contract ERC721Enumerable is Dummy, ERC165 { /// @dev Not implemented /// @dev EVM selector for this function is: 0x2f745c59, /// or in textual repr: tokenOfOwnerByIndex(address,uint256) - function tokenOfOwnerByIndex(address owner, uint256 index) - public - view - returns (uint256) - { + function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) { require(false, stub_error); owner; index; @@ -728,21 +703,9 @@ contract ERC721Metadata is Dummy, ERC165 { /// @dev inlined interface contract ERC721Events { - event Transfer( - address indexed from, - address indexed to, - uint256 indexed tokenId - ); - event Approval( - address indexed owner, - address indexed approved, - uint256 indexed tokenId - ); - event ApprovalForAll( - address indexed owner, - address indexed operator, - bool approved - ); + event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); + event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); + event ApprovalForAll(address indexed owner, address indexed operator, bool approved); } /// @title ERC-721 Non-Fungible Token Standard @@ -870,11 +833,7 @@ contract ERC721 is Dummy, ERC165, ERC721Events { /// @dev Not implemented /// @dev EVM selector for this function is: 0xe985e9c5, /// or in textual repr: isApprovedForAll(address,address) - function isApprovedForAll(address owner, address operator) - public - view - returns (address) - { + function isApprovedForAll(address owner, address operator) public view returns (address) { require(false, stub_error); owner; operator; diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index d89a40340703d19fd465afc48fe685175645f7b1..427f807ced448659cf057263b31169b096ab3cdc 100644 GIT binary patch delta 358 zcmbQEJV$xMQ%07V*7dt4zhqQlOqat(Q1QQuvhC`Sli7aYB z<|ZNGejxMK1m0mVL6U#O?GS6pb zV$GXe&8{s}m&p9kEP*AF<9=9lB8y}q>$=It>~6wf7FfI$Ccb$G`(#dqnTZG68WSeT iz1ul^YsgDptJ&(kl@fb`zN3j0y!Ij;)^AP-$IqFWSz4c$n*h+;ALd_*5Wsrgi-;AagOYF+f#uASJphBnkBF#a@-G#PGpfxWNn%p&+f*=dVI1HyS5OB z50-6($!^}kKABVDi1UU=S(-2R%72<&Gvy|WdfWT6d!K7gJa>crvd*#8dGV981q}i6 CTa>>5 diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index 92fa860b68..c65d9a2d5e 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -10,11 +10,7 @@ contract Dummy { } contract ERC165 is Dummy { - function supportsInterface(bytes4 interfaceID) - external - view - returns (bool) - { + function supportsInterface(bytes4 interfaceID) external view returns (bool) { require(false, stub_error); interfaceID; return true; @@ -85,11 +81,7 @@ contract TokenProperties is Dummy, ERC165 { /// @return Property value bytes /// @dev EVM selector for this function is: 0x7228c327, /// or in textual repr: property(uint256,string) - function property(uint256 tokenId, string memory key) - public - view - returns (bytes memory) - { + function property(uint256 tokenId, string memory key) public view returns (bytes memory) { require(false, stub_error); tokenId; key; @@ -99,7 +91,7 @@ contract TokenProperties is Dummy, ERC165 { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0 +/// @dev the ERC-165 identifier for this interface is 0x47dbc105 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -107,9 +99,7 @@ contract Collection is Dummy, ERC165 { /// @param value Propery value. /// @dev EVM selector for this function is: 0x2f073f66, /// or in textual repr: setCollectionProperty(string,bytes) - function setCollectionProperty(string memory key, bytes memory value) - public - { + function setCollectionProperty(string memory key, bytes memory value) public { require(false, stub_error); key; value; @@ -135,11 +125,7 @@ contract Collection is Dummy, ERC165 { /// @return bytes The property corresponding to the key. /// @dev EVM selector for this function is: 0xcf24fd6d, /// or in textual repr: collectionProperty(string) - function collectionProperty(string memory key) - public - view - returns (bytes memory) - { + function collectionProperty(string memory key) public view returns (bytes memory) { require(false, stub_error); key; dummy; @@ -172,6 +158,7 @@ contract Collection is Dummy, ERC165 { dummy = 0; } + /// Whether there is a pending sponsor. /// @dev EVM selector for this function is: 0x058ac185, /// or in textual repr: hasCollectionPendingSponsor() function hasCollectionPendingSponsor() public view returns (bool) { @@ -201,9 +188,9 @@ contract Collection is Dummy, ERC165 { /// Get current sponsor. /// /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - /// @dev EVM selector for this function is: 0xb66bbc14, - /// or in textual repr: getCollectionSponsor() - function getCollectionSponsor() public view returns (Tuple17 memory) { + /// @dev EVM selector for this function is: 0x6ec0a9f1, + /// or in textual repr: collectionSponsor() + function collectionSponsor() public view returns (Tuple17 memory) { require(false, stub_error); dummy; return Tuple17(0x0000000000000000000000000000000000000000, 0); @@ -311,9 +298,7 @@ contract Collection is Dummy, ERC165 { /// @param collections Addresses of collections that will be available for nesting. /// @dev EVM selector for this function is: 0x64872396, /// or in textual repr: setCollectionNesting(bool,address[]) - function setCollectionNesting(bool enable, address[] memory collections) - public - { + function setCollectionNesting(bool enable, address[] memory collections) public { require(false, stub_error); enable; collections; @@ -430,9 +415,9 @@ contract Collection is Dummy, ERC165 { /// @return `Fungible` or `NFT` or `ReFungible` /// @dev EVM selector for this function is: 0xd34b55b8, /// or in textual repr: uniqueCollectionType() - function uniqueCollectionType() public returns (string memory) { + function uniqueCollectionType() public view returns (string memory) { require(false, stub_error); - dummy = 0; + dummy; return ""; } @@ -607,10 +592,7 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { /// @param tokenIds IDs of the minted RFTs /// @dev EVM selector for this function is: 0x44a9945e, /// or in textual repr: mintBulk(address,uint256[]) - function mintBulk(address to, uint256[] memory tokenIds) - public - returns (bool) - { + function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) { require(false, stub_error); to; tokenIds; @@ -625,10 +607,7 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { /// @param tokens array of pairs of token ID and token URI for minted tokens /// @dev EVM selector for this function is: 0x36543006, /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) - function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) - public - returns (bool) - { + function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) public returns (bool) { require(false, stub_error); to; tokens; @@ -675,11 +654,7 @@ contract ERC721Enumerable is Dummy, ERC165 { /// Not implemented /// @dev EVM selector for this function is: 0x2f745c59, /// or in textual repr: tokenOfOwnerByIndex(address,uint256) - function tokenOfOwnerByIndex(address owner, uint256 index) - public - view - returns (uint256) - { + function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) { require(false, stub_error); owner; index; @@ -740,21 +715,9 @@ contract ERC721Metadata is Dummy, ERC165 { /// @dev inlined interface contract ERC721Events { - event Transfer( - address indexed from, - address indexed to, - uint256 indexed tokenId - ); - event Approval( - address indexed owner, - address indexed approved, - uint256 indexed tokenId - ); - event ApprovalForAll( - address indexed owner, - address indexed operator, - bool approved - ); + event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); + event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); + event ApprovalForAll(address indexed owner, address indexed operator, bool approved); } /// @title ERC-721 Non-Fungible Token Standard @@ -880,11 +843,7 @@ contract ERC721 is Dummy, ERC165, ERC721Events { /// @dev Not implemented /// @dev EVM selector for this function is: 0xe985e9c5, /// or in textual repr: isApprovedForAll(address,address) - function isApprovedForAll(address owner, address operator) - public - view - returns (address) - { + function isApprovedForAll(address owner, address operator) public view returns (address) { require(false, stub_error); owner; operator; diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.raw b/pallets/refungible/src/stubs/UniqueRefungibleToken.raw index b3837138deccefbf8c6f21ed6b1e6ce0917cd9cb..e31434a4746be17b8f396df77cb331dff46649ab 100644 GIT binary patch delta 44 zcmV+{0Mq}J43rG8!v!Gua~XbIRFixf2FsW-PQ;_w8DV0m;aUQDNwl;{`FU CQWM(% diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.sol b/pallets/refungible/src/stubs/UniqueRefungibleToken.sol index a8bea20b5f..d777f067dd 100644 --- a/pallets/refungible/src/stubs/UniqueRefungibleToken.sol +++ b/pallets/refungible/src/stubs/UniqueRefungibleToken.sol @@ -10,11 +10,7 @@ contract Dummy { } contract ERC165 is Dummy { - function supportsInterface(bytes4 interfaceID) - external - view - returns (bool) - { + function supportsInterface(bytes4 interfaceID) external view returns (bool) { require(false, stub_error); interfaceID; return true; @@ -72,11 +68,7 @@ contract ERC20UniqueExtensions is Dummy, ERC165 { /// @dev inlined interface contract ERC20Events { event Transfer(address indexed from, address indexed to, uint256 value); - event Approval( - address indexed owner, - address indexed spender, - uint256 value - ); + event Approval(address indexed owner, address indexed spender, uint256 value); } /// @title Standard ERC20 token @@ -188,11 +180,7 @@ contract ERC20 is Dummy, ERC165, ERC20Events { /// @return A uint256 specifying the amount of tokens still available for the spender. /// @dev EVM selector for this function is: 0xdd62ed3e, /// or in textual repr: allowance(address,address) - function allowance(address owner, address spender) - public - view - returns (uint256) - { + function allowance(address owner, address spender) public view returns (uint256) { require(false, stub_error); owner; spender; @@ -201,10 +189,4 @@ contract ERC20 is Dummy, ERC165, ERC20Events { } } -contract UniqueRefungibleToken is - Dummy, - ERC165, - ERC20, - ERC20UniqueExtensions, - ERC1633 -{} +contract UniqueRefungibleToken is Dummy, ERC165, ERC20, ERC20UniqueExtensions, ERC1633 {} diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index c7f9a59c2311260fcae79aff5cce5569abe20804..0499e178e4b4b45e4d99621b78b5336591d7876d 100644 GIT binary patch delta 44 zcmV+{0Mq}_3(yO&e+3{{U?e{T!MdV8(hSAcveZrRJvXqCF=Rbu*r%5BE#%mfp9L|# C92Ers delta 44 zcmV+{0Mq}_3(yO&e+3}h2t|&e%kN~y;`C { await submitTransactionAsync(sponsor, confirmTx); expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; - const sponsorTuple = await collectionEvm.methods.getCollectionSponsor().call({from: owner}); + const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner}); expect(bigIntToSub(api, BigInt(sponsorTuple[1]))).to.be.eq(sponsor.address); }); @@ -77,7 +77,7 @@ describe('evm collection sponsoring', () => { await collectionEvm.methods.removeCollectionSponsor().send({from: owner}); - const sponsorTuple = await collectionEvm.methods.getCollectionSponsor().call({from: owner}); + const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner}); expect(sponsorTuple.field_0).to.be.eq('0x0000000000000000000000000000000000000000'); }); diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index 6c80caf1fb..535d804db5 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -157,6 +157,23 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "collectionSponsor", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "field_0", "type": "address" }, + { "internalType": "uint256", "name": "field_1", "type": "uint256" } + ], + "internalType": "struct Tuple6", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "confirmCollectionSponsorship", @@ -185,23 +202,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "getCollectionSponsor", - "outputs": [ - { - "components": [ - { "internalType": "address", "name": "field_0", "type": "address" }, - { "internalType": "uint256", "name": "field_1", "type": "uint256" } - ], - "internalType": "struct Tuple6", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "hasCollectionPendingSponsor", @@ -453,7 +453,7 @@ "inputs": [], "name": "uniqueCollectionType", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" } ] diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index 5a0d6ee990..c760d51b4b 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -187,6 +187,23 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "collectionSponsor", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "field_0", "type": "address" }, + { "internalType": "uint256", "name": "field_1", "type": "uint256" } + ], + "internalType": "struct Tuple17", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "confirmCollectionSponsorship", @@ -234,23 +251,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "getCollectionSponsor", - "outputs": [ - { - "components": [ - { "internalType": "address", "name": "field_0", "type": "address" }, - { "internalType": "uint256", "name": "field_1", "type": "uint256" } - ], - "internalType": "struct Tuple17", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "hasCollectionPendingSponsor", @@ -651,7 +651,7 @@ "inputs": [], "name": "uniqueCollectionType", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" } ] diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index 3e5f9d84c3..691c0aeb8a 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -187,6 +187,23 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "collectionSponsor", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "field_0", "type": "address" }, + { "internalType": "uint256", "name": "field_1", "type": "uint256" } + ], + "internalType": "struct Tuple17", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "confirmCollectionSponsorship", @@ -234,23 +251,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "getCollectionSponsor", - "outputs": [ - { - "components": [ - { "internalType": "address", "name": "field_0", "type": "address" }, - { "internalType": "uint256", "name": "field_1", "type": "uint256" } - ], - "internalType": "struct Tuple17", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "hasCollectionPendingSponsor", @@ -660,7 +660,7 @@ "inputs": [], "name": "uniqueCollectionType", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" } ] From ceb51feb97c80bdf070d490a5046dc1e5c1343a1 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Mon, 19 Sep 2022 07:13:22 +0000 Subject: [PATCH 0933/1274] feat: enable refungible for quartz --- runtime/common/construct_runtime/mod.rs | 2 +- runtime/quartz/Cargo.toml | 2 +- tests/src/pallet-presence.test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/common/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs index 859e089602..9dda013aae 100644 --- a/runtime/common/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -65,7 +65,7 @@ macro_rules! construct_runtime { Common: pallet_common::{Pallet, Storage, Event} = 66, Fungible: pallet_fungible::{Pallet, Storage} = 67, - #[runtimes(opal)] + #[runtimes(opal, quartz)] Refungible: pallet_refungible::{Pallet, Storage} = 68, Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69, diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 71e3ce848e..ae7fd46adf 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -120,7 +120,7 @@ std = [ "orml-vesting/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] -quartz-runtime = [] +quartz-runtime = ['refungible'] refungible = [] scheduler = [] diff --git a/tests/src/pallet-presence.test.ts b/tests/src/pallet-presence.test.ts index 899c342c0e..c9f5638ec5 100644 --- a/tests/src/pallet-presence.test.ts +++ b/tests/src/pallet-presence.test.ts @@ -67,7 +67,7 @@ describe('Pallet presence', () => { if (chain.eq('OPAL by UNIQUE')) { requiredPallets.push(refungible, scheduler, appPromotion, ...rmrkPallets); } else if (chain.eq('QUARTZ by UNIQUE')) { - // Insert Quartz additional pallets here + requiredPallets.push(refungible); } else if (chain.eq('UNIQUE')) { // Insert Unique additional pallets here } From 231992803ffee70254f3e4198517234cdd936813 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 19 Sep 2022 12:21:27 +0000 Subject: [PATCH 0934/1274] fix: rename some methods --- pallets/evm-contract-helpers/src/eth.rs | 6 +- .../src/stubs/ContractHelpers.raw | Bin 1848 -> 1848 bytes .../src/stubs/ContractHelpers.sol | 20 ++-- tests/src/eth/api/ContractHelpers.sol | 20 ++-- tests/src/eth/contractSponsoring.test.ts | 10 +- tests/src/eth/util/contractHelpersAbi.json | 94 +++++++++--------- 6 files changed, 75 insertions(+), 75 deletions(-) diff --git a/pallets/evm-contract-helpers/src/eth.rs b/pallets/evm-contract-helpers/src/eth.rs index 787b9b4ba8..9d41395e42 100644 --- a/pallets/evm-contract-helpers/src/eth.rs +++ b/pallets/evm-contract-helpers/src/eth.rs @@ -169,7 +169,7 @@ where /// /// @param contractAddress The contract for which a sponsor is requested. /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> { + fn sponsor(&self, contract_address: address) -> Result<(address, uint256)> { let sponsor = Pallet::::get_sponsor(contract_address).ok_or("Contract has no sponsor")?; Ok(pallet_common::eth::convert_cross_account_to_tuple::( @@ -220,7 +220,7 @@ where /// Get current contract sponsoring rate limit /// @param contractAddress Contract to get sponsoring rate limit of /// @return uint32 Amount of blocks between two sponsored transactions - fn get_sponsoring_rate_limit(&self, contract_address: address) -> Result { + fn sponsoring_rate_limit(&self, contract_address: address) -> Result { self.recorder().consume_sload()?; Ok(>::get(contract_address) @@ -273,7 +273,7 @@ where /// @param contractAddress Contract to get sponsoring fee limit of /// @return uint256 Maximum amount of fee that could be spent by single /// transaction - fn get_sponsoring_fee_limit(&self, contract_address: address) -> Result { + fn sponsoring_fee_limit(&self, contract_address: address) -> Result { self.recorder().consume_sload()?; Ok(get_sponsoring_fee_limit::(contract_address)) diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw index 67dda44777d5733dee28067035a8df00fcc6c617..256cf98065c43a3eafc4b8b2894c91a251e408cb 100644 GIT binary patch delta 199 zcmdnNw}WrPK}O-S9Dj4cM25BD4avug-sb?Bg_G|yih3vk1wP2{nkH8{Lo$GC?Gf@h(uReA`J5pp*!Z+4=qEIv`VNvLTZwqtaw| zCVQ6B?PhF~yO>@~e!!=!RsFi9iicfKuh#PI3UHq=C%N?>E;$^-gze zV}_czda?r(8>8lAcP4w5M4n%JCwDQunEakugynl8j&esNl~k1Mf*G><3Il|n51kn TKh4Ijd;XW}xi*oL+1U*N`Ceg( diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol index 8090e536d5..78098a6478 100644 --- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol +++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol @@ -25,7 +25,7 @@ contract ContractHelpersEvents { } /// @title Magic contract, which allows users to reconfigure other contracts -/// @dev the ERC-165 identifier for this interface is 0x172cb4fb +/// @dev the ERC-165 identifier for this interface is 0x30afad04 contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// Get user, which deployed specified contract /// @dev May return zero address in case if contract is deployed @@ -94,9 +94,9 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// /// @param contractAddress The contract for which a sponsor is requested. /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - /// @dev EVM selector for this function is: 0x743fc745, - /// or in textual repr: getSponsor(address) - function getSponsor(address contractAddress) public view returns (Tuple0 memory) { + /// @dev EVM selector for this function is: 0x766c4f37, + /// or in textual repr: sponsor(address) + function sponsor(address contractAddress) public view returns (Tuple0 memory) { require(false, stub_error); contractAddress; dummy; @@ -150,9 +150,9 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// Get current contract sponsoring rate limit /// @param contractAddress Contract to get sponsoring rate limit of /// @return uint32 Amount of blocks between two sponsored transactions - /// @dev EVM selector for this function is: 0x610cfabd, - /// or in textual repr: getSponsoringRateLimit(address) - function getSponsoringRateLimit(address contractAddress) public view returns (uint32) { + /// @dev EVM selector for this function is: 0xf29694d8, + /// or in textual repr: sponsoringRateLimit(address) + function sponsoringRateLimit(address contractAddress) public view returns (uint32) { require(false, stub_error); contractAddress; dummy; @@ -193,9 +193,9 @@ contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// @param contractAddress Contract to get sponsoring fee limit of /// @return uint256 Maximum amount of fee that could be spent by single /// transaction - /// @dev EVM selector for this function is: 0xc3fdc9ee, - /// or in textual repr: getSponsoringFeeLimit(address) - function getSponsoringFeeLimit(address contractAddress) public view returns (uint256) { + /// @dev EVM selector for this function is: 0x75b73606, + /// or in textual repr: sponsoringFeeLimit(address) + function sponsoringFeeLimit(address contractAddress) public view returns (uint256) { require(false, stub_error); contractAddress; dummy; diff --git a/tests/src/eth/api/ContractHelpers.sol b/tests/src/eth/api/ContractHelpers.sol index 9062e643bd..dd0970b96b 100644 --- a/tests/src/eth/api/ContractHelpers.sol +++ b/tests/src/eth/api/ContractHelpers.sol @@ -20,7 +20,7 @@ interface ContractHelpersEvents { } /// @title Magic contract, which allows users to reconfigure other contracts -/// @dev the ERC-165 identifier for this interface is 0x172cb4fb +/// @dev the ERC-165 identifier for this interface is 0x30afad04 interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// Get user, which deployed specified contract /// @dev May return zero address in case if contract is deployed @@ -67,9 +67,9 @@ interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// /// @param contractAddress The contract for which a sponsor is requested. /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. - /// @dev EVM selector for this function is: 0x743fc745, - /// or in textual repr: getSponsor(address) - function getSponsor(address contractAddress) external view returns (Tuple0 memory); + /// @dev EVM selector for this function is: 0x766c4f37, + /// or in textual repr: sponsor(address) + function sponsor(address contractAddress) external view returns (Tuple0 memory); /// Check tat contract has confirmed sponsor. /// @@ -98,9 +98,9 @@ interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// Get current contract sponsoring rate limit /// @param contractAddress Contract to get sponsoring rate limit of /// @return uint32 Amount of blocks between two sponsored transactions - /// @dev EVM selector for this function is: 0x610cfabd, - /// or in textual repr: getSponsoringRateLimit(address) - function getSponsoringRateLimit(address contractAddress) external view returns (uint32); + /// @dev EVM selector for this function is: 0xf29694d8, + /// or in textual repr: sponsoringRateLimit(address) + function sponsoringRateLimit(address contractAddress) external view returns (uint32); /// Set contract sponsoring rate limit /// @dev Sponsoring rate limit - is a minimum amount of blocks that should @@ -126,9 +126,9 @@ interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents { /// @param contractAddress Contract to get sponsoring fee limit of /// @return uint256 Maximum amount of fee that could be spent by single /// transaction - /// @dev EVM selector for this function is: 0xc3fdc9ee, - /// or in textual repr: getSponsoringFeeLimit(address) - function getSponsoringFeeLimit(address contractAddress) external view returns (uint256); + /// @dev EVM selector for this function is: 0x75b73606, + /// or in textual repr: sponsoringFeeLimit(address) + function sponsoringFeeLimit(address contractAddress) external view returns (uint256); /// Is specified user present in contract allow list /// @dev Contract owner always implicitly included diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index cedb1f411c..7447552cdf 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -223,7 +223,7 @@ describe('Sponsoring EVM contracts', () => { const helpers = contractHelpers(web3, owner); await helpers.methods.selfSponsoredEnable(flipper.options.address).send(); - const result = await helpers.methods.getSponsor(flipper.options.address).call(); + const result = await helpers.methods.sponsor(flipper.options.address).call(); expect(result[0]).to.be.eq(flipper.options.address); expect(result[1]).to.be.eq('0'); @@ -237,7 +237,7 @@ describe('Sponsoring EVM contracts', () => { await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); - const result = await helpers.methods.getSponsor(flipper.options.address).call(); + const result = await helpers.methods.sponsor(flipper.options.address).call(); expect(result[0]).to.be.eq(sponsor); expect(result[1]).to.be.eq('0'); @@ -482,7 +482,7 @@ describe('Sponsoring EVM contracts', () => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const flipper = await deployFlipper(web3, owner); const helpers = contractHelpers(web3, owner); - expect(await helpers.methods.getSponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200'); + expect(await helpers.methods.sponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200'); }); }); @@ -551,7 +551,7 @@ describe('Sponsoring Fee Limit', () => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const flipper = await deployFlipper(web3, owner); const helpers = contractHelpers(web3, owner); - expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935'); + expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935'); }); itWeb3('Set fee limit', async ({api, web3, privateKeyWrapper}) => { @@ -559,7 +559,7 @@ describe('Sponsoring Fee Limit', () => { const flipper = await deployFlipper(web3, owner); const helpers = contractHelpers(web3, owner); await helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send(); - expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100'); + expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100'); }); itWeb3('Negative test - set fee limit by non-owner', async ({api, web3, privateKeyWrapper}) => { diff --git a/tests/src/eth/util/contractHelpersAbi.json b/tests/src/eth/util/contractHelpersAbi.json index a4686d431c..f10d1e5a83 100644 --- a/tests/src/eth/util/contractHelpersAbi.json +++ b/tests/src/eth/util/contractHelpersAbi.json @@ -111,18 +111,8 @@ "type": "address" } ], - "name": "getSponsor", - "outputs": [ - { - "components": [ - { "internalType": "address", "name": "field_0", "type": "address" }, - { "internalType": "uint256", "name": "field_1", "type": "uint256" } - ], - "internalType": "struct Tuple0", - "name": "", - "type": "tuple" - } - ], + "name": "hasPendingSponsor", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, @@ -134,8 +124,8 @@ "type": "address" } ], - "name": "getSponsoringFeeLimit", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "hasSponsor", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, @@ -147,9 +137,9 @@ "type": "address" } ], - "name": "getSponsoringRateLimit", - "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], - "stateMutability": "view", + "name": "removeSponsor", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { @@ -160,9 +150,9 @@ "type": "address" } ], - "name": "hasPendingSponsor", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", + "name": "selfSponsoredEnable", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { @@ -171,11 +161,12 @@ "internalType": "address", "name": "contractAddress", "type": "address" - } + }, + { "internalType": "address", "name": "sponsor", "type": "address" } ], - "name": "hasSponsor", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", + "name": "setSponsor", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { @@ -184,9 +175,10 @@ "internalType": "address", "name": "contractAddress", "type": "address" - } + }, + { "internalType": "uint256", "name": "feeLimit", "type": "uint256" } ], - "name": "removeSponsor", + "name": "setSponsoringFeeLimit", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -197,9 +189,10 @@ "internalType": "address", "name": "contractAddress", "type": "address" - } + }, + { "internalType": "uint8", "name": "mode", "type": "uint8" } ], - "name": "selfSponsoredEnable", + "name": "setSponsoringMode", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -211,9 +204,9 @@ "name": "contractAddress", "type": "address" }, - { "internalType": "address", "name": "sponsor", "type": "address" } + { "internalType": "uint32", "name": "rateLimit", "type": "uint32" } ], - "name": "setSponsor", + "name": "setSponsoringRateLimit", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -224,12 +217,21 @@ "internalType": "address", "name": "contractAddress", "type": "address" - }, - { "internalType": "uint256", "name": "feeLimit", "type": "uint256" } + } ], - "name": "setSponsoringFeeLimit", - "outputs": [], - "stateMutability": "nonpayable", + "name": "sponsor", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "field_0", "type": "address" }, + { "internalType": "uint256", "name": "field_1", "type": "uint256" } + ], + "internalType": "struct Tuple0", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", "type": "function" }, { @@ -238,12 +240,11 @@ "internalType": "address", "name": "contractAddress", "type": "address" - }, - { "internalType": "uint8", "name": "mode", "type": "uint8" } + } ], - "name": "setSponsoringMode", - "outputs": [], - "stateMutability": "nonpayable", + "name": "sponsoringEnabled", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", "type": "function" }, { @@ -252,12 +253,11 @@ "internalType": "address", "name": "contractAddress", "type": "address" - }, - { "internalType": "uint32", "name": "rateLimit", "type": "uint32" } + } ], - "name": "setSponsoringRateLimit", - "outputs": [], - "stateMutability": "nonpayable", + "name": "sponsoringFeeLimit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", "type": "function" }, { @@ -268,8 +268,8 @@ "type": "address" } ], - "name": "sponsoringEnabled", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "name": "sponsoringRateLimit", + "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, From d80ffd97d5f26b18e55eb0ea42d1508f3f6d7066 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 19 Sep 2022 13:38:06 +0000 Subject: [PATCH 0935/1274] fix: use while instead of loop --- .../evm-coder/procedural/src/solidity_interface.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/crates/evm-coder/procedural/src/solidity_interface.rs b/crates/evm-coder/procedural/src/solidity_interface.rs index eee69967e3..9b2fdb69be 100644 --- a/crates/evm-coder/procedural/src/solidity_interface.rs +++ b/crates/evm-coder/procedural/src/solidity_interface.rs @@ -158,7 +158,7 @@ impl Parse for IsList { parenthesized!(contents in input); let input = contents; - loop { + while !input.is_empty() { let lookahead = input.lookahead1(); if lookahead.peek(Token![if]) { input.parse::()?; @@ -181,16 +181,10 @@ impl Parse for IsList { if via.replace((ty, method)).is_some() { return Err(syn::Error::new(input.span(), "via is already set")); } - } else if input.is_empty() { - break; - } else { - return Err(lookahead.error()); - } - - if input.peek(Token![,]) { + } else if input.peek(Token![,]) { input.parse::()?; } else { - break; + return Err(lookahead.error()); } } } else if lookahead.peek(Token![,]) || input.is_empty() { From 68abc1e2a3609da5a302910537b607b54aa0b588 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 19 Sep 2022 13:49:02 +0000 Subject: [PATCH 0936/1274] feat: use returns kw with via kw --- crates/evm-coder/procedural/src/solidity_interface.rs | 3 ++- pallets/fungible/src/erc.rs | 2 +- pallets/nonfungible/src/erc.rs | 2 +- pallets/refungible/src/erc.rs | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/evm-coder/procedural/src/solidity_interface.rs b/crates/evm-coder/procedural/src/solidity_interface.rs index 9b2fdb69be..30e9dd8c11 100644 --- a/crates/evm-coder/procedural/src/solidity_interface.rs +++ b/crates/evm-coder/procedural/src/solidity_interface.rs @@ -175,7 +175,7 @@ impl Parse for IsList { parenthesized!(contents in input); let method = contents.parse::()?; - contents.parse::()?; + contents.parse::()?; let ty = contents.parse::()?; if via.replace((ty, method)).is_some() { @@ -536,6 +536,7 @@ mod kw { syn::custom_keyword!(weight); syn::custom_keyword!(via); + syn::custom_keyword!(returns); syn::custom_keyword!(name); syn::custom_keyword!(is); syn::custom_keyword!(inline_is); diff --git a/pallets/fungible/src/erc.rs b/pallets/fungible/src/erc.rs index ac86b9d7ed..088f841b34 100644 --- a/pallets/fungible/src/erc.rs +++ b/pallets/fungible/src/erc.rs @@ -199,7 +199,7 @@ impl FungibleHandle { ERC20, ERC20Mintable, ERC20UniqueExtensions, - Collection(via(common_mut, CollectionHandle)), + Collection(via(common_mut returns CollectionHandle)), ) )] impl FungibleHandle where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {} diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index ddd9271b75..28ae9f866e 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -736,7 +736,7 @@ impl NonfungibleHandle { ERC721UniqueExtensions, ERC721Mintable, ERC721Burnable, - Collection(via(common_mut, CollectionHandle)), + Collection(via(common_mut returns CollectionHandle)), TokenProperties, ) )] diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index e4696240f6..66140d384c 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -785,7 +785,7 @@ impl RefungibleHandle { ERC721UniqueExtensions, ERC721Mintable, ERC721Burnable, - Collection(via(common_mut, CollectionHandle)), + Collection(via(common_mut returns CollectionHandle)), TokenProperties, ) )] From 296267302144f024724fe9527cd991547337ec4d Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 19 Sep 2022 14:04:35 +0000 Subject: [PATCH 0937/1274] fix: parse comma at the end --- crates/evm-coder/procedural/src/solidity_interface.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/evm-coder/procedural/src/solidity_interface.rs b/crates/evm-coder/procedural/src/solidity_interface.rs index 30e9dd8c11..ca5f8bf358 100644 --- a/crates/evm-coder/procedural/src/solidity_interface.rs +++ b/crates/evm-coder/procedural/src/solidity_interface.rs @@ -181,11 +181,13 @@ impl Parse for IsList { if via.replace((ty, method)).is_some() { return Err(syn::Error::new(input.span(), "via is already set")); } - } else if input.peek(Token![,]) { - input.parse::()?; } else { return Err(lookahead.error()); } + + if input.peek(Token![,]) { + input.parse::()?; + } } } else if lookahead.peek(Token![,]) || input.is_empty() { // Pass From 4e55e3985dacf83abd6e83124a0f8b366fd15e3a Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Mon, 19 Sep 2022 14:02:47 +0000 Subject: [PATCH 0938/1274] tests: thorough event logging + a few more tests refactored --- tests/package.json | 1 + tests/src/fungible.test.ts | 14 ++--- tests/src/inflation.test.ts | 59 +++++++++--------- tests/src/refungible.test.ts | 49 ++++++++------- tests/src/tx-version-presence.test.ts | 2 +- tests/src/util/playgrounds/types.ts | 31 +++++++--- tests/src/util/playgrounds/unique.ts | 87 ++++++++++++++++++++++----- 7 files changed, 159 insertions(+), 84 deletions(-) diff --git a/tests/package.json b/tests/package.json index 093f65660a..16805480da 100644 --- a/tests/package.json +++ b/tests/package.json @@ -64,6 +64,7 @@ "testTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/transfer.test.ts", "testBurnItem": "mocha --timeout 9999999 -r ts-node/register ./**/burnItem.test.ts", "testAdminTransferAndBurn": "mocha --timeout 9999999 -r ts-node/register ./**/adminTransferAndBurn.test.ts", + "testMintModes": "mocha --timeout 9999999 -r ts-node/register ./**/mintModes.test.ts", "testSetMintPermission": "mocha --timeout 9999999 -r ts-node/register ./**/setMintPermission.test.ts", "testSetPublicAccessMode": "mocha --timeout 9999999 -r ts-node/register ./**/setPublicAccessMode.test.ts", "testCreditFeesToTreasury": "mocha --timeout 9999999 -r ts-node/register ./**/creditFeesToTreasury.test.ts", diff --git a/tests/src/fungible.test.ts b/tests/src/fungible.test.ts index 89bd4e0304..5fdf0ecd4d 100644 --- a/tests/src/fungible.test.ts +++ b/tests/src/fungible.test.ts @@ -15,18 +15,18 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {U128_MAX} from './util/helpers'; import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; -// todo:playgrounds get rid of globals -let alice: IKeyringPair; -let bob: IKeyringPair; +const U128_MAX = (1n << 128n) - 1n; describe('integration test: Fungible functionality:', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - alice = privateKey('//Alice'); - bob = privateKey('//Bob'); + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor); }); }); @@ -82,7 +82,7 @@ describe('integration test: Fungible functionality:', () => { expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(60n); expect(await collection.getBalance(ethAcc)).to.be.equal(140n); - await expect(collection.transfer(alice, {Substrate: bob.address}, 350n)).to.eventually.be.rejected; + await expect(collection.transfer(alice, {Substrate: bob.address}, 350n)).to.eventually.be.rejectedWith(/common\.TokenValueTooLow/); }); itSub('Tokens multiple creation', async ({helper}) => { diff --git a/tests/src/inflation.test.ts b/tests/src/inflation.test.ts index 9e8f4990e3..015ceb1aeb 100644 --- a/tests/src/inflation.test.ts +++ b/tests/src/inflation.test.ts @@ -14,42 +14,45 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {IKeyringPair} from '@polkadot/types/types'; +import {expect, itSub, usingPlaygrounds} from './util/playgrounds'; +// todo:playgrounds requires sudo, look into on the later stage describe('integration test: Inflation', () => { - it('First year inflation is 10%', async () => { - await usingApi(async (api, privateKeyWrapper) => { + let superuser: IKeyringPair; - // Make sure non-sudo can't start inflation - const tx = api.tx.inflation.startInflation(1); - const bob = privateKeyWrapper('//Bob'); - await expect(submitTransactionExpectFailAsync(bob, tx)).to.be.rejected; + before(async () => { + await usingPlaygrounds(async (_, privateKey) => { + superuser = privateKey('//Alice'); + }); + }); + + itSub('First year inflation is 10%', async ({helper}) => { + // Make sure non-sudo can't start inflation + const [bob] = await helper.arrange.createAccounts([10n], superuser); - // Start inflation on relay block 1 (Alice is sudo) - const alice = privateKeyWrapper('//Alice'); - const sudoTx = api.tx.sudo.sudo(tx as any); - await submitTransactionAsync(alice, sudoTx); + await expect(helper.executeExtrinsic(bob, 'api.tx.inflation.startInflation', [1])).to.be.rejectedWith(/BadOrigin/); - const blockInterval = (api.consts.inflation.inflationBlockInterval).toBigInt(); - const totalIssuanceStart = (await api.query.inflation.startingYearTotalIssuance()).toBigInt(); - const blockInflation = (await api.query.inflation.blockInflation()).toBigInt(); + // Make sure superuser can't start inflation without explicit sudo + await expect(helper.executeExtrinsic(superuser, 'api.tx.inflation.startInflation', [1])).to.be.rejectedWith(/BadOrigin/); - const YEAR = 5259600n; // 6-second block. Blocks in one year - // const YEAR = 2629800n; // 12-second block. Blocks in one year + // Start inflation on relay block 1 (Alice is sudo) + const tx = helper.constructApiCall('api.tx.inflation.startInflation', [1]); + await expect(helper.executeExtrinsic(superuser, 'api.tx.sudo.sudo', [tx])).to.not.be.rejected; - const totalExpectedInflation = totalIssuanceStart / 10n; - const totalActualInflation = blockInflation * YEAR / blockInterval; + const blockInterval = (helper.api!.consts.inflation.inflationBlockInterval as any).toBigInt(); + const totalIssuanceStart = ((await helper.api!.query.inflation.startingYearTotalIssuance()) as any).toBigInt(); + const blockInflation = (await helper.api!.query.inflation.blockInflation() as any).toBigInt(); - const tolerance = 0.00001; // Relative difference per year between theoretical and actual inflation - const expectedInflation = totalExpectedInflation / totalActualInflation - 1n; + const YEAR = 5259600n; // 6-second block. Blocks in one year + // const YEAR = 2629800n; // 12-second block. Blocks in one year - expect(Math.abs(Number(expectedInflation))).to.be.lessThanOrEqual(tolerance); - }); - }); + const totalExpectedInflation = totalIssuanceStart / 10n; + const totalActualInflation = blockInflation * YEAR / blockInterval; + + const tolerance = 0.00001; // Relative difference per year between theoretical and actual inflation + const expectedInflation = totalExpectedInflation / totalActualInflation - 1n; + expect(Math.abs(Number(expectedInflation))).to.be.lessThanOrEqual(tolerance); + }); }); diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 62c4c23b81..60c0d58a2d 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -17,17 +17,18 @@ import {IKeyringPair} from '@polkadot/types/types'; import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from './util/playgrounds'; -let alice: IKeyringPair; -let bob: IKeyringPair; const MAX_REFUNGIBLE_PIECES = 1_000_000_000_000_000_000_000n; describe('integration test: Refungible functionality:', async () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async function() { await usingPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - alice = privateKey('//Alice'); - bob = privateKey('//Bob'); + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor); }); }); @@ -209,36 +210,38 @@ describe('integration test: Refungible functionality:', async () => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); const token = await collection.mintToken(alice, 100n); await token.repartition(alice, 200n); - const chainEvents = helper.chainLog.slice(-1)[0].events.map((x: any) => x.event); - expect(chainEvents).to.include.deep.members([{ - method: 'ItemCreated', + const chainEvents = helper.chainLog.slice(-1)[0].events; + expect(chainEvents).to.deep.include({ section: 'common', - index: '0x4202', - data: [ - helper.api!.createType('u32', collection.collectionId).toHuman(), - helper.api!.createType('u32', token.tokenId).toHuman(), - {Substrate: alice.address}, - '100', + method: 'ItemCreated', + index: [66, 2], + data: [ + collection.collectionId, + token.tokenId, + {substrate: alice.address}, + 100n, ], - }]); + phase: {applyExtrinsic: 2}, + }); }); itSub('Repartition with decreased amount', async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); const token = await collection.mintToken(alice, 100n); await token.repartition(alice, 50n); - const chainEvents = helper.chainLog.slice(-1)[0].events.map((x: any) => x.event); - expect(chainEvents).to.include.deep.members([{ + const chainEvents = helper.chainLog.slice(-1)[0].events; + expect(chainEvents).to.deep.include({ method: 'ItemDestroyed', section: 'common', - index: '0x4203', - data: [ - helper.api!.createType('u32', collection.collectionId).toHuman(), - helper.api!.createType('u32', token.tokenId).toHuman(), - {Substrate: alice.address}, - '50', + index: [66, 3], + data: [ + collection.collectionId, + token.tokenId, + {substrate: alice.address}, + 50n, ], - }]); + phase: {applyExtrinsic: 2}, + }); }); itSub('Create new collection with properties', async ({helper}) => { diff --git a/tests/src/tx-version-presence.test.ts b/tests/src/tx-version-presence.test.ts index 09e1b14aab..058103f888 100644 --- a/tests/src/tx-version-presence.test.ts +++ b/tests/src/tx-version-presence.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import { Metadata } from '@polkadot/types'; +import {Metadata} from '@polkadot/types'; import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; let metadata: Metadata; diff --git a/tests/src/util/playgrounds/types.ts b/tests/src/util/playgrounds/types.ts index b3acfb1af1..87d59c4849 100644 --- a/tests/src/util/playgrounds/types.ts +++ b/tests/src/util/playgrounds/types.ts @@ -3,20 +3,31 @@ import {IKeyringPair} from '@polkadot/types/types'; -export interface IChainEvent { - data: any; - method: string; +export interface IEvent { section: string; + method: string; + index: [number, number] | string; + data: any[]; + phase: {applyExtrinsic: number} | 'Initialization', } export interface ITransactionResult { - status: 'Fail' | 'Success'; - result: { - events: { - event: IChainEvent - }[]; - }, - moduleError?: string; + status: 'Fail' | 'Success'; + result: { + events: { + phase: any, // {ApplyExtrinsic: number} | 'Initialization', + event: IEvent; + // topics: any[]; + }[]; + }, + moduleError?: string; +} + +export interface ISubscribeBlockEventsData { + number: number; + hash: string; + timestamp: number; + events: IEvent[]; } export interface ILogger { diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index ea4743339b..753bc1f654 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -9,7 +9,7 @@ import {ApiPromise, WsProvider, Keyring} from '@polkadot/api'; import {ApiInterfaceEvents} from '@polkadot/api/types'; import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; -import {IApiListeners, IBlock, IChainEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; +import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; export const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => { const address = {} as ICrossAccountId; @@ -149,7 +149,7 @@ class UniqueUtil { return {success, tokens}; } - static findCollectionInEvents(events: {event: IChainEvent}[], collectionId: number, expectedSection: string, expectedMethod: string) { + static findCollectionInEvents(events: {event: IEvent}[], collectionId: number, expectedSection: string, expectedMethod: string) { let eventId = null; events.forEach(({event: {data, method, section}}) => { if ((section === expectedSection) && (method === expectedMethod)) { @@ -163,7 +163,7 @@ class UniqueUtil { return eventId === collectionId; } - static isTokenTransferSuccess(events: {event: IChainEvent}[], collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) { + static isTokenTransferSuccess(events: {event: IEvent}[], collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) { const normalizeAddress = (address: string | ICrossAccountId) => { if(typeof address === 'string') return address; const obj = {} as any; @@ -195,11 +195,64 @@ class UniqueUtil { } } +class UniqueEventHelper { + private static extractIndex(index: any): [number, number] | string { + if(index.toRawType() === '[u8;2]') return [index[0], index[1]]; + return index.toJSON(); + } + + private static extractSub(data: any, subTypes: any): {[key: string]: any} { + let obj: any = {}; + let index = 0; + + if (data.entries) + for(const [key, value] of data.entries()) { + obj[key] = this.extractData(value, subTypes[index]); + index++; + } + else obj = data.toJSON(); + + return obj; + } + + private static extractData(data: any, type: any): any { + if (['u16', 'u32'].indexOf(type.type) > -1) return data.toNumber(); + if (['u64', 'u128', 'u256'].indexOf(type.type) > -1) return data.toBigInt(); + if(type.hasOwnProperty('sub')) return this.extractSub(data, type.sub); + return data.toHuman(); + } + + public static extractEvents(records: ITransactionResult): IEvent[] { + const parsedEvents: IEvent[] = []; + + records.result.events.forEach((record) => { + const {event, phase} = record; + const types = (event as any).typeDef; + + const eventData: IEvent = { + section: event.section.toString(), + method: event.method.toString(), + index: this.extractIndex(event.index), + data: [], + phase: phase.toJSON(), + }; + + event.data.forEach((val: any, index: number) => { + eventData.data.push(this.extractData(val, types[index])); + }); + + parsedEvents.push(eventData); + }); + + return parsedEvents; + } +} class ChainHelperBase { transactionStatus = UniqueUtil.transactionStatus; chainLogType = UniqueUtil.chainLogType; util: typeof UniqueUtil; + eventHelper: typeof UniqueEventHelper; logger: ILogger; api: ApiPromise | null; forcedNetwork: TUniqueNetworks | null; @@ -208,6 +261,7 @@ class ChainHelperBase { constructor(logger?: ILogger) { this.util = UniqueUtil; + this.eventHelper = UniqueEventHelper; if (typeof logger == 'undefined') logger = this.util.getDefaultLogger(); this.logger = logger; this.api = null; @@ -290,7 +344,7 @@ class ChainHelperBase { return {api, network}; } - getTransactionStatus(data: {events: {event: IChainEvent}[], status: any}) { + getTransactionStatus(data: {events: {event: IEvent}[], status: any}) { const {events, status} = data; if (status.isReady) { return this.transactionStatus.NOT_READY; @@ -299,11 +353,11 @@ class ChainHelperBase { return this.transactionStatus.NOT_READY; } if (status.isInBlock || status.isFinalized) { - const errors = events.filter(e => e.event.data.method === 'ExtrinsicFailed'); + const errors = events.filter(e => e.event.method === 'ExtrinsicFailed'); if (errors.length > 0) { return this.transactionStatus.FAIL; } - if (events.filter(e => e.event.data.method === 'ExtrinsicSuccess').length > 0) { + if (events.filter(e => e.event.method === 'ExtrinsicSuccess').length > 0) { return this.transactionStatus.SUCCESS; } } @@ -332,13 +386,16 @@ class ChainHelperBase { if (result.hasOwnProperty('dispatchError')) { const dispatchError = result['dispatchError']; - if (dispatchError && dispatchError.isModule) { - const modErr = dispatchError.asModule; - const errorMeta = dispatchError.registry.findMetaError(modErr); + if (dispatchError) { + if (dispatchError.isModule) { + const modErr = dispatchError.asModule; + const errorMeta = dispatchError.registry.findMetaError(modErr); - moduleError = `${errorMeta.section}.${errorMeta.name}`; - } - else { + moduleError = `${errorMeta.section}.${errorMeta.name}`; + } else { + moduleError = dispatchError.toHuman(); + } + } else { this.logger.log(result, this.logger.level.ERROR); } } @@ -364,16 +421,16 @@ class ChainHelperBase { return call(...params); } - async executeExtrinsic(sender: TSigner, extrinsic: string, params: any[], expectSuccess=false/*, failureMessage='expected success'*/) { + async executeExtrinsic(sender: TSigner, extrinsic: string, params: any[], expectSuccess=true/*, failureMessage='expected success'*/) { if(this.api === null) throw Error('API not initialized'); if(!extrinsic.startsWith('api.tx.')) throw Error(`${extrinsic} is not transaction`); const startTime = (new Date()).getTime(); let result: ITransactionResult; - let events = []; + let events: IEvent[] = []; try { result = await this.signTransaction(sender, this.constructApiCall(extrinsic, params), extrinsic) as ITransactionResult; - events = result.result.events.map((x: any) => x.toHuman()); + events = this.eventHelper.extractEvents(result); } catch(e) { if(!(e as object).hasOwnProperty('status')) throw e; From 1b4500fbabfe57eddce635edf8d85b499a2108bf Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Mon, 19 Sep 2022 14:10:39 +0000 Subject: [PATCH 0939/1274] revert(tests): minor unneeded changes --- tests/package.json | 1 - tests/src/util/playgrounds/types.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/package.json b/tests/package.json index 16805480da..093f65660a 100644 --- a/tests/package.json +++ b/tests/package.json @@ -64,7 +64,6 @@ "testTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/transfer.test.ts", "testBurnItem": "mocha --timeout 9999999 -r ts-node/register ./**/burnItem.test.ts", "testAdminTransferAndBurn": "mocha --timeout 9999999 -r ts-node/register ./**/adminTransferAndBurn.test.ts", - "testMintModes": "mocha --timeout 9999999 -r ts-node/register ./**/mintModes.test.ts", "testSetMintPermission": "mocha --timeout 9999999 -r ts-node/register ./**/setMintPermission.test.ts", "testSetPublicAccessMode": "mocha --timeout 9999999 -r ts-node/register ./**/setPublicAccessMode.test.ts", "testCreditFeesToTreasury": "mocha --timeout 9999999 -r ts-node/register ./**/creditFeesToTreasury.test.ts", diff --git a/tests/src/util/playgrounds/types.ts b/tests/src/util/playgrounds/types.ts index 87d59c4849..049ca5e851 100644 --- a/tests/src/util/playgrounds/types.ts +++ b/tests/src/util/playgrounds/types.ts @@ -17,7 +17,6 @@ export interface ITransactionResult { events: { phase: any, // {ApplyExtrinsic: number} | 'Initialization', event: IEvent; - // topics: any[]; }[]; }, moduleError?: string; From 7e1e685463e3c3134215ece784f51c6bbc8aba34 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Mon, 19 Sep 2022 14:23:54 +0000 Subject: [PATCH 0940/1274] tests(allow-list): refactor overabundance of allow-list tests --- tests/package.json | 4 +- tests/src/addToAllowList.test.ts | 135 ------ tests/src/allowLists.test.ts | 443 +++++++++--------- tests/src/mintModes.test.ts | 148 ------ tests/src/removeFromAllowList.test.ts | 134 ------ ...mission.test.ts => setPermissions.test.ts} | 78 ++- tests/src/setPublicAccessMode.test.ts | 93 ---- 7 files changed, 250 insertions(+), 785 deletions(-) delete mode 100644 tests/src/addToAllowList.test.ts delete mode 100644 tests/src/mintModes.test.ts delete mode 100644 tests/src/removeFromAllowList.test.ts rename tests/src/{setMintPermission.test.ts => setPermissions.test.ts} (56%) delete mode 100644 tests/src/setPublicAccessMode.test.ts diff --git a/tests/package.json b/tests/package.json index 093f65660a..a37b6efb43 100644 --- a/tests/package.json +++ b/tests/package.json @@ -48,7 +48,6 @@ "testConfirmSponsorship": "mocha --timeout 9999999 -r ts-node/register ./**/confirmSponsorship.test.ts", "testRemoveCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionAdmin.test.ts", "testRemoveCollectionSponsor": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionSponsor.test.ts", - "testRemoveFromAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/removeFromAllowList.test.ts", "testAllowLists": "mocha --timeout 9999999 -r ts-node/register ./**/allowLists.test.ts", "testConnection": "mocha --timeout 9999999 -r ts-node/register ./**/connection.test.ts", "testContracts": "mocha --timeout 9999999 -r ts-node/register ./**/contracts.test.ts", @@ -64,8 +63,7 @@ "testTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/transfer.test.ts", "testBurnItem": "mocha --timeout 9999999 -r ts-node/register ./**/burnItem.test.ts", "testAdminTransferAndBurn": "mocha --timeout 9999999 -r ts-node/register ./**/adminTransferAndBurn.test.ts", - "testSetMintPermission": "mocha --timeout 9999999 -r ts-node/register ./**/setMintPermission.test.ts", - "testSetPublicAccessMode": "mocha --timeout 9999999 -r ts-node/register ./**/setPublicAccessMode.test.ts", + "testSetPermissions": "mocha --timeout 9999999 -r ts-node/register ./**/setPermissions.test.ts", "testCreditFeesToTreasury": "mocha --timeout 9999999 -r ts-node/register ./**/creditFeesToTreasury.test.ts", "testContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/contractSponsoring.test.ts", "testEnableContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/enableContractSponsoring.test.ts", diff --git a/tests/src/addToAllowList.test.ts b/tests/src/addToAllowList.test.ts deleted file mode 100644 index 98cc22eb1a..0000000000 --- a/tests/src/addToAllowList.test.ts +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import usingApi, {submitTransactionExpectFailAsync} from './substrate/substrate-api'; -import { - addToAllowListExpectSuccess, - createCollectionExpectSuccess, - createItemExpectSuccess, - destroyCollectionExpectSuccess, - enablePublicMintingExpectSuccess, - enableAllowListExpectSuccess, - normalizeAccountId, - addCollectionAdminExpectSuccess, - addToAllowListExpectFail, - getCreatedCollectionCount, -} from './util/helpers'; - -chai.use(chaiAsPromised); -const expect = chai.expect; - -let alice: IKeyringPair; -let bob: IKeyringPair; -let charlie: IKeyringPair; - -describe('Integration Test ext. addToAllowList()', () => { - - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - }); - }); - - it('Execute the extrinsic with parameters: Collection ID and address to add to the allow list', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addToAllowListExpectSuccess(alice, collectionId, bob.address); - }); - - it('Allowlisted minting: list restrictions', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addToAllowListExpectSuccess(alice, collectionId, bob.address); - await enableAllowListExpectSuccess(alice, collectionId); - await enablePublicMintingExpectSuccess(alice, collectionId); - await createItemExpectSuccess(bob, collectionId, 'NFT', bob.address); - }); -}); - -describe('Negative Integration Test ext. addToAllowList()', () => { - - it('Allow list an address in the collection that does not exist', async () => { - await usingApi(async (api, privateKeyWrapper) => { - // tslint:disable-next-line: no-bitwise - const collectionId = await getCreatedCollectionCount(api) + 1; - const bob = privateKeyWrapper('//Bob'); - - const tx = api.tx.unique.addToAllowList(collectionId, normalizeAccountId(bob.address)); - await expect(submitTransactionExpectFailAsync(alice, tx)).to.be.rejected; - }); - }); - - it('Allow list an address in the collection that was destroyed', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - // tslint:disable-next-line: no-bitwise - const collectionId = await createCollectionExpectSuccess(); - await destroyCollectionExpectSuccess(collectionId); - const tx = api.tx.unique.addToAllowList(collectionId, normalizeAccountId(bob.address)); - await expect(submitTransactionExpectFailAsync(alice, tx)).to.be.rejected; - }); - }); - - it('Allow list an address in the collection that does not have allow list access enabled', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const ferdie = privateKeyWrapper('//Ferdie'); - const collectionId = await createCollectionExpectSuccess(); - await enableAllowListExpectSuccess(alice, collectionId); - await enablePublicMintingExpectSuccess(alice, collectionId); - const tx = api.tx.unique.createItem(collectionId, normalizeAccountId(ferdie.address), 'NFT'); - await expect(submitTransactionExpectFailAsync(ferdie, tx)).to.be.rejected; - }); - }); - -}); - -describe('Integration Test ext. addToAllowList() with collection admin permissions:', () => { - - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); - }); - }); - - it('Negative. Add to the allow list by regular user', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addToAllowListExpectFail(bob, collectionId, charlie.address); - }); - - it('Execute the extrinsic with parameters: Collection ID and address to add to the allow list', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await addToAllowListExpectSuccess(bob, collectionId, charlie.address); - }); - - it('Allowlisted minting: list restrictions', async () => { - const collectionId = await createCollectionExpectSuccess(); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await addToAllowListExpectSuccess(bob, collectionId, charlie.address); - - // allowed only for collection owner - await enableAllowListExpectSuccess(alice, collectionId); - await enablePublicMintingExpectSuccess(alice, collectionId); - - await createItemExpectSuccess(charlie, collectionId, 'NFT', charlie.address); - }); -}); diff --git a/tests/src/allowLists.test.ts b/tests/src/allowLists.test.ts index cd0a72d973..0e8379b2d8 100644 --- a/tests/src/allowLists.test.ts +++ b/tests/src/allowLists.test.ts @@ -15,232 +15,161 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {usingPlaygrounds} from './util/playgrounds'; +import {usingPlaygrounds, expect, itSub} from './util/playgrounds'; +import {ICollectionPermissions} from './util/playgrounds/types'; -chai.use(chaiAsPromised); -const expect = chai.expect; - -let donor: IKeyringPair; - -let alice: IKeyringPair; -let bob: IKeyringPair; -let charlie: IKeyringPair; - -describe('Integration Test ext. Allow list tests', () => { +describe('Integration Test ext. Add to Allow List', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); - [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([30n, 10n, 10n], donor); }); }); - it('Owner can add address to allow list', async () => { - await usingPlaygrounds(async (helper) => { + describe('Positive', async () => { + itSub('Owner can add address to allow list', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + // allow list does not need to be enabled to add someone in advance await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); const allowList = await helper.nft.getAllowList(collectionId); - expect(allowList).to.be.deep.contains({Substrate: bob.address}); + expect(allowList).to.deep.contain({Substrate: bob.address}); }); - }); - - it('Admin can add address to allow list', async () => { - await usingPlaygrounds(async (helper) => { + + itSub('Admin can add address to allow list', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address}); + // allow list does not need to be enabled to add someone in advance await helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}); const allowList = await helper.nft.getAllowList(collectionId); - expect(allowList).to.be.deep.contains({Substrate: charlie.address}); + expect(allowList).to.deep.contain({Substrate: charlie.address}); }); - }); - it('Non-privileged user cannot add address to allow list', async () => { - await usingPlaygrounds(async (helper) => { + itSub('If address is already added to allow list, nothing happens', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const addToAllowListTx = async () => helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}); - await expect(addToAllowListTx()).to.be.rejected; + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + const allowList = await helper.nft.getAllowList(collectionId); + expect(allowList).to.deep.contain({Substrate: bob.address}); }); }); - it('Nobody can add address to allow list of non-existing collection', async () => { - const collectionId = (1<<32) - 1; - await usingPlaygrounds(async (helper) => { - const addToAllowListTx = async () => helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}); - await expect(addToAllowListTx()).to.be.rejected; + describe('Negative', async () => { + itSub('Nobody can add address to allow list of non-existing collection', async ({helper}) => { + const collectionId = (1<<32) - 1; + await expect(helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); - }); - - it('Nobody can add address to allow list of destroyed collection', async () => { - await usingPlaygrounds(async (helper) => { + + itSub('Nobody can add address to allow list of destroyed collection', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await helper.collection.burn(alice, collectionId); - const addToAllowListTx = async () => helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - await expect(addToAllowListTx()).to.be.rejected; + await expect(helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); - }); - it('If address is already added to allow list, nothing happens', async () => { - await usingPlaygrounds(async (helper) => { + itSub('Non-privileged user cannot add address to allow list', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - const allowList = await helper.nft.getAllowList(collectionId); - expect(allowList).to.be.deep.contains({Substrate: bob.address}); + await expect(helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address})) + .to.be.rejectedWith(/common\.NoPermission/); }); }); +}); - it('Owner can remove address from allow list', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - - await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); +describe('Integration Test ext. Remove from Allow List', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; - const allowList = await helper.nft.getAllowList(collectionId); - - expect(allowList).to.be.not.deep.contains({Substrate: bob.address}); + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([30n, 10n, 10n], donor); }); }); - it('Admin can remove address from allow list', async () => { - await usingPlaygrounds(async (helper) => { + describe('Positive', async () => { + itSub('Owner can remove address from allow list', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.addAdmin(alice, collectionId, {Substrate: charlie.address}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - await helper.collection.removeFromAllowList(charlie, collectionId, {Substrate: bob.address}); - const allowList = await helper.nft.getAllowList(collectionId); - - expect(allowList).to.be.not.deep.contains({Substrate: bob.address}); - }); - }); + await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); - it('Non-privileged user cannot remove address from allow list', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); - const removeTx = async () => helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address}); - await expect(removeTx()).to.be.rejected; const allowList = await helper.nft.getAllowList(collectionId); - expect(allowList).to.be.deep.contains({Substrate: charlie.address}); - }); - }); - - it('Nobody can remove address from allow list of non-existing collection', async () => { - const collectionId = (1<<32) - 1; - await usingPlaygrounds(async (helper) => { - const removeTx = async () => helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address}); - await expect(removeTx()).to.be.rejected; + expect(allowList).to.not.deep.contain({Substrate: bob.address}); }); - }); - it('Nobody can remove address from allow list of deleted collection', async () => { - await usingPlaygrounds(async (helper) => { + itSub('Admin can remove address from allow list', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await helper.nft.addAdmin(alice, collectionId, {Substrate: charlie.address}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - await helper.collection.burn(alice, collectionId); - const removeTx = async () => helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); + await helper.collection.removeFromAllowList(charlie, collectionId, {Substrate: bob.address}); - await expect(removeTx()).to.be.rejected; + const allowList = await helper.nft.getAllowList(collectionId); + expect(allowList).to.not.deep.contain({Substrate: bob.address}); }); - }); - it('If address is already removed from allow list, nothing happens', async () => { - await usingPlaygrounds(async (helper) => { + itSub('If address is already removed from allow list, nothing happens', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); const allowListBefore = await helper.nft.getAllowList(collectionId); - expect(allowListBefore).to.be.not.deep.contains({Substrate: bob.address}); - + expect(allowListBefore).to.not.deep.contain({Substrate: bob.address}); + await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}); - + const allowListAfter = await helper.nft.getAllowList(collectionId); - expect(allowListAfter).to.be.not.deep.contains({Substrate: bob.address}); + expect(allowListAfter).to.not.deep.contain({Substrate: bob.address}); }); }); - it('If Public Access mode is set to AllowList, tokens can’t be transferred from a non-allowlisted address with transfer or transferFrom. Test1', async () => { - await usingPlaygrounds(async (helper) => { + describe('Negative', async () => { + itSub('Non-privileged user cannot remove address from allow list', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + await expect(helper.collection.removeFromAllowList(charlie, collectionId, {Substrate: charlie.address})) + .to.be.rejectedWith(/common\.NoPermission/); - const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - await expect(transferResult()).to.be.rejected; - }); - }); - - it('If Public Access mode is set to AllowList, tokens can’t be transferred from a non-allowlisted address with transfer or transferFrom. Test2', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); - await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address}); - - const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - await expect(transferResult()).to.be.rejected; + const allowList = await helper.nft.getAllowList(collectionId); + expect(allowList).to.deep.contain({Substrate: charlie.address}); }); - }); - - it('If Public Access mode is set to AllowList, tokens can’t be transferred to a non-allowlisted address with transfer or transferFrom. Test1', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); - - const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - await expect(transferResult()).to.be.rejected; + + itSub('Nobody can remove address from allow list of non-existing collection', async ({helper}) => { + const collectionId = (1<<32) - 1; + await expect(helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); - }); - - it('If Public Access mode is set to AllowList, tokens can’t be transferred to a non-allowlisted address with transfer or transferFrom. Test2', async () => { - await usingPlaygrounds(async (helper) => { + + itSub('Nobody can remove address from allow list of deleted collection', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); - - await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address}); - - const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - await expect(transferResult()).to.be.rejected; + await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); + await helper.collection.burn(alice, collectionId); + + await expect(helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.CollectionNotFound/); }); }); +}); - it('If Public Access mode is set to AllowList, tokens can’t be destroyed by a non-allowlisted address (even if it owned them before enabling AllowList mode)', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); - const burnTx = async () => helper.nft.burnToken(bob, collectionId, tokenId); - await expect(burnTx()).to.be.rejected; - }); - }); +describe('Integration Test ext. Transfer if included in Allow List', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; - it('If Public Access mode is set to AllowList, token transfers can’t be Approved by a non-allowlisted address (see Approve method)', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); - const approveTx = async () => helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); - await expect(approveTx()).to.be.rejected; + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([30n, 10n, 10n], donor); }); }); - it('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transfer.', async () => { - await usingPlaygrounds(async (helper) => { + describe('Positive', async () => { + itSub('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transfer.', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); @@ -250,130 +179,182 @@ describe('Integration Test ext. Allow list tests', () => { const owner = await helper.nft.getTokenOwner(collectionId, tokenId); expect(owner.Substrate).to.be.equal(charlie.address); }); - }); - - it('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transferFrom.', async () => { - await usingPlaygrounds(async (helper) => { + + itSub('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transferFrom.', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - + await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address}); const owner = await helper.nft.getTokenOwner(collectionId, tokenId); expect(owner.Substrate).to.be.equal(charlie.address); }); - }); - - it('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transfer', async () => { - await usingPlaygrounds(async (helper) => { + + itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transfer', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); - + await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}); const owner = await helper.nft.getTokenOwner(collectionId, tokenId); expect(owner.Substrate).to.be.equal(charlie.address); }); - }); - - it('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transferFrom', async () => { - await usingPlaygrounds(async (helper) => { + + itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transferFrom', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); - + await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address}); const owner = await helper.nft.getTokenOwner(collectionId, tokenId); expect(owner.Substrate).to.be.equal(charlie.address); }); }); - it('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens can be created by owner', async () => { - await usingPlaygrounds(async (helper) => { + describe('Negative', async () => { + itSub('If Public Access mode is set to AllowList, tokens can\'t be transferred from a non-allowlisted address with transfer or transferFrom. Test1', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - const token = await helper.nft.getToken(collectionId, tokenId); - expect(token).to.be.not.null; + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + + await expect(helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address})) + .to.be.rejectedWith(/common\.AddressNotInAllowlist/); }); - }); - - it('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens can be created by admin', async () => { - await usingPlaygrounds(async (helper) => { + + itSub('If Public Access mode is set to AllowList, tokens can\'t be transferred from a non-allowlisted address with transfer or transferFrom. Test2', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); - await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address}); - const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); - const token = await helper.nft.getToken(collectionId, tokenId); - expect(token).to.be.not.null; + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address}); + + await expect(helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address})) + .to.be.rejectedWith(/common\.AddressNotInAllowlist/); }); - }); - - it('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens cannot be created by non-privileged and allow-listed address', async () => { - await usingPlaygrounds(async (helper) => { + + itSub('If Public Access mode is set to AllowList, tokens can\'t be transferred to a non-allowlisted address with transfer or transferFrom. Test1', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); - await helper.collection.addToAllowList(alice, collectionId, {Substrate: bob.address}); - const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); - await expect(mintTokenTx()).to.be.rejected; + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + + await expect(helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address})) + .to.be.rejectedWith(/common\.AddressNotInAllowlist/); }); - }); - - it('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens cannot be created by non-privileged and non-allow listed address', async () => { - await usingPlaygrounds(async (helper) => { + + itSub('If Public Access mode is set to AllowList, tokens can\'t be transferred to a non-allowlisted address with transfer or transferFrom. Test2', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false}); - const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); - await expect(mintTokenTx()).to.be.rejected; + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address}); + await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address}); + + await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address}); + await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address}); + + await expect(helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address})) + .to.be.rejectedWith(/common\.AddressNotInAllowlist/); }); - }); - - it('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by owner', async () => { - await usingPlaygrounds(async (helper) => { + + itSub('If Public Access mode is set to AllowList, tokens can\'t be destroyed by a non-allowlisted address (even if it owned them before enabling AllowList mode)', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); - const owner = await helper.nft.getTokenOwner(collectionId, tokenId); - expect(owner.Substrate).to.be.equal(alice.address); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await expect(helper.nft.burnToken(bob, collectionId, tokenId)) + .to.be.rejectedWith(/common\.NoPermission/); }); - }); - - it('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by admin', async () => { - await usingPlaygrounds(async (helper) => { + + itSub('If Public Access mode is set to AllowList, token transfers can\'t be Approved by a non-allowlisted address (see Approve method)', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); - await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address}); - const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); - const owner = await helper.nft.getTokenOwner(collectionId, tokenId); - expect(owner.Substrate).to.be.equal(bob.address); + const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); + await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'}); + await expect(helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.AddressNotInAllowlist/); }); }); +}); - it('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens cannot be created by non-privileged and non-allow listed address', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); - const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); - await expect(mintTokenTx()).to.be.rejected; +describe('Integration Test ext. Mint if included in Allow List', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); - it('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by non-privileged and allow listed address', async () => { - await usingPlaygrounds(async (helper) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}); - await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}); - const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address}); - const owner = await helper.nft.getTokenOwner(collectionId, tokenId); - expect(owner.Substrate).to.be.equal(bob.address); + const permissionSet: ICollectionPermissions[] = [ + {access: 'Normal', mintMode: false}, + {access: 'Normal', mintMode: true}, + {access: 'AllowList', mintMode: false}, + {access: 'AllowList', mintMode: true}, + ]; + + const testPermissionSuite = async (permissions: ICollectionPermissions) => { + const allowlistedMintingShouldFail = !permissions.mintMode!; + + const appropriateRejectionMessage = permissions.mintMode! ? /common\.AddressNotInAllowlist/ : /common\.PublicMintingNotAllowed/; + + const allowlistedMintingTest = () => itSub( + `With the condtions above, tokens can${allowlistedMintingShouldFail ? '\'t' : ''} be created by allow-listed addresses`, + async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {}); + await collection.setPermissions(alice, permissions); + await collection.addToAllowList(alice, {Substrate: bob.address}); + + if (allowlistedMintingShouldFail) + await expect(collection.mintToken(bob, {Substrate: bob.address})).to.be.rejectedWith(appropriateRejectionMessage); + else + await expect(collection.mintToken(bob, {Substrate: bob.address})).to.not.be.rejected; + }, + ); + + + describe(`Public Access Mode = ${permissions.access}, Mint Mode = ${permissions.mintMode}`, async () => { + describe('Positive', async () => { + itSub('With the condtions above, tokens can be created by owner', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {}); + await collection.setPermissions(alice, permissions); + await expect(collection.mintToken(alice, {Substrate: alice.address})).to.not.be.rejected; + }); + + itSub('With the condtions above, tokens can be created by admin', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {}); + await collection.setPermissions(alice, permissions); + await collection.addAdmin(alice, {Substrate: bob.address}); + await expect(collection.mintToken(bob, {Substrate: bob.address})).to.not.be.rejected; + }); + + if (!allowlistedMintingShouldFail) allowlistedMintingTest(); + }); + + describe('Negative', async () => { + itSub('With the condtions above, tokens can\'t be created by non-priviliged non-allow-listed address', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await collection.setPermissions(alice, permissions); + await expect(collection.mintToken(bob, {Substrate: bob.address})) + .to.be.rejectedWith(appropriateRejectionMessage); + }); + + if (allowlistedMintingShouldFail) allowlistedMintingTest(); + }); }); - }); + }; + + for (const permissions of permissionSet) { + testPermissionSuite(permissions); + } }); diff --git a/tests/src/mintModes.test.ts b/tests/src/mintModes.test.ts deleted file mode 100644 index e93d91a998..0000000000 --- a/tests/src/mintModes.test.ts +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -import {IKeyringPair} from '@polkadot/types/types'; -import usingApi from './substrate/substrate-api'; -import { - addToAllowListExpectSuccess, - createCollectionExpectSuccess, - createItemExpectFailure, - createItemExpectSuccess, - enableAllowListExpectSuccess, - setMintPermissionExpectSuccess, - addCollectionAdminExpectSuccess, - disableAllowListExpectSuccess, -} from './util/helpers'; - -describe('Integration Test public minting', () => { - let alice: IKeyringPair; - let bob: IKeyringPair; - - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - }); - }); - - it('If the AllowList mode is enabled, then the address added to the allowlist and not the owner or administrator can create tokens', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, true); - await addToAllowListExpectSuccess(alice, collectionId, bob.address); - - await createItemExpectSuccess(bob, collectionId, 'NFT'); - }); - }); - - it('If the AllowList mode is enabled, address not included in allowlist that is regular user cannot create tokens', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, true); - await createItemExpectFailure(bob, collectionId, 'NFT'); - }); - }); - - it('If the AllowList mode is enabled, address not included in allowlist that is admin can create tokens', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, true); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await createItemExpectSuccess(bob, collectionId, 'NFT'); - }); - }); - - it('If the AllowList mode is enabled, address not included in allowlist that is owner can create tokens', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, true); - await createItemExpectSuccess(alice, collectionId, 'NFT'); - }); - }); - - it('If the AllowList mode is disabled, owner can create tokens', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await disableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, true); - await createItemExpectSuccess(alice, collectionId, 'NFT'); - }); - }); - - it('If the AllowList mode is disabled, collection admin can create tokens', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await disableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, true); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await createItemExpectSuccess(bob, collectionId, 'NFT'); - }); - }); - - it('If the AllowList mode is disabled, regular user can`t create tokens', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await disableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, true); - await createItemExpectFailure(bob, collectionId, 'NFT'); - }); - }); -}); - -describe('Integration Test private minting', () => { - let alice: IKeyringPair; - let bob: IKeyringPair; - - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - }); - }); - - it('Address that is the not owner or not admin cannot create tokens', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await enableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, false); - await addToAllowListExpectSuccess(alice, collectionId, bob.address); - await createItemExpectFailure(bob, collectionId, 'NFT'); - }); - }); - - it('Address that is collection owner can create tokens', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await disableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, false); - await createItemExpectSuccess(alice, collectionId, 'NFT'); - }); - }); - - it('Address that is admin can create tokens', async () => { - await usingApi(async () => { - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await disableAllowListExpectSuccess(alice, collectionId); - await setMintPermissionExpectSuccess(alice, collectionId, false); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - await createItemExpectSuccess(bob, collectionId, 'NFT'); - }); - }); -}); diff --git a/tests/src/removeFromAllowList.test.ts b/tests/src/removeFromAllowList.test.ts deleted file mode 100644 index e037bcba2d..0000000000 --- a/tests/src/removeFromAllowList.test.ts +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; - -describe('Integration Test removeFromAllowList', () => { - let alice: IKeyringPair; - let bob: IKeyringPair; - - before(async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); - [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); - }); - }); - - itSub('ensure bob is not in allowlist after removal', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-1', tokenPrefix: 'RFAL'}); - - const collectionInfo = await collection.getData(); - expect(collectionInfo!.raw.permissions.access).to.not.equal('AllowList'); - - await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); - await collection.addToAllowList(alice, {Substrate: bob.address}); - expect(await collection.getAllowList()).to.deep.contains({Substrate: bob.address}); - - await collection.removeFromAllowList(alice, {Substrate: bob.address}); - expect(await collection.getAllowList()).to.be.empty; - }); - - itSub('allows removal from collection with unset allowlist status', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-2', tokenPrefix: 'RFAL'}); - - await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); - await collection.addToAllowList(alice, {Substrate: bob.address}); - expect(await collection.getAllowList()).to.deep.contains({Substrate: bob.address}); - - await collection.setPermissions(alice, {access: 'Normal'}); - - await collection.removeFromAllowList(alice, {Substrate: bob.address}); - expect(await collection.getAllowList()).to.be.empty; - }); -}); - -describe('Negative Integration Test removeFromAllowList', () => { - let alice: IKeyringPair; - let bob: IKeyringPair; - - before(async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); - [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); - }); - }); - - itSub('fails on removal from not existing collection', async ({helper}) => { - const nonExistentCollectionId = (1 << 32) - 1; - await expect(helper.collection.removeFromAllowList(alice, nonExistentCollectionId, {Substrate: alice.address})) - .to.be.rejectedWith(/common\.CollectionNotFound/); - }); - - itSub('fails on removal from removed collection', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-3', tokenPrefix: 'RFAL'}); - await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); - await collection.addToAllowList(alice, {Substrate: bob.address}); - - await collection.burn(alice); - await expect(collection.removeFromAllowList(alice, {Substrate: bob.address})) - .to.be.rejectedWith(/common\.CollectionNotFound/); - }); -}); - -describe('Integration Test removeFromAllowList with collection admin permissions', () => { - let alice: IKeyringPair; - let bob: IKeyringPair; - let charlie: IKeyringPair; - - before(async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); - [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); - }); - }); - - itSub('ensure address is not in allowlist after removal', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-4', tokenPrefix: 'RFAL'}); - - await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); - await collection.addAdmin(alice, {Substrate: bob.address}); - - await collection.addToAllowList(bob, {Substrate: charlie.address}); - await collection.removeFromAllowList(bob, {Substrate: charlie.address}); - - expect(await collection.getAllowList()).to.be.empty; - }); - - itSub('Collection admin allowed to remove from allowlist with unset allowlist status', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-5', tokenPrefix: 'RFAL'}); - - await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); - await collection.addAdmin(alice, {Substrate: bob.address}); - await collection.addToAllowList(alice, {Substrate: charlie.address}); - - await collection.setPermissions(bob, {access: 'Normal'}); - await collection.removeFromAllowList(bob, {Substrate: charlie.address}); - - expect(await collection.getAllowList()).to.be.empty; - }); - - itSub('Regular user can`t remove from allowlist', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-6', tokenPrefix: 'RFAL'}); - - await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); - await collection.addToAllowList(alice, {Substrate: charlie.address}); - - await expect(collection.removeFromAllowList(bob, {Substrate: charlie.address})) - .to.be.rejectedWith(/common\.NoPermission/); - expect(await collection.getAllowList()).to.deep.contain({Substrate: charlie.address}); - }); -}); diff --git a/tests/src/setMintPermission.test.ts b/tests/src/setPermissions.test.ts similarity index 56% rename from tests/src/setMintPermission.test.ts rename to tests/src/setPermissions.test.ts index be136a4636..447eb791b1 100644 --- a/tests/src/setMintPermission.test.ts +++ b/tests/src/setPermissions.test.ts @@ -17,7 +17,7 @@ import {IKeyringPair} from '@polkadot/types/types'; import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; -describe('Integration Test setMintPermission', () => { +describe('Integration Test: Set Permissions', () => { let alice: IKeyringPair; let bob: IKeyringPair; @@ -28,39 +28,43 @@ describe('Integration Test setMintPermission', () => { }); }); - itSub('ensure allow-listed non-privileged address can mint tokens', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-1', description: '', tokenPrefix: 'SMP'}); - await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); - await collection.addToAllowList(alice, {Substrate: bob.address}); - - await expect(collection.mintToken(bob, {Substrate: bob.address})).to.not.be.rejected; - }); - - itSub('can be enabled twice', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-2', description: '', tokenPrefix: 'SMP'}); + itSub('can all be enabled twice', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetPermissions-1', tokenPrefix: 'SP'}); expect((await collection.getData())?.raw.permissions.access).to.not.equal('AllowList'); - await collection.setPermissions(alice, {mintMode: true}); - await collection.setPermissions(alice, {mintMode: true}); - expect((await collection.getData())?.raw.permissions.mintMode).to.be.true; + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {collectionAdmin: true, tokenOwner: true, restricted: [1, 2]}}); + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {collectionAdmin: true, tokenOwner: true, restricted: [1, 2]}}); + + const permissions = (await collection.getData())?.raw.permissions; + expect(permissions).to.be.deep.equal({ + access: 'AllowList', + mintMode: true, + nesting: {collectionAdmin: true, tokenOwner: true, restricted: [1, 2]}, + }); }); - itSub('can be disabled twice', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-3', description: '', tokenPrefix: 'SMP'}); + itSub('can all be disabled twice', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetPermissions-2', tokenPrefix: 'SP'}); expect((await collection.getData())?.raw.permissions.access).to.equal('Normal'); - await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); - expect((await collection.getData())?.raw.permissions.access).to.equal('AllowList'); - expect((await collection.getData())?.raw.permissions.mintMode).to.equal(true); + await collection.setPermissions(alice, {access: 'AllowList', nesting: {collectionAdmin: false, tokenOwner: true, restricted: [1, 2]}}); + expect((await collection.getData())?.raw.permissions).to.be.deep.equal({ + access: 'AllowList', + mintMode: false, + nesting: {collectionAdmin: false, tokenOwner: true, restricted: [1, 2]}, + }); - await collection.setPermissions(alice, {access: 'Normal', mintMode: false}); - await collection.setPermissions(alice, {access: 'Normal', mintMode: false}); - expect((await collection.getData())?.raw.permissions.access).to.equal('Normal'); - expect((await collection.getData())?.raw.permissions.mintMode).to.equal(false); + await collection.setPermissions(alice, {access: 'Normal', mintMode: false, nesting: {}}); + await collection.setPermissions(alice, {access: 'Normal', mintMode: false, nesting: {}}); + expect((await collection.getData())?.raw.permissions).to.be.deep.equal({ + access: 'Normal', + mintMode: false, + nesting: {collectionAdmin: false, tokenOwner: false, restricted: null}, + }); }); - itSub('Collection admin success on set', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-4', description: '', tokenPrefix: 'SMP'}); + itSub('collection admin can set permissions', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetPermissions-2', tokenPrefix: 'SP'}); await collection.addAdmin(alice, {Substrate: bob.address}); await collection.setPermissions(bob, {access: 'AllowList', mintMode: true}); @@ -69,7 +73,7 @@ describe('Integration Test setMintPermission', () => { }); }); -describe('Negative Integration Test setMintPermission', () => { +describe('Negative Integration Test: Set Permissions', () => { let alice: IKeyringPair; let bob: IKeyringPair; @@ -82,30 +86,22 @@ describe('Negative Integration Test setMintPermission', () => { itSub('fails on not existing collection', async ({helper}) => { const collectionId = (1 << 32) - 1; - await expect(helper.collection.setPermissions(alice, collectionId, {mintMode: true})) + await expect(helper.collection.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true})) .to.be.rejectedWith(/common\.CollectionNotFound/); }); itSub('fails on removed collection', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-Neg-1', tokenPrefix: 'SMP'}); + const collection = await helper.nft.mintCollection(alice, {name: 'SetPermissions-Neg-1', tokenPrefix: 'SP'}); await collection.burn(alice); - await expect(collection.setPermissions(alice, {mintMode: true})) + await expect(collection.setPermissions(alice, {access: 'AllowList', mintMode: true})) .to.be.rejectedWith(/common\.CollectionNotFound/); }); - itSub('fails when non-owner tries to set mint status', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-Neg-2', tokenPrefix: 'SMP'}); + itSub('fails when non-owner tries to set permissions', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'SetPermissions-Neg-2', tokenPrefix: 'SP'}); - await expect(collection.setPermissions(bob, {mintMode: true})) + await expect(collection.setPermissions(bob, {access: 'AllowList', mintMode: true})) .to.be.rejectedWith(/common\.NoPermission/); }); - - itSub('ensure non-allow-listed non-privileged address can\'t mint tokens', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-Neg-3', tokenPrefix: 'SMP'}); - await collection.setPermissions(alice, {mintMode: true}); - - await expect(collection.mintToken(bob, {Substrate: bob.address})) - .to.be.rejectedWith(/common\.AddressNotInAllowlist/); - }); -}); +}); \ No newline at end of file diff --git a/tests/src/setPublicAccessMode.test.ts b/tests/src/setPublicAccessMode.test.ts deleted file mode 100644 index ed645e141e..0000000000 --- a/tests/src/setPublicAccessMode.test.ts +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -// https://unique-network.readthedocs.io/en/latest/jsapi.html#setschemaversion -import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; - -describe('Integration Test setPublicAccessMode(): ', () => { - let alice: IKeyringPair; - let bob: IKeyringPair; - - before(async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); - [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); - }); - }); - - itSub('Runs extrinsic with collection id parameters, sets the allowlist mode for the collection', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-1', tokenPrefix: 'TF'}); - await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); - await collection.addToAllowList(alice, {Substrate: bob.address}); - - await expect(collection.mintToken(bob, {Substrate: bob.address})).to.be.not.rejected; - }); - - itSub('Allowlisted collection limits', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-2', tokenPrefix: 'TF'}); - await collection.setPermissions(alice, {access: 'AllowList', mintMode: true}); - - await expect(collection.mintToken(bob, {Substrate: bob.address})) - .to.be.rejectedWith(/common\.AddressNotInAllowlist/); - }); - - itSub('setPublicAccessMode by collection admin', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-4', tokenPrefix: 'TF'}); - await collection.addAdmin(alice, {Substrate: bob.address}); - - await expect(collection.setPermissions(bob, {access: 'AllowList'})).to.be.not.rejected; - }); -}); - -describe('Negative Integration Test ext. setPublicAccessMode(): ', () => { - let alice: IKeyringPair; - let bob: IKeyringPair; - - before(async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); - [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); - }); - }); - - itSub('Sets a non-existent collection', async ({helper}) => { - const collectionId = (1 << 32) - 1; - await expect(helper.collection.setPermissions(alice, collectionId, {access: 'AllowList'})) - .to.be.rejectedWith(/common\.CollectionNotFound/); - }); - - itSub('Sets the collection that has been deleted', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-1', tokenPrefix: 'TF'}); - await collection.burn(alice); - - await expect(collection.setPermissions(alice, {access: 'AllowList'})) - .to.be.rejectedWith(/common\.CollectionNotFound/); - }); - - itSub('Re-sets the list mode already set in quantity', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-2', tokenPrefix: 'TF'}); - await collection.setPermissions(alice, {access: 'AllowList'}); - await collection.setPermissions(alice, {access: 'AllowList'}); - }); - - itSub('Executes method as a malefactor', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-3', tokenPrefix: 'TF'}); - - await expect(collection.setPermissions(bob, {access: 'AllowList'})) - .to.be.rejectedWith(/common\.NoPermission/); - }); -}); From 3fefb83ade7dcbcb5e243e225ae5fae24523389e Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 19 Sep 2022 14:43:06 +0000 Subject: [PATCH 0941/1274] fix: deny comma absence between if/via --- crates/evm-coder/procedural/src/solidity_interface.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/evm-coder/procedural/src/solidity_interface.rs b/crates/evm-coder/procedural/src/solidity_interface.rs index ca5f8bf358..9863c44b74 100644 --- a/crates/evm-coder/procedural/src/solidity_interface.rs +++ b/crates/evm-coder/procedural/src/solidity_interface.rs @@ -187,6 +187,8 @@ impl Parse for IsList { if input.peek(Token![,]) { input.parse::()?; + } else if !input.is_empty() { + return Err(syn::Error::new(input.span(), "expected end")); } } } else if lookahead.peek(Token![,]) || input.is_empty() { From 385c9660b4ca895ce10cb6646f33adc2b7ec1a91 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Tue, 20 Sep 2022 07:43:30 +0000 Subject: [PATCH 0942/1274] tests(util): minor refactor of transaction options --- tests/src/util/playgrounds/unique.dev.ts | 4 ++-- tests/src/util/playgrounds/unique.ts | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 9f116c67e2..5a7786ee1e 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -132,7 +132,7 @@ class ArrangeGroup { accounts.push(recipient); if (balance !== 0n) { const tx = this.helper.constructApiCall('api.tx.balances.transfer', [{Id: recipient.address}, balance * tokenNominal]); - transactions.push(this.helper.signTransaction(donor, tx, 'account generation', {nonce})); + transactions.push(this.helper.signTransaction(donor, tx, {nonce}, 'account generation')); nonce++; } } @@ -183,7 +183,7 @@ class ArrangeGroup { accounts.push(recepient); if (withBalance !== 0n) { const tx = this.helper.constructApiCall('api.tx.balances.transfer', [{Id: recepient.address}, withBalance * tokenNominal]); - transactions.push(this.helper.signTransaction(donor, tx, 'account generation', {nonce})); + transactions.push(this.helper.signTransaction(donor, tx, {nonce}, 'account generation')); nonce++; } } diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 753bc1f654..5a05c5b811 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -6,7 +6,7 @@ /* eslint-disable no-prototype-builtins */ import {ApiPromise, WsProvider, Keyring} from '@polkadot/api'; -import {ApiInterfaceEvents} from '@polkadot/api/types'; +import {ApiInterfaceEvents, SignerOptions} from '@polkadot/api/types'; import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; @@ -205,12 +205,12 @@ class UniqueEventHelper { let obj: any = {}; let index = 0; - if (data.entries) + if (data.entries) { for(const [key, value] of data.entries()) { obj[key] = this.extractData(value, subTypes[index]); index++; } - else obj = data.toJSON(); + } else obj = data.toJSON(); return obj; } @@ -365,7 +365,7 @@ class ChainHelperBase { return this.transactionStatus.FAIL; } - signTransaction(sender: TSigner, transaction: any, label = 'transaction', options: any = null) { + signTransaction(sender: TSigner, transaction: any, options: Partial | null = null, label = 'transaction') { const sign = (callback: any) => { if(options !== null) return transaction.signAndSend(sender, options, callback); return transaction.signAndSend(sender, callback); @@ -421,7 +421,7 @@ class ChainHelperBase { return call(...params); } - async executeExtrinsic(sender: TSigner, extrinsic: string, params: any[], expectSuccess=true/*, failureMessage='expected success'*/) { + async executeExtrinsic(sender: TSigner, extrinsic: string, params: any[], expectSuccess=true, options: Partial|null = null/*, failureMessage='expected success'*/) { if(this.api === null) throw Error('API not initialized'); if(!extrinsic.startsWith('api.tx.')) throw Error(`${extrinsic} is not transaction`); @@ -429,7 +429,7 @@ class ChainHelperBase { let result: ITransactionResult; let events: IEvent[] = []; try { - result = await this.signTransaction(sender, this.constructApiCall(extrinsic, params), extrinsic) as ITransactionResult; + result = await this.signTransaction(sender, this.constructApiCall(extrinsic, params), options, extrinsic) as ITransactionResult; events = this.eventHelper.extractEvents(result); } catch(e) { From 155f75c524c6df59237317a38d56ebaee59ff1d1 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Tue, 20 Sep 2022 09:04:54 +0000 Subject: [PATCH 0943/1274] tests(app-promotion): fix a test to new expected behavior --- tests/src/app-promotion.test.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 03bc71384a..a26eb1a940 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -555,9 +555,8 @@ describe('App promotion', () => { const flipper = await helper.eth.deployFlipper(contractOwner); await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address]); - const stopSponsoringResult = await helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address]); - expect(stopSponsoringResult.status).to.equal('Fail'); - expect(stopSponsoringResult.moduleError).to.equal('appPromotion.NoPermission'); + await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address])) + .to.be.rejectedWith(/appPromotion\.NoPermission/); }); itEth('should not affect a contract which is not sponsored by pallete', async ({helper}) => { From e876e8de0a826a06458123a868d47ad26b8c55cd Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Tue, 20 Sep 2022 09:09:53 +0000 Subject: [PATCH 0944/1274] tests: refactor small tests + place better todos on all skipped --- tests/src/addToContractAllowList.test.ts | 1 + tests/src/block-production.test.ts | 11 +++----- tests/src/connection.test.ts | 24 +++++----------- tests/src/contracts.test.ts | 1 + tests/src/enableContractSponsoring.test.ts | 1 + tests/src/evmCoder.test.ts | 28 +++++++++++-------- .../setContractSponsoringRateLimit.test.ts | 2 +- tests/src/util/playgrounds/index.ts | 4 +-- 8 files changed, 34 insertions(+), 38 deletions(-) diff --git a/tests/src/addToContractAllowList.test.ts b/tests/src/addToContractAllowList.test.ts index 307b7b2f08..dce930d380 100644 --- a/tests/src/addToContractAllowList.test.ts +++ b/tests/src/addToContractAllowList.test.ts @@ -27,6 +27,7 @@ import { chai.use(chaiAsPromised); const expect = chai.expect; +// todo:playgrounds skipped ~ postponed describe.skip('Integration Test addToContractAllowList', () => { it('Add an address to a contract allow list', async () => { diff --git a/tests/src/block-production.test.ts b/tests/src/block-production.test.ts index 1f01a2a54a..222f959c1e 100644 --- a/tests/src/block-production.test.ts +++ b/tests/src/block-production.test.ts @@ -14,9 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import usingApi from './substrate/substrate-api'; -import {expect} from 'chai'; import {ApiPromise} from '@polkadot/api'; +import {expect, itSub} from './util/playgrounds'; const BLOCK_TIME_MS = 12000; const TOLERANCE_MS = 3000; @@ -37,10 +36,8 @@ function getBlocks(api: ApiPromise): Promise { } describe('Block Production smoke test', () => { - it('Node produces new blocks', async () => { - await usingApi(async (api) => { - const blocks: number[] | undefined = await getBlocks(api); - expect(blocks[0]).to.be.lessThan(blocks[1]); - }); + itSub('Node produces new blocks', async ({helper}) => { + const blocks: number[] | undefined = await getBlocks(helper.api!); + expect(blocks[0]).to.be.lessThan(blocks[1]); }); }); diff --git a/tests/src/connection.test.ts b/tests/src/connection.test.ts index a365a05c64..0785bf10ed 100644 --- a/tests/src/connection.test.ts +++ b/tests/src/connection.test.ts @@ -14,29 +14,19 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import usingApi from './substrate/substrate-api'; -import {WsProvider} from '@polkadot/api'; -import * as chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; - -chai.use(chaiAsPromised); - -const expect = chai.expect; +import {itSub, expect, usingPlaygrounds} from './util/playgrounds'; describe('Connection smoke test', () => { - it('Connection can be established', async () => { - await usingApi(async api => { - const health = await api.rpc.system.health(); - expect(health).to.be.not.empty; - }); + itSub('Connection can be established', async ({helper}) => { + const health = (await helper.callRpc('api.rpc.system.health')).toJSON(); + expect(health).to.be.not.empty; }); it('Cannot connect to 255.255.255.255', async () => { - const neverConnectProvider = new WsProvider('ws://255.255.255.255:9944'); await expect((async () => { - await usingApi(async api => { - await api.rpc.system.health(); - }, {provider: neverConnectProvider}); + await usingPlaygrounds(async helper => { + await helper.callRpc('api.rpc.system.health'); + }, 'ws://255.255.255.255:9944'); })()).to.be.eventually.rejected; }); }); diff --git a/tests/src/contracts.test.ts b/tests/src/contracts.test.ts index 63fcd7a671..045522924a 100644 --- a/tests/src/contracts.test.ts +++ b/tests/src/contracts.test.ts @@ -47,6 +47,7 @@ const value = 0; const gasLimit = 9000n * 1000000n; const marketContractAddress = '5CYN9j3YvRkqxewoxeSvRbhAym4465C57uMmX5j4yz99L5H6'; +// todo:playgrounds skipped ~ postponed describe.skip('Contracts', () => { it('Can deploy smart contract Flipper, instantiate it and call it\'s get and flip messages.', async () => { await usingApi(async (api, privateKeyWrapper) => { diff --git a/tests/src/enableContractSponsoring.test.ts b/tests/src/enableContractSponsoring.test.ts index 46c3386dde..e1084d150b 100644 --- a/tests/src/enableContractSponsoring.test.ts +++ b/tests/src/enableContractSponsoring.test.ts @@ -29,6 +29,7 @@ import { chai.use(chaiAsPromised); const expect = chai.expect; +// todo:playgrounds skipped ~ postponed describe.skip('Integration Test enableContractSponsoring', () => { it('ensure tx fee is paid from endowment', async () => { await usingApi(async (api, privateKeyWrapper) => { diff --git a/tests/src/evmCoder.test.ts b/tests/src/evmCoder.test.ts index dd492504fe..9a1444933f 100644 --- a/tests/src/evmCoder.test.ts +++ b/tests/src/evmCoder.test.ts @@ -14,13 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +import {IKeyringPair} from '@polkadot/types/types'; import Web3 from 'web3'; -import {createEthAccountWithBalance, createNonfungibleCollection, GAS_ARGS, itWeb3} from './eth/util/helpers'; +import {itEth, expect, usingEthPlaygrounds} from './eth/util/playgrounds'; import * as solc from 'solc'; -import chai from 'chai'; -const expect = chai.expect; - async function compileTestContract(collectionAddress: string, contractAddress: string) { const input = { language: 'Solidity', @@ -79,22 +77,30 @@ async function compileTestContract(collectionAddress: string, contractAddress: s }; } -async function deployTestContract(web3: Web3, owner: string, collectionAddress: string, contractAddress: string) { +async function deployTestContract(web3: Web3, owner: string, collectionAddress: string, contractAddress: string, gas: number) { const compiled = await compileTestContract(collectionAddress, contractAddress); const fractionalizerContract = new web3.eth.Contract(compiled.abi, undefined, { data: compiled.object, from: owner, - ...GAS_ARGS, + gas, }); return await fractionalizerContract.deploy({data: compiled.object}).send({from: owner}); } describe('Evm Coder tests', () => { - itWeb3('Call non-existing function', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const {collectionIdAddress} = await createNonfungibleCollection(api, web3, owner); - const contract = await deployTestContract(web3, owner, collectionIdAddress, '0x1bfed5D614b886b9Ab2eA4CBAc22A96B7EC29c9c'); - const testContract = await deployTestContract(web3, owner, collectionIdAddress, contract.options.address); + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); + + itEth('Call non-existing function', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.eth.createNonfungibleCollection(owner, 'EVMCODER', '', 'TEST'); + const contract = await deployTestContract(helper.getWeb3(), owner, collection.collectionAddress, '0x1bfed5D614b886b9Ab2eA4CBAc22A96B7EC29c9c', helper.eth.DEFAULT_GAS); + const testContract = await deployTestContract(helper.getWeb3(), owner, collection.collectionAddress, contract.options.address, helper.eth.DEFAULT_GAS); { const result = await testContract.methods.test1().send(); expect(result.events.Result.returnValues).to.deep.equal({ diff --git a/tests/src/setContractSponsoringRateLimit.test.ts b/tests/src/setContractSponsoringRateLimit.test.ts index 77e830d557..7f50a2fa85 100644 --- a/tests/src/setContractSponsoringRateLimit.test.ts +++ b/tests/src/setContractSponsoringRateLimit.test.ts @@ -25,7 +25,7 @@ import { setContractSponsoringRateLimitExpectSuccess, } from './util/helpers'; -// todo:playgrounds postponed skipped test +// todo:playgrounds skipped~postponed test describe.skip('Integration Test setContractSponsoringRateLimit', () => { it('ensure sponsored contract can\'t be called twice without pause for free', async () => { await usingApi(async (api, privateKeyWrapper) => { diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index 6b5c60e4f9..bbf3f8c3f0 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -13,14 +13,14 @@ import {DevUniqueHelper, SilentLogger, SilentConsole} from './unique.dev'; chai.use(chaiAsPromised); export const expect = chai.expect; -export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { +export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise, url: string = config.substrateUrl) => { const silentConsole = new SilentConsole(); silentConsole.enable(); const helper = new DevUniqueHelper(new SilentLogger()); try { - await helper.connect(config.substrateUrl); + await helper.connect(url); const ss58Format = helper.chain.getChainProperties().ss58Format; const privateKey = (seed: string) => helper.util.fromSeed(seed, ss58Format); await code(helper, privateKey); From d6b2f4ba68a9ab4ccba8d5361cb41ee38c076919 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 20 Sep 2022 15:26:58 +0300 Subject: [PATCH 0945/1274] add draft check for each re-usable workflow --- .github/workflows/ci-develop.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index a496514af9..68770be110 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -3,7 +3,7 @@ name: develop on: pull_request: branches: [ 'develop' ] - types: [ opened, reopened, synchronize, ready_for_review ] + types: [ opened, reopened, synchronize, ready_for_review, converted_to_draft ] concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} @@ -12,23 +12,28 @@ concurrency: jobs: yarn-test-dev: + if: github.event.pull_request.draft == false uses: ./.github/workflows/dev-build-tests_v2.yml + unit-test: + if: github.event.pull_request.draft == false uses: ./.github/workflows/unit-test_v2.yml canary: - if: ${{ contains( github.event.pull_request.labels.*.name, 'canary') }} + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'canary')) }} uses: ./.github/workflows/canary.yml secrets: inherit # pass all secrets xcm: - if: ${{ contains( github.event.pull_request.labels.*.name, 'xcm') }} + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'xcm')) }} uses: ./.github/workflows/xcm.yml secrets: inherit # pass all secrets codestyle: + if: github.event.pull_request.draft == false uses: ./.github/workflows/codestyle_v2.yml yarn_eslint: + if: github.event.pull_request.draft == false uses: ./.github/workflows/test_codestyle_v2.yml From 3069e4dc18cec91573ab8d2225ad10aa6094d6cc Mon Sep 17 00:00:00 2001 From: rkv Date: Tue, 20 Sep 2022 18:43:26 +0300 Subject: [PATCH 0946/1274] add helpers & fix replace mistakes --- tests/src/allowLists.test.ts | 6 +- tests/src/change-collection-owner.test.ts | 6 +- tests/src/confirmSponsorship.test.ts | 34 +++++++---- tests/src/createCollection.test.ts | 54 ++++++++++++----- tests/src/createItem.test.ts | 70 ++++++++++++++++------- tests/src/createMultipleItems.test.ts | 6 +- 6 files changed, 120 insertions(+), 56 deletions(-) diff --git a/tests/src/allowLists.test.ts b/tests/src/allowLists.test.ts index edee51140a..06ba22c8b3 100644 --- a/tests/src/allowLists.test.ts +++ b/tests/src/allowLists.test.ts @@ -1,12 +1,12 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // This file is part of Unique Network. -// Unique Network is free software: you can redistribute itSub and/or modify -// itSub under the terms of the GNU General Public License as published by +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Unique Network is distributed in the hope that itSub will be useful, +// Unique Network is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. diff --git a/tests/src/change-collection-owner.test.ts b/tests/src/change-collection-owner.test.ts index caec444727..f7fa680e00 100644 --- a/tests/src/change-collection-owner.test.ts +++ b/tests/src/change-collection-owner.test.ts @@ -1,12 +1,12 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // This file is part of Unique Network. -// Unique Network is free software: you can redistribute itSub and/or modify -// itSub under the terms of the GNU General Public License as published by +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Unique Network is distributed in the hope that itSub will be useful, +// Unique Network is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. diff --git a/tests/src/confirmSponsorship.test.ts b/tests/src/confirmSponsorship.test.ts index 007653e021..1c3a03cb07 100644 --- a/tests/src/confirmSponsorship.test.ts +++ b/tests/src/confirmSponsorship.test.ts @@ -1,12 +1,12 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // This file is part of Unique Network. -// Unique Network is free software: you can redistribute itSub and/or modify -// itSub under the terms of the GNU General Public License as published by +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Unique Network is distributed in the hope that itSub will be useful, +// Unique Network is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. @@ -17,6 +17,18 @@ import {IKeyringPair} from '@polkadot/types/types'; import {usingPlaygrounds, expect, itSub, Pallets} from './util/playgrounds'; +async function setSponsorHelper(collection: any, signer: IKeyringPair, sponsorAddress: string) { + await collection.setSponsor(signer, sponsorAddress); + const raw = (await collection.getData())?.raw; + expect(raw.sponsorship.Unconfirmed).to.be.equal(sponsorAddress); +} + +async function confirmSponsorHelper(collection: any, signer: IKeyringPair) { + await collection.confirmSponsorship(signer); + const raw = (await collection.getData())?.raw; + expect(raw.sponsorship.Confirmed).to.be.equal(signer.address); +} + describe('integration test: ext. confirmSponsorship():', () => { let alice: IKeyringPair; let bob: IKeyringPair; @@ -32,21 +44,21 @@ describe('integration test: ext. confirmSponsorship():', () => { itSub('Confirm collection sponsorship', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(bob); + await setSponsorHelper(collection, alice, bob.address); + await confirmSponsorHelper(collection, bob); }); itSub('Add sponsor to a collection after the same sponsor was already added and confirmed', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(bob); - await collection.setSponsor(alice, bob.address); + await setSponsorHelper(collection, alice, bob.address); + await confirmSponsorHelper(collection, bob); + await setSponsorHelper(collection, alice, bob.address); }); itSub('Add new sponsor to a collection after another sponsor was already added and confirmed', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.setSponsor(alice, bob.address); - await collection.confirmSponsorship(bob); - await collection.setSponsor(alice, charlie.address); + await setSponsorHelper(collection, alice, bob.address); + await confirmSponsorHelper(collection, bob); + await setSponsorHelper(collection, alice, charlie.address); }); itSub('NFT: Transfer fees are paid by the sponsor after confirmation', async ({helper}) => { diff --git a/tests/src/createCollection.test.ts b/tests/src/createCollection.test.ts index 7e43c6df5e..66e3973c7d 100644 --- a/tests/src/createCollection.test.ts +++ b/tests/src/createCollection.test.ts @@ -1,12 +1,12 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // This file is part of Unique Network. -// Unique Network is free software: you can redistribute itSub and/or modify -// itSub under the terms of the GNU General Public License as published by +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Unique Network is distributed in the hope that itSub will be useful, +// Unique Network is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. @@ -16,7 +16,33 @@ import {usingPlaygrounds, expect, itSub, Pallets} from './util/playgrounds'; import {IKeyringPair} from '@polkadot/types/types'; -import {IProperty} from './util/playgrounds/types'; +import {ICollectionCreationOptions, IProperty} from './util/playgrounds/types'; +import {DevUniqueHelper} from './util/playgrounds/unique.dev'; + +async function mintCollectionHelper(helper: DevUniqueHelper, signer: IKeyringPair, options: ICollectionCreationOptions, type?: 'nft' | 'fungible' | 'refungible') { + let collection; + if (type === 'nft') { + collection = await helper.nft.mintCollection(signer, options); + } else if (type === 'fungible') { + collection = await helper.ft.mintCollection(signer, options, 0); + } else { + collection = await helper.rft.mintCollection(signer, options); + } + const data = await collection.getData(); + expect(data?.normalizedOwner).to.be.equal(signer.address); + expect(data?.name).to.be.equal(options.name); + expect(data?.description).to.be.equal(options.description); + expect(data?.raw.tokenPrefix).to.be.equal(options.tokenPrefix); + if (options.properties) { + expect(data?.raw.properties).to.be.deep.equal(options.properties); + } + + if (options.tokenPropertyPermissions) { + expect(data?.raw.tokenPropertyPermissions).to.be.deep.equal(options.tokenPropertyPermissions); + } + + return collection; +} describe('integration test: ext. createCollection():', () => { let alice: IKeyringPair; @@ -29,41 +55,41 @@ describe('integration test: ext. createCollection():', () => { }); itSub('Create new NFT collection', async ({helper}) => { - await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + await mintCollectionHelper(helper, alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 'nft'); }); itSub('Create new NFT collection whith collection_name of maximum length (64 bytes)', async ({helper}) => { - await helper.nft.mintCollection(alice, {name: 'A'.repeat(64), description: 'descr', tokenPrefix: 'COL'}); + await mintCollectionHelper(helper, alice, {name: 'A'.repeat(64), description: 'descr', tokenPrefix: 'COL'}, 'nft'); }); itSub('Create new NFT collection whith collection_description of maximum length (256 bytes)', async ({helper}) => { - await helper.nft.mintCollection(alice, {name: 'name', description: 'A'.repeat(256), tokenPrefix: 'COL'}); + await mintCollectionHelper(helper, alice, {name: 'name', description: 'A'.repeat(256), tokenPrefix: 'COL'}, 'nft'); }); itSub('Create new NFT collection whith token_prefix of maximum length (16 bytes)', async ({helper}) => { - await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'A'.repeat(16)}); + await mintCollectionHelper(helper, alice, {name: 'name', description: 'descr', tokenPrefix: 'A'.repeat(16)}, 'nft'); }); itSub('Create new Fungible collection', async ({helper}) => { - await helper.ft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 0); + await mintCollectionHelper(helper, alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 'fungible'); }); itSub.ifWithPallets('Create new ReFungible collection', [Pallets.ReFungible], async ({helper}) => { - await helper.rft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); + await mintCollectionHelper(helper, alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 'refungible'); }); itSub('create new collection with properties', async ({helper}) => { - await helper.nft.mintCollection(alice, { + await mintCollectionHelper(helper, alice, { name: 'name', description: 'descr', tokenPrefix: 'COL', properties: [{key: 'key1', value: 'val1'}], tokenPropertyPermissions: [{key: 'key1', permission: {tokenOwner: true, mutable: false, collectionAdmin: true}}], - }); + }, 'nft'); }); itSub('Create new collection with extra fields', async ({helper}) => { - const collection = await helper.ft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 8); + const collection = await mintCollectionHelper(helper, alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 'fungible'); await collection.setPermissions(alice, {access: 'AllowList'}); await collection.setLimits(alice, {accountTokenOwnershipLimit: 3}); const data = await collection.getData(); @@ -74,7 +100,7 @@ describe('integration test: ext. createCollection():', () => { expect(data?.name).to.be.equal('name'); expect(data?.description).to.be.equal('descr'); expect(raw.permissions.access).to.be.equal('AllowList'); - expect(raw.mode).to.be.deep.equal({Fungible: '8'}); + expect(raw.mode).to.be.deep.equal({Fungible: '0'}); expect(limits.accountTokenOwnershipLimit).to.be.equal(3); }); diff --git a/tests/src/createItem.test.ts b/tests/src/createItem.test.ts index b5e37d5c9b..f77f049787 100644 --- a/tests/src/createItem.test.ts +++ b/tests/src/createItem.test.ts @@ -1,12 +1,12 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // This file is part of Unique Network. -// Unique Network is free software: you can redistribute itSub and/or modify -// itSub under the terms of the GNU General Public License as published by +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Unique Network is distributed in the hope that itSub will be useful, +// Unique Network is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. @@ -21,11 +21,37 @@ import { itApi, normalizeAccountId, getCreateItemResult, + CrossAccountId, } from './util/helpers'; import {usingPlaygrounds, expect, itSub, Pallets} from './util/playgrounds'; import {IProperty} from './util/playgrounds/types'; import {executeTransaction} from './substrate/substrate-api'; +import {DevUniqueHelper} from './util/playgrounds/unique.dev'; + +async function mintTokenHelper(helper: DevUniqueHelper, collection: any, signer: IKeyringPair, owner: CrossAccountId, type: 'nft' | 'fungible' | 'refungible'='nft', properties?: IProperty[]) { + let token; + const itemCountBefore = await helper.collection.getLastTokenId(collection.collectionId); + const itemBalanceBefore = (await helper.api!.rpc.unique.balance(collection.collectionId, owner, 0)).toBigInt(); + if (type === 'nft') { + token = await collection.mintToken(signer, owner, properties); + } else if (type === 'fungible') { + await collection.mint(signer, 10n, owner); + } else { + token = await collection.mintToken(signer, 100n, owner, properties); + } + + const itemCountAfter = await helper.collection.getLastTokenId(collection.collectionId); + const itemBalanceAfter = (await helper.api!.rpc.unique.balance(collection.collectionId, owner, 0)).toBigInt(); + + if (type === 'fungible') { + expect(itemBalanceAfter - itemBalanceBefore).to.be.equal(10n); + } else { + expect(itemCountAfter).to.be.equal(itemCountBefore + 1); + } + + return token; +} describe('integration test: ext. ():', () => { @@ -41,55 +67,55 @@ describe('integration test: ext. ():', () => { itSub('Create new item in NFT collection', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.mintToken(alice, {Substrate: alice.address}); + await mintTokenHelper(helper, collection, alice, {Substrate: alice.address}); }); itSub('Create new item in Fungible collection', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); - await collection.mint(alice, 10n, {Substrate: alice.address}); + await mintTokenHelper(helper, collection, alice, {Substrate: alice.address}, 'fungible'); }); - itApi.skip('Check events on create new item in Fungible collection', async ({api}) => { - const createMode = 'Fungible'; + itSub('Check events on create new item in Fungible collection', async ({helper}) => { + const {collectionId} = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}, 0); + const api = helper.api!; - const newCollectionID = (await createCollection(api, alice, {mode: {type: createMode, decimalPoints: 0}})).collectionId; const to = normalizeAccountId(alice); { const createData = {fungible: {value: 100}}; - const tx = api.tx.unique.createItem(newCollectionID, to, createData as any); + const tx = api.tx.unique.createItem(collectionId, to, createData as any); const events = await executeTransaction(api, alice, tx); const result = getCreateItemResult(events); expect(result.amount).to.be.equal(100); - expect(result.collectionId).to.be.equal(newCollectionID); + expect(result.collectionId).to.be.equal(collectionId); expect(result.recipient).to.be.deep.equal(to); } { const createData = {fungible: {value: 50}}; - const tx = api.tx.unique.createItem(newCollectionID, to, createData as any); + const tx = api.tx.unique.createItem(collectionId, to, createData as any); const events = await executeTransaction(api, alice, tx); const result = getCreateItemResult(events); expect(result.amount).to.be.equal(50); - expect(result.collectionId).to.be.equal(newCollectionID); + expect(result.collectionId).to.be.equal(collectionId); expect(result.recipient).to.be.deep.equal(to); } }); itSub.ifWithPallets('Create new item in ReFungible collection', [Pallets.ReFungible], async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); - await collection.mintToken(alice, 100n, {Substrate: alice.address}); + await mintTokenHelper(helper, collection, alice, {Substrate: alice.address}, 'refungible'); }); itSub('Create new item in NFT collection with collection admin permissions', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await collection.addAdmin(alice, {Substrate: bob.address}); - await collection.mintToken(bob, {Substrate: alice.address}); + await mintTokenHelper(helper, collection, bob, {Substrate: alice.address}); }); itSub('Create new item in Fungible collection with collection admin permissions', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); await collection.addAdmin(alice, {Substrate: bob.address}); - await collection.mint(bob, 10n, {Substrate: alice.address}); + await mintTokenHelper(helper, collection, bob, {Substrate: alice.address}, 'fungible'); }); itSub.ifWithPallets('Create new item in ReFungible collection with collection admin permissions', [Pallets.ReFungible], async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await collection.addAdmin(alice, {Substrate: bob.address}); - await collection.mintToken(bob, 100n, {Substrate: alice.address}); + await mintTokenHelper(helper, collection, bob, {Substrate: alice.address}, 'refungible'); }); itSub('Set property Admin', async ({helper}) => { @@ -97,7 +123,7 @@ describe('integration test: ext. ():', () => { properties: [{key: 'k', value: 'v'}], tokenPropertyPermissions: [{key: 'k', permission: {tokenOwner: false, mutable: true, collectionAdmin: true}}], }); - await collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); + await mintTokenHelper(helper, collection, alice, {Substrate: bob.address}, 'nft', [{key: 'k', value: 'v'}]); }); itSub('Set property AdminConst', async ({helper}) => { @@ -105,7 +131,7 @@ describe('integration test: ext. ():', () => { properties: [{key: 'k', value: 'v'}], tokenPropertyPermissions: [{key: 'k', permission: {tokenOwner: false, mutable: false, collectionAdmin: true}}], }); - await collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); + await mintTokenHelper(helper, collection, alice, {Substrate: bob.address}, 'nft', [{key: 'k', value: 'v'}]); }); itSub('Set property itemOwnerOrAdmin', async ({helper}) => { @@ -113,13 +139,13 @@ describe('integration test: ext. ():', () => { properties: [{key: 'k', value: 'v'}], tokenPropertyPermissions: [{key: 'k', permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}], }); - await collection.mintToken(alice, {Substrate: bob.address}, [{key: 'k', value: 'v'}]); + await mintTokenHelper(helper, collection, alice, {Substrate: bob.address}, 'nft', [{key: 'k', value: 'v'}]); }); itSub('Check total pieces of Fungible token', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); const amount = 10n; - await collection.mint(alice, amount, {Substrate: bob.address}); + await mintTokenHelper(helper, collection, alice, {Substrate: bob.address}, 'fungible'); { const totalPieces = await collection.getTotalPieces(); expect(totalPieces).to.be.equal(amount); @@ -134,7 +160,7 @@ describe('integration test: ext. ():', () => { itSub('Check total pieces of NFT token', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const amount = 1n; - const token = await collection.mintToken(alice, {Substrate: bob.address}); + const token = await mintTokenHelper(helper, collection, alice, {Substrate: bob.address}); { const totalPieces = await helper.api?.rpc.unique.totalPieces(collection.collectionId, token.tokenId); expect(totalPieces?.unwrap().toBigInt()).to.be.equal(amount); @@ -149,7 +175,7 @@ describe('integration test: ext. ():', () => { itSub.ifWithPallets('Check total pieces of ReFungible token', [Pallets.ReFungible], async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const amount = 100n; - const token = await collection.mintToken(alice, amount, {Substrate: bob.address}); + const token = await mintTokenHelper(helper, collection, alice, {Substrate: bob.address}, 'refungible'); { const totalPieces = await token.getTotalPieces(); expect(totalPieces).to.be.equal(amount); diff --git a/tests/src/createMultipleItems.test.ts b/tests/src/createMultipleItems.test.ts index ad39ed8f81..556e0ece44 100644 --- a/tests/src/createMultipleItems.test.ts +++ b/tests/src/createMultipleItems.test.ts @@ -1,12 +1,12 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // This file is part of Unique Network. -// Unique Network is free software: you can redistribute itSub and/or modify -// itSub under the terms of the GNU General Public License as published by +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// Unique Network is distributed in the hope that itSub will be useful, +// Unique Network is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. From f5a3434a83480771f6def24ead015cc92cf59a3c Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 21 Sep 2022 16:19:47 +0300 Subject: [PATCH 0947/1274] fix: createMultipleItemsEx remove skip tests --- tests/src/createMultipleItemsEx.test.ts | 156 ++++++++++++------------ 1 file changed, 76 insertions(+), 80 deletions(-) diff --git a/tests/src/createMultipleItemsEx.test.ts b/tests/src/createMultipleItemsEx.test.ts index 0a555fcc6e..b946d080a0 100644 --- a/tests/src/createMultipleItemsEx.test.ts +++ b/tests/src/createMultipleItemsEx.test.ts @@ -16,8 +16,6 @@ import {IKeyringPair} from '@polkadot/types/types'; import {usingPlaygrounds, expect, Pallets, itSub} from './util/playgrounds'; -import usingApi, {executeTransaction} from './substrate/substrate-api'; -import {createCollectionExpectSuccess, getBalance, getLastTokenId, getTokenProperties, requirePallets} from './util/helpers'; import {IProperty} from './util/playgrounds/types'; describe('Integration Test: createMultipleItemsEx', () => { @@ -173,95 +171,93 @@ describe('Integration Test: createMultipleItemsEx', () => { } }); - it.skip('can initialize fungible with multiple owners', async () => { - const collection = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); + itSub('can initialize fungible with multiple owners', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + }, 0); + + const api = helper.api; + await helper.signTransaction(alice, api?.tx.unique.createMultipleItemsEx(collection.collectionId, { + Fungible: new Map([ + [JSON.stringify({Substrate: alice.address}), 50], + [JSON.stringify({Substrate: bob.address}), 100], + ]), + })); + + expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(50n); + expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(100n); + }); + + itSub.ifWithPallets('can initialize an RFT with multiple owners', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'k', permission: {tokenOwner: true, mutable: false, collectionAdmin: false}}, + ], + }); - await executeTransaction(api, alice, api.tx.unique.createMultipleItemsEx(collection, { - Fungible: new Map([ - [JSON.stringify({Substrate: alice.address}), 50], - [JSON.stringify({Substrate: bob.address}), 100], + const api = helper.api; + await helper.signTransaction(alice, api?.tx.unique.createMultipleItemsEx(collection.collectionId, { + RefungibleMultipleOwners: { + users: new Map([ + [JSON.stringify({Substrate: alice.address}), 1], + [JSON.stringify({Substrate: bob.address}), 2], ]), - })); + properties: [ + {key: 'k', value: 'v'}, + ], + }, + })); + const tokenId = await collection.getLastTokenId(); + expect(tokenId).to.be.equal(1); + expect(await collection.getTokenBalance(1, {Substrate: alice.address})).to.be.equal(1n); + expect(await collection.getTokenBalance(1, {Substrate: bob.address})).to.be.equal(2n); + }); - expect(await getBalance(api, collection, alice.address, 0)).to.equal(50n); - expect(await getBalance(api, collection, bob.address, 0)).to.equal(100n); + itSub.ifWithPallets('can initialize multiple RFTs with the same owner', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice, { + name: 'name', + description: 'descr', + tokenPrefix: 'COL', + tokenPropertyPermissions: [ + {key: 'k', permission: {tokenOwner: true, mutable: false, collectionAdmin: false}}, + ], }); - }); - it.skip('can initialize an RFT with multiple owners', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'data', permission: {tokenOwner: true}}]), - ); - - await executeTransaction(api, alice, api.tx.unique.createMultipleItemsEx(collection, { - RefungibleMultipleOwners: { - users: new Map([ - [JSON.stringify({Substrate: alice.address}), 1], - [JSON.stringify({Substrate: bob.address}), 2], - ]), + const api = helper.api; + + await helper.signTransaction(alice, api?.tx.unique.createMultipleItemsEx(collection.collectionId, { + RefungibleMultipleItems: [ + { + user: {Substrate: alice.address}, pieces: 1, properties: [ - {key: 'data', value: 'testValue'}, + {key: 'k', value: 'v1'}, ], }, - })); - - const itemsListIndexAfter = await getLastTokenId(api, collection); - expect(itemsListIndexAfter).to.be.equal(1); - - expect(await getBalance(api, collection, alice.address, 1)).to.be.equal(1n); - expect(await getBalance(api, collection, bob.address, 1)).to.be.equal(2n); - expect((await getTokenProperties(api, collection, 1, ['data']))[0].value).to.be.equal('testValue'); - }); - }); + { + user: {Substrate: alice.address}, pieces: 3, + properties: [ + {key: 'k', value: 'v2'}, + ], + }, + ], + })); - it.skip('can initialize multiple RFTs with the same owner', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'data', permission: {tokenOwner: true}}]), - ); - - await executeTransaction(api, alice, api.tx.unique.createMultipleItemsEx(collection, { - RefungibleMultipleItems: [ - { - user: {Substrate: alice.address}, pieces: 1, - properties: [ - {key: 'data', value: 'testValue1'}, - ], - }, - { - user: {Substrate: alice.address}, pieces: 3, - properties: [ - {key: 'data', value: 'testValue2'}, - ], - }, - ], - })); + expect(await collection.getLastTokenId()).to.be.equal(2); + expect(await collection.getTokenBalance(1, {Substrate: alice.address})).to.be.equal(1n); + expect(await collection.getTokenBalance(2, {Substrate: alice.address})).to.be.equal(3n); - const itemsListIndexAfter = await getLastTokenId(api, collection); - expect(itemsListIndexAfter).to.be.equal(2); + const tokenData1 = await helper.rft.getToken(collection.collectionId, 1); + expect(tokenData1).to.not.be.null; + expect(tokenData1?.properties[0]).to.be.deep.equal({key: 'k', value: 'v1'}); - expect(await getBalance(api, collection, alice.address, 1)).to.be.equal(1n); - expect(await getBalance(api, collection, alice.address, 2)).to.be.equal(3n); - expect((await getTokenProperties(api, collection, 1, ['data']))[0].value).to.be.equal('testValue1'); - expect((await getTokenProperties(api, collection, 2, ['data']))[0].value).to.be.equal('testValue2'); - }); + const tokenData2 = await helper.rft.getToken(collection.collectionId, 2); + expect(tokenData2).to.not.be.null; + expect(tokenData2?.properties[0]).to.be.deep.equal({key: 'k', value: 'v2'}); }); }); From 3c4a992556fd7e9c8dd3134a4c787206dbc914b0 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 22 Sep 2022 09:07:31 +0000 Subject: [PATCH 0948/1274] feat: add skip/only/ifWithPallets to itSub/itEth --- tests/src/eth/util/playgrounds/index.ts | 24 ++++++++++++++++++------ tests/src/util/playgrounds/index.ts | 8 +++++++- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/tests/src/eth/util/playgrounds/index.ts b/tests/src/eth/util/playgrounds/index.ts index c7cffe4fe5..b0f1e295f6 100644 --- a/tests/src/eth/util/playgrounds/index.ts +++ b/tests/src/eth/util/playgrounds/index.ts @@ -12,6 +12,7 @@ export {EthUniqueHelper} from './unique.dev'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; +import { requirePalletsOrSkip } from '../../../util/playgrounds'; chai.use(chaiAsPromised); export const expect = chai.expect; @@ -35,15 +36,26 @@ export const usingEthPlaygrounds = async (code: (helper: EthUniqueHelper, privat } }; -export async function itEth(name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean } = {}) { - let i: any = it; - if (opts.only) i = i.only; - else if (opts.skip) i = i.skip; - i(name, async () => { +export async function itEth(name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean, requiredPallets?: string[] } = {}) { + (opts.only ? it.only : + opts.skip ? it.skip : it)(name, async function() { await usingEthPlaygrounds(async (helper, privateKey) => { + if (opts.requiredPallets) { + requirePalletsOrSkip(this, helper, opts.requiredPallets); + } + await cb({helper, privateKey}); }); }); } + +export async function itEthIfWithPallet(name: string, required: string[], cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean, requiredPallets?: string[] } = {}) { + return itEth(name, cb, {requiredPallets: required, ...opts}); +} + itEth.only = (name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itEth(name, cb, {only: true}); -itEth.skip = (name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itEth(name, cb, {skip: true}); \ No newline at end of file +itEth.skip = (name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itEth(name, cb, {skip: true}); + +itEthIfWithPallet.only = (name: string, required: string[], cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itEthIfWithPallet(name, required, cb, {only: true}); +itEthIfWithPallet.skip = (name: string, required: string[], cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itEthIfWithPallet(name, required, cb, {skip: true}); +itEth.ifWithPallets = itEthIfWithPallet; diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index bbf3f8c3f0..241b6731b4 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -63,6 +63,12 @@ export async function itSub(name: string, cb: (apis: { helper: DevUniqueHelper, }); }); } +export async function itSubIfWithPallet(name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean, requiredPallets?: string[] } = {}) { + return itSub(name, cb, {requiredPallets: required, ...opts}); +} itSub.only = (name: string, cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSub(name, cb, {only: true}); itSub.skip = (name: string, cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSub(name, cb, {skip: true}); -itSub.ifWithPallets = (name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSub(name, cb, {requiredPallets: required}); + +itSubIfWithPallet.only = (name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSubIfWithPallet(name, required, cb, {only: true}); +itSubIfWithPallet.skip = (name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSubIfWithPallet(name, required, cb, {skip: true}); +itSub.ifWithPallets = itSubIfWithPallet; From fd6a419056e6e618aee3dd5cf5175a267538edbd Mon Sep 17 00:00:00 2001 From: rkv Date: Thu, 22 Sep 2022 14:03:59 +0300 Subject: [PATCH 0949/1274] fix: normalize addresses --- tests/src/change-collection-owner.test.ts | 12 ++++++------ tests/src/createCollection.test.ts | 4 ++-- tests/src/createMultipleItems.test.ts | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/src/change-collection-owner.test.ts b/tests/src/change-collection-owner.test.ts index f7fa680e00..91deba5d05 100644 --- a/tests/src/change-collection-owner.test.ts +++ b/tests/src/change-collection-owner.test.ts @@ -31,11 +31,11 @@ describe('Integration Test changeCollectionOwner(collection_id, new_owner):', () itSub('Changing owner changes owner address', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const beforeChanging = await helper.collection.getData(collection.collectionId); - expect(beforeChanging?.normalizedOwner).to.be.equal(alice.address); + expect(beforeChanging?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(alice.address)); await collection.changeOwner(alice, bob.address); const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); + expect(afterChanging?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(bob.address)); }); }); @@ -60,7 +60,7 @@ describe('Integration Test changeCollectionOwner(collection_id, new_owner) speci await expect(changeOwnerTx()).to.be.rejectedWith(/common\.NoPermission/); const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); + expect(afterChanging?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(bob.address)); }); itSub('New collectionOwner has access to sponsorship management operations in the collection', async ({helper}) => { @@ -68,7 +68,7 @@ describe('Integration Test changeCollectionOwner(collection_id, new_owner) speci await collection.changeOwner(alice, bob.address); const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); + expect(afterChanging?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(bob.address)); await collection.setSponsor(bob, charlie.address); await collection.confirmSponsorship(charlie); @@ -97,7 +97,7 @@ describe('Integration Test changeCollectionOwner(collection_id, new_owner) speci await collection.changeOwner(alice, bob.address); await collection.changeOwner(bob, charlie.address); const collectionData = await collection.getData(); - expect(collectionData?.normalizedOwner).to.be.equal(charlie.address); + expect(collectionData?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(charlie.address)); }); }); @@ -140,7 +140,7 @@ describe('Negative Integration Test changeCollectionOwner(collection_id, new_own await expect(changeOwnerTx()).to.be.rejectedWith(/common\.NoPermission/); const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(bob.address); + expect(afterChanging?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(bob.address)); const setSponsorTx = async () => collection.setSponsor(alice, charlie.address); const confirmSponsorshipTx = async () => collection.confirmSponsorship(alice); diff --git a/tests/src/createCollection.test.ts b/tests/src/createCollection.test.ts index 66e3973c7d..f7bd03d073 100644 --- a/tests/src/createCollection.test.ts +++ b/tests/src/createCollection.test.ts @@ -29,7 +29,7 @@ async function mintCollectionHelper(helper: DevUniqueHelper, signer: IKeyringPai collection = await helper.rft.mintCollection(signer, options); } const data = await collection.getData(); - expect(data?.normalizedOwner).to.be.equal(signer.address); + expect(data?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(signer.address)); expect(data?.name).to.be.equal(options.name); expect(data?.description).to.be.equal(options.description); expect(data?.raw.tokenPrefix).to.be.equal(options.tokenPrefix); @@ -96,7 +96,7 @@ describe('integration test: ext. createCollection():', () => { const limits = await collection.getEffectiveLimits(); const raw = data?.raw; - expect(data?.normalizedOwner).to.be.equal(alice.address); + expect(data?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(alice.address)); expect(data?.name).to.be.equal('name'); expect(data?.description).to.be.equal('descr'); expect(raw.permissions.access).to.be.equal('AllowList'); diff --git a/tests/src/createMultipleItems.test.ts b/tests/src/createMultipleItems.test.ts index 556e0ece44..6d0b0c6094 100644 --- a/tests/src/createMultipleItems.test.ts +++ b/tests/src/createMultipleItems.test.ts @@ -48,7 +48,7 @@ describe('Integration Test createMultipleItems(collection_id, owner, items_data) const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); for (const [i, token] of tokens.entries()) { const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.util.normalizeSubstrateAddress(alice.address)}); expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); } }); @@ -116,7 +116,7 @@ describe('Integration Test createMultipleItems(collection_id, owner, items_data) const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); for (const [i, token] of tokens.entries()) { const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.util.normalizeSubstrateAddress(alice.address)}); expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); } }); @@ -138,7 +138,7 @@ describe('Integration Test createMultipleItems(collection_id, owner, items_data) const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); for (const [i, token] of tokens.entries()) { const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.util.normalizeSubstrateAddress(alice.address)}); expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); } }); @@ -160,7 +160,7 @@ describe('Integration Test createMultipleItems(collection_id, owner, items_data) const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); for (const [i, token] of tokens.entries()) { const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: alice.address}); + expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.util.normalizeSubstrateAddress(alice.address)}); expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); } }); From 9e6bd66f0fef69c2f8ac964fb416e2021b78c663 Mon Sep 17 00:00:00 2001 From: rkv Date: Thu, 22 Sep 2022 14:27:02 +0300 Subject: [PATCH 0950/1274] fix: wrap rft test with ifWithPallets --- tests/src/createItem.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/createItem.test.ts b/tests/src/createItem.test.ts index f77f049787..4e7601bb69 100644 --- a/tests/src/createItem.test.ts +++ b/tests/src/createItem.test.ts @@ -209,7 +209,7 @@ describe('Negative integration test: ext. createItem():', () => { const mintTx = async () => collection.mint(bob, 10n, {Substrate: bob.address}); await expect(mintTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); }); - itSub('Regular user cannot create new item in ReFungible collection', async ({helper}) => { + itSub.ifWithPallets('Regular user cannot create new item in ReFungible collection', [Pallets.ReFungible], async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const mintTx = async () => collection.mintToken(bob, 100n, {Substrate: bob.address}); await expect(mintTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/); From 04cd15cc5d24a75e292e6a7f9b3e3b593e9409e0 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Thu, 22 Sep 2022 15:01:04 +0000 Subject: [PATCH 0951/1274] tests(nesting): refactored to use playgrounds --- tests/src/eth/util/playgrounds/index.ts | 2 +- tests/src/eth/util/playgrounds/unique.dev.ts | 2 +- tests/src/nesting/graphs.test.ts | 94 +- tests/src/nesting/migration-check.test.ts | 3 +- tests/src/nesting/nest.test.ts | 1231 +++++------ tests/src/nesting/properties.test.ts | 1911 ++++++++---------- tests/src/nesting/rules-smoke.test.ts | 63 - tests/src/nesting/unnest.test.ts | 236 +-- tests/src/util/playgrounds/types.ts | 9 +- tests/src/util/playgrounds/unique.ts | 145 +- 10 files changed, 1659 insertions(+), 2037 deletions(-) delete mode 100644 tests/src/nesting/rules-smoke.test.ts diff --git a/tests/src/eth/util/playgrounds/index.ts b/tests/src/eth/util/playgrounds/index.ts index b0f1e295f6..3bf1dd14e1 100644 --- a/tests/src/eth/util/playgrounds/index.ts +++ b/tests/src/eth/util/playgrounds/index.ts @@ -12,7 +12,7 @@ export {EthUniqueHelper} from './unique.dev'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import { requirePalletsOrSkip } from '../../../util/playgrounds'; +import {requirePalletsOrSkip} from '../../../util/playgrounds'; chai.use(chaiAsPromised); export const expect = chai.expect; diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index 097aaf7438..b6153ce2e4 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -240,7 +240,7 @@ class EthAddressGroup extends EthGroupBase { } fromTokenId(collectionId: number, tokenId: number): string { - return this.helper.util.getNestingTokenAddress(collectionId, tokenId); + return this.helper.util.getNestingTokenAddressRaw({collectionId, tokenId}); } normalizeAddress(address: string): string { diff --git a/tests/src/nesting/graphs.test.ts b/tests/src/nesting/graphs.test.ts index d384dddd00..86bd219df2 100644 --- a/tests/src/nesting/graphs.test.ts +++ b/tests/src/nesting/graphs.test.ts @@ -1,9 +1,22 @@ -import {ApiPromise} from '@polkadot/api'; +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + import {IKeyringPair} from '@polkadot/types/types'; -import {expect} from 'chai'; -import {tokenIdToCross} from '../eth/util/helpers'; -import usingApi, {executeTransaction} from '../substrate/substrate-api'; -import {getCreateCollectionResult, transferExpectSuccess, setCollectionLimitsExpectSuccess} from '../util/helpers'; +import {expect, itSub, usingPlaygrounds} from '../util/playgrounds'; +import {UniqueHelper, UniqueNFTToken} from '../util/playgrounds/unique'; /** * ```dot @@ -12,46 +25,47 @@ import {getCreateCollectionResult, transferExpectSuccess, setCollectionLimitsExp * 8 -> 5 * ``` */ -async function buildComplexObjectGraph(api: ApiPromise, sender: IKeyringPair): Promise { - const events = await executeTransaction(api, sender, api.tx.unique.createCollectionEx({mode: 'NFT', permissions: {nesting: {tokenOwner: true}}})); - const {collectionId} = getCreateCollectionResult(events); - - await executeTransaction(api, sender, api.tx.unique.createMultipleItemsEx(collectionId, {NFT: Array(8).fill({owner: {Substrate: sender.address}})})); - - await transferExpectSuccess(collectionId, 8, sender, tokenIdToCross(collectionId, 5)); +async function buildComplexObjectGraph(helper: UniqueHelper, sender: IKeyringPair): Promise { + const collection = await helper.nft.mintCollection(sender, {permissions: {nesting: {tokenOwner: true}}}); + const tokens = await collection.mintMultipleTokens(sender, Array(8).fill({owner: {Substrate: sender.address}})); - await transferExpectSuccess(collectionId, 7, sender, tokenIdToCross(collectionId, 6)); - await transferExpectSuccess(collectionId, 6, sender, tokenIdToCross(collectionId, 5)); - await transferExpectSuccess(collectionId, 5, sender, tokenIdToCross(collectionId, 2)); + await tokens[7].nest(sender, tokens[4]); + await tokens[6].nest(sender, tokens[5]); + await tokens[5].nest(sender, tokens[4]); + await tokens[4].nest(sender, tokens[1]); + await tokens[3].nest(sender, tokens[2]); + await tokens[2].nest(sender, tokens[1]); + await tokens[1].nest(sender, tokens[0]); - await transferExpectSuccess(collectionId, 4, sender, tokenIdToCross(collectionId, 3)); - await transferExpectSuccess(collectionId, 3, sender, tokenIdToCross(collectionId, 2)); - await transferExpectSuccess(collectionId, 2, sender, tokenIdToCross(collectionId, 1)); - - return collectionId; + return tokens; } describe('Graphs', () => { - it('Ouroboros can\'t be created in a complex graph', async () => { - await usingApi(async (api, privateKeyWrapper) => { - const alice = privateKeyWrapper('//Alice'); - const collection = await buildComplexObjectGraph(api, alice); - const tokenTwoParent = tokenIdToCross(collection, 1); - - // to self - await expect( - executeTransaction(api, alice, api.tx.unique.transfer(tokenIdToCross(collection, 1), collection, 1, 1)), - 'first transaction', - ).to.be.rejectedWith(/structure\.OuroborosDetected/); - // to nested part of graph - await expect( - executeTransaction(api, alice, api.tx.unique.transfer(tokenIdToCross(collection, 5), collection, 1, 1)), - 'second transaction', - ).to.be.rejectedWith(/structure\.OuroborosDetected/); - await expect( - executeTransaction(api, alice, api.tx.unique.transferFrom(tokenTwoParent, tokenIdToCross(collection, 8), collection, 2, 1)), - 'third transaction', - ).to.be.rejectedWith(/structure\.OuroborosDetected/); + let alice: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); }); }); + + itSub('Ouroboros can\'t be created in a complex graph', async ({helper}) => { + const tokens = await buildComplexObjectGraph(helper, alice); + + // to self + await expect( + tokens[0].nest(alice, tokens[0]), + 'first transaction', + ).to.be.rejectedWith(/structure\.OuroborosDetected/); + // to nested part of graph + await expect( + tokens[0].nest(alice, tokens[4]), + 'second transaction', + ).to.be.rejectedWith(/structure\.OuroborosDetected/); + await expect( + tokens[1].transferFrom(alice, tokens[0].nestingAddress(), tokens[7].nestingAddress()), + 'third transaction', + ).to.be.rejectedWith(/structure\.OuroborosDetected/); + }); }); diff --git a/tests/src/nesting/migration-check.test.ts b/tests/src/nesting/migration-check.test.ts index 19c212ef91..44bec04325 100644 --- a/tests/src/nesting/migration-check.test.ts +++ b/tests/src/nesting/migration-check.test.ts @@ -8,7 +8,8 @@ import waitNewBlocks from '../substrate/wait-new-blocks'; import find from 'find-process'; // todo un-skip for migrations -describe.skip('Migration testing', () => { +// todo:playgrounds skipped, this one is outdated. Probably to be deleted/replaced. +describe.skip('Migration testing: Properties', () => { let alice: IKeyringPair; before(async() => { diff --git a/tests/src/nesting/nest.test.ts b/tests/src/nesting/nest.test.ts index 4e0c6b6a74..b8b8f0488d 100644 --- a/tests/src/nesting/nest.test.ts +++ b/tests/src/nesting/nest.test.ts @@ -1,840 +1,667 @@ -import {expect} from 'chai'; -import {tokenIdToAddress} from '../eth/util/helpers'; -import usingApi, {executeTransaction} from '../substrate/substrate-api'; -import { - addCollectionAdminExpectSuccess, - addToAllowListExpectSuccess, - createCollectionExpectSuccess, - createItemExpectSuccess, - enableAllowListExpectSuccess, - enablePublicMintingExpectSuccess, - getTokenChildren, - getTokenOwner, - getTopmostTokenOwner, - normalizeAccountId, - setCollectionPermissionsExpectSuccess, - transferExpectFailure, - transferExpectSuccess, - transferFromExpectSuccess, - setCollectionLimitsExpectSuccess, - requirePallets, - Pallets, -} from '../util/helpers'; -import {IKeyringPair} from '@polkadot/types/types'; - -let alice: IKeyringPair; -let bob: IKeyringPair; -let charlie: IKeyringPair; +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. -describe('Integration Test: Composite nesting tests', () => { - before(async () => { - await usingApi(async (_, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - }); - }); +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. - 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: {tokenOwner: true}}); - const targetToken = await createItemExpectSuccess(alice, collection, 'NFT'); +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. - // Create a nested token - const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)}); - expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: alice.address}); - expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()}); +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . - // Create a token to be nested - const newToken = await createItemExpectSuccess(alice, collection, 'NFT'); - - // Nest - await transferExpectSuccess(collection, newToken, alice, {Ethereum: tokenIdToAddress(collection, targetToken)}); - expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address}); - expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()}); - - // Move bundle to different user - await transferExpectSuccess(collection, targetToken, alice, {Substrate: bob.address}); - expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: bob.address}); - expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()}); - - // Unnest - await transferFromExpectSuccess(collection, newToken, bob, {Ethereum: tokenIdToAddress(collection, targetToken)}, {Substrate: bob.address}); - expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: bob.address}); - }); - }); +import {IKeyringPair} from '@polkadot/types/types'; +import {expect, itSub, Pallets, usingPlaygrounds} from '../util/playgrounds'; - it('Transfers an already bundled token', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); - - 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()}); - }); - }); +describe('Integration Test: Composite nesting tests', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; - it('Checks token children', async () => { - await usingApi(async api => { - const collectionA = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionLimitsExpectSuccess(alice, collectionA, {ownerCanTransfer: true}); - await setCollectionPermissionsExpectSuccess(alice, collectionA, {nesting: {tokenOwner: true}}); - const collectionB = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - - const targetToken = await createItemExpectSuccess(alice, collectionA, 'NFT'); - const targetAddress = {Ethereum: tokenIdToAddress(collectionA, targetToken)}; - let children = await getTokenChildren(api, collectionA, targetToken); - expect(children.length).to.be.equal(0, 'Children length check at creation'); - - // Create a nested NFT token - const tokenA = await createItemExpectSuccess(alice, collectionA, 'NFT', targetAddress); - children = await getTokenChildren(api, collectionA, targetToken); - expect(children.length).to.be.equal(1, 'Children length check at nesting #1'); - expect(children).to.have.deep.members([ - {token: tokenA, collection: collectionA}, - ], 'Children contents check at nesting #1'); - - // Create then nest - const tokenB = await createItemExpectSuccess(alice, collectionA, 'NFT'); - await transferExpectSuccess(collectionA, tokenB, alice, targetAddress); - children = await getTokenChildren(api, collectionA, targetToken); - expect(children.length).to.be.equal(2, 'Children length check at nesting #2'); - expect(children).to.have.deep.members([ - {token: tokenA, collection: collectionA}, - {token: tokenB, collection: collectionA}, - ], 'Children contents check at nesting #2'); - - // Move token B to a different user outside the nesting tree - await transferFromExpectSuccess(collectionA, tokenB, alice, targetAddress, bob); - children = await getTokenChildren(api, collectionA, targetToken); - expect(children.length).to.be.equal(1, 'Children length check at unnesting'); - expect(children).to.be.have.deep.members([ - {token: tokenA, collection: collectionA}, - ], 'Children contents check at unnesting'); - - // Create a fungible token in another collection and then nest - const tokenC = await createItemExpectSuccess(alice, collectionB, 'Fungible'); - await transferExpectSuccess(collectionB, tokenC, alice, targetAddress, 1, 'Fungible'); - children = await getTokenChildren(api, collectionA, targetToken); - expect(children.length).to.be.equal(2, 'Children length check at nesting #3 (from another collection)'); - expect(children).to.be.have.deep.members([ - {token: tokenA, collection: collectionA}, - {token: tokenC, collection: collectionB}, - ], 'Children contents check at nesting #3 (from another collection)'); - - // Move the fungible token inside token A deeper in the nesting tree - await transferFromExpectSuccess(collectionB, tokenC, alice, targetAddress, {Ethereum: tokenIdToAddress(collectionA, tokenA)}, 1, 'Fungible'); - children = await getTokenChildren(api, collectionA, targetToken); - expect(children.length).to.be.equal(1, 'Children length check at deeper nesting'); - expect(children).to.be.have.deep.members([ - {token: tokenA, collection: collectionA}, - ], 'Children contents check at deeper nesting'); - }); + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); + }); + }); + + itSub('Performs the full suite: bundles a token, transfers, and unnests', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + const targetToken = await collection.mintToken(alice); + + // Create an immediately nested token + const nestedToken = await collection.mintToken(alice, targetToken.nestingAddress()); + expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address}); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + + // Create a token to be nested + const newToken = await collection.mintToken(alice); + + // Nest + await newToken.nest(alice, targetToken); + expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address}); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + + // Move bundle to different user + await targetToken.transfer(alice, {Substrate: bob.address}); + expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address}); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address}); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + + // Unnest + await newToken.unnest(bob, targetToken, {Substrate: bob.address}); + expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address}); + expect(await newToken.getOwner()).to.be.deep.equal({Substrate: bob.address}); + }); + + itSub('Transfers an already bundled token', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + const tokenA = await collection.mintToken(alice); + const tokenB = await collection.mintToken(alice); + + // Create a nested token + const tokenC = await collection.mintToken(alice, tokenA.nestingAddress()); + expect(await tokenC.getOwner()).to.be.deep.equal(tokenA.nestingAddress()); + + // Transfer the nested token to another token + await expect(tokenC.transferFrom(alice, tokenA.nestingAddress(), tokenB.nestingAddress())).to.be.fulfilled; + expect(await tokenC.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address}); + expect(await tokenC.getOwner()).to.be.deep.equal(tokenB.nestingAddress()); + }); + + itSub('Checks token children', async ({helper}) => { + const collectionA = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + const collectionB = await helper.ft.mintCollection(alice); + + const targetToken = await collectionA.mintToken(alice); + expect((await targetToken.getChildren()).length).to.be.equal(0, 'Children length check at creation'); + + // Create a nested NFT token + const tokenA = await collectionA.mintToken(alice, targetToken.nestingAddress()); + expect(await targetToken.getChildren()).to.have.deep.members([ + {tokenId: tokenA.tokenId, collectionId: collectionA.collectionId}, + ], 'Children contents check at nesting #1').and.be.length(1, 'Children length check at nesting #1'); + + // Create then nest + const tokenB = await collectionA.mintToken(alice); + await tokenB.nest(alice, targetToken); + expect(await targetToken.getChildren()).to.have.deep.members([ + {tokenId: tokenA.tokenId, collectionId: collectionA.collectionId}, + {tokenId: tokenB.tokenId, collectionId: collectionA.collectionId}, + ], 'Children contents check at nesting #2').and.be.length(2, 'Children length check at nesting #2'); + + // Move token B to a different user outside the nesting tree + await tokenB.unnest(alice, targetToken, {Substrate: bob.address}); + expect(await targetToken.getChildren()).to.be.have.deep.members([ + {tokenId: tokenA.tokenId, collectionId: collectionA.collectionId}, + ], 'Children contents check at nesting #3 (unnesting)').and.be.length(1, 'Children length check at nesting #3 (unnesting)'); + + // Create a fungible token in another collection and then nest + await collectionB.mint(alice, 10n); + await collectionB.transfer(alice, targetToken.nestingAddress(), 2n); + expect(await targetToken.getChildren()).to.be.have.deep.members([ + {tokenId: tokenA.tokenId, collectionId: collectionA.collectionId}, + {tokenId: 0, collectionId: collectionB.collectionId}, + ], 'Children contents check at nesting #4 (from another collection)') + .and.be.length(2, 'Children length check at nesting #4 (from another collection)'); + + // Move part of the fungible token inside token A deeper in the nesting tree + await collectionB.transferFrom(alice, targetToken.nestingAddress(), tokenA.nestingAddress(), 1n); + expect(await targetToken.getChildren()).to.be.have.deep.members([ + {tokenId: tokenA.tokenId, collectionId: collectionA.collectionId}, + {tokenId: 0, collectionId: collectionB.collectionId}, + ], 'Children contents check at nesting #5 (deeper)').and.be.length(2, 'Children length check at nesting #5 (deeper)'); + expect(await tokenA.getChildren()).to.be.have.deep.members([ + {tokenId: 0, collectionId: collectionB.collectionId}, + ], 'Children contents check at nesting #5.5 (deeper)').and.be.length(1, 'Children length check at nesting #5.5 (deeper)'); + + // Move the remaining part of the fungible token inside token A deeper in the nesting tree + await collectionB.transferFrom(alice, targetToken.nestingAddress(), tokenA.nestingAddress(), 1n); + expect(await targetToken.getChildren()).to.be.have.deep.members([ + {tokenId: tokenA.tokenId, collectionId: collectionA.collectionId}, + ], 'Children contents check at nesting #6 (deeper)').and.be.length(1, 'Children length check at nesting #6 (deeper)'); + expect(await tokenA.getChildren()).to.be.have.deep.members([ + {tokenId: 0, collectionId: collectionB.collectionId}, + ], 'Children contents check at nesting #6.5 (deeper)').and.be.length(1, 'Children length check at nesting #6.5 (deeper)'); }); }); -describe('Integration Test: Various token type nesting', async () => { +describe('Integration Test: Various token type nesting', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; + before(async () => { - await usingApi(async (_, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([50n, 10n, 10n], donor); }); }); - it('Admin (NFT): allows an Admin to nest a token', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {collectionAdmin: true}}); - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - const targetToken = await createItemExpectSuccess(alice, collection, 'NFT', charlie.address); + itSub('Admin (NFT): allows an Admin to nest a token', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {collectionAdmin: true}}}); + await collection.addAdmin(alice, {Substrate: bob.address}); + const targetToken = await collection.mintToken(alice, {Substrate: charlie.address}); - // Create a nested token - const nestedToken = await createItemExpectSuccess(bob, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)}); - expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: charlie.address}); - expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()}); + // Create an immediately nested token + const nestedToken = await collection.mintToken(bob, targetToken.nestingAddress()); + expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); - // Create a token to be nested and nest - const newToken = await createItemExpectSuccess(bob, collection, 'NFT'); - await transferExpectSuccess(collection, newToken, bob, {Ethereum: tokenIdToAddress(collection, targetToken)}); - expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: charlie.address}); - expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()}); - }); + // Create a token to be nested and nest + const newToken = await collection.mintToken(bob); + await newToken.nest(bob, targetToken); + expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); }); - it('Admin (NFT): Admin and Token Owner can operate together', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true, collectionAdmin: true}}); - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - const targetToken = await createItemExpectSuccess(alice, collection, 'NFT', charlie.address); + itSub('Admin (NFT): Admin and Token Owner can operate together', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {collectionAdmin: true, tokenOwner: true}}}); + await collection.addAdmin(alice, {Substrate: bob.address}); + const targetToken = await collection.mintToken(alice, {Substrate: charlie.address}); - // Create a nested token by an administrator - const nestedToken = await createItemExpectSuccess(bob, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)}); - expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: charlie.address}); - expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()}); + // Create an immediately nested token by an administrator + const nestedToken = await collection.mintToken(bob, targetToken.nestingAddress()); + expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); - // Create a token and allow the owner to nest too - const newToken = await createItemExpectSuccess(alice, collection, 'NFT', charlie.address); - await transferExpectSuccess(collection, newToken, charlie, {Ethereum: tokenIdToAddress(collection, nestedToken)}); - expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: charlie.address}); - expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, nestedToken).toLowerCase()}); - }); + // Create a token to be nested and nest + const newToken = await collection.mintToken(alice, {Substrate: charlie.address}); + await newToken.nest(charlie, targetToken); + expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); }); - it('Admin (NFT): allows an Admin to nest a token (Restricted nesting)', async () => { - await usingApi(async api => { - const collectionA = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await addCollectionAdminExpectSuccess(alice, collectionA, bob.address); - const collectionB = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await addCollectionAdminExpectSuccess(alice, collectionB, bob.address); - await setCollectionPermissionsExpectSuccess(alice, collectionA, {nesting: {collectionAdmin: true, restricted:[collectionA, collectionB]}}); - const targetToken = await createItemExpectSuccess(alice, collectionA, 'NFT', charlie.address); - - // Create a nested token - const nestedToken = await createItemExpectSuccess(bob, collectionB, 'NFT', {Ethereum: tokenIdToAddress(collectionA, targetToken)}); - expect(await getTopmostTokenOwner(api, collectionB, nestedToken)).to.be.deep.equal({Substrate: charlie.address}); - expect(await getTokenOwner(api, collectionB, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collectionA, targetToken).toLowerCase()}); - - // Create a token to be nested and nest - const newToken = await createItemExpectSuccess(bob, collectionB, 'NFT'); - await transferExpectSuccess(collectionB, newToken, bob, {Ethereum: tokenIdToAddress(collectionA, targetToken)}); - expect(await getTopmostTokenOwner(api, collectionB, newToken)).to.be.deep.equal({Substrate: charlie.address}); - expect(await getTokenOwner(api, collectionB, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collectionA, targetToken).toLowerCase()}); - }); + itSub('Admin (NFT): allows an Admin to nest a token (Restricted nesting)', async ({helper}) => { + const collectionA = await helper.nft.mintCollection(alice); + await collectionA.addAdmin(alice, {Substrate: bob.address}); + const collectionB = await helper.nft.mintCollection(alice); + await collectionB.addAdmin(alice, {Substrate: bob.address}); + await collectionA.setPermissions(alice, {nesting: {collectionAdmin: true, restricted:[collectionB.collectionId]}}); + const targetToken = await collectionA.mintToken(alice, {Substrate: charlie.address}); + + // Create an immediately nested token + const nestedToken = await collectionB.mintToken(bob, targetToken.nestingAddress()); + expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + + // Create a token to be nested and nest + const newToken = await collectionB.mintToken(bob); + await newToken.nest(bob, targetToken); + expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); }); // ---------- Non-Fungible ---------- - it('NFT: allows an Owner to nest/unnest their token', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); - const targetToken = await createItemExpectSuccess(alice, collection, 'NFT'); - - // Create a nested token - const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)}); - expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: alice.address}); - expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()}); - - // Create a token to be nested and nest - const newToken = await createItemExpectSuccess(alice, collection, 'NFT'); - await transferExpectSuccess(collection, newToken, alice, {Ethereum: tokenIdToAddress(collection, targetToken)}); - expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address}); - expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()}); - }); + itSub('NFT: allows an Owner to nest/unnest their token', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {permissions: {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true}}}); + await collection.addToAllowList(alice, {Substrate: charlie.address}); + const targetToken = await collection.mintToken(charlie); + await collection.addToAllowList(alice, targetToken.nestingAddress()); + + // Create an immediately nested token + const nestedToken = await collection.mintToken(charlie, targetToken.nestingAddress()); + expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + + // Create a token to be nested and nest + const newToken = await collection.mintToken(charlie); + await newToken.nest(charlie, targetToken); + expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); }); - it('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true, restricted:[collection]}}); - const targetToken = await createItemExpectSuccess(alice, collection, 'NFT'); + itSub('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async ({helper}) => { + const collectionA = await helper.nft.mintCollection(alice); + const collectionB = await helper.nft.mintCollection(alice); + //await collectionB.addAdmin(alice, {Substrate: bob.address}); + const targetToken = await collectionA.mintToken(alice, {Substrate: charlie.address}); - // Create a nested token - const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)}); - expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: alice.address}); - expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()}); + await collectionA.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true, restricted:[collectionB.collectionId]}}); + await collectionA.addToAllowList(alice, {Substrate: charlie.address}); + await collectionA.addToAllowList(alice, targetToken.nestingAddress()); - // Create a token to be nested and nest - const newToken = await createItemExpectSuccess(alice, collection, 'NFT'); - await transferExpectSuccess(collection, newToken, alice, {Ethereum: tokenIdToAddress(collection, targetToken)}); - expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address}); - expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()}); - }); + await collectionB.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await collectionB.addToAllowList(alice, {Substrate: charlie.address}); + await collectionB.addToAllowList(alice, targetToken.nestingAddress()); + + // Create an immediately nested token + const nestedToken = await collectionB.mintToken(charlie, targetToken.nestingAddress()); + expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + + // Create a token to be nested and nest + const newToken = await collectionB.mintToken(charlie); + await newToken.nest(charlie, targetToken); + expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); }); // ---------- Fungible ---------- - it('Fungible: allows an Owner to nest/unnest their token', async () => { - await usingApi(async api => { - const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}}); - const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address}); - const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)}; - - const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - - // Create a nested token - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collectionFT, - targetAddress, - {Fungible: {Value: 10}}, - ))).to.not.be.rejected; - - // Nest a new token - const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible'); - await transferExpectSuccess(collectionFT, newToken, alice, targetAddress, 1, 'Fungible'); - }); + itSub('Fungible: allows an Owner to nest/unnest their token', async ({helper}) => { + const collectionNFT = await helper.nft.mintCollection(alice, {permissions: {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true}}}); + const collectionFT = await helper.ft.mintCollection(alice); + const targetToken = await collectionNFT.mintToken(alice, {Substrate: charlie.address}); + + await collectionNFT.addToAllowList(alice, {Substrate: charlie.address}); + await collectionNFT.addToAllowList(alice, targetToken.nestingAddress()); + + await collectionFT.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await collectionFT.addToAllowList(alice, {Substrate: charlie.address}); + await collectionFT.addToAllowList(alice, targetToken.nestingAddress()); + + // Create an immediately nested token + await collectionFT.mint(charlie, 5n, targetToken.nestingAddress()); + expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(5n); + + // Create a token to be nested and nest + await collectionFT.mint(charlie, 5n); + await collectionFT.transfer(charlie, targetToken.nestingAddress(), 2n); + expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(7n); }); - it('Fungible: allows an Owner to nest/unnest their token (Restricted nesting)', async () => { - await usingApi(async api => { - const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address}); - const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)}; + itSub('Fungible: allows an Owner to nest/unnest their token (Restricted nesting)', async ({helper}) => { + const collectionNFT = await helper.nft.mintCollection(alice); + const collectionFT = await helper.ft.mintCollection(alice); + const targetToken = await collectionNFT.mintToken(alice, {Substrate: charlie.address}); - const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); + await collectionNFT.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true, restricted:[collectionFT.collectionId]}}); + await collectionNFT.addToAllowList(alice, {Substrate: charlie.address}); + await collectionNFT.addToAllowList(alice, targetToken.nestingAddress()); - await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted: [collectionFT]}}); + await collectionFT.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await collectionFT.addToAllowList(alice, {Substrate: charlie.address}); + await collectionFT.addToAllowList(alice, targetToken.nestingAddress()); - // Create a nested token - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collectionFT, - targetAddress, - {Fungible: {Value: 10}}, - ))).to.not.be.rejected; + // Create an immediately nested token + await collectionFT.mint(charlie, 5n, targetToken.nestingAddress()); + expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(5n); - // Nest a new token - const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible'); - await transferExpectSuccess(collectionFT, newToken, alice, targetAddress, 1, 'Fungible'); - }); + // Create a token to be nested and nest + await collectionFT.mint(charlie, 5n); + await collectionFT.transfer(charlie, targetToken.nestingAddress(), 2n); + expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(7n); }); // ---------- Re-Fungible ---------- - it('ReFungible: allows an Owner to nest/unnest their token', async function() { - await requirePallets(this, [Pallets.ReFungible]); + itSub.ifWithPallets('ReFungible: allows an Owner to nest/unnest their token', [Pallets.ReFungible], async ({helper}) => { + const collectionNFT = await helper.nft.mintCollection(alice, {permissions: {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true}}}); + const collectionRFT = await helper.rft.mintCollection(alice); + const targetToken = await collectionNFT.mintToken(alice, {Substrate: charlie.address}); - await usingApi(async api => { - const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}}); - const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address}); - const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)}; + await collectionNFT.addToAllowList(alice, {Substrate: charlie.address}); + await collectionNFT.addToAllowList(alice, targetToken.nestingAddress()); - const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); + await collectionRFT.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await collectionRFT.addToAllowList(alice, {Substrate: charlie.address}); + await collectionRFT.addToAllowList(alice, targetToken.nestingAddress()); - // Create a nested token - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collectionRFT, - targetAddress, - {ReFungible: {pieces: 100}}, - ))).to.not.be.rejected; + // Create an immediately nested token + const nestedToken = await collectionRFT.mintToken(charlie, 5n, targetToken.nestingAddress()); + expect(await nestedToken.getBalance(targetToken.nestingAddress())).to.be.equal(5n); - // Nest a new token - const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible'); - await transferExpectSuccess(collectionRFT, newToken, alice, targetAddress, 100, 'ReFungible'); - }); + // Create a token to be nested and nest + const newToken = await collectionRFT.mintToken(charlie, 5n); + await newToken.transfer(charlie, targetToken.nestingAddress(), 2n); + expect(await newToken.getBalance(targetToken.nestingAddress())).to.be.equal(2n); }); - it('ReFungible: allows an Owner to nest/unnest their token (Restricted nesting)', async function() { - await requirePallets(this, [Pallets.ReFungible]); + itSub.ifWithPallets('ReFungible: allows an Owner to nest/unnest their token (Restricted nesting)', [Pallets.ReFungible], async ({helper}) => { + const collectionNFT = await helper.nft.mintCollection(alice); + const collectionRFT = await helper.rft.mintCollection(alice); + const targetToken = await collectionNFT.mintToken(alice, {Substrate: charlie.address}); - await usingApi(async api => { - const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address}); - const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)}; + await collectionNFT.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true, restricted:[collectionRFT.collectionId]}}); + await collectionNFT.addToAllowList(alice, {Substrate: charlie.address}); + await collectionNFT.addToAllowList(alice, targetToken.nestingAddress()); - const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); + await collectionRFT.setPermissions(alice, {access: 'AllowList', mintMode: true}); + await collectionRFT.addToAllowList(alice, {Substrate: charlie.address}); + await collectionRFT.addToAllowList(alice, targetToken.nestingAddress()); - await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[collectionRFT]}}); + // Create an immediately nested token + const nestedToken = await collectionRFT.mintToken(charlie, 5n, targetToken.nestingAddress()); + expect(await nestedToken.getBalance(targetToken.nestingAddress())).to.be.equal(5n); - // Create a nested token - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collectionRFT, - targetAddress, - {ReFungible: {pieces: 100}}, - ))).to.not.be.rejected; - - // Nest a new token - const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible'); - await transferExpectSuccess(collectionRFT, newToken, alice, targetAddress, 100, 'ReFungible'); - }); + // Create a token to be nested and nest + const newToken = await collectionRFT.mintToken(charlie, 5n); + await newToken.transfer(charlie, targetToken.nestingAddress(), 2n); + expect(await newToken.getBalance(targetToken.nestingAddress())).to.be.equal(2n); }); }); -describe('Negative Test: Nesting', async() => { +describe('Negative Test: Nesting', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { - await usingApi(async (_, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([100n, 50n], donor); }); }); - it('Disallows excessive token nesting', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); - const targetToken = await createItemExpectSuccess(alice, collection, 'NFT'); - - const maxNestingLevel = 5; - let prevToken = targetToken; - - // Create a nested-token matryoshka - for (let i = 0; i < maxNestingLevel; i++) { - const nestedToken = await createItemExpectSuccess( - alice, - collection, - 'NFT', - {Ethereum: tokenIdToAddress(collection, prevToken)}, - ); + itSub('Disallows excessive token nesting', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + let token = await collection.mintToken(alice); - prevToken = nestedToken; - } + const maxNestingLevel = 5; - // The nesting depth is limited by `maxNestingLevel` - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collection, - {Ethereum: tokenIdToAddress(collection, prevToken)}, - {nft: {}} as any, - )), 'while creating nested token').to.be.rejectedWith(/^structure\.DepthLimit$/); + // Create a nested-token matryoshka + for (let i = 0; i < maxNestingLevel; i++) { + token = await collection.mintToken(alice, token.nestingAddress()); + } - expect(await getTopmostTokenOwner(api, collection, prevToken)).to.be.deep.equal({Substrate: alice.address}); - }); + // The nesting depth is limited by `maxNestingLevel` + await expect(collection.mintToken(alice, token.nestingAddress())) + .to.be.rejectedWith(/structure\.DepthLimit/); + expect(await token.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address}); + expect(await token.getChildren()).to.be.length(0); }); // ---------- Admin ------------ - it('Admin (NFT): disallows an Admin to operate nesting when only TokenOwner is allowed', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - const targetToken = await createItemExpectSuccess(alice, collection, 'NFT'); - - // Try to create a nested token as collection admin when it's disallowed - await expect(executeTransaction(api, bob, api.tx.unique.createItem( - collection, - {Ethereum: tokenIdToAddress(collection, targetToken)}, - {nft: {}} as any, - )), 'while creating nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); - - // Try to create and nest a token in the wrong collection - const newToken = await createItemExpectSuccess(bob, collection, 'NFT'); - await expect(executeTransaction( - api, - bob, - api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1), - ), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); - expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: bob.address}); - }); - }); + itSub('Admin (NFT): disallows an Admin to operate nesting when only TokenOwner is allowed', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + await collection.addAdmin(alice, {Substrate: bob.address}); + const targetToken = await collection.mintToken(alice); - it('Admin (NFT): disallows a Token Owner to operate nesting when only Admin is allowed', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {collectionAdmin: true}}); - await addToAllowListExpectSuccess(alice, collection, bob.address); - await enableAllowListExpectSuccess(alice, collection); - await enablePublicMintingExpectSuccess(alice, collection); - const targetToken = await createItemExpectSuccess(alice, collection, 'NFT'); - - // Try to create a nested token as collection admin when it's disallowed - await expect(executeTransaction(api, bob, api.tx.unique.createItem( - collection, - {Ethereum: tokenIdToAddress(collection, targetToken)}, - {nft: {}} as any, - )), 'while creating nested token').to.be.rejectedWith(/common\.AddressNotInAllowlist/); - - // Try to create and nest a token in the wrong collection - const newToken = await createItemExpectSuccess(bob, collection, 'NFT'); - await expect(executeTransaction( - api, - bob, - api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1), - ), 'while nesting new token').to.be.rejectedWith(/common\.AddressNotInAllowlist/); - expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: bob.address}); - }); - }); + // Try to create an immediately nested token as collection admin when it's disallowed + await expect(collection.mintToken(bob, targetToken.nestingAddress())) + .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); - it('Admin (NFT): disallows an Admin to nest and unnest someone else\'s token', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionLimitsExpectSuccess(alice, collection, {ownerCanTransfer: true}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {collectionAdmin: true}}); - - await addToAllowListExpectSuccess(alice, collection, bob.address); - await enableAllowListExpectSuccess(alice, collection); - await enablePublicMintingExpectSuccess(alice, collection); - - // Create a token to attempt to be nested into - const targetToken = await createItemExpectSuccess(bob, collection, 'NFT'); - const targetAddress = {Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()}; - - // Try to nest somebody else's token - const newToken = await createItemExpectSuccess(bob, collection, 'NFT'); - await expect(executeTransaction( - api, - alice, - api.tx.unique.transferFrom(targetAddress, {Substrate: bob.address}, collection, newToken, 1), - ), 'while nesting another\'s token token').to.be.rejectedWith(/common\.AddressNotInAllowlist/); - expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: bob.address}); - - // Nest a token as admin and try to unnest it, now belonging to someone else - const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', targetAddress); - await expect(executeTransaction( - api, - alice, - api.tx.unique.transferFrom(targetAddress, normalizeAccountId(alice), collection, nestedToken, 1), - ), 'while unnesting another\'s token').to.be.rejectedWith(/common\.AddressNotInAllowlist/); - expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal(targetAddress); - expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: bob.address}); - }); + // Try to create a token to be nested and nest + const newToken = await collection.mintToken(bob); + await expect(newToken.nest(bob, targetToken)) + .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); + + expect(await targetToken.getChildren()).to.be.length(0); + expect(await newToken.getOwner()).to.be.deep.equal({Substrate: bob.address}); }); - it('Admin (NFT): disallows an Admin to nest a token from an unlisted collection (Restricted nesting)', async () => { - await usingApi(async api => { - const collectionA = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - const collectionB = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collectionA, {nesting: {collectionAdmin: true, restricted:[collectionA]}}); + itSub('Admin (NFT): disallows a Token Owner to operate nesting when only Admin is allowed', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {permissions: {access: 'AllowList', mintMode: true, nesting: {collectionAdmin: true}}}); + const targetToken = await collection.mintToken(alice, {Substrate: bob.address}); + await collection.addToAllowList(alice, {Substrate: bob.address}); + await collection.addToAllowList(alice, targetToken.nestingAddress()); - // Create a token to attempt to be nested into - const targetToken = await createItemExpectSuccess(alice, collectionA, 'NFT'); + // Try to create a nested token as token owner when it's disallowed + await expect(collection.mintToken(bob, targetToken.nestingAddress())) + .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); - // Try to create and nest a token in the wrong collection - const newToken = await createItemExpectSuccess(alice, collectionB, 'NFT'); - await expect(executeTransaction( - api, - alice, - api.tx.unique.transfer({Ethereum: tokenIdToAddress(collectionA, targetToken)}, collectionB, newToken, 1), - ), 'while nesting a foreign token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); - expect(await getTokenOwner(api, collectionB, newToken)).to.be.deep.equal({Substrate: alice.address}); - }); + // Try to create a token to be nested and nest + const newToken = await collection.mintToken(bob); + await expect(newToken.nest(bob, targetToken)) + .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); + + expect(await targetToken.getChildren()).to.be.length(0); + expect(await newToken.getOwner()).to.be.deep.equal({Substrate: bob.address}); }); - // ---------- Non-Fungible ---------- + itSub('Admin (NFT): disallows an Admin to unnest someone else\'s token', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {limits: {ownerCanTransfer: true}, permissions: {access: 'AllowList', mintMode: true, nesting: {collectionAdmin: true}}}); + //await collection.addAdmin(alice, {Substrate: bob.address}); + const targetToken = await collection.mintToken(alice, {Substrate: bob.address}); + await collection.addToAllowList(alice, {Substrate: bob.address}); + await collection.addToAllowList(alice, targetToken.nestingAddress()); - it('NFT: disallows to nest token if nesting is disabled', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {}}); - const targetToken = await createItemExpectSuccess(alice, collection, 'NFT'); - - // Try to create a nested token - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collection, - {Ethereum: tokenIdToAddress(collection, targetToken)}, - {nft: {}} as any, - )), 'while creating nested token').to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/); - - // Create a token to be nested - const newToken = await createItemExpectSuccess(alice, collection, 'NFT'); - // Try to nest - await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); - expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address}); - expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address}); - }); - }); + // Try to nest somebody else's token + const newToken = await collection.mintToken(bob); + await expect(newToken.nest(alice, targetToken)) + .to.be.rejectedWith(/common\.NoPermission/); - it('NFT: disallows a non-Owner to nest someone else\'s token', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); + // Try to unnest a token belonging to someone else as collection admin + const nestedToken = await collection.mintToken(alice, targetToken.nestingAddress()); + await expect(nestedToken.unnest(alice, targetToken, {Substrate: bob.address})) + .to.be.rejectedWith(/common\.AddressNotInAllowlist/); - await addToAllowListExpectSuccess(alice, collection, bob.address); - await enableAllowListExpectSuccess(alice, collection); - await enablePublicMintingExpectSuccess(alice, collection); + expect(await targetToken.getChildren()).to.be.length(1); + expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address}); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + }); - // Create a token to attempt to be nested into - const targetToken = await createItemExpectSuccess(bob, collection, 'NFT'); + itSub('Admin (NFT): disallows an Admin to nest a token from an unlisted collection (Restricted nesting)', async ({helper}) => { + const collectionA = await helper.nft.mintCollection(alice); + const collectionB = await helper.nft.mintCollection(alice); + await collectionA.setPermissions(alice, {nesting: {collectionAdmin: true, restricted: [collectionA.collectionId]}}); + const targetToken = await collectionA.mintToken(alice); - // Try to create a nested token in the wrong collection - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collection, - {Ethereum: tokenIdToAddress(collection, targetToken)}, - {nft: {}} as any, - )), 'while creating nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); + // Try to create a nested token from another collection + await expect(collectionB.mintToken(alice, targetToken.nestingAddress())) + .to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); - // Try to create and nest a token in the wrong collection - const newToken = await createItemExpectSuccess(alice, collection, 'NFT'); - await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.AddressNotInAllowlist/); - expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address}); - }); + // Create a token in another collection yet to be nested and try to nest + const newToken = await collectionB.mintToken(alice); + await expect(newToken.nest(alice, targetToken)) + .to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); + + expect(await targetToken.getChildren()).to.be.length(0); + expect(await newToken.getOwner()).to.be.deep.equal({Substrate: alice.address}); }); - it('NFT: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true, restricted:[collection]}}); + // ---------- Non-Fungible ---------- - await addToAllowListExpectSuccess(alice, collection, bob.address); - await enableAllowListExpectSuccess(alice, collection); - await enablePublicMintingExpectSuccess(alice, collection); + itSub('NFT: disallows to nest token if nesting is disabled', async ({helper}) => { + // Collection is implicitly not allowed nesting at creation + const collection = await helper.nft.mintCollection(alice); + const targetToken = await collection.mintToken(alice); - // Create a token to attempt to be nested into - const targetToken = await createItemExpectSuccess(bob, collection, 'NFT'); + // Try to create a nested token as token owner when it's disallowed + await expect(collection.mintToken(alice, targetToken.nestingAddress())) + .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); - // Try to create a nested token in the wrong collection - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collection, - {Ethereum: tokenIdToAddress(collection, targetToken)}, - {nft: {}} as any, - )), 'while creating nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); + // Try to create a token to be nested and nest + const newToken = await collection.mintToken(alice); + await expect(newToken.nest(alice, targetToken)) + .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); - // Try to create and nest a token in the wrong collection - const newToken = await createItemExpectSuccess(alice, collection, 'NFT'); - await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.AddressNotInAllowlist/); - expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address}); - }); + expect(await targetToken.getChildren()).to.be.length(0); + expect(await newToken.getOwner()).to.be.deep.equal({Substrate: alice.address}); }); - it('NFT: disallows to nest token in an unlisted collection', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true, restricted:[]}}); + itSub('NFT: disallows a non-Owner to nest someone else\'s token', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const targetToken = await collection.mintToken(alice); - // Create a token to attempt to be nested into - const targetToken = await createItemExpectSuccess(alice, collection, 'NFT'); + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true}}); + await collection.addToAllowList(alice, {Substrate: bob.address}); + await collection.addToAllowList(alice, targetToken.nestingAddress()); - // Try to create a nested token in the wrong collection - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collection, - {Ethereum: tokenIdToAddress(collection, targetToken)}, - {nft: {}} as any, - )), 'while creating nested token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); + // Try to create a token to be nested and nest + const newToken = await collection.mintToken(alice); + await expect(newToken.nest(bob, targetToken)).to.be.rejectedWith(/common\.NoPermission/); - // Try to create and nest a token in the wrong collection - const newToken = await createItemExpectSuccess(alice, collection, 'NFT'); - await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); - expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address}); - }); + expect(await targetToken.getChildren()).to.be.length(0); + expect(await newToken.getOwner()).to.be.deep.equal({Substrate: alice.address}); }); - // ---------- Fungible ---------- + itSub('NFT: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const targetToken = await collection.mintToken(alice); - it('Fungible: disallows to nest token if nesting is disabled', async () => { - await usingApi(async api => { - const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {}}); - const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT'); - const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)}; - - const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - - // Try to create a nested token - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collectionFT, - targetAddress, - {Fungible: {Value: 10}}, - )), 'while creating nested token').to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/); - - // Create a token to be nested - const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible'); - // Try to nest - await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); - - // Create another token to be nested - const newToken2 = await createItemExpectSuccess(alice, collectionFT, 'Fungible'); - // Try to nest inside a fungible token - await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collectionFT, newToken)}, collectionFT, newToken2, 1)), 'while nesting new token inside fungible').to.be.rejectedWith(/fungible\.FungibleDisallowsNesting/); - }); - }); + await collection.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true}}); + await collection.addToAllowList(alice, {Substrate: bob.address}); + await collection.addToAllowList(alice, targetToken.nestingAddress()); - it('Fungible: disallows a non-Owner to nest someone else\'s token', async () => { - await usingApi(async api => { - const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}}); + const collectionB = await helper.nft.mintCollection(alice, {permissions: {access: 'AllowList', mintMode: true}}); + await collectionB.addToAllowList(alice, {Substrate: bob.address}); + await collectionB.addToAllowList(alice, targetToken.nestingAddress()); - await addToAllowListExpectSuccess(alice, collectionNFT, bob.address); - await enableAllowListExpectSuccess(alice, collectionNFT); - await enablePublicMintingExpectSuccess(alice, collectionNFT); + // Try to create a token to be nested and nest + const newToken = await collectionB.mintToken(alice); + await expect(newToken.nest(bob, targetToken)).to.be.rejectedWith(/common\.NoPermission/); - // Create a token to attempt to be nested into - const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT'); - const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)}; + expect(await targetToken.getChildren()).to.be.length(0); + expect(await newToken.getOwner()).to.be.deep.equal({Substrate: alice.address}); + }); - const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); + itSub('NFT: disallows to nest token in an unlisted collection', async ({helper}) => { + // Create collection with restricted nesting -- even self is not allowed + const collection = await helper.nft.mintCollection(alice, {permissions: {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true, restricted: []}}}); + const targetToken = await collection.mintToken(alice, {Substrate: bob.address}); - // Try to create a nested token in the wrong collection - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collectionFT, - targetAddress, - {Fungible: {Value: 10}}, - )), 'while creating nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); + await collection.addToAllowList(alice, {Substrate: bob.address}); + await collection.addToAllowList(alice, targetToken.nestingAddress()); - // Try to create and nest a token in the wrong collection - const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible'); - await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); - }); + // Try to mint in own collection after allowlisting the accounts + await expect(collection.mintToken(bob, targetToken.nestingAddress())) + .to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); }); - it('Fungible: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async () => { - await usingApi(async api => { - const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await addToAllowListExpectSuccess(alice, collectionNFT, bob.address); - await enableAllowListExpectSuccess(alice, collectionNFT); - await enablePublicMintingExpectSuccess(alice, collectionNFT); - - // Create a token to attempt to be nested into - const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT'); - const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)}; + // ---------- Fungible ---------- - const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[collectionFT]}}); + itSub('Fungible: disallows to nest token if nesting is disabled', async ({helper}) => { + const collectionNFT = await helper.nft.mintCollection(alice); + const collectionFT = await helper.ft.mintCollection(alice); + const targetToken = await collectionNFT.mintToken(alice); - // Try to create a nested token in the wrong collection - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collectionFT, - targetAddress, - {Fungible: {Value: 10}}, - )), 'while creating nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); + // Try to create an immediately nested token + await expect(collectionFT.mint(alice, 5n, targetToken.nestingAddress())) + .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); - // Try to create and nest a token in the wrong collection - const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible'); - await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); - }); + // Try to create a token to be nested and nest + await collectionFT.mint(alice, 5n); + await expect(collectionFT.transfer(alice, targetToken.nestingAddress(), 2n)) + .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); + expect(await collectionFT.getBalance({Substrate: alice.address})).to.be.equal(5n); }); - it('Fungible: disallows to nest token in an unlisted collection', async () => { - await usingApi(async api => { - const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[]}}); + itSub('Fungible: disallows a non-Owner to unnest someone else\'s token', async ({helper}) => { + const collectionNFT = await helper.nft.mintCollection(alice, {permissions: {nesting: {collectionAdmin: true, tokenOwner: true}}}); + const collectionFT = await helper.ft.mintCollection(alice); + const targetToken = await collectionNFT.mintToken(alice, {Substrate: bob.address}); - // Create a token to attempt to be nested into - const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT'); - const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)}; + // Nest some tokens as Alice into Bob's token + await collectionFT.mint(alice, 5n, targetToken.nestingAddress()); - const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); + // Try to pull it out + await expect(collectionFT.transferFrom(alice, targetToken.nestingAddress(), {Substrate: bob.address}, 1n)) + .to.be.rejectedWith(/common\.ApprovedValueTooLow/); + expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(5n); + }); - // Try to create a nested token in the wrong collection - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collectionFT, - targetAddress, - {Fungible: {Value: 10}}, - )), 'while creating a nested token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); + itSub('Fungible: disallows a non-Owner to unnest someone else\'s token (Restricted nesting)', async ({helper}) => { + const collectionNFT = await helper.nft.mintCollection(alice); + const collectionFT = await helper.ft.mintCollection(alice); + const targetToken = await collectionNFT.mintToken(alice, {Substrate: bob.address}); - // Try to create and nest a token in the wrong collection - const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible'); - await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); - }); - }); + await collectionNFT.setPermissions(alice, {nesting: {collectionAdmin: true, tokenOwner: true, restricted: [collectionFT.collectionId]}}); - // ---------- Re-Fungible ---------- + // Nest some tokens as Alice into Bob's token + await collectionFT.mint(alice, 5n, targetToken.nestingAddress()); - it('ReFungible: disallows to nest token if nesting is disabled', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await usingApi(async api => { - const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {}}); - const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT'); - const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)}; - - const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - - // Create a nested token - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collectionRFT, - targetAddress, - {ReFungible: {pieces: 100}}, - )), 'while creating a nested token').to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/); - - // Create a token to be nested - const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible'); - // Try to nest - await transferExpectFailure(collectionRFT, newToken, alice, targetAddress, 100); - // Try to nest - await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); - - // Create another token to be nested - const newToken2 = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible'); - // Try to nest inside a fungible token - await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collectionRFT, newToken)}, collectionRFT, newToken2, 1)), 'while nesting new token inside refungible').to.be.rejectedWith(/refungible\.RefungibleDisallowsNesting/); - }); + // Try to pull it out as Alice still + await expect(collectionFT.transferFrom(alice, targetToken.nestingAddress(), {Substrate: bob.address}, 1n)) + .to.be.rejectedWith(/common\.ApprovedValueTooLow/); + expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(5n); }); - it('ReFungible: disallows a non-Owner to nest someone else\'s token', async function() { - await requirePallets(this, [Pallets.ReFungible]); + itSub('Fungible: disallows to nest token in an unlisted collection', async ({helper}) => { + const collectionNFT = await helper.nft.mintCollection(alice, {permissions: {nesting: {collectionAdmin: true, tokenOwner: true, restricted: []}}}); + const collectionFT = await helper.ft.mintCollection(alice); + const targetToken = await collectionNFT.mintToken(alice); - await usingApi(async api => { - const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}}); + // Try to mint an immediately nested token + await expect(collectionFT.mint(alice, 5n, targetToken.nestingAddress())) + .to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); - await addToAllowListExpectSuccess(alice, collectionNFT, bob.address); - await enableAllowListExpectSuccess(alice, collectionNFT); - await enablePublicMintingExpectSuccess(alice, collectionNFT); + // Mint a token and try to nest it + await collectionFT.mint(alice, 5n); + await expect(collectionFT.transfer(alice, targetToken.nestingAddress(), 1n)) + .to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); - // Create a token to attempt to be nested into - const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT'); - const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)}; + expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(0n); + expect(await collectionFT.getBalance({Substrate: alice.address})).to.be.equal(5n); + }); - const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); + // ---------- Re-Fungible ---------- - // Try to create a nested token in the wrong collection - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collectionRFT, - targetAddress, - {ReFungible: {pieces: 100}}, - )), 'while creating a nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); + itSub.ifWithPallets('ReFungible: disallows to nest token if nesting is disabled', [Pallets.ReFungible], async ({helper}) => { + const collectionNFT = await helper.nft.mintCollection(alice); + const collectionRFT = await helper.rft.mintCollection(alice); + const targetToken = await collectionNFT.mintToken(alice); - // Try to create and nest a token in the wrong collection - const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible'); - await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); - }); + // Try to create an immediately nested token + await expect(collectionRFT.mintToken(alice, 5n, targetToken.nestingAddress())) + .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); + + // Try to create a token to be nested and nest + const token = await collectionRFT.mintToken(alice, 5n); + await expect(token.transfer(alice, targetToken.nestingAddress(), 2n)) + .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(5n); }); - it('ReFungible: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async function() { - await requirePallets(this, [Pallets.ReFungible]); + itSub.ifWithPallets('ReFungible: disallows a non-Owner to nest someone else\'s token', [Pallets.ReFungible], async ({helper}) => { + const collectionNFT = await helper.nft.mintCollection(alice); + const collectionRFT = await helper.rft.mintCollection(alice); + const targetToken = await collectionNFT.mintToken(alice); - await usingApi(async api => { - const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await addToAllowListExpectSuccess(alice, collectionNFT, bob.address); - await enableAllowListExpectSuccess(alice, collectionNFT); - await enablePublicMintingExpectSuccess(alice, collectionNFT); + await collectionNFT.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true}}); + await collectionNFT.addToAllowList(alice, {Substrate: bob.address}); + await collectionNFT.addToAllowList(alice, targetToken.nestingAddress()); - // Create a token to attempt to be nested into - const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT'); - const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)}; + // Try to create a token to be nested and nest + const newToken = await collectionRFT.mintToken(alice); + await expect(newToken.transfer(bob, targetToken.nestingAddress())).to.be.rejectedWith(/common\.TokenValueTooLow/); - const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[collectionRFT]}}); + expect(await targetToken.getChildren()).to.be.length(0); + expect(await newToken.getBalance({Substrate: alice.address})).to.be.equal(1n); - // Try to create a nested token in the wrong collection - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collectionRFT, - targetAddress, - {ReFungible: {pieces: 100}}, - )), 'while creating a nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); + // Nest some tokens as Alice into Bob's token + await newToken.transfer(alice, targetToken.nestingAddress()); - // Try to create and nest a token in the wrong collection - const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible'); - await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); - }); + // Try to pull it out + await expect(newToken.transferFrom(bob, targetToken.nestingAddress(), {Substrate: alice.address}, 1n)) + .to.be.rejectedWith(/common\.ApprovedValueTooLow/); + expect(await newToken.getBalance(targetToken.nestingAddress())).to.be.equal(1n); }); - it('ReFungible: disallows to nest token to an unlisted collection', async function() { - await requirePallets(this, [Pallets.ReFungible]); + itSub.ifWithPallets('ReFungible: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', [Pallets.ReFungible], async ({helper}) => { + const collectionNFT = await helper.nft.mintCollection(alice); + const collectionRFT = await helper.rft.mintCollection(alice); + const targetToken = await collectionNFT.mintToken(alice); - await usingApi(async api => { - const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[]}}); + await collectionNFT.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true, restricted: [collectionRFT.collectionId]}}); + await collectionNFT.addToAllowList(alice, {Substrate: bob.address}); + await collectionNFT.addToAllowList(alice, targetToken.nestingAddress()); - // Create a token to attempt to be nested into - const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT'); - const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)}; + // Try to create a token to be nested and nest + const newToken = await collectionRFT.mintToken(alice); + await expect(newToken.transfer(bob, targetToken.nestingAddress())).to.be.rejectedWith(/common\.TokenValueTooLow/); - const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); + expect(await targetToken.getChildren()).to.be.length(0); + expect(await newToken.getBalance({Substrate: alice.address})).to.be.equal(1n); - // Try to create a nested token in the wrong collection - await expect(executeTransaction(api, alice, api.tx.unique.createItem( - collectionRFT, - targetAddress, - {ReFungible: {pieces: 100}}, - )), 'while creating a nested token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); + // Nest some tokens as Alice into Bob's token + await newToken.transfer(alice, targetToken.nestingAddress()); - // Try to create and nest a token in the wrong collection - const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible'); - await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); - }); + // Try to pull it out + await expect(newToken.transferFrom(bob, targetToken.nestingAddress(), {Substrate: alice.address}, 1n)) + .to.be.rejectedWith(/common\.ApprovedValueTooLow/); + expect(await newToken.getBalance(targetToken.nestingAddress())).to.be.equal(1n); + }); + + itSub.ifWithPallets('ReFungible: disallows to nest token to an unlisted collection', [Pallets.ReFungible], async ({helper}) => { + const collectionNFT = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true, restricted: []}}}); + const collectionRFT = await helper.rft.mintCollection(alice); + const targetToken = await collectionNFT.mintToken(alice); + + // Try to create an immediately nested token + await expect(collectionRFT.mintToken(alice, 5n, targetToken.nestingAddress())) + .to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); + + // Try to create a token to be nested and nest + const token = await collectionRFT.mintToken(alice, 5n); + await expect(token.transfer(alice, targetToken.nestingAddress(), 2n)) + .to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(5n); }); }); diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index 39979f44b3..7ccfaa505d 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -1,5 +1,20 @@ -import {expect} from 'chai'; -import usingApi, {executeTransaction} from '../substrate/substrate-api'; +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +/*import usingApi, {executeTransaction} from '../substrate/substrate-api'; import { addCollectionAdminExpectSuccess, CollectionMode, @@ -8,997 +23,776 @@ import { createItemExpectSuccess, getCreateCollectionResult, transferExpectSuccess, - requirePallets, - Pallets, -} from '../util/helpers'; +} from '../util/helpers';*/ import {IKeyringPair} from '@polkadot/types/types'; -import {tokenIdToAddress} from '../eth/util/helpers'; +import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../util/playgrounds'; +import {UniqueCollectionBase, UniqueHelper, UniqueNFTCollection, UniqueNFTToken, UniqueRFTCollection, UniqueRFTToken} from '../util/playgrounds/unique'; -let alice: IKeyringPair; -let bob: IKeyringPair; -let charlie: IKeyringPair; +// ---------- COLLECTION PROPERTIES + +describe('Integration Test: Collection Properties', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; -describe('Composite Properties Test', () => { before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); }); }); - async function testMakeSureSuppliesRequired(mode: CollectionMode) { - await usingApi(async api => { - const collectionId = await createCollectionExpectSuccess({mode: mode}); + itSub('Properties are initially empty', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + expect(await collection.getProperties()).to.be.empty; + }); - const collectionOption = await api.rpc.unique.collectionById(collectionId); - expect(collectionOption.isSome).to.be.true; - let collection = collectionOption.unwrap(); - expect(collection.tokenPropertyPermissions.toHuman()).to.be.empty; - expect(collection.properties.toHuman()).to.be.empty; + async function testSetsPropertiesForCollection(collection: UniqueCollectionBase) { + // As owner + await expect(collection.setProperties(alice, [{key: 'electron', value: 'come bond'}])).to.be.fulfilled; - const propertyPermissions = [ - {key: 'mindgame', permission: {collectionAdmin: true, mutable: false, tokenOwner: true}}, - {key: 'skullduggery', permission: {collectionAdmin: false, mutable: true, tokenOwner: false}}, - ]; - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collectionId, propertyPermissions), - )).to.not.be.rejected; - - const collectionProperties = [ - {key: 'black_hole', value: 'LIGO'}, - {key: 'electron', value: 'come bond'}, - ]; - await expect(executeTransaction( - api, - alice, - api.tx.unique.setCollectionProperties(collectionId, collectionProperties), - )).to.not.be.rejected; - - collection = (await api.rpc.unique.collectionById(collectionId)).unwrap(); - expect(collection.tokenPropertyPermissions.toHuman()).to.be.deep.equal(propertyPermissions); - expect(collection.properties.toHuman()).to.be.deep.equal(collectionProperties); - }); + await collection.addAdmin(alice, {Substrate: bob.address}); + + // As administrator + await expect(collection.setProperties(bob, [{key: 'black_hole'}])).to.be.fulfilled; + + const properties = await collection.getProperties(); + expect(properties).to.include.deep.members([ + {key: 'electron', value: 'come bond'}, + {key: 'black_hole', value: ''}, + ]); } - it('Makes sure collectionById supplies required fields for NFT', async () => { - await testMakeSureSuppliesRequired({type: 'NFT'}); + itSub('Sets properties for a NFT collection', async ({helper}) => { + await testSetsPropertiesForCollection(await helper.nft.mintCollection(alice)); }); - it('Makes sure collectionById supplies required fields for ReFungible', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await testMakeSureSuppliesRequired({type: 'ReFungible'}); + itSub.ifWithPallets('Sets properties for a ReFungible collection', [Pallets.ReFungible], async ({helper}) => { + await testSetsPropertiesForCollection(await helper.rft.mintCollection(alice)); }); -}); -// ---------- COLLECTION PROPERTIES + async function testCheckValidNames(collection: UniqueCollectionBase) { + // alpha symbols + await expect(collection.setProperties(alice, [{key: 'answer'}])).to.be.fulfilled; -describe('Integration Test: Collection Properties', () => { - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - }); - }); + // numeric symbols + await expect(collection.setProperties(alice, [{key: '451'}])).to.be.fulfilled; - it('Reads properties from a collection', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess(); - const properties = (await api.query.common.collectionProperties(collection)).toJSON(); - expect(properties.map).to.be.empty; - expect(properties.consumedSpace).to.equal(0); - }); - }); + // underscore symbol + await expect(collection.setProperties(alice, [{key: 'black_hole'}])).to.be.fulfilled; + // dash symbol + await expect(collection.setProperties(alice, [{key: '-'}])).to.be.fulfilled; - async function testSetsPropertiesForCollection(mode: string) { - await usingApi(async api => { - const events = await executeTransaction(api, bob, api.tx.unique.createCollectionEx({mode: mode})); - const {collectionId} = getCreateCollectionResult(events); - - // As owner - await expect(executeTransaction( - api, - bob, - api.tx.unique.setCollectionProperties(collectionId, [{key: 'electron', value: 'come bond'}]), - )).to.not.be.rejected; - - await addCollectionAdminExpectSuccess(bob, collectionId, alice.address); - - // As administrator - await expect(executeTransaction( - api, - alice, - api.tx.unique.setCollectionProperties(collectionId, [{key: 'black_hole'}]), - )).to.not.be.rejected; - - const properties = (await api.rpc.unique.collectionProperties(collectionId, ['electron', 'black_hole'])).toHuman(); - expect(properties).to.be.deep.equal([ - {key: 'electron', value: 'come bond'}, - {key: 'black_hole', value: ''}, - ]); - }); + // dot symbol + await expect(collection.setProperties(alice, [{key: 'once.in.a.long.long.while...', value: 'you get a little lost'}])).to.be.fulfilled; + + const properties = await collection.getProperties(); + expect(properties).to.include.deep.members([ + {key: 'answer', value: ''}, + {key: '451', value: ''}, + {key: 'black_hole', value: ''}, + {key: '-', value: ''}, + {key: 'once.in.a.long.long.while...', value: 'you get a little lost'}, + ]); } - it('Sets properties for a NFT collection', async () => { - await testSetsPropertiesForCollection('NFT'); - }); - it('Sets properties for a ReFungible collection', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testSetsPropertiesForCollection('ReFungible'); + itSub('Check valid names for NFT collection properties keys', async ({helper}) => { + await testCheckValidNames(await helper.nft.mintCollection(alice)); }); - async function testCheckValidNames(mode: string) { - await usingApi(async api => { - const events = await executeTransaction(api, bob, api.tx.unique.createCollectionEx({mode: mode})); - const {collectionId} = getCreateCollectionResult(events); - - // alpha symbols - await expect(executeTransaction( - api, - bob, - api.tx.unique.setCollectionProperties(collectionId, [{key: 'alpha'}]), - )).to.not.be.rejected; - - // numeric symbols - await expect(executeTransaction( - api, - bob, - api.tx.unique.setCollectionProperties(collectionId, [{key: '123'}]), - )).to.not.be.rejected; - - // underscore symbol - await expect(executeTransaction( - api, - bob, - api.tx.unique.setCollectionProperties(collectionId, [{key: 'black_hole'}]), - )).to.not.be.rejected; - - // dash symbol - await expect(executeTransaction( - api, - bob, - api.tx.unique.setCollectionProperties(collectionId, [{key: 'semi-automatic'}]), - )).to.not.be.rejected; - - // underscore symbol - await expect(executeTransaction( - api, - bob, - api.tx.unique.setCollectionProperties(collectionId, [{key: 'build.rs'}]), - )).to.not.be.rejected; - - const propertyKeys = ['alpha', '123', 'black_hole', 'semi-automatic', 'build.rs']; - const properties = (await api.rpc.unique.collectionProperties(collectionId, propertyKeys)).toHuman(); - expect(properties).to.be.deep.equal([ - {key: 'alpha', value: ''}, - {key: '123', value: ''}, - {key: 'black_hole', value: ''}, - {key: 'semi-automatic', value: ''}, - {key: 'build.rs', value: ''}, - ]); - }); - } - it('Check valid names for NFT collection properties keys', async () => { - await testCheckValidNames('NFT'); + itSub.ifWithPallets('Check valid names for ReFungible collection properties keys', [Pallets.ReFungible], async ({helper}) => { + await testCheckValidNames(await helper.rft.mintCollection(alice)); }); - it('Check valid names for ReFungible collection properties keys', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testCheckValidNames('ReFungible'); - }); + async function testChangesProperties(collection: UniqueCollectionBase) { + await expect(collection.setProperties(alice, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: ''}])).to.be.fulfilled; - async function testChangesProperties(mode: CollectionMode) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setCollectionProperties(collection, [{key: 'electron', value: 'come bond'}, {key: 'black_hole'}]), - )).to.not.be.rejected; - - // Mutate the properties - await expect(executeTransaction( - api, - alice, - api.tx.unique.setCollectionProperties(collection, [{key: 'electron', value: 'bonded'}, {key: 'black_hole', value: 'LIGO'}]), - )).to.not.be.rejected; - - const properties = (await api.rpc.unique.collectionProperties(collection, ['electron', 'black_hole'])).toHuman(); - expect(properties).to.be.deep.equal([ - {key: 'electron', value: 'bonded'}, - {key: 'black_hole', value: 'LIGO'}, - ]); - }); + // Mutate the properties + await expect(collection.setProperties(alice, [{key: 'black_hole', value: 'LIGO'}])).to.be.fulfilled; + + const properties = await collection.getProperties(); + expect(properties).to.include.deep.members([ + {key: 'electron', value: 'come bond'}, + {key: 'black_hole', value: 'LIGO'}, + ]); } - it('Changes properties of a NFT collection', async () => { - await testChangesProperties({type: 'NFT'}); + + itSub('Changes properties of a NFT collection', async ({helper}) => { + await testChangesProperties(await helper.nft.mintCollection(alice)); }); - it('Changes properties of a ReFungible collection', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testChangesProperties({type: 'ReFungible'}); + itSub.ifWithPallets('Changes properties of a ReFungible collection', [Pallets.ReFungible], async ({helper}) => { + await testChangesProperties(await helper.rft.mintCollection(alice)); }); - async function testDeleteProperties(mode: CollectionMode) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setCollectionProperties(collection, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: 'LIGO'}]), - )).to.not.be.rejected; - - await expect(executeTransaction( - api, - alice, - api.tx.unique.deleteCollectionProperties(collection, ['electron']), - )).to.not.be.rejected; - - const properties = (await api.rpc.unique.collectionProperties(collection, ['electron', 'black_hole'])).toHuman(); - expect(properties).to.be.deep.equal([ - {key: 'black_hole', value: 'LIGO'}, - ]); - }); + async function testDeleteProperties(collection: UniqueCollectionBase) { + await expect(collection.setProperties(alice, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: 'LIGO'}])).to.be.fulfilled; + + await expect(collection.deleteProperties(alice, ['electron'])).to.be.fulfilled; + + const properties = await collection.getProperties(['black_hole', 'electron']); + expect(properties).to.be.deep.equal([ + {key: 'black_hole', value: 'LIGO'}, + ]); } - it('Deletes properties of a NFT collection', async () => { - await testDeleteProperties({type: 'NFT'}); + + itSub('Deletes properties of a NFT collection', async ({helper}) => { + await testDeleteProperties(await helper.nft.mintCollection(alice)); }); - it('Deletes properties of a ReFungible collection', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testDeleteProperties({type: 'ReFungible'}); + itSub.ifWithPallets('Deletes properties of a ReFungible collection', [Pallets.ReFungible], async ({helper}) => { + await testDeleteProperties(await helper.rft.mintCollection(alice)); }); }); describe('Negative Integration Test: Collection Properties', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor); }); }); - async function testFailsSetPropertiesIfNotOwnerOrAdmin(mode: CollectionMode) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - - await expect(executeTransaction( - api, - bob, - api.tx.unique.setCollectionProperties(collection, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: 'LIGO'}]), - )).to.be.rejectedWith(/common\.NoPermission/); - - const properties = (await api.query.common.collectionProperties(collection)).toJSON(); - expect(properties.map).to.be.empty; - expect(properties.consumedSpace).to.equal(0); - }); + async function testFailsSetPropertiesIfNotOwnerOrAdmin(collection: UniqueCollectionBase) { + await expect(collection.setProperties(bob, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: 'LIGO'}])) + .to.be.rejectedWith(/common\.NoPermission/); + + expect(await collection.getProperties()).to.be.empty; } - it('Fails to set properties in a NFT collection if not its onwer/administrator', async () => { - await testFailsSetPropertiesIfNotOwnerOrAdmin({type: 'NFT'}); + + itSub('Fails to set properties in a NFT collection if not its onwer/administrator', async ({helper}) => { + await testFailsSetPropertiesIfNotOwnerOrAdmin(await helper.nft.mintCollection(alice)); }); - it('Fails to set properties in a ReFungible collection if not its onwer/administrator', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testFailsSetPropertiesIfNotOwnerOrAdmin({type: 'ReFungible'}); + itSub.ifWithPallets('Fails to set properties in a ReFungible collection if not its onwer/administrator', [Pallets.ReFungible], async ({helper}) => { + await testFailsSetPropertiesIfNotOwnerOrAdmin(await helper.rft.mintCollection(alice)); }); - async function testFailsSetPropertiesThatExeedLimits(mode: CollectionMode) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - const spaceLimit = (await api.query.common.collectionProperties(collection)).toJSON().spaceLimit as number; - - // Mute the general tx parsing error, too many bytes to process - { - console.error = () => {}; - await expect(executeTransaction( - api, - alice, - api.tx.unique.setCollectionProperties(collection, [{key: 'electron', value: 'low high '.repeat(Math.ceil(spaceLimit! / 9))}]), - )).to.be.rejected; - } - - let properties = (await api.rpc.unique.collectionProperties(collection, ['electron'])).toJSON(); - expect(properties).to.be.empty; + async function testFailsSetPropertiesThatExeedLimits(collection: UniqueCollectionBase) { + const spaceLimit = (await (collection.helper!.api! as any).query.common.collectionProperties(collection.collectionId)).spaceLimit.toNumber(); - await expect(executeTransaction( - api, - alice, - api.tx.unique.setCollectionProperties(collection, [ - {key: 'electron', value: 'low high '.repeat(Math.ceil(spaceLimit! / 18))}, - {key: 'black_hole', value: '0'.repeat(Math.ceil(spaceLimit! / 2))}, - ]), - )).to.be.rejectedWith(/common\.NoSpaceForProperty/); - - properties = (await api.rpc.unique.collectionProperties(collection, ['electron', 'black hole'])).toJSON(); - expect(properties).to.be.empty; - }); + // Mute the general tx parsing error, too many bytes to process + { + console.error = () => {}; + await expect(collection.setProperties(alice, [ + {key: 'electron', value: 'low high '.repeat(Math.ceil(spaceLimit! / 9))}, + ])).to.be.rejected; + } + + expect(await collection.getProperties(['electron'])).to.be.empty; + + await expect(collection.setProperties(alice, [ + {key: 'electron', value: 'low high '.repeat(Math.ceil(spaceLimit! / 18))}, + {key: 'black_hole', value: '0'.repeat(Math.ceil(spaceLimit! / 2))}, + ])).to.be.rejectedWith(/common\.NoSpaceForProperty/); + + expect(await collection.getProperties(['electron', 'black_hole'])).to.be.empty; } - it('Fails to set properties that exceed the limits (NFT)', async () => { - await testFailsSetPropertiesThatExeedLimits({type: 'NFT'}); + + itSub('Fails to set properties that exceed the limits (NFT)', async ({helper}) => { + await testFailsSetPropertiesThatExeedLimits(await helper.nft.mintCollection(alice)); }); - it('Fails to set properties that exceed the limits (ReFungible)', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testFailsSetPropertiesThatExeedLimits({type: 'ReFungible'}); + itSub.ifWithPallets('Fails to set properties that exceed the limits (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + await testFailsSetPropertiesThatExeedLimits(await helper.rft.mintCollection(alice)); }); - async function testFailsSetMorePropertiesThanAllowed(mode: CollectionMode) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - - const propertiesToBeSet = []; - for (let i = 0; i < 65; i++) { - propertiesToBeSet.push({ - key: 'electron_' + i, - value: Math.random() > 0.5 ? 'high' : 'low', - }); - } - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setCollectionProperties(collection, propertiesToBeSet), - )).to.be.rejectedWith(/common\.PropertyLimitReached/); - - const properties = (await api.query.common.collectionProperties(collection)).toJSON(); - expect(properties.map).to.be.empty; - expect(properties.consumedSpace).to.equal(0); - }); + async function testFailsSetMorePropertiesThanAllowed(collection: UniqueCollectionBase) { + const propertiesToBeSet = []; + for (let i = 0; i < 65; i++) { + propertiesToBeSet.push({ + key: 'electron_' + i, + value: Math.random() > 0.5 ? 'high' : 'low', + }); + } + + await expect(collection.setProperties(alice, propertiesToBeSet)). + to.be.rejectedWith(/common\.PropertyLimitReached/); + + expect(await collection.getProperties()).to.be.empty; } - it('Fails to set more properties than it is allowed (NFT)', async () => { - await testFailsSetMorePropertiesThanAllowed({type: 'NFT'}); + + itSub('Fails to set more properties than it is allowed (NFT)', async ({helper}) => { + await testFailsSetMorePropertiesThanAllowed(await helper.nft.mintCollection(alice)); }); - it('Fails to set more properties than it is allowed (ReFungible)', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testFailsSetMorePropertiesThanAllowed({type: 'ReFungible'}); + itSub.ifWithPallets('Fails to set more properties than it is allowed (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + await testFailsSetMorePropertiesThanAllowed(await helper.rft.mintCollection(alice)); }); - async function testFailsSetPropertiesWithInvalidNames(mode: CollectionMode) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - - const invalidProperties = [ - [{key: 'electron', value: 'negative'}, {key: 'string theory', value: 'understandable'}], - [{key: 'Mr/Sandman', value: 'Bring me a gene'}], - [{key: 'déjà vu', value: 'hmm...'}], - ]; - - for (let i = 0; i < invalidProperties.length; i++) { - await expect(executeTransaction( - api, - alice, - api.tx.unique.setCollectionProperties(collection, invalidProperties[i]), - ), `on rejecting the new badly-named property #${i}`).to.be.rejectedWith(/common\.InvalidCharacterInPropertyKey/); - } - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setCollectionProperties(collection, [{key: '', value: 'nothing must not exist'}]), - ), 'on rejecting an unnamed property').to.be.rejectedWith(/common\.EmptyPropertyKey/); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setCollectionProperties(collection, [ - {key: 'CRISPR-Cas9', value: 'rewriting nature!'}, - ]), - ), 'on setting the correctly-but-still-badly-named property').to.not.be.rejected; - - const keys = invalidProperties.flatMap(propertySet => propertySet.map(property => property.key)).concat('CRISPR-Cas9').concat(''); - - const properties = (await api.rpc.unique.collectionProperties(collection, keys)).toHuman(); - expect(properties).to.be.deep.equal([ - {key: 'CRISPR-Cas9', value: 'rewriting nature!'}, - ]); - - for (let i = 0; i < invalidProperties.length; i++) { - await expect(executeTransaction( - api, - alice, - api.tx.unique.deleteCollectionProperties(collection, invalidProperties[i].map(propertySet => propertySet.key)), - ), `on trying to delete the non-existent badly-named property #${i}`).to.be.rejectedWith(/common\.InvalidCharacterInPropertyKey/); - } - }); + async function testFailsSetPropertiesWithInvalidNames(collection: UniqueCollectionBase) { + const invalidProperties = [ + [{key: 'electron', value: 'negative'}, {key: 'string theory', value: 'understandable'}], + [{key: 'Mr/Sandman', value: 'Bring me a gene'}], + [{key: 'déjà vu', value: 'hmm...'}], + ]; + + for (let i = 0; i < invalidProperties.length; i++) { + await expect( + collection.setProperties(alice, invalidProperties[i]), + `on rejecting the new badly-named property #${i}`, + ).to.be.rejectedWith(/common\.InvalidCharacterInPropertyKey/); + } + + await expect( + collection.setProperties(alice, [{key: '', value: 'nothing must not exist'}]), + 'on rejecting an unnamed property', + ).to.be.rejectedWith(/common\.EmptyPropertyKey/); + + await expect( + collection.setProperties(alice, [{key: 'CRISPR-Cas9', value: 'rewriting nature!'}]), + 'on setting the correctly-but-still-badly-named property', + ).to.be.fulfilled; + + const keys = invalidProperties.flatMap(propertySet => propertySet.map(property => property.key)).concat('CRISPR-Cas9').concat(''); + + const properties = await collection.getProperties(keys); + expect(properties).to.be.deep.equal([ + {key: 'CRISPR-Cas9', value: 'rewriting nature!'}, + ]); + + for (let i = 0; i < invalidProperties.length; i++) { + await expect( + collection.deleteProperties(alice, invalidProperties[i].map(propertySet => propertySet.key)), + `on trying to delete the non-existent badly-named property #${i}`, + ).to.be.rejectedWith(/common\.InvalidCharacterInPropertyKey/); + } } - it('Fails to set properties with invalid names (NFT)', async () => { - await testFailsSetPropertiesWithInvalidNames({type: 'NFT'}); + + itSub('Fails to set properties with invalid names (NFT)', async ({helper}) => { + await testFailsSetPropertiesWithInvalidNames(await helper.nft.mintCollection(alice)); }); - it('Fails to set properties with invalid names (ReFungible)', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testFailsSetPropertiesWithInvalidNames({type: 'ReFungible'}); + itSub.ifWithPallets('Fails to set properties with invalid names (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + await testFailsSetPropertiesWithInvalidNames(await helper.rft.mintCollection(alice)); }); }); // ---------- ACCESS RIGHTS describe('Integration Test: Access Rights to Token Properties', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor); }); }); - it('Reads access rights to properties of a collection', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess(); - const propertyRights = (await api.query.common.collectionPropertyPermissions(collection)).toJSON(); - expect(propertyRights).to.be.empty; - }); + itSub('Reads access rights to properties of a collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const propertyRights = (await helper.api!.query.common.collectionPropertyPermissions(collection.collectionId)).toJSON(); + expect(propertyRights).to.be.empty; }); - async function testSetsAccessRightsToProperties(mode: CollectionMode) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'skullduggery', permission: {mutable: true}}]), - )).to.not.be.rejected; - - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'mindgame', permission: {collectionAdmin: true, tokenOwner: false}}]), - )).to.not.be.rejected; - - const propertyRights = (await api.rpc.unique.propertyPermissions(collection, ['skullduggery', 'mindgame'])).toHuman(); - expect(propertyRights).to.be.deep.equal([ - {key: 'skullduggery', permission: {'mutable': true, 'collectionAdmin': false, 'tokenOwner': false}}, - {key: 'mindgame', permission: {'mutable': false, 'collectionAdmin': true, 'tokenOwner': false}}, - ]); - }); + async function testSetsAccessRightsToProperties(collection: UniqueNFTCollection | UniqueRFTCollection) { + await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: true}}])) + .to.be.fulfilled; + + await collection.addAdmin(alice, {Substrate: bob.address}); + + await expect(collection.setTokenPropertyPermissions(bob, [{key: 'mindgame', permission: {collectionAdmin: true, tokenOwner: false}}])) + .to.be.fulfilled; + + const propertyRights = await collection.getPropertyPermissions(['skullduggery', 'mindgame']); + expect(propertyRights).to.include.deep.members([ + {key: 'skullduggery', permission: {mutable: true, collectionAdmin: false, tokenOwner: false}}, + {key: 'mindgame', permission: {mutable: false, collectionAdmin: true, tokenOwner: false}}, + ]); } - it('Sets access rights to properties of a collection (NFT)', async () => { - await testSetsAccessRightsToProperties({type: 'NFT'}); + + itSub('Sets access rights to properties of a collection (NFT)', async ({helper}) => { + await testSetsAccessRightsToProperties(await helper.nft.mintCollection(alice)); }); - it('Sets access rights to properties of a collection (ReFungible)', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testSetsAccessRightsToProperties({type: 'ReFungible'}); + itSub.ifWithPallets('Sets access rights to properties of a collection (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + await testSetsAccessRightsToProperties(await helper.rft.mintCollection(alice)); }); - async function testChangesAccessRightsToProperty(mode: CollectionMode) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'skullduggery', permission: {mutable: true, collectionAdmin: true}}]), - )).to.not.be.rejected; - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'skullduggery', permission: {mutable: false, tokenOwner: true}}]), - )).to.not.be.rejected; - - const propertyRights = (await api.rpc.unique.propertyPermissions(collection, ['skullduggery'])).toHuman(); - expect(propertyRights).to.be.deep.equal([ - {key: 'skullduggery', permission: {'mutable': false, 'collectionAdmin': false, 'tokenOwner': true}}, - ]); - }); + async function testChangesAccessRightsToProperty(collection: UniqueNFTCollection | UniqueRFTCollection) { + await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: true, collectionAdmin: true}}])) + .to.be.fulfilled; + + await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: false, tokenOwner: true}}])) + .to.be.fulfilled; + + const propertyRights = await collection.getPropertyPermissions(); + expect(propertyRights).to.be.deep.equal([ + {key: 'skullduggery', permission: {'mutable': false, 'collectionAdmin': false, 'tokenOwner': true}}, + ]); } - it('Changes access rights to properties of a NFT collection', async () => { - await testChangesAccessRightsToProperty({type: 'NFT'}); + + itSub('Changes access rights to properties of a NFT collection', async ({helper}) => { + await testChangesAccessRightsToProperty(await helper.nft.mintCollection(alice)); }); - it('Changes access rights to properties of a ReFungible collection', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testChangesAccessRightsToProperty({type: 'ReFungible'}); + itSub.ifWithPallets('Changes access rights to properties of a ReFungible collection', [Pallets.ReFungible], async ({helper}) => { + await testChangesAccessRightsToProperty(await helper.rft.mintCollection(alice)); }); }); describe('Negative Integration Test: Access Rights to Token Properties', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); }); }); - async function testPreventsFromSettingAccessRightsNotAdminOrOwner(mode: CollectionMode) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - - await expect(executeTransaction( - api, - bob, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'skullduggery', permission: {mutable: true, tokenOwner: true}}]), - )).to.be.rejectedWith(/common\.NoPermission/); - - const propertyRights = (await api.rpc.unique.propertyPermissions(collection, ['skullduggery'])).toJSON(); - expect(propertyRights).to.be.empty; - }); + async function testPreventsFromSettingAccessRightsNotAdminOrOwner(collection: UniqueNFTCollection | UniqueRFTCollection) { + await expect(collection.setTokenPropertyPermissions(bob, [{key: 'skullduggery', permission: {mutable: true, tokenOwner: true}}])) + .to.be.rejectedWith(/common\.NoPermission/); + + const propertyRights = await collection.getPropertyPermissions(['skullduggery']); + expect(propertyRights).to.be.empty; } - it('Prevents from setting access rights to properties of a NFT collection if not an onwer/admin', async () => { - await testPreventsFromSettingAccessRightsNotAdminOrOwner({type: 'NFT'}); + + itSub('Prevents from setting access rights to properties of a NFT collection if not an onwer/admin', async ({helper}) => { + await testPreventsFromSettingAccessRightsNotAdminOrOwner(await helper.nft.mintCollection(alice)); }); - it('Prevents from setting access rights to properties of a ReFungible collection if not an onwer/admin', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testPreventsFromSettingAccessRightsNotAdminOrOwner({type: 'ReFungible'}); + itSub.ifWithPallets('Prevents from setting access rights to properties of a ReFungible collection if not an onwer/admin', [Pallets.ReFungible], async ({helper}) => { + await testPreventsFromSettingAccessRightsNotAdminOrOwner(await helper.rft.mintCollection(alice)); }); - async function testPreventFromAddingTooManyPossibleProperties(mode: CollectionMode) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - - const constitution = []; - for (let i = 0; i < 65; i++) { - constitution.push({ - key: 'property_' + i, - permission: Math.random() > 0.5 ? {mutable: true, collectionAdmin: true, tokenOwner: true} : {}, - }); - } - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, constitution), - )).to.be.rejectedWith(/common\.PropertyLimitReached/); - - const propertyRights = (await api.query.common.collectionPropertyPermissions(collection)).toJSON(); - expect(propertyRights).to.be.empty; - }); + async function testPreventFromAddingTooManyPossibleProperties(collection: UniqueNFTCollection | UniqueRFTCollection) { + const constitution = []; + for (let i = 0; i < 65; i++) { + constitution.push({ + key: 'property_' + i, + permission: Math.random() > 0.5 ? {mutable: true, collectionAdmin: true, tokenOwner: true} : {}, + }); + } + + await expect(collection.setTokenPropertyPermissions(alice, constitution)) + .to.be.rejectedWith(/common\.PropertyLimitReached/); + + const propertyRights = await collection.getPropertyPermissions(); + expect(propertyRights).to.be.empty; } - it('Prevents from adding too many possible properties (NFT)', async () => { - await testPreventFromAddingTooManyPossibleProperties({type: 'NFT'}); + + itSub('Prevents from adding too many possible properties (NFT)', async ({helper}) => { + await testPreventFromAddingTooManyPossibleProperties(await helper.nft.mintCollection(alice)); }); - it('Prevents from adding too many possible properties (ReFungible)', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testPreventFromAddingTooManyPossibleProperties({type: 'ReFungible'}); + itSub.ifWithPallets('Prevents from adding too many possible properties (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + await testPreventFromAddingTooManyPossibleProperties(await helper.rft.mintCollection(alice)); }); - async function testPreventAccessRightsModifiedIfConstant(mode: CollectionMode) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'skullduggery', permission: {mutable: false, tokenOwner: true}}]), - )).to.not.be.rejected; - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'skullduggery', permission: {}}]), - )).to.be.rejectedWith(/common\.NoPermission/); - - const propertyRights = (await api.rpc.unique.propertyPermissions(collection, ['skullduggery'])).toHuman(); - expect(propertyRights).to.deep.equal([ - {key: 'skullduggery', permission: {'mutable': false, 'collectionAdmin': false, 'tokenOwner': true}}, - ]); - }); + async function testPreventAccessRightsModifiedIfConstant(collection: UniqueNFTCollection | UniqueRFTCollection) { + await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: false, tokenOwner: true}}])) + .to.be.fulfilled; + + await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {collectionAdmin: true}}])) + .to.be.rejectedWith(/common\.NoPermission/); + + const propertyRights = await collection.getPropertyPermissions(['skullduggery']); + expect(propertyRights).to.deep.equal([ + {key: 'skullduggery', permission: {'mutable': false, 'collectionAdmin': false, 'tokenOwner': true}}, + ]); } - it('Prevents access rights to be modified if constant (NFT)', async () => { - await testPreventAccessRightsModifiedIfConstant({type: 'NFT'}); + + itSub('Prevents access rights to be modified if constant (NFT)', async ({helper}) => { + await testPreventAccessRightsModifiedIfConstant(await helper.nft.mintCollection(alice)); }); - it('Prevents access rights to be modified if constant (ReFungible)', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testPreventAccessRightsModifiedIfConstant({type: 'ReFungible'}); + itSub.ifWithPallets('Prevents access rights to be modified if constant (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + await testPreventAccessRightsModifiedIfConstant(await helper.rft.mintCollection(alice)); }); - async function testPreventsAddingPropertiesWithInvalidNames(mode: CollectionMode) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - - const invalidProperties = [ - [{key: 'skullduggery', permission: {tokenOwner: true}}, {key: 'im possible', permission: {collectionAdmin: true}}], - [{key: 'G#4', permission: {tokenOwner: true}}], - [{key: 'HÆMILTON', permission: {mutable: false, collectionAdmin: true, tokenOwner: true}}], - ]; - - for (let i = 0; i < invalidProperties.length; i++) { - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, invalidProperties[i]), - ), `on setting the new badly-named property #${i}`).to.be.rejectedWith(/common\.InvalidCharacterInPropertyKey/); - } - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: '', permission: {}}]), - ), 'on rejecting an unnamed property').to.be.rejectedWith(/common\.EmptyPropertyKey/); - - const correctKey = '--0x03116e387820CA05'; // PolkadotJS would parse this as an already encoded hex-string - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [ - {key: correctKey, permission: {collectionAdmin: true}}, - ]), - ), 'on setting the correctly-but-still-badly-named property').to.not.be.rejected; - - const keys = invalidProperties.flatMap(propertySet => propertySet.map(property => property.key)).concat(correctKey).concat(''); - - const propertyRights = (await api.rpc.unique.propertyPermissions(collection, keys)).toHuman(); - expect(propertyRights).to.be.deep.equal([ - {key: correctKey, permission: {mutable: false, collectionAdmin: true, tokenOwner: false}}, - ]); - }); + async function testPreventsAddingPropertiesWithInvalidNames(collection: UniqueNFTCollection | UniqueRFTCollection) { + const invalidProperties = [ + [{key: 'skullduggery', permission: {tokenOwner: true}}, {key: 'im possible', permission: {collectionAdmin: true}}], + [{key: 'G#4', permission: {tokenOwner: true}}], + [{key: 'HÆMILTON', permission: {mutable: false, collectionAdmin: true, tokenOwner: true}}], + ]; + + for (let i = 0; i < invalidProperties.length; i++) { + await expect( + collection.setTokenPropertyPermissions(alice, invalidProperties[i]), + `on setting the new badly-named property #${i}`, + ).to.be.rejectedWith(/common\.InvalidCharacterInPropertyKey/); + } + + await expect( + collection.setTokenPropertyPermissions(alice, [{key: '', permission: {}}]), + 'on rejecting an unnamed property', + ).to.be.rejectedWith(/common\.EmptyPropertyKey/); + + const correctKey = '--0x03116e387820CA05'; // PolkadotJS would parse this as an already encoded hex-string + await expect( + collection.setTokenPropertyPermissions(alice, [ + {key: correctKey, permission: {collectionAdmin: true}}, + ]), + 'on setting the correctly-but-still-badly-named property', + ).to.be.fulfilled; + + const keys = invalidProperties.flatMap(propertySet => propertySet.map(property => property.key)).concat(correctKey).concat(''); + + const propertyRights = await collection.getPropertyPermissions(keys); + expect(propertyRights).to.be.deep.equal([ + {key: correctKey, permission: {mutable: false, collectionAdmin: true, tokenOwner: false}}, + ]); } - it('Prevents adding properties with invalid names (NFT)', async () => { - await testPreventsAddingPropertiesWithInvalidNames({type: 'NFT'}); + + itSub('Prevents adding properties with invalid names (NFT)', async ({helper}) => { + await testPreventsAddingPropertiesWithInvalidNames(await helper.nft.mintCollection(alice)); }); - it('Prevents adding properties with invalid names (ReFungible)', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testPreventsAddingPropertiesWithInvalidNames({type: 'ReFungible'}); + itSub.ifWithPallets('Prevents adding properties with invalid names (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + await testPreventsAddingPropertiesWithInvalidNames(await helper.rft.mintCollection(alice)); }); }); // ---------- TOKEN PROPERTIES describe('Integration Test: Token Properties', () => { + let alice: IKeyringPair; // collection owner + let bob: IKeyringPair; // collection admin + let charlie: IKeyringPair; // token owner + let permissions: {permission: any, signers: IKeyringPair[]}[]; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); // collection owner - bob = privateKeyWrapper('//Bob'); // collection admin - charlie = privateKeyWrapper('//Charlie'); // token owner - - permissions = [ - {permission: {mutable: true, collectionAdmin: true}, signers: [alice, bob]}, - {permission: {mutable: false, collectionAdmin: true}, signers: [alice, bob]}, - {permission: {mutable: true, tokenOwner: true}, signers: [charlie]}, - {permission: {mutable: false, tokenOwner: true}, signers: [charlie]}, - {permission: {mutable: true, collectionAdmin: true, tokenOwner: true}, signers: [alice, bob, charlie]}, - {permission: {mutable: false, collectionAdmin: true, tokenOwner: true}, signers: [alice, bob, charlie]}, - ]; + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); + + // todo:playgrounds probably separate these tests later + permissions = [ + {permission: {mutable: true, collectionAdmin: true}, signers: [alice, bob]}, + {permission: {mutable: false, collectionAdmin: true}, signers: [alice, bob]}, + {permission: {mutable: true, tokenOwner: true}, signers: [charlie]}, + {permission: {mutable: false, tokenOwner: true}, signers: [charlie]}, + {permission: {mutable: true, collectionAdmin: true, tokenOwner: true}, signers: [alice, bob, charlie]}, + {permission: {mutable: false, collectionAdmin: true, tokenOwner: true}, signers: [alice, bob, charlie]}, + ]; }); - async function testReadsYetEmptyProperties(mode: CollectionMode) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - const token = await createItemExpectSuccess(alice, collection, mode.type); - - const properties = (await api.query.nonfungible.tokenProperties(collection, token)).toJSON(); - expect(properties.map).to.be.empty; - expect(properties.consumedSpace).to.be.equal(0); - - const tokenData = (await api.rpc.unique.tokenData(collection, token, ['anything'])).toJSON().properties; - expect(tokenData).to.be.empty; - }); + async function testReadsYetEmptyProperties(token: UniqueNFTToken | UniqueRFTToken) { + const properties = await token.getProperties(); + expect(properties).to.be.empty; + + const tokenData = await token.getData(); + expect(tokenData!.properties).to.be.empty; } - it('Reads yet empty properties of a token (NFT)', async () => { - await testReadsYetEmptyProperties({type: 'NFT'}); - }); - it('Reads yet empty properties of a token (ReFungible)', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testReadsYetEmptyProperties({type: 'ReFungible'}); + itSub('Reads yet empty properties of a token (NFT)', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const token = await collection.mintToken(alice); + await testReadsYetEmptyProperties(token); }); - async function testAssignPropertiesAccordingToPermissions(mode: CollectionMode, pieces: number) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - const token = await createItemExpectSuccess(alice, collection, mode.type); - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - await transferExpectSuccess(collection, token, alice, charlie, pieces, mode.type); - - const propertyKeys: string[] = []; - let i = 0; - for (const permission of permissions) { - for (const signer of permission.signers) { - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), - ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.setTokenProperties(collection, token, [{key: key, value: 'Serotonin increase'}]), - ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - } - - i++; - } + itSub.ifWithPallets('Reads yet empty properties of a token (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice); + await testReadsYetEmptyProperties(token); + }); - const properties = (await api.rpc.unique.tokenProperties(collection, token, propertyKeys)).toHuman() as any[]; - const tokensData = (await api.rpc.unique.tokenData(collection, token, propertyKeys)).toHuman().properties as any[]; - for (let i = 0; i < properties.length; i++) { - expect(properties[i].value).to.be.equal('Serotonin increase'); - expect(tokensData[i].value).to.be.equal('Serotonin increase'); + async function testAssignPropertiesAccordingToPermissions(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint) { + await token.collection.addAdmin(alice, {Substrate: bob.address}); + await token.transfer(alice, {Substrate: charlie.address}, pieces); + + const propertyKeys: string[] = []; + let i = 0; + for (const permission of permissions) { + i++; + let j = 0; + for (const signer of permission.signers) { + j++; + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect( + token.collection.setTokenPropertyPermissions(alice, [{key: key, permission: permission.permission}]), + `on setting permission #${i} by alice`, + ).to.be.fulfilled; + + await expect( + token.setProperties(signer, [{key: key, value: 'Serotonin increase'}]), + `on adding property #${i} by signer #${j}`, + ).to.be.fulfilled; } - }); + } + + const properties = await token.getProperties(propertyKeys); + const tokenData = await token.getData(); + for (let i = 0; i < properties.length; i++) { + expect(properties[i].value).to.be.equal('Serotonin increase'); + expect(tokenData!.properties[i].value).to.be.equal('Serotonin increase'); + } } - it('Assigns properties to a token according to permissions (NFT)', async () => { - await testAssignPropertiesAccordingToPermissions({type: 'NFT'}, 1); + + itSub('Assigns properties to a token according to permissions (NFT)', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const token = await collection.mintToken(alice); + await testAssignPropertiesAccordingToPermissions(token, 1n); }); - it('Assigns properties to a token according to permissions (ReFungible)', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testAssignPropertiesAccordingToPermissions({type: 'ReFungible'}, 100); + itSub.ifWithPallets('Assigns properties to a token according to permissions (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice, 100n); + await testAssignPropertiesAccordingToPermissions(token, 100n); }); - async function testChangesPropertiesAccordingPermission(mode: CollectionMode, pieces: number) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - const token = await createItemExpectSuccess(alice, collection, mode.type); - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - await transferExpectSuccess(collection, token, alice, charlie, pieces, mode.type); - - const propertyKeys: string[] = []; - let i = 0; - for (const permission of permissions) { - if (!permission.permission.mutable) continue; - - for (const signer of permission.signers) { - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), - ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.setTokenProperties(collection, token, [{key: key, value: 'Serotonin increase'}]), - ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.setTokenProperties(collection, token, [{key: key, value: 'Serotonin stable'}]), - ), `on changing property ${i} by ${signer.address}`).to.not.be.rejected; - } - - i++; - } - - const properties = (await api.rpc.unique.tokenProperties(collection, token, propertyKeys)).toHuman() as any[]; - const tokensData = (await api.rpc.unique.tokenData(collection, token, propertyKeys)).toHuman().properties as any[]; - for (let i = 0; i < properties.length; i++) { - expect(properties[i].value).to.be.equal('Serotonin stable'); - expect(tokensData[i].value).to.be.equal('Serotonin stable'); + async function testChangesPropertiesAccordingPermission(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint) { + await token.collection.addAdmin(alice, {Substrate: bob.address}); + await token.transfer(alice, {Substrate: charlie.address}, pieces); + + const propertyKeys: string[] = []; + let i = 0; + for (const permission of permissions) { + i++; + if (!permission.permission.mutable) continue; + + let j = 0; + for (const signer of permission.signers) { + j++; + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect( + token.collection.setTokenPropertyPermissions(alice, [{key: key, permission: permission.permission}]), + `on setting permission #${i} by alice`, + ).to.be.fulfilled; + + await expect( + token.setProperties(signer, [{key, value: 'Serotonin increase'}]), + `on adding property #${i} by signer #${j}`, + ).to.be.fulfilled; + + await expect( + token.setProperties(signer, [{key, value: 'Serotonin stable'}]), + `on changing property #${i} by signer #${j}`, + ).to.be.fulfilled; } - }); + } + + const properties = await token.getProperties(propertyKeys); + const tokenData = await token.getData(); + for (let i = 0; i < properties.length; i++) { + expect(properties[i].value).to.be.equal('Serotonin stable'); + expect(tokenData!.properties[i].value).to.be.equal('Serotonin stable'); + } } - it('Changes properties of a token according to permissions (NFT)', async () => { - await testChangesPropertiesAccordingPermission({type: 'NFT'}, 1); - }); - it('Changes properties of a token according to permissions (ReFungible)', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testChangesPropertiesAccordingPermission({type: 'ReFungible'}, 100); + itSub('Changes properties of a token according to permissions (NFT)', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const token = await collection.mintToken(alice); + await testChangesPropertiesAccordingPermission(token, 1n); }); - async function testDeletePropertiesAccordingPermission(mode: CollectionMode, pieces: number) { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: mode}); - const token = await createItemExpectSuccess(alice, collection, mode.type); - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - await transferExpectSuccess(collection, token, alice, charlie, pieces, mode.type); + itSub.ifWithPallets('Changes properties of a token according to permissions (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice, 100n); + await testChangesPropertiesAccordingPermission(token, 100n); + }); - const propertyKeys: string[] = []; - let i = 0; - - for (const permission of permissions) { - if (!permission.permission.mutable) continue; - - for (const signer of permission.signers) { - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), - ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.setTokenProperties(collection, token, [{key: key, value: 'Serotonin increase'}]), - ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.deleteTokenProperties(collection, token, [key]), - ), `on deleting property ${i} by ${signer.address}`).to.not.be.rejected; - } - - i++; + async function testDeletePropertiesAccordingPermission(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint) { + await token.collection.addAdmin(alice, {Substrate: bob.address}); + await token.transfer(alice, {Substrate: charlie.address}, pieces); + + const propertyKeys: string[] = []; + let i = 0; + + for (const permission of permissions) { + i++; + if (!permission.permission.mutable) continue; + + let j = 0; + for (const signer of permission.signers) { + j++; + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect( + token.collection.setTokenPropertyPermissions(alice, [{key: key, permission: permission.permission}]), + `on setting permission #${i} by alice`, + ).to.be.fulfilled; + + await expect( + token.setProperties(signer, [{key, value: 'Serotonin increase'}]), + `on adding property #${i} by signer #${j}`, + ).to.be.fulfilled; + + await expect( + token.deleteProperties(signer, [key]), + `on deleting property #${i} by signer #${j}`, + ).to.be.fulfilled; } - - const properties = (await api.rpc.unique.tokenProperties(collection, token, propertyKeys)).toJSON() as any[]; - expect(properties).to.be.empty; - const tokensData = (await api.rpc.unique.tokenData(collection, token, propertyKeys)).toJSON().properties as any[]; - expect(tokensData).to.be.empty; - expect((await api.query.nonfungible.tokenProperties(collection, token)).toJSON().consumedSpace).to.be.equal(0); - }); + } + + expect(await token.getProperties(propertyKeys)).to.be.empty; + expect((await token.getData())!.properties).to.be.empty; } - it('Deletes properties of a token according to permissions (NFT)', async () => { - await testDeletePropertiesAccordingPermission({type: 'NFT'}, 1); + + itSub('Deletes properties of a token according to permissions (NFT)', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const token = await collection.mintToken(alice); + await testDeletePropertiesAccordingPermission(token, 1n); }); - it('Deletes properties of a token according to permissions (ReFungible)', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testDeletePropertiesAccordingPermission({type: 'ReFungible'}, 100); + itSub.ifWithPallets('Deletes properties of a token according to permissions (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice, 100n); + await testDeletePropertiesAccordingPermission(token, 100n); }); - it('Assigns properties to a nested token according to permissions', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); - const token = await createItemExpectSuccess(alice, collection, 'NFT'); - const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, token)}); - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - await transferExpectSuccess(collection, token, alice, charlie); - - const propertyKeys: string[] = []; - let i = 0; - for (const permission of permissions) { - for (const signer of permission.signers) { - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), - ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]), - ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - } - - i++; + itSub('Assigns properties to a nested token according to permissions', async ({helper}) => { + const collectionA = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + const collectionB = await helper.nft.mintCollection(alice); + const targetToken = await collectionA.mintToken(alice); + const nestedToken = await collectionB.mintToken(alice, targetToken.nestingAddress()); + + await collectionB.addAdmin(alice, {Substrate: bob.address}); + await targetToken.transfer(alice, {Substrate: charlie.address}); + + const propertyKeys: string[] = []; + let i = 0; + for (const permission of permissions) { + i++; + let j = 0; + for (const signer of permission.signers) { + j++; + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect( + nestedToken.collection.setTokenPropertyPermissions(alice, [{key: key, permission: permission.permission}]), + `on setting permission #${i} by alice`, + ).to.be.fulfilled; + + await expect( + nestedToken.setProperties(signer, [{key, value: 'Serotonin increase'}]), + `on adding property #${i} by signer #${j}`, + ).to.be.fulfilled; } - const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toHuman() as any[]; - const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toHuman().properties as any[]; - for (let i = 0; i < properties.length; i++) { - expect(properties[i].value).to.be.equal('Serotonin increase'); - expect(tokensData[i].value).to.be.equal('Serotonin increase'); - } - }); - }); + } - it('Changes properties of a nested token according to permissions', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); - const token = await createItemExpectSuccess(alice, collection, 'NFT'); - const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, token)}); - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - await transferExpectSuccess(collection, token, alice, charlie); - - const propertyKeys: string[] = []; - let i = 0; - for (const permission of permissions) { - if (!permission.permission.mutable) continue; - - for (const signer of permission.signers) { - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), - ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]), - ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin stable'}]), - ), `on changing property ${i} by ${signer.address}`).to.not.be.rejected; - } - - i++; - } + const properties = await nestedToken.getProperties(propertyKeys); + const tokenData = await nestedToken.getData(); + for (let i = 0; i < properties.length; i++) { + expect(properties[i].value).to.be.equal('Serotonin increase'); + expect(tokenData!.properties[i].value).to.be.equal('Serotonin increase'); + } + expect(await targetToken.getProperties()).to.be.empty; + }); - const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toHuman() as any[]; - const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toHuman().properties as any[]; - for (let i = 0; i < properties.length; i++) { - expect(properties[i].value).to.be.equal('Serotonin stable'); - expect(tokensData[i].value).to.be.equal('Serotonin stable'); + itSub('Changes properties of a nested token according to permissions', async ({helper}) => { + const collectionA = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + const collectionB = await helper.nft.mintCollection(alice); + const targetToken = await collectionA.mintToken(alice); + const nestedToken = await collectionB.mintToken(alice, targetToken.nestingAddress()); + + await collectionB.addAdmin(alice, {Substrate: bob.address}); + await targetToken.transfer(alice, {Substrate: charlie.address}); + + const propertyKeys: string[] = []; + let i = 0; + for (const permission of permissions) { + i++; + if (!permission.permission.mutable) continue; + + let j = 0; + for (const signer of permission.signers) { + j++; + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect( + nestedToken.collection.setTokenPropertyPermissions(alice, [{key: key, permission: permission.permission}]), + `on setting permission #${i} by alice`, + ).to.be.fulfilled; + + await expect( + nestedToken.setProperties(signer, [{key, value: 'Serotonin increase'}]), + `on adding property #${i} by signer #${j}`, + ).to.be.fulfilled; + + await expect( + nestedToken.setProperties(signer, [{key, value: 'Serotonin stable'}]), + `on changing property #${i} by signer #${j}`, + ).to.be.fulfilled; } - }); + } + + const properties = await nestedToken.getProperties(propertyKeys); + const tokenData = await nestedToken.getData(); + for (let i = 0; i < properties.length; i++) { + expect(properties[i].value).to.be.equal('Serotonin stable'); + expect(tokenData!.properties[i].value).to.be.equal('Serotonin stable'); + } + expect(await targetToken.getProperties()).to.be.empty; }); - it('Deletes properties of a nested token according to permissions', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); - const token = await createItemExpectSuccess(alice, collection, 'NFT'); - const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, token)}); - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - await transferExpectSuccess(collection, token, alice, charlie); - - const propertyKeys: string[] = []; - let i = 0; - - for (const permission of permissions) { - if (!permission.permission.mutable) continue; - - for (const signer of permission.signers) { - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: key, permission: permission.permission}]), - ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.setTokenProperties(collection, nestedToken, [{key: key, value: 'Serotonin increase'}]), - ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.deleteTokenProperties(collection, nestedToken, [key]), - ), `on deleting property ${i} by ${signer.address}`).to.not.be.rejected; - } - - i++; + itSub('Deletes properties of a nested token according to permissions', async ({helper}) => { + const collectionA = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + const collectionB = await helper.nft.mintCollection(alice); + const targetToken = await collectionA.mintToken(alice); + const nestedToken = await collectionB.mintToken(alice, targetToken.nestingAddress()); + + await collectionB.addAdmin(alice, {Substrate: bob.address}); + await targetToken.transfer(alice, {Substrate: charlie.address}); + + const propertyKeys: string[] = []; + let i = 0; + for (const permission of permissions) { + i++; + if (!permission.permission.mutable) continue; + + let j = 0; + for (const signer of permission.signers) { + j++; + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect( + nestedToken.collection.setTokenPropertyPermissions(alice, [{key: key, permission: permission.permission}]), + `on setting permission #${i} by alice`, + ).to.be.fulfilled; + + await expect( + nestedToken.setProperties(signer, [{key, value: 'Serotonin increase'}]), + `on adding property #${i} by signer #${j}`, + ).to.be.fulfilled; + + await expect( + nestedToken.deleteProperties(signer, [key]), + `on deleting property #${i} by signer #${j}`, + ).to.be.fulfilled; } + } - const properties = (await api.rpc.unique.tokenProperties(collection, nestedToken, propertyKeys)).toJSON() as any[]; - expect(properties).to.be.empty; - const tokensData = (await api.rpc.unique.tokenData(collection, nestedToken, propertyKeys)).toJSON().properties as any[]; - expect(tokensData).to.be.empty; - expect((await api.query.nonfungible.tokenProperties(collection, nestedToken)).toJSON().consumedSpace).to.be.equal(0); - }); + expect(await nestedToken.getProperties(propertyKeys)).to.be.empty; + expect((await nestedToken.getData())!.properties).to.be.empty; + expect(await targetToken.getProperties()).to.be.empty; }); }); describe('Negative Integration Test: Token Properties', () => { - let collection: number; - let token: number; - let originalSpace: number; + let alice: IKeyringPair; // collection owner + let bob: IKeyringPair; // collection admin + let charlie: IKeyringPair; // token owner + let constitution: {permission: any, signers: IKeyringPair[], sinner: IKeyringPair}[]; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); - const dave = privateKeyWrapper('//Dave'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + let dave: IKeyringPair; + [alice, bob, charlie, dave] = await helper.arrange.createAccounts([100n, 100n, 100n, 100n], donor); + // todo:playgrounds probably separate these tests later constitution = [ {permission: {mutable: true, collectionAdmin: true}, signers: [alice, bob], sinner: charlie}, {permission: {mutable: false, collectionAdmin: true}, signers: [alice, bob], sinner: charlie}, @@ -1010,278 +804,255 @@ describe('Negative Integration Test: Token Properties', () => { }); }); - async function prepare(mode: CollectionMode, pieces: number) { - collection = await createCollectionExpectSuccess({mode: mode}); - token = await createItemExpectSuccess(alice, collection, mode.type); - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - await transferExpectSuccess(collection, token, alice, charlie, pieces, mode.type); - - await usingApi(async api => { - let i = 0; - for (const passage of constitution) { - const signer = passage.signers[0]; - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: `${i}`, permission: passage.permission}]), - ), `on setting permission ${i} by ${signer.address}`).to.not.be.rejected; - - await expect(executeTransaction( - api, - signer, - api.tx.unique.setTokenProperties(collection, token, [{key: `${i}`, value: 'Serotonin increase'}]), - ), `on adding property ${i} by ${signer.address}`).to.not.be.rejected; - - i++; - } - - originalSpace = (await api.query.nonfungible.tokenProperties(collection, token)).toJSON().consumedSpace as number; - }); + async function getConsumedSpace(api: any, collectionId: number, tokenId: number, mode: 'NFT' | 'RFT'): Promise { + return (await (mode == 'NFT' ? api.query.nonfungible : api.query.refungible).tokenProperties(collectionId, tokenId)).toJSON().consumedSpace; } - async function testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(mode: CollectionMode, pieces: number) { - await prepare(mode, pieces); - - await usingApi(async api => { - let i = -1; - for (const forbiddance of constitution) { - i++; - if (!forbiddance.permission.mutable) continue; - - await expect(executeTransaction( - api, - forbiddance.sinner, - api.tx.unique.setTokenProperties(collection, token, [{key: `${i}`, value: 'Serotonin down'}]), - ), `on failing to change property ${i} by ${forbiddance.sinner.address}`).to.be.rejectedWith(/common\.NoPermission/); - - await expect(executeTransaction( - api, - forbiddance.sinner, - api.tx.unique.deleteTokenProperties(collection, token, [`${i}`]), - ), `on failing to delete property ${i} by ${forbiddance.sinner.address}`).to.be.rejectedWith(/common\.NoPermission/); - } - - const properties = (await api.query.nonfungible.tokenProperties(collection, token)).toJSON(); - expect(properties.consumedSpace).to.be.equal(originalSpace); - }); + async function prepare(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint): Promise { + await token.collection.addAdmin(alice, {Substrate: bob.address}); + await token.transfer(alice, {Substrate: charlie.address}, pieces); + + let i = 0; + for (const passage of constitution) { + i++; + const signer = passage.signers[0]; + + await expect( + token.collection.setTokenPropertyPermissions(alice, [{key: `${i}`, permission: passage.permission}]), + `on setting permission ${i} by alice`, + ).to.be.fulfilled; + + await expect( + token.setProperties(signer, [{key: `${i}`, value: 'Serotonin increase'}]), + `on adding property ${i} by ${signer.address}`, + ).to.be.fulfilled; + } + + const originalSpace = await getConsumedSpace(token.collection.helper.api, token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); + return originalSpace; } - it('Forbids changing/deleting properties of a token if the user is outside of permissions (NFT)', async () => { - await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions({type: 'NFT'}, 1); + + async function testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint) { + const originalSpace = await prepare(token, pieces); + + let i = 0; + for (const forbiddance of constitution) { + i++; + if (!forbiddance.permission.mutable) continue; + + await expect( + token.setProperties(forbiddance.sinner, [{key: `${i}`, value: 'Serotonin down'}]), + `on failing to change property ${i} by the malefactor`, + ).to.be.rejectedWith(/common\.NoPermission/); + + await expect( + token.deleteProperties(forbiddance.sinner, [`${i}`]), + `on failing to delete property ${i} by the malefactor`, + ).to.be.rejectedWith(/common\.NoPermission/); + } + + const consumedSpace = await getConsumedSpace(token.collection.helper.api, token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); + expect(consumedSpace).to.be.equal(originalSpace); + } + + itSub('Forbids changing/deleting properties of a token if the user is outside of permissions (NFT)', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const token = await collection.mintToken(alice); + await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(token, 1n); }); - it('Forbids changing/deleting properties of a token if the user is outside of permissions (ReFungible)', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions({type: 'ReFungible'}, 100); + itSub.ifWithPallets('Forbids changing/deleting properties of a token if the user is outside of permissions (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice, 100n); + await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(token, 100n); }); - async function testForbidsChangingDeletingPropertiesIfPropertyImmutable(mode: CollectionMode, pieces: number) { - await prepare(mode, pieces); - - await usingApi(async api => { - let i = -1; - for (const permission of constitution) { - i++; - if (permission.permission.mutable) continue; - - await expect(executeTransaction( - api, - permission.signers[0], - api.tx.unique.setTokenProperties(collection, token, [{key: `${i}`, value: 'Serotonin down'}]), - ), `on failing to change property ${i} by ${permission.signers[0].address}`).to.be.rejectedWith(/common\.NoPermission/); - - await expect(executeTransaction( - api, - permission.signers[0], - api.tx.unique.deleteTokenProperties(collection, token, [i.toString()]), - ), `on failing to delete property ${i} by ${permission.signers[0].address}`).to.be.rejectedWith(/common\.NoPermission/); - } + async function testForbidsChangingDeletingPropertiesIfPropertyImmutable(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint) { + const originalSpace = await prepare(token, pieces); + + let i = 0; + for (const permission of constitution) { + i++; + if (permission.permission.mutable) continue; + + await expect( + token.setProperties(permission.signers[0], [{key: `${i}`, value: 'Serotonin down'}]), + `on failing to change property ${i} by signer #0`, + ).to.be.rejectedWith(/common\.NoPermission/); + + await expect( + token.deleteProperties(permission.signers[0], [i.toString()]), + `on failing to delete property ${i} by signer #0`, + ).to.be.rejectedWith(/common\.NoPermission/); + } - const properties = (await api.query.nonfungible.tokenProperties(collection, token)).toJSON(); - expect(properties.consumedSpace).to.be.equal(originalSpace); - }); + const consumedSpace = await getConsumedSpace(token.collection.helper.api, token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); + expect(consumedSpace).to.be.equal(originalSpace); } - it('Forbids changing/deleting properties of a token if the property is permanent (immutable) (NFT)', async () => { - await testForbidsChangingDeletingPropertiesIfPropertyImmutable({type: 'NFT'}, 1); - }); - it('Forbids changing/deleting properties of a token if the property is permanent (immutable) (ReFungible)', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testForbidsChangingDeletingPropertiesIfPropertyImmutable({type: 'ReFungible'}, 100); + itSub('Forbids changing/deleting properties of a token if the property is permanent (immutable) (NFT)', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const token = await collection.mintToken(alice); + await testForbidsChangingDeletingPropertiesIfPropertyImmutable(token, 1n); }); - async function testForbidsAddingPropertiesIfPropertyNotDeclared(mode: CollectionMode, pieces: number) { - await prepare(mode, pieces); + itSub.ifWithPallets('Forbids changing/deleting properties of a token if the property is permanent (immutable) (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice, 100n); + await testForbidsChangingDeletingPropertiesIfPropertyImmutable(token, 100n); + }); - await usingApi(async api => { - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenProperties(collection, token, [{key: 'non-existent', value: 'I exist!'}]), - ), 'on failing to add a previously non-existent property').to.be.rejectedWith(/common\.NoPermission/); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'now-existent', permission: {}}]), - ), 'on setting a new non-permitted property').to.not.be.rejected; - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenProperties(collection, token, [{key: 'now-existent', value: 'I exist!'}]), - ), 'on failing to add a property forbidden by the \'None\' permission').to.be.rejectedWith(/common\.NoPermission/); - - expect((await api.rpc.unique.tokenProperties(collection, token, ['non-existent', 'now-existent'])).toJSON()).to.be.empty; - const properties = (await api.query.nonfungible.tokenProperties(collection, token)).toJSON(); - expect(properties.consumedSpace).to.be.equal(originalSpace); - }); + async function testForbidsAddingPropertiesIfPropertyNotDeclared(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint) { + const originalSpace = await prepare(token, pieces); + + await expect( + token.setProperties(alice, [{key: 'non-existent', value: 'I exist!'}]), + 'on failing to add a previously non-existent property', + ).to.be.rejectedWith(/common\.NoPermission/); + + await expect( + token.collection.setTokenPropertyPermissions(alice, [{key: 'now-existent', permission: {}}]), + 'on setting a new non-permitted property', + ).to.be.fulfilled; + + await expect( + token.setProperties(alice, [{key: 'now-existent', value: 'I exist!'}]), + 'on failing to add a property forbidden by the \'None\' permission', + ).to.be.rejectedWith(/common\.NoPermission/); + + expect(await token.getProperties(['non-existent', 'now-existent'])).to.be.empty; + + const consumedSpace = await getConsumedSpace(token.collection.helper.api, token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); + expect(consumedSpace).to.be.equal(originalSpace); } - it('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (NFT)', async () => { - await testForbidsAddingPropertiesIfPropertyNotDeclared({type: 'NFT'}, 1); + + itSub('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (NFT)', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const token = await collection.mintToken(alice); + await testForbidsAddingPropertiesIfPropertyNotDeclared(token, 1n); }); - it('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (ReFungible)', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testForbidsAddingPropertiesIfPropertyNotDeclared({type: 'ReFungible'}, 100); + itSub.ifWithPallets('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice, 100n); + await testForbidsAddingPropertiesIfPropertyNotDeclared(token, 100n); }); - async function testForbidsAddingTooManyProperties(mode: CollectionMode, pieces: number) { - await prepare(mode, pieces); - - await usingApi(async api => { - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [ - {key: 'a_holy_book', permission: {collectionAdmin: true, tokenOwner: true}}, - {key: 'young_years', permission: {collectionAdmin: true, tokenOwner: true}}, - ]), - ), 'on setting a new non-permitted property').to.not.be.rejected; - - // Mute the general tx parsing error - { - console.error = () => {}; - await expect(executeTransaction( - api, - alice, - api.tx.unique.setCollectionProperties(collection, [{key: 'a_holy_book', value: 'word '.repeat(6554)}]), - )).to.be.rejected; - } - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenProperties(collection, token, [ - {key: 'a_holy_book', value: 'word '.repeat(3277)}, - {key: 'young_years', value: 'neverending'.repeat(1490)}, - ]), - )).to.be.rejectedWith(/common\.NoSpaceForProperty/); - - expect((await api.rpc.unique.tokenProperties(collection, token, ['a_holy_book', 'young_years'])).toJSON()).to.be.empty; - const propertiesMap = (await api.query.nonfungible.tokenProperties(collection, token)).toJSON(); - expect(propertiesMap.consumedSpace).to.be.equal(originalSpace); - }); + async function testForbidsAddingTooManyProperties(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint) { + const originalSpace = await prepare(token, pieces); + + await expect( + token.collection.setTokenPropertyPermissions(alice, [ + {key: 'a_holy_book', permission: {collectionAdmin: true, tokenOwner: true}}, + {key: 'young_years', permission: {collectionAdmin: true, tokenOwner: true}}, + ]), + 'on setting new permissions for properties', + ).to.be.fulfilled; + + // Mute the general tx parsing error + { + console.error = () => {}; + await expect(token.setProperties(alice, [{key: 'a_holy_book', value: 'word '.repeat(6554)}])) + .to.be.rejected; + } + + await expect(token.setProperties(alice, [ + {key: 'a_holy_book', value: 'word '.repeat(3277)}, + {key: 'young_years', value: 'neverending'.repeat(1490)}, + ])).to.be.rejectedWith(/common\.NoSpaceForProperty/); + + expect(await token.getProperties(['a_holy_book', 'young_years'])).to.be.empty; + const consumedSpace = await getConsumedSpace(token.collection.helper.api, token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); + expect(consumedSpace).to.be.equal(originalSpace); } - it('Forbids adding too many properties to a token (NFT)', async () => { - await testForbidsAddingTooManyProperties({type: 'NFT'}, 1); + + itSub('Forbids adding too many properties to a token (NFT)', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const token = await collection.mintToken(alice); + await testForbidsAddingTooManyProperties(token, 1n); }); - it('Forbids adding too many properties to a token (ReFungible)', async function() { - await requirePallets(this, [Pallets.ReFungible]); - await testForbidsAddingTooManyProperties({type: 'ReFungible'}, 100); + itSub.ifWithPallets('Forbids adding too many properties to a token (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice, 100n); + await testForbidsAddingTooManyProperties(token, 100n); }); }); describe('ReFungible token properties permissions tests', () => { - let collection: number; - let token: number; + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; before(async function() { - await requirePallets(this, [Pallets.ReFungible]); + await usingPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - charlie = privateKeyWrapper('//Charlie'); + const donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); - beforeEach(async () => { - await usingApi(async api => { - collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - token = await createItemExpectSuccess(alice, collection, 'ReFungible'); - await addCollectionAdminExpectSuccess(alice, collection, bob.address); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'key', permission: {mutable:true, tokenOwner: true}}]), - )).to.not.be.rejected; - }); + async function prepare(helper: UniqueHelper): Promise { + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice, 100n); + + await collection.addAdmin(alice, {Substrate: bob.address}); + await collection.setTokenPropertyPermissions(alice, [{key: 'fractals', permission: {mutable: true, tokenOwner: true}}]); + + return token; + } + + itSub('Forbids adding token property with tokenOwner==true when signer doesn\'t have all pieces', async ({helper}) => { + const token = await prepare(helper); + + await token.transfer(alice, {Substrate: charlie.address}, 33n); + + await expect(token.setProperties(alice, [ + {key: 'fractals', value: 'multiverse'}, + ])).to.be.rejectedWith(/common\.NoPermission/); }); - it('Forbids add token property with tokenOwher==true but signer have\'t all pieces', async () => { - await usingApi(async api => { - await transferExpectSuccess(collection, token, alice, charlie, 33, 'ReFungible'); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenProperties(collection, token, [ - {key: 'key', value: 'word'}, - ]), - )).to.be.rejectedWith(/common\.NoPermission/); - }); + itSub('Forbids mutating token property with tokenOwher==true when signer doesn\'t have all pieces', async ({helper}) => { + const token = await prepare(helper); + + await expect(token.collection.setTokenPropertyPermissions(alice, [{key: 'fractals', permission: {mutable:true, tokenOwner: true}}])) + .to.be.fulfilled; + + await expect(token.setProperties(alice, [ + {key: 'fractals', value: 'multiverse'}, + ])).to.be.fulfilled; + + await token.transfer(alice, {Substrate: charlie.address}, 33n); + + await expect(token.setProperties(alice, [ + {key: 'fractals', value: 'want to rule the world'}, + ])).to.be.rejectedWith(/common\.NoPermission/); }); - it('Forbids mutate token property with tokenOwher==true but signer have\'t all pieces', async () => { - await usingApi(async api => { - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenPropertyPermissions(collection, [{key: 'key', permission: {mutable:true, tokenOwner: true}}]), - )).to.not.be.rejected; - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenProperties(collection, token, [ - {key: 'key', value: 'word'}, - ]), - )).to.be.not.rejected; - - await transferExpectSuccess(collection, token, alice, charlie, 33, 'ReFungible'); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenProperties(collection, token, [ - {key: 'key', value: 'bad word'}, - ]), - )).to.be.rejectedWith(/common\.NoPermission/); - }); + itSub('Forbids deleting token property with tokenOwner==true when signer doesn\'t have all pieces', async ({helper}) => { + const token = await prepare(helper); + + await expect(token.setProperties(alice, [ + {key: 'fractals', value: 'one headline - why believe it'}, + ])).to.be.fulfilled; + + await token.transfer(alice, {Substrate: charlie.address}, 33n); + + await expect(token.deleteProperties(alice, ['fractals'])). + to.be.rejectedWith(/common\.NoPermission/); }); - it('Forbids delete token property with tokenOwher==true but signer have\'t all pieces', async () => { - await usingApi(async api => { - await expect(executeTransaction( - api, - alice, - api.tx.unique.setTokenProperties(collection, token, [ - {key: 'key', value: 'word'}, - ]), - )).to.be.not.rejected; - - await transferExpectSuccess(collection, token, alice, charlie, 33, 'ReFungible'); - - await expect(executeTransaction( - api, - alice, - api.tx.unique.deleteTokenProperties(collection, token, [ - 'key', - ]), - )).to.be.rejectedWith(/common\.NoPermission/); - }); + itSub('Allows token property mutation with collectionOwner==true when admin doesn\'t have all pieces', async ({helper}) => { + const token = await prepare(helper); + + await token.transfer(alice, {Substrate: charlie.address}, 33n); + + await expect(token.collection.setTokenPropertyPermissions(alice, [{key: 'fractals', permission: {mutable:true, collectionAdmin: true}}])) + .to.be.fulfilled; + + await expect(token.setProperties(alice, [ + {key: 'fractals', value: 'multiverse'}, + ])).to.be.fulfilled; }); }); diff --git a/tests/src/nesting/rules-smoke.test.ts b/tests/src/nesting/rules-smoke.test.ts deleted file mode 100644 index 1b58a78f80..0000000000 --- a/tests/src/nesting/rules-smoke.test.ts +++ /dev/null @@ -1,63 +0,0 @@ -import {expect} from 'chai'; -import {tokenIdToAddress} from '../eth/util/helpers'; -import usingApi, {executeTransaction} from '../substrate/substrate-api'; -import {createCollectionExpectSuccess, createFungibleItemExpectSuccess, createItemExpectSuccess, CrossAccountId, getCreateCollectionResult, requirePallets, Pallets} from '../util/helpers'; -import {IKeyringPair} from '@polkadot/types/types'; - -describe('nesting check', () => { - let alice!: IKeyringPair; - let nestTarget!: CrossAccountId; - before(async() => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const events = await executeTransaction(api, alice, api.tx.unique.createCollectionEx({ - mode: 'NFT', - permissions: { - nesting: {tokenOwner: true, restricted: []}, - }, - })); - const collection = getCreateCollectionResult(events).collectionId; - const token = await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: bob.address}); - nestTarget = {Ethereum: tokenIdToAddress(collection, token)}; - }); - }); - - it('called for fungible', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'Fungible',decimalPoints:0}}); - await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {Fungible: {Value: 1}}))) - .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/); - - await createFungibleItemExpectSuccess(alice, collection, {Value:1n}, {Substrate: alice.address}); - await expect(executeTransaction(api, alice, api.tx.unique.transfer(nestTarget, collection, 0, 1n))) - .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/); - }); - }); - - it('called for nonfungible', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {NFT: {properties: []}}))) - .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/); - - const token = await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: alice.address}); - await expect(executeTransaction(api, alice, api.tx.unique.transfer(nestTarget, collection, token, 1n))) - .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/); - }); - }); - - it('called for refungible', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {ReFungible: {}}))) - .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/); - - const token = await createItemExpectSuccess(alice, collection, 'ReFungible', {Substrate: alice.address}); - await expect(executeTransaction(api, alice, api.tx.unique.transfer(nestTarget, collection, token, 1n))) - .to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/); - }); - }); -}); diff --git a/tests/src/nesting/unnest.test.ts b/tests/src/nesting/unnest.test.ts index 3a214cf559..a0977544f5 100644 --- a/tests/src/nesting/unnest.test.ts +++ b/tests/src/nesting/unnest.test.ts @@ -1,162 +1,126 @@ -import {expect} from 'chai'; -import {tokenIdToAddress} from '../eth/util/helpers'; -import usingApi, {executeTransaction} from '../substrate/substrate-api'; -import { - createCollectionExpectSuccess, - createItemExpectSuccess, - getBalance, - getTokenOwner, - normalizeAccountId, - setCollectionPermissionsExpectSuccess, - transferExpectSuccess, - transferFromExpectSuccess, - requirePallets, - Pallets, -} from '../util/helpers'; -import {IKeyringPair} from '@polkadot/types/types'; +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . -let alice: IKeyringPair; -let bob: IKeyringPair; +import {IKeyringPair} from '@polkadot/types/types'; +import {expect, itSub, Pallets, usingPlaygrounds} from '../util/playgrounds'; describe('Integration Test: Unnesting', () => { + let alice: IKeyringPair; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([50n], donor); }); }); - it('NFT: allows the owner to successfully unnest a token', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); - const targetToken = await createItemExpectSuccess(alice, collection, 'NFT'); - const targetAddress = {Ethereum: tokenIdToAddress(collection, targetToken)}; - - // Create a nested token - const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', targetAddress); - - // Unnest - await expect(executeTransaction( - api, - alice, - api.tx.unique.transferFrom(normalizeAccountId(targetAddress), normalizeAccountId(alice), collection, nestedToken, 1), - ), 'while unnesting').to.not.be.rejected; - expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: alice.address}); - - // Nest and burn - await transferExpectSuccess(collection, nestedToken, alice, targetAddress); - await expect(executeTransaction( - api, - alice, - api.tx.unique.burnFrom(collection, normalizeAccountId(targetAddress), nestedToken, 1), - ), 'while burning').to.not.be.rejected; - await expect(getTokenOwner(api, collection, nestedToken)).to.be.rejected; - }); + itSub('NFT: allows the owner to successfully unnest a token', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + const targetToken = await collection.mintToken(alice); + + // Create a nested token + const nestedToken = await collection.mintToken(alice, targetToken.nestingAddress()); + + // Unnest + await expect(nestedToken.transferFrom(alice, targetToken.nestingAddress(), {Substrate: alice.address}), 'while unnesting').to.be.fulfilled; + expect(await nestedToken.getOwner()).to.be.deep.equal({Substrate: alice.address}); + + // Nest and burn + await nestedToken.nest(alice, targetToken); + await expect(nestedToken.burnFrom(alice, targetToken.nestingAddress()), 'while burning').to.be.fulfilled; + await expect(nestedToken.getOwner()).to.be.rejected; }); - it('Fungible: allows the owner to successfully unnest a token', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); - const targetToken = await createItemExpectSuccess(alice, collection, 'NFT'); - const targetAddress = {Ethereum: tokenIdToAddress(collection, targetToken)}; - - const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}}); - const nestedToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible'); - - // Nest and unnest - await transferExpectSuccess(collectionFT, nestedToken, alice, targetAddress, 1, 'Fungible'); - await transferFromExpectSuccess(collectionFT, nestedToken, alice, targetAddress, alice, 1, 'Fungible'); - - // Nest and burn - await transferExpectSuccess(collectionFT, nestedToken, alice, targetAddress, 1, 'Fungible'); - const balanceBefore = await getBalance(api, collectionFT, normalizeAccountId(targetAddress), nestedToken); - await expect(executeTransaction( - api, - alice, - api.tx.unique.burnFrom(collectionFT, normalizeAccountId(targetAddress), nestedToken, 1), - ), 'while burning').to.not.be.rejected; - const balanceAfter = await getBalance(api, collectionFT, normalizeAccountId(targetAddress), nestedToken); - expect(balanceAfter + BigInt(1)).to.be.equal(balanceBefore); - }); + itSub('Fungible: allows the owner to successfully unnest a token', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + const targetToken = await collection.mintToken(alice); + + const collectionFT = await helper.ft.mintCollection(alice); + + // Nest and unnest + await collectionFT.mint(alice, 10n, targetToken.nestingAddress()); + await expect(collectionFT.transferFrom(alice, targetToken.nestingAddress(), {Substrate: alice.address}, 9n), 'while unnesting').to.be.fulfilled; + expect(await collectionFT.getBalance({Substrate: alice.address})).to.be.equal(9n); + expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(1n); + + // Nest and burn + await collectionFT.transfer(alice, targetToken.nestingAddress(), 5n); + await expect(collectionFT.burnTokensFrom(alice, targetToken.nestingAddress(), 6n), 'while burning').to.be.fulfilled; + expect(await collectionFT.getBalance({Substrate: alice.address})).to.be.equal(4n); + expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(0n); + expect(await targetToken.getChildren()).to.be.length(0); }); - it('ReFungible: allows the owner to successfully unnest a token', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); - const targetToken = await createItemExpectSuccess(alice, collection, 'NFT'); - const targetAddress = {Ethereum: tokenIdToAddress(collection, targetToken)}; - - const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}}); - const nestedToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible'); - - // Nest and unnest - await transferExpectSuccess(collectionRFT, nestedToken, alice, targetAddress, 1, 'ReFungible'); - await transferFromExpectSuccess(collectionRFT, nestedToken, alice, targetAddress, alice, 1, 'ReFungible'); - - // Nest and burn - await transferExpectSuccess(collectionRFT, nestedToken, alice, targetAddress, 1, 'ReFungible'); - await expect(executeTransaction( - api, - alice, - api.tx.unique.burnFrom(collectionRFT, normalizeAccountId(targetAddress), nestedToken, 1), - ), 'while burning').to.not.be.rejected; - const balance = await getBalance(api, collectionRFT, normalizeAccountId(targetAddress), nestedToken); - expect(balance).to.be.equal(0n); - }); + itSub.ifWithPallets('ReFungible: allows the owner to successfully unnest a token', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + const targetToken = await collection.mintToken(alice); + + const collectionRFT = await helper.rft.mintCollection(alice); + + // Nest and unnest + const token = await collectionRFT.mintToken(alice, 10n, targetToken.nestingAddress()); + await expect(token.transferFrom(alice, targetToken.nestingAddress(), {Substrate: alice.address}, 9n), 'while unnesting').to.be.fulfilled; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(9n); + expect(await token.getBalance(targetToken.nestingAddress())).to.be.equal(1n); + + // Nest and burn + await token.transfer(alice, targetToken.nestingAddress(), 5n); + await expect(token.burnFrom(alice, targetToken.nestingAddress(), 6n), 'while burning').to.be.fulfilled; + expect(await token.getBalance({Substrate: alice.address})).to.be.equal(4n); + expect(await token.getBalance(targetToken.nestingAddress())).to.be.equal(0n); + expect(await targetToken.getChildren()).to.be.length(0); }); }); describe('Negative Test: Unnesting', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); }); }); - it('Disallows a non-owner to unnest/burn a token', async () => { - await usingApi(async api => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); - const targetToken = await createItemExpectSuccess(alice, collection, 'NFT'); - const targetAddress = {Ethereum: tokenIdToAddress(collection, targetToken)}; - - // Create a nested token - const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', targetAddress); - - // Try to unnest - await expect(executeTransaction( - api, - bob, - api.tx.unique.transferFrom(normalizeAccountId(targetAddress), normalizeAccountId(bob), collection, nestedToken, 1), - ), 'while unnesting').to.be.rejectedWith(/^common\.ApprovedValueTooLow$/); - expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()}); - - // Try to burn - await expect(executeTransaction( - api, - bob, - api.tx.unique.burnFrom(collection, normalizeAccountId(bob.address), nestedToken, 1), - ), 'while burning').to.not.be.rejectedWith(/^common\.ApprovedValueTooLow$/); - expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()}); - }); + itSub('Disallows a non-owner to unnest/burn a token', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + const targetToken = await collection.mintToken(alice); + + // Create a nested token + const nestedToken = await collection.mintToken(alice, targetToken.nestingAddress()); + + // Try to unnest + await expect(nestedToken.unnest(bob, targetToken, {Substrate: alice.address})).to.be.rejectedWith(/common\.ApprovedValueTooLow/); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + + // Try to burn + await expect(nestedToken.burnFrom(bob, targetToken.nestingAddress())).to.be.rejectedWith(/common\.ApprovedValueTooLow/); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); }); // todo another test for creating excessive depth matryoshka with Ethereum? // Recursive nesting - it('Prevents Ouroboros creation', async () => { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}}); - const targetToken = await createItemExpectSuccess(alice, collection, 'NFT'); - - // Create a nested token ouroboros - const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)}); - await expect(transferExpectSuccess(collection, targetToken, alice, {Ethereum: tokenIdToAddress(collection, nestedToken)})).to.be.rejectedWith(/^structure\.OuroborosDetected$/); + itSub('Prevents Ouroboros creation', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + const targetToken = await collection.mintToken(alice); + + // Fail to create a nested token ouroboros + const nestedToken = await collection.mintToken(alice, targetToken.nestingAddress()); + await expect(targetToken.nest(alice, nestedToken)).to.be.rejectedWith(/^structure\.OuroborosDetected$/); }); }); diff --git a/tests/src/util/playgrounds/types.ts b/tests/src/util/playgrounds/types.ts index 049ca5e851..67f962fa3f 100644 --- a/tests/src/util/playgrounds/types.ts +++ b/tests/src/util/playgrounds/types.ts @@ -94,21 +94,22 @@ export interface ICollectionPermissions { export interface IProperty { key: string; - value: string; + value?: string; } export interface ITokenPropertyPermission { key: string; permission: { - mutable: boolean; - tokenOwner: boolean; - collectionAdmin: boolean; + mutable?: boolean; + tokenOwner?: boolean; + collectionAdmin?: boolean; } } export interface IToken { collectionId: number; tokenId: number; + //nestingAddress: () => {Ethereum: string}; } export interface IBlock { diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 5a05c5b811..1b82f6f591 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -55,8 +55,12 @@ class UniqueUtil { RPC: 'rpc', }; - static getNestingTokenAddress(collectionId: number, tokenId: number) { - return nesting.tokenIdToAddress(collectionId, tokenId); + static getNestingTokenAddress(token: IToken) { + return {Ethereum: this.getNestingTokenAddressRaw(token).toLowerCase()}; + } + + static getNestingTokenAddressRaw(token: IToken) { + return nesting.tokenIdToAddress(token.collectionId, token.tokenId); } static getDefaultLogger(): ILogger { @@ -896,6 +900,18 @@ class CollectionGroup extends HelperGroup { return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'CollectionPropertySet'); } + /** + * Get collection properties. + * + * @param collectionId ID of collection + * @param propertyKeys optionally filter the returned properties to only these keys + * @example getProperties(1219, ['location', 'date', 'time', 'isParadise']); + * @returns array of key-value pairs + */ + async getProperties(collectionId: number, propertyKeys: string[] | null = null): Promise { + return (await this.helper.callRpc('api.rpc.unique.collectionProperties', [collectionId, ...(propertyKeys === null ? [] : [propertyKeys])])).toHuman(); + } + /** * Deletes onchain properties from the collection. * @@ -988,13 +1004,13 @@ class CollectionGroup extends HelperGroup { * * @param signer keyring of signer * @param collectionId ID of collection - * @param fromAddressObj address on behalf of which the token will be burnt * @param tokenId ID of token + * @param fromAddressObj address on behalf of which the token will be burnt * @param amount amount of tokens to be burned. For NFT must be set to 1n * @example burnTokenFrom(aliceKeyring, 10, {Substrate: "5DyN4Y92vZCjv38fg..."}, 5, {Ethereum: "0x9F0583DbB85..."}) * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async burnTokenFrom(signer: TSigner, collectionId: number, fromAddressObj: ICrossAccountId, tokenId: number, amount=1n): Promise { + async burnTokenFrom(signer: TSigner, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, amount=1n): Promise { const burnResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.burnFrom', [collectionId, fromAddressObj, tokenId, amount], @@ -1117,7 +1133,7 @@ class NFTnRFT extends CollectionGroup { * * @param signer keyring of signer * @param collectionId ID of collection - * @param permissions permissions to change a property by the collection owner or admin + * @param permissions permissions to change a property by the collection admin or token owner * @example setTokenPropertyPermissions( * aliceKeyring, 10, [{key: "gender", permission: {tokenOwner: true, mutable: true, collectionAdmin: true}}] * ) @@ -1133,6 +1149,18 @@ class NFTnRFT extends CollectionGroup { return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'PropertyPermissionSet'); } + /** + * Get token property permissions. + * + * @param collectionId ID of collection + * @param propertyKeys optionally filter the returned property permissions to only these keys + * @example getPropertyPermissions(1219, ['location', 'date', 'time', 'isParadise']); + * @returns array of key-permission pairs + */ + async getPropertyPermissions(collectionId: number, propertyKeys: string[] | null = null): Promise { + return (await this.helper.callRpc('api.rpc.unique.propertyPermissions', [collectionId, ...(propertyKeys === null ? [] : [propertyKeys])])).toHuman(); + } + /** * Set token properties * @@ -1153,6 +1181,19 @@ class NFTnRFT extends CollectionGroup { return this.helper.util.findCollectionInEvents(result.result.events, collectionId, 'common', 'TokenPropertySet'); } + /** + * Get properties, metadata assigned to a token. + * + * @param collectionId ID of collection + * @param tokenId ID of token + * @param propertyKeys optionally filter the returned properties to only these keys + * @example getTokenProperties(1219, ['location', 'date', 'time', 'isParadise']); + * @returns array of key-value pairs + */ + async getTokenProperties(collectionId: number, tokenId: number, propertyKeys: string[] | null = null): Promise { + return (await this.helper.callRpc('api.rpc.unique.tokenProperties', [collectionId, tokenId, ...(propertyKeys === null ? [] : [propertyKeys])])).toHuman(); + } + /** * Delete the provided properties of a token * @param signer keyring of signer @@ -1339,7 +1380,7 @@ class NFTGroup extends NFTnRFT { * @returns ```true``` if extrinsic success, otherwise ```false``` */ async nestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken): Promise { - const rootTokenAddress = {Ethereum: this.helper.util.getNestingTokenAddress(rootTokenObj.collectionId, rootTokenObj.tokenId)}; + const rootTokenAddress = this.helper.util.getNestingTokenAddress(rootTokenObj); const result = await this.transferToken(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress); if(!result) { throw Error('Unable to nest token!'); @@ -1357,7 +1398,7 @@ class NFTGroup extends NFTnRFT { * @returns ```true``` if extrinsic success, otherwise ```false``` */ async unnestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, toAddressObj: ICrossAccountId): Promise { - const rootTokenAddress = {Ethereum: this.helper.util.getNestingTokenAddress(rootTokenObj.collectionId, rootTokenObj.tokenId)}; + const rootTokenAddress = this.helper.util.getNestingTokenAddress(rootTokenObj); const result = await this.transferTokenFrom(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress, toAddressObj); if(!result) { throw Error('Unable to unnest token!'); @@ -1377,7 +1418,7 @@ class NFTGroup extends NFTnRFT { * }) * @returns object of the created collection */ - async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions): Promise { + async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions = {}): Promise { return await super.mintCollection(signer, collectionOptions, 'NFT') as UniqueNFTCollection; } @@ -1563,7 +1604,7 @@ class RFTGroup extends NFTnRFT { * }) * @returns object of the created collection */ - async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions): Promise { + async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions = {}): Promise { return await super.mintCollection(signer, collectionOptions, 'RFT') as UniqueRFTCollection; } @@ -1633,12 +1674,26 @@ class RFTGroup extends NFTnRFT { * @param tokenId ID of token * @param amount number of pieces to be burnt * @example burnToken(aliceKeyring, 10, 5); - * @returns ```true``` and burnt token number is extrinsic success. Otherwise ```false``` and ```null``` + * @returns ```true``` and burnt token number, if extrinsic is successful. Otherwise ```false``` and ```null``` */ async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number, amount=1n): Promise<{ success: boolean; token: number | null; }> { return await super.burnToken(signer, collectionId, tokenId, amount); } + /** + * Destroys a concrete instance of RFT on behalf of the owner. + * @param signer keyring of signer + * @param collectionId ID of collection + * @param tokenId ID of token + * @param fromAddressObj address on behalf of which the token will be burnt + * @param amount number of pieces to be burnt + * @example burnTokenFrom(aliceKeyring, 10, 5, {Substrate: "5DyN4Y92vZCjv38fg..."}, 2n) + * @returns ```true``` if extrinsic success, otherwise ```false``` + */ + async burnTokenFrom(signer: IKeyringPair, collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, amount=1n): Promise { + return await super.burnTokenFrom(signer, collectionId, tokenId, fromAddressObj, amount); + } + /** * Set, change, or remove approved address to transfer the ownership of the RFT. * @@ -1711,7 +1766,7 @@ class FTGroup extends CollectionGroup { * }, 18) * @returns newly created fungible collection */ - async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, decimalPoints = 0): Promise { + async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions = {}, decimalPoints = 0): Promise { collectionOptions = JSON.parse(JSON.stringify(collectionOptions)) as ICollectionCreationOptions; // Clone object if(collectionOptions.tokenPropertyPermissions) throw Error('Fungible collections has no tokenPropertyPermissions'); collectionOptions.mode = {fungible: decimalPoints}; @@ -1840,7 +1895,7 @@ class FTGroup extends CollectionGroup { * @returns ```true``` if extrinsic success, otherwise ```false``` */ async burnTokensFrom(signer: IKeyringPair, collectionId: number, fromAddressObj: ICrossAccountId, amount=1n): Promise { - return await super.burnTokenFrom(signer, collectionId, fromAddressObj, 0, amount); + return await super.burnTokenFrom(signer, collectionId, 0, fromAddressObj, amount); } /** @@ -2161,7 +2216,7 @@ export class UniqueHelper extends ChainHelperBase { } -class UniqueCollectionBase { +export class UniqueCollectionBase { helper: UniqueHelper; collectionId: number; @@ -2194,6 +2249,10 @@ class UniqueCollectionBase { return await this.helper.collection.getEffectiveLimits(this.collectionId); } + async getProperties(propertyKeys: string[] | null = null) { + return await this.helper.collection.getProperties(this.collectionId, propertyKeys); + } + async setSponsor(signer: TSigner, sponsorAddress: TSubstrateAccount) { return await this.helper.collection.setSponsor(signer, this.collectionId, sponsorAddress); } @@ -2260,7 +2319,7 @@ class UniqueCollectionBase { } -class UniqueNFTCollection extends UniqueCollectionBase { +export class UniqueNFTCollection extends UniqueCollectionBase { getTokenObject(tokenId: number) { return new UniqueNFTToken(tokenId, this); } @@ -2285,6 +2344,14 @@ class UniqueNFTCollection extends UniqueCollectionBase { return await this.helper.nft.getTokenChildren(this.collectionId, tokenId, blockHashAt); } + async getPropertyPermissions(propertyKeys: string[] | null = null) { + return await this.helper.nft.getPropertyPermissions(this.collectionId, propertyKeys); + } + + async getTokenProperties(tokenId: number, propertyKeys: string[] | null = null) { + return await this.helper.nft.getTokenProperties(this.collectionId, tokenId, propertyKeys); + } + async transferToken(signer: TSigner, tokenId: number, addressObj: ICrossAccountId) { return await this.helper.nft.transferToken(signer, this.collectionId, tokenId, addressObj); } @@ -2313,6 +2380,10 @@ class UniqueNFTCollection extends UniqueCollectionBase { return await this.helper.nft.burnToken(signer, this.collectionId, tokenId); } + async burnTokenFrom(signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId) { + return await this.helper.nft.burnTokenFrom(signer, this.collectionId, tokenId, fromAddressObj); + } + async setTokenProperties(signer: TSigner, tokenId: number, properties: IProperty[]) { return await this.helper.nft.setTokenProperties(signer, this.collectionId, tokenId, properties); } @@ -2335,11 +2406,15 @@ class UniqueNFTCollection extends UniqueCollectionBase { } -class UniqueRFTCollection extends UniqueCollectionBase { +export class UniqueRFTCollection extends UniqueCollectionBase { getTokenObject(tokenId: number) { return new UniqueRFTToken(tokenId, this); } + async getToken(tokenId: number, blockHashAt?: string) { + return await this.helper.rft.getToken(this.collectionId, tokenId, [], blockHashAt); + } + async getTokensByAddress(addressObj: ICrossAccountId) { return await this.helper.rft.getTokensByAddress(this.collectionId, addressObj); } @@ -2356,6 +2431,14 @@ class UniqueRFTCollection extends UniqueCollectionBase { return await this.helper.rft.getTokenTotalPieces(this.collectionId, tokenId); } + async getPropertyPermissions(propertyKeys: string[] | null = null) { + return await this.helper.rft.getPropertyPermissions(this.collectionId, propertyKeys); + } + + async getTokenProperties(tokenId: number, propertyKeys: string[] | null = null) { + return await this.helper.rft.getTokenProperties(this.collectionId, tokenId, propertyKeys); + } + async transferToken(signer: TSigner, tokenId: number, addressObj: ICrossAccountId, amount=1n) { return await this.helper.rft.transferToken(signer, this.collectionId, tokenId, addressObj, amount); } @@ -2388,6 +2471,10 @@ class UniqueRFTCollection extends UniqueCollectionBase { return await this.helper.rft.burnToken(signer, this.collectionId, tokenId, amount); } + async burnTokenFrom(signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId, amount=1n) { + return await this.helper.rft.burnTokenFrom(signer, this.collectionId, tokenId, fromAddressObj, amount); + } + async setTokenProperties(signer: TSigner, tokenId: number, properties: IProperty[]) { return await this.helper.rft.setTokenProperties(signer, this.collectionId, tokenId, properties); } @@ -2402,7 +2489,7 @@ class UniqueRFTCollection extends UniqueCollectionBase { } -class UniqueFTCollection extends UniqueCollectionBase { +export class UniqueFTCollection extends UniqueCollectionBase { async mint(signer: TSigner, amount=1n, owner: ICrossAccountId = {Substrate: signer.address}) { return await this.helper.ft.mintTokens(signer, this.collectionId, amount, owner); } @@ -2449,7 +2536,7 @@ class UniqueFTCollection extends UniqueCollectionBase { } -class UniqueTokenBase implements IToken { +export class UniqueTokenBase implements IToken { collection: UniqueNFTCollection | UniqueRFTCollection; collectionId: number; tokenId: number; @@ -2464,6 +2551,10 @@ class UniqueTokenBase implements IToken { return await this.collection.getTokenNextSponsored(this.tokenId, addressObj); } + async getProperties(propertyKeys: string[] | null = null) { + return await this.collection.getTokenProperties(this.tokenId, propertyKeys); + } + async setProperties(signer: TSigner, properties: IProperty[]) { return await this.collection.setTokenProperties(signer, this.tokenId, properties); } @@ -2471,10 +2562,14 @@ class UniqueTokenBase implements IToken { async deleteProperties(signer: TSigner, propertyKeys: string[]) { return await this.collection.deleteTokenProperties(signer, this.tokenId, propertyKeys); } + + nestingAddress() { + return this.collection.helper.util.getNestingTokenAddress(this); + } } -class UniqueNFTToken extends UniqueTokenBase { +export class UniqueNFTToken extends UniqueTokenBase { collection: UniqueNFTCollection; constructor(tokenId: number, collection: UniqueNFTCollection) { @@ -2525,9 +2620,13 @@ class UniqueNFTToken extends UniqueTokenBase { async burn(signer: TSigner) { return await this.collection.burnToken(signer, this.tokenId); } + + async burnFrom(signer: TSigner, fromAddressObj: ICrossAccountId) { + return await this.collection.burnTokenFrom(signer, this.tokenId, fromAddressObj); + } } -class UniqueRFTToken extends UniqueTokenBase { +export class UniqueRFTToken extends UniqueTokenBase { collection: UniqueRFTCollection; constructor(tokenId: number, collection: UniqueRFTCollection) { @@ -2535,6 +2634,10 @@ class UniqueRFTToken extends UniqueTokenBase { this.collection = collection; } + async getData(blockHashAt?: string) { + return await this.collection.getToken(this.tokenId, blockHashAt); + } + async getTop10Owners() { return await this.collection.getTop10TokenOwners(this.tokenId); } @@ -2570,4 +2673,8 @@ class UniqueRFTToken extends UniqueTokenBase { async burn(signer: TSigner, amount=1n) { return await this.collection.burnToken(signer, this.tokenId, amount); } + + async burnFrom(signer: TSigner, fromAddressObj: ICrossAccountId, amount=1n) { + return await this.collection.burnTokenFrom(signer, this.tokenId, fromAddressObj, amount); + } } From 378c38c729064ec1d1d2ba6edc49b6a959cdef11 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 23 Sep 2022 08:36:14 +0000 Subject: [PATCH 0952/1274] tests(util): altrefactorbstrate normalization --- tests/src/util/playgrounds/unique.ts | 31 +++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 1b82f6f591..669c1be785 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -596,11 +596,7 @@ class CollectionGroup extends HelperGroup { const admins = (await this.helper.callRpc('api.rpc.unique.adminlist', [collectionId])).toHuman(); return normalize - ? admins.map((address: any) => { - return address.Substrate - ? {Substrate: this.helper.address.normalizeSubstrate(address.Substrate)} - : address; - }) + ? admins.map((address: any) => this.helper.address.normalizeCrossAccountIfSubstrate(address)) : admins; } @@ -614,11 +610,7 @@ class CollectionGroup extends HelperGroup { async getAllowList(collectionId: number, normalize = false): Promise { const allowListed = (await this.helper.callRpc('api.rpc.unique.allowlist', [collectionId])).toHuman(); return normalize - ? allowListed.map((address: any) => { - return address.Substrate - ? {Substrate: this.helper.address.normalizeSubstrate(address.Substrate)} - : address; - }) + ? allowListed.map((address: any) => this.helper.address.normalizeCrossAccountIfSubstrate(address)) : allowListed; } @@ -1122,7 +1114,7 @@ class NFTnRFT extends CollectionGroup { if (tokenData === null || tokenData.owner === null) return null; const owner = {} as any; for (const key of Object.keys(tokenData.owner)) { - owner[key.toLocaleLowerCase()] = key.toLocaleLowerCase() === 'substrate' ? this.helper.address.normalizeSubstrate(tokenData.owner[key]) : tokenData.owner[key]; + owner[key.toLocaleLowerCase()] = this.helper.address.normalizeCrossAccountIfSubstrate(tokenData.owner[key]); } tokenData.normalizedOwner = crossAccountIdFromLower(owner); return tokenData; @@ -1345,9 +1337,7 @@ class NFTGroup extends NFTnRFT { if (owner === null) return null; - owner = owner.toHuman(); - - return owner.Substrate ? {Substrate: this.helper.address.normalizeSubstrate(owner.Substrate)} : owner; + return owner.toHuman(); } /** @@ -2071,6 +2061,19 @@ class AddressGroup extends HelperGroup { return this.helper.util.normalizeSubstrateAddress(address, ss58Format); } + /** + * Normalizes the address of an account ONLY if it's Substrate to the specified ss58 format, by default ```42```. + * @param account account of either Substrate type or Ethereum, but only Substrate will be changed + * @param ss58Format format for address conversion, by default ```42``` + * @example normalizeCrossAccountIfSubstrate({Substrate: "unjKJQJrRd238pkUZZvzDQrfKuM39zBSnQ5zjAGAGcdRhaJTx"}) // returns 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + * @returns untouched ethereum account or substrate account converted to normalized (i.e., starting with 5) or specified explicitly representation + */ + normalizeCrossAccountIfSubstrate(account: ICrossAccountId, ss58Format = 42): ICrossAccountId { + return account.Substrate + ? {Substrate: this.normalizeSubstrate(account.Substrate, ss58Format)} + : account; + } + /** * Get address in the connected chain format * @param address substrate address From b0b1d402a3ae5251db6b24b0d4b46709455d259b Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 23 Sep 2022 09:51:20 +0000 Subject: [PATCH 0953/1274] tests(nesting): refactor naming conventions for token addresses --- tests/src/eth/util/playgrounds/unique.dev.ts | 2 +- tests/src/nesting/graphs.test.ts | 2 +- tests/src/nesting/nest.test.ts | 190 +++++++++---------- tests/src/nesting/properties.test.ts | 6 +- tests/src/nesting/unnest.test.ts | 40 ++-- tests/src/util/playgrounds/types.ts | 1 - tests/src/util/playgrounds/unique.ts | 14 +- 7 files changed, 127 insertions(+), 128 deletions(-) diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index b6153ce2e4..abe3635060 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -240,7 +240,7 @@ class EthAddressGroup extends EthGroupBase { } fromTokenId(collectionId: number, tokenId: number): string { - return this.helper.util.getNestingTokenAddressRaw({collectionId, tokenId}); + return this.helper.util.getTokenAddress({collectionId, tokenId}); } normalizeAddress(address: string): string { diff --git a/tests/src/nesting/graphs.test.ts b/tests/src/nesting/graphs.test.ts index 86bd219df2..8849444c69 100644 --- a/tests/src/nesting/graphs.test.ts +++ b/tests/src/nesting/graphs.test.ts @@ -64,7 +64,7 @@ describe('Graphs', () => { 'second transaction', ).to.be.rejectedWith(/structure\.OuroborosDetected/); await expect( - tokens[1].transferFrom(alice, tokens[0].nestingAddress(), tokens[7].nestingAddress()), + tokens[1].transferFrom(alice, tokens[0].nestingAccount(), tokens[7].nestingAccount()), 'third transaction', ).to.be.rejectedWith(/structure\.OuroborosDetected/); }); diff --git a/tests/src/nesting/nest.test.ts b/tests/src/nesting/nest.test.ts index b8b8f0488d..04f4cd3822 100644 --- a/tests/src/nesting/nest.test.ts +++ b/tests/src/nesting/nest.test.ts @@ -33,9 +33,9 @@ describe('Integration Test: Composite nesting tests', () => { const targetToken = await collection.mintToken(alice); // Create an immediately nested token - const nestedToken = await collection.mintToken(alice, targetToken.nestingAddress()); + const nestedToken = await collection.mintToken(alice, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); // Create a token to be nested const newToken = await collection.mintToken(alice); @@ -43,14 +43,14 @@ describe('Integration Test: Composite nesting tests', () => { // Nest await newToken.nest(alice, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); // Move bundle to different user await targetToken.transfer(alice, {Substrate: bob.address}); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); // Unnest await newToken.unnest(bob, targetToken, {Substrate: bob.address}); @@ -64,13 +64,13 @@ describe('Integration Test: Composite nesting tests', () => { const tokenB = await collection.mintToken(alice); // Create a nested token - const tokenC = await collection.mintToken(alice, tokenA.nestingAddress()); - expect(await tokenC.getOwner()).to.be.deep.equal(tokenA.nestingAddress()); + const tokenC = await collection.mintToken(alice, tokenA.nestingAccount()); + expect(await tokenC.getOwner()).to.be.deep.equal(tokenA.nestingAccount()); // Transfer the nested token to another token - await expect(tokenC.transferFrom(alice, tokenA.nestingAddress(), tokenB.nestingAddress())).to.be.fulfilled; + await expect(tokenC.transferFrom(alice, tokenA.nestingAccount(), tokenB.nestingAccount())).to.be.fulfilled; expect(await tokenC.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address}); - expect(await tokenC.getOwner()).to.be.deep.equal(tokenB.nestingAddress()); + expect(await tokenC.getOwner()).to.be.deep.equal(tokenB.nestingAccount()); }); itSub('Checks token children', async ({helper}) => { @@ -81,7 +81,7 @@ describe('Integration Test: Composite nesting tests', () => { expect((await targetToken.getChildren()).length).to.be.equal(0, 'Children length check at creation'); // Create a nested NFT token - const tokenA = await collectionA.mintToken(alice, targetToken.nestingAddress()); + const tokenA = await collectionA.mintToken(alice, targetToken.nestingAccount()); expect(await targetToken.getChildren()).to.have.deep.members([ {tokenId: tokenA.tokenId, collectionId: collectionA.collectionId}, ], 'Children contents check at nesting #1').and.be.length(1, 'Children length check at nesting #1'); @@ -102,7 +102,7 @@ describe('Integration Test: Composite nesting tests', () => { // Create a fungible token in another collection and then nest await collectionB.mint(alice, 10n); - await collectionB.transfer(alice, targetToken.nestingAddress(), 2n); + await collectionB.transfer(alice, targetToken.nestingAccount(), 2n); expect(await targetToken.getChildren()).to.be.have.deep.members([ {tokenId: tokenA.tokenId, collectionId: collectionA.collectionId}, {tokenId: 0, collectionId: collectionB.collectionId}, @@ -110,7 +110,7 @@ describe('Integration Test: Composite nesting tests', () => { .and.be.length(2, 'Children length check at nesting #4 (from another collection)'); // Move part of the fungible token inside token A deeper in the nesting tree - await collectionB.transferFrom(alice, targetToken.nestingAddress(), tokenA.nestingAddress(), 1n); + await collectionB.transferFrom(alice, targetToken.nestingAccount(), tokenA.nestingAccount(), 1n); expect(await targetToken.getChildren()).to.be.have.deep.members([ {tokenId: tokenA.tokenId, collectionId: collectionA.collectionId}, {tokenId: 0, collectionId: collectionB.collectionId}, @@ -120,7 +120,7 @@ describe('Integration Test: Composite nesting tests', () => { ], 'Children contents check at nesting #5.5 (deeper)').and.be.length(1, 'Children length check at nesting #5.5 (deeper)'); // Move the remaining part of the fungible token inside token A deeper in the nesting tree - await collectionB.transferFrom(alice, targetToken.nestingAddress(), tokenA.nestingAddress(), 1n); + await collectionB.transferFrom(alice, targetToken.nestingAccount(), tokenA.nestingAccount(), 1n); expect(await targetToken.getChildren()).to.be.have.deep.members([ {tokenId: tokenA.tokenId, collectionId: collectionA.collectionId}, ], 'Children contents check at nesting #6 (deeper)').and.be.length(1, 'Children length check at nesting #6 (deeper)'); @@ -148,15 +148,15 @@ describe('Integration Test: Various token type nesting', () => { const targetToken = await collection.mintToken(alice, {Substrate: charlie.address}); // Create an immediately nested token - const nestedToken = await collection.mintToken(bob, targetToken.nestingAddress()); + const nestedToken = await collection.mintToken(bob, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); // Create a token to be nested and nest const newToken = await collection.mintToken(bob); await newToken.nest(bob, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); }); itSub('Admin (NFT): Admin and Token Owner can operate together', async ({helper}) => { @@ -165,15 +165,15 @@ describe('Integration Test: Various token type nesting', () => { const targetToken = await collection.mintToken(alice, {Substrate: charlie.address}); // Create an immediately nested token by an administrator - const nestedToken = await collection.mintToken(bob, targetToken.nestingAddress()); + const nestedToken = await collection.mintToken(bob, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); // Create a token to be nested and nest const newToken = await collection.mintToken(alice, {Substrate: charlie.address}); await newToken.nest(charlie, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); }); itSub('Admin (NFT): allows an Admin to nest a token (Restricted nesting)', async ({helper}) => { @@ -185,15 +185,15 @@ describe('Integration Test: Various token type nesting', () => { const targetToken = await collectionA.mintToken(alice, {Substrate: charlie.address}); // Create an immediately nested token - const nestedToken = await collectionB.mintToken(bob, targetToken.nestingAddress()); + const nestedToken = await collectionB.mintToken(bob, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); // Create a token to be nested and nest const newToken = await collectionB.mintToken(bob); await newToken.nest(bob, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); }); // ---------- Non-Fungible ---------- @@ -202,18 +202,18 @@ describe('Integration Test: Various token type nesting', () => { const collection = await helper.nft.mintCollection(alice, {permissions: {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true}}}); await collection.addToAllowList(alice, {Substrate: charlie.address}); const targetToken = await collection.mintToken(charlie); - await collection.addToAllowList(alice, targetToken.nestingAddress()); + await collection.addToAllowList(alice, targetToken.nestingAccount()); // Create an immediately nested token - const nestedToken = await collection.mintToken(charlie, targetToken.nestingAddress()); + const nestedToken = await collection.mintToken(charlie, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); // Create a token to be nested and nest const newToken = await collection.mintToken(charlie); await newToken.nest(charlie, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); }); itSub('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async ({helper}) => { @@ -224,22 +224,22 @@ describe('Integration Test: Various token type nesting', () => { await collectionA.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true, restricted:[collectionB.collectionId]}}); await collectionA.addToAllowList(alice, {Substrate: charlie.address}); - await collectionA.addToAllowList(alice, targetToken.nestingAddress()); + await collectionA.addToAllowList(alice, targetToken.nestingAccount()); await collectionB.setPermissions(alice, {access: 'AllowList', mintMode: true}); await collectionB.addToAllowList(alice, {Substrate: charlie.address}); - await collectionB.addToAllowList(alice, targetToken.nestingAddress()); + await collectionB.addToAllowList(alice, targetToken.nestingAccount()); // Create an immediately nested token - const nestedToken = await collectionB.mintToken(charlie, targetToken.nestingAddress()); + const nestedToken = await collectionB.mintToken(charlie, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); // Create a token to be nested and nest const newToken = await collectionB.mintToken(charlie); await newToken.nest(charlie, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); }); // ---------- Fungible ---------- @@ -250,20 +250,20 @@ describe('Integration Test: Various token type nesting', () => { const targetToken = await collectionNFT.mintToken(alice, {Substrate: charlie.address}); await collectionNFT.addToAllowList(alice, {Substrate: charlie.address}); - await collectionNFT.addToAllowList(alice, targetToken.nestingAddress()); + await collectionNFT.addToAllowList(alice, targetToken.nestingAccount()); await collectionFT.setPermissions(alice, {access: 'AllowList', mintMode: true}); await collectionFT.addToAllowList(alice, {Substrate: charlie.address}); - await collectionFT.addToAllowList(alice, targetToken.nestingAddress()); + await collectionFT.addToAllowList(alice, targetToken.nestingAccount()); // Create an immediately nested token - await collectionFT.mint(charlie, 5n, targetToken.nestingAddress()); - expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(5n); + await collectionFT.mint(charlie, 5n, targetToken.nestingAccount()); + expect(await collectionFT.getBalance(targetToken.nestingAccount())).to.be.equal(5n); // Create a token to be nested and nest await collectionFT.mint(charlie, 5n); - await collectionFT.transfer(charlie, targetToken.nestingAddress(), 2n); - expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(7n); + await collectionFT.transfer(charlie, targetToken.nestingAccount(), 2n); + expect(await collectionFT.getBalance(targetToken.nestingAccount())).to.be.equal(7n); }); itSub('Fungible: allows an Owner to nest/unnest their token (Restricted nesting)', async ({helper}) => { @@ -273,20 +273,20 @@ describe('Integration Test: Various token type nesting', () => { await collectionNFT.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true, restricted:[collectionFT.collectionId]}}); await collectionNFT.addToAllowList(alice, {Substrate: charlie.address}); - await collectionNFT.addToAllowList(alice, targetToken.nestingAddress()); + await collectionNFT.addToAllowList(alice, targetToken.nestingAccount()); await collectionFT.setPermissions(alice, {access: 'AllowList', mintMode: true}); await collectionFT.addToAllowList(alice, {Substrate: charlie.address}); - await collectionFT.addToAllowList(alice, targetToken.nestingAddress()); + await collectionFT.addToAllowList(alice, targetToken.nestingAccount()); // Create an immediately nested token - await collectionFT.mint(charlie, 5n, targetToken.nestingAddress()); - expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(5n); + await collectionFT.mint(charlie, 5n, targetToken.nestingAccount()); + expect(await collectionFT.getBalance(targetToken.nestingAccount())).to.be.equal(5n); // Create a token to be nested and nest await collectionFT.mint(charlie, 5n); - await collectionFT.transfer(charlie, targetToken.nestingAddress(), 2n); - expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(7n); + await collectionFT.transfer(charlie, targetToken.nestingAccount(), 2n); + expect(await collectionFT.getBalance(targetToken.nestingAccount())).to.be.equal(7n); }); // ---------- Re-Fungible ---------- @@ -297,20 +297,20 @@ describe('Integration Test: Various token type nesting', () => { const targetToken = await collectionNFT.mintToken(alice, {Substrate: charlie.address}); await collectionNFT.addToAllowList(alice, {Substrate: charlie.address}); - await collectionNFT.addToAllowList(alice, targetToken.nestingAddress()); + await collectionNFT.addToAllowList(alice, targetToken.nestingAccount()); await collectionRFT.setPermissions(alice, {access: 'AllowList', mintMode: true}); await collectionRFT.addToAllowList(alice, {Substrate: charlie.address}); - await collectionRFT.addToAllowList(alice, targetToken.nestingAddress()); + await collectionRFT.addToAllowList(alice, targetToken.nestingAccount()); // Create an immediately nested token - const nestedToken = await collectionRFT.mintToken(charlie, 5n, targetToken.nestingAddress()); - expect(await nestedToken.getBalance(targetToken.nestingAddress())).to.be.equal(5n); + const nestedToken = await collectionRFT.mintToken(charlie, 5n, targetToken.nestingAccount()); + expect(await nestedToken.getBalance(targetToken.nestingAccount())).to.be.equal(5n); // Create a token to be nested and nest const newToken = await collectionRFT.mintToken(charlie, 5n); - await newToken.transfer(charlie, targetToken.nestingAddress(), 2n); - expect(await newToken.getBalance(targetToken.nestingAddress())).to.be.equal(2n); + await newToken.transfer(charlie, targetToken.nestingAccount(), 2n); + expect(await newToken.getBalance(targetToken.nestingAccount())).to.be.equal(2n); }); itSub.ifWithPallets('ReFungible: allows an Owner to nest/unnest their token (Restricted nesting)', [Pallets.ReFungible], async ({helper}) => { @@ -320,20 +320,20 @@ describe('Integration Test: Various token type nesting', () => { await collectionNFT.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true, restricted:[collectionRFT.collectionId]}}); await collectionNFT.addToAllowList(alice, {Substrate: charlie.address}); - await collectionNFT.addToAllowList(alice, targetToken.nestingAddress()); + await collectionNFT.addToAllowList(alice, targetToken.nestingAccount()); await collectionRFT.setPermissions(alice, {access: 'AllowList', mintMode: true}); await collectionRFT.addToAllowList(alice, {Substrate: charlie.address}); - await collectionRFT.addToAllowList(alice, targetToken.nestingAddress()); + await collectionRFT.addToAllowList(alice, targetToken.nestingAccount()); // Create an immediately nested token - const nestedToken = await collectionRFT.mintToken(charlie, 5n, targetToken.nestingAddress()); - expect(await nestedToken.getBalance(targetToken.nestingAddress())).to.be.equal(5n); + const nestedToken = await collectionRFT.mintToken(charlie, 5n, targetToken.nestingAccount()); + expect(await nestedToken.getBalance(targetToken.nestingAccount())).to.be.equal(5n); // Create a token to be nested and nest const newToken = await collectionRFT.mintToken(charlie, 5n); - await newToken.transfer(charlie, targetToken.nestingAddress(), 2n); - expect(await newToken.getBalance(targetToken.nestingAddress())).to.be.equal(2n); + await newToken.transfer(charlie, targetToken.nestingAccount(), 2n); + expect(await newToken.getBalance(targetToken.nestingAccount())).to.be.equal(2n); }); }); @@ -356,11 +356,11 @@ describe('Negative Test: Nesting', () => { // Create a nested-token matryoshka for (let i = 0; i < maxNestingLevel; i++) { - token = await collection.mintToken(alice, token.nestingAddress()); + token = await collection.mintToken(alice, token.nestingAccount()); } // The nesting depth is limited by `maxNestingLevel` - await expect(collection.mintToken(alice, token.nestingAddress())) + await expect(collection.mintToken(alice, token.nestingAccount())) .to.be.rejectedWith(/structure\.DepthLimit/); expect(await token.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address}); expect(await token.getChildren()).to.be.length(0); @@ -374,7 +374,7 @@ describe('Negative Test: Nesting', () => { const targetToken = await collection.mintToken(alice); // Try to create an immediately nested token as collection admin when it's disallowed - await expect(collection.mintToken(bob, targetToken.nestingAddress())) + await expect(collection.mintToken(bob, targetToken.nestingAccount())) .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); // Try to create a token to be nested and nest @@ -390,10 +390,10 @@ describe('Negative Test: Nesting', () => { const collection = await helper.nft.mintCollection(alice, {permissions: {access: 'AllowList', mintMode: true, nesting: {collectionAdmin: true}}}); const targetToken = await collection.mintToken(alice, {Substrate: bob.address}); await collection.addToAllowList(alice, {Substrate: bob.address}); - await collection.addToAllowList(alice, targetToken.nestingAddress()); + await collection.addToAllowList(alice, targetToken.nestingAccount()); // Try to create a nested token as token owner when it's disallowed - await expect(collection.mintToken(bob, targetToken.nestingAddress())) + await expect(collection.mintToken(bob, targetToken.nestingAccount())) .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); // Try to create a token to be nested and nest @@ -410,7 +410,7 @@ describe('Negative Test: Nesting', () => { //await collection.addAdmin(alice, {Substrate: bob.address}); const targetToken = await collection.mintToken(alice, {Substrate: bob.address}); await collection.addToAllowList(alice, {Substrate: bob.address}); - await collection.addToAllowList(alice, targetToken.nestingAddress()); + await collection.addToAllowList(alice, targetToken.nestingAccount()); // Try to nest somebody else's token const newToken = await collection.mintToken(bob); @@ -418,13 +418,13 @@ describe('Negative Test: Nesting', () => { .to.be.rejectedWith(/common\.NoPermission/); // Try to unnest a token belonging to someone else as collection admin - const nestedToken = await collection.mintToken(alice, targetToken.nestingAddress()); + const nestedToken = await collection.mintToken(alice, targetToken.nestingAccount()); await expect(nestedToken.unnest(alice, targetToken, {Substrate: bob.address})) .to.be.rejectedWith(/common\.AddressNotInAllowlist/); expect(await targetToken.getChildren()).to.be.length(1); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); }); itSub('Admin (NFT): disallows an Admin to nest a token from an unlisted collection (Restricted nesting)', async ({helper}) => { @@ -434,7 +434,7 @@ describe('Negative Test: Nesting', () => { const targetToken = await collectionA.mintToken(alice); // Try to create a nested token from another collection - await expect(collectionB.mintToken(alice, targetToken.nestingAddress())) + await expect(collectionB.mintToken(alice, targetToken.nestingAccount())) .to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); // Create a token in another collection yet to be nested and try to nest @@ -454,7 +454,7 @@ describe('Negative Test: Nesting', () => { const targetToken = await collection.mintToken(alice); // Try to create a nested token as token owner when it's disallowed - await expect(collection.mintToken(alice, targetToken.nestingAddress())) + await expect(collection.mintToken(alice, targetToken.nestingAccount())) .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); // Try to create a token to be nested and nest @@ -472,7 +472,7 @@ describe('Negative Test: Nesting', () => { await collection.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true}}); await collection.addToAllowList(alice, {Substrate: bob.address}); - await collection.addToAllowList(alice, targetToken.nestingAddress()); + await collection.addToAllowList(alice, targetToken.nestingAccount()); // Try to create a token to be nested and nest const newToken = await collection.mintToken(alice); @@ -488,11 +488,11 @@ describe('Negative Test: Nesting', () => { await collection.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true}}); await collection.addToAllowList(alice, {Substrate: bob.address}); - await collection.addToAllowList(alice, targetToken.nestingAddress()); + await collection.addToAllowList(alice, targetToken.nestingAccount()); const collectionB = await helper.nft.mintCollection(alice, {permissions: {access: 'AllowList', mintMode: true}}); await collectionB.addToAllowList(alice, {Substrate: bob.address}); - await collectionB.addToAllowList(alice, targetToken.nestingAddress()); + await collectionB.addToAllowList(alice, targetToken.nestingAccount()); // Try to create a token to be nested and nest const newToken = await collectionB.mintToken(alice); @@ -508,10 +508,10 @@ describe('Negative Test: Nesting', () => { const targetToken = await collection.mintToken(alice, {Substrate: bob.address}); await collection.addToAllowList(alice, {Substrate: bob.address}); - await collection.addToAllowList(alice, targetToken.nestingAddress()); + await collection.addToAllowList(alice, targetToken.nestingAccount()); // Try to mint in own collection after allowlisting the accounts - await expect(collection.mintToken(bob, targetToken.nestingAddress())) + await expect(collection.mintToken(bob, targetToken.nestingAccount())) .to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); }); @@ -523,12 +523,12 @@ describe('Negative Test: Nesting', () => { const targetToken = await collectionNFT.mintToken(alice); // Try to create an immediately nested token - await expect(collectionFT.mint(alice, 5n, targetToken.nestingAddress())) + await expect(collectionFT.mint(alice, 5n, targetToken.nestingAccount())) .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); // Try to create a token to be nested and nest await collectionFT.mint(alice, 5n); - await expect(collectionFT.transfer(alice, targetToken.nestingAddress(), 2n)) + await expect(collectionFT.transfer(alice, targetToken.nestingAccount(), 2n)) .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); expect(await collectionFT.getBalance({Substrate: alice.address})).to.be.equal(5n); }); @@ -539,12 +539,12 @@ describe('Negative Test: Nesting', () => { const targetToken = await collectionNFT.mintToken(alice, {Substrate: bob.address}); // Nest some tokens as Alice into Bob's token - await collectionFT.mint(alice, 5n, targetToken.nestingAddress()); + await collectionFT.mint(alice, 5n, targetToken.nestingAccount()); // Try to pull it out - await expect(collectionFT.transferFrom(alice, targetToken.nestingAddress(), {Substrate: bob.address}, 1n)) + await expect(collectionFT.transferFrom(alice, targetToken.nestingAccount(), {Substrate: bob.address}, 1n)) .to.be.rejectedWith(/common\.ApprovedValueTooLow/); - expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(5n); + expect(await collectionFT.getBalance(targetToken.nestingAccount())).to.be.equal(5n); }); itSub('Fungible: disallows a non-Owner to unnest someone else\'s token (Restricted nesting)', async ({helper}) => { @@ -555,12 +555,12 @@ describe('Negative Test: Nesting', () => { await collectionNFT.setPermissions(alice, {nesting: {collectionAdmin: true, tokenOwner: true, restricted: [collectionFT.collectionId]}}); // Nest some tokens as Alice into Bob's token - await collectionFT.mint(alice, 5n, targetToken.nestingAddress()); + await collectionFT.mint(alice, 5n, targetToken.nestingAccount()); // Try to pull it out as Alice still - await expect(collectionFT.transferFrom(alice, targetToken.nestingAddress(), {Substrate: bob.address}, 1n)) + await expect(collectionFT.transferFrom(alice, targetToken.nestingAccount(), {Substrate: bob.address}, 1n)) .to.be.rejectedWith(/common\.ApprovedValueTooLow/); - expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(5n); + expect(await collectionFT.getBalance(targetToken.nestingAccount())).to.be.equal(5n); }); itSub('Fungible: disallows to nest token in an unlisted collection', async ({helper}) => { @@ -569,15 +569,15 @@ describe('Negative Test: Nesting', () => { const targetToken = await collectionNFT.mintToken(alice); // Try to mint an immediately nested token - await expect(collectionFT.mint(alice, 5n, targetToken.nestingAddress())) + await expect(collectionFT.mint(alice, 5n, targetToken.nestingAccount())) .to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); // Mint a token and try to nest it await collectionFT.mint(alice, 5n); - await expect(collectionFT.transfer(alice, targetToken.nestingAddress(), 1n)) + await expect(collectionFT.transfer(alice, targetToken.nestingAccount(), 1n)) .to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); - expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(0n); + expect(await collectionFT.getBalance(targetToken.nestingAccount())).to.be.equal(0n); expect(await collectionFT.getBalance({Substrate: alice.address})).to.be.equal(5n); }); @@ -589,12 +589,12 @@ describe('Negative Test: Nesting', () => { const targetToken = await collectionNFT.mintToken(alice); // Try to create an immediately nested token - await expect(collectionRFT.mintToken(alice, 5n, targetToken.nestingAddress())) + await expect(collectionRFT.mintToken(alice, 5n, targetToken.nestingAccount())) .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); // Try to create a token to be nested and nest const token = await collectionRFT.mintToken(alice, 5n); - await expect(token.transfer(alice, targetToken.nestingAddress(), 2n)) + await expect(token.transfer(alice, targetToken.nestingAccount(), 2n)) .to.be.rejectedWith(/common\.UserIsNotAllowedToNest/); expect(await token.getBalance({Substrate: alice.address})).to.be.equal(5n); }); @@ -606,22 +606,22 @@ describe('Negative Test: Nesting', () => { await collectionNFT.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true}}); await collectionNFT.addToAllowList(alice, {Substrate: bob.address}); - await collectionNFT.addToAllowList(alice, targetToken.nestingAddress()); + await collectionNFT.addToAllowList(alice, targetToken.nestingAccount()); // Try to create a token to be nested and nest const newToken = await collectionRFT.mintToken(alice); - await expect(newToken.transfer(bob, targetToken.nestingAddress())).to.be.rejectedWith(/common\.TokenValueTooLow/); + await expect(newToken.transfer(bob, targetToken.nestingAccount())).to.be.rejectedWith(/common\.TokenValueTooLow/); expect(await targetToken.getChildren()).to.be.length(0); expect(await newToken.getBalance({Substrate: alice.address})).to.be.equal(1n); // Nest some tokens as Alice into Bob's token - await newToken.transfer(alice, targetToken.nestingAddress()); + await newToken.transfer(alice, targetToken.nestingAccount()); // Try to pull it out - await expect(newToken.transferFrom(bob, targetToken.nestingAddress(), {Substrate: alice.address}, 1n)) + await expect(newToken.transferFrom(bob, targetToken.nestingAccount(), {Substrate: alice.address}, 1n)) .to.be.rejectedWith(/common\.ApprovedValueTooLow/); - expect(await newToken.getBalance(targetToken.nestingAddress())).to.be.equal(1n); + expect(await newToken.getBalance(targetToken.nestingAccount())).to.be.equal(1n); }); itSub.ifWithPallets('ReFungible: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', [Pallets.ReFungible], async ({helper}) => { @@ -631,22 +631,22 @@ describe('Negative Test: Nesting', () => { await collectionNFT.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {tokenOwner: true, restricted: [collectionRFT.collectionId]}}); await collectionNFT.addToAllowList(alice, {Substrate: bob.address}); - await collectionNFT.addToAllowList(alice, targetToken.nestingAddress()); + await collectionNFT.addToAllowList(alice, targetToken.nestingAccount()); // Try to create a token to be nested and nest const newToken = await collectionRFT.mintToken(alice); - await expect(newToken.transfer(bob, targetToken.nestingAddress())).to.be.rejectedWith(/common\.TokenValueTooLow/); + await expect(newToken.transfer(bob, targetToken.nestingAccount())).to.be.rejectedWith(/common\.TokenValueTooLow/); expect(await targetToken.getChildren()).to.be.length(0); expect(await newToken.getBalance({Substrate: alice.address})).to.be.equal(1n); // Nest some tokens as Alice into Bob's token - await newToken.transfer(alice, targetToken.nestingAddress()); + await newToken.transfer(alice, targetToken.nestingAccount()); // Try to pull it out - await expect(newToken.transferFrom(bob, targetToken.nestingAddress(), {Substrate: alice.address}, 1n)) + await expect(newToken.transferFrom(bob, targetToken.nestingAccount(), {Substrate: alice.address}, 1n)) .to.be.rejectedWith(/common\.ApprovedValueTooLow/); - expect(await newToken.getBalance(targetToken.nestingAddress())).to.be.equal(1n); + expect(await newToken.getBalance(targetToken.nestingAccount())).to.be.equal(1n); }); itSub.ifWithPallets('ReFungible: disallows to nest token to an unlisted collection', [Pallets.ReFungible], async ({helper}) => { @@ -655,12 +655,12 @@ describe('Negative Test: Nesting', () => { const targetToken = await collectionNFT.mintToken(alice); // Try to create an immediately nested token - await expect(collectionRFT.mintToken(alice, 5n, targetToken.nestingAddress())) + await expect(collectionRFT.mintToken(alice, 5n, targetToken.nestingAccount())) .to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); // Try to create a token to be nested and nest const token = await collectionRFT.mintToken(alice, 5n); - await expect(token.transfer(alice, targetToken.nestingAddress(), 2n)) + await expect(token.transfer(alice, targetToken.nestingAccount(), 2n)) .to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/); expect(await token.getBalance({Substrate: alice.address})).to.be.equal(5n); }); diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index 7ccfaa505d..d6bd7731d0 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -651,7 +651,7 @@ describe('Integration Test: Token Properties', () => { const collectionA = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); const collectionB = await helper.nft.mintCollection(alice); const targetToken = await collectionA.mintToken(alice); - const nestedToken = await collectionB.mintToken(alice, targetToken.nestingAddress()); + const nestedToken = await collectionB.mintToken(alice, targetToken.nestingAccount()); await collectionB.addAdmin(alice, {Substrate: bob.address}); await targetToken.transfer(alice, {Substrate: charlie.address}); @@ -692,7 +692,7 @@ describe('Integration Test: Token Properties', () => { const collectionA = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); const collectionB = await helper.nft.mintCollection(alice); const targetToken = await collectionA.mintToken(alice); - const nestedToken = await collectionB.mintToken(alice, targetToken.nestingAddress()); + const nestedToken = await collectionB.mintToken(alice, targetToken.nestingAccount()); await collectionB.addAdmin(alice, {Substrate: bob.address}); await targetToken.transfer(alice, {Substrate: charlie.address}); @@ -739,7 +739,7 @@ describe('Integration Test: Token Properties', () => { const collectionA = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); const collectionB = await helper.nft.mintCollection(alice); const targetToken = await collectionA.mintToken(alice); - const nestedToken = await collectionB.mintToken(alice, targetToken.nestingAddress()); + const nestedToken = await collectionB.mintToken(alice, targetToken.nestingAccount()); await collectionB.addAdmin(alice, {Substrate: bob.address}); await targetToken.transfer(alice, {Substrate: charlie.address}); diff --git a/tests/src/nesting/unnest.test.ts b/tests/src/nesting/unnest.test.ts index a0977544f5..b30cb22578 100644 --- a/tests/src/nesting/unnest.test.ts +++ b/tests/src/nesting/unnest.test.ts @@ -32,15 +32,15 @@ describe('Integration Test: Unnesting', () => { const targetToken = await collection.mintToken(alice); // Create a nested token - const nestedToken = await collection.mintToken(alice, targetToken.nestingAddress()); + const nestedToken = await collection.mintToken(alice, targetToken.nestingAccount()); // Unnest - await expect(nestedToken.transferFrom(alice, targetToken.nestingAddress(), {Substrate: alice.address}), 'while unnesting').to.be.fulfilled; + await expect(nestedToken.transferFrom(alice, targetToken.nestingAccount(), {Substrate: alice.address}), 'while unnesting').to.be.fulfilled; expect(await nestedToken.getOwner()).to.be.deep.equal({Substrate: alice.address}); // Nest and burn await nestedToken.nest(alice, targetToken); - await expect(nestedToken.burnFrom(alice, targetToken.nestingAddress()), 'while burning').to.be.fulfilled; + await expect(nestedToken.burnFrom(alice, targetToken.nestingAccount()), 'while burning').to.be.fulfilled; await expect(nestedToken.getOwner()).to.be.rejected; }); @@ -51,16 +51,16 @@ describe('Integration Test: Unnesting', () => { const collectionFT = await helper.ft.mintCollection(alice); // Nest and unnest - await collectionFT.mint(alice, 10n, targetToken.nestingAddress()); - await expect(collectionFT.transferFrom(alice, targetToken.nestingAddress(), {Substrate: alice.address}, 9n), 'while unnesting').to.be.fulfilled; + await collectionFT.mint(alice, 10n, targetToken.nestingAccount()); + await expect(collectionFT.transferFrom(alice, targetToken.nestingAccount(), {Substrate: alice.address}, 9n), 'while unnesting').to.be.fulfilled; expect(await collectionFT.getBalance({Substrate: alice.address})).to.be.equal(9n); - expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(1n); + expect(await collectionFT.getBalance(targetToken.nestingAccount())).to.be.equal(1n); // Nest and burn - await collectionFT.transfer(alice, targetToken.nestingAddress(), 5n); - await expect(collectionFT.burnTokensFrom(alice, targetToken.nestingAddress(), 6n), 'while burning').to.be.fulfilled; + await collectionFT.transfer(alice, targetToken.nestingAccount(), 5n); + await expect(collectionFT.burnTokensFrom(alice, targetToken.nestingAccount(), 6n), 'while burning').to.be.fulfilled; expect(await collectionFT.getBalance({Substrate: alice.address})).to.be.equal(4n); - expect(await collectionFT.getBalance(targetToken.nestingAddress())).to.be.equal(0n); + expect(await collectionFT.getBalance(targetToken.nestingAccount())).to.be.equal(0n); expect(await targetToken.getChildren()).to.be.length(0); }); @@ -71,16 +71,16 @@ describe('Integration Test: Unnesting', () => { const collectionRFT = await helper.rft.mintCollection(alice); // Nest and unnest - const token = await collectionRFT.mintToken(alice, 10n, targetToken.nestingAddress()); - await expect(token.transferFrom(alice, targetToken.nestingAddress(), {Substrate: alice.address}, 9n), 'while unnesting').to.be.fulfilled; + const token = await collectionRFT.mintToken(alice, 10n, targetToken.nestingAccount()); + await expect(token.transferFrom(alice, targetToken.nestingAccount(), {Substrate: alice.address}, 9n), 'while unnesting').to.be.fulfilled; expect(await token.getBalance({Substrate: alice.address})).to.be.equal(9n); - expect(await token.getBalance(targetToken.nestingAddress())).to.be.equal(1n); + expect(await token.getBalance(targetToken.nestingAccount())).to.be.equal(1n); // Nest and burn - await token.transfer(alice, targetToken.nestingAddress(), 5n); - await expect(token.burnFrom(alice, targetToken.nestingAddress(), 6n), 'while burning').to.be.fulfilled; + await token.transfer(alice, targetToken.nestingAccount(), 5n); + await expect(token.burnFrom(alice, targetToken.nestingAccount(), 6n), 'while burning').to.be.fulfilled; expect(await token.getBalance({Substrate: alice.address})).to.be.equal(4n); - expect(await token.getBalance(targetToken.nestingAddress())).to.be.equal(0n); + expect(await token.getBalance(targetToken.nestingAccount())).to.be.equal(0n); expect(await targetToken.getChildren()).to.be.length(0); }); }); @@ -101,15 +101,15 @@ describe('Negative Test: Unnesting', () => { const targetToken = await collection.mintToken(alice); // Create a nested token - const nestedToken = await collection.mintToken(alice, targetToken.nestingAddress()); + const nestedToken = await collection.mintToken(alice, targetToken.nestingAccount()); // Try to unnest await expect(nestedToken.unnest(bob, targetToken, {Substrate: alice.address})).to.be.rejectedWith(/common\.ApprovedValueTooLow/); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); // Try to burn - await expect(nestedToken.burnFrom(bob, targetToken.nestingAddress())).to.be.rejectedWith(/common\.ApprovedValueTooLow/); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAddress()); + await expect(nestedToken.burnFrom(bob, targetToken.nestingAccount())).to.be.rejectedWith(/common\.ApprovedValueTooLow/); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); }); // todo another test for creating excessive depth matryoshka with Ethereum? @@ -120,7 +120,7 @@ describe('Negative Test: Unnesting', () => { const targetToken = await collection.mintToken(alice); // Fail to create a nested token ouroboros - const nestedToken = await collection.mintToken(alice, targetToken.nestingAddress()); + const nestedToken = await collection.mintToken(alice, targetToken.nestingAccount()); await expect(targetToken.nest(alice, nestedToken)).to.be.rejectedWith(/^structure\.OuroborosDetected$/); }); }); diff --git a/tests/src/util/playgrounds/types.ts b/tests/src/util/playgrounds/types.ts index 67f962fa3f..956f4b64ec 100644 --- a/tests/src/util/playgrounds/types.ts +++ b/tests/src/util/playgrounds/types.ts @@ -109,7 +109,6 @@ export interface ITokenPropertyPermission { export interface IToken { collectionId: number; tokenId: number; - //nestingAddress: () => {Ethereum: string}; } export interface IBlock { diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 669c1be785..443715db42 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -55,11 +55,11 @@ class UniqueUtil { RPC: 'rpc', }; - static getNestingTokenAddress(token: IToken) { - return {Ethereum: this.getNestingTokenAddressRaw(token).toLowerCase()}; + static getTokenAccount(token: IToken) { + return {Ethereum: this.getTokenAddress(token).toLowerCase()}; } - static getNestingTokenAddressRaw(token: IToken) { + static getTokenAddress(token: IToken) { return nesting.tokenIdToAddress(token.collectionId, token.tokenId); } @@ -1370,7 +1370,7 @@ class NFTGroup extends NFTnRFT { * @returns ```true``` if extrinsic success, otherwise ```false``` */ async nestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken): Promise { - const rootTokenAddress = this.helper.util.getNestingTokenAddress(rootTokenObj); + const rootTokenAddress = this.helper.util.getTokenAccount(rootTokenObj); const result = await this.transferToken(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress); if(!result) { throw Error('Unable to nest token!'); @@ -1388,7 +1388,7 @@ class NFTGroup extends NFTnRFT { * @returns ```true``` if extrinsic success, otherwise ```false``` */ async unnestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, toAddressObj: ICrossAccountId): Promise { - const rootTokenAddress = this.helper.util.getNestingTokenAddress(rootTokenObj); + const rootTokenAddress = this.helper.util.getTokenAccount(rootTokenObj); const result = await this.transferTokenFrom(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress, toAddressObj); if(!result) { throw Error('Unable to unnest token!'); @@ -2566,8 +2566,8 @@ export class UniqueTokenBase implements IToken { return await this.collection.deleteTokenProperties(signer, this.tokenId, propertyKeys); } - nestingAddress() { - return this.collection.helper.util.getNestingTokenAddress(this); + nestingAccount() { + return this.collection.helper.util.getTokenAccount(this); } } From 99f3d75dc724b7c79091d914224f63d74bad49fe Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 26 Sep 2022 14:52:57 +0300 Subject: [PATCH 0954/1274] burnItemEvent migrated --- tests/src/check-event/burnItemEvent.test.ts | 36 +++++++++------------ 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/tests/src/check-event/burnItemEvent.test.ts b/tests/src/check-event/burnItemEvent.test.ts index 39e2b261a8..2db596a43b 100644 --- a/tests/src/check-event/burnItemEvent.test.ts +++ b/tests/src/check-event/burnItemEvent.test.ts @@ -15,15 +15,11 @@ // along with Unique Network. If not, see . // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {createCollectionExpectSuccess, createItemExpectSuccess, uniqueEventMessage} from '../util/helpers'; +import {executeTransaction} from '../substrate/substrate-api'; +import {uniqueEventMessage} from '../util/helpers'; +import {usingPlaygrounds, expect, itSub} from '../util/playgrounds'; -chai.use(chaiAsPromised); -const expect = chai.expect; describe('Burn Item event ', () => { let alice: IKeyringPair; @@ -31,20 +27,20 @@ describe('Burn Item event ', () => { const checkTreasury = 'Deposit'; const checkSystem = 'ExtrinsicSuccess'; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); }); }); - it('Check event from burnItem(): ', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionID = await createCollectionExpectSuccess(); - const itemID = await createItemExpectSuccess(alice, collectionID, 'NFT'); - const burnItem = api.tx.unique.burnItem(collectionID, itemID, 1); - const events = await submitTransactionAsync(alice, burnItem); - const msg = JSON.stringify(uniqueEventMessage(events)); - expect(msg).to.be.contain(checkSection); - expect(msg).to.be.contain(checkTreasury); - expect(msg).to.be.contain(checkSystem); - }); + itSub('Check event from burnItem(): ', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}); + + const tx = helper.api!.tx.unique.burnItem(collection.collectionId, token.tokenId, 1); + const events = await executeTransaction(helper.api!, alice, tx); + const msg = JSON.stringify(uniqueEventMessage(events)); + expect(msg).to.be.contain(checkSection); + expect(msg).to.be.contain(checkTreasury); + expect(msg).to.be.contain(checkSystem); }); }); From 4801eabf3aa8a7ec7a4ac340491f58456262ca0d Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 26 Sep 2022 14:57:55 +0300 Subject: [PATCH 0955/1274] createCollectionEvent migrated --- .../check-event/createCollectionEvent.test.ts | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/tests/src/check-event/createCollectionEvent.test.ts b/tests/src/check-event/createCollectionEvent.test.ts index 7c97c9c3ab..8fad76a1b6 100644 --- a/tests/src/check-event/createCollectionEvent.test.ts +++ b/tests/src/check-event/createCollectionEvent.test.ts @@ -15,15 +15,10 @@ // along with Unique Network. If not, see . // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; +import {executeTransaction} from '../substrate/substrate-api'; import {uniqueEventMessage} from '../util/helpers'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {usingPlaygrounds, itSub, expect} from '../util/playgrounds'; describe('Create collection event ', () => { let alice: IKeyringPair; @@ -31,18 +26,18 @@ describe('Create collection event ', () => { const checkTreasury = 'Deposit'; const checkSystem = 'ExtrinsicSuccess'; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); }); }); - it('Check event from createCollection(): ', async () => { - await usingApi(async (api: ApiPromise) => { - const tx = api.tx.unique.createCollectionEx({name: [0x31], description: [0x32], tokenPrefix: '0x33', mode: 'NFT'}); - const events = await submitTransactionAsync(alice, tx); - const msg = JSON.stringify(uniqueEventMessage(events)); - expect(msg).to.be.contain(checkSection); - expect(msg).to.be.contain(checkTreasury); - expect(msg).to.be.contain(checkSystem); - }); + itSub('Check event from createCollection(): ', async ({helper}) => { + const api = helper.api!; + const tx = api.tx.unique.createCollectionEx({name: [0x31], description: [0x32], tokenPrefix: '0x33', mode: 'NFT'}); + const events = await executeTransaction(api, alice, tx); + const msg = JSON.stringify(uniqueEventMessage(events)); + expect(msg).to.be.contain(checkSection); + expect(msg).to.be.contain(checkTreasury); + expect(msg).to.be.contain(checkSystem); }); }); From 5861102c1fccb2143273ed20f8a6569f1b59c9d5 Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 26 Sep 2022 15:01:30 +0300 Subject: [PATCH 0956/1274] createItemEvent migrated --- tests/src/check-event/createItemEvent.test.ts | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/tests/src/check-event/createItemEvent.test.ts b/tests/src/check-event/createItemEvent.test.ts index 08ebee1a92..eb6f5569e9 100644 --- a/tests/src/check-event/createItemEvent.test.ts +++ b/tests/src/check-event/createItemEvent.test.ts @@ -15,15 +15,10 @@ // along with Unique Network. If not, see . // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {createCollectionExpectSuccess, uniqueEventMessage, normalizeAccountId} from '../util/helpers'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {executeTransaction} from '../substrate/substrate-api'; +import {uniqueEventMessage, normalizeAccountId} from '../util/helpers'; +import {itSub, usingPlaygrounds, expect} from '../util/playgrounds'; describe('Create Item event ', () => { let alice: IKeyringPair; @@ -31,19 +26,18 @@ describe('Create Item event ', () => { const checkTreasury = 'Deposit'; const checkSystem = 'ExtrinsicSuccess'; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); }); }); - it('Check event from createItem(): ', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionID = await createCollectionExpectSuccess(); - const createItem = api.tx.unique.createItem(collectionID, normalizeAccountId(alice.address), 'NFT'); - const events = await submitTransactionAsync(alice, createItem); - const msg = JSON.stringify(uniqueEventMessage(events)); - expect(msg).to.be.contain(checkSection); - expect(msg).to.be.contain(checkTreasury); - expect(msg).to.be.contain(checkSystem); - }); + itSub('Check event from createItem(): ', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const createItemTx = helper.api!.tx.unique.createItem(collection.collectionId, normalizeAccountId(alice.address), 'NFT'); + const events = await executeTransaction(helper.api!, alice, createItemTx); + const msg = JSON.stringify(uniqueEventMessage(events)); + expect(msg).to.be.contain(checkSection); + expect(msg).to.be.contain(checkTreasury); + expect(msg).to.be.contain(checkSystem); }); }); From 81a7dacce5bb9670f40da7469b25d92653d4cacf Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 26 Sep 2022 15:10:32 +0300 Subject: [PATCH 0957/1274] createMultipleItemsEvent migrated --- .../createMultipleItemsEvent.test.ts | 36 ++++++++----------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/tests/src/check-event/createMultipleItemsEvent.test.ts b/tests/src/check-event/createMultipleItemsEvent.test.ts index 899c4946e1..da7a52c696 100644 --- a/tests/src/check-event/createMultipleItemsEvent.test.ts +++ b/tests/src/check-event/createMultipleItemsEvent.test.ts @@ -15,15 +15,10 @@ // along with Unique Network. If not, see . // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {createCollectionExpectSuccess, uniqueEventMessage, normalizeAccountId} from '../util/helpers'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {executeTransaction} from '../substrate/substrate-api'; +import {uniqueEventMessage, normalizeAccountId} from '../util/helpers'; +import {usingPlaygrounds, itSub, expect} from '../util/playgrounds'; describe('Create Multiple Items Event event ', () => { let alice: IKeyringPair; @@ -31,20 +26,19 @@ describe('Create Multiple Items Event event ', () => { const checkTreasury = 'Deposit'; const checkSystem = 'ExtrinsicSuccess'; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); }); }); - it('Check event from createMultipleItems(): ', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionID = await createCollectionExpectSuccess(); - const args = [{NFT: {}}, {NFT: {}}, {NFT: {}}]; - const createMultipleItems = api.tx.unique.createMultipleItems(collectionID, normalizeAccountId(alice.address), args); - const events = await submitTransactionAsync(alice, createMultipleItems); - const msg = JSON.stringify(uniqueEventMessage(events)); - expect(msg).to.be.contain(checkSection); - expect(msg).to.be.contain(checkTreasury); - expect(msg).to.be.contain(checkSystem); - }); + itSub('Check event from createMultipleItems(): ', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const args = [{NFT: {}}, {NFT: {}}, {NFT: {}}]; + const createMultipleItemsTx = helper.api!.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args); + const events = await executeTransaction(helper.api!, alice, createMultipleItemsTx); + const msg = JSON.stringify(uniqueEventMessage(events)); + expect(msg).to.be.contain(checkSection); + expect(msg).to.be.contain(checkTreasury); + expect(msg).to.be.contain(checkSystem); }); }); From 6f2de8e52e3166991b0bf91f2b8a7b56602ec215 Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 26 Sep 2022 15:14:56 +0300 Subject: [PATCH 0958/1274] destroyCollectionEvent migrated --- .../destroyCollectionEvent.test.ts | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/tests/src/check-event/destroyCollectionEvent.test.ts b/tests/src/check-event/destroyCollectionEvent.test.ts index 7c97c42c6c..d80228447f 100644 --- a/tests/src/check-event/destroyCollectionEvent.test.ts +++ b/tests/src/check-event/destroyCollectionEvent.test.ts @@ -15,33 +15,28 @@ // along with Unique Network. If not, see . // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {createCollectionExpectSuccess, uniqueEventMessage} from '../util/helpers'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {executeTransaction} from '../substrate/substrate-api'; +import {uniqueEventMessage} from '../util/helpers'; +import {itSub, usingPlaygrounds, expect} from '../util/playgrounds'; describe('Destroy collection event ', () => { let alice: IKeyringPair; const checkTreasury = 'Deposit'; const checkSystem = 'ExtrinsicSuccess'; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); }); }); - it('Check event from destroyCollection(): ', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionID = await createCollectionExpectSuccess(); - const destroyCollection = api.tx.unique.destroyCollection(collectionID); - const events = await submitTransactionAsync(alice, destroyCollection); - const msg = JSON.stringify(uniqueEventMessage(events)); - expect(msg).to.be.contain(checkTreasury); - expect(msg).to.be.contain(checkSystem); - }); + + itSub('Check event from destroyCollection(): ', async ({helper}) => { + const {collectionId} = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const destroyCollectionTx = helper.api!.tx.unique.destroyCollection(collectionId); + const events = await executeTransaction(helper.api!, alice, destroyCollectionTx); + const msg = JSON.stringify(uniqueEventMessage(events)); + expect(msg).to.be.contain(checkTreasury); + expect(msg).to.be.contain(checkSystem); }); }); From 508677d90089c28bf3957806240f6885b8f73f5a Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 26 Sep 2022 15:20:50 +0300 Subject: [PATCH 0959/1274] transferEvent migrated --- tests/src/check-event/transferEvent.test.ts | 39 +++++++++------------ 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/tests/src/check-event/transferEvent.test.ts b/tests/src/check-event/transferEvent.test.ts index 3e8fbb39af..193a511671 100644 --- a/tests/src/check-event/transferEvent.test.ts +++ b/tests/src/check-event/transferEvent.test.ts @@ -15,15 +15,10 @@ // along with Unique Network. If not, see . // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {createCollectionExpectSuccess, createItemExpectSuccess, uniqueEventMessage, normalizeAccountId} from '../util/helpers'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {executeTransaction} from '../substrate/substrate-api'; +import {uniqueEventMessage, normalizeAccountId} from '../util/helpers'; +import {usingPlaygrounds, expect, itSub} from '../util/playgrounds'; describe('Transfer event ', () => { let alice: IKeyringPair; @@ -31,22 +26,22 @@ describe('Transfer event ', () => { const checkSection = 'Transfer'; const checkTreasury = 'Deposit'; const checkSystem = 'ExtrinsicSuccess'; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); }); }); - it('Check event from transfer(): ', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionID = await createCollectionExpectSuccess(); - const itemID = await createItemExpectSuccess(alice, collectionID, 'NFT'); - const transfer = api.tx.unique.transfer(normalizeAccountId(bob.address), collectionID, itemID, 1); - const events = await submitTransactionAsync(alice, transfer); - const msg = JSON.stringify(uniqueEventMessage(events)); - expect(msg).to.be.contain(checkSection); - expect(msg).to.be.contain(checkTreasury); - expect(msg).to.be.contain(checkSystem); - }); + + itSub('Check event from transfer(): ', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const {tokenId} = await collection.mintToken(alice, {Substrate: alice.address}); + const transferTx = helper.api!.tx.unique.transfer(normalizeAccountId(bob.address), collection.collectionId, tokenId, 1); + const events = await executeTransaction(helper.api!, alice, transferTx); + const msg = JSON.stringify(uniqueEventMessage(events)); + expect(msg).to.be.contain(checkSection); + expect(msg).to.be.contain(checkTreasury); + expect(msg).to.be.contain(checkSystem); }); }); From 076b5dc181efba926408e186aea1b55719d598d5 Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 26 Sep 2022 15:23:03 +0300 Subject: [PATCH 0960/1274] transferFromEvent migrated --- .../src/check-event/transferFromEvent.test.ts | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/tests/src/check-event/transferFromEvent.test.ts b/tests/src/check-event/transferFromEvent.test.ts index c4cd4480b7..e784b0946a 100644 --- a/tests/src/check-event/transferFromEvent.test.ts +++ b/tests/src/check-event/transferFromEvent.test.ts @@ -15,38 +15,33 @@ // along with Unique Network. If not, see . // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {createCollectionExpectSuccess, createItemExpectSuccess, uniqueEventMessage, normalizeAccountId} from '../util/helpers'; +import {executeTransaction} from '../substrate/substrate-api'; +import {uniqueEventMessage, normalizeAccountId} from '../util/helpers'; +import {usingPlaygrounds, expect, itSub} from '../util/playgrounds'; -chai.use(chaiAsPromised); -const expect = chai.expect; - -describe('Transfer from event ', () => { +describe('Transfer event ', () => { let alice: IKeyringPair; let bob: IKeyringPair; const checkSection = 'Transfer'; const checkTreasury = 'Deposit'; const checkSystem = 'ExtrinsicSuccess'; + before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); }); }); - it('Check event from transferFrom(): ', async () => { - await usingApi(async (api: ApiPromise) => { - const collectionID = await createCollectionExpectSuccess(); - const itemID = await createItemExpectSuccess(alice, collectionID, 'NFT'); - const transferFrom = api.tx.unique.transferFrom(normalizeAccountId(alice.address), normalizeAccountId(bob.address), collectionID, itemID, 1); - const events = await submitTransactionAsync(alice, transferFrom); - const msg = JSON.stringify(uniqueEventMessage(events)); - expect(msg).to.be.contain(checkSection); - expect(msg).to.be.contain(checkTreasury); - expect(msg).to.be.contain(checkSystem); - }); + + itSub('Check event from transfer(): ', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const {tokenId} = await collection.mintToken(alice, {Substrate: alice.address}); + const transferTx = helper.api!.tx.unique.transferFrom(normalizeAccountId(alice.address), normalizeAccountId(bob.address), collection.collectionId, tokenId, 1); + const events = await executeTransaction(helper.api!, alice, transferTx); + const msg = JSON.stringify(uniqueEventMessage(events)); + expect(msg).to.be.contain(checkSection); + expect(msg).to.be.contain(checkTreasury); + expect(msg).to.be.contain(checkSystem); }); }); From bebe7844b72b8b098b607cbeaaaf016e7244e051 Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 26 Sep 2022 16:17:36 +0300 Subject: [PATCH 0961/1274] eth/allowList migrated --- tests/src/eth/allowlist.test.ts | 66 +++++++++++++++------------------ 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/tests/src/eth/allowlist.test.ts b/tests/src/eth/allowlist.test.ts index 6a354deaa6..389a20d043 100644 --- a/tests/src/eth/allowlist.test.ts +++ b/tests/src/eth/allowlist.test.ts @@ -15,26 +15,21 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {expect} from 'chai'; -import {isAllowlisted, normalizeAccountId} from '../util/helpers'; -import { - contractHelpers, - createEthAccount, - createEthAccountWithBalance, - deployFlipper, - evmCollection, - evmCollectionHelpers, - getCollectionAddressFromResult, - itWeb3, -} from './util/helpers'; -import {itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {itEth, usingEthPlaygrounds, expect} from './util/playgrounds'; describe('EVM contract allowlist', () => { - itWeb3('Contract allowlist can be toggled', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); - const helpers = contractHelpers(web3, owner); + itEth('Contract allowlist can be toggled', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const flipper = await helper.eth.deployFlipper(owner); + const helpers = helper.ethNativeContract.contractHelpers(owner); // Any user is allowed by default expect(await helpers.methods.allowlistEnabled(flipper.options.address).call()).to.be.false; @@ -48,12 +43,11 @@ describe('EVM contract allowlist', () => { expect(await helpers.methods.allowlistEnabled(flipper.options.address).call()).to.be.false; }); - itWeb3('Non-allowlisted user can\'t call contract with allowlist enabled', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - - const helpers = contractHelpers(web3, owner); + itEth('Non-allowlisted user can\'t call contract with allowlist enabled', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const caller = await helper.eth.createAccountWithBalance(donor); + const flipper = await helper.eth.deployFlipper(owner); + const helpers = helper.ethNativeContract.contractHelpers(owner); // User can flip with allowlist disabled await flipper.methods.flip().send({from: caller}); @@ -79,18 +73,18 @@ describe('EVM collection allowlist', () => { donor = privateKey('//Alice'); }); }); - + itEth('Collection allowlist can be added and removed by [eth] address', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const user = helper.eth.createAccount(); - + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - + expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner}); expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.true; - + await collectionEvm.methods.removeFromCollectionAllowList(user).send({from: owner}); expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; }); @@ -98,14 +92,14 @@ describe('EVM collection allowlist', () => { itEth('Collection allowlist can be added and removed by [sub] address', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const user = donor; - + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - + expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; - + await collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; }); @@ -114,15 +108,15 @@ describe('EVM collection allowlist', () => { const owner = await helper.eth.createAccountWithBalance(donor); const notOwner = await helper.eth.createAccountWithBalance(donor); const user = helper.eth.createAccount(); - + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - + expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; await expect(collectionEvm.methods.addToCollectionAllowList(user).call({from: notOwner})).to.be.rejectedWith('NoPermission'); expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner}); - + expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.true; await expect(collectionEvm.methods.removeFromCollectionAllowList(user).call({from: notOwner})).to.be.rejectedWith('NoPermission'); expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.true; @@ -132,15 +126,15 @@ describe('EVM collection allowlist', () => { const owner = await helper.eth.createAccountWithBalance(donor); const notOwner = await helper.eth.createAccountWithBalance(donor); const user = donor; - + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - + expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; await expect(collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); - + expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; await expect(collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; From f0eacde65dd959804b1bca842d04304bf58cbb3c Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 26 Sep 2022 17:54:29 +0300 Subject: [PATCH 0962/1274] wip: collectionAdmin migrating --- tests/src/eth/collectionAdmin.test.ts | 102 +++++++++++++------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index 5f5f5e9b37..dda531d368 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -13,59 +13,59 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {expect} from 'chai'; +import {IKeyringPair} from '@polkadot/types/types'; import privateKey from '../substrate/privateKey'; import {UNIQUE} from '../util/helpers'; import { createEthAccount, - createEthAccountWithBalance, - evmCollection, - evmCollectionHelpers, - getCollectionAddressFromResult, + createEthAccountWithBalance, + evmCollection, + evmCollectionHelpers, + getCollectionAddressFromResult, itWeb3, recordEthFee, } from './util/helpers'; +import {usingEthPlaygrounds, itEth, expect} from './util/playgrounds'; describe('Add collection admins', () => { - itWeb3('Add admin by owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); + + itEth('Add admin by owner', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + + const newAdmin = helper.eth.createAccount(); - const newAdmin = createEthAccount(web3); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); await collectionEvm.methods.addCollectionAdmin(newAdmin).send(); - const adminList = await api.rpc.unique.adminlist(collectionId); + const adminList = await helper.api!.rpc.unique.adminlist(collectionId); expect(adminList[0].asEthereum.toString().toLocaleLowerCase()) .to.be.eq(newAdmin.toLocaleLowerCase()); }); - itWeb3('Add substrate admin by owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + itEth('Add substrate admin by owner', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - const newAdmin = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const [newAdmin] = await helper.arrange.createAccounts([10n], donor); await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send(); - const adminList = await api.rpc.unique.adminlist(collectionId); + const adminList = await helper.api!.rpc.unique.adminlist(collectionId); expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) .to.be.eq(newAdmin.address.toLocaleLowerCase()); }); - + itWeb3('Verify owner or admin', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelper = evmCollectionHelpers(web3, owner); - + const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') .send(); @@ -81,7 +81,7 @@ describe('Add collection admins', () => { itWeb3('(!negative tests!) Add admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelper = evmCollectionHelpers(web3, owner); - + const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') .send(); @@ -90,7 +90,7 @@ describe('Add collection admins', () => { const admin = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); await collectionEvm.methods.addCollectionAdmin(admin).send(); - + const user = createEthAccount(web3); await expect(collectionEvm.methods.addCollectionAdmin(user).call({from: admin})) .to.be.rejectedWith('NoPermission'); @@ -104,7 +104,7 @@ describe('Add collection admins', () => { itWeb3('(!negative tests!) Add admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelper = evmCollectionHelpers(web3, owner); - + const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') .send(); @@ -112,7 +112,7 @@ describe('Add collection admins', () => { const notAdmin = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - + const user = createEthAccount(web3); await expect(collectionEvm.methods.addCollectionAdmin(user).call({from: notAdmin})) .to.be.rejectedWith('NoPermission'); @@ -124,7 +124,7 @@ describe('Add collection admins', () => { itWeb3('(!negative tests!) Add substrate admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelper = evmCollectionHelpers(web3, owner); - + const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') .send(); @@ -143,11 +143,11 @@ describe('Add collection admins', () => { expect(adminList[0].asEthereum.toString().toLocaleLowerCase()) .to.be.eq(admin.toLocaleLowerCase()); }); - + itWeb3('(!negative tests!) Add substrate admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelper = evmCollectionHelpers(web3, owner); - + const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') .send(); @@ -168,7 +168,7 @@ describe('Remove collection admins', () => { itWeb3('Remove admin by owner', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelper = evmCollectionHelpers(web3, owner); - + const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') .send(); @@ -192,7 +192,7 @@ describe('Remove collection admins', () => { itWeb3('Remove substrate admin by owner', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelper = evmCollectionHelpers(web3, owner); - + const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') .send(); @@ -206,7 +206,7 @@ describe('Remove collection admins', () => { expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) .to.be.eq(newAdmin.address.toLocaleLowerCase()); } - + await collectionEvm.methods.removeCollectionAdminSubstrate(newAdmin.addressRaw).send(); const adminList = await api.rpc.unique.adminlist(collectionId); expect(adminList.length).to.be.eq(0); @@ -215,7 +215,7 @@ describe('Remove collection admins', () => { itWeb3('(!negative tests!) Remove admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelper = evmCollectionHelpers(web3, owner); - + const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') .send(); @@ -242,7 +242,7 @@ describe('Remove collection admins', () => { itWeb3('(!negative tests!) Remove admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelper = evmCollectionHelpers(web3, owner); - + const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') .send(); @@ -267,7 +267,7 @@ describe('Remove collection admins', () => { itWeb3('(!negative tests!) Remove substrate admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelper = evmCollectionHelpers(web3, owner); - + const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') .send(); @@ -292,7 +292,7 @@ describe('Remove collection admins', () => { itWeb3('(!negative tests!) Remove substrate admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelper = evmCollectionHelpers(web3, owner); - + const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') .send(); @@ -323,9 +323,9 @@ describe('Change owner tests', () => { .send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - + await collectionEvm.methods.setOwner(newOwner).send(); - + expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.false; expect(await collectionEvm.methods.isOwnerOrAdmin(newOwner).call()).to.be.true; }); @@ -354,7 +354,7 @@ describe('Change owner tests', () => { .send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - + await expect(collectionEvm.methods.setOwner(newOwner).send({from: newOwner})).to.be.rejected; expect(await collectionEvm.methods.isOwnerOrAdmin(newOwner).call()).to.be.false; }); @@ -370,12 +370,12 @@ describe('Change substrate owner tests', () => { .send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - + expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.true; expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; - + await collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send(); - + expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.false; expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.true; }); @@ -405,8 +405,8 @@ describe('Change substrate owner tests', () => { .send(); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - + await expect(collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send({from: otherReceiver})).to.be.rejected; expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; }); -}); \ No newline at end of file +}); From 415e2e02d9147197d03ed790f85fcd67a36bb0ec Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Tue, 27 Sep 2022 07:57:48 +0000 Subject: [PATCH 0963/1274] tests(nesting+properties): collection and token interfaces + make lower case not default for token addresses + more consts from old helpers included --- tests/src/fungible.test.ts | 4 +- tests/src/nesting/graphs.test.ts | 5 +- tests/src/nesting/nest.test.ts | 34 +++--- tests/src/nesting/properties.test.ts | 61 +++++----- tests/src/nesting/unnest.test.ts | 4 +- tests/src/util/playgrounds/index.ts | 8 +- tests/src/util/playgrounds/types.ts | 169 ++++++++++++++++++++++++++- tests/src/util/playgrounds/unique.ts | 102 ++++++++-------- 8 files changed, 279 insertions(+), 108 deletions(-) diff --git a/tests/src/fungible.test.ts b/tests/src/fungible.test.ts index 5fdf0ecd4d..d9c2fbe687 100644 --- a/tests/src/fungible.test.ts +++ b/tests/src/fungible.test.ts @@ -15,9 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; - -const U128_MAX = (1n << 128n) - 1n; +import {itSub, usingPlaygrounds, expect, U128_MAX} from './util/playgrounds'; describe('integration test: Fungible functionality:', () => { let alice: IKeyringPair; diff --git a/tests/src/nesting/graphs.test.ts b/tests/src/nesting/graphs.test.ts index 8849444c69..e6976be8b0 100644 --- a/tests/src/nesting/graphs.test.ts +++ b/tests/src/nesting/graphs.test.ts @@ -16,7 +16,8 @@ import {IKeyringPair} from '@polkadot/types/types'; import {expect, itSub, usingPlaygrounds} from '../util/playgrounds'; -import {UniqueHelper, UniqueNFTToken} from '../util/playgrounds/unique'; +import {ITokenNonfungible} from '../util/playgrounds/types'; +import {UniqueHelper} from '../util/playgrounds/unique'; /** * ```dot @@ -25,7 +26,7 @@ import {UniqueHelper, UniqueNFTToken} from '../util/playgrounds/unique'; * 8 -> 5 * ``` */ -async function buildComplexObjectGraph(helper: UniqueHelper, sender: IKeyringPair): Promise { +async function buildComplexObjectGraph(helper: UniqueHelper, sender: IKeyringPair): Promise { const collection = await helper.nft.mintCollection(sender, {permissions: {nesting: {tokenOwner: true}}}); const tokens = await collection.mintMultipleTokens(sender, Array(8).fill({owner: {Substrate: sender.address}})); diff --git a/tests/src/nesting/nest.test.ts b/tests/src/nesting/nest.test.ts index 04f4cd3822..c1232272f6 100644 --- a/tests/src/nesting/nest.test.ts +++ b/tests/src/nesting/nest.test.ts @@ -35,7 +35,7 @@ describe('Integration Test: Composite nesting tests', () => { // Create an immediately nested token const nestedToken = await collection.mintToken(alice, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); // Create a token to be nested const newToken = await collection.mintToken(alice); @@ -43,14 +43,14 @@ describe('Integration Test: Composite nesting tests', () => { // Nest await newToken.nest(alice, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); // Move bundle to different user await targetToken.transfer(alice, {Substrate: bob.address}); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); // Unnest await newToken.unnest(bob, targetToken, {Substrate: bob.address}); @@ -65,12 +65,12 @@ describe('Integration Test: Composite nesting tests', () => { // Create a nested token const tokenC = await collection.mintToken(alice, tokenA.nestingAccount()); - expect(await tokenC.getOwner()).to.be.deep.equal(tokenA.nestingAccount()); + expect(await tokenC.getOwner()).to.be.deep.equal(tokenA.nestingAccountInLowerCase()); // Transfer the nested token to another token await expect(tokenC.transferFrom(alice, tokenA.nestingAccount(), tokenB.nestingAccount())).to.be.fulfilled; expect(await tokenC.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address}); - expect(await tokenC.getOwner()).to.be.deep.equal(tokenB.nestingAccount()); + expect(await tokenC.getOwner()).to.be.deep.equal(tokenB.nestingAccountInLowerCase()); }); itSub('Checks token children', async ({helper}) => { @@ -150,13 +150,13 @@ describe('Integration Test: Various token type nesting', () => { // Create an immediately nested token const nestedToken = await collection.mintToken(bob, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); // Create a token to be nested and nest const newToken = await collection.mintToken(bob); await newToken.nest(bob, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); }); itSub('Admin (NFT): Admin and Token Owner can operate together', async ({helper}) => { @@ -167,13 +167,13 @@ describe('Integration Test: Various token type nesting', () => { // Create an immediately nested token by an administrator const nestedToken = await collection.mintToken(bob, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); // Create a token to be nested and nest const newToken = await collection.mintToken(alice, {Substrate: charlie.address}); await newToken.nest(charlie, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); }); itSub('Admin (NFT): allows an Admin to nest a token (Restricted nesting)', async ({helper}) => { @@ -187,13 +187,13 @@ describe('Integration Test: Various token type nesting', () => { // Create an immediately nested token const nestedToken = await collectionB.mintToken(bob, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); // Create a token to be nested and nest const newToken = await collectionB.mintToken(bob); await newToken.nest(bob, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); }); // ---------- Non-Fungible ---------- @@ -207,13 +207,13 @@ describe('Integration Test: Various token type nesting', () => { // Create an immediately nested token const nestedToken = await collection.mintToken(charlie, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); // Create a token to be nested and nest const newToken = await collection.mintToken(charlie); await newToken.nest(charlie, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); }); itSub('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async ({helper}) => { @@ -233,13 +233,13 @@ describe('Integration Test: Various token type nesting', () => { // Create an immediately nested token const nestedToken = await collectionB.mintToken(charlie, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); // Create a token to be nested and nest const newToken = await collectionB.mintToken(charlie); await newToken.nest(charlie, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); }); // ---------- Fungible ---------- @@ -424,7 +424,7 @@ describe('Negative Test: Nesting', () => { expect(await targetToken.getChildren()).to.be.length(1); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); }); itSub('Admin (NFT): disallows an Admin to nest a token from an unlisted collection (Restricted nesting)', async ({helper}) => { diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index d6bd7731d0..515f5ad9a0 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -14,19 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -/*import usingApi, {executeTransaction} from '../substrate/substrate-api'; -import { - addCollectionAdminExpectSuccess, - CollectionMode, - createCollectionExpectSuccess, - setCollectionPermissionsExpectSuccess, - createItemExpectSuccess, - getCreateCollectionResult, - transferExpectSuccess, -} from '../util/helpers';*/ import {IKeyringPair} from '@polkadot/types/types'; import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../util/playgrounds'; -import {UniqueCollectionBase, UniqueHelper, UniqueNFTCollection, UniqueNFTToken, UniqueRFTCollection, UniqueRFTToken} from '../util/playgrounds/unique'; +import {ICollectionBase, ICollectionNFT, ITokenNonfungible, ICollectionRFT, ITokenRefungible} from '../util/playgrounds/types'; +import {UniqueHelper} from '../util/playgrounds/unique'; // ---------- COLLECTION PROPERTIES @@ -46,7 +37,7 @@ describe('Integration Test: Collection Properties', () => { expect(await collection.getProperties()).to.be.empty; }); - async function testSetsPropertiesForCollection(collection: UniqueCollectionBase) { + async function testSetsPropertiesForCollection(collection: ICollectionBase) { // As owner await expect(collection.setProperties(alice, [{key: 'electron', value: 'come bond'}])).to.be.fulfilled; @@ -70,7 +61,7 @@ describe('Integration Test: Collection Properties', () => { await testSetsPropertiesForCollection(await helper.rft.mintCollection(alice)); }); - async function testCheckValidNames(collection: UniqueCollectionBase) { + async function testCheckValidNames(collection: ICollectionBase) { // alpha symbols await expect(collection.setProperties(alice, [{key: 'answer'}])).to.be.fulfilled; @@ -104,7 +95,7 @@ describe('Integration Test: Collection Properties', () => { await testCheckValidNames(await helper.rft.mintCollection(alice)); }); - async function testChangesProperties(collection: UniqueCollectionBase) { + async function testChangesProperties(collection: ICollectionBase) { await expect(collection.setProperties(alice, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: ''}])).to.be.fulfilled; // Mutate the properties @@ -125,7 +116,7 @@ describe('Integration Test: Collection Properties', () => { await testChangesProperties(await helper.rft.mintCollection(alice)); }); - async function testDeleteProperties(collection: UniqueCollectionBase) { + async function testDeleteProperties(collection: ICollectionBase) { await expect(collection.setProperties(alice, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: 'LIGO'}])).to.be.fulfilled; await expect(collection.deleteProperties(alice, ['electron'])).to.be.fulfilled; @@ -156,7 +147,7 @@ describe('Negative Integration Test: Collection Properties', () => { }); }); - async function testFailsSetPropertiesIfNotOwnerOrAdmin(collection: UniqueCollectionBase) { + async function testFailsSetPropertiesIfNotOwnerOrAdmin(collection: ICollectionBase) { await expect(collection.setProperties(bob, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: 'LIGO'}])) .to.be.rejectedWith(/common\.NoPermission/); @@ -171,7 +162,7 @@ describe('Negative Integration Test: Collection Properties', () => { await testFailsSetPropertiesIfNotOwnerOrAdmin(await helper.rft.mintCollection(alice)); }); - async function testFailsSetPropertiesThatExeedLimits(collection: UniqueCollectionBase) { + async function testFailsSetPropertiesThatExeedLimits(collection: ICollectionBase) { const spaceLimit = (await (collection.helper!.api! as any).query.common.collectionProperties(collection.collectionId)).spaceLimit.toNumber(); // Mute the general tx parsing error, too many bytes to process @@ -200,7 +191,7 @@ describe('Negative Integration Test: Collection Properties', () => { await testFailsSetPropertiesThatExeedLimits(await helper.rft.mintCollection(alice)); }); - async function testFailsSetMorePropertiesThanAllowed(collection: UniqueCollectionBase) { + async function testFailsSetMorePropertiesThanAllowed(collection: ICollectionBase) { const propertiesToBeSet = []; for (let i = 0; i < 65; i++) { propertiesToBeSet.push({ @@ -223,7 +214,7 @@ describe('Negative Integration Test: Collection Properties', () => { await testFailsSetMorePropertiesThanAllowed(await helper.rft.mintCollection(alice)); }); - async function testFailsSetPropertiesWithInvalidNames(collection: UniqueCollectionBase) { + async function testFailsSetPropertiesWithInvalidNames(collection: ICollectionBase) { const invalidProperties = [ [{key: 'electron', value: 'negative'}, {key: 'string theory', value: 'understandable'}], [{key: 'Mr/Sandman', value: 'Bring me a gene'}], @@ -290,7 +281,7 @@ describe('Integration Test: Access Rights to Token Properties', () => { expect(propertyRights).to.be.empty; }); - async function testSetsAccessRightsToProperties(collection: UniqueNFTCollection | UniqueRFTCollection) { + async function testSetsAccessRightsToProperties(collection: ICollectionNFT | ICollectionRFT) { await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: true}}])) .to.be.fulfilled; @@ -314,7 +305,7 @@ describe('Integration Test: Access Rights to Token Properties', () => { await testSetsAccessRightsToProperties(await helper.rft.mintCollection(alice)); }); - async function testChangesAccessRightsToProperty(collection: UniqueNFTCollection | UniqueRFTCollection) { + async function testChangesAccessRightsToProperty(collection: ICollectionNFT | ICollectionRFT) { await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: true, collectionAdmin: true}}])) .to.be.fulfilled; @@ -347,7 +338,7 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { }); }); - async function testPreventsFromSettingAccessRightsNotAdminOrOwner(collection: UniqueNFTCollection | UniqueRFTCollection) { + async function testPreventsFromSettingAccessRightsNotAdminOrOwner(collection: ICollectionNFT | ICollectionRFT) { await expect(collection.setTokenPropertyPermissions(bob, [{key: 'skullduggery', permission: {mutable: true, tokenOwner: true}}])) .to.be.rejectedWith(/common\.NoPermission/); @@ -363,7 +354,7 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { await testPreventsFromSettingAccessRightsNotAdminOrOwner(await helper.rft.mintCollection(alice)); }); - async function testPreventFromAddingTooManyPossibleProperties(collection: UniqueNFTCollection | UniqueRFTCollection) { + async function testPreventFromAddingTooManyPossibleProperties(collection: ICollectionNFT | ICollectionRFT) { const constitution = []; for (let i = 0; i < 65; i++) { constitution.push({ @@ -387,7 +378,7 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { await testPreventFromAddingTooManyPossibleProperties(await helper.rft.mintCollection(alice)); }); - async function testPreventAccessRightsModifiedIfConstant(collection: UniqueNFTCollection | UniqueRFTCollection) { + async function testPreventAccessRightsModifiedIfConstant(collection: ICollectionNFT | ICollectionRFT) { await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: false, tokenOwner: true}}])) .to.be.fulfilled; @@ -408,7 +399,7 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { await testPreventAccessRightsModifiedIfConstant(await helper.rft.mintCollection(alice)); }); - async function testPreventsAddingPropertiesWithInvalidNames(collection: UniqueNFTCollection | UniqueRFTCollection) { + async function testPreventsAddingPropertiesWithInvalidNames(collection: ICollectionNFT | ICollectionRFT) { const invalidProperties = [ [{key: 'skullduggery', permission: {tokenOwner: true}}, {key: 'im possible', permission: {collectionAdmin: true}}], [{key: 'G#4', permission: {tokenOwner: true}}], @@ -478,7 +469,7 @@ describe('Integration Test: Token Properties', () => { ]; }); - async function testReadsYetEmptyProperties(token: UniqueNFTToken | UniqueRFTToken) { + async function testReadsYetEmptyProperties(token: ITokenNonfungible | ITokenRefungible) { const properties = await token.getProperties(); expect(properties).to.be.empty; @@ -498,7 +489,7 @@ describe('Integration Test: Token Properties', () => { await testReadsYetEmptyProperties(token); }); - async function testAssignPropertiesAccordingToPermissions(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint) { + async function testAssignPropertiesAccordingToPermissions(token: ITokenNonfungible | ITokenRefungible, pieces: bigint) { await token.collection.addAdmin(alice, {Substrate: bob.address}); await token.transfer(alice, {Substrate: charlie.address}, pieces); @@ -544,7 +535,7 @@ describe('Integration Test: Token Properties', () => { await testAssignPropertiesAccordingToPermissions(token, 100n); }); - async function testChangesPropertiesAccordingPermission(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint) { + async function testChangesPropertiesAccordingPermission(token: ITokenNonfungible | ITokenRefungible, pieces: bigint) { await token.collection.addAdmin(alice, {Substrate: bob.address}); await token.transfer(alice, {Substrate: charlie.address}, pieces); @@ -597,7 +588,7 @@ describe('Integration Test: Token Properties', () => { await testChangesPropertiesAccordingPermission(token, 100n); }); - async function testDeletePropertiesAccordingPermission(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint) { + async function testDeletePropertiesAccordingPermission(token: ITokenNonfungible | ITokenRefungible, pieces: bigint) { await token.collection.addAdmin(alice, {Substrate: bob.address}); await token.transfer(alice, {Substrate: charlie.address}, pieces); @@ -808,7 +799,7 @@ describe('Negative Integration Test: Token Properties', () => { return (await (mode == 'NFT' ? api.query.nonfungible : api.query.refungible).tokenProperties(collectionId, tokenId)).toJSON().consumedSpace; } - async function prepare(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint): Promise { + async function prepare(token: ITokenNonfungible | ITokenRefungible, pieces: bigint): Promise { await token.collection.addAdmin(alice, {Substrate: bob.address}); await token.transfer(alice, {Substrate: charlie.address}, pieces); @@ -832,7 +823,7 @@ describe('Negative Integration Test: Token Properties', () => { return originalSpace; } - async function testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint) { + async function testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(token: ITokenNonfungible | ITokenRefungible, pieces: bigint) { const originalSpace = await prepare(token, pieces); let i = 0; @@ -867,7 +858,7 @@ describe('Negative Integration Test: Token Properties', () => { await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(token, 100n); }); - async function testForbidsChangingDeletingPropertiesIfPropertyImmutable(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint) { + async function testForbidsChangingDeletingPropertiesIfPropertyImmutable(token: ITokenNonfungible | ITokenRefungible, pieces: bigint) { const originalSpace = await prepare(token, pieces); let i = 0; @@ -902,7 +893,7 @@ describe('Negative Integration Test: Token Properties', () => { await testForbidsChangingDeletingPropertiesIfPropertyImmutable(token, 100n); }); - async function testForbidsAddingPropertiesIfPropertyNotDeclared(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint) { + async function testForbidsAddingPropertiesIfPropertyNotDeclared(token: ITokenNonfungible | ITokenRefungible, pieces: bigint) { const originalSpace = await prepare(token, pieces); await expect( @@ -938,7 +929,7 @@ describe('Negative Integration Test: Token Properties', () => { await testForbidsAddingPropertiesIfPropertyNotDeclared(token, 100n); }); - async function testForbidsAddingTooManyProperties(token: UniqueNFTToken | UniqueRFTToken, pieces: bigint) { + async function testForbidsAddingTooManyProperties(token: ITokenNonfungible | ITokenRefungible, pieces: bigint) { const originalSpace = await prepare(token, pieces); await expect( @@ -993,7 +984,7 @@ describe('ReFungible token properties permissions tests', () => { }); }); - async function prepare(helper: UniqueHelper): Promise { + async function prepare(helper: UniqueHelper): Promise { const collection = await helper.rft.mintCollection(alice); const token = await collection.mintToken(alice, 100n); diff --git a/tests/src/nesting/unnest.test.ts b/tests/src/nesting/unnest.test.ts index b30cb22578..12c7c34f81 100644 --- a/tests/src/nesting/unnest.test.ts +++ b/tests/src/nesting/unnest.test.ts @@ -105,11 +105,11 @@ describe('Negative Test: Unnesting', () => { // Try to unnest await expect(nestedToken.unnest(bob, targetToken, {Substrate: alice.address})).to.be.rejectedWith(/common\.ApprovedValueTooLow/); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); // Try to burn await expect(nestedToken.burnFrom(bob, targetToken.nestingAccount())).to.be.rejectedWith(/common\.ApprovedValueTooLow/); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); }); // todo another test for creating excessive depth matryoshka with Ethereum? diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index 241b6731b4..aebad3f353 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -9,10 +9,16 @@ import config from '../../config'; import '../../interfaces/augment-api-events'; import {DevUniqueHelper, SilentLogger, SilentConsole} from './unique.dev'; - chai.use(chaiAsPromised); export const expect = chai.expect; +export const U128_MAX = (1n << 128n) - 1n; + +const MICROUNIQUE = 1_000_000_000_000n; +const MILLIUNIQUE = 1_000n * MICROUNIQUE; +const CENTIUNIQUE = 10n * MILLIUNIQUE; +export const UNIQUE = 100n * CENTIUNIQUE; + export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise, url: string = config.substrateUrl) => { const silentConsole = new SilentConsole(); silentConsole.enable(); diff --git a/tests/src/util/playgrounds/types.ts b/tests/src/util/playgrounds/types.ts index 956f4b64ec..ab57a5fc9d 100644 --- a/tests/src/util/playgrounds/types.ts +++ b/tests/src/util/playgrounds/types.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import {IKeyringPair} from '@polkadot/types/types'; +import {UniqueHelper} from './unique'; export interface IEvent { section: string; @@ -106,7 +107,7 @@ export interface ITokenPropertyPermission { } } -export interface IToken { +export interface ITokenAddress { collectionId: number; tokenId: number; } @@ -167,3 +168,169 @@ export type TEthereumAccount = string; export type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated'; export type TUniqueNetworks = 'opal' | 'quartz' | 'unique'; export type TSigner = IKeyringPair; // | 'string' + +export interface ICollectionBase { + helper: UniqueHelper; + collectionId: number; + getData: () => Promise<{ + id: number; + name: string; + description: string; + tokensCount: number; + admins: ICrossAccountId[]; + normalizedOwner: TSubstrateAccount; + raw: any + } | null>; + getLastTokenId: () => Promise; + isTokenExists: (tokenId: number) => Promise; + getAdmins: () => Promise; + getAllowList: () => Promise; + getEffectiveLimits: () => Promise; + getProperties: (propertyKeys?: string[]) => Promise; + getTokenNextSponsored: (tokenId: number, addressObj: ICrossAccountId) => Promise; + setSponsor: (signer: TSigner, sponsorAddress: TSubstrateAccount) => Promise; + confirmSponsorship: (signer: TSigner) => Promise; + removeSponsor: (signer: TSigner) => Promise; + setLimits: (signer: TSigner, limits: ICollectionLimits) => Promise; + changeOwner: (signer: TSigner, ownerAddress: TSubstrateAccount) => Promise; + addAdmin: (signer: TSigner, adminAddressObj: ICrossAccountId) => Promise; + addToAllowList: (signer: TSigner, addressObj: ICrossAccountId) => Promise; + removeFromAllowList: (signer: TSigner, addressObj: ICrossAccountId) => Promise; + removeAdmin: (signer: TSigner, adminAddressObj: ICrossAccountId) => Promise; + setProperties: (signer: TSigner, properties: IProperty[]) => Promise; + deleteProperties: (signer: TSigner, propertyKeys: string[]) => Promise; + setPermissions: (signer: TSigner, permissions: ICollectionPermissions) => Promise; + enableNesting: (signer: TSigner, permissions: INestingPermissions) => Promise; + disableNesting: (signer: TSigner) => Promise; + burn: (signer: TSigner) => Promise; +} + +export interface ICollectionNFT extends ICollectionBase { + getTokenObject: (tokenId: number) => ITokenNonfungible; // todo:playgrounds + getTokensByAddress: (addressObj: ICrossAccountId) => Promise; + getToken: (tokenId: number, blockHashAt?: string) => Promise<{ + properties: IProperty[]; + owner: ICrossAccountId; + normalizedOwner: ICrossAccountId; + }| null>; + getTokenOwner: (tokenId: number, blockHashAt?: string) => Promise; + getTokenTopmostOwner: (tokenId: number, blockHashAt?: string) => Promise; + getTokenChildren: (tokenId: number, blockHashAt?: string) => Promise; // todo:playgrounds + getPropertyPermissions: (propertyKeys?: string[]) => Promise; + getTokenProperties: (tokenId: number, propertyKeys?: string[]) => Promise; + transferToken: (signer: TSigner, tokenId: number, addressObj: ICrossAccountId) => Promise; + transferTokenFrom: (signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) => Promise; + approveToken: (signer: TSigner, tokenId: number, toAddressObj: ICrossAccountId) => Promise; + isTokenApproved: (tokenId: number, toAddressObj: ICrossAccountId) => Promise; + mintToken: (signer: TSigner, owner: ICrossAccountId, properties?: IProperty[]) => Promise;// todo:playgrounds + mintMultipleTokens: (signer: TSigner, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[]) => Promise;// todo:playgrounds + burnToken: (signer: TSigner, tokenId: number) => Promise<{ + success: boolean, + token: number | null + }>; + burnTokenFrom: (signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId) => Promise; + setTokenProperties: (signer: TSigner, tokenId: number, properties: IProperty[]) => Promise; + deleteTokenProperties: (signer: TSigner, tokenId: number, propertyKeys: string[]) => Promise; + setTokenPropertyPermissions: (signer: TSigner, permissions: ITokenPropertyPermission[]) => Promise; + nestToken: (signer: TSigner, tokenId: number, toTokenObj: ITokenAddress) => Promise; + unnestToken: (signer: TSigner, tokenId: number, fromTokenObj: ITokenAddress, toAddressObj: ICrossAccountId) => Promise; +} + +export interface ICollectionRFT extends ICollectionBase { + getTokenObject: (tokenId: number) => ITokenRefungible; + getToken: (tokenId: number, blockHashAt?: string) => Promise<{ + properties: IProperty[]; + owner: ICrossAccountId; + normalizedOwner: ICrossAccountId; + }| null>; + getTokensByAddress: (addressObj: ICrossAccountId) => Promise; + getTop10TokenOwners: (tokenId: number) => Promise; + getTokenBalance: (tokenId: number, addressObj: ICrossAccountId) => Promise; + getTokenTotalPieces: (tokenId: number) => Promise; + getTokenApprovedPieces: (tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) => Promise; + getPropertyPermissions: (propertyKeys?: string[] | null) => Promise; + getTokenProperties: (tokenId: number, propertyKeys?: string[]) => Promise; + transferToken: (signer: TSigner, tokenId: number, addressObj: ICrossAccountId, amount: bigint) => Promise; + transferTokenFrom: (signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount: bigint) => Promise; + approveToken: (signer: TSigner, tokenId: number, toAddressObj: ICrossAccountId, amount: bigint) => Promise; + repartitionToken: (signer: TSigner, tokenId: number, amount: bigint) => Promise; + mintToken: (signer: TSigner, pieces: bigint, owner: ICrossAccountId, properties?: IProperty[]) => Promise; + mintMultipleTokens: (signer: TSigner, tokens: {pieces: bigint, owner: ICrossAccountId, properties?: IProperty[]}[]) => Promise; // todo:playgrounds + burnToken: (signer: TSigner, tokenId: number, amount: bigint) => Promise<{ + success: boolean, + token: number | null + }>; + burnTokenFrom: (signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId, amount: bigint) => Promise; + setTokenProperties: (signer: TSigner, tokenId: number, properties: IProperty[]) => Promise; + deleteTokenProperties: (signer: TSigner, tokenId: number, propertyKeys: string[]) => Promise; + setTokenPropertyPermissions: (signer: TSigner, permissions: ITokenPropertyPermission[]) => Promise; +} + +export interface ICollectionFT extends ICollectionBase { + getBalance: (addressObj: ICrossAccountId) => Promise; + getTotalPieces: () => Promise; + getApprovedTokens: (fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) => Promise; + getTop10Owners: () => Promise; + mint: (signer: TSigner, amount: bigint, owner: ICrossAccountId) => Promise; + mintWithOneOwner: (signer: TSigner, tokens: {value: bigint}[], owner: ICrossAccountId) => Promise; + transfer: (signer: TSigner, toAddressObj: ICrossAccountId, amount: bigint) => Promise; + transferFrom: (signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount: bigint) => Promise; + burnTokens: (signer: TSigner, amount: bigint) => Promise; + burnTokensFrom: (signer: TSigner, fromAddressObj: ICrossAccountId, amount: bigint) => Promise; + approveTokens: (signer: TSigner, toAddressObj: ICrossAccountId, amount: bigint) => Promise; +} + +export interface ITokenBase extends ITokenAddress { + collection: ICollectionNFT | ICollectionRFT; + getNextSponsored: (addressObj: ICrossAccountId) => Promise; + getProperties: (propertyKeys?: string[]) => Promise; + setProperties: (signer: TSigner, properties: IProperty[]) => Promise; + deleteProperties: (signer: TSigner, propertyKeys: string[]) => Promise; + nestingAccount: () => ICrossAccountId; + nestingAccountInLowerCase: () => ICrossAccountId; +} + +export interface ITokenNonfungible extends ITokenBase { + collection: ICollectionNFT; + getData: (blockHashAt?: string) => Promise<{ + properties: IProperty[]; + owner: ICrossAccountId; + normalizedOwner: ICrossAccountId; + }| null>; + getOwner: (blockHashAt?: string) => Promise; + getTopmostOwner: (blockHashAt?: string) => Promise; + getChildren: (blockHashAt?: string) => Promise; // todo:playgrounds + nest: (signer: TSigner, toTokenObj: ITokenAddress) => Promise; + unnest: (signer: TSigner, fromTokenObj: ITokenAddress, toAddressObj: ICrossAccountId) => Promise; + transfer: (signer: TSigner, addressObj: ICrossAccountId) => Promise; + transferFrom: (signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) => Promise; + approve: (signer: TSigner, toAddressObj: ICrossAccountId) => Promise; + isApproved: (toAddressObj: ICrossAccountId) => Promise; + burn: (signer: TSigner) => Promise<{ + success: boolean, + token: number | null + }>; + burnFrom: (signer: TSigner, fromAddressObj: ICrossAccountId) => Promise; +} + +export interface ITokenRefungible extends ITokenBase { + collection: ICollectionRFT; + getData: (blockHashAt?: string) => Promise<{ + properties: IProperty[]; + owner: ICrossAccountId; + normalizedOwner: ICrossAccountId; + }| null>; + getTop10Owners: () => Promise; + getBalance: (addressObj: ICrossAccountId) => Promise; + getTotalPieces: () => Promise; + getApprovedPieces: (fromAddressObj: ICrossAccountId, toAccountObj: ICrossAccountId) => Promise; + transfer: (signer: TSigner, addressObj: ICrossAccountId, amount: bigint) => Promise; + transferFrom: (signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount: bigint) => Promise; + approve: (signer: TSigner, toAddressObj: ICrossAccountId, amount: bigint) => Promise; + repartition: (signer: TSigner, amount: bigint) => Promise; + burn: (signer: TSigner, amount: bigint) => Promise<{ + success: boolean, + token: number | null + }>; + burnFrom: (signer: TSigner, fromAddressObj: ICrossAccountId, amount: bigint) => Promise; +} diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 443715db42..e725a1e933 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -9,7 +9,7 @@ import {ApiPromise, WsProvider, Keyring} from '@polkadot/api'; import {ApiInterfaceEvents, SignerOptions} from '@polkadot/api/types'; import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; -import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; +import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISubstrateBalance, ITokenAddress, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks, ICollectionBase, ICollectionNFT, ICollectionRFT, ITokenBase, ITokenNonfungible, ITokenRefungible, ICollectionFT} from './types'; export const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => { const address = {} as ICrossAccountId; @@ -55,11 +55,15 @@ class UniqueUtil { RPC: 'rpc', }; - static getTokenAccount(token: IToken) { + static getTokenAccount(token: ITokenAddress): ICrossAccountId { + return {Ethereum: this.getTokenAddress(token)}; + } + + static getTokenAccountInLowerCase(token: ITokenAddress): ICrossAccountId { return {Ethereum: this.getTokenAddress(token).toLowerCase()}; } - static getTokenAddress(token: IToken) { + static getTokenAddress(token: ITokenAddress): string { return nesting.tokenIdToAddress(token.collectionId, token.tokenId); } @@ -1348,7 +1352,7 @@ class NFTGroup extends NFTnRFT { * @example getTokenChildren(10, 5); * @returns tokens whose depth of nesting is <= 5 */ - async getTokenChildren(collectionId: number, tokenId: number, blockHashAt?: string): Promise { + async getTokenChildren(collectionId: number, tokenId: number, blockHashAt?: string): Promise { let children; if(typeof blockHashAt === 'undefined') { children = await this.helper.callRpc('api.rpc.unique.tokenChildren', [collectionId, tokenId]); @@ -1369,7 +1373,7 @@ class NFTGroup extends NFTnRFT { * @example nestToken(aliceKeyring, {collectionId: 10, tokenId: 5}, {collectionId: 10, tokenId: 4}); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async nestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken): Promise { + async nestToken(signer: TSigner, tokenObj: ITokenAddress, rootTokenObj: ITokenAddress): Promise { const rootTokenAddress = this.helper.util.getTokenAccount(rootTokenObj); const result = await this.transferToken(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress); if(!result) { @@ -1387,7 +1391,7 @@ class NFTGroup extends NFTnRFT { * @example unnestToken(aliceKeyring, {collectionId: 10, tokenId: 5}, {collectionId: 10, tokenId: 4}, {Substrate: "5DyN4Y92vZCjv38fg..."}); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async unnestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, toAddressObj: ICrossAccountId): Promise { + async unnestToken(signer: TSigner, tokenObj: ITokenAddress, rootTokenObj: ITokenAddress, toAddressObj: ICrossAccountId): Promise { const rootTokenAddress = this.helper.util.getTokenAccount(rootTokenObj); const result = await this.transferTokenFrom(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress, toAddressObj); if(!result) { @@ -1456,7 +1460,7 @@ class NFTGroup extends NFTnRFT { true, ); const collection = this.getCollectionObject(collectionId); - return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); + return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: ITokenAddress) => collection.getTokenObject(x.tokenId)); } /** @@ -1489,7 +1493,7 @@ class NFTGroup extends NFTnRFT { true, ); const collection = this.getCollectionObject(collectionId); - return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); + return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: ITokenAddress) => collection.getTokenObject(x.tokenId)); } /** @@ -1630,7 +1634,7 @@ class RFTGroup extends NFTnRFT { true, // `Unable to mint RFT tokens for ${label}`, ); const collection = this.getCollectionObject(collectionId); - return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); + return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: ITokenAddress) => collection.getTokenObject(x.tokenId)); } /** @@ -1654,7 +1658,7 @@ class RFTGroup extends NFTnRFT { true, ); const collection = this.getCollectionObject(collectionId); - return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); + return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: ITokenAddress) => collection.getTokenObject(x.tokenId)); } /** @@ -2219,7 +2223,7 @@ export class UniqueHelper extends ChainHelperBase { } -export class UniqueCollectionBase { +class UniqueCollectionBase implements ICollectionBase { helper: UniqueHelper; collectionId: number; @@ -2256,6 +2260,10 @@ export class UniqueCollectionBase { return await this.helper.collection.getProperties(this.collectionId, propertyKeys); } + async getTokenNextSponsored(tokenId: number, addressObj: ICrossAccountId) { + return await this.helper.collection.getTokenNextSponsored(this.collectionId, tokenId, addressObj); + } + async setSponsor(signer: TSigner, sponsorAddress: TSubstrateAccount) { return await this.helper.collection.setSponsor(signer, this.collectionId, sponsorAddress); } @@ -2300,10 +2308,6 @@ export class UniqueCollectionBase { return await this.helper.collection.deleteProperties(signer, this.collectionId, propertyKeys); } - async getTokenNextSponsored(tokenId: number, addressObj: ICrossAccountId) { - return await this.helper.collection.getTokenNextSponsored(this.collectionId, tokenId, addressObj); - } - async setPermissions(signer: TSigner, permissions: ICollectionPermissions) { return await this.helper.collection.setPermissions(signer, this.collectionId, permissions); } @@ -2322,7 +2326,7 @@ export class UniqueCollectionBase { } -export class UniqueNFTCollection extends UniqueCollectionBase { +class UniqueNFTCollection extends UniqueCollectionBase implements ICollectionNFT { getTokenObject(tokenId: number) { return new UniqueNFTToken(tokenId, this); } @@ -2399,17 +2403,17 @@ export class UniqueNFTCollection extends UniqueCollectionBase { return await this.helper.nft.setTokenPropertyPermissions(signer, this.collectionId, permissions); } - async nestToken(signer: TSigner, tokenId: number, toTokenObj: IToken) { + async nestToken(signer: TSigner, tokenId: number, toTokenObj: ITokenAddress) { return await this.helper.nft.nestToken(signer, {collectionId: this.collectionId, tokenId}, toTokenObj); } - async unnestToken(signer: TSigner, tokenId: number, fromTokenObj: IToken, toAddressObj: ICrossAccountId) { + async unnestToken(signer: TSigner, tokenId: number, fromTokenObj: ITokenAddress, toAddressObj: ICrossAccountId) { return await this.helper.nft.unnestToken(signer, {collectionId: this.collectionId, tokenId}, fromTokenObj, toAddressObj); } } -export class UniqueRFTCollection extends UniqueCollectionBase { +class UniqueRFTCollection extends UniqueCollectionBase implements ICollectionRFT { getTokenObject(tokenId: number) { return new UniqueRFTToken(tokenId, this); } @@ -2434,6 +2438,10 @@ export class UniqueRFTCollection extends UniqueCollectionBase { return await this.helper.rft.getTokenTotalPieces(this.collectionId, tokenId); } + async getTokenApprovedPieces(tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) { + return await this.helper.rft.getTokenApprovedPieces(this.collectionId, tokenId, toAddressObj, fromAddressObj); + } + async getPropertyPermissions(propertyKeys: string[] | null = null) { return await this.helper.rft.getPropertyPermissions(this.collectionId, propertyKeys); } @@ -2454,10 +2462,6 @@ export class UniqueRFTCollection extends UniqueCollectionBase { return await this.helper.rft.approveToken(signer, this.collectionId, tokenId, toAddressObj, amount); } - async getTokenApprovedPieces(tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) { - return await this.helper.rft.getTokenApprovedPieces(this.collectionId, tokenId, toAddressObj, fromAddressObj); - } - async repartitionToken(signer: TSigner, tokenId: number, amount: bigint) { return await this.helper.rft.repartitionToken(signer, this.collectionId, tokenId, amount); } @@ -2492,23 +2496,31 @@ export class UniqueRFTCollection extends UniqueCollectionBase { } -export class UniqueFTCollection extends UniqueCollectionBase { - async mint(signer: TSigner, amount=1n, owner: ICrossAccountId = {Substrate: signer.address}) { - return await this.helper.ft.mintTokens(signer, this.collectionId, amount, owner); +class UniqueFTCollection extends UniqueCollectionBase implements ICollectionFT { + async getBalance(addressObj: ICrossAccountId) { + return await this.helper.ft.getBalance(this.collectionId, addressObj); } - async mintWithOneOwner(signer: TSigner, tokens: {value: bigint}[], owner: ICrossAccountId = {Substrate: signer.address}) { - return await this.helper.ft.mintMultipleTokensWithOneOwner(signer, this.collectionId, tokens, owner); + async getTotalPieces() { + return await this.helper.ft.getTotalPieces(this.collectionId); } - async getBalance(addressObj: ICrossAccountId) { - return await this.helper.ft.getBalance(this.collectionId, addressObj); + async getApprovedTokens(fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) { + return await this.helper.ft.getApprovedTokens(this.collectionId, fromAddressObj, toAddressObj); } async getTop10Owners() { return await this.helper.ft.getTop10Owners(this.collectionId); } + async mint(signer: TSigner, amount=1n, owner: ICrossAccountId = {Substrate: signer.address}) { + return await this.helper.ft.mintTokens(signer, this.collectionId, amount, owner); + } + + async mintWithOneOwner(signer: TSigner, tokens: {value: bigint}[], owner: ICrossAccountId = {Substrate: signer.address}) { + return await this.helper.ft.mintMultipleTokensWithOneOwner(signer, this.collectionId, tokens, owner); + } + async transfer(signer: TSigner, toAddressObj: ICrossAccountId, amount=1n) { return await this.helper.ft.transfer(signer, this.collectionId, toAddressObj, amount); } @@ -2525,21 +2537,13 @@ export class UniqueFTCollection extends UniqueCollectionBase { return await this.helper.ft.burnTokensFrom(signer, this.collectionId, fromAddressObj, amount); } - async getTotalPieces() { - return await this.helper.ft.getTotalPieces(this.collectionId); - } - async approveTokens(signer: TSigner, toAddressObj: ICrossAccountId, amount=1n) { return await this.helper.ft.approveTokens(signer, this.collectionId, toAddressObj, amount); } - - async getApprovedTokens(fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) { - return await this.helper.ft.getApprovedTokens(this.collectionId, fromAddressObj, toAddressObj); - } } -export class UniqueTokenBase implements IToken { +class UniqueTokenBase implements ITokenBase { collection: UniqueNFTCollection | UniqueRFTCollection; collectionId: number; tokenId: number; @@ -2569,10 +2573,14 @@ export class UniqueTokenBase implements IToken { nestingAccount() { return this.collection.helper.util.getTokenAccount(this); } + + nestingAccountInLowerCase() { + return this.collection.helper.util.getTokenAccountInLowerCase(this); + } } -export class UniqueNFTToken extends UniqueTokenBase { +class UniqueNFTToken extends UniqueTokenBase implements ITokenNonfungible { collection: UniqueNFTCollection; constructor(tokenId: number, collection: UniqueNFTCollection) { @@ -2596,11 +2604,11 @@ export class UniqueNFTToken extends UniqueTokenBase { return await this.collection.getTokenChildren(this.tokenId, blockHashAt); } - async nest(signer: TSigner, toTokenObj: IToken) { + async nest(signer: TSigner, toTokenObj: ITokenAddress) { return await this.collection.nestToken(signer, this.tokenId, toTokenObj); } - async unnest(signer: TSigner, fromTokenObj: IToken, toAddressObj: ICrossAccountId) { + async unnest(signer: TSigner, fromTokenObj: ITokenAddress, toAddressObj: ICrossAccountId) { return await this.collection.unnestToken(signer, this.tokenId, fromTokenObj, toAddressObj); } @@ -2629,7 +2637,7 @@ export class UniqueNFTToken extends UniqueTokenBase { } } -export class UniqueRFTToken extends UniqueTokenBase { +class UniqueRFTToken extends UniqueTokenBase implements ITokenRefungible { collection: UniqueRFTCollection; constructor(tokenId: number, collection: UniqueRFTCollection) { @@ -2653,6 +2661,10 @@ export class UniqueRFTToken extends UniqueTokenBase { return await this.collection.getTokenTotalPieces(this.tokenId); } + async getApprovedPieces(fromAddressObj: ICrossAccountId, toAccountObj: ICrossAccountId) { + return await this.collection.getTokenApprovedPieces(this.tokenId, fromAddressObj, toAccountObj); + } + async transfer(signer: TSigner, addressObj: ICrossAccountId, amount=1n) { return await this.collection.transferToken(signer, this.tokenId, addressObj, amount); } @@ -2665,10 +2677,6 @@ export class UniqueRFTToken extends UniqueTokenBase { return await this.collection.approveToken(signer, this.tokenId, toAddressObj, amount); } - async getApprovedPieces(fromAddressObj: ICrossAccountId, toAccountObj: ICrossAccountId) { - return await this.collection.getTokenApprovedPieces(this.tokenId, fromAddressObj, toAccountObj); - } - async repartition(signer: TSigner, amount: bigint) { return await this.collection.repartitionToken(signer, this.tokenId, amount); } From 77e366b9e580ca6ed98bfc854195d023a8425aa4 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Tue, 27 Sep 2022 08:21:31 +0000 Subject: [PATCH 0964/1274] tests(nesting): revert majority of last commit + refactor token and collection naming convention --- tests/src/fungible.test.ts | 4 +- tests/src/nesting/graphs.test.ts | 5 +- tests/src/nesting/properties.test.ts | 51 ++++---- tests/src/util/playgrounds/index.ts | 7 -- tests/src/util/playgrounds/types.ts | 169 +-------------------------- tests/src/util/playgrounds/unique.ts | 72 ++++++------ 6 files changed, 67 insertions(+), 241 deletions(-) diff --git a/tests/src/fungible.test.ts b/tests/src/fungible.test.ts index d9c2fbe687..5fdf0ecd4d 100644 --- a/tests/src/fungible.test.ts +++ b/tests/src/fungible.test.ts @@ -15,7 +15,9 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect, U128_MAX} from './util/playgrounds'; +import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; + +const U128_MAX = (1n << 128n) - 1n; describe('integration test: Fungible functionality:', () => { let alice: IKeyringPair; diff --git a/tests/src/nesting/graphs.test.ts b/tests/src/nesting/graphs.test.ts index e6976be8b0..b504330033 100644 --- a/tests/src/nesting/graphs.test.ts +++ b/tests/src/nesting/graphs.test.ts @@ -16,8 +16,7 @@ import {IKeyringPair} from '@polkadot/types/types'; import {expect, itSub, usingPlaygrounds} from '../util/playgrounds'; -import {ITokenNonfungible} from '../util/playgrounds/types'; -import {UniqueHelper} from '../util/playgrounds/unique'; +import {UniqueHelper, UniqueNFToken} from '../util/playgrounds/unique'; /** * ```dot @@ -26,7 +25,7 @@ import {UniqueHelper} from '../util/playgrounds/unique'; * 8 -> 5 * ``` */ -async function buildComplexObjectGraph(helper: UniqueHelper, sender: IKeyringPair): Promise { +async function buildComplexObjectGraph(helper: UniqueHelper, sender: IKeyringPair): Promise { const collection = await helper.nft.mintCollection(sender, {permissions: {nesting: {tokenOwner: true}}}); const tokens = await collection.mintMultipleTokens(sender, Array(8).fill({owner: {Substrate: sender.address}})); diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index 515f5ad9a0..cc8dd0dfed 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -16,8 +16,7 @@ import {IKeyringPair} from '@polkadot/types/types'; import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../util/playgrounds'; -import {ICollectionBase, ICollectionNFT, ITokenNonfungible, ICollectionRFT, ITokenRefungible} from '../util/playgrounds/types'; -import {UniqueHelper} from '../util/playgrounds/unique'; +import {UniqueHelper, UniqueBaseCollection, UniqueNFTCollection, UniqueNFToken, UniqueRFTCollection, UniqueRFToken} from '../util/playgrounds/unique'; // ---------- COLLECTION PROPERTIES @@ -37,7 +36,7 @@ describe('Integration Test: Collection Properties', () => { expect(await collection.getProperties()).to.be.empty; }); - async function testSetsPropertiesForCollection(collection: ICollectionBase) { + async function testSetsPropertiesForCollection(collection: UniqueBaseCollection) { // As owner await expect(collection.setProperties(alice, [{key: 'electron', value: 'come bond'}])).to.be.fulfilled; @@ -61,7 +60,7 @@ describe('Integration Test: Collection Properties', () => { await testSetsPropertiesForCollection(await helper.rft.mintCollection(alice)); }); - async function testCheckValidNames(collection: ICollectionBase) { + async function testCheckValidNames(collection: UniqueBaseCollection) { // alpha symbols await expect(collection.setProperties(alice, [{key: 'answer'}])).to.be.fulfilled; @@ -95,7 +94,7 @@ describe('Integration Test: Collection Properties', () => { await testCheckValidNames(await helper.rft.mintCollection(alice)); }); - async function testChangesProperties(collection: ICollectionBase) { + async function testChangesProperties(collection: UniqueBaseCollection) { await expect(collection.setProperties(alice, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: ''}])).to.be.fulfilled; // Mutate the properties @@ -116,7 +115,7 @@ describe('Integration Test: Collection Properties', () => { await testChangesProperties(await helper.rft.mintCollection(alice)); }); - async function testDeleteProperties(collection: ICollectionBase) { + async function testDeleteProperties(collection: UniqueBaseCollection) { await expect(collection.setProperties(alice, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: 'LIGO'}])).to.be.fulfilled; await expect(collection.deleteProperties(alice, ['electron'])).to.be.fulfilled; @@ -147,7 +146,7 @@ describe('Negative Integration Test: Collection Properties', () => { }); }); - async function testFailsSetPropertiesIfNotOwnerOrAdmin(collection: ICollectionBase) { + async function testFailsSetPropertiesIfNotOwnerOrAdmin(collection: UniqueBaseCollection) { await expect(collection.setProperties(bob, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: 'LIGO'}])) .to.be.rejectedWith(/common\.NoPermission/); @@ -162,7 +161,7 @@ describe('Negative Integration Test: Collection Properties', () => { await testFailsSetPropertiesIfNotOwnerOrAdmin(await helper.rft.mintCollection(alice)); }); - async function testFailsSetPropertiesThatExeedLimits(collection: ICollectionBase) { + async function testFailsSetPropertiesThatExeedLimits(collection: UniqueBaseCollection) { const spaceLimit = (await (collection.helper!.api! as any).query.common.collectionProperties(collection.collectionId)).spaceLimit.toNumber(); // Mute the general tx parsing error, too many bytes to process @@ -191,7 +190,7 @@ describe('Negative Integration Test: Collection Properties', () => { await testFailsSetPropertiesThatExeedLimits(await helper.rft.mintCollection(alice)); }); - async function testFailsSetMorePropertiesThanAllowed(collection: ICollectionBase) { + async function testFailsSetMorePropertiesThanAllowed(collection: UniqueBaseCollection) { const propertiesToBeSet = []; for (let i = 0; i < 65; i++) { propertiesToBeSet.push({ @@ -214,7 +213,7 @@ describe('Negative Integration Test: Collection Properties', () => { await testFailsSetMorePropertiesThanAllowed(await helper.rft.mintCollection(alice)); }); - async function testFailsSetPropertiesWithInvalidNames(collection: ICollectionBase) { + async function testFailsSetPropertiesWithInvalidNames(collection: UniqueBaseCollection) { const invalidProperties = [ [{key: 'electron', value: 'negative'}, {key: 'string theory', value: 'understandable'}], [{key: 'Mr/Sandman', value: 'Bring me a gene'}], @@ -281,7 +280,7 @@ describe('Integration Test: Access Rights to Token Properties', () => { expect(propertyRights).to.be.empty; }); - async function testSetsAccessRightsToProperties(collection: ICollectionNFT | ICollectionRFT) { + async function testSetsAccessRightsToProperties(collection: UniqueNFTCollection | UniqueRFTCollection) { await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: true}}])) .to.be.fulfilled; @@ -305,7 +304,7 @@ describe('Integration Test: Access Rights to Token Properties', () => { await testSetsAccessRightsToProperties(await helper.rft.mintCollection(alice)); }); - async function testChangesAccessRightsToProperty(collection: ICollectionNFT | ICollectionRFT) { + async function testChangesAccessRightsToProperty(collection: UniqueNFTCollection | UniqueRFTCollection) { await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: true, collectionAdmin: true}}])) .to.be.fulfilled; @@ -338,7 +337,7 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { }); }); - async function testPreventsFromSettingAccessRightsNotAdminOrOwner(collection: ICollectionNFT | ICollectionRFT) { + async function testPreventsFromSettingAccessRightsNotAdminOrOwner(collection: UniqueNFTCollection | UniqueRFTCollection) { await expect(collection.setTokenPropertyPermissions(bob, [{key: 'skullduggery', permission: {mutable: true, tokenOwner: true}}])) .to.be.rejectedWith(/common\.NoPermission/); @@ -354,7 +353,7 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { await testPreventsFromSettingAccessRightsNotAdminOrOwner(await helper.rft.mintCollection(alice)); }); - async function testPreventFromAddingTooManyPossibleProperties(collection: ICollectionNFT | ICollectionRFT) { + async function testPreventFromAddingTooManyPossibleProperties(collection: UniqueNFTCollection | UniqueRFTCollection) { const constitution = []; for (let i = 0; i < 65; i++) { constitution.push({ @@ -378,7 +377,7 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { await testPreventFromAddingTooManyPossibleProperties(await helper.rft.mintCollection(alice)); }); - async function testPreventAccessRightsModifiedIfConstant(collection: ICollectionNFT | ICollectionRFT) { + async function testPreventAccessRightsModifiedIfConstant(collection: UniqueNFTCollection | UniqueRFTCollection) { await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: false, tokenOwner: true}}])) .to.be.fulfilled; @@ -399,7 +398,7 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { await testPreventAccessRightsModifiedIfConstant(await helper.rft.mintCollection(alice)); }); - async function testPreventsAddingPropertiesWithInvalidNames(collection: ICollectionNFT | ICollectionRFT) { + async function testPreventsAddingPropertiesWithInvalidNames(collection: UniqueNFTCollection | UniqueRFTCollection) { const invalidProperties = [ [{key: 'skullduggery', permission: {tokenOwner: true}}, {key: 'im possible', permission: {collectionAdmin: true}}], [{key: 'G#4', permission: {tokenOwner: true}}], @@ -469,7 +468,7 @@ describe('Integration Test: Token Properties', () => { ]; }); - async function testReadsYetEmptyProperties(token: ITokenNonfungible | ITokenRefungible) { + async function testReadsYetEmptyProperties(token: UniqueNFToken | UniqueRFToken) { const properties = await token.getProperties(); expect(properties).to.be.empty; @@ -489,7 +488,7 @@ describe('Integration Test: Token Properties', () => { await testReadsYetEmptyProperties(token); }); - async function testAssignPropertiesAccordingToPermissions(token: ITokenNonfungible | ITokenRefungible, pieces: bigint) { + async function testAssignPropertiesAccordingToPermissions(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { await token.collection.addAdmin(alice, {Substrate: bob.address}); await token.transfer(alice, {Substrate: charlie.address}, pieces); @@ -535,7 +534,7 @@ describe('Integration Test: Token Properties', () => { await testAssignPropertiesAccordingToPermissions(token, 100n); }); - async function testChangesPropertiesAccordingPermission(token: ITokenNonfungible | ITokenRefungible, pieces: bigint) { + async function testChangesPropertiesAccordingPermission(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { await token.collection.addAdmin(alice, {Substrate: bob.address}); await token.transfer(alice, {Substrate: charlie.address}, pieces); @@ -588,7 +587,7 @@ describe('Integration Test: Token Properties', () => { await testChangesPropertiesAccordingPermission(token, 100n); }); - async function testDeletePropertiesAccordingPermission(token: ITokenNonfungible | ITokenRefungible, pieces: bigint) { + async function testDeletePropertiesAccordingPermission(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { await token.collection.addAdmin(alice, {Substrate: bob.address}); await token.transfer(alice, {Substrate: charlie.address}, pieces); @@ -799,7 +798,7 @@ describe('Negative Integration Test: Token Properties', () => { return (await (mode == 'NFT' ? api.query.nonfungible : api.query.refungible).tokenProperties(collectionId, tokenId)).toJSON().consumedSpace; } - async function prepare(token: ITokenNonfungible | ITokenRefungible, pieces: bigint): Promise { + async function prepare(token: UniqueNFToken | UniqueRFToken, pieces: bigint): Promise { await token.collection.addAdmin(alice, {Substrate: bob.address}); await token.transfer(alice, {Substrate: charlie.address}, pieces); @@ -823,7 +822,7 @@ describe('Negative Integration Test: Token Properties', () => { return originalSpace; } - async function testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(token: ITokenNonfungible | ITokenRefungible, pieces: bigint) { + async function testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { const originalSpace = await prepare(token, pieces); let i = 0; @@ -858,7 +857,7 @@ describe('Negative Integration Test: Token Properties', () => { await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(token, 100n); }); - async function testForbidsChangingDeletingPropertiesIfPropertyImmutable(token: ITokenNonfungible | ITokenRefungible, pieces: bigint) { + async function testForbidsChangingDeletingPropertiesIfPropertyImmutable(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { const originalSpace = await prepare(token, pieces); let i = 0; @@ -893,7 +892,7 @@ describe('Negative Integration Test: Token Properties', () => { await testForbidsChangingDeletingPropertiesIfPropertyImmutable(token, 100n); }); - async function testForbidsAddingPropertiesIfPropertyNotDeclared(token: ITokenNonfungible | ITokenRefungible, pieces: bigint) { + async function testForbidsAddingPropertiesIfPropertyNotDeclared(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { const originalSpace = await prepare(token, pieces); await expect( @@ -929,7 +928,7 @@ describe('Negative Integration Test: Token Properties', () => { await testForbidsAddingPropertiesIfPropertyNotDeclared(token, 100n); }); - async function testForbidsAddingTooManyProperties(token: ITokenNonfungible | ITokenRefungible, pieces: bigint) { + async function testForbidsAddingTooManyProperties(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { const originalSpace = await prepare(token, pieces); await expect( @@ -984,7 +983,7 @@ describe('ReFungible token properties permissions tests', () => { }); }); - async function prepare(helper: UniqueHelper): Promise { + async function prepare(helper: UniqueHelper): Promise { const collection = await helper.rft.mintCollection(alice); const token = await collection.mintToken(alice, 100n); diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index aebad3f353..98bb83e772 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -12,13 +12,6 @@ import {DevUniqueHelper, SilentLogger, SilentConsole} from './unique.dev'; chai.use(chaiAsPromised); export const expect = chai.expect; -export const U128_MAX = (1n << 128n) - 1n; - -const MICROUNIQUE = 1_000_000_000_000n; -const MILLIUNIQUE = 1_000n * MICROUNIQUE; -const CENTIUNIQUE = 10n * MILLIUNIQUE; -export const UNIQUE = 100n * CENTIUNIQUE; - export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise, url: string = config.substrateUrl) => { const silentConsole = new SilentConsole(); silentConsole.enable(); diff --git a/tests/src/util/playgrounds/types.ts b/tests/src/util/playgrounds/types.ts index ab57a5fc9d..956f4b64ec 100644 --- a/tests/src/util/playgrounds/types.ts +++ b/tests/src/util/playgrounds/types.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import {IKeyringPair} from '@polkadot/types/types'; -import {UniqueHelper} from './unique'; export interface IEvent { section: string; @@ -107,7 +106,7 @@ export interface ITokenPropertyPermission { } } -export interface ITokenAddress { +export interface IToken { collectionId: number; tokenId: number; } @@ -168,169 +167,3 @@ export type TEthereumAccount = string; export type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated'; export type TUniqueNetworks = 'opal' | 'quartz' | 'unique'; export type TSigner = IKeyringPair; // | 'string' - -export interface ICollectionBase { - helper: UniqueHelper; - collectionId: number; - getData: () => Promise<{ - id: number; - name: string; - description: string; - tokensCount: number; - admins: ICrossAccountId[]; - normalizedOwner: TSubstrateAccount; - raw: any - } | null>; - getLastTokenId: () => Promise; - isTokenExists: (tokenId: number) => Promise; - getAdmins: () => Promise; - getAllowList: () => Promise; - getEffectiveLimits: () => Promise; - getProperties: (propertyKeys?: string[]) => Promise; - getTokenNextSponsored: (tokenId: number, addressObj: ICrossAccountId) => Promise; - setSponsor: (signer: TSigner, sponsorAddress: TSubstrateAccount) => Promise; - confirmSponsorship: (signer: TSigner) => Promise; - removeSponsor: (signer: TSigner) => Promise; - setLimits: (signer: TSigner, limits: ICollectionLimits) => Promise; - changeOwner: (signer: TSigner, ownerAddress: TSubstrateAccount) => Promise; - addAdmin: (signer: TSigner, adminAddressObj: ICrossAccountId) => Promise; - addToAllowList: (signer: TSigner, addressObj: ICrossAccountId) => Promise; - removeFromAllowList: (signer: TSigner, addressObj: ICrossAccountId) => Promise; - removeAdmin: (signer: TSigner, adminAddressObj: ICrossAccountId) => Promise; - setProperties: (signer: TSigner, properties: IProperty[]) => Promise; - deleteProperties: (signer: TSigner, propertyKeys: string[]) => Promise; - setPermissions: (signer: TSigner, permissions: ICollectionPermissions) => Promise; - enableNesting: (signer: TSigner, permissions: INestingPermissions) => Promise; - disableNesting: (signer: TSigner) => Promise; - burn: (signer: TSigner) => Promise; -} - -export interface ICollectionNFT extends ICollectionBase { - getTokenObject: (tokenId: number) => ITokenNonfungible; // todo:playgrounds - getTokensByAddress: (addressObj: ICrossAccountId) => Promise; - getToken: (tokenId: number, blockHashAt?: string) => Promise<{ - properties: IProperty[]; - owner: ICrossAccountId; - normalizedOwner: ICrossAccountId; - }| null>; - getTokenOwner: (tokenId: number, blockHashAt?: string) => Promise; - getTokenTopmostOwner: (tokenId: number, blockHashAt?: string) => Promise; - getTokenChildren: (tokenId: number, blockHashAt?: string) => Promise; // todo:playgrounds - getPropertyPermissions: (propertyKeys?: string[]) => Promise; - getTokenProperties: (tokenId: number, propertyKeys?: string[]) => Promise; - transferToken: (signer: TSigner, tokenId: number, addressObj: ICrossAccountId) => Promise; - transferTokenFrom: (signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) => Promise; - approveToken: (signer: TSigner, tokenId: number, toAddressObj: ICrossAccountId) => Promise; - isTokenApproved: (tokenId: number, toAddressObj: ICrossAccountId) => Promise; - mintToken: (signer: TSigner, owner: ICrossAccountId, properties?: IProperty[]) => Promise;// todo:playgrounds - mintMultipleTokens: (signer: TSigner, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[]) => Promise;// todo:playgrounds - burnToken: (signer: TSigner, tokenId: number) => Promise<{ - success: boolean, - token: number | null - }>; - burnTokenFrom: (signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId) => Promise; - setTokenProperties: (signer: TSigner, tokenId: number, properties: IProperty[]) => Promise; - deleteTokenProperties: (signer: TSigner, tokenId: number, propertyKeys: string[]) => Promise; - setTokenPropertyPermissions: (signer: TSigner, permissions: ITokenPropertyPermission[]) => Promise; - nestToken: (signer: TSigner, tokenId: number, toTokenObj: ITokenAddress) => Promise; - unnestToken: (signer: TSigner, tokenId: number, fromTokenObj: ITokenAddress, toAddressObj: ICrossAccountId) => Promise; -} - -export interface ICollectionRFT extends ICollectionBase { - getTokenObject: (tokenId: number) => ITokenRefungible; - getToken: (tokenId: number, blockHashAt?: string) => Promise<{ - properties: IProperty[]; - owner: ICrossAccountId; - normalizedOwner: ICrossAccountId; - }| null>; - getTokensByAddress: (addressObj: ICrossAccountId) => Promise; - getTop10TokenOwners: (tokenId: number) => Promise; - getTokenBalance: (tokenId: number, addressObj: ICrossAccountId) => Promise; - getTokenTotalPieces: (tokenId: number) => Promise; - getTokenApprovedPieces: (tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) => Promise; - getPropertyPermissions: (propertyKeys?: string[] | null) => Promise; - getTokenProperties: (tokenId: number, propertyKeys?: string[]) => Promise; - transferToken: (signer: TSigner, tokenId: number, addressObj: ICrossAccountId, amount: bigint) => Promise; - transferTokenFrom: (signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount: bigint) => Promise; - approveToken: (signer: TSigner, tokenId: number, toAddressObj: ICrossAccountId, amount: bigint) => Promise; - repartitionToken: (signer: TSigner, tokenId: number, amount: bigint) => Promise; - mintToken: (signer: TSigner, pieces: bigint, owner: ICrossAccountId, properties?: IProperty[]) => Promise; - mintMultipleTokens: (signer: TSigner, tokens: {pieces: bigint, owner: ICrossAccountId, properties?: IProperty[]}[]) => Promise; // todo:playgrounds - burnToken: (signer: TSigner, tokenId: number, amount: bigint) => Promise<{ - success: boolean, - token: number | null - }>; - burnTokenFrom: (signer: TSigner, tokenId: number, fromAddressObj: ICrossAccountId, amount: bigint) => Promise; - setTokenProperties: (signer: TSigner, tokenId: number, properties: IProperty[]) => Promise; - deleteTokenProperties: (signer: TSigner, tokenId: number, propertyKeys: string[]) => Promise; - setTokenPropertyPermissions: (signer: TSigner, permissions: ITokenPropertyPermission[]) => Promise; -} - -export interface ICollectionFT extends ICollectionBase { - getBalance: (addressObj: ICrossAccountId) => Promise; - getTotalPieces: () => Promise; - getApprovedTokens: (fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) => Promise; - getTop10Owners: () => Promise; - mint: (signer: TSigner, amount: bigint, owner: ICrossAccountId) => Promise; - mintWithOneOwner: (signer: TSigner, tokens: {value: bigint}[], owner: ICrossAccountId) => Promise; - transfer: (signer: TSigner, toAddressObj: ICrossAccountId, amount: bigint) => Promise; - transferFrom: (signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount: bigint) => Promise; - burnTokens: (signer: TSigner, amount: bigint) => Promise; - burnTokensFrom: (signer: TSigner, fromAddressObj: ICrossAccountId, amount: bigint) => Promise; - approveTokens: (signer: TSigner, toAddressObj: ICrossAccountId, amount: bigint) => Promise; -} - -export interface ITokenBase extends ITokenAddress { - collection: ICollectionNFT | ICollectionRFT; - getNextSponsored: (addressObj: ICrossAccountId) => Promise; - getProperties: (propertyKeys?: string[]) => Promise; - setProperties: (signer: TSigner, properties: IProperty[]) => Promise; - deleteProperties: (signer: TSigner, propertyKeys: string[]) => Promise; - nestingAccount: () => ICrossAccountId; - nestingAccountInLowerCase: () => ICrossAccountId; -} - -export interface ITokenNonfungible extends ITokenBase { - collection: ICollectionNFT; - getData: (blockHashAt?: string) => Promise<{ - properties: IProperty[]; - owner: ICrossAccountId; - normalizedOwner: ICrossAccountId; - }| null>; - getOwner: (blockHashAt?: string) => Promise; - getTopmostOwner: (blockHashAt?: string) => Promise; - getChildren: (blockHashAt?: string) => Promise; // todo:playgrounds - nest: (signer: TSigner, toTokenObj: ITokenAddress) => Promise; - unnest: (signer: TSigner, fromTokenObj: ITokenAddress, toAddressObj: ICrossAccountId) => Promise; - transfer: (signer: TSigner, addressObj: ICrossAccountId) => Promise; - transferFrom: (signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId) => Promise; - approve: (signer: TSigner, toAddressObj: ICrossAccountId) => Promise; - isApproved: (toAddressObj: ICrossAccountId) => Promise; - burn: (signer: TSigner) => Promise<{ - success: boolean, - token: number | null - }>; - burnFrom: (signer: TSigner, fromAddressObj: ICrossAccountId) => Promise; -} - -export interface ITokenRefungible extends ITokenBase { - collection: ICollectionRFT; - getData: (blockHashAt?: string) => Promise<{ - properties: IProperty[]; - owner: ICrossAccountId; - normalizedOwner: ICrossAccountId; - }| null>; - getTop10Owners: () => Promise; - getBalance: (addressObj: ICrossAccountId) => Promise; - getTotalPieces: () => Promise; - getApprovedPieces: (fromAddressObj: ICrossAccountId, toAccountObj: ICrossAccountId) => Promise; - transfer: (signer: TSigner, addressObj: ICrossAccountId, amount: bigint) => Promise; - transferFrom: (signer: TSigner, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount: bigint) => Promise; - approve: (signer: TSigner, toAddressObj: ICrossAccountId, amount: bigint) => Promise; - repartition: (signer: TSigner, amount: bigint) => Promise; - burn: (signer: TSigner, amount: bigint) => Promise<{ - success: boolean, - token: number | null - }>; - burnFrom: (signer: TSigner, fromAddressObj: ICrossAccountId, amount: bigint) => Promise; -} diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index e725a1e933..eace500d9d 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -9,7 +9,7 @@ import {ApiPromise, WsProvider, Keyring} from '@polkadot/api'; import {ApiInterfaceEvents, SignerOptions} from '@polkadot/api/types'; import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; -import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISubstrateBalance, ITokenAddress, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks, ICollectionBase, ICollectionNFT, ICollectionRFT, ITokenBase, ITokenNonfungible, ITokenRefungible, ICollectionFT} from './types'; +import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; export const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => { const address = {} as ICrossAccountId; @@ -55,15 +55,15 @@ class UniqueUtil { RPC: 'rpc', }; - static getTokenAccount(token: ITokenAddress): ICrossAccountId { + static getTokenAccount(token: IToken): ICrossAccountId { return {Ethereum: this.getTokenAddress(token)}; } - static getTokenAccountInLowerCase(token: ITokenAddress): ICrossAccountId { + static getTokenAccountInLowerCase(token: IToken): ICrossAccountId { return {Ethereum: this.getTokenAddress(token).toLowerCase()}; } - static getTokenAddress(token: ITokenAddress): string { + static getTokenAddress(token: IToken): string { return nesting.tokenIdToAddress(token.collectionId, token.tokenId); } @@ -1218,7 +1218,7 @@ class NFTnRFT extends CollectionGroup { * @example mintCollection(aliceKeyring, {name: 'New', description: "New collection", tokenPrefix: "NEW"}, "NFT") * @returns object of the created collection */ - async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, mode: 'NFT' | 'RFT'): Promise { + async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, mode: 'NFT' | 'RFT'): Promise { collectionOptions = JSON.parse(JSON.stringify(collectionOptions)) as ICollectionCreationOptions; // Clone object collectionOptions.mode = (mode === 'NFT') ? {nft: null} : {refungible: null}; for (const key of ['name', 'description', 'tokenPrefix']) { @@ -1260,8 +1260,8 @@ class NFTGroup extends NFTnRFT { * @example getTokenObject(10, 5); * @returns instance of UniqueNFTToken */ - getTokenObject(collectionId: number, tokenId: number): UniqueNFTToken { - return new UniqueNFTToken(tokenId, this.getCollectionObject(collectionId)); + getTokenObject(collectionId: number, tokenId: number): UniqueNFToken { + return new UniqueNFToken(tokenId, this.getCollectionObject(collectionId)); } /** @@ -1352,7 +1352,7 @@ class NFTGroup extends NFTnRFT { * @example getTokenChildren(10, 5); * @returns tokens whose depth of nesting is <= 5 */ - async getTokenChildren(collectionId: number, tokenId: number, blockHashAt?: string): Promise { + async getTokenChildren(collectionId: number, tokenId: number, blockHashAt?: string): Promise { let children; if(typeof blockHashAt === 'undefined') { children = await this.helper.callRpc('api.rpc.unique.tokenChildren', [collectionId, tokenId]); @@ -1373,7 +1373,7 @@ class NFTGroup extends NFTnRFT { * @example nestToken(aliceKeyring, {collectionId: 10, tokenId: 5}, {collectionId: 10, tokenId: 4}); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async nestToken(signer: TSigner, tokenObj: ITokenAddress, rootTokenObj: ITokenAddress): Promise { + async nestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken): Promise { const rootTokenAddress = this.helper.util.getTokenAccount(rootTokenObj); const result = await this.transferToken(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress); if(!result) { @@ -1391,7 +1391,7 @@ class NFTGroup extends NFTnRFT { * @example unnestToken(aliceKeyring, {collectionId: 10, tokenId: 5}, {collectionId: 10, tokenId: 4}, {Substrate: "5DyN4Y92vZCjv38fg..."}); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async unnestToken(signer: TSigner, tokenObj: ITokenAddress, rootTokenObj: ITokenAddress, toAddressObj: ICrossAccountId): Promise { + async unnestToken(signer: TSigner, tokenObj: IToken, rootTokenObj: IToken, toAddressObj: ICrossAccountId): Promise { const rootTokenAddress = this.helper.util.getTokenAccount(rootTokenObj); const result = await this.transferTokenFrom(signer, tokenObj.collectionId, tokenObj.tokenId, rootTokenAddress, toAddressObj); if(!result) { @@ -1422,7 +1422,7 @@ class NFTGroup extends NFTnRFT { * @param data token data * @returns created token object */ - async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; properties?: IProperty[]; }): Promise { + async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; properties?: IProperty[]; }): Promise { const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createItem', [data.collectionId, (typeof data.owner === 'string') ? {Substrate: data.owner} : data.owner, { @@ -1453,14 +1453,14 @@ class NFTGroup extends NFTnRFT { * }]); * @returns ```true``` if extrinsic success, otherwise ```false``` */ - async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[]): Promise { + async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, properties?: IProperty[]}[]): Promise { const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createMultipleItemsEx', [collectionId, {NFT: tokens}], true, ); const collection = this.getCollectionObject(collectionId); - return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: ITokenAddress) => collection.getTokenObject(x.tokenId)); + return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); } /** @@ -1481,7 +1481,7 @@ class NFTGroup extends NFTnRFT { * }]); * @returns array of newly created tokens */ - async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {properties?: IProperty[]}[]): Promise { + async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {properties?: IProperty[]}[]): Promise { const rawTokens = []; for (const token of tokens) { const raw = {NFT: {properties: token.properties}}; @@ -1493,7 +1493,7 @@ class NFTGroup extends NFTnRFT { true, ); const collection = this.getCollectionObject(collectionId); - return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: ITokenAddress) => collection.getTokenObject(x.tokenId)); + return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); } /** @@ -1530,8 +1530,8 @@ class RFTGroup extends NFTnRFT { * @example getTokenObject(10, 5); * @returns instance of UniqueNFTToken */ - getTokenObject(collectionId: number, tokenId: number): UniqueRFTToken { - return new UniqueRFTToken(tokenId, this.getCollectionObject(collectionId)); + getTokenObject(collectionId: number, tokenId: number): UniqueRFToken { + return new UniqueRFToken(tokenId, this.getCollectionObject(collectionId)); } /** @@ -1609,7 +1609,7 @@ class RFTGroup extends NFTnRFT { * @example mintToken(aliceKeyring, {collectionId: 10, owner: {Substrate: '5GHoZe9c73RYbVzq...'}, pieces: 10000n}); * @returns created token object */ - async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; pieces: bigint; properties?: IProperty[]; }): Promise { + async mintToken(signer: TSigner, data: { collectionId: number; owner: ICrossAccountId | string; pieces: bigint; properties?: IProperty[]; }): Promise { const creationResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.createItem', [data.collectionId, (typeof data.owner === 'string') ? {Substrate: data.owner} : data.owner, { @@ -1626,7 +1626,7 @@ class RFTGroup extends NFTnRFT { return this.getTokenObject(data.collectionId, createdTokens.tokens[0].tokenId); } - async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, pieces: bigint, properties?: IProperty[]}[]): Promise { + async mintMultipleTokens(signer: TSigner, collectionId: number, tokens: {owner: ICrossAccountId, pieces: bigint, properties?: IProperty[]}[]): Promise { throw Error('Not implemented'); const creationResult = await this.helper.executeExtrinsic( signer, @@ -1634,7 +1634,7 @@ class RFTGroup extends NFTnRFT { true, // `Unable to mint RFT tokens for ${label}`, ); const collection = this.getCollectionObject(collectionId); - return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: ITokenAddress) => collection.getTokenObject(x.tokenId)); + return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); } /** @@ -1646,7 +1646,7 @@ class RFTGroup extends NFTnRFT { * @example mintMultipleTokensWithOneOwner(aliceKeyring, 10, {Substrate: "5GHoZe9c73RYbVzq..."}, [{pieces: 100000n, properties: [{key: "gender", value: "male"}]}]); * @returns array of newly created RFT tokens */ - async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {pieces: bigint, properties?: IProperty[]}[]): Promise { + async mintMultipleTokensWithOneOwner(signer: TSigner, collectionId: number, owner: ICrossAccountId, tokens: {pieces: bigint, properties?: IProperty[]}[]): Promise { const rawTokens = []; for (const token of tokens) { const raw = {ReFungible: {pieces: token.pieces, properties: token.properties}}; @@ -1658,7 +1658,7 @@ class RFTGroup extends NFTnRFT { true, ); const collection = this.getCollectionObject(collectionId); - return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: ITokenAddress) => collection.getTokenObject(x.tokenId)); + return this.helper.util.extractTokensFromCreationResult(creationResult).tokens.map((x: IToken) => collection.getTokenObject(x.tokenId)); } /** @@ -1985,7 +1985,7 @@ class ChainGroup extends HelperGroup { class BalanceGroup extends HelperGroup { /** - * Representation of the native token in the smallest unit + * Representation of the native token in the smallest unit - one OPAL (OPL), QUARTZ (QTZ), or UNIQUE (UNQ). * @example getOneTokenNominal() * @returns ```BigInt``` representation of the native token in the smallest unit, e.g. ```1_000_000_000_000_000_000n``` for QTZ. */ @@ -2223,7 +2223,7 @@ export class UniqueHelper extends ChainHelperBase { } -class UniqueCollectionBase implements ICollectionBase { +export class UniqueBaseCollection { helper: UniqueHelper; collectionId: number; @@ -2326,9 +2326,9 @@ class UniqueCollectionBase implements ICollectionBase { } -class UniqueNFTCollection extends UniqueCollectionBase implements ICollectionNFT { +export class UniqueNFTCollection extends UniqueBaseCollection { getTokenObject(tokenId: number) { - return new UniqueNFTToken(tokenId, this); + return new UniqueNFToken(tokenId, this); } async getTokensByAddress(addressObj: ICrossAccountId) { @@ -2403,19 +2403,19 @@ class UniqueNFTCollection extends UniqueCollectionBase implements ICollectionNFT return await this.helper.nft.setTokenPropertyPermissions(signer, this.collectionId, permissions); } - async nestToken(signer: TSigner, tokenId: number, toTokenObj: ITokenAddress) { + async nestToken(signer: TSigner, tokenId: number, toTokenObj: IToken) { return await this.helper.nft.nestToken(signer, {collectionId: this.collectionId, tokenId}, toTokenObj); } - async unnestToken(signer: TSigner, tokenId: number, fromTokenObj: ITokenAddress, toAddressObj: ICrossAccountId) { + async unnestToken(signer: TSigner, tokenId: number, fromTokenObj: IToken, toAddressObj: ICrossAccountId) { return await this.helper.nft.unnestToken(signer, {collectionId: this.collectionId, tokenId}, fromTokenObj, toAddressObj); } } -class UniqueRFTCollection extends UniqueCollectionBase implements ICollectionRFT { +export class UniqueRFTCollection extends UniqueBaseCollection { getTokenObject(tokenId: number) { - return new UniqueRFTToken(tokenId, this); + return new UniqueRFToken(tokenId, this); } async getToken(tokenId: number, blockHashAt?: string) { @@ -2496,7 +2496,7 @@ class UniqueRFTCollection extends UniqueCollectionBase implements ICollectionRFT } -class UniqueFTCollection extends UniqueCollectionBase implements ICollectionFT { +export class UniqueFTCollection extends UniqueBaseCollection { async getBalance(addressObj: ICrossAccountId) { return await this.helper.ft.getBalance(this.collectionId, addressObj); } @@ -2543,7 +2543,7 @@ class UniqueFTCollection extends UniqueCollectionBase implements ICollectionFT { } -class UniqueTokenBase implements ITokenBase { +export class UniqueBaseToken { collection: UniqueNFTCollection | UniqueRFTCollection; collectionId: number; tokenId: number; @@ -2580,7 +2580,7 @@ class UniqueTokenBase implements ITokenBase { } -class UniqueNFTToken extends UniqueTokenBase implements ITokenNonfungible { +export class UniqueNFToken extends UniqueBaseToken { collection: UniqueNFTCollection; constructor(tokenId: number, collection: UniqueNFTCollection) { @@ -2604,11 +2604,11 @@ class UniqueNFTToken extends UniqueTokenBase implements ITokenNonfungible { return await this.collection.getTokenChildren(this.tokenId, blockHashAt); } - async nest(signer: TSigner, toTokenObj: ITokenAddress) { + async nest(signer: TSigner, toTokenObj: IToken) { return await this.collection.nestToken(signer, this.tokenId, toTokenObj); } - async unnest(signer: TSigner, fromTokenObj: ITokenAddress, toAddressObj: ICrossAccountId) { + async unnest(signer: TSigner, fromTokenObj: IToken, toAddressObj: ICrossAccountId) { return await this.collection.unnestToken(signer, this.tokenId, fromTokenObj, toAddressObj); } @@ -2637,7 +2637,7 @@ class UniqueNFTToken extends UniqueTokenBase implements ITokenNonfungible { } } -class UniqueRFTToken extends UniqueTokenBase implements ITokenRefungible { +export class UniqueRFToken extends UniqueBaseToken { collection: UniqueRFTCollection; constructor(tokenId: number, collection: UniqueRFTCollection) { From ed1eea85386fd313bf318b3b83017e3b43099276 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Tue, 27 Sep 2022 14:26:44 +0000 Subject: [PATCH 0965/1274] tests(eth): NFT, RFT, FT tests refactored for playgrounds --- tests/package.json | 3 + tests/src/eth/fungible.test.ts | 587 ++++++-------- tests/src/eth/nonFungible.test.ts | 744 +++++++----------- tests/src/eth/reFungible.test.ts | 454 +++++------ tests/src/eth/reFungibleToken.test.ts | 760 +++++++------------ tests/src/eth/util/playgrounds/unique.dev.ts | 31 +- 6 files changed, 1026 insertions(+), 1553 deletions(-) diff --git a/tests/package.json b/tests/package.json index a37b6efb43..9f6830bd1b 100644 --- a/tests/package.json +++ b/tests/package.json @@ -87,8 +87,11 @@ "testLimits": "mocha --timeout 9999999 -r ts-node/register ./**/limits.test.ts", "testEthCreateNFTCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createNFTCollection.test.ts", "testEthCreateRFTCollection": "mocha --timeout 9999999 -r ts-node/register ./**/eth/createRFTCollection.test.ts", + "testEthNFT": "mocha --timeout 9999999 -r ts-node/register ./**/eth/nonFungible.test.ts", "testRFT": "mocha --timeout 9999999 -r ts-node/register ./**/refungible.test.ts", + "testEthRFT": "mocha --timeout 9999999 -r ts-node/register ./**/eth/reFungible.test.ts ./**/eth/reFungibleToken.test.ts", "testFT": "mocha --timeout 9999999 -r ts-node/register ./**/fungible.test.ts", + "testEthFT": "mocha --timeout 9999999 -r ts-node/register ./**/eth/fungible.test.ts", "testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts", "testPromotion": "mocha --timeout 9999999 -r ts-node/register ./**/app-promotion.test.ts", "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", diff --git a/tests/src/eth/fungible.test.ts b/tests/src/eth/fungible.test.ts index 9eb3d01306..238a0f6d9a 100644 --- a/tests/src/eth/fungible.test.ts +++ b/tests/src/eth/fungible.test.ts @@ -14,204 +14,132 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {approveExpectSuccess, createCollection, createCollectionExpectSuccess, createFungibleItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess, UNIQUE} from '../util/helpers'; -import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, GAS_ARGS, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, transferBalanceToEth} from './util/helpers'; -import fungibleAbi from './fungibleAbi.json'; -import {expect} from 'chai'; -import {submitTransactionAsync} from '../substrate/substrate-api'; +import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {IKeyringPair} from '@polkadot/types/types'; describe('Fungible: Information getting', () => { - itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'Fungible', decimalPoints: 0}, - }); - const alice = privateKeyWrapper('//Alice'); + let donor: IKeyringPair; + let alice: IKeyringPair; - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([20n], donor); + }); + }); - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Substrate: alice.address}); + itEth('totalSupply', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.ft.mintCollection(alice); + await collection.mint(alice, 200n); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(fungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'ft', caller); const totalSupply = await contract.methods.totalSupply().call(); - expect(totalSupply).to.equal('200'); }); - itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'Fungible', decimalPoints: 0}, - }); - const alice = privateKeyWrapper('//Alice'); - - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('balanceOf', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.ft.mintCollection(alice); + await collection.mint(alice, 200n, {Ethereum: caller}); - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Ethereum: caller}); - - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(fungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'ft', caller); const balance = await contract.methods.balanceOf(caller).call(); - expect(balance).to.equal('200'); }); }); describe('Fungible: Plain calls', () => { - itWeb3('Can perform mint()', async ({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const collection = await createCollection(api, alice, { - name: 'token name', - mode: {type: 'Fungible', decimalPoints: 0}, + let donor: IKeyringPair; + let alice: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([20n], donor); }); + }); - const receiver = createEthAccount(web3); + itEth('Can perform mint()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const collection = await helper.ft.mintCollection(alice); + await collection.addAdmin(alice, {Ethereum: owner}); - const collectionIdAddress = collectionIdToAddress(collection.collectionId); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const changeAdminTx = api.tx.unique.addCollectionAdmin(collection.collectionId, {Ethereum: owner}); - await submitTransactionAsync(alice, changeAdminTx); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner); - const collectionContract = evmCollection(web3, owner, collectionIdAddress, {type: 'Fungible', decimalPoints: 0}); - const result = await collectionContract.methods.mint(receiver, 100).send(); - const events = normalizeEvents(result.events); + const result = await contract.methods.mint(receiver, 100).send(); - expect(events).to.be.deep.equal([ - { - address: collectionIdAddress, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - value: '100', - }, - }, - ]); + const event = result.events.Transfer; + expect(event.address).to.equal(collectionAddress); + expect(event.returnValues.from).to.equal('0x0000000000000000000000000000000000000000'); + expect(event.returnValues.to).to.equal(receiver); + expect(event.returnValues.value).to.equal('100'); }); - itWeb3('Can perform mintBulk()', async ({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const collection = await createCollection(api, alice, { - name: 'token name', - mode: {type: 'Fungible', decimalPoints: 0}, - }); - - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const receiver1 = createEthAccount(web3); - const receiver2 = createEthAccount(web3); - const receiver3 = createEthAccount(web3); - - const collectionIdAddress = collectionIdToAddress(collection.collectionId); - const changeAdminTx = api.tx.unique.addCollectionAdmin(collection.collectionId, {Ethereum: owner}); - await submitTransactionAsync(alice, changeAdminTx); - - const collectionContract = evmCollection(web3, owner, collectionIdAddress, {type: 'Fungible', decimalPoints: 0}); - const result = await collectionContract.methods.mintBulk([ - [receiver1, 10], - [receiver2, 20], - [receiver3, 30], - ]).send(); - const events = normalizeEvents(result.events); - - expect(events).to.be.deep.contain({ - address:collectionIdAddress, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver1, - value: '10', - }, - }); - - expect(events).to.be.deep.contain({ - address:collectionIdAddress, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver2, - value: '20', - }, - }); - - expect(events).to.be.deep.contain({ - address:collectionIdAddress, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver3, - value: '30', - }, - }); + itEth('Can perform mintBulk()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const bulkSize = 3; + const receivers = [...new Array(bulkSize)].map(() => helper.eth.createAccount()); + const collection = await helper.ft.mintCollection(alice); + await collection.addAdmin(alice, {Ethereum: owner}); + + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner); + + const result = await contract.methods.mintBulk(Array.from({length: bulkSize}, (_, i) => ( + [receivers[i], (i + 1) * 10] + ))).send(); + const events = result.events.Transfer.sort((a: any, b: any) => +a.returnValues.value - b.returnValues.value); + for (let i = 0; i < bulkSize; i++) { + const event = events[i]; + expect(event.address).to.equal(collectionAddress); + expect(event.returnValues.from).to.equal('0x0000000000000000000000000000000000000000'); + expect(event.returnValues.to).to.equal(receivers[i]); + expect(event.returnValues.value).to.equal(String(10 * (i + 1))); + } }); - itWeb3('Can perform burn()', async ({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const collection = await createCollection(api, alice, { - name: 'token name', - mode: {type: 'Fungible', decimalPoints: 0}, - }); - - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const changeAdminTx = api.tx.unique.addCollectionAdmin(collection.collectionId, {Ethereum: owner}); - await submitTransactionAsync(alice, changeAdminTx); - const receiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('Can perform burn()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const receiver = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.ft.mintCollection(alice); + await collection.addAdmin(alice, {Ethereum: owner}); - const collectionIdAddress = collectionIdToAddress(collection.collectionId); - const collectionContract = evmCollection(web3, owner, collectionIdAddress, {type: 'Fungible', decimalPoints: 0}); - await collectionContract.methods.mint(receiver, 100).send(); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner); + await contract.methods.mint(receiver, 100).send(); - const result = await collectionContract.methods.burnFrom(receiver, 49).send({from: receiver}); + const result = await contract.methods.burnFrom(receiver, 49).send({from: receiver}); - const events = normalizeEvents(result.events); - - expect(events).to.be.deep.equal([ - { - address: collectionIdAddress, - event: 'Transfer', - args: { - from: receiver, - to: '0x0000000000000000000000000000000000000000', - value: '49', - }, - }, - ]); - - const balance = await collectionContract.methods.balanceOf(receiver).call(); + const event = result.events.Transfer; + expect(event.address).to.equal(collectionAddress); + expect(event.returnValues.from).to.equal(receiver); + expect(event.returnValues.to).to.equal('0x0000000000000000000000000000000000000000'); + expect(event.returnValues.value).to.equal('49'); + + const balance = await contract.methods.balanceOf(receiver).call(); expect(balance).to.equal('51'); }); - itWeb3('Can perform approve()', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'Fungible', decimalPoints: 0}, - }); - const alice = privateKeyWrapper('//Alice'); - - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('Can perform approve()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const spender = helper.eth.createAccount(); + const collection = await helper.ft.mintCollection(alice); + await collection.mint(alice, 200n, {Ethereum: owner}); - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Ethereum: owner}); - - const spender = createEthAccount(web3); - - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(fungibleAbi as any, address, {from: owner, ...GAS_ARGS}); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner); { const result = await contract.methods.approve(spender, 100).send({from: owner}); - const events = normalizeEvents(result.events); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Approval', - args: { - owner, - spender, - value: '100', - }, - }, - ]); + + const event = result.events.Approval; + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.owner).to.be.equal(owner); + expect(event.returnValues.spender).to.be.equal(spender); + expect(event.returnValues.value).to.be.equal('100'); } { @@ -220,51 +148,32 @@ describe('Fungible: Plain calls', () => { } }); - itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'Fungible', decimalPoints: 0}, - }); - const alice = privateKeyWrapper('//Alice'); - - const owner = createEthAccount(web3); - await transferBalanceToEth(api, alice, owner); - - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Ethereum: owner}); - - const spender = createEthAccount(web3); - await transferBalanceToEth(api, alice, spender); + itEth('Can perform transferFrom()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const spender = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const collection = await helper.ft.mintCollection(alice); + await collection.mint(alice, 200n, {Ethereum: owner}); - const receiver = createEthAccount(web3); - - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(fungibleAbi as any, address, {from: owner, ...GAS_ARGS}); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner); await contract.methods.approve(spender, 100).send(); { const result = await contract.methods.transferFrom(owner, receiver, 49).send({from: spender}); - const events = normalizeEvents(result.events); - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: owner, - to: receiver, - value: '49', - }, - }, - { - address, - event: 'Approval', - args: { - owner, - spender, - value: '51', - }, - }, - ]); + + let event = result.events.Transfer; + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.from).to.be.equal(owner); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.value).to.be.equal('49'); + + event = result.events.Approval; + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.owner).to.be.equal(owner); + expect(event.returnValues.spender).to.be.equal(spender); + expect(event.returnValues.value).to.be.equal('51'); } { @@ -278,38 +187,23 @@ describe('Fungible: Plain calls', () => { } }); - itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'Fungible', decimalPoints: 0}, - }); - const alice = privateKeyWrapper('//Alice'); - - const owner = createEthAccount(web3); - await transferBalanceToEth(api, alice, owner); - - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Ethereum: owner}); + itEth('Can perform transfer()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const receiver = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.ft.mintCollection(alice); + await collection.mint(alice, 200n, {Ethereum: owner}); - const receiver = createEthAccount(web3); - await transferBalanceToEth(api, alice, receiver); - - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(fungibleAbi as any, address, {from: owner, ...GAS_ARGS}); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner); { const result = await contract.methods.transfer(receiver, 50).send({from: owner}); - const events = normalizeEvents(result.events); - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: owner, - to: receiver, - value: '50', - }, - }, - ]); + + const event = result.events.Transfer; + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.from).to.be.equal(owner); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.value).to.be.equal('50'); } { @@ -325,162 +219,141 @@ describe('Fungible: Plain calls', () => { }); describe('Fungible: Fees', () => { - itWeb3('approve() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'Fungible', decimalPoints: 0}, - }); - const alice = privateKeyWrapper('//Alice'); - - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const spender = createEthAccount(web3); - - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Ethereum: owner}); + let donor: IKeyringPair; + let alice: IKeyringPair; - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(fungibleAbi as any, address, {from: owner, ...GAS_ARGS}); - - const cost = await recordEthFee(api, owner, () => contract.methods.approve(spender, 100).send({from: owner})); - expect(cost < BigInt(0.2 * Number(UNIQUE))); - }); - - itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'Fungible', decimalPoints: 0}, + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([20n], donor); }); - const alice = privateKeyWrapper('//Alice'); - - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const spender = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + }); + + itEth('approve() call fee is less than 0.2UNQ', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const spender = helper.eth.createAccount(); + const collection = await helper.ft.mintCollection(alice); + await collection.mint(alice, 200n, {Ethereum: owner}); + + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner); + + const cost = await helper.eth.recordCallFee(owner, () => contract.methods.approve(spender, 100).send({from: owner})); + expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); + }); - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Ethereum: owner}); + itEth('transferFrom() call fee is less than 0.2UNQ', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const spender = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.ft.mintCollection(alice); + await collection.mint(alice, 200n, {Ethereum: owner}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(fungibleAbi as any, address, {from: owner, ...GAS_ARGS}); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner); await contract.methods.approve(spender, 100).send({from: owner}); - const cost = await recordEthFee(api, spender, () => contract.methods.transferFrom(owner, spender, 100).send({from: spender})); - expect(cost < BigInt(0.2 * Number(UNIQUE))); + const cost = await helper.eth.recordCallFee(spender, () => contract.methods.transferFrom(owner, spender, 100).send({from: spender})); + expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); }); - itWeb3('transfer() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'Fungible', decimalPoints: 0}, - }); - const alice = privateKeyWrapper('//Alice'); + itEth('transfer() call fee is less than 0.2UNQ', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const collection = await helper.ft.mintCollection(alice); + await collection.mint(alice, 200n, {Ethereum: owner}); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const receiver = createEthAccount(web3); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'ft', owner); - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Ethereum: owner}); - - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(fungibleAbi as any, address, {from: owner, ...GAS_ARGS}); - - const cost = await recordEthFee(api, owner, () => contract.methods.transfer(receiver, 100).send({from: owner})); - expect(cost < BigInt(0.2 * Number(UNIQUE))); + const cost = await helper.eth.recordCallFee(owner, () => contract.methods.transfer(receiver, 100).send({from: owner})); + expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); }); }); describe('Fungible: Substrate calls', () => { - itWeb3('Events emitted for approve()', async ({web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'Fungible', decimalPoints: 0}, - }); - const alice = privateKeyWrapper('//Alice'); + let donor: IKeyringPair; + let alice: IKeyringPair; - const receiver = createEthAccount(web3); + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([20n], donor); + }); + }); - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}); + itEth('Events emitted for approve()', async ({helper}) => { + const receiver = helper.eth.createAccount(); + const collection = await helper.ft.mintCollection(alice); + await collection.mint(alice, 200n); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(fungibleAbi as any, address); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'ft'); - const events = await recordEvents(contract, async () => { - await approveExpectSuccess(collection, 0, alice, {Ethereum: receiver}, 100); + const events: any = []; + contract.events.allEvents((_: any, event: any) => { + events.push(event); }); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Approval', - args: { - owner: subToEth(alice.address), - spender: receiver, - value: '100', - }, - }, - ]); + await collection.approveTokens(alice, {Ethereum: receiver}, 100n); + + const event = events[0]; + expect(event.event).to.be.equal('Approval'); + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.owner).to.be.equal(helper.address.substrateToEth(alice.address)); + expect(event.returnValues.spender).to.be.equal(receiver); + expect(event.returnValues.value).to.be.equal('100'); }); - itWeb3('Events emitted for transferFrom()', async ({web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'Fungible', decimalPoints: 0}, - }); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - - const receiver = createEthAccount(web3); - - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}); - await approveExpectSuccess(collection, 0, alice, bob.address, 100); + itEth('Events emitted for transferFrom()', async ({helper}) => { + const [bob] = await helper.arrange.createAccounts([10n], donor); + const receiver = helper.eth.createAccount(); + const collection = await helper.ft.mintCollection(alice); + await collection.mint(alice, 200n); + await collection.approveTokens(alice, {Substrate: bob.address}, 100n); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(fungibleAbi as any, address); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'ft'); - const events = await recordEvents(contract, async () => { - await transferFromExpectSuccess(collection, 0, bob, alice, {Ethereum: receiver}, 51, 'Fungible'); + const events: any = []; + contract.events.allEvents((_: any, event: any) => { + events.push(event); }); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: subToEth(alice.address), - to: receiver, - value: '51', - }, - }, - { - address, - event: 'Approval', - args: { - owner: subToEth(alice.address), - spender: subToEth(bob.address), - value: '49', - }, - }, - ]); + await collection.transferFrom(bob, {Substrate: alice.address}, {Ethereum: receiver}, 51n); + + let event = events[0]; + expect(event.event).to.be.equal('Transfer'); + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.from).to.be.equal(helper.address.substrateToEth(alice.address)); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.value).to.be.equal('51'); + + event = events[1]; + expect(event.event).to.be.equal('Approval'); + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.owner).to.be.equal(helper.address.substrateToEth(alice.address)); + expect(event.returnValues.spender).to.be.equal(helper.address.substrateToEth(bob.address)); + expect(event.returnValues.value).to.be.equal('49'); }); - itWeb3('Events emitted for transfer()', async ({web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'Fungible', decimalPoints: 0}, - }); - const alice = privateKeyWrapper('//Alice'); + itEth('Events emitted for transfer()', async ({helper}) => { + const receiver = helper.eth.createAccount(); + const collection = await helper.ft.mintCollection(alice); + await collection.mint(alice, 200n); - const receiver = createEthAccount(web3); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'ft'); - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}); - - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(fungibleAbi as any, address); - - const events = await recordEvents(contract, async () => { - await transferExpectSuccess(collection, 0, alice, {Ethereum:receiver}, 51, 'Fungible'); + const events: any = []; + contract.events.allEvents((_: any, event: any) => { + events.push(event); }); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: subToEth(alice.address), - to: receiver, - value: '51', - }, - }, - ]); + await collection.transfer(alice, {Ethereum:receiver}, 51n); + + const event = events[0]; + expect(event.event).to.be.equal('Transfer'); + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.from).to.be.equal(helper.address.substrateToEth(alice.address)); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.value).to.be.equal('51'); }); }); diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 7cc25c3983..b1c38fb717 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -14,72 +14,78 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {approveExpectSuccess, burnItemExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess, UNIQUE} from '../util/helpers'; -import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, transferBalanceToEth} from './util/helpers'; -import nonFungibleAbi from './nonFungibleAbi.json'; -import {expect} from 'chai'; -import {submitTransactionAsync} from '../substrate/substrate-api'; +import {itEth, usingEthPlaygrounds, expect, EthUniqueHelper} from './util/playgrounds'; +import {IKeyringPair} from '@polkadot/types/types'; +import {Contract} from 'web3-eth-contract'; describe('NFT: Information getting', () => { - itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, + let donor: IKeyringPair; + let alice: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); }); - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + }); + + itEth('totalSupply', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {}); + await collection.mintToken(alice); - await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: alice.address}); + const caller = await helper.eth.createAccountWithBalance(donor); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller); const totalSupply = await contract.methods.totalSupply().call(); expect(totalSupply).to.equal('1'); }); - itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); + itEth('balanceOf', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {}); + const caller = await helper.eth.createAccountWithBalance(donor); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum:caller}); - await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: caller}); - await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: caller}); + await collection.mintToken(alice, {Ethereum: caller}); + await collection.mintToken(alice, {Ethereum: caller}); + await collection.mintToken(alice, {Ethereum: caller}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller); const balance = await contract.methods.balanceOf(caller).call(); expect(balance).to.equal('3'); }); - itWeb3('ownerOf', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); + itEth('ownerOf', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {}); + const caller = await helper.eth.createAccountWithBalance(donor); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: caller}); + const token = await collection.mintToken(alice, {Ethereum: caller}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); - const owner = await contract.methods.ownerOf(tokenId).call(); + const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller); + + const owner = await contract.methods.ownerOf(token.tokenId).call(); expect(owner).to.equal(caller); }); }); describe('Check ERC721 token URI for NFT', () => { - itWeb3('Empty tokenURI', async ({web3, api, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, owner); - let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', '').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const receiver = createEthAccount(web3); - const contract = evmCollection(web3, owner, collectionIdAddress); + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); + + async function setup(helper: EthUniqueHelper, tokenPrefix: string, propertyKey?: string, propertyValue?: string): Promise<{contract: Contract, nextTokenId: string}> { + const owner = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + + const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); + let result = await collectionHelper.methods.createERC721MetadataCompatibleCollection('Mint collection', 'a', 'b', tokenPrefix).send(); + const collectionAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); const nextTokenId = await contract.methods.nextTokenId().call(); expect(nextTokenId).to.be.equal('1'); @@ -88,162 +94,73 @@ describe('Check ERC721 token URI for NFT', () => { nextTokenId, ).send(); - const events = normalizeEvents(result.events); - const address = collectionIdToAddress(collectionId); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: nextTokenId, - }, - }, - ]); + if (propertyKey && propertyValue) { + // Set URL or suffix + await contract.methods.setProperty(nextTokenId, propertyKey, Buffer.from(propertyValue)).send(); + } + + const event = result.events.Transfer; + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000'); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.tokenId).to.be.equal(nextTokenId); + + return {contract, nextTokenId}; + } + itEth('Empty tokenURI', async ({helper}) => { + const {contract, nextTokenId} = await setup(helper, ''); expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal(''); }); - itWeb3('TokenURI from url', async ({web3, api, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, owner); - let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', 'BaseURI_').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const receiver = createEthAccount(web3); - const contract = evmCollection(web3, owner, collectionIdAddress); - - const nextTokenId = await contract.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - result = await contract.methods.mint( - receiver, - nextTokenId, - ).send(); - - // Set URL - await contract.methods.setProperty(nextTokenId, 'url', Buffer.from('Token URI')).send(); - - const events = normalizeEvents(result.events); - const address = collectionIdToAddress(collectionId); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: nextTokenId, - }, - }, - ]); - + itEth('TokenURI from url', async ({helper}) => { + const {contract, nextTokenId} = await setup(helper, 'BaseURI_', 'url', 'Token URI'); expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Token URI'); }); - itWeb3('TokenURI from baseURI + tokenId', async ({web3, api, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, owner); - let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', 'BaseURI_').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const receiver = createEthAccount(web3); - const contract = evmCollection(web3, owner, collectionIdAddress); - - const nextTokenId = await contract.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - result = await contract.methods.mint( - receiver, - nextTokenId, - ).send(); - - const events = normalizeEvents(result.events); - const address = collectionIdToAddress(collectionId); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: nextTokenId, - }, - }, - ]); - + itEth('TokenURI from baseURI + tokenId', async ({helper}) => { + const {contract, nextTokenId} = await setup(helper, 'BaseURI_'); expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('BaseURI_' + nextTokenId); }); - itWeb3('TokenURI from baseURI + suffix', async ({web3, api, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, owner); - let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', 'BaseURI_').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const receiver = createEthAccount(web3); - const contract = evmCollection(web3, owner, collectionIdAddress); - - const nextTokenId = await contract.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - result = await contract.methods.mint( - receiver, - nextTokenId, - ).send(); - - // Set suffix + itEth('TokenURI from baseURI + suffix', async ({helper}) => { const suffix = '/some/suffix'; - await contract.methods.setProperty(nextTokenId, 'suffix', Buffer.from(suffix)).send(); - - const events = normalizeEvents(result.events); - const address = collectionIdToAddress(collectionId); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: nextTokenId, - }, - }, - ]); - + const {contract, nextTokenId} = await setup(helper, 'BaseURI_', 'suffix', suffix); expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('BaseURI_' + suffix); }); }); describe('NFT: Plain calls', () => { - itWeb3('Can perform mint()', async ({web3, api, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, owner); - let result = await helper.methods.createNonfungibleCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const receiver = createEthAccount(web3); - const contract = evmCollection(web3, owner, collectionIdAddress); + let donor: IKeyringPair; + let alice: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); + }); + }); + + itEth('Can perform mint()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'Minty', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); const nextTokenId = await contract.methods.nextTokenId().call(); expect(nextTokenId).to.be.equal('1'); - result = await contract.methods.mintWithTokenURI( + const result = await contract.methods.mintWithTokenURI( receiver, nextTokenId, 'Test URI', ).send(); - const events = normalizeEvents(result.events); - const address = collectionIdToAddress(collectionId); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: nextTokenId, - }, - }, - ]); + const event = result.events.Transfer; + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000'); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.tokenId).to.be.equal(nextTokenId); expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); @@ -254,7 +171,8 @@ describe('NFT: Plain calls', () => { }); //TODO: CORE-302 add eth methods - itWeb3.skip('Can perform mintBulk()', async ({web3, api, privateKeyWrapper}) => { + /* todo:playgrounds skipped test! + itWeb3.skip('Can perform mintBulk()', async ({helper}) => { const collection = await createCollectionExpectSuccess({ mode: {type: 'NFT'}, }); @@ -316,107 +234,70 @@ describe('NFT: Plain calls', () => { expect(await contract.methods.tokenURI(+nextTokenId + 2).call()).to.be.equal('Test URI 2'); } }); + */ - itWeb3('Can perform burn()', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); + itEth('Can perform burn()', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collection = await helper.nft.mintCollection(alice, {}); + const {tokenId} = await collection.mintToken(alice, {Ethereum: caller}); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: owner}); - - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: owner, ...GAS_ARGS}); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', caller); { - const result = await contract.methods.burn(tokenId).send({from: owner}); - const events = normalizeEvents(result.events); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: owner, - to: '0x0000000000000000000000000000000000000000', - tokenId: tokenId.toString(), - }, - }, - ]); + const result = await contract.methods.burn(tokenId).send({from: caller}); + + const event = result.events.Transfer; + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.from).to.be.equal(caller); + expect(event.returnValues.to).to.be.equal('0x0000000000000000000000000000000000000000'); + expect(event.returnValues.tokenId).to.be.equal(`${tokenId}`); } }); - itWeb3('Can perform approve()', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); - - const owner = createEthAccount(web3); - await transferBalanceToEth(api, alice, owner); + itEth('Can perform approve()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const spender = helper.eth.createAccount(); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: owner}); + const collection = await helper.nft.mintCollection(alice, {}); + const {tokenId} = await collection.mintToken(alice, {Ethereum: owner}); - const spender = createEthAccount(web3); - - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); { - const result = await contract.methods.approve(spender, tokenId).send({from: owner, ...GAS_ARGS}); - const events = normalizeEvents(result.events); + const result = await contract.methods.approve(spender, tokenId).send({from: owner}); - expect(events).to.be.deep.equal([ - { - address, - event: 'Approval', - args: { - owner, - approved: spender, - tokenId: tokenId.toString(), - }, - }, - ]); + const event = result.events.Approval; + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.owner).to.be.equal(owner); + expect(event.returnValues.approved).to.be.equal(spender); + expect(event.returnValues.tokenId).to.be.equal(`${tokenId}`); } }); - itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); - - const owner = createEthAccount(web3); - await transferBalanceToEth(api, alice, owner); - - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: owner}); + itEth('Can perform transferFrom()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const spender = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); - const spender = createEthAccount(web3); - await transferBalanceToEth(api, alice, spender); + const collection = await helper.nft.mintCollection(alice, {}); + const {tokenId} = await collection.mintToken(alice, {Ethereum: owner}); - const receiver = createEthAccount(web3); - - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: owner, ...GAS_ARGS}); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await contract.methods.approve(spender, tokenId).send({from: owner}); { const result = await contract.methods.transferFrom(owner, receiver, tokenId).send({from: spender}); - const events = normalizeEvents(result.events); - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: owner, - to: receiver, - tokenId: tokenId.toString(), - }, - }, - ]); + + const event = result.events.Transfer; + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.from).to.be.equal(owner); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.tokenId).to.be.equal(`${tokenId}`); } { @@ -430,37 +311,24 @@ describe('NFT: Plain calls', () => { } }); - itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); - - const owner = createEthAccount(web3); - await transferBalanceToEth(api, alice, owner); + itEth('Can perform transfer()', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {}); + const owner = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: owner}); + const {tokenId} = await collection.mintToken(alice, {Ethereum: owner}); - const receiver = createEthAccount(web3); - await transferBalanceToEth(api, alice, receiver); - - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: owner, ...GAS_ARGS}); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); { const result = await contract.methods.transfer(receiver, tokenId).send({from: owner}); - const events = normalizeEvents(result.events); - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: owner, - to: receiver, - tokenId: tokenId.toString(), - }, - }, - ]); + + const event = result.events.Transfer; + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.from).to.be.equal(owner); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.tokenId).to.be.equal(`${tokenId}`); } { @@ -476,237 +344,209 @@ describe('NFT: Plain calls', () => { }); describe('NFT: Fees', () => { - itWeb3('approve() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); + let donor: IKeyringPair; + let alice: IKeyringPair; - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const spender = createEthAccount(web3); + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); + }); + }); + + itEth('approve() call fee is less than 0.2UNQ', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const spender = helper.eth.createAccount(); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: owner}); + const collection = await helper.nft.mintCollection(alice, {}); + const {tokenId} = await collection.mintToken(alice, {Ethereum: owner}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: owner, ...GAS_ARGS}); + const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', owner); - const cost = await recordEthFee(api, owner, () => contract.methods.approve(spender, tokenId).send({from: owner})); - expect(cost < BigInt(0.2 * Number(UNIQUE))); + const cost = await helper.eth.recordCallFee(owner, () => contract.methods.approve(spender, tokenId).send({from: owner})); + expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); }); - itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); - - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const spender = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('transferFrom() call fee is less than 0.2UNQ', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const spender = await helper.eth.createAccountWithBalance(donor); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: owner}); + const collection = await helper.nft.mintCollection(alice, {}); + const {tokenId} = await collection.mintToken(alice, {Ethereum: owner}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: owner, ...GAS_ARGS}); + const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', owner); await contract.methods.approve(spender, tokenId).send({from: owner}); - const cost = await recordEthFee(api, spender, () => contract.methods.transferFrom(owner, spender, tokenId).send({from: spender})); - expect(cost < BigInt(0.2 * Number(UNIQUE))); + const cost = await helper.eth.recordCallFee(spender, () => contract.methods.transferFrom(owner, spender, tokenId).send({from: spender})); + expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); }); - itWeb3('transfer() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); - - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const receiver = createEthAccount(web3); + itEth('transfer() call fee is less than 0.2UNQ', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: owner}); + const collection = await helper.nft.mintCollection(alice, {}); + const {tokenId} = await collection.mintToken(alice, {Ethereum: owner}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: owner, ...GAS_ARGS}); + const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', owner); - const cost = await recordEthFee(api, owner, () => contract.methods.transfer(receiver, tokenId).send({from: owner})); - expect(cost < BigInt(0.2 * Number(UNIQUE))); + const cost = await helper.eth.recordCallFee(owner, () => contract.methods.transfer(receiver, tokenId).send({from: owner})); + expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); }); }); describe('NFT: Substrate calls', () => { - itWeb3('Events emitted for mint()', async ({web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); - - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address); + let donor: IKeyringPair; + let alice: IKeyringPair; - let tokenId: number; - const events = await recordEvents(contract, async () => { - tokenId = await createItemExpectSuccess(alice, collection, 'NFT'); + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([20n], donor); }); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: subToEth(alice.address), - tokenId: tokenId!.toString(), - }, - }, - ]); }); - itWeb3('Events emitted for burn()', async ({web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); - - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address); + itEth('Events emitted for mint()', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {}); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'nft'); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT'); - const events = await recordEvents(contract, async () => { - await burnItemExpectSuccess(alice, collection, tokenId); + const events: any = []; + contract.events.allEvents((_: any, event: any) => { + events.push(event); }); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: subToEth(alice.address), - to: '0x0000000000000000000000000000000000000000', - tokenId: tokenId.toString(), - }, - }, - ]); + const {tokenId} = await collection.mintToken(alice); + + const event = events[0]; + expect(event.event).to.be.equal('Transfer'); + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000'); + expect(event.returnValues.to).to.be.equal(helper.address.substrateToEth(alice.address)); + expect(event.returnValues.tokenId).to.be.equal(tokenId.toString()); }); - itWeb3('Events emitted for approve()', async ({web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); + itEth('Events emitted for burn()', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {}); + const token = await collection.mintToken(alice); - const receiver = createEthAccount(web3); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'nft'); + + const events: any = []; + contract.events.allEvents((_: any, event: any) => { + events.push(event); + }); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT'); + await token.burn(alice); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address); + const event = events[0]; + expect(event.event).to.be.equal('Transfer'); + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.from).to.be.equal(helper.address.substrateToEth(alice.address)); + expect(event.returnValues.to).to.be.equal('0x0000000000000000000000000000000000000000'); + expect(event.returnValues.tokenId).to.be.equal(token.tokenId.toString()); + }); - const events = await recordEvents(contract, async () => { - await approveExpectSuccess(collection, tokenId, alice, {Ethereum: receiver}, 1); - }); + itEth('Events emitted for approve()', async ({helper}) => { + const receiver = helper.eth.createAccount(); - expect(events).to.be.deep.equal([ - { - address, - event: 'Approval', - args: { - owner: subToEth(alice.address), - approved: receiver, - tokenId: tokenId.toString(), - }, - }, - ]); - }); + const collection = await helper.nft.mintCollection(alice, {}); + const token = await collection.mintToken(alice); - itWeb3('Events emitted for transferFrom()', async ({web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'nft'); + + const events: any = []; + contract.events.allEvents((_: any, event: any) => { + events.push(event); }); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const receiver = createEthAccount(web3); + await token.approve(alice, {Ethereum: receiver}); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT'); - await approveExpectSuccess(collection, tokenId, alice, bob.address, 1); + const event = events[0]; + expect(event.event).to.be.equal('Approval'); + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.owner).to.be.equal(helper.address.substrateToEth(alice.address)); + expect(event.returnValues.approved).to.be.equal(receiver); + expect(event.returnValues.tokenId).to.be.equal(token.tokenId.toString()); + }); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address); + itEth('Events emitted for transferFrom()', async ({helper}) => { + const [bob] = await helper.arrange.createAccounts([10n], donor); + const receiver = helper.eth.createAccount(); - const events = await recordEvents(contract, async () => { - await transferFromExpectSuccess(collection, tokenId, bob, alice, {Ethereum: receiver}, 1, 'NFT'); - }); + const collection = await helper.nft.mintCollection(alice, {}); + const token = await collection.mintToken(alice); + await token.approve(alice, {Substrate: bob.address}); - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: subToEth(alice.address), - to: receiver, - tokenId: tokenId.toString(), - }, - }, - ]); - }); - - itWeb3('Events emitted for transfer()', async ({web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'nft'); + + const events: any = []; + contract.events.allEvents((_: any, event: any) => { + events.push(event); }); - const alice = privateKeyWrapper('//Alice'); - const receiver = createEthAccount(web3); + await token.transferFrom(bob, {Substrate: alice.address}, {Ethereum: receiver}); + + const event = events[0]; + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.from).to.be.equal(helper.address.substrateToEth(alice.address)); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.tokenId).to.be.equal(`${token.tokenId}`); + }); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT'); + itEth('Events emitted for transfer()', async ({helper}) => { + const receiver = helper.eth.createAccount(); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address); + const collection = await helper.nft.mintCollection(alice, {}); + const token = await collection.mintToken(alice); - const events = await recordEvents(contract, async () => { - await transferExpectSuccess(collection, tokenId, alice, {Ethereum: receiver}, 1, 'NFT'); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'nft'); + + const events: any = []; + contract.events.allEvents((_: any, event: any) => { + events.push(event); }); - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: subToEth(alice.address), - to: receiver, - tokenId: tokenId.toString(), - }, - }, - ]); + await token.transfer(alice, {Ethereum: receiver}); + + const event = events[0]; + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.from).to.be.equal(helper.address.substrateToEth(alice.address)); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.tokenId).to.be.equal(`${token.tokenId}`); }); }); describe('Common metadata', () => { - itWeb3('Returns collection name', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'NFT'}, + let donor: IKeyringPair; + let alice: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([20n], donor); }); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + }); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); - const name = await contract.methods.name().call(); + itEth('Returns collection name', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.nft.mintCollection(alice, {name: 'oh River', tokenPrefix: 'CHANGE'}); - expect(name).to.equal('token name'); + const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller); + const name = await contract.methods.name().call(); + expect(name).to.equal('oh River'); }); - itWeb3('Returns symbol name', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - tokenPrefix: 'TOK', - mode: {type: 'NFT'}, - }); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('Returns symbol name', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.nft.mintCollection(alice, {name: 'oh River', tokenPrefix: 'CHANGE'}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller); const symbol = await contract.methods.symbol().call(); - - expect(symbol).to.equal('TOK'); + expect(symbol).to.equal('CHANGE'); }); }); \ No newline at end of file diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 4729cdb541..01861b980d 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -14,33 +14,35 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {createCollectionExpectSuccess, UNIQUE, requirePallets, Pallets} from '../util/helpers'; -import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, tokenIdToAddress, uniqueRefungibleToken} from './util/helpers'; -import {expect} from 'chai'; +import {Pallets, requirePalletsOrSkip} from '../util/playgrounds'; +import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {IKeyringPair} from '@polkadot/types/types'; describe('Refungible: Information getting', () => { + let donor: IKeyringPair; + before(async function() { - await requirePallets(this, [Pallets.ReFungible]); + await usingEthPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + + donor = privateKey('//Alice'); + }); }); - itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + itEth('totalSupply', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'TotalSupply', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const nextTokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, nextTokenId).send(); const totalSupply = await contract.methods.totalSupply().call(); expect(totalSupply).to.equal('1'); }); - itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + itEth('balanceOf', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'BalanceOf', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); { const nextTokenId = await contract.methods.nextTokenId().call(); @@ -56,38 +58,30 @@ describe('Refungible: Information getting', () => { } const balance = await contract.methods.balanceOf(caller).call(); - expect(balance).to.equal('3'); }); - itWeb3('ownerOf', async ({api, web3, privateKeyWrapper}) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + itEth('ownerOf', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'OwnerOf', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, tokenId).send(); const owner = await contract.methods.ownerOf(tokenId).call(); - expect(owner).to.equal(caller); }); - itWeb3('ownerOf after burn', async ({api, web3, privateKeyWrapper}) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const receiver = createEthAccount(web3); - const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + itEth('ownerOf after burn', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'OwnerOf-AfterBurn', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, tokenId).send(); - - const tokenAddress = tokenIdToAddress(collectionId, tokenId); - const tokenContract = uniqueRefungibleToken(web3, tokenAddress, caller); + const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller); await tokenContract.methods.repartition(2).send(); await tokenContract.methods.transfer(receiver, 1).send(); @@ -95,79 +89,66 @@ describe('Refungible: Information getting', () => { await tokenContract.methods.burnFrom(caller, 1).send(); const owner = await contract.methods.ownerOf(tokenId).call(); - expect(owner).to.equal(receiver); }); - itWeb3('ownerOf for partial ownership', async ({api, web3, privateKeyWrapper}) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const receiver = createEthAccount(web3); - const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + itEth('ownerOf for partial ownership', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Partial-OwnerOf', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, tokenId).send(); - - const tokenAddress = tokenIdToAddress(collectionId, tokenId); - const tokenContract = uniqueRefungibleToken(web3, tokenAddress, caller); + const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller); await tokenContract.methods.repartition(2).send(); await tokenContract.methods.transfer(receiver, 1).send(); const owner = await contract.methods.ownerOf(tokenId).call(); - expect(owner).to.equal('0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF'); }); }); describe('Refungible: Plain calls', () => { + let donor: IKeyringPair; + before(async function() { - await requirePallets(this, [Pallets.ReFungible]); + await usingEthPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + + donor = privateKey('//Alice'); + }); }); - itWeb3('Can perform mint()', async ({web3, api, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, owner); - let result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const receiver = createEthAccount(web3); - const contract = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); + itEth('Can perform mint()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Minty', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); + const nextTokenId = await contract.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - result = await contract.methods.mintWithTokenURI( + const result = await contract.methods.mintWithTokenURI( receiver, nextTokenId, 'Test URI', ).send(); - const events = normalizeEvents(result.events); - - expect(events).to.include.deep.members([ - { - address: collectionIdAddress, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: nextTokenId, - }, - }, - ]); + const event = result.events.Transfer; + expect(event.address).to.equal(collectionAddress); + expect(event.returnValues.from).to.equal('0x0000000000000000000000000000000000000000'); + expect(event.returnValues.to).to.equal(receiver); + expect(event.returnValues.tokenId).to.equal(nextTokenId); expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); }); - itWeb3('Can perform mintBulk()', async ({web3, api, privateKeyWrapper}) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); - - const receiver = createEthAccount(web3); + itEth('Can perform mintBulk()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'MintBulky', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); { const nextTokenId = await contract.methods.nextTokenId().call(); @@ -180,37 +161,15 @@ describe('Refungible: Plain calls', () => { [+nextTokenId + 2, 'Test URI 2'], ], ).send(); - const events = normalizeEvents(result.events); - - expect(events).to.include.deep.members([ - { - address: collectionIdAddress, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: nextTokenId, - }, - }, - { - address: collectionIdAddress, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: String(+nextTokenId + 1), - }, - }, - { - address: collectionIdAddress, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: String(+nextTokenId + 2), - }, - }, - ]); + + const events = result.events.Transfer; + for (let i = 0; i < 2; i++) { + const event = events[i]; + expect(event.address).to.equal(collectionAddress); + expect(event.returnValues.from).to.equal('0x0000000000000000000000000000000000000000'); + expect(event.returnValues.to).to.equal(receiver); + expect(event.returnValues.tokenId).to.equal(String(+nextTokenId + i)); + } expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI 0'); expect(await contract.methods.tokenURI(+nextTokenId + 1).call()).to.be.equal('Test URI 1'); @@ -218,76 +177,54 @@ describe('Refungible: Plain calls', () => { } }); - itWeb3('Can perform burn()', async ({web3, api, privateKeyWrapper}) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + itEth('Can perform burn()', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Burny', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, tokenId).send(); { const result = await contract.methods.burn(tokenId).send(); - const events = normalizeEvents(result.events); - expect(events).to.include.deep.members([ - { - address: collectionIdAddress, - event: 'Transfer', - args: { - from: caller, - to: '0x0000000000000000000000000000000000000000', - tokenId: tokenId.toString(), - }, - }, - ]); + const event = result.events.Transfer; + expect(event.address).to.equal(collectionAddress); + expect(event.returnValues.from).to.equal(caller); + expect(event.returnValues.to).to.equal('0x0000000000000000000000000000000000000000'); + expect(event.returnValues.tokenId).to.equal(tokenId.toString()); } }); - itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); - - const receiver = createEthAccount(web3); + itEth('Can perform transferFrom()', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'TransferFromy', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); + const tokenAddress = helper.ethAddress.fromTokenId(collectionId, tokenId); await contract.methods.mint(caller, tokenId).send(); - const address = tokenIdToAddress(collectionId, tokenId); - const tokenContract = uniqueRefungibleToken(web3, address, caller); + const tokenContract = helper.ethNativeContract.rftToken(tokenAddress, caller); await tokenContract.methods.repartition(15).send(); { - const erc20Events = await recordEvents(tokenContract, async () => { - const result = await contract.methods.transferFrom(caller, receiver, tokenId).send(); - const events = normalizeEvents(result.events); - expect(events).to.include.deep.members([ - { - address: collectionIdAddress, - event: 'Transfer', - args: { - from: caller, - to: receiver, - tokenId: tokenId.toString(), - }, - }, - ]); + const tokenEvents: any = []; + tokenContract.events.allEvents((_: any, event: any) => { + tokenEvents.push(event); }); - - expect(erc20Events).to.include.deep.members([ - { - address, - event: 'Transfer', - args: { - from: caller, - to: receiver, - value: '15', - }, - }, - ]); + const result = await contract.methods.transferFrom(caller, receiver, tokenId).send(); + + let event = result.events.Transfer; + expect(event.address).to.equal(collectionAddress); + expect(event.returnValues.from).to.equal(caller); + expect(event.returnValues.to).to.equal(receiver); + expect(event.returnValues.tokenId).to.equal(tokenId.toString()); + + event = tokenEvents[0]; + expect(event.address).to.equal(tokenAddress); + expect(event.returnValues.from).to.equal(caller); + expect(event.returnValues.to).to.equal(receiver); + expect(event.returnValues.value).to.equal('15'); } { @@ -301,32 +238,23 @@ describe('Refungible: Plain calls', () => { } }); - itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); - - const receiver = createEthAccount(web3); + itEth('Can perform transfer()', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Transferry', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, tokenId).send(); { const result = await contract.methods.transfer(receiver, tokenId).send(); - const events = normalizeEvents(result.events); - expect(events).to.include.deep.members([ - { - address: collectionIdAddress, - event: 'Transfer', - args: { - from: caller, - to: receiver, - tokenId: tokenId.toString(), - }, - }, - ]); + + const event = result.events.Transfer; + expect(event.address).to.equal(collectionAddress); + expect(event.returnValues.from).to.equal(caller); + expect(event.returnValues.to).to.equal(receiver); + expect(event.returnValues.tokenId).to.equal(tokenId.toString()); } { @@ -340,141 +268,127 @@ describe('Refungible: Plain calls', () => { } }); - itWeb3('transfer event on transfer from partial ownership to full ownership', async ({api, web3, privateKeyWrapper}) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const receiver = createEthAccount(web3); - const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + itEth('transfer event on transfer from partial ownership to full ownership', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Transferry-Partial-to-Full', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, tokenId).send(); - const tokenAddress = tokenIdToAddress(collectionId, tokenId); - const tokenContract = uniqueRefungibleToken(web3, tokenAddress, caller); + const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller); await tokenContract.methods.repartition(2).send(); await tokenContract.methods.transfer(receiver, 1).send(); - const events = await recordEvents(contract, async () => - await tokenContract.methods.transfer(receiver, 1).send()); - expect(events).to.deep.equal([ - { - address: collectionIdAddress, - event: 'Transfer', - args: { - from: '0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF', - to: receiver, - tokenId: tokenId.toString(), - }, - }, - ]); + const events: any = []; + contract.events.allEvents((_: any, event: any) => { + events.push(event); + }); + await tokenContract.methods.transfer(receiver, 1).send(); + + const event = events[0]; + expect(event.address).to.equal(collectionAddress); + expect(event.returnValues.from).to.equal('0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF'); + expect(event.returnValues.to).to.equal(receiver); + expect(event.returnValues.tokenId).to.equal(tokenId.toString()); }); - itWeb3('transfer event on transfer from full ownership to partial ownership', async ({api, web3, privateKeyWrapper}) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const receiver = createEthAccount(web3); - const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + itEth('transfer event on transfer from full ownership to partial ownership', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Transferry-Full-to-Partial', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, tokenId).send(); - const tokenAddress = tokenIdToAddress(collectionId, tokenId); - const tokenContract = uniqueRefungibleToken(web3, tokenAddress, caller); + const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller); await tokenContract.methods.repartition(2).send(); - const events = await recordEvents(contract, async () => - await tokenContract.methods.transfer(receiver, 1).send()); - - expect(events).to.deep.equal([ - { - address: collectionIdAddress, - event: 'Transfer', - args: { - from: caller, - to: '0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF', - tokenId: tokenId.toString(), - }, - }, - ]); + const events: any = []; + contract.events.allEvents((_: any, event: any) => { + events.push(event); + }); + await tokenContract.methods.transfer(receiver, 1).send(); + + const event = events[0]; + expect(event.address).to.equal(collectionAddress); + expect(event.returnValues.from).to.equal(caller); + expect(event.returnValues.to).to.equal('0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF'); + expect(event.returnValues.tokenId).to.equal(tokenId.toString()); }); }); describe('RFT: Fees', () => { + let donor: IKeyringPair; + before(async function() { - await requirePallets(this, [Pallets.ReFungible]); - }); + await usingEthPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + donor = privateKey('//Alice'); + }); + }); - const receiver = createEthAccount(web3); + itEth('transferFrom() call fee is less than 0.2UNQ', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Feeful-Transfer-From', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, tokenId).send(); - const cost = await recordEthFee(api, caller, () => contract.methods.transferFrom(caller, receiver, tokenId).send()); - expect(cost < BigInt(0.2 * Number(UNIQUE))); + const cost = await helper.eth.recordCallFee(caller, () => contract.methods.transferFrom(caller, receiver, tokenId).send()); + expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); expect(cost > 0n); }); - itWeb3('transfer() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); - - const receiver = createEthAccount(web3); + itEth('transfer() call fee is less than 0.2UNQ', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Feeful-Transfer', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, tokenId).send(); - const cost = await recordEthFee(api, caller, () => contract.methods.transfer(receiver, tokenId).send()); - expect(cost < BigInt(0.2 * Number(UNIQUE))); + const cost = await helper.eth.recordCallFee(caller, () => contract.methods.transfer(receiver, tokenId).send()); + expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); expect(cost > 0n); }); }); describe('Common metadata', () => { + let donor: IKeyringPair; + let alice: IKeyringPair; + before(async function() { - await requirePallets(this, [Pallets.ReFungible]); - }); + await usingEthPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - itWeb3('Returns collection name', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'ReFungible'}, + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([20n], donor); }); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + }); - const address = collectionIdToAddress(collection); - const contract = evmCollection(web3, caller, address, {type: 'ReFungible'}); + itEth('Returns collection name', async ({helper}) => { + const caller = helper.eth.createAccount(); + const collection = await helper.rft.mintCollection(alice, {name: 'Leviathan', tokenPrefix: '11'}); + + const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'rft', caller); const name = await contract.methods.name().call(); - - expect(name).to.equal('token name'); + expect(name).to.equal('Leviathan'); }); - itWeb3('Returns symbol name', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - tokenPrefix: 'TOK', - mode: {type: 'ReFungible'}, - }); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - - const address = collectionIdToAddress(collection); - const contract = evmCollection(web3, caller, address, {type: 'ReFungible'}); + itEth('Returns symbol name', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Leviathan', '', '12'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const symbol = await contract.methods.symbol().call(); - - expect(symbol).to.equal('TOK'); + expect(symbol).to.equal('12'); }); }); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 9acdf25341..0e0793238a 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -14,115 +14,76 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {approve, createCollection, createRefungibleToken, transfer, transferFrom, UNIQUE, requirePallets, Pallets} from '../util/helpers'; -import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, createRFTCollection, evmCollection, evmCollectionHelpers, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth, uniqueRefungible, uniqueRefungibleToken} from './util/helpers'; - -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -chai.use(chaiAsPromised); -const expect = chai.expect; +import {Pallets, requirePalletsOrSkip} from '../util/playgrounds'; +import {EthUniqueHelper, expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {IKeyringPair} from '@polkadot/types/types'; +import {Contract} from 'web3-eth-contract'; describe('Refungible token: Information getting', () => { - before(async function() { - await requirePallets(this, [Pallets.ReFungible]); - }); - - itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); + let donor: IKeyringPair; + let alice: IKeyringPair; - const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([20n], donor); + }); + }); - const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: caller})).itemId; + itEth('totalSupply', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.rft.mintCollection(alice, {tokenPrefix: 'MUON'}); + const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: caller}); - const address = tokenIdToAddress(collectionId, tokenId); - const contract = uniqueRefungibleToken(web3, address, caller); + const contract = helper.ethNativeContract.rftTokenById(collection.collectionId, tokenId, caller); const totalSupply = await contract.methods.totalSupply().call(); - expect(totalSupply).to.equal('200'); }); - itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - - const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; - - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - - const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: caller})).itemId; + itEth('balanceOf', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.rft.mintCollection(alice, {tokenPrefix: 'MUON'}); + const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: caller}); - const address = tokenIdToAddress(collectionId, tokenId); - const contract = uniqueRefungibleToken(web3, address, caller); + const contract = helper.ethNativeContract.rftTokenById(collection.collectionId, tokenId, caller); const balance = await contract.methods.balanceOf(caller).call(); - expect(balance).to.equal('200'); }); - itWeb3('decimals', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - - const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; - - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('decimals', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.rft.mintCollection(alice, {tokenPrefix: 'MUON'}); + const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: caller}); - const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: caller})).itemId; - - const address = tokenIdToAddress(collectionId, tokenId); - const contract = uniqueRefungibleToken(web3, address, caller); + const contract = helper.ethNativeContract.rftTokenById(collection.collectionId, tokenId, caller); const decimals = await contract.methods.decimals().call(); - expect(decimals).to.equal('0'); }); }); // FIXME: Need erc721 for ReFubgible. describe('Check ERC721 token URI for ReFungible', () => { - before(async function() { - await requirePallets(this, [Pallets.ReFungible]); - }); - - itWeb3('Empty tokenURI', async ({web3, api, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, owner); - let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', '').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const receiver = createEthAccount(web3); - const contract = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); - - const nextTokenId = await contract.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - result = await contract.methods.mint( - receiver, - nextTokenId, - ).send(); + let donor: IKeyringPair; - const events = normalizeEvents(result.events); - const address = collectionIdToAddress(collectionId); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: nextTokenId, - }, - }, - ]); + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal(''); + donor = privateKey('//Alice'); + }); }); - itWeb3('TokenURI from url', async ({web3, api, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, owner); - let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', 'BaseURI_').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const receiver = createEthAccount(web3); - const contract = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); + async function setup(helper: EthUniqueHelper, tokenPrefix: string, propertyKey?: string, propertyValue?: string): Promise<{contract: Contract, nextTokenId: string}> { + const owner = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); + let result = await collectionHelper.methods.createERC721MetadataCompatibleCollection('Mint collection', 'a', 'b', tokenPrefix).send(); + const collectionAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); + const nextTokenId = await contract.methods.nextTokenId().call(); expect(nextTokenId).to.be.equal('1'); result = await contract.methods.mint( @@ -130,133 +91,71 @@ describe('Check ERC721 token URI for ReFungible', () => { nextTokenId, ).send(); - // Set URL - await contract.methods.setProperty(nextTokenId, 'url', Buffer.from('Token URI')).send(); + if (propertyKey && propertyValue) { + // Set URL or suffix + await contract.methods.setProperty(nextTokenId, propertyKey, Buffer.from(propertyValue)).send(); + } - const events = normalizeEvents(result.events); - const address = collectionIdToAddress(collectionId); + const event = result.events.Transfer; + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000'); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.tokenId).to.be.equal(nextTokenId); - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: nextTokenId, - }, - }, - ]); + return {contract, nextTokenId}; + } - expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Token URI'); + itEth('Empty tokenURI', async ({helper}) => { + const {contract, nextTokenId} = await setup(helper, ''); + expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal(''); }); - itWeb3('TokenURI from baseURI + tokenId', async ({web3, api, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, owner); - let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', 'BaseURI_').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const receiver = createEthAccount(web3); - const contract = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); - - const nextTokenId = await contract.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - result = await contract.methods.mint( - receiver, - nextTokenId, - ).send(); - - const events = normalizeEvents(result.events); - const address = collectionIdToAddress(collectionId); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: nextTokenId, - }, - }, - ]); + itEth('TokenURI from url', async ({helper}) => { + const {contract, nextTokenId} = await setup(helper, 'BaseURI_', 'url', 'Token URI'); + expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Token URI'); + }); + itEth('TokenURI from baseURI + tokenId', async ({helper}) => { + const {contract, nextTokenId} = await setup(helper, 'BaseURI_'); expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('BaseURI_' + nextTokenId); }); - itWeb3('TokenURI from baseURI + suffix', async ({web3, api, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, owner); - let result = await helper.methods.createERC721MetadataCompatibleCollection('Mint collection', '1', '1', 'BaseURI_').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const receiver = createEthAccount(web3); - const contract = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); - - const nextTokenId = await contract.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - result = await contract.methods.mint( - receiver, - nextTokenId, - ).send(); - - // Set suffix + itEth('TokenURI from baseURI + suffix', async ({helper}) => { const suffix = '/some/suffix'; - await contract.methods.setProperty(nextTokenId, 'suffix', Buffer.from(suffix)).send(); - - const events = normalizeEvents(result.events); - const address = collectionIdToAddress(collectionId); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: nextTokenId, - }, - }, - ]); - + const {contract, nextTokenId} = await setup(helper, 'BaseURI_', 'suffix', suffix); expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('BaseURI_' + suffix); }); }); describe('Refungible: Plain calls', () => { - before(async function() { - await requirePallets(this, [Pallets.ReFungible]); - }); - - itWeb3('Can perform approve()', async ({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - - const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; - - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + let donor: IKeyringPair; + let alice: IKeyringPair; - const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: owner})).itemId; + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - const address = tokenIdToAddress(collectionId, tokenId); + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([50n], donor); + }); + }); - const spender = createEthAccount(web3); + itEth('Can perform approve()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const spender = helper.eth.createAccount(); + const collection = await helper.rft.mintCollection(alice); + const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: owner}); - const contract = uniqueRefungibleToken(web3, address, owner); + const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId); + const contract = helper.ethNativeContract.rftToken(tokenAddress, owner); { const result = await contract.methods.approve(spender, 100).send({from: owner}); - const events = normalizeEvents(result.events); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Approval', - args: { - owner, - spender, - value: '100', - }, - }, - ]); + const event = result.events.Approval; + expect(event.address).to.be.equal(tokenAddress); + expect(event.returnValues.owner).to.be.equal(owner); + expect(event.returnValues.spender).to.be.equal(spender); + expect(event.returnValues.value).to.be.equal('100'); } { @@ -265,49 +164,31 @@ describe('Refungible: Plain calls', () => { } }); - itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - - const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; - - const owner = createEthAccount(web3); - await transferBalanceToEth(api, alice, owner); - - const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: owner})).itemId; - - const spender = createEthAccount(web3); - await transferBalanceToEth(api, alice, spender); + itEth('Can perform transferFrom()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const spender = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const collection = await helper.rft.mintCollection(alice); + const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: owner}); - const receiver = createEthAccount(web3); - - const address = tokenIdToAddress(collectionId, tokenId); - const contract = uniqueRefungibleToken(web3, address, owner); + const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId); + const contract = helper.ethNativeContract.rftToken(tokenAddress, owner); await contract.methods.approve(spender, 100).send(); { const result = await contract.methods.transferFrom(owner, receiver, 49).send({from: spender}); - const events = normalizeEvents(result.events); - expect(events).to.include.deep.members([ - { - address, - event: 'Transfer', - args: { - from: owner, - to: receiver, - value: '49', - }, - }, - { - address, - event: 'Approval', - args: { - owner, - spender, - value: '51', - }, - }, - ]); + let event = result.events.Transfer; + expect(event.address).to.be.equal(tokenAddress); + expect(event.returnValues.from).to.be.equal(owner); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.value).to.be.equal('49'); + + event = result.events.Approval; + expect(event.address).to.be.equal(tokenAddress); + expect(event.returnValues.owner).to.be.equal(owner); + expect(event.returnValues.spender).to.be.equal(spender); + expect(event.returnValues.value).to.be.equal('51'); } { @@ -321,36 +202,22 @@ describe('Refungible: Plain calls', () => { } }); - itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - - const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; - - const owner = createEthAccount(web3); - await transferBalanceToEth(api, alice, owner); - - const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: owner})).itemId; + itEth('Can perform transfer()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const collection = await helper.rft.mintCollection(alice); + const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: owner}); - const receiver = createEthAccount(web3); - await transferBalanceToEth(api, alice, receiver); - - const address = tokenIdToAddress(collectionId, tokenId); - const contract = uniqueRefungibleToken(web3, address, owner); + const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId); + const contract = helper.ethNativeContract.rftToken(tokenAddress, owner); { const result = await contract.methods.transfer(receiver, 50).send({from: owner}); - const events = normalizeEvents(result.events); - expect(events).to.include.deep.members([ - { - address, - event: 'Transfer', - args: { - from: owner, - to: receiver, - value: '50', - }, - }, - ]); + const event = result.events.Transfer; + expect(event.address).to.be.equal(tokenAddress); + expect(event.returnValues.from).to.be.equal(owner); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.value).to.be.equal('50'); } { @@ -364,21 +231,14 @@ describe('Refungible: Plain calls', () => { } }); - itWeb3('Can perform repartition()', async ({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - - const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; - - const owner = createEthAccount(web3); - await transferBalanceToEth(api, alice, owner); + itEth('Can perform repartition()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const receiver = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.rft.mintCollection(alice); + const {tokenId} = await collection.mintToken(alice, 100n, {Ethereum: owner}); - const receiver = createEthAccount(web3); - await transferBalanceToEth(api, alice, receiver); - - const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n, {Ethereum: owner})).itemId; - - const address = tokenIdToAddress(collectionId, tokenId); - const contract = uniqueRefungibleToken(web3, address, owner); + const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId); + const contract = helper.ethNativeContract.rftToken(tokenAddress, owner); await contract.methods.repartition(200).send({from: owner}); expect(+await contract.methods.balanceOf(owner).call()).to.be.equal(200); @@ -386,289 +246,247 @@ describe('Refungible: Plain calls', () => { expect(+await contract.methods.balanceOf(owner).call()).to.be.equal(90); expect(+await contract.methods.balanceOf(receiver).call()).to.be.equal(110); - await expect(contract.methods.repartition(80).send({from: owner})).to.eventually.be.rejected; + await expect(contract.methods.repartition(80).send({from: owner})).to.eventually.be.rejected; // Transaction is reverted await contract.methods.transfer(receiver, 90).send({from: owner}); expect(+await contract.methods.balanceOf(owner).call()).to.be.equal(0); expect(+await contract.methods.balanceOf(receiver).call()).to.be.equal(200); await contract.methods.repartition(150).send({from: receiver}); - await expect(contract.methods.transfer(owner, 160).send({from: receiver})).to.eventually.be.rejected; + await expect(contract.methods.transfer(owner, 160).send({from: receiver})).to.eventually.be.rejected; // Transaction is reverted expect(+await contract.methods.balanceOf(receiver).call()).to.be.equal(150); }); - itWeb3('Can repartition with increased amount', async ({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - - const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; - - const owner = createEthAccount(web3); - await transferBalanceToEth(api, alice, owner); + itEth('Can repartition with increased amount', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.rft.mintCollection(alice); + const {tokenId} = await collection.mintToken(alice, 100n, {Ethereum: owner}); - const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n, {Ethereum: owner})).itemId; - - const address = tokenIdToAddress(collectionId, tokenId); - const contract = uniqueRefungibleToken(web3, address, owner); + const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId); + const contract = helper.ethNativeContract.rftToken(tokenAddress, owner); const result = await contract.methods.repartition(200).send(); - const events = normalizeEvents(result.events); - - expect(events).to.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: owner, - value: '100', - }, - }, - ]); - }); - - itWeb3('Can repartition with decreased amount', async ({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const collectionId = (await createCollection(api, alice, {name: 'token name', mode: {type: 'ReFungible'}})).collectionId; - - const owner = createEthAccount(web3); - await transferBalanceToEth(api, alice, owner); + const event = result.events.Transfer; + expect(event.address).to.be.equal(tokenAddress); + expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000'); + expect(event.returnValues.to).to.be.equal(owner); + expect(event.returnValues.value).to.be.equal('100'); + }); - const tokenId = (await createRefungibleToken(api, alice, collectionId, 100n, {Ethereum: owner})).itemId; + itEth('Can repartition with decreased amount', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.rft.mintCollection(alice); + const {tokenId} = await collection.mintToken(alice, 100n, {Ethereum: owner}); - const address = tokenIdToAddress(collectionId, tokenId); - const contract = uniqueRefungibleToken(web3, address, owner); + const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId); + const contract = helper.ethNativeContract.rftToken(tokenAddress, owner); const result = await contract.methods.repartition(50).send(); - const events = normalizeEvents(result.events); - expect(events).to.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: owner, - to: '0x0000000000000000000000000000000000000000', - value: '50', - }, - }, - ]); + const event = result.events.Transfer; + expect(event.address).to.be.equal(tokenAddress); + expect(event.returnValues.from).to.be.equal(owner); + expect(event.returnValues.to).to.be.equal('0x0000000000000000000000000000000000000000'); + expect(event.returnValues.value).to.be.equal('50'); }); - itWeb3('Receiving Transfer event on burning into full ownership', async ({web3, api, privateKeyWrapper}) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const receiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, caller); - const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'}); + itEth('Receiving Transfer event on burning into full ownership', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const receiver = await helper.eth.createAccountWithBalance(donor); + const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Devastation', '6', '6'); + const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, tokenId).send(); + const tokenAddress = helper.ethAddress.fromTokenId(collectionId, tokenId); + const tokenContract = helper.ethNativeContract.rftToken(tokenAddress, caller); - const address = tokenIdToAddress(collectionId, tokenId); - - const tokenContract = uniqueRefungibleToken(web3, address, caller); await tokenContract.methods.repartition(2).send(); await tokenContract.methods.transfer(receiver, 1).send(); - const events = await recordEvents(contract, async () => - await tokenContract.methods.burnFrom(caller, 1).send()); - expect(events).to.deep.equal([ - { - address: collectionIdAddress, - event: 'Transfer', - args: { - from: '0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF', - to: receiver, - tokenId, - }, - }, - ]); + const events: any = []; + contract.events.allEvents((_: any, event: any) => { + events.push(event); + }); + await tokenContract.methods.burnFrom(caller, 1).send(); + + const event = events[0]; + expect(event.address).to.be.equal(collectionAddress); + expect(event.returnValues.from).to.be.equal('0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF'); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.tokenId).to.be.equal(tokenId); }); }); describe('Refungible: Fees', () => { - before(async function() { - await requirePallets(this, [Pallets.ReFungible]); - }); + let donor: IKeyringPair; + let alice: IKeyringPair; - itWeb3('approve() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - - const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; - - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const spender = createEthAccount(web3); - - const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: owner})).itemId; - - const address = tokenIdToAddress(collectionId, tokenId); - const contract = uniqueRefungibleToken(web3, address, owner); + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - const cost = await recordEthFee(api, owner, () => contract.methods.approve(spender, 100).send({from: owner})); - expect(cost < BigInt(0.2 * Number(UNIQUE))); + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([50n], donor); + }); }); - itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); + itEth('approve() call fee is less than 0.2UNQ', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const spender = helper.eth.createAccount(); + const collection = await helper.rft.mintCollection(alice); + const {tokenId} = await collection.mintToken(alice, 100n, {Ethereum: owner}); - const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; + const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId); + const contract = helper.ethNativeContract.rftToken(tokenAddress, owner); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const spender = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const cost = await helper.eth.recordCallFee(owner, () => contract.methods.approve(spender, 100).send({from: owner})); + expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); + }); - const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: owner})).itemId; + itEth('transferFrom() call fee is less than 0.2UNQ', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const spender = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.rft.mintCollection(alice); + const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: owner}); - const address = tokenIdToAddress(collectionId, tokenId); - const contract = uniqueRefungibleToken(web3, address, owner); + const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId); + const contract = helper.ethNativeContract.rftToken(tokenAddress, owner); await contract.methods.approve(spender, 100).send({from: owner}); - const cost = await recordEthFee(api, spender, () => contract.methods.transferFrom(owner, spender, 100).send({from: spender})); - expect(cost < BigInt(0.2 * Number(UNIQUE))); + const cost = await helper.eth.recordCallFee(spender, () => contract.methods.transferFrom(owner, spender, 100).send({from: spender})); + expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); }); - itWeb3('transfer() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); + itEth('transfer() call fee is less than 0.2UNQ', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + const collection = await helper.rft.mintCollection(alice); + const {tokenId} = await collection.mintToken(alice, 200n, {Ethereum: owner}); - const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; + const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, tokenId); + const contract = helper.ethNativeContract.rftToken(tokenAddress, owner); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const receiver = createEthAccount(web3); - - const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n, {Ethereum: owner})).itemId; - - const address = tokenIdToAddress(collectionId, tokenId); - const contract = uniqueRefungibleToken(web3, address, owner); - - const cost = await recordEthFee(api, owner, () => contract.methods.transfer(receiver, 100).send({from: owner})); - expect(cost < BigInt(0.2 * Number(UNIQUE))); + const cost = await helper.eth.recordCallFee(owner, () => contract.methods.transfer(receiver, 100).send({from: owner})); + expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); }); }); describe('Refungible: Substrate calls', () => { - before(async function() { - await requirePallets(this, [Pallets.ReFungible]); - }); - - itWeb3('Events emitted for approve()', async ({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - - const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; + let donor: IKeyringPair; + let alice: IKeyringPair; - const receiver = createEthAccount(web3); - - const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n)).itemId; - - const address = tokenIdToAddress(collectionId, tokenId); - const contract = uniqueRefungibleToken(web3, address); + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - const events = await recordEvents(contract, async () => { - expect(await approve(api, collectionId, tokenId, alice, {Ethereum: receiver}, 100n)).to.be.true; + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([50n], donor); }); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Approval', - args: { - owner: subToEth(alice.address), - spender: receiver, - value: '100', - }, - }, - ]); }); - itWeb3('Events emitted for transferFrom()', async ({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); + itEth('Events emitted for approve()', async ({helper}) => { + const receiver = helper.eth.createAccount(); + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice, 200n); - const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; - const bob = privateKeyWrapper('//Bob'); + const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, token.tokenId); + const contract = helper.ethNativeContract.rftToken(tokenAddress); - const receiver = createEthAccount(web3); + const events: any = []; + contract.events.allEvents((_: any, event: any) => { + events.push(event); + }); + expect(await token.approve(alice, {Ethereum: receiver}, 100n)).to.be.true; + + const event = events[0]; + expect(event.event).to.be.equal('Approval'); + expect(event.address).to.be.equal(tokenAddress); + expect(event.returnValues.owner).to.be.equal(helper.address.substrateToEth(alice.address)); + expect(event.returnValues.spender).to.be.equal(receiver); + expect(event.returnValues.value).to.be.equal('100'); + }); - const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n)).itemId; - expect(await approve(api, collectionId, tokenId, alice, bob.address, 100n)).to.be.true; + itEth('Events emitted for transferFrom()', async ({helper}) => { + const [bob] = await helper.arrange.createAccounts([10n], donor); + const receiver = helper.eth.createAccount(); + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice, 200n); + await token.approve(alice, {Substrate: bob.address}, 100n); - const address = tokenIdToAddress(collectionId, tokenId); - const contract = uniqueRefungibleToken(web3, address); + const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, token.tokenId); + const contract = helper.ethNativeContract.rftToken(tokenAddress); - const events = await recordEvents(contract, async () => { - expect(await transferFrom(api, collectionId, tokenId, bob, alice, {Ethereum: receiver}, 51n)).to.be.true; + const events: any = []; + contract.events.allEvents((_: any, event: any) => { + events.push(event); }); - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: subToEth(alice.address), - to: receiver, - value: '51', - }, - }, - { - address, - event: 'Approval', - args: { - owner: subToEth(alice.address), - spender: subToEth(bob.address), - value: '49', - }, - }, - ]); + expect(await token.transferFrom(bob, {Substrate: alice.address}, {Ethereum: receiver}, 51n)).to.be.true; + + let event = events[0]; + expect(event.event).to.be.equal('Transfer'); + expect(event.address).to.be.equal(tokenAddress); + expect(event.returnValues.from).to.be.equal(helper.address.substrateToEth(alice.address)); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.value).to.be.equal('51'); + + event = events[1]; + expect(event.event).to.be.equal('Approval'); + expect(event.address).to.be.equal(tokenAddress); + expect(event.returnValues.owner).to.be.equal(helper.address.substrateToEth(alice.address)); + expect(event.returnValues.spender).to.be.equal(helper.address.substrateToEth(bob.address)); + expect(event.returnValues.value).to.be.equal('49'); }); - itWeb3('Events emitted for transfer()', async ({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - - const collectionId = (await createCollection(api, alice, {mode: {type: 'ReFungible'}})).collectionId; + itEth('Events emitted for transfer()', async ({helper}) => { + const receiver = helper.eth.createAccount(); + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice, 200n); - const receiver = createEthAccount(web3); + const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, token.tokenId); + const contract = helper.ethNativeContract.rftToken(tokenAddress); - const tokenId = (await createRefungibleToken(api, alice, collectionId, 200n)).itemId; - - const address = tokenIdToAddress(collectionId, tokenId); - const contract = uniqueRefungibleToken(web3, address); - - const events = await recordEvents(contract, async () => { - expect(await transfer(api, collectionId, tokenId, alice, {Ethereum: receiver}, 51n)).to.be.true; + const events: any = []; + contract.events.allEvents((_: any, event: any) => { + events.push(event); }); - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: subToEth(alice.address), - to: receiver, - value: '51', - }, - }, - ]); + expect(await token.transfer(alice, {Ethereum: receiver}, 51n)).to.be.true; + + const event = events[0]; + expect(event.event).to.be.equal('Transfer'); + expect(event.address).to.be.equal(tokenAddress); + expect(event.returnValues.from).to.be.equal(helper.address.substrateToEth(alice.address)); + expect(event.returnValues.to).to.be.equal(receiver); + expect(event.returnValues.value).to.be.equal('51'); }); }); describe('ERC 1633 implementation', () => { + let donor: IKeyringPair; + before(async function() { - await requirePallets(this, [Pallets.ReFungible]); - }); + await usingEthPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - itWeb3('Default parent token address and id', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + donor = privateKey('//Alice'); + }); + }); - const {collectionIdAddress, collectionId} = await createRFTCollection(api, web3, owner); - const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner); - const refungibleTokenId = await refungibleContract.methods.nextTokenId().call(); - await refungibleContract.methods.mint(owner, refungibleTokenId).send(); + itEth('Default parent token address and id', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); - const rftTokenAddress = tokenIdToAddress(collectionId, refungibleTokenId); - const refungibleTokenContract = uniqueRefungibleToken(web3, rftTokenAddress, owner); + const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Sands', '', 'GRAIN'); + const collectionContract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); + + const tokenId = await collectionContract.methods.nextTokenId().call(); + await collectionContract.methods.mint(owner, tokenId).send(); + const tokenAddress = helper.ethAddress.fromTokenId(collectionId, tokenId); + const tokenContract = helper.ethNativeContract.rftToken(tokenAddress, owner); - const tokenAddress = await refungibleTokenContract.methods.parentToken().call(); - const tokenId = await refungibleTokenContract.methods.parentTokenId().call(); - expect(tokenAddress).to.be.equal(collectionIdAddress); - expect(tokenId).to.be.equal(refungibleTokenId); + expect(await tokenContract.methods.parentToken().call()).to.be.equal(collectionAddress); + expect(await tokenContract.methods.parentTokenId().call()).to.be.equal(tokenId); }); }); diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index abe3635060..f16f08d9e5 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -116,13 +116,17 @@ class NativeContractGroup extends EthGroupBase { return new web3.eth.Contract(abi as any, address, {gas: this.helper.eth.DEFAULT_GAS, ...(caller ? {from: caller} : {})}); } - rftTokenByAddress(address: string, caller?: string): Contract { + collectionById(collectionId: number, mode: 'nft' | 'rft' | 'ft', caller?: string): Contract { + return this.collection(this.helper.ethAddress.fromCollectionId(collectionId), mode, caller); + } + + rftToken(address: string, caller?: string): Contract { const web3 = this.helper.getWeb3(); return new web3.eth.Contract(refungibleTokenAbi as any, address, {gas: this.helper.eth.DEFAULT_GAS, ...(caller ? {from: caller} : {})}); } - rftToken(collectionId: number, tokenId: number, caller?: string): Contract { - return this.rftTokenByAddress(this.helper.ethAddress.fromTokenId(collectionId, tokenId), caller); + rftTokenById(collectionId: number, tokenId: number, caller?: string): Contract { + return this.rftToken(this.helper.ethAddress.fromTokenId(collectionId, tokenId), caller); } } @@ -171,6 +175,17 @@ class EthGroup extends EthGroupBase { return {collectionId, collectionAddress}; } + async createRefungibleCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{collectionId: number, collectionAddress: string}> { + const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); + + const result = await collectionHelper.methods.createRFTCollection(name, description, tokenPrefix).send(); + + const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); + const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress); + + return {collectionId, collectionAddress}; + } + async deployCollectorContract(signer: string): Promise { return await this.helper.ethContract.deployByCode(signer, 'Collector', ` // SPDX-License-Identifier: UNLICENSED @@ -215,6 +230,16 @@ class EthGroup extends EthGroupBase { } `); } + + async recordCallFee(user: string, call: () => Promise): Promise { + const before = await this.helper.balance.getEthereum(user); + await call(); + // In dev mode, the transaction might not finish processing in time + await this.helper.wait.newBlocks(1); + const after = await this.helper.balance.getEthereum(user); + + return before - after; + } } class EthAddressGroup extends EthGroupBase { From a9c26037395e319c6ac261658b7e126c39d78aa9 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Mon, 26 Sep 2022 12:25:28 +0000 Subject: [PATCH 0966/1274] misk: Turn off eth metods for substrate addresses. --- pallets/common/src/erc.rs | 199 ++++++----- pallets/fungible/src/stubs/UniqueFungible.raw | Bin 3349 -> 3219 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 82 +---- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4497 -> 4374 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 82 +---- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4508 -> 4401 bytes .../refungible/src/stubs/UniqueRefungible.sol | 82 +---- tests/src/eth/allowlist.test.ts | 52 +-- tests/src/eth/api/UniqueFungible.sol | 53 +-- tests/src/eth/api/UniqueNFT.sol | 53 +-- tests/src/eth/api/UniqueRefungible.sol | 53 +-- tests/src/eth/collectionAdmin.test.ts | 335 +++++++++--------- tests/src/eth/collectionSponsoring.test.ts | 138 ++++---- tests/src/eth/fungibleAbi.json | 63 ---- tests/src/eth/nonFungibleAbi.json | 63 ---- tests/src/eth/reFungibleAbi.json | 63 ---- 16 files changed, 378 insertions(+), 940 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index b156811328..d1ea18ed1e 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -139,25 +139,26 @@ where save(self) } - /// Set the substrate sponsor of the collection. - /// - /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - /// - /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - fn set_collection_sponsor_substrate( - &mut self, - caller: caller, - sponsor: uint256, - ) -> Result { - self.consume_store_reads_and_writes(1, 1)?; - - check_is_owner_or_admin(caller, self)?; - - let sponsor = convert_uint256_to_cross_account::(sponsor); - self.set_sponsor(sponsor.as_sub().clone()) - .map_err(dispatch_to_evm::)?; - save(self) - } + // TODO: Temprorary off. Need refactor + // /// Set the substrate sponsor of the collection. + // /// + // /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. + // /// + // /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. + // fn set_collection_sponsor_substrate( + // &mut self, + // caller: caller, + // sponsor: uint256, + // ) -> Result { + // self.consume_store_reads_and_writes(1, 1)?; + + // check_is_owner_or_admin(caller, self)?; + + // let sponsor = convert_uint256_to_cross_account::(sponsor); + // self.set_sponsor(sponsor.as_sub().clone()) + // .map_err(dispatch_to_evm::)?; + // save(self) + // } /// Whether there is a pending sponsor. fn has_collection_pending_sponsor(&self) -> Result { @@ -299,35 +300,37 @@ where Ok(crate::eth::collection_id_to_address(self.id)) } - /// Add collection admin by substrate address. - /// @param newAdmin Substrate administrator address. - fn add_collection_admin_substrate( - &mut self, - caller: caller, - new_admin: uint256, - ) -> Result { - self.consume_store_writes(2)?; - - let caller = T::CrossAccountId::from_eth(caller); - let new_admin = convert_uint256_to_cross_account::(new_admin); - >::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::)?; - Ok(()) - } - - /// Remove collection admin by substrate address. - /// @param admin Substrate administrator address. - fn remove_collection_admin_substrate( - &mut self, - caller: caller, - admin: uint256, - ) -> Result { - self.consume_store_writes(2)?; + // TODO: Temprorary off. Need refactor + // /// Add collection admin by substrate address. + // /// @param newAdmin Substrate administrator address. + // fn add_collection_admin_substrate( + // &mut self, + // caller: caller, + // new_admin: uint256, + // ) -> Result { + // self.consume_store_writes(2)?; + + // let caller = T::CrossAccountId::from_eth(caller); + // let new_admin = convert_uint256_to_cross_account::(new_admin); + // >::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::)?; + // Ok(()) + // } - let caller = T::CrossAccountId::from_eth(caller); - let admin = convert_uint256_to_cross_account::(admin); - >::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::)?; - Ok(()) - } + // TODO: Temprorary off. Need refactor + // /// Remove collection admin by substrate address. + // /// @param admin Substrate administrator address. + // fn remove_collection_admin_substrate( + // &mut self, + // caller: caller, + // admin: uint256, + // ) -> Result { + // self.consume_store_writes(2)?; + + // let caller = T::CrossAccountId::from_eth(caller); + // let admin = convert_uint256_to_cross_account::(admin); + // >::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::)?; + // Ok(()) + // } /// Add collection admin. /// @param newAdmin Address of the added administrator. @@ -476,21 +479,22 @@ where Ok(()) } - /// Add substrate user to allowed list. - /// - /// @param user User substrate address. - fn add_to_collection_allow_list_substrate( - &mut self, - caller: caller, - user: uint256, - ) -> Result { - self.consume_store_writes(1)?; - - let caller = T::CrossAccountId::from_eth(caller); - let user = convert_uint256_to_cross_account::(user); - Pallet::::toggle_allowlist(self, &caller, &user, true).map_err(dispatch_to_evm::)?; - Ok(()) - } + // TODO: Temprorary off. Need refactor + // /// Add substrate user to allowed list. + // /// + // /// @param user User substrate address. + // fn add_to_collection_allow_list_substrate( + // &mut self, + // caller: caller, + // user: uint256, + // ) -> Result { + // self.consume_store_writes(1)?; + + // let caller = T::CrossAccountId::from_eth(caller); + // let user = convert_uint256_to_cross_account::(user); + // Pallet::::toggle_allowlist(self, &caller, &user, true).map_err(dispatch_to_evm::)?; + // Ok(()) + // } /// Remove the user from the allowed list. /// @@ -504,21 +508,22 @@ where Ok(()) } - /// Remove substrate user from allowed list. - /// - /// @param user User substrate address. - fn remove_from_collection_allow_list_substrate( - &mut self, - caller: caller, - user: uint256, - ) -> Result { - self.consume_store_writes(1)?; - - let caller = T::CrossAccountId::from_eth(caller); - let user = convert_uint256_to_cross_account::(user); - Pallet::::toggle_allowlist(self, &caller, &user, false).map_err(dispatch_to_evm::)?; - Ok(()) - } + // TODO: Temprorary off. Need refactor + // /// Remove substrate user from allowed list. + // /// + // /// @param user User substrate address. + // fn remove_from_collection_allow_list_substrate( + // &mut self, + // caller: caller, + // user: uint256, + // ) -> Result { + // self.consume_store_writes(1)?; + + // let caller = T::CrossAccountId::from_eth(caller); + // let user = convert_uint256_to_cross_account::(user); + // Pallet::::toggle_allowlist(self, &caller, &user, false).map_err(dispatch_to_evm::)?; + // Ok(()) + // } /// Switch permission for minting. /// @@ -551,14 +556,15 @@ where Ok(self.is_owner_or_admin(&user)) } - /// Check that substrate account is the owner or admin of the collection - /// - /// @param user account to verify - /// @return "true" if account is the owner or admin - fn is_owner_or_admin_substrate(&self, user: uint256) -> Result { - let user = convert_uint256_to_cross_account::(user); - Ok(self.is_owner_or_admin(&user)) - } + // TODO: Temprorary off. Need refactor + // /// Check that substrate account is the owner or admin of the collection + // /// + // /// @param user account to verify + // /// @return "true" if account is the owner or admin + // fn is_owner_or_admin_substrate(&self, user: uint256) -> Result { + // let user = convert_uint256_to_cross_account::(user); + // Ok(self.is_owner_or_admin(&user)) + // } /// Returns collection type /// @@ -595,18 +601,19 @@ where .map_err(dispatch_to_evm::) } - /// Changes collection owner to another substrate account - /// - /// @dev Owner can be changed only by current owner - /// @param newOwner new owner substrate account - fn set_owner_substrate(&mut self, caller: caller, new_owner: uint256) -> Result { - self.consume_store_writes(1)?; + // TODO: Temprorary off. Need refactor + // /// Changes collection owner to another substrate account + // /// + // /// @dev Owner can be changed only by current owner + // /// @param newOwner new owner substrate account + // fn set_owner_substrate(&mut self, caller: caller, new_owner: uint256) -> Result { + // self.consume_store_writes(1)?; - let caller = T::CrossAccountId::from_eth(caller); - let new_owner = convert_uint256_to_cross_account::(new_owner); - self.set_owner_internal(caller, new_owner) - .map_err(dispatch_to_evm::) - } + // let caller = T::CrossAccountId::from_eth(caller); + // let new_owner = convert_uint256_to_cross_account::(new_owner); + // self.set_owner_internal(caller, new_owner) + // .map_err(dispatch_to_evm::) + // } // TODO: need implement AbiWriter for &Vec // fn collection_admins(&self) -> Result> { diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index f22b157cf2bb0010cbe5f62cf3e3ce86ada3685d..266c3e176e6ba4311e9ee41fadadea560ca08182 100644 GIT binary patch literal 3219 zcmaJ@eT-aH6@PbU-h6B{?sU6TwzF|xTGD@-(pDL;Ldq-#B%=6c=+1+@fcNffS+-%f zYj-8o+VDPSTTSuJ?DhjSp@<5bm|#kc4H_ab4OUT%HE2?xYXl9F{y|7dg)Hmu-1}yB zwjs>q&HUcE=lh&{?&XWTRNZ5AZy60d2Fm<}BIf zh{m3&+O@mxIPgurSm0WP5AkG$U(2;6n={uPh`hW5{t=5m>g5}z%?+=|O@QKCol+ax zQf4DEt2Q6>a%AW4umfkf;Tn7}WLzI`88_-Zw06oe9WY9&$DrGFCH=hRxx<_>u)F|= zO_QFg?Up&iw^T^DQuP%J3|H{nShW#GkBgsdunUB*RqX(OhvA0d@IgO^NY-NY4mcCQ zGTUmIq0h=T*ZO&)9u)@q^PGiIVO=;3x$}_I!j{wh^?bwjq-Siub*RqD-tc_D=8@M1 zivoDb?tzz~N4~QY)@;biQtzRtz^~+?+8w3?YIt`2AEhy;)_im1r5GOl z#}9`()lhtR{}2L`zg>72vgGsBNpCygy?_sIEL|sMW#2lrjc4|~j)XjirP7O^=?C;; z2rlw@$iMHakWB!N&Tc#gm;)ROzW#5i#;NW3!q5d!2V0SlMl78L*Vgnc4*;GA+{UX%YcDSr}h{VQ9B z0e=;%8DWnFF+W>A_cUM$O!{|U3;`bmOf9{U0GzVWmDsYPYp3YiaRX0^Z@j2x8ey$SPN13=Kc+Ay&`q1 zA~;2n8Wt(j6Z*fSh*+`TOE;2p0;`=@$ z&fAq8&!g74k+K;0=(Bbsd(>=eM0zszCwav8i_(v@u6&N$DILX{R+MS-+ z9IMM*@5^n9^cfEF*G?MsN2aW}C|NG6_lgW|Zggy*KQdG8{-D;-SGC3=N_pn{ig~3q zGN&z(`KhX&S0TErdIqPAb5s?*9nFfXuPQZH^={^pB8$xbLa(lph*3i|E7oYg$wlGB*{~(u==4iuPs*avNR&OQ zYSxZ2`K+{~*|T-#qeupGaV_lLYS9%|bl+x)?kVVA#;w$=1buxN9UePoDysH9l86ip;yNy@ zqI-|!?h5E^2w8NPiSBaM_Stc|P|rVpLRF7)^wEz;$EO~czGuT4Rm-wkiseEe@mN2m8bRQr;a>Crwv^WgZjQQJE?vrp7!4B+vJ YsfTt??4F$2J!*_k8k1sX{NdgI2iL1*GXMYp literal 3349 zcmaJ@dyHIF8NX-eJv_Rz+ZkMD&EB+4YeINboYvX~r%I&>RPRi>bDP{)&)I3aENQoE zyMj;&_c^<@0q;z=FDhgse;`st3z(|0u}W=-4@frx1`CaWCMxw&$flsn`uonkGo9TK zb~3ZS^PTVgedm0KpXbFgU&>9(D*FS<)&Js?t2hHv7Wp=Q|57ou&zM=DTXe3NGln*x zuX+B=`8q$J=SrEc<oWam}bfiqmSRNm(?9_zIjS8JWLcU;#@FiNV;pxd$}eM+~je$E(JPQqbL zqi@BqN}S2yymS2t|w8M|K}ud$NdKjE?o5Ab>Yz!ouXqmRt0{(*Q^fz>Z$)^1S{!g^{Lo*e~}T&Zvdz6>^}iG7Q%(1x-t*bD zuLF()4o8+g0Z0vmQ)5<1Io3B}YmN4|2jrGnEw2CH`+$_O;;98ap<`>Euigdf=B8}s z#&xxf=vV_Tg5dflVD~e{Lg>OLa@U*#{3oc_zjR|iWTSwKPwWCU(gk>P;`7@8)llOA zd&CX3u-O-%1bi4wv2UO90G|hp&%6-;8Iw96B5g%z^B|hCQpSXZkWJOb+&-(RTyN-P_h%5Gzo7<(6_sv;7N~@-y zb2(G%$j;*;dV~TqOLlPkOy(ofTm#of!(t7;QD&j{(_zwr2%GVyCfjYy+dD^lNM4eX zEjcNVl%62}=^L<$E^Y zkK07(rp@d!+66zV&C322YcS>GRwJWi&n%c|65K4W1f3a70tHfTq$?|;7Xz}0PTL~- z+lsNjAuo1#7jncF1RPcYE-?(GNRO2xh0_5Yv!rCY@I{Ua5!;|+uz1X3rJBRw8WXYQ zxQnI28e{O6_w`@^u$;#*V6+ClNQ;U*DNxE)hq)rQj69bHk=wvt7yyFiMaLuOV?PL; zk3H*%m{~Cj<1MeRAVOi zvWOU_41wf6iv4!5-`->o6W&sa87$)4z_CqoXgrq32_~gTxfui&cLIOyLQ4$uRm2|+ z$PO%9%+#^P;<#@)`dxZCbd35)l!*1Wk#nJ(*am?ABPJhH|3eib!z-Q`Q&pzgCPx2WgJt zk0LM;1b1tsEOAF*NhCDX6FF~aBC(mP9vT9xx(2JP;A;)~kZdbd@-s26<0~^H5=VKT zE0c{x$>4m=w#tsHmtc2gEi`Rtsx&{ ztpk=E355&u&Sr9Nuz`~|JMYM~jzIEP%H|D<*@`lKTT|?g;7+P*O%ZDQ;E?00b2nO?*;X$) z$jO-^eIFk4POhODo`bi%NKdq$@?Mz-FL`gq7^^V{MN*lChiUpJIz6IA`iw5pIIVmZ z?_#^`X0y0cY<3WaiK^@)317txUBi=Eq~Fo4jV=uhkNJBsCGfU(*dcn-PaHWMRF87> z;rF%-jcnV!X;GJY@*DLv?>#m>bL{EoSH1e$dxwsF>R9H&3wQqc(&;I4VCaRbw(Q=y wz4}EZ*{R$*diT(7wYqb7beE`(s=z}#Mz(L=v2}QK>lSrrSREFlL-%g|KhV&m9smFU diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index d78818db87..53c60f531d 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -18,7 +18,7 @@ contract ERC165 is Dummy { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0x47dbc105 +/// @dev the ERC-165 identifier for this interface is 0x3e1e8083 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -72,19 +72,6 @@ contract Collection is Dummy, ERC165 { dummy = 0; } - /// Set the substrate sponsor of the collection. - /// - /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - /// - /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - /// @dev EVM selector for this function is: 0xc74d6751, - /// or in textual repr: setCollectionSponsorSubstrate(uint256) - function setCollectionSponsorSubstrate(uint256 sponsor) public { - require(false, stub_error); - sponsor; - dummy = 0; - } - /// Whether there is a pending sponsor. /// @dev EVM selector for this function is: 0x058ac185, /// or in textual repr: hasCollectionPendingSponsor() @@ -167,26 +154,6 @@ contract Collection is Dummy, ERC165 { return 0x0000000000000000000000000000000000000000; } - /// Add collection admin by substrate address. - /// @param newAdmin Substrate administrator address. - /// @dev EVM selector for this function is: 0x5730062b, - /// or in textual repr: addCollectionAdminSubstrate(uint256) - function addCollectionAdminSubstrate(uint256 newAdmin) public { - require(false, stub_error); - newAdmin; - dummy = 0; - } - - /// Remove collection admin by substrate address. - /// @param admin Substrate administrator address. - /// @dev EVM selector for this function is: 0x4048fcf9, - /// or in textual repr: removeCollectionAdminSubstrate(uint256) - function removeCollectionAdminSubstrate(uint256 admin) public { - require(false, stub_error); - admin; - dummy = 0; - } - /// Add collection admin. /// @param newAdmin Address of the added administrator. /// @dev EVM selector for this function is: 0x92e462c7, @@ -267,17 +234,6 @@ contract Collection is Dummy, ERC165 { dummy = 0; } - /// Add substrate user to allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xd06ad267, - /// or in textual repr: addToCollectionAllowListSubstrate(uint256) - function addToCollectionAllowListSubstrate(uint256 user) public { - require(false, stub_error); - user; - dummy = 0; - } - /// Remove the user from the allowed list. /// /// @param user Address of a removed user. @@ -289,17 +245,6 @@ contract Collection is Dummy, ERC165 { dummy = 0; } - /// Remove substrate user from allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xa31913ed, - /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) - function removeFromCollectionAllowListSubstrate(uint256 user) public { - require(false, stub_error); - user; - dummy = 0; - } - /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -324,19 +269,6 @@ contract Collection is Dummy, ERC165 { return false; } - /// Check that substrate account is the owner or admin of the collection - /// - /// @param user account to verify - /// @return "true" if account is the owner or admin - /// @dev EVM selector for this function is: 0x68910e00, - /// or in textual repr: isOwnerOrAdminSubstrate(uint256) - function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) { - require(false, stub_error); - user; - dummy; - return false; - } - /// Returns collection type /// /// @return `Fungible` or `NFT` or `ReFungible` @@ -371,18 +303,6 @@ contract Collection is Dummy, ERC165 { newOwner; dummy = 0; } - - /// Changes collection owner to another substrate account - /// - /// @dev Owner can be changed only by current owner - /// @param newOwner new owner substrate account - /// @dev EVM selector for this function is: 0xb212138f, - /// or in textual repr: setOwnerSubstrate(uint256) - function setOwnerSubstrate(uint256 newOwner) public { - require(false, stub_error); - newOwner; - dummy = 0; - } } /// @dev the ERC-165 identifier for this interface is 0x63034ac5 diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 0f113339e4dee6673004d2f148e7409d8686db9b..6fbcefcc1a116b6fd4750e0573005d93fa317028 100644 GIT binary patch literal 4374 zcmai1dvH`&8Q;Su``&F5lJHn+*1)v>Q6AbZErqcQDAIy(vyN7yP_&j}tvHN!q%tztX^6jb&b^yWS~a_O z^E>B!@9#U`IhS6hnJm47YPz0v+I=EQVU-eHpXL~i8tB{ebeqvwR8*QWYIHwl%zPzRbD2vi zI!aEZO-3!(^A_~L7@E>kw8nBPwKI{6vkN4 zOlId5+axV2^-ZDvf|Hy!rI8ZbNlvocz;_OOKHD>TN};i+8p1NNDc@fpEk@g*MFtVq zB5^EONgjrkw!v*D`|^D@X%TY!og}^42+?{QcR*3Vp(lyc24C21_aUlei2CMH-}PHm zL*9@W=Bsh@LaXN1F#ke~()98)tz)gV@=7fuLwT)Z_r+%y0#*V3ZpQGsTIM?l`0j?S z^8vr>!g^NqCg4^3>X~|0tpnaT{_b(WU4S1AZ&_5&{O?I!QVfv$(LT*4BESb7lfNcD3kz;GUL=&6;LFq;Q_bxZCYz)p{s+w6+nSNq~C zLaf%YfBv?Y0OxyD-`e!h0(kZW1Z>&*x8DLTb0Mgj0Jp9_2_O6>pnYcQ>wxb8mfmlN z#8G#+7>sXW>B;GtSuWM4vuho|^PVyuQFrMZ_bq%I0ecw?J^nj>1o$-$PaXNt4deO) z#^(XK#0{VO)t#^==82g;wBemvHlc*2Mb@kY;2gk}-Dm#_7;zzZp8-@(tk?#47_cMz z+0Q`x3xKQprtiV*Pd$lT493k^TC}J8F~IKue(A{Iqk!M{sOGlL2|z-Ha=-=3 z)y;t1{LJawrU14BE;PTs9B{qI%WcM(YnUB;U=1L*d3Nt3s{p^~QH3VgeGCmFSep2g zOd9a_E_A~-DSKfH;5E!nZj3{s2zm3&y&pkLeWe)J)9|B*jsfyosh#=d0^kyts+~M- ziJ{g(MqWDvsDh|^$7vgor@Q)1zv{vOt9=7-CuRe~m;8YH^VqQHX3W2e`CI4GDi%Ob zVAXqbst=Pr%-)cs47sl>r?qJS8{|`j2Z2a{L)3K z$#Xaokd!{W!_mUnT6PWn3WBAVSQCYBX z(;G>dUP=>pamtf2AvkVY+Lt7ML;sRQVyXzMK8hMh}d|D5qHku@*Dz`(LEVWw9u_cpAhM3! z1Wg8^O*rm8NqrU6S3PRia)UORq>cqAj4?~-Xkfu)9*^K)!CAOW2+7#5EN~h(0X=Kc zlvyC87Nm<^0W^i1M9L)hQeTl@GDy)WX3Jr~32WLsQo)Uq-bfb}PA2>5H3qEHX z1!(&)rxq2Zq?E*^#;3Pv7SbhdDlB+5k9&&A+G+PRND$D76YaDxvLCjF~PWD%NOJG~DA@=#Z!6SfAN1!!n@I zOo1SXlHxVjZWg*wF#0MZr<7b>8rAGRq3nhvw#LLh?4GGCJh{(sl?*Bh3*U(gBLt$T zOBkiOS}`hOw3t$NP|D!mW&)yGS%jzwDCxipKcWs!D+h5w9}=58EXjct)c;oh!6n9zdh_t-I>)5_AyCwFz ztK?+T7Du?*~G z-l+$9&vW;`yNBaUl8v=0?&hDx%}T3Syu^E-2&`xbvgwz5ZTtmK=g+)it7PGM!q;tb z@wYwV_ifQ>1{4wCETksOQgzukjJI6ySd&a9&mLemX0?_ zc6bzriNnTf)hRLbX=v7Fqs9{7!P~sqSW;Bm#LGNO>@L5{+gU1Kd+T8D?}ONMc(ZLuA62=sUExp#Aew$1L{ z{LVSw`}@v!&MqCG$uzxw$iFJ9Y>`>g%V90ZR$}K^c`8cPLGykg~s)I&4U>u>*g9$;gU@eq6DvG%%fSNuVz7T70=xn1#Z-9_^8dz!Nly0lEc6CFe9$g79#>rMqqUojLAVW znV6OH21zMYYNnoo85`Xkr6h00M&{eWcLsb?-Z8ql5G^UXWf@tW?Jba$-rk=h{fKLc zm^oNU=EBOn&TS{#v&B3~S#o>L7`+;WXsw+)Aj{y;V#I8RFRX4KqDl@>=^iRwxlUE& z4T)h=y`2|YHMO33euhzk4vbbi7nQ)!<^1JifY$*3z5m_)Bbe6@_{rd!86#L#o6sf1fa(J*y|v`@LM)vEJoD}L z1Atz@vtQdB0l{vEVQ)j@7AU)nB@S(d1Do0|g6cG8Pt0DJvS(jglevJ|0f(2HkMS=- zweu_c7XZEr_?)4k28m+<7v|dD!)zs!T#U_d z|DOK&fFFaZZP^=_z)%AyA9`>dV3T7)a@Mtvp==+PIJ9|_N9vjZFJQLSc=!Rp_W@_* zCWHaEIK13^j9s$&BICbNK%%(KjXzH&Fw3i8WcutHz=s`%>eC(t z$~Iw%Lo2gtridw(TUD{^ zv-oQjH%IO3?vcM*@Cz4(CdXmFCMbCzTpD5XP*8^37AUya0(&rmZMN)Te8C6YGK1UQ zd^{>c`a)AMs%~fA6+BjIN*9L)!es@kjILkSNZBl>iHO^fMjk07pn5A$pOp@t3zz6k ze00t+a9ChN!@?Afy7|IMw_wZMikc9YSxInsml#=PgOe`RF*A0O{xya)RT1VLkBSJt zZPfs;A{@{XKM(&K75!g}2#u-}J&jVvM_eaqb4U(UnK-PtQm#);s3>5Z9WRRgAr5#6 zTscoe6Z5_*rkVGo&b-fMl)kccUc)+v;ypp3C9K*VhMBA%)2iVuImSEG;v$t zuOvV8b-jLM6RVk;#lyVUc_7lJ*b*%|p)ELRKTX{Q>Mn=cwp^zz25De5YloR->45xg z;Mityu$n!%$5@iFds)qNTtc*Tj>e4wArX)swgu2QE-`U~+)bqtY>1PRSxQ&JfWzI$ z^GMZvAn5f(N#^7t9JXFxKrAxf$h=;Fwq+TmB+F&FY~80MEv4p=F6)xSeBaFCN|h%X zNfiu&>=EX>1Gf+><}eN^MLf8h(LBM`N-pC;sNyIk332DzbIf-urYc$TJtYi~6IPg1 zVciZy-pZAod=!l1j_=ow#m5ci>&qzpG~Q?Skwo83`S;oRw6>xdM+$ZIuvX zB+7_NZYU}$u8^#DjIE@0Lec0IVd;};vOo|-L2*t*^rAa*a@p3UQZ-++lszVh zbHid^TXdB46?I!lzbv!bow%!F=b@;}7`?>RTB8z1hbgs3rd-}y>PM<>_Uxh~_7Z{( zzqycq@nW$?D1s#11vh^QUb|BKqXeg3G1GF@KhYNGpH?tzPZ10Vbb{ee2@2U=Mu@e& ziFic)Ph{~}1uoO-7^;KiORa(VPuX(` z=KmA(U(lIuk$LzEQ26q;Di?IhU481%fvV z;2@LLr}?d%|5Y}b)3E~Eg<0rWH-@z;SNR8C5i~4tOq4(0)T*m~Epz@Th;ry68Ywig zz(2)=nqWbx5+eQ;$%>9n3}PCHPA`v6utgA;bEK^3IfN(p^{kQ5(|iKoJxmrHhyJ|v zCNEr@E68jkgG+{T2^;O&b27?J4chzPy^UP%248R_?KkW_@M(90ZwaD`yFuH3?(T>G z&)rb?Gu&mNal&$!*P+H?yCpPJ@D1%2?oVi*ZE$E&rJ>?vvKnva4g6V&4e5ePb@y7Q z3_?E^iztK2DFng4a0DO8>DbG>Q}^?pXYYS|4~NbRvYV{3^Up%p-Bz)1i1$7#uvSA5 zO~2A>!?)Wy!*@Ex=4Rn}!rN|g;fzE4-MrOl`eYVfZnZMeg=o_17?ip;H4j@8o(q*VKgerIT&4n3Xni z4l|B3vcNk@-J+~EC&zC#d19_7tgbDi7zBG>k^7(7F18HM+4Y@Wi&s3dYVMeZ_{O;h z(;XN7{LxR|dHKtmXPm#$`Kv?S^L7XBiVhsVb3^OV$z7`+UDkP@=mpxEp|hx_>lwSl6OYiL1(X1JrrQR-|BzLc&udLUcjc%@8&#DK5BXtM z%`actw~<~*Qcs31rga%QlX^x~N_2gyZ6q|%cjV|ZMxv~!G-WjCUd))eTCV9;E~RWM zS(UaJajxey^uQRJ(o?jhK&Wr3PH3vwz}F7v6b*!8)*z6r>tcQ+XXx#e5Rm)=1}h5x zWL3S568yF%y}A&6H3x#L_}raU;YNdwuaLC@6U(xyg@64pBc;(6GY(H0vAPt-SkO%7 z*_?r7kH3OFOVM@=*H`EDZymTDT*Q z*{n;o@Aly?XgG%@4zbh&c+mI4Q7~KrJhb`RZvamKzS);O3j)pMZvUc-UH7zLO|cvzrF+bkOM)r6mV zh7y)I#L{ZOdz6b$19B%@k56a@+zPnZeEh3`+g)C6GsaxQoWK`X0dkw?^gi||;G-^8 z@Ro`HiZkyNEKPc;H4SC|aG(>4$(d7qV2EJ$mPC|G{5@;!UJ0LUxB_dBoZKtGGW2e==z{?T(@z~LNv z85AKd9;rCGiX2G;jHSxWIyv-VzQS{o=-R4olYhf&?Ms$Kt) z|KnPYQ1`ge44o{PmJP>1H7;jBvR;@Jd&lqLo0gPaqBYXVX-)i~l=Z_nG zw{{d=h>_3B{0%%-TALxac!Wy?tAahcqLYeU$q*U0F^wWpNWgtOeIgw^7h}PT4)T%f zZg5;+qra`CjNQsdt|;lIJCah|l*YcoDNoCU;3R76_;T_j{ZkT&sUysH5;YLpD6-D$ z1_!8zpI85livF)f1Vb~3kwNj|D`k+3JthaLY#b(BDc7f^HI!^4^DmPvBM)E?xGe9) zCgykcSLR=9F#o+-b)X{7Q&{Ix6eXjc7S(zo>21~%T;N(cUwhEkTn}KQjnka}w(>*S zFd8O9-KiWt%)gfhB4f)YXfX(F!AbZD>OftN1<;g|+OgcAEhd@B0=JGcOXz4~fqCGV zCpcK(0o*f$Wb`ZZ<9dU;hDB3mk&rk@S2_Y{3YUzON$#eeGQWS2vR%$p!+^urEbvGL zc1U_7T~;``42P@tkX&SepB0QEVS)OrT2_>bQW5tZkKU$PNSC<8u)v2oTzLvaCv8QO zAbX&H3%3Lja~Ow|A|Bk$M1kPyqg3!gs8T2;58}?XTP$!KQ`Ia5ZkV3 zXttvyG`D0pN(L2$g_hthiNvF*D;Np2VpPUxC8f@qtyFfF2a&3qJPUox6r` z&fy~pT%o=ss+BhpPpc*q5_aw(Ec^x6Y}|99!<8az39C|*UP679c&SZf;q}g3nuQG( z-fFPWb!=%)<4_;kB8kGowN@wgvnDs@MafYp5Y@ybm_-_MTDpK6I19hRm-JD!NVIQz zQO=})5@tu7Sr$IS{KHvwn?cfgrXSxW!F9!5kC5lK^F|e&WNarH#mXq-Ct+A6i{=jCj_j7DQ3@N#RH?xtknwqeE8Dy6tXFc0F zhn>P1S>!v(gkVlzVey+yf!O`H%3R8-CPB}u%HW>evSoNMukY*Z-mq%ZBhx3Q-gtHY zj_y^-Mav^kUSCLGI`oa1oA&m+a@(>ALw~GnKR5Dp=ce^*^7nay4W7BZPjqie<=3z4 g?P2-e6ma+24QsmAcCG8}>P&U7ORZzQ-J84q4XFmHrT_o{ literal 4508 zcmai232aoy8Gh5X*XzCPHF&{U5^o`bs0l|EmT;-HX-iQ`;CYL8DNE6eZ4O7qP~$kF z4&@#D)+Xe5yEa#;A`@CAs7hNAry`+6r70n(l(V9UmI6{rW2LDS5=B5`=r?cPTR)Q? zIO}{f^I!A*|35QpdX?5C>13*?YSL_yB3*P~4kbX+L{r1>zoatqOr;uVMw&{>a7J#D z$g8PL^O8l~-=kM!R7%o%T9Tv>QfW9tiK_et8rRu5L!AxB{ZI^q1-qyDO?*lyj;PCnglU@V7 z(y?V8;4?NH%SzV(4jDto#xidi;HQIE1_7%9Zx44b7|Tjl2w%bs6mDVZ%#-KVV(Aj# z`ENBI0*nA&nEOHm0!JN%pLX4T2hN7D#37_610Jjz^P;VL{E4*MyW^Dv)aH|GO~A#F>fZ9fDM-BzxTWP+AjtDC$8Y;@4txY>r?A8! zq&TA+2edB(@@P69dV31s0N_)bAD<74U5+kK7nUB!(v!36{|vYsu-!9xKcvn%QqwzE zeka1d@E(@FexQF9;M0I~U$g^op$(xs4X`=+#Rs6vd2Z>Mv=g)Q0oP`iUdL=PliUoJ zO0cxF?d0D9s{rN0OSS^W0n;l}sBbDj*G?Zy&^R+5!wFN>Uoln1lk;lFwSdD-~JSA7OJ+170$FJx^8x`{iZahx<~ccwmN4(H(c9kpQyB@9*O}*p)a;5JUJWoKPMzP5iXC2d4!bFu?6z(wZI@oh|RV= zN-vmp+YIh^k3xR870%I!_s~x;Ds5-pZqA(2po!ZAQZNfiB3K;p&v`>S zN`Jrp) zno0=s&PGLqahuy!gu7beSL1(^qW^0VWGEWZk|<^Tifbfkj@W@K6ZaN(%Ka$`1qF<2 z?Rl8SXo*FgE4PF%U?l*<& zC4v}DJRJB>9l!rIt#Vv7E2~fA!^+Az5lK_DM6E_>EiT>9OK*Vm21nYCT%)x*sbXcl zqr$R$!2UjH?6Wjj*&v=YmSuD=EBhwiBWf~B<9d#e2t-fV2521bnYd0Kqf(wfbx7XK zCyO-Tp4Sb|RM{;duO;#_7Z-Hcetl7~$b1tGEeCH;r!sk2F31JzX(g!*N*3v|-b>7v zOw+h(5S29Kbb{;==9`5FiN!gBLrTF1-)7VxcxA~2d_Ywkr6hrO?mf$Vk6@~pCEqR) zfSj;sQbcqEVBX4=oqQCGvmM{NPQ+(*=6flX>8J5NvyUYD?#aK;&c9V5T#y@)D9z?L zE9Di!jGicfmFx&B3SN_}e5&oFd`^$vD`@GHXRQ%xOJt=H!CyOQDL< zV>x?92xmueUtVyWyws!FPWok;mA{5(D>@HFUBKutcWaIE7@eTh9+`4sN4_7ax_4(o zj@cU^8~cV4KlnC~EsRhEb=WSn`H#@GE5$!aXllhUt*!d!+6Mg#bGp4#kO6}Z8UB?* zLUxxCxVD>!GwRpU_*exl)6y8Kl{XPjt0EHOA8@=JaKgru8a^B=B9?cAl-h&(>fxnU z#r*aYLrpOMhs^)J#{8`~((J~erD%&73J))6m6*@!2qq8|Rt$q=biB7&U~5`Q7{skr7Ffv2YEzkBjU?3MHvI0fv{n_@+g{wx8`bJ0Z97TI z*`%D$5&Xvjm1q`a7k{Ahf5j$qPOQLw5f)CYyQ7XOSNR8y3mFzTBg&sQwc@H@E1Z7_ zp)5`jmE^{-z_6H55-b=fQpCS4S?p*;C#DW|dO176FA3p7mJ~8t7W4!crS*iCHvi_H_{UrqSaC-_^#s^C7E z1uZ7~5> zL+t;t8d8MtC{|f$ry$5hZU~PFSHeT~5jfJ6d~cysPQaIn=Qb`t>wIs%i+@)Agg&tY zbRX$XwS^;M5!F__?5bIKifuUjXja3K!7qez$#+JzbF_X)yF9B{l4cc~k&?Ukdafn2 z)zvt@G_q3`v(k31Va9Ps=J-icu_>)C%kr0vLCkH0Rjf#5bb_AG$o+eEio^%%O_UF_pqZml@=cO=bL-qST+=zyLZa-o5#OhI`ge-7p^5w4=!!lw4tr}Ym%>0 qdbD$0>!x_~hW5@5*4!BfZe72zZT0%q?VYPz;;rrRcGlV2wff&i#_|FH diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index c65d9a2d5e..bf18c48dee 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -91,7 +91,7 @@ contract TokenProperties is Dummy, ERC165 { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0x47dbc105 +/// @dev the ERC-165 identifier for this interface is 0x3e1e8083 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -145,19 +145,6 @@ contract Collection is Dummy, ERC165 { dummy = 0; } - /// Set the substrate sponsor of the collection. - /// - /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - /// - /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - /// @dev EVM selector for this function is: 0xc74d6751, - /// or in textual repr: setCollectionSponsorSubstrate(uint256) - function setCollectionSponsorSubstrate(uint256 sponsor) public { - require(false, stub_error); - sponsor; - dummy = 0; - } - /// Whether there is a pending sponsor. /// @dev EVM selector for this function is: 0x058ac185, /// or in textual repr: hasCollectionPendingSponsor() @@ -240,26 +227,6 @@ contract Collection is Dummy, ERC165 { return 0x0000000000000000000000000000000000000000; } - /// Add collection admin by substrate address. - /// @param newAdmin Substrate administrator address. - /// @dev EVM selector for this function is: 0x5730062b, - /// or in textual repr: addCollectionAdminSubstrate(uint256) - function addCollectionAdminSubstrate(uint256 newAdmin) public { - require(false, stub_error); - newAdmin; - dummy = 0; - } - - /// Remove collection admin by substrate address. - /// @param admin Substrate administrator address. - /// @dev EVM selector for this function is: 0x4048fcf9, - /// or in textual repr: removeCollectionAdminSubstrate(uint256) - function removeCollectionAdminSubstrate(uint256 admin) public { - require(false, stub_error); - admin; - dummy = 0; - } - /// Add collection admin. /// @param newAdmin Address of the added administrator. /// @dev EVM selector for this function is: 0x92e462c7, @@ -340,17 +307,6 @@ contract Collection is Dummy, ERC165 { dummy = 0; } - /// Add substrate user to allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xd06ad267, - /// or in textual repr: addToCollectionAllowListSubstrate(uint256) - function addToCollectionAllowListSubstrate(uint256 user) public { - require(false, stub_error); - user; - dummy = 0; - } - /// Remove the user from the allowed list. /// /// @param user Address of a removed user. @@ -362,17 +318,6 @@ contract Collection is Dummy, ERC165 { dummy = 0; } - /// Remove substrate user from allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xa31913ed, - /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) - function removeFromCollectionAllowListSubstrate(uint256 user) public { - require(false, stub_error); - user; - dummy = 0; - } - /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -397,19 +342,6 @@ contract Collection is Dummy, ERC165 { return false; } - /// Check that substrate account is the owner or admin of the collection - /// - /// @param user account to verify - /// @return "true" if account is the owner or admin - /// @dev EVM selector for this function is: 0x68910e00, - /// or in textual repr: isOwnerOrAdminSubstrate(uint256) - function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) { - require(false, stub_error); - user; - dummy; - return false; - } - /// Returns collection type /// /// @return `Fungible` or `NFT` or `ReFungible` @@ -444,18 +376,6 @@ contract Collection is Dummy, ERC165 { newOwner; dummy = 0; } - - /// Changes collection owner to another substrate account - /// - /// @dev Owner can be changed only by current owner - /// @param newOwner new owner substrate account - /// @dev EVM selector for this function is: 0xb212138f, - /// or in textual repr: setOwnerSubstrate(uint256) - function setOwnerSubstrate(uint256 newOwner) public { - require(false, stub_error); - newOwner; - dummy = 0; - } } /// @dev anonymous struct diff --git a/tests/src/eth/allowlist.test.ts b/tests/src/eth/allowlist.test.ts index 6a354deaa6..9096a3dd9a 100644 --- a/tests/src/eth/allowlist.test.ts +++ b/tests/src/eth/allowlist.test.ts @@ -95,20 +95,21 @@ describe('EVM collection allowlist', () => { expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; }); - itEth('Collection allowlist can be added and removed by [sub] address', async ({helper}) => { - const owner = await helper.eth.createAccountWithBalance(donor); - const user = donor; + // TODO: Temprorary off. Need refactor + // itEth('Collection allowlist can be added and removed by [sub] address', async ({helper}) => { + // const owner = await helper.eth.createAccountWithBalance(donor); + // const user = donor; - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + // const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + // const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; - await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); - expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; + // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; + // await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); + // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; - await collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); - expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; - }); + // await collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); + // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; + // }); itEth('Collection allowlist can not be add and remove [eth] address by not owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); @@ -128,21 +129,22 @@ describe('EVM collection allowlist', () => { expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.true; }); - itEth('Collection allowlist can not be add and remove [sub] address by not owner', async ({helper}) => { - const owner = await helper.eth.createAccountWithBalance(donor); - const notOwner = await helper.eth.createAccountWithBalance(donor); - const user = donor; + // TODO: Temprorary off. Need refactor + // itEth('Collection allowlist can not be add and remove [sub] address by not owner', async ({helper}) => { + // const owner = await helper.eth.createAccountWithBalance(donor); + // const notOwner = await helper.eth.createAccountWithBalance(donor); + // const user = donor; - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + // const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + // const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; - await expect(collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); - expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; - await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); + // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; + // await expect(collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); + // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; + // await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); - expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; - await expect(collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); - expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; - }); + // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; + // await expect(collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); + // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; + // }); }); diff --git a/tests/src/eth/api/UniqueFungible.sol b/tests/src/eth/api/UniqueFungible.sol index 069119e893..3cad11c906 100644 --- a/tests/src/eth/api/UniqueFungible.sol +++ b/tests/src/eth/api/UniqueFungible.sol @@ -13,7 +13,7 @@ interface ERC165 is Dummy { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0x47dbc105 +/// @dev the ERC-165 identifier for this interface is 0x3e1e8083 interface Collection is Dummy, ERC165 { /// Set collection property. /// @@ -49,15 +49,6 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: setCollectionSponsor(address) function setCollectionSponsor(address sponsor) external; - /// Set the substrate sponsor of the collection. - /// - /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - /// - /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - /// @dev EVM selector for this function is: 0xc74d6751, - /// or in textual repr: setCollectionSponsorSubstrate(uint256) - function setCollectionSponsorSubstrate(uint256 sponsor) external; - /// Whether there is a pending sponsor. /// @dev EVM selector for this function is: 0x058ac185, /// or in textual repr: hasCollectionPendingSponsor() @@ -112,18 +103,6 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: contractAddress() function contractAddress() external view returns (address); - /// Add collection admin by substrate address. - /// @param newAdmin Substrate administrator address. - /// @dev EVM selector for this function is: 0x5730062b, - /// or in textual repr: addCollectionAdminSubstrate(uint256) - function addCollectionAdminSubstrate(uint256 newAdmin) external; - - /// Remove collection admin by substrate address. - /// @param admin Substrate administrator address. - /// @dev EVM selector for this function is: 0x4048fcf9, - /// or in textual repr: removeCollectionAdminSubstrate(uint256) - function removeCollectionAdminSubstrate(uint256 admin) external; - /// Add collection admin. /// @param newAdmin Address of the added administrator. /// @dev EVM selector for this function is: 0x92e462c7, @@ -174,13 +153,6 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: addToCollectionAllowList(address) function addToCollectionAllowList(address user) external; - /// Add substrate user to allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xd06ad267, - /// or in textual repr: addToCollectionAllowListSubstrate(uint256) - function addToCollectionAllowListSubstrate(uint256 user) external; - /// Remove the user from the allowed list. /// /// @param user Address of a removed user. @@ -188,13 +160,6 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: removeFromCollectionAllowList(address) function removeFromCollectionAllowList(address user) external; - /// Remove substrate user from allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xa31913ed, - /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) - function removeFromCollectionAllowListSubstrate(uint256 user) external; - /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -210,14 +175,6 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: isOwnerOrAdmin(address) function isOwnerOrAdmin(address user) external view returns (bool); - /// Check that substrate account is the owner or admin of the collection - /// - /// @param user account to verify - /// @return "true" if account is the owner or admin - /// @dev EVM selector for this function is: 0x68910e00, - /// or in textual repr: isOwnerOrAdminSubstrate(uint256) - function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool); - /// Returns collection type /// /// @return `Fungible` or `NFT` or `ReFungible` @@ -240,14 +197,6 @@ interface Collection is Dummy, ERC165 { /// @dev EVM selector for this function is: 0x13af4035, /// or in textual repr: setOwner(address) function setOwner(address newOwner) external; - - /// Changes collection owner to another substrate account - /// - /// @dev Owner can be changed only by current owner - /// @param newOwner new owner substrate account - /// @dev EVM selector for this function is: 0xb212138f, - /// or in textual repr: setOwnerSubstrate(uint256) - function setOwnerSubstrate(uint256 newOwner) external; } /// @dev the ERC-165 identifier for this interface is 0x63034ac5 diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index dd0e82c4bc..4f46ba94cf 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -62,7 +62,7 @@ interface TokenProperties is Dummy, ERC165 { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0x47dbc105 +/// @dev the ERC-165 identifier for this interface is 0x3e1e8083 interface Collection is Dummy, ERC165 { /// Set collection property. /// @@ -98,15 +98,6 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: setCollectionSponsor(address) function setCollectionSponsor(address sponsor) external; - /// Set the substrate sponsor of the collection. - /// - /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - /// - /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - /// @dev EVM selector for this function is: 0xc74d6751, - /// or in textual repr: setCollectionSponsorSubstrate(uint256) - function setCollectionSponsorSubstrate(uint256 sponsor) external; - /// Whether there is a pending sponsor. /// @dev EVM selector for this function is: 0x058ac185, /// or in textual repr: hasCollectionPendingSponsor() @@ -161,18 +152,6 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: contractAddress() function contractAddress() external view returns (address); - /// Add collection admin by substrate address. - /// @param newAdmin Substrate administrator address. - /// @dev EVM selector for this function is: 0x5730062b, - /// or in textual repr: addCollectionAdminSubstrate(uint256) - function addCollectionAdminSubstrate(uint256 newAdmin) external; - - /// Remove collection admin by substrate address. - /// @param admin Substrate administrator address. - /// @dev EVM selector for this function is: 0x4048fcf9, - /// or in textual repr: removeCollectionAdminSubstrate(uint256) - function removeCollectionAdminSubstrate(uint256 admin) external; - /// Add collection admin. /// @param newAdmin Address of the added administrator. /// @dev EVM selector for this function is: 0x92e462c7, @@ -223,13 +202,6 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: addToCollectionAllowList(address) function addToCollectionAllowList(address user) external; - /// Add substrate user to allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xd06ad267, - /// or in textual repr: addToCollectionAllowListSubstrate(uint256) - function addToCollectionAllowListSubstrate(uint256 user) external; - /// Remove the user from the allowed list. /// /// @param user Address of a removed user. @@ -237,13 +209,6 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: removeFromCollectionAllowList(address) function removeFromCollectionAllowList(address user) external; - /// Remove substrate user from allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xa31913ed, - /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) - function removeFromCollectionAllowListSubstrate(uint256 user) external; - /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -259,14 +224,6 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: isOwnerOrAdmin(address) function isOwnerOrAdmin(address user) external view returns (bool); - /// Check that substrate account is the owner or admin of the collection - /// - /// @param user account to verify - /// @return "true" if account is the owner or admin - /// @dev EVM selector for this function is: 0x68910e00, - /// or in textual repr: isOwnerOrAdminSubstrate(uint256) - function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool); - /// Returns collection type /// /// @return `Fungible` or `NFT` or `ReFungible` @@ -289,14 +246,6 @@ interface Collection is Dummy, ERC165 { /// @dev EVM selector for this function is: 0x13af4035, /// or in textual repr: setOwner(address) function setOwner(address newOwner) external; - - /// Changes collection owner to another substrate account - /// - /// @dev Owner can be changed only by current owner - /// @param newOwner new owner substrate account - /// @dev EVM selector for this function is: 0xb212138f, - /// or in textual repr: setOwnerSubstrate(uint256) - function setOwnerSubstrate(uint256 newOwner) external; } /// @dev anonymous struct diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index 38133e4c27..0e0933f05d 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -62,7 +62,7 @@ interface TokenProperties is Dummy, ERC165 { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0x47dbc105 +/// @dev the ERC-165 identifier for this interface is 0x3e1e8083 interface Collection is Dummy, ERC165 { /// Set collection property. /// @@ -98,15 +98,6 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: setCollectionSponsor(address) function setCollectionSponsor(address sponsor) external; - /// Set the substrate sponsor of the collection. - /// - /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - /// - /// @param sponsor Substrate address of the sponsor from whose account funds will be debited for operations with the contract. - /// @dev EVM selector for this function is: 0xc74d6751, - /// or in textual repr: setCollectionSponsorSubstrate(uint256) - function setCollectionSponsorSubstrate(uint256 sponsor) external; - /// Whether there is a pending sponsor. /// @dev EVM selector for this function is: 0x058ac185, /// or in textual repr: hasCollectionPendingSponsor() @@ -161,18 +152,6 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: contractAddress() function contractAddress() external view returns (address); - /// Add collection admin by substrate address. - /// @param newAdmin Substrate administrator address. - /// @dev EVM selector for this function is: 0x5730062b, - /// or in textual repr: addCollectionAdminSubstrate(uint256) - function addCollectionAdminSubstrate(uint256 newAdmin) external; - - /// Remove collection admin by substrate address. - /// @param admin Substrate administrator address. - /// @dev EVM selector for this function is: 0x4048fcf9, - /// or in textual repr: removeCollectionAdminSubstrate(uint256) - function removeCollectionAdminSubstrate(uint256 admin) external; - /// Add collection admin. /// @param newAdmin Address of the added administrator. /// @dev EVM selector for this function is: 0x92e462c7, @@ -223,13 +202,6 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: addToCollectionAllowList(address) function addToCollectionAllowList(address user) external; - /// Add substrate user to allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xd06ad267, - /// or in textual repr: addToCollectionAllowListSubstrate(uint256) - function addToCollectionAllowListSubstrate(uint256 user) external; - /// Remove the user from the allowed list. /// /// @param user Address of a removed user. @@ -237,13 +209,6 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: removeFromCollectionAllowList(address) function removeFromCollectionAllowList(address user) external; - /// Remove substrate user from allowed list. - /// - /// @param user User substrate address. - /// @dev EVM selector for this function is: 0xa31913ed, - /// or in textual repr: removeFromCollectionAllowListSubstrate(uint256) - function removeFromCollectionAllowListSubstrate(uint256 user) external; - /// Switch permission for minting. /// /// @param mode Enable if "true". @@ -259,14 +224,6 @@ interface Collection is Dummy, ERC165 { /// or in textual repr: isOwnerOrAdmin(address) function isOwnerOrAdmin(address user) external view returns (bool); - /// Check that substrate account is the owner or admin of the collection - /// - /// @param user account to verify - /// @return "true" if account is the owner or admin - /// @dev EVM selector for this function is: 0x68910e00, - /// or in textual repr: isOwnerOrAdminSubstrate(uint256) - function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool); - /// Returns collection type /// /// @return `Fungible` or `NFT` or `ReFungible` @@ -289,14 +246,6 @@ interface Collection is Dummy, ERC165 { /// @dev EVM selector for this function is: 0x13af4035, /// or in textual repr: setOwner(address) function setOwner(address newOwner) external; - - /// Changes collection owner to another substrate account - /// - /// @dev Owner can be changed only by current owner - /// @param newOwner new owner substrate account - /// @dev EVM selector for this function is: 0xb212138f, - /// or in textual repr: setOwnerSubstrate(uint256) - function setOwnerSubstrate(uint256 newOwner) external; } /// @dev anonymous struct diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index 5f5f5e9b37..95b8129050 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -44,23 +44,24 @@ describe('Add collection admins', () => { .to.be.eq(newAdmin.toLocaleLowerCase()); }); - itWeb3('Add substrate admin by owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); + // TODO: Temprorary off. Need refactor + // itWeb3('Add substrate admin by owner', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - - const newAdmin = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send(); - - const adminList = await api.rpc.unique.adminlist(collectionId); - expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) - .to.be.eq(newAdmin.address.toLocaleLowerCase()); - }); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + + // const newAdmin = privateKeyWrapper('//Alice'); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send(); + + // const adminList = await api.rpc.unique.adminlist(collectionId); + // expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) + // .to.be.eq(newAdmin.address.toLocaleLowerCase()); + // }); itWeb3('Verify owner or admin', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -121,47 +122,49 @@ describe('Add collection admins', () => { expect(adminList.length).to.be.eq(0); }); - itWeb3('(!negative tests!) Add substrate admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); + // TODO: Temprorary off. Need refactor + // itWeb3('(!negative tests!) Add substrate admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - - const admin = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await collectionEvm.methods.addCollectionAdmin(admin).send(); - - const notAdmin = privateKey('//Alice'); - await expect(collectionEvm.methods.addCollectionAdminSubstrate(notAdmin.addressRaw).call({from: admin})) - .to.be.rejectedWith('NoPermission'); - - const adminList = await api.rpc.unique.adminlist(collectionId); - expect(adminList.length).to.be.eq(1); - expect(adminList[0].asEthereum.toString().toLocaleLowerCase()) - .to.be.eq(admin.toLocaleLowerCase()); - }); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + + // const admin = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // await collectionEvm.methods.addCollectionAdmin(admin).send(); + + // const notAdmin = privateKey('//Alice'); + // await expect(collectionEvm.methods.addCollectionAdminSubstrate(notAdmin.addressRaw).call({from: admin})) + // .to.be.rejectedWith('NoPermission'); + + // const adminList = await api.rpc.unique.adminlist(collectionId); + // expect(adminList.length).to.be.eq(1); + // expect(adminList[0].asEthereum.toString().toLocaleLowerCase()) + // .to.be.eq(admin.toLocaleLowerCase()); + // }); - itWeb3('(!negative tests!) Add substrate admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); + // TODO: Temprorary off. Need refactor + // itWeb3('(!negative tests!) Add substrate admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - - const notAdmin0 = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - const notAdmin1 = privateKey('//Alice'); - await expect(collectionEvm.methods.addCollectionAdminSubstrate(notAdmin1.addressRaw).call({from: notAdmin0})) - .to.be.rejectedWith('NoPermission'); - - const adminList = await api.rpc.unique.adminlist(collectionId); - expect(adminList.length).to.be.eq(0); - }); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + + // const notAdmin0 = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // const notAdmin1 = privateKey('//Alice'); + // await expect(collectionEvm.methods.addCollectionAdminSubstrate(notAdmin1.addressRaw).call({from: notAdmin0})) + // .to.be.rejectedWith('NoPermission'); + + // const adminList = await api.rpc.unique.adminlist(collectionId); + // expect(adminList.length).to.be.eq(0); + // }); }); describe('Remove collection admins', () => { @@ -189,28 +192,29 @@ describe('Remove collection admins', () => { expect(adminList.length).to.be.eq(0); }); - itWeb3('Remove substrate admin by owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); + // TODO: Temprorary off. Need refactor + // itWeb3('Remove substrate admin by owner', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - - const newAdmin = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send(); - { - const adminList = await api.rpc.unique.adminlist(collectionId); - expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) - .to.be.eq(newAdmin.address.toLocaleLowerCase()); - } + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + + // const newAdmin = privateKeyWrapper('//Alice'); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send(); + // { + // const adminList = await api.rpc.unique.adminlist(collectionId); + // expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) + // .to.be.eq(newAdmin.address.toLocaleLowerCase()); + // } - await collectionEvm.methods.removeCollectionAdminSubstrate(newAdmin.addressRaw).send(); - const adminList = await api.rpc.unique.adminlist(collectionId); - expect(adminList.length).to.be.eq(0); - }); + // await collectionEvm.methods.removeCollectionAdminSubstrate(newAdmin.addressRaw).send(); + // const adminList = await api.rpc.unique.adminlist(collectionId); + // expect(adminList.length).to.be.eq(0); + // }); itWeb3('(!negative tests!) Remove admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -264,53 +268,55 @@ describe('Remove collection admins', () => { } }); - itWeb3('(!negative tests!) Remove substrate admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); + // TODO: Temprorary off. Need refactor + // itWeb3('(!negative tests!) Remove substrate admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - - const adminSub = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send(); - const adminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - await collectionEvm.methods.addCollectionAdmin(adminEth).send(); - - await expect(collectionEvm.methods.removeCollectionAdminSubstrate(adminSub.addressRaw).call({from: adminEth})) - .to.be.rejectedWith('NoPermission'); - - const adminList = await api.rpc.unique.adminlist(collectionId); - expect(adminList.length).to.be.eq(2); - expect(adminList.toString().toLocaleLowerCase()) - .to.be.deep.contains(adminSub.address.toLocaleLowerCase()) - .to.be.deep.contains(adminEth.toLocaleLowerCase()); - }); - - itWeb3('(!negative tests!) Remove substrate admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + + // const adminSub = privateKeyWrapper('//Alice'); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send(); + // const adminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // await collectionEvm.methods.addCollectionAdmin(adminEth).send(); + + // await expect(collectionEvm.methods.removeCollectionAdminSubstrate(adminSub.addressRaw).call({from: adminEth})) + // .to.be.rejectedWith('NoPermission'); + + // const adminList = await api.rpc.unique.adminlist(collectionId); + // expect(adminList.length).to.be.eq(2); + // expect(adminList.toString().toLocaleLowerCase()) + // .to.be.deep.contains(adminSub.address.toLocaleLowerCase()) + // .to.be.deep.contains(adminEth.toLocaleLowerCase()); + // }); + + // TODO: Temprorary off. Need refactor + // itWeb3('(!negative tests!) Remove substrate admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - - const adminSub = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send(); - const notAdminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - - await expect(collectionEvm.methods.removeCollectionAdminSubstrate(adminSub.addressRaw).call({from: notAdminEth})) - .to.be.rejectedWith('NoPermission'); - - const adminList = await api.rpc.unique.adminlist(collectionId); - expect(adminList.length).to.be.eq(1); - expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) - .to.be.eq(adminSub.address.toLocaleLowerCase()); - }); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + + // const adminSub = privateKeyWrapper('//Alice'); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send(); + // const notAdminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + + // await expect(collectionEvm.methods.removeCollectionAdminSubstrate(adminSub.addressRaw).call({from: notAdminEth})) + // .to.be.rejectedWith('NoPermission'); + + // const adminList = await api.rpc.unique.adminlist(collectionId); + // expect(adminList.length).to.be.eq(1); + // expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) + // .to.be.eq(adminSub.address.toLocaleLowerCase()); + // }); }); describe('Change owner tests', () => { @@ -361,52 +367,55 @@ describe('Change owner tests', () => { }); describe('Change substrate owner tests', () => { - itWeb3('Change owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const newOwner = privateKeyWrapper('//Alice'); - const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // TODO: Temprorary off. Need refactor + // itWeb3('Change owner', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const newOwner = privateKeyWrapper('//Alice'); + // const collectionHelper = evmCollectionHelpers(web3, owner); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.true; - expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; + // expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.true; + // expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; - await collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send(); + // await collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send(); - expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.false; - expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.true; - }); - - itWeb3('change owner call fee', async ({web3, api, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const newOwner = privateKeyWrapper('//Alice'); - const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - - const cost = await recordEthFee(api, owner, () => collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send()); - expect(cost < BigInt(0.2 * Number(UNIQUE))); - expect(cost > 0); - }); - - itWeb3('(!negative tests!) call setOwner by non owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const otherReceiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const newOwner = privateKeyWrapper('//Alice'); - const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.false; + // expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.true; + // }); + + // TODO: Temprorary off. Need refactor + // itWeb3('change owner call fee', async ({web3, api, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const newOwner = privateKeyWrapper('//Alice'); + // const collectionHelper = evmCollectionHelpers(web3, owner); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + + // const cost = await recordEthFee(api, owner, () => collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send()); + // expect(cost < BigInt(0.2 * Number(UNIQUE))); + // expect(cost > 0); + // }); + + // TODO: Temprorary off. Need refactor + // itWeb3('(!negative tests!) call setOwner by non owner', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const otherReceiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const newOwner = privateKeyWrapper('//Alice'); + // const collectionHelper = evmCollectionHelpers(web3, owner); + // const result = await collectionHelper.methods + // .createNonfungibleCollection('A', 'B', 'C') + // .send(); + // const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await expect(collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send({from: otherReceiver})).to.be.rejected; - expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; - }); + // await expect(collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send({from: otherReceiver})).to.be.rejected; + // expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; + // }); }); \ No newline at end of file diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index 957b5c5e3f..5c0240c8b9 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -40,25 +40,26 @@ describe('evm collection sponsoring', () => { ]); }); - itWeb3('Set substrate sponsor', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const sponsor = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - - expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; - result = await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner}); - expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.true; + // TODO: Temprorary off. Need refactor + // itWeb3('Set substrate sponsor', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelpers = evmCollectionHelpers(web3, owner); + // let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + // const sponsor = privateKeyWrapper('//Alice'); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + + // expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; + // result = await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner}); + // expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.true; - const confirmTx = await api.tx.unique.confirmSponsorship(collectionId); - await submitTransactionAsync(sponsor, confirmTx); - expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; + // const confirmTx = await api.tx.unique.confirmSponsorship(collectionId); + // await submitTransactionAsync(sponsor, confirmTx); + // expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; - const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner}); - expect(bigIntToSub(api, BigInt(sponsorTuple[1]))).to.be.eq(sponsor.address); - }); + // const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner}); + // expect(bigIntToSub(api, BigInt(sponsorTuple[1]))).to.be.eq(sponsor.address); + // }); itWeb3('Remove sponsor', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -150,60 +151,61 @@ describe('evm collection sponsoring', () => { } }); - itWeb3('Sponsoring collection from substrate address via access list', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const sponsor = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + // TODO: Temprorary off. Need refactor + // itWeb3('Sponsoring collection from substrate address via access list', async ({api, web3, privateKeyWrapper}) => { + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const collectionHelpers = evmCollectionHelpers(web3, owner); + // const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + // const sponsor = privateKeyWrapper('//Alice'); + // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner}); + // await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner}); - const confirmTx = await api.tx.unique.confirmSponsorship(collectionId); - await submitTransactionAsync(sponsor, confirmTx); + // const confirmTx = await api.tx.unique.confirmSponsorship(collectionId); + // await submitTransactionAsync(sponsor, confirmTx); - const user = createEthAccount(web3); - const nextTokenId = await collectionEvm.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - - await collectionEvm.methods.setCollectionAccess(1 /*'AllowList'*/).send({from: owner}); - await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner}); - await collectionEvm.methods.setCollectionMintMode(true).send({from: owner}); - - const ownerBalanceBefore = await ethBalanceViaSub(api, owner); - const sponsorBalanceBefore = (await getBalance(api, [sponsor.address]))[0]; - - { - const nextTokenId = await collectionEvm.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - const result = await collectionEvm.methods.mintWithTokenURI( - user, - nextTokenId, - 'Test URI', - ).send({from: user}); - const events = normalizeEvents(result.events); - - expect(events).to.be.deep.equal([ - { - address: collectionIdAddress, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: user, - tokenId: nextTokenId, - }, - }, - ]); - - const ownerBalanceAfter = await ethBalanceViaSub(api, owner); - const sponsorBalanceAfter = (await getBalance(api, [sponsor.address]))[0]; - - expect(await collectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); - expect(ownerBalanceBefore).to.be.eq(ownerBalanceAfter); - expect(sponsorBalanceBefore > sponsorBalanceAfter).to.be.true; - } - }); + // const user = createEthAccount(web3); + // const nextTokenId = await collectionEvm.methods.nextTokenId().call(); + // expect(nextTokenId).to.be.equal('1'); + + // await collectionEvm.methods.setCollectionAccess(1 /*'AllowList'*/).send({from: owner}); + // await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner}); + // await collectionEvm.methods.setCollectionMintMode(true).send({from: owner}); + + // const ownerBalanceBefore = await ethBalanceViaSub(api, owner); + // const sponsorBalanceBefore = (await getBalance(api, [sponsor.address]))[0]; + + // { + // const nextTokenId = await collectionEvm.methods.nextTokenId().call(); + // expect(nextTokenId).to.be.equal('1'); + // const result = await collectionEvm.methods.mintWithTokenURI( + // user, + // nextTokenId, + // 'Test URI', + // ).send({from: user}); + // const events = normalizeEvents(result.events); + + // expect(events).to.be.deep.equal([ + // { + // address: collectionIdAddress, + // event: 'Transfer', + // args: { + // from: '0x0000000000000000000000000000000000000000', + // to: user, + // tokenId: nextTokenId, + // }, + // }, + // ]); + + // const ownerBalanceAfter = await ethBalanceViaSub(api, owner); + // const sponsorBalanceAfter = (await getBalance(api, [sponsor.address]))[0]; + + // expect(await collectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); + // expect(ownerBalanceBefore).to.be.eq(ownerBalanceAfter); + // expect(sponsorBalanceBefore > sponsorBalanceAfter).to.be.true; + // } + // }); itWeb3('Check that transaction via EVM spend money from sponsor address', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); diff --git a/tests/src/eth/fungibleAbi.json b/tests/src/eth/fungibleAbi.json index 535d804db5..2db19a7774 100644 --- a/tests/src/eth/fungibleAbi.json +++ b/tests/src/eth/fungibleAbi.json @@ -58,15 +58,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "newAdmin", "type": "uint256" } - ], - "name": "addCollectionAdminSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" } @@ -76,15 +67,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "addToCollectionAllowListSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, @@ -218,15 +200,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "isOwnerOrAdminSubstrate", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, @@ -270,15 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "admin", "type": "uint256" } - ], - "name": "removeCollectionAdminSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "removeCollectionSponsor", @@ -295,15 +259,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "removeFromCollectionAllowListSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [{ "internalType": "uint8", "name": "mode", "type": "uint8" }], "name": "setCollectionAccess", @@ -378,15 +333,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "sponsor", "type": "uint256" } - ], - "name": "setCollectionSponsorSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } @@ -396,15 +342,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "newOwner", "type": "uint256" } - ], - "name": "setOwnerSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" } diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index c760d51b4b..e3bca35559 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -89,15 +89,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "newAdmin", "type": "uint256" } - ], - "name": "addCollectionAdminSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" } @@ -107,15 +98,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "addToCollectionAllowListSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" } @@ -277,15 +259,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "isOwnerOrAdminSubstrate", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, @@ -384,15 +357,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "admin", "type": "uint256" } - ], - "name": "removeCollectionAdminSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "removeCollectionSponsor", @@ -409,15 +373,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "removeFromCollectionAllowListSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, @@ -525,15 +480,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "sponsor", "type": "uint256" } - ], - "name": "setCollectionSponsorSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } @@ -543,15 +489,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "newOwner", "type": "uint256" } - ], - "name": "setOwnerSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index 691c0aeb8a..39f312198d 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -89,15 +89,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "newAdmin", "type": "uint256" } - ], - "name": "addCollectionAdminSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" } @@ -107,15 +98,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "addToCollectionAllowListSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" } @@ -277,15 +259,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "isOwnerOrAdminSubstrate", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, @@ -384,15 +357,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "admin", "type": "uint256" } - ], - "name": "removeCollectionAdminSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "removeCollectionSponsor", @@ -409,15 +373,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "user", "type": "uint256" } - ], - "name": "removeFromCollectionAllowListSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, @@ -525,15 +480,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "sponsor", "type": "uint256" } - ], - "name": "setCollectionSponsorSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } @@ -543,15 +489,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "newOwner", "type": "uint256" } - ], - "name": "setOwnerSubstrate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, From 95c88d307c6bc556f649c821ff15c872b798221b Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 28 Sep 2022 15:28:49 +0300 Subject: [PATCH 0967/1274] eth/collectionProperties migrated --- tests/src/eth/collectionProperties.test.ts | 67 +++++++++++----------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/tests/src/eth/collectionProperties.test.ts b/tests/src/eth/collectionProperties.test.ts index 582e0ba217..3c1b604926 100644 --- a/tests/src/eth/collectionProperties.test.ts +++ b/tests/src/eth/collectionProperties.test.ts @@ -1,53 +1,56 @@ -import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess} from '../util/helpers'; -import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3} from './util/helpers'; -import nonFungibleAbi from './nonFungibleAbi.json'; -import {expect} from 'chai'; -import {executeTransaction} from '../substrate/substrate-api'; +import {itEth, usingEthPlaygrounds, expect} from './util/playgrounds'; +import {IKeyringPair} from '@polkadot/types/types'; describe('EVM collection properties', () => { - itWeb3('Can be set', async({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); + let donor: IKeyringPair; + let alice: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + [alice] = await _helper.arrange.createAccounts([10n], donor); + }); + }); - await addCollectionAdminExpectSuccess(alice, collection, {Ethereum: caller}); + itEth('Can be set', async({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'test', tokenPrefix: 'test'}); + await collection.addAdmin(alice, {Ethereum: caller}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', caller); await contract.methods.setCollectionProperty('testKey', Buffer.from('testValue')).send({from: caller}); - const [{value}] = (await api.rpc.unique.collectionProperties(collection, ['testKey'])).toHuman()! as any; - expect(value).to.equal('testValue'); + const raw = (await collection.getData())?.raw; + + expect(raw.properties[0].value).to.equal('testValue'); }); - itWeb3('Can be deleted', async({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await executeTransaction(api, alice, api.tx.unique.setCollectionProperties(collection, [{key: 'testKey', value: 'testValue'}])); + itEth('Can be deleted', async({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'test', tokenPrefix: 'test', properties: [{key: 'testKey', value: 'testValue'}]}); - await addCollectionAdminExpectSuccess(alice, collection, {Ethereum: caller}); + await collection.addAdmin(alice, {Ethereum: caller}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', caller); await contract.methods.deleteCollectionProperty('testKey').send({from: caller}); - const result = (await api.rpc.unique.collectionProperties(collection, ['testKey'])).toJSON()! as any; - expect(result.length).to.equal(0); + const raw = (await collection.getData())?.raw; + + expect(raw.properties.length).to.equal(0); }); - itWeb3('Can be read', async({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const caller = createEthAccount(web3); - const collection = await createCollectionExpectSuccess({mode: {type:'NFT'}}); - await executeTransaction(api, alice, api.tx.unique.setCollectionProperties(collection, [{key: 'testKey', value: 'testValue'}])); + itEth('Can be read', async({helper}) => { + const caller = helper.eth.createAccount(); + const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'test', tokenPrefix: 'test', properties: [{key: 'testKey', value: 'testValue'}]}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', caller); const value = await contract.methods.collectionProperty('testKey').call(); - expect(value).to.equal(web3.utils.toHex('testValue')); + expect(value).to.equal(helper.web3?.utils.toHex('testValue')); }); }); From adb854cc5dc66574062ecb8d27ccac0f7bb071f0 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Wed, 28 Sep 2022 12:46:17 +0000 Subject: [PATCH 0968/1274] tests(util): introduce CrossAccountId class to take on some util functionality --- tests/src/nesting/nest.test.ts | 34 ++++---- tests/src/nesting/unnest.test.ts | 4 +- tests/src/rpc.test.ts | 4 +- tests/src/util/playgrounds/unique.ts | 115 ++++++++++++++------------- 4 files changed, 81 insertions(+), 76 deletions(-) diff --git a/tests/src/nesting/nest.test.ts b/tests/src/nesting/nest.test.ts index c1232272f6..95498d4779 100644 --- a/tests/src/nesting/nest.test.ts +++ b/tests/src/nesting/nest.test.ts @@ -35,7 +35,7 @@ describe('Integration Test: Composite nesting tests', () => { // Create an immediately nested token const nestedToken = await collection.mintToken(alice, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); // Create a token to be nested const newToken = await collection.mintToken(alice); @@ -43,14 +43,14 @@ describe('Integration Test: Composite nesting tests', () => { // Nest await newToken.nest(alice, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); // Move bundle to different user await targetToken.transfer(alice, {Substrate: bob.address}); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); // Unnest await newToken.unnest(bob, targetToken, {Substrate: bob.address}); @@ -65,12 +65,12 @@ describe('Integration Test: Composite nesting tests', () => { // Create a nested token const tokenC = await collection.mintToken(alice, tokenA.nestingAccount()); - expect(await tokenC.getOwner()).to.be.deep.equal(tokenA.nestingAccountInLowerCase()); + expect(await tokenC.getOwner()).to.be.deep.equal(tokenA.nestingAccount().toLowerCase()); // Transfer the nested token to another token await expect(tokenC.transferFrom(alice, tokenA.nestingAccount(), tokenB.nestingAccount())).to.be.fulfilled; expect(await tokenC.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address}); - expect(await tokenC.getOwner()).to.be.deep.equal(tokenB.nestingAccountInLowerCase()); + expect(await tokenC.getOwner()).to.be.deep.equal(tokenB.nestingAccount().toLowerCase()); }); itSub('Checks token children', async ({helper}) => { @@ -150,13 +150,13 @@ describe('Integration Test: Various token type nesting', () => { // Create an immediately nested token const nestedToken = await collection.mintToken(bob, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); // Create a token to be nested and nest const newToken = await collection.mintToken(bob); await newToken.nest(bob, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); }); itSub('Admin (NFT): Admin and Token Owner can operate together', async ({helper}) => { @@ -167,13 +167,13 @@ describe('Integration Test: Various token type nesting', () => { // Create an immediately nested token by an administrator const nestedToken = await collection.mintToken(bob, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); // Create a token to be nested and nest const newToken = await collection.mintToken(alice, {Substrate: charlie.address}); await newToken.nest(charlie, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); }); itSub('Admin (NFT): allows an Admin to nest a token (Restricted nesting)', async ({helper}) => { @@ -187,13 +187,13 @@ describe('Integration Test: Various token type nesting', () => { // Create an immediately nested token const nestedToken = await collectionB.mintToken(bob, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); // Create a token to be nested and nest const newToken = await collectionB.mintToken(bob); await newToken.nest(bob, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); }); // ---------- Non-Fungible ---------- @@ -207,13 +207,13 @@ describe('Integration Test: Various token type nesting', () => { // Create an immediately nested token const nestedToken = await collection.mintToken(charlie, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); // Create a token to be nested and nest const newToken = await collection.mintToken(charlie); await newToken.nest(charlie, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); }); itSub('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async ({helper}) => { @@ -233,13 +233,13 @@ describe('Integration Test: Various token type nesting', () => { // Create an immediately nested token const nestedToken = await collectionB.mintToken(charlie, targetToken.nestingAccount()); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); // Create a token to be nested and nest const newToken = await collectionB.mintToken(charlie); await newToken.nest(charlie, targetToken); expect(await newToken.getTopmostOwner()).to.be.deep.equal({Substrate: charlie.address}); - expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await newToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); }); // ---------- Fungible ---------- @@ -424,7 +424,7 @@ describe('Negative Test: Nesting', () => { expect(await targetToken.getChildren()).to.be.length(1); expect(await nestedToken.getTopmostOwner()).to.be.deep.equal({Substrate: bob.address}); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); }); itSub('Admin (NFT): disallows an Admin to nest a token from an unlisted collection (Restricted nesting)', async ({helper}) => { diff --git a/tests/src/nesting/unnest.test.ts b/tests/src/nesting/unnest.test.ts index 12c7c34f81..66b7ee6763 100644 --- a/tests/src/nesting/unnest.test.ts +++ b/tests/src/nesting/unnest.test.ts @@ -105,11 +105,11 @@ describe('Negative Test: Unnesting', () => { // Try to unnest await expect(nestedToken.unnest(bob, targetToken, {Substrate: alice.address})).to.be.rejectedWith(/common\.ApprovedValueTooLow/); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); // Try to burn await expect(nestedToken.burnFrom(bob, targetToken.nestingAccount())).to.be.rejectedWith(/common\.ApprovedValueTooLow/); - expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccountInLowerCase()); + expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase()); }); // todo another test for creating excessive depth matryoshka with Ethereum? diff --git a/tests/src/rpc.test.ts b/tests/src/rpc.test.ts index 291f3f86c2..8937f6f1ba 100644 --- a/tests/src/rpc.test.ts +++ b/tests/src/rpc.test.ts @@ -16,7 +16,7 @@ import {IKeyringPair} from '@polkadot/types/types'; import {usingPlaygrounds, itSub, expect} from './util/playgrounds'; -import {crossAccountIdFromLower} from './util/playgrounds/unique'; +import {CrossAccountId} from './util/playgrounds/unique'; describe('integration test: RPC methods', () => { let donor: IKeyringPair; @@ -55,7 +55,7 @@ describe('integration test: RPC methods', () => { // Set-up over const owners = await helper.callRpc('api.rpc.unique.tokenOwners', [collection.collectionId, 0]); - const ids = (owners.toJSON() as any[]).map(crossAccountIdFromLower); + const ids = (owners.toJSON() as any[]).map(CrossAccountId.fromLowerCaseKeys); expect(ids).to.deep.include.members([{Substrate: alice.address}, ethAcc, {Substrate: bob.address}, ...facelessCrowd]); expect(owners.length == 10).to.be.true; diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index eace500d9d..aba9ead3ae 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -11,12 +11,42 @@ import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} f import {IKeyringPair} from '@polkadot/types/types'; import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; -export const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => { - const address = {} as ICrossAccountId; - if(lowerAddress.substrate) address.Substrate = lowerAddress.substrate; - if(lowerAddress.ethereum) address.Ethereum = lowerAddress.ethereum; - return address; -}; +export class CrossAccountId implements ICrossAccountId { + Substrate?: TSubstrateAccount; + Ethereum?: TEthereumAccount; + + constructor(account: ICrossAccountId) { + if (account.Substrate) this.Substrate = account.Substrate; + if (account.Ethereum) this.Ethereum = account.Ethereum; + } + + static fromKeyring(account: IKeyringPair) { + return new CrossAccountId({Substrate: account.address}); + } + + static fromLowerCaseKeys(address: ICrossAccountIdLower): CrossAccountId { + return new CrossAccountId({Substrate: address.substrate, Ethereum: address.ethereum}); + } + + static normalizeSubstrateAddress(address: TSubstrateAccount, ss58Format = 42): TSubstrateAccount { + return encodeAddress(decodeAddress(address), ss58Format); + } + + static withNormalizedSubstrate(address: TSubstrateAccount, ss58Format = 42): CrossAccountId { + return new CrossAccountId({Substrate: CrossAccountId.normalizeSubstrateAddress(address, ss58Format)}); + } + + withNormalizedSubstrate(ss58Format = 42): CrossAccountId { + if (this.Substrate) return CrossAccountId.withNormalizedSubstrate(this.Substrate, ss58Format); + return this; + } + + toLowerCase(): CrossAccountId { + if (this.Substrate) this.Substrate = this.Substrate.toLowerCase(); + if (this.Ethereum) this.Ethereum = this.Ethereum.toLowerCase(); + return this; + } +} const nesting = { toChecksumAddress(address: string): string { @@ -55,12 +85,8 @@ class UniqueUtil { RPC: 'rpc', }; - static getTokenAccount(token: IToken): ICrossAccountId { - return {Ethereum: this.getTokenAddress(token)}; - } - - static getTokenAccountInLowerCase(token: IToken): ICrossAccountId { - return {Ethereum: this.getTokenAddress(token).toLowerCase()}; + static getTokenAccount(token: IToken): CrossAccountId { + return new CrossAccountId({Ethereum: this.getTokenAddress(token)}); } static getTokenAddress(token: IToken): string { @@ -94,10 +120,6 @@ class UniqueUtil { return keyring.addFromUri(seed); } - static normalizeSubstrateAddress(address: string, ss58Format = 42) { - return encodeAddress(decodeAddress(address), ss58Format); - } - static extractCollectionIdFromCreationResult(creationResult: ITransactionResult) { if (creationResult.status !== this.transactionStatus.SUCCESS) { throw Error('Unable to create collection!'); @@ -178,8 +200,8 @@ class UniqueUtil { Object.keys(address).forEach(k => { obj[k.toLocaleLowerCase()] = address[k as 'Substrate' | 'Ethereum']; }); - if(obj.substrate) return {Substrate: this.normalizeSubstrateAddress(obj.substrate)}; - if(obj.ethereum) return {Ethereum: obj.ethereum.toLocaleLowerCase()}; + if(obj.substrate) return CrossAccountId.withNormalizedSubstrate(obj.substrate); + if(obj.ethereum) return CrossAccountId.fromLowerCaseKeys(obj).toLowerCase(); return address; }; let transfer = {collectionId: null, tokenId: null, from: null, to: null, amount: 1} as any; @@ -563,7 +585,7 @@ class CollectionGroup extends HelperGroup { name: string; description: string; tokensCount: number; - admins: ICrossAccountId[]; + admins: CrossAccountId[]; normalizedOwner: TSubstrateAccount; raw: any } | null> { @@ -596,11 +618,11 @@ class CollectionGroup extends HelperGroup { * @example await getAdmins(1) * @returns array of administrators */ - async getAdmins(collectionId: number, normalize = false): Promise { + async getAdmins(collectionId: number, normalize = false): Promise { const admins = (await this.helper.callRpc('api.rpc.unique.adminlist', [collectionId])).toHuman(); return normalize - ? admins.map((address: any) => this.helper.address.normalizeCrossAccountIfSubstrate(address)) + ? admins.map((address: CrossAccountId) => address.withNormalizedSubstrate()) : admins; } @@ -611,10 +633,10 @@ class CollectionGroup extends HelperGroup { * @example await getAllowList(1) * @returns array of allow-listed addresses */ - async getAllowList(collectionId: number, normalize = false): Promise { + async getAllowList(collectionId: number, normalize = false): Promise { const allowListed = (await this.helper.callRpc('api.rpc.unique.allowlist', [collectionId])).toHuman(); return normalize - ? allowListed.map((address: any) => this.helper.address.normalizeCrossAccountIfSubstrate(address)) + ? allowListed.map((address: CrossAccountId) => address.withNormalizedSubstrate()) : allowListed; } @@ -1099,8 +1121,8 @@ class NFTnRFT extends CollectionGroup { */ async getToken(collectionId: number, tokenId: number, propertyKeys: string[] = [], blockHashAt?: string): Promise<{ properties: IProperty[]; - owner: ICrossAccountId; - normalizedOwner: ICrossAccountId; + owner: CrossAccountId; + normalizedOwner: CrossAccountId; }| null> { let tokenData; if(typeof blockHashAt === 'undefined') { @@ -1118,9 +1140,9 @@ class NFTnRFT extends CollectionGroup { if (tokenData === null || tokenData.owner === null) return null; const owner = {} as any; for (const key of Object.keys(tokenData.owner)) { - owner[key.toLocaleLowerCase()] = this.helper.address.normalizeCrossAccountIfSubstrate(tokenData.owner[key]); + owner[key.toLocaleLowerCase()] = new CrossAccountId(tokenData.owner[key]).withNormalizedSubstrate(); } - tokenData.normalizedOwner = crossAccountIdFromLower(owner); + tokenData.normalizedOwner = CrossAccountId.fromLowerCaseKeys(owner); return tokenData; } @@ -1272,14 +1294,14 @@ class NFTGroup extends NFTnRFT { * @example getTokenOwner(10, 5); * @returns Address in CrossAccountId format, e.g. {Substrate: "5DnSF6RRjwteE3BrCj..."} */ - async getTokenOwner(collectionId: number, tokenId: number, blockHashAt?: string): Promise { + async getTokenOwner(collectionId: number, tokenId: number, blockHashAt?: string): Promise { let owner; if (typeof blockHashAt === 'undefined') { owner = await this.helper.callRpc('api.rpc.unique.tokenOwner', [collectionId, tokenId]); } else { owner = await this.helper.callRpc('api.rpc.unique.tokenOwner', [collectionId, tokenId, blockHashAt]); } - return crossAccountIdFromLower(owner.toJSON()); + return CrossAccountId.fromLowerCaseKeys(owner.toJSON()); } /** @@ -1331,7 +1353,7 @@ class NFTGroup extends NFTnRFT { * @example getTokenTopmostOwner(10, 5); * @returns address in CrossAccountId format, e.g. {Substrate: "5DyN4Y92vZCjv38fg..."} */ - async getTokenTopmostOwner(collectionId: number, tokenId: number, blockHashAt?: string): Promise { + async getTokenTopmostOwner(collectionId: number, tokenId: number, blockHashAt?: string): Promise { let owner; if (typeof blockHashAt === 'undefined') { owner = await this.helper.callRpc('api.rpc.unique.topmostTokenOwner', [collectionId, tokenId]); @@ -1541,8 +1563,8 @@ class RFTGroup extends NFTnRFT { * @example getTokenTop10Owners(10, 5); * @returns array of top 10 owners */ - async getTokenTop10Owners(collectionId: number, tokenId: number): Promise { - return (await this.helper.callRpc('api.rpc.unique.tokenOwners', [collectionId, tokenId])).toJSON().map(crossAccountIdFromLower); + async getTokenTop10Owners(collectionId: number, tokenId: number): Promise { + return (await this.helper.callRpc('api.rpc.unique.tokenOwners', [collectionId, tokenId])).toJSON().map(CrossAccountId.fromLowerCaseKeys); } /** @@ -1825,8 +1847,8 @@ class FTGroup extends CollectionGroup { * @example getTop10Owners(10); * @returns array of ```ICrossAccountId``` */ - async getTop10Owners(collectionId: number): Promise { - return (await this.helper.callRpc('api.rpc.unique.tokenOwners', [collectionId, 0])).toJSON().map(crossAccountIdFromLower); + async getTop10Owners(collectionId: number): Promise { + return (await this.helper.callRpc('api.rpc.unique.tokenOwners', [collectionId, 0])).toJSON().map(CrossAccountId.fromLowerCaseKeys); } /** @@ -2045,9 +2067,9 @@ class BalanceGroup extends HelperGroup { }; } }); - let isSuccess = this.helper.address.normalizeSubstrate(typeof signer === 'string' ? signer : signer.address) === transfer.from; - isSuccess = isSuccess && this.helper.address.normalizeSubstrate(address) === transfer.to; - isSuccess = isSuccess && BigInt(amount) === transfer.amount; + const isSuccess = this.helper.address.normalizeSubstrate(typeof signer === 'string' ? signer : signer.address) === transfer.from + && this.helper.address.normalizeSubstrate(address) === transfer.to + && BigInt(amount) === transfer.amount; return isSuccess; } } @@ -2062,20 +2084,7 @@ class AddressGroup extends HelperGroup { * @returns substrate address converted to normalized (i.e., starting with 5) or specified explicitly representation */ normalizeSubstrate(address: TSubstrateAccount, ss58Format = 42): TSubstrateAccount { - return this.helper.util.normalizeSubstrateAddress(address, ss58Format); - } - - /** - * Normalizes the address of an account ONLY if it's Substrate to the specified ss58 format, by default ```42```. - * @param account account of either Substrate type or Ethereum, but only Substrate will be changed - * @param ss58Format format for address conversion, by default ```42``` - * @example normalizeCrossAccountIfSubstrate({Substrate: "unjKJQJrRd238pkUZZvzDQrfKuM39zBSnQ5zjAGAGcdRhaJTx"}) // returns 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY - * @returns untouched ethereum account or substrate account converted to normalized (i.e., starting with 5) or specified explicitly representation - */ - normalizeCrossAccountIfSubstrate(account: ICrossAccountId, ss58Format = 42): ICrossAccountId { - return account.Substrate - ? {Substrate: this.normalizeSubstrate(account.Substrate, ss58Format)} - : account; + return CrossAccountId.normalizeSubstrateAddress(address, ss58Format); } /** @@ -2573,10 +2582,6 @@ export class UniqueBaseToken { nestingAccount() { return this.collection.helper.util.getTokenAccount(this); } - - nestingAccountInLowerCase() { - return this.collection.helper.util.getTokenAccountInLowerCase(this); - } } From 759b8713cf2365a9d1901b026fc1657202b31bb3 Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 28 Sep 2022 16:01:08 +0300 Subject: [PATCH 0969/1274] eth/base migrated --- tests/src/eth/base.test.ts | 105 +++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 52 deletions(-) diff --git a/tests/src/eth/base.test.ts b/tests/src/eth/base.test.ts index 606eab642d..e4f0878469 100644 --- a/tests/src/eth/base.test.ts +++ b/tests/src/eth/base.test.ts @@ -15,54 +15,53 @@ // along with Unique Network. If not, see . import { - collectionIdToAddress, - createEthAccount, - createEthAccountWithBalance, - deployFlipper, ethBalanceViaSub, GAS_ARGS, - itWeb3, recordEthFee, - usingWeb3, } from './util/helpers'; -import {expect} from 'chai'; -import {createCollectionExpectSuccess, createItemExpectSuccess, UNIQUE} from '../util/helpers'; -import nonFungibleAbi from './nonFungibleAbi.json'; import {Contract} from 'web3-eth-contract'; -import Web3 from 'web3'; + +import {IKeyringPair} from '@polkadot/types/types'; +import {EthUniqueHelper, itEth, usingEthPlaygrounds, expect} from './util/playgrounds'; +import {UNIQUE} from '../util/helpers'; describe('Contract calls', () => { - itWeb3('Call of simple contract fee is less than 0.2 UNQ', async ({web3, api, privateKeyWrapper}) => { - const deployer = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, deployer); + let donor: IKeyringPair; - const cost = await recordEthFee(api, deployer, () => flipper.methods.flip().send({from: deployer})); - expect(cost < BigInt(0.2 * Number(UNIQUE))).to.be.true; + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); }); - itWeb3('Balance transfer fee is less than 0.2 UNQ', async ({web3, api, privateKeyWrapper}) => { - const userA = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const userB = createEthAccount(web3); + itEth('Call of simple contract fee is less than 0.2 UNQ', async ({helper}) => { + const deployer = await helper.eth.createAccountWithBalance(donor); + const flipper = await helper.eth.deployFlipper(deployer); - const cost = await recordEthFee(api, userA, () => web3.eth.sendTransaction({from: userA, to: userB, value: '1000000', ...GAS_ARGS})); - const balanceB = await ethBalanceViaSub(api, userB); + const cost = await recordEthFee(helper.api!, deployer, () => flipper.methods.flip().send({from: deployer})); + expect(cost < BigInt(0.2 * Number(UNIQUE))).to.be.true; + }); + + itEth('Balance transfer fee is less than 0.2 UNQ', async ({helper}) => { + const userA = await helper.eth.createAccountWithBalance(donor); + const userB = helper.eth.createAccount(); + const cost = await recordEthFee(helper.api!, userA, () => helper.web3!.eth.sendTransaction({from: userA, to: userB, value: '1000000', ...GAS_ARGS})); + const balanceB = await ethBalanceViaSub(helper.api!, userB); expect(cost - balanceB < BigInt(0.2 * Number(UNIQUE))).to.be.true; }); - itWeb3('NFT transfer is close to 0.15 UNQ', async ({web3, api, privateKeyWrapper}) => { - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const receiver = createEthAccount(web3); + itEth('NFT transfer is close to 0.15 UNQ', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); - const alice = privateKeyWrapper('//Alice'); - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const itemId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: caller}); + const [alice] = await helper.arrange.createAccounts([10n], donor); + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const {tokenId} = await collection.mintToken(alice, {Ethereum: caller}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', caller); - const cost = await recordEthFee(api, caller, () => contract.methods.transfer(receiver, itemId).send(caller)); + const cost = await recordEthFee(helper.api!, caller, () => contract.methods.transfer(receiver, tokenId).send(caller)); const fee = Number(cost) / Number(UNIQUE); const expectedFee = 0.15; @@ -78,46 +77,48 @@ describe('ERC165 tests', async () => { let collection: number; let minter: string; - function contract(web3: Web3): Contract { - return new web3.eth.Contract(nonFungibleAbi as any, collectionIdToAddress(collection), {from: minter, ...GAS_ARGS}); + function contract(helper: EthUniqueHelper): Contract { + return helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection), 'nft', minter); } before(async () => { - await usingWeb3 (async (web3) => { - collection = await createCollectionExpectSuccess(); - minter = createEthAccount(web3); + await usingEthPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + const [alice] = await helper.arrange.createAccounts([10n], donor); + ({collectionId: collection} = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'})); + minter = helper.eth.createAccount(); }); }); - itWeb3('interfaceID == 0xffffffff always false', async ({web3}) => { - expect(await contract(web3).methods.supportsInterface('0xffffffff').call()).to.be.false; + itEth('interfaceID == 0xffffffff always false', async ({helper}) => { + expect(await contract(helper).methods.supportsInterface('0xffffffff').call()).to.be.false; }); - itWeb3('ERC721 support', async ({web3}) => { - expect(await contract(web3).methods.supportsInterface('0x780e9d63').call()).to.be.true; + itEth('ERC721 support', async ({helper}) => { + expect(await contract(helper).methods.supportsInterface('0x780e9d63').call()).to.be.true; }); - itWeb3('ERC721Metadata support', async ({web3}) => { - expect(await contract(web3).methods.supportsInterface('0x5b5e139f').call()).to.be.true; + itEth('ERC721Metadata support', async ({helper}) => { + expect(await contract(helper).methods.supportsInterface('0x5b5e139f').call()).to.be.true; }); - itWeb3('ERC721Mintable support', async ({web3}) => { - expect(await contract(web3).methods.supportsInterface('0x68ccfe89').call()).to.be.true; + itEth('ERC721Mintable support', async ({helper}) => { + expect(await contract(helper).methods.supportsInterface('0x68ccfe89').call()).to.be.true; }); - itWeb3('ERC721Enumerable support', async ({web3}) => { - expect(await contract(web3).methods.supportsInterface('0x780e9d63').call()).to.be.true; + itEth('ERC721Enumerable support', async ({helper}) => { + expect(await contract(helper).methods.supportsInterface('0x780e9d63').call()).to.be.true; }); - itWeb3('ERC721UniqueExtensions support', async ({web3}) => { - expect(await contract(web3).methods.supportsInterface('0xd74d154f').call()).to.be.true; + itEth('ERC721UniqueExtensions support', async ({helper}) => { + expect(await contract(helper).methods.supportsInterface('0xd74d154f').call()).to.be.true; }); - itWeb3('ERC721Burnable support', async ({web3}) => { - expect(await contract(web3).methods.supportsInterface('0x42966c68').call()).to.be.true; + itEth('ERC721Burnable support', async ({helper}) => { + expect(await contract(helper).methods.supportsInterface('0x42966c68').call()).to.be.true; }); - itWeb3('ERC165 support', async ({web3}) => { - expect(await contract(web3).methods.supportsInterface('0x01ffc9a7').call()).to.be.true; + itEth('ERC165 support', async ({helper}) => { + expect(await contract(helper).methods.supportsInterface('0x01ffc9a7').call()).to.be.true; }); }); From 3fb65c0d79a10ee2d0c3e16c75c75acf22054f47 Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 28 Sep 2022 16:39:21 +0300 Subject: [PATCH 0970/1274] eth/proxy/fungibleProxy migrated --- tests/src/eth/proxy/fungibleProxy.test.ts | 123 +++++++++++----------- 1 file changed, 61 insertions(+), 62 deletions(-) diff --git a/tests/src/eth/proxy/fungibleProxy.test.ts b/tests/src/eth/proxy/fungibleProxy.test.ts index 9c2e2baef3..ba3e2b9c80 100644 --- a/tests/src/eth/proxy/fungibleProxy.test.ts +++ b/tests/src/eth/proxy/fungibleProxy.test.ts @@ -14,19 +14,16 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {createCollectionExpectSuccess, createFungibleItemExpectSuccess} from '../../util/helpers'; -import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents} from '../util/helpers'; -import fungibleAbi from '../fungibleAbi.json'; +import {GAS_ARGS, normalizeEvents} from '../util/helpers'; import {expect} from 'chai'; -import {ApiPromise} from '@polkadot/api'; -import Web3 from 'web3'; import {readFile} from 'fs/promises'; import {IKeyringPair} from '@polkadot/types/types'; +import {EthUniqueHelper, itEth, usingEthPlaygrounds} from '../util/playgrounds'; -async function proxyWrap(api: ApiPromise, web3: Web3, wrapped: any, privateKeyWrapper: (account: string) => IKeyringPair) { +async function proxyWrap(helper: EthUniqueHelper, wrapped: any, donor: IKeyringPair) { // Proxy owner has no special privilegies, we don't need to reuse them - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const proxyContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/UniqueFungibleProxy.abi`)).toString()), undefined, { + const owner = await helper.eth.createAccountWithBalance(donor); + const proxyContract = new helper.web3!.eth.Contract(JSON.parse((await readFile(`${__dirname}/UniqueFungibleProxy.abi`)).toString()), undefined, { from: owner, ...GAS_ARGS, }); @@ -35,35 +32,38 @@ async function proxyWrap(api: ApiPromise, web3: Web3, wrapped: any, privateKeyWr } describe('Fungible (Via EVM proxy): Information getting', () => { - itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'Fungible', decimalPoints: 0}, + let alice: IKeyringPair; + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); }); - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + }); - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Substrate: alice.address}); + itEth('totalSupply', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}, 0); + const caller = await helper.eth.createAccountWithBalance(donor); + await collection.mint(alice, 200n, {Substrate: alice.address}); - const address = collectionIdToAddress(collection); - const contract = await proxyWrap(api, web3, new web3.eth.Contract(fungibleAbi as any, address, {from: caller, ...GAS_ARGS}), privateKeyWrapper); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const evmCollection = helper.ethNativeContract.collection(address, 'ft', caller); + const contract = await proxyWrap(helper, evmCollection, donor); const totalSupply = await contract.methods.totalSupply().call(); expect(totalSupply).to.equal('200'); }); - itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'Fungible', decimalPoints: 0}, - }); - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('balanceOf', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}, 0); + const caller = await helper.eth.createAccountWithBalance(donor); - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Ethereum: caller}); + await collection.mint(alice, 200n, {Ethereum: caller}); - const address = collectionIdToAddress(collection); - const contract = await proxyWrap(api, web3, new web3.eth.Contract(fungibleAbi as any, address, {from: caller, ...GAS_ARGS}), privateKeyWrapper); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const evmCollection = helper.ethNativeContract.collection(address, 'ft', caller); + const contract = await proxyWrap(helper, evmCollection, donor); const balance = await contract.methods.balanceOf(caller).call(); expect(balance).to.equal('200'); @@ -71,18 +71,25 @@ describe('Fungible (Via EVM proxy): Information getting', () => { }); describe('Fungible (Via EVM proxy): Plain calls', () => { - itWeb3('Can perform approve()', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'Fungible', decimalPoints: 0}, + let alice: IKeyringPair; + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); }); - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const spender = createEthAccount(web3); + }); - const address = collectionIdToAddress(collection); - const contract = await proxyWrap(api, web3, new web3.eth.Contract(fungibleAbi as any, address, {from: caller, ...GAS_ARGS}), privateKeyWrapper); - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Ethereum: contract.options.address}); + itEth('Can perform approve()', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}, 0); + const caller = await helper.eth.createAccountWithBalance(donor); + const spender = helper.eth.createAccount(); + + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const evmCollection = helper.ethNativeContract.collection(address, 'ft', caller); + const contract = await proxyWrap(helper, evmCollection, donor); + await collection.mint(alice, 200n, {Ethereum: contract.options.address}); { const result = await contract.methods.approve(spender, 100).send({from: caller}); @@ -107,22 +114,17 @@ describe('Fungible (Via EVM proxy): Plain calls', () => { } }); - itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'Fungible', decimalPoints: 0}, - }); - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Ethereum: owner}); + itEth('Can perform transferFrom()', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}, 0); + const caller = await helper.eth.createAccountWithBalance(donor); + const owner = await helper.eth.createAccountWithBalance(donor); - const receiver = createEthAccount(web3); + await collection.mint(alice, 200n, {Ethereum: owner}); + const receiver = helper.eth.createAccount(); - const address = collectionIdToAddress(collection); - const evmCollection = new web3.eth.Contract(fungibleAbi as any, address, {from: caller, ...GAS_ARGS}); - const contract = await proxyWrap(api, web3, evmCollection, privateKeyWrapper); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const evmCollection = helper.ethNativeContract.collection(address, 'ft', caller); + const contract = await proxyWrap(helper, evmCollection, donor); await evmCollection.methods.approve(contract.options.address, 100).send({from: owner}); @@ -162,18 +164,15 @@ describe('Fungible (Via EVM proxy): Plain calls', () => { } }); - itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'Fungible', decimalPoints: 0}, - }); - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const receiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('Can perform transfer()', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}, 0); + const caller = await helper.eth.createAccountWithBalance(donor); + const receiver = await helper.eth.createAccountWithBalance(donor); - const address = collectionIdToAddress(collection); - const contract = await proxyWrap(api, web3, new web3.eth.Contract(fungibleAbi as any, address, {from: caller, ...GAS_ARGS}), privateKeyWrapper); - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Ethereum: contract.options.address}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const evmCollection = helper.ethNativeContract.collection(address, 'ft', caller); + const contract = await proxyWrap(helper, evmCollection, donor); + await collection.mint(alice, 200n, {Ethereum: contract.options.address}); { const result = await contract.methods.transfer(receiver, 50).send({from: caller}); From c50b56fb58ccfc094a388a15f58ea6ab50cba1e4 Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 28 Sep 2022 17:18:33 +0300 Subject: [PATCH 0971/1274] eth/proxy/nonFungibleProxy migrated --- tests/src/eth/proxy/nonFungibleProxy.test.ts | 189 +++++++++---------- 1 file changed, 94 insertions(+), 95 deletions(-) diff --git a/tests/src/eth/proxy/nonFungibleProxy.test.ts b/tests/src/eth/proxy/nonFungibleProxy.test.ts index 428e9a76de..cc3d8cc88d 100644 --- a/tests/src/eth/proxy/nonFungibleProxy.test.ts +++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts @@ -14,20 +14,16 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {createCollectionExpectSuccess, createItemExpectSuccess} from '../../util/helpers'; -import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents} from '../util/helpers'; -import nonFungibleAbi from '../nonFungibleAbi.json'; +import {GAS_ARGS, itWeb3, normalizeEvents} from '../util/helpers'; import {expect} from 'chai'; -import {submitTransactionAsync} from '../../substrate/substrate-api'; -import Web3 from 'web3'; import {readFile} from 'fs/promises'; -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; +import {EthUniqueHelper, itEth, usingEthPlaygrounds} from '../util/playgrounds'; -async function proxyWrap(api: ApiPromise, web3: Web3, wrapped: any, privateKeyWrapper: (account: string) => IKeyringPair) { +async function proxyWrap(helper: EthUniqueHelper, wrapped: any, donor: IKeyringPair) { // Proxy owner has no special privilegies, we don't need to reuse them - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const proxyContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/UniqueNFTProxy.abi`)).toString()), undefined, { + const owner = await helper.eth.createAccountWithBalance(donor); + const proxyContract = new helper.web3!.eth.Contract(JSON.parse((await readFile(`${__dirname}/UniqueNFTProxy.abi`)).toString()), undefined, { from: owner, ...GAS_ARGS, }); @@ -36,51 +32,56 @@ async function proxyWrap(api: ApiPromise, web3: Web3, wrapped: any, privateKeyWr } describe('NFT (Via EVM proxy): Information getting', () => { - itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, + let alice: IKeyringPair; + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); }); - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + }); - await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: alice.address}); + itEth('totalSupply', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const caller = await helper.eth.createAccountWithBalance(donor); + await collection.mintToken(alice, {Substrate: alice.address}); - const address = collectionIdToAddress(collection); - const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}), privateKeyWrapper); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller); + const contract = await proxyWrap(helper, evmCollection, donor); const totalSupply = await contract.methods.totalSupply().call(); expect(totalSupply).to.equal('1'); }); - itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); + itEth('balanceOf', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: caller}); - await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: caller}); - await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: caller}); + const caller = await helper.eth.createAccountWithBalance(donor); + await collection.mintMultipleTokens(alice, [ + {owner: {Ethereum: caller}}, + {owner: {Ethereum: caller}}, + {owner: {Ethereum: caller}}, + ]); - const address = collectionIdToAddress(collection); - const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}), privateKeyWrapper); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller); + const contract = await proxyWrap(helper, evmCollection, donor); const balance = await contract.methods.balanceOf(caller).call(); expect(balance).to.equal('3'); }); - itWeb3('ownerOf', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); + itEth('ownerOf', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: caller}); + const caller = await helper.eth.createAccountWithBalance(donor); + const {tokenId} = await collection.mintToken(alice, {Ethereum: caller}); - const address = collectionIdToAddress(collection); - const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}), privateKeyWrapper); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller); + const contract = await proxyWrap(helper, evmCollection, donor); const owner = await contract.methods.ownerOf(tokenId).call(); expect(owner).to.equal(caller); @@ -88,18 +89,25 @@ describe('NFT (Via EVM proxy): Information getting', () => { }); describe('NFT (Via EVM proxy): Plain calls', () => { - itWeb3('Can perform mint()', async ({web3, api, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'A', 'A') - .send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const receiver = createEthAccount(web3); - const collectionEvmOwned = evmCollection(web3, owner, collectionIdAddress); - const collectionEvm = evmCollection(web3, caller, collectionIdAddress); - const contract = await proxyWrap(api, web3, collectionEvm, privateKeyWrapper); + let alice: IKeyringPair; + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([10n], donor); + }); + }); + + itEth('Can perform mint()', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'A', 'A'); + const caller = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + + const collectionEvmOwned = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', caller); + const contract = await proxyWrap(helper, collectionEvm, donor); await collectionEvmOwned.methods.addCollectionAdmin(contract.options.address).send(); { @@ -115,7 +123,7 @@ describe('NFT (Via EVM proxy): Plain calls', () => { expect(events).to.be.deep.equal([ { - address: collectionIdAddress.toLocaleLowerCase(), + address: collectionAddress.toLocaleLowerCase(), event: 'Transfer', args: { from: '0x0000000000000000000000000000000000000000', @@ -128,9 +136,10 @@ describe('NFT (Via EVM proxy): Plain calls', () => { expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); } }); - + //TODO: CORE-302 add eth methods itWeb3.skip('Can perform mintBulk()', async ({web3, api, privateKeyWrapper}) => { + /* const collection = await createCollectionExpectSuccess({ mode: {type: 'NFT'}, }); @@ -191,21 +200,18 @@ describe('NFT (Via EVM proxy): Plain calls', () => { expect(await contract.methods.tokenURI(+nextTokenId + 1).call()).to.be.equal('Test URI 1'); expect(await contract.methods.tokenURI(+nextTokenId + 2).call()).to.be.equal('Test URI 2'); } + */ }); - itWeb3('Can perform burn()', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('Can perform burn()', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const caller = await helper.eth.createAccountWithBalance(donor); - const address = collectionIdToAddress(collection); - const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}), privateKeyWrapper); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: contract.options.address}); - - const changeAdminTx = api.tx.unique.addCollectionAdmin(collection, {Ethereum: contract.options.address}); - await submitTransactionAsync(alice, changeAdminTx); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller); + const contract = await proxyWrap(helper, evmCollection, donor); + const {tokenId} = await collection.mintToken(alice, {Ethereum: contract.options.address}); + await collection.addAdmin(alice, {Ethereum: contract.options.address}); { const result = await contract.methods.burn(tokenId).send({from: caller}); @@ -225,17 +231,15 @@ describe('NFT (Via EVM proxy): Plain calls', () => { } }); - itWeb3('Can perform approve()', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const spender = createEthAccount(web3); + itEth('Can perform approve()', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const caller = await helper.eth.createAccountWithBalance(donor); + const spender = helper.eth.createAccount(); - const address = collectionIdToAddress(collection); - const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address), privateKeyWrapper); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: contract.options.address}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller); + const contract = await proxyWrap(helper, evmCollection, donor); + const {tokenId} = await collection.mintToken(alice, {Ethereum: contract.options.address}); { const result = await contract.methods.approve(spender, tokenId).send({from: caller, ...GAS_ARGS}); @@ -255,20 +259,17 @@ describe('NFT (Via EVM proxy): Plain calls', () => { } }); - itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('Can perform transferFrom()', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const caller = await helper.eth.createAccountWithBalance(donor); + const owner = await helper.eth.createAccountWithBalance(donor); - const receiver = createEthAccount(web3); + const receiver = helper.eth.createAccount(); - const address = collectionIdToAddress(collection); - const evmCollection = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); - const contract = await proxyWrap(api, web3, evmCollection, privateKeyWrapper); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: owner}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller); + const contract = await proxyWrap(helper, evmCollection, donor); + const {tokenId} = await collection.mintToken(alice, {Ethereum: owner}); await evmCollection.methods.approve(contract.options.address, tokenId).send({from: owner}); @@ -299,17 +300,15 @@ describe('NFT (Via EVM proxy): Plain calls', () => { } }); - itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const receiver = createEthAccount(web3); + itEth('Can perform transfer()', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const caller = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); - const address = collectionIdToAddress(collection); - const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}), privateKeyWrapper); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: contract.options.address}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller); + const contract = await proxyWrap(helper, evmCollection, donor); + const {tokenId} = await collection.mintToken(alice, {Ethereum: contract.options.address}); { const result = await contract.methods.transfer(receiver, tokenId).send({from: caller}); From 9cb826388a256b50d4796b8ea047b864ff0501e1 Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 28 Sep 2022 17:19:10 +0300 Subject: [PATCH 0972/1274] wip: collectionAdmin to be fixed --- tests/src/eth/collectionAdmin.test.ts | 333 +++++++++++--------------- 1 file changed, 138 insertions(+), 195 deletions(-) diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index dda531d368..1a1537e166 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -14,15 +14,8 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import privateKey from '../substrate/privateKey'; import {UNIQUE} from '../util/helpers'; import { - createEthAccount, - createEthAccountWithBalance, - evmCollection, - evmCollectionHelpers, - getCollectionAddressFromResult, - itWeb3, recordEthFee, } from './util/helpers'; import {usingEthPlaygrounds, itEth, expect} from './util/playgrounds'; @@ -62,176 +55,146 @@ describe('Add collection admins', () => { .to.be.eq(newAdmin.address.toLocaleLowerCase()); }); - itWeb3('Verify owner or admin', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); + //FIXME: + itEth('Verify owner or admin', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const newAdmin = createEthAccount(web3); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const newAdmin = helper.eth.createAccount(); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); expect(await collectionEvm.methods.isOwnerOrAdmin(newAdmin).call()).to.be.false; await collectionEvm.methods.addCollectionAdmin(newAdmin).send(); expect(await collectionEvm.methods.isOwnerOrAdmin(newAdmin).call()).to.be.true; }); - itWeb3('(!negative tests!) Add admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + itEth('(!negative tests!) Add admin by ADMIN is not allowed', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const admin = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const admin = await helper.eth.createAccountWithBalance(donor); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await collectionEvm.methods.addCollectionAdmin(admin).send(); - const user = createEthAccount(web3); + const user = helper.eth.createAccount(); await expect(collectionEvm.methods.addCollectionAdmin(user).call({from: admin})) .to.be.rejectedWith('NoPermission'); - const adminList = await api.rpc.unique.adminlist(collectionId); + const adminList = await helper.api!.rpc.unique.adminlist(collectionId); expect(adminList.length).to.be.eq(1); expect(adminList[0].asEthereum.toString().toLocaleLowerCase()) .to.be.eq(admin.toLocaleLowerCase()); }); - itWeb3('(!negative tests!) Add admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + itEth('(!negative tests!) Add admin by USER is not allowed', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const notAdmin = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const notAdmin = await helper.eth.createAccountWithBalance(donor); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - const user = createEthAccount(web3); + const user = helper.eth.createAccount(); await expect(collectionEvm.methods.addCollectionAdmin(user).call({from: notAdmin})) .to.be.rejectedWith('NoPermission'); - const adminList = await api.rpc.unique.adminlist(collectionId); + const adminList = await helper.api!.rpc.unique.adminlist(collectionId); expect(adminList.length).to.be.eq(0); }); - itWeb3('(!negative tests!) Add substrate admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + itEth('(!negative tests!) Add substrate admin by ADMIN is not allowed', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const admin = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const admin = await helper.eth.createAccountWithBalance(donor); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await collectionEvm.methods.addCollectionAdmin(admin).send(); - const notAdmin = privateKey('//Alice'); + const [notAdmin] = await helper.arrange.createAccounts([10n], donor); await expect(collectionEvm.methods.addCollectionAdminSubstrate(notAdmin.addressRaw).call({from: admin})) .to.be.rejectedWith('NoPermission'); - const adminList = await api.rpc.unique.adminlist(collectionId); + const adminList = await helper.api!.rpc.unique.adminlist(collectionId); expect(adminList.length).to.be.eq(1); expect(adminList[0].asEthereum.toString().toLocaleLowerCase()) .to.be.eq(admin.toLocaleLowerCase()); }); - itWeb3('(!negative tests!) Add substrate admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + itEth('(!negative tests!) Add substrate admin by USER is not allowed', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const notAdmin0 = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - const notAdmin1 = privateKey('//Alice'); + const notAdmin0 = await helper.eth.createAccountWithBalance(donor); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + const [notAdmin1] = await helper.arrange.createAccounts([10n], donor); await expect(collectionEvm.methods.addCollectionAdminSubstrate(notAdmin1.addressRaw).call({from: notAdmin0})) .to.be.rejectedWith('NoPermission'); - const adminList = await api.rpc.unique.adminlist(collectionId); + const adminList = await helper.api!.rpc.unique.adminlist(collectionId); expect(adminList.length).to.be.eq(0); }); }); describe('Remove collection admins', () => { - itWeb3('Remove admin by owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + itEth('Remove admin by owner', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const newAdmin = createEthAccount(web3); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const newAdmin = helper.eth.createAccount(); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await collectionEvm.methods.addCollectionAdmin(newAdmin).send(); + { - const adminList = await api.rpc.unique.adminlist(collectionId); + const adminList = await helper.api!.rpc.unique.adminlist(collectionId); expect(adminList.length).to.be.eq(1); expect(adminList[0].asEthereum.toString().toLocaleLowerCase()) .to.be.eq(newAdmin.toLocaleLowerCase()); } await collectionEvm.methods.removeCollectionAdmin(newAdmin).send(); - const adminList = await api.rpc.unique.adminlist(collectionId); + const adminList = await helper.api!.rpc.unique.adminlist(collectionId); expect(adminList.length).to.be.eq(0); }); - itWeb3('Remove substrate admin by owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + itEth('Remove substrate admin by owner', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const newAdmin = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const [newAdmin] = await helper.arrange.createAccounts([10n], donor); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send(); { - const adminList = await api.rpc.unique.adminlist(collectionId); + const adminList = await helper.api!.rpc.unique.adminlist(collectionId); expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) .to.be.eq(newAdmin.address.toLocaleLowerCase()); } await collectionEvm.methods.removeCollectionAdminSubstrate(newAdmin.addressRaw).send(); - const adminList = await api.rpc.unique.adminlist(collectionId); + const adminList = await helper.api!.rpc.unique.adminlist(collectionId); expect(adminList.length).to.be.eq(0); }); - itWeb3('(!negative tests!) Remove admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + itEth('(!negative tests!) Remove admin by ADMIN is not allowed', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - const admin0 = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const admin0 = await helper.eth.createAccountWithBalance(donor); await collectionEvm.methods.addCollectionAdmin(admin0).send(); - const admin1 = createEthAccount(web3); + const admin1 = await helper.eth.createAccountWithBalance(donor); await collectionEvm.methods.addCollectionAdmin(admin1).send(); await expect(collectionEvm.methods.removeCollectionAdmin(admin1).call({from: admin0})) .to.be.rejectedWith('NoPermission'); { - const adminList = await api.rpc.unique.adminlist(collectionId); + const adminList = await helper.api!.rpc.unique.adminlist(collectionId); expect(adminList.length).to.be.eq(2); expect(adminList.toString().toLocaleLowerCase()) .to.be.deep.contains(admin0.toLocaleLowerCase()) @@ -239,74 +202,59 @@ describe('Remove collection admins', () => { } }); - itWeb3('(!negative tests!) Remove admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + itEth('(!negative tests!) Remove admin by USER is not allowed', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - const admin = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const admin = await helper.eth.createAccountWithBalance(donor); await collectionEvm.methods.addCollectionAdmin(admin).send(); - const notAdmin = createEthAccount(web3); + const notAdmin = helper.eth.createAccount(); await expect(collectionEvm.methods.removeCollectionAdmin(admin).call({from: notAdmin})) .to.be.rejectedWith('NoPermission'); { - const adminList = await api.rpc.unique.adminlist(collectionId); + const adminList = await helper.api!.rpc.unique.adminlist(collectionId); expect(adminList[0].asEthereum.toString().toLocaleLowerCase()) .to.be.eq(admin.toLocaleLowerCase()); expect(adminList.length).to.be.eq(1); } }); - itWeb3('(!negative tests!) Remove substrate admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + itEth('(!negative tests!) Remove substrate admin by ADMIN is not allowed', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const adminSub = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const [adminSub] = await helper.arrange.createAccounts([10n], donor); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send(); - const adminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const adminEth = await helper.eth.createAccountWithBalance(donor); await collectionEvm.methods.addCollectionAdmin(adminEth).send(); await expect(collectionEvm.methods.removeCollectionAdminSubstrate(adminSub.addressRaw).call({from: adminEth})) .to.be.rejectedWith('NoPermission'); - const adminList = await api.rpc.unique.adminlist(collectionId); + const adminList = await helper.api!.rpc.unique.adminlist(collectionId); expect(adminList.length).to.be.eq(2); expect(adminList.toString().toLocaleLowerCase()) .to.be.deep.contains(adminSub.address.toLocaleLowerCase()) .to.be.deep.contains(adminEth.toLocaleLowerCase()); }); - itWeb3('(!negative tests!) Remove substrate admin by USER is not allowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + itEth('(!negative tests!) Remove substrate admin by USER is not allowed', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); - const adminSub = privateKeyWrapper('//Alice'); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + const [adminSub] = await helper.arrange.createAccounts([10n], donor); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await collectionEvm.methods.addCollectionAdminSubstrate(adminSub.addressRaw).send(); - const notAdminEth = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const notAdminEth = await helper.eth.createAccountWithBalance(donor); await expect(collectionEvm.methods.removeCollectionAdminSubstrate(adminSub.addressRaw).call({from: notAdminEth})) .to.be.rejectedWith('NoPermission'); - const adminList = await api.rpc.unique.adminlist(collectionId); + const adminList = await helper.api!.rpc.unique.adminlist(collectionId); expect(adminList.length).to.be.eq(1); expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) .to.be.eq(adminSub.address.toLocaleLowerCase()); @@ -314,15 +262,19 @@ describe('Remove collection admins', () => { }); describe('Change owner tests', () => { - itWeb3('Change owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const newOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); + + itEth('Change owner', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const newOwner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await collectionEvm.methods.setOwner(newOwner).send(); @@ -330,30 +282,23 @@ describe('Change owner tests', () => { expect(await collectionEvm.methods.isOwnerOrAdmin(newOwner).call()).to.be.true; }); - itWeb3('change owner call fee', async ({web3, api, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const newOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - - const cost = await recordEthFee(api, owner, () => collectionEvm.methods.setOwner(newOwner).send()); + itEth('change owner call fee', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const newOwner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + + const cost = await recordEthFee(helper.api!, owner, () => collectionEvm.methods.setOwner(newOwner).send()); expect(cost < BigInt(0.2 * Number(UNIQUE))); expect(cost > 0); }); - itWeb3('(!negative tests!) call setOwner by non owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const newOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + //FIXME + itEth('(!negative tests!) call setOwner by non owner', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const newOwner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await expect(collectionEvm.methods.setOwner(newOwner).send({from: newOwner})).to.be.rejected; expect(await collectionEvm.methods.isOwnerOrAdmin(newOwner).call()).to.be.false; @@ -361,15 +306,20 @@ describe('Change owner tests', () => { }); describe('Change substrate owner tests', () => { - itWeb3('Change owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const newOwner = privateKeyWrapper('//Alice'); - const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); + + //FIXME + itEth('Change owner', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const [newOwner] = await helper.arrange.createAccounts([10n], donor); + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.true; expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; @@ -380,31 +330,24 @@ describe('Change substrate owner tests', () => { expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.true; }); - itWeb3('change owner call fee', async ({web3, api, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const newOwner = privateKeyWrapper('//Alice'); - const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - - const cost = await recordEthFee(api, owner, () => collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send()); + itEth('change owner call fee', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const [newOwner] = await helper.arrange.createAccounts([10n], donor); + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + + const cost = await recordEthFee(helper.api!, owner, () => collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send()); expect(cost < BigInt(0.2 * Number(UNIQUE))); expect(cost > 0); }); - itWeb3('(!negative tests!) call setOwner by non owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const otherReceiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const newOwner = privateKeyWrapper('//Alice'); - const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + //FIXME + itEth('(!negative tests!) call setOwner by non owner', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const otherReceiver = await helper.eth.createAccountWithBalance(donor); + const [newOwner] = await helper.arrange.createAccounts([10n], donor); + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await expect(collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send({from: otherReceiver})).to.be.rejected; expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false; From 0d65400dcfd0bea650af1b9fe5abfd73d9cea41e Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 5 Sep 2022 15:28:15 +0700 Subject: [PATCH 0973/1274] add separate workflow for testnet-build --- .docker/Dockerfile-testnet.j2 | 77 +++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .docker/Dockerfile-testnet.j2 diff --git a/.docker/Dockerfile-testnet.j2 b/.docker/Dockerfile-testnet.j2 new file mode 100644 index 0000000000..126df0d6cc --- /dev/null +++ b/.docker/Dockerfile-testnet.j2 @@ -0,0 +1,77 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install {{ RUST_TOOLCHAIN }} && \ + rustup default {{ RUST_TOOLCHAIN }} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD ====== +FROM rust-builder as builder-unique + +ARG PROFILE=release + +WORKDIR /unique_parachain + +COPY ../launch-config.yml ./launch-config.yml + +RUN git clone -b {{ BRANCH }} https://github.com/UniqueNetwork/unique-chain.git && \ + cd unique-chain && \ + cargo build --features={{ FEATURE }} --$PROFILE + +# ===== RUN ====== + +FROM ubuntu:20.04 + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b {{ POLKADOT_LAUNCH_BRANCH }} + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn install + +COPY --from=builder-unique /unique_parachain/launch-config.yml /polkadot-launch/launch-config.yml +COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ + +COPY --from=uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ + +EXPOSE 9844 +EXPOSE 9944 +EXPOSE 9933 +EXPOSE 9833 +EXPOSE 40333 +EXPOSE 30333 + +CMD export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start launch-config.json + + From 0d1126efc1dbf8ad6a946f874c5720e1e1852aec Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 5 Sep 2022 15:31:03 +0700 Subject: [PATCH 0974/1274] add separate workflow for testnet-build --- .github/workflows/testnet-build.yml | 144 ++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 .github/workflows/testnet-build.yml diff --git a/.github/workflows/testnet-build.yml b/.github/workflows/testnet-build.yml new file mode 100644 index 0000000000..154a173141 --- /dev/null +++ b/.github/workflows/testnet-build.yml @@ -0,0 +1,144 @@ +name: testnet-build + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: + - master + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + - ready_for_review + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +#Define Workflow variables +env: + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + prepare-execution-marix: + + name: Prepare execution matrix + + runs-on: [self-hosted-ci,medium] + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: fabiocaccamo/create-matrix-action@v2 + id: create_matrix + with: + matrix: | + network {opal}, runtime {opal}, features {opal-runtime} + network {quartz}, runtime {quartz}, features {quartz-runtime} + network {unique}, runtime {unique}, features {unique-runtime} + + testnet-build: + needs: prepare-execution-marix + # The type of runner that the job will run on + runs-on: [self-hosted-ci,medium] + + timeout-minutes: 600 + + name: ${{ matrix.network }} + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} + + steps: + - name: Skip if pull request is in Draft + if: github.event.pull_request.draft == true + run: exit 1 + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-testnet.j2 + output_file: .docker/Dockerfile-testnet.${{ matrix.network }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + NETWORK=${{ matrix.network }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }} + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + BRANCH=${{ github.head_ref }} + + - name: Show build configuration + run: cat .docker/Dockerfile-testnet.${{ matrix.network }}.yml + + - name: Show launch-config configuration + run: cat launch-config.json + + - name: Run find-and-replace to remove slashes from branch name + uses: mad9000/actions-find-and-replace-string@2 + id: branchname + with: + source: ${{ github.head_ref }} + find: '/' + replace: '-' + + - name: Log in to Docker Hub + uses: docker/login-action@v2.0.0 + with: + username: ${{ secrets.CORE_DOCKERHUB_USERNAME }} + password: ${{ secrets.CORE_DOCKERHUB_TOKEN }} + + - name: Pull polkadot docker image + run: docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} + + - name: Build the stack + run: cd .docker/ && docker build --file ./Dockerfile-testnet.${{ matrix.network }}.yml --tag uniquenetwork/${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/${{ matrix.network }}-testnet-local::latest . + + - name: Push docker version image + run: docker push uniquenetwork/${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} + + - name: Push docker latest image + run: docker push uniquenetwork/${{ matrix.network }}-testnet-local:latest + + - name: Clean Workspace + if: always() + uses: AutoModality/action-clean@v1.1.0 + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f + docker system prune -f From baf5f0d83501721173965e3824c39b82996a3308 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 5 Sep 2022 15:54:37 +0700 Subject: [PATCH 0975/1274] add separate workflow for testnet-build --- .github/workflows/testnet-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testnet-build.yml b/.github/workflows/testnet-build.yml index 154a173141..4c4d6a640a 100644 --- a/.github/workflows/testnet-build.yml +++ b/.github/workflows/testnet-build.yml @@ -72,9 +72,9 @@ jobs: include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}} steps: - - name: Skip if pull request is in Draft - if: github.event.pull_request.draft == true - run: exit 1 + - name: Skip if pull request is in Draft + if: github.event.pull_request.draft == true + run: exit 1 - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 From f3ac9f95f00cbbd08524d4d000281b244ea29196 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 5 Sep 2022 15:56:41 +0700 Subject: [PATCH 0976/1274] add separate workflow for testnet-build --- .github/workflows/testnet-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testnet-build.yml b/.github/workflows/testnet-build.yml index 4c4d6a640a..7ffd44f64f 100644 --- a/.github/workflows/testnet-build.yml +++ b/.github/workflows/testnet-build.yml @@ -125,7 +125,7 @@ jobs: run: docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} - name: Build the stack - run: cd .docker/ && docker build --file ./Dockerfile-testnet.${{ matrix.network }}.yml --tag uniquenetwork/${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/${{ matrix.network }}-testnet-local::latest . + run: cd .docker/ && docker build --file ./Dockerfile-testnet.${{ matrix.network }}.yml --tag uniquenetwork/${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/${{ matrix.network }}-testnet-local:latest . - name: Push docker version image run: docker push uniquenetwork/${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} From accde6ff13692f560bc5a10eca644836c244b0f5 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 6 Sep 2022 22:31:56 +0700 Subject: [PATCH 0977/1274] add launch-config for testnet build --- .docker/Dockerfile-testnet.j2 | 2 +- .docker/testnet-config/launch-config.json | 121 ++++++++++++++++++++++ 2 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 .docker/testnet-config/launch-config.json diff --git a/.docker/Dockerfile-testnet.j2 b/.docker/Dockerfile-testnet.j2 index 126df0d6cc..0a833c3dc7 100644 --- a/.docker/Dockerfile-testnet.j2 +++ b/.docker/Dockerfile-testnet.j2 @@ -57,7 +57,7 @@ RUN export NVM_DIR="$HOME/.nvm" && \ npm install --global yarn && \ yarn install -COPY --from=builder-unique /unique_parachain/launch-config.yml /polkadot-launch/launch-config.yml +COPY --from=builder-unique /unique_parachain/.docker/testnet-config/launch-config.yml /polkadot-launch/launch-config.yml COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ COPY --from=uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ diff --git a/.docker/testnet-config/launch-config.json b/.docker/testnet-config/launch-config.json new file mode 100644 index 0000000000..9709a36df6 --- /dev/null +++ b/.docker/testnet-config/launch-config.json @@ -0,0 +1,121 @@ +{ + "relaychain": { + "bin": "/polkadot/target/release/polkadot", + "chain": "rococo-local", + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "/unique-chain/target/release/unique-collator", + "id": "1000", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace" + ] + }, + { + "port": 31201, + "wsPort": 9945, + "rpcPort": 9934, + "name": "bob", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [], + "finalization": false +} From ed558603a25ea9a1d11d1a0d42881bc024c8794f Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 6 Sep 2022 22:38:42 +0700 Subject: [PATCH 0978/1274] fix Dockerfile for testnet --- .docker/Dockerfile-testnet.j2 | 2 -- 1 file changed, 2 deletions(-) diff --git a/.docker/Dockerfile-testnet.j2 b/.docker/Dockerfile-testnet.j2 index 0a833c3dc7..22eb175719 100644 --- a/.docker/Dockerfile-testnet.j2 +++ b/.docker/Dockerfile-testnet.j2 @@ -31,8 +31,6 @@ ARG PROFILE=release WORKDIR /unique_parachain -COPY ../launch-config.yml ./launch-config.yml - RUN git clone -b {{ BRANCH }} https://github.com/UniqueNetwork/unique-chain.git && \ cd unique-chain && \ cargo build --features={{ FEATURE }} --$PROFILE From 55cce01b8b72fb209b270c736575f8830ac92a48 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 6 Sep 2022 23:46:12 +0700 Subject: [PATCH 0979/1274] fix dockerfile for testnet --- .docker/Dockerfile-testnet.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile-testnet.j2 b/.docker/Dockerfile-testnet.j2 index 22eb175719..3c54fed4bd 100644 --- a/.docker/Dockerfile-testnet.j2 +++ b/.docker/Dockerfile-testnet.j2 @@ -55,7 +55,7 @@ RUN export NVM_DIR="$HOME/.nvm" && \ npm install --global yarn && \ yarn install -COPY --from=builder-unique /unique_parachain/.docker/testnet-config/launch-config.yml /polkadot-launch/launch-config.yml +COPY --from=builder-unique /unique_parachain/unique-chain/.docker/testnet-config/launch-config.yml /polkadot-launch/launch-config.yml COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ COPY --from=uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ From cd39996a961e0fbbacd3868194d56743f230f0fe Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 8 Sep 2022 00:01:14 +0700 Subject: [PATCH 0980/1274] fix Dockerfile for testnet build --- .docker/Dockerfile-testnet.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.docker/Dockerfile-testnet.j2 b/.docker/Dockerfile-testnet.j2 index 3c54fed4bd..594e882b9a 100644 --- a/.docker/Dockerfile-testnet.j2 +++ b/.docker/Dockerfile-testnet.j2 @@ -55,7 +55,7 @@ RUN export NVM_DIR="$HOME/.nvm" && \ npm install --global yarn && \ yarn install -COPY --from=builder-unique /unique_parachain/unique-chain/.docker/testnet-config/launch-config.yml /polkadot-launch/launch-config.yml +COPY --from=builder-unique /unique_parachain/unique-chain/.docker/testnet-config/launch-config.json /polkadot-launch/launch-config.json COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ COPY --from=uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ @@ -72,4 +72,4 @@ CMD export NVM_DIR="$HOME/.nvm" && \ cd /polkadot-launch && \ yarn start launch-config.json - + \ No newline at end of file From 6b0c03191275e1ee66cccb9fd2c325cb67573507 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Wed, 28 Sep 2022 21:52:52 +0700 Subject: [PATCH 0981/1274] fix unit tests Dockerfile --- .docker/Dockerfile-chain-dev-unit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile-chain-dev-unit b/.docker/Dockerfile-chain-dev-unit index 96f307d2a5..7cacee5c5c 100644 --- a/.docker/Dockerfile-chain-dev-unit +++ b/.docker/Dockerfile-chain-dev-unit @@ -23,4 +23,4 @@ COPY . /dev_chain WORKDIR /dev_chain -CMD cargo test --features=limit-testing +CMD cargo test --features=limit-testing --workspace From 62959b25e377c7d5151222c663a6061c9b09d226 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Thu, 29 Sep 2022 17:34:51 +0700 Subject: [PATCH 0982/1274] add `calculateFee` and `callEVM` methods to playgrounds --- tests/src/eth/payable.test.ts | 2 +- tests/src/eth/util/playgrounds/unique.dev.ts | 11 ++++++++--- tests/src/util/playgrounds/unique.dev.ts | 12 ++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/tests/src/eth/payable.test.ts b/tests/src/eth/payable.test.ts index 01f264b417..a4815ce0cb 100644 --- a/tests/src/eth/payable.test.ts +++ b/tests/src/eth/payable.test.ts @@ -50,7 +50,7 @@ describe('EVM payable contracts', () => { await helper.eth.transferBalanceFromSubstrate(alice, helper.address.substrateToEth(alice.address), 5n); - await helper.eth.callEVM(alice, contract.options.address, contract.methods.giveMoney().encodeABI(), weiCount); + await helper.eth.sendEVM(alice, contract.options.address, contract.methods.giveMoney().encodeABI(), weiCount); expect(await contract.methods.getCollected().call()).to.be.equal(weiCount); }); diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index abe3635060..7c32ba3814 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -27,6 +27,7 @@ import nonFungibleAbi from '../../nonFungibleAbi.json'; import refungibleAbi from '../../reFungibleAbi.json'; import refungibleTokenAbi from '../../reFungibleTokenAbi.json'; import contractHelpersAbi from './../contractHelpersAbi.json'; +import {TEthereumAccount} from '../../../util/playgrounds/types'; class EthGroupBase { helper: EthUniqueHelper; @@ -43,13 +44,13 @@ class ContractGroup extends EthGroupBase { return {error: `File not found: ${path}`}; }; - const knownImports = {} as any; + const knownImports = {} as {[key: string]: string}; for(const imp of imports) { knownImports[imp.solPath] = (await readFile(imp.fsPath)).toString(); } return function(path: string) { - if(knownImports.hasOwnPropertyDescriptor(path)) return {contents: knownImports[path]}; + if(path in knownImports) return {contents: knownImports[path]}; return {error: `File not found: ${path}`}; }; } @@ -148,7 +149,7 @@ class EthGroup extends EthGroupBase { return await this.helper.balance.transferToSubstrate(donor, evmToAddress(recepient), amount * (inTokens ? this.helper.balance.getOneTokenNominal() : 1n)); } - async callEVM(signer: IKeyringPair, contractAddress: string, abi: any, value: string, gasLimit?: number) { + async sendEVM(signer: IKeyringPair, contractAddress: string, abi: string, value: string, gasLimit?: number) { if(!gasLimit) gasLimit = this.DEFAULT_GAS; const web3 = this.helper.getWeb3(); const gasPrice = await web3.eth.getGasPrice(); @@ -159,6 +160,10 @@ class EthGroup extends EthGroupBase { true, ); } + + async callEVM(signer: TEthereumAccount, contractAddress: string, abi: string) { + return await this.helper.callRpc('api.rpc.eth.call', [{from: signer, to: contractAddress, data: abi}]); + } async createNonfungibleCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{collectionId: number, collectionAddress: string}> { const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 5a7786ee1e..47c1c8bd24 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -6,6 +6,7 @@ import {UniqueHelper} from './unique'; import {ApiPromise, WsProvider} from '@polkadot/api'; import * as defs from '../../interfaces/definitions'; import {IKeyringPair} from '@polkadot/types/types'; +import {ICrossAccountId} from './types'; export class SilentLogger { @@ -230,6 +231,17 @@ class ArrangeGroup { const block2date = await findCreationDate(block2); if(block2date! - block1date! < 9000) return true; }; + + async calculcateFee(payer: ICrossAccountId, promise: () => Promise): Promise { + const address = payer.Substrate ? payer.Substrate : await this.helper.address.ethToSubstrate(payer.Ethereum!); + let balance = await this.helper.balance.getSubstrate(address); + + await promise(); + + balance -= await this.helper.balance.getSubstrate(address); + + return balance; + } } class WaitGroup { From 629591d9aa58aab312c5d7e80a51e3f58f2a2149 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 26 Sep 2022 09:11:06 +0000 Subject: [PATCH 0983/1274] fix: use option vec for properties rpc --- tests/src/interfaces/unique/definitions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/interfaces/unique/definitions.ts b/tests/src/interfaces/unique/definitions.ts index 29daa4c791..303e5d2813 100644 --- a/tests/src/interfaces/unique/definitions.ts +++ b/tests/src/interfaces/unique/definitions.ts @@ -24,7 +24,7 @@ const CROSS_ACCOUNT_ID_TYPE = 'PalletEvmAccountBasicCrossAccountIdRepr'; const collectionParam = {name: 'collection', type: 'u32'}; const tokenParam = {name: 'tokenId', type: 'u32'}; -const propertyKeysParam = {name: 'propertyKeys', type: 'Vec', isOptional: true}; +const propertyKeysParam = {name: 'propertyKeys', type: 'Option>', isOptional: true}; const crossAccountParam = (name = 'account') => ({name, type: CROSS_ACCOUNT_ID_TYPE}); const atParam = {name: 'at', type: 'Hash', isOptional: true}; From e899eeedd0beef71de47352b44c2f8e8933b7d56 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 26 Sep 2022 09:11:20 +0000 Subject: [PATCH 0984/1274] chore: regenerate types --- tests/src/interfaces/augment-api-rpc.ts | 8 ++++---- tests/src/interfaces/augment-types.ts | 3 ++- tests/src/interfaces/default/types.ts | 3 +++ tests/src/interfaces/lookup.ts | 16 ++++++++++------ tests/src/interfaces/registry.ts | 3 ++- tests/src/interfaces/types-lookup.ts | 15 +++++++++------ 6 files changed, 30 insertions(+), 18 deletions(-) diff --git a/tests/src/interfaces/augment-api-rpc.ts b/tests/src/interfaces/augment-api-rpc.ts index bbcff3420f..713d02450f 100644 --- a/tests/src/interfaces/augment-api-rpc.ts +++ b/tests/src/interfaces/augment-api-rpc.ts @@ -695,7 +695,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Get collection properties, optionally limited to the provided keys **/ - collectionProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec | (Text | string)[], at?: Hash | string | Uint8Array) => Observable>>; + collectionProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Option> | null | Uint8Array | Vec | (Text | string)[], at?: Hash | string | Uint8Array) => Observable>>; /** * Get chain stats about collections **/ @@ -723,7 +723,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Get property permissions, optionally limited to the provided keys **/ - propertyPermissions: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec | (Text | string)[], at?: Hash | string | Uint8Array) => Observable>>; + propertyPermissions: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, propertyKeys?: Option> | null | Uint8Array | Vec | (Text | string)[], at?: Hash | string | Uint8Array) => Observable>>; /** * Get tokens nested directly into the token **/ @@ -731,7 +731,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Get token data, including properties, optionally limited to the provided keys, and total pieces for an RFT **/ - tokenData: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec | (Text | string)[], at?: Hash | string | Uint8Array) => Observable>; + tokenData: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Option> | null | Uint8Array | Vec | (Text | string)[], at?: Hash | string | Uint8Array) => Observable>; /** * Check if the token exists **/ @@ -747,7 +747,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { /** * Get token properties, optionally limited to the provided keys **/ - tokenProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Vec | (Text | string)[], at?: Hash | string | Uint8Array) => Observable>>; + tokenProperties: AugmentedRpc<(collection: u32 | AnyNumber | Uint8Array, tokenId: u32 | AnyNumber | Uint8Array, propertyKeys?: Option> | null | Uint8Array | Vec | (Text | string)[], at?: Hash | string | Uint8Array) => Observable>>; /** * Get the topmost token owner in the hierarchy of a possibly nested token **/ diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index fc21f21948..cdb52b3aa1 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; @@ -535,6 +535,7 @@ declare module '@polkadot/types/types/registry' { FrameSystemExtensionsCheckGenesis: FrameSystemExtensionsCheckGenesis; FrameSystemExtensionsCheckNonce: FrameSystemExtensionsCheckNonce; FrameSystemExtensionsCheckSpecVersion: FrameSystemExtensionsCheckSpecVersion; + FrameSystemExtensionsCheckTxVersion: FrameSystemExtensionsCheckTxVersion; FrameSystemExtensionsCheckWeight: FrameSystemExtensionsCheckWeight; FrameSystemLastRuntimeUpgradeInfo: FrameSystemLastRuntimeUpgradeInfo; FrameSystemLimitsBlockLength: FrameSystemLimitsBlockLength; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 38f5af1a5e..b0c254d7c2 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -691,6 +691,9 @@ export interface FrameSystemExtensionsCheckNonce extends Compact {} /** @name FrameSystemExtensionsCheckSpecVersion */ export interface FrameSystemExtensionsCheckSpecVersion extends Null {} +/** @name FrameSystemExtensionsCheckTxVersion */ +export interface FrameSystemExtensionsCheckTxVersion extends Null {} + /** @name FrameSystemExtensionsCheckWeight */ export interface FrameSystemExtensionsCheckWeight extends Null {} diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index adfff5ceab..b3f8bd3974 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -3540,27 +3540,31 @@ export default { **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup479: frame_system::extensions::check_genesis::CheckGenesis + * Lookup479: frame_system::extensions::check_tx_version::CheckTxVersion + **/ + FrameSystemExtensionsCheckTxVersion: 'Null', + /** + * Lookup480: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup482: frame_system::extensions::check_nonce::CheckNonce + * Lookup483: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup483: frame_system::extensions::check_weight::CheckWeight + * Lookup484: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup484: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup485: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup485: opal_runtime::Runtime + * Lookup486: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup486: pallet_ethereum::FakeTransactionFinalizer + * Lookup487: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index 24e02077cb..2da85ab04d 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { interface InterfaceTypes { @@ -71,6 +71,7 @@ declare module '@polkadot/types/types/registry' { FrameSystemExtensionsCheckGenesis: FrameSystemExtensionsCheckGenesis; FrameSystemExtensionsCheckNonce: FrameSystemExtensionsCheckNonce; FrameSystemExtensionsCheckSpecVersion: FrameSystemExtensionsCheckSpecVersion; + FrameSystemExtensionsCheckTxVersion: FrameSystemExtensionsCheckTxVersion; FrameSystemExtensionsCheckWeight: FrameSystemExtensionsCheckWeight; FrameSystemLastRuntimeUpgradeInfo: FrameSystemLastRuntimeUpgradeInfo; FrameSystemLimitsBlockLength: FrameSystemLimitsBlockLength; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 014d26efae..3b82b9a82f 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -3784,22 +3784,25 @@ declare module '@polkadot/types/lookup' { /** @name FrameSystemExtensionsCheckSpecVersion (478) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (479) */ + /** @name FrameSystemExtensionsCheckTxVersion (479) */ + type FrameSystemExtensionsCheckTxVersion = Null; + + /** @name FrameSystemExtensionsCheckGenesis (480) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (482) */ + /** @name FrameSystemExtensionsCheckNonce (483) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (483) */ + /** @name FrameSystemExtensionsCheckWeight (484) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (484) */ + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (485) */ interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (485) */ + /** @name OpalRuntimeRuntime (486) */ type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (486) */ + /** @name PalletEthereumFakeTransactionFinalizer (487) */ type PalletEthereumFakeTransactionFinalizer = Null; } // declare module From 3ce311c312ce436d8fc3c24aca4c19cc6746786b Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 29 Sep 2022 15:46:10 +0000 Subject: [PATCH 0985/1274] test: query properties rpc --- tests/package.json | 2 +- tests/src/getPropertiesRpc.test.ts | 126 +++++++++++++++++++++++++++ tests/src/util/playgrounds/unique.ts | 16 ++-- 3 files changed, 135 insertions(+), 9 deletions(-) create mode 100644 tests/src/getPropertiesRpc.test.ts diff --git a/tests/package.json b/tests/package.json index a37b6efb43..f9988b3487 100644 --- a/tests/package.json +++ b/tests/package.json @@ -38,7 +38,7 @@ "testNesting": "mocha --timeout 9999999 -r ts-node/register ./**/nest.test.ts", "testUnnesting": "mocha --timeout 9999999 -r ts-node/register ./**/unnest.test.ts", "testStructure": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/**.test.ts", - "testProperties": "mocha --timeout 9999999 -r ts-node/register ./**/properties.test.ts", + "testProperties": "mocha --timeout 9999999 -r ts-node/register ./**/properties.test.ts ./**/getPropertiesRpc.test.ts", "testMigration": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/migration-check.test.ts", "testRmrk": "mocha --timeout 9999999 -r ts-node/register ./**/rmrk/**.test.ts", "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts", diff --git a/tests/src/getPropertiesRpc.test.ts b/tests/src/getPropertiesRpc.test.ts new file mode 100644 index 0000000000..bdfde904ef --- /dev/null +++ b/tests/src/getPropertiesRpc.test.ts @@ -0,0 +1,126 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import {IKeyringPair} from '@polkadot/types/types'; +import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from './util/playgrounds'; +import {UniqueHelper, UniqueBaseCollection, UniqueNFTCollection, UniqueNFToken} from './util/playgrounds/unique'; + +const collectionProps = [ + {key: 'col-0', value: 'col-0-value'}, + {key: 'col-1', value: 'col-1-value'}, +]; + +const tokenProps = [ + {key: 'tok-0', value: 'tok-0-value'}, + {key: 'tok-1', value: 'tok-1-value'}, +]; + +const tokPropPermission = { + mutable: false, + tokenOwner: true, + collectionAdmin: false, +}; + +const tokenPropPermissions = [ + { + key: 'tok-0', + permission: tokPropPermission, + }, + { + key: 'tok-1', + permission: tokPropPermission, + }, +]; + +describe('query properties RPC', () => { + let alice: IKeyringPair; + + const mintCollection = async (helper: UniqueHelper) => { + return await helper.nft.mintCollection(alice, { + tokenPrefix: 'prps', + properties: collectionProps, + tokenPropertyPermissions: tokenPropPermissions, + }); + }; + + const mintToken = async (collection: UniqueNFTCollection) => { + return await collection.mintToken(alice, {Substrate: alice.address}, tokenProps); + }; + + + before(async () => { + await usingPlaygrounds(async (_, privateKey) => { + alice = privateKey('//Alice'); + }); + }); + + itSub('query empty collection key set', async ({helper}) => { + const collection = await mintCollection(helper); + const props = await collection.getProperties([]); + expect(props).to.be.empty; + }); + + itSub('query empty token key set', async ({helper}) => { + const collection = await mintCollection(helper); + const token = await mintToken(collection); + const props = await token.getProperties([]); + expect(props).to.be.empty; + }); + + itSub('query empty token key permissions set', async ({helper}) => { + const collection = await mintCollection(helper); + const propPermissions = await collection.getPropertyPermissions([]); + expect(propPermissions).to.be.empty; + }); + + itSub('query all collection props by null arg', async ({helper}) => { + const collection = await mintCollection(helper); + const props = await collection.getProperties(null); + expect(props).to.be.deep.equal(collectionProps); + }); + + itSub('query all token props by null arg', async ({helper}) => { + const collection = await mintCollection(helper); + const token = await mintToken(collection); + const props = await token.getProperties(null); + expect(props).to.be.deep.equal(tokenProps); + }); + + itSub('query empty token key permissions by null arg', async ({helper}) => { + const collection = await mintCollection(helper); + const propPermissions = await collection.getPropertyPermissions(null); + expect(propPermissions).to.be.deep.equal(tokenPropPermissions); + }); + + itSub('query all collection props by undefined arg', async ({helper}) => { + const collection = await mintCollection(helper); + const props = await collection.getProperties(); + expect(props).to.be.deep.equal(collectionProps); + }); + + itSub('query all token props by undefined arg', async ({helper}) => { + const collection = await mintCollection(helper); + const token = await mintToken(collection); + const props = await token.getProperties(); + expect(props).to.be.deep.equal(tokenProps); + }); + + itSub('query empty token key permissions by undefined arg', async ({helper}) => { + const collection = await mintCollection(helper); + const propPermissions = await collection.getPropertyPermissions(); + expect(propPermissions).to.be.deep.equal(tokenPropPermissions); + }); +}); diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index aba9ead3ae..0f9c65006f 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -926,8 +926,8 @@ class CollectionGroup extends HelperGroup { * @example getProperties(1219, ['location', 'date', 'time', 'isParadise']); * @returns array of key-value pairs */ - async getProperties(collectionId: number, propertyKeys: string[] | null = null): Promise { - return (await this.helper.callRpc('api.rpc.unique.collectionProperties', [collectionId, ...(propertyKeys === null ? [] : [propertyKeys])])).toHuman(); + async getProperties(collectionId: number, propertyKeys?: string[] | null): Promise { + return (await this.helper.callRpc('api.rpc.unique.collectionProperties', [collectionId, propertyKeys])).toHuman(); } /** @@ -1208,8 +1208,8 @@ class NFTnRFT extends CollectionGroup { * @example getTokenProperties(1219, ['location', 'date', 'time', 'isParadise']); * @returns array of key-value pairs */ - async getTokenProperties(collectionId: number, tokenId: number, propertyKeys: string[] | null = null): Promise { - return (await this.helper.callRpc('api.rpc.unique.tokenProperties', [collectionId, tokenId, ...(propertyKeys === null ? [] : [propertyKeys])])).toHuman(); + async getTokenProperties(collectionId: number, tokenId: number, propertyKeys?: string[] | null): Promise { + return (await this.helper.callRpc('api.rpc.unique.tokenProperties', [collectionId, tokenId, propertyKeys])).toHuman(); } /** @@ -2265,7 +2265,7 @@ export class UniqueBaseCollection { return await this.helper.collection.getEffectiveLimits(this.collectionId); } - async getProperties(propertyKeys: string[] | null = null) { + async getProperties(propertyKeys?: string[] | null) { return await this.helper.collection.getProperties(this.collectionId, propertyKeys); } @@ -2364,7 +2364,7 @@ export class UniqueNFTCollection extends UniqueBaseCollection { return await this.helper.nft.getPropertyPermissions(this.collectionId, propertyKeys); } - async getTokenProperties(tokenId: number, propertyKeys: string[] | null = null) { + async getTokenProperties(tokenId: number, propertyKeys?: string[] | null) { return await this.helper.nft.getTokenProperties(this.collectionId, tokenId, propertyKeys); } @@ -2455,7 +2455,7 @@ export class UniqueRFTCollection extends UniqueBaseCollection { return await this.helper.rft.getPropertyPermissions(this.collectionId, propertyKeys); } - async getTokenProperties(tokenId: number, propertyKeys: string[] | null = null) { + async getTokenProperties(tokenId: number, propertyKeys?: string[] | null) { return await this.helper.rft.getTokenProperties(this.collectionId, tokenId, propertyKeys); } @@ -2567,7 +2567,7 @@ export class UniqueBaseToken { return await this.collection.getTokenNextSponsored(this.tokenId, addressObj); } - async getProperties(propertyKeys: string[] | null = null) { + async getProperties(propertyKeys?: string[] | null) { return await this.collection.getTokenProperties(this.tokenId, propertyKeys); } From d4443286d44f7a2ec19d024d5a1896f80168fe46 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 30 Sep 2022 08:18:17 +0000 Subject: [PATCH 0986/1274] tests(eth): more small tests refactored to playgrounds --- tests/src/eth/createNFTCollection.test.ts | 257 +++++++++---------- tests/src/eth/createRFTCollection.test.ts | 252 +++++++++--------- tests/src/eth/crossTransfer.test.ts | 133 +++++----- tests/src/eth/helpersSmoke.test.ts | 27 +- tests/src/eth/migration.test.ts | 31 ++- tests/src/eth/nonFungible.test.ts | 76 ++---- tests/src/eth/util/playgrounds/unique.dev.ts | 10 +- tests/src/util/playgrounds/unique.ts | 38 ++- 8 files changed, 417 insertions(+), 407 deletions(-) diff --git a/tests/src/eth/createNFTCollection.test.ts b/tests/src/eth/createNFTCollection.test.ts index 81876aeb12..c69a5be129 100644 --- a/tests/src/eth/createNFTCollection.test.ts +++ b/tests/src/eth/createNFTCollection.test.ts @@ -15,47 +15,49 @@ // along with Unique Network. If not, see . import {evmToAddress} from '@polkadot/util-crypto'; -import {expect} from 'chai'; -import {getCreatedCollectionCount, getDetailedCollectionInfo} from '../util/helpers'; -import { - evmCollectionHelpers, - collectionIdToAddress, - createEthAccount, - createEthAccountWithBalance, - evmCollection, - itWeb3, - getCollectionAddressFromResult, -} from './util/helpers'; +import {IKeyringPair} from '@polkadot/types/types'; +import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; describe('Create NFT collection from EVM', () => { - itWeb3('Create collection', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - const collectionName = 'CollectionEVM'; + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); + + itEth('Create collection', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + + const name = 'CollectionEVM'; const description = 'Some description'; - const tokenPrefix = 'token prefix'; - - const collectionCountBefore = await getCreatedCollectionCount(api); - const result = await collectionHelper.methods - .createNonfungibleCollection(collectionName, description, tokenPrefix) - .send(); - const collectionCountAfter = await getCreatedCollectionCount(api); - - const {collectionId, collection} = await getCollectionAddressFromResult(api, result); + const prefix = 'token prefix'; + + // todo:playgrounds this might fail when in async environment. + const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; + const {collectionId} = await helper.eth.createNonfungibleCollection(owner, name, description, prefix); + const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; + + const collection = helper.nft.getCollectionObject(collectionId); + const data = (await collection.getData())!; + expect(collectionCountAfter - collectionCountBefore).to.be.eq(1); expect(collectionId).to.be.eq(collectionCountAfter); - expect(collection.name.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(collectionName); - expect(collection.description.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(description); - expect(collection.tokenPrefix.toHuman()).to.be.eq(tokenPrefix); - expect(collection.mode.isNft).to.be.true; + expect(data.name).to.be.eq(name); + expect(data.description).to.be.eq(description); + expect(data.raw.tokenPrefix).to.be.eq(prefix); + expect(data.raw.mode).to.be.eq('NFT'); }); - itWeb3('Check collection address exist', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - - const expectedCollectionId = await getCreatedCollectionCount(api) + 1; - const expectedCollectionAddress = collectionIdToAddress(expectedCollectionId); + // todo:playgrounds this test will fail when in async environment. + itEth('Check collection address exist', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + + const expectedCollectionId = +(await helper.callRpc('api.rpc.unique.collectionStats')).created + 1; + const expectedCollectionAddress = helper.ethAddress.fromCollectionId(expectedCollectionId); + const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); + expect(await collectionHelpers.methods .isCollectionExist(expectedCollectionAddress) .call()).to.be.false; @@ -69,31 +71,30 @@ describe('Create NFT collection from EVM', () => { .call()).to.be.true; }); - itWeb3('Set sponsorship', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - result = await collectionEvm.methods.setCollectionSponsor(sponsor).send(); - let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - expect(collectionSub.sponsorship.isUnconfirmed).to.be.true; - const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format; - expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); - await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); - const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress); + itEth('Set sponsorship', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); + const ss58Format = helper.chain.getChainProperties().ss58Format; + const {collectionId, collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'Sponsor', 'absolutely anything', 'ROC'); + + const collection = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + await collection.methods.setCollectionSponsor(sponsor).send(); + + let data = (await helper.nft.getData(collectionId))!; + expect(data.raw.sponsorship.Unconfirmed).to.be.equal(evmToAddress(sponsor, Number(ss58Format))); + + await expect(collection.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); + + const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'nft', sponsor); await sponsorCollection.methods.confirmCollectionSponsorship().send(); - collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - expect(collectionSub.sponsorship.isConfirmed).to.be.true; - expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + + data = (await helper.nft.getData(collectionId))!; + expect(data.raw.sponsorship.Confirmed).to.be.equal(evmToAddress(sponsor, Number(ss58Format))); }); - itWeb3('Set limits', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - const result = await collectionHelpers.methods.createNonfungibleCollection('Const collection', '5', '5').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + itEth('Set limits', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionId, collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'Limits', 'absolutely anything', 'FLO'); const limits = { accountTokenOwnershipLimit: 1000, sponsoredDataSize: 1024, @@ -106,124 +107,122 @@ describe('Create NFT collection from EVM', () => { transfersEnabled: false, }; - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); - await collectionEvm.methods['setCollectionLimit(string,uint32)']('accountTokenOwnershipLimit', limits.accountTokenOwnershipLimit).send(); - await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsoredDataSize', limits.sponsoredDataSize).send(); - await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsoredDataRateLimit', limits.sponsoredDataRateLimit).send(); - await collectionEvm.methods['setCollectionLimit(string,uint32)']('tokenLimit', limits.tokenLimit).send(); - await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsorTransferTimeout', limits.sponsorTransferTimeout).send(); - await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsorApproveTimeout', limits.sponsorApproveTimeout).send(); - await collectionEvm.methods['setCollectionLimit(string,bool)']('ownerCanTransfer', limits.ownerCanTransfer).send(); - await collectionEvm.methods['setCollectionLimit(string,bool)']('ownerCanDestroy', limits.ownerCanDestroy).send(); - await collectionEvm.methods['setCollectionLimit(string,bool)']('transfersEnabled', limits.transfersEnabled).send(); + const collection = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + await collection.methods['setCollectionLimit(string,uint32)']('accountTokenOwnershipLimit', limits.accountTokenOwnershipLimit).send(); + await collection.methods['setCollectionLimit(string,uint32)']('sponsoredDataSize', limits.sponsoredDataSize).send(); + await collection.methods['setCollectionLimit(string,uint32)']('sponsoredDataRateLimit', limits.sponsoredDataRateLimit).send(); + await collection.methods['setCollectionLimit(string,uint32)']('tokenLimit', limits.tokenLimit).send(); + await collection.methods['setCollectionLimit(string,uint32)']('sponsorTransferTimeout', limits.sponsorTransferTimeout).send(); + await collection.methods['setCollectionLimit(string,uint32)']('sponsorApproveTimeout', limits.sponsorApproveTimeout).send(); + await collection.methods['setCollectionLimit(string,bool)']('ownerCanTransfer', limits.ownerCanTransfer).send(); + await collection.methods['setCollectionLimit(string,bool)']('ownerCanDestroy', limits.ownerCanDestroy).send(); + await collection.methods['setCollectionLimit(string,bool)']('transfersEnabled', limits.transfersEnabled).send(); - const collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - expect(collectionSub.limits.accountTokenOwnershipLimit.unwrap().toNumber()).to.be.eq(limits.accountTokenOwnershipLimit); - expect(collectionSub.limits.sponsoredDataSize.unwrap().toNumber()).to.be.eq(limits.sponsoredDataSize); - expect(collectionSub.limits.sponsoredDataRateLimit.unwrap().asBlocks.toNumber()).to.be.eq(limits.sponsoredDataRateLimit); - expect(collectionSub.limits.tokenLimit.unwrap().toNumber()).to.be.eq(limits.tokenLimit); - expect(collectionSub.limits.sponsorTransferTimeout.unwrap().toNumber()).to.be.eq(limits.sponsorTransferTimeout); - expect(collectionSub.limits.sponsorApproveTimeout.unwrap().toNumber()).to.be.eq(limits.sponsorApproveTimeout); - expect(collectionSub.limits.ownerCanTransfer.toHuman()).to.be.eq(limits.ownerCanTransfer); - expect(collectionSub.limits.ownerCanDestroy.toHuman()).to.be.eq(limits.ownerCanDestroy); - expect(collectionSub.limits.transfersEnabled.toHuman()).to.be.eq(limits.transfersEnabled); + const data = (await helper.nft.getData(collectionId))!; + expect(data.raw.limits.accountTokenOwnershipLimit).to.be.eq(limits.accountTokenOwnershipLimit); + expect(data.raw.limits.sponsoredDataSize).to.be.eq(limits.sponsoredDataSize); + expect(data.raw.limits.sponsoredDataRateLimit.blocks).to.be.eq(limits.sponsoredDataRateLimit); + expect(data.raw.limits.tokenLimit).to.be.eq(limits.tokenLimit); + expect(data.raw.limits.sponsorTransferTimeout).to.be.eq(limits.sponsorTransferTimeout); + expect(data.raw.limits.sponsorApproveTimeout).to.be.eq(limits.sponsorApproveTimeout); + expect(data.raw.limits.ownerCanTransfer).to.be.eq(limits.ownerCanTransfer); + expect(data.raw.limits.ownerCanDestroy).to.be.eq(limits.ownerCanDestroy); + expect(data.raw.limits.transfersEnabled).to.be.eq(limits.transfersEnabled); }); - itWeb3('Collection address exist', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('Collection address exist', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); const collectionAddressForNonexistentCollection = '0x17C4E6453CC49AAAAEACA894E6D9683E00112233'; - const collectionHelpers = evmCollectionHelpers(web3, owner); - expect(await collectionHelpers.methods - .isCollectionExist(collectionAddressForNonexistentCollection).call()) + expect(await helper.ethNativeContract.collectionHelpers(collectionAddressForNonexistentCollection) + .methods.isCollectionExist(collectionAddressForNonexistentCollection).call()) .to.be.false; - const result = await collectionHelpers.methods.createNonfungibleCollection('Collection address exist', '7', '7').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - expect(await collectionHelpers.methods - .isCollectionExist(collectionIdAddress).call()) + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'Exister', 'absolutely anything', 'EVC'); + expect(await helper.ethNativeContract.collectionHelpers(collectionAddress) + .methods.isCollectionExist(collectionAddress).call()) .to.be.true; }); }); describe('(!negative tests!) Create NFT collection from EVM', () => { - itWeb3('(!negative test!) Create collection (bad lengths)', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, owner); + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); + + itEth('(!negative test!) Create collection (bad lengths)', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); { - const MAX_NAME_LENGHT = 64; - const collectionName = 'A'.repeat(MAX_NAME_LENGHT + 1); + const MAX_NAME_LENGTH = 64; + const collectionName = 'A'.repeat(MAX_NAME_LENGTH + 1); const description = 'A'; const tokenPrefix = 'A'; - - await expect(helper.methods + + await expect(collectionHelper.methods .createNonfungibleCollection(collectionName, description, tokenPrefix) - .call()).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGHT); + .call()).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH); } - { - const MAX_DESCRIPTION_LENGHT = 256; + { + const MAX_DESCRIPTION_LENGTH = 256; const collectionName = 'A'; - const description = 'A'.repeat(MAX_DESCRIPTION_LENGHT + 1); + const description = 'A'.repeat(MAX_DESCRIPTION_LENGTH + 1); const tokenPrefix = 'A'; - await expect(helper.methods + await expect(collectionHelper.methods .createNonfungibleCollection(collectionName, description, tokenPrefix) - .call()).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGHT); + .call()).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH); } - { - const MAX_TOKEN_PREFIX_LENGHT = 16; + { + const MAX_TOKEN_PREFIX_LENGTH = 16; const collectionName = 'A'; const description = 'A'; - const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGHT + 1); - await expect(helper.methods + const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGTH + 1); + await expect(collectionHelper.methods .createNonfungibleCollection(collectionName, description, tokenPrefix) - .call()).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGHT); + .call()).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH); } }); - itWeb3('(!negative test!) Create collection (no funds)', async ({web3}) => { - const owner = createEthAccount(web3); - const helper = evmCollectionHelpers(web3, owner); - const collectionName = 'A'; - const description = 'A'; - const tokenPrefix = 'A'; - - await expect(helper.methods - .createNonfungibleCollection(collectionName, description, tokenPrefix) + itEth('(!negative test!) Create collection (no funds)', async ({helper}) => { + const owner = helper.eth.createAccount(); + const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); + await expect(collectionHelper.methods + .createNonfungibleCollection('Peasantry', 'absolutely anything', 'CVE') .call()).to.be.rejectedWith('NotSufficientFounds'); }); - itWeb3('(!negative test!) Check owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const notOwner = createEthAccount(web3); - const collectionHelpers = evmCollectionHelpers(web3, owner); - const result = await collectionHelpers.methods.createNonfungibleCollection('A', 'A', 'A').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const contractEvmFromNotOwner = evmCollection(web3, notOwner, collectionIdAddress); + itEth('(!negative test!) Check owner', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const malfeasant = helper.eth.createAccount(); + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'Transgressed', 'absolutely anything', 'COR'); + const malfeasantCollection = helper.ethNativeContract.collection(collectionAddress, 'nft', malfeasant); const EXPECTED_ERROR = 'NoPermission'; { - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - await expect(contractEvmFromNotOwner.methods + const sponsor = await helper.eth.createAccountWithBalance(donor); + await expect(malfeasantCollection.methods .setCollectionSponsor(sponsor) .call()).to.be.rejectedWith(EXPECTED_ERROR); - const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress); + const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'nft', sponsor); await expect(sponsorCollection.methods .confirmCollectionSponsorship() .call()).to.be.rejectedWith('caller is not set as sponsor'); } { - await expect(contractEvmFromNotOwner.methods + await expect(malfeasantCollection.methods .setCollectionLimit('account_token_ownership_limit', '1000') .call()).to.be.rejectedWith(EXPECTED_ERROR); } }); - itWeb3('(!negative test!) Set limits', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - const result = await collectionHelpers.methods.createNonfungibleCollection('Schema collection', 'A', 'A').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + itEth('(!negative test!) Set limits', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'Limits', 'absolutely anything', 'OLF'); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await expect(collectionEvm.methods .setCollectionLimit('badLimit', 'true') .call()).to.be.rejectedWith('unknown boolean limit "badLimit"'); diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts index b911273700..b3dcdef68e 100644 --- a/tests/src/eth/createRFTCollection.test.ts +++ b/tests/src/eth/createRFTCollection.test.ts @@ -15,51 +15,50 @@ // along with Unique Network. If not, see . import {evmToAddress} from '@polkadot/util-crypto'; -import {expect} from 'chai'; -import {getCreatedCollectionCount, getDetailedCollectionInfo, requirePallets, Pallets} from '../util/helpers'; -import { - evmCollectionHelpers, - collectionIdToAddress, - createEthAccount, - createEthAccountWithBalance, - evmCollection, - itWeb3, - getCollectionAddressFromResult, -} from './util/helpers'; +import {IKeyringPair} from '@polkadot/types/types'; +import {Pallets, requirePalletsOrSkip} from '../util/playgrounds'; +import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; describe('Create RFT collection from EVM', () => { + let donor: IKeyringPair; + before(async function() { - await requirePallets(this, [Pallets.ReFungible]); + await usingEthPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + donor = privateKey('//Alice'); + }); }); - itWeb3('Create collection', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelper = evmCollectionHelpers(web3, owner); - const collectionName = 'CollectionEVM'; + itEth('Create collection', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + + const name = 'CollectionEVM'; const description = 'Some description'; - const tokenPrefix = 'token prefix'; + const prefix = 'token prefix'; - const collectionCountBefore = await getCreatedCollectionCount(api); - const result = await collectionHelper.methods - .createRFTCollection(collectionName, description, tokenPrefix) - .send(); - const collectionCountAfter = await getCreatedCollectionCount(api); + // todo:playgrounds this might fail when in async environment. + const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; + const {collectionId} = await helper.eth.createRefungibleCollection(owner, name, description, prefix); + const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; - const {collectionId, collection} = await getCollectionAddressFromResult(api, result); + const data = (await helper.rft.getData(collectionId))!; + expect(collectionCountAfter - collectionCountBefore).to.be.eq(1); expect(collectionId).to.be.eq(collectionCountAfter); - expect(collection.name.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(collectionName); - expect(collection.description.map(v => String.fromCharCode(v.toNumber())).join('')).to.be.eq(description); - expect(collection.tokenPrefix.toHuman()).to.be.eq(tokenPrefix); - expect(collection.mode.isReFungible).to.be.true; + expect(data.name).to.be.eq(name); + expect(data.description).to.be.eq(description); + expect(data.raw.tokenPrefix).to.be.eq(prefix); + expect(data.raw.mode).to.be.eq('ReFungible'); }); - itWeb3('Check collection address exist', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - - const expectedCollectionId = await getCreatedCollectionCount(api) + 1; - const expectedCollectionAddress = collectionIdToAddress(expectedCollectionId); + // todo:playgrounds this test will fail when in async environment. + itEth('Check collection address exist', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + + const expectedCollectionId = +(await helper.callRpc('api.rpc.unique.collectionStats')).created + 1; + const expectedCollectionAddress = helper.ethAddress.fromCollectionId(expectedCollectionId); + const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); + expect(await collectionHelpers.methods .isCollectionExist(expectedCollectionAddress) .call()).to.be.false; @@ -73,31 +72,30 @@ describe('Create RFT collection from EVM', () => { .call()).to.be.true; }); - itWeb3('Set sponsorship', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - let result = await collectionHelpers.methods.createRFTCollection('Sponsor collection', '1', '1').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); - result = await collectionEvm.methods.setCollectionSponsor(sponsor).send(); - let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - expect(collectionSub.sponsorship.isUnconfirmed).to.be.true; - const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format; - expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); - await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); - const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress); + itEth('Set sponsorship', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); + const ss58Format = helper.chain.getChainProperties().ss58Format; + const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Sponsor', 'absolutely anything', 'ENVY'); + + const collection = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); + await collection.methods.setCollectionSponsor(sponsor).send(); + + let data = (await helper.rft.getData(collectionId))!; + expect(data.raw.sponsorship.Unconfirmed).to.be.equal(evmToAddress(sponsor, Number(ss58Format))); + + await expect(collection.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); + + const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor); await sponsorCollection.methods.confirmCollectionSponsorship().send(); - collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - expect(collectionSub.sponsorship.isConfirmed).to.be.true; - expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + + data = (await helper.rft.getData(collectionId))!; + expect(data.raw.sponsorship.Confirmed).to.be.equal(evmToAddress(sponsor, Number(ss58Format))); }); - itWeb3('Set limits', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - const result = await collectionHelpers.methods.createRFTCollection('Const collection', '5', '5').send(); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); + itEth('Set limits', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Limits', 'absolutely anything', 'INSI'); const limits = { accountTokenOwnershipLimit: 1000, sponsoredDataSize: 1024, @@ -110,128 +108,122 @@ describe('Create RFT collection from EVM', () => { transfersEnabled: false, }; - const collectionEvm = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); - await collectionEvm.methods['setCollectionLimit(string,uint32)']('accountTokenOwnershipLimit', limits.accountTokenOwnershipLimit).send(); - await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsoredDataSize', limits.sponsoredDataSize).send(); - await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsoredDataRateLimit', limits.sponsoredDataRateLimit).send(); - await collectionEvm.methods['setCollectionLimit(string,uint32)']('tokenLimit', limits.tokenLimit).send(); - await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsorTransferTimeout', limits.sponsorTransferTimeout).send(); - await collectionEvm.methods['setCollectionLimit(string,uint32)']('sponsorApproveTimeout', limits.sponsorApproveTimeout).send(); - await collectionEvm.methods['setCollectionLimit(string,bool)']('ownerCanTransfer', limits.ownerCanTransfer).send(); - await collectionEvm.methods['setCollectionLimit(string,bool)']('ownerCanDestroy', limits.ownerCanDestroy).send(); - await collectionEvm.methods['setCollectionLimit(string,bool)']('transfersEnabled', limits.transfersEnabled).send(); + const collection = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); + await collection.methods['setCollectionLimit(string,uint32)']('accountTokenOwnershipLimit', limits.accountTokenOwnershipLimit).send(); + await collection.methods['setCollectionLimit(string,uint32)']('sponsoredDataSize', limits.sponsoredDataSize).send(); + await collection.methods['setCollectionLimit(string,uint32)']('sponsoredDataRateLimit', limits.sponsoredDataRateLimit).send(); + await collection.methods['setCollectionLimit(string,uint32)']('tokenLimit', limits.tokenLimit).send(); + await collection.methods['setCollectionLimit(string,uint32)']('sponsorTransferTimeout', limits.sponsorTransferTimeout).send(); + await collection.methods['setCollectionLimit(string,uint32)']('sponsorApproveTimeout', limits.sponsorApproveTimeout).send(); + await collection.methods['setCollectionLimit(string,bool)']('ownerCanTransfer', limits.ownerCanTransfer).send(); + await collection.methods['setCollectionLimit(string,bool)']('ownerCanDestroy', limits.ownerCanDestroy).send(); + await collection.methods['setCollectionLimit(string,bool)']('transfersEnabled', limits.transfersEnabled).send(); - const collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - expect(collectionSub.limits.accountTokenOwnershipLimit.unwrap().toNumber()).to.be.eq(limits.accountTokenOwnershipLimit); - expect(collectionSub.limits.sponsoredDataSize.unwrap().toNumber()).to.be.eq(limits.sponsoredDataSize); - expect(collectionSub.limits.sponsoredDataRateLimit.unwrap().asBlocks.toNumber()).to.be.eq(limits.sponsoredDataRateLimit); - expect(collectionSub.limits.tokenLimit.unwrap().toNumber()).to.be.eq(limits.tokenLimit); - expect(collectionSub.limits.sponsorTransferTimeout.unwrap().toNumber()).to.be.eq(limits.sponsorTransferTimeout); - expect(collectionSub.limits.sponsorApproveTimeout.unwrap().toNumber()).to.be.eq(limits.sponsorApproveTimeout); - expect(collectionSub.limits.ownerCanTransfer.toHuman()).to.be.eq(limits.ownerCanTransfer); - expect(collectionSub.limits.ownerCanDestroy.toHuman()).to.be.eq(limits.ownerCanDestroy); - expect(collectionSub.limits.transfersEnabled.toHuman()).to.be.eq(limits.transfersEnabled); + const data = (await helper.rft.getData(collectionId))!; + expect(data.raw.limits.accountTokenOwnershipLimit).to.be.eq(limits.accountTokenOwnershipLimit); + expect(data.raw.limits.sponsoredDataSize).to.be.eq(limits.sponsoredDataSize); + expect(data.raw.limits.sponsoredDataRateLimit.blocks).to.be.eq(limits.sponsoredDataRateLimit); + expect(data.raw.limits.tokenLimit).to.be.eq(limits.tokenLimit); + expect(data.raw.limits.sponsorTransferTimeout).to.be.eq(limits.sponsorTransferTimeout); + expect(data.raw.limits.sponsorApproveTimeout).to.be.eq(limits.sponsorApproveTimeout); + expect(data.raw.limits.ownerCanTransfer).to.be.eq(limits.ownerCanTransfer); + expect(data.raw.limits.ownerCanDestroy).to.be.eq(limits.ownerCanDestroy); + expect(data.raw.limits.transfersEnabled).to.be.eq(limits.transfersEnabled); }); - itWeb3('Collection address exist', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('Collection address exist', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); const collectionAddressForNonexistentCollection = '0x17C4E6453CC49AAAAEACA894E6D9683E00112233'; - const collectionHelpers = evmCollectionHelpers(web3, owner); - expect(await collectionHelpers.methods - .isCollectionExist(collectionAddressForNonexistentCollection).call()) + expect(await helper.ethNativeContract.collectionHelpers(collectionAddressForNonexistentCollection) + .methods.isCollectionExist(collectionAddressForNonexistentCollection).call()) .to.be.false; - const result = await collectionHelpers.methods.createRFTCollection('Collection address exist', '7', '7').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - expect(await collectionHelpers.methods - .isCollectionExist(collectionIdAddress).call()) + const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Exister', 'absolutely anything', 'WIWT'); + expect(await helper.ethNativeContract.collectionHelpers(collectionAddress) + .methods.isCollectionExist(collectionAddress).call()) .to.be.true; }); }); describe('(!negative tests!) Create RFT collection from EVM', () => { + let donor: IKeyringPair; + before(async function() { - await requirePallets(this, [Pallets.ReFungible]); + await usingEthPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + donor = privateKey('//Alice'); + }); }); - itWeb3('(!negative test!) Create collection (bad lengths)', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const helper = evmCollectionHelpers(web3, owner); + itEth('(!negative test!) Create collection (bad lengths)', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); { - const MAX_NAME_LENGHT = 64; - const collectionName = 'A'.repeat(MAX_NAME_LENGHT + 1); + const MAX_NAME_LENGTH = 64; + const collectionName = 'A'.repeat(MAX_NAME_LENGTH + 1); const description = 'A'; const tokenPrefix = 'A'; - - await expect(helper.methods + + await expect(collectionHelper.methods .createRFTCollection(collectionName, description, tokenPrefix) - .call()).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGHT); - + .call()).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH); } - { - const MAX_DESCRIPTION_LENGHT = 256; + { + const MAX_DESCRIPTION_LENGTH = 256; const collectionName = 'A'; - const description = 'A'.repeat(MAX_DESCRIPTION_LENGHT + 1); + const description = 'A'.repeat(MAX_DESCRIPTION_LENGTH + 1); const tokenPrefix = 'A'; - await expect(helper.methods + await expect(collectionHelper.methods .createRFTCollection(collectionName, description, tokenPrefix) - .call()).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGHT); + .call()).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH); } - { - const MAX_TOKEN_PREFIX_LENGHT = 16; + { + const MAX_TOKEN_PREFIX_LENGTH = 16; const collectionName = 'A'; const description = 'A'; - const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGHT + 1); - await expect(helper.methods + const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGTH + 1); + await expect(collectionHelper.methods .createRFTCollection(collectionName, description, tokenPrefix) - .call()).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGHT); + .call()).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH); } }); - itWeb3('(!negative test!) Create collection (no funds)', async ({web3}) => { - const owner = createEthAccount(web3); - const helper = evmCollectionHelpers(web3, owner); - const collectionName = 'A'; - const description = 'A'; - const tokenPrefix = 'A'; - - await expect(helper.methods - .createRFTCollection(collectionName, description, tokenPrefix) + itEth('(!negative test!) Create collection (no funds)', async ({helper}) => { + const owner = helper.eth.createAccount(); + const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); + await expect(collectionHelper.methods + .createRFTCollection('Peasantry', 'absolutely anything', 'TWIW') .call()).to.be.rejectedWith('NotSufficientFounds'); }); - itWeb3('(!negative test!) Check owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const notOwner = createEthAccount(web3); - const collectionHelpers = evmCollectionHelpers(web3, owner); - const result = await collectionHelpers.methods.createRFTCollection('A', 'A', 'A').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const contractEvmFromNotOwner = evmCollection(web3, notOwner, collectionIdAddress, {type: 'ReFungible'}); + itEth('(!negative test!) Check owner', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const peasant = helper.eth.createAccount(); + const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Transgressed', 'absolutely anything', 'YVNE'); + const peasantCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', peasant); const EXPECTED_ERROR = 'NoPermission'; { - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - await expect(contractEvmFromNotOwner.methods + const sponsor = await helper.eth.createAccountWithBalance(donor); + await expect(peasantCollection.methods .setCollectionSponsor(sponsor) .call()).to.be.rejectedWith(EXPECTED_ERROR); - const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress); + const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor); await expect(sponsorCollection.methods .confirmCollectionSponsorship() .call()).to.be.rejectedWith('caller is not set as sponsor'); } { - await expect(contractEvmFromNotOwner.methods + await expect(peasantCollection.methods .setCollectionLimit('account_token_ownership_limit', '1000') .call()).to.be.rejectedWith(EXPECTED_ERROR); } }); - itWeb3('(!negative test!) Set limits', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - const result = await collectionHelpers.methods.createRFTCollection('Schema collection', 'A', 'A').send(); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'}); + itEth('(!negative test!) Set limits', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Limits', 'absolutely anything', 'ISNI'); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); await expect(collectionEvm.methods .setCollectionLimit('badLimit', 'true') .call()).to.be.rejectedWith('unknown boolean limit "badLimit"'); diff --git a/tests/src/eth/crossTransfer.test.ts b/tests/src/eth/crossTransfer.test.ts index d60c8f635b..07bd1f436f 100644 --- a/tests/src/eth/crossTransfer.test.ts +++ b/tests/src/eth/crossTransfer.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {createCollectionExpectSuccess, +/*import {createCollectionExpectSuccess, createFungibleItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess, @@ -23,81 +23,94 @@ import {createCollectionExpectSuccess, import {collectionIdToAddress, createEthAccountWithBalance, subToEth, - GAS_ARGS, itWeb3} from './util/helpers'; + GAS_ARGS, itEth} from './util/helpers'; import fungibleAbi from './fungibleAbi.json'; -import nonFungibleAbi from './nonFungibleAbi.json'; +import nonFungibleAbi from './nonFungibleAbi.json';*/ +import {itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {CrossAccountId} from '../util/playgrounds/unique'; +import {IKeyringPair} from '@polkadot/types/types'; describe('Token transfer between substrate address and EVM address. Fungible', () => { - itWeb3('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async ({privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'Fungible', decimalPoints: 0}, + let donor: IKeyringPair; + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - await setCollectionLimitsExpectSuccess(alice, collection, {ownerCanTransfer: true}); - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Substrate: alice.address}); - await transferExpectSuccess(collection, 0, alice, {Ethereum: subToEth(charlie.address)} , 200, 'Fungible'); - await transferFromExpectSuccess(collection, 0, alice, {Ethereum: subToEth(charlie.address)}, charlie, 50, 'Fungible'); - await transferExpectSuccess(collection, 0, charlie, bob, 50, 'Fungible'); }); + + itEth('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async ({helper}) => { + const bobCA = CrossAccountId.fromKeyring(bob); + const charlieCA = CrossAccountId.fromKeyring(charlie); - itWeb3('The private key X create a EVM address. Alice sends a token to the substrate address corresponding to this EVM address, and X can send it to Bob in the EVM', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'Fungible', decimalPoints: 0}, - }); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - await setCollectionLimitsExpectSuccess(alice, collection, {ownerCanTransfer: true}); - const bobProxy = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const aliceProxy = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const collection = await helper.ft.mintCollection(alice); + await collection.setLimits(alice, {ownerCanTransfer: true}); + + await collection.mint(alice, 200n); + await collection.transfer(alice, charlieCA.toEthereum(), 200n); + await collection.transferFrom(alice, charlieCA.toEthereum(), charlieCA, 50n); + await collection.transfer(charlie, bobCA, 50n); + }); + + itEth('The private key X create a EVM address. Alice sends a token to the substrate address corresponding to this EVM address, and X can send it to Bob in the EVM', async ({helper}) => { + const aliceProxy = await helper.eth.createAccountWithBalance(donor); + const bobProxy = await helper.eth.createAccountWithBalance(donor); + + const collection = await helper.ft.mintCollection(alice); + await collection.setLimits(alice, {ownerCanTransfer: true}); - await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, alice.address); - await transferExpectSuccess(collection, 0, alice, {Ethereum: aliceProxy} , 200, 'Fungible'); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(fungibleAbi as any, address, {from: aliceProxy, ...GAS_ARGS}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'ft', aliceProxy); + await collection.mint(alice, 200n, {Ethereum: aliceProxy}); await contract.methods.transfer(bobProxy, 50).send({from: aliceProxy}); - await transferFromExpectSuccess(collection, 0, alice, {Ethereum: bobProxy}, bob, 50, 'Fungible'); - await transferExpectSuccess(collection, 0, bob, alice, 50, 'Fungible'); + await collection.transferFrom(alice, {Ethereum: bobProxy}, CrossAccountId.fromKeyring(bob), 50n); + await collection.transfer(bob, CrossAccountId.fromKeyring(alice), 50n); }); }); describe('Token transfer between substrate address and EVM address. NFT', () => { - itWeb3('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async ({privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'NFT'}, + let donor: IKeyringPair; + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - await setCollectionLimitsExpectSuccess(alice, collection, {ownerCanTransfer: true}); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: alice.address}); - await transferExpectSuccess(collection, tokenId, alice, {Ethereum: subToEth(charlie.address)}, 1, 'NFT'); - await transferFromExpectSuccess(collection, tokenId, alice, {Ethereum: subToEth(charlie.address)}, charlie, 1, 'NFT'); - await transferExpectSuccess(collection, tokenId, charlie, bob, 1, 'NFT'); + }); + + itEth('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async ({helper}) => { + const charlieEth = CrossAccountId.fromKeyring(charlie, 'Ethereum'); + + const collection = await helper.nft.mintCollection(alice); + await collection.setLimits(alice, {ownerCanTransfer: true}); + const token = await collection.mintToken(alice); + await token.transfer(alice, charlieEth); + await token.transferFrom(alice, charlieEth, CrossAccountId.fromKeyring(charlie)); + await token.transfer(charlie, CrossAccountId.fromKeyring(bob)); }); - itWeb3('The private key X create a EVM address. Alice sends a token to the substrate address corresponding to this EVM address, and X can send it to Bob in the EVM', async ({api, web3, privateKeyWrapper}) => { - const collection = await createCollectionExpectSuccess({ - name: 'token name', - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); - const bob = privateKeyWrapper('//Bob'); - const charlie = privateKeyWrapper('//Charlie'); - await setCollectionLimitsExpectSuccess(alice, collection, {ownerCanTransfer: true}); - const bobProxy = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const aliceProxy = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: alice.address}); - await transferExpectSuccess(collection, tokenId, alice, {Ethereum: aliceProxy} , 1, 'NFT'); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: aliceProxy, ...GAS_ARGS}); + itEth('The private key X create a EVM address. Alice sends a token to the substrate address corresponding to this EVM address, and X can send it to Bob in the EVM', async ({helper}) => { + const aliceProxy = await helper.eth.createAccountWithBalance(donor); + const bobProxy = await helper.eth.createAccountWithBalance(donor); + + const collection = await helper.nft.mintCollection(alice); + await collection.setLimits(alice, {ownerCanTransfer: true}); + + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', aliceProxy); + + const token = await collection.mintToken(alice); + await token.transfer(alice, {Ethereum: aliceProxy}); await contract.methods.transfer(bobProxy, 1).send({from: aliceProxy}); - await transferFromExpectSuccess(collection, tokenId, alice, {Ethereum: bobProxy}, bob, 1, 'NFT'); - await transferExpectSuccess(collection, tokenId, bob, charlie, 1, 'NFT'); + await token.transferFrom(alice, {Ethereum: bobProxy}, {Substrate: bob.address}); + await token.transfer(bob, {Substrate: charlie.address}); }); }); diff --git a/tests/src/eth/helpersSmoke.test.ts b/tests/src/eth/helpersSmoke.test.ts index ed260ae64d..39eb5d3c2a 100644 --- a/tests/src/eth/helpersSmoke.test.ts +++ b/tests/src/eth/helpersSmoke.test.ts @@ -14,21 +14,30 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {expect} from 'chai'; -import {createEthAccountWithBalance, deployFlipper, itWeb3, contractHelpers} from './util/helpers'; +import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {IKeyringPair} from '@polkadot/types/types'; describe('Helpers sanity check', () => { - itWeb3('Contract owner is recorded', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + let donor: IKeyringPair; - const flipper = await deployFlipper(web3, owner); + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); + + itEth('Contract owner is recorded', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + + const flipper = await helper.eth.deployFlipper(owner); - expect(await contractHelpers(web3, owner).methods.contractOwner(flipper.options.address).call()).to.be.equal(owner); + expect(await helper.ethNativeContract.contractHelpers(owner).methods.contractOwner(flipper.options.address).call()).to.be.equal(owner); }); - itWeb3('Flipper is working', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); + itEth('Flipper is working', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + + const flipper = await helper.eth.deployFlipper(owner); expect(await flipper.methods.getValue().call()).to.be.false; await flipper.methods.flip().send({from: owner}); diff --git a/tests/src/eth/migration.test.ts b/tests/src/eth/migration.test.ts index 151d51d742..ee58e27e3f 100644 --- a/tests/src/eth/migration.test.ts +++ b/tests/src/eth/migration.test.ts @@ -14,12 +14,20 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {expect} from 'chai'; -import {submitTransactionAsync} from '../substrate/substrate-api'; -import {createEthAccountWithBalance, GAS_ARGS, itWeb3} from './util/helpers'; +import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {IKeyringPair} from '@polkadot/types/types'; describe('EVM Migrations', () => { - itWeb3('Deploy contract saved state', async ({web3, api, privateKeyWrapper}) => { + let superuser: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + superuser = privateKey('//Alice'); + }); + }); + + // todo:playgrounds requires sudo, look into later + itEth('Deploy contract saved state', async ({helper}) => { /* contract StatefulContract { uint counter; @@ -53,13 +61,16 @@ describe('EVM Migrations', () => { ['0xedc95719e9a3b28dd8e80877cb5880a9be7de1a13fc8b05e7999683b6b567643', '0x0000000000000000000000000000000000000000000000000000000000000004'], ]; - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const caller = await helper.eth.createAccountWithBalance(superuser); - await submitTransactionAsync(alice, api.tx.sudo.sudo(api.tx.evmMigration.begin(ADDRESS) as any)); - await submitTransactionAsync(alice, api.tx.sudo.sudo(api.tx.evmMigration.setData(ADDRESS, DATA as any) as any)); - await submitTransactionAsync(alice, api.tx.sudo.sudo(api.tx.evmMigration.finish(ADDRESS, CODE) as any)); + const txBegin = helper.constructApiCall('api.tx.evmMigration.begin', [ADDRESS]); + const txSetData = helper.constructApiCall('api.tx.evmMigration.setData', [ADDRESS, DATA]); + const txFinish = helper.constructApiCall('api.tx.evmMigration.finish', [ADDRESS, CODE]); + await expect(helper.executeExtrinsic(superuser, 'api.tx.sudo.sudo', [txBegin])).to.be.fulfilled; + await expect(helper.executeExtrinsic(superuser, 'api.tx.sudo.sudo', [txSetData])).to.be.fulfilled; + await expect(helper.executeExtrinsic(superuser, 'api.tx.sudo.sudo', [txFinish])).to.be.fulfilled; + const web3 = helper.getWeb3(); const contract = new web3.eth.Contract([ { inputs: [], @@ -87,7 +98,7 @@ describe('EVM Migrations', () => { stateMutability: 'view', type: 'function', }, - ], ADDRESS, {from: caller, ...GAS_ARGS}); + ], ADDRESS, {from: caller, gas: helper.eth.DEFAULT_GAS}); expect(await contract.methods.counterValue().call()).to.be.equal('10'); for (let i = 1; i <= 4; i++) { diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index b1c38fb717..26c0f280cf 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -171,70 +171,38 @@ describe('NFT: Plain calls', () => { }); //TODO: CORE-302 add eth methods - /* todo:playgrounds skipped test! - itWeb3.skip('Can perform mintBulk()', async ({helper}) => { - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); - - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const changeAdminTx = api.tx.unique.addCollectionAdmin(collection, {Ethereum: caller}); - await submitTransactionAsync(alice, changeAdminTx); - const receiver = createEthAccount(web3); + itEth.skip('Can perform mintBulk()', async ({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const collection = await helper.nft.mintCollection(alice); + await collection.addAdmin(alice, {Ethereum: caller}); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', caller); { + const bulkSize = 3; const nextTokenId = await contract.methods.nextTokenId().call(); expect(nextTokenId).to.be.equal('1'); const result = await contract.methods.mintBulkWithTokenURI( receiver, - [ - [nextTokenId, 'Test URI 0'], - [+nextTokenId + 1, 'Test URI 1'], - [+nextTokenId + 2, 'Test URI 2'], - ], + Array.from({length: bulkSize}, (_, i) => ( + [+nextTokenId + i, `Test URI ${i}`] + )), ).send({from: caller}); - const events = normalizeEvents(result.events); - - expect(events).to.be.deep.equal([ - { - address, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: nextTokenId, - }, - }, - { - address, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: String(+nextTokenId + 1), - }, - }, - { - address, - event: 'Transfer', - args: { - from: '0x0000000000000000000000000000000000000000', - to: receiver, - tokenId: String(+nextTokenId + 2), - }, - }, - ]); - - expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI 0'); - expect(await contract.methods.tokenURI(+nextTokenId + 1).call()).to.be.equal('Test URI 1'); - expect(await contract.methods.tokenURI(+nextTokenId + 2).call()).to.be.equal('Test URI 2'); + + const events = result.events.Transfer.sort((a: any, b: any) => +a.returnValues.tokenId - b.returnValues.tokenId); + for (let i = 0; i < bulkSize; i++) { + const event = events[i]; + expect(event.address).to.equal(collectionAddress); + expect(event.returnValues.from).to.equal('0x0000000000000000000000000000000000000000'); + expect(event.returnValues.to).to.equal(receiver); + expect(event.returnValues.tokenId).to.equal(`${+nextTokenId + i}`); + + expect(await contract.methods.tokenURI(+nextTokenId + i).call()).to.be.equal(`Test URI ${i}`); + } } }); - */ itEth('Can perform burn()', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index 536fec74a4..c310ead38a 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -131,7 +131,7 @@ class NativeContractGroup extends EthGroupBase { } } - + class EthGroup extends EthGroupBase { DEFAULT_GAS = 2_500_000; @@ -164,14 +164,14 @@ class EthGroup extends EthGroupBase { true, ); } - + async callEVM(signer: TEthereumAccount, contractAddress: string, abi: string) { return await this.helper.callRpc('api.rpc.eth.call', [{from: signer, to: contractAddress, data: abi}]); } async createNonfungibleCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{collectionId: number, collectionAddress: string}> { const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); - + const result = await collectionHelper.methods.createNonfungibleCollection(name, description, tokenPrefix).send(); const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); @@ -182,7 +182,7 @@ class EthGroup extends EthGroupBase { async createRefungibleCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{collectionId: number, collectionAddress: string}> { const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); - + const result = await collectionHelper.methods.createRFTCollection(name, description, tokenPrefix).send(); const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); @@ -246,7 +246,7 @@ class EthGroup extends EthGroupBase { return before - after; } } - + class EthAddressGroup extends EthGroupBase { extractCollectionId(address: string): number { if (!(address.length === 42 || address.length === 40)) throw new Error('address wrong format'); diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index aba9ead3ae..b4ba142af0 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -20,8 +20,11 @@ export class CrossAccountId implements ICrossAccountId { if (account.Ethereum) this.Ethereum = account.Ethereum; } - static fromKeyring(account: IKeyringPair) { - return new CrossAccountId({Substrate: account.address}); + static fromKeyring(account: IKeyringPair, domain: 'Substrate' | 'Ethereum' = 'Substrate') { + switch (domain) { + case 'Substrate': return new CrossAccountId({Substrate: account.address}); + case 'Ethereum': return new CrossAccountId({Substrate: account.address}).toEthereum(); + } } static fromLowerCaseKeys(address: ICrossAccountIdLower): CrossAccountId { @@ -40,6 +43,24 @@ export class CrossAccountId implements ICrossAccountId { if (this.Substrate) return CrossAccountId.withNormalizedSubstrate(this.Substrate, ss58Format); return this; } + + static translateSubToEth(address: TSubstrateAccount): TEthereumAccount { + return nesting.toChecksumAddress('0x' + Array.from(addressToEvm(address), i => i.toString(16).padStart(2, '0')).join('')); + } + + toEthereum(): CrossAccountId { + if (this.Substrate) return new CrossAccountId({Ethereum: CrossAccountId.translateSubToEth(this.Substrate)}); + return this; + } + + static translateEthToSub(address: TEthereumAccount, ss58Format?: number): TSubstrateAccount { + return evmToAddress(address, ss58Format); + } + + toSubstrate(ss58Format?: number): CrossAccountId { + if (this.Ethereum) return new CrossAccountId({Substrate: CrossAccountId.translateEthToSub(this.Ethereum, ss58Format)}); + return this; + } toLowerCase(): CrossAccountId { if (this.Substrate) this.Substrate = this.Substrate.toLowerCase(); @@ -2093,9 +2114,8 @@ class AddressGroup extends HelperGroup { * @example normalizeSubstrateToChainFormat("5GrwvaEF5zXb26Fz...") // returns unjKJQJrRd238pkUZZ... for Unique Network * @returns address in chain format */ - async normalizeSubstrateToChainFormat(address: TSubstrateAccount): Promise { - const info = this.helper.chain.getChainProperties(); - return encodeAddress(decodeAddress(address), info.ss58Format); + normalizeSubstrateToChainFormat(address: TSubstrateAccount): TSubstrateAccount { + return this.normalizeSubstrate(address, this.helper.chain.getChainProperties().ss58Format); } /** @@ -2105,10 +2125,8 @@ class AddressGroup extends HelperGroup { * @example ethToSubstrate('0x9F0583DbB855d...') * @returns substrate mirror of a provided ethereum address */ - async ethToSubstrate(ethAddress: TEthereumAccount, toChainFormat=false): Promise { - if(!toChainFormat) return evmToAddress(ethAddress); - const info = this.helper.chain.getChainProperties(); - return evmToAddress(ethAddress, info.ss58Format); + ethToSubstrate(ethAddress: TEthereumAccount, toChainFormat=false): TSubstrateAccount { + return CrossAccountId.translateEthToSub(ethAddress, toChainFormat ? this.helper.chain.getChainProperties().ss58Format : undefined); } /** @@ -2118,7 +2136,7 @@ class AddressGroup extends HelperGroup { * @returns ethereum mirror of a provided substrate address */ substrateToEth(subAddress: TSubstrateAccount): TEthereumAccount { - return nesting.toChecksumAddress('0x' + Array.from(addressToEvm(subAddress), i => i.toString(16).padStart(2, '0')).join('')); + return CrossAccountId.translateSubToEth(subAddress); } } From 3b7dec1d258fdc60eaa89f9e7fe2f71b4f2f48e7 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 30 Sep 2022 08:29:46 +0000 Subject: [PATCH 0987/1274] tests(eth): remove redundant commented area --- tests/src/eth/crossTransfer.test.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tests/src/eth/crossTransfer.test.ts b/tests/src/eth/crossTransfer.test.ts index 07bd1f436f..80e50bdee3 100644 --- a/tests/src/eth/crossTransfer.test.ts +++ b/tests/src/eth/crossTransfer.test.ts @@ -14,18 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -/*import {createCollectionExpectSuccess, - createFungibleItemExpectSuccess, - transferExpectSuccess, - transferFromExpectSuccess, - setCollectionLimitsExpectSuccess, - createItemExpectSuccess} from '../util/helpers'; -import {collectionIdToAddress, - createEthAccountWithBalance, - subToEth, - GAS_ARGS, itEth} from './util/helpers'; -import fungibleAbi from './fungibleAbi.json'; -import nonFungibleAbi from './nonFungibleAbi.json';*/ import {itEth, usingEthPlaygrounds} from './util/playgrounds'; import {CrossAccountId} from '../util/playgrounds/unique'; import {IKeyringPair} from '@polkadot/types/types'; From d59662d61f76c09a23689bd4411f955e4c312e01 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 30 Sep 2022 09:17:56 +0000 Subject: [PATCH 0988/1274] fix: remove unused imports --- tests/src/getPropertiesRpc.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/getPropertiesRpc.test.ts b/tests/src/getPropertiesRpc.test.ts index bdfde904ef..6289dc9634 100644 --- a/tests/src/getPropertiesRpc.test.ts +++ b/tests/src/getPropertiesRpc.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from './util/playgrounds'; -import {UniqueHelper, UniqueBaseCollection, UniqueNFTCollection, UniqueNFToken} from './util/playgrounds/unique'; +import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; +import {UniqueHelper, UniqueNFTCollection} from './util/playgrounds/unique'; const collectionProps = [ {key: 'col-0', value: 'col-0-value'}, From 12fbdbdcf4df2c428170c2fd1e14bba7d1199f22 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 30 Sep 2022 11:58:18 +0000 Subject: [PATCH 0989/1274] tests(playgrounds): updates and revisions for older tests on playgrounds --- tests/src/change-collection-owner.test.ts | 12 ++--- tests/src/createCollection.test.ts | 24 +++------ tests/src/createItem.test.ts | 63 +++++++++-------------- tests/src/createMultipleItems.test.ts | 19 ++++--- tests/src/creditFeesToTreasury.test.ts | 36 +++++-------- tests/src/destroyCollection.test.ts | 5 +- tests/src/nesting/properties.test.ts | 1 - tests/src/refungible.test.ts | 10 ++-- tests/src/util/playgrounds/unique.ts | 43 +++++++++------- 9 files changed, 92 insertions(+), 121 deletions(-) diff --git a/tests/src/change-collection-owner.test.ts b/tests/src/change-collection-owner.test.ts index 91deba5d05..97a55bdb57 100644 --- a/tests/src/change-collection-owner.test.ts +++ b/tests/src/change-collection-owner.test.ts @@ -31,11 +31,11 @@ describe('Integration Test changeCollectionOwner(collection_id, new_owner):', () itSub('Changing owner changes owner address', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const beforeChanging = await helper.collection.getData(collection.collectionId); - expect(beforeChanging?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(alice.address)); + expect(beforeChanging?.normalizedOwner).to.be.equal(helper.address.normalizeSubstrate(alice.address)); await collection.changeOwner(alice, bob.address); const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(bob.address)); + expect(afterChanging?.normalizedOwner).to.be.equal(helper.address.normalizeSubstrate(bob.address)); }); }); @@ -60,7 +60,7 @@ describe('Integration Test changeCollectionOwner(collection_id, new_owner) speci await expect(changeOwnerTx()).to.be.rejectedWith(/common\.NoPermission/); const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(bob.address)); + expect(afterChanging?.normalizedOwner).to.be.equal(helper.address.normalizeSubstrate(bob.address)); }); itSub('New collectionOwner has access to sponsorship management operations in the collection', async ({helper}) => { @@ -68,7 +68,7 @@ describe('Integration Test changeCollectionOwner(collection_id, new_owner) speci await collection.changeOwner(alice, bob.address); const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(bob.address)); + expect(afterChanging?.normalizedOwner).to.be.equal(helper.address.normalizeSubstrate(bob.address)); await collection.setSponsor(bob, charlie.address); await collection.confirmSponsorship(charlie); @@ -97,7 +97,7 @@ describe('Integration Test changeCollectionOwner(collection_id, new_owner) speci await collection.changeOwner(alice, bob.address); await collection.changeOwner(bob, charlie.address); const collectionData = await collection.getData(); - expect(collectionData?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(charlie.address)); + expect(collectionData?.normalizedOwner).to.be.equal(helper.address.normalizeSubstrate(charlie.address)); }); }); @@ -140,7 +140,7 @@ describe('Negative Integration Test changeCollectionOwner(collection_id, new_own await expect(changeOwnerTx()).to.be.rejectedWith(/common\.NoPermission/); const afterChanging = await helper.collection.getData(collection.collectionId); - expect(afterChanging?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(bob.address)); + expect(afterChanging?.normalizedOwner).to.be.equal(helper.address.normalizeSubstrate(bob.address)); const setSponsorTx = async () => collection.setSponsor(alice, charlie.address); const confirmSponsorshipTx = async () => collection.confirmSponsorship(alice); diff --git a/tests/src/createCollection.test.ts b/tests/src/createCollection.test.ts index f7bd03d073..0a3b3f22be 100644 --- a/tests/src/createCollection.test.ts +++ b/tests/src/createCollection.test.ts @@ -14,12 +14,12 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {usingPlaygrounds, expect, itSub, Pallets} from './util/playgrounds'; import {IKeyringPair} from '@polkadot/types/types'; +import {usingPlaygrounds, expect, itSub, Pallets} from './util/playgrounds'; import {ICollectionCreationOptions, IProperty} from './util/playgrounds/types'; -import {DevUniqueHelper} from './util/playgrounds/unique.dev'; +import {UniqueHelper} from './util/playgrounds/unique'; -async function mintCollectionHelper(helper: DevUniqueHelper, signer: IKeyringPair, options: ICollectionCreationOptions, type?: 'nft' | 'fungible' | 'refungible') { +async function mintCollectionHelper(helper: UniqueHelper, signer: IKeyringPair, options: ICollectionCreationOptions, type?: 'nft' | 'fungible' | 'refungible') { let collection; if (type === 'nft') { collection = await helper.nft.mintCollection(signer, options); @@ -29,7 +29,7 @@ async function mintCollectionHelper(helper: DevUniqueHelper, signer: IKeyringPai collection = await helper.rft.mintCollection(signer, options); } const data = await collection.getData(); - expect(data?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(signer.address)); + expect(data?.normalizedOwner).to.be.equal(helper.address.normalizeSubstrate(signer.address)); expect(data?.name).to.be.equal(options.name); expect(data?.description).to.be.equal(options.description); expect(data?.raw.tokenPrefix).to.be.equal(options.tokenPrefix); @@ -54,32 +54,27 @@ describe('integration test: ext. createCollection():', () => { }); }); itSub('Create new NFT collection', async ({helper}) => { - await mintCollectionHelper(helper, alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 'nft'); }); itSub('Create new NFT collection whith collection_name of maximum length (64 bytes)', async ({helper}) => { - await mintCollectionHelper(helper, alice, {name: 'A'.repeat(64), description: 'descr', tokenPrefix: 'COL'}, 'nft'); }); itSub('Create new NFT collection whith collection_description of maximum length (256 bytes)', async ({helper}) => { - await mintCollectionHelper(helper, alice, {name: 'name', description: 'A'.repeat(256), tokenPrefix: 'COL'}, 'nft'); }); itSub('Create new NFT collection whith token_prefix of maximum length (16 bytes)', async ({helper}) => { - await mintCollectionHelper(helper, alice, {name: 'name', description: 'descr', tokenPrefix: 'A'.repeat(16)}, 'nft'); }); - itSub('Create new Fungible collection', async ({helper}) => { + itSub('Create new Fungible collection', async ({helper}) => { await mintCollectionHelper(helper, alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 'fungible'); }); - itSub.ifWithPallets('Create new ReFungible collection', [Pallets.ReFungible], async ({helper}) => { + itSub.ifWithPallets('Create new ReFungible collection', [Pallets.ReFungible], async ({helper}) => { await mintCollectionHelper(helper, alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 'refungible'); }); itSub('create new collection with properties', async ({helper}) => { - await mintCollectionHelper(helper, alice, { name: 'name', description: 'descr', tokenPrefix: 'COL', properties: [{key: 'key1', value: 'val1'}], @@ -88,7 +83,6 @@ describe('integration test: ext. createCollection():', () => { }); itSub('Create new collection with extra fields', async ({helper}) => { - const collection = await mintCollectionHelper(helper, alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 'fungible'); await collection.setPermissions(alice, {access: 'AllowList'}); await collection.setLimits(alice, {accountTokenOwnershipLimit: 3}); @@ -96,7 +90,7 @@ describe('integration test: ext. createCollection():', () => { const limits = await collection.getEffectiveLimits(); const raw = data?.raw; - expect(data?.normalizedOwner).to.be.equal(helper.util.normalizeSubstrateAddress(alice.address)); + expect(data?.normalizedOwner).to.be.equal(helper.address.normalizeSubstrate(alice.address)); expect(data?.name).to.be.equal('name'); expect(data?.description).to.be.equal('descr'); expect(raw.permissions.access).to.be.equal('AllowList'); @@ -105,7 +99,6 @@ describe('integration test: ext. createCollection():', () => { }); itSub('New collection is not external', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}); const data = await collection.getData(); expect(data?.raw.readOnly).to.be.false; @@ -131,12 +124,11 @@ describe('(!negative test!) integration test: ext. createCollection():', () => { await expect(mintCollectionTx()).to.be.rejectedWith('Verification Error'); }); itSub('(!negative test!) create new NFT collection whith incorrect data (token_prefix)', async ({helper}) => { - const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'A'.repeat(17)}); await expect(mintCollectionTx()).to.be.rejectedWith('Verification Error'); }); + itSub('(!negative test!) fails when bad limits are set', async ({helper}) => { - const mintCollectionTx = async () => helper.nft.mintCollection(alice, {name: 'name', description: 'descr', tokenPrefix: 'COL', limits: {tokenLimit: 0}}); await expect(mintCollectionTx()).to.be.rejectedWith(/common\.CollectionTokenLimitExceeded/); }); diff --git a/tests/src/createItem.test.ts b/tests/src/createItem.test.ts index 4e7601bb69..04a41a10d8 100644 --- a/tests/src/createItem.test.ts +++ b/tests/src/createItem.test.ts @@ -15,24 +15,14 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; - -import { - createCollection, - itApi, - normalizeAccountId, - getCreateItemResult, - CrossAccountId, -} from './util/helpers'; - import {usingPlaygrounds, expect, itSub, Pallets} from './util/playgrounds'; -import {IProperty} from './util/playgrounds/types'; -import {executeTransaction} from './substrate/substrate-api'; -import {DevUniqueHelper} from './util/playgrounds/unique.dev'; +import {IProperty, ICrossAccountId} from './util/playgrounds/types'; +import {UniqueHelper} from './util/playgrounds/unique'; -async function mintTokenHelper(helper: DevUniqueHelper, collection: any, signer: IKeyringPair, owner: CrossAccountId, type: 'nft' | 'fungible' | 'refungible'='nft', properties?: IProperty[]) { +async function mintTokenHelper(helper: UniqueHelper, collection: any, signer: IKeyringPair, owner: ICrossAccountId, type: 'nft' | 'fungible' | 'refungible'='nft', properties?: IProperty[]) { let token; const itemCountBefore = await helper.collection.getLastTokenId(collection.collectionId); - const itemBalanceBefore = (await helper.api!.rpc.unique.balance(collection.collectionId, owner, 0)).toBigInt(); + const itemBalanceBefore = (await helper.callRpc('api.rpc.unique.balance', [collection.collectionId, owner, 0])).toBigInt(); if (type === 'nft') { token = await collection.mintToken(signer, owner, properties); } else if (type === 'fungible') { @@ -42,7 +32,7 @@ async function mintTokenHelper(helper: DevUniqueHelper, collection: any, signer: } const itemCountAfter = await helper.collection.getLastTokenId(collection.collectionId); - const itemBalanceAfter = (await helper.api!.rpc.unique.balance(collection.collectionId, owner, 0)).toBigInt(); + const itemBalanceAfter = (await helper.callRpc('api.rpc.unique.balance', [collection.collectionId, owner, 0])).toBigInt(); if (type === 'fungible') { expect(itemBalanceAfter - itemBalanceBefore).to.be.equal(10n); @@ -75,27 +65,22 @@ describe('integration test: ext. ():', () => { }); itSub('Check events on create new item in Fungible collection', async ({helper}) => { const {collectionId} = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}, 0); - const api = helper.api!; - - - const to = normalizeAccountId(alice); + const to = {Substrate: alice.address}; { const createData = {fungible: {value: 100}}; - const tx = api.tx.unique.createItem(collectionId, to, createData as any); - const events = await executeTransaction(api, alice, tx); - const result = getCreateItemResult(events); - expect(result.amount).to.be.equal(100); - expect(result.collectionId).to.be.equal(collectionId); - expect(result.recipient).to.be.deep.equal(to); + const events = await helper.executeExtrinsic(alice, 'api.tx.unique.createItem', [collectionId, to, createData as any]); + const result = helper.util.extractTokensFromCreationResult(events); + expect(result.tokens[0].amount).to.be.equal(100n); + expect(result.tokens[0].collectionId).to.be.equal(collectionId); + expect(result.tokens[0].owner).to.be.deep.equal(to); } { const createData = {fungible: {value: 50}}; - const tx = api.tx.unique.createItem(collectionId, to, createData as any); - const events = await executeTransaction(api, alice, tx); - const result = getCreateItemResult(events); - expect(result.amount).to.be.equal(50); - expect(result.collectionId).to.be.equal(collectionId); - expect(result.recipient).to.be.deep.equal(to); + const events = await helper.executeExtrinsic(alice, 'api.tx.unique.createItem', [collectionId, to, createData as any]); + const result = helper.util.extractTokensFromCreationResult(events); + expect(result.tokens[0].amount).to.be.equal(50n); + expect(result.tokens[0].collectionId).to.be.equal(collectionId); + expect(result.tokens[0].owner).to.be.deep.equal(to); } }); itSub.ifWithPallets('Create new item in ReFungible collection', [Pallets.ReFungible], async ({helper}) => { @@ -162,12 +147,12 @@ describe('integration test: ext. ():', () => { const amount = 1n; const token = await mintTokenHelper(helper, collection, alice, {Substrate: bob.address}); { - const totalPieces = await helper.api?.rpc.unique.totalPieces(collection.collectionId, token.tokenId); + const totalPieces = await helper.callRpc('api.rpc.unique.totalPieces', [collection.collectionId, token.tokenId]); expect(totalPieces?.unwrap().toBigInt()).to.be.equal(amount); } await token.transfer(bob, {Substrate: alice.address}); { - const totalPieces = await helper.api?.rpc.unique.totalPieces(collection.collectionId, token.tokenId); + const totalPieces = await helper.callRpc('api.rpc.unique.totalPieces', [collection.collectionId, token.tokenId]); expect(totalPieces?.unwrap().toBigInt()).to.be.equal(amount); } }); @@ -267,21 +252,21 @@ describe('Negative integration test: ext. createItem():', () => { itSub('Check total pieces for invalid Fungible token', async ({helper}) => { const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); const invalidTokenId = 1_000_000; - expect((await helper.api?.rpc.unique.totalPieces(collection.collectionId, invalidTokenId))?.isNone).to.be.true; - expect((await helper.api?.rpc.unique.tokenData(collection.collectionId, invalidTokenId))?.pieces.toBigInt()).to.be.equal(0n); + expect((await helper.callRpc('api.rpc.unique.totalPieces', [collection.collectionId, invalidTokenId]))?.isNone).to.be.true; + expect((await helper.callRpc('api.rpc.unique.tokenData', [collection.collectionId, invalidTokenId]))?.pieces.toBigInt()).to.be.equal(0n); }); itSub('Check total pieces for invalid NFT token', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const invalidTokenId = 1_000_000; - expect((await helper.api?.rpc.unique.totalPieces(collection.collectionId, invalidTokenId))?.isNone).to.be.true; - expect((await helper.api?.rpc.unique.tokenData(collection.collectionId, invalidTokenId))?.pieces.toBigInt()).to.be.equal(0n); + expect((await helper.callRpc('api.rpc.unique.totalPieces', [collection.collectionId, invalidTokenId]))?.isNone).to.be.true; + expect((await helper.callRpc('api.rpc.unique.tokenData', [collection.collectionId, invalidTokenId]))?.pieces.toBigInt()).to.be.equal(0n); }); itSub.ifWithPallets('Check total pieces for invalid Refungible token', [Pallets.ReFungible], async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const invalidTokenId = 1_000_000; - expect((await helper.api?.rpc.unique.totalPieces(collection.collectionId, invalidTokenId))?.isNone).to.be.true; - expect((await helper.api?.rpc.unique.tokenData(collection.collectionId, invalidTokenId))?.pieces.toBigInt()).to.be.equal(0n); + expect((await helper.callRpc('api.rpc.unique.totalPieces', [collection.collectionId, invalidTokenId]))?.isNone).to.be.true; + expect((await helper.callRpc('api.rpc.unique.tokenData', [collection.collectionId, invalidTokenId]))?.pieces.toBigInt()).to.be.equal(0n); }); }); diff --git a/tests/src/createMultipleItems.test.ts b/tests/src/createMultipleItems.test.ts index 6d0b0c6094..a11e234688 100644 --- a/tests/src/createMultipleItems.test.ts +++ b/tests/src/createMultipleItems.test.ts @@ -15,12 +15,8 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import { - normalizeAccountId, -} from './util/helpers'; import {usingPlaygrounds, expect, Pallets, itSub} from './util/playgrounds'; - describe('Integration Test createMultipleItems(collection_id, owner, items_data):', () => { let alice: IKeyringPair; @@ -48,7 +44,7 @@ describe('Integration Test createMultipleItems(collection_id, owner, items_data) const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); for (const [i, token] of tokens.entries()) { const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.util.normalizeSubstrateAddress(alice.address)}); + expect(tokenData?.normalizedOwner.Substrate).to.be.deep.equal(helper.address.normalizeSubstrate(alice.address)); expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); } }); @@ -116,7 +112,7 @@ describe('Integration Test createMultipleItems(collection_id, owner, items_data) const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); for (const [i, token] of tokens.entries()) { const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.util.normalizeSubstrateAddress(alice.address)}); + expect(tokenData?.normalizedOwner.Substrate).to.be.deep.equal(helper.address.normalizeSubstrate(alice.address)); expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); } }); @@ -138,7 +134,7 @@ describe('Integration Test createMultipleItems(collection_id, owner, items_data) const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); for (const [i, token] of tokens.entries()) { const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.util.normalizeSubstrateAddress(alice.address)}); + expect(tokenData?.normalizedOwner.Substrate).to.be.deep.equal(helper.address.normalizeSubstrate(alice.address)); expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); } }); @@ -160,7 +156,7 @@ describe('Integration Test createMultipleItems(collection_id, owner, items_data) const tokens = await helper.nft.mintMultipleTokensWithOneOwner(alice, collection.collectionId, {Substrate: alice.address}, args); for (const [i, token] of tokens.entries()) { const tokenData = await token.getData(); - expect(tokenData?.normalizedOwner).to.be.deep.equal({Substrate: helper.util.normalizeSubstrateAddress(alice.address)}); + expect(tokenData?.normalizedOwner.Substrate).to.be.equal(helper.address.normalizeSubstrate(alice.address)); expect(tokenData?.properties[0].value).to.be.equal(args[i].properties[0].value); } }); @@ -275,8 +271,11 @@ describe('Negative Integration Test createMultipleItems(collection_id, owner, it }); const types = ['NFT', 'Fungible', 'ReFungible']; - const mintTx = helper.api?.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), types); - await expect(helper.signTransaction(alice, mintTx)).to.be.rejected; + await expect(helper.executeExtrinsic( + alice, + 'api.tx.unique.createMultipleItems', + [collectionId, {Substrate: alice.address}, types], + )).to.be.rejectedWith(/nonfungible\.NotNonfungibleDataUsedToMintFungibleCollectionToken/); }); itSub('Create tokens with different data limits <> maximum data limit', async ({helper}) => { diff --git a/tests/src/creditFeesToTreasury.test.ts b/tests/src/creditFeesToTreasury.test.ts index d52c20aa33..0abb647ffb 100644 --- a/tests/src/creditFeesToTreasury.test.ts +++ b/tests/src/creditFeesToTreasury.test.ts @@ -16,11 +16,6 @@ import './interfaces/augment-api-consts'; import {IKeyringPair} from '@polkadot/types/types'; -import { - UNIQUE, -} from './util/helpers'; - -import {default as waitNewBlocks} from './substrate/wait-new-blocks'; import {ApiPromise} from '@polkadot/api'; import {usingPlaygrounds, expect, itSub} from './util/playgrounds'; @@ -63,7 +58,7 @@ describe('integration test: Fees must be credited to Treasury:', () => { itSub('Total issuance does not change', async ({helper}) => { const api = helper.api!; await skipInflationBlock(api); - await waitNewBlocks(api, 1); + await helper.wait.newBlocks(1); const totalBefore = (await api.query.balances.totalIssuance()).toBigInt(); @@ -75,9 +70,8 @@ describe('integration test: Fees must be credited to Treasury:', () => { }); itSub('Sender balance decreased by fee+sent amount, Treasury balance increased by fee', async ({helper}) => { - const api = helper.api!; - await skipInflationBlock(api); - await waitNewBlocks(api, 1); + await skipInflationBlock(helper.api!); + await helper.wait.newBlocks(1); const treasuryBalanceBefore = await helper.balance.getSubstrate(TREASURY); const aliceBalanceBefore = await helper.balance.getSubstrate(alice.address); @@ -96,7 +90,7 @@ describe('integration test: Fees must be credited to Treasury:', () => { itSub('Treasury balance increased by failed tx fee', async ({helper}) => { const api = helper.api!; - await waitNewBlocks(api, 1); + await helper.wait.newBlocks(1); const treasuryBalanceBefore = await helper.balance.getSubstrate(TREASURY); const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); @@ -113,9 +107,8 @@ describe('integration test: Fees must be credited to Treasury:', () => { }); itSub('NFT Transactions also send fees to Treasury', async ({helper}) => { - const api = helper.api!; - await skipInflationBlock(api); - await waitNewBlocks(api, 1); + await skipInflationBlock(helper.api!); + await helper.wait.newBlocks(1); const treasuryBalanceBefore = await helper.balance.getSubstrate(TREASURY); const aliceBalanceBefore = await helper.balance.getSubstrate(alice.address); @@ -131,9 +124,9 @@ describe('integration test: Fees must be credited to Treasury:', () => { }); itSub('Fees are sane', async ({helper}) => { - const api = helper.api!; - await skipInflationBlock(api); - await waitNewBlocks(api, 1); + const unique = helper.balance.getOneTokenNominal(); + await skipInflationBlock(helper.api!); + await helper.wait.newBlocks(1); const aliceBalanceBefore = await helper.balance.getSubstrate(alice.address); @@ -142,14 +135,13 @@ describe('integration test: Fees must be credited to Treasury:', () => { const aliceBalanceAfter = await helper.balance.getSubstrate(alice.address); const fee = aliceBalanceBefore - aliceBalanceAfter; - expect(fee / UNIQUE < BigInt(Math.ceil(saneMaximumFee + createCollectionDeposit))).to.be.true; - expect(fee / UNIQUE < BigInt(Math.ceil(saneMinimumFee + createCollectionDeposit))).to.be.true; + expect(fee / unique < BigInt(Math.ceil(saneMaximumFee + createCollectionDeposit))).to.be.true; + expect(fee / unique < BigInt(Math.ceil(saneMinimumFee + createCollectionDeposit))).to.be.true; }); itSub('NFT Transfer fee is close to 0.1 Unique', async ({helper}) => { - const api = helper.api!; - await skipInflationBlock(api); - await waitNewBlocks(api, 1); + await skipInflationBlock(helper.api!); + await helper.wait.newBlocks(1); const collection = await helper.nft.mintCollection(alice, { name: 'test', @@ -163,7 +155,7 @@ describe('integration test: Fees must be credited to Treasury:', () => { await token.transfer(alice, {Substrate: bob.address}); const aliceBalanceAfter = await helper.balance.getSubstrate(alice.address); - const fee = Number(aliceBalanceBefore - aliceBalanceAfter) / Number(UNIQUE); + const fee = Number(aliceBalanceBefore - aliceBalanceAfter) / Number(helper.balance.getOneTokenNominal()); const expectedTransferFee = 0.1; // fee drifts because of NextFeeMultiplier const tolerance = 0.001; diff --git a/tests/src/destroyCollection.test.ts b/tests/src/destroyCollection.test.ts index c432819f0d..a3ae9ceaed 100644 --- a/tests/src/destroyCollection.test.ts +++ b/tests/src/destroyCollection.test.ts @@ -15,10 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import { - Pallets, -} from './util/helpers'; -import {itSub, expect, usingPlaygrounds} from './util/playgrounds'; +import {itSub, expect, usingPlaygrounds, Pallets} from './util/playgrounds'; describe('integration test: ext. destroyCollection():', () => { let alice: IKeyringPair; diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index cc8dd0dfed..9e4c90083d 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -666,7 +666,6 @@ describe('Integration Test: Token Properties', () => { `on adding property #${i} by signer #${j}`, ).to.be.fulfilled; } - } const properties = await nestedToken.getProperties(propertyKeys); diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 60c0d58a2d..b52ae0ffcc 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -124,7 +124,7 @@ describe('integration test: Refungible functionality:', async () => { const token = await collection.mintToken(alice, 100n); expect(await collection.isTokenExists(token.tokenId)).to.be.true; expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); - expect((await token.burn(alice, 99n)).success).to.be.true; + expect(await token.burn(alice, 99n)).to.be.true; expect(await collection.isTokenExists(token.tokenId)).to.be.true; expect(await token.getBalance({Substrate: alice.address})).to.be.equal(1n); }); @@ -136,7 +136,7 @@ describe('integration test: Refungible functionality:', async () => { expect(await collection.isTokenExists(token.tokenId)).to.be.true; expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); - expect((await token.burn(alice, 100n)).success).to.be.true; + expect(await token.burn(alice, 100n)).to.be.true; expect(await collection.isTokenExists(token.tokenId)).to.be.false; }); @@ -152,17 +152,17 @@ describe('integration test: Refungible functionality:', async () => { expect(await token.getBalance({Substrate: alice.address})).to.be.equal(40n); expect(await token.getBalance({Substrate: bob.address})).to.be.equal(60n); - expect((await token.burn(alice, 40n)).success).to.be.true; + expect(await token.burn(alice, 40n)).to.be.true; expect(await collection.isTokenExists(token.tokenId)).to.be.true; expect(await token.getBalance({Substrate: alice.address})).to.be.equal(0n); - expect((await token.burn(bob, 59n)).success).to.be.true; + expect(await token.burn(bob, 59n)).to.be.true; expect(await token.getBalance({Substrate: bob.address})).to.be.equal(1n); expect(await collection.isTokenExists(token.tokenId)).to.be.true; - expect((await token.burn(bob, 1n)).success).to.be.true; + expect(await token.burn(bob, 1n)).to.be.true; expect(await collection.isTokenExists(token.tokenId)).to.be.false; }); diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index aba9ead3ae..28c30132d7 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -120,7 +120,7 @@ class UniqueUtil { return keyring.addFromUri(seed); } - static extractCollectionIdFromCreationResult(creationResult: ITransactionResult) { + static extractCollectionIdFromCreationResult(creationResult: ITransactionResult): number { if (creationResult.status !== this.transactionStatus.SUCCESS) { throw Error('Unable to create collection!'); } @@ -139,12 +139,15 @@ class UniqueUtil { return collectionId; } - static extractTokensFromCreationResult(creationResult: ITransactionResult) { + static extractTokensFromCreationResult(creationResult: ITransactionResult): { + success: boolean, + tokens: {collectionId: number, tokenId: number, owner: CrossAccountId, amount: bigint}[], + } { if (creationResult.status !== this.transactionStatus.SUCCESS) { throw Error('Unable to create tokens!'); } let success = false; - const tokens = [] as any; + const tokens = [] as {collectionId: number, tokenId: number, owner: CrossAccountId, amount: bigint}[]; creationResult.result.events.forEach(({event: {data, method, section}}) => { if (method === 'ExtrinsicSuccess') { success = true; @@ -152,19 +155,23 @@ class UniqueUtil { tokens.push({ collectionId: parseInt(data[0].toString(), 10), tokenId: parseInt(data[1].toString(), 10), - owner: data[2].toJSON(), + owner: data[2].toHuman(), + amount: data[3].toBigInt(), }); } }); return {success, tokens}; } - static extractTokensFromBurnResult(burnResult: ITransactionResult) { + static extractTokensFromBurnResult(burnResult: ITransactionResult): { + success: boolean, + tokens: {collectionId: number, tokenId: number, owner: CrossAccountId, amount: bigint}[], + } { if (burnResult.status !== this.transactionStatus.SUCCESS) { throw Error('Unable to burn tokens!'); } let success = false; - const tokens = [] as any; + const tokens = [] as {collectionId: number, tokenId: number, owner: CrossAccountId, amount: bigint}[]; burnResult.result.events.forEach(({event: {data, method, section}}) => { if (method === 'ExtrinsicSuccess') { success = true; @@ -172,14 +179,15 @@ class UniqueUtil { tokens.push({ collectionId: parseInt(data[0].toString(), 10), tokenId: parseInt(data[1].toString(), 10), - owner: data[2].toJSON(), + owner: data[2].toHuman(), + amount: data[3].toBigInt(), }); } }); return {success, tokens}; } - static findCollectionInEvents(events: {event: IEvent}[], collectionId: number, expectedSection: string, expectedMethod: string) { + static findCollectionInEvents(events: {event: IEvent}[], collectionId: number, expectedSection: string, expectedMethod: string): boolean { let eventId = null; events.forEach(({event: {data, method, section}}) => { if ((section === expectedSection) && (method === expectedMethod)) { @@ -1001,12 +1009,9 @@ class CollectionGroup extends HelperGroup { * @param tokenId ID of token * @param amount amount of tokens to be burned. For NFT must be set to 1n * @example burnToken(aliceKeyring, 10, 5); - * @returns ```true``` and burnt token number is extrinsic success. Otherwise ```false``` and ```null``` + * @returns ```true``` if the extrinsic is successful, otherwise ```false``` */ - async burnToken(signer: TSigner, collectionId: number, tokenId: number, amount=1n): Promise<{ - success: boolean, - token: number | null - }> { + async burnToken(signer: TSigner, collectionId: number, tokenId: number, amount=1n): Promise { const burnResult = await this.helper.executeExtrinsic( signer, 'api.tx.unique.burnItem', [collectionId, tokenId, amount], @@ -1014,7 +1019,7 @@ class CollectionGroup extends HelperGroup { ); const burnedTokens = this.helper.util.extractTokensFromBurnResult(burnResult); if (burnedTokens.tokens.length > 1) throw Error('Burned multiple tokens'); - return {success: burnedTokens.success, token: burnedTokens.tokens.length > 0 ? burnedTokens.tokens[0] : null}; + return burnedTokens.success; } /** @@ -1140,7 +1145,9 @@ class NFTnRFT extends CollectionGroup { if (tokenData === null || tokenData.owner === null) return null; const owner = {} as any; for (const key of Object.keys(tokenData.owner)) { - owner[key.toLocaleLowerCase()] = new CrossAccountId(tokenData.owner[key]).withNormalizedSubstrate(); + owner[key.toLocaleLowerCase()] = key.toLocaleLowerCase() == 'substrate' + ? CrossAccountId.normalizeSubstrateAddress(tokenData.owner[key]) + : tokenData.owner[key]; } tokenData.normalizedOwner = CrossAccountId.fromLowerCaseKeys(owner); return tokenData; @@ -1690,9 +1697,9 @@ class RFTGroup extends NFTnRFT { * @param tokenId ID of token * @param amount number of pieces to be burnt * @example burnToken(aliceKeyring, 10, 5); - * @returns ```true``` and burnt token number, if extrinsic is successful. Otherwise ```false``` and ```null``` + * @returns ```true``` if the extrinsic is successful, otherwise ```false``` */ - async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number, amount=1n): Promise<{ success: boolean; token: number | null; }> { + async burnToken(signer: IKeyringPair, collectionId: number, tokenId: number, amount=1n): Promise { return await super.burnToken(signer, collectionId, tokenId, amount); } @@ -1898,7 +1905,7 @@ class FTGroup extends CollectionGroup { * @returns ```true``` if extrinsic success, otherwise ```false``` */ async burnTokens(signer: IKeyringPair, collectionId: number, amount=1n): Promise { - return (await super.burnToken(signer, collectionId, 0, amount)).success; + return await super.burnToken(signer, collectionId, 0, amount); } /** From fea73f40565c1e9b96241d4a5068877abdc7ee80 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 30 Sep 2022 12:52:17 +0000 Subject: [PATCH 0990/1274] test: tests for contract fees --- pallets/nonfungible/src/lib.rs | 2 +- pallets/unique/src/eth/mod.rs | 1 + tests/src/eth/payable.test.ts | 146 ++++++++++++++++++++++++++++++++- 3 files changed, 147 insertions(+), 2 deletions(-) diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 204b20dde7..f474cb9e98 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -114,7 +114,7 @@ use pallet_structure::{Pallet as PalletStructure, Error as StructureError}; use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder}; use sp_core::H160; use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome}; -use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap, collections::btree_set::BTreeSet}; +use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap}; use core::ops::Deref; use codec::{Encode, Decode, MaxEncodedLen}; use scale_info::TypeInfo; diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 1e25c711c3..f9e3c6b85a 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -194,6 +194,7 @@ where fn create_nonfungible_collection( &mut self, caller: caller, + value: value, name: string, description: string, token_prefix: string, diff --git a/tests/src/eth/payable.test.ts b/tests/src/eth/payable.test.ts index a4815ce0cb..aa34c2e6fc 100644 --- a/tests/src/eth/payable.test.ts +++ b/tests/src/eth/payable.test.ts @@ -16,7 +16,7 @@ import {IKeyringPair} from '@polkadot/types/types'; -import {itEth, expect, usingEthPlaygrounds} from './util/playgrounds'; +import {itEth, expect, usingEthPlaygrounds, EthUniqueHelper} from './util/playgrounds'; describe('EVM payable contracts', () => { let donor: IKeyringPair; @@ -104,3 +104,147 @@ describe('EVM payable contracts', () => { } }); }); + +describe('EVM transaction fees', () => { + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_, privateKey) => { + donor = privateKey('//Alice'); + }); + }); + + itEth('Fee is withdrawn from the user', async({helper}) => { + const deployer = await helper.eth.createAccountWithBalance(donor); + const caller = await helper.eth.createAccountWithBalance(donor); + const contract = await helper.eth.deployFlipper(deployer); + + const initialCallerBalance = await helper.balance.getEthereum(caller); + await contract.methods.flip().send({from: caller}); + const finalCallerBalance = await helper.balance.getEthereum(caller); + expect(finalCallerBalance < initialCallerBalance).to.be.true; + }); + + itEth('Fee for nested calls is withdrawn from the user', async({helper}) => { + const deployer = await helper.eth.createAccountWithBalance(donor); + const caller = await helper.eth.createAccountWithBalance(donor); + const contract = await deployProxyContract(helper, deployer); + + const initialCallerBalance = await helper.balance.getEthereum(caller); + const initialContractBalance = await helper.balance.getEthereum(contract.options.address); + await contract.methods.flip().send({from: caller}); + const finalCallerBalance = await helper.balance.getEthereum(caller); + const finalContractBalance = await helper.balance.getEthereum(contract.options.address); + expect(finalCallerBalance < initialCallerBalance).to.be.true; + expect(finalContractBalance == initialContractBalance).to.be.true; + }); + + itEth('Fee for nested calls to native methods is withdrawn from the user', async({helper}) => { + const CONTRACT_BALANCE = 3n * helper.balance.getOneTokenNominal(); + + const deployer = await helper.eth.createAccountWithBalance(donor); + const caller = await helper.eth.createAccountWithBalance(donor); + const contract = await deployProxyContract(helper, deployer); + + const web3 = helper.getWeb3(); + await web3.eth.sendTransaction({from: deployer, to: contract.options.address, value: CONTRACT_BALANCE.toString(), gas: helper.eth.DEFAULT_GAS}); + + const collectionAddress = (await contract.methods.createNonfungibleCollection().send({from: caller})).events.CollectionCreated.returnValues.collection; + const initialCallerBalance = await helper.balance.getEthereum(caller); + const initialContractBalance = await helper.balance.getEthereum(contract.options.address); + await contract.methods.mintNftToken(collectionAddress).send({from: caller}); + const finalCallerBalance = await helper.balance.getEthereum(caller); + const finalContractBalance = await helper.balance.getEthereum(contract.options.address); + expect(finalCallerBalance < initialCallerBalance).to.be.true; + expect(finalContractBalance == initialContractBalance).to.be.true; + }); + + itEth('Fee for nested calls to create*Collection methods is withdrawn from the user and from the contract', async({helper}) => { + const CONTRACT_BALANCE = 3n * helper.balance.getOneTokenNominal(); + + const deployer = await helper.eth.createAccountWithBalance(donor); + const caller = await helper.eth.createAccountWithBalance(donor); + const contract = await deployProxyContract(helper, deployer); + + const web3 = helper.getWeb3(); + await web3.eth.sendTransaction({from: deployer, to: contract.options.address, value: CONTRACT_BALANCE.toString(), gas: helper.eth.DEFAULT_GAS}); + + const initialCallerBalance = await helper.balance.getEthereum(caller); + const initialContractBalance = await helper.balance.getEthereum(contract.options.address); + await contract.methods.createNonfungibleCollection().send({from: caller}); + const finalCallerBalance = await helper.balance.getEthereum(caller); + const finalContractBalance = await helper.balance.getEthereum(contract.options.address); + expect(finalCallerBalance < initialCallerBalance).to.be.true; + expect(finalContractBalance < initialContractBalance).to.be.true; + }); + + async function deployProxyContract(helper: EthUniqueHelper, deployer: string) { + return await helper.ethContract.deployByCode( + deployer, + 'ProxyContract', + ` + // SPDX-License-Identifier: UNLICENSED + pragma solidity ^0.8.6; + + import {CollectionHelpers} from "../api/CollectionHelpers.sol"; + import {UniqueNFT} from "../api/UniqueNFT.sol"; + + contract ProxyContract { + bool value = false; + address flipper; + + event CollectionCreated(address collection); + event TokenMinted(uint256 tokenId); + + receive() external payable {} + + constructor() { + flipper = address(new Flipper()); + } + + function flip() public { + value = !value; + Flipper(flipper).flip(); + } + + function createNonfungibleCollection() public { + address collectionHelpers = 0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F; + address nftCollection = CollectionHelpers(collectionHelpers).createNonfungibleCollection("A", "B", "C"); + emit CollectionCreated(nftCollection); + } + + function mintNftToken(address collectionAddress) public { + UniqueNFT collection = UniqueNFT(collectionAddress); + uint256 tokenId = collection.nextTokenId(); + collection.mint(msg.sender, tokenId); + emit TokenMinted(tokenId); + } + + function getValue() public view returns (bool) { + return Flipper(flipper).getValue(); + } + } + + contract Flipper { + bool value = false; + function flip() public { + value = !value; + } + function getValue() public view returns (bool) { + return value; + } + } + `, + [ + { + solPath: 'api/CollectionHelpers.sol', + fsPath: `${__dirname}/api/CollectionHelpers.sol`, + }, + { + solPath: 'api/UniqueNFT.sol', + fsPath: `${__dirname}/api/UniqueNFT.sol`, + }, + ], + ); + } +}); From c9c7549767f0dba49c94b79754f0d7ddad10f2e0 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 30 Sep 2022 12:52:17 +0000 Subject: [PATCH 0991/1274] feature: make collection creation methods `payable` --- .../procedural/src/solidity_interface.rs | 23 +++++++--- crates/evm-coder/src/solidity.rs | 4 ++ pallets/common/src/dispatch.rs | 1 + pallets/common/src/lib.rs | 3 +- pallets/foreign-assets/src/lib.rs | 5 +- pallets/fungible/src/lib.rs | 5 +- pallets/nonfungible/src/lib.rs | 2 + pallets/proxy-rmrk-core/src/lib.rs | 2 +- pallets/proxy-rmrk-equip/src/lib.rs | 2 +- pallets/refungible/src/lib.rs | 3 +- pallets/unique/src/eth/mod.rs | 43 +++++++++++++++--- .../src/eth/stubs/CollectionHelpers.raw | Bin 1488 -> 1501 bytes .../src/eth/stubs/CollectionHelpers.sol | 8 ++-- pallets/unique/src/lib.rs | 4 +- runtime/common/dispatch.rs | 7 +-- tests/src/eth/api/CollectionHelpers.sol | 8 ++-- tests/src/eth/collectionHelpersAbi.json | 8 ++-- .../src/eth/fractionalizer/Fractionalizer.sol | 14 +++--- tests/src/eth/payable.test.ts | 31 ++++++------- 19 files changed, 112 insertions(+), 61 deletions(-) diff --git a/crates/evm-coder/procedural/src/solidity_interface.rs b/crates/evm-coder/procedural/src/solidity_interface.rs index 9863c44b74..fa24ac848b 100644 --- a/crates/evm-coder/procedural/src/solidity_interface.rs +++ b/crates/evm-coder/procedural/src/solidity_interface.rs @@ -560,6 +560,7 @@ struct Method { selector: u32, args: Vec, has_normal_args: bool, + has_value_args: bool, mutability: Mutability, result: Type, weight: Option, @@ -647,14 +648,20 @@ impl Method { .unwrap_or_else(|| cases::camelcase::to_camel_case(&ident.to_string())); let mut selector_str = camel_name.clone(); selector_str.push('('); - let mut has_normal_args = false; - for (i, arg) in args.iter().filter(|arg| !arg.is_special()).enumerate() { - if i != 0 { - selector_str.push(','); + let mut normal_args_count = 0u32; + let mut has_value_args = false; + for arg in args.iter() { + if arg.is_value() { + has_value_args = true; + } else if !arg.is_special() { + if normal_args_count != 0 { + selector_str.push(','); + } + write!(selector_str, "{}", arg.selector_ty()).unwrap(); + normal_args_count = normal_args_count.saturating_add(1); } - write!(selector_str, "{}", arg.selector_ty()).unwrap(); - has_normal_args = true; } + let has_normal_args = normal_args_count > 0; selector_str.push(')'); let selector = fn_selector_str(&selector_str); @@ -667,6 +674,7 @@ impl Method { selector, args, has_normal_args, + has_value_args, mutability, result: result.clone(), weight, @@ -823,7 +831,7 @@ impl Method { let docs = &self.docs; let selector_str = &self.selector_str; let selector = self.selector; - + let is_payable = self.has_value_args; quote! { SolidityFunction { docs: &[#(#docs),*], @@ -831,6 +839,7 @@ impl Method { selector: #selector, name: #camel_name, mutability: #mutability, + is_payable: #is_payable, args: ( #( #args, diff --git a/crates/evm-coder/src/solidity.rs b/crates/evm-coder/src/solidity.rs index d0cb5c80e2..bad3ff1520 100644 --- a/crates/evm-coder/src/solidity.rs +++ b/crates/evm-coder/src/solidity.rs @@ -422,6 +422,7 @@ pub struct SolidityFunction { pub args: A, pub result: R, pub mutability: SolidityMutability, + pub is_payable: bool, } impl SolidityFunctions for SolidityFunction { fn solidity_name( @@ -452,6 +453,9 @@ impl SolidityFunctions for SolidityF SolidityMutability::View => write!(writer, " view")?, SolidityMutability::Mutable => {} } + if self.is_payable { + write!(writer, " payable")?; + } if !self.result.is_empty() { write!(writer, " returns (")?; self.result.solidity_name(writer, tc)?; diff --git a/pallets/common/src/dispatch.rs b/pallets/common/src/dispatch.rs index d38cddfd71..7f6b78baa9 100644 --- a/pallets/common/src/dispatch.rs +++ b/pallets/common/src/dispatch.rs @@ -78,6 +78,7 @@ pub trait CollectionDispatch { /// * `data` - Description of the created collection. fn create( sender: T::CrossAccountId, + payer: T::CrossAccountId, data: CreateCollectionData, ) -> Result; diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index cb7c49e5e6..e0aa7f5002 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -866,6 +866,7 @@ impl Pallet { /// * `flags` - Extra flags to store. pub fn init_collection( owner: T::CrossAccountId, + payer: T::CrossAccountId, data: CreateCollectionData, flags: CollectionFlags, ) -> Result { @@ -939,7 +940,7 @@ impl Pallet { ), ); ::Currency::settle( - owner.as_sub(), + payer.as_sub(), imbalance, WithdrawReasons::TRANSFER, ExistenceRequirement::KeepAlive, diff --git a/pallets/foreign-assets/src/lib.rs b/pallets/foreign-assets/src/lib.rs index 9b8d320a24..5afa834e43 100644 --- a/pallets/foreign-assets/src/lib.rs +++ b/pallets/foreign-assets/src/lib.rs @@ -309,9 +309,10 @@ pub mod module { mode: CollectionMode::Fungible(md.decimals), ..Default::default() }; - + let owner = T::CrossAccountId::from_sub(owner); let bounded_collection_id = >::init_foreign_collection( - CrossAccountId::from_sub(owner), + owner.clone(), + owner, data, )?; let foreign_asset_id = diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index edb122278f..41cb1a9b11 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -210,18 +210,21 @@ impl Pallet { /// Initializes the collection. Returns [CollectionId] on success, [DispatchError] otherwise. pub fn init_collection( owner: T::CrossAccountId, + payer: T::CrossAccountId, data: CreateCollectionData, ) -> Result { - >::init_collection(owner, data, CollectionFlags::default()) + >::init_collection(owner, payer, data, CollectionFlags::default()) } /// Initializes the collection with ForeignCollection flag. Returns [CollectionId] on success, [DispatchError] otherwise. pub fn init_foreign_collection( owner: T::CrossAccountId, + payer: T::CrossAccountId, data: CreateCollectionData, ) -> Result { let id = >::init_collection( owner, + payer, data, CollectionFlags { foreign: true, diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index f474cb9e98..d7cbb4226a 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -405,11 +405,13 @@ impl Pallet { /// - `data`: Contains settings for collection limits and permissions. pub fn init_collection( owner: T::CrossAccountId, + payer: T::CrossAccountId, data: CreateCollectionData, is_external: bool, ) -> Result { >::init_collection( owner, + payer, data, CollectionFlags { external: is_external, diff --git a/pallets/proxy-rmrk-core/src/lib.rs b/pallets/proxy-rmrk-core/src/lib.rs index 79a52f3bd2..2b2dd9c8f3 100644 --- a/pallets/proxy-rmrk-core/src/lib.rs +++ b/pallets/proxy-rmrk-core/src/lib.rs @@ -1448,7 +1448,7 @@ impl Pallet { data: CreateCollectionData, properties: impl Iterator, ) -> Result { - let collection_id = >::init_collection(sender, data, true); + let collection_id = >::init_collection(sender.clone(), sender, data, true); if let Err(DispatchError::Arithmetic(_)) = &collection_id { return Err(>::NoAvailableCollectionId.into()); diff --git a/pallets/proxy-rmrk-equip/src/lib.rs b/pallets/proxy-rmrk-equip/src/lib.rs index e1e36e349e..553c636438 100644 --- a/pallets/proxy-rmrk-equip/src/lib.rs +++ b/pallets/proxy-rmrk-equip/src/lib.rs @@ -251,7 +251,7 @@ pub mod pallet { }; let collection_id_res = - >::init_collection(cross_sender.clone(), data, true); + >::init_collection(cross_sender.clone(), cross_sender.clone(), data, true); if let Err(DispatchError::Arithmetic(_)) = &collection_id_res { return Err(>::NoAvailableBaseId.into()); diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index b9bf5b9054..52bd85f1d7 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -373,9 +373,10 @@ impl Pallet { /// - `data`: Contains settings for collection limits and permissions. pub fn init_collection( owner: T::CrossAccountId, + payer: T::CrossAccountId, data: CreateCollectionData, ) -> Result { - >::init_collection(owner, data, CollectionFlags::default()) + >::init_collection(owner, payer, data, CollectionFlags::default()) } /// Destroy RFT collection diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index f9e3c6b85a..ddd894fe43 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -28,7 +28,7 @@ use pallet_common::{ static_property::{key, value as property_value}, }, }; -use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder}; +use pallet_evm_coder_substrate::{dispatch_to_evm, SubstrateRecorder, WithRecorder}; use pallet_evm::{account::CrossAccountId, OnMethodCall, PrecompileHandle, PrecompileResult}; use up_data_structs::{ CollectionName, CollectionDescription, CollectionTokenPrefix, CreateCollectionData, @@ -156,6 +156,7 @@ fn create_refungible_collection_internal< T: Config + pallet_nonfungible::Config + pallet_refungible::Config, >( caller: caller, + value: value, name: string, description: string, token_prefix: string, @@ -172,8 +173,16 @@ fn create_refungible_collection_internal< base_uri_value, add_properties, )?; + let value = value.as_u128(); + let creation_price: Result = T::CollectionCreationPrice::get() + .try_into() + .map_err(|_| "collection creation price should be convertible to u128".into()); + if value != creation_price? { + return Err("Sent amount not equals to collection creation price".into()); + } + let collection_helpers_address = T::CrossAccountId::from_eth(::ContractAddress::get()); - let collection_id = T::CollectionDispatch::create(caller.clone(), data) + let collection_id = T::CollectionDispatch::create(caller.clone(), collection_helpers_address, data) .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; let address = pallet_common::eth::collection_id_to_address(collection_id); Ok(address) @@ -183,7 +192,7 @@ fn create_refungible_collection_internal< #[solidity_interface(name = CollectionHelpers, events(CollectionHelpersEvents))] impl EvmCollectionHelpers where - T: Config + pallet_nonfungible::Config + pallet_refungible::Config, + T: Config + pallet_common::Config + pallet_nonfungible::Config + pallet_refungible::Config, { /// Create an NFT collection /// @param name Name of the collection @@ -209,8 +218,17 @@ where Default::default(), false, )?; - let collection_id = T::CollectionDispatch::create(caller, data) - .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; + let value = value.as_u128(); + let creation_price: Result = T::CollectionCreationPrice::get() + .try_into() + .map_err(|_| "collection creation price should be convertible to u128".into()); + let creation_price = creation_price?; + if value != creation_price { + return Err(format!("Sent amount not equals to collection creation price ({0})", creation_price).into()); + } + let collection_helpers_address = T::CrossAccountId::from_eth(::ContractAddress::get()); + let collection_id = + T::CollectionDispatch::create(caller, collection_helpers_address, data).map_err(dispatch_to_evm::)?; let address = pallet_common::eth::collection_id_to_address(collection_id); Ok(address) @@ -221,6 +239,7 @@ where fn create_nonfungible_collection_with_properties( &mut self, caller: caller, + value: value, name: string, description: string, token_prefix: string, @@ -236,7 +255,15 @@ where base_uri_value, true, )?; - let collection_id = T::CollectionDispatch::create(caller, data) + let value = value.as_u128(); + let creation_price: Result = T::CollectionCreationPrice::get() + .try_into() + .map_err(|_| "collection creation price should be convertible to u128".into()); + if value != creation_price? { + return Err("Sent amount not equals to collection creation price".into()); + } + let collection_helpers_address = T::CrossAccountId::from_eth(::ContractAddress::get()); + let collection_id = T::CollectionDispatch::create(caller, collection_helpers_address, data) .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; let address = pallet_common::eth::collection_id_to_address(collection_id); @@ -248,12 +275,14 @@ where fn create_refungible_collection( &mut self, caller: caller, + value: value, name: string, description: string, token_prefix: string, ) -> Result
{ create_refungible_collection_internal::( caller, + value, name, description, token_prefix, @@ -267,6 +296,7 @@ where fn create_refungible_collection_with_properties( &mut self, caller: caller, + value: value, name: string, description: string, token_prefix: string, @@ -274,6 +304,7 @@ where ) -> Result
{ create_refungible_collection_internal::( caller, + value, name, description, token_prefix, diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index 0499e178e4b4b45e4d99621b78b5336591d7876d..f0376d2b3c3c4819d0ebf1dae4df215ed1f2bc20 100644 GIT binary patch delta 734 zcmZXRL1@%K6ozLq*-|V*wrtXtT{J3+9u$RUK?GR@OQ|R^)T9`ZHwbzWJgr49n@O^} zEnc!2_26YaDE4X*6a)otMMR|@ysWHe!Arr5)OE7itgFsr4)fmk-aqrthl$RF0$r$B zZ~#2Utcd2GKUD&JXxgK=4d^(atzY0JfLvB6y5ImZpj+~;;NHfQ0!0`320poK)>A3E zDr(-gYf^NZqG}mrie=lS=nJ2g_Tta{gtWg@x7|Mb{y&!N2dQTv|ug~s1~(pZ|O(&S38iYY#0yZ21co7iZX{mIh7jF=q~cTK2_5DOV$ z4+(Apj1brJDPmITR?}ZebodUrRC|!7gMV+eo=tq!4EnU~3QfK7=T@IGqB|snW@Uu< zkx3HL@SEw=TBaE%A)HSPKi7Ah>`uvn;}45uV0fBNNH4Geg^LWZ&q~6WK=UYBa-bGy zvFX+Wg%L`sd`sRpA3K1>cab%Rl1-u0n`vmi6{;%aiax$?rdf1{S)fNcAh*F3m6CT3 zTMT_{MRgpBe<08J<=h_q&8f3-XKMb@&87J3nDlXBZSHMn`SIr5YQFrsy8bQV?cA~7 D#|8)z delta 698 zcmZ9JO=#3W6vt;W$w5{jTe@vwE2e%_JrpdM6_H&R1VKcc2H6~P@J&@(s#ih0Y$n;w zu85FiS}z{_09jBEtw-^o2dg4N{XlvVD(JzB2nEGMtrOF1O9$rg-uv<1|Nq|S+(J%= zC8%033@+zZ$g~G@x{pgam*Lxh4g*^L3$6qXx&?-G8<4x=P*6)cL*p_sVQJ7khgV;B zdKsD!PjMyB&{c*mmq2Cccg9B$1T~syToFLv?KYc=0WKD{>1| z%+QZ0WMscAR>$0kgewVUcn#81V0ep|Rr>Lec%_UOr&BrHoLF6Zu9uh0lr2BQ`$T~l z+hZBTGN?IR+VHs*fYEGYoPZC7Ma=q_v`u4kn?GruDO%gVh8eEZoEZv63!4%BKS(KN z#NIA3O`*DhC}+fpE+Htu2I6czMJQ7)wY+vZC!#c-iKb~xlNGtrKQw~Gzj7m`{Y_$( z``MtmmcQ0SN-=_Uu`e^?Lzj?Js=?qo^1UnNSKzf0DdMi$KhTq=xhZdj;ZBk8KHkgZ z5f;=P`I9!({l1twO<(7Pk;z!wwXJCbmI%3JGcqp@XocbV#K?7dU?VgDIRV!Tj6AdX znTCh0u!%#tVbT#7wIRcX-AC2uPwrLTZ+-FU@yAm?%ZFy8(evdCi=CUxBVQNABW?5_ DUF-Y* diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.sol b/pallets/unique/src/eth/stubs/CollectionHelpers.sol index 478abbdf6c..0fcb32a52d 100644 --- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol +++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol @@ -36,7 +36,7 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory name, string memory description, string memory tokenPrefix - ) public returns (address) { + ) public payable returns (address) { require(false, stub_error); name; description; @@ -52,7 +52,7 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory description, string memory tokenPrefix, string memory baseUri - ) public returns (address) { + ) public payable returns (address) { require(false, stub_error); name; description; @@ -68,7 +68,7 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory name, string memory description, string memory tokenPrefix - ) public returns (address) { + ) public payable returns (address) { require(false, stub_error); name; description; @@ -84,7 +84,7 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory description, string memory tokenPrefix, string memory baseUri - ) public returns (address) { + ) public payable returns (address) { require(false, stub_error); name; description; diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index 7c2cbcf785..b21ec08b22 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -344,8 +344,8 @@ decl_module! { let sender = ensure_signed(origin)?; // ========= - - let _id = T::CollectionDispatch::create(T::CrossAccountId::from_sub(sender), data)?; + let sender = T::CrossAccountId::from_sub(sender); + let _id = T::CollectionDispatch::create(sender.clone(), sender, data)?; Ok(()) } diff --git a/runtime/common/dispatch.rs b/runtime/common/dispatch.rs index 9b14c7d2aa..0052a3e1ac 100644 --- a/runtime/common/dispatch.rs +++ b/runtime/common/dispatch.rs @@ -55,21 +55,22 @@ where { fn create( sender: T::CrossAccountId, + payer: T::CrossAccountId, data: CreateCollectionData, ) -> Result { let id = match data.mode { - CollectionMode::NFT => >::init_collection(sender, data, false)?, + CollectionMode::NFT => >::init_collection(sender, payer, data, false)?, CollectionMode::Fungible(decimal_points) => { // check params ensure!( decimal_points <= MAX_DECIMAL_POINTS, pallet_unique::Error::::CollectionDecimalPointLimitExceeded ); - >::init_collection(sender, data)? + >::init_collection(sender, payer, data)? } #[cfg(feature = "refungible")] - CollectionMode::ReFungible => >::init_collection(sender, data)?, + CollectionMode::ReFungible => >::init_collection(sender, payer, data)?, #[cfg(not(feature = "refungible"))] CollectionMode::ReFungible => return unsupported!(T), diff --git a/tests/src/eth/api/CollectionHelpers.sol b/tests/src/eth/api/CollectionHelpers.sol index db8f21d307..74c6371c8b 100644 --- a/tests/src/eth/api/CollectionHelpers.sol +++ b/tests/src/eth/api/CollectionHelpers.sol @@ -31,7 +31,7 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory name, string memory description, string memory tokenPrefix - ) external returns (address); + ) external payable returns (address); /// @dev EVM selector for this function is: 0xa634a5f9, /// or in textual repr: createERC721MetadataCompatibleCollection(string,string,string,string) @@ -40,7 +40,7 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory description, string memory tokenPrefix, string memory baseUri - ) external returns (address); + ) external payable returns (address); /// @dev EVM selector for this function is: 0xab173450, /// or in textual repr: createRFTCollection(string,string,string) @@ -48,7 +48,7 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory name, string memory description, string memory tokenPrefix - ) external returns (address); + ) external payable returns (address); /// @dev EVM selector for this function is: 0xa5596388, /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string) @@ -57,7 +57,7 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory description, string memory tokenPrefix, string memory baseUri - ) external returns (address); + ) external payable returns (address); /// Check if a collection exists /// @param collectionAddress Address of the collection in question diff --git a/tests/src/eth/collectionHelpersAbi.json b/tests/src/eth/collectionHelpersAbi.json index b2d1aa6d04..248d006491 100644 --- a/tests/src/eth/collectionHelpersAbi.json +++ b/tests/src/eth/collectionHelpersAbi.json @@ -27,7 +27,7 @@ ], "name": "createERC721MetadataCompatibleCollection", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "nonpayable", + "stateMutability": "payable", "type": "function" }, { @@ -39,7 +39,7 @@ ], "name": "createERC721MetadataCompatibleRFTCollection", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "nonpayable", + "stateMutability": "payable", "type": "function" }, { @@ -50,7 +50,7 @@ ], "name": "createNonfungibleCollection", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "nonpayable", + "stateMutability": "payable", "type": "function" }, { @@ -61,7 +61,7 @@ ], "name": "createRFTCollection", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "nonpayable", + "stateMutability": "payable", "type": "function" }, { diff --git a/tests/src/eth/fractionalizer/Fractionalizer.sol b/tests/src/eth/fractionalizer/Fractionalizer.sol index 2a99376b8b..3add7e341e 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.sol +++ b/tests/src/eth/fractionalizer/Fractionalizer.sol @@ -18,7 +18,8 @@ contract Fractionalizer { mapping(address => bool) nftCollectionAllowList; mapping(address => mapping(uint256 => uint256)) public nft2rftMapping; mapping(address => Token) public rft2nftMapping; - bytes32 refungibleCollectionType = keccak256(bytes("ReFungible")); + //use constant to reduce gas cost + bytes32 constant refungibleCollectionType = keccak256(bytes("ReFungible")); receive() external payable onlyOwner {} @@ -51,11 +52,12 @@ contract Fractionalizer { /// Throws if `msg.sender` is not owner or admin of provided RFT collection. /// Can only be called by contract owner. /// @param _collection address of RFT collection. - function setRFTCollection(address _collection) public onlyOwner { + function setRFTCollection(address _collection) external onlyOwner { require(rftCollection == address(0), "RFT collection is already set"); UniqueRefungible refungibleContract = UniqueRefungible(_collection); string memory collectionType = refungibleContract.uniqueCollectionType(); + // compare hashed to reduce gas cost require( keccak256(bytes(collectionType)) == refungibleCollectionType, "Wrong collection type. Collection is not refungible." @@ -79,7 +81,7 @@ contract Fractionalizer { string calldata _name, string calldata _description, string calldata _tokenPrefix - ) public onlyOwner { + ) external onlyOwner { require(rftCollection == address(0), "RFT collection is already set"); address collectionHelpers = 0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F; rftCollection = CollectionHelpers(collectionHelpers).createRFTCollection(_name, _description, _tokenPrefix); @@ -90,7 +92,7 @@ contract Fractionalizer { /// @dev Can only be called by contract owner. /// @param collection NFT token address. /// @param status `true` to allow and `false` to disallow NFT token. - function setNftCollectionIsAllowed(address collection, bool status) public onlyOwner { + function setNftCollectionIsAllowed(address collection, bool status) external onlyOwner { nftCollectionAllowList[collection] = status; emit AllowListSet(collection, status); } @@ -109,7 +111,7 @@ contract Fractionalizer { address _collection, uint256 _token, uint128 _pieces - ) public { + ) external { require(rftCollection != address(0), "RFT collection is not set"); UniqueRefungible rftCollectionContract = UniqueRefungible(rftCollection); require( @@ -148,7 +150,7 @@ contract Fractionalizer { /// Throws if `msg.sender` isn't owner of all RFT token pieces. /// @param _collection RFT collection address /// @param _token id of RFT token - function rft2nft(address _collection, uint256 _token) public { + function rft2nft(address _collection, uint256 _token) external { require(rftCollection != address(0), "RFT collection is not set"); require(rftCollection == _collection, "Wrong RFT collection"); UniqueRefungible rftCollectionContract = UniqueRefungible(rftCollection); diff --git a/tests/src/eth/payable.test.ts b/tests/src/eth/payable.test.ts index aa34c2e6fc..bae10dff6d 100644 --- a/tests/src/eth/payable.test.ts +++ b/tests/src/eth/payable.test.ts @@ -140,16 +140,13 @@ describe('EVM transaction fees', () => { }); itEth('Fee for nested calls to native methods is withdrawn from the user', async({helper}) => { - const CONTRACT_BALANCE = 3n * helper.balance.getOneTokenNominal(); + const CONTRACT_BALANCE = 2n * helper.balance.getOneTokenNominal(); const deployer = await helper.eth.createAccountWithBalance(donor); const caller = await helper.eth.createAccountWithBalance(donor); const contract = await deployProxyContract(helper, deployer); - - const web3 = helper.getWeb3(); - await web3.eth.sendTransaction({from: deployer, to: contract.options.address, value: CONTRACT_BALANCE.toString(), gas: helper.eth.DEFAULT_GAS}); - const collectionAddress = (await contract.methods.createNonfungibleCollection().send({from: caller})).events.CollectionCreated.returnValues.collection; + const collectionAddress = (await contract.methods.createNonfungibleCollection().send({from: caller, value: Number(CONTRACT_BALANCE)})).events.CollectionCreated.returnValues.collection; const initialCallerBalance = await helper.balance.getEthereum(caller); const initialContractBalance = await helper.balance.getEthereum(contract.options.address); await contract.methods.mintNftToken(collectionAddress).send({from: caller}); @@ -160,22 +157,18 @@ describe('EVM transaction fees', () => { }); itEth('Fee for nested calls to create*Collection methods is withdrawn from the user and from the contract', async({helper}) => { - const CONTRACT_BALANCE = 3n * helper.balance.getOneTokenNominal(); - + const CONTRACT_BALANCE = 2n * helper.balance.getOneTokenNominal(); const deployer = await helper.eth.createAccountWithBalance(donor); const caller = await helper.eth.createAccountWithBalance(donor); const contract = await deployProxyContract(helper, deployer); - - const web3 = helper.getWeb3(); - await web3.eth.sendTransaction({from: deployer, to: contract.options.address, value: CONTRACT_BALANCE.toString(), gas: helper.eth.DEFAULT_GAS}); const initialCallerBalance = await helper.balance.getEthereum(caller); const initialContractBalance = await helper.balance.getEthereum(contract.options.address); - await contract.methods.createNonfungibleCollection().send({from: caller}); + await contract.methods.createNonfungibleCollection().send({from: caller, value: Number(CONTRACT_BALANCE)}); const finalCallerBalance = await helper.balance.getEthereum(caller); const finalContractBalance = await helper.balance.getEthereum(contract.options.address); expect(finalCallerBalance < initialCallerBalance).to.be.true; - expect(finalContractBalance < initialContractBalance).to.be.true; + expect(finalContractBalance == initialContractBalance).to.be.true; }); async function deployProxyContract(helper: EthUniqueHelper, deployer: string) { @@ -189,6 +182,8 @@ describe('EVM transaction fees', () => { import {CollectionHelpers} from "../api/CollectionHelpers.sol"; import {UniqueNFT} from "../api/UniqueNFT.sol"; + error Value(uint256 value); + contract ProxyContract { bool value = false; address flipper; @@ -207,30 +202,30 @@ describe('EVM transaction fees', () => { Flipper(flipper).flip(); } - function createNonfungibleCollection() public { + function createNonfungibleCollection() external payable { address collectionHelpers = 0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F; - address nftCollection = CollectionHelpers(collectionHelpers).createNonfungibleCollection("A", "B", "C"); + address nftCollection = CollectionHelpers(collectionHelpers).createNonfungibleCollection{value: msg.value}("A", "B", "C"); emit CollectionCreated(nftCollection); } - function mintNftToken(address collectionAddress) public { + function mintNftToken(address collectionAddress) external { UniqueNFT collection = UniqueNFT(collectionAddress); uint256 tokenId = collection.nextTokenId(); collection.mint(msg.sender, tokenId); emit TokenMinted(tokenId); } - function getValue() public view returns (bool) { + function getValue() external view returns (bool) { return Flipper(flipper).getValue(); } } contract Flipper { bool value = false; - function flip() public { + function flip() external { value = !value; } - function getValue() public view returns (bool) { + function getValue() external view returns (bool) { return value; } } From 57eaceedfd432ed227c1b98fc80aca4cf36a1fc5 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 30 Sep 2022 12:52:17 +0000 Subject: [PATCH 0992/1274] chore: fix code review requests --- .../procedural/src/solidity_interface.rs | 19 ++++------ pallets/unique/src/eth/mod.rs | 37 ++++++++----------- 2 files changed, 22 insertions(+), 34 deletions(-) diff --git a/crates/evm-coder/procedural/src/solidity_interface.rs b/crates/evm-coder/procedural/src/solidity_interface.rs index fa24ac848b..ecb4b66b6b 100644 --- a/crates/evm-coder/procedural/src/solidity_interface.rs +++ b/crates/evm-coder/procedural/src/solidity_interface.rs @@ -648,20 +648,15 @@ impl Method { .unwrap_or_else(|| cases::camelcase::to_camel_case(&ident.to_string())); let mut selector_str = camel_name.clone(); selector_str.push('('); - let mut normal_args_count = 0u32; - let mut has_value_args = false; - for arg in args.iter() { - if arg.is_value() { - has_value_args = true; - } else if !arg.is_special() { - if normal_args_count != 0 { - selector_str.push(','); - } - write!(selector_str, "{}", arg.selector_ty()).unwrap(); - normal_args_count = normal_args_count.saturating_add(1); + let mut has_normal_args = false; + for (i, arg) in args.iter().filter(|arg| !arg.is_special()).enumerate() { + if i != 0 { + selector_str.push(','); } + write!(selector_str, "{}", arg.selector_ty()).unwrap(); + has_normal_args = true; } - let has_normal_args = normal_args_count > 0; + let has_value_args = args.iter().any(|a| a.is_value()); selector_str.push(')'); let selector = fn_selector_str(&selector_str); diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index ddd894fe43..a1360b5817 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -173,13 +173,7 @@ fn create_refungible_collection_internal< base_uri_value, add_properties, )?; - let value = value.as_u128(); - let creation_price: Result = T::CollectionCreationPrice::get() - .try_into() - .map_err(|_| "collection creation price should be convertible to u128".into()); - if value != creation_price? { - return Err("Sent amount not equals to collection creation price".into()); - } + check_sent_amount_equals_collection_creation_price::(value)?; let collection_helpers_address = T::CrossAccountId::from_eth(::ContractAddress::get()); let collection_id = T::CollectionDispatch::create(caller.clone(), collection_helpers_address, data) @@ -188,6 +182,18 @@ fn create_refungible_collection_internal< Ok(address) } +fn check_sent_amount_equals_collection_creation_price(value: value) -> Result<()> { + let value = value.as_u128(); + let creation_price: u128 = T::CollectionCreationPrice::get() + .try_into() + .map_err(|_| ()) // workaround for `expect` requiring `Debug` trait + .expect("Collection creation price should be convertible to u128"); + if value != creation_price { + return Err(format!("Sent amount not equals to collection creation price ({0})", creation_price).into()); + } + Ok(()) +} + /// @title Contract, which allows users to operate with collections #[solidity_interface(name = CollectionHelpers, events(CollectionHelpersEvents))] impl EvmCollectionHelpers @@ -218,14 +224,7 @@ where Default::default(), false, )?; - let value = value.as_u128(); - let creation_price: Result = T::CollectionCreationPrice::get() - .try_into() - .map_err(|_| "collection creation price should be convertible to u128".into()); - let creation_price = creation_price?; - if value != creation_price { - return Err(format!("Sent amount not equals to collection creation price ({0})", creation_price).into()); - } + check_sent_amount_equals_collection_creation_price::(value)?; let collection_helpers_address = T::CrossAccountId::from_eth(::ContractAddress::get()); let collection_id = T::CollectionDispatch::create(caller, collection_helpers_address, data).map_err(dispatch_to_evm::)?; @@ -255,13 +254,7 @@ where base_uri_value, true, )?; - let value = value.as_u128(); - let creation_price: Result = T::CollectionCreationPrice::get() - .try_into() - .map_err(|_| "collection creation price should be convertible to u128".into()); - if value != creation_price? { - return Err("Sent amount not equals to collection creation price".into()); - } + check_sent_amount_equals_collection_creation_price::(value)?; let collection_helpers_address = T::CrossAccountId::from_eth(::ContractAddress::get()); let collection_id = T::CollectionDispatch::create(caller, collection_helpers_address, data) .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; From 624d2812f7d4a84f7947d88391e2f3d1ecbacfb7 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 27 Sep 2022 10:13:26 +0000 Subject: [PATCH 0993/1274] chore: fix tests --- tests/src/eth/collectionAdmin.test.ts | 22 +++++++++---------- tests/src/eth/collectionSponsoring.test.ts | 10 ++++----- tests/src/eth/createNFTCollection.test.ts | 13 ++++++----- tests/src/eth/createRFTCollection.test.ts | 13 ++++++----- .../src/eth/fractionalizer/Fractionalizer.sol | 4 ++-- .../eth/fractionalizer/fractionalizer.test.ts | 8 +++---- tests/src/eth/nonFungible.test.ts | 3 ++- tests/src/eth/proxy/nonFungibleProxy.test.ts | 4 ++-- tests/src/eth/reFungibleToken.test.ts | 3 ++- tests/src/eth/util/helpers.ts | 4 ++-- tests/src/eth/util/playgrounds/unique.dev.ts | 10 +++++---- tests/src/util/playgrounds/unique.ts | 3 +++ 12 files changed, 52 insertions(+), 45 deletions(-) diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index 95b8129050..2df14de6db 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -30,10 +30,10 @@ describe('Add collection admins', () => { itWeb3('Add admin by owner', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelper = evmCollectionHelpers(web3, owner); - + const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') - .send(); + .send({value: Number(2n * UNIQUE)}); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const newAdmin = createEthAccount(web3); @@ -69,7 +69,7 @@ describe('Add collection admins', () => { const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') - .send(); + .send({value: Number(2n * UNIQUE)}); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const newAdmin = createEthAccount(web3); @@ -85,7 +85,7 @@ describe('Add collection admins', () => { const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') - .send(); + .send({value: Number(2n * UNIQUE)}); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const admin = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -108,7 +108,7 @@ describe('Add collection admins', () => { const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') - .send(); + .send({value: Number(2n * UNIQUE)}); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const notAdmin = await createEthAccountWithBalance(api, web3, privateKeyWrapper); @@ -174,7 +174,7 @@ describe('Remove collection admins', () => { const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') - .send(); + .send({value: Number(2n * UNIQUE)}); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const newAdmin = createEthAccount(web3); @@ -222,7 +222,7 @@ describe('Remove collection admins', () => { const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') - .send(); + .send({value: Number(2n * UNIQUE)}); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); @@ -249,7 +249,7 @@ describe('Remove collection admins', () => { const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') - .send(); + .send({value: Number(2n * UNIQUE)}); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); @@ -326,7 +326,7 @@ describe('Change owner tests', () => { const collectionHelper = evmCollectionHelpers(web3, owner); const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') - .send(); + .send({value: Number(2n * UNIQUE)}); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); @@ -342,7 +342,7 @@ describe('Change owner tests', () => { const collectionHelper = evmCollectionHelpers(web3, owner); const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') - .send(); + .send({value: Number(2n * UNIQUE)}); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); @@ -357,7 +357,7 @@ describe('Change owner tests', () => { const collectionHelper = evmCollectionHelpers(web3, owner); const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') - .send(); + .send({value: Number(2n * UNIQUE)}); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index 5c0240c8b9..c8fc4737cf 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -1,10 +1,8 @@ -import {addToAllowListExpectSuccess, bigIntToSub, confirmSponsorshipExpectSuccess, createCollectionExpectSuccess, enablePublicMintingExpectSuccess, getDetailedCollectionInfo, setCollectionSponsorExpectSuccess} from '../util/helpers'; +import {addToAllowListExpectSuccess, confirmSponsorshipExpectSuccess, createCollectionExpectSuccess, enablePublicMintingExpectSuccess, getDetailedCollectionInfo, setCollectionSponsorExpectSuccess, UNIQUE} from '../util/helpers'; import {itWeb3, createEthAccount, collectionIdToAddress, GAS_ARGS, normalizeEvents, createEthAccountWithBalance, evmCollectionHelpers, getCollectionAddressFromResult, evmCollection, ethBalanceViaSub} from './util/helpers'; import nonFungibleAbi from './nonFungibleAbi.json'; import {expect} from 'chai'; import {evmToAddress} from '@polkadot/util-crypto'; -import {submitTransactionAsync} from '../substrate/substrate-api'; -import getBalance from '../substrate/get-balance'; describe('evm collection sponsoring', () => { itWeb3('sponsors mint transactions', async ({web3, privateKeyWrapper}) => { @@ -64,7 +62,7 @@ describe('evm collection sponsoring', () => { itWeb3('Remove sponsor', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelpers = evmCollectionHelpers(web3, owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * UNIQUE)}); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); @@ -85,7 +83,7 @@ describe('evm collection sponsoring', () => { itWeb3('Sponsoring collection from evm address via access list', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelpers = evmCollectionHelpers(web3, owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * UNIQUE)}); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); @@ -210,7 +208,7 @@ describe('evm collection sponsoring', () => { itWeb3('Check that transaction via EVM spend money from sponsor address', async ({api, web3, privateKeyWrapper}) => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionHelpers = evmCollectionHelpers(web3, owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * UNIQUE)}); const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const collectionEvm = evmCollection(web3, owner, collectionIdAddress); diff --git a/tests/src/eth/createNFTCollection.test.ts b/tests/src/eth/createNFTCollection.test.ts index c69a5be129..79d38fac07 100644 --- a/tests/src/eth/createNFTCollection.test.ts +++ b/tests/src/eth/createNFTCollection.test.ts @@ -17,6 +17,7 @@ import {evmToAddress} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {UNIQUE} from '../util/helpers'; describe('Create NFT collection from EVM', () => { let donor: IKeyringPair; @@ -64,7 +65,7 @@ describe('Create NFT collection from EVM', () => { await collectionHelpers.methods .createNonfungibleCollection('A', 'A', 'A') - .send(); + .send({value: Number(2n * UNIQUE)}); expect(await collectionHelpers.methods .isCollectionExist(expectedCollectionAddress) @@ -164,7 +165,7 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { await expect(collectionHelper.methods .createNonfungibleCollection(collectionName, description, tokenPrefix) - .call()).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH); + .call({value: Number(2n * UNIQUE)})).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH); } { @@ -174,7 +175,7 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { const tokenPrefix = 'A'; await expect(collectionHelper.methods .createNonfungibleCollection(collectionName, description, tokenPrefix) - .call()).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH); + .call({value: Number(2n * UNIQUE)})).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH); } { const MAX_TOKEN_PREFIX_LENGTH = 16; @@ -183,16 +184,16 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGTH + 1); await expect(collectionHelper.methods .createNonfungibleCollection(collectionName, description, tokenPrefix) - .call()).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH); + .call({value: Number(2n * UNIQUE)})).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH); } }); itEth('(!negative test!) Create collection (no funds)', async ({helper}) => { - const owner = helper.eth.createAccount(); + const owner = await helper.eth.createAccountWithBalance(donor); const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); await expect(collectionHelper.methods .createNonfungibleCollection('Peasantry', 'absolutely anything', 'CVE') - .call()).to.be.rejectedWith('NotSufficientFounds'); + .call({value: Number(1n * UNIQUE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); }); itEth('(!negative test!) Check owner', async ({helper}) => { diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts index b3dcdef68e..dca382b410 100644 --- a/tests/src/eth/createRFTCollection.test.ts +++ b/tests/src/eth/createRFTCollection.test.ts @@ -18,6 +18,7 @@ import {evmToAddress} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; import {Pallets, requirePalletsOrSkip} from '../util/playgrounds'; import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {UNIQUE} from '../util/helpers'; describe('Create RFT collection from EVM', () => { let donor: IKeyringPair; @@ -65,7 +66,7 @@ describe('Create RFT collection from EVM', () => { await collectionHelpers.methods .createRFTCollection('A', 'A', 'A') - .send(); + .send({value: Number(2n * UNIQUE)}); expect(await collectionHelpers.methods .isCollectionExist(expectedCollectionAddress) @@ -166,7 +167,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { await expect(collectionHelper.methods .createRFTCollection(collectionName, description, tokenPrefix) - .call()).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH); + .call({value: Number(2n * UNIQUE)})).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH); } { const MAX_DESCRIPTION_LENGTH = 256; @@ -175,7 +176,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { const tokenPrefix = 'A'; await expect(collectionHelper.methods .createRFTCollection(collectionName, description, tokenPrefix) - .call()).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH); + .call({value: Number(2n * UNIQUE)})).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH); } { const MAX_TOKEN_PREFIX_LENGTH = 16; @@ -184,16 +185,16 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGTH + 1); await expect(collectionHelper.methods .createRFTCollection(collectionName, description, tokenPrefix) - .call()).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH); + .call({value: Number(2n * UNIQUE)})).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH); } }); itEth('(!negative test!) Create collection (no funds)', async ({helper}) => { - const owner = helper.eth.createAccount(); + const owner = await helper.eth.createAccountWithBalance(donor); const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); await expect(collectionHelper.methods .createRFTCollection('Peasantry', 'absolutely anything', 'TWIW') - .call()).to.be.rejectedWith('NotSufficientFounds'); + .call({value: Number(1n * UNIQUE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); }); itEth('(!negative test!) Check owner', async ({helper}) => { diff --git a/tests/src/eth/fractionalizer/Fractionalizer.sol b/tests/src/eth/fractionalizer/Fractionalizer.sol index 3add7e341e..29f40621ac 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.sol +++ b/tests/src/eth/fractionalizer/Fractionalizer.sol @@ -81,10 +81,10 @@ contract Fractionalizer { string calldata _name, string calldata _description, string calldata _tokenPrefix - ) external onlyOwner { + ) external payable onlyOwner { require(rftCollection == address(0), "RFT collection is already set"); address collectionHelpers = 0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F; - rftCollection = CollectionHelpers(collectionHelpers).createRFTCollection(_name, _description, _tokenPrefix); + rftCollection = CollectionHelpers(collectionHelpers).createRFTCollection{value: msg.value}(_name, _description, _tokenPrefix); emit RFTCollectionSet(rftCollection); } diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index f43df017c4..0058e8e3dc 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -93,7 +93,7 @@ async function initFractionalizer(api: ApiPromise, web3: Web3, privateKeyWrapper const fractionalizer = await deployFractionalizer(web3, owner); const amount = 10n * UNIQUE; await web3.eth.sendTransaction({from: owner, to: fractionalizer.options.address, value: `${amount}`, ...GAS_ARGS}); - const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send(); + const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({value: Number(2n * UNIQUE)}); const rftCollectionAddress = result.events.RFTCollectionSet.returnValues._collection; return {fractionalizer, rftCollectionAddress}; } @@ -141,9 +141,9 @@ describe('Fractionalizer contract usage', () => { const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const fractionalizer = await deployFractionalizer(web3, owner); const tx = api.tx.balances.transfer(evmToAddress(fractionalizer.options.address), 10n * UNIQUE); - await submitTransactionAsync(alice, tx); + await executeTransaction(api, alice, tx); - const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({from: owner}); + const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({from: owner, value: Number(2n * UNIQUE)}); expect(result.events).to.be.like({ RFTCollectionSet: {}, }); @@ -295,7 +295,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const tx = api.tx.balances.transfer(evmToAddress(fractionalizer.options.address), 10n * UNIQUE); await submitTransactionAsync(alice, tx); - const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({from: owner}); + const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({from: owner, value: Number(2n * UNIQUE)}); const collectionIdAddress = result.events.RFTCollectionSet.returnValues._collection; await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 26c0f280cf..823e2e4182 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -17,6 +17,7 @@ import {itEth, usingEthPlaygrounds, expect, EthUniqueHelper} from './util/playgrounds'; import {IKeyringPair} from '@polkadot/types/types'; import {Contract} from 'web3-eth-contract'; +import {UNIQUE} from '../util/helpers'; describe('NFT: Information getting', () => { let donor: IKeyringPair; @@ -83,7 +84,7 @@ describe('Check ERC721 token URI for NFT', () => { const receiver = helper.eth.createAccount(); const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelper.methods.createERC721MetadataCompatibleCollection('Mint collection', 'a', 'b', tokenPrefix).send(); + let result = await collectionHelper.methods.createERC721MetadataCompatibleCollection('Mint collection', 'a', 'b', tokenPrefix).send({value: Number(2n * UNIQUE)}); const collectionAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); diff --git a/tests/src/eth/proxy/nonFungibleProxy.test.ts b/tests/src/eth/proxy/nonFungibleProxy.test.ts index 428e9a76de..ad4551740c 100644 --- a/tests/src/eth/proxy/nonFungibleProxy.test.ts +++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {createCollectionExpectSuccess, createItemExpectSuccess} from '../../util/helpers'; +import {createCollectionExpectSuccess, createItemExpectSuccess, UNIQUE} from '../../util/helpers'; import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents} from '../util/helpers'; import nonFungibleAbi from '../nonFungibleAbi.json'; import {expect} from 'chai'; @@ -93,7 +93,7 @@ describe('NFT (Via EVM proxy): Plain calls', () => { const collectionHelper = evmCollectionHelpers(web3, owner); const result = await collectionHelper.methods .createNonfungibleCollection('A', 'A', 'A') - .send(); + .send({value: Number(2n * UNIQUE)}); const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); const receiver = createEthAccount(web3); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 0e0793238a..bb6a0c570b 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -18,6 +18,7 @@ import {Pallets, requirePalletsOrSkip} from '../util/playgrounds'; import {EthUniqueHelper, expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; import {IKeyringPair} from '@polkadot/types/types'; import {Contract} from 'web3-eth-contract'; +import {UNIQUE} from '../util/helpers'; describe('Refungible token: Information getting', () => { let donor: IKeyringPair; @@ -80,7 +81,7 @@ describe('Check ERC721 token URI for ReFungible', () => { const receiver = helper.eth.createAccount(); const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelper.methods.createERC721MetadataCompatibleCollection('Mint collection', 'a', 'b', tokenPrefix).send(); + let result = await collectionHelper.methods.createERC721MetadataCompatibleCollection('Mint collection', 'a', 'b', tokenPrefix).send({value: Number(2n * UNIQUE)}); const collectionAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); diff --git a/tests/src/eth/util/helpers.ts b/tests/src/eth/util/helpers.ts index 533307b740..52d9c6964f 100644 --- a/tests/src/eth/util/helpers.ts +++ b/tests/src/eth/util/helpers.ts @@ -145,7 +145,7 @@ export async function createRFTCollection(api: ApiPromise, web3: Web3, owner: st const collectionHelper = evmCollectionHelpers(web3, owner); const result = await collectionHelper.methods .createRFTCollection('A', 'B', 'C') - .send(); + .send({value: Number(2n * UNIQUE)}); return await getCollectionAddressFromResult(api, result); } @@ -154,7 +154,7 @@ export async function createNonfungibleCollection(api: ApiPromise, web3: Web3, o const collectionHelper = evmCollectionHelpers(web3, owner); const result = await collectionHelper.methods .createNonfungibleCollection('A', 'B', 'C') - .send(); + .send({value: Number(2n * UNIQUE)}); return await getCollectionAddressFromResult(api, result); } diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index c310ead38a..67c6af02cf 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -170,9 +170,10 @@ class EthGroup extends EthGroupBase { } async createNonfungibleCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{collectionId: number, collectionAddress: string}> { + const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice(); const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); - - const result = await collectionHelper.methods.createNonfungibleCollection(name, description, tokenPrefix).send(); + + const result = await collectionHelper.methods.createNonfungibleCollection(name, description, tokenPrefix).send({value: Number(collectionCreationPrice)}); const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress); @@ -181,9 +182,10 @@ class EthGroup extends EthGroupBase { } async createRefungibleCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{collectionId: number, collectionAddress: string}> { + const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice(); const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); - - const result = await collectionHelper.methods.createRFTCollection(name, description, tokenPrefix).send(); + + const result = await collectionHelper.methods.createRFTCollection(name, description, tokenPrefix).send({value: Number(collectionCreationPrice)}); const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress); diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 657742e011..774ae7ce01 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -2034,6 +2034,9 @@ class ChainGroup extends HelperGroup { class BalanceGroup extends HelperGroup { + getCollectionCreationPrice(): bigint { + return 2n * this.helper.balance.getOneTokenNominal(); + } /** * Representation of the native token in the smallest unit - one OPAL (OPL), QUARTZ (QTZ), or UNIQUE (UNQ). * @example getOneTokenNominal() From 413ee1397f1dc85d06c0cb096a90134733688e37 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 27 Sep 2022 10:13:26 +0000 Subject: [PATCH 0994/1274] chore: cargo fmt --- pallets/foreign-assets/src/lib.rs | 7 ++----- pallets/proxy-rmrk-equip/src/lib.rs | 8 ++++++-- pallets/unique/src/eth/mod.rs | 32 +++++++++++++++++++++-------- runtime/common/dispatch.rs | 4 +++- 4 files changed, 35 insertions(+), 16 deletions(-) diff --git a/pallets/foreign-assets/src/lib.rs b/pallets/foreign-assets/src/lib.rs index 5afa834e43..6bbd5ca88f 100644 --- a/pallets/foreign-assets/src/lib.rs +++ b/pallets/foreign-assets/src/lib.rs @@ -310,11 +310,8 @@ pub mod module { ..Default::default() }; let owner = T::CrossAccountId::from_sub(owner); - let bounded_collection_id = >::init_foreign_collection( - owner.clone(), - owner, - data, - )?; + let bounded_collection_id = + >::init_foreign_collection(owner.clone(), owner, data)?; let foreign_asset_id = Self::do_register_foreign_asset(&location, &metadata, bounded_collection_id)?; diff --git a/pallets/proxy-rmrk-equip/src/lib.rs b/pallets/proxy-rmrk-equip/src/lib.rs index 553c636438..57b1ccb210 100644 --- a/pallets/proxy-rmrk-equip/src/lib.rs +++ b/pallets/proxy-rmrk-equip/src/lib.rs @@ -250,8 +250,12 @@ pub mod pallet { ..Default::default() }; - let collection_id_res = - >::init_collection(cross_sender.clone(), cross_sender.clone(), data, true); + let collection_id_res = >::init_collection( + cross_sender.clone(), + cross_sender.clone(), + data, + true, + ); if let Err(DispatchError::Arithmetic(_)) = &collection_id_res { return Err(>::NoAvailableBaseId.into()); diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index a1360b5817..fd76cf17da 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -174,10 +174,12 @@ fn create_refungible_collection_internal< add_properties, )?; check_sent_amount_equals_collection_creation_price::(value)?; - let collection_helpers_address = T::CrossAccountId::from_eth(::ContractAddress::get()); + let collection_helpers_address = + T::CrossAccountId::from_eth(::ContractAddress::get()); - let collection_id = T::CollectionDispatch::create(caller.clone(), collection_helpers_address, data) - .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; + let collection_id = + T::CollectionDispatch::create(caller.clone(), collection_helpers_address, data) + .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; let address = pallet_common::eth::collection_id_to_address(collection_id); Ok(address) } @@ -189,7 +191,11 @@ fn check_sent_amount_equals_collection_creation_price(value: value) - .map_err(|_| ()) // workaround for `expect` requiring `Debug` trait .expect("Collection creation price should be convertible to u128"); if value != creation_price { - return Err(format!("Sent amount not equals to collection creation price ({0})", creation_price).into()); + return Err(format!( + "Sent amount not equals to collection creation price ({0})", + creation_price + ) + .into()); } Ok(()) } @@ -225,9 +231,10 @@ where false, )?; check_sent_amount_equals_collection_creation_price::(value)?; - let collection_helpers_address = T::CrossAccountId::from_eth(::ContractAddress::get()); - let collection_id = - T::CollectionDispatch::create(caller, collection_helpers_address, data).map_err(dispatch_to_evm::)?; + let collection_helpers_address = + T::CrossAccountId::from_eth(::ContractAddress::get()); + let collection_id = T::CollectionDispatch::create(caller, collection_helpers_address, data) + .map_err(dispatch_to_evm::)?; let address = pallet_common::eth::collection_id_to_address(collection_id); Ok(address) @@ -255,7 +262,8 @@ where true, )?; check_sent_amount_equals_collection_creation_price::(value)?; - let collection_helpers_address = T::CrossAccountId::from_eth(::ContractAddress::get()); + let collection_helpers_address = + T::CrossAccountId::from_eth(::ContractAddress::get()); let collection_id = T::CollectionDispatch::create(caller, collection_helpers_address, data) .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; @@ -317,6 +325,14 @@ where Ok(false) } + + fn collection_creation_fee(&self) -> Result { + let price: u128 = T::CollectionCreationPrice::get() + .try_into() + .map_err(|_| ()) // workaround for `expect` requiring `Debug` trait + .expect("Collection creation price should be convertible to u128"); + Ok(price.into()) + } } /// Implements [`OnMethodCall`], which delegates call to [`EvmCollectionHelpers`] diff --git a/runtime/common/dispatch.rs b/runtime/common/dispatch.rs index 0052a3e1ac..bd0446b7f5 100644 --- a/runtime/common/dispatch.rs +++ b/runtime/common/dispatch.rs @@ -59,7 +59,9 @@ where data: CreateCollectionData, ) -> Result { let id = match data.mode { - CollectionMode::NFT => >::init_collection(sender, payer, data, false)?, + CollectionMode::NFT => { + >::init_collection(sender, payer, data, false)? + } CollectionMode::Fungible(decimal_points) => { // check params ensure!( From 9309104302007a434f6698deace5bdbbb9f2bc84 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 27 Sep 2022 10:13:26 +0000 Subject: [PATCH 0995/1274] chore: add `collectionCreationFee` method to CollectionHelpers --- .../src/eth/stubs/CollectionHelpers.raw | Bin 1501 -> 1563 bytes .../src/eth/stubs/CollectionHelpers.sol | 10 +++++++++- tests/src/eth/api/CollectionHelpers.sol | 6 +++++- tests/src/eth/collectionHelpersAbi.json | 7 +++++++ tests/src/eth/payable.test.ts | 5 +++++ tests/src/eth/util/playgrounds/unique.dev.ts | 5 +++++ 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index f0376d2b3c3c4819d0ebf1dae4df215ed1f2bc20..803617208127e5e97a96c49118d3705d204ab534 100644 GIT binary patch delta 895 zcmZ9KPiPZC6vk(EHh8ElNl8*6t*#XGqM(oz>M2SQQIKgUS!F4_F`$AT#6K4=+1X8# z6fc`>qM!%up%$wLOA$SI>qQTN;K@r%r7Bn|6pKp1Sl?!ow04(;Z)Se`zHi>lV%MX+ zL0E=l3J!rOWy%qOpL0Q*X49sikAVyW+4u{l2dG0qL2l?k60qEFW}f%Oc}S4+x-Y|m z)KM-hg)1nRP<}XZcMjzy%9XQMN16Z-vtgJSy7hhr$9HgP`eLStau(&&`1EE|8bGqh z#m$Hy5)DyvL8^i{L!b(JDs2ebpEe*l>O>+k1se6VSz^wHA;_B+r$n0wP<)@nm{W>2 zQ9-8g|7~g^?HjHBXEg3Pv2*?!4Yb#2Pse$?7!Y(wj$S$)tHGBT&Z|_=;gTcR?PdZm zSOfP2nw4X{5kbe?mr5VK?!HrwY7hO=GI3?A^_W%&nO8b~g5Gi?OdD9l!6FXQhQyPw zWhxKaM3GVt{N<)tJgXe>>*RLTQAYfEq41(TiMb}zMwNqBpotQ1Iw_ai#LW&-;gH-x z6x&3lL%1AZ2a%oi5iXS11*_=$lsGR}OBG(`*al)^10a|88lZgiX?u6r^|sNUg54^D zQM7y~EbDC%Y=4KqD9M2xNW2||oy=PWFN!;*_U#+@r)8pjA!JmB1)f4(JrKIDL)MO# zxiMh}B@=AE92o4b>p&4>1;iTI1B35QnuEkUP&90juW2dn^y3Wj zv5G0ka>azgkf*A$3_1<8)neWn-nkcnpE?LoJnyHO*U~zuAa3w{L@D)3nDqX?B(@6; z2tHjHx>QUrz_&CS#Ars4-z`tDe8)aWT@NtbuCZQKP|aUeQuMIj!wy}%5PHho<&Dk5 zvXjV+8+Zwt3kzl(3Yh^{tf=E43f+zr&+U^mL0kao70or{8AHJnWotfIUB%6^Q9l`R6R6!vx@ zKcgy)xppI{;(v~%`ZM8J=As`#YO+t@2ihIaB!>;CI$E2XbtfU2U}OHV`2NAR0TdZF zYY4W8@31l8YIeD%st`}x^fnKtx*|hA{sfR0P&-};nefpad mr`t=Z!3Wod+h2N=52e}SyQT4&#o|OV|9Wihhv$EfANdPkNI3fd diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.sol b/pallets/unique/src/eth/stubs/CollectionHelpers.sol index 0fcb32a52d..8e7423b725 100644 --- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol +++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol @@ -23,7 +23,7 @@ contract CollectionHelpersEvents { } /// @title Contract, which allows users to operate with collections -/// @dev the ERC-165 identifier for this interface is 0x88ee8ef1 +/// @dev the ERC-165 identifier for this interface is 0x5ad4f440 contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { /// Create an NFT collection /// @param name Name of the collection @@ -105,4 +105,12 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { dummy; return false; } + + /// @dev EVM selector for this function is: 0xd23a7ab1, + /// or in textual repr: collectionCreationFee() + function collectionCreationFee() public view returns (uint256) { + require(false, stub_error); + dummy; + return 0; + } } diff --git a/tests/src/eth/api/CollectionHelpers.sol b/tests/src/eth/api/CollectionHelpers.sol index 74c6371c8b..7d198e8a99 100644 --- a/tests/src/eth/api/CollectionHelpers.sol +++ b/tests/src/eth/api/CollectionHelpers.sol @@ -18,7 +18,7 @@ interface CollectionHelpersEvents { } /// @title Contract, which allows users to operate with collections -/// @dev the ERC-165 identifier for this interface is 0x88ee8ef1 +/// @dev the ERC-165 identifier for this interface is 0x5ad4f440 interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { /// Create an NFT collection /// @param name Name of the collection @@ -65,4 +65,8 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { /// @dev EVM selector for this function is: 0xc3de1494, /// or in textual repr: isCollectionExist(address) function isCollectionExist(address collectionAddress) external view returns (bool); + + /// @dev EVM selector for this function is: 0xd23a7ab1, + /// or in textual repr: collectionCreationFee() + function collectionCreationFee() external view returns (uint256); } diff --git a/tests/src/eth/collectionHelpersAbi.json b/tests/src/eth/collectionHelpersAbi.json index 248d006491..9c00df3da6 100644 --- a/tests/src/eth/collectionHelpersAbi.json +++ b/tests/src/eth/collectionHelpersAbi.json @@ -18,6 +18,13 @@ "name": "CollectionCreated", "type": "event" }, + { + "inputs": [], + "name": "collectionCreationFee", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "string", "name": "name", "type": "string" }, diff --git a/tests/src/eth/payable.test.ts b/tests/src/eth/payable.test.ts index bae10dff6d..69b09010b3 100644 --- a/tests/src/eth/payable.test.ts +++ b/tests/src/eth/payable.test.ts @@ -171,6 +171,11 @@ describe('EVM transaction fees', () => { expect(finalContractBalance == initialContractBalance).to.be.true; }); + itEth('Get collection creation fee', async({helper}) => { + const deployer = await helper.eth.createAccountWithBalance(donor); + expect(await helper.eth.getCollectionCreationFee(deployer)).to.be.equal(String(2n * helper.balance.getOneTokenNominal())); + }); + async function deployProxyContract(helper: EthUniqueHelper, deployer: string) { return await helper.ethContract.deployByCode( deployer, diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index 67c6af02cf..6714bf0047 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -152,6 +152,11 @@ class EthGroup extends EthGroupBase { async transferBalanceFromSubstrate(donor: IKeyringPair, recepient: string, amount=1000n, inTokens=true) { return await this.helper.balance.transferToSubstrate(donor, evmToAddress(recepient), amount * (inTokens ? this.helper.balance.getOneTokenNominal() : 1n)); } + + async getCollectionCreationFee(signer: string) { + const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); + return await collectionHelper.methods.collectionCreationFee().call(); + } async sendEVM(signer: IKeyringPair, contractAddress: string, abi: string, value: string, gasLimit?: number) { if(!gasLimit) gasLimit = this.DEFAULT_GAS; From 9ac7a7ef38df3b36b3b124090089729d35d56f83 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 27 Sep 2022 10:13:26 +0000 Subject: [PATCH 0996/1274] chore: remove flipper copy --- tests/src/eth/payable.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/src/eth/payable.test.ts b/tests/src/eth/payable.test.ts index 69b09010b3..8378906eef 100644 --- a/tests/src/eth/payable.test.ts +++ b/tests/src/eth/payable.test.ts @@ -191,7 +191,7 @@ describe('EVM transaction fees', () => { contract ProxyContract { bool value = false; - address flipper; + address innerContract; event CollectionCreated(address collection); event TokenMinted(uint256 tokenId); @@ -199,12 +199,12 @@ describe('EVM transaction fees', () => { receive() external payable {} constructor() { - flipper = address(new Flipper()); + innerContract = address(new InnerContract()); } function flip() public { value = !value; - Flipper(flipper).flip(); + InnerContract(innerContract).flip(); } function createNonfungibleCollection() external payable { @@ -221,11 +221,11 @@ describe('EVM transaction fees', () => { } function getValue() external view returns (bool) { - return Flipper(flipper).getValue(); + return InnerContract(innerContract).getValue(); } } - contract Flipper { + contract InnerContract { bool value = false; function flip() external { value = !value; From 239c99e5ac3303a523d2a5bd83d77d919200ea29 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 27 Sep 2022 10:13:26 +0000 Subject: [PATCH 0997/1274] chore: test with wrong fee for collection creation --- tests/src/eth/payable.test.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/src/eth/payable.test.ts b/tests/src/eth/payable.test.ts index 8378906eef..0ac454a42d 100644 --- a/tests/src/eth/payable.test.ts +++ b/tests/src/eth/payable.test.ts @@ -171,6 +171,26 @@ describe('EVM transaction fees', () => { expect(finalContractBalance == initialContractBalance).to.be.true; }); + itEth('Negative test: call createNFTCollection with wrong fee', async({helper}) => { + const SMALL_FEE = 1n * helper.balance.getOneTokenNominal(); + const BIG_FEE = 3n * helper.balance.getOneTokenNominal(); + const caller = await helper.eth.createAccountWithBalance(donor); + const collectionHelper = helper.ethNativeContract.collectionHelpers(caller); + + await expect(collectionHelper.methods.createNonfungibleCollection('A', 'B', 'C').call({value: Number(SMALL_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); + await expect(collectionHelper.methods.createNonfungibleCollection('A', 'B', 'C').call({value: Number(BIG_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); + }); + + itEth('Negative test: call createRFTCollection with wrong fee', async({helper}) => { + const SMALL_FEE = 1n * helper.balance.getOneTokenNominal(); + const BIG_FEE = 3n * helper.balance.getOneTokenNominal(); + const caller = await helper.eth.createAccountWithBalance(donor); + const collectionHelper = helper.ethNativeContract.collectionHelpers(caller); + + await expect(collectionHelper.methods.createRFTCollection('A', 'B', 'C').call({value: Number(SMALL_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); + await expect(collectionHelper.methods.createRFTCollection('A', 'B', 'C').call({value: Number(BIG_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); + }); + itEth('Get collection creation fee', async({helper}) => { const deployer = await helper.eth.createAccountWithBalance(donor); expect(await helper.eth.getCollectionCreationFee(deployer)).to.be.equal(String(2n * helper.balance.getOneTokenNominal())); From 7aba0b5d7f8d977a12fd73bc695cdd26c72355d8 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 30 Sep 2022 18:04:54 +0000 Subject: [PATCH 0998/1274] basic test --- tests/src/eth/allowlist.test.ts | 4 - tests/src/eth/proxyContract.test.ts | 124 +++++++++++++++++++ tests/src/eth/util/playgrounds/unique.dev.ts | 1 - 3 files changed, 124 insertions(+), 5 deletions(-) create mode 100644 tests/src/eth/proxyContract.test.ts diff --git a/tests/src/eth/allowlist.test.ts b/tests/src/eth/allowlist.test.ts index 9096a3dd9a..27d36556ab 100644 --- a/tests/src/eth/allowlist.test.ts +++ b/tests/src/eth/allowlist.test.ts @@ -19,12 +19,8 @@ import {expect} from 'chai'; import {isAllowlisted, normalizeAccountId} from '../util/helpers'; import { contractHelpers, - createEthAccount, createEthAccountWithBalance, deployFlipper, - evmCollection, - evmCollectionHelpers, - getCollectionAddressFromResult, itWeb3, } from './util/helpers'; import {itEth, usingEthPlaygrounds} from './util/playgrounds'; diff --git a/tests/src/eth/proxyContract.test.ts b/tests/src/eth/proxyContract.test.ts new file mode 100644 index 0000000000..75bcba24dd --- /dev/null +++ b/tests/src/eth/proxyContract.test.ts @@ -0,0 +1,124 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import {IKeyringPair} from '@polkadot/types/types'; + +import {itEth, expect, usingEthPlaygrounds, EthUniqueHelper} from './util/playgrounds'; + +describe('EVM payable contracts', () => { + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_, privateKey) => { + donor = privateKey('//Alice'); + }); + }); + + itEth('Update proxy contract', async({helper}) => { + const deployer = await helper.eth.createAccountWithBalance(donor); + const proxyContract = await deployProxyContract(helper, deployer); + const realContractV1 = await deployRealContractV1(helper, deployer); + await proxyContract.methods.updateVersion(realContractV1.options.address).send(); + await proxyContract.methods.flip().send(); + await proxyContract.methods.flip().send(); + await proxyContract.methods.flip().send(); + const value1 = await proxyContract.methods.getValue().call(); + const flipCount1 = await proxyContract.methods.getFlipCount().call(); + expect(value1).to.be.equal(true); + expect(flipCount1).to.be.equal('3'); + const realContractV2 = await deployRealContractV2(helper, deployer); + await proxyContract.methods.updateVersion(realContractV2.options.address).send(); + await proxyContract.methods.flip().send(); + await proxyContract.methods.flip().send(); + const value2 = await proxyContract.methods.getValue().call(); + const flipCount2 = await proxyContract.methods.getFlipCount().call(); + expect(value2).to.be.equal(true); + expect(flipCount2).to.be.equal('1'); + }); + + async function deployProxyContract(helper: EthUniqueHelper, deployer: string) { + return await helper.ethContract.deployByCode(deployer, 'ProxyContract', ` + // SPDX-License-Identifier: UNLICENSED + pragma solidity ^0.8.6; + + contract ProxyContract { + address realContract; + event NewEvent(uint data); + receive() external payable {} + constructor() {} + function updateVersion(address newContractAddress) external { + realContract = newContractAddress; + } + function flip() external { + RealContract(realContract).flip(); + } + function getValue() external view returns (bool) { + return RealContract(realContract).getValue(); + } + function getFlipCount() external view returns (uint) { + return RealContract(realContract).getFlipCount(); + } + } + + interface RealContract { + function flip() external; + function getValue() external view returns (bool); + function getFlipCount() external view returns (uint); + }`); + } + + async function deployRealContractV1(helper: EthUniqueHelper, deployer: string) { + return await helper.ethContract.deployByCode(deployer, 'RealContractV1', ` + // SPDX-License-Identifier: UNLICENSED + pragma solidity ^0.8.6; + + contract RealContractV1 { + bool value = false; + uint flipCount = 0; + function flip() external { + value = !value; + flipCount++; + } + function getValue() external view returns (bool) { + return value; + } + function getFlipCount() external view returns (uint) { + return flipCount; + } + }`); + } + + async function deployRealContractV2(helper: EthUniqueHelper, deployer: string) { + return await helper.ethContract.deployByCode(deployer, 'RealContractV2', ` + // SPDX-License-Identifier: UNLICENSED + pragma solidity ^0.8.6; + + contract RealContractV2 { + bool value = false; + uint flipCount = 10; + function flip() external { + value = !value; + flipCount--; + } + function getValue() external view returns (bool) { + return value; + } + function getFlipCount() external view returns (uint) { + return flipCount; + } + }`); + } +}); \ No newline at end of file diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index 6714bf0047..b356da0516 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -71,7 +71,6 @@ class ContractGroup extends EthGroupBase { }, }, }), {import: await this.findImports(imports)})).contracts[`${name}.sol`][name]; - return { abi: out.abi, object: '0x' + out.evm.bytecode.object, From 301e4e6b0f10b0a567ab4d8ec0943034e0a0c8e6 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 30 Sep 2022 18:04:54 +0000 Subject: [PATCH 0999/1274] Save contract state between upgrades --- tests/src/eth/proxyContract.test.ts | 57 +++++++++++++++++++---------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/tests/src/eth/proxyContract.test.ts b/tests/src/eth/proxyContract.test.ts index 75bcba24dd..a4d99f70df 100644 --- a/tests/src/eth/proxyContract.test.ts +++ b/tests/src/eth/proxyContract.test.ts @@ -15,6 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; +import {GAS_ARGS} from './util/helpers'; import {itEth, expect, usingEthPlaygrounds, EthUniqueHelper} from './util/playgrounds'; @@ -29,22 +30,26 @@ describe('EVM payable contracts', () => { itEth('Update proxy contract', async({helper}) => { const deployer = await helper.eth.createAccountWithBalance(donor); + const caller = await helper.eth.createAccountWithBalance(donor); const proxyContract = await deployProxyContract(helper, deployer); const realContractV1 = await deployRealContractV1(helper, deployer); + const realContractV1proxy = new helper.web3!.eth.Contract(realContractV1.options.jsonInterface, proxyContract.options.address, {from: caller, ...GAS_ARGS}); await proxyContract.methods.updateVersion(realContractV1.options.address).send(); - await proxyContract.methods.flip().send(); - await proxyContract.methods.flip().send(); - await proxyContract.methods.flip().send(); - const value1 = await proxyContract.methods.getValue().call(); - const flipCount1 = await proxyContract.methods.getFlipCount().call(); - expect(value1).to.be.equal(true); + + await realContractV1proxy.methods.flip().send(); + await realContractV1proxy.methods.flip().send(); + await realContractV1proxy.methods.flip().send(); + const value1 = await realContractV1proxy.methods.getValue().call(); + const flipCount1 = await realContractV1proxy.methods.getFlipCount().call(); expect(flipCount1).to.be.equal('3'); + expect(value1).to.be.equal(true); const realContractV2 = await deployRealContractV2(helper, deployer); + const realContractV2proxy = new helper.web3!.eth.Contract(realContractV2.options.jsonInterface, proxyContract.options.address, {from: caller, ...GAS_ARGS}); await proxyContract.methods.updateVersion(realContractV2.options.address).send(); - await proxyContract.methods.flip().send(); - await proxyContract.methods.flip().send(); - const value2 = await proxyContract.methods.getValue().call(); - const flipCount2 = await proxyContract.methods.getFlipCount().call(); + await realContractV2proxy.methods.flip().send(); + await realContractV2proxy.methods.flip().send(); + const value2 = await realContractV2proxy.methods.getValue().call(); + const flipCount2 = await realContractV2proxy.methods.getFlipCount().call(); expect(value2).to.be.equal(true); expect(flipCount2).to.be.equal('1'); }); @@ -55,21 +60,33 @@ describe('EVM payable contracts', () => { pragma solidity ^0.8.6; contract ProxyContract { - address realContract; event NewEvent(uint data); receive() external payable {} + bytes32 private constant implementationSlot = bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1); constructor() {} function updateVersion(address newContractAddress) external { - realContract = newContractAddress; - } - function flip() external { - RealContract(realContract).flip(); + bytes32 slot = implementationSlot; + assembly { + sstore(slot, newContractAddress) + } } - function getValue() external view returns (bool) { - return RealContract(realContract).getValue(); - } - function getFlipCount() external view returns (uint) { - return RealContract(realContract).getFlipCount(); + fallback() external { + bytes32 slot = implementationSlot; + assembly { + let ptr := mload(0x40) + let contractAddress := sload(slot) + + calldatacopy(ptr, 0, calldatasize()) + + let result := delegatecall(gas(), contractAddress, ptr, calldatasize(), 0, 0) + let size := returndatasize() + + returndatacopy(ptr, 0, size) + + switch result + case 0 { revert(ptr, size) } + default { return(ptr, size) } + } } } From ea8fa39bcf35fa244ef6f7423b72db443ca056ed Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 30 Sep 2022 18:04:54 +0000 Subject: [PATCH 1000/1274] Add new method to contract v2 --- tests/src/eth/proxyContract.test.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/src/eth/proxyContract.test.ts b/tests/src/eth/proxyContract.test.ts index a4d99f70df..990113acc2 100644 --- a/tests/src/eth/proxyContract.test.ts +++ b/tests/src/eth/proxyContract.test.ts @@ -32,6 +32,7 @@ describe('EVM payable contracts', () => { const deployer = await helper.eth.createAccountWithBalance(donor); const caller = await helper.eth.createAccountWithBalance(donor); const proxyContract = await deployProxyContract(helper, deployer); + const realContractV1 = await deployRealContractV1(helper, deployer); const realContractV1proxy = new helper.web3!.eth.Contract(realContractV1.options.jsonInterface, proxyContract.options.address, {from: caller, ...GAS_ARGS}); await proxyContract.methods.updateVersion(realContractV1.options.address).send(); @@ -43,15 +44,18 @@ describe('EVM payable contracts', () => { const flipCount1 = await realContractV1proxy.methods.getFlipCount().call(); expect(flipCount1).to.be.equal('3'); expect(value1).to.be.equal(true); + const realContractV2 = await deployRealContractV2(helper, deployer); const realContractV2proxy = new helper.web3!.eth.Contract(realContractV2.options.jsonInterface, proxyContract.options.address, {from: caller, ...GAS_ARGS}); await proxyContract.methods.updateVersion(realContractV2.options.address).send(); + await realContractV2proxy.methods.flip().send(); await realContractV2proxy.methods.flip().send(); + await realContractV2proxy.methods.increaseFlipCount().send(); const value2 = await realContractV2proxy.methods.getValue().call(); const flipCount2 = await realContractV2proxy.methods.getFlipCount().call(); expect(value2).to.be.equal(true); - expect(flipCount2).to.be.equal('1'); + expect(flipCount2).to.be.equal('6'); }); async function deployProxyContract(helper: EthUniqueHelper, deployer: string) { @@ -130,6 +134,9 @@ describe('EVM payable contracts', () => { value = !value; flipCount--; } + function increaseFlipCount() external { + flipCount = flipCount + 5; + } function getValue() external view returns (bool) { return value; } From 8a13a05ca7b7df0e3226e5e831c244321772122c Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Mon, 3 Oct 2022 06:14:05 +0000 Subject: [PATCH 1001/1274] Add new storage field in contract V2 --- tests/src/eth/proxyContract.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/src/eth/proxyContract.test.ts b/tests/src/eth/proxyContract.test.ts index 990113acc2..17ad5028c3 100644 --- a/tests/src/eth/proxyContract.test.ts +++ b/tests/src/eth/proxyContract.test.ts @@ -51,6 +51,7 @@ describe('EVM payable contracts', () => { await realContractV2proxy.methods.flip().send(); await realContractV2proxy.methods.flip().send(); + await realContractV2proxy.methods.setStep(5).send(); await realContractV2proxy.methods.increaseFlipCount().send(); const value2 = await realContractV2proxy.methods.getValue().call(); const flipCount2 = await realContractV2proxy.methods.getFlipCount().call(); @@ -130,12 +131,16 @@ describe('EVM payable contracts', () => { contract RealContractV2 { bool value = false; uint flipCount = 10; + uint step = 1; function flip() external { value = !value; flipCount--; } + function setStep(uint value) external { + step = value; + } function increaseFlipCount() external { - flipCount = flipCount + 5; + flipCount = flipCount + step; } function getValue() external view returns (bool) { return value; From 4901aab0e57d51005f16c711d9219969e15c04df Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Mon, 3 Oct 2022 16:50:39 +0000 Subject: [PATCH 1002/1274] Move burnItemTests to playgrounds + fix appPromotion flaky test --- tests/src/app-promotion.test.ts | 5 +- tests/src/burnItem.test.ts | 313 +++++++-------------------- tests/src/util/playgrounds/unique.ts | 8 + 3 files changed, 92 insertions(+), 234 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index a26eb1a940..76b3d6d1a3 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -34,7 +34,10 @@ const palletAddress = calculatePalleteAddress('appstake'); let accounts: IKeyringPair[] = []; const LOCKING_PERIOD = 20n; // 20 blocks of relay const UNLOCKING_PERIOD = 10n; // 10 blocks of parachain -const rewardAvailableInBlock = (stakedInBlock: bigint) => (stakedInBlock - stakedInBlock % LOCKING_PERIOD) + (LOCKING_PERIOD * 2n); +const rewardAvailableInBlock = (stakedInBlock: bigint) => { + if (stakedInBlock % LOCKING_PERIOD === 0n) return stakedInBlock + 20n; + return (stakedInBlock - stakedInBlock % LOCKING_PERIOD) + (LOCKING_PERIOD * 2n); +}; describe('App promotion', () => { before(async function () { diff --git a/tests/src/burnItem.test.ts b/tests/src/burnItem.test.ts index 7115d5d612..18b8e5ef30 100644 --- a/tests/src/burnItem.test.ts +++ b/tests/src/burnItem.test.ts @@ -14,289 +14,136 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api'; import {IKeyringPair} from '@polkadot/types/types'; -import { - createCollectionExpectSuccess, - createItemExpectSuccess, - getGenericResult, - normalizeAccountId, - addCollectionAdminExpectSuccess, - getBalance, - setCollectionLimitsExpectSuccess, - isTokenExists, - requirePallets, - Pallets, -} from './util/helpers'; - -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -chai.use(chaiAsPromised); -const expect = chai.expect; +import {expect, itSub, Pallets, usingPlaygrounds} from './util/playgrounds'; +let donor: IKeyringPair; let alice: IKeyringPair; let bob: IKeyringPair; describe('integration test: ext. burnItem():', () => { before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); - it('Burn item in NFT collection', async () => { - const createMode = 'NFT'; - const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}}); - const tokenId = await createItemExpectSuccess(alice, collectionId, createMode); + itSub('Burn item in NFT collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const token = await collection.mintToken(alice); - await usingApi(async (api) => { - const tx = api.tx.unique.burnItem(collectionId, tokenId, 1); - const events = await submitTransactionAsync(alice, tx); - const result = getGenericResult(events); - - expect(result.success).to.be.true; - // Get the item - expect(await isTokenExists(api, collectionId, tokenId)).to.be.false; - }); + await token.burn(alice); + expect(await token.isExist()).to.be.false; }); - it('Burn item in Fungible collection', async () => { - const createMode = 'Fungible'; - const collectionId = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}}); - await createItemExpectSuccess(alice, collectionId, createMode); // Helper creates 10 fungible tokens - const tokenId = 0; // ignored - - await usingApi(async (api) => { - // Destroy 1 of 10 - const tx = api.tx.unique.burnItem(collectionId, tokenId, 1); - const events = await submitTransactionAsync(alice, tx); - const result = getGenericResult(events); - - // Get alice balance - const balance = await getBalance(api, collectionId, alice.address, 0); + itSub('Burn item in Fungible collection', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {}, 10); + await collection.mint(alice, 10n); - // What to expect - expect(result.success).to.be.true; - expect(balance).to.be.equal(9n); - }); + await collection.burnTokens(alice, 1n); + expect(await collection.getBalance({Substrate: alice.address})).to.eq(9n); }); - it('Burn item in ReFungible collection', async function() { - await requirePallets(this, [Pallets.ReFungible]); + itSub.ifWithPallets('Burn item in ReFungible collection', [Pallets.ReFungible], async function({helper}) { + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice, 100n); - const createMode = 'ReFungible'; - const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}}); - const tokenId = await createItemExpectSuccess(alice, collectionId, createMode); + await token.burn(alice, 90n); + expect(await token.getBalance({Substrate: alice.address})).to.eq(10n); - await usingApi(async (api) => { - const tx = api.tx.unique.burnItem(collectionId, tokenId, 100); - const events = await submitTransactionAsync(alice, tx); - const result = getGenericResult(events); + await token.burn(alice, 10n); + expect(await token.getBalance({Substrate: alice.address})).to.eq(0n); + }); - // Get alice balance - const balance = await getBalance(api, collectionId, alice.address, tokenId); + itSub.ifWithPallets('Burn owned portion of item in ReFungible collection', [Pallets.ReFungible], async function({helper}) { + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice, 100n); - // What to expect - expect(result.success).to.be.true; - expect(balance).to.be.equal(0n); - }); - }); + await token.transfer(alice, {Substrate: bob.address}, 1n); - it('Burn owned portion of item in ReFungible collection', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const createMode = 'ReFungible'; - const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}}); - const tokenId = await createItemExpectSuccess(alice, collectionId, createMode); - - await usingApi(async (api) => { - // Transfer 1/100 of the token to Bob - const transfertx = api.tx.unique.transfer(normalizeAccountId(bob.address), collectionId, tokenId, 1); - const events1 = await submitTransactionAsync(alice, transfertx); - const result1 = getGenericResult(events1); - - // Get balances - const bobBalanceBefore = await getBalance(api, collectionId, bob.address, tokenId); - const aliceBalanceBefore = await getBalance(api, collectionId, alice.address, tokenId); - - // Bob burns his portion - const tx = api.tx.unique.burnItem(collectionId, tokenId, 1); - const events2 = await submitTransactionAsync(bob, tx); - const result2 = getGenericResult(events2); - - // Get balances - const bobBalanceAfter = await getBalance(api, collectionId, bob.address, tokenId); - const aliceBalanceAfter = await getBalance(api, collectionId, alice.address, tokenId); - // console.log(balance); - - // What to expect before burning - expect(result1.success).to.be.true; - expect(aliceBalanceBefore).to.be.equal(99n); - expect(bobBalanceBefore).to.be.equal(1n); - - // What to expect after burning - expect(result2.success).to.be.true; - expect(aliceBalanceAfter).to.be.equal(99n); - expect(bobBalanceAfter).to.be.equal(0n); - }); + expect(await token.getBalance({Substrate: alice.address})).to.eq(99n); + expect(await token.getBalance({Substrate: bob.address})).to.eq(1n); - }); + await token.burn(bob, 1n); + expect(await token.getBalance({Substrate: alice.address})).to.eq(99n); + expect(await token.getBalance({Substrate: bob.address})).to.eq(0n); + }); }); describe('integration test: ext. burnItem() with admin permissions:', () => { before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); - it('Burn item in NFT collection', async () => { - const createMode = 'NFT'; - const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true}); - const tokenId = await createItemExpectSuccess(alice, collectionId, createMode); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - - await usingApi(async (api) => { - const tx = api.tx.unique.burnFrom(collectionId, {Substrate: alice.address}, tokenId, 1); - const events = await submitTransactionAsync(bob, tx); - const result = getGenericResult(events); - - expect(result.success).to.be.true; - // Get the item - expect(await isTokenExists(api, collectionId, tokenId)).to.be.false; - }); + itSub('Burn item in NFT collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + await collection.setLimits(alice, {ownerCanTransfer: true}); + await collection.addAdmin(alice, {Substrate: bob.address}); + const token = await collection.mintToken(alice); + + await token.burnFrom(bob, {Substrate: alice.address}); + expect(await token.isExist()).to.be.false; }); - // TODO: burnFrom - it('Burn item in Fungible collection', async () => { - const createMode = 'Fungible'; - const collectionId = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true}); - const tokenId = await createItemExpectSuccess(alice, collectionId, createMode); // Helper creates 10 fungible tokens - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - - await usingApi(async (api) => { - // Destroy 1 of 10 - const tx = api.tx.unique.burnFrom(collectionId, normalizeAccountId(alice.address), tokenId, 1); - const events = await submitTransactionAsync(bob, tx); - const result = getGenericResult(events); - - // Get alice balance - const balance = await getBalance(api, collectionId, alice.address, 0); - - // What to expect - expect(result.success).to.be.true; - expect(balance).to.be.equal(9n); - }); + itSub('Burn item in Fungible collection', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {}, 0); + await collection.setLimits(alice, {ownerCanTransfer: true}); + await collection.addAdmin(alice, {Substrate: bob.address}); + await collection.mint(alice, 10n); + + await collection.burnTokensFrom(bob, {Substrate: alice.address}, 1n); + expect(await collection.getBalance({Substrate: alice.address})).to.eq(9n); }); - // TODO: burnFrom - it('Burn item in ReFungible collection', async function() { - await requirePallets(this, [Pallets.ReFungible]); - - const createMode = 'ReFungible'; - const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true}); - const tokenId = await createItemExpectSuccess(alice, collectionId, createMode); - await addCollectionAdminExpectSuccess(alice, collectionId, bob.address); - - await usingApi(async (api) => { - const tx = api.tx.unique.burnFrom(collectionId, normalizeAccountId(alice.address), tokenId, 100); - const events = await submitTransactionAsync(bob, tx); - const result = getGenericResult(events); - // Get alice balance - expect(result.success).to.be.true; - // Get the item - expect(await isTokenExists(api, collectionId, tokenId)).to.be.false; - }); + itSub.ifWithPallets('Burn item in ReFungible collection', [Pallets.ReFungible], async function({helper}) { + const collection = await helper.rft.mintCollection(alice); + await collection.setLimits(alice, {ownerCanTransfer: true}); + await collection.addAdmin(alice, {Substrate: bob.address}); + const token = await collection.mintToken(alice, 100n); + + await token.burnFrom(bob, {Substrate: alice.address}, 100n); + expect(await token.isExist()).to.be.false; }); }); describe('Negative integration test: ext. burnItem():', () => { before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); - it('Burn a token that was never created', async () => { - const createMode = 'NFT'; - const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}}); - const tokenId = 10; - - await usingApi(async (api) => { - const tx = api.tx.unique.burnItem(collectionId, tokenId, 1); - const badTransaction = async function () { - await submitTransactionExpectFailAsync(alice, tx); - }; - await expect(badTransaction()).to.be.rejected; - }); - + itSub('Burn a token that was never created', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + await expect(collection.burnToken(alice, 10)).to.be.rejectedWith('common.TokenNotFound'); }); - it('Burn a token using the address that does not own it', async () => { - const createMode = 'NFT'; - const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}}); - const tokenId = await createItemExpectSuccess(alice, collectionId, createMode); - - await usingApi(async (api) => { - const tx = api.tx.unique.burnItem(collectionId, tokenId, 1); - const badTransaction = async function () { - await submitTransactionExpectFailAsync(bob, tx); - }; - await expect(badTransaction()).to.be.rejected; - }); + itSub('Burn a token using the address that does not own it', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const token = await collection.mintToken(alice); + await expect(token.burn(bob)).to.be.rejectedWith('common.NoPermission'); }); - it('Transfer a burned a token', async () => { - const createMode = 'NFT'; - const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}}); - const tokenId = await createItemExpectSuccess(alice, collectionId, createMode); - - await usingApi(async (api) => { - - const burntx = api.tx.unique.burnItem(collectionId, tokenId, 1); - const events1 = await submitTransactionAsync(alice, burntx); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; - - const tx = api.tx.unique.transfer(normalizeAccountId(bob.address), collectionId, tokenId, 1); - const badTransaction = async function () { - await submitTransactionExpectFailAsync(alice, tx); - }; - await expect(badTransaction()).to.be.rejected; - }); + itSub('Transfer a burned token', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const token = await collection.mintToken(alice); + await token.burn(alice); + await expect(token.transfer(alice, {Substrate: bob.address})).to.be.rejectedWith('common.TokenNotFound'); }); - it('Burn more than owned in Fungible collection', async () => { - const createMode = 'Fungible'; - const collectionId = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}}); - // Helper creates 10 fungible tokens - await createItemExpectSuccess(alice, collectionId, createMode); - const tokenId = 0; // ignored - - await usingApi(async (api) => { - // Destroy 11 of 10 - const tx = api.tx.unique.burnItem(collectionId, tokenId, 11); - const badTransaction = async function () { - await submitTransactionExpectFailAsync(alice, tx); - }; - await expect(badTransaction()).to.be.rejected; - - // Get alice balance - const balance = await getBalance(api, collectionId, alice.address, 0); - - // What to expect - expect(balance).to.be.equal(10n); - }); + itSub('Burn more than owned in Fungible collection', async ({helper}) => { + const collection = await helper.ft.mintCollection(alice, {}, 0); + await collection.mint(alice, 10n); + await expect(collection.burnTokens(alice, 11n)).to.be.rejectedWith('common.TokenValueTooLow'); + expect(await collection.getBalance({Substrate: alice.address})).to.eq(10n); }); - }); diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 774ae7ce01..73f24d11e8 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -2661,6 +2661,10 @@ export class UniqueNFToken extends UniqueBaseToken { return await this.collection.isTokenApproved(this.tokenId, toAddressObj); } + async isExist() { + return await this.collection.isTokenExists(this.tokenId); + } + async burn(signer: TSigner) { return await this.collection.burnToken(signer, this.tokenId); } @@ -2694,6 +2698,10 @@ export class UniqueRFToken extends UniqueBaseToken { return await this.collection.getTokenTotalPieces(this.tokenId); } + async isExist() { + return await this.collection.isTokenExists(this.tokenId); + } + async getApprovedPieces(fromAddressObj: ICrossAccountId, toAccountObj: ICrossAccountId) { return await this.collection.getTokenApprovedPieces(this.tokenId, fromAddressObj, toAccountObj); } From 2203d0f0ed698b02ceb7ee6f199d41ef1bf2c7df Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 3 Oct 2022 19:05:06 +0000 Subject: [PATCH 1003/1274] Tests: refactor fractionalizer tests to playgrounds --- tests/package.json | 1 + .../eth/fractionalizer/fractionalizer.test.ts | 522 ++++++++---------- tests/src/eth/util/playgrounds/index.ts | 2 + 3 files changed, 237 insertions(+), 288 deletions(-) diff --git a/tests/package.json b/tests/package.json index c105fb688f..b3a793d87e 100644 --- a/tests/package.json +++ b/tests/package.json @@ -30,6 +30,7 @@ "testEth": "mocha --timeout 9999999 -r ts-node/register './**/eth/**/*.test.ts'", "testEthMarketplace": "mocha --timeout 9999999 -r ts-node/register './**/eth/marketplace/**/*.test.ts'", "testEthNesting": "mocha --timeout 9999999 -r ts-node/register './**/eth/nesting/**/*.test.ts'", + "testEthFractionalizer": "mocha --timeout 9999999 -r ts-node/register './**/eth/fractionalizer/**/*.test.ts'", "testEthPayable": "mocha --timeout 9999999 -r ts-node/register './**/eth/payable.test.ts'", "load": "mocha --timeout 9999999 -r ts-node/register './**/*.load.ts'", "loadTransfer": "ts-node src/transfer.nload.ts", diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index 0058e8e3dc..612aa1971a 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -15,98 +15,61 @@ // along with Unique Network. If not, see . -import Web3 from 'web3'; -import {ApiPromise} from '@polkadot/api'; -import {evmToAddress} from '@polkadot/util-crypto'; import {readFile} from 'fs/promises'; -import {executeTransaction, submitTransactionAsync} from '../../substrate/substrate-api'; -import {getCreateCollectionResult, getCreateItemResult, UNIQUE, requirePallets, Pallets} from '../../util/helpers'; -import {collectionIdToAddress, CompiledContract, createEthAccountWithBalance, createNonfungibleCollection, createRFTCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers'; -import {Contract} from 'web3-eth-contract'; -import * as solc from 'solc'; -import chai from 'chai'; -import chaiLike from 'chai-like'; import {IKeyringPair} from '@polkadot/types/types'; -chai.use(chaiLike); -const expect = chai.expect; -let fractionalizer: CompiledContract; - -async function compileFractionalizer() { - if (!fractionalizer) { - const input = { - language: 'Solidity', - sources: { - ['Fractionalizer.sol']: { - content: (await readFile(`${__dirname}/Fractionalizer.sol`)).toString(), - }, - }, - settings: { - outputSelection: { - '*': { - '*': ['*'], - }, - }, - }, - }; - const json = JSON.parse(solc.compile(JSON.stringify(input), {import: await findImports()})); - const out = json.contracts['Fractionalizer.sol']['Fractionalizer']; - - fractionalizer = { - abi: out.abi, - object: '0x' + out.evm.bytecode.object, - }; +import {evmToAddress} from '@polkadot/util-crypto'; + +import {Contract} from 'web3-eth-contract'; + +import {usingEthPlaygrounds, expect, itEth, EthUniqueHelper} from '../util/playgrounds'; +import {CompiledContract} from '../util/playgrounds/types'; +import {requirePalletsOrSkip, Pallets} from '../../util/playgrounds'; + + +let compiledFractionalizer: CompiledContract; + +const compileContract = async (helper: EthUniqueHelper): Promise => { + if(!compiledFractionalizer) { + compiledFractionalizer = await helper.ethContract.compile('Fractionalizer', (await readFile(`${__dirname}/Fractionalizer.sol`)).toString(), [ + {solPath: 'api/CollectionHelpers.sol', fsPath: `${__dirname}/../api/CollectionHelpers.sol`}, + {solPath: 'api/ContractHelpers.sol', fsPath: `${__dirname}/../api/ContractHelpers.sol`}, + {solPath: 'api/UniqueRefungibleToken.sol', fsPath: `${__dirname}/../api/UniqueRefungibleToken.sol`}, + {solPath: 'api/UniqueRefungible.sol', fsPath: `${__dirname}/../api/UniqueRefungible.sol`}, + {solPath: 'api/UniqueNFT.sol', fsPath: `${__dirname}/../api/UniqueNFT.sol`}, + ]); } - return fractionalizer; + return compiledFractionalizer; } -async function findImports() { - const collectionHelpers = (await readFile(`${__dirname}/../api/CollectionHelpers.sol`)).toString(); - const contractHelpers = (await readFile(`${__dirname}/../api/ContractHelpers.sol`)).toString(); - const uniqueRefungibleToken = (await readFile(`${__dirname}/../api/UniqueRefungibleToken.sol`)).toString(); - const uniqueRefungible = (await readFile(`${__dirname}/../api/UniqueRefungible.sol`)).toString(); - const uniqueNFT = (await readFile(`${__dirname}/../api/UniqueNFT.sol`)).toString(); - - return function(path: string) { - switch (path) { - case 'api/CollectionHelpers.sol': return {contents: `${collectionHelpers}`}; - case 'api/ContractHelpers.sol': return {contents: `${contractHelpers}`}; - case 'api/UniqueRefungibleToken.sol': return {contents: `${uniqueRefungibleToken}`}; - case 'api/UniqueRefungible.sol': return {contents: `${uniqueRefungible}`}; - case 'api/UniqueNFT.sol': return {contents: `${uniqueNFT}`}; - default: return {error: 'File not found'}; - } - }; -} -async function deployFractionalizer(web3: Web3, owner: string) { - const compiled = await compileFractionalizer(); - const fractionalizerContract = new web3.eth.Contract(compiled.abi, undefined, { - data: compiled.object, - from: owner, - ...GAS_ARGS, - }); - return await fractionalizerContract.deploy({data: compiled.object}).send({from: owner}); +const deployContract = async (helper: EthUniqueHelper, owner: string): Promise => { + const compiled = await compileContract(helper); + return await helper.ethContract.deployByAbi(owner, compiled.abi, compiled.object); } -async function initFractionalizer(api: ApiPromise, web3: Web3, privateKeyWrapper: (account: string) => IKeyringPair, owner: string) { - const fractionalizer = await deployFractionalizer(web3, owner); - const amount = 10n * UNIQUE; - await web3.eth.sendTransaction({from: owner, to: fractionalizer.options.address, value: `${amount}`, ...GAS_ARGS}); - const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({value: Number(2n * UNIQUE)}); + +const initContract = async (helper: EthUniqueHelper, owner: string): Promise<{contract: Contract, rftCollectionAddress: string}> => { + const fractionalizer = await deployContract(helper, owner); + const amount = 10n * helper.balance.getOneTokenNominal(); + const web3 = helper.getWeb3(); + await web3.eth.sendTransaction({from: owner, to: fractionalizer.options.address, value: `${amount}`, gas: helper.eth.DEFAULT_GAS}); + const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({value: Number(2n * helper.balance.getOneTokenNominal())}); const rftCollectionAddress = result.events.RFTCollectionSet.returnValues._collection; - return {fractionalizer, rftCollectionAddress}; + return {contract: fractionalizer, rftCollectionAddress}; } -async function createRFTToken(api: ApiPromise, web3: Web3, owner: string, fractionalizer: Contract, amount: bigint) { - const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); - const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); +const mintRFTToken = async (helper: EthUniqueHelper, owner: string, fractionalizer: Contract, amount: bigint): Promise<{ + nftCollectionAddress: string, nftTokenId: number, rftTokenAddress: string +}> => { + const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); const nftTokenId = await nftContract.methods.nextTokenId().call(); - await nftContract.methods.mint(owner, nftTokenId).send(); + await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); - await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send(); - await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send(); - const result = await fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, amount).send(); + await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, true).send({from: owner}); + await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send({from: owner}); + const result = await fractionalizer.methods.nft2rft(nftCollection.collectionAddress, nftTokenId, amount).send({from: owner}); const {_collection, _tokenId, _rftToken} = result.events.Fractionalized.returnValues; return { nftCollectionAddress: _collection, @@ -115,104 +78,111 @@ async function createRFTToken(api: ApiPromise, web3: Web3, owner: string, fracti }; } + describe('Fractionalizer contract usage', () => { + let donor: IKeyringPair; + before(async function() { - await requirePallets(this, [Pallets.ReFungible]); + await usingEthPlaygrounds(async (helper: EthUniqueHelper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + donor = privateKey('//Alice'); + }); }); - itWeb3('Set RFT collection', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const fractionalizer = await deployFractionalizer(web3, owner); - const {collectionIdAddress} = await createRFTCollection(api, web3, owner); - const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner); - await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send(); - const result = await fractionalizer.methods.setRFTCollection(collectionIdAddress).send(); + itEth('Set RFT collection', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 10n); + const fractionalizer = await deployContract(helper, owner); + const rftCollection = await helper.eth.createRefungibleCollection(owner, 'rft', 'RFT collection', 'RFT'); + const rftContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner); + + await rftContract.methods.addCollectionAdmin(fractionalizer.options.address).send({from: owner}); + const result = await fractionalizer.methods.setRFTCollection(rftCollection.collectionAddress).send({from: owner}); expect(result.events).to.be.like({ RFTCollectionSet: { returnValues: { - _collection: collectionIdAddress, + _collection: rftCollection.collectionAddress, }, }, }); }); - itWeb3('Mint RFT collection', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const fractionalizer = await deployFractionalizer(web3, owner); - const tx = api.tx.balances.transfer(evmToAddress(fractionalizer.options.address), 10n * UNIQUE); - await executeTransaction(api, alice, tx); + itEth('Mint RFT collection', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 10n); + const fractionalizer = await deployContract(helper, owner); + await helper.balance.transferToSubstrate(donor, evmToAddress(fractionalizer.options.address), 10n * helper.balance.getOneTokenNominal()); - const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({from: owner, value: Number(2n * UNIQUE)}); + const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({from: owner, value: Number(2n * helper.balance.getOneTokenNominal())}); expect(result.events).to.be.like({ RFTCollectionSet: {}, }); expect(result.events.RFTCollectionSet.returnValues._collection).to.be.ok; }); - itWeb3('Set Allowlist', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); - const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); - const result1 = await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send({from: owner}); + itEth('Set Allowlist', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); + const {contract: fractionalizer} = await initContract(helper, owner); + const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + + const result1 = await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, true).send({from: owner}); expect(result1.events).to.be.like({ AllowListSet: { returnValues: { - _collection: nftCollectionAddress, + _collection: nftCollection.collectionAddress, _status: true, }, }, }); - const result2 = await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, false).send({from: owner}); + const result2 = await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, false).send({from: owner}); expect(result2.events).to.be.like({ AllowListSet: { returnValues: { - _collection: nftCollectionAddress, + _collection: nftCollection.collectionAddress, _status: false, }, }, }); }); - itWeb3('NFT to RFT', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('NFT to RFT', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); - const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); - const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); + const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); const nftTokenId = await nftContract.methods.nextTokenId().call(); - await nftContract.methods.mint(owner, nftTokenId).send(); + await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); - const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); + const {contract: fractionalizer} = await initContract(helper, owner); - await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send(); - await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send(); - const result = await fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).send(); + await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, true).send({from: owner}); + await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send({from: owner}); + const result = await fractionalizer.methods.nft2rft(nftCollection.collectionAddress, nftTokenId, 100).send({from: owner}); expect(result.events).to.be.like({ Fractionalized: { returnValues: { - _collection: nftCollectionAddress, + _collection: nftCollection.collectionAddress, _tokenId: nftTokenId, _amount: '100', }, }, }); const rftTokenAddress = result.events.Fractionalized.returnValues._rftToken; - const rftTokenContract = uniqueRefungibleToken(web3, rftTokenAddress, owner); + + const rftTokenContract = helper.ethNativeContract.rftToken(rftTokenAddress); expect(await rftTokenContract.methods.balanceOf(owner).call()).to.equal('100'); }); - itWeb3('RFT to NFT', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('RFT to NFT', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); - const {fractionalizer, rftCollectionAddress} = await initFractionalizer(api, web3, privateKeyWrapper, owner); - const {rftTokenAddress, nftCollectionAddress, nftTokenId} = await createRFTToken(api, web3, owner, fractionalizer, 100n); + const {contract: fractionalizer, rftCollectionAddress} = await initContract(helper, owner); + const {rftTokenAddress, nftCollectionAddress, nftTokenId} = await mintRFTToken(helper, owner, fractionalizer, 100n); - const {collectionId, tokenId} = tokenIdFromAddress(rftTokenAddress); - const refungibleAddress = collectionIdToAddress(collectionId); + const {collectionId, tokenId} = helper.ethAddress.extractTokenId(rftTokenAddress); + const refungibleAddress = helper.ethAddress.fromCollectionId(collectionId); expect(rftCollectionAddress).to.be.equal(refungibleAddress); - const refungibleTokenContract = uniqueRefungibleToken(web3, rftTokenAddress, owner); - await refungibleTokenContract.methods.approve(fractionalizer.options.address, 100).send(); - const result = await fractionalizer.methods.rft2nft(refungibleAddress, tokenId).send(); + const refungibleTokenContract = helper.ethNativeContract.rftToken(rftTokenAddress, owner); + await refungibleTokenContract.methods.approve(fractionalizer.options.address, 100).send({from: owner}); + const result = await fractionalizer.methods.rft2nft(refungibleAddress, tokenId).send({from: owner}); expect(result.events).to.be.like({ Defractionalized: { returnValues: { @@ -224,17 +194,17 @@ describe('Fractionalizer contract usage', () => { }); }); - itWeb3('Test fractionalizer NFT <-> RFT mapping ', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('Test fractionalizer NFT <-> RFT mapping ', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); - const {fractionalizer, rftCollectionAddress} = await initFractionalizer(api, web3, privateKeyWrapper, owner); - const {rftTokenAddress, nftCollectionAddress, nftTokenId} = await createRFTToken(api, web3, owner, fractionalizer, 100n); + const {contract: fractionalizer, rftCollectionAddress} = await initContract(helper, owner); + const {rftTokenAddress, nftCollectionAddress, nftTokenId} = await mintRFTToken(helper, owner, fractionalizer, 100n); - const {collectionId, tokenId} = tokenIdFromAddress(rftTokenAddress); - const refungibleAddress = collectionIdToAddress(collectionId); + const {collectionId, tokenId} = helper.ethAddress.extractTokenId(rftTokenAddress); + const refungibleAddress = helper.ethAddress.fromCollectionId(collectionId); expect(rftCollectionAddress).to.be.equal(refungibleAddress); - const refungibleTokenContract = uniqueRefungibleToken(web3, rftTokenAddress, owner); - await refungibleTokenContract.methods.approve(fractionalizer.options.address, 100).send(); + const refungibleTokenContract = helper.ethNativeContract.rftToken(rftTokenAddress, owner); + await refungibleTokenContract.methods.approve(fractionalizer.options.address, 100).send({from: owner}); const rft2nft = await fractionalizer.methods.rft2nftMapping(rftTokenAddress).call(); expect(rft2nft).to.be.like({ @@ -250,251 +220,227 @@ describe('Fractionalizer contract usage', () => { describe('Negative Integration Tests for fractionalizer', () => { + let donor: IKeyringPair; + before(async function() { - await requirePallets(this, [Pallets.ReFungible]); + await usingEthPlaygrounds(async (helper: EthUniqueHelper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + donor = privateKey('//Alice'); + }); }); - itWeb3('call setRFTCollection twice', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const {collectionIdAddress} = await createRFTCollection(api, web3, owner); - const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner); + itEth('call setRFTCollection twice', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); + const rftCollection = await helper.eth.createRefungibleCollection(owner, 'rft', 'RFT collection', 'RFT'); + const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner); - const fractionalizer = await deployFractionalizer(web3, owner); - await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send(); - await fractionalizer.methods.setRFTCollection(collectionIdAddress).send(); + const fractionalizer = await deployContract(helper, owner); + await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send({from: owner}); + await fractionalizer.methods.setRFTCollection(rftCollection.collectionAddress).send({from: owner}); - await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) + await expect(fractionalizer.methods.setRFTCollection(rftCollection.collectionAddress).call()) .to.be.rejectedWith(/RFT collection is already set$/g); }); - itWeb3('call setRFTCollection with NFT collection', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const {collectionIdAddress} = await createNonfungibleCollection(api, web3, owner); - const nftContract = uniqueNFT(web3, collectionIdAddress, owner); + itEth('call setRFTCollection with NFT collection', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); + const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); - const fractionalizer = await deployFractionalizer(web3, owner); - await nftContract.methods.addCollectionAdmin(fractionalizer.options.address).send(); + const fractionalizer = await deployContract(helper, owner); + await nftContract.methods.addCollectionAdmin(fractionalizer.options.address).send({from: owner}); - await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) + await expect(fractionalizer.methods.setRFTCollection(nftCollection.collectionAddress).call()) .to.be.rejectedWith(/Wrong collection type. Collection is not refungible.$/g); }); - itWeb3('call setRFTCollection while not collection admin', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const fractionalizer = await deployFractionalizer(web3, owner); - const {collectionIdAddress} = await createRFTCollection(api, web3, owner); + itEth('call setRFTCollection while not collection admin', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); + const fractionalizer = await deployContract(helper, owner); + const rftCollection = await helper.eth.createRefungibleCollection(owner, 'rft', 'RFT collection', 'RFT'); - await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) + await expect(fractionalizer.methods.setRFTCollection(rftCollection.collectionAddress).call()) .to.be.rejectedWith(/Fractionalizer contract should be an admin of the collection$/g); }); - itWeb3('call setRFTCollection after createAndSetRFTCollection', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const fractionalizer = await deployFractionalizer(web3, owner); - const tx = api.tx.balances.transfer(evmToAddress(fractionalizer.options.address), 10n * UNIQUE); - await submitTransactionAsync(alice, tx); + itEth('call setRFTCollection after createAndSetRFTCollection', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); + const fractionalizer = await deployContract(helper, owner); + await helper.balance.transferToSubstrate(donor, evmToAddress(fractionalizer.options.address), 10n * helper.balance.getOneTokenNominal()); - const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({from: owner, value: Number(2n * UNIQUE)}); + const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({from: owner, value: Number(2n * helper.balance.getOneTokenNominal())}); const collectionIdAddress = result.events.RFTCollectionSet.returnValues._collection; await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call()) .to.be.rejectedWith(/RFT collection is already set$/g); }); - itWeb3('call nft2rft without setting RFT collection for contract', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('call nft2rft without setting RFT collection for contract', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); - const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); - const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); + const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); const nftTokenId = await nftContract.methods.nextTokenId().call(); - await nftContract.methods.mint(owner, nftTokenId).send(); + await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); - const fractionalizer = await deployFractionalizer(web3, owner); + const fractionalizer = await deployContract(helper, owner); - await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) + await expect(fractionalizer.methods.nft2rft(nftCollection.collectionAddress, nftTokenId, 100).call()) .to.be.rejectedWith(/RFT collection is not set$/g); }); - itWeb3('call nft2rft while not owner of NFT token', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const nftOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('call nft2rft while not owner of NFT token', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); + const nftOwner = await helper.eth.createAccountWithBalance(donor, 10n); - const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); - const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); + const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); const nftTokenId = await nftContract.methods.nextTokenId().call(); - await nftContract.methods.mint(owner, nftTokenId).send(); - await nftContract.methods.transfer(nftOwner, 1).send(); + await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); + await nftContract.methods.transfer(nftOwner, 1).send({from: owner}); - const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); - await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send(); + const {contract: fractionalizer} = await initContract(helper, owner); + await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, true).send({from: owner}); - await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) + await expect(fractionalizer.methods.nft2rft(nftCollection.collectionAddress, nftTokenId, 100).call({from: owner})) .to.be.rejectedWith(/Only token owner could fractionalize it$/g); }); - itWeb3('call nft2rft while not in list of allowed accounts', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('call nft2rft while not in list of allowed accounts', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); - const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); - const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); + const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); const nftTokenId = await nftContract.methods.nextTokenId().call(); - await nftContract.methods.mint(owner, nftTokenId).send(); + await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); - const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); + const {contract: fractionalizer} = await initContract(helper, owner); - await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send(); - await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) + await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send({from: owner}); + await expect(fractionalizer.methods.nft2rft(nftCollection.collectionAddress, nftTokenId, 100).call()) .to.be.rejectedWith(/Fractionalization of this collection is not allowed by admin$/g); }); - itWeb3('call nft2rft while fractionalizer doesnt have approval for nft token', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('call nft2rft while fractionalizer doesnt have approval for nft token', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); - const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); - const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); + const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); const nftTokenId = await nftContract.methods.nextTokenId().call(); - await nftContract.methods.mint(owner, nftTokenId).send(); + await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); - const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); + const {contract: fractionalizer} = await initContract(helper, owner); - await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send(); - await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) + await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, true).send({from: owner}); + await expect(fractionalizer.methods.nft2rft(nftCollection.collectionAddress, nftTokenId, 100).call()) .to.be.rejectedWith(/ApprovedValueTooLow$/g); }); - itWeb3('call rft2nft without setting RFT collection for contract', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('call rft2nft without setting RFT collection for contract', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); - const fractionalizer = await deployFractionalizer(web3, owner); - const {collectionIdAddress: rftCollectionAddress} = await createRFTCollection(api, web3, owner); - const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner); + const fractionalizer = await deployContract(helper, owner); + const rftCollection = await helper.eth.createRefungibleCollection(owner, 'rft', 'RFT collection', 'RFT'); + const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner); const rftTokenId = await refungibleContract.methods.nextTokenId().call(); - await refungibleContract.methods.mint(owner, rftTokenId).send(); + await refungibleContract.methods.mint(owner, rftTokenId).send({from: owner}); - await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).call()) + await expect(fractionalizer.methods.rft2nft(rftCollection.collectionAddress, rftTokenId).call({from: owner})) .to.be.rejectedWith(/RFT collection is not set$/g); }); - itWeb3('call rft2nft for RFT token that is not from configured RFT collection', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('call rft2nft for RFT token that is not from configured RFT collection', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); - const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); - const {collectionIdAddress: rftCollectionAddress} = await createRFTCollection(api, web3, owner); - const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner); + const {contract: fractionalizer} = await initContract(helper, owner); + const rftCollection = await helper.eth.createRefungibleCollection(owner, 'rft', 'RFT collection', 'RFT'); + const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner); const rftTokenId = await refungibleContract.methods.nextTokenId().call(); - await refungibleContract.methods.mint(owner, rftTokenId).send(); + await refungibleContract.methods.mint(owner, rftTokenId).send({from: owner}); - await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).call()) + await expect(fractionalizer.methods.rft2nft(rftCollection.collectionAddress, rftTokenId).call()) .to.be.rejectedWith(/Wrong RFT collection$/g); }); - itWeb3('call rft2nft for RFT token that was not minted by fractionalizer contract', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const {collectionIdAddress: rftCollectionAddress} = await createRFTCollection(api, web3, owner); + itEth('call rft2nft for RFT token that was not minted by fractionalizer contract', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); + const rftCollection = await helper.eth.createRefungibleCollection(owner, 'rft', 'RFT collection', 'RFT'); + const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner); - const fractionalizer = await deployFractionalizer(web3, owner); - const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner); + const fractionalizer = await deployContract(helper, owner); - await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send(); - await fractionalizer.methods.setRFTCollection(rftCollectionAddress).send(); + await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send({from: owner}); + await fractionalizer.methods.setRFTCollection(rftCollection.collectionAddress).send({from: owner}); const rftTokenId = await refungibleContract.methods.nextTokenId().call(); - await refungibleContract.methods.mint(owner, rftTokenId).send(); + await refungibleContract.methods.mint(owner, rftTokenId).send({from: owner}); - await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, rftTokenId).call()) + await expect(fractionalizer.methods.rft2nft(rftCollection.collectionAddress, rftTokenId).call()) .to.be.rejectedWith(/No corresponding NFT token found$/g); }); - itWeb3('call rft2nft without owning all RFT pieces', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const receiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('call rft2nft without owning all RFT pieces', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); + const receiver = await helper.eth.createAccountWithBalance(donor, 10n); - const {fractionalizer, rftCollectionAddress} = await initFractionalizer(api, web3, privateKeyWrapper, owner); - const {rftTokenAddress} = await createRFTToken(api, web3, owner, fractionalizer, 100n); + const {contract: fractionalizer, rftCollectionAddress} = await initContract(helper, owner); + const {rftTokenAddress} = await mintRFTToken(helper, owner, fractionalizer, 100n); - const {tokenId} = tokenIdFromAddress(rftTokenAddress); - const refungibleTokenContract = uniqueRefungibleToken(web3, rftTokenAddress, owner); - await refungibleTokenContract.methods.transfer(receiver, 50).send(); - await refungibleTokenContract.methods.approve(fractionalizer.options.address, 50).send(); - await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, tokenId).call()) + const {tokenId} = helper.ethAddress.extractTokenId(rftTokenAddress); + const refungibleTokenContract = helper.ethNativeContract.rftToken(rftTokenAddress, owner); + await refungibleTokenContract.methods.transfer(receiver, 50).send({from: owner}); + await refungibleTokenContract.methods.approve(fractionalizer.options.address, 50).send({from: receiver}); + await expect(fractionalizer.methods.rft2nft(rftCollectionAddress, tokenId).call({from: receiver})) .to.be.rejectedWith(/Not all pieces are owned by the caller$/g); }); - itWeb3('send QTZ/UNQ to contract from non owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const payer = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('send QTZ/UNQ to contract from non owner', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); + const payer = await helper.eth.createAccountWithBalance(donor, 10n); - const fractionalizer = await deployFractionalizer(web3, owner); - const amount = 10n * UNIQUE; - await expect(web3.eth.sendTransaction({from: payer, to: fractionalizer.options.address, value: `${amount}`, ...GAS_ARGS})).to.be.rejected; + const fractionalizer = await deployContract(helper, owner); + const amount = 10n * helper.balance.getOneTokenNominal(); + const web3 = helper.getWeb3(); + await expect(web3.eth.sendTransaction({from: payer, to: fractionalizer.options.address, value: `${amount}`, gas: helper.eth.DEFAULT_GAS})).to.be.rejected; }); - itWeb3('fractionalize NFT with NFT transfers disallowed', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - let collectionId; - { - const tx = api.tx.unique.createCollectionEx({name: 'A', description: 'B', tokenPrefix: 'C', mode: 'NFT'}); - const events = await submitTransactionAsync(alice, tx); - const result = getCreateCollectionResult(events); - collectionId = result.collectionId; - } - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - let nftTokenId; - { - const createData = {nft: {}}; - const tx = api.tx.unique.createItem(collectionId, {Ethereum: owner}, createData as any); - const events = await executeTransaction(api, alice, tx); - const result = getCreateItemResult(events); - nftTokenId = result.itemId; - } - { - const tx = api.tx.unique.setTransfersEnabledFlag(collectionId, false); - await executeTransaction(api, alice, tx); - } - const nftCollectionAddress = collectionIdToAddress(collectionId); - const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner); - await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send(); - - const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); - await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send(); - await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100).call()) + itEth('fractionalize NFT with NFT transfers disallowed', async ({helper}) => { + const nftCollection = await helper.nft.mintCollection(donor, {name: 'A', description: 'B', tokenPrefix: 'C'}); + + const owner = await helper.eth.createAccountWithBalance(donor, 20n); + const nftToken = await nftCollection.mintToken(donor, {Ethereum: owner}); + await helper.executeExtrinsic(donor, 'api.tx.unique.setTransfersEnabledFlag', [nftCollection.collectionId, false], true); + const nftCollectionAddress = helper.ethAddress.fromCollectionId(nftCollection.collectionId); + const {contract: fractionalizer} = await initContract(helper, owner); + await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send({from: owner}); + + const nftContract = helper.ethNativeContract.collection(nftCollectionAddress, 'nft', owner); + await nftContract.methods.approve(fractionalizer.options.address, nftToken.tokenId).send({from: owner}); + await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftToken.tokenId, 100).call()) .to.be.rejectedWith(/TransferNotAllowed$/g); }); - itWeb3('fractionalize NFT with RFT transfers disallowed', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const alice = privateKeyWrapper('//Alice'); - - let collectionId; - { - const tx = api.tx.unique.createCollectionEx({name: 'A', description: 'B', tokenPrefix: 'C', mode: 'ReFungible'}); - const events = await submitTransactionAsync(alice, tx); - const result = getCreateCollectionResult(events); - collectionId = result.collectionId; - } - const rftCollectionAddress = collectionIdToAddress(collectionId); - const fractionalizer = await deployFractionalizer(web3, owner); - { - const changeAdminTx = api.tx.unique.addCollectionAdmin(collectionId, {Ethereum: fractionalizer.options.address}); - await submitTransactionAsync(alice, changeAdminTx); - } - await fractionalizer.methods.setRFTCollection(rftCollectionAddress).send(); - { - const tx = api.tx.unique.setTransfersEnabledFlag(collectionId, false); - await executeTransaction(api, alice, tx); - } - - const {collectionIdAddress: nftCollectionAddress} = await createNonfungibleCollection(api, web3, owner); - const nftContract = uniqueNFT(web3, nftCollectionAddress, owner); + itEth('fractionalize NFT with RFT transfers disallowed', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor, 20n); + + const rftCollection = await helper.rft.mintCollection(donor, {name: 'A', description: 'B', tokenPrefix: 'C'}); + const rftCollectionAddress = helper.ethAddress.fromCollectionId(rftCollection.collectionId); + const fractionalizer = await deployContract(helper, owner); + await rftCollection.addAdmin(donor, {Ethereum: fractionalizer.options.address}); + + await fractionalizer.methods.setRFTCollection(rftCollectionAddress).send({from: owner}); + await helper.executeExtrinsic(donor, 'api.tx.unique.setTransfersEnabledFlag', [rftCollection.collectionId, false], true); + + const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); const nftTokenId = await nftContract.methods.nextTokenId().call(); - await nftContract.methods.mint(owner, nftTokenId).send(); + await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); - await fractionalizer.methods.setNftCollectionIsAllowed(nftCollectionAddress, true).send(); - await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send(); + await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, true).send({from: owner}); + await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send({from: owner}); - await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100n).call()) + await expect(fractionalizer.methods.nft2rft(nftCollection.collectionAddress, nftTokenId, 100n).call()) .to.be.rejectedWith(/TransferNotAllowed$/g); }); }); diff --git a/tests/src/eth/util/playgrounds/index.ts b/tests/src/eth/util/playgrounds/index.ts index 3bf1dd14e1..1a3d986076 100644 --- a/tests/src/eth/util/playgrounds/index.ts +++ b/tests/src/eth/util/playgrounds/index.ts @@ -12,8 +12,10 @@ export {EthUniqueHelper} from './unique.dev'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; +import chaiLike from 'chai-like'; import {requirePalletsOrSkip} from '../../../util/playgrounds'; chai.use(chaiAsPromised); +chai.use(chaiLike); export const expect = chai.expect; export const usingEthPlaygrounds = async (code: (helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { From f6544e68902b93f5a6cb40efffb78da4a461d4cb Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Tue, 4 Oct 2022 07:58:39 +0000 Subject: [PATCH 1004/1274] Move isExist method to UniqueBaseToken class --- tests/src/util/playgrounds/unique.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 73f24d11e8..8c2e3c7fa3 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -2607,6 +2607,10 @@ export class UniqueBaseToken { return await this.collection.deleteTokenProperties(signer, this.tokenId, propertyKeys); } + async isExist() { + return await this.collection.isTokenExists(this.tokenId); + } + nestingAccount() { return this.collection.helper.util.getTokenAccount(this); } @@ -2661,10 +2665,6 @@ export class UniqueNFToken extends UniqueBaseToken { return await this.collection.isTokenApproved(this.tokenId, toAddressObj); } - async isExist() { - return await this.collection.isTokenExists(this.tokenId); - } - async burn(signer: TSigner) { return await this.collection.burnToken(signer, this.tokenId); } @@ -2698,10 +2698,6 @@ export class UniqueRFToken extends UniqueBaseToken { return await this.collection.getTokenTotalPieces(this.tokenId); } - async isExist() { - return await this.collection.isTokenExists(this.tokenId); - } - async getApprovedPieces(fromAddressObj: ICrossAccountId, toAccountObj: ICrossAccountId) { return await this.collection.getTokenApprovedPieces(this.tokenId, fromAddressObj, toAccountObj); } From 3deec63c54672e329ce460719692b26649bd4871 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 28 Sep 2022 14:20:38 +0000 Subject: [PATCH 1005/1274] build: upgrade to polkadot-v0.9.29 --- Cargo.lock | 1184 +++++++++-------- Cargo.toml | 5 - client/rpc/Cargo.toml | 14 +- crates/evm-coder/Cargo.toml | 7 +- .../procedural/src/solidity_interface.rs | 2 +- crates/evm-coder/src/execution.rs | 7 +- crates/evm-coder/src/lib.rs | 2 +- crates/evm-coder/tests/conditional_is.rs | 2 +- node/cli/Cargo.toml | 132 +- node/cli/src/command.rs | 6 +- node/cli/src/service.rs | 16 +- node/rpc/Cargo.toml | 66 +- node/rpc/src/lib.rs | 2 + pallets/app-promotion/Cargo.toml | 22 +- pallets/app-promotion/src/lib.rs | 4 +- pallets/app-promotion/src/weights.rs | 120 +- pallets/common/Cargo.toml | 16 +- pallets/common/src/dispatch.rs | 2 +- pallets/common/src/lib.rs | 20 +- pallets/common/src/weights.rs | 32 +- pallets/configuration/Cargo.toml | 14 +- pallets/configuration/src/lib.rs | 4 +- pallets/evm-coder-substrate/Cargo.toml | 14 +- pallets/evm-contract-helpers/Cargo.toml | 16 +- pallets/evm-migration/Cargo.toml | 18 +- pallets/evm-migration/src/weights.rs | 40 +- pallets/evm-transaction-payment/Cargo.toml | 22 +- pallets/foreign-assets/Cargo.toml | 30 +- pallets/foreign-assets/src/lib.rs | 2 +- pallets/foreign-assets/src/weights.rs | 24 +- pallets/fungible/Cargo.toml | 14 +- pallets/fungible/src/common.rs | 16 +- pallets/fungible/src/weights.rs | 96 +- pallets/inflation/Cargo.toml | 20 +- pallets/inflation/src/lib.rs | 10 +- pallets/inflation/src/tests.rs | 3 +- pallets/nonfungible/Cargo.toml | 14 +- pallets/nonfungible/src/common.rs | 12 +- pallets/nonfungible/src/lib.rs | 4 +- pallets/nonfungible/src/weights.rs | 208 +-- pallets/proxy-rmrk-core/Cargo.toml | 14 +- pallets/proxy-rmrk-core/src/weights.rs | 228 ++-- pallets/proxy-rmrk-equip/Cargo.toml | 14 +- pallets/proxy-rmrk-equip/src/weights.rs | 52 +- pallets/refungible/Cargo.toml | 14 +- pallets/refungible/src/common.rs | 16 +- pallets/refungible/src/lib.rs | 8 +- pallets/refungible/src/weights.rs | 292 ++-- pallets/scheduler/Cargo.toml | 20 +- pallets/scheduler/src/lib.rs | 2 +- pallets/scheduler/src/weights.rs | 224 ++-- pallets/structure/Cargo.toml | 10 +- pallets/structure/src/weights.rs | 8 +- pallets/unique/Cargo.toml | 16 +- pallets/unique/src/lib.rs | 6 +- pallets/unique/src/weights.rs | 144 +- primitives/app_promotion_rpc/Cargo.toml | 10 +- primitives/common/Cargo.toml | 16 +- primitives/common/src/constants.rs | 2 +- primitives/data-structs/Cargo.toml | 12 +- primitives/rmrk-rpc/Cargo.toml | 8 +- primitives/rpc/Cargo.toml | 10 +- primitives/rpc/src/lib.rs | 5 +- runtime/common/config/ethereum.rs | 10 +- runtime/common/config/orml.rs | 2 +- runtime/common/config/parachain.rs | 4 +- runtime/common/config/xcm/mod.rs | 3 +- runtime/common/config/xcm/nativeassets.rs | 3 +- runtime/common/mod.rs | 4 +- runtime/common/runtime_apis.rs | 4 + runtime/opal/Cargo.toml | 120 +- runtime/opal/src/xcm_barrier.rs | 4 +- runtime/quartz/Cargo.toml | 118 +- runtime/tests/Cargo.toml | 26 +- runtime/unique/Cargo.toml | 118 +- 75 files changed, 1923 insertions(+), 1866 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef4c43d730..daf094c5db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -443,11 +443,12 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ + "async-trait", "beefy-primitives", "fnv", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "hex", "log", @@ -455,6 +456,7 @@ dependencies = [ "parking_lot 0.12.1", "sc-chain-spec", "sc-client-api", + "sc-consensus", "sc-finality-grandpa", "sc-keystore", "sc-network", @@ -477,11 +479,11 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "beefy-gadget", "beefy-primitives", - "futures 0.3.23", + "futures 0.3.24", "jsonrpsee", "log", "parity-scale-codec 3.1.5", @@ -497,7 +499,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "beefy-primitives", "sp-api", @@ -506,7 +508,7 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -845,6 +847,15 @@ dependencies = [ "nom", ] +[[package]] +name = "cfg-expr" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" +dependencies = [ + "smallvec", +] + [[package]] name = "cfg-if" version = "0.1.10" @@ -947,9 +958,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.17" +version = "3.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e724a68d9319343bb3328c9cc2dfde263f4b3142ee1059a9980580171c954b" +checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" dependencies = [ "atty", "bitflags", @@ -964,9 +975,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.2.17" +version = "3.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13547f7012c01ab4a0e8f8967730ada8f9fdf419e8b6c792788f39cf4e46eefa" +checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" dependencies = [ "heck", "proc-macro-error", @@ -1327,7 +1338,7 @@ dependencies = [ [[package]] name = "cumulus-client-cli" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "clap", "parity-scale-codec 3.1.5", @@ -1342,13 +1353,13 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.23", + "futures 0.3.24", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", "polkadot-node-primitives", @@ -1366,12 +1377,12 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "async-trait", "cumulus-client-consensus-common", "cumulus-primitives-core", - "futures 0.3.23", + "futures 0.3.24", "parity-scale-codec 3.1.5", "sc-client-api", "sc-consensus", @@ -1395,12 +1406,12 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "async-trait", "cumulus-relay-chain-interface", "dyn-clone", - "futures 0.3.23", + "futures 0.3.24", "parity-scale-codec 3.1.5", "polkadot-primitives", "sc-client-api", @@ -1416,12 +1427,12 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "async-trait", "cumulus-relay-chain-interface", "derive_more", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", @@ -1441,11 +1452,11 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "parity-scale-codec 3.1.5", "polkadot-node-primitives", @@ -1465,7 +1476,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -1493,7 +1504,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "frame-executive", "frame-support", @@ -1511,7 +1522,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-dmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1529,8 +1540,9 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ + "bytes", "cumulus-pallet-parachain-system-proc-macro", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", @@ -1559,7 +1571,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1570,7 +1582,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1587,7 +1599,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1605,7 +1617,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "frame-support", "parity-scale-codec 3.1.5", @@ -1621,7 +1633,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1644,10 +1656,10 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "cumulus-primitives-core", - "futures 0.3.23", + "futures 0.3.24", "parity-scale-codec 3.1.5", "sp-inherents", "sp-std", @@ -1657,10 +1669,11 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "cumulus-primitives-core", "frame-support", + "log", "parity-scale-codec 3.1.5", "polkadot-core-primitives", "polkadot-parachain", @@ -1676,14 +1689,13 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", - "parking_lot 0.12.1", "polkadot-cli", "polkadot-client", "polkadot-service", @@ -1706,12 +1718,12 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "async-trait", "cumulus-primitives-core", "derive_more", - "futures 0.3.23", + "futures 0.3.24", "jsonrpsee-core", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", @@ -1729,13 +1741,13 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "async-trait", "backoff", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "jsonrpsee", "parity-scale-codec 3.1.5", @@ -1756,7 +1768,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "cumulus-primitives-core", "parity-scale-codec 3.1.5", @@ -2018,6 +2030,20 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ed25519-zebra" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" +dependencies = [ + "curve25519-dalek 3.2.0", + "hex", + "rand_core 0.6.3", + "sha2 0.9.9", + "thiserror", + "zeroize", +] + [[package]] name = "either" version = "1.7.0" @@ -2184,7 +2210,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "evm" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.29#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "auto_impl", "environmental", @@ -2208,6 +2234,7 @@ dependencies = [ "ethereum", "evm-coder-procedural", "evm-core", + "frame-support", "hex", "hex-literal", "impl-trait-for-tuples", @@ -2230,7 +2257,7 @@ dependencies = [ [[package]] name = "evm-core" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.29#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "parity-scale-codec 3.1.5", "primitive-types", @@ -2241,7 +2268,7 @@ dependencies = [ [[package]] name = "evm-gasometer" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.29#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "environmental", "evm-core", @@ -2252,7 +2279,7 @@ dependencies = [ [[package]] name = "evm-runtime" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.27#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.29#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "auto_impl", "environmental", @@ -2267,7 +2294,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", ] [[package]] @@ -2344,7 +2371,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "async-trait", "fc-db", @@ -2363,7 +2390,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -2379,12 +2406,12 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "fc-db", "fp-consensus", "fp-rpc", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "log", "sc-client-api", @@ -2396,7 +2423,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "ethereum", "ethereum-types", @@ -2405,7 +2432,7 @@ dependencies = [ "fc-rpc-core", "fp-rpc", "fp-storage", - "futures 0.3.23", + "futures 0.3.24", "hex", "jsonrpsee", "libsecp256k1", @@ -2418,6 +2445,7 @@ dependencies = [ "rustc-hex", "sc-client-api", "sc-network", + "sc-network-common", "sc-rpc", "sc-service", "sc-transaction-pool", @@ -2425,6 +2453,7 @@ dependencies = [ "sp-api", "sp-block-builder", "sp-blockchain", + "sp-consensus", "sp-core", "sp-io", "sp-runtime", @@ -2436,7 +2465,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "ethereum", "ethereum-types", @@ -2495,7 +2524,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b22349c6a11563a202d95772a68e0fcf56119e74ea8a2a19cf2301460fcd0df5" dependencies = [ "either", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "log", "num-traits", @@ -2559,7 +2588,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "parity-scale-codec 3.1.5", ] @@ -2577,7 +2606,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "ethereum", "parity-scale-codec 3.1.5", @@ -2589,7 +2618,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "evm", "frame-support", @@ -2603,7 +2632,7 @@ dependencies = [ [[package]] name = "fp-evm-mapping" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "frame-support", "sp-core", @@ -2612,7 +2641,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "ethereum", "ethereum-types", @@ -2629,7 +2658,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "ethereum", "frame-support", @@ -2645,7 +2674,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "parity-scale-codec 3.1.5", ] @@ -2653,7 +2682,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-support", "frame-system", @@ -2665,6 +2694,7 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", + "sp-core", "sp-io", "sp-runtime", "sp-runtime-interface", @@ -2675,7 +2705,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "Inflector", "chrono", @@ -2726,7 +2756,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2737,7 +2767,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2753,10 +2783,11 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-support", "frame-system", + "frame-try-runtime", "parity-scale-codec 3.1.5", "scale-info", "sp-core", @@ -2781,7 +2812,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "bitflags", "frame-metadata", @@ -2795,6 +2826,7 @@ dependencies = [ "scale-info", "serde", "smallvec", + "sp-api", "sp-arithmetic", "sp-core", "sp-core-hashing-proc-macro", @@ -2811,10 +2843,12 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "Inflector", + "cfg-expr", "frame-support-procedural-tools", + "itertools", "proc-macro2", "quote", "syn", @@ -2823,7 +2857,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2835,7 +2869,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "proc-macro2", "quote", @@ -2845,7 +2879,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-support", "log", @@ -2862,7 +2896,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -2877,7 +2911,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "parity-scale-codec 3.1.5", "sp-api", @@ -2886,9 +2920,10 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-support", + "parity-scale-codec 3.1.5", "sp-api", "sp-runtime", "sp-std", @@ -2948,9 +2983,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab30e97ab6aacfe635fad58f22c2bb06c8b685f7421eb1e064a729e2a5f481fa" +checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" dependencies = [ "futures-channel", "futures-core", @@ -2963,9 +2998,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bfc52cbddcfd745bf1740338492bb0bd83d76c67b445f91c5fb29fae29ecaa1" +checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" dependencies = [ "futures-core", "futures-sink", @@ -2973,15 +3008,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2acedae88d38235936c3922476b10fced7b2b68136f5e3c03c2d5be348a1115" +checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" [[package]] name = "futures-executor" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d11aa21b5b587a64682c0094c2bdd4df0076c5324961a40cc3abd7f37930528" +checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" dependencies = [ "futures-core", "futures-task", @@ -2991,9 +3026,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93a66fc6d035a26a3ae255a6d2bca35eda63ae4c5512bef54449113f7a1228e5" +checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" [[package]] name = "futures-lite" @@ -3012,9 +3047,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0db9cce532b0eae2ccf2766ab246f114b56b9cf6d445e00c2549fbc100ca045d" +checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" dependencies = [ "proc-macro2", "quote", @@ -3034,15 +3069,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0bae1fe9752cf7fd9b0064c674ae63f97b37bc714d745cbde0afb7ec4e6765" +checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" [[package]] name = "futures-task" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "842fc63b931f4056a24d59de13fb1272134ce261816e063e634ad0c15cdc5306" +checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" [[package]] name = "futures-timer" @@ -3052,9 +3087,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0828a5471e340229c11c77ca80017937ce3c58cb788a17e5f1c2d5c485a9577" +checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" dependencies = [ "futures 0.1.31", "futures-channel", @@ -3457,7 +3492,7 @@ dependencies = [ "async-io", "core-foundation", "fnv", - "futures 0.3.23", + "futures 0.3.24", "if-addrs", "ipnet", "log", @@ -3616,8 +3651,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.14.0" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bd0d559d5e679b1ab2f869b486a11182923863b1b3ee8b421763cdd707b783a" dependencies = [ "jsonrpsee-core", "jsonrpsee-http-server", @@ -3630,8 +3666,9 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.14.0" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8752740ecd374bcbf8b69f3e80b0327942df76f793f8d4e60d3355650c31fb74" dependencies = [ "futures-util", "http", @@ -3650,8 +3687,9 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.14.0" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3dc3e9cf2ba50b7b1d7d76a667619f82846caa39e8e8daa8a4962d74acaddca" dependencies = [ "anyhow", "arrayvec 0.7.2", @@ -3662,6 +3700,7 @@ dependencies = [ "futures-timer", "futures-util", "globset", + "http", "hyper", "jsonrpsee-types", "lazy_static", @@ -3674,13 +3713,15 @@ dependencies = [ "thiserror", "tokio", "tracing", + "tracing-futures", "unicase", ] [[package]] name = "jsonrpsee-http-server" -version = "0.14.0" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03802f0373a38c2420c70b5144742d800b509e2937edc4afb116434f07120117" dependencies = [ "futures-channel", "futures-util", @@ -3691,12 +3732,14 @@ dependencies = [ "serde_json", "tokio", "tracing", + "tracing-futures", ] [[package]] name = "jsonrpsee-proc-macros" -version = "0.14.0" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd67957d4280217247588ac86614ead007b301ca2fa9f19c19f880a536f029e3" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3706,8 +3749,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.14.0" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e290bba767401b646812f608c099b922d8142603c9e73a50fb192d3ac86f4a0d" dependencies = [ "anyhow", "beef", @@ -3719,9 +3763,11 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.14.0" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ee5feddd5188e62ac08fcf0e56478138e581509d4730f3f7be9b57dd402a4ff" dependencies = [ + "http", "jsonrpsee-client-transport", "jsonrpsee-core", "jsonrpsee-types", @@ -3729,11 +3775,13 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-server" -version = "0.14.0" -source = "git+https://github.com/uniquenetwork/jsonrpsee?branch=unique-v0.14.0-fix-unknown-fields#01bb8a7ec51880c79206bdcac4f09d54e58b2da8" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d488ba74fb369e5ab68926feb75a483458b88e768d44319f37e4ecad283c7325" dependencies = [ "futures-channel", "futures-util", + "http", "jsonrpsee-core", "jsonrpsee-types", "serde_json", @@ -3742,6 +3790,7 @@ dependencies = [ "tokio-stream", "tokio-util", "tracing", + "tracing-futures", ] [[package]] @@ -3764,8 +3813,8 @@ checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" [[package]] name = "kusama-runtime" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -3857,8 +3906,8 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "frame-support", "polkadot-primitives", @@ -3966,7 +4015,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81327106887e42d004fbdab1fef93675be2e2e07c1b95fce45e2cc813485611d" dependencies = [ "bytes", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "getrandom 0.2.7", "instant", @@ -4010,7 +4059,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4decc51f3573653a9f4ecacb31b1b922dd20c25a6322bb15318ec04287ec46f9" dependencies = [ "async-trait", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "instant", "libp2p-core", @@ -4033,7 +4082,7 @@ dependencies = [ "ed25519-dalek", "either", "fnv", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "instant", "lazy_static", @@ -4064,7 +4113,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0183dc2a3da1fbbf85e5b6cf51217f55b14f5daea0c455a9536eef646bfec71" dependencies = [ "flate2", - "futures 0.3.23", + "futures 0.3.24", "libp2p-core", ] @@ -4075,7 +4124,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6cbf54723250fa5d521383be789bf60efdabe6bacfb443f87da261019a49b4b5" dependencies = [ "async-std-resolver", - "futures 0.3.23", + "futures 0.3.24", "libp2p-core", "log", "parking_lot 0.12.1", @@ -4091,7 +4140,7 @@ checksum = "98a4b6ffd53e355775d24b76f583fdda54b3284806f678499b57913adb94f231" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.23", + "futures 0.3.24", "libp2p-core", "libp2p-swarm", "log", @@ -4112,7 +4161,7 @@ dependencies = [ "byteorder", "bytes", "fnv", - "futures 0.3.23", + "futures 0.3.24", "hex_fmt", "instant", "libp2p-core", @@ -4136,7 +4185,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c50b585518f8efd06f93ac2f976bd672e17cdac794644b3117edd078e96bda06" dependencies = [ "asynchronous-codec", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "libp2p-core", "libp2p-swarm", @@ -4161,7 +4210,7 @@ dependencies = [ "bytes", "either", "fnv", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "instant", "libp2p-core", @@ -4187,7 +4236,7 @@ dependencies = [ "async-io", "data-encoding", "dns-parser", - "futures 0.3.23", + "futures 0.3.24", "if-watch", "lazy_static", "libp2p-core", @@ -4223,7 +4272,7 @@ checksum = "61fd1b20638ec209c5075dfb2e8ce6a7ea4ec3cd3ad7b77f7a477c06d53322e2" dependencies = [ "asynchronous-codec", "bytes", - "futures 0.3.23", + "futures 0.3.24", "libp2p-core", "log", "nohash-hasher", @@ -4241,7 +4290,7 @@ checksum = "762408cb5d84b49a600422d7f9a42c18012d8da6ebcd570f9a4a4290ba41fb6f" dependencies = [ "bytes", "curve25519-dalek 3.2.0", - "futures 0.3.23", + "futures 0.3.24", "lazy_static", "libp2p-core", "log", @@ -4261,7 +4310,7 @@ version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "100a6934ae1dbf8a693a4e7dd1d730fd60b774dafc45688ed63b554497c6c925" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "instant", "libp2p-core", @@ -4279,7 +4328,7 @@ checksum = "be27bf0820a6238a4e06365b096d428271cce85a129cf16f2fe9eb1610c4df86" dependencies = [ "asynchronous-codec", "bytes", - "futures 0.3.23", + "futures 0.3.24", "libp2p-core", "log", "prost", @@ -4294,7 +4343,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f1a458bbda880107b5b36fcb9b5a1ef0c329685da0e203ed692a8ebe64cc92c" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "log", "pin-project", "rand 0.7.3", @@ -4311,7 +4360,7 @@ dependencies = [ "asynchronous-codec", "bytes", "either", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "instant", "libp2p-core", @@ -4336,7 +4385,7 @@ checksum = "9511c9672ba33284838e349623319c8cad2d18cfad243ae46c6b7e8a2982ea4e" dependencies = [ "asynchronous-codec", "bimap", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "instant", "libp2p-core", @@ -4359,7 +4408,7 @@ checksum = "508a189e2795d892c8f5c1fa1e9e0b1845d32d7b0b249dbf7b05b18811361843" dependencies = [ "async-trait", "bytes", - "futures 0.3.23", + "futures 0.3.24", "instant", "libp2p-core", "libp2p-swarm", @@ -4377,7 +4426,7 @@ checksum = "95ac5be6c2de2d1ff3f7693fda6faf8a827b1f3e808202277783fea9f527d114" dependencies = [ "either", "fnv", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "instant", "libp2p-core", @@ -4406,7 +4455,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a6771dc19aa3c65d6af9a8c65222bfc8fcd446630ddca487acd161fa6096f3b" dependencies = [ "async-io", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "if-watch", "ipnet", @@ -4423,7 +4472,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d125e3e5f0d58f3c6ac21815b20cf4b6a88b8db9dc26368ea821838f4161fd4d" dependencies = [ "async-std", - "futures 0.3.23", + "futures 0.3.24", "libp2p-core", "log", ] @@ -4434,7 +4483,7 @@ version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec894790eec3c1608f8d1a8a0bdf0dbeb79ed4de2dce964222011c2896dfa05a" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -4449,7 +4498,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9808e57e81be76ff841c106b4c5974fb4d41a233a7bdd2afbf1687ac6def3818" dependencies = [ "either", - "futures 0.3.23", + "futures 0.3.24", "futures-rustls", "libp2p-core", "log", @@ -4467,7 +4516,7 @@ version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6dea686217a06072033dc025631932810e2f6ad784e4fafa42e27d311c7a81c" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "libp2p-core", "parking_lot 0.12.1", "thiserror", @@ -4787,7 +4836,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "rand 0.8.5", "thrift", ] @@ -4898,7 +4947,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "363a84be6453a70e63513660f4894ef815daf88e3356bffcda9ca27d810ce83b" dependencies = [ "bytes", - "futures 0.3.23", + "futures 0.3.24", "log", "pin-project", "smallvec", @@ -4994,7 +5043,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ "bytes", - "futures 0.3.23", + "futures 0.3.24", "log", "netlink-packet-core", "netlink-sys", @@ -5010,7 +5059,7 @@ checksum = "92b654097027250401127914afb37cb1f311df6610a9891ff07a757e94199027" dependencies = [ "async-io", "bytes", - "futures 0.3.23", + "futures 0.3.24", "libc", "log", ] @@ -5169,7 +5218,7 @@ checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" [[package]] name = "opal-runtime" -version = "0.9.27" +version = "0.9.29" dependencies = [ "app-promotion-rpc", "cumulus-pallet-aura-ext", @@ -5281,11 +5330,11 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "orchestra" version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "async-trait", "dyn-clonable", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "orchestra-proc-macro", "pin-project", @@ -5297,7 +5346,7 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "expander 0.0.6", "itertools", @@ -5320,7 +5369,7 @@ dependencies = [ [[package]] name = "orml-tokens" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" +source = "git+https://github.com/UniqueNetwork/open-runtime-module-library?branch=polkadot-v0.9.29#2caeb6621a59cbf37829d6a80bc2b89195959d45" dependencies = [ "frame-support", "frame-system", @@ -5335,7 +5384,7 @@ dependencies = [ [[package]] name = "orml-traits" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" +source = "git+https://github.com/UniqueNetwork/open-runtime-module-library?branch=polkadot-v0.9.29#2caeb6621a59cbf37829d6a80bc2b89195959d45" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -5353,7 +5402,7 @@ dependencies = [ [[package]] name = "orml-utilities" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" +source = "git+https://github.com/UniqueNetwork/open-runtime-module-library?branch=polkadot-v0.9.29#2caeb6621a59cbf37829d6a80bc2b89195959d45" dependencies = [ "frame-support", "parity-scale-codec 3.1.5", @@ -5367,7 +5416,7 @@ dependencies = [ [[package]] name = "orml-vesting" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" +source = "git+https://github.com/UniqueNetwork/open-runtime-module-library?branch=polkadot-v0.9.29#2caeb6621a59cbf37829d6a80bc2b89195959d45" dependencies = [ "frame-support", "frame-system", @@ -5382,7 +5431,7 @@ dependencies = [ [[package]] name = "orml-xcm-support" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" +source = "git+https://github.com/UniqueNetwork/open-runtime-module-library?branch=polkadot-v0.9.29#2caeb6621a59cbf37829d6a80bc2b89195959d45" dependencies = [ "frame-support", "orml-traits", @@ -5396,7 +5445,7 @@ dependencies = [ [[package]] name = "orml-xtokens" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362" +source = "git+https://github.com/UniqueNetwork/open-runtime-module-library?branch=polkadot-v0.9.29#2caeb6621a59cbf37829d6a80bc2b89195959d45" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -5457,7 +5506,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-support", "frame-system", @@ -5473,7 +5522,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-support", "frame-system", @@ -5489,7 +5538,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-support", "frame-system", @@ -5504,7 +5553,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5528,7 +5577,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5548,7 +5597,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5563,7 +5612,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "fp-evm", "frame-support", @@ -5578,7 +5627,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "beefy-primitives", "frame-support", @@ -5594,7 +5643,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -5617,7 +5666,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5635,7 +5684,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5654,7 +5703,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5708,7 +5757,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5724,7 +5773,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5747,7 +5796,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5760,7 +5809,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5778,7 +5827,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "ethereum", "ethereum-types", @@ -5807,7 +5856,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.27-fee-limit#0ae36821312f4a26e7f96225f1b2cb16216cddf5" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "evm", "fp-evm", @@ -5960,7 +6009,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5975,7 +6024,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5998,7 +6047,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6014,7 +6063,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6034,7 +6083,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6070,7 +6119,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6087,7 +6136,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -6105,7 +6154,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "jsonrpsee", "parity-scale-codec 3.1.5", @@ -6120,7 +6169,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6135,7 +6184,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-support", "frame-system", @@ -6152,7 +6201,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6171,7 +6220,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "parity-scale-codec 3.1.5", "sp-api", @@ -6203,7 +6252,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-support", "frame-system", @@ -6220,7 +6269,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6243,7 +6292,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6259,7 +6308,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6274,7 +6323,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-support", "frame-system", @@ -6288,7 +6337,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6367,7 +6416,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6383,7 +6432,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-support", "frame-system", @@ -6404,7 +6453,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6420,7 +6469,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-support", "frame-system", @@ -6434,7 +6483,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6457,7 +6506,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6468,7 +6517,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "log", "sp-arithmetic", @@ -6492,7 +6541,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-support", "frame-system", @@ -6506,7 +6555,7 @@ dependencies = [ [[package]] name = "pallet-template-transaction-payment" version = "3.0.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.29#3f663c3ee19933cd5545e0420ce2562fa8301235" dependencies = [ "frame-benchmarking", "frame-support", @@ -6526,7 +6575,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6544,7 +6593,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6563,7 +6612,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-support", "frame-system", @@ -6579,7 +6628,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6594,7 +6643,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "pallet-transaction-payment", "parity-scale-codec 3.1.5", @@ -6605,7 +6654,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6665,7 +6714,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6681,7 +6730,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6695,8 +6744,8 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "frame-support", "frame-system", @@ -6713,8 +6762,8 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "frame-benchmarking", "frame-support", @@ -6731,7 +6780,7 @@ dependencies = [ [[package]] name = "parachain-info" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.27#66b684f88eba6c755651b8c47dccad2c2d9ac3db" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -6783,6 +6832,7 @@ dependencies = [ "arrayvec 0.7.2", "bitvec 1.0.1", "byte-slice-cast", + "bytes", "impl-trait-for-tuples", "parity-scale-codec-derive 3.1.3", "serde", @@ -7058,10 +7108,10 @@ checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" [[package]] name = "polkadot-approval-distribution" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7073,10 +7123,10 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7087,12 +7137,12 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "derive_more", "fatality", - "futures 0.3.23", + "futures 0.3.24", "lru 0.7.8", "parity-scale-codec 3.1.5", "polkadot-erasure-coding", @@ -7110,11 +7160,11 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "fatality", - "futures 0.3.23", + "futures 0.3.24", "lru 0.7.8", "parity-scale-codec 3.1.5", "polkadot-erasure-coding", @@ -7131,12 +7181,12 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "clap", "frame-benchmarking-cli", - "futures 0.3.23", + "futures 0.3.24", "log", "polkadot-client", "polkadot-node-core-pvf", @@ -7157,8 +7207,8 @@ dependencies = [ [[package]] name = "polkadot-client" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "beefy-primitives", "frame-benchmarking", @@ -7197,12 +7247,12 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "always-assert", "fatality", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -7218,8 +7268,8 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "parity-scale-codec 3.1.5", "parity-util-mem", @@ -7231,12 +7281,12 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "derive_more", "fatality", - "futures 0.3.23", + "futures 0.3.24", "lru 0.7.8", "parity-scale-codec 3.1.5", "polkadot-erasure-coding", @@ -7254,8 +7304,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "parity-scale-codec 3.1.5", "polkadot-node-primitives", @@ -7268,10 +7318,10 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-subsystem", @@ -7288,14 +7338,14 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "always-assert", "async-trait", "bytes", "fatality", - "futures 0.3.23", + "futures 0.3.24", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", "polkadot-node-network-protocol", @@ -7304,6 +7354,7 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "sc-network", + "sc-network-common", "sp-consensus", "thiserror", "tracing-gum", @@ -7311,10 +7362,10 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "parity-scale-codec 3.1.5", "polkadot-erasure-coding", "polkadot-node-primitives", @@ -7329,12 +7380,12 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "bitvec 1.0.1", "derive_more", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "kvdb", "lru 0.7.8", @@ -7358,11 +7409,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "bitvec 1.0.1", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "kvdb", "parity-scale-codec 3.1.5", @@ -7378,12 +7429,12 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "bitvec 1.0.1", "fatality", - "futures 0.3.23", + "futures 0.3.24", "polkadot-erasure-coding", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7397,10 +7448,10 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", @@ -7412,11 +7463,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "async-trait", - "futures 0.3.23", + "futures 0.3.24", "parity-scale-codec 3.1.5", "polkadot-node-core-pvf", "polkadot-node-primitives", @@ -7430,10 +7481,10 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", @@ -7445,10 +7496,10 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "kvdb", "parity-scale-codec 3.1.5", @@ -7462,11 +7513,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "fatality", - "futures 0.3.23", + "futures 0.3.24", "kvdb", "lru 0.7.8", "parity-scale-codec 3.1.5", @@ -7481,11 +7532,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "async-trait", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "polkadot-node-subsystem", "polkadot-primitives", @@ -7498,12 +7549,12 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "bitvec 1.0.1", "fatality", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7516,14 +7567,14 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "always-assert", "assert_matches", "async-process", "async-std", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "parity-scale-codec 3.1.5", "pin-project", @@ -7548,10 +7599,10 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7564,10 +7615,10 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "memory-lru", "parity-util-mem", "polkadot-node-subsystem", @@ -7580,8 +7631,8 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "async-std", "lazy_static", @@ -7598,11 +7649,11 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "bs58", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "log", "parity-scale-codec 3.1.5", @@ -7617,13 +7668,14 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "async-trait", "derive_more", "fatality", - "futures 0.3.23", + "futures 0.3.24", + "hex", "parity-scale-codec 3.1.5", "polkadot-node-jaeger", "polkadot-node-primitives", @@ -7638,11 +7690,11 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "bounded-vec", - "futures 0.3.23", + "futures 0.3.24", "parity-scale-codec 3.1.5", "polkadot-parachain", "polkadot-primitives", @@ -7660,8 +7712,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -7670,12 +7722,12 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "async-trait", "derive_more", - "futures 0.3.23", + "futures 0.3.24", "orchestra", "polkadot-node-jaeger", "polkadot-node-network-protocol", @@ -7693,13 +7745,13 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "async-trait", "derive_more", "fatality", - "futures 0.3.23", + "futures 0.3.24", "itertools", "kvdb", "lru 0.7.8", @@ -7726,11 +7778,11 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "async-trait", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "lru 0.7.8", "orchestra", @@ -7749,8 +7801,8 @@ dependencies = [ [[package]] name = "polkadot-parachain" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "derive_more", "frame-support", @@ -7766,8 +7818,8 @@ dependencies = [ [[package]] name = "polkadot-performance-test" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "env_logger", "kusama-runtime", @@ -7781,8 +7833,8 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "bitvec 1.0.1", "frame-system", @@ -7811,8 +7863,8 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "beefy-gadget", "beefy-gadget-rpc", @@ -7843,8 +7895,8 @@ dependencies = [ [[package]] name = "polkadot-runtime" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -7876,6 +7928,9 @@ dependencies = [ "pallet-indices", "pallet-membership", "pallet-multisig", + "pallet-nomination-pools", + "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", "pallet-offences", "pallet-offences-benchmarking", "pallet-preimage", @@ -7928,8 +7983,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -7975,8 +8030,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "frame-support", "polkadot-primitives", @@ -7987,8 +8042,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "bs58", "parity-scale-codec 3.1.5", @@ -7999,8 +8054,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "bitflags", "bitvec 1.0.1", @@ -8042,14 +8097,15 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "async-trait", "beefy-gadget", "beefy-primitives", + "frame-support", "frame-system-rpc-runtime-api", - "futures 0.3.23", + "futures 0.3.24", "hex-literal", "kusama-runtime", "kvdb", @@ -8105,11 +8161,11 @@ dependencies = [ "sc-consensus", "sc-consensus-babe", "sc-consensus-slots", - "sc-consensus-uncles", "sc-executor", "sc-finality-grandpa", "sc-keystore", "sc-network", + "sc-network-common", "sc-offchain", "sc-service", "sc-sync-state-rpc", @@ -8145,12 +8201,12 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "arrayvec 0.5.2", "fatality", - "futures 0.3.23", + "futures 0.3.24", "indexmap", "parity-scale-codec 3.1.5", "polkadot-node-network-protocol", @@ -8166,8 +8222,8 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "parity-scale-codec 3.1.5", "polkadot-primitives", @@ -8176,8 +8232,8 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -8237,12 +8293,12 @@ dependencies = [ [[package]] name = "polkadot-test-service" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "frame-benchmarking", "frame-system", - "futures 0.3.23", + "futures 0.3.24", "hex", "pallet-balances", "pallet-staking", @@ -8267,6 +8323,7 @@ dependencies = [ "sc-executor", "sc-finality-grandpa", "sc-network", + "sc-network-common", "sc-service", "sc-tracing", "sc-transaction-pool", @@ -8347,12 +8404,12 @@ dependencies = [ [[package]] name = "prioritized-metered-channel" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "coarsetime", "crossbeam-queue", "derive_more", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "nanorand", "thiserror", @@ -8884,7 +8941,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "env_logger", "jsonrpsee", @@ -8917,12 +8974,6 @@ dependencies = [ "quick-error", ] -[[package]] -name = "retain_mut" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" - [[package]] name = "rfc6979" version = "0.1.0" @@ -9004,8 +9055,8 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -9073,8 +9124,8 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "frame-support", "polkadot-primitives", @@ -9085,9 +9136,9 @@ dependencies = [ [[package]] name = "rpassword" -version = "5.0.1" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb" +checksum = "26b763cb66df1c928432cc35053f8bd4cec3335d8559fc16010017d16b3c1680" dependencies = [ "libc", "winapi", @@ -9100,7 +9151,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" dependencies = [ "async-global-executor", - "futures 0.3.23", + "futures 0.3.24", "log", "netlink-packet-route", "netlink-proto", @@ -9217,7 +9268,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "pin-project", "static_assertions", ] @@ -9258,7 +9309,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "log", "sp-core", @@ -9269,10 +9320,10 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "ip_network", "libp2p", @@ -9282,7 +9333,7 @@ dependencies = [ "prost-build", "rand 0.7.3", "sc-client-api", - "sc-network", + "sc-network-common", "sp-api", "sp-authority-discovery", "sp-blockchain", @@ -9296,9 +9347,9 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "log", "parity-scale-codec 3.1.5", @@ -9319,7 +9370,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "parity-scale-codec 3.1.5", "sc-client-api", @@ -9335,13 +9386,13 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.7", "parity-scale-codec 3.1.5", "sc-chain-spec-derive", - "sc-network", + "sc-network-common", "sc-telemetry", "serde", "serde_json", @@ -9352,7 +9403,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9363,12 +9414,12 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "chrono", "clap", "fdlimit", - "futures 0.3.23", + "futures 0.3.24", "hex", "libp2p", "log", @@ -9402,10 +9453,10 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "fnv", - "futures 0.3.23", + "futures 0.3.24", "hash-db", "log", "parity-scale-codec 3.1.5", @@ -9430,7 +9481,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "hash-db", "kvdb", @@ -9455,10 +9506,10 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "libp2p", "log", @@ -9479,10 +9530,10 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", - "futures 0.3.23", + "futures 0.3.24", "log", "parity-scale-codec 3.1.5", "sc-block-builder", @@ -9508,11 +9559,11 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", "fork-tree", - "futures 0.3.23", + "futures 0.3.24", "log", "merlin", "num-bigint", @@ -9521,7 +9572,6 @@ dependencies = [ "parity-scale-codec 3.1.5", "parking_lot 0.12.1", "rand 0.7.3", - "retain_mut", "sc-client-api", "sc-consensus", "sc-consensus-epochs", @@ -9551,9 +9601,9 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "jsonrpsee", "sc-consensus-babe", "sc-consensus-epochs", @@ -9573,7 +9623,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "fork-tree", "parity-scale-codec 3.1.5", @@ -9586,11 +9636,11 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "assert_matches", "async-trait", - "futures 0.3.23", + "futures 0.3.24", "jsonrpsee", "log", "parity-scale-codec 3.1.5", @@ -9620,10 +9670,10 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "log", "parity-scale-codec 3.1.5", @@ -9642,21 +9692,10 @@ dependencies = [ "thiserror", ] -[[package]] -name = "sc-consensus-uncles" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "sc-client-api", - "sp-authorship", - "sp-runtime", - "thiserror", -] - [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "lazy_static", "lru 0.7.8", @@ -9683,14 +9722,13 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "environmental", "parity-scale-codec 3.1.5", "sc-allocator", "sp-maybe-compressed-blob", "sp-sandbox", - "sp-serializer", "sp-wasm-interface", "thiserror", "wasm-instrument", @@ -9700,7 +9738,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "log", "parity-scale-codec 3.1.5", @@ -9715,7 +9753,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "cfg-if 1.0.0", "libc", @@ -9723,6 +9761,7 @@ dependencies = [ "once_cell", "parity-scale-codec 3.1.5", "parity-wasm 0.42.2", + "rustix 0.33.7", "rustix 0.35.7", "sc-allocator", "sc-executor-common", @@ -9735,14 +9774,14 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "ahash", "async-trait", "dyn-clone", "finality-grandpa", "fork-tree", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "hex", "log", @@ -9776,10 +9815,10 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "finality-grandpa", - "futures 0.3.23", + "futures 0.3.24", "jsonrpsee", "log", "parity-scale-codec 3.1.5", @@ -9797,15 +9836,15 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "ansi_term", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "log", "parity-util-mem", "sc-client-api", - "sc-network", + "sc-network-common", "sc-transaction-pool-api", "sp-blockchain", "sp-runtime", @@ -9814,7 +9853,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", "hex", @@ -9829,7 +9868,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", "asynchronous-codec", @@ -9839,7 +9878,7 @@ dependencies = [ "either", "fnv", "fork-tree", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "hex", "ip_network", @@ -9878,33 +9917,39 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ + "async-trait", "bitflags", - "futures 0.3.23", + "bytes", + "futures 0.3.24", "libp2p", "parity-scale-codec 3.1.5", "prost-build", "sc-consensus", "sc-peerset", + "serde", "smallvec", + "sp-blockchain", "sp-consensus", "sp-finality-grandpa", "sp-runtime", + "thiserror", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "ahash", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "libp2p", "log", "lru 0.7.8", - "sc-network", + "sc-network-common", + "sc-peerset", "sp-runtime", "substrate-prometheus-endpoint", "tracing", @@ -9913,9 +9958,10 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", + "hex", "libp2p", "log", "parity-scale-codec 3.1.5", @@ -9933,10 +9979,11 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "fork-tree", - "futures 0.3.23", + "futures 0.3.24", + "hex", "libp2p", "log", "lru 0.7.8", @@ -9960,22 +10007,24 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "bytes", "fnv", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "hex", "hyper", "hyper-rustls", + "libp2p", "num_cpus", "once_cell", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", "rand 0.7.3", "sc-client-api", - "sc-network", + "sc-network-common", + "sc-peerset", "sc-utils", "sp-api", "sp-core", @@ -9988,9 +10037,9 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "libp2p", "log", "sc-utils", @@ -10001,7 +10050,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -10010,9 +10059,9 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "hash-db", "jsonrpsee", "log", @@ -10040,9 +10089,9 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "jsonrpsee", "log", "parity-scale-codec 3.1.5", @@ -10063,9 +10112,9 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "jsonrpsee", "log", "serde_json", @@ -10076,12 +10125,12 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", "directories", "exit-future", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "hash-db", "jsonrpsee", @@ -10143,7 +10192,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "log", "parity-scale-codec 3.1.5", @@ -10157,7 +10206,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "jsonrpsee", "parity-scale-codec 3.1.5", @@ -10176,9 +10225,9 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "libc", "log", "rand 0.7.3", @@ -10195,10 +10244,10 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "chrono", - "futures 0.3.23", + "futures 0.3.24", "libp2p", "log", "parking_lot 0.12.1", @@ -10213,7 +10262,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "ansi_term", "atty", @@ -10244,7 +10293,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10255,16 +10304,15 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "linked-hash-map", "log", "parity-scale-codec 3.1.5", "parity-util-mem", "parking_lot 0.12.1", - "retain_mut", "sc-client-api", "sc-transaction-pool-api", "sc-utils", @@ -10282,9 +10330,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "log", "serde", "sp-blockchain", @@ -10295,9 +10343,9 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "lazy_static", "log", @@ -10472,18 +10520,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.143" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e8e5d5b70924f74ff5c6d64d9a5acd91422117c60f48c4e07855238a254553" +checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.143" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3d8e8de557aee63c26b85b947f5e59b690d0454c753f3adeb5cd7835ab88391" +checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" dependencies = [ "proc-macro2", "quote", @@ -10492,9 +10540,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.83" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7" +checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" dependencies = [ "itoa 1.0.3", "ryu", @@ -10665,8 +10713,8 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "enumn", "parity-scale-codec 3.1.5", @@ -10732,7 +10780,7 @@ dependencies = [ "base64", "bytes", "flate2", - "futures 0.3.23", + "futures 0.3.24", "httparse", "log", "rand 0.8.5", @@ -10742,7 +10790,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "hash-db", "log", @@ -10752,6 +10800,7 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-std", + "sp-trie", "sp-version", "thiserror", ] @@ -10759,7 +10808,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "blake2", "proc-macro-crate", @@ -10771,7 +10820,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -10784,7 +10833,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "integer-sqrt", "num-traits", @@ -10799,7 +10848,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -10812,7 +10861,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", "parity-scale-codec 3.1.5", @@ -10824,7 +10873,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "parity-scale-codec 3.1.5", "sp-api", @@ -10836,9 +10885,9 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "log", "lru 0.7.8", "parity-scale-codec 3.1.5", @@ -10854,10 +10903,10 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", - "futures 0.3.23", + "futures 0.3.24", "futures-timer", "log", "parity-scale-codec 3.1.5", @@ -10873,7 +10922,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", "parity-scale-codec 3.1.5", @@ -10891,7 +10940,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", "merlin", @@ -10914,7 +10963,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -10928,7 +10977,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -10941,15 +10990,15 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "base58", "bitflags", "blake2-rfc", "byteorder", "dyn-clonable", - "ed25519-dalek", - "futures 0.3.23", + "ed25519-zebra", + "futures 0.3.24", "hash-db", "hash256-std-hasher", "hex", @@ -10987,7 +11036,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "blake2", "byteorder", @@ -11001,7 +11050,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "proc-macro2", "quote", @@ -11012,7 +11061,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -11021,7 +11070,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "proc-macro2", "quote", @@ -11031,7 +11080,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "environmental", "parity-scale-codec 3.1.5", @@ -11042,7 +11091,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "finality-grandpa", "log", @@ -11060,7 +11109,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -11074,9 +11123,10 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ - "futures 0.3.23", + "bytes", + "futures 0.3.24", "hash-db", "libsecp256k1", "log", @@ -11099,7 +11149,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "lazy_static", "sp-core", @@ -11110,10 +11160,10 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", - "futures 0.3.23", + "futures 0.3.24", "merlin", "parity-scale-codec 3.1.5", "parking_lot 0.12.1", @@ -11127,7 +11177,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "thiserror", "zstd", @@ -11136,7 +11186,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "log", "parity-scale-codec 3.1.5", @@ -11151,7 +11201,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -11165,7 +11215,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "sp-api", "sp-core", @@ -11175,7 +11225,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "backtrace", "lazy_static", @@ -11185,7 +11235,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "rustc-hash", "serde", @@ -11195,7 +11245,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "either", "hash256-std-hasher", @@ -11217,8 +11267,9 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ + "bytes", "impl-trait-for-tuples", "parity-scale-codec 3.1.5", "primitive-types", @@ -11234,7 +11285,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "Inflector", "proc-macro-crate", @@ -11246,7 +11297,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "log", "parity-scale-codec 3.1.5", @@ -11257,19 +11308,10 @@ dependencies = [ "wasmi", ] -[[package]] -name = "sp-serializer" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -11283,7 +11325,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "parity-scale-codec 3.1.5", "scale-info", @@ -11294,7 +11336,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "hash-db", "log", @@ -11316,12 +11358,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "impl-serde", "parity-scale-codec 3.1.5", @@ -11334,7 +11376,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "log", "sp-core", @@ -11347,7 +11389,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", "futures-timer", @@ -11363,7 +11405,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "parity-scale-codec 3.1.5", "sp-std", @@ -11375,7 +11417,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "sp-api", "sp-runtime", @@ -11384,7 +11426,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", "log", @@ -11400,15 +11442,22 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ + "ahash", "hash-db", + "hashbrown 0.12.3", + "lazy_static", + "lru 0.7.8", "memory-db", + "nohash-hasher", "parity-scale-codec 3.1.5", + "parking_lot 0.12.1", "scale-info", "sp-core", "sp-std", "thiserror", + "tracing", "trie-db", "trie-root", ] @@ -11416,7 +11465,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "impl-serde", "parity-scale-codec 3.1.5", @@ -11433,7 +11482,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "parity-scale-codec 3.1.5", "proc-macro2", @@ -11444,7 +11493,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "impl-trait-for-tuples", "log", @@ -11577,7 +11626,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "platforms", ] @@ -11585,10 +11634,10 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.23", + "futures 0.3.24", "jsonrpsee", "log", "parity-scale-codec 3.1.5", @@ -11606,7 +11655,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "futures-util", "hyper", @@ -11619,7 +11668,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "jsonrpsee", "log", @@ -11640,10 +11689,10 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "async-trait", - "futures 0.3.23", + "futures 0.3.24", "hex", "parity-scale-codec 3.1.5", "sc-client-api", @@ -11666,9 +11715,9 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "substrate-test-utils-derive", "tokio", ] @@ -11676,7 +11725,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11687,7 +11736,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "ansi_term", "build-helper", @@ -11788,8 +11837,8 @@ dependencies = [ [[package]] name = "test-runtime-constants" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "frame-support", "polkadot-primitives", @@ -11830,24 +11879,24 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" [[package]] name = "thiserror" -version = "1.0.32" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" +checksum = "0a99cb8c4b9a8ef0e7907cd3b617cc8dc04d571c4e73c8ae403d80ac160bb122" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.32" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" +checksum = "3a891860d3c8d66fec8e73ddb3765f90082374dbaaa833407b904a94f1a7eb43" dependencies = [ "proc-macro2", "quote", @@ -11976,9 +12025,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.20.1" +version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581" +checksum = "0020c875007ad96677dcc890298f4b942882c5d4eb7cc8f439fc3bf813dc9c95" dependencies = [ "autocfg", "bytes", @@ -12103,8 +12152,8 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -12114,8 +12163,8 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "expander 0.0.6", "proc-macro-crate", @@ -12170,9 +12219,9 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32d034c0d3db64b43c31de38e945f15b40cd4ca6d2dcfc26d4798ce8de4ab83" +checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" dependencies = [ "hash-db", "hashbrown 0.12.3", @@ -12252,9 +12301,10 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.27#8eff668a42325aeb4433eace1604f4d286a6ec05" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" dependencies = [ "clap", + "frame-try-runtime", "jsonrpsee", "log", "parity-scale-codec 3.1.5", @@ -12380,7 +12430,7 @@ checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" [[package]] name = "unique-node" -version = "0.9.27" +version = "0.9.29" dependencies = [ "app-promotion-rpc", "clap", @@ -12404,7 +12454,7 @@ dependencies = [ "fp-rpc", "frame-benchmarking", "frame-benchmarking-cli", - "futures 0.3.23", + "futures 0.3.24", "jsonrpsee", "log", "opal-runtime", @@ -12478,7 +12528,7 @@ dependencies = [ "fc-rpc-core", "fp-rpc", "fp-storage", - "futures 0.3.23", + "futures 0.3.24", "jsonrpsee", "pallet-common", "pallet-ethereum", @@ -12640,7 +12690,7 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "up-common" -version = "0.9.27" +version = "0.9.29" dependencies = [ "fp-rpc", "frame-support", @@ -12687,7 +12737,7 @@ dependencies = [ [[package]] name = "up-sponsorship" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.27#853766d6033ceb68a2bef196790b962dd0663a04" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.29#3f663c3ee19933cd5545e0420ce2562fa8301235" dependencies = [ "impl-trait-for-tuples", ] @@ -12875,7 +12925,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "js-sys", "parking_lot 0.11.2", "pin-utils", @@ -13126,8 +13176,8 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -13215,8 +13265,8 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "frame-support", "polkadot-primitives", @@ -13396,8 +13446,8 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "derivative", "impl-trait-for-tuples", @@ -13410,8 +13460,8 @@ dependencies = [ [[package]] name = "xcm-builder" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "frame-support", "frame-system", @@ -13430,8 +13480,8 @@ dependencies = [ [[package]] name = "xcm-executor" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "frame-benchmarking", "frame-support", @@ -13448,8 +13498,8 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "0.9.27" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.27#b017bad50d360a1c6e3cdf9652bdb85e5f479fea" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "Inflector", "proc-macro2", @@ -13463,7 +13513,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" dependencies = [ - "futures 0.3.23", + "futures 0.3.24", "log", "nohash-hasher", "parking_lot 0.12.1", diff --git a/Cargo.toml b/Cargo.toml index 1381cc613f..bf2405fe80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,8 +14,3 @@ members = [ default-members = ['node/*', 'runtime/opal'] [profile.release] panic = 'unwind' - -[patch.crates-io] -jsonrpsee = { git = "https://github.com/uniquenetwork/jsonrpsee", branch = "unique-v0.14.0-fix-unknown-fields" } -jsonrpsee-types = { git = "https://github.com/uniquenetwork/jsonrpsee", branch = "unique-v0.14.0-fix-unknown-fields" } -jsonrpsee-core = { git = "https://github.com/uniquenetwork/jsonrpsee", branch = "unique-v0.14.0-fix-unknown-fields" } diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index 91298c33da..e1be279cfb 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -11,12 +11,12 @@ up-rpc = { path = "../../primitives/rpc" } app-promotion-rpc = { path = "../../primitives/app_promotion_rpc"} rmrk-rpc = { path = "../../primitives/rmrk-rpc" } codec = { package = "parity-scale-codec", version = "3.1.2" } -jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } +jsonrpsee = { version = "0.15.1", features = ["server", "macros"] } anyhow = "1.0.57" -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } diff --git a/crates/evm-coder/Cargo.toml b/crates/evm-coder/Cargo.toml index 98cccf41c8..a559dc7e6c 100644 --- a/crates/evm-coder/Cargo.toml +++ b/crates/evm-coder/Cargo.toml @@ -11,9 +11,10 @@ evm-coder-procedural = { path = "./procedural" } primitive-types = { version = "0.11.1", default-features = false } # Evm doesn't have reexports for log and others ethereum = { version = "0.12.0", default-features = false } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } # Error types for execution -evm-core = { default-features = false , git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.27" } +evm-core = { default-features = false , git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.29" } # We have tuple-heavy code in solidity.rs impl-trait-for-tuples = "0.2.2" @@ -24,4 +25,4 @@ hex-literal = "0.3.4" [features] default = ["std"] -std = ["ethereum/std", "primitive-types/std", "evm-core/std"] +std = ["ethereum/std", "primitive-types/std", "evm-core/std", "frame-support/std"] diff --git a/crates/evm-coder/procedural/src/solidity_interface.rs b/crates/evm-coder/procedural/src/solidity_interface.rs index ecb4b66b6b..cf5b659c1d 100644 --- a/crates/evm-coder/procedural/src/solidity_interface.rs +++ b/crates/evm-coder/procedural/src/solidity_interface.rs @@ -1126,7 +1126,7 @@ impl SolidityInterface { #weight_variants, )* // TODO: It should be very cheap, but not free - Self::ERC165Call(::evm_coder::ERC165Call::SupportsInterface {..}, _) => 100u64.into(), + Self::ERC165Call(::evm_coder::ERC165Call::SupportsInterface {..}, _) => frame_support::weights::Weight::from_ref_time(100).into(), #( #weight_variants_this, )* diff --git a/crates/evm-coder/src/execution.rs b/crates/evm-coder/src/execution.rs index cd38d18d1e..adc87f5e41 100644 --- a/crates/evm-coder/src/execution.rs +++ b/crates/evm-coder/src/execution.rs @@ -58,9 +58,14 @@ impl From for DispatchInfo { Self { weight } } } +impl From for DispatchInfo { + fn from(weight: u64) -> Self { + Self { weight: Weight::from_ref_time(weight) } + } +} impl From<()> for DispatchInfo { fn from(_: ()) -> Self { - Self { weight: 0 } + Self { weight: Weight::zero() } } } diff --git a/crates/evm-coder/src/lib.rs b/crates/evm-coder/src/lib.rs index eabb69403c..fa247f2240 100644 --- a/crates/evm-coder/src/lib.rs +++ b/crates/evm-coder/src/lib.rs @@ -169,7 +169,7 @@ pub trait Call: Sized { /// Should be same between evm-coder and substrate to avoid confusion /// /// Isn't same thing as gas, some mapping is required between those types -pub type Weight = u64; +pub type Weight = frame_support::weights::Weight; /// In substrate, we have benchmarking, which allows /// us to not rely on gas metering, but instead predict amount of gas to execute call diff --git a/crates/evm-coder/tests/conditional_is.rs b/crates/evm-coder/tests/conditional_is.rs index 17183d9266..210decd309 100644 --- a/crates/evm-coder/tests/conditional_is.rs +++ b/crates/evm-coder/tests/conditional_is.rs @@ -1,4 +1,4 @@ -use evm_coder::{types::*, solidity_interface, execution::Result, Call}; +use evm_coder::{types::*, solidity_interface, execution::Result}; pub struct Contract(bool); diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 7619530dcf..306892cb35 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -3,7 +3,7 @@ [build-dependencies.substrate-build-script-utils] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" ################################################################################ # Substrate Dependecies @@ -16,158 +16,158 @@ version = '3.1.2' [dependencies.frame-benchmarking] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-benchmarking-cli] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.try-runtime-cli] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-transaction-payment-rpc] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.substrate-prometheus-endpoint] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-basic-authorship] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-chain-spec] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-cli] features = ['wasmtime'] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-client-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-consensus] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-consensus-aura] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-executor] features = ['wasmtime'] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-finality-grandpa] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-keystore] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-rpc] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-rpc-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-service] features = ['wasmtime'] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-telemetry] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-transaction-pool] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-tracing] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-sysinfo] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-block-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-blockchain] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-consensus] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-consensus-aura] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-core] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-finality-grandpa] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-inherents] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-keystore] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-offchain] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-runtime] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-session] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-timestamp] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-transaction-pool] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-trie] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.substrate-frame-rpc-system] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sc-network] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.serde] features = ['derive'] @@ -178,76 +178,76 @@ version = '1.0.68' [dependencies.sc-consensus-manual-seal] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" ################################################################################ # Cumulus dependencies [dependencies.cumulus-client-consensus-aura] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.cumulus-client-consensus-common] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.cumulus-client-collator] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.cumulus-client-cli] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.cumulus-client-network] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.cumulus-primitives-parachain-inherent] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.cumulus-client-service] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.cumulus-relay-chain-interface] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.cumulus-relay-chain-inprocess-interface] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.cumulus-relay-chain-rpc-interface] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" ################################################################################ # Polkadot dependencies [dependencies.polkadot-primitives] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" [dependencies.polkadot-service] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" [dependencies.polkadot-cli] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" [dependencies.polkadot-test-service] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" ################################################################################ @@ -277,7 +277,7 @@ path = "../../primitives/rpc" [dependencies.pallet-transaction-payment-rpc-runtime-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" ################################################################################ # Package @@ -291,7 +291,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'unique-node' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = "0.9.27" +version = "0.9.29" [[bin]] name = 'unique-collator' @@ -306,16 +306,16 @@ log = '0.4.16' flexi_logger = "0.22.5" parking_lot = '0.12.1' clap = "3.1.2" -jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } +jsonrpsee = { version = "0.15.1", features = ["server", "macros"] } tokio = { version = "1.19.2", features = ["time"] } -fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } unique-rpc = { default-features = false, path = "../rpc" } app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index 55471393b5..27180a071c 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -574,7 +574,7 @@ impl CliConfiguration for RelayChainCli { fn base_path(&self) -> Result> { Ok(self .shared_params() - .base_path() + .base_path()? .or_else(|| self.base_path.clone().map(Into::into))) } @@ -628,10 +628,6 @@ impl CliConfiguration for RelayChainCli { self.base.base.transaction_pool(is_dev) } - fn state_cache_child_ratio(&self) -> Result> { - self.base.base.state_cache_child_ratio() - } - fn rpc_methods(&self) -> Result { self.base.base.rpc_methods() } diff --git a/node/cli/src/service.rs b/node/cli/src/service.rs index 5c32400af0..23da932d33 100644 --- a/node/cli/src/service.rs +++ b/node/cli/src/service.rs @@ -43,13 +43,13 @@ use cumulus_client_network::BlockAnnounceValidator; use cumulus_primitives_core::ParaId; use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain; use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult}; -use cumulus_relay_chain_rpc_interface::RelayChainRPCInterface; +use cumulus_relay_chain_rpc_interface::{RelayChainRpcInterface, create_client_and_start_worker}; // Substrate Imports use sc_client_api::ExecutorProvider; use sc_executor::NativeElseWasmExecutor; use sc_executor::NativeExecutionDispatch; -use sc_network::NetworkService; +use sc_network::{NetworkService, NetworkBlock}; use sc_service::{BasePath, Configuration, PartialComponents, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; use sp_keystore::SyncCryptoStorePtr; @@ -320,10 +320,14 @@ async fn build_relay_chain_interface( Option, )> { match collator_options.relay_chain_rpc_url { - Some(relay_chain_url) => Ok(( - Arc::new(RelayChainRPCInterface::new(relay_chain_url).await?) as Arc<_>, - None, - )), + Some(relay_chain_url) => { + let rpc_client = create_client_and_start_worker(relay_chain_url, task_manager).await?; + + Ok(( + Arc::new(RelayChainRpcInterface::new(rpc_client)) as Arc<_>, + None, + )) + }, None => build_inprocess_relay_chain( polkadot_config, parachain_config, diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index 24a760e6ac..f75b73429a 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -11,42 +11,42 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] futures = { version = "0.3.17", features = ["compat"] } -jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } +jsonrpsee = { version = "0.15.1", features = ["server", "macros"] } # pallet-contracts-rpc = { git = 'https://github.com/paritytech/substrate', branch = 'master' } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } tokio = { version = "1.19.2", features = ["macros", "sync"] } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } pallet-common = { default-features = false, path = "../../pallets/common" } up-common = { path = "../../primitives/common" } diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index f43e3e1d36..3c3b46df6f 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -175,6 +175,8 @@ where EthPubSubApiServer, EthSigner, Net, NetApiServer, Web3, Web3ApiServer, }; use uc_rpc::{UniqueApiServer, Unique}; + + #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] use uc_rpc::{AppPromotionApiServer, AppPromotion}; #[cfg(not(feature = "unique-runtime"))] diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index 82e51ce0bc..006e7ab654 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -46,17 +46,17 @@ scale-info = { version = "2.0.1", default-features = false, features = [ # Substrate Dependencies codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = '3.1.2' } -frame-benchmarking = {default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-balances ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-timestamp ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-randomness-collective-flip ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm ={ default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -sp-std ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-io ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-benchmarking = {default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-balances ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-timestamp ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-randomness-collective-flip ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-evm ={ default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +sp-std ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-io ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } serde = { default-features = false, features = ['derive'], version = '1.0.130' } ################################################################################ diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 65064ce82a..2c03a6ffc0 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -410,7 +410,7 @@ pub mod pallet { .sum(); if total_staked.is_zero() { - return Ok(None.into()); // TO-DO + return Ok(None::.into()); // TO-DO } pendings @@ -433,7 +433,7 @@ pub mod pallet { Self::deposit_event(Event::Unstake(staker_id, total_staked)); - Ok(None.into()) + Ok(None::.into()) } /// Sets the pallet to be the sponsor for the collection. diff --git a/pallets/app-promotion/src/weights.rs b/pallets/app-promotion/src/weights.rs index 276aac5a46..78ea346ce7 100644 --- a/pallets/app-promotion/src/weights.rs +++ b/pallets/app-promotion/src/weights.rs @@ -51,29 +51,29 @@ impl WeightInfo for SubstrateWeight { // Storage: AppPromotion PendingUnstake (r:1 w:0) // Storage: System Account (r:1 w:1) fn on_initialize(b: u32, ) -> Weight { - (2_651_000 as Weight) + Weight::from_ref_time(2_651_000) // Standard Error: 103_000 - .saturating_add((6_024_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(6_024_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(b as u64))) } // Storage: AppPromotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - (7_117_000 as Weight) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(7_117_000) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: ParachainSystem ValidationData (r:1 w:0) // Storage: AppPromotion NextCalculatedRecord (r:1 w:1) // Storage: AppPromotion Staked (r:2 w:0) fn payout_stakers(b: u32, ) -> Weight { - (9_958_000 as Weight) + Weight::from_ref_time(9_958_000) // Standard Error: 8_000 - .saturating_add((4_406_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(4_406_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: AppPromotion StakesPerAccount (r:1 w:1) // Storage: System Account (r:1 w:1) @@ -82,9 +82,9 @@ impl WeightInfo for SubstrateWeight { // Storage: AppPromotion Staked (r:1 w:1) // Storage: AppPromotion TotalStaked (r:1 w:1) fn stake() -> Weight { - (20_574_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(20_574_000) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(5 as u64)) } // Storage: AppPromotion PendingUnstake (r:1 w:1) // Storage: AppPromotion Staked (r:2 w:1) @@ -93,37 +93,37 @@ impl WeightInfo for SubstrateWeight { // Storage: AppPromotion TotalStaked (r:1 w:1) // Storage: AppPromotion StakesPerAccount (r:0 w:1) fn unstake() -> Weight { - (31_703_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(31_703_000) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn sponsor_collection() -> Weight { - (12_932_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(12_932_000) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn stop_sponsoring_collection() -> Weight { - (12_453_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(12_453_000) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:0 w:1) fn sponsor_contract() -> Weight { - (11_952_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(11_952_000) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:1 w:1) fn stop_sponsoring_contract() -> Weight { - (12_538_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(12_538_000) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } @@ -132,29 +132,29 @@ impl WeightInfo for () { // Storage: AppPromotion PendingUnstake (r:1 w:0) // Storage: System Account (r:1 w:1) fn on_initialize(b: u32, ) -> Weight { - (2_651_000 as Weight) + Weight::from_ref_time(2_651_000) // Standard Error: 103_000 - .saturating_add((6_024_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(6_024_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(b as u64))) } // Storage: AppPromotion Admin (r:0 w:1) fn set_admin_address() -> Weight { - (7_117_000 as Weight) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(7_117_000) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: ParachainSystem ValidationData (r:1 w:0) // Storage: AppPromotion NextCalculatedRecord (r:1 w:1) // Storage: AppPromotion Staked (r:2 w:0) fn payout_stakers(b: u32, ) -> Weight { - (9_958_000 as Weight) + Weight::from_ref_time(9_958_000) // Standard Error: 8_000 - .saturating_add((4_406_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(4_406_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: AppPromotion StakesPerAccount (r:1 w:1) // Storage: System Account (r:1 w:1) @@ -163,9 +163,9 @@ impl WeightInfo for () { // Storage: AppPromotion Staked (r:1 w:1) // Storage: AppPromotion TotalStaked (r:1 w:1) fn stake() -> Weight { - (20_574_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(6 as Weight)) - .saturating_add(RocksDbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(20_574_000) + .saturating_add(RocksDbWeight::get().reads(6 as u64)) + .saturating_add(RocksDbWeight::get().writes(5 as u64)) } // Storage: AppPromotion PendingUnstake (r:1 w:1) // Storage: AppPromotion Staked (r:2 w:1) @@ -174,36 +174,36 @@ impl WeightInfo for () { // Storage: AppPromotion TotalStaked (r:1 w:1) // Storage: AppPromotion StakesPerAccount (r:0 w:1) fn unstake() -> Weight { - (31_703_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(6 as Weight)) - .saturating_add(RocksDbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(31_703_000) + .saturating_add(RocksDbWeight::get().reads(6 as u64)) + .saturating_add(RocksDbWeight::get().writes(6 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn sponsor_collection() -> Weight { - (12_932_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(12_932_000) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) fn stop_sponsoring_collection() -> Weight { - (12_453_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(12_453_000) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:0 w:1) fn sponsor_contract() -> Weight { - (11_952_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(11_952_000) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: AppPromotion Admin (r:1 w:0) // Storage: EvmContractHelpers Sponsoring (r:1 w:1) fn stop_sponsoring_contract() -> Weight { - (12_538_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(12_538_000) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } } diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index 341c25ffa3..638316c155 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -11,18 +11,18 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } ethereum = { version = "0.12.0", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } serde = { version = "1.0.130", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/common/src/dispatch.rs b/pallets/common/src/dispatch.rs index 7f6b78baa9..bc2ffed51a 100644 --- a/pallets/common/src/dispatch.rs +++ b/pallets/common/src/dispatch.rs @@ -19,7 +19,7 @@ pub fn dispatch_weight() -> Weight { // Read collection ::DbWeight::get().reads(1) // Dynamic dispatch? - + 6_000_000 + + Weight::from_ref_time(6_000_000) // submit_logs is measured as part of collection pallets } diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index e0aa7f5002..e58f93c2ce 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -186,9 +186,11 @@ impl CollectionHandle { pub fn consume_store_reads(&self, reads: u64) -> evm_coder::execution::Result<()> { self.recorder .consume_gas(T::GasWeightMapping::weight_to_gas( - ::DbWeight::get() - .read - .saturating_mul(reads), + Weight::from_ref_time( + ::DbWeight::get() + .read + .saturating_mul(reads) + ), )) } @@ -196,9 +198,11 @@ impl CollectionHandle { pub fn consume_store_writes(&self, writes: u64) -> evm_coder::execution::Result<()> { self.recorder .consume_gas(T::GasWeightMapping::weight_to_gas( - ::DbWeight::get() - .write - .saturating_mul(writes), + Weight::from_ref_time( + ::DbWeight::get() + .write + .saturating_mul(writes) + ), )) } @@ -213,7 +217,7 @@ impl CollectionHandle { let writes = weight.read.saturating_mul(writes); self.recorder .consume_gas(T::GasWeightMapping::weight_to_gas( - reads.saturating_add(writes), + Weight::from_ref_time(reads.saturating_add(writes)), )) } @@ -706,7 +710,7 @@ pub mod pallet { fn on_runtime_upgrade() -> Weight { StorageVersion::new(1).put::>(); - 0 + Weight::zero() } } } diff --git a/pallets/common/src/weights.rs b/pallets/common/src/weights.rs index 7d5417bdc2..756d94a9e6 100644 --- a/pallets/common/src/weights.rs +++ b/pallets/common/src/weights.rs @@ -42,19 +42,19 @@ pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { // Storage: Common CollectionProperties (r:1 w:1) fn set_collection_properties(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 142_818_000 - .saturating_add((2_786_252_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(2_786_252_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Common CollectionProperties (r:1 w:1) fn delete_collection_properties(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 101_087_000 - .saturating_add((2_739_521_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(2_739_521_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } @@ -62,18 +62,18 @@ impl WeightInfo for SubstrateWeight { impl WeightInfo for () { // Storage: Common CollectionProperties (r:1 w:1) fn set_collection_properties(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 142_818_000 - .saturating_add((2_786_252_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(2_786_252_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Common CollectionProperties (r:1 w:1) fn delete_collection_properties(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 101_087_000 - .saturating_add((2_739_521_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(2_739_521_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } } diff --git a/pallets/configuration/Cargo.toml b/pallets/configuration/Cargo.toml index 4aa7619fd3..eccd24542a 100644 --- a/pallets/configuration/Cargo.toml +++ b/pallets/configuration/Cargo.toml @@ -10,13 +10,13 @@ parity-scale-codec = { version = "3.1.5", features = [ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } smallvec = "1.6.1" [features] diff --git a/pallets/configuration/src/lib.rs b/pallets/configuration/src/lib.rs index 0385cfe16d..aefaf1c870 100644 --- a/pallets/configuration/src/lib.rs +++ b/pallets/configuration/src/lib.rs @@ -20,7 +20,7 @@ use core::marker::PhantomData; use frame_support::{ pallet, - weights::{WeightToFeePolynomial, WeightToFeeCoefficients, WeightToFeeCoefficient}, + weights::{WeightToFeePolynomial, WeightToFeeCoefficients, WeightToFeeCoefficient, Weight}, traits::Get, }; use sp_arithmetic::traits::{BaseArithmetic, Unsigned}; @@ -115,7 +115,7 @@ where pub struct FeeCalculator(PhantomData); impl fp_evm::FeeCalculator for FeeCalculator { - fn min_gas_price() -> (U256, u64) { + fn min_gas_price() -> (U256, Weight) { ( >::get().into(), T::DbWeight::get().reads(1), diff --git a/pallets/evm-coder-substrate/Cargo.toml b/pallets/evm-coder-substrate/Cargo.toml index c1e2bde6c3..806f69a010 100644 --- a/pallets/evm-coder-substrate/Cargo.toml +++ b/pallets/evm-coder-substrate/Cargo.toml @@ -8,15 +8,15 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } ethereum = { version = "0.12.0", default-features = false } evm-coder = { default-features = false, path = "../../crates/evm-coder" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } up-data-structs = { default-features = false, path = "../../primitives/data-structs" } [dependencies.codec] diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index e46d443435..c2490fdd11 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -12,16 +12,16 @@ log = { default-features = false, version = "0.4.14" } ethereum = { version = "0.12.0", default-features = false } # Substrate -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } # Unique -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29" } # Locals evm-coder = { default-features = false, path = '../../crates/evm-coder' } diff --git a/pallets/evm-migration/Cargo.toml b/pallets/evm-migration/Cargo.toml index d6252f1162..4a7f53e1b6 100644 --- a/pallets/evm-migration/Cargo.toml +++ b/pallets/evm-migration/Cargo.toml @@ -8,15 +8,15 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } [dependencies.codec] default-features = false diff --git a/pallets/evm-migration/src/weights.rs b/pallets/evm-migration/src/weights.rs index 82969f2fa4..5002d29546 100644 --- a/pallets/evm-migration/src/weights.rs +++ b/pallets/evm-migration/src/weights.rs @@ -46,25 +46,25 @@ impl WeightInfo for SubstrateWeight { // Storage: System Account (r:1 w:0) // Storage: EVM AccountCodes (r:1 w:0) fn begin() -> Weight { - (8_035_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(8_035_000) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: EvmMigration MigrationPending (r:1 w:0) // Storage: EVM AccountStorages (r:0 w:1) fn set_data(b: u32, ) -> Weight { - (3_076_000 as Weight) + Weight::from_ref_time(3_076_000) // Standard Error: 0 - .saturating_add((828_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(828_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(b as u64))) } // Storage: EvmMigration MigrationPending (r:1 w:1) // Storage: EVM AccountCodes (r:0 w:1) fn finish(_b: u32, ) -> Weight { - (6_591_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(6_591_000) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } } @@ -74,24 +74,24 @@ impl WeightInfo for () { // Storage: System Account (r:1 w:0) // Storage: EVM AccountCodes (r:1 w:0) fn begin() -> Weight { - (8_035_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(8_035_000) + .saturating_add(RocksDbWeight::get().reads(3 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: EvmMigration MigrationPending (r:1 w:0) // Storage: EVM AccountStorages (r:0 w:1) fn set_data(b: u32, ) -> Weight { - (3_076_000 as Weight) + Weight::from_ref_time(3_076_000) // Standard Error: 0 - .saturating_add((828_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(828_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(b as u64))) } // Storage: EvmMigration MigrationPending (r:1 w:1) // Storage: EVM AccountCodes (r:0 w:1) fn finish(_b: u32, ) -> Weight { - (6_591_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(6_591_000) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } } diff --git a/pallets/evm-transaction-payment/Cargo.toml b/pallets/evm-transaction-payment/Cargo.toml index 5abdcc528b..afa9019792 100644 --- a/pallets/evm-transaction-payment/Cargo.toml +++ b/pallets/evm-transaction-payment/Cargo.toml @@ -8,17 +8,17 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } [dependencies.codec] default-features = false diff --git a/pallets/foreign-assets/Cargo.toml b/pallets/foreign-assets/Cargo.toml index 860ef7599c..44ffdccf31 100644 --- a/pallets/foreign-assets/Cargo.toml +++ b/pallets/foreign-assets/Cargo.toml @@ -9,28 +9,28 @@ log = { version = "0.4.16", default-features = false } serde = { version = "1.0.136", optional = true } scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } pallet-common = { default-features = false, path = '../common' } pallet-fungible = { default-features = false, path = '../fungible' } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false } +xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false } +xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false } #orml-tokens = { git = 'https://github.com/UniqueNetwork/open-runtime-module-library', branch = 'unique-polkadot-v0.9.24', version = "0.4.1-dev", default-features = false } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.27", version = "0.4.1-dev", default-features = false } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +orml-tokens = { git = "https://github.com/UniqueNetwork/open-runtime-module-library", branch = "polkadot-v0.9.29", version = "0.4.1-dev", default-features = false } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } [dev-dependencies] serde_json = "1.0.68" hex = { version = "0.4" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } [features] default = ["std"] @@ -50,4 +50,4 @@ std = [ "orml-tokens/std" ] try-runtime = ["frame-support/try-runtime"] -runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks'] \ No newline at end of file +runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks'] diff --git a/pallets/foreign-assets/src/lib.rs b/pallets/foreign-assets/src/lib.rs index 6bbd5ca88f..b6c42be20e 100644 --- a/pallets/foreign-assets/src/lib.rs +++ b/pallets/foreign-assets/src/lib.rs @@ -54,7 +54,7 @@ use up_data_structs::{CollectionId, TokenId, CreateCollectionData}; // NOTE:v1::MultiLocation is used in storages, we would need to do migration if upgrade the // MultiLocation in the future. -use xcm::opaque::latest::prelude::XcmError; +use xcm::opaque::latest::{prelude::XcmError, Weight}; use xcm::{v1::MultiLocation, VersionedMultiLocation}; use xcm_executor::{traits::WeightTrader, Assets}; diff --git a/pallets/foreign-assets/src/weights.rs b/pallets/foreign-assets/src/weights.rs index cfcde0d5a8..767539c334 100644 --- a/pallets/foreign-assets/src/weights.rs +++ b/pallets/foreign-assets/src/weights.rs @@ -53,16 +53,16 @@ impl WeightInfo for SubstrateWeight { // Storage: Common CollectionProperties (r:0 w:1) // Storage: Common CollectionById (r:0 w:1) fn register_foreign_asset() -> Weight { - (52_161_000 as Weight) - .saturating_add(T::DbWeight::get().reads(9 as Weight)) - .saturating_add(T::DbWeight::get().writes(11 as Weight)) + Weight::from_ref_time(52_161_000) + .saturating_add(T::DbWeight::get().reads(9 as u64)) + .saturating_add(T::DbWeight::get().writes(11 as u64)) } // Storage: ForeignAssets ForeignAssetLocations (r:1 w:1) // Storage: ForeignAssets AssetMetadatas (r:1 w:1) fn update_foreign_asset() -> Weight { - (19_111_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(19_111_000) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } } @@ -80,15 +80,15 @@ impl WeightInfo for () { // Storage: Common CollectionProperties (r:0 w:1) // Storage: Common CollectionById (r:0 w:1) fn register_foreign_asset() -> Weight { - (52_161_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(9 as Weight)) - .saturating_add(RocksDbWeight::get().writes(11 as Weight)) + Weight::from_ref_time(52_161_000) + .saturating_add(RocksDbWeight::get().reads(9 as u64)) + .saturating_add(RocksDbWeight::get().writes(11 as u64)) } // Storage: ForeignAssets ForeignAssetLocations (r:1 w:1) // Storage: ForeignAssets AssetMetadatas (r:1 w:1) fn update_foreign_asset() -> Weight { - (19_111_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(19_111_000) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } } diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index 0ed6712684..b2bbb198f6 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -11,19 +11,19 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' } ethereum = { version = "0.12.0", default-features = false } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } diff --git a/pallets/fungible/src/common.rs b/pallets/fungible/src/common.rs index 3a4ee265ce..79456de536 100644 --- a/pallets/fungible/src/common.rs +++ b/pallets/fungible/src/common.rs @@ -45,7 +45,7 @@ impl CommonWeightInfo for CommonWeights { CreateItemExData::Fungible(f) => { >::create_multiple_items_ex(f.len() as u32) } - _ => 0, + _ => Weight::zero(), } } @@ -55,27 +55,27 @@ impl CommonWeightInfo for CommonWeights { fn set_collection_properties(_amount: u32) -> Weight { // Error - 0 + Weight::zero() } fn delete_collection_properties(_amount: u32) -> Weight { // Error - 0 + Weight::zero() } fn set_token_properties(_amount: u32) -> Weight { // Error - 0 + Weight::zero() } fn delete_token_properties(_amount: u32) -> Weight { // Error - 0 + Weight::zero() } fn set_token_property_permissions(_amount: u32) -> Weight { // Error - 0 + Weight::zero() } fn transfer() -> Weight { @@ -101,11 +101,11 @@ impl CommonWeightInfo for CommonWeights { fn burn_recursively_breadth_raw(_amount: u32) -> Weight { // Fungible tokens can't have children - 0 + Weight::zero() } fn token_owner() -> Weight { - 0 + Weight::zero() } } diff --git a/pallets/fungible/src/weights.rs b/pallets/fungible/src/weights.rs index 2da1da43da..68ee906092 100644 --- a/pallets/fungible/src/weights.rs +++ b/pallets/fungible/src/weights.rs @@ -48,55 +48,55 @@ impl WeightInfo for SubstrateWeight { // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:1 w:1) fn create_item() -> Weight { - (18_195_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(18_195_000) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:4 w:4) fn create_multiple_items_ex(b: u32, ) -> Weight { - (19_218_000 as Weight) + Weight::from_ref_time(19_218_000) // Standard Error: 3_000 - .saturating_add((4_516_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(4_516_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(b as u64))) } // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:1 w:1) fn burn_item() -> Weight { - (18_719_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(18_719_000) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Fungible Balance (r:2 w:2) fn transfer() -> Weight { - (20_563_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(20_563_000) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Fungible Balance (r:1 w:0) // Storage: Fungible Allowance (r:0 w:1) fn approve() -> Weight { - (17_583_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_583_000) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Fungible Allowance (r:1 w:1) // Storage: Fungible Balance (r:2 w:2) fn transfer_from() -> Weight { - (29_845_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(29_845_000) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Fungible Allowance (r:1 w:1) // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:1 w:1) fn burn_from() -> Weight { - (28_248_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(28_248_000) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } } @@ -105,54 +105,54 @@ impl WeightInfo for () { // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:1 w:1) fn create_item() -> Weight { - (18_195_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(18_195_000) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:4 w:4) fn create_multiple_items_ex(b: u32, ) -> Weight { - (19_218_000 as Weight) + Weight::from_ref_time(19_218_000) // Standard Error: 3_000 - .saturating_add((4_516_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(4_516_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) + .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(b as u64))) } // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:1 w:1) fn burn_item() -> Weight { - (18_719_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(18_719_000) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } // Storage: Fungible Balance (r:2 w:2) fn transfer() -> Weight { - (20_563_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(20_563_000) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } // Storage: Fungible Balance (r:1 w:0) // Storage: Fungible Allowance (r:0 w:1) fn approve() -> Weight { - (17_583_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_583_000) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Fungible Allowance (r:1 w:1) // Storage: Fungible Balance (r:2 w:2) fn transfer_from() -> Weight { - (29_845_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) - .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(29_845_000) + .saturating_add(RocksDbWeight::get().reads(3 as u64)) + .saturating_add(RocksDbWeight::get().writes(3 as u64)) } // Storage: Fungible Allowance (r:1 w:1) // Storage: Fungible TotalSupply (r:1 w:1) // Storage: Fungible Balance (r:1 w:1) fn burn_from() -> Weight { - (28_248_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) - .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(28_248_000) + .saturating_add(RocksDbWeight::get().reads(3 as u64)) + .saturating_add(RocksDbWeight::get().writes(3 as u64)) } } diff --git a/pallets/inflation/Cargo.toml b/pallets/inflation/Cargo.toml index 74ceac9569..e9f8564727 100644 --- a/pallets/inflation/Cargo.toml +++ b/pallets/inflation/Cargo.toml @@ -43,37 +43,37 @@ version = '3.1.2' default-features = false optional = true git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.serde] default-features = false @@ -83,17 +83,17 @@ version = '1.0.130' [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies] scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/inflation/src/lib.rs b/pallets/inflation/src/lib.rs index c2ac38b2e3..1e2f984a38 100644 --- a/pallets/inflation/src/lib.rs +++ b/pallets/inflation/src/lib.rs @@ -110,7 +110,7 @@ pub mod pallet { where ::BlockNumber: From, { - let mut consumed_weight = 0; + let mut consumed_weight = Weight::zero(); let mut add_weight = |reads, writes, weight| { consumed_weight += T::DbWeight::get().reads_writes(reads, writes); consumed_weight += weight; @@ -119,7 +119,7 @@ pub mod pallet { let block_interval: u32 = T::InflationBlockInterval::get().try_into().unwrap_or(0); let current_relay_block = T::BlockNumberProvider::current_block_number(); let next_inflation: T::BlockNumber = >::get(); - add_weight(1, 0, 5_000_000); + add_weight(1, 0, Weight::from_ref_time(5_000_000)); // Apply inflation every InflationBlockInterval blocks // If next_inflation == 0, this means inflation wasn't yet initialized @@ -128,10 +128,10 @@ pub mod pallet { // Do the "current_relay_block >= next_recalculation" check in the "current_relay_block >= next_inflation" // block because it saves InflationBlockInterval DB reads for NextRecalculationBlock. let next_recalculation: T::BlockNumber = >::get(); - add_weight(1, 0, 0); + add_weight(1, 0, Weight::zero()); if current_relay_block >= next_recalculation { Self::recalculate_inflation(next_recalculation); - add_weight(0, 4, 5_000_000); + add_weight(0, 4, Weight::from_ref_time(5_000_000)); } T::Currency::deposit_into_existing( @@ -143,7 +143,7 @@ pub mod pallet { // Update inflation block >::set(next_inflation + block_interval.into()); - add_weight(3, 3, 10_000_000); + add_weight(3, 3, Weight::from_ref_time(10_000_000)); } consumed_weight diff --git a/pallets/inflation/src/tests.rs b/pallets/inflation/src/tests.rs index dd63f4b164..3ce875f299 100644 --- a/pallets/inflation/src/tests.rs +++ b/pallets/inflation/src/tests.rs @@ -21,6 +21,7 @@ use crate as pallet_inflation; use frame_support::{ assert_ok, parameter_types, traits::{Currency, OnInitialize, Everything, ConstU32}, + weights::Weight, }; use frame_system::RawOrigin; use sp_core::H256; @@ -69,7 +70,7 @@ frame_support::construct_runtime!( parameter_types! { pub const BlockHashCount: u64 = 250; pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(1024); + frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(1024)); pub const SS58Prefix: u8 = 42; } diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index 46494ef23a..71a07e34a4 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -11,19 +11,19 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' } ethereum = { version = "0.12.0", default-features = false } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } diff --git a/pallets/nonfungible/src/common.rs b/pallets/nonfungible/src/common.rs index d8da653dd8..a91828ae9c 100644 --- a/pallets/nonfungible/src/common.rs +++ b/pallets/nonfungible/src/common.rs @@ -44,16 +44,16 @@ impl CommonWeightInfo for CommonWeights { CreateItemExData::NFT(t) => { >::create_multiple_items_ex(t.len() as u32) + t.iter() - .map(|t| { + .filter_map(|t| { if t.properties.len() > 0 { - Self::set_token_properties(t.properties.len() as u32) + Some(Self::set_token_properties(t.properties.len() as u32)) } else { - 0 + None } }) - .sum::() + .fold(Weight::zero(), |a, b| a.saturating_add(b)) } - _ => 0, + _ => Weight::zero(), } } @@ -67,7 +67,7 @@ impl CommonWeightInfo for CommonWeights { } _ => None, }) - .sum::() + .fold(Weight::zero(), |a, b| a.saturating_add(b)) } fn burn_item() -> Weight { diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index d7cbb4226a..f48af786ef 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -278,7 +278,7 @@ pub mod pallet { fn on_runtime_upgrade() -> Weight { StorageVersion::new(1).put::>(); - 0 + Weight::zero() } } } @@ -545,7 +545,7 @@ impl Pallet { let current_token_account = T::CrossTokenAddressMapping::token_to_address(collection.id, token); - let mut weight = 0 as Weight; + let mut weight = Weight::zero(); // This method is transactional, if user in fact doesn't have permissions to remove token - // tokens removed here will be restored after rejected transaction diff --git a/pallets/nonfungible/src/weights.rs b/pallets/nonfungible/src/weights.rs index 4005d88096..5af18ac9e3 100644 --- a/pallets/nonfungible/src/weights.rs +++ b/pallets/nonfungible/src/weights.rs @@ -57,34 +57,34 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn create_item() -> Weight { - (25_905_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(25_905_000) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Nonfungible TokensMinted (r:1 w:1) // Storage: Nonfungible AccountBalance (r:1 w:1) // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (24_955_000 as Weight) + Weight::from_ref_time(24_955_000) // Standard Error: 3_000 - .saturating_add((5_340_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(5_340_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(b as u64))) } // Storage: Nonfungible TokensMinted (r:1 w:1) // Storage: Nonfungible AccountBalance (r:4 w:4) // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items_ex(b: u32, ) -> Weight { - (13_666_000 as Weight) + Weight::from_ref_time(13_666_000) // Standard Error: 5_000 - .saturating_add((8_299_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(8_299_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(b as u64))) } // Storage: Nonfungible TokenData (r:1 w:1) // Storage: Nonfungible TokenChildren (r:1 w:0) @@ -94,9 +94,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_item() -> Weight { - (36_205_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(36_205_000) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(5 as u64)) } // Storage: Nonfungible TokenChildren (r:1 w:0) // Storage: Nonfungible TokenData (r:1 w:1) @@ -106,9 +106,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_recursively_self_raw() -> Weight { - (44_550_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(44_550_000) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(5 as u64)) } // Storage: Nonfungible TokenChildren (r:1 w:0) // Storage: Nonfungible TokenData (r:1 w:1) @@ -119,38 +119,38 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:0 w:1) // Storage: Common CollectionById (r:1 w:0) fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 1_536_000 - .saturating_add((312_125_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - .saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(312_125_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(7 as u64)) + .saturating_add(T::DbWeight::get().reads((4 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes(6 as u64)) + .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(b as u64))) } // Storage: Nonfungible TokenData (r:1 w:1) // Storage: Nonfungible AccountBalance (r:2 w:2) // Storage: Nonfungible Allowance (r:1 w:0) // Storage: Nonfungible Owned (r:0 w:2) fn transfer() -> Weight { - (31_116_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(31_116_000) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(5 as u64)) } // Storage: Nonfungible TokenData (r:1 w:0) // Storage: Nonfungible Allowance (r:1 w:1) fn approve() -> Weight { - (20_802_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(20_802_000) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Nonfungible Allowance (r:1 w:1) // Storage: Nonfungible TokenData (r:1 w:1) // Storage: Nonfungible AccountBalance (r:2 w:2) // Storage: Nonfungible Owned (r:0 w:2) fn transfer_from() -> Weight { - (36_083_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(36_083_000) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Nonfungible Allowance (r:1 w:1) // Storage: Nonfungible TokenData (r:1 w:1) @@ -160,40 +160,40 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (41_781_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(41_781_000) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Common CollectionPropertyPermissions (r:1 w:1) fn set_token_property_permissions(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 58_000 - .saturating_add((15_705_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(15_705_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Common CollectionPropertyPermissions (r:1 w:0) // Storage: Nonfungible TokenProperties (r:1 w:1) fn set_token_properties(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 3_595_000 - .saturating_add((590_344_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(590_344_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Common CollectionPropertyPermissions (r:1 w:0) // Storage: Nonfungible TokenProperties (r:1 w:1) fn delete_token_properties(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 3_664_000 - .saturating_add((605_836_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(605_836_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Nonfungible TokenData (r:1 w:0) fn token_owner() -> Weight { - (4_366_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) + Weight::from_ref_time(4_366_000) + .saturating_add(T::DbWeight::get().reads(1 as u64)) } } @@ -204,34 +204,34 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn create_item() -> Weight { - (25_905_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(25_905_000) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(4 as u64)) } // Storage: Nonfungible TokensMinted (r:1 w:1) // Storage: Nonfungible AccountBalance (r:1 w:1) // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (24_955_000 as Weight) + Weight::from_ref_time(24_955_000) // Standard Error: 3_000 - .saturating_add((5_340_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(5_340_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) + .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(b as u64))) } // Storage: Nonfungible TokensMinted (r:1 w:1) // Storage: Nonfungible AccountBalance (r:4 w:4) // Storage: Nonfungible TokenData (r:0 w:4) // Storage: Nonfungible Owned (r:0 w:4) fn create_multiple_items_ex(b: u32, ) -> Weight { - (13_666_000 as Weight) + Weight::from_ref_time(13_666_000) // Standard Error: 5_000 - .saturating_add((8_299_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(8_299_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) + .saturating_add(RocksDbWeight::get().writes((3 as u64).saturating_mul(b as u64))) } // Storage: Nonfungible TokenData (r:1 w:1) // Storage: Nonfungible TokenChildren (r:1 w:0) @@ -241,9 +241,9 @@ impl WeightInfo for () { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_item() -> Weight { - (36_205_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(36_205_000) + .saturating_add(RocksDbWeight::get().reads(5 as u64)) + .saturating_add(RocksDbWeight::get().writes(5 as u64)) } // Storage: Nonfungible TokenChildren (r:1 w:0) // Storage: Nonfungible TokenData (r:1 w:1) @@ -253,9 +253,9 @@ impl WeightInfo for () { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_recursively_self_raw() -> Weight { - (44_550_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(44_550_000) + .saturating_add(RocksDbWeight::get().reads(5 as u64)) + .saturating_add(RocksDbWeight::get().writes(5 as u64)) } // Storage: Nonfungible TokenChildren (r:1 w:0) // Storage: Nonfungible TokenData (r:1 w:1) @@ -266,38 +266,38 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:0 w:1) // Storage: Common CollectionById (r:1 w:0) fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 1_536_000 - .saturating_add((312_125_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(7 as Weight)) - .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(b as Weight))) - .saturating_add(RocksDbWeight::get().writes(6 as Weight)) - .saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(312_125_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(7 as u64)) + .saturating_add(RocksDbWeight::get().reads((4 as u64).saturating_mul(b as u64))) + .saturating_add(RocksDbWeight::get().writes(6 as u64)) + .saturating_add(RocksDbWeight::get().writes((4 as u64).saturating_mul(b as u64))) } // Storage: Nonfungible TokenData (r:1 w:1) // Storage: Nonfungible AccountBalance (r:2 w:2) // Storage: Nonfungible Allowance (r:1 w:0) // Storage: Nonfungible Owned (r:0 w:2) fn transfer() -> Weight { - (31_116_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(31_116_000) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().writes(5 as u64)) } // Storage: Nonfungible TokenData (r:1 w:0) // Storage: Nonfungible Allowance (r:1 w:1) fn approve() -> Weight { - (20_802_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(20_802_000) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Nonfungible Allowance (r:1 w:1) // Storage: Nonfungible TokenData (r:1 w:1) // Storage: Nonfungible AccountBalance (r:2 w:2) // Storage: Nonfungible Owned (r:0 w:2) fn transfer_from() -> Weight { - (36_083_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(36_083_000) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().writes(6 as u64)) } // Storage: Nonfungible Allowance (r:1 w:1) // Storage: Nonfungible TokenData (r:1 w:1) @@ -307,39 +307,39 @@ impl WeightInfo for () { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (41_781_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(41_781_000) + .saturating_add(RocksDbWeight::get().reads(5 as u64)) + .saturating_add(RocksDbWeight::get().writes(6 as u64)) } // Storage: Common CollectionPropertyPermissions (r:1 w:1) fn set_token_property_permissions(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 58_000 - .saturating_add((15_705_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(15_705_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Common CollectionPropertyPermissions (r:1 w:0) // Storage: Nonfungible TokenProperties (r:1 w:1) fn set_token_properties(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 3_595_000 - .saturating_add((590_344_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(590_344_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Common CollectionPropertyPermissions (r:1 w:0) // Storage: Nonfungible TokenProperties (r:1 w:1) fn delete_token_properties(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 3_664_000 - .saturating_add((605_836_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(605_836_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Nonfungible TokenData (r:1 w:0) fn token_owner() -> Weight { - (4_366_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + Weight::from_ref_time(4_366_000) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) } } diff --git a/pallets/proxy-rmrk-core/Cargo.toml b/pallets/proxy-rmrk-core/Cargo.toml index c5b4cb4e9e..1491b8ecb5 100644 --- a/pallets/proxy-rmrk-core/Cargo.toml +++ b/pallets/proxy-rmrk-core/Cargo.toml @@ -11,17 +11,17 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } pallet-structure = { default-features = false, path = "../../pallets/structure" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", diff --git a/pallets/proxy-rmrk-core/src/weights.rs b/pallets/proxy-rmrk-core/src/weights.rs index 6c5bf15518..6220185947 100644 --- a/pallets/proxy-rmrk-core/src/weights.rs +++ b/pallets/proxy-rmrk-core/src/weights.rs @@ -64,9 +64,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Common CollectionById (r:0 w:1) // Storage: RmrkCore UniqueCollectionId (r:0 w:1) fn create_collection() -> Weight { - (49_754_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(8 as Weight)) + Weight::from_ref_time(49_754_000) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(8 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:1) @@ -77,17 +77,17 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokensBurnt (r:0 w:1) // Storage: Common AdminAmount (r:0 w:1) fn destroy_collection() -> Weight { - (48_588_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(48_588_000) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) // Storage: Common CollectionProperties (r:1 w:0) fn change_collection_issuer() -> Weight { - (25_054_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(25_054_000) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -95,9 +95,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokensMinted (r:1 w:0) // Storage: Nonfungible TokensBurnt (r:1 w:0) fn lock_collection() -> Weight { - (26_483_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(26_483_000) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -109,13 +109,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenAuxProperties (r:2 w:2) fn mint_nft(b: u32, ) -> Weight { - (62_419_000 as Weight) + Weight::from_ref_time(62_419_000) // Standard Error: 7_000 - .saturating_add((12_325_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(12_325_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes(5 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(b as u64))) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -128,13 +128,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_nft(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 1_488_000 - .saturating_add((298_367_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(9 as Weight)) - .saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - .saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(298_367_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(9 as u64)) + .saturating_add(T::DbWeight::get().reads((4 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes(6 as u64)) + .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(b as u64))) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -146,9 +146,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenChildren (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:2) fn send() -> Weight { - (81_942_000 as Weight) - .saturating_add(T::DbWeight::get().reads(12 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(81_942_000) + .saturating_add(T::DbWeight::get().reads(12 as u64)) + .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:2 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -161,9 +161,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenChildren (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:2) fn accept_nft() -> Weight { - (97_925_000 as Weight) - .saturating_add(T::DbWeight::get().reads(16 as Weight)) - .saturating_add(T::DbWeight::get().writes(8 as Weight)) + Weight::from_ref_time(97_925_000) + .saturating_add(T::DbWeight::get().reads(16 as u64)) + .saturating_add(T::DbWeight::get().writes(8 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -177,9 +177,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible Allowance (r:5 w:0) // Storage: Nonfungible Owned (r:0 w:5) fn reject_nft() -> Weight { - (277_794_000 as Weight) - .saturating_add(T::DbWeight::get().reads(30 as Weight)) - .saturating_add(T::DbWeight::get().writes(26 as Weight)) + Weight::from_ref_time(277_794_000) + .saturating_add(T::DbWeight::get().reads(30 as u64)) + .saturating_add(T::DbWeight::get().writes(26 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -187,9 +187,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenData (r:5 w:0) fn set_property() -> Weight { - (54_657_000 as Weight) - .saturating_add(T::DbWeight::get().reads(9 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(54_657_000) + .saturating_add(T::DbWeight::get().reads(9 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -197,9 +197,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenData (r:5 w:0) fn set_priority() -> Weight { - (55_056_000 as Weight) - .saturating_add(T::DbWeight::get().reads(9 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(55_056_000) + .saturating_add(T::DbWeight::get().reads(9 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -208,9 +208,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn add_basic_resource() -> Weight { - (61_673_000 as Weight) - .saturating_add(T::DbWeight::get().reads(10 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(61_673_000) + .saturating_add(T::DbWeight::get().reads(10 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -219,9 +219,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenAuxProperties (r:2 w:2) fn add_composable_resource() -> Weight { - (67_125_000 as Weight) - .saturating_add(T::DbWeight::get().reads(11 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(67_125_000) + .saturating_add(T::DbWeight::get().reads(11 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -230,9 +230,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn add_slot_resource() -> Weight { - (69_058_000 as Weight) - .saturating_add(T::DbWeight::get().reads(10 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(69_058_000) + .saturating_add(T::DbWeight::get().reads(10 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -240,9 +240,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenAuxProperties (r:1 w:1) // Storage: Nonfungible TokenData (r:5 w:0) fn remove_resource() -> Weight { - (53_427_000 as Weight) - .saturating_add(T::DbWeight::get().reads(9 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(53_427_000) + .saturating_add(T::DbWeight::get().reads(9 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -250,9 +250,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:5 w:0) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn accept_resource() -> Weight { - (50_623_000 as Weight) - .saturating_add(T::DbWeight::get().reads(9 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(50_623_000) + .saturating_add(T::DbWeight::get().reads(9 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -260,9 +260,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:5 w:0) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn accept_resource_removal() -> Weight { - (50_917_000 as Weight) - .saturating_add(T::DbWeight::get().reads(9 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(50_917_000) + .saturating_add(T::DbWeight::get().reads(9 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } @@ -277,9 +277,9 @@ impl WeightInfo for () { // Storage: Common CollectionById (r:0 w:1) // Storage: RmrkCore UniqueCollectionId (r:0 w:1) fn create_collection() -> Weight { - (49_754_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(8 as Weight)) + Weight::from_ref_time(49_754_000) + .saturating_add(RocksDbWeight::get().reads(5 as u64)) + .saturating_add(RocksDbWeight::get().writes(8 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:1) @@ -290,17 +290,17 @@ impl WeightInfo for () { // Storage: Nonfungible TokensBurnt (r:0 w:1) // Storage: Common AdminAmount (r:0 w:1) fn destroy_collection() -> Weight { - (48_588_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(48_588_000) + .saturating_add(RocksDbWeight::get().reads(5 as u64)) + .saturating_add(RocksDbWeight::get().writes(6 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionById (r:1 w:1) // Storage: Common CollectionProperties (r:1 w:0) fn change_collection_issuer() -> Weight { - (25_054_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(25_054_000) + .saturating_add(RocksDbWeight::get().reads(3 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -308,9 +308,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokensMinted (r:1 w:0) // Storage: Nonfungible TokensBurnt (r:1 w:0) fn lock_collection() -> Weight { - (26_483_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(26_483_000) + .saturating_add(RocksDbWeight::get().reads(5 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -322,13 +322,13 @@ impl WeightInfo for () { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenAuxProperties (r:2 w:2) fn mint_nft(b: u32, ) -> Weight { - (62_419_000 as Weight) + Weight::from_ref_time(62_419_000) // Standard Error: 7_000 - .saturating_add((12_325_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(6 as Weight)) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(RocksDbWeight::get().writes(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(12_325_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(6 as u64)) + .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(RocksDbWeight::get().writes(5 as u64)) + .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(b as u64))) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -341,13 +341,13 @@ impl WeightInfo for () { // Storage: Nonfungible Owned (r:0 w:1) // Storage: Nonfungible TokenProperties (r:0 w:1) fn burn_nft(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 1_488_000 - .saturating_add((298_367_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(9 as Weight)) - .saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(b as Weight))) - .saturating_add(RocksDbWeight::get().writes(6 as Weight)) - .saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(298_367_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(9 as u64)) + .saturating_add(RocksDbWeight::get().reads((4 as u64).saturating_mul(b as u64))) + .saturating_add(RocksDbWeight::get().writes(6 as u64)) + .saturating_add(RocksDbWeight::get().writes((4 as u64).saturating_mul(b as u64))) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -359,9 +359,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenChildren (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:2) fn send() -> Weight { - (81_942_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(12 as Weight)) - .saturating_add(RocksDbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(81_942_000) + .saturating_add(RocksDbWeight::get().reads(12 as u64)) + .saturating_add(RocksDbWeight::get().writes(6 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:2 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -374,9 +374,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenChildren (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:2) fn accept_nft() -> Weight { - (97_925_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(16 as Weight)) - .saturating_add(RocksDbWeight::get().writes(8 as Weight)) + Weight::from_ref_time(97_925_000) + .saturating_add(RocksDbWeight::get().reads(16 as u64)) + .saturating_add(RocksDbWeight::get().writes(8 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -390,9 +390,9 @@ impl WeightInfo for () { // Storage: Nonfungible Allowance (r:5 w:0) // Storage: Nonfungible Owned (r:0 w:5) fn reject_nft() -> Weight { - (277_794_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(30 as Weight)) - .saturating_add(RocksDbWeight::get().writes(26 as Weight)) + Weight::from_ref_time(277_794_000) + .saturating_add(RocksDbWeight::get().reads(30 as u64)) + .saturating_add(RocksDbWeight::get().writes(26 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -400,9 +400,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenData (r:5 w:0) fn set_property() -> Weight { - (54_657_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(9 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(54_657_000) + .saturating_add(RocksDbWeight::get().reads(9 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -410,9 +410,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenData (r:5 w:0) fn set_priority() -> Weight { - (55_056_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(9 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(55_056_000) + .saturating_add(RocksDbWeight::get().reads(9 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -421,9 +421,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn add_basic_resource() -> Weight { - (61_673_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(10 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(61_673_000) + .saturating_add(RocksDbWeight::get().reads(10 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -432,9 +432,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenAuxProperties (r:2 w:2) fn add_composable_resource() -> Weight { - (67_125_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(11 as Weight)) - .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(67_125_000) + .saturating_add(RocksDbWeight::get().reads(11 as u64)) + .saturating_add(RocksDbWeight::get().writes(3 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -443,9 +443,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenProperties (r:1 w:1) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn add_slot_resource() -> Weight { - (69_058_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(10 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(69_058_000) + .saturating_add(RocksDbWeight::get().reads(10 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -453,9 +453,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenAuxProperties (r:1 w:1) // Storage: Nonfungible TokenData (r:5 w:0) fn remove_resource() -> Weight { - (53_427_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(9 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(53_427_000) + .saturating_add(RocksDbWeight::get().reads(9 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -463,9 +463,9 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:5 w:0) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn accept_resource() -> Weight { - (50_623_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(9 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(50_623_000) + .saturating_add(RocksDbWeight::get().reads(9 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: RmrkCore UniqueCollectionId (r:1 w:0) // Storage: Common CollectionProperties (r:1 w:0) @@ -473,8 +473,8 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:5 w:0) // Storage: Nonfungible TokenAuxProperties (r:1 w:1) fn accept_resource_removal() -> Weight { - (50_917_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(9 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(50_917_000) + .saturating_add(RocksDbWeight::get().reads(9 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } } diff --git a/pallets/proxy-rmrk-equip/Cargo.toml b/pallets/proxy-rmrk-equip/Cargo.toml index fd33dc71b7..8f7bde625d 100644 --- a/pallets/proxy-rmrk-equip/Cargo.toml +++ b/pallets/proxy-rmrk-equip/Cargo.toml @@ -11,16 +11,16 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", diff --git a/pallets/proxy-rmrk-equip/src/weights.rs b/pallets/proxy-rmrk-equip/src/weights.rs index a064cf69c0..ab3a887e93 100644 --- a/pallets/proxy-rmrk-equip/src/weights.rs +++ b/pallets/proxy-rmrk-equip/src/weights.rs @@ -54,13 +54,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn create_base(b: u32, ) -> Weight { - (58_417_000 as Weight) + Weight::from_ref_time(58_417_000) // Standard Error: 27_000 - .saturating_add((20_439_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(8 as Weight)) - .saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(20_439_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes(8 as u64)) + .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(b as u64))) } // Storage: Common CollectionProperties (r:1 w:0) // Storage: Common CollectionById (r:1 w:0) @@ -71,20 +71,20 @@ impl WeightInfo for SubstrateWeight { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn theme_add(b: u32, ) -> Weight { - (46_005_000 as Weight) + Weight::from_ref_time(46_005_000) // Standard Error: 42_000 - .saturating_add((2_922_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + .saturating_add(Weight::from_ref_time(2_922_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(5 as u64)) } // Storage: Common CollectionProperties (r:1 w:0) // Storage: Common CollectionById (r:1 w:0) // Storage: RmrkEquip InernalPartId (r:1 w:0) // Storage: Nonfungible TokenProperties (r:1 w:1) fn equippable() -> Weight { - (32_526_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(32_526_000) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } @@ -103,13 +103,13 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn create_base(b: u32, ) -> Weight { - (58_417_000 as Weight) + Weight::from_ref_time(58_417_000) // Standard Error: 27_000 - .saturating_add((20_439_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(6 as Weight)) - .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(b as Weight))) - .saturating_add(RocksDbWeight::get().writes(8 as Weight)) - .saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(20_439_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(6 as u64)) + .saturating_add(RocksDbWeight::get().reads((2 as u64).saturating_mul(b as u64))) + .saturating_add(RocksDbWeight::get().writes(8 as u64)) + .saturating_add(RocksDbWeight::get().writes((4 as u64).saturating_mul(b as u64))) } // Storage: Common CollectionProperties (r:1 w:0) // Storage: Common CollectionById (r:1 w:0) @@ -120,19 +120,19 @@ impl WeightInfo for () { // Storage: Nonfungible TokenData (r:0 w:1) // Storage: Nonfungible Owned (r:0 w:1) fn theme_add(b: u32, ) -> Weight { - (46_005_000 as Weight) + Weight::from_ref_time(46_005_000) // Standard Error: 42_000 - .saturating_add((2_922_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(6 as Weight)) - .saturating_add(RocksDbWeight::get().writes(5 as Weight)) + .saturating_add(Weight::from_ref_time(2_922_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(6 as u64)) + .saturating_add(RocksDbWeight::get().writes(5 as u64)) } // Storage: Common CollectionProperties (r:1 w:0) // Storage: Common CollectionById (r:1 w:0) // Storage: RmrkEquip InernalPartId (r:1 w:0) // Storage: Nonfungible TokenProperties (r:1 w:1) fn equippable() -> Weight { - (32_526_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(32_526_000) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } } diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index 31fb156c5d..be811ec943 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -11,17 +11,17 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } struct-versioning = { path = "../../crates/struct-versioning" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } diff --git a/pallets/refungible/src/common.rs b/pallets/refungible/src/common.rs index 5bc0d42f19..9a7a416bf0 100644 --- a/pallets/refungible/src/common.rs +++ b/pallets/refungible/src/common.rs @@ -38,18 +38,18 @@ use crate::{ macro_rules! max_weight_of { ($($method:ident ($($args:tt)*)),*) => { - 0 + Weight::zero() $( .max(>::$method($($args)*)) )* }; } -fn properties_weight(properties: &CollectionPropertiesVec) -> u64 { +fn properties_weight(properties: &CollectionPropertiesVec) -> Weight { if properties.len() > 0 { >::set_token_properties(properties.len() as u32) } else { - 0 + Weight::zero() } } @@ -66,9 +66,9 @@ impl CommonWeightInfo for CommonWeights { up_data_structs::CreateItemData::ReFungible(rft_data) => { properties_weight::(&rft_data.properties) } - _ => 0, + _ => Weight::zero(), }) - .fold(0, |a, b| a.saturating_add(b)), + .fold(Weight::zero(), |a, b| a.saturating_add(b)), ) } @@ -83,10 +83,10 @@ impl CommonWeightInfo for CommonWeights { .saturating_add( i.iter() .map(|d| properties_weight::(&d.properties)) - .fold(0, |a, b| a.saturating_add(b)), + .fold(Weight::zero(), |a, b| a.saturating_add(b)), ) } - _ => 0, + _ => Weight::zero(), } } @@ -146,7 +146,7 @@ impl CommonWeightInfo for CommonWeights { } fn burn_recursively_breadth_raw(_amount: u32) -> Weight { // Refungible token can't have children - 0 + Weight::zero() } fn token_owner() -> Weight { diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 52bd85f1d7..e003e92db1 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -99,9 +99,7 @@ use frame_support::{ use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; use pallet_evm_coder_substrate::WithRecorder; use pallet_common::{ - CollectionHandle, CommonCollectionOperations, - dispatch::CollectionDispatch, - erc::static_property::{key, property_value_from_bytes}, + CommonCollectionOperations, Error as CommonError, eth::collection_id_to_address, Event as CommonEvent, Pallet as PalletCommon, @@ -112,7 +110,7 @@ use sp_core::H160; use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome}; use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap}; use up_data_structs::{ - AccessMode, budget::Budget, CollectionId, CollectionMode, CollectionFlags, + AccessMode, budget::Budget, CollectionId, CollectionFlags, CollectionPropertiesVec, CreateCollectionData, CustomDataLimit, mapping::TokenAddressMapping, MAX_ITEMS_PER_BATCH, MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission, PropertyPermission, PropertyScope, PropertyValue, TokenId, TrySetProperty, @@ -287,7 +285,7 @@ pub mod pallet { } StorageVersion::new(2).put::>(); - 0 + Weight::zero() } } } diff --git a/pallets/refungible/src/weights.rs b/pallets/refungible/src/weights.rs index 4698a36b2b..4b35e1fa41 100644 --- a/pallets/refungible/src/weights.rs +++ b/pallets/refungible/src/weights.rs @@ -65,9 +65,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TotalSupply (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) fn create_item() -> Weight { - (29_527_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(29_527_000) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(5 as u64)) } // Storage: Refungible TokensMinted (r:1 w:1) // Storage: Refungible AccountBalance (r:1 w:1) @@ -75,12 +75,12 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TotalSupply (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (28_541_000 as Weight) + Weight::from_ref_time(28_541_000) // Standard Error: 4_000 - .saturating_add((6_671_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(6_671_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(b as u64))) } // Storage: Refungible TokensMinted (r:1 w:1) // Storage: Refungible AccountBalance (r:4 w:4) @@ -88,13 +88,13 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TotalSupply (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_items(b: u32, ) -> Weight { - (24_366_000 as Weight) + Weight::from_ref_time(24_366_000) // Standard Error: 5_000 - .saturating_add((9_338_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(9_338_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(b as u64))) } // Storage: Refungible TokensMinted (r:1 w:1) // Storage: Refungible TotalSupply (r:0 w:1) @@ -102,22 +102,22 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible Balance (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight { - (27_574_000 as Weight) + Weight::from_ref_time(27_574_000) // Standard Error: 4_000 - .saturating_add((7_193_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(7_193_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(b as u64))) } // Storage: Refungible TotalSupply (r:1 w:1) // Storage: Refungible Balance (r:3 w:1) // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn burn_item_partial() -> Weight { - (42_943_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(42_943_000) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Refungible TotalSupply (r:1 w:1) // Storage: Refungible Balance (r:1 w:1) @@ -126,58 +126,58 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible Owned (r:0 w:1) // Storage: Refungible TokenProperties (r:0 w:1) fn burn_item_fully() -> Weight { - (36_861_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(36_861_000) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible TotalSupply (r:1 w:0) fn transfer_normal() -> Weight { - (27_789_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(27_789_000) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_creating() -> Weight { - (32_893_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(32_893_000) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_removing() -> Weight { - (34_703_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(34_703_000) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:2 w:2) // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:2) fn transfer_creating_removing() -> Weight { - (37_547_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(37_547_000) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Refungible Balance (r:1 w:0) // Storage: Refungible Allowance (r:0 w:1) fn approve() -> Weight { - (20_039_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(20_039_000) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible TotalSupply (r:1 w:0) fn transfer_from_normal() -> Weight { - (37_628_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(37_628_000) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) @@ -185,9 +185,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_creating() -> Weight { - (42_072_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(42_072_000) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(5 as u64)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) @@ -195,9 +195,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_removing() -> Weight { - (43_024_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(43_024_000) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(5 as u64)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) @@ -205,9 +205,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:2) fn transfer_from_creating_removing() -> Weight { - (45_910_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) + Weight::from_ref_time(45_910_000) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(7 as u64)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible TotalSupply (r:1 w:1) @@ -217,47 +217,47 @@ impl WeightInfo for SubstrateWeight { // Storage: Refungible Owned (r:0 w:1) // Storage: Refungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (48_584_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) + Weight::from_ref_time(48_584_000) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(7 as u64)) } // Storage: Common CollectionPropertyPermissions (r:1 w:1) fn set_token_property_permissions(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 60_000 - .saturating_add((15_533_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(15_533_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Common CollectionPropertyPermissions (r:1 w:0) // Storage: Refungible TokenProperties (r:1 w:1) fn set_token_properties(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 3_609_000 - .saturating_add((590_204_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(590_204_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Common CollectionPropertyPermissions (r:1 w:0) // Storage: Refungible TokenProperties (r:1 w:1) fn delete_token_properties(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 3_637_000 - .saturating_add((603_468_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(603_468_000).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Refungible TotalSupply (r:1 w:1) // Storage: Refungible Balance (r:1 w:1) fn repartition_item() -> Weight { - (22_356_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(22_356_000) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Refungible Balance (r:2 w:0) fn token_owner() -> Weight { - (9_431_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) + Weight::from_ref_time(9_431_000) + .saturating_add(T::DbWeight::get().reads(2 as u64)) } } @@ -269,9 +269,9 @@ impl WeightInfo for () { // Storage: Refungible TotalSupply (r:0 w:1) // Storage: Refungible Owned (r:0 w:1) fn create_item() -> Weight { - (29_527_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(29_527_000) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(5 as u64)) } // Storage: Refungible TokensMinted (r:1 w:1) // Storage: Refungible AccountBalance (r:1 w:1) @@ -279,12 +279,12 @@ impl WeightInfo for () { // Storage: Refungible TotalSupply (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items(b: u32, ) -> Weight { - (28_541_000 as Weight) + Weight::from_ref_time(28_541_000) // Standard Error: 4_000 - .saturating_add((6_671_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(6_671_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) + .saturating_add(RocksDbWeight::get().writes((3 as u64).saturating_mul(b as u64))) } // Storage: Refungible TokensMinted (r:1 w:1) // Storage: Refungible AccountBalance (r:4 w:4) @@ -292,13 +292,13 @@ impl WeightInfo for () { // Storage: Refungible TotalSupply (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_items(b: u32, ) -> Weight { - (24_366_000 as Weight) + Weight::from_ref_time(24_366_000) // Standard Error: 5_000 - .saturating_add((9_338_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(9_338_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) + .saturating_add(RocksDbWeight::get().writes((4 as u64).saturating_mul(b as u64))) } // Storage: Refungible TokensMinted (r:1 w:1) // Storage: Refungible TotalSupply (r:0 w:1) @@ -306,22 +306,22 @@ impl WeightInfo for () { // Storage: Refungible Balance (r:0 w:4) // Storage: Refungible Owned (r:0 w:4) fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight { - (27_574_000 as Weight) + Weight::from_ref_time(27_574_000) // Standard Error: 4_000 - .saturating_add((7_193_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(b as Weight))) + .saturating_add(Weight::from_ref_time(7_193_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) + .saturating_add(RocksDbWeight::get().writes((3 as u64).saturating_mul(b as u64))) } // Storage: Refungible TotalSupply (r:1 w:1) // Storage: Refungible Balance (r:3 w:1) // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible Owned (r:0 w:1) fn burn_item_partial() -> Weight { - (42_943_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(42_943_000) + .saturating_add(RocksDbWeight::get().reads(5 as u64)) + .saturating_add(RocksDbWeight::get().writes(4 as u64)) } // Storage: Refungible TotalSupply (r:1 w:1) // Storage: Refungible Balance (r:1 w:1) @@ -330,58 +330,58 @@ impl WeightInfo for () { // Storage: Refungible Owned (r:0 w:1) // Storage: Refungible TokenProperties (r:0 w:1) fn burn_item_fully() -> Weight { - (36_861_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(36_861_000) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().writes(6 as u64)) } // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible TotalSupply (r:1 w:0) fn transfer_normal() -> Weight { - (27_789_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(27_789_000) + .saturating_add(RocksDbWeight::get().reads(3 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_creating() -> Weight { - (32_893_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(32_893_000) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().writes(4 as u64)) } // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:1 w:1) // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_removing() -> Weight { - (34_703_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(34_703_000) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().writes(4 as u64)) } // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible AccountBalance (r:2 w:2) // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:2) fn transfer_creating_removing() -> Weight { - (37_547_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(37_547_000) + .saturating_add(RocksDbWeight::get().reads(5 as u64)) + .saturating_add(RocksDbWeight::get().writes(6 as u64)) } // Storage: Refungible Balance (r:1 w:0) // Storage: Refungible Allowance (r:0 w:1) fn approve() -> Weight { - (20_039_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(20_039_000) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) // Storage: Refungible TotalSupply (r:1 w:0) fn transfer_from_normal() -> Weight { - (37_628_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(37_628_000) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().writes(3 as u64)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) @@ -389,9 +389,9 @@ impl WeightInfo for () { // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_creating() -> Weight { - (42_072_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(42_072_000) + .saturating_add(RocksDbWeight::get().reads(5 as u64)) + .saturating_add(RocksDbWeight::get().writes(5 as u64)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) @@ -399,9 +399,9 @@ impl WeightInfo for () { // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:1) fn transfer_from_removing() -> Weight { - (43_024_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(43_024_000) + .saturating_add(RocksDbWeight::get().reads(5 as u64)) + .saturating_add(RocksDbWeight::get().writes(5 as u64)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible Balance (r:2 w:2) @@ -409,9 +409,9 @@ impl WeightInfo for () { // Storage: Refungible TotalSupply (r:1 w:0) // Storage: Refungible Owned (r:0 w:2) fn transfer_from_creating_removing() -> Weight { - (45_910_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(6 as Weight)) - .saturating_add(RocksDbWeight::get().writes(7 as Weight)) + Weight::from_ref_time(45_910_000) + .saturating_add(RocksDbWeight::get().reads(6 as u64)) + .saturating_add(RocksDbWeight::get().writes(7 as u64)) } // Storage: Refungible Allowance (r:1 w:1) // Storage: Refungible TotalSupply (r:1 w:1) @@ -421,46 +421,46 @@ impl WeightInfo for () { // Storage: Refungible Owned (r:0 w:1) // Storage: Refungible TokenProperties (r:0 w:1) fn burn_from() -> Weight { - (48_584_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(7 as Weight)) + Weight::from_ref_time(48_584_000) + .saturating_add(RocksDbWeight::get().reads(5 as u64)) + .saturating_add(RocksDbWeight::get().writes(7 as u64)) } // Storage: Common CollectionPropertyPermissions (r:1 w:1) fn set_token_property_permissions(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 60_000 - .saturating_add((15_533_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(15_533_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Common CollectionPropertyPermissions (r:1 w:0) // Storage: Refungible TokenProperties (r:1 w:1) fn set_token_properties(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 3_609_000 - .saturating_add((590_204_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(590_204_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Common CollectionPropertyPermissions (r:1 w:0) // Storage: Refungible TokenProperties (r:1 w:1) fn delete_token_properties(b: u32, ) -> Weight { - (0 as Weight) + (Weight::from_ref_time(0)) // Standard Error: 3_637_000 - .saturating_add((603_468_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(603_468_000).saturating_mul(b as u64)) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Refungible TotalSupply (r:1 w:1) // Storage: Refungible Balance (r:1 w:1) fn repartition_item() -> Weight { - (22_356_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(22_356_000) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } // Storage: Refungible Balance (r:2 w:0) fn token_owner() -> Weight { - (9_431_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + Weight::from_ref_time(9_431_000) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) } } diff --git a/pallets/scheduler/Cargo.toml b/pallets/scheduler/Cargo.toml index 8ed3ebe8d6..95a90e709a 100644 --- a/pallets/scheduler/Cargo.toml +++ b/pallets/scheduler/Cargo.toml @@ -16,20 +16,20 @@ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.27' } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.29' } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29" } log = { version = "0.4.16", default-features = false } [dev-dependencies] -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } [features] default = ["std"] diff --git a/pallets/scheduler/src/lib.rs b/pallets/scheduler/src/lib.rs index 2a181e4386..ead4fc0a39 100644 --- a/pallets/scheduler/src/lib.rs +++ b/pallets/scheduler/src/lib.rs @@ -497,7 +497,7 @@ pub mod pallet { } } // Total weight should be 0, because the transaction is already paid for - 0 + Weight::zero() } } diff --git a/pallets/scheduler/src/weights.rs b/pallets/scheduler/src/weights.rs index 12e4c39a84..646ccf74f8 100644 --- a/pallets/scheduler/src/weights.rs +++ b/pallets/scheduler/src/weights.rs @@ -55,13 +55,13 @@ impl WeightInfo for SubstrateWeight { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - (26_641_000 as Weight) + Weight::from_ref_time(26_641_000) // Standard Error: 9_000 - .saturating_add((8_547_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(8_547_000).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(4 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: System Account (r:1 w:1) @@ -69,12 +69,12 @@ impl WeightInfo for SubstrateWeight { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_resolved(s: u32, ) -> Weight { - (23_941_000 as Weight) + Weight::from_ref_time(23_941_000) // Standard Error: 17_000 - .saturating_add((5_282_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(5_282_000).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:2 w:2) // Storage: System Account (r:1 w:1) @@ -82,13 +82,13 @@ impl WeightInfo for SubstrateWeight { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic(s: u32, ) -> Weight { - (24_858_000 as Weight) + Weight::from_ref_time(24_858_000) // Standard Error: 7_000 - .saturating_add((8_657_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(8_657_000).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(4 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:2 w:2) // Storage: System Account (r:1 w:1) @@ -96,23 +96,23 @@ impl WeightInfo for SubstrateWeight { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - (25_515_000 as Weight) + Weight::from_ref_time(25_515_000) // Standard Error: 14_000 - .saturating_add((8_656_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(8_656_000).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(4 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_aborted(s: u32, ) -> Weight { - (7_584_000 as Weight) + Weight::from_ref_time(7_584_000) // Standard Error: 1_000 - .saturating_add((2_065_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(2_065_000).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: System Account (r:1 w:1) @@ -120,22 +120,22 @@ impl WeightInfo for SubstrateWeight { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_aborted(s: u32, ) -> Weight { - (25_552_000 as Weight) + Weight::from_ref_time(25_552_000) // Standard Error: 4_000 - .saturating_add((5_187_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(5_187_000).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named(s: u32, ) -> Weight { - (8_980_000 as Weight) + Weight::from_ref_time(8_980_000) // Standard Error: 12_000 - .saturating_add((2_050_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(2_050_000).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: System Account (r:1 w:1) @@ -143,12 +143,12 @@ impl WeightInfo for SubstrateWeight { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize(s: u32, ) -> Weight { - (24_482_000 as Weight) + Weight::from_ref_time(24_482_000) // Standard Error: 4_000 - .saturating_add((5_249_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(5_249_000).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: System Account (r:1 w:1) @@ -156,30 +156,30 @@ impl WeightInfo for SubstrateWeight { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_resolved(s: u32, ) -> Weight { - (25_187_000 as Weight) + Weight::from_ref_time(25_187_000) // Standard Error: 4_000 - .saturating_add((5_216_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(5_216_000).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn schedule_named(s: u32, ) -> Weight { - (17_316_000 as Weight) + Weight::from_ref_time(17_316_000) // Standard Error: 3_000 - .saturating_add((82_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(82_000).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn cancel_named(s: u32, ) -> Weight { - (15_652_000 as Weight) + Weight::from_ref_time(15_652_000) // Standard Error: 1_000 - .saturating_add((436_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(436_000).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } } @@ -191,13 +191,13 @@ impl WeightInfo for () { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - (26_641_000 as Weight) + Weight::from_ref_time(26_641_000) // Standard Error: 9_000 - .saturating_add((8_547_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(8_547_000).saturating_mul(s as u64)) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(RocksDbWeight::get().writes(4 as u64)) + .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: System Account (r:1 w:1) @@ -205,12 +205,12 @@ impl WeightInfo for () { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_resolved(s: u32, ) -> Weight { - (23_941_000 as Weight) + Weight::from_ref_time(23_941_000) // Standard Error: 17_000 - .saturating_add((5_282_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(5_282_000).saturating_mul(s as u64)) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().writes(4 as u64)) + .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:2 w:2) // Storage: System Account (r:1 w:1) @@ -218,13 +218,13 @@ impl WeightInfo for () { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic(s: u32, ) -> Weight { - (24_858_000 as Weight) + Weight::from_ref_time(24_858_000) // Standard Error: 7_000 - .saturating_add((8_657_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(8_657_000).saturating_mul(s as u64)) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(RocksDbWeight::get().writes(4 as u64)) + .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:2 w:2) // Storage: System Account (r:1 w:1) @@ -232,23 +232,23 @@ impl WeightInfo for () { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - (25_515_000 as Weight) + Weight::from_ref_time(25_515_000) // Standard Error: 14_000 - .saturating_add((8_656_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(8_656_000).saturating_mul(s as u64)) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(RocksDbWeight::get().writes(4 as u64)) + .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_aborted(s: u32, ) -> Weight { - (7_584_000 as Weight) + Weight::from_ref_time(7_584_000) // Standard Error: 1_000 - .saturating_add((2_065_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(2_065_000).saturating_mul(s as u64)) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) + .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: System Account (r:1 w:1) @@ -256,22 +256,22 @@ impl WeightInfo for () { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_aborted(s: u32, ) -> Weight { - (25_552_000 as Weight) + Weight::from_ref_time(25_552_000) // Standard Error: 4_000 - .saturating_add((5_187_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(5_187_000).saturating_mul(s as u64)) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().writes(4 as u64)) + .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named(s: u32, ) -> Weight { - (8_980_000 as Weight) + Weight::from_ref_time(8_980_000) // Standard Error: 12_000 - .saturating_add((2_050_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(2_050_000).saturating_mul(s as u64)) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) + .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: System Account (r:1 w:1) @@ -279,12 +279,12 @@ impl WeightInfo for () { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize(s: u32, ) -> Weight { - (24_482_000 as Weight) + Weight::from_ref_time(24_482_000) // Standard Error: 4_000 - .saturating_add((5_249_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(5_249_000).saturating_mul(s as u64)) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().writes(4 as u64)) + .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: System Account (r:1 w:1) @@ -292,29 +292,29 @@ impl WeightInfo for () { // Storage: System BlockWeight (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_resolved(s: u32, ) -> Weight { - (25_187_000 as Weight) + Weight::from_ref_time(25_187_000) // Standard Error: 4_000 - .saturating_add((5_216_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + .saturating_add(Weight::from_ref_time(5_216_000).saturating_mul(s as u64)) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().writes(4 as u64)) + .saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn schedule_named(s: u32, ) -> Weight { - (17_316_000 as Weight) + Weight::from_ref_time(17_316_000) // Standard Error: 3_000 - .saturating_add((82_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(82_000).saturating_mul(s as u64)) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn cancel_named(s: u32, ) -> Weight { - (15_652_000 as Weight) + Weight::from_ref_time(15_652_000) // Standard Error: 1_000 - .saturating_add((436_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(436_000).saturating_mul(s as u64)) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } } diff --git a/pallets/structure/Cargo.toml b/pallets/structure/Cargo.toml index 1022e92501..860b9f68a0 100644 --- a/pallets/structure/Cargo.toml +++ b/pallets/structure/Cargo.toml @@ -4,10 +4,10 @@ version = "0.1.2" edition = "2021" [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } pallet-common = { path = "../common", default-features = false } parity-scale-codec = { version = "3.1.2", default-features = false, features = [ "derive", @@ -16,7 +16,7 @@ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } up-data-structs = { path = "../../primitives/data-structs", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } [features] default = ["std"] diff --git a/pallets/structure/src/weights.rs b/pallets/structure/src/weights.rs index 98d0df6226..160e386fb5 100644 --- a/pallets/structure/src/weights.rs +++ b/pallets/structure/src/weights.rs @@ -42,8 +42,8 @@ impl WeightInfo for SubstrateWeight { // Storage: Common CollectionById (r:1 w:0) // Storage: Nonfungible TokenData (r:1 w:0) fn find_parent() -> Weight { - (7_180_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) + Weight::from_ref_time(7_180_000) + .saturating_add(T::DbWeight::get().reads(2 as u64)) } } @@ -52,7 +52,7 @@ impl WeightInfo for () { // Storage: Common CollectionById (r:1 w:0) // Storage: Nonfungible TokenData (r:1 w:0) fn find_parent() -> Weight { - (7_180_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + Weight::from_ref_time(7_180_000) + .saturating_add(RocksDbWeight::get().reads(2 as u64)) } } diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index 4303e91ade..d0cf366c8a 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -59,37 +59,37 @@ version = '3.1.2' default-features = false optional = true git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" ################################################################################ # Local Dependencies @@ -98,7 +98,7 @@ up-data-structs = { default-features = false, path = "../../primitives/data-stru scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } pallet-common = { default-features = false, path = "../common" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index b21ec08b22..ee6299ba77 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -83,7 +83,7 @@ use frame_support::{ }; use scale_info::TypeInfo; use frame_system::{self as system, ensure_signed}; -use sp_runtime::{sp_std::prelude::Vec}; +use sp_std::{vec, vec::Vec}; use up_data_structs::{ MAX_COLLECTION_NAME_LENGTH, MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH, CreateItemData, CollectionLimits, CollectionPermissions, CollectionId, CollectionMode, TokenId, @@ -280,11 +280,11 @@ decl_module! { pub fn deposit_event() = default; fn on_initialize(_now: T::BlockNumber) -> Weight { - 0 + Weight::zero() } fn on_runtime_upgrade() -> Weight { - 0 + Weight::zero() } /// Create a collection of tokens. diff --git a/pallets/unique/src/weights.rs b/pallets/unique/src/weights.rs index 6184aebcf3..5a141355e2 100644 --- a/pallets/unique/src/weights.rs +++ b/pallets/unique/src/weights.rs @@ -57,9 +57,9 @@ impl WeightInfo for SubstrateWeight { // Storage: Common CollectionProperties (r:0 w:1) // Storage: Common CollectionById (r:0 w:1) fn create_collection() -> Weight { - (43_143_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(43_143_000) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Common CollectionById (r:1 w:1) // Storage: Nonfungible TokenData (r:1 w:0) @@ -69,75 +69,75 @@ impl WeightInfo for SubstrateWeight { // Storage: Common AdminAmount (r:0 w:1) // Storage: Common CollectionProperties (r:0 w:1) fn destroy_collection() -> Weight { - (50_188_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(50_188_000) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Common CollectionById (r:1 w:0) // Storage: Common Allowlist (r:0 w:1) fn add_to_allow_list() -> Weight { - (18_238_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_238_000) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Common CollectionById (r:1 w:0) // Storage: Common Allowlist (r:0 w:1) fn remove_from_allow_list() -> Weight { - (18_084_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_084_000) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Common CollectionById (r:1 w:1) fn change_collection_owner() -> Weight { - (18_265_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_265_000) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Common CollectionById (r:1 w:0) // Storage: Common IsAdmin (r:1 w:1) // Storage: Common AdminAmount (r:1 w:1) fn add_collection_admin() -> Weight { - (23_558_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(23_558_000) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Common CollectionById (r:1 w:0) // Storage: Common IsAdmin (r:1 w:1) // Storage: Common AdminAmount (r:1 w:1) fn remove_collection_admin() -> Weight { - (25_285_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(25_285_000) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Common CollectionById (r:1 w:1) fn set_collection_sponsor() -> Weight { - (17_885_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_885_000) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Common CollectionById (r:1 w:1) fn confirm_sponsorship() -> Weight { - (17_897_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_897_000) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Common CollectionById (r:1 w:1) fn remove_collection_sponsor() -> Weight { - (17_836_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_836_000) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Common CollectionById (r:1 w:1) fn set_transfers_enabled_flag() -> Weight { - (9_714_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(9_714_000) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Common CollectionById (r:1 w:1) fn set_collection_limits() -> Weight { - (18_166_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_166_000) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } @@ -150,9 +150,9 @@ impl WeightInfo for () { // Storage: Common CollectionProperties (r:0 w:1) // Storage: Common CollectionById (r:0 w:1) fn create_collection() -> Weight { - (43_143_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(43_143_000) + .saturating_add(RocksDbWeight::get().reads(4 as u64)) + .saturating_add(RocksDbWeight::get().writes(6 as u64)) } // Storage: Common CollectionById (r:1 w:1) // Storage: Nonfungible TokenData (r:1 w:0) @@ -162,74 +162,74 @@ impl WeightInfo for () { // Storage: Common AdminAmount (r:0 w:1) // Storage: Common CollectionProperties (r:0 w:1) fn destroy_collection() -> Weight { - (50_188_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) - .saturating_add(RocksDbWeight::get().writes(6 as Weight)) + Weight::from_ref_time(50_188_000) + .saturating_add(RocksDbWeight::get().reads(3 as u64)) + .saturating_add(RocksDbWeight::get().writes(6 as u64)) } // Storage: Common CollectionById (r:1 w:0) // Storage: Common Allowlist (r:0 w:1) fn add_to_allow_list() -> Weight { - (18_238_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_238_000) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Common CollectionById (r:1 w:0) // Storage: Common Allowlist (r:0 w:1) fn remove_from_allow_list() -> Weight { - (18_084_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_084_000) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Common CollectionById (r:1 w:1) fn change_collection_owner() -> Weight { - (18_265_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_265_000) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Common CollectionById (r:1 w:0) // Storage: Common IsAdmin (r:1 w:1) // Storage: Common AdminAmount (r:1 w:1) fn add_collection_admin() -> Weight { - (23_558_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(23_558_000) + .saturating_add(RocksDbWeight::get().reads(3 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } // Storage: Common CollectionById (r:1 w:0) // Storage: Common IsAdmin (r:1 w:1) // Storage: Common AdminAmount (r:1 w:1) fn remove_collection_admin() -> Weight { - (25_285_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(3 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(25_285_000) + .saturating_add(RocksDbWeight::get().reads(3 as u64)) + .saturating_add(RocksDbWeight::get().writes(2 as u64)) } // Storage: Common CollectionById (r:1 w:1) fn set_collection_sponsor() -> Weight { - (17_885_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_885_000) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Common CollectionById (r:1 w:1) fn confirm_sponsorship() -> Weight { - (17_897_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_897_000) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Common CollectionById (r:1 w:1) fn remove_collection_sponsor() -> Weight { - (17_836_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_836_000) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Common CollectionById (r:1 w:1) fn set_transfers_enabled_flag() -> Weight { - (9_714_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(9_714_000) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Common CollectionById (r:1 w:1) fn set_collection_limits() -> Weight { - (18_166_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_166_000) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } } diff --git a/primitives/app_promotion_rpc/Cargo.toml b/primitives/app_promotion_rpc/Cargo.toml index a1b9fcf35c..7bcb59e7f3 100644 --- a/primitives/app_promotion_rpc/Cargo.toml +++ b/primitives/app_promotion_rpc/Cargo.toml @@ -10,11 +10,11 @@ up-data-structs = { default-features = false, path = '../data-structs' } codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [ "derive", ] } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } [features] default = ["std"] diff --git a/primitives/common/Cargo.toml b/primitives/common/Cargo.toml index d692cd3143..aa2f70c459 100644 --- a/primitives/common/Cargo.toml +++ b/primitives/common/Cargo.toml @@ -6,7 +6,7 @@ homepage = 'https://unique.network' license = 'All Rights Reserved' name = 'up-common' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = "0.9.27" +version = "0.9.29" [features] default = ['std'] @@ -23,34 +23,34 @@ std = [ [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.fp-rpc] default-features = false git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.27-fee-limit" +branch = "unique-polkadot-v0.9.29-fee-limit" [dependencies.pallet-evm] default-features = false git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.27-fee-limit" +branch = "unique-polkadot-v0.9.29-fee-limit" diff --git a/primitives/common/src/constants.rs b/primitives/common/src/constants.rs index 1a5eba72af..5ff5c661e9 100644 --- a/primitives/common/src/constants.rs +++ b/primitives/common/src/constants.rs @@ -54,7 +54,7 @@ pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); /// by Operational extrinsics. pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// We allow for 2 seconds of compute with a 6 second average block time. -pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; +pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_div(2); parameter_types! { pub const TransactionByteFee: Balance = 501 * MICROUNIQUE; diff --git a/primitives/data-structs/Cargo.toml b/primitives/data-structs/Cargo.toml index e86d25fe1b..6034a72781 100644 --- a/primitives/data-structs/Cargo.toml +++ b/primitives/data-structs/Cargo.toml @@ -18,14 +18,14 @@ codec = { package = "parity-scale-codec", version = "3.1.2", default-features = serde = { version = "1.0.130", features = [ 'derive', ], default-features = false, optional = true } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } derivative = { version = "2.2.0", features = ["use_core"] } struct-versioning = { path = "../../crates/struct-versioning" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } rmrk-traits = { default-features = false, path = "../rmrk-traits" } bondrewd = { version = "0.1.14", features = ["derive"], default-features = false } diff --git a/primitives/rmrk-rpc/Cargo.toml b/primitives/rmrk-rpc/Cargo.toml index 569a3cc16d..c779b5464e 100644 --- a/primitives/rmrk-rpc/Cargo.toml +++ b/primitives/rmrk-rpc/Cargo.toml @@ -8,10 +8,10 @@ edition = "2021" codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ "derive", ] } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } serde = { version = "1.0.130", default-features = false, features = ["derive"] } rmrk-traits = { default-features = false, path = "../rmrk-traits" } diff --git a/primitives/rpc/Cargo.toml b/primitives/rpc/Cargo.toml index 57add7153d..3d8b8464ef 100644 --- a/primitives/rpc/Cargo.toml +++ b/primitives/rpc/Cargo.toml @@ -10,11 +10,11 @@ up-data-structs = { default-features = false, path = '../data-structs' } codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [ "derive", ] } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } [features] default = ["std"] diff --git a/primitives/rpc/src/lib.rs b/primitives/rpc/src/lib.rs index e6a2471e13..a173d52b7c 100644 --- a/primitives/rpc/src/lib.rs +++ b/primitives/rpc/src/lib.rs @@ -23,10 +23,7 @@ use up_data_structs::{ use sp_std::vec::Vec; use codec::Decode; -use sp_runtime::{ - DispatchError, - traits::{AtLeast32BitUnsigned, Member}, -}; +use sp_runtime::DispatchError; type Result = core::result::Result; diff --git a/runtime/common/config/ethereum.rs b/runtime/common/config/ethereum.rs index a713925428..6c17185530 100644 --- a/runtime/common/config/ethereum.rs +++ b/runtime/common/config/ethereum.rs @@ -27,9 +27,9 @@ impl pallet_evm::account::Config for Runtime { // (contract, which only writes a lot of data), // approximating on top of our real store write weight parameter_types! { - pub const WritesPerSecond: u64 = WEIGHT_PER_SECOND / ::DbWeight::get().write; + pub const WritesPerSecond: u64 = WEIGHT_PER_SECOND.ref_time() / ::DbWeight::get().write; pub const GasPerSecond: u64 = WritesPerSecond::get() * 20000; - pub const WeightPerGas: u64 = WEIGHT_PER_SECOND / GasPerSecond::get(); + pub const WeightPerGas: u64 = WEIGHT_PER_SECOND.ref_time() / GasPerSecond::get(); } /// Limiting EVM execution to 50% of block for substrate users and management tasks @@ -37,16 +37,16 @@ parameter_types! { /// scheduled fairly const EVM_DISPATCH_RATIO: Perbill = Perbill::from_percent(50); parameter_types! { - pub BlockGasLimit: U256 = U256::from(NORMAL_DISPATCH_RATIO * EVM_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT / WeightPerGas::get()); + pub BlockGasLimit: U256 = U256::from((NORMAL_DISPATCH_RATIO * EVM_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT / WeightPerGas::get()).ref_time()); } pub enum FixedGasWeightMapping {} impl pallet_evm::GasWeightMapping for FixedGasWeightMapping { fn gas_to_weight(gas: u64) -> Weight { - gas.saturating_mul(WeightPerGas::get()) + Weight::from_ref_time(gas).saturating_mul(WeightPerGas::get()) } fn weight_to_gas(weight: Weight) -> u64 { - weight / WeightPerGas::get() + (weight / WeightPerGas::get()).ref_time() } } diff --git a/runtime/common/config/orml.rs b/runtime/common/config/orml.rs index 8138325eaa..7b4d0c6c1a 100644 --- a/runtime/common/config/orml.rs +++ b/runtime/common/config/orml.rs @@ -17,12 +17,12 @@ use frame_support::{ parameter_types, traits::{Contains, Everything}, - weights::Weight, }; use frame_system::EnsureSigned; use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key}; use sp_runtime::traits::Convert; use xcm::v1::{Junction::*, Junctions::*, MultiLocation, NetworkId}; +use xcm::latest::Weight; use xcm_builder::LocationInverter; use xcm_executor::XcmExecutor; use sp_std::{vec, vec::Vec}; diff --git a/runtime/common/config/parachain.rs b/runtime/common/config/parachain.rs index 2d51f9e374..0e6fc516c1 100644 --- a/runtime/common/config/parachain.rs +++ b/runtime/common/config/parachain.rs @@ -19,8 +19,8 @@ use crate::{Runtime, Event, XcmpQueue, DmpQueue}; use up_common::constants::*; parameter_types! { - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); } impl cumulus_pallet_parachain_system::Config for Runtime { diff --git a/runtime/common/config/xcm/mod.rs b/runtime/common/config/xcm/mod.rs index 21faa1ec38..8a21151f69 100644 --- a/runtime/common/config/xcm/mod.rs +++ b/runtime/common/config/xcm/mod.rs @@ -16,14 +16,13 @@ use frame_support::{ traits::{Everything, Get}, - weights::Weight, parameter_types, }; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; use xcm::v1::{Junction::*, MultiLocation, NetworkId}; -use xcm::latest::prelude::*; +use xcm::latest::{prelude::*, Weight}; use xcm_builder::{ AccountId32Aliases, EnsureXcmOrigin, FixedWeightBounds, LocationInverter, ParentAsSuperuser, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, diff --git a/runtime/common/config/xcm/nativeassets.rs b/runtime/common/config/xcm/nativeassets.rs index d67a464a07..705cc3d366 100644 --- a/runtime/common/config/xcm/nativeassets.rs +++ b/runtime/common/config/xcm/nativeassets.rs @@ -16,7 +16,7 @@ use frame_support::{ traits::{tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Get}, - weights::{Weight, WeightToFeePolynomial}, + weights::WeightToFeePolynomial, }; use sp_runtime::traits::{CheckedConversion, Zero, Convert}; use xcm::v1::{Junction::*, MultiLocation, Junctions::*}; @@ -24,6 +24,7 @@ use xcm::latest::{ AssetId::{Concrete}, Fungibility::Fungible as XcmFungible, MultiAsset, Error as XcmError, + Weight, }; use xcm_builder::{CurrencyAdapter, NativeAsset}; use xcm_executor::{ diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index c67fb4b1ee..affa528873 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -40,7 +40,7 @@ use sp_std::vec::Vec; use sp_version::NativeVersion; use crate::{ - Runtime, Call, Balances, Treasury, Aura, Signature, AllPalletsReversedWithSystemFirst, + Runtime, Call, Balances, Treasury, Aura, Signature, AllPalletsWithSystem, InherentDataExt, }; use up_common::types::{AccountId, BlockNumber}; @@ -105,7 +105,7 @@ pub type Executive = frame_executive::Executive< Block, frame_system::ChainContext, Runtime, - AllPalletsReversedWithSystemFirst, + AllPalletsWithSystem >; type NegativeImbalance = >::NegativeImbalance; diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index c06e6f857f..f26d352ccb 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -190,6 +190,7 @@ macro_rules! impl_common_runtime_apis { } impl app_promotion_rpc::AppPromotionApi for Runtime { + #[allow(unused_variables)] fn total_staked(staker: Option) -> Result { #[cfg(not(feature = "app-promotion"))] return unsupported!(); @@ -198,6 +199,7 @@ macro_rules! impl_common_runtime_apis { return Ok(>::cross_id_total_staked(staker).unwrap_or_default()); } + #[allow(unused_variables)] fn total_staked_per_block(staker: CrossAccountId) -> Result, DispatchError> { #[cfg(not(feature = "app-promotion"))] return unsupported!(); @@ -206,6 +208,7 @@ macro_rules! impl_common_runtime_apis { return Ok(>::cross_id_total_staked_per_block(staker)); } + #[allow(unused_variables)] fn pending_unstake(staker: Option) -> Result { #[cfg(not(feature = "app-promotion"))] return unsupported!(); @@ -214,6 +217,7 @@ macro_rules! impl_common_runtime_apis { return Ok(>::cross_id_pending_unstake(staker)); } + #[allow(unused_variables)] fn pending_unstake_per_block(staker: CrossAccountId) -> Result, DispatchError> { #[cfg(not(feature = "app-promotion"))] return unsupported!(); diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 84b1bf2855..2ebcb7fbf6 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -10,7 +10,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'opal-runtime' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = "0.9.27" +version = "0.9.29" [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] @@ -151,39 +151,39 @@ version = '3.1.2' default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-try-runtime] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-executive] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-system-benchmarking] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-system-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.hex-literal] optional = true @@ -198,12 +198,12 @@ version = '1.0.130' [dependencies.pallet-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" # Contracts specific packages # [dependencies.pallet-contracts] @@ -227,32 +227,32 @@ branch = "polkadot-v0.9.27" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-sudo] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-transaction-payment] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-treasury] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" # [dependencies.pallet-vesting] # default-features = false @@ -262,67 +262,67 @@ branch = "polkadot-v0.9.27" [dependencies.sp-arithmetic] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-block-builder] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-inherents] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-offchain] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-session] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-transaction-pool] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-version] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.smallvec] version = '1.6.1' @@ -333,46 +333,46 @@ version = '1.6.1' [dependencies.parachain-info] default-features = false git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.cumulus-pallet-aura-ext] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-pallet-parachain-system] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-pallet-xcm] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-pallet-dmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-pallet-xcmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-primitives-utility] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-primitives-timestamp] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false ################################################################################ @@ -380,50 +380,50 @@ default-features = false [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" default-features = false [dependencies.xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" default-features = false [dependencies.xcm-builder] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" default-features = false [dependencies.xcm-executor] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" default-features = false [dependencies.pallet-xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" default-features = false [dependencies.orml-vesting] -git = "https://github.com/open-web3-stack/open-runtime-module-library" -branch = "polkadot-v0.9.27" +git = "https://github.com/UniqueNetwork/open-runtime-module-library" +branch = "polkadot-v0.9.29" version = "0.4.1-dev" default-features = false [dependencies.orml-xtokens] -git = "https://github.com/open-web3-stack/open-runtime-module-library" -branch = "polkadot-v0.9.27" +git = "https://github.com/UniqueNetwork/open-runtime-module-library" +branch = "polkadot-v0.9.29" version = "0.4.1-dev" default-features = false [dependencies.orml-tokens] -git = "https://github.com/open-web3-stack/open-runtime-module-library" -branch = "polkadot-v0.9.27" +git = "https://github.com/UniqueNetwork/open-runtime-module-library" +branch = "polkadot-v0.9.29" version = "0.4.1-dev" default-features = false [dependencies.orml-traits] -git = "https://github.com/open-web3-stack/open-runtime-module-library" -branch = "polkadot-v0.9.27" +git = "https://github.com/UniqueNetwork/open-runtime-module-library" +branch = "polkadot-v0.9.29" version = "0.4.1-dev" default-features = false @@ -441,7 +441,7 @@ pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } @@ -455,18 +455,18 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.29' } pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" } ################################################################################ @@ -485,4 +485,4 @@ version = "2.0.0" [build-dependencies.substrate-wasm-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" diff --git a/runtime/opal/src/xcm_barrier.rs b/runtime/opal/src/xcm_barrier.rs index 7f7edb127c..9c225b6302 100644 --- a/runtime/opal/src/xcm_barrier.rs +++ b/runtime/opal/src/xcm_barrier.rs @@ -14,8 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use frame_support::{weights::Weight, traits::Everything}; -use xcm::{latest::Xcm, v1::MultiLocation}; +use frame_support::traits::Everything; +use xcm::{latest::{Xcm, Weight}, v1::MultiLocation}; use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit}; use xcm_executor::traits::ShouldExecute; diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 1dc76de294..65a416ddcb 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -148,39 +148,39 @@ version = '3.1.2' default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-try-runtime] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-executive] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-system-benchmarking] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-system-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.hex-literal] optional = true @@ -195,12 +195,12 @@ version = '1.0.130' [dependencies.pallet-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" # Contracts specific packages # [dependencies.pallet-contracts] @@ -224,32 +224,32 @@ branch = "polkadot-v0.9.27" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-sudo] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-transaction-payment] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-treasury] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" # [dependencies.pallet-vesting] # default-features = false @@ -259,67 +259,67 @@ branch = "polkadot-v0.9.27" [dependencies.sp-arithmetic] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-block-builder] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-inherents] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-offchain] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-session] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-transaction-pool] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-version] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.smallvec] version = '1.6.1' @@ -330,46 +330,46 @@ version = '1.6.1' [dependencies.parachain-info] default-features = false git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.cumulus-pallet-aura-ext] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-pallet-parachain-system] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-pallet-xcm] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-pallet-dmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-pallet-xcmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-primitives-utility] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-primitives-timestamp] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false ################################################################################ @@ -377,50 +377,50 @@ default-features = false [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" default-features = false [dependencies.xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" default-features = false [dependencies.xcm-builder] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" default-features = false [dependencies.xcm-executor] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" default-features = false [dependencies.pallet-xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" default-features = false [dependencies.orml-vesting] -git = "https://github.com/open-web3-stack/open-runtime-module-library" -branch = "polkadot-v0.9.27" +git = "https://github.com/UniqueNetwork/open-runtime-module-library" +branch = "polkadot-v0.9.29" version = "0.4.1-dev" default-features = false [dependencies.orml-xtokens] -git = "https://github.com/open-web3-stack/open-runtime-module-library" -branch = "polkadot-v0.9.27" +git = "https://github.com/UniqueNetwork/open-runtime-module-library" +branch = "polkadot-v0.9.29" version = "0.4.1-dev" default-features = false [dependencies.orml-tokens] -git = "https://github.com/open-web3-stack/open-runtime-module-library" -branch = "polkadot-v0.9.27" +git = "https://github.com/UniqueNetwork/open-runtime-module-library" +branch = "polkadot-v0.9.29" version = "0.4.1-dev" default-features = false [dependencies.orml-traits] -git = "https://github.com/open-web3-stack/open-runtime-module-library" -branch = "polkadot-v0.9.27" +git = "https://github.com/UniqueNetwork/open-runtime-module-library" +branch = "polkadot-v0.9.29" version = "0.4.1-dev" default-features = false @@ -446,7 +446,7 @@ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } @@ -460,18 +460,18 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.29' } pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" } ################################################################################ @@ -490,4 +490,4 @@ version = "2.0.0" [build-dependencies.substrate-wasm-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index 95b5ae12be..5833e7e3ae 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -11,22 +11,22 @@ refungible = [] [dependencies] up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } pallet-common = { path = '../../pallets/common' } pallet-structure = { path = '../../pallets/structure' } @@ -43,4 +43,4 @@ parity-scale-codec = { version = "3.1.2", default-features = false, features = [ scale-info = "*" evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29" } diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 0a2c5a7f97..ce85fe73d2 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -149,39 +149,39 @@ version = '3.1.2' default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-try-runtime] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-executive] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-system-benchmarking] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.frame-system-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.hex-literal] optional = true @@ -196,12 +196,12 @@ version = '1.0.130' [dependencies.pallet-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" # Contracts specific packages # [dependencies.pallet-contracts] @@ -225,32 +225,32 @@ branch = "polkadot-v0.9.27" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-sudo] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-transaction-payment] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.pallet-treasury] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" # [dependencies.pallet-vesting] # default-features = false @@ -260,67 +260,67 @@ branch = "polkadot-v0.9.27" [dependencies.sp-arithmetic] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-block-builder] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-inherents] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-offchain] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-session] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-transaction-pool] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.sp-version] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.smallvec] version = '1.6.1' @@ -331,46 +331,46 @@ version = '1.6.1' [dependencies.parachain-info] default-features = false git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" [dependencies.cumulus-pallet-aura-ext] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-pallet-parachain-system] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-pallet-xcm] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-pallet-dmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-pallet-xcmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-primitives-utility] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false [dependencies.cumulus-primitives-timestamp] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" default-features = false ################################################################################ @@ -378,50 +378,50 @@ default-features = false [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" default-features = false [dependencies.xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" default-features = false [dependencies.xcm-builder] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" default-features = false [dependencies.xcm-executor] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" default-features = false [dependencies.pallet-xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.27" +branch = "release-v0.9.29" default-features = false [dependencies.orml-vesting] -git = "https://github.com/open-web3-stack/open-runtime-module-library" -branch = "polkadot-v0.9.27" +git = "https://github.com/UniqueNetwork/open-runtime-module-library" +branch = "polkadot-v0.9.29" version = "0.4.1-dev" default-features = false [dependencies.orml-xtokens] -git = "https://github.com/open-web3-stack/open-runtime-module-library" -branch = "polkadot-v0.9.27" +git = "https://github.com/UniqueNetwork/open-runtime-module-library" +branch = "polkadot-v0.9.29" version = "0.4.1-dev" default-features = false [dependencies.orml-tokens] -git = "https://github.com/open-web3-stack/open-runtime-module-library" -branch = "polkadot-v0.9.27" +git = "https://github.com/UniqueNetwork/open-runtime-module-library" +branch = "polkadot-v0.9.29" version = "0.4.1-dev" default-features = false [dependencies.orml-traits] -git = "https://github.com/open-web3-stack/open-runtime-module-library" -branch = "polkadot-v0.9.27" +git = "https://github.com/UniqueNetwork/open-runtime-module-library" +branch = "polkadot-v0.9.29" version = "0.4.1-dev" default-features = false ################################################################################ @@ -451,19 +451,19 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.29' } pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" } ################################################################################ @@ -482,4 +482,4 @@ version = "2.0.0" [build-dependencies.substrate-wasm-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.27" +branch = "polkadot-v0.9.29" From b88274c6db1bd29ff28ab1354702bfc35a228bc8 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 28 Sep 2022 16:06:11 +0000 Subject: [PATCH 1006/1274] fix: cargo fmt --- crates/evm-coder/src/execution.rs | 8 ++++-- node/cli/src/service.rs | 2 +- pallets/common/src/lib.rs | 30 ++++++++++------------- pallets/refungible/src/lib.rs | 12 ++++----- runtime/common/config/xcm/nativeassets.rs | 3 +-- runtime/common/mod.rs | 7 ++---- runtime/opal/src/xcm_barrier.rs | 5 +++- 7 files changed, 32 insertions(+), 35 deletions(-) diff --git a/crates/evm-coder/src/execution.rs b/crates/evm-coder/src/execution.rs index adc87f5e41..c27ee59590 100644 --- a/crates/evm-coder/src/execution.rs +++ b/crates/evm-coder/src/execution.rs @@ -60,12 +60,16 @@ impl From for DispatchInfo { } impl From for DispatchInfo { fn from(weight: u64) -> Self { - Self { weight: Weight::from_ref_time(weight) } + Self { + weight: Weight::from_ref_time(weight), + } } } impl From<()> for DispatchInfo { fn from(_: ()) -> Self { - Self { weight: Weight::zero() } + Self { + weight: Weight::zero(), + } } } diff --git a/node/cli/src/service.rs b/node/cli/src/service.rs index 23da932d33..deab655b17 100644 --- a/node/cli/src/service.rs +++ b/node/cli/src/service.rs @@ -327,7 +327,7 @@ async fn build_relay_chain_interface( Arc::new(RelayChainRpcInterface::new(rpc_client)) as Arc<_>, None, )) - }, + } None => build_inprocess_relay_chain( polkadot_config, parachain_config, diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index e58f93c2ce..00f5d0ef61 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -185,25 +185,21 @@ impl CollectionHandle { /// Consume gas for reading. pub fn consume_store_reads(&self, reads: u64) -> evm_coder::execution::Result<()> { self.recorder - .consume_gas(T::GasWeightMapping::weight_to_gas( - Weight::from_ref_time( - ::DbWeight::get() - .read - .saturating_mul(reads) - ), - )) + .consume_gas(T::GasWeightMapping::weight_to_gas(Weight::from_ref_time( + ::DbWeight::get() + .read + .saturating_mul(reads), + ))) } /// Consume gas for writing. pub fn consume_store_writes(&self, writes: u64) -> evm_coder::execution::Result<()> { self.recorder - .consume_gas(T::GasWeightMapping::weight_to_gas( - Weight::from_ref_time( - ::DbWeight::get() - .write - .saturating_mul(writes) - ), - )) + .consume_gas(T::GasWeightMapping::weight_to_gas(Weight::from_ref_time( + ::DbWeight::get() + .write + .saturating_mul(writes), + ))) } /// Consume gas for reading and writing. @@ -216,9 +212,9 @@ impl CollectionHandle { let reads = weight.read.saturating_mul(reads); let writes = weight.read.saturating_mul(writes); self.recorder - .consume_gas(T::GasWeightMapping::weight_to_gas( - Weight::from_ref_time(reads.saturating_add(writes)), - )) + .consume_gas(T::GasWeightMapping::weight_to_gas(Weight::from_ref_time( + reads.saturating_add(writes), + ))) } /// Save collection to storage. diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index e003e92db1..7602172ea9 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -99,9 +99,7 @@ use frame_support::{ use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; use pallet_evm_coder_substrate::WithRecorder; use pallet_common::{ - CommonCollectionOperations, - Error as CommonError, - eth::collection_id_to_address, + CommonCollectionOperations, Error as CommonError, eth::collection_id_to_address, Event as CommonEvent, Pallet as PalletCommon, }; use pallet_structure::Pallet as PalletStructure; @@ -110,10 +108,10 @@ use sp_core::H160; use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome}; use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap}; use up_data_structs::{ - AccessMode, budget::Budget, CollectionId, CollectionFlags, - CollectionPropertiesVec, CreateCollectionData, CustomDataLimit, mapping::TokenAddressMapping, - MAX_ITEMS_PER_BATCH, MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission, - PropertyPermission, PropertyScope, PropertyValue, TokenId, TrySetProperty, + AccessMode, budget::Budget, CollectionId, CollectionFlags, CollectionPropertiesVec, + CreateCollectionData, CustomDataLimit, mapping::TokenAddressMapping, MAX_ITEMS_PER_BATCH, + MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission, PropertyPermission, + PropertyScope, PropertyValue, TokenId, TrySetProperty, }; use frame_support::BoundedBTreeMap; use derivative::Derivative; diff --git a/runtime/common/config/xcm/nativeassets.rs b/runtime/common/config/xcm/nativeassets.rs index 705cc3d366..2fecd60058 100644 --- a/runtime/common/config/xcm/nativeassets.rs +++ b/runtime/common/config/xcm/nativeassets.rs @@ -23,8 +23,7 @@ use xcm::v1::{Junction::*, MultiLocation, Junctions::*}; use xcm::latest::{ AssetId::{Concrete}, Fungibility::Fungible as XcmFungible, - MultiAsset, Error as XcmError, - Weight, + MultiAsset, Error as XcmError, Weight, }; use xcm_builder::{CurrencyAdapter, NativeAsset}; use xcm_executor::{ diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index affa528873..0ddf76175f 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -39,10 +39,7 @@ use sp_std::vec::Vec; #[cfg(feature = "std")] use sp_version::NativeVersion; -use crate::{ - Runtime, Call, Balances, Treasury, Aura, Signature, AllPalletsWithSystem, - InherentDataExt, -}; +use crate::{Runtime, Call, Balances, Treasury, Aura, Signature, AllPalletsWithSystem, InherentDataExt}; use up_common::types::{AccountId, BlockNumber}; #[macro_export] @@ -105,7 +102,7 @@ pub type Executive = frame_executive::Executive< Block, frame_system::ChainContext, Runtime, - AllPalletsWithSystem + AllPalletsWithSystem, >; type NegativeImbalance = >::NegativeImbalance; diff --git a/runtime/opal/src/xcm_barrier.rs b/runtime/opal/src/xcm_barrier.rs index 9c225b6302..99c4d9a3d0 100644 --- a/runtime/opal/src/xcm_barrier.rs +++ b/runtime/opal/src/xcm_barrier.rs @@ -15,7 +15,10 @@ // along with Unique Network. If not, see . use frame_support::traits::Everything; -use xcm::{latest::{Xcm, Weight}, v1::MultiLocation}; +use xcm::{ + latest::{Xcm, Weight}, + v1::MultiLocation, +}; use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit}; use xcm_executor::traits::ShouldExecute; From c1336b37b0b51dca5150d6d4b10a4d8206d035f0 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 3 Oct 2022 11:04:01 +0000 Subject: [PATCH 1007/1274] build: update frame-weight-template --- .maintain/frame-weight-template.hbs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.maintain/frame-weight-template.hbs b/.maintain/frame-weight-template.hbs index 0ec6414a55..e6ce89a0b1 100644 --- a/.maintain/frame-weight-template.hbs +++ b/.maintain/frame-weight-template.hbs @@ -47,22 +47,22 @@ impl WeightInfo for SubstrateWeight { {{~#each benchmark.components as |c| ~}} {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} ) -> Weight { - ({{underscore benchmark.base_weight}} as Weight) + Weight::from_ref_time({{underscore benchmark.base_weight}} as u64) {{#each benchmark.component_weight as |cw|}} // Standard Error: {{underscore cw.error}} - .saturating_add(({{underscore cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight)) + .saturating_add(Weight::from_ref_time({{underscore cw.slope}} as u64).saturating_mul({{cw.name}} as u64)) {{/each}} {{#if (ne benchmark.base_reads "0")}} - .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as Weight)) + .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as u64)) {{/if}} {{#each benchmark.component_reads as |cr|}} - .saturating_add(T::DbWeight::get().reads(({{cr.slope}} as Weight).saturating_mul({{cr.name}} as Weight))) + .saturating_add(T::DbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64))) {{/each}} {{#if (ne benchmark.base_writes "0")}} - .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as Weight)) + .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as u64)) {{/if}} {{#each benchmark.component_writes as |cw|}} - .saturating_add(T::DbWeight::get().writes(({{cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight))) + .saturating_add(T::DbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64))) {{/each}} } {{/each}} @@ -79,22 +79,22 @@ impl WeightInfo for () { {{~#each benchmark.components as |c| ~}} {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} ) -> Weight { - ({{underscore benchmark.base_weight}} as Weight) + Weight::from_ref_time({{underscore benchmark.base_weight}} as u64) {{#each benchmark.component_weight as |cw|}} // Standard Error: {{underscore cw.error}} - .saturating_add(({{underscore cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight)) + .saturating_add(Weight::from_ref_time({{underscore cw.slope}} as u64).saturating_mul({{cw.name}} as u64)) {{/each}} {{#if (ne benchmark.base_reads "0")}} - .saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}} as Weight)) + .saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}} as u64)) {{/if}} {{#each benchmark.component_reads as |cr|}} - .saturating_add(RocksDbWeight::get().reads(({{cr.slope}} as Weight).saturating_mul({{cr.name}} as Weight))) + .saturating_add(RocksDbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64))) {{/each}} {{#if (ne benchmark.base_writes "0")}} - .saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}} as Weight)) + .saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}} as u64)) {{/if}} {{#each benchmark.component_writes as |cw|}} - .saturating_add(RocksDbWeight::get().writes(({{cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight))) + .saturating_add(RocksDbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64))) {{/each}} } {{/each}} From 2472fbfb0a20a577b84ad6292ace83d0a5b8be52 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 3 Oct 2022 11:04:16 +0000 Subject: [PATCH 1008/1274] fix: benchmarks --- pallets/common/src/benchmarking.rs | 2 +- pallets/fungible/src/benchmarking.rs | 2 +- pallets/nonfungible/src/benchmarking.rs | 2 +- pallets/refungible/src/benchmarking.rs | 2 +- pallets/structure/src/benchmarking.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pallets/common/src/benchmarking.rs b/pallets/common/src/benchmarking.rs index 58466792f1..122b6b715c 100644 --- a/pallets/common/src/benchmarking.rs +++ b/pallets/common/src/benchmarking.rs @@ -116,7 +116,7 @@ fn create_collection( create_collection_raw( owner, CollectionMode::NFT, - |owner, data| >::init_collection(owner, data, CollectionFlags::default()), + |owner: T::CrossAccountId, data| >::init_collection(owner.clone(), owner, data, CollectionFlags::default()), |h| h, ) } diff --git a/pallets/fungible/src/benchmarking.rs b/pallets/fungible/src/benchmarking.rs index c24df19dd3..8977138a19 100644 --- a/pallets/fungible/src/benchmarking.rs +++ b/pallets/fungible/src/benchmarking.rs @@ -31,7 +31,7 @@ fn create_collection( create_collection_raw( owner, CollectionMode::Fungible(0), - >::init_collection, + |owner: T::CrossAccountId, data| >::init_collection(owner.clone(), owner, data), FungibleHandle::cast, ) } diff --git a/pallets/nonfungible/src/benchmarking.rs b/pallets/nonfungible/src/benchmarking.rs index 5444cbc3a8..82ec42006d 100644 --- a/pallets/nonfungible/src/benchmarking.rs +++ b/pallets/nonfungible/src/benchmarking.rs @@ -54,7 +54,7 @@ fn create_collection( create_collection_raw( owner, CollectionMode::NFT, - |owner, data| >::init_collection(owner, data, true), + |owner: T::CrossAccountId, data| >::init_collection(owner.clone(), owner, data, true), NonfungibleHandle::cast, ) } diff --git a/pallets/refungible/src/benchmarking.rs b/pallets/refungible/src/benchmarking.rs index 82712f38b4..b64c8e761b 100644 --- a/pallets/refungible/src/benchmarking.rs +++ b/pallets/refungible/src/benchmarking.rs @@ -62,7 +62,7 @@ fn create_collection( create_collection_raw( owner, CollectionMode::ReFungible, - >::init_collection, + |owner: T::CrossAccountId, data| >::init_collection(owner.clone(), owner, data), RefungibleHandle::cast, ) } diff --git a/pallets/structure/src/benchmarking.rs b/pallets/structure/src/benchmarking.rs index 8697b06cff..667a6e8f7e 100644 --- a/pallets/structure/src/benchmarking.rs +++ b/pallets/structure/src/benchmarking.rs @@ -32,7 +32,7 @@ benchmarks! { let caller_cross = T::CrossAccountId::from_sub(caller.clone()); ::Currency::deposit_creating(&caller, T::CollectionCreationPrice::get()); - T::CollectionDispatch::create(caller_cross.clone(), CreateCollectionData { + T::CollectionDispatch::create(caller_cross.clone(), caller_cross.clone(), CreateCollectionData { mode: CollectionMode::NFT, ..Default::default() })?; From e5aee8255e7c2f11a47b08c986f46b68947cd1ca Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 3 Oct 2022 11:09:37 +0000 Subject: [PATCH 1009/1274] fix: use fully qualified path in evm-coder --- crates/evm-coder/procedural/src/solidity_interface.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/evm-coder/procedural/src/solidity_interface.rs b/crates/evm-coder/procedural/src/solidity_interface.rs index cf5b659c1d..feb32c506a 100644 --- a/crates/evm-coder/procedural/src/solidity_interface.rs +++ b/crates/evm-coder/procedural/src/solidity_interface.rs @@ -1126,7 +1126,7 @@ impl SolidityInterface { #weight_variants, )* // TODO: It should be very cheap, but not free - Self::ERC165Call(::evm_coder::ERC165Call::SupportsInterface {..}, _) => frame_support::weights::Weight::from_ref_time(100).into(), + Self::ERC165Call(::evm_coder::ERC165Call::SupportsInterface {..}, _) => ::frame_support::weights::Weight::from_ref_time(100).into(), #( #weight_variants_this, )* From ea2246a29cee72d2b2b726d8fa1bd9260306a0bb Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 3 Oct 2022 12:08:38 +0000 Subject: [PATCH 1010/1274] fix: use unique-polkadot-v0.9.29 --- Cargo.lock | 1288 ++++++++++---------- client/rpc/Cargo.toml | 2 +- node/cli/Cargo.toml | 14 +- node/rpc/Cargo.toml | 14 +- pallets/app-promotion/Cargo.toml | 2 +- pallets/common/Cargo.toml | 4 +- pallets/configuration/Cargo.toml | 2 +- pallets/evm-coder-substrate/Cargo.toml | 4 +- pallets/evm-contract-helpers/Cargo.toml | 4 +- pallets/evm-migration/Cargo.toml | 4 +- pallets/evm-transaction-payment/Cargo.toml | 8 +- pallets/fungible/Cargo.toml | 2 +- pallets/nonfungible/Cargo.toml | 2 +- pallets/proxy-rmrk-core/Cargo.toml | 2 +- pallets/proxy-rmrk-equip/Cargo.toml | 2 +- pallets/refungible/Cargo.toml | 2 +- pallets/structure/Cargo.toml | 2 +- pallets/unique/Cargo.toml | 2 +- primitives/app_promotion_rpc/Cargo.toml | 2 +- primitives/common/Cargo.toml | 4 +- primitives/data-structs/Cargo.toml | 2 +- primitives/rpc/Cargo.toml | 2 +- runtime/opal/Cargo.toml | 12 +- runtime/quartz/Cargo.toml | 12 +- runtime/tests/Cargo.toml | 6 +- runtime/unique/Cargo.toml | 12 +- 26 files changed, 705 insertions(+), 707 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index daf094c5db..0e01e64e1a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,9 +75,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" dependencies = [ "memchr", ] @@ -90,9 +90,9 @@ checksum = "fbf688625d06217d5b1bb0ea9d9c44a1635fd0ee3534466388d18203174f4d11" [[package]] name = "android_system_properties" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ed72e1635e121ca3e79420540282af22da58be50de153d36f81ddc6b83aa9e" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" dependencies = [ "libc", ] @@ -108,9 +108,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.61" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "508b352bb5c066aac251f6daf6b36eccd03e8a88e8081cd44959ea277a3af9a8" +checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" [[package]] name = "app-promotion-rpc" @@ -118,7 +118,7 @@ version = "0.1.0" dependencies = [ "pallet-common", "pallet-evm", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-api", "sp-core", "sp-runtime", @@ -211,9 +211,9 @@ dependencies = [ [[package]] name = "async-global-executor" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5262ed948da60dd8956c6c5aca4d4163593dddb7b32d73267c93dab7b2e98940" +checksum = "0da5b41ee986eed3f524c380e6d64965aea573882a8907682ad100f7859305ca" dependencies = [ "async-channel", "async-executor", @@ -221,16 +221,16 @@ dependencies = [ "async-lock", "blocking", "futures-lite", - "num_cpus", "once_cell", ] [[package]] name = "async-io" -version = "1.7.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5e18f61464ae81cde0a23e713ae8fd299580c54d697a35820cfd0625b8b0e07" +checksum = "83e21f3a490c72b3b0cf44962180e60045de2925d8dff97918f7ee43c8f637c7" dependencies = [ + "autocfg", "concurrent-queue", "futures-lite", "libc", @@ -255,11 +255,12 @@ dependencies = [ [[package]] name = "async-process" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2c06e30a24e8c78a3987d07f0930edf76ef35e027e7bdb063fccafdad1f60c" +checksum = "02111fd8655a613c25069ea89fc8d9bb89331fa77486eb3bc059ee757cfa481c" dependencies = [ "async-io", + "autocfg", "blocking", "cfg-if 1.0.0", "event-listener", @@ -443,7 +444,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "beefy-primitives", @@ -452,7 +453,7 @@ dependencies = [ "futures-timer", "hex", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-chain-spec", "sc-client-api", @@ -479,14 +480,14 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "beefy-gadget", "beefy-primitives", "futures 0.3.24", "jsonrpsee", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-rpc", "sc-utils", @@ -499,7 +500,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "beefy-primitives", "sp-api", @@ -508,9 +509,9 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-api", "sp-application-crypto", @@ -589,7 +590,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9cf849ee05b2ee5fba5e36f97ff8ec2533916700fc0758d40d92136a42f3388" dependencies = [ - "digest 0.10.3", + "digest 0.10.5", ] [[package]] @@ -635,7 +636,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "constant_time_eq", - "digest 0.10.3", + "digest 0.10.5", ] [[package]] @@ -662,9 +663,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ "generic-array 0.14.6", ] @@ -753,9 +754,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.10.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" +checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" [[package]] name = "byte-slice-cast" @@ -824,7 +825,7 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver 1.0.13", + "semver 1.0.14", "serde", "serde_json", ] @@ -947,9 +948,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.3.3" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b" +checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" dependencies = [ "glob", "libc", @@ -1018,9 +1019,9 @@ dependencies = [ [[package]] name = "comfy-table" -version = "6.0.0" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121d8a5b0346092c18a4b2fd6f620d7a06f0eb7ac0a45860939a0884bc579c56" +checksum = "85914173c2f558d61613bfbbf1911f14e630895087a7ed2fafc0f5319e1536e7" dependencies = [ "strum", "strum_macros", @@ -1090,9 +1091,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] @@ -1225,15 +1226,14 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" +checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" dependencies = [ "autocfg", "cfg-if 1.0.0", "crossbeam-utils", "memoffset", - "once_cell", "scopeguard", ] @@ -1249,12 +1249,11 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ "cfg-if 1.0.0", - "once_cell", ] [[package]] @@ -1270,7 +1269,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" dependencies = [ "generic-array 0.14.6", - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -1341,7 +1340,7 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "clap", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-chain-spec", "sc-cli", "sc-service", @@ -1360,7 +1359,7 @@ dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", "futures 0.3.24", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -1383,7 +1382,7 @@ dependencies = [ "cumulus-client-consensus-common", "cumulus-primitives-core", "futures 0.3.24", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-client-api", "sc-consensus", "sc-consensus-aura", @@ -1412,7 +1411,7 @@ dependencies = [ "cumulus-relay-chain-interface", "dyn-clone", "futures 0.3.24", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-primitives", "sc-client-api", "sc-consensus", @@ -1434,7 +1433,7 @@ dependencies = [ "derive_more", "futures 0.3.24", "futures-timer", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "polkadot-node-primitives", "polkadot-parachain", @@ -1458,7 +1457,7 @@ dependencies = [ "cumulus-relay-chain-interface", "futures 0.3.24", "futures-timer", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", @@ -1510,7 +1509,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-aura", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-application-crypto", @@ -1528,7 +1527,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-io", "sp-runtime", @@ -1552,7 +1551,7 @@ dependencies = [ "impl-trait-for-tuples", "log", "pallet-balances", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-parachain", "scale-info", "serde", @@ -1587,7 +1586,7 @@ dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-io", @@ -1605,7 +1604,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "rand_chacha 0.3.1", "scale-info", "sp-runtime", @@ -1620,7 +1619,7 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "frame-support", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-core-primitives", "polkadot-parachain", "polkadot-primitives", @@ -1639,7 +1638,7 @@ dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", "cumulus-test-relay-sproof-builder", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-client-api", "scale-info", "sp-api", @@ -1660,7 +1659,7 @@ source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa9 dependencies = [ "cumulus-primitives-core", "futures 0.3.24", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-inherents", "sp-std", "sp-timestamp", @@ -1674,7 +1673,7 @@ dependencies = [ "cumulus-primitives-core", "frame-support", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-core-primitives", "polkadot-parachain", "polkadot-primitives", @@ -1725,7 +1724,7 @@ dependencies = [ "derive_more", "futures 0.3.24", "jsonrpsee-core", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "polkadot-overseer", "polkadot-service", @@ -1750,7 +1749,7 @@ dependencies = [ "futures 0.3.24", "futures-timer", "jsonrpsee", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "polkadot-service", "sc-client-api", @@ -1771,7 +1770,7 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" dependencies = [ "cumulus-primitives-core", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-primitives", "sp-runtime", "sp-state-machine", @@ -1812,7 +1811,7 @@ checksum = "4033478fbf70d6acf2655ac70da91ee65852d69daf7a67bf7a2f518fb47aafcf" dependencies = [ "byteorder", "digest 0.9.0", - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -1896,11 +1895,11 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" dependencies = [ - "block-buffer 0.10.2", + "block-buffer 0.10.3", "crypto-common", "subtle", ] @@ -2038,7 +2037,7 @@ checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" dependencies = [ "curve25519-dalek 3.2.0", "hex", - "rand_core 0.6.3", + "rand_core 0.6.4", "sha2 0.9.9", "thiserror", "zeroize", @@ -2046,9 +2045,9 @@ dependencies = [ [[package]] name = "either" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "elliptic-curve" @@ -2062,7 +2061,7 @@ dependencies = [ "ff", "generic-array 0.14.6", "group", - "rand_core 0.6.3", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", @@ -2113,9 +2112,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +checksum = "c90bf5f19754d10198ccb95b70664fc925bd1fc090a0fd9a6ebc54acc8cd6272" dependencies = [ "atty", "humantime", @@ -2176,12 +2175,12 @@ dependencies = [ "ethereum-types", "hash-db", "hash256-std-hasher", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "rlp", "rlp-derive", "scale-info", "serde", - "sha3 0.10.2", + "sha3 0.10.5", "triehash", ] @@ -2219,12 +2218,12 @@ dependencies = [ "evm-gasometer", "evm-runtime", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "primitive-types", "rlp", "scale-info", "serde", - "sha3 0.10.2", + "sha3 0.10.5", ] [[package]] @@ -2250,7 +2249,7 @@ dependencies = [ "hex", "proc-macro2", "quote", - "sha3 0.10.2", + "sha3 0.10.5", "syn", ] @@ -2259,7 +2258,7 @@ name = "evm-core" version = "0.35.0" source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.29#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "primitive-types", "scale-info", "serde", @@ -2285,7 +2284,7 @@ dependencies = [ "environmental", "evm-core", "primitive-types", - "sha3 0.10.2", + "sha3 0.10.5", ] [[package]] @@ -2371,7 +2370,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "async-trait", "fc-db", @@ -2390,12 +2389,12 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "fp-storage", "kvdb-rocksdb", "parity-db", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-client-db", "sp-core", @@ -2406,7 +2405,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "fc-db", "fp-consensus", @@ -2423,7 +2422,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "ethereum", "ethereum-types", @@ -2438,7 +2437,7 @@ dependencies = [ "libsecp256k1", "log", "lru 0.7.8", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "prometheus", "rand 0.8.5", "rlp", @@ -2465,7 +2464,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "ethereum", "ethereum-types", @@ -2491,7 +2490,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" dependencies = [ - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", ] @@ -2528,7 +2527,7 @@ dependencies = [ "futures-timer", "log", "num-traits", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "scale-info", ] @@ -2588,28 +2587,27 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", ] [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "ethereum", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-core", "sp-runtime", "sp-std", @@ -2618,12 +2616,12 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "evm", "frame-support", "impl-trait-for-tuples", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "serde", "sp-core", "sp-std", @@ -2632,7 +2630,7 @@ dependencies = [ [[package]] name = "fp-evm-mapping" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "frame-support", "sp-core", @@ -2641,12 +2639,12 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "ethereum", "ethereum-types", "fp-evm", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-api", "sp-core", @@ -2658,11 +2656,11 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "ethereum", "frame-support", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parity-util-mem", "scale-info", "serde", @@ -2674,21 +2672,21 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", ] [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-support", "frame-system", "linregress", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "paste", "scale-info", "serde", @@ -2705,7 +2703,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "Inflector", "chrono", @@ -2724,7 +2722,7 @@ dependencies = [ "linked-hash-map", "log", "memory-db", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "rand 0.8.5", "rand_pcg 0.3.1", "sc-block-builder", @@ -2756,7 +2754,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2767,12 +2765,12 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-election-provider-solution-type", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-arithmetic", "sp-npos-elections", @@ -2783,12 +2781,12 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-support", "frame-system", "frame-try-runtime", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -2804,7 +2802,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d" dependencies = [ "cfg-if 1.0.0", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", ] @@ -2812,7 +2810,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "bitflags", "frame-metadata", @@ -2821,7 +2819,7 @@ dependencies = [ "k256", "log", "once_cell", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "paste", "scale-info", "serde", @@ -2843,7 +2841,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "Inflector", "cfg-expr", @@ -2857,7 +2855,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2869,7 +2867,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "proc-macro2", "quote", @@ -2879,11 +2877,11 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-support", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -2896,12 +2894,12 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-runtime", @@ -2911,19 +2909,19 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-api", ] [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-support", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-api", "sp-runtime", "sp-std", @@ -2931,9 +2929,9 @@ dependencies = [ [[package]] name = "fs-err" -version = "2.7.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd79fa345a495d3ae89fb7165fec01c0e72f41821d642dda363a1e97975652e" +checksum = "64db3e262960f0662f43a6366788d5f10f7f244b8f7d7d987f560baf5ded5c50" [[package]] name = "fs-swap" @@ -3225,15 +3223,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" dependencies = [ "ff", - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", ] [[package]] name = "h2" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" dependencies = [ "bytes", "fnv", @@ -3250,9 +3248,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.3.3" +version = "4.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360d9740069b2f6cbb63ce2dbaa71a20d3185350cbb990d7bebeb9318415eb17" +checksum = "56b224eaa4987c03c30b251de7ef0c15a6a59f34222905850dbc3026dfb24d5f" dependencies = [ "log", "pest", @@ -3394,9 +3392,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -3451,9 +3449,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.45" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5528d9c2817db4e10cc78f8d4c8228906e5854f389ff6b076cee3572a09d35" +checksum = "fd911b35d940d2bd0bea0f9100068e5b97b51a1cbe13d13382f132e0365257a0" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -3473,6 +3471,16 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "if-addrs" version = "0.7.0" @@ -3507,7 +3515,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", ] [[package]] @@ -3582,9 +3590,9 @@ checksum = "ec58677acfea8a15352d42fc87d11d63596ade9239e0a7c9352914417515dbe6" [[package]] name = "io-lifetimes" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24c3f4eff5495aee4c0399d7b6a0dc2b6e81be84242ffbfcf253ebacccc1d0cb" +checksum = "1ea37f355c05dde75b84bba2d767906ad522e97cd9e2eef2be7a4ab7fb442c06" [[package]] name = "ip_network" @@ -3612,9 +3620,9 @@ checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] @@ -3633,18 +3641,18 @@ checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" [[package]] name = "jobserver" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.59" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" dependencies = [ "wasm-bindgen", ] @@ -3871,7 +3879,7 @@ dependencies = [ "pallet-vesting", "pallet-xcm", "pallet-xcm-benchmarks", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", @@ -3978,9 +3986,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.131" +version = "0.2.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c3b4822ccebfa39c02fc03d1534441b22ead323fa0f48bb7ddd8e6ba076a40" +checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb" [[package]] name = "libloading" @@ -4098,7 +4106,7 @@ dependencies = [ "rand 0.8.5", "ring", "rw-stream-sink", - "sha2 0.10.2", + "sha2 0.10.6", "smallvec", "thiserror", "unsigned-varint", @@ -4172,7 +4180,7 @@ dependencies = [ "prost-build", "rand 0.7.3", "regex", - "sha2 0.10.2", + "sha2 0.10.6", "smallvec", "unsigned-varint", "wasm-timer", @@ -4219,7 +4227,7 @@ dependencies = [ "prost", "prost-build", "rand 0.7.3", - "sha2 0.10.2", + "sha2 0.10.6", "smallvec", "thiserror", "uint", @@ -4297,7 +4305,7 @@ dependencies = [ "prost", "prost-build", "rand 0.8.5", - "sha2 0.10.2", + "sha2 0.10.6", "snow", "static_assertions", "x25519-dalek", @@ -4394,7 +4402,7 @@ dependencies = [ "prost", "prost-build", "rand 0.8.5", - "sha2 0.10.2", + "sha2 0.10.6", "thiserror", "unsigned-varint", "void", @@ -4636,9 +4644,9 @@ checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ "autocfg", "scopeguard", @@ -4666,18 +4674,18 @@ dependencies = [ [[package]] name = "lru" -version = "0.6.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ea2d928b485416e8908cff2d97d621db22b27f7b3b6729e438bcf42c671ba91" +checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" dependencies = [ - "hashbrown 0.11.2", + "hashbrown 0.12.3", ] [[package]] name = "lru" -version = "0.7.8" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" +checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" dependencies = [ "hashbrown 0.12.3", ] @@ -4693,9 +4701,9 @@ dependencies = [ [[package]] name = "lz4" -version = "1.23.3" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edcb94251b1c375c459e5abe9fb0168c1c826c3370172684844f8f3f8d1a885" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" dependencies = [ "libc", "lz4-sys", @@ -4703,9 +4711,9 @@ dependencies = [ [[package]] name = "lz4-sys" -version = "1.9.3" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7be8908e2ed6f31c02db8a9fa962f03e36c53fbfde437363eae3306b85d7e17" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" dependencies = [ "cc", "libc", @@ -4765,15 +4773,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memmap2" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723e3ebdcdc5c023db1df315364573789f8857c11b631a2fdfad7c00f5c046b4" -dependencies = [ - "libc", -] - [[package]] name = "memmap2" version = "0.5.7" @@ -4805,11 +4804,11 @@ dependencies = [ [[package]] name = "memory-lru" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beeb98b3d1ed2c0054bd81b5ba949a0243c3ccad751d45ea898fa8059fa2860a" +checksum = "ce95ae042940bad7e312857b929ee3d11b8f799a80cb7b9c7ec5125516906395" dependencies = [ - "lru 0.6.6", + "lru 0.8.1", ] [[package]] @@ -4849,9 +4848,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" dependencies = [ "adler", ] @@ -4913,10 +4912,10 @@ dependencies = [ "blake2s_simd", "blake3", "core2", - "digest 0.10.3", + "digest 0.10.5", "multihash-derive", - "sha2 0.10.2", - "sha3 0.10.2", + "sha2 0.10.6", + "sha3 0.10.5", "unsigned-varint", ] @@ -5212,9 +5211,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" [[package]] name = "opal-runtime" @@ -5280,7 +5279,7 @@ dependencies = [ "pallet-unique-scheduler", "pallet-xcm", "parachain-info", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-parachain", "rmrk-rpc", "scale-info", @@ -5374,7 +5373,7 @@ dependencies = [ "frame-support", "frame-system", "orml-traits", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-runtime", @@ -5390,7 +5389,7 @@ dependencies = [ "impl-trait-for-tuples", "num-traits", "orml-utilities", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-io", @@ -5405,7 +5404,7 @@ version = "0.4.1-dev" source = "git+https://github.com/UniqueNetwork/open-runtime-module-library?branch=polkadot-v0.9.29#2caeb6621a59cbf37829d6a80bc2b89195959d45" dependencies = [ "frame-support", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-io", @@ -5420,7 +5419,7 @@ source = "git+https://github.com/UniqueNetwork/open-runtime-module-library?branc dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-io", @@ -5435,7 +5434,7 @@ source = "git+https://github.com/UniqueNetwork/open-runtime-module-library?branc dependencies = [ "frame-support", "orml-traits", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-runtime", "sp-std", "xcm", @@ -5453,7 +5452,7 @@ dependencies = [ "orml-traits", "orml-xcm-support", "pallet-xcm", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-io", @@ -5493,7 +5492,7 @@ dependencies = [ "pallet-randomness-collective-flip", "pallet-timestamp", "pallet-unique", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -5506,12 +5505,12 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-support", "frame-system", "pallet-timestamp", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-application-crypto", "sp-consensus-aura", @@ -5522,12 +5521,12 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-support", "frame-system", "pallet-session", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-application-crypto", "sp-authority-discovery", @@ -5538,12 +5537,12 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-authorship", "sp-runtime", @@ -5553,7 +5552,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", @@ -5562,7 +5561,7 @@ dependencies = [ "pallet-authorship", "pallet-session", "pallet-timestamp", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-application-crypto", "sp-consensus-babe", @@ -5577,7 +5576,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5585,7 +5584,7 @@ dependencies = [ "frame-system", "log", "pallet-balances", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -5597,13 +5596,13 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-runtime", "sp-std", @@ -5612,12 +5611,12 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "fp-evm", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -5627,13 +5626,13 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "beefy-primitives", "frame-support", "frame-system", "pallet-session", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-runtime", @@ -5643,7 +5642,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -5654,7 +5653,7 @@ dependencies = [ "pallet-beefy", "pallet-mmr", "pallet-session", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -5666,14 +5665,14 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", "pallet-treasury", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -5684,7 +5683,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", @@ -5692,7 +5691,7 @@ dependencies = [ "log", "pallet-bounties", "pallet-treasury", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -5703,13 +5702,13 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -5729,7 +5728,7 @@ dependencies = [ "frame-system", "pallet-evm", "pallet-evm-coder-substrate", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -5745,7 +5744,7 @@ dependencies = [ "fp-evm", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "smallvec", "sp-arithmetic", @@ -5757,12 +5756,12 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-io", @@ -5773,14 +5772,14 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-election-provider-support", "frame-support", "frame-system", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "rand 0.7.3", "scale-info", "sp-arithmetic", @@ -5796,12 +5795,12 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-election-provider-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-npos-elections", "sp-runtime", ] @@ -5809,13 +5808,13 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -5827,7 +5826,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "ethereum", "ethereum-types", @@ -5843,11 +5842,11 @@ dependencies = [ "log", "pallet-evm", "pallet-timestamp", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "rlp", "scale-info", "serde", - "sha3 0.10.2", + "sha3 0.10.5", "sp-io", "sp-runtime", "sp-std", @@ -5856,7 +5855,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29-fee-limit#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" dependencies = [ "evm", "fp-evm", @@ -5868,12 +5867,12 @@ dependencies = [ "impl-trait-for-tuples", "log", "pallet-timestamp", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "primitive-types", "rlp", "scale-info", "serde", - "sha3 0.10.2", + "sha3 0.10.5", "sp-core", "sp-io", "sp-runtime", @@ -5891,7 +5890,7 @@ dependencies = [ "frame-system", "pallet-ethereum", "pallet-evm", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-std", @@ -5912,7 +5911,7 @@ dependencies = [ "pallet-evm", "pallet-evm-coder-substrate", "pallet-evm-transaction-payment", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-runtime", @@ -5930,7 +5929,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-evm", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -5948,7 +5947,7 @@ dependencies = [ "frame-system", "pallet-ethereum", "pallet-evm", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -5971,7 +5970,7 @@ dependencies = [ "pallet-common", "pallet-fungible", "pallet-timestamp", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "serde_json", @@ -5998,7 +5997,7 @@ dependencies = [ "pallet-evm", "pallet-evm-coder-substrate", "pallet-structure", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-runtime", @@ -6009,12 +6008,12 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-arithmetic", "sp-runtime", @@ -6024,7 +6023,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", @@ -6032,7 +6031,7 @@ dependencies = [ "log", "pallet-authorship", "pallet-session", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-application-crypto", "sp-core", @@ -6047,13 +6046,13 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "enumflags2", "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-io", "sp-runtime", @@ -6063,14 +6062,14 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", "pallet-authorship", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-application-crypto", "sp-core", @@ -6083,12 +6082,12 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6107,7 +6106,7 @@ dependencies = [ "pallet-balances", "pallet-randomness-collective-flip", "pallet-timestamp", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -6119,13 +6118,13 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6136,13 +6135,13 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6154,10 +6153,10 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "jsonrpsee", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "serde", "sp-api", "sp-blockchain", @@ -6169,12 +6168,12 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-io", "sp-runtime", @@ -6184,12 +6183,12 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6201,7 +6200,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6210,7 +6209,7 @@ dependencies = [ "pallet-bags-list", "pallet-nomination-pools", "pallet-staking", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-runtime", "sp-staking", @@ -6220,9 +6219,9 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-api", "sp-std", ] @@ -6240,7 +6239,7 @@ dependencies = [ "pallet-evm", "pallet-evm-coder-substrate", "pallet-structure", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-runtime", @@ -6252,13 +6251,13 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-support", "frame-system", "log", "pallet-balances", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-runtime", @@ -6269,7 +6268,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6282,7 +6281,7 @@ dependencies = [ "pallet-offences", "pallet-session", "pallet-staking", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-runtime", "sp-staking", @@ -6292,12 +6291,12 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6308,12 +6307,12 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-io", "sp-runtime", @@ -6323,11 +6322,11 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "safe-mix", "scale-info", "sp-runtime", @@ -6337,12 +6336,12 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-io", "sp-runtime", @@ -6363,7 +6362,7 @@ dependencies = [ "pallet-evm", "pallet-evm-coder-substrate", "pallet-structure", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-runtime", @@ -6384,7 +6383,7 @@ dependencies = [ "pallet-evm", "pallet-nonfungible", "pallet-structure", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "rmrk-traits", "scale-info", "sp-core", @@ -6404,7 +6403,7 @@ dependencies = [ "pallet-evm", "pallet-nonfungible", "pallet-rmrk-core", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "rmrk-traits", "scale-info", "sp-core", @@ -6416,13 +6415,13 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-io", "sp-runtime", @@ -6432,14 +6431,14 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", "log", "pallet-timestamp", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6453,7 +6452,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", @@ -6469,11 +6468,11 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "rand_chacha 0.2.2", "scale-info", "sp-runtime", @@ -6483,7 +6482,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6492,7 +6491,7 @@ dependencies = [ "log", "pallet-authorship", "pallet-session", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "rand_chacha 0.2.2", "scale-info", "serde", @@ -6506,7 +6505,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6517,7 +6516,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "log", "sp-arithmetic", @@ -6532,7 +6531,7 @@ dependencies = [ "frame-system", "pallet-common", "pallet-evm", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-std", "up-data-structs", @@ -6541,11 +6540,11 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-io", "sp-runtime", @@ -6562,7 +6561,7 @@ dependencies = [ "frame-system", "pallet-balances", "pallet-transaction-payment", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -6575,13 +6574,13 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-inherents", "sp-io", @@ -6593,14 +6592,14 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", "pallet-treasury", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -6612,11 +6611,11 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -6628,11 +6627,11 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-api", "sp-blockchain", "sp-core", @@ -6643,10 +6642,10 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "pallet-transaction-payment", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-api", "sp-runtime", ] @@ -6654,14 +6653,14 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "impl-trait-for-tuples", "pallet-balances", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-runtime", @@ -6682,7 +6681,7 @@ dependencies = [ "pallet-evm-coder-substrate", "pallet-nonfungible", "pallet-refungible", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -6700,7 +6699,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -6714,12 +6713,12 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -6730,13 +6729,13 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-runtime", "sp-std", @@ -6750,7 +6749,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -6769,7 +6768,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-runtime", "sp-std", @@ -6785,16 +6784,16 @@ dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", ] [[package]] name = "parity-db" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb474d0ed0836e185cb998a6b140ed1073d1fbf27d690ecf9ede8030289382c" +checksum = "2c8fdb726a43661fa54b43e7114e6b88b2289cae388eb3ad766d9d1754d83fce" dependencies = [ "blake2-rfc", "crc32fast", @@ -6803,8 +6802,8 @@ dependencies = [ "libc", "log", "lz4", - "memmap2 0.2.3", - "parking_lot 0.11.2", + "memmap2", + "parking_lot 0.12.1", "rand 0.8.5", "snap", ] @@ -6825,9 +6824,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.1.5" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9182e4a71cae089267ab03e67c99368db7cd877baf50f931e5d6d4b71e195ac0" +checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" dependencies = [ "arrayvec 0.7.2", "bitvec 1.0.1", @@ -6968,9 +6967,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9423e2b32f7a043629287a536f21951e8c6a82482d0acb1eeebfc90bc2225b22" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" [[package]] name = "pbkdf2" @@ -6998,15 +6997,15 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.2.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69486e2b8c2d2aeb9762db7b4e00b0331156393555cff467f4163ff06821eef8" +checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" dependencies = [ "thiserror", "ucd-trie", @@ -7014,9 +7013,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.2.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b13570633aff33c6d22ce47dd566b10a3b9122c2fe9d8e7501895905be532b91" +checksum = "60b75706b9642ebcb34dab3bc7750f811609a0eb1dd8b88c2d15bf628c1c65b2" dependencies = [ "pest", "pest_generator", @@ -7024,9 +7023,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.2.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c567e5702efdc79fb18859ea74c3eb36e14c43da7b8c1f098a4ed6514ec7a0" +checksum = "f4f9272122f5979a6511a749af9db9bfc810393f63119970d7085fed1c4ea0db" dependencies = [ "pest", "pest_meta", @@ -7037,13 +7036,13 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.2.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eb32be5ee3bbdafa8c7a18b0a8a8d962b66cfa2ceee4037f49267a50ee821fe" +checksum = "4c8717927f9b79515e565a64fe46c38b8cd0427e64c40680b14a7365ab09ac8d" dependencies = [ "once_cell", "pest", - "sha-1 0.10.0", + "sha1", ] [[package]] @@ -7144,7 +7143,7 @@ dependencies = [ "fatality", "futures 0.3.24", "lru 0.7.8", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-erasure-coding", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -7166,7 +7165,7 @@ dependencies = [ "fatality", "futures 0.3.24", "lru 0.7.8", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-erasure-coding", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -7271,7 +7270,7 @@ name = "polkadot-core-primitives" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parity-util-mem", "scale-info", "sp-core", @@ -7288,7 +7287,7 @@ dependencies = [ "fatality", "futures 0.3.24", "lru 0.7.8", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-erasure-coding", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -7307,7 +7306,7 @@ name = "polkadot-erasure-coding" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-node-primitives", "polkadot-primitives", "reed-solomon-novelpoly", @@ -7346,7 +7345,7 @@ dependencies = [ "bytes", "fatality", "futures 0.3.24", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "polkadot-node-network-protocol", "polkadot-node-subsystem", @@ -7366,7 +7365,7 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "futures 0.3.24", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-erasure-coding", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7390,7 +7389,7 @@ dependencies = [ "kvdb", "lru 0.7.8", "merlin", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-node-jaeger", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7416,7 +7415,7 @@ dependencies = [ "futures 0.3.24", "futures-timer", "kvdb", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-erasure-coding", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7468,7 +7467,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#9407 dependencies = [ "async-trait", "futures 0.3.24", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-node-core-pvf", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7502,7 +7501,7 @@ dependencies = [ "futures 0.3.24", "futures-timer", "kvdb", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7520,7 +7519,7 @@ dependencies = [ "futures 0.3.24", "kvdb", "lru 0.7.8", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7576,7 +7575,7 @@ dependencies = [ "async-std", "futures 0.3.24", "futures-timer", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "pin-project", "polkadot-core-primitives", "polkadot-node-subsystem-util", @@ -7638,7 +7637,7 @@ dependencies = [ "lazy_static", "log", "mick-jaeger", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "polkadot-node-primitives", "polkadot-primitives", @@ -7656,7 +7655,7 @@ dependencies = [ "futures 0.3.24", "futures-timer", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-primitives", "prioritized-metered-channel", "sc-cli", @@ -7676,7 +7675,7 @@ dependencies = [ "fatality", "futures 0.3.24", "hex", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-node-jaeger", "polkadot-node-primitives", "polkadot-primitives", @@ -7695,7 +7694,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#9407 dependencies = [ "bounded-vec", "futures 0.3.24", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-parachain", "polkadot-primitives", "schnorrkel", @@ -7756,7 +7755,7 @@ dependencies = [ "kvdb", "lru 0.7.8", "parity-db", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parity-util-mem", "parking_lot 0.11.2", "pin-project", @@ -7806,7 +7805,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#9407 dependencies = [ "derive_more", "frame-support", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parity-util-mem", "polkadot-core-primitives", "scale-info", @@ -7839,7 +7838,7 @@ dependencies = [ "bitvec 1.0.1", "frame-system", "hex-literal", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parity-util-mem", "polkadot-core-primitives", "polkadot-parachain", @@ -7948,7 +7947,7 @@ dependencies = [ "pallet-utility", "pallet-vesting", "pallet-xcm", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-constants", @@ -8007,7 +8006,7 @@ dependencies = [ "pallet-transaction-payment", "pallet-treasury", "pallet-vesting", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-primitives", "polkadot-runtime-parachains", "rustc-hex", @@ -8046,7 +8045,7 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "bs58", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-primitives", "sp-std", "sp-tracing", @@ -8072,7 +8071,7 @@ dependencies = [ "pallet-staking", "pallet-timestamp", "pallet-vesting", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-primitives", "polkadot-runtime-metrics", "rand 0.8.5", @@ -8208,7 +8207,7 @@ dependencies = [ "fatality", "futures 0.3.24", "indexmap", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -8225,7 +8224,7 @@ name = "polkadot-statement-table" version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-primitives", "sp-core", ] @@ -8259,7 +8258,7 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "pallet-vesting", "pallet-xcm", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-parachain", "polkadot-primitives", "polkadot-runtime-common", @@ -8347,10 +8346,11 @@ dependencies = [ [[package]] name = "polling" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" +checksum = "899b00b9c8ab553c743b3e11e87c5c7d423b2a2de229ba95b24a756344748011" dependencies = [ + "autocfg", "cfg-if 1.0.0", "libc", "log", @@ -8453,18 +8453,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.43" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" dependencies = [ "unicode-ident", ] [[package]] name = "prometheus" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cface98dfa6d645ea4c789839f176e4b072265d085bfcc48eaa8d137f58d3c39" +checksum = "45c8babc29389186697fe5a2a4859d697825496b83db5d0b65271cdc0488e88c" dependencies = [ "cfg-if 1.0.0", "fnv", @@ -8567,9 +8567,9 @@ dependencies = [ [[package]] name = "psm" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f446d0a6efba22928558c4fb4ce0b3fd6c89b0061343e390bf01a703742b8125" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" dependencies = [ "cc", ] @@ -8638,7 +8638,7 @@ dependencies = [ "pallet-unique-scheduler", "pallet-xcm", "parachain-info", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-parachain", "rmrk-rpc", "scale-info", @@ -8727,7 +8727,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -8747,7 +8747,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -8761,9 +8761,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom 0.2.7", ] @@ -8802,7 +8802,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" dependencies = [ - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -8941,12 +8941,12 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "env_logger", "jsonrpsee", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "serde", "serde_json", "sp-core", @@ -9038,7 +9038,7 @@ dependencies = [ name = "rmrk-traits" version = "0.1.0" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", ] @@ -9091,7 +9091,7 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "pallet-utility", "pallet-xcm", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-parachain", "polkadot-primitives", "polkadot-runtime-common", @@ -9192,7 +9192,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.13", + "semver 1.0.14", ] [[package]] @@ -9211,13 +9211,13 @@ dependencies = [ [[package]] name = "rustix" -version = "0.35.7" +version = "0.35.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51cc38aa10f6bbb377ed28197aa052aa4e2b762c22be9d3153d01822587e787" +checksum = "fbb2fda4666def1433b1b05431ab402e42a1084285477222b72d6c564c417cef" dependencies = [ "bitflags", "errno", - "io-lifetimes 0.7.2", + "io-lifetimes 0.7.3", "libc", "linux-raw-sys 0.0.46", "windows-sys", @@ -9309,7 +9309,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "log", "sp-core", @@ -9320,7 +9320,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "futures 0.3.24", @@ -9328,7 +9328,7 @@ dependencies = [ "ip_network", "libp2p", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "prost", "prost-build", "rand 0.7.3", @@ -9347,12 +9347,12 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "futures 0.3.24", "futures-timer", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-block-builder", "sc-client-api", "sc-proposer-metrics", @@ -9370,9 +9370,9 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-client-api", "sp-api", "sp-block-builder", @@ -9386,11 +9386,11 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "impl-trait-for-tuples", - "memmap2 0.5.7", - "parity-scale-codec 3.1.5", + "memmap2", + "parity-scale-codec 3.2.1", "sc-chain-spec-derive", "sc-network-common", "sc-telemetry", @@ -9403,7 +9403,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9414,7 +9414,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "chrono", "clap", @@ -9424,7 +9424,7 @@ dependencies = [ "libp2p", "log", "names", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "rand 0.7.3", "regex", "rpassword", @@ -9453,13 +9453,13 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "fnv", "futures 0.3.24", "hash-db", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-executor", "sc-transaction-pool-api", @@ -9481,7 +9481,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "hash-db", "kvdb", @@ -9490,7 +9490,7 @@ dependencies = [ "linked-hash-map", "log", "parity-db", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-client-api", "sc-state-db", @@ -9506,7 +9506,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "futures 0.3.24", @@ -9530,12 +9530,12 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "futures 0.3.24", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-block-builder", "sc-client-api", "sc-consensus", @@ -9559,7 +9559,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "fork-tree", @@ -9569,7 +9569,7 @@ dependencies = [ "num-bigint", "num-rational 0.2.4", "num-traits", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "rand 0.7.3", "sc-client-api", @@ -9601,7 +9601,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "futures 0.3.24", "jsonrpsee", @@ -9623,10 +9623,10 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "fork-tree", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-client-api", "sc-consensus", "sp-blockchain", @@ -9636,14 +9636,14 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "assert_matches", "async-trait", "futures 0.3.24", "jsonrpsee", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-client-api", "sc-consensus", "sc-consensus-aura", @@ -9670,13 +9670,13 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "futures 0.3.24", "futures-timer", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-client-api", "sc-consensus", "sc-telemetry", @@ -9695,11 +9695,11 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "lazy_static", "lru 0.7.8", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-executor-common", "sc-executor-wasmi", @@ -9722,10 +9722,10 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "environmental", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-allocator", "sp-maybe-compressed-blob", "sp-sandbox", @@ -9738,10 +9738,10 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -9753,16 +9753,16 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "cfg-if 1.0.0", "libc", "log", "once_cell", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parity-wasm 0.42.2", "rustix 0.33.7", - "rustix 0.35.7", + "rustix 0.35.11", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -9774,7 +9774,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "ahash", "async-trait", @@ -9785,7 +9785,7 @@ dependencies = [ "futures-timer", "hex", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "rand 0.8.5", "sc-block-builder", @@ -9815,13 +9815,13 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "finality-grandpa", "futures 0.3.24", "jsonrpsee", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-client-api", "sc-finality-grandpa", "sc-rpc", @@ -9836,7 +9836,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "ansi_term", "futures 0.3.24", @@ -9853,7 +9853,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "hex", @@ -9868,7 +9868,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "asynchronous-codec", @@ -9887,7 +9887,7 @@ dependencies = [ "linked_hash_set", "log", "lru 0.7.8", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "pin-project", "prost", @@ -9917,14 +9917,14 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "bitflags", "bytes", "futures 0.3.24", "libp2p", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "prost-build", "sc-consensus", "sc-peerset", @@ -9940,7 +9940,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "ahash", "futures 0.3.24", @@ -9958,13 +9958,13 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "futures 0.3.24", "hex", "libp2p", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "prost", "prost-build", "sc-client-api", @@ -9979,7 +9979,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "fork-tree", "futures 0.3.24", @@ -9987,7 +9987,7 @@ dependencies = [ "libp2p", "log", "lru 0.7.8", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "prost", "prost-build", "sc-client-api", @@ -10007,7 +10007,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "bytes", "fnv", @@ -10019,7 +10019,7 @@ dependencies = [ "libp2p", "num_cpus", "once_cell", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "rand 0.7.3", "sc-client-api", @@ -10037,7 +10037,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "futures 0.3.24", "libp2p", @@ -10050,7 +10050,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -10059,13 +10059,13 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "futures 0.3.24", "hash-db", "jsonrpsee", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-block-builder", "sc-chain-spec", @@ -10089,12 +10089,12 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "futures 0.3.24", "jsonrpsee", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sc-chain-spec", "sc-transaction-pool-api", @@ -10112,7 +10112,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "futures 0.3.24", "jsonrpsee", @@ -10125,7 +10125,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "directories", @@ -10135,7 +10135,7 @@ dependencies = [ "hash-db", "jsonrpsee", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parity-util-mem", "parking_lot 0.12.1", "pin-project", @@ -10192,10 +10192,10 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parity-util-mem", "parity-util-mem-derive", "parking_lot 0.12.1", @@ -10206,10 +10206,10 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "jsonrpsee", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-chain-spec", "sc-client-api", "sc-consensus-babe", @@ -10225,7 +10225,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "futures 0.3.24", "libc", @@ -10244,7 +10244,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "chrono", "futures 0.3.24", @@ -10262,7 +10262,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "ansi_term", "atty", @@ -10293,7 +10293,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10304,13 +10304,13 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "futures 0.3.24", "futures-timer", "linked-hash-map", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parity-util-mem", "parking_lot 0.12.1", "sc-client-api", @@ -10330,7 +10330,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "futures 0.3.24", "log", @@ -10343,7 +10343,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "futures 0.3.24", "futures-timer", @@ -10355,23 +10355,23 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c46be926081c9f4dd5dd9b6f1d3e3229f2360bc6502dd8836f84a93b7c75e99a" +checksum = "333af15b02563b8182cd863f925bd31ef8fa86a0e095d30c091956057d436153" dependencies = [ "bitvec 1.0.1", "cfg-if 1.0.0", "derive_more", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info-derive", "serde", ] [[package]] name = "scale-info-derive" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e334bb10a245e28e5fd755cabcafd96cfcd167c99ae63a46924ca8d8703a3c" +checksum = "53f56acbd0743d29ffa08f911ab5397def774ad01bab3786804cf6ee057fb5e1" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10464,9 +10464,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" dependencies = [ "bitflags", "core-foundation", @@ -10505,9 +10505,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" dependencies = [ "serde", ] @@ -10572,14 +10572,14 @@ dependencies = [ ] [[package]] -name = "sha-1" -version = "0.10.0" +name = "sha1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.3", + "digest 0.10.5", ] [[package]] @@ -10609,13 +10609,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.3", + "digest 0.10.5", ] [[package]] @@ -10632,11 +10632,11 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.2" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a31480366ec990f395a61b7c08122d99bd40544fdb5abcfc1b06bb29994312c" +checksum = "e2904bea16a1ae962b483322a1c7b81d976029203aea1f461e51cd7705db7ba9" dependencies = [ - "digest 0.10.3", + "digest 0.10.5", "keccak", ] @@ -10681,7 +10681,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" dependencies = [ "digest 0.9.0", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -10717,7 +10717,7 @@ version = "0.9.29" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" dependencies = [ "enumn", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "paste", "sp-runtime", "sp-std", @@ -10734,9 +10734,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "snap" @@ -10754,18 +10754,18 @@ dependencies = [ "blake2", "chacha20poly1305", "curve25519-dalek 4.0.0-pre.1", - "rand_core 0.6.3", + "rand_core 0.6.4", "ring", "rustc_version 0.4.0", - "sha2 0.10.2", + "sha2 0.10.6", "subtle", ] [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi", @@ -10784,17 +10784,17 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "sha-1 0.9.8", + "sha-1", ] [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "hash-db", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-api-proc-macro", "sp-core", "sp-runtime", @@ -10808,7 +10808,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "blake2", "proc-macro-crate", @@ -10820,9 +10820,9 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-core", @@ -10833,11 +10833,11 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "integer-sqrt", "num-traits", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-debug-derive", @@ -10848,9 +10848,9 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-api", "sp-application-crypto", @@ -10861,10 +10861,10 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-inherents", "sp-runtime", "sp-std", @@ -10873,9 +10873,9 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-api", "sp-inherents", "sp-runtime", @@ -10885,12 +10885,12 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "futures 0.3.24", "log", "lru 0.7.8", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "sp-api", "sp-consensus", @@ -10903,13 +10903,13 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "futures 0.3.24", "futures-timer", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-core", "sp-inherents", "sp-runtime", @@ -10922,10 +10922,10 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-api", "sp-application-crypto", @@ -10940,11 +10940,11 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "merlin", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-api", @@ -10963,9 +10963,9 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-arithmetic", @@ -10977,9 +10977,9 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "schnorrkel", "sp-core", @@ -10990,7 +10990,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "base58", "bitflags", @@ -11008,7 +11008,7 @@ dependencies = [ "log", "merlin", "num-traits", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parity-util-mem", "parking_lot 0.12.1", "primitive-types", @@ -11036,13 +11036,13 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "blake2", "byteorder", - "digest 0.10.3", - "sha2 0.10.2", - "sha3 0.10.2", + "digest 0.10.5", + "sha2 0.10.6", + "sha3 0.10.5", "sp-std", "twox-hash", ] @@ -11050,7 +11050,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "proc-macro2", "quote", @@ -11061,7 +11061,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -11070,7 +11070,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "proc-macro2", "quote", @@ -11080,10 +11080,10 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "environmental", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-std", "sp-storage", ] @@ -11091,11 +11091,11 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "finality-grandpa", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-api", @@ -11109,11 +11109,11 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "impl-trait-for-tuples", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-core", "sp-runtime", "sp-std", @@ -11123,14 +11123,14 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "bytes", "futures 0.3.24", "hash-db", "libsecp256k1", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "secp256k1", "sp-core", @@ -11149,7 +11149,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "lazy_static", "sp-core", @@ -11160,12 +11160,12 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "futures 0.3.24", "merlin", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "schnorrkel", "serde", @@ -11177,7 +11177,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "thiserror", "zstd", @@ -11186,10 +11186,10 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "serde", "sp-api", "sp-core", @@ -11201,9 +11201,9 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "serde", "sp-arithmetic", @@ -11215,7 +11215,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "sp-api", "sp-core", @@ -11225,7 +11225,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "backtrace", "lazy_static", @@ -11235,7 +11235,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "rustc-hash", "serde", @@ -11245,13 +11245,13 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "either", "hash256-std-hasher", "impl-trait-for-tuples", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parity-util-mem", "paste", "rand 0.7.3", @@ -11267,11 +11267,11 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "bytes", "impl-trait-for-tuples", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "primitive-types", "sp-externalities", "sp-runtime-interface-proc-macro", @@ -11285,7 +11285,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "Inflector", "proc-macro-crate", @@ -11297,10 +11297,10 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-core", "sp-io", "sp-std", @@ -11311,9 +11311,9 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-api", "sp-core", @@ -11325,9 +11325,9 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-runtime", "sp-std", @@ -11336,12 +11336,12 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "hash-db", "log", "num-traits", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "rand 0.7.3", "smallvec", @@ -11358,15 +11358,15 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "impl-serde", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "ref-cast", "serde", "sp-debug-derive", @@ -11376,7 +11376,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "log", "sp-core", @@ -11389,12 +11389,12 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "futures-timer", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-api", "sp-inherents", "sp-runtime", @@ -11405,9 +11405,9 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-std", "tracing", "tracing-core", @@ -11417,7 +11417,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "sp-api", "sp-runtime", @@ -11426,11 +11426,11 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-inherents", @@ -11442,7 +11442,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "ahash", "hash-db", @@ -11451,7 +11451,7 @@ dependencies = [ "lru 0.7.8", "memory-db", "nohash-hasher", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "scale-info", "sp-core", @@ -11465,10 +11465,10 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "impl-serde", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parity-wasm 0.42.2", "scale-info", "serde", @@ -11482,9 +11482,9 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "proc-macro2", "quote", "syn", @@ -11493,11 +11493,11 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "impl-trait-for-tuples", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-std", "wasmi", "wasmtime", @@ -11511,9 +11511,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "ss58-registry" -version = "1.25.0" +version = "1.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a039906277e0d8db996cd9d1ef19278c10209d994ecfc1025ced16342873a17c" +checksum = "c2486f3d026e958566c6079caef44108cddf0ae6f8a411ef74fb08cdb56e614a" dependencies = [ "Inflector", "num-format", @@ -11626,7 +11626,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "platforms", ] @@ -11634,13 +11634,13 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.24", "jsonrpsee", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-client-api", "sc-rpc-api", "sc-transaction-pool-api", @@ -11655,7 +11655,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "futures-util", "hyper", @@ -11668,11 +11668,11 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "jsonrpsee", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-client-api", "sc-rpc-api", "scale-info", @@ -11689,12 +11689,12 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "async-trait", "futures 0.3.24", "hex", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sc-client-api", "sc-client-db", "sc-consensus", @@ -11715,7 +11715,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "futures 0.3.24", "substrate-test-utils-derive", @@ -11725,7 +11725,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11736,7 +11736,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "ansi_term", "build-helper", @@ -11758,9 +11758,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.99" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +checksum = "e90cde112c4b9690b8cbe810cba9ddd8bc1d7472e2cae317b69e9438c1cba7d2" dependencies = [ "proc-macro2", "quote", @@ -11867,7 +11867,7 @@ dependencies = [ "pallet-timestamp", "pallet-transaction-payment", "pallet-unique", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-core", "sp-io", @@ -11885,18 +11885,18 @@ checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" [[package]] name = "thiserror" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a99cb8c4b9a8ef0e7907cd3b617cc8dc04d571c4e73c8ae403d80ac160bb122" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a891860d3c8d66fec8e73ddb3765f90082374dbaaa833407b904a94f1a7eb43" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ "proc-macro2", "quote", @@ -12025,9 +12025,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.21.1" +version = "1.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0020c875007ad96677dcc890298f4b942882c5d4eb7cc8f439fc3bf813dc9c95" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" dependencies = [ "autocfg", "bytes", @@ -12035,7 +12035,6 @@ dependencies = [ "memchr", "mio", "num_cpus", - "once_cell", "parking_lot 0.12.1", "pin-project-lite 0.2.9", "signal-hook-registry", @@ -12068,9 +12067,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" +checksum = "f6edf2d6bc038a43d31353570e27270603f4648d18f5ed10c0e179abe43255af" dependencies = [ "futures-core", "pin-project-lite 0.2.9", @@ -12079,9 +12078,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" dependencies = [ "bytes", "futures-core", @@ -12262,7 +12261,7 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna", + "idna 0.2.3", "ipnet", "lazy_static", "log", @@ -12301,13 +12300,13 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#7c4ac358c29c9748c6e8ed4e05910504cd01a3b9" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" dependencies = [ "clap", "frame-try-runtime", "jsonrpsee", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "remote-externalities", "sc-chain-spec", "sc-cli", @@ -12337,7 +12336,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if 1.0.0", - "digest 0.10.3", + "digest 0.10.5", "rand 0.8.5", "static_assertions", ] @@ -12357,7 +12356,7 @@ dependencies = [ "jsonrpsee", "pallet-common", "pallet-evm", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "rmrk-rpc", "sp-api", "sp-blockchain", @@ -12370,15 +12369,15 @@ dependencies = [ [[package]] name = "ucd-trie" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89570599c4fe5585de2b388aab47e99f7fa4e9238a1399f707a02e356058141c" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "uint" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" +checksum = "a45526d29728d135c2900b0d30573fe3ee79fceb12ef534c7bb30e810a91b601" dependencies = [ "byteorder", "crunchy", @@ -12403,30 +12402,30 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" +checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unicode-xid" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unique-node" @@ -12461,7 +12460,7 @@ dependencies = [ "pallet-ethereum", "pallet-transaction-payment-rpc", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "polkadot-cli", "polkadot-parachain", @@ -12631,7 +12630,7 @@ dependencies = [ "pallet-unique-scheduler", "pallet-xcm", "parachain-info", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-parachain", "rmrk-rpc", "scale-info", @@ -12710,7 +12709,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-evm", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "rmrk-traits", "scale-info", "serde", @@ -12726,7 +12725,7 @@ version = "0.1.3" dependencies = [ "pallet-common", "pallet-evm", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-api", "sp-core", "sp-runtime", @@ -12744,13 +12743,12 @@ dependencies = [ [[package]] name = "url" -version = "2.2.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", - "idna", - "matches", + "idna 0.3.0", "percent-encoding", ] @@ -12835,9 +12833,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -12845,9 +12843,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" dependencies = [ "bumpalo", "log", @@ -12860,9 +12858,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.32" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -12872,9 +12870,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -12882,9 +12880,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", @@ -12895,9 +12893,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "wasm-gc-api" @@ -13138,9 +13136,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.59" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" dependencies = [ "js-sys", "wasm-bindgen", @@ -13158,9 +13156,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.4" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1c760f0d366a6c24a02ed7816e23e691f5d92291f94d15e836006fd11b04daf" +checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" dependencies = [ "webpki", ] @@ -13230,7 +13228,7 @@ dependencies = [ "pallet-vesting", "pallet-xcm", "pallet-xcm-benchmarks", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-parachain", "polkadot-primitives", "polkadot-runtime-common", @@ -13277,13 +13275,13 @@ dependencies = [ [[package]] name = "which" -version = "4.2.5" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" +checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" dependencies = [ "either", - "lazy_static", "libc", + "once_cell", ] [[package]] @@ -13452,7 +13450,7 @@ dependencies = [ "derivative", "impl-trait-for-tuples", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "scale-info", "sp-runtime", "xcm-procedural", @@ -13467,7 +13465,7 @@ dependencies = [ "frame-system", "log", "pallet-transaction-payment", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "polkadot-parachain", "scale-info", "sp-arithmetic", @@ -13487,7 +13485,7 @@ dependencies = [ "frame-support", "impl-trait-for-tuples", "log", - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", "sp-arithmetic", "sp-core", "sp-io", diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index e1be279cfb..d071affdb8 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -19,4 +19,4 @@ sp-blockchain = { default-features = false, git = "https://github.com/paritytech sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 306892cb35..a227a4a016 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -309,13 +309,13 @@ clap = "3.1.2" jsonrpsee = { version = "0.15.1", features = ["server", "macros"] } tokio = { version = "1.19.2", features = ["time"] } -fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } unique-rpc = { default-features = false, path = "../rpc" } app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index f75b73429a..c6fa1b7fbb 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -40,13 +40,13 @@ sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } tokio = { version = "1.19.2", features = ["macros", "sync"] } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } pallet-common = { default-features = false, path = "../../pallets/common" } up-common = { path = "../../primitives/common" } diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index 006e7ab654..13755473da 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -52,7 +52,7 @@ frame-system ={ default-features = false, git = "https://github.com/paritytech/s pallet-balances ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } pallet-timestamp ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } pallet-randomness-collective-flip ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm ={ default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm ={ default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } sp-std ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index 638316c155..6da10bf354 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -17,12 +17,12 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } ethereum = { version = "0.12.0", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } serde = { version = "1.0.130", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/configuration/Cargo.toml b/pallets/configuration/Cargo.toml index eccd24542a..6109e59c3d 100644 --- a/pallets/configuration/Cargo.toml +++ b/pallets/configuration/Cargo.toml @@ -16,7 +16,7 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } smallvec = "1.6.1" [features] diff --git a/pallets/evm-coder-substrate/Cargo.toml b/pallets/evm-coder-substrate/Cargo.toml index 806f69a010..f6d8f6d952 100644 --- a/pallets/evm-coder-substrate/Cargo.toml +++ b/pallets/evm-coder-substrate/Cargo.toml @@ -12,8 +12,8 @@ sp-std = { default-features = false, git = "https://github.com/paritytech/substr sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } ethereum = { version = "0.12.0", default-features = false } evm-coder = { default-features = false, path = "../../crates/evm-coder" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index c2490fdd11..6e11adfcab 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -19,8 +19,8 @@ sp-std = { default-features = false, git = "https://github.com/paritytech/substr sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } # Unique -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29" } # Locals diff --git a/pallets/evm-migration/Cargo.toml b/pallets/evm-migration/Cargo.toml index 4a7f53e1b6..d6d360ecb4 100644 --- a/pallets/evm-migration/Cargo.toml +++ b/pallets/evm-migration/Cargo.toml @@ -15,8 +15,8 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } [dependencies.codec] default-features = false diff --git a/pallets/evm-transaction-payment/Cargo.toml b/pallets/evm-transaction-payment/Cargo.toml index afa9019792..ad6909f614 100644 --- a/pallets/evm-transaction-payment/Cargo.toml +++ b/pallets/evm-transaction-payment/Cargo.toml @@ -14,11 +14,11 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } [dependencies.codec] default-features = false diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index b2bbb198f6..cdc98eef75 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -23,7 +23,7 @@ evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' } ethereum = { version = "0.12.0", default-features = false } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index 71a07e34a4..4fbd160584 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -16,7 +16,7 @@ frame-system = { default-features = false, git = "https://github.com/paritytech/ sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } diff --git a/pallets/proxy-rmrk-core/Cargo.toml b/pallets/proxy-rmrk-core/Cargo.toml index 1491b8ecb5..80055f24f6 100644 --- a/pallets/proxy-rmrk-core/Cargo.toml +++ b/pallets/proxy-rmrk-core/Cargo.toml @@ -20,7 +20,7 @@ pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } pallet-structure = { default-features = false, path = "../../pallets/structure" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/proxy-rmrk-equip/Cargo.toml b/pallets/proxy-rmrk-equip/Cargo.toml index 8f7bde625d..65c0a90a5e 100644 --- a/pallets/proxy-rmrk-equip/Cargo.toml +++ b/pallets/proxy-rmrk-equip/Cargo.toml @@ -19,7 +19,7 @@ sp-core = { default-features = false, git = "https://github.com/paritytech/subst pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index be811ec943..dd42107755 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -16,7 +16,7 @@ frame-system = { default-features = false, git = "https://github.com/paritytech/ sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } pallet-common = { default-features = false, path = '../common' } diff --git a/pallets/structure/Cargo.toml b/pallets/structure/Cargo.toml index 860b9f68a0..2a6ee62ac9 100644 --- a/pallets/structure/Cargo.toml +++ b/pallets/structure/Cargo.toml @@ -16,7 +16,7 @@ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } up-data-structs = { path = "../../primitives/data-structs", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } [features] default = ["std"] diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index d0cf366c8a..73d363de75 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -98,7 +98,7 @@ up-data-structs = { default-features = false, path = "../../primitives/data-stru scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } pallet-common = { default-features = false, path = "../common" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } diff --git a/primitives/app_promotion_rpc/Cargo.toml b/primitives/app_promotion_rpc/Cargo.toml index 7bcb59e7f3..32ff478fe6 100644 --- a/primitives/app_promotion_rpc/Cargo.toml +++ b/primitives/app_promotion_rpc/Cargo.toml @@ -14,7 +14,7 @@ sp-core = { default-features = false, git = "https://github.com/paritytech/subst sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } [features] default = ["std"] diff --git a/primitives/common/Cargo.toml b/primitives/common/Cargo.toml index aa2f70c459..96c13d54fc 100644 --- a/primitives/common/Cargo.toml +++ b/primitives/common/Cargo.toml @@ -48,9 +48,9 @@ branch = "polkadot-v0.9.29" [dependencies.fp-rpc] default-features = false git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.29-fee-limit" +branch = "unique-polkadot-v0.9.29" [dependencies.pallet-evm] default-features = false git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.29-fee-limit" +branch = "unique-polkadot-v0.9.29" diff --git a/primitives/data-structs/Cargo.toml b/primitives/data-structs/Cargo.toml index 6034a72781..07310329ac 100644 --- a/primitives/data-structs/Cargo.toml +++ b/primitives/data-structs/Cargo.toml @@ -25,7 +25,7 @@ sp-std = { default-features = false, git = "https://github.com/paritytech/substr sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } derivative = { version = "2.2.0", features = ["use_core"] } struct-versioning = { path = "../../crates/struct-versioning" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } rmrk-traits = { default-features = false, path = "../rmrk-traits" } bondrewd = { version = "0.1.14", features = ["derive"], default-features = false } diff --git a/primitives/rpc/Cargo.toml b/primitives/rpc/Cargo.toml index 3d8b8464ef..3a230c0ceb 100644 --- a/primitives/rpc/Cargo.toml +++ b/primitives/rpc/Cargo.toml @@ -14,7 +14,7 @@ sp-core = { default-features = false, git = "https://github.com/paritytech/subst sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } [features] default = ["std"] diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 2ebcb7fbf6..fe9dbda20e 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -441,7 +441,7 @@ pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } @@ -460,11 +460,11 @@ pallet-evm-migration = { path = '../../pallets/evm-migration', default-features pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.29' } pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" } diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 65a416ddcb..68f9c2b2af 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -446,7 +446,7 @@ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } @@ -465,11 +465,11 @@ pallet-evm-migration = { path = '../../pallets/evm-migration', default-features pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.29' } pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" } diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index 5833e7e3ae..27319c64fc 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -16,7 +16,7 @@ sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } @@ -25,8 +25,8 @@ pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "p pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } pallet-common = { path = '../../pallets/common' } pallet-structure = { path = '../../pallets/structure' } diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index ce85fe73d2..5f25c10c1a 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -456,12 +456,12 @@ pallet-evm-migration = { path = '../../pallets/evm-migration', default-features pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29-fee-limit" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.29' } pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" } From 29dbca81ac00113af5e60c11f98734fa50c7e8a6 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 3 Oct 2022 12:09:02 +0000 Subject: [PATCH 1011/1274] fix: cargo fmt --- pallets/common/src/benchmarking.rs | 4 +++- pallets/nonfungible/src/benchmarking.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pallets/common/src/benchmarking.rs b/pallets/common/src/benchmarking.rs index 122b6b715c..6dd8994fae 100644 --- a/pallets/common/src/benchmarking.rs +++ b/pallets/common/src/benchmarking.rs @@ -116,7 +116,9 @@ fn create_collection( create_collection_raw( owner, CollectionMode::NFT, - |owner: T::CrossAccountId, data| >::init_collection(owner.clone(), owner, data, CollectionFlags::default()), + |owner: T::CrossAccountId, data| { + >::init_collection(owner.clone(), owner, data, CollectionFlags::default()) + }, |h| h, ) } diff --git a/pallets/nonfungible/src/benchmarking.rs b/pallets/nonfungible/src/benchmarking.rs index 82ec42006d..6940f1a36e 100644 --- a/pallets/nonfungible/src/benchmarking.rs +++ b/pallets/nonfungible/src/benchmarking.rs @@ -54,7 +54,9 @@ fn create_collection( create_collection_raw( owner, CollectionMode::NFT, - |owner: T::CrossAccountId, data| >::init_collection(owner.clone(), owner, data, true), + |owner: T::CrossAccountId, data| { + >::init_collection(owner.clone(), owner, data, true) + }, NonfungibleHandle::cast, ) } From 9affb1b2e0f99829b2f224416d38047b3545b9fa Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 3 Oct 2022 12:26:14 +0000 Subject: [PATCH 1012/1274] fix: quartz mainnet tag - add missing feature --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 506d0da420..351f7be451 100644 --- a/.env +++ b/.env @@ -5,7 +5,7 @@ POLKADOT_MAINNET_BRANCH=release-v0.9.26 UNIQUE_MAINNET_TAG=v924010 KUSAMA_MAINNET_BRANCH=release-v0.9.26 -QUARTZ_MAINNET_TAG=quartz-v924012-2 +QUARTZ_MAINNET_TAG=quartz-v924012-2-opal-runtime-feature UNQWND_MAINNET_BRANCH=release-v0.9.24 From e9e910f902c3024b16fb282d77b889fc480aef7a Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 3 Oct 2022 14:31:07 +0000 Subject: [PATCH 1013/1274] Revert "fix: quartz mainnet tag - add missing feature" This reverts commit 619c3a54d9cf6e33f2a3d81e3737ecba878aba60. --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 351f7be451..506d0da420 100644 --- a/.env +++ b/.env @@ -5,7 +5,7 @@ POLKADOT_MAINNET_BRANCH=release-v0.9.26 UNIQUE_MAINNET_TAG=v924010 KUSAMA_MAINNET_BRANCH=release-v0.9.26 -QUARTZ_MAINNET_TAG=quartz-v924012-2-opal-runtime-feature +QUARTZ_MAINNET_TAG=quartz-v924012-2 UNQWND_MAINNET_BRANCH=release-v0.9.24 From 55c7c972e8a3b9f74c7992ffd381d78ba56e22d4 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Tue, 4 Oct 2022 08:55:43 +0000 Subject: [PATCH 1014/1274] Fix after review Accounts moved inside describe Rename: token.isExist -> token.doesExist --- tests/src/burnItem.test.ts | 21 +++++++++++++++------ tests/src/fungible.test.ts | 8 ++++---- tests/src/refungible.test.ts | 16 ++++++++-------- tests/src/util/playgrounds/unique.ts | 12 ++++++------ 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/tests/src/burnItem.test.ts b/tests/src/burnItem.test.ts index 18b8e5ef30..ddd782f8fc 100644 --- a/tests/src/burnItem.test.ts +++ b/tests/src/burnItem.test.ts @@ -17,11 +17,12 @@ import {IKeyringPair} from '@polkadot/types/types'; import {expect, itSub, Pallets, usingPlaygrounds} from './util/playgrounds'; -let donor: IKeyringPair; -let alice: IKeyringPair; -let bob: IKeyringPair; describe('integration test: ext. burnItem():', () => { + let donor: IKeyringPair; + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { await usingPlaygrounds(async (helper, privateKey) => { donor = privateKey('//Alice'); @@ -34,7 +35,7 @@ describe('integration test: ext. burnItem():', () => { const token = await collection.mintToken(alice); await token.burn(alice); - expect(await token.isExist()).to.be.false; + expect(await token.doesExist()).to.be.false; }); itSub('Burn item in Fungible collection', async ({helper}) => { @@ -73,6 +74,10 @@ describe('integration test: ext. burnItem():', () => { }); describe('integration test: ext. burnItem() with admin permissions:', () => { + let donor: IKeyringPair; + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { await usingPlaygrounds(async (helper, privateKey) => { donor = privateKey('//Alice'); @@ -87,7 +92,7 @@ describe('integration test: ext. burnItem() with admin permissions:', () => { const token = await collection.mintToken(alice); await token.burnFrom(bob, {Substrate: alice.address}); - expect(await token.isExist()).to.be.false; + expect(await token.doesExist()).to.be.false; }); itSub('Burn item in Fungible collection', async ({helper}) => { @@ -107,11 +112,15 @@ describe('integration test: ext. burnItem() with admin permissions:', () => { const token = await collection.mintToken(alice, 100n); await token.burnFrom(bob, {Substrate: alice.address}, 100n); - expect(await token.isExist()).to.be.false; + expect(await token.doesExist()).to.be.false; }); }); describe('Negative integration test: ext. burnItem():', () => { + let donor: IKeyringPair; + let alice: IKeyringPair; + let bob: IKeyringPair; + before(async () => { await usingPlaygrounds(async (helper, privateKey) => { donor = privateKey('//Alice'); diff --git a/tests/src/fungible.test.ts b/tests/src/fungible.test.ts index 5fdf0ecd4d..41543b8e2a 100644 --- a/tests/src/fungible.test.ts +++ b/tests/src/fungible.test.ts @@ -101,10 +101,10 @@ describe('integration test: Fungible functionality:', () => { const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); await collection.mint(alice, 500n); - expect(await collection.isTokenExists(0)).to.be.true; + expect(await collection.doesTokenExist(0)).to.be.true; expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(500n); expect(await collection.burnTokens(alice, 499n)).to.be.true; - expect(await collection.isTokenExists(0)).to.be.true; + expect(await collection.doesTokenExist(0)).to.be.true; expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(1n); }); @@ -112,9 +112,9 @@ describe('integration test: Fungible functionality:', () => { const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); await collection.mint(alice, 500n); - expect(await collection.isTokenExists(0)).to.be.true; + expect(await collection.doesTokenExist(0)).to.be.true; expect(await collection.burnTokens(alice, 500n)).to.be.true; - expect(await collection.isTokenExists(0)).to.be.true; + expect(await collection.doesTokenExist(0)).to.be.true; expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(0n); expect(await collection.getTotalPieces()).to.be.equal(0n); diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index b52ae0ffcc..e68eb4a34a 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -122,10 +122,10 @@ describe('integration test: Refungible functionality:', async () => { itSub('Burn some pieces', async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); const token = await collection.mintToken(alice, 100n); - expect(await collection.isTokenExists(token.tokenId)).to.be.true; + expect(await collection.doesTokenExist(token.tokenId)).to.be.true; expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); expect(await token.burn(alice, 99n)).to.be.true; - expect(await collection.isTokenExists(token.tokenId)).to.be.true; + expect(await collection.doesTokenExist(token.tokenId)).to.be.true; expect(await token.getBalance({Substrate: alice.address})).to.be.equal(1n); }); @@ -133,18 +133,18 @@ describe('integration test: Refungible functionality:', async () => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); const token = await collection.mintToken(alice, 100n); - expect(await collection.isTokenExists(token.tokenId)).to.be.true; + expect(await collection.doesTokenExist(token.tokenId)).to.be.true; expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); expect(await token.burn(alice, 100n)).to.be.true; - expect(await collection.isTokenExists(token.tokenId)).to.be.false; + expect(await collection.doesTokenExist(token.tokenId)).to.be.false; }); itSub('Burn some pieces for multiple users', async ({helper}) => { const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); const token = await collection.mintToken(alice, 100n); - expect(await collection.isTokenExists(token.tokenId)).to.be.true; + expect(await collection.doesTokenExist(token.tokenId)).to.be.true; expect(await token.getBalance({Substrate: alice.address})).to.be.equal(100n); expect(await token.transfer(alice, {Substrate: bob.address}, 60n)).to.be.true; @@ -154,17 +154,17 @@ describe('integration test: Refungible functionality:', async () => { expect(await token.burn(alice, 40n)).to.be.true; - expect(await collection.isTokenExists(token.tokenId)).to.be.true; + expect(await collection.doesTokenExist(token.tokenId)).to.be.true; expect(await token.getBalance({Substrate: alice.address})).to.be.equal(0n); expect(await token.burn(bob, 59n)).to.be.true; expect(await token.getBalance({Substrate: bob.address})).to.be.equal(1n); - expect(await collection.isTokenExists(token.tokenId)).to.be.true; + expect(await collection.doesTokenExist(token.tokenId)).to.be.true; expect(await token.burn(bob, 1n)).to.be.true; - expect(await collection.isTokenExists(token.tokenId)).to.be.false; + expect(await collection.doesTokenExist(token.tokenId)).to.be.false; }); itSub('Set allowance for token', async ({helper}) => { diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 8c2e3c7fa3..e33d2c0ad5 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -1114,10 +1114,10 @@ class CollectionGroup extends HelperGroup { * * @param collectionId ID of collection * @param tokenId ID of token - * @example isTokenExists(10, 20); + * @example doesTokenExist(10, 20); * @returns true if the token exists, otherwise false */ - async isTokenExists(collectionId: number, tokenId: number): Promise { + async doesTokenExist(collectionId: number, tokenId: number): Promise { return (await this.helper.callRpc('api.rpc.unique.tokenExists', [collectionId, tokenId])).toJSON(); } } @@ -2277,8 +2277,8 @@ export class UniqueBaseCollection { return await this.helper.collection.getLastTokenId(this.collectionId); } - async isTokenExists(tokenId: number) { - return await this.helper.collection.isTokenExists(this.collectionId, tokenId); + async doesTokenExist(tokenId: number) { + return await this.helper.collection.doesTokenExist(this.collectionId, tokenId); } async getAdmins() { @@ -2607,8 +2607,8 @@ export class UniqueBaseToken { return await this.collection.deleteTokenProperties(signer, this.tokenId, propertyKeys); } - async isExist() { - return await this.collection.isTokenExists(this.tokenId); + async doesExist() { + return await this.collection.doesTokenExist(this.tokenId); } nestingAccount() { From 452938b6367f2fba0cafa1277c64438af5fa2d67 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Tue, 4 Oct 2022 09:14:02 +0000 Subject: [PATCH 1015/1274] Fix eslint --- tests/src/eth/fractionalizer/fractionalizer.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index 612aa1971a..033431af9f 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -40,13 +40,13 @@ const compileContract = async (helper: EthUniqueHelper): Promise => { const compiled = await compileContract(helper); return await helper.ethContract.deployByAbi(owner, compiled.abi, compiled.object); -} +}; const initContract = async (helper: EthUniqueHelper, owner: string): Promise<{contract: Contract, rftCollectionAddress: string}> => { @@ -57,7 +57,7 @@ const initContract = async (helper: EthUniqueHelper, owner: string): Promise<{co const result = await fractionalizer.methods.createAndSetRFTCollection('A', 'B', 'C').send({value: Number(2n * helper.balance.getOneTokenNominal())}); const rftCollectionAddress = result.events.RFTCollectionSet.returnValues._collection; return {contract: fractionalizer, rftCollectionAddress}; -} +}; const mintRFTToken = async (helper: EthUniqueHelper, owner: string, fractionalizer: Contract, amount: bigint): Promise<{ nftCollectionAddress: string, nftTokenId: number, rftTokenAddress: string @@ -76,7 +76,7 @@ const mintRFTToken = async (helper: EthUniqueHelper, owner: string, fractionaliz nftTokenId: _tokenId, rftTokenAddress: _rftToken, }; -} +}; describe('Fractionalizer contract usage', () => { From 7ec038f8d19288ae0e2beb6a4c3d40b68da38151 Mon Sep 17 00:00:00 2001 From: rkv Date: Tue, 4 Oct 2022 12:36:00 +0300 Subject: [PATCH 1016/1274] fix: skip tests that use substrate addresses --- tests/src/eth/collectionAdmin.test.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index 1a1537e166..b0fc098bd1 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -42,7 +42,7 @@ describe('Add collection admins', () => { .to.be.eq(newAdmin.toLocaleLowerCase()); }); - itEth('Add substrate admin by owner', async ({helper}) => { + itEth.skip('Add substrate admin by owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); @@ -100,7 +100,7 @@ describe('Add collection admins', () => { expect(adminList.length).to.be.eq(0); }); - itEth('(!negative tests!) Add substrate admin by ADMIN is not allowed', async ({helper}) => { + itEth.skip('(!negative tests!) Add substrate admin by ADMIN is not allowed', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); @@ -118,7 +118,7 @@ describe('Add collection admins', () => { .to.be.eq(admin.toLocaleLowerCase()); }); - itEth('(!negative tests!) Add substrate admin by USER is not allowed', async ({helper}) => { + itEth.skip('(!negative tests!) Add substrate admin by USER is not allowed', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); @@ -162,7 +162,7 @@ describe('Remove collection admins', () => { expect(adminList.length).to.be.eq(0); }); - itEth('Remove substrate admin by owner', async ({helper}) => { + itEth.skip('Remove substrate admin by owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); @@ -222,7 +222,7 @@ describe('Remove collection admins', () => { } }); - itEth('(!negative tests!) Remove substrate admin by ADMIN is not allowed', async ({helper}) => { + itEth.skip('(!negative tests!) Remove substrate admin by ADMIN is not allowed', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); @@ -242,7 +242,7 @@ describe('Remove collection admins', () => { .to.be.deep.contains(adminEth.toLocaleLowerCase()); }); - itEth('(!negative tests!) Remove substrate admin by USER is not allowed', async ({helper}) => { + itEth.skip('(!negative tests!) Remove substrate admin by USER is not allowed', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); @@ -315,7 +315,7 @@ describe('Change substrate owner tests', () => { }); //FIXME - itEth('Change owner', async ({helper}) => { + itEth.skip('Change owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const [newOwner] = await helper.arrange.createAccounts([10n], donor); const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); @@ -330,7 +330,7 @@ describe('Change substrate owner tests', () => { expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.true; }); - itEth('change owner call fee', async ({helper}) => { + itEth.skip('change owner call fee', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const [newOwner] = await helper.arrange.createAccounts([10n], donor); const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); @@ -342,7 +342,7 @@ describe('Change substrate owner tests', () => { }); //FIXME - itEth('(!negative tests!) call setOwner by non owner', async ({helper}) => { + itEth.skip('(!negative tests!) call setOwner by non owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const otherReceiver = await helper.eth.createAccountWithBalance(donor); const [newOwner] = await helper.arrange.createAccounts([10n], donor); From d8f70cf89830df7f6241f1566a2aa85fa556aa11 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 4 Oct 2022 12:50:39 +0300 Subject: [PATCH 1017/1274] fix: toolchain version in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8034ea29bd..c81d977271 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ curl https://sh.rustup.rs -sSf | sh 2. Remove all installed toolchains with `rustup toolchain list` and `rustup toolchain uninstall `. -3. Install toolchain nightly-2022-05-11 and make it default: +3. Install toolchain nightly-2022-07-24 and make it default: ```bash rustup toolchain install nightly-2022-07-24 From 174392d0d0f6ee104dc46bc2eb39767aea671483 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 4 Oct 2022 12:16:35 +0300 Subject: [PATCH 1018/1274] disable checkout to an old branch for old tests --- .github/workflows/node-only-update_v2.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 5c46d0641f..a442abf6c7 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -156,21 +156,14 @@ jobs: exit 0 shell: bash - - name: Checkout at '${{ matrix.mainnet_branch }}' branch - uses: actions/checkout@master - with: - ref: ${{ matrix.mainnet_branch }} #Checking out head commit - path: ${{ matrix.mainnet_branch }} - - - name: Run tests before Node Parachain upgrade - working-directory: ${{ matrix.mainnet_branch }}/tests + working-directory: tests run: | yarn install yarn add mochawesome echo "Ready to start tests" yarn polkadot-types - NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} + NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-before-${NOW} env: RPC_URL: http://127.0.0.1:9933/ @@ -180,7 +173,7 @@ jobs: if: success() || failure() # run this step even if previous step failed with: name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created - path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-*.json # Path to test results + path: tests/mochawesome-report/test-before-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' @@ -247,7 +240,7 @@ jobs: node scripts/readyness.js echo "Ready to start tests" yarn polkadot-types - NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} + NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-after-${NOW} env: RPC_URL: http://127.0.0.1:9933/ @@ -257,7 +250,7 @@ jobs: if: success() || failure() # run this step even if previous step failed with: name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created - path: tests/mochawesome-report/test-*.json # Path to test results + path: tests/mochawesome-report/test-after-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' From 801b59758b03dc8c3f91470b0a6333e829bde5f2 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 19 Sep 2022 12:37:41 +0000 Subject: [PATCH 1019/1274] feat: disable scheduler in opal --- runtime/common/construct_runtime/mod.rs | 4 ++-- runtime/common/mod.rs | 3 +++ runtime/opal/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/runtime/common/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs index 64295c3c76..ea7c14a41c 100644 --- a/runtime/common/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -57,8 +57,8 @@ macro_rules! construct_runtime { Inflation: pallet_inflation::{Pallet, Call, Storage} = 60, Unique: pallet_unique::{Pallet, Call, Storage, Event} = 61, - #[runtimes(opal)] - Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event} = 62, + // #[runtimes(opal)] + // Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event} = 62, Configuration: pallet_configuration::{Pallet, Call, Storage} = 63, diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index 0ddf76175f..7021ae2276 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -20,7 +20,10 @@ pub mod dispatch; pub mod ethereum; pub mod instance; pub mod runtime_apis; + +#[cfg(feature = "scheduler")] pub mod scheduler; + pub mod sponsoring; pub mod weights; diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index fe9dbda20e..38c009a762 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -130,7 +130,7 @@ std = [ "pallet-foreign-assets/std" ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] -opal-runtime = ['refungible', 'scheduler', 'rmrk', 'app-promotion', 'foreign-assets'] +opal-runtime = ['refungible', 'rmrk', 'app-promotion', 'foreign-assets'] refungible = [] scheduler = [] From c57a8f4afb66ed4087c31bc1bc3d15e460eb9614 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 3 Oct 2022 14:32:52 +0000 Subject: [PATCH 1020/1274] fix: quartz mainnet tag - add missing feature --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 506d0da420..351f7be451 100644 --- a/.env +++ b/.env @@ -5,7 +5,7 @@ POLKADOT_MAINNET_BRANCH=release-v0.9.26 UNIQUE_MAINNET_TAG=v924010 KUSAMA_MAINNET_BRANCH=release-v0.9.26 -QUARTZ_MAINNET_TAG=quartz-v924012-2 +QUARTZ_MAINNET_TAG=quartz-v924012-2-opal-runtime-feature UNQWND_MAINNET_BRANCH=release-v0.9.24 From da2d6006e0d913057d658cb9b1cfe41bc340e722 Mon Sep 17 00:00:00 2001 From: rkv Date: Tue, 4 Oct 2022 14:16:39 +0300 Subject: [PATCH 1021/1274] fix: check-event tests migrated --- tests/src/check-event/burnItemEvent.test.ts | 8 +++----- .../check-event/createCollectionEvent.test.ts | 9 +++------ tests/src/check-event/createItemEvent.test.ts | 8 +++----- .../check-event/createMultipleItemsEvent.test.ts | 16 +++++++++------- .../check-event/destroyCollectionEvent.test.ts | 10 ++++------ tests/src/check-event/transferEvent.test.ts | 10 ++++------ tests/src/check-event/transferFromEvent.test.ts | 10 ++++------ 7 files changed, 30 insertions(+), 41 deletions(-) diff --git a/tests/src/check-event/burnItemEvent.test.ts b/tests/src/check-event/burnItemEvent.test.ts index 2db596a43b..c5e48a23f8 100644 --- a/tests/src/check-event/burnItemEvent.test.ts +++ b/tests/src/check-event/burnItemEvent.test.ts @@ -16,8 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {executeTransaction} from '../substrate/substrate-api'; -import {uniqueEventMessage} from '../util/helpers'; +import {getEventMessage} from '../util/helpers'; import {usingPlaygrounds, expect, itSub} from '../util/playgrounds'; @@ -35,10 +34,9 @@ describe('Burn Item event ', () => { itSub('Check event from burnItem(): ', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); const token = await collection.mintToken(alice, {Substrate: alice.address}); + await token.burn(alice); - const tx = helper.api!.tx.unique.burnItem(collection.collectionId, token.tokenId, 1); - const events = await executeTransaction(helper.api!, alice, tx); - const msg = JSON.stringify(uniqueEventMessage(events)); + const msg = JSON.stringify(getEventMessage(helper.chainLog[helper.chainLog.length - 1].events)); expect(msg).to.be.contain(checkSection); expect(msg).to.be.contain(checkTreasury); expect(msg).to.be.contain(checkSystem); diff --git a/tests/src/check-event/createCollectionEvent.test.ts b/tests/src/check-event/createCollectionEvent.test.ts index 8fad76a1b6..e9dbaf6517 100644 --- a/tests/src/check-event/createCollectionEvent.test.ts +++ b/tests/src/check-event/createCollectionEvent.test.ts @@ -16,8 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {executeTransaction} from '../substrate/substrate-api'; -import {uniqueEventMessage} from '../util/helpers'; +import {getEventMessage} from '../util/helpers'; import {usingPlaygrounds, itSub, expect} from '../util/playgrounds'; describe('Create collection event ', () => { @@ -32,10 +31,8 @@ describe('Create collection event ', () => { }); }); itSub('Check event from createCollection(): ', async ({helper}) => { - const api = helper.api!; - const tx = api.tx.unique.createCollectionEx({name: [0x31], description: [0x32], tokenPrefix: '0x33', mode: 'NFT'}); - const events = await executeTransaction(api, alice, tx); - const msg = JSON.stringify(uniqueEventMessage(events)); + await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + const msg = JSON.stringify(getEventMessage(helper.chainLog[helper.chainLog.length - 1].events)); expect(msg).to.be.contain(checkSection); expect(msg).to.be.contain(checkTreasury); expect(msg).to.be.contain(checkSystem); diff --git a/tests/src/check-event/createItemEvent.test.ts b/tests/src/check-event/createItemEvent.test.ts index eb6f5569e9..1bc71b4055 100644 --- a/tests/src/check-event/createItemEvent.test.ts +++ b/tests/src/check-event/createItemEvent.test.ts @@ -16,8 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {executeTransaction} from '../substrate/substrate-api'; -import {uniqueEventMessage, normalizeAccountId} from '../util/helpers'; +import {getEventMessage} from '../util/helpers'; import {itSub, usingPlaygrounds, expect} from '../util/playgrounds'; describe('Create Item event ', () => { @@ -33,9 +32,8 @@ describe('Create Item event ', () => { }); itSub('Check event from createItem(): ', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const createItemTx = helper.api!.tx.unique.createItem(collection.collectionId, normalizeAccountId(alice.address), 'NFT'); - const events = await executeTransaction(helper.api!, alice, createItemTx); - const msg = JSON.stringify(uniqueEventMessage(events)); + await collection.mintToken(alice, {Substrate: alice.address}); + const msg = JSON.stringify(getEventMessage(helper.chainLog[helper.chainLog.length - 1].events)); expect(msg).to.be.contain(checkSection); expect(msg).to.be.contain(checkTreasury); expect(msg).to.be.contain(checkSystem); diff --git a/tests/src/check-event/createMultipleItemsEvent.test.ts b/tests/src/check-event/createMultipleItemsEvent.test.ts index da7a52c696..c9cb63bc3a 100644 --- a/tests/src/check-event/createMultipleItemsEvent.test.ts +++ b/tests/src/check-event/createMultipleItemsEvent.test.ts @@ -16,8 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {executeTransaction} from '../substrate/substrate-api'; -import {uniqueEventMessage, normalizeAccountId} from '../util/helpers'; +import {getEventMessage} from '../util/helpers'; import {usingPlaygrounds, itSub, expect} from '../util/playgrounds'; describe('Create Multiple Items Event event ', () => { @@ -32,11 +31,14 @@ describe('Create Multiple Items Event event ', () => { }); }); itSub('Check event from createMultipleItems(): ', async ({helper}) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const args = [{NFT: {}}, {NFT: {}}, {NFT: {}}]; - const createMultipleItemsTx = helper.api!.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args); - const events = await executeTransaction(helper.api!, alice, createMultipleItemsTx); - const msg = JSON.stringify(uniqueEventMessage(events)); + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + + await collection.mintMultipleTokens(alice, [ + {owner: {Substrate: alice.address}}, + {owner: {Substrate: alice.address}}, + ]); + + const msg = JSON.stringify(getEventMessage(helper.chainLog[helper.chainLog.length - 1].events)); expect(msg).to.be.contain(checkSection); expect(msg).to.be.contain(checkTreasury); expect(msg).to.be.contain(checkSystem); diff --git a/tests/src/check-event/destroyCollectionEvent.test.ts b/tests/src/check-event/destroyCollectionEvent.test.ts index d80228447f..1f97ea638d 100644 --- a/tests/src/check-event/destroyCollectionEvent.test.ts +++ b/tests/src/check-event/destroyCollectionEvent.test.ts @@ -16,8 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {executeTransaction} from '../substrate/substrate-api'; -import {uniqueEventMessage} from '../util/helpers'; +import {getEventMessage} from '../util/helpers'; import {itSub, usingPlaygrounds, expect} from '../util/playgrounds'; describe('Destroy collection event ', () => { @@ -32,10 +31,9 @@ describe('Destroy collection event ', () => { }); itSub('Check event from destroyCollection(): ', async ({helper}) => { - const {collectionId} = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const destroyCollectionTx = helper.api!.tx.unique.destroyCollection(collectionId); - const events = await executeTransaction(helper.api!, alice, destroyCollectionTx); - const msg = JSON.stringify(uniqueEventMessage(events)); + const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); + await collection.burn(alice); + const msg = JSON.stringify(getEventMessage(helper.chainLog[helper.chainLog.length - 1].events)); expect(msg).to.be.contain(checkTreasury); expect(msg).to.be.contain(checkSystem); }); diff --git a/tests/src/check-event/transferEvent.test.ts b/tests/src/check-event/transferEvent.test.ts index 193a511671..0aaed63b6a 100644 --- a/tests/src/check-event/transferEvent.test.ts +++ b/tests/src/check-event/transferEvent.test.ts @@ -16,8 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {executeTransaction} from '../substrate/substrate-api'; -import {uniqueEventMessage, normalizeAccountId} from '../util/helpers'; +import {getEventMessage} from '../util/helpers'; import {usingPlaygrounds, expect, itSub} from '../util/playgrounds'; describe('Transfer event ', () => { @@ -36,10 +35,9 @@ describe('Transfer event ', () => { itSub('Check event from transfer(): ', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const {tokenId} = await collection.mintToken(alice, {Substrate: alice.address}); - const transferTx = helper.api!.tx.unique.transfer(normalizeAccountId(bob.address), collection.collectionId, tokenId, 1); - const events = await executeTransaction(helper.api!, alice, transferTx); - const msg = JSON.stringify(uniqueEventMessage(events)); + const token = await collection.mintToken(alice, {Substrate: alice.address}); + await token.transfer(alice, {Substrate: bob.address}); + const msg = JSON.stringify(getEventMessage(helper.chainLog[helper.chainLog.length - 1].events)); expect(msg).to.be.contain(checkSection); expect(msg).to.be.contain(checkTreasury); expect(msg).to.be.contain(checkSystem); diff --git a/tests/src/check-event/transferFromEvent.test.ts b/tests/src/check-event/transferFromEvent.test.ts index e784b0946a..0e1a954f71 100644 --- a/tests/src/check-event/transferFromEvent.test.ts +++ b/tests/src/check-event/transferFromEvent.test.ts @@ -16,8 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {executeTransaction} from '../substrate/substrate-api'; -import {uniqueEventMessage, normalizeAccountId} from '../util/helpers'; +import {getEventMessage} from '../util/helpers'; import {usingPlaygrounds, expect, itSub} from '../util/playgrounds'; describe('Transfer event ', () => { @@ -36,10 +35,9 @@ describe('Transfer event ', () => { itSub('Check event from transfer(): ', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const {tokenId} = await collection.mintToken(alice, {Substrate: alice.address}); - const transferTx = helper.api!.tx.unique.transferFrom(normalizeAccountId(alice.address), normalizeAccountId(bob.address), collection.collectionId, tokenId, 1); - const events = await executeTransaction(helper.api!, alice, transferTx); - const msg = JSON.stringify(uniqueEventMessage(events)); + const token = await collection.mintToken(alice, {Substrate: alice.address}); + await token.transferFrom(alice, {Substrate: alice.address}, {Substrate: bob.address}); + const msg = JSON.stringify(getEventMessage(helper.chainLog[helper.chainLog.length - 1].events)); expect(msg).to.be.contain(checkSection); expect(msg).to.be.contain(checkTreasury); expect(msg).to.be.contain(checkSystem); From 104c91ace9f18a084e8f5a1d941f4ffbf5aa4704 Mon Sep 17 00:00:00 2001 From: rkv Date: Tue, 4 Oct 2022 15:32:44 +0300 Subject: [PATCH 1022/1274] fix: remove aux func getMessage --- tests/src/check-event/burnItemEvent.test.ts | 15 +++++++-------- .../check-event/createCollectionEvent.test.ts | 15 +++++++-------- tests/src/check-event/createItemEvent.test.ts | 15 +++++++-------- .../check-event/createMultipleItemsEvent.test.ts | 15 +++++++-------- .../check-event/destroyCollectionEvent.test.ts | 13 +++++++------ tests/src/check-event/transferEvent.test.ts | 15 +++++++-------- tests/src/check-event/transferFromEvent.test.ts | 16 +++++++--------- 7 files changed, 49 insertions(+), 55 deletions(-) diff --git a/tests/src/check-event/burnItemEvent.test.ts b/tests/src/check-event/burnItemEvent.test.ts index c5e48a23f8..c37965b1e5 100644 --- a/tests/src/check-event/burnItemEvent.test.ts +++ b/tests/src/check-event/burnItemEvent.test.ts @@ -16,15 +16,12 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {getEventMessage} from '../util/helpers'; import {usingPlaygrounds, expect, itSub} from '../util/playgrounds'; +import {IEvent} from '../util/playgrounds/types'; describe('Burn Item event ', () => { let alice: IKeyringPair; - const checkSection = 'ItemDestroyed'; - const checkTreasury = 'Deposit'; - const checkSystem = 'ExtrinsicSuccess'; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { const donor = privateKey('//Alice'); @@ -36,9 +33,11 @@ describe('Burn Item event ', () => { const token = await collection.mintToken(alice, {Substrate: alice.address}); await token.burn(alice); - const msg = JSON.stringify(getEventMessage(helper.chainLog[helper.chainLog.length - 1].events)); - expect(msg).to.be.contain(checkSection); - expect(msg).to.be.contain(checkTreasury); - expect(msg).to.be.contain(checkSystem); + const event = helper.chainLog[helper.chainLog.length - 1].events as IEvent[]; + const eventStrings = event.map(e => `${e.section}.${e.method}`); + + expect(eventStrings).to.contains('common.ItemDestroyed'); + expect(eventStrings).to.contains('treasury.Deposit'); + expect(eventStrings).to.contains('system.ExtrinsicSuccess'); }); }); diff --git a/tests/src/check-event/createCollectionEvent.test.ts b/tests/src/check-event/createCollectionEvent.test.ts index e9dbaf6517..57d31b91aa 100644 --- a/tests/src/check-event/createCollectionEvent.test.ts +++ b/tests/src/check-event/createCollectionEvent.test.ts @@ -16,14 +16,11 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {getEventMessage} from '../util/helpers'; import {usingPlaygrounds, itSub, expect} from '../util/playgrounds'; +import {IEvent} from '../util/playgrounds/types'; describe('Create collection event ', () => { let alice: IKeyringPair; - const checkSection = 'CollectionCreated'; - const checkTreasury = 'Deposit'; - const checkSystem = 'ExtrinsicSuccess'; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { const donor = privateKey('//Alice'); @@ -32,9 +29,11 @@ describe('Create collection event ', () => { }); itSub('Check event from createCollection(): ', async ({helper}) => { await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); - const msg = JSON.stringify(getEventMessage(helper.chainLog[helper.chainLog.length - 1].events)); - expect(msg).to.be.contain(checkSection); - expect(msg).to.be.contain(checkTreasury); - expect(msg).to.be.contain(checkSystem); + const event = helper.chainLog[helper.chainLog.length - 1].events as IEvent[]; + const eventStrings = event.map(e => `${e.section}.${e.method}`); + + expect(eventStrings).to.contains('common.CollectionCreated'); + expect(eventStrings).to.contains('treasury.Deposit'); + expect(eventStrings).to.contains('system.ExtrinsicSuccess'); }); }); diff --git a/tests/src/check-event/createItemEvent.test.ts b/tests/src/check-event/createItemEvent.test.ts index 1bc71b4055..8c3709d536 100644 --- a/tests/src/check-event/createItemEvent.test.ts +++ b/tests/src/check-event/createItemEvent.test.ts @@ -16,14 +16,11 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {getEventMessage} from '../util/helpers'; import {itSub, usingPlaygrounds, expect} from '../util/playgrounds'; +import {IEvent} from '../util/playgrounds/types'; describe('Create Item event ', () => { let alice: IKeyringPair; - const checkSection = 'ItemCreated'; - const checkTreasury = 'Deposit'; - const checkSystem = 'ExtrinsicSuccess'; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { const donor = privateKey('//Alice'); @@ -33,9 +30,11 @@ describe('Create Item event ', () => { itSub('Check event from createItem(): ', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); await collection.mintToken(alice, {Substrate: alice.address}); - const msg = JSON.stringify(getEventMessage(helper.chainLog[helper.chainLog.length - 1].events)); - expect(msg).to.be.contain(checkSection); - expect(msg).to.be.contain(checkTreasury); - expect(msg).to.be.contain(checkSystem); + const event = helper.chainLog[helper.chainLog.length - 1].events as IEvent[]; + const eventStrings = event.map(e => `${e.section}.${e.method}`); + + expect(eventStrings).to.contains('common.ItemCreated'); + expect(eventStrings).to.contains('treasury.Deposit'); + expect(eventStrings).to.contains('system.ExtrinsicSuccess'); }); }); diff --git a/tests/src/check-event/createMultipleItemsEvent.test.ts b/tests/src/check-event/createMultipleItemsEvent.test.ts index c9cb63bc3a..f0479618de 100644 --- a/tests/src/check-event/createMultipleItemsEvent.test.ts +++ b/tests/src/check-event/createMultipleItemsEvent.test.ts @@ -16,14 +16,11 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {getEventMessage} from '../util/helpers'; import {usingPlaygrounds, itSub, expect} from '../util/playgrounds'; +import {IEvent} from '../util/playgrounds/types'; describe('Create Multiple Items Event event ', () => { let alice: IKeyringPair; - const checkSection = 'ItemCreated'; - const checkTreasury = 'Deposit'; - const checkSystem = 'ExtrinsicSuccess'; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { const donor = privateKey('//Alice'); @@ -38,9 +35,11 @@ describe('Create Multiple Items Event event ', () => { {owner: {Substrate: alice.address}}, ]); - const msg = JSON.stringify(getEventMessage(helper.chainLog[helper.chainLog.length - 1].events)); - expect(msg).to.be.contain(checkSection); - expect(msg).to.be.contain(checkTreasury); - expect(msg).to.be.contain(checkSystem); + const event = helper.chainLog[helper.chainLog.length - 1].events as IEvent[]; + const eventStrings = event.map(e => `${e.section}.${e.method}`); + + expect(eventStrings).to.contains('common.ItemCreated'); + expect(eventStrings).to.contains('treasury.Deposit'); + expect(eventStrings).to.contains('system.ExtrinsicSuccess'); }); }); diff --git a/tests/src/check-event/destroyCollectionEvent.test.ts b/tests/src/check-event/destroyCollectionEvent.test.ts index 1f97ea638d..8de5eaa8e8 100644 --- a/tests/src/check-event/destroyCollectionEvent.test.ts +++ b/tests/src/check-event/destroyCollectionEvent.test.ts @@ -16,13 +16,11 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {getEventMessage} from '../util/helpers'; import {itSub, usingPlaygrounds, expect} from '../util/playgrounds'; +import {IEvent} from '../util/playgrounds/types'; describe('Destroy collection event ', () => { let alice: IKeyringPair; - const checkTreasury = 'Deposit'; - const checkSystem = 'ExtrinsicSuccess'; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { const donor = privateKey('//Alice'); @@ -33,8 +31,11 @@ describe('Destroy collection event ', () => { itSub('Check event from destroyCollection(): ', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); await collection.burn(alice); - const msg = JSON.stringify(getEventMessage(helper.chainLog[helper.chainLog.length - 1].events)); - expect(msg).to.be.contain(checkTreasury); - expect(msg).to.be.contain(checkSystem); + const event = helper.chainLog[helper.chainLog.length - 1].events as IEvent[]; + const eventStrings = event.map(e => `${e.section}.${e.method}`); + + expect(eventStrings).to.contains('common.CollectionDestroyed'); + expect(eventStrings).to.contains('treasury.Deposit'); + expect(eventStrings).to.contains('system.ExtrinsicSuccess'); }); }); diff --git a/tests/src/check-event/transferEvent.test.ts b/tests/src/check-event/transferEvent.test.ts index 0aaed63b6a..704baa59b2 100644 --- a/tests/src/check-event/transferEvent.test.ts +++ b/tests/src/check-event/transferEvent.test.ts @@ -16,15 +16,12 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {getEventMessage} from '../util/helpers'; import {usingPlaygrounds, expect, itSub} from '../util/playgrounds'; +import {IEvent} from '../util/playgrounds/types'; describe('Transfer event ', () => { let alice: IKeyringPair; let bob: IKeyringPair; - const checkSection = 'Transfer'; - const checkTreasury = 'Deposit'; - const checkSystem = 'ExtrinsicSuccess'; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { @@ -37,9 +34,11 @@ describe('Transfer event ', () => { const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); const token = await collection.mintToken(alice, {Substrate: alice.address}); await token.transfer(alice, {Substrate: bob.address}); - const msg = JSON.stringify(getEventMessage(helper.chainLog[helper.chainLog.length - 1].events)); - expect(msg).to.be.contain(checkSection); - expect(msg).to.be.contain(checkTreasury); - expect(msg).to.be.contain(checkSystem); + const event = helper.chainLog[helper.chainLog.length - 1].events as IEvent[]; + const eventStrings = event.map(e => `${e.section}.${e.method}`); + + expect(eventStrings).to.contains('common.Transfer'); + expect(eventStrings).to.contains('treasury.Deposit'); + expect(eventStrings).to.contains('system.ExtrinsicSuccess'); }); }); diff --git a/tests/src/check-event/transferFromEvent.test.ts b/tests/src/check-event/transferFromEvent.test.ts index 0e1a954f71..56c99174b7 100644 --- a/tests/src/check-event/transferFromEvent.test.ts +++ b/tests/src/check-event/transferFromEvent.test.ts @@ -16,16 +16,12 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {getEventMessage} from '../util/helpers'; import {usingPlaygrounds, expect, itSub} from '../util/playgrounds'; +import {IEvent} from '../util/playgrounds/types'; describe('Transfer event ', () => { let alice: IKeyringPair; let bob: IKeyringPair; - const checkSection = 'Transfer'; - const checkTreasury = 'Deposit'; - const checkSystem = 'ExtrinsicSuccess'; - before(async () => { await usingPlaygrounds(async (helper, privateKey) => { const donor = privateKey('//Alice'); @@ -37,9 +33,11 @@ describe('Transfer event ', () => { const collection = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); const token = await collection.mintToken(alice, {Substrate: alice.address}); await token.transferFrom(alice, {Substrate: alice.address}, {Substrate: bob.address}); - const msg = JSON.stringify(getEventMessage(helper.chainLog[helper.chainLog.length - 1].events)); - expect(msg).to.be.contain(checkSection); - expect(msg).to.be.contain(checkTreasury); - expect(msg).to.be.contain(checkSystem); + const event = helper.chainLog[helper.chainLog.length - 1].events as IEvent[]; + const eventStrings = event.map(e => `${e.section}.${e.method}`); + + expect(eventStrings).to.contains('common.Transfer'); + expect(eventStrings).to.contains('treasury.Deposit'); + expect(eventStrings).to.contains('system.ExtrinsicSuccess'); }); }); From d664736cbced2983f15f6641fda120fc05f2a4f6 Mon Sep 17 00:00:00 2001 From: rkv Date: Tue, 4 Oct 2022 16:48:23 +0300 Subject: [PATCH 1023/1274] fix: eth tests --- tests/src/eth/base.test.ts | 7 +- tests/src/eth/collectionAdmin.test.ts | 72 ++++++++++++-------- tests/src/eth/collectionProperties.test.ts | 2 +- tests/src/eth/proxy/fungibleProxy.test.ts | 3 +- tests/src/eth/proxy/nonFungibleProxy.test.ts | 3 +- 5 files changed, 52 insertions(+), 35 deletions(-) diff --git a/tests/src/eth/base.test.ts b/tests/src/eth/base.test.ts index e4f0878469..9e39c6aa08 100644 --- a/tests/src/eth/base.test.ts +++ b/tests/src/eth/base.test.ts @@ -23,7 +23,6 @@ import {Contract} from 'web3-eth-contract'; import {IKeyringPair} from '@polkadot/types/types'; import {EthUniqueHelper, itEth, usingEthPlaygrounds, expect} from './util/playgrounds'; -import {UNIQUE} from '../util/helpers'; describe('Contract calls', () => { let donor: IKeyringPair; @@ -39,7 +38,7 @@ describe('Contract calls', () => { const flipper = await helper.eth.deployFlipper(deployer); const cost = await recordEthFee(helper.api!, deployer, () => flipper.methods.flip().send({from: deployer})); - expect(cost < BigInt(0.2 * Number(UNIQUE))).to.be.true; + expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))).to.be.true; }); itEth('Balance transfer fee is less than 0.2 UNQ', async ({helper}) => { @@ -47,7 +46,7 @@ describe('Contract calls', () => { const userB = helper.eth.createAccount(); const cost = await recordEthFee(helper.api!, userA, () => helper.web3!.eth.sendTransaction({from: userA, to: userB, value: '1000000', ...GAS_ARGS})); const balanceB = await ethBalanceViaSub(helper.api!, userB); - expect(cost - balanceB < BigInt(0.2 * Number(UNIQUE))).to.be.true; + expect(cost - balanceB < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))).to.be.true; }); itEth('NFT transfer is close to 0.15 UNQ', async ({helper}) => { @@ -63,7 +62,7 @@ describe('Contract calls', () => { const cost = await recordEthFee(helper.api!, caller, () => contract.methods.transfer(receiver, tokenId).send(caller)); - const fee = Number(cost) / Number(UNIQUE); + const fee = Number(cost) / Number(helper.balance.getOneTokenNominal()); const expectedFee = 0.15; const tolerance = 0.001; diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index b0fc098bd1..402cb2db4d 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -14,11 +14,32 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {UNIQUE} from '../util/helpers'; -import { - recordEthFee, -} from './util/helpers'; -import {usingEthPlaygrounds, itEth, expect} from './util/playgrounds'; +import {usingEthPlaygrounds, itEth, expect, EthUniqueHelper} from './util/playgrounds'; + +async function waitNewBlocks(helper: EthUniqueHelper, count: number) { + // eslint-disable-next-line no-async-promise-executor + return new Promise(async (resolve) => { + const unsubscribe = await helper.callRpc('api.rpc.chain.subscribeNewHeads', [() => { + if (count > 0) { + count--; + } else { + unsubscribe(); + resolve(); + } + }]); + }); +} + +async function recordEthFee(helper: EthUniqueHelper, userAddress: string, call: () => Promise) { + const before = await helper.balance.getSubstrate(helper.address.ethToSubstrate(userAddress)); + await call(); + waitNewBlocks(helper, 1); + const after = await helper.balance.getSubstrate(helper.address.ethToSubstrate(userAddress)); + + expect(after < before).to.be.true; + + return before - after; +} describe('Add collection admins', () => { let donor: IKeyringPair; @@ -37,7 +58,7 @@ describe('Add collection admins', () => { const newAdmin = helper.eth.createAccount(); await collectionEvm.methods.addCollectionAdmin(newAdmin).send(); - const adminList = await helper.api!.rpc.unique.adminlist(collectionId); + const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]); expect(adminList[0].asEthereum.toString().toLocaleLowerCase()) .to.be.eq(newAdmin.toLocaleLowerCase()); }); @@ -50,12 +71,11 @@ describe('Add collection admins', () => { const [newAdmin] = await helper.arrange.createAccounts([10n], donor); await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send(); - const adminList = await helper.api!.rpc.unique.adminlist(collectionId); + const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]); expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) .to.be.eq(newAdmin.address.toLocaleLowerCase()); }); - //FIXME: itEth('Verify owner or admin', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); @@ -79,7 +99,7 @@ describe('Add collection admins', () => { await expect(collectionEvm.methods.addCollectionAdmin(user).call({from: admin})) .to.be.rejectedWith('NoPermission'); - const adminList = await helper.api!.rpc.unique.adminlist(collectionId); + const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]); expect(adminList.length).to.be.eq(1); expect(adminList[0].asEthereum.toString().toLocaleLowerCase()) .to.be.eq(admin.toLocaleLowerCase()); @@ -96,7 +116,7 @@ describe('Add collection admins', () => { await expect(collectionEvm.methods.addCollectionAdmin(user).call({from: notAdmin})) .to.be.rejectedWith('NoPermission'); - const adminList = await helper.api!.rpc.unique.adminlist(collectionId); + const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]); expect(adminList.length).to.be.eq(0); }); @@ -112,7 +132,7 @@ describe('Add collection admins', () => { await expect(collectionEvm.methods.addCollectionAdminSubstrate(notAdmin.addressRaw).call({from: admin})) .to.be.rejectedWith('NoPermission'); - const adminList = await helper.api!.rpc.unique.adminlist(collectionId); + const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]); expect(adminList.length).to.be.eq(1); expect(adminList[0].asEthereum.toString().toLocaleLowerCase()) .to.be.eq(admin.toLocaleLowerCase()); @@ -128,7 +148,7 @@ describe('Add collection admins', () => { await expect(collectionEvm.methods.addCollectionAdminSubstrate(notAdmin1.addressRaw).call({from: notAdmin0})) .to.be.rejectedWith('NoPermission'); - const adminList = await helper.api!.rpc.unique.adminlist(collectionId); + const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]); expect(adminList.length).to.be.eq(0); }); }); @@ -151,14 +171,14 @@ describe('Remove collection admins', () => { await collectionEvm.methods.addCollectionAdmin(newAdmin).send(); { - const adminList = await helper.api!.rpc.unique.adminlist(collectionId); + const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]); expect(adminList.length).to.be.eq(1); expect(adminList[0].asEthereum.toString().toLocaleLowerCase()) .to.be.eq(newAdmin.toLocaleLowerCase()); } await collectionEvm.methods.removeCollectionAdmin(newAdmin).send(); - const adminList = await helper.api!.rpc.unique.adminlist(collectionId); + const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]); expect(adminList.length).to.be.eq(0); }); @@ -170,13 +190,13 @@ describe('Remove collection admins', () => { const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await collectionEvm.methods.addCollectionAdminSubstrate(newAdmin.addressRaw).send(); { - const adminList = await helper.api!.rpc.unique.adminlist(collectionId); + const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]); expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) .to.be.eq(newAdmin.address.toLocaleLowerCase()); } await collectionEvm.methods.removeCollectionAdminSubstrate(newAdmin.addressRaw).send(); - const adminList = await helper.api!.rpc.unique.adminlist(collectionId); + const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]); expect(adminList.length).to.be.eq(0); }); @@ -194,7 +214,7 @@ describe('Remove collection admins', () => { await expect(collectionEvm.methods.removeCollectionAdmin(admin1).call({from: admin0})) .to.be.rejectedWith('NoPermission'); { - const adminList = await helper.api!.rpc.unique.adminlist(collectionId); + const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]); expect(adminList.length).to.be.eq(2); expect(adminList.toString().toLocaleLowerCase()) .to.be.deep.contains(admin0.toLocaleLowerCase()) @@ -215,7 +235,7 @@ describe('Remove collection admins', () => { await expect(collectionEvm.methods.removeCollectionAdmin(admin).call({from: notAdmin})) .to.be.rejectedWith('NoPermission'); { - const adminList = await helper.api!.rpc.unique.adminlist(collectionId); + const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]); expect(adminList[0].asEthereum.toString().toLocaleLowerCase()) .to.be.eq(admin.toLocaleLowerCase()); expect(adminList.length).to.be.eq(1); @@ -235,7 +255,7 @@ describe('Remove collection admins', () => { await expect(collectionEvm.methods.removeCollectionAdminSubstrate(adminSub.addressRaw).call({from: adminEth})) .to.be.rejectedWith('NoPermission'); - const adminList = await helper.api!.rpc.unique.adminlist(collectionId); + const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]); expect(adminList.length).to.be.eq(2); expect(adminList.toString().toLocaleLowerCase()) .to.be.deep.contains(adminSub.address.toLocaleLowerCase()) @@ -254,7 +274,7 @@ describe('Remove collection admins', () => { await expect(collectionEvm.methods.removeCollectionAdminSubstrate(adminSub.addressRaw).call({from: notAdminEth})) .to.be.rejectedWith('NoPermission'); - const adminList = await helper.api!.rpc.unique.adminlist(collectionId); + const adminList = await helper.callRpc('api.rpc.unique.adminlist', [collectionId]); expect(adminList.length).to.be.eq(1); expect(adminList[0].asSubstrate.toString().toLocaleLowerCase()) .to.be.eq(adminSub.address.toLocaleLowerCase()); @@ -287,13 +307,11 @@ describe('Change owner tests', () => { const newOwner = await helper.eth.createAccountWithBalance(donor); const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - - const cost = await recordEthFee(helper.api!, owner, () => collectionEvm.methods.setOwner(newOwner).send()); - expect(cost < BigInt(0.2 * Number(UNIQUE))); + const cost = await recordEthFee(helper, owner, () => collectionEvm.methods.setOwner(newOwner).send()); + expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); expect(cost > 0); }); - //FIXME itEth('(!negative tests!) call setOwner by non owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const newOwner = await helper.eth.createAccountWithBalance(donor); @@ -314,7 +332,6 @@ describe('Change substrate owner tests', () => { }); }); - //FIXME itEth.skip('Change owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const [newOwner] = await helper.arrange.createAccounts([10n], donor); @@ -336,12 +353,11 @@ describe('Change substrate owner tests', () => { const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - const cost = await recordEthFee(helper.api!, owner, () => collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send()); - expect(cost < BigInt(0.2 * Number(UNIQUE))); + const cost = await recordEthFee(helper, owner, () => collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send()); + expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); expect(cost > 0); }); - //FIXME itEth.skip('(!negative tests!) call setOwner by non owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const otherReceiver = await helper.eth.createAccountWithBalance(donor); diff --git a/tests/src/eth/collectionProperties.test.ts b/tests/src/eth/collectionProperties.test.ts index 3c1b604926..c80da4ec51 100644 --- a/tests/src/eth/collectionProperties.test.ts +++ b/tests/src/eth/collectionProperties.test.ts @@ -51,6 +51,6 @@ describe('EVM collection properties', () => { const contract = helper.ethNativeContract.collection(address, 'nft', caller); const value = await contract.methods.collectionProperty('testKey').call(); - expect(value).to.equal(helper.web3?.utils.toHex('testValue')); + expect(value).to.equal(helper.getWeb3().utils.toHex('testValue')); }); }); diff --git a/tests/src/eth/proxy/fungibleProxy.test.ts b/tests/src/eth/proxy/fungibleProxy.test.ts index ba3e2b9c80..92b626497b 100644 --- a/tests/src/eth/proxy/fungibleProxy.test.ts +++ b/tests/src/eth/proxy/fungibleProxy.test.ts @@ -23,7 +23,8 @@ import {EthUniqueHelper, itEth, usingEthPlaygrounds} from '../util/playgrounds'; async function proxyWrap(helper: EthUniqueHelper, wrapped: any, donor: IKeyringPair) { // Proxy owner has no special privilegies, we don't need to reuse them const owner = await helper.eth.createAccountWithBalance(donor); - const proxyContract = new helper.web3!.eth.Contract(JSON.parse((await readFile(`${__dirname}/UniqueFungibleProxy.abi`)).toString()), undefined, { + const web3 = helper.getWeb3(); + const proxyContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/UniqueFungibleProxy.abi`)).toString()), undefined, { from: owner, ...GAS_ARGS, }); diff --git a/tests/src/eth/proxy/nonFungibleProxy.test.ts b/tests/src/eth/proxy/nonFungibleProxy.test.ts index cc3d8cc88d..5ed9959967 100644 --- a/tests/src/eth/proxy/nonFungibleProxy.test.ts +++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts @@ -23,7 +23,8 @@ import {EthUniqueHelper, itEth, usingEthPlaygrounds} from '../util/playgrounds'; async function proxyWrap(helper: EthUniqueHelper, wrapped: any, donor: IKeyringPair) { // Proxy owner has no special privilegies, we don't need to reuse them const owner = await helper.eth.createAccountWithBalance(donor); - const proxyContract = new helper.web3!.eth.Contract(JSON.parse((await readFile(`${__dirname}/UniqueNFTProxy.abi`)).toString()), undefined, { + const web3 = helper.getWeb3(); + const proxyContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/UniqueNFTProxy.abi`)).toString()), undefined, { from: owner, ...GAS_ARGS, }); From 686b7bd51dff8ef3a6dc91edc46fe407d2c832e6 Mon Sep 17 00:00:00 2001 From: rkv Date: Tue, 4 Oct 2022 17:07:48 +0300 Subject: [PATCH 1024/1274] fix: use newBlocks from playgrounds --- tests/src/eth/collectionAdmin.test.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index 402cb2db4d..bab5c80bcc 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -16,24 +16,10 @@ import {IKeyringPair} from '@polkadot/types/types'; import {usingEthPlaygrounds, itEth, expect, EthUniqueHelper} from './util/playgrounds'; -async function waitNewBlocks(helper: EthUniqueHelper, count: number) { - // eslint-disable-next-line no-async-promise-executor - return new Promise(async (resolve) => { - const unsubscribe = await helper.callRpc('api.rpc.chain.subscribeNewHeads', [() => { - if (count > 0) { - count--; - } else { - unsubscribe(); - resolve(); - } - }]); - }); -} - async function recordEthFee(helper: EthUniqueHelper, userAddress: string, call: () => Promise) { const before = await helper.balance.getSubstrate(helper.address.ethToSubstrate(userAddress)); await call(); - waitNewBlocks(helper, 1); + await helper.wait.newBlocks(1); const after = await helper.balance.getSubstrate(helper.address.ethToSubstrate(userAddress)); expect(after < before).to.be.true; From d3b796f0c54734fd7ec821c295f9add6a741861e Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 4 Oct 2022 13:23:25 +0000 Subject: [PATCH 1025/1274] fix: try-runtime for polkadot-v0.9.29 --- Cargo.lock | 376 ++++++++++----------- pallets/app-promotion/Cargo.toml | 2 + pallets/common/Cargo.toml | 1 + pallets/configuration/Cargo.toml | 1 + pallets/evm-coder-substrate/Cargo.toml | 1 + pallets/evm-coder-substrate/src/lib.rs | 14 +- pallets/evm-contract-helpers/Cargo.toml | 1 + pallets/evm-migration/Cargo.toml | 1 + pallets/evm-transaction-payment/Cargo.toml | 1 + pallets/fungible/Cargo.toml | 1 + pallets/inflation/Cargo.toml | 1 + pallets/nonfungible/Cargo.toml | 1 + pallets/proxy-rmrk-core/Cargo.toml | 1 + pallets/proxy-rmrk-equip/Cargo.toml | 1 + pallets/refungible/Cargo.toml | 1 + pallets/scheduler/Cargo.toml | 2 +- pallets/structure/Cargo.toml | 1 + pallets/unique/Cargo.toml | 1 + runtime/common/runtime_apis.rs | 16 +- runtime/opal/Cargo.toml | 38 +++ 20 files changed, 264 insertions(+), 198 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e01e64e1a..e17b8e1141 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -444,7 +444,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "beefy-primitives", @@ -480,7 +480,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -500,7 +500,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "beefy-primitives", "sp-api", @@ -509,7 +509,7 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -2370,7 +2370,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "async-trait", "fc-db", @@ -2389,7 +2389,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -2405,7 +2405,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "fc-db", "fp-consensus", @@ -2422,7 +2422,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "ethereum", "ethereum-types", @@ -2464,7 +2464,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "ethereum", "ethereum-types", @@ -2587,7 +2587,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", ] @@ -2604,7 +2604,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "ethereum", "parity-scale-codec 3.2.1", @@ -2616,7 +2616,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "evm", "frame-support", @@ -2630,7 +2630,7 @@ dependencies = [ [[package]] name = "fp-evm-mapping" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "frame-support", "sp-core", @@ -2639,7 +2639,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "ethereum", "ethereum-types", @@ -2656,7 +2656,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "ethereum", "frame-support", @@ -2672,7 +2672,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "parity-scale-codec 3.2.1", ] @@ -2680,7 +2680,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -2703,7 +2703,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "Inflector", "chrono", @@ -2754,7 +2754,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2765,7 +2765,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2781,7 +2781,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -2810,7 +2810,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "bitflags", "frame-metadata", @@ -2841,7 +2841,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "Inflector", "cfg-expr", @@ -2855,7 +2855,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2867,7 +2867,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro2", "quote", @@ -2877,7 +2877,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "log", @@ -2894,7 +2894,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -2909,7 +2909,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "sp-api", @@ -2918,7 +2918,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "parity-scale-codec 3.2.1", @@ -5505,7 +5505,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -5521,7 +5521,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -5537,7 +5537,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -5552,7 +5552,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -5576,7 +5576,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5596,7 +5596,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -5611,7 +5611,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "fp-evm", "frame-support", @@ -5626,7 +5626,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "beefy-primitives", "frame-support", @@ -5642,7 +5642,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -5665,7 +5665,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -5683,7 +5683,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -5702,7 +5702,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -5756,7 +5756,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -5772,7 +5772,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5795,7 +5795,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5808,7 +5808,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -5826,7 +5826,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "ethereum", "ethereum-types", @@ -5855,7 +5855,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "evm", "fp-evm", @@ -6008,7 +6008,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6023,7 +6023,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6046,7 +6046,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6062,7 +6062,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6082,7 +6082,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6118,7 +6118,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6135,7 +6135,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -6153,7 +6153,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "jsonrpsee", "parity-scale-codec 3.2.1", @@ -6168,7 +6168,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6183,7 +6183,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -6200,7 +6200,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6219,7 +6219,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "sp-api", @@ -6251,7 +6251,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -6268,7 +6268,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6291,7 +6291,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6307,7 +6307,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6322,7 +6322,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -6336,7 +6336,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6415,7 +6415,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6431,7 +6431,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -6452,7 +6452,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6468,7 +6468,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -6482,7 +6482,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6505,7 +6505,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6516,7 +6516,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "sp-arithmetic", @@ -6540,7 +6540,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -6554,7 +6554,7 @@ dependencies = [ [[package]] name = "pallet-template-transaction-payment" version = "3.0.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.29#3f663c3ee19933cd5545e0420ce2562fa8301235" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.29#2917e3c58a51d3654788326197cb3e1eab7febae" dependencies = [ "frame-benchmarking", "frame-support", @@ -6574,7 +6574,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6592,7 +6592,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6611,7 +6611,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -6627,7 +6627,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6642,7 +6642,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "pallet-transaction-payment", "parity-scale-codec 3.2.1", @@ -6653,7 +6653,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6713,7 +6713,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6729,7 +6729,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -8941,7 +8941,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "env_logger", "jsonrpsee", @@ -9309,7 +9309,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "sp-core", @@ -9320,7 +9320,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures 0.3.24", @@ -9347,7 +9347,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "futures-timer", @@ -9370,7 +9370,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "sc-client-api", @@ -9386,7 +9386,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "impl-trait-for-tuples", "memmap2", @@ -9403,7 +9403,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9414,7 +9414,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "chrono", "clap", @@ -9453,7 +9453,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "fnv", "futures 0.3.24", @@ -9481,7 +9481,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "hash-db", "kvdb", @@ -9506,7 +9506,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures 0.3.24", @@ -9530,7 +9530,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures 0.3.24", @@ -9559,7 +9559,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "fork-tree", @@ -9601,7 +9601,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "jsonrpsee", @@ -9623,7 +9623,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "fork-tree", "parity-scale-codec 3.2.1", @@ -9636,7 +9636,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "assert_matches", "async-trait", @@ -9670,7 +9670,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures 0.3.24", @@ -9695,7 +9695,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "lazy_static", "lru 0.7.8", @@ -9722,7 +9722,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "environmental", "parity-scale-codec 3.2.1", @@ -9738,7 +9738,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -9753,7 +9753,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "cfg-if 1.0.0", "libc", @@ -9774,7 +9774,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ahash", "async-trait", @@ -9815,7 +9815,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "finality-grandpa", "futures 0.3.24", @@ -9836,7 +9836,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ansi_term", "futures 0.3.24", @@ -9853,7 +9853,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "hex", @@ -9868,7 +9868,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "asynchronous-codec", @@ -9917,7 +9917,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "bitflags", @@ -9940,7 +9940,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ahash", "futures 0.3.24", @@ -9958,7 +9958,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "hex", @@ -9979,7 +9979,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "fork-tree", "futures 0.3.24", @@ -10007,7 +10007,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "bytes", "fnv", @@ -10037,7 +10037,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "libp2p", @@ -10050,7 +10050,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -10059,7 +10059,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "hash-db", @@ -10089,7 +10089,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "jsonrpsee", @@ -10112,7 +10112,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "jsonrpsee", @@ -10125,7 +10125,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "directories", @@ -10192,7 +10192,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -10206,7 +10206,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "jsonrpsee", "parity-scale-codec 3.2.1", @@ -10225,7 +10225,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "libc", @@ -10244,7 +10244,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "chrono", "futures 0.3.24", @@ -10262,7 +10262,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ansi_term", "atty", @@ -10293,7 +10293,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10304,7 +10304,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "futures-timer", @@ -10330,7 +10330,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "log", @@ -10343,7 +10343,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "futures-timer", @@ -10790,7 +10790,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "hash-db", "log", @@ -10808,7 +10808,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "blake2", "proc-macro-crate", @@ -10820,7 +10820,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -10833,7 +10833,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "integer-sqrt", "num-traits", @@ -10848,7 +10848,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -10861,7 +10861,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "parity-scale-codec 3.2.1", @@ -10873,7 +10873,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "sp-api", @@ -10885,7 +10885,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "log", @@ -10903,7 +10903,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures 0.3.24", @@ -10922,7 +10922,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "parity-scale-codec 3.2.1", @@ -10940,7 +10940,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "merlin", @@ -10963,7 +10963,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -10977,7 +10977,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -10990,7 +10990,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "base58", "bitflags", @@ -11036,7 +11036,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "blake2", "byteorder", @@ -11050,7 +11050,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro2", "quote", @@ -11061,7 +11061,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -11070,7 +11070,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro2", "quote", @@ -11080,7 +11080,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "environmental", "parity-scale-codec 3.2.1", @@ -11091,7 +11091,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "finality-grandpa", "log", @@ -11109,7 +11109,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -11123,7 +11123,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "bytes", "futures 0.3.24", @@ -11149,7 +11149,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "lazy_static", "sp-core", @@ -11160,7 +11160,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures 0.3.24", @@ -11177,7 +11177,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "thiserror", "zstd", @@ -11186,7 +11186,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -11201,7 +11201,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11215,7 +11215,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "sp-api", "sp-core", @@ -11225,7 +11225,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "backtrace", "lazy_static", @@ -11235,7 +11235,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "rustc-hash", "serde", @@ -11245,7 +11245,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "either", "hash256-std-hasher", @@ -11267,7 +11267,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -11285,7 +11285,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "Inflector", "proc-macro-crate", @@ -11297,7 +11297,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -11311,7 +11311,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11325,7 +11325,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11336,7 +11336,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "hash-db", "log", @@ -11358,12 +11358,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "impl-serde", "parity-scale-codec 3.2.1", @@ -11376,7 +11376,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "sp-core", @@ -11389,7 +11389,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures-timer", @@ -11405,7 +11405,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "sp-std", @@ -11417,7 +11417,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "sp-api", "sp-runtime", @@ -11426,7 +11426,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "log", @@ -11442,7 +11442,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ahash", "hash-db", @@ -11465,7 +11465,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "impl-serde", "parity-scale-codec 3.2.1", @@ -11482,7 +11482,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "proc-macro2", @@ -11493,7 +11493,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "impl-trait-for-tuples", "log", @@ -11511,9 +11511,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "ss58-registry" -version = "1.30.0" +version = "1.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2486f3d026e958566c6079caef44108cddf0ae6f8a411ef74fb08cdb56e614a" +checksum = "1de151faef619cb7b5c26b32d42bc7ddccac0d202beb7a84344b44e9232b92f7" dependencies = [ "Inflector", "num-format", @@ -11626,7 +11626,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "platforms", ] @@ -11634,7 +11634,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.24", @@ -11655,7 +11655,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures-util", "hyper", @@ -11668,7 +11668,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "jsonrpsee", "log", @@ -11689,7 +11689,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures 0.3.24", @@ -11715,7 +11715,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "substrate-test-utils-derive", @@ -11725,7 +11725,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11736,7 +11736,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ansi_term", "build-helper", @@ -12300,7 +12300,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "clap", "frame-try-runtime", @@ -12736,7 +12736,7 @@ dependencies = [ [[package]] name = "up-sponsorship" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.29#3f663c3ee19933cd5545e0420ce2562fa8301235" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.29#2917e3c58a51d3654788326197cb3e1eab7febae" dependencies = [ "impl-trait-for-tuples", ] diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index 13755473da..cfec3e80ef 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -38,6 +38,8 @@ std = [ 'serde/std', ] +try-runtime = ["frame-support/try-runtime"] + [dependencies] scale-info = { version = "2.0.1", default-features = false, features = [ "derive", diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index 6da10bf354..17bbfdb3b2 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -44,3 +44,4 @@ runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "up-data-structs/runtime-benchmarks", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/configuration/Cargo.toml b/pallets/configuration/Cargo.toml index 6109e59c3d..c833e13a41 100644 --- a/pallets/configuration/Cargo.toml +++ b/pallets/configuration/Cargo.toml @@ -31,3 +31,4 @@ std = [ "sp-arithmetic/std", "fp-evm/std", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/evm-coder-substrate/Cargo.toml b/pallets/evm-coder-substrate/Cargo.toml index f6d8f6d952..67677c4bc0 100644 --- a/pallets/evm-coder-substrate/Cargo.toml +++ b/pallets/evm-coder-substrate/Cargo.toml @@ -39,3 +39,4 @@ std = [ 'frame-benchmarking/std', ] runtime-benchmarks = ['frame-benchmarking'] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/evm-coder-substrate/src/lib.rs b/pallets/evm-coder-substrate/src/lib.rs index 1c57d85ea2..6d9bc2644f 100644 --- a/pallets/evm-coder-substrate/src/lib.rs +++ b/pallets/evm-coder-substrate/src/lib.rs @@ -40,7 +40,7 @@ use sp_core::H160; use evm_coder::{ abi::{AbiReader, AbiWrite, AbiWriter}, - execution::{self, Result}, + execution, types::{Msg, value}, }; @@ -147,13 +147,13 @@ impl SubstrateRecorder { Ok(()) } - pub fn consume_sload(&self) -> Result<()> { + pub fn consume_sload(&self) -> execution::Result<()> { self.consume_gas(G_SLOAD_WORD) } - pub fn consume_sstore(&self) -> Result<()> { + pub fn consume_sstore(&self) -> execution::Result<()> { self.consume_gas(G_SSTORE_WORD) } - pub fn consume_gas(&self, gas: u64) -> Result<()> { + pub fn consume_gas(&self, gas: u64) -> execution::Result<()> { if gas == u64::MAX { return Err(execution::Error::Error(ExitError::OutOfGas)); } @@ -172,7 +172,7 @@ impl SubstrateRecorder { pub fn evm_to_precompile_output( self, handle: &mut impl PrecompileHandle, - result: evm_coder::execution::Result>, + result: execution::Result>, ) -> Option { use evm_coder::execution::Error; // We ignore error here, as it should not occur, as we have our own bookkeeping of gas @@ -198,7 +198,7 @@ impl SubstrateRecorder { } } -pub fn dispatch_to_evm(err: DispatchError) -> evm_coder::execution::Error { +pub fn dispatch_to_evm(err: DispatchError) -> execution::Error { use evm_coder::execution::Error as ExError; match err { DispatchError::Module(ModuleError { index, error, .. }) @@ -257,7 +257,7 @@ fn call_internal< e: &mut E, value: value, input: &[u8], -) -> evm_coder::execution::Result> { +) -> execution::Result> { let (selector, mut reader) = AbiReader::new_call(input)?; let call = C::parse(selector, &mut reader)?; if call.is_none() { diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index 6e11adfcab..f58b026b23 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -51,3 +51,4 @@ std = [ "pallet-evm/std", "up-sponsorship/std", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/evm-migration/Cargo.toml b/pallets/evm-migration/Cargo.toml index d6d360ecb4..2535746082 100644 --- a/pallets/evm-migration/Cargo.toml +++ b/pallets/evm-migration/Cargo.toml @@ -38,3 +38,4 @@ std = [ "fp-evm/std", ] runtime-benchmarks = ["frame-benchmarking"] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/evm-transaction-payment/Cargo.toml b/pallets/evm-transaction-payment/Cargo.toml index ad6909f614..8ce830c8ff 100644 --- a/pallets/evm-transaction-payment/Cargo.toml +++ b/pallets/evm-transaction-payment/Cargo.toml @@ -41,3 +41,4 @@ std = [ "up-sponsorship/std", "fp-evm-mapping/std", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index cdc98eef75..57cfce8623 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -45,3 +45,4 @@ std = [ "pallet-evm/std", ] runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks'] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/inflation/Cargo.toml b/pallets/inflation/Cargo.toml index e9f8564727..3202e22d73 100644 --- a/pallets/inflation/Cargo.toml +++ b/pallets/inflation/Cargo.toml @@ -29,6 +29,7 @@ std = [ 'sp-runtime/std', 'frame-benchmarking/std', ] +try-runtime = ["frame-support/try-runtime"] ################################################################################ # Substrate Dependencies diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index 4fbd160584..ce03c95126 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -51,3 +51,4 @@ runtime-benchmarks = [ 'frame-system/runtime-benchmarks', 'up-data-structs/runtime-benchmarks', ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/proxy-rmrk-core/Cargo.toml b/pallets/proxy-rmrk-core/Cargo.toml index 80055f24f6..c0443d01ae 100644 --- a/pallets/proxy-rmrk-core/Cargo.toml +++ b/pallets/proxy-rmrk-core/Cargo.toml @@ -48,3 +48,4 @@ runtime-benchmarks = [ 'frame-support/runtime-benchmarks', 'frame-system/runtime-benchmarks', ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/proxy-rmrk-equip/Cargo.toml b/pallets/proxy-rmrk-equip/Cargo.toml index 65c0a90a5e..da8986cd9a 100644 --- a/pallets/proxy-rmrk-equip/Cargo.toml +++ b/pallets/proxy-rmrk-equip/Cargo.toml @@ -47,3 +47,4 @@ runtime-benchmarks = [ 'frame-support/runtime-benchmarks', 'frame-system/runtime-benchmarks', ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index dd42107755..029a592322 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -51,3 +51,4 @@ runtime-benchmarks = [ 'frame-system/runtime-benchmarks', 'up-data-structs/runtime-benchmarks', ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/scheduler/Cargo.toml b/pallets/scheduler/Cargo.toml index 95a90e709a..52edbbe389 100644 --- a/pallets/scheduler/Cargo.toml +++ b/pallets/scheduler/Cargo.toml @@ -50,4 +50,4 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", ] -#try-runtime = ["frame-support/try-runtime"] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/structure/Cargo.toml b/pallets/structure/Cargo.toml index 2a6ee62ac9..712adb5ed9 100644 --- a/pallets/structure/Cargo.toml +++ b/pallets/structure/Cargo.toml @@ -32,3 +32,4 @@ std = [ "pallet-evm/std", ] runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks'] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index 73d363de75..470f102d8f 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -32,6 +32,7 @@ std = [ 'pallet-evm-coder-substrate/std', 'pallet-nonfungible/std', ] +try-runtime = ["frame-support/try-runtime"] limit-testing = ["up-data-structs/limit-testing"] ################################################################################ diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index f26d352ccb..1296f610d3 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -770,8 +770,20 @@ macro_rules! impl_common_runtime_apis { (weight, crate::config::substrate::RuntimeBlockWeights::get().max_block) } - fn execute_block_no_check(block: Block) -> frame_support::pallet_prelude::Weight { - Executive::execute_block_no_check(block) + fn execute_block( + block: Block, + state_root_check: bool, + select: frame_try_runtime::TryStateSelect + ) -> frame_support::pallet_prelude::Weight { + log::info!( + target: "node-runtime", + "try-runtime: executing block {:?} / root checks: {:?} / try-state-select: {:?}", + block.header.hash(), + state_root_check, + select, + ); + + Executive::try_execute_block(block, state_root_check, select).unwrap() } } } diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index fe9dbda20e..45bc3fe57a 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -47,7 +47,45 @@ runtime-benchmarks = [ try-runtime = [ 'frame-try-runtime', 'frame-executive/try-runtime', + 'frame-support/try-runtime', 'frame-system/try-runtime', + 'cumulus-pallet-parachain-system/try-runtime', + 'parachain-info/try-runtime', + 'pallet-aura/try-runtime', + 'cumulus-pallet-aura-ext/try-runtime', + 'pallet-balances/try-runtime', + 'pallet-randomness-collective-flip/try-runtime', + 'pallet-timestamp/try-runtime', + 'pallet-transaction-payment/try-runtime', + 'pallet-treasury/try-runtime', + 'pallet-sudo/try-runtime', + 'orml-vesting/try-runtime', + 'orml-xtokens/try-runtime', + 'orml-tokens/try-runtime', + 'cumulus-pallet-xcmp-queue/try-runtime', + 'pallet-xcm/try-runtime', + 'cumulus-pallet-xcm/try-runtime', + 'cumulus-pallet-dmp-queue/try-runtime', + 'pallet-inflation/try-runtime', + 'pallet-unique/try-runtime', + 'pallet-unique-scheduler/try-runtime', + 'pallet-configuration/try-runtime', + 'pallet-charge-transaction/try-runtime', + 'pallet-common/try-runtime', + 'pallet-fungible/try-runtime', + 'pallet-refungible/try-runtime', + 'pallet-nonfungible/try-runtime', + 'pallet-structure/try-runtime', + 'pallet-proxy-rmrk-core/try-runtime', + 'pallet-proxy-rmrk-equip/try-runtime', + 'pallet-app-promotion/try-runtime', + 'pallet-foreign-assets/try-runtime', + 'pallet-evm/try-runtime', + 'pallet-ethereum/try-runtime', + 'pallet-evm-coder-substrate/try-runtime', + 'pallet-evm-contract-helpers/try-runtime', + 'pallet-evm-transaction-payment/try-runtime', + 'pallet-evm-migration/try-runtime', ] std = [ 'codec/std', From c3c26aa9e24ffb9e3e13afad21ffa20e58b3d00f Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 4 Oct 2022 13:23:25 +0000 Subject: [PATCH 1026/1274] fix: try-runtime for polkadot-v0.9.29 --- Cargo.lock | 376 ++++++++++----------- pallets/app-promotion/Cargo.toml | 2 + pallets/common/Cargo.toml | 1 + pallets/configuration/Cargo.toml | 1 + pallets/evm-coder-substrate/Cargo.toml | 1 + pallets/evm-coder-substrate/src/lib.rs | 14 +- pallets/evm-contract-helpers/Cargo.toml | 1 + pallets/evm-migration/Cargo.toml | 1 + pallets/evm-transaction-payment/Cargo.toml | 1 + pallets/fungible/Cargo.toml | 1 + pallets/inflation/Cargo.toml | 1 + pallets/nonfungible/Cargo.toml | 1 + pallets/proxy-rmrk-core/Cargo.toml | 1 + pallets/proxy-rmrk-equip/Cargo.toml | 1 + pallets/refungible/Cargo.toml | 1 + pallets/scheduler/Cargo.toml | 2 +- pallets/structure/Cargo.toml | 1 + pallets/unique/Cargo.toml | 1 + runtime/common/runtime_apis.rs | 16 +- runtime/opal/Cargo.toml | 38 +++ 20 files changed, 264 insertions(+), 198 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e01e64e1a..e17b8e1141 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -444,7 +444,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "beefy-primitives", @@ -480,7 +480,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -500,7 +500,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "beefy-primitives", "sp-api", @@ -509,7 +509,7 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -2370,7 +2370,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "async-trait", "fc-db", @@ -2389,7 +2389,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -2405,7 +2405,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "fc-db", "fp-consensus", @@ -2422,7 +2422,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "ethereum", "ethereum-types", @@ -2464,7 +2464,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "ethereum", "ethereum-types", @@ -2587,7 +2587,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", ] @@ -2604,7 +2604,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "ethereum", "parity-scale-codec 3.2.1", @@ -2616,7 +2616,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "evm", "frame-support", @@ -2630,7 +2630,7 @@ dependencies = [ [[package]] name = "fp-evm-mapping" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "frame-support", "sp-core", @@ -2639,7 +2639,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "ethereum", "ethereum-types", @@ -2656,7 +2656,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "ethereum", "frame-support", @@ -2672,7 +2672,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "parity-scale-codec 3.2.1", ] @@ -2680,7 +2680,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -2703,7 +2703,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "Inflector", "chrono", @@ -2754,7 +2754,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2765,7 +2765,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2781,7 +2781,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -2810,7 +2810,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "bitflags", "frame-metadata", @@ -2841,7 +2841,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "Inflector", "cfg-expr", @@ -2855,7 +2855,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2867,7 +2867,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro2", "quote", @@ -2877,7 +2877,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "log", @@ -2894,7 +2894,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -2909,7 +2909,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "sp-api", @@ -2918,7 +2918,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "parity-scale-codec 3.2.1", @@ -5505,7 +5505,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -5521,7 +5521,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -5537,7 +5537,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -5552,7 +5552,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -5576,7 +5576,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5596,7 +5596,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -5611,7 +5611,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "fp-evm", "frame-support", @@ -5626,7 +5626,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "beefy-primitives", "frame-support", @@ -5642,7 +5642,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -5665,7 +5665,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -5683,7 +5683,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -5702,7 +5702,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -5756,7 +5756,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -5772,7 +5772,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5795,7 +5795,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5808,7 +5808,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -5826,7 +5826,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "ethereum", "ethereum-types", @@ -5855,7 +5855,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#30b8f3330d1e9a0b3fc812d60642f6f67b93c059" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" dependencies = [ "evm", "fp-evm", @@ -6008,7 +6008,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6023,7 +6023,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6046,7 +6046,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6062,7 +6062,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6082,7 +6082,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6118,7 +6118,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6135,7 +6135,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -6153,7 +6153,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "jsonrpsee", "parity-scale-codec 3.2.1", @@ -6168,7 +6168,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6183,7 +6183,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -6200,7 +6200,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6219,7 +6219,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "sp-api", @@ -6251,7 +6251,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -6268,7 +6268,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6291,7 +6291,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6307,7 +6307,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6322,7 +6322,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -6336,7 +6336,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6415,7 +6415,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6431,7 +6431,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -6452,7 +6452,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6468,7 +6468,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -6482,7 +6482,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6505,7 +6505,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6516,7 +6516,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "sp-arithmetic", @@ -6540,7 +6540,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -6554,7 +6554,7 @@ dependencies = [ [[package]] name = "pallet-template-transaction-payment" version = "3.0.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.29#3f663c3ee19933cd5545e0420ce2562fa8301235" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.29#2917e3c58a51d3654788326197cb3e1eab7febae" dependencies = [ "frame-benchmarking", "frame-support", @@ -6574,7 +6574,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6592,7 +6592,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6611,7 +6611,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-support", "frame-system", @@ -6627,7 +6627,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6642,7 +6642,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "pallet-transaction-payment", "parity-scale-codec 3.2.1", @@ -6653,7 +6653,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6713,7 +6713,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -6729,7 +6729,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-benchmarking", "frame-support", @@ -8941,7 +8941,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "env_logger", "jsonrpsee", @@ -9309,7 +9309,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "sp-core", @@ -9320,7 +9320,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures 0.3.24", @@ -9347,7 +9347,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "futures-timer", @@ -9370,7 +9370,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "sc-client-api", @@ -9386,7 +9386,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "impl-trait-for-tuples", "memmap2", @@ -9403,7 +9403,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9414,7 +9414,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "chrono", "clap", @@ -9453,7 +9453,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "fnv", "futures 0.3.24", @@ -9481,7 +9481,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "hash-db", "kvdb", @@ -9506,7 +9506,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures 0.3.24", @@ -9530,7 +9530,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures 0.3.24", @@ -9559,7 +9559,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "fork-tree", @@ -9601,7 +9601,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "jsonrpsee", @@ -9623,7 +9623,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "fork-tree", "parity-scale-codec 3.2.1", @@ -9636,7 +9636,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "assert_matches", "async-trait", @@ -9670,7 +9670,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures 0.3.24", @@ -9695,7 +9695,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "lazy_static", "lru 0.7.8", @@ -9722,7 +9722,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "environmental", "parity-scale-codec 3.2.1", @@ -9738,7 +9738,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -9753,7 +9753,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "cfg-if 1.0.0", "libc", @@ -9774,7 +9774,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ahash", "async-trait", @@ -9815,7 +9815,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "finality-grandpa", "futures 0.3.24", @@ -9836,7 +9836,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ansi_term", "futures 0.3.24", @@ -9853,7 +9853,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "hex", @@ -9868,7 +9868,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "asynchronous-codec", @@ -9917,7 +9917,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "bitflags", @@ -9940,7 +9940,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ahash", "futures 0.3.24", @@ -9958,7 +9958,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "hex", @@ -9979,7 +9979,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "fork-tree", "futures 0.3.24", @@ -10007,7 +10007,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "bytes", "fnv", @@ -10037,7 +10037,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "libp2p", @@ -10050,7 +10050,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -10059,7 +10059,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "hash-db", @@ -10089,7 +10089,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "jsonrpsee", @@ -10112,7 +10112,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "jsonrpsee", @@ -10125,7 +10125,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "directories", @@ -10192,7 +10192,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -10206,7 +10206,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "jsonrpsee", "parity-scale-codec 3.2.1", @@ -10225,7 +10225,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "libc", @@ -10244,7 +10244,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "chrono", "futures 0.3.24", @@ -10262,7 +10262,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ansi_term", "atty", @@ -10293,7 +10293,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10304,7 +10304,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "futures-timer", @@ -10330,7 +10330,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "log", @@ -10343,7 +10343,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "futures-timer", @@ -10790,7 +10790,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "hash-db", "log", @@ -10808,7 +10808,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "blake2", "proc-macro-crate", @@ -10820,7 +10820,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -10833,7 +10833,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "integer-sqrt", "num-traits", @@ -10848,7 +10848,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -10861,7 +10861,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "parity-scale-codec 3.2.1", @@ -10873,7 +10873,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "sp-api", @@ -10885,7 +10885,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "log", @@ -10903,7 +10903,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures 0.3.24", @@ -10922,7 +10922,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "parity-scale-codec 3.2.1", @@ -10940,7 +10940,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "merlin", @@ -10963,7 +10963,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -10977,7 +10977,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -10990,7 +10990,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "base58", "bitflags", @@ -11036,7 +11036,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "blake2", "byteorder", @@ -11050,7 +11050,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro2", "quote", @@ -11061,7 +11061,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -11070,7 +11070,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro2", "quote", @@ -11080,7 +11080,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "environmental", "parity-scale-codec 3.2.1", @@ -11091,7 +11091,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "finality-grandpa", "log", @@ -11109,7 +11109,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -11123,7 +11123,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "bytes", "futures 0.3.24", @@ -11149,7 +11149,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "lazy_static", "sp-core", @@ -11160,7 +11160,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures 0.3.24", @@ -11177,7 +11177,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "thiserror", "zstd", @@ -11186,7 +11186,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -11201,7 +11201,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11215,7 +11215,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "sp-api", "sp-core", @@ -11225,7 +11225,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "backtrace", "lazy_static", @@ -11235,7 +11235,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "rustc-hash", "serde", @@ -11245,7 +11245,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "either", "hash256-std-hasher", @@ -11267,7 +11267,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -11285,7 +11285,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "Inflector", "proc-macro-crate", @@ -11297,7 +11297,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -11311,7 +11311,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11325,7 +11325,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11336,7 +11336,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "hash-db", "log", @@ -11358,12 +11358,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "impl-serde", "parity-scale-codec 3.2.1", @@ -11376,7 +11376,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "log", "sp-core", @@ -11389,7 +11389,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures-timer", @@ -11405,7 +11405,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "sp-std", @@ -11417,7 +11417,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "sp-api", "sp-runtime", @@ -11426,7 +11426,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "log", @@ -11442,7 +11442,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ahash", "hash-db", @@ -11465,7 +11465,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "impl-serde", "parity-scale-codec 3.2.1", @@ -11482,7 +11482,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "parity-scale-codec 3.2.1", "proc-macro2", @@ -11493,7 +11493,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "impl-trait-for-tuples", "log", @@ -11511,9 +11511,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "ss58-registry" -version = "1.30.0" +version = "1.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2486f3d026e958566c6079caef44108cddf0ae6f8a411ef74fb08cdb56e614a" +checksum = "1de151faef619cb7b5c26b32d42bc7ddccac0d202beb7a84344b44e9232b92f7" dependencies = [ "Inflector", "num-format", @@ -11626,7 +11626,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "platforms", ] @@ -11634,7 +11634,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.24", @@ -11655,7 +11655,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures-util", "hyper", @@ -11668,7 +11668,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "jsonrpsee", "log", @@ -11689,7 +11689,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "async-trait", "futures 0.3.24", @@ -11715,7 +11715,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "futures 0.3.24", "substrate-test-utils-derive", @@ -11725,7 +11725,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11736,7 +11736,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "ansi_term", "build-helper", @@ -12300,7 +12300,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#c6ebc1e73f85deba349db0ea785ad53addb6f69f" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" dependencies = [ "clap", "frame-try-runtime", @@ -12736,7 +12736,7 @@ dependencies = [ [[package]] name = "up-sponsorship" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.29#3f663c3ee19933cd5545e0420ce2562fa8301235" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.29#2917e3c58a51d3654788326197cb3e1eab7febae" dependencies = [ "impl-trait-for-tuples", ] diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index 13755473da..cfec3e80ef 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -38,6 +38,8 @@ std = [ 'serde/std', ] +try-runtime = ["frame-support/try-runtime"] + [dependencies] scale-info = { version = "2.0.1", default-features = false, features = [ "derive", diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index 6da10bf354..17bbfdb3b2 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -44,3 +44,4 @@ runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "up-data-structs/runtime-benchmarks", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/configuration/Cargo.toml b/pallets/configuration/Cargo.toml index 6109e59c3d..c833e13a41 100644 --- a/pallets/configuration/Cargo.toml +++ b/pallets/configuration/Cargo.toml @@ -31,3 +31,4 @@ std = [ "sp-arithmetic/std", "fp-evm/std", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/evm-coder-substrate/Cargo.toml b/pallets/evm-coder-substrate/Cargo.toml index f6d8f6d952..67677c4bc0 100644 --- a/pallets/evm-coder-substrate/Cargo.toml +++ b/pallets/evm-coder-substrate/Cargo.toml @@ -39,3 +39,4 @@ std = [ 'frame-benchmarking/std', ] runtime-benchmarks = ['frame-benchmarking'] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/evm-coder-substrate/src/lib.rs b/pallets/evm-coder-substrate/src/lib.rs index 1c57d85ea2..6d9bc2644f 100644 --- a/pallets/evm-coder-substrate/src/lib.rs +++ b/pallets/evm-coder-substrate/src/lib.rs @@ -40,7 +40,7 @@ use sp_core::H160; use evm_coder::{ abi::{AbiReader, AbiWrite, AbiWriter}, - execution::{self, Result}, + execution, types::{Msg, value}, }; @@ -147,13 +147,13 @@ impl SubstrateRecorder { Ok(()) } - pub fn consume_sload(&self) -> Result<()> { + pub fn consume_sload(&self) -> execution::Result<()> { self.consume_gas(G_SLOAD_WORD) } - pub fn consume_sstore(&self) -> Result<()> { + pub fn consume_sstore(&self) -> execution::Result<()> { self.consume_gas(G_SSTORE_WORD) } - pub fn consume_gas(&self, gas: u64) -> Result<()> { + pub fn consume_gas(&self, gas: u64) -> execution::Result<()> { if gas == u64::MAX { return Err(execution::Error::Error(ExitError::OutOfGas)); } @@ -172,7 +172,7 @@ impl SubstrateRecorder { pub fn evm_to_precompile_output( self, handle: &mut impl PrecompileHandle, - result: evm_coder::execution::Result>, + result: execution::Result>, ) -> Option { use evm_coder::execution::Error; // We ignore error here, as it should not occur, as we have our own bookkeeping of gas @@ -198,7 +198,7 @@ impl SubstrateRecorder { } } -pub fn dispatch_to_evm(err: DispatchError) -> evm_coder::execution::Error { +pub fn dispatch_to_evm(err: DispatchError) -> execution::Error { use evm_coder::execution::Error as ExError; match err { DispatchError::Module(ModuleError { index, error, .. }) @@ -257,7 +257,7 @@ fn call_internal< e: &mut E, value: value, input: &[u8], -) -> evm_coder::execution::Result> { +) -> execution::Result> { let (selector, mut reader) = AbiReader::new_call(input)?; let call = C::parse(selector, &mut reader)?; if call.is_none() { diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index 6e11adfcab..f58b026b23 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -51,3 +51,4 @@ std = [ "pallet-evm/std", "up-sponsorship/std", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/evm-migration/Cargo.toml b/pallets/evm-migration/Cargo.toml index d6d360ecb4..2535746082 100644 --- a/pallets/evm-migration/Cargo.toml +++ b/pallets/evm-migration/Cargo.toml @@ -38,3 +38,4 @@ std = [ "fp-evm/std", ] runtime-benchmarks = ["frame-benchmarking"] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/evm-transaction-payment/Cargo.toml b/pallets/evm-transaction-payment/Cargo.toml index ad6909f614..8ce830c8ff 100644 --- a/pallets/evm-transaction-payment/Cargo.toml +++ b/pallets/evm-transaction-payment/Cargo.toml @@ -41,3 +41,4 @@ std = [ "up-sponsorship/std", "fp-evm-mapping/std", ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index cdc98eef75..57cfce8623 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -45,3 +45,4 @@ std = [ "pallet-evm/std", ] runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks'] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/inflation/Cargo.toml b/pallets/inflation/Cargo.toml index e9f8564727..3202e22d73 100644 --- a/pallets/inflation/Cargo.toml +++ b/pallets/inflation/Cargo.toml @@ -29,6 +29,7 @@ std = [ 'sp-runtime/std', 'frame-benchmarking/std', ] +try-runtime = ["frame-support/try-runtime"] ################################################################################ # Substrate Dependencies diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index 4fbd160584..ce03c95126 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -51,3 +51,4 @@ runtime-benchmarks = [ 'frame-system/runtime-benchmarks', 'up-data-structs/runtime-benchmarks', ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/proxy-rmrk-core/Cargo.toml b/pallets/proxy-rmrk-core/Cargo.toml index 80055f24f6..c0443d01ae 100644 --- a/pallets/proxy-rmrk-core/Cargo.toml +++ b/pallets/proxy-rmrk-core/Cargo.toml @@ -48,3 +48,4 @@ runtime-benchmarks = [ 'frame-support/runtime-benchmarks', 'frame-system/runtime-benchmarks', ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/proxy-rmrk-equip/Cargo.toml b/pallets/proxy-rmrk-equip/Cargo.toml index 65c0a90a5e..da8986cd9a 100644 --- a/pallets/proxy-rmrk-equip/Cargo.toml +++ b/pallets/proxy-rmrk-equip/Cargo.toml @@ -47,3 +47,4 @@ runtime-benchmarks = [ 'frame-support/runtime-benchmarks', 'frame-system/runtime-benchmarks', ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index dd42107755..029a592322 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -51,3 +51,4 @@ runtime-benchmarks = [ 'frame-system/runtime-benchmarks', 'up-data-structs/runtime-benchmarks', ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/scheduler/Cargo.toml b/pallets/scheduler/Cargo.toml index 95a90e709a..52edbbe389 100644 --- a/pallets/scheduler/Cargo.toml +++ b/pallets/scheduler/Cargo.toml @@ -50,4 +50,4 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", ] -#try-runtime = ["frame-support/try-runtime"] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/structure/Cargo.toml b/pallets/structure/Cargo.toml index 2a6ee62ac9..712adb5ed9 100644 --- a/pallets/structure/Cargo.toml +++ b/pallets/structure/Cargo.toml @@ -32,3 +32,4 @@ std = [ "pallet-evm/std", ] runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks'] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index 73d363de75..470f102d8f 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -32,6 +32,7 @@ std = [ 'pallet-evm-coder-substrate/std', 'pallet-nonfungible/std', ] +try-runtime = ["frame-support/try-runtime"] limit-testing = ["up-data-structs/limit-testing"] ################################################################################ diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index f26d352ccb..1296f610d3 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -770,8 +770,20 @@ macro_rules! impl_common_runtime_apis { (weight, crate::config::substrate::RuntimeBlockWeights::get().max_block) } - fn execute_block_no_check(block: Block) -> frame_support::pallet_prelude::Weight { - Executive::execute_block_no_check(block) + fn execute_block( + block: Block, + state_root_check: bool, + select: frame_try_runtime::TryStateSelect + ) -> frame_support::pallet_prelude::Weight { + log::info!( + target: "node-runtime", + "try-runtime: executing block {:?} / root checks: {:?} / try-state-select: {:?}", + block.header.hash(), + state_root_check, + select, + ); + + Executive::try_execute_block(block, state_root_check, select).unwrap() } } } diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 38c009a762..7ef6441f19 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -47,7 +47,45 @@ runtime-benchmarks = [ try-runtime = [ 'frame-try-runtime', 'frame-executive/try-runtime', + 'frame-support/try-runtime', 'frame-system/try-runtime', + 'cumulus-pallet-parachain-system/try-runtime', + 'parachain-info/try-runtime', + 'pallet-aura/try-runtime', + 'cumulus-pallet-aura-ext/try-runtime', + 'pallet-balances/try-runtime', + 'pallet-randomness-collective-flip/try-runtime', + 'pallet-timestamp/try-runtime', + 'pallet-transaction-payment/try-runtime', + 'pallet-treasury/try-runtime', + 'pallet-sudo/try-runtime', + 'orml-vesting/try-runtime', + 'orml-xtokens/try-runtime', + 'orml-tokens/try-runtime', + 'cumulus-pallet-xcmp-queue/try-runtime', + 'pallet-xcm/try-runtime', + 'cumulus-pallet-xcm/try-runtime', + 'cumulus-pallet-dmp-queue/try-runtime', + 'pallet-inflation/try-runtime', + 'pallet-unique/try-runtime', + 'pallet-unique-scheduler/try-runtime', + 'pallet-configuration/try-runtime', + 'pallet-charge-transaction/try-runtime', + 'pallet-common/try-runtime', + 'pallet-fungible/try-runtime', + 'pallet-refungible/try-runtime', + 'pallet-nonfungible/try-runtime', + 'pallet-structure/try-runtime', + 'pallet-proxy-rmrk-core/try-runtime', + 'pallet-proxy-rmrk-equip/try-runtime', + 'pallet-app-promotion/try-runtime', + 'pallet-foreign-assets/try-runtime', + 'pallet-evm/try-runtime', + 'pallet-ethereum/try-runtime', + 'pallet-evm-coder-substrate/try-runtime', + 'pallet-evm-contract-helpers/try-runtime', + 'pallet-evm-transaction-payment/try-runtime', + 'pallet-evm-migration/try-runtime', ] std = [ 'codec/std', From f211d099a000b44408847d7ecc2e5e17aba5af09 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 4 Oct 2022 17:46:41 +0000 Subject: [PATCH 1027/1274] chore: bump spec_version --- runtime/opal/src/lib.rs | 2 +- runtime/quartz/src/lib.rs | 2 +- runtime/unique/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 9aaa4a9891..d237eb6eaa 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -50,7 +50,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 927030, + spec_version: 929030, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index 94b1dd28c0..c9e67a7cdf 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -50,7 +50,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 927030, + spec_version: 929030, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index b7c454453c..c9a28d8d3d 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -50,7 +50,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 927030, + spec_version: 929030, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, From 80e5c9d6a523fea86f5ee3c5e37089015e62b079 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 4 Oct 2022 17:47:12 +0000 Subject: [PATCH 1028/1274] chore: bump tx_version --- runtime/opal/src/lib.rs | 2 +- runtime/quartz/src/lib.rs | 2 +- runtime/unique/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index d237eb6eaa..d62bbd951f 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -53,7 +53,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_version: 929030, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 2, + transaction_version: 3, state_version: 0, }; diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index c9e67a7cdf..f72939ee00 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -53,7 +53,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_version: 929030, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 2, + transaction_version: 3, state_version: 0, }; diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index c9a28d8d3d..aac1dab3e4 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -53,7 +53,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_version: 929030, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 2, + transaction_version: 3, state_version: 0, }; From 297a02f4e4b81611701f2de9f63ef616ecc3e5e7 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 4 Oct 2022 22:28:00 +0300 Subject: [PATCH 1029/1274] temporary fix for no-spec --- .docker/Dockerfile-try-runtime | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index 4622407a8d..489a998711 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -47,4 +47,4 @@ RUN echo "Requested features: $FEATURE\n" && \ cargo build --features=$FEATURE --release -CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $REPLICA_FROM +CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime --no-spec-name-check on-runtime-upgrade live --uri $REPLICA_FROM \ No newline at end of file From 1afec91d262ec941ef397d586c4bd050dffb3e65 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 4 Oct 2022 22:30:04 +0300 Subject: [PATCH 1030/1274] new line --- .docker/Dockerfile-try-runtime | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index 489a998711..ed1d5fc696 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -46,5 +46,4 @@ RUN echo "Requested features: $FEATURE\n" && \ echo "Fork from: $REPLICA_FROM\n" && \ cargo build --features=$FEATURE --release - -CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime --no-spec-name-check on-runtime-upgrade live --uri $REPLICA_FROM \ No newline at end of file +CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime --no-spec-name-check on-runtime-upgrade live --uri $REPLICA_FROM From 1d30029fd67b916adfd725f2a8e6a6b8a29665a4 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 01:46:18 +0400 Subject: [PATCH 1031/1274] Test: market evm tests to playgrounds --- tests/src/eth/marketplace/marketplace.test.ts | 195 +++++++++--------- tests/src/util/playgrounds/unique.ts | 1 + 2 files changed, 97 insertions(+), 99 deletions(-) diff --git a/tests/src/eth/marketplace/marketplace.test.ts b/tests/src/eth/marketplace/marketplace.test.ts index e4161c3a73..faa5cfa881 100644 --- a/tests/src/eth/marketplace/marketplace.test.ts +++ b/tests/src/eth/marketplace/marketplace.test.ts @@ -14,33 +14,47 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +import {usingPlaygrounds} from './../../util/playgrounds/index'; +import {IKeyringPair} from '@polkadot/types/types'; import {readFile} from 'fs/promises'; -import {getBalanceSingle} from '../../substrate/get-balance'; -import { - addToAllowListExpectSuccess, - confirmSponsorshipExpectSuccess, - createCollectionExpectSuccess, - createItemExpectSuccess, - getTokenOwner, - setCollectionLimitsExpectSuccess, - setCollectionSponsorExpectSuccess, - transferExpectSuccess, - transferFromExpectSuccess, - transferBalanceTo, -} from '../../util/helpers'; -import {collectionIdToAddress, contractHelpers, createEthAccountWithBalance, executeEthTxOnSub, GAS_ARGS, itWeb3, SponsoringMode, subToEth, subToEthLowercase, transferBalanceToEth} from '../util/helpers'; -import {evmToAddress} from '@polkadot/util-crypto'; +import {collectionIdToAddress, contractHelpers, GAS_ARGS, SponsoringMode} from '../util/helpers'; import nonFungibleAbi from '../nonFungibleAbi.json'; -import {expect} from 'chai'; +import {itEth, expect} from '../util/playgrounds'; const PRICE = 2000n; describe('Matcher contract usage', () => { - itWeb3('With UNQ', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const matcherOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + let donor: IKeyringPair; + let alice: IKeyringPair; + let aliceMirror: string; + let aliceDoubleMirror: string; + let seller: IKeyringPair; + let sellerMirror: string; + + before(async () => { + await usingPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); + + beforeEach(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + [alice] = await helper.arrange.createAccounts([10000n], donor); + aliceMirror = helper.address.substrateToEth(alice.address).toLowerCase(); + aliceDoubleMirror = helper.address.ethToSubstrate(aliceMirror); + seller = privateKey(`//Seller/${Date.now()}`); + sellerMirror = helper.address.substrateToEth(seller.address).toLowerCase(); + + await helper.balance.transferToSubstrate(donor, aliceDoubleMirror, 10_000_000_000_000_000_000n); + }); + }); + + itEth('With UNQ', async ({helper}) => { + const web3 = helper.web3!; + + const sponsor = await helper.eth.createAccountWithBalance(donor); + const matcherOwner = await helper.eth.createAccountWithBalance(donor); const matcherContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/MarketPlace.abi`)).toString()), undefined, { from: matcherOwner, ...GAS_ARGS, @@ -53,59 +67,52 @@ describe('Matcher contract usage', () => { await helpers.methods.setSponsor(matcher.options.address, sponsor).send({from: matcherOwner}); await helpers.methods.confirmSponsorship(matcher.options.address).send({from: sponsor}); - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsorApproveTimeout: 1}); - const evmCollection = new web3.eth.Contract(nonFungibleAbi as any, collectionIdToAddress(collectionId), {from: matcherOwner}); - await setCollectionSponsorExpectSuccess(collectionId, alice.address); - await transferBalanceToEth(api, alice, subToEth(alice.address)); - await confirmSponsorshipExpectSuccess(collectionId); - - await helpers.methods.toggleAllowed(matcher.options.address, subToEth(alice.address), true).send({from: matcherOwner}); - await addToAllowListExpectSuccess(alice, collectionId, evmToAddress(subToEth(alice.address))); + const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}, pendingSponsor: alice.address}); + await collection.confirmSponsorship(alice); + await collection.addToAllowList(alice, {Substrate: aliceDoubleMirror}); + const evmCollection = new web3.eth.Contract(nonFungibleAbi as any, collectionIdToAddress(collection.collectionId), {from: matcherOwner}); + await helper.eth.transferBalanceFromSubstrate(donor, aliceMirror); - const seller = privateKeyWrapper(`//Seller/${Date.now()}`); - await helpers.methods.toggleAllowed(matcher.options.address, subToEth(seller.address), true).send({from: matcherOwner}); + await helpers.methods.toggleAllowed(matcher.options.address, aliceMirror, true).send({from: matcherOwner}); + await helpers.methods.toggleAllowed(matcher.options.address, sellerMirror, true).send({from: matcherOwner}); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', seller.address); - - // To transfer item to matcher it first needs to be transfered to EVM account of bob - await transferExpectSuccess(collectionId, tokenId, seller, {Ethereum: subToEth(seller.address)}); + const token = await collection.mintToken(alice, {Ethereum: sellerMirror}); // Token is owned by seller initially - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal({Ethereum: subToEthLowercase(seller.address)}); + expect(await token.getOwner()).to.be.deep.equal({Ethereum: sellerMirror}); // Ask { - await executeEthTxOnSub(web3, api, seller, evmCollection, m => m.approve(matcher.options.address, tokenId)); - await executeEthTxOnSub(web3, api, seller, matcher, m => m.addAsk(PRICE, '0x0000000000000000000000000000000000000001', evmCollection.options.address, tokenId)); + await helper.eth.sendEVM(seller, evmCollection.options.address, evmCollection.methods.approve(matcher.options.address, token.tokenId).encodeABI(), '0'); + await helper.eth.sendEVM(seller, matcher.options.address, matcher.methods.addAsk(PRICE, '0x0000000000000000000000000000000000000001', evmCollection.options.address, token.tokenId).encodeABI(), '0'); } // Token is transferred to matcher - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal({Ethereum: matcher.options.address.toLowerCase()}); + expect(await token.getOwner()).to.be.deep.equal({Ethereum: matcher.options.address.toLowerCase()}); // Buy { - const sellerBalanceBeforePurchase = await getBalanceSingle(api, seller.address); - await executeEthTxOnSub(web3, api, alice, matcher, m => m.buy(evmCollection.options.address, tokenId), {value: PRICE}); - expect(await getBalanceSingle(api, seller.address) - sellerBalanceBeforePurchase === PRICE); + const sellerBalanceBeforePurchase = await helper.balance.getSubstrate(seller.address); + await helper.eth.sendEVM(alice, matcher.options.address, matcher.methods.buy(evmCollection.options.address, token.tokenId).encodeABI(), PRICE.toString()); + expect(await helper.balance.getSubstrate(seller.address) - sellerBalanceBeforePurchase === PRICE); } // Token is transferred to evm account of alice - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal({Ethereum: subToEthLowercase(alice.address)}); + expect(await token.getOwner()).to.be.deep.equal({Ethereum: aliceMirror}); // Transfer token to substrate side of alice - await transferFromExpectSuccess(collectionId, tokenId, alice, {Ethereum: subToEth(alice.address)}, {Substrate: alice.address}); + await token.transferFrom(alice, {Ethereum: aliceMirror}, {Substrate: alice.address}); // Token is transferred to substrate account of alice, seller received funds - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal({Substrate: alice.address}); + expect(await token.getOwner()).to.be.deep.equal({Substrate: alice.address}); }); + itEth('With escrow', async ({helper}) => { + const web3 = helper.web3!; - itWeb3('With escrow', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const matcherOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const escrow = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const sponsor = await helper.eth.createAccountWithBalance(donor); + const matcherOwner = await helper.eth.createAccountWithBalance(donor); + const escrow = await helper.eth.createAccountWithBalance(donor); const matcherContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/MarketPlace.abi`)).toString()), undefined, { from: matcherOwner, ...GAS_ARGS, @@ -119,110 +126,100 @@ describe('Matcher contract usage', () => { await helpers.methods.setSponsor(matcher.options.address, sponsor).send({from: matcherOwner}); await helpers.methods.confirmSponsorship(matcher.options.address).send({from: sponsor}); - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsorApproveTimeout: 1}); - const evmCollection = new web3.eth.Contract(nonFungibleAbi as any, collectionIdToAddress(collectionId), {from: matcherOwner}); - await setCollectionSponsorExpectSuccess(collectionId, alice.address); - await transferBalanceToEth(api, alice, subToEth(alice.address)); - await confirmSponsorshipExpectSuccess(collectionId); + const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}, pendingSponsor: alice.address}); + await collection.confirmSponsorship(alice); + await collection.addToAllowList(alice, {Substrate: aliceDoubleMirror}); + const evmCollection = new web3.eth.Contract(nonFungibleAbi as any, collectionIdToAddress(collection.collectionId), {from: matcherOwner}); + await helper.eth.transferBalanceFromSubstrate(donor, aliceMirror); - await helpers.methods.toggleAllowed(matcher.options.address, subToEth(alice.address), true).send({from: matcherOwner}); - await addToAllowListExpectSuccess(alice, collectionId, evmToAddress(subToEth(alice.address))); - const seller = privateKeyWrapper(`//Seller/${Date.now()}`); - await helpers.methods.toggleAllowed(matcher.options.address, subToEth(seller.address), true).send({from: matcherOwner}); + await helpers.methods.toggleAllowed(matcher.options.address, aliceMirror, true).send({from: matcherOwner}); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', seller.address); + await helpers.methods.toggleAllowed(matcher.options.address, sellerMirror, true).send({from: matcherOwner}); - // To transfer item to matcher it first needs to be transfered to EVM account of bob - await transferExpectSuccess(collectionId, tokenId, seller, {Ethereum: subToEth(seller.address)}); + const token = await collection.mintToken(alice, {Ethereum: sellerMirror}); // Token is owned by seller initially - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal({Ethereum: subToEthLowercase(seller.address)}); + expect(await token.getOwner()).to.be.deep.equal({Ethereum: sellerMirror}); // Ask { - await executeEthTxOnSub(web3, api, seller, evmCollection, m => m.approve(matcher.options.address, tokenId)); - await executeEthTxOnSub(web3, api, seller, matcher, m => m.addAsk(PRICE, '0x0000000000000000000000000000000000000001', evmCollection.options.address, tokenId)); + await helper.eth.sendEVM(seller, evmCollection.options.address, evmCollection.methods.approve(matcher.options.address, token.tokenId).encodeABI(), '0'); + await helper.eth.sendEVM(seller, matcher.options.address, matcher.methods.addAsk(PRICE, '0x0000000000000000000000000000000000000001', evmCollection.options.address, token.tokenId).encodeABI(), '0'); } // Token is transferred to matcher - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal({Ethereum: matcher.options.address.toLowerCase()}); + expect(await token.getOwner()).to.be.deep.equal({Ethereum: matcher.options.address.toLowerCase()}); // Give buyer KSM - await matcher.methods.depositKSM(PRICE, subToEth(alice.address)).send({from: escrow}); + await matcher.methods.depositKSM(PRICE, aliceMirror).send({from: escrow}); // Buy { - expect(await matcher.methods.balanceKSM(subToEth(seller.address)).call()).to.be.equal('0'); - expect(await matcher.methods.balanceKSM(subToEth(alice.address)).call()).to.be.equal(PRICE.toString()); + expect(await matcher.methods.balanceKSM(sellerMirror).call()).to.be.equal('0'); + expect(await matcher.methods.balanceKSM(aliceMirror).call()).to.be.equal(PRICE.toString()); - await executeEthTxOnSub(web3, api, alice, matcher, m => m.buyKSM(evmCollection.options.address, tokenId, subToEth(alice.address), subToEth(alice.address))); + await helper.eth.sendEVM(alice, matcher.options.address, matcher.methods.buyKSM(evmCollection.options.address, token.tokenId, aliceMirror, aliceMirror).encodeABI(), '0'); // Price is removed from buyer balance, and added to seller - expect(await matcher.methods.balanceKSM(subToEth(alice.address)).call()).to.be.equal('0'); - expect(await matcher.methods.balanceKSM(subToEth(seller.address)).call()).to.be.equal(PRICE.toString()); + expect(await matcher.methods.balanceKSM(aliceMirror).call()).to.be.equal('0'); + expect(await matcher.methods.balanceKSM(sellerMirror).call()).to.be.equal(PRICE.toString()); } // Token is transferred to evm account of alice - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal({Ethereum: subToEthLowercase(alice.address)}); + expect(await token.getOwner()).to.be.deep.equal({Ethereum: aliceMirror}); // Transfer token to substrate side of alice - await transferFromExpectSuccess(collectionId, tokenId, alice, {Ethereum: subToEth(alice.address)}, {Substrate: alice.address}); + await token.transferFrom(alice, {Ethereum: aliceMirror}, {Substrate: alice.address}); // Token is transferred to substrate account of alice, seller received funds - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal({Substrate: alice.address}); + expect(await token.getOwner()).to.be.deep.equal({Substrate: alice.address}); }); + itEth('Sell tokens from substrate user via EVM contract', async ({helper, privateKey}) => { + const web3 = helper.web3!; - itWeb3('Sell tokens from substrate user via EVM contract', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const matcherOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + const matcherOwner = await helper.eth.createAccountWithBalance(donor); const matcherContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/MarketPlace.abi`)).toString()), undefined, { from: matcherOwner, ...GAS_ARGS, }); const matcher = await matcherContract.deploy({data: (await readFile(`${__dirname}/MarketPlace.bin`)).toString(), arguments:[matcherOwner]}).send({from: matcherOwner}); - await transferBalanceToEth(api, alice, matcher.options.address); + await helper.eth.transferBalanceFromSubstrate(donor, matcher.options.address); - const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsorApproveTimeout: 1}); - const evmCollection = new web3.eth.Contract(nonFungibleAbi as any, collectionIdToAddress(collectionId), {from: matcherOwner}); + const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}}); + const evmCollection = new web3.eth.Contract(nonFungibleAbi as any, collectionIdToAddress(collection.collectionId), {from: matcherOwner}); - const seller = privateKeyWrapper(`//Seller/${Date.now()}`); - await transferBalanceTo(api, alice, seller.address); + await helper.balance.transferToSubstrate(donor, seller.address, 100_000_000_000_000_000_000n); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', seller.address); - - // To transfer item to matcher it first needs to be transfered to EVM account of bob - await transferExpectSuccess(collectionId, tokenId, seller, {Ethereum: subToEth(seller.address)}); + const token = await collection.mintToken(alice, {Ethereum: sellerMirror}); // Token is owned by seller initially - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal({Ethereum: subToEthLowercase(seller.address)}); + expect(await token.getOwner()).to.be.deep.equal({Ethereum: sellerMirror}); // Ask { - await executeEthTxOnSub(web3, api, seller, evmCollection, m => m.approve(matcher.options.address, tokenId)); - await executeEthTxOnSub(web3, api, seller, matcher, m => m.addAsk(PRICE, '0x0000000000000000000000000000000000000001', evmCollection.options.address, tokenId)); + await helper.eth.sendEVM(seller, evmCollection.options.address, evmCollection.methods.approve(matcher.options.address, token.tokenId).encodeABI(), '0'); + await helper.eth.sendEVM(seller, matcher.options.address, matcher.methods.addAsk(PRICE, '0x0000000000000000000000000000000000000001', evmCollection.options.address, token.tokenId).encodeABI(), '0'); } // Token is transferred to matcher - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal({Ethereum: matcher.options.address.toLowerCase()}); + expect(await token.getOwner()).to.be.deep.equal({Ethereum: matcher.options.address.toLowerCase()}); // Buy { - const sellerBalanceBeforePurchase = await getBalanceSingle(api, seller.address); - await executeEthTxOnSub(web3, api, alice, matcher, m => m.buy(evmCollection.options.address, tokenId), {value: PRICE}); - expect(await getBalanceSingle(api, seller.address) - sellerBalanceBeforePurchase === PRICE); + const sellerBalanceBeforePurchase = await helper.balance.getSubstrate(seller.address); + await helper.eth.sendEVM(alice, matcher.options.address, matcher.methods.buy(evmCollection.options.address, token.tokenId).encodeABI(), PRICE.toString()); + expect(await helper.balance.getSubstrate(seller.address) - sellerBalanceBeforePurchase === PRICE); } // Token is transferred to evm account of alice - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal({Ethereum: subToEthLowercase(alice.address)}); + expect(await token.getOwner()).to.be.deep.equal({Ethereum: aliceMirror}); // Transfer token to substrate side of alice - await transferFromExpectSuccess(collectionId, tokenId, alice, {Ethereum: subToEth(alice.address)}, {Substrate: alice.address}); + await token.transferFrom(alice, {Ethereum: aliceMirror}, {Substrate: alice.address}); // Token is transferred to substrate account of alice, seller received funds - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal({Substrate: alice.address}); + expect(await token.getOwner()).to.be.deep.equal({Substrate: alice.address}); }); }); diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index e33d2c0ad5..cbc1a2e9ee 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -275,6 +275,7 @@ class UniqueEventHelper { } private static extractData(data: any, type: any): any { + if(!type) return data.toHuman(); if (['u16', 'u32'].indexOf(type.type) > -1) return data.toNumber(); if (['u64', 'u128', 'u256'].indexOf(type.type) > -1) return data.toBigInt(); if(type.hasOwnProperty('sub')) return this.extractSub(data, type.sub); From a468291dce23d08081f4af465fcab56171058a6b Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 01:58:37 +0400 Subject: [PATCH 1032/1274] Fix eslint warning --- tests/src/util/playgrounds/unique.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index cbc1a2e9ee..18ffd807ab 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -2161,7 +2161,7 @@ class StakingGroup extends HelperGroup { */ async stake(signer: TSigner, amountToStake: bigint, label?: string): Promise { if(typeof label === 'undefined') label = `${signer.address} amount: ${amountToStake}`; - const stakeResult = await this.helper.executeExtrinsic( + const _stakeResult = await this.helper.executeExtrinsic( signer, 'api.tx.appPromotion.stake', [amountToStake], true, ); @@ -2178,7 +2178,7 @@ class StakingGroup extends HelperGroup { */ async unstake(signer: TSigner, label?: string): Promise { if(typeof label === 'undefined') label = `${signer.address}`; - const unstakeResult = await this.helper.executeExtrinsic( + const _unstakeResult = await this.helper.executeExtrinsic( signer, 'api.tx.appPromotion.unstake', [], true, ); From 95b5e616af82a693112302ccf5824b8aa6f46790 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 02:51:18 +0400 Subject: [PATCH 1033/1274] Minor improvment --- tests/src/eth/marketplace/marketplace.test.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/src/eth/marketplace/marketplace.test.ts b/tests/src/eth/marketplace/marketplace.test.ts index faa5cfa881..d2cd7664e7 100644 --- a/tests/src/eth/marketplace/marketplace.test.ts +++ b/tests/src/eth/marketplace/marketplace.test.ts @@ -51,15 +51,15 @@ describe('Matcher contract usage', () => { }); itEth('With UNQ', async ({helper}) => { - const web3 = helper.web3!; - - const sponsor = await helper.eth.createAccountWithBalance(donor); + const web3 = helper.getWeb3(); const matcherOwner = await helper.eth.createAccountWithBalance(donor); const matcherContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/MarketPlace.abi`)).toString()), undefined, { from: matcherOwner, ...GAS_ARGS, }); const matcher = await matcherContract.deploy({data: (await readFile(`${__dirname}/MarketPlace.bin`)).toString(), arguments:[matcherOwner]}).send({from: matcherOwner}); + + const sponsor = await helper.eth.createAccountWithBalance(donor); const helpers = contractHelpers(web3, matcherOwner); await helpers.methods.setSponsoringMode(matcher.options.address, SponsoringMode.Allowlisted).send({from: matcherOwner}); await helpers.methods.setSponsoringRateLimit(matcher.options.address, 1).send({from: matcherOwner}); @@ -108,16 +108,16 @@ describe('Matcher contract usage', () => { }); itEth('With escrow', async ({helper}) => { - const web3 = helper.web3!; - - const sponsor = await helper.eth.createAccountWithBalance(donor); + const web3 = helper.getWeb3(); const matcherOwner = await helper.eth.createAccountWithBalance(donor); - const escrow = await helper.eth.createAccountWithBalance(donor); const matcherContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/MarketPlace.abi`)).toString()), undefined, { from: matcherOwner, ...GAS_ARGS, }); const matcher = await matcherContract.deploy({data: (await readFile(`${__dirname}/MarketPlace.bin`)).toString(), arguments: [matcherOwner]}).send({from: matcherOwner, gas: 10000000}); + + const sponsor = await helper.eth.createAccountWithBalance(donor); + const escrow = await helper.eth.createAccountWithBalance(donor); await matcher.methods.setEscrow(escrow).send({from: matcherOwner}); const helpers = contractHelpers(web3, matcherOwner); await helpers.methods.setSponsoringMode(matcher.options.address, SponsoringMode.Allowlisted).send({from: matcherOwner}); @@ -176,15 +176,15 @@ describe('Matcher contract usage', () => { expect(await token.getOwner()).to.be.deep.equal({Substrate: alice.address}); }); - itEth('Sell tokens from substrate user via EVM contract', async ({helper, privateKey}) => { - const web3 = helper.web3!; - + itEth('Sell tokens from substrate user via EVM contract', async ({helper}) => { + const web3 = helper.getWeb3(); const matcherOwner = await helper.eth.createAccountWithBalance(donor); const matcherContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/MarketPlace.abi`)).toString()), undefined, { from: matcherOwner, ...GAS_ARGS, }); const matcher = await matcherContract.deploy({data: (await readFile(`${__dirname}/MarketPlace.bin`)).toString(), arguments:[matcherOwner]}).send({from: matcherOwner}); + await helper.eth.transferBalanceFromSubstrate(donor, matcher.options.address); const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}}); From d9f54e3d760ba29075db9d306dc1a390ea65d042 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 5 Oct 2022 01:29:44 +0000 Subject: [PATCH 1034/1274] fix: try-runtime for quartz/unique --- runtime/quartz/Cargo.toml | 38 ++++++++++++++++++++++++++++++++++++++ runtime/unique/Cargo.toml | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 68f9c2b2af..486f098366 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -46,7 +46,45 @@ runtime-benchmarks = [ try-runtime = [ 'frame-try-runtime', 'frame-executive/try-runtime', + 'frame-support/try-runtime', 'frame-system/try-runtime', + 'cumulus-pallet-parachain-system/try-runtime', + 'parachain-info/try-runtime', + 'pallet-aura/try-runtime', + 'cumulus-pallet-aura-ext/try-runtime', + 'pallet-balances/try-runtime', + 'pallet-randomness-collective-flip/try-runtime', + 'pallet-timestamp/try-runtime', + 'pallet-transaction-payment/try-runtime', + 'pallet-treasury/try-runtime', + 'pallet-sudo/try-runtime', + 'orml-vesting/try-runtime', + 'orml-xtokens/try-runtime', + 'orml-tokens/try-runtime', + 'cumulus-pallet-xcmp-queue/try-runtime', + 'pallet-xcm/try-runtime', + 'cumulus-pallet-xcm/try-runtime', + 'cumulus-pallet-dmp-queue/try-runtime', + 'pallet-inflation/try-runtime', + 'pallet-unique/try-runtime', + 'pallet-unique-scheduler/try-runtime', + 'pallet-configuration/try-runtime', + 'pallet-charge-transaction/try-runtime', + 'pallet-common/try-runtime', + 'pallet-fungible/try-runtime', + 'pallet-refungible/try-runtime', + 'pallet-nonfungible/try-runtime', + 'pallet-structure/try-runtime', + 'pallet-proxy-rmrk-core/try-runtime', + 'pallet-proxy-rmrk-equip/try-runtime', + 'pallet-app-promotion/try-runtime', + 'pallet-foreign-assets/try-runtime', + 'pallet-evm/try-runtime', + 'pallet-ethereum/try-runtime', + 'pallet-evm-coder-substrate/try-runtime', + 'pallet-evm-contract-helpers/try-runtime', + 'pallet-evm-transaction-payment/try-runtime', + 'pallet-evm-migration/try-runtime', ] std = [ 'codec/std', diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 5f25c10c1a..1ce0bf67eb 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -47,7 +47,45 @@ runtime-benchmarks = [ try-runtime = [ 'frame-try-runtime', 'frame-executive/try-runtime', + 'frame-support/try-runtime', 'frame-system/try-runtime', + 'cumulus-pallet-parachain-system/try-runtime', + 'parachain-info/try-runtime', + 'pallet-aura/try-runtime', + 'cumulus-pallet-aura-ext/try-runtime', + 'pallet-balances/try-runtime', + 'pallet-randomness-collective-flip/try-runtime', + 'pallet-timestamp/try-runtime', + 'pallet-transaction-payment/try-runtime', + 'pallet-treasury/try-runtime', + 'pallet-sudo/try-runtime', + 'orml-vesting/try-runtime', + 'orml-xtokens/try-runtime', + 'orml-tokens/try-runtime', + 'cumulus-pallet-xcmp-queue/try-runtime', + 'pallet-xcm/try-runtime', + 'cumulus-pallet-xcm/try-runtime', + 'cumulus-pallet-dmp-queue/try-runtime', + 'pallet-inflation/try-runtime', + 'pallet-unique/try-runtime', + 'pallet-unique-scheduler/try-runtime', + 'pallet-configuration/try-runtime', + 'pallet-charge-transaction/try-runtime', + 'pallet-common/try-runtime', + 'pallet-fungible/try-runtime', + 'pallet-refungible/try-runtime', + 'pallet-nonfungible/try-runtime', + 'pallet-structure/try-runtime', + 'pallet-proxy-rmrk-core/try-runtime', + 'pallet-proxy-rmrk-equip/try-runtime', + 'pallet-app-promotion/try-runtime', + 'pallet-foreign-assets/try-runtime', + 'pallet-evm/try-runtime', + 'pallet-ethereum/try-runtime', + 'pallet-evm-coder-substrate/try-runtime', + 'pallet-evm-contract-helpers/try-runtime', + 'pallet-evm-transaction-payment/try-runtime', + 'pallet-evm-migration/try-runtime', ] std = [ 'codec/std', From 8b875cb25e996e836a040272aae6ae29e20d0b7d Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 5 Oct 2022 01:29:44 +0000 Subject: [PATCH 1035/1274] fix: try-runtime for quartz/unique --- runtime/quartz/Cargo.toml | 38 ++++++++++++++++++++++++++++++++++++++ runtime/unique/Cargo.toml | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 68f9c2b2af..486f098366 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -46,7 +46,45 @@ runtime-benchmarks = [ try-runtime = [ 'frame-try-runtime', 'frame-executive/try-runtime', + 'frame-support/try-runtime', 'frame-system/try-runtime', + 'cumulus-pallet-parachain-system/try-runtime', + 'parachain-info/try-runtime', + 'pallet-aura/try-runtime', + 'cumulus-pallet-aura-ext/try-runtime', + 'pallet-balances/try-runtime', + 'pallet-randomness-collective-flip/try-runtime', + 'pallet-timestamp/try-runtime', + 'pallet-transaction-payment/try-runtime', + 'pallet-treasury/try-runtime', + 'pallet-sudo/try-runtime', + 'orml-vesting/try-runtime', + 'orml-xtokens/try-runtime', + 'orml-tokens/try-runtime', + 'cumulus-pallet-xcmp-queue/try-runtime', + 'pallet-xcm/try-runtime', + 'cumulus-pallet-xcm/try-runtime', + 'cumulus-pallet-dmp-queue/try-runtime', + 'pallet-inflation/try-runtime', + 'pallet-unique/try-runtime', + 'pallet-unique-scheduler/try-runtime', + 'pallet-configuration/try-runtime', + 'pallet-charge-transaction/try-runtime', + 'pallet-common/try-runtime', + 'pallet-fungible/try-runtime', + 'pallet-refungible/try-runtime', + 'pallet-nonfungible/try-runtime', + 'pallet-structure/try-runtime', + 'pallet-proxy-rmrk-core/try-runtime', + 'pallet-proxy-rmrk-equip/try-runtime', + 'pallet-app-promotion/try-runtime', + 'pallet-foreign-assets/try-runtime', + 'pallet-evm/try-runtime', + 'pallet-ethereum/try-runtime', + 'pallet-evm-coder-substrate/try-runtime', + 'pallet-evm-contract-helpers/try-runtime', + 'pallet-evm-transaction-payment/try-runtime', + 'pallet-evm-migration/try-runtime', ] std = [ 'codec/std', diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 5f25c10c1a..1ce0bf67eb 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -47,7 +47,45 @@ runtime-benchmarks = [ try-runtime = [ 'frame-try-runtime', 'frame-executive/try-runtime', + 'frame-support/try-runtime', 'frame-system/try-runtime', + 'cumulus-pallet-parachain-system/try-runtime', + 'parachain-info/try-runtime', + 'pallet-aura/try-runtime', + 'cumulus-pallet-aura-ext/try-runtime', + 'pallet-balances/try-runtime', + 'pallet-randomness-collective-flip/try-runtime', + 'pallet-timestamp/try-runtime', + 'pallet-transaction-payment/try-runtime', + 'pallet-treasury/try-runtime', + 'pallet-sudo/try-runtime', + 'orml-vesting/try-runtime', + 'orml-xtokens/try-runtime', + 'orml-tokens/try-runtime', + 'cumulus-pallet-xcmp-queue/try-runtime', + 'pallet-xcm/try-runtime', + 'cumulus-pallet-xcm/try-runtime', + 'cumulus-pallet-dmp-queue/try-runtime', + 'pallet-inflation/try-runtime', + 'pallet-unique/try-runtime', + 'pallet-unique-scheduler/try-runtime', + 'pallet-configuration/try-runtime', + 'pallet-charge-transaction/try-runtime', + 'pallet-common/try-runtime', + 'pallet-fungible/try-runtime', + 'pallet-refungible/try-runtime', + 'pallet-nonfungible/try-runtime', + 'pallet-structure/try-runtime', + 'pallet-proxy-rmrk-core/try-runtime', + 'pallet-proxy-rmrk-equip/try-runtime', + 'pallet-app-promotion/try-runtime', + 'pallet-foreign-assets/try-runtime', + 'pallet-evm/try-runtime', + 'pallet-ethereum/try-runtime', + 'pallet-evm-coder-substrate/try-runtime', + 'pallet-evm-contract-helpers/try-runtime', + 'pallet-evm-transaction-payment/try-runtime', + 'pallet-evm-migration/try-runtime', ] std = [ 'codec/std', From 4ad2532d647c6350ed939e067e1cc5101cbd0929 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 10:43:55 +0400 Subject: [PATCH 1036/1274] Fix: replace old helpers with new ones --- tests/src/eth/marketplace/marketplace.test.ts | 24 ++++++++----------- tests/src/eth/util/playgrounds/index.ts | 6 +++++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/tests/src/eth/marketplace/marketplace.test.ts b/tests/src/eth/marketplace/marketplace.test.ts index d2cd7664e7..293199c611 100644 --- a/tests/src/eth/marketplace/marketplace.test.ts +++ b/tests/src/eth/marketplace/marketplace.test.ts @@ -17,14 +17,10 @@ import {usingPlaygrounds} from './../../util/playgrounds/index'; import {IKeyringPair} from '@polkadot/types/types'; import {readFile} from 'fs/promises'; -import {collectionIdToAddress, contractHelpers, GAS_ARGS, SponsoringMode} from '../util/helpers'; -import nonFungibleAbi from '../nonFungibleAbi.json'; - -import {itEth, expect} from '../util/playgrounds'; - -const PRICE = 2000n; +import {itEth, expect, SponsoringMode} from '../util/playgrounds'; describe('Matcher contract usage', () => { + const PRICE = 2000n; let donor: IKeyringPair; let alice: IKeyringPair; let aliceMirror: string; @@ -55,12 +51,12 @@ describe('Matcher contract usage', () => { const matcherOwner = await helper.eth.createAccountWithBalance(donor); const matcherContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/MarketPlace.abi`)).toString()), undefined, { from: matcherOwner, - ...GAS_ARGS, + gas: helper.eth.DEFAULT_GAS, }); const matcher = await matcherContract.deploy({data: (await readFile(`${__dirname}/MarketPlace.bin`)).toString(), arguments:[matcherOwner]}).send({from: matcherOwner}); const sponsor = await helper.eth.createAccountWithBalance(donor); - const helpers = contractHelpers(web3, matcherOwner); + const helpers = helper.ethNativeContract.contractHelpers(matcherOwner); await helpers.methods.setSponsoringMode(matcher.options.address, SponsoringMode.Allowlisted).send({from: matcherOwner}); await helpers.methods.setSponsoringRateLimit(matcher.options.address, 1).send({from: matcherOwner}); @@ -70,7 +66,7 @@ describe('Matcher contract usage', () => { const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}, pendingSponsor: alice.address}); await collection.confirmSponsorship(alice); await collection.addToAllowList(alice, {Substrate: aliceDoubleMirror}); - const evmCollection = new web3.eth.Contract(nonFungibleAbi as any, collectionIdToAddress(collection.collectionId), {from: matcherOwner}); + const evmCollection = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft'); await helper.eth.transferBalanceFromSubstrate(donor, aliceMirror); await helpers.methods.toggleAllowed(matcher.options.address, aliceMirror, true).send({from: matcherOwner}); @@ -112,14 +108,14 @@ describe('Matcher contract usage', () => { const matcherOwner = await helper.eth.createAccountWithBalance(donor); const matcherContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/MarketPlace.abi`)).toString()), undefined, { from: matcherOwner, - ...GAS_ARGS, + gas: helper.eth.DEFAULT_GAS, }); const matcher = await matcherContract.deploy({data: (await readFile(`${__dirname}/MarketPlace.bin`)).toString(), arguments: [matcherOwner]}).send({from: matcherOwner, gas: 10000000}); const sponsor = await helper.eth.createAccountWithBalance(donor); const escrow = await helper.eth.createAccountWithBalance(donor); await matcher.methods.setEscrow(escrow).send({from: matcherOwner}); - const helpers = contractHelpers(web3, matcherOwner); + const helpers = helper.ethNativeContract.contractHelpers(matcherOwner); await helpers.methods.setSponsoringMode(matcher.options.address, SponsoringMode.Allowlisted).send({from: matcherOwner}); await helpers.methods.setSponsoringRateLimit(matcher.options.address, 1).send({from: matcherOwner}); @@ -129,7 +125,7 @@ describe('Matcher contract usage', () => { const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}, pendingSponsor: alice.address}); await collection.confirmSponsorship(alice); await collection.addToAllowList(alice, {Substrate: aliceDoubleMirror}); - const evmCollection = new web3.eth.Contract(nonFungibleAbi as any, collectionIdToAddress(collection.collectionId), {from: matcherOwner}); + const evmCollection = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft'); await helper.eth.transferBalanceFromSubstrate(donor, aliceMirror); @@ -181,14 +177,14 @@ describe('Matcher contract usage', () => { const matcherOwner = await helper.eth.createAccountWithBalance(donor); const matcherContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/MarketPlace.abi`)).toString()), undefined, { from: matcherOwner, - ...GAS_ARGS, + gas: helper.eth.DEFAULT_GAS, }); const matcher = await matcherContract.deploy({data: (await readFile(`${__dirname}/MarketPlace.bin`)).toString(), arguments:[matcherOwner]}).send({from: matcherOwner}); await helper.eth.transferBalanceFromSubstrate(donor, matcher.options.address); const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}}); - const evmCollection = new web3.eth.Contract(nonFungibleAbi as any, collectionIdToAddress(collection.collectionId), {from: matcherOwner}); + const evmCollection = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft'); await helper.balance.transferToSubstrate(donor, seller.address, 100_000_000_000_000_000_000n); diff --git a/tests/src/eth/util/playgrounds/index.ts b/tests/src/eth/util/playgrounds/index.ts index 1a3d986076..5c5b587025 100644 --- a/tests/src/eth/util/playgrounds/index.ts +++ b/tests/src/eth/util/playgrounds/index.ts @@ -18,6 +18,12 @@ chai.use(chaiAsPromised); chai.use(chaiLike); export const expect = chai.expect; +export enum SponsoringMode { + Disabled = 0, + Allowlisted = 1, + Generous = 2, +} + export const usingEthPlaygrounds = async (code: (helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { const silentConsole = new SilentConsole(); silentConsole.enable(); From 09dc1ff93b78de548e2dcb6a0ab977ce04ea848f Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 29 Sep 2022 17:15:49 +0000 Subject: [PATCH 1037/1274] refactor: eth tokenProperties --- tests/src/eth/tokenProperties.test.ts | 152 +++++++++++++------------- 1 file changed, 79 insertions(+), 73 deletions(-) diff --git a/tests/src/eth/tokenProperties.test.ts b/tests/src/eth/tokenProperties.test.ts index c04814f16f..2c43525029 100644 --- a/tests/src/eth/tokenProperties.test.ts +++ b/tests/src/eth/tokenProperties.test.ts @@ -1,94 +1,100 @@ -import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess} from '../util/helpers'; -import {cartesian, collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3} from './util/helpers'; -import nonFungibleAbi from './nonFungibleAbi.json'; -import {expect} from 'chai'; -import {executeTransaction} from '../substrate/substrate-api'; - -describe('EVM token properties', () => { - itWeb3('Can be reconfigured', async({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); +import {cartesian} from './util/helpers'; +import {itEth, expect} from '../eth/util/playgrounds'; + +describe.only('EVM token properties', () => { + itEth('Can be reconfigured', async({helper, privateKey}) => { + const alice = privateKey('//Alice'); + const caller = await helper.eth.createAccountWithBalance(alice); + for(const [mutable,collectionAdmin, tokenOwner] of cartesian([], [false, true], [false, true], [false, true])) { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await addCollectionAdminExpectSuccess(alice, collection, {Ethereum: caller}); - - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); - + const collection = await helper.nft.mintCollection(alice, {tokenPrefix: 'ethp'}); + await collection.addAdmin(alice, {Ethereum: caller}); + + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = await helper.ethNativeContract.collection(address, 'nft', caller); + await contract.methods.setTokenPropertyPermission('testKey', mutable, collectionAdmin, tokenOwner).send({from: caller}); - const state = (await api.query.common.collectionPropertyPermissions(collection)).toJSON(); - expect(state).to.be.deep.equal({ - [web3.utils.toHex('testKey')]: {mutable, collectionAdmin, tokenOwner}, - }); + const state = await collection.getPropertyPermissions(); + expect(state).to.be.deep.equal([{ + key: 'testKey', + permission: {mutable, collectionAdmin, tokenOwner}, + }]); } }); - itWeb3('Can be set', async({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - const token = await createItemExpectSuccess(alice, collection, 'NFT'); - await executeTransaction(api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{ - key: 'testKey', - permission: { - collectionAdmin: true, - }, - }])); + itEth('Can be set', async({helper, privateKey}) => { + const alice = privateKey('//Alice'); + const caller = await helper.eth.createAccountWithBalance(alice); + const collection = await helper.nft.mintCollection(alice, { + tokenPrefix: 'ethp', + tokenPropertyPermissions: [{ + key: 'testKey', + permission: { + collectionAdmin: true, + }, + }], + }); + const token = await collection.mintToken(alice); - await addCollectionAdminExpectSuccess(alice, collection, {Ethereum: caller}); + await collection.addAdmin(alice, {Ethereum: caller}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', caller); - await contract.methods.setProperty(token, 'testKey', Buffer.from('testValue')).send({from: caller}); + await contract.methods.setProperty(token.tokenId, 'testKey', Buffer.from('testValue')).send({from: caller}); - const [{value}] = (await api.rpc.unique.tokenProperties(collection, token, ['testKey'])).toHuman()! as any; + const [{value}] = await token.getProperties(['testKey']); expect(value).to.equal('testValue'); }); - itWeb3('Can be deleted', async({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - const token = await createItemExpectSuccess(alice, collection, 'NFT'); - await executeTransaction(api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{ - key: 'testKey', - permission: { - mutable: true, - collectionAdmin: true, - }, - }])); - await executeTransaction(api, alice, api.tx.unique.setTokenProperties(collection, token, [{key: 'testKey', value: 'testValue'}])); + itEth('Can be deleted', async({helper, privateKey}) => { + const alice = privateKey('//Alice'); + const caller = await helper.eth.createAccountWithBalance(alice); + const collection = await helper.nft.mintCollection(alice, { + tokenPrefix: 'ethp', + tokenPropertyPermissions: [{ + key: 'testKey', + permission: { + mutable: true, + collectionAdmin: true, + }, + }], + }); - await addCollectionAdminExpectSuccess(alice, collection, {Ethereum: caller}); + await collection.addAdmin(alice, {Ethereum: caller}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const token = await collection.mintToken(alice); + await token.setProperties(alice, [{key: 'testKey', value: 'testValue'}]); - await contract.methods.deleteProperty(token, 'testKey').send({from: caller}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', caller); - const result = (await api.rpc.unique.tokenProperties(collection, token, ['testKey'])).toJSON()! as any; + await contract.methods.deleteProperty(token.tokenId, 'testKey').send({from: caller}); + + const result = await token.getProperties(['testKey']); expect(result.length).to.equal(0); }); - itWeb3('Can be read', async({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const caller = createEthAccount(web3); - const collection = await createCollectionExpectSuccess({mode: {type:'NFT'}}); - const token = await createItemExpectSuccess(alice, collection, 'NFT'); - - await executeTransaction(api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{ - key: 'testKey', - permission: { - collectionAdmin: true, - }, - }])); - await executeTransaction(api, alice, api.tx.unique.setTokenProperties(collection, token, [{key: 'testKey', value: 'testValue'}])); - - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); - - const value = await contract.methods.property(token, 'testKey').call(); - expect(value).to.equal(web3.utils.toHex('testValue')); + + itEth('Can be read', async({helper, privateKey}) => { + const alice = privateKey('//Alice'); + const caller = await helper.eth.createAccountWithBalance(alice); + const collection = await helper.nft.mintCollection(alice, { + tokenPrefix: 'ethp', + tokenPropertyPermissions: [{ + key: 'testKey', + permission: { + collectionAdmin: true, + }, + }], + }); + const token = await collection.mintToken(alice); + await token.setProperties(alice, [{key: 'testKey', value: 'testValue'}]); + + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', caller); + + const value = await contract.methods.property(token.tokenId, 'testKey').call(); + expect(value).to.equal(helper.getWeb3().utils.toHex('testValue')); }); }); From cd9df53a9d65d6c6839d32e01ef7c287349602fc Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 30 Sep 2022 09:45:10 +0000 Subject: [PATCH 1038/1274] refactor: use playgrounds in eth sponsoring test --- tests/src/eth/sponsoring.test.ts | 61 ++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/tests/src/eth/sponsoring.test.ts b/tests/src/eth/sponsoring.test.ts index c6ebe18768..9f0175ef2d 100644 --- a/tests/src/eth/sponsoring.test.ts +++ b/tests/src/eth/sponsoring.test.ts @@ -14,20 +14,25 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {expect} from 'chai'; -import {contractHelpers, createEthAccount, createEthAccountWithBalance, deployCollector, deployFlipper, itWeb3, SponsoringMode} from './util/helpers'; +import {SponsoringMode} from './util/helpers'; +import {itEth, expect} from '../eth/util/playgrounds'; describe('EVM sponsoring', () => { - itWeb3('Fee is deducted from contract if sponsoring is enabled', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const caller = createEthAccount(web3); - const originalCallerBalance = await web3.eth.getBalance(caller); - expect(originalCallerBalance).to.be.equal('0'); + itEth('Fee is deducted from contract if sponsoring is enabled', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); - const flipper = await deployFlipper(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const caller = await helper.eth.createAccount(); + const originalCallerBalance = await helper.balance.getEthereum(caller); + + expect(originalCallerBalance).to.be.equal(0n); + + // const flipper = await deployFlipper(web3, owner); + const flipper = await helper.eth.deployFlipper(owner); + + const helpers = helper.ethNativeContract.contractHelpers(owner); - const helpers = contractHelpers(web3, owner); await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner}); await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner}); @@ -39,27 +44,31 @@ describe('EVM sponsoring', () => { await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner}); expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.true; - const originalSponsorBalance = await web3.eth.getBalance(sponsor); - expect(originalSponsorBalance).to.be.not.equal('0'); + const originalSponsorBalance = await helper.balance.getEthereum(sponsor); + expect(originalSponsorBalance).to.be.not.equal(0n); await flipper.methods.flip().send({from: caller}); expect(await flipper.methods.getValue().call()).to.be.true; // Balance should be taken from flipper instead of caller - expect(await web3.eth.getBalance(caller)).to.be.equals(originalCallerBalance); - expect(await web3.eth.getBalance(sponsor)).to.be.not.equals(originalSponsorBalance); + expect(await helper.balance.getEthereum(caller)).to.be.equal(originalCallerBalance); + expect(await helper.balance.getEthereum(sponsor)).to.be.not.equal(originalSponsorBalance); }); - itWeb3('...but this doesn\'t applies to payable value', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const originalCallerBalance = await web3.eth.getBalance(caller); - expect(originalCallerBalance).to.be.not.equal('0'); + itEth('...but this doesn\'t applies to payable value', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const caller = await helper.eth.createAccountWithBalance(alice); + const originalCallerBalance = await helper.balance.getEthereum(caller); + + expect(originalCallerBalance).to.be.not.equal(0n); + + const collector = await helper.eth.deployCollectorContract(owner); - const collector = await deployCollector(web3, owner); + const helpers = helper.ethNativeContract.contractHelpers(owner); - const helpers = contractHelpers(web3, owner); await helpers.methods.toggleAllowlist(collector.options.address, true).send({from: owner}); await helpers.methods.toggleAllowed(collector.options.address, caller, true).send({from: owner}); @@ -71,14 +80,14 @@ describe('EVM sponsoring', () => { await helpers.methods.setSponsor(collector.options.address, sponsor).send({from: owner}); await helpers.methods.confirmSponsorship(collector.options.address).send({from: sponsor}); - const originalSponsorBalance = await web3.eth.getBalance(sponsor); - expect(originalSponsorBalance).to.be.not.equal('0'); + const originalSponsorBalance = await helper.balance.getEthereum(sponsor); + expect(originalSponsorBalance).to.be.not.equal(0n); await collector.methods.giveMoney().send({from: caller, value: '10000'}); // Balance will be taken from both caller (value) and from collector (fee) - expect(await web3.eth.getBalance(caller)).to.be.equals((BigInt(originalCallerBalance) - 10000n).toString()); - expect(await web3.eth.getBalance(sponsor)).to.be.not.equals(originalSponsorBalance); + expect(await helper.balance.getEthereum(caller)).to.be.equals((originalCallerBalance - 10000n)); + expect(await helper.balance.getEthereum(sponsor)).to.be.not.equals(originalSponsorBalance); expect(await collector.methods.getCollected().call()).to.be.equal('10000'); }); }); From 8afb146fd3b5371ddf8b66f8c9cfb35f73d2d90b Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 30 Sep 2022 10:47:24 +0000 Subject: [PATCH 1039/1274] fix: remove redundant await --- tests/src/eth/tokenProperties.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/eth/tokenProperties.test.ts b/tests/src/eth/tokenProperties.test.ts index 2c43525029..3a5a37f111 100644 --- a/tests/src/eth/tokenProperties.test.ts +++ b/tests/src/eth/tokenProperties.test.ts @@ -11,7 +11,7 @@ describe.only('EVM token properties', () => { await collection.addAdmin(alice, {Ethereum: caller}); const address = helper.ethAddress.fromCollectionId(collection.collectionId); - const contract = await helper.ethNativeContract.collection(address, 'nft', caller); + const contract = helper.ethNativeContract.collection(address, 'nft', caller); await contract.methods.setTokenPropertyPermission('testKey', mutable, collectionAdmin, tokenOwner).send({from: caller}); From 22fb1ca81266707b043a3805a0b5470b1ddb5cdc Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 30 Sep 2022 12:16:17 +0000 Subject: [PATCH 1040/1274] refactor: use playgtounds in collectionSponsoring eth test --- tests/src/eth/collectionSponsoring.test.ts | 140 +++++++++++---------- 1 file changed, 74 insertions(+), 66 deletions(-) diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index c8fc4737cf..b4cf8edc89 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -1,25 +1,22 @@ -import {addToAllowListExpectSuccess, confirmSponsorshipExpectSuccess, createCollectionExpectSuccess, enablePublicMintingExpectSuccess, getDetailedCollectionInfo, setCollectionSponsorExpectSuccess, UNIQUE} from '../util/helpers'; -import {itWeb3, createEthAccount, collectionIdToAddress, GAS_ARGS, normalizeEvents, createEthAccountWithBalance, evmCollectionHelpers, getCollectionAddressFromResult, evmCollection, ethBalanceViaSub} from './util/helpers'; -import nonFungibleAbi from './nonFungibleAbi.json'; -import {expect} from 'chai'; +import {collectionIdToAddress, normalizeEvents} from './util/helpers'; import {evmToAddress} from '@polkadot/util-crypto'; +import {itEth, expect} from '../eth/util/playgrounds'; describe('evm collection sponsoring', () => { - itWeb3('sponsors mint transactions', async ({web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); + itEth('sponsors mint transactions', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); - const collection = await createCollectionExpectSuccess(); - await setCollectionSponsorExpectSuccess(collection, alice.address); - await confirmSponsorshipExpectSuccess(collection); + const collection = await helper.nft.mintCollection(alice, {tokenPrefix: 'spnr', permissions: {mintMode: true}}); + await collection.setSponsor(alice, alice.address); + await collection.confirmSponsorship(alice); - const minter = createEthAccount(web3); - expect(await web3.eth.getBalance(minter)).to.equal('0'); + const minter = helper.eth.createAccount(); + expect(await helper.balance.getEthereum(minter)).to.equal(0n); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, collectionIdToAddress(collection), {from: minter, ...GAS_ARGS}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', minter); - await enablePublicMintingExpectSuccess(alice, collection); - await addToAllowListExpectSuccess(alice, collection, {Ethereum: minter}); + await collection.addToAllowList(alice, {Ethereum: minter}); const nextTokenId = await contract.methods.nextTokenId().call(); expect(nextTokenId).to.equal('1'); @@ -59,13 +56,16 @@ describe('evm collection sponsoring', () => { // expect(bigIntToSub(api, BigInt(sponsorTuple[1]))).to.be.eq(sponsor.address); // }); - itWeb3('Remove sponsor', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * UNIQUE)}); - const {collectionIdAddress} = await getCollectionAddressFromResult(api, result); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + itEth('Remove sponsor', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + const owner = await helper.eth.createAccountWithBalance(alice); + const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); + + let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const collectionEvm = await helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner); expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner}); @@ -80,30 +80,34 @@ describe('evm collection sponsoring', () => { expect(sponsorTuple.field_0).to.be.eq('0x0000000000000000000000000000000000000000'); }); - itWeb3('Sponsoring collection from evm address via access list', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * UNIQUE)}); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + itEth('Sponsoring collection from evm address via access list', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + const owner = await helper.eth.createAccountWithBalance(alice); + const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); + + let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); + const collectionId = helper.ethAddress.extractCollectionId(collectionIdAddress); + const collection = helper.nft.getCollectionObject(collectionId); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const collectionEvm = await helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner); + result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner}); - let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format; - expect(collectionSub.sponsorship.isUnconfirmed).to.be.true; - expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + let collectionData = (await collection.getData())!; + const ss58Format = helper.chain.getChainProperties().ss58Format; + expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor}); - collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - expect(collectionSub.sponsorship.isConfirmed).to.be.true; - expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + collectionData = (await collection.getData())!; + expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); - const user = createEthAccount(web3); + const user = helper.eth.createAccount(); const nextTokenId = await collectionEvm.methods.nextTokenId().call(); expect(nextTokenId).to.be.equal('1'); - const oldPermissions = (await getDetailedCollectionInfo(api, collectionId))!.permissions.toHuman(); + const oldPermissions = (await collection.getData())!.raw.permissions; // (await getDetailedCollectionInfo(api, collectionId))!.permissions.toHuman(); expect(oldPermissions.mintMode).to.be.false; expect(oldPermissions.access).to.be.equal('Normal'); @@ -111,12 +115,12 @@ describe('evm collection sponsoring', () => { await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner}); await collectionEvm.methods.setCollectionMintMode(true).send({from: owner}); - const newPermissions = (await getDetailedCollectionInfo(api, collectionId))!.permissions.toHuman(); + const newPermissions = (await collection.getData())!.raw.permissions; // (await getDetailedCollectionInfo(api, collectionId))!.permissions.toHuman(); expect(newPermissions.mintMode).to.be.true; expect(newPermissions.access).to.be.equal('AllowList'); - const ownerBalanceBefore = await ethBalanceViaSub(api, owner); - const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor); + const ownerBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(owner)); + const sponsorBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor)); { const nextTokenId = await collectionEvm.methods.nextTokenId().call(); @@ -140,8 +144,8 @@ describe('evm collection sponsoring', () => { }, ]); - const ownerBalanceAfter = await ethBalanceViaSub(api, owner); - const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor); + const ownerBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(owner)); + const sponsorBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor)); expect(await collectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); expect(ownerBalanceBefore).to.be.eq(ownerBalanceAfter); @@ -205,33 +209,37 @@ describe('evm collection sponsoring', () => { // } // }); - itWeb3('Check that transaction via EVM spend money from sponsor address', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionHelpers = evmCollectionHelpers(web3, owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * UNIQUE)}); - const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collectionEvm = evmCollection(web3, owner, collectionIdAddress); + itEth('Check that transaction via EVM spend money from sponsor address', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + const owner = await helper.eth.createAccountWithBalance(alice); + const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); + + let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); + const collectionId = helper.ethAddress.extractCollectionId(collectionIdAddress); + const collection = helper.nft.getCollectionObject(collectionId); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const collectionEvm = await helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner); + result = await collectionEvm.methods.setCollectionSponsor(sponsor).send(); - let collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - const ss58Format = (api.registry.getChainProperties())!.toJSON().ss58Format; - expect(collectionSub.sponsorship.isUnconfirmed).to.be.true; - expect(collectionSub.sponsorship.asUnconfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + let collectionData = (await collection.getData())!; + const ss58Format = helper.chain.getChainProperties().ss58Format; + expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); - const sponsorCollection = evmCollection(web3, sponsor, collectionIdAddress); + + const sponsorCollection = await helper.ethNativeContract.collection(collectionIdAddress, 'nft', sponsor); await sponsorCollection.methods.confirmCollectionSponsorship().send(); - collectionSub = (await getDetailedCollectionInfo(api, collectionId))!; - expect(collectionSub.sponsorship.isConfirmed).to.be.true; - expect(collectionSub.sponsorship.asConfirmed.toHuman()).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + collectionData = (await collection.getData())!; + expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); - const user = createEthAccount(web3); + const user = helper.eth.createAccount(); await collectionEvm.methods.addCollectionAdmin(user).send(); - const ownerBalanceBefore = await ethBalanceViaSub(api, owner); - const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor); - - - const userCollectionEvm = evmCollection(web3, user, collectionIdAddress); + const ownerBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(owner)); + const sponsorBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor)); + + const userCollectionEvm = await helper.ethNativeContract.collection(collectionIdAddress, 'nft', user); const nextTokenId = await userCollectionEvm.methods.nextTokenId().call(); expect(nextTokenId).to.be.equal('1'); result = await userCollectionEvm.methods.mintWithTokenURI( @@ -256,9 +264,9 @@ describe('evm collection sponsoring', () => { ]); expect(await userCollectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); - const ownerBalanceAfter = await ethBalanceViaSub(api, owner); + const ownerBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(owner)); expect(ownerBalanceAfter).to.be.eq(ownerBalanceBefore); - const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor); + const sponsorBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor)); expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; }); }); From 48cdcf7aa35b587ec18203a4e364243bffcb3065 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 3 Oct 2022 09:55:13 +0000 Subject: [PATCH 1041/1274] fix: minor fixes in eth tests --- tests/src/eth/collectionSponsoring.test.ts | 8 ++++---- tests/src/eth/tokenProperties.test.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index b4cf8edc89..a9070b4cb8 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -65,7 +65,7 @@ describe('evm collection sponsoring', () => { let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const sponsor = await helper.eth.createAccountWithBalance(alice); - const collectionEvm = await helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner); + const collectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner); expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner}); @@ -220,7 +220,7 @@ describe('evm collection sponsoring', () => { const collectionId = helper.ethAddress.extractCollectionId(collectionIdAddress); const collection = helper.nft.getCollectionObject(collectionId); const sponsor = await helper.eth.createAccountWithBalance(alice); - const collectionEvm = await helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner); + const collectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner); result = await collectionEvm.methods.setCollectionSponsor(sponsor).send(); let collectionData = (await collection.getData())!; @@ -228,7 +228,7 @@ describe('evm collection sponsoring', () => { expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); - const sponsorCollection = await helper.ethNativeContract.collection(collectionIdAddress, 'nft', sponsor); + const sponsorCollection = helper.ethNativeContract.collection(collectionIdAddress, 'nft', sponsor); await sponsorCollection.methods.confirmCollectionSponsorship().send(); collectionData = (await collection.getData())!; expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); @@ -239,7 +239,7 @@ describe('evm collection sponsoring', () => { const ownerBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(owner)); const sponsorBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor)); - const userCollectionEvm = await helper.ethNativeContract.collection(collectionIdAddress, 'nft', user); + const userCollectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', user); const nextTokenId = await userCollectionEvm.methods.nextTokenId().call(); expect(nextTokenId).to.be.equal('1'); result = await userCollectionEvm.methods.mintWithTokenURI( diff --git a/tests/src/eth/tokenProperties.test.ts b/tests/src/eth/tokenProperties.test.ts index 3a5a37f111..6e402cb7a6 100644 --- a/tests/src/eth/tokenProperties.test.ts +++ b/tests/src/eth/tokenProperties.test.ts @@ -1,7 +1,7 @@ import {cartesian} from './util/helpers'; import {itEth, expect} from '../eth/util/playgrounds'; -describe.only('EVM token properties', () => { +describe('EVM token properties', () => { itEth('Can be reconfigured', async({helper, privateKey}) => { const alice = privateKey('//Alice'); const caller = await helper.eth.createAccountWithBalance(alice); From a4fc74116913fa561e8d531025c9dfb738218b09 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 3 Oct 2022 09:55:31 +0000 Subject: [PATCH 1042/1274] fix: draft fix of contractSponsoring --- tests/src/eth/contractSponsoring.test.ts | 649 +++++++++++++++-------- 1 file changed, 419 insertions(+), 230 deletions(-) diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index 7447552cdf..a0d3012ee1 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -15,43 +15,47 @@ // along with Unique Network. If not, see . import * as solc from 'solc'; -import {expect} from 'chai'; import {expectSubstrateEventsAtBlock} from '../util/helpers'; import Web3 from 'web3'; import { - contractHelpers, - createEthAccountWithBalance, - transferBalanceToEth, - deployFlipper, - itWeb3, SponsoringMode, - createEthAccount, - ethBalanceViaSub, normalizeEvents, CompiledContract, GAS_ARGS, - subToEth, + contractHelpers, + createEthAccountWithBalance, } from './util/helpers'; -import {submitTransactionAsync} from '../substrate/substrate-api'; +import {itEth, expect} from '../eth/util/playgrounds'; + + +describe.only('Sponsoring EVM contracts', () => { + itEth('Self sponsored can be set by the address that deployed the contract', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const flipper = await helper.eth.deployFlipper(owner); + const helpers = helper.ethNativeContract.contractHelpers(owner); -describe('Sponsoring EVM contracts', () => { - itWeb3('Self sponsored can be set by the address that deployed the contract', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; await expect(helpers.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; }); - itWeb3('Set self sponsored events', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Set self sponsored events', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const flipper = await helper.eth.deployFlipper(owner); + const helpers = helper.ethNativeContract.contractHelpers(owner); const result = await helpers.methods.selfSponsoredEnable(flipper.options.address).send(); - // console.log(result); const ethEvents = normalizeEvents(result.events); expect(ethEvents).to.be.deep.equal([ { @@ -72,58 +76,92 @@ describe('Sponsoring EVM contracts', () => { }, ]); + // TODO use helper.getApi() from the sceduler PR await expectSubstrateEventsAtBlock( - api, + helper.api!, result.blockNumber, 'evmContractHelpers', ['ContractSponsorSet','ContractSponsorshipConfirmed'], ); }); - itWeb3('Self sponsored can not be set by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Self sponsored can not be set by the address that did not deployed the contract', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const helpers = contractHelpers(web3, owner); + // const flipper = await deployFlipper(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const notOwner = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; await expect(helpers.methods.selfSponsoredEnable(flipper.options.address).call({from: notOwner})).to.be.rejectedWith('NoPermission'); expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; }); - itWeb3('Sponsoring can be set by the address that has deployed the contract', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth.only('Sponsoring can be set by the address that has deployed the contract', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); + expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; await expect(helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Allowlisted).send({from: owner})).to.be.not.rejected; expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.true; }); - itWeb3('Sponsoring cannot be set by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Sponsoring cannot be set by the address that did not deployed the contract', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const notOwner = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); + expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; await expect(helpers.methods.setSponsoringMode(notOwner, SponsoringMode.Allowlisted).call({from: notOwner})).to.be.rejectedWith('NoPermission'); expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; }); - itWeb3('Sponsor can be set by the address that deployed the contract', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Sponsor can be set by the address that deployed the contract', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); + expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.false; await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected; expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.true; }); - itWeb3('Set sponsor event', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Set sponsor event', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); const result = await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); const events = normalizeEvents(result.events); @@ -138,41 +176,64 @@ describe('Sponsoring EVM contracts', () => { }, ]); + // TODO use helper.getApi() from the sceduler PR await expectSubstrateEventsAtBlock( - api, + helper.api!, result.blockNumber, 'evmContractHelpers', ['ContractSponsorSet'], ); }); - itWeb3('Sponsor can not be set by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Sponsor can not be set by the address that did not deployed the contract', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const notOwner = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); + expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.false; await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).call({from: notOwner})).to.be.rejectedWith('NoPermission'); expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.false; }); - itWeb3('Sponsorship can be confirmed by the address that pending as sponsor', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Sponsorship can be confirmed by the address that pending as sponsor', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected; await expect(helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor})).to.be.not.rejected; expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; }); - itWeb3('Confirm sponsorship event', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Confirm sponsorship event', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); + await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected; const result = await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); const events = normalizeEvents(result.events); @@ -187,40 +248,62 @@ describe('Sponsoring EVM contracts', () => { }, ]); + // TODO use helper.getApi() from the sceduler PR await expectSubstrateEventsAtBlock( - api, + helper.api!, result.blockNumber, 'evmContractHelpers', ['ContractSponsorshipConfirmed'], ); }); - itWeb3('Sponsorship can not be confirmed by the address that not pending as sponsor', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const notSponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Sponsorship can not be confirmed by the address that not pending as sponsor', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const notSponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const notSponsor = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected; await expect(helpers.methods.confirmSponsorship(flipper.options.address).call({from: notSponsor})).to.be.rejectedWith('NoPermission'); expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; }); - itWeb3('Sponsorship can not be confirmed by the address that not set as sponsor', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const notSponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Sponsorship can not be confirmed by the address that not set as sponsor', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const notSponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const notSponsor = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); + expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; await expect(helpers.methods.confirmSponsorship(flipper.options.address).call({from: notSponsor})).to.be.rejectedWith('NoPendingSponsor'); expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; }); - itWeb3('Get self sponsored sponsor', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Get self sponsored sponsor', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const flipper = helper.ethNativeContract.contractHelpers(owner); + const helpers = helper.ethNativeContract.contractHelpers(owner); + await helpers.methods.selfSponsoredEnable(flipper.options.address).send(); const result = await helpers.methods.sponsor(flipper.options.address).call(); @@ -229,11 +312,18 @@ describe('Sponsoring EVM contracts', () => { expect(result[1]).to.be.eq('0'); }); - itWeb3('Get confirmed sponsor', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Get confirmed sponsor', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); + await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); @@ -243,11 +333,17 @@ describe('Sponsoring EVM contracts', () => { expect(result[1]).to.be.eq('0'); }); - itWeb3('Sponsor can be removed by the address that deployed the contract', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Sponsor can be removed by the address that deployed the contract', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); @@ -258,11 +354,17 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; }); - itWeb3('Remove sponsor event', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Remove sponsor event', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); @@ -279,20 +381,28 @@ describe('Sponsoring EVM contracts', () => { }, ]); + // TODO use helper.getApi() from the sceduler PR await expectSubstrateEventsAtBlock( - api, + helper.api!, result.blockNumber, 'evmContractHelpers', ['ContractSponsorRemoved'], ); }); - itWeb3('Sponsor can not be removed by the address that did not deployed the contract', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Sponsor can not be removed by the address that did not deployed the contract', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const notOwner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); @@ -303,14 +413,19 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; }); - itWeb3('In generous mode, non-allowlisted user transaction will be sponsored', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - - const flipper = await deployFlipper(web3, owner); + itEth('In generous mode, non-allowlisted user transaction will be sponsored', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); - const helpers = contractHelpers(web3, owner); + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const caller = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); @@ -318,57 +433,66 @@ describe('Sponsoring EVM contracts', () => { await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: owner}); await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner}); - const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor); - const callerBalanceBefore = await ethBalanceViaSub(api, caller); + const sponsorBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor)); + const callerBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(caller)); await flipper.methods.flip().send({from: caller}); expect(await flipper.methods.getValue().call()).to.be.true; // Balance should be taken from sponsor instead of caller - const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor); - const callerBalanceAfter = await ethBalanceViaSub(api, caller); + const sponsorBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor)); + const callerBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(caller)); expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; expect(callerBalanceAfter).to.be.eq(callerBalanceBefore); }); - itWeb3('In generous mode, non-allowlisted user transaction will be self sponsored', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); + itEth('In generous mode, non-allowlisted user transaction will be self sponsored', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - - const flipper = await deployFlipper(web3, owner); - - const helpers = contractHelpers(web3, owner); + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const caller = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); await helpers.methods.selfSponsoredEnable(flipper.options.address).send(); await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: owner}); await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner}); - await transferBalanceToEth(api, alice, flipper.options.address); + // await transferBalanceToEth(api, alice, flipper.options.address); + await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address); - const contractBalanceBefore = await ethBalanceViaSub(api, flipper.options.address); - const callerBalanceBefore = await ethBalanceViaSub(api, caller); + const contractBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(flipper.options.address)); + const callerBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(caller)); await flipper.methods.flip().send({from: caller}); expect(await flipper.methods.getValue().call()).to.be.true; // Balance should be taken from sponsor instead of caller - const contractBalanceAfter = await ethBalanceViaSub(api, flipper.options.address); - const callerBalanceAfter = await ethBalanceViaSub(api, caller); + const contractBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(flipper.options.address)); + const callerBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(caller)); expect(contractBalanceAfter < contractBalanceBefore).to.be.true; expect(callerBalanceAfter).to.be.eq(callerBalanceBefore); }); - itWeb3('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should decrease (allowlisted)', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const caller = createEthAccount(web3); + itEth('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should decrease (allowlisted)', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); - const flipper = await deployFlipper(web3, owner); + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const caller = createEthAccount(web3); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const caller = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); - const helpers = contractHelpers(web3, owner); await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner}); await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner}); @@ -378,51 +502,61 @@ describe('Sponsoring EVM contracts', () => { await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); - const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor); + const sponsorBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor)); expect(sponsorBalanceBefore).to.be.not.equal('0'); await flipper.methods.flip().send({from: caller}); expect(await flipper.methods.getValue().call()).to.be.true; // Balance should be taken from flipper instead of caller - const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor); + const sponsorBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor)); expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; }); - itWeb3('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should not decrease (non-allowlisted)', async ({api, web3, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const caller = createEthAccount(web3); + itEth('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should not decrease (non-allowlisted)', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); - const flipper = await deployFlipper(web3, owner); - - const helpers = contractHelpers(web3, owner); + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const caller = createEthAccount(web3); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const caller = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Allowlisted).send({from: owner}); await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner}); - await transferBalanceToEth(api, alice, flipper.options.address); + // await transferBalanceToEth(api, alice, flipper.options.address); + await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address); - const originalFlipperBalance = await web3.eth.getBalance(flipper.options.address); + const originalFlipperBalance = await helper.balance.getEthereum(flipper.options.address); // await web3.eth.getBalance(flipper.options.address); expect(originalFlipperBalance).to.be.not.equal('0'); await expect(flipper.methods.flip().send({from: caller})).to.be.rejectedWith(/InvalidTransaction::Payment/); expect(await flipper.methods.getValue().call()).to.be.false; // Balance should be taken from flipper instead of caller - const balanceAfter = await web3.eth.getBalance(flipper.options.address); - expect(+balanceAfter).to.be.equals(+originalFlipperBalance); + // FIXME the comment is wrong! What check should be here? + const balanceAfter = await helper.balance.getEthereum(flipper.options.address); // await web3.eth.getBalance(flipper.options.address); + expect(balanceAfter).to.be.equals(originalFlipperBalance); }); - itWeb3('Sponsoring is set, an address that has UNQ can send a transaction and it works. User balance should not change', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('Sponsoring is set, an address that has UNQ can send a transaction and it works. User balance should not change', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); - const flipper = await deployFlipper(web3, owner); + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const caller = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); - const helpers = contractHelpers(web3, owner); await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner}); await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner}); @@ -432,27 +566,33 @@ describe('Sponsoring EVM contracts', () => { await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); - const sponsorBalanceBefore = await ethBalanceViaSub(api, sponsor); - const callerBalanceBefore = await ethBalanceViaSub(api, caller); + const sponsorBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor)); + const callerBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(caller)); await flipper.methods.flip().send({from: caller}); expect(await flipper.methods.getValue().call()).to.be.true; - const sponsorBalanceAfter = await ethBalanceViaSub(api, sponsor); - const callerBalanceAfter = await ethBalanceViaSub(api, caller); + const sponsorBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor)); + const callerBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(caller)); expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; expect(callerBalanceAfter).to.be.equals(callerBalanceBefore); }); - itWeb3('Sponsoring is limited, with setContractRateLimit. The limitation is working if transactions are sent more often, the sender pays the commission.', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const originalCallerBalance = await web3.eth.getBalance(caller); - - const flipper = await deployFlipper(web3, owner); - - const helpers = contractHelpers(web3, owner); + itEth('Sponsoring is limited, with setContractRateLimit. The limitation is working if transactions are sent more often, the sender pays the commission.', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const caller = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); + + const originalCallerBalance = await helper.balance.getEthereum(caller); // await web3.eth.getBalance(caller); await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner}); await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner}); @@ -462,26 +602,32 @@ describe('Sponsoring EVM contracts', () => { await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); - const originalFlipperBalance = await web3.eth.getBalance(sponsor); + const originalFlipperBalance = await helper.balance.getEthereum(sponsor); // await web3.eth.getBalance(sponsor); expect(originalFlipperBalance).to.be.not.equal('0'); await flipper.methods.flip().send({from: caller}); expect(await flipper.methods.getValue().call()).to.be.true; - expect(await web3.eth.getBalance(caller)).to.be.equals(originalCallerBalance); + expect(await helper.balance.getEthereum(caller)).to.be.equals(originalCallerBalance); - const newFlipperBalance = await web3.eth.getBalance(sponsor); + const newFlipperBalance = await helper.balance.getEthereum(sponsor); expect(newFlipperBalance).to.be.not.equals(originalFlipperBalance); await flipper.methods.flip().send({from: caller}); - expect(await web3.eth.getBalance(sponsor)).to.be.equal(newFlipperBalance); - expect(await web3.eth.getBalance(caller)).to.be.not.equals(originalCallerBalance); + expect(await helper.balance.getEthereum(sponsor)).to.be.equal(newFlipperBalance); + expect(await helper.balance.getEthereum(caller)).to.be.not.equals(originalCallerBalance); }); // TODO: Find a way to calculate default rate limit - itWeb3('Default rate limit equals 7200', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Default rate limit equals 7200', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); + expect(await helpers.methods.sponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200'); }); }); @@ -547,36 +693,61 @@ describe('Sponsoring Fee Limit', () => { return await testContract.deploy({data: compiled.object}).send({from: owner}); } - itWeb3('Default fee limit', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Default fee limit', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); + expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935'); }); - itWeb3('Set fee limit', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Set fee limit', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); + await helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send(); expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100'); }); - itWeb3('Negative test - set fee limit by non-owner', async ({api, web3, privateKeyWrapper}) => { - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const stranger = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const flipper = await deployFlipper(web3, owner); - const helpers = contractHelpers(web3, owner); + itEth('Negative test - set fee limit by non-owner', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const stranger = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const flipper = await deployFlipper(web3, owner); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const stranger = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = helper.ethNativeContract.contractHelpers(owner); + await expect(helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send({from: stranger})).to.be.rejected; }); - itWeb3('Negative test - check that eth transactions exceeding fee limit are not executed', async ({api, web3, privateKeyWrapper}) => { - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const user = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('Negative test - check that eth transactions exceeding fee limit are not executed', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); - const testContract = await deployTestContract(web3, owner); - const helpers = contractHelpers(web3, owner); + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const user = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const user = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); + + const testContract = await deployTestContract(helper.getWeb3(), owner); await helpers.methods.setSponsoringMode(testContract.options.address, SponsoringMode.Generous).send({from: owner}); await helpers.methods.setSponsoringRateLimit(testContract.options.address, 0).send({from: owner}); @@ -584,24 +755,29 @@ describe('Sponsoring Fee Limit', () => { await helpers.methods.setSponsor(testContract.options.address, sponsor).send(); await helpers.methods.confirmSponsorship(testContract.options.address).send({from: sponsor}); - const gasPrice = BigInt(await web3.eth.getGasPrice()); + const gasPrice = BigInt(await helper.getWeb3().eth.getGasPrice()); await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 2_000_000n * gasPrice).send(); - const originalUserBalance = await web3.eth.getBalance(user); + const originalUserBalance = await helper.balance.getEthereum(user); // await web3.eth.getBalance(user); await testContract.methods.test(100).send({from: user, gas: 2_000_000}); - expect(await web3.eth.getBalance(user)).to.be.equal(originalUserBalance); + expect(await helper.balance.getEthereum(user)).to.be.equal(originalUserBalance); await testContract.methods.test(100).send({from: user, gas: 2_100_000}); - expect(await web3.eth.getBalance(user)).to.not.be.equal(originalUserBalance); + expect(await helper.balance.getEthereum(user)).to.not.be.equal(originalUserBalance); }); - itWeb3('Negative test - check that evm.call transactions exceeding fee limit are not executed', async ({api, web3, privateKeyWrapper}) => { - const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + itEth('Negative test - check that evm.call transactions exceeding fee limit are not executed', async ({helper, privateKey}) => { + const alice = privateKey('//Alice'); + + // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + // const helpers = contractHelpers(web3, owner); + const owner = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(alice); + const helpers = helper.ethNativeContract.contractHelpers(owner); - const testContract = await deployTestContract(web3, owner); - const helpers = contractHelpers(web3, owner); + const testContract = await deployTestContract(helper.getWeb3(), owner); await helpers.methods.setSponsoringMode(testContract.options.address, SponsoringMode.Generous).send({from: owner}); await helpers.methods.setSponsoringRateLimit(testContract.options.address, 0).send({from: owner}); @@ -609,43 +785,56 @@ describe('Sponsoring Fee Limit', () => { await helpers.methods.setSponsor(testContract.options.address, sponsor).send(); await helpers.methods.confirmSponsorship(testContract.options.address).send({from: sponsor}); - const gasPrice = BigInt(await web3.eth.getGasPrice()); + const gasPrice = BigInt(await helper.getWeb3().eth.getGasPrice()); await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 2_000_000n * gasPrice).send(); - const alice = privateKeyWrapper('//Alice'); - const originalAliceBalance = (await api.query.system.account(alice.address)).data.free.toBigInt(); - - await submitTransactionAsync( + const originalAliceBalance = await helper.balance.getSubstrate(alice.address); // (await api.query.system.account(alice.address)).data.free.toBigInt(); + + // await submitTransactionAsync( + // alice, + // api.tx.evm.call( + // subToEth(alice.address), + // testContract.options.address, + // testContract.methods.test(100).encodeABI(), + // Uint8Array.from([]), + // 2_000_000n, + // gasPrice, + // null, + // null, + // [], + // ), + // ); + await helper.eth.sendEVM( alice, - api.tx.evm.call( - subToEth(alice.address), - testContract.options.address, - testContract.methods.test(100).encodeABI(), - Uint8Array.from([]), - 2_000_000n, - gasPrice, - null, - null, - [], - ), + testContract.options.address, + testContract.methods.test().encodeABI(), + '100', ); - expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.be.equal(originalAliceBalance); + // expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.be.equal(originalAliceBalance); + expect(await helper.balance.getSubstrate(alice.address)).to.be.equal(originalAliceBalance); - await submitTransactionAsync( + // await submitTransactionAsync( + // alice, + // api.tx.evm.call( + // subToEth(alice.address), + // testContract.options.address, + // testContract.methods.test(100).encodeABI(), + // Uint8Array.from([]), + // 2_100_000n, + // gasPrice, + // null, + // null, + // [], + // ), + // ); + await helper.eth.sendEVM( alice, - api.tx.evm.call( - subToEth(alice.address), - testContract.options.address, - testContract.methods.test(100).encodeABI(), - Uint8Array.from([]), - 2_100_000n, - gasPrice, - null, - null, - [], - ), + testContract.options.address, + testContract.methods.test().encodeABI(), + '100', ); - expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.not.be.equal(originalAliceBalance); + // expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.not.be.equal(originalAliceBalance); + expect(await helper.balance.getSubstrate(alice.address)).to.not.be.equal(originalAliceBalance); }); }); From 535a8e928ce8e5549741179f4bee7da7ce44aaf9 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Wed, 5 Oct 2022 08:06:31 +0000 Subject: [PATCH 1043/1274] tests: introduce feed alices + refactor tests to use the filename as donor key --- tests/package.json | 29 ++-- tests/src/addCollectionAdmin.test.ts | 8 +- tests/src/adminTransferAndBurn.test.ts | 2 +- tests/src/allowLists.test.ts | 8 +- tests/src/app-promotion.test.ts | 4 +- tests/src/approve.test.ts | 22 +-- tests/src/burnItem.test.ts | 6 +- tests/src/change-collection-owner.test.ts | 6 +- tests/src/check-event/burnItemEvent.test.ts | 2 +- .../check-event/createCollectionEvent.test.ts | 2 +- tests/src/check-event/createItemEvent.test.ts | 2 +- .../createMultipleItemsEvent.test.ts | 2 +- .../destroyCollectionEvent.test.ts | 2 +- tests/src/check-event/transferEvent.test.ts | 2 +- .../src/check-event/transferFromEvent.test.ts | 2 +- tests/src/confirmSponsorship.test.ts | 4 +- tests/src/createCollection.test.ts | 4 +- tests/src/createItem.test.ts | 4 +- tests/src/createMultipleItems.test.ts | 4 +- tests/src/createMultipleItemsEx.test.ts | 4 +- tests/src/creditFeesToTreasury.test.ts | 2 +- tests/src/destroyCollection.test.ts | 4 +- tests/src/enableDisableTransfer.test.ts | 4 +- tests/src/eth/allowlist.test.ts | 4 +- tests/src/eth/base.test.ts | 4 +- tests/src/eth/collectionAdmin.test.ts | 8 +- tests/src/eth/collectionProperties.test.ts | 18 ++- tests/src/eth/createNFTCollection.test.ts | 4 +- tests/src/eth/createRFTCollection.test.ts | 4 +- tests/src/eth/crossTransfer.test.ts | 4 +- .../eth/fractionalizer/fractionalizer.test.ts | 4 +- tests/src/eth/fungible.test.ts | 8 +- tests/src/eth/helpersSmoke.test.ts | 2 +- tests/src/eth/migration.test.ts | 2 +- tests/src/eth/nesting/nest.test.ts | 2 +- tests/src/eth/nonFungible.test.ts | 12 +- tests/src/eth/payable.test.ts | 8 +- tests/src/eth/proxy/fungibleProxy.test.ts | 4 +- tests/src/eth/proxy/nonFungibleProxy.test.ts | 6 +- tests/src/eth/reFungible.test.ts | 8 +- tests/src/eth/reFungibleToken.test.ts | 12 +- tests/src/eth/tokenProperties.test.ts | 128 ++++++++++-------- tests/src/eth/util/playgrounds/index.ts | 45 ++++-- tests/src/evmCoder.test.ts | 2 +- tests/src/fungible.test.ts | 9 +- tests/src/getPropertiesRpc.test.ts | 2 +- tests/src/inflation.test.ts | 2 +- tests/src/limits.test.ts | 12 +- tests/src/nesting/graphs.test.ts | 2 +- tests/src/nesting/nest.test.ts | 6 +- tests/src/nesting/properties.test.ts | 16 +-- tests/src/nesting/unnest.test.ts | 4 +- tests/src/nextSponsoring.test.ts | 2 +- tests/src/refungible.test.ts | 9 +- tests/src/removeCollectionAdmin.test.ts | 4 +- tests/src/removeCollectionSponsor.test.ts | 4 +- tests/src/rpc.test.ts | 2 +- tests/src/setCollectionLimits.test.ts | 4 +- tests/src/setCollectionSponsor.test.ts | 4 +- tests/src/setPermissions.test.ts | 4 +- tests/src/transfer.test.ts | 10 +- tests/src/transferFrom.test.ts | 4 +- tests/src/util/playgrounds/feedAlices.ts | 77 +++++++++++ tests/src/util/playgrounds/index.ts | 40 ++++-- 64 files changed, 404 insertions(+), 231 deletions(-) create mode 100644 tests/src/util/playgrounds/feedAlices.ts diff --git a/tests/package.json b/tests/package.json index b3a793d87e..3e54ba89f5 100644 --- a/tests/package.json +++ b/tests/package.json @@ -26,24 +26,25 @@ "scripts": { "lint": "eslint --ext .ts,.js src/", "fix": "eslint --ext .ts,.js src/ --fix", - "test": "mocha --timeout 9999999 -r ts-node/register './src/**/*.test.ts'", - "testEth": "mocha --timeout 9999999 -r ts-node/register './**/eth/**/*.test.ts'", - "testEthMarketplace": "mocha --timeout 9999999 -r ts-node/register './**/eth/marketplace/**/*.test.ts'", - "testEthNesting": "mocha --timeout 9999999 -r ts-node/register './**/eth/nesting/**/*.test.ts'", - "testEthFractionalizer": "mocha --timeout 9999999 -r ts-node/register './**/eth/fractionalizer/**/*.test.ts'", + "feedAlices": "ts-node ./src/util/playgrounds/feedAlices.ts", + + "test": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register './src/**/*.test.ts'", + "testStructure": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register ./**/nesting/**.test.ts", + "testEth": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/**/*.test.ts'", + "testEthNesting": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/nesting/**/*.test.ts'", + "testEthFractionalizer": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/fractionalizer/**/*.test.ts'", + "testEthMarketplace": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/marketplace/**/*.test.ts'", + "testCollision": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register ./src/collision-tests/*.test.ts", + "testEvent": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register ./src/check-event/*.test.ts", + "testRmrk": "mocha --timeout 9999999 -r ts-node/register ./**/rmrk/**.test.ts", + "testEthPayable": "mocha --timeout 9999999 -r ts-node/register './**/eth/payable.test.ts'", - "load": "mocha --timeout 9999999 -r ts-node/register './**/*.load.ts'", - "loadTransfer": "ts-node src/transfer.nload.ts", - "testCollision": "mocha --timeout 9999999 -r ts-node/register ./src/collision-tests/*.test.ts", - "testEvent": "mocha --timeout 9999999 -r ts-node/register ./src/check-event/*.test.ts", + "testEthTokenProperties": "mocha --timeout 9999999 -r ts-node/register ./**/eth/tokenProperties.test.ts", "testNesting": "mocha --timeout 9999999 -r ts-node/register ./**/nest.test.ts", "testUnnesting": "mocha --timeout 9999999 -r ts-node/register ./**/unnest.test.ts", - "testStructure": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/**.test.ts", "testProperties": "mocha --timeout 9999999 -r ts-node/register ./**/properties.test.ts ./**/getPropertiesRpc.test.ts", "testMigration": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/migration-check.test.ts", - "testRmrk": "mocha --timeout 9999999 -r ts-node/register ./**/rmrk/**.test.ts", "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts", - "testSetSchemaVersion": "mocha --timeout 9999999 -r ts-node/register ./**/setSchemaVersion.test.ts", "testSetCollectionLimits": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionLimits.test.ts", "testChangeCollectionOwner": "mocha --timeout 9999999 -r ts-node/register ./**/change-collection-owner.test.ts", "testSetCollectionSponsor": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionSponsor.test.ts", @@ -96,6 +97,10 @@ "testEthFT": "mocha --timeout 9999999 -r ts-node/register ./**/eth/fungible.test.ts", "testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts", "testPromotion": "mocha --timeout 9999999 -r ts-node/register ./**/app-promotion.test.ts", + + "load": "mocha --timeout 9999999 -r ts-node/register './**/*.load.ts'", + "loadTransfer": "ts-node src/transfer.nload.ts", + "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", "polkadot-types-from-defs": "ts-node ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .", "polkadot-types-from-chain": "ts-node ./node_modules/.bin/polkadot-types-from-chain --endpoint src/interfaces/metadata.json --output src/interfaces/ --package .", diff --git a/tests/src/addCollectionAdmin.test.ts b/tests/src/addCollectionAdmin.test.ts index 3d6a4e92e0..e5b2496d98 100644 --- a/tests/src/addCollectionAdmin.test.ts +++ b/tests/src/addCollectionAdmin.test.ts @@ -21,8 +21,8 @@ describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () let donor: IKeyringPair; before(async () => { - await usingPlaygrounds(async (_, privateKeyWrapper) => { - donor = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (_, privateKey) => { + donor = await privateKey({filename: __filename}); }); }); @@ -44,8 +44,8 @@ describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_ let donor: IKeyringPair; before(async () => { - await usingPlaygrounds(async (_, privateKeyWrapper) => { - donor = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (_, privateKey) => { + donor = await privateKey({filename: __filename}); }); }); diff --git a/tests/src/adminTransferAndBurn.test.ts b/tests/src/adminTransferAndBurn.test.ts index a5cd6a2574..e5af146b0a 100644 --- a/tests/src/adminTransferAndBurn.test.ts +++ b/tests/src/adminTransferAndBurn.test.ts @@ -24,7 +24,7 @@ describe('Integration Test: ownerCanTransfer allows admins to use only transferF before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); }); diff --git a/tests/src/allowLists.test.ts b/tests/src/allowLists.test.ts index 9d610b6d2c..3e219c2f29 100644 --- a/tests/src/allowLists.test.ts +++ b/tests/src/allowLists.test.ts @@ -25,7 +25,7 @@ describe('Integration Test ext. Allow list tests', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([30n, 10n, 10n], donor); }); }); @@ -87,7 +87,7 @@ describe('Integration Test ext. Remove from Allow List', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([30n, 10n, 10n], donor); }); }); @@ -163,7 +163,7 @@ describe('Integration Test ext. Transfer if included in Allow List', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([30n, 10n, 10n], donor); }); }); @@ -291,7 +291,7 @@ describe('Integration Test ext. Mint if included in Allow List', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 76b3d6d1a3..273c170110 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -43,8 +43,8 @@ describe('App promotion', () => { before(async function () { await usingPlaygrounds(async (helper, privateKey) => { if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); - alice = privateKey('//Alice'); - palletAdmin = privateKey('//Charlie'); // TODO use custom address + alice = await privateKey({filename: __filename}); + [palletAdmin] = await helper.arrange.createAccounts([100n], alice); await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); nominal = helper.balance.getOneTokenNominal(); await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal); diff --git a/tests/src/approve.test.ts b/tests/src/approve.test.ts index 9c8eceac98..a83cf96d24 100644 --- a/tests/src/approve.test.ts +++ b/tests/src/approve.test.ts @@ -25,7 +25,7 @@ describe('Integration Test approve(spender, collection_id, item_id, amount):', ( before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); @@ -104,7 +104,7 @@ describe('Normal user can approve other users to transfer:', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); @@ -141,7 +141,7 @@ describe('Approved users can transferFrom up to approved amount:', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); @@ -184,7 +184,7 @@ describe('Approved users cannot use transferFrom to repeat transfers if approved before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); @@ -235,7 +235,7 @@ describe('Approved amount decreases by the transferred amount.:', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie, dave] = await helper.arrange.createAccounts([100n, 100n, 100n, 100n], donor); }); }); @@ -265,7 +265,7 @@ describe('User may clear the approvals to approving for 0 amount:', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); @@ -320,7 +320,7 @@ describe('User cannot approve for the amount greater than they own:', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); @@ -357,7 +357,7 @@ describe('Administrator and collection owner do not need approval in order to ex before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie, dave] = await helper.arrange.createAccounts([100n, 100n, 100n, 100n], donor); }); }); @@ -423,7 +423,7 @@ describe('Repeated approvals add up', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie, dave] = await helper.arrange.createAccounts([100n, 100n, 100n, 100n], donor); }); }); @@ -474,7 +474,7 @@ describe('Integration Test approve(spender, collection_id, item_id, amount) with before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); @@ -495,7 +495,7 @@ describe('Negative Integration Test approve(spender, collection_id, item_id, amo before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); diff --git a/tests/src/burnItem.test.ts b/tests/src/burnItem.test.ts index ddd782f8fc..050aab3c1a 100644 --- a/tests/src/burnItem.test.ts +++ b/tests/src/burnItem.test.ts @@ -25,7 +25,7 @@ describe('integration test: ext. burnItem():', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); @@ -80,7 +80,7 @@ describe('integration test: ext. burnItem() with admin permissions:', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); @@ -123,7 +123,7 @@ describe('Negative integration test: ext. burnItem():', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); diff --git a/tests/src/change-collection-owner.test.ts b/tests/src/change-collection-owner.test.ts index 97a55bdb57..4fd49c538c 100644 --- a/tests/src/change-collection-owner.test.ts +++ b/tests/src/change-collection-owner.test.ts @@ -23,7 +23,7 @@ describe('Integration Test changeCollectionOwner(collection_id, new_owner):', () before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); @@ -46,7 +46,7 @@ describe('Integration Test changeCollectionOwner(collection_id, new_owner) speci before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); @@ -108,7 +108,7 @@ describe('Negative Integration Test changeCollectionOwner(collection_id, new_own before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); diff --git a/tests/src/check-event/burnItemEvent.test.ts b/tests/src/check-event/burnItemEvent.test.ts index c37965b1e5..fc7c4f26fe 100644 --- a/tests/src/check-event/burnItemEvent.test.ts +++ b/tests/src/check-event/burnItemEvent.test.ts @@ -24,7 +24,7 @@ describe('Burn Item event ', () => { let alice: IKeyringPair; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); diff --git a/tests/src/check-event/createCollectionEvent.test.ts b/tests/src/check-event/createCollectionEvent.test.ts index 57d31b91aa..19a4766dd3 100644 --- a/tests/src/check-event/createCollectionEvent.test.ts +++ b/tests/src/check-event/createCollectionEvent.test.ts @@ -23,7 +23,7 @@ describe('Create collection event ', () => { let alice: IKeyringPair; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); diff --git a/tests/src/check-event/createItemEvent.test.ts b/tests/src/check-event/createItemEvent.test.ts index 8c3709d536..461e44fb3c 100644 --- a/tests/src/check-event/createItemEvent.test.ts +++ b/tests/src/check-event/createItemEvent.test.ts @@ -23,7 +23,7 @@ describe('Create Item event ', () => { let alice: IKeyringPair; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); diff --git a/tests/src/check-event/createMultipleItemsEvent.test.ts b/tests/src/check-event/createMultipleItemsEvent.test.ts index f0479618de..c89ac505f9 100644 --- a/tests/src/check-event/createMultipleItemsEvent.test.ts +++ b/tests/src/check-event/createMultipleItemsEvent.test.ts @@ -23,7 +23,7 @@ describe('Create Multiple Items Event event ', () => { let alice: IKeyringPair; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); diff --git a/tests/src/check-event/destroyCollectionEvent.test.ts b/tests/src/check-event/destroyCollectionEvent.test.ts index 8de5eaa8e8..0c4c94ec92 100644 --- a/tests/src/check-event/destroyCollectionEvent.test.ts +++ b/tests/src/check-event/destroyCollectionEvent.test.ts @@ -23,7 +23,7 @@ describe('Destroy collection event ', () => { let alice: IKeyringPair; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); diff --git a/tests/src/check-event/transferEvent.test.ts b/tests/src/check-event/transferEvent.test.ts index 704baa59b2..24166bf061 100644 --- a/tests/src/check-event/transferEvent.test.ts +++ b/tests/src/check-event/transferEvent.test.ts @@ -25,7 +25,7 @@ describe('Transfer event ', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); }); }); diff --git a/tests/src/check-event/transferFromEvent.test.ts b/tests/src/check-event/transferFromEvent.test.ts index 56c99174b7..c11c7cac08 100644 --- a/tests/src/check-event/transferFromEvent.test.ts +++ b/tests/src/check-event/transferFromEvent.test.ts @@ -24,7 +24,7 @@ describe('Transfer event ', () => { let bob: IKeyringPair; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); }); }); diff --git a/tests/src/confirmSponsorship.test.ts b/tests/src/confirmSponsorship.test.ts index 1c3a03cb07..f2a7d70733 100644 --- a/tests/src/confirmSponsorship.test.ts +++ b/tests/src/confirmSponsorship.test.ts @@ -37,7 +37,7 @@ describe('integration test: ext. confirmSponsorship():', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie, zeroBalance] = await helper.arrange.createAccounts([100n, 100n, 100n, 0n], donor); }); }); @@ -183,7 +183,7 @@ describe('(!negative test!) integration test: ext. confirmSponsorship():', () => before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie, ownerZeroBalance, senderZeroBalance] = await helper.arrange.createAccounts([100n, 100n, 100n, 0n, 0n], donor); }); }); diff --git a/tests/src/createCollection.test.ts b/tests/src/createCollection.test.ts index 0a3b3f22be..479f44ec5b 100644 --- a/tests/src/createCollection.test.ts +++ b/tests/src/createCollection.test.ts @@ -49,7 +49,7 @@ describe('integration test: ext. createCollection():', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([100n], donor); }); }); @@ -110,7 +110,7 @@ describe('(!negative test!) integration test: ext. createCollection():', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([100n], donor); }); }); diff --git a/tests/src/createItem.test.ts b/tests/src/createItem.test.ts index 04a41a10d8..f573b4d88f 100644 --- a/tests/src/createItem.test.ts +++ b/tests/src/createItem.test.ts @@ -50,7 +50,7 @@ describe('integration test: ext. ():', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); @@ -179,7 +179,7 @@ describe('Negative integration test: ext. createItem():', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); diff --git a/tests/src/createMultipleItems.test.ts b/tests/src/createMultipleItems.test.ts index a11e234688..d4fb0e81a8 100644 --- a/tests/src/createMultipleItems.test.ts +++ b/tests/src/createMultipleItems.test.ts @@ -22,7 +22,7 @@ describe('Integration Test createMultipleItems(collection_id, owner, items_data) before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([100n], donor); }); }); @@ -168,7 +168,7 @@ describe('Negative Integration Test createMultipleItems(collection_id, owner, it before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); diff --git a/tests/src/createMultipleItemsEx.test.ts b/tests/src/createMultipleItemsEx.test.ts index b946d080a0..36bd139ccd 100644 --- a/tests/src/createMultipleItemsEx.test.ts +++ b/tests/src/createMultipleItemsEx.test.ts @@ -25,7 +25,7 @@ describe('Integration Test: createMultipleItemsEx', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); @@ -268,7 +268,7 @@ describe('Negative test: createMultipleItemsEx', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); diff --git a/tests/src/creditFeesToTreasury.test.ts b/tests/src/creditFeesToTreasury.test.ts index 0abb647ffb..57b5f09c62 100644 --- a/tests/src/creditFeesToTreasury.test.ts +++ b/tests/src/creditFeesToTreasury.test.ts @@ -50,7 +50,7 @@ describe('integration test: Fees must be credited to Treasury:', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); diff --git a/tests/src/destroyCollection.test.ts b/tests/src/destroyCollection.test.ts index a3ae9ceaed..eadb9f2347 100644 --- a/tests/src/destroyCollection.test.ts +++ b/tests/src/destroyCollection.test.ts @@ -22,7 +22,7 @@ describe('integration test: ext. destroyCollection():', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([100n], donor); }); }); @@ -62,7 +62,7 @@ describe('(!negative test!) integration test: ext. destroyCollection():', () => before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); diff --git a/tests/src/enableDisableTransfer.test.ts b/tests/src/enableDisableTransfer.test.ts index 4f88cfc291..64d8b6a21d 100644 --- a/tests/src/enableDisableTransfer.test.ts +++ b/tests/src/enableDisableTransfer.test.ts @@ -23,7 +23,7 @@ describe('Enable/Disable Transfers', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); @@ -62,7 +62,7 @@ describe('Negative Enable/Disable Transfers', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor); }); }); diff --git a/tests/src/eth/allowlist.test.ts b/tests/src/eth/allowlist.test.ts index 560888e8c7..445f26f254 100644 --- a/tests/src/eth/allowlist.test.ts +++ b/tests/src/eth/allowlist.test.ts @@ -22,7 +22,7 @@ describe('EVM contract allowlist', () => { before(async function() { await usingEthPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); @@ -70,7 +70,7 @@ describe('EVM collection allowlist', () => { before(async function() { await usingEthPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); diff --git a/tests/src/eth/base.test.ts b/tests/src/eth/base.test.ts index 9e39c6aa08..1793bfc117 100644 --- a/tests/src/eth/base.test.ts +++ b/tests/src/eth/base.test.ts @@ -29,7 +29,7 @@ describe('Contract calls', () => { before(async function() { await usingEthPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); @@ -82,7 +82,7 @@ describe('ERC165 tests', async () => { before(async () => { await usingEthPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); const [alice] = await helper.arrange.createAccounts([10n], donor); ({collectionId: collection} = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'})); minter = helper.eth.createAccount(); diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index bab5c80bcc..7a87569ee3 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -32,7 +32,7 @@ describe('Add collection admins', () => { before(async function() { await usingEthPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); @@ -144,7 +144,7 @@ describe('Remove collection admins', () => { before(async function() { await usingEthPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); @@ -272,7 +272,7 @@ describe('Change owner tests', () => { before(async function() { await usingEthPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); @@ -314,7 +314,7 @@ describe('Change substrate owner tests', () => { before(async function() { await usingEthPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); diff --git a/tests/src/eth/collectionProperties.test.ts b/tests/src/eth/collectionProperties.test.ts index c80da4ec51..ef96611166 100644 --- a/tests/src/eth/collectionProperties.test.ts +++ b/tests/src/eth/collectionProperties.test.ts @@ -1,3 +1,19 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + import {itEth, usingEthPlaygrounds, expect} from './util/playgrounds'; import {IKeyringPair} from '@polkadot/types/types'; @@ -7,7 +23,7 @@ describe('EVM collection properties', () => { before(async function() { await usingEthPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await _helper.arrange.createAccounts([10n], donor); }); }); diff --git a/tests/src/eth/createNFTCollection.test.ts b/tests/src/eth/createNFTCollection.test.ts index 79d38fac07..facee4d109 100644 --- a/tests/src/eth/createNFTCollection.test.ts +++ b/tests/src/eth/createNFTCollection.test.ts @@ -24,7 +24,7 @@ describe('Create NFT collection from EVM', () => { before(async function() { await usingEthPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); @@ -150,7 +150,7 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { before(async function() { await usingEthPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts index dca382b410..26dca0211e 100644 --- a/tests/src/eth/createRFTCollection.test.ts +++ b/tests/src/eth/createRFTCollection.test.ts @@ -26,7 +26,7 @@ describe('Create RFT collection from EVM', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); @@ -152,7 +152,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); diff --git a/tests/src/eth/crossTransfer.test.ts b/tests/src/eth/crossTransfer.test.ts index 80e50bdee3..c2d0e9072c 100644 --- a/tests/src/eth/crossTransfer.test.ts +++ b/tests/src/eth/crossTransfer.test.ts @@ -26,7 +26,7 @@ describe('Token transfer between substrate address and EVM address. Fungible', ( before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); }); @@ -69,7 +69,7 @@ describe('Token transfer between substrate address and EVM address. NFT', () => before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); }); diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index 033431af9f..ac8a966a9c 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -85,7 +85,7 @@ describe('Fractionalizer contract usage', () => { before(async function() { await usingEthPlaygrounds(async (helper: EthUniqueHelper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); @@ -225,7 +225,7 @@ describe('Negative Integration Tests for fractionalizer', () => { before(async function() { await usingEthPlaygrounds(async (helper: EthUniqueHelper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); diff --git a/tests/src/eth/fungible.test.ts b/tests/src/eth/fungible.test.ts index 238a0f6d9a..bd843e1690 100644 --- a/tests/src/eth/fungible.test.ts +++ b/tests/src/eth/fungible.test.ts @@ -23,7 +23,7 @@ describe('Fungible: Information getting', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([20n], donor); }); }); @@ -55,7 +55,7 @@ describe('Fungible: Plain calls', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([20n], donor); }); }); @@ -224,7 +224,7 @@ describe('Fungible: Fees', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([20n], donor); }); }); @@ -277,7 +277,7 @@ describe('Fungible: Substrate calls', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([20n], donor); }); }); diff --git a/tests/src/eth/helpersSmoke.test.ts b/tests/src/eth/helpersSmoke.test.ts index 39eb5d3c2a..ec85ad499c 100644 --- a/tests/src/eth/helpersSmoke.test.ts +++ b/tests/src/eth/helpersSmoke.test.ts @@ -22,7 +22,7 @@ describe('Helpers sanity check', () => { before(async function() { await usingEthPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); diff --git a/tests/src/eth/migration.test.ts b/tests/src/eth/migration.test.ts index ee58e27e3f..d2a3762308 100644 --- a/tests/src/eth/migration.test.ts +++ b/tests/src/eth/migration.test.ts @@ -22,7 +22,7 @@ describe('EVM Migrations', () => { before(async function() { await usingEthPlaygrounds(async (_helper, privateKey) => { - superuser = privateKey('//Alice'); + superuser = await privateKey('//Alice'); }); }); diff --git a/tests/src/eth/nesting/nest.test.ts b/tests/src/eth/nesting/nest.test.ts index 10709d7864..d163795dd2 100644 --- a/tests/src/eth/nesting/nest.test.ts +++ b/tests/src/eth/nesting/nest.test.ts @@ -21,7 +21,7 @@ describe('EVM nesting tests group', () => { before(async function() { await usingEthPlaygrounds(async (_, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 823e2e4182..d055b82e39 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -25,7 +25,7 @@ describe('NFT: Information getting', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); @@ -75,7 +75,7 @@ describe('Check ERC721 token URI for NFT', () => { before(async function() { await usingEthPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); @@ -137,7 +137,7 @@ describe('NFT: Plain calls', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); @@ -318,7 +318,7 @@ describe('NFT: Fees', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); @@ -371,7 +371,7 @@ describe('NFT: Substrate calls', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([20n], donor); }); }); @@ -496,7 +496,7 @@ describe('Common metadata', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([20n], donor); }); }); diff --git a/tests/src/eth/payable.test.ts b/tests/src/eth/payable.test.ts index 0ac454a42d..d60535429c 100644 --- a/tests/src/eth/payable.test.ts +++ b/tests/src/eth/payable.test.ts @@ -23,7 +23,7 @@ describe('EVM payable contracts', () => { before(async function() { await usingEthPlaygrounds(async (_, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); @@ -68,7 +68,7 @@ describe('EVM payable contracts', () => { expect(await contract.methods.getUnaccounted().call()).to.be.equal(weiCount.toString()); }); - itEth('Balance can be retrieved from evm contract', async({helper, privateKey}) => { + itEth('Balance can be retrieved from evm contract', async({helper}) => { const FEE_BALANCE = 10n * helper.balance.getOneTokenNominal(); const CONTRACT_BALANCE = 1n * helper.balance.getOneTokenNominal(); @@ -80,7 +80,7 @@ describe('EVM payable contracts', () => { await web3.eth.sendTransaction({from: deployer, to: contract.options.address, value: CONTRACT_BALANCE.toString(), gas: helper.eth.DEFAULT_GAS}); - const receiver = privateKey(`//Receiver${Date.now()}`); + const [receiver] = await helper.arrange.createAccounts([0n], donor); // First receive balance on eth balance of bob { @@ -110,7 +110,7 @@ describe('EVM transaction fees', () => { before(async function() { await usingEthPlaygrounds(async (_, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); diff --git a/tests/src/eth/proxy/fungibleProxy.test.ts b/tests/src/eth/proxy/fungibleProxy.test.ts index 92b626497b..fc599e6245 100644 --- a/tests/src/eth/proxy/fungibleProxy.test.ts +++ b/tests/src/eth/proxy/fungibleProxy.test.ts @@ -38,7 +38,7 @@ describe('Fungible (Via EVM proxy): Information getting', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); @@ -77,7 +77,7 @@ describe('Fungible (Via EVM proxy): Plain calls', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); diff --git a/tests/src/eth/proxy/nonFungibleProxy.test.ts b/tests/src/eth/proxy/nonFungibleProxy.test.ts index 5ed9959967..4fea1354b7 100644 --- a/tests/src/eth/proxy/nonFungibleProxy.test.ts +++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts @@ -38,7 +38,7 @@ describe('NFT (Via EVM proxy): Information getting', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); @@ -95,7 +95,7 @@ describe('NFT (Via EVM proxy): Plain calls', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); @@ -139,7 +139,7 @@ describe('NFT (Via EVM proxy): Plain calls', () => { }); //TODO: CORE-302 add eth methods - itWeb3.skip('Can perform mintBulk()', async ({web3, api, privateKeyWrapper}) => { + itWeb3.skip('Can perform mintBulk()', async () => { /* const collection = await createCollectionExpectSuccess({ mode: {type: 'NFT'}, diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 01861b980d..d46816852c 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -25,7 +25,7 @@ describe('Refungible: Information getting', () => { await usingEthPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); @@ -117,7 +117,7 @@ describe('Refungible: Plain calls', () => { await usingEthPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); @@ -329,7 +329,7 @@ describe('RFT: Fees', () => { await usingEthPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); @@ -370,7 +370,7 @@ describe('Common metadata', () => { await usingEthPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([20n], donor); }); }); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index bb6a0c570b..a0a42e5918 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -28,7 +28,7 @@ describe('Refungible token: Information getting', () => { await usingEthPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([20n], donor); }); }); @@ -72,7 +72,7 @@ describe('Check ERC721 token URI for ReFungible', () => { await usingEthPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); @@ -136,7 +136,7 @@ describe('Refungible: Plain calls', () => { await usingEthPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([50n], donor); }); }); @@ -327,7 +327,7 @@ describe('Refungible: Fees', () => { await usingEthPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([50n], donor); }); }); @@ -382,7 +382,7 @@ describe('Refungible: Substrate calls', () => { await usingEthPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([50n], donor); }); }); @@ -472,7 +472,7 @@ describe('ERC 1633 implementation', () => { await usingEthPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); diff --git a/tests/src/eth/tokenProperties.test.ts b/tests/src/eth/tokenProperties.test.ts index c04814f16f..a0d477edbe 100644 --- a/tests/src/eth/tokenProperties.test.ts +++ b/tests/src/eth/tokenProperties.test.ts @@ -1,94 +1,116 @@ -import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess} from '../util/helpers'; -import {cartesian, collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3} from './util/helpers'; -import nonFungibleAbi from './nonFungibleAbi.json'; -import {expect} from 'chai'; -import {executeTransaction} from '../substrate/substrate-api'; +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import {itEth, usingEthPlaygrounds, expect, cartesian} from './util/playgrounds'; +import {IKeyringPair} from '@polkadot/types/types'; describe('EVM token properties', () => { - itWeb3('Can be reconfigured', async({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); + let donor: IKeyringPair; + let alice: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = await privateKey({filename: __filename}); + [alice] = await helper.arrange.createAccounts([100n], donor); + }); + }); + + itEth('Can be reconfigured', async({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); for(const [mutable,collectionAdmin, tokenOwner] of cartesian([], [false, true], [false, true], [false, true])) { - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - await addCollectionAdminExpectSuccess(alice, collection, {Ethereum: caller}); + const collection = await helper.nft.mintCollection(alice); + await collection.addAdmin(alice, {Ethereum: caller}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', caller); await contract.methods.setTokenPropertyPermission('testKey', mutable, collectionAdmin, tokenOwner).send({from: caller}); - const state = (await api.query.common.collectionPropertyPermissions(collection)).toJSON(); - expect(state).to.be.deep.equal({ - [web3.utils.toHex('testKey')]: {mutable, collectionAdmin, tokenOwner}, - }); + expect(await collection.getPropertyPermissions()).to.be.deep.equal([{ + key: 'testKey', + permission: {mutable, collectionAdmin, tokenOwner}, + }]); } }); - itWeb3('Can be set', async({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - const token = await createItemExpectSuccess(alice, collection, 'NFT'); - await executeTransaction(api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{ + itEth('Can be set', async({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.nft.mintCollection(alice); + const token = await collection.mintToken(alice); + + await collection.setTokenPropertyPermissions(alice, [{ key: 'testKey', permission: { collectionAdmin: true, }, - }])); + }]); - await addCollectionAdminExpectSuccess(alice, collection, {Ethereum: caller}); + await collection.addAdmin(alice, {Ethereum: caller}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', caller); - await contract.methods.setProperty(token, 'testKey', Buffer.from('testValue')).send({from: caller}); + await contract.methods.setProperty(token.tokenId, 'testKey', Buffer.from('testValue')).send({from: caller}); - const [{value}] = (await api.rpc.unique.tokenProperties(collection, token, ['testKey'])).toHuman()! as any; + const [{value}] = await token.getProperties(['testKey']); expect(value).to.equal('testValue'); }); - itWeb3('Can be deleted', async({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - const token = await createItemExpectSuccess(alice, collection, 'NFT'); - await executeTransaction(api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{ + itEth('Can be deleted', async({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.nft.mintCollection(alice); + const token = await collection.mintToken(alice); + + await collection.setTokenPropertyPermissions(alice, [{ key: 'testKey', permission: { mutable: true, collectionAdmin: true, }, - }])); - await executeTransaction(api, alice, api.tx.unique.setTokenProperties(collection, token, [{key: 'testKey', value: 'testValue'}])); + }]); + await token.setProperties(alice, [{key: 'testKey', value: 'testValue'}]); - await addCollectionAdminExpectSuccess(alice, collection, {Ethereum: caller}); + await collection.addAdmin(alice, {Ethereum: caller}); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', caller); - await contract.methods.deleteProperty(token, 'testKey').send({from: caller}); + await contract.methods.deleteProperty(token.tokenId, 'testKey').send({from: caller}); - const result = (await api.rpc.unique.tokenProperties(collection, token, ['testKey'])).toJSON()! as any; + const result = await token.getProperties(['testKey']); expect(result.length).to.equal(0); }); - itWeb3('Can be read', async({web3, api, privateKeyWrapper}) => { - const alice = privateKeyWrapper('//Alice'); - const caller = createEthAccount(web3); - const collection = await createCollectionExpectSuccess({mode: {type:'NFT'}}); - const token = await createItemExpectSuccess(alice, collection, 'NFT'); - await executeTransaction(api, alice, api.tx.unique.setTokenPropertyPermissions(collection, [{ + itEth('Can be read', async({helper}) => { + const caller = helper.eth.createAccount(); + const collection = await helper.nft.mintCollection(alice); + const token = await collection.mintToken(alice); + + await collection.setTokenPropertyPermissions(alice, [{ key: 'testKey', permission: { collectionAdmin: true, }, - }])); - await executeTransaction(api, alice, api.tx.unique.setTokenProperties(collection, token, [{key: 'testKey', value: 'testValue'}])); + }]); + await token.setProperties(alice, [{key: 'testKey', value: 'testValue'}]); - const address = collectionIdToAddress(collection); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', caller); - const value = await contract.methods.property(token, 'testKey').call(); - expect(value).to.equal(web3.utils.toHex('testValue')); + const value = await contract.methods.property(token.tokenId, 'testKey').call(); + expect(value).to.equal(helper.getWeb3().utils.toHex('testValue')); }); }); diff --git a/tests/src/eth/util/playgrounds/index.ts b/tests/src/eth/util/playgrounds/index.ts index 1a3d986076..33104c7ea7 100644 --- a/tests/src/eth/util/playgrounds/index.ts +++ b/tests/src/eth/util/playgrounds/index.ts @@ -1,6 +1,7 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // SPDX-License-Identifier: Apache-2.0 +import * as path from 'path'; import {IKeyringPair} from '@polkadot/types/types'; import config from '../../../config'; @@ -13,12 +14,13 @@ export {EthUniqueHelper} from './unique.dev'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; import chaiLike from 'chai-like'; -import {requirePalletsOrSkip} from '../../../util/playgrounds'; +import {getTestSeed, requirePalletsOrSkip} from '../../../util/playgrounds'; + chai.use(chaiAsPromised); chai.use(chaiLike); export const expect = chai.expect; -export const usingEthPlaygrounds = async (code: (helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { +export const usingEthPlaygrounds = async (code: (helper: EthUniqueHelper, privateKey: (seed: string | {filename: string}) => Promise) => Promise) => { const silentConsole = new SilentConsole(); silentConsole.enable(); @@ -28,7 +30,20 @@ export const usingEthPlaygrounds = async (code: (helper: EthUniqueHelper, privat await helper.connect(config.substrateUrl); await helper.connectWeb3(config.substrateUrl); const ss58Format = helper.chain.getChainProperties().ss58Format; - const privateKey = (seed: string) => helper.util.fromSeed(seed, ss58Format); + const privateKey = async (seed: string | {filename: string}) => { + if (typeof seed === 'string') { + return helper.util.fromSeed(seed, ss58Format); + } + else { + const actualSeed = getTestSeed(seed.filename); + let account = helper.util.fromSeed(actualSeed, ss58Format); + if (await helper.balance.getSubstrate(account.address) == 0n) { + console.warn(`${path.basename(seed.filename)}: Not enough funds present on the filename account. Using the default one as the donor instead.`); + account = helper.util.fromSeed('//Alice', ss58Format); + } + return account; + } + }; await code(helper, privateKey); } finally { @@ -38,7 +53,7 @@ export const usingEthPlaygrounds = async (code: (helper: EthUniqueHelper, privat } }; -export async function itEth(name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean, requiredPallets?: string[] } = {}) { +export async function itEth(name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string | {filename: string}) => Promise }) => any, opts: { only?: boolean, skip?: boolean, requiredPallets?: string[] } = {}) { (opts.only ? it.only : opts.skip ? it.skip : it)(name, async function() { await usingEthPlaygrounds(async (helper, privateKey) => { @@ -51,13 +66,25 @@ export async function itEth(name: string, cb: (apis: { helper: EthUniqueHelper, }); } -export async function itEthIfWithPallet(name: string, required: string[], cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean, requiredPallets?: string[] } = {}) { +export async function itEthIfWithPallet(name: string, required: string[], cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string | {filename: string}) => Promise }) => any, opts: { only?: boolean, skip?: boolean, requiredPallets?: string[] } = {}) { return itEth(name, cb, {requiredPallets: required, ...opts}); } -itEth.only = (name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itEth(name, cb, {only: true}); -itEth.skip = (name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itEth(name, cb, {skip: true}); +itEth.only = (name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string | {filename: string}) => Promise }) => any) => itEth(name, cb, {only: true}); +itEth.skip = (name: string, cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string | {filename: string}) => Promise }) => any) => itEth(name, cb, {skip: true}); -itEthIfWithPallet.only = (name: string, required: string[], cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itEthIfWithPallet(name, required, cb, {only: true}); -itEthIfWithPallet.skip = (name: string, required: string[], cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itEthIfWithPallet(name, required, cb, {skip: true}); +itEthIfWithPallet.only = (name: string, required: string[], cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string | {filename: string}) => Promise }) => any) => itEthIfWithPallet(name, required, cb, {only: true}); +itEthIfWithPallet.skip = (name: string, required: string[], cb: (apis: { helper: EthUniqueHelper, privateKey: (seed: string | {filename: string}) => Promise }) => any) => itEthIfWithPallet(name, required, cb, {skip: true}); itEth.ifWithPallets = itEthIfWithPallet; + +type ElementOf = A extends readonly (infer T)[] ? T : never; +// I want a fancier api, not a memory efficiency +export function* cartesian>, R extends Array>(internalRest: [...R], ...args: [...T]): Generator<[...R, ...{[K in keyof T]: ElementOf}]> { + if(args.length === 0) { + yield internalRest as any; + return; + } + for(const value of args[0]) { + yield* cartesian([...internalRest, value], ...args.slice(1)) as any; + } +} diff --git a/tests/src/evmCoder.test.ts b/tests/src/evmCoder.test.ts index 9a1444933f..df728c94dd 100644 --- a/tests/src/evmCoder.test.ts +++ b/tests/src/evmCoder.test.ts @@ -92,7 +92,7 @@ describe('Evm Coder tests', () => { before(async function() { await usingEthPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); diff --git a/tests/src/fungible.test.ts b/tests/src/fungible.test.ts index 41543b8e2a..b3c462ac94 100644 --- a/tests/src/fungible.test.ts +++ b/tests/src/fungible.test.ts @@ -20,12 +20,13 @@ import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; const U128_MAX = (1n << 128n) - 1n; describe('integration test: Fungible functionality:', () => { + let donor: IKeyringPair; let alice: IKeyringPair; let bob: IKeyringPair; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor); }); }); @@ -43,9 +44,9 @@ describe('integration test: Fungible functionality:', () => { expect(aliceBalance).to.be.equal(U128_MAX); }); - itSub('RPC method tokenOnewrs for fungible collection and token', async ({helper, privateKey}) => { + itSub('RPC method tokenOnewrs for fungible collection and token', async ({helper}) => { const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; - const facelessCrowd = Array(7).fill(0).map((_, i) => ({Substrate: privateKey(`//Alice+${i}`).address})); + const facelessCrowd = (await helper.arrange.createAccounts(Array(7).fill(0n), donor)).map(keyring => {return {Substrate: keyring.address};}); const collection = await helper.ft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); @@ -64,7 +65,7 @@ describe('integration test: Fungible functionality:', () => { expect(owners).to.deep.include.members([{Substrate: alice.address}, ethAcc, {Substrate: bob.address}, ...facelessCrowd]); expect(owners.length).to.be.equal(10); - const eleven = privateKey('//ALice+11'); + const [eleven] = await helper.arrange.createAccounts([0n], donor); expect(await collection.transfer(alice, {Substrate: eleven.address}, 10n)).to.be.true; expect((await collection.getTop10Owners()).length).to.be.equal(10); }); diff --git a/tests/src/getPropertiesRpc.test.ts b/tests/src/getPropertiesRpc.test.ts index 6289dc9634..622d135527 100644 --- a/tests/src/getPropertiesRpc.test.ts +++ b/tests/src/getPropertiesRpc.test.ts @@ -63,7 +63,7 @@ describe('query properties RPC', () => { before(async () => { await usingPlaygrounds(async (_, privateKey) => { - alice = privateKey('//Alice'); + alice = await privateKey({filename: __filename}); }); }); diff --git a/tests/src/inflation.test.ts b/tests/src/inflation.test.ts index 015ceb1aeb..7ef54dc51f 100644 --- a/tests/src/inflation.test.ts +++ b/tests/src/inflation.test.ts @@ -23,7 +23,7 @@ describe('integration test: Inflation', () => { before(async () => { await usingPlaygrounds(async (_, privateKey) => { - superuser = privateKey('//Alice'); + superuser = await privateKey('//Alice'); }); }); diff --git a/tests/src/limits.test.ts b/tests/src/limits.test.ts index 14c2c4ed9e..987b4204e5 100644 --- a/tests/src/limits.test.ts +++ b/tests/src/limits.test.ts @@ -22,7 +22,7 @@ describe('Number of tokens per address (NFT)', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); @@ -60,7 +60,7 @@ describe('Number of tokens per address (ReFungible)', () => { await usingPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); @@ -292,7 +292,7 @@ describe('Collection zero limits (NFT)', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); }); @@ -333,7 +333,7 @@ describe('Collection zero limits (Fungible)', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); }); @@ -366,7 +366,7 @@ describe('Collection zero limits (ReFungible)', () => { await usingPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); }); }); @@ -404,7 +404,7 @@ describe('Effective collection limits (NFT)', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); diff --git a/tests/src/nesting/graphs.test.ts b/tests/src/nesting/graphs.test.ts index b504330033..e672fcabc2 100644 --- a/tests/src/nesting/graphs.test.ts +++ b/tests/src/nesting/graphs.test.ts @@ -45,7 +45,7 @@ describe('Graphs', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([10n], donor); }); }); diff --git a/tests/src/nesting/nest.test.ts b/tests/src/nesting/nest.test.ts index 95498d4779..4e23e126df 100644 --- a/tests/src/nesting/nest.test.ts +++ b/tests/src/nesting/nest.test.ts @@ -23,7 +23,7 @@ describe('Integration Test: Composite nesting tests', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); }); }); @@ -137,7 +137,7 @@ describe('Integration Test: Various token type nesting', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([50n, 10n, 10n], donor); }); }); @@ -343,7 +343,7 @@ describe('Negative Test: Nesting', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 50n], donor); }); }); diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index 9e4c90083d..71308c3394 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -26,7 +26,7 @@ describe('Integration Test: Collection Properties', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); }); }); @@ -141,7 +141,7 @@ describe('Negative Integration Test: Collection Properties', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor); }); }); @@ -269,7 +269,7 @@ describe('Integration Test: Access Rights to Token Properties', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor); }); }); @@ -332,7 +332,7 @@ describe('Negative Integration Test: Access Rights to Token Properties', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); }); }); @@ -453,7 +453,7 @@ describe('Integration Test: Token Properties', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); @@ -777,7 +777,7 @@ describe('Negative Integration Test: Token Properties', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); let dave: IKeyringPair; [alice, bob, charlie, dave] = await helper.arrange.createAccounts([100n, 100n, 100n, 100n], donor); @@ -977,7 +977,7 @@ describe('ReFungible token properties permissions tests', () => { await usingPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); }); }); @@ -1002,7 +1002,7 @@ describe('ReFungible token properties permissions tests', () => { ])).to.be.rejectedWith(/common\.NoPermission/); }); - itSub('Forbids mutating token property with tokenOwher==true when signer doesn\'t have all pieces', async ({helper}) => { + itSub('Forbids mutating token property with tokenOwner==true when signer doesn\'t have all pieces', async ({helper}) => { const token = await prepare(helper); await expect(token.collection.setTokenPropertyPermissions(alice, [{key: 'fractals', permission: {mutable:true, tokenOwner: true}}])) diff --git a/tests/src/nesting/unnest.test.ts b/tests/src/nesting/unnest.test.ts index 66b7ee6763..e48aed7bb5 100644 --- a/tests/src/nesting/unnest.test.ts +++ b/tests/src/nesting/unnest.test.ts @@ -22,7 +22,7 @@ describe('Integration Test: Unnesting', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice] = await helper.arrange.createAccounts([50n], donor); }); }); @@ -91,7 +91,7 @@ describe('Negative Test: Unnesting', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); }); }); diff --git a/tests/src/nextSponsoring.test.ts b/tests/src/nextSponsoring.test.ts index e66e67d6bb..549ba7345f 100644 --- a/tests/src/nextSponsoring.test.ts +++ b/tests/src/nextSponsoring.test.ts @@ -25,7 +25,7 @@ describe('Integration Test getNextSponsored(collection_id, owner, item_id):', () before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([20n, 10n], donor); }); }); diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index e68eb4a34a..fbd87345c3 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -20,6 +20,7 @@ import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from './ const MAX_REFUNGIBLE_PIECES = 1_000_000_000_000_000_000_000n; describe('integration test: Refungible functionality:', async () => { + let donor: IKeyringPair; let alice: IKeyringPair; let bob: IKeyringPair; @@ -27,7 +28,7 @@ describe('integration test: Refungible functionality:', async () => { await usingPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - const donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor); }); }); @@ -61,9 +62,9 @@ describe('integration test: Refungible functionality:', async () => { .to.eventually.be.rejectedWith(/refungible\.WrongRefungiblePieces/); }); - itSub('RPC method tokenOnewrs for refungible collection and token', async ({helper, privateKey}) => { + itSub('RPC method tokenOnewrs for refungible collection and token', async ({helper}) => { const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; - const facelessCrowd = Array(7).fill(0).map((_, i) => ({Substrate: privateKey(`//Alice+${i}`).address})); + const facelessCrowd = (await helper.arrange.createAccounts(Array(7).fill(0n), donor)).map(keyring => {return {Substrate: keyring.address};}); const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'}); @@ -82,7 +83,7 @@ describe('integration test: Refungible functionality:', async () => { expect(owners).to.deep.include.members([{Substrate: alice.address}, ethAcc, {Substrate: bob.address}, ...facelessCrowd]); expect(owners.length).to.be.equal(10); - const eleven = privateKey('//ALice+11'); + const [eleven] = await helper.arrange.createAccounts([0n], donor); expect(await token.transfer(alice, {Substrate: eleven.address}, 10n)).to.be.true; expect((await token.getTop10Owners()).length).to.be.equal(10); }); diff --git a/tests/src/removeCollectionAdmin.test.ts b/tests/src/removeCollectionAdmin.test.ts index 88b9cc2240..3678c79a03 100644 --- a/tests/src/removeCollectionAdmin.test.ts +++ b/tests/src/removeCollectionAdmin.test.ts @@ -23,7 +23,7 @@ describe('Integration Test removeCollectionAdmin(collection_id, account_id):', ( before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([20n, 10n], donor); }); }); @@ -62,7 +62,7 @@ describe('Negative Integration Test removeCollectionAdmin(collection_id, account before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([20n, 10n, 10n], donor); }); }); diff --git a/tests/src/removeCollectionSponsor.test.ts b/tests/src/removeCollectionSponsor.test.ts index 326b160dfd..45fdb75138 100644 --- a/tests/src/removeCollectionSponsor.test.ts +++ b/tests/src/removeCollectionSponsor.test.ts @@ -24,7 +24,7 @@ describe('integration test: ext. removeCollectionSponsor():', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); }); }); @@ -78,7 +78,7 @@ describe('(!negative test!) integration test: ext. removeCollectionSponsor():', before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([20n, 10n, 10n], donor); }); }); diff --git a/tests/src/rpc.test.ts b/tests/src/rpc.test.ts index 8937f6f1ba..9607614446 100644 --- a/tests/src/rpc.test.ts +++ b/tests/src/rpc.test.ts @@ -25,7 +25,7 @@ describe('integration test: RPC methods', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([20n, 10n], donor); }); }); diff --git a/tests/src/setCollectionLimits.test.ts b/tests/src/setCollectionLimits.test.ts index 7cb7919b68..894756491e 100644 --- a/tests/src/setCollectionLimits.test.ts +++ b/tests/src/setCollectionLimits.test.ts @@ -29,7 +29,7 @@ describe('setCollectionLimits positive', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([20n, 10n], donor); }); }); @@ -104,7 +104,7 @@ describe('setCollectionLimits negative', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([20n, 10n], donor); }); }); diff --git a/tests/src/setCollectionSponsor.test.ts b/tests/src/setCollectionSponsor.test.ts index 46a804cbb5..0af3f94952 100644 --- a/tests/src/setCollectionSponsor.test.ts +++ b/tests/src/setCollectionSponsor.test.ts @@ -24,7 +24,7 @@ describe('integration test: ext. setCollectionSponsor():', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([20n, 10n, 10n], donor); }); }); @@ -93,7 +93,7 @@ describe('(!negative test!) integration test: ext. setCollectionSponsor():', () before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([10n, 5n], donor); }); }); diff --git a/tests/src/setPermissions.test.ts b/tests/src/setPermissions.test.ts index 447eb791b1..5a19435d1d 100644 --- a/tests/src/setPermissions.test.ts +++ b/tests/src/setPermissions.test.ts @@ -23,7 +23,7 @@ describe('Integration Test: Set Permissions', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); }); }); @@ -79,7 +79,7 @@ describe('Negative Integration Test: Set Permissions', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor); }); }); diff --git a/tests/src/transfer.test.ts b/tests/src/transfer.test.ts index 19bf353685..6b1fb832b2 100644 --- a/tests/src/transfer.test.ts +++ b/tests/src/transfer.test.ts @@ -19,12 +19,13 @@ import {itEth, usingEthPlaygrounds} from './eth/util/playgrounds'; import {itSub, Pallets, usingPlaygrounds, expect} from './util/playgrounds'; describe('Integration Test Transfer(recipient, collection_id, item_id, value)', () => { + let donor: IKeyringPair; let alice: IKeyringPair; let bob: IKeyringPair; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); }); }); @@ -42,8 +43,7 @@ describe('Integration Test Transfer(recipient, collection_id, item_id, value)', expect(bobsBalanceAfter > bobsBalanceBefore).to.be.true; }); - itSub('Inability to pay fees error message is correct', async ({helper, privateKey}) => { - const donor = privateKey('//Alice'); + itSub('Inability to pay fees error message is correct', async ({helper}) => { const [zero] = await helper.arrange.createAccounts([0n], donor); // console.error = () => {}; @@ -117,7 +117,7 @@ describe('Negative Integration Test Transfer(recipient, collection_id, item_id, before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); }); }); @@ -256,7 +256,7 @@ describe('Transfers to self (potentially over substrate-evm boundary)', () => { before(async function() { await usingEthPlaygrounds(async (_, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); diff --git a/tests/src/transferFrom.test.ts b/tests/src/transferFrom.test.ts index 011cf9a260..5f6f8cb230 100644 --- a/tests/src/transferFrom.test.ts +++ b/tests/src/transferFrom.test.ts @@ -24,7 +24,7 @@ describe('Integration Test transferFrom(from, recipient, collection_id, item_id, before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([20n, 10n, 10n], donor); }); }); @@ -91,7 +91,7 @@ describe('Negative Integration Test transferFrom(from, recipient, collection_id, before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const donor = privateKey('//Alice'); + const donor = await privateKey({filename: __filename}); [alice, bob, charlie] = await helper.arrange.createAccounts([50n, 10n, 10n], donor); }); }); diff --git a/tests/src/util/playgrounds/feedAlices.ts b/tests/src/util/playgrounds/feedAlices.ts new file mode 100644 index 0000000000..3791738186 --- /dev/null +++ b/tests/src/util/playgrounds/feedAlices.ts @@ -0,0 +1,77 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +import * as path from 'path'; +import {promises as fs} from 'fs'; +import {usingPlaygrounds} from '.'; + +async function getFiles(rootPath: string): Promise { + const files = await fs.readdir(rootPath, {withFileTypes: true}); + const filenames: string[] = []; + for (const entry of files) { + const res = path.resolve(rootPath, entry.name); + if (entry.isDirectory()) { + filenames.push(...await getFiles(res)); + } else { + filenames.push(res); + } + } + return filenames; +} + +const fundFilenames = async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const oneToken = helper.balance.getOneTokenNominal(); + const alice = await privateKey('//Alice'); + const nonce = await helper.chain.getNonce(alice.address); + const filenames = await getFiles(path.resolve(__dirname, '../..')); + + console.log(`Main Alice address: ${alice.address}, with balance:`, await helper.balance.getSubstrate(alice.address)); + + const batchSize = 20; + let balanceGrantedCounter = 0; + for (let b = 0; b < filenames.length; b += batchSize) { + const tx = []; + let batchBalanceGrantedCounter = 0; + for (const f of filenames.slice(b, b + batchSize)) { + if (!f.endsWith('.test.ts')) continue; + const account = await privateKey({filename: f}); + const aliceBalance = await helper.balance.getSubstrate(account.address); + + if (aliceBalance < 5000n * oneToken) { + tx.push(helper.executeExtrinsic( + alice, + 'api.tx.balances.transfer', + [account.address, 10000n * oneToken], + true, + {nonce: nonce + balanceGrantedCounter++}, + ).then(() => true).catch(() => {console.error(`Transaction to ${path.basename(f)} registered as failed. Strange.`); return false;})); + batchBalanceGrantedCounter++; + } + } + + if(tx.length > 0) { + console.log(`Granting funds to ${batchBalanceGrantedCounter} filename accounts.`); + const result = await Promise.all(tx); + if (result && result.lastIndexOf(false) > -1) throw new Error('The transactions actually probably succeeded, should check the balances.'); + } + } + + if (balanceGrantedCounter == 0) console.log('No account needs additional funding.'); + }); +}; + +const fundFilenamesWithRetries = async (retriesLeft: number): Promise => { + if (retriesLeft <= 0) return Promise.resolve(false); + return fundFilenames() + .then(() => Promise.resolve(true)) + .catch(() => { + console.error(`Some transactions have failed. ${retriesLeft >= 1 ? 'Retrying...' : 'Something is wrong.'}`); + return fundFilenamesWithRetries(--retriesLeft); + }); +}; + +fundFilenamesWithRetries(2).then((result) => process.exit(result ? 0 : 1)).catch(e => { + console.error(e); + process.exit(1); +}); diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index 98bb83e772..f4c17e4ecd 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -1,6 +1,8 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // SPDX-License-Identifier: Apache-2.0 +import * as path from 'path'; +import * as crypto from 'crypto'; import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; @@ -12,7 +14,16 @@ import {DevUniqueHelper, SilentLogger, SilentConsole} from './unique.dev'; chai.use(chaiAsPromised); export const expect = chai.expect; -export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise, url: string = config.substrateUrl) => { +const getTestHash = (filename: string) => { + return crypto.createHash('md5').update(path.basename(filename)).digest('hex'); +}; + +export const getTestSeed = (filename: string) => { + return `//Alice+${getTestHash(filename)}`; +}; + +// todo:playgrounds normalize to seed and filename +export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string | {filename: string}) => Promise) => Promise, url: string = config.substrateUrl) => { const silentConsole = new SilentConsole(); silentConsole.enable(); @@ -21,7 +32,20 @@ export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKe try { await helper.connect(url); const ss58Format = helper.chain.getChainProperties().ss58Format; - const privateKey = (seed: string) => helper.util.fromSeed(seed, ss58Format); + const privateKey = async (seed: string | {filename: string}) => { + if (typeof seed === 'string') { + return helper.util.fromSeed(seed, ss58Format); + } + else { + const actualSeed = getTestSeed(seed.filename); + let account = helper.util.fromSeed(actualSeed, ss58Format); + if (await helper.balance.getSubstrate(account.address) == 0n) { + console.warn(`${path.basename(seed.filename)}: Not enough funds present on the filename account. Using the default one as the donor instead.`); + account = helper.util.fromSeed('//Alice', ss58Format); + } + return account; + } + }; await code(helper, privateKey); } finally { @@ -50,7 +74,7 @@ export function requirePalletsOrSkip(test: Context, helper: DevUniqueHelper, req } } -export async function itSub(name: string, cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean, requiredPallets?: string[] } = {}) { +export async function itSub(name: string, cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => Promise }) => any, opts: { only?: boolean, skip?: boolean, requiredPallets?: string[] } = {}) { (opts.only ? it.only : opts.skip ? it.skip : it)(name, async function () { await usingPlaygrounds(async (helper, privateKey) => { @@ -62,12 +86,12 @@ export async function itSub(name: string, cb: (apis: { helper: DevUniqueHelper, }); }); } -export async function itSubIfWithPallet(name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean, requiredPallets?: string[] } = {}) { +export async function itSubIfWithPallet(name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => Promise }) => any, opts: { only?: boolean, skip?: boolean, requiredPallets?: string[] } = {}) { return itSub(name, cb, {requiredPallets: required, ...opts}); } -itSub.only = (name: string, cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSub(name, cb, {only: true}); -itSub.skip = (name: string, cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSub(name, cb, {skip: true}); +itSub.only = (name: string, cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => Promise }) => any) => itSub(name, cb, {only: true}); +itSub.skip = (name: string, cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => Promise }) => any) => itSub(name, cb, {skip: true}); -itSubIfWithPallet.only = (name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSubIfWithPallet(name, required, cb, {only: true}); -itSubIfWithPallet.skip = (name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSubIfWithPallet(name, required, cb, {skip: true}); +itSubIfWithPallet.only = (name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => Promise }) => any) => itSubIfWithPallet(name, required, cb, {only: true}); +itSubIfWithPallet.skip = (name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => Promise }) => any) => itSubIfWithPallet(name, required, cb, {skip: true}); itSub.ifWithPallets = itSubIfWithPallet; From 44c4cc84381c7a7c4aac8a282a0e0657319ac844 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 5 Oct 2022 09:02:15 +0000 Subject: [PATCH 1044/1274] fix: contractSponsoring deplyFlipper, remove unneeded comments --- tests/src/eth/contractSponsoring.test.ts | 193 +++++------------------ 1 file changed, 37 insertions(+), 156 deletions(-) diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index a0d3012ee1..e21d98c5e4 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -23,19 +23,14 @@ import { normalizeEvents, CompiledContract, GAS_ARGS, - contractHelpers, - createEthAccountWithBalance, } from './util/helpers'; import {itEth, expect} from '../eth/util/playgrounds'; -describe.only('Sponsoring EVM contracts', () => { +describe('Sponsoring EVM contracts', () => { itEth('Self sponsored can be set by the address that deployed the contract', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const flipper = await helper.eth.deployFlipper(owner); const helpers = helper.ethNativeContract.contractHelpers(owner); @@ -48,9 +43,6 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Set self sponsored events', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const flipper = await helper.eth.deployFlipper(owner); const helpers = helper.ethNativeContract.contractHelpers(owner); @@ -88,26 +80,19 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Self sponsored can not be set by the address that did not deployed the contract', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const helpers = contractHelpers(web3, owner); - // const flipper = await deployFlipper(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const notOwner = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; await expect(helpers.methods.selfSponsoredEnable(flipper.options.address).call({from: notOwner})).to.be.rejectedWith('NoPermission'); expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; }); - itEth.only('Sponsoring can be set by the address that has deployed the contract', async ({helper, privateKey}) => { + itEth('Sponsoring can be set by the address that has deployed the contract', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -120,14 +105,10 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Sponsoring cannot be set by the address that did not deployed the contract', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const notOwner = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; await expect(helpers.methods.setSponsoringMode(notOwner, SponsoringMode.Allowlisted).call({from: notOwner})).to.be.rejectedWith('NoPermission'); @@ -137,14 +118,10 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Sponsor can be set by the address that deployed the contract', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.false; await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected; @@ -154,14 +131,10 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Set sponsor event', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); const result = await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); const events = normalizeEvents(result.events); @@ -188,16 +161,11 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Sponsor can not be set by the address that did not deployed the contract', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); const notOwner = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.false; await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).call({from: notOwner})).to.be.rejectedWith('NoPermission'); @@ -207,14 +175,10 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Sponsorship can be confirmed by the address that pending as sponsor', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected; @@ -225,14 +189,10 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Confirm sponsorship event', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected; const result = await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); @@ -260,16 +220,11 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Sponsorship can not be confirmed by the address that not pending as sponsor', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const notSponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); const notSponsor = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected; @@ -280,14 +235,10 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Sponsorship can not be confirmed by the address that not set as sponsor', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const notSponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const notSponsor = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; await expect(helpers.methods.confirmSponsorship(flipper.options.address).call({from: notSponsor})).to.be.rejectedWith('NoPendingSponsor'); @@ -297,12 +248,9 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Get self sponsored sponsor', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); - const flipper = helper.ethNativeContract.contractHelpers(owner); const helpers = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); await helpers.methods.selfSponsoredEnable(flipper.options.address).send(); @@ -315,14 +263,10 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Get confirmed sponsor', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); @@ -336,14 +280,10 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Sponsor can be removed by the address that deployed the contract', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); @@ -357,14 +297,10 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Remove sponsor event', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); @@ -393,16 +329,11 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Sponsor can not be removed by the address that did not deployed the contract', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const notOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const notOwner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); @@ -416,16 +347,11 @@ describe.only('Sponsoring EVM contracts', () => { itEth('In generous mode, non-allowlisted user transaction will be sponsored', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); const caller = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); @@ -449,21 +375,16 @@ describe.only('Sponsoring EVM contracts', () => { itEth('In generous mode, non-allowlisted user transaction will be self sponsored', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const caller = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); await helpers.methods.selfSponsoredEnable(flipper.options.address).send(); await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: owner}); await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner}); - // await transferBalanceToEth(api, alice, flipper.options.address); await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address); const contractBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(flipper.options.address)); @@ -482,16 +403,11 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should decrease (allowlisted)', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const caller = createEthAccount(web3); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); - const caller = await helper.eth.createAccountWithBalance(alice); + const caller = await helper.eth.createAccount(); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner}); await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner}); @@ -516,22 +432,17 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should not decrease (non-allowlisted)', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const caller = createEthAccount(web3); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); - const caller = await helper.eth.createAccountWithBalance(alice); + const caller = await helper.eth.createAccount(); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Allowlisted).send({from: owner}); await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner}); - // await transferBalanceToEth(api, alice, flipper.options.address); await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address); - const originalFlipperBalance = await helper.balance.getEthereum(flipper.options.address); // await web3.eth.getBalance(flipper.options.address); + const originalFlipperBalance = await helper.balance.getEthereum(flipper.options.address); expect(originalFlipperBalance).to.be.not.equal('0'); await expect(flipper.methods.flip().send({from: caller})).to.be.rejectedWith(/InvalidTransaction::Payment/); @@ -539,23 +450,18 @@ describe.only('Sponsoring EVM contracts', () => { // Balance should be taken from flipper instead of caller // FIXME the comment is wrong! What check should be here? - const balanceAfter = await helper.balance.getEthereum(flipper.options.address); // await web3.eth.getBalance(flipper.options.address); + const balanceAfter = await helper.balance.getEthereum(flipper.options.address); expect(balanceAfter).to.be.equals(originalFlipperBalance); }); itEth('Sponsoring is set, an address that has UNQ can send a transaction and it works. User balance should not change', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); const caller = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner}); await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner}); @@ -581,18 +487,13 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Sponsoring is limited, with setContractRateLimit. The limitation is working if transactions are sent more often, the sender pays the commission.', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); const caller = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); - const originalCallerBalance = await helper.balance.getEthereum(caller); // await web3.eth.getBalance(caller); + const originalCallerBalance = await helper.balance.getEthereum(caller); await helpers.methods.toggleAllowlist(flipper.options.address, true).send({from: owner}); await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({from: owner}); @@ -602,7 +503,7 @@ describe.only('Sponsoring EVM contracts', () => { await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); - const originalFlipperBalance = await helper.balance.getEthereum(sponsor); // await web3.eth.getBalance(sponsor); + const originalFlipperBalance = await helper.balance.getEthereum(sponsor); expect(originalFlipperBalance).to.be.not.equal('0'); await flipper.methods.flip().send({from: caller}); @@ -621,12 +522,9 @@ describe.only('Sponsoring EVM contracts', () => { itEth('Default rate limit equals 7200', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); expect(await helpers.methods.sponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200'); }); @@ -696,12 +594,9 @@ describe('Sponsoring Fee Limit', () => { itEth('Default fee limit', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935'); }); @@ -709,12 +604,9 @@ describe('Sponsoring Fee Limit', () => { itEth('Set fee limit', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); await helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send(); expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100'); @@ -723,14 +615,10 @@ describe('Sponsoring Fee Limit', () => { itEth('Negative test - set fee limit by non-owner', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const stranger = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const flipper = await deployFlipper(web3, owner); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const stranger = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); - const flipper = helper.ethNativeContract.contractHelpers(owner); + const flipper = await helper.eth.deployFlipper(owner); await expect(helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send({from: stranger})).to.be.rejected; }); @@ -738,10 +626,6 @@ describe('Sponsoring Fee Limit', () => { itEth('Negative test - check that eth transactions exceeding fee limit are not executed', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const user = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); const user = await helper.eth.createAccountWithBalance(alice); @@ -759,7 +643,7 @@ describe('Sponsoring Fee Limit', () => { await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 2_000_000n * gasPrice).send(); - const originalUserBalance = await helper.balance.getEthereum(user); // await web3.eth.getBalance(user); + const originalUserBalance = await helper.balance.getEthereum(user); await testContract.methods.test(100).send({from: user, gas: 2_000_000}); expect(await helper.balance.getEthereum(user)).to.be.equal(originalUserBalance); @@ -770,9 +654,6 @@ describe('Sponsoring Fee Limit', () => { itEth('Negative test - check that evm.call transactions exceeding fee limit are not executed', async ({helper, privateKey}) => { const alice = privateKey('//Alice'); - // const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - // const helpers = contractHelpers(web3, owner); const owner = await helper.eth.createAccountWithBalance(alice); const sponsor = await helper.eth.createAccountWithBalance(alice); const helpers = helper.ethNativeContract.contractHelpers(owner); @@ -789,7 +670,7 @@ describe('Sponsoring Fee Limit', () => { await helpers.methods.setSponsoringFeeLimit(testContract.options.address, 2_000_000n * gasPrice).send(); - const originalAliceBalance = await helper.balance.getSubstrate(alice.address); // (await api.query.system.account(alice.address)).data.free.toBigInt(); + const originalAliceBalance = await helper.balance.getSubstrate(alice.address); // await submitTransactionAsync( // alice, @@ -808,8 +689,8 @@ describe('Sponsoring Fee Limit', () => { await helper.eth.sendEVM( alice, testContract.options.address, - testContract.methods.test().encodeABI(), - '100', + testContract.methods.test(100).encodeABI(), + '0', ); // expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.be.equal(originalAliceBalance); expect(await helper.balance.getSubstrate(alice.address)).to.be.equal(originalAliceBalance); @@ -832,7 +713,7 @@ describe('Sponsoring Fee Limit', () => { alice, testContract.options.address, testContract.methods.test().encodeABI(), - '100', + '0', ); // expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.not.be.equal(originalAliceBalance); expect(await helper.balance.getSubstrate(alice.address)).to.not.be.equal(originalAliceBalance); From 1e8c54cb6ea68509fa55595c2dbf4b03830401a2 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 13:09:16 +0400 Subject: [PATCH 1045/1274] Tests: move outdated tests to .oudated dir --- .../addToContractAllowList.test.ts | 6 +- .../collision-tests/admVsOwnerChanges.test.ts | 0 .../collision-tests/admVsOwnerData.test.ts | 0 .../collision-tests/admVsOwnerTake.test.ts | 0 .../adminDestroyCollection.test.ts | 0 .../collision-tests/adminLimitsOff.test.ts | 0 .../collision-tests/adminRightsOff.test.ts | 0 .../setSponsorNewOwner.test.ts | 0 .../collision-tests/sponsorPayments.test.ts | 0 .../collision-tests/tokenLimitsOff.test.ts | 0 .../collision-tests/turnsOffMinting.test.ts | 0 tests/src/{ => .outdated}/contracts.test.ts | 6 +- .../enableContractSponsoring.test.ts | 6 +- tests/src/{ => .outdated}/inflation.test.ts | 2 +- tests/src/{ => .outdated}/overflow.test.ts | 4 +- .../removeFromContractAllowList.test.ts | 6 +- tests/src/{ => .outdated}/scheduler.test.ts | 4 +- .../{ => .outdated}/setChainLimits.test.ts | 4 +- .../setContractSponsoringRateLimit.test.ts | 8 +- tests/src/{ => .outdated}/xcmTransfer.test.ts | 8 +- tests/src/nesting/migration-check.test.ts | 173 ------------------ tests/tsconfig.json | 3 + 22 files changed, 30 insertions(+), 200 deletions(-) rename tests/src/{ => .outdated}/addToContractAllowList.test.ts (97%) rename tests/src/{ => .outdated}/collision-tests/admVsOwnerChanges.test.ts (100%) rename tests/src/{ => .outdated}/collision-tests/admVsOwnerData.test.ts (100%) rename tests/src/{ => .outdated}/collision-tests/admVsOwnerTake.test.ts (100%) rename tests/src/{ => .outdated}/collision-tests/adminDestroyCollection.test.ts (100%) rename tests/src/{ => .outdated}/collision-tests/adminLimitsOff.test.ts (100%) rename tests/src/{ => .outdated}/collision-tests/adminRightsOff.test.ts (100%) rename tests/src/{ => .outdated}/collision-tests/setSponsorNewOwner.test.ts (100%) rename tests/src/{ => .outdated}/collision-tests/sponsorPayments.test.ts (100%) rename tests/src/{ => .outdated}/collision-tests/tokenLimitsOff.test.ts (100%) rename tests/src/{ => .outdated}/collision-tests/turnsOffMinting.test.ts (100%) rename tests/src/{ => .outdated}/contracts.test.ts (98%) rename tests/src/{ => .outdated}/enableContractSponsoring.test.ts (97%) rename tests/src/{ => .outdated}/inflation.test.ts (97%) rename tests/src/{ => .outdated}/overflow.test.ts (96%) rename tests/src/{ => .outdated}/removeFromContractAllowList.test.ts (96%) rename tests/src/{ => .outdated}/scheduler.test.ts (99%) rename tests/src/{ => .outdated}/setChainLimits.test.ts (96%) rename tests/src/{ => .outdated}/setContractSponsoringRateLimit.test.ts (94%) rename tests/src/{ => .outdated}/xcmTransfer.test.ts (95%) delete mode 100644 tests/src/nesting/migration-check.test.ts diff --git a/tests/src/addToContractAllowList.test.ts b/tests/src/.outdated/addToContractAllowList.test.ts similarity index 97% rename from tests/src/addToContractAllowList.test.ts rename to tests/src/.outdated/addToContractAllowList.test.ts index dce930d380..e04ac4f596 100644 --- a/tests/src/addToContractAllowList.test.ts +++ b/tests/src/.outdated/addToContractAllowList.test.ts @@ -16,13 +16,13 @@ import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import usingApi, {submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api'; +import usingApi, {submitTransactionAsync, submitTransactionExpectFailAsync} from '../substrate/substrate-api'; import { deployFlipper, -} from './util/contracthelpers'; +} from '../util/contracthelpers'; import { getGenericResult, -} from './util/helpers'; +} from '../util/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; diff --git a/tests/src/collision-tests/admVsOwnerChanges.test.ts b/tests/src/.outdated/collision-tests/admVsOwnerChanges.test.ts similarity index 100% rename from tests/src/collision-tests/admVsOwnerChanges.test.ts rename to tests/src/.outdated/collision-tests/admVsOwnerChanges.test.ts diff --git a/tests/src/collision-tests/admVsOwnerData.test.ts b/tests/src/.outdated/collision-tests/admVsOwnerData.test.ts similarity index 100% rename from tests/src/collision-tests/admVsOwnerData.test.ts rename to tests/src/.outdated/collision-tests/admVsOwnerData.test.ts diff --git a/tests/src/collision-tests/admVsOwnerTake.test.ts b/tests/src/.outdated/collision-tests/admVsOwnerTake.test.ts similarity index 100% rename from tests/src/collision-tests/admVsOwnerTake.test.ts rename to tests/src/.outdated/collision-tests/admVsOwnerTake.test.ts diff --git a/tests/src/collision-tests/adminDestroyCollection.test.ts b/tests/src/.outdated/collision-tests/adminDestroyCollection.test.ts similarity index 100% rename from tests/src/collision-tests/adminDestroyCollection.test.ts rename to tests/src/.outdated/collision-tests/adminDestroyCollection.test.ts diff --git a/tests/src/collision-tests/adminLimitsOff.test.ts b/tests/src/.outdated/collision-tests/adminLimitsOff.test.ts similarity index 100% rename from tests/src/collision-tests/adminLimitsOff.test.ts rename to tests/src/.outdated/collision-tests/adminLimitsOff.test.ts diff --git a/tests/src/collision-tests/adminRightsOff.test.ts b/tests/src/.outdated/collision-tests/adminRightsOff.test.ts similarity index 100% rename from tests/src/collision-tests/adminRightsOff.test.ts rename to tests/src/.outdated/collision-tests/adminRightsOff.test.ts diff --git a/tests/src/collision-tests/setSponsorNewOwner.test.ts b/tests/src/.outdated/collision-tests/setSponsorNewOwner.test.ts similarity index 100% rename from tests/src/collision-tests/setSponsorNewOwner.test.ts rename to tests/src/.outdated/collision-tests/setSponsorNewOwner.test.ts diff --git a/tests/src/collision-tests/sponsorPayments.test.ts b/tests/src/.outdated/collision-tests/sponsorPayments.test.ts similarity index 100% rename from tests/src/collision-tests/sponsorPayments.test.ts rename to tests/src/.outdated/collision-tests/sponsorPayments.test.ts diff --git a/tests/src/collision-tests/tokenLimitsOff.test.ts b/tests/src/.outdated/collision-tests/tokenLimitsOff.test.ts similarity index 100% rename from tests/src/collision-tests/tokenLimitsOff.test.ts rename to tests/src/.outdated/collision-tests/tokenLimitsOff.test.ts diff --git a/tests/src/collision-tests/turnsOffMinting.test.ts b/tests/src/.outdated/collision-tests/turnsOffMinting.test.ts similarity index 100% rename from tests/src/collision-tests/turnsOffMinting.test.ts rename to tests/src/.outdated/collision-tests/turnsOffMinting.test.ts diff --git a/tests/src/contracts.test.ts b/tests/src/.outdated/contracts.test.ts similarity index 98% rename from tests/src/contracts.test.ts rename to tests/src/.outdated/contracts.test.ts index 045522924a..6f9c60085f 100644 --- a/tests/src/contracts.test.ts +++ b/tests/src/.outdated/contracts.test.ts @@ -16,14 +16,14 @@ import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; +import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; import fs from 'fs'; import {Abi, ContractPromise as Contract} from '@polkadot/api-contract'; import { deployFlipper, getFlipValue, deployTransferContract, -} from './util/contracthelpers'; +} from '../util/contracthelpers'; import { addToAllowListExpectSuccess, @@ -37,7 +37,7 @@ import { isAllowlisted, transferFromExpectSuccess, getTokenOwner, -} from './util/helpers'; +} from '../util/helpers'; chai.use(chaiAsPromised); diff --git a/tests/src/enableContractSponsoring.test.ts b/tests/src/.outdated/enableContractSponsoring.test.ts similarity index 97% rename from tests/src/enableContractSponsoring.test.ts rename to tests/src/.outdated/enableContractSponsoring.test.ts index e1084d150b..c0348eb622 100644 --- a/tests/src/enableContractSponsoring.test.ts +++ b/tests/src/.outdated/enableContractSponsoring.test.ts @@ -17,14 +17,14 @@ import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import usingApi from './substrate/substrate-api'; -import {deployFlipper, getFlipValue, toggleFlipValueExpectSuccess} from './util/contracthelpers'; +import usingApi from '../substrate/substrate-api'; +import {deployFlipper, getFlipValue, toggleFlipValueExpectSuccess} from '../util/contracthelpers'; import { enableContractSponsoringExpectFailure, enableContractSponsoringExpectSuccess, findUnusedAddress, setContractSponsoringRateLimitExpectSuccess, -} from './util/helpers'; +} from '../util/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; diff --git a/tests/src/inflation.test.ts b/tests/src/.outdated/inflation.test.ts similarity index 97% rename from tests/src/inflation.test.ts rename to tests/src/.outdated/inflation.test.ts index 015ceb1aeb..282b38cb22 100644 --- a/tests/src/inflation.test.ts +++ b/tests/src/.outdated/inflation.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, usingPlaygrounds} from './util/playgrounds'; +import {expect, itSub, usingPlaygrounds} from '../util/playgrounds'; // todo:playgrounds requires sudo, look into on the later stage describe('integration test: Inflation', () => { diff --git a/tests/src/overflow.test.ts b/tests/src/.outdated/overflow.test.ts similarity index 96% rename from tests/src/overflow.test.ts rename to tests/src/.outdated/overflow.test.ts index ada2d1742c..3e99696577 100644 --- a/tests/src/overflow.test.ts +++ b/tests/src/.outdated/overflow.test.ts @@ -17,8 +17,8 @@ import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import usingApi from './substrate/substrate-api'; -import {approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, getAllowance, getBalance, transferExpectFailure, transferExpectSuccess, transferFromExpectFail, transferFromExpectSuccess, U128_MAX} from './util/helpers'; +import usingApi from '../substrate/substrate-api'; +import {approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, getAllowance, getBalance, transferExpectFailure, transferExpectSuccess, transferFromExpectFail, transferFromExpectSuccess, U128_MAX} from '../util/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; diff --git a/tests/src/removeFromContractAllowList.test.ts b/tests/src/.outdated/removeFromContractAllowList.test.ts similarity index 96% rename from tests/src/removeFromContractAllowList.test.ts rename to tests/src/.outdated/removeFromContractAllowList.test.ts index 8365dd5f5c..51ddfe9b1f 100644 --- a/tests/src/removeFromContractAllowList.test.ts +++ b/tests/src/.outdated/removeFromContractAllowList.test.ts @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import usingApi from './substrate/substrate-api'; -import {deployFlipper, toggleFlipValueExpectFailure, toggleFlipValueExpectSuccess} from './util/contracthelpers'; -import {addToContractAllowListExpectSuccess, isAllowlistedInContract, removeFromContractAllowListExpectFailure, removeFromContractAllowListExpectSuccess, toggleContractAllowlistExpectSuccess} from './util/helpers'; +import usingApi from '../substrate/substrate-api'; +import {deployFlipper, toggleFlipValueExpectFailure, toggleFlipValueExpectSuccess} from '../util/contracthelpers'; +import {addToContractAllowListExpectSuccess, isAllowlistedInContract, removeFromContractAllowListExpectFailure, removeFromContractAllowListExpectSuccess, toggleContractAllowlistExpectSuccess} from '../util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; import {expect} from 'chai'; diff --git a/tests/src/scheduler.test.ts b/tests/src/.outdated/scheduler.test.ts similarity index 99% rename from tests/src/scheduler.test.ts rename to tests/src/.outdated/scheduler.test.ts index fd870593f6..33305a1723 100644 --- a/tests/src/scheduler.test.ts +++ b/tests/src/.outdated/scheduler.test.ts @@ -19,7 +19,7 @@ import chaiAsPromised from 'chai-as-promised'; import { default as usingApi, submitTransactionAsync, -} from './substrate/substrate-api'; +} from '../substrate/substrate-api'; import { createItemExpectSuccess, createCollectionExpectSuccess, @@ -39,7 +39,7 @@ import { getFreeBalance, confirmSponsorshipByKeyExpectSuccess, scheduleExpectFailure, -} from './util/helpers'; +} from '../util/helpers'; import {IKeyringPair} from '@polkadot/types/types'; chai.use(chaiAsPromised); diff --git a/tests/src/setChainLimits.test.ts b/tests/src/.outdated/setChainLimits.test.ts similarity index 96% rename from tests/src/setChainLimits.test.ts rename to tests/src/.outdated/setChainLimits.test.ts index 39da831ec0..1e3cc05c16 100644 --- a/tests/src/setChainLimits.test.ts +++ b/tests/src/.outdated/setChainLimits.test.ts @@ -15,13 +15,13 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import usingApi from './substrate/substrate-api'; +import usingApi from '../substrate/substrate-api'; import { createCollectionExpectSuccess, addCollectionAdminExpectSuccess, setChainLimitsExpectFailure, IChainLimits, -} from './util/helpers'; +} from '../util/helpers'; // todo:playgrounds skipped ~ postponed describe.skip('Negative Integration Test setChainLimits', () => { diff --git a/tests/src/setContractSponsoringRateLimit.test.ts b/tests/src/.outdated/setContractSponsoringRateLimit.test.ts similarity index 94% rename from tests/src/setContractSponsoringRateLimit.test.ts rename to tests/src/.outdated/setContractSponsoringRateLimit.test.ts index 7f50a2fa85..97f92cbeb8 100644 --- a/tests/src/setContractSponsoringRateLimit.test.ts +++ b/tests/src/.outdated/setContractSponsoringRateLimit.test.ts @@ -15,15 +15,15 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import usingApi from './substrate/substrate-api'; -import waitNewBlocks from './substrate/wait-new-blocks'; -import {deployFlipper, toggleFlipValueExpectFailure, toggleFlipValueExpectSuccess} from './util/contracthelpers'; +import usingApi from '../substrate/substrate-api'; +import waitNewBlocks from '../substrate/wait-new-blocks'; +import {deployFlipper, toggleFlipValueExpectFailure, toggleFlipValueExpectSuccess} from '../util/contracthelpers'; import { enableContractSponsoringExpectSuccess, findUnusedAddress, setContractSponsoringRateLimitExpectFailure, setContractSponsoringRateLimitExpectSuccess, -} from './util/helpers'; +} from '../util/helpers'; // todo:playgrounds skipped~postponed test describe.skip('Integration Test setContractSponsoringRateLimit', () => { diff --git a/tests/src/xcmTransfer.test.ts b/tests/src/.outdated/xcmTransfer.test.ts similarity index 95% rename from tests/src/xcmTransfer.test.ts rename to tests/src/.outdated/xcmTransfer.test.ts index 774e1da60a..e428611be8 100644 --- a/tests/src/xcmTransfer.test.ts +++ b/tests/src/.outdated/xcmTransfer.test.ts @@ -20,10 +20,10 @@ import chaiAsPromised from 'chai-as-promised'; import {WsProvider} from '@polkadot/api'; import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; -import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; -import {getGenericResult} from './util/helpers'; -import waitNewBlocks from './substrate/wait-new-blocks'; -import getBalance from './substrate/get-balance'; +import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; +import {getGenericResult} from '../util/helpers'; +import waitNewBlocks from '../substrate/wait-new-blocks'; +import getBalance from '../substrate/get-balance'; chai.use(chaiAsPromised); const expect = chai.expect; diff --git a/tests/src/nesting/migration-check.test.ts b/tests/src/nesting/migration-check.test.ts deleted file mode 100644 index 44bec04325..0000000000 --- a/tests/src/nesting/migration-check.test.ts +++ /dev/null @@ -1,173 +0,0 @@ -import {expect} from 'chai'; -import usingApi, {executeTransaction, submitTransactionAsync} from '../substrate/substrate-api'; -import {getCreateCollectionResult, getCreateItemResult, normalizeAccountId} from '../util/helpers'; -import {IKeyringPair} from '@polkadot/types/types'; -import {strToUTF16} from '../util/util'; -import waitNewBlocks from '../substrate/wait-new-blocks'; -// Used for polkadot-launch signalling -import find from 'find-process'; - -// todo un-skip for migrations -// todo:playgrounds skipped, this one is outdated. Probably to be deleted/replaced. -describe.skip('Migration testing: Properties', () => { - let alice: IKeyringPair; - - before(async() => { - await usingApi(async (_, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - }); - }); - - it('Preserves collection settings after migration', async () => { - let oldVersion: number; - let collectionId: number; - let collectionOld: any; - let nftId: number; - let nftOld: any; - - await usingApi(async api => { - // ----------- Collection pre-upgrade ------------ - const txCollection = api.tx.unique.createCollectionEx({ - mode: 'NFT', - access: 'AllowList', - name: strToUTF16('Mojave Pictures'), - description: strToUTF16('$2.2 billion power plant!'), - tokenPrefix: '0x0002030', - offchainSchema: '0x111111', - schemaVersion: 'Unique', - limits: { - accountTokenOwnershipLimit: 3, - }, - constOnChainSchema: '0x333333', - variableOnChainSchema: '0x22222', - }); - const events0 = await submitTransactionAsync(alice, txCollection); - const result0 = getCreateCollectionResult(events0); - collectionId = result0.collectionId; - - // Get the pre-upgrade collection info - collectionOld = (await api.query.common.collectionById(collectionId)).toJSON(); - - // ---------- NFT pre-upgrade ------------ - const txNft = api.tx.unique.createItem( - collectionId, - normalizeAccountId(alice), - { - NFT: { - owner: {substrate: alice.address}, - constData: '0x0000', - variableData: '0x1111', - }, - }, - ); - const events1 = await executeTransaction(api, alice, txNft); - const result1 = getCreateItemResult(events1); - nftId = result1.itemId; - - // Get the pre-upgrade NFT data - nftOld = (await api.query.nonfungible.tokenData(collectionId, nftId)).toJSON(); - - // Get the pre-upgrade spec version - oldVersion = (api.consts.system.version.toJSON() as any).specVersion; - }); - - console.log(`Now waiting for the parachain upgrade from ${oldVersion!}...`); - - let newVersion = oldVersion!; - let connectionFailCounter = 0; - - // Cooperate with polkadot-launch if it's running (assuming custom name change to 'polkadot-launch'), and send a custom signal - find('name', 'polkadot-launch', true).then((list) => { - for (const proc of list) { - process.kill(proc.pid, 'SIGUSR1'); - } - }); - - // And wait for the parachain upgrade - { - // Catch warnings like 'RPC methods not decorated' and keep the 'waiting' message in front - const stdlog = console.warn.bind(console); - let warnCount = 0; - console.warn = function(...args){ - if (arguments.length <= 2 || !args[2].includes('RPC methods not decorated')) { - warnCount++; - stdlog.apply(console, args as any); - } - }; - - let oldWarnCount = 0; - while (newVersion == oldVersion! && connectionFailCounter < 5) { - await new Promise(resolve => setTimeout(resolve, 12000)); - try { - await usingApi(async api => { - await waitNewBlocks(api); - newVersion = (api.consts.system.version.toJSON() as any).specVersion; - if (warnCount > oldWarnCount) { - console.log(`Still waiting for the parachain upgrade from ${oldVersion!}...`); - oldWarnCount = warnCount; - } - }); - } catch (_) { - connectionFailCounter++; - } - } - } - - await usingApi(async api => { - // ---------- Collection comparison ----------- - const collectionNew = (await api.query.common.collectionById(collectionId)).toJSON() as any; - - // Make sure the extra fields are what they should be - expect(( - await api.rpc.unique.collectionProperties(collectionId, ['_old_constOnChainSchema']) - )[0].value.toHex()).to.be.equal(collectionOld.constOnChainSchema); - - expect(( - await api.rpc.unique.collectionProperties(collectionId, ['_old_variableOnChainSchema']) - )[0].value.toHex()).to.be.equal(collectionOld.variableOnChainSchema); - - expect(( - await api.rpc.unique.collectionProperties(collectionId, ['_old_offchainSchema']) - )[0].value.toHex()).to.be.equal(collectionOld.offchainSchema); - - expect(( - await api.rpc.unique.collectionProperties(collectionId, ['_old_schemaVersion']) - )[0].value.toHuman()).to.be.equal(collectionOld.schemaVersion); - - expect(collectionNew.permissions).to.be.deep.equal({ - access: collectionOld.access, - mintMode: collectionOld.mintMode, - nesting: null, - }); - - expect(collectionNew.externalCollection).to.be.equal(false); - - // Get rid of extra fields to perform comparison on the rest of the collection - delete collectionNew.permissions; - delete collectionNew.externalCollection; - delete collectionOld.schemaVersion; - delete collectionOld.constOnChainSchema; - delete collectionOld.variableOnChainSchema; - delete collectionOld.offchainSchema; - delete collectionOld.mintMode; - delete collectionOld.access; - delete collectionOld.metaUpdatePermission; // todo look into, doesn't migrate - - expect(collectionNew).to.be.deep.equal(collectionOld); - - // ---------- NFT comparison ----------- - const nftNew = (await api.query.nonfungible.tokenData(collectionId, nftId)).toJSON() as any; - - // Make sure the extra fields are what they should be - expect((await api.rpc.unique.tokenProperties(collectionId, nftId, ['_old_constData']))[0].value.toHex()).to.be.equal(nftOld.constData); - - expect((await api.rpc.unique.tokenProperties(collectionId, nftId, ['_old_variableData']))[0].value.toHex()).to.be.equal(nftOld.variableData); - - // Get rid of extra fields to perform comparison on the rest of the NFT - delete nftOld.constData; - delete nftOld.variableData; - - expect(nftNew).to.be.deep.equal(nftOld); - }); - }); -}); diff --git a/tests/tsconfig.json b/tests/tsconfig.json index c2eb63e9e1..706509525c 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -20,6 +20,9 @@ "include": [ "./src/**/*", "./src/interfaces/*.ts" +, "src/.outdated/collision-tests" ], + "exclude": [ + "./src/.outdated" ], "lib": [ "es2017" From 19616c6c3deeb302de261ba464311dd53e0329e1 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 14:36:29 +0400 Subject: [PATCH 1046/1274] Fix: collectionSponsoringTests --- tests/src/eth/collectionSponsoring.test.ts | 77 ++++++++++++---------- 1 file changed, 43 insertions(+), 34 deletions(-) diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index a9070b4cb8..5be9ce19cf 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -1,11 +1,27 @@ -import {collectionIdToAddress, normalizeEvents} from './util/helpers'; -import {evmToAddress} from '@polkadot/util-crypto'; +import {usingPlaygrounds} from './../util/playgrounds/index'; +import {IKeyringPair} from '@polkadot/types/types'; +import {normalizeEvents} from './util/helpers'; import {itEth, expect} from '../eth/util/playgrounds'; describe('evm collection sponsoring', () => { - itEth('sponsors mint transactions', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); + let donor: IKeyringPair; + let alice: IKeyringPair; + let nominal: bigint; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + nominal = helper.balance.getOneTokenNominal(); + }); + }); + + beforeEach(async () => { + await usingPlaygrounds(async (helper) => { + [alice] = await helper.arrange.createAccounts([1000n], donor); + }); + }); + itEth('sponsors mint transactions', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {tokenPrefix: 'spnr', permissions: {mintMode: true}}); await collection.setSponsor(alice, alice.address); await collection.confirmSponsorship(alice); @@ -13,8 +29,8 @@ describe('evm collection sponsoring', () => { const minter = helper.eth.createAccount(); expect(await helper.balance.getEthereum(minter)).to.equal(0n); - const address = helper.ethAddress.fromCollectionId(collection.collectionId); - const contract = helper.ethNativeContract.collection(address, 'nft', minter); + const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', minter); await collection.addToAllowList(alice, {Ethereum: minter}); @@ -24,7 +40,7 @@ describe('evm collection sponsoring', () => { const events = normalizeEvents(result.events); expect(events).to.be.deep.equal([ { - address, + address: collectionAddress, event: 'Transfer', args: { from: '0x0000000000000000000000000000000000000000', @@ -56,15 +72,13 @@ describe('evm collection sponsoring', () => { // expect(bigIntToSub(api, BigInt(sponsorTuple[1]))).to.be.eq(sponsor.address); // }); - itEth('Remove sponsor', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); + itEth('Remove sponsor', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * nominal)}); const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); - const sponsor = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(donor); const collectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner); expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; @@ -81,27 +95,25 @@ describe('evm collection sponsoring', () => { }); itEth('Sponsoring collection from evm address via access list', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); + const owner = await helper.eth.createAccountWithBalance(donor); const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * nominal)}); const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const collectionId = helper.ethAddress.extractCollectionId(collectionIdAddress); const collection = helper.nft.getCollectionObject(collectionId); - const sponsor = await helper.eth.createAccountWithBalance(alice); - const collectionEvm = await helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner); + const sponsor = await helper.eth.createAccountWithBalance(donor); + const collectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner); result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner}); let collectionData = (await collection.getData())!; const ss58Format = helper.chain.getChainProperties().ss58Format; - expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor)); await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor}); collectionData = (await collection.getData())!; - expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor)); const user = helper.eth.createAccount(); const nextTokenId = await collectionEvm.methods.nextTokenId().call(); @@ -119,8 +131,8 @@ describe('evm collection sponsoring', () => { expect(newPermissions.mintMode).to.be.true; expect(newPermissions.access).to.be.equal('AllowList'); - const ownerBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(owner)); - const sponsorBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor)); + const ownerBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner)); + const sponsorBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor)); { const nextTokenId = await collectionEvm.methods.nextTokenId().call(); @@ -210,34 +222,31 @@ describe('evm collection sponsoring', () => { // }); itEth('Check that transaction via EVM spend money from sponsor address', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); + const owner = await helper.eth.createAccountWithBalance(donor); const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * nominal)}); const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const collectionId = helper.ethAddress.extractCollectionId(collectionIdAddress); const collection = helper.nft.getCollectionObject(collectionId); - const sponsor = await helper.eth.createAccountWithBalance(alice); + const sponsor = await helper.eth.createAccountWithBalance(donor); const collectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner); result = await collectionEvm.methods.setCollectionSponsor(sponsor).send(); let collectionData = (await collection.getData())!; - const ss58Format = helper.chain.getChainProperties().ss58Format; - expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor)); await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); const sponsorCollection = helper.ethNativeContract.collection(collectionIdAddress, 'nft', sponsor); await sponsorCollection.methods.confirmCollectionSponsorship().send(); collectionData = (await collection.getData())!; - expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(evmToAddress(sponsor, Number(ss58Format))); + expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor)); const user = helper.eth.createAccount(); await collectionEvm.methods.addCollectionAdmin(user).send(); - const ownerBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(owner)); - const sponsorBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor)); + const ownerBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner)); + const sponsorBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor)); const userCollectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', user); const nextTokenId = await userCollectionEvm.methods.nextTokenId().call(); @@ -249,7 +258,7 @@ describe('evm collection sponsoring', () => { ).send(); const events = normalizeEvents(result.events); - const address = collectionIdToAddress(collectionId); + const address = helper.ethAddress.fromCollectionId(collectionId); expect(events).to.be.deep.equal([ { From aa8bcd1e4a39f2056d1c4829fd8fa2c76d9c4ed8 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 14:43:00 +0400 Subject: [PATCH 1047/1274] Tests: normalizeEvents to ethPlaygrounds --- tests/src/eth/collectionSponsoring.test.ts | 9 +++--- tests/src/eth/util/playgrounds/types.ts | 8 +++++- tests/src/eth/util/playgrounds/unique.dev.ts | 29 +++++++++++++++++++- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index 5be9ce19cf..cee319f995 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -1,6 +1,5 @@ -import {usingPlaygrounds} from './../util/playgrounds/index'; import {IKeyringPair} from '@polkadot/types/types'; -import {normalizeEvents} from './util/helpers'; +import {usingPlaygrounds} from './../util/playgrounds/index'; import {itEth, expect} from '../eth/util/playgrounds'; describe('evm collection sponsoring', () => { @@ -37,7 +36,7 @@ describe('evm collection sponsoring', () => { const nextTokenId = await contract.methods.nextTokenId().call(); expect(nextTokenId).to.equal('1'); const result = await contract.methods.mint(minter, nextTokenId).send(); - const events = normalizeEvents(result.events); + const events = helper.eth.normalizeEvents(result.events); expect(events).to.be.deep.equal([ { address: collectionAddress, @@ -142,7 +141,7 @@ describe('evm collection sponsoring', () => { nextTokenId, 'Test URI', ).send({from: user}); - const events = normalizeEvents(result.events); + const events = helper.eth.normalizeEvents(result.events); expect(events).to.be.deep.equal([ { @@ -257,7 +256,7 @@ describe('evm collection sponsoring', () => { 'Test URI', ).send(); - const events = normalizeEvents(result.events); + const events = helper.eth.normalizeEvents(result.events); const address = helper.ethAddress.fromCollectionId(collectionId); expect(events).to.be.deep.equal([ diff --git a/tests/src/eth/util/playgrounds/types.ts b/tests/src/eth/util/playgrounds/types.ts index e7aa9d3905..eda8a191ca 100644 --- a/tests/src/eth/util/playgrounds/types.ts +++ b/tests/src/eth/util/playgrounds/types.ts @@ -6,4 +6,10 @@ export interface ContractImports { export interface CompiledContract { abi: any; object: string; -} \ No newline at end of file +} + +export type NormalizedEvent = { + address: string, + event: string, + args: { [key: string]: string } +}; diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index 6714bf0047..1fb39bf2a1 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -18,7 +18,7 @@ import {IKeyringPair} from '@polkadot/types/types'; import {DevUniqueHelper} from '../../../util/playgrounds/unique.dev'; -import {ContractImports, CompiledContract} from './types'; +import {ContractImports, CompiledContract, NormalizedEvent} from './types'; // Native contracts ABI import collectionHelpersAbi from '../../collectionHelpersAbi.json'; @@ -252,6 +252,33 @@ class EthGroup extends EthGroupBase { return before - after; } + + normalizeEvents(events: any): NormalizedEvent[] { + const output = []; + for (const key of Object.keys(events)) { + if (key.match(/^[0-9]+$/)) { + output.push(events[key]); + } else if (Array.isArray(events[key])) { + output.push(...events[key]); + } else { + output.push(events[key]); + } + } + output.sort((a, b) => a.logIndex - b.logIndex); + return output.map(({address, event, returnValues}) => { + const args: { [key: string]: string } = {}; + for (const key of Object.keys(returnValues)) { + if (!key.match(/^[0-9]+$/)) { + args[key] = returnValues[key]; + } + } + return { + address, + event, + args, + }; + }); + } } class EthAddressGroup extends EthGroupBase { From 25d2901b8a5dc2adad06222658cce902340edf12 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 15:49:19 +0400 Subject: [PATCH 1048/1274] Tests: fix eth contractsSponsoing --- tests/src/eth/contractSponsoring.test.ts | 356 +++++++++-------------- 1 file changed, 130 insertions(+), 226 deletions(-) diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index e21d98c5e4..b220963bf5 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -14,24 +14,24 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . +import {IKeyringPair} from '@polkadot/types/types'; import * as solc from 'solc'; -import {expectSubstrateEventsAtBlock} from '../util/helpers'; -import Web3 from 'web3'; +import {EthUniqueHelper} from './util/playgrounds/unique.dev'; +import {itEth, expect, SponsoringMode, usingEthPlaygrounds} from '../eth/util/playgrounds'; +import {usingPlaygrounds} from '../util/playgrounds'; +import {CompiledContract} from './util/playgrounds/types'; -import { - SponsoringMode, - normalizeEvents, - CompiledContract, - GAS_ARGS, -} from './util/helpers'; -import {itEth, expect} from '../eth/util/playgrounds'; +describe('Sponsoring EVM contracts', () => { + let donor: IKeyringPair; + before(async () => { + await usingPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); -describe('Sponsoring EVM contracts', () => { itEth('Self sponsored can be set by the address that deployed the contract', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); + const owner = await helper.eth.createAccountWithBalance(donor); const flipper = await helper.eth.deployFlipper(owner); const helpers = helper.ethNativeContract.contractHelpers(owner); @@ -40,15 +40,13 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; }); - itEth('Set self sponsored events', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); + itEth('Set self sponsored events', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); const flipper = await helper.eth.deployFlipper(owner); const helpers = helper.ethNativeContract.contractHelpers(owner); const result = await helpers.methods.selfSponsoredEnable(flipper.options.address).send(); - const ethEvents = normalizeEvents(result.events); + const ethEvents = helper.eth.helper.eth.normalizeEvents(result.events); expect(ethEvents).to.be.deep.equal([ { address: flipper.options.address, @@ -67,21 +65,11 @@ describe('Sponsoring EVM contracts', () => { }, }, ]); - - // TODO use helper.getApi() from the sceduler PR - await expectSubstrateEventsAtBlock( - helper.api!, - result.blockNumber, - 'evmContractHelpers', - ['ContractSponsorSet','ContractSponsorshipConfirmed'], - ); }); - itEth('Self sponsored can not be set by the address that did not deployed the contract', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const notOwner = await helper.eth.createAccountWithBalance(alice); + itEth('Self sponsored can not be set by the address that did not deployed the contract', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const notOwner = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -90,10 +78,8 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; }); - itEth('Sponsoring can be set by the address that has deployed the contract', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); + itEth('Sponsoring can be set by the address that has deployed the contract', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -102,11 +88,9 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.true; }); - itEth('Sponsoring cannot be set by the address that did not deployed the contract', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const notOwner = await helper.eth.createAccountWithBalance(alice); + itEth('Sponsoring cannot be set by the address that did not deployed the contract', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const notOwner = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -115,11 +99,9 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; }); - itEth('Sponsor can be set by the address that deployed the contract', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); + itEth('Sponsor can be set by the address that deployed the contract', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -128,16 +110,14 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.true; }); - itEth('Set sponsor event', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); + itEth('Set sponsor event', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); const result = await helpers.methods.setSponsor(flipper.options.address, sponsor).send(); - const events = normalizeEvents(result.events); + const events = helper.eth.normalizeEvents(result.events); expect(events).to.be.deep.equal([ { address: flipper.options.address, @@ -148,22 +128,12 @@ describe('Sponsoring EVM contracts', () => { }, }, ]); - - // TODO use helper.getApi() from the sceduler PR - await expectSubstrateEventsAtBlock( - helper.api!, - result.blockNumber, - 'evmContractHelpers', - ['ContractSponsorSet'], - ); }); - itEth('Sponsor can not be set by the address that did not deployed the contract', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); - const notOwner = await helper.eth.createAccountWithBalance(alice); + itEth('Sponsor can not be set by the address that did not deployed the contract', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); + const notOwner = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -172,11 +142,9 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasPendingSponsor(flipper.options.address).call()).to.be.false; }); - itEth('Sponsorship can be confirmed by the address that pending as sponsor', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); + itEth('Sponsorship can be confirmed by the address that pending as sponsor', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -186,17 +154,15 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; }); - itEth('Confirm sponsorship event', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); + itEth('Confirm sponsorship event', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); await expect(helpers.methods.setSponsor(flipper.options.address, sponsor).send()).to.be.not.rejected; const result = await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); - const events = normalizeEvents(result.events); + const events = helper.eth.normalizeEvents(result.events); expect(events).to.be.deep.equal([ { address: flipper.options.address, @@ -207,22 +173,12 @@ describe('Sponsoring EVM contracts', () => { }, }, ]); - - // TODO use helper.getApi() from the sceduler PR - await expectSubstrateEventsAtBlock( - helper.api!, - result.blockNumber, - 'evmContractHelpers', - ['ContractSponsorshipConfirmed'], - ); }); - itEth('Sponsorship can not be confirmed by the address that not pending as sponsor', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); - const notSponsor = await helper.eth.createAccountWithBalance(alice); + itEth('Sponsorship can not be confirmed by the address that not pending as sponsor', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); + const notSponsor = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -232,11 +188,9 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; }); - itEth('Sponsorship can not be confirmed by the address that not set as sponsor', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const notSponsor = await helper.eth.createAccountWithBalance(alice); + itEth('Sponsorship can not be confirmed by the address that not set as sponsor', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const notSponsor = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -245,10 +199,8 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; }); - itEth('Get self sponsored sponsor', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); + itEth('Get self sponsored sponsor', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -260,11 +212,9 @@ describe('Sponsoring EVM contracts', () => { expect(result[1]).to.be.eq('0'); }); - itEth('Get confirmed sponsor', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); + itEth('Get confirmed sponsor', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -277,11 +227,9 @@ describe('Sponsoring EVM contracts', () => { expect(result[1]).to.be.eq('0'); }); - itEth('Sponsor can be removed by the address that deployed the contract', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); + itEth('Sponsor can be removed by the address that deployed the contract', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -294,11 +242,9 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.false; }); - itEth('Remove sponsor event', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); + itEth('Remove sponsor event', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -306,7 +252,7 @@ describe('Sponsoring EVM contracts', () => { await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor}); const result = await helpers.methods.removeSponsor(flipper.options.address).send(); - const events = normalizeEvents(result.events); + const events = helper.eth.normalizeEvents(result.events); expect(events).to.be.deep.equal([ { address: flipper.options.address, @@ -316,22 +262,12 @@ describe('Sponsoring EVM contracts', () => { }, }, ]); - - // TODO use helper.getApi() from the sceduler PR - await expectSubstrateEventsAtBlock( - helper.api!, - result.blockNumber, - 'evmContractHelpers', - ['ContractSponsorRemoved'], - ); }); - itEth('Sponsor can not be removed by the address that did not deployed the contract', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const notOwner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); + itEth('Sponsor can not be removed by the address that did not deployed the contract', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const notOwner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -344,12 +280,10 @@ describe('Sponsoring EVM contracts', () => { expect(await helpers.methods.hasSponsor(flipper.options.address).call()).to.be.true; }); - itEth('In generous mode, non-allowlisted user transaction will be sponsored', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); - const caller = await helper.eth.createAccountWithBalance(alice); + itEth('In generous mode, non-allowlisted user transaction will be sponsored', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); + const caller = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -372,11 +306,9 @@ describe('Sponsoring EVM contracts', () => { expect(callerBalanceAfter).to.be.eq(callerBalanceBefore); }); - itEth('In generous mode, non-allowlisted user transaction will be self sponsored', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const caller = await helper.eth.createAccountWithBalance(alice); + itEth('In generous mode, non-allowlisted user transaction will be self sponsored', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const caller = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -385,7 +317,7 @@ describe('Sponsoring EVM contracts', () => { await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: owner}); await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner}); - await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address); + await helper.eth.transferBalanceFromSubstrate(donor, flipper.options.address); const contractBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(flipper.options.address)); const callerBalanceBefore = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(caller)); @@ -400,12 +332,10 @@ describe('Sponsoring EVM contracts', () => { expect(callerBalanceAfter).to.be.eq(callerBalanceBefore); }); - itEth('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should decrease (allowlisted)', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); - const caller = await helper.eth.createAccount(); + itEth('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should decrease (allowlisted)', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); + const caller = helper.eth.createAccount(); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -429,10 +359,8 @@ describe('Sponsoring EVM contracts', () => { expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; }); - itEth('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should not decrease (non-allowlisted)', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); + itEth('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should not decrease (non-allowlisted)', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); const caller = await helper.eth.createAccount(); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -440,7 +368,7 @@ describe('Sponsoring EVM contracts', () => { await helpers.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Allowlisted).send({from: owner}); await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner}); - await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address); + await helper.eth.transferBalanceFromSubstrate(donor, flipper.options.address); const originalFlipperBalance = await helper.balance.getEthereum(flipper.options.address); expect(originalFlipperBalance).to.be.not.equal('0'); @@ -454,12 +382,10 @@ describe('Sponsoring EVM contracts', () => { expect(balanceAfter).to.be.equals(originalFlipperBalance); }); - itEth('Sponsoring is set, an address that has UNQ can send a transaction and it works. User balance should not change', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); - const caller = await helper.eth.createAccountWithBalance(alice); + itEth('Sponsoring is set, an address that has UNQ can send a transaction and it works. User balance should not change', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); + const caller = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -484,12 +410,10 @@ describe('Sponsoring EVM contracts', () => { expect(callerBalanceAfter).to.be.equals(callerBalanceBefore); }); - itEth('Sponsoring is limited, with setContractRateLimit. The limitation is working if transactions are sent more often, the sender pays the commission.', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); - const caller = await helper.eth.createAccountWithBalance(alice); + itEth('Sponsoring is limited, with setContractRateLimit. The limitation is working if transactions are sent more often, the sender pays the commission.', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); + const caller = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -519,10 +443,8 @@ describe('Sponsoring EVM contracts', () => { }); // TODO: Find a way to calculate default rate limit - itEth('Default rate limit equals 7200', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); + itEth('Default rate limit equals 7200', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -531,9 +453,10 @@ describe('Sponsoring EVM contracts', () => { }); describe('Sponsoring Fee Limit', () => { + let donor: IKeyringPair; + let alice: IKeyringPair; + let DEFAULT_GAS: number; - let testContract: CompiledContract; - function compileTestContract() { if (!testContract) { const input = { @@ -581,30 +504,44 @@ describe('Sponsoring Fee Limit', () => { return testContract; } - async function deployTestContract(web3: Web3, owner: string) { + async function deployTestContract(helper: EthUniqueHelper, owner: string) { + const web3 = helper.getWeb3(); const compiled = compileTestContract(); const testContract = new web3.eth.Contract(compiled.abi, undefined, { data: compiled.object, from: owner, - ...GAS_ARGS, + gas: DEFAULT_GAS, }); return await testContract.deploy({data: compiled.object}).send({from: owner}); } - itEth('Default fee limit', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); + before(async () => { + await usingEthPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + DEFAULT_GAS = helper.eth.DEFAULT_GAS; + }); + }); + + beforeEach(async () => { + await usingPlaygrounds(async (helper) => { + [alice] = await helper.arrange.createAccounts([1000n], donor); + }); + }); + + let testContract: CompiledContract; + - const owner = await helper.eth.createAccountWithBalance(alice); + + itEth('Default fee limit', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935'); }); - itEth('Set fee limit', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); + itEth('Set fee limit', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); @@ -612,26 +549,22 @@ describe('Sponsoring Fee Limit', () => { expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100'); }); - itEth('Negative test - set fee limit by non-owner', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const stranger = await helper.eth.createAccountWithBalance(alice); + itEth('Negative test - set fee limit by non-owner', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const stranger = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); await expect(helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send({from: stranger})).to.be.rejected; }); - itEth('Negative test - check that eth transactions exceeding fee limit are not executed', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); - const user = await helper.eth.createAccountWithBalance(alice); + itEth('Negative test - check that eth transactions exceeding fee limit are not executed', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); + const user = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); - const testContract = await deployTestContract(helper.getWeb3(), owner); + const testContract = await deployTestContract(helper, owner); await helpers.methods.setSponsoringMode(testContract.options.address, SponsoringMode.Generous).send({from: owner}); await helpers.methods.setSponsoringRateLimit(testContract.options.address, 0).send({from: owner}); @@ -652,13 +585,11 @@ describe('Sponsoring Fee Limit', () => { }); itEth('Negative test - check that evm.call transactions exceeding fee limit are not executed', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); - const testContract = await deployTestContract(helper.getWeb3(), owner); + const testContract = await deployTestContract(helper, owner); await helpers.methods.setSponsoringMode(testContract.options.address, SponsoringMode.Generous).send({from: owner}); await helpers.methods.setSponsoringRateLimit(testContract.options.address, 0).send({from: owner}); @@ -672,50 +603,23 @@ describe('Sponsoring Fee Limit', () => { const originalAliceBalance = await helper.balance.getSubstrate(alice.address); - // await submitTransactionAsync( - // alice, - // api.tx.evm.call( - // subToEth(alice.address), - // testContract.options.address, - // testContract.methods.test(100).encodeABI(), - // Uint8Array.from([]), - // 2_000_000n, - // gasPrice, - // null, - // null, - // [], - // ), - // ); await helper.eth.sendEVM( alice, testContract.options.address, testContract.methods.test(100).encodeABI(), '0', + 2_000_000, ); // expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.be.equal(originalAliceBalance); expect(await helper.balance.getSubstrate(alice.address)).to.be.equal(originalAliceBalance); - // await submitTransactionAsync( - // alice, - // api.tx.evm.call( - // subToEth(alice.address), - // testContract.options.address, - // testContract.methods.test(100).encodeABI(), - // Uint8Array.from([]), - // 2_100_000n, - // gasPrice, - // null, - // null, - // [], - // ), - // ); await helper.eth.sendEVM( alice, testContract.options.address, - testContract.methods.test().encodeABI(), + testContract.methods.test(100).encodeABI(), '0', + 2_100_000, ); - // expect((await api.query.system.account(alice.address)).data.free.toBigInt()).to.not.be.equal(originalAliceBalance); expect(await helper.balance.getSubstrate(alice.address)).to.not.be.equal(originalAliceBalance); }); }); From 1c95a0f366997ecf53a1caa77a6068728ca9683d Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 5 Oct 2022 11:52:34 +0000 Subject: [PATCH 1049/1274] fix CI workflow (C) Alexander Aksenov --- .github/workflows/market-test_v2.yml | 7 ++++--- .github/workflows/node-only-update_v2.yml | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index a81c7d0365..bf31a339bb 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -10,8 +10,8 @@ jobs: market_test: # The type of runner that the job will run on - runs-on: [self-hosted-ci,large] - timeout-minutes: 1380 + runs-on: [self-hosted-ci,medium] + timeout-minutes: 180 name: ${{ matrix.network }} @@ -97,6 +97,8 @@ jobs: yarn install node scripts/readyness.js echo "Ready to start tests" + env: + RPC_URL: http://127.0.0.1:9933/ - name: Show content of .env file and Generate accounts working-directory: qa-tests @@ -187,4 +189,3 @@ jobs: - diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index a442abf6c7..8479ac07ab 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -156,8 +156,15 @@ jobs: exit 0 shell: bash + - name: Checkout at '${{ matrix.mainnet_branch }}' branch + uses: actions/checkout@master + with: + ref: ${{ matrix.mainnet_branch }} #Checking out head commit + path: ${{ matrix.mainnet_branch }} + + - name: Run tests before Node Parachain upgrade - working-directory: tests + working-directory: ${{ matrix.mainnet_branch }}/tests run: | yarn install yarn add mochawesome @@ -173,11 +180,11 @@ jobs: if: success() || failure() # run this step even if previous step failed with: name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created - path: tests/mochawesome-report/test-before-*.json # Path to test results + path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-before-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' - - name: Send SIGUSR1 to polkadotlaunch process + - name: Send SIGUSR1 to polkadot-launch process if: success() || failure() run: | #Get PID of polkadot-launch @@ -185,6 +192,7 @@ jobs: echo "Polkadot-launch PID: $PID" #Send SIGUSR1 signal to $PID docker exec node-parachain kill -SIGUSR1 ${PID} + echo "SIGUSR1 sent to Polkadot-launch PID: $PID" # 🌗 All parachain collators restarted with the new binaries. - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade. @@ -233,7 +241,8 @@ jobs: shell: bash - name: Run tests after Node Parachain upgrade - working-directory: tests + if: success() + working-directory: ${{ matrix.mainnet_branch }}/tests run: | yarn install yarn add mochawesome @@ -250,7 +259,7 @@ jobs: if: success() || failure() # run this step even if previous step failed with: name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created - path: tests/mochawesome-report/test-after-*.json # Path to test results + path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-after-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' From 35058074c9df4d539f095b9bb5294ec56ed80541 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 16:00:09 +0400 Subject: [PATCH 1050/1274] Fix: eth sponsoring test --- tests/src/eth/sponsoring.test.ts | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/tests/src/eth/sponsoring.test.ts b/tests/src/eth/sponsoring.test.ts index 9f0175ef2d..f8462c6a60 100644 --- a/tests/src/eth/sponsoring.test.ts +++ b/tests/src/eth/sponsoring.test.ts @@ -14,21 +14,27 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {SponsoringMode} from './util/helpers'; -import {itEth, expect} from '../eth/util/playgrounds'; +import {IKeyringPair} from '@polkadot/types/types'; +import {itEth, expect, SponsoringMode} from '../eth/util/playgrounds'; +import {usingPlaygrounds} from './../util/playgrounds/index'; describe('EVM sponsoring', () => { - itEth('Fee is deducted from contract if sponsoring is enabled', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); + let donor: IKeyringPair; - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); - const caller = await helper.eth.createAccount(); + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); + + itEth('Fee is deducted from contract if sponsoring is enabled', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); + const caller = helper.eth.createAccount(); const originalCallerBalance = await helper.balance.getEthereum(caller); expect(originalCallerBalance).to.be.equal(0n); - // const flipper = await deployFlipper(web3, owner); const flipper = await helper.eth.deployFlipper(owner); const helpers = helper.ethNativeContract.contractHelpers(owner); @@ -55,12 +61,10 @@ describe('EVM sponsoring', () => { expect(await helper.balance.getEthereum(sponsor)).to.be.not.equal(originalSponsorBalance); }); - itEth('...but this doesn\'t applies to payable value', async ({helper, privateKey}) => { - const alice = privateKey('//Alice'); - - const owner = await helper.eth.createAccountWithBalance(alice); - const sponsor = await helper.eth.createAccountWithBalance(alice); - const caller = await helper.eth.createAccountWithBalance(alice); + itEth('...but this doesn\'t applies to payable value', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const sponsor = await helper.eth.createAccountWithBalance(donor); + const caller = await helper.eth.createAccountWithBalance(donor); const originalCallerBalance = await helper.balance.getEthereum(caller); expect(originalCallerBalance).to.be.not.equal(0n); From 878b12ba681617e27802aec47c77ad39eabfa659 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 16:07:30 +0400 Subject: [PATCH 1051/1274] Tests: eth tokenProperties small improvements --- tests/src/eth/tokenProperties.test.ts | 45 +++++++++++++++++++-------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/tests/src/eth/tokenProperties.test.ts b/tests/src/eth/tokenProperties.test.ts index 6e402cb7a6..8771b1d77d 100644 --- a/tests/src/eth/tokenProperties.test.ts +++ b/tests/src/eth/tokenProperties.test.ts @@ -1,10 +1,20 @@ -import {cartesian} from './util/helpers'; +import {IKeyringPair} from '@polkadot/types/types'; +import {usingPlaygrounds} from './../util/playgrounds/index'; import {itEth, expect} from '../eth/util/playgrounds'; describe('EVM token properties', () => { - itEth('Can be reconfigured', async({helper, privateKey}) => { - const alice = privateKey('//Alice'); - const caller = await helper.eth.createAccountWithBalance(alice); + let donor: IKeyringPair; + let alice: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([1000n], donor); + }); + }); + + itEth('Can be reconfigured', async({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); for(const [mutable,collectionAdmin, tokenOwner] of cartesian([], [false, true], [false, true], [false, true])) { const collection = await helper.nft.mintCollection(alice, {tokenPrefix: 'ethp'}); @@ -23,9 +33,8 @@ describe('EVM token properties', () => { } }); - itEth('Can be set', async({helper, privateKey}) => { - const alice = privateKey('//Alice'); - const caller = await helper.eth.createAccountWithBalance(alice); + itEth('Can be set', async({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); const collection = await helper.nft.mintCollection(alice, { tokenPrefix: 'ethp', tokenPropertyPermissions: [{ @@ -48,9 +57,8 @@ describe('EVM token properties', () => { expect(value).to.equal('testValue'); }); - itEth('Can be deleted', async({helper, privateKey}) => { - const alice = privateKey('//Alice'); - const caller = await helper.eth.createAccountWithBalance(alice); + itEth('Can be deleted', async({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); const collection = await helper.nft.mintCollection(alice, { tokenPrefix: 'ethp', tokenPropertyPermissions: [{ @@ -76,9 +84,8 @@ describe('EVM token properties', () => { expect(result.length).to.equal(0); }); - itEth('Can be read', async({helper, privateKey}) => { - const alice = privateKey('//Alice'); - const caller = await helper.eth.createAccountWithBalance(alice); + itEth('Can be read', async({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); const collection = await helper.nft.mintCollection(alice, { tokenPrefix: 'ethp', tokenPropertyPermissions: [{ @@ -98,3 +105,15 @@ describe('EVM token properties', () => { expect(value).to.equal(helper.getWeb3().utils.toHex('testValue')); }); }); + + +type ElementOf = A extends readonly (infer T)[] ? T : never; +function* cartesian>, R extends Array>(internalRest: [...R], ...args: [...T]): Generator<[...R, ...{[K in keyof T]: ElementOf}]> { + if(args.length === 0) { + yield internalRest as any; + return; + } + for(const value of args[0]) { + yield* cartesian([...internalRest, value], ...args.slice(1)) as any; + } +} \ No newline at end of file From 5721d4c0d16e633678daa6f6a3e77476a328f8f3 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 17:13:09 +0400 Subject: [PATCH 1052/1274] Fix tests for quartz and unique runtimes and skip scheduling --- tests/src/eth/collectionSponsoring.test.ts | 17 ++++++++--------- tests/src/eth/scheduling.test.ts | 3 ++- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index cee319f995..bb9627d493 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -93,7 +93,7 @@ describe('evm collection sponsoring', () => { expect(sponsorTuple.field_0).to.be.eq('0x0000000000000000000000000000000000000000'); }); - itEth('Sponsoring collection from evm address via access list', async ({helper, privateKey}) => { + itEth('Sponsoring collection from evm address via access list', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); @@ -106,13 +106,12 @@ describe('evm collection sponsoring', () => { result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner}); let collectionData = (await collection.getData())!; - const ss58Format = helper.chain.getChainProperties().ss58Format; - expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor)); + expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true)); await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor}); collectionData = (await collection.getData())!; - expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor)); + expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true)); const user = helper.eth.createAccount(); const nextTokenId = await collectionEvm.methods.nextTokenId().call(); @@ -220,7 +219,7 @@ describe('evm collection sponsoring', () => { // } // }); - itEth('Check that transaction via EVM spend money from sponsor address', async ({helper, privateKey}) => { + itEth('Check that transaction via EVM spend money from sponsor address', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); @@ -233,13 +232,13 @@ describe('evm collection sponsoring', () => { result = await collectionEvm.methods.setCollectionSponsor(sponsor).send(); let collectionData = (await collection.getData())!; - expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor)); + expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true)); await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); const sponsorCollection = helper.ethNativeContract.collection(collectionIdAddress, 'nft', sponsor); await sponsorCollection.methods.confirmCollectionSponsorship().send(); collectionData = (await collection.getData())!; - expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor)); + expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true)); const user = helper.eth.createAccount(); await collectionEvm.methods.addCollectionAdmin(user).send(); @@ -272,9 +271,9 @@ describe('evm collection sponsoring', () => { ]); expect(await userCollectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); - const ownerBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(owner)); + const ownerBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner)); expect(ownerBalanceAfter).to.be.eq(ownerBalanceBefore); - const sponsorBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor)); + const sponsorBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor)); expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; }); }); diff --git a/tests/src/eth/scheduling.test.ts b/tests/src/eth/scheduling.test.ts index 2d7fc7e887..a721caaeba 100644 --- a/tests/src/eth/scheduling.test.ts +++ b/tests/src/eth/scheduling.test.ts @@ -18,7 +18,8 @@ import {expect} from 'chai'; import {createEthAccountWithBalance, deployFlipper, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from './util/helpers'; import {scheduleExpectSuccess, waitNewBlocks, requirePallets, Pallets} from '../util/helpers'; -describe('Scheduing EVM smart contracts', () => { +// TODO mrshiposha update this test in #581 +describe.skip('Scheduing EVM smart contracts', () => { before(async function() { await requirePallets(this, [Pallets.Scheduler]); }); From e56f4f262daf2d252fa58696aca448bcac054f44 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 5 Oct 2022 16:25:09 +0300 Subject: [PATCH 1053/1274] Canary tests - disable chain readyness check. --- .github/workflows/market-test_v2.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index bf31a339bb..6a0f753cd0 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -91,14 +91,20 @@ jobs: rm -rf .env cp .env.docker .env +# Temporary disable node readyness check. Have to dig into the script logic. +# - name: Wait for chain up and running +# working-directory: tests +# run: | +# yarn install +# node scripts/readyness.js +# echo "Ready to start tests" +# env: +# RPC_URL: http://127.0.0.1:9933/ + - name: Wait for chain up and running - working-directory: tests run: | - yarn install - node scripts/readyness.js - echo "Ready to start tests" - env: - RPC_URL: http://127.0.0.1:9933/ + sleep 1200s + echo "Ready to start Market e2e tests" - name: Show content of .env file and Generate accounts working-directory: qa-tests From 3d7a4e708efd61b77c2148db3d988b0969a74344 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 5 Oct 2022 16:26:39 +0300 Subject: [PATCH 1054/1274] Add console output. --- tests/scripts/readyness.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/scripts/readyness.js b/tests/scripts/readyness.js index 31bd353fa9..3bf5b3313d 100644 --- a/tests/scripts/readyness.js +++ b/tests/scripts/readyness.js @@ -25,6 +25,7 @@ const main = async () => { } catch(e) { await sleep(10000); + console.log(e); } } } From b41988211357b6acb5905fae9bbb5d6ba42c24b5 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 17:31:27 +0400 Subject: [PATCH 1055/1274] Move test to .oudated --- tests/src/{ => .outdated}/toggleContractAllowList.test.ts | 6 +++--- tests/tsconfig.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename tests/src/{ => .outdated}/toggleContractAllowList.test.ts (98%) diff --git a/tests/src/toggleContractAllowList.test.ts b/tests/src/.outdated/toggleContractAllowList.test.ts similarity index 98% rename from tests/src/toggleContractAllowList.test.ts rename to tests/src/.outdated/toggleContractAllowList.test.ts index 64a01474b3..cf03a6567a 100644 --- a/tests/src/toggleContractAllowList.test.ts +++ b/tests/src/.outdated/toggleContractAllowList.test.ts @@ -16,14 +16,14 @@ import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import usingApi, {submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api'; +import usingApi, {submitTransactionAsync, submitTransactionExpectFailAsync} from '../substrate/substrate-api'; import { deployFlipper, getFlipValue, -} from './util/contracthelpers'; +} from '../util/contracthelpers'; import { getGenericResult, -} from './util/helpers'; +} from '../util/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; diff --git a/tests/tsconfig.json b/tests/tsconfig.json index 706509525c..72b7de8ca0 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -20,7 +20,7 @@ "include": [ "./src/**/*", "./src/interfaces/*.ts" -, "src/.outdated/collision-tests" ], + ], "exclude": [ "./src/.outdated" ], From 879cf3feac5483204a2b02920344f43bf94498e7 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 17:45:38 +0400 Subject: [PATCH 1056/1274] Move old contracts to .outdated. Delete rpc.load.ts --- .../balance-transfer-contract/metadata.json | 0 .../src/{ => .outdated}/flipper/metadata.json | 0 .../load_test_sc/metadata.json | 0 .../transfer_contract/metadata.json | 0 .../src/balance-transfer-contract/calls.wasm | Bin 28677 -> 0 bytes tests/src/flipper/flipper.wasm | Bin 2483 -> 0 bytes tests/src/load_test_sc/loadtester.wasm | Bin 25929 -> 0 bytes tests/src/rpc.load.ts | 155 ------------------ tests/src/transfer_contract/nft_transfer.wasm | Bin 17076 -> 0 bytes 9 files changed, 155 deletions(-) rename tests/src/{ => .outdated}/balance-transfer-contract/metadata.json (100%) rename tests/src/{ => .outdated}/flipper/metadata.json (100%) rename tests/src/{ => .outdated}/load_test_sc/metadata.json (100%) rename tests/src/{ => .outdated}/transfer_contract/metadata.json (100%) delete mode 100644 tests/src/balance-transfer-contract/calls.wasm delete mode 100644 tests/src/flipper/flipper.wasm delete mode 100644 tests/src/load_test_sc/loadtester.wasm delete mode 100644 tests/src/rpc.load.ts delete mode 100644 tests/src/transfer_contract/nft_transfer.wasm diff --git a/tests/src/balance-transfer-contract/metadata.json b/tests/src/.outdated/balance-transfer-contract/metadata.json similarity index 100% rename from tests/src/balance-transfer-contract/metadata.json rename to tests/src/.outdated/balance-transfer-contract/metadata.json diff --git a/tests/src/flipper/metadata.json b/tests/src/.outdated/flipper/metadata.json similarity index 100% rename from tests/src/flipper/metadata.json rename to tests/src/.outdated/flipper/metadata.json diff --git a/tests/src/load_test_sc/metadata.json b/tests/src/.outdated/load_test_sc/metadata.json similarity index 100% rename from tests/src/load_test_sc/metadata.json rename to tests/src/.outdated/load_test_sc/metadata.json diff --git a/tests/src/transfer_contract/metadata.json b/tests/src/.outdated/transfer_contract/metadata.json similarity index 100% rename from tests/src/transfer_contract/metadata.json rename to tests/src/.outdated/transfer_contract/metadata.json diff --git a/tests/src/balance-transfer-contract/calls.wasm b/tests/src/balance-transfer-contract/calls.wasm deleted file mode 100644 index 1caede3bd9922da1b73411f2aeaad0e79438ac2a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28677 zcmeI2Pi!35eaGLMnO&|pOL64bF>Sie+l>-ajnpjv?UHudXcSAfqWDi@*LE+p1)Ghv zlqHd3RJ(93%2on52vQ@5AZXLXMGH8W0s)Ging%}fP@qNNL(%3^Bt>)VK|l&LMbo;U z@9)hnNy|>vAcr1?|I7tb5Aa zhue%>t#a1UsO z`t;eeF426h`3sw8&TXAN7iS91Tzq=d7G6B_J8Lf0!adWQYp0)aS^D^6jikYkZ@R=! zfU4E9yM2>M(oERbY$gfZHC*O>lK9qS%QYwc!~ zj=kv~6;Mdiefn_M%}!O!gya}h>aphR4w+W>2qB~|gyaPvycp7B?lZG*l zr=}XgmFcOeq}|9v@A}Te(LyR0hMh4Xog|39PMSh-a9~eE za`oZkQ&~IBL;40A(qpYxp=sp{S34OwbpO)xOq0b%V$Ta*3VA?>M zVet8E7~I{?jfC%k*yRZtlmJZV2CKzg8Hz^!V{B9U59{5r{u2{${2#^ajySi!<&!jP zG$)*gu;AyCnetCw$;z8Re8&)FUCpVj}i@f986XWfF!S?2j zZa4ABgk?1R!;Zi6N>;QDW^)Yl?|}Kf8-)oZ+b;D+j())QTW)mwyO8v6W0JBl%&S+k z@{SvYIU)%QsYrUA?RVbj_Mb^oGKTqGVBUVCFh?Zq=>7X_pZz~>2X`58Ill2G==BCU(U*Jypn~+YzgUHLUS)s!5dZPHV=4QdfVr~YZx~bkZ(e4a@|HT(`n`+ z2u`8U;_kzT}6Z2kMUbLGq%A+KxOiye9fy^^AUqm?M`5rr180uy-zbw%}Pcex|sI z6|Z^pHk}vma~8aBcKLVxIIXAxhE9enTZ%=M$9ffl#pIr_fSeT;SR{oYYpH=0Am$|! zA0GWn+ar&@<7~bTG`9X6&|V)wlkZWcf$upC`Pc;~IzcxfHQy2vvKJkzJXk;%sl{&` z&mZy0-sA`}E`LglqAHerRN`uNQ>mCy8=Z0t#U!YVJ40(`&sJabT>j+lfE(FYB82J* zYi7$ji4lci;h!B&6R(YAve~fQz7jVUhrpYRoNM94n7K+Q{7{}}j^x4qB`%MDZ3rx} zVlu(${O?;?#(7LGH{|r*N~(OZO!~>ESOPouOISOb zeYs*&3a`*Lm)uLn$Yq6fTs~IFPLp z4B$N^90;2`$Yb{Dap+?E+evaX1+^6OstgIQMy}+C#T}yPh?^<>hUAr&8Chz8k2xR| zH?^K>v zKLl|6634%vJj|srNFEK1Hw=pt9b)J$9MGMj-6VWa<%BrNICwWYrsE+p|MaEYe#X9A{E~Q>mgGJ!VDK25x^A>6S^6A8UBSQ`k)! zZ)UbO^CJWo8cD#| zg~(>G9-+h)f+EG@jYvSibc+bS&C+!0?H_JuDmpdmub*wgRdF!4%L93fJ4E;4(cr;+ z(q^$8hX z6%yeIVN0Al`8Yls2A~SX#ynpNA!|4me$QyqQ3qGiC5f0zZtm`5_07ZL7~62Ag;fJG z!B)_d_V|gF3(`z?GVFVZIMxc2Wx6%&wu}Jz6GoXz1rZQNeUJ_|r%;ID(?!7`M||FF zd`b^Hd{U{1woVJ7N%@g!+8h|Sn4Sm@NJ5xh&v^n#qsLadRBJ>M&IYDBl9&##S}^oi z5~{Ayd_YQ%(3{4Q*`JJaw_Ncb&=lPWR=>BT!49Y4M1)~B#o^NB196s+BaEQwSexC0 zmAMuwPLv_YuW%r>x}UW2zf5*}Hrw5C(OUE$2DZ&7CNd@U^R^4lPkgXV{$j>ketd&v zn|HhYGUc*;sr;et=$&xayfl71MZodx*r^y#PTQ)RE)k30ZO<6w2**^J0VI_)jW5)X z>@2UgBuSGx##|9JQjp`dm8J~bSLFa;UqMwgj$w}|e$!|v6Z7PixUf!+=HZc(L+DTJ z$*qMDl_zLE22Jvk8_2EWj^aQE1!2clHO!flkd&=TPp|_}f3QQWM&;3Mp}s25MhU`w zdwN+`W~ul863%SRKc&7|_2Otd2t*OX3YM^hPv55l)$H;%a<{nm5JI6n(mjf9+0mTOewLiFG^^M}#dP zT_1KQIJ5FJ@*_O93Dvc<6KFahCW|&|mt^H-mAKkR&MO$5352Hu#DP#2oD>7i%Qm?X zYG>)2T0AADnbou+)9=Y}BGZ$@6o17Ed`BM|TM+LhCR8UZY!G)D;Y^;B+S(PXrFB@4 zUAGYh5gky5e|mQ+qL|`CR@_nCZEYPHY8q`Q%fFhSUMS_c{5u!AUK|s{pf)mgk8@J_ zD1Ht*M=!;y%}haW8ZMb9OlpsHHez0&eQ<7Nr*e4?PltwPR(@c^+Gw`B{DBvT2)t}= zZN3v0Ks!y@G%^qkbZrhcKkFJqAatiloU+0;&lp0cuu& zOc>2A_T01u)7RVv>BeS$bbPjA_?3mjA4U`W0|*v>Fhm&T(fei8R%XF+JaZ(FE`Lt1QsA-fG7$ijg)M8MO<57EdWe&-Eu2oCU#O8~8@DJn~1nNGX);tn!3U2S<49pBGA9>&HqEwoU?`)9NPHloH zSQ{fhk{iH=L2MuaI4H%b#K~mr9hrM(Rw|Y>ctdBQ;X|+rk}C@RG3&;f#|bkdQ^J3w zexmAEHRxN*h2z!nT9Ok0%=6$)t=nN)*@Q|NUw(wHvaM*vuDa{^Fwtr07*7PxF9qKU zsa}|1wF)U93fjmslbN!nD3xc)fO$WN7v3F~CXf<)$j~b1ye}4ZH@Y$Q7>#f_&dwx& zdUg|@m?5dJic<~zYh;R~0Z~$VGv>B9S&zPqKW%i7mB0l;O6+R-5_#nw1lk49Lw~yJlBpY#C z4Aq&W6RZSf0v{M(jKZ2lZbOa|V)Ps9Lhb|&CKyxYB5Z|@_IQon;+d<;KT9eKTbWEl zzw#w+f9iY+YR0?>!9?PGRmnL~g_p2IT1!eYLGIbeA8`qp*eip|iA@ly8mT!) zf|FeMzteSkFJBBr`SySP=Wh=;cwm`Rc;|yndd)9ieSX8>&;qRB6rHw3&pd)f7VPh~ z);m)=1)vvGkT4}S2zugY#E83&5oLvK7I1i=k~g}>DKjUjHWA639;lTVC-iDbEoHQ6 zN)h{v4oY7(3Z@exir&j-#UjAjyWXAD3@gceNk@xmw8&r%7pUuDtbohGsEyFshlMKv z(jyR(*U0TrTRRzxB|7E@H8CmGP#4Qdnq@)(%jK;s-Nm->lD`TeKr?lXIx#^*K8vcB9ghm-n7iPeX#Qc}~%F-jep9mZ#d19sB+7xyM+ay+IxGFYc4*J|)jbo!PP1zUQ`O z>h$hNeA5Rx1rjkGl=$%FH^BBIcdqnXpY9PMVi*Q$gUe3*;gbPB` zUAX?y2(OSiArsDsj5e_{P9>_QvFq?zYp*SQTKAgX;RcuU($ANFtS=T6%lY%;E|b^8 z;!)uH5_{t{vpJEVd)j}G#R3IReevt~bB;a?p%E_Bue!8p+yqXj`cb1@q}-*g;UOS_ zWr<3X|GVm{-baxCHVL<*_c&}mqQR2F+!;F-Y*K5@&LZyRdu0!@wn1*r*o!P zWEg%-n?aduc0~Ys6kdR@LwRry#ILvkRIQ-kqYN0sUYmg>Zv=a7PTOG%eJR(|OF=3!d;MW= z2w7cej-XRK()CB>y)LUiz)JxgRm@*VfaDEjM5uAG)lDQ&=oEBr?LDBw`lKR6FLOf_ zd_NF%Ne`obfSMr2)z>qcEmGB%8CJ!SyH5~Is{qSnh%hWu)Sz;kk|{^tUXrG=k;=ZB z*qLwQ5u4$uZE-+Oa0pQD{z&f__xG#ioNfCxs$5&@@B3iWRXV zB)3PagLog(^*sN|=RI_CAoHJOzxh|M{=>h1^G~lG-`sQ!=bYLM`ZW1GwC>!*uDKTD zW2euaKKJxm*xEdO?&5E)ZH6=FE}dUrdvf!0=eEu~w-z?nE`ILpR&YJ%-CeBrd=fq> zAHfw4!4_Qo?Bg@SImsApx;CHQ^SxegzPHd@>@D?{d;Q*^x6)gk@6FH8FU&8_FU>E{ z_vZ)mEAy)hy@mOOg@wh1rG@2%{=#5kWnp!(w>ZDJu(-Imw79(3UmPs1EUqr~mgbih zmKK+mmX??LOM|7ArPbx$^8E6`^5XK+^73+jd9b{)yxQ;e=lcu&#r{%%x!>;(`YZj_ zL2ocWSQso0mIlj%{$Maz8LY1KR_0e0Ru)&5R+d-#D}$AlmDN>9Tm}6qpjX+p$`o~I z#gq8l&u5xX!RPSg;Xs)>=Km(f@8febpTN)ILvwSJbB7+SMEwcAuYTh6nX_xp+`IPl z`DfPLExY!Cdhmhl&@fCnNm3A7N_eH=Po%{MBvQNBvVv zpq4-_fm#B!1ZoM?5~w9mOQ4oOErD7BwFGJj)DoyAP)neeKrMk<0<{Ec3Dgp(B~VMC zmOw3mS^~8MY6;X5s3lNKpq4-_fm#B!1ZoM?5~w9mOQ4oOErD7BwFGJj)DoyAP)nee jKrMk<0<{Ec3Dgp(B~VMCmOw3mS^~8MY6<*5k-+}|#Z8## diff --git a/tests/src/flipper/flipper.wasm b/tests/src/flipper/flipper.wasm deleted file mode 100644 index 1d176595a96517e79af9faa6e4a5511af76e5ce7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2483 zcma)8O>Z1U5Ur~2Sx-E>*>*yZ6$|Jc63G!*T14cvEQGdKvKJo^9Jt3;vP6u(;cE-i?V5YwD74J$S?+{h7sI6bw++=4XjjPC6nJ|t&v@9gc-rTHHg7Jg;s$-5N# zRms=LbMTd?uvpzN)HAwX)U`WXJ6-3q^#E$io;}3_IS%BNYhXA%UveIuBd|{rAuCb0}fknTpP9oUVEZqS6!oGz*1XEphK4&vR$DI3d#!Q z9Yhm#g9Hu&!@Ri^;B^T$_-Lv4_KY}Zt0qpAIJGcagE%E;x=zHwOHG^x4B`aL zB<|E^k>t8)xLr3bofsjlqBxSA8u!la6Fcwo#Fe^ea?kD9~rh+rFq zM8zjF$P-)y*Knxex2wSJ@&=p={B^j=Mc|GpV20O;F&GV^=I%S5S&HNh=p$-+9?-{< z%f!G)u$lmWK+WgDZYh(?k~c-Gxn>z*9;rVC$qR^CA$Wp29OkM7EKLMaV1;^*dI-0v zQAwa8-W#nWFE2d3806nPDav$>QJXO+54;dmXjWigg~(l`Vl%1uS_K6%CA!A-jfAsH zVQKLw*C;xTUtdjUsklzkSJ|hC3-@RXOkkBz7oeWtzCwZAf`%XDL>rI>Qv9AtHsMFO zMBNyL^kssl?d%oM8RGJWNNB^jRh--=mfW{NE{Qr61G{UZH5q$)V~NvI`G zs~g)u0Bv1A9L~+@q;ACe^)1m(;^!&?CX=8P=tlylf^(NOV{P0Z3&&i?pera3Pd?um zqpzTyEkM^Jr&s}JH&8F<2BG%!>*eJ$JHhSJZ)^K2*d*uPx@25p>QXXOoCX1*>aAD2bIxB{x{~eg?z$^Me>}f>^t*KV~A*gY@8|dAx3xDND+2-}vhp%kD^6K`R!G~&aYxC;0)0O_dcx!X# z#albCZeRW8rgQ1V$L+=ISFgRc`Qpy@)$6x@XLEad^Cjog>&NW%H?D17-CoQLhnM{3 zp(V5QVq$ZC_xg?3cJ`MkjkLYF^V;@x=d$&+JRkTx_rdw08~KsXd=ZLbG#FfzRKHvS6Yxn$C<4-V9|MY6L4d-Vr`nH%iA-cAjpUm8P zCQ3DLGAJttl$CjtLx~GYbSJZd(P=eiZuqa*YH`lIm@n4ixtho9@N+SbVgEUL>qU0m z+w*JTH|hNKUcLs8p6&Q^-_5I2O=vU3ilLpHpJj=veKh7UpA6P^Mm{8v$n0w5;y?!W zj_VmaZ6NrSv}!e}13hEr8XaTiW!Mq*Cmk=7#7lO5mK)MuV!XVb-C&Gc3%6sG&W$Wq;{lsi7tOD!ldF#(ONAGE%Sqtb64*dLtNUQVZ(z&ww zj4N|T=LaDv^nu%I0wV&FB`6m9GLpftz`#fb!9xBZsaGYJsi0sb7(vsStyxVPe*mq$ z!!8iyz*3Be`3xW)EZePjI;~RHK4Kg)ENi}iNQj8oGJ@0VSpflF2c1R8>=x!Di(A-^ zlPPqI3z+u};l;kLePD!z$gcgN5f-pG=}-F6><{+4LGwBg;RE76rNJ+#3dKh=8nv)<(U<1pOycX0Uo zIDE2?)sNZ-q(|)o(oeCEFD>i?OTiX#55I^YP1Xi^f-JbnPdQf)VxCNS(E6J*7tY4a z;t_M-_8(8P!QS!w>H-$iCQwY2^1s^;#<#$aTDTO72)65|B2sVIl zLCMB2ngLD?a#-BF8O6bcI*-{ol0-g3P;G9Yz?n%1qb4CdACmAWli0tiGx)RF#=Xr% zn1^O!oQGyk)69anE^M;I1qLt_pD!T82yqZXuib^>dLGsDv8@7dSnSZ zbHZ;ve+Km`GI!oHJRFfb?-_!B7d+EA7#tps$3uH-QYV9DVl1i(4V*SR^QRn=^GFt| zfEXc?^C~lJ_%B=HWoqYc$t#3Oatp027o{F}Ped&r+V|wg$tyH;6*V;e0)lsLvnoA! zbB@*Ua>9pq_m%c6;|&QcRVZKgnd+BntH}i&Caumj6NtDX`)KtjUqPl!lm6C0$Aj)z6s<<AK?#~Vjw{qr)F|DAcWfmD>LvvvU3=;2!21Qr&u@?e@luI-~%18mPWIB2n z&s<<~K&lxm7!Az`es2?zKjJf*jJFoTFS|(CH~fH6ed7hQS2`F8Kal`sX80{b1HU6N zJxlt~ z*s4qx4F8)w5sxshbw|olO0dNoJP_aD=uEf+BiCqButt+7iNQ9SVj)Sb!xqQA$`Z^? zm*N4&>)U}9L+$U+mx2#ES8n9%ux2Smfoxf%!9J-~;bx>iwj)S4(jYhTw+@q8{!InU za_;@Ew3auS&`=?&M>Jj?OLSEeR+}Yys2+zqo1ubDf`#_O53`$5X9h8e&rn z+0*m#J3gg+vRFF6RErbAA};!qfs=roIw({8Y7D0wHJBVWPZgO{-Kc7={g7(Lvm451 zONG>KD&XjdmS0lwqt1nS%?K^{$*$714Dj#V!E`l9t{TL+ZLHuNQg9Nv$RDajhU%Nh z7E+)Uak$ltW1-SvB$rf)DnYUCp_$o`;E0nx`#An>RkY1lLXE?Zf;_Z9u%H8S+HW7? zVS;#QS37ao;afDuAn95RlI+hod?95y!(K_ia%9YL{~QFmBJ8URRd9J^TX8)Chr(Ld z1J;)#_yw-Aa^6|~#s#Jgne2UF*E^q`8Ipvmh$s+@kFPvfBPzOavrr;X>rd4TLWJ+|ao%YkJ zQbr8-Hi~aWckiw8xA8n2!q=#U@n>v;Y1pu(1>e52XYt;OR@w1D zbu(3>ieYR?aUnM&ZYvHTk4ytJLT#>?%-+rLQVK>qsDAYFOJGtD-vuW8BMwtz#bKW8 zw*)?uVc^P-(XXD82C-2j&z0TFyR#x7O}?AmQR`^|_yIPKWl4Ga|DsEZ-`gV~{i8=% zyKT6y9><~T7bCrs*?q2{J|IEZ{p1JGpJ=jo8>h3HkJ-kD`g!t?nrtI}`(4${8!NN} z+KP6F*d&D4#Uyi{NY^&scjviO$lK4TA#@QqfOOD(TU~QA-4xx0ece5NTP@EY2+|+=x%yiDLDy{y+YGR=v+kuDQvs4Q zly}t>{>xU3g_)Bb**SRwH(~(yXDj=2^-vvtcxcsCMyEx&PaE^_-9TAD%Z+B6Z=1Oz z5_Nl$e|V4D)76fR#{5n!tx?2$S$bcL`5NV}ErA8Q>WGX>>iSZ;e`6)PsA+UjQprA3 zEEW~lnnL9!H6&cPj8*T76nr<-Gu9O}Tn#TF^Wr`=QMnYB2`%m*5>@UBb#XgOawS#> zQDbbj|GD6Wa1($B;fdGghR{ejeX1(8&A(@wQ z?FyGGk2UxqS2m0V0ODu@An_Bbqs+GiBRhCre=aMRQbE`YwqRK)VxWUM+}!4PH@=KI zC#0L(oa-i+Ikb(xc8u>A*@nN3ojY%3O*soy(DaGCB`e zmCnm{K$9u2={rI@qTvf=p*!`2QuO7WMOAE=a}Dwgyo45r4C!e==_WO7uIa;u4q8-r z>u4Ed5J4o>UG~J~fx;E%9bjI}109ql`PQ`T{`Q$_^V6NOOkHq zrAcQAf89>ae?Raghgf{6&ftrZB>FAVt>e&SCsQgL1%Ivz$h{XS2gP{pEa6h5`REep z*;%$jF9pu1tMWKhNy6Cn_Duqo-)i5ObEh`G2ze5@n8_AzDY&;tx7-eKt7U}@sd9pu zGH-GL!dRa<6^MC|a*4oXXO{gf_8G;=O}p08PU+ZX+xl&L;2eV1#@gL!cW$Ag)A`db z^F&Wnr%GCZ$JwpGK69**RFN0~5pi7{y2od5B!EHKBL{9NcF>B%^QZ8ZHQ) zgPahz?`V=8Zej40lUj}u{Px8uHEf#10elmu6bq%YtZ_e1-0v@1k2U!~WM>j46^lzr znb#9BHR07l@+9oTay~2_j-mOOQWDcl#>r%&bX=B%BzX^mETrerXKkH4v_EqKGk8;Zj=+hG8mi^sTH!p3-Dw859@pi({4__KVYXm^>`5}sr~ zS_^%#61q%%74ZsvJ53OuxRqAtF~xqIiItO4F^=QqfhsxED17Q_!<_Kf)AkI)H-Wf2 z{Nq2I_(W9Tu=AbLg4aQnxc@o+2gK){pg9h7)J!3nE<&-f-Fh>y{2V}unN0D3_#!Zv z&Wwz4{J}JII>=PUSjK$Spk=g=PC#lhQ|)7`&g_SVvk|jkoB%;xg{Gj;Wu}^L9=jkv z%Z2^T4vlBdKkRvI8|=#y-Z>Ze&G=PF8}K{icf@bOul=+{!t$*>jqQJW1bPH|1bPH| z1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH| z1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH| T1bPH|1bPH|1bPJiA0Y5wQG7SE diff --git a/tests/src/rpc.load.ts b/tests/src/rpc.load.ts deleted file mode 100644 index e16126103a..0000000000 --- a/tests/src/rpc.load.ts +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; -import {IKeyringPair} from '@polkadot/types/types'; -import {Abi, BlueprintPromise as Blueprint, CodePromise, ContractPromise as Contract} from '@polkadot/api-contract'; -import {ApiPromise, Keyring} from '@polkadot/api'; -import {findUnusedAddress} from './util/helpers'; -import fs from 'fs'; - -const value = 0; -const gasLimit = 500000n * 1000000n; -const endowment = '1000000000000000'; - -/*eslint no-async-promise-executor: "off"*/ -function deployBlueprint(alice: IKeyringPair, code: CodePromise): Promise { - return new Promise(async (resolve) => { - const unsub = await code - .createBlueprint() - .signAndSend(alice, (result) => { - if (result.status.isInBlock || result.status.isFinalized) { - // here we have an additional field in the result, containing the blueprint - resolve(result.blueprint); - unsub(); - } - }); - }); -} - -/*eslint no-async-promise-executor: "off"*/ -function deployContract(alice: IKeyringPair, blueprint: Blueprint) : Promise { - return new Promise(async (resolve) => { - const unsub = await blueprint.tx - .new(endowment, gasLimit) - .signAndSend(alice, (result) => { - if (result.status.isInBlock || result.status.isFinalized) { - unsub(); - resolve(result); - } - }); - }); -} - -async function prepareDeployer(api: ApiPromise, privateKeyWrapper: ((account: string) => IKeyringPair)) { - // Find unused address - const deployer = await findUnusedAddress(api, privateKeyWrapper); - - // Transfer balance to it - const alice = privateKeyWrapper('//Alice'); - const amount = BigInt(endowment) + 10n**15n; - const tx = api.tx.balances.transfer(deployer.address, amount); - await submitTransactionAsync(alice, tx); - - return deployer; -} - -async function deployLoadTester(api: ApiPromise, privateKeyWrapper: ((account: string) => IKeyringPair)): Promise<[Contract, IKeyringPair]> { - const metadata = JSON.parse(fs.readFileSync('./src/load_test_sc/metadata.json').toString('utf-8')); - const abi = new Abi(metadata); - - const deployer = await prepareDeployer(api, privateKeyWrapper); - - const wasm = fs.readFileSync('./src/load_test_sc/loadtester.wasm'); - - const code = new CodePromise(api, abi, wasm); - - const blueprint = await deployBlueprint(deployer, code); - const contract = (await deployContract(deployer, blueprint))['contract'] as Contract; - - return [contract, deployer]; -} - -async function getScData(contract: Contract, deployer: IKeyringPair) { - const result = await contract.query.get(deployer.address, value, gasLimit); - - if(!result.result.isSuccess) { - throw 'Failed to get value'; - } - return result.result.asSuccess.data; -} - - -describe('RPC Tests', () => { - it('Simple RPC Load Test', async () => { - await usingApi(async api => { - let count = 0; - let hrTime = process.hrtime(); - let microsec1 = hrTime[0] * 1000000 + hrTime[1] / 1000; - let rate = 0; - const checkPoint = 1000; - - /* eslint no-constant-condition: "off" */ - while (true) { - await api.rpc.system.chain(); - count++; - process.stdout.write(`RPC reads: ${count} times at rate ${rate} r/s \r`); - - if (count % checkPoint == 0) { - hrTime = process.hrtime(); - const microsec2 = hrTime[0] * 1000000 + hrTime[1] / 1000; - rate = 1000000*checkPoint/(microsec2 - microsec1); - microsec1 = microsec2; - } - } - }); - }); - - it('Smart Contract RPC Load Test', async () => { - await usingApi(async (api, privateKeyWrapper) => { - - // Deploy smart contract - const [contract, deployer] = await deployLoadTester(api, privateKeyWrapper); - - // Fill smart contract up with data - const bob = privateKeyWrapper('//Bob'); - const tx = contract.tx.bloat(value, gasLimit, 200); - await submitTransactionAsync(bob, tx); - - // Run load test - let count = 0; - let hrTime = process.hrtime(); - let microsec1 = hrTime[0] * 1000000 + hrTime[1] / 1000; - let rate = 0; - const checkPoint = 10; - - /* eslint no-constant-condition: "off" */ - while (true) { - await getScData(contract, deployer); - count++; - process.stdout.write(`SC reads: ${count} times at rate ${rate} r/s \r`); - - if (count % checkPoint == 0) { - hrTime = process.hrtime(); - const microsec2 = hrTime[0] * 1000000 + hrTime[1] / 1000; - rate = 1000000*checkPoint/(microsec2 - microsec1); - microsec1 = microsec2; - } - } - }); - }); - -}); diff --git a/tests/src/transfer_contract/nft_transfer.wasm b/tests/src/transfer_contract/nft_transfer.wasm deleted file mode 100644 index fd5eace8c84595fff2367e5cbea56f7313d7430b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17076 zcmds;Ym8l2b;tMK=iJB4oogSzf)kr??!gV$)W$oG1ZBQG^h&OI*UW zacsw=L<;sKSe0AR${+f{s#?iuquS5_DUFKTM#U9KjnqKh7Kx}2;SY#L&LP`0+jAqV0`?=n0?X~xDyC3~TId71s2TJ%>jPjnr^$8nb)f zz6U=1(C&}!e_+oi4)59j$VVUE@4BhSr1kjd{sSLBJX|Qv_Q=?5A=|V6(dNhYeC**v zj|Cr!Z0iiP2_5e|L~1POWr9C`T3O3^m;0&QP3Fy}3t^edT-NrDJZt#SY=d%KSjaoA z6`}dyo&)#e{f zJG!BCF)Lc7FI~}|$~vW^EgUXdQ=wA^D@T85)-R(W#ASmRiis)TNe$tUM$s=8gAK0p zZdPV7*AMNAdHW&1yX*91=%Do5oxQXxAN_z10769>W*Xv_HOgFAX0bge^Rkha792&t%=%0hZU=WtZB1OvrlAxKoV&XL zFq}vrn3%?}diw}27A&*UZ_Q{c-PVkL>I7_c*Ei8sbLN!?3`5)(Q=Lv*c>3aPopnY5 z7ya#OkNKcrHI^wlozBxfWJq&joo6Y=x8wA_9&16uUdX`Au$$gXT`0PcWO~pGu%i>0 zPV0tS>ER=^bK+9?-2C*BDxWWp-=q36e^1D1ZVzIc9#m-N)YoYa&nt7l7fN~MRDu)W zz$l}}^)-sXlZLk|S2QWA+eGKV5RPUw4u~HRwg*)}2}8T4oZ z@x1TlVn9{Dk&pkcbPtuy+Q8jg)j4fN6A% z=sS|P6CPN{>FotyJLWy=!yMEG_}h$}xx~S5%-U6UIwI5oAz^`HRp~c7xOp&99jTL? zZ+0f?0Vz++iM|)2_z^|53~rq6^Z?JWfk&nL+j94oaPB#ruNyxs;+boj0O0a!mjQWC#>MJ8?P8=~vZL6`~B2?-Cc{(L14-q?wtE zYt-(l{8p?3rCbauvzf4#2c#%?G-kr;5_u{!_}E1n!37~6E|iTFX=7Nu)mXqls1{-= zOYu~=62R*qR3_*^7z8DIU|cm~cCgB0hR)RB=h5$7h8bnTMts#DjN#E<4skOXFo4_c z*02&>Sk0R^h@+eJ>kUl)t(O^_5q4Yrdd$&}{aw6Z_lDD$?Yr_cGhuw1oM|9jKWG{m zR5UZqBlQFFou)y)sEnr3-EI^GodtgK9fx{mav_ey6dHqbBGJ7LN_Z(CN-x|>)+uhN zLOzFRV#Q=aV9OvnNdlZ3fIp_7qm|Y7tv%2{R?^&7Z9 z|HkQMCVbG|zM9_L1GKzA84Eg@7T&+zeL$rxe&4LWpOTb#ySp#dJv8g@Wyn7o^!YgG z56=2~X!&{qX|wy#2&oUw`a1>l13e*r!=P#k!4Hhu@1OM>Xs8BNOAYsp8t$F-B@NdP zD(uVnTK6Pry-p-t0>quO9yN^Dh%C+V5gTSb(jHf8@z!`lIqT6_TsMoi#~aqqdOTvB zylnBcvmWD%cS6k(Edm7GX+0A8+~QZyI!|?HfUsBxS-vg4n6;P5!3Z)3Jmo~{v)uYj zr9LYLBOo2fXmmTZtR0M?bn(rDax#s+c2IUGMb|OnA;GdEwPU@uGl`r7QHcxsVFN#! z%LkqCLn)ueEEnqn3bWZwV_M84O4|_CFt_wqecrh&b3T(5hznk0A#Fb_ppG(iuOI<> z9w&^+lLM9PY|Ivj4Gvs7Mrs;ga*$9)6>Wrs@nznLLtK?qJ`JvLa!8n74pex+U0@`; zUCJNIKoANg8?opTU4&pZsl%)>G;G_d5pe@Aac=L%;L`ghy(dKw-b8KiH30)Hi_TO_ zrqdV53eNbnJerL9$UnDxO-9r!!EfNxGOSMjZA<+$jHp-7%=5e0uUBU}x@xVo`c!jN zYKYp~M#SEBYgg6-TJwKyZzXCOxb=FX^OD{&0dT~~I^JB{YBJDP)jVa z^~TsFw%M#pS#_Xli90pVtG3u?I9ilq*w^Hd)rEbn5&LQa645ZKCZGu-=#LnJ%)txOEG-5botYS?GwbWio~3o=29{ z%3{37+)yJdK9nv5`Vv;MQ82sUi{%tRg2HmOcx!2krq-aRFD9)mTxk@&%DT64LcKek zH3)ohJ^mP%epvogcDwVNb795NhBSI1-&+wH10E6DrN5;^W^IQv6Taaoef3HF>UovU zL(pDHX=8RC9bF(eFh{)*2F1#1<>^ZPt=lSB&i`0HZ~0WUQc)Vw+RFL0JR3XJXo{`RgmF;CgEZ8)ZK!^;2W)b8UM zj4en2*qeC%C0i3Hx!L`RF^Gmtw#Ua8vY|%=t1a#`*{nZ{`qFYP6J57vukgCroxw@p z24+4!o0$`AP<$>G*SS21hK9*_mGaaZ1~1fEHmqm+fo}@V{7&T zW$AkYy3$0Y7VL)&+9R0i89vsuHZ`qR{96wx#1?njfJ_F5xSC+QM}!%FB=akfh9JaO ztOl?~HQ%OYm8_gd0c^AWRZ5!U1>n1=GC}CSdKtYCKLrEYWn#crtehBd(aM)HfR&dr zfQ7HdfJBuM14Ni11K1(Geg=GY2?Neu$^apFhPj6bitjS8V+`nbS+E~A83Pt2>N@qQ z1qd0CZ;+nG1mOAX2eEzm&tzUY*0w8QDi178iybmR`MX75n2Q96og^ho1w{ zr)v(M0lAanu$f-n7WEX3*kh_EZWJJ(q{V3kZ; zw^Oc?*<<6UZ7C^}UJGX-6G~7L+r?X}79QBF{!BP0U|KW5OiX4I&V=U$6|~d_qR<@K zoJ?}rH8Z?OWTZ|KWU}!Js1|V(TlHm3C8jXa zRPNOD$_{CLJjmAM_=LU@ewAZN5G(hi$MNWy#t%aQ(gRy(Ry??K9Wg4-E$ zaWAornk2o$+GTU+I!M7DH|9gqohHIJq{>I&^SolPuZNRFeeDfnBnOP6|1Y&<>eeS58`bjFM7(sV8+7n5fA@P8)bhT?Ysi zABde7%zyTS)Xw}L#DZ?{vyY*zlBh^fuoFmz_~)1MtjxOk6zQ+UYQiANSsy7=<_TxG z5gzwe#lQw{Xh6`Mk-10)1nn8s$Yl6S7^@ zJhKFT7?Q|-;iqL>(VAlA{1ZR2AY^{wpTF?kzsTO-owyFk*^rFeGZ?W(ZQQ;|%+Mgq zpm^zPR%Qkx!2+{arguJBgJ;M=rTO`t=NuOZU{w8L2L?aMjloUXXs(+BQdMGGN7UiAxxzJ zp?8%)_V@5Ci-9awVQC;M=E}1|%IqvEc>Hn&K|olCuxLa!1caIt_#`oDTAOrw5l{n> zeLmPJP_odP4qNs87jNtp%Q51rOn?XL;Ade?{u2YQQv8nhd-rjEFw->4>u69Tp* zSTlTvmaX+s5&nPKG>#x(x^)b>F;6qwsP&ZfE3YK!L+n`~or#~Z#e ziW!_pDFHctAHQyrM94nk_zPBpVHwtlzpwgP{~}T(;kn4Z`kW++-544n7&j6M;J%g6 z1@o7D4;Pzt)#tAXm%yghuA%y1$5emH;Nb2%j zV7IkH@sF&%h{rjL<0MNFL`i_mIo2ydR3Ky^15r=?OL#%=2sp^8)l_&1tX8Kj-WMs3 zw(;@Hyw&6prE2nsQZ;!*DbUp1e@k(UQh(3uBBcnU&I`brQWjGac^SoODqev+rg z_Yf~qw2;xq|Df1SwJ%fDi5QE1gW_azC1Wx+E_y?GgRn;IpG4S8q-~M5wi%av8CBQU zRK*Dm<;_wywY-t)y`sEv>~uL**_w0-gWd?uGh(nWtx0qKry-40Q3v|*Aw$|+O87=tkk8-YIJ-JW#zE$3dFN~344reNWfoEr6pi{ zO{LYYc1Z6o7{5~t>N{ajVFD8ao{3b=0?BYLB45|1J z6k9sJT51UK57JjN4A+=pkbSr)ImIHFjl>*WRbGj8Yi-4AD3vyPQ?QrZi}G!$w5BA6 zyPCx`xAGd|Ns8bK#2#3B2_@NWaMD1)w(Jfy`K&%s+Uou1gHg@vNn z(rbsK(Zx?ck@q!L5B6qJO$OabtXsig@8TP-6eVvt)-6f0+9~``*d4Z zH6Q}3@@V&*9=Wc9Xc+jH?k)z~d8yJ{u+=h3Io6t>G2cmEnr;f8Tj>r&3FA9uQ>_za zb4SmGxl)Na?(B^b0f>zV5W|Q-8g+~aH!>Z-P4{x3(BMUagVK_LcDgwt_@*?lPudb+ zAvsh~?O<8fBOTNb?b^DXrnFqc(rszoQuoT5oP4oi=Jfrh;EG>1uOk6rBio1iPS;xC zrU ztkAh^(nmw*;h9;tKl5$Jik{FC< ztr2FjKg`mpJLFm-?YtY;IC>i6+J+?UrFd|ev=0@8)8Mfo>yxyvtuuBsT_WHXjr<}A zI0v?4c&|=!TD%ScH_;gh_*5F${`m;FOtpW%>7O9Ds(_m~o0#hw$WJHLkmVa;fWZ!k zO*~`8%t=~#JtaGpj>k{Z!X8weE_(I1BB``t2NEO04$oKzn~)?+-9ban5~k|8peM6& zlR>X{WK!x^yiA=bSV?-zDLJ#UbhO||uyu99C5zAMwW;P+G@jL4OK+=rJEymX-qw^k zUK=QNQ^Q6xTb{NlI>1j=>Senj8Hu#!YSy$}5l7z|-%4Yesb9u{Z?d%U%#&shhN&Q_ zwH98f0(g)su?d+&N=?m6!>+8Lsf!zh+Ptn#$oUfIY*3KxI!LxI88(CL2Sp&C4Z!_(@$)&mY^g^;AcDO?Pgd^ZW zGD5_fN#g9<#k)q=KfMlFY&PA2);vT{Q-gxZ6dO%}M|~alvO6CP2y+asuT7^r9}HP~ z=ObMS#2iYJZSgkHa|h!FT|zw)=E8WCE%jQGr)`@pFkHF6X9~>cu zfiGyxdE>4@LP0)`K}h6j?JtFN8Ye^A%GnGT0qN$@zFQ(ThoSXTwfId$AXCkTThx@%Hwt->6USUh^0 z#bV6D?76OtYeve+m zMxr8gjvNFIBUv6FKgdFk_)u2HY9pRIT<4T)bAhok!0GvYSCpVnE(gZkgFgV z1uSwICwgA=y7aen%O-RcicDjxJ<*AiC{>%yDUVi%Q%bMQTgHPlQ_h2&NP`DhG#(-X?j0P+y>#sMYrtjrRK2R+y`u794=Z6v<6wDs2}KC8?>uyGvpd z(A5(HCIJzr&8|W!f`3F#?&E}K($cTvlZ9U$M=)bHX3R9l+N5H5O5L0+s0245%!Wxy zNQ#~ZTw<+yS%{ugIOz<%4cT4dog4~7SaoYws-J3H+hEkIcdhD>Iy4^`VlHN}=X_L4XKS*I)B$>f$dzme(9cTa=G zCW!+T)Ahb&Tg6*H+-R!KUaa1ZVChphAg?9JI(I-DfVM!*T|Z3j6rWv zfShS+@BC4ge9;23iyIDea=(erCXj?oa`40cMhKbIMe=Gfgw`#t>BU!|f$frT6AvJT zZ}M5?Fs8FBKDvA>t@6-d@h+5*V}d@_5N#&hNx_JA2Zg@ap$*wa#DPmS0y>M6<`t!3 zv~mx4IBhz5+BT$z9WBvgdQ_pc`h=qh8<0Fy&;3rGw)9~Nw)6oCx`Db8Z#tU0(X$~zdHvPeqrzZZj?>#7p!bxRK{lx_-CCPc77 z#b#9=^OfDYr?|is7F)SAGl$n_8ughIiOZXAaIhH}s#K8lCT zV1{v*j=ckrd7IzEHdhs0ZaolThaZ2q((1A1tU zNg(20p^q!5Za->H)2gv#K<@VzD>^B5k@+A2qg^q-3dp%xpt9dDN2>TKvhnSFKIg+g z%HeRYiSOhZ;{anV%0n#Kek*%(3&8i}(gfx&31QS5!uI#1CZ1<~#4qN{#~Cp$dw%F5RX|hfAcxH Y=K_Bje>r~*{+j%?_-i|bgB>6K7taM5cK`qY From ced28e83586c85c1f05c14927b3f600c543505ce Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 17:56:03 +0400 Subject: [PATCH 1057/1274] Revert "Move old contracts to .outdated. Delete rpc.load.ts" This reverts commit 879cf3feac5483204a2b02920344f43bf94498e7. --- .../src/balance-transfer-contract/calls.wasm | Bin 0 -> 28677 bytes .../balance-transfer-contract/metadata.json | 0 tests/src/flipper/flipper.wasm | Bin 0 -> 2483 bytes .../src/{.outdated => }/flipper/metadata.json | 0 tests/src/load_test_sc/loadtester.wasm | Bin 0 -> 25929 bytes .../load_test_sc/metadata.json | 0 tests/src/rpc.load.ts | 155 ++++++++++++++++++ .../transfer_contract/metadata.json | 0 tests/src/transfer_contract/nft_transfer.wasm | Bin 0 -> 17076 bytes 9 files changed, 155 insertions(+) create mode 100644 tests/src/balance-transfer-contract/calls.wasm rename tests/src/{.outdated => }/balance-transfer-contract/metadata.json (100%) create mode 100644 tests/src/flipper/flipper.wasm rename tests/src/{.outdated => }/flipper/metadata.json (100%) create mode 100644 tests/src/load_test_sc/loadtester.wasm rename tests/src/{.outdated => }/load_test_sc/metadata.json (100%) create mode 100644 tests/src/rpc.load.ts rename tests/src/{.outdated => }/transfer_contract/metadata.json (100%) create mode 100644 tests/src/transfer_contract/nft_transfer.wasm diff --git a/tests/src/balance-transfer-contract/calls.wasm b/tests/src/balance-transfer-contract/calls.wasm new file mode 100644 index 0000000000000000000000000000000000000000..1caede3bd9922da1b73411f2aeaad0e79438ac2a GIT binary patch literal 28677 zcmeI2Pi!35eaGLMnO&|pOL64bF>Sie+l>-ajnpjv?UHudXcSAfqWDi@*LE+p1)Ghv zlqHd3RJ(93%2on52vQ@5AZXLXMGH8W0s)Ging%}fP@qNNL(%3^Bt>)VK|l&LMbo;U z@9)hnNy|>vAcr1?|I7tb5Aa zhue%>t#a1UsO z`t;eeF426h`3sw8&TXAN7iS91Tzq=d7G6B_J8Lf0!adWQYp0)aS^D^6jikYkZ@R=! zfU4E9yM2>M(oERbY$gfZHC*O>lK9qS%QYwc!~ zj=kv~6;Mdiefn_M%}!O!gya}h>aphR4w+W>2qB~|gyaPvycp7B?lZG*l zr=}XgmFcOeq}|9v@A}Te(LyR0hMh4Xog|39PMSh-a9~eE za`oZkQ&~IBL;40A(qpYxp=sp{S34OwbpO)xOq0b%V$Ta*3VA?>M zVet8E7~I{?jfC%k*yRZtlmJZV2CKzg8Hz^!V{B9U59{5r{u2{${2#^ajySi!<&!jP zG$)*gu;AyCnetCw$;z8Re8&)FUCpVj}i@f986XWfF!S?2j zZa4ABgk?1R!;Zi6N>;QDW^)Yl?|}Kf8-)oZ+b;D+j())QTW)mwyO8v6W0JBl%&S+k z@{SvYIU)%QsYrUA?RVbj_Mb^oGKTqGVBUVCFh?Zq=>7X_pZz~>2X`58Ill2G==BCU(U*Jypn~+YzgUHLUS)s!5dZPHV=4QdfVr~YZx~bkZ(e4a@|HT(`n`+ z2u`8U;_kzT}6Z2kMUbLGq%A+KxOiye9fy^^AUqm?M`5rr180uy-zbw%}Pcex|sI z6|Z^pHk}vma~8aBcKLVxIIXAxhE9enTZ%=M$9ffl#pIr_fSeT;SR{oYYpH=0Am$|! zA0GWn+ar&@<7~bTG`9X6&|V)wlkZWcf$upC`Pc;~IzcxfHQy2vvKJkzJXk;%sl{&` z&mZy0-sA`}E`LglqAHerRN`uNQ>mCy8=Z0t#U!YVJ40(`&sJabT>j+lfE(FYB82J* zYi7$ji4lci;h!B&6R(YAve~fQz7jVUhrpYRoNM94n7K+Q{7{}}j^x4qB`%MDZ3rx} zVlu(${O?;?#(7LGH{|r*N~(OZO!~>ESOPouOISOb zeYs*&3a`*Lm)uLn$Yq6fTs~IFPLp z4B$N^90;2`$Yb{Dap+?E+evaX1+^6OstgIQMy}+C#T}yPh?^<>hUAr&8Chz8k2xR| zH?^K>v zKLl|6634%vJj|srNFEK1Hw=pt9b)J$9MGMj-6VWa<%BrNICwWYrsE+p|MaEYe#X9A{E~Q>mgGJ!VDK25x^A>6S^6A8UBSQ`k)! zZ)UbO^CJWo8cD#| zg~(>G9-+h)f+EG@jYvSibc+bS&C+!0?H_JuDmpdmub*wgRdF!4%L93fJ4E;4(cr;+ z(q^$8hX z6%yeIVN0Al`8Yls2A~SX#ynpNA!|4me$QyqQ3qGiC5f0zZtm`5_07ZL7~62Ag;fJG z!B)_d_V|gF3(`z?GVFVZIMxc2Wx6%&wu}Jz6GoXz1rZQNeUJ_|r%;ID(?!7`M||FF zd`b^Hd{U{1woVJ7N%@g!+8h|Sn4Sm@NJ5xh&v^n#qsLadRBJ>M&IYDBl9&##S}^oi z5~{Ayd_YQ%(3{4Q*`JJaw_Ncb&=lPWR=>BT!49Y4M1)~B#o^NB196s+BaEQwSexC0 zmAMuwPLv_YuW%r>x}UW2zf5*}Hrw5C(OUE$2DZ&7CNd@U^R^4lPkgXV{$j>ketd&v zn|HhYGUc*;sr;et=$&xayfl71MZodx*r^y#PTQ)RE)k30ZO<6w2**^J0VI_)jW5)X z>@2UgBuSGx##|9JQjp`dm8J~bSLFa;UqMwgj$w}|e$!|v6Z7PixUf!+=HZc(L+DTJ z$*qMDl_zLE22Jvk8_2EWj^aQE1!2clHO!flkd&=TPp|_}f3QQWM&;3Mp}s25MhU`w zdwN+`W~ul863%SRKc&7|_2Otd2t*OX3YM^hPv55l)$H;%a<{nm5JI6n(mjf9+0mTOewLiFG^^M}#dP zT_1KQIJ5FJ@*_O93Dvc<6KFahCW|&|mt^H-mAKkR&MO$5352Hu#DP#2oD>7i%Qm?X zYG>)2T0AADnbou+)9=Y}BGZ$@6o17Ed`BM|TM+LhCR8UZY!G)D;Y^;B+S(PXrFB@4 zUAGYh5gky5e|mQ+qL|`CR@_nCZEYPHY8q`Q%fFhSUMS_c{5u!AUK|s{pf)mgk8@J_ zD1Ht*M=!;y%}haW8ZMb9OlpsHHez0&eQ<7Nr*e4?PltwPR(@c^+Gw`B{DBvT2)t}= zZN3v0Ks!y@G%^qkbZrhcKkFJqAatiloU+0;&lp0cuu& zOc>2A_T01u)7RVv>BeS$bbPjA_?3mjA4U`W0|*v>Fhm&T(fei8R%XF+JaZ(FE`Lt1QsA-fG7$ijg)M8MO<57EdWe&-Eu2oCU#O8~8@DJn~1nNGX);tn!3U2S<49pBGA9>&HqEwoU?`)9NPHloH zSQ{fhk{iH=L2MuaI4H%b#K~mr9hrM(Rw|Y>ctdBQ;X|+rk}C@RG3&;f#|bkdQ^J3w zexmAEHRxN*h2z!nT9Ok0%=6$)t=nN)*@Q|NUw(wHvaM*vuDa{^Fwtr07*7PxF9qKU zsa}|1wF)U93fjmslbN!nD3xc)fO$WN7v3F~CXf<)$j~b1ye}4ZH@Y$Q7>#f_&dwx& zdUg|@m?5dJic<~zYh;R~0Z~$VGv>B9S&zPqKW%i7mB0l;O6+R-5_#nw1lk49Lw~yJlBpY#C z4Aq&W6RZSf0v{M(jKZ2lZbOa|V)Ps9Lhb|&CKyxYB5Z|@_IQon;+d<;KT9eKTbWEl zzw#w+f9iY+YR0?>!9?PGRmnL~g_p2IT1!eYLGIbeA8`qp*eip|iA@ly8mT!) zf|FeMzteSkFJBBr`SySP=Wh=;cwm`Rc;|yndd)9ieSX8>&;qRB6rHw3&pd)f7VPh~ z);m)=1)vvGkT4}S2zugY#E83&5oLvK7I1i=k~g}>DKjUjHWA639;lTVC-iDbEoHQ6 zN)h{v4oY7(3Z@exir&j-#UjAjyWXAD3@gceNk@xmw8&r%7pUuDtbohGsEyFshlMKv z(jyR(*U0TrTRRzxB|7E@H8CmGP#4Qdnq@)(%jK;s-Nm->lD`TeKr?lXIx#^*K8vcB9ghm-n7iPeX#Qc}~%F-jep9mZ#d19sB+7xyM+ay+IxGFYc4*J|)jbo!PP1zUQ`O z>h$hNeA5Rx1rjkGl=$%FH^BBIcdqnXpY9PMVi*Q$gUe3*;gbPB` zUAX?y2(OSiArsDsj5e_{P9>_QvFq?zYp*SQTKAgX;RcuU($ANFtS=T6%lY%;E|b^8 z;!)uH5_{t{vpJEVd)j}G#R3IReevt~bB;a?p%E_Bue!8p+yqXj`cb1@q}-*g;UOS_ zWr<3X|GVm{-baxCHVL<*_c&}mqQR2F+!;F-Y*K5@&LZyRdu0!@wn1*r*o!P zWEg%-n?aduc0~Ys6kdR@LwRry#ILvkRIQ-kqYN0sUYmg>Zv=a7PTOG%eJR(|OF=3!d;MW= z2w7cej-XRK()CB>y)LUiz)JxgRm@*VfaDEjM5uAG)lDQ&=oEBr?LDBw`lKR6FLOf_ zd_NF%Ne`obfSMr2)z>qcEmGB%8CJ!SyH5~Is{qSnh%hWu)Sz;kk|{^tUXrG=k;=ZB z*qLwQ5u4$uZE-+Oa0pQD{z&f__xG#ioNfCxs$5&@@B3iWRXV zB)3PagLog(^*sN|=RI_CAoHJOzxh|M{=>h1^G~lG-`sQ!=bYLM`ZW1GwC>!*uDKTD zW2euaKKJxm*xEdO?&5E)ZH6=FE}dUrdvf!0=eEu~w-z?nE`ILpR&YJ%-CeBrd=fq> zAHfw4!4_Qo?Bg@SImsApx;CHQ^SxegzPHd@>@D?{d;Q*^x6)gk@6FH8FU&8_FU>E{ z_vZ)mEAy)hy@mOOg@wh1rG@2%{=#5kWnp!(w>ZDJu(-Imw79(3UmPs1EUqr~mgbih zmKK+mmX??LOM|7ArPbx$^8E6`^5XK+^73+jd9b{)yxQ;e=lcu&#r{%%x!>;(`YZj_ zL2ocWSQso0mIlj%{$Maz8LY1KR_0e0Ru)&5R+d-#D}$AlmDN>9Tm}6qpjX+p$`o~I z#gq8l&u5xX!RPSg;Xs)>=Km(f@8febpTN)ILvwSJbB7+SMEwcAuYTh6nX_xp+`IPl z`DfPLExY!Cdhmhl&@fCnNm3A7N_eH=Po%{MBvQNBvVv zpq4-_fm#B!1ZoM?5~w9mOQ4oOErD7BwFGJj)DoyAP)neeKrMk<0<{Ec3Dgp(B~VMC zmOw3mS^~8MY6;X5s3lNKpq4-_fm#B!1ZoM?5~w9mOQ4oOErD7BwFGJj)DoyAP)nee jKrMk<0<{Ec3Dgp(B~VMCmOw3mS^~8MY6<*5k-+}|#Z8## literal 0 HcmV?d00001 diff --git a/tests/src/.outdated/balance-transfer-contract/metadata.json b/tests/src/balance-transfer-contract/metadata.json similarity index 100% rename from tests/src/.outdated/balance-transfer-contract/metadata.json rename to tests/src/balance-transfer-contract/metadata.json diff --git a/tests/src/flipper/flipper.wasm b/tests/src/flipper/flipper.wasm new file mode 100644 index 0000000000000000000000000000000000000000..1d176595a96517e79af9faa6e4a5511af76e5ce7 GIT binary patch literal 2483 zcma)8O>Z1U5Ur~2Sx-E>*>*yZ6$|Jc63G!*T14cvEQGdKvKJo^9Jt3;vP6u(;cE-i?V5YwD74J$S?+{h7sI6bw++=4XjjPC6nJ|t&v@9gc-rTHHg7Jg;s$-5N# zRms=LbMTd?uvpzN)HAwX)U`WXJ6-3q^#E$io;}3_IS%BNYhXA%UveIuBd|{rAuCb0}fknTpP9oUVEZqS6!oGz*1XEphK4&vR$DI3d#!Q z9Yhm#g9Hu&!@Ri^;B^T$_-Lv4_KY}Zt0qpAIJGcagE%E;x=zHwOHG^x4B`aL zB<|E^k>t8)xLr3bofsjlqBxSA8u!la6Fcwo#Fe^ea?kD9~rh+rFq zM8zjF$P-)y*Knxex2wSJ@&=p={B^j=Mc|GpV20O;F&GV^=I%S5S&HNh=p$-+9?-{< z%f!G)u$lmWK+WgDZYh(?k~c-Gxn>z*9;rVC$qR^CA$Wp29OkM7EKLMaV1;^*dI-0v zQAwa8-W#nWFE2d3806nPDav$>QJXO+54;dmXjWigg~(l`Vl%1uS_K6%CA!A-jfAsH zVQKLw*C;xTUtdjUsklzkSJ|hC3-@RXOkkBz7oeWtzCwZAf`%XDL>rI>Qv9AtHsMFO zMBNyL^kssl?d%oM8RGJWNNB^jRh--=mfW{NE{Qr61G{UZH5q$)V~NvI`G zs~g)u0Bv1A9L~+@q;ACe^)1m(;^!&?CX=8P=tlylf^(NOV{P0Z3&&i?pera3Pd?um zqpzTyEkM^Jr&s}JH&8F<2BG%!>*eJ$JHhSJZ)^K2*d*uPx@25p>QXXOoCX1*>aAD2bIxB{x{~eg?z$^Me>}f>^t*KV~A*gY@8|dAx3xDND+2-}vhp%kD^6K`R!G~&aYxC;0)0O_dcx!X# z#albCZeRW8rgQ1V$L+=ISFgRc`Qpy@)$6x@XLEad^Cjog>&NW%H?D17-CoQLhnM{3 zp(V5QVq$ZC_xg?3cJ`MkjkLYF^V;@x=d$&+JRkTx_rdw08~KsXd=ZLbG#FfzRKHvS6Yxn$C<4-V9|MY6L4d-Vr`nH%iA-cAjpUm8P zCQ3DLGAJttl$CjtLx~GYbSJZd(P=eiZuqa*YH`lIm@n4ixtho9@N+SbVgEUL>qU0m z+w*JTH|hNKUcLs8p6&Q^-_5I2O=vU3ilLpHpJj=veKh7UpA6P^Mm{8v$n0w5;y?!W zj_VmaZ6NrSv}!e}13hEr8XaTiW!Mq*Cmk=7#7lO5mK)MuV!XVb-C&Gc3%6sG&W$Wq;{lsi7tOD!ldF#(ONAGE%Sqtb64*dLtNUQVZ(z&ww zj4N|T=LaDv^nu%I0wV&FB`6m9GLpftz`#fb!9xBZsaGYJsi0sb7(vsStyxVPe*mq$ z!!8iyz*3Be`3xW)EZePjI;~RHK4Kg)ENi}iNQj8oGJ@0VSpflF2c1R8>=x!Di(A-^ zlPPqI3z+u};l;kLePD!z$gcgN5f-pG=}-F6><{+4LGwBg;RE76rNJ+#3dKh=8nv)<(U<1pOycX0Uo zIDE2?)sNZ-q(|)o(oeCEFD>i?OTiX#55I^YP1Xi^f-JbnPdQf)VxCNS(E6J*7tY4a z;t_M-_8(8P!QS!w>H-$iCQwY2^1s^;#<#$aTDTO72)65|B2sVIl zLCMB2ngLD?a#-BF8O6bcI*-{ol0-g3P;G9Yz?n%1qb4CdACmAWli0tiGx)RF#=Xr% zn1^O!oQGyk)69anE^M;I1qLt_pD!T82yqZXuib^>dLGsDv8@7dSnSZ zbHZ;ve+Km`GI!oHJRFfb?-_!B7d+EA7#tps$3uH-QYV9DVl1i(4V*SR^QRn=^GFt| zfEXc?^C~lJ_%B=HWoqYc$t#3Oatp027o{F}Ped&r+V|wg$tyH;6*V;e0)lsLvnoA! zbB@*Ua>9pq_m%c6;|&QcRVZKgnd+BntH}i&Caumj6NtDX`)KtjUqPl!lm6C0$Aj)z6s<<AK?#~Vjw{qr)F|DAcWfmD>LvvvU3=;2!21Qr&u@?e@luI-~%18mPWIB2n z&s<<~K&lxm7!Az`es2?zKjJf*jJFoTFS|(CH~fH6ed7hQS2`F8Kal`sX80{b1HU6N zJxlt~ z*s4qx4F8)w5sxshbw|olO0dNoJP_aD=uEf+BiCqButt+7iNQ9SVj)Sb!xqQA$`Z^? zm*N4&>)U}9L+$U+mx2#ES8n9%ux2Smfoxf%!9J-~;bx>iwj)S4(jYhTw+@q8{!InU za_;@Ew3auS&`=?&M>Jj?OLSEeR+}Yys2+zqo1ubDf`#_O53`$5X9h8e&rn z+0*m#J3gg+vRFF6RErbAA};!qfs=roIw({8Y7D0wHJBVWPZgO{-Kc7={g7(Lvm451 zONG>KD&XjdmS0lwqt1nS%?K^{$*$714Dj#V!E`l9t{TL+ZLHuNQg9Nv$RDajhU%Nh z7E+)Uak$ltW1-SvB$rf)DnYUCp_$o`;E0nx`#An>RkY1lLXE?Zf;_Z9u%H8S+HW7? zVS;#QS37ao;afDuAn95RlI+hod?95y!(K_ia%9YL{~QFmBJ8URRd9J^TX8)Chr(Ld z1J;)#_yw-Aa^6|~#s#Jgne2UF*E^q`8Ipvmh$s+@kFPvfBPzOavrr;X>rd4TLWJ+|ao%YkJ zQbr8-Hi~aWckiw8xA8n2!q=#U@n>v;Y1pu(1>e52XYt;OR@w1D zbu(3>ieYR?aUnM&ZYvHTk4ytJLT#>?%-+rLQVK>qsDAYFOJGtD-vuW8BMwtz#bKW8 zw*)?uVc^P-(XXD82C-2j&z0TFyR#x7O}?AmQR`^|_yIPKWl4Ga|DsEZ-`gV~{i8=% zyKT6y9><~T7bCrs*?q2{J|IEZ{p1JGpJ=jo8>h3HkJ-kD`g!t?nrtI}`(4${8!NN} z+KP6F*d&D4#Uyi{NY^&scjviO$lK4TA#@QqfOOD(TU~QA-4xx0ece5NTP@EY2+|+=x%yiDLDy{y+YGR=v+kuDQvs4Q zly}t>{>xU3g_)Bb**SRwH(~(yXDj=2^-vvtcxcsCMyEx&PaE^_-9TAD%Z+B6Z=1Oz z5_Nl$e|V4D)76fR#{5n!tx?2$S$bcL`5NV}ErA8Q>WGX>>iSZ;e`6)PsA+UjQprA3 zEEW~lnnL9!H6&cPj8*T76nr<-Gu9O}Tn#TF^Wr`=QMnYB2`%m*5>@UBb#XgOawS#> zQDbbj|GD6Wa1($B;fdGghR{ejeX1(8&A(@wQ z?FyGGk2UxqS2m0V0ODu@An_Bbqs+GiBRhCre=aMRQbE`YwqRK)VxWUM+}!4PH@=KI zC#0L(oa-i+Ikb(xc8u>A*@nN3ojY%3O*soy(DaGCB`e zmCnm{K$9u2={rI@qTvf=p*!`2QuO7WMOAE=a}Dwgyo45r4C!e==_WO7uIa;u4q8-r z>u4Ed5J4o>UG~J~fx;E%9bjI}109ql`PQ`T{`Q$_^V6NOOkHq zrAcQAf89>ae?Raghgf{6&ftrZB>FAVt>e&SCsQgL1%Ivz$h{XS2gP{pEa6h5`REep z*;%$jF9pu1tMWKhNy6Cn_Duqo-)i5ObEh`G2ze5@n8_AzDY&;tx7-eKt7U}@sd9pu zGH-GL!dRa<6^MC|a*4oXXO{gf_8G;=O}p08PU+ZX+xl&L;2eV1#@gL!cW$Ag)A`db z^F&Wnr%GCZ$JwpGK69**RFN0~5pi7{y2od5B!EHKBL{9NcF>B%^QZ8ZHQ) zgPahz?`V=8Zej40lUj}u{Px8uHEf#10elmu6bq%YtZ_e1-0v@1k2U!~WM>j46^lzr znb#9BHR07l@+9oTay~2_j-mOOQWDcl#>r%&bX=B%BzX^mETrerXKkH4v_EqKGk8;Zj=+hG8mi^sTH!p3-Dw859@pi({4__KVYXm^>`5}sr~ zS_^%#61q%%74ZsvJ53OuxRqAtF~xqIiItO4F^=QqfhsxED17Q_!<_Kf)AkI)H-Wf2 z{Nq2I_(W9Tu=AbLg4aQnxc@o+2gK){pg9h7)J!3nE<&-f-Fh>y{2V}unN0D3_#!Zv z&Wwz4{J}JII>=PUSjK$Spk=g=PC#lhQ|)7`&g_SVvk|jkoB%;xg{Gj;Wu}^L9=jkv z%Z2^T4vlBdKkRvI8|=#y-Z>Ze&G=PF8}K{icf@bOul=+{!t$*>jqQJW1bPH|1bPH| z1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH| z1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH|1bPH| T1bPH|1bPH|1bPJiA0Y5wQG7SE literal 0 HcmV?d00001 diff --git a/tests/src/.outdated/load_test_sc/metadata.json b/tests/src/load_test_sc/metadata.json similarity index 100% rename from tests/src/.outdated/load_test_sc/metadata.json rename to tests/src/load_test_sc/metadata.json diff --git a/tests/src/rpc.load.ts b/tests/src/rpc.load.ts new file mode 100644 index 0000000000..e16126103a --- /dev/null +++ b/tests/src/rpc.load.ts @@ -0,0 +1,155 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; +import {IKeyringPair} from '@polkadot/types/types'; +import {Abi, BlueprintPromise as Blueprint, CodePromise, ContractPromise as Contract} from '@polkadot/api-contract'; +import {ApiPromise, Keyring} from '@polkadot/api'; +import {findUnusedAddress} from './util/helpers'; +import fs from 'fs'; + +const value = 0; +const gasLimit = 500000n * 1000000n; +const endowment = '1000000000000000'; + +/*eslint no-async-promise-executor: "off"*/ +function deployBlueprint(alice: IKeyringPair, code: CodePromise): Promise { + return new Promise(async (resolve) => { + const unsub = await code + .createBlueprint() + .signAndSend(alice, (result) => { + if (result.status.isInBlock || result.status.isFinalized) { + // here we have an additional field in the result, containing the blueprint + resolve(result.blueprint); + unsub(); + } + }); + }); +} + +/*eslint no-async-promise-executor: "off"*/ +function deployContract(alice: IKeyringPair, blueprint: Blueprint) : Promise { + return new Promise(async (resolve) => { + const unsub = await blueprint.tx + .new(endowment, gasLimit) + .signAndSend(alice, (result) => { + if (result.status.isInBlock || result.status.isFinalized) { + unsub(); + resolve(result); + } + }); + }); +} + +async function prepareDeployer(api: ApiPromise, privateKeyWrapper: ((account: string) => IKeyringPair)) { + // Find unused address + const deployer = await findUnusedAddress(api, privateKeyWrapper); + + // Transfer balance to it + const alice = privateKeyWrapper('//Alice'); + const amount = BigInt(endowment) + 10n**15n; + const tx = api.tx.balances.transfer(deployer.address, amount); + await submitTransactionAsync(alice, tx); + + return deployer; +} + +async function deployLoadTester(api: ApiPromise, privateKeyWrapper: ((account: string) => IKeyringPair)): Promise<[Contract, IKeyringPair]> { + const metadata = JSON.parse(fs.readFileSync('./src/load_test_sc/metadata.json').toString('utf-8')); + const abi = new Abi(metadata); + + const deployer = await prepareDeployer(api, privateKeyWrapper); + + const wasm = fs.readFileSync('./src/load_test_sc/loadtester.wasm'); + + const code = new CodePromise(api, abi, wasm); + + const blueprint = await deployBlueprint(deployer, code); + const contract = (await deployContract(deployer, blueprint))['contract'] as Contract; + + return [contract, deployer]; +} + +async function getScData(contract: Contract, deployer: IKeyringPair) { + const result = await contract.query.get(deployer.address, value, gasLimit); + + if(!result.result.isSuccess) { + throw 'Failed to get value'; + } + return result.result.asSuccess.data; +} + + +describe('RPC Tests', () => { + it('Simple RPC Load Test', async () => { + await usingApi(async api => { + let count = 0; + let hrTime = process.hrtime(); + let microsec1 = hrTime[0] * 1000000 + hrTime[1] / 1000; + let rate = 0; + const checkPoint = 1000; + + /* eslint no-constant-condition: "off" */ + while (true) { + await api.rpc.system.chain(); + count++; + process.stdout.write(`RPC reads: ${count} times at rate ${rate} r/s \r`); + + if (count % checkPoint == 0) { + hrTime = process.hrtime(); + const microsec2 = hrTime[0] * 1000000 + hrTime[1] / 1000; + rate = 1000000*checkPoint/(microsec2 - microsec1); + microsec1 = microsec2; + } + } + }); + }); + + it('Smart Contract RPC Load Test', async () => { + await usingApi(async (api, privateKeyWrapper) => { + + // Deploy smart contract + const [contract, deployer] = await deployLoadTester(api, privateKeyWrapper); + + // Fill smart contract up with data + const bob = privateKeyWrapper('//Bob'); + const tx = contract.tx.bloat(value, gasLimit, 200); + await submitTransactionAsync(bob, tx); + + // Run load test + let count = 0; + let hrTime = process.hrtime(); + let microsec1 = hrTime[0] * 1000000 + hrTime[1] / 1000; + let rate = 0; + const checkPoint = 10; + + /* eslint no-constant-condition: "off" */ + while (true) { + await getScData(contract, deployer); + count++; + process.stdout.write(`SC reads: ${count} times at rate ${rate} r/s \r`); + + if (count % checkPoint == 0) { + hrTime = process.hrtime(); + const microsec2 = hrTime[0] * 1000000 + hrTime[1] / 1000; + rate = 1000000*checkPoint/(microsec2 - microsec1); + microsec1 = microsec2; + } + } + }); + }); + +}); diff --git a/tests/src/.outdated/transfer_contract/metadata.json b/tests/src/transfer_contract/metadata.json similarity index 100% rename from tests/src/.outdated/transfer_contract/metadata.json rename to tests/src/transfer_contract/metadata.json diff --git a/tests/src/transfer_contract/nft_transfer.wasm b/tests/src/transfer_contract/nft_transfer.wasm new file mode 100644 index 0000000000000000000000000000000000000000..fd5eace8c84595fff2367e5cbea56f7313d7430b GIT binary patch literal 17076 zcmds;Ym8l2b;tMK=iJB4oogSzf)kr??!gV$)W$oG1ZBQG^h&OI*UW zacsw=L<;sKSe0AR${+f{s#?iuquS5_DUFKTM#U9KjnqKh7Kx}2;SY#L&LP`0+jAqV0`?=n0?X~xDyC3~TId71s2TJ%>jPjnr^$8nb)f zz6U=1(C&}!e_+oi4)59j$VVUE@4BhSr1kjd{sSLBJX|Qv_Q=?5A=|V6(dNhYeC**v zj|Cr!Z0iiP2_5e|L~1POWr9C`T3O3^m;0&QP3Fy}3t^edT-NrDJZt#SY=d%KSjaoA z6`}dyo&)#e{f zJG!BCF)Lc7FI~}|$~vW^EgUXdQ=wA^D@T85)-R(W#ASmRiis)TNe$tUM$s=8gAK0p zZdPV7*AMNAdHW&1yX*91=%Do5oxQXxAN_z10769>W*Xv_HOgFAX0bge^Rkha792&t%=%0hZU=WtZB1OvrlAxKoV&XL zFq}vrn3%?}diw}27A&*UZ_Q{c-PVkL>I7_c*Ei8sbLN!?3`5)(Q=Lv*c>3aPopnY5 z7ya#OkNKcrHI^wlozBxfWJq&joo6Y=x8wA_9&16uUdX`Au$$gXT`0PcWO~pGu%i>0 zPV0tS>ER=^bK+9?-2C*BDxWWp-=q36e^1D1ZVzIc9#m-N)YoYa&nt7l7fN~MRDu)W zz$l}}^)-sXlZLk|S2QWA+eGKV5RPUw4u~HRwg*)}2}8T4oZ z@x1TlVn9{Dk&pkcbPtuy+Q8jg)j4fN6A% z=sS|P6CPN{>FotyJLWy=!yMEG_}h$}xx~S5%-U6UIwI5oAz^`HRp~c7xOp&99jTL? zZ+0f?0Vz++iM|)2_z^|53~rq6^Z?JWfk&nL+j94oaPB#ruNyxs;+boj0O0a!mjQWC#>MJ8?P8=~vZL6`~B2?-Cc{(L14-q?wtE zYt-(l{8p?3rCbauvzf4#2c#%?G-kr;5_u{!_}E1n!37~6E|iTFX=7Nu)mXqls1{-= zOYu~=62R*qR3_*^7z8DIU|cm~cCgB0hR)RB=h5$7h8bnTMts#DjN#E<4skOXFo4_c z*02&>Sk0R^h@+eJ>kUl)t(O^_5q4Yrdd$&}{aw6Z_lDD$?Yr_cGhuw1oM|9jKWG{m zR5UZqBlQFFou)y)sEnr3-EI^GodtgK9fx{mav_ey6dHqbBGJ7LN_Z(CN-x|>)+uhN zLOzFRV#Q=aV9OvnNdlZ3fIp_7qm|Y7tv%2{R?^&7Z9 z|HkQMCVbG|zM9_L1GKzA84Eg@7T&+zeL$rxe&4LWpOTb#ySp#dJv8g@Wyn7o^!YgG z56=2~X!&{qX|wy#2&oUw`a1>l13e*r!=P#k!4Hhu@1OM>Xs8BNOAYsp8t$F-B@NdP zD(uVnTK6Pry-p-t0>quO9yN^Dh%C+V5gTSb(jHf8@z!`lIqT6_TsMoi#~aqqdOTvB zylnBcvmWD%cS6k(Edm7GX+0A8+~QZyI!|?HfUsBxS-vg4n6;P5!3Z)3Jmo~{v)uYj zr9LYLBOo2fXmmTZtR0M?bn(rDax#s+c2IUGMb|OnA;GdEwPU@uGl`r7QHcxsVFN#! z%LkqCLn)ueEEnqn3bWZwV_M84O4|_CFt_wqecrh&b3T(5hznk0A#Fb_ppG(iuOI<> z9w&^+lLM9PY|Ivj4Gvs7Mrs;ga*$9)6>Wrs@nznLLtK?qJ`JvLa!8n74pex+U0@`; zUCJNIKoANg8?opTU4&pZsl%)>G;G_d5pe@Aac=L%;L`ghy(dKw-b8KiH30)Hi_TO_ zrqdV53eNbnJerL9$UnDxO-9r!!EfNxGOSMjZA<+$jHp-7%=5e0uUBU}x@xVo`c!jN zYKYp~M#SEBYgg6-TJwKyZzXCOxb=FX^OD{&0dT~~I^JB{YBJDP)jVa z^~TsFw%M#pS#_Xli90pVtG3u?I9ilq*w^Hd)rEbn5&LQa645ZKCZGu-=#LnJ%)txOEG-5botYS?GwbWio~3o=29{ z%3{37+)yJdK9nv5`Vv;MQ82sUi{%tRg2HmOcx!2krq-aRFD9)mTxk@&%DT64LcKek zH3)ohJ^mP%epvogcDwVNb795NhBSI1-&+wH10E6DrN5;^W^IQv6Taaoef3HF>UovU zL(pDHX=8RC9bF(eFh{)*2F1#1<>^ZPt=lSB&i`0HZ~0WUQc)Vw+RFL0JR3XJXo{`RgmF;CgEZ8)ZK!^;2W)b8UM zj4en2*qeC%C0i3Hx!L`RF^Gmtw#Ua8vY|%=t1a#`*{nZ{`qFYP6J57vukgCroxw@p z24+4!o0$`AP<$>G*SS21hK9*_mGaaZ1~1fEHmqm+fo}@V{7&T zW$AkYy3$0Y7VL)&+9R0i89vsuHZ`qR{96wx#1?njfJ_F5xSC+QM}!%FB=akfh9JaO ztOl?~HQ%OYm8_gd0c^AWRZ5!U1>n1=GC}CSdKtYCKLrEYWn#crtehBd(aM)HfR&dr zfQ7HdfJBuM14Ni11K1(Geg=GY2?Neu$^apFhPj6bitjS8V+`nbS+E~A83Pt2>N@qQ z1qd0CZ;+nG1mOAX2eEzm&tzUY*0w8QDi178iybmR`MX75n2Q96og^ho1w{ zr)v(M0lAanu$f-n7WEX3*kh_EZWJJ(q{V3kZ; zw^Oc?*<<6UZ7C^}UJGX-6G~7L+r?X}79QBF{!BP0U|KW5OiX4I&V=U$6|~d_qR<@K zoJ?}rH8Z?OWTZ|KWU}!Js1|V(TlHm3C8jXa zRPNOD$_{CLJjmAM_=LU@ewAZN5G(hi$MNWy#t%aQ(gRy(Ry??K9Wg4-E$ zaWAornk2o$+GTU+I!M7DH|9gqohHIJq{>I&^SolPuZNRFeeDfnBnOP6|1Y&<>eeS58`bjFM7(sV8+7n5fA@P8)bhT?Ysi zABde7%zyTS)Xw}L#DZ?{vyY*zlBh^fuoFmz_~)1MtjxOk6zQ+UYQiANSsy7=<_TxG z5gzwe#lQw{Xh6`Mk-10)1nn8s$Yl6S7^@ zJhKFT7?Q|-;iqL>(VAlA{1ZR2AY^{wpTF?kzsTO-owyFk*^rFeGZ?W(ZQQ;|%+Mgq zpm^zPR%Qkx!2+{arguJBgJ;M=rTO`t=NuOZU{w8L2L?aMjloUXXs(+BQdMGGN7UiAxxzJ zp?8%)_V@5Ci-9awVQC;M=E}1|%IqvEc>Hn&K|olCuxLa!1caIt_#`oDTAOrw5l{n> zeLmPJP_odP4qNs87jNtp%Q51rOn?XL;Ade?{u2YQQv8nhd-rjEFw->4>u69Tp* zSTlTvmaX+s5&nPKG>#x(x^)b>F;6qwsP&ZfE3YK!L+n`~or#~Z#e ziW!_pDFHctAHQyrM94nk_zPBpVHwtlzpwgP{~}T(;kn4Z`kW++-544n7&j6M;J%g6 z1@o7D4;Pzt)#tAXm%yghuA%y1$5emH;Nb2%j zV7IkH@sF&%h{rjL<0MNFL`i_mIo2ydR3Ky^15r=?OL#%=2sp^8)l_&1tX8Kj-WMs3 zw(;@Hyw&6prE2nsQZ;!*DbUp1e@k(UQh(3uBBcnU&I`brQWjGac^SoODqev+rg z_Yf~qw2;xq|Df1SwJ%fDi5QE1gW_azC1Wx+E_y?GgRn;IpG4S8q-~M5wi%av8CBQU zRK*Dm<;_wywY-t)y`sEv>~uL**_w0-gWd?uGh(nWtx0qKry-40Q3v|*Aw$|+O87=tkk8-YIJ-JW#zE$3dFN~344reNWfoEr6pi{ zO{LYYc1Z6o7{5~t>N{ajVFD8ao{3b=0?BYLB45|1J z6k9sJT51UK57JjN4A+=pkbSr)ImIHFjl>*WRbGj8Yi-4AD3vyPQ?QrZi}G!$w5BA6 zyPCx`xAGd|Ns8bK#2#3B2_@NWaMD1)w(Jfy`K&%s+Uou1gHg@vNn z(rbsK(Zx?ck@q!L5B6qJO$OabtXsig@8TP-6eVvt)-6f0+9~``*d4Z zH6Q}3@@V&*9=Wc9Xc+jH?k)z~d8yJ{u+=h3Io6t>G2cmEnr;f8Tj>r&3FA9uQ>_za zb4SmGxl)Na?(B^b0f>zV5W|Q-8g+~aH!>Z-P4{x3(BMUagVK_LcDgwt_@*?lPudb+ zAvsh~?O<8fBOTNb?b^DXrnFqc(rszoQuoT5oP4oi=Jfrh;EG>1uOk6rBio1iPS;xC zrU ztkAh^(nmw*;h9;tKl5$Jik{FC< ztr2FjKg`mpJLFm-?YtY;IC>i6+J+?UrFd|ev=0@8)8Mfo>yxyvtuuBsT_WHXjr<}A zI0v?4c&|=!TD%ScH_;gh_*5F${`m;FOtpW%>7O9Ds(_m~o0#hw$WJHLkmVa;fWZ!k zO*~`8%t=~#JtaGpj>k{Z!X8weE_(I1BB``t2NEO04$oKzn~)?+-9ban5~k|8peM6& zlR>X{WK!x^yiA=bSV?-zDLJ#UbhO||uyu99C5zAMwW;P+G@jL4OK+=rJEymX-qw^k zUK=QNQ^Q6xTb{NlI>1j=>Senj8Hu#!YSy$}5l7z|-%4Yesb9u{Z?d%U%#&shhN&Q_ zwH98f0(g)su?d+&N=?m6!>+8Lsf!zh+Ptn#$oUfIY*3KxI!LxI88(CL2Sp&C4Z!_(@$)&mY^g^;AcDO?Pgd^ZW zGD5_fN#g9<#k)q=KfMlFY&PA2);vT{Q-gxZ6dO%}M|~alvO6CP2y+asuT7^r9}HP~ z=ObMS#2iYJZSgkHa|h!FT|zw)=E8WCE%jQGr)`@pFkHF6X9~>cu zfiGyxdE>4@LP0)`K}h6j?JtFN8Ye^A%GnGT0qN$@zFQ(ThoSXTwfId$AXCkTThx@%Hwt->6USUh^0 z#bV6D?76OtYeve+m zMxr8gjvNFIBUv6FKgdFk_)u2HY9pRIT<4T)bAhok!0GvYSCpVnE(gZkgFgV z1uSwICwgA=y7aen%O-RcicDjxJ<*AiC{>%yDUVi%Q%bMQTgHPlQ_h2&NP`DhG#(-X?j0P+y>#sMYrtjrRK2R+y`u794=Z6v<6wDs2}KC8?>uyGvpd z(A5(HCIJzr&8|W!f`3F#?&E}K($cTvlZ9U$M=)bHX3R9l+N5H5O5L0+s0245%!Wxy zNQ#~ZTw<+yS%{ugIOz<%4cT4dog4~7SaoYws-J3H+hEkIcdhD>Iy4^`VlHN}=X_L4XKS*I)B$>f$dzme(9cTa=G zCW!+T)Ahb&Tg6*H+-R!KUaa1ZVChphAg?9JI(I-DfVM!*T|Z3j6rWv zfShS+@BC4ge9;23iyIDea=(erCXj?oa`40cMhKbIMe=Gfgw`#t>BU!|f$frT6AvJT zZ}M5?Fs8FBKDvA>t@6-d@h+5*V}d@_5N#&hNx_JA2Zg@ap$*wa#DPmS0y>M6<`t!3 zv~mx4IBhz5+BT$z9WBvgdQ_pc`h=qh8<0Fy&;3rGw)9~Nw)6oCx`Db8Z#tU0(X$~zdHvPeqrzZZj?>#7p!bxRK{lx_-CCPc77 z#b#9=^OfDYr?|is7F)SAGl$n_8ughIiOZXAaIhH}s#K8lCT zV1{v*j=ckrd7IzEHdhs0ZaolThaZ2q((1A1tU zNg(20p^q!5Za->H)2gv#K<@VzD>^B5k@+A2qg^q-3dp%xpt9dDN2>TKvhnSFKIg+g z%HeRYiSOhZ;{anV%0n#Kek*%(3&8i}(gfx&31QS5!uI#1CZ1<~#4qN{#~Cp$dw%F5RX|hfAcxH Y=K_Bje>r~*{+j%?_-i|bgB>6K7taM5cK`qY literal 0 HcmV?d00001 From c004530d43d2abd453a0051221424924ee5c3f9e Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 18:22:46 +0400 Subject: [PATCH 1058/1274] Move old contracts to .oudated --- .../balance-transfer-contract/calls.wasm | Bin .../balance-transfer-contract/metadata.json | 0 .../src/{ => .outdated}/flipper/flipper.wasm | Bin .../src/{ => .outdated}/flipper/metadata.json | 0 .../load_test_sc/loadtester.wasm | Bin .../load_test_sc/metadata.json | 0 .../transfer_contract/metadata.json | 0 .../transfer_contract/nft_transfer.wasm | Bin tests/src/rpc.load.ts | 155 ------------------ 9 files changed, 155 deletions(-) rename tests/src/{ => .outdated}/balance-transfer-contract/calls.wasm (100%) rename tests/src/{ => .outdated}/balance-transfer-contract/metadata.json (100%) rename tests/src/{ => .outdated}/flipper/flipper.wasm (100%) rename tests/src/{ => .outdated}/flipper/metadata.json (100%) rename tests/src/{ => .outdated}/load_test_sc/loadtester.wasm (100%) rename tests/src/{ => .outdated}/load_test_sc/metadata.json (100%) rename tests/src/{ => .outdated}/transfer_contract/metadata.json (100%) rename tests/src/{ => .outdated}/transfer_contract/nft_transfer.wasm (100%) delete mode 100644 tests/src/rpc.load.ts diff --git a/tests/src/balance-transfer-contract/calls.wasm b/tests/src/.outdated/balance-transfer-contract/calls.wasm similarity index 100% rename from tests/src/balance-transfer-contract/calls.wasm rename to tests/src/.outdated/balance-transfer-contract/calls.wasm diff --git a/tests/src/balance-transfer-contract/metadata.json b/tests/src/.outdated/balance-transfer-contract/metadata.json similarity index 100% rename from tests/src/balance-transfer-contract/metadata.json rename to tests/src/.outdated/balance-transfer-contract/metadata.json diff --git a/tests/src/flipper/flipper.wasm b/tests/src/.outdated/flipper/flipper.wasm similarity index 100% rename from tests/src/flipper/flipper.wasm rename to tests/src/.outdated/flipper/flipper.wasm diff --git a/tests/src/flipper/metadata.json b/tests/src/.outdated/flipper/metadata.json similarity index 100% rename from tests/src/flipper/metadata.json rename to tests/src/.outdated/flipper/metadata.json diff --git a/tests/src/load_test_sc/loadtester.wasm b/tests/src/.outdated/load_test_sc/loadtester.wasm similarity index 100% rename from tests/src/load_test_sc/loadtester.wasm rename to tests/src/.outdated/load_test_sc/loadtester.wasm diff --git a/tests/src/load_test_sc/metadata.json b/tests/src/.outdated/load_test_sc/metadata.json similarity index 100% rename from tests/src/load_test_sc/metadata.json rename to tests/src/.outdated/load_test_sc/metadata.json diff --git a/tests/src/transfer_contract/metadata.json b/tests/src/.outdated/transfer_contract/metadata.json similarity index 100% rename from tests/src/transfer_contract/metadata.json rename to tests/src/.outdated/transfer_contract/metadata.json diff --git a/tests/src/transfer_contract/nft_transfer.wasm b/tests/src/.outdated/transfer_contract/nft_transfer.wasm similarity index 100% rename from tests/src/transfer_contract/nft_transfer.wasm rename to tests/src/.outdated/transfer_contract/nft_transfer.wasm diff --git a/tests/src/rpc.load.ts b/tests/src/rpc.load.ts deleted file mode 100644 index e16126103a..0000000000 --- a/tests/src/rpc.load.ts +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; -import {IKeyringPair} from '@polkadot/types/types'; -import {Abi, BlueprintPromise as Blueprint, CodePromise, ContractPromise as Contract} from '@polkadot/api-contract'; -import {ApiPromise, Keyring} from '@polkadot/api'; -import {findUnusedAddress} from './util/helpers'; -import fs from 'fs'; - -const value = 0; -const gasLimit = 500000n * 1000000n; -const endowment = '1000000000000000'; - -/*eslint no-async-promise-executor: "off"*/ -function deployBlueprint(alice: IKeyringPair, code: CodePromise): Promise { - return new Promise(async (resolve) => { - const unsub = await code - .createBlueprint() - .signAndSend(alice, (result) => { - if (result.status.isInBlock || result.status.isFinalized) { - // here we have an additional field in the result, containing the blueprint - resolve(result.blueprint); - unsub(); - } - }); - }); -} - -/*eslint no-async-promise-executor: "off"*/ -function deployContract(alice: IKeyringPair, blueprint: Blueprint) : Promise { - return new Promise(async (resolve) => { - const unsub = await blueprint.tx - .new(endowment, gasLimit) - .signAndSend(alice, (result) => { - if (result.status.isInBlock || result.status.isFinalized) { - unsub(); - resolve(result); - } - }); - }); -} - -async function prepareDeployer(api: ApiPromise, privateKeyWrapper: ((account: string) => IKeyringPair)) { - // Find unused address - const deployer = await findUnusedAddress(api, privateKeyWrapper); - - // Transfer balance to it - const alice = privateKeyWrapper('//Alice'); - const amount = BigInt(endowment) + 10n**15n; - const tx = api.tx.balances.transfer(deployer.address, amount); - await submitTransactionAsync(alice, tx); - - return deployer; -} - -async function deployLoadTester(api: ApiPromise, privateKeyWrapper: ((account: string) => IKeyringPair)): Promise<[Contract, IKeyringPair]> { - const metadata = JSON.parse(fs.readFileSync('./src/load_test_sc/metadata.json').toString('utf-8')); - const abi = new Abi(metadata); - - const deployer = await prepareDeployer(api, privateKeyWrapper); - - const wasm = fs.readFileSync('./src/load_test_sc/loadtester.wasm'); - - const code = new CodePromise(api, abi, wasm); - - const blueprint = await deployBlueprint(deployer, code); - const contract = (await deployContract(deployer, blueprint))['contract'] as Contract; - - return [contract, deployer]; -} - -async function getScData(contract: Contract, deployer: IKeyringPair) { - const result = await contract.query.get(deployer.address, value, gasLimit); - - if(!result.result.isSuccess) { - throw 'Failed to get value'; - } - return result.result.asSuccess.data; -} - - -describe('RPC Tests', () => { - it('Simple RPC Load Test', async () => { - await usingApi(async api => { - let count = 0; - let hrTime = process.hrtime(); - let microsec1 = hrTime[0] * 1000000 + hrTime[1] / 1000; - let rate = 0; - const checkPoint = 1000; - - /* eslint no-constant-condition: "off" */ - while (true) { - await api.rpc.system.chain(); - count++; - process.stdout.write(`RPC reads: ${count} times at rate ${rate} r/s \r`); - - if (count % checkPoint == 0) { - hrTime = process.hrtime(); - const microsec2 = hrTime[0] * 1000000 + hrTime[1] / 1000; - rate = 1000000*checkPoint/(microsec2 - microsec1); - microsec1 = microsec2; - } - } - }); - }); - - it('Smart Contract RPC Load Test', async () => { - await usingApi(async (api, privateKeyWrapper) => { - - // Deploy smart contract - const [contract, deployer] = await deployLoadTester(api, privateKeyWrapper); - - // Fill smart contract up with data - const bob = privateKeyWrapper('//Bob'); - const tx = contract.tx.bloat(value, gasLimit, 200); - await submitTransactionAsync(bob, tx); - - // Run load test - let count = 0; - let hrTime = process.hrtime(); - let microsec1 = hrTime[0] * 1000000 + hrTime[1] / 1000; - let rate = 0; - const checkPoint = 10; - - /* eslint no-constant-condition: "off" */ - while (true) { - await getScData(contract, deployer); - count++; - process.stdout.write(`SC reads: ${count} times at rate ${rate} r/s \r`); - - if (count % checkPoint == 0) { - hrTime = process.hrtime(); - const microsec2 = hrTime[0] * 1000000 + hrTime[1] / 1000; - rate = 1000000*checkPoint/(microsec2 - microsec1); - microsec1 = microsec2; - } - } - }); - }); - -}); From a4faf27db0a85a869dc462498db13833726ea20c Mon Sep 17 00:00:00 2001 From: Maksandre Date: Wed, 5 Oct 2022 18:32:45 +0400 Subject: [PATCH 1059/1274] Return inflation test from .oudated --- tests/src/{.outdated => }/inflation.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename tests/src/{.outdated => }/inflation.test.ts (97%) diff --git a/tests/src/.outdated/inflation.test.ts b/tests/src/inflation.test.ts similarity index 97% rename from tests/src/.outdated/inflation.test.ts rename to tests/src/inflation.test.ts index 282b38cb22..015ceb1aeb 100644 --- a/tests/src/.outdated/inflation.test.ts +++ b/tests/src/inflation.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, usingPlaygrounds} from '../util/playgrounds'; +import {expect, itSub, usingPlaygrounds} from './util/playgrounds'; // todo:playgrounds requires sudo, look into on the later stage describe('integration test: Inflation', () => { From 21df7e44f4634cca648167ab6c2c329ae021d550 Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 6 Oct 2022 09:18:50 +0000 Subject: [PATCH 1060/1274] Move old helpers to deprecated folder --- .../.outdated/addToContractAllowList.test.ts | 8 +- tests/src/.outdated/contracts.test.ts | 8 +- .../enableContractSponsoring.test.ts | 4 +- .../{ => .outdated}/eth/scheduling.test.ts | 4 +- tests/src/.outdated/overflow.test.ts | 2 +- .../removeFromContractAllowList.test.ts | 4 +- tests/src/.outdated/scheduler.test.ts | 2 +- tests/src/.outdated/setChainLimits.test.ts | 2 +- .../setContractSponsoringRateLimit.test.ts | 4 +- .../.outdated/toggleContractAllowList.test.ts | 4 +- tests/src/.outdated/xcmTransfer.test.ts | 2 +- tests/src/app-promotion.test.ts | 100 +++++++++------- tests/src/calibrate.ts | 113 +++++++++--------- tests/src/creditFeesToTreasury.test.ts | 8 +- .../contracthelpers.ts | 2 +- .../eth}/helpers.d.ts | 0 .../eth}/helpers.ts | 14 +-- .../{util => deprecated-helpers}/helpers.ts | 0 .../src/{util => deprecated-helpers}/util.ts | 0 tests/src/eth/base.test.ts | 14 +-- tests/src/eth/createNFTCollection.test.ts | 16 +-- tests/src/eth/createRFTCollection.test.ts | 14 ++- tests/src/eth/nonFungible.test.ts | 4 +- tests/src/eth/proxy/fungibleProxy.test.ts | 9 +- tests/src/eth/proxy/nonFungibleProxy.test.ts | 24 ++-- tests/src/eth/reFungibleToken.test.ts | 4 +- tests/src/eth/util/playgrounds/unique.dev.ts | 11 +- tests/src/rmrk/acceptNft.test.ts | 2 +- tests/src/rmrk/addResource.test.ts | 2 +- tests/src/rmrk/addTheme.test.ts | 2 +- tests/src/rmrk/burnNft.test.ts | 2 +- tests/src/rmrk/changeCollectionIssuer.test.ts | 2 +- tests/src/rmrk/createBase.test.ts | 2 +- tests/src/rmrk/createCollection.test.ts | 2 +- tests/src/rmrk/deleteCollection.test.ts | 2 +- tests/src/rmrk/equipNft.test.ts | 2 +- tests/src/rmrk/getOwnedNfts.test.ts | 2 +- tests/src/rmrk/lockCollection.test.ts | 2 +- tests/src/rmrk/mintNft.test.ts | 2 +- tests/src/rmrk/rejectNft.test.ts | 2 +- tests/src/rmrk/removeResource.test.ts | 2 +- tests/src/rmrk/rmrkIsolation.test.ts | 2 +- tests/src/rmrk/sendNft.test.ts | 2 +- tests/src/rmrk/setCollectionProperty.test.ts | 2 +- tests/src/rmrk/setEquippableList.test.ts | 2 +- tests/src/rmrk/setNftProperty.test.ts | 2 +- tests/src/rmrk/setResourcePriorities.test.ts | 2 +- tests/src/substrate/get-balance.ts | 2 +- tests/src/transfer.nload.ts | 16 ++- tests/src/util/playgrounds/index.ts | 1 + tests/src/util/playgrounds/unique.ts | 5 + tests/src/xcm/xcmOpal.test.ts | 3 +- tests/src/xcm/xcmQuartz.test.ts | 2 +- tests/src/xcm/xcmUnique.test.ts | 2 +- 54 files changed, 236 insertions(+), 212 deletions(-) rename tests/src/{ => .outdated}/eth/scheduling.test.ts (94%) rename tests/src/{util => deprecated-helpers}/contracthelpers.ts (98%) rename tests/src/{eth/util => deprecated-helpers/eth}/helpers.d.ts (100%) rename tests/src/{eth/util => deprecated-helpers/eth}/helpers.ts (97%) rename tests/src/{util => deprecated-helpers}/helpers.ts (100%) rename tests/src/{util => deprecated-helpers}/util.ts (100%) diff --git a/tests/src/.outdated/addToContractAllowList.test.ts b/tests/src/.outdated/addToContractAllowList.test.ts index e04ac4f596..e5cd09da81 100644 --- a/tests/src/.outdated/addToContractAllowList.test.ts +++ b/tests/src/.outdated/addToContractAllowList.test.ts @@ -17,12 +17,8 @@ import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; import usingApi, {submitTransactionAsync, submitTransactionExpectFailAsync} from '../substrate/substrate-api'; -import { - deployFlipper, -} from '../util/contracthelpers'; -import { - getGenericResult, -} from '../util/helpers'; +import {deployFlipper} from '../deprecated-helpers/contracthelpers'; +import {getGenericResult} from '../deprecated-helpers/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; diff --git a/tests/src/.outdated/contracts.test.ts b/tests/src/.outdated/contracts.test.ts index 6f9c60085f..4b77e8738a 100644 --- a/tests/src/.outdated/contracts.test.ts +++ b/tests/src/.outdated/contracts.test.ts @@ -19,11 +19,7 @@ import chaiAsPromised from 'chai-as-promised'; import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; import fs from 'fs'; import {Abi, ContractPromise as Contract} from '@polkadot/api-contract'; -import { - deployFlipper, - getFlipValue, - deployTransferContract, -} from '../util/contracthelpers'; +import {deployFlipper, getFlipValue, deployTransferContract} from '../deprecated-helpers/contracthelpers'; import { addToAllowListExpectSuccess, @@ -37,7 +33,7 @@ import { isAllowlisted, transferFromExpectSuccess, getTokenOwner, -} from '../util/helpers'; +} from '../deprecated-helpers/helpers'; chai.use(chaiAsPromised); diff --git a/tests/src/.outdated/enableContractSponsoring.test.ts b/tests/src/.outdated/enableContractSponsoring.test.ts index c0348eb622..d8df57e80e 100644 --- a/tests/src/.outdated/enableContractSponsoring.test.ts +++ b/tests/src/.outdated/enableContractSponsoring.test.ts @@ -18,13 +18,13 @@ import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; import usingApi from '../substrate/substrate-api'; -import {deployFlipper, getFlipValue, toggleFlipValueExpectSuccess} from '../util/contracthelpers'; +import {deployFlipper, getFlipValue, toggleFlipValueExpectSuccess} from '../deprecated-helpers/contracthelpers'; import { enableContractSponsoringExpectFailure, enableContractSponsoringExpectSuccess, findUnusedAddress, setContractSponsoringRateLimitExpectSuccess, -} from '../util/helpers'; +} from '../deprecated-helpers/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; diff --git a/tests/src/eth/scheduling.test.ts b/tests/src/.outdated/eth/scheduling.test.ts similarity index 94% rename from tests/src/eth/scheduling.test.ts rename to tests/src/.outdated/eth/scheduling.test.ts index a721caaeba..91ba16b6de 100644 --- a/tests/src/eth/scheduling.test.ts +++ b/tests/src/.outdated/eth/scheduling.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import {expect} from 'chai'; -import {createEthAccountWithBalance, deployFlipper, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from './util/helpers'; -import {scheduleExpectSuccess, waitNewBlocks, requirePallets, Pallets} from '../util/helpers'; +import {createEthAccountWithBalance, deployFlipper, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from '../../deprecated-helpers/eth/helpers'; +import {scheduleExpectSuccess, waitNewBlocks, requirePallets, Pallets} from '../../deprecated-helpers/helpers'; // TODO mrshiposha update this test in #581 describe.skip('Scheduing EVM smart contracts', () => { diff --git a/tests/src/.outdated/overflow.test.ts b/tests/src/.outdated/overflow.test.ts index 3e99696577..a413b3bc14 100644 --- a/tests/src/.outdated/overflow.test.ts +++ b/tests/src/.outdated/overflow.test.ts @@ -18,7 +18,7 @@ import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; import usingApi from '../substrate/substrate-api'; -import {approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, getAllowance, getBalance, transferExpectFailure, transferExpectSuccess, transferFromExpectFail, transferFromExpectSuccess, U128_MAX} from '../util/helpers'; +import {approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, getAllowance, getBalance, transferExpectFailure, transferExpectSuccess, transferFromExpectFail, transferFromExpectSuccess, U128_MAX} from '../deprecated-helpers/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; diff --git a/tests/src/.outdated/removeFromContractAllowList.test.ts b/tests/src/.outdated/removeFromContractAllowList.test.ts index 51ddfe9b1f..d23e668a83 100644 --- a/tests/src/.outdated/removeFromContractAllowList.test.ts +++ b/tests/src/.outdated/removeFromContractAllowList.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import usingApi from '../substrate/substrate-api'; -import {deployFlipper, toggleFlipValueExpectFailure, toggleFlipValueExpectSuccess} from '../util/contracthelpers'; -import {addToContractAllowListExpectSuccess, isAllowlistedInContract, removeFromContractAllowListExpectFailure, removeFromContractAllowListExpectSuccess, toggleContractAllowlistExpectSuccess} from '../util/helpers'; +import {deployFlipper, toggleFlipValueExpectFailure, toggleFlipValueExpectSuccess} from '../deprecated-helpers/contracthelpers'; +import {addToContractAllowListExpectSuccess, isAllowlistedInContract, removeFromContractAllowListExpectFailure, removeFromContractAllowListExpectSuccess, toggleContractAllowlistExpectSuccess} from '../deprecated-helpers/helpers'; import {IKeyringPair} from '@polkadot/types/types'; import {expect} from 'chai'; diff --git a/tests/src/.outdated/scheduler.test.ts b/tests/src/.outdated/scheduler.test.ts index 33305a1723..08a257cb48 100644 --- a/tests/src/.outdated/scheduler.test.ts +++ b/tests/src/.outdated/scheduler.test.ts @@ -39,7 +39,7 @@ import { getFreeBalance, confirmSponsorshipByKeyExpectSuccess, scheduleExpectFailure, -} from '../util/helpers'; +} from '../deprecated-helpers/helpers'; import {IKeyringPair} from '@polkadot/types/types'; chai.use(chaiAsPromised); diff --git a/tests/src/.outdated/setChainLimits.test.ts b/tests/src/.outdated/setChainLimits.test.ts index 1e3cc05c16..54531d2296 100644 --- a/tests/src/.outdated/setChainLimits.test.ts +++ b/tests/src/.outdated/setChainLimits.test.ts @@ -21,7 +21,7 @@ import { addCollectionAdminExpectSuccess, setChainLimitsExpectFailure, IChainLimits, -} from '../util/helpers'; +} from '../deprecated-helpers/helpers'; // todo:playgrounds skipped ~ postponed describe.skip('Negative Integration Test setChainLimits', () => { diff --git a/tests/src/.outdated/setContractSponsoringRateLimit.test.ts b/tests/src/.outdated/setContractSponsoringRateLimit.test.ts index 97f92cbeb8..48dcf907dd 100644 --- a/tests/src/.outdated/setContractSponsoringRateLimit.test.ts +++ b/tests/src/.outdated/setContractSponsoringRateLimit.test.ts @@ -17,13 +17,13 @@ import {IKeyringPair} from '@polkadot/types/types'; import usingApi from '../substrate/substrate-api'; import waitNewBlocks from '../substrate/wait-new-blocks'; -import {deployFlipper, toggleFlipValueExpectFailure, toggleFlipValueExpectSuccess} from '../util/contracthelpers'; +import {deployFlipper, toggleFlipValueExpectFailure, toggleFlipValueExpectSuccess} from '../deprecated-helpers/contracthelpers'; import { enableContractSponsoringExpectSuccess, findUnusedAddress, setContractSponsoringRateLimitExpectFailure, setContractSponsoringRateLimitExpectSuccess, -} from '../util/helpers'; +} from '../deprecated-helpers/helpers'; // todo:playgrounds skipped~postponed test describe.skip('Integration Test setContractSponsoringRateLimit', () => { diff --git a/tests/src/.outdated/toggleContractAllowList.test.ts b/tests/src/.outdated/toggleContractAllowList.test.ts index cf03a6567a..34fd608bcb 100644 --- a/tests/src/.outdated/toggleContractAllowList.test.ts +++ b/tests/src/.outdated/toggleContractAllowList.test.ts @@ -20,10 +20,10 @@ import usingApi, {submitTransactionAsync, submitTransactionExpectFailAsync} from import { deployFlipper, getFlipValue, -} from '../util/contracthelpers'; +} from '../deprecated-helpers/contracthelpers'; import { getGenericResult, -} from '../util/helpers'; +} from '../deprecated-helpers/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; diff --git a/tests/src/.outdated/xcmTransfer.test.ts b/tests/src/.outdated/xcmTransfer.test.ts index e428611be8..37e6ddfc5b 100644 --- a/tests/src/.outdated/xcmTransfer.test.ts +++ b/tests/src/.outdated/xcmTransfer.test.ts @@ -21,7 +21,7 @@ import {WsProvider} from '@polkadot/api'; import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {getGenericResult} from '../util/helpers'; +import {getGenericResult} from '../deprecated-helpers/helpers'; import waitNewBlocks from '../substrate/wait-new-blocks'; import getBalance from '../substrate/get-balance'; diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 76b3d6d1a3..7ef2a5586d 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -15,17 +15,11 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import { - normalizeAccountId, - getModuleNames, - Pallets, -} from './util/helpers'; -import {itSub, usingPlaygrounds} from './util/playgrounds'; +import {itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip} from './util/playgrounds'; import {encodeAddress} from '@polkadot/util-crypto'; import {stringToU8a} from '@polkadot/util'; -import {SponsoringMode} from './eth/util/helpers'; import {DevUniqueHelper} from './util/playgrounds/unique.dev'; -import {itEth, expect} from './eth/util/playgrounds'; +import {itEth, expect, SponsoringMode} from './eth/util/playgrounds'; let alice: IKeyringPair; let palletAdmin: IKeyringPair; @@ -42,10 +36,11 @@ const rewardAvailableInBlock = (stakedInBlock: bigint) => { describe('App promotion', () => { before(async function () { await usingPlaygrounds(async (helper, privateKey) => { - if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip(); + requirePalletsOrSkip(this, helper, [Pallets.AppPromotion]); alice = privateKey('//Alice'); palletAdmin = privateKey('//Charlie'); // TODO use custom address - await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); + const api = helper.getApi(); + await helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); nominal = helper.balance.getOneTokenNominal(); await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal); await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal); @@ -231,54 +226,59 @@ describe('App promotion', () => { describe('admin adress', () => { itSub('can be set by sudo only', async ({helper}) => { + const api = helper.getApi(); const nonAdmin = accounts.pop()!; // nonAdmin can not set admin not from himself nor as a sudo - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.rejected; - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.rejected; + await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.rejected; + await expect(helper.signTransaction(nonAdmin, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.rejected; // Alice can - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; + await expect(helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; }); itSub('can be any valid CrossAccountId', async ({helper}) => { // We are not going to set an eth address as a sponsor, // but we do want to check, it doesn't break anything; + const api = helper.getApi(); const account = accounts.pop()!; const ethAccount = helper.address.substrateToEth(account.address); // Alice sets Ethereum address as a sudo. Then Substrate address back... - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.fulfilled; - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; + await expect(helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.fulfilled; + await expect(helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; // ...It doesn't break anything; const collection = await helper.nft.mintCollection(account, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(account, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; + await expect(helper.signTransaction(account, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; }); itSub('can be reassigned', async ({helper}) => { + const api = helper.getApi(); const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.fulfilled; - await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.fulfilled; - await expect(helper.signTransaction(oldAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; + await expect(helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: oldAdmin.address})))).to.be.fulfilled; + await expect(helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: newAdmin.address})))).to.be.fulfilled; + await expect(helper.signTransaction(oldAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; - await expect(helper.signTransaction(newAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled; + await expect(helper.signTransaction(newAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled; }); }); describe('collection sponsoring', () => { before(async function () { await usingPlaygrounds(async (helper) => { - const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})); + const api = helper.getApi(); + const tx = api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})); await helper.signTransaction(alice, tx); }); }); itSub('should actually sponsor transactions', async ({helper}) => { + const api = helper.getApi(); const [collectionOwner, tokenSender, receiver] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'Name', description: 'Description', tokenPrefix: 'Prefix', limits: {sponsorTransferTimeout: 0}}); const token = await collection.mintToken(collectionOwner, {Substrate: tokenSender.address}); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId)); + await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId)); const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress); await token.transfer(tokenSender, {Substrate: receiver.address}); @@ -291,41 +291,44 @@ describe('App promotion', () => { }); itSub('can not be set by non admin', async ({helper}) => { + const api = helper.getApi(); const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; + await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; expect((await collection.getData())?.raw.sponsorship).to.equal('Disabled'); }); itSub('should set pallet address as confirmed admin', async ({helper}) => { + const api = helper.getApi(); const [collectionOwner, oldSponsor] = [accounts.pop()!, accounts.pop()!]; // Can set sponsoring for collection without sponsor const collectionWithoutSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'No-sponsor', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.fulfilled; + await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.fulfilled; expect((await collectionWithoutSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); // Can set sponsoring for collection with unconfirmed sponsor const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.fulfilled; + await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.fulfilled; expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); // Can set sponsoring for collection with confirmed sponsor const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address}); await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.fulfilled; + await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.fulfilled; expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); }); itSub('can be overwritten by collection owner', async ({helper}) => { + const api = helper.getApi(); const [collectionOwner, newSponsor] = [accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); const collectionId = collection.collectionId; - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionId))).to.be.fulfilled; + await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionId))).to.be.fulfilled; // Collection limits still can be changed by the owner expect(await collection.setLimits(collectionOwner, {sponsorTransferTimeout: 0})).to.be.true; @@ -338,44 +341,48 @@ describe('App promotion', () => { }); itSub('should not overwrite collection limits set by the owner earlier', async ({helper}) => { + const api = helper.getApi(); const limits = {ownerCanDestroy: true, ownerCanTransfer: true, sponsorTransferTimeout: 0}; const collectionWithLimits = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.fulfilled; + await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.fulfilled; expect((await collectionWithLimits.getData())?.raw.limits).to.be.deep.contain(limits); }); itSub('should reject transaction if collection doesn\'t exist', async ({helper}) => { + const api = helper.getApi(); const collectionOwner = accounts.pop()!; // collection has never existed - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(999999999))).to.be.rejected; + await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(999999999))).to.be.rejected; // collection has been burned const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await collection.burn(collectionOwner); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; + await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; }); }); describe('stopSponsoringCollection', () => { - itSub('can not be called by non-admin', async ({helper}) => { + itSub('can not be called by non-admin', async ({helper}) => { + const api = helper.getApi(); const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled; + await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled; - await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected; + await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected; expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress}); }); itSub('should set sponsoring as disabled', async ({helper}) => { + const api = helper.getApi(); const [collectionOwner, recepient] = [accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits: {sponsorTransferTimeout: 0}}); const token = await collection.mintToken(collectionOwner, {Substrate: collectionOwner.address}); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId)); - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId)); + await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId)); + await helper.signTransaction(palletAdmin, api.tx.appPromotion.stopSponsoringCollection(collection.collectionId)); expect((await collection.getData())?.raw.sponsorship).to.be.equal('Disabled'); @@ -387,11 +394,12 @@ describe('App promotion', () => { }); itSub('should not affect collection which is not sponsored by pallete', async ({helper}) => { + const api = helper.getApi(); const collectionOwner = accounts.pop()!; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address}); await collection.confirmSponsorship(collectionOwner); - await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected; + await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected; expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: collectionOwner.address}); }); @@ -415,8 +423,8 @@ describe('App promotion', () => { await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address]); expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true; - expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); - expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner); + expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.deep.equal({ confirmed: { substrate: palletAddress, }, @@ -431,7 +439,7 @@ describe('App promotion', () => { await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled; // Contract is self sponsored - expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.be.deep.equal({ + expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.be.deep.equal({ confirmed: { ethereum: flipper.options.address.toLowerCase(), }, @@ -462,8 +470,8 @@ describe('App promotion', () => { await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected; expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true; - expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); - expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner); + expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.deep.equal({ confirmed: { ethereum: flipper.options.address.toLowerCase(), }, @@ -482,7 +490,7 @@ describe('App promotion', () => { await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true)).to.be.rejectedWith('appPromotion.NoPermission'); // contract still self-sponsored - expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.deep.equal({ confirmed: { ethereum: flipper.options.address.toLowerCase(), }, @@ -505,7 +513,7 @@ describe('App promotion', () => { await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address, 1000n); // transferBalanceToEth(api, alice, flipper.options.address, 1000n); // Set promotion to the Flipper - await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorContract(flipper.options.address)); + await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true); // Caller calls Flipper await flipper.methods.flip().send({from: caller}); @@ -536,8 +544,8 @@ describe('App promotion', () => { await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address], true); expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.false; - expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner); - expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({ + expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner); + expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.deep.equal({ disabled: null, }); @@ -717,7 +725,7 @@ function calculateIncome(base: bigint, calcPeriod: bigint, iter = 0): bigint { // Wait while promotion period less than specified block, to avoid boundary cases // 0 if this should be the beginning of the period. async function waitPromotionPeriodDoesntEnd(helper: DevUniqueHelper, waitBlockLessThan = LOCKING_PERIOD / 3n) { - const relayBlockNumber = (await helper.api!.query.parachainSystem.validationData()).value.relayParentNumber.toNumber(); // await helper.chain.getLatestBlockNumber(); + const relayBlockNumber = (await helper.callRpc('api.query.parachainSystem.validationData', [])).value.relayParentNumber.toNumber(); // await helper.chain.getLatestBlockNumber(); const currentPeriodBlock = BigInt(relayBlockNumber) % LOCKING_PERIOD; if (currentPeriodBlock > waitBlockLessThan) { diff --git a/tests/src/calibrate.ts b/tests/src/calibrate.ts index b2e85039e6..6838634468 100644 --- a/tests/src/calibrate.ts +++ b/tests/src/calibrate.ts @@ -1,10 +1,7 @@ -import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import Web3 from 'web3'; -import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, recordEthFee, usingWeb3} from './eth/util/helpers'; -import usingApi, {executeTransaction} from './substrate/substrate-api'; -import {createCollectionExpectSuccess, createItemExpectSuccess, transferExpectSuccess, UNIQUE, waitNewBlocks} from './util/helpers'; -import nonFungibleAbi from './eth/nonFungibleAbi.json'; + +import {usingEthPlaygrounds, EthUniqueHelper} from './eth/util/playgrounds'; + function linearRegression(points: { x: bigint, y: bigint }[]) { let sumxy = 0n; @@ -59,32 +56,33 @@ function _error(points: { x: bigint, y: bigint }[], hypothesis: (a: bigint) => b }).reduce((a, b) => a + b, 0n) / BigInt(points.length)); } -async function calibrateWeightToFee(api: ApiPromise, privateKey: (account: string) => IKeyringPair) { +async function calibrateWeightToFee(helper: EthUniqueHelper, privateKey: (account: string) => IKeyringPair) { const alice = privateKey('//Alice'); const bob = privateKey('//Bob'); const dataPoints = []; { - const collectionId = await createCollectionExpectSuccess(); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT'); - const aliceBalanceBefore = (await api.query.system.account(alice.address)).data.free.toBigInt(); - await transferExpectSuccess(collectionId, tokenId, alice, bob, 1, 'NFT'); - const aliceBalanceAfter = (await api.query.system.account(alice.address)).data.free.toBigInt(); + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New collection', tokenPrefix: 'NEW'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}); + const aliceBalanceBefore = await helper.balance.getSubstrate(alice.address); + await token.transfer(alice, {Substrate: bob.address}); + const aliceBalanceAfter = await helper.balance.getSubstrate(alice.address); - console.log(`Original price: ${Number(aliceBalanceBefore - aliceBalanceAfter) / Number(UNIQUE)} UNQ`); + console.log(`Original price: ${Number(aliceBalanceBefore - aliceBalanceAfter) / Number(helper.balance.getOneTokenNominal())} UNQ`); } + const api = helper.getApi(); const defaultCoeff = (api.consts.configuration.defaultWeightToFeeCoefficient as any).toBigInt(); for (let i = -5; i < 5; i++) { - await executeTransaction(api, alice, api.tx.sudo.sudo(api.tx.configuration.setWeightToFeeCoefficientOverride(defaultCoeff + defaultCoeff / 1000n * BigInt(i)))); + await helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.configuration.setWeightToFeeCoefficientOverride(defaultCoeff + defaultCoeff / 1000n * BigInt(i)))); const coefficient = (await api.query.configuration.weightToFeeCoefficientOverride() as any).toBigInt(); - const collectionId = await createCollectionExpectSuccess(); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT'); + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New collection', tokenPrefix: 'NEW'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}); - const aliceBalanceBefore = (await api.query.system.account(alice.address)).data.free.toBigInt(); - await transferExpectSuccess(collectionId, tokenId, alice, bob, 1, 'NFT'); - const aliceBalanceAfter = (await api.query.system.account(alice.address)).data.free.toBigInt(); + const aliceBalanceBefore = await helper.balance.getSubstrate(alice.address); + await token.transfer(alice, {Substrate: bob.address}); + const aliceBalanceAfter = await helper.balance.getSubstrate(alice.address); const transferPrice = aliceBalanceBefore - aliceBalanceAfter; @@ -94,52 +92,53 @@ async function calibrateWeightToFee(api: ApiPromise, privateKey: (account: strin // console.log(`Error: ${error(dataPoints, x => a*x+b)}`); - const perfectValue = a * UNIQUE / 10n + b; - await executeTransaction(api, alice, api.tx.sudo.sudo(api.tx.configuration.setWeightToFeeCoefficientOverride(perfectValue.toString()))); + const perfectValue = a * helper.balance.getOneTokenNominal() / 10n + b; + await helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.configuration.setWeightToFeeCoefficientOverride(perfectValue.toString()))); { - const collectionId = await createCollectionExpectSuccess(); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT'); - const aliceBalanceBefore = (await api.query.system.account(alice.address)).data.free.toBigInt(); - await transferExpectSuccess(collectionId, tokenId, alice, bob, 1, 'NFT'); - const aliceBalanceAfter = (await api.query.system.account(alice.address)).data.free.toBigInt(); + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New collection', tokenPrefix: 'NEW'}); + const token = await collection.mintToken(alice, {Substrate: alice.address}); + const aliceBalanceBefore = await helper.balance.getSubstrate(alice.address); + await token.transfer(alice, {Substrate: bob.address}); + const aliceBalanceAfter = await helper.balance.getSubstrate(alice.address); - console.log(`Calibrated price: ${Number(aliceBalanceBefore - aliceBalanceAfter) / Number(UNIQUE)} UNQ`); + console.log(`Calibrated price: ${Number(aliceBalanceBefore - aliceBalanceAfter) / Number(helper.balance.getOneTokenNominal())} UNQ`); } } -async function calibrateMinGasPrice(api: ApiPromise, web3: Web3, privateKey: (account: string) => IKeyringPair) { +async function calibrateMinGasPrice(helper: EthUniqueHelper, privateKey: (account: string) => IKeyringPair) { const alice = privateKey('//Alice'); - const caller = await createEthAccountWithBalance(api, web3, privateKey); - const receiver = createEthAccount(web3); + const caller = await helper.eth.createAccountWithBalance(alice); + const receiver = helper.eth.createAccount(); const dataPoints = []; { - const collectionId = await createCollectionExpectSuccess(); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', {Ethereum: caller}); + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New collection', tokenPrefix: 'NEW'}); + const token = await collection.mintToken(alice, {Ethereum: caller}); - const address = collectionIdToAddress(collectionId); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', caller); - const cost = await recordEthFee(api, caller, () => contract.methods.transfer(receiver, tokenId).send(caller)); + const cost = await helper.eth.calculateFee({Ethereum: caller}, () => contract.methods.transfer(receiver, token.tokenId).send({from: caller, gas: helper.eth.DEFAULT_GAS})); - console.log(`Original price: ${Number(cost) / Number(UNIQUE)} UNQ`); + console.log(`Original price: ${Number(cost) / Number(helper.balance.getOneTokenNominal())} UNQ`); } + const api = helper.getApi(); const defaultCoeff = (api.consts.configuration.defaultMinGasPrice as any).toBigInt(); for (let i = -8; i < 8; i++) { const gasPrice = defaultCoeff + defaultCoeff / 100000n * BigInt(i); const gasPriceStr = '0x' + gasPrice.toString(16); - await executeTransaction(api, alice, api.tx.sudo.sudo(api.tx.configuration.setMinGasPriceOverride(gasPrice))); + await helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.configuration.setMinGasPriceOverride(gasPrice))); const coefficient = (await api.query.configuration.minGasPriceOverride() as any).toBigInt(); - const collectionId = await createCollectionExpectSuccess(); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', {Ethereum: caller}); + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New collection', tokenPrefix: 'NEW'}); + const token = await collection.mintToken(alice, {Ethereum: caller}); - const address = collectionIdToAddress(collectionId); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, gasPrice: gasPriceStr, ...GAS_ARGS}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', caller); - const transferPrice = await recordEthFee(api, caller, () => contract.methods.transfer(receiver, tokenId).send(caller)); + const transferPrice = await helper.eth.calculateFee({Ethereum: caller}, () => contract.methods.transfer(receiver, token.tokenId).send({from: caller, gasPrice: gasPriceStr, gas: helper.eth.DEFAULT_GAS})); dataPoints.push({x: transferPrice, y: coefficient}); } @@ -149,34 +148,30 @@ async function calibrateMinGasPrice(api: ApiPromise, web3: Web3, privateKey: (ac // console.log(`Error: ${error(dataPoints, x => a*x+b)}`); // * 0.15 = * 10000 / 66666 - const perfectValue = a * UNIQUE * 1000000n / 6666666n + b; - await executeTransaction(api, alice, api.tx.sudo.sudo(api.tx.configuration.setMinGasPriceOverride(perfectValue.toString()))); + const perfectValue = a * helper.balance.getOneTokenNominal() * 1000000n / 6666666n + b; + await helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.configuration.setMinGasPriceOverride(perfectValue.toString()))); { - const collectionId = await createCollectionExpectSuccess(); - const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', {Ethereum: caller}); + const collection = await helper.nft.mintCollection(alice, {name: 'New', description: 'New collection', tokenPrefix: 'NEW'}); + const token = await collection.mintToken(alice, {Ethereum: caller}); - const address = collectionIdToAddress(collectionId); - const contract = new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const contract = helper.ethNativeContract.collection(address, 'nft', caller); - const cost = await recordEthFee(api, caller, () => contract.methods.transfer(receiver, tokenId).send(caller)); + const cost = await helper.eth.calculateFee({Ethereum: caller}, () => contract.methods.transfer(receiver, token.tokenId).send({from: caller, gas: helper.eth.DEFAULT_GAS})); - console.log(`Calibrated price: ${Number(cost) / Number(UNIQUE)} UNQ`); + console.log(`Calibrated price: ${Number(cost) / Number(helper.balance.getOneTokenNominal())} UNQ`); } } (async () => { - await usingApi(async (api, privateKey) => { + await usingEthPlaygrounds(async (helper: EthUniqueHelper, privateKey) => { // Second run slightly reduces error sometimes, as price line is not actually straight, this is a curve - await calibrateWeightToFee(api, privateKey); - await calibrateWeightToFee(api, privateKey); - - await usingWeb3(async web3 => { - await calibrateMinGasPrice(api, web3, privateKey); - await calibrateMinGasPrice(api, web3, privateKey); - }); + await calibrateWeightToFee(helper, privateKey); + await calibrateWeightToFee(helper, privateKey); - await api.disconnect(); + await calibrateMinGasPrice(helper, privateKey); + await calibrateMinGasPrice(helper, privateKey); }); })(); diff --git a/tests/src/creditFeesToTreasury.test.ts b/tests/src/creditFeesToTreasury.test.ts index 0abb647ffb..48c9d053c4 100644 --- a/tests/src/creditFeesToTreasury.test.ts +++ b/tests/src/creditFeesToTreasury.test.ts @@ -29,7 +29,7 @@ const createCollectionDeposit = 100; /*eslint no-async-promise-executor: "off"*/ function skipInflationBlock(api: ApiPromise): Promise { const promise = new Promise(async (resolve) => { - const blockInterval = (await api.consts.inflation.inflationBlockInterval).toNumber(); + const blockInterval = api.consts.inflation.inflationBlockInterval.toNumber(); const unsubscribe = await api.rpc.chain.subscribeNewHeads(head => { const currentBlock = head.number.toNumber(); if (currentBlock % blockInterval < blockInterval - 10) { @@ -56,15 +56,15 @@ describe('integration test: Fees must be credited to Treasury:', () => { }); itSub('Total issuance does not change', async ({helper}) => { - const api = helper.api!; + const api = helper.getApi(); await skipInflationBlock(api); await helper.wait.newBlocks(1); - const totalBefore = (await api.query.balances.totalIssuance()).toBigInt(); + const totalBefore = (await helper.callRpc('api.query.balances.totalIssuance', [])).toBigInt(); await helper.balance.transferToSubstrate(alice, bob.address, 1n); - const totalAfter = (await api.query.balances.totalIssuance()).toBigInt(); + const totalAfter = (await helper.callRpc('api.query.balances.totalIssuance', [])).toBigInt(); expect(totalAfter).to.be.equal(totalBefore); }); diff --git a/tests/src/util/contracthelpers.ts b/tests/src/deprecated-helpers/contracthelpers.ts similarity index 98% rename from tests/src/util/contracthelpers.ts rename to tests/src/deprecated-helpers/contracthelpers.ts index b9ef52845c..c4f5eb0c53 100644 --- a/tests/src/util/contracthelpers.ts +++ b/tests/src/deprecated-helpers/contracthelpers.ts @@ -24,7 +24,7 @@ import {ApiPromise} from '@polkadot/api'; chai.use(chaiAsPromised); const expect = chai.expect; -import {findUnusedAddress, getGenericResult} from '../util/helpers'; +import {findUnusedAddress, getGenericResult} from './helpers'; const value = 0; const gasLimit = '200000000000'; diff --git a/tests/src/eth/util/helpers.d.ts b/tests/src/deprecated-helpers/eth/helpers.d.ts similarity index 100% rename from tests/src/eth/util/helpers.d.ts rename to tests/src/deprecated-helpers/eth/helpers.d.ts diff --git a/tests/src/eth/util/helpers.ts b/tests/src/deprecated-helpers/eth/helpers.ts similarity index 97% rename from tests/src/eth/util/helpers.ts rename to tests/src/deprecated-helpers/eth/helpers.ts index 52d9c6964f..b59eca8c16 100644 --- a/tests/src/eth/util/helpers.ts +++ b/tests/src/deprecated-helpers/eth/helpers.ts @@ -27,13 +27,13 @@ import config from '../../config'; import getBalance from '../../substrate/get-balance'; import usingApi, {submitTransactionAsync} from '../../substrate/substrate-api'; import waitNewBlocks from '../../substrate/wait-new-blocks'; -import {CollectionMode, CrossAccountId, getDetailedCollectionInfo, getGenericResult, UNIQUE} from '../../util/helpers'; -import collectionHelpersAbi from '../collectionHelpersAbi.json'; -import fungibleAbi from '../fungibleAbi.json'; -import nonFungibleAbi from '../nonFungibleAbi.json'; -import refungibleAbi from '../reFungibleAbi.json'; -import refungibleTokenAbi from '../reFungibleTokenAbi.json'; -import contractHelpersAbi from './contractHelpersAbi.json'; +import {CollectionMode, CrossAccountId, getDetailedCollectionInfo, getGenericResult, UNIQUE} from '../helpers'; +import collectionHelpersAbi from '../../eth/collectionHelpersAbi.json'; +import fungibleAbi from '../../eth/fungibleAbi.json'; +import nonFungibleAbi from '../../eth/nonFungibleAbi.json'; +import refungibleAbi from '../../eth/reFungibleAbi.json'; +import refungibleTokenAbi from '../../eth/reFungibleTokenAbi.json'; +import contractHelpersAbi from '../../eth/util/contractHelpersAbi.json'; export const GAS_ARGS = {gas: 2500000}; diff --git a/tests/src/util/helpers.ts b/tests/src/deprecated-helpers/helpers.ts similarity index 100% rename from tests/src/util/helpers.ts rename to tests/src/deprecated-helpers/helpers.ts diff --git a/tests/src/util/util.ts b/tests/src/deprecated-helpers/util.ts similarity index 100% rename from tests/src/util/util.ts rename to tests/src/deprecated-helpers/util.ts diff --git a/tests/src/eth/base.test.ts b/tests/src/eth/base.test.ts index 9e39c6aa08..fdc371e772 100644 --- a/tests/src/eth/base.test.ts +++ b/tests/src/eth/base.test.ts @@ -14,16 +14,12 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import { - ethBalanceViaSub, - GAS_ARGS, - recordEthFee, -} from './util/helpers'; import {Contract} from 'web3-eth-contract'; import {IKeyringPair} from '@polkadot/types/types'; import {EthUniqueHelper, itEth, usingEthPlaygrounds, expect} from './util/playgrounds'; + describe('Contract calls', () => { let donor: IKeyringPair; @@ -37,15 +33,15 @@ describe('Contract calls', () => { const deployer = await helper.eth.createAccountWithBalance(donor); const flipper = await helper.eth.deployFlipper(deployer); - const cost = await recordEthFee(helper.api!, deployer, () => flipper.methods.flip().send({from: deployer})); + const cost = await helper.eth.calculateFee({Ethereum: deployer}, () => flipper.methods.flip().send({from: deployer})); expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))).to.be.true; }); itEth('Balance transfer fee is less than 0.2 UNQ', async ({helper}) => { const userA = await helper.eth.createAccountWithBalance(donor); const userB = helper.eth.createAccount(); - const cost = await recordEthFee(helper.api!, userA, () => helper.web3!.eth.sendTransaction({from: userA, to: userB, value: '1000000', ...GAS_ARGS})); - const balanceB = await ethBalanceViaSub(helper.api!, userB); + const cost = await helper.eth.calculateFee({Ethereum: userA}, () => helper.getWeb3().eth.sendTransaction({from: userA, to: userB, value: '1000000', gas: helper.eth.DEFAULT_GAS})); + const balanceB = await helper.balance.getEthereum(userB); expect(cost - balanceB < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))).to.be.true; }); @@ -60,7 +56,7 @@ describe('Contract calls', () => { const address = helper.ethAddress.fromCollectionId(collection.collectionId); const contract = helper.ethNativeContract.collection(address, 'nft', caller); - const cost = await recordEthFee(helper.api!, caller, () => contract.methods.transfer(receiver, tokenId).send(caller)); + const cost = await helper.eth.calculateFee({Ethereum: caller}, () => contract.methods.transfer(receiver, tokenId).send(caller)); const fee = Number(cost) / Number(helper.balance.getOneTokenNominal()); const expectedFee = 0.15; diff --git a/tests/src/eth/createNFTCollection.test.ts b/tests/src/eth/createNFTCollection.test.ts index 79d38fac07..4257ab89cb 100644 --- a/tests/src/eth/createNFTCollection.test.ts +++ b/tests/src/eth/createNFTCollection.test.ts @@ -17,7 +17,7 @@ import {evmToAddress} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; -import {UNIQUE} from '../util/helpers'; + describe('Create NFT collection from EVM', () => { let donor: IKeyringPair; @@ -65,7 +65,7 @@ describe('Create NFT collection from EVM', () => { await collectionHelpers.methods .createNonfungibleCollection('A', 'A', 'A') - .send({value: Number(2n * UNIQUE)}); + .send({value: Number(2n * helper.balance.getOneTokenNominal())}); expect(await collectionHelpers.methods .isCollectionExist(expectedCollectionAddress) @@ -147,10 +147,12 @@ describe('Create NFT collection from EVM', () => { describe('(!negative tests!) Create NFT collection from EVM', () => { let donor: IKeyringPair; + let nominal: bigint; before(async function() { - await usingEthPlaygrounds(async (_helper, privateKey) => { + await usingEthPlaygrounds(async (helper, privateKey) => { donor = privateKey('//Alice'); + nominal = helper.balance.getOneTokenNominal() }); }); @@ -165,7 +167,7 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { await expect(collectionHelper.methods .createNonfungibleCollection(collectionName, description, tokenPrefix) - .call({value: Number(2n * UNIQUE)})).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH); + .call({value: Number(2n * nominal)})).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH); } { @@ -175,7 +177,7 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { const tokenPrefix = 'A'; await expect(collectionHelper.methods .createNonfungibleCollection(collectionName, description, tokenPrefix) - .call({value: Number(2n * UNIQUE)})).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH); + .call({value: Number(2n * nominal)})).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH); } { const MAX_TOKEN_PREFIX_LENGTH = 16; @@ -184,7 +186,7 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGTH + 1); await expect(collectionHelper.methods .createNonfungibleCollection(collectionName, description, tokenPrefix) - .call({value: Number(2n * UNIQUE)})).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH); + .call({value: Number(2n * nominal)})).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH); } }); @@ -193,7 +195,7 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); await expect(collectionHelper.methods .createNonfungibleCollection('Peasantry', 'absolutely anything', 'CVE') - .call({value: Number(1n * UNIQUE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); + .call({value: Number(1n * nominal)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); }); itEth('(!negative test!) Check owner', async ({helper}) => { diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts index dca382b410..7857986ca2 100644 --- a/tests/src/eth/createRFTCollection.test.ts +++ b/tests/src/eth/createRFTCollection.test.ts @@ -18,7 +18,7 @@ import {evmToAddress} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; import {Pallets, requirePalletsOrSkip} from '../util/playgrounds'; import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; -import {UNIQUE} from '../util/helpers'; + describe('Create RFT collection from EVM', () => { let donor: IKeyringPair; @@ -66,7 +66,7 @@ describe('Create RFT collection from EVM', () => { await collectionHelpers.methods .createRFTCollection('A', 'A', 'A') - .send({value: Number(2n * UNIQUE)}); + .send({value: Number(2n * helper.balance.getOneTokenNominal())}); expect(await collectionHelpers.methods .isCollectionExist(expectedCollectionAddress) @@ -148,11 +148,13 @@ describe('Create RFT collection from EVM', () => { describe('(!negative tests!) Create RFT collection from EVM', () => { let donor: IKeyringPair; + let nominal: bigint; before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); + nominal = helper.balance.getOneTokenNominal(); }); }); @@ -167,7 +169,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { await expect(collectionHelper.methods .createRFTCollection(collectionName, description, tokenPrefix) - .call({value: Number(2n * UNIQUE)})).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH); + .call({value: Number(2n * nominal)})).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH); } { const MAX_DESCRIPTION_LENGTH = 256; @@ -176,7 +178,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { const tokenPrefix = 'A'; await expect(collectionHelper.methods .createRFTCollection(collectionName, description, tokenPrefix) - .call({value: Number(2n * UNIQUE)})).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH); + .call({value: Number(2n * nominal)})).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH); } { const MAX_TOKEN_PREFIX_LENGTH = 16; @@ -185,7 +187,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGTH + 1); await expect(collectionHelper.methods .createRFTCollection(collectionName, description, tokenPrefix) - .call({value: Number(2n * UNIQUE)})).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH); + .call({value: Number(2n * nominal)})).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH); } }); @@ -194,7 +196,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); await expect(collectionHelper.methods .createRFTCollection('Peasantry', 'absolutely anything', 'TWIW') - .call({value: Number(1n * UNIQUE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); + .call({value: Number(1n * nominal)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); }); itEth('(!negative test!) Check owner', async ({helper}) => { diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 823e2e4182..3edbc1dde5 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -17,7 +17,7 @@ import {itEth, usingEthPlaygrounds, expect, EthUniqueHelper} from './util/playgrounds'; import {IKeyringPair} from '@polkadot/types/types'; import {Contract} from 'web3-eth-contract'; -import {UNIQUE} from '../util/helpers'; + describe('NFT: Information getting', () => { let donor: IKeyringPair; @@ -84,7 +84,7 @@ describe('Check ERC721 token URI for NFT', () => { const receiver = helper.eth.createAccount(); const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelper.methods.createERC721MetadataCompatibleCollection('Mint collection', 'a', 'b', tokenPrefix).send({value: Number(2n * UNIQUE)}); + let result = await collectionHelper.methods.createERC721MetadataCompatibleCollection('Mint collection', 'a', 'b', tokenPrefix).send({value: Number(2n * helper.balance.getOneTokenNominal())}); const collectionAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); diff --git a/tests/src/eth/proxy/fungibleProxy.test.ts b/tests/src/eth/proxy/fungibleProxy.test.ts index 92b626497b..d2b546526b 100644 --- a/tests/src/eth/proxy/fungibleProxy.test.ts +++ b/tests/src/eth/proxy/fungibleProxy.test.ts @@ -14,7 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {GAS_ARGS, normalizeEvents} from '../util/helpers'; import {expect} from 'chai'; import {readFile} from 'fs/promises'; import {IKeyringPair} from '@polkadot/types/types'; @@ -26,7 +25,7 @@ async function proxyWrap(helper: EthUniqueHelper, wrapped: any, donor: IKeyringP const web3 = helper.getWeb3(); const proxyContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/UniqueFungibleProxy.abi`)).toString()), undefined, { from: owner, - ...GAS_ARGS, + gas: helper.eth.DEFAULT_GAS, }); const proxy = await proxyContract.deploy({data: (await readFile(`${__dirname}/UniqueFungibleProxy.bin`)).toString(), arguments: [wrapped.options.address]}).send({from: owner}); return proxy; @@ -94,7 +93,7 @@ describe('Fungible (Via EVM proxy): Plain calls', () => { { const result = await contract.methods.approve(spender, 100).send({from: caller}); - const events = normalizeEvents(result.events); + const events = helper.eth.normalizeEvents(result.events); expect(events).to.be.deep.equal([ { @@ -131,7 +130,7 @@ describe('Fungible (Via EVM proxy): Plain calls', () => { { const result = await contract.methods.transferFrom(owner, receiver, 49).send({from: caller}); - const events = normalizeEvents(result.events); + const events = helper.eth.normalizeEvents(result.events); expect(events).to.be.deep.equal([ { address, @@ -177,7 +176,7 @@ describe('Fungible (Via EVM proxy): Plain calls', () => { { const result = await contract.methods.transfer(receiver, 50).send({from: caller}); - const events = normalizeEvents(result.events); + const events = helper.eth.normalizeEvents(result.events); expect(events).to.be.deep.equal([ { address, diff --git a/tests/src/eth/proxy/nonFungibleProxy.test.ts b/tests/src/eth/proxy/nonFungibleProxy.test.ts index 5ed9959967..bfbc0b7593 100644 --- a/tests/src/eth/proxy/nonFungibleProxy.test.ts +++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts @@ -14,11 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {GAS_ARGS, itWeb3, normalizeEvents} from '../util/helpers'; -import {expect} from 'chai'; import {readFile} from 'fs/promises'; import {IKeyringPair} from '@polkadot/types/types'; -import {EthUniqueHelper, itEth, usingEthPlaygrounds} from '../util/playgrounds'; +import {EthUniqueHelper, itEth, usingEthPlaygrounds, expect} from '../util/playgrounds'; + async function proxyWrap(helper: EthUniqueHelper, wrapped: any, donor: IKeyringPair) { // Proxy owner has no special privilegies, we don't need to reuse them @@ -26,7 +25,7 @@ async function proxyWrap(helper: EthUniqueHelper, wrapped: any, donor: IKeyringP const web3 = helper.getWeb3(); const proxyContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/UniqueNFTProxy.abi`)).toString()), undefined, { from: owner, - ...GAS_ARGS, + gas: helper.eth.DEFAULT_GAS, }); const proxy = await proxyContract.deploy({data: (await readFile(`${__dirname}/UniqueNFTProxy.bin`)).toString(), arguments: [wrapped.options.address]}).send({from: owner}); return proxy; @@ -119,7 +118,7 @@ describe('NFT (Via EVM proxy): Plain calls', () => { nextTokenId, 'Test URI', ).send({from: caller}); - const events = normalizeEvents(result.events); + const events = helper.eth.normalizeEvents(result.events); events[0].address = events[0].address.toLocaleLowerCase(); expect(events).to.be.deep.equal([ @@ -139,7 +138,10 @@ describe('NFT (Via EVM proxy): Plain calls', () => { }); //TODO: CORE-302 add eth methods - itWeb3.skip('Can perform mintBulk()', async ({web3, api, privateKeyWrapper}) => { + itEth.skip('Can perform mintBulk()', async ({helper, privateKey}) => { + const api = helper.getApi(); + const web3 = helper.getWeb3(); + const privateKeyWrapper = privateKey; /* const collection = await createCollectionExpectSuccess({ mode: {type: 'NFT'}, @@ -216,7 +218,7 @@ describe('NFT (Via EVM proxy): Plain calls', () => { { const result = await contract.methods.burn(tokenId).send({from: caller}); - const events = normalizeEvents(result.events); + const events = helper.eth.normalizeEvents(result.events); expect(events).to.be.deep.equal([ { @@ -243,8 +245,8 @@ describe('NFT (Via EVM proxy): Plain calls', () => { const {tokenId} = await collection.mintToken(alice, {Ethereum: contract.options.address}); { - const result = await contract.methods.approve(spender, tokenId).send({from: caller, ...GAS_ARGS}); - const events = normalizeEvents(result.events); + const result = await contract.methods.approve(spender, tokenId).send({from: caller, gas: helper.eth.DEFAULT_GAS}); + const events = helper.eth.normalizeEvents(result.events); expect(events).to.be.deep.equal([ { @@ -276,7 +278,7 @@ describe('NFT (Via EVM proxy): Plain calls', () => { { const result = await contract.methods.transferFrom(owner, receiver, tokenId).send({from: caller}); - const events = normalizeEvents(result.events); + const events = helper.eth.normalizeEvents(result.events); expect(events).to.be.deep.equal([ { address, @@ -313,7 +315,7 @@ describe('NFT (Via EVM proxy): Plain calls', () => { { const result = await contract.methods.transfer(receiver, tokenId).send({from: caller}); - const events = normalizeEvents(result.events); + const events = helper.eth.normalizeEvents(result.events); expect(events).to.be.deep.equal([ { address, diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index bb6a0c570b..5196ac525e 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -18,7 +18,7 @@ import {Pallets, requirePalletsOrSkip} from '../util/playgrounds'; import {EthUniqueHelper, expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; import {IKeyringPair} from '@polkadot/types/types'; import {Contract} from 'web3-eth-contract'; -import {UNIQUE} from '../util/helpers'; + describe('Refungible token: Information getting', () => { let donor: IKeyringPair; @@ -81,7 +81,7 @@ describe('Check ERC721 token URI for ReFungible', () => { const receiver = helper.eth.createAccount(); const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelper.methods.createERC721MetadataCompatibleCollection('Mint collection', 'a', 'b', tokenPrefix).send({value: Number(2n * UNIQUE)}); + let result = await collectionHelper.methods.createERC721MetadataCompatibleCollection('Mint collection', 'a', 'b', tokenPrefix).send({value: Number(2n * helper.balance.getOneTokenNominal())}); const collectionAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index 1fb39bf2a1..69737fab1d 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -27,7 +27,7 @@ import nonFungibleAbi from '../../nonFungibleAbi.json'; import refungibleAbi from '../../reFungibleAbi.json'; import refungibleTokenAbi from '../../reFungibleTokenAbi.json'; import contractHelpersAbi from './../contractHelpersAbi.json'; -import {TEthereumAccount} from '../../../util/playgrounds/types'; +import {ICrossAccountId, TEthereumAccount} from '../../../util/playgrounds/types'; class EthGroupBase { helper: EthUniqueHelper; @@ -279,6 +279,15 @@ class EthGroup extends EthGroupBase { }; }); } + + async calculateFee(address: ICrossAccountId, code: () => Promise): Promise { + const wrappedCode = async () => { + await code(); + // In dev mode, the transaction might not finish processing in time + await this.helper.wait.newBlocks(1); + } + return await this.helper.arrange.calculcateFee(address, code); + } } class EthAddressGroup extends EthGroupBase { diff --git a/tests/src/rmrk/acceptNft.test.ts b/tests/src/rmrk/acceptNft.test.ts index b1dce6bf18..8003cb9084 100644 --- a/tests/src/rmrk/acceptNft.test.ts +++ b/tests/src/rmrk/acceptNft.test.ts @@ -8,7 +8,7 @@ import { } from './util/tx'; import {NftIdTuple} from './util/fetch'; import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; describe('integration test: accept NFT', () => { let api: any; diff --git a/tests/src/rmrk/addResource.test.ts b/tests/src/rmrk/addResource.test.ts index 2129005be2..ae302bd483 100644 --- a/tests/src/rmrk/addResource.test.ts +++ b/tests/src/rmrk/addResource.test.ts @@ -12,7 +12,7 @@ import { addNftComposableResource, } from './util/tx'; import {RmrkTraitsResourceResourceInfo as ResourceInfo} from '@polkadot/types/lookup'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; describe('integration test: add NFT resource', () => { const Alice = '//Alice'; diff --git a/tests/src/rmrk/addTheme.test.ts b/tests/src/rmrk/addTheme.test.ts index a28353a4d2..8aea26210f 100644 --- a/tests/src/rmrk/addTheme.test.ts +++ b/tests/src/rmrk/addTheme.test.ts @@ -3,7 +3,7 @@ import {getApiConnection} from '../substrate/substrate-api'; import {createBase, addTheme} from './util/tx'; import {expectTxFailure} from './util/helpers'; import {getThemeNames} from './util/fetch'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; describe('integration test: add Theme to Base', () => { let api: any; diff --git a/tests/src/rmrk/burnNft.test.ts b/tests/src/rmrk/burnNft.test.ts index c533628f42..2d189d29fc 100644 --- a/tests/src/rmrk/burnNft.test.ts +++ b/tests/src/rmrk/burnNft.test.ts @@ -5,7 +5,7 @@ import {burnNft, createCollection, sendNft, mintNft} from './util/tx'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; diff --git a/tests/src/rmrk/changeCollectionIssuer.test.ts b/tests/src/rmrk/changeCollectionIssuer.test.ts index 7bbb08f18e..88ec3f590a 100644 --- a/tests/src/rmrk/changeCollectionIssuer.test.ts +++ b/tests/src/rmrk/changeCollectionIssuer.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {expectTxFailure} from './util/helpers'; import { changeIssuer, diff --git a/tests/src/rmrk/createBase.test.ts b/tests/src/rmrk/createBase.test.ts index 089ac1ef0d..2390a884d7 100644 --- a/tests/src/rmrk/createBase.test.ts +++ b/tests/src/rmrk/createBase.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {createCollection, createBase} from './util/tx'; describe('integration test: create new Base', () => { diff --git a/tests/src/rmrk/createCollection.test.ts b/tests/src/rmrk/createCollection.test.ts index da8f557459..b6c90ff767 100644 --- a/tests/src/rmrk/createCollection.test.ts +++ b/tests/src/rmrk/createCollection.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {createCollection} from './util/tx'; describe('Integration test: create new collection', () => { diff --git a/tests/src/rmrk/deleteCollection.test.ts b/tests/src/rmrk/deleteCollection.test.ts index f0cd5bbd35..0caf5d734d 100644 --- a/tests/src/rmrk/deleteCollection.test.ts +++ b/tests/src/rmrk/deleteCollection.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, deleteCollection} from './util/tx'; diff --git a/tests/src/rmrk/equipNft.test.ts b/tests/src/rmrk/equipNft.test.ts index 892856e8cb..ed8d4ae9e9 100644 --- a/tests/src/rmrk/equipNft.test.ts +++ b/tests/src/rmrk/equipNft.test.ts @@ -1,7 +1,7 @@ import {ApiPromise} from '@polkadot/api'; import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {getNft, getParts, NftIdTuple} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import { diff --git a/tests/src/rmrk/getOwnedNfts.test.ts b/tests/src/rmrk/getOwnedNfts.test.ts index 83f9acfb0a..5259b059c8 100644 --- a/tests/src/rmrk/getOwnedNfts.test.ts +++ b/tests/src/rmrk/getOwnedNfts.test.ts @@ -1,6 +1,6 @@ import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {getOwnedNfts} from './util/fetch'; import {mintNft, createCollection} from './util/tx'; diff --git a/tests/src/rmrk/lockCollection.test.ts b/tests/src/rmrk/lockCollection.test.ts index c48a112b98..03016fe5ea 100644 --- a/tests/src/rmrk/lockCollection.test.ts +++ b/tests/src/rmrk/lockCollection.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, lockCollection, mintNft} from './util/tx'; diff --git a/tests/src/rmrk/mintNft.test.ts b/tests/src/rmrk/mintNft.test.ts index 391e00e137..a3fe58a7b1 100644 --- a/tests/src/rmrk/mintNft.test.ts +++ b/tests/src/rmrk/mintNft.test.ts @@ -1,6 +1,6 @@ import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {getNft} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import {createCollection, mintNft} from './util/tx'; diff --git a/tests/src/rmrk/rejectNft.test.ts b/tests/src/rmrk/rejectNft.test.ts index 345ecbb2eb..701b14fbfa 100644 --- a/tests/src/rmrk/rejectNft.test.ts +++ b/tests/src/rmrk/rejectNft.test.ts @@ -8,7 +8,7 @@ import { } from './util/tx'; import {getChildren, NftIdTuple} from './util/fetch'; import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; describe('integration test: reject NFT', () => { let api: any; diff --git a/tests/src/rmrk/removeResource.test.ts b/tests/src/rmrk/removeResource.test.ts index bcfd948aa1..941f5ea7a4 100644 --- a/tests/src/rmrk/removeResource.test.ts +++ b/tests/src/rmrk/removeResource.test.ts @@ -1,7 +1,7 @@ import {expect} from 'chai'; import privateKey from '../substrate/privateKey'; import {executeTransaction, getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {getNft, NftIdTuple} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import { diff --git a/tests/src/rmrk/rmrkIsolation.test.ts b/tests/src/rmrk/rmrkIsolation.test.ts index cb62607d94..b104c46149 100644 --- a/tests/src/rmrk/rmrkIsolation.test.ts +++ b/tests/src/rmrk/rmrkIsolation.test.ts @@ -9,7 +9,7 @@ import { requirePallets, normalizeAccountId, Pallets, -} from '../util/helpers'; +} from '../deprecated-helpers/helpers'; import {IKeyringPair} from '@polkadot/types/types'; import {ApiPromise} from '@polkadot/api'; import {it} from 'mocha'; diff --git a/tests/src/rmrk/sendNft.test.ts b/tests/src/rmrk/sendNft.test.ts index 3db58c0708..9cafa5f5e8 100644 --- a/tests/src/rmrk/sendNft.test.ts +++ b/tests/src/rmrk/sendNft.test.ts @@ -3,7 +3,7 @@ import {getApiConnection} from '../substrate/substrate-api'; import {createCollection, mintNft, sendNft} from './util/tx'; import {NftIdTuple} from './util/fetch'; import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; describe('integration test: send NFT', () => { let api: any; diff --git a/tests/src/rmrk/setCollectionProperty.test.ts b/tests/src/rmrk/setCollectionProperty.test.ts index 9bc0ecb57f..4cb6a2d0a4 100644 --- a/tests/src/rmrk/setCollectionProperty.test.ts +++ b/tests/src/rmrk/setCollectionProperty.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, setPropertyCollection} from './util/tx'; diff --git a/tests/src/rmrk/setEquippableList.test.ts b/tests/src/rmrk/setEquippableList.test.ts index 95176c8828..6e16877d52 100644 --- a/tests/src/rmrk/setEquippableList.test.ts +++ b/tests/src/rmrk/setEquippableList.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {expectTxFailure} from './util/helpers'; import {createCollection, createBase, setEquippableList} from './util/tx'; diff --git a/tests/src/rmrk/setNftProperty.test.ts b/tests/src/rmrk/setNftProperty.test.ts index 5451283315..ba7254092a 100644 --- a/tests/src/rmrk/setNftProperty.test.ts +++ b/tests/src/rmrk/setNftProperty.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {NftIdTuple} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import {createCollection, mintNft, sendNft, setNftProperty} from './util/tx'; diff --git a/tests/src/rmrk/setResourcePriorities.test.ts b/tests/src/rmrk/setResourcePriorities.test.ts index 53eac860b2..ac26d7874b 100644 --- a/tests/src/rmrk/setResourcePriorities.test.ts +++ b/tests/src/rmrk/setResourcePriorities.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../util/helpers'; +import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {expectTxFailure} from './util/helpers'; import {mintNft, createCollection, setResourcePriorities} from './util/tx'; diff --git a/tests/src/substrate/get-balance.ts b/tests/src/substrate/get-balance.ts index 807e40c73e..733dede57e 100644 --- a/tests/src/substrate/get-balance.ts +++ b/tests/src/substrate/get-balance.ts @@ -19,7 +19,7 @@ import {AccountInfo} from '@polkadot/types/interfaces/system'; import promisifySubstrate from './promisify-substrate'; import {IKeyringPair} from '@polkadot/types/types'; import {submitTransactionAsync} from './substrate-api'; -import {getGenericResult} from '../util/helpers'; +import {getGenericResult} from '../deprecated-helpers/helpers'; import {expect} from 'chai'; export default async function getBalance(api: ApiPromise, accounts: string[]): Promise> { diff --git a/tests/src/transfer.nload.ts b/tests/src/transfer.nload.ts index 4d95eab428..1e22f45af0 100644 --- a/tests/src/transfer.nload.ts +++ b/tests/src/transfer.nload.ts @@ -18,10 +18,24 @@ import {ApiPromise} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; import usingApi, {submitTransactionAsync} from './substrate/substrate-api'; import waitNewBlocks from './substrate/wait-new-blocks'; -import {findUnusedAddresses} from './util/helpers'; import * as cluster from 'cluster'; import os from 'os'; +async function findUnusedAddress(api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair, seedAddition = ''): Promise { + let bal = 0n; + let unused; + do { + const randomSeed = 'seed' + Math.floor(Math.random() * Math.floor(10000)) + seedAddition; + unused = privateKeyWrapper(`//${randomSeed}`); + bal = (await api.query.system.account(unused.address)).data.free.toBigInt(); + } while (bal !== 0n); + return unused; +} + +function findUnusedAddresses(api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair, amount: number): Promise { + return Promise.all(new Array(amount).fill(null).map(() => findUnusedAddress(api, privateKeyWrapper, '_' + Date.now()))); +} + // Innacurate transfer fee const FEE = 10n ** 8n; diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index 98bb83e772..093ca2ba22 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -38,6 +38,7 @@ export enum Pallets { Fungible = 'fungible', NFT = 'nonfungible', Scheduler = 'scheduler', + AppPromotion = 'apppromotion', } export function requirePalletsOrSkip(test: Context, helper: DevUniqueHelper, requiredPallets: string[]) { diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 18ffd807ab..89a0d4bb09 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -330,6 +330,11 @@ class ChainHelperBase { this.chainLog = []; } + getApi(): ApiPromise { + if(this.api === null) throw Error('API not initialized'); + return this.api; + } + clearChainLog(): void { this.chainLog = []; } diff --git a/tests/src/xcm/xcmOpal.test.ts b/tests/src/xcm/xcmOpal.test.ts index d8765a5939..c5358c3953 100644 --- a/tests/src/xcm/xcmOpal.test.ts +++ b/tests/src/xcm/xcmOpal.test.ts @@ -21,9 +21,8 @@ import {WsProvider} from '@polkadot/api'; import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; import usingApi, {executeTransaction} from './../substrate/substrate-api'; -import {bigIntToDecimals, describe_xcm, getGenericResult, paraSiblingSovereignAccount} from './../util/helpers'; +import {bigIntToDecimals, describe_xcm, getGenericResult, paraSiblingSovereignAccount, normalizeAccountId} from './../deprecated-helpers/helpers'; import waitNewBlocks from './../substrate/wait-new-blocks'; -import {normalizeAccountId} from './../util/helpers'; import getBalance from './../substrate/get-balance'; diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index cb05f94396..6ee1f06d29 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -21,7 +21,7 @@ import {WsProvider, Keyring} from '@polkadot/api'; import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../util/helpers'; +import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../deprecated-helpers/helpers'; import {MultiLocation} from '@polkadot/types/interfaces'; import {blake2AsHex} from '@polkadot/util-crypto'; import waitNewBlocks from '../substrate/wait-new-blocks'; diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index 91ba806fa6..3764c9d780 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -21,7 +21,7 @@ import {WsProvider, Keyring} from '@polkadot/api'; import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../util/helpers'; +import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../deprecated-helpers/helpers'; import {MultiLocation} from '@polkadot/types/interfaces'; import {blake2AsHex} from '@polkadot/util-crypto'; import waitNewBlocks from '../substrate/wait-new-blocks'; From 5f8c947dd85dd3764dbb59bee284f5ec275c147b Mon Sep 17 00:00:00 2001 From: Igor Kozyrev Date: Thu, 6 Oct 2022 09:25:22 +0000 Subject: [PATCH 1061/1274] up version --- Cargo.lock | 4 ++-- README.md | 2 +- runtime/quartz/Cargo.toml | 2 +- runtime/unique/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e17b8e1141..ee89308fab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8576,7 +8576,7 @@ dependencies = [ [[package]] name = "quartz-runtime" -version = "0.9.27" +version = "0.9.29" dependencies = [ "app-promotion-rpc", "cumulus-pallet-aura-ext", @@ -12568,7 +12568,7 @@ dependencies = [ [[package]] name = "unique-runtime" -version = "0.9.27" +version = "0.9.29" dependencies = [ "app-promotion-rpc", "cumulus-pallet-aura-ext", diff --git a/README.md b/README.md index c81d977271..cb8c607dae 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ git checkout feature/runtime-upgrade-testing ``` git clone https://github.com/paritytech/polkadot.git cd polkadot -git checkout release-v0.9.27 +git checkout release-v0.9.29 cargo build --release ``` diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 486f098366..8597bdb60b 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -10,7 +10,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'quartz-runtime' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.9.27' +version = '0.9.29' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 1ce0bf67eb..b721a28b57 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -10,7 +10,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'unique-runtime' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.9.27' +version = '0.9.29' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] From f462fd90fa851b160a2a484b5943043cbb429ac7 Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 6 Oct 2022 09:46:15 +0000 Subject: [PATCH 1062/1274] Tests: code-style fixes --- tests/src/addCollectionAdmin.test.ts | 2 +- tests/src/approve.test.ts | 6 ++--- tests/src/block-production.test.ts | 2 +- tests/src/createMultipleItemsEx.test.ts | 16 +++++------- tests/src/creditFeesToTreasury.test.ts | 10 ++++---- tests/src/eth/createNFTCollection.test.ts | 2 +- tests/src/eth/proxy/nonFungibleProxy.test.ts | 26 +++++++------------- tests/src/eth/util/playgrounds/unique.dev.ts | 4 +-- tests/src/inflation.test.ts | 6 ++--- tests/src/nesting/properties.test.ts | 12 ++++----- tests/src/pallet-presence.test.ts | 2 +- tests/src/tx-version-presence.test.ts | 2 +- tests/src/util/playgrounds/unique.dev.ts | 10 ++++---- tests/src/util/playgrounds/unique.ts | 4 +-- 14 files changed, 46 insertions(+), 58 deletions(-) diff --git a/tests/src/addCollectionAdmin.test.ts b/tests/src/addCollectionAdmin.test.ts index 3d6a4e92e0..42aa65d331 100644 --- a/tests/src/addCollectionAdmin.test.ts +++ b/tests/src/addCollectionAdmin.test.ts @@ -110,7 +110,7 @@ describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_ const [alice, ...accounts] = await helper.arrange.createAccounts([10n, 0n, 0n, 0n, 0n, 0n, 0n, 0n], donor); const collection = await helper.nft.mintCollection(alice, {name: 'Collection Name', description: 'Collection Description', tokenPrefix: 'COL'}); - const chainAdminLimit = (helper.api!.consts.common.collectionAdminsLimit as any).toNumber(); + const chainAdminLimit = (helper.getApi().consts.common.collectionAdminsLimit as any).toNumber(); expect(chainAdminLimit).to.be.equal(5); for (let i = 0; i < chainAdminLimit; i++) { diff --git a/tests/src/approve.test.ts b/tests/src/approve.test.ts index 9c8eceac98..3524645bf1 100644 --- a/tests/src/approve.test.ts +++ b/tests/src/approve.test.ts @@ -60,7 +60,7 @@ describe('Integration Test approve(spender, collection_id, item_id, amount):', ( const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true; - await helper.signTransaction(alice, helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0)); + await helper.signTransaction(alice, helper.constructApiCall('api.tx.unique.approve', [{Substrate: bob.address}, collectionId, tokenId, 0])); expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.false; }); @@ -275,7 +275,7 @@ describe('User may clear the approvals to approving for 0 amount:', () => { const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address}); await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}); expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.true; - await helper.signTransaction(alice, helper.api?.tx.unique.approve({Substrate: bob.address}, collectionId, tokenId, 0)); + await helper.signTransaction(alice, helper.constructApiCall('api.tx.unique.approve', [{Substrate: bob.address}, collectionId, tokenId, 0])); expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: bob.address})).to.be.false; const transferTokenFromTx = async () => helper.nft.transferTokenFrom(bob, collectionId, tokenId, {Substrate: bob.address}, {Substrate: bob.address}); await expect(transferTokenFromTx()).to.be.rejected; @@ -328,7 +328,7 @@ describe('User cannot approve for the amount greater than they own:', () => { itSub('1 for NFT', async ({helper}) => { const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: bob.address}); - const approveTx = async () => helper.signTransaction(bob, helper.api?.tx.unique.approve({Substrate: charlie.address}, collectionId, tokenId, 2)); + const approveTx = async () => helper.signTransaction(bob, helper.constructApiCall('api.tx.unique.approve', [{Substrate: charlie.address}, collectionId, tokenId, 2])); await expect(approveTx()).to.be.rejected; expect(await helper.nft.isTokenApproved(collectionId, tokenId, {Substrate: charlie.address})).to.be.false; }); diff --git a/tests/src/block-production.test.ts b/tests/src/block-production.test.ts index 222f959c1e..4c22da3c12 100644 --- a/tests/src/block-production.test.ts +++ b/tests/src/block-production.test.ts @@ -37,7 +37,7 @@ function getBlocks(api: ApiPromise): Promise { describe('Block Production smoke test', () => { itSub('Node produces new blocks', async ({helper}) => { - const blocks: number[] | undefined = await getBlocks(helper.api!); + const blocks: number[] | undefined = await getBlocks(helper.getApi()); expect(blocks[0]).to.be.lessThan(blocks[1]); }); }); diff --git a/tests/src/createMultipleItemsEx.test.ts b/tests/src/createMultipleItemsEx.test.ts index b946d080a0..b8ce8cd20f 100644 --- a/tests/src/createMultipleItemsEx.test.ts +++ b/tests/src/createMultipleItemsEx.test.ts @@ -178,13 +178,12 @@ describe('Integration Test: createMultipleItemsEx', () => { tokenPrefix: 'COL', }, 0); - const api = helper.api; - await helper.signTransaction(alice, api?.tx.unique.createMultipleItemsEx(collection.collectionId, { + await helper.executeExtrinsic(alice, 'api.tx.unique.createMultipleItemsEx',[collection.collectionId, { Fungible: new Map([ [JSON.stringify({Substrate: alice.address}), 50], [JSON.stringify({Substrate: bob.address}), 100], ]), - })); + }], true); expect(await collection.getBalance({Substrate: alice.address})).to.be.equal(50n); expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(100n); @@ -200,8 +199,7 @@ describe('Integration Test: createMultipleItemsEx', () => { ], }); - const api = helper.api; - await helper.signTransaction(alice, api?.tx.unique.createMultipleItemsEx(collection.collectionId, { + await helper.executeExtrinsic(alice, 'api.tx.unique.createMultipleItemsEx', [collection.collectionId, { RefungibleMultipleOwners: { users: new Map([ [JSON.stringify({Substrate: alice.address}), 1], @@ -211,7 +209,7 @@ describe('Integration Test: createMultipleItemsEx', () => { {key: 'k', value: 'v'}, ], }, - })); + }], true); const tokenId = await collection.getLastTokenId(); expect(tokenId).to.be.equal(1); expect(await collection.getTokenBalance(1, {Substrate: alice.address})).to.be.equal(1n); @@ -228,9 +226,7 @@ describe('Integration Test: createMultipleItemsEx', () => { ], }); - const api = helper.api; - - await helper.signTransaction(alice, api?.tx.unique.createMultipleItemsEx(collection.collectionId, { + await helper.executeExtrinsic(alice, 'api.tx.unique.createMultipleItemsEx', [collection.collectionId, { RefungibleMultipleItems: [ { user: {Substrate: alice.address}, pieces: 1, @@ -245,7 +241,7 @@ describe('Integration Test: createMultipleItemsEx', () => { ], }, ], - })); + }], true); expect(await collection.getLastTokenId()).to.be.equal(2); expect(await collection.getTokenBalance(1, {Substrate: alice.address})).to.be.equal(1n); diff --git a/tests/src/creditFeesToTreasury.test.ts b/tests/src/creditFeesToTreasury.test.ts index 48c9d053c4..842cc0fc89 100644 --- a/tests/src/creditFeesToTreasury.test.ts +++ b/tests/src/creditFeesToTreasury.test.ts @@ -70,7 +70,7 @@ describe('integration test: Fees must be credited to Treasury:', () => { }); itSub('Sender balance decreased by fee+sent amount, Treasury balance increased by fee', async ({helper}) => { - await skipInflationBlock(helper.api!); + await skipInflationBlock(helper.getApi()); await helper.wait.newBlocks(1); const treasuryBalanceBefore = await helper.balance.getSubstrate(TREASURY); @@ -89,7 +89,7 @@ describe('integration test: Fees must be credited to Treasury:', () => { }); itSub('Treasury balance increased by failed tx fee', async ({helper}) => { - const api = helper.api!; + const api = helper.getApi(); await helper.wait.newBlocks(1); const treasuryBalanceBefore = await helper.balance.getSubstrate(TREASURY); @@ -107,7 +107,7 @@ describe('integration test: Fees must be credited to Treasury:', () => { }); itSub('NFT Transactions also send fees to Treasury', async ({helper}) => { - await skipInflationBlock(helper.api!); + await skipInflationBlock(helper.getApi()); await helper.wait.newBlocks(1); const treasuryBalanceBefore = await helper.balance.getSubstrate(TREASURY); @@ -125,7 +125,7 @@ describe('integration test: Fees must be credited to Treasury:', () => { itSub('Fees are sane', async ({helper}) => { const unique = helper.balance.getOneTokenNominal(); - await skipInflationBlock(helper.api!); + await skipInflationBlock(helper.getApi()); await helper.wait.newBlocks(1); const aliceBalanceBefore = await helper.balance.getSubstrate(alice.address); @@ -140,7 +140,7 @@ describe('integration test: Fees must be credited to Treasury:', () => { }); itSub('NFT Transfer fee is close to 0.1 Unique', async ({helper}) => { - await skipInflationBlock(helper.api!); + await skipInflationBlock(helper.getApi()); await helper.wait.newBlocks(1); const collection = await helper.nft.mintCollection(alice, { diff --git a/tests/src/eth/createNFTCollection.test.ts b/tests/src/eth/createNFTCollection.test.ts index 4257ab89cb..3113cc79c4 100644 --- a/tests/src/eth/createNFTCollection.test.ts +++ b/tests/src/eth/createNFTCollection.test.ts @@ -152,7 +152,7 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { donor = privateKey('//Alice'); - nominal = helper.balance.getOneTokenNominal() + nominal = helper.balance.getOneTokenNominal(); }); }); diff --git a/tests/src/eth/proxy/nonFungibleProxy.test.ts b/tests/src/eth/proxy/nonFungibleProxy.test.ts index bfbc0b7593..1aa6557fe5 100644 --- a/tests/src/eth/proxy/nonFungibleProxy.test.ts +++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts @@ -138,23 +138,16 @@ describe('NFT (Via EVM proxy): Plain calls', () => { }); //TODO: CORE-302 add eth methods - itEth.skip('Can perform mintBulk()', async ({helper, privateKey}) => { - const api = helper.getApi(); - const web3 = helper.getWeb3(); - const privateKeyWrapper = privateKey; - /* - const collection = await createCollectionExpectSuccess({ - mode: {type: 'NFT'}, - }); - const alice = privateKeyWrapper('//Alice'); + itEth.skip('Can perform mintBulk()', async ({helper}) => { + const collection = await helper.nft.mintCollection(donor, {name: 'New', description: 'New collection', tokenPrefix: 'NEW'}); - const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper); - const receiver = createEthAccount(web3); + const caller = await helper.eth.createAccountWithBalance(donor, 30n); + const receiver = helper.eth.createAccount(); - const address = collectionIdToAddress(collection); - const contract = await proxyWrap(api, web3, new web3.eth.Contract(nonFungibleAbi as any, address, {from: caller, ...GAS_ARGS}), privateKeyWrapper); - const changeAdminTx = api.tx.unique.addCollectionAdmin(collection, {Ethereum: contract.options.address}); - await submitTransactionAsync(alice, changeAdminTx); + const address = helper.ethAddress.fromCollectionId(collection.collectionId); + const evmCollection = helper.ethNativeContract.collection(address, 'nft', caller); + const contract = await proxyWrap(helper, evmCollection, donor); + await collection.addAdmin(donor, {Ethereum: contract.options.address}); { const nextTokenId = await contract.methods.nextTokenId().call(); @@ -167,7 +160,7 @@ describe('NFT (Via EVM proxy): Plain calls', () => { [+nextTokenId + 2, 'Test URI 2'], ], ).send({from: caller}); - const events = normalizeEvents(result.events); + const events = helper.eth.normalizeEvents(result.events); expect(events).to.be.deep.equal([ { @@ -203,7 +196,6 @@ describe('NFT (Via EVM proxy): Plain calls', () => { expect(await contract.methods.tokenURI(+nextTokenId + 1).call()).to.be.equal('Test URI 1'); expect(await contract.methods.tokenURI(+nextTokenId + 2).call()).to.be.equal('Test URI 2'); } - */ }); itEth('Can perform burn()', async ({helper}) => { diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index 69737fab1d..a842b2b143 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -285,8 +285,8 @@ class EthGroup extends EthGroupBase { await code(); // In dev mode, the transaction might not finish processing in time await this.helper.wait.newBlocks(1); - } - return await this.helper.arrange.calculcateFee(address, code); + }; + return await this.helper.arrange.calculcateFee(address, wrappedCode); } } diff --git a/tests/src/inflation.test.ts b/tests/src/inflation.test.ts index 015ceb1aeb..670e3100fe 100644 --- a/tests/src/inflation.test.ts +++ b/tests/src/inflation.test.ts @@ -40,9 +40,9 @@ describe('integration test: Inflation', () => { const tx = helper.constructApiCall('api.tx.inflation.startInflation', [1]); await expect(helper.executeExtrinsic(superuser, 'api.tx.sudo.sudo', [tx])).to.not.be.rejected; - const blockInterval = (helper.api!.consts.inflation.inflationBlockInterval as any).toBigInt(); - const totalIssuanceStart = ((await helper.api!.query.inflation.startingYearTotalIssuance()) as any).toBigInt(); - const blockInflation = (await helper.api!.query.inflation.blockInflation() as any).toBigInt(); + const blockInterval = (helper.getApi().consts.inflation.inflationBlockInterval as any).toBigInt(); + const totalIssuanceStart = ((await helper.callRpc('api.query.inflation.startingYearTotalIssuance', [])) as any).toBigInt(); + const blockInflation = (await helper.callRpc('api.query.inflation.blockInflation', []) as any).toBigInt(); const YEAR = 5259600n; // 6-second block. Blocks in one year // const YEAR = 2629800n; // 12-second block. Blocks in one year diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index 9e4c90083d..7d20a3c46e 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -276,7 +276,7 @@ describe('Integration Test: Access Rights to Token Properties', () => { itSub('Reads access rights to properties of a collection', async ({helper}) => { const collection = await helper.nft.mintCollection(alice); - const propertyRights = (await helper.api!.query.common.collectionPropertyPermissions(collection.collectionId)).toJSON(); + const propertyRights = (await helper.callRpc('api.query.common.collectionPropertyPermissions', [collection.collectionId])).toJSON(); expect(propertyRights).to.be.empty; }); @@ -817,7 +817,7 @@ describe('Negative Integration Test: Token Properties', () => { ).to.be.fulfilled; } - const originalSpace = await getConsumedSpace(token.collection.helper.api, token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); + const originalSpace = await getConsumedSpace(token.collection.helper.getApi(), token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); return originalSpace; } @@ -840,7 +840,7 @@ describe('Negative Integration Test: Token Properties', () => { ).to.be.rejectedWith(/common\.NoPermission/); } - const consumedSpace = await getConsumedSpace(token.collection.helper.api, token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); + const consumedSpace = await getConsumedSpace(token.collection.helper.getApi(), token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); expect(consumedSpace).to.be.equal(originalSpace); } @@ -875,7 +875,7 @@ describe('Negative Integration Test: Token Properties', () => { ).to.be.rejectedWith(/common\.NoPermission/); } - const consumedSpace = await getConsumedSpace(token.collection.helper.api, token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); + const consumedSpace = await getConsumedSpace(token.collection.helper.getApi(), token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); expect(consumedSpace).to.be.equal(originalSpace); } @@ -911,7 +911,7 @@ describe('Negative Integration Test: Token Properties', () => { expect(await token.getProperties(['non-existent', 'now-existent'])).to.be.empty; - const consumedSpace = await getConsumedSpace(token.collection.helper.api, token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); + const consumedSpace = await getConsumedSpace(token.collection.helper.getApi(), token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); expect(consumedSpace).to.be.equal(originalSpace); } @@ -951,7 +951,7 @@ describe('Negative Integration Test: Token Properties', () => { ])).to.be.rejectedWith(/common\.NoSpaceForProperty/); expect(await token.getProperties(['a_holy_book', 'young_years'])).to.be.empty; - const consumedSpace = await getConsumedSpace(token.collection.helper.api, token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); + const consumedSpace = await getConsumedSpace(token.collection.helper.getApi(), token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); expect(consumedSpace).to.be.equal(originalSpace); } diff --git a/tests/src/pallet-presence.test.ts b/tests/src/pallet-presence.test.ts index 0d814bdf28..2a10a0db78 100644 --- a/tests/src/pallet-presence.test.ts +++ b/tests/src/pallet-presence.test.ts @@ -59,7 +59,7 @@ const consensusPallets = [ describe('Pallet presence', () => { before(async () => { await usingPlaygrounds(async helper => { - const chain = await helper.api!.rpc.system.chain(); + const chain = await helper.callRpc('api.rpc.system.chain', []); const refungible = 'refungible'; const scheduler = 'scheduler'; diff --git a/tests/src/tx-version-presence.test.ts b/tests/src/tx-version-presence.test.ts index 058103f888..9e80dd65a4 100644 --- a/tests/src/tx-version-presence.test.ts +++ b/tests/src/tx-version-presence.test.ts @@ -22,7 +22,7 @@ let metadata: Metadata; describe('TxVersion is present', () => { before(async () => { await usingPlaygrounds(async helper => { - metadata = await helper.api!.rpc.state.getMetadata(); + metadata = await helper.callRpc('api.rpc.state.getMetadata', []); }); }); diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 47c1c8bd24..9399f473db 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -215,8 +215,8 @@ class ArrangeGroup { }; isDevNode = async () => { - const block1 = await this.helper.api?.rpc.chain.getBlock(await this.helper.api?.rpc.chain.getBlockHash(1)); - const block2 = await this.helper.api?.rpc.chain.getBlock(await this.helper.api?.rpc.chain.getBlockHash(2)); + const block1 = await this.helper.callRpc('api.rpc.chain.getBlock', [await this.helper.callRpc('api.rpc.chain.getBlockHash', [1])]); + const block2 = await this.helper.callRpc('api.rpc.chain.getBlock', [await this.helper.callRpc('api.rpc.chain.getBlockHash', [2])]); const findCreationDate = async (block: any) => { const humanBlock = block.toHuman(); let date; @@ -259,7 +259,7 @@ class WaitGroup { async newBlocks(blocksCount = 1): Promise { // eslint-disable-next-line no-async-promise-executor const promise = new Promise(async (resolve) => { - const unsubscribe = await this.helper.api!.rpc.chain.subscribeNewHeads(() => { + const unsubscribe = await this.helper.getApi().rpc.chain.subscribeNewHeads(() => { if (blocksCount > 0) { blocksCount--; } else { @@ -274,7 +274,7 @@ class WaitGroup { async forParachainBlockNumber(blockNumber: bigint) { // eslint-disable-next-line no-async-promise-executor return new Promise(async (resolve) => { - const unsubscribe = await this.helper.api!.rpc.chain.subscribeNewHeads(async (data: any) => { + const unsubscribe = await this.helper.getApi().rpc.chain.subscribeNewHeads(async (data: any) => { if (data.number.toNumber() >= blockNumber) { unsubscribe(); resolve(); @@ -286,7 +286,7 @@ class WaitGroup { async forRelayBlockNumber(blockNumber: bigint) { // eslint-disable-next-line no-async-promise-executor return new Promise(async (resolve) => { - const unsubscribe = await this.helper.api!.query.parachainSystem.validationData(async (data: any) => { + const unsubscribe = await this.helper.getApi().query.parachainSystem.validationData(async (data: any) => { if (data.value.relayParentNumber.toNumber() >= blockNumber) { // @ts-ignore unsubscribe(); diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 89a0d4bb09..56191e837f 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -1991,7 +1991,7 @@ class ChainGroup extends HelperGroup { * @returns ss58Format, token decimals, and token symbol */ getChainProperties(): IChainProperties { - const properties = (this.helper.api as any).registry.getChainProperties().toJSON(); + const properties = (this.helper.getApi() as any).registry.getChainProperties().toJSON(); return { ss58Format: properties.ss58Format.toJSON(), tokenDecimals: properties.tokenDecimals.toJSON(), @@ -2034,7 +2034,7 @@ class ChainGroup extends HelperGroup { * @returns number, account's nonce */ async getNonce(address: TSubstrateAccount): Promise { - return (await (this.helper.api as any).query.system.account(address)).nonce.toNumber(); + return (await this.helper.callRpc('api.query.system.account', [address])).nonce.toNumber(); } } From 8fce67681f3fb8dced960ae4c70825f5846044a6 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 6 Oct 2022 14:02:05 +0300 Subject: [PATCH 1063/1274] Test node update only fix. --- .github/workflows/node-only-update_v2.yml | 28 +++++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 8479ac07ab..a2990bef21 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -170,7 +170,7 @@ jobs: yarn add mochawesome echo "Ready to start tests" yarn polkadot-types - NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-before-${NOW} + NOW=$(date +%s) && yarn testConnection --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ @@ -180,21 +180,30 @@ jobs: if: success() || failure() # run this step even if previous step failed with: name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created - path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-before-*.json # Path to test results + path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' - - name: Send SIGUSR1 to polkadot-launch process + - name: Send SIGUSR1 to polkadotlaunch process if: success() || failure() run: | - #Get PID of polkadot-launch + ContainerID=$(docker ps -aqf "name=node-parachain") PID=$(docker exec node-parachain pidof 'polkadot-launch') echo "Polkadot-launch PID: $PID" - #Send SIGUSR1 signal to $PID docker exec node-parachain kill -SIGUSR1 ${PID} echo "SIGUSR1 sent to Polkadot-launch PID: $PID" + docker logs ${ContainerID} + + - name: Get chain logs + if: always() # run this step always + run: | + docker exec node-parachain cat /polkadot-launch/9944.log + docker exec node-parachain cat /polkadot-launch/9945.log + docker exec node-parachain cat /polkadot-launch/alice.log + docker exec node-parachain cat /polkadot-launch/eve.log + docker exec node-parachain cat /polkadot-launch/dave.log + docker exec node-parachain cat /polkadot-launch/charlie.log - # 🌗 All parachain collators restarted with the new binaries. - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade. if: success() run: | @@ -241,15 +250,14 @@ jobs: shell: bash - name: Run tests after Node Parachain upgrade - if: success() - working-directory: ${{ matrix.mainnet_branch }}/tests + working-directory: tests run: | yarn install yarn add mochawesome node scripts/readyness.js echo "Ready to start tests" yarn polkadot-types - NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-after-${NOW} + NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} env: RPC_URL: http://127.0.0.1:9933/ @@ -259,7 +267,7 @@ jobs: if: success() || failure() # run this step even if previous step failed with: name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created - path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-after-*.json # Path to test results + path: tests/mochawesome-report/test-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' From e620ed909cf2df0e6c54030efd9e313b35104b2b Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 6 Oct 2022 14:05:00 +0300 Subject: [PATCH 1064/1274] added stale parameters. --- .github/workflows/node-only-update_v2.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index a2990bef21..24eacd774a 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -170,7 +170,7 @@ jobs: yarn add mochawesome echo "Ready to start tests" yarn polkadot-types - NOW=$(date +%s) && yarn testConnection --reporter mochawesome --reporter-options reportFilename=test-${NOW} + NOW=$(date +%s) && yarn testConnection --reporter mochawesome --reporter-options reportFilename=test-before-${NOW} env: RPC_URL: http://127.0.0.1:9933/ @@ -180,11 +180,11 @@ jobs: if: success() || failure() # run this step even if previous step failed with: name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created - path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-*.json # Path to test results + path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-before-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' - - name: Send SIGUSR1 to polkadotlaunch process + - name: Send SIGUSR1 to polkadot-launch process if: success() || failure() run: | ContainerID=$(docker ps -aqf "name=node-parachain") @@ -250,14 +250,15 @@ jobs: shell: bash - name: Run tests after Node Parachain upgrade - working-directory: tests + if: success() + working-directory: ${{ matrix.mainnet_branch }}/tests run: | yarn install yarn add mochawesome node scripts/readyness.js echo "Ready to start tests" yarn polkadot-types - NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} + NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-after-${NOW} env: RPC_URL: http://127.0.0.1:9933/ @@ -267,7 +268,7 @@ jobs: if: success() || failure() # run this step even if previous step failed with: name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created - path: tests/mochawesome-report/test-*.json # Path to test results + path: tests/mochawesome-report/test-after-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' From aff9f8c4db77109ebeefdd4899c52798165b7058 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 6 Oct 2022 14:06:21 +0300 Subject: [PATCH 1065/1274] Add stale path to tests. --- .github/workflows/node-only-update_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 24eacd774a..3f8dd7b56c 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -268,7 +268,7 @@ jobs: if: success() || failure() # run this step even if previous step failed with: name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created - path: tests/mochawesome-report/test-after-*.json # Path to test results + path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-after-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' From 46e9b30c30f7d585a1ca77606242a9c98d50adad Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Thu, 6 Oct 2022 15:27:17 +0300 Subject: [PATCH 1066/1274] change to all tests. remove readyness.js as it not exists at old branches. --- .github/workflows/node-only-update_v2.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 3f8dd7b56c..1ac59eb7fe 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -170,7 +170,7 @@ jobs: yarn add mochawesome echo "Ready to start tests" yarn polkadot-types - NOW=$(date +%s) && yarn testConnection --reporter mochawesome --reporter-options reportFilename=test-before-${NOW} + NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-before-${NOW} env: RPC_URL: http://127.0.0.1:9933/ @@ -195,7 +195,7 @@ jobs: docker logs ${ContainerID} - name: Get chain logs - if: always() # run this step always + if: failure() # run this step only at failure run: | docker exec node-parachain cat /polkadot-launch/9944.log docker exec node-parachain cat /polkadot-launch/9945.log @@ -255,7 +255,6 @@ jobs: run: | yarn install yarn add mochawesome - node scripts/readyness.js echo "Ready to start tests" yarn polkadot-types NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-after-${NOW} From 4a02655589a8bf25d0b39d2b9c09b72ced729164 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 6 Oct 2022 14:09:58 +0000 Subject: [PATCH 1067/1274] feat: catch dispatchError in playgrounds --- tests/src/util/playgrounds/types.ts | 2 ++ tests/src/util/playgrounds/unique.ts | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/src/util/playgrounds/types.ts b/tests/src/util/playgrounds/types.ts index 956f4b64ec..20cf80790b 100644 --- a/tests/src/util/playgrounds/types.ts +++ b/tests/src/util/playgrounds/types.ts @@ -14,6 +14,7 @@ export interface IEvent { export interface ITransactionResult { status: 'Fail' | 'Success'; result: { + dispatchError: any, events: { phase: any, // {ApplyExtrinsic: number} | 'Initialization', event: IEvent; @@ -47,6 +48,7 @@ export interface IUniqueHelperLog { call: string; params: any[]; moduleError?: string; + dispatchError?: any; events?: any; } diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 56191e837f..aa4d0de53c 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -514,12 +514,18 @@ class ChainHelperBase { params, } as IUniqueHelperLog; - if(result.status !== this.transactionStatus.SUCCESS && result.moduleError) log.moduleError = result.moduleError; + if(result.status !== this.transactionStatus.SUCCESS) { + if (result.moduleError) log.moduleError = result.moduleError; + else if (result.result.dispatchError) log.dispatchError = result.result.dispatchError; + } if(events.length > 0) log.events = events; this.chainLog.push(log); - if(expectSuccess && result.status !== this.transactionStatus.SUCCESS) throw Error(`${result.moduleError}`); + if(expectSuccess && result.status !== this.transactionStatus.SUCCESS) { + if (result.moduleError) throw Error(`${result.moduleError}`); + else if (result.result.dispatchError) throw Error(JSON.stringify(result.result.dispatchError)); + } return result; } From 17a52a581b90e05a1bd81ef4e5050887fe9b3ca7 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 6 Oct 2022 15:01:08 +0000 Subject: [PATCH 1068/1274] feat: add nested ops - scheduled and sudo --- tests/src/eth/util/playgrounds/index.ts | 1 - tests/src/eth/util/playgrounds/unique.dev.ts | 22 +- tests/src/util/playgrounds/types.ts | 8 + tests/src/util/playgrounds/unique.dev.ts | 19 +- tests/src/util/playgrounds/unique.ts | 324 ++++++++++++++++++- 5 files changed, 360 insertions(+), 14 deletions(-) diff --git a/tests/src/eth/util/playgrounds/index.ts b/tests/src/eth/util/playgrounds/index.ts index 5c5b587025..1229e15ccc 100644 --- a/tests/src/eth/util/playgrounds/index.ts +++ b/tests/src/eth/util/playgrounds/index.ts @@ -39,7 +39,6 @@ export const usingEthPlaygrounds = async (code: (helper: EthUniqueHelper, privat } finally { await helper.disconnect(); - await helper.disconnectWeb3(); silentConsole.disable(); } }; diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index a842b2b143..b66f784500 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -321,6 +321,7 @@ class EthAddressGroup extends EthGroupBase { } } +export type EthUniqueHelperConstructor = new (...args: any[]) => EthUniqueHelper; export class EthUniqueHelper extends DevUniqueHelper { web3: Web3 | null = null; @@ -331,8 +332,10 @@ export class EthUniqueHelper extends DevUniqueHelper { ethNativeContract: NativeContractGroup; ethContract: ContractGroup; - constructor(logger: { log: (msg: any, level: any) => void, level: any }) { - super(logger); + constructor(logger: { log: (msg: any, level: any) => void, level: any }, options: {[key: string]: any} = {}) { + options.helperBase = options.helperBase ?? EthUniqueHelper; + + super(logger, options); this.eth = new EthGroup(this); this.ethAddress = new EthAddressGroup(this); this.ethNativeContract = new NativeContractGroup(this); @@ -350,10 +353,23 @@ export class EthUniqueHelper extends DevUniqueHelper { this.web3 = new Web3(this.web3Provider); } - async disconnectWeb3() { + async disconnect() { if(this.web3 === null) return; this.web3Provider?.connection.close(); + + await super.disconnect(); + } + + clearApi() { this.web3 = null; } + + clone(helperCls: EthUniqueHelperConstructor, options?: { [key: string]: any; }): EthUniqueHelper { + const newHelper = super.clone(helperCls, options) as EthUniqueHelper; + newHelper.web3 = this.web3; + newHelper.web3Provider = this.web3Provider; + + return newHelper; + } } \ No newline at end of file diff --git a/tests/src/util/playgrounds/types.ts b/tests/src/util/playgrounds/types.ts index 20cf80790b..56669dfb51 100644 --- a/tests/src/util/playgrounds/types.ts +++ b/tests/src/util/playgrounds/types.ts @@ -164,6 +164,14 @@ export interface IStakingInfo { amount: bigint, } +export interface ISchedulerOptions { + priority?: number, + periodic?: { + period: number, + repetitions: number, + }, +} + export type TSubstrateAccount = string; export type TEthereumAccount = string; export type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated'; diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 9399f473db..b8650a634c 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -7,6 +7,9 @@ import {ApiPromise, WsProvider} from '@polkadot/api'; import * as defs from '../../interfaces/definitions'; import {IKeyringPair} from '@polkadot/types/types'; import {ICrossAccountId} from './types'; +import type {EventRecord} from '@polkadot/types/interfaces'; +import {VoidFn} from '@polkadot/api/types'; +import {FrameSystemEventRecord} from '@polkadot/types/lookup'; export class SilentLogger { @@ -63,8 +66,10 @@ export class DevUniqueHelper extends UniqueHelper { wait: WaitGroup; admin: AdminGroup; - constructor(logger: { log: (msg: any, level: any) => void, level: any }) { - super(logger); + constructor(logger: { log: (msg: any, level: any) => void, level: any }, options: {[key: string]: any} = {}) { + options.helperBase = options.helperBase ?? DevUniqueHelper; + + super(logger, options); this.arrange = new ArrangeGroup(this); this.wait = new WaitGroup(this); this.admin = new AdminGroup(this); @@ -108,9 +113,9 @@ export class DevUniqueHelper extends UniqueHelper { } class ArrangeGroup { - helper: UniqueHelper; + helper: DevUniqueHelper; - constructor(helper: UniqueHelper) { + constructor(helper: DevUniqueHelper) { this.helper = helper; } @@ -245,14 +250,14 @@ class ArrangeGroup { } class WaitGroup { - helper: UniqueHelper; + helper: DevUniqueHelper; - constructor(helper: UniqueHelper) { + constructor(helper: DevUniqueHelper) { this.helper = helper; } /** - * Wait for specified bnumber of blocks + * Wait for specified number of blocks * @param blocksCount number of blocks to wait * @returns */ diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index aa4d0de53c..8e02ecb57f 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -9,7 +9,8 @@ import {ApiPromise, WsProvider, Keyring} from '@polkadot/api'; import {ApiInterfaceEvents, SignerOptions} from '@polkadot/api/types'; import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; -import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; +import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISchedulerOptions, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; +import {RuntimeDispatchInfo} from '@polkadot/types/interfaces'; export class CrossAccountId implements ICrossAccountId { Substrate?: TSubstrateAccount; @@ -318,6 +319,7 @@ class ChainHelperBase { forcedNetwork: TUniqueNetworks | null; network: TUniqueNetworks | null; chainLog: IUniqueHelperLog[]; + children: ChainHelperBase[]; constructor(logger?: ILogger) { this.util = UniqueUtil; @@ -328,6 +330,7 @@ class ChainHelperBase { this.forcedNetwork = null; this.network = null; this.chainLog = []; + this.children = []; } getApi(): ApiPromise { @@ -351,8 +354,16 @@ class ChainHelperBase { } async disconnect() { + for (const child of this.children) { + child.clearApi(); + } + if (this.api === null) return; await this.api.disconnect(); + this.clearApi(); + } + + clearApi() { this.api = null; this.network = null; } @@ -479,7 +490,7 @@ class ChainHelperBase { constructApiCall(apiCall: string, params: any[]) { if(!apiCall.startsWith('api.')) throw Error(`Invalid api call: ${apiCall}`); - let call = this.api as any; + let call = this.getApi() as any; for(const part of apiCall.slice(4).split('.')) { call = call[part]; } @@ -2248,7 +2259,67 @@ class StakingGroup extends HelperGroup { } } +class SchedulerGroup extends HelperGroup { + constructor(helper: UniqueHelper) { + super(helper); + } + + async cancelScheduled(signer: TSigner, scheduledId: string) { + return this.helper.executeExtrinsic( + signer, + 'api.tx.scheduler.cancelNamed', + [scheduledId], + true, + ); + } + + async changePriority(signer: TSigner, scheduledId: string, priority: number) { + return this.helper.executeExtrinsic( + signer, + 'api.tx.scheduler.changeNamedPriority', + [scheduledId, priority], + true, + ); + } + + scheduleAt( + scheduledId: string, + executionBlockNumber: number, + options: ISchedulerOptions = {}, + ) { + return this.schedule('scheduleNamed', scheduledId, executionBlockNumber, options); + } + + scheduleAfter( + scheduledId: string, + blocksBeforeExecution: number, + options: ISchedulerOptions = {}, + ) { + return this.schedule('scheduleNamedAfter', scheduledId, blocksBeforeExecution, options); + } + + schedule( + scheduleFn: 'scheduleNamed' | 'scheduleNamedAfter', + scheduledId: string, + blocksNum: number, + options: ISchedulerOptions = {}, + ) { + // eslint-disable-next-line @typescript-eslint/naming-convention + const ScheduledHelperType = ScheduledUniqueHelper(this.helper.helperBase); + return this.helper.clone(ScheduledHelperType, { + scheduleFn, + scheduledId, + blocksNum, + options, + }) as T; + } +} + +export type UniqueHelperConstructor = new(...args: any[]) => UniqueHelper; + export class UniqueHelper extends ChainHelperBase { + helperBase: any; + chain: ChainGroup; balance: BalanceGroup; address: AddressGroup; @@ -2257,9 +2328,13 @@ export class UniqueHelper extends ChainHelperBase { rft: RFTGroup; ft: FTGroup; staking: StakingGroup; + scheduler: SchedulerGroup; - constructor(logger?: ILogger) { + constructor(logger?: ILogger, options: {[key: string]: any} = {}) { super(logger); + + this.helperBase = options.helperBase ?? UniqueHelper; + this.chain = new ChainGroup(this); this.balance = new BalanceGroup(this); this.address = new AddressGroup(this); @@ -2268,9 +2343,98 @@ export class UniqueHelper extends ChainHelperBase { this.rft = new RFTGroup(this); this.ft = new FTGroup(this); this.staking = new StakingGroup(this); + this.scheduler = new SchedulerGroup(this); } + + clone(helperCls: UniqueHelperConstructor, options: {[key: string]: any} = {}) { + Object.setPrototypeOf(helperCls.prototype, this); + const newHelper = new helperCls(this.logger, options); + + newHelper.api = this.api; + newHelper.network = this.network; + newHelper.forceNetwork = this.forceNetwork; + + this.children.push(newHelper); + + return newHelper; + } + + getSudo() { + // eslint-disable-next-line @typescript-eslint/naming-convention + const SudoHelperType = SudoUniqueHelper(this.helperBase); + return this.clone(SudoHelperType) as T; + } +} + +// eslint-disable-next-line @typescript-eslint/naming-convention +function ScheduledUniqueHelper(Base: T) { + return class extends Base { + scheduleFn: 'scheduleNamed' | 'scheduleNamedAfter'; + scheduledId: string; + blocksNum: number; + options: ISchedulerOptions; + + constructor(...args: any[]) { + const logger = args[0] as ILogger; + const options = args[1] as { + scheduleFn: 'scheduleNamed' | 'scheduleNamedAfter', + scheduledId: string, + blocksNum: number, + options: ISchedulerOptions + }; + + super(logger); + + this.scheduleFn = options.scheduleFn; + this.scheduledId = options.scheduledId; + this.blocksNum = options.blocksNum; + this.options = options.options; + } + + executeExtrinsic(sender: IKeyringPair, scheduledExtrinsic: string, scheduledParams: any[], expectSuccess?: boolean): Promise { + const scheduledTx = this.constructApiCall(scheduledExtrinsic, scheduledParams); + const extrinsic = 'api.tx.scheduler.' + this.scheduleFn; + + return super.executeExtrinsic( + sender, + extrinsic, + [ + this.scheduledId, + this.blocksNum, + this.options.periodic ? [this.options.periodic.period, this.options.periodic.repetitions] : null, + this.options.priority ?? null, + {Value: scheduledTx}, + ], + expectSuccess, + ); + } + }; } +// eslint-disable-next-line @typescript-eslint/naming-convention +function SudoUniqueHelper(Base: T) { + return class extends Base { + constructor(...args: any[]) { + super(...args); + } + + executeExtrinsic ( + sender: IKeyringPair, + extrinsic: string, + params: any[], + expectSuccess?: boolean, + ): Promise { + const call = this.constructApiCall(extrinsic, params); + + return super.executeExtrinsic( + sender, + 'api.tx.sudo.sudo', + [call], + expectSuccess, + ); + } + }; +} export class UniqueBaseCollection { helper: UniqueHelper; @@ -2372,6 +2536,28 @@ export class UniqueBaseCollection { async burn(signer: TSigner) { return await this.helper.collection.burn(signer, this.collectionId); } + + scheduleAt( + scheduledId: string, + executionBlockNumber: number, + options: ISchedulerOptions = {}, + ) { + const scheduledHelper = this.helper.scheduler.scheduleAt(scheduledId, executionBlockNumber, options); + return new UniqueBaseCollection(this.collectionId, scheduledHelper); + } + + scheduleAfter( + scheduledId: string, + blocksBeforeExecution: number, + options: ISchedulerOptions = {}, + ) { + const scheduledHelper = this.helper.scheduler.scheduleAfter(scheduledId, blocksBeforeExecution, options); + return new UniqueBaseCollection(this.collectionId, scheduledHelper); + } + + getSudo() { + return new UniqueBaseCollection(this.collectionId, this.helper.getSudo()); + } } @@ -2459,6 +2645,28 @@ export class UniqueNFTCollection extends UniqueBaseCollection { async unnestToken(signer: TSigner, tokenId: number, fromTokenObj: IToken, toAddressObj: ICrossAccountId) { return await this.helper.nft.unnestToken(signer, {collectionId: this.collectionId, tokenId}, fromTokenObj, toAddressObj); } + + scheduleAt( + scheduledId: string, + executionBlockNumber: number, + options: ISchedulerOptions = {}, + ) { + const scheduledHelper = this.helper.scheduler.scheduleAt(scheduledId, executionBlockNumber, options); + return new UniqueNFTCollection(this.collectionId, scheduledHelper); + } + + scheduleAfter( + scheduledId: string, + blocksBeforeExecution: number, + options: ISchedulerOptions = {}, + ) { + const scheduledHelper = this.helper.scheduler.scheduleAfter(scheduledId, blocksBeforeExecution, options); + return new UniqueNFTCollection(this.collectionId, scheduledHelper); + } + + getSudo() { + return new UniqueNFTCollection(this.collectionId, this.helper.getSudo()); + } } @@ -2542,6 +2750,28 @@ export class UniqueRFTCollection extends UniqueBaseCollection { async setTokenPropertyPermissions(signer: TSigner, permissions: ITokenPropertyPermission[]) { return await this.helper.rft.setTokenPropertyPermissions(signer, this.collectionId, permissions); } + + scheduleAt( + scheduledId: string, + executionBlockNumber: number, + options: ISchedulerOptions = {}, + ) { + const scheduledHelper = this.helper.scheduler.scheduleAt(scheduledId, executionBlockNumber, options); + return new UniqueRFTCollection(this.collectionId, scheduledHelper); + } + + scheduleAfter( + scheduledId: string, + blocksBeforeExecution: number, + options: ISchedulerOptions = {}, + ) { + const scheduledHelper = this.helper.scheduler.scheduleAfter(scheduledId, blocksBeforeExecution, options); + return new UniqueRFTCollection(this.collectionId, scheduledHelper); + } + + getSudo() { + return new UniqueRFTCollection(this.collectionId, this.helper.getSudo()); + } } @@ -2589,6 +2819,28 @@ export class UniqueFTCollection extends UniqueBaseCollection { async approveTokens(signer: TSigner, toAddressObj: ICrossAccountId, amount=1n) { return await this.helper.ft.approveTokens(signer, this.collectionId, toAddressObj, amount); } + + scheduleAt( + scheduledId: string, + executionBlockNumber: number, + options: ISchedulerOptions = {}, + ) { + const scheduledHelper = this.helper.scheduler.scheduleAt(scheduledId, executionBlockNumber, options); + return new UniqueFTCollection(this.collectionId, scheduledHelper); + } + + scheduleAfter( + scheduledId: string, + blocksBeforeExecution: number, + options: ISchedulerOptions = {}, + ) { + const scheduledHelper = this.helper.scheduler.scheduleAfter(scheduledId, blocksBeforeExecution, options); + return new UniqueFTCollection(this.collectionId, scheduledHelper); + } + + getSudo() { + return new UniqueFTCollection(this.collectionId, this.helper.getSudo()); + } } @@ -2626,6 +2878,28 @@ export class UniqueBaseToken { nestingAccount() { return this.collection.helper.util.getTokenAccount(this); } + + scheduleAt( + scheduledId: string, + executionBlockNumber: number, + options: ISchedulerOptions = {}, + ) { + const scheduledCollection = this.collection.scheduleAt(scheduledId, executionBlockNumber, options); + return new UniqueBaseToken(this.tokenId, scheduledCollection); + } + + scheduleAfter( + scheduledId: string, + blocksBeforeExecution: number, + options: ISchedulerOptions = {}, + ) { + const scheduledCollection = this.collection.scheduleAfter(scheduledId, blocksBeforeExecution, options); + return new UniqueBaseToken(this.tokenId, scheduledCollection); + } + + getSudo() { + return new UniqueBaseToken(this.tokenId, this.collection.getSudo()); + } } @@ -2684,6 +2958,28 @@ export class UniqueNFToken extends UniqueBaseToken { async burnFrom(signer: TSigner, fromAddressObj: ICrossAccountId) { return await this.collection.burnTokenFrom(signer, this.tokenId, fromAddressObj); } + + scheduleAt( + scheduledId: string, + executionBlockNumber: number, + options: ISchedulerOptions = {}, + ) { + const scheduledCollection = this.collection.scheduleAt(scheduledId, executionBlockNumber, options); + return new UniqueNFToken(this.tokenId, scheduledCollection); + } + + scheduleAfter( + scheduledId: string, + blocksBeforeExecution: number, + options: ISchedulerOptions = {}, + ) { + const scheduledCollection = this.collection.scheduleAfter(scheduledId, blocksBeforeExecution, options); + return new UniqueNFToken(this.tokenId, scheduledCollection); + } + + getSudo() { + return new UniqueNFToken(this.tokenId, this.collection.getSudo()); + } } export class UniqueRFToken extends UniqueBaseToken { @@ -2737,4 +3033,26 @@ export class UniqueRFToken extends UniqueBaseToken { async burnFrom(signer: TSigner, fromAddressObj: ICrossAccountId, amount=1n) { return await this.collection.burnTokenFrom(signer, this.tokenId, fromAddressObj, amount); } + + scheduleAt( + scheduledId: string, + executionBlockNumber: number, + options: ISchedulerOptions = {}, + ) { + const scheduledCollection = this.collection.scheduleAt(scheduledId, executionBlockNumber, options); + return new UniqueRFToken(this.tokenId, scheduledCollection); + } + + scheduleAfter( + scheduledId: string, + blocksBeforeExecution: number, + options: ISchedulerOptions = {}, + ) { + const scheduledCollection = this.collection.scheduleAfter(scheduledId, blocksBeforeExecution, options); + return new UniqueRFToken(this.tokenId, scheduledCollection); + } + + getSudo() { + return new UniqueRFToken(this.tokenId, this.collection.getSudo()); + } } From 09b9e64d04803cd8a90c21601e293e0ad749c3de Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 6 Oct 2022 16:52:09 +0000 Subject: [PATCH 1069/1274] fix: remove unused imports --- tests/src/util/playgrounds/unique.dev.ts | 4 ---- tests/src/util/playgrounds/unique.ts | 1 - 2 files changed, 5 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index b8650a634c..af25949bfb 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -7,10 +7,6 @@ import {ApiPromise, WsProvider} from '@polkadot/api'; import * as defs from '../../interfaces/definitions'; import {IKeyringPair} from '@polkadot/types/types'; import {ICrossAccountId} from './types'; -import type {EventRecord} from '@polkadot/types/interfaces'; -import {VoidFn} from '@polkadot/api/types'; -import {FrameSystemEventRecord} from '@polkadot/types/lookup'; - export class SilentLogger { log(_msg: any, _level: any): void { } diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 8e02ecb57f..dd6ebc7355 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -10,7 +10,6 @@ import {ApiInterfaceEvents, SignerOptions} from '@polkadot/api/types'; import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISchedulerOptions, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; -import {RuntimeDispatchInfo} from '@polkadot/types/interfaces'; export class CrossAccountId implements ICrossAccountId { Substrate?: TSubstrateAccount; From 3bccb6bdb53e7d164c1ced12bcc9f421b4399f6d Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 6 Oct 2022 17:30:22 +0000 Subject: [PATCH 1070/1274] feat: add usingPlaygrounds.atUrl, move describeXcm --- tests/src/deprecated-helpers/helpers.ts | 6 ------ tests/src/util/playgrounds/index.ts | 12 +++++++++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/src/deprecated-helpers/helpers.ts b/tests/src/deprecated-helpers/helpers.ts index ac998ea567..0236de50d1 100644 --- a/tests/src/deprecated-helpers/helpers.ts +++ b/tests/src/deprecated-helpers/helpers.ts @@ -1764,12 +1764,6 @@ export async function queryCollectionExpectSuccess(api: ApiPromise, collectionId return (await api.rpc.unique.collectionById(collectionId)).unwrap(); } -export const describe_xcm = ( - process.env.RUN_XCM_TESTS - ? describe - : describe.skip -); - export async function waitNewBlocks(blocksCount = 1): Promise { await usingApi(async (api) => { const promise = new Promise(async (resolve) => { diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index 093ca2ba22..ea09031177 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -12,7 +12,7 @@ import {DevUniqueHelper, SilentLogger, SilentConsole} from './unique.dev'; chai.use(chaiAsPromised); export const expect = chai.expect; -export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise, url: string = config.substrateUrl) => { +export async function usingPlaygrounds(code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise, url: string = config.substrateUrl) { const silentConsole = new SilentConsole(); silentConsole.enable(); @@ -28,6 +28,10 @@ export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKe await helper.disconnect(); silentConsole.disable(); } +} + +usingPlaygrounds.atUrl = (url: string, code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { + return usingPlaygrounds(code, url); }; export enum Pallets { @@ -72,3 +76,9 @@ itSub.skip = (name: string, cb: (apis: { helper: DevUniqueHelper, privateKey: (s itSubIfWithPallet.only = (name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSubIfWithPallet(name, required, cb, {only: true}); itSubIfWithPallet.skip = (name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSubIfWithPallet(name, required, cb, {skip: true}); itSub.ifWithPallets = itSubIfWithPallet; + +export const describeXcm = ( + process.env.RUN_XCM_TESTS + ? describe + : describe.skip +); From f2ade55622b2989f8b4d49e2e74bba5a30b26679 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 6 Oct 2022 17:31:07 +0000 Subject: [PATCH 1071/1274] feat: add foreignAssets to playgrnds --- tests/src/util/playgrounds/types.ts | 7 +++++++ tests/src/util/playgrounds/unique.ts | 28 +++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/tests/src/util/playgrounds/types.ts b/tests/src/util/playgrounds/types.ts index 56669dfb51..7813e41e24 100644 --- a/tests/src/util/playgrounds/types.ts +++ b/tests/src/util/playgrounds/types.ts @@ -172,6 +172,13 @@ export interface ISchedulerOptions { }, } +export interface IForeignAssetMetadata { + name?: number | Uint8Array, + symbol?: string, + decimals?: number, + minimalBalance?: bigint, +} + export type TSubstrateAccount = string; export type TEthereumAccount = string; export type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated'; diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index dd6ebc7355..4ea718298b 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -9,7 +9,7 @@ import {ApiPromise, WsProvider, Keyring} from '@polkadot/api'; import {ApiInterfaceEvents, SignerOptions} from '@polkadot/api/types'; import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; -import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISchedulerOptions, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types'; +import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISchedulerOptions, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks, IForeignAssetMetadata} from './types'; export class CrossAccountId implements ICrossAccountId { Substrate?: TSubstrateAccount; @@ -2314,6 +2314,30 @@ class SchedulerGroup extends HelperGroup { } } +class ForeignAssetsGroup extends HelperGroup { + constructor(helper: UniqueHelper) { + super(helper); + } + + async register(signer: TSigner, ownerAddress: TSubstrateAccount, location: any, metadata: IForeignAssetMetadata) { + await this.helper.executeExtrinsic( + signer, + 'api.tx.foreignAssets.registerForeignAsset', + [ownerAddress, location, metadata], + true, + ); + } + + async update(signer: TSigner, foreignAssetId: number, location: any, metadata: IForeignAssetMetadata) { + await this.helper.executeExtrinsic( + signer, + 'api.tx.foreignAssets.updateForeignAsset', + [foreignAssetId, location, metadata], + true, + ); + } +} + export type UniqueHelperConstructor = new(...args: any[]) => UniqueHelper; export class UniqueHelper extends ChainHelperBase { @@ -2328,6 +2352,7 @@ export class UniqueHelper extends ChainHelperBase { ft: FTGroup; staking: StakingGroup; scheduler: SchedulerGroup; + foreignAssets: ForeignAssetsGroup; constructor(logger?: ILogger, options: {[key: string]: any} = {}) { super(logger); @@ -2343,6 +2368,7 @@ export class UniqueHelper extends ChainHelperBase { this.ft = new FTGroup(this); this.staking = new StakingGroup(this); this.scheduler = new SchedulerGroup(this); + this.foreignAssets = new ForeignAssetsGroup(this); } clone(helperCls: UniqueHelperConstructor, options: {[key: string]: any} = {}) { From 5ea65b7821a450c208297008fa420b1f0826f8c3 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 6 Oct 2022 17:31:28 +0000 Subject: [PATCH 1072/1274] refactor: draft move xcm tests to playgrounds --- tests/src/xcm/xcmOpal.test.ts | 376 +++++------ tests/src/xcm/xcmQuartz.test.ts | 1029 +++++++++++++++--------------- tests/src/xcm/xcmUnique.test.ts | 1040 +++++++++++++++---------------- 3 files changed, 1190 insertions(+), 1255 deletions(-) diff --git a/tests/src/xcm/xcmOpal.test.ts b/tests/src/xcm/xcmOpal.test.ts index c5358c3953..625b5446e9 100644 --- a/tests/src/xcm/xcmOpal.test.ts +++ b/tests/src/xcm/xcmOpal.test.ts @@ -14,33 +14,27 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; - -import {WsProvider} from '@polkadot/api'; -import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; -import usingApi, {executeTransaction} from './../substrate/substrate-api'; -import {bigIntToDecimals, describe_xcm, getGenericResult, paraSiblingSovereignAccount, normalizeAccountId} from './../deprecated-helpers/helpers'; -import waitNewBlocks from './../substrate/wait-new-blocks'; +import {executeTransaction} from './../substrate/substrate-api'; +import {bigIntToDecimals, getGenericResult, paraSiblingSovereignAccount} from './../deprecated-helpers/helpers'; import getBalance from './../substrate/get-balance'; - - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itSub, expect, describeXcm, usingPlaygrounds} from '../util/playgrounds'; const STATEMINE_CHAIN = 1000; const UNIQUE_CHAIN = 2095; const RELAY_PORT = '9844'; -const UNIQUE_PORT = '9944'; const STATEMINE_PORT = '9948'; + +const relayUrl = 'ws://127.0.0.1:' + RELAY_PORT; +const statemineUrl = 'ws://127.0.0.1:' + STATEMINE_PORT; + const STATEMINE_PALLET_INSTANCE = 50; const ASSET_ID = 100; const ASSET_METADATA_DECIMALS = 18; const ASSET_METADATA_NAME = 'USDT'; const ASSET_METADATA_DESCRIPTION = 'USDT'; -const ASSET_METADATA_MINIMAL_BALANCE = 1; +const ASSET_METADATA_MINIMAL_BALANCE = 1n; const WESTMINT_DECIMALS = 12; @@ -49,7 +43,7 @@ const TRANSFER_AMOUNT = 1_000_000_000_000_000_000n; // 10,000.00 (ten thousands) USDT const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n; -describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { +describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { let alice: IKeyringPair; let bob: IKeyringPair; @@ -69,24 +63,13 @@ describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); // funds donor + await usingPlaygrounds(async (_helper, privateKey) => { + alice = privateKey('//Alice'); + bob = privateKey('//Bob'); // funds donor }); - const statemineApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT), - }; - - const uniqueApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), - }; - - const relayApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + RELAY_PORT), - }; - - await usingApi(async (api) => { + await usingPlaygrounds.atUrl(statemineUrl, async (helper) => { + const api = helper.getApi(); // 350.00 (three hundred fifty) DOT const fundingAmount = 3_500_000_000_000; @@ -115,11 +98,10 @@ describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { const result4 = getGenericResult(events4); expect(result4.success).to.be.true; - }, statemineApiOptions); - + }); - await usingApi(async (api) => { + await usingPlaygrounds(async (helper) => { const location = { V1: { parents: 1, @@ -144,20 +126,23 @@ describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { decimals: ASSET_METADATA_DECIMALS, minimalBalance: ASSET_METADATA_MINIMAL_BALANCE, }; - //registerForeignAsset(owner, location, metadata) - const tx = api.tx.foreignAssets.registerForeignAsset(alice.addressRaw, location, metadata); - const sudoTx = api.tx.sudo.sudo(tx as any); - const events = await executeTransaction(api, alice, sudoTx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + await helper.getSudo().foreignAssets.register(alice, alice.address, location, metadata); + // const tx = api.tx.foreignAssets.registerForeignAsset(alice.addressRaw, location, metadata); + // const sudoTx = api.tx.sudo.sudo(tx as any); + // const events = await executeTransaction(api, alice, sudoTx); + // const result = getGenericResult(events); + // expect(result.success).to.be.true; - [balanceOpalBefore] = await getBalance(api, [alice.address]); + // [balanceOpalBefore] = await getBalance(api, [alice.address]); + balanceOpalBefore = await helper.balance.getSubstrate(alice.address); - }, uniqueApiOptions); + }); // Providing the relay currency to the unique sender account - await usingApi(async (api) => { + await usingPlaygrounds.atUrl(relayUrl, async (helper) => { + const api = helper.getApi(); + const destination = { V1: { parents: 0, @@ -205,21 +190,13 @@ describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { const events = await executeTransaction(api, alice, tx); const result = getGenericResult(events); expect(result.success).to.be.true; - }, relayApiOptions); + }); }); - it('Should connect and send USDT from Westmint to Opal', async () => { - - const statemineApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT), - }; - - const uniqueApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), - }; - - await usingApi(async (api) => { + itSub('Should connect and send USDT from Westmint to Opal', async ({helper}) => { + await usingPlaygrounds.atUrl(statemineUrl, async (helper) => { + const api = helper.getApi(); const dest = { V1: { @@ -288,125 +265,109 @@ describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { ); expect(balanceStmnBefore > balanceStmnAfter).to.be.true; - }, statemineApiOptions); + }); // ensure that asset has been delivered - await usingApi(async (api) => { - await waitNewBlocks(api, 3); - // expext collection id will be with id 1 - const free = (await api.query.fungible.balance(1, normalizeAccountId(alice.address))).toBigInt(); - - [balanceOpalAfter] = await getBalance(api, [alice.address]); - - // commission has not paid in USDT token - expect(free == TRANSFER_AMOUNT).to.be.true; - console.log( - 'Opal to Westmint transaction fees on Opal: %s USDT', - bigIntToDecimals(TRANSFER_AMOUNT - free), - ); - // ... and parachain native token - expect(balanceOpalAfter == balanceOpalBefore).to.be.true; - console.log( - 'Opal to Westmint transaction fees on Opal: %s WND', - bigIntToDecimals(balanceOpalAfter - balanceOpalBefore, WESTMINT_DECIMALS), - ); - - }, uniqueApiOptions); - + // await waitNewBlocks(api, 3); + await helper.wait.newBlocks(3); + + // expext collection id will be with id 1 + // const free = (await api.query.fungible.balance(1, normalizeAccountId(alice.address))).toBigInt(); + const free = await helper.ft.getBalance(1, {Substrate: alice.address}); + + // [balanceOpalAfter] = await getBalance(api, [alice.address]); + balanceOpalAfter = await helper.balance.getSubstrate(alice.address); + + // commission has not paid in USDT token + expect(free == TRANSFER_AMOUNT).to.be.true; + console.log( + 'Opal to Westmint transaction fees on Opal: %s USDT', + bigIntToDecimals(TRANSFER_AMOUNT - free), + ); + // ... and parachain native token + expect(balanceOpalAfter == balanceOpalBefore).to.be.true; + console.log( + 'Opal to Westmint transaction fees on Opal: %s WND', + bigIntToDecimals(balanceOpalAfter - balanceOpalBefore, WESTMINT_DECIMALS), + ); }); - it('Should connect and send USDT from Unique to Statemine back', async () => { - - const uniqueApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), - }; - - const statemineApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT), - }; + itSub('Should connect and send USDT from Unique to Statemine back', async ({helper}) => { + const api = helper.getApi(); - await usingApi(async (api) => { - const destination = { - V1: { - parents: 1, - interior: {X2: [ - { - Parachain: STATEMINE_CHAIN, - }, - { - AccountId32: { - network: 'Any', - id: alice.addressRaw, - }, - }, - ]}, - }, - }; - - const currencies: [any, bigint][] = [ - [ + const destination = { + V1: { + parents: 1, + interior: {X2: [ { - ForeignAssetId: 0, + Parachain: STATEMINE_CHAIN, }, - //10_000_000_000_000_000n, - TRANSFER_AMOUNT, - ], - [ { - NativeAssetId: 'Parent', + AccountId32: { + network: 'Any', + id: alice.addressRaw, + }, }, - 400_000_000_000_000n, - ], - ]; + ]}, + }, + }; - const feeItem = 1; - const destWeight = 500000000000; + const currencies: [any, bigint][] = [ + [ + { + ForeignAssetId: 0, + }, + //10_000_000_000_000_000n, + TRANSFER_AMOUNT, + ], + [ + { + NativeAssetId: 'Parent', + }, + 400_000_000_000_000n, + ], + ]; - const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight); - const events = await executeTransaction(api, alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - // the commission has been paid in parachain native token - [balanceOpalFinal] = await getBalance(api, [alice.address]); - expect(balanceOpalAfter > balanceOpalFinal).to.be.true; - }, uniqueApiOptions); + const feeItem = 1; + const destWeight = 500000000000; + + const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight); + const events = await executeTransaction(api, alice, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + // the commission has been paid in parachain native token + [balanceOpalFinal] = await getBalance(api, [alice.address]); + expect(balanceOpalAfter > balanceOpalFinal).to.be.true; + + await usingPlaygrounds.atUrl(statemineUrl, async (helper) => { + // await waitNewBlocks(api, 3); + await helper.wait.newBlocks(3); - await usingApi(async (api) => { - await waitNewBlocks(api, 3); + const api = helper.getApi(); // The USDT token never paid fees. Its amount not changed from begin value. // Also check that xcm transfer has been succeeded const free = ((await api.query.assets.account(100, alice.address)).toHuman()) as any; expect(BigInt(free.balance.replace(/,/g, '')) == ASSET_AMOUNT).to.be.true; - }, statemineApiOptions); + }); }); - it('Should connect and send Relay token to Unique', async () => { - - const uniqueApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), - }; - - const uniqueApiOptions2: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), - }; - - const relayApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + RELAY_PORT), - }; - + itSub('Should connect and send Relay token to Unique', async ({helper}) => { const TRANSFER_AMOUNT_RELAY = 50_000_000_000_000_000n; - await usingApi(async (api) => { - [balanceBobBefore] = await getBalance(api, [bob.address]); - balanceBobRelayTokenBefore = BigInt(((await api.query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free); + // [balanceBobBefore] = await getBalance(api, [bob.address]); + // balanceBobRelayTokenBefore = BigInt(((await api.query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free); + balanceBobBefore = await helper.balance.getSubstrate(bob.address); - }, uniqueApiOptions); + // TODO + balanceBobRelayTokenBefore = BigInt(((await helper.getApi().query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free); // Providing the relay currency to the unique sender account - await usingApi(async (api) => { + await usingPlaygrounds.atUrl(relayUrl, async (helper) => { + const api = helper.getApi(); + const destination = { V1: { parents: 0, @@ -454,73 +415,72 @@ describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { const events = await executeTransaction(api, bob, tx); const result = getGenericResult(events); expect(result.success).to.be.true; - }, relayApiOptions); + }); - await usingApi(async (api) => { - await waitNewBlocks(api, 3); - - [balanceBobAfter] = await getBalance(api, [bob.address]); - balanceBobRelayTokenAfter = BigInt(((await api.query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free); - const wndFee = balanceBobRelayTokenAfter - TRANSFER_AMOUNT_RELAY - balanceBobRelayTokenBefore; - console.log( - 'Relay (Westend) to Opal transaction fees: %s OPL', - bigIntToDecimals(balanceBobAfter - balanceBobBefore), - ); - console.log( - 'Relay (Westend) to Opal transaction fees: %s WND', - bigIntToDecimals(wndFee, WESTMINT_DECIMALS), - ); - expect(balanceBobBefore == balanceBobAfter).to.be.true; - expect(balanceBobRelayTokenBefore < balanceBobRelayTokenAfter).to.be.true; - }, uniqueApiOptions2); + // await waitNewBlocks(api, 3); + await helper.wait.newBlocks(3); + // [balanceBobAfter] = await getBalance(api, [bob.address]); + // balanceBobRelayTokenAfter = BigInt(((await api.query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free); + balanceBobAfter = await helper.balance.getSubstrate(bob.address); + + // TODO + balanceBobRelayTokenAfter = BigInt(((await helper.getApi().query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free); + + const wndFee = balanceBobRelayTokenAfter - TRANSFER_AMOUNT_RELAY - balanceBobRelayTokenBefore; + console.log( + 'Relay (Westend) to Opal transaction fees: %s OPL', + bigIntToDecimals(balanceBobAfter - balanceBobBefore), + ); + console.log( + 'Relay (Westend) to Opal transaction fees: %s WND', + bigIntToDecimals(wndFee, WESTMINT_DECIMALS), + ); + expect(balanceBobBefore == balanceBobAfter).to.be.true; + expect(balanceBobRelayTokenBefore < balanceBobRelayTokenAfter).to.be.true; }); - it('Should connect and send Relay token back', async () => { - const uniqueApiOptions: ApiOptions = { - provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT), - }; - - await usingApi(async (api) => { - const destination = { - V1: { - parents: 1, - interior: {X2: [ - { - Parachain: STATEMINE_CHAIN, - }, - { - AccountId32: { - network: 'Any', - id: bob.addressRaw, - }, - }, - ]}, - }, - }; - - const currencies: any = [ - [ + itSub('Should connect and send Relay token back', async ({helper}) => { + const destination = { + V1: { + parents: 1, + interior: {X2: [ { - NativeAssetId: 'Parent', + Parachain: STATEMINE_CHAIN, }, - 50_000_000_000_000_000n, - ], - ]; - - const feeItem = 0; - const destWeight = 500000000000; - - const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight); - const events = await executeTransaction(api, bob, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - [balanceBobFinal] = await getBalance(api, [bob.address]); - console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobFinal); + { + AccountId32: { + network: 'Any', + id: bob.addressRaw, + }, + }, + ]}, + }, + }; - }, uniqueApiOptions); + const currencies: any = [ + [ + { + NativeAssetId: 'Parent', + }, + 50_000_000_000_000_000n, + ], + ]; + + const feeItem = 0; + const destWeight = 500000000000; + + // TODO + const api = helper.getApi(); + const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight); + const events = await executeTransaction(api, bob, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + // [balanceBobFinal] = await getBalance(api, [bob.address]); + balanceBobFinal = await helper.balance.getSubstrate(bob.address); + console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobFinal); }); }); diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index 6ee1f06d29..71b2cb7e74 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -14,22 +14,15 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; - -import {WsProvider, Keyring} from '@polkadot/api'; -import {ApiOptions} from '@polkadot/api/types'; +import {Keyring} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../deprecated-helpers/helpers'; +import {submitTransactionAsync} from '../substrate/substrate-api'; +import {getGenericResult, generateKeyringPair, waitEvent, bigIntToDecimals} from '../deprecated-helpers/helpers'; import {MultiLocation} from '@polkadot/types/interfaces'; import {blake2AsHex} from '@polkadot/util-crypto'; -import waitNewBlocks from '../substrate/wait-new-blocks'; import getBalance from '../substrate/get-balance'; import {XcmV2TraitsOutcome, XcmV2TraitsError} from '../interfaces'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itSub, expect, describeXcm, usingPlaygrounds} from '../util/playgrounds'; const QUARTZ_CHAIN = 2095; const KARURA_CHAIN = 2000; @@ -39,29 +32,15 @@ const RELAY_PORT = 9844; const KARURA_PORT = 9946; const MOONRIVER_PORT = 9947; +const relayUrl = 'ws://127.0.0.1:' + RELAY_PORT; +const karuraUrl = 'ws://127.0.0.1:' + KARURA_PORT; +const moonriverUrl = 'ws://127.0.0.1:' + MOONRIVER_PORT; + const KARURA_DECIMALS = 12; const TRANSFER_AMOUNT = 2000000000000000000000000n; -function parachainApiOptions(port: number): ApiOptions { - return { - provider: new WsProvider('ws://127.0.0.1:' + port.toString()), - }; -} - -function karuraOptions(): ApiOptions { - return parachainApiOptions(KARURA_PORT); -} - -function moonriverOptions(): ApiOptions { - return parachainApiOptions(MOONRIVER_PORT); -} - -function relayOptions(): ApiOptions { - return parachainApiOptions(RELAY_PORT); -} - -describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { +describeXcm('[XCM] Integration test: Exchanging tokens with Karura', () => { let alice: IKeyringPair; let randomAccount: IKeyringPair; @@ -76,233 +55,234 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { let balanceQuartzForeignTokenFinal: bigint; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { + await usingPlaygrounds(async (helper, privateKey) => { const keyringSr25519 = new Keyring({type: 'sr25519'}); - alice = privateKeyWrapper('//Alice'); + alice = privateKey('//Alice'); randomAccount = generateKeyringPair(keyringSr25519); }); // Karura side - await usingApi( - async (api) => { - const destination = { - V0: { - X2: [ - 'Parent', - { - Parachain: QUARTZ_CHAIN, - }, - ], - }, - }; - - const metadata = { - name: 'QTZ', - symbol: 'QTZ', - decimals: 18, - minimalBalance: 1, - }; - - const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata); - const sudoTx = api.tx.sudo.sudo(tx as any); - const events = await submitTransactionAsync(alice, sudoTx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); - const events1 = await submitTransactionAsync(alice, tx1); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; - - [balanceKaruraTokenInit] = await getBalance(api, [randomAccount.address]); - { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceQuartzForeignTokenInit = BigInt(free); - } - }, - karuraOptions(), - ); - - // Quartz side - await usingApi(async (api) => { - const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); - const events0 = await submitTransactionAsync(alice, tx0); - const result0 = getGenericResult(events0); - expect(result0.success).to.be.true; - - [balanceQuartzTokenInit] = await getBalance(api, [randomAccount.address]); - }); - }); - - it('Should connect and send QTZ to Karura', async () => { - - // Quartz side - await usingApi(async (api) => { + await usingPlaygrounds.atUrl(karuraUrl, async (helper) => { + const api = helper.getApi(); const destination = { V0: { X2: [ 'Parent', { - Parachain: KARURA_CHAIN, + Parachain: QUARTZ_CHAIN, }, ], }, }; - const beneficiary = { - V0: { - X1: { - AccountId32: { - network: 'Any', - id: randomAccount.addressRaw, - }, - }, - }, + const metadata = { + name: 'QTZ', + symbol: 'QTZ', + decimals: 18, + minimalBalance: 1, }; - const assets = { - V1: [ + const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata); + const sudoTx = api.tx.sudo.sudo(tx as any); + const events = await submitTransactionAsync(alice, sudoTx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); + const events1 = await submitTransactionAsync(alice, tx1); + const result1 = getGenericResult(events1); + expect(result1.success).to.be.true; + + [balanceKaruraTokenInit] = await getBalance(api, [randomAccount.address]); + { + const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceQuartzForeignTokenInit = BigInt(free); + } + }); + + // Quartz side + await usingPlaygrounds(async (helper) => { + // const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); + // const events0 = await submitTransactionAsync(alice, tx0); + // const result0 = getGenericResult(events0); + // expect(result0.success).to.be.true; + await helper.balance.transferToSubstrate(alice, randomAccount.address, 10n * TRANSFER_AMOUNT); + + // [balanceQuartzTokenInit] = await getBalance(api, [randomAccount.address]); + balanceQuartzTokenInit = await helper.balance.getSubstrate(randomAccount.address); + }); + }); + + itSub('Should connect and send QTZ to Karura', async ({helper}) => { + + // Quartz side + const destination = { + V0: { + X2: [ + 'Parent', { - id: { - Concrete: { - parents: 0, - interior: 'Here', - }, - }, - fun: { - Fungible: TRANSFER_AMOUNT, - }, + Parachain: KARURA_CHAIN, }, ], - }; + }, + }; + + const beneficiary = { + V0: { + X1: { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, + }, + }, + }, + }; - const feeAssetItem = 0; + const assets = { + V1: [ + { + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: TRANSFER_AMOUNT, + }, + }, + ], + }; - const weightLimit = { - Limited: 5000000000, - }; + const feeAssetItem = 0; - const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); - const events = await submitTransactionAsync(randomAccount, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + const weightLimit = { + Limited: 5000000000, + }; - [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccount.address]); + // TODO + const tx = helper.getApi().tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); + const events = await submitTransactionAsync(randomAccount, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; - const qtzFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT; - console.log('[Quartz -> Karura] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees)); - expect(qtzFees > 0n).to.be.true; - }); + // [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccount.address]); + balanceQuartzTokenMiddle = await helper.balance.getSubstrate(randomAccount.address); + + const qtzFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT; + console.log('[Quartz -> Karura] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees)); + expect(qtzFees > 0n).to.be.true; // Karura side - await usingApi( - async (api) => { - await waitNewBlocks(api, 3); - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceQuartzForeignTokenMiddle = BigInt(free); + await usingPlaygrounds.atUrl(karuraUrl, async (helper) => { + // await waitNewBlocks(api, 3); + await helper.wait.newBlocks(3); - [balanceKaruraTokenMiddle] = await getBalance(api, [randomAccount.address]); + // TODO + const {free} = (await helper.getApi().query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceQuartzForeignTokenMiddle = BigInt(free); - const karFees = balanceKaruraTokenInit - balanceKaruraTokenMiddle; - const qtzIncomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenInit; + // [balanceKaruraTokenMiddle] = await getBalance(api, [randomAccount.address]); + balanceKaruraTokenMiddle = await helper.balance.getSubstrate(randomAccount.address); - console.log( - '[Quartz -> Karura] transaction fees on Karura: %s KAR', - bigIntToDecimals(karFees, KARURA_DECIMALS), - ); - console.log('[Quartz -> Karura] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer)); - expect(karFees == 0n).to.be.true; - expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true; - }, - karuraOptions(), - ); + const karFees = balanceKaruraTokenInit - balanceKaruraTokenMiddle; + const qtzIncomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenInit; + + console.log( + '[Quartz -> Karura] transaction fees on Karura: %s KAR', + bigIntToDecimals(karFees, KARURA_DECIMALS), + ); + console.log('[Quartz -> Karura] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer)); + expect(karFees == 0n).to.be.true; + expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true; + }); }); - it('Should connect to Karura and send QTZ back', async () => { + itSub('Should connect to Karura and send QTZ back', async ({helper}) => { // Karura side - await usingApi( - async (api) => { - const destination = { - V1: { - parents: 1, - interior: { - X2: [ - {Parachain: QUARTZ_CHAIN}, - { - AccountId32: { - network: 'Any', - id: randomAccount.addressRaw, - }, + await usingPlaygrounds.atUrl(karuraUrl, async (helper) => { + const destination = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: QUARTZ_CHAIN}, + { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, }, - ], - }, + }, + ], }, - }; + }, + }; - const id = { - ForeignAsset: 0, - }; + const id = { + ForeignAsset: 0, + }; - const destWeight = 50000000; + const destWeight = 50000000; - const tx = api.tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight); - const events = await submitTransactionAsync(randomAccount, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + // TODO + const tx = helper.getApi().tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight); + const events = await submitTransactionAsync(randomAccount, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; - [balanceKaruraTokenFinal] = await getBalance(api, [randomAccount.address]); - { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, id)).toJSON() as any; - balanceQuartzForeignTokenFinal = BigInt(free); - } + // [balanceKaruraTokenFinal] = await getBalance(api, [randomAccount.address]); + balanceKaruraTokenFinal = await helper.balance.getSubstrate(randomAccount.address); + { + // TODO + const {free} = (await helper.getApi().query.tokens.accounts(randomAccount.addressRaw, id)).toJSON() as any; + balanceQuartzForeignTokenFinal = BigInt(free); + } - const karFees = balanceKaruraTokenMiddle - balanceKaruraTokenFinal; - const qtzOutcomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenFinal; + const karFees = balanceKaruraTokenMiddle - balanceKaruraTokenFinal; + const qtzOutcomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenFinal; - console.log( - '[Karura -> Quartz] transaction fees on Karura: %s KAR', - bigIntToDecimals(karFees, KARURA_DECIMALS), - ); - console.log('[Karura -> Quartz] outcome %s QTZ', bigIntToDecimals(qtzOutcomeTransfer)); + console.log( + '[Karura -> Quartz] transaction fees on Karura: %s KAR', + bigIntToDecimals(karFees, KARURA_DECIMALS), + ); + console.log('[Karura -> Quartz] outcome %s QTZ', bigIntToDecimals(qtzOutcomeTransfer)); - expect(karFees > 0).to.be.true; - expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; - }, - karuraOptions(), - ); + expect(karFees > 0).to.be.true; + expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; + }); // Quartz side - await usingApi(async (api) => { - await waitNewBlocks(api, 3); + // await waitNewBlocks(api, 3); + await helper.wait.newBlocks(3); - [balanceQuartzTokenFinal] = await getBalance(api, [randomAccount.address]); - const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle; - expect(actuallyDelivered > 0).to.be.true; + // [balanceQuartzTokenFinal] = await getBalance(api, [randomAccount.address]); + balanceQuartzTokenFinal = await helper.balance.getSubstrate(randomAccount.address); + const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle; + expect(actuallyDelivered > 0).to.be.true; - console.log('[Karura -> Quartz] actually delivered %s QTZ', bigIntToDecimals(actuallyDelivered)); + console.log('[Karura -> Quartz] actually delivered %s QTZ', bigIntToDecimals(actuallyDelivered)); - const qtzFees = TRANSFER_AMOUNT - actuallyDelivered; - console.log('[Karura -> Quartz] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees)); - expect(qtzFees == 0n).to.be.true; - }); + const qtzFees = TRANSFER_AMOUNT - actuallyDelivered; + console.log('[Karura -> Quartz] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees)); + expect(qtzFees == 0n).to.be.true; }); }); // These tests are relevant only when the foreign asset pallet is disabled -describe_xcm('[XCM] Integration test: Quartz rejects non-native tokens', () => { +describeXcm('[XCM] Integration test: Quartz rejects non-native tokens', () => { let alice: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (_helper, privateKey) => { + alice = privateKey('//Alice'); }); }); - it('Quartz rejects tokens from the Relay', async () => { - await usingApi(async (api) => { + itSub('Quartz rejects tokens from the Relay', async ({helper}) => { + await usingPlaygrounds.atUrl(relayUrl, async (helper) => { const destination = { V1: { parents: 0, @@ -346,44 +326,45 @@ describe_xcm('[XCM] Integration test: Quartz rejects non-native tokens', () => { Limited: 5_000_000_000, }; - const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); + // TODO + const tx = helper.getApi().tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); const events = await submitTransactionAsync(alice, tx); const result = getGenericResult(events); expect(result.success).to.be.true; - }, relayOptions()); - - await usingApi(async api => { - const maxWaitBlocks = 3; - const dmpQueueExecutedDownward = await waitEvent( - api, - maxWaitBlocks, - 'dmpQueue', - 'ExecutedDownward', - ); + }); - expect( - dmpQueueExecutedDownward != null, - '[Relay] dmpQueue.ExecutedDownward event is expected', - ).to.be.true; + const maxWaitBlocks = 3; - const event = dmpQueueExecutedDownward!.event; - const outcome = event.data[1] as XcmV2TraitsOutcome; + // TODO + const dmpQueueExecutedDownward = await waitEvent( + helper.getApi(), + maxWaitBlocks, + 'dmpQueue', + 'ExecutedDownward', + ); - expect( - outcome.isIncomplete, - '[Relay] The outcome of the XCM should be `Incomplete`', - ).to.be.true; + expect( + dmpQueueExecutedDownward != null, + '[Relay] dmpQueue.ExecutedDownward event is expected', + ).to.be.true; - const incomplete = outcome.asIncomplete; - expect( - incomplete[1].toString() == 'AssetNotFound', - '[Relay] The XCM error should be `AssetNotFound`', - ).to.be.true; - }); + const event = dmpQueueExecutedDownward!.event; + const outcome = event.data[1] as XcmV2TraitsOutcome; + + expect( + outcome.isIncomplete, + '[Relay] The outcome of the XCM should be `Incomplete`', + ).to.be.true; + + const incomplete = outcome.asIncomplete; + expect( + incomplete[1].toString() == 'AssetNotFound', + '[Relay] The XCM error should be `AssetNotFound`', + ).to.be.true; }); - it('Quartz rejects KAR tokens from Karura', async () => { - await usingApi(async (api) => { + itSub('Quartz rejects KAR tokens from Karura', async ({helper}) => { + await usingPlaygrounds.atUrl(karuraUrl, async (helper) => { const destination = { V1: { parents: 1, @@ -407,33 +388,34 @@ describe_xcm('[XCM] Integration test: Quartz rejects non-native tokens', () => { const destWeight = 50000000; - const tx = api.tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight); + // TODO + const tx = helper.getApi().tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight); const events = await submitTransactionAsync(alice, tx); const result = getGenericResult(events); expect(result.success).to.be.true; - }, karuraOptions()); + }); - await usingApi(async api => { - const maxWaitBlocks = 3; - const xcmpQueueFailEvent = await waitEvent(api, maxWaitBlocks, 'xcmpQueue', 'Fail'); + const maxWaitBlocks = 3; - expect( - xcmpQueueFailEvent != null, - '[Karura] xcmpQueue.FailEvent event is expected', - ).to.be.true; + // TODO + const xcmpQueueFailEvent = await waitEvent(helper.getApi(), maxWaitBlocks, 'xcmpQueue', 'Fail'); - const event = xcmpQueueFailEvent!.event; - const outcome = event.data[1] as XcmV2TraitsError; + expect( + xcmpQueueFailEvent != null, + '[Karura] xcmpQueue.FailEvent event is expected', + ).to.be.true; - expect( - outcome.isUntrustedReserveLocation, - '[Karura] The XCM error should be `UntrustedReserveLocation`', - ).to.be.true; - }); + const event = xcmpQueueFailEvent!.event; + const outcome = event.data[1] as XcmV2TraitsError; + + expect( + outcome.isUntrustedReserveLocation, + '[Karura] The XCM error should be `UntrustedReserveLocation`', + ).to.be.true; }); }); -describe_xcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { +describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { // Quartz constants let quartzAlice: IKeyringPair; @@ -478,322 +460,327 @@ describe_xcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { let balanceMovrTokenFinal: bigint; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { + await usingPlaygrounds(async (_helper, privateKey) => { const keyringEth = new Keyring({type: 'ethereum'}); const keyringSr25519 = new Keyring({type: 'sr25519'}); - quartzAlice = privateKeyWrapper('//Alice'); + quartzAlice = privateKey('//Alice'); randomAccountQuartz = generateKeyringPair(keyringSr25519); randomAccountMoonriver = generateKeyringPair(keyringEth); balanceForeignQtzTokenInit = 0n; }); - await usingApi( - async (api) => { + await usingPlaygrounds.atUrl(moonriverUrl, async (helper) => { + // TODO - // >>> Sponsoring Dorothy >>> - console.log('Sponsoring Dorothy.......'); - const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n); - const events0 = await submitTransactionAsync(alithAccount, tx0); - const result0 = getGenericResult(events0); - expect(result0.success).to.be.true; - console.log('Sponsoring Dorothy.......DONE'); - // <<< Sponsoring Dorothy <<< + const api = helper.getApi(); - const sourceLocation: MultiLocation = api.createType( - 'MultiLocation', - { - parents: 1, - interior: {X1: {Parachain: QUARTZ_CHAIN}}, - }, - ); - - quartzAssetLocation = {XCM: sourceLocation}; - const existentialDeposit = 1; - const isSufficient = true; - const unitsPerSecond = '1'; - const numAssetsWeightHint = 0; - - const registerTx = api.tx.assetManager.registerForeignAsset( - quartzAssetLocation, - quartzAssetMetadata, - existentialDeposit, - isSufficient, - ); - console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || ''); - - const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond( - quartzAssetLocation, - unitsPerSecond, - numAssetsWeightHint, - ); - console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || ''); - - const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]); - console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || ''); - - // >>> Note motion preimage >>> - console.log('Note motion preimage.......'); - const encodedProposal = batchCall?.method.toHex() || ''; - const proposalHash = blake2AsHex(encodedProposal); - console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal); - console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); - console.log('Encoded length %d', encodedProposal.length); - - const tx1 = api.tx.democracy.notePreimage(encodedProposal); - const events1 = await submitTransactionAsync(baltatharAccount, tx1); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; - console.log('Note motion preimage.......DONE'); - // <<< Note motion preimage <<< - - // >>> Propose external motion through council >>> - console.log('Propose external motion through council.......'); - const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash); - const tx2 = api.tx.councilCollective.propose( - councilVotingThreshold, - externalMotion, - externalMotion.encodedLength, - ); - const events2 = await submitTransactionAsync(baltatharAccount, tx2); - const result2 = getGenericResult(events2); - expect(result2.success).to.be.true; - - const encodedMotion = externalMotion?.method.toHex() || ''; - const motionHash = blake2AsHex(encodedMotion); - console.log('Motion hash is %s', motionHash); - - const tx3 = api.tx.councilCollective.vote(motionHash, 0, true); - { - const events3 = await submitTransactionAsync(dorothyAccount, tx3); - const result3 = getGenericResult(events3); - expect(result3.success).to.be.true; - } - { - const events3 = await submitTransactionAsync(baltatharAccount, tx3); - const result3 = getGenericResult(events3); - expect(result3.success).to.be.true; - } - - const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength); - const events4 = await submitTransactionAsync(dorothyAccount, tx4); - const result4 = getGenericResult(events4); - expect(result4.success).to.be.true; - console.log('Propose external motion through council.......DONE'); - // <<< Propose external motion through council <<< - - // >>> Fast track proposal through technical committee >>> - console.log('Fast track proposal through technical committee.......'); - const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); - const tx5 = api.tx.techCommitteeCollective.propose( - technicalCommitteeThreshold, - fastTrack, - fastTrack.encodedLength, - ); - const events5 = await submitTransactionAsync(alithAccount, tx5); - const result5 = getGenericResult(events5); - expect(result5.success).to.be.true; - - const encodedFastTrack = fastTrack?.method.toHex() || ''; - const fastTrackHash = blake2AsHex(encodedFastTrack); - console.log('FastTrack hash is %s', fastTrackHash); - - const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1; - const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true); - { - const events6 = await submitTransactionAsync(baltatharAccount, tx6); - const result6 = getGenericResult(events6); - expect(result6.success).to.be.true; - } + // >>> Sponsoring Dorothy >>> + console.log('Sponsoring Dorothy.......'); + // const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n); + // const events0 = await submitTransactionAsync(alithAccount, tx0); + // const result0 = getGenericResult(events0); + // expect(result0.success).to.be.true; + await helper.balance.transferToSubstrate(alithAccount, dorothyAccount.address, 11_000_000_000_000_000_000n); + console.log('Sponsoring Dorothy.......DONE'); + // <<< Sponsoring Dorothy <<< + + const sourceLocation: MultiLocation = api.createType( + 'MultiLocation', { - const events6 = await submitTransactionAsync(alithAccount, tx6); - const result6 = getGenericResult(events6); - expect(result6.success).to.be.true; - } - - const tx7 = api.tx.techCommitteeCollective - .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength); - const events7 = await submitTransactionAsync(baltatharAccount, tx7); - const result7 = getGenericResult(events7); - expect(result7.success).to.be.true; - console.log('Fast track proposal through technical committee.......DONE'); - // <<< Fast track proposal through technical committee <<< - - // >>> Referendum voting >>> - console.log('Referendum voting.......'); - const tx8 = api.tx.democracy.vote( - 0, - {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}}, - ); - const events8 = await submitTransactionAsync(dorothyAccount, tx8); - const result8 = getGenericResult(events8); - expect(result8.success).to.be.true; - console.log('Referendum voting.......DONE'); - // <<< Referendum voting <<< - - // >>> Acquire Quartz AssetId Info on Moonriver >>> - console.log('Acquire Quartz AssetId Info on Moonriver.......'); - - // Wait for the democracy execute - await waitNewBlocks(api, 5); - - assetId = (await api.query.assetManager.assetTypeId({ - XCM: sourceLocation, - })).toString(); - - console.log('QTZ asset ID is %s', assetId); - console.log('Acquire Quartz AssetId Info on Moonriver.......DONE'); - // >>> Acquire Quartz AssetId Info on Moonriver >>> - - // >>> Sponsoring random Account >>> - console.log('Sponsoring random Account.......'); - const tx10 = api.tx.balances.transfer(randomAccountMoonriver.address, 11_000_000_000_000_000_000n); - const events10 = await submitTransactionAsync(baltatharAccount, tx10); - const result10 = getGenericResult(events10); - expect(result10.success).to.be.true; - console.log('Sponsoring random Account.......DONE'); - // <<< Sponsoring random Account <<< - - [balanceMovrTokenInit] = await getBalance(api, [randomAccountMoonriver.address]); - }, - moonriverOptions(), - ); + parents: 1, + interior: {X1: {Parachain: QUARTZ_CHAIN}}, + }, + ); + + quartzAssetLocation = {XCM: sourceLocation}; + const existentialDeposit = 1; + const isSufficient = true; + const unitsPerSecond = '1'; + const numAssetsWeightHint = 0; + + const registerTx = api.tx.assetManager.registerForeignAsset( + quartzAssetLocation, + quartzAssetMetadata, + existentialDeposit, + isSufficient, + ); + console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || ''); + + const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond( + quartzAssetLocation, + unitsPerSecond, + numAssetsWeightHint, + ); + console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || ''); + + const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]); + console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || ''); + + // >>> Note motion preimage >>> + console.log('Note motion preimage.......'); + const encodedProposal = batchCall?.method.toHex() || ''; + const proposalHash = blake2AsHex(encodedProposal); + console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal); + console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); + console.log('Encoded length %d', encodedProposal.length); + + const tx1 = api.tx.democracy.notePreimage(encodedProposal); + const events1 = await submitTransactionAsync(baltatharAccount, tx1); + const result1 = getGenericResult(events1); + expect(result1.success).to.be.true; + console.log('Note motion preimage.......DONE'); + // <<< Note motion preimage <<< + + // >>> Propose external motion through council >>> + console.log('Propose external motion through council.......'); + const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash); + const tx2 = api.tx.councilCollective.propose( + councilVotingThreshold, + externalMotion, + externalMotion.encodedLength, + ); + const events2 = await submitTransactionAsync(baltatharAccount, tx2); + const result2 = getGenericResult(events2); + expect(result2.success).to.be.true; + + const encodedMotion = externalMotion?.method.toHex() || ''; + const motionHash = blake2AsHex(encodedMotion); + console.log('Motion hash is %s', motionHash); + + const tx3 = api.tx.councilCollective.vote(motionHash, 0, true); + { + const events3 = await submitTransactionAsync(dorothyAccount, tx3); + const result3 = getGenericResult(events3); + expect(result3.success).to.be.true; + } + { + const events3 = await submitTransactionAsync(baltatharAccount, tx3); + const result3 = getGenericResult(events3); + expect(result3.success).to.be.true; + } + + const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength); + const events4 = await submitTransactionAsync(dorothyAccount, tx4); + const result4 = getGenericResult(events4); + expect(result4.success).to.be.true; + console.log('Propose external motion through council.......DONE'); + // <<< Propose external motion through council <<< + + // >>> Fast track proposal through technical committee >>> + console.log('Fast track proposal through technical committee.......'); + const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); + const tx5 = api.tx.techCommitteeCollective.propose( + technicalCommitteeThreshold, + fastTrack, + fastTrack.encodedLength, + ); + const events5 = await submitTransactionAsync(alithAccount, tx5); + const result5 = getGenericResult(events5); + expect(result5.success).to.be.true; + + const encodedFastTrack = fastTrack?.method.toHex() || ''; + const fastTrackHash = blake2AsHex(encodedFastTrack); + console.log('FastTrack hash is %s', fastTrackHash); + + const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1; + const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true); + { + const events6 = await submitTransactionAsync(baltatharAccount, tx6); + const result6 = getGenericResult(events6); + expect(result6.success).to.be.true; + } + { + const events6 = await submitTransactionAsync(alithAccount, tx6); + const result6 = getGenericResult(events6); + expect(result6.success).to.be.true; + } + + const tx7 = api.tx.techCommitteeCollective + .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength); + const events7 = await submitTransactionAsync(baltatharAccount, tx7); + const result7 = getGenericResult(events7); + expect(result7.success).to.be.true; + console.log('Fast track proposal through technical committee.......DONE'); + // <<< Fast track proposal through technical committee <<< + + // >>> Referendum voting >>> + console.log('Referendum voting.......'); + const tx8 = api.tx.democracy.vote( + 0, + {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}}, + ); + const events8 = await submitTransactionAsync(dorothyAccount, tx8); + const result8 = getGenericResult(events8); + expect(result8.success).to.be.true; + console.log('Referendum voting.......DONE'); + // <<< Referendum voting <<< + + // >>> Acquire Quartz AssetId Info on Moonriver >>> + console.log('Acquire Quartz AssetId Info on Moonriver.......'); + + // Wait for the democracy execute + // await waitNewBlocks(api, 5); + await helper.wait.newBlocks(5); + + assetId = (await api.query.assetManager.assetTypeId({ + XCM: sourceLocation, + })).toString(); + + console.log('QTZ asset ID is %s', assetId); + console.log('Acquire Quartz AssetId Info on Moonriver.......DONE'); + // >>> Acquire Quartz AssetId Info on Moonriver >>> + + // >>> Sponsoring random Account >>> + console.log('Sponsoring random Account.......'); + // const tx10 = api.tx.balances.transfer(randomAccountMoonriver.address, 11_000_000_000_000_000_000n); + // const events10 = await submitTransactionAsync(baltatharAccount, tx10); + // const result10 = getGenericResult(events10); + // expect(result10.success).to.be.true; + await helper.balance.transferToSubstrate(baltatharAccount, randomAccountMoonriver.address, 11_000_000_000_000_000_000n); + console.log('Sponsoring random Account.......DONE'); + // <<< Sponsoring random Account <<< + + // [balanceMovrTokenInit] = await getBalance(api, [randomAccountMoonriver.address]); + balanceMovrTokenInit = await helper.balance.getSubstrate(randomAccountMoonriver.address); + }); - await usingApi(async (api) => { - const tx0 = api.tx.balances.transfer(randomAccountQuartz.address, 10n * TRANSFER_AMOUNT); - const events0 = await submitTransactionAsync(quartzAlice, tx0); - const result0 = getGenericResult(events0); - expect(result0.success).to.be.true; + await usingPlaygrounds(async (helper) => { + // const tx0 = api.tx.balances.transfer(randomAccountQuartz.address, 10n * TRANSFER_AMOUNT); + // const events0 = await submitTransactionAsync(quartzAlice, tx0); + // const result0 = getGenericResult(events0); + // expect(result0.success).to.be.true; + await helper.balance.transferToSubstrate(quartzAlice, randomAccountQuartz.address, 10n * TRANSFER_AMOUNT); - [balanceQuartzTokenInit] = await getBalance(api, [randomAccountQuartz.address]); + // [balanceQuartzTokenInit] = await getBalance(api, [randomAccountQuartz.address]); + balanceQuartzTokenInit = await helper.balance.getSubstrate(randomAccountQuartz.address); }); }); - it('Should connect and send QTZ to Moonriver', async () => { - await usingApi(async (api) => { - const currencyId = { - NativeAssetId: 'Here', + itSub('Should connect and send QTZ to Moonriver', async ({helper}) => { + const currencyId = { + NativeAssetId: 'Here', + }; + const dest = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: MOONRIVER_CHAIN}, + {AccountKey20: {network: 'Any', key: randomAccountMoonriver.address}}, + ], + }, + }, + }; + const amount = TRANSFER_AMOUNT; + const destWeight = 850000000; + + // TODO + const tx = helper.getApi().tx.xTokens.transfer(currencyId, amount, dest, destWeight); + const events = await submitTransactionAsync(randomAccountQuartz, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + // [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccountQuartz.address]); + balanceQuartzTokenMiddle = await helper.balance.getSubstrate(randomAccountQuartz.address); + expect(balanceQuartzTokenMiddle < balanceQuartzTokenInit).to.be.true; + + const transactionFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT; + console.log('[Quartz -> Moonriver] transaction fees on Quartz: %s QTZ', bigIntToDecimals(transactionFees)); + expect(transactionFees > 0).to.be.true; + + await usingPlaygrounds.atUrl(moonriverUrl, async (helper) => { + // await waitNewBlocks(api, 3); + await helper.wait.newBlocks(3); + + // [balanceMovrTokenMiddle] = await getBalance(api, [randomAccountMoonriver.address]); + balanceMovrTokenMiddle = await helper.balance.getSubstrate(randomAccountMoonriver.address); + + const movrFees = balanceMovrTokenInit - balanceMovrTokenMiddle; + console.log('[Quartz -> Moonriver] transaction fees on Moonriver: %s MOVR',bigIntToDecimals(movrFees)); + expect(movrFees == 0n).to.be.true; + + // TODO + const qtzRandomAccountAsset = ( + await helper.getApi().query.assets.account(assetId, randomAccountMoonriver.address) + ).toJSON()! as any; + + balanceForeignQtzTokenMiddle = BigInt(qtzRandomAccountAsset['balance']); + const qtzIncomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenInit; + console.log('[Quartz -> Moonriver] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer)); + expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true; + }); + }); + + itSub('Should connect to Moonriver and send QTZ back', async ({helper}) => { + await usingPlaygrounds.atUrl(moonriverUrl, async (helper) => { + const asset = { + V1: { + id: { + Concrete: { + parents: 1, + interior: { + X1: {Parachain: QUARTZ_CHAIN}, + }, + }, + }, + fun: { + Fungible: TRANSFER_AMOUNT, + }, + }, }; - const dest = { + const destination = { V1: { parents: 1, interior: { X2: [ - {Parachain: MOONRIVER_CHAIN}, - {AccountKey20: {network: 'Any', key: randomAccountMoonriver.address}}, + {Parachain: QUARTZ_CHAIN}, + {AccountId32: {network: 'Any', id: randomAccountQuartz.addressRaw}}, ], }, }, }; - const amount = TRANSFER_AMOUNT; - const destWeight = 850000000; + const destWeight = 50000000; - const tx = api.tx.xTokens.transfer(currencyId, amount, dest, destWeight); - const events = await submitTransactionAsync(randomAccountQuartz, tx); + // TODO + const tx = helper.getApi().tx.xTokens.transferMultiasset(asset, destination, destWeight); + const events = await submitTransactionAsync(randomAccountMoonriver, tx); const result = getGenericResult(events); expect(result.success).to.be.true; - [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccountQuartz.address]); - expect(balanceQuartzTokenMiddle < balanceQuartzTokenInit).to.be.true; + // [balanceMovrTokenFinal] = await getBalance(api, [randomAccountMoonriver.address]); + balanceMovrTokenFinal = await helper.balance.getSubstrate(randomAccountMoonriver.address); - const transactionFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT; - console.log('[Quartz -> Moonriver] transaction fees on Quartz: %s QTZ', bigIntToDecimals(transactionFees)); - expect(transactionFees > 0).to.be.true; - }); + const movrFees = balanceMovrTokenMiddle - balanceMovrTokenFinal; + console.log('[Moonriver -> Quartz] transaction fees on Moonriver: %s MOVR', bigIntToDecimals(movrFees)); + expect(movrFees > 0).to.be.true; - await usingApi( - async (api) => { - await waitNewBlocks(api, 3); + const qtzRandomAccountAsset = ( + await helper.getApi().query.assets.account(assetId, randomAccountMoonriver.address) + ).toJSON()! as any; - [balanceMovrTokenMiddle] = await getBalance(api, [randomAccountMoonriver.address]); + expect(qtzRandomAccountAsset).to.be.null; - const movrFees = balanceMovrTokenInit - balanceMovrTokenMiddle; - console.log('[Quartz -> Moonriver] transaction fees on Moonriver: %s MOVR',bigIntToDecimals(movrFees)); - expect(movrFees == 0n).to.be.true; - - const qtzRandomAccountAsset = ( - await api.query.assets.account(assetId, randomAccountMoonriver.address) - ).toJSON()! as any; - - balanceForeignQtzTokenMiddle = BigInt(qtzRandomAccountAsset['balance']); - const qtzIncomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenInit; - console.log('[Quartz -> Moonriver] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer)); - expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true; - }, - moonriverOptions(), - ); - }); + balanceForeignQtzTokenFinal = 0n; - it('Should connect to Moonriver and send QTZ back', async () => { - await usingApi( - async (api) => { - const asset = { - V1: { - id: { - Concrete: { - parents: 1, - interior: { - X1: {Parachain: QUARTZ_CHAIN}, - }, - }, - }, - fun: { - Fungible: TRANSFER_AMOUNT, - }, - }, - }; - const destination = { - V1: { - parents: 1, - interior: { - X2: [ - {Parachain: QUARTZ_CHAIN}, - {AccountId32: {network: 'Any', id: randomAccountQuartz.addressRaw}}, - ], - }, - }, - }; - const destWeight = 50000000; - - const tx = api.tx.xTokens.transferMultiasset(asset, destination, destWeight); - const events = await submitTransactionAsync(randomAccountMoonriver, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - [balanceMovrTokenFinal] = await getBalance(api, [randomAccountMoonriver.address]); - - const movrFees = balanceMovrTokenMiddle - balanceMovrTokenFinal; - console.log('[Moonriver -> Quartz] transaction fees on Moonriver: %s MOVR', bigIntToDecimals(movrFees)); - expect(movrFees > 0).to.be.true; - - const qtzRandomAccountAsset = ( - await api.query.assets.account(assetId, randomAccountMoonriver.address) - ).toJSON()! as any; - - expect(qtzRandomAccountAsset).to.be.null; - - balanceForeignQtzTokenFinal = 0n; - - const qtzOutcomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenFinal; - console.log('[Quartz -> Moonriver] outcome %s QTZ', bigIntToDecimals(qtzOutcomeTransfer)); - expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; - }, - moonriverOptions(), - ); + const qtzOutcomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenFinal; + console.log('[Quartz -> Moonriver] outcome %s QTZ', bigIntToDecimals(qtzOutcomeTransfer)); + expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; + }); - await usingApi(async (api) => { - await waitNewBlocks(api, 3); + // await waitNewBlocks(api, 3); + await helper.wait.newBlocks(3); - [balanceQuartzTokenFinal] = await getBalance(api, [randomAccountQuartz.address]); - const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle; - expect(actuallyDelivered > 0).to.be.true; + // [balanceQuartzTokenFinal] = await getBalance(api, [randomAccountQuartz.address]); + balanceQuartzTokenFinal = await helper.balance.getSubstrate(randomAccountQuartz.address); + const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle; + expect(actuallyDelivered > 0).to.be.true; - console.log('[Moonriver -> Quartz] actually delivered %s QTZ', bigIntToDecimals(actuallyDelivered)); + console.log('[Moonriver -> Quartz] actually delivered %s QTZ', bigIntToDecimals(actuallyDelivered)); - const qtzFees = TRANSFER_AMOUNT - actuallyDelivered; - console.log('[Moonriver -> Quartz] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees)); - expect(qtzFees == 0n).to.be.true; - }); + const qtzFees = TRANSFER_AMOUNT - actuallyDelivered; + console.log('[Moonriver -> Quartz] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees)); + expect(qtzFees == 0n).to.be.true; }); }); diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index 3764c9d780..6a873843b0 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -14,22 +14,15 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; - -import {WsProvider, Keyring} from '@polkadot/api'; -import {ApiOptions} from '@polkadot/api/types'; +import {Keyring} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../deprecated-helpers/helpers'; +import {submitTransactionAsync} from '../substrate/substrate-api'; +import {getGenericResult, generateKeyringPair, waitEvent, bigIntToDecimals} from '../deprecated-helpers/helpers'; import {MultiLocation} from '@polkadot/types/interfaces'; import {blake2AsHex} from '@polkadot/util-crypto'; -import waitNewBlocks from '../substrate/wait-new-blocks'; import getBalance from '../substrate/get-balance'; import {XcmV2TraitsError, XcmV2TraitsOutcome} from '../interfaces'; - -chai.use(chaiAsPromised); -const expect = chai.expect; +import {itSub, expect, describeXcm, usingPlaygrounds} from '../util/playgrounds'; const UNIQUE_CHAIN = 2037; const ACALA_CHAIN = 2000; @@ -39,29 +32,15 @@ const RELAY_PORT = 9844; const ACALA_PORT = 9946; const MOONBEAM_PORT = 9947; +const relayUrl = 'ws://127.0.0.1:' + RELAY_PORT; +const acalaUrl = 'ws://127.0.0.1:' + ACALA_PORT; +const moonbeamUrl = 'ws://127.0.0.1:' + MOONBEAM_PORT; + const ACALA_DECIMALS = 12; const TRANSFER_AMOUNT = 2000000000000000000000000n; -function parachainApiOptions(port: number): ApiOptions { - return { - provider: new WsProvider('ws://127.0.0.1:' + port.toString()), - }; -} - -function acalaOptions(): ApiOptions { - return parachainApiOptions(ACALA_PORT); -} - -function moonbeamOptions(): ApiOptions { - return parachainApiOptions(MOONBEAM_PORT); -} - -function relayOptions(): ApiOptions { - return parachainApiOptions(RELAY_PORT); -} - -describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { +describeXcm('[XCM] Integration test: Exchanging tokens with Acala', () => { let alice: IKeyringPair; let randomAccount: IKeyringPair; @@ -76,233 +55,235 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { let balanceUniqueForeignTokenFinal: bigint; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { + await usingPlaygrounds(async (_helper, privateKey) => { const keyringSr25519 = new Keyring({type: 'sr25519'}); - alice = privateKeyWrapper('//Alice'); + alice = privateKey('//Alice'); randomAccount = generateKeyringPair(keyringSr25519); }); // Acala side - await usingApi( - async (api) => { - const destination = { - V0: { - X2: [ - 'Parent', - { - Parachain: UNIQUE_CHAIN, - }, - ], - }, - }; - - const metadata = { - name: 'UNQ', - symbol: 'UNQ', - decimals: 18, - minimalBalance: 1, - }; - - const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata); - const sudoTx = api.tx.sudo.sudo(tx as any); - const events = await submitTransactionAsync(alice, sudoTx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); - const events1 = await submitTransactionAsync(alice, tx1); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; - - [balanceAcalaTokenInit] = await getBalance(api, [randomAccount.address]); - { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceUniqueForeignTokenInit = BigInt(free); - } - }, - acalaOptions(), - ); - - // Unique side - await usingApi(async (api) => { - const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); - const events0 = await submitTransactionAsync(alice, tx0); - const result0 = getGenericResult(events0); - expect(result0.success).to.be.true; - - [balanceUniqueTokenInit] = await getBalance(api, [randomAccount.address]); - }); - }); - - it('Should connect and send UNQ to Acala', async () => { - - // Unique side - await usingApi(async (api) => { - + await usingPlaygrounds.atUrl(acalaUrl, async (helper) => { const destination = { V0: { X2: [ 'Parent', { - Parachain: ACALA_CHAIN, + Parachain: UNIQUE_CHAIN, }, ], }, }; - const beneficiary = { - V0: { - X1: { - AccountId32: { - network: 'Any', - id: randomAccount.addressRaw, - }, - }, - }, + const metadata = { + name: 'UNQ', + symbol: 'UNQ', + decimals: 18, + minimalBalance: 1, }; - const assets = { - V1: [ + // TODO + const tx = helper.getApi().tx.assetRegistry.registerForeignAsset(destination, metadata); + const sudoTx = helper.getApi().tx.sudo.sudo(tx as any); + const events = await submitTransactionAsync(alice, sudoTx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + // const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); + // const events1 = await submitTransactionAsync(alice, tx1); + // const result1 = getGenericResult(events1); + // expect(result1.success).to.be.true; + await helper.balance.transferToSubstrate(alice, randomAccount.address, 10000000000000n); + + // [balanceAcalaTokenInit] = await getBalance(api, [randomAccount.address]); + balanceAcalaTokenInit = await helper.balance.getSubstrate(randomAccount.address); + { + // TODO + const {free} = (await helper.getApi().query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceUniqueForeignTokenInit = BigInt(free); + } + }); + + // Unique side + await usingPlaygrounds(async (helper) => { + // const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); + // const events0 = await submitTransactionAsync(alice, tx0); + // const result0 = getGenericResult(events0); + // expect(result0.success).to.be.true; + await helper.balance.transferToSubstrate(alice, randomAccount.address, 10n * TRANSFER_AMOUNT); + + // [balanceUniqueTokenInit] = await getBalance(api, [randomAccount.address]); + balanceUniqueTokenInit = await helper.balance.getSubstrate(randomAccount.address); + }); + }); + + itSub('Should connect and send UNQ to Acala', async ({helper}) => { + + // Unique side + const destination = { + V0: { + X2: [ + 'Parent', { - id: { - Concrete: { - parents: 0, - interior: 'Here', - }, - }, - fun: { - Fungible: TRANSFER_AMOUNT, - }, + Parachain: ACALA_CHAIN, }, ], - }; + }, + }; + + const beneficiary = { + V0: { + X1: { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, + }, + }, + }, + }; - const feeAssetItem = 0; + const assets = { + V1: [ + { + id: { + Concrete: { + parents: 0, + interior: 'Here', + }, + }, + fun: { + Fungible: TRANSFER_AMOUNT, + }, + }, + ], + }; - const weightLimit = { - Limited: 5000000000, - }; + const feeAssetItem = 0; - const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); - const events = await submitTransactionAsync(randomAccount, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + const weightLimit = { + Limited: 5000000000, + }; - [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccount.address]); + // TODO + const tx = helper.getApi().tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); + const events = await submitTransactionAsync(randomAccount, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; - const unqFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT; - console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees)); - expect(unqFees > 0n).to.be.true; - }); + // [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccount.address]); + balanceUniqueTokenMiddle = await helper.balance.getSubstrate(randomAccount.address); + + const unqFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT; + console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees)); + expect(unqFees > 0n).to.be.true; // Acala side - await usingApi( - async (api) => { - await waitNewBlocks(api, 3); - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceUniqueForeignTokenMiddle = BigInt(free); - - [balanceAcalaTokenMiddle] = await getBalance(api, [randomAccount.address]); - - const acaFees = balanceAcalaTokenInit - balanceAcalaTokenMiddle; - const unqIncomeTransfer = balanceUniqueForeignTokenMiddle - balanceUniqueForeignTokenInit; - - console.log( - '[Unique -> Acala] transaction fees on Acala: %s ACA', - bigIntToDecimals(acaFees, ACALA_DECIMALS), - ); - console.log('[Unique -> Acala] income %s UNQ', bigIntToDecimals(unqIncomeTransfer)); - expect(acaFees == 0n).to.be.true; - expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true; - }, - acalaOptions(), - ); + await usingPlaygrounds.atUrl(acalaUrl, async (helper) => { + // await waitNewBlocks(api, 3); + await helper.wait.newBlocks(3); + + // TODO + const {free} = (await helper.getApi().query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; + balanceUniqueForeignTokenMiddle = BigInt(free); + + // [balanceAcalaTokenMiddle] = await getBalance(api, [randomAccount.address]); + balanceAcalaTokenMiddle = await helper.balance.getSubstrate(randomAccount.address); + + const acaFees = balanceAcalaTokenInit - balanceAcalaTokenMiddle; + const unqIncomeTransfer = balanceUniqueForeignTokenMiddle - balanceUniqueForeignTokenInit; + + console.log( + '[Unique -> Acala] transaction fees on Acala: %s ACA', + bigIntToDecimals(acaFees, ACALA_DECIMALS), + ); + console.log('[Unique -> Acala] income %s UNQ', bigIntToDecimals(unqIncomeTransfer)); + expect(acaFees == 0n).to.be.true; + expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true; + }); }); - it('Should connect to Acala and send UNQ back', async () => { + itSub('Should connect to Acala and send UNQ back', async ({helper}) => { // Acala side - await usingApi( - async (api) => { - const destination = { - V1: { - parents: 1, - interior: { - X2: [ - {Parachain: UNIQUE_CHAIN}, - { - AccountId32: { - network: 'Any', - id: randomAccount.addressRaw, - }, + await usingPlaygrounds.atUrl(acalaUrl, async (helper) => { + const destination = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: UNIQUE_CHAIN}, + { + AccountId32: { + network: 'Any', + id: randomAccount.addressRaw, }, - ], - }, + }, + ], }, - }; + }, + }; - const id = { - ForeignAsset: 0, - }; + const id = { + ForeignAsset: 0, + }; - const destWeight = 50000000; + const destWeight = 50000000; - const tx = api.tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight); - const events = await submitTransactionAsync(randomAccount, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + // TODO + const tx = helper.getApi().tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight); + const events = await submitTransactionAsync(randomAccount, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; - [balanceAcalaTokenFinal] = await getBalance(api, [randomAccount.address]); - { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, id)).toJSON() as any; - balanceUniqueForeignTokenFinal = BigInt(free); - } + // [balanceAcalaTokenFinal] = await getBalance(api, [randomAccount.address]); + balanceAcalaTokenFinal = await helper.balance.getSubstrate(randomAccount.address); + { + // TODO + const {free} = (await helper.getApi().query.tokens.accounts(randomAccount.addressRaw, id)).toJSON() as any; + balanceUniqueForeignTokenFinal = BigInt(free); + } - const acaFees = balanceAcalaTokenMiddle - balanceAcalaTokenFinal; - const unqOutcomeTransfer = balanceUniqueForeignTokenMiddle - balanceUniqueForeignTokenFinal; + const acaFees = balanceAcalaTokenMiddle - balanceAcalaTokenFinal; + const unqOutcomeTransfer = balanceUniqueForeignTokenMiddle - balanceUniqueForeignTokenFinal; - console.log( - '[Acala -> Unique] transaction fees on Acala: %s ACA', - bigIntToDecimals(acaFees, ACALA_DECIMALS), - ); - console.log('[Acala -> Unique] outcome %s UNQ', bigIntToDecimals(unqOutcomeTransfer)); + console.log( + '[Acala -> Unique] transaction fees on Acala: %s ACA', + bigIntToDecimals(acaFees, ACALA_DECIMALS), + ); + console.log('[Acala -> Unique] outcome %s UNQ', bigIntToDecimals(unqOutcomeTransfer)); - expect(acaFees > 0).to.be.true; - expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; - }, - acalaOptions(), - ); + expect(acaFees > 0).to.be.true; + expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; + }); - // Unique side - await usingApi(async (api) => { - await waitNewBlocks(api, 3); + // await waitNewBlocks(api, 3); + await helper.wait.newBlocks(3); - [balanceUniqueTokenFinal] = await getBalance(api, [randomAccount.address]); - const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle; - expect(actuallyDelivered > 0).to.be.true; + // [balanceUniqueTokenFinal] = await getBalance(api, [randomAccount.address]); + balanceUniqueTokenFinal = await helper.balance.getSubstrate(randomAccount.address); + const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle; + expect(actuallyDelivered > 0).to.be.true; - console.log('[Acala -> Unique] actually delivered %s UNQ', bigIntToDecimals(actuallyDelivered)); + console.log('[Acala -> Unique] actually delivered %s UNQ', bigIntToDecimals(actuallyDelivered)); - const unqFees = TRANSFER_AMOUNT - actuallyDelivered; - console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees)); - expect(unqFees == 0n).to.be.true; - }); + const unqFees = TRANSFER_AMOUNT - actuallyDelivered; + console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees)); + expect(unqFees == 0n).to.be.true; }); }); // These tests are relevant only when the foreign asset pallet is disabled -describe_xcm('[XCM] Integration test: Unique rejects non-native tokens', () => { +describeXcm('[XCM] Integration test: Unique rejects non-native tokens', () => { let alice: IKeyringPair; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); + await usingPlaygrounds(async (_helper, privateKey) => { + alice = privateKey('//Alice'); }); }); - it('Unique rejects tokens from the Relay', async () => { - await usingApi(async (api) => { + itSub('Unique rejects tokens from the Relay', async ({helper}) => { + await usingPlaygrounds.atUrl(relayUrl, async (helper) => { const destination = { V1: { parents: 0, @@ -346,44 +327,45 @@ describe_xcm('[XCM] Integration test: Unique rejects non-native tokens', () => { Limited: 5_000_000_000, }; - const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); + // TODO + const tx = helper.getApi().tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); const events = await submitTransactionAsync(alice, tx); const result = getGenericResult(events); expect(result.success).to.be.true; - }, relayOptions()); - - await usingApi(async api => { - const maxWaitBlocks = 3; - const dmpQueueExecutedDownward = await waitEvent( - api, - maxWaitBlocks, - 'dmpQueue', - 'ExecutedDownward', - ); + }); - expect( - dmpQueueExecutedDownward != null, - '[Relay] dmpQueue.ExecutedDownward event is expected', - ).to.be.true; + const maxWaitBlocks = 3; - const event = dmpQueueExecutedDownward!.event; - const outcome = event.data[1] as XcmV2TraitsOutcome; + // TODO + const dmpQueueExecutedDownward = await waitEvent( + helper.getApi(), + maxWaitBlocks, + 'dmpQueue', + 'ExecutedDownward', + ); - expect( - outcome.isIncomplete, - '[Relay] The outcome of the XCM should be `Incomplete`', - ).to.be.true; + expect( + dmpQueueExecutedDownward != null, + '[Relay] dmpQueue.ExecutedDownward event is expected', + ).to.be.true; - const incomplete = outcome.asIncomplete; - expect( - incomplete[1].toString() == 'AssetNotFound', - '[Relay] The XCM error should be `AssetNotFound`', - ).to.be.true; - }); + const event = dmpQueueExecutedDownward!.event; + const outcome = event.data[1] as XcmV2TraitsOutcome; + + expect( + outcome.isIncomplete, + '[Relay] The outcome of the XCM should be `Incomplete`', + ).to.be.true; + + const incomplete = outcome.asIncomplete; + expect( + incomplete[1].toString() == 'AssetNotFound', + '[Relay] The XCM error should be `AssetNotFound`', + ).to.be.true; }); - it('Unique rejects ACA tokens from Acala', async () => { - await usingApi(async (api) => { + itSub('Unique rejects ACA tokens from Acala', async ({helper}) => { + await usingPlaygrounds.atUrl(acalaUrl, async (helper) => { const destination = { V1: { parents: 1, @@ -407,33 +389,34 @@ describe_xcm('[XCM] Integration test: Unique rejects non-native tokens', () => { const destWeight = 50000000; - const tx = api.tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight); + // TODO + const tx = helper.getApi().tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight); const events = await submitTransactionAsync(alice, tx); const result = getGenericResult(events); expect(result.success).to.be.true; - }, acalaOptions()); + }); - await usingApi(async api => { - const maxWaitBlocks = 3; - const xcmpQueueFailEvent = await waitEvent(api, maxWaitBlocks, 'xcmpQueue', 'Fail'); + const maxWaitBlocks = 3; - expect( - xcmpQueueFailEvent != null, - '[Acala] xcmpQueue.FailEvent event is expected', - ).to.be.true; + // TODO + const xcmpQueueFailEvent = await waitEvent(helper.getApi(), maxWaitBlocks, 'xcmpQueue', 'Fail'); - const event = xcmpQueueFailEvent!.event; - const outcome = event.data[1] as XcmV2TraitsError; + expect( + xcmpQueueFailEvent != null, + '[Acala] xcmpQueue.FailEvent event is expected', + ).to.be.true; - expect( - outcome.isUntrustedReserveLocation, - '[Acala] The XCM error should be `UntrustedReserveLocation`', - ).to.be.true; - }); + const event = xcmpQueueFailEvent!.event; + const outcome = event.data[1] as XcmV2TraitsError; + + expect( + outcome.isUntrustedReserveLocation, + '[Acala] The XCM error should be `UntrustedReserveLocation`', + ).to.be.true; }); }); -describe_xcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { +describeXcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { // Unique constants let uniqueAlice: IKeyringPair; @@ -478,322 +461,327 @@ describe_xcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { let balanceGlmrTokenFinal: bigint; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { + await usingPlaygrounds(async (_helper, privateKey) => { const keyringEth = new Keyring({type: 'ethereum'}); const keyringSr25519 = new Keyring({type: 'sr25519'}); - uniqueAlice = privateKeyWrapper('//Alice'); + uniqueAlice = privateKey('//Alice'); randomAccountUnique = generateKeyringPair(keyringSr25519); randomAccountMoonbeam = generateKeyringPair(keyringEth); balanceForeignUnqTokenInit = 0n; }); - await usingApi( - async (api) => { + await usingPlaygrounds.atUrl(moonbeamUrl, async (helper) => { + // TODO - // >>> Sponsoring Dorothy >>> - console.log('Sponsoring Dorothy.......'); - const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n); - const events0 = await submitTransactionAsync(alithAccount, tx0); - const result0 = getGenericResult(events0); - expect(result0.success).to.be.true; - console.log('Sponsoring Dorothy.......DONE'); - // <<< Sponsoring Dorothy <<< + const api = helper.getApi(); - const sourceLocation: MultiLocation = api.createType( - 'MultiLocation', - { - parents: 1, - interior: {X1: {Parachain: UNIQUE_CHAIN}}, - }, - ); - - uniqueAssetLocation = {XCM: sourceLocation}; - const existentialDeposit = 1; - const isSufficient = true; - const unitsPerSecond = '1'; - const numAssetsWeightHint = 0; - - const registerTx = api.tx.assetManager.registerForeignAsset( - uniqueAssetLocation, - uniqueAssetMetadata, - existentialDeposit, - isSufficient, - ); - console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || ''); - - const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond( - uniqueAssetLocation, - unitsPerSecond, - numAssetsWeightHint, - ); - console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || ''); - - const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]); - console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || ''); - - // >>> Note motion preimage >>> - console.log('Note motion preimage.......'); - const encodedProposal = batchCall?.method.toHex() || ''; - const proposalHash = blake2AsHex(encodedProposal); - console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal); - console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); - console.log('Encoded length %d', encodedProposal.length); - - const tx1 = api.tx.democracy.notePreimage(encodedProposal); - const events1 = await submitTransactionAsync(baltatharAccount, tx1); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; - console.log('Note motion preimage.......DONE'); - // <<< Note motion preimage <<< - - // >>> Propose external motion through council >>> - console.log('Propose external motion through council.......'); - const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash); - const tx2 = api.tx.councilCollective.propose( - councilVotingThreshold, - externalMotion, - externalMotion.encodedLength, - ); - const events2 = await submitTransactionAsync(baltatharAccount, tx2); - const result2 = getGenericResult(events2); - expect(result2.success).to.be.true; - - const encodedMotion = externalMotion?.method.toHex() || ''; - const motionHash = blake2AsHex(encodedMotion); - console.log('Motion hash is %s', motionHash); - - const tx3 = api.tx.councilCollective.vote(motionHash, 0, true); - { - const events3 = await submitTransactionAsync(dorothyAccount, tx3); - const result3 = getGenericResult(events3); - expect(result3.success).to.be.true; - } - { - const events3 = await submitTransactionAsync(baltatharAccount, tx3); - const result3 = getGenericResult(events3); - expect(result3.success).to.be.true; - } - - const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength); - const events4 = await submitTransactionAsync(dorothyAccount, tx4); - const result4 = getGenericResult(events4); - expect(result4.success).to.be.true; - console.log('Propose external motion through council.......DONE'); - // <<< Propose external motion through council <<< - - // >>> Fast track proposal through technical committee >>> - console.log('Fast track proposal through technical committee.......'); - const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); - const tx5 = api.tx.techCommitteeCollective.propose( - technicalCommitteeThreshold, - fastTrack, - fastTrack.encodedLength, - ); - const events5 = await submitTransactionAsync(alithAccount, tx5); - const result5 = getGenericResult(events5); - expect(result5.success).to.be.true; - - const encodedFastTrack = fastTrack?.method.toHex() || ''; - const fastTrackHash = blake2AsHex(encodedFastTrack); - console.log('FastTrack hash is %s', fastTrackHash); - - const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1; - const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true); - { - const events6 = await submitTransactionAsync(baltatharAccount, tx6); - const result6 = getGenericResult(events6); - expect(result6.success).to.be.true; - } + // >>> Sponsoring Dorothy >>> + console.log('Sponsoring Dorothy.......'); + // const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n); + // const events0 = await submitTransactionAsync(alithAccount, tx0); + // const result0 = getGenericResult(events0); + // expect(result0.success).to.be.true; + await helper.balance.transferToSubstrate(alithAccount, dorothyAccount.address, 11_000_000_000_000_000_000n); + console.log('Sponsoring Dorothy.......DONE'); + // <<< Sponsoring Dorothy <<< + + const sourceLocation: MultiLocation = api.createType( + 'MultiLocation', { - const events6 = await submitTransactionAsync(alithAccount, tx6); - const result6 = getGenericResult(events6); - expect(result6.success).to.be.true; - } - - const tx7 = api.tx.techCommitteeCollective - .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength); - const events7 = await submitTransactionAsync(baltatharAccount, tx7); - const result7 = getGenericResult(events7); - expect(result7.success).to.be.true; - console.log('Fast track proposal through technical committee.......DONE'); - // <<< Fast track proposal through technical committee <<< - - // >>> Referendum voting >>> - console.log('Referendum voting.......'); - const tx8 = api.tx.democracy.vote( - 0, - {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}}, - ); - const events8 = await submitTransactionAsync(dorothyAccount, tx8); - const result8 = getGenericResult(events8); - expect(result8.success).to.be.true; - console.log('Referendum voting.......DONE'); - // <<< Referendum voting <<< - - // >>> Acquire Unique AssetId Info on Moonbeam >>> - console.log('Acquire Unique AssetId Info on Moonbeam.......'); - - // Wait for the democracy execute - await waitNewBlocks(api, 5); - - assetId = (await api.query.assetManager.assetTypeId({ - XCM: sourceLocation, - })).toString(); - - console.log('UNQ asset ID is %s', assetId); - console.log('Acquire Unique AssetId Info on Moonbeam.......DONE'); - // >>> Acquire Unique AssetId Info on Moonbeam >>> - - // >>> Sponsoring random Account >>> - console.log('Sponsoring random Account.......'); - const tx10 = api.tx.balances.transfer(randomAccountMoonbeam.address, 11_000_000_000_000_000_000n); - const events10 = await submitTransactionAsync(baltatharAccount, tx10); - const result10 = getGenericResult(events10); - expect(result10.success).to.be.true; - console.log('Sponsoring random Account.......DONE'); - // <<< Sponsoring random Account <<< - - [balanceGlmrTokenInit] = await getBalance(api, [randomAccountMoonbeam.address]); - }, - moonbeamOptions(), - ); + parents: 1, + interior: {X1: {Parachain: UNIQUE_CHAIN}}, + }, + ); + + uniqueAssetLocation = {XCM: sourceLocation}; + const existentialDeposit = 1; + const isSufficient = true; + const unitsPerSecond = '1'; + const numAssetsWeightHint = 0; + + const registerTx = api.tx.assetManager.registerForeignAsset( + uniqueAssetLocation, + uniqueAssetMetadata, + existentialDeposit, + isSufficient, + ); + console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || ''); + + const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond( + uniqueAssetLocation, + unitsPerSecond, + numAssetsWeightHint, + ); + console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || ''); + + const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]); + console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || ''); + + // >>> Note motion preimage >>> + console.log('Note motion preimage.......'); + const encodedProposal = batchCall?.method.toHex() || ''; + const proposalHash = blake2AsHex(encodedProposal); + console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal); + console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); + console.log('Encoded length %d', encodedProposal.length); + + const tx1 = api.tx.democracy.notePreimage(encodedProposal); + const events1 = await submitTransactionAsync(baltatharAccount, tx1); + const result1 = getGenericResult(events1); + expect(result1.success).to.be.true; + console.log('Note motion preimage.......DONE'); + // <<< Note motion preimage <<< + + // >>> Propose external motion through council >>> + console.log('Propose external motion through council.......'); + const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash); + const tx2 = api.tx.councilCollective.propose( + councilVotingThreshold, + externalMotion, + externalMotion.encodedLength, + ); + const events2 = await submitTransactionAsync(baltatharAccount, tx2); + const result2 = getGenericResult(events2); + expect(result2.success).to.be.true; + + const encodedMotion = externalMotion?.method.toHex() || ''; + const motionHash = blake2AsHex(encodedMotion); + console.log('Motion hash is %s', motionHash); + + const tx3 = api.tx.councilCollective.vote(motionHash, 0, true); + { + const events3 = await submitTransactionAsync(dorothyAccount, tx3); + const result3 = getGenericResult(events3); + expect(result3.success).to.be.true; + } + { + const events3 = await submitTransactionAsync(baltatharAccount, tx3); + const result3 = getGenericResult(events3); + expect(result3.success).to.be.true; + } + + const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength); + const events4 = await submitTransactionAsync(dorothyAccount, tx4); + const result4 = getGenericResult(events4); + expect(result4.success).to.be.true; + console.log('Propose external motion through council.......DONE'); + // <<< Propose external motion through council <<< + + // >>> Fast track proposal through technical committee >>> + console.log('Fast track proposal through technical committee.......'); + const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); + const tx5 = api.tx.techCommitteeCollective.propose( + technicalCommitteeThreshold, + fastTrack, + fastTrack.encodedLength, + ); + const events5 = await submitTransactionAsync(alithAccount, tx5); + const result5 = getGenericResult(events5); + expect(result5.success).to.be.true; + + const encodedFastTrack = fastTrack?.method.toHex() || ''; + const fastTrackHash = blake2AsHex(encodedFastTrack); + console.log('FastTrack hash is %s', fastTrackHash); + + const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1; + const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true); + { + const events6 = await submitTransactionAsync(baltatharAccount, tx6); + const result6 = getGenericResult(events6); + expect(result6.success).to.be.true; + } + { + const events6 = await submitTransactionAsync(alithAccount, tx6); + const result6 = getGenericResult(events6); + expect(result6.success).to.be.true; + } + + const tx7 = api.tx.techCommitteeCollective + .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength); + const events7 = await submitTransactionAsync(baltatharAccount, tx7); + const result7 = getGenericResult(events7); + expect(result7.success).to.be.true; + console.log('Fast track proposal through technical committee.......DONE'); + // <<< Fast track proposal through technical committee <<< + + // >>> Referendum voting >>> + console.log('Referendum voting.......'); + const tx8 = api.tx.democracy.vote( + 0, + {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}}, + ); + const events8 = await submitTransactionAsync(dorothyAccount, tx8); + const result8 = getGenericResult(events8); + expect(result8.success).to.be.true; + console.log('Referendum voting.......DONE'); + // <<< Referendum voting <<< + + // >>> Acquire Unique AssetId Info on Moonbeam >>> + console.log('Acquire Unique AssetId Info on Moonbeam.......'); + + // Wait for the democracy execute + // await waitNewBlocks(api, 5); + await helper.wait.newBlocks(5); + + assetId = (await api.query.assetManager.assetTypeId({ + XCM: sourceLocation, + })).toString(); + + console.log('UNQ asset ID is %s', assetId); + console.log('Acquire Unique AssetId Info on Moonbeam.......DONE'); + // >>> Acquire Unique AssetId Info on Moonbeam >>> + + // >>> Sponsoring random Account >>> + console.log('Sponsoring random Account.......'); + // const tx10 = api.tx.balances.transfer(randomAccountMoonbeam.address, 11_000_000_000_000_000_000n); + // const events10 = await submitTransactionAsync(baltatharAccount, tx10); + // const result10 = getGenericResult(events10); + // expect(result10.success).to.be.true; + await helper.balance.transferToSubstrate(baltatharAccount, randomAccountMoonbeam.address, 11_000_000_000_000_000_000n); + console.log('Sponsoring random Account.......DONE'); + // <<< Sponsoring random Account <<< + + [balanceGlmrTokenInit] = await getBalance(api, [randomAccountMoonbeam.address]); + }); - await usingApi(async (api) => { - const tx0 = api.tx.balances.transfer(randomAccountUnique.address, 10n * TRANSFER_AMOUNT); - const events0 = await submitTransactionAsync(uniqueAlice, tx0); - const result0 = getGenericResult(events0); - expect(result0.success).to.be.true; + await usingPlaygrounds(async (helper) => { + // const tx0 = api.tx.balances.transfer(randomAccountUnique.address, 10n * TRANSFER_AMOUNT); + // const events0 = await submitTransactionAsync(uniqueAlice, tx0); + // const result0 = getGenericResult(events0); + // expect(result0.success).to.be.true; + await helper.balance.transferToSubstrate(uniqueAlice, randomAccountUnique.address, 10n * TRANSFER_AMOUNT); - [balanceUniqueTokenInit] = await getBalance(api, [randomAccountUnique.address]); + // [balanceUniqueTokenInit] = await getBalance(api, [randomAccountUnique.address]); + balanceUniqueTokenInit = await helper.balance.getSubstrate(randomAccountUnique.address); }); }); - it('Should connect and send UNQ to Moonbeam', async () => { - await usingApi(async (api) => { - const currencyId = { - NativeAssetId: 'Here', + itSub('Should connect and send UNQ to Moonbeam', async ({helper}) => { + const currencyId = { + NativeAssetId: 'Here', + }; + const dest = { + V1: { + parents: 1, + interior: { + X2: [ + {Parachain: MOONBEAM_CHAIN}, + {AccountKey20: {network: 'Any', key: randomAccountMoonbeam.address}}, + ], + }, + }, + }; + const amount = TRANSFER_AMOUNT; + const destWeight = 850000000; + + // TODO + const tx = helper.getApi().tx.xTokens.transfer(currencyId, amount, dest, destWeight); + const events = await submitTransactionAsync(randomAccountUnique, tx); + const result = getGenericResult(events); + expect(result.success).to.be.true; + + // [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccountUnique.address]); + balanceUniqueTokenMiddle = await helper.balance.getSubstrate(randomAccountUnique.address); + expect(balanceUniqueTokenMiddle < balanceUniqueTokenInit).to.be.true; + + const transactionFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT; + console.log('[Unique -> Moonbeam] transaction fees on Unique: %s UNQ', bigIntToDecimals(transactionFees)); + expect(transactionFees > 0).to.be.true; + + await usingPlaygrounds.atUrl(moonbeamUrl, async (helper) => { + // await waitNewBlocks(api, 3); + await helper.wait.newBlocks(3); + + // [balanceGlmrTokenMiddle] = await getBalance(api, [randomAccountMoonbeam.address]); + balanceGlmrTokenMiddle = await helper.balance.getSubstrate(randomAccountMoonbeam.address); + + const glmrFees = balanceGlmrTokenInit - balanceGlmrTokenMiddle; + console.log('[Unique -> Moonbeam] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees)); + expect(glmrFees == 0n).to.be.true; + + // TODO + const unqRandomAccountAsset = ( + await helper.getApi().query.assets.account(assetId, randomAccountMoonbeam.address) + ).toJSON()! as any; + + balanceForeignUnqTokenMiddle = BigInt(unqRandomAccountAsset['balance']); + const unqIncomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenInit; + console.log('[Unique -> Moonbeam] income %s UNQ', bigIntToDecimals(unqIncomeTransfer)); + expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true; + }); + }); + + itSub('Should connect to Moonbeam and send UNQ back', async ({helper}) => { + await usingPlaygrounds.atUrl(moonbeamUrl, async (helper) => { + const asset = { + V1: { + id: { + Concrete: { + parents: 1, + interior: { + X1: {Parachain: UNIQUE_CHAIN}, + }, + }, + }, + fun: { + Fungible: TRANSFER_AMOUNT, + }, + }, }; - const dest = { + const destination = { V1: { parents: 1, interior: { X2: [ - {Parachain: MOONBEAM_CHAIN}, - {AccountKey20: {network: 'Any', key: randomAccountMoonbeam.address}}, + {Parachain: UNIQUE_CHAIN}, + {AccountId32: {network: 'Any', id: randomAccountUnique.addressRaw}}, ], }, }, }; - const amount = TRANSFER_AMOUNT; - const destWeight = 850000000; + const destWeight = 50000000; - const tx = api.tx.xTokens.transfer(currencyId, amount, dest, destWeight); - const events = await submitTransactionAsync(randomAccountUnique, tx); + // TODO + const tx = helper.getApi().tx.xTokens.transferMultiasset(asset, destination, destWeight); + const events = await submitTransactionAsync(randomAccountMoonbeam, tx); const result = getGenericResult(events); expect(result.success).to.be.true; - [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccountUnique.address]); - expect(balanceUniqueTokenMiddle < balanceUniqueTokenInit).to.be.true; - - const transactionFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT; - console.log('[Unique -> Moonbeam] transaction fees on Unique: %s UNQ', bigIntToDecimals(transactionFees)); - expect(transactionFees > 0).to.be.true; - }); - - await usingApi( - async (api) => { - await waitNewBlocks(api, 3); - - [balanceGlmrTokenMiddle] = await getBalance(api, [randomAccountMoonbeam.address]); - - const glmrFees = balanceGlmrTokenInit - balanceGlmrTokenMiddle; - console.log('[Unique -> Moonbeam] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees)); - expect(glmrFees == 0n).to.be.true; + // [balanceGlmrTokenFinal] = await getBalance(api, [randomAccountMoonbeam.address]); + balanceGlmrTokenFinal = await helper.balance.getSubstrate(randomAccountMoonbeam.address); - const unqRandomAccountAsset = ( - await api.query.assets.account(assetId, randomAccountMoonbeam.address) - ).toJSON()! as any; + const glmrFees = balanceGlmrTokenMiddle - balanceGlmrTokenFinal; + console.log('[Moonbeam -> Unique] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees)); + expect(glmrFees > 0).to.be.true; - balanceForeignUnqTokenMiddle = BigInt(unqRandomAccountAsset['balance']); - const unqIncomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenInit; - console.log('[Unique -> Moonbeam] income %s UNQ', bigIntToDecimals(unqIncomeTransfer)); - expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true; - }, - moonbeamOptions(), - ); - }); - - it('Should connect to Moonbeam and send UNQ back', async () => { - await usingApi( - async (api) => { - const asset = { - V1: { - id: { - Concrete: { - parents: 1, - interior: { - X1: {Parachain: UNIQUE_CHAIN}, - }, - }, - }, - fun: { - Fungible: TRANSFER_AMOUNT, - }, - }, - }; - const destination = { - V1: { - parents: 1, - interior: { - X2: [ - {Parachain: UNIQUE_CHAIN}, - {AccountId32: {network: 'Any', id: randomAccountUnique.addressRaw}}, - ], - }, - }, - }; - const destWeight = 50000000; - - const tx = api.tx.xTokens.transferMultiasset(asset, destination, destWeight); - const events = await submitTransactionAsync(randomAccountMoonbeam, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - [balanceGlmrTokenFinal] = await getBalance(api, [randomAccountMoonbeam.address]); - - const glmrFees = balanceGlmrTokenMiddle - balanceGlmrTokenFinal; - console.log('[Moonbeam -> Unique] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees)); - expect(glmrFees > 0).to.be.true; + // TODO + const unqRandomAccountAsset = ( + await helper.getApi().query.assets.account(assetId, randomAccountMoonbeam.address) + ).toJSON()! as any; - const unqRandomAccountAsset = ( - await api.query.assets.account(assetId, randomAccountMoonbeam.address) - ).toJSON()! as any; + expect(unqRandomAccountAsset).to.be.null; - expect(unqRandomAccountAsset).to.be.null; + balanceForeignUnqTokenFinal = 0n; - balanceForeignUnqTokenFinal = 0n; - - const unqOutcomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenFinal; - console.log('[Unique -> Moonbeam] outcome %s UNQ', bigIntToDecimals(unqOutcomeTransfer)); - expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; - }, - moonbeamOptions(), - ); + const unqOutcomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenFinal; + console.log('[Unique -> Moonbeam] outcome %s UNQ', bigIntToDecimals(unqOutcomeTransfer)); + expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; + }); - await usingApi(async (api) => { - await waitNewBlocks(api, 3); + // await waitNewBlocks(api, 3); + await helper.wait.newBlocks(3); - [balanceUniqueTokenFinal] = await getBalance(api, [randomAccountUnique.address]); - const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle; - expect(actuallyDelivered > 0).to.be.true; + // [balanceUniqueTokenFinal] = await getBalance(api, [randomAccountUnique.address]); + balanceUniqueTokenFinal = await helper.balance.getSubstrate(randomAccountUnique.address); + const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle; + expect(actuallyDelivered > 0).to.be.true; - console.log('[Moonbeam -> Unique] actually delivered %s UNQ', bigIntToDecimals(actuallyDelivered)); + console.log('[Moonbeam -> Unique] actually delivered %s UNQ', bigIntToDecimals(actuallyDelivered)); - const unqFees = TRANSFER_AMOUNT - actuallyDelivered; - console.log('[Moonbeam -> Unique] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees)); - expect(unqFees == 0n).to.be.true; - }); + const unqFees = TRANSFER_AMOUNT - actuallyDelivered; + console.log('[Moonbeam -> Unique] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees)); + expect(unqFees == 0n).to.be.true; }); }); From d85160e4c954cfbaccf96a004a026664372fa9df Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 7 Oct 2022 15:33:46 +0700 Subject: [PATCH 1073/1274] add xcm launch-configs for rococo --- .../launch-config-xcm-opal-rococo.json | 134 ++++++++++++ .../launch-config-xcm-quartz-rococo.json | 199 ++++++++++++++++++ .../launch-config-xcm-unique-rococo.json | 18 +- 3 files changed, 342 insertions(+), 9 deletions(-) create mode 100644 .docker/xcm-config/launch-config-xcm-opal-rococo.json create mode 100644 .docker/xcm-config/launch-config-xcm-quartz-rococo.json diff --git a/.docker/xcm-config/launch-config-xcm-opal-rococo.json b/.docker/xcm-config/launch-config-xcm-opal-rococo.json new file mode 100644 index 0000000000..18b7e00f39 --- /dev/null +++ b/.docker/xcm-config/launch-config-xcm-opal-rococo.json @@ -0,0 +1,134 @@ +{ + "relaychain": { + "bin": "/polkadot/target/release/polkadot", + "chain": "rococo-local", + "chainInitializer": [ + "chainql", + "--tla-code=spec=import '${spec}'", + "5validators.jsonnet" + ], + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + } + + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "/unique-chain/target/release/unique-collator", + "id": "2095", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + }, + { + "bin": "/cumulus/target/release/cumulus", + "id": "1000", + "chain": "westmint-local", + "balance": "1000000000000000000000000", + "nodes": [ + { + "wsPort": 9948, + "port": 31204, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [ + { + "sender": 2095, + "recipient": 1000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 1000, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + } + ], + "finalization": false +} + diff --git a/.docker/xcm-config/launch-config-xcm-quartz-rococo.json b/.docker/xcm-config/launch-config-xcm-quartz-rococo.json new file mode 100644 index 0000000000..52c55770fd --- /dev/null +++ b/.docker/xcm-config/launch-config-xcm-quartz-rococo.json @@ -0,0 +1,199 @@ +{ + "relaychain": { + "bin": "/polkadot/target/release/polkadot", + "chain": "rococo-local", + "chainInitializer": [ + "chainql", + "--tla-code=spec=import '${spec}'", + "5validators.jsonnet" + ], + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + } + + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "/unique-chain/target/release/unique-collator", + "id": "2095", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + }, + { + "bin": "/acala/target/release/acala", + "id": "2000", + "chain": "karura-dev", + "balance": "1000000000000000000000", + "nodes": [ + { + "wsPort": 9946, + "port": 31202, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + }, + { + "bin": "/moonbeam/target/release/moonbeam", + "id": 2023, + "balance": "1000000000000000000000", + "chain": "moonriver-local", + "chainInitializer": [ + "chainql", + "--tla-code=spec=import '${spec}'", + "minBondFix.jsonnet" + ], + "nodes": [ + { + "wsPort": 9947, + "port": 31203, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "--", + "--execution=wasm" + ] + } + ] + }, + { + "bin": "/cumulus/target/release/cumulus", + "id": "1000", + "chain": "statemine-local", + "balance": "1000000000000000000000000", + "nodes": [ + { + "wsPort": 9948, + "port": 31204, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [ + { + "sender": 2095, + "recipient": 2000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2000, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2095, + "recipient": 2023, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2023, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2095, + "recipient": 1000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 1000, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + } + ], + "finalization": false +} + diff --git a/.docker/xcm-config/launch-config-xcm-unique-rococo.json b/.docker/xcm-config/launch-config-xcm-unique-rococo.json index 505fa95c04..db5eb193c5 100644 --- a/.docker/xcm-config/launch-config-xcm-unique-rococo.json +++ b/.docker/xcm-config/launch-config-xcm-unique-rococo.json @@ -90,8 +90,8 @@ "rpcPort": 9933, "name": "alice", "flags": [ - "-lruntime=trace", - "-lxcm=trace", + "-lruntime=trace", + "-lxcm=trace", "--unsafe-rpc-external", "--unsafe-ws-external" ] @@ -114,8 +114,8 @@ "port": 31202, "name": "alice", "flags": [ - "-lruntime=trace", - "-lxcm=trace", + "-lruntime=trace", + "-lxcm=trace", "--unsafe-rpc-external", "--unsafe-ws-external" ] @@ -133,11 +133,11 @@ "port": 31203, "name": "alice", "flags": [ - "-lruntime=trace", - "-lxcm=trace", + "-lruntime=trace", + "-lxcm=trace", "--unsafe-rpc-external", "--unsafe-ws-external", - "--", + "--", "--execution=wasm" ] } @@ -154,8 +154,8 @@ "port": 31204, "name": "alice", "flags": [ - "-lruntime=trace", - "-lxcm=trace", + "-lruntime=trace", + "-lxcm=trace", "--unsafe-rpc-external", "--unsafe-ws-external" ] From cea54c5de896242a9359f1f7b429b950cfd0a8ca Mon Sep 17 00:00:00 2001 From: Andrey Date: Fri, 7 Oct 2022 10:58:53 +0000 Subject: [PATCH 1074/1274] Tests: move explicit solc calls to playgrounds --- tests/package.json | 3 +- tests/src/eth/contractSponsoring.test.ts | 82 +++++---------- tests/src/eth/evmCoder.test.ts | 90 +++++++++++++++++ tests/src/evmCoder.test.ts | 123 ----------------------- 4 files changed, 118 insertions(+), 180 deletions(-) create mode 100644 tests/src/eth/evmCoder.test.ts delete mode 100644 tests/src/evmCoder.test.ts diff --git a/tests/package.json b/tests/package.json index b3a793d87e..6dd666eb9c 100644 --- a/tests/package.json +++ b/tests/package.json @@ -32,6 +32,7 @@ "testEthNesting": "mocha --timeout 9999999 -r ts-node/register './**/eth/nesting/**/*.test.ts'", "testEthFractionalizer": "mocha --timeout 9999999 -r ts-node/register './**/eth/fractionalizer/**/*.test.ts'", "testEthPayable": "mocha --timeout 9999999 -r ts-node/register './**/eth/payable.test.ts'", + "testEvmCoder": "mocha --timeout 9999999 -r ts-node/register './**/eth/evmCoder.test.ts'", "load": "mocha --timeout 9999999 -r ts-node/register './**/*.load.ts'", "loadTransfer": "ts-node src/transfer.nload.ts", "testCollision": "mocha --timeout 9999999 -r ts-node/register ./src/collision-tests/*.test.ts", @@ -67,7 +68,7 @@ "testAdminTransferAndBurn": "mocha --timeout 9999999 -r ts-node/register ./**/adminTransferAndBurn.test.ts", "testSetPermissions": "mocha --timeout 9999999 -r ts-node/register ./**/setPermissions.test.ts", "testCreditFeesToTreasury": "mocha --timeout 9999999 -r ts-node/register ./**/creditFeesToTreasury.test.ts", - "testContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/contractSponsoring.test.ts", + "testContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/eth/contractSponsoring.test.ts", "testEnableContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/enableContractSponsoring.test.ts", "testRemoveFromContractAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/removeFromContractAllowList.test.ts", "testSetContractSponsoringRateLimit": "mocha --timeout 9999999 -r ts-node/register ./**/setContractSponsoringRateLimit.test.ts", diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index b220963bf5..5d83e0f8b5 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -15,7 +15,6 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import * as solc from 'solc'; import {EthUniqueHelper} from './util/playgrounds/unique.dev'; import {itEth, expect, SponsoringMode, usingEthPlaygrounds} from '../eth/util/playgrounds'; import {usingPlaygrounds} from '../util/playgrounds'; @@ -455,70 +454,44 @@ describe('Sponsoring EVM contracts', () => { describe('Sponsoring Fee Limit', () => { let donor: IKeyringPair; let alice: IKeyringPair; - let DEFAULT_GAS: number; + let testContract: CompiledContract; - function compileTestContract() { + async function compileTestContract(helper: EthUniqueHelper) { if (!testContract) { - const input = { - language: 'Solidity', - sources: { - ['TestContract.sol']: { - content: - ` - // SPDX-License-Identifier: MIT - pragma solidity ^0.8.0; - - contract TestContract { - event Result(bool); - - function test(uint32 cycles) public { - uint256 counter = 0; - while(true) { - counter ++; - if (counter > cycles){ - break; - } - } - emit Result(true); + testContract = await helper.ethContract.compile( + 'TestContract', + ` + // SPDX-License-Identifier: MIT + pragma solidity ^0.8.0; + + contract TestContract { + event Result(bool); + + function test(uint32 cycles) public { + uint256 counter = 0; + while(true) { + counter ++; + if (counter > cycles){ + break; } } - `, - }, - }, - settings: { - outputSelection: { - '*': { - '*': ['*'], - }, - }, - }, - }; - const json = JSON.parse(solc.compile(JSON.stringify(input))); - const out = json.contracts['TestContract.sol']['TestContract']; - - testContract = { - abi: out.abi, - object: '0x' + out.evm.bytecode.object, - }; + emit Result(true); + } + } + `, + ); } return testContract; } async function deployTestContract(helper: EthUniqueHelper, owner: string) { - const web3 = helper.getWeb3(); - const compiled = compileTestContract(); - const testContract = new web3.eth.Contract(compiled.abi, undefined, { - data: compiled.object, - from: owner, - gas: DEFAULT_GAS, - }); - return await testContract.deploy({data: compiled.object}).send({from: owner}); + const compiled = await compileTestContract(helper); + return await helper.ethContract.deployByAbi(owner, compiled.abi, compiled.object); } before(async () => { - await usingEthPlaygrounds(async (helper, privateKey) => { + await usingEthPlaygrounds(async (_helper, privateKey) => { donor = privateKey('//Alice'); - DEFAULT_GAS = helper.eth.DEFAULT_GAS; }); }); @@ -526,10 +499,7 @@ describe('Sponsoring Fee Limit', () => { await usingPlaygrounds(async (helper) => { [alice] = await helper.arrange.createAccounts([1000n], donor); }); - }); - - let testContract: CompiledContract; - + }); itEth('Default fee limit', async ({helper}) => { diff --git a/tests/src/eth/evmCoder.test.ts b/tests/src/eth/evmCoder.test.ts new file mode 100644 index 0000000000..c762738c70 --- /dev/null +++ b/tests/src/eth/evmCoder.test.ts @@ -0,0 +1,90 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import {IKeyringPair} from '@polkadot/types/types'; +import {itEth, expect, usingEthPlaygrounds} from './util/playgrounds'; + +const getContractSource = (collectionAddress: string, contractAddress: string): string => { + return ` + // SPDX-License-Identifier: MIT + pragma solidity ^0.8.0; + interface ITest { + function ztestzzzzzzz() external returns (uint256 n); + } + contract Test { + event Result(bool, uint256); + function test1() public { + try + ITest(${collectionAddress}).ztestzzzzzzz() + returns (uint256 n) { + // enters + emit Result(true, n); // => [true, BigNumber { value: "43648854190028290368124427828690944273759144372138548774646036134290060795932" }] + } catch { + emit Result(false, 0); + } + } + function test2() public { + try + ITest(${contractAddress}).ztestzzzzzzz() + returns (uint256 n) { + emit Result(true, n); + } catch { + // enters + emit Result(false, 0); // => [ false, BigNumber { value: "0" } ] + } + } + function test3() public { + ITest(${collectionAddress}).ztestzzzzzzz(); + } + } + `; +}; + + +describe('Evm Coder tests', () => { + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); + + itEth('Call non-existing function', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.eth.createNonfungibleCollection(owner, 'EVMCODER', '', 'TEST'); + const contract = await helper.ethContract.deployByCode(owner, 'Test', getContractSource(collection.collectionAddress, '0x1bfed5D614b886b9Ab2eA4CBAc22A96B7EC29c9c')); + const testContract = await helper.ethContract.deployByCode(owner, 'Test', getContractSource(collection.collectionAddress, contract.options.address)); + { + const result = await testContract.methods.test1().send(); + expect(result.events.Result.returnValues).to.deep.equal({ + '0': false, + '1': '0', + }); + } + { + const result = await testContract.methods.test2().send(); + expect(result.events.Result.returnValues).to.deep.equal({ + '0': false, + '1': '0', + }); + } + { + await expect(testContract.methods.test3().call()) + .to.be.rejectedWith(/unrecognized selector: 0xd9f02b36$/g); + } + }); +}); diff --git a/tests/src/evmCoder.test.ts b/tests/src/evmCoder.test.ts deleted file mode 100644 index 9a1444933f..0000000000 --- a/tests/src/evmCoder.test.ts +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -import {IKeyringPair} from '@polkadot/types/types'; -import Web3 from 'web3'; -import {itEth, expect, usingEthPlaygrounds} from './eth/util/playgrounds'; -import * as solc from 'solc'; - -async function compileTestContract(collectionAddress: string, contractAddress: string) { - const input = { - language: 'Solidity', - sources: { - ['Test.sol']: { - content: - ` - // SPDX-License-Identifier: MIT - pragma solidity ^0.8.0; - interface ITest { - function ztestzzzzzzz() external returns (uint256 n); - } - contract Test { - event Result(bool, uint256); - function test1() public { - try - ITest(${collectionAddress}).ztestzzzzzzz() - returns (uint256 n) { - // enters - emit Result(true, n); // => [true, BigNumber { value: "43648854190028290368124427828690944273759144372138548774646036134290060795932" }] - } catch { - emit Result(false, 0); - } - } - function test2() public { - try - ITest(${contractAddress}).ztestzzzzzzz() - returns (uint256 n) { - emit Result(true, n); - } catch { - // enters - emit Result(false, 0); // => [ false, BigNumber { value: "0" } ] - } - } - function test3() public { - ITest(${collectionAddress}).ztestzzzzzzz(); - } - } - `, - }, - }, - settings: { - outputSelection: { - '*': { - '*': ['*'], - }, - }, - }, - }; - const json = JSON.parse(solc.compile(JSON.stringify(input))); - const out = json.contracts['Test.sol']['Test']; - - return { - abi: out.abi, - object: '0x' + out.evm.bytecode.object, - }; -} - -async function deployTestContract(web3: Web3, owner: string, collectionAddress: string, contractAddress: string, gas: number) { - const compiled = await compileTestContract(collectionAddress, contractAddress); - const fractionalizerContract = new web3.eth.Contract(compiled.abi, undefined, { - data: compiled.object, - from: owner, - gas, - }); - return await fractionalizerContract.deploy({data: compiled.object}).send({from: owner}); -} - -describe('Evm Coder tests', () => { - let donor: IKeyringPair; - - before(async function() { - await usingEthPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); - }); - }); - - itEth('Call non-existing function', async ({helper}) => { - const owner = await helper.eth.createAccountWithBalance(donor); - const collection = await helper.eth.createNonfungibleCollection(owner, 'EVMCODER', '', 'TEST'); - const contract = await deployTestContract(helper.getWeb3(), owner, collection.collectionAddress, '0x1bfed5D614b886b9Ab2eA4CBAc22A96B7EC29c9c', helper.eth.DEFAULT_GAS); - const testContract = await deployTestContract(helper.getWeb3(), owner, collection.collectionAddress, contract.options.address, helper.eth.DEFAULT_GAS); - { - const result = await testContract.methods.test1().send(); - expect(result.events.Result.returnValues).to.deep.equal({ - '0': false, - '1': '0', - }); - } - { - const result = await testContract.methods.test2().send(); - expect(result.events.Result.returnValues).to.deep.equal({ - '0': false, - '1': '0', - }); - } - { - await expect(testContract.methods.test3().call()) - .to.be.rejectedWith(/unrecognized selector: 0xd9f02b36$/g); - } - }); -}); From 8d90cabdbe1bd9a31f401e388c34db728e024d5b Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 7 Oct 2022 18:07:06 +0700 Subject: [PATCH 1075/1274] add additional dockerfiles --- .docker/additional/.env | 5 ++ .docker/additional/Dockerfile-xcm | 86 +++++++++++++++++++++++ .docker/additional/docker-compose-xcm.yml | 24 +++++++ 3 files changed, 115 insertions(+) create mode 100644 .docker/additional/.env create mode 100644 .docker/additional/Dockerfile-xcm create mode 100644 .docker/additional/docker-compose-xcm.yml diff --git a/.docker/additional/.env b/.docker/additional/.env new file mode 100644 index 0000000000..52109c6993 --- /dev/null +++ b/.docker/additional/.env @@ -0,0 +1,5 @@ +RUST_TOOLCHAIN=nightly-2022-07-24 +UNIQUE_BRANCH=feature/multi-assets-redone +CHAIN=quartz +POLKADOT_LAUNCH_BRANCH=feature/rewrite-chain-id-in-spec +LAUNCH_CONFIG_FILE=launch-config-xcm-quartz.json \ No newline at end of file diff --git a/.docker/additional/Dockerfile-xcm b/.docker/additional/Dockerfile-xcm new file mode 100644 index 0000000000..ece35f317b --- /dev/null +++ b/.docker/additional/Dockerfile-xcm @@ -0,0 +1,86 @@ +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ARG RUST_TOOLCHAIN +#ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install ${RUST_TOOLCHAIN} && \ + rustup default ${RUST_TOOLCHAIN} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain ${RUST_TOOLCHAIN} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD ====== +FROM rust-builder as builder-unique + +ARG UNIQUE_BRANCH +ARG CHAIN +ARG LAUNCH_CONFIG_FILE +ARG PROFILE=release + +WORKDIR /unique_parachain + +RUN git clone -b ${UNIQUE_BRANCH} https://github.com/UniqueNetwork/unique-chain.git && \ + cd unique-chain && \ + cargo build --features=${CHAIN}-runtime --$PROFILE + +# ===== RUN ====== +FROM ubuntu:20.04 + +ARG POLKADOT_LAUNCH_BRANCH +ARG LAUNCH_CONFIG_FILE + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b ${POLKADOT_LAUNCH_BRANCH} + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn install + +COPY --from=builder-unique /unique_parachain/unique-chain/.docker/unique-chain/${LAUNCH_CONFIG_FILE} /polkadot-launch/ +COPY --from=builder-unique /unique_parachain/unique-chain/.docker/unique-chain/5validators.jsonnet /polkadot-launch/5validators.jsonnet +COPY --from=builder-unique /unique_parachain/unique-chain/.docker/unique-chain/minBondFix.jsonnet /polkadot-launch/minBondFix.jsonnet + +COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=uniquenetwork/builder-polkadot:latest /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=uniquenetwork/builder-moonbeam:latest /unique_parachain/moonbeam/target/release/moonbeam /moonbeam/target/release/ +COPY --from=uniquenetwork/builder-cumulus:latest /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus +COPY --from=uniquenetwork/builder-acala:latest /unique_parachain/Acala/target/production/acala /acala/target/release/ +COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/ + +EXPOSE 9844 +EXPOSE 9944 +EXPOSE 9946 +EXPOSE 9947 +EXPOSE 9948 + +CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start ${LAUNCH_CONFIG_FILE} + diff --git a/.docker/additional/docker-compose-xcm.yml b/.docker/additional/docker-compose-xcm.yml new file mode 100644 index 0000000000..5236728f65 --- /dev/null +++ b/.docker/additional/docker-compose-xcm.yml @@ -0,0 +1,24 @@ +version: "3.5" + +services: + xcm_nodes: + build: + context: . + dockerfile: ./Dockerfile-xcm + container_name: xcm-${CHAIN}-testnet-local + expose: + - 9844 + - 9944 + - 9946 + - 9947 + - 9948 + ports: + - 127.0.0.1:9844:9844 + - 127.0.0.1:9944:9944 + - 127.0.0.1:9946:9946 + - 127.0.0.1:9947:9947 + - 127.0.0.1:9948:9948 + logging: + options: + max-size: "1m" + max-file: "3" From 787ea853c0cec744c7ced22ee98a2ef66fa26e15 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 7 Oct 2022 17:35:27 +0300 Subject: [PATCH 1076/1274] Change Job Timeout. Add timeout before docker log collection and restart. --- .github/workflows/node-only-update_v2.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 1ac59eb7fe..dfafcc326a 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -49,7 +49,7 @@ jobs: - timeout-minutes: 1380 + timeout-minutes: 2880 name: ${{ matrix.network }} @@ -189,10 +189,15 @@ jobs: run: | ContainerID=$(docker ps -aqf "name=node-parachain") PID=$(docker exec node-parachain pidof 'polkadot-launch') - echo "Polkadot-launch PID: $PID" - docker exec node-parachain kill -SIGUSR1 ${PID} - echo "SIGUSR1 sent to Polkadot-launch PID: $PID" + sleep 30s + echo -e "Show logs of node-parachain container.\n" docker logs ${ContainerID} + echo -e "\n" + echo -e "Restart polkadot-launch process: $PID\n" + docker exec node-parachain kill -SIGUSR1 ${PID} + echo -e "SIGUSR1 sent to Polkadot-launch PID: $PID\n" + echo -e "Get node-parachain logs:\n" + docker logs -t -n 5 ${ContainerID} - name: Get chain logs if: failure() # run this step only at failure From d1851d8ede930e4fb7143fcd33b615faa2821e13 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 7 Oct 2022 17:39:57 +0000 Subject: [PATCH 1077/1274] tests(util): fix and adapt feed-alices to asynchronisity --- tests/package.json | 19 ++++++++-------- tests/src/eth/util/playgrounds/unique.dev.ts | 4 ++-- tests/src/util/playgrounds/feedAlices.ts | 23 ++++++++++---------- tests/src/util/playgrounds/index.ts | 7 +++--- 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/tests/package.json b/tests/package.json index 3e54ba89f5..69acdc7bb7 100644 --- a/tests/package.json +++ b/tests/package.json @@ -29,14 +29,14 @@ "feedAlices": "ts-node ./src/util/playgrounds/feedAlices.ts", "test": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register './src/**/*.test.ts'", + "testSequential": "yarn feedAlices && mocha --timeout 9999999 -r ts-node/register './src/**/*.seqtest.ts'", "testStructure": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register ./**/nesting/**.test.ts", "testEth": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/**/*.test.ts'", "testEthNesting": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/nesting/**/*.test.ts'", "testEthFractionalizer": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/fractionalizer/**/*.test.ts'", "testEthMarketplace": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/marketplace/**/*.test.ts'", - "testCollision": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register ./src/collision-tests/*.test.ts", "testEvent": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register ./src/check-event/*.test.ts", - "testRmrk": "mocha --timeout 9999999 -r ts-node/register ./**/rmrk/**.test.ts", + "testRmrk": "mocha --timeout 9999999 -r ts-node/register ./**/rmrk/**test.ts", "testEthPayable": "mocha --timeout 9999999 -r ts-node/register './**/eth/payable.test.ts'", "testEthTokenProperties": "mocha --timeout 9999999 -r ts-node/register ./**/eth/tokenProperties.test.ts", @@ -48,7 +48,7 @@ "testSetCollectionLimits": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionLimits.test.ts", "testChangeCollectionOwner": "mocha --timeout 9999999 -r ts-node/register ./**/change-collection-owner.test.ts", "testSetCollectionSponsor": "mocha --timeout 9999999 -r ts-node/register ./**/setCollectionSponsor.test.ts", - "testConfirmSponsorship": "mocha --timeout 9999999 -r ts-node/register ./**/confirmSponsorship.test.ts", + "testConfirmSponsorship": "mocha --timeout 9999999 --parallel -r ts-node/register ./**/confirmSponsorship.test.ts", "testRemoveCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionAdmin.test.ts", "testRemoveCollectionSponsor": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionSponsor.test.ts", "testAllowLists": "mocha --timeout 9999999 -r ts-node/register ./**/allowLists.test.ts", @@ -78,12 +78,6 @@ "testInflation": "mocha --timeout 9999999 -r ts-node/register ./**/inflation.test.ts", "testScheduler": "mocha --timeout 9999999 -r ts-node/register ./**/scheduler.test.ts", "testSchedulingEVM": "mocha --timeout 9999999 -r ts-node/register ./**/eth/scheduling.test.ts", - "testXcmUnique": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmUnique.test.ts", - "testXcmQuartz": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmQuartz.test.ts", - "testXcmOpal": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmOpal.test.ts", - "testXcmTransferAcala": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferAcala.test.ts acalaId=2000 uniqueId=5000", - "testXcmTransferStatemine": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferStatemine.test.ts statemineId=1000 uniqueId=5000", - "testXcmTransferMoonbeam": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferMoonbeam.test.ts", "testPalletPresence": "mocha --timeout 9999999 -r ts-node/register ./**/pallet-presence.test.ts", "testBlockProduction": "mocha --timeout 9999999 -r ts-node/register ./**/block-production.test.ts", "testEnableDisableTransfers": "mocha --timeout 9999999 -r ts-node/register ./**/enableDisableTransfer.test.ts", @@ -97,6 +91,13 @@ "testEthFT": "mocha --timeout 9999999 -r ts-node/register ./**/eth/fungible.test.ts", "testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts", "testPromotion": "mocha --timeout 9999999 -r ts-node/register ./**/app-promotion.test.ts", + + "testXcmUnique": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmUnique.test.ts", + "testXcmQuartz": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmQuartz.test.ts", + "testXcmOpal": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmOpal.test.ts", + "testXcmTransferAcala": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferAcala.test.ts acalaId=2000 uniqueId=5000", + "testXcmTransferStatemine": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferStatemine.test.ts statemineId=1000 uniqueId=5000", + "testXcmTransferMoonbeam": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferMoonbeam.test.ts", "load": "mocha --timeout 9999999 -r ts-node/register './**/*.load.ts'", "loadTransfer": "ts-node src/transfer.nload.ts", diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index b66f784500..479a19fdcd 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -142,14 +142,14 @@ class EthGroup extends EthGroupBase { return account.address; } - async createAccountWithBalance(donor: IKeyringPair, amount=1000n) { + async createAccountWithBalance(donor: IKeyringPair, amount=100n) { const account = this.createAccount(); await this.transferBalanceFromSubstrate(donor, account, amount); return account; } - async transferBalanceFromSubstrate(donor: IKeyringPair, recepient: string, amount=1000n, inTokens=true) { + async transferBalanceFromSubstrate(donor: IKeyringPair, recepient: string, amount=100n, inTokens=true) { return await this.helper.balance.transferToSubstrate(donor, evmToAddress(recepient), amount * (inTokens ? this.helper.balance.getOneTokenNominal() : 1n)); } diff --git a/tests/src/util/playgrounds/feedAlices.ts b/tests/src/util/playgrounds/feedAlices.ts index 3791738186..ba9c9def33 100644 --- a/tests/src/util/playgrounds/feedAlices.ts +++ b/tests/src/util/playgrounds/feedAlices.ts @@ -26,23 +26,23 @@ const fundFilenames = async () => { const nonce = await helper.chain.getNonce(alice.address); const filenames = await getFiles(path.resolve(__dirname, '../..')); - console.log(`Main Alice address: ${alice.address}, with balance:`, await helper.balance.getSubstrate(alice.address)); - - const batchSize = 20; + // batching is actually undesired, it takes away the time while all the transactions actually succeed + const batchSize = 300; let balanceGrantedCounter = 0; for (let b = 0; b < filenames.length; b += batchSize) { const tx = []; let batchBalanceGrantedCounter = 0; - for (const f of filenames.slice(b, b + batchSize)) { - if (!f.endsWith('.test.ts')) continue; - const account = await privateKey({filename: f}); + for (let i = 0; batchBalanceGrantedCounter < batchSize && b + i < filenames.length; i++) { + const f = filenames[b + i]; + if (!f.endsWith('.test.ts') || f.includes('.outdated')) continue; + const account = await privateKey({filename: f, ignoreFundsPresence: true}); const aliceBalance = await helper.balance.getSubstrate(account.address); - if (aliceBalance < 5000n * oneToken) { + if (aliceBalance < 7500n * oneToken) { tx.push(helper.executeExtrinsic( alice, 'api.tx.balances.transfer', - [account.address, 10000n * oneToken], + [account.address, 15000n * oneToken], true, {nonce: nonce + balanceGrantedCounter++}, ).then(() => true).catch(() => {console.error(`Transaction to ${path.basename(f)} registered as failed. Strange.`); return false;})); @@ -65,13 +65,14 @@ const fundFilenamesWithRetries = async (retriesLeft: number): Promise = if (retriesLeft <= 0) return Promise.resolve(false); return fundFilenames() .then(() => Promise.resolve(true)) - .catch(() => { - console.error(`Some transactions have failed. ${retriesLeft >= 1 ? 'Retrying...' : 'Something is wrong.'}`); + .catch(e => { + console.error(e); + console.error(`Some transactions might have failed. ${retriesLeft > 1 ? 'Retrying...' : 'Something is wrong.'}\n`); return fundFilenamesWithRetries(--retriesLeft); }); }; -fundFilenamesWithRetries(2).then((result) => process.exit(result ? 0 : 1)).catch(e => { +fundFilenamesWithRetries(3).then((result) => process.exit(result ? 0 : 1)).catch(e => { console.error(e); process.exit(1); }); diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index 02838e9d1c..12a82ec218 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -22,8 +22,7 @@ export const getTestSeed = (filename: string) => { return `//Alice+${getTestHash(filename)}`; }; -// todo:playgrounds normalize to seed and filename -export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string | {filename: string}) => Promise) => Promise, url: string = config.substrateUrl) => { +export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string | {filename: string, ignoreFundsPresence?: boolean}) => Promise) => Promise, url: string = config.substrateUrl) => { const silentConsole = new SilentConsole(); silentConsole.enable(); @@ -32,14 +31,14 @@ export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKe try { await helper.connect(url); const ss58Format = helper.chain.getChainProperties().ss58Format; - const privateKey = async (seed: string | {filename: string}) => { + const privateKey = async (seed: string | {filename: string, ignoreFundsPresence?: boolean}) => { if (typeof seed === 'string') { return helper.util.fromSeed(seed, ss58Format); } else { const actualSeed = getTestSeed(seed.filename); let account = helper.util.fromSeed(actualSeed, ss58Format); - if (await helper.balance.getSubstrate(account.address) == 0n) { + if (!seed.ignoreFundsPresence && await helper.balance.getSubstrate(account.address) == 0n) { console.warn(`${path.basename(seed.filename)}: Not enough funds present on the filename account. Using the default one as the donor instead.`); account = helper.util.fromSeed('//Alice', ss58Format); } From 85e8bc9019377e9f3167bb07c2ed2a37f8636694 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 7 Oct 2022 17:46:50 +0000 Subject: [PATCH 1078/1274] tests: refactor and adapt some tests for asynchronicity --- tests/src/app-promotion.test.ts | 6 +- tests/src/confirmSponsorship.test.ts | 12 +- ...est.ts => creditFeesToTreasury.seqtest.ts} | 0 tests/src/eth/collectionSponsoring.test.ts | 11 +- tests/src/eth/contractSponsoring.test.ts | 17 +- tests/src/eth/createNFTCollection.test.ts | 13 +- tests/src/eth/createRFTCollection.test.ts | 12 +- tests/src/eth/marketplace/marketplace.test.ts | 13 +- tests/src/eth/sponsoring.test.ts | 4 +- .../src/nesting/collectionProperties.test.ts | 261 ++++ tests/src/nesting/properties.test.ts | 1047 ----------------- tests/src/nesting/propertyPermissions.test.ts | 198 ++++ tests/src/nesting/tokenProperties.test.ts | 594 ++++++++++ 13 files changed, 1087 insertions(+), 1101 deletions(-) rename tests/src/{creditFeesToTreasury.test.ts => creditFeesToTreasury.seqtest.ts} (100%) create mode 100644 tests/src/nesting/collectionProperties.test.ts delete mode 100644 tests/src/nesting/properties.test.ts create mode 100644 tests/src/nesting/propertyPermissions.test.ts create mode 100644 tests/src/nesting/tokenProperties.test.ts diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 7525d27f12..9e0b6eafcf 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -37,7 +37,7 @@ describe('App promotion', () => { before(async function () { await usingPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.AppPromotion]); - alice = await privateKey({filename: __filename}); + alice = await privateKey('//Alice'); [palletAdmin] = await helper.arrange.createAccounts([100n], alice); const api = helper.getApi(); await helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); @@ -557,7 +557,7 @@ describe('App promotion', () => { // caller payed for call expect(1000n * nominal > callerBalance).to.be.true; - expect(contractBalanceAfter).to.be.equal(1000n * nominal); + expect(contractBalanceAfter).to.be.equal(100n * nominal); }); itEth('can not be called by non-admin', async ({helper}) => { @@ -613,7 +613,7 @@ describe('App promotion', () => { await helper.staking.stake(staker, 200n * nominal); // wait rewards are available: - const [_, stake2] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); + const [_stake1, stake2] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}); await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake2.block)); const payoutToStaker = (await helper.admin.payoutStakers(palletAdmin, 100)).find((payout) => payout.staker === staker.address)?.payout; diff --git a/tests/src/confirmSponsorship.test.ts b/tests/src/confirmSponsorship.test.ts index f2a7d70733..55bf65a23f 100644 --- a/tests/src/confirmSponsorship.test.ts +++ b/tests/src/confirmSponsorship.test.ts @@ -109,7 +109,9 @@ describe('integration test: ext. confirmSponsorship():', () => { }); itSub('NFT: Sponsoring of transfers is rate limited', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL', limits: { + sponsorTransferTimeout: 1000, + }}); await collection.setSponsor(alice, bob.address); await collection.confirmSponsorship(bob); @@ -125,7 +127,9 @@ describe('integration test: ext. confirmSponsorship():', () => { }); itSub('Fungible: Sponsoring is rate limited', async ({helper}) => { - const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL', limits: { + sponsorTransferTimeout: 1000, + }}); await collection.setSponsor(alice, bob.address); await collection.confirmSponsorship(bob); @@ -141,7 +145,9 @@ describe('integration test: ext. confirmSponsorship():', () => { }); itSub.ifWithPallets('ReFungible: Sponsoring is rate limited', [Pallets.ReFungible], async ({helper}) => { - const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const collection = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL', limits: { + sponsorTransferTimeout: 1000, + }}); await collection.setSponsor(alice, bob.address); await collection.confirmSponsorship(bob); diff --git a/tests/src/creditFeesToTreasury.test.ts b/tests/src/creditFeesToTreasury.seqtest.ts similarity index 100% rename from tests/src/creditFeesToTreasury.test.ts rename to tests/src/creditFeesToTreasury.seqtest.ts diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index bb9627d493..33160858e6 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -9,17 +9,12 @@ describe('evm collection sponsoring', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); + [alice] = await helper.arrange.createAccounts([100n], donor); nominal = helper.balance.getOneTokenNominal(); }); }); - - beforeEach(async () => { - await usingPlaygrounds(async (helper) => { - [alice] = await helper.arrange.createAccounts([1000n], donor); - }); - }); - + itEth('sponsors mint transactions', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {tokenPrefix: 'spnr', permissions: {mintMode: true}}); await collection.setSponsor(alice, alice.address); diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index b220963bf5..c3728cd5fe 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -26,11 +26,11 @@ describe('Sponsoring EVM contracts', () => { before(async () => { await usingPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); - itEth('Self sponsored can be set by the address that deployed the contract', async ({helper, privateKey}) => { + itEth('Self sponsored can be set by the address that deployed the contract', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const flipper = await helper.eth.deployFlipper(owner); const helpers = helper.ethNativeContract.contractHelpers(owner); @@ -517,20 +517,13 @@ describe('Sponsoring Fee Limit', () => { before(async () => { await usingEthPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); + [alice] = await helper.arrange.createAccounts([100n], donor); DEFAULT_GAS = helper.eth.DEFAULT_GAS; }); }); - beforeEach(async () => { - await usingPlaygrounds(async (helper) => { - [alice] = await helper.arrange.createAccounts([1000n], donor); - }); - }); - let testContract: CompiledContract; - - itEth('Default fee limit', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); @@ -584,7 +577,7 @@ describe('Sponsoring Fee Limit', () => { expect(await helper.balance.getEthereum(user)).to.not.be.equal(originalUserBalance); }); - itEth('Negative test - check that evm.call transactions exceeding fee limit are not executed', async ({helper, privateKey}) => { + itEth('Negative test - check that evm.call transactions exceeding fee limit are not executed', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const sponsor = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); diff --git a/tests/src/eth/createNFTCollection.test.ts b/tests/src/eth/createNFTCollection.test.ts index fdcf444565..e4cd35171c 100644 --- a/tests/src/eth/createNFTCollection.test.ts +++ b/tests/src/eth/createNFTCollection.test.ts @@ -35,24 +35,17 @@ describe('Create NFT collection from EVM', () => { const description = 'Some description'; const prefix = 'token prefix'; - // todo:playgrounds this might fail when in async environment. - const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; const {collectionId} = await helper.eth.createNonfungibleCollection(owner, name, description, prefix); - const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; - - const collection = helper.nft.getCollectionObject(collectionId); - const data = (await collection.getData())!; + const data = (await helper.rft.getData(collectionId))!; - expect(collectionCountAfter - collectionCountBefore).to.be.eq(1); - expect(collectionId).to.be.eq(collectionCountAfter); expect(data.name).to.be.eq(name); expect(data.description).to.be.eq(description); expect(data.raw.tokenPrefix).to.be.eq(prefix); expect(data.raw.mode).to.be.eq('NFT'); }); - // todo:playgrounds this test will fail when in async environment. - itEth('Check collection address exist', async ({helper}) => { + // this test will occasionally fail when in async environment. + itEth.skip('Check collection address exist', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const expectedCollectionId = +(await helper.callRpc('api.rpc.unique.collectionStats')).created + 1; diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts index 96dd72837d..c2c08508d7 100644 --- a/tests/src/eth/createRFTCollection.test.ts +++ b/tests/src/eth/createRFTCollection.test.ts @@ -37,23 +37,17 @@ describe('Create RFT collection from EVM', () => { const description = 'Some description'; const prefix = 'token prefix'; - // todo:playgrounds this might fail when in async environment. - const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; const {collectionId} = await helper.eth.createRefungibleCollection(owner, name, description, prefix); - const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; - const data = (await helper.rft.getData(collectionId))!; - expect(collectionCountAfter - collectionCountBefore).to.be.eq(1); - expect(collectionId).to.be.eq(collectionCountAfter); expect(data.name).to.be.eq(name); expect(data.description).to.be.eq(description); expect(data.raw.tokenPrefix).to.be.eq(prefix); expect(data.raw.mode).to.be.eq('ReFungible'); }); - - // todo:playgrounds this test will fail when in async environment. - itEth('Check collection address exist', async ({helper}) => { + + // this test will occasionally fail when in async environment. + itEth.skip('Check collection address exist', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const expectedCollectionId = +(await helper.callRpc('api.rpc.unique.collectionStats')).created + 1; diff --git a/tests/src/eth/marketplace/marketplace.test.ts b/tests/src/eth/marketplace/marketplace.test.ts index 293199c611..7159cda05b 100644 --- a/tests/src/eth/marketplace/marketplace.test.ts +++ b/tests/src/eth/marketplace/marketplace.test.ts @@ -14,10 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {usingPlaygrounds} from './../../util/playgrounds/index'; import {IKeyringPair} from '@polkadot/types/types'; import {readFile} from 'fs/promises'; -import {itEth, expect, SponsoringMode} from '../util/playgrounds'; +import {itEth, usingEthPlaygrounds, expect, SponsoringMode} from '../util/playgrounds'; describe('Matcher contract usage', () => { const PRICE = 2000n; @@ -29,17 +28,17 @@ describe('Matcher contract usage', () => { let sellerMirror: string; before(async () => { - await usingPlaygrounds(async (_helper, privateKey) => { - donor = privateKey('//Alice'); + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = await privateKey({filename: __filename}); }); }); beforeEach(async () => { - await usingPlaygrounds(async (helper, privateKey) => { - [alice] = await helper.arrange.createAccounts([10000n], donor); + await usingEthPlaygrounds(async (helper, privateKey) => { + [alice] = await helper.arrange.createAccounts([1000n], donor); aliceMirror = helper.address.substrateToEth(alice.address).toLowerCase(); aliceDoubleMirror = helper.address.ethToSubstrate(aliceMirror); - seller = privateKey(`//Seller/${Date.now()}`); + seller = await privateKey(`//Seller/${Date.now()}`); sellerMirror = helper.address.substrateToEth(seller.address).toLowerCase(); await helper.balance.transferToSubstrate(donor, aliceDoubleMirror, 10_000_000_000_000_000_000n); diff --git a/tests/src/eth/sponsoring.test.ts b/tests/src/eth/sponsoring.test.ts index f8462c6a60..f950dc65c4 100644 --- a/tests/src/eth/sponsoring.test.ts +++ b/tests/src/eth/sponsoring.test.ts @@ -22,8 +22,8 @@ describe('EVM sponsoring', () => { let donor: IKeyringPair; before(async () => { - await usingPlaygrounds(async (helper, privateKey) => { - donor = privateKey('//Alice'); + await usingPlaygrounds(async (_helper, privateKey) => { + donor = await privateKey({filename: __filename}); }); }); diff --git a/tests/src/nesting/collectionProperties.test.ts b/tests/src/nesting/collectionProperties.test.ts new file mode 100644 index 0000000000..0018e93e26 --- /dev/null +++ b/tests/src/nesting/collectionProperties.test.ts @@ -0,0 +1,261 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import {IKeyringPair} from '@polkadot/types/types'; +import {itSub, Pallets, usingPlaygrounds, expect} from '../util/playgrounds'; +import {UniqueBaseCollection} from '../util/playgrounds/unique'; + +describe('Integration Test: Collection Properties', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = await privateKey({filename: __filename}); + [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); + }); + }); + + itSub('Properties are initially empty', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + expect(await collection.getProperties()).to.be.empty; + }); + + async function testSetsPropertiesForCollection(collection: UniqueBaseCollection) { + // As owner + await expect(collection.setProperties(alice, [{key: 'electron', value: 'come bond'}])).to.be.fulfilled; + + await collection.addAdmin(alice, {Substrate: bob.address}); + + // As administrator + await expect(collection.setProperties(bob, [{key: 'black_hole'}])).to.be.fulfilled; + + const properties = await collection.getProperties(); + expect(properties).to.include.deep.members([ + {key: 'electron', value: 'come bond'}, + {key: 'black_hole', value: ''}, + ]); + } + + itSub('Sets properties for a NFT collection', async ({helper}) => { + await testSetsPropertiesForCollection(await helper.nft.mintCollection(alice)); + }); + + itSub.ifWithPallets('Sets properties for a ReFungible collection', [Pallets.ReFungible], async ({helper}) => { + await testSetsPropertiesForCollection(await helper.rft.mintCollection(alice)); + }); + + async function testCheckValidNames(collection: UniqueBaseCollection) { + // alpha symbols + await expect(collection.setProperties(alice, [{key: 'answer'}])).to.be.fulfilled; + + // numeric symbols + await expect(collection.setProperties(alice, [{key: '451'}])).to.be.fulfilled; + + // underscore symbol + await expect(collection.setProperties(alice, [{key: 'black_hole'}])).to.be.fulfilled; + + // dash symbol + await expect(collection.setProperties(alice, [{key: '-'}])).to.be.fulfilled; + + // dot symbol + await expect(collection.setProperties(alice, [{key: 'once.in.a.long.long.while...', value: 'you get a little lost'}])).to.be.fulfilled; + + const properties = await collection.getProperties(); + expect(properties).to.include.deep.members([ + {key: 'answer', value: ''}, + {key: '451', value: ''}, + {key: 'black_hole', value: ''}, + {key: '-', value: ''}, + {key: 'once.in.a.long.long.while...', value: 'you get a little lost'}, + ]); + } + + itSub('Check valid names for NFT collection properties keys', async ({helper}) => { + await testCheckValidNames(await helper.nft.mintCollection(alice)); + }); + + itSub.ifWithPallets('Check valid names for ReFungible collection properties keys', [Pallets.ReFungible], async ({helper}) => { + await testCheckValidNames(await helper.rft.mintCollection(alice)); + }); + + async function testChangesProperties(collection: UniqueBaseCollection) { + await expect(collection.setProperties(alice, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: ''}])).to.be.fulfilled; + + // Mutate the properties + await expect(collection.setProperties(alice, [{key: 'black_hole', value: 'LIGO'}])).to.be.fulfilled; + + const properties = await collection.getProperties(); + expect(properties).to.include.deep.members([ + {key: 'electron', value: 'come bond'}, + {key: 'black_hole', value: 'LIGO'}, + ]); + } + + itSub('Changes properties of a NFT collection', async ({helper}) => { + await testChangesProperties(await helper.nft.mintCollection(alice)); + }); + + itSub.ifWithPallets('Changes properties of a ReFungible collection', [Pallets.ReFungible], async ({helper}) => { + await testChangesProperties(await helper.rft.mintCollection(alice)); + }); + + async function testDeleteProperties(collection: UniqueBaseCollection) { + await expect(collection.setProperties(alice, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: 'LIGO'}])).to.be.fulfilled; + + await expect(collection.deleteProperties(alice, ['electron'])).to.be.fulfilled; + + const properties = await collection.getProperties(['black_hole', 'electron']); + expect(properties).to.be.deep.equal([ + {key: 'black_hole', value: 'LIGO'}, + ]); + } + + itSub('Deletes properties of a NFT collection', async ({helper}) => { + await testDeleteProperties(await helper.nft.mintCollection(alice)); + }); + + itSub.ifWithPallets('Deletes properties of a ReFungible collection', [Pallets.ReFungible], async ({helper}) => { + await testDeleteProperties(await helper.rft.mintCollection(alice)); + }); +}); + +describe('Negative Integration Test: Collection Properties', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = await privateKey({filename: __filename}); + [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor); + }); + }); + + async function testFailsSetPropertiesIfNotOwnerOrAdmin(collection: UniqueBaseCollection) { + await expect(collection.setProperties(bob, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: 'LIGO'}])) + .to.be.rejectedWith(/common\.NoPermission/); + + expect(await collection.getProperties()).to.be.empty; + } + + itSub('Fails to set properties in a NFT collection if not its onwer/administrator', async ({helper}) => { + await testFailsSetPropertiesIfNotOwnerOrAdmin(await helper.nft.mintCollection(alice)); + }); + + itSub.ifWithPallets('Fails to set properties in a ReFungible collection if not its onwer/administrator', [Pallets.ReFungible], async ({helper}) => { + await testFailsSetPropertiesIfNotOwnerOrAdmin(await helper.rft.mintCollection(alice)); + }); + + async function testFailsSetPropertiesThatExeedLimits(collection: UniqueBaseCollection) { + const spaceLimit = (await (collection.helper!.api! as any).query.common.collectionProperties(collection.collectionId)).spaceLimit.toNumber(); + + // Mute the general tx parsing error, too many bytes to process + { + console.error = () => {}; + await expect(collection.setProperties(alice, [ + {key: 'electron', value: 'low high '.repeat(Math.ceil(spaceLimit! / 9))}, + ])).to.be.rejected; + } + + expect(await collection.getProperties(['electron'])).to.be.empty; + + await expect(collection.setProperties(alice, [ + {key: 'electron', value: 'low high '.repeat(Math.ceil(spaceLimit! / 18))}, + {key: 'black_hole', value: '0'.repeat(Math.ceil(spaceLimit! / 2))}, + ])).to.be.rejectedWith(/common\.NoSpaceForProperty/); + + expect(await collection.getProperties(['electron', 'black_hole'])).to.be.empty; + } + + itSub('Fails to set properties that exceed the limits (NFT)', async ({helper}) => { + await testFailsSetPropertiesThatExeedLimits(await helper.nft.mintCollection(alice)); + }); + + itSub.ifWithPallets('Fails to set properties that exceed the limits (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + await testFailsSetPropertiesThatExeedLimits(await helper.rft.mintCollection(alice)); + }); + + async function testFailsSetMorePropertiesThanAllowed(collection: UniqueBaseCollection) { + const propertiesToBeSet = []; + for (let i = 0; i < 65; i++) { + propertiesToBeSet.push({ + key: 'electron_' + i, + value: Math.random() > 0.5 ? 'high' : 'low', + }); + } + + await expect(collection.setProperties(alice, propertiesToBeSet)). + to.be.rejectedWith(/common\.PropertyLimitReached/); + + expect(await collection.getProperties()).to.be.empty; + } + + itSub('Fails to set more properties than it is allowed (NFT)', async ({helper}) => { + await testFailsSetMorePropertiesThanAllowed(await helper.nft.mintCollection(alice)); + }); + + itSub.ifWithPallets('Fails to set more properties than it is allowed (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + await testFailsSetMorePropertiesThanAllowed(await helper.rft.mintCollection(alice)); + }); + + async function testFailsSetPropertiesWithInvalidNames(collection: UniqueBaseCollection) { + const invalidProperties = [ + [{key: 'electron', value: 'negative'}, {key: 'string theory', value: 'understandable'}], + [{key: 'Mr/Sandman', value: 'Bring me a gene'}], + [{key: 'déjà vu', value: 'hmm...'}], + ]; + + for (let i = 0; i < invalidProperties.length; i++) { + await expect( + collection.setProperties(alice, invalidProperties[i]), + `on rejecting the new badly-named property #${i}`, + ).to.be.rejectedWith(/common\.InvalidCharacterInPropertyKey/); + } + + await expect( + collection.setProperties(alice, [{key: '', value: 'nothing must not exist'}]), + 'on rejecting an unnamed property', + ).to.be.rejectedWith(/common\.EmptyPropertyKey/); + + await expect( + collection.setProperties(alice, [{key: 'CRISPR-Cas9', value: 'rewriting nature!'}]), + 'on setting the correctly-but-still-badly-named property', + ).to.be.fulfilled; + + const keys = invalidProperties.flatMap(propertySet => propertySet.map(property => property.key)).concat('CRISPR-Cas9').concat(''); + + const properties = await collection.getProperties(keys); + expect(properties).to.be.deep.equal([ + {key: 'CRISPR-Cas9', value: 'rewriting nature!'}, + ]); + + for (let i = 0; i < invalidProperties.length; i++) { + await expect( + collection.deleteProperties(alice, invalidProperties[i].map(propertySet => propertySet.key)), + `on trying to delete the non-existent badly-named property #${i}`, + ).to.be.rejectedWith(/common\.InvalidCharacterInPropertyKey/); + } + } + + itSub('Fails to set properties with invalid names (NFT)', async ({helper}) => { + await testFailsSetPropertiesWithInvalidNames(await helper.nft.mintCollection(alice)); + }); + + itSub.ifWithPallets('Fails to set properties with invalid names (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + await testFailsSetPropertiesWithInvalidNames(await helper.rft.mintCollection(alice)); + }); +}); + \ No newline at end of file diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts deleted file mode 100644 index 9606f6252f..0000000000 --- a/tests/src/nesting/properties.test.ts +++ /dev/null @@ -1,1047 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../util/playgrounds'; -import {UniqueHelper, UniqueBaseCollection, UniqueNFTCollection, UniqueNFToken, UniqueRFTCollection, UniqueRFToken} from '../util/playgrounds/unique'; - -// ---------- COLLECTION PROPERTIES - -describe('Integration Test: Collection Properties', () => { - let alice: IKeyringPair; - let bob: IKeyringPair; - - before(async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const donor = await privateKey({filename: __filename}); - [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); - }); - }); - - itSub('Properties are initially empty', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice); - expect(await collection.getProperties()).to.be.empty; - }); - - async function testSetsPropertiesForCollection(collection: UniqueBaseCollection) { - // As owner - await expect(collection.setProperties(alice, [{key: 'electron', value: 'come bond'}])).to.be.fulfilled; - - await collection.addAdmin(alice, {Substrate: bob.address}); - - // As administrator - await expect(collection.setProperties(bob, [{key: 'black_hole'}])).to.be.fulfilled; - - const properties = await collection.getProperties(); - expect(properties).to.include.deep.members([ - {key: 'electron', value: 'come bond'}, - {key: 'black_hole', value: ''}, - ]); - } - - itSub('Sets properties for a NFT collection', async ({helper}) => { - await testSetsPropertiesForCollection(await helper.nft.mintCollection(alice)); - }); - - itSub.ifWithPallets('Sets properties for a ReFungible collection', [Pallets.ReFungible], async ({helper}) => { - await testSetsPropertiesForCollection(await helper.rft.mintCollection(alice)); - }); - - async function testCheckValidNames(collection: UniqueBaseCollection) { - // alpha symbols - await expect(collection.setProperties(alice, [{key: 'answer'}])).to.be.fulfilled; - - // numeric symbols - await expect(collection.setProperties(alice, [{key: '451'}])).to.be.fulfilled; - - // underscore symbol - await expect(collection.setProperties(alice, [{key: 'black_hole'}])).to.be.fulfilled; - - // dash symbol - await expect(collection.setProperties(alice, [{key: '-'}])).to.be.fulfilled; - - // dot symbol - await expect(collection.setProperties(alice, [{key: 'once.in.a.long.long.while...', value: 'you get a little lost'}])).to.be.fulfilled; - - const properties = await collection.getProperties(); - expect(properties).to.include.deep.members([ - {key: 'answer', value: ''}, - {key: '451', value: ''}, - {key: 'black_hole', value: ''}, - {key: '-', value: ''}, - {key: 'once.in.a.long.long.while...', value: 'you get a little lost'}, - ]); - } - - itSub('Check valid names for NFT collection properties keys', async ({helper}) => { - await testCheckValidNames(await helper.nft.mintCollection(alice)); - }); - - itSub.ifWithPallets('Check valid names for ReFungible collection properties keys', [Pallets.ReFungible], async ({helper}) => { - await testCheckValidNames(await helper.rft.mintCollection(alice)); - }); - - async function testChangesProperties(collection: UniqueBaseCollection) { - await expect(collection.setProperties(alice, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: ''}])).to.be.fulfilled; - - // Mutate the properties - await expect(collection.setProperties(alice, [{key: 'black_hole', value: 'LIGO'}])).to.be.fulfilled; - - const properties = await collection.getProperties(); - expect(properties).to.include.deep.members([ - {key: 'electron', value: 'come bond'}, - {key: 'black_hole', value: 'LIGO'}, - ]); - } - - itSub('Changes properties of a NFT collection', async ({helper}) => { - await testChangesProperties(await helper.nft.mintCollection(alice)); - }); - - itSub.ifWithPallets('Changes properties of a ReFungible collection', [Pallets.ReFungible], async ({helper}) => { - await testChangesProperties(await helper.rft.mintCollection(alice)); - }); - - async function testDeleteProperties(collection: UniqueBaseCollection) { - await expect(collection.setProperties(alice, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: 'LIGO'}])).to.be.fulfilled; - - await expect(collection.deleteProperties(alice, ['electron'])).to.be.fulfilled; - - const properties = await collection.getProperties(['black_hole', 'electron']); - expect(properties).to.be.deep.equal([ - {key: 'black_hole', value: 'LIGO'}, - ]); - } - - itSub('Deletes properties of a NFT collection', async ({helper}) => { - await testDeleteProperties(await helper.nft.mintCollection(alice)); - }); - - itSub.ifWithPallets('Deletes properties of a ReFungible collection', [Pallets.ReFungible], async ({helper}) => { - await testDeleteProperties(await helper.rft.mintCollection(alice)); - }); -}); - -describe('Negative Integration Test: Collection Properties', () => { - let alice: IKeyringPair; - let bob: IKeyringPair; - - before(async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const donor = await privateKey({filename: __filename}); - [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor); - }); - }); - - async function testFailsSetPropertiesIfNotOwnerOrAdmin(collection: UniqueBaseCollection) { - await expect(collection.setProperties(bob, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: 'LIGO'}])) - .to.be.rejectedWith(/common\.NoPermission/); - - expect(await collection.getProperties()).to.be.empty; - } - - itSub('Fails to set properties in a NFT collection if not its onwer/administrator', async ({helper}) => { - await testFailsSetPropertiesIfNotOwnerOrAdmin(await helper.nft.mintCollection(alice)); - }); - - itSub.ifWithPallets('Fails to set properties in a ReFungible collection if not its onwer/administrator', [Pallets.ReFungible], async ({helper}) => { - await testFailsSetPropertiesIfNotOwnerOrAdmin(await helper.rft.mintCollection(alice)); - }); - - async function testFailsSetPropertiesThatExeedLimits(collection: UniqueBaseCollection) { - const spaceLimit = (await (collection.helper!.api! as any).query.common.collectionProperties(collection.collectionId)).spaceLimit.toNumber(); - - // Mute the general tx parsing error, too many bytes to process - { - console.error = () => {}; - await expect(collection.setProperties(alice, [ - {key: 'electron', value: 'low high '.repeat(Math.ceil(spaceLimit! / 9))}, - ])).to.be.rejected; - } - - expect(await collection.getProperties(['electron'])).to.be.empty; - - await expect(collection.setProperties(alice, [ - {key: 'electron', value: 'low high '.repeat(Math.ceil(spaceLimit! / 18))}, - {key: 'black_hole', value: '0'.repeat(Math.ceil(spaceLimit! / 2))}, - ])).to.be.rejectedWith(/common\.NoSpaceForProperty/); - - expect(await collection.getProperties(['electron', 'black_hole'])).to.be.empty; - } - - itSub('Fails to set properties that exceed the limits (NFT)', async ({helper}) => { - await testFailsSetPropertiesThatExeedLimits(await helper.nft.mintCollection(alice)); - }); - - itSub.ifWithPallets('Fails to set properties that exceed the limits (ReFungible)', [Pallets.ReFungible], async ({helper}) => { - await testFailsSetPropertiesThatExeedLimits(await helper.rft.mintCollection(alice)); - }); - - async function testFailsSetMorePropertiesThanAllowed(collection: UniqueBaseCollection) { - const propertiesToBeSet = []; - for (let i = 0; i < 65; i++) { - propertiesToBeSet.push({ - key: 'electron_' + i, - value: Math.random() > 0.5 ? 'high' : 'low', - }); - } - - await expect(collection.setProperties(alice, propertiesToBeSet)). - to.be.rejectedWith(/common\.PropertyLimitReached/); - - expect(await collection.getProperties()).to.be.empty; - } - - itSub('Fails to set more properties than it is allowed (NFT)', async ({helper}) => { - await testFailsSetMorePropertiesThanAllowed(await helper.nft.mintCollection(alice)); - }); - - itSub.ifWithPallets('Fails to set more properties than it is allowed (ReFungible)', [Pallets.ReFungible], async ({helper}) => { - await testFailsSetMorePropertiesThanAllowed(await helper.rft.mintCollection(alice)); - }); - - async function testFailsSetPropertiesWithInvalidNames(collection: UniqueBaseCollection) { - const invalidProperties = [ - [{key: 'electron', value: 'negative'}, {key: 'string theory', value: 'understandable'}], - [{key: 'Mr/Sandman', value: 'Bring me a gene'}], - [{key: 'déjà vu', value: 'hmm...'}], - ]; - - for (let i = 0; i < invalidProperties.length; i++) { - await expect( - collection.setProperties(alice, invalidProperties[i]), - `on rejecting the new badly-named property #${i}`, - ).to.be.rejectedWith(/common\.InvalidCharacterInPropertyKey/); - } - - await expect( - collection.setProperties(alice, [{key: '', value: 'nothing must not exist'}]), - 'on rejecting an unnamed property', - ).to.be.rejectedWith(/common\.EmptyPropertyKey/); - - await expect( - collection.setProperties(alice, [{key: 'CRISPR-Cas9', value: 'rewriting nature!'}]), - 'on setting the correctly-but-still-badly-named property', - ).to.be.fulfilled; - - const keys = invalidProperties.flatMap(propertySet => propertySet.map(property => property.key)).concat('CRISPR-Cas9').concat(''); - - const properties = await collection.getProperties(keys); - expect(properties).to.be.deep.equal([ - {key: 'CRISPR-Cas9', value: 'rewriting nature!'}, - ]); - - for (let i = 0; i < invalidProperties.length; i++) { - await expect( - collection.deleteProperties(alice, invalidProperties[i].map(propertySet => propertySet.key)), - `on trying to delete the non-existent badly-named property #${i}`, - ).to.be.rejectedWith(/common\.InvalidCharacterInPropertyKey/); - } - } - - itSub('Fails to set properties with invalid names (NFT)', async ({helper}) => { - await testFailsSetPropertiesWithInvalidNames(await helper.nft.mintCollection(alice)); - }); - - itSub.ifWithPallets('Fails to set properties with invalid names (ReFungible)', [Pallets.ReFungible], async ({helper}) => { - await testFailsSetPropertiesWithInvalidNames(await helper.rft.mintCollection(alice)); - }); -}); - -// ---------- ACCESS RIGHTS - -describe('Integration Test: Access Rights to Token Properties', () => { - let alice: IKeyringPair; - let bob: IKeyringPair; - - before(async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const donor = await privateKey({filename: __filename}); - [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor); - }); - }); - - itSub('Reads access rights to properties of a collection', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice); - const propertyRights = (await helper.callRpc('api.query.common.collectionPropertyPermissions', [collection.collectionId])).toJSON(); - expect(propertyRights).to.be.empty; - }); - - async function testSetsAccessRightsToProperties(collection: UniqueNFTCollection | UniqueRFTCollection) { - await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: true}}])) - .to.be.fulfilled; - - await collection.addAdmin(alice, {Substrate: bob.address}); - - await expect(collection.setTokenPropertyPermissions(bob, [{key: 'mindgame', permission: {collectionAdmin: true, tokenOwner: false}}])) - .to.be.fulfilled; - - const propertyRights = await collection.getPropertyPermissions(['skullduggery', 'mindgame']); - expect(propertyRights).to.include.deep.members([ - {key: 'skullduggery', permission: {mutable: true, collectionAdmin: false, tokenOwner: false}}, - {key: 'mindgame', permission: {mutable: false, collectionAdmin: true, tokenOwner: false}}, - ]); - } - - itSub('Sets access rights to properties of a collection (NFT)', async ({helper}) => { - await testSetsAccessRightsToProperties(await helper.nft.mintCollection(alice)); - }); - - itSub.ifWithPallets('Sets access rights to properties of a collection (ReFungible)', [Pallets.ReFungible], async ({helper}) => { - await testSetsAccessRightsToProperties(await helper.rft.mintCollection(alice)); - }); - - async function testChangesAccessRightsToProperty(collection: UniqueNFTCollection | UniqueRFTCollection) { - await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: true, collectionAdmin: true}}])) - .to.be.fulfilled; - - await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: false, tokenOwner: true}}])) - .to.be.fulfilled; - - const propertyRights = await collection.getPropertyPermissions(); - expect(propertyRights).to.be.deep.equal([ - {key: 'skullduggery', permission: {'mutable': false, 'collectionAdmin': false, 'tokenOwner': true}}, - ]); - } - - itSub('Changes access rights to properties of a NFT collection', async ({helper}) => { - await testChangesAccessRightsToProperty(await helper.nft.mintCollection(alice)); - }); - - itSub.ifWithPallets('Changes access rights to properties of a ReFungible collection', [Pallets.ReFungible], async ({helper}) => { - await testChangesAccessRightsToProperty(await helper.rft.mintCollection(alice)); - }); -}); - -describe('Negative Integration Test: Access Rights to Token Properties', () => { - let alice: IKeyringPair; - let bob: IKeyringPair; - - before(async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const donor = await privateKey({filename: __filename}); - [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); - }); - }); - - async function testPreventsFromSettingAccessRightsNotAdminOrOwner(collection: UniqueNFTCollection | UniqueRFTCollection) { - await expect(collection.setTokenPropertyPermissions(bob, [{key: 'skullduggery', permission: {mutable: true, tokenOwner: true}}])) - .to.be.rejectedWith(/common\.NoPermission/); - - const propertyRights = await collection.getPropertyPermissions(['skullduggery']); - expect(propertyRights).to.be.empty; - } - - itSub('Prevents from setting access rights to properties of a NFT collection if not an onwer/admin', async ({helper}) => { - await testPreventsFromSettingAccessRightsNotAdminOrOwner(await helper.nft.mintCollection(alice)); - }); - - itSub.ifWithPallets('Prevents from setting access rights to properties of a ReFungible collection if not an onwer/admin', [Pallets.ReFungible], async ({helper}) => { - await testPreventsFromSettingAccessRightsNotAdminOrOwner(await helper.rft.mintCollection(alice)); - }); - - async function testPreventFromAddingTooManyPossibleProperties(collection: UniqueNFTCollection | UniqueRFTCollection) { - const constitution = []; - for (let i = 0; i < 65; i++) { - constitution.push({ - key: 'property_' + i, - permission: Math.random() > 0.5 ? {mutable: true, collectionAdmin: true, tokenOwner: true} : {}, - }); - } - - await expect(collection.setTokenPropertyPermissions(alice, constitution)) - .to.be.rejectedWith(/common\.PropertyLimitReached/); - - const propertyRights = await collection.getPropertyPermissions(); - expect(propertyRights).to.be.empty; - } - - itSub('Prevents from adding too many possible properties (NFT)', async ({helper}) => { - await testPreventFromAddingTooManyPossibleProperties(await helper.nft.mintCollection(alice)); - }); - - itSub.ifWithPallets('Prevents from adding too many possible properties (ReFungible)', [Pallets.ReFungible], async ({helper}) => { - await testPreventFromAddingTooManyPossibleProperties(await helper.rft.mintCollection(alice)); - }); - - async function testPreventAccessRightsModifiedIfConstant(collection: UniqueNFTCollection | UniqueRFTCollection) { - await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: false, tokenOwner: true}}])) - .to.be.fulfilled; - - await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {collectionAdmin: true}}])) - .to.be.rejectedWith(/common\.NoPermission/); - - const propertyRights = await collection.getPropertyPermissions(['skullduggery']); - expect(propertyRights).to.deep.equal([ - {key: 'skullduggery', permission: {'mutable': false, 'collectionAdmin': false, 'tokenOwner': true}}, - ]); - } - - itSub('Prevents access rights to be modified if constant (NFT)', async ({helper}) => { - await testPreventAccessRightsModifiedIfConstant(await helper.nft.mintCollection(alice)); - }); - - itSub.ifWithPallets('Prevents access rights to be modified if constant (ReFungible)', [Pallets.ReFungible], async ({helper}) => { - await testPreventAccessRightsModifiedIfConstant(await helper.rft.mintCollection(alice)); - }); - - async function testPreventsAddingPropertiesWithInvalidNames(collection: UniqueNFTCollection | UniqueRFTCollection) { - const invalidProperties = [ - [{key: 'skullduggery', permission: {tokenOwner: true}}, {key: 'im possible', permission: {collectionAdmin: true}}], - [{key: 'G#4', permission: {tokenOwner: true}}], - [{key: 'HÆMILTON', permission: {mutable: false, collectionAdmin: true, tokenOwner: true}}], - ]; - - for (let i = 0; i < invalidProperties.length; i++) { - await expect( - collection.setTokenPropertyPermissions(alice, invalidProperties[i]), - `on setting the new badly-named property #${i}`, - ).to.be.rejectedWith(/common\.InvalidCharacterInPropertyKey/); - } - - await expect( - collection.setTokenPropertyPermissions(alice, [{key: '', permission: {}}]), - 'on rejecting an unnamed property', - ).to.be.rejectedWith(/common\.EmptyPropertyKey/); - - const correctKey = '--0x03116e387820CA05'; // PolkadotJS would parse this as an already encoded hex-string - await expect( - collection.setTokenPropertyPermissions(alice, [ - {key: correctKey, permission: {collectionAdmin: true}}, - ]), - 'on setting the correctly-but-still-badly-named property', - ).to.be.fulfilled; - - const keys = invalidProperties.flatMap(propertySet => propertySet.map(property => property.key)).concat(correctKey).concat(''); - - const propertyRights = await collection.getPropertyPermissions(keys); - expect(propertyRights).to.be.deep.equal([ - {key: correctKey, permission: {mutable: false, collectionAdmin: true, tokenOwner: false}}, - ]); - } - - itSub('Prevents adding properties with invalid names (NFT)', async ({helper}) => { - await testPreventsAddingPropertiesWithInvalidNames(await helper.nft.mintCollection(alice)); - }); - - itSub.ifWithPallets('Prevents adding properties with invalid names (ReFungible)', [Pallets.ReFungible], async ({helper}) => { - await testPreventsAddingPropertiesWithInvalidNames(await helper.rft.mintCollection(alice)); - }); -}); - -// ---------- TOKEN PROPERTIES - -describe('Integration Test: Token Properties', () => { - let alice: IKeyringPair; // collection owner - let bob: IKeyringPair; // collection admin - let charlie: IKeyringPair; // token owner - - let permissions: {permission: any, signers: IKeyringPair[]}[]; - - before(async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const donor = await privateKey({filename: __filename}); - [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); - }); - - // todo:playgrounds probably separate these tests later - permissions = [ - {permission: {mutable: true, collectionAdmin: true}, signers: [alice, bob]}, - {permission: {mutable: false, collectionAdmin: true}, signers: [alice, bob]}, - {permission: {mutable: true, tokenOwner: true}, signers: [charlie]}, - {permission: {mutable: false, tokenOwner: true}, signers: [charlie]}, - {permission: {mutable: true, collectionAdmin: true, tokenOwner: true}, signers: [alice, bob, charlie]}, - {permission: {mutable: false, collectionAdmin: true, tokenOwner: true}, signers: [alice, bob, charlie]}, - ]; - }); - - async function testReadsYetEmptyProperties(token: UniqueNFToken | UniqueRFToken) { - const properties = await token.getProperties(); - expect(properties).to.be.empty; - - const tokenData = await token.getData(); - expect(tokenData!.properties).to.be.empty; - } - - itSub('Reads yet empty properties of a token (NFT)', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice); - const token = await collection.mintToken(alice); - await testReadsYetEmptyProperties(token); - }); - - itSub.ifWithPallets('Reads yet empty properties of a token (ReFungible)', [Pallets.ReFungible], async ({helper}) => { - const collection = await helper.rft.mintCollection(alice); - const token = await collection.mintToken(alice); - await testReadsYetEmptyProperties(token); - }); - - async function testAssignPropertiesAccordingToPermissions(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { - await token.collection.addAdmin(alice, {Substrate: bob.address}); - await token.transfer(alice, {Substrate: charlie.address}, pieces); - - const propertyKeys: string[] = []; - let i = 0; - for (const permission of permissions) { - i++; - let j = 0; - for (const signer of permission.signers) { - j++; - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect( - token.collection.setTokenPropertyPermissions(alice, [{key: key, permission: permission.permission}]), - `on setting permission #${i} by alice`, - ).to.be.fulfilled; - - await expect( - token.setProperties(signer, [{key: key, value: 'Serotonin increase'}]), - `on adding property #${i} by signer #${j}`, - ).to.be.fulfilled; - } - } - - const properties = await token.getProperties(propertyKeys); - const tokenData = await token.getData(); - for (let i = 0; i < properties.length; i++) { - expect(properties[i].value).to.be.equal('Serotonin increase'); - expect(tokenData!.properties[i].value).to.be.equal('Serotonin increase'); - } - } - - itSub('Assigns properties to a token according to permissions (NFT)', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice); - const token = await collection.mintToken(alice); - await testAssignPropertiesAccordingToPermissions(token, 1n); - }); - - itSub.ifWithPallets('Assigns properties to a token according to permissions (ReFungible)', [Pallets.ReFungible], async ({helper}) => { - const collection = await helper.rft.mintCollection(alice); - const token = await collection.mintToken(alice, 100n); - await testAssignPropertiesAccordingToPermissions(token, 100n); - }); - - async function testChangesPropertiesAccordingPermission(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { - await token.collection.addAdmin(alice, {Substrate: bob.address}); - await token.transfer(alice, {Substrate: charlie.address}, pieces); - - const propertyKeys: string[] = []; - let i = 0; - for (const permission of permissions) { - i++; - if (!permission.permission.mutable) continue; - - let j = 0; - for (const signer of permission.signers) { - j++; - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect( - token.collection.setTokenPropertyPermissions(alice, [{key: key, permission: permission.permission}]), - `on setting permission #${i} by alice`, - ).to.be.fulfilled; - - await expect( - token.setProperties(signer, [{key, value: 'Serotonin increase'}]), - `on adding property #${i} by signer #${j}`, - ).to.be.fulfilled; - - await expect( - token.setProperties(signer, [{key, value: 'Serotonin stable'}]), - `on changing property #${i} by signer #${j}`, - ).to.be.fulfilled; - } - } - - const properties = await token.getProperties(propertyKeys); - const tokenData = await token.getData(); - for (let i = 0; i < properties.length; i++) { - expect(properties[i].value).to.be.equal('Serotonin stable'); - expect(tokenData!.properties[i].value).to.be.equal('Serotonin stable'); - } - } - - itSub('Changes properties of a token according to permissions (NFT)', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice); - const token = await collection.mintToken(alice); - await testChangesPropertiesAccordingPermission(token, 1n); - }); - - itSub.ifWithPallets('Changes properties of a token according to permissions (ReFungible)', [Pallets.ReFungible], async ({helper}) => { - const collection = await helper.rft.mintCollection(alice); - const token = await collection.mintToken(alice, 100n); - await testChangesPropertiesAccordingPermission(token, 100n); - }); - - async function testDeletePropertiesAccordingPermission(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { - await token.collection.addAdmin(alice, {Substrate: bob.address}); - await token.transfer(alice, {Substrate: charlie.address}, pieces); - - const propertyKeys: string[] = []; - let i = 0; - - for (const permission of permissions) { - i++; - if (!permission.permission.mutable) continue; - - let j = 0; - for (const signer of permission.signers) { - j++; - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect( - token.collection.setTokenPropertyPermissions(alice, [{key: key, permission: permission.permission}]), - `on setting permission #${i} by alice`, - ).to.be.fulfilled; - - await expect( - token.setProperties(signer, [{key, value: 'Serotonin increase'}]), - `on adding property #${i} by signer #${j}`, - ).to.be.fulfilled; - - await expect( - token.deleteProperties(signer, [key]), - `on deleting property #${i} by signer #${j}`, - ).to.be.fulfilled; - } - } - - expect(await token.getProperties(propertyKeys)).to.be.empty; - expect((await token.getData())!.properties).to.be.empty; - } - - itSub('Deletes properties of a token according to permissions (NFT)', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice); - const token = await collection.mintToken(alice); - await testDeletePropertiesAccordingPermission(token, 1n); - }); - - itSub.ifWithPallets('Deletes properties of a token according to permissions (ReFungible)', [Pallets.ReFungible], async ({helper}) => { - const collection = await helper.rft.mintCollection(alice); - const token = await collection.mintToken(alice, 100n); - await testDeletePropertiesAccordingPermission(token, 100n); - }); - - itSub('Assigns properties to a nested token according to permissions', async ({helper}) => { - const collectionA = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); - const collectionB = await helper.nft.mintCollection(alice); - const targetToken = await collectionA.mintToken(alice); - const nestedToken = await collectionB.mintToken(alice, targetToken.nestingAccount()); - - await collectionB.addAdmin(alice, {Substrate: bob.address}); - await targetToken.transfer(alice, {Substrate: charlie.address}); - - const propertyKeys: string[] = []; - let i = 0; - for (const permission of permissions) { - i++; - let j = 0; - for (const signer of permission.signers) { - j++; - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect( - nestedToken.collection.setTokenPropertyPermissions(alice, [{key: key, permission: permission.permission}]), - `on setting permission #${i} by alice`, - ).to.be.fulfilled; - - await expect( - nestedToken.setProperties(signer, [{key, value: 'Serotonin increase'}]), - `on adding property #${i} by signer #${j}`, - ).to.be.fulfilled; - } - } - - const properties = await nestedToken.getProperties(propertyKeys); - const tokenData = await nestedToken.getData(); - for (let i = 0; i < properties.length; i++) { - expect(properties[i].value).to.be.equal('Serotonin increase'); - expect(tokenData!.properties[i].value).to.be.equal('Serotonin increase'); - } - expect(await targetToken.getProperties()).to.be.empty; - }); - - itSub('Changes properties of a nested token according to permissions', async ({helper}) => { - const collectionA = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); - const collectionB = await helper.nft.mintCollection(alice); - const targetToken = await collectionA.mintToken(alice); - const nestedToken = await collectionB.mintToken(alice, targetToken.nestingAccount()); - - await collectionB.addAdmin(alice, {Substrate: bob.address}); - await targetToken.transfer(alice, {Substrate: charlie.address}); - - const propertyKeys: string[] = []; - let i = 0; - for (const permission of permissions) { - i++; - if (!permission.permission.mutable) continue; - - let j = 0; - for (const signer of permission.signers) { - j++; - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect( - nestedToken.collection.setTokenPropertyPermissions(alice, [{key: key, permission: permission.permission}]), - `on setting permission #${i} by alice`, - ).to.be.fulfilled; - - await expect( - nestedToken.setProperties(signer, [{key, value: 'Serotonin increase'}]), - `on adding property #${i} by signer #${j}`, - ).to.be.fulfilled; - - await expect( - nestedToken.setProperties(signer, [{key, value: 'Serotonin stable'}]), - `on changing property #${i} by signer #${j}`, - ).to.be.fulfilled; - } - } - - const properties = await nestedToken.getProperties(propertyKeys); - const tokenData = await nestedToken.getData(); - for (let i = 0; i < properties.length; i++) { - expect(properties[i].value).to.be.equal('Serotonin stable'); - expect(tokenData!.properties[i].value).to.be.equal('Serotonin stable'); - } - expect(await targetToken.getProperties()).to.be.empty; - }); - - itSub('Deletes properties of a nested token according to permissions', async ({helper}) => { - const collectionA = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); - const collectionB = await helper.nft.mintCollection(alice); - const targetToken = await collectionA.mintToken(alice); - const nestedToken = await collectionB.mintToken(alice, targetToken.nestingAccount()); - - await collectionB.addAdmin(alice, {Substrate: bob.address}); - await targetToken.transfer(alice, {Substrate: charlie.address}); - - const propertyKeys: string[] = []; - let i = 0; - for (const permission of permissions) { - i++; - if (!permission.permission.mutable) continue; - - let j = 0; - for (const signer of permission.signers) { - j++; - const key = i + '_' + signer.address; - propertyKeys.push(key); - - await expect( - nestedToken.collection.setTokenPropertyPermissions(alice, [{key: key, permission: permission.permission}]), - `on setting permission #${i} by alice`, - ).to.be.fulfilled; - - await expect( - nestedToken.setProperties(signer, [{key, value: 'Serotonin increase'}]), - `on adding property #${i} by signer #${j}`, - ).to.be.fulfilled; - - await expect( - nestedToken.deleteProperties(signer, [key]), - `on deleting property #${i} by signer #${j}`, - ).to.be.fulfilled; - } - } - - expect(await nestedToken.getProperties(propertyKeys)).to.be.empty; - expect((await nestedToken.getData())!.properties).to.be.empty; - expect(await targetToken.getProperties()).to.be.empty; - }); -}); - -describe('Negative Integration Test: Token Properties', () => { - let alice: IKeyringPair; // collection owner - let bob: IKeyringPair; // collection admin - let charlie: IKeyringPair; // token owner - - let constitution: {permission: any, signers: IKeyringPair[], sinner: IKeyringPair}[]; - - before(async () => { - await usingPlaygrounds(async (helper, privateKey) => { - const donor = await privateKey({filename: __filename}); - let dave: IKeyringPair; - [alice, bob, charlie, dave] = await helper.arrange.createAccounts([100n, 100n, 100n, 100n], donor); - - // todo:playgrounds probably separate these tests later - constitution = [ - {permission: {mutable: true, collectionAdmin: true}, signers: [alice, bob], sinner: charlie}, - {permission: {mutable: false, collectionAdmin: true}, signers: [alice, bob], sinner: charlie}, - {permission: {mutable: true, tokenOwner: true}, signers: [charlie], sinner: alice}, - {permission: {mutable: false, tokenOwner: true}, signers: [charlie], sinner: alice}, - {permission: {mutable: true, collectionAdmin: true, tokenOwner: true}, signers: [alice, bob, charlie], sinner: dave}, - {permission: {mutable: false, collectionAdmin: true, tokenOwner: true}, signers: [alice, bob, charlie], sinner: dave}, - ]; - }); - }); - - async function getConsumedSpace(api: any, collectionId: number, tokenId: number, mode: 'NFT' | 'RFT'): Promise { - return (await (mode == 'NFT' ? api.query.nonfungible : api.query.refungible).tokenProperties(collectionId, tokenId)).toJSON().consumedSpace; - } - - async function prepare(token: UniqueNFToken | UniqueRFToken, pieces: bigint): Promise { - await token.collection.addAdmin(alice, {Substrate: bob.address}); - await token.transfer(alice, {Substrate: charlie.address}, pieces); - - let i = 0; - for (const passage of constitution) { - i++; - const signer = passage.signers[0]; - - await expect( - token.collection.setTokenPropertyPermissions(alice, [{key: `${i}`, permission: passage.permission}]), - `on setting permission ${i} by alice`, - ).to.be.fulfilled; - - await expect( - token.setProperties(signer, [{key: `${i}`, value: 'Serotonin increase'}]), - `on adding property ${i} by ${signer.address}`, - ).to.be.fulfilled; - } - - const originalSpace = await getConsumedSpace(token.collection.helper.getApi(), token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); - return originalSpace; - } - - async function testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { - const originalSpace = await prepare(token, pieces); - - let i = 0; - for (const forbiddance of constitution) { - i++; - if (!forbiddance.permission.mutable) continue; - - await expect( - token.setProperties(forbiddance.sinner, [{key: `${i}`, value: 'Serotonin down'}]), - `on failing to change property ${i} by the malefactor`, - ).to.be.rejectedWith(/common\.NoPermission/); - - await expect( - token.deleteProperties(forbiddance.sinner, [`${i}`]), - `on failing to delete property ${i} by the malefactor`, - ).to.be.rejectedWith(/common\.NoPermission/); - } - - const consumedSpace = await getConsumedSpace(token.collection.helper.getApi(), token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); - expect(consumedSpace).to.be.equal(originalSpace); - } - - itSub('Forbids changing/deleting properties of a token if the user is outside of permissions (NFT)', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice); - const token = await collection.mintToken(alice); - await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(token, 1n); - }); - - itSub.ifWithPallets('Forbids changing/deleting properties of a token if the user is outside of permissions (ReFungible)', [Pallets.ReFungible], async ({helper}) => { - const collection = await helper.rft.mintCollection(alice); - const token = await collection.mintToken(alice, 100n); - await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(token, 100n); - }); - - async function testForbidsChangingDeletingPropertiesIfPropertyImmutable(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { - const originalSpace = await prepare(token, pieces); - - let i = 0; - for (const permission of constitution) { - i++; - if (permission.permission.mutable) continue; - - await expect( - token.setProperties(permission.signers[0], [{key: `${i}`, value: 'Serotonin down'}]), - `on failing to change property ${i} by signer #0`, - ).to.be.rejectedWith(/common\.NoPermission/); - - await expect( - token.deleteProperties(permission.signers[0], [i.toString()]), - `on failing to delete property ${i} by signer #0`, - ).to.be.rejectedWith(/common\.NoPermission/); - } - - const consumedSpace = await getConsumedSpace(token.collection.helper.getApi(), token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); - expect(consumedSpace).to.be.equal(originalSpace); - } - - itSub('Forbids changing/deleting properties of a token if the property is permanent (immutable) (NFT)', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice); - const token = await collection.mintToken(alice); - await testForbidsChangingDeletingPropertiesIfPropertyImmutable(token, 1n); - }); - - itSub.ifWithPallets('Forbids changing/deleting properties of a token if the property is permanent (immutable) (ReFungible)', [Pallets.ReFungible], async ({helper}) => { - const collection = await helper.rft.mintCollection(alice); - const token = await collection.mintToken(alice, 100n); - await testForbidsChangingDeletingPropertiesIfPropertyImmutable(token, 100n); - }); - - async function testForbidsAddingPropertiesIfPropertyNotDeclared(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { - const originalSpace = await prepare(token, pieces); - - await expect( - token.setProperties(alice, [{key: 'non-existent', value: 'I exist!'}]), - 'on failing to add a previously non-existent property', - ).to.be.rejectedWith(/common\.NoPermission/); - - await expect( - token.collection.setTokenPropertyPermissions(alice, [{key: 'now-existent', permission: {}}]), - 'on setting a new non-permitted property', - ).to.be.fulfilled; - - await expect( - token.setProperties(alice, [{key: 'now-existent', value: 'I exist!'}]), - 'on failing to add a property forbidden by the \'None\' permission', - ).to.be.rejectedWith(/common\.NoPermission/); - - expect(await token.getProperties(['non-existent', 'now-existent'])).to.be.empty; - - const consumedSpace = await getConsumedSpace(token.collection.helper.getApi(), token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); - expect(consumedSpace).to.be.equal(originalSpace); - } - - itSub('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (NFT)', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice); - const token = await collection.mintToken(alice); - await testForbidsAddingPropertiesIfPropertyNotDeclared(token, 1n); - }); - - itSub.ifWithPallets('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (ReFungible)', [Pallets.ReFungible], async ({helper}) => { - const collection = await helper.rft.mintCollection(alice); - const token = await collection.mintToken(alice, 100n); - await testForbidsAddingPropertiesIfPropertyNotDeclared(token, 100n); - }); - - async function testForbidsAddingTooManyProperties(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { - const originalSpace = await prepare(token, pieces); - - await expect( - token.collection.setTokenPropertyPermissions(alice, [ - {key: 'a_holy_book', permission: {collectionAdmin: true, tokenOwner: true}}, - {key: 'young_years', permission: {collectionAdmin: true, tokenOwner: true}}, - ]), - 'on setting new permissions for properties', - ).to.be.fulfilled; - - // Mute the general tx parsing error - { - console.error = () => {}; - await expect(token.setProperties(alice, [{key: 'a_holy_book', value: 'word '.repeat(6554)}])) - .to.be.rejected; - } - - await expect(token.setProperties(alice, [ - {key: 'a_holy_book', value: 'word '.repeat(3277)}, - {key: 'young_years', value: 'neverending'.repeat(1490)}, - ])).to.be.rejectedWith(/common\.NoSpaceForProperty/); - - expect(await token.getProperties(['a_holy_book', 'young_years'])).to.be.empty; - const consumedSpace = await getConsumedSpace(token.collection.helper.getApi(), token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); - expect(consumedSpace).to.be.equal(originalSpace); - } - - itSub('Forbids adding too many properties to a token (NFT)', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice); - const token = await collection.mintToken(alice); - await testForbidsAddingTooManyProperties(token, 1n); - }); - - itSub.ifWithPallets('Forbids adding too many properties to a token (ReFungible)', [Pallets.ReFungible], async ({helper}) => { - const collection = await helper.rft.mintCollection(alice); - const token = await collection.mintToken(alice, 100n); - await testForbidsAddingTooManyProperties(token, 100n); - }); -}); - -describe('ReFungible token properties permissions tests', () => { - let alice: IKeyringPair; - let bob: IKeyringPair; - let charlie: IKeyringPair; - - before(async function() { - await usingPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); - - const donor = await privateKey({filename: __filename}); - [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); - }); - }); - - async function prepare(helper: UniqueHelper): Promise { - const collection = await helper.rft.mintCollection(alice); - const token = await collection.mintToken(alice, 100n); - - await collection.addAdmin(alice, {Substrate: bob.address}); - await collection.setTokenPropertyPermissions(alice, [{key: 'fractals', permission: {mutable: true, tokenOwner: true}}]); - - return token; - } - - itSub('Forbids adding token property with tokenOwner==true when signer doesn\'t have all pieces', async ({helper}) => { - const token = await prepare(helper); - - await token.transfer(alice, {Substrate: charlie.address}, 33n); - - await expect(token.setProperties(alice, [ - {key: 'fractals', value: 'multiverse'}, - ])).to.be.rejectedWith(/common\.NoPermission/); - }); - - itSub('Forbids mutating token property with tokenOwner==true when signer doesn\'t have all pieces', async ({helper}) => { - const token = await prepare(helper); - - await expect(token.collection.setTokenPropertyPermissions(alice, [{key: 'fractals', permission: {mutable:true, tokenOwner: true}}])) - .to.be.fulfilled; - - await expect(token.setProperties(alice, [ - {key: 'fractals', value: 'multiverse'}, - ])).to.be.fulfilled; - - await token.transfer(alice, {Substrate: charlie.address}, 33n); - - await expect(token.setProperties(alice, [ - {key: 'fractals', value: 'want to rule the world'}, - ])).to.be.rejectedWith(/common\.NoPermission/); - }); - - itSub('Forbids deleting token property with tokenOwner==true when signer doesn\'t have all pieces', async ({helper}) => { - const token = await prepare(helper); - - await expect(token.setProperties(alice, [ - {key: 'fractals', value: 'one headline - why believe it'}, - ])).to.be.fulfilled; - - await token.transfer(alice, {Substrate: charlie.address}, 33n); - - await expect(token.deleteProperties(alice, ['fractals'])). - to.be.rejectedWith(/common\.NoPermission/); - }); - - itSub('Allows token property mutation with collectionOwner==true when admin doesn\'t have all pieces', async ({helper}) => { - const token = await prepare(helper); - - await token.transfer(alice, {Substrate: charlie.address}, 33n); - - await expect(token.collection.setTokenPropertyPermissions(alice, [{key: 'fractals', permission: {mutable:true, collectionAdmin: true}}])) - .to.be.fulfilled; - - await expect(token.setProperties(alice, [ - {key: 'fractals', value: 'multiverse'}, - ])).to.be.fulfilled; - }); -}); diff --git a/tests/src/nesting/propertyPermissions.test.ts b/tests/src/nesting/propertyPermissions.test.ts new file mode 100644 index 0000000000..9c5ae2d1eb --- /dev/null +++ b/tests/src/nesting/propertyPermissions.test.ts @@ -0,0 +1,198 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import {IKeyringPair} from '@polkadot/types/types'; +import {itSub, Pallets, usingPlaygrounds, expect} from '../util/playgrounds'; +import {UniqueNFTCollection, UniqueRFTCollection} from '../util/playgrounds/unique'; + +describe('Integration Test: Access Rights to Token Properties', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = await privateKey({filename: __filename}); + [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor); + }); + }); + + itSub('Reads access rights to properties of a collection', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const propertyRights = (await helper.callRpc('api.query.common.collectionPropertyPermissions', [collection.collectionId])).toJSON(); + expect(propertyRights).to.be.empty; + }); + + async function testSetsAccessRightsToProperties(collection: UniqueNFTCollection | UniqueRFTCollection) { + await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: true}}])) + .to.be.fulfilled; + + await collection.addAdmin(alice, {Substrate: bob.address}); + + await expect(collection.setTokenPropertyPermissions(bob, [{key: 'mindgame', permission: {collectionAdmin: true, tokenOwner: false}}])) + .to.be.fulfilled; + + const propertyRights = await collection.getPropertyPermissions(['skullduggery', 'mindgame']); + expect(propertyRights).to.include.deep.members([ + {key: 'skullduggery', permission: {mutable: true, collectionAdmin: false, tokenOwner: false}}, + {key: 'mindgame', permission: {mutable: false, collectionAdmin: true, tokenOwner: false}}, + ]); + } + + itSub('Sets access rights to properties of a collection (NFT)', async ({helper}) => { + await testSetsAccessRightsToProperties(await helper.nft.mintCollection(alice)); + }); + + itSub.ifWithPallets('Sets access rights to properties of a collection (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + await testSetsAccessRightsToProperties(await helper.rft.mintCollection(alice)); + }); + + async function testChangesAccessRightsToProperty(collection: UniqueNFTCollection | UniqueRFTCollection) { + await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: true, collectionAdmin: true}}])) + .to.be.fulfilled; + + await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: false, tokenOwner: true}}])) + .to.be.fulfilled; + + const propertyRights = await collection.getPropertyPermissions(); + expect(propertyRights).to.be.deep.equal([ + {key: 'skullduggery', permission: {'mutable': false, 'collectionAdmin': false, 'tokenOwner': true}}, + ]); + } + + itSub('Changes access rights to properties of a NFT collection', async ({helper}) => { + await testChangesAccessRightsToProperty(await helper.nft.mintCollection(alice)); + }); + + itSub.ifWithPallets('Changes access rights to properties of a ReFungible collection', [Pallets.ReFungible], async ({helper}) => { + await testChangesAccessRightsToProperty(await helper.rft.mintCollection(alice)); + }); +}); + +describe('Negative Integration Test: Access Rights to Token Properties', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = await privateKey({filename: __filename}); + [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor); + }); + }); + + async function testPreventsFromSettingAccessRightsNotAdminOrOwner(collection: UniqueNFTCollection | UniqueRFTCollection) { + await expect(collection.setTokenPropertyPermissions(bob, [{key: 'skullduggery', permission: {mutable: true, tokenOwner: true}}])) + .to.be.rejectedWith(/common\.NoPermission/); + + const propertyRights = await collection.getPropertyPermissions(['skullduggery']); + expect(propertyRights).to.be.empty; + } + + itSub('Prevents from setting access rights to properties of a NFT collection if not an onwer/admin', async ({helper}) => { + await testPreventsFromSettingAccessRightsNotAdminOrOwner(await helper.nft.mintCollection(alice)); + }); + + itSub.ifWithPallets('Prevents from setting access rights to properties of a ReFungible collection if not an onwer/admin', [Pallets.ReFungible], async ({helper}) => { + await testPreventsFromSettingAccessRightsNotAdminOrOwner(await helper.rft.mintCollection(alice)); + }); + + async function testPreventFromAddingTooManyPossibleProperties(collection: UniqueNFTCollection | UniqueRFTCollection) { + const constitution = []; + for (let i = 0; i < 65; i++) { + constitution.push({ + key: 'property_' + i, + permission: Math.random() > 0.5 ? {mutable: true, collectionAdmin: true, tokenOwner: true} : {}, + }); + } + + await expect(collection.setTokenPropertyPermissions(alice, constitution)) + .to.be.rejectedWith(/common\.PropertyLimitReached/); + + const propertyRights = await collection.getPropertyPermissions(); + expect(propertyRights).to.be.empty; + } + + itSub('Prevents from adding too many possible properties (NFT)', async ({helper}) => { + await testPreventFromAddingTooManyPossibleProperties(await helper.nft.mintCollection(alice)); + }); + + itSub.ifWithPallets('Prevents from adding too many possible properties (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + await testPreventFromAddingTooManyPossibleProperties(await helper.rft.mintCollection(alice)); + }); + + async function testPreventAccessRightsModifiedIfConstant(collection: UniqueNFTCollection | UniqueRFTCollection) { + await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {mutable: false, tokenOwner: true}}])) + .to.be.fulfilled; + + await expect(collection.setTokenPropertyPermissions(alice, [{key: 'skullduggery', permission: {collectionAdmin: true}}])) + .to.be.rejectedWith(/common\.NoPermission/); + + const propertyRights = await collection.getPropertyPermissions(['skullduggery']); + expect(propertyRights).to.deep.equal([ + {key: 'skullduggery', permission: {'mutable': false, 'collectionAdmin': false, 'tokenOwner': true}}, + ]); + } + + itSub('Prevents access rights to be modified if constant (NFT)', async ({helper}) => { + await testPreventAccessRightsModifiedIfConstant(await helper.nft.mintCollection(alice)); + }); + + itSub.ifWithPallets('Prevents access rights to be modified if constant (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + await testPreventAccessRightsModifiedIfConstant(await helper.rft.mintCollection(alice)); + }); + + async function testPreventsAddingPropertiesWithInvalidNames(collection: UniqueNFTCollection | UniqueRFTCollection) { + const invalidProperties = [ + [{key: 'skullduggery', permission: {tokenOwner: true}}, {key: 'im possible', permission: {collectionAdmin: true}}], + [{key: 'G#4', permission: {tokenOwner: true}}], + [{key: 'HÆMILTON', permission: {mutable: false, collectionAdmin: true, tokenOwner: true}}], + ]; + + for (let i = 0; i < invalidProperties.length; i++) { + await expect( + collection.setTokenPropertyPermissions(alice, invalidProperties[i]), + `on setting the new badly-named property #${i}`, + ).to.be.rejectedWith(/common\.InvalidCharacterInPropertyKey/); + } + + await expect( + collection.setTokenPropertyPermissions(alice, [{key: '', permission: {}}]), + 'on rejecting an unnamed property', + ).to.be.rejectedWith(/common\.EmptyPropertyKey/); + + const correctKey = '--0x03116e387820CA05'; // PolkadotJS would parse this as an already encoded hex-string + await expect( + collection.setTokenPropertyPermissions(alice, [ + {key: correctKey, permission: {collectionAdmin: true}}, + ]), + 'on setting the correctly-but-still-badly-named property', + ).to.be.fulfilled; + + const keys = invalidProperties.flatMap(propertySet => propertySet.map(property => property.key)).concat(correctKey).concat(''); + + const propertyRights = await collection.getPropertyPermissions(keys); + expect(propertyRights).to.be.deep.equal([ + {key: correctKey, permission: {mutable: false, collectionAdmin: true, tokenOwner: false}}, + ]); + } + + itSub('Prevents adding properties with invalid names (NFT)', async ({helper}) => { + await testPreventsAddingPropertiesWithInvalidNames(await helper.nft.mintCollection(alice)); + }); + + itSub.ifWithPallets('Prevents adding properties with invalid names (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + await testPreventsAddingPropertiesWithInvalidNames(await helper.rft.mintCollection(alice)); + }); +}); \ No newline at end of file diff --git a/tests/src/nesting/tokenProperties.test.ts b/tests/src/nesting/tokenProperties.test.ts new file mode 100644 index 0000000000..808042ec6d --- /dev/null +++ b/tests/src/nesting/tokenProperties.test.ts @@ -0,0 +1,594 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import {IKeyringPair} from '@polkadot/types/types'; +import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../util/playgrounds'; +import {UniqueHelper, UniqueNFToken, UniqueRFToken} from '../util/playgrounds/unique'; + +describe('Integration Test: Token Properties', () => { + let alice: IKeyringPair; // collection owner + let bob: IKeyringPair; // collection admin + let charlie: IKeyringPair; // token owner + + let permissions: {permission: any, signers: IKeyringPair[]}[]; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = await privateKey({filename: __filename}); + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); + }); + + permissions = [ + {permission: {mutable: true, collectionAdmin: true}, signers: [alice, bob]}, + {permission: {mutable: false, collectionAdmin: true}, signers: [alice, bob]}, + {permission: {mutable: true, tokenOwner: true}, signers: [charlie]}, + {permission: {mutable: false, tokenOwner: true}, signers: [charlie]}, + {permission: {mutable: true, collectionAdmin: true, tokenOwner: true}, signers: [alice, bob, charlie]}, + {permission: {mutable: false, collectionAdmin: true, tokenOwner: true}, signers: [alice, bob, charlie]}, + ]; + }); + + async function mintCollectionWithAllPermissionsAndToken(helper: UniqueHelper, mode: 'NFT' | 'RFT'): Promise<[UniqueNFToken | UniqueRFToken, bigint]> { + const collection = await (mode == 'NFT' ? helper.nft : helper.rft).mintCollection(alice, { + tokenPropertyPermissions: permissions.flatMap(({permission, signers}, i) => + signers.map(signer => {return {key: `${i+1}_${signer.address}`, permission};})), + }); + return mode == 'NFT' ? [await collection.mintToken(alice), 1n] : [await collection.mintToken(alice, 100n), 100n]; + } + + async function testReadsYetEmptyProperties(token: UniqueNFToken | UniqueRFToken) { + const properties = await token.getProperties(); + expect(properties).to.be.empty; + + const tokenData = await token.getData(); + expect(tokenData!.properties).to.be.empty; + } + + itSub('Reads yet empty properties of a token (NFT)', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice); + const token = await collection.mintToken(alice); + await testReadsYetEmptyProperties(token); + }); + + itSub.ifWithPallets('Reads yet empty properties of a token (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice); + await testReadsYetEmptyProperties(token); + }); + + async function testAssignPropertiesAccordingToPermissions(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { + await token.collection.addAdmin(alice, {Substrate: bob.address}); + await token.transfer(alice, {Substrate: charlie.address}, pieces); + + const propertyKeys: string[] = []; + let i = 0; + for (const permission of permissions) { + i++; + let j = 0; + for (const signer of permission.signers) { + j++; + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect( + token.setProperties(signer, [{key: key, value: 'Serotonin increase'}]), + `on adding property #${i} by signer #${j}`, + ).to.be.fulfilled; + } + } + + const properties = await token.getProperties(propertyKeys); + const tokenData = await token.getData(); + for (let i = 0; i < properties.length; i++) { + expect(properties[i].value).to.be.equal('Serotonin increase'); + expect(tokenData!.properties[i].value).to.be.equal('Serotonin increase'); + } + } + + itSub('Assigns properties to a token according to permissions (NFT)', async ({helper}) => { + const [token, amount] = await mintCollectionWithAllPermissionsAndToken(helper, 'NFT'); + await testAssignPropertiesAccordingToPermissions(token, amount); + }); + + itSub.ifWithPallets('Assigns properties to a token according to permissions (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const [token, amount] = await mintCollectionWithAllPermissionsAndToken(helper, 'RFT'); + await testAssignPropertiesAccordingToPermissions(token, amount); + }); + + async function testChangesPropertiesAccordingPermission(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { + await token.collection.addAdmin(alice, {Substrate: bob.address}); + await token.transfer(alice, {Substrate: charlie.address}, pieces); + + const propertyKeys: string[] = []; + let i = 0; + for (const permission of permissions) { + i++; + if (!permission.permission.mutable) continue; + + let j = 0; + for (const signer of permission.signers) { + j++; + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect( + token.setProperties(signer, [{key, value: 'Serotonin increase'}]), + `on adding property #${i} by signer #${j}`, + ).to.be.fulfilled; + + await expect( + token.setProperties(signer, [{key, value: 'Serotonin stable'}]), + `on changing property #${i} by signer #${j}`, + ).to.be.fulfilled; + } + } + + const properties = await token.getProperties(propertyKeys); + const tokenData = await token.getData(); + for (let i = 0; i < properties.length; i++) { + expect(properties[i].value).to.be.equal('Serotonin stable'); + expect(tokenData!.properties[i].value).to.be.equal('Serotonin stable'); + } + } + + itSub('Changes properties of a token according to permissions (NFT)', async ({helper}) => { + const [token, amount] = await mintCollectionWithAllPermissionsAndToken(helper, 'NFT'); + await testChangesPropertiesAccordingPermission(token, amount); + }); + + itSub.ifWithPallets('Changes properties of a token according to permissions (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const [token, amount] = await mintCollectionWithAllPermissionsAndToken(helper, 'RFT'); + await testChangesPropertiesAccordingPermission(token, amount); + }); + + async function testDeletePropertiesAccordingPermission(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { + await token.collection.addAdmin(alice, {Substrate: bob.address}); + await token.transfer(alice, {Substrate: charlie.address}, pieces); + + const propertyKeys: string[] = []; + let i = 0; + + for (const permission of permissions) { + i++; + if (!permission.permission.mutable) continue; + + let j = 0; + for (const signer of permission.signers) { + j++; + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect( + token.setProperties(signer, [{key, value: 'Serotonin increase'}]), + `on adding property #${i} by signer #${j}`, + ).to.be.fulfilled; + + await expect( + token.deleteProperties(signer, [key]), + `on deleting property #${i} by signer #${j}`, + ).to.be.fulfilled; + } + } + + expect(await token.getProperties(propertyKeys)).to.be.empty; + expect((await token.getData())!.properties).to.be.empty; + } + + itSub('Deletes properties of a token according to permissions (NFT)', async ({helper}) => { + const [token, amount] = await mintCollectionWithAllPermissionsAndToken(helper, 'NFT'); + await testDeletePropertiesAccordingPermission(token, amount); + }); + + itSub.ifWithPallets('Deletes properties of a token according to permissions (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const [token, amount] = await mintCollectionWithAllPermissionsAndToken(helper, 'RFT'); + await testDeletePropertiesAccordingPermission(token, amount); + }); + + itSub('Assigns properties to a nested token according to permissions', async ({helper}) => { + const collectionA = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + const collectionB = await helper.nft.mintCollection(alice, { + tokenPropertyPermissions: permissions.flatMap(({permission, signers}, i) => + signers.map(signer => {return {key: `${i+1}_${signer.address}`, permission};})), + }); + const targetToken = await collectionA.mintToken(alice); + const nestedToken = await collectionB.mintToken(alice, targetToken.nestingAccount()); + + await collectionB.addAdmin(alice, {Substrate: bob.address}); + await targetToken.transfer(alice, {Substrate: charlie.address}); + + const propertyKeys: string[] = []; + let i = 0; + for (const permission of permissions) { + i++; + let j = 0; + for (const signer of permission.signers) { + j++; + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect( + nestedToken.setProperties(signer, [{key, value: 'Serotonin increase'}]), + `on adding property #${i} by signer #${j}`, + ).to.be.fulfilled; + } + } + + const properties = await nestedToken.getProperties(propertyKeys); + const tokenData = await nestedToken.getData(); + for (let i = 0; i < properties.length; i++) { + expect(properties[i].value).to.be.equal('Serotonin increase'); + expect(tokenData!.properties[i].value).to.be.equal('Serotonin increase'); + } + expect(await targetToken.getProperties()).to.be.empty; + }); + + itSub('Changes properties of a nested token according to permissions', async ({helper}) => { + const collectionA = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + const collectionB = await helper.nft.mintCollection(alice, { + tokenPropertyPermissions: permissions.flatMap(({permission, signers}, i) => + signers.map(signer => {return {key: `${i+1}_${signer.address}`, permission};})), + }); + const targetToken = await collectionA.mintToken(alice); + const nestedToken = await collectionB.mintToken(alice, targetToken.nestingAccount()); + + await collectionB.addAdmin(alice, {Substrate: bob.address}); + await targetToken.transfer(alice, {Substrate: charlie.address}); + + const propertyKeys: string[] = []; + let i = 0; + for (const permission of permissions) { + i++; + if (!permission.permission.mutable) continue; + + let j = 0; + for (const signer of permission.signers) { + j++; + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect( + nestedToken.setProperties(signer, [{key, value: 'Serotonin increase'}]), + `on adding property #${i} by signer #${j}`, + ).to.be.fulfilled; + + await expect( + nestedToken.setProperties(signer, [{key, value: 'Serotonin stable'}]), + `on changing property #${i} by signer #${j}`, + ).to.be.fulfilled; + } + } + + const properties = await nestedToken.getProperties(propertyKeys); + const tokenData = await nestedToken.getData(); + for (let i = 0; i < properties.length; i++) { + expect(properties[i].value).to.be.equal('Serotonin stable'); + expect(tokenData!.properties[i].value).to.be.equal('Serotonin stable'); + } + expect(await targetToken.getProperties()).to.be.empty; + }); + + itSub('Deletes properties of a nested token according to permissions', async ({helper}) => { + const collectionA = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}}); + const collectionB = await helper.nft.mintCollection(alice, { + tokenPropertyPermissions: permissions.flatMap(({permission, signers}, i) => + signers.map(signer => {return {key: `${i+1}_${signer.address}`, permission};})), + }); + const targetToken = await collectionA.mintToken(alice); + const nestedToken = await collectionB.mintToken(alice, targetToken.nestingAccount()); + + await collectionB.addAdmin(alice, {Substrate: bob.address}); + await targetToken.transfer(alice, {Substrate: charlie.address}); + + const propertyKeys: string[] = []; + let i = 0; + for (const permission of permissions) { + i++; + if (!permission.permission.mutable) continue; + + let j = 0; + for (const signer of permission.signers) { + j++; + const key = i + '_' + signer.address; + propertyKeys.push(key); + + await expect( + nestedToken.setProperties(signer, [{key, value: 'Serotonin increase'}]), + `on adding property #${i} by signer #${j}`, + ).to.be.fulfilled; + + await expect( + nestedToken.deleteProperties(signer, [key]), + `on deleting property #${i} by signer #${j}`, + ).to.be.fulfilled; + } + } + + expect(await nestedToken.getProperties(propertyKeys)).to.be.empty; + expect((await nestedToken.getData())!.properties).to.be.empty; + expect(await targetToken.getProperties()).to.be.empty; + }); +}); + +describe('Negative Integration Test: Token Properties', () => { + let alice: IKeyringPair; // collection owner + let bob: IKeyringPair; // collection admin + let charlie: IKeyringPair; // token owner + + let constitution: {permission: any, signers: IKeyringPair[], sinner: IKeyringPair}[]; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = await privateKey({filename: __filename}); + let dave: IKeyringPair; + [alice, bob, charlie, dave] = await helper.arrange.createAccounts([100n, 100n, 100n, 100n], donor); + + // todo:playgrounds probably separate these tests later + constitution = [ + {permission: {mutable: true, collectionAdmin: true}, signers: [alice, bob], sinner: charlie}, + {permission: {mutable: false, collectionAdmin: true}, signers: [alice, bob], sinner: charlie}, + {permission: {mutable: true, tokenOwner: true}, signers: [charlie], sinner: alice}, + {permission: {mutable: false, tokenOwner: true}, signers: [charlie], sinner: alice}, + {permission: {mutable: true, collectionAdmin: true, tokenOwner: true}, signers: [alice, bob, charlie], sinner: dave}, + {permission: {mutable: false, collectionAdmin: true, tokenOwner: true}, signers: [alice, bob, charlie], sinner: dave}, + ]; + }); + }); + + async function mintCollectionWithAllPermissionsAndToken(helper: UniqueHelper, mode: 'NFT' | 'RFT'): Promise<[UniqueNFToken | UniqueRFToken, bigint]> { + const collection = await (mode == 'NFT' ? helper.nft : helper.rft).mintCollection(alice, { + tokenPropertyPermissions: constitution.map(({permission}, i) => {return {key: `${i+1}`, permission};}), + }); + return mode == 'NFT' ? [await collection.mintToken(alice), 1n] : [await collection.mintToken(alice, 100n), 100n]; + } + + async function getConsumedSpace(api: any, collectionId: number, tokenId: number, mode: 'NFT' | 'RFT'): Promise { + return (await (mode == 'NFT' ? api.query.nonfungible : api.query.refungible).tokenProperties(collectionId, tokenId)).toJSON().consumedSpace; + } + + async function prepare(token: UniqueNFToken | UniqueRFToken, pieces: bigint): Promise { + await token.collection.addAdmin(alice, {Substrate: bob.address}); + await token.transfer(alice, {Substrate: charlie.address}, pieces); + + let i = 0; + for (const passage of constitution) { + i++; + const signer = passage.signers[0]; + await expect( + token.setProperties(signer, [{key: `${i}`, value: 'Serotonin increase'}]), + `on adding property ${i} by ${signer.address}`, + ).to.be.fulfilled; + } + + const originalSpace = await getConsumedSpace(token.collection.helper.getApi(), token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); + return originalSpace; + } + + async function testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { + const originalSpace = await prepare(token, pieces); + + let i = 0; + for (const forbiddance of constitution) { + i++; + if (!forbiddance.permission.mutable) continue; + + await expect( + token.setProperties(forbiddance.sinner, [{key: `${i}`, value: 'Serotonin down'}]), + `on failing to change property ${i} by the malefactor`, + ).to.be.rejectedWith(/common\.NoPermission/); + + await expect( + token.deleteProperties(forbiddance.sinner, [`${i}`]), + `on failing to delete property ${i} by the malefactor`, + ).to.be.rejectedWith(/common\.NoPermission/); + } + + const consumedSpace = await getConsumedSpace(token.collection.helper.getApi(), token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); + expect(consumedSpace).to.be.equal(originalSpace); + } + + itSub('Forbids changing/deleting properties of a token if the user is outside of permissions (NFT)', async ({helper}) => { + const [token, amount] = await mintCollectionWithAllPermissionsAndToken(helper, 'NFT'); + await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(token, amount); + }); + + itSub.ifWithPallets('Forbids changing/deleting properties of a token if the user is outside of permissions (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const [token, amount] = await mintCollectionWithAllPermissionsAndToken(helper, 'RFT'); + await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions(token, amount); + }); + + async function testForbidsChangingDeletingPropertiesIfPropertyImmutable(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { + const originalSpace = await prepare(token, pieces); + + let i = 0; + for (const permission of constitution) { + i++; + if (permission.permission.mutable) continue; + + await expect( + token.setProperties(permission.signers[0], [{key: `${i}`, value: 'Serotonin down'}]), + `on failing to change property ${i} by signer #0`, + ).to.be.rejectedWith(/common\.NoPermission/); + + await expect( + token.deleteProperties(permission.signers[0], [i.toString()]), + `on failing to delete property ${i} by signer #0`, + ).to.be.rejectedWith(/common\.NoPermission/); + } + + const consumedSpace = await getConsumedSpace(token.collection.helper.getApi(), token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); + expect(consumedSpace).to.be.equal(originalSpace); + } + + itSub('Forbids changing/deleting properties of a token if the property is permanent (immutable) (NFT)', async ({helper}) => { + const [token, amount] = await mintCollectionWithAllPermissionsAndToken(helper, 'NFT'); + await testForbidsChangingDeletingPropertiesIfPropertyImmutable(token, amount); + }); + + itSub.ifWithPallets('Forbids changing/deleting properties of a token if the property is permanent (immutable) (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const [token, amount] = await mintCollectionWithAllPermissionsAndToken(helper, 'RFT'); + await testForbidsChangingDeletingPropertiesIfPropertyImmutable(token, amount); + }); + + async function testForbidsAddingPropertiesIfPropertyNotDeclared(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { + const originalSpace = await prepare(token, pieces); + + await expect( + token.setProperties(alice, [{key: 'non-existent', value: 'I exist!'}]), + 'on failing to add a previously non-existent property', + ).to.be.rejectedWith(/common\.NoPermission/); + + await expect( + token.collection.setTokenPropertyPermissions(alice, [{key: 'now-existent', permission: {}}]), + 'on setting a new non-permitted property', + ).to.be.fulfilled; + + await expect( + token.setProperties(alice, [{key: 'now-existent', value: 'I exist!'}]), + 'on failing to add a property forbidden by the \'None\' permission', + ).to.be.rejectedWith(/common\.NoPermission/); + + expect(await token.getProperties(['non-existent', 'now-existent'])).to.be.empty; + + const consumedSpace = await getConsumedSpace(token.collection.helper.getApi(), token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); + expect(consumedSpace).to.be.equal(originalSpace); + } + + itSub('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (NFT)', async ({helper}) => { + const [token, amount] = await mintCollectionWithAllPermissionsAndToken(helper, 'NFT'); + await testForbidsAddingPropertiesIfPropertyNotDeclared(token, amount); + }); + + itSub.ifWithPallets('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const [token, amount] = await mintCollectionWithAllPermissionsAndToken(helper, 'RFT'); + await testForbidsAddingPropertiesIfPropertyNotDeclared(token, amount); + }); + + async function testForbidsAddingTooManyProperties(token: UniqueNFToken | UniqueRFToken, pieces: bigint) { + const originalSpace = await prepare(token, pieces); + + await expect( + token.collection.setTokenPropertyPermissions(alice, [ + {key: 'a_holy_book', permission: {collectionAdmin: true, tokenOwner: true}}, + {key: 'young_years', permission: {collectionAdmin: true, tokenOwner: true}}, + ]), + 'on setting new permissions for properties', + ).to.be.fulfilled; + + // Mute the general tx parsing error + { + console.error = () => {}; + await expect(token.setProperties(alice, [{key: 'a_holy_book', value: 'word '.repeat(6554)}])) + .to.be.rejected; + } + + await expect(token.setProperties(alice, [ + {key: 'a_holy_book', value: 'word '.repeat(3277)}, + {key: 'young_years', value: 'neverending'.repeat(1490)}, + ])).to.be.rejectedWith(/common\.NoSpaceForProperty/); + + expect(await token.getProperties(['a_holy_book', 'young_years'])).to.be.empty; + const consumedSpace = await getConsumedSpace(token.collection.helper.getApi(), token.collectionId, token.tokenId, pieces == 1n ? 'NFT' : 'RFT'); + expect(consumedSpace).to.be.equal(originalSpace); + } + + itSub('Forbids adding too many properties to a token (NFT)', async ({helper}) => { + const [token, amount] = await mintCollectionWithAllPermissionsAndToken(helper, 'NFT'); + await testForbidsAddingTooManyProperties(token, amount); + }); + + itSub.ifWithPallets('Forbids adding too many properties to a token (ReFungible)', [Pallets.ReFungible], async ({helper}) => { + const [token, amount] = await mintCollectionWithAllPermissionsAndToken(helper, 'RFT'); + await testForbidsAddingTooManyProperties(token, amount); + }); +}); + +describe('ReFungible token properties permissions tests', () => { + let alice: IKeyringPair; + let bob: IKeyringPair; + let charlie: IKeyringPair; + + before(async function() { + await usingPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + + const donor = await privateKey({filename: __filename}); + [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); + }); + }); + + async function prepare(helper: UniqueHelper): Promise { + const collection = await helper.rft.mintCollection(alice); + const token = await collection.mintToken(alice, 100n); + + await collection.addAdmin(alice, {Substrate: bob.address}); + await collection.setTokenPropertyPermissions(alice, [{key: 'fractals', permission: {mutable: true, tokenOwner: true}}]); + + return token; + } + + itSub('Forbids adding token property with tokenOwner==true when signer doesn\'t have all pieces', async ({helper}) => { + const token = await prepare(helper); + + await token.transfer(alice, {Substrate: charlie.address}, 33n); + + await expect(token.setProperties(alice, [ + {key: 'fractals', value: 'multiverse'}, + ])).to.be.rejectedWith(/common\.NoPermission/); + }); + + itSub('Forbids mutating token property with tokenOwner==true when signer doesn\'t have all pieces', async ({helper}) => { + const token = await prepare(helper); + + await expect(token.collection.setTokenPropertyPermissions(alice, [{key: 'fractals', permission: {mutable:true, tokenOwner: true}}])) + .to.be.fulfilled; + + await expect(token.setProperties(alice, [ + {key: 'fractals', value: 'multiverse'}, + ])).to.be.fulfilled; + + await token.transfer(alice, {Substrate: charlie.address}, 33n); + + await expect(token.setProperties(alice, [ + {key: 'fractals', value: 'want to rule the world'}, + ])).to.be.rejectedWith(/common\.NoPermission/); + }); + + itSub('Forbids deleting token property with tokenOwner==true when signer doesn\'t have all pieces', async ({helper}) => { + const token = await prepare(helper); + + await expect(token.setProperties(alice, [ + {key: 'fractals', value: 'one headline - why believe it'}, + ])).to.be.fulfilled; + + await token.transfer(alice, {Substrate: charlie.address}, 33n); + + await expect(token.deleteProperties(alice, ['fractals'])). + to.be.rejectedWith(/common\.NoPermission/); + }); + + itSub('Allows token property mutation with collectionOwner==true when admin doesn\'t have all pieces', async ({helper}) => { + const token = await prepare(helper); + + await token.transfer(alice, {Substrate: charlie.address}, 33n); + + await expect(token.collection.setTokenPropertyPermissions(alice, [{key: 'fractals', permission: {mutable:true, collectionAdmin: true}}])) + .to.be.fulfilled; + + await expect(token.setProperties(alice, [ + {key: 'fractals', value: 'multiverse'}, + ])).to.be.fulfilled; + }); +}); From a5bd6fad4f0f209f332ccd056bfd7e609171d354 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 7 Oct 2022 17:47:35 +0000 Subject: [PATCH 1079/1274] tests(rmrk+outdated): refactor old helpers and rmrk to get rid of warnings --- tests/src/deprecated-helpers/helpers.ts | 8 +- ...acceptNft.test.ts => acceptNft.seqtest.ts} | 0 ...esource.test.ts => addResource.seqtest.ts} | 100 +++++++------- .../{addTheme.test.ts => addTheme.seqtest.ts} | 0 .../{burnNft.test.ts => burnNft.seqtest.ts} | 52 ++++---- ...t.ts => changeCollectionIssuer.seqtest.ts} | 16 +-- ...eateBase.test.ts => createBase.seqtest.ts} | 0 ...on.test.ts => createCollection.seqtest.ts} | 0 ...on.test.ts => deleteCollection.seqtest.ts} | 14 +- .../{equipNft.test.ts => equipNft.seqtest.ts} | 54 ++++---- ...edNfts.test.ts => getOwnedNfts.seqtest.ts} | 0 ...tion.test.ts => lockCollection.seqtest.ts} | 46 +++---- .../{mintNft.test.ts => mintNft.seqtest.ts} | 0 ...rejectNft.test.ts => rejectNft.seqtest.ts} | 2 +- ...urce.test.ts => removeResource.seqtest.ts} | 125 +++++++++--------- ...ation.test.ts => rmrkIsolation.seqtest.ts} | 14 +- .../{sendNft.test.ts => sendNft.seqtest.ts} | 0 ...st.ts => setCollectionProperty.seqtest.ts} | 18 +-- ...t.test.ts => setEquippableList.seqtest.ts} | 0 ...erty.test.ts => setNftProperty.seqtest.ts} | 0 ...st.ts => setResourcePriorities.seqtest.ts} | 2 - tests/src/rmrk/util/fetch.ts | 2 +- tests/src/rmrk/util/helpers.ts | 2 +- 23 files changed, 223 insertions(+), 232 deletions(-) rename tests/src/rmrk/{acceptNft.test.ts => acceptNft.seqtest.ts} (100%) rename tests/src/rmrk/{addResource.test.ts => addResource.seqtest.ts} (88%) rename tests/src/rmrk/{addTheme.test.ts => addTheme.seqtest.ts} (100%) rename tests/src/rmrk/{burnNft.test.ts => burnNft.seqtest.ts} (84%) rename tests/src/rmrk/{changeCollectionIssuer.test.ts => changeCollectionIssuer.seqtest.ts} (78%) rename tests/src/rmrk/{createBase.test.ts => createBase.seqtest.ts} (100%) rename tests/src/rmrk/{createCollection.test.ts => createCollection.seqtest.ts} (100%) rename tests/src/rmrk/{deleteCollection.test.ts => deleteCollection.seqtest.ts} (80%) rename tests/src/rmrk/{equipNft.test.ts => equipNft.seqtest.ts} (89%) rename tests/src/rmrk/{getOwnedNfts.test.ts => getOwnedNfts.seqtest.ts} (100%) rename tests/src/rmrk/{lockCollection.test.ts => lockCollection.seqtest.ts} (79%) rename tests/src/rmrk/{mintNft.test.ts => mintNft.seqtest.ts} (100%) rename tests/src/rmrk/{rejectNft.test.ts => rejectNft.seqtest.ts} (98%) rename tests/src/rmrk/{removeResource.test.ts => removeResource.seqtest.ts} (75%) rename tests/src/rmrk/{rmrkIsolation.test.ts => rmrkIsolation.seqtest.ts} (94%) rename tests/src/rmrk/{sendNft.test.ts => sendNft.seqtest.ts} (100%) rename tests/src/rmrk/{setCollectionProperty.test.ts => setCollectionProperty.seqtest.ts} (85%) rename tests/src/rmrk/{setEquippableList.test.ts => setEquippableList.seqtest.ts} (100%) rename tests/src/rmrk/{setNftProperty.test.ts => setNftProperty.seqtest.ts} (100%) rename tests/src/rmrk/{setResourcePriorities.test.ts => setResourcePriorities.seqtest.ts} (98%) diff --git a/tests/src/deprecated-helpers/helpers.ts b/tests/src/deprecated-helpers/helpers.ts index ac998ea567..cff8eff881 100644 --- a/tests/src/deprecated-helpers/helpers.ts +++ b/tests/src/deprecated-helpers/helpers.ts @@ -463,7 +463,7 @@ createCollection( } export async function createCollectionExpectSuccess(params: Partial = {}): Promise { - const {name, description, mode, tokenPrefix} = {...defaultCreateCollectionParams, ...params}; + const {name, description, tokenPrefix} = {...defaultCreateCollectionParams, ...params}; let collectionId = 0; await usingApi(async (api, privateKeyWrapper) => { @@ -763,7 +763,7 @@ export async function confirmSponsorshipExpectSuccess(collectionId: number, send } export async function confirmSponsorshipByKeyExpectSuccess(collectionId: number, sender: IKeyringPair) { - await usingApi(async (api, privateKeyWrapper) => { + await usingApi(async (api) => { // Run the transaction const tx = api.tx.unique.confirmSponsorship(collectionId); @@ -1764,11 +1764,11 @@ export async function queryCollectionExpectSuccess(api: ApiPromise, collectionId return (await api.rpc.unique.collectionById(collectionId)).unwrap(); } -export const describe_xcm = ( +/*export const describe_xcm = ( process.env.RUN_XCM_TESTS ? describe : describe.skip -); +);*/ export async function waitNewBlocks(blocksCount = 1): Promise { await usingApi(async (api) => { diff --git a/tests/src/rmrk/acceptNft.test.ts b/tests/src/rmrk/acceptNft.seqtest.ts similarity index 100% rename from tests/src/rmrk/acceptNft.test.ts rename to tests/src/rmrk/acceptNft.seqtest.ts diff --git a/tests/src/rmrk/addResource.test.ts b/tests/src/rmrk/addResource.seqtest.ts similarity index 88% rename from tests/src/rmrk/addResource.test.ts rename to tests/src/rmrk/addResource.seqtest.ts index ae302bd483..2653ab323f 100644 --- a/tests/src/rmrk/addResource.test.ts +++ b/tests/src/rmrk/addResource.seqtest.ts @@ -15,8 +15,8 @@ import {RmrkTraitsResourceResourceInfo as ResourceInfo} from '@polkadot/types/lo import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; describe('integration test: add NFT resource', () => { - const Alice = '//Alice'; - const Bob = '//Bob'; + const alice = '//Alice'; + const bob = '//Bob'; const src = 'test-res-src'; const metadata = 'test-res-metadata'; const license = 'test-res-license'; @@ -33,7 +33,7 @@ describe('integration test: add NFT resource', () => { it('add resource', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -41,15 +41,15 @@ describe('integration test: add NFT resource', () => { const nftAlice = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionIdAlice, 'nft-metadata', ); await addNftBasicResource( api, - Alice, + alice, 'added', collectionIdAlice, nftAlice, @@ -63,22 +63,22 @@ describe('integration test: add NFT resource', () => { it('add a resource to the nested NFT', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', ); - const parentNftId = await mintNft(api, Alice, Alice, collectionIdAlice, 'parent-nft-metadata'); - const childNftId = await mintNft(api, Alice, Alice, collectionIdAlice, 'child-nft-metadata'); + const parentNftId = await mintNft(api, alice, alice, collectionIdAlice, 'parent-nft-metadata'); + const childNftId = await mintNft(api, alice, alice, collectionIdAlice, 'child-nft-metadata'); const newOwnerNFT: NftIdTuple = [collectionIdAlice, parentNftId]; - await sendNft(api, 'sent', Alice, collectionIdAlice, childNftId, newOwnerNFT); + await sendNft(api, 'sent', alice, collectionIdAlice, childNftId, newOwnerNFT); await addNftBasicResource( api, - Alice, + alice, 'added', collectionIdAlice, childNftId, @@ -92,7 +92,7 @@ describe('integration test: add NFT resource', () => { it('add multiple resources', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -100,8 +100,8 @@ describe('integration test: add NFT resource', () => { const nftAlice = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionIdAlice, 'nft-metadata', ); @@ -152,7 +152,7 @@ describe('integration test: add NFT resource', () => { const firstBasicResourceId = await addNftBasicResource( api, - Alice, + alice, 'added', collectionIdAlice, nftAlice, @@ -164,7 +164,7 @@ describe('integration test: add NFT resource', () => { const secondBasicResourceId = await addNftBasicResource( api, - Alice, + alice, 'added', collectionIdAlice, nftAlice, @@ -176,7 +176,7 @@ describe('integration test: add NFT resource', () => { const composableResourceId = await addNftComposableResource( api, - Alice, + alice, 'added', collectionIdAlice, nftAlice, @@ -190,7 +190,7 @@ describe('integration test: add NFT resource', () => { const slotResourceId = await addNftSlotResource( api, - Alice, + alice, 'added', collectionIdAlice, nftAlice, @@ -218,7 +218,7 @@ describe('integration test: add NFT resource', () => { it('[negative]: unable to add a resource to the non-existing NFT', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -226,7 +226,7 @@ describe('integration test: add NFT resource', () => { const tx = addNftBasicResource( api, - Alice, + alice, 'added', collectionIdAlice, nonexistentId, @@ -242,7 +242,7 @@ describe('integration test: add NFT resource', () => { it('[negative]: unable to add a resource by a not-an-owner user', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -250,15 +250,15 @@ describe('integration test: add NFT resource', () => { const nftAlice = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionIdAlice, 'nft-metadata', ); const tx = addNftBasicResource( api, - Bob, + bob, 'added', collectionIdAlice, nftAlice, @@ -274,22 +274,22 @@ describe('integration test: add NFT resource', () => { it('[negative]: unable to add a resource to the nested NFT if it isnt root owned by the caller', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', ); - const parentNftId = await mintNft(api, Alice, Alice, collectionIdAlice, 'parent-nft-metadata'); - const childNftId = await mintNft(api, Alice, Alice, collectionIdAlice, 'child-nft-metadata'); + const parentNftId = await mintNft(api, alice, alice, collectionIdAlice, 'parent-nft-metadata'); + const childNftId = await mintNft(api, alice, alice, collectionIdAlice, 'child-nft-metadata'); const newOwnerNFT: NftIdTuple = [collectionIdAlice, parentNftId]; - await sendNft(api, 'sent', Alice, collectionIdAlice, childNftId, newOwnerNFT); + await sendNft(api, 'sent', alice, collectionIdAlice, childNftId, newOwnerNFT); const tx = addNftBasicResource( api, - Bob, + bob, 'added', collectionIdAlice, childNftId, @@ -305,7 +305,7 @@ describe('integration test: add NFT resource', () => { it('accept resource', async () => { const collectionIdBob = await createCollection( api, - Bob, + bob, 'test-metadata', null, 'test-symbol', @@ -313,15 +313,15 @@ describe('integration test: add NFT resource', () => { const nftAlice = await mintNft( api, - Bob, - Alice, + bob, + alice, collectionIdBob, 'nft-metadata', ); const resourceId = await addNftBasicResource( api, - Bob, + bob, 'pending', collectionIdBob, nftAlice, @@ -331,13 +331,13 @@ describe('integration test: add NFT resource', () => { thumb, ); - await acceptNftResource(api, Alice, collectionIdBob, nftAlice, resourceId); + await acceptNftResource(api, alice, collectionIdBob, nftAlice, resourceId); }); it('[negative]: unable to accept a non-existing resource', async () => { const collectionIdBob = await createCollection( api, - Bob, + bob, 'test-metadata', null, 'test-symbol', @@ -345,20 +345,20 @@ describe('integration test: add NFT resource', () => { const nftAlice = await mintNft( api, - Bob, - Alice, + bob, + alice, collectionIdBob, 'nft-metadata', ); - const tx = acceptNftResource(api, Alice, collectionIdBob, nftAlice, nonexistentId); + const tx = acceptNftResource(api, alice, collectionIdBob, nftAlice, nonexistentId); await expectTxFailure(/rmrkCore\.ResourceDoesntExist/, tx); }); it('[negative]: unable to accept a resource by a not-an-NFT-owner user', async () => { const collectionIdBob = await createCollection( api, - Bob, + bob, 'test-metadata', null, 'test-symbol', @@ -366,15 +366,15 @@ describe('integration test: add NFT resource', () => { const nftAlice = await mintNft( api, - Bob, - Alice, + bob, + alice, collectionIdBob, 'nft-metadata', ); const resourceId = await addNftBasicResource( api, - Bob, + bob, 'pending', collectionIdBob, nftAlice, @@ -384,7 +384,7 @@ describe('integration test: add NFT resource', () => { thumb, ); - const tx = acceptNftResource(api, Bob, collectionIdBob, nftAlice, resourceId); + const tx = acceptNftResource(api, bob, collectionIdBob, nftAlice, resourceId); await expectTxFailure(/rmrkCore\.NoPermission/, tx); }); @@ -392,7 +392,7 @@ describe('integration test: add NFT resource', () => { it('[negative]: unable to accept a resource to a non-target NFT', async () => { const collectionIdBob = await createCollection( api, - Bob, + bob, 'test-metadata', null, 'test-symbol', @@ -400,23 +400,23 @@ describe('integration test: add NFT resource', () => { const nftAlice = await mintNft( api, - Bob, - Alice, + bob, + alice, collectionIdBob, 'nft-metadata', ); const wrongNft = await mintNft( api, - Bob, - Alice, + bob, + alice, collectionIdBob, 'nft-metadata', ); const resourceId = await addNftBasicResource( api, - Bob, + bob, 'pending', collectionIdBob, nftAlice, @@ -426,7 +426,7 @@ describe('integration test: add NFT resource', () => { thumb, ); - const tx = acceptNftResource(api, Bob, collectionIdBob, wrongNft, resourceId); + const tx = acceptNftResource(api, bob, collectionIdBob, wrongNft, resourceId); await expectTxFailure(/rmrkCore\.ResourceDoesntExist/, tx); }); diff --git a/tests/src/rmrk/addTheme.test.ts b/tests/src/rmrk/addTheme.seqtest.ts similarity index 100% rename from tests/src/rmrk/addTheme.test.ts rename to tests/src/rmrk/addTheme.seqtest.ts diff --git a/tests/src/rmrk/burnNft.test.ts b/tests/src/rmrk/burnNft.seqtest.ts similarity index 84% rename from tests/src/rmrk/burnNft.test.ts rename to tests/src/rmrk/burnNft.seqtest.ts index 2d189d29fc..c750f45bf9 100644 --- a/tests/src/rmrk/burnNft.test.ts +++ b/tests/src/rmrk/burnNft.seqtest.ts @@ -11,8 +11,8 @@ chai.use(chaiAsPromised); const expect = chai.expect; describe('integration test: burn nft', () => { - const Alice = '//Alice'; - const Bob = '//Bob'; + const alice = '//Alice'; + const bob = '//Bob'; let api: any; before(async function() { @@ -24,26 +24,26 @@ describe('integration test: burn nft', () => { it('burn nft', async () => { await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', ).then(async (collectionId) => { const nftId = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionId, 'nft-metadata', ); - await burnNft(api, Alice, collectionId, nftId); + await burnNft(api, alice, collectionId, nftId); }); }); it('burn nft with children', async () => { const collectionId = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -51,23 +51,23 @@ describe('integration test: burn nft', () => { const parentNftId = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionId, 'nft-metadata', ); const childNftId = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionId, 'nft-metadata', ); const newOwnerNFT: NftIdTuple = [collectionId, parentNftId]; - await sendNft(api, 'sent', Alice, collectionId, childNftId, newOwnerNFT); + await sendNft(api, 'sent', alice, collectionId, childNftId, newOwnerNFT); const childrenBefore = await getChildren(api, collectionId, parentNftId); expect(childrenBefore.length === 1, 'Error: parent NFT should have children') @@ -80,7 +80,7 @@ describe('integration test: burn nft', () => { expect(child.nftId.eq(childNftId), 'Error: invalid child NFT Id') .to.be.true; - await burnNft(api, Alice, collectionId, parentNftId); + await burnNft(api, alice, collectionId, parentNftId); const childrenAfter = await getChildren(api, collectionId, parentNftId); @@ -90,7 +90,7 @@ describe('integration test: burn nft', () => { it('burn child nft', async () => { const collectionId = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -98,23 +98,23 @@ describe('integration test: burn nft', () => { const parentNftId = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionId, 'nft-metadata', ); const childNftId = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionId, 'nft-metadata', ); const newOwnerNFT: NftIdTuple = [collectionId, parentNftId]; - await sendNft(api, 'sent', Alice, collectionId, childNftId, newOwnerNFT); + await sendNft(api, 'sent', alice, collectionId, childNftId, newOwnerNFT); const childrenBefore = await getChildren(api, collectionId, parentNftId); expect(childrenBefore.length === 1, 'Error: parent NFT should have children') @@ -127,7 +127,7 @@ describe('integration test: burn nft', () => { expect(child.nftId.eq(childNftId), 'Error: invalid child NFT Id') .to.be.true; - await burnNft(api, Alice, collectionId, childNftId); + await burnNft(api, alice, collectionId, childNftId); const childrenAfter = await getChildren(api, collectionId, parentNftId); @@ -137,12 +137,12 @@ describe('integration test: burn nft', () => { it('[negative] burn non-existing NFT', async () => { await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', ).then(async (collectionId) => { - const tx = burnNft(api, Alice, collectionId, 99999); + const tx = burnNft(api, alice, collectionId, 99999); await expectTxFailure(/rmrkCore\.NoAvailableNftId/, tx); }); }); @@ -150,19 +150,19 @@ describe('integration test: burn nft', () => { it('[negative] burn not an owner NFT user', async () => { await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', ).then(async (collectionId) => { const nftId = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionId, 'nft-metadata', ); - const tx = burnNft(api, Bob, collectionId, nftId); + const tx = burnNft(api, bob, collectionId, nftId); await expectTxFailure(/rmrkCore\.NoPermission/, tx); }); }); diff --git a/tests/src/rmrk/changeCollectionIssuer.test.ts b/tests/src/rmrk/changeCollectionIssuer.seqtest.ts similarity index 78% rename from tests/src/rmrk/changeCollectionIssuer.test.ts rename to tests/src/rmrk/changeCollectionIssuer.seqtest.ts index 88ec3f590a..859c3fd514 100644 --- a/tests/src/rmrk/changeCollectionIssuer.test.ts +++ b/tests/src/rmrk/changeCollectionIssuer.seqtest.ts @@ -7,8 +7,8 @@ import { } from './util/tx'; describe('integration test: collection issuer', () => { - const Alice = '//Alice'; - const Bob = '//Bob'; + const alice = '//Alice'; + const bob = '//Bob'; let api: any; before(async function() { @@ -21,18 +21,18 @@ describe('integration test: collection issuer', () => { it('change collection issuer', async () => { await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', ).then(async (collectionId) => { - await changeIssuer(api, Alice, collectionId, Bob); + await changeIssuer(api, alice, collectionId, bob); }); }); it('[negative] change not an owner NFT collection issuer', async () => { - await createCollection(api, Bob, 'test-metadata', null, 'test-symbol').then(async (collectionId) => { - const tx = changeIssuer(api, Alice, collectionId, Bob); + await createCollection(api, bob, 'test-metadata', null, 'test-symbol').then(async (collectionId) => { + const tx = changeIssuer(api, alice, collectionId, bob); await expectTxFailure(/rmrkCore\.NoPermission/, tx); }); }); @@ -40,12 +40,12 @@ describe('integration test: collection issuer', () => { it('[negative] change non-existigit NFT collection issuer', async () => { await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', ).then(async () => { - const tx = changeIssuer(api, Alice, 99999, Bob); + const tx = changeIssuer(api, alice, 99999, bob); await expectTxFailure(/rmrkCore\.CollectionUnknown/, tx); }); }); diff --git a/tests/src/rmrk/createBase.test.ts b/tests/src/rmrk/createBase.seqtest.ts similarity index 100% rename from tests/src/rmrk/createBase.test.ts rename to tests/src/rmrk/createBase.seqtest.ts diff --git a/tests/src/rmrk/createCollection.test.ts b/tests/src/rmrk/createCollection.seqtest.ts similarity index 100% rename from tests/src/rmrk/createCollection.test.ts rename to tests/src/rmrk/createCollection.seqtest.ts diff --git a/tests/src/rmrk/deleteCollection.test.ts b/tests/src/rmrk/deleteCollection.seqtest.ts similarity index 80% rename from tests/src/rmrk/deleteCollection.test.ts rename to tests/src/rmrk/deleteCollection.seqtest.ts index 0caf5d734d..1de21bdd65 100644 --- a/tests/src/rmrk/deleteCollection.test.ts +++ b/tests/src/rmrk/deleteCollection.seqtest.ts @@ -10,35 +10,35 @@ describe('integration test: delete collection', () => { await requirePallets(this, [Pallets.RmrkCore]); }); - const Alice = '//Alice'; - const Bob = '//Bob'; + const alice = '//Alice'; + const bob = '//Bob'; it('delete NFT collection', async () => { await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', ).then(async (collectionId) => { - await deleteCollection(api, Alice, collectionId.toString()); + await deleteCollection(api, alice, collectionId.toString()); }); }); it('[negative] delete non-existing NFT collection', async () => { - const tx = deleteCollection(api, Alice, '99999'); + const tx = deleteCollection(api, alice, '99999'); await expectTxFailure(/rmrkCore\.CollectionUnknown/, tx); }); it('[negative] delete not an owner NFT collection', async () => { await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', ).then(async (collectionId) => { - const tx = deleteCollection(api, Bob, collectionId.toString()); + const tx = deleteCollection(api, bob, collectionId.toString()); await expectTxFailure(/rmrkCore.NoPermission/, tx); }); }); diff --git a/tests/src/rmrk/equipNft.test.ts b/tests/src/rmrk/equipNft.seqtest.ts similarity index 89% rename from tests/src/rmrk/equipNft.test.ts rename to tests/src/rmrk/equipNft.seqtest.ts index ed8d4ae9e9..4814ce2943 100644 --- a/tests/src/rmrk/equipNft.test.ts +++ b/tests/src/rmrk/equipNft.seqtest.ts @@ -2,7 +2,7 @@ import {ApiPromise} from '@polkadot/api'; import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; -import {getNft, getParts, NftIdTuple} from './util/fetch'; +import {getNft, NftIdTuple} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import { addNftComposableResource, @@ -15,8 +15,8 @@ import { unequipNft, } from './util/tx'; -const Alice = '//Alice'; -const Bob = '//Bob'; +const alice = '//Alice'; +const bob = '//Bob'; const composableParts: number[] = [5, 2, 7]; const composableSrc = 'test-cmp-src'; @@ -34,7 +34,7 @@ const slotId = 1; async function createTestCollection(api: ApiPromise): Promise { return createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -44,8 +44,8 @@ async function createTestCollection(api: ApiPromise): Promise { async function mintTestNft(api: ApiPromise, collectionId: number): Promise { return await mintNft( api, - Alice, - Alice, + alice, + alice, collectionId, 'nft-metadata', ); @@ -56,13 +56,13 @@ async function mintChildNft(api: ApiPromise, collectionId: number, parentNftId: const parentNFT: NftIdTuple = [collectionId, parentNftId]; - await sendNft(api, 'sent', Alice, collectionId, nftChildId, parentNFT); + await sendNft(api, 'sent', alice, collectionId, nftChildId, parentNFT); return nftChildId; } async function createTestBase(api: ApiPromise): Promise { - return createBase(api, Alice, 'test-base', 'DTBase', [ + return createBase(api, alice, 'test-base', 'DTBase', [ { SlotPart: { id: slotId, @@ -77,7 +77,7 @@ async function createTestBase(api: ApiPromise): Promise { async function addTestComposable(api: ApiPromise, collectionId: number, nftId: number, baseId: number) { await addNftComposableResource( api, - Alice, + alice, 'added', collectionId, nftId, @@ -93,7 +93,7 @@ async function addTestComposable(api: ApiPromise, collectionId: number, nftId: n async function addTestSlot(api: ApiPromise, collectionId: number, nftId: number, baseId: number, slotId: number): Promise { return await addNftSlotResource( api, - Alice, + alice, 'added', collectionId, nftId, @@ -142,7 +142,7 @@ describe.skip('integration test: Equip NFT', () => { const equipperNFT: NftIdTuple = [collectionId, nftParentId]; const itemNFT: NftIdTuple = [collectionId, nftChildId]; - await equipNft(api, Alice, itemNFT, equipperNFT, resourceId, baseId, slotId); + await equipNft(api, alice, itemNFT, equipperNFT, resourceId, baseId, slotId); await checkEquipStatus(api, 'equipped', collectionId, nftChildId); }); @@ -160,11 +160,11 @@ describe.skip('integration test: Equip NFT', () => { const equipperNFT: NftIdTuple = [collectionId, nftParentId]; const itemNFT: NftIdTuple = [collectionId, nftChildId]; - await equipNft(api, Alice, itemNFT, equipperNFT, resourceId, baseId, slotId); + await equipNft(api, alice, itemNFT, equipperNFT, resourceId, baseId, slotId); await checkEquipStatus(api, 'equipped', collectionId, nftChildId); - await unequipNft(api, Alice, itemNFT, equipperNFT, resourceId, baseId, slotId); + await unequipNft(api, alice, itemNFT, equipperNFT, resourceId, baseId, slotId); await checkEquipStatus(api, 'unequipped', collectionId, nftChildId); }); @@ -173,8 +173,8 @@ describe.skip('integration test: Equip NFT', () => { const nftChildId = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionId, 'nft-metadata', ); @@ -185,7 +185,7 @@ describe.skip('integration test: Equip NFT', () => { const baseId = 0; const resourceId = 0; - const tx = equipNft(api, Alice, itemNFT, invalidEquipperNFT, resourceId, baseId, slotId); + const tx = equipNft(api, alice, itemNFT, invalidEquipperNFT, resourceId, baseId, slotId); await expectTxFailure(/rmrkCore\.NoAvailableNftId/, tx); }); @@ -193,8 +193,8 @@ describe.skip('integration test: Equip NFT', () => { const collectionId = await createTestCollection(api); const nftParentId = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionId, 'nft-metadata', ); @@ -208,7 +208,7 @@ describe.skip('integration test: Equip NFT', () => { const resourceId = 0; - const tx = equipNft(api, Alice, invalidItemNFT, equipperNFT, resourceId, baseId, slotId); + const tx = equipNft(api, alice, invalidItemNFT, equipperNFT, resourceId, baseId, slotId); await expectTxFailure(/rmrkCore\.NoAvailableNftId/, tx); }); @@ -226,7 +226,7 @@ describe.skip('integration test: Equip NFT', () => { const resourceId = await addTestSlot(api, collectionId, nftChildId, baseId, slotId); - const tx = equipNft(api, Bob, itemNFT, equipperNFT, resourceId, baseId, slotId); + const tx = equipNft(api, bob, itemNFT, equipperNFT, resourceId, baseId, slotId); await expectTxFailure(/rmrkEquip\.PermissionError/, tx); }); @@ -244,7 +244,7 @@ describe.skip('integration test: Equip NFT', () => { const equipperNFT: NftIdTuple = [collectionId, nftParentId]; const itemNFT: NftIdTuple = [collectionId, nftGrandchildId]; - const tx = equipNft(api, Alice, itemNFT, equipperNFT, resourceId, baseId, slotId); + const tx = equipNft(api, alice, itemNFT, equipperNFT, resourceId, baseId, slotId); await expectTxFailure(/rmrkEquip\.MustBeDirectParent/, tx); }); @@ -263,7 +263,7 @@ describe.skip('integration test: Equip NFT', () => { const invalidBaseId = 99999; - const tx = equipNft(api, Alice, itemNFT, equipperNFT, resourceId, invalidBaseId, slotId); + const tx = equipNft(api, alice, itemNFT, equipperNFT, resourceId, invalidBaseId, slotId); await expectTxFailure(/rmrkEquip\.NoResourceForThisBaseFoundOnNft/, tx); }); @@ -281,7 +281,7 @@ describe.skip('integration test: Equip NFT', () => { const itemNFT: NftIdTuple = [collectionId, nftChildId]; const incorrectSlotId = slotId + 1; - const tx = equipNft(api, Alice, itemNFT, equipperNFT, resourceId, baseId, incorrectSlotId); + const tx = equipNft(api, alice, itemNFT, equipperNFT, resourceId, baseId, incorrectSlotId); await expectTxFailure(/rmrkEquip\.ItemHasNoResourceToEquipThere/, tx); }); @@ -290,7 +290,7 @@ describe.skip('integration test: Equip NFT', () => { const nftParentId = await mintTestNft(api, collectionId); const nftChildId = await mintChildNft(api, collectionId, nftParentId); - const baseId = await createBase(api, Alice, 'test-base', 'DTBase', [ + const baseId = await createBase(api, alice, 'test-base', 'DTBase', [ { FixedPart: { id: slotId, @@ -307,7 +307,7 @@ describe.skip('integration test: Equip NFT', () => { const equipperNFT: NftIdTuple = [collectionId, nftParentId]; const itemNFT: NftIdTuple = [collectionId, nftChildId]; - const tx = equipNft(api, Alice, itemNFT, equipperNFT, resourceId, baseId, slotId); + const tx = equipNft(api, alice, itemNFT, equipperNFT, resourceId, baseId, slotId); await expectTxFailure(/rmrkEquip\.CantEquipFixedPart/, tx); }); @@ -316,7 +316,7 @@ describe.skip('integration test: Equip NFT', () => { const nftParentId = await mintTestNft(api, collectionId); const nftChildId = await mintChildNft(api, collectionId, nftParentId); - const baseId = await createBase(api, Alice, 'test-base', 'DTBase', [ + const baseId = await createBase(api, alice, 'test-base', 'DTBase', [ { SlotPart: { id: 1, @@ -333,7 +333,7 @@ describe.skip('integration test: Equip NFT', () => { const equipperNFT: NftIdTuple = [collectionId, nftParentId]; const itemNFT: NftIdTuple = [collectionId, nftChildId]; - const tx = equipNft(api, Alice, itemNFT, equipperNFT, resourceId, baseId, slotId); + const tx = equipNft(api, alice, itemNFT, equipperNFT, resourceId, baseId, slotId); await expectTxFailure(/rmrkEquip\.CollectionNotEquippable/, tx); }); diff --git a/tests/src/rmrk/getOwnedNfts.test.ts b/tests/src/rmrk/getOwnedNfts.seqtest.ts similarity index 100% rename from tests/src/rmrk/getOwnedNfts.test.ts rename to tests/src/rmrk/getOwnedNfts.seqtest.ts diff --git a/tests/src/rmrk/lockCollection.test.ts b/tests/src/rmrk/lockCollection.seqtest.ts similarity index 79% rename from tests/src/rmrk/lockCollection.test.ts rename to tests/src/rmrk/lockCollection.seqtest.ts index 03016fe5ea..5920edd8af 100644 --- a/tests/src/rmrk/lockCollection.test.ts +++ b/tests/src/rmrk/lockCollection.seqtest.ts @@ -4,9 +4,9 @@ import {expectTxFailure} from './util/helpers'; import {createCollection, lockCollection, mintNft} from './util/tx'; describe('integration test: lock collection', () => { - const Alice = '//Alice'; - const Bob = '//Bob'; - const Max = 5; + const alice = '//Alice'; + const bob = '//Bob'; + const max = 5; let api: any; before(async function () { @@ -17,29 +17,29 @@ describe('integration test: lock collection', () => { it('lock collection', async () => { await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', ).then(async (collectionId) => { - await lockCollection(api, Alice, collectionId); + await lockCollection(api, alice, collectionId); }); }); it('[negative] lock non-existing NFT collection', async () => { - const tx = lockCollection(api, Alice, 99999); + const tx = lockCollection(api, alice, 99999); await expectTxFailure(/rmrkCore\.CollectionUnknown/, tx); }); it('[negative] lock not an owner NFT collection issuer', async () => { await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', ).then(async (collectionId) => { - const tx = lockCollection(api, Bob, collectionId); + const tx = lockCollection(api, bob, collectionId); await expectTxFailure(/rmrkCore\.NoPermission/, tx); }); }); @@ -47,39 +47,39 @@ describe('integration test: lock collection', () => { it('lock collection with minting', async () => { await createCollection( api, - Alice, + alice, 'test-metadata', - Max, + max, 'test-symbol', ).then(async (collectionId) => { for (let i = 0; i < 5; i++) { await mintNft( api, - Alice, - Alice, + alice, + alice, collectionId, 'test-metadata', null, null, ); } - await lockCollection(api, Alice, collectionId, Max); + await lockCollection(api, alice, collectionId, max); }); }); it('[negative] unable to mint NFT inside a locked collection', async () => { await createCollection( api, - Alice, + alice, 'test-metadata', - Max, + max, 'test-symbol', ).then(async (collectionId) => { - await lockCollection(api, Alice, collectionId); + await lockCollection(api, alice, collectionId); const tx = mintNft( api, - Alice, - Alice, + alice, + alice, collectionId, 'test-metadata', null, @@ -90,11 +90,11 @@ describe('integration test: lock collection', () => { }); it('[negative] unable to mint NFT inside a full collection', async () => { - await createCollection(api, Alice, 'test-metadata', 1, 'test-symbol').then(async (collectionId) => { + await createCollection(api, alice, 'test-metadata', 1, 'test-symbol').then(async (collectionId) => { await mintNft( api, - Alice, - Alice, + alice, + alice, collectionId, 'test-metadata', null, @@ -102,8 +102,8 @@ describe('integration test: lock collection', () => { ); const tx = mintNft( api, - Alice, - Alice, + alice, + alice, collectionId, 'test-metadata', null, diff --git a/tests/src/rmrk/mintNft.test.ts b/tests/src/rmrk/mintNft.seqtest.ts similarity index 100% rename from tests/src/rmrk/mintNft.test.ts rename to tests/src/rmrk/mintNft.seqtest.ts diff --git a/tests/src/rmrk/rejectNft.test.ts b/tests/src/rmrk/rejectNft.seqtest.ts similarity index 98% rename from tests/src/rmrk/rejectNft.test.ts rename to tests/src/rmrk/rejectNft.seqtest.ts index 701b14fbfa..5bda70f249 100644 --- a/tests/src/rmrk/rejectNft.test.ts +++ b/tests/src/rmrk/rejectNft.seqtest.ts @@ -6,7 +6,7 @@ import { sendNft, rejectNft, } from './util/tx'; -import {getChildren, NftIdTuple} from './util/fetch'; +import {NftIdTuple} from './util/fetch'; import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; diff --git a/tests/src/rmrk/removeResource.test.ts b/tests/src/rmrk/removeResource.seqtest.ts similarity index 75% rename from tests/src/rmrk/removeResource.test.ts rename to tests/src/rmrk/removeResource.seqtest.ts index 941f5ea7a4..ae18f05912 100644 --- a/tests/src/rmrk/removeResource.test.ts +++ b/tests/src/rmrk/removeResource.seqtest.ts @@ -1,14 +1,9 @@ -import {expect} from 'chai'; -import privateKey from '../substrate/privateKey'; -import {executeTransaction, getApiConnection} from '../substrate/substrate-api'; +import {getApiConnection} from '../substrate/substrate-api'; import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; -import {getNft, NftIdTuple} from './util/fetch'; +import {NftIdTuple} from './util/fetch'; import {expectTxFailure} from './util/helpers'; import { - acceptNft, acceptResourceRemoval, addNftBasicResource, - createBase, - createCollection, - mintNft, removeNftResource, sendNft, + acceptResourceRemoval, addNftBasicResource, createCollection, mintNft, removeNftResource, sendNft, } from './util/tx'; @@ -16,15 +11,13 @@ import { describe('Integration test: remove nft resource', () => { let api: any; - let ss58Format: string; before(async function() { api = await getApiConnection(); - ss58Format = api.registry.getChainProperties()!.toJSON().ss58Format; await requirePallets(this, [Pallets.RmrkCore]); }); - const Alice = '//Alice'; - const Bob = '//Bob'; + const alice = '//Alice'; + const bob = '//Bob'; const src = 'test-basic-src'; const metadata = 'test-basic-metadata'; const license = 'test-basic-license'; @@ -33,7 +26,7 @@ describe('Integration test: remove nft resource', () => { it('deleting a resource directly by the NFT owner', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -41,15 +34,15 @@ describe('Integration test: remove nft resource', () => { const nftAlice = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionIdAlice, 'nft-metadata', ); const resourceId = await addNftBasicResource( api, - Alice, + alice, 'added', collectionIdAlice, nftAlice, @@ -59,24 +52,24 @@ describe('Integration test: remove nft resource', () => { thumb, ); - await removeNftResource(api, 'removed', Alice, collectionIdAlice, nftAlice, resourceId); + await removeNftResource(api, 'removed', alice, collectionIdAlice, nftAlice, resourceId); }); it('deleting resources indirectly by the NFT owner', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', ); - const parentNftId = await mintNft(api, Alice, Alice, collectionIdAlice, 'parent-nft-metadata'); - const childNftId = await mintNft(api, Alice, Alice, collectionIdAlice, 'child-nft-metadata'); + const parentNftId = await mintNft(api, alice, alice, collectionIdAlice, 'parent-nft-metadata'); + const childNftId = await mintNft(api, alice, alice, collectionIdAlice, 'child-nft-metadata'); const resourceId = await addNftBasicResource( api, - Alice, + alice, 'added', collectionIdAlice, childNftId, @@ -88,15 +81,15 @@ describe('Integration test: remove nft resource', () => { const newOwnerNFT: NftIdTuple = [collectionIdAlice, parentNftId]; - await sendNft(api, 'sent', Alice, collectionIdAlice, childNftId, newOwnerNFT); + await sendNft(api, 'sent', alice, collectionIdAlice, childNftId, newOwnerNFT); - await removeNftResource(api, 'removed', Alice, collectionIdAlice, childNftId, resourceId); + await removeNftResource(api, 'removed', alice, collectionIdAlice, childNftId, resourceId); }); it('deleting a resource by the collection owner', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -104,15 +97,15 @@ describe('Integration test: remove nft resource', () => { const nftBob = await mintNft( api, - Alice, - Bob, + alice, + bob, collectionIdAlice, 'nft-metadata', ); const resourceId = await addNftBasicResource( api, - Alice, + alice, 'pending', collectionIdAlice, nftBob, @@ -122,14 +115,14 @@ describe('Integration test: remove nft resource', () => { thumb, ); - await removeNftResource(api, 'pending', Alice, collectionIdAlice, nftBob, resourceId); - await acceptResourceRemoval(api, Bob, collectionIdAlice, nftBob, resourceId); + await removeNftResource(api, 'pending', alice, collectionIdAlice, nftBob, resourceId); + await acceptResourceRemoval(api, bob, collectionIdAlice, nftBob, resourceId); }); it('deleting a resource in a nested NFT by the collection owner', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -137,22 +130,22 @@ describe('Integration test: remove nft resource', () => { const parentNftId = await mintNft( api, - Alice, - Bob, + alice, + bob, collectionIdAlice, 'parent-nft-metadata', ); const childNftId = await mintNft( api, - Alice, - Bob, + alice, + bob, collectionIdAlice, 'child-nft-metadata', ); const resourceId = await addNftBasicResource( api, - Alice, + alice, 'pending', collectionIdAlice, childNftId, @@ -164,16 +157,16 @@ describe('Integration test: remove nft resource', () => { const newOwnerNFT: NftIdTuple = [collectionIdAlice, parentNftId]; - await sendNft(api, 'sent', Bob, collectionIdAlice, childNftId, newOwnerNFT); + await sendNft(api, 'sent', bob, collectionIdAlice, childNftId, newOwnerNFT); - await removeNftResource(api, 'pending', Alice, collectionIdAlice, childNftId, resourceId); - await acceptResourceRemoval(api, Bob, collectionIdAlice, childNftId, resourceId); + await removeNftResource(api, 'pending', alice, collectionIdAlice, childNftId, resourceId); + await acceptResourceRemoval(api, bob, collectionIdAlice, childNftId, resourceId); }); it('[negative]: can\'t delete a resource in a non-existing collection', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -181,15 +174,15 @@ describe('Integration test: remove nft resource', () => { const nftAlice = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionIdAlice, 'nft-metadata', ); const resourceId = await addNftBasicResource( api, - Alice, + alice, 'added', collectionIdAlice, nftAlice, @@ -199,14 +192,14 @@ describe('Integration test: remove nft resource', () => { thumb, ); - const tx = removeNftResource(api, 'removed', Alice, 0xFFFFFFFF, nftAlice, resourceId); + const tx = removeNftResource(api, 'removed', alice, 0xFFFFFFFF, nftAlice, resourceId); await expectTxFailure(/rmrkCore\.CollectionUnknown/, tx); // FIXME: inappropriate error message (NoAvailableNftId) }); it('[negative]: only collection owner can delete a resource', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -214,15 +207,15 @@ describe('Integration test: remove nft resource', () => { const nftAlice = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionIdAlice, 'nft-metadata', ); const resourceId = await addNftBasicResource( api, - Alice, + alice, 'added', collectionIdAlice, nftAlice, @@ -232,14 +225,14 @@ describe('Integration test: remove nft resource', () => { thumb, ); - const tx = removeNftResource(api, 'removed', Bob, collectionIdAlice, nftAlice, resourceId); + const tx = removeNftResource(api, 'removed', bob, collectionIdAlice, nftAlice, resourceId); await expectTxFailure(/rmrkCore\.NoPermission/, tx); }); it('[negative]: cannot delete a resource that does not exist', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -247,20 +240,20 @@ describe('Integration test: remove nft resource', () => { const nftAlice = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionIdAlice, 'nft-metadata', ); - const tx = removeNftResource(api, 'removed', Alice, collectionIdAlice, nftAlice, 127); + const tx = removeNftResource(api, 'removed', alice, collectionIdAlice, nftAlice, 127); await expectTxFailure(/rmrkCore\.ResourceDoesntExist/, tx); }); it('[negative]: Cannot accept deleting resource without owner attempt do delete it', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -268,15 +261,15 @@ describe('Integration test: remove nft resource', () => { const nftBob = await mintNft( api, - Alice, - Bob, + alice, + bob, collectionIdAlice, 'nft-metadata', ); const resourceId = await addNftBasicResource( api, - Alice, + alice, 'pending', collectionIdAlice, nftBob, @@ -286,14 +279,14 @@ describe('Integration test: remove nft resource', () => { thumb, ); - const tx = acceptResourceRemoval(api, Bob, collectionIdAlice, nftBob, resourceId); + const tx = acceptResourceRemoval(api, bob, collectionIdAlice, nftBob, resourceId); await expectTxFailure(/rmrkCore\.ResourceNotPending/, tx); }); it('[negative]: cannot confirm the deletion of a non-existing resource', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -301,20 +294,20 @@ describe('Integration test: remove nft resource', () => { const nftBob = await mintNft( api, - Alice, - Bob, + alice, + bob, collectionIdAlice, 'nft-metadata', ); - const tx = acceptResourceRemoval(api, Bob, collectionIdAlice, nftBob, 127); + const tx = acceptResourceRemoval(api, bob, collectionIdAlice, nftBob, 127); await expectTxFailure(/rmrkCore\.ResourceDoesntExist/, tx); }); it('[negative]: Non-owner user cannot confirm the deletion of resource', async () => { const collectionIdAlice = await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', @@ -322,15 +315,15 @@ describe('Integration test: remove nft resource', () => { const nftAlice = await mintNft( api, - Alice, - Alice, + alice, + alice, collectionIdAlice, 'nft-metadata', ); const resourceId = await addNftBasicResource( api, - Alice, + alice, 'added', collectionIdAlice, nftAlice, @@ -340,7 +333,7 @@ describe('Integration test: remove nft resource', () => { thumb, ); - const tx = acceptResourceRemoval(api, Bob, collectionIdAlice, nftAlice, resourceId); + const tx = acceptResourceRemoval(api, bob, collectionIdAlice, nftAlice, resourceId); await expectTxFailure(/rmrkCore\.NoPermission/, tx); }); diff --git a/tests/src/rmrk/rmrkIsolation.test.ts b/tests/src/rmrk/rmrkIsolation.seqtest.ts similarity index 94% rename from tests/src/rmrk/rmrkIsolation.test.ts rename to tests/src/rmrk/rmrkIsolation.seqtest.ts index b104c46149..0c81899acc 100644 --- a/tests/src/rmrk/rmrkIsolation.test.ts +++ b/tests/src/rmrk/rmrkIsolation.seqtest.ts @@ -59,7 +59,7 @@ async function isUnique(): Promise { } describe('RMRK External Integration Test', async () => { - const it_rmrk = (await isUnique() ? it : it.skip); + const itRmrk = (await isUnique() ? it : it.skip); before(async function() { await usingApi(async (api, privateKeyWrapper) => { @@ -68,7 +68,7 @@ describe('RMRK External Integration Test', async () => { }); }); - it_rmrk('Creates a new RMRK collection that is mapped to a different ID and is tagged as external', async () => { + itRmrk('Creates a new RMRK collection that is mapped to a different ID and is tagged as external', async () => { await usingApi(async api => { // throwaway collection to bump last Unique collection ID to test ID mapping await createCollectionExpectSuccess(); @@ -88,7 +88,7 @@ describe('Negative Integration Test: External Collections, Internal Ops', async let rmrkCollectionId: number; let rmrkNftId: number; - const it_rmrk = (await isUnique() ? it : it.skip); + const itRmrk = (await isUnique() ? it : it.skip); before(async () => { await usingApi(async (api, privateKeyWrapper) => { @@ -103,7 +103,7 @@ describe('Negative Integration Test: External Collections, Internal Ops', async }); }); - it_rmrk('[Negative] Forbids Unique operations with an external collection, handled by dispatch_call', async () => { + itRmrk('[Negative] Forbids Unique operations with an external collection, handled by dispatch_call', async () => { await usingApi(async api => { // Collection item creation @@ -162,7 +162,7 @@ describe('Negative Integration Test: External Collections, Internal Ops', async }); }); - it_rmrk('[Negative] Forbids Unique collection operations with an external collection', async () => { + itRmrk('[Negative] Forbids Unique collection operations with an external collection', async () => { await usingApi(async api => { const txDestroyCollection = api.tx.unique.destroyCollection(uniqueCollectionId); await expect(executeTransaction(api, alice, txDestroyCollection), 'destroying collection') @@ -225,7 +225,7 @@ describe('Negative Integration Test: Internal Collections, External Ops', async let collectionId: number; let nftId: number; - const it_rmrk = (await isUnique() ? it : it.skip); + const itRmrk = (await isUnique() ? it : it.skip); before(async () => { await usingApi(async (api, privateKeyWrapper) => { @@ -237,7 +237,7 @@ describe('Negative Integration Test: Internal Collections, External Ops', async }); }); - it_rmrk('[Negative] Forbids RMRK operations with the internal collection and NFT (due to the lack of mapping)', async () => { + itRmrk('[Negative] Forbids RMRK operations with the internal collection and NFT (due to the lack of mapping)', async () => { await usingApi(async api => { const txChangeOwner = api.tx.rmrkCore.changeCollectionIssuer(collectionId, bob.address); await expect(executeTransaction(api, alice, txChangeOwner), 'changing collection issuer') diff --git a/tests/src/rmrk/sendNft.test.ts b/tests/src/rmrk/sendNft.seqtest.ts similarity index 100% rename from tests/src/rmrk/sendNft.test.ts rename to tests/src/rmrk/sendNft.seqtest.ts diff --git a/tests/src/rmrk/setCollectionProperty.test.ts b/tests/src/rmrk/setCollectionProperty.seqtest.ts similarity index 85% rename from tests/src/rmrk/setCollectionProperty.test.ts rename to tests/src/rmrk/setCollectionProperty.seqtest.ts index 4cb6a2d0a4..0641896ce6 100644 --- a/tests/src/rmrk/setCollectionProperty.test.ts +++ b/tests/src/rmrk/setCollectionProperty.seqtest.ts @@ -4,8 +4,8 @@ import {expectTxFailure} from './util/helpers'; import {createCollection, setPropertyCollection} from './util/tx'; describe('integration test: set collection property', () => { - const Alice = '//Alice'; - const Bob = '//Bob'; + const alice = '//Alice'; + const bob = '//Bob'; let api: any; before(async function () { @@ -16,16 +16,16 @@ describe('integration test: set collection property', () => { it('set collection property', async () => { await createCollection( api, - Alice, + alice, 'test-metadata', null, 'test-symbol', ).then(async (collectionId) => { - await setPropertyCollection(api, Alice, collectionId, 'test_key', '42'); - await setPropertyCollection(api, Alice, collectionId, 'test_key', '10'); + await setPropertyCollection(api, alice, collectionId, 'test_key', '42'); + await setPropertyCollection(api, alice, collectionId, 'test_key', '10'); await setPropertyCollection( api, - Alice, + alice, collectionId, 'second_test_key', '111', @@ -36,7 +36,7 @@ describe('integration test: set collection property', () => { it('[negative] set non-existing collection property', async () => { const tx = setPropertyCollection( api, - Alice, + alice, 9999, 'test_key', '42', @@ -47,14 +47,14 @@ describe('integration test: set collection property', () => { it('[negative] set property not an owner NFT collection issuer', async () => { await createCollection( api, - Bob, + bob, 'test-metadata', null, 'test-symbol', ).then(async (collectionId) => { const tx = setPropertyCollection( api, - Alice, + alice, collectionId, 'test_key', '42', diff --git a/tests/src/rmrk/setEquippableList.test.ts b/tests/src/rmrk/setEquippableList.seqtest.ts similarity index 100% rename from tests/src/rmrk/setEquippableList.test.ts rename to tests/src/rmrk/setEquippableList.seqtest.ts diff --git a/tests/src/rmrk/setNftProperty.test.ts b/tests/src/rmrk/setNftProperty.seqtest.ts similarity index 100% rename from tests/src/rmrk/setNftProperty.test.ts rename to tests/src/rmrk/setNftProperty.seqtest.ts diff --git a/tests/src/rmrk/setResourcePriorities.test.ts b/tests/src/rmrk/setResourcePriorities.seqtest.ts similarity index 98% rename from tests/src/rmrk/setResourcePriorities.test.ts rename to tests/src/rmrk/setResourcePriorities.seqtest.ts index ac26d7874b..d47f64d78a 100644 --- a/tests/src/rmrk/setResourcePriorities.test.ts +++ b/tests/src/rmrk/setResourcePriorities.seqtest.ts @@ -45,8 +45,6 @@ describe('integration test: set NFT resource priorities', () => { }); it('[negative] set NFT resource priorities to non-existing NFT', async () => { - const owner = alice; - const collectionId = 0; const maxNftId = 0xFFFFFFFF; diff --git a/tests/src/rmrk/util/fetch.ts b/tests/src/rmrk/util/fetch.ts index 8122a669b9..d9458ed8df 100644 --- a/tests/src/rmrk/util/fetch.ts +++ b/tests/src/rmrk/util/fetch.ts @@ -1,5 +1,5 @@ import {ApiPromise} from '@polkadot/api'; -import type {Option, Bytes} from '@polkadot/types-codec'; +import type {Option} from '@polkadot/types-codec'; import type { RmrkTraitsCollectionCollectionInfo as Collection, RmrkTraitsNftNftInfo as Nft, diff --git a/tests/src/rmrk/util/helpers.ts b/tests/src/rmrk/util/helpers.ts index c43fccb5a9..5a1d44cd03 100644 --- a/tests/src/rmrk/util/helpers.ts +++ b/tests/src/rmrk/util/helpers.ts @@ -107,7 +107,7 @@ export async function isNftChildOfAnother( export function isTxResultSuccess(events: EventRecord[]): boolean { let success = false; - events.forEach(({event: {data, method, section}}) => { + events.forEach(({event: {method}}) => { if (method == 'ExtrinsicSuccess') { success = true; } From c8c85d4b9b734437cfcdc9c9da871871e31091ef Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 10 Oct 2022 09:04:48 +0000 Subject: [PATCH 1080/1274] fix: bump polkadot version in .env --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 351f7be451..e25f1a1977 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ RUST_TOOLCHAIN=nightly-2022-07-24 -POLKADOT_BUILD_BRANCH=release-v0.9.27 +POLKADOT_BUILD_BRANCH=release-v0.9.29 POLKADOT_MAINNET_BRANCH=release-v0.9.26 UNIQUE_MAINNET_TAG=v924010 From 797fec697130ffe76b19830b189d1e70afcdb36f Mon Sep 17 00:00:00 2001 From: Maksandre Date: Mon, 10 Oct 2022 14:51:20 +0400 Subject: [PATCH 1081/1274] Increase the donor balance to 1M --- tests/src/util/playgrounds/feedAlices.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/util/playgrounds/feedAlices.ts b/tests/src/util/playgrounds/feedAlices.ts index ba9c9def33..071100b61d 100644 --- a/tests/src/util/playgrounds/feedAlices.ts +++ b/tests/src/util/playgrounds/feedAlices.ts @@ -38,11 +38,11 @@ const fundFilenames = async () => { const account = await privateKey({filename: f, ignoreFundsPresence: true}); const aliceBalance = await helper.balance.getSubstrate(account.address); - if (aliceBalance < 7500n * oneToken) { + if (aliceBalance < 100_000n * oneToken) { tx.push(helper.executeExtrinsic( alice, 'api.tx.balances.transfer', - [account.address, 15000n * oneToken], + [account.address, 1_000_000n * oneToken], true, {nonce: nonce + balanceGrantedCounter++}, ).then(() => true).catch(() => {console.error(`Transaction to ${path.basename(f)} registered as failed. Strange.`); return false;})); From d52c8f54898b40d49bbfef650a70fef4b5736e03 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Mon, 10 Oct 2022 15:35:03 +0400 Subject: [PATCH 1082/1274] Add donor to app-promotion Rename alice -> superuser Use donor for account creation instead of superuser --- tests/src/app-promotion.test.ts | 61 +++++++++++++++++---------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 7008f2c996..6cb4371861 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -21,7 +21,8 @@ import {stringToU8a} from '@polkadot/util'; import {DevUniqueHelper} from './util/playgrounds/unique.dev'; import {itEth, expect, SponsoringMode} from './eth/util/playgrounds'; -let alice: IKeyringPair; +let superuser: IKeyringPair; +let donor: IKeyringPair; let palletAdmin: IKeyringPair; let nominal: bigint; const palletAddress = calculatePalleteAddress('appstake'); @@ -37,14 +38,15 @@ describe('App promotion', () => { before(async function () { await usingPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.AppPromotion]); - alice = await privateKey('//Alice'); - [palletAdmin] = await helper.arrange.createAccounts([100n], alice); + superuser = await privateKey('//Alice'); + donor = await privateKey({filename: __filename}); + [palletAdmin] = await helper.arrange.createAccounts([100n], donor); const api = helper.getApi(); - await helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); + await helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); nominal = helper.balance.getOneTokenNominal(); - await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal); - await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal); - accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests + await helper.balance.transferToSubstrate(donor, palletAdmin.address, 1000n * nominal); + await helper.balance.transferToSubstrate(donor, palletAddress, 1000n * nominal); + accounts = await helper.arrange.createCrowd(100, 1000n, donor); // create accounts-pool to speed up tests }); }); @@ -76,7 +78,7 @@ describe('App promotion', () => { }); itSub('should allow to create maximum 10 stakes for account', async ({helper}) => { - const [staker] = await helper.arrange.createAccounts([2000n], alice); + const [staker] = await helper.arrange.createAccounts([2000n], donor); for (let i = 0; i < 10; i++) { await helper.staking.stake(staker, 100n * nominal); } @@ -144,7 +146,7 @@ describe('App promotion', () => { expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); // staker can transfer: - await helper.balance.transferToSubstrate(staker, alice.address, 998n * nominal); + await helper.balance.transferToSubstrate(staker, donor.address, 998n * nominal); expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(1n); }); @@ -233,7 +235,7 @@ describe('App promotion', () => { await expect(helper.signTransaction(nonAdmin, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.rejected; // Alice can - await expect(helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; + await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; }); itSub('can be any valid CrossAccountId', async ({helper}) => { @@ -243,8 +245,8 @@ describe('App promotion', () => { const account = accounts.pop()!; const ethAccount = helper.address.substrateToEth(account.address); // Alice sets Ethereum address as a sudo. Then Substrate address back... - await expect(helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.fulfilled; - await expect(helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; + await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.fulfilled; + await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; // ...It doesn't break anything; const collection = await helper.nft.mintCollection(account, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); @@ -256,8 +258,8 @@ describe('App promotion', () => { const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: oldAdmin.address})))).to.be.fulfilled; - await expect(helper.signTransaction(alice, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: newAdmin.address})))).to.be.fulfilled; + await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: oldAdmin.address})))).to.be.fulfilled; + await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: newAdmin.address})))).to.be.fulfilled; await expect(helper.signTransaction(oldAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; await expect(helper.signTransaction(newAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled; @@ -269,7 +271,7 @@ describe('App promotion', () => { await usingPlaygrounds(async (helper) => { const api = helper.getApi(); const tx = api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})); - await helper.signTransaction(alice, tx); + await helper.signTransaction(superuser, tx); }); }); @@ -343,7 +345,7 @@ describe('App promotion', () => { itSub('should not overwrite collection limits set by the owner earlier', async ({helper}) => { const api = helper.getApi(); const limits = {ownerCanDestroy: true, ownerCanTransfer: true, sponsorTransferTimeout: 0}; - const collectionWithLimits = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits}); + const collectionWithLimits = await helper.nft.mintCollection(accounts.pop()!, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits}); await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.fulfilled; expect((await collectionWithLimits.getData())?.raw.limits).to.be.deep.contain(limits); @@ -416,7 +418,7 @@ describe('App promotion', () => { describe('contract sponsoring', () => { itEth('should set palletes address as a sponsor', async ({helper}) => { - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase(); const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); @@ -432,7 +434,7 @@ describe('App promotion', () => { }); itEth('should overwrite sponsoring mode and existed sponsor', async ({helper}) => { - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase(); const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); @@ -459,7 +461,7 @@ describe('App promotion', () => { }); itEth('can be overwritten by contract owner', async ({helper}) => { - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase(); const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); @@ -480,7 +482,7 @@ describe('App promotion', () => { itEth('can not be set by non admin', async ({helper}) => { const nonAdmin = accounts.pop()!; - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase(); const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); @@ -499,18 +501,18 @@ describe('App promotion', () => { itEth('should actually sponsor transactions', async ({helper}) => { // Contract caller - const caller = await helper.eth.createAccountWithBalance(alice, 1000n); + const caller = await helper.eth.createAccountWithBalance(donor, 1000n); const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress); // Deploy flipper - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase(); const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner); const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); // Owner sets to sponsor every tx await contractHelper.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: contractOwner}); await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); - await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address, 1000n); // transferBalanceToEth(api, alice, flipper.options.address, 1000n); + await helper.eth.transferBalanceFromSubstrate(donor, flipper.options.address, 1000n); // transferBalanceToEth(api, alice, flipper.options.address, 1000n); // Set promotion to the Flipper await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true); @@ -533,10 +535,10 @@ describe('App promotion', () => { describe('stopSponsoringContract', () => { itEth('should remove pallet address from contract sponsors', async ({helper}) => { - const caller = await helper.eth.createAccountWithBalance(alice, 1000n); - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const caller = await helper.eth.createAccountWithBalance(donor, 1000n); + const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase(); const flipper = await helper.eth.deployFlipper(contractOwner); - await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address); + await helper.eth.transferBalanceFromSubstrate(donor, flipper.options.address); const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner}); @@ -563,7 +565,7 @@ describe('App promotion', () => { itEth('can not be called by non-admin', async ({helper}) => { const nonAdmin = accounts.pop()!; - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase(); const flipper = await helper.eth.deployFlipper(contractOwner); await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address]); @@ -573,7 +575,7 @@ describe('App promotion', () => { itEth('should not affect a contract which is not sponsored by pallete', async ({helper}) => { const nonAdmin = accounts.pop()!; - const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase(); + const contractOwner = (await helper.eth.createAccountWithBalance(donor, 1000n)).toLowerCase(); const flipper = await helper.eth.deployFlipper(contractOwner); const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner); await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled; @@ -679,7 +681,7 @@ describe('App promotion', () => { itSub.skip('can be paid 1000 rewards in a time', async ({helper}) => { // all other stakes should be unstaked - const oneHundredStakers = await helper.arrange.createCrowd(100, 1050n, alice); + const oneHundredStakers = await helper.arrange.createCrowd(100, 1050n, donor); // stakers stakes 10 times each for (let i = 0; i < 10; i++) { @@ -690,7 +692,6 @@ describe('App promotion', () => { }); itSub.skip('can handle 40.000 rewards', async ({helper}) => { - const [donor] = await helper.arrange.createAccounts([7_000_000n], alice); const crowdStakes = async () => { // each account in the crowd stakes 2 times const crowd = await helper.arrange.createCrowd(500, 300n, donor); From ea2cca91b119691d396147ac1f22ac2dcb8f2fbe Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 10 Oct 2022 13:09:55 +0000 Subject: [PATCH 1083/1274] feat: enrich playgrounds with xcm capability --- tests/src/util/playgrounds/index.ts | 37 +- tests/src/util/playgrounds/types.ts | 33 ++ tests/src/util/playgrounds/unique.dev.ts | 107 +++++- tests/src/util/playgrounds/unique.ts | 415 +++++++++++++++++++---- 4 files changed, 516 insertions(+), 76 deletions(-) diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index ea09031177..aa775de0a7 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -7,16 +7,18 @@ import chaiAsPromised from 'chai-as-promised'; import {Context} from 'mocha'; import config from '../../config'; import '../../interfaces/augment-api-events'; -import {DevUniqueHelper, SilentLogger, SilentConsole} from './unique.dev'; +import {ChainHelperBase} from './unique'; +import {ILogger} from './types'; +import {DevUniqueHelper, SilentLogger, SilentConsole, DevMoonbeamHelper, DevMoonriverHelper, DevAcalaHelper, DevKaruraHelper, DevRelayHelper} from './unique.dev'; chai.use(chaiAsPromised); export const expect = chai.expect; -export async function usingPlaygrounds(code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise, url: string = config.substrateUrl) { +async function usingPlaygroundsGeneral(helperType: new(logger: ILogger) => T, url: string, code: (helper: T, privateKey: (seed: string) => IKeyringPair) => Promise) { const silentConsole = new SilentConsole(); silentConsole.enable(); - const helper = new DevUniqueHelper(new SilentLogger()); + const helper = new helperType(new SilentLogger()); try { await helper.connect(url); @@ -30,8 +32,33 @@ export async function usingPlaygrounds(code: (helper: DevUniqueHelper, privateKe } } -usingPlaygrounds.atUrl = (url: string, code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { - return usingPlaygrounds(code, url); +export const usingPlaygrounds = (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise, url: string = config.substrateUrl) => { + return usingPlaygroundsGeneral(DevUniqueHelper, url, code); +}; + +// TODO specific type +export const usingStatemintPlaygrounds = async (url: string, code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { + return usingPlaygroundsGeneral(DevUniqueHelper, url, code); +}; + +export const usingRelayPlaygrounds = async (url: string, code: (helper: DevRelayHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { + return usingPlaygroundsGeneral(DevRelayHelper, url, code); +}; + +export const usingAcalaPlaygrounds = async (url: string, code: (helper: DevAcalaHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { + return usingPlaygroundsGeneral(DevAcalaHelper, url, code); +}; + +export const usingKaruraPlaygrounds = async (url: string, code: (helper: DevKaruraHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { + return usingPlaygroundsGeneral(DevAcalaHelper, url, code); +}; + +export const usingMoonbeamPlaygrounds = async (url: string, code: (helper: DevMoonbeamHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { + return usingPlaygroundsGeneral(DevMoonbeamHelper, url, code); +}; + +export const usingMoonriverPlaygrounds = async (url: string, code: (helper: DevMoonbeamHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { + return usingPlaygroundsGeneral(DevMoonriverHelper, url, code); }; export enum Pallets { diff --git a/tests/src/util/playgrounds/types.ts b/tests/src/util/playgrounds/types.ts index 7813e41e24..2d5cdb8833 100644 --- a/tests/src/util/playgrounds/types.ts +++ b/tests/src/util/playgrounds/types.ts @@ -179,8 +179,41 @@ export interface IForeignAssetMetadata { minimalBalance?: bigint, } +export interface MoonbeamAssetInfo { + location: any, + metadata: { + name: string, + symbol: string, + decimals: number, + isFrozen: boolean, + minimalBalance: bigint, + }, + existentialDeposit: bigint, + isSufficient: boolean, + unitsPerSecond: bigint, + numAssetsWeightHint: number, +} + +export interface AcalaAssetMetadata { + name: string, + symbol: string, + decimals: number, + minimalBalance: bigint, +} + +export interface DemocracyStandardAccountVote { + balance: bigint, + vote: { + aye: boolean, + conviction: number, + }, +} + export type TSubstrateAccount = string; export type TEthereumAccount = string; export type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated'; export type TUniqueNetworks = 'opal' | 'quartz' | 'unique'; +export type TSiblingNetworkds = 'moonbeam' | 'moonriver' | 'acala' | 'karura' | 'westmint'; +export type TRelayNetworks = 'rococo' | 'westend'; +export type TNetworks = TUniqueNetworks | TSiblingNetworkds | TRelayNetworks; export type TSigner = IKeyringPair; // | 'string' diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index af25949bfb..f6f579f097 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import {mnemonicGenerate} from '@polkadot/util-crypto'; -import {UniqueHelper} from './unique'; -import {ApiPromise, WsProvider} from '@polkadot/api'; +import {UniqueHelper, MoonbeamHelper, ChainHelperBase, AcalaHelper, RelayHelper} from './unique'; +import {ApiPromise, Keyring, WsProvider} from '@polkadot/api'; import * as defs from '../../interfaces/definitions'; import {IKeyringPair} from '@polkadot/types/types'; +import {EventRecord} from '@polkadot/types/interfaces'; import {ICrossAccountId} from './types'; export class SilentLogger { @@ -53,7 +54,6 @@ export class SilentConsole { } } - export class DevUniqueHelper extends UniqueHelper { /** * Arrange methods for tests @@ -108,6 +108,36 @@ export class DevUniqueHelper extends UniqueHelper { } } +export class DevRelayHelper extends RelayHelper {} + +export class DevMoonbeamHelper extends MoonbeamHelper { + account: MoonbeamAccountGroup; + wait: WaitGroup; + + constructor(logger: { log: (msg: any, level: any) => void, level: any }, options: {[key: string]: any} = {}) { + options.helperBase = options.helperBase ?? DevMoonbeamHelper; + + super(logger, options); + this.account = new MoonbeamAccountGroup(this); + this.wait = new WaitGroup(this); + } +} + +export class DevMoonriverHelper extends DevMoonbeamHelper {} + +export class DevAcalaHelper extends AcalaHelper { + wait: WaitGroup; + + constructor(logger: { log: (msg: any, level: any) => void, level: any }, options: {[key: string]: any} = {}) { + options.helperBase = options.helperBase ?? DevAcalaHelper; + + super(logger, options); + this.wait = new WaitGroup(this); + } +} + +export class DevKaruraHelper extends DevAcalaHelper {} + class ArrangeGroup { helper: DevUniqueHelper; @@ -245,10 +275,43 @@ class ArrangeGroup { } } +class MoonbeamAccountGroup { + helper: MoonbeamHelper; + + _alithAccount: IKeyringPair; + _baltatharAccount: IKeyringPair; + _dorothyAccount: IKeyringPair; + + constructor(helper: MoonbeamHelper) { + this.helper = helper; + + const keyring = new Keyring({type: 'ethereum'}); + const alithPrivateKey = '0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133'; + const baltatharPrivateKey = '0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b'; + const dorothyPrivateKey = '0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68'; + + this._alithAccount = keyring.addFromUri(alithPrivateKey, undefined, 'ethereum'); + this._baltatharAccount = keyring.addFromUri(baltatharPrivateKey, undefined, 'ethereum'); + this._dorothyAccount = keyring.addFromUri(dorothyPrivateKey, undefined, 'ethereum'); + } + + alithAccount() { + return this._alithAccount; + } + + baltatharAccount() { + return this._baltatharAccount; + } + + dorothyAccount() { + return this._dorothyAccount; + } +} + class WaitGroup { - helper: DevUniqueHelper; + helper: ChainHelperBase; - constructor(helper: DevUniqueHelper) { + constructor(helper: ChainHelperBase) { this.helper = helper; } @@ -296,6 +359,40 @@ class WaitGroup { }); }); } + + async event(maxBlocksToWait: number, eventSection: string, eventMethod: string) { + // eslint-disable-next-line no-async-promise-executor + const promise = new Promise(async (resolve) => { + const unsubscribe = await this.helper.getApi().rpc.chain.subscribeNewHeads(async header => { + const blockNumber = header.number.toHuman(); + const blockHash = header.hash; + const eventIdStr = `${eventSection}.${eventMethod}`; + const waitLimitStr = `wait blocks remaining: ${maxBlocksToWait}`; + + console.log(`[Block #${blockNumber}] Waiting for event \`${eventIdStr}\` (${waitLimitStr})`); + + const apiAt = await this.helper.getApi().at(blockHash); + const eventRecords = await apiAt.query.system.events(); + + const neededEvent = eventRecords.find(r => { + return r.event.section == eventSection && r.event.method == eventMethod; + }); + + if (neededEvent) { + unsubscribe(); + resolve(neededEvent); + } else if (maxBlocksToWait > 0) { + maxBlocksToWait--; + } else { + console.log(`Event \`${eventIdStr}\` is NOT found`); + + unsubscribe(); + resolve(null); + } + }); + }); + return promise; + } } class AdminGroup { diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 4ea718298b..3bd7c34469 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -9,7 +9,7 @@ import {ApiPromise, WsProvider, Keyring} from '@polkadot/api'; import {ApiInterfaceEvents, SignerOptions} from '@polkadot/api/types'; import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; -import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISchedulerOptions, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks, IForeignAssetMetadata} from './types'; +import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISchedulerOptions, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, IForeignAssetMetadata, TNetworks, MoonbeamAssetInfo, DemocracyStandardAccountVote, AcalaAssetMetadata} from './types'; export class CrossAccountId implements ICrossAccountId { Substrate?: TSubstrateAccount; @@ -308,19 +308,25 @@ class UniqueEventHelper { } } -class ChainHelperBase { +export class ChainHelperBase { + helperBase: any; + transactionStatus = UniqueUtil.transactionStatus; chainLogType = UniqueUtil.chainLogType; util: typeof UniqueUtil; eventHelper: typeof UniqueEventHelper; logger: ILogger; api: ApiPromise | null; - forcedNetwork: TUniqueNetworks | null; - network: TUniqueNetworks | null; + forcedNetwork: TNetworks | null; + network: TNetworks | null; chainLog: IUniqueHelperLog[]; children: ChainHelperBase[]; + address: AddressGroup; + chain: ChainGroup; + + constructor(logger?: ILogger, helperBase?: any) { + this.helperBase = helperBase; - constructor(logger?: ILogger) { this.util = UniqueUtil; this.eventHelper = UniqueEventHelper; if (typeof logger == 'undefined') logger = this.util.getDefaultLogger(); @@ -330,6 +336,21 @@ class ChainHelperBase { this.network = null; this.chainLog = []; this.children = []; + this.address = new AddressGroup(this); + this.chain = new ChainGroup(this); + } + + clone(helperCls: ChainHelperBaseConstructor, options: {[key: string]: any} = {}) { + Object.setPrototypeOf(helperCls.prototype, this); + const newHelper = new helperCls(this.logger, options); + + newHelper.api = this.api; + newHelper.network = this.network; + newHelper.forceNetwork = this.forceNetwork; + + this.children.push(newHelper); + + return newHelper; } getApi(): ApiPromise { @@ -341,7 +362,7 @@ class ChainHelperBase { this.chainLog = []; } - forceNetwork(value: TUniqueNetworks): void { + forceNetwork(value: TNetworks): void { this.forcedNetwork = value; } @@ -367,13 +388,17 @@ class ChainHelperBase { this.network = null; } - static async detectNetwork(api: ApiPromise): Promise { + static async detectNetwork(api: ApiPromise): Promise { const spec = (await api.query.system.lastRuntimeUpgrade()).toJSON() as any; + const xcmChains = ['rococo', 'westend', 'westmint', 'acala', 'karura', 'moonbeam', 'moonriver']; + + if(xcmChains.indexOf(spec.specName) > -1) return spec.specName; + if(['quartz', 'unique'].indexOf(spec.specName) > -1) return spec.specName; return 'opal'; } - static async detectNetworkByWsEndpoint(wsEndpoint: string): Promise { + static async detectNetworkByWsEndpoint(wsEndpoint: string): Promise { const api = new ApiPromise({provider: new WsProvider(wsEndpoint)}); await api.isReady; @@ -384,10 +409,11 @@ class ChainHelperBase { return network; } - static async createConnection(wsEndpoint: string, listeners?: IApiListeners, network?: TUniqueNetworks | null): Promise<{ + static async createConnection(wsEndpoint: string, listeners?: IApiListeners, network?: TNetworks | null): Promise<{ api: ApiPromise; - network: TUniqueNetworks; + network: TNetworks; }> { + console.log('createConnection network = ', network); if(typeof network === 'undefined' || network === null) network = 'opal'; const supportedRPC = { opal: { @@ -399,6 +425,13 @@ class ChainHelperBase { unique: { unique: require('@unique-nft/unique-mainnet-types/definitions').unique.rpc, }, + rococo: {}, + westend: {}, + moonbeam: {}, + moonriver: {}, + acala: {}, + karura: {}, + westmint: {}, }; if(!supportedRPC.hasOwnProperty(network)) network = await this.detectNetworkByWsEndpoint(wsEndpoint); const rpc = supportedRPC[network]; @@ -590,16 +623,16 @@ class ChainHelperBase { } -class HelperGroup { - helper: UniqueHelper; +class HelperGroup { + helper: T; - constructor(uniqueHelper: UniqueHelper) { + constructor(uniqueHelper: T) { this.helper = uniqueHelper; } } -class CollectionGroup extends HelperGroup { +class CollectionGroup extends HelperGroup { /** * Get number of blocks when sponsored transaction is available. * @@ -2000,7 +2033,7 @@ class FTGroup extends CollectionGroup { } -class ChainGroup extends HelperGroup { +class ChainGroup extends HelperGroup { /** * Get system properties of a chain * @example getChainProperties(); @@ -2054,10 +2087,106 @@ class ChainGroup extends HelperGroup { } } +class SubstrateBalanceGroup extends HelperGroup { + /** + * Get substrate address balance + * @param address substrate address + * @example getSubstrate("5GrwvaEF5zXb26Fz...") + * @returns amount of tokens on address + */ + async getSubstrate(address: TSubstrateAccount): Promise { + return (await this.helper.callRpc('api.query.system.account', [address])).data.free.toBigInt(); + } + + /** + * Transfer tokens to substrate address + * @param signer keyring of signer + * @param address substrate address of a recipient + * @param amount amount of tokens to be transfered + * @example transferToSubstrate(aliceKeyring, "5GrwvaEF5zXb26Fz...", 100_000_000_000n); + * @returns ```true``` if extrinsic success, otherwise ```false``` + */ + async transferToSubstrate(signer: TSigner, address: TSubstrateAccount, amount: bigint | string): Promise { + const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.transfer', [address, amount], true/*, `Unable to transfer balance from ${this.helper.getSignerAddress(signer)} to ${address}`*/); + + let transfer = {from: null, to: null, amount: 0n} as any; + result.result.events.forEach(({event: {data, method, section}}) => { + if ((section === 'balances') && (method === 'Transfer')) { + transfer = { + from: this.helper.address.normalizeSubstrate(data[0]), + to: this.helper.address.normalizeSubstrate(data[1]), + amount: BigInt(data[2]), + }; + } + }); + const isSuccess = this.helper.address.normalizeSubstrate(typeof signer === 'string' ? signer : signer.address) === transfer.from + && this.helper.address.normalizeSubstrate(address) === transfer.to + && BigInt(amount) === transfer.amount; + return isSuccess; + } + + /** + * Get full substrate balance including free, miscFrozen, feeFrozen, and reserved + * @param address substrate address + * @returns + */ + async getSubstrateFull(address: TSubstrateAccount): Promise { + const accountInfo = (await this.helper.callRpc('api.query.system.account', [address])).data; + return {free: accountInfo.free.toBigInt(), miscFrozen: accountInfo.miscFrozen.toBigInt(), feeFrozen: accountInfo.feeFrozen.toBigInt(), reserved: accountInfo.reserved.toBigInt()}; + } +} + +class EthereumBalanceGroup extends HelperGroup { + /** + * Get ethereum address balance + * @param address ethereum address + * @example getEthereum("0x9F0583DbB855d...") + * @returns amount of tokens on address + */ + async getEthereum(address: TEthereumAccount): Promise { + return (await this.helper.callRpc('api.rpc.eth.getBalance', [address])).toBigInt(); + } + + /** + * Transfer tokens to address + * @param signer keyring of signer + * @param address Ethereum address of a recipient + * @param amount amount of tokens to be transfered + * @example transferToEthereum(alithKeyring, "0x9F0583DbB855d...", 100_000_000_000n); + * @returns ```true``` if extrinsic success, otherwise ```false``` + */ + async transferToEthereum(signer: TSigner, address: TEthereumAccount, amount: bigint | string): Promise { + const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.transfer', [address, amount], true); + + let transfer = {from: null, to: null, amount: 0n} as any; + result.result.events.forEach(({event: {data, method, section}}) => { + if ((section === 'balances') && (method === 'Transfer')) { + transfer = { + from: data[0].toString(), + to: data[1].toString(), + amount: BigInt(data[2]), + }; + } + }); + const isSuccess = (typeof signer === 'string' ? signer : signer.address) === transfer.from + && address === transfer.to + && BigInt(amount) === transfer.amount; + return isSuccess; + } +} + +class BalanceGroup extends HelperGroup { + subBalanceGroup: SubstrateBalanceGroup; + ethBalanceGroup: EthereumBalanceGroup; + + constructor(helper: T) { + super(helper); + this.subBalanceGroup = new SubstrateBalanceGroup(helper); + this.ethBalanceGroup = new EthereumBalanceGroup(helper); + } -class BalanceGroup extends HelperGroup { getCollectionCreationPrice(): bigint { - return 2n * this.helper.balance.getOneTokenNominal(); + return 2n * this.getOneTokenNominal(); } /** * Representation of the native token in the smallest unit - one OPAL (OPL), QUARTZ (QTZ), or UNIQUE (UNQ). @@ -2076,7 +2205,7 @@ class BalanceGroup extends HelperGroup { * @returns amount of tokens on address */ async getSubstrate(address: TSubstrateAccount): Promise { - return (await this.helper.callRpc('api.query.system.account', [address])).data.free.toBigInt(); + return this.subBalanceGroup.getSubstrate(address); } /** @@ -2085,8 +2214,7 @@ class BalanceGroup extends HelperGroup { * @returns */ async getSubstrateFull(address: TSubstrateAccount): Promise { - const accountInfo = (await this.helper.callRpc('api.query.system.account', [address])).data; - return {free: accountInfo.free.toBigInt(), miscFrozen: accountInfo.miscFrozen.toBigInt(), feeFrozen: accountInfo.feeFrozen.toBigInt(), reserved: accountInfo.reserved.toBigInt()}; + return this.subBalanceGroup.getSubstrateFull(address); } /** @@ -2096,7 +2224,7 @@ class BalanceGroup extends HelperGroup { * @returns amount of tokens on address */ async getEthereum(address: TEthereumAccount): Promise { - return (await this.helper.callRpc('api.rpc.eth.getBalance', [address])).toBigInt(); + return this.ethBalanceGroup.getEthereum(address); } /** @@ -2108,27 +2236,11 @@ class BalanceGroup extends HelperGroup { * @returns ```true``` if extrinsic success, otherwise ```false``` */ async transferToSubstrate(signer: TSigner, address: TSubstrateAccount, amount: bigint | string): Promise { - const result = await this.helper.executeExtrinsic(signer, 'api.tx.balances.transfer', [address, amount], true/*, `Unable to transfer balance from ${this.helper.getSignerAddress(signer)} to ${address}`*/); - - let transfer = {from: null, to: null, amount: 0n} as any; - result.result.events.forEach(({event: {data, method, section}}) => { - if ((section === 'balances') && (method === 'Transfer')) { - transfer = { - from: this.helper.address.normalizeSubstrate(data[0]), - to: this.helper.address.normalizeSubstrate(data[1]), - amount: BigInt(data[2]), - }; - } - }); - const isSuccess = this.helper.address.normalizeSubstrate(typeof signer === 'string' ? signer : signer.address) === transfer.from - && this.helper.address.normalizeSubstrate(address) === transfer.to - && BigInt(amount) === transfer.amount; - return isSuccess; + return this.subBalanceGroup.transferToSubstrate(signer, address, amount); } } - -class AddressGroup extends HelperGroup { +class AddressGroup extends HelperGroup { /** * Normalizes the address to the specified ss58 format, by default ```42```. * @param address substrate address @@ -2172,7 +2284,7 @@ class AddressGroup extends HelperGroup { } } -class StakingGroup extends HelperGroup { +class StakingGroup extends HelperGroup { /** * Stake tokens for App Promotion * @param signer keyring of signer @@ -2258,7 +2370,7 @@ class StakingGroup extends HelperGroup { } } -class SchedulerGroup extends HelperGroup { +class SchedulerGroup extends HelperGroup { constructor(helper: UniqueHelper) { super(helper); } @@ -2314,11 +2426,7 @@ class SchedulerGroup extends HelperGroup { } } -class ForeignAssetsGroup extends HelperGroup { - constructor(helper: UniqueHelper) { - super(helper); - } - +class ForeignAssetsGroup extends HelperGroup { async register(signer: TSigner, ownerAddress: TSubstrateAccount, location: any, metadata: IForeignAssetMetadata) { await this.helper.executeExtrinsic( signer, @@ -2338,14 +2446,130 @@ class ForeignAssetsGroup extends HelperGroup { } } +class XcmGroup extends HelperGroup { + palletName: string; + + constructor(helper: T, palletName: string) { + super(helper); + + this.palletName = palletName; + } + + async limitedReserveTransferAssets(signer: TSigner, destination: any, beneficiary: any, assets: any, feeAssetItem: number, weightLimit: number) { + await this.helper.executeExtrinsic(signer, `api.tx.${this.palletName}.limitedReserveTransferAssets`, [destination, beneficiary, assets, feeAssetItem, {Limited: weightLimit}], true); + } +} + +class XTokensGroup extends HelperGroup { + async transfer(signer: TSigner, currencyId: any, amount: bigint, destination: any, destWeight: number) { + await this.helper.executeExtrinsic(signer, 'api.tx.xTokens.transfer', [currencyId, amount, destination, destWeight], true); + } + + async transferMultiasset(signer: TSigner, asset: any, destination: any, destWeight: number) { + await this.helper.executeExtrinsic(signer, 'api.tx.xTokens.transferMultiasset', [asset, destination, destWeight], true); + } +} + +class TokensGroup extends HelperGroup { + async accounts(address: string, currencyId: any) { + const {free} = (await this.helper.callRpc('api.query.tokens.accounts', [address, currencyId])).toJSON() as any; + return BigInt(free); + } +} + +class AcalaAssetRegistryGroup extends HelperGroup { + async registerForeignAsset(signer: TSigner, destination: any, metadata: AcalaAssetMetadata) { + await this.helper.executeExtrinsic(signer, 'api.tx.assetRegistry.registerForeignAsset', [destination, metadata], true); + } +} + +class MoonbeamAssetManagerGroup extends HelperGroup { + makeRegisterForeignAssetProposal(assetInfo: MoonbeamAssetInfo) { + const apiPrefix = 'api.tx.assetManager.'; + + const registerTx = this.helper.constructApiCall( + apiPrefix + 'registerForeignAsset', + [assetInfo.location, assetInfo.metadata, assetInfo.existentialDeposit, assetInfo.isSufficient], + ); + + const setUnitsTx = this.helper.constructApiCall( + apiPrefix + 'setAssetUnitsPerSecond', + [assetInfo.location, assetInfo.unitsPerSecond, assetInfo.numAssetsWeightHint], + ); + + const batchCall = this.helper.getApi().tx.utility.batchAll([registerTx, setUnitsTx]); + const encodedProposal = batchCall?.method.toHex() || ''; + return encodedProposal; + } + + async assetTypeId(location: any) { + return await this.helper.callRpc('api.query.assetManager.assetTypeId', [location]); + } +} + +class MoonbeamAssetsGroup extends HelperGroup { + async account(assetId: string, address: string) { + const accountAsset = ( + await this.helper.callRpc('api.query.assets.account', [assetId, address]) + ).toJSON()! as any; + + if (accountAsset !== null) { + return BigInt(accountAsset['balance']); + } else { + return null; + } + } +} + +class MoonbeamDemocracyGroup extends HelperGroup { + async notePreimage(signer: TSigner, encodedProposal: string) { + await this.helper.executeExtrinsic(signer, 'api.tx.democracy.notePreimage', [encodedProposal], true); + } + + externalProposeMajority(proposalHash: string) { + return this.helper.constructApiCall('api.tx.democracy.externalProposeMajority', [proposalHash]); + } + + fastTrack(proposalHash: string, votingPeriod: number, delayPeriod: number) { + return this.helper.constructApiCall('api.tx.democracy.fastTrack', [proposalHash, votingPeriod, delayPeriod]); + } + + async referendumVote(signer: TSigner, referendumIndex: number, accountVote: DemocracyStandardAccountVote) { + await this.helper.executeExtrinsic(signer, 'api.tx.democracy.vote', [referendumIndex, {Standard: accountVote}], true); + } +} + +class MoonbeamCollectiveGroup extends HelperGroup { + collective: string; + + constructor(helper: MoonbeamHelper, collective: string) { + super(helper); + + this.collective = collective; + } + + async propose(signer: TSigner, threshold: number, proposalHash: string, lengthBound: number) { + await this.helper.executeExtrinsic(signer, `api.tx.${this.collective}.propose`, [threshold, proposalHash, lengthBound], true); + } + + async vote(signer: TSigner, proposalHash: string, proposalIndex: number, approve: boolean) { + await this.helper.executeExtrinsic(signer, `api.tx.${this.collective}.vote`, [proposalHash, proposalIndex, approve], true); + } + + async close(signer: TSigner, proposalHash: string, proposalIndex: number, weightBound: number, lengthBound: number) { + await this.helper.executeExtrinsic(signer, `api.tx.${this.collective}.close`, [proposalHash, proposalIndex, weightBound, lengthBound], true); + } + + async proposalCount() { + return Number(await this.helper.callRpc(`api.query.${this.collective}.proposalCount`, [])); + } +} + +export type ChainHelperBaseConstructor = new(...args: any[]) => ChainHelperBase; export type UniqueHelperConstructor = new(...args: any[]) => UniqueHelper; export class UniqueHelper extends ChainHelperBase { - helperBase: any; - - chain: ChainGroup; - balance: BalanceGroup; - address: AddressGroup; + balance: BalanceGroup; collection: CollectionGroup; nft: NFTGroup; rft: RFTGroup; @@ -2353,13 +2577,13 @@ export class UniqueHelper extends ChainHelperBase { staking: StakingGroup; scheduler: SchedulerGroup; foreignAssets: ForeignAssetsGroup; + xcm: XcmGroup; + xTokens: XTokensGroup; + tokens: TokensGroup; constructor(logger?: ILogger, options: {[key: string]: any} = {}) { - super(logger); + super(logger, options.helperBase ?? UniqueHelper); - this.helperBase = options.helperBase ?? UniqueHelper; - - this.chain = new ChainGroup(this); this.balance = new BalanceGroup(this); this.address = new AddressGroup(this); this.collection = new CollectionGroup(this); @@ -2369,24 +2593,83 @@ export class UniqueHelper extends ChainHelperBase { this.staking = new StakingGroup(this); this.scheduler = new SchedulerGroup(this); this.foreignAssets = new ForeignAssetsGroup(this); + this.xcm = new XcmGroup(this, 'polkadotXcm'); + this.xTokens = new XTokensGroup(this); + this.tokens = new TokensGroup(this); } - clone(helperCls: UniqueHelperConstructor, options: {[key: string]: any} = {}) { - Object.setPrototypeOf(helperCls.prototype, this); - const newHelper = new helperCls(this.logger, options); + getSudo() { + // eslint-disable-next-line @typescript-eslint/naming-convention + const SudoHelperType = SudoHelper(this.helperBase); + return this.clone(SudoHelperType) as T; + } +} - newHelper.api = this.api; - newHelper.network = this.network; - newHelper.forceNetwork = this.forceNetwork; +export class XcmChainHelper extends ChainHelperBase { + async connect(wsEndpoint: string, _listeners?: any): Promise { + const wsProvider = new WsProvider(wsEndpoint); + this.api = new ApiPromise({ + provider: wsProvider, + }); + await this.api.isReadyOrError; + this.network = await UniqueHelper.detectNetwork(this.api); + } +} - this.children.push(newHelper); +export class RelayHelper extends XcmChainHelper { + xcm: XcmGroup; - return newHelper; + constructor(logger?: ILogger, options: {[key: string]: any} = {}) { + super(logger, options.helperBase ?? RelayHelper); + + this.xcm = new XcmGroup(this, 'xcmPallet'); } +} - getSudo() { +export class MoonbeamHelper extends XcmChainHelper { + balance: EthereumBalanceGroup; + assetManager: MoonbeamAssetManagerGroup; + assets: MoonbeamAssetsGroup; + xTokens: XTokensGroup; + democracy: MoonbeamDemocracyGroup; + collective: { + council: MoonbeamCollectiveGroup, + techCommittee: MoonbeamCollectiveGroup, + }; + + constructor(logger?: ILogger, options: {[key: string]: any} = {}) { + super(logger, options.helperBase ?? MoonbeamHelper); + + this.balance = new EthereumBalanceGroup(this); + this.assetManager = new MoonbeamAssetManagerGroup(this); + this.assets = new MoonbeamAssetsGroup(this); + this.xTokens = new XTokensGroup(this); + this.democracy = new MoonbeamDemocracyGroup(this); + this.collective = { + council: new MoonbeamCollectiveGroup(this, 'councilCollective'), + techCommittee: new MoonbeamCollectiveGroup(this, 'techCommitteeCollective'), + }; + } +} + +export class AcalaHelper extends XcmChainHelper { + balance: SubstrateBalanceGroup; + assetRegistry: AcalaAssetRegistryGroup; + xTokens: XTokensGroup; + tokens: TokensGroup; + + constructor(logger?: ILogger, options: {[key: string]: any} = {}) { + super(logger, options.helperBase ?? AcalaHelper); + + this.balance = new SubstrateBalanceGroup(this); + this.assetRegistry = new AcalaAssetRegistryGroup(this); + this.xTokens = new XTokensGroup(this); + this.tokens = new TokensGroup(this); + } + + getSudo() { // eslint-disable-next-line @typescript-eslint/naming-convention - const SudoHelperType = SudoUniqueHelper(this.helperBase); + const SudoHelperType = SudoHelper(this.helperBase); return this.clone(SudoHelperType) as T; } } @@ -2437,7 +2720,7 @@ function ScheduledUniqueHelper(Base: T) { } // eslint-disable-next-line @typescript-eslint/naming-convention -function SudoUniqueHelper(Base: T) { +function SudoHelper(Base: T) { return class extends Base { constructor(...args: any[]) { super(...args); From 9f829acfc3d39fee1414a396d0137719a1c7e22b Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 10 Oct 2022 13:12:23 +0000 Subject: [PATCH 1084/1274] refactor: use playgrounds in quartz xcm tests --- tests/src/xcm/xcmQuartz.test.ts | 326 +++++++------------------------- 1 file changed, 73 insertions(+), 253 deletions(-) diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index 71b2cb7e74..f62bfb45a1 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -16,13 +16,10 @@ import {Keyring} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import {submitTransactionAsync} from '../substrate/substrate-api'; -import {getGenericResult, generateKeyringPair, waitEvent, bigIntToDecimals} from '../deprecated-helpers/helpers'; -import {MultiLocation} from '@polkadot/types/interfaces'; +import {generateKeyringPair, bigIntToDecimals} from '../deprecated-helpers/helpers'; import {blake2AsHex} from '@polkadot/util-crypto'; -import getBalance from '../substrate/get-balance'; import {XcmV2TraitsOutcome, XcmV2TraitsError} from '../interfaces'; -import {itSub, expect, describeXcm, usingPlaygrounds} from '../util/playgrounds'; +import {itSub, expect, describeXcm, usingPlaygrounds, usingKaruraPlaygrounds, usingRelayPlaygrounds, usingMoonriverPlaygrounds} from '../util/playgrounds'; const QUARTZ_CHAIN = 2095; const KARURA_CHAIN = 2000; @@ -63,9 +60,7 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Karura', () => { }); // Karura side - await usingPlaygrounds.atUrl(karuraUrl, async (helper) => { - const api = helper.getApi(); - + await usingKaruraPlaygrounds(karuraUrl, async (helper) => { const destination = { V0: { X2: [ @@ -81,43 +76,22 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Karura', () => { name: 'QTZ', symbol: 'QTZ', decimals: 18, - minimalBalance: 1, + minimalBalance: 1n, }; - const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata); - const sudoTx = api.tx.sudo.sudo(tx as any); - const events = await submitTransactionAsync(alice, sudoTx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); - const events1 = await submitTransactionAsync(alice, tx1); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; - - [balanceKaruraTokenInit] = await getBalance(api, [randomAccount.address]); - { - const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceQuartzForeignTokenInit = BigInt(free); - } + await helper.getSudo().assetRegistry.registerForeignAsset(alice, destination, metadata); + await helper.balance.transferToSubstrate(alice, randomAccount.address, 10000000000000n); + balanceKaruraTokenInit = await helper.balance.getSubstrate(randomAccount.address); + balanceQuartzForeignTokenInit = await helper.tokens.accounts(randomAccount.address, {ForeignAsset: 0}); }); - // Quartz side await usingPlaygrounds(async (helper) => { - // const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); - // const events0 = await submitTransactionAsync(alice, tx0); - // const result0 = getGenericResult(events0); - // expect(result0.success).to.be.true; await helper.balance.transferToSubstrate(alice, randomAccount.address, 10n * TRANSFER_AMOUNT); - - // [balanceQuartzTokenInit] = await getBalance(api, [randomAccount.address]); balanceQuartzTokenInit = await helper.balance.getSubstrate(randomAccount.address); }); }); itSub('Should connect and send QTZ to Karura', async ({helper}) => { - - // Quartz side const destination = { V0: { X2: [ @@ -157,34 +131,18 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Karura', () => { }; const feeAssetItem = 0; + const weightLimit = 5000000000; - const weightLimit = { - Limited: 5000000000, - }; - - // TODO - const tx = helper.getApi().tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); - const events = await submitTransactionAsync(randomAccount, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - // [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccount.address]); + await helper.xcm.limitedReserveTransferAssets(randomAccount, destination, beneficiary, assets, feeAssetItem, weightLimit); balanceQuartzTokenMiddle = await helper.balance.getSubstrate(randomAccount.address); const qtzFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT; console.log('[Quartz -> Karura] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees)); expect(qtzFees > 0n).to.be.true; - // Karura side - await usingPlaygrounds.atUrl(karuraUrl, async (helper) => { - // await waitNewBlocks(api, 3); + await usingKaruraPlaygrounds(karuraUrl, async (helper) => { await helper.wait.newBlocks(3); - - // TODO - const {free} = (await helper.getApi().query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceQuartzForeignTokenMiddle = BigInt(free); - - // [balanceKaruraTokenMiddle] = await getBalance(api, [randomAccount.address]); + balanceQuartzForeignTokenMiddle = await helper.tokens.accounts(randomAccount.address, {ForeignAsset: 0}); balanceKaruraTokenMiddle = await helper.balance.getSubstrate(randomAccount.address); const karFees = balanceKaruraTokenInit - balanceKaruraTokenMiddle; @@ -201,9 +159,7 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Karura', () => { }); itSub('Should connect to Karura and send QTZ back', async ({helper}) => { - - // Karura side - await usingPlaygrounds.atUrl(karuraUrl, async (helper) => { + await usingKaruraPlaygrounds(karuraUrl, async (helper) => { const destination = { V1: { parents: 1, @@ -227,19 +183,9 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Karura', () => { const destWeight = 50000000; - // TODO - const tx = helper.getApi().tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight); - const events = await submitTransactionAsync(randomAccount, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - // [balanceKaruraTokenFinal] = await getBalance(api, [randomAccount.address]); + await helper.xTokens.transfer(randomAccount, id, TRANSFER_AMOUNT, destination, destWeight); balanceKaruraTokenFinal = await helper.balance.getSubstrate(randomAccount.address); - { - // TODO - const {free} = (await helper.getApi().query.tokens.accounts(randomAccount.addressRaw, id)).toJSON() as any; - balanceQuartzForeignTokenFinal = BigInt(free); - } + balanceQuartzForeignTokenFinal = await helper.tokens.accounts(randomAccount.address, id); const karFees = balanceKaruraTokenMiddle - balanceKaruraTokenFinal; const qtzOutcomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenFinal; @@ -254,11 +200,8 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Karura', () => { expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; }); - // Quartz side - // await waitNewBlocks(api, 3); await helper.wait.newBlocks(3); - // [balanceQuartzTokenFinal] = await getBalance(api, [randomAccount.address]); balanceQuartzTokenFinal = await helper.balance.getSubstrate(randomAccount.address); const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle; expect(actuallyDelivered > 0).to.be.true; @@ -282,7 +225,7 @@ describeXcm('[XCM] Integration test: Quartz rejects non-native tokens', () => { }); itSub('Quartz rejects tokens from the Relay', async ({helper}) => { - await usingPlaygrounds.atUrl(relayUrl, async (helper) => { + await usingRelayPlaygrounds(relayUrl, async (helper) => { const destination = { V1: { parents: 0, @@ -321,27 +264,14 @@ describeXcm('[XCM] Integration test: Quartz rejects non-native tokens', () => { }; const feeAssetItem = 0; + const weightLimit = 5_000_000_000; - const weightLimit = { - Limited: 5_000_000_000, - }; - - // TODO - const tx = helper.getApi().tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); - const events = await submitTransactionAsync(alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + await helper.xcm.limitedReserveTransferAssets(alice, destination, beneficiary, assets, feeAssetItem, weightLimit); }); const maxWaitBlocks = 3; - // TODO - const dmpQueueExecutedDownward = await waitEvent( - helper.getApi(), - maxWaitBlocks, - 'dmpQueue', - 'ExecutedDownward', - ); + const dmpQueueExecutedDownward = await helper.wait.event(maxWaitBlocks, 'dmpQueue', 'ExecutedDownward'); expect( dmpQueueExecutedDownward != null, @@ -364,7 +294,7 @@ describeXcm('[XCM] Integration test: Quartz rejects non-native tokens', () => { }); itSub('Quartz rejects KAR tokens from Karura', async ({helper}) => { - await usingPlaygrounds.atUrl(karuraUrl, async (helper) => { + await usingKaruraPlaygrounds(karuraUrl, async (helper) => { const destination = { V1: { parents: 1, @@ -388,17 +318,12 @@ describeXcm('[XCM] Integration test: Quartz rejects non-native tokens', () => { const destWeight = 50000000; - // TODO - const tx = helper.getApi().tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight); - const events = await submitTransactionAsync(alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + await helper.xTokens.transfer(alice, id, 100_000_000_000n, destination, destWeight); }); const maxWaitBlocks = 3; - // TODO - const xcmpQueueFailEvent = await waitEvent(helper.getApi(), maxWaitBlocks, 'xcmpQueue', 'Fail'); + const xcmpQueueFailEvent = await helper.wait.event(maxWaitBlocks, 'xcmpQueue', 'Fail'); expect( xcmpQueueFailEvent != null, @@ -427,15 +352,6 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { // Moonriver constants let assetId: string; - const moonriverKeyring = new Keyring({type: 'ethereum'}); - const alithPrivateKey = '0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133'; - const baltatharPrivateKey = '0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b'; - const dorothyPrivateKey = '0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68'; - - const alithAccount = moonriverKeyring.addFromUri(alithPrivateKey, undefined, 'ethereum'); - const baltatharAccount = moonriverKeyring.addFromUri(baltatharPrivateKey, undefined, 'ethereum'); - const dorothyAccount = moonriverKeyring.addFromUri(dorothyPrivateKey, undefined, 'ethereum'); - const councilVotingThreshold = 2; const technicalCommitteeThreshold = 2; const votingPeriod = 3; @@ -446,7 +362,7 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { symbol: 'xcQTZ', decimals: 18, isFrozen: false, - minimalBalance: 1, + minimalBalance: 1n, }; let balanceQuartzTokenInit: bigint; @@ -471,149 +387,88 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { balanceForeignQtzTokenInit = 0n; }); - await usingPlaygrounds.atUrl(moonriverUrl, async (helper) => { - // TODO - - const api = helper.getApi(); + await usingMoonriverPlaygrounds(moonriverUrl, async (helper) => { + const alithAccount = helper.account.alithAccount(); + const baltatharAccount = helper.account.baltatharAccount(); + const dorothyAccount = helper.account.dorothyAccount(); // >>> Sponsoring Dorothy >>> console.log('Sponsoring Dorothy.......'); - // const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n); - // const events0 = await submitTransactionAsync(alithAccount, tx0); - // const result0 = getGenericResult(events0); - // expect(result0.success).to.be.true; - await helper.balance.transferToSubstrate(alithAccount, dorothyAccount.address, 11_000_000_000_000_000_000n); + await helper.balance.transferToEthereum(alithAccount, dorothyAccount.address, 11_000_000_000_000_000_000n); console.log('Sponsoring Dorothy.......DONE'); // <<< Sponsoring Dorothy <<< - const sourceLocation: MultiLocation = api.createType( - 'MultiLocation', - { + quartzAssetLocation = { + XCM: { parents: 1, interior: {X1: {Parachain: QUARTZ_CHAIN}}, }, - ); - - quartzAssetLocation = {XCM: sourceLocation}; - const existentialDeposit = 1; + }; + const existentialDeposit = 1n; const isSufficient = true; - const unitsPerSecond = '1'; + const unitsPerSecond = 1n; const numAssetsWeightHint = 0; - const registerTx = api.tx.assetManager.registerForeignAsset( - quartzAssetLocation, - quartzAssetMetadata, + const encodedProposal = helper.assetManager.makeRegisterForeignAssetProposal({ + location: quartzAssetLocation, + metadata: quartzAssetMetadata, existentialDeposit, isSufficient, - ); - console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || ''); - - const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond( - quartzAssetLocation, unitsPerSecond, numAssetsWeightHint, - ); - console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || ''); + }); + const proposalHash = blake2AsHex(encodedProposal); - const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]); - console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || ''); + console.log('Encoded proposal for registerForeignAsset & setAssetUnitsPerSecond is %s', encodedProposal); + console.log('Encoded length %d', encodedProposal.length); + console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); // >>> Note motion preimage >>> console.log('Note motion preimage.......'); - const encodedProposal = batchCall?.method.toHex() || ''; - const proposalHash = blake2AsHex(encodedProposal); - console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal); - console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); - console.log('Encoded length %d', encodedProposal.length); - - const tx1 = api.tx.democracy.notePreimage(encodedProposal); - const events1 = await submitTransactionAsync(baltatharAccount, tx1); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; + await helper.democracy.notePreimage(baltatharAccount, encodedProposal); console.log('Note motion preimage.......DONE'); // <<< Note motion preimage <<< // >>> Propose external motion through council >>> console.log('Propose external motion through council.......'); - const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash); - const tx2 = api.tx.councilCollective.propose( - councilVotingThreshold, - externalMotion, - externalMotion.encodedLength, - ); - const events2 = await submitTransactionAsync(baltatharAccount, tx2); - const result2 = getGenericResult(events2); - expect(result2.success).to.be.true; - + const externalMotion = helper.democracy.externalProposeMajority(proposalHash); const encodedMotion = externalMotion?.method.toHex() || ''; const motionHash = blake2AsHex(encodedMotion); console.log('Motion hash is %s', motionHash); - const tx3 = api.tx.councilCollective.vote(motionHash, 0, true); - { - const events3 = await submitTransactionAsync(dorothyAccount, tx3); - const result3 = getGenericResult(events3); - expect(result3.success).to.be.true; - } - { - const events3 = await submitTransactionAsync(baltatharAccount, tx3); - const result3 = getGenericResult(events3); - expect(result3.success).to.be.true; - } - - const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength); - const events4 = await submitTransactionAsync(dorothyAccount, tx4); - const result4 = getGenericResult(events4); - expect(result4.success).to.be.true; + await helper.collective.council.propose(baltatharAccount, councilVotingThreshold, externalMotion, externalMotion.encodedLength); + + const councilProposalIdx = await helper.collective.council.proposalCount() - 1; + await helper.collective.council.vote(dorothyAccount, motionHash, councilProposalIdx, true); + await helper.collective.council.vote(baltatharAccount, motionHash, councilProposalIdx, true); + + await helper.collective.council.close(dorothyAccount, motionHash, councilProposalIdx, 1_000_000_000, externalMotion.encodedLength); console.log('Propose external motion through council.......DONE'); // <<< Propose external motion through council <<< // >>> Fast track proposal through technical committee >>> console.log('Fast track proposal through technical committee.......'); - const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); - const tx5 = api.tx.techCommitteeCollective.propose( - technicalCommitteeThreshold, - fastTrack, - fastTrack.encodedLength, - ); - const events5 = await submitTransactionAsync(alithAccount, tx5); - const result5 = getGenericResult(events5); - expect(result5.success).to.be.true; - + const fastTrack = helper.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); const encodedFastTrack = fastTrack?.method.toHex() || ''; const fastTrackHash = blake2AsHex(encodedFastTrack); console.log('FastTrack hash is %s', fastTrackHash); - const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1; - const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true); - { - const events6 = await submitTransactionAsync(baltatharAccount, tx6); - const result6 = getGenericResult(events6); - expect(result6.success).to.be.true; - } - { - const events6 = await submitTransactionAsync(alithAccount, tx6); - const result6 = getGenericResult(events6); - expect(result6.success).to.be.true; - } - - const tx7 = api.tx.techCommitteeCollective - .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength); - const events7 = await submitTransactionAsync(baltatharAccount, tx7); - const result7 = getGenericResult(events7); - expect(result7.success).to.be.true; + await helper.collective.techCommittee.propose(alithAccount, technicalCommitteeThreshold, fastTrack, fastTrack.encodedLength); + + const techProposalIdx = await helper.collective.techCommittee.proposalCount() - 1; + await helper.collective.techCommittee.vote(baltatharAccount, fastTrackHash, techProposalIdx, true); + await helper.collective.techCommittee.vote(alithAccount, fastTrackHash, techProposalIdx, true); + + await helper.collective.techCommittee.close(baltatharAccount, fastTrackHash, techProposalIdx, 1_000_000_000, fastTrack.encodedLength); console.log('Fast track proposal through technical committee.......DONE'); // <<< Fast track proposal through technical committee <<< // >>> Referendum voting >>> console.log('Referendum voting.......'); - const tx8 = api.tx.democracy.vote( - 0, - {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}}, - ); - const events8 = await submitTransactionAsync(dorothyAccount, tx8); - const result8 = getGenericResult(events8); - expect(result8.success).to.be.true; + await helper.democracy.referendumVote(dorothyAccount, 0, { + balance: 10_000_000_000_000_000_000n, + vote: {aye: true, conviction: 1}, + }); console.log('Referendum voting.......DONE'); // <<< Referendum voting <<< @@ -621,12 +476,9 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { console.log('Acquire Quartz AssetId Info on Moonriver.......'); // Wait for the democracy execute - // await waitNewBlocks(api, 5); await helper.wait.newBlocks(5); - assetId = (await api.query.assetManager.assetTypeId({ - XCM: sourceLocation, - })).toString(); + assetId = (await helper.assetManager.assetTypeId(quartzAssetLocation)).toString(); console.log('QTZ asset ID is %s', assetId); console.log('Acquire Quartz AssetId Info on Moonriver.......DONE'); @@ -634,26 +486,15 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { // >>> Sponsoring random Account >>> console.log('Sponsoring random Account.......'); - // const tx10 = api.tx.balances.transfer(randomAccountMoonriver.address, 11_000_000_000_000_000_000n); - // const events10 = await submitTransactionAsync(baltatharAccount, tx10); - // const result10 = getGenericResult(events10); - // expect(result10.success).to.be.true; - await helper.balance.transferToSubstrate(baltatharAccount, randomAccountMoonriver.address, 11_000_000_000_000_000_000n); + await helper.balance.transferToEthereum(baltatharAccount, randomAccountMoonriver.address, 11_000_000_000_000_000_000n); console.log('Sponsoring random Account.......DONE'); // <<< Sponsoring random Account <<< - // [balanceMovrTokenInit] = await getBalance(api, [randomAccountMoonriver.address]); - balanceMovrTokenInit = await helper.balance.getSubstrate(randomAccountMoonriver.address); + balanceMovrTokenInit = await helper.balance.getEthereum(randomAccountMoonriver.address); }); await usingPlaygrounds(async (helper) => { - // const tx0 = api.tx.balances.transfer(randomAccountQuartz.address, 10n * TRANSFER_AMOUNT); - // const events0 = await submitTransactionAsync(quartzAlice, tx0); - // const result0 = getGenericResult(events0); - // expect(result0.success).to.be.true; await helper.balance.transferToSubstrate(quartzAlice, randomAccountQuartz.address, 10n * TRANSFER_AMOUNT); - - // [balanceQuartzTokenInit] = await getBalance(api, [randomAccountQuartz.address]); balanceQuartzTokenInit = await helper.balance.getSubstrate(randomAccountQuartz.address); }); }); @@ -676,13 +517,8 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { const amount = TRANSFER_AMOUNT; const destWeight = 850000000; - // TODO - const tx = helper.getApi().tx.xTokens.transfer(currencyId, amount, dest, destWeight); - const events = await submitTransactionAsync(randomAccountQuartz, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + await helper.xTokens.transfer(randomAccountQuartz, currencyId, amount, dest, destWeight); - // [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccountQuartz.address]); balanceQuartzTokenMiddle = await helper.balance.getSubstrate(randomAccountQuartz.address); expect(balanceQuartzTokenMiddle < balanceQuartzTokenInit).to.be.true; @@ -690,23 +526,16 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { console.log('[Quartz -> Moonriver] transaction fees on Quartz: %s QTZ', bigIntToDecimals(transactionFees)); expect(transactionFees > 0).to.be.true; - await usingPlaygrounds.atUrl(moonriverUrl, async (helper) => { - // await waitNewBlocks(api, 3); + await usingMoonriverPlaygrounds(moonriverUrl, async (helper) => { await helper.wait.newBlocks(3); - // [balanceMovrTokenMiddle] = await getBalance(api, [randomAccountMoonriver.address]); - balanceMovrTokenMiddle = await helper.balance.getSubstrate(randomAccountMoonriver.address); + balanceMovrTokenMiddle = await helper.balance.getEthereum(randomAccountMoonriver.address); const movrFees = balanceMovrTokenInit - balanceMovrTokenMiddle; console.log('[Quartz -> Moonriver] transaction fees on Moonriver: %s MOVR',bigIntToDecimals(movrFees)); expect(movrFees == 0n).to.be.true; - // TODO - const qtzRandomAccountAsset = ( - await helper.getApi().query.assets.account(assetId, randomAccountMoonriver.address) - ).toJSON()! as any; - - balanceForeignQtzTokenMiddle = BigInt(qtzRandomAccountAsset['balance']); + balanceForeignQtzTokenMiddle = (await helper.assets.account(assetId, randomAccountMoonriver.address))!; // BigInt(qtzRandomAccountAsset['balance']); const qtzIncomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenInit; console.log('[Quartz -> Moonriver] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer)); expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true; @@ -714,7 +543,7 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { }); itSub('Should connect to Moonriver and send QTZ back', async ({helper}) => { - await usingPlaygrounds.atUrl(moonriverUrl, async (helper) => { + await usingMoonriverPlaygrounds(moonriverUrl, async (helper) => { const asset = { V1: { id: { @@ -743,22 +572,15 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { }; const destWeight = 50000000; - // TODO - const tx = helper.getApi().tx.xTokens.transferMultiasset(asset, destination, destWeight); - const events = await submitTransactionAsync(randomAccountMoonriver, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + await helper.xTokens.transferMultiasset(randomAccountMoonriver, asset, destination, destWeight); - // [balanceMovrTokenFinal] = await getBalance(api, [randomAccountMoonriver.address]); - balanceMovrTokenFinal = await helper.balance.getSubstrate(randomAccountMoonriver.address); + balanceMovrTokenFinal = await helper.balance.getEthereum(randomAccountMoonriver.address); const movrFees = balanceMovrTokenMiddle - balanceMovrTokenFinal; console.log('[Moonriver -> Quartz] transaction fees on Moonriver: %s MOVR', bigIntToDecimals(movrFees)); expect(movrFees > 0).to.be.true; - const qtzRandomAccountAsset = ( - await helper.getApi().query.assets.account(assetId, randomAccountMoonriver.address) - ).toJSON()! as any; + const qtzRandomAccountAsset = await helper.assets.account(assetId, randomAccountMoonriver.address); expect(qtzRandomAccountAsset).to.be.null; @@ -769,10 +591,8 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; }); - // await waitNewBlocks(api, 3); await helper.wait.newBlocks(3); - // [balanceQuartzTokenFinal] = await getBalance(api, [randomAccountQuartz.address]); balanceQuartzTokenFinal = await helper.balance.getSubstrate(randomAccountQuartz.address); const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle; expect(actuallyDelivered > 0).to.be.true; From 6c62f5a03f69cda2923b439633b2dccc5b096da5 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Mon, 10 Oct 2022 17:34:12 +0400 Subject: [PATCH 1085/1274] Split promotion tests to sequential and parallel - add globalSetup script to set app promotion admin - move calculatePalleteAddress helper to DevUniqueHelper --- tests/globalSetup.ts | 18 +++++ tests/package.json | 2 +- tests/src/app-promotion.seqtest.ts | 83 ++++++++++++++++++++++++ tests/src/app-promotion.test.ts | 66 ++----------------- tests/src/util/playgrounds/unique.dev.ts | 8 ++- 5 files changed, 113 insertions(+), 64 deletions(-) create mode 100644 tests/globalSetup.ts create mode 100644 tests/src/app-promotion.seqtest.ts diff --git a/tests/globalSetup.ts b/tests/globalSetup.ts new file mode 100644 index 0000000000..5dd82e1bd2 --- /dev/null +++ b/tests/globalSetup.ts @@ -0,0 +1,18 @@ +import {Pallets, usingPlaygrounds} from './src/util/playgrounds/index'; + +export async function mochaGlobalSetup() { + await usingPlaygrounds(async (helper, privateKey) => { + // Set up App Promotion admin + const missingPallets = helper.fetchMissingPalletNames([Pallets.AppPromotion]); + if (missingPallets.length === 0) { + const superuser = await privateKey('//Alice'); + const palletAddress = helper.arrange.calculatePalleteAddress('appstake'); + const palletAdmin = await privateKey('//PromotionAdmin'); + const api = helper.getApi(); + await helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); + const nominal = helper.balance.getOneTokenNominal(); + await helper.balance.transferToSubstrate(superuser, palletAdmin.address, 1000n * nominal); + await helper.balance.transferToSubstrate(superuser, palletAddress, 1000n * nominal); + } + }); +} diff --git a/tests/package.json b/tests/package.json index 1ae5b00bf2..be773841cc 100644 --- a/tests/package.json +++ b/tests/package.json @@ -21,7 +21,7 @@ }, "mocha": { "timeout": 9999999, - "require": "ts-node/register" + "require": ["ts-node/register", "./globalSetup.ts"] }, "scripts": { "lint": "eslint --ext .ts,.js src/", diff --git a/tests/src/app-promotion.seqtest.ts b/tests/src/app-promotion.seqtest.ts new file mode 100644 index 0000000000..e5f5861d52 --- /dev/null +++ b/tests/src/app-promotion.seqtest.ts @@ -0,0 +1,83 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import {IKeyringPair} from '@polkadot/types/types'; +import {itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip} from './util/playgrounds'; +import {expect} from './eth/util/playgrounds'; + +let superuser: IKeyringPair; +let donor: IKeyringPair; +let palletAdmin: IKeyringPair; +let nominal: bigint; +let palletAddress; +let accounts: IKeyringPair[]; + + +describe('App promotion', () => { + before(async function () { + await usingPlaygrounds(async (helper, privateKey) => { + requirePalletsOrSkip(this, helper, [Pallets.AppPromotion]); + superuser = await privateKey('//Alice'); + donor = await privateKey({filename: __filename}); + palletAddress = helper.arrange.calculatePalleteAddress('appstake'); + palletAdmin = await privateKey('//PromotionAdmin'); + const api = helper.getApi(); + await helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); + nominal = helper.balance.getOneTokenNominal(); + await helper.balance.transferToSubstrate(donor, palletAdmin.address, 1000n * nominal); + await helper.balance.transferToSubstrate(donor, palletAddress, 1000n * nominal); + accounts = await helper.arrange.createCrowd(100, 1000n, donor); // create accounts-pool to speed up tests + }); + }); + + describe('admin adress', () => { + itSub('can be set by sudo only', async ({helper}) => { + const api = helper.getApi(); + const nonAdmin = accounts.pop()!; + // nonAdmin can not set admin not from himself nor as a sudo + await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.rejected; + await expect(helper.signTransaction(nonAdmin, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.rejected; + }); + + itSub('can be any valid CrossAccountId', async ({helper}) => { + // We are not going to set an eth address as a sponsor, + // but we do want to check, it doesn't break anything; + const api = helper.getApi(); + const account = accounts.pop()!; + const ethAccount = helper.address.substrateToEth(account.address); + // Alice sets Ethereum address as a sudo. Then Substrate address back... + await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.fulfilled; + await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; + + // ...It doesn't break anything; + const collection = await helper.nft.mintCollection(account, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + await expect(helper.signTransaction(account, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; + }); + + itSub('can be reassigned', async ({helper}) => { + const api = helper.getApi(); + const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; + const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); + + await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: oldAdmin.address})))).to.be.fulfilled; + await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: newAdmin.address})))).to.be.fulfilled; + await expect(helper.signTransaction(oldAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; + + await expect(helper.signTransaction(newAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled; + }); + }); +}); + diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 6cb4371861..362b2681e4 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -16,17 +16,14 @@ import {IKeyringPair} from '@polkadot/types/types'; import {itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip} from './util/playgrounds'; -import {encodeAddress} from '@polkadot/util-crypto'; -import {stringToU8a} from '@polkadot/util'; import {DevUniqueHelper} from './util/playgrounds/unique.dev'; import {itEth, expect, SponsoringMode} from './eth/util/playgrounds'; -let superuser: IKeyringPair; let donor: IKeyringPair; let palletAdmin: IKeyringPair; let nominal: bigint; -const palletAddress = calculatePalleteAddress('appstake'); -let accounts: IKeyringPair[] = []; +let palletAddress: string; +let accounts: IKeyringPair[]; const LOCKING_PERIOD = 20n; // 20 blocks of relay const UNLOCKING_PERIOD = 10n; // 10 blocks of parachain const rewardAvailableInBlock = (stakedInBlock: bigint) => { @@ -38,11 +35,9 @@ describe('App promotion', () => { before(async function () { await usingPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.AppPromotion]); - superuser = await privateKey('//Alice'); donor = await privateKey({filename: __filename}); - [palletAdmin] = await helper.arrange.createAccounts([100n], donor); - const api = helper.getApi(); - await helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); + palletAddress = helper.arrange.calculatePalleteAddress('appstake'); + palletAdmin = await privateKey('//PromotionAdmin'); nominal = helper.balance.getOneTokenNominal(); await helper.balance.transferToSubstrate(donor, palletAdmin.address, 1000n * nominal); await helper.balance.transferToSubstrate(donor, palletAddress, 1000n * nominal); @@ -226,55 +221,7 @@ describe('App promotion', () => { }); }); - describe('admin adress', () => { - itSub('can be set by sudo only', async ({helper}) => { - const api = helper.getApi(); - const nonAdmin = accounts.pop()!; - // nonAdmin can not set admin not from himself nor as a sudo - await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.rejected; - await expect(helper.signTransaction(nonAdmin, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.rejected; - - // Alice can - await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; - }); - - itSub('can be any valid CrossAccountId', async ({helper}) => { - // We are not going to set an eth address as a sponsor, - // but we do want to check, it doesn't break anything; - const api = helper.getApi(); - const account = accounts.pop()!; - const ethAccount = helper.address.substrateToEth(account.address); - // Alice sets Ethereum address as a sudo. Then Substrate address back... - await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.fulfilled; - await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled; - - // ...It doesn't break anything; - const collection = await helper.nft.mintCollection(account, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - await expect(helper.signTransaction(account, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; - }); - - itSub('can be reassigned', async ({helper}) => { - const api = helper.getApi(); - const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; - const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); - - await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: oldAdmin.address})))).to.be.fulfilled; - await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: newAdmin.address})))).to.be.fulfilled; - await expect(helper.signTransaction(oldAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected; - - await expect(helper.signTransaction(newAdmin, api.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled; - }); - }); - describe('collection sponsoring', () => { - before(async function () { - await usingPlaygrounds(async (helper) => { - const api = helper.getApi(); - const tx = api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})); - await helper.signTransaction(superuser, tx); - }); - }); - itSub('should actually sponsor transactions', async ({helper}) => { const api = helper.getApi(); const [collectionOwner, tokenSender, receiver] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; @@ -709,11 +656,6 @@ describe('App promotion', () => { }); }); -function calculatePalleteAddress(palletId: any) { - const address = stringToU8a(('modl' + palletId).padEnd(32, '\0')); - return encodeAddress(address); -} - function calculateIncome(base: bigint, calcPeriod: bigint, iter = 0): bigint { const DAY = 7200n; const ACCURACY = 1_000_000_000n; diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index af25949bfb..c34cd18021 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -1,7 +1,8 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // SPDX-License-Identifier: Apache-2.0 -import {mnemonicGenerate} from '@polkadot/util-crypto'; +import {stringToU8a} from '@polkadot/util'; +import {encodeAddress, mnemonicGenerate} from '@polkadot/util-crypto'; import {UniqueHelper} from './unique'; import {ApiPromise, WsProvider} from '@polkadot/api'; import * as defs from '../../interfaces/definitions'; @@ -243,6 +244,11 @@ class ArrangeGroup { return balance; } + + calculatePalleteAddress(palletId: any) { + const address = stringToU8a(('modl' + palletId).padEnd(32, '\0')); + return encodeAddress(address); + } } class WaitGroup { From 3833b2da5ea7ddaa7e8f5c645ee485bf28b9fa3f Mon Sep 17 00:00:00 2001 From: Maksandre Date: Mon, 10 Oct 2022 17:58:58 +0400 Subject: [PATCH 1086/1274] Tests app-promotion: cleanup before scripts --- tests/src/app-promotion.seqtest.ts | 15 +++------------ tests/src/app-promotion.test.ts | 2 -- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/tests/src/app-promotion.seqtest.ts b/tests/src/app-promotion.seqtest.ts index e5f5861d52..a39e42d779 100644 --- a/tests/src/app-promotion.seqtest.ts +++ b/tests/src/app-promotion.seqtest.ts @@ -21,10 +21,6 @@ import {expect} from './eth/util/playgrounds'; let superuser: IKeyringPair; let donor: IKeyringPair; let palletAdmin: IKeyringPair; -let nominal: bigint; -let palletAddress; -let accounts: IKeyringPair[]; - describe('App promotion', () => { before(async function () { @@ -32,21 +28,16 @@ describe('App promotion', () => { requirePalletsOrSkip(this, helper, [Pallets.AppPromotion]); superuser = await privateKey('//Alice'); donor = await privateKey({filename: __filename}); - palletAddress = helper.arrange.calculatePalleteAddress('appstake'); palletAdmin = await privateKey('//PromotionAdmin'); const api = helper.getApi(); await helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); - nominal = helper.balance.getOneTokenNominal(); - await helper.balance.transferToSubstrate(donor, palletAdmin.address, 1000n * nominal); - await helper.balance.transferToSubstrate(donor, palletAddress, 1000n * nominal); - accounts = await helper.arrange.createCrowd(100, 1000n, donor); // create accounts-pool to speed up tests }); }); describe('admin adress', () => { itSub('can be set by sudo only', async ({helper}) => { const api = helper.getApi(); - const nonAdmin = accounts.pop()!; + const [nonAdmin] = await helper.arrange.createAccounts([10n], donor); // nonAdmin can not set admin not from himself nor as a sudo await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.rejected; await expect(helper.signTransaction(nonAdmin, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.rejected; @@ -56,7 +47,7 @@ describe('App promotion', () => { // We are not going to set an eth address as a sponsor, // but we do want to check, it doesn't break anything; const api = helper.getApi(); - const account = accounts.pop()!; + const [account] = await helper.arrange.createAccounts([10n], donor); const ethAccount = helper.address.substrateToEth(account.address); // Alice sets Ethereum address as a sudo. Then Substrate address back... await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.fulfilled; @@ -69,7 +60,7 @@ describe('App promotion', () => { itSub('can be reassigned', async ({helper}) => { const api = helper.getApi(); - const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!]; + const [oldAdmin, newAdmin, collectionOwner] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'}); await expect(helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: oldAdmin.address})))).to.be.fulfilled; diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 362b2681e4..a31b9b7888 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -39,8 +39,6 @@ describe('App promotion', () => { palletAddress = helper.arrange.calculatePalleteAddress('appstake'); palletAdmin = await privateKey('//PromotionAdmin'); nominal = helper.balance.getOneTokenNominal(); - await helper.balance.transferToSubstrate(donor, palletAdmin.address, 1000n * nominal); - await helper.balance.transferToSubstrate(donor, palletAddress, 1000n * nominal); accounts = await helper.arrange.createCrowd(100, 1000n, donor); // create accounts-pool to speed up tests }); }); From c18879f1d0cb6cb045552a175c0c9f1bf92ee8a1 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 10 Oct 2022 14:33:53 +0000 Subject: [PATCH 1087/1274] refactor: use playgrounds in unique xcm tests --- tests/src/xcm/xcmUnique.test.ts | 312 +++++++------------------------- 1 file changed, 70 insertions(+), 242 deletions(-) diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index 6a873843b0..dad69d2b5d 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -16,13 +16,10 @@ import {Keyring} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import {submitTransactionAsync} from '../substrate/substrate-api'; -import {getGenericResult, generateKeyringPair, waitEvent, bigIntToDecimals} from '../deprecated-helpers/helpers'; -import {MultiLocation} from '@polkadot/types/interfaces'; +import {generateKeyringPair, bigIntToDecimals} from '../deprecated-helpers/helpers'; import {blake2AsHex} from '@polkadot/util-crypto'; -import getBalance from '../substrate/get-balance'; import {XcmV2TraitsError, XcmV2TraitsOutcome} from '../interfaces'; -import {itSub, expect, describeXcm, usingPlaygrounds} from '../util/playgrounds'; +import {itSub, expect, describeXcm, usingPlaygrounds, usingAcalaPlaygrounds, usingRelayPlaygrounds, usingMoonbeamPlaygrounds} from '../util/playgrounds'; const UNIQUE_CHAIN = 2037; const ACALA_CHAIN = 2000; @@ -62,8 +59,7 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Acala', () => { randomAccount = generateKeyringPair(keyringSr25519); }); - // Acala side - await usingPlaygrounds.atUrl(acalaUrl, async (helper) => { + await usingAcalaPlaygrounds(acalaUrl, async (helper) => { const destination = { V0: { X2: [ @@ -79,47 +75,23 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Acala', () => { name: 'UNQ', symbol: 'UNQ', decimals: 18, - minimalBalance: 1, + minimalBalance: 1n, }; - // TODO - const tx = helper.getApi().tx.assetRegistry.registerForeignAsset(destination, metadata); - const sudoTx = helper.getApi().tx.sudo.sudo(tx as any); - const events = await submitTransactionAsync(alice, sudoTx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - // const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n); - // const events1 = await submitTransactionAsync(alice, tx1); - // const result1 = getGenericResult(events1); - // expect(result1.success).to.be.true; + await helper.getSudo().assetRegistry.registerForeignAsset(alice, destination, metadata); await helper.balance.transferToSubstrate(alice, randomAccount.address, 10000000000000n); - - // [balanceAcalaTokenInit] = await getBalance(api, [randomAccount.address]); balanceAcalaTokenInit = await helper.balance.getSubstrate(randomAccount.address); - { - // TODO - const {free} = (await helper.getApi().query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceUniqueForeignTokenInit = BigInt(free); - } + balanceUniqueForeignTokenInit = await helper.tokens.accounts(randomAccount.address, {ForeignAsset: 0}); }); - // Unique side await usingPlaygrounds(async (helper) => { - // const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT); - // const events0 = await submitTransactionAsync(alice, tx0); - // const result0 = getGenericResult(events0); - // expect(result0.success).to.be.true; await helper.balance.transferToSubstrate(alice, randomAccount.address, 10n * TRANSFER_AMOUNT); - - // [balanceUniqueTokenInit] = await getBalance(api, [randomAccount.address]); balanceUniqueTokenInit = await helper.balance.getSubstrate(randomAccount.address); }); }); itSub('Should connect and send UNQ to Acala', async ({helper}) => { - // Unique side const destination = { V0: { X2: [ @@ -159,34 +131,20 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Acala', () => { }; const feeAssetItem = 0; + const weightLimit = 5000000000; - const weightLimit = { - Limited: 5000000000, - }; + await helper.xcm.limitedReserveTransferAssets(randomAccount, destination, beneficiary, assets, feeAssetItem, weightLimit); - // TODO - const tx = helper.getApi().tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); - const events = await submitTransactionAsync(randomAccount, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - // [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccount.address]); balanceUniqueTokenMiddle = await helper.balance.getSubstrate(randomAccount.address); const unqFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT; console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees)); expect(unqFees > 0n).to.be.true; - // Acala side - await usingPlaygrounds.atUrl(acalaUrl, async (helper) => { - // await waitNewBlocks(api, 3); + await usingAcalaPlaygrounds(acalaUrl, async (helper) => { await helper.wait.newBlocks(3); - // TODO - const {free} = (await helper.getApi().query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any; - balanceUniqueForeignTokenMiddle = BigInt(free); - - // [balanceAcalaTokenMiddle] = await getBalance(api, [randomAccount.address]); + balanceUniqueForeignTokenMiddle = await helper.tokens.accounts(randomAccount.address, {ForeignAsset: 0}); balanceAcalaTokenMiddle = await helper.balance.getSubstrate(randomAccount.address); const acaFees = balanceAcalaTokenInit - balanceAcalaTokenMiddle; @@ -203,9 +161,7 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Acala', () => { }); itSub('Should connect to Acala and send UNQ back', async ({helper}) => { - - // Acala side - await usingPlaygrounds.atUrl(acalaUrl, async (helper) => { + await usingAcalaPlaygrounds(acalaUrl, async (helper) => { const destination = { V1: { parents: 1, @@ -229,19 +185,10 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Acala', () => { const destWeight = 50000000; - // TODO - const tx = helper.getApi().tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight); - const events = await submitTransactionAsync(randomAccount, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + await helper.xTokens.transfer(randomAccount, id, TRANSFER_AMOUNT, destination, destWeight); - // [balanceAcalaTokenFinal] = await getBalance(api, [randomAccount.address]); balanceAcalaTokenFinal = await helper.balance.getSubstrate(randomAccount.address); - { - // TODO - const {free} = (await helper.getApi().query.tokens.accounts(randomAccount.addressRaw, id)).toJSON() as any; - balanceUniqueForeignTokenFinal = BigInt(free); - } + balanceUniqueForeignTokenFinal = await helper.tokens.accounts(randomAccount.address, id); const acaFees = balanceAcalaTokenMiddle - balanceAcalaTokenFinal; const unqOutcomeTransfer = balanceUniqueForeignTokenMiddle - balanceUniqueForeignTokenFinal; @@ -256,10 +203,8 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Acala', () => { expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; }); - // await waitNewBlocks(api, 3); await helper.wait.newBlocks(3); - // [balanceUniqueTokenFinal] = await getBalance(api, [randomAccount.address]); balanceUniqueTokenFinal = await helper.balance.getSubstrate(randomAccount.address); const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle; expect(actuallyDelivered > 0).to.be.true; @@ -283,7 +228,7 @@ describeXcm('[XCM] Integration test: Unique rejects non-native tokens', () => { }); itSub('Unique rejects tokens from the Relay', async ({helper}) => { - await usingPlaygrounds.atUrl(relayUrl, async (helper) => { + await usingRelayPlaygrounds(relayUrl, async (helper) => { const destination = { V1: { parents: 0, @@ -322,27 +267,14 @@ describeXcm('[XCM] Integration test: Unique rejects non-native tokens', () => { }; const feeAssetItem = 0; + const weightLimit = 5_000_000_000; - const weightLimit = { - Limited: 5_000_000_000, - }; - - // TODO - const tx = helper.getApi().tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); - const events = await submitTransactionAsync(alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + await helper.xcm.limitedReserveTransferAssets(alice, destination, beneficiary, assets, feeAssetItem, weightLimit); }); const maxWaitBlocks = 3; - // TODO - const dmpQueueExecutedDownward = await waitEvent( - helper.getApi(), - maxWaitBlocks, - 'dmpQueue', - 'ExecutedDownward', - ); + const dmpQueueExecutedDownward = await helper.wait.event(maxWaitBlocks, 'dmpQueue', 'ExecutedDownward'); expect( dmpQueueExecutedDownward != null, @@ -365,7 +297,7 @@ describeXcm('[XCM] Integration test: Unique rejects non-native tokens', () => { }); itSub('Unique rejects ACA tokens from Acala', async ({helper}) => { - await usingPlaygrounds.atUrl(acalaUrl, async (helper) => { + await usingAcalaPlaygrounds(acalaUrl, async (helper) => { const destination = { V1: { parents: 1, @@ -389,17 +321,12 @@ describeXcm('[XCM] Integration test: Unique rejects non-native tokens', () => { const destWeight = 50000000; - // TODO - const tx = helper.getApi().tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight); - const events = await submitTransactionAsync(alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + await helper.xTokens.transfer(alice, id, 100_000_000_000n, destination, destWeight); }); const maxWaitBlocks = 3; - // TODO - const xcmpQueueFailEvent = await waitEvent(helper.getApi(), maxWaitBlocks, 'xcmpQueue', 'Fail'); + const xcmpQueueFailEvent = await helper.wait.event(maxWaitBlocks, 'xcmpQueue', 'Fail'); expect( xcmpQueueFailEvent != null, @@ -416,7 +343,7 @@ describeXcm('[XCM] Integration test: Unique rejects non-native tokens', () => { }); }); -describeXcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { +describe.only('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { // Unique constants let uniqueAlice: IKeyringPair; @@ -447,7 +374,7 @@ describeXcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { symbol: 'xcUNQ', decimals: 18, isFrozen: false, - minimalBalance: 1, + minimalBalance: 1n, }; let balanceUniqueTokenInit: bigint; @@ -472,149 +399,84 @@ describeXcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { balanceForeignUnqTokenInit = 0n; }); - await usingPlaygrounds.atUrl(moonbeamUrl, async (helper) => { - // TODO - - const api = helper.getApi(); - + await usingMoonbeamPlaygrounds(moonbeamUrl, async (helper) => { // >>> Sponsoring Dorothy >>> console.log('Sponsoring Dorothy.......'); - // const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n); - // const events0 = await submitTransactionAsync(alithAccount, tx0); - // const result0 = getGenericResult(events0); - // expect(result0.success).to.be.true; - await helper.balance.transferToSubstrate(alithAccount, dorothyAccount.address, 11_000_000_000_000_000_000n); + await helper.balance.transferToEthereum(alithAccount, dorothyAccount.address, 11_000_000_000_000_000_000n); console.log('Sponsoring Dorothy.......DONE'); // <<< Sponsoring Dorothy <<< - const sourceLocation: MultiLocation = api.createType( - 'MultiLocation', - { + uniqueAssetLocation = { + XCM: { parents: 1, interior: {X1: {Parachain: UNIQUE_CHAIN}}, }, - ); - - uniqueAssetLocation = {XCM: sourceLocation}; - const existentialDeposit = 1; + }; + const existentialDeposit = 1n; const isSufficient = true; - const unitsPerSecond = '1'; + const unitsPerSecond = 1n; const numAssetsWeightHint = 0; - const registerTx = api.tx.assetManager.registerForeignAsset( - uniqueAssetLocation, - uniqueAssetMetadata, + const encodedProposal = helper.assetManager.makeRegisterForeignAssetProposal({ + location: uniqueAssetLocation, + metadata: uniqueAssetMetadata, existentialDeposit, isSufficient, - ); - console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || ''); - - const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond( - uniqueAssetLocation, unitsPerSecond, numAssetsWeightHint, - ); - console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || ''); + }); + const proposalHash = blake2AsHex(encodedProposal); - const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]); - console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || ''); + console.log('Encoded proposal for registerForeignAsset & setAssetUnitsPerSecond is %s', encodedProposal); + console.log('Encoded length %d', encodedProposal.length); + console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); // >>> Note motion preimage >>> console.log('Note motion preimage.......'); - const encodedProposal = batchCall?.method.toHex() || ''; - const proposalHash = blake2AsHex(encodedProposal); - console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal); - console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash); - console.log('Encoded length %d', encodedProposal.length); - - const tx1 = api.tx.democracy.notePreimage(encodedProposal); - const events1 = await submitTransactionAsync(baltatharAccount, tx1); - const result1 = getGenericResult(events1); - expect(result1.success).to.be.true; + await helper.democracy.notePreimage(baltatharAccount, encodedProposal); console.log('Note motion preimage.......DONE'); // <<< Note motion preimage <<< // >>> Propose external motion through council >>> console.log('Propose external motion through council.......'); - const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash); - const tx2 = api.tx.councilCollective.propose( - councilVotingThreshold, - externalMotion, - externalMotion.encodedLength, - ); - const events2 = await submitTransactionAsync(baltatharAccount, tx2); - const result2 = getGenericResult(events2); - expect(result2.success).to.be.true; - + const externalMotion = helper.democracy.externalProposeMajority(proposalHash); const encodedMotion = externalMotion?.method.toHex() || ''; const motionHash = blake2AsHex(encodedMotion); console.log('Motion hash is %s', motionHash); - const tx3 = api.tx.councilCollective.vote(motionHash, 0, true); - { - const events3 = await submitTransactionAsync(dorothyAccount, tx3); - const result3 = getGenericResult(events3); - expect(result3.success).to.be.true; - } - { - const events3 = await submitTransactionAsync(baltatharAccount, tx3); - const result3 = getGenericResult(events3); - expect(result3.success).to.be.true; - } - - const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength); - const events4 = await submitTransactionAsync(dorothyAccount, tx4); - const result4 = getGenericResult(events4); - expect(result4.success).to.be.true; + await helper.collective.council.propose(baltatharAccount, councilVotingThreshold, externalMotion, externalMotion.encodedLength); + + const councilProposalIdx = await helper.collective.council.proposalCount() - 1; + await helper.collective.council.vote(dorothyAccount, motionHash, councilProposalIdx, true); + await helper.collective.council.vote(baltatharAccount, motionHash, councilProposalIdx, true); + + await helper.collective.council.close(dorothyAccount, motionHash, councilProposalIdx, 1_000_000_000, externalMotion.encodedLength); console.log('Propose external motion through council.......DONE'); // <<< Propose external motion through council <<< // >>> Fast track proposal through technical committee >>> console.log('Fast track proposal through technical committee.......'); - const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); - const tx5 = api.tx.techCommitteeCollective.propose( - technicalCommitteeThreshold, - fastTrack, - fastTrack.encodedLength, - ); - const events5 = await submitTransactionAsync(alithAccount, tx5); - const result5 = getGenericResult(events5); - expect(result5.success).to.be.true; - + const fastTrack = helper.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod); const encodedFastTrack = fastTrack?.method.toHex() || ''; const fastTrackHash = blake2AsHex(encodedFastTrack); console.log('FastTrack hash is %s', fastTrackHash); - const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1; - const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true); - { - const events6 = await submitTransactionAsync(baltatharAccount, tx6); - const result6 = getGenericResult(events6); - expect(result6.success).to.be.true; - } - { - const events6 = await submitTransactionAsync(alithAccount, tx6); - const result6 = getGenericResult(events6); - expect(result6.success).to.be.true; - } - - const tx7 = api.tx.techCommitteeCollective - .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength); - const events7 = await submitTransactionAsync(baltatharAccount, tx7); - const result7 = getGenericResult(events7); - expect(result7.success).to.be.true; + await helper.collective.techCommittee.propose(alithAccount, technicalCommitteeThreshold, fastTrack, fastTrack.encodedLength); + + const techProposalIdx = await helper.collective.techCommittee.proposalCount() - 1; + await helper.collective.techCommittee.vote(baltatharAccount, fastTrackHash, techProposalIdx, true); + await helper.collective.techCommittee.vote(alithAccount, fastTrackHash, techProposalIdx, true); + + await helper.collective.techCommittee.close(baltatharAccount, fastTrackHash, techProposalIdx, 1_000_000_000, fastTrack.encodedLength); console.log('Fast track proposal through technical committee.......DONE'); // <<< Fast track proposal through technical committee <<< // >>> Referendum voting >>> console.log('Referendum voting.......'); - const tx8 = api.tx.democracy.vote( - 0, - {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}}, - ); - const events8 = await submitTransactionAsync(dorothyAccount, tx8); - const result8 = getGenericResult(events8); - expect(result8.success).to.be.true; + await helper.democracy.referendumVote(dorothyAccount, 0, { + balance: 10_000_000_000_000_000_000n, + vote: {aye: true, conviction: 1}, + }); console.log('Referendum voting.......DONE'); // <<< Referendum voting <<< @@ -622,12 +484,9 @@ describeXcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { console.log('Acquire Unique AssetId Info on Moonbeam.......'); // Wait for the democracy execute - // await waitNewBlocks(api, 5); await helper.wait.newBlocks(5); - assetId = (await api.query.assetManager.assetTypeId({ - XCM: sourceLocation, - })).toString(); + assetId = (await helper.assetManager.assetTypeId(uniqueAssetLocation)).toString(); console.log('UNQ asset ID is %s', assetId); console.log('Acquire Unique AssetId Info on Moonbeam.......DONE'); @@ -635,25 +494,15 @@ describeXcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { // >>> Sponsoring random Account >>> console.log('Sponsoring random Account.......'); - // const tx10 = api.tx.balances.transfer(randomAccountMoonbeam.address, 11_000_000_000_000_000_000n); - // const events10 = await submitTransactionAsync(baltatharAccount, tx10); - // const result10 = getGenericResult(events10); - // expect(result10.success).to.be.true; - await helper.balance.transferToSubstrate(baltatharAccount, randomAccountMoonbeam.address, 11_000_000_000_000_000_000n); + await helper.balance.transferToEthereum(baltatharAccount, randomAccountMoonbeam.address, 11_000_000_000_000_000_000n); console.log('Sponsoring random Account.......DONE'); // <<< Sponsoring random Account <<< - [balanceGlmrTokenInit] = await getBalance(api, [randomAccountMoonbeam.address]); + balanceGlmrTokenInit = await helper.balance.getEthereum(randomAccountMoonbeam.address); }); await usingPlaygrounds(async (helper) => { - // const tx0 = api.tx.balances.transfer(randomAccountUnique.address, 10n * TRANSFER_AMOUNT); - // const events0 = await submitTransactionAsync(uniqueAlice, tx0); - // const result0 = getGenericResult(events0); - // expect(result0.success).to.be.true; await helper.balance.transferToSubstrate(uniqueAlice, randomAccountUnique.address, 10n * TRANSFER_AMOUNT); - - // [balanceUniqueTokenInit] = await getBalance(api, [randomAccountUnique.address]); balanceUniqueTokenInit = await helper.balance.getSubstrate(randomAccountUnique.address); }); }); @@ -676,13 +525,8 @@ describeXcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { const amount = TRANSFER_AMOUNT; const destWeight = 850000000; - // TODO - const tx = helper.getApi().tx.xTokens.transfer(currencyId, amount, dest, destWeight); - const events = await submitTransactionAsync(randomAccountUnique, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + await helper.xTokens.transfer(randomAccountUnique, currencyId, amount, dest, destWeight); - // [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccountUnique.address]); balanceUniqueTokenMiddle = await helper.balance.getSubstrate(randomAccountUnique.address); expect(balanceUniqueTokenMiddle < balanceUniqueTokenInit).to.be.true; @@ -690,23 +534,17 @@ describeXcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { console.log('[Unique -> Moonbeam] transaction fees on Unique: %s UNQ', bigIntToDecimals(transactionFees)); expect(transactionFees > 0).to.be.true; - await usingPlaygrounds.atUrl(moonbeamUrl, async (helper) => { - // await waitNewBlocks(api, 3); + await usingMoonbeamPlaygrounds(moonbeamUrl, async (helper) => { await helper.wait.newBlocks(3); - // [balanceGlmrTokenMiddle] = await getBalance(api, [randomAccountMoonbeam.address]); - balanceGlmrTokenMiddle = await helper.balance.getSubstrate(randomAccountMoonbeam.address); + balanceGlmrTokenMiddle = await helper.balance.getEthereum(randomAccountMoonbeam.address); const glmrFees = balanceGlmrTokenInit - balanceGlmrTokenMiddle; console.log('[Unique -> Moonbeam] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees)); expect(glmrFees == 0n).to.be.true; - // TODO - const unqRandomAccountAsset = ( - await helper.getApi().query.assets.account(assetId, randomAccountMoonbeam.address) - ).toJSON()! as any; + balanceForeignUnqTokenMiddle = (await helper.assets.account(assetId, randomAccountMoonbeam.address))!; - balanceForeignUnqTokenMiddle = BigInt(unqRandomAccountAsset['balance']); const unqIncomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenInit; console.log('[Unique -> Moonbeam] income %s UNQ', bigIntToDecimals(unqIncomeTransfer)); expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true; @@ -714,7 +552,7 @@ describeXcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { }); itSub('Should connect to Moonbeam and send UNQ back', async ({helper}) => { - await usingPlaygrounds.atUrl(moonbeamUrl, async (helper) => { + await usingMoonbeamPlaygrounds(moonbeamUrl, async (helper) => { const asset = { V1: { id: { @@ -743,26 +581,18 @@ describeXcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { }; const destWeight = 50000000; - // TODO - const tx = helper.getApi().tx.xTokens.transferMultiasset(asset, destination, destWeight); - const events = await submitTransactionAsync(randomAccountMoonbeam, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + await helper.xTokens.transferMultiasset(randomAccountMoonbeam, asset, destination, destWeight); - // [balanceGlmrTokenFinal] = await getBalance(api, [randomAccountMoonbeam.address]); - balanceGlmrTokenFinal = await helper.balance.getSubstrate(randomAccountMoonbeam.address); + balanceGlmrTokenFinal = await helper.balance.getEthereum(randomAccountMoonbeam.address); const glmrFees = balanceGlmrTokenMiddle - balanceGlmrTokenFinal; console.log('[Moonbeam -> Unique] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees)); expect(glmrFees > 0).to.be.true; - // TODO - const unqRandomAccountAsset = ( - await helper.getApi().query.assets.account(assetId, randomAccountMoonbeam.address) - ).toJSON()! as any; + const unqRandomAccountAsset = await helper.assets.account(assetId, randomAccountMoonbeam.address); expect(unqRandomAccountAsset).to.be.null; - + balanceForeignUnqTokenFinal = 0n; const unqOutcomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenFinal; @@ -770,10 +600,8 @@ describeXcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; }); - // await waitNewBlocks(api, 3); await helper.wait.newBlocks(3); - // [balanceUniqueTokenFinal] = await getBalance(api, [randomAccountUnique.address]); balanceUniqueTokenFinal = await helper.balance.getSubstrate(randomAccountUnique.address); const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle; expect(actuallyDelivered > 0).to.be.true; From 3b6e667c53c2f60e5c91202b002e6825ce0b507a Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 10 Oct 2022 14:34:09 +0000 Subject: [PATCH 1088/1274] fix: remove redundant comment --- tests/src/xcm/xcmQuartz.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index f62bfb45a1..9928b79a38 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -59,7 +59,6 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Karura', () => { randomAccount = generateKeyringPair(keyringSr25519); }); - // Karura side await usingKaruraPlaygrounds(karuraUrl, async (helper) => { const destination = { V0: { From ffb42508ed4ff58400b470707cc7a986f79e89e1 Mon Sep 17 00:00:00 2001 From: Maksandre Date: Mon, 10 Oct 2022 19:45:22 +0400 Subject: [PATCH 1089/1274] Move feedAlices to globalSetup.ts --- tests/globalSetup.ts | 18 ---------- tests/package.json | 19 +++++----- .../{feedAlices.ts => globalSetup.ts} | 36 +++++++++++++++---- 3 files changed, 39 insertions(+), 34 deletions(-) delete mode 100644 tests/globalSetup.ts rename tests/src/util/playgrounds/{feedAlices.ts => globalSetup.ts} (69%) diff --git a/tests/globalSetup.ts b/tests/globalSetup.ts deleted file mode 100644 index 5dd82e1bd2..0000000000 --- a/tests/globalSetup.ts +++ /dev/null @@ -1,18 +0,0 @@ -import {Pallets, usingPlaygrounds} from './src/util/playgrounds/index'; - -export async function mochaGlobalSetup() { - await usingPlaygrounds(async (helper, privateKey) => { - // Set up App Promotion admin - const missingPallets = helper.fetchMissingPalletNames([Pallets.AppPromotion]); - if (missingPallets.length === 0) { - const superuser = await privateKey('//Alice'); - const palletAddress = helper.arrange.calculatePalleteAddress('appstake'); - const palletAdmin = await privateKey('//PromotionAdmin'); - const api = helper.getApi(); - await helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); - const nominal = helper.balance.getOneTokenNominal(); - await helper.balance.transferToSubstrate(superuser, palletAdmin.address, 1000n * nominal); - await helper.balance.transferToSubstrate(superuser, palletAddress, 1000n * nominal); - } - }); -} diff --git a/tests/package.json b/tests/package.json index be773841cc..2040ac9bcf 100644 --- a/tests/package.json +++ b/tests/package.json @@ -21,21 +21,20 @@ }, "mocha": { "timeout": 9999999, - "require": ["ts-node/register", "./globalSetup.ts"] + "require": ["ts-node/register", "./src/util/playgrounds/globalSetup.ts"] }, "scripts": { "lint": "eslint --ext .ts,.js src/", "fix": "eslint --ext .ts,.js src/ --fix", - "feedAlices": "ts-node ./src/util/playgrounds/feedAlices.ts", - "test": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register './src/**/*.test.ts'", - "testSequential": "yarn feedAlices && mocha --timeout 9999999 -r ts-node/register './src/**/*.seqtest.ts'", - "testStructure": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register ./**/nesting/**.test.ts", - "testEth": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/**/*.test.ts'", - "testEthNesting": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/nesting/**/*.test.ts'", - "testEthFractionalizer": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/fractionalizer/**/*.test.ts'", - "testEthMarketplace": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/marketplace/**/*.test.ts'", - "testEvent": "yarn feedAlices && mocha --parallel --timeout 9999999 -r ts-node/register ./src/check-event/*.test.ts", + "test": "mocha --parallel --timeout 9999999 -r ts-node/register './src/**/*.test.ts'", + "testSequential": "mocha --timeout 9999999 -r ts-node/register './src/**/*.seqtest.ts'", + "testStructure": "mocha --parallel --timeout 9999999 -r ts-node/register ./**/nesting/**.test.ts", + "testEth": "mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/**/*.test.ts'", + "testEthNesting": "mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/nesting/**/*.test.ts'", + "testEthFractionalizer": "mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/fractionalizer/**/*.test.ts'", + "testEthMarketplace": "mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/marketplace/**/*.test.ts'", + "testEvent": "mocha --parallel --timeout 9999999 -r ts-node/register ./src/check-event/*.test.ts", "testRmrk": "mocha --timeout 9999999 -r ts-node/register ./**/rmrk/**test.ts", "testEthPayable": "mocha --timeout 9999999 -r ts-node/register './**/eth/payable.test.ts'", diff --git a/tests/src/util/playgrounds/feedAlices.ts b/tests/src/util/playgrounds/globalSetup.ts similarity index 69% rename from tests/src/util/playgrounds/feedAlices.ts rename to tests/src/util/playgrounds/globalSetup.ts index 071100b61d..2391b9cc39 100644 --- a/tests/src/util/playgrounds/feedAlices.ts +++ b/tests/src/util/playgrounds/globalSetup.ts @@ -1,9 +1,38 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // SPDX-License-Identifier: Apache-2.0 +import {usingPlaygrounds, Pallets} from './index'; import * as path from 'path'; import {promises as fs} from 'fs'; -import {usingPlaygrounds} from '.'; + +// This file is used in the mocha package.json section +export async function mochaGlobalSetup() { + await usingPlaygrounds(async (helper, privateKey) => { + try { + // 1. Create donors + await fundFilenamesWithRetries(3) + .then((result) => { + if (!result) process.exit(1); + }); + + // 2. Set up App Promotion admin + const missingPallets = helper.fetchMissingPalletNames([Pallets.AppPromotion]); + if (missingPallets.length === 0) { + const superuser = await privateKey('//Alice'); + const palletAddress = helper.arrange.calculatePalleteAddress('appstake'); + const palletAdmin = await privateKey('//PromotionAdmin'); + const api = helper.getApi(); + await helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); + const nominal = helper.balance.getOneTokenNominal(); + await helper.balance.transferToSubstrate(superuser, palletAdmin.address, 1000n * nominal); + await helper.balance.transferToSubstrate(superuser, palletAddress, 1000n * nominal); + } + } catch (error) { + console.error(error); + process.exit(1); + } + }); +} async function getFiles(rootPath: string): Promise { const files = await fs.readdir(rootPath, {withFileTypes: true}); @@ -71,8 +100,3 @@ const fundFilenamesWithRetries = async (retriesLeft: number): Promise = return fundFilenamesWithRetries(--retriesLeft); }); }; - -fundFilenamesWithRetries(3).then((result) => process.exit(result ? 0 : 1)).catch(e => { - console.error(e); - process.exit(1); -}); From e3c12ebfcd6ce8cd9c67670e6410f2a400bbf52b Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 11 Oct 2022 11:15:13 +0700 Subject: [PATCH 1090/1274] add additional files --- .docker/additional/xcm-rococo/.env | 16 ++ .../xcm-rococo/Dockerfile-xcm-opal-rococo | 89 ++++++++ .../xcm-rococo/Dockerfile-xcm-quartz-rococo | 93 ++++++++ .../xcm-rococo/Dockerfile-xcm-unique-rococo | 93 ++++++++ .../docker-compose-xcm-opal-rococo.yml | 26 +++ .../docker-compose-xcm-quartz-rococo.yml | 26 +++ .../docker-compose-xcm-unique-rococo.yml | 26 +++ .../launch-config-xcm-opal-rococo.json | 134 ++++++++++++ .../launch-config-xcm-quartz-rococo.json | 199 ++++++++++++++++++ 9 files changed, 702 insertions(+) create mode 100644 .docker/additional/xcm-rococo/.env create mode 100644 .docker/additional/xcm-rococo/Dockerfile-xcm-opal-rococo create mode 100644 .docker/additional/xcm-rococo/Dockerfile-xcm-quartz-rococo create mode 100644 .docker/additional/xcm-rococo/Dockerfile-xcm-unique-rococo create mode 100644 .docker/additional/xcm-rococo/docker-compose-xcm-opal-rococo.yml create mode 100644 .docker/additional/xcm-rococo/docker-compose-xcm-quartz-rococo.yml create mode 100644 .docker/additional/xcm-rococo/docker-compose-xcm-unique-rococo.yml create mode 100644 .docker/xcm-config/launch-config-xcm-opal-rococo.json create mode 100644 .docker/xcm-config/launch-config-xcm-quartz-rococo.json diff --git a/.docker/additional/xcm-rococo/.env b/.docker/additional/xcm-rococo/.env new file mode 100644 index 0000000000..41356b6460 --- /dev/null +++ b/.docker/additional/xcm-rococo/.env @@ -0,0 +1,16 @@ +RUST_TOOLCHAIN=nightly-2022-07-24 +UNIQUE_BRANCH="develop" + +POLKADOT_BUILD_BRANCH=release-v0.9.29 + +KARURA_BUILD_BRANCH=2.9.1 +ACALA_BUILD_BRANCH=2.9.2 + +MOONRIVER_BUILD_BRANCH=runtime-1701 +MOONBEAM_BUILD_BRANCH=runtime-1701 + +STATEMINE_BUILD_BRANCH=parachains-v9270 +STATEMINT_BUILD_BRANCH=release-parachains-v9230 +WESTMINT_BUILD_BRANCH=parachains-v9270 + +POLKADOT_LAUNCH_BRANCH="unique-network" diff --git a/.docker/additional/xcm-rococo/Dockerfile-xcm-opal-rococo b/.docker/additional/xcm-rococo/Dockerfile-xcm-opal-rococo new file mode 100644 index 0000000000..3efcf46cc5 --- /dev/null +++ b/.docker/additional/xcm-rococo/Dockerfile-xcm-opal-rococo @@ -0,0 +1,89 @@ +ARG CHAIN=opal +ARG LAUNCH_CONFIG_FILE=launch-config-xcm-opal-rococo.json + +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ARG RUST_TOOLCHAIN +ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install ${RUST_TOOLCHAIN} && \ + rustup default ${RUST_TOOLCHAIN} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain ${RUST_TOOLCHAIN} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD ====== +FROM rust-builder as builder-unique + +ARG UNIQUE_BRANCH +ARG CHAIN +ARG LAUNCH_CONFIG_FILE +ARG PROFILE=release + +WORKDIR /unique_parachain +#COPY . . + +RUN git clone -b ${UNIQUE_BRANCH} https://github.com/UniqueNetwork/unique-chain.git . && \ +# cd unique-chain && \ + cargo build --features=${CHAIN}-runtime --$PROFILE + +# ===== RUN ====== +FROM ubuntu:20.04 + +ARG POLKADOT_LAUNCH_BRANCH +ARG LAUNCH_CONFIG_FILE +ENV POLKADOT_LAUNCH_BRANCH $POLKADOT_LAUNCH_BRANCH +ENV LAUNCH_CONFIG_FILE $LAUNCH_CONFIG_FILE + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b ${POLKADOT_LAUNCH_BRANCH} + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn install + +COPY --from=builder-unique /unique_parachain/.docker/xcm-config/${LAUNCH_CONFIG_FILE} /polkadot-launch/ + +COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=uniquenetwork/builder-cumulus:${STATEMINE_BUILD_BRANCH} /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus +COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/ + +EXPOSE 9844 +EXPOSE 9944 +EXPOSE 9946 +EXPOSE 9947 +EXPOSE 9948 + +CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start ${LAUNCH_CONFIG_FILE} + + diff --git a/.docker/additional/xcm-rococo/Dockerfile-xcm-quartz-rococo b/.docker/additional/xcm-rococo/Dockerfile-xcm-quartz-rococo new file mode 100644 index 0000000000..e94b5f9221 --- /dev/null +++ b/.docker/additional/xcm-rococo/Dockerfile-xcm-quartz-rococo @@ -0,0 +1,93 @@ +ARG CHAIN=quartz +ARG LAUNCH_CONFIG_FILE=launch-config-xcm-quartz-rococo.json + +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ARG RUST_TOOLCHAIN +ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install ${RUST_TOOLCHAIN} && \ + rustup default ${RUST_TOOLCHAIN} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain ${RUST_TOOLCHAIN} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD ====== +FROM rust-builder as builder-unique + +ARG UNIQUE_BRANCH +ARG CHAIN +ARG LAUNCH_CONFIG_FILE +ARG PROFILE=release + +WORKDIR /unique_parachain +#COPY . . + +RUN git clone -b ${UNIQUE_BRANCH} https://github.com/UniqueNetwork/unique-chain.git . && \ +# cd unique-chain && \ + cargo build --features=${CHAIN}-runtime --$PROFILE + +# ===== RUN ====== +FROM ubuntu:20.04 + +ARG POLKADOT_LAUNCH_BRANCH +ARG LAUNCH_CONFIG_FILE +ENV POLKADOT_LAUNCH_BRANCH $POLKADOT_LAUNCH_BRANCH +ENV LAUNCH_CONFIG_FILE $LAUNCH_CONFIG_FILE + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b ${POLKADOT_LAUNCH_BRANCH} + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn install + +COPY --from=builder-unique /unique_parachain/.docker/xcm-config/${LAUNCH_CONFIG_FILE} /polkadot-launch/ +COPY --from=builder-unique /unique_parachain/.docker/xcm-config/5validators.jsonnet /polkadot-launch/5validators.jsonnet +COPY --from=builder-unique /unique_parachain/.docker/xcm-config/minBondFix.jsonnet /polkadot-launch/minBondFix.jsonnet + +COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=uniquenetwork/builder-moonbeam:${MOONRIVER_BUILD_BRANCH} /unique_parachain/moonbeam/target/release/moonbeam /moonbeam/target/release/ +COPY --from=uniquenetwork/builder-cumulus:${STATEMINE_BUILD_BRANCH} /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus +COPY --from=uniquenetwork/builder-acala:${KARURA_BUILD_BRANCH} /unique_parachain/Acala/target/production/acala /acala/target/release/ +COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/ + +EXPOSE 9844 +EXPOSE 9944 +EXPOSE 9946 +EXPOSE 9947 +EXPOSE 9948 + +CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start ${LAUNCH_CONFIG_FILE} + + diff --git a/.docker/additional/xcm-rococo/Dockerfile-xcm-unique-rococo b/.docker/additional/xcm-rococo/Dockerfile-xcm-unique-rococo new file mode 100644 index 0000000000..5675be4b30 --- /dev/null +++ b/.docker/additional/xcm-rococo/Dockerfile-xcm-unique-rococo @@ -0,0 +1,93 @@ +ARG CHAIN=unique +ARG LAUNCH_CONFIG_FILE=launch-config-xcm-unique-rococo.json + +# ===== Rust builder ===== +FROM ubuntu:20.04 as rust-builder +LABEL maintainer="Unique.Network" + +ARG RUST_TOOLCHAIN +ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install ${RUST_TOOLCHAIN} && \ + rustup default ${RUST_TOOLCHAIN} && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain ${RUST_TOOLCHAIN} + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD ====== +FROM rust-builder as builder-unique + +ARG UNIQUE_BRANCH +ARG CHAIN +ARG LAUNCH_CONFIG_FILE +ARG PROFILE=release + +WORKDIR /unique_parachain +#COPY . . + +RUN git clone -b ${UNIQUE_BRANCH} https://github.com/UniqueNetwork/unique-chain.git . && \ +# cd unique-chain && \ + cargo build --features=${CHAIN}-runtime --$PROFILE + +# ===== RUN ====== +FROM ubuntu:20.04 + +ARG POLKADOT_LAUNCH_BRANCH +ARG LAUNCH_CONFIG_FILE +ENV POLKADOT_LAUNCH_BRANCH $POLKADOT_LAUNCH_BRANCH +ENV LAUNCH_CONFIG_FILE $LAUNCH_CONFIG_FILE + +RUN apt-get -y update && \ + apt-get -y install curl git && \ + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16.16.0 && \ + nvm use v16.16.0 + +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b ${POLKADOT_LAUNCH_BRANCH} + +RUN export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + npm install --global yarn && \ + yarn install + +COPY --from=builder-unique /unique_parachain/.docker/xcm-config/${LAUNCH_CONFIG_FILE} /polkadot-launch/ +COPY --from=builder-unique /unique_parachain/.docker/xcm-config/5validators.jsonnet /polkadot-launch/5validators.jsonnet +COPY --from=builder-unique /unique_parachain/.docker/xcm-config/minBondFix.jsonnet /polkadot-launch/minBondFix.jsonnet + +COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=uniquenetwork/builder-moonbeam:${MOONBEAM_BUILD_BRANCH} /unique_parachain/moonbeam/target/release/moonbeam /moonbeam/target/release/ +COPY --from=uniquenetwork/builder-cumulus:${STATEMINT_BUILD_BRANCH} /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus +COPY --from=uniquenetwork/builder-acala:${ACALA_BUILD_BRANCH} /unique_parachain/Acala/target/production/acala /acala/target/release/ +COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/ + +EXPOSE 9844 +EXPOSE 9944 +EXPOSE 9946 +EXPOSE 9947 +EXPOSE 9948 + +CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + cd /polkadot-launch && \ + yarn start ${LAUNCH_CONFIG_FILE} + + diff --git a/.docker/additional/xcm-rococo/docker-compose-xcm-opal-rococo.yml b/.docker/additional/xcm-rococo/docker-compose-xcm-opal-rococo.yml new file mode 100644 index 0000000000..40f7410577 --- /dev/null +++ b/.docker/additional/xcm-rococo/docker-compose-xcm-opal-rococo.yml @@ -0,0 +1,26 @@ +version: "3.5" + +services: + xcm_opal_rococo: + build: + context: . + dockerfile: .Dockerfile-xcm-opal-rococo + container_name: xcm-opal-rococo + image: xcm-opal-rococo:latest + env_file: .env + expose: + - 9844 + - 9944 + - 9946 + - 9947 + - 9948 + ports: + - 127.0.0.1:9844:9844 + - 127.0.0.1:9944:9944 + - 127.0.0.1:9946:9946 + - 127.0.0.1:9947:9947 + - 127.0.0.1:9948:9948 + logging: + options: + max-size: "1m" + max-file: "3" diff --git a/.docker/additional/xcm-rococo/docker-compose-xcm-quartz-rococo.yml b/.docker/additional/xcm-rococo/docker-compose-xcm-quartz-rococo.yml new file mode 100644 index 0000000000..561fa57ddd --- /dev/null +++ b/.docker/additional/xcm-rococo/docker-compose-xcm-quartz-rococo.yml @@ -0,0 +1,26 @@ +version: "3.5" + +services: + xcm_quartz_rococo: + build: + context: . + dockerfile: .Dockerfile-xcm-quartz-rococo + container_name: xcm-quartz-rococo + image: xcm-quartz-rococo:latest + env_file: .env + expose: + - 9844 + - 9944 + - 9946 + - 9947 + - 9948 + ports: + - 127.0.0.1:9844:9844 + - 127.0.0.1:9944:9944 + - 127.0.0.1:9946:9946 + - 127.0.0.1:9947:9947 + - 127.0.0.1:9948:9948 + logging: + options: + max-size: "1m" + max-file: "3" diff --git a/.docker/additional/xcm-rococo/docker-compose-xcm-unique-rococo.yml b/.docker/additional/xcm-rococo/docker-compose-xcm-unique-rococo.yml new file mode 100644 index 0000000000..116c59651f --- /dev/null +++ b/.docker/additional/xcm-rococo/docker-compose-xcm-unique-rococo.yml @@ -0,0 +1,26 @@ +version: "3.5" + +services: + xcm_unique_rococo: + build: + context: . + dockerfile: .Dockerfile-xcm-unique-rococo + container_name: xcm-unique-rococo + image: xcm-unique-rococo:latest + env_file: .env + expose: + - 9844 + - 9944 + - 9946 + - 9947 + - 9948 + ports: + - 127.0.0.1:9844:9844 + - 127.0.0.1:9944:9944 + - 127.0.0.1:9946:9946 + - 127.0.0.1:9947:9947 + - 127.0.0.1:9948:9948 + logging: + options: + max-size: "1m" + max-file: "3" diff --git a/.docker/xcm-config/launch-config-xcm-opal-rococo.json b/.docker/xcm-config/launch-config-xcm-opal-rococo.json new file mode 100644 index 0000000000..18b7e00f39 --- /dev/null +++ b/.docker/xcm-config/launch-config-xcm-opal-rococo.json @@ -0,0 +1,134 @@ +{ + "relaychain": { + "bin": "/polkadot/target/release/polkadot", + "chain": "rococo-local", + "chainInitializer": [ + "chainql", + "--tla-code=spec=import '${spec}'", + "5validators.jsonnet" + ], + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + } + + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "/unique-chain/target/release/unique-collator", + "id": "2095", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + }, + { + "bin": "/cumulus/target/release/cumulus", + "id": "1000", + "chain": "westmint-local", + "balance": "1000000000000000000000000", + "nodes": [ + { + "wsPort": 9948, + "port": 31204, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [ + { + "sender": 2095, + "recipient": 1000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 1000, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + } + ], + "finalization": false +} + diff --git a/.docker/xcm-config/launch-config-xcm-quartz-rococo.json b/.docker/xcm-config/launch-config-xcm-quartz-rococo.json new file mode 100644 index 0000000000..52c55770fd --- /dev/null +++ b/.docker/xcm-config/launch-config-xcm-quartz-rococo.json @@ -0,0 +1,199 @@ +{ + "relaychain": { + "bin": "/polkadot/target/release/polkadot", + "chain": "rococo-local", + "chainInitializer": [ + "chainql", + "--tla-code=spec=import '${spec}'", + "5validators.jsonnet" + ], + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lparachain::candidate_validation=debug" + ] + } + + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "/unique-chain/target/release/unique-collator", + "id": "2095", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + }, + { + "bin": "/acala/target/release/acala", + "id": "2000", + "chain": "karura-dev", + "balance": "1000000000000000000000", + "nodes": [ + { + "wsPort": 9946, + "port": 31202, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + }, + { + "bin": "/moonbeam/target/release/moonbeam", + "id": 2023, + "balance": "1000000000000000000000", + "chain": "moonriver-local", + "chainInitializer": [ + "chainql", + "--tla-code=spec=import '${spec}'", + "minBondFix.jsonnet" + ], + "nodes": [ + { + "wsPort": 9947, + "port": 31203, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external", + "--", + "--execution=wasm" + ] + } + ] + }, + { + "bin": "/cumulus/target/release/cumulus", + "id": "1000", + "chain": "statemine-local", + "balance": "1000000000000000000000000", + "nodes": [ + { + "wsPort": 9948, + "port": 31204, + "name": "alice", + "flags": [ + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [ + { + "sender": 2095, + "recipient": 2000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2000, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2095, + "recipient": 2023, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2023, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 2095, + "recipient": 1000, + "maxCapacity": 8, + "maxMessageSize": 512 + }, + { + "sender": 1000, + "recipient": 2095, + "maxCapacity": 8, + "maxMessageSize": 512 + } + ], + "finalization": false +} + From 792111584ff15b9d4f21e3ca79414a59ccc7df7d Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 11 Oct 2022 04:18:50 +0000 Subject: [PATCH 1091/1274] feat: westmint playgrounds --- tests/src/util/playgrounds/index.ts | 7 ++- tests/src/util/playgrounds/unique.dev.ts | 13 ++++- tests/src/util/playgrounds/unique.ts | 64 ++++++++++++++++++------ 3 files changed, 63 insertions(+), 21 deletions(-) diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index aa775de0a7..6eb01ec1de 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -9,7 +9,7 @@ import config from '../../config'; import '../../interfaces/augment-api-events'; import {ChainHelperBase} from './unique'; import {ILogger} from './types'; -import {DevUniqueHelper, SilentLogger, SilentConsole, DevMoonbeamHelper, DevMoonriverHelper, DevAcalaHelper, DevKaruraHelper, DevRelayHelper} from './unique.dev'; +import {DevUniqueHelper, SilentLogger, SilentConsole, DevMoonbeamHelper, DevMoonriverHelper, DevAcalaHelper, DevKaruraHelper, DevRelayHelper, DevWestmintHelper} from './unique.dev'; chai.use(chaiAsPromised); export const expect = chai.expect; @@ -36,9 +36,8 @@ export const usingPlaygrounds = (code: (helper: DevUniqueHelper, privateKey: (se return usingPlaygroundsGeneral(DevUniqueHelper, url, code); }; -// TODO specific type -export const usingStatemintPlaygrounds = async (url: string, code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { - return usingPlaygroundsGeneral(DevUniqueHelper, url, code); +export const usingWestmintPlaygrounds = async (url: string, code: (helper: DevWestmintHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { + return usingPlaygroundsGeneral(DevWestmintHelper, url, code); }; export const usingRelayPlaygrounds = async (url: string, code: (helper: DevRelayHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index f6f579f097..aeb37826c5 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import {mnemonicGenerate} from '@polkadot/util-crypto'; -import {UniqueHelper, MoonbeamHelper, ChainHelperBase, AcalaHelper, RelayHelper} from './unique'; +import {UniqueHelper, MoonbeamHelper, ChainHelperBase, AcalaHelper, RelayHelper, WestmintHelper} from './unique'; import {ApiPromise, Keyring, WsProvider} from '@polkadot/api'; import * as defs from '../../interfaces/definitions'; import {IKeyringPair} from '@polkadot/types/types'; @@ -110,6 +110,17 @@ export class DevUniqueHelper extends UniqueHelper { export class DevRelayHelper extends RelayHelper {} +export class DevWestmintHelper extends WestmintHelper { + wait: WaitGroup; + + constructor(logger: { log: (msg: any, level: any) => void, level: any }, options: {[key: string]: any} = {}) { + options.helperBase = options.helperBase ?? DevWestmintHelper; + + super(logger, options); + this.wait = new WaitGroup(this); + } +} + export class DevMoonbeamHelper extends MoonbeamHelper { account: MoonbeamAccountGroup; wait: WaitGroup; diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 3bd7c34469..0e62c36578 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -2468,6 +2468,10 @@ class XTokensGroup extends HelperGroup { async transferMultiasset(signer: TSigner, asset: any, destination: any, destWeight: number) { await this.helper.executeExtrinsic(signer, 'api.tx.xTokens.transferMultiasset', [asset, destination, destWeight], true); } + + async transferMulticurrencies(signer: TSigner, currencies: any[], feeItem: number, destLocation: any, destWeight: number) { + await this.helper.executeExtrinsic(signer, 'api.tx.xTokens.transferMulticurrencies', [currencies, feeItem, destLocation, destWeight], true); + } } class TokensGroup extends HelperGroup { @@ -2477,6 +2481,32 @@ class TokensGroup extends HelperGroup { } } +class AssetsGroup extends HelperGroup { + async create(signer: TSigner, assetId: number, admin: string, minimalBalance: bigint) { + await this.helper.executeExtrinsic(signer, 'api.tx.assets.create', [assetId, admin, minimalBalance], true); + } + + async setMetadata(signer: TSigner, assetId: number, name: string, symbol: string, decimals: number) { + await this.helper.executeExtrinsic(signer, 'api.tx.assets.setMetadata', [assetId, name, symbol, decimals], true); + } + + async mint(signer: TSigner, assetId: number, beneficiary: string, amount: bigint) { + await this.helper.executeExtrinsic(signer, 'api.tx.assets.mint', [assetId, beneficiary, amount], true); + } + + async account(assetId: string | number, address: string) { + const accountAsset = ( + await this.helper.callRpc('api.query.assets.account', [assetId, address]) + ).toJSON()! as any; + + if (accountAsset !== null) { + return BigInt(accountAsset['balance']); + } else { + return null; + } + } +} + class AcalaAssetRegistryGroup extends HelperGroup { async registerForeignAsset(signer: TSigner, destination: any, metadata: AcalaAssetMetadata) { await this.helper.executeExtrinsic(signer, 'api.tx.assetRegistry.registerForeignAsset', [destination, metadata], true); @@ -2507,20 +2537,6 @@ class MoonbeamAssetManagerGroup extends HelperGroup { } } -class MoonbeamAssetsGroup extends HelperGroup { - async account(assetId: string, address: string) { - const accountAsset = ( - await this.helper.callRpc('api.query.assets.account', [assetId, address]) - ).toJSON()! as any; - - if (accountAsset !== null) { - return BigInt(accountAsset['balance']); - } else { - return null; - } - } -} - class MoonbeamDemocracyGroup extends HelperGroup { async notePreimage(signer: TSigner, encodedProposal: string) { await this.helper.executeExtrinsic(signer, 'api.tx.democracy.notePreimage', [encodedProposal], true); @@ -2626,10 +2642,26 @@ export class RelayHelper extends XcmChainHelper { } } +export class WestmintHelper extends XcmChainHelper { + balance: SubstrateBalanceGroup; + xcm: XcmGroup; + assets: AssetsGroup; + xTokens: XTokensGroup; + + constructor(logger?: ILogger, options: {[key: string]: any} = {}) { + super(logger, options.helperBase ?? WestmintHelper); + + this.balance = new SubstrateBalanceGroup(this); + this.xcm = new XcmGroup(this, 'polkadotXcm'); + this.assets = new AssetsGroup(this); + this.xTokens = new XTokensGroup(this); + } +} + export class MoonbeamHelper extends XcmChainHelper { balance: EthereumBalanceGroup; assetManager: MoonbeamAssetManagerGroup; - assets: MoonbeamAssetsGroup; + assets: AssetsGroup; xTokens: XTokensGroup; democracy: MoonbeamDemocracyGroup; collective: { @@ -2642,7 +2674,7 @@ export class MoonbeamHelper extends XcmChainHelper { this.balance = new EthereumBalanceGroup(this); this.assetManager = new MoonbeamAssetManagerGroup(this); - this.assets = new MoonbeamAssetsGroup(this); + this.assets = new AssetsGroup(this); this.xTokens = new XTokensGroup(this); this.democracy = new MoonbeamDemocracyGroup(this); this.collective = { From 681fe40c30ae8c9ed078f4b7f14e8bf5fe3e9a5e Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 11 Oct 2022 04:19:33 +0000 Subject: [PATCH 1092/1274] refactor: use playgrounds in opal xcm tests --- tests/src/xcm/xcmOpal.test.ts | 137 +++++++--------------------------- 1 file changed, 27 insertions(+), 110 deletions(-) diff --git a/tests/src/xcm/xcmOpal.test.ts b/tests/src/xcm/xcmOpal.test.ts index 625b5446e9..69fb2ab079 100644 --- a/tests/src/xcm/xcmOpal.test.ts +++ b/tests/src/xcm/xcmOpal.test.ts @@ -15,10 +15,8 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {executeTransaction} from './../substrate/substrate-api'; -import {bigIntToDecimals, getGenericResult, paraSiblingSovereignAccount} from './../deprecated-helpers/helpers'; -import getBalance from './../substrate/get-balance'; -import {itSub, expect, describeXcm, usingPlaygrounds} from '../util/playgrounds'; +import {bigIntToDecimals, paraSiblingSovereignAccount} from './../deprecated-helpers/helpers'; +import {itSub, expect, describeXcm, usingPlaygrounds, usingWestmintPlaygrounds, usingRelayPlaygrounds} from '../util/playgrounds'; const STATEMINE_CHAIN = 1000; const UNIQUE_CHAIN = 2095; @@ -68,36 +66,17 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { bob = privateKey('//Bob'); // funds donor }); - await usingPlaygrounds.atUrl(statemineUrl, async (helper) => { - const api = helper.getApi(); - + await usingWestmintPlaygrounds(statemineUrl, async (helper) => { // 350.00 (three hundred fifty) DOT - const fundingAmount = 3_500_000_000_000; - - const tx = api.tx.assets.create(ASSET_ID, alice.addressRaw, ASSET_METADATA_MINIMAL_BALANCE); - const events = await executeTransaction(api, alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - // set metadata - const tx2 = api.tx.assets.setMetadata(ASSET_ID, ASSET_METADATA_NAME, ASSET_METADATA_DESCRIPTION, ASSET_METADATA_DECIMALS); - const events2 = await executeTransaction(api, alice, tx2); - const result2 = getGenericResult(events2); - expect(result2.success).to.be.true; + const fundingAmount = 3_500_000_000_000n; - // mint some amount of asset - const tx3 = api.tx.assets.mint(ASSET_ID, alice.addressRaw, ASSET_AMOUNT); - const events3 = await executeTransaction(api, alice, tx3); - const result3 = getGenericResult(events3); - expect(result3.success).to.be.true; + await helper.assets.create(alice, ASSET_ID, alice.address, ASSET_METADATA_MINIMAL_BALANCE); + await helper.assets.setMetadata(alice, ASSET_ID, ASSET_METADATA_NAME, ASSET_METADATA_DESCRIPTION, ASSET_METADATA_DECIMALS); + await helper.assets.mint(alice, ASSET_ID, alice.address, ASSET_AMOUNT); // funding parachain sovereing account (Parachain: 2095) const parachainSovereingAccount = await paraSiblingSovereignAccount(UNIQUE_CHAIN); - const tx4 = api.tx.balances.transfer(parachainSovereingAccount, fundingAmount); - const events4 = await executeTransaction(api, bob, tx4); - const result4 = getGenericResult(events4); - expect(result4.success).to.be.true; - + await helper.balance.transferToSubstrate(bob, parachainSovereingAccount, fundingAmount); }); @@ -127,22 +106,12 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { minimalBalance: ASSET_METADATA_MINIMAL_BALANCE, }; await helper.getSudo().foreignAssets.register(alice, alice.address, location, metadata); - // const tx = api.tx.foreignAssets.registerForeignAsset(alice.addressRaw, location, metadata); - // const sudoTx = api.tx.sudo.sudo(tx as any); - // const events = await executeTransaction(api, alice, sudoTx); - // const result = getGenericResult(events); - // expect(result.success).to.be.true; - - // [balanceOpalBefore] = await getBalance(api, [alice.address]); balanceOpalBefore = await helper.balance.getSubstrate(alice.address); - }); // Providing the relay currency to the unique sender account - await usingPlaygrounds.atUrl(relayUrl, async (helper) => { - const api = helper.getApi(); - + await usingRelayPlaygrounds(relayUrl, async (helper) => { const destination = { V1: { parents: 0, @@ -181,23 +150,15 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { }; const feeAssetItem = 0; + const weightLimit = 5_000_000_000; - const weightLimit = { - Limited: 5_000_000_000, - }; - - const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); - const events = await executeTransaction(api, alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + await helper.xcm.limitedReserveTransferAssets(alice, destination, beneficiary, assets, feeAssetItem, weightLimit); }); }); itSub('Should connect and send USDT from Westmint to Opal', async ({helper}) => { - await usingPlaygrounds.atUrl(statemineUrl, async (helper) => { - const api = helper.getApi(); - + await usingWestmintPlaygrounds(statemineUrl, async (helper) => { const dest = { V1: { parents: 1, @@ -244,19 +205,12 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { }; const feeAssetItem = 0; + const weightLimit = 5000000000; - const weightLimit = { - Limited: 5000000000, - }; - - [balanceStmnBefore] = await getBalance(api, [alice.address]); - - const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(dest, beneficiary, assets, feeAssetItem, weightLimit); - const events = await executeTransaction(api, alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + balanceStmnBefore = await helper.balance.getSubstrate(alice.address); + await helper.xcm.limitedReserveTransferAssets(alice, dest, beneficiary, assets, feeAssetItem, weightLimit); - [balanceStmnAfter] = await getBalance(api, [alice.address]); + balanceStmnAfter = await helper.balance.getSubstrate(alice.address); // common good parachain take commission in it native token console.log( @@ -269,14 +223,11 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { // ensure that asset has been delivered - // await waitNewBlocks(api, 3); await helper.wait.newBlocks(3); // expext collection id will be with id 1 - // const free = (await api.query.fungible.balance(1, normalizeAccountId(alice.address))).toBigInt(); const free = await helper.ft.getBalance(1, {Substrate: alice.address}); - // [balanceOpalAfter] = await getBalance(api, [alice.address]); balanceOpalAfter = await helper.balance.getSubstrate(alice.address); // commission has not paid in USDT token @@ -294,8 +245,6 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { }); itSub('Should connect and send USDT from Unique to Statemine back', async ({helper}) => { - const api = helper.getApi(); - const destination = { V1: { parents: 1, @@ -332,42 +281,29 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { const feeItem = 1; const destWeight = 500000000000; - const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight); - const events = await executeTransaction(api, alice, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + await helper.xTokens.transferMulticurrencies(alice, currencies, feeItem, destination, destWeight); // the commission has been paid in parachain native token - [balanceOpalFinal] = await getBalance(api, [alice.address]); + balanceOpalFinal = await helper.balance.getSubstrate(alice.address); expect(balanceOpalAfter > balanceOpalFinal).to.be.true; - await usingPlaygrounds.atUrl(statemineUrl, async (helper) => { - // await waitNewBlocks(api, 3); + await usingWestmintPlaygrounds(statemineUrl, async (helper) => { await helper.wait.newBlocks(3); - - const api = helper.getApi(); // The USDT token never paid fees. Its amount not changed from begin value. // Also check that xcm transfer has been succeeded - const free = ((await api.query.assets.account(100, alice.address)).toHuman()) as any; - expect(BigInt(free.balance.replace(/,/g, '')) == ASSET_AMOUNT).to.be.true; + expect((await helper.assets.account(ASSET_ID, alice.address))! == ASSET_AMOUNT).to.be.true; }); }); itSub('Should connect and send Relay token to Unique', async ({helper}) => { const TRANSFER_AMOUNT_RELAY = 50_000_000_000_000_000n; - // [balanceBobBefore] = await getBalance(api, [bob.address]); - // balanceBobRelayTokenBefore = BigInt(((await api.query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free); balanceBobBefore = await helper.balance.getSubstrate(bob.address); - - // TODO - balanceBobRelayTokenBefore = BigInt(((await helper.getApi().query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free); + balanceBobRelayTokenBefore = await helper.tokens.accounts(bob.address, {NativeAssetId: 'Parent'}); // Providing the relay currency to the unique sender account - await usingPlaygrounds.atUrl(relayUrl, async (helper) => { - const api = helper.getApi(); - + await usingRelayPlaygrounds(relayUrl, async (helper) => { const destination = { V1: { parents: 0, @@ -406,27 +342,15 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { }; const feeAssetItem = 0; + const weightLimit = 5_000_000_000; - const weightLimit = { - Limited: 5_000_000_000, - }; - - const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit); - const events = await executeTransaction(api, bob, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + await helper.xcm.limitedReserveTransferAssets(bob, destination, beneficiary, assets, feeAssetItem, weightLimit); }); - - // await waitNewBlocks(api, 3); await helper.wait.newBlocks(3); - // [balanceBobAfter] = await getBalance(api, [bob.address]); - // balanceBobRelayTokenAfter = BigInt(((await api.query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free); - balanceBobAfter = await helper.balance.getSubstrate(bob.address); - - // TODO - balanceBobRelayTokenAfter = BigInt(((await helper.getApi().query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free); + balanceBobAfter = await helper.balance.getSubstrate(bob.address); + balanceBobRelayTokenAfter = await helper.tokens.accounts(bob.address, {NativeAssetId: 'Parent'}); const wndFee = balanceBobRelayTokenAfter - TRANSFER_AMOUNT_RELAY - balanceBobRelayTokenBefore; console.log( @@ -471,16 +395,9 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { const feeItem = 0; const destWeight = 500000000000; - // TODO - const api = helper.getApi(); - const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight); - const events = await executeTransaction(api, bob, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; + await helper.xTokens.transferMulticurrencies(bob, currencies, feeItem, destination, destWeight); - // [balanceBobFinal] = await getBalance(api, [bob.address]); balanceBobFinal = await helper.balance.getSubstrate(bob.address); console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobFinal); }); - }); From 698c51fd21a7d54dcfc5825d11df1656588fcd66 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 11 Oct 2022 04:35:29 +0000 Subject: [PATCH 1093/1274] fix: move RMRK needed parts of deprecated helpers --- tests/src/rmrk/acceptNft.test.ts | 3 +- tests/src/rmrk/addResource.test.ts | 3 +- tests/src/rmrk/addTheme.test.ts | 3 +- tests/src/rmrk/burnNft.test.ts | 3 +- tests/src/rmrk/changeCollectionIssuer.test.ts | 3 +- tests/src/rmrk/createBase.test.ts | 2 +- tests/src/rmrk/createCollection.test.ts | 2 +- tests/src/rmrk/deleteCollection.test.ts | 3 +- tests/src/rmrk/equipNft.test.ts | 3 +- tests/src/rmrk/getOwnedNfts.test.ts | 2 +- tests/src/rmrk/lockCollection.test.ts | 3 +- tests/src/rmrk/mintNft.test.ts | 3 +- tests/src/rmrk/rejectNft.test.ts | 3 +- tests/src/rmrk/removeResource.test.ts | 3 +- tests/src/rmrk/sendNft.test.ts | 3 +- tests/src/rmrk/setCollectionProperty.test.ts | 3 +- tests/src/rmrk/setEquippableList.test.ts | 3 +- tests/src/rmrk/setNftProperty.test.ts | 3 +- tests/src/rmrk/setResourcePriorities.test.ts | 3 +- tests/src/rmrk/util/helpers.ts | 41 +++++++++++++++++++ 20 files changed, 60 insertions(+), 35 deletions(-) diff --git a/tests/src/rmrk/acceptNft.test.ts b/tests/src/rmrk/acceptNft.test.ts index 8003cb9084..c3c2497594 100644 --- a/tests/src/rmrk/acceptNft.test.ts +++ b/tests/src/rmrk/acceptNft.test.ts @@ -7,8 +7,7 @@ import { acceptNft, } from './util/tx'; import {NftIdTuple} from './util/fetch'; -import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; +import {isNftChildOfAnother, expectTxFailure, requirePallets, Pallets} from './util/helpers'; describe('integration test: accept NFT', () => { let api: any; diff --git a/tests/src/rmrk/addResource.test.ts b/tests/src/rmrk/addResource.test.ts index ae302bd483..5568334450 100644 --- a/tests/src/rmrk/addResource.test.ts +++ b/tests/src/rmrk/addResource.test.ts @@ -1,7 +1,7 @@ import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; import {NftIdTuple} from './util/fetch'; -import {expectTxFailure, getResourceById} from './util/helpers'; +import {expectTxFailure, getResourceById, requirePallets, Pallets} from './util/helpers'; import { addNftBasicResource, acceptNftResource, @@ -12,7 +12,6 @@ import { addNftComposableResource, } from './util/tx'; import {RmrkTraitsResourceResourceInfo as ResourceInfo} from '@polkadot/types/lookup'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; describe('integration test: add NFT resource', () => { const Alice = '//Alice'; diff --git a/tests/src/rmrk/addTheme.test.ts b/tests/src/rmrk/addTheme.test.ts index 8aea26210f..b61f5e61eb 100644 --- a/tests/src/rmrk/addTheme.test.ts +++ b/tests/src/rmrk/addTheme.test.ts @@ -1,9 +1,8 @@ import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; import {createBase, addTheme} from './util/tx'; -import {expectTxFailure} from './util/helpers'; +import {expectTxFailure, requirePallets, Pallets} from './util/helpers'; import {getThemeNames} from './util/fetch'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; describe('integration test: add Theme to Base', () => { let api: any; diff --git a/tests/src/rmrk/burnNft.test.ts b/tests/src/rmrk/burnNft.test.ts index 2d189d29fc..dc98444c11 100644 --- a/tests/src/rmrk/burnNft.test.ts +++ b/tests/src/rmrk/burnNft.test.ts @@ -1,11 +1,10 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {expectTxFailure} from './util/helpers'; +import {expectTxFailure, requirePallets, Pallets} from './util/helpers'; import {NftIdTuple, getChildren} from './util/fetch'; import {burnNft, createCollection, sendNft, mintNft} from './util/tx'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; chai.use(chaiAsPromised); const expect = chai.expect; diff --git a/tests/src/rmrk/changeCollectionIssuer.test.ts b/tests/src/rmrk/changeCollectionIssuer.test.ts index 88ec3f590a..6260f2d051 100644 --- a/tests/src/rmrk/changeCollectionIssuer.test.ts +++ b/tests/src/rmrk/changeCollectionIssuer.test.ts @@ -1,6 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; -import {expectTxFailure} from './util/helpers'; +import {expectTxFailure, requirePallets, Pallets} from './util/helpers'; import { changeIssuer, createCollection, diff --git a/tests/src/rmrk/createBase.test.ts b/tests/src/rmrk/createBase.test.ts index 2390a884d7..95840c077d 100644 --- a/tests/src/rmrk/createBase.test.ts +++ b/tests/src/rmrk/createBase.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; +import {requirePallets, Pallets} from './util/helpers'; import {createCollection, createBase} from './util/tx'; describe('integration test: create new Base', () => { diff --git a/tests/src/rmrk/createCollection.test.ts b/tests/src/rmrk/createCollection.test.ts index b6c90ff767..d5167ade75 100644 --- a/tests/src/rmrk/createCollection.test.ts +++ b/tests/src/rmrk/createCollection.test.ts @@ -1,5 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; +import {requirePallets, Pallets} from './util/helpers'; import {createCollection} from './util/tx'; describe('Integration test: create new collection', () => { diff --git a/tests/src/rmrk/deleteCollection.test.ts b/tests/src/rmrk/deleteCollection.test.ts index 0caf5d734d..c2fdbc55d0 100644 --- a/tests/src/rmrk/deleteCollection.test.ts +++ b/tests/src/rmrk/deleteCollection.test.ts @@ -1,6 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; -import {expectTxFailure} from './util/helpers'; +import {expectTxFailure, requirePallets, Pallets} from './util/helpers'; import {createCollection, deleteCollection} from './util/tx'; describe('integration test: delete collection', () => { diff --git a/tests/src/rmrk/equipNft.test.ts b/tests/src/rmrk/equipNft.test.ts index ed8d4ae9e9..e60cac0f3d 100644 --- a/tests/src/rmrk/equipNft.test.ts +++ b/tests/src/rmrk/equipNft.test.ts @@ -1,9 +1,8 @@ import {ApiPromise} from '@polkadot/api'; import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {getNft, getParts, NftIdTuple} from './util/fetch'; -import {expectTxFailure} from './util/helpers'; +import {expectTxFailure, requirePallets, Pallets} from './util/helpers'; import { addNftComposableResource, addNftSlotResource, diff --git a/tests/src/rmrk/getOwnedNfts.test.ts b/tests/src/rmrk/getOwnedNfts.test.ts index 5259b059c8..9b051cd79b 100644 --- a/tests/src/rmrk/getOwnedNfts.test.ts +++ b/tests/src/rmrk/getOwnedNfts.test.ts @@ -1,6 +1,6 @@ import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; +import {requirePallets, Pallets} from './util/helpers'; import {getOwnedNfts} from './util/fetch'; import {mintNft, createCollection} from './util/tx'; diff --git a/tests/src/rmrk/lockCollection.test.ts b/tests/src/rmrk/lockCollection.test.ts index 03016fe5ea..8e5103279d 100644 --- a/tests/src/rmrk/lockCollection.test.ts +++ b/tests/src/rmrk/lockCollection.test.ts @@ -1,6 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; -import {expectTxFailure} from './util/helpers'; +import {expectTxFailure, requirePallets, Pallets} from './util/helpers'; import {createCollection, lockCollection, mintNft} from './util/tx'; describe('integration test: lock collection', () => { diff --git a/tests/src/rmrk/mintNft.test.ts b/tests/src/rmrk/mintNft.test.ts index a3fe58a7b1..f92f47724f 100644 --- a/tests/src/rmrk/mintNft.test.ts +++ b/tests/src/rmrk/mintNft.test.ts @@ -1,8 +1,7 @@ import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {getNft} from './util/fetch'; -import {expectTxFailure} from './util/helpers'; +import {expectTxFailure, requirePallets, Pallets} from './util/helpers'; import {createCollection, mintNft} from './util/tx'; describe('integration test: mint new NFT', () => { diff --git a/tests/src/rmrk/rejectNft.test.ts b/tests/src/rmrk/rejectNft.test.ts index 701b14fbfa..be40c5ffb6 100644 --- a/tests/src/rmrk/rejectNft.test.ts +++ b/tests/src/rmrk/rejectNft.test.ts @@ -7,8 +7,7 @@ import { rejectNft, } from './util/tx'; import {getChildren, NftIdTuple} from './util/fetch'; -import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; +import {isNftChildOfAnother, expectTxFailure, requirePallets, Pallets} from './util/helpers'; describe('integration test: reject NFT', () => { let api: any; diff --git a/tests/src/rmrk/removeResource.test.ts b/tests/src/rmrk/removeResource.test.ts index 941f5ea7a4..87cb21bc70 100644 --- a/tests/src/rmrk/removeResource.test.ts +++ b/tests/src/rmrk/removeResource.test.ts @@ -1,9 +1,8 @@ import {expect} from 'chai'; import privateKey from '../substrate/privateKey'; import {executeTransaction, getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {getNft, NftIdTuple} from './util/fetch'; -import {expectTxFailure} from './util/helpers'; +import {expectTxFailure, requirePallets, Pallets} from './util/helpers'; import { acceptNft, acceptResourceRemoval, addNftBasicResource, createBase, diff --git a/tests/src/rmrk/sendNft.test.ts b/tests/src/rmrk/sendNft.test.ts index 9cafa5f5e8..e9001a1cc7 100644 --- a/tests/src/rmrk/sendNft.test.ts +++ b/tests/src/rmrk/sendNft.test.ts @@ -2,8 +2,7 @@ import {expect} from 'chai'; import {getApiConnection} from '../substrate/substrate-api'; import {createCollection, mintNft, sendNft} from './util/tx'; import {NftIdTuple} from './util/fetch'; -import {isNftChildOfAnother, expectTxFailure} from './util/helpers'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; +import {isNftChildOfAnother, expectTxFailure, requirePallets, Pallets} from './util/helpers'; describe('integration test: send NFT', () => { let api: any; diff --git a/tests/src/rmrk/setCollectionProperty.test.ts b/tests/src/rmrk/setCollectionProperty.test.ts index 4cb6a2d0a4..13147c0474 100644 --- a/tests/src/rmrk/setCollectionProperty.test.ts +++ b/tests/src/rmrk/setCollectionProperty.test.ts @@ -1,6 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; -import {expectTxFailure} from './util/helpers'; +import {expectTxFailure, requirePallets, Pallets} from './util/helpers'; import {createCollection, setPropertyCollection} from './util/tx'; describe('integration test: set collection property', () => { diff --git a/tests/src/rmrk/setEquippableList.test.ts b/tests/src/rmrk/setEquippableList.test.ts index 6e16877d52..3a5203a4cc 100644 --- a/tests/src/rmrk/setEquippableList.test.ts +++ b/tests/src/rmrk/setEquippableList.test.ts @@ -1,6 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; -import {expectTxFailure} from './util/helpers'; +import {expectTxFailure, requirePallets, Pallets} from './util/helpers'; import {createCollection, createBase, setEquippableList} from './util/tx'; describe("integration test: set slot's Equippable List", () => { diff --git a/tests/src/rmrk/setNftProperty.test.ts b/tests/src/rmrk/setNftProperty.test.ts index ba7254092a..97b7b0910b 100644 --- a/tests/src/rmrk/setNftProperty.test.ts +++ b/tests/src/rmrk/setNftProperty.test.ts @@ -1,7 +1,6 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; import {NftIdTuple} from './util/fetch'; -import {expectTxFailure} from './util/helpers'; +import {expectTxFailure, requirePallets, Pallets} from './util/helpers'; import {createCollection, mintNft, sendNft, setNftProperty} from './util/tx'; describe('integration test: set NFT property', () => { diff --git a/tests/src/rmrk/setResourcePriorities.test.ts b/tests/src/rmrk/setResourcePriorities.test.ts index ac26d7874b..aa15516162 100644 --- a/tests/src/rmrk/setResourcePriorities.test.ts +++ b/tests/src/rmrk/setResourcePriorities.test.ts @@ -1,6 +1,5 @@ import {getApiConnection} from '../substrate/substrate-api'; -import {requirePallets, Pallets} from '../deprecated-helpers/helpers'; -import {expectTxFailure} from './util/helpers'; +import {expectTxFailure, requirePallets, Pallets} from './util/helpers'; import {mintNft, createCollection, setResourcePriorities} from './util/tx'; describe('integration test: set NFT resource priorities', () => { diff --git a/tests/src/rmrk/util/helpers.ts b/tests/src/rmrk/util/helpers.ts index c43fccb5a9..1bf1c7c618 100644 --- a/tests/src/rmrk/util/helpers.ts +++ b/tests/src/rmrk/util/helpers.ts @@ -10,6 +10,8 @@ import privateKey from '../../substrate/privateKey'; import {NftIdTuple, getChildren, getOwnedNfts, getCollectionProperties, getNftProperties, getResources} from './fetch'; import chaiAsPromised from 'chai-as-promised'; import chai from 'chai'; +import {getApiConnection} from '../../substrate/substrate-api'; +import {Context} from 'mocha'; chai.use(chaiAsPromised); const expect = chai.expect; @@ -19,6 +21,45 @@ interface TxResult { successData: T | null; } +export enum Pallets { + Inflation = 'inflation', + RmrkCore = 'rmrkcore', + RmrkEquip = 'rmrkequip', + ReFungible = 'refungible', + Fungible = 'fungible', + NFT = 'nonfungible', + Scheduler = 'scheduler', + AppPromotion = 'apppromotion', +} + +let modulesNames: any; +export function getModuleNames(api: ApiPromise): string[] { + if (typeof modulesNames === 'undefined') + modulesNames = api.runtimeMetadata.asLatest.pallets.map(m => m.name.toString().toLowerCase()); + return modulesNames; +} + +export async function missingRequiredPallets(requiredPallets: string[]): Promise { + const api = await getApiConnection(); + const pallets = getModuleNames(api); + + return requiredPallets.filter(p => !pallets.includes(p)); +} + +export async function requirePallets(mocha: Context, requiredPallets: string[]) { + const missingPallets = await missingRequiredPallets(requiredPallets); + + if (missingPallets.length > 0) { + const skippingTestMsg = `\tSkipping test "${mocha.test?.title}".`; + const missingPalletsMsg = `\tThe following pallets are missing:\n\t- ${missingPallets.join('\n\t- ')}`; + const skipMsg = `${skippingTestMsg}\n${missingPalletsMsg}`; + + console.error('\x1b[38:5:208m%s\x1b[0m', skipMsg); + + mocha.skip(); + } +} + export function makeNftOwner(api: ApiPromise, owner: string | NftIdTuple): NftOwner { const isNftSending = (typeof owner !== 'string'); From 641d3fa29e379bbc2da30588049a9310719bfa32 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 11 Oct 2022 06:08:47 +0000 Subject: [PATCH 1094/1274] refactor: use playgrounds in RMRK isolation test --- tests/src/rmrk/rmrkIsolation.test.ts | 298 ++++++++++++--------------- 1 file changed, 135 insertions(+), 163 deletions(-) diff --git a/tests/src/rmrk/rmrkIsolation.test.ts b/tests/src/rmrk/rmrkIsolation.test.ts index b104c46149..d9e6808f7a 100644 --- a/tests/src/rmrk/rmrkIsolation.test.ts +++ b/tests/src/rmrk/rmrkIsolation.test.ts @@ -1,85 +1,80 @@ -import {expect} from 'chai'; -import usingApi, {executeTransaction} from '../substrate/substrate-api'; -import { - createCollectionExpectSuccess, - createItemExpectSuccess, - getCreateCollectionResult, - getDetailedCollectionInfo, - getGenericResult, - requirePallets, - normalizeAccountId, - Pallets, -} from '../deprecated-helpers/helpers'; +import {executeTransaction} from '../substrate/substrate-api'; import {IKeyringPair} from '@polkadot/types/types'; -import {ApiPromise} from '@polkadot/api'; -import {it} from 'mocha'; +import {itSub, expect, usingPlaygrounds, Pallets} from '../util/playgrounds'; +import {UniqueHelper} from '../util/playgrounds/unique'; let alice: IKeyringPair; let bob: IKeyringPair; -async function createRmrkCollection(api: ApiPromise, sender: IKeyringPair): Promise<{uniqueId: number, rmrkId: number}> { - const tx = api.tx.rmrkCore.createCollection('metadata', null, 'symbol'); - const events = await executeTransaction(api, sender, tx); +async function createRmrkCollection(helper: UniqueHelper, sender: IKeyringPair): Promise<{uniqueId: number, rmrkId: number}> { + const result = await helper.executeExtrinsic(sender, 'api.tx.rmrkCore.createCollection', ['metadata', null, 'symbol'], true); - const uniqueResult = getCreateCollectionResult(events); - const rmrkResult = getGenericResult(events, 'rmrkCore', 'CollectionCreated', (data) => { - return parseInt(data[1].toString(), 10); + const uniqueId = helper.util.extractCollectionIdFromCreationResult(result); + + let rmrkId = null; + result.result.events.forEach(({event: {data, method, section}}) => { + if ((section === 'rmrkCore') && (method === 'CollectionCreated')) { + rmrkId = parseInt(data[1].toString(), 10); + } }); + if (rmrkId === null) { + throw Error('No rmrkCore.CollectionCreated event was found!'); + } + return { - uniqueId: uniqueResult.collectionId, - rmrkId: rmrkResult.data!, + uniqueId, + rmrkId, }; } -async function createRmrkNft(api: ApiPromise, sender: IKeyringPair, collectionId: number): Promise { - const tx = api.tx.rmrkCore.mintNft( - sender.address, - collectionId, - sender.address, - null, - 'nft-metadata', +async function createRmrkNft(helper: UniqueHelper, sender: IKeyringPair, collectionId: number): Promise { + const result = await helper.executeExtrinsic( + sender, + 'api.tx.rmrkCore.mintNft', + [ + sender.address, + collectionId, + sender.address, + null, + 'nft-metadata', + true, + null, + ], true, - null, ); - const events = await executeTransaction(api, sender, tx); - const result = getGenericResult(events, 'rmrkCore', 'NftMinted', (data) => { - return parseInt(data[2].toString(), 10); - }); - return result.data!; -} + let rmrkNftId = null; + result.result.events.forEach(({event: {data, method, section}}) => { + if ((section === 'rmrkCore') && (method === 'NftMinted')) { + rmrkNftId = parseInt(data[2].toString(), 10); + } + }); -async function isUnique(): Promise { - return usingApi(async api => { - const chain = await api.rpc.system.chain(); + if (rmrkNftId === null) { + throw Error('No rmrkCore.NftMinted event was found!'); + } - return chain.eq('UNIQUE'); - }); + return rmrkNftId; } describe('RMRK External Integration Test', async () => { - const it_rmrk = (await isUnique() ? it : it.skip); - before(async function() { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - await requirePallets(this, [Pallets.RmrkCore]); + await usingPlaygrounds(async (_helper, privateKey) => { + alice = privateKey('//Alice'); }); }); - it_rmrk('Creates a new RMRK collection that is mapped to a different ID and is tagged as external', async () => { - await usingApi(async api => { - // throwaway collection to bump last Unique collection ID to test ID mapping - await createCollectionExpectSuccess(); + itSub.ifWithPallets('Creates a new RMRK collection that is mapped to a different ID and is tagged as external', [Pallets.RmrkCore], async ({helper}) => { + // throw away collection to bump last Unique collection ID to test ID mapping + await helper.nft.mintCollection(alice, {tokenPrefix: 'unqt'}); - const collectionIds = await createRmrkCollection(api, alice); + const collectionIds = await createRmrkCollection(helper, alice); - expect(collectionIds.rmrkId).to.be.lessThan(collectionIds.uniqueId, 'collection ID mapping'); + expect(collectionIds.rmrkId).to.be.lessThan(collectionIds.uniqueId, 'collection ID mapping'); - const collection = (await getDetailedCollectionInfo(api, collectionIds.uniqueId))!; - expect(collection.readOnly.toHuman(), 'tagged external').to.be.true; - }); + const collection = (await helper.nft.getCollectionObject(collectionIds.uniqueId).getData())!; // (await getDetailedCollectionInfo(api, collectionIds.uniqueId))!; + expect(collection.raw.readOnly, 'tagged external').to.be.true; }); }); @@ -87,137 +82,115 @@ describe('Negative Integration Test: External Collections, Internal Ops', async let uniqueCollectionId: number; let rmrkCollectionId: number; let rmrkNftId: number; - - const it_rmrk = (await isUnique() ? it : it.skip); + let normalizedAlice: {Substrate: string}; before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + alice = privateKey('//Alice'); + bob = privateKey('//Bob'); + normalizedAlice = {Substrate: helper.address.normalizeSubstrateToChainFormat(alice.address)}; - const collectionIds = await createRmrkCollection(api, alice); + const collectionIds = await createRmrkCollection(helper, alice); uniqueCollectionId = collectionIds.uniqueId; rmrkCollectionId = collectionIds.rmrkId; - rmrkNftId = await createRmrkNft(api, alice, rmrkCollectionId); + rmrkNftId = await createRmrkNft(helper, alice, rmrkCollectionId); }); }); - it_rmrk('[Negative] Forbids Unique operations with an external collection, handled by dispatch_call', async () => { - await usingApi(async api => { - // Collection item creation - - const txCreateItem = api.tx.unique.createItem(uniqueCollectionId, normalizeAccountId(alice), 'NFT'); - await expect(executeTransaction(api, alice, txCreateItem), 'creating item') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + itSub.ifWithPallets('[Negative] Forbids Unique operations with an external collection, handled by dispatch_call', [Pallets.RmrkCore], async ({helper}) => { + // Collection item creation - const txCreateMultipleItems = api.tx.unique.createMultipleItems(uniqueCollectionId, normalizeAccountId(alice), [{NFT: {}}, {NFT: {}}]); - await expect(executeTransaction(api, alice, txCreateMultipleItems), 'creating multiple') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.mintToken(alice, {collectionId: uniqueCollectionId, owner: {Substrate: alice.address}}), 'creating item') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txCreateMultipleItemsEx = api.tx.unique.createMultipleItemsEx(uniqueCollectionId, {NFT: [{}]}); - await expect(executeTransaction(api, alice, txCreateMultipleItemsEx), 'creating multiple ex') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + const txCreateMultipleItems = helper.getApi().tx.unique.createMultipleItems(uniqueCollectionId, normalizedAlice, [{NFT: {}}, {NFT: {}}]); + await expect(executeTransaction(helper.getApi(), alice, txCreateMultipleItems), 'creating multiple') + .to.be.rejectedWith(/common\.CollectionIsExternal/); + + await expect(helper.nft.mintMultipleTokens(alice, uniqueCollectionId, [{owner: {Substrate: alice.address}}]), 'creating multiple ex') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - // Collection properties + // Collection properties - const txSetCollectionProperties = api.tx.unique.setCollectionProperties(uniqueCollectionId, [{key: 'a', value: '1'}, {key: 'b'}]); - await expect(executeTransaction(api, alice, txSetCollectionProperties), 'setting collection properties') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.setProperties(alice, uniqueCollectionId, [{key: 'a', value: '1'}, {key: 'b'}]), 'setting collection properties') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txDeleteCollectionProperties = api.tx.unique.deleteCollectionProperties(uniqueCollectionId, ['a']); - await expect(executeTransaction(api, alice, txDeleteCollectionProperties), 'deleting collection properties') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.deleteProperties(alice, uniqueCollectionId, ['a']), 'deleting collection properties') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txsetTokenPropertyPermissions = api.tx.unique.setTokenPropertyPermissions(uniqueCollectionId, [{key: 'a', permission: {mutable: true}}]); - await expect(executeTransaction(api, alice, txsetTokenPropertyPermissions), 'setting property permissions') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.setTokenPropertyPermissions(alice, uniqueCollectionId, [{key: 'a', permission: {mutable: true}}]), 'setting property permissions') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - // NFT + // NFT - const txBurn = api.tx.unique.burnItem(uniqueCollectionId, rmrkNftId, 1); - await expect(executeTransaction(api, alice, txBurn), 'burning').to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.burnToken(alice, uniqueCollectionId, rmrkNftId, 1n), 'burning') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txBurnFrom = api.tx.unique.burnFrom(uniqueCollectionId, normalizeAccountId(alice), rmrkNftId, 1); - await expect(executeTransaction(api, alice, txBurnFrom), 'burning-from').to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.burnTokenFrom(alice, uniqueCollectionId, rmrkNftId, {Substrate: alice.address}, 1n), 'burning-from') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txTransfer = api.tx.unique.transfer(normalizeAccountId(bob), uniqueCollectionId, rmrkNftId, 1); - await expect(executeTransaction(api, alice, txTransfer), 'transferring').to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.transferToken(alice, uniqueCollectionId, rmrkNftId, {Substrate: bob.address}), 'transferring') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txApprove = api.tx.unique.approve(normalizeAccountId(bob), uniqueCollectionId, rmrkNftId, 1); - await expect(executeTransaction(api, alice, txApprove), 'approving').to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.approveToken(alice, uniqueCollectionId, rmrkNftId, {Substrate: bob.address}), 'approving') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txTransferFrom = api.tx.unique.transferFrom(normalizeAccountId(alice), normalizeAccountId(bob), uniqueCollectionId, rmrkNftId, 1); - await expect(executeTransaction(api, alice, txTransferFrom), 'transferring-from').to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.transferTokenFrom(alice, uniqueCollectionId, rmrkNftId, {Substrate: alice.address}, {Substrate: bob.address}), 'transferring-from') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - // NFT properties + // NFT properties - const txSetTokenProperties = api.tx.unique.setTokenProperties(uniqueCollectionId, rmrkNftId, [{key: 'a', value: '2'}]); - await expect(executeTransaction(api, alice, txSetTokenProperties), 'setting token properties') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.setTokenProperties(alice, uniqueCollectionId, rmrkNftId, [{key: 'a', value: '2'}]), 'setting token properties') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txDeleteTokenProperties = api.tx.unique.deleteTokenProperties(uniqueCollectionId, rmrkNftId, ['a']); - await expect(executeTransaction(api, alice, txDeleteTokenProperties), 'deleting token properties') - .to.be.rejectedWith(/common\.CollectionIsExternal/); - }); + await expect(helper.nft.deleteTokenProperties(alice, uniqueCollectionId, rmrkNftId, ['a'])) + .to.be.rejectedWith(/common\.CollectionIsExternal/); }); - it_rmrk('[Negative] Forbids Unique collection operations with an external collection', async () => { - await usingApi(async api => { - const txDestroyCollection = api.tx.unique.destroyCollection(uniqueCollectionId); - await expect(executeTransaction(api, alice, txDestroyCollection), 'destroying collection') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + itSub.ifWithPallets('[Negative] Forbids Unique collection operations with an external collection', [Pallets.RmrkCore], async ({helper}) => { + await expect(helper.nft.burn(alice, uniqueCollectionId), 'destroying collection') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - // Allow list + // Allow list - const txAddAllowList = api.tx.unique.addToAllowList(uniqueCollectionId, normalizeAccountId(bob)); - await expect(executeTransaction(api, alice, txAddAllowList), 'adding to allow list') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.addToAllowList(alice, uniqueCollectionId, {Substrate: bob.address}), 'adding to allow list') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txRemoveAllowList = api.tx.unique.removeFromAllowList(uniqueCollectionId, normalizeAccountId(bob)); - await expect(executeTransaction(api, alice, txRemoveAllowList), 'removing from allowlist') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.removeFromAllowList(alice, uniqueCollectionId, {Substrate: bob.address}), 'removing from allowlist') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - // Owner / Admin / Sponsor + // Owner / Admin / Sponsor - const txChangeOwner = api.tx.unique.changeCollectionOwner(uniqueCollectionId, bob.address); - await expect(executeTransaction(api, alice, txChangeOwner), 'changing owner') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.changeOwner(alice, uniqueCollectionId, bob.address), 'changing owner') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txAddAdmin = api.tx.unique.addCollectionAdmin(uniqueCollectionId, normalizeAccountId(bob)); - await expect(executeTransaction(api, alice, txAddAdmin), 'adding admin') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.addAdmin(alice, uniqueCollectionId, {Substrate: bob.address}), 'adding admin') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txRemoveAdmin = api.tx.unique.removeCollectionAdmin(uniqueCollectionId, normalizeAccountId(bob)); - await expect(executeTransaction(api, alice, txRemoveAdmin), 'removing admin') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.removeAdmin(alice, uniqueCollectionId, {Substrate: bob.address}), 'removing admin') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txAddCollectionSponsor = api.tx.unique.setCollectionSponsor(uniqueCollectionId, bob.address); - await expect(executeTransaction(api, alice, txAddCollectionSponsor), 'setting sponsor') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.setSponsor(alice, uniqueCollectionId, bob.address), 'setting sponsor') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txConfirmCollectionSponsor = api.tx.unique.confirmSponsorship(uniqueCollectionId); - await expect(executeTransaction(api, alice, txConfirmCollectionSponsor), 'confirming sponsor') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.confirmSponsorship(alice, uniqueCollectionId), 'confirming sponsor') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txRemoveCollectionSponsor = api.tx.unique.removeCollectionSponsor(uniqueCollectionId); - await expect(executeTransaction(api, alice, txRemoveCollectionSponsor), 'removing sponsor') - .to.be.rejectedWith(/common\.CollectionIsExternal/); - - // Limits / permissions / transfers + await expect(helper.nft.removeSponsor(alice, uniqueCollectionId), 'removing sponsor') + .to.be.rejectedWith(/common\.CollectionIsExternal/); + + // Limits / permissions / transfers - const txSetTransfers = api.tx.unique.setTransfersEnabledFlag(uniqueCollectionId, true); - await expect(executeTransaction(api, alice, txSetTransfers), 'setting transfers enabled flag') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + const txSetTransfers = helper.getApi().tx.unique.setTransfersEnabledFlag(uniqueCollectionId, true); + await expect(executeTransaction(helper.getApi(), alice, txSetTransfers), 'setting transfers enabled flag') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txSetLimits = api.tx.unique.setCollectionLimits(uniqueCollectionId, {transfersEnabled: false}); - await expect(executeTransaction(api, alice, txSetLimits), 'setting collection limits') - .to.be.rejectedWith(/common\.CollectionIsExternal/); + await expect(helper.nft.setLimits(alice, uniqueCollectionId, {transfersEnabled: false}), 'setting collection limits') + .to.be.rejectedWith(/common\.CollectionIsExternal/); - const txSetPermissions = api.tx.unique.setCollectionPermissions(uniqueCollectionId, {access: 'AllowList'}); - await expect(executeTransaction(api, alice, txSetPermissions), 'setting collection permissions') - .to.be.rejectedWith(/common\.CollectionIsExternal/); - }); + await expect(helper.nft.setPermissions(alice, uniqueCollectionId, {access: 'AllowList'}), 'setting collection permissions') + .to.be.rejectedWith(/common\.CollectionIsExternal/); }); }); @@ -225,27 +198,26 @@ describe('Negative Integration Test: Internal Collections, External Ops', async let collectionId: number; let nftId: number; - const it_rmrk = (await isUnique() ? it : it.skip); - before(async () => { - await usingApi(async (api, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); + await usingPlaygrounds(async (helper, privateKey) => { + alice = privateKey('//Alice'); + bob = privateKey('//Bob'); - collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}}); - nftId = await createItemExpectSuccess(alice, collectionId, 'NFT'); + const collection = await helper.nft.mintCollection(alice, {tokenPrefix: 'iceo'}); + collectionId = collection.collectionId; + nftId = (await collection.mintToken(alice)).tokenId; }); }); - it_rmrk('[Negative] Forbids RMRK operations with the internal collection and NFT (due to the lack of mapping)', async () => { - await usingApi(async api => { - const txChangeOwner = api.tx.rmrkCore.changeCollectionIssuer(collectionId, bob.address); - await expect(executeTransaction(api, alice, txChangeOwner), 'changing collection issuer') - .to.be.rejectedWith(/rmrkCore\.CollectionUnknown/); + itSub.ifWithPallets('[Negative] Forbids RMRK operations with the internal collection and NFT (due to the lack of mapping)', [Pallets.RmrkCore], async ({helper}) => { + const api = helper.getApi(); - const maxBurns = 10; - const txBurnItem = api.tx.rmrkCore.burnNft(collectionId, nftId, maxBurns); - await expect(executeTransaction(api, alice, txBurnItem), 'burning NFT').to.be.rejectedWith(/rmrkCore\.CollectionUnknown/); - }); + const txChangeOwner = api.tx.rmrkCore.changeCollectionIssuer(collectionId, bob.address); + await expect(executeTransaction(api, alice, txChangeOwner), 'changing collection issuer') + .to.be.rejectedWith(/rmrkCore\.CollectionUnknown/); + + const maxBurns = 10; + const txBurnItem = api.tx.rmrkCore.burnNft(collectionId, nftId, maxBurns); + await expect(executeTransaction(api, alice, txBurnItem), 'burning NFT').to.be.rejectedWith(/rmrkCore\.CollectionUnknown/); }); }); From 65ae6b1a299c1243dd3efe337e3c8d0a179f33d7 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Tue, 11 Oct 2022 11:23:40 +0000 Subject: [PATCH 1095/1274] Create donors for seqtest and change test scripts --- tests/package.json | 4 +++- tests/src/deprecated-helpers/helpers.ts | 4 ++-- tests/src/util/playgrounds/globalSetup.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/package.json b/tests/package.json index 2040ac9bcf..276eb4d7d0 100644 --- a/tests/package.json +++ b/tests/package.json @@ -27,8 +27,10 @@ "lint": "eslint --ext .ts,.js src/", "fix": "eslint --ext .ts,.js src/ --fix", - "test": "mocha --parallel --timeout 9999999 -r ts-node/register './src/**/*.test.ts'", + "test": "npm run testParallel && npm run testSequential", + "testParallel": "mocha --parallel --timeout 9999999 -r ts-node/register './src/**/*.test.ts'", "testSequential": "mocha --timeout 9999999 -r ts-node/register './src/**/*.seqtest.ts'", + "testDevnode": "mocha --timeout 9999999 -r ts-node/register './src/**/*test.ts'", "testStructure": "mocha --parallel --timeout 9999999 -r ts-node/register ./**/nesting/**.test.ts", "testEth": "mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/**/*.test.ts'", "testEthNesting": "mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/nesting/**/*.test.ts'", diff --git a/tests/src/deprecated-helpers/helpers.ts b/tests/src/deprecated-helpers/helpers.ts index cff8eff881..e251730768 100644 --- a/tests/src/deprecated-helpers/helpers.ts +++ b/tests/src/deprecated-helpers/helpers.ts @@ -1764,11 +1764,11 @@ export async function queryCollectionExpectSuccess(api: ApiPromise, collectionId return (await api.rpc.unique.collectionById(collectionId)).unwrap(); } -/*export const describe_xcm = ( +export const describe_xcm = ( process.env.RUN_XCM_TESTS ? describe : describe.skip -);*/ +); export async function waitNewBlocks(blocksCount = 1): Promise { await usingApi(async (api) => { diff --git a/tests/src/util/playgrounds/globalSetup.ts b/tests/src/util/playgrounds/globalSetup.ts index 2391b9cc39..19a13e9993 100644 --- a/tests/src/util/playgrounds/globalSetup.ts +++ b/tests/src/util/playgrounds/globalSetup.ts @@ -63,7 +63,7 @@ const fundFilenames = async () => { let batchBalanceGrantedCounter = 0; for (let i = 0; batchBalanceGrantedCounter < batchSize && b + i < filenames.length; i++) { const f = filenames[b + i]; - if (!f.endsWith('.test.ts') || f.includes('.outdated')) continue; + if (!f.endsWith('.test.ts') && !f.endsWith('seqtest.ts') || f.includes('.outdated')) continue; const account = await privateKey({filename: f, ignoreFundsPresence: true}); const aliceBalance = await helper.balance.getSubstrate(account.address); From 3e53a318506271563f8184ff09b1b903b80da04c Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 11 Oct 2022 12:04:32 +0000 Subject: [PATCH 1096/1274] fix: remove deprecated helpers from qtz xcm tests --- tests/src/xcm/xcmQuartz.test.ts | 50 +++++++++++++++------------------ 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index 9928b79a38..c583dc2c2b 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {Keyring} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import {generateKeyringPair, bigIntToDecimals} from '../deprecated-helpers/helpers'; import {blake2AsHex} from '@polkadot/util-crypto'; import {XcmV2TraitsOutcome, XcmV2TraitsError} from '../interfaces'; import {itSub, expect, describeXcm, usingPlaygrounds, usingKaruraPlaygrounds, usingRelayPlaygrounds, usingMoonriverPlaygrounds} from '../util/playgrounds'; @@ -53,10 +51,8 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Karura', () => { before(async () => { await usingPlaygrounds(async (helper, privateKey) => { - const keyringSr25519 = new Keyring({type: 'sr25519'}); - alice = privateKey('//Alice'); - randomAccount = generateKeyringPair(keyringSr25519); + [randomAccount] = await helper.arrange.createAccounts([0n], alice); }); await usingKaruraPlaygrounds(karuraUrl, async (helper) => { @@ -136,7 +132,7 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Karura', () => { balanceQuartzTokenMiddle = await helper.balance.getSubstrate(randomAccount.address); const qtzFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT; - console.log('[Quartz -> Karura] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees)); + console.log('[Quartz -> Karura] transaction fees on Quartz: %s QTZ', helper.util.bigIntToDecimals(qtzFees)); expect(qtzFees > 0n).to.be.true; await usingKaruraPlaygrounds(karuraUrl, async (helper) => { @@ -149,9 +145,9 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Karura', () => { console.log( '[Quartz -> Karura] transaction fees on Karura: %s KAR', - bigIntToDecimals(karFees, KARURA_DECIMALS), + helper.util.bigIntToDecimals(karFees, KARURA_DECIMALS), ); - console.log('[Quartz -> Karura] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer)); + console.log('[Quartz -> Karura] income %s QTZ', helper.util.bigIntToDecimals(qtzIncomeTransfer)); expect(karFees == 0n).to.be.true; expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true; }); @@ -191,9 +187,9 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Karura', () => { console.log( '[Karura -> Quartz] transaction fees on Karura: %s KAR', - bigIntToDecimals(karFees, KARURA_DECIMALS), + helper.util.bigIntToDecimals(karFees, KARURA_DECIMALS), ); - console.log('[Karura -> Quartz] outcome %s QTZ', bigIntToDecimals(qtzOutcomeTransfer)); + console.log('[Karura -> Quartz] outcome %s QTZ', helper.util.bigIntToDecimals(qtzOutcomeTransfer)); expect(karFees > 0).to.be.true; expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; @@ -205,10 +201,10 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Karura', () => { const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle; expect(actuallyDelivered > 0).to.be.true; - console.log('[Karura -> Quartz] actually delivered %s QTZ', bigIntToDecimals(actuallyDelivered)); + console.log('[Karura -> Quartz] actually delivered %s QTZ', helper.util.bigIntToDecimals(actuallyDelivered)); const qtzFees = TRANSFER_AMOUNT - actuallyDelivered; - console.log('[Karura -> Quartz] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees)); + console.log('[Karura -> Quartz] transaction fees on Quartz: %s QTZ', helper.util.bigIntToDecimals(qtzFees)); expect(qtzFees == 0n).to.be.true; }); }); @@ -342,7 +338,7 @@ describeXcm('[XCM] Integration test: Quartz rejects non-native tokens', () => { describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { // Quartz constants - let quartzAlice: IKeyringPair; + let quartzDonor: IKeyringPair; let quartzAssetLocation; let randomAccountQuartz: IKeyringPair; @@ -375,13 +371,9 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { let balanceMovrTokenFinal: bigint; before(async () => { - await usingPlaygrounds(async (_helper, privateKey) => { - const keyringEth = new Keyring({type: 'ethereum'}); - const keyringSr25519 = new Keyring({type: 'sr25519'}); - - quartzAlice = privateKey('//Alice'); - randomAccountQuartz = generateKeyringPair(keyringSr25519); - randomAccountMoonriver = generateKeyringPair(keyringEth); + await usingPlaygrounds(async (helper, privateKey) => { + quartzDonor = privateKey('//Alice'); + [randomAccountQuartz] = await helper.arrange.createAccounts([0n], quartzDonor); balanceForeignQtzTokenInit = 0n; }); @@ -391,6 +383,8 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { const baltatharAccount = helper.account.baltatharAccount(); const dorothyAccount = helper.account.dorothyAccount(); + randomAccountMoonriver = helper.account.create(); + // >>> Sponsoring Dorothy >>> console.log('Sponsoring Dorothy.......'); await helper.balance.transferToEthereum(alithAccount, dorothyAccount.address, 11_000_000_000_000_000_000n); @@ -493,7 +487,7 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { }); await usingPlaygrounds(async (helper) => { - await helper.balance.transferToSubstrate(quartzAlice, randomAccountQuartz.address, 10n * TRANSFER_AMOUNT); + await helper.balance.transferToSubstrate(quartzDonor, randomAccountQuartz.address, 10n * TRANSFER_AMOUNT); balanceQuartzTokenInit = await helper.balance.getSubstrate(randomAccountQuartz.address); }); }); @@ -522,7 +516,7 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { expect(balanceQuartzTokenMiddle < balanceQuartzTokenInit).to.be.true; const transactionFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT; - console.log('[Quartz -> Moonriver] transaction fees on Quartz: %s QTZ', bigIntToDecimals(transactionFees)); + console.log('[Quartz -> Moonriver] transaction fees on Quartz: %s QTZ', helper.util.bigIntToDecimals(transactionFees)); expect(transactionFees > 0).to.be.true; await usingMoonriverPlaygrounds(moonriverUrl, async (helper) => { @@ -531,12 +525,12 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { balanceMovrTokenMiddle = await helper.balance.getEthereum(randomAccountMoonriver.address); const movrFees = balanceMovrTokenInit - balanceMovrTokenMiddle; - console.log('[Quartz -> Moonriver] transaction fees on Moonriver: %s MOVR',bigIntToDecimals(movrFees)); + console.log('[Quartz -> Moonriver] transaction fees on Moonriver: %s MOVR',helper.util.bigIntToDecimals(movrFees)); expect(movrFees == 0n).to.be.true; balanceForeignQtzTokenMiddle = (await helper.assets.account(assetId, randomAccountMoonriver.address))!; // BigInt(qtzRandomAccountAsset['balance']); const qtzIncomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenInit; - console.log('[Quartz -> Moonriver] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer)); + console.log('[Quartz -> Moonriver] income %s QTZ', helper.util.bigIntToDecimals(qtzIncomeTransfer)); expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true; }); }); @@ -576,7 +570,7 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { balanceMovrTokenFinal = await helper.balance.getEthereum(randomAccountMoonriver.address); const movrFees = balanceMovrTokenMiddle - balanceMovrTokenFinal; - console.log('[Moonriver -> Quartz] transaction fees on Moonriver: %s MOVR', bigIntToDecimals(movrFees)); + console.log('[Moonriver -> Quartz] transaction fees on Moonriver: %s MOVR', helper.util.bigIntToDecimals(movrFees)); expect(movrFees > 0).to.be.true; const qtzRandomAccountAsset = await helper.assets.account(assetId, randomAccountMoonriver.address); @@ -586,7 +580,7 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { balanceForeignQtzTokenFinal = 0n; const qtzOutcomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenFinal; - console.log('[Quartz -> Moonriver] outcome %s QTZ', bigIntToDecimals(qtzOutcomeTransfer)); + console.log('[Quartz -> Moonriver] outcome %s QTZ', helper.util.bigIntToDecimals(qtzOutcomeTransfer)); expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; }); @@ -596,10 +590,10 @@ describeXcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle; expect(actuallyDelivered > 0).to.be.true; - console.log('[Moonriver -> Quartz] actually delivered %s QTZ', bigIntToDecimals(actuallyDelivered)); + console.log('[Moonriver -> Quartz] actually delivered %s QTZ', helper.util.bigIntToDecimals(actuallyDelivered)); const qtzFees = TRANSFER_AMOUNT - actuallyDelivered; - console.log('[Moonriver -> Quartz] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees)); + console.log('[Moonriver -> Quartz] transaction fees on Quartz: %s QTZ', helper.util.bigIntToDecimals(qtzFees)); expect(qtzFees == 0n).to.be.true; }); }); From d4f8612460c4b826a41421f849c5aabffd81ab14 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 11 Oct 2022 12:05:04 +0000 Subject: [PATCH 1097/1274] fix: remove deprecated helpers from opal xcm test --- tests/src/xcm/xcmOpal.test.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/src/xcm/xcmOpal.test.ts b/tests/src/xcm/xcmOpal.test.ts index 69fb2ab079..6787472fdf 100644 --- a/tests/src/xcm/xcmOpal.test.ts +++ b/tests/src/xcm/xcmOpal.test.ts @@ -15,7 +15,6 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {bigIntToDecimals, paraSiblingSovereignAccount} from './../deprecated-helpers/helpers'; import {itSub, expect, describeXcm, usingPlaygrounds, usingWestmintPlaygrounds, usingRelayPlaygrounds} from '../util/playgrounds'; const STATEMINE_CHAIN = 1000; @@ -75,7 +74,7 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { await helper.assets.mint(alice, ASSET_ID, alice.address, ASSET_AMOUNT); // funding parachain sovereing account (Parachain: 2095) - const parachainSovereingAccount = await paraSiblingSovereignAccount(UNIQUE_CHAIN); + const parachainSovereingAccount = helper.address.paraSiblingSovereignAccount(UNIQUE_CHAIN); await helper.balance.transferToSubstrate(bob, parachainSovereingAccount, fundingAmount); }); @@ -215,7 +214,7 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { // common good parachain take commission in it native token console.log( 'Opal to Westmint transaction fees on Westmint: %s WND', - bigIntToDecimals(balanceStmnBefore - balanceStmnAfter, WESTMINT_DECIMALS), + helper.util.bigIntToDecimals(balanceStmnBefore - balanceStmnAfter, WESTMINT_DECIMALS), ); expect(balanceStmnBefore > balanceStmnAfter).to.be.true; @@ -234,13 +233,13 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { expect(free == TRANSFER_AMOUNT).to.be.true; console.log( 'Opal to Westmint transaction fees on Opal: %s USDT', - bigIntToDecimals(TRANSFER_AMOUNT - free), + helper.util.bigIntToDecimals(TRANSFER_AMOUNT - free), ); // ... and parachain native token expect(balanceOpalAfter == balanceOpalBefore).to.be.true; console.log( 'Opal to Westmint transaction fees on Opal: %s WND', - bigIntToDecimals(balanceOpalAfter - balanceOpalBefore, WESTMINT_DECIMALS), + helper.util.bigIntToDecimals(balanceOpalAfter - balanceOpalBefore, WESTMINT_DECIMALS), ); }); @@ -355,11 +354,11 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { const wndFee = balanceBobRelayTokenAfter - TRANSFER_AMOUNT_RELAY - balanceBobRelayTokenBefore; console.log( 'Relay (Westend) to Opal transaction fees: %s OPL', - bigIntToDecimals(balanceBobAfter - balanceBobBefore), + helper.util.bigIntToDecimals(balanceBobAfter - balanceBobBefore), ); console.log( 'Relay (Westend) to Opal transaction fees: %s WND', - bigIntToDecimals(wndFee, WESTMINT_DECIMALS), + helper.util.bigIntToDecimals(wndFee, WESTMINT_DECIMALS), ); expect(balanceBobBefore == balanceBobAfter).to.be.true; expect(balanceBobRelayTokenBefore < balanceBobRelayTokenAfter).to.be.true; From 646fe67abd7f7bb969a6deb4961dad8a8a310815 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 11 Oct 2022 12:05:41 +0000 Subject: [PATCH 1098/1274] fix: call super clearApi in eth helpers --- tests/src/eth/util/playgrounds/unique.dev.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index b66f784500..98771d6582 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -361,6 +361,7 @@ export class EthUniqueHelper extends DevUniqueHelper { } clearApi() { + super.clearApi(); this.web3 = null; } From f5e3860bbbbb49d217050475cc5298899d79839a Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 11 Oct 2022 12:06:25 +0000 Subject: [PATCH 1099/1274] feat: add bitintToDecimals and sovereign account util --- tests/src/util/playgrounds/unique.ts | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 0e62c36578..32af9d07e7 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -252,6 +252,19 @@ class UniqueUtil { isSuccess = isSuccess && amount === transfer.amount; return isSuccess; } + + static bigIntToDecimals(number: bigint, decimals = 18) { + const numberStr = number.toString(); + const dotPos = numberStr.length - decimals; + + if (dotPos <= 0) { + return '0.' + '0'.repeat(Math.abs(dotPos)) + numberStr; + } else { + const intPart = numberStr.substring(0, dotPos); + const fractPart = numberStr.substring(dotPos); + return intPart + '.' + fractPart; + } + } } class UniqueEventHelper { @@ -2282,6 +2295,17 @@ class AddressGroup extends HelperGroup { substrateToEth(subAddress: TSubstrateAccount): TEthereumAccount { return CrossAccountId.translateSubToEth(subAddress); } + + paraSiblingSovereignAccount(paraid: number) { + // We are getting a *sibling* parachain sovereign account, + // so we need a sibling prefix: encoded(b"sibl") == 0x7369626c + const siblingPrefix = '0x7369626c'; + + const encodedParaId = this.helper.getApi().createType('u32', paraid).toHex(true).substring(2); + const suffix = '000000000000000000000000000000000000000000000000'; + + return siblingPrefix + encodedParaId + suffix; + } } class StakingGroup extends HelperGroup { @@ -2601,7 +2625,6 @@ export class UniqueHelper extends ChainHelperBase { super(logger, options.helperBase ?? UniqueHelper); this.balance = new BalanceGroup(this); - this.address = new AddressGroup(this); this.collection = new CollectionGroup(this); this.nft = new NFTGroup(this); this.rft = new RFTGroup(this); From 0e54e4ffee5d25a353df2ce9f699401d5438a4cf Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 11 Oct 2022 12:07:23 +0000 Subject: [PATCH 1100/1274] feat: add create account to moonbeam helper --- tests/src/util/playgrounds/unique.dev.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index aeb37826c5..1be4662d23 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -8,6 +8,7 @@ import * as defs from '../../interfaces/definitions'; import {IKeyringPair} from '@polkadot/types/types'; import {EventRecord} from '@polkadot/types/interfaces'; import {ICrossAccountId} from './types'; +import {FrameSystemEventRecord} from '@polkadot/types/lookup'; export class SilentLogger { log(_msg: any, _level: any): void { } @@ -289,6 +290,7 @@ class ArrangeGroup { class MoonbeamAccountGroup { helper: MoonbeamHelper; + keyring: Keyring; _alithAccount: IKeyringPair; _baltatharAccount: IKeyringPair; _dorothyAccount: IKeyringPair; @@ -296,14 +298,14 @@ class MoonbeamAccountGroup { constructor(helper: MoonbeamHelper) { this.helper = helper; - const keyring = new Keyring({type: 'ethereum'}); + this.keyring = new Keyring({type: 'ethereum'}); const alithPrivateKey = '0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133'; const baltatharPrivateKey = '0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b'; const dorothyPrivateKey = '0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68'; - this._alithAccount = keyring.addFromUri(alithPrivateKey, undefined, 'ethereum'); - this._baltatharAccount = keyring.addFromUri(baltatharPrivateKey, undefined, 'ethereum'); - this._dorothyAccount = keyring.addFromUri(dorothyPrivateKey, undefined, 'ethereum'); + this._alithAccount = this.keyring.addFromUri(alithPrivateKey, undefined, 'ethereum'); + this._baltatharAccount = this.keyring.addFromUri(baltatharPrivateKey, undefined, 'ethereum'); + this._dorothyAccount = this.keyring.addFromUri(dorothyPrivateKey, undefined, 'ethereum'); } alithAccount() { @@ -317,6 +319,10 @@ class MoonbeamAccountGroup { dorothyAccount() { return this._dorothyAccount; } + + create() { + return this.keyring.addFromUri(mnemonicGenerate()); + } } class WaitGroup { @@ -383,9 +389,9 @@ class WaitGroup { console.log(`[Block #${blockNumber}] Waiting for event \`${eventIdStr}\` (${waitLimitStr})`); const apiAt = await this.helper.getApi().at(blockHash); - const eventRecords = await apiAt.query.system.events(); + const eventRecords = (await apiAt.query.system.events()) as any; - const neededEvent = eventRecords.find(r => { + const neededEvent = eventRecords.toArray().find((r: FrameSystemEventRecord) => { return r.event.section == eventSection && r.event.method == eventMethod; }); From 7b023557183bc934ced9087dfd6c03bc22d0b0cd Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 11 Oct 2022 12:27:56 +0000 Subject: [PATCH 1101/1274] fix: remove deprecated helpers from unique xcm test --- tests/src/xcm/xcmUnique.test.ts | 67 ++++++++++++++------------------- 1 file changed, 28 insertions(+), 39 deletions(-) diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index dad69d2b5d..358342a838 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {Keyring} from '@polkadot/api'; import {IKeyringPair} from '@polkadot/types/types'; -import {generateKeyringPair, bigIntToDecimals} from '../deprecated-helpers/helpers'; import {blake2AsHex} from '@polkadot/util-crypto'; import {XcmV2TraitsError, XcmV2TraitsOutcome} from '../interfaces'; import {itSub, expect, describeXcm, usingPlaygrounds, usingAcalaPlaygrounds, usingRelayPlaygrounds, usingMoonbeamPlaygrounds} from '../util/playgrounds'; @@ -52,11 +50,9 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Acala', () => { let balanceUniqueForeignTokenFinal: bigint; before(async () => { - await usingPlaygrounds(async (_helper, privateKey) => { - const keyringSr25519 = new Keyring({type: 'sr25519'}); - + await usingPlaygrounds(async (helper, privateKey) => { alice = privateKey('//Alice'); - randomAccount = generateKeyringPair(keyringSr25519); + [randomAccount] = await helper.arrange.createAccounts([0n], alice); }); await usingAcalaPlaygrounds(acalaUrl, async (helper) => { @@ -138,7 +134,7 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Acala', () => { balanceUniqueTokenMiddle = await helper.balance.getSubstrate(randomAccount.address); const unqFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT; - console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees)); + console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', helper.util.bigIntToDecimals(unqFees)); expect(unqFees > 0n).to.be.true; await usingAcalaPlaygrounds(acalaUrl, async (helper) => { @@ -152,9 +148,9 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Acala', () => { console.log( '[Unique -> Acala] transaction fees on Acala: %s ACA', - bigIntToDecimals(acaFees, ACALA_DECIMALS), + helper.util.bigIntToDecimals(acaFees, ACALA_DECIMALS), ); - console.log('[Unique -> Acala] income %s UNQ', bigIntToDecimals(unqIncomeTransfer)); + console.log('[Unique -> Acala] income %s UNQ', helper.util.bigIntToDecimals(unqIncomeTransfer)); expect(acaFees == 0n).to.be.true; expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true; }); @@ -195,9 +191,9 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Acala', () => { console.log( '[Acala -> Unique] transaction fees on Acala: %s ACA', - bigIntToDecimals(acaFees, ACALA_DECIMALS), + helper.util.bigIntToDecimals(acaFees, ACALA_DECIMALS), ); - console.log('[Acala -> Unique] outcome %s UNQ', bigIntToDecimals(unqOutcomeTransfer)); + console.log('[Acala -> Unique] outcome %s UNQ', helper.util.bigIntToDecimals(unqOutcomeTransfer)); expect(acaFees > 0).to.be.true; expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; @@ -209,10 +205,10 @@ describeXcm('[XCM] Integration test: Exchanging tokens with Acala', () => { const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle; expect(actuallyDelivered > 0).to.be.true; - console.log('[Acala -> Unique] actually delivered %s UNQ', bigIntToDecimals(actuallyDelivered)); + console.log('[Acala -> Unique] actually delivered %s UNQ', helper.util.bigIntToDecimals(actuallyDelivered)); const unqFees = TRANSFER_AMOUNT - actuallyDelivered; - console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees)); + console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', helper.util.bigIntToDecimals(unqFees)); expect(unqFees == 0n).to.be.true; }); }); @@ -343,10 +339,10 @@ describeXcm('[XCM] Integration test: Unique rejects non-native tokens', () => { }); }); -describe.only('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { +describeXcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { // Unique constants - let uniqueAlice: IKeyringPair; + let uniqueDonor: IKeyringPair; let uniqueAssetLocation; let randomAccountUnique: IKeyringPair; @@ -355,15 +351,6 @@ describe.only('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { // Moonbeam constants let assetId: string; - const moonbeamKeyring = new Keyring({type: 'ethereum'}); - const alithPrivateKey = '0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133'; - const baltatharPrivateKey = '0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b'; - const dorothyPrivateKey = '0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68'; - - const alithAccount = moonbeamKeyring.addFromUri(alithPrivateKey, undefined, 'ethereum'); - const baltatharAccount = moonbeamKeyring.addFromUri(baltatharPrivateKey, undefined, 'ethereum'); - const dorothyAccount = moonbeamKeyring.addFromUri(dorothyPrivateKey, undefined, 'ethereum'); - const councilVotingThreshold = 2; const technicalCommitteeThreshold = 2; const votingPeriod = 3; @@ -388,18 +375,20 @@ describe.only('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { let balanceGlmrTokenFinal: bigint; before(async () => { - await usingPlaygrounds(async (_helper, privateKey) => { - const keyringEth = new Keyring({type: 'ethereum'}); - const keyringSr25519 = new Keyring({type: 'sr25519'}); - - uniqueAlice = privateKey('//Alice'); - randomAccountUnique = generateKeyringPair(keyringSr25519); - randomAccountMoonbeam = generateKeyringPair(keyringEth); + await usingPlaygrounds(async (helper, privateKey) => { + uniqueDonor = privateKey('//Alice'); + [randomAccountUnique] = await helper.arrange.createAccounts([0n], uniqueDonor); balanceForeignUnqTokenInit = 0n; }); await usingMoonbeamPlaygrounds(moonbeamUrl, async (helper) => { + const alithAccount = helper.account.alithAccount(); + const baltatharAccount = helper.account.baltatharAccount(); + const dorothyAccount = helper.account.dorothyAccount(); + + randomAccountMoonbeam = helper.account.create(); + // >>> Sponsoring Dorothy >>> console.log('Sponsoring Dorothy.......'); await helper.balance.transferToEthereum(alithAccount, dorothyAccount.address, 11_000_000_000_000_000_000n); @@ -502,7 +491,7 @@ describe.only('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { }); await usingPlaygrounds(async (helper) => { - await helper.balance.transferToSubstrate(uniqueAlice, randomAccountUnique.address, 10n * TRANSFER_AMOUNT); + await helper.balance.transferToSubstrate(uniqueDonor, randomAccountUnique.address, 10n * TRANSFER_AMOUNT); balanceUniqueTokenInit = await helper.balance.getSubstrate(randomAccountUnique.address); }); }); @@ -531,7 +520,7 @@ describe.only('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { expect(balanceUniqueTokenMiddle < balanceUniqueTokenInit).to.be.true; const transactionFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT; - console.log('[Unique -> Moonbeam] transaction fees on Unique: %s UNQ', bigIntToDecimals(transactionFees)); + console.log('[Unique -> Moonbeam] transaction fees on Unique: %s UNQ', helper.util.bigIntToDecimals(transactionFees)); expect(transactionFees > 0).to.be.true; await usingMoonbeamPlaygrounds(moonbeamUrl, async (helper) => { @@ -540,13 +529,13 @@ describe.only('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { balanceGlmrTokenMiddle = await helper.balance.getEthereum(randomAccountMoonbeam.address); const glmrFees = balanceGlmrTokenInit - balanceGlmrTokenMiddle; - console.log('[Unique -> Moonbeam] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees)); + console.log('[Unique -> Moonbeam] transaction fees on Moonbeam: %s GLMR', helper.util.bigIntToDecimals(glmrFees)); expect(glmrFees == 0n).to.be.true; balanceForeignUnqTokenMiddle = (await helper.assets.account(assetId, randomAccountMoonbeam.address))!; const unqIncomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenInit; - console.log('[Unique -> Moonbeam] income %s UNQ', bigIntToDecimals(unqIncomeTransfer)); + console.log('[Unique -> Moonbeam] income %s UNQ', helper.util.bigIntToDecimals(unqIncomeTransfer)); expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true; }); }); @@ -586,7 +575,7 @@ describe.only('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { balanceGlmrTokenFinal = await helper.balance.getEthereum(randomAccountMoonbeam.address); const glmrFees = balanceGlmrTokenMiddle - balanceGlmrTokenFinal; - console.log('[Moonbeam -> Unique] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees)); + console.log('[Moonbeam -> Unique] transaction fees on Moonbeam: %s GLMR', helper.util.bigIntToDecimals(glmrFees)); expect(glmrFees > 0).to.be.true; const unqRandomAccountAsset = await helper.assets.account(assetId, randomAccountMoonbeam.address); @@ -596,7 +585,7 @@ describe.only('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { balanceForeignUnqTokenFinal = 0n; const unqOutcomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenFinal; - console.log('[Unique -> Moonbeam] outcome %s UNQ', bigIntToDecimals(unqOutcomeTransfer)); + console.log('[Unique -> Moonbeam] outcome %s UNQ', helper.util.bigIntToDecimals(unqOutcomeTransfer)); expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true; }); @@ -606,10 +595,10 @@ describe.only('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle; expect(actuallyDelivered > 0).to.be.true; - console.log('[Moonbeam -> Unique] actually delivered %s UNQ', bigIntToDecimals(actuallyDelivered)); + console.log('[Moonbeam -> Unique] actually delivered %s UNQ', helper.util.bigIntToDecimals(actuallyDelivered)); const unqFees = TRANSFER_AMOUNT - actuallyDelivered; - console.log('[Moonbeam -> Unique] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees)); + console.log('[Moonbeam -> Unique] transaction fees on Unique: %s UNQ', helper.util.bigIntToDecimals(unqFees)); expect(unqFees == 0n).to.be.true; }); }); From fdd477f83a79d633df8011b3f9da03bbe18f9419 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Tue, 11 Oct 2022 13:51:42 +0000 Subject: [PATCH 1102/1274] Use yarn --- tests/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/package.json b/tests/package.json index 276eb4d7d0..03b6092481 100644 --- a/tests/package.json +++ b/tests/package.json @@ -27,7 +27,7 @@ "lint": "eslint --ext .ts,.js src/", "fix": "eslint --ext .ts,.js src/ --fix", - "test": "npm run testParallel && npm run testSequential", + "test": "yarn testParallel && yarn testSequential", "testParallel": "mocha --parallel --timeout 9999999 -r ts-node/register './src/**/*.test.ts'", "testSequential": "mocha --timeout 9999999 -r ts-node/register './src/**/*.seqtest.ts'", "testDevnode": "mocha --timeout 9999999 -r ts-node/register './src/**/*test.ts'", From 06c3c6b2e92604d3023a57dc64a52e0e8526629f Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 11 Oct 2022 14:55:32 +0000 Subject: [PATCH 1103/1274] fix: remove deprecated-helpers --- .../src/deprecated-helpers/contracthelpers.ts | 114 - tests/src/deprecated-helpers/eth/helpers.d.ts | 17 - tests/src/deprecated-helpers/eth/helpers.ts | 451 ---- tests/src/deprecated-helpers/helpers.ts | 1873 ----------------- tests/src/deprecated-helpers/util.ts | 46 - 5 files changed, 2501 deletions(-) delete mode 100644 tests/src/deprecated-helpers/contracthelpers.ts delete mode 100644 tests/src/deprecated-helpers/eth/helpers.d.ts delete mode 100644 tests/src/deprecated-helpers/eth/helpers.ts delete mode 100644 tests/src/deprecated-helpers/helpers.ts delete mode 100644 tests/src/deprecated-helpers/util.ts diff --git a/tests/src/deprecated-helpers/contracthelpers.ts b/tests/src/deprecated-helpers/contracthelpers.ts deleted file mode 100644 index c4f5eb0c53..0000000000 --- a/tests/src/deprecated-helpers/contracthelpers.ts +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {submitTransactionAsync, submitTransactionExpectFailAsync} from '../substrate/substrate-api'; -import fs from 'fs'; -import {Abi, CodePromise, ContractPromise as Contract} from '@polkadot/api-contract'; -import {IKeyringPair} from '@polkadot/types/types'; -import {ApiPromise} from '@polkadot/api'; - -chai.use(chaiAsPromised); -const expect = chai.expect; -import {findUnusedAddress, getGenericResult} from './helpers'; - -const value = 0; -const gasLimit = '200000000000'; -const endowment = '100000000000000000'; - -/* eslint no-async-promise-executor: "off" */ -function deployContract(alice: IKeyringPair, code: CodePromise, constructor = 'default', ...args: any[]): Promise { - return new Promise(async (resolve) => { - const unsub = await (code as any) - .tx[constructor]({value: endowment, gasLimit}, ...args) - .signAndSend(alice, (result: any) => { - if (result.status.isInBlock || result.status.isFinalized) { - // here we have an additional field in the result, containing the blueprint - resolve((result as any).contract); - unsub(); - } - }); - }); -} - -async function prepareDeployer(api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair) { - // Find unused address - const deployer = await findUnusedAddress(api, privateKeyWrapper); - - // Transfer balance to it - const alice = privateKeyWrapper('//Alice'); - const amount = BigInt(endowment) + 10n**15n; - const tx = api.tx.balances.transfer(deployer.address, amount); - await submitTransactionAsync(alice, tx); - - return deployer; -} - -export async function deployFlipper(api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair): Promise<[Contract, IKeyringPair]> { - const metadata = JSON.parse(fs.readFileSync('./src/flipper/metadata.json').toString('utf-8')); - const abi = new Abi(metadata); - - const deployer = await prepareDeployer(api, privateKeyWrapper); - - const wasm = fs.readFileSync('./src/flipper/flipper.wasm'); - - const code = new CodePromise(api, abi, wasm); - - const contract = (await deployContract(deployer, code, 'new', true)) as Contract; - - const initialGetResponse = await getFlipValue(contract, deployer); - expect(initialGetResponse).to.be.true; - - return [contract, deployer]; -} - -export async function getFlipValue(contract: Contract, deployer: IKeyringPair) { - const result = await contract.query.get(deployer.address, {value, gasLimit}); - - if(!result.result.isOk) { - throw 'Failed to get flipper value'; - } - return (result.result.asOk.data[0] == 0x00) ? false : true; -} - -export async function toggleFlipValueExpectSuccess(sender: IKeyringPair, contract: Contract) { - const tx = contract.tx.flip({value, gasLimit}); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - - expect(result.success).to.be.true; -} - -export async function toggleFlipValueExpectFailure(sender: IKeyringPair, contract: Contract) { - const tx = contract.tx.flip({value, gasLimit}); - await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; -} - -export async function deployTransferContract(api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair): Promise<[Contract, IKeyringPair]> { - const metadata = JSON.parse(fs.readFileSync('./src/transfer_contract/metadata.json').toString('utf-8')); - const abi = new Abi(metadata); - - const deployer = await prepareDeployer(api, privateKeyWrapper); - - const wasm = fs.readFileSync('./src/transfer_contract/nft_transfer.wasm'); - - const code = new CodePromise(api, abi, wasm); - - const contract = await deployContract(deployer, code); - - return [contract, deployer]; -} diff --git a/tests/src/deprecated-helpers/eth/helpers.d.ts b/tests/src/deprecated-helpers/eth/helpers.d.ts deleted file mode 100644 index c5f9582541..0000000000 --- a/tests/src/deprecated-helpers/eth/helpers.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -declare module 'solc'; \ No newline at end of file diff --git a/tests/src/deprecated-helpers/eth/helpers.ts b/tests/src/deprecated-helpers/eth/helpers.ts deleted file mode 100644 index b59eca8c16..0000000000 --- a/tests/src/deprecated-helpers/eth/helpers.ts +++ /dev/null @@ -1,451 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -// eslint-disable-next-line @typescript-eslint/triple-slash-reference -/// - -import {ApiPromise} from '@polkadot/api'; -import {IKeyringPair} from '@polkadot/types/types'; -import {addressToEvm, evmToAddress} from '@polkadot/util-crypto'; -import {expect} from 'chai'; -import * as solc from 'solc'; -import Web3 from 'web3'; -import config from '../../config'; -import getBalance from '../../substrate/get-balance'; -import usingApi, {submitTransactionAsync} from '../../substrate/substrate-api'; -import waitNewBlocks from '../../substrate/wait-new-blocks'; -import {CollectionMode, CrossAccountId, getDetailedCollectionInfo, getGenericResult, UNIQUE} from '../helpers'; -import collectionHelpersAbi from '../../eth/collectionHelpersAbi.json'; -import fungibleAbi from '../../eth/fungibleAbi.json'; -import nonFungibleAbi from '../../eth/nonFungibleAbi.json'; -import refungibleAbi from '../../eth/reFungibleAbi.json'; -import refungibleTokenAbi from '../../eth/reFungibleTokenAbi.json'; -import contractHelpersAbi from '../../eth/util/contractHelpersAbi.json'; - -export const GAS_ARGS = {gas: 2500000}; - -export enum SponsoringMode { - Disabled = 0, - Allowlisted = 1, - Generous = 2, -} - -let web3Connected = false; -export async function usingWeb3(cb: (web3: Web3) => Promise | T): Promise { - if (web3Connected) throw new Error('do not nest usingWeb3 calls'); - web3Connected = true; - - const provider = new Web3.providers.WebsocketProvider(config.substrateUrl); - const web3 = new Web3(provider); - - try { - return await cb(web3); - } finally { - // provider.disconnect(3000, 'normal disconnect'); - provider.connection.close(); - web3Connected = false; - } -} - -function encodeIntBE(v: number): number[] { - if (v >= 0xffffffff || v < 0) throw new Error('id overflow'); - return [ - v >> 24, - (v >> 16) & 0xff, - (v >> 8) & 0xff, - v & 0xff, - ]; -} - -export async function getCollectionAddressFromResult(api: ApiPromise, result: any) { - const collectionIdAddress = normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); - const collectionId = collectionIdFromAddress(collectionIdAddress); - const collection = (await getDetailedCollectionInfo(api, collectionId))!; - return {collectionIdAddress, collectionId, collection}; -} - -export function collectionIdToAddress(collection: number): string { - const buf = Buffer.from([0x17, 0xc4, 0xe6, 0x45, 0x3c, 0xc4, 0x9a, 0xaa, 0xae, 0xac, 0xa8, 0x94, 0xe6, 0xd9, 0x68, 0x3e, - ...encodeIntBE(collection), - ]); - return Web3.utils.toChecksumAddress('0x' + buf.toString('hex')); -} -export function collectionIdFromAddress(address: string): number { - if (!address.startsWith('0x')) - throw 'address not starts with "0x"'; - if (address.length > 42) - throw 'address length is more than 20 bytes'; - return Number('0x' + address.substring(address.length - 8)); -} - -export function normalizeAddress(address: string): string { - return '0x' + address.substring(address.length - 40); -} - -export function tokenIdToAddress(collection: number, token: number): string { - const buf = Buffer.from([0xf8, 0x23, 0x8c, 0xcf, 0xff, 0x8e, 0xd8, 0x87, 0x46, 0x3f, 0xd5, 0xe0, - ...encodeIntBE(collection), - ...encodeIntBE(token), - ]); - return Web3.utils.toChecksumAddress('0x' + buf.toString('hex')); -} - -export function tokenIdFromAddress(address: string) { - if (!address.startsWith('0x')) - throw 'address not starts with "0x"'; - if (address.length > 42) - throw 'address length is more than 20 bytes'; - return { - collectionId: Number('0x' + address.substring(address.length - 16, address.length - 8)), - tokenId: Number('0x' + address.substring(address.length - 8)), - }; -} - -export function tokenIdToCross(collection: number, token: number): CrossAccountId { - return { - Ethereum: tokenIdToAddress(collection, token), - }; -} - -export function createEthAccount(web3: Web3) { - const account = web3.eth.accounts.create(); - web3.eth.accounts.wallet.add(account.privateKey); - return account.address; -} - -export async function createEthAccountWithBalance(api: ApiPromise, web3: Web3, privateKeyWrapper: (account: string) => IKeyringPair) { - const alice = privateKeyWrapper('//Alice'); - const account = createEthAccount(web3); - await transferBalanceToEth(api, alice, account); - - return account; -} - -export async function transferBalanceToEth(api: ApiPromise, source: IKeyringPair, target: string, amount = 1000n * UNIQUE) { - const tx = api.tx.balances.transfer(evmToAddress(target), amount); - const events = await submitTransactionAsync(source, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; -} - -export async function createRFTCollection(api: ApiPromise, web3: Web3, owner: string) { - const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createRFTCollection('A', 'B', 'C') - .send({value: Number(2n * UNIQUE)}); - return await getCollectionAddressFromResult(api, result); -} - - -export async function createNonfungibleCollection(api: ApiPromise, web3: Web3, owner: string) { - const collectionHelper = evmCollectionHelpers(web3, owner); - const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') - .send({value: Number(2n * UNIQUE)}); - return await getCollectionAddressFromResult(api, result); -} - -export function uniqueNFT(web3: Web3, address: string, owner: string) { - return new web3.eth.Contract(nonFungibleAbi as any, address, { - from: owner, - ...GAS_ARGS, - }); -} - -export function uniqueRefungible(web3: Web3, collectionAddress: string, owner: string) { - return new web3.eth.Contract(refungibleAbi as any, collectionAddress, { - from: owner, - ...GAS_ARGS, - }); -} - -export function uniqueRefungibleToken(web3: Web3, tokenAddress: string, owner: string | undefined = undefined) { - return new web3.eth.Contract(refungibleTokenAbi as any, tokenAddress, { - from: owner, - ...GAS_ARGS, - }); -} - -export async function itWeb3(name: string, cb: (apis: { web3: Web3, api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean } = {}) { - let i: any = it; - if (opts.only) i = i.only; - else if (opts.skip) i = i.skip; - i(name, async () => { - await usingApi(async (api, privateKeyWrapper) => { - await usingWeb3(async web3 => { - await cb({api, web3, privateKeyWrapper}); - }); - }); - }); -} -itWeb3.only = (name: string, cb: (apis: { web3: Web3, api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itWeb3(name, cb, {only: true}); -itWeb3.skip = (name: string, cb: (apis: { web3: Web3, api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itWeb3(name, cb, {skip: true}); - -export async function generateSubstrateEthPair(web3: Web3) { - const account = web3.eth.accounts.create(); - evmToAddress(account.address); -} - -type NormalizedEvent = { - address: string, - event: string, - args: { [key: string]: string } -}; - -export function normalizeEvents(events: any): NormalizedEvent[] { - const output = []; - for (const key of Object.keys(events)) { - if (key.match(/^[0-9]+$/)) { - output.push(events[key]); - } else if (Array.isArray(events[key])) { - output.push(...events[key]); - } else { - output.push(events[key]); - } - } - output.sort((a, b) => a.logIndex - b.logIndex); - return output.map(({address, event, returnValues}) => { - const args: { [key: string]: string } = {}; - for (const key of Object.keys(returnValues)) { - if (!key.match(/^[0-9]+$/)) { - args[key] = returnValues[key]; - } - } - return { - address, - event, - args, - }; - }); -} - -export async function recordEvents(contract: any, action: () => Promise): Promise { - const out: any = []; - contract.events.allEvents((_: any, event: any) => { - out.push(event); - }); - await action(); - return normalizeEvents(out); -} - -export function subToEthLowercase(eth: string): string { - const bytes = addressToEvm(eth); - return '0x' + Buffer.from(bytes).toString('hex'); -} - -export function subToEth(eth: string): string { - return Web3.utils.toChecksumAddress(subToEthLowercase(eth)); -} - -export interface CompiledContract { - abi: any, - object: string, -} - -export function compileContract(name: string, src: string) : CompiledContract { - const out = JSON.parse(solc.compile(JSON.stringify({ - language: 'Solidity', - sources: { - [`${name}.sol`]: { - content: ` - // SPDX-License-Identifier: UNLICENSED - pragma solidity ^0.8.6; - - ${src} - `, - }, - }, - settings: { - outputSelection: { - '*': { - '*': ['*'], - }, - }, - }, - }))).contracts[`${name}.sol`][name]; - - return { - abi: out.abi, - object: '0x' + out.evm.bytecode.object, - }; -} - -export async function deployFlipper(web3: Web3, deployer: string) { - const compiled = compileContract('Flipper', ` - contract Flipper { - bool value = false; - function flip() public { - value = !value; - } - function getValue() public view returns (bool) { - return value; - } - } - `); - const flipperContract = new web3.eth.Contract(compiled.abi, undefined, { - data: compiled.object, - from: deployer, - ...GAS_ARGS, - }); - const flipper = await flipperContract.deploy({data: compiled.object}).send({from: deployer}); - - return flipper; -} - -export async function deployCollector(web3: Web3, deployer: string) { - const compiled = compileContract('Collector', ` - contract Collector { - uint256 collected; - fallback() external payable { - giveMoney(); - } - function giveMoney() public payable { - collected += msg.value; - } - function getCollected() public view returns (uint256) { - return collected; - } - function getUnaccounted() public view returns (uint256) { - return address(this).balance - collected; - } - - function withdraw(address payable target) public { - target.transfer(collected); - collected = 0; - } - } - `); - const collectorContract = new web3.eth.Contract(compiled.abi, undefined, { - data: compiled.object, - from: deployer, - ...GAS_ARGS, - }); - const collector = await collectorContract.deploy({data: compiled.object}).send({from: deployer}); - - return collector; -} - -/** - * pallet evm_contract_helpers - * @param web3 - * @param caller - eth address - * @returns - */ -export function contractHelpers(web3: Web3, caller: string) { - return new web3.eth.Contract(contractHelpersAbi as any, '0x842899ECF380553E8a4de75bF534cdf6fBF64049', {from: caller, ...GAS_ARGS}); -} - -/** - * evm collection helper - * @param web3 - * @param caller - eth address - * @returns - */ -export function evmCollectionHelpers(web3: Web3, caller: string) { - return new web3.eth.Contract(collectionHelpersAbi as any, '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f', {from: caller, ...GAS_ARGS}); -} - -/** - * evm collection - * @param web3 - * @param caller - eth address - * @returns - */ -export function evmCollection(web3: Web3, caller: string, collection: string, mode: CollectionMode = {type: 'NFT'}) { - let abi; - switch (mode.type) { - case 'Fungible': - abi = fungibleAbi; - break; - - case 'NFT': - abi = nonFungibleAbi; - break; - - case 'ReFungible': - abi = refungibleAbi; - break; - - default: - throw 'Bad collection mode'; - } - const contract = new web3.eth.Contract(abi as any, collection, {from: caller, ...GAS_ARGS}); - return contract; -} - -/** - * Execute ethereum method call using substrate account - * @param to target contract - * @param mkTx - closure, receiving `contract.methods`, and returning method call, - * to be used as following (assuming `to` = erc20 contract): - * `m => m.transfer(to, amount)` - * - * # Example - * ```ts - * executeEthTxOnSub(api, alice, erc20Contract, m => m.transfer(target, amount)); - * ``` - */ -export async function executeEthTxOnSub(web3: Web3, api: ApiPromise, from: IKeyringPair, to: any, mkTx: (methods: any) => any, {value = 0}: {value?: bigint | number} = { }) { - const tx = api.tx.evm.call( - subToEth(from.address), - to.options.address, - mkTx(to.methods).encodeABI(), - value, - GAS_ARGS.gas, - await web3.eth.getGasPrice(), - null, - null, - [], - ); - const events = await submitTransactionAsync(from, tx); - expect(events.some(({event: {section, method}}) => section == 'evm' && method == 'Executed')).to.be.true; -} - -export async function ethBalanceViaSub(api: ApiPromise, address: string): Promise { - return (await getBalance(api, [evmToAddress(address)]))[0]; -} - -/** - * Measure how much gas given closure consumes - * - * @param user which user balance will be checked - */ -export async function recordEthFee(api: ApiPromise, user: string, call: () => Promise): Promise { - const before = await ethBalanceViaSub(api, user); - - await call(); - - // In dev mode, the transaction might not finish processing in time - await waitNewBlocks(api, 1); - const after = await ethBalanceViaSub(api, user); - - // Can't use .to.be.less, because chai doesn't supports bigint - expect(after < before).to.be.true; - - return before - after; -} - -type ElementOf = A extends readonly (infer T)[] ? T : never; -// I want a fancier api, not a memory efficiency -export function* cartesian>, R extends Array>(internalRest: [...R], ...args: [...T]): Generator<[...R, ...{[K in keyof T]: ElementOf}]> { - if(args.length === 0) { - yield internalRest as any; - return; - } - for(const value of args[0]) { - yield* cartesian([...internalRest, value], ...args.slice(1)) as any; - } -} \ No newline at end of file diff --git a/tests/src/deprecated-helpers/helpers.ts b/tests/src/deprecated-helpers/helpers.ts deleted file mode 100644 index 0236de50d1..0000000000 --- a/tests/src/deprecated-helpers/helpers.ts +++ /dev/null @@ -1,1873 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -import '../interfaces/augment-api-rpc'; -import '../interfaces/augment-api-query'; -import {ApiPromise, Keyring} from '@polkadot/api'; -import type {AccountId, EventRecord, Event, BlockNumber} from '@polkadot/types/interfaces'; -import type {GenericEventData} from '@polkadot/types'; -import {AnyTuple, IEvent, IKeyringPair} from '@polkadot/types/types'; -import {evmToAddress} from '@polkadot/util-crypto'; -import {AnyNumber} from '@polkadot/types-codec/types'; -import BN from 'bn.js'; -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -import {default as usingApi, executeTransaction, submitTransactionAsync, submitTransactionExpectFailAsync} from '../substrate/substrate-api'; -import {hexToStr, strToUTF16, utf16ToStr} from './util'; -import {UpDataStructsRpcCollection, UpDataStructsCreateItemData, UpDataStructsProperty} from '@polkadot/types/lookup'; -import {UpDataStructsTokenChild} from '../interfaces'; -import {Context} from 'mocha'; - -chai.use(chaiAsPromised); -const expect = chai.expect; - -export type CrossAccountId = { - Substrate: string, -} | { - Ethereum: string, -}; - - -export enum Pallets { - Inflation = 'inflation', - RmrkCore = 'rmrkcore', - RmrkEquip = 'rmrkequip', - ReFungible = 'refungible', - Fungible = 'fungible', - NFT = 'nonfungible', - Scheduler = 'scheduler', - AppPromotion = 'apppromotion', -} - -export async function isUnique(): Promise { - return usingApi(async api => { - const chain = await api.rpc.system.chain(); - - return chain.eq('UNIQUE'); - }); -} - -export async function isQuartz(): Promise { - return usingApi(async api => { - const chain = await api.rpc.system.chain(); - - return chain.eq('QUARTZ'); - }); -} - -let modulesNames: any; -export function getModuleNames(api: ApiPromise): string[] { - if (typeof modulesNames === 'undefined') - modulesNames = api.runtimeMetadata.asLatest.pallets.map(m => m.name.toString().toLowerCase()); - return modulesNames; -} - -export async function missingRequiredPallets(requiredPallets: string[]): Promise { - return await usingApi(async api => { - const pallets = getModuleNames(api); - - return requiredPallets.filter(p => !pallets.includes(p)); - }); -} - -export async function checkPalletsPresence(requiredPallets: string[]): Promise { - return (await missingRequiredPallets(requiredPallets)).length == 0; -} - -export async function requirePallets(mocha: Context, requiredPallets: string[]) { - const missingPallets = await missingRequiredPallets(requiredPallets); - - if (missingPallets.length > 0) { - const skippingTestMsg = `\tSkipping test "${mocha.test?.title}".`; - const missingPalletsMsg = `\tThe following pallets are missing:\n\t- ${missingPallets.join('\n\t- ')}`; - const skipMsg = `${skippingTestMsg}\n${missingPalletsMsg}`; - - console.error('\x1b[38:5:208m%s\x1b[0m', skipMsg); - - mocha.skip(); - } -} - -export function bigIntToSub(api: ApiPromise, number: bigint) { - return api.registry.createType('AccountId', '0x' + number.toString(16).padStart(64, '0')).toJSON(); -} - -export function bigIntToDecimals(number: bigint, decimals = 18): string { - const numberStr = number.toString(); - const dotPos = numberStr.length - decimals; - - if (dotPos <= 0) { - return '0.' + '0'.repeat(Math.abs(dotPos)) + numberStr; - } else { - const intPart = numberStr.substring(0, dotPos); - const fractPart = numberStr.substring(dotPos); - return intPart + '.' + fractPart; - } -} - -export function normalizeAccountId(input: string | AccountId | CrossAccountId | IKeyringPair): CrossAccountId { - if (typeof input === 'string') { - if (input.length >= 47) { - return {Substrate: input}; - } else if (input.length === 42 && input.startsWith('0x')) { - return {Ethereum: input.toLowerCase()}; - } else if (input.length === 40 && !input.startsWith('0x')) { - return {Ethereum: '0x' + input.toLowerCase()}; - } else { - throw new Error(`Unknown address format: "${input}"`); - } - } - if ('address' in input) { - return {Substrate: input.address}; - } - if ('Ethereum' in input) { - return { - Ethereum: input.Ethereum.toLowerCase(), - }; - } else if ('ethereum' in input) { - return { - Ethereum: (input as any).ethereum.toLowerCase(), - }; - } else if ('Substrate' in input) { - return input; - } else if ('substrate' in input) { - return { - Substrate: (input as any).substrate, - }; - } - - // AccountId - return {Substrate: input.toString()}; -} -export function toSubstrateAddress(input: string | CrossAccountId | IKeyringPair): string { - input = normalizeAccountId(input); - if ('Substrate' in input) { - return input.Substrate; - } else { - return evmToAddress(input.Ethereum); - } -} - -export const U128_MAX = (1n << 128n) - 1n; - -const MICROUNIQUE = 1_000_000_000_000n; -const MILLIUNIQUE = 1_000n * MICROUNIQUE; -const CENTIUNIQUE = 10n * MILLIUNIQUE; -export const UNIQUE = 100n * CENTIUNIQUE; - -interface GenericResult { - success: boolean; - data: T | null; -} - -interface CreateCollectionResult { - success: boolean; - collectionId: number; -} - -interface CreateItemResult { - success: boolean; - collectionId: number; - itemId: number; - recipient?: CrossAccountId; - amount?: number; -} - -interface DestroyItemResult { - success: boolean; - collectionId: number; - itemId: number; - owner: CrossAccountId; - amount: number; -} - -interface TransferResult { - collectionId: number; - itemId: number; - sender?: CrossAccountId; - recipient?: CrossAccountId; - value: bigint; -} - -interface IReFungibleOwner { - fraction: BN; - owner: number[]; -} - -interface IGetMessage { - checkMsgUnqMethod: string; - checkMsgTrsMethod: string; - checkMsgSysMethod: string; -} - -export interface IFungibleTokenDataType { - value: number; -} - -export interface IChainLimits { - collectionNumbersLimit: number; - accountTokenOwnershipLimit: number; - collectionsAdminsLimit: number; - customDataLimit: number; - nftSponsorTransferTimeout: number; - fungibleSponsorTransferTimeout: number; - refungibleSponsorTransferTimeout: number; - //offchainSchemaLimit: number; - //constOnChainSchemaLimit: number; -} - -export interface IReFungibleTokenDataType { - owner: IReFungibleOwner[]; -} - -export function uniqueEventMessage(events: EventRecord[]): IGetMessage { - let checkMsgUnqMethod = ''; - let checkMsgTrsMethod = ''; - let checkMsgSysMethod = ''; - events.forEach(({event: {method, section}}) => { - if (section === 'common') { - checkMsgUnqMethod = method; - } else if (section === 'treasury') { - checkMsgTrsMethod = method; - } else if (section === 'system') { - checkMsgSysMethod = method; - } else { return null; } - }); - const result: IGetMessage = { - checkMsgUnqMethod, - checkMsgTrsMethod, - checkMsgSysMethod, - }; - return result; -} - -export function getEvent(events: EventRecord[], check: (event: IEvent) => event is T): T | undefined { - const event = events.find(r => check(r.event)); - if (!event) return; - return event.event as T; -} - -export function getGenericResult(events: EventRecord[]): GenericResult; -export function getGenericResult( - events: EventRecord[], - expectSection: string, - expectMethod: string, - extractAction: (data: GenericEventData) => T -): GenericResult; - -export function getGenericResult( - events: EventRecord[], - expectSection?: string, - expectMethod?: string, - extractAction?: (data: GenericEventData) => T, -): GenericResult { - let success = false; - let successData = null; - - events.forEach(({event: {data, method, section}}) => { - // console.log(` ${phase}: ${section}.${method}:: ${data}`); - if (method === 'ExtrinsicSuccess') { - success = true; - } else if ((expectSection == section) && (expectMethod == method)) { - successData = extractAction!(data as any); - } - }); - - const result: GenericResult = { - success, - data: successData, - }; - return result; -} - -export function getCreateCollectionResult(events: EventRecord[]): CreateCollectionResult { - const genericResult = getGenericResult(events, 'common', 'CollectionCreated', (data) => parseInt(data[0].toString(), 10)); - const result: CreateCollectionResult = { - success: genericResult.success, - collectionId: genericResult.data ?? 0, - }; - return result; -} - -export function getCreateItemsResult(events: EventRecord[]): CreateItemResult[] { - const results: CreateItemResult[] = []; - - const genericResult = getGenericResult(events, 'common', 'ItemCreated', (data) => { - const collectionId = parseInt(data[0].toString(), 10); - const itemId = parseInt(data[1].toString(), 10); - const recipient = normalizeAccountId(data[2].toJSON() as any); - const amount = parseInt(data[3].toString(), 10); - - const itemRes: CreateItemResult = { - success: true, - collectionId, - itemId, - recipient, - amount, - }; - - results.push(itemRes); - return results; - }); - - if (!genericResult.success) return []; - return results; -} - -export function getCreateItemResult(events: EventRecord[]): CreateItemResult { - const genericResult = getGenericResult(events, 'common', 'ItemCreated', (data) => data.map(function(value) { return value.toJSON(); })); - - if (genericResult.data == null) - return { - success: genericResult.success, - collectionId: 0, - itemId: 0, - amount: 0, - }; - else - return { - success: genericResult.success, - collectionId: genericResult.data[0] as number, - itemId: genericResult.data[1] as number, - recipient: normalizeAccountId(genericResult.data![2] as any), - amount: genericResult.data[3] as number, - }; -} - -export function getDestroyItemsResult(events: EventRecord[]): DestroyItemResult[] { - const results: DestroyItemResult[] = []; - - const genericResult = getGenericResult(events, 'common', 'ItemDestroyed', (data) => { - const collectionId = parseInt(data[0].toString(), 10); - const itemId = parseInt(data[1].toString(), 10); - const owner = normalizeAccountId(data[2].toJSON() as any); - const amount = parseInt(data[3].toString(), 10); - - const itemRes: DestroyItemResult = { - success: true, - collectionId, - itemId, - owner, - amount, - }; - - results.push(itemRes); - return results; - }); - - if (!genericResult.success) return []; - return results; -} - -export function getTransferResult(api: ApiPromise, events: EventRecord[]): TransferResult { - for (const {event} of events) { - if (api.events.common.Transfer.is(event)) { - const [collection, token, sender, recipient, value] = event.data; - return { - collectionId: collection.toNumber(), - itemId: token.toNumber(), - sender: normalizeAccountId(sender.toJSON() as any), - recipient: normalizeAccountId(recipient.toJSON() as any), - value: value.toBigInt(), - }; - } - } - throw new Error('no transfer event'); -} - -interface Nft { - type: 'NFT'; -} - -interface Fungible { - type: 'Fungible'; - decimalPoints: number; -} - -interface ReFungible { - type: 'ReFungible'; -} - -export type CollectionMode = Nft | Fungible | ReFungible; - -export type Property = { - key: any, - value: any, -}; - -type Permission = { - mutable: boolean; - collectionAdmin: boolean; - tokenOwner: boolean; -} - -type PropertyPermission = { - key: any; - permission: Permission; -} - -export type CreateCollectionParams = { - mode: CollectionMode, - name: string, - description: string, - tokenPrefix: string, - properties?: Array, - propPerm?: Array -}; - -const defaultCreateCollectionParams: CreateCollectionParams = { - description: 'description', - mode: {type: 'NFT'}, - name: 'name', - tokenPrefix: 'prefix', -}; - -export async function -createCollection( - api: ApiPromise, - sender: IKeyringPair, - params: Partial = {}, -): Promise { - const {name, description, mode, tokenPrefix} = {...defaultCreateCollectionParams, ...params}; - - let modeprm = {}; - if (mode.type === 'NFT') { - modeprm = {nft: null}; - } else if (mode.type === 'Fungible') { - modeprm = {fungible: mode.decimalPoints}; - } else if (mode.type === 'ReFungible') { - modeprm = {refungible: null}; - } - - const tx = api.tx.unique.createCollectionEx({ - name: strToUTF16(name), - description: strToUTF16(description), - tokenPrefix: strToUTF16(tokenPrefix), - mode: modeprm as any, - }); - const events = await executeTransaction(api, sender, tx); - return getCreateCollectionResult(events); -} - -export async function createCollectionExpectSuccess(params: Partial = {}): Promise { - const {name, description, mode, tokenPrefix} = {...defaultCreateCollectionParams, ...params}; - - let collectionId = 0; - await usingApi(async (api, privateKeyWrapper) => { - // Get number of collections before the transaction - const collectionCountBefore = await getCreatedCollectionCount(api); - - // Run the CreateCollection transaction - const alicePrivateKey = privateKeyWrapper('//Alice'); - - const result = await createCollection(api, alicePrivateKey, params); - - // Get number of collections after the transaction - const collectionCountAfter = await getCreatedCollectionCount(api); - - // Get the collection - const collection = await queryCollectionExpectSuccess(api, result.collectionId); - - // What to expect - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.true; - expect(result.collectionId).to.be.equal(collectionCountAfter); - // tslint:disable-next-line:no-unused-expression - expect(collection).to.be.not.null; - expect(collectionCountAfter).to.be.equal(collectionCountBefore + 1, 'Error: NFT collection NOT created.'); - expect(collection.owner.toString()).to.be.equal(toSubstrateAddress(alicePrivateKey)); - expect(utf16ToStr(collection.name.toJSON() as any)).to.be.equal(name); - expect(utf16ToStr(collection.description.toJSON() as any)).to.be.equal(description); - expect(hexToStr(collection.tokenPrefix.toJSON())).to.be.equal(tokenPrefix); - - collectionId = result.collectionId; - }); - - return collectionId; -} - -export async function createCollectionWithPropsExpectSuccess(params: Partial = {}): Promise { - const {name, description, mode, tokenPrefix} = {...defaultCreateCollectionParams, ...params}; - - let collectionId = 0; - await usingApi(async (api, privateKeyWrapper) => { - // Get number of collections before the transaction - const collectionCountBefore = await getCreatedCollectionCount(api); - - // Run the CreateCollection transaction - const alicePrivateKey = privateKeyWrapper('//Alice'); - - let modeprm = {}; - if (mode.type === 'NFT') { - modeprm = {nft: null}; - } else if (mode.type === 'Fungible') { - modeprm = {fungible: mode.decimalPoints}; - } else if (mode.type === 'ReFungible') { - modeprm = {refungible: null}; - } - - const tx = api.tx.unique.createCollectionEx({name: strToUTF16(name), description: strToUTF16(description), tokenPrefix: strToUTF16(tokenPrefix), mode: modeprm as any, properties: params.properties, tokenPropertyPermissions: params.propPerm}); - const events = await submitTransactionAsync(alicePrivateKey, tx); - const result = getCreateCollectionResult(events); - - // Get number of collections after the transaction - const collectionCountAfter = await getCreatedCollectionCount(api); - - // Get the collection - const collection = await queryCollectionExpectSuccess(api, result.collectionId); - - // What to expect - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.true; - expect(result.collectionId).to.be.equal(collectionCountAfter); - // tslint:disable-next-line:no-unused-expression - expect(collection).to.be.not.null; - expect(collectionCountAfter).to.be.equal(collectionCountBefore + 1, 'Error: NFT collection NOT created.'); - expect(collection.owner.toString()).to.be.equal(toSubstrateAddress(alicePrivateKey)); - expect(utf16ToStr(collection.name.toJSON() as any)).to.be.equal(name); - expect(utf16ToStr(collection.description.toJSON() as any)).to.be.equal(description); - expect(hexToStr(collection.tokenPrefix.toJSON())).to.be.equal(tokenPrefix); - - - collectionId = result.collectionId; - }); - - return collectionId; -} - -export async function createCollectionWithPropsExpectFailure(params: Partial = {}) { - const {name, description, mode, tokenPrefix} = {...defaultCreateCollectionParams, ...params}; - - await usingApi(async (api, privateKeyWrapper) => { - // Get number of collections before the transaction - const collectionCountBefore = await getCreatedCollectionCount(api); - - // Run the CreateCollection transaction - const alicePrivateKey = privateKeyWrapper('//Alice'); - - let modeprm = {}; - if (mode.type === 'NFT') { - modeprm = {nft: null}; - } else if (mode.type === 'Fungible') { - modeprm = {fungible: mode.decimalPoints}; - } else if (mode.type === 'ReFungible') { - modeprm = {refungible: null}; - } - - const tx = api.tx.unique.createCollectionEx({name: strToUTF16(name), description: strToUTF16(description), tokenPrefix: strToUTF16(tokenPrefix), mode: modeprm as any, properties: params.properties, tokenPropertyPermissions: params.propPerm}); - await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected; - - - // Get number of collections after the transaction - const collectionCountAfter = await getCreatedCollectionCount(api); - - expect(collectionCountAfter).to.be.equal(collectionCountBefore, 'Error: Collection with incorrect data created.'); - }); -} - -export async function createCollectionExpectFailure(params: Partial = {}) { - const {name, description, mode, tokenPrefix} = {...defaultCreateCollectionParams, ...params}; - - let modeprm = {}; - if (mode.type === 'NFT') { - modeprm = {nft: null}; - } else if (mode.type === 'Fungible') { - modeprm = {fungible: mode.decimalPoints}; - } else if (mode.type === 'ReFungible') { - modeprm = {refungible: null}; - } - - await usingApi(async (api, privateKeyWrapper) => { - // Get number of collections before the transaction - const collectionCountBefore = await getCreatedCollectionCount(api); - - // Run the CreateCollection transaction - const alicePrivateKey = privateKeyWrapper('//Alice'); - const tx = api.tx.unique.createCollectionEx({name: strToUTF16(name), description: strToUTF16(description), tokenPrefix: strToUTF16(tokenPrefix), mode: modeprm as any}); - await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected; - - // Get number of collections after the transaction - const collectionCountAfter = await getCreatedCollectionCount(api); - - // What to expect - expect(collectionCountAfter).to.be.equal(collectionCountBefore, 'Error: Collection with incorrect data created.'); - }); -} - -export async function findUnusedAddress(api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair, seedAddition = ''): Promise { - let bal = 0n; - let unused; - do { - const randomSeed = 'seed' + Math.floor(Math.random() * Math.floor(10000)) + seedAddition; - unused = privateKeyWrapper(`//${randomSeed}`); - bal = (await api.query.system.account(unused.address)).data.free.toBigInt(); - } while (bal !== 0n); - return unused; -} - -export async function getAllowance(api: ApiPromise, collectionId: number, owner: CrossAccountId | string | IKeyringPair, approved: CrossAccountId | string | IKeyringPair, tokenId: number) { - return (await api.rpc.unique.allowance(collectionId, normalizeAccountId(owner), normalizeAccountId(approved), tokenId)).toBigInt(); -} - -export function findUnusedAddresses(api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair, amount: number): Promise { - return Promise.all(new Array(amount).fill(null).map(() => findUnusedAddress(api, privateKeyWrapper, '_' + Date.now()))); -} - -export async function findNotExistingCollection(api: ApiPromise): Promise { - const totalNumber = await getCreatedCollectionCount(api); - const newCollection: number = totalNumber + 1; - return newCollection; -} - -function getDestroyResult(events: EventRecord[]): boolean { - let success = false; - events.forEach(({event: {method}}) => { - if (method == 'ExtrinsicSuccess') { - success = true; - } - }); - return success; -} - -export async function destroyCollectionExpectFailure(collectionId: number, senderSeed = '//Alice') { - await usingApi(async (api, privateKeyWrapper) => { - // Run the DestroyCollection transaction - const alicePrivateKey = privateKeyWrapper(senderSeed); - const tx = api.tx.unique.destroyCollection(collectionId); - await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected; - }); -} - -export async function destroyCollectionExpectSuccess(collectionId: number, senderSeed = '//Alice') { - await usingApi(async (api, privateKeyWrapper) => { - // Run the DestroyCollection transaction - const alicePrivateKey = privateKeyWrapper(senderSeed); - const tx = api.tx.unique.destroyCollection(collectionId); - const events = await submitTransactionAsync(alicePrivateKey, tx); - const result = getDestroyResult(events); - expect(result).to.be.true; - - // What to expect - expect(await getDetailedCollectionInfo(api, collectionId)).to.be.null; - }); -} - -export async function setCollectionLimitsExpectSuccess(sender: IKeyringPair, collectionId: number, limits: any) { - await usingApi(async (api) => { - const tx = api.tx.unique.setCollectionLimits(collectionId, limits); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - - expect(result.success).to.be.true; - }); -} - -export const setCollectionPermissionsExpectSuccess = async (sender: IKeyringPair, collectionId: number, permissions: any) => { - await usingApi(async(api) => { - const tx = api.tx.unique.setCollectionPermissions(collectionId, permissions); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - - expect(result.success).to.be.true; - }); -}; - -export async function setCollectionLimitsExpectFailure(sender: IKeyringPair, collectionId: number, limits: any) { - await usingApi(async (api) => { - const tx = api.tx.unique.setCollectionLimits(collectionId, limits); - const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; - const result = getGenericResult(events); - - expect(result.success).to.be.false; - }); -} - -export async function setCollectionSponsorExpectSuccess(collectionId: number, sponsor: string, sender = '//Alice') { - await usingApi(async (api, privateKeyWrapper) => { - - // Run the transaction - const senderPrivateKey = privateKeyWrapper(sender); - const tx = api.tx.unique.setCollectionSponsor(collectionId, sponsor); - const events = await submitTransactionAsync(senderPrivateKey, tx); - const result = getGenericResult(events); - - // Get the collection - const collection = await queryCollectionExpectSuccess(api, collectionId); - - // What to expect - expect(result.success).to.be.true; - expect(collection.sponsorship.toJSON()).to.deep.equal({ - unconfirmed: sponsor, - }); - }); -} - -export async function removeCollectionSponsorExpectSuccess(collectionId: number, sender = '//Alice') { - await usingApi(async (api, privateKeyWrapper) => { - - // Run the transaction - const alicePrivateKey = privateKeyWrapper(sender); - const tx = api.tx.unique.removeCollectionSponsor(collectionId); - const events = await submitTransactionAsync(alicePrivateKey, tx); - const result = getGenericResult(events); - - // Get the collection - const collection = await queryCollectionExpectSuccess(api, collectionId); - - // What to expect - expect(result.success).to.be.true; - expect(collection.sponsorship.toJSON()).to.be.deep.equal({disabled: null}); - }); -} - -export async function removeCollectionSponsorExpectFailure(collectionId: number, senderSeed = '//Alice') { - await usingApi(async (api, privateKeyWrapper) => { - - // Run the transaction - const alicePrivateKey = privateKeyWrapper(senderSeed); - const tx = api.tx.unique.removeCollectionSponsor(collectionId); - await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected; - }); -} - -export async function setCollectionSponsorExpectFailure(collectionId: number, sponsor: string, senderSeed = '//Alice') { - await usingApi(async (api, privateKeyWrapper) => { - - // Run the transaction - const alicePrivateKey = privateKeyWrapper(senderSeed); - const tx = api.tx.unique.setCollectionSponsor(collectionId, sponsor); - await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected; - }); -} - -export async function confirmSponsorshipExpectSuccess(collectionId: number, senderSeed = '//Alice') { - await usingApi(async (api, privateKeyWrapper) => { - - // Run the transaction - const sender = privateKeyWrapper(senderSeed); - await confirmSponsorshipByKeyExpectSuccess(collectionId, sender); - }); -} - -export async function confirmSponsorshipByKeyExpectSuccess(collectionId: number, sender: IKeyringPair) { - await usingApi(async (api, privateKeyWrapper) => { - - // Run the transaction - const tx = api.tx.unique.confirmSponsorship(collectionId); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - - // Get the collection - const collection = await queryCollectionExpectSuccess(api, collectionId); - - // What to expect - expect(result.success).to.be.true; - expect(collection.sponsorship.toJSON()).to.be.deep.equal({ - confirmed: sender.address, - }); - }); -} - - -export async function confirmSponsorshipExpectFailure(collectionId: number, senderSeed = '//Alice') { - await usingApi(async (api, privateKeyWrapper) => { - - // Run the transaction - const sender = privateKeyWrapper(senderSeed); - const tx = api.tx.unique.confirmSponsorship(collectionId); - await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; - }); -} - -export async function enableContractSponsoringExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, enable: boolean) { - await usingApi(async (api) => { - const tx = api.tx.unique.enableContractSponsoring(contractAddress, enable); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - - expect(result.success).to.be.true; - }); -} - -export async function enableContractSponsoringExpectFailure(sender: IKeyringPair, contractAddress: AccountId | string, enable: boolean) { - await usingApi(async (api) => { - const tx = api.tx.unique.enableContractSponsoring(contractAddress, enable); - const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; - const result = getGenericResult(events); - - expect(result.success).to.be.false; - }); -} - -export async function setTransferFlagExpectSuccess(sender: IKeyringPair, collectionId: number, enabled: boolean) { - - await usingApi(async (api) => { - - const tx = api.tx.unique.setTransfersEnabledFlag(collectionId, enabled); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - - expect(result.success).to.be.true; - }); -} - -export async function setTransferFlagExpectFailure(sender: IKeyringPair, collectionId: number, enabled: boolean) { - - await usingApi(async (api) => { - - const tx = api.tx.unique.setTransfersEnabledFlag(collectionId, enabled); - const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; - const result = getGenericResult(events); - - expect(result.success).to.be.false; - }); -} - -export async function setContractSponsoringRateLimitExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, rateLimit: number) { - await usingApi(async (api) => { - const tx = api.tx.unique.setContractSponsoringRateLimit(contractAddress, rateLimit); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - - expect(result.success).to.be.true; - }); -} - -export async function setContractSponsoringRateLimitExpectFailure(sender: IKeyringPair, contractAddress: AccountId | string, rateLimit: number) { - await usingApi(async (api) => { - const tx = api.tx.unique.setContractSponsoringRateLimit(contractAddress, rateLimit); - const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; - const result = getGenericResult(events); - - expect(result.success).to.be.false; - }); -} - -export async function getNextSponsored( - api: ApiPromise, - collectionId: number, - account: string | CrossAccountId, - tokenId: number, -): Promise { - return Number((await api.rpc.unique.nextSponsored(collectionId, account, tokenId)).unwrapOr(-1)); -} - -export async function toggleContractAllowlistExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, value = true) { - await usingApi(async (api) => { - const tx = api.tx.unique.toggleContractAllowList(contractAddress, value); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - - expect(result.success).to.be.true; - }); -} - -export async function isAllowlistedInContract(contractAddress: AccountId | string, user: string) { - let allowlisted = false; - await usingApi(async (api) => { - allowlisted = (await api.query.unique.contractAllowList(contractAddress, user)).toJSON() as boolean; - }); - return allowlisted; -} - -export async function addToContractAllowListExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, user: AccountId | string) { - await usingApi(async (api) => { - const tx = api.tx.unique.addToContractAllowList(contractAddress.toString(), user.toString()); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - - expect(result.success).to.be.true; - }); -} - -export async function removeFromContractAllowListExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, user: AccountId | string) { - await usingApi(async (api) => { - const tx = api.tx.unique.removeFromContractAllowList(contractAddress.toString(), user.toString()); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - - expect(result.success).to.be.true; - }); -} - -export async function removeFromContractAllowListExpectFailure(sender: IKeyringPair, contractAddress: AccountId | string, user: AccountId | string) { - await usingApi(async (api) => { - const tx = api.tx.unique.removeFromContractAllowList(contractAddress.toString(), user.toString()); - const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; - const result = getGenericResult(events); - - expect(result.success).to.be.false; - }); -} - -export interface CreateFungibleData { - readonly Value: bigint; -} - -export interface CreateReFungibleData { } -export interface CreateNftData { } - -export type CreateItemData = { - NFT: CreateNftData; -} | { - Fungible: CreateFungibleData; -} | { - ReFungible: CreateReFungibleData; -}; - -export async function burnItem(api: ApiPromise, sender: IKeyringPair, collectionId: number, tokenId: number, value: number | bigint) : Promise { - const tx = api.tx.unique.burnItem(collectionId, tokenId, value); - const events = await submitTransactionAsync(sender, tx); - return getGenericResult(events).success; -} - -export async function burnItemExpectSuccess(sender: IKeyringPair, collectionId: number, tokenId: number, value: number | bigint = 1) { - await usingApi(async (api) => { - const balanceBefore = await getBalance(api, collectionId, normalizeAccountId(sender), tokenId); - // if burning token by admin - use adminButnItemExpectSuccess - expect(balanceBefore >= BigInt(value)).to.be.true; - - expect(await burnItem(api, sender, collectionId, tokenId, value)).to.be.true; - - const balanceAfter = await getBalance(api, collectionId, normalizeAccountId(sender), tokenId); - expect(balanceAfter + BigInt(value)).to.be.equal(balanceBefore); - }); -} - -export async function burnItemExpectFailure(sender: IKeyringPair, collectionId: number, tokenId: number, value: number | bigint = 1) { - await usingApi(async (api) => { - const tx = api.tx.unique.burnItem(collectionId, tokenId, value); - - const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; - const result = getCreateCollectionResult(events); - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.false; - }); -} - -export async function burnFromExpectSuccess(sender: IKeyringPair, from: IKeyringPair | CrossAccountId, collectionId: number, tokenId: number, value: number | bigint = 1) { - await usingApi(async (api) => { - const tx = api.tx.unique.burnFrom(collectionId, normalizeAccountId(from), tokenId, value); - const events = await submitTransactionAsync(sender, tx); - return getGenericResult(events).success; - }); -} - -export async function -approve( - api: ApiPromise, - collectionId: number, - tokenId: number, owner: IKeyringPair, approved: CrossAccountId | string | IKeyringPair, amount: number | bigint, -) { - const approveUniqueTx = api.tx.unique.approve(normalizeAccountId(approved), collectionId, tokenId, amount); - const events = await submitTransactionAsync(owner, approveUniqueTx); - return getGenericResult(events).success; -} - -export async function -approveExpectSuccess( - collectionId: number, - tokenId: number, owner: IKeyringPair, approved: CrossAccountId | string, amount: number | bigint = 1, -) { - await usingApi(async (api: ApiPromise) => { - const result = await approve(api, collectionId, tokenId, owner, approved, amount); - expect(result).to.be.true; - - expect(await getAllowance(api, collectionId, owner, approved, tokenId)).to.be.equal(BigInt(amount)); - }); -} - -export async function adminApproveFromExpectSuccess( - collectionId: number, - tokenId: number, admin: IKeyringPair, owner: CrossAccountId | string, approved: CrossAccountId | string, amount: number | bigint = 1, -) { - await usingApi(async (api: ApiPromise) => { - const approveUniqueTx = api.tx.unique.approve(normalizeAccountId(approved), collectionId, tokenId, amount); - const events = await submitTransactionAsync(admin, approveUniqueTx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - expect(await getAllowance(api, collectionId, owner, approved, tokenId)).to.be.equal(BigInt(amount)); - }); -} - -export async function -transferFrom( - api: ApiPromise, - collectionId: number, - tokenId: number, - accountApproved: IKeyringPair, - accountFrom: IKeyringPair | CrossAccountId, - accountTo: IKeyringPair | CrossAccountId, - value: number | bigint, -) { - const from = normalizeAccountId(accountFrom); - const to = normalizeAccountId(accountTo); - const transferFromTx = api.tx.unique.transferFrom(from, to, collectionId, tokenId, value); - const events = await submitTransactionAsync(accountApproved, transferFromTx); - return getGenericResult(events).success; -} - -export async function -transferFromExpectSuccess( - collectionId: number, - tokenId: number, - accountApproved: IKeyringPair, - accountFrom: IKeyringPair | CrossAccountId, - accountTo: IKeyringPair | CrossAccountId, - value: number | bigint = 1, - type = 'NFT', -) { - await usingApi(async (api: ApiPromise) => { - const from = normalizeAccountId(accountFrom); - const to = normalizeAccountId(accountTo); - let balanceBefore = 0n; - if (type === 'Fungible' || type === 'ReFungible') { - balanceBefore = await getBalance(api, collectionId, to, tokenId); - } - expect(await transferFrom(api, collectionId, tokenId, accountApproved, accountFrom, accountTo, value)).to.be.true; - if (type === 'NFT') { - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal(to); - } - if (type === 'Fungible') { - const balanceAfter = await getBalance(api, collectionId, to, tokenId); - if (JSON.stringify(to) !== JSON.stringify(from)) { - expect(balanceAfter - balanceBefore).to.be.equal(BigInt(value)); - } else { - expect(balanceAfter).to.be.equal(balanceBefore); - } - } - if (type === 'ReFungible') { - expect(await getBalance(api, collectionId, to, tokenId)).to.be.equal(balanceBefore + BigInt(value)); - } - }); -} - -export async function -transferFromExpectFail( - collectionId: number, - tokenId: number, - accountApproved: IKeyringPair, - accountFrom: IKeyringPair, - accountTo: IKeyringPair, - value: number | bigint = 1, -) { - await usingApi(async (api: ApiPromise) => { - const transferFromTx = api.tx.unique.transferFrom(normalizeAccountId(accountFrom.address), normalizeAccountId(accountTo.address), collectionId, tokenId, value); - const events = await expect(submitTransactionExpectFailAsync(accountApproved, transferFromTx)).to.be.rejected; - const result = getCreateCollectionResult(events); - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.false; - }); -} - -/* eslint no-async-promise-executor: "off" */ -export async function getBlockNumber(api: ApiPromise): Promise { - return new Promise(async (resolve) => { - const unsubscribe = await api.rpc.chain.subscribeNewHeads((head) => { - unsubscribe(); - resolve(head.number.toNumber()); - }); - }); -} - -export async function addCollectionAdminExpectSuccess(sender: IKeyringPair, collectionId: number, address: string | CrossAccountId) { - await usingApi(async (api) => { - const changeAdminTx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(address)); - const events = await submitTransactionAsync(sender, changeAdminTx); - const result = getCreateCollectionResult(events); - expect(result.success).to.be.true; - }); -} - -export async function adminApproveFromExpectFail( - collectionId: number, - tokenId: number, admin: IKeyringPair, owner: CrossAccountId | string, approved: CrossAccountId | string, amount: number | bigint = 1, -) { - await usingApi(async (api: ApiPromise) => { - const approveUniqueTx = api.tx.unique.approve(normalizeAccountId(approved), collectionId, tokenId, amount); - const events = await expect(submitTransactionAsync(admin, approveUniqueTx)).to.be.rejected; - const result = getGenericResult(events); - expect(result.success).to.be.false; - }); -} - -export async function -getFreeBalance(account: IKeyringPair): Promise { - let balance = 0n; - await usingApi(async (api) => { - balance = BigInt((await api.query.system.account(account.address)).data.free.toString()); - }); - - return balance; -} - -export async function paraSiblingSovereignAccount(paraid: number): Promise { - return usingApi(async api => { - // We are getting a *sibling* parachain sovereign account, - // so we need a sibling prefix: encoded(b"sibl") == 0x7369626c - const siblingPrefix = '0x7369626c'; - - const encodedParaId = api.createType('u32', paraid).toHex(true).substring(2); - const suffix = '000000000000000000000000000000000000000000000000'; - - return siblingPrefix + encodedParaId + suffix; - }); -} - -export async function transferBalanceTo(api: ApiPromise, source: IKeyringPair, target: string, amount = 1000n * UNIQUE) { - const tx = api.tx.balances.transfer(target, amount); - const events = await submitTransactionAsync(source, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; -} - -export async function -scheduleExpectSuccess( - operationTx: any, - sender: IKeyringPair, - blockSchedule: number, - scheduledId: string, - period = 1, - repetitions = 1, -) { - await usingApi(async (api: ApiPromise) => { - const blockNumber: number | undefined = await getBlockNumber(api); - const expectedBlockNumber = blockNumber + blockSchedule; - - expect(blockNumber).to.be.greaterThan(0); - const scheduleTx = api.tx.scheduler.scheduleNamed( // schedule - scheduledId, - expectedBlockNumber, - repetitions > 1 ? [period, repetitions] : null, - 0, - {Value: operationTx as any}, - ); - - const events = await submitTransactionAsync(sender, scheduleTx); - expect(getGenericResult(events).success).to.be.true; - }); -} - -export async function -scheduleExpectFailure( - operationTx: any, - sender: IKeyringPair, - blockSchedule: number, - scheduledId: string, - period = 1, - repetitions = 1, -) { - await usingApi(async (api: ApiPromise) => { - const blockNumber: number | undefined = await getBlockNumber(api); - const expectedBlockNumber = blockNumber + blockSchedule; - - expect(blockNumber).to.be.greaterThan(0); - const scheduleTx = api.tx.scheduler.scheduleNamed( // schedule - scheduledId, - expectedBlockNumber, - repetitions <= 1 ? null : [period, repetitions], - 0, - {Value: operationTx as any}, - ); - - //const events = - await expect(submitTransactionExpectFailAsync(sender, scheduleTx)).to.be.rejected; - //expect(getGenericResult(events).success).to.be.false; - }); -} - -export async function -scheduleTransferAndWaitExpectSuccess( - collectionId: number, - tokenId: number, - sender: IKeyringPair, - recipient: IKeyringPair, - value: number | bigint = 1, - blockSchedule: number, - scheduledId: string, -) { - await usingApi(async (api: ApiPromise) => { - await scheduleTransferExpectSuccess(collectionId, tokenId, sender, recipient, value, blockSchedule, scheduledId); - - const recipientBalanceBefore = (await api.query.system.account(recipient.address)).data.free.toBigInt(); - - // sleep for n + 1 blocks - await waitNewBlocks(blockSchedule + 1); - - const recipientBalanceAfter = (await api.query.system.account(recipient.address)).data.free.toBigInt(); - - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal(normalizeAccountId(recipient.address)); - expect(recipientBalanceAfter).to.be.equal(recipientBalanceBefore); - }); -} - -export async function -scheduleTransferExpectSuccess( - collectionId: number, - tokenId: number, - sender: IKeyringPair, - recipient: IKeyringPair, - value: number | bigint = 1, - blockSchedule: number, - scheduledId: string, -) { - await usingApi(async (api: ApiPromise) => { - const transferTx = api.tx.unique.transfer(normalizeAccountId(recipient.address), collectionId, tokenId, value); - - await scheduleExpectSuccess(transferTx, sender, blockSchedule, scheduledId); - - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal(normalizeAccountId(sender.address)); - }); -} - -export async function -scheduleTransferFundsPeriodicExpectSuccess( - amount: bigint, - sender: IKeyringPair, - recipient: IKeyringPair, - blockSchedule: number, - scheduledId: string, - period: number, - repetitions: number, -) { - await usingApi(async (api: ApiPromise) => { - const transferTx = api.tx.balances.transfer(recipient.address, amount); - - const balanceBefore = await getFreeBalance(recipient); - - await scheduleExpectSuccess(transferTx, sender, blockSchedule, scheduledId, period, repetitions); - - expect(await getFreeBalance(recipient)).to.be.equal(balanceBefore); - }); -} - -export async function -transfer( - api: ApiPromise, - collectionId: number, - tokenId: number, - sender: IKeyringPair, - recipient: IKeyringPair | CrossAccountId, - value: number | bigint, -) : Promise { - const transferTx = api.tx.unique.transfer(normalizeAccountId(recipient), collectionId, tokenId, value); - const events = await executeTransaction(api, sender, transferTx); - return getGenericResult(events).success; -} - -export async function -transferExpectSuccess( - collectionId: number, - tokenId: number, - sender: IKeyringPair, - recipient: IKeyringPair | CrossAccountId, - value: number | bigint = 1, - type = 'NFT', -) { - await usingApi(async (api: ApiPromise) => { - const from = normalizeAccountId(sender); - const to = normalizeAccountId(recipient); - - let balanceBefore = 0n; - if (type === 'Fungible' || type === 'ReFungible') { - balanceBefore = await getBalance(api, collectionId, to, tokenId); - } - - const transferTx = api.tx.unique.transfer(normalizeAccountId(recipient), collectionId, tokenId, value); - const events = await executeTransaction(api, sender, transferTx); - const result = getTransferResult(api, events); - - expect(result.collectionId).to.be.equal(collectionId); - expect(result.itemId).to.be.equal(tokenId); - expect(result.sender).to.be.deep.equal(normalizeAccountId(sender.address)); - expect(result.recipient).to.be.deep.equal(to); - expect(result.value).to.be.equal(BigInt(value)); - - if (type === 'NFT') { - expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal(to); - } - if (type === 'Fungible' || type === 'ReFungible') { - const balanceAfter = await getBalance(api, collectionId, to, tokenId); - if (JSON.stringify(to) !== JSON.stringify(from)) { - expect(balanceAfter - balanceBefore).to.be.equal(BigInt(value)); - } else { - expect(balanceAfter).to.be.equal(balanceBefore); - } - } - }); -} - -export async function -transferExpectFailure( - collectionId: number, - tokenId: number, - sender: IKeyringPair, - recipient: IKeyringPair | CrossAccountId, - value: number | bigint = 1, -) { - await usingApi(async (api: ApiPromise) => { - const transferTx = api.tx.unique.transfer(normalizeAccountId(recipient), collectionId, tokenId, value); - const events = await expect(submitTransactionExpectFailAsync(sender, transferTx)).to.be.rejected; - const result = getGenericResult(events); - // if (events && Array.isArray(events)) { - // const result = getCreateCollectionResult(events); - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.false; - //} - }); -} - -export async function -approveExpectFail( - collectionId: number, - tokenId: number, owner: IKeyringPair, approved: IKeyringPair, amount: number | bigint = 1, -) { - await usingApi(async (api: ApiPromise) => { - const approveUniqueTx = api.tx.unique.approve(normalizeAccountId(approved.address), collectionId, tokenId, amount); - const events = await expect(submitTransactionExpectFailAsync(owner, approveUniqueTx)).to.be.rejected; - const result = getCreateCollectionResult(events); - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.false; - }); -} - -export async function getBalance( - api: ApiPromise, - collectionId: number, - owner: string | CrossAccountId | IKeyringPair, - token: number, -): Promise { - return (await api.rpc.unique.balance(collectionId, normalizeAccountId(owner), token)).toBigInt(); -} -export async function getTokenOwner( - api: ApiPromise, - collectionId: number, - token: number, -): Promise { - const owner = (await api.rpc.unique.tokenOwner(collectionId, token)).toJSON() as any; - if (owner == null) throw new Error('owner == null'); - return normalizeAccountId(owner); -} -export async function getTopmostTokenOwner( - api: ApiPromise, - collectionId: number, - token: number, -): Promise { - const owner = (await api.rpc.unique.topmostTokenOwner(collectionId, token)).toJSON() as any; - if (owner == null) throw new Error('owner == null'); - return normalizeAccountId(owner); -} -export async function getTokenChildren( - api: ApiPromise, - collectionId: number, - tokenId: number, -): Promise { - return (await api.rpc.unique.tokenChildren(collectionId, tokenId)).toJSON() as any; -} -export async function isTokenExists( - api: ApiPromise, - collectionId: number, - token: number, -): Promise { - return (await api.rpc.unique.tokenExists(collectionId, token)).toJSON(); -} -export async function getLastTokenId( - api: ApiPromise, - collectionId: number, -): Promise { - return (await api.rpc.unique.lastTokenId(collectionId)).toJSON(); -} -export async function getAdminList( - api: ApiPromise, - collectionId: number, -): Promise { - return (await api.rpc.unique.adminlist(collectionId)).toHuman() as any; -} -export async function getTokenProperties( - api: ApiPromise, - collectionId: number, - tokenId: number, - propertyKeys: string[], -): Promise { - return (await api.rpc.unique.tokenProperties(collectionId, tokenId, propertyKeys)).toHuman() as any; -} - -export async function createFungibleItemExpectSuccess( - sender: IKeyringPair, - collectionId: number, - data: CreateFungibleData, - owner: CrossAccountId | string = sender.address, -) { - return await usingApi(async (api) => { - const tx = api.tx.unique.createItem(collectionId, normalizeAccountId(owner), {Fungible: data}); - - const events = await submitTransactionAsync(sender, tx); - const result = getCreateItemResult(events); - - expect(result.success).to.be.true; - return result.itemId; - }); -} - -export async function createMultipleItemsExpectSuccess(sender: IKeyringPair, collectionId: number, itemsData: any, owner: CrossAccountId | string = sender.address) { - await usingApi(async (api) => { - const to = normalizeAccountId(owner); - const tx = api.tx.unique.createMultipleItems(collectionId, to, itemsData); - - const events = await submitTransactionAsync(sender, tx); - expect(getGenericResult(events).success).to.be.true; - }); -} - -export async function createMultipleItemsWithPropsExpectSuccess(sender: IKeyringPair, collectionId: number, itemsData: any, owner: CrossAccountId | string = sender.address) { - await usingApi(async (api) => { - const to = normalizeAccountId(owner); - const tx = api.tx.unique.createMultipleItems(collectionId, to, itemsData); - - const events = await submitTransactionAsync(sender, tx); - const result = getCreateItemsResult(events); - - for (const res of result) { - expect(await api.rpc.unique.tokenProperties(collectionId, res.itemId)).not.to.be.empty; - } - }); -} - -export async function createMultipleItemsExWithPropsExpectSuccess(sender: IKeyringPair, collectionId: number, itemsData: any) { - await usingApi(async (api) => { - const tx = api.tx.unique.createMultipleItemsEx(collectionId, itemsData); - - const events = await submitTransactionAsync(sender, tx); - const result = getCreateItemsResult(events); - - for (const res of result) { - expect(await api.rpc.unique.tokenProperties(collectionId, res.itemId)).not.to.be.empty; - } - }); -} - -export async function createItemWithPropsExpectSuccess(sender: IKeyringPair, collectionId: number, createMode: string, props: Array, owner: CrossAccountId | string = sender.address) { - let newItemId = 0; - await usingApi(async (api) => { - const to = normalizeAccountId(owner); - const itemCountBefore = await getLastTokenId(api, collectionId); - const itemBalanceBefore = await getBalance(api, collectionId, to, newItemId); - - let tx; - if (createMode === 'Fungible') { - const createData = {fungible: {value: 10}}; - tx = api.tx.unique.createItem(collectionId, to, createData as any); - } else if (createMode === 'ReFungible') { - const createData = {refungible: {pieces: 100}}; - tx = api.tx.unique.createItem(collectionId, to, createData as any); - } else { - const data = api.createType('UpDataStructsCreateItemData', {NFT: {properties: props}}); - tx = api.tx.unique.createItem(collectionId, to, data as UpDataStructsCreateItemData); - } - - const events = await submitTransactionAsync(sender, tx); - const result = getCreateItemResult(events); - - const itemCountAfter = await getLastTokenId(api, collectionId); - const itemBalanceAfter = await getBalance(api, collectionId, to, newItemId); - - if (createMode === 'NFT') { - expect(await api.rpc.unique.tokenProperties(collectionId, result.itemId)).not.to.be.empty; - } - - // What to expect - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.true; - if (createMode === 'Fungible') { - expect(itemBalanceAfter - itemBalanceBefore).to.be.equal(10n); - } else { - expect(itemCountAfter).to.be.equal(itemCountBefore + 1); - } - expect(collectionId).to.be.equal(result.collectionId); - expect(itemCountAfter.toString()).to.be.equal(result.itemId.toString()); - expect(to).to.be.deep.equal(result.recipient); - newItemId = result.itemId; - }); - return newItemId; -} - -export async function createItemWithPropsExpectFailure(sender: IKeyringPair, collectionId: number, createMode: string, props: Array, owner: CrossAccountId | string = sender.address) { - await usingApi(async (api) => { - - let tx; - if (createMode === 'NFT') { - const data = api.createType('UpDataStructsCreateItemData', {NFT: {properties: props}}) as UpDataStructsCreateItemData; - tx = api.tx.unique.createItem(collectionId, normalizeAccountId(owner), data); - } else { - tx = api.tx.unique.createItem(collectionId, normalizeAccountId(owner), createMode); - } - - - const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; - if(events.message && events.message.toString().indexOf('1002: Verification Error') > -1) return; - const result = getCreateItemResult(events); - - expect(result.success).to.be.false; - }); -} - -export async function createItemExpectSuccess(sender: IKeyringPair, collectionId: number, createMode: string, owner: CrossAccountId | string = sender.address) { - let newItemId = 0; - await usingApi(async (api) => { - const to = normalizeAccountId(owner); - const itemCountBefore = await getLastTokenId(api, collectionId); - const itemBalanceBefore = await getBalance(api, collectionId, to, newItemId); - - let tx; - if (createMode === 'Fungible') { - const createData = {fungible: {value: 10}}; - tx = api.tx.unique.createItem(collectionId, to, createData as any); - } else if (createMode === 'ReFungible') { - const createData = {refungible: {pieces: 100}}; - tx = api.tx.unique.createItem(collectionId, to, createData as any); - } else { - const createData = {nft: {}}; - tx = api.tx.unique.createItem(collectionId, to, createData as any); - } - - const events = await executeTransaction(api, sender, tx); - const result = getCreateItemResult(events); - - const itemCountAfter = await getLastTokenId(api, collectionId); - const itemBalanceAfter = await getBalance(api, collectionId, to, newItemId); - - // What to expect - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.true; - if (createMode === 'Fungible') { - expect(itemBalanceAfter - itemBalanceBefore).to.be.equal(10n); - } else { - expect(itemCountAfter).to.be.equal(itemCountBefore + 1); - } - expect(collectionId).to.be.equal(result.collectionId); - expect(itemCountAfter.toString()).to.be.equal(result.itemId.toString()); - expect(to).to.be.deep.equal(result.recipient); - newItemId = result.itemId; - }); - return newItemId; -} - -export async function createRefungibleToken(api: ApiPromise, sender: IKeyringPair, collectionId: number, amount: bigint, owner: CrossAccountId | IKeyringPair | string = sender.address) : Promise { - const createData = {refungible: {pieces: amount}}; - const tx = api.tx.unique.createItem(collectionId, normalizeAccountId(owner), createData as any); - - const events = await submitTransactionAsync(sender, tx); - return getCreateItemResult(events); -} - -export async function createItemExpectFailure(sender: IKeyringPair, collectionId: number, createMode: string, owner: CrossAccountId | string = sender.address) { - await usingApi(async (api) => { - const tx = api.tx.unique.createItem(collectionId, normalizeAccountId(owner), createMode); - - const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; - const result = getCreateItemResult(events); - - expect(result.success).to.be.false; - }); -} - -export async function setPublicAccessModeExpectSuccess( - sender: IKeyringPair, collectionId: number, - accessMode: 'Normal' | 'AllowList', -) { - await usingApi(async (api) => { - - // Run the transaction - const tx = api.tx.unique.setCollectionPermissions(collectionId, {access: accessMode}); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - - // Get the collection - const collection = await queryCollectionExpectSuccess(api, collectionId); - - // What to expect - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.true; - expect(collection.permissions.access.toHuman()).to.be.equal(accessMode); - }); -} - -export async function setPublicAccessModeExpectFail( - sender: IKeyringPair, collectionId: number, - accessMode: 'Normal' | 'AllowList', -) { - await usingApi(async (api) => { - - // Run the transaction - const tx = api.tx.unique.setCollectionPermissions(collectionId, {access: accessMode}); - const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; - const result = getGenericResult(events); - - // What to expect - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.false; - }); -} - -export async function enableAllowListExpectSuccess(sender: IKeyringPair, collectionId: number) { - await setPublicAccessModeExpectSuccess(sender, collectionId, 'AllowList'); -} - -export async function enableAllowListExpectFail(sender: IKeyringPair, collectionId: number) { - await setPublicAccessModeExpectFail(sender, collectionId, 'AllowList'); -} - -export async function disableAllowListExpectSuccess(sender: IKeyringPair, collectionId: number) { - await setPublicAccessModeExpectSuccess(sender, collectionId, 'Normal'); -} - -export async function setMintPermissionExpectSuccess(sender: IKeyringPair, collectionId: number, enabled: boolean) { - await usingApi(async (api) => { - - // Run the transaction - const tx = api.tx.unique.setCollectionPermissions(collectionId, {mintMode: enabled}); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - // Get the collection - const collection = await queryCollectionExpectSuccess(api, collectionId); - - expect(collection.permissions.mintMode.toHuman()).to.be.equal(enabled); - }); -} - -export async function enablePublicMintingExpectSuccess(sender: IKeyringPair, collectionId: number) { - await setMintPermissionExpectSuccess(sender, collectionId, true); -} - -export async function setMintPermissionExpectFailure(sender: IKeyringPair, collectionId: number, enabled: boolean) { - await usingApi(async (api) => { - // Run the transaction - const tx = api.tx.unique.setCollectionPermissions(collectionId, {mintMode: enabled}); - const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; - const result = getCreateCollectionResult(events); - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.false; - }); -} - -export async function setChainLimitsExpectFailure(sender: IKeyringPair, limits: IChainLimits) { - await usingApi(async (api) => { - // Run the transaction - const tx = api.tx.unique.setChainLimits(limits); - const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; - const result = getCreateCollectionResult(events); - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.false; - }); -} - -export async function isAllowlisted(api: ApiPromise, collectionId: number, address: string | CrossAccountId | IKeyringPair) { - return (await api.rpc.unique.allowed(collectionId, normalizeAccountId(address))).toJSON(); -} - -export async function addToAllowListExpectSuccess(sender: IKeyringPair, collectionId: number, address: string | AccountId | CrossAccountId) { - await usingApi(async (api) => { - expect(await isAllowlisted(api, collectionId, normalizeAccountId(address))).to.be.false; - - // Run the transaction - const tx = api.tx.unique.addToAllowList(collectionId, normalizeAccountId(address)); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - expect(await isAllowlisted(api, collectionId, normalizeAccountId(address))).to.be.true; - }); -} - -export async function addToAllowListAgainExpectSuccess(sender: IKeyringPair, collectionId: number, address: string | AccountId) { - await usingApi(async (api) => { - - expect(await isAllowlisted(api, collectionId, normalizeAccountId(address))).to.be.true; - - // Run the transaction - const tx = api.tx.unique.addToAllowList(collectionId, normalizeAccountId(address)); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - expect(result.success).to.be.true; - - expect(await isAllowlisted(api, collectionId, normalizeAccountId(address))).to.be.true; - }); -} - -export async function addToAllowListExpectFail(sender: IKeyringPair, collectionId: number, address: string | AccountId) { - await usingApi(async (api) => { - - // Run the transaction - const tx = api.tx.unique.addToAllowList(collectionId, normalizeAccountId(address)); - const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; - const result = getGenericResult(events); - - // What to expect - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.false; - }); -} - -export async function removeFromAllowListExpectSuccess(sender: IKeyringPair, collectionId: number, address: CrossAccountId) { - await usingApi(async (api) => { - // Run the transaction - const tx = api.tx.unique.removeFromAllowList(collectionId, normalizeAccountId(address)); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - - // What to expect - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.true; - }); -} - -export async function removeFromAllowListExpectFailure(sender: IKeyringPair, collectionId: number, address: CrossAccountId) { - await usingApi(async (api) => { - // Run the transaction - const tx = api.tx.unique.removeFromAllowList(collectionId, normalizeAccountId(address)); - const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected; - const result = getGenericResult(events); - - // What to expect - // tslint:disable-next-line:no-unused-expression - expect(result.success).to.be.false; - }); -} - -export const getDetailedCollectionInfo = async (api: ApiPromise, collectionId: number) - : Promise => { - return (await api.rpc.unique.collectionById(collectionId)).unwrapOr(null); -}; - -export const getCreatedCollectionCount = async (api: ApiPromise): Promise => { - // set global object - collectionsCount - return (await api.rpc.unique.collectionStats()).created.toNumber(); -}; - -export async function queryCollectionExpectSuccess(api: ApiPromise, collectionId: number): Promise { - return (await api.rpc.unique.collectionById(collectionId)).unwrap(); -} - -export async function waitNewBlocks(blocksCount = 1): Promise { - await usingApi(async (api) => { - const promise = new Promise(async (resolve) => { - const unsubscribe = await api.rpc.chain.subscribeNewHeads(() => { - if (blocksCount > 0) { - blocksCount--; - } else { - unsubscribe(); - resolve(); - } - }); - }); - return promise; - }); -} - -export async function waitEvent( - api: ApiPromise, - maxBlocksToWait: number, - eventSection: string, - eventMethod: string, -): Promise { - - const promise = new Promise(async (resolve) => { - const unsubscribe = await api.rpc.chain.subscribeNewHeads(async header => { - const blockNumber = header.number.toHuman(); - const blockHash = header.hash; - const eventIdStr = `${eventSection}.${eventMethod}`; - const waitLimitStr = `wait blocks remaining: ${maxBlocksToWait}`; - - console.log(`[Block #${blockNumber}] Waiting for event \`${eventIdStr}\` (${waitLimitStr})`); - - const apiAt = await api.at(blockHash); - const eventRecords = await apiAt.query.system.events(); - - const neededEvent = eventRecords.find(r => { - return r.event.section == eventSection && r.event.method == eventMethod; - }); - - if (neededEvent) { - unsubscribe(); - resolve(neededEvent); - } else if (maxBlocksToWait > 0) { - maxBlocksToWait--; - } else { - console.log(`Event \`${eventIdStr}\` is NOT found`); - - unsubscribe(); - resolve(null); - } - }); - }); - return promise; -} - -export async function repartitionRFT( - api: ApiPromise, - collectionId: number, - sender: IKeyringPair, - tokenId: number, - amount: bigint, -): Promise { - const tx = api.tx.unique.repartition(collectionId, tokenId, amount); - const events = await submitTransactionAsync(sender, tx); - const result = getGenericResult(events); - - return result.success; -} - -export async function itApi(name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any, opts: { only?: boolean, skip?: boolean } = {}) { - let i: any = it; - if (opts.only) i = i.only; - else if (opts.skip) i = i.skip; - i(name, async () => { - await usingApi(async (api, privateKeyWrapper) => { - await cb({api, privateKeyWrapper}); - }); - }); -} - -itApi.only = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {only: true}); -itApi.skip = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {skip: true}); - -let accountSeed = 10000; -export function generateKeyringPair(keyring: Keyring) { - const privateKey = `0xDEADBEEF${(Date.now() + (accountSeed++)).toString(16).padStart(64 - 8, '0')}`; - return keyring.addFromUri(privateKey); -} - -export async function expectSubstrateEventsAtBlock(api: ApiPromise, blockNumber: AnyNumber | BlockNumber, section: string, methods: string[], dryRun = false) { - const blockHash = await api.rpc.chain.getBlockHash(blockNumber); - const subEvents = (await api.query.system.events.at(blockHash)) - .filter(x => x.event.section === section) - .map((x) => x.toHuman()); - const events = methods.map((m) => { - return { - event: { - method: m, - section, - }, - }; - }); - if (!dryRun) { - expect(subEvents).to.be.like(events); - } - return subEvents; -} diff --git a/tests/src/deprecated-helpers/util.ts b/tests/src/deprecated-helpers/util.ts deleted file mode 100644 index cb644a9333..0000000000 --- a/tests/src/deprecated-helpers/util.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -export function strToUTF16(str: string): any { - const buf: number[] = []; - for (let i=0, strLen=str.length; i < strLen; i++) { - buf.push(str.charCodeAt(i)); - } - return buf; -} - -export function utf16ToStr(buf: number[]): string { - let str = ''; - for (let i=0, strLen=buf.length; i < strLen; i++) { - if (buf[i] != 0) str += String.fromCharCode(buf[i]); - else break; - } - return str; -} - -export function hexToStr(buf: string): string { - let str = ''; - let hexStart = buf.indexOf('0x'); - if (hexStart < 0) hexStart = 0; - else hexStart = 2; - for (let i=hexStart, strLen=buf.length; i < strLen; i+=2) { - const ch = buf[i] + buf[i+1]; - const num = parseInt(ch, 16); - if (num != 0) str += String.fromCharCode(num); - else break; - } - return str; -} From ce82ba0680fd88ad0d90ef14bf690a34d799bc45 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Tue, 11 Oct 2022 15:58:42 +0000 Subject: [PATCH 1104/1274] tests(parallel): fix phantom errors --- tests/src/approve.test.ts | 2 +- tests/src/confirmSponsorship.test.ts | 9 ++++++--- tests/src/deprecated-helpers/helpers.ts | 4 ++-- tests/src/refungible.test.ts | 12 ++++++------ tests/src/xcm/xcmOpal.test.ts | 4 ++-- tests/src/xcm/xcmQuartz.test.ts | 8 ++++---- tests/src/xcm/xcmUnique.test.ts | 8 ++++---- 7 files changed, 25 insertions(+), 22 deletions(-) diff --git a/tests/src/approve.test.ts b/tests/src/approve.test.ts index 380ec01551..be305713b9 100644 --- a/tests/src/approve.test.ts +++ b/tests/src/approve.test.ts @@ -227,7 +227,7 @@ describe('Approved users cannot use transferFrom to repeat transfers if approved }); }); -describe('Approved amount decreases by the transferred amount.:', () => { +describe('Approved amount decreases by the transferred amount:', () => { let alice: IKeyringPair; let bob: IKeyringPair; let charlie: IKeyringPair; diff --git a/tests/src/confirmSponsorship.test.ts b/tests/src/confirmSponsorship.test.ts index 55bf65a23f..02a293f3bf 100644 --- a/tests/src/confirmSponsorship.test.ts +++ b/tests/src/confirmSponsorship.test.ts @@ -73,7 +73,7 @@ describe('integration test: ext. confirmSponsorship():', () => { }); itSub('Fungible: Transfer fees are paid by the sponsor after confirmation', async ({helper}) => { - const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0); + const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); await collection.setSponsor(alice, bob.address); await collection.confirmSponsorship(bob); const bobBalanceBefore = await helper.balance.getSubstrate(bob.address); @@ -163,7 +163,10 @@ describe('integration test: ext. confirmSponsorship():', () => { }); itSub('NFT: Sponsoring of createItem is rate limited', async ({helper}) => { - const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL', limits: { + sponsoredDataRateLimit: {blocks: 1000}, + sponsorTransferTimeout: 1000, + }}); await collection.setSponsor(alice, bob.address); await collection.confirmSponsorship(bob); await collection.setPermissions(alice, {mintMode: true, access: 'AllowList'}); @@ -195,7 +198,7 @@ describe('(!negative test!) integration test: ext. confirmSponsorship():', () => }); itSub('(!negative test!) Confirm sponsorship for a collection that never existed', async ({helper}) => { - const collectionId = 1_000_000; + const collectionId = (1 << 32) - 1; const confirmSponsorshipTx = async () => helper.collection.confirmSponsorship(bob, collectionId); await expect(confirmSponsorshipTx()).to.be.rejectedWith(/common\.CollectionNotFound/); }); diff --git a/tests/src/deprecated-helpers/helpers.ts b/tests/src/deprecated-helpers/helpers.ts index cff8eff881..cc81588f75 100644 --- a/tests/src/deprecated-helpers/helpers.ts +++ b/tests/src/deprecated-helpers/helpers.ts @@ -1764,11 +1764,11 @@ export async function queryCollectionExpectSuccess(api: ApiPromise, collectionId return (await api.rpc.unique.collectionById(collectionId)).unwrap(); } -/*export const describe_xcm = ( +export const describeXCM = ( process.env.RUN_XCM_TESTS ? describe : describe.skip -);*/ +); export async function waitNewBlocks(blocksCount = 1): Promise { await usingApi(async (api) => { diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index fbd87345c3..da1afa836b 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -62,7 +62,7 @@ describe('integration test: Refungible functionality:', async () => { .to.eventually.be.rejectedWith(/refungible\.WrongRefungiblePieces/); }); - itSub('RPC method tokenOnewrs for refungible collection and token', async ({helper}) => { + itSub('RPC method tokenOwners for refungible collection and token', async ({helper}) => { const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'}; const facelessCrowd = (await helper.arrange.createAccounts(Array(7).fill(0n), donor)).map(keyring => {return {Substrate: keyring.address};}); @@ -212,7 +212,8 @@ describe('integration test: Refungible functionality:', async () => { const token = await collection.mintToken(alice, 100n); await token.repartition(alice, 200n); const chainEvents = helper.chainLog.slice(-1)[0].events; - expect(chainEvents).to.deep.include({ + const event = chainEvents.find((event: any) => event.section === 'common' && event.method === 'ItemCreated'); + expect(event).to.deep.include({ section: 'common', method: 'ItemCreated', index: [66, 2], @@ -222,7 +223,6 @@ describe('integration test: Refungible functionality:', async () => { {substrate: alice.address}, 100n, ], - phase: {applyExtrinsic: 2}, }); }); @@ -231,9 +231,10 @@ describe('integration test: Refungible functionality:', async () => { const token = await collection.mintToken(alice, 100n); await token.repartition(alice, 50n); const chainEvents = helper.chainLog.slice(-1)[0].events; - expect(chainEvents).to.deep.include({ - method: 'ItemDestroyed', + const event = chainEvents.find((event: any) => event.section === 'common' && event.method === 'ItemDestroyed'); + expect(event).to.deep.include({ section: 'common', + method: 'ItemDestroyed', index: [66, 3], data: [ collection.collectionId, @@ -241,7 +242,6 @@ describe('integration test: Refungible functionality:', async () => { {substrate: alice.address}, 50n, ], - phase: {applyExtrinsic: 2}, }); }); diff --git a/tests/src/xcm/xcmOpal.test.ts b/tests/src/xcm/xcmOpal.test.ts index c5358c3953..6b5d285b1b 100644 --- a/tests/src/xcm/xcmOpal.test.ts +++ b/tests/src/xcm/xcmOpal.test.ts @@ -21,7 +21,7 @@ import {WsProvider} from '@polkadot/api'; import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; import usingApi, {executeTransaction} from './../substrate/substrate-api'; -import {bigIntToDecimals, describe_xcm, getGenericResult, paraSiblingSovereignAccount, normalizeAccountId} from './../deprecated-helpers/helpers'; +import {bigIntToDecimals, describeXCM, getGenericResult, paraSiblingSovereignAccount, normalizeAccountId} from './../deprecated-helpers/helpers'; import waitNewBlocks from './../substrate/wait-new-blocks'; import getBalance from './../substrate/get-balance'; @@ -49,7 +49,7 @@ const TRANSFER_AMOUNT = 1_000_000_000_000_000_000n; // 10,000.00 (ten thousands) USDT const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n; -describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { +describeXCM('[XCM] Integration test: Exchanging USDT with Westmint', () => { let alice: IKeyringPair; let bob: IKeyringPair; diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index 6ee1f06d29..83ecf8d513 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -21,7 +21,7 @@ import {WsProvider, Keyring} from '@polkadot/api'; import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../deprecated-helpers/helpers'; +import {getGenericResult, generateKeyringPair, waitEvent, describeXCM, bigIntToDecimals} from '../deprecated-helpers/helpers'; import {MultiLocation} from '@polkadot/types/interfaces'; import {blake2AsHex} from '@polkadot/util-crypto'; import waitNewBlocks from '../substrate/wait-new-blocks'; @@ -61,7 +61,7 @@ function relayOptions(): ApiOptions { return parachainApiOptions(RELAY_PORT); } -describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { +describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { let alice: IKeyringPair; let randomAccount: IKeyringPair; @@ -292,7 +292,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => { }); // These tests are relevant only when the foreign asset pallet is disabled -describe_xcm('[XCM] Integration test: Quartz rejects non-native tokens', () => { +describeXCM('[XCM] Integration test: Quartz rejects non-native tokens', () => { let alice: IKeyringPair; before(async () => { @@ -433,7 +433,7 @@ describe_xcm('[XCM] Integration test: Quartz rejects non-native tokens', () => { }); }); -describe_xcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { +describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { // Quartz constants let quartzAlice: IKeyringPair; diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index 3764c9d780..a50ac7c40c 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -21,7 +21,7 @@ import {WsProvider, Keyring} from '@polkadot/api'; import {ApiOptions} from '@polkadot/api/types'; import {IKeyringPair} from '@polkadot/types/types'; import usingApi, {submitTransactionAsync} from '../substrate/substrate-api'; -import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../deprecated-helpers/helpers'; +import {getGenericResult, generateKeyringPair, waitEvent, describeXCM, bigIntToDecimals} from '../deprecated-helpers/helpers'; import {MultiLocation} from '@polkadot/types/interfaces'; import {blake2AsHex} from '@polkadot/util-crypto'; import waitNewBlocks from '../substrate/wait-new-blocks'; @@ -61,7 +61,7 @@ function relayOptions(): ApiOptions { return parachainApiOptions(RELAY_PORT); } -describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { +describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => { let alice: IKeyringPair; let randomAccount: IKeyringPair; @@ -292,7 +292,7 @@ describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => { }); // These tests are relevant only when the foreign asset pallet is disabled -describe_xcm('[XCM] Integration test: Unique rejects non-native tokens', () => { +describeXCM('[XCM] Integration test: Unique rejects non-native tokens', () => { let alice: IKeyringPair; before(async () => { @@ -433,7 +433,7 @@ describe_xcm('[XCM] Integration test: Unique rejects non-native tokens', () => { }); }); -describe_xcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { +describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => { // Unique constants let uniqueAlice: IKeyringPair; From 8a971f87399aff25bb21f01f09dcb4c3656eb353 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Tue, 11 Oct 2022 15:59:42 +0000 Subject: [PATCH 1105/1274] tests(chore): update dependencies + regenerate types --- tests/package.json | 18 +- tests/src/interfaces/augment-api-consts.ts | 6 +- tests/src/interfaces/augment-api-events.ts | 20 +- tests/src/interfaces/augment-api-query.ts | 10 +- tests/src/interfaces/augment-api-rpc.ts | 7 + tests/src/interfaces/augment-api-tx.ts | 16 +- tests/src/interfaces/augment-types.ts | 13 +- tests/src/interfaces/default/types.ts | 68 +- tests/src/interfaces/lookup.ts | 586 ++++----- tests/src/interfaces/registry.ts | 4 +- tests/src/interfaces/types-lookup.ts | 588 ++++----- tests/yarn.lock | 1387 ++++++++++---------- 12 files changed, 1376 insertions(+), 1347 deletions(-) diff --git a/tests/package.json b/tests/package.json index 1ae5b00bf2..e49bc3aba2 100644 --- a/tests/package.json +++ b/tests/package.json @@ -5,11 +5,11 @@ "main": "", "devDependencies": { "@polkadot/ts": "0.4.22", - "@polkadot/typegen": "9.2.2", + "@polkadot/typegen": "9.5.1", "@types/chai": "^4.3.1", "@types/chai-as-promised": "^7.1.5", "@types/chai-like": "^1.1.1", - "@types/mocha": "^9.1.1", + "@types/mocha": "^10.0.0", "@types/node": "^17.0.35", "@typescript-eslint/eslint-plugin": "^5.26.0", "@typescript-eslint/parser": "^5.26.0", @@ -92,7 +92,7 @@ "testEthFT": "mocha --timeout 9999999 -r ts-node/register ./**/eth/fungible.test.ts", "testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts", "testPromotion": "mocha --timeout 9999999 -r ts-node/register ./**/app-promotion.test.ts", - + "testXcmUnique": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmUnique.test.ts", "testXcmQuartz": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmQuartz.test.ts", "testXcmOpal": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmOpal.test.ts", @@ -102,7 +102,7 @@ "load": "mocha --timeout 9999999 -r ts-node/register './**/*.load.ts'", "loadTransfer": "ts-node src/transfer.nload.ts", - + "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", "polkadot-types-from-defs": "ts-node ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .", "polkadot-types-from-chain": "ts-node ./node_modules/.bin/polkadot-types-from-chain --endpoint src/interfaces/metadata.json --output src/interfaces/ --package .", @@ -112,14 +112,14 @@ "license": "SEE LICENSE IN ../LICENSE", "homepage": "", "dependencies": { - "@polkadot/api": "9.2.2", - "@polkadot/api-contract": "9.2.2", - "@polkadot/util-crypto": "10.1.7", - "bignumber.js": "^9.0.2", + "@polkadot/api": "9.5.1", + "@polkadot/api-contract": "9.5.1", + "@polkadot/util-crypto": "10.1.10", + "bignumber.js": "^9.1.0", "chai-as-promised": "^7.1.1", "chai-like": "^1.1.1", "find-process": "^1.4.7", - "solc": "0.8.14-fixed", + "solc": "0.8.17", "web3": "^1.7.3" }, "standard": { diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index 85db5313f3..2251b9f1f2 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -8,7 +8,7 @@ import '@polkadot/api-base/types/consts'; import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types'; import type { Option, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { Codec } from '@polkadot/types-codec/types'; -import type { Perbill, Permill } from '@polkadot/types/interfaces/runtime'; +import type { Perbill, Permill, Weight } from '@polkadot/types/interfaces/runtime'; import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion, XcmV1MultiLocation } from '@polkadot/types/lookup'; export type __AugmentedConst = AugmentedConst; @@ -97,7 +97,7 @@ declare module '@polkadot/api-base/types/consts' { * The maximum weight that may be scheduled per block for any dispatchables of less * priority than `schedule::HARD_DEADLINE`. **/ - maximumWeight: u64 & AugmentedConst; + maximumWeight: Weight & AugmentedConst; /** * The maximum number of scheduled calls in the queue for a single block. * Not strictly enforced, but used for weight estimation. @@ -126,7 +126,7 @@ declare module '@polkadot/api-base/types/consts' { **/ dbWeight: FrameSupportWeightsRuntimeDbWeight & AugmentedConst; /** - * The designated SS85 prefix of this chain. + * The designated SS58 prefix of this chain. * * This replaces the "ss58Format" property declared in the chain spec. Reason is * that the runtime should know about the prefix in order to make use of it as diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index 88b44476eb..dd50d96a48 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -8,7 +8,7 @@ import '@polkadot/api-base/types/events'; import type { ApiTypes, AugmentedEvent } from '@polkadot/api-base/types'; import type { Bytes, Null, Option, Result, U256, U8aFixed, bool, u128, u32, u64, u8 } from '@polkadot/types-codec'; import type { ITuple } from '@polkadot/types-codec/types'; -import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime'; +import type { AccountId32, H160, H256, Weight } from '@polkadot/types/interfaces/runtime'; import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetMultiAssets, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; export type __AugmentedEvent = AugmentedEvent; @@ -184,11 +184,11 @@ declare module '@polkadot/api-base/types/events' { /** * Downward message is overweight and was placed in the overweight queue. **/ - OverweightEnqueued: AugmentedEvent; + OverweightEnqueued: AugmentedEvent; /** * Downward message from the overweight queue was executed. **/ - OverweightServiced: AugmentedEvent; + OverweightServiced: AugmentedEvent; /** * Downward message is unsupported version of XCM. **/ @@ -196,7 +196,7 @@ declare module '@polkadot/api-base/types/events' { /** * The weight limit for handling downward messages was reached. **/ - WeightExhausted: AugmentedEvent; + WeightExhausted: AugmentedEvent; /** * Generic event **/ @@ -290,7 +290,7 @@ declare module '@polkadot/api-base/types/events' { /** * Downward messages were processed using the given weight. **/ - DownwardMessagesProcessed: AugmentedEvent; + DownwardMessagesProcessed: AugmentedEvent; /** * Some downward messages have been received and will be processed. **/ @@ -378,7 +378,7 @@ declare module '@polkadot/api-base/types/events' { * * \[ id, pallet index, call index, actual weight, max budgeted weight \] **/ - NotifyOverweight: AugmentedEvent; + NotifyOverweight: AugmentedEvent; /** * A given location which had a version change subscription was dropped owing to an error * migrating the location to our new XCM format. @@ -769,19 +769,19 @@ declare module '@polkadot/api-base/types/events' { /** * Some XCM failed. **/ - Fail: AugmentedEvent, error: XcmV2TraitsError, weight: u64], { messageHash: Option, error: XcmV2TraitsError, weight: u64 }>; + Fail: AugmentedEvent, error: XcmV2TraitsError, weight: Weight], { messageHash: Option, error: XcmV2TraitsError, weight: Weight }>; /** * An XCM exceeded the individual message weight budget. **/ - OverweightEnqueued: AugmentedEvent; + OverweightEnqueued: AugmentedEvent; /** * An XCM from the overweight queue was executed with the given actual weight used. **/ - OverweightServiced: AugmentedEvent; + OverweightServiced: AugmentedEvent; /** * Some XCM was executed ok. **/ - Success: AugmentedEvent, weight: u64], { messageHash: Option, weight: u64 }>; + Success: AugmentedEvent, weight: Weight], { messageHash: Option, weight: Weight }>; /** * An upward message was sent to the relay chain. **/ diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index a51dfbea7e..a495706000 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -8,8 +8,8 @@ import '@polkadot/api-base/types/storage'; import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types'; import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; -import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime'; -import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup'; +import type { AccountId32, H160, H256, Weight } from '@polkadot/types/interfaces/runtime'; +import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup'; import type { Observable } from '@polkadot/types/types'; export type __AugmentedQuery = AugmentedQuery unknown>; @@ -555,12 +555,12 @@ declare module '@polkadot/api-base/types/storage' { * The weight we reserve at the beginning of the block for processing DMP messages. This * overrides the amount set in the Config trait. **/ - reservedDmpWeightOverride: AugmentedQuery Observable>, []> & QueryableStorageEntry; + reservedDmpWeightOverride: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The weight we reserve at the beginning of the block for processing XCMP messages. This * overrides the amount set in the Config trait. **/ - reservedXcmpWeightOverride: AugmentedQuery Observable>, []> & QueryableStorageEntry; + reservedXcmpWeightOverride: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * An option which indicates if the relay-chain restricts signalling a validation code upgrade. * In other words, if this is `Some` and [`NewValidationCode`] is `Some` then the produced @@ -716,7 +716,7 @@ declare module '@polkadot/api-base/types/storage' { /** * The current weight for the block. **/ - blockWeight: AugmentedQuery Observable, []> & QueryableStorageEntry; + blockWeight: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Digest of the current block, also part of the block header. **/ diff --git a/tests/src/interfaces/augment-api-rpc.ts b/tests/src/interfaces/augment-api-rpc.ts index 713d02450f..28f0df926c 100644 --- a/tests/src/interfaces/augment-api-rpc.ts +++ b/tests/src/interfaces/augment-api-rpc.ts @@ -161,22 +161,27 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { }; contracts: { /** + * @deprecated Use the runtime interface `api.call.contractsApi.call` instead * Executes a call to a contract **/ call: AugmentedRpc<(callRequest: ContractCallRequest | { origin?: any; dest?: any; value?: any; gasLimit?: any; storageDepositLimit?: any; inputData?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable>; /** + * @deprecated Use the runtime interface `api.call.contractsApi.getStorage` instead * Returns the value under a specified storage key in a contract **/ getStorage: AugmentedRpc<(address: AccountId | string | Uint8Array, key: H256 | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable>>; /** + * @deprecated Use the runtime interface `api.call.contractsApi.instantiate` instead * Instantiate a new contract **/ instantiate: AugmentedRpc<(request: InstantiateRequest | { origin?: any; value?: any; gasLimit?: any; storageDepositLimit?: any; code?: any; data?: any; salt?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable>; /** + * @deprecated Not available in newer versions of the contracts interfaces * Returns the projected time a given contract will be able to sustain paying its rent **/ rentProjection: AugmentedRpc<(address: AccountId | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable>>; /** + * @deprecated Use the runtime interface `api.call.contractsApi.uploadCode` instead * Upload new code without instantiating a contract from it **/ uploadCode: AugmentedRpc<(uploadRequest: CodeUploadRequest | { origin?: any; code?: any; storageDepositLimit?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable>; @@ -515,6 +520,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { **/ getChildStorageSize: AugmentedRpc<(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable>; /** + * @deprecated Use `api.rpc.state.getKeysPaged` to retrieve keys * Retrieves the keys with a certain prefix **/ getKeys: AugmentedRpc<(key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable>>; @@ -527,6 +533,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { **/ getMetadata: AugmentedRpc<(at?: BlockHash | string | Uint8Array) => Observable>; /** + * @deprecated Use `api.rpc.state.getKeysPaged` to retrieve keys * Returns the keys with prefix, leave empty to get all the keys (deprecated: Use getKeysPaged) **/ getPairs: AugmentedRpc<(prefix: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable>>; diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index f37ca55a43..7911b3c0f7 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -8,7 +8,7 @@ import '@polkadot/api-base/types/submittable'; import type { ApiTypes, AugmentedSubmittable, SubmittableExtrinsic, SubmittableExtrinsicFunction } from '@polkadot/api-base/types'; import type { Bytes, Compact, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types'; -import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; +import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill, Weight } from '@polkadot/types/interfaces/runtime'; import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, FrameSupportScheduleMaybeHashed, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartEquippableList, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; export type __AugmentedSubmittable = AugmentedSubmittable<() => unknown>; @@ -243,7 +243,7 @@ declare module '@polkadot/api-base/types/submittable' { * Events: * - `OverweightServiced`: On success. **/ - serviceOverweight: AugmentedSubmittable<(index: u64 | AnyNumber | Uint8Array, weightLimit: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u64, u64]>; + serviceOverweight: AugmentedSubmittable<(index: u64 | AnyNumber | Uint8Array, weightLimit: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u64, Weight]>; /** * Generic tx **/ @@ -367,7 +367,7 @@ declare module '@polkadot/api-base/types/submittable' { * NOTE: A successful return to this does *not* imply that the `msg` was executed successfully * to completion; only that *some* of it was executed. **/ - execute: AugmentedSubmittable<(message: XcmVersionedXcm | { V0: any } | { V1: any } | { V2: any } | string | Uint8Array, maxWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [XcmVersionedXcm, u64]>; + execute: AugmentedSubmittable<(message: XcmVersionedXcm | { V0: any } | { V1: any } | { V2: any } | string | Uint8Array, maxWeight: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic, [XcmVersionedXcm, Weight]>; /** * Set a safe XCM version (the version that XCM should be encoded with if the most recent * version a destination can accept is unknown). @@ -902,7 +902,7 @@ declare module '@polkadot/api-base/types/submittable' { * - The weight of this call is defined by the caller. * # **/ - sudoUncheckedWeight: AugmentedSubmittable<(call: Call | IMethod | string | Uint8Array, weight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, u64]>; + sudoUncheckedWeight: AugmentedSubmittable<(call: Call | IMethod | string | Uint8Array, weight: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Call, Weight]>; /** * Generic tx **/ @@ -1683,7 +1683,7 @@ declare module '@polkadot/api-base/types/submittable' { * Events: * - `OverweightServiced`: On success. **/ - serviceOverweight: AugmentedSubmittable<(index: u64 | AnyNumber | Uint8Array, weightLimit: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u64, u64]>; + serviceOverweight: AugmentedSubmittable<(index: u64 | AnyNumber | Uint8Array, weightLimit: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u64, Weight]>; /** * Suspends all XCM executions for the XCMP queue, regardless of the sender's origin. * @@ -1720,7 +1720,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `origin`: Must pass `Root`. * - `new`: Desired value for `QueueConfigData.threshold_weight` **/ - updateThresholdWeight: AugmentedSubmittable<(updated: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u64]>; + updateThresholdWeight: AugmentedSubmittable<(updated: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Weight]>; /** * Overwrites the speed to which the available weight approaches the maximum weight. * A lower number results in a faster progression. A value of 1 makes the entire weight available initially. @@ -1728,7 +1728,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `origin`: Must pass `Root`. * - `new`: Desired value for `QueueConfigData.weight_restrict_decay`. **/ - updateWeightRestrictDecay: AugmentedSubmittable<(updated: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u64]>; + updateWeightRestrictDecay: AugmentedSubmittable<(updated: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Weight]>; /** * Overwrite the maximum amount of weight any individual message may consume. * Messages above this weight go into the overweight queue and may only be serviced explicitly. @@ -1736,7 +1736,7 @@ declare module '@polkadot/api-base/types/submittable' { * - `origin`: Must pass `Root`. * - `new`: Desired value for `QueueConfigData.xcmp_max_individual_weight`. **/ - updateXcmpMaxIndividualWeight: AugmentedSubmittable<(updated: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u64]>; + updateXcmpMaxIndividualWeight: AugmentedSubmittable<(updated: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Weight]>; /** * Generic tx **/ diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index cdb52b3aa1..3891771381 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassWeight, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; @@ -25,7 +25,7 @@ import type { StatementKind } from '@polkadot/types/interfaces/claims'; import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective'; import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus'; import type { AliveContractInfo, CodeHash, CodeSource, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractInstantiateResultTo299, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateRequestV1, InstantiateRequestV2, InstantiateReturnValue, InstantiateReturnValueOk, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts'; -import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, ContractConstructorSpecV1, ContractConstructorSpecV2, ContractConstructorSpecV3, ContractContractSpecV0, ContractContractSpecV1, ContractContractSpecV2, ContractContractSpecV3, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpecLatest, ContractEventParamSpecV0, ContractEventParamSpecV2, ContractEventSpecLatest, ContractEventSpecV0, ContractEventSpecV1, ContractEventSpecV2, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpecLatest, ContractMessageParamSpecV0, ContractMessageParamSpecV2, ContractMessageSpecLatest, ContractMessageSpecV0, ContractMessageSpecV1, ContractMessageSpecV2, ContractMetadata, ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1, ContractMetadataV2, ContractMetadataV3, ContractProject, ContractProjectContract, ContractProjectInfo, ContractProjectSource, ContractProjectV0, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi'; +import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, ContractConstructorSpecV1, ContractConstructorSpecV2, ContractConstructorSpecV3, ContractContractSpecV0, ContractContractSpecV1, ContractContractSpecV2, ContractContractSpecV3, ContractContractSpecV4, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpecLatest, ContractEventParamSpecV0, ContractEventParamSpecV2, ContractEventSpecLatest, ContractEventSpecV0, ContractEventSpecV1, ContractEventSpecV2, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpecLatest, ContractMessageParamSpecV0, ContractMessageParamSpecV2, ContractMessageSpecLatest, ContractMessageSpecV0, ContractMessageSpecV1, ContractMessageSpecV2, ContractMetadata, ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1, ContractMetadataV2, ContractMetadataV3, ContractMetadataV4, ContractProject, ContractProjectContract, ContractProjectInfo, ContractProjectSource, ContractProjectV0, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi'; import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan'; import type { CollationInfo, CollationInfoV1, ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus'; import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy'; @@ -53,7 +53,7 @@ import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/ty import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase'; import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery'; import type { RpcMethods } from '@polkadot/types/interfaces/rpc'; -import type { AccountId, AccountId20, AccountId32, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, SlotDuration, StorageData, StorageInfo, StorageProof, TransactionInfo, TransactionLongevity, TransactionPriority, TransactionStorageProof, TransactionTag, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; +import type { AccountId, AccountId20, AccountId32, AccountId33, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, SlotDuration, StorageData, StorageInfo, StorageProof, TransactionInfo, TransactionLongevity, TransactionPriority, TransactionStorageProof, TransactionTag, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier, WeightV1, WeightV2 } from '@polkadot/types/interfaces/runtime'; import type { Si0Field, Si0LookupTypeId, Si0Path, Si0Type, Si0TypeDef, Si0TypeDefArray, Si0TypeDefBitSequence, Si0TypeDefCompact, Si0TypeDefComposite, Si0TypeDefPhantom, Si0TypeDefPrimitive, Si0TypeDefSequence, Si0TypeDefTuple, Si0TypeDefVariant, Si0TypeParameter, Si0Variant, Si1Field, Si1LookupTypeId, Si1Path, Si1Type, Si1TypeDef, Si1TypeDefArray, Si1TypeDefBitSequence, Si1TypeDefCompact, Si1TypeDefComposite, Si1TypeDefPrimitive, Si1TypeDefSequence, Si1TypeDefTuple, Si1TypeDefVariant, Si1TypeParameter, Si1Variant, SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefBitSequence, SiTypeDefCompact, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiTypeParameter, SiVariant } from '@polkadot/types/interfaces/scaleInfo'; import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler'; import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session'; @@ -79,6 +79,7 @@ declare module '@polkadot/types/types/registry' { AccountId: AccountId; AccountId20: AccountId20; AccountId32: AccountId32; + AccountId33: AccountId33; AccountIdOf: AccountIdOf; AccountIndex: AccountIndex; AccountInfo: AccountInfo; @@ -253,6 +254,7 @@ declare module '@polkadot/types/types/registry' { ContractContractSpecV1: ContractContractSpecV1; ContractContractSpecV2: ContractContractSpecV2; ContractContractSpecV3: ContractContractSpecV3; + ContractContractSpecV4: ContractContractSpecV4; ContractCryptoHasher: ContractCryptoHasher; ContractDiscriminant: ContractDiscriminant; ContractDisplayName: ContractDisplayName; @@ -296,6 +298,7 @@ declare module '@polkadot/types/types/registry' { ContractMetadataV1: ContractMetadataV1; ContractMetadataV2: ContractMetadataV2; ContractMetadataV3: ContractMetadataV3; + ContractMetadataV4: ContractMetadataV4; ContractProject: ContractProject; ContractProjectContract: ContractProjectContract; ContractProjectInfo: ContractProjectInfo; @@ -524,7 +527,7 @@ declare module '@polkadot/types/types/registry' { FrameSupportWeightsDispatchInfo: FrameSupportWeightsDispatchInfo; FrameSupportWeightsPays: FrameSupportWeightsPays; FrameSupportWeightsPerDispatchClassU32: FrameSupportWeightsPerDispatchClassU32; - FrameSupportWeightsPerDispatchClassU64: FrameSupportWeightsPerDispatchClassU64; + FrameSupportWeightsPerDispatchClassWeight: FrameSupportWeightsPerDispatchClassWeight; FrameSupportWeightsPerDispatchClassWeightsPerClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; FrameSupportWeightsRuntimeDbWeight: FrameSupportWeightsRuntimeDbWeight; FrameSystemAccountInfo: FrameSystemAccountInfo; @@ -1375,6 +1378,8 @@ declare module '@polkadot/types/types/registry' { WeightMultiplier: WeightMultiplier; WeightPerClass: WeightPerClass; WeightToFeeCoefficient: WeightToFeeCoefficient; + WeightV1: WeightV1; + WeightV2: WeightV2; WildFungibility: WildFungibility; WildFungibilityV0: WildFungibilityV0; WildFungibilityV1: WildFungibilityV1; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index b0c254d7c2..4c6e18b78e 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -3,7 +3,7 @@ import type { BTreeMap, BTreeSet, Bytes, Compact, Enum, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { ITuple } from '@polkadot/types-codec/types'; -import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; +import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill, Weight } from '@polkadot/types/interfaces/runtime'; import type { Event } from '@polkadot/types/interfaces/system'; /** @name CumulusPalletDmpQueueCall */ @@ -11,14 +11,14 @@ export interface CumulusPalletDmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { readonly index: u64; - readonly weightLimit: u64; + readonly weightLimit: Weight; } & Struct; readonly type: 'ServiceOverweight'; } /** @name CumulusPalletDmpQueueConfigData */ export interface CumulusPalletDmpQueueConfigData extends Struct { - readonly maxIndividual: u64; + readonly maxIndividual: Weight; } /** @name CumulusPalletDmpQueueError */ @@ -46,19 +46,19 @@ export interface CumulusPalletDmpQueueEvent extends Enum { readonly isWeightExhausted: boolean; readonly asWeightExhausted: { readonly messageId: U8aFixed; - readonly remainingWeight: u64; - readonly requiredWeight: u64; + readonly remainingWeight: Weight; + readonly requiredWeight: Weight; } & Struct; readonly isOverweightEnqueued: boolean; readonly asOverweightEnqueued: { readonly messageId: U8aFixed; readonly overweightIndex: u64; - readonly requiredWeight: u64; + readonly requiredWeight: Weight; } & Struct; readonly isOverweightServiced: boolean; readonly asOverweightServiced: { readonly overweightIndex: u64; - readonly weightUsed: u64; + readonly weightUsed: Weight; } & Struct; readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced'; } @@ -122,7 +122,7 @@ export interface CumulusPalletParachainSystemEvent extends Enum { } & Struct; readonly isDownwardMessagesProcessed: boolean; readonly asDownwardMessagesProcessed: { - readonly weightUsed: u64; + readonly weightUsed: Weight; readonly dmqHead: H256; } & Struct; readonly type: 'ValidationFunctionStored' | 'ValidationFunctionApplied' | 'ValidationFunctionDiscarded' | 'UpgradeAuthorized' | 'DownwardMessagesReceived' | 'DownwardMessagesProcessed'; @@ -166,7 +166,7 @@ export interface CumulusPalletXcmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { readonly index: u64; - readonly weightLimit: u64; + readonly weightLimit: Weight; } & Struct; readonly isSuspendXcmExecution: boolean; readonly isResumeXcmExecution: boolean; @@ -184,15 +184,15 @@ export interface CumulusPalletXcmpQueueCall extends Enum { } & Struct; readonly isUpdateThresholdWeight: boolean; readonly asUpdateThresholdWeight: { - readonly new_: u64; + readonly new_: Weight; } & Struct; readonly isUpdateWeightRestrictDecay: boolean; readonly asUpdateWeightRestrictDecay: { - readonly new_: u64; + readonly new_: Weight; } & Struct; readonly isUpdateXcmpMaxIndividualWeight: boolean; readonly asUpdateXcmpMaxIndividualWeight: { - readonly new_: u64; + readonly new_: Weight; } & Struct; readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight'; } @@ -212,13 +212,13 @@ export interface CumulusPalletXcmpQueueEvent extends Enum { readonly isSuccess: boolean; readonly asSuccess: { readonly messageHash: Option; - readonly weight: u64; + readonly weight: Weight; } & Struct; readonly isFail: boolean; readonly asFail: { readonly messageHash: Option; readonly error: XcmV2TraitsError; - readonly weight: u64; + readonly weight: Weight; } & Struct; readonly isBadVersion: boolean; readonly asBadVersion: { @@ -241,12 +241,12 @@ export interface CumulusPalletXcmpQueueEvent extends Enum { readonly sender: u32; readonly sentAt: u32; readonly index: u64; - readonly required: u64; + readonly required: Weight; } & Struct; readonly isOverweightServiced: boolean; readonly asOverweightServiced: { readonly index: u64; - readonly used: u64; + readonly used: Weight; } & Struct; readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced'; } @@ -286,9 +286,9 @@ export interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; readonly resumeThreshold: u32; - readonly thresholdWeight: u64; - readonly weightRestrictDecay: u64; - readonly xcmpMaxIndividualWeight: u64; + readonly thresholdWeight: Weight; + readonly weightRestrictDecay: Weight; + readonly xcmpMaxIndividualWeight: Weight; } /** @name CumulusPrimitivesParachainInherentParachainInherentData */ @@ -546,7 +546,7 @@ export interface FrameSupportWeightsDispatchClass extends Enum { /** @name FrameSupportWeightsDispatchInfo */ export interface FrameSupportWeightsDispatchInfo extends Struct { - readonly weight: u64; + readonly weight: Weight; readonly class: FrameSupportWeightsDispatchClass; readonly paysFee: FrameSupportWeightsPays; } @@ -565,11 +565,11 @@ export interface FrameSupportWeightsPerDispatchClassU32 extends Struct { readonly mandatory: u32; } -/** @name FrameSupportWeightsPerDispatchClassU64 */ -export interface FrameSupportWeightsPerDispatchClassU64 extends Struct { - readonly normal: u64; - readonly operational: u64; - readonly mandatory: u64; +/** @name FrameSupportWeightsPerDispatchClassWeight */ +export interface FrameSupportWeightsPerDispatchClassWeight extends Struct { + readonly normal: Weight; + readonly operational: Weight; + readonly mandatory: Weight; } /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass */ @@ -710,17 +710,17 @@ export interface FrameSystemLimitsBlockLength extends Struct { /** @name FrameSystemLimitsBlockWeights */ export interface FrameSystemLimitsBlockWeights extends Struct { - readonly baseBlock: u64; - readonly maxBlock: u64; + readonly baseBlock: Weight; + readonly maxBlock: Weight; readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; } /** @name FrameSystemLimitsWeightsPerClass */ export interface FrameSystemLimitsWeightsPerClass extends Struct { - readonly baseExtrinsic: u64; - readonly maxExtrinsic: Option; - readonly maxTotal: Option; - readonly reserved: Option; + readonly baseExtrinsic: Weight; + readonly maxExtrinsic: Option; + readonly maxTotal: Option; + readonly reserved: Option; } /** @name FrameSystemPhase */ @@ -1929,7 +1929,7 @@ export interface PalletSudoCall extends Enum { readonly isSudoUncheckedWeight: boolean; readonly asSudoUncheckedWeight: { readonly call: Call; - readonly weight: u64; + readonly weight: Weight; } & Struct; readonly isSetKey: boolean; readonly asSetKey: { @@ -2372,7 +2372,7 @@ export interface PalletXcmCall extends Enum { readonly isExecute: boolean; readonly asExecute: { readonly message: XcmVersionedXcm; - readonly maxWeight: u64; + readonly maxWeight: Weight; } & Struct; readonly isForceXcmVersion: boolean; readonly asForceXcmVersion: { @@ -2441,7 +2441,7 @@ export interface PalletXcmEvent extends Enum { readonly isNotified: boolean; readonly asNotified: ITuple<[u64, u8, u8]>; readonly isNotifyOverweight: boolean; - readonly asNotifyOverweight: ITuple<[u64, u8, u8, u64, u64]>; + readonly asNotifyOverweight: ITuple<[u64, u8, u8, Weight, Weight]>; readonly isNotifyDispatchError: boolean; readonly asNotifyDispatchError: ITuple<[u64, u8, u8]>; readonly isNotifyDecodeFailed: boolean; diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index b3f8bd3974..b72630896c 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -24,21 +24,21 @@ export default { feeFrozen: 'u128' }, /** - * Lookup7: frame_support::weights::PerDispatchClass + * Lookup7: frame_support::weights::PerDispatchClass **/ - FrameSupportWeightsPerDispatchClassU64: { - normal: 'u64', - operational: 'u64', - mandatory: 'u64' + FrameSupportWeightsPerDispatchClassWeight: { + normal: 'Weight', + operational: 'Weight', + mandatory: 'Weight' }, /** - * Lookup11: sp_runtime::generic::digest::Digest + * Lookup12: sp_runtime::generic::digest::Digest **/ SpRuntimeDigest: { logs: 'Vec' }, /** - * Lookup13: sp_runtime::generic::digest::DigestItem + * Lookup14: sp_runtime::generic::digest::DigestItem **/ SpRuntimeDigestDigestItem: { _enum: { @@ -54,7 +54,7 @@ export default { } }, /** - * Lookup16: frame_system::EventRecord + * Lookup17: frame_system::EventRecord **/ FrameSystemEventRecord: { phase: 'FrameSystemPhase', @@ -62,7 +62,7 @@ export default { topics: 'Vec' }, /** - * Lookup18: frame_system::pallet::Event + * Lookup19: frame_system::pallet::Event **/ FrameSystemEvent: { _enum: { @@ -90,27 +90,27 @@ export default { } }, /** - * Lookup19: frame_support::weights::DispatchInfo + * Lookup20: frame_support::weights::DispatchInfo **/ FrameSupportWeightsDispatchInfo: { - weight: 'u64', + weight: 'Weight', class: 'FrameSupportWeightsDispatchClass', paysFee: 'FrameSupportWeightsPays' }, /** - * Lookup20: frame_support::weights::DispatchClass + * Lookup21: frame_support::weights::DispatchClass **/ FrameSupportWeightsDispatchClass: { _enum: ['Normal', 'Operational', 'Mandatory'] }, /** - * Lookup21: frame_support::weights::Pays + * Lookup22: frame_support::weights::Pays **/ FrameSupportWeightsPays: { _enum: ['Yes', 'No'] }, /** - * Lookup22: sp_runtime::DispatchError + * Lookup23: sp_runtime::DispatchError **/ SpRuntimeDispatchError: { _enum: { @@ -127,32 +127,32 @@ export default { } }, /** - * Lookup23: sp_runtime::ModuleError + * Lookup24: sp_runtime::ModuleError **/ SpRuntimeModuleError: { index: 'u8', error: '[u8;4]' }, /** - * Lookup24: sp_runtime::TokenError + * Lookup25: sp_runtime::TokenError **/ SpRuntimeTokenError: { _enum: ['NoFunds', 'WouldDie', 'BelowMinimum', 'CannotCreate', 'UnknownAsset', 'Frozen', 'Unsupported'] }, /** - * Lookup25: sp_runtime::ArithmeticError + * Lookup26: sp_runtime::ArithmeticError **/ SpRuntimeArithmeticError: { _enum: ['Underflow', 'Overflow', 'DivisionByZero'] }, /** - * Lookup26: sp_runtime::TransactionalError + * Lookup27: sp_runtime::TransactionalError **/ SpRuntimeTransactionalError: { _enum: ['LimitReached', 'NoLayer'] }, /** - * Lookup27: cumulus_pallet_parachain_system::pallet::Event + * Lookup28: cumulus_pallet_parachain_system::pallet::Event **/ CumulusPalletParachainSystemEvent: { _enum: { @@ -168,13 +168,13 @@ export default { count: 'u32', }, DownwardMessagesProcessed: { - weightUsed: 'u64', + weightUsed: 'Weight', dmqHead: 'H256' } } }, /** - * Lookup28: pallet_balances::pallet::Event + * Lookup29: pallet_balances::pallet::Event **/ PalletBalancesEvent: { _enum: { @@ -225,13 +225,13 @@ export default { } }, /** - * Lookup29: frame_support::traits::tokens::misc::BalanceStatus + * Lookup30: frame_support::traits::tokens::misc::BalanceStatus **/ FrameSupportTokensMiscBalanceStatus: { _enum: ['Free', 'Reserved'] }, /** - * Lookup30: pallet_transaction_payment::pallet::Event + * Lookup31: pallet_transaction_payment::pallet::Event **/ PalletTransactionPaymentEvent: { _enum: { @@ -243,7 +243,7 @@ export default { } }, /** - * Lookup31: pallet_treasury::pallet::Event + * Lookup32: pallet_treasury::pallet::Event **/ PalletTreasuryEvent: { _enum: { @@ -279,7 +279,7 @@ export default { } }, /** - * Lookup32: pallet_sudo::pallet::Event + * Lookup33: pallet_sudo::pallet::Event **/ PalletSudoEvent: { _enum: { @@ -295,7 +295,7 @@ export default { } }, /** - * Lookup36: orml_vesting::module::Event + * Lookup37: orml_vesting::module::Event **/ OrmlVestingModuleEvent: { _enum: { @@ -314,7 +314,7 @@ export default { } }, /** - * Lookup37: orml_vesting::VestingSchedule + * Lookup38: orml_vesting::VestingSchedule **/ OrmlVestingVestingSchedule: { start: 'u32', @@ -323,7 +323,7 @@ export default { perPeriod: 'Compact' }, /** - * Lookup39: orml_xtokens::module::Event + * Lookup40: orml_xtokens::module::Event **/ OrmlXtokensModuleEvent: { _enum: { @@ -336,18 +336,18 @@ export default { } }, /** - * Lookup40: xcm::v1::multiasset::MultiAssets + * Lookup41: xcm::v1::multiasset::MultiAssets **/ XcmV1MultiassetMultiAssets: 'Vec', /** - * Lookup42: xcm::v1::multiasset::MultiAsset + * Lookup43: xcm::v1::multiasset::MultiAsset **/ XcmV1MultiAsset: { id: 'XcmV1MultiassetAssetId', fun: 'XcmV1MultiassetFungibility' }, /** - * Lookup43: xcm::v1::multiasset::AssetId + * Lookup44: xcm::v1::multiasset::AssetId **/ XcmV1MultiassetAssetId: { _enum: { @@ -356,14 +356,14 @@ export default { } }, /** - * Lookup44: xcm::v1::multilocation::MultiLocation + * Lookup45: xcm::v1::multilocation::MultiLocation **/ XcmV1MultiLocation: { parents: 'u8', interior: 'XcmV1MultilocationJunctions' }, /** - * Lookup45: xcm::v1::multilocation::Junctions + * Lookup46: xcm::v1::multilocation::Junctions **/ XcmV1MultilocationJunctions: { _enum: { @@ -379,7 +379,7 @@ export default { } }, /** - * Lookup46: xcm::v1::junction::Junction + * Lookup47: xcm::v1::junction::Junction **/ XcmV1Junction: { _enum: { @@ -407,7 +407,7 @@ export default { } }, /** - * Lookup48: xcm::v0::junction::NetworkId + * Lookup49: xcm::v0::junction::NetworkId **/ XcmV0JunctionNetworkId: { _enum: { @@ -418,7 +418,7 @@ export default { } }, /** - * Lookup52: xcm::v0::junction::BodyId + * Lookup53: xcm::v0::junction::BodyId **/ XcmV0JunctionBodyId: { _enum: { @@ -432,7 +432,7 @@ export default { } }, /** - * Lookup53: xcm::v0::junction::BodyPart + * Lookup54: xcm::v0::junction::BodyPart **/ XcmV0JunctionBodyPart: { _enum: { @@ -455,7 +455,7 @@ export default { } }, /** - * Lookup54: xcm::v1::multiasset::Fungibility + * Lookup55: xcm::v1::multiasset::Fungibility **/ XcmV1MultiassetFungibility: { _enum: { @@ -464,7 +464,7 @@ export default { } }, /** - * Lookup55: xcm::v1::multiasset::AssetInstance + * Lookup56: xcm::v1::multiasset::AssetInstance **/ XcmV1MultiassetAssetInstance: { _enum: { @@ -478,7 +478,7 @@ export default { } }, /** - * Lookup58: orml_tokens::module::Event + * Lookup59: orml_tokens::module::Event **/ OrmlTokensModuleEvent: { _enum: { @@ -555,7 +555,7 @@ export default { } }, /** - * Lookup59: pallet_foreign_assets::AssetIds + * Lookup60: pallet_foreign_assets::AssetIds **/ PalletForeignAssetsAssetIds: { _enum: { @@ -564,24 +564,24 @@ export default { } }, /** - * Lookup60: pallet_foreign_assets::NativeCurrency + * Lookup61: pallet_foreign_assets::NativeCurrency **/ PalletForeignAssetsNativeCurrency: { _enum: ['Here', 'Parent'] }, /** - * Lookup61: cumulus_pallet_xcmp_queue::pallet::Event + * Lookup62: cumulus_pallet_xcmp_queue::pallet::Event **/ CumulusPalletXcmpQueueEvent: { _enum: { Success: { messageHash: 'Option', - weight: 'u64', + weight: 'Weight', }, Fail: { messageHash: 'Option', error: 'XcmV2TraitsError', - weight: 'u64', + weight: 'Weight', }, BadVersion: { messageHash: 'Option', @@ -599,16 +599,16 @@ export default { sender: 'u32', sentAt: 'u32', index: 'u64', - required: 'u64', + required: 'Weight', }, OverweightServiced: { index: 'u64', - used: 'u64' + used: 'Weight' } } }, /** - * Lookup63: xcm::v2::traits::Error + * Lookup64: xcm::v2::traits::Error **/ XcmV2TraitsError: { _enum: { @@ -641,7 +641,7 @@ export default { } }, /** - * Lookup65: pallet_xcm::pallet::Event + * Lookup66: pallet_xcm::pallet::Event **/ PalletXcmEvent: { _enum: { @@ -650,7 +650,7 @@ export default { UnexpectedResponse: '(XcmV1MultiLocation,u64)', ResponseReady: '(u64,XcmV2Response)', Notified: '(u64,u8,u8)', - NotifyOverweight: '(u64,u8,u8,u64,u64)', + NotifyOverweight: '(u64,u8,u8,Weight,Weight)', NotifyDispatchError: '(u64,u8,u8)', NotifyDecodeFailed: '(u64,u8,u8)', InvalidResponder: '(XcmV1MultiLocation,u64,Option)', @@ -664,7 +664,7 @@ export default { } }, /** - * Lookup66: xcm::v2::traits::Outcome + * Lookup67: xcm::v2::traits::Outcome **/ XcmV2TraitsOutcome: { _enum: { @@ -674,11 +674,11 @@ export default { } }, /** - * Lookup67: xcm::v2::Xcm + * Lookup68: xcm::v2::Xcm **/ XcmV2Xcm: 'Vec', /** - * Lookup69: xcm::v2::Instruction + * Lookup70: xcm::v2::Instruction **/ XcmV2Instruction: { _enum: { @@ -776,7 +776,7 @@ export default { } }, /** - * Lookup70: xcm::v2::Response + * Lookup71: xcm::v2::Response **/ XcmV2Response: { _enum: { @@ -787,19 +787,19 @@ export default { } }, /** - * Lookup73: xcm::v0::OriginKind + * Lookup74: xcm::v0::OriginKind **/ XcmV0OriginKind: { _enum: ['Native', 'SovereignAccount', 'Superuser', 'Xcm'] }, /** - * Lookup74: xcm::double_encoded::DoubleEncoded + * Lookup75: xcm::double_encoded::DoubleEncoded **/ XcmDoubleEncoded: { encoded: 'Bytes' }, /** - * Lookup75: xcm::v1::multiasset::MultiAssetFilter + * Lookup76: xcm::v1::multiasset::MultiAssetFilter **/ XcmV1MultiassetMultiAssetFilter: { _enum: { @@ -808,7 +808,7 @@ export default { } }, /** - * Lookup76: xcm::v1::multiasset::WildMultiAsset + * Lookup77: xcm::v1::multiasset::WildMultiAsset **/ XcmV1MultiassetWildMultiAsset: { _enum: { @@ -820,13 +820,13 @@ export default { } }, /** - * Lookup77: xcm::v1::multiasset::WildFungibility + * Lookup78: xcm::v1::multiasset::WildFungibility **/ XcmV1MultiassetWildFungibility: { _enum: ['Fungible', 'NonFungible'] }, /** - * Lookup78: xcm::v2::WeightLimit + * Lookup79: xcm::v2::WeightLimit **/ XcmV2WeightLimit: { _enum: { @@ -835,7 +835,7 @@ export default { } }, /** - * Lookup80: xcm::VersionedMultiAssets + * Lookup81: xcm::VersionedMultiAssets **/ XcmVersionedMultiAssets: { _enum: { @@ -844,7 +844,7 @@ export default { } }, /** - * Lookup82: xcm::v0::multi_asset::MultiAsset + * Lookup83: xcm::v0::multi_asset::MultiAsset **/ XcmV0MultiAsset: { _enum: { @@ -883,7 +883,7 @@ export default { } }, /** - * Lookup83: xcm::v0::multi_location::MultiLocation + * Lookup84: xcm::v0::multi_location::MultiLocation **/ XcmV0MultiLocation: { _enum: { @@ -899,7 +899,7 @@ export default { } }, /** - * Lookup84: xcm::v0::junction::Junction + * Lookup85: xcm::v0::junction::Junction **/ XcmV0Junction: { _enum: { @@ -928,7 +928,7 @@ export default { } }, /** - * Lookup85: xcm::VersionedMultiLocation + * Lookup86: xcm::VersionedMultiLocation **/ XcmVersionedMultiLocation: { _enum: { @@ -937,7 +937,7 @@ export default { } }, /** - * Lookup86: cumulus_pallet_xcm::pallet::Event + * Lookup87: cumulus_pallet_xcm::pallet::Event **/ CumulusPalletXcmEvent: { _enum: { @@ -947,7 +947,7 @@ export default { } }, /** - * Lookup87: cumulus_pallet_dmp_queue::pallet::Event + * Lookup88: cumulus_pallet_dmp_queue::pallet::Event **/ CumulusPalletDmpQueueEvent: { _enum: { @@ -963,22 +963,22 @@ export default { }, WeightExhausted: { messageId: '[u8;32]', - remainingWeight: 'u64', - requiredWeight: 'u64', + remainingWeight: 'Weight', + requiredWeight: 'Weight', }, OverweightEnqueued: { messageId: '[u8;32]', overweightIndex: 'u64', - requiredWeight: 'u64', + requiredWeight: 'Weight', }, OverweightServiced: { overweightIndex: 'u64', - weightUsed: 'u64' + weightUsed: 'Weight' } } }, /** - * Lookup88: pallet_unique::RawEvent> + * Lookup89: pallet_unique::RawEvent> **/ PalletUniqueRawEvent: { _enum: { @@ -995,7 +995,7 @@ export default { } }, /** - * Lookup89: pallet_evm::account::BasicCrossAccountIdRepr + * Lookup90: pallet_evm::account::BasicCrossAccountIdRepr **/ PalletEvmAccountBasicCrossAccountIdRepr: { _enum: { @@ -1004,7 +1004,7 @@ export default { } }, /** - * Lookup92: pallet_unique_scheduler::pallet::Event + * Lookup93: pallet_unique_scheduler::pallet::Event **/ PalletUniqueSchedulerEvent: { _enum: { @@ -1029,13 +1029,13 @@ export default { } }, /** - * Lookup95: frame_support::traits::schedule::LookupError + * Lookup96: frame_support::traits::schedule::LookupError **/ FrameSupportScheduleLookupError: { _enum: ['Unknown', 'BadFormat'] }, /** - * Lookup96: pallet_common::pallet::Event + * Lookup97: pallet_common::pallet::Event **/ PalletCommonEvent: { _enum: { @@ -1053,7 +1053,7 @@ export default { } }, /** - * Lookup99: pallet_structure::pallet::Event + * Lookup100: pallet_structure::pallet::Event **/ PalletStructureEvent: { _enum: { @@ -1061,7 +1061,7 @@ export default { } }, /** - * Lookup100: pallet_rmrk_core::pallet::Event + * Lookup101: pallet_rmrk_core::pallet::Event **/ PalletRmrkCoreEvent: { _enum: { @@ -1138,7 +1138,7 @@ export default { } }, /** - * Lookup101: rmrk_traits::nft::AccountIdOrCollectionNftTuple + * Lookup102: rmrk_traits::nft::AccountIdOrCollectionNftTuple **/ RmrkTraitsNftAccountIdOrCollectionNftTuple: { _enum: { @@ -1147,7 +1147,7 @@ export default { } }, /** - * Lookup106: pallet_rmrk_equip::pallet::Event + * Lookup107: pallet_rmrk_equip::pallet::Event **/ PalletRmrkEquipEvent: { _enum: { @@ -1162,7 +1162,7 @@ export default { } }, /** - * Lookup107: pallet_app_promotion::pallet::Event + * Lookup108: pallet_app_promotion::pallet::Event **/ PalletAppPromotionEvent: { _enum: { @@ -1173,7 +1173,7 @@ export default { } }, /** - * Lookup108: pallet_foreign_assets::module::Event + * Lookup109: pallet_foreign_assets::module::Event **/ PalletForeignAssetsModuleEvent: { _enum: { @@ -1198,7 +1198,7 @@ export default { } }, /** - * Lookup109: pallet_foreign_assets::module::AssetMetadata + * Lookup110: pallet_foreign_assets::module::AssetMetadata **/ PalletForeignAssetsModuleAssetMetadata: { name: 'Bytes', @@ -1207,7 +1207,7 @@ export default { minimalBalance: 'u128' }, /** - * Lookup110: pallet_evm::pallet::Event + * Lookup111: pallet_evm::pallet::Event **/ PalletEvmEvent: { _enum: { @@ -1221,7 +1221,7 @@ export default { } }, /** - * Lookup111: ethereum::log::Log + * Lookup112: ethereum::log::Log **/ EthereumLog: { address: 'H160', @@ -1229,7 +1229,7 @@ export default { data: 'Bytes' }, /** - * Lookup115: pallet_ethereum::pallet::Event + * Lookup116: pallet_ethereum::pallet::Event **/ PalletEthereumEvent: { _enum: { @@ -1237,7 +1237,7 @@ export default { } }, /** - * Lookup116: evm_core::error::ExitReason + * Lookup117: evm_core::error::ExitReason **/ EvmCoreErrorExitReason: { _enum: { @@ -1248,13 +1248,13 @@ export default { } }, /** - * Lookup117: evm_core::error::ExitSucceed + * Lookup118: evm_core::error::ExitSucceed **/ EvmCoreErrorExitSucceed: { _enum: ['Stopped', 'Returned', 'Suicided'] }, /** - * Lookup118: evm_core::error::ExitError + * Lookup119: evm_core::error::ExitError **/ EvmCoreErrorExitError: { _enum: { @@ -1276,13 +1276,13 @@ export default { } }, /** - * Lookup121: evm_core::error::ExitRevert + * Lookup122: evm_core::error::ExitRevert **/ EvmCoreErrorExitRevert: { _enum: ['Reverted'] }, /** - * Lookup122: evm_core::error::ExitFatal + * Lookup123: evm_core::error::ExitFatal **/ EvmCoreErrorExitFatal: { _enum: { @@ -1293,7 +1293,7 @@ export default { } }, /** - * Lookup123: pallet_evm_contract_helpers::pallet::Event + * Lookup124: pallet_evm_contract_helpers::pallet::Event **/ PalletEvmContractHelpersEvent: { _enum: { @@ -1303,7 +1303,7 @@ export default { } }, /** - * Lookup124: frame_system::Phase + * Lookup125: frame_system::Phase **/ FrameSystemPhase: { _enum: { @@ -1313,14 +1313,14 @@ export default { } }, /** - * Lookup126: frame_system::LastRuntimeUpgradeInfo + * Lookup127: frame_system::LastRuntimeUpgradeInfo **/ FrameSystemLastRuntimeUpgradeInfo: { specVersion: 'Compact', specName: 'Text' }, /** - * Lookup127: frame_system::pallet::Call + * Lookup128: frame_system::pallet::Call **/ FrameSystemCall: { _enum: { @@ -1358,15 +1358,15 @@ export default { } }, /** - * Lookup132: frame_system::limits::BlockWeights + * Lookup133: frame_system::limits::BlockWeights **/ FrameSystemLimitsBlockWeights: { - baseBlock: 'u64', - maxBlock: 'u64', + baseBlock: 'Weight', + maxBlock: 'Weight', perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass' }, /** - * Lookup133: frame_support::weights::PerDispatchClass + * Lookup134: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassWeightsPerClass: { normal: 'FrameSystemLimitsWeightsPerClass', @@ -1374,22 +1374,22 @@ export default { mandatory: 'FrameSystemLimitsWeightsPerClass' }, /** - * Lookup134: frame_system::limits::WeightsPerClass + * Lookup135: frame_system::limits::WeightsPerClass **/ FrameSystemLimitsWeightsPerClass: { - baseExtrinsic: 'u64', - maxExtrinsic: 'Option', - maxTotal: 'Option', - reserved: 'Option' + baseExtrinsic: 'Weight', + maxExtrinsic: 'Option', + maxTotal: 'Option', + reserved: 'Option' }, /** - * Lookup136: frame_system::limits::BlockLength + * Lookup137: frame_system::limits::BlockLength **/ FrameSystemLimitsBlockLength: { max: 'FrameSupportWeightsPerDispatchClassU32' }, /** - * Lookup137: frame_support::weights::PerDispatchClass + * Lookup138: frame_support::weights::PerDispatchClass **/ FrameSupportWeightsPerDispatchClassU32: { normal: 'u32', @@ -1397,14 +1397,14 @@ export default { mandatory: 'u32' }, /** - * Lookup138: frame_support::weights::RuntimeDbWeight + * Lookup139: frame_support::weights::RuntimeDbWeight **/ FrameSupportWeightsRuntimeDbWeight: { read: 'u64', write: 'u64' }, /** - * Lookup139: sp_version::RuntimeVersion + * Lookup140: sp_version::RuntimeVersion **/ SpVersionRuntimeVersion: { specName: 'Text', @@ -1417,13 +1417,13 @@ export default { stateVersion: 'u8' }, /** - * Lookup144: frame_system::pallet::Error + * Lookup145: frame_system::pallet::Error **/ FrameSystemError: { _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] }, /** - * Lookup145: polkadot_primitives::v2::PersistedValidationData + * Lookup146: polkadot_primitives::v2::PersistedValidationData **/ PolkadotPrimitivesV2PersistedValidationData: { parentHead: 'Bytes', @@ -1432,19 +1432,19 @@ export default { maxPovSize: 'u32' }, /** - * Lookup148: polkadot_primitives::v2::UpgradeRestriction + * Lookup149: polkadot_primitives::v2::UpgradeRestriction **/ PolkadotPrimitivesV2UpgradeRestriction: { _enum: ['Present'] }, /** - * Lookup149: sp_trie::storage_proof::StorageProof + * Lookup150: sp_trie::storage_proof::StorageProof **/ SpTrieStorageProof: { trieNodes: 'BTreeSet' }, /** - * Lookup151: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot + * Lookup152: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot **/ CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: { dmqMqcHead: 'H256', @@ -1453,7 +1453,7 @@ export default { egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>' }, /** - * Lookup154: polkadot_primitives::v2::AbridgedHrmpChannel + * Lookup155: polkadot_primitives::v2::AbridgedHrmpChannel **/ PolkadotPrimitivesV2AbridgedHrmpChannel: { maxCapacity: 'u32', @@ -1464,7 +1464,7 @@ export default { mqcHead: 'Option' }, /** - * Lookup155: polkadot_primitives::v2::AbridgedHostConfiguration + * Lookup156: polkadot_primitives::v2::AbridgedHostConfiguration **/ PolkadotPrimitivesV2AbridgedHostConfiguration: { maxCodeSize: 'u32', @@ -1478,14 +1478,14 @@ export default { validationUpgradeDelay: 'u32' }, /** - * Lookup161: polkadot_core_primitives::OutboundHrmpMessage + * Lookup162: polkadot_core_primitives::OutboundHrmpMessage **/ PolkadotCorePrimitivesOutboundHrmpMessage: { recipient: 'u32', data: 'Bytes' }, /** - * Lookup162: cumulus_pallet_parachain_system::pallet::Call + * Lookup163: cumulus_pallet_parachain_system::pallet::Call **/ CumulusPalletParachainSystemCall: { _enum: { @@ -1504,7 +1504,7 @@ export default { } }, /** - * Lookup163: cumulus_primitives_parachain_inherent::ParachainInherentData + * Lookup164: cumulus_primitives_parachain_inherent::ParachainInherentData **/ CumulusPrimitivesParachainInherentParachainInherentData: { validationData: 'PolkadotPrimitivesV2PersistedValidationData', @@ -1513,27 +1513,27 @@ export default { horizontalMessages: 'BTreeMap>' }, /** - * Lookup165: polkadot_core_primitives::InboundDownwardMessage + * Lookup166: polkadot_core_primitives::InboundDownwardMessage **/ PolkadotCorePrimitivesInboundDownwardMessage: { sentAt: 'u32', msg: 'Bytes' }, /** - * Lookup168: polkadot_core_primitives::InboundHrmpMessage + * Lookup169: polkadot_core_primitives::InboundHrmpMessage **/ PolkadotCorePrimitivesInboundHrmpMessage: { sentAt: 'u32', data: 'Bytes' }, /** - * Lookup171: cumulus_pallet_parachain_system::pallet::Error + * Lookup172: cumulus_pallet_parachain_system::pallet::Error **/ CumulusPalletParachainSystemError: { _enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized'] }, /** - * Lookup173: pallet_balances::BalanceLock + * Lookup174: pallet_balances::BalanceLock **/ PalletBalancesBalanceLock: { id: '[u8;8]', @@ -1541,26 +1541,26 @@ export default { reasons: 'PalletBalancesReasons' }, /** - * Lookup174: pallet_balances::Reasons + * Lookup175: pallet_balances::Reasons **/ PalletBalancesReasons: { _enum: ['Fee', 'Misc', 'All'] }, /** - * Lookup177: pallet_balances::ReserveData + * Lookup178: pallet_balances::ReserveData **/ PalletBalancesReserveData: { id: '[u8;16]', amount: 'u128' }, /** - * Lookup179: pallet_balances::Releases + * Lookup180: pallet_balances::Releases **/ PalletBalancesReleases: { _enum: ['V1_0_0', 'V2_0_0'] }, /** - * Lookup180: pallet_balances::pallet::Call + * Lookup181: pallet_balances::pallet::Call **/ PalletBalancesCall: { _enum: { @@ -1593,13 +1593,13 @@ export default { } }, /** - * Lookup183: pallet_balances::pallet::Error + * Lookup184: pallet_balances::pallet::Error **/ PalletBalancesError: { _enum: ['VestingBalance', 'LiquidityRestrictions', 'InsufficientBalance', 'ExistentialDeposit', 'KeepAlive', 'ExistingVestingSchedule', 'DeadAccount', 'TooManyReserves'] }, /** - * Lookup185: pallet_timestamp::pallet::Call + * Lookup186: pallet_timestamp::pallet::Call **/ PalletTimestampCall: { _enum: { @@ -1609,13 +1609,13 @@ export default { } }, /** - * Lookup187: pallet_transaction_payment::Releases + * Lookup188: pallet_transaction_payment::Releases **/ PalletTransactionPaymentReleases: { _enum: ['V1Ancient', 'V2'] }, /** - * Lookup188: pallet_treasury::Proposal + * Lookup189: pallet_treasury::Proposal **/ PalletTreasuryProposal: { proposer: 'AccountId32', @@ -1624,7 +1624,7 @@ export default { bond: 'u128' }, /** - * Lookup191: pallet_treasury::pallet::Call + * Lookup192: pallet_treasury::pallet::Call **/ PalletTreasuryCall: { _enum: { @@ -1648,17 +1648,17 @@ export default { } }, /** - * Lookup194: frame_support::PalletId + * Lookup195: frame_support::PalletId **/ FrameSupportPalletId: '[u8;8]', /** - * Lookup195: pallet_treasury::pallet::Error + * Lookup196: pallet_treasury::pallet::Error **/ PalletTreasuryError: { _enum: ['InsufficientProposersBalance', 'InvalidIndex', 'TooManyApprovals', 'InsufficientPermission', 'ProposalNotApproved'] }, /** - * Lookup196: pallet_sudo::pallet::Call + * Lookup197: pallet_sudo::pallet::Call **/ PalletSudoCall: { _enum: { @@ -1667,7 +1667,7 @@ export default { }, sudo_unchecked_weight: { call: 'Call', - weight: 'u64', + weight: 'Weight', }, set_key: { _alias: { @@ -1682,7 +1682,7 @@ export default { } }, /** - * Lookup198: orml_vesting::module::Call + * Lookup199: orml_vesting::module::Call **/ OrmlVestingModuleCall: { _enum: { @@ -1701,7 +1701,7 @@ export default { } }, /** - * Lookup200: orml_xtokens::module::Call + * Lookup201: orml_xtokens::module::Call **/ OrmlXtokensModuleCall: { _enum: { @@ -1744,7 +1744,7 @@ export default { } }, /** - * Lookup201: xcm::VersionedMultiAsset + * Lookup202: xcm::VersionedMultiAsset **/ XcmVersionedMultiAsset: { _enum: { @@ -1753,7 +1753,7 @@ export default { } }, /** - * Lookup204: orml_tokens::module::Call + * Lookup205: orml_tokens::module::Call **/ OrmlTokensModuleCall: { _enum: { @@ -1787,13 +1787,13 @@ export default { } }, /** - * Lookup205: cumulus_pallet_xcmp_queue::pallet::Call + * Lookup206: cumulus_pallet_xcmp_queue::pallet::Call **/ CumulusPalletXcmpQueueCall: { _enum: { service_overweight: { index: 'u64', - weightLimit: 'u64', + weightLimit: 'Weight', }, suspend_xcm_execution: 'Null', resume_xcm_execution: 'Null', @@ -1819,24 +1819,24 @@ export default { _alias: { new_: 'new', }, - new_: 'u64', + new_: 'Weight', }, update_weight_restrict_decay: { _alias: { new_: 'new', }, - new_: 'u64', + new_: 'Weight', }, update_xcmp_max_individual_weight: { _alias: { new_: 'new', }, - new_: 'u64' + new_: 'Weight' } } }, /** - * Lookup206: pallet_xcm::pallet::Call + * Lookup207: pallet_xcm::pallet::Call **/ PalletXcmCall: { _enum: { @@ -1858,7 +1858,7 @@ export default { }, execute: { message: 'XcmVersionedXcm', - maxWeight: 'u64', + maxWeight: 'Weight', }, force_xcm_version: { location: 'XcmV1MultiLocation', @@ -1890,7 +1890,7 @@ export default { } }, /** - * Lookup207: xcm::VersionedXcm + * Lookup208: xcm::VersionedXcm **/ XcmVersionedXcm: { _enum: { @@ -1900,7 +1900,7 @@ export default { } }, /** - * Lookup208: xcm::v0::Xcm + * Lookup209: xcm::v0::Xcm **/ XcmV0Xcm: { _enum: { @@ -1954,7 +1954,7 @@ export default { } }, /** - * Lookup210: xcm::v0::order::Order + * Lookup211: xcm::v0::order::Order **/ XcmV0Order: { _enum: { @@ -1997,7 +1997,7 @@ export default { } }, /** - * Lookup212: xcm::v0::Response + * Lookup213: xcm::v0::Response **/ XcmV0Response: { _enum: { @@ -2005,7 +2005,7 @@ export default { } }, /** - * Lookup213: xcm::v1::Xcm + * Lookup214: xcm::v1::Xcm **/ XcmV1Xcm: { _enum: { @@ -2064,7 +2064,7 @@ export default { } }, /** - * Lookup215: xcm::v1::order::Order + * Lookup216: xcm::v1::order::Order **/ XcmV1Order: { _enum: { @@ -2109,7 +2109,7 @@ export default { } }, /** - * Lookup217: xcm::v1::Response + * Lookup218: xcm::v1::Response **/ XcmV1Response: { _enum: { @@ -2118,22 +2118,22 @@ export default { } }, /** - * Lookup231: cumulus_pallet_xcm::pallet::Call + * Lookup232: cumulus_pallet_xcm::pallet::Call **/ CumulusPalletXcmCall: 'Null', /** - * Lookup232: cumulus_pallet_dmp_queue::pallet::Call + * Lookup233: cumulus_pallet_dmp_queue::pallet::Call **/ CumulusPalletDmpQueueCall: { _enum: { service_overweight: { index: 'u64', - weightLimit: 'u64' + weightLimit: 'Weight' } } }, /** - * Lookup233: pallet_inflation::pallet::Call + * Lookup234: pallet_inflation::pallet::Call **/ PalletInflationCall: { _enum: { @@ -2143,7 +2143,7 @@ export default { } }, /** - * Lookup234: pallet_unique::Call + * Lookup235: pallet_unique::Call **/ PalletUniqueCall: { _enum: { @@ -2275,7 +2275,7 @@ export default { } }, /** - * Lookup239: up_data_structs::CollectionMode + * Lookup240: up_data_structs::CollectionMode **/ UpDataStructsCollectionMode: { _enum: { @@ -2285,7 +2285,7 @@ export default { } }, /** - * Lookup240: up_data_structs::CreateCollectionData + * Lookup241: up_data_structs::CreateCollectionData **/ UpDataStructsCreateCollectionData: { mode: 'UpDataStructsCollectionMode', @@ -2300,13 +2300,13 @@ export default { properties: 'Vec' }, /** - * Lookup242: up_data_structs::AccessMode + * Lookup243: up_data_structs::AccessMode **/ UpDataStructsAccessMode: { _enum: ['Normal', 'AllowList'] }, /** - * Lookup244: up_data_structs::CollectionLimits + * Lookup245: up_data_structs::CollectionLimits **/ UpDataStructsCollectionLimits: { accountTokenOwnershipLimit: 'Option', @@ -2320,7 +2320,7 @@ export default { transfersEnabled: 'Option' }, /** - * Lookup246: up_data_structs::SponsoringRateLimit + * Lookup247: up_data_structs::SponsoringRateLimit **/ UpDataStructsSponsoringRateLimit: { _enum: { @@ -2329,7 +2329,7 @@ export default { } }, /** - * Lookup249: up_data_structs::CollectionPermissions + * Lookup250: up_data_structs::CollectionPermissions **/ UpDataStructsCollectionPermissions: { access: 'Option', @@ -2337,7 +2337,7 @@ export default { nesting: 'Option' }, /** - * Lookup251: up_data_structs::NestingPermissions + * Lookup252: up_data_structs::NestingPermissions **/ UpDataStructsNestingPermissions: { tokenOwner: 'bool', @@ -2345,18 +2345,18 @@ export default { restricted: 'Option' }, /** - * Lookup253: up_data_structs::OwnerRestrictedSet + * Lookup254: up_data_structs::OwnerRestrictedSet **/ UpDataStructsOwnerRestrictedSet: 'BTreeSet', /** - * Lookup258: up_data_structs::PropertyKeyPermission + * Lookup259: up_data_structs::PropertyKeyPermission **/ UpDataStructsPropertyKeyPermission: { key: 'Bytes', permission: 'UpDataStructsPropertyPermission' }, /** - * Lookup259: up_data_structs::PropertyPermission + * Lookup260: up_data_structs::PropertyPermission **/ UpDataStructsPropertyPermission: { mutable: 'bool', @@ -2364,14 +2364,14 @@ export default { tokenOwner: 'bool' }, /** - * Lookup262: up_data_structs::Property + * Lookup263: up_data_structs::Property **/ UpDataStructsProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup265: up_data_structs::CreateItemData + * Lookup266: up_data_structs::CreateItemData **/ UpDataStructsCreateItemData: { _enum: { @@ -2381,26 +2381,26 @@ export default { } }, /** - * Lookup266: up_data_structs::CreateNftData + * Lookup267: up_data_structs::CreateNftData **/ UpDataStructsCreateNftData: { properties: 'Vec' }, /** - * Lookup267: up_data_structs::CreateFungibleData + * Lookup268: up_data_structs::CreateFungibleData **/ UpDataStructsCreateFungibleData: { value: 'u128' }, /** - * Lookup268: up_data_structs::CreateReFungibleData + * Lookup269: up_data_structs::CreateReFungibleData **/ UpDataStructsCreateReFungibleData: { pieces: 'u128', properties: 'Vec' }, /** - * Lookup271: up_data_structs::CreateItemExData> + * Lookup272: up_data_structs::CreateItemExData> **/ UpDataStructsCreateItemExData: { _enum: { @@ -2411,14 +2411,14 @@ export default { } }, /** - * Lookup273: up_data_structs::CreateNftExData> + * Lookup274: up_data_structs::CreateNftExData> **/ UpDataStructsCreateNftExData: { properties: 'Vec', owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup280: up_data_structs::CreateRefungibleExSingleOwner> + * Lookup281: up_data_structs::CreateRefungibleExSingleOwner> **/ UpDataStructsCreateRefungibleExSingleOwner: { user: 'PalletEvmAccountBasicCrossAccountIdRepr', @@ -2426,14 +2426,14 @@ export default { properties: 'Vec' }, /** - * Lookup282: up_data_structs::CreateRefungibleExMultipleOwners> + * Lookup283: up_data_structs::CreateRefungibleExMultipleOwners> **/ UpDataStructsCreateRefungibleExMultipleOwners: { users: 'BTreeMap', properties: 'Vec' }, /** - * Lookup283: pallet_unique_scheduler::pallet::Call + * Lookup284: pallet_unique_scheduler::pallet::Call **/ PalletUniqueSchedulerCall: { _enum: { @@ -2457,7 +2457,7 @@ export default { } }, /** - * Lookup285: frame_support::traits::schedule::MaybeHashed + * Lookup286: frame_support::traits::schedule::MaybeHashed **/ FrameSupportScheduleMaybeHashed: { _enum: { @@ -2466,7 +2466,7 @@ export default { } }, /** - * Lookup286: pallet_configuration::pallet::Call + * Lookup287: pallet_configuration::pallet::Call **/ PalletConfigurationCall: { _enum: { @@ -2479,15 +2479,15 @@ export default { } }, /** - * Lookup287: pallet_template_transaction_payment::Call + * Lookup289: pallet_template_transaction_payment::Call **/ PalletTemplateTransactionPaymentCall: 'Null', /** - * Lookup288: pallet_structure::pallet::Call + * Lookup290: pallet_structure::pallet::Call **/ PalletStructureCall: 'Null', /** - * Lookup289: pallet_rmrk_core::pallet::Call + * Lookup291: pallet_rmrk_core::pallet::Call **/ PalletRmrkCoreCall: { _enum: { @@ -2578,7 +2578,7 @@ export default { } }, /** - * Lookup295: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup297: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceTypes: { _enum: { @@ -2588,7 +2588,7 @@ export default { } }, /** - * Lookup297: rmrk_traits::resource::BasicResource> + * Lookup299: rmrk_traits::resource::BasicResource> **/ RmrkTraitsResourceBasicResource: { src: 'Option', @@ -2597,7 +2597,7 @@ export default { thumb: 'Option' }, /** - * Lookup299: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup301: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceComposableResource: { parts: 'Vec', @@ -2608,7 +2608,7 @@ export default { thumb: 'Option' }, /** - * Lookup300: rmrk_traits::resource::SlotResource> + * Lookup302: rmrk_traits::resource::SlotResource> **/ RmrkTraitsResourceSlotResource: { base: 'u32', @@ -2619,7 +2619,7 @@ export default { thumb: 'Option' }, /** - * Lookup303: pallet_rmrk_equip::pallet::Call + * Lookup305: pallet_rmrk_equip::pallet::Call **/ PalletRmrkEquipCall: { _enum: { @@ -2640,7 +2640,7 @@ export default { } }, /** - * Lookup306: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup308: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPartPartType: { _enum: { @@ -2649,7 +2649,7 @@ export default { } }, /** - * Lookup308: rmrk_traits::part::FixedPart> + * Lookup310: rmrk_traits::part::FixedPart> **/ RmrkTraitsPartFixedPart: { id: 'u32', @@ -2657,7 +2657,7 @@ export default { src: 'Bytes' }, /** - * Lookup309: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup311: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPartSlotPart: { id: 'u32', @@ -2666,7 +2666,7 @@ export default { z: 'u32' }, /** - * Lookup310: rmrk_traits::part::EquippableList> + * Lookup312: rmrk_traits::part::EquippableList> **/ RmrkTraitsPartEquippableList: { _enum: { @@ -2676,7 +2676,7 @@ export default { } }, /** - * Lookup312: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> + * Lookup314: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> **/ RmrkTraitsTheme: { name: 'Bytes', @@ -2684,14 +2684,14 @@ export default { inherit: 'bool' }, /** - * Lookup314: rmrk_traits::theme::ThemeProperty> + * Lookup316: rmrk_traits::theme::ThemeProperty> **/ RmrkTraitsThemeThemeProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup316: pallet_app_promotion::pallet::Call + * Lookup318: pallet_app_promotion::pallet::Call **/ PalletAppPromotionCall: { _enum: { @@ -2720,7 +2720,7 @@ export default { } }, /** - * Lookup318: pallet_foreign_assets::module::Call + * Lookup320: pallet_foreign_assets::module::Call **/ PalletForeignAssetsModuleCall: { _enum: { @@ -2737,7 +2737,7 @@ export default { } }, /** - * Lookup319: pallet_evm::pallet::Call + * Lookup321: pallet_evm::pallet::Call **/ PalletEvmCall: { _enum: { @@ -2780,7 +2780,7 @@ export default { } }, /** - * Lookup323: pallet_ethereum::pallet::Call + * Lookup325: pallet_ethereum::pallet::Call **/ PalletEthereumCall: { _enum: { @@ -2790,7 +2790,7 @@ export default { } }, /** - * Lookup324: ethereum::transaction::TransactionV2 + * Lookup326: ethereum::transaction::TransactionV2 **/ EthereumTransactionTransactionV2: { _enum: { @@ -2800,7 +2800,7 @@ export default { } }, /** - * Lookup325: ethereum::transaction::LegacyTransaction + * Lookup327: ethereum::transaction::LegacyTransaction **/ EthereumTransactionLegacyTransaction: { nonce: 'U256', @@ -2812,7 +2812,7 @@ export default { signature: 'EthereumTransactionTransactionSignature' }, /** - * Lookup326: ethereum::transaction::TransactionAction + * Lookup328: ethereum::transaction::TransactionAction **/ EthereumTransactionTransactionAction: { _enum: { @@ -2821,7 +2821,7 @@ export default { } }, /** - * Lookup327: ethereum::transaction::TransactionSignature + * Lookup329: ethereum::transaction::TransactionSignature **/ EthereumTransactionTransactionSignature: { v: 'u64', @@ -2829,7 +2829,7 @@ export default { s: 'H256' }, /** - * Lookup329: ethereum::transaction::EIP2930Transaction + * Lookup331: ethereum::transaction::EIP2930Transaction **/ EthereumTransactionEip2930Transaction: { chainId: 'u64', @@ -2845,14 +2845,14 @@ export default { s: 'H256' }, /** - * Lookup331: ethereum::transaction::AccessListItem + * Lookup333: ethereum::transaction::AccessListItem **/ EthereumTransactionAccessListItem: { address: 'H160', storageKeys: 'Vec' }, /** - * Lookup332: ethereum::transaction::EIP1559Transaction + * Lookup334: ethereum::transaction::EIP1559Transaction **/ EthereumTransactionEip1559Transaction: { chainId: 'u64', @@ -2869,7 +2869,7 @@ export default { s: 'H256' }, /** - * Lookup333: pallet_evm_migration::pallet::Call + * Lookup335: pallet_evm_migration::pallet::Call **/ PalletEvmMigrationCall: { _enum: { @@ -2887,32 +2887,32 @@ export default { } }, /** - * Lookup336: pallet_sudo::pallet::Error + * Lookup338: pallet_sudo::pallet::Error **/ PalletSudoError: { _enum: ['RequireSudo'] }, /** - * Lookup338: orml_vesting::module::Error + * Lookup340: orml_vesting::module::Error **/ OrmlVestingModuleError: { _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded'] }, /** - * Lookup339: orml_xtokens::module::Error + * Lookup341: orml_xtokens::module::Error **/ OrmlXtokensModuleError: { _enum: ['AssetHasNoReserve', 'NotCrossChainTransfer', 'InvalidDest', 'NotCrossChainTransferableCurrency', 'UnweighableMessage', 'XcmExecutionFailed', 'CannotReanchor', 'InvalidAncestry', 'InvalidAsset', 'DestinationNotInvertible', 'BadVersion', 'DistinctReserveForAssetAndFee', 'ZeroFee', 'ZeroAmount', 'TooManyAssetsBeingSent', 'AssetIndexNonExistent', 'FeeNotEnough', 'NotSupportedMultiLocation', 'MinXcmFeeNotDefined'] }, /** - * Lookup342: orml_tokens::BalanceLock + * Lookup344: orml_tokens::BalanceLock **/ OrmlTokensBalanceLock: { id: '[u8;8]', amount: 'u128' }, /** - * Lookup344: orml_tokens::AccountData + * Lookup346: orml_tokens::AccountData **/ OrmlTokensAccountData: { free: 'u128', @@ -2920,20 +2920,20 @@ export default { frozen: 'u128' }, /** - * Lookup346: orml_tokens::ReserveData + * Lookup348: orml_tokens::ReserveData **/ OrmlTokensReserveData: { id: 'Null', amount: 'u128' }, /** - * Lookup348: orml_tokens::module::Error + * Lookup350: orml_tokens::module::Error **/ OrmlTokensModuleError: { _enum: ['BalanceTooLow', 'AmountIntoBalanceFailed', 'LiquidityRestrictions', 'MaxLocksExceeded', 'KeepAlive', 'ExistentialDeposit', 'DeadAccount', 'TooManyReserves'] }, /** - * Lookup350: cumulus_pallet_xcmp_queue::InboundChannelDetails + * Lookup352: cumulus_pallet_xcmp_queue::InboundChannelDetails **/ CumulusPalletXcmpQueueInboundChannelDetails: { sender: 'u32', @@ -2941,19 +2941,19 @@ export default { messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>' }, /** - * Lookup351: cumulus_pallet_xcmp_queue::InboundState + * Lookup353: cumulus_pallet_xcmp_queue::InboundState **/ CumulusPalletXcmpQueueInboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup354: polkadot_parachain::primitives::XcmpMessageFormat + * Lookup356: polkadot_parachain::primitives::XcmpMessageFormat **/ PolkadotParachainPrimitivesXcmpMessageFormat: { _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals'] }, /** - * Lookup357: cumulus_pallet_xcmp_queue::OutboundChannelDetails + * Lookup359: cumulus_pallet_xcmp_queue::OutboundChannelDetails **/ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: 'u32', @@ -2963,46 +2963,46 @@ export default { lastIndex: 'u16' }, /** - * Lookup358: cumulus_pallet_xcmp_queue::OutboundState + * Lookup360: cumulus_pallet_xcmp_queue::OutboundState **/ CumulusPalletXcmpQueueOutboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup360: cumulus_pallet_xcmp_queue::QueueConfigData + * Lookup362: cumulus_pallet_xcmp_queue::QueueConfigData **/ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: 'u32', dropThreshold: 'u32', resumeThreshold: 'u32', - thresholdWeight: 'u64', - weightRestrictDecay: 'u64', - xcmpMaxIndividualWeight: 'u64' + thresholdWeight: 'Weight', + weightRestrictDecay: 'Weight', + xcmpMaxIndividualWeight: 'Weight' }, /** - * Lookup362: cumulus_pallet_xcmp_queue::pallet::Error + * Lookup364: cumulus_pallet_xcmp_queue::pallet::Error **/ CumulusPalletXcmpQueueError: { _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit'] }, /** - * Lookup363: pallet_xcm::pallet::Error + * Lookup365: pallet_xcm::pallet::Error **/ PalletXcmError: { _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed'] }, /** - * Lookup364: cumulus_pallet_xcm::pallet::Error + * Lookup366: cumulus_pallet_xcm::pallet::Error **/ CumulusPalletXcmError: 'Null', /** - * Lookup365: cumulus_pallet_dmp_queue::ConfigData + * Lookup367: cumulus_pallet_dmp_queue::ConfigData **/ CumulusPalletDmpQueueConfigData: { - maxIndividual: 'u64' + maxIndividual: 'Weight' }, /** - * Lookup366: cumulus_pallet_dmp_queue::PageIndexData + * Lookup368: cumulus_pallet_dmp_queue::PageIndexData **/ CumulusPalletDmpQueuePageIndexData: { beginUsed: 'u32', @@ -3010,19 +3010,19 @@ export default { overweightCount: 'u64' }, /** - * Lookup369: cumulus_pallet_dmp_queue::pallet::Error + * Lookup371: cumulus_pallet_dmp_queue::pallet::Error **/ CumulusPalletDmpQueueError: { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup373: pallet_unique::Error + * Lookup375: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup376: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> + * Lookup378: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> **/ PalletUniqueSchedulerScheduledV3: { maybeId: 'Option<[u8;16]>', @@ -3032,7 +3032,7 @@ export default { origin: 'OpalRuntimeOriginCaller' }, /** - * Lookup377: opal_runtime::OriginCaller + * Lookup379: opal_runtime::OriginCaller **/ OpalRuntimeOriginCaller: { _enum: { @@ -3141,7 +3141,7 @@ export default { } }, /** - * Lookup378: frame_support::dispatch::RawOrigin + * Lookup380: frame_support::dispatch::RawOrigin **/ FrameSupportDispatchRawOrigin: { _enum: { @@ -3151,7 +3151,7 @@ export default { } }, /** - * Lookup379: pallet_xcm::pallet::Origin + * Lookup381: pallet_xcm::pallet::Origin **/ PalletXcmOrigin: { _enum: { @@ -3160,7 +3160,7 @@ export default { } }, /** - * Lookup380: cumulus_pallet_xcm::pallet::Origin + * Lookup382: cumulus_pallet_xcm::pallet::Origin **/ CumulusPalletXcmOrigin: { _enum: { @@ -3169,7 +3169,7 @@ export default { } }, /** - * Lookup381: pallet_ethereum::RawOrigin + * Lookup383: pallet_ethereum::RawOrigin **/ PalletEthereumRawOrigin: { _enum: { @@ -3177,17 +3177,17 @@ export default { } }, /** - * Lookup382: sp_core::Void + * Lookup384: sp_core::Void **/ SpCoreVoid: 'Null', /** - * Lookup383: pallet_unique_scheduler::pallet::Error + * Lookup385: pallet_unique_scheduler::pallet::Error **/ PalletUniqueSchedulerError: { _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] }, /** - * Lookup384: up_data_structs::Collection + * Lookup386: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -3201,7 +3201,7 @@ export default { flags: '[u8;1]' }, /** - * Lookup385: up_data_structs::SponsorshipState + * Lookup387: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipStateAccountId32: { _enum: { @@ -3211,7 +3211,7 @@ export default { } }, /** - * Lookup387: up_data_structs::Properties + * Lookup389: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -3219,15 +3219,15 @@ export default { spaceLimit: 'u32' }, /** - * Lookup388: up_data_structs::PropertiesMap> + * Lookup390: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** - * Lookup393: up_data_structs::PropertiesMap + * Lookup395: up_data_structs::PropertiesMap **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup400: up_data_structs::CollectionStats + * Lookup402: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -3235,18 +3235,18 @@ export default { alive: 'u32' }, /** - * Lookup401: up_data_structs::TokenChild + * Lookup403: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup402: PhantomType::up_data_structs + * Lookup404: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup404: up_data_structs::TokenData> + * Lookup406: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -3254,7 +3254,7 @@ export default { pieces: 'u128' }, /** - * Lookup406: up_data_structs::RpcCollection + * Lookup408: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -3271,7 +3271,7 @@ export default { foreign: 'bool' }, /** - * Lookup407: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup409: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -3281,7 +3281,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup408: rmrk_traits::nft::NftInfo> + * Lookup410: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -3291,14 +3291,14 @@ export default { pending: 'bool' }, /** - * Lookup410: rmrk_traits::nft::RoyaltyInfo + * Lookup412: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup411: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup413: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -3307,14 +3307,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup412: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup414: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup413: rmrk_traits::base::BaseInfo> + * Lookup415: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -3322,92 +3322,92 @@ export default { symbol: 'Bytes' }, /** - * Lookup414: rmrk_traits::nft::NftChild + * Lookup416: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup416: pallet_common::pallet::Error + * Lookup418: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup418: pallet_fungible::pallet::Error + * Lookup420: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup419: pallet_refungible::ItemData + * Lookup421: pallet_refungible::ItemData **/ PalletRefungibleItemData: { constData: 'Bytes' }, /** - * Lookup424: pallet_refungible::pallet::Error + * Lookup426: pallet_refungible::pallet::Error **/ PalletRefungibleError: { _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup425: pallet_nonfungible::ItemData> + * Lookup427: pallet_nonfungible::ItemData> **/ PalletNonfungibleItemData: { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup427: up_data_structs::PropertyScope + * Lookup429: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { _enum: ['None', 'Rmrk'] }, /** - * Lookup429: pallet_nonfungible::pallet::Error + * Lookup431: pallet_nonfungible::pallet::Error **/ PalletNonfungibleError: { _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup430: pallet_structure::pallet::Error + * Lookup432: pallet_structure::pallet::Error **/ PalletStructureError: { _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup431: pallet_rmrk_core::pallet::Error + * Lookup433: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** - * Lookup433: pallet_rmrk_equip::pallet::Error + * Lookup435: pallet_rmrk_equip::pallet::Error **/ PalletRmrkEquipError: { _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] }, /** - * Lookup439: pallet_app_promotion::pallet::Error + * Lookup441: pallet_app_promotion::pallet::Error **/ PalletAppPromotionError: { _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'SponsorNotSet', 'IncorrectLockedBalanceOperation'] }, /** - * Lookup440: pallet_foreign_assets::module::Error + * Lookup442: pallet_foreign_assets::module::Error **/ PalletForeignAssetsModuleError: { _enum: ['BadLocation', 'MultiLocationExisted', 'AssetIdNotExists', 'AssetIdExisted'] }, /** - * Lookup443: pallet_evm::pallet::Error + * Lookup445: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup446: fp_rpc::TransactionStatus + * Lookup448: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -3419,11 +3419,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup448: ethbloom::Bloom + * Lookup450: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup450: ethereum::receipt::ReceiptV3 + * Lookup452: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -3433,7 +3433,7 @@ export default { } }, /** - * Lookup451: ethereum::receipt::EIP658ReceiptData + * Lookup453: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -3442,7 +3442,7 @@ export default { logs: 'Vec' }, /** - * Lookup452: ethereum::block::Block + * Lookup454: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -3450,7 +3450,7 @@ export default { ommers: 'Vec' }, /** - * Lookup453: ethereum::header::Header + * Lookup455: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -3470,23 +3470,23 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup454: ethereum_types::hash::H64 + * Lookup456: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup459: pallet_ethereum::pallet::Error + * Lookup461: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup460: pallet_evm_coder_substrate::pallet::Error + * Lookup462: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup461: up_data_structs::SponsorshipState> + * Lookup463: up_data_structs::SponsorshipState> **/ UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: { _enum: { @@ -3496,25 +3496,25 @@ export default { } }, /** - * Lookup462: pallet_evm_contract_helpers::SponsoringModeT + * Lookup464: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup468: pallet_evm_contract_helpers::pallet::Error + * Lookup470: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission', 'NoPendingSponsor', 'TooManyMethodsHaveSponsoredLimit'] }, /** - * Lookup469: pallet_evm_migration::pallet::Error + * Lookup471: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup471: sp_runtime::MultiSignature + * Lookup473: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3524,47 +3524,47 @@ export default { } }, /** - * Lookup472: sp_core::ed25519::Signature + * Lookup474: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup474: sp_core::sr25519::Signature + * Lookup476: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup475: sp_core::ecdsa::Signature + * Lookup477: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup478: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup480: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup479: frame_system::extensions::check_tx_version::CheckTxVersion + * Lookup481: frame_system::extensions::check_tx_version::CheckTxVersion **/ FrameSystemExtensionsCheckTxVersion: 'Null', /** - * Lookup480: frame_system::extensions::check_genesis::CheckGenesis + * Lookup482: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup483: frame_system::extensions::check_nonce::CheckNonce + * Lookup485: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup484: frame_system::extensions::check_weight::CheckWeight + * Lookup486: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup485: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup487: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup486: opal_runtime::Runtime + * Lookup488: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup487: pallet_ethereum::FakeTransactionFinalizer + * Lookup489: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index 2da85ab04d..8357683f1a 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassWeight, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { interface InterfaceTypes { @@ -60,7 +60,7 @@ declare module '@polkadot/types/types/registry' { FrameSupportWeightsDispatchInfo: FrameSupportWeightsDispatchInfo; FrameSupportWeightsPays: FrameSupportWeightsPays; FrameSupportWeightsPerDispatchClassU32: FrameSupportWeightsPerDispatchClassU32; - FrameSupportWeightsPerDispatchClassU64: FrameSupportWeightsPerDispatchClassU64; + FrameSupportWeightsPerDispatchClassWeight: FrameSupportWeightsPerDispatchClassWeight; FrameSupportWeightsPerDispatchClassWeightsPerClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; FrameSupportWeightsRuntimeDbWeight: FrameSupportWeightsRuntimeDbWeight; FrameSystemAccountInfo: FrameSystemAccountInfo; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index 3b82b9a82f..cf8c465ed0 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -7,7 +7,7 @@ import '@polkadot/types/lookup'; import type { BTreeMap, BTreeSet, Bytes, Compact, Enum, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { ITuple } from '@polkadot/types-codec/types'; -import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime'; +import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill, Weight } from '@polkadot/types/interfaces/runtime'; import type { Event } from '@polkadot/types/interfaces/system'; declare module '@polkadot/types/lookup' { @@ -28,19 +28,19 @@ declare module '@polkadot/types/lookup' { readonly feeFrozen: u128; } - /** @name FrameSupportWeightsPerDispatchClassU64 (7) */ - interface FrameSupportWeightsPerDispatchClassU64 extends Struct { - readonly normal: u64; - readonly operational: u64; - readonly mandatory: u64; + /** @name FrameSupportWeightsPerDispatchClassWeight (7) */ + interface FrameSupportWeightsPerDispatchClassWeight extends Struct { + readonly normal: Weight; + readonly operational: Weight; + readonly mandatory: Weight; } - /** @name SpRuntimeDigest (11) */ + /** @name SpRuntimeDigest (12) */ interface SpRuntimeDigest extends Struct { readonly logs: Vec; } - /** @name SpRuntimeDigestDigestItem (13) */ + /** @name SpRuntimeDigestDigestItem (14) */ interface SpRuntimeDigestDigestItem extends Enum { readonly isOther: boolean; readonly asOther: Bytes; @@ -54,14 +54,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated'; } - /** @name FrameSystemEventRecord (16) */ + /** @name FrameSystemEventRecord (17) */ interface FrameSystemEventRecord extends Struct { readonly phase: FrameSystemPhase; readonly event: Event; readonly topics: Vec; } - /** @name FrameSystemEvent (18) */ + /** @name FrameSystemEvent (19) */ interface FrameSystemEvent extends Enum { readonly isExtrinsicSuccess: boolean; readonly asExtrinsicSuccess: { @@ -89,14 +89,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked'; } - /** @name FrameSupportWeightsDispatchInfo (19) */ + /** @name FrameSupportWeightsDispatchInfo (20) */ interface FrameSupportWeightsDispatchInfo extends Struct { - readonly weight: u64; + readonly weight: Weight; readonly class: FrameSupportWeightsDispatchClass; readonly paysFee: FrameSupportWeightsPays; } - /** @name FrameSupportWeightsDispatchClass (20) */ + /** @name FrameSupportWeightsDispatchClass (21) */ interface FrameSupportWeightsDispatchClass extends Enum { readonly isNormal: boolean; readonly isOperational: boolean; @@ -104,14 +104,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Normal' | 'Operational' | 'Mandatory'; } - /** @name FrameSupportWeightsPays (21) */ + /** @name FrameSupportWeightsPays (22) */ interface FrameSupportWeightsPays extends Enum { readonly isYes: boolean; readonly isNo: boolean; readonly type: 'Yes' | 'No'; } - /** @name SpRuntimeDispatchError (22) */ + /** @name SpRuntimeDispatchError (23) */ interface SpRuntimeDispatchError extends Enum { readonly isOther: boolean; readonly isCannotLookup: boolean; @@ -130,13 +130,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional'; } - /** @name SpRuntimeModuleError (23) */ + /** @name SpRuntimeModuleError (24) */ interface SpRuntimeModuleError extends Struct { readonly index: u8; readonly error: U8aFixed; } - /** @name SpRuntimeTokenError (24) */ + /** @name SpRuntimeTokenError (25) */ interface SpRuntimeTokenError extends Enum { readonly isNoFunds: boolean; readonly isWouldDie: boolean; @@ -148,7 +148,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported'; } - /** @name SpRuntimeArithmeticError (25) */ + /** @name SpRuntimeArithmeticError (26) */ interface SpRuntimeArithmeticError extends Enum { readonly isUnderflow: boolean; readonly isOverflow: boolean; @@ -156,14 +156,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero'; } - /** @name SpRuntimeTransactionalError (26) */ + /** @name SpRuntimeTransactionalError (27) */ interface SpRuntimeTransactionalError extends Enum { readonly isLimitReached: boolean; readonly isNoLayer: boolean; readonly type: 'LimitReached' | 'NoLayer'; } - /** @name CumulusPalletParachainSystemEvent (27) */ + /** @name CumulusPalletParachainSystemEvent (28) */ interface CumulusPalletParachainSystemEvent extends Enum { readonly isValidationFunctionStored: boolean; readonly isValidationFunctionApplied: boolean; @@ -181,13 +181,13 @@ declare module '@polkadot/types/lookup' { } & Struct; readonly isDownwardMessagesProcessed: boolean; readonly asDownwardMessagesProcessed: { - readonly weightUsed: u64; + readonly weightUsed: Weight; readonly dmqHead: H256; } & Struct; readonly type: 'ValidationFunctionStored' | 'ValidationFunctionApplied' | 'ValidationFunctionDiscarded' | 'UpgradeAuthorized' | 'DownwardMessagesReceived' | 'DownwardMessagesProcessed'; } - /** @name PalletBalancesEvent (28) */ + /** @name PalletBalancesEvent (29) */ interface PalletBalancesEvent extends Enum { readonly isEndowed: boolean; readonly asEndowed: { @@ -246,14 +246,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'BalanceSet' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'Deposit' | 'Withdraw' | 'Slashed'; } - /** @name FrameSupportTokensMiscBalanceStatus (29) */ + /** @name FrameSupportTokensMiscBalanceStatus (30) */ interface FrameSupportTokensMiscBalanceStatus extends Enum { readonly isFree: boolean; readonly isReserved: boolean; readonly type: 'Free' | 'Reserved'; } - /** @name PalletTransactionPaymentEvent (30) */ + /** @name PalletTransactionPaymentEvent (31) */ interface PalletTransactionPaymentEvent extends Enum { readonly isTransactionFeePaid: boolean; readonly asTransactionFeePaid: { @@ -264,7 +264,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'TransactionFeePaid'; } - /** @name PalletTreasuryEvent (31) */ + /** @name PalletTreasuryEvent (32) */ interface PalletTreasuryEvent extends Enum { readonly isProposed: boolean; readonly asProposed: { @@ -306,7 +306,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit' | 'SpendApproved'; } - /** @name PalletSudoEvent (32) */ + /** @name PalletSudoEvent (33) */ interface PalletSudoEvent extends Enum { readonly isSudid: boolean; readonly asSudid: { @@ -323,7 +323,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone'; } - /** @name OrmlVestingModuleEvent (36) */ + /** @name OrmlVestingModuleEvent (37) */ interface OrmlVestingModuleEvent extends Enum { readonly isVestingScheduleAdded: boolean; readonly asVestingScheduleAdded: { @@ -343,7 +343,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated'; } - /** @name OrmlVestingVestingSchedule (37) */ + /** @name OrmlVestingVestingSchedule (38) */ interface OrmlVestingVestingSchedule extends Struct { readonly start: u32; readonly period: u32; @@ -351,7 +351,7 @@ declare module '@polkadot/types/lookup' { readonly perPeriod: Compact; } - /** @name OrmlXtokensModuleEvent (39) */ + /** @name OrmlXtokensModuleEvent (40) */ interface OrmlXtokensModuleEvent extends Enum { readonly isTransferredMultiAssets: boolean; readonly asTransferredMultiAssets: { @@ -363,16 +363,16 @@ declare module '@polkadot/types/lookup' { readonly type: 'TransferredMultiAssets'; } - /** @name XcmV1MultiassetMultiAssets (40) */ + /** @name XcmV1MultiassetMultiAssets (41) */ interface XcmV1MultiassetMultiAssets extends Vec {} - /** @name XcmV1MultiAsset (42) */ + /** @name XcmV1MultiAsset (43) */ interface XcmV1MultiAsset extends Struct { readonly id: XcmV1MultiassetAssetId; readonly fun: XcmV1MultiassetFungibility; } - /** @name XcmV1MultiassetAssetId (43) */ + /** @name XcmV1MultiassetAssetId (44) */ interface XcmV1MultiassetAssetId extends Enum { readonly isConcrete: boolean; readonly asConcrete: XcmV1MultiLocation; @@ -381,13 +381,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Concrete' | 'Abstract'; } - /** @name XcmV1MultiLocation (44) */ + /** @name XcmV1MultiLocation (45) */ interface XcmV1MultiLocation extends Struct { readonly parents: u8; readonly interior: XcmV1MultilocationJunctions; } - /** @name XcmV1MultilocationJunctions (45) */ + /** @name XcmV1MultilocationJunctions (46) */ interface XcmV1MultilocationJunctions extends Enum { readonly isHere: boolean; readonly isX1: boolean; @@ -409,7 +409,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; } - /** @name XcmV1Junction (46) */ + /** @name XcmV1Junction (47) */ interface XcmV1Junction extends Enum { readonly isParachain: boolean; readonly asParachain: Compact; @@ -443,7 +443,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; } - /** @name XcmV0JunctionNetworkId (48) */ + /** @name XcmV0JunctionNetworkId (49) */ interface XcmV0JunctionNetworkId extends Enum { readonly isAny: boolean; readonly isNamed: boolean; @@ -453,7 +453,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama'; } - /** @name XcmV0JunctionBodyId (52) */ + /** @name XcmV0JunctionBodyId (53) */ interface XcmV0JunctionBodyId extends Enum { readonly isUnit: boolean; readonly isNamed: boolean; @@ -467,7 +467,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial'; } - /** @name XcmV0JunctionBodyPart (53) */ + /** @name XcmV0JunctionBodyPart (54) */ interface XcmV0JunctionBodyPart extends Enum { readonly isVoice: boolean; readonly isMembers: boolean; @@ -492,7 +492,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion'; } - /** @name XcmV1MultiassetFungibility (54) */ + /** @name XcmV1MultiassetFungibility (55) */ interface XcmV1MultiassetFungibility extends Enum { readonly isFungible: boolean; readonly asFungible: Compact; @@ -501,7 +501,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Fungible' | 'NonFungible'; } - /** @name XcmV1MultiassetAssetInstance (55) */ + /** @name XcmV1MultiassetAssetInstance (56) */ interface XcmV1MultiassetAssetInstance extends Enum { readonly isUndefined: boolean; readonly isIndex: boolean; @@ -519,7 +519,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob'; } - /** @name OrmlTokensModuleEvent (58) */ + /** @name OrmlTokensModuleEvent (59) */ interface OrmlTokensModuleEvent extends Enum { readonly isEndowed: boolean; readonly asEndowed: { @@ -607,7 +607,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'BalanceSet' | 'TotalIssuanceSet' | 'Withdrawn' | 'Slashed' | 'Deposited' | 'LockSet' | 'LockRemoved'; } - /** @name PalletForeignAssetsAssetIds (59) */ + /** @name PalletForeignAssetsAssetIds (60) */ interface PalletForeignAssetsAssetIds extends Enum { readonly isForeignAssetId: boolean; readonly asForeignAssetId: u32; @@ -616,25 +616,25 @@ declare module '@polkadot/types/lookup' { readonly type: 'ForeignAssetId' | 'NativeAssetId'; } - /** @name PalletForeignAssetsNativeCurrency (60) */ + /** @name PalletForeignAssetsNativeCurrency (61) */ interface PalletForeignAssetsNativeCurrency extends Enum { readonly isHere: boolean; readonly isParent: boolean; readonly type: 'Here' | 'Parent'; } - /** @name CumulusPalletXcmpQueueEvent (61) */ + /** @name CumulusPalletXcmpQueueEvent (62) */ interface CumulusPalletXcmpQueueEvent extends Enum { readonly isSuccess: boolean; readonly asSuccess: { readonly messageHash: Option; - readonly weight: u64; + readonly weight: Weight; } & Struct; readonly isFail: boolean; readonly asFail: { readonly messageHash: Option; readonly error: XcmV2TraitsError; - readonly weight: u64; + readonly weight: Weight; } & Struct; readonly isBadVersion: boolean; readonly asBadVersion: { @@ -657,17 +657,17 @@ declare module '@polkadot/types/lookup' { readonly sender: u32; readonly sentAt: u32; readonly index: u64; - readonly required: u64; + readonly required: Weight; } & Struct; readonly isOverweightServiced: boolean; readonly asOverweightServiced: { readonly index: u64; - readonly used: u64; + readonly used: Weight; } & Struct; readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name XcmV2TraitsError (63) */ + /** @name XcmV2TraitsError (64) */ interface XcmV2TraitsError extends Enum { readonly isOverflow: boolean; readonly isUnimplemented: boolean; @@ -700,7 +700,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable'; } - /** @name PalletXcmEvent (65) */ + /** @name PalletXcmEvent (66) */ interface PalletXcmEvent extends Enum { readonly isAttempted: boolean; readonly asAttempted: XcmV2TraitsOutcome; @@ -713,7 +713,7 @@ declare module '@polkadot/types/lookup' { readonly isNotified: boolean; readonly asNotified: ITuple<[u64, u8, u8]>; readonly isNotifyOverweight: boolean; - readonly asNotifyOverweight: ITuple<[u64, u8, u8, u64, u64]>; + readonly asNotifyOverweight: ITuple<[u64, u8, u8, Weight, Weight]>; readonly isNotifyDispatchError: boolean; readonly asNotifyDispatchError: ITuple<[u64, u8, u8]>; readonly isNotifyDecodeFailed: boolean; @@ -737,7 +737,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail'; } - /** @name XcmV2TraitsOutcome (66) */ + /** @name XcmV2TraitsOutcome (67) */ interface XcmV2TraitsOutcome extends Enum { readonly isComplete: boolean; readonly asComplete: u64; @@ -748,10 +748,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'Complete' | 'Incomplete' | 'Error'; } - /** @name XcmV2Xcm (67) */ + /** @name XcmV2Xcm (68) */ interface XcmV2Xcm extends Vec {} - /** @name XcmV2Instruction (69) */ + /** @name XcmV2Instruction (70) */ interface XcmV2Instruction extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: XcmV1MultiassetMultiAssets; @@ -871,7 +871,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion'; } - /** @name XcmV2Response (70) */ + /** @name XcmV2Response (71) */ interface XcmV2Response extends Enum { readonly isNull: boolean; readonly isAssets: boolean; @@ -883,7 +883,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version'; } - /** @name XcmV0OriginKind (73) */ + /** @name XcmV0OriginKind (74) */ interface XcmV0OriginKind extends Enum { readonly isNative: boolean; readonly isSovereignAccount: boolean; @@ -892,12 +892,12 @@ declare module '@polkadot/types/lookup' { readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm'; } - /** @name XcmDoubleEncoded (74) */ + /** @name XcmDoubleEncoded (75) */ interface XcmDoubleEncoded extends Struct { readonly encoded: Bytes; } - /** @name XcmV1MultiassetMultiAssetFilter (75) */ + /** @name XcmV1MultiassetMultiAssetFilter (76) */ interface XcmV1MultiassetMultiAssetFilter extends Enum { readonly isDefinite: boolean; readonly asDefinite: XcmV1MultiassetMultiAssets; @@ -906,7 +906,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Definite' | 'Wild'; } - /** @name XcmV1MultiassetWildMultiAsset (76) */ + /** @name XcmV1MultiassetWildMultiAsset (77) */ interface XcmV1MultiassetWildMultiAsset extends Enum { readonly isAll: boolean; readonly isAllOf: boolean; @@ -917,14 +917,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'All' | 'AllOf'; } - /** @name XcmV1MultiassetWildFungibility (77) */ + /** @name XcmV1MultiassetWildFungibility (78) */ interface XcmV1MultiassetWildFungibility extends Enum { readonly isFungible: boolean; readonly isNonFungible: boolean; readonly type: 'Fungible' | 'NonFungible'; } - /** @name XcmV2WeightLimit (78) */ + /** @name XcmV2WeightLimit (79) */ interface XcmV2WeightLimit extends Enum { readonly isUnlimited: boolean; readonly isLimited: boolean; @@ -932,7 +932,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unlimited' | 'Limited'; } - /** @name XcmVersionedMultiAssets (80) */ + /** @name XcmVersionedMultiAssets (81) */ interface XcmVersionedMultiAssets extends Enum { readonly isV0: boolean; readonly asV0: Vec; @@ -941,7 +941,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1'; } - /** @name XcmV0MultiAsset (82) */ + /** @name XcmV0MultiAsset (83) */ interface XcmV0MultiAsset extends Enum { readonly isNone: boolean; readonly isAll: boolean; @@ -986,7 +986,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'None' | 'All' | 'AllFungible' | 'AllNonFungible' | 'AllAbstractFungible' | 'AllAbstractNonFungible' | 'AllConcreteFungible' | 'AllConcreteNonFungible' | 'AbstractFungible' | 'AbstractNonFungible' | 'ConcreteFungible' | 'ConcreteNonFungible'; } - /** @name XcmV0MultiLocation (83) */ + /** @name XcmV0MultiLocation (84) */ interface XcmV0MultiLocation extends Enum { readonly isNull: boolean; readonly isX1: boolean; @@ -1008,7 +1008,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Null' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8'; } - /** @name XcmV0Junction (84) */ + /** @name XcmV0Junction (85) */ interface XcmV0Junction extends Enum { readonly isParent: boolean; readonly isParachain: boolean; @@ -1043,7 +1043,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality'; } - /** @name XcmVersionedMultiLocation (85) */ + /** @name XcmVersionedMultiLocation (86) */ interface XcmVersionedMultiLocation extends Enum { readonly isV0: boolean; readonly asV0: XcmV0MultiLocation; @@ -1052,7 +1052,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1'; } - /** @name CumulusPalletXcmEvent (86) */ + /** @name CumulusPalletXcmEvent (87) */ interface CumulusPalletXcmEvent extends Enum { readonly isInvalidFormat: boolean; readonly asInvalidFormat: U8aFixed; @@ -1063,7 +1063,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; } - /** @name CumulusPalletDmpQueueEvent (87) */ + /** @name CumulusPalletDmpQueueEvent (88) */ interface CumulusPalletDmpQueueEvent extends Enum { readonly isInvalidFormat: boolean; readonly asInvalidFormat: { @@ -1081,24 +1081,24 @@ declare module '@polkadot/types/lookup' { readonly isWeightExhausted: boolean; readonly asWeightExhausted: { readonly messageId: U8aFixed; - readonly remainingWeight: u64; - readonly requiredWeight: u64; + readonly remainingWeight: Weight; + readonly requiredWeight: Weight; } & Struct; readonly isOverweightEnqueued: boolean; readonly asOverweightEnqueued: { readonly messageId: U8aFixed; readonly overweightIndex: u64; - readonly requiredWeight: u64; + readonly requiredWeight: Weight; } & Struct; readonly isOverweightServiced: boolean; readonly asOverweightServiced: { readonly overweightIndex: u64; - readonly weightUsed: u64; + readonly weightUsed: Weight; } & Struct; readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced'; } - /** @name PalletUniqueRawEvent (88) */ + /** @name PalletUniqueRawEvent (89) */ interface PalletUniqueRawEvent extends Enum { readonly isCollectionSponsorRemoved: boolean; readonly asCollectionSponsorRemoved: u32; @@ -1123,7 +1123,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet'; } - /** @name PalletEvmAccountBasicCrossAccountIdRepr (89) */ + /** @name PalletEvmAccountBasicCrossAccountIdRepr (90) */ interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { readonly isSubstrate: boolean; readonly asSubstrate: AccountId32; @@ -1132,7 +1132,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Substrate' | 'Ethereum'; } - /** @name PalletUniqueSchedulerEvent (92) */ + /** @name PalletUniqueSchedulerEvent (93) */ interface PalletUniqueSchedulerEvent extends Enum { readonly isScheduled: boolean; readonly asScheduled: { @@ -1159,14 +1159,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; } - /** @name FrameSupportScheduleLookupError (95) */ + /** @name FrameSupportScheduleLookupError (96) */ interface FrameSupportScheduleLookupError extends Enum { readonly isUnknown: boolean; readonly isBadFormat: boolean; readonly type: 'Unknown' | 'BadFormat'; } - /** @name PalletCommonEvent (96) */ + /** @name PalletCommonEvent (97) */ interface PalletCommonEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; @@ -1193,14 +1193,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; } - /** @name PalletStructureEvent (99) */ + /** @name PalletStructureEvent (100) */ interface PalletStructureEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: Result; readonly type: 'Executed'; } - /** @name PalletRmrkCoreEvent (100) */ + /** @name PalletRmrkCoreEvent (101) */ interface PalletRmrkCoreEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: { @@ -1290,7 +1290,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; } - /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (101) */ + /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (102) */ interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { readonly isAccountId: boolean; readonly asAccountId: AccountId32; @@ -1299,7 +1299,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'AccountId' | 'CollectionAndNftTuple'; } - /** @name PalletRmrkEquipEvent (106) */ + /** @name PalletRmrkEquipEvent (107) */ interface PalletRmrkEquipEvent extends Enum { readonly isBaseCreated: boolean; readonly asBaseCreated: { @@ -1314,7 +1314,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BaseCreated' | 'EquippablesUpdated'; } - /** @name PalletAppPromotionEvent (107) */ + /** @name PalletAppPromotionEvent (108) */ interface PalletAppPromotionEvent extends Enum { readonly isStakingRecalculation: boolean; readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>; @@ -1327,7 +1327,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'StakingRecalculation' | 'Stake' | 'Unstake' | 'SetAdmin'; } - /** @name PalletForeignAssetsModuleEvent (108) */ + /** @name PalletForeignAssetsModuleEvent (109) */ interface PalletForeignAssetsModuleEvent extends Enum { readonly isForeignAssetRegistered: boolean; readonly asForeignAssetRegistered: { @@ -1354,7 +1354,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ForeignAssetRegistered' | 'ForeignAssetUpdated' | 'AssetRegistered' | 'AssetUpdated'; } - /** @name PalletForeignAssetsModuleAssetMetadata (109) */ + /** @name PalletForeignAssetsModuleAssetMetadata (110) */ interface PalletForeignAssetsModuleAssetMetadata extends Struct { readonly name: Bytes; readonly symbol: Bytes; @@ -1362,7 +1362,7 @@ declare module '@polkadot/types/lookup' { readonly minimalBalance: u128; } - /** @name PalletEvmEvent (110) */ + /** @name PalletEvmEvent (111) */ interface PalletEvmEvent extends Enum { readonly isLog: boolean; readonly asLog: EthereumLog; @@ -1381,21 +1381,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; } - /** @name EthereumLog (111) */ + /** @name EthereumLog (112) */ interface EthereumLog extends Struct { readonly address: H160; readonly topics: Vec; readonly data: Bytes; } - /** @name PalletEthereumEvent (115) */ + /** @name PalletEthereumEvent (116) */ interface PalletEthereumEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; readonly type: 'Executed'; } - /** @name EvmCoreErrorExitReason (116) */ + /** @name EvmCoreErrorExitReason (117) */ interface EvmCoreErrorExitReason extends Enum { readonly isSucceed: boolean; readonly asSucceed: EvmCoreErrorExitSucceed; @@ -1408,7 +1408,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; } - /** @name EvmCoreErrorExitSucceed (117) */ + /** @name EvmCoreErrorExitSucceed (118) */ interface EvmCoreErrorExitSucceed extends Enum { readonly isStopped: boolean; readonly isReturned: boolean; @@ -1416,7 +1416,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Stopped' | 'Returned' | 'Suicided'; } - /** @name EvmCoreErrorExitError (118) */ + /** @name EvmCoreErrorExitError (119) */ interface EvmCoreErrorExitError extends Enum { readonly isStackUnderflow: boolean; readonly isStackOverflow: boolean; @@ -1437,13 +1437,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; } - /** @name EvmCoreErrorExitRevert (121) */ + /** @name EvmCoreErrorExitRevert (122) */ interface EvmCoreErrorExitRevert extends Enum { readonly isReverted: boolean; readonly type: 'Reverted'; } - /** @name EvmCoreErrorExitFatal (122) */ + /** @name EvmCoreErrorExitFatal (123) */ interface EvmCoreErrorExitFatal extends Enum { readonly isNotSupported: boolean; readonly isUnhandledInterrupt: boolean; @@ -1454,7 +1454,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; } - /** @name PalletEvmContractHelpersEvent (123) */ + /** @name PalletEvmContractHelpersEvent (124) */ interface PalletEvmContractHelpersEvent extends Enum { readonly isContractSponsorSet: boolean; readonly asContractSponsorSet: ITuple<[H160, AccountId32]>; @@ -1465,7 +1465,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ContractSponsorSet' | 'ContractSponsorshipConfirmed' | 'ContractSponsorRemoved'; } - /** @name FrameSystemPhase (124) */ + /** @name FrameSystemPhase (125) */ interface FrameSystemPhase extends Enum { readonly isApplyExtrinsic: boolean; readonly asApplyExtrinsic: u32; @@ -1474,13 +1474,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } - /** @name FrameSystemLastRuntimeUpgradeInfo (126) */ + /** @name FrameSystemLastRuntimeUpgradeInfo (127) */ interface FrameSystemLastRuntimeUpgradeInfo extends Struct { readonly specVersion: Compact; readonly specName: Text; } - /** @name FrameSystemCall (127) */ + /** @name FrameSystemCall (128) */ interface FrameSystemCall extends Enum { readonly isFillBlock: boolean; readonly asFillBlock: { @@ -1522,47 +1522,47 @@ declare module '@polkadot/types/lookup' { readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent'; } - /** @name FrameSystemLimitsBlockWeights (132) */ + /** @name FrameSystemLimitsBlockWeights (133) */ interface FrameSystemLimitsBlockWeights extends Struct { - readonly baseBlock: u64; - readonly maxBlock: u64; + readonly baseBlock: Weight; + readonly maxBlock: Weight; readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; } - /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (133) */ + /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (134) */ interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { readonly normal: FrameSystemLimitsWeightsPerClass; readonly operational: FrameSystemLimitsWeightsPerClass; readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name FrameSystemLimitsWeightsPerClass (134) */ + /** @name FrameSystemLimitsWeightsPerClass (135) */ interface FrameSystemLimitsWeightsPerClass extends Struct { - readonly baseExtrinsic: u64; - readonly maxExtrinsic: Option; - readonly maxTotal: Option; - readonly reserved: Option; + readonly baseExtrinsic: Weight; + readonly maxExtrinsic: Option; + readonly maxTotal: Option; + readonly reserved: Option; } - /** @name FrameSystemLimitsBlockLength (136) */ + /** @name FrameSystemLimitsBlockLength (137) */ interface FrameSystemLimitsBlockLength extends Struct { readonly max: FrameSupportWeightsPerDispatchClassU32; } - /** @name FrameSupportWeightsPerDispatchClassU32 (137) */ + /** @name FrameSupportWeightsPerDispatchClassU32 (138) */ interface FrameSupportWeightsPerDispatchClassU32 extends Struct { readonly normal: u32; readonly operational: u32; readonly mandatory: u32; } - /** @name FrameSupportWeightsRuntimeDbWeight (138) */ + /** @name FrameSupportWeightsRuntimeDbWeight (139) */ interface FrameSupportWeightsRuntimeDbWeight extends Struct { readonly read: u64; readonly write: u64; } - /** @name SpVersionRuntimeVersion (139) */ + /** @name SpVersionRuntimeVersion (140) */ interface SpVersionRuntimeVersion extends Struct { readonly specName: Text; readonly implName: Text; @@ -1574,7 +1574,7 @@ declare module '@polkadot/types/lookup' { readonly stateVersion: u8; } - /** @name FrameSystemError (144) */ + /** @name FrameSystemError (145) */ interface FrameSystemError extends Enum { readonly isInvalidSpecName: boolean; readonly isSpecVersionNeedsToIncrease: boolean; @@ -1585,7 +1585,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name PolkadotPrimitivesV2PersistedValidationData (145) */ + /** @name PolkadotPrimitivesV2PersistedValidationData (146) */ interface PolkadotPrimitivesV2PersistedValidationData extends Struct { readonly parentHead: Bytes; readonly relayParentNumber: u32; @@ -1593,18 +1593,18 @@ declare module '@polkadot/types/lookup' { readonly maxPovSize: u32; } - /** @name PolkadotPrimitivesV2UpgradeRestriction (148) */ + /** @name PolkadotPrimitivesV2UpgradeRestriction (149) */ interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { readonly isPresent: boolean; readonly type: 'Present'; } - /** @name SpTrieStorageProof (149) */ + /** @name SpTrieStorageProof (150) */ interface SpTrieStorageProof extends Struct { readonly trieNodes: BTreeSet; } - /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (151) */ + /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (152) */ interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { readonly dmqMqcHead: H256; readonly relayDispatchQueueSize: ITuple<[u32, u32]>; @@ -1612,7 +1612,7 @@ declare module '@polkadot/types/lookup' { readonly egressChannels: Vec>; } - /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (154) */ + /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (155) */ interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { readonly maxCapacity: u32; readonly maxTotalSize: u32; @@ -1622,7 +1622,7 @@ declare module '@polkadot/types/lookup' { readonly mqcHead: Option; } - /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (155) */ + /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (156) */ interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { readonly maxCodeSize: u32; readonly maxHeadDataSize: u32; @@ -1635,13 +1635,13 @@ declare module '@polkadot/types/lookup' { readonly validationUpgradeDelay: u32; } - /** @name PolkadotCorePrimitivesOutboundHrmpMessage (161) */ + /** @name PolkadotCorePrimitivesOutboundHrmpMessage (162) */ interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { readonly recipient: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemCall (162) */ + /** @name CumulusPalletParachainSystemCall (163) */ interface CumulusPalletParachainSystemCall extends Enum { readonly isSetValidationData: boolean; readonly asSetValidationData: { @@ -1662,7 +1662,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade'; } - /** @name CumulusPrimitivesParachainInherentParachainInherentData (163) */ + /** @name CumulusPrimitivesParachainInherentParachainInherentData (164) */ interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { readonly validationData: PolkadotPrimitivesV2PersistedValidationData; readonly relayChainState: SpTrieStorageProof; @@ -1670,19 +1670,19 @@ declare module '@polkadot/types/lookup' { readonly horizontalMessages: BTreeMap>; } - /** @name PolkadotCorePrimitivesInboundDownwardMessage (165) */ + /** @name PolkadotCorePrimitivesInboundDownwardMessage (166) */ interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { readonly sentAt: u32; readonly msg: Bytes; } - /** @name PolkadotCorePrimitivesInboundHrmpMessage (168) */ + /** @name PolkadotCorePrimitivesInboundHrmpMessage (169) */ interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { readonly sentAt: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemError (171) */ + /** @name CumulusPalletParachainSystemError (172) */ interface CumulusPalletParachainSystemError extends Enum { readonly isOverlappingUpgrades: boolean; readonly isProhibitedByPolkadot: boolean; @@ -1695,14 +1695,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized'; } - /** @name PalletBalancesBalanceLock (173) */ + /** @name PalletBalancesBalanceLock (174) */ interface PalletBalancesBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; readonly reasons: PalletBalancesReasons; } - /** @name PalletBalancesReasons (174) */ + /** @name PalletBalancesReasons (175) */ interface PalletBalancesReasons extends Enum { readonly isFee: boolean; readonly isMisc: boolean; @@ -1710,20 +1710,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'Fee' | 'Misc' | 'All'; } - /** @name PalletBalancesReserveData (177) */ + /** @name PalletBalancesReserveData (178) */ interface PalletBalancesReserveData extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name PalletBalancesReleases (179) */ + /** @name PalletBalancesReleases (180) */ interface PalletBalancesReleases extends Enum { readonly isV100: boolean; readonly isV200: boolean; readonly type: 'V100' | 'V200'; } - /** @name PalletBalancesCall (180) */ + /** @name PalletBalancesCall (181) */ interface PalletBalancesCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1760,7 +1760,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; } - /** @name PalletBalancesError (183) */ + /** @name PalletBalancesError (184) */ interface PalletBalancesError extends Enum { readonly isVestingBalance: boolean; readonly isLiquidityRestrictions: boolean; @@ -1773,7 +1773,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves'; } - /** @name PalletTimestampCall (185) */ + /** @name PalletTimestampCall (186) */ interface PalletTimestampCall extends Enum { readonly isSet: boolean; readonly asSet: { @@ -1782,14 +1782,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Set'; } - /** @name PalletTransactionPaymentReleases (187) */ + /** @name PalletTransactionPaymentReleases (188) */ interface PalletTransactionPaymentReleases extends Enum { readonly isV1Ancient: boolean; readonly isV2: boolean; readonly type: 'V1Ancient' | 'V2'; } - /** @name PalletTreasuryProposal (188) */ + /** @name PalletTreasuryProposal (189) */ interface PalletTreasuryProposal extends Struct { readonly proposer: AccountId32; readonly value: u128; @@ -1797,7 +1797,7 @@ declare module '@polkadot/types/lookup' { readonly bond: u128; } - /** @name PalletTreasuryCall (191) */ + /** @name PalletTreasuryCall (192) */ interface PalletTreasuryCall extends Enum { readonly isProposeSpend: boolean; readonly asProposeSpend: { @@ -1824,10 +1824,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval'; } - /** @name FrameSupportPalletId (194) */ + /** @name FrameSupportPalletId (195) */ interface FrameSupportPalletId extends U8aFixed {} - /** @name PalletTreasuryError (195) */ + /** @name PalletTreasuryError (196) */ interface PalletTreasuryError extends Enum { readonly isInsufficientProposersBalance: boolean; readonly isInvalidIndex: boolean; @@ -1837,7 +1837,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved'; } - /** @name PalletSudoCall (196) */ + /** @name PalletSudoCall (197) */ interface PalletSudoCall extends Enum { readonly isSudo: boolean; readonly asSudo: { @@ -1846,7 +1846,7 @@ declare module '@polkadot/types/lookup' { readonly isSudoUncheckedWeight: boolean; readonly asSudoUncheckedWeight: { readonly call: Call; - readonly weight: u64; + readonly weight: Weight; } & Struct; readonly isSetKey: boolean; readonly asSetKey: { @@ -1860,7 +1860,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs'; } - /** @name OrmlVestingModuleCall (198) */ + /** @name OrmlVestingModuleCall (199) */ interface OrmlVestingModuleCall extends Enum { readonly isClaim: boolean; readonly isVestedTransfer: boolean; @@ -1880,7 +1880,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor'; } - /** @name OrmlXtokensModuleCall (200) */ + /** @name OrmlXtokensModuleCall (201) */ interface OrmlXtokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1927,7 +1927,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'TransferMultiasset' | 'TransferWithFee' | 'TransferMultiassetWithFee' | 'TransferMulticurrencies' | 'TransferMultiassets'; } - /** @name XcmVersionedMultiAsset (201) */ + /** @name XcmVersionedMultiAsset (202) */ interface XcmVersionedMultiAsset extends Enum { readonly isV0: boolean; readonly asV0: XcmV0MultiAsset; @@ -1936,7 +1936,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1'; } - /** @name OrmlTokensModuleCall (204) */ + /** @name OrmlTokensModuleCall (205) */ interface OrmlTokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1973,12 +1973,12 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'TransferAll' | 'TransferKeepAlive' | 'ForceTransfer' | 'SetBalance'; } - /** @name CumulusPalletXcmpQueueCall (205) */ + /** @name CumulusPalletXcmpQueueCall (206) */ interface CumulusPalletXcmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { readonly index: u64; - readonly weightLimit: u64; + readonly weightLimit: Weight; } & Struct; readonly isSuspendXcmExecution: boolean; readonly isResumeXcmExecution: boolean; @@ -1996,20 +1996,20 @@ declare module '@polkadot/types/lookup' { } & Struct; readonly isUpdateThresholdWeight: boolean; readonly asUpdateThresholdWeight: { - readonly new_: u64; + readonly new_: Weight; } & Struct; readonly isUpdateWeightRestrictDecay: boolean; readonly asUpdateWeightRestrictDecay: { - readonly new_: u64; + readonly new_: Weight; } & Struct; readonly isUpdateXcmpMaxIndividualWeight: boolean; readonly asUpdateXcmpMaxIndividualWeight: { - readonly new_: u64; + readonly new_: Weight; } & Struct; readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight'; } - /** @name PalletXcmCall (206) */ + /** @name PalletXcmCall (207) */ interface PalletXcmCall extends Enum { readonly isSend: boolean; readonly asSend: { @@ -2033,7 +2033,7 @@ declare module '@polkadot/types/lookup' { readonly isExecute: boolean; readonly asExecute: { readonly message: XcmVersionedXcm; - readonly maxWeight: u64; + readonly maxWeight: Weight; } & Struct; readonly isForceXcmVersion: boolean; readonly asForceXcmVersion: { @@ -2071,7 +2071,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets'; } - /** @name XcmVersionedXcm (207) */ + /** @name XcmVersionedXcm (208) */ interface XcmVersionedXcm extends Enum { readonly isV0: boolean; readonly asV0: XcmV0Xcm; @@ -2082,7 +2082,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1' | 'V2'; } - /** @name XcmV0Xcm (208) */ + /** @name XcmV0Xcm (209) */ interface XcmV0Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -2145,7 +2145,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom'; } - /** @name XcmV0Order (210) */ + /** @name XcmV0Order (211) */ interface XcmV0Order extends Enum { readonly isNull: boolean; readonly isDepositAsset: boolean; @@ -2193,14 +2193,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV0Response (212) */ + /** @name XcmV0Response (213) */ interface XcmV0Response extends Enum { readonly isAssets: boolean; readonly asAssets: Vec; readonly type: 'Assets'; } - /** @name XcmV1Xcm (213) */ + /** @name XcmV1Xcm (214) */ interface XcmV1Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -2269,7 +2269,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion'; } - /** @name XcmV1Order (215) */ + /** @name XcmV1Order (216) */ interface XcmV1Order extends Enum { readonly isNoop: boolean; readonly isDepositAsset: boolean; @@ -2319,7 +2319,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV1Response (217) */ + /** @name XcmV1Response (218) */ interface XcmV1Response extends Enum { readonly isAssets: boolean; readonly asAssets: XcmV1MultiassetMultiAssets; @@ -2328,20 +2328,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'Assets' | 'Version'; } - /** @name CumulusPalletXcmCall (231) */ + /** @name CumulusPalletXcmCall (232) */ type CumulusPalletXcmCall = Null; - /** @name CumulusPalletDmpQueueCall (232) */ + /** @name CumulusPalletDmpQueueCall (233) */ interface CumulusPalletDmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { readonly index: u64; - readonly weightLimit: u64; + readonly weightLimit: Weight; } & Struct; readonly type: 'ServiceOverweight'; } - /** @name PalletInflationCall (233) */ + /** @name PalletInflationCall (234) */ interface PalletInflationCall extends Enum { readonly isStartInflation: boolean; readonly asStartInflation: { @@ -2350,7 +2350,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'StartInflation'; } - /** @name PalletUniqueCall (234) */ + /** @name PalletUniqueCall (235) */ interface PalletUniqueCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -2508,7 +2508,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; } - /** @name UpDataStructsCollectionMode (239) */ + /** @name UpDataStructsCollectionMode (240) */ interface UpDataStructsCollectionMode extends Enum { readonly isNft: boolean; readonly isFungible: boolean; @@ -2517,7 +2517,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateCollectionData (240) */ + /** @name UpDataStructsCreateCollectionData (241) */ interface UpDataStructsCreateCollectionData extends Struct { readonly mode: UpDataStructsCollectionMode; readonly access: Option; @@ -2531,14 +2531,14 @@ declare module '@polkadot/types/lookup' { readonly properties: Vec; } - /** @name UpDataStructsAccessMode (242) */ + /** @name UpDataStructsAccessMode (243) */ interface UpDataStructsAccessMode extends Enum { readonly isNormal: boolean; readonly isAllowList: boolean; readonly type: 'Normal' | 'AllowList'; } - /** @name UpDataStructsCollectionLimits (244) */ + /** @name UpDataStructsCollectionLimits (245) */ interface UpDataStructsCollectionLimits extends Struct { readonly accountTokenOwnershipLimit: Option; readonly sponsoredDataSize: Option; @@ -2551,7 +2551,7 @@ declare module '@polkadot/types/lookup' { readonly transfersEnabled: Option; } - /** @name UpDataStructsSponsoringRateLimit (246) */ + /** @name UpDataStructsSponsoringRateLimit (247) */ interface UpDataStructsSponsoringRateLimit extends Enum { readonly isSponsoringDisabled: boolean; readonly isBlocks: boolean; @@ -2559,43 +2559,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'SponsoringDisabled' | 'Blocks'; } - /** @name UpDataStructsCollectionPermissions (249) */ + /** @name UpDataStructsCollectionPermissions (250) */ interface UpDataStructsCollectionPermissions extends Struct { readonly access: Option; readonly mintMode: Option; readonly nesting: Option; } - /** @name UpDataStructsNestingPermissions (251) */ + /** @name UpDataStructsNestingPermissions (252) */ interface UpDataStructsNestingPermissions extends Struct { readonly tokenOwner: bool; readonly collectionAdmin: bool; readonly restricted: Option; } - /** @name UpDataStructsOwnerRestrictedSet (253) */ + /** @name UpDataStructsOwnerRestrictedSet (254) */ interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} - /** @name UpDataStructsPropertyKeyPermission (258) */ + /** @name UpDataStructsPropertyKeyPermission (259) */ interface UpDataStructsPropertyKeyPermission extends Struct { readonly key: Bytes; readonly permission: UpDataStructsPropertyPermission; } - /** @name UpDataStructsPropertyPermission (259) */ + /** @name UpDataStructsPropertyPermission (260) */ interface UpDataStructsPropertyPermission extends Struct { readonly mutable: bool; readonly collectionAdmin: bool; readonly tokenOwner: bool; } - /** @name UpDataStructsProperty (262) */ + /** @name UpDataStructsProperty (263) */ interface UpDataStructsProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name UpDataStructsCreateItemData (265) */ + /** @name UpDataStructsCreateItemData (266) */ interface UpDataStructsCreateItemData extends Enum { readonly isNft: boolean; readonly asNft: UpDataStructsCreateNftData; @@ -2606,23 +2606,23 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateNftData (266) */ + /** @name UpDataStructsCreateNftData (267) */ interface UpDataStructsCreateNftData extends Struct { readonly properties: Vec; } - /** @name UpDataStructsCreateFungibleData (267) */ + /** @name UpDataStructsCreateFungibleData (268) */ interface UpDataStructsCreateFungibleData extends Struct { readonly value: u128; } - /** @name UpDataStructsCreateReFungibleData (268) */ + /** @name UpDataStructsCreateReFungibleData (269) */ interface UpDataStructsCreateReFungibleData extends Struct { readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateItemExData (271) */ + /** @name UpDataStructsCreateItemExData (272) */ interface UpDataStructsCreateItemExData extends Enum { readonly isNft: boolean; readonly asNft: Vec; @@ -2635,26 +2635,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; } - /** @name UpDataStructsCreateNftExData (273) */ + /** @name UpDataStructsCreateNftExData (274) */ interface UpDataStructsCreateNftExData extends Struct { readonly properties: Vec; readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsCreateRefungibleExSingleOwner (280) */ + /** @name UpDataStructsCreateRefungibleExSingleOwner (281) */ interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { readonly user: PalletEvmAccountBasicCrossAccountIdRepr; readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateRefungibleExMultipleOwners (282) */ + /** @name UpDataStructsCreateRefungibleExMultipleOwners (283) */ interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { readonly users: BTreeMap; readonly properties: Vec; } - /** @name PalletUniqueSchedulerCall (283) */ + /** @name PalletUniqueSchedulerCall (284) */ interface PalletUniqueSchedulerCall extends Enum { readonly isScheduleNamed: boolean; readonly asScheduleNamed: { @@ -2679,7 +2679,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; } - /** @name FrameSupportScheduleMaybeHashed (285) */ + /** @name FrameSupportScheduleMaybeHashed (286) */ interface FrameSupportScheduleMaybeHashed extends Enum { readonly isValue: boolean; readonly asValue: Call; @@ -2688,7 +2688,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Value' | 'Hash'; } - /** @name PalletConfigurationCall (286) */ + /** @name PalletConfigurationCall (287) */ interface PalletConfigurationCall extends Enum { readonly isSetWeightToFeeCoefficientOverride: boolean; readonly asSetWeightToFeeCoefficientOverride: { @@ -2701,13 +2701,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride'; } - /** @name PalletTemplateTransactionPaymentCall (287) */ + /** @name PalletTemplateTransactionPaymentCall (289) */ type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletStructureCall (288) */ + /** @name PalletStructureCall (290) */ type PalletStructureCall = Null; - /** @name PalletRmrkCoreCall (289) */ + /** @name PalletRmrkCoreCall (291) */ interface PalletRmrkCoreCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -2813,7 +2813,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; } - /** @name RmrkTraitsResourceResourceTypes (295) */ + /** @name RmrkTraitsResourceResourceTypes (297) */ interface RmrkTraitsResourceResourceTypes extends Enum { readonly isBasic: boolean; readonly asBasic: RmrkTraitsResourceBasicResource; @@ -2824,7 +2824,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Basic' | 'Composable' | 'Slot'; } - /** @name RmrkTraitsResourceBasicResource (297) */ + /** @name RmrkTraitsResourceBasicResource (299) */ interface RmrkTraitsResourceBasicResource extends Struct { readonly src: Option; readonly metadata: Option; @@ -2832,7 +2832,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceComposableResource (299) */ + /** @name RmrkTraitsResourceComposableResource (301) */ interface RmrkTraitsResourceComposableResource extends Struct { readonly parts: Vec; readonly base: u32; @@ -2842,7 +2842,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceSlotResource (300) */ + /** @name RmrkTraitsResourceSlotResource (302) */ interface RmrkTraitsResourceSlotResource extends Struct { readonly base: u32; readonly src: Option; @@ -2852,7 +2852,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name PalletRmrkEquipCall (303) */ + /** @name PalletRmrkEquipCall (305) */ interface PalletRmrkEquipCall extends Enum { readonly isCreateBase: boolean; readonly asCreateBase: { @@ -2874,7 +2874,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; } - /** @name RmrkTraitsPartPartType (306) */ + /** @name RmrkTraitsPartPartType (308) */ interface RmrkTraitsPartPartType extends Enum { readonly isFixedPart: boolean; readonly asFixedPart: RmrkTraitsPartFixedPart; @@ -2883,14 +2883,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'FixedPart' | 'SlotPart'; } - /** @name RmrkTraitsPartFixedPart (308) */ + /** @name RmrkTraitsPartFixedPart (310) */ interface RmrkTraitsPartFixedPart extends Struct { readonly id: u32; readonly z: u32; readonly src: Bytes; } - /** @name RmrkTraitsPartSlotPart (309) */ + /** @name RmrkTraitsPartSlotPart (311) */ interface RmrkTraitsPartSlotPart extends Struct { readonly id: u32; readonly equippable: RmrkTraitsPartEquippableList; @@ -2898,7 +2898,7 @@ declare module '@polkadot/types/lookup' { readonly z: u32; } - /** @name RmrkTraitsPartEquippableList (310) */ + /** @name RmrkTraitsPartEquippableList (312) */ interface RmrkTraitsPartEquippableList extends Enum { readonly isAll: boolean; readonly isEmpty: boolean; @@ -2907,20 +2907,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'All' | 'Empty' | 'Custom'; } - /** @name RmrkTraitsTheme (312) */ + /** @name RmrkTraitsTheme (314) */ interface RmrkTraitsTheme extends Struct { readonly name: Bytes; readonly properties: Vec; readonly inherit: bool; } - /** @name RmrkTraitsThemeThemeProperty (314) */ + /** @name RmrkTraitsThemeThemeProperty (316) */ interface RmrkTraitsThemeThemeProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name PalletAppPromotionCall (316) */ + /** @name PalletAppPromotionCall (318) */ interface PalletAppPromotionCall extends Enum { readonly isSetAdminAddress: boolean; readonly asSetAdminAddress: { @@ -2954,7 +2954,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers'; } - /** @name PalletForeignAssetsModuleCall (318) */ + /** @name PalletForeignAssetsModuleCall (320) */ interface PalletForeignAssetsModuleCall extends Enum { readonly isRegisterForeignAsset: boolean; readonly asRegisterForeignAsset: { @@ -2971,7 +2971,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset'; } - /** @name PalletEvmCall (319) */ + /** @name PalletEvmCall (321) */ interface PalletEvmCall extends Enum { readonly isWithdraw: boolean; readonly asWithdraw: { @@ -3016,7 +3016,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name PalletEthereumCall (323) */ + /** @name PalletEthereumCall (325) */ interface PalletEthereumCall extends Enum { readonly isTransact: boolean; readonly asTransact: { @@ -3025,7 +3025,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transact'; } - /** @name EthereumTransactionTransactionV2 (324) */ + /** @name EthereumTransactionTransactionV2 (326) */ interface EthereumTransactionTransactionV2 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumTransactionLegacyTransaction; @@ -3036,7 +3036,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumTransactionLegacyTransaction (325) */ + /** @name EthereumTransactionLegacyTransaction (327) */ interface EthereumTransactionLegacyTransaction extends Struct { readonly nonce: U256; readonly gasPrice: U256; @@ -3047,7 +3047,7 @@ declare module '@polkadot/types/lookup' { readonly signature: EthereumTransactionTransactionSignature; } - /** @name EthereumTransactionTransactionAction (326) */ + /** @name EthereumTransactionTransactionAction (328) */ interface EthereumTransactionTransactionAction extends Enum { readonly isCall: boolean; readonly asCall: H160; @@ -3055,14 +3055,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Call' | 'Create'; } - /** @name EthereumTransactionTransactionSignature (327) */ + /** @name EthereumTransactionTransactionSignature (329) */ interface EthereumTransactionTransactionSignature extends Struct { readonly v: u64; readonly r: H256; readonly s: H256; } - /** @name EthereumTransactionEip2930Transaction (329) */ + /** @name EthereumTransactionEip2930Transaction (331) */ interface EthereumTransactionEip2930Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -3077,13 +3077,13 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name EthereumTransactionAccessListItem (331) */ + /** @name EthereumTransactionAccessListItem (333) */ interface EthereumTransactionAccessListItem extends Struct { readonly address: H160; readonly storageKeys: Vec; } - /** @name EthereumTransactionEip1559Transaction (332) */ + /** @name EthereumTransactionEip1559Transaction (334) */ interface EthereumTransactionEip1559Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -3099,7 +3099,7 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name PalletEvmMigrationCall (333) */ + /** @name PalletEvmMigrationCall (335) */ interface PalletEvmMigrationCall extends Enum { readonly isBegin: boolean; readonly asBegin: { @@ -3118,13 +3118,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Begin' | 'SetData' | 'Finish'; } - /** @name PalletSudoError (336) */ + /** @name PalletSudoError (338) */ interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: 'RequireSudo'; } - /** @name OrmlVestingModuleError (338) */ + /** @name OrmlVestingModuleError (340) */ interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; @@ -3135,7 +3135,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name OrmlXtokensModuleError (339) */ + /** @name OrmlXtokensModuleError (341) */ interface OrmlXtokensModuleError extends Enum { readonly isAssetHasNoReserve: boolean; readonly isNotCrossChainTransfer: boolean; @@ -3159,26 +3159,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined'; } - /** @name OrmlTokensBalanceLock (342) */ + /** @name OrmlTokensBalanceLock (344) */ interface OrmlTokensBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name OrmlTokensAccountData (344) */ + /** @name OrmlTokensAccountData (346) */ interface OrmlTokensAccountData extends Struct { readonly free: u128; readonly reserved: u128; readonly frozen: u128; } - /** @name OrmlTokensReserveData (346) */ + /** @name OrmlTokensReserveData (348) */ interface OrmlTokensReserveData extends Struct { readonly id: Null; readonly amount: u128; } - /** @name OrmlTokensModuleError (348) */ + /** @name OrmlTokensModuleError (350) */ interface OrmlTokensModuleError extends Enum { readonly isBalanceTooLow: boolean; readonly isAmountIntoBalanceFailed: boolean; @@ -3191,21 +3191,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (350) */ + /** @name CumulusPalletXcmpQueueInboundChannelDetails (352) */ interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (351) */ + /** @name CumulusPalletXcmpQueueInboundState (353) */ interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (354) */ + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (356) */ interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; @@ -3213,7 +3213,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (357) */ + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (359) */ interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; @@ -3222,24 +3222,24 @@ declare module '@polkadot/types/lookup' { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (358) */ + /** @name CumulusPalletXcmpQueueOutboundState (360) */ interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (360) */ + /** @name CumulusPalletXcmpQueueQueueConfigData (362) */ interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; readonly resumeThreshold: u32; - readonly thresholdWeight: u64; - readonly weightRestrictDecay: u64; - readonly xcmpMaxIndividualWeight: u64; + readonly thresholdWeight: Weight; + readonly weightRestrictDecay: Weight; + readonly xcmpMaxIndividualWeight: Weight; } - /** @name CumulusPalletXcmpQueueError (362) */ + /** @name CumulusPalletXcmpQueueError (364) */ interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; @@ -3249,7 +3249,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (363) */ + /** @name PalletXcmError (365) */ interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; @@ -3267,29 +3267,29 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (364) */ + /** @name CumulusPalletXcmError (366) */ type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (365) */ + /** @name CumulusPalletDmpQueueConfigData (367) */ interface CumulusPalletDmpQueueConfigData extends Struct { - readonly maxIndividual: u64; + readonly maxIndividual: Weight; } - /** @name CumulusPalletDmpQueuePageIndexData (366) */ + /** @name CumulusPalletDmpQueuePageIndexData (368) */ interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (369) */ + /** @name CumulusPalletDmpQueueError (371) */ interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (373) */ + /** @name PalletUniqueError (375) */ interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; @@ -3298,7 +3298,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name PalletUniqueSchedulerScheduledV3 (376) */ + /** @name PalletUniqueSchedulerScheduledV3 (378) */ interface PalletUniqueSchedulerScheduledV3 extends Struct { readonly maybeId: Option; readonly priority: u8; @@ -3307,7 +3307,7 @@ declare module '@polkadot/types/lookup' { readonly origin: OpalRuntimeOriginCaller; } - /** @name OpalRuntimeOriginCaller (377) */ + /** @name OpalRuntimeOriginCaller (379) */ interface OpalRuntimeOriginCaller extends Enum { readonly isSystem: boolean; readonly asSystem: FrameSupportDispatchRawOrigin; @@ -3321,7 +3321,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; } - /** @name FrameSupportDispatchRawOrigin (378) */ + /** @name FrameSupportDispatchRawOrigin (380) */ interface FrameSupportDispatchRawOrigin extends Enum { readonly isRoot: boolean; readonly isSigned: boolean; @@ -3330,7 +3330,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Root' | 'Signed' | 'None'; } - /** @name PalletXcmOrigin (379) */ + /** @name PalletXcmOrigin (381) */ interface PalletXcmOrigin extends Enum { readonly isXcm: boolean; readonly asXcm: XcmV1MultiLocation; @@ -3339,7 +3339,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Xcm' | 'Response'; } - /** @name CumulusPalletXcmOrigin (380) */ + /** @name CumulusPalletXcmOrigin (382) */ interface CumulusPalletXcmOrigin extends Enum { readonly isRelay: boolean; readonly isSiblingParachain: boolean; @@ -3347,17 +3347,17 @@ declare module '@polkadot/types/lookup' { readonly type: 'Relay' | 'SiblingParachain'; } - /** @name PalletEthereumRawOrigin (381) */ + /** @name PalletEthereumRawOrigin (383) */ interface PalletEthereumRawOrigin extends Enum { readonly isEthereumTransaction: boolean; readonly asEthereumTransaction: H160; readonly type: 'EthereumTransaction'; } - /** @name SpCoreVoid (382) */ + /** @name SpCoreVoid (384) */ type SpCoreVoid = Null; - /** @name PalletUniqueSchedulerError (383) */ + /** @name PalletUniqueSchedulerError (385) */ interface PalletUniqueSchedulerError extends Enum { readonly isFailedToSchedule: boolean; readonly isNotFound: boolean; @@ -3366,7 +3366,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; } - /** @name UpDataStructsCollection (384) */ + /** @name UpDataStructsCollection (386) */ interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3379,7 +3379,7 @@ declare module '@polkadot/types/lookup' { readonly flags: U8aFixed; } - /** @name UpDataStructsSponsorshipStateAccountId32 (385) */ + /** @name UpDataStructsSponsorshipStateAccountId32 (387) */ interface UpDataStructsSponsorshipStateAccountId32 extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3389,43 +3389,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (387) */ + /** @name UpDataStructsProperties (389) */ interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (388) */ + /** @name UpDataStructsPropertiesMapBoundedVec (390) */ interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (393) */ + /** @name UpDataStructsPropertiesMapPropertyPermission (395) */ interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (400) */ + /** @name UpDataStructsCollectionStats (402) */ interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (401) */ + /** @name UpDataStructsTokenChild (403) */ interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (402) */ + /** @name PhantomTypeUpDataStructs (404) */ interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (404) */ + /** @name UpDataStructsTokenData (406) */ interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (406) */ + /** @name UpDataStructsRpcCollection (408) */ interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3441,7 +3441,7 @@ declare module '@polkadot/types/lookup' { readonly foreign: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (407) */ + /** @name RmrkTraitsCollectionCollectionInfo (409) */ interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; @@ -3450,7 +3450,7 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (408) */ + /** @name RmrkTraitsNftNftInfo (410) */ interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; @@ -3459,13 +3459,13 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (410) */ + /** @name RmrkTraitsNftRoyaltyInfo (412) */ interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (411) */ + /** @name RmrkTraitsResourceResourceInfo (413) */ interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; @@ -3473,26 +3473,26 @@ declare module '@polkadot/types/lookup' { readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (412) */ + /** @name RmrkTraitsPropertyPropertyInfo (414) */ interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (413) */ + /** @name RmrkTraitsBaseBaseInfo (415) */ interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (414) */ + /** @name RmrkTraitsNftNftChild (416) */ interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (416) */ + /** @name PalletCommonError (418) */ interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; @@ -3531,7 +3531,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (418) */ + /** @name PalletFungibleError (420) */ interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; @@ -3541,12 +3541,12 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (419) */ + /** @name PalletRefungibleItemData (421) */ interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } - /** @name PalletRefungibleError (424) */ + /** @name PalletRefungibleError (426) */ interface PalletRefungibleError extends Enum { readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isWrongRefungiblePieces: boolean; @@ -3556,19 +3556,19 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletNonfungibleItemData (425) */ + /** @name PalletNonfungibleItemData (427) */ interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (427) */ + /** @name UpDataStructsPropertyScope (429) */ interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; readonly type: 'None' | 'Rmrk'; } - /** @name PalletNonfungibleError (429) */ + /** @name PalletNonfungibleError (431) */ interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; @@ -3576,7 +3576,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (430) */ + /** @name PalletStructureError (432) */ interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; @@ -3585,7 +3585,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletRmrkCoreError (431) */ + /** @name PalletRmrkCoreError (433) */ interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; @@ -3609,7 +3609,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } - /** @name PalletRmrkEquipError (433) */ + /** @name PalletRmrkEquipError (435) */ interface PalletRmrkEquipError extends Enum { readonly isPermissionError: boolean; readonly isNoAvailableBaseId: boolean; @@ -3621,7 +3621,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; } - /** @name PalletAppPromotionError (439) */ + /** @name PalletAppPromotionError (441) */ interface PalletAppPromotionError extends Enum { readonly isAdminNotSet: boolean; readonly isNoPermission: boolean; @@ -3632,7 +3632,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'IncorrectLockedBalanceOperation'; } - /** @name PalletForeignAssetsModuleError (440) */ + /** @name PalletForeignAssetsModuleError (442) */ interface PalletForeignAssetsModuleError extends Enum { readonly isBadLocation: boolean; readonly isMultiLocationExisted: boolean; @@ -3641,7 +3641,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted'; } - /** @name PalletEvmError (443) */ + /** @name PalletEvmError (445) */ interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; @@ -3652,7 +3652,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (446) */ + /** @name FpRpcTransactionStatus (448) */ interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; @@ -3663,10 +3663,10 @@ declare module '@polkadot/types/lookup' { readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (448) */ + /** @name EthbloomBloom (450) */ interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (450) */ + /** @name EthereumReceiptReceiptV3 (452) */ interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; @@ -3677,7 +3677,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (451) */ + /** @name EthereumReceiptEip658ReceiptData (453) */ interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; @@ -3685,14 +3685,14 @@ declare module '@polkadot/types/lookup' { readonly logs: Vec; } - /** @name EthereumBlock (452) */ + /** @name EthereumBlock (454) */ interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (453) */ + /** @name EthereumHeader (455) */ interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; @@ -3711,24 +3711,24 @@ declare module '@polkadot/types/lookup' { readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (454) */ + /** @name EthereumTypesHashH64 (456) */ interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (459) */ + /** @name PalletEthereumError (461) */ interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (460) */ + /** @name PalletEvmCoderSubstrateError (462) */ interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (461) */ + /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (463) */ interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3738,7 +3738,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name PalletEvmContractHelpersSponsoringModeT (462) */ + /** @name PalletEvmContractHelpersSponsoringModeT (464) */ interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; @@ -3746,7 +3746,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (468) */ + /** @name PalletEvmContractHelpersError (470) */ interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly isNoPendingSponsor: boolean; @@ -3754,14 +3754,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'NoPermission' | 'NoPendingSponsor' | 'TooManyMethodsHaveSponsoredLimit'; } - /** @name PalletEvmMigrationError (469) */ + /** @name PalletEvmMigrationError (471) */ interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (471) */ + /** @name SpRuntimeMultiSignature (473) */ interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; @@ -3772,37 +3772,37 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (472) */ + /** @name SpCoreEd25519Signature (474) */ interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (474) */ + /** @name SpCoreSr25519Signature (476) */ interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (475) */ + /** @name SpCoreEcdsaSignature (477) */ interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (478) */ + /** @name FrameSystemExtensionsCheckSpecVersion (480) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckTxVersion (479) */ + /** @name FrameSystemExtensionsCheckTxVersion (481) */ type FrameSystemExtensionsCheckTxVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (480) */ + /** @name FrameSystemExtensionsCheckGenesis (482) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (483) */ + /** @name FrameSystemExtensionsCheckNonce (485) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (484) */ + /** @name FrameSystemExtensionsCheckWeight (486) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (485) */ + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (487) */ interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (486) */ + /** @name OpalRuntimeRuntime (488) */ type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (487) */ + /** @name PalletEthereumFakeTransactionFinalizer (489) */ type PalletEthereumFakeTransactionFinalizer = Null; } // declare module diff --git a/tests/yarn.lock b/tests/yarn.lock index e260dc1ea4..865c2c5e09 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -17,49 +17,49 @@ dependencies: "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.19.0.tgz#2a592fd89bacb1fcde68de31bee4f2f2dacb0e86" - integrity sha512-y5rqgTTPTmaF5e2nVhOxw+Ur9HDJLsWb6U/KpgUzRZEdPfE6VOubXBKLdbcUTijzRptednSBDQbYZBOSqJxpJw== +"@babel/compat-data@^7.19.3": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.19.4.tgz#95c86de137bf0317f3a570e1b6e996b427299747" + integrity sha512-CHIGpJcUQ5lU9KrPHTjBMhVwQG6CQjxfg36fGXl3qk/Gik1WwWachaXFuo0uCWJT/mStOKtcbFJCaVLihC1CMw== -"@babel/core@^7.18.10": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.0.tgz#d2f5f4f2033c00de8096be3c9f45772563e150c3" - integrity sha512-reM4+U7B9ss148rh2n1Qs9ASS+w94irYXga7c2jaQv9RVzpS7Mv1a9rnYYwuDa45G+DkORt9g6An2k/V4d9LbQ== +"@babel/core@^7.19.3": + version "7.19.3" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.3.tgz#2519f62a51458f43b682d61583c3810e7dcee64c" + integrity sha512-WneDJxdsjEvyKtXKsaBGbDeiyOjR5vYq4HcShxnIbG0qixpoHjI3MqeZM9NDvsojNCEBItQE4juOo/bU6e72gQ== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.19.0" - "@babel/helper-compilation-targets" "^7.19.0" + "@babel/generator" "^7.19.3" + "@babel/helper-compilation-targets" "^7.19.3" "@babel/helper-module-transforms" "^7.19.0" "@babel/helpers" "^7.19.0" - "@babel/parser" "^7.19.0" + "@babel/parser" "^7.19.3" "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.0" - "@babel/types" "^7.19.0" + "@babel/traverse" "^7.19.3" + "@babel/types" "^7.19.3" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.1" semver "^6.3.0" -"@babel/generator@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.0.tgz#785596c06425e59334df2ccee63ab166b738419a" - integrity sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg== +"@babel/generator@^7.19.3", "@babel/generator@^7.19.4": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.4.tgz#60050cf3f0a593d7b2471b4be4f62a56b949237f" + integrity sha512-5T2lY5vXqS+5UEit/5TwcIUeCnwgCljcF8IQRT6XRQPBrvLeq5V8W+URv+GvwoF3FP8tkhp++evVyDzkDGzNmA== dependencies: - "@babel/types" "^7.19.0" + "@babel/types" "^7.19.4" "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" -"@babel/helper-compilation-targets@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.0.tgz#537ec8339d53e806ed422f1e06c8f17d55b96bb0" - integrity sha512-Ai5bNWXIvwDvWM7njqsG3feMlL9hCVQsPYXodsZyLwshYkZVJt59Gftau4VrE8S9IT9asd2uSP1hG6wCNw+sXA== +"@babel/helper-compilation-targets@^7.19.3": + version "7.19.3" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.3.tgz#a10a04588125675d7c7ae299af86fa1b2ee038ca" + integrity sha512-65ESqLGyGmLvgR0mst5AdW1FkNlj9rQsCKduzEoEPhBCDFGXvz2jW6bXFG6i0/MrV2s7hhXjjb2yAzcPuQlLwg== dependencies: - "@babel/compat-data" "^7.19.0" + "@babel/compat-data" "^7.19.3" "@babel/helper-validator-option" "^7.18.6" - browserslist "^4.20.2" + browserslist "^4.21.3" semver "^6.3.0" "@babel/helper-environment-visitor@^7.18.9": @@ -104,11 +104,11 @@ "@babel/types" "^7.19.0" "@babel/helper-simple-access@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz#d6d8f51f4ac2978068df934b569f08f29788c7ea" - integrity sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g== + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.19.4.tgz#be553f4951ac6352df2567f7daa19a0ee15668e7" + integrity sha512-f9Xq6WqBFqaDfbCzn2w85hwklswz5qsKlh7f08w4Y9yhJHpnNC0QemtSkK5YyOY8kPGvyiwdzZksGUhnGdaUIg== dependencies: - "@babel/types" "^7.18.6" + "@babel/types" "^7.19.4" "@babel/helper-split-export-declaration@^7.18.6": version "7.18.6" @@ -117,15 +117,15 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-string-parser@^7.18.10": - version "7.18.10" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz#181f22d28ebe1b3857fa575f5c290b1aaf659b56" - integrity sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw== +"@babel/helper-string-parser@^7.19.4": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" + integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== -"@babel/helper-validator-identifier@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz#9c97e30d31b2b8c72a1d08984f2ca9b574d7a076" - integrity sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g== +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" + integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== "@babel/helper-validator-option@^7.18.6": version "7.18.6" @@ -133,13 +133,13 @@ integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== "@babel/helpers@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.19.0.tgz#f30534657faf246ae96551d88dd31e9d1fa1fc18" - integrity sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg== + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.19.4.tgz#42154945f87b8148df7203a25c31ba9a73be46c5" + integrity sha512-G+z3aOx2nfDHwX/kyVii5fJq+bgscg89/dJNWpYeKeBv3v9xX8EIabmx1k6u9LS04H7nROFVRVK+e3k0VHp+sw== dependencies: "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.0" - "@babel/types" "^7.19.0" + "@babel/traverse" "^7.19.4" + "@babel/types" "^7.19.4" "@babel/highlight@^7.18.6": version "7.18.6" @@ -150,10 +150,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.18.10", "@babel/parser@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.0.tgz#497fcafb1d5b61376959c1c338745ef0577aa02c" - integrity sha512-74bEXKX2h+8rrfQUfsBfuZZHzsEs6Eql4pqy/T4Nn6Y9wNPggQOqD6z6pn5Bl8ZfysKouFZT/UXEH94ummEeQw== +"@babel/parser@^7.18.10", "@babel/parser@^7.19.3", "@babel/parser@^7.19.4": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.4.tgz#03c4339d2b8971eb3beca5252bafd9b9f79db3dc" + integrity sha512-qpVT7gtuOLjWeDTKLkJ6sryqLliBaFpAtGeqw5cs5giLldvh+Ch0plqnUMKoVAUS6ZEueQQiZV+p5pxtPitEsA== "@babel/register@^7.18.9": version "7.18.9" @@ -166,10 +166,10 @@ pirates "^4.0.5" source-map-support "^0.5.16" -"@babel/runtime@^7.18.9": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.19.0.tgz#22b11c037b094d27a8a2504ea4dcff00f50e2259" - integrity sha512-eR8Lo9hnDS7tqkO7NsV+mKvCmv5boaXFSZ70DnfhcgiEne8hv9oCEd36Klw74EtizEqLsy4YnW8UWwpBVolHZA== +"@babel/runtime@^7.18.9", "@babel/runtime@^7.19.0": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.19.4.tgz#a42f814502ee467d55b38dd1c256f53a7b885c78" + integrity sha512-EXpLCrk55f+cYqmHsSR+yD/0gAIMxxA9QK9lnQWzhMCvt+YmoBN7Zx94s++Kv0+unHk39vxNO8t+CMA2WSS3wA== dependencies: regenerator-runtime "^0.13.4" @@ -182,29 +182,29 @@ "@babel/parser" "^7.18.10" "@babel/types" "^7.18.10" -"@babel/traverse@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.0.tgz#eb9c561c7360005c592cc645abafe0c3c4548eed" - integrity sha512-4pKpFRDh+utd2mbRC8JLnlsMUii3PMHjpL6a0SZ4NMZy7YFP9aXORxEhdMVOc9CpWtDF09IkciQLEhK7Ml7gRA== +"@babel/traverse@^7.19.0", "@babel/traverse@^7.19.3", "@babel/traverse@^7.19.4": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.4.tgz#f117820e18b1e59448a6c1fa9d0ff08f7ac459a8" + integrity sha512-w3K1i+V5u2aJUOXBFFC5pveFLmtq1s3qcdDNC2qRI6WPBQIDaKFqXxDEqDO/h1dQ3HjsZoZMyIy6jGLq0xtw+g== dependencies: "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.19.0" + "@babel/generator" "^7.19.4" "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-function-name" "^7.19.0" "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.19.0" - "@babel/types" "^7.19.0" + "@babel/parser" "^7.19.4" + "@babel/types" "^7.19.4" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.19.0.tgz#75f21d73d73dc0351f3368d28db73465f4814600" - integrity sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA== +"@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.19.3", "@babel/types@^7.19.4": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.19.4.tgz#0dd5c91c573a202d600490a35b33246fed8a41c7" + integrity sha512-M5LK7nAeS6+9j7hAq+b3fQs+pNfUtTGq+yFFfHnauFA8zQtLRfmuipmsKDKKLuyG+wC8ABW43A153YNawNTEtw== dependencies: - "@babel/helper-string-parser" "^7.18.10" - "@babel/helper-validator-identifier" "^7.18.6" + "@babel/helper-string-parser" "^7.19.4" + "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" "@cspotcode/source-map-support@^0.8.0": @@ -214,10 +214,10 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@eslint/eslintrc@^1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.1.tgz#de0807bfeffc37b964a7d0400e0c348ce5a2543d" - integrity sha512-OhSY22oQQdw3zgPOOwdoj01l/Dzl1Z+xyUP33tkSN+aqyEhymJCcPHyXt+ylW8FSe0TfRC2VG+ROQOapD0aZSQ== +"@eslint/eslintrc@^1.3.3": + version "1.3.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.3.tgz#2b044ab39fdfa75b4688184f9e573ce3c5b0ff95" + integrity sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -354,9 +354,9 @@ integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== "@ethersproject/networks@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.0.tgz#df72a392f1a63a57f87210515695a31a245845ad" - integrity sha512-MG6oHSQHd4ebvJrleEQQ4HhVu8Ichr0RDYEfHzsVAVjHNM+w36x9wp9r+hf1JstMXtseXDtkiVoARAG6M959AA== + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" + integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== dependencies: "@ethersproject/logger" "^5.7.0" @@ -412,9 +412,9 @@ "@ethersproject/signing-key" "^5.7.0" "@ethersproject/web@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.0.tgz#40850c05260edad8b54827923bbad23d96aac0bc" - integrity sha512-ApHcbbj+muRASVDSCl/tgxaH2LBkRMEYfLOLVa0COipx0+nlu0QKet7U2lEg0vdkh8XRSLf2nd1f1Uk9SrVSGA== + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" + integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== dependencies: "@ethersproject/base64" "^5.7.0" "@ethersproject/bytes" "^5.7.0" @@ -422,20 +422,15 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@humanwhocodes/config-array@^0.10.4": - version "0.10.4" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.4.tgz#01e7366e57d2ad104feea63e72248f22015c520c" - integrity sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw== +"@humanwhocodes/config-array@^0.10.5": + version "0.10.7" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.7.tgz#6d53769fd0c222767e6452e8ebda825c22e9f0dc" + integrity sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" minimatch "^3.0.4" -"@humanwhocodes/gitignore-to-minimatch@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz#316b0a63b91c10e53f242efb4ace5c3b34e8728d" - integrity sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA== - "@humanwhocodes/module-importer@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" @@ -463,7 +458,7 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@^3.0.3": +"@jridgewell/resolve-uri@3.1.0", "@jridgewell/resolve-uri@^3.0.3": version "3.1.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== @@ -473,7 +468,7 @@ resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/sourcemap-codec@^1.4.10": +"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.14" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== @@ -487,22 +482,22 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping@^0.3.9": - version "0.3.15" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774" - integrity sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g== + version "0.3.16" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.16.tgz#a7982f16c18cae02be36274365433e5b49d7b23f" + integrity sha512-LCQ+NeThyJ4k1W2d+vIKdxuSt9R3pQSZ4P92m7EakaYuXcVWbHuT5bjNcqLd4Rdgi6xYWYDvBJZJLZSLanjDcA== dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/resolve-uri" "3.1.0" + "@jridgewell/sourcemap-codec" "1.4.14" -"@noble/hashes@1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183" - integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA== +"@noble/hashes@1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.3.tgz#360afc77610e0a61f3417e497dcf36862e4f8111" + integrity sha512-CE0FCR57H2acVI5UOzIGSSIYxZ6v/HOhDR0Ro9VLyhnzLwx0o8W1mmgaqlEUx4049qJDlIBRztv5k+MM8vbO3A== -"@noble/secp256k1@1.6.3": - version "1.6.3" - resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.6.3.tgz#7eed12d9f4404b416999d0c87686836c4c5c9b94" - integrity sha512-T04e4iTurVy7I8Sw4+c5OSN9/RkPlo1uKxAomtxQNLq8j1uPAqnsqG1bqvY3Jv7c13gyr6dui0zmh/I3+f/JaQ== +"@noble/secp256k1@1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.0.tgz#d15357f7c227e751d90aa06b05a0e5cf993ba8c1" + integrity sha512-kbacwGSsH/CTout0ZnZWxnW1B+jH/7r/WAAKLBtrRJ/+CUH7lgmQzl3GTrQua3SGKWNSDsS6lmjnDpIJ5Dxyaw== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -525,139 +520,139 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@polkadot/api-augment@9.2.2": - version "9.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-9.2.2.tgz#fab9dd96f9322ae658245cd8711fd2d8db5c2412" - integrity sha512-yDtp1ecRWMCFXTjmKOvqXI6VHTYvHormRwJwE85VGQbMsZFDWFVbQXZOxsqkfx2rJye/25seVRWxQS+7oKzqkA== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/api-base" "9.2.2" - "@polkadot/rpc-augment" "9.2.2" - "@polkadot/types" "9.2.2" - "@polkadot/types-augment" "9.2.2" - "@polkadot/types-codec" "9.2.2" - "@polkadot/util" "^10.1.4" - -"@polkadot/api-base@9.2.2": - version "9.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-9.2.2.tgz#f84cbf1eb1893e9c8eb538369c8b349f3d64d5fd" - integrity sha512-Dqbh0MQo/ByAqOC56ga1VkVCpEjfWtxPHz3ni8oXJp0YvjA/4qKkZRM2ejoN07XKOMFNBZC4hnmNplyaCnVHfw== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/rpc-core" "9.2.2" - "@polkadot/types" "9.2.2" - "@polkadot/util" "^10.1.4" - rxjs "^7.5.6" - -"@polkadot/api-contract@9.2.2": - version "9.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/api-contract/-/api-contract-9.2.2.tgz#1b8c1c6a4fb2f5e21d0c9549062c8242453a15b5" - integrity sha512-NE2QbBtX7e/lXdOG5wFqArjnbujcVWppoksvX1SrG2GKdhM2Y/shHLNV7uCYMq3tqmmCKOcp0RKE85Owu/7LQA== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/api" "9.2.2" - "@polkadot/types" "9.2.2" - "@polkadot/types-codec" "9.2.2" - "@polkadot/types-create" "9.2.2" - "@polkadot/util" "^10.1.4" - "@polkadot/util-crypto" "^10.1.4" - rxjs "^7.5.6" - -"@polkadot/api-derive@9.2.2": - version "9.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-9.2.2.tgz#70b510d8140f081ef145b9bdf4f8a03108183192" - integrity sha512-8Du6Wxro5yhAgwJ7R8xWCrDFnAWGv6aDWVnpckUZWs9LRw5wGNN4GJD4WB/715H9ZZXzQ/sDW5lXo3ux19SE7w== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/api" "9.2.2" - "@polkadot/api-augment" "9.2.2" - "@polkadot/api-base" "9.2.2" - "@polkadot/rpc-core" "9.2.2" - "@polkadot/types" "9.2.2" - "@polkadot/types-codec" "9.2.2" - "@polkadot/util" "^10.1.4" - "@polkadot/util-crypto" "^10.1.4" - rxjs "^7.5.6" - -"@polkadot/api@9.2.2": - version "9.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-9.2.2.tgz#3ecd80110acf5e479ce510d301e3a7ce2c1b8f17" - integrity sha512-dRXfdGhV3XWRtsYt+OskAwSAimTRC1k/oh3yO1vYc7C9cmqssw0LMEib9mlVh7qHprD30db7NleTOSFU6Bt2ag== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/api-augment" "9.2.2" - "@polkadot/api-base" "9.2.2" - "@polkadot/api-derive" "9.2.2" - "@polkadot/keyring" "^10.1.4" - "@polkadot/rpc-augment" "9.2.2" - "@polkadot/rpc-core" "9.2.2" - "@polkadot/rpc-provider" "9.2.2" - "@polkadot/types" "9.2.2" - "@polkadot/types-augment" "9.2.2" - "@polkadot/types-codec" "9.2.2" - "@polkadot/types-create" "9.2.2" - "@polkadot/types-known" "9.2.2" - "@polkadot/util" "^10.1.4" - "@polkadot/util-crypto" "^10.1.4" +"@polkadot/api-augment@9.5.1": + version "9.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-9.5.1.tgz#f4ae75837782dd09c2f7468f78c17626c359797d" + integrity sha512-9NQ2miIKVJvyhR2Zhk0XcHA+pgnWhQ0815lqcq0kz9ny5JHUFeGlNtxECw7AEnxoiC81EqpfWkOHpJpfiIcOmw== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/api-base" "9.5.1" + "@polkadot/rpc-augment" "9.5.1" + "@polkadot/types" "9.5.1" + "@polkadot/types-augment" "9.5.1" + "@polkadot/types-codec" "9.5.1" + "@polkadot/util" "^10.1.10" + +"@polkadot/api-base@9.5.1": + version "9.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-9.5.1.tgz#f6084ebd21c4c43e3c11a7d638621d27162c5fcc" + integrity sha512-3qsMsIhYbU3zp+YnP5h6Hg98y3B+FrxgPW7r2Uk6Kp1uSPmIzhMCyGuxur/BAcDVbd3KME+zWLHJDYOdyhuUwQ== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/rpc-core" "9.5.1" + "@polkadot/types" "9.5.1" + "@polkadot/util" "^10.1.10" + rxjs "^7.5.7" + +"@polkadot/api-contract@9.5.1": + version "9.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-contract/-/api-contract-9.5.1.tgz#ba45c9150610477f5d05509414f7330b6175ecdd" + integrity sha512-BfI1Yi2R0eZ076F4v4UZklQ+8WS0g8QZ9g2716FoNTGGYogUeMQ/8gZWIJaAyylCypN/ucNLdpSmSTnhR59jCw== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/api" "9.5.1" + "@polkadot/types" "9.5.1" + "@polkadot/types-codec" "9.5.1" + "@polkadot/types-create" "9.5.1" + "@polkadot/util" "^10.1.10" + "@polkadot/util-crypto" "^10.1.10" + rxjs "^7.5.7" + +"@polkadot/api-derive@9.5.1": + version "9.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-9.5.1.tgz#8542b989c34249df5ec3b836ec10b910897620df" + integrity sha512-fKlKQe8WZ3jrm44w/zptMofljW5qj+jZxnryK08CAH/MINlZArPfCtn+EJla2ND9aTnRMUWlEBtytyCPImI/Hg== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/api" "9.5.1" + "@polkadot/api-augment" "9.5.1" + "@polkadot/api-base" "9.5.1" + "@polkadot/rpc-core" "9.5.1" + "@polkadot/types" "9.5.1" + "@polkadot/types-codec" "9.5.1" + "@polkadot/util" "^10.1.10" + "@polkadot/util-crypto" "^10.1.10" + rxjs "^7.5.7" + +"@polkadot/api@9.5.1": + version "9.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-9.5.1.tgz#3501dac23bf82986dfe0a8c22857eb86610eca61" + integrity sha512-A2i/+mCl6cbFJ84ExMcWosUDfq0gVvzyKftkbRMs0oDzvHVVucTm0nCCzBgi/ltvSsFq8oJQ4pVqNTfT/IXgeQ== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/api-augment" "9.5.1" + "@polkadot/api-base" "9.5.1" + "@polkadot/api-derive" "9.5.1" + "@polkadot/keyring" "^10.1.10" + "@polkadot/rpc-augment" "9.5.1" + "@polkadot/rpc-core" "9.5.1" + "@polkadot/rpc-provider" "9.5.1" + "@polkadot/types" "9.5.1" + "@polkadot/types-augment" "9.5.1" + "@polkadot/types-codec" "9.5.1" + "@polkadot/types-create" "9.5.1" + "@polkadot/types-known" "9.5.1" + "@polkadot/util" "^10.1.10" + "@polkadot/util-crypto" "^10.1.10" eventemitter3 "^4.0.7" - rxjs "^7.5.6" - -"@polkadot/keyring@^10.1.4": - version "10.1.7" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-10.1.7.tgz#d51be1dc5807c961889847d8f0e10e4bbdd19d3f" - integrity sha512-lArwaAS3hDs+HHupDIC4r2mFaAfmNQV2YzwL2wM5zhOqB2RugN03BFrgwNll0y9/Bg8rYDqM3Y5BvVMzgMZ6XA== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/util" "10.1.7" - "@polkadot/util-crypto" "10.1.7" - -"@polkadot/networks@10.1.7", "@polkadot/networks@^10.1.4": - version "10.1.7" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.1.7.tgz#33b38d70409e2daf0990ef18ff150c6718ffb700" - integrity sha512-ol864SZ/GwAF72GQOPRy+Y9r6NtgJJjMBlDLESvV5VK64eEB0MRSSyiOdd7y/4SumR9crrrNimx3ynACFgxZ8A== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/util" "10.1.7" - "@substrate/ss58-registry" "^1.28.0" - -"@polkadot/rpc-augment@9.2.2": - version "9.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-9.2.2.tgz#7246e6a43536296ad19be8460a81e434d718ff4c" - integrity sha512-LbluIgoFtFtN/PTLk0kPErPgMPwj1+ySLn1bNlWjshoE00NeYAIltin9j11iT9g4Zpb+ppSWpsrhO/5crGqERQ== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/rpc-core" "9.2.2" - "@polkadot/types" "9.2.2" - "@polkadot/types-codec" "9.2.2" - "@polkadot/util" "^10.1.4" - -"@polkadot/rpc-core@9.2.2": - version "9.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-9.2.2.tgz#96b9fd033ecf0d4edf5f2f48c958a1991776b332" - integrity sha512-D+rmC7etJVvlDb7debjF1HDvjqvRnx/b3j7zKpJ3IjjVKWiYyCgQvcyyLyX4lH1f3PHOfEJZP6Q8FNA8B2U7XA== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/rpc-augment" "9.2.2" - "@polkadot/rpc-provider" "9.2.2" - "@polkadot/types" "9.2.2" - "@polkadot/util" "^10.1.4" - rxjs "^7.5.6" - -"@polkadot/rpc-provider@9.2.2": - version "9.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-9.2.2.tgz#14453b8e80d4f0826dbcbf4e749d5a9397cb6905" - integrity sha512-QnUql17q9ByP+7IyouXJDUPjkvOB1ciCGTwzf98WlOQxr/OEwcaWx0axHSVtMQyhX06ciVIbyI9hIjV5cfT78A== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/keyring" "^10.1.4" - "@polkadot/types" "9.2.2" - "@polkadot/types-support" "9.2.2" - "@polkadot/util" "^10.1.4" - "@polkadot/util-crypto" "^10.1.4" - "@polkadot/x-fetch" "^10.1.4" - "@polkadot/x-global" "^10.1.4" - "@polkadot/x-ws" "^10.1.4" - "@substrate/connect" "0.7.10" + rxjs "^7.5.7" + +"@polkadot/keyring@^10.1.10": + version "10.1.10" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-10.1.10.tgz#f9d97ab528e612df4820e0df1837faae51c15904" + integrity sha512-crKYBbwmPcFoTP6mby2+o1QWsjAyi5QlKzU8tXuXOApP6SBuqmDujIuLOKNG2vZoftNdVldsVL0WmKVYtBeuQg== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/util" "10.1.10" + "@polkadot/util-crypto" "10.1.10" + +"@polkadot/networks@10.1.10", "@polkadot/networks@^10.1.10": + version "10.1.10" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.1.10.tgz#421ce200f8b26759edd1d9d9408d934527f5b455" + integrity sha512-Db78t2XnFIZbdSdu1aFuj3/1cNwcSzG/+wNrpCQ9dPhnGPy5S1GVbmU8pyxTftPKdTFc+8RdBr+5bc0d5ijGiA== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/util" "10.1.10" + "@substrate/ss58-registry" "^1.31.0" + +"@polkadot/rpc-augment@9.5.1": + version "9.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-9.5.1.tgz#a4d8d7c6132375c9f4d50c7cb4c6813ff700937f" + integrity sha512-7Qm6oIoVIqv6VOaIqDal45hUTb3TVZ58S3zkSr60p/dPMlGCaFMcojtfcQErHtCW0hgvzFNsDl9ShpXRcPWu7g== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/rpc-core" "9.5.1" + "@polkadot/types" "9.5.1" + "@polkadot/types-codec" "9.5.1" + "@polkadot/util" "^10.1.10" + +"@polkadot/rpc-core@9.5.1": + version "9.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-9.5.1.tgz#7c327d735b742aaaee856bce6288331d0b2b042f" + integrity sha512-8CXgBVTEUjeuN5VOwS6MjTeqpN+9qrNJAAwNEba36/72g6Wgg3flza11kx0luQ6OLPVgCM7OcAjZ17p16phXDA== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/rpc-augment" "9.5.1" + "@polkadot/rpc-provider" "9.5.1" + "@polkadot/types" "9.5.1" + "@polkadot/util" "^10.1.10" + rxjs "^7.5.7" + +"@polkadot/rpc-provider@9.5.1": + version "9.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-9.5.1.tgz#1857b655a461820025b85cf3a7e7a58066ede137" + integrity sha512-CxyEo1SzwbcByUsrW5RUm5GTLNK7yjmVlTMseex8zQLO4+4erqUoQzr6TTIPSt4LWyk+TjbZdtGtlt7p6i2nJg== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/keyring" "^10.1.10" + "@polkadot/types" "9.5.1" + "@polkadot/types-support" "9.5.1" + "@polkadot/util" "^10.1.10" + "@polkadot/util-crypto" "^10.1.10" + "@polkadot/x-fetch" "^10.1.10" + "@polkadot/x-global" "^10.1.10" + "@polkadot/x-ws" "^10.1.10" + "@substrate/connect" "0.7.14" eventemitter3 "^4.0.7" mock-socket "^9.1.5" nock "^13.2.9" @@ -669,119 +664,119 @@ dependencies: "@types/chrome" "^0.0.171" -"@polkadot/typegen@9.2.2": - version "9.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/typegen/-/typegen-9.2.2.tgz#e99ec0c8b6a73e302ab6015008c16a969908a794" - integrity sha512-Bh7cvvT45Vw0A5yJDb4Pp+gIsMaqDg1x/p7QpBFf/RbPL6bORC3hBOxwa36m+RyWhYggNycoxfnKz5eAsdjCFQ== +"@polkadot/typegen@9.5.1": + version "9.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/typegen/-/typegen-9.5.1.tgz#deb74a4bbabd205d68f2b3d59793b3234cfc8c00" + integrity sha512-SKLiXHUpSCBop8dd1P/LCN2R5GpM41QSOmRyNVnhgOKPtmB/vxS2pVNvMDl7dOhQkANCO6E2CWZiIPeWlu/G7Q== dependencies: - "@babel/core" "^7.18.10" + "@babel/core" "^7.19.3" "@babel/register" "^7.18.9" - "@babel/runtime" "^7.18.9" - "@polkadot/api" "9.2.2" - "@polkadot/api-augment" "9.2.2" - "@polkadot/rpc-augment" "9.2.2" - "@polkadot/rpc-provider" "9.2.2" - "@polkadot/types" "9.2.2" - "@polkadot/types-augment" "9.2.2" - "@polkadot/types-codec" "9.2.2" - "@polkadot/types-create" "9.2.2" - "@polkadot/types-support" "9.2.2" - "@polkadot/util" "^10.1.4" - "@polkadot/util-crypto" "^10.1.4" - "@polkadot/x-ws" "^10.1.4" + "@babel/runtime" "^7.19.0" + "@polkadot/api" "9.5.1" + "@polkadot/api-augment" "9.5.1" + "@polkadot/rpc-augment" "9.5.1" + "@polkadot/rpc-provider" "9.5.1" + "@polkadot/types" "9.5.1" + "@polkadot/types-augment" "9.5.1" + "@polkadot/types-codec" "9.5.1" + "@polkadot/types-create" "9.5.1" + "@polkadot/types-support" "9.5.1" + "@polkadot/util" "^10.1.10" + "@polkadot/util-crypto" "^10.1.10" + "@polkadot/x-ws" "^10.1.10" handlebars "^4.7.7" websocket "^1.0.34" - yargs "^17.5.1" - -"@polkadot/types-augment@9.2.2": - version "9.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-9.2.2.tgz#3ec2aff0a86287f9f9f4ddb0aa5430450d4a684f" - integrity sha512-OyAC/WxNYrJjVp8NXklAeg/380BnFCBo4YgEOT4EhXK8fWzKzanvFAFROKAg78JQBI4LRJKkRyAEWIEzMNGR1Q== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/types" "9.2.2" - "@polkadot/types-codec" "9.2.2" - "@polkadot/util" "^10.1.4" - -"@polkadot/types-codec@9.2.2": - version "9.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-9.2.2.tgz#8ab24d6208cce7e6abf3c352742045062b7ff588" - integrity sha512-p6E31UQ9Hq0KwKXz5wBXvzrus3v7fY3yHR9EkR8eZvG7rBIHST42JPlfXIxKmnkkXkMxIX1LNSHQy0A8EikVxQ== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/util" "^10.1.4" - "@polkadot/x-bigint" "^10.1.4" - -"@polkadot/types-create@9.2.2": - version "9.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-9.2.2.tgz#d1e3cf945a0c95b31999673add738c4d585543d8" - integrity sha512-byGoFbkwpMHuqRwZXoD3lrTRkgIB89GlZlXJIfBuNeGE84nWktPCuZw3hBm5LO/qIgp5RFjdfeOCmBvxQ0fzQg== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/types-codec" "9.2.2" - "@polkadot/util" "^10.1.4" - -"@polkadot/types-known@9.2.2": - version "9.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-9.2.2.tgz#0d3d70eb37796aac06c874cd2b2bc97464f00e6a" - integrity sha512-WHkgoMJg0ZzxOainMjvGhaIa8/m/zwmhH1P+0UqLoZf+oE9EUkjPJaG5oETz4YUa3Nb8uuHfdMl6c5xN3DMIaQ== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/networks" "^10.1.4" - "@polkadot/types" "9.2.2" - "@polkadot/types-codec" "9.2.2" - "@polkadot/types-create" "9.2.2" - "@polkadot/util" "^10.1.4" - -"@polkadot/types-support@9.2.2": - version "9.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-9.2.2.tgz#d695b54b466bb47c0b376d07e9853d1ae3b17d5e" - integrity sha512-JNcdTyMKGETV7pjE4eZ8eBs82c4ZSY7n1R1/xT/tNZNA6uNdukBxOOkyRHdu5ugEehwCMSpOgruMCNH9e77zLg== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/util" "^10.1.4" - -"@polkadot/types@9.2.2": - version "9.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-9.2.2.tgz#b74d098ed8c725f961c3d95b610c49bde1cf5334" - integrity sha512-sDpS/m9oeihkYAYljZzp7xfMkJDLP5nLHSKkLdrh6H9XDVQnKgzJ19/kuAHsU8FCa9E37Al3aSQf/+NR+kCfZw== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/keyring" "^10.1.4" - "@polkadot/types-augment" "9.2.2" - "@polkadot/types-codec" "9.2.2" - "@polkadot/types-create" "9.2.2" - "@polkadot/util" "^10.1.4" - "@polkadot/util-crypto" "^10.1.4" - rxjs "^7.5.6" - -"@polkadot/util-crypto@10.1.7", "@polkadot/util-crypto@^10.1.4": - version "10.1.7" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.1.7.tgz#fe5ea006bf23ae19319f3ac9236905a984a65e2f" - integrity sha512-zGmSU7a0wdWfpDtfc+Q7fUuW+extu9o1Uh4JpkuwwZ/dxmyW5xlfqVsIScM1pdPyjJsyamX8KwsKiVsW4slasg== - dependencies: - "@babel/runtime" "^7.18.9" - "@noble/hashes" "1.1.2" - "@noble/secp256k1" "1.6.3" - "@polkadot/networks" "10.1.7" - "@polkadot/util" "10.1.7" + yargs "^17.6.0" + +"@polkadot/types-augment@9.5.1": + version "9.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-9.5.1.tgz#907d05da7cf0891cdf6d59e2387a3394a978a5c9" + integrity sha512-1AzQpGe5bGttYbbjR1UhV19htsFjgqJ651eyT3YdRqo1hotZ2GwTCkGXuTJtcmQQH9G09xUUwS3nx8WsSyQ70A== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/types" "9.5.1" + "@polkadot/types-codec" "9.5.1" + "@polkadot/util" "^10.1.10" + +"@polkadot/types-codec@9.5.1": + version "9.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-9.5.1.tgz#d0c04a9f7dd8337dce4fe806e634c4ef99f954cc" + integrity sha512-7Dy8TeApu4lN8DqdMZLuh34ocdHQh9jzAob6cQl1fl1ypOiCO/SwPjFkj0Xnhh7QQz9X9w63jZzbaFR3PPT+0g== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/util" "^10.1.10" + "@polkadot/x-bigint" "^10.1.10" + +"@polkadot/types-create@9.5.1": + version "9.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-9.5.1.tgz#06f71f08b3c68fb3bbdabe838325c955384d59bd" + integrity sha512-pUQ1U0mho5aKRdi4iR9DP9ldIoj9U+ApHIeYyxkBY8RexMQOpkt8PZfpFhg4z2H5vZj/sgNIBXq65HjXuyu+9w== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/types-codec" "9.5.1" + "@polkadot/util" "^10.1.10" + +"@polkadot/types-known@9.5.1": + version "9.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-9.5.1.tgz#0eb596078733a96f2cff3d5b4258966f4a6e4a5a" + integrity sha512-SedfPDxJREYPATa7X2Fv26z6UVPYv6v9Z9P4nulnC6Yl8C2+Q4A/VIqTtgsJc0DU1YT3gM8ofVxircfHqqRVNA== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/networks" "^10.1.10" + "@polkadot/types" "9.5.1" + "@polkadot/types-codec" "9.5.1" + "@polkadot/types-create" "9.5.1" + "@polkadot/util" "^10.1.10" + +"@polkadot/types-support@9.5.1": + version "9.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-9.5.1.tgz#5383cd84375aedd67bf0ccd2fa230d811f4b9dc9" + integrity sha512-mjenEGNT/ReY1xFexb37NDgV7QHHBBfWt31ZQMZKDkQL+R2P0rXFpmitcE3eOCV3oY4mf+GaU2N/ZfnsFl3tPQ== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/util" "^10.1.10" + +"@polkadot/types@9.5.1": + version "9.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-9.5.1.tgz#5f3891ce45d8d78aa0b5bc65d7517d98342699b0" + integrity sha512-xuhYq+O4JRl2iqLVEwKVHnfOA9AfwoNlHzrFx2DChDcIWdmgmUDASq9TkZhBP+jx81SieMH7iTf4zY6UwPKYQw== + dependencies: + "@babel/runtime" "^7.19.0" + "@polkadot/keyring" "^10.1.10" + "@polkadot/types-augment" "9.5.1" + "@polkadot/types-codec" "9.5.1" + "@polkadot/types-create" "9.5.1" + "@polkadot/util" "^10.1.10" + "@polkadot/util-crypto" "^10.1.10" + rxjs "^7.5.7" + +"@polkadot/util-crypto@10.1.10", "@polkadot/util-crypto@^10.1.10": + version "10.1.10" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.1.10.tgz#ae00c794dda6a2f5e40cdaaa87987312461dc59f" + integrity sha512-w9h/wf4wZXeUkRnihhnfqlaKuoQtrjkjK3C5liCQkr9vx5zOsmg/nMSDP8UUFJX0msPPYpFeNvzn7oDIs6qSZA== + dependencies: + "@babel/runtime" "^7.19.0" + "@noble/hashes" "1.1.3" + "@noble/secp256k1" "1.7.0" + "@polkadot/networks" "10.1.10" + "@polkadot/util" "10.1.10" "@polkadot/wasm-crypto" "^6.3.1" - "@polkadot/x-bigint" "10.1.7" - "@polkadot/x-randomvalues" "10.1.7" + "@polkadot/x-bigint" "10.1.10" + "@polkadot/x-randomvalues" "10.1.10" "@scure/base" "1.1.1" ed2curve "^0.3.0" tweetnacl "^1.0.3" -"@polkadot/util@10.1.7", "@polkadot/util@^10.1.4": - version "10.1.7" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.1.7.tgz#c54ca2a5b29cb834b40d8a876baefa3a0efb93af" - integrity sha512-s7gDLdNb4HUpoe3faXwoO6HwiUp8pi66voYKiUYRh1kEtW1o9vGBgyZPHPGC/FBgILzTJKii/9XxnSex60zBTA== +"@polkadot/util@10.1.10", "@polkadot/util@^10.1.10": + version "10.1.10" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.1.10.tgz#dc79c93d70e699e8cc1b09e636af7e4a64c5f0f0" + integrity sha512-BQoTfSxZ3BWAgWDjgKBVdyw1AJGaoOeAidCA+LZcHV6wlMu5643AZPUnoMrW413MbbpxsIhJXtNttqOwjo8MjA== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-bigint" "10.1.7" - "@polkadot/x-global" "10.1.7" - "@polkadot/x-textdecoder" "10.1.7" - "@polkadot/x-textencoder" "10.1.7" + "@babel/runtime" "^7.19.0" + "@polkadot/x-bigint" "10.1.10" + "@polkadot/x-global" "10.1.10" + "@polkadot/x-textdecoder" "10.1.10" + "@polkadot/x-textencoder" "10.1.10" "@types/bn.js" "^5.1.1" bn.js "^5.2.1" @@ -836,62 +831,62 @@ dependencies: "@babel/runtime" "^7.18.9" -"@polkadot/x-bigint@10.1.7", "@polkadot/x-bigint@^10.1.4": - version "10.1.7" - resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.1.7.tgz#1338689476ffdbb9f9cb243df1954ae8186134b9" - integrity sha512-uaClHpI6cnDumIfejUKvNTkB43JleEb0V6OIufDKJ/e1aCLE3f/Ws9ggwL8ea05lQP5k5xqOzbPdizi/UvrgKQ== +"@polkadot/x-bigint@10.1.10", "@polkadot/x-bigint@^10.1.10": + version "10.1.10" + resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.1.10.tgz#97dcccda2e24776aad3ae49f3268c03332138246" + integrity sha512-4Jt0BO0WTby6r9A2DgkDxf/LFaICQHvSl1VSFtBf0Z0GV2n4OxkBX5x/1bdEdGEvYT5rM7RbR3xI7EL+W1ixHA== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.7" + "@babel/runtime" "^7.19.0" + "@polkadot/x-global" "10.1.10" -"@polkadot/x-fetch@^10.1.4": - version "10.1.7" - resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-10.1.7.tgz#1b76051a495563403a20ef235a8558c6d91b11a6" - integrity sha512-NL+xrlqUoCLwCIAvQLwOA189gSUgeSGOFjCmZ9uMkBqf35KXeZoHWse6YaoseTSlnAal3dQOGbXnYWZ4Ck2OSA== +"@polkadot/x-fetch@^10.1.10": + version "10.1.10" + resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-10.1.10.tgz#6551e44211cf21a1ca076eedc4676754345e1504" + integrity sha512-LvTxAN6GaJzfgZ74WFYPZrIkMEThpX5u7O4ILiExcJt87E19cSWlYSHDa5n+OLjUpq0lBV2ueF90iUblt6aHpg== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.7" + "@babel/runtime" "^7.19.0" + "@polkadot/x-global" "10.1.10" "@types/node-fetch" "^2.6.2" node-fetch "^3.2.10" -"@polkadot/x-global@10.1.7", "@polkadot/x-global@^10.1.4": - version "10.1.7" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.1.7.tgz#91a472ac2f83fd0858dcd0df528844a5b650790e" - integrity sha512-k2ZUZyBVgDnP/Ysxapa0mthn63j6gsN2V0kZejEQPyOfCHtQQkse3jFvAWdslpWoR8j2k8SN5O6reHc0F4f7mA== +"@polkadot/x-global@10.1.10", "@polkadot/x-global@^10.1.10": + version "10.1.10" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.1.10.tgz#eedf63f1f3918c7f2bd8ef0907e051783f1a626e" + integrity sha512-WFfgaZSrzPlKLdnOus2mIFGzUbSDIQK6RMCfFfM9SmF3DkoxN40z5Nkni4PztfKr22stlkhmhnX/Lp/NxpuT6Q== dependencies: - "@babel/runtime" "^7.18.9" + "@babel/runtime" "^7.19.0" -"@polkadot/x-randomvalues@10.1.7": - version "10.1.7" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.1.7.tgz#d537f1f7bf3fb03e6c08ae6e6ac36e069c1f9844" - integrity sha512-3er4UYOlozLGgFYWwcbmcFslmO8m82u4cAGR4AaEag0VdV7jLO/M5lTmivT/3rtLSww6sjkEfr522GM2Q5lmFg== +"@polkadot/x-randomvalues@10.1.10": + version "10.1.10" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.1.10.tgz#a10f98f2c4d744612b68ee697e43f1e4d6e1f89a" + integrity sha512-KM4sCI/DNLIXlmnkeJIuYvh3pPuWvnkbR1a6TUB12J1izUJ+uGV+cAFRR4/EZk3oEsG/Tgivbs56meEOo3ws5A== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.7" + "@babel/runtime" "^7.19.0" + "@polkadot/x-global" "10.1.10" -"@polkadot/x-textdecoder@10.1.7": - version "10.1.7" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.1.7.tgz#1dd4e6141b1669acdd321a4da1fc6fdc271b7908" - integrity sha512-iAFOHludmZFOyVL8sQFv4TDqbcqQU5gwwYv74duTA+WQBgbSITJrBahSCV/rXOjUqds9pzQO3qBFzziznNnkiQ== +"@polkadot/x-textdecoder@10.1.10": + version "10.1.10" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.1.10.tgz#a6d0010b092bdefc69c70dcb34d76ec8993980b2" + integrity sha512-cAk37faYXx8IICeaq/tdl+aiIXwo3SLrx9XNoQqhX02g+SEs3ARM7zJcohj/p8ynWAI+ezNcsKn1wh174nquHw== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.7" + "@babel/runtime" "^7.19.0" + "@polkadot/x-global" "10.1.10" -"@polkadot/x-textencoder@10.1.7": - version "10.1.7" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.1.7.tgz#b208601f33b936c7a059f126dbb6b26a87f45864" - integrity sha512-GzjaWZDbgzZ0IQT60xuZ7cZ0wnlNVYMqpfI9KvBc58X9dPI3TIMwzbXDVzZzpjY1SAqJGs4hJse9HMWZazfhew== +"@polkadot/x-textencoder@10.1.10": + version "10.1.10" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.1.10.tgz#35b2e778b3dbb6816bb37f1848b772c4cd3c43d1" + integrity sha512-Auaql6BL5UHtWakZUQyj4y/BrM0tm4bYG5vXCMQCA1Gg0ky+46DhgpRrAQ9F7NNgWg1A6dA2I9KuAA4BTbNx0w== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.7" + "@babel/runtime" "^7.19.0" + "@polkadot/x-global" "10.1.10" -"@polkadot/x-ws@^10.1.4": - version "10.1.7" - resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-10.1.7.tgz#b1fbfe3e16fa809f35f24ef47fde145b018d8cdc" - integrity sha512-aNkotxHx3qPVjiItD9lbNONs4GNzqeeZ98wHtCjd9JWl/g+xNkOVF3xQ8++1qSHPBEYSwKh9URjQH2+CD2XlvQ== +"@polkadot/x-ws@^10.1.10": + version "10.1.10" + resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-10.1.10.tgz#27b55a988a0f60db7f79fed8268802406f522813" + integrity sha512-JxDgfm0ox2XPAtdTeJXYl6qq7LY/KOPi69wRpFMczWaYUsZubO6EiRzgzjuFlHY4/oxfjS/D+YbzcjefTxHz6g== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.7" + "@babel/runtime" "^7.19.0" + "@polkadot/x-global" "10.1.10" "@types/websocket" "^1.0.5" websocket "^1.0.34" @@ -910,27 +905,27 @@ resolved "https://registry.yarnpkg.com/@substrate/connect-extension-protocol/-/connect-extension-protocol-1.0.1.tgz#fa5738039586c648013caa6a0c95c43265dbe77d" integrity sha512-161JhCC1csjH3GE5mPLEd7HbWtwNSPJBg3p1Ksz9SFlTzj/bgEwudiRN2y5i0MoLGCIJRYKyKGMxVnd29PzNjg== -"@substrate/connect@0.7.10": - version "0.7.10" - resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.7.10.tgz#db49a62188cd830a8dc8848240e635da21f333ff" - integrity sha512-WNdW18e0I696/AQjrAXdMD9W8YaKLTcPr2Cu8scSwiUT40in84KEzi+g+P367cE2etAc+Dvu8vNDEQTbUPNqEg== +"@substrate/connect@0.7.14": + version "0.7.14" + resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.7.14.tgz#c090e952e9cdd93185a94d24fbc424ea20fe7bbe" + integrity sha512-uW5uBmihpivshmmmw+rsg7qOV0KqVSep4rWOXFMP8aFQinvmqw4JqxP21og4H/7JZxttYUBFQVsdtXHGKJ0aVQ== dependencies: "@substrate/connect-extension-protocol" "^1.0.1" - "@substrate/smoldot-light" "0.6.27" + "@substrate/smoldot-light" "0.6.34" eventemitter3 "^4.0.7" -"@substrate/smoldot-light@0.6.27": - version "0.6.27" - resolved "https://registry.yarnpkg.com/@substrate/smoldot-light/-/smoldot-light-0.6.27.tgz#7e66ad4bfddce4168a6008f6be8c771c881ae585" - integrity sha512-Wy3fbyfZqR3HLynuxeBkUunZsrbqpsmFN+D0/8cVIHZbO7WDwJsmCUc32yO5r+v6s/T97L7FOJHEyMWmRfnKAQ== +"@substrate/smoldot-light@0.6.34": + version "0.6.34" + resolved "https://registry.yarnpkg.com/@substrate/smoldot-light/-/smoldot-light-0.6.34.tgz#273dba622102281fd0fdb0e375198bff2ec584c3" + integrity sha512-+HK9MaJ0HelJmpf4YYR+salJ7dhVBltmhGlyz5l8OXS9DW18fe0Z2wxEo8P5kX9CUxlCXEb8J9JBRQAYBPHbwQ== dependencies: pako "^2.0.4" - websocket "^1.0.32" + ws "^8.8.1" -"@substrate/ss58-registry@^1.28.0": - version "1.29.0" - resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.29.0.tgz#0dea078271b5318c5eff7176e1df1f9b2c27e43f" - integrity sha512-KTqwZgTjtWPhCAUJJx9qswP/p9cRKUU9GOHYUDKNdISFDiFafWmpI54JHfYLkgjvkSKEUgRZnvLpe0LMF1fXvw== +"@substrate/ss58-registry@^1.31.0": + version "1.31.0" + resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.31.0.tgz#489e3a496081dc3ee7ef5ef2eb513962d5d29351" + integrity sha512-OSOmdjaq9foXfHBy9aLVMwGheygvsiZlv4dggnLOYOuhSmNCsSB/PaW4DBz+/tSdK1Fo9+ZiFW6cF24RA+m0sw== "@szmarczak/http-timer@^4.0.5": version "4.0.6" @@ -1023,9 +1018,9 @@ integrity sha512-BsPXH/irW0ht0Ji6iw/jJaK8Lj3FJemon2gvEqHKpCdDCeemHa+rI3WBGq5z7cDMZgoLjY40oninGxqk+8NzNQ== "@types/har-format@*": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@types/har-format/-/har-format-1.2.8.tgz#e6908b76d4c88be3db642846bb8b455f0bfb1c4e" - integrity sha512-OP6L9VuZNdskgNN3zFQQ54ceYD8OLq5IbqO4VK91ORLfOm7WdT/CiT/pHEBSQEqCInJ2y3O6iCm/zGtPElpgJQ== + version "1.2.9" + resolved "https://registry.yarnpkg.com/@types/har-format/-/har-format-1.2.9.tgz#b9b3a9bfc33a078e7d898a00b09662910577f4a4" + integrity sha512-rffW6MhQ9yoa75bdNi+rjZBAvu2HhehWJXlhuWXnWdENeuKe82wUgAwxYOb7KRKKmxYN+D/iRKd2NDQMLqlUmg== "@types/http-cache-semantics@*": version "4.0.1" @@ -1044,10 +1039,10 @@ dependencies: "@types/node" "*" -"@types/mocha@^9.1.1": - version "9.1.1" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" - integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== +"@types/mocha@^10.0.0": + version "10.0.0" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.0.tgz#3d9018c575f0e3f7386c1de80ee66cc21fbb7a52" + integrity sha512-rADY+HtTOA52l9VZWtgQfn4p+UDVM2eDVkMZT1I6syp0YKxW2F9v+0pbRZLsvskhQv/vMb6ZfCay81GHbz5SHg== "@types/node-fetch@^2.6.2": version "2.6.2" @@ -1058,9 +1053,9 @@ form-data "^3.0.0" "@types/node@*": - version "18.7.16" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.16.tgz#0eb3cce1e37c79619943d2fd903919fc30850601" - integrity sha512-EQHhixfu+mkqHMZl1R2Ovuvn47PUw18azMJOTwSZr9/fhzHNGXAJ0ma0dayRVchprpCj0Kc1K1xKoWaATWF1qg== + version "18.8.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.8.3.tgz#ce750ab4017effa51aed6a7230651778d54e327c" + integrity sha512-0os9vz6BpGwxGe9LOhgP/ncvYN5Tx1fNcd2TM3rD/aCGBkysb+ZWpXEocG24h6ZzOi13+VB8HndAQFezsSOw1w== "@types/node@^12.12.6": version "12.20.55" @@ -1101,84 +1096,83 @@ "@types/node" "*" "@typescript-eslint/eslint-plugin@^5.26.0": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.36.2.tgz#6df092a20e0f9ec748b27f293a12cb39d0c1fe4d" - integrity sha512-OwwR8LRwSnI98tdc2z7mJYgY60gf7I9ZfGjN5EjCwwns9bdTuQfAXcsjSB2wSQ/TVNYSGKf4kzVXbNGaZvwiXw== + version "5.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.39.0.tgz#778b2d9e7f293502c7feeea6c74dca8eb3e67511" + integrity sha512-xVfKOkBm5iWMNGKQ2fwX5GVgBuHmZBO1tCRwXmY5oAIsPscfwm2UADDuNB8ZVYCtpQvJK4xpjrK7jEhcJ0zY9A== dependencies: - "@typescript-eslint/scope-manager" "5.36.2" - "@typescript-eslint/type-utils" "5.36.2" - "@typescript-eslint/utils" "5.36.2" + "@typescript-eslint/scope-manager" "5.39.0" + "@typescript-eslint/type-utils" "5.39.0" + "@typescript-eslint/utils" "5.39.0" debug "^4.3.4" - functional-red-black-tree "^1.0.1" ignore "^5.2.0" regexpp "^3.2.0" semver "^7.3.7" tsutils "^3.21.0" "@typescript-eslint/parser@^5.26.0": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.36.2.tgz#3ddf323d3ac85a25295a55fcb9c7a49ab4680ddd" - integrity sha512-qS/Kb0yzy8sR0idFspI9Z6+t7mqk/oRjnAYfewG+VN73opAUvmYL3oPIMmgOX6CnQS6gmVIXGshlb5RY/R22pA== + version "5.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.39.0.tgz#93fa0bc980a3a501e081824f6097f7ca30aaa22b" + integrity sha512-PhxLjrZnHShe431sBAGHaNe6BDdxAASDySgsBCGxcBecVCi8NQWxQZMcizNA4g0pN51bBAn/FUfkWG3SDVcGlA== dependencies: - "@typescript-eslint/scope-manager" "5.36.2" - "@typescript-eslint/types" "5.36.2" - "@typescript-eslint/typescript-estree" "5.36.2" + "@typescript-eslint/scope-manager" "5.39.0" + "@typescript-eslint/types" "5.39.0" + "@typescript-eslint/typescript-estree" "5.39.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.36.2.tgz#a75eb588a3879ae659514780831370642505d1cd" - integrity sha512-cNNP51L8SkIFSfce8B1NSUBTJTu2Ts4nWeWbFrdaqjmn9yKrAaJUBHkyTZc0cL06OFHpb+JZq5AUHROS398Orw== +"@typescript-eslint/scope-manager@5.39.0": + version "5.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.39.0.tgz#873e1465afa3d6c78d8ed2da68aed266a08008d0" + integrity sha512-/I13vAqmG3dyqMVSZPjsbuNQlYS082Y7OMkwhCfLXYsmlI0ca4nkL7wJ/4gjX70LD4P8Hnw1JywUVVAwepURBw== dependencies: - "@typescript-eslint/types" "5.36.2" - "@typescript-eslint/visitor-keys" "5.36.2" + "@typescript-eslint/types" "5.39.0" + "@typescript-eslint/visitor-keys" "5.39.0" -"@typescript-eslint/type-utils@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.36.2.tgz#752373f4babf05e993adf2cd543a763632826391" - integrity sha512-rPQtS5rfijUWLouhy6UmyNquKDPhQjKsaKH0WnY6hl/07lasj8gPaH2UD8xWkePn6SC+jW2i9c2DZVDnL+Dokw== +"@typescript-eslint/type-utils@5.39.0": + version "5.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.39.0.tgz#0a8c00f95dce4335832ad2dc6bc431c14e32a0a6" + integrity sha512-KJHJkOothljQWzR3t/GunL0TPKY+fGJtnpl+pX+sJ0YiKTz3q2Zr87SGTmFqsCMFrLt5E0+o+S6eQY0FAXj9uA== dependencies: - "@typescript-eslint/typescript-estree" "5.36.2" - "@typescript-eslint/utils" "5.36.2" + "@typescript-eslint/typescript-estree" "5.39.0" + "@typescript-eslint/utils" "5.39.0" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.36.2.tgz#a5066e500ebcfcee36694186ccc57b955c05faf9" - integrity sha512-9OJSvvwuF1L5eS2EQgFUbECb99F0mwq501w0H0EkYULkhFa19Qq7WFbycdw1PexAc929asupbZcgjVIe6OK/XQ== +"@typescript-eslint/types@5.39.0": + version "5.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.39.0.tgz#f4e9f207ebb4579fd854b25c0bf64433bb5ed78d" + integrity sha512-gQMZrnfEBFXK38hYqt8Lkwt8f4U6yq+2H5VDSgP/qiTzC8Nw8JO3OuSUOQ2qW37S/dlwdkHDntkZM6SQhKyPhw== -"@typescript-eslint/typescript-estree@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.36.2.tgz#0c93418b36c53ba0bc34c61fe9405c4d1d8fe560" - integrity sha512-8fyH+RfbKc0mTspfuEjlfqA4YywcwQK2Amcf6TDOwaRLg7Vwdu4bZzyvBZp4bjt1RRjQ5MDnOZahxMrt2l5v9w== +"@typescript-eslint/typescript-estree@5.39.0": + version "5.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.39.0.tgz#c0316aa04a1a1f4f7f9498e3c13ef1d3dc4cf88b" + integrity sha512-qLFQP0f398sdnogJoLtd43pUgB18Q50QSA+BTE5h3sUxySzbWDpTSdgt4UyxNSozY/oDK2ta6HVAzvGgq8JYnA== dependencies: - "@typescript-eslint/types" "5.36.2" - "@typescript-eslint/visitor-keys" "5.36.2" + "@typescript-eslint/types" "5.39.0" + "@typescript-eslint/visitor-keys" "5.39.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.36.2.tgz#b01a76f0ab244404c7aefc340c5015d5ce6da74c" - integrity sha512-uNcopWonEITX96v9pefk9DC1bWMdkweeSsewJ6GeC7L6j2t0SJywisgkr9wUTtXk90fi2Eljj90HSHm3OGdGRg== +"@typescript-eslint/utils@5.39.0": + version "5.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.39.0.tgz#b7063cca1dcf08d1d21b0d91db491161ad0be110" + integrity sha512-+DnY5jkpOpgj+EBtYPyHRjXampJfC0yUZZzfzLuUWVZvCuKqSdJVC8UhdWipIw7VKNTfwfAPiOWzYkAwuIhiAg== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.36.2" - "@typescript-eslint/types" "5.36.2" - "@typescript-eslint/typescript-estree" "5.36.2" + "@typescript-eslint/scope-manager" "5.39.0" + "@typescript-eslint/types" "5.39.0" + "@typescript-eslint/typescript-estree" "5.39.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.36.2": - version "5.36.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.36.2.tgz#2f8f78da0a3bad3320d2ac24965791ac39dace5a" - integrity sha512-BtRvSR6dEdrNt7Net2/XDjbYKU5Ml6GqJgVfXT0CxTCJlnIqK7rAGreuWKMT2t8cFUT2Msv5oxw0GMRD7T5J7A== +"@typescript-eslint/visitor-keys@5.39.0": + version "5.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.39.0.tgz#8f41f7d241b47257b081ddba5d3ce80deaae61e2" + integrity sha512-yyE3RPwOG+XJBLrhvsxAidUgybJVQ/hG8BhiJo0k8JSAYfk/CshVcxf0HwP4Jt7WZZ6vLmxdo1p6EyN3tzFTkg== dependencies: - "@typescript-eslint/types" "5.36.2" + "@typescript-eslint/types" "5.39.0" eslint-visitor-keys "^3.3.0" "@ungap/promise-all-settled@1.1.2": @@ -1187,9 +1181,9 @@ integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== abortcontroller-polyfill@^1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.3.tgz#1b5b487bd6436b5b764fd52a612509702c3144b5" - integrity sha512-zetDJxd89y3X99Kvo4qFx8GKlt6GsvN3UcRZHwU6iFA/0KiOmhkTVhe8oRoTBiTVPZu09x3vCra47+w8Yz1+2Q== + version "1.7.5" + resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz#6738495f4e901fbb57b6c0611d0c75f76c485bed" + integrity sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ== accepts@~1.3.8: version "1.3.8" @@ -1352,7 +1346,7 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -bignumber.js@^9.0.0, bignumber.js@^9.0.2: +bignumber.js@^9.0.0, bignumber.js@^9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.0.tgz#8d340146107fe3a6cb8d40699643c302e8773b62" integrity sha512-4LwHK4nfDOraBCtst+wOWIHbu1vhvAPJK8g8nROd4iuc3PSEjWif/qwbkh8jwCJz6yDBvtU4KPynETgrfh7y3A== @@ -1387,10 +1381,10 @@ bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -body-parser@1.20.0, body-parser@^1.16.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.0.tgz#3de69bd89011c11573d7bfee6a64f11b6bd27cc5" - integrity sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg== +body-parser@1.20.1, body-parser@^1.16.0: + version "1.20.1" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" + integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== dependencies: bytes "3.1.2" content-type "~1.0.4" @@ -1400,7 +1394,7 @@ body-parser@1.20.0, body-parser@^1.16.0: http-errors "2.0.0" iconv-lite "0.4.24" on-finished "2.4.1" - qs "6.10.3" + qs "6.11.0" raw-body "2.5.1" type-is "~1.6.18" unpipe "1.0.0" @@ -1491,15 +1485,15 @@ browserify-sign@^4.0.0: readable-stream "^3.6.0" safe-buffer "^5.2.0" -browserslist@^4.20.2: - version "4.21.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.3.tgz#5df277694eb3c48bc5c4b05af3e8b7e09c5a6d1a" - integrity sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ== +browserslist@^4.21.3: + version "4.21.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" + integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== dependencies: - caniuse-lite "^1.0.30001370" - electron-to-chromium "^1.4.202" + caniuse-lite "^1.0.30001400" + electron-to-chromium "^1.4.251" node-releases "^2.0.6" - update-browserslist-db "^1.0.5" + update-browserslist-db "^1.0.9" bs58@^4.0.0: version "4.0.1" @@ -1593,10 +1587,10 @@ camelcase@^6.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001370: - version "1.0.30001393" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001393.tgz#1aa161e24fe6af2e2ccda000fc2b94be0b0db356" - integrity sha512-N/od11RX+Gsk+1qY/jbPa0R6zJupEa0lxeBG598EbrtblxVCTJsQwbRBm6+V+rxpc5lHKdsXb9RY83cZIPLseA== +caniuse-lite@^1.0.30001400: + version "1.0.30001418" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001418.tgz#5f459215192a024c99e3e3a53aac310fc7cf24e6" + integrity sha512-oIs7+JL3K9JRQ3jPZjlH6qyYDp+nBTCais7hjh0s+fuBwufc7uZ7hPYMXrDOJhV360KGMTcczMRObk0/iMqZRg== caseless@~0.12.0: version "0.12.0" @@ -1703,6 +1697,15 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + clone-deep@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" @@ -2057,10 +2060,10 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== -electron-to-chromium@^1.4.202: - version "1.4.246" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.246.tgz#802132d1bbd3ff32ce82fcd6a6ed6ab59b4366dc" - integrity sha512-/wFCHUE+Hocqr/LlVGsuKLIw4P2lBWwFIDcNMDpJGzyIysQV4aycpoOitAs32FT94EHKnNqDR/CVZJFbXEufJA== +electron-to-chromium@^1.4.251: + version "1.4.276" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.276.tgz#17837b19dafcc43aba885c4689358b298c19b520" + integrity sha512-EpuHPqu8YhonqLBXHoU6hDJCD98FCe6KDoet3/gY1qsQ6usjJoHqBH2YIVs8FXaAtHwVL8Uqa/fsYao/vq9VWQ== elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.3, elliptic@^6.5.4: version "6.5.4" @@ -2093,21 +2096,21 @@ end-of-stream@^1.1.0: once "^1.4.0" es-abstract@^1.19.0, es-abstract@^1.19.5, es-abstract@^1.20.0: - version "1.20.2" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.2.tgz#8495a07bc56d342a3b8ea3ab01bd986700c2ccb3" - integrity sha512-XxXQuVNrySBNlEkTYJoDNFe5+s2yIOpzq80sUHEdPdQr0S5nTLz4ZPPPswNIpKseDDUS5yghX1gfLIHQZ1iNuQ== + version "1.20.4" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.4.tgz#1d103f9f8d78d4cf0713edcd6d0ed1a46eed5861" + integrity sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" function-bind "^1.1.1" function.prototype.name "^1.1.5" - get-intrinsic "^1.1.2" + get-intrinsic "^1.1.3" get-symbol-description "^1.0.0" has "^1.0.3" has-property-descriptors "^1.0.0" has-symbols "^1.0.3" internal-slot "^1.0.3" - is-callable "^1.2.4" + is-callable "^1.2.7" is-negative-zero "^2.0.2" is-regex "^1.1.4" is-shared-array-buffer "^1.0.2" @@ -2117,6 +2120,7 @@ es-abstract@^1.19.0, es-abstract@^1.19.5, es-abstract@^1.20.0: object-keys "^1.1.1" object.assign "^4.1.4" regexp.prototype.flags "^1.4.3" + safe-regex-test "^1.0.0" string.prototype.trimend "^1.0.5" string.prototype.trimstart "^1.0.5" unbox-primitive "^1.0.2" @@ -2215,13 +2219,12 @@ eslint-visitor-keys@^3.3.0: integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== eslint@^8.16.0: - version "8.23.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.23.0.tgz#a184918d288820179c6041bb3ddcc99ce6eea040" - integrity sha512-pBG/XOn0MsJcKcTRLr27S5HpzQo4kLr+HjLQIyK4EiCsijDl/TB+h5uEuJU6bQ8Edvwz1XWOjpaP2qgnXGpTcA== + version "8.25.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.25.0.tgz#00eb962f50962165d0c4ee3327708315eaa8058b" + integrity sha512-DVlJOZ4Pn50zcKW5bYH7GQK/9MsoQG2d5eDH0ebEkE8PbgzTTmtt/VTH9GGJ4BfeZCpBLqFfvsjX35UacUL83A== dependencies: - "@eslint/eslintrc" "^1.3.1" - "@humanwhocodes/config-array" "^0.10.4" - "@humanwhocodes/gitignore-to-minimatch" "^1.0.2" + "@eslint/eslintrc" "^1.3.3" + "@humanwhocodes/config-array" "^0.10.5" "@humanwhocodes/module-importer" "^1.0.1" ajv "^6.10.0" chalk "^4.0.0" @@ -2238,7 +2241,6 @@ eslint@^8.16.0: fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" find-up "^5.0.0" - functional-red-black-tree "^1.0.1" glob-parent "^6.0.1" globals "^13.15.0" globby "^11.1.0" @@ -2247,6 +2249,7 @@ eslint@^8.16.0: import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" + js-sdsl "^4.1.4" js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" @@ -2397,13 +2400,13 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: safe-buffer "^5.1.1" express@^4.14.0: - version "4.18.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.1.tgz#7797de8b9c72c857b9cd0e14a5eea80666267caf" - integrity sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q== + version "4.18.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" + integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.0" + body-parser "1.20.1" content-disposition "0.5.4" content-type "~1.0.4" cookie "0.5.0" @@ -2422,7 +2425,7 @@ express@^4.14.0: parseurl "~1.3.3" path-to-regexp "0.1.7" proxy-addr "~2.0.7" - qs "6.10.3" + qs "6.11.0" range-parser "~1.2.1" safe-buffer "5.2.1" send "0.18.0" @@ -2575,9 +2578,9 @@ flatted@^3.1.0: integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== follow-redirects@^1.12.1: - version "1.15.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5" - integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== for-each@^0.3.3: version "0.3.3" @@ -2672,11 +2675,6 @@ function.prototype.name@^1.1.5: es-abstract "^1.19.0" functions-have-names "^1.2.2" -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== - functions-have-names@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" @@ -2697,10 +2695,10 @@ get-func-name@^2.0.0: resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.2.tgz#336975123e05ad0b7ba41f152ee4aadbea6cf598" - integrity sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA== +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" + integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== dependencies: function-bind "^1.1.1" has "^1.0.3" @@ -3086,10 +3084,10 @@ is-boolean-object@^1.1.0: call-bind "^1.0.2" has-tostringtag "^1.0.0" -is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" - integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== is-date-object@^1.0.1: version "1.0.5" @@ -3233,6 +3231,11 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== +js-sdsl@^4.1.4: + version "4.1.5" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.1.5.tgz#1ff1645e6b4d1b028cd3f862db88c9d887f26e2a" + integrity sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q== + js-sha3@0.8.0, js-sha3@^0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" @@ -4025,10 +4028,10 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -qs@6.10.3: - version "6.10.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" - integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ== +qs@6.11.0: + version "6.11.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" + integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== dependencies: side-channel "^1.0.4" @@ -4203,10 +4206,10 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^7.5.6: - version "7.5.6" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.6.tgz#0446577557862afd6903517ce7cae79ecb9662bc" - integrity sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw== +rxjs@^7.5.7: + version "7.5.7" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.7.tgz#2ec0d57fdc89ece220d2e702730ae8f1e49def39" + integrity sha512-z9MzKh/UcOqB3i20H6rtrlaE/CgjLOvheWK/9ILrbhROGTweAi1BaFsTT9FbwZi5Trr1qNRs+MXkhmR06awzQA== dependencies: tslib "^2.1.0" @@ -4220,6 +4223,15 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== +safe-regex-test@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" + integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + is-regex "^1.1.4" + "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -4250,9 +4262,9 @@ semver@^6.3.0: integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== semver@^7.3.7: - version "7.3.7" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" - integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== + version "7.3.8" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" + integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== dependencies: lru-cache "^6.0.0" @@ -4368,10 +4380,10 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -solc@0.8.14-fixed: - version "0.8.14-fixed" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.14-fixed.tgz#a730a1e8259ac06313f6b7287df046ebe1dddc13" - integrity sha512-jFYa2fKbk95olckuDbhs9kbtaUhLRllM7aC++mLinJBUcdHbaHVM8LxHaJpOIDdnHBV9TpIP4XBybVugqMDyhA== +solc@0.8.17: + version "0.8.17" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.17.tgz#c748fec6a64bf029ec406aa9b37e75938d1115ae" + integrity sha512-Dtidk2XtTTmkB3IKdyeg6wLYopJnBVxdoykN8oP8VY3PQjN16BScYoUJTXFm2OP7P0hXNAqWiJNmmfuELtLf8g== dependencies: command-exists "^1.2.8" commander "^8.1.0" @@ -4666,14 +4678,14 @@ typedarray-to-buffer@^3.1.5: is-typedarray "^1.0.0" typescript@^4.7.2: - version "4.8.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.3.tgz#d59344522c4bc464a65a730ac695007fdb66dd88" - integrity sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig== + version "4.8.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" + integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== uglify-js@^3.1.4: - version "3.17.0" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.0.tgz#55bd6e9d19ce5eef0d5ad17cd1f587d85b180a85" - integrity sha512-aTeNPVmgIMPpm1cxXr2Q/nEbvkmV8yq66F3om7X3P/cvOXQ0TMQ64Wk63iyT1gPlmdmGzjGpyLh1f3y8MZWXGg== + version "3.17.3" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.3.tgz#f0feedf019c4510f164099e8d7e72ff2d7304377" + integrity sha512-JmMFDME3iufZnBpyKL+uS78LRiC+mK55zWfM5f/pWBJfpOttXAqYfdDGRukYhJuyRinvPVAtUhvy7rlDybNtFg== ultron@~1.1.0: version "1.1.1" @@ -4700,10 +4712,10 @@ unpipe@1.0.0, unpipe@~1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== -update-browserslist-db@^1.0.5: - version "1.0.7" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.7.tgz#16279639cff1d0f800b14792de43d97df2d11b7d" - integrity sha512-iN/XYesmZ2RmmWAiI4Z5rq0YqSiv0brj9Ce9CfhNE4xIW2h+MFxcgkxIzZ+ShkFPUkjU3gQ+3oypadD3RAMtrg== +update-browserslist-db@^1.0.9: + version "1.0.10" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" + integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ== dependencies: escalade "^3.1.1" picocolors "^1.0.0" @@ -4793,85 +4805,85 @@ web-streams-polyfill@^3.0.3: resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== -web3-bzz@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.7.5.tgz#edeb262c3a6619109763077a94172513cf07cdde" - integrity sha512-Z53sY0YK/losqjJncmL4vP0zZI9r6tiXg6o7R6e1JD2Iy7FH3serQvU+qXmPjqEBzsnhf8wTG+YcBPB3RHpr0Q== +web3-bzz@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.8.0.tgz#2023676d7c17ea36512bf76eb310755a02a3d464" + integrity sha512-caDtdKeLi7+2Vb+y+cq2yyhkNjnxkFzVW0j1DtemarBg3dycG1iEl75CVQMLNO6Wkg+HH9tZtRnUyFIe5LIUeQ== dependencies: "@types/node" "^12.12.6" got "12.1.0" swarm-js "^0.1.40" -web3-core-helpers@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.7.5.tgz#e97b3ecac787ade4b9390807a86aca78ed97872b" - integrity sha512-lDDjTks6Q6aNUO87RYrY2xub3UWTKr/RIWxpHJODEqkLxZS1dWdyliJ6aIx3031VQwsNT5HE7NvABe/t0p3iDQ== +web3-core-helpers@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.8.0.tgz#5dcfdda1a4ea277041d912003198f1334ca29d7c" + integrity sha512-nMAVwZB3rEp/khHI2BvFy0e/xCryf501p5NGjswmJtEM+Zrd3Biaw52JrB1qAZZIzCA8cmLKaOgdfamoDOpWdw== dependencies: - web3-eth-iban "1.7.5" - web3-utils "1.7.5" + web3-eth-iban "1.8.0" + web3-utils "1.8.0" -web3-core-method@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.7.5.tgz#ffe8883c169468f0e4d13509377f2d8876d9b7be" - integrity sha512-ApTvq1Llzlbxmy0n4L7QaE6NodIsR80VJqk8qN4kLg30SGznt/pNJFebryLI2kpyDmxSgj1TjEWzmHJBp6FhYg== +web3-core-method@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.8.0.tgz#9c2da8896808917d1679c319f19e2174ba17086c" + integrity sha512-c94RAzo3gpXwf2rf8rL8C77jOzNWF4mXUoUfZYYsiY35cJFd46jQDPI00CB5+ZbICTiA5mlVzMj4e7jAsTqiLA== dependencies: "@ethersproject/transactions" "^5.6.2" - web3-core-helpers "1.7.5" - web3-core-promievent "1.7.5" - web3-core-subscriptions "1.7.5" - web3-utils "1.7.5" + web3-core-helpers "1.8.0" + web3-core-promievent "1.8.0" + web3-core-subscriptions "1.8.0" + web3-utils "1.8.0" -web3-core-promievent@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.7.5.tgz#56a9b06a20e20a0a89d2ab7f88d44c8ae01d5b62" - integrity sha512-uZ1VRErVuhiLtHlyt3oEH/JSvAf6bWPndChHR9PG7i1Zfqm6ZVCeM91ICTPmiL8ddsGQOxASpnJk4vhApcTIww== +web3-core-promievent@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.8.0.tgz#979765fd4d37ab0f158f0ee54037b279b737bd53" + integrity sha512-FGLyjAuOaAQ+ZhV6iuw9tg/9WvIkSZXKHQ4mdTyQ8MxVraOtFivOCbuLLsGgapfHYX+RPxsc1j1YzQjKoupagQ== dependencies: eventemitter3 "4.0.4" -web3-core-requestmanager@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.7.5.tgz#be18fc99642689aeb2e016fa43fb47bb9e8c94ce" - integrity sha512-3KpfxW/wVH4mgwWEsSJGHKrtRVoijWlDxtUrm17xgtqRNZ2mFolifKnHAUKa0fY48C9CrxmcCiMIi3W4G6WYRw== +web3-core-requestmanager@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.8.0.tgz#06189df80cf52d24a195a7ef655031afe8192df3" + integrity sha512-2AoYCs3Owl5foWcf4uKPONyqFygSl9T54L8b581U16nsUirjhoTUGK/PBhMDVcLCmW4QQmcY5A8oPFpkQc1TTg== dependencies: util "^0.12.0" - web3-core-helpers "1.7.5" - web3-providers-http "1.7.5" - web3-providers-ipc "1.7.5" - web3-providers-ws "1.7.5" + web3-core-helpers "1.8.0" + web3-providers-http "1.8.0" + web3-providers-ipc "1.8.0" + web3-providers-ws "1.8.0" -web3-core-subscriptions@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.7.5.tgz#c0e25610768ea9d9f9107b4ac74b6b6573125e00" - integrity sha512-YK6utQ7Wwjbe4XZOIA8quWGBPi1lFDS1A+jQYwxKKrCvm6BloBNc3FhvrcSYlDhLe/kOy8+2Je8i9amndgT4ww== +web3-core-subscriptions@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.8.0.tgz#ff66ae4467c8cb4716367248bcefb1845c0f8b83" + integrity sha512-7lHVRzDdg0+Gcog55lG6Q3D8JV+jN+4Ly6F8cSn9xFUAwOkdbgdWsjknQG7t7CDWy21DQkvdiY2BJF8S68AqOA== dependencies: eventemitter3 "4.0.4" - web3-core-helpers "1.7.5" + web3-core-helpers "1.8.0" -web3-core@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.7.5.tgz#8ee2ca490230a30ca970cb9f308eb65b76405e1d" - integrity sha512-UgOWXZr1fR/3cUQJKWbfMwRxj1/N7o6RSd/dHqdXBlOD+62EjNZItFmLRg5veq5kp9YfXzrNw9bnDkXfsL+nKQ== +web3-core@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.8.0.tgz#90afce527ac1b1dff8cbed2acbc0336530b8aacf" + integrity sha512-9sCA+Z02ci6zoY2bAquFiDjujRwmSKHiSGi4B8IstML8okSytnzXk1izHYSynE7ahIkguhjWAuXFvX76F5rAbA== dependencies: "@types/bn.js" "^5.1.0" "@types/node" "^12.12.6" bignumber.js "^9.0.0" - web3-core-helpers "1.7.5" - web3-core-method "1.7.5" - web3-core-requestmanager "1.7.5" - web3-utils "1.7.5" + web3-core-helpers "1.8.0" + web3-core-method "1.8.0" + web3-core-requestmanager "1.8.0" + web3-utils "1.8.0" -web3-eth-abi@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.7.5.tgz#db9d6dbcc043a6e922252f3228686e9bbd50d7c9" - integrity sha512-qWHvF7sayxql9BD1yqK9sZRLBQ66eJzGeaU53Y1PRq2iFPrhY6NUWxQ3c3ps0rg+dyObvRbloviWpKXcS4RE/A== +web3-eth-abi@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.8.0.tgz#47fdff00bfdfa72064c9c612ff6369986598196d" + integrity sha512-xPeMb2hS9YLQK/Q5YZpkcmzoRGM+/R8bogSrYHhNC3hjZSSU0YRH+1ZKK0f9YF4qDZaPMI8tKWIMSCDIpjG6fg== dependencies: "@ethersproject/abi" "^5.6.3" - web3-utils "1.7.5" + web3-utils "1.8.0" -web3-eth-accounts@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.7.5.tgz#b37ee3aeebcc6bce3337636aeb272cbba0ece547" - integrity sha512-AzMLoTj3RGwKpyp3x3TtHrEeU4VpR99iMOD6NKrWSDumS6QEi0lCo+y7QZhdTlINw3iIA3SFIdvbAOO4NCHSDg== +web3-eth-accounts@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.8.0.tgz#960d947ee87a49d6c706dc6312334fbfbd6ff812" + integrity sha512-HQ/MDSv4bexwJLvnqsM6xpGE7c2NVOqyhzOZFyMUKXbIwIq85T3TaLnM9pCN7XqMpDcfxqiZ3q43JqQVkzHdmw== dependencies: "@ethereumjs/common" "^2.5.0" "@ethereumjs/tx" "^3.3.2" @@ -4880,127 +4892,127 @@ web3-eth-accounts@1.7.5: ethereumjs-util "^7.0.10" scrypt-js "^3.0.1" uuid "3.3.2" - web3-core "1.7.5" - web3-core-helpers "1.7.5" - web3-core-method "1.7.5" - web3-utils "1.7.5" + web3-core "1.8.0" + web3-core-helpers "1.8.0" + web3-core-method "1.8.0" + web3-utils "1.8.0" -web3-eth-contract@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.7.5.tgz#a032419579bcec062513a3d089ad0e89ac63d731" - integrity sha512-qab7NPJRKRlTs58ozsqK8YIEwWpxIm3vD/okSIKBGkFx5gIHWW+vGmMh5PDSfefLJM9rCd+T+Lc0LYvtME7uqg== +web3-eth-contract@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.8.0.tgz#58f4ce0bde74e5ce87663502e409a92abad7b2c5" + integrity sha512-6xeXhW2YoCrz2Ayf2Vm4srWiMOB6LawkvxWJDnUWJ8SMATg4Pgu42C/j8rz/enXbYWt2IKuj0kk8+QszxQbK+Q== dependencies: "@types/bn.js" "^5.1.0" - web3-core "1.7.5" - web3-core-helpers "1.7.5" - web3-core-method "1.7.5" - web3-core-promievent "1.7.5" - web3-core-subscriptions "1.7.5" - web3-eth-abi "1.7.5" - web3-utils "1.7.5" - -web3-eth-ens@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.7.5.tgz#fa0e287f5e6fae20531117b7467e21b482d58cab" - integrity sha512-k1Q0msdRv/wac2egpZBIwG3n/sa/KdrVmVJvFm471gLTL4xfUizV5qJjkDVf+ikf9JyDvWJTs5eWNUUbOFIw/A== + web3-core "1.8.0" + web3-core-helpers "1.8.0" + web3-core-method "1.8.0" + web3-core-promievent "1.8.0" + web3-core-subscriptions "1.8.0" + web3-eth-abi "1.8.0" + web3-utils "1.8.0" + +web3-eth-ens@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.8.0.tgz#f1937371eac54b087ebe2e871780c2710d39998d" + integrity sha512-/eFbQEwvsMOEiOhw9/iuRXCsPkqAmHHWuFOrThQkozRgcnSTRnvxkkRC/b6koiT5/HaKeUs4yQDg+/ixsIxZxA== dependencies: content-hash "^2.5.2" eth-ens-namehash "2.0.8" - web3-core "1.7.5" - web3-core-helpers "1.7.5" - web3-core-promievent "1.7.5" - web3-eth-abi "1.7.5" - web3-eth-contract "1.7.5" - web3-utils "1.7.5" - -web3-eth-iban@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.7.5.tgz#1a50efa42cabf1b731396d38bef6a8bf92b5ee1f" - integrity sha512-mn2W5t/1IpL8OZvzAabLKT4kvwRnZSJ9K0tctndl9sDNWkfITYQibEEhUaNNA50Q5fJKgVudHI/m0gwIVTyG8Q== + web3-core "1.8.0" + web3-core-helpers "1.8.0" + web3-core-promievent "1.8.0" + web3-eth-abi "1.8.0" + web3-eth-contract "1.8.0" + web3-utils "1.8.0" + +web3-eth-iban@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.8.0.tgz#3af8a0c95b5f7b0b81ab0bcd2075c1e5dda31520" + integrity sha512-4RbvUxcMpo/e5811sE3a6inJ2H4+FFqUVmlRYs0RaXaxiHweahSRBNcpO0UWgmlePTolj0rXqPT2oEr0DuC8kg== dependencies: bn.js "^5.2.1" - web3-utils "1.7.5" + web3-utils "1.8.0" -web3-eth-personal@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.7.5.tgz#615a3ddcf97aeea93e2a4569753c033fd7a495c5" - integrity sha512-txh2P/eN8I4AOUKFi9++KKddoD0tWfCuu9Y1Kc41jSRbk6smO88Fum0KWNmYFYhSCX2qiknS1DfqsONl3igoKQ== +web3-eth-personal@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.8.0.tgz#433c35e2e042844402a12d543c4126ea1494b478" + integrity sha512-L7FT4nR3HmsfZyIAhFpEctKkYGOjRC2h6iFKs9gnFCHZga8yLcYcGaYOBIoYtaKom99MuGBoosayWt/Twh7F5A== dependencies: "@types/node" "^12.12.6" - web3-core "1.7.5" - web3-core-helpers "1.7.5" - web3-core-method "1.7.5" - web3-net "1.7.5" - web3-utils "1.7.5" + web3-core "1.8.0" + web3-core-helpers "1.8.0" + web3-core-method "1.8.0" + web3-net "1.8.0" + web3-utils "1.8.0" -web3-eth@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.7.5.tgz#36906f50a6c35570cbc08871a33caa83dc131c9c" - integrity sha512-BucjvqZyDWYkGlsFX+OnOBub0YutlC1KZiNGibdmvtNX0NQK+8iw1uzAoL9yTTwCSszL7lnkFe8N+HCOl9B4Dw== - dependencies: - web3-core "1.7.5" - web3-core-helpers "1.7.5" - web3-core-method "1.7.5" - web3-core-subscriptions "1.7.5" - web3-eth-abi "1.7.5" - web3-eth-accounts "1.7.5" - web3-eth-contract "1.7.5" - web3-eth-ens "1.7.5" - web3-eth-iban "1.7.5" - web3-eth-personal "1.7.5" - web3-net "1.7.5" - web3-utils "1.7.5" - -web3-net@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.7.5.tgz#87fbc00a9ca40515bf60c847c0092498887cfdc8" - integrity sha512-xwuCb2YWw49PmW81AJQ/G+Xi2ikRsYyZXSgyPt4LmZuKjiqg/6kSdK8lZvUi3Pi3wM+QDBXbpr73M/WEkW0KvA== +web3-eth@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.8.0.tgz#006974a5d5e30644d05814111f9e162a72e4a09c" + integrity sha512-hist52os3OT4TQFB/GxPSMxTh3995sz6LPvQpPvj7ktSbpg9RNSFaSsPlCT63wUAHA3PZb1FemkAIeQM5t72Lw== + dependencies: + web3-core "1.8.0" + web3-core-helpers "1.8.0" + web3-core-method "1.8.0" + web3-core-subscriptions "1.8.0" + web3-eth-abi "1.8.0" + web3-eth-accounts "1.8.0" + web3-eth-contract "1.8.0" + web3-eth-ens "1.8.0" + web3-eth-iban "1.8.0" + web3-eth-personal "1.8.0" + web3-net "1.8.0" + web3-utils "1.8.0" + +web3-net@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.8.0.tgz#9acff92d7c647d801bc68df0ff4416f104dbe789" + integrity sha512-kX6EAacK7QrOe7DOh0t5yHS5q2kxZmTCxPVwSz9io9xBeE4n4UhmzGJ/VfhP2eM3OPKYeypcR3LEO6zZ8xn2vw== dependencies: - web3-core "1.7.5" - web3-core-method "1.7.5" - web3-utils "1.7.5" + web3-core "1.8.0" + web3-core-method "1.8.0" + web3-utils "1.8.0" -web3-providers-http@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.7.5.tgz#144bb0c29007d1b766bafb0e20f80be050c7aa80" - integrity sha512-vPgr4Kzy0M3CHtoP/Bh7qwK/D9h2fhjpoqctdMWVJseOfeTgfOphCKN0uwV8w2VpZgDPXA8aeTdBx5OjmDdStA== +web3-providers-http@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.8.0.tgz#3fd1e569ead2095343fac17d53160a3bae674c23" + integrity sha512-/MqxwRzExohBWW97mqlCSW/+NHydGRyoEDUS1bAIF2YjfKFwyRtHgrEzOojzkC9JvB+8LofMvbXk9CcltpZapw== dependencies: abortcontroller-polyfill "^1.7.3" cross-fetch "^3.1.4" es6-promise "^4.2.8" - web3-core-helpers "1.7.5" + web3-core-helpers "1.8.0" -web3-providers-ipc@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.7.5.tgz#5b0f9b4f7340416953b8816d2e42e3f548d47372" - integrity sha512-aNHx+RAROzO+apDEzy8Zncj78iqWBadIXtpmFDg7uiTn8i+oO+IcP1Yni7jyzkltsysVJHgHWG4kPx50ANCK3Q== +web3-providers-ipc@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.8.0.tgz#d339a24c4d764e459e425d3ac868a551ac33e3ea" + integrity sha512-tAXHtVXNUOgehaBU8pzAlB3qhjn/PRpjdzEjzHNFqtRRTwzSEKOJxFeEhaUA4FzHnTlbnrs8ujHWUitcp1elfg== dependencies: oboe "2.1.5" - web3-core-helpers "1.7.5" + web3-core-helpers "1.8.0" -web3-providers-ws@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.7.5.tgz#196b9e56a4a48f9bee54def56875ea53dec7c711" - integrity sha512-9uJNVVkIGC8PmM9kNbgPth56HDMSSsxZh3ZEENdwO3LNWemaADiQYUDCsD/dMVkn0xsGLHP5dgAy4Q5msqySLg== +web3-providers-ws@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.8.0.tgz#a0a73e0606981ea32bed40d215000a64753899de" + integrity sha512-bcZtSifsqyJxwkfQYamfdIRp4nhj9eJd7cxHg1uUkfLJK125WP96wyJL1xbPt7qt0MpfnTFn8/UuIqIB6nFENg== dependencies: eventemitter3 "4.0.4" - web3-core-helpers "1.7.5" + web3-core-helpers "1.8.0" websocket "^1.0.32" -web3-shh@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.7.5.tgz#742e27f5c44bea6d7adef3a49b085e0fcd6aa621" - integrity sha512-aCIWJyLMH5H76OybU4ZpUCJ93yNOPATGhJ+KboRPU8QZDzS2CcVhtEzyl27bbvw+rSnVroMLqBgTXBB4mmKI7A== +web3-shh@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.8.0.tgz#b4abbf4f59d097ce2f74360e61e2e5c0bd6507c7" + integrity sha512-DNRgSa9Jf9xYFUGKSMylrf+zt3MPjhI2qF+UWX07o0y3+uf8zalDGiJOWvIS4upAsdPiKKVJ7co+Neof47OMmg== dependencies: - web3-core "1.7.5" - web3-core-method "1.7.5" - web3-core-subscriptions "1.7.5" - web3-net "1.7.5" + web3-core "1.8.0" + web3-core-method "1.8.0" + web3-core-subscriptions "1.8.0" + web3-net "1.8.0" -web3-utils@1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.7.5.tgz#081a952ac6e0322e25ac97b37358a43c7372ef6a" - integrity sha512-9AqNOziQky4wNQadEwEfHiBdOZqopIHzQQVzmvvv6fJwDSMhP+khqmAZC7YTiGjs0MboyZ8tWNivqSO1699XQw== +web3-utils@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.8.0.tgz#0a506f8c6af9a2ad6ba79689892662769534fc03" + integrity sha512-7nUIl7UWpLVka2f09CMbKOSEvorvHnaugIabU4mj7zfMvm0tSByLcEu3eyV9qgS11qxxLuOkzBIwCstTflhmpQ== dependencies: bn.js "^5.2.1" ethereum-bloom-filters "^1.0.6" @@ -5011,17 +5023,17 @@ web3-utils@1.7.5: utf8 "3.0.0" web3@^1.7.3: - version "1.7.5" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.7.5.tgz#4e185d2058195b5775109b3f27cdea65a34a036e" - integrity sha512-3jHZTWyXt975AOXgnZKayiSWDLpoSKk9fZtLk1hURQtt7AdSbXPT8AK9ooBCm0Dt3GYaOeNcHGaiHC3gtyqhLg== + version "1.8.0" + resolved "https://registry.yarnpkg.com/web3/-/web3-1.8.0.tgz#3ca5f0b32de6a1f626407740411219035b5fde64" + integrity sha512-sldr9stK/SALSJTgI/8qpnDuBJNMGjVR84hJ+AcdQ+MLBGLMGsCDNubCoyO6qgk1/Y9SQ7ignegOI/7BPLoiDA== dependencies: - web3-bzz "1.7.5" - web3-core "1.7.5" - web3-eth "1.7.5" - web3-eth-personal "1.7.5" - web3-net "1.7.5" - web3-shh "1.7.5" - web3-utils "1.7.5" + web3-bzz "1.8.0" + web3-core "1.8.0" + web3-eth "1.8.0" + web3-eth-personal "1.8.0" + web3-net "1.8.0" + web3-shh "1.8.0" + web3-utils "1.8.0" webidl-conversions@^3.0.0: version "3.0.1" @@ -5116,6 +5128,11 @@ ws@^3.0.0: safe-buffer "~5.1.0" ultron "~1.1.0" +ws@^8.8.1: + version "8.9.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.9.0.tgz#2a994bb67144be1b53fe2d23c53c028adeb7f45e" + integrity sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg== + xhr-request-promise@^0.1.2: version "0.1.3" resolved "https://registry.yarnpkg.com/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz#2d5f4b16d8c6c893be97f1a62b0ed4cf3ca5f96c" @@ -5209,12 +5226,12 @@ yargs@16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.5.1: - version "17.5.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.5.1.tgz#e109900cab6fcb7fd44b1d8249166feb0b36e58e" - integrity sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA== +yargs@^17.6.0: + version "17.6.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.0.tgz#e134900fc1f218bc230192bdec06a0a5f973e46c" + integrity sha512-8H/wTDqlSwoSnScvV2N/JHfLWOKuh5MVla9hqLjK3nsfyy6Y4kDSYSvkU5YCUEPOSnRXfIyx3Sq+B/IWudTo4g== dependencies: - cliui "^7.0.2" + cliui "^8.0.1" escalade "^3.1.1" get-caller-file "^2.0.5" require-directory "^2.1.1" From 258e5a1bc41175e34f3ba5af06fa503f0cc151aa Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Wed, 12 Oct 2022 10:27:22 +0000 Subject: [PATCH 1106/1274] tests: rearrange scripts & lift top util files to util folder --- tests/package.json | 20 +++++++++---------- tests/src/addCollectionAdmin.test.ts | 2 +- tests/src/adminTransferAndBurn.test.ts | 2 +- tests/src/allowLists.test.ts | 2 +- tests/src/app-promotion.seqtest.ts | 4 ++-- tests/src/app-promotion.test.ts | 6 +++--- tests/src/approve.test.ts | 2 +- tests/src/block-production.test.ts | 2 +- tests/src/burnItem.test.ts | 2 +- tests/src/calibrate.ts | 12 +++++------ tests/src/change-collection-owner.test.ts | 2 +- tests/src/check-event/burnItemEvent.test.ts | 2 +- .../check-event/createCollectionEvent.test.ts | 2 +- tests/src/check-event/createItemEvent.test.ts | 2 +- .../createMultipleItemsEvent.test.ts | 2 +- .../destroyCollectionEvent.test.ts | 2 +- tests/src/check-event/transferEvent.test.ts | 2 +- .../src/check-event/transferFromEvent.test.ts | 2 +- tests/src/confirmSponsorship.test.ts | 2 +- tests/src/connection.test.ts | 2 +- tests/src/createCollection.test.ts | 2 +- tests/src/createItem.test.ts | 2 +- tests/src/createMultipleItems.test.ts | 2 +- tests/src/createMultipleItemsEx.test.ts | 2 +- tests/src/creditFeesToTreasury.seqtest.ts | 2 +- tests/src/destroyCollection.test.ts | 2 +- tests/src/enableDisableTransfer.test.ts | 2 +- tests/src/eth/allowlist.test.ts | 2 +- tests/src/eth/base.test.ts | 2 +- tests/src/eth/collectionAdmin.test.ts | 2 +- tests/src/eth/collectionProperties.test.ts | 2 +- tests/src/eth/collectionSponsoring.test.ts | 20 +++++++++++++++++-- tests/src/eth/contractSponsoring.test.ts | 4 ++-- tests/src/eth/createNFTCollection.test.ts | 2 +- tests/src/eth/createRFTCollection.test.ts | 4 ++-- tests/src/eth/crossTransfer.test.ts | 2 +- tests/src/eth/evmCoder.test.ts | 2 +- .../eth/fractionalizer/fractionalizer.test.ts | 4 ++-- tests/src/eth/fungible.test.ts | 2 +- tests/src/eth/helpersSmoke.test.ts | 2 +- tests/src/eth/marketplace/marketplace.test.ts | 2 +- tests/src/eth/migration.test.ts | 2 +- tests/src/eth/nesting/nest.test.ts | 2 +- tests/src/eth/nonFungible.test.ts | 2 +- tests/src/eth/payable.test.ts | 2 +- tests/src/eth/proxy/fungibleProxy.test.ts | 2 +- tests/src/eth/proxy/nonFungibleProxy.test.ts | 2 +- tests/src/eth/reFungible.test.ts | 4 ++-- tests/src/eth/reFungibleToken.test.ts | 4 ++-- tests/src/eth/sponsoring.test.ts | 4 ++-- tests/src/eth/tokenProperties.test.ts | 2 +- tests/src/eth/util/{playgrounds => }/index.ts | 10 +++++----- tests/src/fungible.test.ts | 2 +- tests/src/getPropertiesRpc.test.ts | 2 +- tests/src/inflation.test.ts | 2 +- tests/src/limits.test.ts | 2 +- .../src/nesting/collectionProperties.test.ts | 2 +- tests/src/nesting/graphs.test.ts | 2 +- tests/src/nesting/nest.test.ts | 2 +- tests/src/nesting/propertyPermissions.test.ts | 2 +- tests/src/nesting/tokenProperties.test.ts | 2 +- tests/src/nesting/unnest.test.ts | 2 +- tests/src/nextSponsoring.test.ts | 2 +- tests/src/pallet-presence.test.ts | 2 +- tests/src/refungible.test.ts | 2 +- tests/src/removeCollectionAdmin.test.ts | 2 +- tests/src/removeCollectionSponsor.test.ts | 2 +- tests/src/rpc.test.ts | 2 +- tests/src/setCollectionLimits.test.ts | 2 +- tests/src/setCollectionSponsor.test.ts | 2 +- tests/src/setPermissions.test.ts | 2 +- tests/src/transfer.test.ts | 4 ++-- tests/src/transferFrom.test.ts | 2 +- tests/src/tx-version-presence.test.ts | 2 +- .../src/util/{playgrounds => }/globalSetup.ts | 8 ++++---- tests/src/util/{playgrounds => }/index.ts | 6 +++--- tests/src/util/playgrounds/unique.dev.ts | 2 +- 77 files changed, 127 insertions(+), 111 deletions(-) rename tests/src/eth/util/{playgrounds => }/index.ts (92%) rename tests/src/util/{playgrounds => }/globalSetup.ts (94%) rename tests/src/util/{playgrounds => }/index.ts (96%) diff --git a/tests/package.json b/tests/package.json index e159f08c88..ff1780ea37 100644 --- a/tests/package.json +++ b/tests/package.json @@ -21,23 +21,23 @@ }, "mocha": { "timeout": 9999999, - "require": ["ts-node/register", "./src/util/playgrounds/globalSetup.ts"] + "require": ["ts-node/register", "./src/util/globalSetup.ts"] }, "scripts": { "lint": "eslint --ext .ts,.js src/", "fix": "eslint --ext .ts,.js src/ --fix", - "test": "yarn testParallel && yarn testSequential", + "test": "mocha --timeout 9999999 -r ts-node/register './src/**/*.*test.ts'", + "testParallelFull": "yarn testParallel && yarn testSequential", "testParallel": "mocha --parallel --timeout 9999999 -r ts-node/register './src/**/*.test.ts'", "testSequential": "mocha --timeout 9999999 -r ts-node/register './src/**/*.seqtest.ts'", - "testDevnode": "mocha --timeout 9999999 -r ts-node/register './src/**/*test.ts'", - "testStructure": "mocha --parallel --timeout 9999999 -r ts-node/register ./**/nesting/**.test.ts", - "testEth": "mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/**/*.test.ts'", - "testEthNesting": "mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/nesting/**/*.test.ts'", - "testEthFractionalizer": "mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/fractionalizer/**/*.test.ts'", - "testEthMarketplace": "mocha --parallel --timeout 9999999 -r ts-node/register './**/eth/marketplace/**/*.test.ts'", - "testEvent": "mocha --parallel --timeout 9999999 -r ts-node/register ./src/check-event/*.test.ts", - "testRmrk": "mocha --timeout 9999999 -r ts-node/register ./**/rmrk/**test.ts", + "testStructure": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/*.*test.ts", + "testEth": "mocha --timeout 9999999 -r ts-node/register './**/eth/**/*.*test.ts'", + "testEthNesting": "mocha --timeout 9999999 -r ts-node/register './**/eth/nesting/**/*.*test.ts'", + "testEthFractionalizer": "mocha --timeout 9999999 -r ts-node/register './**/eth/fractionalizer/**/*.*test.ts'", + "testEthMarketplace": "mocha --timeout 9999999 -r ts-node/register './**/eth/marketplace/**/*.*test.ts'", + "testEvent": "mocha --timeout 9999999 -r ts-node/register ./src/check-event/*.*test.ts", + "testRmrk": "mocha --timeout 9999999 -r ts-node/register ./**/rmrk/*.*test.ts", "testEthPayable": "mocha --timeout 9999999 -r ts-node/register './**/eth/payable.test.ts'", "testEthTokenProperties": "mocha --timeout 9999999 -r ts-node/register ./**/eth/tokenProperties.test.ts", diff --git a/tests/src/addCollectionAdmin.test.ts b/tests/src/addCollectionAdmin.test.ts index 9ba732a3a0..7d22084f1c 100644 --- a/tests/src/addCollectionAdmin.test.ts +++ b/tests/src/addCollectionAdmin.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; +import {itSub, usingPlaygrounds, expect} from './util'; describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => { let donor: IKeyringPair; diff --git a/tests/src/adminTransferAndBurn.test.ts b/tests/src/adminTransferAndBurn.test.ts index e5af146b0a..05c6f89b1e 100644 --- a/tests/src/adminTransferAndBurn.test.ts +++ b/tests/src/adminTransferAndBurn.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub} from './util/playgrounds'; +import {usingPlaygrounds, expect, itSub} from './util'; describe('Integration Test: ownerCanTransfer allows admins to use only transferFrom/burnFrom:', () => { let alice: IKeyringPair; diff --git a/tests/src/allowLists.test.ts b/tests/src/allowLists.test.ts index 3e219c2f29..6666cbac75 100644 --- a/tests/src/allowLists.test.ts +++ b/tests/src/allowLists.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub} from './util/playgrounds'; +import {usingPlaygrounds, expect, itSub} from './util'; import {ICollectionPermissions} from './util/playgrounds/types'; describe('Integration Test ext. Allow list tests', () => { diff --git a/tests/src/app-promotion.seqtest.ts b/tests/src/app-promotion.seqtest.ts index a39e42d779..c2818cb451 100644 --- a/tests/src/app-promotion.seqtest.ts +++ b/tests/src/app-promotion.seqtest.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip} from './util/playgrounds'; -import {expect} from './eth/util/playgrounds'; +import {itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip} from './util'; +import {expect} from './eth/util'; let superuser: IKeyringPair; let donor: IKeyringPair; diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index a31b9b7888..da6833eff5 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -15,9 +15,9 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip} from './util/playgrounds'; +import {itSub, usingPlaygrounds, Pallets, requirePalletsOrSkip} from './util'; import {DevUniqueHelper} from './util/playgrounds/unique.dev'; -import {itEth, expect, SponsoringMode} from './eth/util/playgrounds'; +import {itEth, expect, SponsoringMode} from './eth/util'; let donor: IKeyringPair; let palletAdmin: IKeyringPair; @@ -36,7 +36,7 @@ describe('App promotion', () => { await usingPlaygrounds(async (helper, privateKey) => { requirePalletsOrSkip(this, helper, [Pallets.AppPromotion]); donor = await privateKey({filename: __filename}); - palletAddress = helper.arrange.calculatePalleteAddress('appstake'); + palletAddress = helper.arrange.calculatePalletAddress('appstake'); palletAdmin = await privateKey('//PromotionAdmin'); nominal = helper.balance.getOneTokenNominal(); accounts = await helper.arrange.createCrowd(100, 1000n, donor); // create accounts-pool to speed up tests diff --git a/tests/src/approve.test.ts b/tests/src/approve.test.ts index be305713b9..0c2cc91702 100644 --- a/tests/src/approve.test.ts +++ b/tests/src/approve.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, Pallets, usingPlaygrounds} from './util/playgrounds'; +import {expect, itSub, Pallets, usingPlaygrounds} from './util'; describe('Integration Test approve(spender, collection_id, item_id, amount):', () => { diff --git a/tests/src/block-production.test.ts b/tests/src/block-production.test.ts index 4c22da3c12..9ba293334a 100644 --- a/tests/src/block-production.test.ts +++ b/tests/src/block-production.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {ApiPromise} from '@polkadot/api'; -import {expect, itSub} from './util/playgrounds'; +import {expect, itSub} from './util'; const BLOCK_TIME_MS = 12000; const TOLERANCE_MS = 3000; diff --git a/tests/src/burnItem.test.ts b/tests/src/burnItem.test.ts index 050aab3c1a..4439cf940a 100644 --- a/tests/src/burnItem.test.ts +++ b/tests/src/burnItem.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, Pallets, usingPlaygrounds} from './util/playgrounds'; +import {expect, itSub, Pallets, usingPlaygrounds} from './util'; describe('integration test: ext. burnItem():', () => { diff --git a/tests/src/calibrate.ts b/tests/src/calibrate.ts index 6838634468..390a7b4e8d 100644 --- a/tests/src/calibrate.ts +++ b/tests/src/calibrate.ts @@ -1,6 +1,6 @@ import {IKeyringPair} from '@polkadot/types/types'; -import {usingEthPlaygrounds, EthUniqueHelper} from './eth/util/playgrounds'; +import {usingEthPlaygrounds, EthUniqueHelper} from './eth/util'; function linearRegression(points: { x: bigint, y: bigint }[]) { @@ -56,9 +56,9 @@ function _error(points: { x: bigint, y: bigint }[], hypothesis: (a: bigint) => b }).reduce((a, b) => a + b, 0n) / BigInt(points.length)); } -async function calibrateWeightToFee(helper: EthUniqueHelper, privateKey: (account: string) => IKeyringPair) { - const alice = privateKey('//Alice'); - const bob = privateKey('//Bob'); +async function calibrateWeightToFee(helper: EthUniqueHelper, privateKey: (account: string) => Promise) { + const alice = await privateKey('//Alice'); + const bob = await privateKey('//Bob'); const dataPoints = []; { @@ -106,8 +106,8 @@ async function calibrateWeightToFee(helper: EthUniqueHelper, privateKey: (accoun } } -async function calibrateMinGasPrice(helper: EthUniqueHelper, privateKey: (account: string) => IKeyringPair) { - const alice = privateKey('//Alice'); +async function calibrateMinGasPrice(helper: EthUniqueHelper, privateKey: (account: string) => Promise) { + const alice = await privateKey('//Alice'); const caller = await helper.eth.createAccountWithBalance(alice); const receiver = helper.eth.createAccount(); const dataPoints = []; diff --git a/tests/src/change-collection-owner.test.ts b/tests/src/change-collection-owner.test.ts index 4fd49c538c..26c2405f3c 100644 --- a/tests/src/change-collection-owner.test.ts +++ b/tests/src/change-collection-owner.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub} from './util/playgrounds'; +import {usingPlaygrounds, expect, itSub} from './util'; describe('Integration Test changeCollectionOwner(collection_id, new_owner):', () => { let alice: IKeyringPair; diff --git a/tests/src/check-event/burnItemEvent.test.ts b/tests/src/check-event/burnItemEvent.test.ts index fc7c4f26fe..a14cea604a 100644 --- a/tests/src/check-event/burnItemEvent.test.ts +++ b/tests/src/check-event/burnItemEvent.test.ts @@ -16,7 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub} from '../util/playgrounds'; +import {usingPlaygrounds, expect, itSub} from '../util'; import {IEvent} from '../util/playgrounds/types'; diff --git a/tests/src/check-event/createCollectionEvent.test.ts b/tests/src/check-event/createCollectionEvent.test.ts index 19a4766dd3..82f73009f3 100644 --- a/tests/src/check-event/createCollectionEvent.test.ts +++ b/tests/src/check-event/createCollectionEvent.test.ts @@ -16,7 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, itSub, expect} from '../util/playgrounds'; +import {usingPlaygrounds, itSub, expect} from '../util'; import {IEvent} from '../util/playgrounds/types'; describe('Create collection event ', () => { diff --git a/tests/src/check-event/createItemEvent.test.ts b/tests/src/check-event/createItemEvent.test.ts index 461e44fb3c..06c7754b8a 100644 --- a/tests/src/check-event/createItemEvent.test.ts +++ b/tests/src/check-event/createItemEvent.test.ts @@ -16,7 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from '../util/playgrounds'; +import {itSub, usingPlaygrounds, expect} from '../util'; import {IEvent} from '../util/playgrounds/types'; describe('Create Item event ', () => { diff --git a/tests/src/check-event/createMultipleItemsEvent.test.ts b/tests/src/check-event/createMultipleItemsEvent.test.ts index c89ac505f9..49dcb1a043 100644 --- a/tests/src/check-event/createMultipleItemsEvent.test.ts +++ b/tests/src/check-event/createMultipleItemsEvent.test.ts @@ -16,7 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, itSub, expect} from '../util/playgrounds'; +import {usingPlaygrounds, itSub, expect} from '../util'; import {IEvent} from '../util/playgrounds/types'; describe('Create Multiple Items Event event ', () => { diff --git a/tests/src/check-event/destroyCollectionEvent.test.ts b/tests/src/check-event/destroyCollectionEvent.test.ts index 0c4c94ec92..682daf6188 100644 --- a/tests/src/check-event/destroyCollectionEvent.test.ts +++ b/tests/src/check-event/destroyCollectionEvent.test.ts @@ -16,7 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from '../util/playgrounds'; +import {itSub, usingPlaygrounds, expect} from '../util'; import {IEvent} from '../util/playgrounds/types'; describe('Destroy collection event ', () => { diff --git a/tests/src/check-event/transferEvent.test.ts b/tests/src/check-event/transferEvent.test.ts index 24166bf061..f51e96fdf1 100644 --- a/tests/src/check-event/transferEvent.test.ts +++ b/tests/src/check-event/transferEvent.test.ts @@ -16,7 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub} from '../util/playgrounds'; +import {usingPlaygrounds, expect, itSub} from '../util'; import {IEvent} from '../util/playgrounds/types'; describe('Transfer event ', () => { diff --git a/tests/src/check-event/transferFromEvent.test.ts b/tests/src/check-event/transferFromEvent.test.ts index c11c7cac08..cb5be98f48 100644 --- a/tests/src/check-event/transferFromEvent.test.ts +++ b/tests/src/check-event/transferFromEvent.test.ts @@ -16,7 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub} from '../util/playgrounds'; +import {usingPlaygrounds, expect, itSub} from '../util'; import {IEvent} from '../util/playgrounds/types'; describe('Transfer event ', () => { diff --git a/tests/src/confirmSponsorship.test.ts b/tests/src/confirmSponsorship.test.ts index 02a293f3bf..ba28b60694 100644 --- a/tests/src/confirmSponsorship.test.ts +++ b/tests/src/confirmSponsorship.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub, Pallets} from './util/playgrounds'; +import {usingPlaygrounds, expect, itSub, Pallets} from './util'; async function setSponsorHelper(collection: any, signer: IKeyringPair, sponsorAddress: string) { await collection.setSponsor(signer, sponsorAddress); diff --git a/tests/src/connection.test.ts b/tests/src/connection.test.ts index 0785bf10ed..07a5f0a7aa 100644 --- a/tests/src/connection.test.ts +++ b/tests/src/connection.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {itSub, expect, usingPlaygrounds} from './util/playgrounds'; +import {itSub, expect, usingPlaygrounds} from './util'; describe('Connection smoke test', () => { itSub('Connection can be established', async ({helper}) => { diff --git a/tests/src/createCollection.test.ts b/tests/src/createCollection.test.ts index 479f44ec5b..f0e6c393c0 100644 --- a/tests/src/createCollection.test.ts +++ b/tests/src/createCollection.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub, Pallets} from './util/playgrounds'; +import {usingPlaygrounds, expect, itSub, Pallets} from './util'; import {ICollectionCreationOptions, IProperty} from './util/playgrounds/types'; import {UniqueHelper} from './util/playgrounds/unique'; diff --git a/tests/src/createItem.test.ts b/tests/src/createItem.test.ts index f573b4d88f..505a1abcb5 100644 --- a/tests/src/createItem.test.ts +++ b/tests/src/createItem.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, itSub, Pallets} from './util/playgrounds'; +import {usingPlaygrounds, expect, itSub, Pallets} from './util'; import {IProperty, ICrossAccountId} from './util/playgrounds/types'; import {UniqueHelper} from './util/playgrounds/unique'; diff --git a/tests/src/createMultipleItems.test.ts b/tests/src/createMultipleItems.test.ts index d4fb0e81a8..b9f3820bcf 100644 --- a/tests/src/createMultipleItems.test.ts +++ b/tests/src/createMultipleItems.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, Pallets, itSub} from './util/playgrounds'; +import {usingPlaygrounds, expect, Pallets, itSub} from './util'; describe('Integration Test createMultipleItems(collection_id, owner, items_data):', () => { let alice: IKeyringPair; diff --git a/tests/src/createMultipleItemsEx.test.ts b/tests/src/createMultipleItemsEx.test.ts index 09e7fc0ebc..350c386ac1 100644 --- a/tests/src/createMultipleItemsEx.test.ts +++ b/tests/src/createMultipleItemsEx.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, expect, Pallets, itSub} from './util/playgrounds'; +import {usingPlaygrounds, expect, Pallets, itSub} from './util'; import {IProperty} from './util/playgrounds/types'; describe('Integration Test: createMultipleItemsEx', () => { diff --git a/tests/src/creditFeesToTreasury.seqtest.ts b/tests/src/creditFeesToTreasury.seqtest.ts index df7d502e64..95e120d261 100644 --- a/tests/src/creditFeesToTreasury.seqtest.ts +++ b/tests/src/creditFeesToTreasury.seqtest.ts @@ -17,7 +17,7 @@ import './interfaces/augment-api-consts'; import {IKeyringPair} from '@polkadot/types/types'; import {ApiPromise} from '@polkadot/api'; -import {usingPlaygrounds, expect, itSub} from './util/playgrounds'; +import {usingPlaygrounds, expect, itSub} from './util'; const TREASURY = '5EYCAe5ijiYfyeZ2JJCGq56LmPyNRAKzpG4QkoQkkQNB5e6Z'; const saneMinimumFee = 0.05; diff --git a/tests/src/destroyCollection.test.ts b/tests/src/destroyCollection.test.ts index eadb9f2347..d51c9f142a 100644 --- a/tests/src/destroyCollection.test.ts +++ b/tests/src/destroyCollection.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, expect, usingPlaygrounds, Pallets} from './util/playgrounds'; +import {itSub, expect, usingPlaygrounds, Pallets} from './util'; describe('integration test: ext. destroyCollection():', () => { let alice: IKeyringPair; diff --git a/tests/src/enableDisableTransfer.test.ts b/tests/src/enableDisableTransfer.test.ts index 64d8b6a21d..401c1d67d7 100644 --- a/tests/src/enableDisableTransfer.test.ts +++ b/tests/src/enableDisableTransfer.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; +import {itSub, usingPlaygrounds, expect} from './util'; describe('Enable/Disable Transfers', () => { let alice: IKeyringPair; diff --git a/tests/src/eth/allowlist.test.ts b/tests/src/eth/allowlist.test.ts index 445f26f254..5ea1df6a02 100644 --- a/tests/src/eth/allowlist.test.ts +++ b/tests/src/eth/allowlist.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itEth, usingEthPlaygrounds, expect} from './util/playgrounds'; +import {itEth, usingEthPlaygrounds, expect} from './util'; describe('EVM contract allowlist', () => { let donor: IKeyringPair; diff --git a/tests/src/eth/base.test.ts b/tests/src/eth/base.test.ts index ede4d76f38..b1a0e20b81 100644 --- a/tests/src/eth/base.test.ts +++ b/tests/src/eth/base.test.ts @@ -17,7 +17,7 @@ import {Contract} from 'web3-eth-contract'; import {IKeyringPair} from '@polkadot/types/types'; -import {EthUniqueHelper, itEth, usingEthPlaygrounds, expect} from './util/playgrounds'; +import {EthUniqueHelper, itEth, usingEthPlaygrounds, expect} from './util'; describe('Contract calls', () => { diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index 7a87569ee3..5ea88ad3e3 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -14,7 +14,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {usingEthPlaygrounds, itEth, expect, EthUniqueHelper} from './util/playgrounds'; +import {usingEthPlaygrounds, itEth, expect, EthUniqueHelper} from './util'; async function recordEthFee(helper: EthUniqueHelper, userAddress: string, call: () => Promise) { const before = await helper.balance.getSubstrate(helper.address.ethToSubstrate(userAddress)); diff --git a/tests/src/eth/collectionProperties.test.ts b/tests/src/eth/collectionProperties.test.ts index ef96611166..d7edc59c80 100644 --- a/tests/src/eth/collectionProperties.test.ts +++ b/tests/src/eth/collectionProperties.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {itEth, usingEthPlaygrounds, expect} from './util/playgrounds'; +import {itEth, usingEthPlaygrounds, expect} from './util'; import {IKeyringPair} from '@polkadot/types/types'; describe('EVM collection properties', () => { diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index 33160858e6..32800875d7 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -1,6 +1,22 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds} from './../util/playgrounds/index'; -import {itEth, expect} from '../eth/util/playgrounds'; +import {usingPlaygrounds} from '../util/index'; +import {itEth, expect} from './util'; describe('evm collection sponsoring', () => { let donor: IKeyringPair; diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index a1a4f84161..ea89cea2a1 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -16,8 +16,8 @@ import {IKeyringPair} from '@polkadot/types/types'; import {EthUniqueHelper} from './util/playgrounds/unique.dev'; -import {itEth, expect, SponsoringMode, usingEthPlaygrounds} from '../eth/util/playgrounds'; -import {usingPlaygrounds} from '../util/playgrounds'; +import {itEth, expect, SponsoringMode, usingEthPlaygrounds} from './util'; +import {usingPlaygrounds} from '../util'; import {CompiledContract} from './util/playgrounds/types'; describe('Sponsoring EVM contracts', () => { diff --git a/tests/src/eth/createNFTCollection.test.ts b/tests/src/eth/createNFTCollection.test.ts index e4cd35171c..a047725508 100644 --- a/tests/src/eth/createNFTCollection.test.ts +++ b/tests/src/eth/createNFTCollection.test.ts @@ -16,7 +16,7 @@ import {evmToAddress} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; -import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {expect, itEth, usingEthPlaygrounds} from './util'; describe('Create NFT collection from EVM', () => { diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts index c2c08508d7..3a6df5d01c 100644 --- a/tests/src/eth/createRFTCollection.test.ts +++ b/tests/src/eth/createRFTCollection.test.ts @@ -16,8 +16,8 @@ import {evmToAddress} from '@polkadot/util-crypto'; import {IKeyringPair} from '@polkadot/types/types'; -import {Pallets, requirePalletsOrSkip} from '../util/playgrounds'; -import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {Pallets, requirePalletsOrSkip} from '../util'; +import {expect, itEth, usingEthPlaygrounds} from './util'; describe('Create RFT collection from EVM', () => { diff --git a/tests/src/eth/crossTransfer.test.ts b/tests/src/eth/crossTransfer.test.ts index c2d0e9072c..e515db5752 100644 --- a/tests/src/eth/crossTransfer.test.ts +++ b/tests/src/eth/crossTransfer.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {itEth, usingEthPlaygrounds} from './util'; import {CrossAccountId} from '../util/playgrounds/unique'; import {IKeyringPair} from '@polkadot/types/types'; diff --git a/tests/src/eth/evmCoder.test.ts b/tests/src/eth/evmCoder.test.ts index 47661307d5..4b14aca4c4 100644 --- a/tests/src/eth/evmCoder.test.ts +++ b/tests/src/eth/evmCoder.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itEth, expect, usingEthPlaygrounds} from './util/playgrounds'; +import {itEth, expect, usingEthPlaygrounds} from './util'; const getContractSource = (collectionAddress: string, contractAddress: string): string => { return ` diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index ac8a966a9c..85fe445237 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -22,9 +22,9 @@ import {evmToAddress} from '@polkadot/util-crypto'; import {Contract} from 'web3-eth-contract'; -import {usingEthPlaygrounds, expect, itEth, EthUniqueHelper} from '../util/playgrounds'; +import {usingEthPlaygrounds, expect, itEth, EthUniqueHelper} from '../util'; import {CompiledContract} from '../util/playgrounds/types'; -import {requirePalletsOrSkip, Pallets} from '../../util/playgrounds'; +import {requirePalletsOrSkip, Pallets} from '../../util'; let compiledFractionalizer: CompiledContract; diff --git a/tests/src/eth/fungible.test.ts b/tests/src/eth/fungible.test.ts index bd843e1690..0625f2dc26 100644 --- a/tests/src/eth/fungible.test.ts +++ b/tests/src/eth/fungible.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {expect, itEth, usingEthPlaygrounds} from './util'; import {IKeyringPair} from '@polkadot/types/types'; describe('Fungible: Information getting', () => { diff --git a/tests/src/eth/helpersSmoke.test.ts b/tests/src/eth/helpersSmoke.test.ts index ec85ad499c..31140efa06 100644 --- a/tests/src/eth/helpersSmoke.test.ts +++ b/tests/src/eth/helpersSmoke.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {expect, itEth, usingEthPlaygrounds} from './util'; import {IKeyringPair} from '@polkadot/types/types'; describe('Helpers sanity check', () => { diff --git a/tests/src/eth/marketplace/marketplace.test.ts b/tests/src/eth/marketplace/marketplace.test.ts index 7159cda05b..90ce502dd3 100644 --- a/tests/src/eth/marketplace/marketplace.test.ts +++ b/tests/src/eth/marketplace/marketplace.test.ts @@ -16,7 +16,7 @@ import {IKeyringPair} from '@polkadot/types/types'; import {readFile} from 'fs/promises'; -import {itEth, usingEthPlaygrounds, expect, SponsoringMode} from '../util/playgrounds'; +import {itEth, usingEthPlaygrounds, expect, SponsoringMode} from '../util'; describe('Matcher contract usage', () => { const PRICE = 2000n; diff --git a/tests/src/eth/migration.test.ts b/tests/src/eth/migration.test.ts index d2a3762308..0cc8456c1f 100644 --- a/tests/src/eth/migration.test.ts +++ b/tests/src/eth/migration.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {expect, itEth, usingEthPlaygrounds} from './util'; import {IKeyringPair} from '@polkadot/types/types'; describe('EVM Migrations', () => { diff --git a/tests/src/eth/nesting/nest.test.ts b/tests/src/eth/nesting/nest.test.ts index d163795dd2..bb021699e8 100644 --- a/tests/src/eth/nesting/nest.test.ts +++ b/tests/src/eth/nesting/nest.test.ts @@ -1,7 +1,7 @@ import {IKeyringPair} from '@polkadot/types/types'; import {Contract} from 'web3-eth-contract'; -import {itEth, EthUniqueHelper, usingEthPlaygrounds, expect} from '../util/playgrounds'; +import {itEth, EthUniqueHelper, usingEthPlaygrounds, expect} from '../util'; const createNestingCollection = async ( helper: EthUniqueHelper, diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index db4451a3fe..23e86e07f2 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {itEth, usingEthPlaygrounds, expect, EthUniqueHelper} from './util/playgrounds'; +import {itEth, usingEthPlaygrounds, expect, EthUniqueHelper} from './util'; import {IKeyringPair} from '@polkadot/types/types'; import {Contract} from 'web3-eth-contract'; diff --git a/tests/src/eth/payable.test.ts b/tests/src/eth/payable.test.ts index d60535429c..e2382497c7 100644 --- a/tests/src/eth/payable.test.ts +++ b/tests/src/eth/payable.test.ts @@ -16,7 +16,7 @@ import {IKeyringPair} from '@polkadot/types/types'; -import {itEth, expect, usingEthPlaygrounds, EthUniqueHelper} from './util/playgrounds'; +import {itEth, expect, usingEthPlaygrounds, EthUniqueHelper} from './util'; describe('EVM payable contracts', () => { let donor: IKeyringPair; diff --git a/tests/src/eth/proxy/fungibleProxy.test.ts b/tests/src/eth/proxy/fungibleProxy.test.ts index 8979357b71..47475cacfb 100644 --- a/tests/src/eth/proxy/fungibleProxy.test.ts +++ b/tests/src/eth/proxy/fungibleProxy.test.ts @@ -17,7 +17,7 @@ import {expect} from 'chai'; import {readFile} from 'fs/promises'; import {IKeyringPair} from '@polkadot/types/types'; -import {EthUniqueHelper, itEth, usingEthPlaygrounds} from '../util/playgrounds'; +import {EthUniqueHelper, itEth, usingEthPlaygrounds} from '../util'; async function proxyWrap(helper: EthUniqueHelper, wrapped: any, donor: IKeyringPair) { // Proxy owner has no special privilegies, we don't need to reuse them diff --git a/tests/src/eth/proxy/nonFungibleProxy.test.ts b/tests/src/eth/proxy/nonFungibleProxy.test.ts index 2187681b67..61f4947d42 100644 --- a/tests/src/eth/proxy/nonFungibleProxy.test.ts +++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts @@ -16,7 +16,7 @@ import {readFile} from 'fs/promises'; import {IKeyringPair} from '@polkadot/types/types'; -import {EthUniqueHelper, itEth, usingEthPlaygrounds, expect} from '../util/playgrounds'; +import {EthUniqueHelper, itEth, usingEthPlaygrounds, expect} from '../util'; async function proxyWrap(helper: EthUniqueHelper, wrapped: any, donor: IKeyringPair) { diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index d46816852c..1598747882 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -14,8 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {Pallets, requirePalletsOrSkip} from '../util/playgrounds'; -import {expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {Pallets, requirePalletsOrSkip} from '../util'; +import {expect, itEth, usingEthPlaygrounds} from './util'; import {IKeyringPair} from '@polkadot/types/types'; describe('Refungible: Information getting', () => { diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 7f6cba6860..194564091d 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -14,8 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {Pallets, requirePalletsOrSkip} from '../util/playgrounds'; -import {EthUniqueHelper, expect, itEth, usingEthPlaygrounds} from './util/playgrounds'; +import {Pallets, requirePalletsOrSkip} from '../util'; +import {EthUniqueHelper, expect, itEth, usingEthPlaygrounds} from './util'; import {IKeyringPair} from '@polkadot/types/types'; import {Contract} from 'web3-eth-contract'; diff --git a/tests/src/eth/sponsoring.test.ts b/tests/src/eth/sponsoring.test.ts index f950dc65c4..52b748b69a 100644 --- a/tests/src/eth/sponsoring.test.ts +++ b/tests/src/eth/sponsoring.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itEth, expect, SponsoringMode} from '../eth/util/playgrounds'; -import {usingPlaygrounds} from './../util/playgrounds/index'; +import {itEth, expect, SponsoringMode} from './util'; +import {usingPlaygrounds} from '../util/index'; describe('EVM sponsoring', () => { let donor: IKeyringPair; diff --git a/tests/src/eth/tokenProperties.test.ts b/tests/src/eth/tokenProperties.test.ts index 5ca49fd0a2..57c69c53a8 100644 --- a/tests/src/eth/tokenProperties.test.ts +++ b/tests/src/eth/tokenProperties.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {itEth, usingEthPlaygrounds, expect} from './util/playgrounds'; +import {itEth, usingEthPlaygrounds, expect} from './util'; import {IKeyringPair} from '@polkadot/types/types'; describe('EVM token properties', () => { diff --git a/tests/src/eth/util/playgrounds/index.ts b/tests/src/eth/util/index.ts similarity index 92% rename from tests/src/eth/util/playgrounds/index.ts rename to tests/src/eth/util/index.ts index 39b9bb67c3..0974417006 100644 --- a/tests/src/eth/util/playgrounds/index.ts +++ b/tests/src/eth/util/index.ts @@ -4,17 +4,17 @@ import * as path from 'path'; import {IKeyringPair} from '@polkadot/types/types'; -import config from '../../../config'; +import config from '../../config'; -import {EthUniqueHelper} from './unique.dev'; -import {SilentLogger, SilentConsole} from '../../../util/playgrounds/unique.dev'; +import {EthUniqueHelper} from './playgrounds/unique.dev'; +import {SilentLogger, SilentConsole} from '../../util/playgrounds/unique.dev'; -export {EthUniqueHelper} from './unique.dev'; +export {EthUniqueHelper} from './playgrounds/unique.dev'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; import chaiLike from 'chai-like'; -import {getTestSeed, requirePalletsOrSkip} from '../../../util/playgrounds'; +import {getTestSeed, requirePalletsOrSkip} from '../../util'; chai.use(chaiAsPromised); chai.use(chaiLike); diff --git a/tests/src/fungible.test.ts b/tests/src/fungible.test.ts index b3c462ac94..e461dab541 100644 --- a/tests/src/fungible.test.ts +++ b/tests/src/fungible.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; +import {itSub, usingPlaygrounds, expect} from './util'; const U128_MAX = (1n << 128n) - 1n; diff --git a/tests/src/getPropertiesRpc.test.ts b/tests/src/getPropertiesRpc.test.ts index 622d135527..19fd9a7a06 100644 --- a/tests/src/getPropertiesRpc.test.ts +++ b/tests/src/getPropertiesRpc.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; +import {itSub, usingPlaygrounds, expect} from './util'; import {UniqueHelper, UniqueNFTCollection} from './util/playgrounds/unique'; const collectionProps = [ diff --git a/tests/src/inflation.test.ts b/tests/src/inflation.test.ts index dd578260b4..78e5131f18 100644 --- a/tests/src/inflation.test.ts +++ b/tests/src/inflation.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, usingPlaygrounds} from './util/playgrounds'; +import {expect, itSub, usingPlaygrounds} from './util'; // todo:playgrounds requires sudo, look into on the later stage describe('integration test: Inflation', () => { diff --git a/tests/src/limits.test.ts b/tests/src/limits.test.ts index 987b4204e5..a7a756443f 100644 --- a/tests/src/limits.test.ts +++ b/tests/src/limits.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util/playgrounds'; +import {expect, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util'; describe('Number of tokens per address (NFT)', () => { let alice: IKeyringPair; diff --git a/tests/src/nesting/collectionProperties.test.ts b/tests/src/nesting/collectionProperties.test.ts index 0018e93e26..1ad1361c71 100644 --- a/tests/src/nesting/collectionProperties.test.ts +++ b/tests/src/nesting/collectionProperties.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, usingPlaygrounds, expect} from '../util/playgrounds'; +import {itSub, Pallets, usingPlaygrounds, expect} from '../util'; import {UniqueBaseCollection} from '../util/playgrounds/unique'; describe('Integration Test: Collection Properties', () => { diff --git a/tests/src/nesting/graphs.test.ts b/tests/src/nesting/graphs.test.ts index e672fcabc2..b6c3ad7538 100644 --- a/tests/src/nesting/graphs.test.ts +++ b/tests/src/nesting/graphs.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, usingPlaygrounds} from '../util/playgrounds'; +import {expect, itSub, usingPlaygrounds} from '../util'; import {UniqueHelper, UniqueNFToken} from '../util/playgrounds/unique'; /** diff --git a/tests/src/nesting/nest.test.ts b/tests/src/nesting/nest.test.ts index 4e23e126df..be20a96c4e 100644 --- a/tests/src/nesting/nest.test.ts +++ b/tests/src/nesting/nest.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, Pallets, usingPlaygrounds} from '../util/playgrounds'; +import {expect, itSub, Pallets, usingPlaygrounds} from '../util'; describe('Integration Test: Composite nesting tests', () => { let alice: IKeyringPair; diff --git a/tests/src/nesting/propertyPermissions.test.ts b/tests/src/nesting/propertyPermissions.test.ts index 9c5ae2d1eb..b8bd0cd818 100644 --- a/tests/src/nesting/propertyPermissions.test.ts +++ b/tests/src/nesting/propertyPermissions.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, usingPlaygrounds, expect} from '../util/playgrounds'; +import {itSub, Pallets, usingPlaygrounds, expect} from '../util'; import {UniqueNFTCollection, UniqueRFTCollection} from '../util/playgrounds/unique'; describe('Integration Test: Access Rights to Token Properties', () => { diff --git a/tests/src/nesting/tokenProperties.test.ts b/tests/src/nesting/tokenProperties.test.ts index 808042ec6d..ae2b1c13ca 100644 --- a/tests/src/nesting/tokenProperties.test.ts +++ b/tests/src/nesting/tokenProperties.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../util/playgrounds'; +import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../util'; import {UniqueHelper, UniqueNFToken, UniqueRFToken} from '../util/playgrounds/unique'; describe('Integration Test: Token Properties', () => { diff --git a/tests/src/nesting/unnest.test.ts b/tests/src/nesting/unnest.test.ts index e48aed7bb5..0da84556bb 100644 --- a/tests/src/nesting/unnest.test.ts +++ b/tests/src/nesting/unnest.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, Pallets, usingPlaygrounds} from '../util/playgrounds'; +import {expect, itSub, Pallets, usingPlaygrounds} from '../util'; describe('Integration Test: Unnesting', () => { let alice: IKeyringPair; diff --git a/tests/src/nextSponsoring.test.ts b/tests/src/nextSponsoring.test.ts index 549ba7345f..33ceca0d4c 100644 --- a/tests/src/nextSponsoring.test.ts +++ b/tests/src/nextSponsoring.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {expect, itSub, Pallets, usingPlaygrounds} from './util/playgrounds'; +import {expect, itSub, Pallets, usingPlaygrounds} from './util'; const SPONSORING_TIMEOUT = 5; diff --git a/tests/src/pallet-presence.test.ts b/tests/src/pallet-presence.test.ts index 2a10a0db78..524e122369 100644 --- a/tests/src/pallet-presence.test.ts +++ b/tests/src/pallet-presence.test.ts @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; +import {itSub, usingPlaygrounds, expect} from './util'; // Pallets that must always be present const requiredPallets = [ diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index da1afa836b..03bae16176 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from './util/playgrounds'; +import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from './util'; const MAX_REFUNGIBLE_PIECES = 1_000_000_000_000_000_000_000n; diff --git a/tests/src/removeCollectionAdmin.test.ts b/tests/src/removeCollectionAdmin.test.ts index 3678c79a03..8c3e62d285 100644 --- a/tests/src/removeCollectionAdmin.test.ts +++ b/tests/src/removeCollectionAdmin.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; +import {itSub, usingPlaygrounds, expect} from './util'; describe('Integration Test removeCollectionAdmin(collection_id, account_id):', () => { let alice: IKeyringPair; diff --git a/tests/src/removeCollectionSponsor.test.ts b/tests/src/removeCollectionSponsor.test.ts index 45fdb75138..467d69b110 100644 --- a/tests/src/removeCollectionSponsor.test.ts +++ b/tests/src/removeCollectionSponsor.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; +import {itSub, usingPlaygrounds, expect} from './util'; describe('integration test: ext. removeCollectionSponsor():', () => { let donor: IKeyringPair; diff --git a/tests/src/rpc.test.ts b/tests/src/rpc.test.ts index 9607614446..5fd5a1ff7d 100644 --- a/tests/src/rpc.test.ts +++ b/tests/src/rpc.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {usingPlaygrounds, itSub, expect} from './util/playgrounds'; +import {usingPlaygrounds, itSub, expect} from './util'; import {CrossAccountId} from './util/playgrounds/unique'; describe('integration test: RPC methods', () => { diff --git a/tests/src/setCollectionLimits.test.ts b/tests/src/setCollectionLimits.test.ts index 894756491e..9d4aacb7b2 100644 --- a/tests/src/setCollectionLimits.test.ts +++ b/tests/src/setCollectionLimits.test.ts @@ -16,7 +16,7 @@ // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; +import {itSub, usingPlaygrounds, expect} from './util'; const accountTokenOwnershipLimit = 0; const sponsoredDataSize = 0; diff --git a/tests/src/setCollectionSponsor.test.ts b/tests/src/setCollectionSponsor.test.ts index 0af3f94952..8c7619a8c0 100644 --- a/tests/src/setCollectionSponsor.test.ts +++ b/tests/src/setCollectionSponsor.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect, Pallets} from './util/playgrounds'; +import {itSub, usingPlaygrounds, expect, Pallets} from './util'; describe('integration test: ext. setCollectionSponsor():', () => { let alice: IKeyringPair; diff --git a/tests/src/setPermissions.test.ts b/tests/src/setPermissions.test.ts index 5a19435d1d..9cc412dee6 100644 --- a/tests/src/setPermissions.test.ts +++ b/tests/src/setPermissions.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; +import {itSub, usingPlaygrounds, expect} from './util'; describe('Integration Test: Set Permissions', () => { let alice: IKeyringPair; diff --git a/tests/src/transfer.test.ts b/tests/src/transfer.test.ts index 6b1fb832b2..a084363e8b 100644 --- a/tests/src/transfer.test.ts +++ b/tests/src/transfer.test.ts @@ -15,8 +15,8 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itEth, usingEthPlaygrounds} from './eth/util/playgrounds'; -import {itSub, Pallets, usingPlaygrounds, expect} from './util/playgrounds'; +import {itEth, usingEthPlaygrounds} from './eth/util'; +import {itSub, Pallets, usingPlaygrounds, expect} from './util'; describe('Integration Test Transfer(recipient, collection_id, item_id, value)', () => { let donor: IKeyringPair; diff --git a/tests/src/transferFrom.test.ts b/tests/src/transferFrom.test.ts index 5f6f8cb230..630aa68539 100644 --- a/tests/src/transferFrom.test.ts +++ b/tests/src/transferFrom.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, Pallets, usingPlaygrounds, expect} from './util/playgrounds'; +import {itSub, Pallets, usingPlaygrounds, expect} from './util'; describe('Integration Test transferFrom(from, recipient, collection_id, item_id, value):', () => { let alice: IKeyringPair; diff --git a/tests/src/tx-version-presence.test.ts b/tests/src/tx-version-presence.test.ts index 9e80dd65a4..4b932af45c 100644 --- a/tests/src/tx-version-presence.test.ts +++ b/tests/src/tx-version-presence.test.ts @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . import {Metadata} from '@polkadot/types'; -import {itSub, usingPlaygrounds, expect} from './util/playgrounds'; +import {itSub, usingPlaygrounds, expect} from './util'; let metadata: Metadata; diff --git a/tests/src/util/playgrounds/globalSetup.ts b/tests/src/util/globalSetup.ts similarity index 94% rename from tests/src/util/playgrounds/globalSetup.ts rename to tests/src/util/globalSetup.ts index 19a13e9993..fa04fc4859 100644 --- a/tests/src/util/playgrounds/globalSetup.ts +++ b/tests/src/util/globalSetup.ts @@ -9,7 +9,7 @@ import {promises as fs} from 'fs'; export async function mochaGlobalSetup() { await usingPlaygrounds(async (helper, privateKey) => { try { - // 1. Create donors + // 1. Create donors for test files await fundFilenamesWithRetries(3) .then((result) => { if (!result) process.exit(1); @@ -19,7 +19,7 @@ export async function mochaGlobalSetup() { const missingPallets = helper.fetchMissingPalletNames([Pallets.AppPromotion]); if (missingPallets.length === 0) { const superuser = await privateKey('//Alice'); - const palletAddress = helper.arrange.calculatePalleteAddress('appstake'); + const palletAddress = helper.arrange.calculatePalletAddress('appstake'); const palletAdmin = await privateKey('//PromotionAdmin'); const api = helper.getApi(); await helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); @@ -53,9 +53,9 @@ const fundFilenames = async () => { const oneToken = helper.balance.getOneTokenNominal(); const alice = await privateKey('//Alice'); const nonce = await helper.chain.getNonce(alice.address); - const filenames = await getFiles(path.resolve(__dirname, '../..')); + const filenames = await getFiles(path.resolve(__dirname, '..')); - // batching is actually undesired, it takes away the time while all the transactions actually succeed + // batching is actually undesireable, it takes away the time while all the transactions actually succeed const batchSize = 300; let balanceGrantedCounter = 0; for (let b = 0; b < filenames.length; b += batchSize) { diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/index.ts similarity index 96% rename from tests/src/util/playgrounds/index.ts rename to tests/src/util/index.ts index 12a82ec218..64eea54bf3 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/index.ts @@ -7,9 +7,9 @@ import {IKeyringPair} from '@polkadot/types/types'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; import {Context} from 'mocha'; -import config from '../../config'; -import '../../interfaces/augment-api-events'; -import {DevUniqueHelper, SilentLogger, SilentConsole} from './unique.dev'; +import config from '../config'; +import '../interfaces/augment-api-events'; +import {DevUniqueHelper, SilentLogger, SilentConsole} from './playgrounds/unique.dev'; chai.use(chaiAsPromised); export const expect = chai.expect; diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index c34cd18021..e1b9db3911 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -245,7 +245,7 @@ class ArrangeGroup { return balance; } - calculatePalleteAddress(palletId: any) { + calculatePalletAddress(palletId: any) { const address = stringToU8a(('modl' + palletId).padEnd(32, '\0')); return encodeAddress(address); } From d6e9c774b63f2b311dc0e6b48ca391631ab93e98 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Wed, 12 Oct 2022 10:28:50 +0000 Subject: [PATCH 1107/1274] tests(promotion): scrub a now redundant comment --- tests/src/app-promotion.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index da6833eff5..f97849ae52 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -504,7 +504,6 @@ describe('App promotion', () => { // caller payed for call expect(1000n * nominal > callerBalance).to.be.true; - // todo:playgrounds look into. why did it work before with 1000n, and is now 100n? expect(contractBalanceAfter).to.be.equal(100n * nominal); }); From 876ef621bd1e3674dfd64218ba576789929e6885 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Tue, 13 Sep 2022 07:05:03 +0000 Subject: [PATCH 1108/1274] feat: add conditional supportInterface for ERC721Metadata --- pallets/common/src/erc.rs | 16 +++++ pallets/nonfungible/src/erc.rs | 25 +------ pallets/nonfungible/src/lib.rs | 14 ++++ pallets/refungible/src/erc.rs | 15 +--- pallets/refungible/src/lib.rs | 23 +++++-- pallets/unique/src/eth/mod.rs | 52 +++++++++++++- .../src/eth/stubs/CollectionHelpers.raw | Bin 1563 -> 1585 bytes .../src/eth/stubs/CollectionHelpers.sol | 49 ++++++++++++-- tests/src/deprecated-helpers/eth/helpers.ts | 4 +- tests/src/deprecated-helpers/helpers.ts | 4 +- tests/src/eth/allowlist.test.ts | 8 +-- tests/src/eth/api/CollectionHelpers.sol | 35 ++++++++-- tests/src/eth/collectionAdmin.test.ts | 38 +++++------ tests/src/eth/collectionHelpersAbi.json | 26 ++++++- tests/src/eth/collectionProperties.test.ts | 45 +++++++++++- tests/src/eth/collectionSponsoring.test.ts | 10 +-- tests/src/eth/createNFTCollection.test.ts | 22 +++--- tests/src/eth/createRFTCollection.test.ts | 12 ++-- tests/src/eth/evmCoder.test.ts | 2 +- .../eth/fractionalizer/fractionalizer.test.ts | 30 ++++---- tests/src/eth/nesting/nest.test.ts | 2 +- tests/src/eth/nonFungible.test.ts | 4 +- tests/src/eth/payable.test.ts | 12 ++-- tests/src/eth/proxy/nonFungibleProxy.test.ts | 2 +- tests/src/eth/reFungible.test.ts | 32 ++++----- tests/src/eth/reFungibleToken.test.ts | 6 +- tests/src/eth/util/playgrounds/unique.dev.ts | 30 +++++++- tests/src/nesting/properties.test.ts | 64 +++++++++++++++++- tests/src/util/playgrounds/unique.ts | 9 +++ 29 files changed, 432 insertions(+), 159 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index d1ea18ed1e..b856cd8aff 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -684,6 +684,11 @@ pub mod static_property { pub fn parent_nft() -> up_data_structs::PropertyKey { property_key_from_bytes(b"parentNft").expect(EXPECT_CONVERT_ERROR) } + + /// Key "parentNft". + pub fn erc721_metadata() -> up_data_structs::PropertyKey { + property_key_from_bytes(b"ERC721Metadata").expect(EXPECT_CONVERT_ERROR) + } } /// Values. @@ -693,10 +698,21 @@ pub mod static_property { /// Value "ERC721Metadata". pub const ERC721_METADATA: &[u8] = b"ERC721Metadata"; + /// Value "1" ERC721 metadata supported. + pub const ERC721_METADATA_SUPPORTED: &[u8] = b"1"; + + /// Value "0" ERC721 metadata supported. + pub const ERC721_METADATA_UNSUPPORTED: &[u8] = b"0"; + /// Value for [`ERC721_METADATA`]. pub fn erc721() -> up_data_structs::PropertyValue { property_value_from_bytes(ERC721_METADATA).expect(EXPECT_CONVERT_ERROR) } + + /// Value for [`ERC721_METADATA`]. + pub fn erc721_metadata_supported() -> up_data_structs::PropertyValue { + property_value_from_bytes(ERC721_METADATA_SUPPORTED).expect(EXPECT_CONVERT_ERROR) + } } /// Convert `byte` to [`PropertyKey`]. diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 28ae9f866e..7949a662a9 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -232,7 +232,7 @@ impl NonfungibleHandle { if !url.is_empty() { return Ok(url); } - } else if !is_erc721_metadata_compatible::(self.id) { + } else if !self.supports_metadata() { return Err("tokenURI not set".into()); } @@ -550,17 +550,6 @@ fn get_token_property( Err("Property tokenURI not found".into()) } -fn is_erc721_metadata_compatible(collection_id: CollectionId) -> bool { - if let Some(shema_name) = - pallet_common::Pallet::::get_collection_property(collection_id, &key::schema_name()) - { - let shema_name = shema_name.into_inner(); - shema_name == property_value::ERC721_METADATA - } else { - false - } -} - fn get_token_permission( collection_id: CollectionId, key: &PropertyKey, @@ -577,16 +566,6 @@ fn get_token_permission( Ok(a) } -fn has_token_permission(collection_id: CollectionId, key: &PropertyKey) -> bool { - if let Ok(token_property_permissions) = - CollectionPropertyPermissions::::try_get(collection_id) - { - return token_property_permissions.contains_key(key); - } - - false -} - /// @title Unique extensions for ERC721. #[solidity_interface(name = ERC721UniqueExtensions)] impl NonfungibleHandle { @@ -731,7 +710,7 @@ impl NonfungibleHandle { name = UniqueNFT, is( ERC721, - ERC721Metadata, + ERC721Metadata(if(this.supports_metadata())), ERC721Enumerable, ERC721UniqueExtensions, ERC721Mintable, diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index f48af786ef..9cc1561f8f 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -108,6 +108,7 @@ use up_data_structs::{ use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; use pallet_common::{ Error as CommonError, Pallet as PalletCommon, Event as CommonEvent, CollectionHandle, + erc::static_property::{key, value}, eth::collection_id_to_address, }; use pallet_structure::{Pallet as PalletStructure, Error as StructureError}; @@ -295,6 +296,19 @@ impl NonfungibleHandle { &mut self.0 } } + +impl NonfungibleHandle { + pub fn supports_metadata(&self) -> bool { + if let Some(erc721_metadata) = + pallet_common::Pallet::::get_collection_property(self.id, &key::erc721_metadata()) + { + *erc721_metadata.into_inner() == *value::ERC721_METADATA_SUPPORTED + } else { + false + } + } +} + impl WithRecorder for NonfungibleHandle { fn recorder(&self) -> &SubstrateRecorder { self.0.recorder() diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 66140d384c..ef13470dae 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -228,7 +228,7 @@ impl RefungibleHandle { if !url.is_empty() { return Ok(url); } - } else if !is_erc721_metadata_compatible::(self.id) { + } else if !self.supports_metadata() { return Err("tokenURI not set".into()); } @@ -578,17 +578,6 @@ fn get_token_property( Err("Property tokenURI not found".into()) } -fn is_erc721_metadata_compatible(collection_id: CollectionId) -> bool { - if let Some(shema_name) = - pallet_common::Pallet::::get_collection_property(collection_id, &key::schema_name()) - { - let shema_name = shema_name.into_inner(); - shema_name == property_value::ERC721_METADATA - } else { - false - } -} - fn get_token_permission( collection_id: CollectionId, key: &PropertyKey, @@ -780,7 +769,7 @@ impl RefungibleHandle { name = UniqueRefungible, is( ERC721, - ERC721Metadata, + ERC721Metadata(if(this.supports_metadata())), ERC721Enumerable, ERC721UniqueExtensions, ERC721Mintable, diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 7602172ea9..2f25a4224c 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -92,14 +92,19 @@ use crate::erc::ERC721Events; use codec::{Encode, Decode, MaxEncodedLen}; use core::ops::Deref; +use derivative::Derivative; use evm_coder::ToLog; use frame_support::{ - BoundedVec, ensure, fail, storage::with_transaction, transactional, pallet_prelude::ConstU32, + BoundedBTreeMap, BoundedVec, ensure, fail, storage::with_transaction, transactional, + pallet_prelude::ConstU32, }; use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; use pallet_evm_coder_substrate::WithRecorder; use pallet_common::{ - CommonCollectionOperations, Error as CommonError, eth::collection_id_to_address, + CommonCollectionOperations, + erc::static_property::{key, value}, + Error as CommonError, + eth::collection_id_to_address, Event as CommonEvent, Pallet as PalletCommon, }; use pallet_structure::Pallet as PalletStructure; @@ -113,8 +118,6 @@ use up_data_structs::{ MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission, PropertyPermission, PropertyScope, PropertyValue, TokenId, TrySetProperty, }; -use frame_support::BoundedBTreeMap; -use derivative::Derivative; pub use pallet::*; #[cfg(feature = "runtime-benchmarks")] @@ -301,6 +304,18 @@ impl RefungibleHandle { } } +impl RefungibleHandle { + pub fn supports_metadata(&self) -> bool { + if let Some(erc721_metadata) = + pallet_common::Pallet::::get_collection_property(self.id, &key::erc721_metadata()) + { + *erc721_metadata.into_inner() == *value::ERC721_METADATA_SUPPORTED + } else { + false + } + } +} + impl Deref for RefungibleHandle { type Target = pallet_common::CollectionHandle; diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index fd76cf17da..ecbd2dea37 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -130,6 +130,13 @@ fn make_data( }) .map_err(|e| Error::Revert(format!("{:?}", e)))?; + properties + .try_push(up_data_structs::Property { + key: key::erc721_metadata(), + value: property_value::erc721_metadata_supported(), + }) + .map_err(|e| Error::Revert(format!("{:?}", e)))?; + if !base_uri_value.is_empty() { properties .try_push(up_data_structs::Property { @@ -212,7 +219,8 @@ where /// @param tokenPrefix Token prefix to represent the collection tokens in UI and user applications /// @return address Address of the newly created collection #[weight(>::create_collection())] - fn create_nonfungible_collection( + #[solidity(rename_selector = "createNFTCollection")] + fn create_nft_collection( &mut self, caller: caller, value: value, @@ -239,9 +247,26 @@ where let address = pallet_common::eth::collection_id_to_address(collection_id); Ok(address) } + /// Create an NFT collection + /// @param name Name of the collection + /// @param description Informative description of the collection + /// @param tokenPrefix Token prefix to represent the collection tokens in UI and user applications + /// @return address Address of the newly created collection + #[weight(>::create_collection())] + #[deprecated(note = "mathod was renamed to `create_nft_collection`, prefer it instead")] + fn create_nonfungible_collection( + &mut self, + caller: caller, + value: value, + name: string, + description: string, + token_prefix: string, + ) -> Result
{ + self.create_nft_collection(caller, value, name, description, token_prefix) + } #[weight(>::create_collection())] - #[solidity(rename_selector = "createERC721MetadataCompatibleCollection")] + #[solidity(rename_selector = "createERC721MetadataNFTCollection")] fn create_nonfungible_collection_with_properties( &mut self, caller: caller, @@ -273,6 +298,27 @@ where #[weight(>::create_collection())] #[solidity(rename_selector = "createRFTCollection")] + fn create_rft_collection( + &mut self, + caller: caller, + value: value, + name: string, + description: string, + token_prefix: string, + ) -> Result
{ + create_refungible_collection_internal::( + caller, + value, + name, + description, + token_prefix, + Default::default(), + false, + ) + } + + #[weight(>::create_collection())] + #[deprecated(note = "mathod was renamed to `create_rft_collection`, prefer it instead")] fn create_refungible_collection( &mut self, caller: caller, @@ -293,7 +339,7 @@ where } #[weight(>::create_collection())] - #[solidity(rename_selector = "createERC721MetadataCompatibleRFTCollection")] + #[solidity(rename_selector = "createERC721MetadataRFTCollection")] fn create_refungible_collection_with_properties( &mut self, caller: caller, diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index 803617208127e5e97a96c49118d3705d204ab534..5c564b15aef6a35614801873d49e6284dda904f4 100644 GIT binary patch delta 999 zcmZXSPiWLY6vk(gY!O;CE4y3E3QbiiQaxC@6+P$*MM@8v2D@nq%1jqg#G5xgY$n;w z_K#wA(^f=E#luRipcTQJ2%cI|Q1Gh7Vg(O^u84@WzGSl7s!0Z3-uun_zQ@eXruinB zERnQE+KI`S=F*17dD+If3ns-g1RW%(`kRINrmlq9*M~06$0*(c+2y`-J&=70eauzE%;L3$JMcdarJl;zo1kQ7 z^SQq7gJC?^+@%Jg5p3x);}l)z+f|C@D5`W5iQ>VGL2+lsAnATL9%mX+upgTx(XAR3 zy$m^FZ-5XC@2#ZhmJ$I<(PP-ZPURkD3||SO|CB@;mXfs+-c?s#Z$=O(r2B`DC0~#a zNytl>;u9s8ierHT-`FaQL=-D8ZUv?Dyd6vV-n^eeBeuK-ao?#2wfxz&@G-3@@XvKv z6p!+GT5U{PTU?ePM{t5+*RrC_mYadA0#^+<2FGYK%^^x*1Y_tSGN29(Nv*iQj%{~vZUH2PDq+eI*nR_=sl zeQkmr^@yVXKbR%E2T6xf*txP**^PoZ>RynrC+u1PwtIrNqur8V+5@GX15(PHKrJ(c z=Vd3PV3Rr&?L?g$<91ifWP;7R`RL&2k`5F*%D(C%(u+Pj1LcI3E2%0(lNO!i!7O>? zT^UCMVwBC8Dk6t;Ghec3&Kai;_J{p&-$##Wzc&V7E`D!bv09s-^~cGcck$7_FYB$1 Q!{25W=dHB^^{zAj0KPa{)&Kwi diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.sol b/pallets/unique/src/eth/stubs/CollectionHelpers.sol index 8e7423b725..2c02928e54 100644 --- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol +++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol @@ -23,8 +23,28 @@ contract CollectionHelpersEvents { } /// @title Contract, which allows users to operate with collections -/// @dev the ERC-165 identifier for this interface is 0x5ad4f440 +/// @dev the ERC-165 identifier for this interface is 0xf62c7aa9 contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { + /// Create an NFT collection + /// @param name Name of the collection + /// @param description Informative description of the collection + /// @param tokenPrefix Token prefix to represent the collection tokens in UI and user applications + /// @return address Address of the newly created collection + /// @dev EVM selector for this function is: 0x844af658, + /// or in textual repr: createNFTCollection(string,string,string) + function createNFTCollection( + string memory name, + string memory description, + string memory tokenPrefix + ) public payable returns (address) { + require(false, stub_error); + name; + description; + tokenPrefix; + dummy = 0; + return 0x0000000000000000000000000000000000000000; + } + /// Create an NFT collection /// @param name Name of the collection /// @param description Informative description of the collection @@ -45,9 +65,9 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { return 0x0000000000000000000000000000000000000000; } - /// @dev EVM selector for this function is: 0xa634a5f9, - /// or in textual repr: createERC721MetadataCompatibleCollection(string,string,string,string) - function createERC721MetadataCompatibleCollection( + /// @dev EVM selector for this function is: 0xd1df968c, + /// or in textual repr: createERC721MetadataNFTCollection(string,string,string,string) + function createERC721MetadataNFTCollection( string memory name, string memory description, string memory tokenPrefix, @@ -77,9 +97,24 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { return 0x0000000000000000000000000000000000000000; } - /// @dev EVM selector for this function is: 0xa5596388, - /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string) - function createERC721MetadataCompatibleRFTCollection( + /// @dev EVM selector for this function is: 0x44a68ad5, + /// or in textual repr: createRefungibleCollection(string,string,string) + function createRefungibleCollection( + string memory name, + string memory description, + string memory tokenPrefix + ) public payable returns (address) { + require(false, stub_error); + name; + description; + tokenPrefix; + dummy = 0; + return 0x0000000000000000000000000000000000000000; + } + + /// @dev EVM selector for this function is: 0xbea6a299, + /// or in textual repr: createERC721MetadataRFTCollection(string,string,string,string) + function createERC721MetadataRFTCollection( string memory name, string memory description, string memory tokenPrefix, diff --git a/tests/src/deprecated-helpers/eth/helpers.ts b/tests/src/deprecated-helpers/eth/helpers.ts index b59eca8c16..83f4b7866a 100644 --- a/tests/src/deprecated-helpers/eth/helpers.ts +++ b/tests/src/deprecated-helpers/eth/helpers.ts @@ -150,10 +150,10 @@ export async function createRFTCollection(api: ApiPromise, web3: Web3, owner: st } -export async function createNonfungibleCollection(api: ApiPromise, web3: Web3, owner: string) { +export async function createNFTCollection(api: ApiPromise, web3: Web3, owner: string) { const collectionHelper = evmCollectionHelpers(web3, owner); const result = await collectionHelper.methods - .createNonfungibleCollection('A', 'B', 'C') + .createNFTCollection('A', 'B', 'C') .send({value: Number(2n * UNIQUE)}); return await getCollectionAddressFromResult(api, result); } diff --git a/tests/src/deprecated-helpers/helpers.ts b/tests/src/deprecated-helpers/helpers.ts index ac998ea567..04df231b71 100644 --- a/tests/src/deprecated-helpers/helpers.ts +++ b/tests/src/deprecated-helpers/helpers.ts @@ -433,6 +433,7 @@ const defaultCreateCollectionParams: CreateCollectionParams = { mode: {type: 'NFT'}, name: 'name', tokenPrefix: 'prefix', + properties: [{key: 'ERC721Metadata', value: '1'}], }; export async function @@ -441,7 +442,7 @@ createCollection( sender: IKeyringPair, params: Partial = {}, ): Promise { - const {name, description, mode, tokenPrefix} = {...defaultCreateCollectionParams, ...params}; + const {name, description, mode, tokenPrefix, properties} = {...defaultCreateCollectionParams, ...params}; let modeprm = {}; if (mode.type === 'NFT') { @@ -457,6 +458,7 @@ createCollection( description: strToUTF16(description), tokenPrefix: strToUTF16(tokenPrefix), mode: modeprm as any, + properties, }); const events = await executeTransaction(api, sender, tx); return getCreateCollectionResult(events); diff --git a/tests/src/eth/allowlist.test.ts b/tests/src/eth/allowlist.test.ts index 560888e8c7..255401a189 100644 --- a/tests/src/eth/allowlist.test.ts +++ b/tests/src/eth/allowlist.test.ts @@ -78,7 +78,7 @@ describe('EVM collection allowlist', () => { const owner = await helper.eth.createAccountWithBalance(donor); const user = helper.eth.createAccount(); - const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; @@ -94,7 +94,7 @@ describe('EVM collection allowlist', () => { // const owner = await helper.eth.createAccountWithBalance(donor); // const user = donor; - // const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + // const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); // const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; @@ -110,7 +110,7 @@ describe('EVM collection allowlist', () => { const notOwner = await helper.eth.createAccountWithBalance(donor); const user = helper.eth.createAccount(); - const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; @@ -129,7 +129,7 @@ describe('EVM collection allowlist', () => { // const notOwner = await helper.eth.createAccountWithBalance(donor); // const user = donor; - // const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + // const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); // const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; diff --git a/tests/src/eth/api/CollectionHelpers.sol b/tests/src/eth/api/CollectionHelpers.sol index 7d198e8a99..4c98a5dfc9 100644 --- a/tests/src/eth/api/CollectionHelpers.sol +++ b/tests/src/eth/api/CollectionHelpers.sol @@ -18,8 +18,21 @@ interface CollectionHelpersEvents { } /// @title Contract, which allows users to operate with collections -/// @dev the ERC-165 identifier for this interface is 0x5ad4f440 +/// @dev the ERC-165 identifier for this interface is 0xf62c7aa9 interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { + /// Create an NFT collection + /// @param name Name of the collection + /// @param description Informative description of the collection + /// @param tokenPrefix Token prefix to represent the collection tokens in UI and user applications + /// @return address Address of the newly created collection + /// @dev EVM selector for this function is: 0x844af658, + /// or in textual repr: createNFTCollection(string,string,string) + function createNFTCollection( + string memory name, + string memory description, + string memory tokenPrefix + ) external payable returns (address); + /// Create an NFT collection /// @param name Name of the collection /// @param description Informative description of the collection @@ -33,9 +46,9 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory tokenPrefix ) external payable returns (address); - /// @dev EVM selector for this function is: 0xa634a5f9, - /// or in textual repr: createERC721MetadataCompatibleCollection(string,string,string,string) - function createERC721MetadataCompatibleCollection( + /// @dev EVM selector for this function is: 0xd1df968c, + /// or in textual repr: createERC721MetadataNFTCollection(string,string,string,string) + function createERC721MetadataNFTCollection( string memory name, string memory description, string memory tokenPrefix, @@ -50,9 +63,17 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory tokenPrefix ) external payable returns (address); - /// @dev EVM selector for this function is: 0xa5596388, - /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string) - function createERC721MetadataCompatibleRFTCollection( + /// @dev EVM selector for this function is: 0x44a68ad5, + /// or in textual repr: createRefungibleCollection(string,string,string) + function createRefungibleCollection( + string memory name, + string memory description, + string memory tokenPrefix + ) external payable returns (address); + + /// @dev EVM selector for this function is: 0xbea6a299, + /// or in textual repr: createERC721MetadataRFTCollection(string,string,string,string) + function createERC721MetadataRFTCollection( string memory name, string memory description, string memory tokenPrefix, diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index bab5c80bcc..42039d7465 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -38,7 +38,7 @@ describe('Add collection admins', () => { itEth('Add admin by owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); const newAdmin = helper.eth.createAccount(); @@ -51,7 +51,7 @@ describe('Add collection admins', () => { itEth.skip('Add substrate admin by owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); const [newAdmin] = await helper.arrange.createAccounts([10n], donor); @@ -64,7 +64,7 @@ describe('Add collection admins', () => { itEth('Verify owner or admin', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const newAdmin = helper.eth.createAccount(); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); @@ -75,7 +75,7 @@ describe('Add collection admins', () => { itEth('(!negative tests!) Add admin by ADMIN is not allowed', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const admin = await helper.eth.createAccountWithBalance(donor); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); @@ -93,7 +93,7 @@ describe('Add collection admins', () => { itEth('(!negative tests!) Add admin by USER is not allowed', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const notAdmin = await helper.eth.createAccountWithBalance(donor); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); @@ -108,7 +108,7 @@ describe('Add collection admins', () => { itEth.skip('(!negative tests!) Add substrate admin by ADMIN is not allowed', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const admin = await helper.eth.createAccountWithBalance(donor); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); @@ -126,7 +126,7 @@ describe('Add collection admins', () => { itEth.skip('(!negative tests!) Add substrate admin by USER is not allowed', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const notAdmin0 = await helper.eth.createAccountWithBalance(donor); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); @@ -150,7 +150,7 @@ describe('Remove collection admins', () => { itEth('Remove admin by owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const newAdmin = helper.eth.createAccount(); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); @@ -170,7 +170,7 @@ describe('Remove collection admins', () => { itEth.skip('Remove substrate admin by owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const [newAdmin] = await helper.arrange.createAccounts([10n], donor); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); @@ -188,7 +188,7 @@ describe('Remove collection admins', () => { itEth('(!negative tests!) Remove admin by ADMIN is not allowed', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); @@ -210,7 +210,7 @@ describe('Remove collection admins', () => { itEth('(!negative tests!) Remove admin by USER is not allowed', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); @@ -230,7 +230,7 @@ describe('Remove collection admins', () => { itEth.skip('(!negative tests!) Remove substrate admin by ADMIN is not allowed', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const [adminSub] = await helper.arrange.createAccounts([10n], donor); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); @@ -250,7 +250,7 @@ describe('Remove collection admins', () => { itEth.skip('(!negative tests!) Remove substrate admin by USER is not allowed', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const [adminSub] = await helper.arrange.createAccounts([10n], donor); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); @@ -279,7 +279,7 @@ describe('Change owner tests', () => { itEth('Change owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const newOwner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await collectionEvm.methods.setOwner(newOwner).send(); @@ -291,7 +291,7 @@ describe('Change owner tests', () => { itEth('change owner call fee', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const newOwner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); const cost = await recordEthFee(helper, owner, () => collectionEvm.methods.setOwner(newOwner).send()); expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); @@ -301,7 +301,7 @@ describe('Change owner tests', () => { itEth('(!negative tests!) call setOwner by non owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const newOwner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await expect(collectionEvm.methods.setOwner(newOwner).send({from: newOwner})).to.be.rejected; @@ -321,7 +321,7 @@ describe('Change substrate owner tests', () => { itEth.skip('Change owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const [newOwner] = await helper.arrange.createAccounts([10n], donor); - const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.true; @@ -336,7 +336,7 @@ describe('Change substrate owner tests', () => { itEth.skip('change owner call fee', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const [newOwner] = await helper.arrange.createAccounts([10n], donor); - const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); const cost = await recordEthFee(helper, owner, () => collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send()); @@ -348,7 +348,7 @@ describe('Change substrate owner tests', () => { const owner = await helper.eth.createAccountWithBalance(donor); const otherReceiver = await helper.eth.createAccountWithBalance(donor); const [newOwner] = await helper.arrange.createAccounts([10n], donor); - const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await expect(collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send({from: otherReceiver})).to.be.rejected; diff --git a/tests/src/eth/collectionHelpersAbi.json b/tests/src/eth/collectionHelpersAbi.json index 9c00df3da6..afb9659356 100644 --- a/tests/src/eth/collectionHelpersAbi.json +++ b/tests/src/eth/collectionHelpersAbi.json @@ -32,7 +32,7 @@ { "internalType": "string", "name": "tokenPrefix", "type": "string" }, { "internalType": "string", "name": "baseUri", "type": "string" } ], - "name": "createERC721MetadataCompatibleCollection", + "name": "createERC721MetadataNFTCollection", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "payable", "type": "function" @@ -44,7 +44,18 @@ { "internalType": "string", "name": "tokenPrefix", "type": "string" }, { "internalType": "string", "name": "baseUri", "type": "string" } ], - "name": "createERC721MetadataCompatibleRFTCollection", + "name": "createERC721MetadataRFTCollection", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "description", "type": "string" }, + { "internalType": "string", "name": "tokenPrefix", "type": "string" } + ], + "name": "createNFTCollection", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "payable", "type": "function" @@ -71,6 +82,17 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "description", "type": "string" }, + { "internalType": "string", "name": "tokenPrefix", "type": "string" } + ], + "name": "createRefungibleCollection", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { diff --git a/tests/src/eth/collectionProperties.test.ts b/tests/src/eth/collectionProperties.test.ts index c80da4ec51..309eaf5338 100644 --- a/tests/src/eth/collectionProperties.test.ts +++ b/tests/src/eth/collectionProperties.test.ts @@ -24,7 +24,7 @@ describe('EVM collection properties', () => { const raw = (await collection.getData())?.raw; - expect(raw.properties[0].value).to.equal('testValue'); + expect(raw.properties[1].value).to.equal('testValue'); }); itEth('Can be deleted', async({helper}) => { @@ -54,3 +54,46 @@ describe('EVM collection properties', () => { expect(value).to.equal(helper.getWeb3().utils.toHex('testValue')); }); }); + +describe('Supports ERC721Metadata', () => { + let donor: IKeyringPair; + + before(async function() { + await usingEthPlaygrounds(async (_helper, privateKey) => { + donor = privateKey('//Alice'); + }); + }); + + itEth('ERC721Metadata property can be set for NFT collection', async({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.nft.mintCollection(donor, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + + await collection.addAdmin(donor, {Ethereum: caller}); + const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller); + + await contract.methods.setCollectionProperty('ERC721Metadata', Buffer.from('1')).send({from: caller}); + + expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.true; + + await contract.methods.setCollectionProperty('ERC721Metadata', Buffer.from('0')).send({from: caller}); + + expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.false; + }); + + itEth('ERC721Metadata property can be set for RFT collection', async({helper}) => { + const caller = await helper.eth.createAccountWithBalance(donor); + const collection = await helper.rft.mintCollection(donor, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + + await collection.addAdmin(donor, {Ethereum: caller}); + + const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller); + + await contract.methods.setCollectionProperty('ERC721Metadata', Buffer.from('1')).send({from: caller}); + + expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.true; + + await contract.methods.setCollectionProperty('ERC721Metadata', Buffer.from('0')).send({from: caller}); + + expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.false; + }); +}); diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index bb9627d493..8ead2b9db0 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -54,7 +54,7 @@ describe('evm collection sponsoring', () => { // itWeb3('Set substrate sponsor', async ({api, web3, privateKeyWrapper}) => { // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); // const collectionHelpers = evmCollectionHelpers(web3, owner); - // let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + // let result = await collectionHelpers.methods.createNFTCollection('Sponsor collection', '1', '1').send(); // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); // const sponsor = privateKeyWrapper('//Alice'); // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); @@ -75,7 +75,7 @@ describe('evm collection sponsoring', () => { const owner = await helper.eth.createAccountWithBalance(donor); const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * nominal)}); + let result = await collectionHelpers.methods.createNFTCollection('Sponsor collection', '1', '1').send({value: Number(2n * nominal)}); const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const sponsor = await helper.eth.createAccountWithBalance(donor); const collectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner); @@ -97,7 +97,7 @@ describe('evm collection sponsoring', () => { const owner = await helper.eth.createAccountWithBalance(donor); const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * nominal)}); + let result = await collectionHelpers.methods.createERC721MetadataNFTCollection('Sponsor collection', '1', '1', '').send({value: Number(2n * nominal)}); const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const collectionId = helper.ethAddress.extractCollectionId(collectionIdAddress); const collection = helper.nft.getCollectionObject(collectionId); @@ -167,7 +167,7 @@ describe('evm collection sponsoring', () => { // itWeb3('Sponsoring collection from substrate address via access list', async ({api, web3, privateKeyWrapper}) => { // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); // const collectionHelpers = evmCollectionHelpers(web3, owner); - // const result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send(); + // const result = await collectionHelpers.methods.createERC721MetadataNFTCollection('Sponsor collection', '1', '1', '').send(); // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); // const sponsor = privateKeyWrapper('//Alice'); // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); @@ -223,7 +223,7 @@ describe('evm collection sponsoring', () => { const owner = await helper.eth.createAccountWithBalance(donor); const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelpers.methods.createNonfungibleCollection('Sponsor collection', '1', '1').send({value: Number(2n * nominal)}); + let result = await collectionHelpers.methods.createERC721MetadataNFTCollection('Sponsor collection', '1', '1', '').send({value: Number(2n * nominal)}); const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const collectionId = helper.ethAddress.extractCollectionId(collectionIdAddress); const collection = helper.nft.getCollectionObject(collectionId); diff --git a/tests/src/eth/createNFTCollection.test.ts b/tests/src/eth/createNFTCollection.test.ts index 3113cc79c4..51f99c4730 100644 --- a/tests/src/eth/createNFTCollection.test.ts +++ b/tests/src/eth/createNFTCollection.test.ts @@ -37,7 +37,7 @@ describe('Create NFT collection from EVM', () => { // todo:playgrounds this might fail when in async environment. const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; - const {collectionId} = await helper.eth.createNonfungibleCollection(owner, name, description, prefix); + const {collectionId} = await helper.eth.createNFTCollection(owner, name, description, prefix); const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; const collection = helper.nft.getCollectionObject(collectionId); @@ -64,7 +64,7 @@ describe('Create NFT collection from EVM', () => { .call()).to.be.false; await collectionHelpers.methods - .createNonfungibleCollection('A', 'A', 'A') + .createNFTCollection('A', 'A', 'A') .send({value: Number(2n * helper.balance.getOneTokenNominal())}); expect(await collectionHelpers.methods @@ -76,7 +76,7 @@ describe('Create NFT collection from EVM', () => { const owner = await helper.eth.createAccountWithBalance(donor); const sponsor = await helper.eth.createAccountWithBalance(donor); const ss58Format = helper.chain.getChainProperties().ss58Format; - const {collectionId, collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'Sponsor', 'absolutely anything', 'ROC'); + const {collectionId, collectionAddress} = await helper.eth.createNFTCollection(owner, 'Sponsor', 'absolutely anything', 'ROC'); const collection = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await collection.methods.setCollectionSponsor(sponsor).send(); @@ -95,7 +95,7 @@ describe('Create NFT collection from EVM', () => { itEth('Set limits', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionId, collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'Limits', 'absolutely anything', 'FLO'); + const {collectionId, collectionAddress} = await helper.eth.createNFTCollection(owner, 'Limits', 'absolutely anything', 'FLO'); const limits = { accountTokenOwnershipLimit: 1000, sponsoredDataSize: 1024, @@ -138,7 +138,7 @@ describe('Create NFT collection from EVM', () => { .methods.isCollectionExist(collectionAddressForNonexistentCollection).call()) .to.be.false; - const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'Exister', 'absolutely anything', 'EVC'); + const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'Exister', 'absolutely anything', 'EVC'); expect(await helper.ethNativeContract.collectionHelpers(collectionAddress) .methods.isCollectionExist(collectionAddress).call()) .to.be.true; @@ -166,7 +166,7 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { const tokenPrefix = 'A'; await expect(collectionHelper.methods - .createNonfungibleCollection(collectionName, description, tokenPrefix) + .createNFTCollection(collectionName, description, tokenPrefix) .call({value: Number(2n * nominal)})).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH); } @@ -176,7 +176,7 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { const description = 'A'.repeat(MAX_DESCRIPTION_LENGTH + 1); const tokenPrefix = 'A'; await expect(collectionHelper.methods - .createNonfungibleCollection(collectionName, description, tokenPrefix) + .createNFTCollection(collectionName, description, tokenPrefix) .call({value: Number(2n * nominal)})).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH); } { @@ -185,7 +185,7 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { const description = 'A'; const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGTH + 1); await expect(collectionHelper.methods - .createNonfungibleCollection(collectionName, description, tokenPrefix) + .createNFTCollection(collectionName, description, tokenPrefix) .call({value: Number(2n * nominal)})).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH); } }); @@ -194,14 +194,14 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { const owner = await helper.eth.createAccountWithBalance(donor); const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); await expect(collectionHelper.methods - .createNonfungibleCollection('Peasantry', 'absolutely anything', 'CVE') + .createNFTCollection('Peasantry', 'absolutely anything', 'CVE') .call({value: Number(1n * nominal)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); }); itEth('(!negative test!) Check owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const malfeasant = helper.eth.createAccount(); - const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'Transgressed', 'absolutely anything', 'COR'); + const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'Transgressed', 'absolutely anything', 'COR'); const malfeasantCollection = helper.ethNativeContract.collection(collectionAddress, 'nft', malfeasant); const EXPECTED_ERROR = 'NoPermission'; { @@ -224,7 +224,7 @@ describe('(!negative tests!) Create NFT collection from EVM', () => { itEth('(!negative test!) Set limits', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'Limits', 'absolutely anything', 'OLF'); + const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'Limits', 'absolutely anything', 'OLF'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await expect(collectionEvm.methods .setCollectionLimit('badLimit', 'true') diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts index 7857986ca2..1ac41f9d1d 100644 --- a/tests/src/eth/createRFTCollection.test.ts +++ b/tests/src/eth/createRFTCollection.test.ts @@ -39,7 +39,7 @@ describe('Create RFT collection from EVM', () => { // todo:playgrounds this might fail when in async environment. const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; - const {collectionId} = await helper.eth.createRefungibleCollection(owner, name, description, prefix); + const {collectionId} = await helper.eth.createRFTCollection(owner, name, description, prefix); const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; const data = (await helper.rft.getData(collectionId))!; @@ -77,7 +77,7 @@ describe('Create RFT collection from EVM', () => { const owner = await helper.eth.createAccountWithBalance(donor); const sponsor = await helper.eth.createAccountWithBalance(donor); const ss58Format = helper.chain.getChainProperties().ss58Format; - const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Sponsor', 'absolutely anything', 'ENVY'); + const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(owner, 'Sponsor', 'absolutely anything', 'ENVY'); const collection = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); await collection.methods.setCollectionSponsor(sponsor).send(); @@ -96,7 +96,7 @@ describe('Create RFT collection from EVM', () => { itEth('Set limits', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Limits', 'absolutely anything', 'INSI'); + const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(owner, 'Limits', 'absolutely anything', 'INSI'); const limits = { accountTokenOwnershipLimit: 1000, sponsoredDataSize: 1024, @@ -139,7 +139,7 @@ describe('Create RFT collection from EVM', () => { .methods.isCollectionExist(collectionAddressForNonexistentCollection).call()) .to.be.false; - const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Exister', 'absolutely anything', 'WIWT'); + const {collectionAddress} = await helper.eth.createRFTCollection(owner, 'Exister', 'absolutely anything', 'WIWT'); expect(await helper.ethNativeContract.collectionHelpers(collectionAddress) .methods.isCollectionExist(collectionAddress).call()) .to.be.true; @@ -202,7 +202,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { itEth('(!negative test!) Check owner', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const peasant = helper.eth.createAccount(); - const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Transgressed', 'absolutely anything', 'YVNE'); + const {collectionAddress} = await helper.eth.createRFTCollection(owner, 'Transgressed', 'absolutely anything', 'YVNE'); const peasantCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', peasant); const EXPECTED_ERROR = 'NoPermission'; { @@ -225,7 +225,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { itEth('(!negative test!) Set limits', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Limits', 'absolutely anything', 'ISNI'); + const {collectionAddress} = await helper.eth.createRFTCollection(owner, 'Limits', 'absolutely anything', 'ISNI'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); await expect(collectionEvm.methods .setCollectionLimit('badLimit', 'true') diff --git a/tests/src/eth/evmCoder.test.ts b/tests/src/eth/evmCoder.test.ts index c762738c70..e3d3fa5dbd 100644 --- a/tests/src/eth/evmCoder.test.ts +++ b/tests/src/eth/evmCoder.test.ts @@ -65,7 +65,7 @@ describe('Evm Coder tests', () => { itEth('Call non-existing function', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const collection = await helper.eth.createNonfungibleCollection(owner, 'EVMCODER', '', 'TEST'); + const collection = await helper.eth.createNFTCollection(owner, 'EVMCODER', '', 'TEST'); const contract = await helper.ethContract.deployByCode(owner, 'Test', getContractSource(collection.collectionAddress, '0x1bfed5D614b886b9Ab2eA4CBAc22A96B7EC29c9c')); const testContract = await helper.ethContract.deployByCode(owner, 'Test', getContractSource(collection.collectionAddress, contract.options.address)); { diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index 033431af9f..dd75ac149e 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -62,7 +62,7 @@ const initContract = async (helper: EthUniqueHelper, owner: string): Promise<{co const mintRFTToken = async (helper: EthUniqueHelper, owner: string, fractionalizer: Contract, amount: bigint): Promise<{ nftCollectionAddress: string, nftTokenId: number, rftTokenAddress: string }> => { - const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); const nftTokenId = await nftContract.methods.nextTokenId().call(); await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); @@ -92,7 +92,7 @@ describe('Fractionalizer contract usage', () => { itEth('Set RFT collection', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor, 10n); const fractionalizer = await deployContract(helper, owner); - const rftCollection = await helper.eth.createRefungibleCollection(owner, 'rft', 'RFT collection', 'RFT'); + const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT'); const rftContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner); await rftContract.methods.addCollectionAdmin(fractionalizer.options.address).send({from: owner}); @@ -121,7 +121,7 @@ describe('Fractionalizer contract usage', () => { itEth('Set Allowlist', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor, 20n); const {contract: fractionalizer} = await initContract(helper, owner); - const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const result1 = await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, true).send({from: owner}); expect(result1.events).to.be.like({ @@ -146,7 +146,7 @@ describe('Fractionalizer contract usage', () => { itEth('NFT to RFT', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor, 20n); - const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); const nftTokenId = await nftContract.methods.nextTokenId().call(); await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); @@ -231,7 +231,7 @@ describe('Negative Integration Tests for fractionalizer', () => { itEth('call setRFTCollection twice', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor, 20n); - const rftCollection = await helper.eth.createRefungibleCollection(owner, 'rft', 'RFT collection', 'RFT'); + const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT'); const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner); const fractionalizer = await deployContract(helper, owner); @@ -244,7 +244,7 @@ describe('Negative Integration Tests for fractionalizer', () => { itEth('call setRFTCollection with NFT collection', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor, 20n); - const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); const fractionalizer = await deployContract(helper, owner); @@ -257,7 +257,7 @@ describe('Negative Integration Tests for fractionalizer', () => { itEth('call setRFTCollection while not collection admin', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor, 20n); const fractionalizer = await deployContract(helper, owner); - const rftCollection = await helper.eth.createRefungibleCollection(owner, 'rft', 'RFT collection', 'RFT'); + const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT'); await expect(fractionalizer.methods.setRFTCollection(rftCollection.collectionAddress).call()) .to.be.rejectedWith(/Fractionalizer contract should be an admin of the collection$/g); @@ -278,7 +278,7 @@ describe('Negative Integration Tests for fractionalizer', () => { itEth('call nft2rft without setting RFT collection for contract', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor, 20n); - const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); const nftTokenId = await nftContract.methods.nextTokenId().call(); await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); @@ -293,7 +293,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const owner = await helper.eth.createAccountWithBalance(donor, 20n); const nftOwner = await helper.eth.createAccountWithBalance(donor, 10n); - const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); const nftTokenId = await nftContract.methods.nextTokenId().call(); await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); @@ -310,7 +310,7 @@ describe('Negative Integration Tests for fractionalizer', () => { itEth('call nft2rft while not in list of allowed accounts', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor, 20n); - const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); const nftTokenId = await nftContract.methods.nextTokenId().call(); await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); @@ -325,7 +325,7 @@ describe('Negative Integration Tests for fractionalizer', () => { itEth('call nft2rft while fractionalizer doesnt have approval for nft token', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor, 20n); - const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); const nftTokenId = await nftContract.methods.nextTokenId().call(); await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); @@ -341,7 +341,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const owner = await helper.eth.createAccountWithBalance(donor, 20n); const fractionalizer = await deployContract(helper, owner); - const rftCollection = await helper.eth.createRefungibleCollection(owner, 'rft', 'RFT collection', 'RFT'); + const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT'); const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner); const rftTokenId = await refungibleContract.methods.nextTokenId().call(); await refungibleContract.methods.mint(owner, rftTokenId).send({from: owner}); @@ -354,7 +354,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const owner = await helper.eth.createAccountWithBalance(donor, 20n); const {contract: fractionalizer} = await initContract(helper, owner); - const rftCollection = await helper.eth.createRefungibleCollection(owner, 'rft', 'RFT collection', 'RFT'); + const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT'); const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner); const rftTokenId = await refungibleContract.methods.nextTokenId().call(); await refungibleContract.methods.mint(owner, rftTokenId).send({from: owner}); @@ -365,7 +365,7 @@ describe('Negative Integration Tests for fractionalizer', () => { itEth('call rft2nft for RFT token that was not minted by fractionalizer contract', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor, 20n); - const rftCollection = await helper.eth.createRefungibleCollection(owner, 'rft', 'RFT collection', 'RFT'); + const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT'); const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner); const fractionalizer = await deployContract(helper, owner); @@ -432,7 +432,7 @@ describe('Negative Integration Tests for fractionalizer', () => { await fractionalizer.methods.setRFTCollection(rftCollectionAddress).send({from: owner}); await helper.executeExtrinsic(donor, 'api.tx.unique.setTransfersEnabledFlag', [rftCollection.collectionId, false], true); - const nftCollection = await helper.eth.createNonfungibleCollection(owner, 'nft', 'NFT collection', 'NFT'); + const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); const nftTokenId = await nftContract.methods.nextTokenId().call(); await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); diff --git a/tests/src/eth/nesting/nest.test.ts b/tests/src/eth/nesting/nest.test.ts index 10709d7864..e2b3f2061f 100644 --- a/tests/src/eth/nesting/nest.test.ts +++ b/tests/src/eth/nesting/nest.test.ts @@ -7,7 +7,7 @@ const createNestingCollection = async ( helper: EthUniqueHelper, owner: string, ): Promise<{ collectionId: number, collectionAddress: string, contract: Contract }> => { - const {collectionAddress, collectionId} = await helper.eth.createNonfungibleCollection(owner, 'A', 'B', 'C'); + const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); await contract.methods.setCollectionNesting(true).send({from: owner}); diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 3edbc1dde5..78912489c8 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -84,7 +84,7 @@ describe('Check ERC721 token URI for NFT', () => { const receiver = helper.eth.createAccount(); const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelper.methods.createERC721MetadataCompatibleCollection('Mint collection', 'a', 'b', tokenPrefix).send({value: Number(2n * helper.balance.getOneTokenNominal())}); + let result = await collectionHelper.methods.createERC721MetadataNFTCollection('Mint collection', 'a', 'b', tokenPrefix).send({value: Number(2n * helper.balance.getOneTokenNominal())}); const collectionAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); @@ -146,7 +146,7 @@ describe('NFT: Plain calls', () => { const owner = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'Minty', '6', '6'); + const {collectionAddress} = await helper.eth.createERC721MetadataNFTCollection(owner, 'Mint collection', '6', '6', ''); const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); const nextTokenId = await contract.methods.nextTokenId().call(); diff --git a/tests/src/eth/payable.test.ts b/tests/src/eth/payable.test.ts index 0ac454a42d..de2077acb8 100644 --- a/tests/src/eth/payable.test.ts +++ b/tests/src/eth/payable.test.ts @@ -146,7 +146,7 @@ describe('EVM transaction fees', () => { const caller = await helper.eth.createAccountWithBalance(donor); const contract = await deployProxyContract(helper, deployer); - const collectionAddress = (await contract.methods.createNonfungibleCollection().send({from: caller, value: Number(CONTRACT_BALANCE)})).events.CollectionCreated.returnValues.collection; + const collectionAddress = (await contract.methods.createNFTCollection().send({from: caller, value: Number(CONTRACT_BALANCE)})).events.CollectionCreated.returnValues.collection; const initialCallerBalance = await helper.balance.getEthereum(caller); const initialContractBalance = await helper.balance.getEthereum(contract.options.address); await contract.methods.mintNftToken(collectionAddress).send({from: caller}); @@ -164,7 +164,7 @@ describe('EVM transaction fees', () => { const initialCallerBalance = await helper.balance.getEthereum(caller); const initialContractBalance = await helper.balance.getEthereum(contract.options.address); - await contract.methods.createNonfungibleCollection().send({from: caller, value: Number(CONTRACT_BALANCE)}); + await contract.methods.createNFTCollection().send({from: caller, value: Number(CONTRACT_BALANCE)}); const finalCallerBalance = await helper.balance.getEthereum(caller); const finalContractBalance = await helper.balance.getEthereum(contract.options.address); expect(finalCallerBalance < initialCallerBalance).to.be.true; @@ -177,8 +177,8 @@ describe('EVM transaction fees', () => { const caller = await helper.eth.createAccountWithBalance(donor); const collectionHelper = helper.ethNativeContract.collectionHelpers(caller); - await expect(collectionHelper.methods.createNonfungibleCollection('A', 'B', 'C').call({value: Number(SMALL_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); - await expect(collectionHelper.methods.createNonfungibleCollection('A', 'B', 'C').call({value: Number(BIG_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); + await expect(collectionHelper.methods.createNFTCollection('A', 'B', 'C').call({value: Number(SMALL_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); + await expect(collectionHelper.methods.createNFTCollection('A', 'B', 'C').call({value: Number(BIG_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); }); itEth('Negative test: call createRFTCollection with wrong fee', async({helper}) => { @@ -227,9 +227,9 @@ describe('EVM transaction fees', () => { InnerContract(innerContract).flip(); } - function createNonfungibleCollection() external payable { + function createNFTCollection() external payable { address collectionHelpers = 0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F; - address nftCollection = CollectionHelpers(collectionHelpers).createNonfungibleCollection{value: msg.value}("A", "B", "C"); + address nftCollection = CollectionHelpers(collectionHelpers).createNFTCollection{value: msg.value}("A", "B", "C"); emit CollectionCreated(nftCollection); } diff --git a/tests/src/eth/proxy/nonFungibleProxy.test.ts b/tests/src/eth/proxy/nonFungibleProxy.test.ts index 1aa6557fe5..5607936e53 100644 --- a/tests/src/eth/proxy/nonFungibleProxy.test.ts +++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts @@ -101,7 +101,7 @@ describe('NFT (Via EVM proxy): Plain calls', () => { itEth('Can perform mint()', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress} = await helper.eth.createNonfungibleCollection(owner, 'A', 'A', 'A'); + const {collectionAddress} = await helper.eth.createERC721MetadataNFTCollection(owner, 'A', 'A', 'A', ''); const caller = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 01861b980d..c21f161460 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -31,7 +31,7 @@ describe('Refungible: Information getting', () => { itEth('totalSupply', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'TotalSupply', '6', '6'); + const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'TotalSupply', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const nextTokenId = await contract.methods.nextTokenId().call(); await contract.methods.mint(caller, nextTokenId).send(); @@ -41,7 +41,7 @@ describe('Refungible: Information getting', () => { itEth('balanceOf', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'BalanceOf', '6', '6'); + const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'BalanceOf', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); { @@ -63,7 +63,7 @@ describe('Refungible: Information getting', () => { itEth('ownerOf', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'OwnerOf', '6', '6'); + const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'OwnerOf', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); @@ -76,7 +76,7 @@ describe('Refungible: Information getting', () => { itEth('ownerOf after burn', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'OwnerOf-AfterBurn', '6', '6'); + const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'OwnerOf-AfterBurn', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); @@ -95,7 +95,7 @@ describe('Refungible: Information getting', () => { itEth('ownerOf for partial ownership', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Partial-OwnerOf', '6', '6'); + const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'Partial-OwnerOf', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); @@ -124,7 +124,7 @@ describe('Refungible: Plain calls', () => { itEth('Can perform mint()', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Minty', '6', '6'); + const {collectionAddress} = await helper.eth.createERC721MetadataRFTCollection(owner, 'Minty', '6', '6', ''); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); const nextTokenId = await contract.methods.nextTokenId().call(); @@ -147,7 +147,7 @@ describe('Refungible: Plain calls', () => { itEth('Can perform mintBulk()', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'MintBulky', '6', '6'); + const {collectionAddress} = await helper.eth.createERC721MetadataRFTCollection(owner, 'MintBulky', '6', '6', ''); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); { @@ -179,7 +179,7 @@ describe('Refungible: Plain calls', () => { itEth('Can perform burn()', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Burny', '6', '6'); + const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Burny', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); @@ -197,7 +197,7 @@ describe('Refungible: Plain calls', () => { itEth('Can perform transferFrom()', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'TransferFromy', '6', '6'); + const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'TransferFromy', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); @@ -241,7 +241,7 @@ describe('Refungible: Plain calls', () => { itEth('Can perform transfer()', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Transferry', '6', '6'); + const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Transferry', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); @@ -271,7 +271,7 @@ describe('Refungible: Plain calls', () => { itEth('transfer event on transfer from partial ownership to full ownership', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Transferry-Partial-to-Full', '6', '6'); + const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'Transferry-Partial-to-Full', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); @@ -298,7 +298,7 @@ describe('Refungible: Plain calls', () => { itEth('transfer event on transfer from full ownership to partial ownership', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Transferry-Full-to-Partial', '6', '6'); + const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'Transferry-Full-to-Partial', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); @@ -336,7 +336,7 @@ describe('RFT: Fees', () => { itEth('transferFrom() call fee is less than 0.2UNQ', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Feeful-Transfer-From', '6', '6'); + const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Feeful-Transfer-From', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); @@ -350,7 +350,7 @@ describe('RFT: Fees', () => { itEth('transfer() call fee is less than 0.2UNQ', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Feeful-Transfer', '6', '6'); + const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Feeful-Transfer', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); @@ -386,8 +386,8 @@ describe('Common metadata', () => { itEth('Returns symbol name', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Leviathan', '', '12'); - const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'Leviathan', tokenPrefix: '12'}); + const contract = helper.ethNativeContract.collectionById(collectionId, 'rft', caller); const symbol = await contract.methods.symbol().call(); expect(symbol).to.equal('12'); }); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 5196ac525e..b2d578ac60 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -81,7 +81,7 @@ describe('Check ERC721 token URI for ReFungible', () => { const receiver = helper.eth.createAccount(); const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelper.methods.createERC721MetadataCompatibleCollection('Mint collection', 'a', 'b', tokenPrefix).send({value: Number(2n * helper.balance.getOneTokenNominal())}); + let result = await collectionHelper.methods.createERC721MetadataNFTCollection('Mint collection', 'a', 'b', tokenPrefix).send({value: Number(2n * helper.balance.getOneTokenNominal())}); const collectionAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); @@ -294,7 +294,7 @@ describe('Refungible: Plain calls', () => { itEth('Receiving Transfer event on burning into full ownership', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); const receiver = await helper.eth.createAccountWithBalance(donor); - const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(caller, 'Devastation', '6', '6'); + const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'Devastation', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); const tokenId = await contract.methods.nextTokenId().call(); @@ -479,7 +479,7 @@ describe('ERC 1633 implementation', () => { itEth('Default parent token address and id', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionId, collectionAddress} = await helper.eth.createRefungibleCollection(owner, 'Sands', '', 'GRAIN'); + const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(owner, 'Sands', '', 'GRAIN'); const collectionContract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); const tokenId = await collectionContract.methods.nextTokenId().call(); diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index b66f784500..fd1f99f319 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -174,11 +174,11 @@ class EthGroup extends EthGroupBase { return await this.helper.callRpc('api.rpc.eth.call', [{from: signer, to: contractAddress, data: abi}]); } - async createNonfungibleCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{collectionId: number, collectionAddress: string}> { + async createNFTCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{collectionId: number, collectionAddress: string}> { const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice(); const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); - const result = await collectionHelper.methods.createNonfungibleCollection(name, description, tokenPrefix).send({value: Number(collectionCreationPrice)}); + const result = await collectionHelper.methods.createNFTCollection(name, description, tokenPrefix).send({value: Number(collectionCreationPrice)}); const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress); @@ -186,7 +186,19 @@ class EthGroup extends EthGroupBase { return {collectionId, collectionAddress}; } - async createRefungibleCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{collectionId: number, collectionAddress: string}> { + async createERC721MetadataNFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string}> { + const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice(); + const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); + + const result = await collectionHelper.methods.createERC721MetadataNFTCollection(name, description, tokenPrefix, baseUri).send({value: Number(collectionCreationPrice)}); + + const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); + const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress); + + return {collectionId, collectionAddress}; + } + + async createRFTCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{collectionId: number, collectionAddress: string}> { const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice(); const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); @@ -198,6 +210,18 @@ class EthGroup extends EthGroupBase { return {collectionId, collectionAddress}; } + async createERC721MetadataRFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string}> { + const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice(); + const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); + + const result = await collectionHelper.methods.createERC721MetadataRFTCollection(name, description, tokenPrefix, baseUri).send({value: Number(collectionCreationPrice)}); + + const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); + const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress); + + return {collectionId, collectionAddress}; + } + async deployCollectorContract(signer: string): Promise { return await this.helper.ethContract.deployByCode(signer, 'Collector', ` // SPDX-License-Identifier: UNLICENSED diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index 7d20a3c46e..4c2427d0c2 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -18,6 +18,52 @@ import {IKeyringPair} from '@polkadot/types/types'; import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from '../util/playgrounds'; import {UniqueHelper, UniqueBaseCollection, UniqueNFTCollection, UniqueNFToken, UniqueRFTCollection, UniqueRFToken} from '../util/playgrounds/unique'; + +describe('Composite Properties Test', () => { + let alice: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + const donor = privateKey('//Alice'); + [alice] = await helper.arrange.createAccounts([50n], donor); + }); + }); + + async function testMakeSureSuppliesRequired(baseCollection: UniqueNFTCollection | UniqueRFTCollection) { + + const collectionOption = await baseCollection.getOptions(); + expect(collectionOption).is.not.null; + let collection = collectionOption; + expect(collection.tokenPropertyPermissions).to.be.empty; + expect(collection.properties).to.be.deep.equal([{key: 'ERC721Metadata', value: '1'}]); + + const propertyPermissions = [ + {key: 'mindgame', permission: {collectionAdmin: true, mutable: false, tokenOwner: true}}, + {key: 'skullduggery', permission: {collectionAdmin: false, mutable: true, tokenOwner: false}}, + ]; + await expect(await baseCollection.setTokenPropertyPermissions(alice, propertyPermissions)).to.be.true; + + const collectionProperties = [ + {key: 'ERC721Metadata', value: '1'}, + {key: 'black_hole', value: 'LIGO'}, + {key: 'electron', value: 'come bond'}, + ]; + + await expect(await baseCollection.setProperties(alice, collectionProperties)).to.be.true; + + collection = await baseCollection.getOptions(); + expect(collection.tokenPropertyPermissions).to.be.deep.equal(propertyPermissions); + expect(collection.properties).to.be.deep.equal(collectionProperties); + } + + itSub('Makes sure collectionById supplies required fields for NFT', async ({helper}) => { + await testMakeSureSuppliesRequired(await helper.nft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'})); + }); + + itSub.ifWithPallets('Makes sure collectionById supplies required fields for ReFungible', [Pallets.ReFungible], async ({helper}) => { + await testMakeSureSuppliesRequired(await helper.rft.mintCollection(alice, {name: 'A', description: 'B', tokenPrefix: 'C'})); + }); +}); // ---------- COLLECTION PROPERTIES describe('Integration Test: Collection Properties', () => { @@ -33,7 +79,11 @@ describe('Integration Test: Collection Properties', () => { itSub('Properties are initially empty', async ({helper}) => { const collection = await helper.nft.mintCollection(alice); - expect(await collection.getProperties()).to.be.empty; + const properties = await collection.getProperties(); + expect(properties).to.be.deep.equal([{ + 'key': 'ERC721Metadata', + 'value': '1', + }]); }); async function testSetsPropertiesForCollection(collection: UniqueBaseCollection) { @@ -150,7 +200,11 @@ describe('Negative Integration Test: Collection Properties', () => { await expect(collection.setProperties(bob, [{key: 'electron', value: 'come bond'}, {key: 'black_hole', value: 'LIGO'}])) .to.be.rejectedWith(/common\.NoPermission/); - expect(await collection.getProperties()).to.be.empty; + const properties = await collection.getProperties(); + expect(properties).to.be.deep.equal([{ + 'key': 'ERC721Metadata', + 'value': '1', + }]); } itSub('Fails to set properties in a NFT collection if not its onwer/administrator', async ({helper}) => { @@ -202,7 +256,11 @@ describe('Negative Integration Test: Collection Properties', () => { await expect(collection.setProperties(alice, propertiesToBeSet)). to.be.rejectedWith(/common\.PropertyLimitReached/); - expect(await collection.getProperties()).to.be.empty; + const properties = await collection.getProperties(); + expect(properties).to.be.deep.equal([{ + 'key': 'ERC721Metadata', + 'value': '1', + }]); } itSub('Fails to set more properties than it is allowed (NFT)', async ({helper}) => { diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index dd6ebc7355..98122f08ee 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -981,6 +981,10 @@ class CollectionGroup extends HelperGroup { return (await this.helper.callRpc('api.rpc.unique.collectionProperties', [collectionId, propertyKeys])).toHuman(); } + async getCollectionOptions(collectionId: number) { + return (await this.helper.callRpc('api.rpc.unique.collectionById', [collectionId])).toHuman(); + } + /** * Deletes onchain properties from the collection. * @@ -1293,6 +1297,7 @@ class NFTnRFT extends CollectionGroup { async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, mode: 'NFT' | 'RFT'): Promise { collectionOptions = JSON.parse(JSON.stringify(collectionOptions)) as ICollectionCreationOptions; // Clone object collectionOptions.mode = (mode === 'NFT') ? {nft: null} : {refungible: null}; + collectionOptions.properties = collectionOptions.properties || [{key: 'ERC721Metadata', value: '1'}]; for (const key of ['name', 'description', 'tokenPrefix']) { if (typeof collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] === 'string') collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] = this.helper.util.str2vec(collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] as string); } @@ -2476,6 +2481,10 @@ export class UniqueBaseCollection { return await this.helper.collection.getTokenNextSponsored(this.collectionId, tokenId, addressObj); } + async getOptions() { + return await this.helper.collection.getCollectionOptions(this.collectionId); + } + async setSponsor(signer: TSigner, sponsorAddress: TSubstrateAccount) { return await this.helper.collection.setSponsor(signer, this.collectionId, sponsorAddress); } From 44771a5df69618965f6ca01c733f71dd1b74572d Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Wed, 12 Oct 2022 15:24:15 +0000 Subject: [PATCH 1109/1274] feat: updates for createERC721MetadataCompatibleCollections --- pallets/common/src/erc.rs | 21 ++++++++++++--- pallets/unique/src/eth/mod.rs | 24 +++++++++++++++--- .../src/eth/stubs/CollectionHelpers.raw | Bin 1585 -> 1585 bytes .../src/eth/stubs/CollectionHelpers.sol | 14 +++++----- tests/src/eth/api/CollectionHelpers.sol | 14 +++++----- tests/src/eth/collectionHelpersAbi.json | 4 +-- tests/src/eth/collectionProperties.test.ts | 4 +-- tests/src/eth/collectionSponsoring.test.ts | 6 ++--- tests/src/eth/nonFungible.test.ts | 12 ++++----- tests/src/eth/proxy/nonFungibleProxy.test.ts | 2 +- tests/src/eth/reFungible.test.ts | 4 +-- tests/src/eth/reFungibleToken.test.ts | 10 +++----- tests/src/eth/util/playgrounds/unique.dev.ts | 8 +++--- 13 files changed, 75 insertions(+), 48 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index b856cd8aff..eeeb9fe949 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -665,6 +665,11 @@ pub mod static_property { property_key_from_bytes(b"schemaName").expect(EXPECT_CONVERT_ERROR) } + /// Key "schemaVersion". + pub fn schema_version() -> up_data_structs::PropertyKey { + property_key_from_bytes(b"schemaVersion").expect(EXPECT_CONVERT_ERROR) + } + /// Key "baseURI". pub fn base_uri() -> up_data_structs::PropertyKey { property_key_from_bytes(b"baseURI").expect(EXPECT_CONVERT_ERROR) @@ -672,12 +677,12 @@ pub mod static_property { /// Key "url". pub fn url() -> up_data_structs::PropertyKey { - property_key_from_bytes(b"url").expect(EXPECT_CONVERT_ERROR) + property_key_from_bytes(b"URI").expect(EXPECT_CONVERT_ERROR) } /// Key "suffix". pub fn suffix() -> up_data_structs::PropertyKey { - property_key_from_bytes(b"suffix").expect(EXPECT_CONVERT_ERROR) + property_key_from_bytes(b"URISuffix").expect(EXPECT_CONVERT_ERROR) } /// Key "parentNft". @@ -685,7 +690,7 @@ pub mod static_property { property_key_from_bytes(b"parentNft").expect(EXPECT_CONVERT_ERROR) } - /// Key "parentNft". + /// Key "ERC721Metadata". pub fn erc721_metadata() -> up_data_structs::PropertyKey { property_key_from_bytes(b"ERC721Metadata").expect(EXPECT_CONVERT_ERROR) } @@ -695,6 +700,9 @@ pub mod static_property { pub mod value { use super::*; + /// Value "Schema version". + pub const SCHEMA_VERSION: &[u8] = b"1.0.0"; + /// Value "ERC721Metadata". pub const ERC721_METADATA: &[u8] = b"ERC721Metadata"; @@ -709,7 +717,12 @@ pub mod static_property { property_value_from_bytes(ERC721_METADATA).expect(EXPECT_CONVERT_ERROR) } - /// Value for [`ERC721_METADATA`]. + /// Value for [`SCHEMA_VERSION`]. + pub fn schema_version() -> up_data_structs::PropertyValue { + property_value_from_bytes(SCHEMA_VERSION).expect(EXPECT_CONVERT_ERROR) + } + + /// Value for [`ERC721_METADATA_SUPPORTED`]. pub fn erc721_metadata_supported() -> up_data_structs::PropertyValue { property_value_from_bytes(ERC721_METADATA_SUPPORTED).expect(EXPECT_CONVERT_ERROR) } diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index ecbd2dea37..e3a66b6ec0 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -116,7 +116,18 @@ fn make_data( .try_push(up_data_structs::PropertyKeyPermission { key: key::suffix(), permission: up_data_structs::PropertyPermission { - mutable: false, + mutable: true, + collection_admin: true, + token_owner: false, + }, + }) + .map_err(|e| Error::Revert(format!("{:?}", e)))?; + + token_property_permissions + .try_push(up_data_structs::PropertyKeyPermission { + key: key::url(), + permission: up_data_structs::PropertyPermission { + mutable: true, collection_admin: true, token_owner: false, }, @@ -129,6 +140,13 @@ fn make_data( value: property_value::erc721(), }) .map_err(|e| Error::Revert(format!("{:?}", e)))?; + + properties + .try_push(up_data_structs::Property { + key: key::schema_version(), + value: property_value::schema_version(), + }) + .map_err(|e| Error::Revert(format!("{:?}", e)))?; properties .try_push(up_data_structs::Property { @@ -266,7 +284,7 @@ where } #[weight(>::create_collection())] - #[solidity(rename_selector = "createERC721MetadataNFTCollection")] + #[solidity(rename_selector = "createERC721MetadataCompatibleNFTCollection")] fn create_nonfungible_collection_with_properties( &mut self, caller: caller, @@ -339,7 +357,7 @@ where } #[weight(>::create_collection())] - #[solidity(rename_selector = "createERC721MetadataRFTCollection")] + #[solidity(rename_selector = "createERC721MetadataCompatibleRFTCollection")] fn create_refungible_collection_with_properties( &mut self, caller: caller, diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index 5c564b15aef6a35614801873d49e6284dda904f4..ab164bc0f497a8c02340cba99ff56d42b8e376a1 100644 GIT binary patch delta 103 zcmdnUvyo@R7DmmL&$k{BOk{`*Z%76)MG_gF0hz1CO#*<-13>2Cdm>YS%rBGgGTL)2 zjZE$UDcP*Tw1-(iNNmDptM!MDZb*OEdYb3Z)B1ZZ_Kvfba9Q=e>Y3&>p>h(NApiqL BEd&4n delta 103 zcmdnUvyo@R7Dml|%NETPOk{`*Z%76)MG_gF0hx#IiA(`9zW|vR?@#LiiB7)DXwR`) z+#~?VIj~uUX%Dl)CI$1Lm3~wE=RP<4_$gAemnk`pN&D1~$4O0X%hpSDDNSNC1OWAe BE9d|K diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.sol b/pallets/unique/src/eth/stubs/CollectionHelpers.sol index 2c02928e54..ef4573a549 100644 --- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol +++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol @@ -23,7 +23,7 @@ contract CollectionHelpersEvents { } /// @title Contract, which allows users to operate with collections -/// @dev the ERC-165 identifier for this interface is 0xf62c7aa9 +/// @dev the ERC-165 identifier for this interface is 0x95eb98f4 contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { /// Create an NFT collection /// @param name Name of the collection @@ -65,9 +65,9 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { return 0x0000000000000000000000000000000000000000; } - /// @dev EVM selector for this function is: 0xd1df968c, - /// or in textual repr: createERC721MetadataNFTCollection(string,string,string,string) - function createERC721MetadataNFTCollection( + /// @dev EVM selector for this function is: 0xa9e7b5c0, + /// or in textual repr: createERC721MetadataCompatibleNFTCollection(string,string,string,string) + function createERC721MetadataCompatibleNFTCollection( string memory name, string memory description, string memory tokenPrefix, @@ -112,9 +112,9 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { return 0x0000000000000000000000000000000000000000; } - /// @dev EVM selector for this function is: 0xbea6a299, - /// or in textual repr: createERC721MetadataRFTCollection(string,string,string,string) - function createERC721MetadataRFTCollection( + /// @dev EVM selector for this function is: 0xa5596388, + /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string) + function createERC721MetadataCompatibleRFTCollection( string memory name, string memory description, string memory tokenPrefix, diff --git a/tests/src/eth/api/CollectionHelpers.sol b/tests/src/eth/api/CollectionHelpers.sol index 4c98a5dfc9..13e5e64ddd 100644 --- a/tests/src/eth/api/CollectionHelpers.sol +++ b/tests/src/eth/api/CollectionHelpers.sol @@ -18,7 +18,7 @@ interface CollectionHelpersEvents { } /// @title Contract, which allows users to operate with collections -/// @dev the ERC-165 identifier for this interface is 0xf62c7aa9 +/// @dev the ERC-165 identifier for this interface is 0x95eb98f4 interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { /// Create an NFT collection /// @param name Name of the collection @@ -46,9 +46,9 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory tokenPrefix ) external payable returns (address); - /// @dev EVM selector for this function is: 0xd1df968c, - /// or in textual repr: createERC721MetadataNFTCollection(string,string,string,string) - function createERC721MetadataNFTCollection( + /// @dev EVM selector for this function is: 0xa9e7b5c0, + /// or in textual repr: createERC721MetadataCompatibleNFTCollection(string,string,string,string) + function createERC721MetadataCompatibleNFTCollection( string memory name, string memory description, string memory tokenPrefix, @@ -71,9 +71,9 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory tokenPrefix ) external payable returns (address); - /// @dev EVM selector for this function is: 0xbea6a299, - /// or in textual repr: createERC721MetadataRFTCollection(string,string,string,string) - function createERC721MetadataRFTCollection( + /// @dev EVM selector for this function is: 0xa5596388, + /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string) + function createERC721MetadataCompatibleRFTCollection( string memory name, string memory description, string memory tokenPrefix, diff --git a/tests/src/eth/collectionHelpersAbi.json b/tests/src/eth/collectionHelpersAbi.json index afb9659356..acb416c8ed 100644 --- a/tests/src/eth/collectionHelpersAbi.json +++ b/tests/src/eth/collectionHelpersAbi.json @@ -32,7 +32,7 @@ { "internalType": "string", "name": "tokenPrefix", "type": "string" }, { "internalType": "string", "name": "baseUri", "type": "string" } ], - "name": "createERC721MetadataNFTCollection", + "name": "createERC721MetadataCompatibleNFTCollection", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "payable", "type": "function" @@ -44,7 +44,7 @@ { "internalType": "string", "name": "tokenPrefix", "type": "string" }, { "internalType": "string", "name": "baseUri", "type": "string" } ], - "name": "createERC721MetadataRFTCollection", + "name": "createERC721MetadataCompatibleRFTCollection", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "payable", "type": "function" diff --git a/tests/src/eth/collectionProperties.test.ts b/tests/src/eth/collectionProperties.test.ts index 309eaf5338..b39d859dab 100644 --- a/tests/src/eth/collectionProperties.test.ts +++ b/tests/src/eth/collectionProperties.test.ts @@ -14,7 +14,7 @@ describe('EVM collection properties', () => { itEth('Can be set', async({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); - const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'test', tokenPrefix: 'test'}); + const collection = await helper.nft.mintCollection(alice, {name: 'name', description: 'test', tokenPrefix: 'test', properties: []}); await collection.addAdmin(alice, {Ethereum: caller}); const address = helper.ethAddress.fromCollectionId(collection.collectionId); @@ -24,7 +24,7 @@ describe('EVM collection properties', () => { const raw = (await collection.getData())?.raw; - expect(raw.properties[1].value).to.equal('testValue'); + expect(raw.properties[0].value).to.equal('testValue'); }); itEth('Can be deleted', async({helper}) => { diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index 8ead2b9db0..98b6282403 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -97,7 +97,7 @@ describe('evm collection sponsoring', () => { const owner = await helper.eth.createAccountWithBalance(donor); const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelpers.methods.createERC721MetadataNFTCollection('Sponsor collection', '1', '1', '').send({value: Number(2n * nominal)}); + let result = await collectionHelpers.methods.createERC721MetadataCompatibleNFTCollection('Sponsor collection', '1', '1', '').send({value: Number(2n * nominal)}); const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const collectionId = helper.ethAddress.extractCollectionId(collectionIdAddress); const collection = helper.nft.getCollectionObject(collectionId); @@ -167,7 +167,7 @@ describe('evm collection sponsoring', () => { // itWeb3('Sponsoring collection from substrate address via access list', async ({api, web3, privateKeyWrapper}) => { // const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper); // const collectionHelpers = evmCollectionHelpers(web3, owner); - // const result = await collectionHelpers.methods.createERC721MetadataNFTCollection('Sponsor collection', '1', '1', '').send(); + // const result = await collectionHelpers.methods.createERC721MetadataCompatibleNFTCollection('Sponsor collection', '1', '1', '').send(); // const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result); // const sponsor = privateKeyWrapper('//Alice'); // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); @@ -223,7 +223,7 @@ describe('evm collection sponsoring', () => { const owner = await helper.eth.createAccountWithBalance(donor); const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelpers.methods.createERC721MetadataNFTCollection('Sponsor collection', '1', '1', '').send({value: Number(2n * nominal)}); + let result = await collectionHelpers.methods.createERC721MetadataCompatibleNFTCollection('Sponsor collection', '1', '1', '').send({value: Number(2n * nominal)}); const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const collectionId = helper.ethAddress.extractCollectionId(collectionIdAddress); const collection = helper.nft.getCollectionObject(collectionId); diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 78912489c8..f013221ed6 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -83,14 +83,12 @@ describe('Check ERC721 token URI for NFT', () => { const owner = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelper.methods.createERC721MetadataNFTCollection('Mint collection', 'a', 'b', tokenPrefix).send({value: Number(2n * helper.balance.getOneTokenNominal())}); - const collectionAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); + const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'Mint collection', 'a', 'b', tokenPrefix); const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); const nextTokenId = await contract.methods.nextTokenId().call(); expect(nextTokenId).to.be.equal('1'); - result = await contract.methods.mint( + const result = await contract.methods.mint( receiver, nextTokenId, ).send(); @@ -115,7 +113,7 @@ describe('Check ERC721 token URI for NFT', () => { }); itEth('TokenURI from url', async ({helper}) => { - const {contract, nextTokenId} = await setup(helper, 'BaseURI_', 'url', 'Token URI'); + const {contract, nextTokenId} = await setup(helper, 'BaseURI_', 'URI', 'Token URI'); expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Token URI'); }); @@ -126,7 +124,7 @@ describe('Check ERC721 token URI for NFT', () => { itEth('TokenURI from baseURI + suffix', async ({helper}) => { const suffix = '/some/suffix'; - const {contract, nextTokenId} = await setup(helper, 'BaseURI_', 'suffix', suffix); + const {contract, nextTokenId} = await setup(helper, 'BaseURI_', 'URISuffix', suffix); expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('BaseURI_' + suffix); }); }); @@ -146,7 +144,7 @@ describe('NFT: Plain calls', () => { const owner = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionAddress} = await helper.eth.createERC721MetadataNFTCollection(owner, 'Mint collection', '6', '6', ''); + const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'Mint collection', '6', '6', ''); const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); const nextTokenId = await contract.methods.nextTokenId().call(); diff --git a/tests/src/eth/proxy/nonFungibleProxy.test.ts b/tests/src/eth/proxy/nonFungibleProxy.test.ts index 5607936e53..111696e43c 100644 --- a/tests/src/eth/proxy/nonFungibleProxy.test.ts +++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts @@ -101,7 +101,7 @@ describe('NFT (Via EVM proxy): Plain calls', () => { itEth('Can perform mint()', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const {collectionAddress} = await helper.eth.createERC721MetadataNFTCollection(owner, 'A', 'A', 'A', ''); + const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'A', 'A', 'A', ''); const caller = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index c21f161460..d8740d7cc3 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -124,7 +124,7 @@ describe('Refungible: Plain calls', () => { itEth('Can perform mint()', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionAddress} = await helper.eth.createERC721MetadataRFTCollection(owner, 'Minty', '6', '6', ''); + const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, 'Minty', '6', '6', ''); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); const nextTokenId = await contract.methods.nextTokenId().call(); @@ -147,7 +147,7 @@ describe('Refungible: Plain calls', () => { itEth('Can perform mintBulk()', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionAddress} = await helper.eth.createERC721MetadataRFTCollection(owner, 'MintBulky', '6', '6', ''); + const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, 'MintBulky', '6', '6', ''); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); { diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index b2d578ac60..784f35ddc2 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -80,14 +80,12 @@ describe('Check ERC721 token URI for ReFungible', () => { const owner = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const collectionHelper = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelper.methods.createERC721MetadataNFTCollection('Mint collection', 'a', 'b', tokenPrefix).send({value: Number(2n * helper.balance.getOneTokenNominal())}); - const collectionAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); + const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, 'Mint collection', 'a', 'b', tokenPrefix); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); const nextTokenId = await contract.methods.nextTokenId().call(); expect(nextTokenId).to.be.equal('1'); - result = await contract.methods.mint( + const result = await contract.methods.mint( receiver, nextTokenId, ).send(); @@ -112,7 +110,7 @@ describe('Check ERC721 token URI for ReFungible', () => { }); itEth('TokenURI from url', async ({helper}) => { - const {contract, nextTokenId} = await setup(helper, 'BaseURI_', 'url', 'Token URI'); + const {contract, nextTokenId} = await setup(helper, 'BaseURI_', 'URI', 'Token URI'); expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Token URI'); }); @@ -123,7 +121,7 @@ describe('Check ERC721 token URI for ReFungible', () => { itEth('TokenURI from baseURI + suffix', async ({helper}) => { const suffix = '/some/suffix'; - const {contract, nextTokenId} = await setup(helper, 'BaseURI_', 'suffix', suffix); + const {contract, nextTokenId} = await setup(helper, 'BaseURI_', 'URISuffix', suffix); expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('BaseURI_' + suffix); }); }); diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index fd1f99f319..16b89d0cec 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -186,11 +186,11 @@ class EthGroup extends EthGroupBase { return {collectionId, collectionAddress}; } - async createERC721MetadataNFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string}> { + async createERC721MetadataCompatibleNFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string}> { const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice(); const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); - const result = await collectionHelper.methods.createERC721MetadataNFTCollection(name, description, tokenPrefix, baseUri).send({value: Number(collectionCreationPrice)}); + const result = await collectionHelper.methods.createERC721MetadataCompatibleNFTCollection(name, description, tokenPrefix, baseUri).send({value: Number(collectionCreationPrice)}); const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress); @@ -210,11 +210,11 @@ class EthGroup extends EthGroupBase { return {collectionId, collectionAddress}; } - async createERC721MetadataRFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string}> { + async createERC721MetadataCompatibleRFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string}> { const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice(); const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); - const result = await collectionHelper.methods.createERC721MetadataRFTCollection(name, description, tokenPrefix, baseUri).send({value: Number(collectionCreationPrice)}); + const result = await collectionHelper.methods.createERC721MetadataCompatibleRFTCollection(name, description, tokenPrefix, baseUri).send({value: Number(collectionCreationPrice)}); const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress); From 8c42de5841abbf8c7c83a25735115b8fdf98c348 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Wed, 12 Oct 2022 15:42:36 +0000 Subject: [PATCH 1110/1274] feat: update tokenURI --- pallets/nonfungible/src/erc.rs | 2 +- pallets/refungible/src/erc.rs | 2 +- tests/src/eth/nonFungible.test.ts | 4 ++-- tests/src/eth/reFungibleToken.test.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 7949a662a9..cd9f3ab34a 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -252,7 +252,7 @@ impl NonfungibleHandle { } } - return Ok(base_uri + token_id.to_string().as_str()); + return Ok(base_uri); } } diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index ef13470dae..8c631cd972 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -248,7 +248,7 @@ impl RefungibleHandle { } } - return Ok(base_uri + token_id.to_string().as_str()); + return Ok(base_uri); } } diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index f013221ed6..54c0bf0d73 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -117,9 +117,9 @@ describe('Check ERC721 token URI for NFT', () => { expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Token URI'); }); - itEth('TokenURI from baseURI + tokenId', async ({helper}) => { + itEth('TokenURI from baseURI', async ({helper}) => { const {contract, nextTokenId} = await setup(helper, 'BaseURI_'); - expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('BaseURI_' + nextTokenId); + expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('BaseURI_'); }); itEth('TokenURI from baseURI + suffix', async ({helper}) => { diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 784f35ddc2..57d93ef73b 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -114,9 +114,9 @@ describe('Check ERC721 token URI for ReFungible', () => { expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Token URI'); }); - itEth('TokenURI from baseURI + tokenId', async ({helper}) => { + itEth('TokenURI from baseURI', async ({helper}) => { const {contract, nextTokenId} = await setup(helper, 'BaseURI_'); - expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('BaseURI_' + nextTokenId); + expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('BaseURI_'); }); itEth('TokenURI from baseURI + suffix', async ({helper}) => { From 0649e6110bdf19d9fb4bd93152862c120b3d17bb Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Wed, 12 Oct 2022 15:47:58 +0000 Subject: [PATCH 1111/1274] chore: cargo fmt --- pallets/unique/src/eth/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index e3a66b6ec0..981689765d 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -140,7 +140,7 @@ fn make_data( value: property_value::erc721(), }) .map_err(|e| Error::Revert(format!("{:?}", e)))?; - + properties .try_push(up_data_structs::Property { key: key::schema_version(), From f8de52dc63cdf678077ac7530abf367876d624fd Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Wed, 12 Oct 2022 18:05:15 +0000 Subject: [PATCH 1112/1274] chore: code review requests --- pallets/nonfungible/src/erc.rs | 62 +++++++---- pallets/nonfungible/src/lib.rs | 12 --- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4374 -> 4374 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 100 +++++++++--------- pallets/refungible/src/erc.rs | 65 +++++++----- pallets/refungible/src/lib.rs | 12 --- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4401 -> 4401 bytes .../refungible/src/stubs/UniqueRefungible.sol | 96 ++++++++--------- pallets/unique/src/eth/mod.rs | 21 ---- .../src/eth/stubs/CollectionHelpers.raw | Bin 1585 -> 1574 bytes .../src/eth/stubs/CollectionHelpers.sol | 17 +-- tests/src/eth/api/CollectionHelpers.sol | 10 +- tests/src/eth/api/UniqueNFT.sol | 70 ++++++------ tests/src/eth/api/UniqueRefungible.sol | 66 ++++++------ tests/src/eth/collectionHelpersAbi.json | 11 -- tests/src/eth/collectionProperties.test.ts | 3 +- tests/src/eth/nonFungible.test.ts | 4 +- tests/src/eth/nonFungibleAbi.json | 6 +- tests/src/eth/reFungibleAbi.json | 6 +- tests/src/eth/reFungibleToken.test.ts | 4 +- 20 files changed, 260 insertions(+), 305 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index cd9f3ab34a..880de2cb36 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -34,15 +34,14 @@ use pallet_evm_coder_substrate::dispatch_to_evm; use sp_std::vec::Vec; use pallet_common::{ erc::{ - CommonEvmHandler, PrecompileResult, CollectionCall, - static_property::{key, value as property_value}, + CommonEvmHandler, PrecompileResult, CollectionCall, static_property::key, + static_property::value, }, CollectionHandle, CollectionPropertyPermissions, }; use pallet_evm::{account::CrossAccountId, PrecompileHandle}; use pallet_evm_coder_substrate::call; use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _}; -use alloc::string::ToString; use crate::{ AccountBalance, Config, CreateItemData, NonfungibleHandle, Pallet, TokenData, TokensMinted, @@ -226,37 +225,44 @@ impl NonfungibleHandle { /// @return token's const_metadata #[solidity(rename_selector = "tokenURI")] fn token_uri(&self, token_id: uint256) -> Result { + if !self.supports_metadata() { + return Ok("".into()); + } + let token_id_u32: u32 = token_id.try_into().map_err(|_| "token id overflow")?; - if let Ok(url) = get_token_property(self, token_id_u32, &key::url()) { - if !url.is_empty() { - return Ok(url); + match get_token_property(self, token_id_u32, &key::url()).as_deref() { + Err(_) | Ok("") => (), + Ok(url) => { + return Ok(url.into()); } - } else if !self.supports_metadata() { - return Err("tokenURI not set".into()); - } + }; - if let Some(base_uri) = + let base_uri = pallet_common::Pallet::::get_collection_property(self.id, &key::base_uri()) - { - if !base_uri.is_empty() { - let base_uri = string::from_utf8(base_uri.into_inner()).map_err(|e| { + .map(BoundedVec::into_inner) + .map(string::from_utf8) + .transpose() + .map_err(|e| { Error::Revert(alloc::format!( "Can not convert value \"baseURI\" to string with error \"{}\"", e )) })?; - if let Ok(suffix) = get_token_property(self, token_id_u32, &key::suffix()) { - if !suffix.is_empty() { - return Ok(base_uri + suffix.as_str()); - } - } - return Ok(base_uri); + let base_uri = match base_uri.as_deref() { + None | Some("") => { + return Ok("".into()); } - } + Some(base_uri) => base_uri.into(), + }; - Ok("".into()) + Ok( + match get_token_property(self, token_id_u32, &key::suffix()).as_deref() { + Err(_) | Ok("") => base_uri, + Ok(suffix) => base_uri + suffix, + }, + ) } } @@ -706,17 +712,29 @@ impl NonfungibleHandle { } } +impl NonfungibleHandle { + pub fn supports_metadata(&self) -> bool { + if let Some(erc721_metadata) = + pallet_common::Pallet::::get_collection_property(self.id, &key::erc721_metadata()) + { + *erc721_metadata.into_inner() == *value::ERC721_METADATA_SUPPORTED + } else { + false + } + } +} + #[solidity_interface( name = UniqueNFT, is( ERC721, - ERC721Metadata(if(this.supports_metadata())), ERC721Enumerable, ERC721UniqueExtensions, ERC721Mintable, ERC721Burnable, Collection(via(common_mut returns CollectionHandle)), TokenProperties, + ERC721Metadata(if(this.supports_metadata())), ) )] impl NonfungibleHandle where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {} diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 9cc1561f8f..7eb6a31871 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -297,18 +297,6 @@ impl NonfungibleHandle { } } -impl NonfungibleHandle { - pub fn supports_metadata(&self) -> bool { - if let Some(erc721_metadata) = - pallet_common::Pallet::::get_collection_property(self.id, &key::erc721_metadata()) - { - *erc721_metadata.into_inner() == *value::ERC721_METADATA_SUPPORTED - } else { - false - } - } -} - impl WithRecorder for NonfungibleHandle { fn recorder(&self) -> &SubstrateRecorder { self.0.recorder() diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 6fbcefcc1a116b6fd4750e0573005d93fa317028..c06d3f5a804375fbd9d3eb1998a13ca9dad47838 100644 GIT binary patch delta 44 zcmV+{0Mq}LB9 RefungibleHandle { /// @return token's const_metadata #[solidity(rename_selector = "tokenURI")] fn token_uri(&self, token_id: uint256) -> Result { + if !self.supports_metadata() { + return Ok("".into()); + } + let token_id_u32: u32 = token_id.try_into().map_err(|_| "token id overflow")?; - if let Ok(url) = get_token_property(self, token_id_u32, &key::url()) { - if !url.is_empty() { - return Ok(url); + match get_token_property(self, token_id_u32, &key::url()).as_deref() { + Err(_) | Ok("") => (), + Ok(url) => { + return Ok(url.into()); } - } else if !self.supports_metadata() { - return Err("tokenURI not set".into()); - } + }; - if let Some(base_uri) = + let base_uri = pallet_common::Pallet::::get_collection_property(self.id, &key::base_uri()) - { - if !base_uri.is_empty() { - let base_uri = string::from_utf8(base_uri.into_inner()).map_err(|e| { + .map(BoundedVec::into_inner) + .map(string::from_utf8) + .transpose() + .map_err(|e| { Error::Revert(alloc::format!( "Can not convert value \"baseURI\" to string with error \"{}\"", e )) })?; - if let Ok(suffix) = get_token_property(self, token_id_u32, &key::suffix()) { - if !suffix.is_empty() { - return Ok(base_uri + suffix.as_str()); - } - } - return Ok(base_uri); + let base_uri = match base_uri.as_deref() { + None | Some("") => { + return Ok("".into()); } - } + Some(base_uri) => base_uri.into(), + }; - Ok("".into()) + Ok( + match get_token_property(self, token_id_u32, &key::suffix()).as_deref() { + Err(_) | Ok("") => base_uri, + Ok(suffix) => base_uri + suffix, + }, + ) } } @@ -765,17 +768,29 @@ impl RefungibleHandle { } } +impl RefungibleHandle { + pub fn supports_metadata(&self) -> bool { + if let Some(erc721_metadata) = + pallet_common::Pallet::::get_collection_property(self.id, &key::erc721_metadata()) + { + *erc721_metadata.into_inner() == *value::ERC721_METADATA_SUPPORTED + } else { + false + } + } +} + #[solidity_interface( name = UniqueRefungible, is( ERC721, - ERC721Metadata(if(this.supports_metadata())), ERC721Enumerable, ERC721UniqueExtensions, ERC721Mintable, ERC721Burnable, Collection(via(common_mut returns CollectionHandle)), TokenProperties, + ERC721Metadata(if(this.supports_metadata())), ) )] impl RefungibleHandle where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {} diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 2f25a4224c..61ff5afaba 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -304,18 +304,6 @@ impl RefungibleHandle { } } -impl RefungibleHandle { - pub fn supports_metadata(&self) -> bool { - if let Some(erc721_metadata) = - pallet_common::Pallet::::get_collection_property(self.id, &key::erc721_metadata()) - { - *erc721_metadata.into_inner() == *value::ERC721_METADATA_SUPPORTED - } else { - false - } - } -} - impl Deref for RefungibleHandle { type Target = pallet_common::CollectionHandle; diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index ebd53bbd195ca4a7b843713a4632cbd9d9959926..56ca90f71acc09e2250c1aee52bc1dc595df524d 100644 GIT binary patch delta 43 zcmV+`0M!4nBC#T{;1D47;@~)Tlve9?B?+0L{q*itPcva{Vq_fd=HRo4`jcRi5i#)K B7L@=1 delta 43 zcmV+`0M!4nBC#T{;1D3k!lsUCW*a+B3u^v4V6UrpBy*l}y(mo&py85>-qU)L5izp` B6Z!xE diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index bf18c48dee..a36ce9dd0c 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -17,6 +17,45 @@ contract ERC165 is Dummy { } } +/// @dev the ERC-165 identifier for this interface is 0x5b5e139f +contract ERC721Metadata is Dummy, ERC165 { + /// @notice A descriptive name for a collection of RFTs in this contract + /// @dev EVM selector for this function is: 0x06fdde03, + /// or in textual repr: name() + function name() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + /// @notice An abbreviated name for RFTs in this contract + /// @dev EVM selector for this function is: 0x95d89b41, + /// or in textual repr: symbol() + function symbol() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. + /// + /// @dev If the token has a `url` property and it is not empty, it is returned. + /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + /// If the collection property `baseURI` is empty or absent, return "" (empty string) + /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). + /// + /// @return token's const_metadata + /// @dev EVM selector for this function is: 0xc87b56dd, + /// or in textual repr: tokenURI(uint256) + function tokenURI(uint256 tokenId) public view returns (string memory) { + require(false, stub_error); + tokenId; + dummy; + return ""; + } +} + /// @title A contract that allows to set and delete token properties and change token property permissions. /// @dev the ERC-165 identifier for this interface is 0x41369377 contract TokenProperties is Dummy, ERC165 { @@ -177,10 +216,10 @@ contract Collection is Dummy, ERC165 { /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. /// @dev EVM selector for this function is: 0x6ec0a9f1, /// or in textual repr: collectionSponsor() - function collectionSponsor() public view returns (Tuple17 memory) { + function collectionSponsor() public view returns (Tuple15 memory) { require(false, stub_error); dummy; - return Tuple17(0x0000000000000000000000000000000000000000, 0); + return Tuple15(0x0000000000000000000000000000000000000000, 0); } /// Set limits for the collection. @@ -359,10 +398,10 @@ contract Collection is Dummy, ERC165 { /// If address is canonical then substrate mirror is zero and vice versa. /// @dev EVM selector for this function is: 0xdf727d3b, /// or in textual repr: collectionOwner() - function collectionOwner() public view returns (Tuple17 memory) { + function collectionOwner() public view returns (Tuple15 memory) { require(false, stub_error); dummy; - return Tuple17(0x0000000000000000000000000000000000000000, 0); + return Tuple15(0x0000000000000000000000000000000000000000, 0); } /// Changes collection owner to another account @@ -379,7 +418,7 @@ contract Collection is Dummy, ERC165 { } /// @dev anonymous struct -struct Tuple17 { +struct Tuple15 { address field_0; uint256 field_1; } @@ -527,7 +566,7 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { /// @param tokens array of pairs of token ID and token URI for minted tokens /// @dev EVM selector for this function is: 0x36543006, /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) - function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) public returns (bool) { + function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) public returns (bool) { require(false, stub_error); to; tokens; @@ -549,7 +588,7 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { } /// @dev anonymous struct -struct Tuple8 { +struct Tuple6 { uint256 field_0; string field_1; } @@ -594,45 +633,6 @@ contract ERC721Enumerable is Dummy, ERC165 { } } -/// @dev the ERC-165 identifier for this interface is 0x5b5e139f -contract ERC721Metadata is Dummy, ERC165 { - /// @notice A descriptive name for a collection of RFTs in this contract - /// @dev EVM selector for this function is: 0x06fdde03, - /// or in textual repr: name() - function name() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - /// @notice An abbreviated name for RFTs in this contract - /// @dev EVM selector for this function is: 0x95d89b41, - /// or in textual repr: symbol() - function symbol() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. - /// - /// @dev If the token has a `url` property and it is not empty, it is returned. - /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. - /// If the collection property `baseURI` is empty or absent, return "" (empty string) - /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix - /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). - /// - /// @return token's const_metadata - /// @dev EVM selector for this function is: 0xc87b56dd, - /// or in textual repr: tokenURI(uint256) - function tokenURI(uint256 tokenId) public view returns (string memory) { - require(false, stub_error); - tokenId; - dummy; - return ""; - } -} - /// @dev inlined interface contract ERC721Events { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); @@ -776,11 +776,11 @@ contract UniqueRefungible is Dummy, ERC165, ERC721, - ERC721Metadata, ERC721Enumerable, ERC721UniqueExtensions, ERC721Mintable, ERC721Burnable, Collection, - TokenProperties + TokenProperties, + ERC721Metadata {} diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 981689765d..bb132b29b9 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -335,27 +335,6 @@ where ) } - #[weight(>::create_collection())] - #[deprecated(note = "mathod was renamed to `create_rft_collection`, prefer it instead")] - fn create_refungible_collection( - &mut self, - caller: caller, - value: value, - name: string, - description: string, - token_prefix: string, - ) -> Result
{ - create_refungible_collection_internal::( - caller, - value, - name, - description, - token_prefix, - Default::default(), - false, - ) - } - #[weight(>::create_collection())] #[solidity(rename_selector = "createERC721MetadataCompatibleRFTCollection")] fn create_refungible_collection_with_properties( diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index ab164bc0f497a8c02340cba99ff56d42b8e376a1..fe52be4bfc58b1493019c4756f72831f16328af3 100644 GIT binary patch delta 953 zcmZ9KJ!lj`6vt4YCuY`UJ$jH-9@#FlMyX4vz#oU zx%w&FLi0PC9|rF%W;sovxj8&G6aqlRjxK6+_uUKJ3p{d$f1i(I=PuMH&|E|Bg7I}} zCA9T0q$p%grm!}KtDMYo@?-!~oSv=foc2|9D4%m>*{py<16z2^-O@Q(jX9||M1bO& z%`?}_g(xSlFn*6(sOn*%Um6tmRbtiXjAjxMw5MG;N#?(ox=TZz%b5|@3uNqI1E5$A zJ1ld0B?>l6p_27H>oIdC-q9_;!1|TB+W6HsAxcL@rJeH-@ zpJzp5Ad0g~|Hnxqk)KN!8}_+K8{El{0G^P@E+Dsqs_+EA95wb5_NXWk}~O`bdquWHNXv zt^!1_n;Ds>a+*2nShV7fQx`9W?fA>-UghNJhm#wF+s}_peR=xhz!9bQ^`-0HGT6vuyWf3qRB(5|?{@(k%?|Z-Zn+ePZf?`c1 zQlecLrkS#F*Y5dX7BbfjglWM}2v+$kj4B{?1(6jr!Qx_VpE308`|HIJvO&$2t;jY= z&PF>`l8YqYuC`8){7Le2_pSL>ggqp`^qO8}uT`U1`a-U+?VCmu}?y2j|cQp}cUis`gIp$eq{@v>@IRr+?FC^iU36^R|h z!}?==&kI(uYT}%fXKp(*WXeb>fv+YBCTGFlrnE%tSKTj{-pvhf=2rqs>zUPLPw)N5&E0o@+?ndPZ#uvH$NmB4 Ct2B%N diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.sol b/pallets/unique/src/eth/stubs/CollectionHelpers.sol index ef4573a549..7986d1001b 100644 --- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol +++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol @@ -23,7 +23,7 @@ contract CollectionHelpersEvents { } /// @title Contract, which allows users to operate with collections -/// @dev the ERC-165 identifier for this interface is 0x95eb98f4 +/// @dev the ERC-165 identifier for this interface is 0xd14d1221 contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { /// Create an NFT collection /// @param name Name of the collection @@ -97,21 +97,6 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { return 0x0000000000000000000000000000000000000000; } - /// @dev EVM selector for this function is: 0x44a68ad5, - /// or in textual repr: createRefungibleCollection(string,string,string) - function createRefungibleCollection( - string memory name, - string memory description, - string memory tokenPrefix - ) public payable returns (address) { - require(false, stub_error); - name; - description; - tokenPrefix; - dummy = 0; - return 0x0000000000000000000000000000000000000000; - } - /// @dev EVM selector for this function is: 0xa5596388, /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string) function createERC721MetadataCompatibleRFTCollection( diff --git a/tests/src/eth/api/CollectionHelpers.sol b/tests/src/eth/api/CollectionHelpers.sol index 13e5e64ddd..f07e669146 100644 --- a/tests/src/eth/api/CollectionHelpers.sol +++ b/tests/src/eth/api/CollectionHelpers.sol @@ -18,7 +18,7 @@ interface CollectionHelpersEvents { } /// @title Contract, which allows users to operate with collections -/// @dev the ERC-165 identifier for this interface is 0x95eb98f4 +/// @dev the ERC-165 identifier for this interface is 0xd14d1221 interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { /// Create an NFT collection /// @param name Name of the collection @@ -63,14 +63,6 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory tokenPrefix ) external payable returns (address); - /// @dev EVM selector for this function is: 0x44a68ad5, - /// or in textual repr: createRefungibleCollection(string,string,string) - function createRefungibleCollection( - string memory name, - string memory description, - string memory tokenPrefix - ) external payable returns (address); - /// @dev EVM selector for this function is: 0xa5596388, /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string) function createERC721MetadataCompatibleRFTCollection( diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index 4f46ba94cf..c5770e8663 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -12,6 +12,34 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } +/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension +/// @dev See https://eips.ethereum.org/EIPS/eip-721 +/// @dev the ERC-165 identifier for this interface is 0x5b5e139f +interface ERC721Metadata is Dummy, ERC165 { + /// @notice A descriptive name for a collection of NFTs in this contract + /// @dev EVM selector for this function is: 0x06fdde03, + /// or in textual repr: name() + function name() external view returns (string memory); + + /// @notice An abbreviated name for NFTs in this contract + /// @dev EVM selector for this function is: 0x95d89b41, + /// or in textual repr: symbol() + function symbol() external view returns (string memory); + + /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. + /// + /// @dev If the token has a `url` property and it is not empty, it is returned. + /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + /// If the collection property `baseURI` is empty or absent, return "" (empty string) + /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). + /// + /// @return token's const_metadata + /// @dev EVM selector for this function is: 0xc87b56dd, + /// or in textual repr: tokenURI(uint256) + function tokenURI(uint256 tokenId) external view returns (string memory); +} + /// @title A contract that allows to set and delete token properties and change token property permissions. /// @dev the ERC-165 identifier for this interface is 0x41369377 interface TokenProperties is Dummy, ERC165 { @@ -120,7 +148,7 @@ interface Collection is Dummy, ERC165 { /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. /// @dev EVM selector for this function is: 0x6ec0a9f1, /// or in textual repr: collectionSponsor() - function collectionSponsor() external view returns (Tuple17 memory); + function collectionSponsor() external view returns (Tuple15 memory); /// Set limits for the collection. /// @dev Throws error if limit not found. @@ -237,7 +265,7 @@ interface Collection is Dummy, ERC165 { /// If address is canonical then substrate mirror is zero and vice versa. /// @dev EVM selector for this function is: 0xdf727d3b, /// or in textual repr: collectionOwner() - function collectionOwner() external view returns (Tuple17 memory); + function collectionOwner() external view returns (Tuple15 memory); /// Changes collection owner to another account /// @@ -249,7 +277,7 @@ interface Collection is Dummy, ERC165 { } /// @dev anonymous struct -struct Tuple17 { +struct Tuple15 { address field_0; uint256 field_1; } @@ -350,11 +378,11 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { /// @param tokens array of pairs of token ID and token URI for minted tokens /// @dev EVM selector for this function is: 0x36543006, /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) - function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) external returns (bool); + function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) external returns (bool); } /// @dev anonymous struct -struct Tuple8 { +struct Tuple6 { uint256 field_0; string field_1; } @@ -384,34 +412,6 @@ interface ERC721Enumerable is Dummy, ERC165 { function totalSupply() external view returns (uint256); } -/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension -/// @dev See https://eips.ethereum.org/EIPS/eip-721 -/// @dev the ERC-165 identifier for this interface is 0x5b5e139f -interface ERC721Metadata is Dummy, ERC165 { - /// @notice A descriptive name for a collection of NFTs in this contract - /// @dev EVM selector for this function is: 0x06fdde03, - /// or in textual repr: name() - function name() external view returns (string memory); - - /// @notice An abbreviated name for NFTs in this contract - /// @dev EVM selector for this function is: 0x95d89b41, - /// or in textual repr: symbol() - function symbol() external view returns (string memory); - - /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. - /// - /// @dev If the token has a `url` property and it is not empty, it is returned. - /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. - /// If the collection property `baseURI` is empty or absent, return "" (empty string) - /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix - /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). - /// - /// @return token's const_metadata - /// @dev EVM selector for this function is: 0xc87b56dd, - /// or in textual repr: tokenURI(uint256) - function tokenURI(uint256 tokenId) external view returns (string memory); -} - /// @dev inlined interface interface ERC721Events { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); @@ -507,11 +507,11 @@ interface UniqueNFT is Dummy, ERC165, ERC721, - ERC721Metadata, ERC721Enumerable, ERC721UniqueExtensions, ERC721Mintable, ERC721Burnable, Collection, - TokenProperties + TokenProperties, + ERC721Metadata {} diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index 0e0933f05d..3d53256922 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -12,6 +12,32 @@ interface ERC165 is Dummy { function supportsInterface(bytes4 interfaceID) external view returns (bool); } +/// @dev the ERC-165 identifier for this interface is 0x5b5e139f +interface ERC721Metadata is Dummy, ERC165 { + /// @notice A descriptive name for a collection of RFTs in this contract + /// @dev EVM selector for this function is: 0x06fdde03, + /// or in textual repr: name() + function name() external view returns (string memory); + + /// @notice An abbreviated name for RFTs in this contract + /// @dev EVM selector for this function is: 0x95d89b41, + /// or in textual repr: symbol() + function symbol() external view returns (string memory); + + /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. + /// + /// @dev If the token has a `url` property and it is not empty, it is returned. + /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + /// If the collection property `baseURI` is empty or absent, return "" (empty string) + /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). + /// + /// @return token's const_metadata + /// @dev EVM selector for this function is: 0xc87b56dd, + /// or in textual repr: tokenURI(uint256) + function tokenURI(uint256 tokenId) external view returns (string memory); +} + /// @title A contract that allows to set and delete token properties and change token property permissions. /// @dev the ERC-165 identifier for this interface is 0x41369377 interface TokenProperties is Dummy, ERC165 { @@ -120,7 +146,7 @@ interface Collection is Dummy, ERC165 { /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. /// @dev EVM selector for this function is: 0x6ec0a9f1, /// or in textual repr: collectionSponsor() - function collectionSponsor() external view returns (Tuple17 memory); + function collectionSponsor() external view returns (Tuple15 memory); /// Set limits for the collection. /// @dev Throws error if limit not found. @@ -237,7 +263,7 @@ interface Collection is Dummy, ERC165 { /// If address is canonical then substrate mirror is zero and vice versa. /// @dev EVM selector for this function is: 0xdf727d3b, /// or in textual repr: collectionOwner() - function collectionOwner() external view returns (Tuple17 memory); + function collectionOwner() external view returns (Tuple15 memory); /// Changes collection owner to another account /// @@ -249,7 +275,7 @@ interface Collection is Dummy, ERC165 { } /// @dev anonymous struct -struct Tuple17 { +struct Tuple15 { address field_0; uint256 field_1; } @@ -352,7 +378,7 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { /// @param tokens array of pairs of token ID and token URI for minted tokens /// @dev EVM selector for this function is: 0x36543006, /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) - function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) external returns (bool); + function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) external returns (bool); /// Returns EVM address for refungible token /// @@ -363,7 +389,7 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { } /// @dev anonymous struct -struct Tuple8 { +struct Tuple6 { uint256 field_0; string field_1; } @@ -393,32 +419,6 @@ interface ERC721Enumerable is Dummy, ERC165 { function totalSupply() external view returns (uint256); } -/// @dev the ERC-165 identifier for this interface is 0x5b5e139f -interface ERC721Metadata is Dummy, ERC165 { - /// @notice A descriptive name for a collection of RFTs in this contract - /// @dev EVM selector for this function is: 0x06fdde03, - /// or in textual repr: name() - function name() external view returns (string memory); - - /// @notice An abbreviated name for RFTs in this contract - /// @dev EVM selector for this function is: 0x95d89b41, - /// or in textual repr: symbol() - function symbol() external view returns (string memory); - - /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. - /// - /// @dev If the token has a `url` property and it is not empty, it is returned. - /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. - /// If the collection property `baseURI` is empty or absent, return "" (empty string) - /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix - /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). - /// - /// @return token's const_metadata - /// @dev EVM selector for this function is: 0xc87b56dd, - /// or in textual repr: tokenURI(uint256) - function tokenURI(uint256 tokenId) external view returns (string memory); -} - /// @dev inlined interface interface ERC721Events { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); @@ -512,11 +512,11 @@ interface UniqueRefungible is Dummy, ERC165, ERC721, - ERC721Metadata, ERC721Enumerable, ERC721UniqueExtensions, ERC721Mintable, ERC721Burnable, Collection, - TokenProperties + TokenProperties, + ERC721Metadata {} diff --git a/tests/src/eth/collectionHelpersAbi.json b/tests/src/eth/collectionHelpersAbi.json index acb416c8ed..4283654b88 100644 --- a/tests/src/eth/collectionHelpersAbi.json +++ b/tests/src/eth/collectionHelpersAbi.json @@ -82,17 +82,6 @@ "stateMutability": "payable", "type": "function" }, - { - "inputs": [ - { "internalType": "string", "name": "name", "type": "string" }, - { "internalType": "string", "name": "description", "type": "string" }, - { "internalType": "string", "name": "tokenPrefix", "type": "string" } - ], - "name": "createRefungibleCollection", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "payable", - "type": "function" - }, { "inputs": [ { diff --git a/tests/src/eth/collectionProperties.test.ts b/tests/src/eth/collectionProperties.test.ts index b39d859dab..2cea68061a 100644 --- a/tests/src/eth/collectionProperties.test.ts +++ b/tests/src/eth/collectionProperties.test.ts @@ -1,5 +1,6 @@ import {itEth, usingEthPlaygrounds, expect} from './util/playgrounds'; import {IKeyringPair} from '@polkadot/types/types'; +import {Pallets} from '../util/playgrounds'; describe('EVM collection properties', () => { let donor: IKeyringPair; @@ -80,7 +81,7 @@ describe('Supports ERC721Metadata', () => { expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.false; }); - itEth('ERC721Metadata property can be set for RFT collection', async({helper}) => { + itEth.ifWithPallets('ERC721Metadata property can be set for RFT collection', [Pallets.ReFungible], async({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); const collection = await helper.rft.mintCollection(donor, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 54c0bf0d73..469310bea8 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -79,11 +79,11 @@ describe('Check ERC721 token URI for NFT', () => { }); }); - async function setup(helper: EthUniqueHelper, tokenPrefix: string, propertyKey?: string, propertyValue?: string): Promise<{contract: Contract, nextTokenId: string}> { + async function setup(helper: EthUniqueHelper, baseUri: string, propertyKey?: string, propertyValue?: string): Promise<{contract: Contract, nextTokenId: string}> { const owner = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'Mint collection', 'a', 'b', tokenPrefix); + const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'Mint collection', 'a', 'b', baseUri); const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); const nextTokenId = await contract.methods.nextTokenId().call(); diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index e3bca35559..6b191668f2 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -154,7 +154,7 @@ { "internalType": "address", "name": "field_0", "type": "address" }, { "internalType": "uint256", "name": "field_1", "type": "uint256" } ], - "internalType": "struct Tuple17", + "internalType": "struct Tuple15", "name": "", "type": "tuple" } @@ -178,7 +178,7 @@ { "internalType": "address", "name": "field_0", "type": "address" }, { "internalType": "uint256", "name": "field_1", "type": "uint256" } ], - "internalType": "struct Tuple17", + "internalType": "struct Tuple15", "name": "", "type": "tuple" } @@ -287,7 +287,7 @@ { "internalType": "uint256", "name": "field_0", "type": "uint256" }, { "internalType": "string", "name": "field_1", "type": "string" } ], - "internalType": "struct Tuple8[]", + "internalType": "struct Tuple6[]", "name": "tokens", "type": "tuple[]" } diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index 39f312198d..74eaccd19e 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -154,7 +154,7 @@ { "internalType": "address", "name": "field_0", "type": "address" }, { "internalType": "uint256", "name": "field_1", "type": "uint256" } ], - "internalType": "struct Tuple17", + "internalType": "struct Tuple15", "name": "", "type": "tuple" } @@ -178,7 +178,7 @@ { "internalType": "address", "name": "field_0", "type": "address" }, { "internalType": "uint256", "name": "field_1", "type": "uint256" } ], - "internalType": "struct Tuple17", + "internalType": "struct Tuple15", "name": "", "type": "tuple" } @@ -287,7 +287,7 @@ { "internalType": "uint256", "name": "field_0", "type": "uint256" }, { "internalType": "string", "name": "field_1", "type": "string" } ], - "internalType": "struct Tuple8[]", + "internalType": "struct Tuple6[]", "name": "tokens", "type": "tuple[]" } diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 57d93ef73b..91ecaebccd 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -76,11 +76,11 @@ describe('Check ERC721 token URI for ReFungible', () => { }); }); - async function setup(helper: EthUniqueHelper, tokenPrefix: string, propertyKey?: string, propertyValue?: string): Promise<{contract: Contract, nextTokenId: string}> { + async function setup(helper: EthUniqueHelper, baseUri: string, propertyKey?: string, propertyValue?: string): Promise<{contract: Contract, nextTokenId: string}> { const owner = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); - const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, 'Mint collection', 'a', 'b', tokenPrefix); + const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, 'Mint collection', 'a', 'b', baseUri); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); const nextTokenId = await contract.methods.nextTokenId().call(); From 48f959311e08211c97ea377ea1d14c19d4b875a1 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Wed, 12 Oct 2022 18:48:07 +0000 Subject: [PATCH 1113/1274] chore: code review requests --- pallets/common/src/erc.rs | 3 --- pallets/unique/src/eth/mod.rs | 13 +------------ tests/src/deprecated-helpers/helpers.ts | 1 - tests/src/eth/base.test.ts | 2 +- tests/src/eth/nonFungible.test.ts | 4 ++-- tests/src/eth/reFungible.test.ts | 4 ++-- tests/src/nesting/properties.test.ts | 18 ++++-------------- tests/src/util/playgrounds/unique.ts | 1 - 8 files changed, 10 insertions(+), 36 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index eeeb9fe949..a168abb1b2 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -709,9 +709,6 @@ pub mod static_property { /// Value "1" ERC721 metadata supported. pub const ERC721_METADATA_SUPPORTED: &[u8] = b"1"; - /// Value "0" ERC721 metadata supported. - pub const ERC721_METADATA_UNSUPPORTED: &[u8] = b"0"; - /// Value for [`ERC721_METADATA`]. pub fn erc721() -> up_data_structs::PropertyValue { property_value_from_bytes(ERC721_METADATA).expect(EXPECT_CONVERT_ERROR) diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index bb132b29b9..f9e129f389 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -104,7 +104,7 @@ fn make_data( .try_push(up_data_structs::PropertyKeyPermission { key: key::url(), permission: up_data_structs::PropertyPermission { - mutable: false, + mutable: true, collection_admin: true, token_owner: false, }, @@ -123,17 +123,6 @@ fn make_data( }) .map_err(|e| Error::Revert(format!("{:?}", e)))?; - token_property_permissions - .try_push(up_data_structs::PropertyKeyPermission { - key: key::url(), - permission: up_data_structs::PropertyPermission { - mutable: true, - collection_admin: true, - token_owner: false, - }, - }) - .map_err(|e| Error::Revert(format!("{:?}", e)))?; - properties .try_push(up_data_structs::Property { key: key::schema_name(), diff --git a/tests/src/deprecated-helpers/helpers.ts b/tests/src/deprecated-helpers/helpers.ts index 04df231b71..30f4be6419 100644 --- a/tests/src/deprecated-helpers/helpers.ts +++ b/tests/src/deprecated-helpers/helpers.ts @@ -433,7 +433,6 @@ const defaultCreateCollectionParams: CreateCollectionParams = { mode: {type: 'NFT'}, name: 'name', tokenPrefix: 'prefix', - properties: [{key: 'ERC721Metadata', value: '1'}], }; export async function diff --git a/tests/src/eth/base.test.ts b/tests/src/eth/base.test.ts index fdc371e772..af311a0772 100644 --- a/tests/src/eth/base.test.ts +++ b/tests/src/eth/base.test.ts @@ -80,7 +80,7 @@ describe('ERC165 tests', async () => { await usingEthPlaygrounds(async (helper, privateKey) => { const donor = privateKey('//Alice'); const [alice] = await helper.arrange.createAccounts([10n], donor); - ({collectionId: collection} = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'})); + ({collectionId: collection} = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test', properties: [{key: 'ERC721Metadata', value: '1'}]})); minter = helper.eth.createAccount(); }); }); diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 469310bea8..ef7a9a01bc 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -501,7 +501,7 @@ describe('Common metadata', () => { itEth('Returns collection name', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); - const collection = await helper.nft.mintCollection(alice, {name: 'oh River', tokenPrefix: 'CHANGE'}); + const collection = await helper.nft.mintCollection(alice, {name: 'oh River', tokenPrefix: 'CHANGE', properties: [{key: 'ERC721Metadata', value: '1'}]}); const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller); const name = await contract.methods.name().call(); @@ -510,7 +510,7 @@ describe('Common metadata', () => { itEth('Returns symbol name', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); - const collection = await helper.nft.mintCollection(alice, {name: 'oh River', tokenPrefix: 'CHANGE'}); + const collection = await helper.nft.mintCollection(alice, {name: 'oh River', tokenPrefix: 'CHANGE', properties: [{key: 'ERC721Metadata', value: '1'}]}); const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller); const symbol = await contract.methods.symbol().call(); diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index d8740d7cc3..76b875278b 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -377,7 +377,7 @@ describe('Common metadata', () => { itEth('Returns collection name', async ({helper}) => { const caller = helper.eth.createAccount(); - const collection = await helper.rft.mintCollection(alice, {name: 'Leviathan', tokenPrefix: '11'}); + const collection = await helper.rft.mintCollection(alice, {name: 'Leviathan', tokenPrefix: '11', properties: [{key: 'ERC721Metadata', value: '1'}]}); const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'rft', caller); const name = await contract.methods.name().call(); @@ -386,7 +386,7 @@ describe('Common metadata', () => { itEth('Returns symbol name', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); - const {collectionId} = await helper.rft.mintCollection(alice, {name: 'Leviathan', tokenPrefix: '12'}); + const {collectionId} = await helper.rft.mintCollection(alice, {name: 'Leviathan', tokenPrefix: '12', properties: [{key: 'ERC721Metadata', value: '1'}]}); const contract = helper.ethNativeContract.collectionById(collectionId, 'rft', caller); const symbol = await contract.methods.symbol().call(); expect(symbol).to.equal('12'); diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index 4c2427d0c2..57d627a26e 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -35,7 +35,7 @@ describe('Composite Properties Test', () => { expect(collectionOption).is.not.null; let collection = collectionOption; expect(collection.tokenPropertyPermissions).to.be.empty; - expect(collection.properties).to.be.deep.equal([{key: 'ERC721Metadata', value: '1'}]); + expect(collection.properties).to.be.empty; const propertyPermissions = [ {key: 'mindgame', permission: {collectionAdmin: true, mutable: false, tokenOwner: true}}, @@ -44,7 +44,6 @@ describe('Composite Properties Test', () => { await expect(await baseCollection.setTokenPropertyPermissions(alice, propertyPermissions)).to.be.true; const collectionProperties = [ - {key: 'ERC721Metadata', value: '1'}, {key: 'black_hole', value: 'LIGO'}, {key: 'electron', value: 'come bond'}, ]; @@ -80,10 +79,7 @@ describe('Integration Test: Collection Properties', () => { itSub('Properties are initially empty', async ({helper}) => { const collection = await helper.nft.mintCollection(alice); const properties = await collection.getProperties(); - expect(properties).to.be.deep.equal([{ - 'key': 'ERC721Metadata', - 'value': '1', - }]); + expect(properties).to.be.empty; }); async function testSetsPropertiesForCollection(collection: UniqueBaseCollection) { @@ -201,10 +197,7 @@ describe('Negative Integration Test: Collection Properties', () => { .to.be.rejectedWith(/common\.NoPermission/); const properties = await collection.getProperties(); - expect(properties).to.be.deep.equal([{ - 'key': 'ERC721Metadata', - 'value': '1', - }]); + expect(properties).to.be.empty; } itSub('Fails to set properties in a NFT collection if not its onwer/administrator', async ({helper}) => { @@ -257,10 +250,7 @@ describe('Negative Integration Test: Collection Properties', () => { to.be.rejectedWith(/common\.PropertyLimitReached/); const properties = await collection.getProperties(); - expect(properties).to.be.deep.equal([{ - 'key': 'ERC721Metadata', - 'value': '1', - }]); + expect(properties).to.be.empty; } itSub('Fails to set more properties than it is allowed (NFT)', async ({helper}) => { diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 98122f08ee..26955b0161 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -1297,7 +1297,6 @@ class NFTnRFT extends CollectionGroup { async mintCollection(signer: TSigner, collectionOptions: ICollectionCreationOptions, mode: 'NFT' | 'RFT'): Promise { collectionOptions = JSON.parse(JSON.stringify(collectionOptions)) as ICollectionCreationOptions; // Clone object collectionOptions.mode = (mode === 'NFT') ? {nft: null} : {refungible: null}; - collectionOptions.properties = collectionOptions.properties || [{key: 'ERC721Metadata', value: '1'}]; for (const key of ['name', 'description', 'tokenPrefix']) { if (typeof collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] === 'string') collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] = this.helper.util.str2vec(collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] as string); } From 795e0bd1ba63283977b2ec502d5ac8ae1f8581a9 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Thu, 13 Oct 2022 08:52:21 +0000 Subject: [PATCH 1114/1274] tests(util): fix duplicate addresses for filenames --- tests/src/util/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/util/index.ts b/tests/src/util/index.ts index 64eea54bf3..a57d0f7b45 100644 --- a/tests/src/util/index.ts +++ b/tests/src/util/index.ts @@ -15,7 +15,7 @@ chai.use(chaiAsPromised); export const expect = chai.expect; const getTestHash = (filename: string) => { - return crypto.createHash('md5').update(path.basename(filename)).digest('hex'); + return crypto.createHash('md5').update(filename).digest('hex'); }; export const getTestSeed = (filename: string) => { From 164f812efca73c81a5436c47e206d71672667d2d Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 13 Oct 2022 09:03:18 +0000 Subject: [PATCH 1115/1274] fix: remove .docker/additional --- .docker/additional/.env | 5 -- .docker/additional/Dockerfile-xcm | 86 ----------------------- .docker/additional/docker-compose-xcm.yml | 24 ------- 3 files changed, 115 deletions(-) delete mode 100644 .docker/additional/.env delete mode 100644 .docker/additional/Dockerfile-xcm delete mode 100644 .docker/additional/docker-compose-xcm.yml diff --git a/.docker/additional/.env b/.docker/additional/.env deleted file mode 100644 index 52109c6993..0000000000 --- a/.docker/additional/.env +++ /dev/null @@ -1,5 +0,0 @@ -RUST_TOOLCHAIN=nightly-2022-07-24 -UNIQUE_BRANCH=feature/multi-assets-redone -CHAIN=quartz -POLKADOT_LAUNCH_BRANCH=feature/rewrite-chain-id-in-spec -LAUNCH_CONFIG_FILE=launch-config-xcm-quartz.json \ No newline at end of file diff --git a/.docker/additional/Dockerfile-xcm b/.docker/additional/Dockerfile-xcm deleted file mode 100644 index ece35f317b..0000000000 --- a/.docker/additional/Dockerfile-xcm +++ /dev/null @@ -1,86 +0,0 @@ -# ===== Rust builder ===== -FROM ubuntu:20.04 as rust-builder -LABEL maintainer="Unique.Network" - -ARG RUST_TOOLCHAIN -#ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN -ENV CARGO_HOME="/cargo-home" -ENV PATH="/cargo-home/bin:$PATH" -ENV TZ=UTC -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ - apt-get clean && \ - rm -r /var/lib/apt/lists/* - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none - -RUN rustup toolchain uninstall $(rustup toolchain list) && \ - rustup toolchain install ${RUST_TOOLCHAIN} && \ - rustup default ${RUST_TOOLCHAIN} && \ - rustup target list --installed && \ - rustup show -RUN rustup target add wasm32-unknown-unknown --toolchain ${RUST_TOOLCHAIN} - -RUN mkdir /unique_parachain -WORKDIR /unique_parachain - -# ===== BUILD ====== -FROM rust-builder as builder-unique - -ARG UNIQUE_BRANCH -ARG CHAIN -ARG LAUNCH_CONFIG_FILE -ARG PROFILE=release - -WORKDIR /unique_parachain - -RUN git clone -b ${UNIQUE_BRANCH} https://github.com/UniqueNetwork/unique-chain.git && \ - cd unique-chain && \ - cargo build --features=${CHAIN}-runtime --$PROFILE - -# ===== RUN ====== -FROM ubuntu:20.04 - -ARG POLKADOT_LAUNCH_BRANCH -ARG LAUNCH_CONFIG_FILE - -RUN apt-get -y update && \ - apt-get -y install curl git && \ - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ - export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - nvm install v16.16.0 && \ - nvm use v16.16.0 - -RUN git clone https://github.com/uniquenetwork/polkadot-launch -b ${POLKADOT_LAUNCH_BRANCH} - -RUN export NVM_DIR="$HOME/.nvm" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - npm install --global yarn && \ - yarn install - -COPY --from=builder-unique /unique_parachain/unique-chain/.docker/unique-chain/${LAUNCH_CONFIG_FILE} /polkadot-launch/ -COPY --from=builder-unique /unique_parachain/unique-chain/.docker/unique-chain/5validators.jsonnet /polkadot-launch/5validators.jsonnet -COPY --from=builder-unique /unique_parachain/unique-chain/.docker/unique-chain/minBondFix.jsonnet /polkadot-launch/minBondFix.jsonnet - -COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=uniquenetwork/builder-polkadot:latest /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=uniquenetwork/builder-moonbeam:latest /unique_parachain/moonbeam/target/release/moonbeam /moonbeam/target/release/ -COPY --from=uniquenetwork/builder-cumulus:latest /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus -COPY --from=uniquenetwork/builder-acala:latest /unique_parachain/Acala/target/production/acala /acala/target/release/ -COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/ - -EXPOSE 9844 -EXPOSE 9944 -EXPOSE 9946 -EXPOSE 9947 -EXPOSE 9948 - -CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" && \ - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ - cd /polkadot-launch && \ - yarn start ${LAUNCH_CONFIG_FILE} - diff --git a/.docker/additional/docker-compose-xcm.yml b/.docker/additional/docker-compose-xcm.yml deleted file mode 100644 index 5236728f65..0000000000 --- a/.docker/additional/docker-compose-xcm.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: "3.5" - -services: - xcm_nodes: - build: - context: . - dockerfile: ./Dockerfile-xcm - container_name: xcm-${CHAIN}-testnet-local - expose: - - 9844 - - 9944 - - 9946 - - 9947 - - 9948 - ports: - - 127.0.0.1:9844:9844 - - 127.0.0.1:9944:9944 - - 127.0.0.1:9946:9946 - - 127.0.0.1:9947:9947 - - 127.0.0.1:9948:9948 - logging: - options: - max-size: "1m" - max-file: "3" From b7135593579f3ab90e988c80d58e4a840f5b0bfc Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 13 Oct 2022 09:05:17 +0000 Subject: [PATCH 1116/1274] chore: remove URI ttp from clean collections --- pallets/unique/src/eth/mod.rs | 79 +++++------ tests/src/eth/api/UniqueRFT.sol | 163 ---------------------- tests/src/eth/createNFTCollection.test.ts | 40 ++++++ tests/src/eth/createRFTCollection.test.ts | 45 +++++- 4 files changed, 121 insertions(+), 206 deletions(-) delete mode 100644 tests/src/eth/api/UniqueRFT.sol diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index f9e129f389..dfa3e27d9a 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -30,6 +30,7 @@ use pallet_common::{ }; use pallet_evm_coder_substrate::{dispatch_to_evm, SubstrateRecorder, WithRecorder}; use pallet_evm::{account::CrossAccountId, OnMethodCall, PrecompileHandle, PrecompileResult}; +use sp_std::vec; use up_data_structs::{ CollectionName, CollectionDescription, CollectionTokenPrefix, CreateCollectionData, CollectionMode, PropertyValue, @@ -96,63 +97,57 @@ fn make_data( base_uri_value: PropertyValue, add_properties: bool, ) -> Result> { - let mut properties = up_data_structs::CollectionPropertiesVec::default(); - let mut token_property_permissions = - up_data_structs::CollectionPropertiesPermissionsVec::default(); - - token_property_permissions - .try_push(up_data_structs::PropertyKeyPermission { - key: key::url(), - permission: up_data_structs::PropertyPermission { - mutable: true, - collection_admin: true, - token_owner: false, + let token_property_permissions = if add_properties { + vec![ + up_data_structs::PropertyKeyPermission { + key: key::url(), + permission: up_data_structs::PropertyPermission { + mutable: true, + collection_admin: true, + token_owner: false, + }, }, - }) - .map_err(|e| Error::Revert(format!("{:?}", e)))?; - - if add_properties { - token_property_permissions - .try_push(up_data_structs::PropertyKeyPermission { + up_data_structs::PropertyKeyPermission { key: key::suffix(), permission: up_data_structs::PropertyPermission { mutable: true, collection_admin: true, token_owner: false, }, - }) - .map_err(|e| Error::Revert(format!("{:?}", e)))?; - - properties - .try_push(up_data_structs::Property { + }, + ] + .try_into() + .map_err(|e| Error::Revert(format!("{:?}", e)))? + } else { + up_data_structs::CollectionPropertiesPermissionsVec::default() + }; + let properties = if add_properties { + let mut properties = vec![ + up_data_structs::Property { key: key::schema_name(), value: property_value::erc721(), - }) - .map_err(|e| Error::Revert(format!("{:?}", e)))?; - - properties - .try_push(up_data_structs::Property { + }, + up_data_structs::Property { key: key::schema_version(), value: property_value::schema_version(), - }) - .map_err(|e| Error::Revert(format!("{:?}", e)))?; - - properties - .try_push(up_data_structs::Property { + }, + up_data_structs::Property { key: key::erc721_metadata(), value: property_value::erc721_metadata_supported(), - }) - .map_err(|e| Error::Revert(format!("{:?}", e)))?; - + }, + ]; if !base_uri_value.is_empty() { - properties - .try_push(up_data_structs::Property { - key: key::base_uri(), - value: base_uri_value, - }) - .map_err(|e| Error::Revert(format!("{:?}", e)))?; + properties.push(up_data_structs::Property { + key: key::base_uri(), + value: base_uri_value, + }) } - } + properties + .try_into() + .map_err(|e| Error::Revert(format!("{:?}", e)))? + } else { + up_data_structs::CollectionPropertiesVec::default() + }; let data = CreateCollectionData { name, diff --git a/tests/src/eth/api/UniqueRFT.sol b/tests/src/eth/api/UniqueRFT.sol deleted file mode 100644 index d42a584788..0000000000 --- a/tests/src/eth/api/UniqueRFT.sol +++ /dev/null @@ -1,163 +0,0 @@ -// SPDX-License-Identifier: OTHER -// This code is automatically generated - -pragma solidity >=0.8.0 <0.9.0; - -// Common stubs holder -interface Dummy { - -} - -interface ERC165 is Dummy { - function supportsInterface(bytes4 interfaceID) external view returns (bool); -} - -// Selector: 7d9262e6 -interface Collection is Dummy, ERC165 { - // Set collection property. - // - // @param key Property key. - // @param value Propery value. - // - // Selector: setCollectionProperty(string,bytes) 2f073f66 - function setCollectionProperty(string memory key, bytes memory value) - external; - - // Delete collection property. - // - // @param key Property key. - // - // Selector: deleteCollectionProperty(string) 7b7debce - function deleteCollectionProperty(string memory key) external; - - // Get collection property. - // - // @dev Throws error if key not found. - // - // @param key Property key. - // @return bytes The property corresponding to the key. - // - // Selector: collectionProperty(string) cf24fd6d - function collectionProperty(string memory key) - external - view - returns (bytes memory); - - // Set the sponsor of the collection. - // - // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor. - // - // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract. - // - // Selector: setCollectionSponsor(address) 7623402e - function setCollectionSponsor(address sponsor) external; - - // Collection sponsorship confirmation. - // - // @dev After setting the sponsor for the collection, it must be confirmed with this function. - // - // Selector: confirmCollectionSponsorship() 3c50e97a - function confirmCollectionSponsorship() external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "accountTokenOwnershipLimit", - // "sponsoredDataSize", - // "sponsoredDataRateLimit", - // "tokenLimit", - // "sponsorTransferTimeout", - // "sponsorApproveTimeout" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,uint32) 6a3841db - function setCollectionLimit(string memory limit, uint32 value) external; - - // Set limits for the collection. - // @dev Throws error if limit not found. - // @param limit Name of the limit. Valid names: - // "ownerCanTransfer", - // "ownerCanDestroy", - // "transfersEnabled" - // @param value Value of the limit. - // - // Selector: setCollectionLimit(string,bool) 993b7fba - function setCollectionLimit(string memory limit, bool value) external; - - // Get contract address. - // - // Selector: contractAddress() f6b4dfb4 - function contractAddress() external view returns (address); - - // Add collection admin by substrate address. - // @param new_admin Substrate administrator address. - // - // Selector: addCollectionAdminSubstrate(uint256) 5730062b - function addCollectionAdminSubstrate(uint256 newAdmin) external; - - // Remove collection admin by substrate address. - // @param admin Substrate administrator address. - // - // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9 - function removeCollectionAdminSubstrate(uint256 admin) external; - - // Add collection admin. - // @param new_admin Address of the added administrator. - // - // Selector: addCollectionAdmin(address) 92e462c7 - function addCollectionAdmin(address newAdmin) external; - - // Remove collection admin. - // - // @param new_admin Address of the removed administrator. - // - // Selector: removeCollectionAdmin(address) fafd7b42 - function removeCollectionAdmin(address admin) external; - - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled' - // - // Selector: setCollectionNesting(bool) 112d4586 - function setCollectionNesting(bool enable) external; - - // Toggle accessibility of collection nesting. - // - // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled' - // @param collections Addresses of collections that will be available for nesting. - // - // Selector: setCollectionNesting(bool,address[]) 64872396 - function setCollectionNesting(bool enable, address[] memory collections) - external; - - // Set the collection access method. - // @param mode Access mode - // 0 for Normal - // 1 for AllowList - // - // Selector: setCollectionAccess(uint8) 41835d4c - function setCollectionAccess(uint8 mode) external; - - // Add the user to the allowed list. - // - // @param user Address of a trusted user. - // - // Selector: addToCollectionAllowList(address) 67844fe6 - function addToCollectionAllowList(address user) external; - - // Remove the user from the allowed list. - // - // @param user Address of a removed user. - // - // Selector: removeFromCollectionAllowList(address) 85c51acb - function removeFromCollectionAllowList(address user) external; - - // Switch permission for minting. - // - // @param mode Enable if "true". - // - // Selector: setCollectionMintMode(bool) 00018e84 - function setCollectionMintMode(bool mode) external; -} - -interface UniqueRFT is Dummy, ERC165, Collection {} diff --git a/tests/src/eth/createNFTCollection.test.ts b/tests/src/eth/createNFTCollection.test.ts index 51f99c4730..4016431137 100644 --- a/tests/src/eth/createNFTCollection.test.ts +++ b/tests/src/eth/createNFTCollection.test.ts @@ -49,6 +49,46 @@ describe('Create NFT collection from EVM', () => { expect(data.description).to.be.eq(description); expect(data.raw.tokenPrefix).to.be.eq(prefix); expect(data.raw.mode).to.be.eq('NFT'); + + const options = await collection.getOptions(); + + expect(options.tokenPropertyPermissions).to.be.empty; + }); + + itEth('Create collection with properties', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + + const name = 'CollectionEVM'; + const description = 'Some description'; + const prefix = 'token prefix'; + const baseUri = 'BaseURI'; + + // todo:playgrounds this might fail when in async environment. + const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; + const {collectionId} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, name, description, prefix, baseUri); + const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; + + const collection = helper.nft.getCollectionObject(collectionId); + const data = (await collection.getData())!; + + expect(collectionCountAfter - collectionCountBefore).to.be.eq(1); + expect(collectionId).to.be.eq(collectionCountAfter); + expect(data.name).to.be.eq(name); + expect(data.description).to.be.eq(description); + expect(data.raw.tokenPrefix).to.be.eq(prefix); + expect(data.raw.mode).to.be.eq('NFT'); + + const options = await collection.getOptions(); + expect(options.tokenPropertyPermissions).to.be.deep.equal([ + { + key: 'URI', + permission: {mutable: true, collectionAdmin: true, tokenOwner: false}, + }, + { + key: 'URISuffix', + permission: {mutable: true, collectionAdmin: true, tokenOwner: false}, + }, + ]); }); // todo:playgrounds this test will fail when in async environment. diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts index 1ac41f9d1d..7cf1a9e9d6 100644 --- a/tests/src/eth/createRFTCollection.test.ts +++ b/tests/src/eth/createRFTCollection.test.ts @@ -42,7 +42,8 @@ describe('Create RFT collection from EVM', () => { const {collectionId} = await helper.eth.createRFTCollection(owner, name, description, prefix); const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; - const data = (await helper.rft.getData(collectionId))!; + const collection = helper.rft.getCollectionObject(collectionId); + const data = (await collection.getData())!; expect(collectionCountAfter - collectionCountBefore).to.be.eq(1); expect(collectionId).to.be.eq(collectionCountAfter); @@ -50,6 +51,48 @@ describe('Create RFT collection from EVM', () => { expect(data.description).to.be.eq(description); expect(data.raw.tokenPrefix).to.be.eq(prefix); expect(data.raw.mode).to.be.eq('ReFungible'); + + const options = await collection.getOptions(); + + expect(options.tokenPropertyPermissions).to.be.empty; + }); + + + + itEth('Create collection with properties', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + + const name = 'CollectionEVM'; + const description = 'Some description'; + const prefix = 'token prefix'; + const baseUri = 'BaseURI'; + + // todo:playgrounds this might fail when in async environment. + const collectionCountBefore = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; + const {collectionId} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, name, description, prefix, baseUri); + const collectionCountAfter = +(await helper.callRpc('api.rpc.unique.collectionStats')).created; + + const collection = helper.rft.getCollectionObject(collectionId); + const data = (await collection.getData())!; + + expect(collectionCountAfter - collectionCountBefore).to.be.eq(1); + expect(collectionId).to.be.eq(collectionCountAfter); + expect(data.name).to.be.eq(name); + expect(data.description).to.be.eq(description); + expect(data.raw.tokenPrefix).to.be.eq(prefix); + expect(data.raw.mode).to.be.eq('ReFungible'); + + const options = await collection.getOptions(); + expect(options.tokenPropertyPermissions).to.be.deep.equal([ + { + key: 'URI', + permission: {mutable: true, collectionAdmin: true, tokenOwner: false}, + }, + { + key: 'URISuffix', + permission: {mutable: true, collectionAdmin: true, tokenOwner: false}, + }, + ]); }); // todo:playgrounds this test will fail when in async environment. From b72b7f6e927af1924ef33f1e076c2ef134c6edc1 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 13 Oct 2022 09:17:28 +0000 Subject: [PATCH 1117/1274] fix: use helper logger in dev helpers --- tests/src/util/playgrounds/unique.dev.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 1be4662d23..a7924f41ee 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -386,7 +386,7 @@ class WaitGroup { const eventIdStr = `${eventSection}.${eventMethod}`; const waitLimitStr = `wait blocks remaining: ${maxBlocksToWait}`; - console.log(`[Block #${blockNumber}] Waiting for event \`${eventIdStr}\` (${waitLimitStr})`); + this.helper.logger.log(`[Block #${blockNumber}] Waiting for event \`${eventIdStr}\` (${waitLimitStr})`); const apiAt = await this.helper.getApi().at(blockHash); const eventRecords = (await apiAt.query.system.events()) as any; @@ -401,7 +401,7 @@ class WaitGroup { } else if (maxBlocksToWait > 0) { maxBlocksToWait--; } else { - console.log(`Event \`${eventIdStr}\` is NOT found`); + this.helper.logger.log(`Event \`${eventIdStr}\` is NOT found`); unsubscribe(); resolve(null); From 78f4f94714cf370f2fcf16f0963401a77c4341fd Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 13 Oct 2022 09:18:04 +0000 Subject: [PATCH 1118/1274] fix: remove unneeded log --- tests/src/util/playgrounds/unique.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index 32af9d07e7..ae8fe586c2 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -426,7 +426,6 @@ export class ChainHelperBase { api: ApiPromise; network: TNetworks; }> { - console.log('createConnection network = ', network); if(typeof network === 'undefined' || network === null) network = 'opal'; const supportedRPC = { opal: { From 3e10430eed1f693e26dbd6d99edca33817701b6e Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Thu, 13 Oct 2022 10:08:45 +0000 Subject: [PATCH 1119/1274] chore: add check in `supports_metadata` --- pallets/nonfungible/src/erc.rs | 12 +++---- pallets/nonfungible/src/lib.rs | 1 - pallets/refungible/src/erc.rs | 12 +++---- pallets/refungible/src/lib.rs | 5 +-- tests/src/eth/base.test.ts | 18 +++++++++- tests/src/eth/collectionProperties.test.ts | 20 +++++++++-- tests/src/eth/nonFungible.test.ts | 36 +++++++++++++++++-- tests/src/eth/reFungible.test.ts | 37 ++++++++++++++++++-- tests/src/eth/util/playgrounds/unique.dev.ts | 2 +- 9 files changed, 118 insertions(+), 25 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 880de2cb36..8cb999dc0d 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -225,10 +225,6 @@ impl NonfungibleHandle { /// @return token's const_metadata #[solidity(rename_selector = "tokenURI")] fn token_uri(&self, token_id: uint256) -> Result { - if !self.supports_metadata() { - return Ok("".into()); - } - let token_id_u32: u32 = token_id.try_into().map_err(|_| "token id overflow")?; match get_token_property(self, token_id_u32, &key::url()).as_deref() { @@ -714,13 +710,17 @@ impl NonfungibleHandle { impl NonfungibleHandle { pub fn supports_metadata(&self) -> bool { - if let Some(erc721_metadata) = + let has_metadata_support_enabled = if let Some(erc721_metadata) = pallet_common::Pallet::::get_collection_property(self.id, &key::erc721_metadata()) { *erc721_metadata.into_inner() == *value::ERC721_METADATA_SUPPORTED } else { false - } + }; + + let has_url_property_permissions = get_token_permission::(self.id, &key::url()).is_ok(); + + has_metadata_support_enabled && has_url_property_permissions } } diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 7eb6a31871..37421eb1dd 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -108,7 +108,6 @@ use up_data_structs::{ use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; use pallet_common::{ Error as CommonError, Pallet as PalletCommon, Event as CommonEvent, CollectionHandle, - erc::static_property::{key, value}, eth::collection_id_to_address, }; use pallet_structure::{Pallet as PalletStructure, Error as StructureError}; diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index b57b3a41ef..850a475b30 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -218,10 +218,6 @@ impl RefungibleHandle { /// @return token's const_metadata #[solidity(rename_selector = "tokenURI")] fn token_uri(&self, token_id: uint256) -> Result { - if !self.supports_metadata() { - return Ok("".into()); - } - let token_id_u32: u32 = token_id.try_into().map_err(|_| "token id overflow")?; match get_token_property(self, token_id_u32, &key::url()).as_deref() { @@ -770,13 +766,17 @@ impl RefungibleHandle { impl RefungibleHandle { pub fn supports_metadata(&self) -> bool { - if let Some(erc721_metadata) = + let has_metadata_support_enabled = if let Some(erc721_metadata) = pallet_common::Pallet::::get_collection_property(self.id, &key::erc721_metadata()) { *erc721_metadata.into_inner() == *value::ERC721_METADATA_SUPPORTED } else { false - } + }; + + let has_url_property_permissions = get_token_permission::(self.id, &key::url()).is_ok(); + + has_metadata_support_enabled && has_url_property_permissions } } diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index 61ff5afaba..d2824875ac 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -101,10 +101,7 @@ use frame_support::{ use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm}; use pallet_evm_coder_substrate::WithRecorder; use pallet_common::{ - CommonCollectionOperations, - erc::static_property::{key, value}, - Error as CommonError, - eth::collection_id_to_address, + CommonCollectionOperations, Error as CommonError, eth::collection_id_to_address, Event as CommonEvent, Pallet as PalletCommon, }; use pallet_structure::Pallet as PalletStructure; diff --git a/tests/src/eth/base.test.ts b/tests/src/eth/base.test.ts index af311a0772..c3c9a7fbcb 100644 --- a/tests/src/eth/base.test.ts +++ b/tests/src/eth/base.test.ts @@ -80,7 +80,23 @@ describe('ERC165 tests', async () => { await usingEthPlaygrounds(async (helper, privateKey) => { const donor = privateKey('//Alice'); const [alice] = await helper.arrange.createAccounts([10n], donor); - ({collectionId: collection} = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test', properties: [{key: 'ERC721Metadata', value: '1'}]})); + ({collectionId: collection} = await helper.nft.mintCollection( + alice, + { + name: 'test', + description: 'test', + tokenPrefix: 'test', + properties: [{key: 'ERC721Metadata', value: '1'}], + tokenPropertyPermissions: [{ + key: 'URI', + permission: { + mutable: true, + collectionAdmin: true, + tokenOwner: false, + }, + }], + }, + )); minter = helper.eth.createAccount(); }); }); diff --git a/tests/src/eth/collectionProperties.test.ts b/tests/src/eth/collectionProperties.test.ts index 2cea68061a..840f7ed90e 100644 --- a/tests/src/eth/collectionProperties.test.ts +++ b/tests/src/eth/collectionProperties.test.ts @@ -67,7 +67,15 @@ describe('Supports ERC721Metadata', () => { itEth('ERC721Metadata property can be set for NFT collection', async({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); - const collection = await helper.nft.mintCollection(donor, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const tokenPropertyPermissions = [{ + key: 'URI', + permission: { + mutable: true, + collectionAdmin: true, + tokenOwner: false, + }, + }]; + const collection = await helper.nft.mintCollection(donor, {name: 'col', description: 'descr', tokenPrefix: 'COL', tokenPropertyPermissions}); await collection.addAdmin(donor, {Ethereum: caller}); const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller); @@ -83,7 +91,15 @@ describe('Supports ERC721Metadata', () => { itEth.ifWithPallets('ERC721Metadata property can be set for RFT collection', [Pallets.ReFungible], async({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); - const collection = await helper.rft.mintCollection(donor, {name: 'col', description: 'descr', tokenPrefix: 'COL'}); + const tokenPropertyPermissions = [{ + key: 'URI', + permission: { + mutable: true, + collectionAdmin: true, + tokenOwner: false, + }, + }]; + const collection = await helper.rft.mintCollection(donor, {name: 'col', description: 'descr', tokenPrefix: 'COL', tokenPropertyPermissions}); await collection.addAdmin(donor, {Ethereum: caller}); diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index ef7a9a01bc..3ea2d0b667 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -501,7 +501,23 @@ describe('Common metadata', () => { itEth('Returns collection name', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); - const collection = await helper.nft.mintCollection(alice, {name: 'oh River', tokenPrefix: 'CHANGE', properties: [{key: 'ERC721Metadata', value: '1'}]}); + const tokenPropertyPermissions = [{ + key: 'URI', + permission: { + mutable: true, + collectionAdmin: true, + tokenOwner: false, + }, + }]; + const collection = await helper.nft.mintCollection( + alice, + { + name: 'oh River', + tokenPrefix: 'CHANGE', + properties: [{key: 'ERC721Metadata', value: '1'}], + tokenPropertyPermissions, + }, + ); const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller); const name = await contract.methods.name().call(); @@ -510,7 +526,23 @@ describe('Common metadata', () => { itEth('Returns symbol name', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); - const collection = await helper.nft.mintCollection(alice, {name: 'oh River', tokenPrefix: 'CHANGE', properties: [{key: 'ERC721Metadata', value: '1'}]}); + const tokenPropertyPermissions = [{ + key: 'URI', + permission: { + mutable: true, + collectionAdmin: true, + tokenOwner: false, + }, + }]; + const collection = await helper.nft.mintCollection( + alice, + { + name: 'oh River', + tokenPrefix: 'CHANGE', + properties: [{key: 'ERC721Metadata', value: '1'}], + tokenPropertyPermissions, + }, + ); const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller); const symbol = await contract.methods.symbol().call(); diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 76b875278b..cb5b4bb9b6 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -377,7 +377,23 @@ describe('Common metadata', () => { itEth('Returns collection name', async ({helper}) => { const caller = helper.eth.createAccount(); - const collection = await helper.rft.mintCollection(alice, {name: 'Leviathan', tokenPrefix: '11', properties: [{key: 'ERC721Metadata', value: '1'}]}); + const tokenPropertyPermissions = [{ + key: 'URI', + permission: { + mutable: true, + collectionAdmin: true, + tokenOwner: false, + }, + }]; + const collection = await helper.rft.mintCollection( + alice, + { + name: 'Leviathan', + tokenPrefix: '11', + properties: [{key: 'ERC721Metadata', value: '1'}], + tokenPropertyPermissions, + }, + ); const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'rft', caller); const name = await contract.methods.name().call(); @@ -386,7 +402,24 @@ describe('Common metadata', () => { itEth('Returns symbol name', async ({helper}) => { const caller = await helper.eth.createAccountWithBalance(donor); - const {collectionId} = await helper.rft.mintCollection(alice, {name: 'Leviathan', tokenPrefix: '12', properties: [{key: 'ERC721Metadata', value: '1'}]}); + const tokenPropertyPermissions = [{ + key: 'URI', + permission: { + mutable: true, + collectionAdmin: true, + tokenOwner: false, + }, + }]; + const {collectionId} = await helper.rft.mintCollection( + alice, + { + name: 'Leviathan', + tokenPrefix: '12', + properties: [{key: 'ERC721Metadata', value: '1'}], + tokenPropertyPermissions, + }, + ); + const contract = helper.ethNativeContract.collectionById(collectionId, 'rft', caller); const symbol = await contract.methods.symbol().call(); expect(symbol).to.equal('12'); diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index 16b89d0cec..a7e4aa5b22 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -213,7 +213,7 @@ class EthGroup extends EthGroupBase { async createERC721MetadataCompatibleRFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string}> { const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice(); const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); - + const result = await collectionHelper.methods.createERC721MetadataCompatibleRFTCollection(name, description, tokenPrefix, baseUri).send({value: Number(collectionCreationPrice)}); const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); From 85e2544b8d1969fb6fed16cfd3d8c3d556d0f420 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Thu, 13 Oct 2022 14:09:56 +0000 Subject: [PATCH 1120/1274] Fix app-promotion tests for a sequential launch --- tests/src/app-promotion.seqtest.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/src/app-promotion.seqtest.ts b/tests/src/app-promotion.seqtest.ts index c2818cb451..ebd727df69 100644 --- a/tests/src/app-promotion.seqtest.ts +++ b/tests/src/app-promotion.seqtest.ts @@ -34,6 +34,13 @@ describe('App promotion', () => { }); }); + after(async () => { + await usingPlaygrounds(async (helper) => { + const api = helper.getApi(); + await helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); + }); + }); + describe('admin adress', () => { itSub('can be set by sudo only', async ({helper}) => { const api = helper.getApi(); From 7c2f408f0bda50eec61954f0712ae9d4ea96940a Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Thu, 13 Oct 2022 15:07:53 +0000 Subject: [PATCH 1121/1274] tests(parallelization): fix createAccounts failing to catch up on dev node + evm events --- tests/src/eth/contractSponsoring.test.ts | 19 ++++++++++--------- tests/src/eth/fungible.test.ts | 12 +++++++++--- tests/src/eth/nonFungible.test.ts | 16 +++++++++++----- tests/src/eth/reFungible.test.ts | 8 ++++++-- tests/src/eth/reFungibleToken.test.ts | 9 +++++++-- tests/src/util/playgrounds/unique.dev.ts | 5 +++-- 6 files changed, 46 insertions(+), 23 deletions(-) diff --git a/tests/src/eth/contractSponsoring.test.ts b/tests/src/eth/contractSponsoring.test.ts index ea89cea2a1..597bf27e13 100644 --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -378,7 +378,7 @@ describe('Sponsoring EVM contracts', () => { // Balance should be taken from flipper instead of caller // FIXME the comment is wrong! What check should be here? const balanceAfter = await helper.balance.getEthereum(flipper.options.address); - expect(balanceAfter).to.be.equals(originalFlipperBalance); + expect(balanceAfter).to.be.equal(originalFlipperBalance); }); itEth('Sponsoring is set, an address that has UNQ can send a transaction and it works. User balance should not change', async ({helper}) => { @@ -406,7 +406,7 @@ describe('Sponsoring EVM contracts', () => { const sponsorBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(sponsor)); const callerBalanceAfter = await helper.balance.getSubstrate(await helper.address.ethToSubstrate(caller)); expect(sponsorBalanceAfter < sponsorBalanceBefore).to.be.true; - expect(callerBalanceAfter).to.be.equals(callerBalanceBefore); + expect(callerBalanceAfter).to.be.equal(callerBalanceBefore); }); itEth('Sponsoring is limited, with setContractRateLimit. The limitation is working if transactions are sent more often, the sender pays the commission.', async ({helper}) => { @@ -431,23 +431,24 @@ describe('Sponsoring EVM contracts', () => { await flipper.methods.flip().send({from: caller}); expect(await flipper.methods.getValue().call()).to.be.true; - expect(await helper.balance.getEthereum(caller)).to.be.equals(originalCallerBalance); + expect(await helper.balance.getEthereum(caller)).to.be.equal(originalCallerBalance); const newFlipperBalance = await helper.balance.getEthereum(sponsor); - expect(newFlipperBalance).to.be.not.equals(originalFlipperBalance); + expect(newFlipperBalance).to.be.not.equal(originalFlipperBalance); await flipper.methods.flip().send({from: caller}); + // todo:playgrounds fails rarely (expected 99893341659775672580n to equal 99912598679356033129n) (again, 99893341659775672580n) expect(await helper.balance.getEthereum(sponsor)).to.be.equal(newFlipperBalance); - expect(await helper.balance.getEthereum(caller)).to.be.not.equals(originalCallerBalance); + expect(await helper.balance.getEthereum(caller)).to.be.not.equal(originalCallerBalance); }); // TODO: Find a way to calculate default rate limit - itEth('Default rate limit equals 7200', async ({helper}) => { + itEth('Default rate limit equal 7200', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); - expect(await helpers.methods.sponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200'); + expect(await helpers.methods.sponsoringRateLimit(flipper.options.address).call()).to.be.equal('7200'); }); }); @@ -501,7 +502,7 @@ describe('Sponsoring Fee Limit', () => { const helpers = helper.ethNativeContract.contractHelpers(owner); const flipper = await helper.eth.deployFlipper(owner); - expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935'); + expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equal('115792089237316195423570985008687907853269984665640564039457584007913129639935'); }); itEth('Set fee limit', async ({helper}) => { @@ -510,7 +511,7 @@ describe('Sponsoring Fee Limit', () => { const flipper = await helper.eth.deployFlipper(owner); await helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send(); - expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100'); + expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equal('100'); }); itEth('Negative test - set fee limit by non-owner', async ({helper}) => { diff --git a/tests/src/eth/fungible.test.ts b/tests/src/eth/fungible.test.ts index 0625f2dc26..ce67e3bf03 100644 --- a/tests/src/eth/fungible.test.ts +++ b/tests/src/eth/fungible.test.ts @@ -294,9 +294,11 @@ describe('Fungible: Substrate calls', () => { contract.events.allEvents((_: any, event: any) => { events.push(event); }); + await collection.approveTokens(alice, {Ethereum: receiver}, 100n); - + if (events.length == 0) await helper.wait.newBlocks(1); const event = events[0]; + expect(event.event).to.be.equal('Approval'); expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.owner).to.be.equal(helper.address.substrateToEth(alice.address)); @@ -318,9 +320,11 @@ describe('Fungible: Substrate calls', () => { contract.events.allEvents((_: any, event: any) => { events.push(event); }); - await collection.transferFrom(bob, {Substrate: alice.address}, {Ethereum: receiver}, 51n); + await collection.transferFrom(bob, {Substrate: alice.address}, {Ethereum: receiver}, 51n); + if (events.length == 0) await helper.wait.newBlocks(1); let event = events[0]; + expect(event.event).to.be.equal('Transfer'); expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.from).to.be.equal(helper.address.substrateToEth(alice.address)); @@ -347,9 +351,11 @@ describe('Fungible: Substrate calls', () => { contract.events.allEvents((_: any, event: any) => { events.push(event); }); + await collection.transfer(alice, {Ethereum:receiver}, 51n); - + if (events.length == 0) await helper.wait.newBlocks(1); const event = events[0]; + expect(event.event).to.be.equal('Transfer'); expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.from).to.be.equal(helper.address.substrateToEth(alice.address)); diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 23e86e07f2..01b01b9153 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -385,9 +385,11 @@ describe('NFT: Substrate calls', () => { contract.events.allEvents((_: any, event: any) => { events.push(event); }); - const {tokenId} = await collection.mintToken(alice); + const {tokenId} = await collection.mintToken(alice); + if (events.length == 0) await helper.wait.newBlocks(1); const event = events[0]; + expect(event.event).to.be.equal('Transfer'); expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000'); @@ -408,8 +410,9 @@ describe('NFT: Substrate calls', () => { }); await token.burn(alice); - + if (events.length == 0) await helper.wait.newBlocks(1); const event = events[0]; + expect(event.event).to.be.equal('Transfer'); expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.from).to.be.equal(helper.address.substrateToEth(alice.address)); @@ -432,8 +435,9 @@ describe('NFT: Substrate calls', () => { }); await token.approve(alice, {Ethereum: receiver}); - + if (events.length == 0) await helper.wait.newBlocks(1); const event = events[0]; + expect(event.event).to.be.equal('Approval'); expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.owner).to.be.equal(helper.address.substrateToEth(alice.address)); @@ -458,8 +462,9 @@ describe('NFT: Substrate calls', () => { }); await token.transferFrom(bob, {Substrate: alice.address}, {Ethereum: receiver}); - + if (events.length == 0) await helper.wait.newBlocks(1); const event = events[0]; + expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.from).to.be.equal(helper.address.substrateToEth(alice.address)); expect(event.returnValues.to).to.be.equal(receiver); @@ -481,8 +486,9 @@ describe('NFT: Substrate calls', () => { }); await token.transfer(alice, {Ethereum: receiver}); - + if (events.length == 0) await helper.wait.newBlocks(1); const event = events[0]; + expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.from).to.be.equal(helper.address.substrateToEth(alice.address)); expect(event.returnValues.to).to.be.equal(receiver); diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 1598747882..067ef0a77e 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -286,9 +286,11 @@ describe('Refungible: Plain calls', () => { contract.events.allEvents((_: any, event: any) => { events.push(event); }); - await tokenContract.methods.transfer(receiver, 1).send(); + await tokenContract.methods.transfer(receiver, 1).send(); + if (events.length == 0) await helper.wait.newBlocks(1); const event = events[0]; + expect(event.address).to.equal(collectionAddress); expect(event.returnValues.from).to.equal('0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF'); expect(event.returnValues.to).to.equal(receiver); @@ -312,9 +314,11 @@ describe('Refungible: Plain calls', () => { contract.events.allEvents((_: any, event: any) => { events.push(event); }); - await tokenContract.methods.transfer(receiver, 1).send(); + await tokenContract.methods.transfer(receiver, 1).send(); + if (events.length == 0) await helper.wait.newBlocks(1); const event = events[0]; + expect(event.address).to.equal(collectionAddress); expect(event.returnValues.from).to.equal(caller); expect(event.returnValues.to).to.equal('0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF'); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 194564091d..bec9cdc76c 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -311,6 +311,7 @@ describe('Refungible: Plain calls', () => { }); await tokenContract.methods.burnFrom(caller, 1).send(); + if (events.length == 0) await helper.wait.newBlocks(1); const event = events[0]; expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.from).to.be.equal('0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF'); @@ -399,9 +400,11 @@ describe('Refungible: Substrate calls', () => { contract.events.allEvents((_: any, event: any) => { events.push(event); }); - expect(await token.approve(alice, {Ethereum: receiver}, 100n)).to.be.true; + expect(await token.approve(alice, {Ethereum: receiver}, 100n)).to.be.true; + if (events.length == 0) await helper.wait.newBlocks(1); const event = events[0]; + expect(event.event).to.be.equal('Approval'); expect(event.address).to.be.equal(tokenAddress); expect(event.returnValues.owner).to.be.equal(helper.address.substrateToEth(alice.address)); @@ -425,6 +428,7 @@ describe('Refungible: Substrate calls', () => { }); expect(await token.transferFrom(bob, {Substrate: alice.address}, {Ethereum: receiver}, 51n)).to.be.true; + if (events.length == 0) await helper.wait.newBlocks(1); let event = events[0]; expect(event.event).to.be.equal('Transfer'); @@ -455,8 +459,9 @@ describe('Refungible: Substrate calls', () => { }); expect(await token.transfer(alice, {Ethereum: receiver}, 51n)).to.be.true; - + if (events.length == 0) await helper.wait.newBlocks(1); const event = events[0]; + expect(event.event).to.be.equal('Transfer'); expect(event.address).to.be.equal(tokenAddress); expect(event.returnValues.from).to.be.equal(helper.address.substrateToEth(alice.address)); diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index e1b9db3911..cf9b4da3a0 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -156,8 +156,9 @@ class ArrangeGroup { }; let accountsCreated = false; - // checkBalances retry up to 5 blocks - for (let index = 0; index < 5; index++) { + const maxBlocksChecked = await this.helper.arrange.isDevNode() ? 50 : 5; + // checkBalances retry up to 5-50 blocks + for (let index = 0; index < maxBlocksChecked; index++) { accountsCreated = await checkBalances(); if(accountsCreated) break; await wait.newBlocks(1); From 02e004a3917bd3ada0381ae5d44c1d475738742a Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Thu, 13 Oct 2022 15:10:17 +0000 Subject: [PATCH 1122/1274] tests(util): fix mocha setup breaking context in case of dynamically skipped tests --- tests/package.json | 25 +++++++++++++------------ tests/src/util/globalSetup.ts | 12 +++++++----- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/tests/package.json b/tests/package.json index ff1780ea37..51b9815e7a 100644 --- a/tests/package.json +++ b/tests/package.json @@ -21,23 +21,24 @@ }, "mocha": { "timeout": 9999999, - "require": ["ts-node/register", "./src/util/globalSetup.ts"] + "require": ["ts-node/register"] }, "scripts": { "lint": "eslint --ext .ts,.js src/", "fix": "eslint --ext .ts,.js src/ --fix", + "setup": "ts-node ./src/util/globalSetup.ts", - "test": "mocha --timeout 9999999 -r ts-node/register './src/**/*.*test.ts'", + "test": "yarn setup && mocha --timeout 9999999 -r ts-node/register './src/**/*.*test.ts'", "testParallelFull": "yarn testParallel && yarn testSequential", - "testParallel": "mocha --parallel --timeout 9999999 -r ts-node/register './src/**/*.test.ts'", - "testSequential": "mocha --timeout 9999999 -r ts-node/register './src/**/*.seqtest.ts'", - "testStructure": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/*.*test.ts", - "testEth": "mocha --timeout 9999999 -r ts-node/register './**/eth/**/*.*test.ts'", - "testEthNesting": "mocha --timeout 9999999 -r ts-node/register './**/eth/nesting/**/*.*test.ts'", - "testEthFractionalizer": "mocha --timeout 9999999 -r ts-node/register './**/eth/fractionalizer/**/*.*test.ts'", - "testEthMarketplace": "mocha --timeout 9999999 -r ts-node/register './**/eth/marketplace/**/*.*test.ts'", - "testEvent": "mocha --timeout 9999999 -r ts-node/register ./src/check-event/*.*test.ts", - "testRmrk": "mocha --timeout 9999999 -r ts-node/register ./**/rmrk/*.*test.ts", + "testParallel": "yarn setup && mocha --parallel --timeout 9999999 -r ts-node/register './src/**/*.test.ts'", + "testSequential": "yarn setup && mocha --timeout 9999999 -r ts-node/register './src/**/*.seqtest.ts'", + "testStructure": "yarn setup && mocha --timeout 9999999 -r ts-node/register ./**/nesting/*.*test.ts", + "testEth": "yarn setup && mocha --timeout 9999999 -r ts-node/register './**/eth/**/*.*test.ts'", + "testEthNesting": "yarn setup && mocha --timeout 9999999 -r ts-node/register './**/eth/nesting/**/*.*test.ts'", + "testEthFractionalizer": "yarn setup && mocha --timeout 9999999 -r ts-node/register './**/eth/fractionalizer/**/*.*test.ts'", + "testEthMarketplace": "yarn setup && mocha --timeout 9999999 -r ts-node/register './**/eth/marketplace/**/*.*test.ts'", + "testEvent": "yarn setup && mocha --timeout 9999999 -r ts-node/register ./src/check-event/*.*test.ts", + "testRmrk": "yarn setup && mocha --timeout 9999999 -r ts-node/register ./**/rmrk/*.*test.ts", "testEthPayable": "mocha --timeout 9999999 -r ts-node/register './**/eth/payable.test.ts'", "testEthTokenProperties": "mocha --timeout 9999999 -r ts-node/register ./**/eth/tokenProperties.test.ts", @@ -92,7 +93,7 @@ "testFT": "mocha --timeout 9999999 -r ts-node/register ./**/fungible.test.ts", "testEthFT": "mocha --timeout 9999999 -r ts-node/register ./**/eth/fungible.test.ts", "testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts", - "testPromotion": "mocha --timeout 9999999 -r ts-node/register ./**/app-promotion.test.ts", + "testPromotion": "yarn setup && mocha --timeout 9999999 -r ts-node/register ./**/app-promotion.test.ts", "testXcmUnique": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmUnique.test.ts", "testXcmQuartz": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmQuartz.test.ts", diff --git a/tests/src/util/globalSetup.ts b/tests/src/util/globalSetup.ts index fa04fc4859..c6e16da4b3 100644 --- a/tests/src/util/globalSetup.ts +++ b/tests/src/util/globalSetup.ts @@ -5,14 +5,14 @@ import {usingPlaygrounds, Pallets} from './index'; import * as path from 'path'; import {promises as fs} from 'fs'; -// This file is used in the mocha package.json section -export async function mochaGlobalSetup() { +// This function should be called before running test suites. +const globalSetup = async (): Promise => { await usingPlaygrounds(async (helper, privateKey) => { try { // 1. Create donors for test files await fundFilenamesWithRetries(3) .then((result) => { - if (!result) process.exit(1); + if (!result) Promise.reject(); }); // 2. Set up App Promotion admin @@ -29,10 +29,10 @@ export async function mochaGlobalSetup() { } } catch (error) { console.error(error); - process.exit(1); + Promise.reject(); } }); -} +}; async function getFiles(rootPath: string): Promise { const files = await fs.readdir(rootPath, {withFileTypes: true}); @@ -100,3 +100,5 @@ const fundFilenamesWithRetries = async (retriesLeft: number): Promise = return fundFilenamesWithRetries(--retriesLeft); }); }; + +globalSetup().catch(() => process.exit(1)); From 23067ec51dc97e9ebc53c64e93504b92ebd227ce Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Thu, 13 Oct 2022 15:28:00 +0000 Subject: [PATCH 1123/1274] tests: adjust minimum donor fund structure + fix app-promotion.seqtest's 'after' if the pallet is not present --- tests/src/app-promotion.seqtest.ts | 3 ++- tests/src/util/globalSetup.ts | 6 +++--- tests/src/util/index.ts | 5 ++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/src/app-promotion.seqtest.ts b/tests/src/app-promotion.seqtest.ts index ebd727df69..7bf1cb9350 100644 --- a/tests/src/app-promotion.seqtest.ts +++ b/tests/src/app-promotion.seqtest.ts @@ -34,8 +34,9 @@ describe('App promotion', () => { }); }); - after(async () => { + after(async function () { await usingPlaygrounds(async (helper) => { + if (helper.fetchMissingPalletNames([Pallets.AppPromotion]).length != 0) return; const api = helper.getApi(); await helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}))); }); diff --git a/tests/src/util/globalSetup.ts b/tests/src/util/globalSetup.ts index c6e16da4b3..9a83082baa 100644 --- a/tests/src/util/globalSetup.ts +++ b/tests/src/util/globalSetup.ts @@ -1,7 +1,7 @@ // Copyright 2019-2022 Unique Network (Gibraltar) Ltd. // SPDX-License-Identifier: Apache-2.0 -import {usingPlaygrounds, Pallets} from './index'; +import {usingPlaygrounds, Pallets, DONOR_FUNDING, MINIMUM_DONOR_FUND} from './index'; import * as path from 'path'; import {promises as fs} from 'fs'; @@ -67,11 +67,11 @@ const fundFilenames = async () => { const account = await privateKey({filename: f, ignoreFundsPresence: true}); const aliceBalance = await helper.balance.getSubstrate(account.address); - if (aliceBalance < 100_000n * oneToken) { + if (aliceBalance < MINIMUM_DONOR_FUND * oneToken) { tx.push(helper.executeExtrinsic( alice, 'api.tx.balances.transfer', - [account.address, 1_000_000n * oneToken], + [account.address, DONOR_FUNDING * oneToken], true, {nonce: nonce + balanceGrantedCounter++}, ).then(() => true).catch(() => {console.error(`Transaction to ${path.basename(f)} registered as failed. Strange.`); return false;})); diff --git a/tests/src/util/index.ts b/tests/src/util/index.ts index a57d0f7b45..000532f35f 100644 --- a/tests/src/util/index.ts +++ b/tests/src/util/index.ts @@ -38,7 +38,7 @@ export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKe else { const actualSeed = getTestSeed(seed.filename); let account = helper.util.fromSeed(actualSeed, ss58Format); - if (!seed.ignoreFundsPresence && await helper.balance.getSubstrate(account.address) == 0n) { + if (!seed.ignoreFundsPresence && await helper.balance.getSubstrate(account.address) < MINIMUM_DONOR_FUND) { console.warn(`${path.basename(seed.filename)}: Not enough funds present on the filename account. Using the default one as the donor instead.`); account = helper.util.fromSeed('//Alice', ss58Format); } @@ -53,6 +53,9 @@ export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKe } }; +export const MINIMUM_DONOR_FUND = 100_000n; +export const DONOR_FUNDING = 1_000_000n; + export enum Pallets { Inflation = 'inflation', RmrkCore = 'rmrkcore', From 9695a43c6e69a7dadedff448da33fd7afe6e2565 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 13 Oct 2022 13:47:46 +0000 Subject: [PATCH 1124/1274] feat(evm-coder): hidden methods Hidden methods appear in selector, and callable from outside, but do not appear in newly generated interfaces/stubs/abi files. Signed-off-by: Yaroslav Bolyukin --- .maintain/scripts/generate_sol.sh | 2 + .../procedural/src/solidity_interface.rs | 44 ++++++++++++++----- crates/evm-coder/src/solidity.rs | 27 ++++++++---- 3 files changed, 54 insertions(+), 19 deletions(-) diff --git a/.maintain/scripts/generate_sol.sh b/.maintain/scripts/generate_sol.sh index c84086a04b..e9bb7b5675 100755 --- a/.maintain/scripts/generate_sol.sh +++ b/.maintain/scripts/generate_sol.sh @@ -11,4 +11,6 @@ sed -n '/=== SNIP START ===/, /=== SNIP END ===/{ /=== SNIP START ===/! { /=== S formatted=$(mktemp) prettier --config $PRETTIER_CONFIG $raw > $formatted +sed -i -E -e "s/.+\/\/ FORMATTING: FORCE NEWLINE//g" $formatted + mv $formatted $OUTPUT diff --git a/crates/evm-coder/procedural/src/solidity_interface.rs b/crates/evm-coder/procedural/src/solidity_interface.rs index feb32c506a..3bac1ae410 100644 --- a/crates/evm-coder/procedural/src/solidity_interface.rs +++ b/crates/evm-coder/procedural/src/solidity_interface.rs @@ -291,22 +291,40 @@ impl Parse for InterfaceInfo { struct MethodInfo { rename_selector: Option, + hide: bool, } impl Parse for MethodInfo { fn parse(input: ParseStream) -> syn::Result { let mut rename_selector = None; - let lookahead = input.lookahead1(); - if lookahead.peek(kw::rename_selector) { - let k = input.parse::()?; - input.parse::()?; - if rename_selector - .replace(input.parse::()?.value()) - .is_some() - { - return Err(syn::Error::new(k.span(), "rename_selector is already set")); + let mut hide = false; + while !input.is_empty() { + let lookahead = input.lookahead1(); + if lookahead.peek(kw::rename_selector) { + let k = input.parse::()?; + input.parse::()?; + if rename_selector + .replace(input.parse::()?.value()) + .is_some() + { + return Err(syn::Error::new(k.span(), "rename_selector is already set")); + } + } else if lookahead.peek(kw::hide) { + input.parse::()?; + hide = true; + } else { + return Err(lookahead.error()); + } + + if input.peek(Token![,]) { + input.parse::()?; + } else if !input.is_empty() { + return Err(syn::Error::new(input.span(), "expected end")); } } - Ok(Self { rename_selector }) + Ok(Self { + rename_selector, + hide, + }) } } @@ -548,6 +566,7 @@ mod kw { syn::custom_keyword!(expect_selector); syn::custom_keyword!(rename_selector); + syn::custom_keyword!(hide); } /// Rust methods are parsed into this structure when Solidity code is generated @@ -558,6 +577,7 @@ struct Method { screaming_name: Ident, selector_str: String, selector: u32, + hide: bool, args: Vec, has_normal_args: bool, has_value_args: bool, @@ -570,6 +590,7 @@ impl Method { fn try_from(value: &ImplItemMethod) -> syn::Result { let mut info = MethodInfo { rename_selector: None, + hide: false, }; let mut docs = Vec::new(); let mut weight = None; @@ -667,6 +688,7 @@ impl Method { screaming_name: snake_ident_to_screaming(ident), selector_str, selector, + hide: info.hide, args, has_normal_args, has_value_args, @@ -826,12 +848,14 @@ impl Method { let docs = &self.docs; let selector_str = &self.selector_str; let selector = self.selector; + let hide = self.hide; let is_payable = self.has_value_args; quote! { SolidityFunction { docs: &[#(#docs),*], selector_str: #selector_str, selector: #selector, + hide: #hide, name: #camel_name, mutability: #mutability, is_payable: #is_payable, diff --git a/crates/evm-coder/src/solidity.rs b/crates/evm-coder/src/solidity.rs index bad3ff1520..5a74323334 100644 --- a/crates/evm-coder/src/solidity.rs +++ b/crates/evm-coder/src/solidity.rs @@ -418,6 +418,7 @@ pub struct SolidityFunction { pub docs: &'static [&'static str], pub selector_str: &'static str, pub selector: u32, + pub hide: bool, pub name: &'static str, pub args: A, pub result: R, @@ -431,16 +432,21 @@ impl SolidityFunctions for SolidityF writer: &mut impl fmt::Write, tc: &TypeCollector, ) -> fmt::Result { + let hide_comment = self.hide.then(|| "// ").unwrap_or(""); for doc in self.docs { - writeln!(writer, "\t///{}", doc)?; + writeln!(writer, "\t{hide_comment}///{}", doc)?; } writeln!( writer, - "\t/// @dev EVM selector for this function is: 0x{:0>8x},", + "\t{hide_comment}/// @dev EVM selector for this function is: 0x{:0>8x},", self.selector )?; - writeln!(writer, "\t/// or in textual repr: {}", self.selector_str)?; - write!(writer, "\tfunction {}(", self.name)?; + writeln!( + writer, + "\t{hide_comment}/// or in textual repr: {}", + self.selector_str + )?; + write!(writer, "\t{hide_comment}function {}(", self.name)?; self.args.solidity_name(writer, tc)?; write!(writer, ")")?; if is_impl { @@ -463,22 +469,25 @@ impl SolidityFunctions for SolidityF } if is_impl { writeln!(writer, " {{")?; - writeln!(writer, "\t\trequire(false, stub_error);")?; + writeln!(writer, "\t{hide_comment}\trequire(false, stub_error);")?; self.args.solidity_get(writer)?; match &self.mutability { SolidityMutability::Pure => {} - SolidityMutability::View => writeln!(writer, "\t\tdummy;")?, - SolidityMutability::Mutable => writeln!(writer, "\t\tdummy = 0;")?, + SolidityMutability::View => writeln!(writer, "\t{hide_comment}\tdummy;")?, + SolidityMutability::Mutable => writeln!(writer, "\t{hide_comment}\tdummy = 0;")?, } if !self.result.is_empty() { - write!(writer, "\t\treturn ")?; + write!(writer, "\t{hide_comment}\treturn ")?; self.result.solidity_default(writer, tc)?; writeln!(writer, ";")?; } - writeln!(writer, "\t}}")?; + writeln!(writer, "\t{hide_comment}}}")?; } else { writeln!(writer, ";")?; } + if self.hide { + writeln!(writer, "// FORMATTING: FORCE NEWLINE")?; + } Ok(()) } } From d4f43b6a7259bbca60be1fc9815b238df041cb6f Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 13 Oct 2022 15:40:37 +0000 Subject: [PATCH 1125/1274] test(nft): check for name/symbol availability Signed-off-by: Yaroslav Bolyukin --- tests/src/eth/nonFungible.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 3ea2d0b667..3d378443e4 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -68,6 +68,16 @@ describe('NFT: Information getting', () => { expect(owner).to.equal(caller); }); + + itEth('name/symbol is available regardless of ERC721Metadata support', async ({helper}) => { + const collection = await helper.nft.mintCollection(alice, {name: 'test', tokenPrefix: 'TEST'}); + const caller = helper.eth.createAccount(); + + const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller); + + expect(await contract.methods.name().call()).to.equal('test'); + expect(await contract.methods.symbol().call()).to.equal('TEST'); + }); }); describe('Check ERC721 token URI for NFT', () => { From f8b7b18b80b539655679cf843bd1a1199e207aba Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 13 Oct 2022 15:46:03 +0000 Subject: [PATCH 1126/1274] refactor: move erc721metadata to flags Signed-off-by: Yaroslav Bolyukin --- pallets/common/src/erc.rs | 8 ----- pallets/common/src/lib.rs | 7 ++++- pallets/nonfungible/src/erc.rs | 18 +----------- pallets/refungible/src/erc.rs | 18 +----------- pallets/unique/src/eth/mod.rs | 47 +++++++++++++++--------------- primitives/data-structs/src/lib.rs | 18 ++++++++++-- 6 files changed, 46 insertions(+), 70 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index a168abb1b2..ca43160581 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -706,9 +706,6 @@ pub mod static_property { /// Value "ERC721Metadata". pub const ERC721_METADATA: &[u8] = b"ERC721Metadata"; - /// Value "1" ERC721 metadata supported. - pub const ERC721_METADATA_SUPPORTED: &[u8] = b"1"; - /// Value for [`ERC721_METADATA`]. pub fn erc721() -> up_data_structs::PropertyValue { property_value_from_bytes(ERC721_METADATA).expect(EXPECT_CONVERT_ERROR) @@ -718,11 +715,6 @@ pub mod static_property { pub fn schema_version() -> up_data_structs::PropertyValue { property_value_from_bytes(SCHEMA_VERSION).expect(EXPECT_CONVERT_ERROR) } - - /// Value for [`ERC721_METADATA_SUPPORTED`]. - pub fn erc721_metadata_supported() -> up_data_structs::PropertyValue { - property_value_from_bytes(ERC721_METADATA_SUPPORTED).expect(EXPECT_CONVERT_ERROR) - } } /// Convert `byte` to [`PropertyKey`]. diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 00f5d0ef61..90586777de 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -71,6 +71,7 @@ use up_data_structs::{ Collection, RpcCollection, CollectionFlags, + RpcCollectionFlags, CollectionId, CreateItemData, MAX_TOKEN_PREFIX_LENGTH, @@ -824,7 +825,11 @@ impl Pallet { token_property_permissions, properties, read_only: flags.external, - foreign: flags.foreign, + + flags: RpcCollectionFlags { + foreign: flags.foreign, + erc721metadata: flags.erc721metadata, + }, }) } } diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 8cb999dc0d..72bcb7a6b8 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -708,22 +708,6 @@ impl NonfungibleHandle { } } -impl NonfungibleHandle { - pub fn supports_metadata(&self) -> bool { - let has_metadata_support_enabled = if let Some(erc721_metadata) = - pallet_common::Pallet::::get_collection_property(self.id, &key::erc721_metadata()) - { - *erc721_metadata.into_inner() == *value::ERC721_METADATA_SUPPORTED - } else { - false - }; - - let has_url_property_permissions = get_token_permission::(self.id, &key::url()).is_ok(); - - has_metadata_support_enabled && has_url_property_permissions - } -} - #[solidity_interface( name = UniqueNFT, is( @@ -732,9 +716,9 @@ impl NonfungibleHandle { ERC721UniqueExtensions, ERC721Mintable, ERC721Burnable, + ERC721Metadata(if(this.flags.erc721metadata)), Collection(via(common_mut returns CollectionHandle)), TokenProperties, - ERC721Metadata(if(this.supports_metadata())), ) )] impl NonfungibleHandle where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {} diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 850a475b30..692b2d959a 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -764,22 +764,6 @@ impl RefungibleHandle { } } -impl RefungibleHandle { - pub fn supports_metadata(&self) -> bool { - let has_metadata_support_enabled = if let Some(erc721_metadata) = - pallet_common::Pallet::::get_collection_property(self.id, &key::erc721_metadata()) - { - *erc721_metadata.into_inner() == *value::ERC721_METADATA_SUPPORTED - } else { - false - }; - - let has_url_property_permissions = get_token_permission::(self.id, &key::url()).is_ok(); - - has_metadata_support_enabled && has_url_property_permissions - } -} - #[solidity_interface( name = UniqueRefungible, is( @@ -788,9 +772,9 @@ impl RefungibleHandle { ERC721UniqueExtensions, ERC721Mintable, ERC721Burnable, + ERC721Metadata(if(this.flags.erc721metadata)), Collection(via(common_mut returns CollectionHandle)), TokenProperties, - ERC721Metadata(if(this.supports_metadata())), ) )] impl RefungibleHandle where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {} diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index dfa3e27d9a..05c1843b40 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -89,6 +89,26 @@ fn convert_data( Ok((caller, name, description, token_prefix, base_uri_value)) } +fn default_url_pkp() -> up_data_structs::PropertyKeyPermission { + up_data_structs::PropertyKeyPermission { + key: key::url(), + permission: up_data_structs::PropertyPermission { + mutable: true, + collection_admin: true, + token_owner: false, + }, + } +} +fn default_suffix_pkp() -> up_data_structs::PropertyKeyPermission { + up_data_structs::PropertyKeyPermission { + key: key::suffix(), + permission: up_data_structs::PropertyPermission { + mutable: true, + collection_admin: true, + token_owner: false, + }, + } +} fn make_data( name: CollectionName, mode: CollectionMode, @@ -98,26 +118,9 @@ fn make_data( add_properties: bool, ) -> Result> { let token_property_permissions = if add_properties { - vec![ - up_data_structs::PropertyKeyPermission { - key: key::url(), - permission: up_data_structs::PropertyPermission { - mutable: true, - collection_admin: true, - token_owner: false, - }, - }, - up_data_structs::PropertyKeyPermission { - key: key::suffix(), - permission: up_data_structs::PropertyPermission { - mutable: true, - collection_admin: true, - token_owner: false, - }, - }, - ] - .try_into() - .map_err(|e| Error::Revert(format!("{:?}", e)))? + vec![default_url_pkp(), default_suffix_pkp()] + .try_into() + .map_err(|e| Error::Revert(format!("{:?}", e)))? } else { up_data_structs::CollectionPropertiesPermissionsVec::default() }; @@ -131,10 +134,6 @@ fn make_data( key: key::schema_version(), value: property_value::schema_version(), }, - up_data_structs::Property { - key: key::erc721_metadata(), - value: property_value::erc721_metadata_supported(), - }, ]; if !base_uri_value.is_empty() { properties.push(up_data_structs::Property { diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 4158279598..b99a6e9cde 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -365,11 +365,14 @@ pub struct CollectionFlags { /// Tokens in foreign collections can be transferred, but not burnt #[bondrewd(bits = "0..1")] pub foreign: bool, + /// Supports ERC721Metadata + #[bondrewd(bits = "1..2")] + pub erc721metadata: bool, /// External collections can't be managed using `unique` api #[bondrewd(bits = "7..8")] pub external: bool, - #[bondrewd(reserve, bits = "1..7")] + #[bondrewd(reserve, bits = "2..7")] pub reserved: u8, } bondrewd_codec!(CollectionFlags); @@ -434,6 +437,15 @@ pub struct Collection { pub meta_update_permission: MetaUpdatePermission, } +#[derive(Encode, Decode, Clone, PartialEq, TypeInfo)] +#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] +pub struct RpcCollectionFlags { + /// Is collection is foreign. + pub foreign: bool, + /// Collection supports ERC721Metadata. + pub erc721metadata: bool, +} + /// Collection parameters, used in RPC calls (see [`Collection`] for the storage version). #[derive(Encode, Decode, Clone, PartialEq, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] @@ -471,8 +483,8 @@ pub struct RpcCollection { /// Is collection read only. pub read_only: bool, - /// Is collection is foreign. - pub foreign: bool, + /// Extra collection flags + pub flags: RpcCollectionFlags, } /// Data used for create collection. From 8ad09da9d2af10b1eabb4443eb38f2349fe80e2d Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 13 Oct 2022 15:46:37 +0000 Subject: [PATCH 1127/1274] fix(nft): name/symbol should be always callable Signed-off-by: Yaroslav Bolyukin --- pallets/nonfungible/src/erc.rs | 26 ++++++--- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4374 -> 4381 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 56 +++++++++++++------- tests/src/eth/api/UniqueNFT.sol | 32 +++++++---- 4 files changed, 80 insertions(+), 34 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 72bcb7a6b8..37e95b8987 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -203,15 +203,17 @@ pub enum ERC721MintableEvents { #[solidity_interface(name = ERC721Metadata, expect_selector = 0x5b5e139f)] impl NonfungibleHandle { /// @notice A descriptive name for a collection of NFTs in this contract - fn name(&self) -> Result { - Ok(decode_utf16(self.name.iter().copied()) - .map(|r| r.unwrap_or(REPLACEMENT_CHARACTER)) - .collect::()) + /// @dev real implementation of this function lies in `ERC721UniqueExtensions` + #[solidity(hide, rename_selector = "name")] + fn name_proxy(&self) -> Result { + self.name() } /// @notice An abbreviated name for NFTs in this contract - fn symbol(&self) -> Result { - Ok(string::from_utf8_lossy(&self.token_prefix).into()) + /// @dev real implementation of this function lies in `ERC721UniqueExtensions` + #[solidity(hide, rename_selector = "symbol")] + fn symbol_proxy(&self) -> Result { + self.symbol() } /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. @@ -571,6 +573,18 @@ fn get_token_permission( /// @title Unique extensions for ERC721. #[solidity_interface(name = ERC721UniqueExtensions)] impl NonfungibleHandle { + /// @notice A descriptive name for a collection of NFTs in this contract + fn name(&self) -> Result { + Ok(decode_utf16(self.name.iter().copied()) + .map(|r| r.unwrap_or(REPLACEMENT_CHARACTER)) + .collect::()) + } + + /// @notice An abbreviated name for NFTs in this contract + fn symbol(&self) -> Result { + Ok(string::from_utf8_lossy(&self.token_prefix).into()) + } + /// @notice Transfer ownership of an NFT /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` /// is the zero address. Throws if `tokenId` is not a valid NFT. diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index c06d3f5a804375fbd9d3eb1998a13ca9dad47838..d09f6a07404d0f0010145161368cb59289e59c6a 100644 GIT binary patch delta 1703 zcmZuwZD?Cn7|!7?$<6(0(wf*TsrhK@$8@4dCWXQx!mP^h?ot!Sb#RUqw6aZEf62hy z?<{tsH#ucv!!eZY$FNFel+7t_KZGF&7JvCcRR*Fc6J%rJpy)aGqs z(AZwYOnWgHL5J~5e01WM{#fey2q3l zhFVVz1v;rx+X!?PWf`R&hGmDyRvT)Mph>Fip)Nts;G0~v_*$4bXL&9uPlsh25QHD) z?*V7A%;&gILfSR_20skeaEGrXIHrj>1~2o)-Id^++ZM{evSxz~mtHg6Q$9;?gRb0$ zB@+xHP7Pu;#2rN3tbtO$;k;049rNS14OCN4XAvK3YBig7%bll3`nu`>?HEH|33P@? z^hyv#+%=Rq*-(!dpr$Jw@@;!rKW?1gSeQ2*;9s{f4;0x_g5I*-`al#kVg-ojnTV}2&tG1ce86>@fC(@%+A2%V;??Td7O(fkR ze*eikIYY6sSr{)E;JEBZWAnNK%WfIQREKVdbgQXPTLw^E8@L^Sr0?h>|ICvyb^!m8zW-mClpq%X delta 1714 zcmaJ>TWB0r7~aEnFLTXo+6^(A?M^nmC={EQu}NQCE!1kE3`?A)jKVpMDAA&YR=gnW zTy}P|mE!Ckm1wBo1xqoNYAgxrLlJ~ZeGw(C_|nqSCrj0$pftpD=FF@+3hu&z@4tNK z`!8osmftMr;1yV@!fnv9?W%t$q5Sem?ri`jmlnZFa^PpfM9D8va`ryB0cFhorAC6RQoqFZXYa{#4(HB79-N)u=uoke`ZB6O5p#V7bO_yeEi^O_jualYH8fdQ1t*UXHwX_`y>l+;!3&C zqP+7>x7AZh@*<_&D)xo33GPk}ad%MKHB23*3Qz?;Ye~go9pOhpCVreMz*mLg?Gfa%&w9`S$HEX}h?H~IId%U&~^z&ep6 zBLwY@#JUn%5q}<~-!jZO2WWP+P0m)3b-CxiffvLAIF6Ua5-8$J;&}Z5b{P^Lq2o5p z4jH1=H$_SyJjsF@0G4df+=zr1n8DJJ;Dyo+le~DC>iC_416<&{Ht^?Mn*9L_?lwTz zbQ+`};j5afIaO-N_zmDA;WW0Sl6)i5ax3WD8L3#$g{JIk(+P({x3A)Qboa!G&@E26 z;THT?z4#~#>ZupQa)^5I*#E1qlRGd=kI6^kX|`Ofil7K_K3s!P+eMc5&zjLzidQ4W zH$CzagZI$YNzYxN&8(B3J!Ee}QierY_=22Qw=iJ$_LUMzyF(&rFJ6<2I}wBN+oW(# zNOJpcLsAz%Jg_A8xXMDiQBqKr$Q)*v8F zkT2Abd>bE8^4o6H&b~_4OZ8QlFq`yM$Tw^Dbi)Bv-vfRdAo&OUkurAAu3htwD{BwU stG@p2`!9X*{L{C-f2Z~NfphzhESye^>7Q8^BF2AOHXW diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index bbf2086f18..66352dba6b 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -21,23 +21,25 @@ contract ERC165 is Dummy { /// @dev See https://eips.ethereum.org/EIPS/eip-721 /// @dev the ERC-165 identifier for this interface is 0x5b5e139f contract ERC721Metadata is Dummy, ERC165 { - /// @notice A descriptive name for a collection of NFTs in this contract - /// @dev EVM selector for this function is: 0x06fdde03, - /// or in textual repr: name() - function name() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } - - /// @notice An abbreviated name for NFTs in this contract - /// @dev EVM selector for this function is: 0x95d89b41, - /// or in textual repr: symbol() - function symbol() public view returns (string memory) { - require(false, stub_error); - dummy; - return ""; - } + // /// @notice A descriptive name for a collection of NFTs in this contract + // /// @dev real implementation of this function lies in `ERC721UniqueExtensions` + // /// @dev EVM selector for this function is: 0x06fdde03, + // /// or in textual repr: name() + // function name() public view returns (string memory) { + // require(false, stub_error); + // dummy; + // return ""; + // } + + // /// @notice An abbreviated name for NFTs in this contract + // /// @dev real implementation of this function lies in `ERC721UniqueExtensions` + // /// @dev EVM selector for this function is: 0x95d89b41, + // /// or in textual repr: symbol() + // function symbol() public view returns (string memory) { + // require(false, stub_error); + // dummy; + // return ""; + // } /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. /// @@ -504,8 +506,26 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { } /// @title Unique extensions for ERC721. -/// @dev the ERC-165 identifier for this interface is 0xd74d154f +/// @dev the ERC-165 identifier for this interface is 0x4468500d contract ERC721UniqueExtensions is Dummy, ERC165 { + /// @notice A descriptive name for a collection of NFTs in this contract + /// @dev EVM selector for this function is: 0x06fdde03, + /// or in textual repr: name() + function name() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + + /// @notice An abbreviated name for NFTs in this contract + /// @dev EVM selector for this function is: 0x95d89b41, + /// or in textual repr: symbol() + function symbol() public view returns (string memory) { + require(false, stub_error); + dummy; + return ""; + } + /// @notice Transfer ownership of an NFT /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` /// is the zero address. Throws if `tokenId` is not a valid NFT. diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index c5770e8663..71b2a34057 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -16,15 +16,17 @@ interface ERC165 is Dummy { /// @dev See https://eips.ethereum.org/EIPS/eip-721 /// @dev the ERC-165 identifier for this interface is 0x5b5e139f interface ERC721Metadata is Dummy, ERC165 { - /// @notice A descriptive name for a collection of NFTs in this contract - /// @dev EVM selector for this function is: 0x06fdde03, - /// or in textual repr: name() - function name() external view returns (string memory); - - /// @notice An abbreviated name for NFTs in this contract - /// @dev EVM selector for this function is: 0x95d89b41, - /// or in textual repr: symbol() - function symbol() external view returns (string memory); + // /// @notice A descriptive name for a collection of NFTs in this contract + // /// @dev real implementation of this function lies in `ERC721UniqueExtensions` + // /// @dev EVM selector for this function is: 0x06fdde03, + // /// or in textual repr: name() + // function name() external view returns (string memory); + + // /// @notice An abbreviated name for NFTs in this contract + // /// @dev real implementation of this function lies in `ERC721UniqueExtensions` + // /// @dev EVM selector for this function is: 0x95d89b41, + // /// or in textual repr: symbol() + // function symbol() external view returns (string memory); /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. /// @@ -336,8 +338,18 @@ interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { } /// @title Unique extensions for ERC721. -/// @dev the ERC-165 identifier for this interface is 0xd74d154f +/// @dev the ERC-165 identifier for this interface is 0x4468500d interface ERC721UniqueExtensions is Dummy, ERC165 { + /// @notice A descriptive name for a collection of NFTs in this contract + /// @dev EVM selector for this function is: 0x06fdde03, + /// or in textual repr: name() + function name() external view returns (string memory); + + /// @notice An abbreviated name for NFTs in this contract + /// @dev EVM selector for this function is: 0x95d89b41, + /// or in textual repr: symbol() + function symbol() external view returns (string memory); + /// @notice Transfer ownership of an NFT /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` /// is the zero address. Throws if `tokenId` is not a valid NFT. From f27580fc65c79ae40475dcc4bbe50fafcf302a6e Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 13 Oct 2022 15:47:00 +0000 Subject: [PATCH 1128/1274] feat: make collection ERC721 compatible Signed-off-by: Yaroslav Bolyukin --- pallets/unique/src/eth/mod.rs | 78 +++++++++++++++++++ .../src/eth/stubs/CollectionHelpers.sol | 11 ++- tests/src/eth/api/CollectionHelpers.sol | 6 +- tests/src/eth/collectionHelpersAbi.json | 10 +++ 4 files changed, 103 insertions(+), 2 deletions(-) diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 05c1843b40..c90dc2e013 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -27,6 +27,7 @@ use pallet_common::{ CollectionHelpersEvents, static_property::{key, value as property_value}, }, + Pallet as PalletCommon, }; use pallet_evm_coder_substrate::{dispatch_to_evm, SubstrateRecorder, WithRecorder}; use pallet_evm::{account::CrossAccountId, OnMethodCall, PrecompileHandle, PrecompileResult}; @@ -340,6 +341,83 @@ where ) } + #[solidity(rename_selector = "makeCollectionERC721MetadataCompatible")] + fn make_collection_metadata_compatible( + &mut self, + caller: caller, + collection: address, + base_uri: string, + ) -> Result<()> { + let caller = T::CrossAccountId::from_eth(caller); + let collection = + pallet_common::eth::map_eth_to_id(&collection).ok_or("not a collection address")?; + let mut collection = + >::new(collection).ok_or("collection not found")?; + + if !matches!( + collection.mode, + CollectionMode::NFT | CollectionMode::ReFungible + ) { + return Err("target collection should be either NFT or Refungible".into()); + } + + self.recorder().consume_sstore()?; + collection + .check_is_owner_or_admin(&caller) + .map_err(dispatch_to_evm::)?; + + if collection.flags.erc721metadata { + return Err("target collection is already Erc721Metadata compatible".into()); + } + collection.flags.erc721metadata = true; + + let all_permissions = >::get(collection.id); + if all_permissions.get(&key::url()).is_none() { + self.recorder().consume_sstore()?; + >::set_property_permission(&collection, &caller, default_url_pkp()) + .map_err(dispatch_to_evm::)?; + } + if all_permissions.get(&key::suffix()).is_none() { + self.recorder().consume_sstore()?; + >::set_property_permission(&collection, &caller, default_suffix_pkp()) + .map_err(dispatch_to_evm::)?; + } + + let all_properties = >::get(collection.id); + let mut new_properties = vec![]; + if all_properties.get(&key::schema_name()).is_none() { + self.recorder().consume_sstore()?; + new_properties.push(up_data_structs::Property { + key: key::schema_name(), + value: property_value::erc721(), + }); + new_properties.push(up_data_structs::Property { + key: key::schema_version(), + value: property_value::schema_version(), + }); + } + if all_properties.get(&key::base_uri()).is_none() && !base_uri.is_empty() { + new_properties.push(up_data_structs::Property { + key: key::base_uri(), + value: base_uri + .into_bytes() + .try_into() + .map_err(|_| "base uri is too large")?, + }); + } + + if !new_properties.is_empty() { + self.recorder().consume_sstore()?; + >::set_collection_properties(&collection, &caller, new_properties) + .map_err(dispatch_to_evm::)?; + } + + self.recorder().consume_sstore()?; + collection.save().map_err(dispatch_to_evm::)?; + + Ok(()) + } + /// Check if a collection exists /// @param collectionAddress Address of the collection in question /// @return bool Does the collection exist? diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.sol b/pallets/unique/src/eth/stubs/CollectionHelpers.sol index 7986d1001b..f1fb40b007 100644 --- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol +++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol @@ -23,7 +23,7 @@ contract CollectionHelpersEvents { } /// @title Contract, which allows users to operate with collections -/// @dev the ERC-165 identifier for this interface is 0xd14d1221 +/// @dev the ERC-165 identifier for this interface is 0x542f5079 contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { /// Create an NFT collection /// @param name Name of the collection @@ -114,6 +114,15 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { return 0x0000000000000000000000000000000000000000; } + /// @dev EVM selector for this function is: 0x85624258, + /// or in textual repr: makeCollectionERC721MetadataCompatible(address,string) + function makeCollectionERC721MetadataCompatible(address collection, string memory baseUri) public { + require(false, stub_error); + collection; + baseUri; + dummy = 0; + } + /// Check if a collection exists /// @param collectionAddress Address of the collection in question /// @return bool Does the collection exist? diff --git a/tests/src/eth/api/CollectionHelpers.sol b/tests/src/eth/api/CollectionHelpers.sol index f07e669146..5dc6ecdbfd 100644 --- a/tests/src/eth/api/CollectionHelpers.sol +++ b/tests/src/eth/api/CollectionHelpers.sol @@ -18,7 +18,7 @@ interface CollectionHelpersEvents { } /// @title Contract, which allows users to operate with collections -/// @dev the ERC-165 identifier for this interface is 0xd14d1221 +/// @dev the ERC-165 identifier for this interface is 0x542f5079 interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { /// Create an NFT collection /// @param name Name of the collection @@ -72,6 +72,10 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory baseUri ) external payable returns (address); + /// @dev EVM selector for this function is: 0x85624258, + /// or in textual repr: makeCollectionERC721MetadataCompatible(address,string) + function makeCollectionERC721MetadataCompatible(address collection, string memory baseUri) external; + /// Check if a collection exists /// @param collectionAddress Address of the collection in question /// @return bool Does the collection exist? diff --git a/tests/src/eth/collectionHelpersAbi.json b/tests/src/eth/collectionHelpersAbi.json index 4283654b88..ca495cb29d 100644 --- a/tests/src/eth/collectionHelpersAbi.json +++ b/tests/src/eth/collectionHelpersAbi.json @@ -95,6 +95,16 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "collection", "type": "address" }, + { "internalType": "string", "name": "baseUri", "type": "string" } + ], + "name": "makeCollectionERC721MetadataCompatible", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" } From 9d5e6bdc297d39eef77f206760ae507919b4ce8a Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 13 Oct 2022 16:18:28 +0000 Subject: [PATCH 1129/1274] fix: forward collection flags Signed-off-by: Yaroslav Bolyukin --- pallets/common/src/dispatch.rs | 3 ++- pallets/fungible/src/lib.rs | 3 ++- pallets/nonfungible/src/benchmarking.rs | 2 +- pallets/nonfungible/src/lib.rs | 12 ++------- pallets/proxy-rmrk-core/src/lib.rs | 10 ++++++- pallets/proxy-rmrk-equip/src/lib.rs | 5 +++- pallets/refungible/src/lib.rs | 3 ++- pallets/unique/src/eth/mod.rs | 36 +++++++++++++++++++------ pallets/unique/src/lib.rs | 2 +- runtime/common/dispatch.rs | 11 +++++--- 10 files changed, 58 insertions(+), 29 deletions(-) diff --git a/pallets/common/src/dispatch.rs b/pallets/common/src/dispatch.rs index bc2ffed51a..dbafded39e 100644 --- a/pallets/common/src/dispatch.rs +++ b/pallets/common/src/dispatch.rs @@ -9,7 +9,7 @@ use frame_support::{ traits::Get, }; use sp_runtime::DispatchError; -use up_data_structs::{CollectionId, CreateCollectionData}; +use up_data_structs::{CollectionId, CreateCollectionData, CollectionFlags}; use crate::{pallet::Config, CommonCollectionOperations, CollectionHandle}; @@ -80,6 +80,7 @@ pub trait CollectionDispatch { sender: T::CrossAccountId, payer: T::CrossAccountId, data: CreateCollectionData, + flags: CollectionFlags, ) -> Result; /// Delete the collection. diff --git a/pallets/fungible/src/lib.rs b/pallets/fungible/src/lib.rs index 41cb1a9b11..4fc62fbb78 100644 --- a/pallets/fungible/src/lib.rs +++ b/pallets/fungible/src/lib.rs @@ -212,8 +212,9 @@ impl Pallet { owner: T::CrossAccountId, payer: T::CrossAccountId, data: CreateCollectionData, + flags: CollectionFlags, ) -> Result { - >::init_collection(owner, payer, data, CollectionFlags::default()) + >::init_collection(owner, payer, data, flags) } /// Initializes the collection with ForeignCollection flag. Returns [CollectionId] on success, [DispatchError] otherwise. diff --git a/pallets/nonfungible/src/benchmarking.rs b/pallets/nonfungible/src/benchmarking.rs index 6940f1a36e..256276d88c 100644 --- a/pallets/nonfungible/src/benchmarking.rs +++ b/pallets/nonfungible/src/benchmarking.rs @@ -55,7 +55,7 @@ fn create_collection( owner, CollectionMode::NFT, |owner: T::CrossAccountId, data| { - >::init_collection(owner.clone(), owner, data, true) + >::init_collection(owner.clone(), owner, data, Default::default()) }, NonfungibleHandle::cast, ) diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 37421eb1dd..2387721474 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -408,17 +408,9 @@ impl Pallet { owner: T::CrossAccountId, payer: T::CrossAccountId, data: CreateCollectionData, - is_external: bool, + flags: CollectionFlags, ) -> Result { - >::init_collection( - owner, - payer, - data, - CollectionFlags { - external: is_external, - ..Default::default() - }, - ) + >::init_collection(owner, payer, data, flags) } /// Destroy NFT collection diff --git a/pallets/proxy-rmrk-core/src/lib.rs b/pallets/proxy-rmrk-core/src/lib.rs index 2b2dd9c8f3..666ae1f43c 100644 --- a/pallets/proxy-rmrk-core/src/lib.rs +++ b/pallets/proxy-rmrk-core/src/lib.rs @@ -1448,7 +1448,15 @@ impl Pallet { data: CreateCollectionData, properties: impl Iterator, ) -> Result { - let collection_id = >::init_collection(sender.clone(), sender, data, true); + let collection_id = >::init_collection( + sender.clone(), + sender, + data, + up_data_structs::CollectionFlags { + external: true, + ..Default::default() + }, + ); if let Err(DispatchError::Arithmetic(_)) = &collection_id { return Err(>::NoAvailableCollectionId.into()); diff --git a/pallets/proxy-rmrk-equip/src/lib.rs b/pallets/proxy-rmrk-equip/src/lib.rs index 57b1ccb210..c8d4e4f6d5 100644 --- a/pallets/proxy-rmrk-equip/src/lib.rs +++ b/pallets/proxy-rmrk-equip/src/lib.rs @@ -254,7 +254,10 @@ pub mod pallet { cross_sender.clone(), cross_sender.clone(), data, - true, + up_data_structs::CollectionFlags { + external: true, + ..Default::default() + }, ); if let Err(DispatchError::Arithmetic(_)) = &collection_id_res { diff --git a/pallets/refungible/src/lib.rs b/pallets/refungible/src/lib.rs index d2824875ac..1dc524a306 100644 --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -371,8 +371,9 @@ impl Pallet { owner: T::CrossAccountId, payer: T::CrossAccountId, data: CreateCollectionData, + flags: CollectionFlags, ) -> Result { - >::init_collection(owner, payer, data, CollectionFlags::default()) + >::init_collection(owner, payer, data, flags) } /// Destroy RFT collection diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index c90dc2e013..d748ceb983 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -34,7 +34,7 @@ use pallet_evm::{account::CrossAccountId, OnMethodCall, PrecompileHandle, Precom use sp_std::vec; use up_data_structs::{ CollectionName, CollectionDescription, CollectionTokenPrefix, CreateCollectionData, - CollectionMode, PropertyValue, + CollectionMode, PropertyValue, CollectionFlags, }; use crate::{Config, SelfWeightOf, weights::WeightInfo}; @@ -186,9 +186,16 @@ fn create_refungible_collection_internal< let collection_helpers_address = T::CrossAccountId::from_eth(::ContractAddress::get()); - let collection_id = - T::CollectionDispatch::create(caller.clone(), collection_helpers_address, data) - .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; + let collection_id = T::CollectionDispatch::create( + caller.clone(), + collection_helpers_address, + data, + CollectionFlags { + erc721metadata: add_properties, + ..Default::default() + }, + ) + .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; let address = pallet_common::eth::collection_id_to_address(collection_id); Ok(address) } @@ -243,8 +250,13 @@ where check_sent_amount_equals_collection_creation_price::(value)?; let collection_helpers_address = T::CrossAccountId::from_eth(::ContractAddress::get()); - let collection_id = T::CollectionDispatch::create(caller, collection_helpers_address, data) - .map_err(dispatch_to_evm::)?; + let collection_id = T::CollectionDispatch::create( + caller, + collection_helpers_address, + data, + Default::default(), + ) + .map_err(dispatch_to_evm::)?; let address = pallet_common::eth::collection_id_to_address(collection_id); Ok(address) @@ -291,8 +303,16 @@ where check_sent_amount_equals_collection_creation_price::(value)?; let collection_helpers_address = T::CrossAccountId::from_eth(::ContractAddress::get()); - let collection_id = T::CollectionDispatch::create(caller, collection_helpers_address, data) - .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; + let collection_id = T::CollectionDispatch::create( + caller, + collection_helpers_address, + data, + CollectionFlags { + erc721metadata: true, + ..Default::default() + }, + ) + .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; let address = pallet_common::eth::collection_id_to_address(collection_id); Ok(address) diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index ee6299ba77..de710baa51 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -345,7 +345,7 @@ decl_module! { // ========= let sender = T::CrossAccountId::from_sub(sender); - let _id = T::CollectionDispatch::create(sender.clone(), sender, data)?; + let _id = T::CollectionDispatch::create(sender.clone(), sender, data, Default::default())?; Ok(()) } diff --git a/runtime/common/dispatch.rs b/runtime/common/dispatch.rs index bd0446b7f5..ccd26b7f8c 100644 --- a/runtime/common/dispatch.rs +++ b/runtime/common/dispatch.rs @@ -31,7 +31,7 @@ use pallet_refungible::{ }; use up_data_structs::{ CollectionMode, CreateCollectionData, MAX_DECIMAL_POINTS, mapping::TokenAddressMapping, - CollectionId, + CollectionId, CollectionFlags, }; #[cfg(not(feature = "refungible"))] @@ -57,10 +57,11 @@ where sender: T::CrossAccountId, payer: T::CrossAccountId, data: CreateCollectionData, + flags: CollectionFlags, ) -> Result { let id = match data.mode { CollectionMode::NFT => { - >::init_collection(sender, payer, data, false)? + >::init_collection(sender, payer, data, flags)? } CollectionMode::Fungible(decimal_points) => { // check params @@ -68,11 +69,13 @@ where decimal_points <= MAX_DECIMAL_POINTS, pallet_unique::Error::::CollectionDecimalPointLimitExceeded ); - >::init_collection(sender, payer, data)? + >::init_collection(sender, payer, data, flags)? } #[cfg(feature = "refungible")] - CollectionMode::ReFungible => >::init_collection(sender, payer, data)?, + CollectionMode::ReFungible => { + >::init_collection(sender, payer, data, flags)? + } #[cfg(not(feature = "refungible"))] CollectionMode::ReFungible => return unsupported!(T), From 825818b094ee2aafd8b4b99934acacbe9e90300d Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 13 Oct 2022 16:25:53 +0000 Subject: [PATCH 1130/1274] fix(refungible): name/symbol should be always callable Signed-off-by: Yaroslav Bolyukin --- pallets/refungible/src/erc.rs | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 692b2d959a..ded9deb27b 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -195,16 +195,18 @@ pub enum ERC721MintableEvents { #[solidity_interface(name = ERC721Metadata)] impl RefungibleHandle { - /// @notice A descriptive name for a collection of RFTs in this contract - fn name(&self) -> Result { - Ok(decode_utf16(self.name.iter().copied()) - .map(|r| r.unwrap_or(REPLACEMENT_CHARACTER)) - .collect::()) + /// @notice A descriptive name for a collection of NFTs in this contract + /// @dev real implementation of this function lies in `ERC721UniqueExtensions` + #[solidity(hide, rename_selector = "name")] + fn name_proxy(&self) -> Result { + self.name() } - /// @notice An abbreviated name for RFTs in this contract - fn symbol(&self) -> Result { - Ok(string::from_utf8_lossy(&self.token_prefix).into()) + /// @notice An abbreviated name for NFTs in this contract + /// @dev real implementation of this function lies in `ERC721UniqueExtensions` + #[solidity(hide, rename_selector = "symbol")] + fn symbol_proxy(&self) -> Result { + self.symbol() } /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. @@ -596,6 +598,18 @@ fn get_token_permission( /// @title Unique extensions for ERC721. #[solidity_interface(name = ERC721UniqueExtensions)] impl RefungibleHandle { + /// @notice A descriptive name for a collection of NFTs in this contract + fn name(&self) -> Result { + Ok(decode_utf16(self.name.iter().copied()) + .map(|r| r.unwrap_or(REPLACEMENT_CHARACTER)) + .collect::()) + } + + /// @notice An abbreviated name for NFTs in this contract + fn symbol(&self) -> Result { + Ok(string::from_utf8_lossy(&self.token_prefix).into()) + } + /// @notice Transfer ownership of an RFT /// @dev Throws unless `msg.sender` is the current owner. Throws if `to` /// is the zero address. Throws if `tokenId` is not a valid RFT. From 5c36133bb18fc16f8d7519f92c09697caabe6162 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 13 Oct 2022 16:27:59 +0000 Subject: [PATCH 1131/1274] chore: regenerate stubs Signed-off-by: Yaroslav Bolyukin --- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4381 -> 4381 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 100 +++++++-------- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4401 -> 4408 bytes .../refungible/src/stubs/UniqueRefungible.sol | 114 ++++++++++-------- tests/src/eth/api/UniqueNFT.sol | 70 +++++------ tests/src/eth/api/UniqueRefungible.sol | 76 +++++++----- tests/src/eth/nonFungibleAbi.json | 4 +- tests/src/eth/reFungibleAbi.json | 4 +- 8 files changed, 200 insertions(+), 168 deletions(-) diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index d09f6a07404d0f0010145161368cb59289e59c6a..7368e167b5598ed3cfc95511a985aee5cd08ee7e 100644 GIT binary patch delta 44 zcmV+{0Mq}SBAp_z%n%?B%Zz9|kv;d%g*><}^6 Cf)wEZ delta 44 zcmV+{0Mq}SBAp_z%n%@tmn~z!a=@+S;<}^F C;T2Z^ diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index 66352dba6b..2744dfac06 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -17,49 +17,6 @@ contract ERC165 is Dummy { } } -/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension -/// @dev See https://eips.ethereum.org/EIPS/eip-721 -/// @dev the ERC-165 identifier for this interface is 0x5b5e139f -contract ERC721Metadata is Dummy, ERC165 { - // /// @notice A descriptive name for a collection of NFTs in this contract - // /// @dev real implementation of this function lies in `ERC721UniqueExtensions` - // /// @dev EVM selector for this function is: 0x06fdde03, - // /// or in textual repr: name() - // function name() public view returns (string memory) { - // require(false, stub_error); - // dummy; - // return ""; - // } - - // /// @notice An abbreviated name for NFTs in this contract - // /// @dev real implementation of this function lies in `ERC721UniqueExtensions` - // /// @dev EVM selector for this function is: 0x95d89b41, - // /// or in textual repr: symbol() - // function symbol() public view returns (string memory) { - // require(false, stub_error); - // dummy; - // return ""; - // } - - /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. - /// - /// @dev If the token has a `url` property and it is not empty, it is returned. - /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. - /// If the collection property `baseURI` is empty or absent, return "" (empty string) - /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix - /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). - /// - /// @return token's const_metadata - /// @dev EVM selector for this function is: 0xc87b56dd, - /// or in textual repr: tokenURI(uint256) - function tokenURI(uint256 tokenId) public view returns (string memory) { - require(false, stub_error); - tokenId; - dummy; - return ""; - } -} - /// @title A contract that allows to set and delete token properties and change token property permissions. /// @dev the ERC-165 identifier for this interface is 0x41369377 contract TokenProperties is Dummy, ERC165 { @@ -220,10 +177,10 @@ contract Collection is Dummy, ERC165 { /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw. /// @dev EVM selector for this function is: 0x6ec0a9f1, /// or in textual repr: collectionSponsor() - function collectionSponsor() public view returns (Tuple15 memory) { + function collectionSponsor() public view returns (Tuple17 memory) { require(false, stub_error); dummy; - return Tuple15(0x0000000000000000000000000000000000000000, 0); + return Tuple17(0x0000000000000000000000000000000000000000, 0); } /// Set limits for the collection. @@ -402,10 +359,10 @@ contract Collection is Dummy, ERC165 { /// If address is canonical then substrate mirror is zero and vice versa. /// @dev EVM selector for this function is: 0xdf727d3b, /// or in textual repr: collectionOwner() - function collectionOwner() public view returns (Tuple15 memory) { + function collectionOwner() public view returns (Tuple17 memory) { require(false, stub_error); dummy; - return Tuple15(0x0000000000000000000000000000000000000000, 0); + return Tuple17(0x0000000000000000000000000000000000000000, 0); } /// Changes collection owner to another account @@ -422,11 +379,54 @@ contract Collection is Dummy, ERC165 { } /// @dev anonymous struct -struct Tuple15 { +struct Tuple17 { address field_0; uint256 field_1; } +/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension +/// @dev See https://eips.ethereum.org/EIPS/eip-721 +/// @dev the ERC-165 identifier for this interface is 0x5b5e139f +contract ERC721Metadata is Dummy, ERC165 { + // /// @notice A descriptive name for a collection of NFTs in this contract + // /// @dev real implementation of this function lies in `ERC721UniqueExtensions` + // /// @dev EVM selector for this function is: 0x06fdde03, + // /// or in textual repr: name() + // function name() public view returns (string memory) { + // require(false, stub_error); + // dummy; + // return ""; + // } + + // /// @notice An abbreviated name for NFTs in this contract + // /// @dev real implementation of this function lies in `ERC721UniqueExtensions` + // /// @dev EVM selector for this function is: 0x95d89b41, + // /// or in textual repr: symbol() + // function symbol() public view returns (string memory) { + // require(false, stub_error); + // dummy; + // return ""; + // } + + /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. + /// + /// @dev If the token has a `url` property and it is not empty, it is returned. + /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`. + /// If the collection property `baseURI` is empty or absent, return "" (empty string) + /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix + /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings). + /// + /// @return token's const_metadata + /// @dev EVM selector for this function is: 0xc87b56dd, + /// or in textual repr: tokenURI(uint256) + function tokenURI(uint256 tokenId) public view returns (string memory) { + require(false, stub_error); + tokenId; + dummy; + return ""; + } +} + /// @title ERC721 Token that can be irreversibly burned (destroyed). /// @dev the ERC-165 identifier for this interface is 0x42966c68 contract ERC721Burnable is Dummy, ERC165 { @@ -790,7 +790,7 @@ contract UniqueNFT is ERC721UniqueExtensions, ERC721Mintable, ERC721Burnable, + ERC721Metadata, Collection, - TokenProperties, - ERC721Metadata + TokenProperties {} diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index 56ca90f71acc09e2250c1aee52bc1dc595df524d..6711598589c9e47cb5e83cf3f4246cf181016e6d 100644 GIT binary patch delta 1622 zcmZ8hduUr#9L_OKa&zt@O>IhRlIAAsbTSojL|vIKqlnH8xeIMBctOwU=0Bsef-(w& z^*)nUvEJOH1M8p&qJkN+?T`6_;RApuZ zdk!b(eePHvIzcX`YKz&M;$-%jKGdUVpc;krgDr;$ZVQyDGweTNxxR$_o$+W~HLm0p ziUz8CqTv09f5eT#?mqNp9Ep3#neYvfIg_0_NT! zDlEez)5EsZ`LDAjelMGM%#wGH4tZ_(=D+kwMzfMywk1*D?QAST#8%jUC`W4-PyVc$#Um>V8qJy4hreOWVNwdP~z^QT&gm zcrJZ@`Zh)2!h(c6yGru0SblIvNO2o&Gn|L-(UIPlFIRwv!=&O-QpuHoOLo!UQ{*By%!{8!XJ3(pTp3*Pa>I*KA|xfjG3j!%&G+c$ zOGPBx!REV4><+_Z(tVMw5sfr%iIpYcNO}1GO1cW$X$N!{tR_m>(*^>jQKIW_jp$ff zRnej~;whSA4H`)-og>qOTORpFMZg%w(iIiw3bg-!$J!%i(=HTHs%U}}O28&wpnEO5 zGD>J|w!XQXYE0WEXu1w?mjRakBIgIIx3?OB$T)c4T+4;GHQwc6dviWWQ0h}HMd;kCd delta 1767 zcmZuxZD?Cn815lWa=(*oNk5JGsNEDR9h57bqEriNC+Z<{33#=fvu=XmD8=eO&HYZp z&?PxlQ9<2M@yC9+R&=n*n1~KU9qh+`452s~f@5Pk1wZOM_nv#Z8)t6F<$2!sea`!J zaM6SO8R2W00|}L8DH_vuvc&RjqtF8l~htbR5U0S+Al<_Eo|@ zDi0EzEQ1ANCr9H8RShB1P7YA~RdNh0tX@qX215|_prYvlP(ejh7(@jN^f>^uAtWdH zTfi8(z;Ao#sT%6h*EP&NZDDSrsx6};X%V0j2qBgA6ztfh9Om4>F|p6|9cdV~BHQ(? z?~z#{f5+#c*tZR93E-qu)d)mWE>PQ0H#1b_N9F-BcZGZ?lpoG8Y^w;+XKFZRP%nOK zpu7R=BKD8>*Rar!6K_{F zh~mSj2wK5OI%}4o2AaaXUXtW*abT;)D5F8g)9@y>2@CT9r((gx!iy&6{~>ovh5A9p zI}Xq+Bb~!ywx+9&*Er!b&t$A?F3?|&(V2thX3CxkSS*~wiI1z=k_l9!(xkr)KkC=e zE`kI5ExIuN7t5|$DtaVl%8acuEjtx4RX?w+fU$a!R;t?$yw6ORE zc}p%RAUIVL{Fa`Q^TJp_(M`K74@^HAdej_$7YM}CUVopwweQf)@Mnq;eMNJX8et$I zJCxGQN(hfx!S3BypLCWvZPX|I#0XlS^!xSt2J3Q;8M+F@^6hMUBX!F3k0`RP@*^zn z`nr0Pl;;?W<#~r*e1D7`NC#j6b?zGd7=1<-%grE}Hq72QM)?DRQaRyxsC0_dQ~B}p z|9jjYfs+!C9*31I`8sv;1KUFD_HYxZ1r=>}gCoT#PlTRx|MjHTV>~^aAvILD`Z`c^ zth5os%11;?kBod%Lx9$!oUh@OLfdm~(CsrTb}mP+oe5rplqCn#*$h`R9=AH`|XFd$rqNZKR-Xpzj0{&>ZM(eP2hdI_uO>p!rJQ6p9JlBZvNT1=^idk I(wSTT1=& Date: Thu, 13 Oct 2022 17:10:18 +0000 Subject: [PATCH 1132/1274] fix(evm-coder) reads should be hidden Signed-off-by: Yaroslav Bolyukin --- crates/evm-coder/src/solidity.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/evm-coder/src/solidity.rs b/crates/evm-coder/src/solidity.rs index 5a74323334..0ceaab6f40 100644 --- a/crates/evm-coder/src/solidity.rs +++ b/crates/evm-coder/src/solidity.rs @@ -225,7 +225,7 @@ impl_tuples! {A B C D E F G H I J} pub trait SolidityArguments { fn solidity_name(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result; - fn solidity_get(&self, writer: &mut impl fmt::Write) -> fmt::Result; + fn solidity_get(&self, prefix: &str, writer: &mut impl fmt::Write) -> fmt::Result; fn solidity_default(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result; fn is_empty(&self) -> bool { self.len() == 0 @@ -248,7 +248,7 @@ impl SolidityArguments for UnnamedArgument { Ok(()) } } - fn solidity_get(&self, _writer: &mut impl fmt::Write) -> fmt::Result { + fn solidity_get(&self, _prefix: &str, _writer: &mut impl fmt::Write) -> fmt::Result { Ok(()) } fn solidity_default(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result { @@ -283,8 +283,8 @@ impl SolidityArguments for NamedArgument { Ok(()) } } - fn solidity_get(&self, writer: &mut impl fmt::Write) -> fmt::Result { - writeln!(writer, "\t\t{};", self.0) + fn solidity_get(&self, prefix: &str, writer: &mut impl fmt::Write) -> fmt::Result { + writeln!(writer, "\t{prefix}\t{};", self.0) } fn solidity_default(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result { T::solidity_default(writer, tc) @@ -318,8 +318,8 @@ impl SolidityArguments for SolidityEventArgument { Ok(()) } } - fn solidity_get(&self, writer: &mut impl fmt::Write) -> fmt::Result { - writeln!(writer, "\t\t{};", self.1) + fn solidity_get(&self, prefix: &str, writer: &mut impl fmt::Write) -> fmt::Result { + writeln!(writer, "\t{prefix}\t{};", self.1) } fn solidity_default(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result { T::solidity_default(writer, tc) @@ -337,7 +337,7 @@ impl SolidityArguments for () { fn solidity_name(&self, _writer: &mut impl fmt::Write, _tc: &TypeCollector) -> fmt::Result { Ok(()) } - fn solidity_get(&self, _writer: &mut impl fmt::Write) -> fmt::Result { + fn solidity_get(&self, _prefix: &str, _writer: &mut impl fmt::Write) -> fmt::Result { Ok(()) } fn solidity_default(&self, _writer: &mut impl fmt::Write, _tc: &TypeCollector) -> fmt::Result { @@ -365,9 +365,9 @@ impl SolidityArguments for Tuple { )* ); Ok(()) } - fn solidity_get(&self, writer: &mut impl fmt::Write) -> fmt::Result { + fn solidity_get(&self, prefix: &str, writer: &mut impl fmt::Write) -> fmt::Result { for_tuples!( #( - Tuple.solidity_get(writer)?; + Tuple.solidity_get(prefix, writer)?; )* ); Ok(()) } @@ -470,7 +470,7 @@ impl SolidityFunctions for SolidityF if is_impl { writeln!(writer, " {{")?; writeln!(writer, "\t{hide_comment}\trequire(false, stub_error);")?; - self.args.solidity_get(writer)?; + self.args.solidity_get(hide_comment, writer)?; match &self.mutability { SolidityMutability::Pure => {} SolidityMutability::View => writeln!(writer, "\t{hide_comment}\tdummy;")?, From ae73107d235e0628df98fac3252b83e8fbdfa7c2 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 13 Oct 2022 17:11:51 +0000 Subject: [PATCH 1133/1274] refactor: do not receive token id as mint argument Signed-off-by: Yaroslav Bolyukin --- pallets/nonfungible/src/erc.rs | 49 +++++++++++++++++++++++++++++----- pallets/refungible/src/erc.rs | 49 +++++++++++++++++++++++++++++----- 2 files changed, 84 insertions(+), 14 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 37e95b8987..2ac74804ef 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -193,7 +193,7 @@ pub enum ERC721Events { } #[derive(ToLog)] -pub enum ERC721MintableEvents { +pub enum ERC721UniqueMintableEvents { #[allow(dead_code)] MintingFinished {}, } @@ -431,19 +431,33 @@ impl NonfungibleHandle { } /// @title ERC721 minting logic. -#[solidity_interface(name = ERC721Mintable, events(ERC721MintableEvents))] +#[solidity_interface(name = ERC721UniqueMintable, events(ERC721UniqueMintableEvents))] impl NonfungibleHandle { fn minting_finished(&self) -> Result { Ok(false) } + /// @notice Function to mint token. + /// @param to The new owner + /// @return uint256 The id of the newly minted token + #[weight(>::create_item())] + fn mint(&mut self, caller: caller, to: address) -> Result { + let token_id: uint256 = >::get(self.id) + .checked_add(1) + .ok_or("item id overflow")? + .into(); + self.mint_check_id(caller, to, token_id)?; + Ok(token_id) + } + /// @notice Function to mint token. /// @dev `tokenId` should be obtained with `nextTokenId` method, /// unlike standard, you can't specify it manually /// @param to The new owner /// @param tokenId ID of the minted NFT + #[solidity(hide, rename_selector = "mint")] #[weight(>::create_item())] - fn mint(&mut self, caller: caller, to: address, token_id: uint256) -> Result { + fn mint_check_id(&mut self, caller: caller, to: address, token_id: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); let to = T::CrossAccountId::from_eth(to); let token_id: u32 = token_id.try_into()?; @@ -473,15 +487,35 @@ impl NonfungibleHandle { Ok(true) } + /// @notice Function to mint token with the given tokenUri. + /// @param to The new owner + /// @param tokenUri Token URI that would be stored in the NFT properties + /// @return uint256 The id of the newly minted token + #[solidity(rename_selector = "mintWithTokenURI")] + #[weight(>::create_item())] + fn mint_with_token_uri( + &mut self, + caller: caller, + to: address, + token_uri: string, + ) -> Result { + let token_id: uint256 = >::get(self.id) + .checked_add(1) + .ok_or("item id overflow")? + .into(); + self.mint_with_token_uri_check_id(caller, to, token_id, token_uri)?; + Ok(token_id) + } + /// @notice Function to mint token with the given tokenUri. /// @dev `tokenId` should be obtained with `nextTokenId` method, /// unlike standard, you can't specify it manually /// @param to The new owner /// @param tokenId ID of the minted NFT /// @param tokenUri Token URI that would be stored in the NFT properties - #[solidity(rename_selector = "mintWithTokenURI")] + #[solidity(hide, rename_selector = "mintWithTokenURI")] #[weight(>::create_item())] - fn mint_with_token_uri( + fn mint_with_token_uri_check_id( &mut self, caller: caller, to: address, @@ -637,6 +671,7 @@ impl NonfungibleHandle { /// should be obtained with `nextTokenId` method /// @param to The new owner /// @param tokenIds IDs of the minted NFTs + #[solidity(hide)] #[weight(>::create_multiple_items(token_ids.len() as u32))] fn mint_bulk(&mut self, caller: caller, to: address, token_ids: Vec) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -673,7 +708,7 @@ impl NonfungibleHandle { /// numbers and first number should be obtained with `nextTokenId` method /// @param to The new owner /// @param tokens array of pairs of token ID and token URI for minted tokens - #[solidity(rename_selector = "mintBulkWithTokenURI")] + #[solidity(hide, rename_selector = "mintBulkWithTokenURI")] #[weight(>::create_multiple_items(tokens.len() as u32))] fn mint_bulk_with_token_uri( &mut self, @@ -728,7 +763,7 @@ impl NonfungibleHandle { ERC721, ERC721Enumerable, ERC721UniqueExtensions, - ERC721Mintable, + ERC721UniqueMintable, ERC721Burnable, ERC721Metadata(if(this.flags.erc721metadata)), Collection(via(common_mut returns CollectionHandle)), diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index ded9deb27b..e37f1be021 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -187,7 +187,7 @@ pub enum ERC721Events { } #[derive(ToLog)] -pub enum ERC721MintableEvents { +pub enum ERC721UniqueMintableEvents { /// @dev Not supported #[allow(dead_code)] MintingFinished {}, @@ -449,19 +449,33 @@ impl RefungibleHandle { } /// @title ERC721 minting logic. -#[solidity_interface(name = ERC721Mintable, events(ERC721MintableEvents))] +#[solidity_interface(name = ERC721UniqueMintable, events(ERC721UniqueMintableEvents))] impl RefungibleHandle { fn minting_finished(&self) -> Result { Ok(false) } + /// @notice Function to mint token. + /// @param to The new owner + /// @return uint256 The id of the newly minted token + #[weight(>::create_item())] + fn mint(&mut self, caller: caller, to: address) -> Result { + let token_id: uint256 = >::get(self.id) + .checked_add(1) + .ok_or("item id overflow")? + .into(); + self.mint_check_id(caller, to, token_id)?; + Ok(token_id) + } + /// @notice Function to mint token. /// @dev `tokenId` should be obtained with `nextTokenId` method, /// unlike standard, you can't specify it manually /// @param to The new owner /// @param tokenId ID of the minted RFT + #[solidity(hide, rename_selector = "mint")] #[weight(>::create_item())] - fn mint(&mut self, caller: caller, to: address, token_id: uint256) -> Result { + fn mint_check_id(&mut self, caller: caller, to: address, token_id: uint256) -> Result { let caller = T::CrossAccountId::from_eth(caller); let to = T::CrossAccountId::from_eth(to); let token_id: u32 = token_id.try_into()?; @@ -496,15 +510,35 @@ impl RefungibleHandle { Ok(true) } + /// @notice Function to mint token with the given tokenUri. + /// @param to The new owner + /// @param tokenUri Token URI that would be stored in the NFT properties + /// @return uint256 The id of the newly minted token + #[solidity(rename_selector = "mintWithTokenURI")] + #[weight(>::create_item())] + fn mint_with_token_uri( + &mut self, + caller: caller, + to: address, + token_uri: string, + ) -> Result { + let token_id: uint256 = >::get(self.id) + .checked_add(1) + .ok_or("item id overflow")? + .into(); + self.mint_with_token_uri_check_id(caller, to, token_id, token_uri)?; + Ok(token_id) + } + /// @notice Function to mint token with the given tokenUri. /// @dev `tokenId` should be obtained with `nextTokenId` method, /// unlike standard, you can't specify it manually /// @param to The new owner /// @param tokenId ID of the minted RFT /// @param tokenUri Token URI that would be stored in the RFT properties - #[solidity(rename_selector = "mintWithTokenURI")] + #[solidity(hide, rename_selector = "mintWithTokenURI")] #[weight(>::create_item())] - fn mint_with_token_uri( + fn mint_with_token_uri_check_id( &mut self, caller: caller, to: address, @@ -671,6 +705,7 @@ impl RefungibleHandle { /// should be obtained with `nextTokenId` method /// @param to The new owner /// @param tokenIds IDs of the minted RFTs + #[solidity(hide)] #[weight(>::create_multiple_items(token_ids.len() as u32))] fn mint_bulk(&mut self, caller: caller, to: address, token_ids: Vec) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -713,7 +748,7 @@ impl RefungibleHandle { /// numbers and first number should be obtained with `nextTokenId` method /// @param to The new owner /// @param tokens array of pairs of token ID and token URI for minted tokens - #[solidity(rename_selector = "mintBulkWithTokenURI")] + #[solidity(hide, rename_selector = "mintBulkWithTokenURI")] #[weight(>::create_multiple_items(tokens.len() as u32))] fn mint_bulk_with_token_uri( &mut self, @@ -784,7 +819,7 @@ impl RefungibleHandle { ERC721, ERC721Enumerable, ERC721UniqueExtensions, - ERC721Mintable, + ERC721UniqueMintable, ERC721Burnable, ERC721Metadata(if(this.flags.erc721metadata)), Collection(via(common_mut returns CollectionHandle)), From d662994941bb8d59c9be9b496954315f75fe8310 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 13 Oct 2022 17:12:50 +0000 Subject: [PATCH 1134/1274] chore: regenerate stubs Signed-off-by: Yaroslav Bolyukin --- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4381 -> 3813 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 126 ++++++++++------- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4408 -> 3840 bytes .../refungible/src/stubs/UniqueRefungible.sol | 128 ++++++++++-------- tests/src/eth/api/UniqueNFT.sol | 85 +++++++----- tests/src/eth/api/UniqueRefungible.sol | 87 ++++++------ tests/src/eth/nonFungibleAbi.json | 38 +----- tests/src/eth/reFungibleAbi.json | 38 +----- 8 files changed, 252 insertions(+), 250 deletions(-) diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 7368e167b5598ed3cfc95511a985aee5cd08ee7e..1d92cbc9cc455d33f74bcca4f8d5e5d8c2bddff4 100644 GIT binary patch literal 3813 zcmaJ^dvH`&9lpoSz5~rdvT585Sx8$QZJ|yZS_(4;6lJt6cUQ7o=2qvNY*Gk?6ho}g zl;J)%V8_ng-6T+LD+7*{QO8>OgCg42%9M^pEzD3y%45byCquQhovDZo_?>g^-Q1vd zGrReI=ltG}bMB=VXm_68M0LZ+yS>Wn7wFz4lmICUTob=<7BuyCy#?sjB31M$P3=|4 zGX<@5@2Zin(+e4@Q(hi5vaJxZhw%o+`o-3+47{#hdpxZFS`l+I6^iV>;@=G|Z zs{C8fj2tES>&}D>q54u0443e|qo5&-CIdfldkq%uDQGtS?SdOwopx9$MAD4iRdB|J zWwNNKIu^-kRB5B3vYTmdOH<;wnO3IL8G0!V)kY5wKvf}OWQf~?SlFy6vPuq9WeHW@ze07? z4TWJ!lUEnou(*kZlAyZig?7EPp?B+w6eCX+_0pcyv#+F>G70#*8>Th^?gKnOw0$Yy zqaJK#4LabYGkL6;h35l)aOnIYz(s(Ur$$yZv(S&EEvW`ubFp>m%RPs&RRTPH*W)Ru zIpK40yMoqBPb}SW1n>;F_T7A_ACP-;3h4Qek=Hbrn zg@~kpt?hkB4*}llLCD?%=p6g_Z-jSxsru($n1rKxY5Wi0T@F|Zs`0kAy|&H;Up)8^K%St@d(F>y3`3uM`4fQL*f+L)X&E#g_tkVB z9y*(1AG;r0D<(Fs2W$Z><>$|X`|o%V0$Tz5Mmr~LH@@~3An#KQr(WWAq2O(7EsB2j0l>=~4&T2PTrt39>f|GUJgDW? zSMLU#2e`ssI9rH$YGT*V`4B$8imkan>FxsD??KPI*8J%az#~|_K0S+@JPx?vmfe>D z&-vbPHK2Kr@vj~D86Z!2>XwydK(BH2Uh=ptNWDa^zIp)gMlglH^^ya~%Nsr!(mWVp zsn-E}uo{^<7XmC5F?tA{g*sVi-eTIo!f#+&!WeM{i+8fnZDR3Xd{M)kcIVud7Cx$k zW4#h`-xqv*b6QE{kDPjtg|`Y37W#a}Wzj*tSoTy#4Y4JTn7x^hTS*J8U=1pY{&WU) zW(M^Er+#1e>wn3|N_V?j#p`B{v=9F$8~ zGdOt^4LezQoM%AKnev=P5=08BI4G+Isk+rX@v`wCYdFHoAkxZnI_+TM9H;y`MQ0=^ znF(?x2WC(;PWg(Z^FAeY`h`mVn{$?BnsFWEdcTl4LI09Lx*G@!=TX_l8$~U7H{cdi z_@(jxxadc1A{n|#%sg5WKUtIH-Dy2A<>Ex=M!7w`OGhK(pgSqYMc#r6r0md~78ahA z%Pjn!$-=)XXtk=i)Zm@R5#fhDTHojrJ$NA#YBSPY;d^pDc-sc<=9m=zN@BALS?BfhWGYm()_*t~o zG0QNwp`cY%wW?O7+eS{eQ3>&oz@lF);*r832FaBzg2E6M{WNzEZbjF^4D^o@lGjw) zA(Dgk<&IUM5jn`BSrlZJdttNae4ZA+4$+$QQtcA?(q%a?4YC?uc~L4qtmv<$0E?cm zSoAvuZH#7XZjE%+uBmX;i(m8rXXHv0O6@YwPRxtn>Z&3;b|5=C9;I09Q=XOB;!$g- zOixXv-DQGoN{+id$60J`*&GdKP_25#bgDa}!rC^;Y|ku0%=N82Icj=V##EKXeu#%Q zOcxrr3hH@oS5OsDuTbhyu38cp(ui(I%;LoJ^)F-Uo(TNGE zCy;bLScxCYWtMopKA||p#3+~e$s_WZI3>CC;PCpxm3UWf8q?+Env+pab8@b2qAB?7 zkMZ&G8p&&h7hmISkF~M&T94#$fiALea@lJP zN=&02gKwpE)`-J!hn23Xnq%SJj5YSvU(K96m2YOwlr~x>mUt#H@S@RZ6!}XLYusIA zjhJeB74JD_-fn3@o0()nm8;5QT*A%b+%4l3h&3K98f$ER5u%ND;pW?4&@8f>zoLyj zv4e=l2eDa8uY3KewgcOb zUVOW6%R?JWpHpJjDYp%;AJ~#DJv2Bx#7e_i;DJq>H}-Gp9~|!Q%MJ`?2ifqz!~OpO DXq++K literal 4381 zcmai13vg6d8NR2RY&QEMfh3SFW43{5eeuw`V1=;(q?W$8*&(~d+jh=LNJ}cDltgAA zw%pfl0+jadCOlG^5wT;-=v1bngAGGvw1XYdDs-@=@~~5_*y)TNYDF~QcOG}MORFZ? z&3DfE&;S1aa}GUE+tTz#YFbv>>(uK0LHFK536R$6+4%lL#?ZfDHUiDfQq3GU^iGXD zmod8TxqaYKdOkt5G+jii(sU-(#tlj=Yr1DQnV|2?(#>{LK{sg9uCoG|akAyRT1&h1 zf~RK;+G5vpIlqS-C_|H0lD6ast)6ZXn#|YnwHLCw2|_Vz6Y#byF@G{^TOE`TkQ{-+ zy3Rit!)m7lzio+tC0Jj|g5VN9^D_p_sI%}@>#o4W-5JBhzb#NBY0?&_9+os<^>!%Z zLNb|?)pHJMH>lQ319>koy}5~!oR^rI>%hK~*r(-urJM6j1;ZAak&W4*JZZN(MqDxi zzZQt+LQ8Tlw9MIDcd|P>m?Q0i?~s?Emzu!Z>fi?GI(AqI;&s3lHtAM)l^mklEmXUB zg_?*P0>iXA6&G4HuZ{&4VU(ihr<+|5xy%1t&&Z*y*|p>KZ!H3>0(^Dm_}Y4=?E^fw z{;>ss-&C-HRhtXHzb_J5{Fn?2Dra^&lonm26$-u^0S!D0{(I!a|W>6-^+DYYw*ZT8 zcY@=DIh+l~SFp5UM%!#fwek2v9^h-fFz!*c^zauKy$Of?0vmb*H+~oJYaIS;|NF{~ z>-O581LPdnfAZ%yL7S-0X2zlQXX@E?MJz3LXU75O0xn;3{2josg4p{spgwlbX29nF zyV5s&0@9xcTs1gjCuV=*bL4C=ZpG5#ooiMDJ`VVm{UZ+mKH*c%TQN5X32U&#A(rj} zT&Q2z1jyBIJ36TuuoG~RbN^j{>-@c3XNQzVa-f0ix=yM{|HY+|?%nhJry>|2x2Km<^7f4FHa2QLyM{EU=OVR?MSS zEQp@Ks&{1!4U@er&?6>S^2sq&cU!yH*vJc_Hc5LEd?3ohiNS?(d1lH)$~Lgz=Vi&rQ&z(+H!!)81((Tb7EIeL*qSkh zi{j9Pc0R?|C54p|*?K+^XttU-!?c_)Kh4YT0MOCHkR3<5;uvYL*`Shz%Lo3;1$v(H{gVIa@~~T{ILDoEj*06W3q7y)hF%#TM* z?u}rG+%96Ykc$kf#Yg11POB404qi(< ztfmY|_y#2<{Apip+-V`h=OT0oe^pXhgSbWy%EAg8YA(gXy)4{gv)aF+v#I)_)u@gH z5)W5ci+EcduFQ71BbOtFg9|TBZgJRdY()xQ(ZR7PSyku`9Y28ihg*?F@3*!XS&0YM4%zsL?<~Od$OsN(c z*VT%SRhIq{ezoT}fJnPce_q>WS^jc$B5Ng)i(<4$ehP~`E+@t%A}D@y$2C@z6<6dvU&#+AVhJ5p?)eer zszz1)mzPnQxzYKGQ?$)dHSke$qxVUolDSc3Kg^8|{6BM}Pk)TLEP6m{US@Ul+ZELk zJt6l^REx0ZFTTPbl=>5kJ|=x9~XO zPc^xidS$WLyE)NmhIJPEr)Xuo`=ZUZiH<>OSy6MB#S=|6OHllsmWT!4?wQYQdm&8$-=ba?}LDpK~@(WIm zcw2Czc{5`;1T}ByBcr=z$?%w6*|(}^-GhDiwoXpQ-)5(W#*Qo<3g?&o;M6mF7EWDy z+S~BPzpNvliZA)&CT&&UBWt>rXrW2k&Hbx;`jTCb^!Bf3UHwVmp0(@Nbg%91?eAWd O?CDMRvi_b8-Twh`Vxx-y diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index 2744dfac06..82ff6a76b0 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -444,13 +444,13 @@ contract ERC721Burnable is Dummy, ERC165 { } /// @dev inlined interface -contract ERC721MintableEvents { +contract ERC721UniqueMintableEvents { event MintingFinished(); } /// @title ERC721 minting logic. -/// @dev the ERC-165 identifier for this interface is 0x68ccfe89 -contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { +/// @dev the ERC-165 identifier for this interface is 0x476ff149 +contract ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents { /// @dev EVM selector for this function is: 0x05d2035b, /// or in textual repr: mintingFinished() function mintingFinished() public view returns (bool) { @@ -460,41 +460,63 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { } /// @notice Function to mint token. - /// @dev `tokenId` should be obtained with `nextTokenId` method, - /// unlike standard, you can't specify it manually /// @param to The new owner - /// @param tokenId ID of the minted NFT - /// @dev EVM selector for this function is: 0x40c10f19, - /// or in textual repr: mint(address,uint256) - function mint(address to, uint256 tokenId) public returns (bool) { + /// @return uint256 The id of the newly minted token + /// @dev EVM selector for this function is: 0x6a627842, + /// or in textual repr: mint(address) + function mint(address to) public returns (uint256) { require(false, stub_error); to; - tokenId; dummy = 0; - return false; + return 0; } + // /// @notice Function to mint token. + // /// @dev `tokenId` should be obtained with `nextTokenId` method, + // /// unlike standard, you can't specify it manually + // /// @param to The new owner + // /// @param tokenId ID of the minted NFT + // /// @dev EVM selector for this function is: 0x40c10f19, + // /// or in textual repr: mint(address,uint256) + // function mint(address to, uint256 tokenId) public returns (bool) { + // require(false, stub_error); + // to; + // tokenId; + // dummy = 0; + // return false; + // } + /// @notice Function to mint token with the given tokenUri. - /// @dev `tokenId` should be obtained with `nextTokenId` method, - /// unlike standard, you can't specify it manually /// @param to The new owner - /// @param tokenId ID of the minted NFT /// @param tokenUri Token URI that would be stored in the NFT properties - /// @dev EVM selector for this function is: 0x50bb4e7f, - /// or in textual repr: mintWithTokenURI(address,uint256,string) - function mintWithTokenURI( - address to, - uint256 tokenId, - string memory tokenUri - ) public returns (bool) { + /// @return uint256 The id of the newly minted token + /// @dev EVM selector for this function is: 0x45c17782, + /// or in textual repr: mintWithTokenURI(address,string) + function mintWithTokenURI(address to, string memory tokenUri) public returns (uint256) { require(false, stub_error); to; - tokenId; tokenUri; dummy = 0; - return false; + return 0; } + // /// @notice Function to mint token with the given tokenUri. + // /// @dev `tokenId` should be obtained with `nextTokenId` method, + // /// unlike standard, you can't specify it manually + // /// @param to The new owner + // /// @param tokenId ID of the minted NFT + // /// @param tokenUri Token URI that would be stored in the NFT properties + // /// @dev EVM selector for this function is: 0x50bb4e7f, + // /// or in textual repr: mintWithTokenURI(address,uint256,string) + // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) public returns (bool) { + // require(false, stub_error); + // to; + // tokenId; + // tokenUri; + // dummy = 0; + // return false; + // } + /// @dev Not implemented /// @dev EVM selector for this function is: 0x7d64bcb4, /// or in textual repr: finishMinting() @@ -563,36 +585,36 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { dummy; return 0; } + // /// @notice Function to mint multiple tokens. + // /// @dev `tokenIds` should be an array of consecutive numbers and first number + // /// should be obtained with `nextTokenId` method + // /// @param to The new owner + // /// @param tokenIds IDs of the minted NFTs + // /// @dev EVM selector for this function is: 0x44a9945e, + // /// or in textual repr: mintBulk(address,uint256[]) + // function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) { + // require(false, stub_error); + // to; + // tokenIds; + // dummy = 0; + // return false; + // } - /// @notice Function to mint multiple tokens. - /// @dev `tokenIds` should be an array of consecutive numbers and first number - /// should be obtained with `nextTokenId` method - /// @param to The new owner - /// @param tokenIds IDs of the minted NFTs - /// @dev EVM selector for this function is: 0x44a9945e, - /// or in textual repr: mintBulk(address,uint256[]) - function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) { - require(false, stub_error); - to; - tokenIds; - dummy = 0; - return false; - } + // /// @notice Function to mint multiple tokens with the given tokenUris. + // /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // /// numbers and first number should be obtained with `nextTokenId` method + // /// @param to The new owner + // /// @param tokens array of pairs of token ID and token URI for minted tokens + // /// @dev EVM selector for this function is: 0x36543006, + // /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) + // function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) public returns (bool) { + // require(false, stub_error); + // to; + // tokens; + // dummy = 0; + // return false; + // } - /// @notice Function to mint multiple tokens with the given tokenUris. - /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - /// numbers and first number should be obtained with `nextTokenId` method - /// @param to The new owner - /// @param tokens array of pairs of token ID and token URI for minted tokens - /// @dev EVM selector for this function is: 0x36543006, - /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) - function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) public returns (bool) { - require(false, stub_error); - to; - tokens; - dummy = 0; - return false; - } } /// @dev anonymous struct @@ -788,7 +810,7 @@ contract UniqueNFT is ERC721, ERC721Enumerable, ERC721UniqueExtensions, - ERC721Mintable, + ERC721UniqueMintable, ERC721Burnable, ERC721Metadata, Collection, diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index 6711598589c9e47cb5e83cf3f4246cf181016e6d..b37de5d021d35fe2eacb2151787e45f031ed5b99 100644 GIT binary patch literal 3840 zcmaJ^3vgUj8NP>oKZ@CqY>AsOYsyp^r93oXA>y`7fdPfPYqDGBqMnmYXoGDiX$;iZ z_C7Z)O6Trwnzlp7Y0FHpgQErOP}J#wNL#h)K%sQhKE{?u2XRKxPVE@tch0?cb5oJc z?B+Y?{O`wk(9<+mp!2D!X$8Aay8MrH$3jYgq)uDM@1Ki`{CTw%=(-Y>)G0;olgJN> zO8K5U#~!AqGgK*=bj(5&911u$cj{9K(4F1c#U zMTK_gDX!-Y=z%dbt7U12MQEs9BQ#rS;%m>AWEF&BRwt0HX=46pN!NNQAs{&bgJqe2 zi;9+~1b?|qKog=blt6F+-wqaA+A~_re!8rxQ^n`>C{$O7DL_Rpbqc zVN#Qu7aF{=i3R3k)J0FXtK|p3u;@=IM)sG~^5)}DECLJy{^6>rl_@6e0z5Um_7=eJ zxUhu<_W+)=&b{2iLfwGp_nq1Yco*Qssjoan%m} zdY54M(=UAr@O4kjy#2!`QtYxvK(%;s#d5&w0O`*3Fksw;VBk)b3!nT1OyB|PAD=gg z+4X?S%zNJwHj0jP#9-+TEG>EQ5go7>@ZJ?i-UclD^0nP*L zmd||~kbAPo_}Z5N7XmIe7hDb)@x(;0Z2k`nJ&UC)ew^z9Jm5k%Y;z08#sFW(?3L*` zNUDfy=QUd{0{+`C24n77?CVec1dta*>Y61Lz|Xi;ePojBZUe@MZ)A)S>PT%8E)Z| zqiEq=-fnH>T}(Jus{#9cLB|(ogoOXaM->*T3lq<%q>BeO>5{iA4#kKS$A^_=m&ZfR>&}LZkcfcPu%p&AQnPCX;>M=Jf@efh zc#wI7XUt77KJu~_nH8?Y_h(W5m5)48j`7~ek>VvPndX!`oiO91$oJiz`5k>TgK!54 z3#~+ElR1$~UJW?lBz~U!KPviBi*R4niC#cS;wP(tY;^BA zjo=)R61dDjb1MtG`yUI>(OKw3QK{F&c?at}3Vsft^tCQggQqirHZ2W-;W^H{{~-1q z-?=U8YD7Yr+I4nss3r~9bd~9IZ3zoftg@s@8 zWTU@WxCh6xRxoMSs1T9@>2X&A&Ej~^8ssJ_Rr$$Js&=)|a1h6yVeuG5q7J>@Rh2n; z*DS>m*MAnd!O|;GXBCyIEZ5|kxN1mRUNw;kaerVDTvf7~MKqGH7zBwSEP|reaA{zX z5vYOuaY71;OgltyP_W#v8YChXSrm(e$Z{)87U{-RBM*@uIabPDB3`PK4%ENMhL>KX zs^Qithk-@jF<9iMMP-6!>vo-V)i23#)b(G~04L-^BudQ+k51I}-{`6#I;Jl=DsEXU zy2RBI&5s)!obc3TnyU~*)1g@A8qT646@Aki=3vCk)u{k>l(WgBv&yDM@ zmI+yA(Sx|pp}SDHHH=>4dc~-U(O)QaN48wsT%AD9F7YjPnJYGyK)B&Kgv8o-*@zL! zAqR)S&Ho%;w`OA94yQh2r*Jmb<4L3yWLi`U!U2h1IAWs?h3qe=nKZ{XJIiRd=~;c| z%WTZON3hs0oy>kz-HK#3;v4&?XWx`1e5}hXo)AHF{HHl#Dy8^0s}JG}T+aB-jTG=c z@CVinPW(QPw9jy}fxGbklulfAU9I5$U2(cU?&e?X5iKT`{aC%$x`R+m5GtfzR6(v03~WHpWSQEykzO$&JoQ zv^jEo$>j~4aNjK~(cRbyuv>~Pqs(_Wk*`G2VOIT{gtwU{R=Y0Gj&0&GXPPA@O&!I@ z_m~OZrf$KyaZNn);dUMNxL@1-Fsu7RD)?9nLEwRSYVkycrfzuSy-O;#)e&o-7^-*~lI1?oK7tSM!@LJV;y(eMUI zZZGlo5=%Z?Vo7v0oyHSLFPN>ZNWV@dWoK6UF6Xeb*mo;<9kJvaC9TKg2O-kC5hve) zqGFIO{Pi}mZ7UC?_!K|b)jzoEfz?Ypo3r)9KiqWo;I?l*I)BS=?*H5O-u&WQFZ}9U z&r+$Hdh&`_k1HGcS3k6(e47;gnDn`k<%6rU<%fnwhFN(e3p}`T)rx_Y14APN{n^2x L><}9n93A*C8c0Yi literal 4408 zcmai14RBP&9l!N*-yg{V3B;r3_^3G30=D)*5r+e7i&F9BhTLhNrMtOAgh>EH%#@~- z_jPxPjP%_lASff0&WKc>e0qkrPD*6 z&8daeD+eE;7n0PIrORnUmd>S~ag`EXpJ^K{8t6Oobi2_~QB;~TnshH_%zQo9>>8I+ zv6Y-k+l&O)a~67F3{B}N+EyggH&Z7xRchjEFXj~ugkshpkge-t{&e2ZJ18L_`56pW z6#nE?y`2(#GD)v4L|@K>;4+@YITda+>G%m*YcO$dPPOoF7-pn2+GZx;$uz94gfSL0 zlZAPuXp(l7dRnQsWG82~wop>ElhcbG;5!XIPti5HwbW8k4PhDCnjb2WcB5m|BBO|F zh1eFXB=^J0qQPw^d-CNXX%}*b>?FP10?~R0cR*3Vp(lym0bf|-R}ocmgnDkHo)12z z8uEt3Fi(?{7uv9>iFqHyC`~WS)CyhYIlB{#oX%^7U4M9LIbZ|e8*|5d6U=iE@ONtX>F~BoR zb|x^JbEyt~cB~s3&S8l|EcF2%_U$_ghW7!V8@Tc+;0eHA59Zzif#&jZn;o%x5wK$-W$IM4KIL-Lohtb;V%yV-HF}i1IFi|cOGW@ zZaO{>Fzxd4Y=G)KmeyJK{ngR1;nwAU!tCE%syRpc-b%3RxP}$hf;b>|=f0j(7Xd%* zKrs9mP&vAKJK%9Z`rVd3z&8O4*;zM0_z71c7lWlcu(V=#&%=Ow0l#>7bS>Z^muk_P zoBhyG#uA5ES_imPx%5py?qudzV=Le`z~$!Gz5=+z<>fYG%rz_wEPDu$+q|&NhjPAH~l&kTYgg4r1@F)op3WA^+ft^h8q7bD!$3Zb=! zegw$NC^7%85+HM^I>}B;47CEedg2h^0Em2#9V-IzO7Q*Gt2)rn5^n-NgIWLhIWOQ? z9=(i>j(Pi;che%;!2DUXpYO$->cQkN^IBrEpHH4a<7e9K=4Rgegk!DZwLcJad~rfZ zV33bqX1)&u3-j)(*en?5lV=@~!C7KS>{$nrUc1sFq=K|wP_TW{NQiYU4erKT!>pQJ z|A{|zT|Iwj^Q6)9l3%(gHMtIlZ<3Te5EEgTY)xc-y)^F61Z9M8VzAATJ$Vg5nFv*M z*`(1k^`qEwjC@|^Z{o4i+6}qIBU~a_RqWAKomA~=mdLnGXmk^BCr_V92hYWX+SpTk zqDCwp!$I1@_AM`h&jidH@@3oaX$K z;fJzeG);%PGkHAB|1=Lo)|O4sW)RwjlkgMNfrdN_peZG_W4S@wOfrQ9J~hcKp`)1v z7J*}t;9!BfanBHv(XY&p>kaN27EPHYLJ}Zd>jL^W(*dru8a!nZoA9p z_;04G2#z%o91S-;7Ie-i7W{qL9Fox)QD~+_5KBq%o?|x)UM?Bs`T#0bN0&ymVwo!o z&5*>_q!fe}I0lB6lnqD8sG_jY-MCUB|ETRMMtQDQj4Bv)Q|gRtrMjy!ii}<3S*YlW z-DwHGxsZLlX2b}!kb%44<{!!H6in#nlGCV}DO?SmaRt6zLYhUXAQ%wn1|xJ?QYiJ+ zgjhSh#3LHMA&*DYxk7zO6bJ7mo>omJB)rto628kd8`oXvaHR-a!nnEf15hvHhFzA8 z6&`Tr(kwj8!j{3pKJ08x|4<*gBZ64k_Am_?F#EnVd09R3ww z(#O>j(H{4r%gOLm%>L1tW#PA(e=MgC86>S|hw)n$Tvy!nNboy5c)yA$89PW;v9d~~ zMDS%{oM4Lf1iw7|6Lz2is zGwP%?l|}Z-2`$YchiW0>Z!#h}1~G|kB057nI+0f;an&MK)v$PY-pQM3Bg-f7ieR${ znqS*>jTd#z6%9H@MiUdcgpE$^xf$iAMxFkzZzJw5zE1N*J6vIFi=u)@6c+6fEyBAR z?VAymNNHWM2+_{|$D&Wx`ipOI^%6(Q}fh7S*VG`%bgy`2UM) zY^LO%6jc`cybMrXaAUZA)FnK&M)FNGCHF11!7(^CP}{z74vKBQa20=|eqy$y(&~41 zx7uPa$VF6J?aYJVyF7o-X7P9Ptg#s>xr$e3BWpD`WBW45 zZbi;|c5n_mg`={>cap}&yuQZb7n~xohjF9%FsGUXJ+CUGd-uqe;lcd)VAuN14{f=B z_LNjEb8#rP|76Gh&vYJb`1ZbVy!GoJt-A93sd=~Fv!8uA`C8YOO+AG>J;6rLE&UI# m-;ye9+SuR63jHbI^}U;Wx_i4f_IG!s)^AL0Wc}+0y8jK{hN*7= diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index c93b461651..ab2a9df35a 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -442,13 +442,13 @@ contract ERC721Burnable is Dummy, ERC165 { } /// @dev inlined interface -contract ERC721MintableEvents { +contract ERC721UniqueMintableEvents { event MintingFinished(); } /// @title ERC721 minting logic. -/// @dev the ERC-165 identifier for this interface is 0x68ccfe89 -contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { +/// @dev the ERC-165 identifier for this interface is 0x476ff149 +contract ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents { /// @dev EVM selector for this function is: 0x05d2035b, /// or in textual repr: mintingFinished() function mintingFinished() public view returns (bool) { @@ -458,41 +458,63 @@ contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { } /// @notice Function to mint token. - /// @dev `tokenId` should be obtained with `nextTokenId` method, - /// unlike standard, you can't specify it manually /// @param to The new owner - /// @param tokenId ID of the minted RFT - /// @dev EVM selector for this function is: 0x40c10f19, - /// or in textual repr: mint(address,uint256) - function mint(address to, uint256 tokenId) public returns (bool) { + /// @return uint256 The id of the newly minted token + /// @dev EVM selector for this function is: 0x6a627842, + /// or in textual repr: mint(address) + function mint(address to) public returns (uint256) { require(false, stub_error); to; - tokenId; dummy = 0; - return false; + return 0; } + // /// @notice Function to mint token. + // /// @dev `tokenId` should be obtained with `nextTokenId` method, + // /// unlike standard, you can't specify it manually + // /// @param to The new owner + // /// @param tokenId ID of the minted RFT + // /// @dev EVM selector for this function is: 0x40c10f19, + // /// or in textual repr: mint(address,uint256) + // function mint(address to, uint256 tokenId) public returns (bool) { + // require(false, stub_error); + // to; + // tokenId; + // dummy = 0; + // return false; + // } + /// @notice Function to mint token with the given tokenUri. - /// @dev `tokenId` should be obtained with `nextTokenId` method, - /// unlike standard, you can't specify it manually /// @param to The new owner - /// @param tokenId ID of the minted RFT - /// @param tokenUri Token URI that would be stored in the RFT properties - /// @dev EVM selector for this function is: 0x50bb4e7f, - /// or in textual repr: mintWithTokenURI(address,uint256,string) - function mintWithTokenURI( - address to, - uint256 tokenId, - string memory tokenUri - ) public returns (bool) { + /// @param tokenUri Token URI that would be stored in the NFT properties + /// @return uint256 The id of the newly minted token + /// @dev EVM selector for this function is: 0x45c17782, + /// or in textual repr: mintWithTokenURI(address,string) + function mintWithTokenURI(address to, string memory tokenUri) public returns (uint256) { require(false, stub_error); to; - tokenId; tokenUri; dummy = 0; - return false; + return 0; } + // /// @notice Function to mint token with the given tokenUri. + // /// @dev `tokenId` should be obtained with `nextTokenId` method, + // /// unlike standard, you can't specify it manually + // /// @param to The new owner + // /// @param tokenId ID of the minted RFT + // /// @param tokenUri Token URI that would be stored in the RFT properties + // /// @dev EVM selector for this function is: 0x50bb4e7f, + // /// or in textual repr: mintWithTokenURI(address,uint256,string) + // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) public returns (bool) { + // require(false, stub_error); + // to; + // tokenId; + // tokenUri; + // dummy = 0; + // return false; + // } + /// @dev Not implemented /// @dev EVM selector for this function is: 0x7d64bcb4, /// or in textual repr: finishMinting() @@ -564,35 +586,35 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { return 0; } - /// @notice Function to mint multiple tokens. - /// @dev `tokenIds` should be an array of consecutive numbers and first number - /// should be obtained with `nextTokenId` method - /// @param to The new owner - /// @param tokenIds IDs of the minted RFTs - /// @dev EVM selector for this function is: 0x44a9945e, - /// or in textual repr: mintBulk(address,uint256[]) - function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) { - require(false, stub_error); - to; - tokenIds; - dummy = 0; - return false; - } + // /// @notice Function to mint multiple tokens. + // /// @dev `tokenIds` should be an array of consecutive numbers and first number + // /// should be obtained with `nextTokenId` method + // /// @param to The new owner + // /// @param tokenIds IDs of the minted RFTs + // /// @dev EVM selector for this function is: 0x44a9945e, + // /// or in textual repr: mintBulk(address,uint256[]) + // function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) { + // require(false, stub_error); + // to; + // tokenIds; + // dummy = 0; + // return false; + // } - /// @notice Function to mint multiple tokens with the given tokenUris. - /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - /// numbers and first number should be obtained with `nextTokenId` method - /// @param to The new owner - /// @param tokens array of pairs of token ID and token URI for minted tokens - /// @dev EVM selector for this function is: 0x36543006, - /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) - function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) public returns (bool) { - require(false, stub_error); - to; - tokens; - dummy = 0; - return false; - } + // /// @notice Function to mint multiple tokens with the given tokenUris. + // /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // /// numbers and first number should be obtained with `nextTokenId` method + // /// @param to The new owner + // /// @param tokens array of pairs of token ID and token URI for minted tokens + // /// @dev EVM selector for this function is: 0x36543006, + // /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) + // function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) public returns (bool) { + // require(false, stub_error); + // to; + // tokens; + // dummy = 0; + // return false; + // } /// Returns EVM address for refungible token /// @@ -798,7 +820,7 @@ contract UniqueRefungible is ERC721, ERC721Enumerable, ERC721UniqueExtensions, - ERC721Mintable, + ERC721UniqueMintable, ERC721Burnable, ERC721Metadata, Collection, diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index 8e727d83a8..718b3ac0b6 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -297,39 +297,50 @@ interface ERC721Burnable is Dummy, ERC165 { } /// @dev inlined interface -interface ERC721MintableEvents { +interface ERC721UniqueMintableEvents { event MintingFinished(); } /// @title ERC721 minting logic. -/// @dev the ERC-165 identifier for this interface is 0x68ccfe89 -interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { +/// @dev the ERC-165 identifier for this interface is 0x476ff149 +interface ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents { /// @dev EVM selector for this function is: 0x05d2035b, /// or in textual repr: mintingFinished() function mintingFinished() external view returns (bool); /// @notice Function to mint token. - /// @dev `tokenId` should be obtained with `nextTokenId` method, - /// unlike standard, you can't specify it manually /// @param to The new owner - /// @param tokenId ID of the minted NFT - /// @dev EVM selector for this function is: 0x40c10f19, - /// or in textual repr: mint(address,uint256) - function mint(address to, uint256 tokenId) external returns (bool); + /// @return uint256 The id of the newly minted token + /// @dev EVM selector for this function is: 0x6a627842, + /// or in textual repr: mint(address) + function mint(address to) external returns (uint256); + + // /// @notice Function to mint token. + // /// @dev `tokenId` should be obtained with `nextTokenId` method, + // /// unlike standard, you can't specify it manually + // /// @param to The new owner + // /// @param tokenId ID of the minted NFT + // /// @dev EVM selector for this function is: 0x40c10f19, + // /// or in textual repr: mint(address,uint256) + // function mint(address to, uint256 tokenId) external returns (bool); /// @notice Function to mint token with the given tokenUri. - /// @dev `tokenId` should be obtained with `nextTokenId` method, - /// unlike standard, you can't specify it manually /// @param to The new owner - /// @param tokenId ID of the minted NFT /// @param tokenUri Token URI that would be stored in the NFT properties - /// @dev EVM selector for this function is: 0x50bb4e7f, - /// or in textual repr: mintWithTokenURI(address,uint256,string) - function mintWithTokenURI( - address to, - uint256 tokenId, - string memory tokenUri - ) external returns (bool); + /// @return uint256 The id of the newly minted token + /// @dev EVM selector for this function is: 0x45c17782, + /// or in textual repr: mintWithTokenURI(address,string) + function mintWithTokenURI(address to, string memory tokenUri) external returns (uint256); + + // /// @notice Function to mint token with the given tokenUri. + // /// @dev `tokenId` should be obtained with `nextTokenId` method, + // /// unlike standard, you can't specify it manually + // /// @param to The new owner + // /// @param tokenId ID of the minted NFT + // /// @param tokenUri Token URI that would be stored in the NFT properties + // /// @dev EVM selector for this function is: 0x50bb4e7f, + // /// or in textual repr: mintWithTokenURI(address,uint256,string) + // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) external returns (bool); /// @dev Not implemented /// @dev EVM selector for this function is: 0x7d64bcb4, @@ -373,24 +384,24 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { /// @dev EVM selector for this function is: 0x75794a3c, /// or in textual repr: nextTokenId() function nextTokenId() external view returns (uint256); + // /// @notice Function to mint multiple tokens. + // /// @dev `tokenIds` should be an array of consecutive numbers and first number + // /// should be obtained with `nextTokenId` method + // /// @param to The new owner + // /// @param tokenIds IDs of the minted NFTs + // /// @dev EVM selector for this function is: 0x44a9945e, + // /// or in textual repr: mintBulk(address,uint256[]) + // function mintBulk(address to, uint256[] memory tokenIds) external returns (bool); + + // /// @notice Function to mint multiple tokens with the given tokenUris. + // /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // /// numbers and first number should be obtained with `nextTokenId` method + // /// @param to The new owner + // /// @param tokens array of pairs of token ID and token URI for minted tokens + // /// @dev EVM selector for this function is: 0x36543006, + // /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) + // function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) external returns (bool); - /// @notice Function to mint multiple tokens. - /// @dev `tokenIds` should be an array of consecutive numbers and first number - /// should be obtained with `nextTokenId` method - /// @param to The new owner - /// @param tokenIds IDs of the minted NFTs - /// @dev EVM selector for this function is: 0x44a9945e, - /// or in textual repr: mintBulk(address,uint256[]) - function mintBulk(address to, uint256[] memory tokenIds) external returns (bool); - - /// @notice Function to mint multiple tokens with the given tokenUris. - /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - /// numbers and first number should be obtained with `nextTokenId` method - /// @param to The new owner - /// @param tokens array of pairs of token ID and token URI for minted tokens - /// @dev EVM selector for this function is: 0x36543006, - /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) - function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) external returns (bool); } /// @dev anonymous struct @@ -521,7 +532,7 @@ interface UniqueNFT is ERC721, ERC721Enumerable, ERC721UniqueExtensions, - ERC721Mintable, + ERC721UniqueMintable, ERC721Burnable, ERC721Metadata, Collection, diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index 3be0a23d0c..2cb52a5fa5 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -295,39 +295,50 @@ interface ERC721Burnable is Dummy, ERC165 { } /// @dev inlined interface -interface ERC721MintableEvents { +interface ERC721UniqueMintableEvents { event MintingFinished(); } /// @title ERC721 minting logic. -/// @dev the ERC-165 identifier for this interface is 0x68ccfe89 -interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents { +/// @dev the ERC-165 identifier for this interface is 0x476ff149 +interface ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents { /// @dev EVM selector for this function is: 0x05d2035b, /// or in textual repr: mintingFinished() function mintingFinished() external view returns (bool); /// @notice Function to mint token. - /// @dev `tokenId` should be obtained with `nextTokenId` method, - /// unlike standard, you can't specify it manually /// @param to The new owner - /// @param tokenId ID of the minted RFT - /// @dev EVM selector for this function is: 0x40c10f19, - /// or in textual repr: mint(address,uint256) - function mint(address to, uint256 tokenId) external returns (bool); + /// @return uint256 The id of the newly minted token + /// @dev EVM selector for this function is: 0x6a627842, + /// or in textual repr: mint(address) + function mint(address to) external returns (uint256); + + // /// @notice Function to mint token. + // /// @dev `tokenId` should be obtained with `nextTokenId` method, + // /// unlike standard, you can't specify it manually + // /// @param to The new owner + // /// @param tokenId ID of the minted RFT + // /// @dev EVM selector for this function is: 0x40c10f19, + // /// or in textual repr: mint(address,uint256) + // function mint(address to, uint256 tokenId) external returns (bool); /// @notice Function to mint token with the given tokenUri. - /// @dev `tokenId` should be obtained with `nextTokenId` method, - /// unlike standard, you can't specify it manually /// @param to The new owner - /// @param tokenId ID of the minted RFT - /// @param tokenUri Token URI that would be stored in the RFT properties - /// @dev EVM selector for this function is: 0x50bb4e7f, - /// or in textual repr: mintWithTokenURI(address,uint256,string) - function mintWithTokenURI( - address to, - uint256 tokenId, - string memory tokenUri - ) external returns (bool); + /// @param tokenUri Token URI that would be stored in the NFT properties + /// @return uint256 The id of the newly minted token + /// @dev EVM selector for this function is: 0x45c17782, + /// or in textual repr: mintWithTokenURI(address,string) + function mintWithTokenURI(address to, string memory tokenUri) external returns (uint256); + + // /// @notice Function to mint token with the given tokenUri. + // /// @dev `tokenId` should be obtained with `nextTokenId` method, + // /// unlike standard, you can't specify it manually + // /// @param to The new owner + // /// @param tokenId ID of the minted RFT + // /// @param tokenUri Token URI that would be stored in the RFT properties + // /// @dev EVM selector for this function is: 0x50bb4e7f, + // /// or in textual repr: mintWithTokenURI(address,uint256,string) + // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) external returns (bool); /// @dev Not implemented /// @dev EVM selector for this function is: 0x7d64bcb4, @@ -374,23 +385,23 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { /// or in textual repr: nextTokenId() function nextTokenId() external view returns (uint256); - /// @notice Function to mint multiple tokens. - /// @dev `tokenIds` should be an array of consecutive numbers and first number - /// should be obtained with `nextTokenId` method - /// @param to The new owner - /// @param tokenIds IDs of the minted RFTs - /// @dev EVM selector for this function is: 0x44a9945e, - /// or in textual repr: mintBulk(address,uint256[]) - function mintBulk(address to, uint256[] memory tokenIds) external returns (bool); - - /// @notice Function to mint multiple tokens with the given tokenUris. - /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - /// numbers and first number should be obtained with `nextTokenId` method - /// @param to The new owner - /// @param tokens array of pairs of token ID and token URI for minted tokens - /// @dev EVM selector for this function is: 0x36543006, - /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) - function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) external returns (bool); + // /// @notice Function to mint multiple tokens. + // /// @dev `tokenIds` should be an array of consecutive numbers and first number + // /// should be obtained with `nextTokenId` method + // /// @param to The new owner + // /// @param tokenIds IDs of the minted RFTs + // /// @dev EVM selector for this function is: 0x44a9945e, + // /// or in textual repr: mintBulk(address,uint256[]) + // function mintBulk(address to, uint256[] memory tokenIds) external returns (bool); + + // /// @notice Function to mint multiple tokens with the given tokenUris. + // /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // /// numbers and first number should be obtained with `nextTokenId` method + // /// @param to The new owner + // /// @param tokens array of pairs of token ID and token URI for minted tokens + // /// @dev EVM selector for this function is: 0x36543006, + // /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) + // function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) external returns (bool); /// Returns EVM address for refungible token /// @@ -526,7 +537,7 @@ interface UniqueRefungible is ERC721, ERC721Enumerable, ERC721UniqueExtensions, - ERC721Mintable, + ERC721UniqueMintable, ERC721Burnable, ERC721Metadata, Collection, diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index ca34512c03..475fafde5a 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -260,51 +260,19 @@ "type": "function" }, { - "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" } - ], + "inputs": [{ "internalType": "address", "name": "to", "type": "address" }], "name": "mint", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256[]", "name": "tokenIds", "type": "uint256[]" } - ], - "name": "mintBulk", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { - "components": [ - { "internalType": "uint256", "name": "field_0", "type": "uint256" }, - { "internalType": "string", "name": "field_1", "type": "string" } - ], - "internalType": "struct Tuple6[]", - "name": "tokens", - "type": "tuple[]" - } - ], - "name": "mintBulkWithTokenURI", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "string", "name": "tokenUri", "type": "string" } ], "name": "mintWithTokenURI", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index 47eb3e3272..be3e7524a7 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -260,51 +260,19 @@ "type": "function" }, { - "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" } - ], + "inputs": [{ "internalType": "address", "name": "to", "type": "address" }], "name": "mint", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256[]", "name": "tokenIds", "type": "uint256[]" } - ], - "name": "mintBulk", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { - "components": [ - { "internalType": "uint256", "name": "field_0", "type": "uint256" }, - { "internalType": "string", "name": "field_1", "type": "string" } - ], - "internalType": "struct Tuple6[]", - "name": "tokens", - "type": "tuple[]" - } - ], - "name": "mintBulkWithTokenURI", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "string", "name": "tokenUri", "type": "string" } ], "name": "mintWithTokenURI", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, From 9d4aa0e3b2241a9b67e068c23803160717ecac3f Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 13 Oct 2022 17:23:12 +0000 Subject: [PATCH 1135/1274] fix: sponsoring for newly added mint methods Signed-off-by: Yaroslav Bolyukin --- runtime/common/ethereum/sponsoring.rs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/runtime/common/ethereum/sponsoring.rs b/runtime/common/ethereum/sponsoring.rs index 89080eb5fb..a78d8606d7 100644 --- a/runtime/common/ethereum/sponsoring.rs +++ b/runtime/common/ethereum/sponsoring.rs @@ -24,7 +24,7 @@ use pallet_evm_transaction_payment::CallContext; use pallet_nonfungible::{ Config as NonfungibleConfig, erc::{ - UniqueNFTCall, ERC721UniqueExtensionsCall, ERC721MintableCall, ERC721Call, + UniqueNFTCall, ERC721UniqueExtensionsCall, ERC721UniqueMintableCall, ERC721Call, TokenPropertiesCall, }, }; @@ -82,18 +82,17 @@ impl let token_id: TokenId = token_id.try_into().ok()?; withdraw_transfer::(&collection, &who, &token_id).map(|()| sponsor) } - UniqueNFTCall::ERC721Mintable( - ERC721MintableCall::Mint { token_id, .. } - | ERC721MintableCall::MintWithTokenUri { token_id, .. }, - ) => { - let _token_id: TokenId = token_id.try_into().ok()?; - withdraw_create_item::( - &collection, - &who, - &CreateItemData::NFT(CreateNftData::default()), - ) - .map(|()| sponsor) - } + UniqueNFTCall::ERC721UniqueMintable( + ERC721UniqueMintableCall::Mint { .. } + | ERC721UniqueMintableCall::MintCheckId { .. } + | ERC721UniqueMintableCall::MintWithTokenUri { .. } + | ERC721UniqueMintableCall::MintWithTokenUriCheckId { .. }, + ) => withdraw_create_item::( + &collection, + &who, + &CreateItemData::NFT(CreateNftData::default()), + ) + .map(|()| sponsor), UniqueNFTCall::ERC721(ERC721Call::TransferFrom { token_id, from, .. }) => { let token_id: TokenId = token_id.try_into().ok()?; let from = T::CrossAccountId::from_eth(from); From 503c92cd6363682e6d950ca9ef12c8380ca5079e Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 14 Oct 2022 08:28:30 +0000 Subject: [PATCH 1136/1274] feat: remove schemaName/schemaVersion Signed-off-by: Yaroslav Bolyukin --- pallets/common/src/erc.rs | 36 ------------------- pallets/nonfungible/src/erc.rs | 5 +-- pallets/refungible/src/erc.rs | 2 +- pallets/unique/src/eth/mod.rs | 65 +++++++++++----------------------- 4 files changed, 22 insertions(+), 86 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index ca43160581..ed30511ff6 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -660,16 +660,6 @@ pub mod static_property { pub mod key { use super::*; - /// Key "schemaName". - pub fn schema_name() -> up_data_structs::PropertyKey { - property_key_from_bytes(b"schemaName").expect(EXPECT_CONVERT_ERROR) - } - - /// Key "schemaVersion". - pub fn schema_version() -> up_data_structs::PropertyKey { - property_key_from_bytes(b"schemaVersion").expect(EXPECT_CONVERT_ERROR) - } - /// Key "baseURI". pub fn base_uri() -> up_data_structs::PropertyKey { property_key_from_bytes(b"baseURI").expect(EXPECT_CONVERT_ERROR) @@ -689,32 +679,6 @@ pub mod static_property { pub fn parent_nft() -> up_data_structs::PropertyKey { property_key_from_bytes(b"parentNft").expect(EXPECT_CONVERT_ERROR) } - - /// Key "ERC721Metadata". - pub fn erc721_metadata() -> up_data_structs::PropertyKey { - property_key_from_bytes(b"ERC721Metadata").expect(EXPECT_CONVERT_ERROR) - } - } - - /// Values. - pub mod value { - use super::*; - - /// Value "Schema version". - pub const SCHEMA_VERSION: &[u8] = b"1.0.0"; - - /// Value "ERC721Metadata". - pub const ERC721_METADATA: &[u8] = b"ERC721Metadata"; - - /// Value for [`ERC721_METADATA`]. - pub fn erc721() -> up_data_structs::PropertyValue { - property_value_from_bytes(ERC721_METADATA).expect(EXPECT_CONVERT_ERROR) - } - - /// Value for [`SCHEMA_VERSION`]. - pub fn schema_version() -> up_data_structs::PropertyValue { - property_value_from_bytes(SCHEMA_VERSION).expect(EXPECT_CONVERT_ERROR) - } } /// Convert `byte` to [`PropertyKey`]. diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 2ac74804ef..677efc6c0d 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -33,10 +33,7 @@ use up_data_structs::{ use pallet_evm_coder_substrate::dispatch_to_evm; use sp_std::vec::Vec; use pallet_common::{ - erc::{ - CommonEvmHandler, PrecompileResult, CollectionCall, static_property::key, - static_property::value, - }, + erc::{CommonEvmHandler, PrecompileResult, CollectionCall, static_property::key}, CollectionHandle, CollectionPropertyPermissions, }; use pallet_evm::{account::CrossAccountId, PrecompileHandle}; diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index e37f1be021..8f36ac549d 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -29,7 +29,7 @@ use evm_coder::{ToLog, execution::*, generate_stubgen, solidity, solidity_interf use frame_support::{BoundedBTreeMap, BoundedVec}; use pallet_common::{ CollectionHandle, CollectionPropertyPermissions, - erc::{CommonEvmHandler, CollectionCall, static_property::key, static_property::value}, + erc::{CommonEvmHandler, CollectionCall, static_property::key}, }; use pallet_evm::{account::CrossAccountId, PrecompileHandle}; use pallet_evm_coder_substrate::{call, dispatch_to_evm}; diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index d748ceb983..93f1267e2c 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -25,7 +25,7 @@ use pallet_common::{ dispatch::CollectionDispatch, erc::{ CollectionHelpersEvents, - static_property::{key, value as property_value}, + static_property::{key}, }, Pallet as PalletCommon, }; @@ -125,26 +125,13 @@ fn make_data( } else { up_data_structs::CollectionPropertiesPermissionsVec::default() }; - let properties = if add_properties { - let mut properties = vec![ - up_data_structs::Property { - key: key::schema_name(), - value: property_value::erc721(), - }, - up_data_structs::Property { - key: key::schema_version(), - value: property_value::schema_version(), - }, - ]; - if !base_uri_value.is_empty() { - properties.push(up_data_structs::Property { - key: key::base_uri(), - value: base_uri_value, - }) - } - properties - .try_into() - .map_err(|e| Error::Revert(format!("{:?}", e)))? + let properties = if add_properties && !base_uri_value.is_empty() { + vec![up_data_structs::Property { + key: key::base_uri(), + value: base_uri_value, + }] + .try_into() + .expect("limit >= 1") } else { up_data_structs::CollectionPropertiesVec::default() }; @@ -404,32 +391,20 @@ where } let all_properties = >::get(collection.id); - let mut new_properties = vec![]; - if all_properties.get(&key::schema_name()).is_none() { - self.recorder().consume_sstore()?; - new_properties.push(up_data_structs::Property { - key: key::schema_name(), - value: property_value::erc721(), - }); - new_properties.push(up_data_structs::Property { - key: key::schema_version(), - value: property_value::schema_version(), - }); - } if all_properties.get(&key::base_uri()).is_none() && !base_uri.is_empty() { - new_properties.push(up_data_structs::Property { - key: key::base_uri(), - value: base_uri - .into_bytes() - .try_into() - .map_err(|_| "base uri is too large")?, - }); - } - - if !new_properties.is_empty() { self.recorder().consume_sstore()?; - >::set_collection_properties(&collection, &caller, new_properties) - .map_err(dispatch_to_evm::)?; + >::set_collection_properties( + &collection, + &caller, + vec![up_data_structs::Property { + key: key::base_uri(), + value: base_uri + .into_bytes() + .try_into() + .map_err(|_| "base uri is too large")?, + }], + ) + .map_err(dispatch_to_evm::)?; } self.recorder().consume_sstore()?; From 6bf51e4b62d4d99d0dd2e55b203c2420af61c387 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 14 Oct 2022 08:41:51 +0000 Subject: [PATCH 1137/1274] feat: remove collection with metadata creation Signed-off-by: Yaroslav Bolyukin --- pallets/unique/src/eth/mod.rs | 200 +++++++--------------------------- 1 file changed, 41 insertions(+), 159 deletions(-) diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 93f1267e2c..2724e6c0ea 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -59,13 +59,11 @@ fn convert_data( name: string, description: string, token_prefix: string, - base_uri: string, ) -> Result<( T::CrossAccountId, CollectionName, CollectionDescription, CollectionTokenPrefix, - PropertyValue, )> { let caller = T::CrossAccountId::from_eth(caller); let name = name @@ -83,69 +81,7 @@ fn convert_data( let token_prefix = token_prefix.into_bytes().try_into().map_err(|_| { error_field_too_long(stringify!(token_prefix), CollectionTokenPrefix::bound()) })?; - let base_uri_value = base_uri - .into_bytes() - .try_into() - .map_err(|_| error_field_too_long(stringify!(token_prefix), PropertyValue::bound()))?; - Ok((caller, name, description, token_prefix, base_uri_value)) -} - -fn default_url_pkp() -> up_data_structs::PropertyKeyPermission { - up_data_structs::PropertyKeyPermission { - key: key::url(), - permission: up_data_structs::PropertyPermission { - mutable: true, - collection_admin: true, - token_owner: false, - }, - } -} -fn default_suffix_pkp() -> up_data_structs::PropertyKeyPermission { - up_data_structs::PropertyKeyPermission { - key: key::suffix(), - permission: up_data_structs::PropertyPermission { - mutable: true, - collection_admin: true, - token_owner: false, - }, - } -} -fn make_data( - name: CollectionName, - mode: CollectionMode, - description: CollectionDescription, - token_prefix: CollectionTokenPrefix, - base_uri_value: PropertyValue, - add_properties: bool, -) -> Result> { - let token_property_permissions = if add_properties { - vec![default_url_pkp(), default_suffix_pkp()] - .try_into() - .map_err(|e| Error::Revert(format!("{:?}", e)))? - } else { - up_data_structs::CollectionPropertiesPermissionsVec::default() - }; - let properties = if add_properties && !base_uri_value.is_empty() { - vec![up_data_structs::Property { - key: key::base_uri(), - value: base_uri_value, - }] - .try_into() - .expect("limit >= 1") - } else { - up_data_structs::CollectionPropertiesVec::default() - }; - - let data = CreateCollectionData { - name, - mode, - description, - token_prefix, - token_property_permissions, - properties, - ..Default::default() - }; - Ok(data) + Ok((caller, name, description, token_prefix)) } fn create_refungible_collection_internal< @@ -156,19 +92,16 @@ fn create_refungible_collection_internal< name: string, description: string, token_prefix: string, - base_uri: string, - add_properties: bool, ) -> Result
{ - let (caller, name, description, token_prefix, base_uri_value) = - convert_data::(caller, name, description, token_prefix, base_uri)?; - let data = make_data::( + let (caller, name, description, token_prefix) = + convert_data::(caller, name, description, token_prefix)?; + let data = CreateCollectionData { name, - CollectionMode::ReFungible, + mode: CollectionMode::ReFungible, description, token_prefix, - base_uri_value, - add_properties, - )?; + ..Default::default() + }; check_sent_amount_equals_collection_creation_price::(value)?; let collection_helpers_address = T::CrossAccountId::from_eth(::ContractAddress::get()); @@ -177,10 +110,7 @@ fn create_refungible_collection_internal< caller.clone(), collection_helpers_address, data, - CollectionFlags { - erc721metadata: add_properties, - ..Default::default() - }, + Default::default(), ) .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; let address = pallet_common::eth::collection_id_to_address(collection_id); @@ -224,16 +154,15 @@ where description: string, token_prefix: string, ) -> Result
{ - let (caller, name, description, token_prefix, _base_uri_value) = - convert_data::(caller, name, description, token_prefix, "".into())?; - let data = make_data::( + let (caller, name, description, token_prefix) = + convert_data::(caller, name, description, token_prefix)?; + let data = CreateCollectionData { name, - CollectionMode::NFT, + mode: CollectionMode::NFT, description, token_prefix, - Default::default(), - false, - )?; + ..Default::default() + }; check_sent_amount_equals_collection_creation_price::(value)?; let collection_helpers_address = T::CrossAccountId::from_eth(::ContractAddress::get()); @@ -266,45 +195,6 @@ where self.create_nft_collection(caller, value, name, description, token_prefix) } - #[weight(>::create_collection())] - #[solidity(rename_selector = "createERC721MetadataCompatibleNFTCollection")] - fn create_nonfungible_collection_with_properties( - &mut self, - caller: caller, - value: value, - name: string, - description: string, - token_prefix: string, - base_uri: string, - ) -> Result
{ - let (caller, name, description, token_prefix, base_uri_value) = - convert_data::(caller, name, description, token_prefix, base_uri)?; - let data = make_data::( - name, - CollectionMode::NFT, - description, - token_prefix, - base_uri_value, - true, - )?; - check_sent_amount_equals_collection_creation_price::(value)?; - let collection_helpers_address = - T::CrossAccountId::from_eth(::ContractAddress::get()); - let collection_id = T::CollectionDispatch::create( - caller, - collection_helpers_address, - data, - CollectionFlags { - erc721metadata: true, - ..Default::default() - }, - ) - .map_err(pallet_evm_coder_substrate::dispatch_to_evm::)?; - - let address = pallet_common::eth::collection_id_to_address(collection_id); - Ok(address) - } - #[weight(>::create_collection())] #[solidity(rename_selector = "createRFTCollection")] fn create_rft_collection( @@ -315,37 +205,7 @@ where description: string, token_prefix: string, ) -> Result
{ - create_refungible_collection_internal::( - caller, - value, - name, - description, - token_prefix, - Default::default(), - false, - ) - } - - #[weight(>::create_collection())] - #[solidity(rename_selector = "createERC721MetadataCompatibleRFTCollection")] - fn create_refungible_collection_with_properties( - &mut self, - caller: caller, - value: value, - name: string, - description: string, - token_prefix: string, - base_uri: string, - ) -> Result
{ - create_refungible_collection_internal::( - caller, - value, - name, - description, - token_prefix, - base_uri, - true, - ) + create_refungible_collection_internal::(caller, value, name, description, token_prefix) } #[solidity(rename_selector = "makeCollectionERC721MetadataCompatible")] @@ -381,13 +241,35 @@ where let all_permissions = >::get(collection.id); if all_permissions.get(&key::url()).is_none() { self.recorder().consume_sstore()?; - >::set_property_permission(&collection, &caller, default_url_pkp()) - .map_err(dispatch_to_evm::)?; + >::set_property_permission( + &collection, + &caller, + up_data_structs::PropertyKeyPermission { + key: key::url(), + permission: up_data_structs::PropertyPermission { + mutable: true, + collection_admin: true, + token_owner: false, + }, + }, + ) + .map_err(dispatch_to_evm::)?; } if all_permissions.get(&key::suffix()).is_none() { self.recorder().consume_sstore()?; - >::set_property_permission(&collection, &caller, default_suffix_pkp()) - .map_err(dispatch_to_evm::)?; + >::set_property_permission( + &collection, + &caller, + up_data_structs::PropertyKeyPermission { + key: key::suffix(), + permission: up_data_structs::PropertyPermission { + mutable: true, + collection_admin: true, + token_owner: false, + }, + }, + ) + .map_err(dispatch_to_evm::)?; } let all_properties = >::get(collection.id); From 088ceb16caa8921bed201461bb0ad46fa681e503 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 14 Oct 2022 08:44:52 +0000 Subject: [PATCH 1138/1274] chore: regenerate stubs Signed-off-by: Yaroslav Bolyukin --- .../src/eth/stubs/CollectionHelpers.raw | Bin 1574 -> 1529 bytes .../src/eth/stubs/CollectionHelpers.sol | 36 +----------------- tests/src/eth/api/CollectionHelpers.sol | 20 +--------- tests/src/eth/collectionHelpersAbi.json | 24 ------------ 4 files changed, 2 insertions(+), 78 deletions(-) diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index fe52be4bfc58b1493019c4756f72831f16328af3..b09c8c190a6eb843b2642f3430bc9a056cabfc3d 100644 GIT binary patch delta 848 zcmZ{iPe>F|9LL{po>NjryRoC$g020d0?C8gpNrBzQV6CYW}*l2o*UR9$jUAq+Icg( ztJP)3XI(sK9SRHrAws-~T|5Yz(IJTvGC~Uaix8#To0;9kOEZ_>`@PTme!ug3^Qh+c z#u#0o9R}S)ZO#pksjtRkE^KYF8H`YLn4+Jn)DD2EwirXb;t3=(W0swsewP?ZF!V!~ zb4PBDCm3v!<%h0I$7OfSqR3t$b{dK^kLCJ?+{$(>p9{C_bguhoP!=o_VlB4D5RZ=N z4BcbMYok>Ru9}2Fvq@;j8Bf!=K~oUaw$PRJ8zxGWazZerF7v=7q0HNg%r}NU2Qtc1 zAY+;YMZ{`_C>!B}(P5}BZ^4d=acIks)TfAowC_HdoTVR=vR?%ZPWv9ihS?bg^Rc%= z{tpETDJP4!XbjxQinmG}=t2_L^I9&4I4t7031&n)uB%?O7%Vb)C@$db4N8s0lp47* z376O5awAVuxdDK<#+2P+7`MQAQNVSXYmqWjZuPqZGU0?thIE?BL#wabPCyTpiO~un zblS0ocwQcaGM#t&BN1QM2ZPrnb`*LviNnmwVnq9%E{D{E{Ju=9vkIBDDY5JwDV?m zceeB}v$NJANP{dSFCOfehNmt;T{;L6T4bjXDez$SX5P*kHjjbtec$hW-~W5>Ti^Yn zK_*{FIztW+ld+6Tcc2;BhP~9JFiy}>g4X^JGXP>eGDUa&SCGul>Sk`?b91$sq95G+ z*n4NDnL>=4%l(6W+&iliWNsK{4mRJtTuKF_5%AJz+GZ14_9$|~R{g~AoT z4YxGh5;^>erfJ@h#5H7*b{m=~Oo{;OzP?%eOskO}o7eeI;l5~sv!p%YGL@VJm4Rzn zjm(x?IJd&Nm5^inX>67$kyNn^z;j68&*83okEmd8t00{fekxsb>@rZOW{s*wQYGm2 zv`~X|Ga~NQ311`We~5}8G%AgkEJq~qG_4XWt{j;Jg-&>f{a@PmtO$h@SS)^=dlwHN0xfmpLdRad-`){ kTdL#rr6KR}<+q2I_6&~{ZhyTxd}Ang3hk2p5Aj2P0fgUMga7~l diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.sol b/pallets/unique/src/eth/stubs/CollectionHelpers.sol index f1fb40b007..ce8e6d7827 100644 --- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol +++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol @@ -23,7 +23,7 @@ contract CollectionHelpersEvents { } /// @title Contract, which allows users to operate with collections -/// @dev the ERC-165 identifier for this interface is 0x542f5079 +/// @dev the ERC-165 identifier for this interface is 0x58918631 contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { /// Create an NFT collection /// @param name Name of the collection @@ -65,23 +65,6 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { return 0x0000000000000000000000000000000000000000; } - /// @dev EVM selector for this function is: 0xa9e7b5c0, - /// or in textual repr: createERC721MetadataCompatibleNFTCollection(string,string,string,string) - function createERC721MetadataCompatibleNFTCollection( - string memory name, - string memory description, - string memory tokenPrefix, - string memory baseUri - ) public payable returns (address) { - require(false, stub_error); - name; - description; - tokenPrefix; - baseUri; - dummy = 0; - return 0x0000000000000000000000000000000000000000; - } - /// @dev EVM selector for this function is: 0xab173450, /// or in textual repr: createRFTCollection(string,string,string) function createRFTCollection( @@ -97,23 +80,6 @@ contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { return 0x0000000000000000000000000000000000000000; } - /// @dev EVM selector for this function is: 0xa5596388, - /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string) - function createERC721MetadataCompatibleRFTCollection( - string memory name, - string memory description, - string memory tokenPrefix, - string memory baseUri - ) public payable returns (address) { - require(false, stub_error); - name; - description; - tokenPrefix; - baseUri; - dummy = 0; - return 0x0000000000000000000000000000000000000000; - } - /// @dev EVM selector for this function is: 0x85624258, /// or in textual repr: makeCollectionERC721MetadataCompatible(address,string) function makeCollectionERC721MetadataCompatible(address collection, string memory baseUri) public { diff --git a/tests/src/eth/api/CollectionHelpers.sol b/tests/src/eth/api/CollectionHelpers.sol index 5dc6ecdbfd..c91cd6367a 100644 --- a/tests/src/eth/api/CollectionHelpers.sol +++ b/tests/src/eth/api/CollectionHelpers.sol @@ -18,7 +18,7 @@ interface CollectionHelpersEvents { } /// @title Contract, which allows users to operate with collections -/// @dev the ERC-165 identifier for this interface is 0x542f5079 +/// @dev the ERC-165 identifier for this interface is 0x58918631 interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { /// Create an NFT collection /// @param name Name of the collection @@ -46,15 +46,6 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory tokenPrefix ) external payable returns (address); - /// @dev EVM selector for this function is: 0xa9e7b5c0, - /// or in textual repr: createERC721MetadataCompatibleNFTCollection(string,string,string,string) - function createERC721MetadataCompatibleNFTCollection( - string memory name, - string memory description, - string memory tokenPrefix, - string memory baseUri - ) external payable returns (address); - /// @dev EVM selector for this function is: 0xab173450, /// or in textual repr: createRFTCollection(string,string,string) function createRFTCollection( @@ -63,15 +54,6 @@ interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents { string memory tokenPrefix ) external payable returns (address); - /// @dev EVM selector for this function is: 0xa5596388, - /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string) - function createERC721MetadataCompatibleRFTCollection( - string memory name, - string memory description, - string memory tokenPrefix, - string memory baseUri - ) external payable returns (address); - /// @dev EVM selector for this function is: 0x85624258, /// or in textual repr: makeCollectionERC721MetadataCompatible(address,string) function makeCollectionERC721MetadataCompatible(address collection, string memory baseUri) external; diff --git a/tests/src/eth/collectionHelpersAbi.json b/tests/src/eth/collectionHelpersAbi.json index ca495cb29d..7c506b33f1 100644 --- a/tests/src/eth/collectionHelpersAbi.json +++ b/tests/src/eth/collectionHelpersAbi.json @@ -25,30 +25,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { "internalType": "string", "name": "name", "type": "string" }, - { "internalType": "string", "name": "description", "type": "string" }, - { "internalType": "string", "name": "tokenPrefix", "type": "string" }, - { "internalType": "string", "name": "baseUri", "type": "string" } - ], - "name": "createERC721MetadataCompatibleNFTCollection", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "string", "name": "name", "type": "string" }, - { "internalType": "string", "name": "description", "type": "string" }, - { "internalType": "string", "name": "tokenPrefix", "type": "string" }, - { "internalType": "string", "name": "baseUri", "type": "string" } - ], - "name": "createERC721MetadataCompatibleRFTCollection", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "payable", - "type": "function" - }, { "inputs": [ { "internalType": "string", "name": "name", "type": "string" }, From 9fa2d18c4c7a725e81a68bf4ea2ca7c028e6b6d6 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 14 Oct 2022 09:08:12 +0000 Subject: [PATCH 1139/1274] fix: skip rmrk before --- tests/src/rmrk/rmrkIsolation.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/src/rmrk/rmrkIsolation.test.ts b/tests/src/rmrk/rmrkIsolation.test.ts index d9e6808f7a..4375bf9173 100644 --- a/tests/src/rmrk/rmrkIsolation.test.ts +++ b/tests/src/rmrk/rmrkIsolation.test.ts @@ -1,6 +1,6 @@ import {executeTransaction} from '../substrate/substrate-api'; import {IKeyringPair} from '@polkadot/types/types'; -import {itSub, expect, usingPlaygrounds, Pallets} from '../util/playgrounds'; +import {itSub, expect, usingPlaygrounds, Pallets, requirePalletsOrSkip} from '../util/playgrounds'; import {UniqueHelper} from '../util/playgrounds/unique'; let alice: IKeyringPair; @@ -84,12 +84,14 @@ describe('Negative Integration Test: External Collections, Internal Ops', async let rmrkNftId: number; let normalizedAlice: {Substrate: string}; - before(async () => { + before(async function() { await usingPlaygrounds(async (helper, privateKey) => { alice = privateKey('//Alice'); bob = privateKey('//Bob'); normalizedAlice = {Substrate: helper.address.normalizeSubstrateToChainFormat(alice.address)}; + requirePalletsOrSkip(this, helper, [Pallets.RmrkCore]); + const collectionIds = await createRmrkCollection(helper, alice); uniqueCollectionId = collectionIds.uniqueId; rmrkCollectionId = collectionIds.rmrkId; From 88cc507e215ebf2b2135fd16db1d41812f0fc711 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 14 Oct 2022 10:17:18 +0000 Subject: [PATCH 1140/1274] tests(xcm): fix parallelization issues with xcm detection --- tests/src/deprecated-helpers/helpers.ts | 10 ++++++---- tests/src/xcm/xcmOpal.test.ts | 1 + tests/src/xcm/xcmQuartz.test.ts | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/src/deprecated-helpers/helpers.ts b/tests/src/deprecated-helpers/helpers.ts index cc81588f75..9302b91f89 100644 --- a/tests/src/deprecated-helpers/helpers.ts +++ b/tests/src/deprecated-helpers/helpers.ts @@ -1764,11 +1764,13 @@ export async function queryCollectionExpectSuccess(api: ApiPromise, collectionId return (await api.rpc.unique.collectionById(collectionId)).unwrap(); } -export const describeXCM = ( - process.env.RUN_XCM_TESTS +export async function describeXCM(title: string, fn: (this: Mocha.Suite) => void, opts: {skip?: boolean} = {}) { + (process.env.RUN_XCM_TESTS && !opts.skip ? describe - : describe.skip -); + : describe.skip)(title, fn); +} + +describeXCM.skip = (name: string, fn: (this: Mocha.Suite) => void) => describeXCM(name, fn, {skip: true}); export async function waitNewBlocks(blocksCount = 1): Promise { await usingApi(async (api) => { diff --git a/tests/src/xcm/xcmOpal.test.ts b/tests/src/xcm/xcmOpal.test.ts index 6b5d285b1b..9c06974d90 100644 --- a/tests/src/xcm/xcmOpal.test.ts +++ b/tests/src/xcm/xcmOpal.test.ts @@ -69,6 +69,7 @@ describeXCM('[XCM] Integration test: Exchanging USDT with Westmint', () => { before(async () => { + console.log('hey babe its opal'); await usingApi(async (api, privateKeyWrapper) => { alice = privateKeyWrapper('//Alice'); bob = privateKeyWrapper('//Bob'); // funds donor diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index 83ecf8d513..091f038272 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -76,6 +76,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => { let balanceQuartzForeignTokenFinal: bigint; before(async () => { + console.log('hey babe'); await usingApi(async (api, privateKeyWrapper) => { const keyringSr25519 = new Keyring({type: 'sr25519'}); @@ -434,7 +435,6 @@ describeXCM('[XCM] Integration test: Quartz rejects non-native tokens', () => { }); describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => { - // Quartz constants let quartzAlice: IKeyringPair; let quartzAssetLocation; From 520f20e8866ce75dfa20ca29790f0245d6cde0ff Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 14 Oct 2022 10:18:45 +0000 Subject: [PATCH 1141/1274] tests(util): generalize extractEvents --- tests/src/util/playgrounds/unique.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/src/util/playgrounds/unique.ts b/tests/src/util/playgrounds/unique.ts index dd6ebc7355..058746aa67 100644 --- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -282,12 +282,12 @@ class UniqueEventHelper { return data.toHuman(); } - public static extractEvents(records: ITransactionResult): IEvent[] { + public static extractEvents(events: {event: any, phase: any}[]): IEvent[] { const parsedEvents: IEvent[] = []; - records.result.events.forEach((record) => { + events.forEach((record) => { const {event, phase} = record; - const types = (event as any).typeDef; + const types = event.typeDef; const eventData: IEvent = { section: event.section.toString(), @@ -505,7 +505,7 @@ class ChainHelperBase { let events: IEvent[] = []; try { result = await this.signTransaction(sender, this.constructApiCall(extrinsic, params), options, extrinsic) as ITransactionResult; - events = this.eventHelper.extractEvents(result); + events = this.eventHelper.extractEvents(result.result.events); } catch(e) { if(!(e as object).hasOwnProperty('status')) throw e; From a41938cf3887959b23f492ccf4f9eddb9766d60e Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 14 Oct 2022 10:50:57 +0000 Subject: [PATCH 1142/1274] fix: disconnect on skip --- tests/src/util/playgrounds/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index 6eb01ec1de..a00d036736 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -71,12 +71,14 @@ export enum Pallets { AppPromotion = 'apppromotion', } -export function requirePalletsOrSkip(test: Context, helper: DevUniqueHelper, requiredPallets: string[]) { +export async function requirePalletsOrSkip(test: Context, helper: DevUniqueHelper, requiredPallets: string[]) { const missingPallets = helper.fetchMissingPalletNames(requiredPallets); if (missingPallets.length > 0) { const skipMsg = `\tSkipping test '${test.test?.title}'.\n\tThe following pallets are missing:\n\t- ${missingPallets.join('\n\t- ')}`; console.warn('\x1b[38:5:208m%s\x1b[0m', skipMsg); + + await helper.disconnect(); test.skip(); } } @@ -86,7 +88,7 @@ export async function itSub(name: string, cb: (apis: { helper: DevUniqueHelper, opts.skip ? it.skip : it)(name, async function () { await usingPlaygrounds(async (helper, privateKey) => { if (opts.requiredPallets) { - requirePalletsOrSkip(this, helper, opts.requiredPallets); + await requirePalletsOrSkip(this, helper, opts.requiredPallets); } await cb({helper, privateKey}); From 2c2096c1385c2e95bbd8913145a34aed3fdd9234 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 14 Oct 2022 10:51:24 +0000 Subject: [PATCH 1143/1274] fix: disconnect when not needed in RMRK helpers --- tests/src/rmrk/util/helpers.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/src/rmrk/util/helpers.ts b/tests/src/rmrk/util/helpers.ts index 1bf1c7c618..0048345ea4 100644 --- a/tests/src/rmrk/util/helpers.ts +++ b/tests/src/rmrk/util/helpers.ts @@ -42,6 +42,7 @@ export function getModuleNames(api: ApiPromise): string[] { export async function missingRequiredPallets(requiredPallets: string[]): Promise { const api = await getApiConnection(); const pallets = getModuleNames(api); + await api.disconnect(); return requiredPallets.filter(p => !pallets.includes(p)); } From 50109b665ea6ffb34ed520beca34fbcc6782eb6a Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 14 Oct 2022 10:51:40 +0000 Subject: [PATCH 1144/1274] fix: RMRK disconnect --- tests/src/rmrk/acceptNft.test.ts | 2 +- tests/src/rmrk/addResource.test.ts | 2 +- tests/src/rmrk/addTheme.test.ts | 2 +- tests/src/rmrk/burnNft.test.ts | 4 +--- tests/src/rmrk/changeCollectionIssuer.test.ts | 4 +--- tests/src/rmrk/createBase.test.ts | 2 +- tests/src/rmrk/createCollection.test.ts | 2 +- tests/src/rmrk/deleteCollection.test.ts | 4 +--- tests/src/rmrk/equipNft.test.ts | 4 +--- tests/src/rmrk/getOwnedNfts.test.ts | 2 +- tests/src/rmrk/lockCollection.test.ts | 4 +--- tests/src/rmrk/mintNft.test.ts | 2 +- tests/src/rmrk/rejectNft.test.ts | 2 +- tests/src/rmrk/removeResource.test.ts | 4 +--- tests/src/rmrk/rmrkIsolation.test.ts | 2 +- tests/src/rmrk/sendNft.test.ts | 2 +- tests/src/rmrk/setCollectionProperty.test.ts | 4 +--- tests/src/rmrk/setEquippableList.test.ts | 2 +- tests/src/rmrk/setNftProperty.test.ts | 2 +- tests/src/rmrk/setResourcePriorities.test.ts | 2 +- 20 files changed, 20 insertions(+), 34 deletions(-) diff --git a/tests/src/rmrk/acceptNft.test.ts b/tests/src/rmrk/acceptNft.test.ts index c3c2497594..63d9b9c292 100644 --- a/tests/src/rmrk/acceptNft.test.ts +++ b/tests/src/rmrk/acceptNft.test.ts @@ -103,5 +103,5 @@ describe('integration test: accept NFT', () => { expect(isChild).to.be.false; }); - after(() => { api.disconnect(); }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/addResource.test.ts b/tests/src/rmrk/addResource.test.ts index 5568334450..70fc57fd7b 100644 --- a/tests/src/rmrk/addResource.test.ts +++ b/tests/src/rmrk/addResource.test.ts @@ -432,6 +432,6 @@ describe('integration test: add NFT resource', () => { after(() => { - api.disconnect(); + after(async() => { await api.disconnect(); }); }); }); diff --git a/tests/src/rmrk/addTheme.test.ts b/tests/src/rmrk/addTheme.test.ts index b61f5e61eb..8f582f66e5 100644 --- a/tests/src/rmrk/addTheme.test.ts +++ b/tests/src/rmrk/addTheme.test.ts @@ -125,5 +125,5 @@ describe('integration test: add Theme to Base', () => { await expectTxFailure(/rmrkEquip\.PermissionError/, tx); }); - after(() => { api.disconnect(); }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/burnNft.test.ts b/tests/src/rmrk/burnNft.test.ts index dc98444c11..0786b3bb8c 100644 --- a/tests/src/rmrk/burnNft.test.ts +++ b/tests/src/rmrk/burnNft.test.ts @@ -166,7 +166,5 @@ describe('integration test: burn nft', () => { }); }); - after(() => { - api.disconnect(); - }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/changeCollectionIssuer.test.ts b/tests/src/rmrk/changeCollectionIssuer.test.ts index 6260f2d051..d49cfec6bd 100644 --- a/tests/src/rmrk/changeCollectionIssuer.test.ts +++ b/tests/src/rmrk/changeCollectionIssuer.test.ts @@ -49,7 +49,5 @@ describe('integration test: collection issuer', () => { }); }); - after(() => { - api.disconnect(); - }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/createBase.test.ts b/tests/src/rmrk/createBase.test.ts index 95840c077d..c57106645b 100644 --- a/tests/src/rmrk/createBase.test.ts +++ b/tests/src/rmrk/createBase.test.ts @@ -84,5 +84,5 @@ describe('integration test: create new Base', () => { ]); }); - after(() => { api.disconnect(); }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/createCollection.test.ts b/tests/src/rmrk/createCollection.test.ts index d5167ade75..90e1fef04a 100644 --- a/tests/src/rmrk/createCollection.test.ts +++ b/tests/src/rmrk/createCollection.test.ts @@ -21,5 +21,5 @@ describe('Integration test: create new collection', () => { await createCollection(api, alice, 'no-limit-metadata', null, 'no-limit-symbol'); }); - after(() => { api.disconnect(); }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/deleteCollection.test.ts b/tests/src/rmrk/deleteCollection.test.ts index c2fdbc55d0..6cbeb19a94 100644 --- a/tests/src/rmrk/deleteCollection.test.ts +++ b/tests/src/rmrk/deleteCollection.test.ts @@ -42,7 +42,5 @@ describe('integration test: delete collection', () => { }); }); - after(() => { - api.disconnect(); - }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/equipNft.test.ts b/tests/src/rmrk/equipNft.test.ts index e60cac0f3d..7ede53cc40 100644 --- a/tests/src/rmrk/equipNft.test.ts +++ b/tests/src/rmrk/equipNft.test.ts @@ -336,7 +336,5 @@ describe.skip('integration test: Equip NFT', () => { await expectTxFailure(/rmrkEquip\.CollectionNotEquippable/, tx); }); - after(() => { - api.disconnect(); - }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/getOwnedNfts.test.ts b/tests/src/rmrk/getOwnedNfts.test.ts index 9b051cd79b..8badf9a569 100644 --- a/tests/src/rmrk/getOwnedNfts.test.ts +++ b/tests/src/rmrk/getOwnedNfts.test.ts @@ -76,5 +76,5 @@ describe('integration test: get owned NFTs', () => { }); }); - after(() => { api.disconnect(); }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/lockCollection.test.ts b/tests/src/rmrk/lockCollection.test.ts index 8e5103279d..9220a9307b 100644 --- a/tests/src/rmrk/lockCollection.test.ts +++ b/tests/src/rmrk/lockCollection.test.ts @@ -112,7 +112,5 @@ describe('integration test: lock collection', () => { }); }); - after(() => { - api.disconnect(); - }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/mintNft.test.ts b/tests/src/rmrk/mintNft.test.ts index f92f47724f..6b4d184050 100644 --- a/tests/src/rmrk/mintNft.test.ts +++ b/tests/src/rmrk/mintNft.test.ts @@ -207,5 +207,5 @@ describe('integration test: mint new NFT', () => { expect(nft.isSome).to.be.false; }); - after(() => { api.disconnect(); }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/rejectNft.test.ts b/tests/src/rmrk/rejectNft.test.ts index be40c5ffb6..814b98cf0c 100644 --- a/tests/src/rmrk/rejectNft.test.ts +++ b/tests/src/rmrk/rejectNft.test.ts @@ -90,5 +90,5 @@ describe('integration test: reject NFT', () => { await expectTxFailure(/rmrkCore\.CannotRejectNonPendingNft/, tx); }); - after(() => { api.disconnect(); }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/removeResource.test.ts b/tests/src/rmrk/removeResource.test.ts index 87cb21bc70..0ff674f144 100644 --- a/tests/src/rmrk/removeResource.test.ts +++ b/tests/src/rmrk/removeResource.test.ts @@ -343,7 +343,5 @@ describe('Integration test: remove nft resource', () => { await expectTxFailure(/rmrkCore\.NoPermission/, tx); }); - after(() => { - api.disconnect(); - }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/rmrkIsolation.test.ts b/tests/src/rmrk/rmrkIsolation.test.ts index 4375bf9173..76e4a15ced 100644 --- a/tests/src/rmrk/rmrkIsolation.test.ts +++ b/tests/src/rmrk/rmrkIsolation.test.ts @@ -90,7 +90,7 @@ describe('Negative Integration Test: External Collections, Internal Ops', async bob = privateKey('//Bob'); normalizedAlice = {Substrate: helper.address.normalizeSubstrateToChainFormat(alice.address)}; - requirePalletsOrSkip(this, helper, [Pallets.RmrkCore]); + await requirePalletsOrSkip(this, helper, [Pallets.RmrkCore]); const collectionIds = await createRmrkCollection(helper, alice); uniqueCollectionId = collectionIds.uniqueId; diff --git a/tests/src/rmrk/sendNft.test.ts b/tests/src/rmrk/sendNft.test.ts index e9001a1cc7..9b47ee28b0 100644 --- a/tests/src/rmrk/sendNft.test.ts +++ b/tests/src/rmrk/sendNft.test.ts @@ -251,5 +251,5 @@ describe('integration test: send NFT', () => { await expectTxFailure(/rmrkCore\.NoPermission/, tx); }); - after(() => { api.disconnect(); }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/setCollectionProperty.test.ts b/tests/src/rmrk/setCollectionProperty.test.ts index 13147c0474..db8597afc3 100644 --- a/tests/src/rmrk/setCollectionProperty.test.ts +++ b/tests/src/rmrk/setCollectionProperty.test.ts @@ -62,7 +62,5 @@ describe('integration test: set collection property', () => { }); }); - after(() => { - api.disconnect(); - }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/setEquippableList.test.ts b/tests/src/rmrk/setEquippableList.test.ts index 3a5203a4cc..52a5630725 100644 --- a/tests/src/rmrk/setEquippableList.test.ts +++ b/tests/src/rmrk/setEquippableList.test.ts @@ -110,5 +110,5 @@ describe("integration test: set slot's Equippable List", () => { await expectTxFailure(/rmrkEquip\.PartDoesntExist/, tx); }); - after(() => { api.disconnect(); }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/setNftProperty.test.ts b/tests/src/rmrk/setNftProperty.test.ts index 97b7b0910b..003cf7d4ee 100644 --- a/tests/src/rmrk/setNftProperty.test.ts +++ b/tests/src/rmrk/setNftProperty.test.ts @@ -84,5 +84,5 @@ describe('integration test: set NFT property', () => { await expectTxFailure(/rmrkCore\.NoPermission/, tx); }); - after(() => { api.disconnect(); }); + after(async() => { await api.disconnect(); }); }); diff --git a/tests/src/rmrk/setResourcePriorities.test.ts b/tests/src/rmrk/setResourcePriorities.test.ts index aa15516162..8eb41d540f 100644 --- a/tests/src/rmrk/setResourcePriorities.test.ts +++ b/tests/src/rmrk/setResourcePriorities.test.ts @@ -54,5 +54,5 @@ describe('integration test: set NFT resource priorities', () => { await expectTxFailure(/rmrkCore\.NoAvailableNftId/, tx); }); - after(() => { api.disconnect(); }); + after(async() => { await api.disconnect(); }); }); From f12ecd3c5bf1739d0889a54ff5e9815a48ee6089 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 14 Oct 2022 10:52:07 +0000 Subject: [PATCH 1145/1274] fix: await require pallets --- tests/src/app-promotion.test.ts | 2 +- tests/src/eth/createRFTCollection.test.ts | 4 ++-- tests/src/eth/fractionalizer/fractionalizer.test.ts | 4 ++-- tests/src/eth/reFungible.test.ts | 8 ++++---- tests/src/eth/reFungibleToken.test.ts | 12 ++++++------ tests/src/eth/util/playgrounds/index.ts | 2 +- tests/src/limits.test.ts | 4 ++-- tests/src/nesting/properties.test.ts | 2 +- tests/src/refungible.test.ts | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index 7ef2a5586d..eb3dee7ca2 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -36,7 +36,7 @@ const rewardAvailableInBlock = (stakedInBlock: bigint) => { describe('App promotion', () => { before(async function () { await usingPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.AppPromotion]); + await requirePalletsOrSkip(this, helper, [Pallets.AppPromotion]); alice = privateKey('//Alice'); palletAdmin = privateKey('//Charlie'); // TODO use custom address const api = helper.getApi(); diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts index 7857986ca2..780734a070 100644 --- a/tests/src/eth/createRFTCollection.test.ts +++ b/tests/src/eth/createRFTCollection.test.ts @@ -25,7 +25,7 @@ describe('Create RFT collection from EVM', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); }); @@ -152,7 +152,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); nominal = helper.balance.getOneTokenNominal(); }); diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index 033431af9f..09f3051ca9 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -84,7 +84,7 @@ describe('Fractionalizer contract usage', () => { before(async function() { await usingEthPlaygrounds(async (helper: EthUniqueHelper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); }); @@ -224,7 +224,7 @@ describe('Negative Integration Tests for fractionalizer', () => { before(async function() { await usingEthPlaygrounds(async (helper: EthUniqueHelper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); }); diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 01861b980d..b51a495ca4 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -23,7 +23,7 @@ describe('Refungible: Information getting', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); @@ -115,7 +115,7 @@ describe('Refungible: Plain calls', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); @@ -327,7 +327,7 @@ describe('RFT: Fees', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); @@ -368,7 +368,7 @@ describe('Common metadata', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); [alice] = await helper.arrange.createAccounts([20n], donor); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 5196ac525e..914b410ab9 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -26,7 +26,7 @@ describe('Refungible token: Information getting', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); [alice] = await helper.arrange.createAccounts([20n], donor); @@ -70,7 +70,7 @@ describe('Check ERC721 token URI for ReFungible', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); @@ -134,7 +134,7 @@ describe('Refungible: Plain calls', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); [alice] = await helper.arrange.createAccounts([50n], donor); @@ -325,7 +325,7 @@ describe('Refungible: Fees', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); [alice] = await helper.arrange.createAccounts([50n], donor); @@ -380,7 +380,7 @@ describe('Refungible: Substrate calls', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); [alice] = await helper.arrange.createAccounts([50n], donor); @@ -470,7 +470,7 @@ describe('ERC 1633 implementation', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); diff --git a/tests/src/eth/util/playgrounds/index.ts b/tests/src/eth/util/playgrounds/index.ts index 1229e15ccc..fe5631ba4c 100644 --- a/tests/src/eth/util/playgrounds/index.ts +++ b/tests/src/eth/util/playgrounds/index.ts @@ -48,7 +48,7 @@ export async function itEth(name: string, cb: (apis: { helper: EthUniqueHelper, opts.skip ? it.skip : it)(name, async function() { await usingEthPlaygrounds(async (helper, privateKey) => { if (opts.requiredPallets) { - requirePalletsOrSkip(this, helper, opts.requiredPallets); + await requirePalletsOrSkip(this, helper, opts.requiredPallets); } await cb({helper, privateKey}); diff --git a/tests/src/limits.test.ts b/tests/src/limits.test.ts index 14c2c4ed9e..b70f1a876e 100644 --- a/tests/src/limits.test.ts +++ b/tests/src/limits.test.ts @@ -58,7 +58,7 @@ describe('Number of tokens per address (ReFungible)', () => { before(async function() { await usingPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); const donor = privateKey('//Alice'); [alice] = await helper.arrange.createAccounts([10n], donor); @@ -364,7 +364,7 @@ describe('Collection zero limits (ReFungible)', () => { before(async function() { await usingPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index 7d20a3c46e..ece5ade8aa 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -975,7 +975,7 @@ describe('ReFungible token properties permissions tests', () => { before(async function() { await usingPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index e68eb4a34a..713f285d16 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -25,7 +25,7 @@ describe('integration test: Refungible functionality:', async () => { before(async function() { await usingPlaygrounds(async (helper, privateKey) => { - requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); const donor = privateKey('//Alice'); [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor); From c1e4a680a9b8e244c3552ffe8d1da9b707f82fcd Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 14 Oct 2022 18:10:32 +0700 Subject: [PATCH 1146/1274] change repositories for testnet nightly build --- .github/workflows/testnet-build.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testnet-build.yml b/.github/workflows/testnet-build.yml index 7ffd44f64f..0a5bc62ff6 100644 --- a/.github/workflows/testnet-build.yml +++ b/.github/workflows/testnet-build.yml @@ -125,13 +125,10 @@ jobs: run: docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} - name: Build the stack - run: cd .docker/ && docker build --file ./Dockerfile-testnet.${{ matrix.network }}.yml --tag uniquenetwork/${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/${{ matrix.network }}-testnet-local:latest . + run: cd .docker/ && docker build --file ./Dockerfile-testnet.${{ matrix.network }}.yml --tag uniquenetwork/${{ matrix.network }}-testnet-local-nightly:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} . - name: Push docker version image - run: docker push uniquenetwork/${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} - - - name: Push docker latest image - run: docker push uniquenetwork/${{ matrix.network }}-testnet-local:latest + run: docker push uniquenetwork/${{ matrix.network }}-testnet-local-nightly:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} - name: Clean Workspace if: always() From c5a9a78a0dde352cc5df18cd25a54f510f94cc8d Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 14 Oct 2022 18:15:00 +0700 Subject: [PATCH 1147/1274] change polkadot version and polkadot-launch branch in .env --- .env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 506d0da420..03843b6eba 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ RUST_TOOLCHAIN=nightly-2022-07-24 -POLKADOT_BUILD_BRANCH=release-v0.9.27 +POLKADOT_BUILD_BRANCH=release-v0.9.29 POLKADOT_MAINNET_BRANCH=release-v0.9.26 UNIQUE_MAINNET_TAG=v924010 @@ -13,7 +13,7 @@ OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443 QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443 -POLKADOT_LAUNCH_BRANCH=feature/rewrite-chain-id-in-spec +POLKADOT_LAUNCH_BRANCH=unique-network KARURA_BUILD_BRANCH=2.9.1 ACALA_BUILD_BRANCH=2.9.2 From 92a3c640f5c509824157b8bdbf7578d3f66b00b3 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 14 Oct 2022 11:50:06 +0000 Subject: [PATCH 1148/1274] fix: describeXcm fn --- tests/src/util/playgrounds/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index a00d036736..6e60ea3641 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -105,8 +105,8 @@ itSubIfWithPallet.only = (name: string, required: string[], cb: (apis: { helper: itSubIfWithPallet.skip = (name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSubIfWithPallet(name, required, cb, {skip: true}); itSub.ifWithPallets = itSubIfWithPallet; -export const describeXcm = ( - process.env.RUN_XCM_TESTS - ? describe - : describe.skip -); +export async function describeXcm(name: string, cb: () => any) { + ( + process.env.RUN_XCM_TESTS ? describe : describe.skip + )(name, cb); +} From de41155a9b061c3b464379f8d9f2c07c3acd7062 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 14 Oct 2022 12:20:09 +0000 Subject: [PATCH 1149/1274] Revert "fix: disconnect on skip" This reverts commit a41938cf3887959b23f492ccf4f9eddb9766d60e. --- tests/src/util/playgrounds/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/src/util/playgrounds/index.ts b/tests/src/util/playgrounds/index.ts index 6e60ea3641..268d584fb8 100644 --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -71,14 +71,12 @@ export enum Pallets { AppPromotion = 'apppromotion', } -export async function requirePalletsOrSkip(test: Context, helper: DevUniqueHelper, requiredPallets: string[]) { +export function requirePalletsOrSkip(test: Context, helper: DevUniqueHelper, requiredPallets: string[]) { const missingPallets = helper.fetchMissingPalletNames(requiredPallets); if (missingPallets.length > 0) { const skipMsg = `\tSkipping test '${test.test?.title}'.\n\tThe following pallets are missing:\n\t- ${missingPallets.join('\n\t- ')}`; console.warn('\x1b[38:5:208m%s\x1b[0m', skipMsg); - - await helper.disconnect(); test.skip(); } } @@ -88,7 +86,7 @@ export async function itSub(name: string, cb: (apis: { helper: DevUniqueHelper, opts.skip ? it.skip : it)(name, async function () { await usingPlaygrounds(async (helper, privateKey) => { if (opts.requiredPallets) { - await requirePalletsOrSkip(this, helper, opts.requiredPallets); + requirePalletsOrSkip(this, helper, opts.requiredPallets); } await cb({helper, privateKey}); From 294182f8261c8c29e1c7938b2f7a2c9a6eac589a Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 14 Oct 2022 12:21:18 +0000 Subject: [PATCH 1150/1274] Revert "fix: await require pallets" This reverts commit f12ecd3c5bf1739d0889a54ff5e9815a48ee6089. --- tests/src/app-promotion.test.ts | 2 +- tests/src/eth/createRFTCollection.test.ts | 4 ++-- tests/src/eth/fractionalizer/fractionalizer.test.ts | 4 ++-- tests/src/eth/reFungible.test.ts | 8 ++++---- tests/src/eth/reFungibleToken.test.ts | 12 ++++++------ tests/src/eth/util/playgrounds/index.ts | 2 +- tests/src/limits.test.ts | 4 ++-- tests/src/nesting/properties.test.ts | 2 +- tests/src/refungible.test.ts | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/src/app-promotion.test.ts b/tests/src/app-promotion.test.ts index eb3dee7ca2..7ef2a5586d 100644 --- a/tests/src/app-promotion.test.ts +++ b/tests/src/app-promotion.test.ts @@ -36,7 +36,7 @@ const rewardAvailableInBlock = (stakedInBlock: bigint) => { describe('App promotion', () => { before(async function () { await usingPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.AppPromotion]); + requirePalletsOrSkip(this, helper, [Pallets.AppPromotion]); alice = privateKey('//Alice'); palletAdmin = privateKey('//Charlie'); // TODO use custom address const api = helper.getApi(); diff --git a/tests/src/eth/createRFTCollection.test.ts b/tests/src/eth/createRFTCollection.test.ts index 780734a070..7857986ca2 100644 --- a/tests/src/eth/createRFTCollection.test.ts +++ b/tests/src/eth/createRFTCollection.test.ts @@ -25,7 +25,7 @@ describe('Create RFT collection from EVM', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); }); @@ -152,7 +152,7 @@ describe('(!negative tests!) Create RFT collection from EVM', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); nominal = helper.balance.getOneTokenNominal(); }); diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index 09f3051ca9..033431af9f 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -84,7 +84,7 @@ describe('Fractionalizer contract usage', () => { before(async function() { await usingEthPlaygrounds(async (helper: EthUniqueHelper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); }); @@ -224,7 +224,7 @@ describe('Negative Integration Tests for fractionalizer', () => { before(async function() { await usingEthPlaygrounds(async (helper: EthUniqueHelper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); }); diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index b51a495ca4..01861b980d 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -23,7 +23,7 @@ describe('Refungible: Information getting', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); @@ -115,7 +115,7 @@ describe('Refungible: Plain calls', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); @@ -327,7 +327,7 @@ describe('RFT: Fees', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); @@ -368,7 +368,7 @@ describe('Common metadata', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); [alice] = await helper.arrange.createAccounts([20n], donor); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 914b410ab9..5196ac525e 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -26,7 +26,7 @@ describe('Refungible token: Information getting', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); [alice] = await helper.arrange.createAccounts([20n], donor); @@ -70,7 +70,7 @@ describe('Check ERC721 token URI for ReFungible', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); @@ -134,7 +134,7 @@ describe('Refungible: Plain calls', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); [alice] = await helper.arrange.createAccounts([50n], donor); @@ -325,7 +325,7 @@ describe('Refungible: Fees', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); [alice] = await helper.arrange.createAccounts([50n], donor); @@ -380,7 +380,7 @@ describe('Refungible: Substrate calls', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); [alice] = await helper.arrange.createAccounts([50n], donor); @@ -470,7 +470,7 @@ describe('ERC 1633 implementation', () => { before(async function() { await usingEthPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); donor = privateKey('//Alice'); }); diff --git a/tests/src/eth/util/playgrounds/index.ts b/tests/src/eth/util/playgrounds/index.ts index fe5631ba4c..1229e15ccc 100644 --- a/tests/src/eth/util/playgrounds/index.ts +++ b/tests/src/eth/util/playgrounds/index.ts @@ -48,7 +48,7 @@ export async function itEth(name: string, cb: (apis: { helper: EthUniqueHelper, opts.skip ? it.skip : it)(name, async function() { await usingEthPlaygrounds(async (helper, privateKey) => { if (opts.requiredPallets) { - await requirePalletsOrSkip(this, helper, opts.requiredPallets); + requirePalletsOrSkip(this, helper, opts.requiredPallets); } await cb({helper, privateKey}); diff --git a/tests/src/limits.test.ts b/tests/src/limits.test.ts index b70f1a876e..14c2c4ed9e 100644 --- a/tests/src/limits.test.ts +++ b/tests/src/limits.test.ts @@ -58,7 +58,7 @@ describe('Number of tokens per address (ReFungible)', () => { before(async function() { await usingPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); const donor = privateKey('//Alice'); [alice] = await helper.arrange.createAccounts([10n], donor); @@ -364,7 +364,7 @@ describe('Collection zero limits (ReFungible)', () => { before(async function() { await usingPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor); diff --git a/tests/src/nesting/properties.test.ts b/tests/src/nesting/properties.test.ts index ece5ade8aa..7d20a3c46e 100644 --- a/tests/src/nesting/properties.test.ts +++ b/tests/src/nesting/properties.test.ts @@ -975,7 +975,7 @@ describe('ReFungible token properties permissions tests', () => { before(async function() { await usingPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); const donor = privateKey('//Alice'); [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor); diff --git a/tests/src/refungible.test.ts b/tests/src/refungible.test.ts index 713f285d16..e68eb4a34a 100644 --- a/tests/src/refungible.test.ts +++ b/tests/src/refungible.test.ts @@ -25,7 +25,7 @@ describe('integration test: Refungible functionality:', async () => { before(async function() { await usingPlaygrounds(async (helper, privateKey) => { - await requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); + requirePalletsOrSkip(this, helper, [Pallets.ReFungible]); const donor = privateKey('//Alice'); [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor); From 68bf2bb2d7848b0a89a59f52cf029300644e1bc4 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 14 Oct 2022 14:14:45 +0000 Subject: [PATCH 1151/1274] fix: use config for xcm urls --- tests/src/config.ts | 8 +++++++- tests/src/xcm/xcmOpal.test.ts | 14 ++++++-------- tests/src/xcm/xcmQuartz.test.ts | 11 ++++------- tests/src/xcm/xcmUnique.test.ts | 11 ++++------- 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/tests/src/config.ts b/tests/src/config.ts index 439fbcdb6e..a6ac6b9755 100644 --- a/tests/src/config.ts +++ b/tests/src/config.ts @@ -19,6 +19,12 @@ import process from 'process'; const config = { substrateUrl: process.env.substrateUrl || 'ws://127.0.0.1:9944', frontierUrl: process.env.frontierUrl || 'http://127.0.0.1:9933', + relayUrl: process.env.relayUrl || 'ws://127.0.0.1:9844', + acalaUrl: process.env.acalaUrl || 'ws://127.0.0.1:9946', + karuraUrl: process.env.acalaUrl || 'ws://127.0.0.1:9946', + moonbeamUrl: process.env.moonbeamUrl || 'ws://127.0.0.1:9947', + moonriverUrl: process.env.moonbeamUrl || 'ws://127.0.0.1:9947', + westmintUrl: process.env.westmintUrl || 'ws://127.0.0.1:9948', }; -export default config; \ No newline at end of file +export default config; diff --git a/tests/src/xcm/xcmOpal.test.ts b/tests/src/xcm/xcmOpal.test.ts index 6787472fdf..8b19c8dfeb 100644 --- a/tests/src/xcm/xcmOpal.test.ts +++ b/tests/src/xcm/xcmOpal.test.ts @@ -15,16 +15,14 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; +import config from '../config'; import {itSub, expect, describeXcm, usingPlaygrounds, usingWestmintPlaygrounds, usingRelayPlaygrounds} from '../util/playgrounds'; const STATEMINE_CHAIN = 1000; const UNIQUE_CHAIN = 2095; -const RELAY_PORT = '9844'; -const STATEMINE_PORT = '9948'; - -const relayUrl = 'ws://127.0.0.1:' + RELAY_PORT; -const statemineUrl = 'ws://127.0.0.1:' + STATEMINE_PORT; +const relayUrl = config.relayUrl; +const westmintUrl = config.westmintUrl; const STATEMINE_PALLET_INSTANCE = 50; const ASSET_ID = 100; @@ -65,7 +63,7 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { bob = privateKey('//Bob'); // funds donor }); - await usingWestmintPlaygrounds(statemineUrl, async (helper) => { + await usingWestmintPlaygrounds(westmintUrl, async (helper) => { // 350.00 (three hundred fifty) DOT const fundingAmount = 3_500_000_000_000n; @@ -157,7 +155,7 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { }); itSub('Should connect and send USDT from Westmint to Opal', async ({helper}) => { - await usingWestmintPlaygrounds(statemineUrl, async (helper) => { + await usingWestmintPlaygrounds(westmintUrl, async (helper) => { const dest = { V1: { parents: 1, @@ -286,7 +284,7 @@ describeXcm('[XCM] Integration test: Exchanging USDT with Westmint', () => { balanceOpalFinal = await helper.balance.getSubstrate(alice.address); expect(balanceOpalAfter > balanceOpalFinal).to.be.true; - await usingWestmintPlaygrounds(statemineUrl, async (helper) => { + await usingWestmintPlaygrounds(westmintUrl, async (helper) => { await helper.wait.newBlocks(3); // The USDT token never paid fees. Its amount not changed from begin value. diff --git a/tests/src/xcm/xcmQuartz.test.ts b/tests/src/xcm/xcmQuartz.test.ts index c583dc2c2b..a445dc7f4e 100644 --- a/tests/src/xcm/xcmQuartz.test.ts +++ b/tests/src/xcm/xcmQuartz.test.ts @@ -16,6 +16,7 @@ import {IKeyringPair} from '@polkadot/types/types'; import {blake2AsHex} from '@polkadot/util-crypto'; +import config from '../config'; import {XcmV2TraitsOutcome, XcmV2TraitsError} from '../interfaces'; import {itSub, expect, describeXcm, usingPlaygrounds, usingKaruraPlaygrounds, usingRelayPlaygrounds, usingMoonriverPlaygrounds} from '../util/playgrounds'; @@ -23,13 +24,9 @@ const QUARTZ_CHAIN = 2095; const KARURA_CHAIN = 2000; const MOONRIVER_CHAIN = 2023; -const RELAY_PORT = 9844; -const KARURA_PORT = 9946; -const MOONRIVER_PORT = 9947; - -const relayUrl = 'ws://127.0.0.1:' + RELAY_PORT; -const karuraUrl = 'ws://127.0.0.1:' + KARURA_PORT; -const moonriverUrl = 'ws://127.0.0.1:' + MOONRIVER_PORT; +const relayUrl = config.relayUrl; +const karuraUrl = config.karuraUrl; +const moonriverUrl = config.moonriverUrl; const KARURA_DECIMALS = 12; diff --git a/tests/src/xcm/xcmUnique.test.ts b/tests/src/xcm/xcmUnique.test.ts index 358342a838..7a1b8d9790 100644 --- a/tests/src/xcm/xcmUnique.test.ts +++ b/tests/src/xcm/xcmUnique.test.ts @@ -16,6 +16,7 @@ import {IKeyringPair} from '@polkadot/types/types'; import {blake2AsHex} from '@polkadot/util-crypto'; +import config from '../config'; import {XcmV2TraitsError, XcmV2TraitsOutcome} from '../interfaces'; import {itSub, expect, describeXcm, usingPlaygrounds, usingAcalaPlaygrounds, usingRelayPlaygrounds, usingMoonbeamPlaygrounds} from '../util/playgrounds'; @@ -23,13 +24,9 @@ const UNIQUE_CHAIN = 2037; const ACALA_CHAIN = 2000; const MOONBEAM_CHAIN = 2004; -const RELAY_PORT = 9844; -const ACALA_PORT = 9946; -const MOONBEAM_PORT = 9947; - -const relayUrl = 'ws://127.0.0.1:' + RELAY_PORT; -const acalaUrl = 'ws://127.0.0.1:' + ACALA_PORT; -const moonbeamUrl = 'ws://127.0.0.1:' + MOONBEAM_PORT; +const relayUrl = config.relayUrl; +const acalaUrl = config.acalaUrl; +const moonbeamUrl = config.moonbeamUrl; const ACALA_DECIMALS = 12; From e031ad691e58ef910488e8a5d111f826785b55b6 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 14 Oct 2022 17:22:13 +0000 Subject: [PATCH 1152/1274] refactor: temporarly unhide mintBulk Signed-off-by: Yaroslav Bolyukin --- pallets/nonfungible/src/erc.rs | 4 +- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 3813 -> 4274 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 66 ++++++++++-------- pallets/refungible/src/erc.rs | 4 +- .../refungible/src/stubs/UniqueRefungible.raw | Bin 3840 -> 4301 bytes .../refungible/src/stubs/UniqueRefungible.sol | 64 +++++++++-------- tests/src/eth/api/UniqueNFT.sol | 40 ++++++----- tests/src/eth/api/UniqueRefungible.sol | 38 +++++----- tests/src/eth/nonFungibleAbi.json | 29 ++++++++ tests/src/eth/reFungibleAbi.json | 29 ++++++++ 10 files changed, 174 insertions(+), 100 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index 677efc6c0d..e562baa5c0 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -510,7 +510,7 @@ impl NonfungibleHandle { /// @param to The new owner /// @param tokenId ID of the minted NFT /// @param tokenUri Token URI that would be stored in the NFT properties - #[solidity(hide, rename_selector = "mintWithTokenURI")] + #[solidity(/*hide,*/ rename_selector = "mintWithTokenURI")] #[weight(>::create_item())] fn mint_with_token_uri_check_id( &mut self, @@ -705,7 +705,7 @@ impl NonfungibleHandle { /// numbers and first number should be obtained with `nextTokenId` method /// @param to The new owner /// @param tokens array of pairs of token ID and token URI for minted tokens - #[solidity(hide, rename_selector = "mintBulkWithTokenURI")] + #[solidity(/*hide,*/ rename_selector = "mintBulkWithTokenURI")] #[weight(>::create_multiple_items(tokens.len() as u32))] fn mint_bulk_with_token_uri( &mut self, diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index 1d92cbc9cc455d33f74bcca4f8d5e5d8c2bddff4..a3b4cc228e482d511ef52ab73e7975cee8b82e84 100644 GIT binary patch literal 4274 zcmaJ^e{fVs9l!N*KXVszBsq$gF()9cQ~A-+qf!_R6lyIkyqw8h@wIg~mz1VLN=e!Z z6!U)F9Vsn+cL@~4agaLGA0xF|#z_I0)>^H$iY*MaVu8Wd4*G{$)WMD+es=f0%L{4~ zE_`A9O;KN#E~Rx@I-B~&RZ4Wd)i#nE=)3cD$VgTcm8OkG-H#nJ@8z0V<5DWN zl2d7$k>GmXgdP|}(|Ve=6$uTr>V&3Cjr{C~c|`-E*fj`b>$=!Ko;UO^N(e}f!eB+= zpPZ_9P=ep~lwTL3FXlmT5ua;wD%@z)@h4(+V&j&aYT>_On32|Ko0)(o%{aXg##qoy z=I527Njg;On?e00JJmWPNlDR8O)qwV?>P8;Mc3#VrDR1lgk@w?ep`uj7+s?l8AV(x z#I|51xfNCx4Q@Nxoi7(jhmgC?PSJ}=h}OHf1BwC;Jw@y;_`(`aAgW}H`W8{&g-cXJ z-jEpPYjpBL>lQXL|5B_n^lYnExchTUPbC-`%WH+5zumhOunzFp?D6#p=GzZ=X5-ey zfDbybnbo}kc)oc4Y-#QG26M$ontUit1F9E)?CHFR9-sR;sJ7RYyp8dHH zs}=Sv9y$a#*QL5|(@jg@*}V|3W$T}R4Y<;Qph^I4?KuJ;{3c-W<&V7zcn+}oPB$b@ zy2Hg_eF;bR&uX9NP;Gi`tqpj>RmLNVDE$ajcXxjs@u>SLV84IP zKI0mPVB=LUT?u%}6*FsWUFQZ2l%k7cVXv(AT+GQ5r;Us8E}bm zels99f2n!<&4As2%dB|~fHPfQZnIcxh54Z`+zH5SoU*Y2s(Z^DI}ETtM9PDF9i$pZ?4!Z z^e*2#;)o1g6h~q(?MwOXN>WG#saH_=swpcW*0nUe9%psInqB{s|1B?nfAkqJr312O4VeVup3J>dE!fBlu-l{l+~ul^1%U;WeGRjkv?7v>(;{f-6R zLo7QJ-g1{uz3b3tTSuz4y20)`yKYE@}ST&hJ{oXq*mp2lDu^;C(z0 zSzDHUn?YzBF1Y`uJ_YJiF12I1LEB6+jRpTc#Vnztg@xjId;|vz;jJJgqeEHnIo$nv z)}m>%L`VXp8Akw3L^W**drt}a#RSj#7C)B;=u_!{+pR9f@4hvN5cb-h4(qU;qR5r zZ8AC|3T-bD#8OiH#Ic)&kClwFH-Jjj(WOzXSQg6uB8jajDTo9dC6PqgaFmQH3X7!i zQiMR%b``66T&-ADuv$W?v$B=y&dMk}4Z@Lu9+ z)nr1VO^%jmt7|r1vC!d45w=7ZNh-aJhjUprR`eEUFTEmjNXpi{O`(zR#vH$2>!7s?kq)njK7KbPp#M7!BwA>W?^tm zOqp1o@~^*6(y;pLW%++dZ%--s`T>{m!O8fd5S)5&qs+aj|F%QwDQ&L_KXxVk%yjA! znew!dka12DS(pbpDK)YB3vxrtuoyz&WQl)A5(zShNo*4d+Qt(UOH1OaMXIV{Aw#hh zc@|qJEjO}!AKyW27W*VFjGdRovo3@|D?Y+8b^H;w%-a54A)wPGNUh`7&n09#8SkvJ-Jp=cwD_rjjf7JJx!Mpkf(uI5a h2RE|9U>dk@{f2eD>wEhLdwbG-{po%-*mr;Le*mRXeiHxy literal 3813 zcmaJ^dvH`&9lpoSz5~rdvT585Sx8$QZJ|yZS_(4;6lJt6cUQ7o=2qvNY*Gk?6ho}g zl;J)%V8_ng-6T+LD+7*{QO8>OgCg42%9M^pEzD3y%45byCquQhovDZo_?>g^-Q1vd zGrReI=ltG}bMB=VXm_68M0LZ+yS>Wn7wFz4lmICUTob=<7BuyCy#?sjB31M$P3=|4 zGX<@5@2Zin(+e4@Q(hi5vaJxZhw%o+`o-3+47{#hdpxZFS`l+I6^iV>;@=G|Z zs{C8fj2tES>&}D>q54u0443e|qo5&-CIdfldkq%uDQGtS?SdOwopx9$MAD4iRdB|J zWwNNKIu^-kRB5B3vYTmdOH<;wnO3IL8G0!V)kY5wKvf}OWQf~?SlFy6vPuq9WeHW@ze07? z4TWJ!lUEnou(*kZlAyZig?7EPp?B+w6eCX+_0pcyv#+F>G70#*8>Th^?gKnOw0$Yy zqaJK#4LabYGkL6;h35l)aOnIYz(s(Ur$$yZv(S&EEvW`ubFp>m%RPs&RRTPH*W)Ru zIpK40yMoqBPb}SW1n>;F_T7A_ACP-;3h4Qek=Hbrn zg@~kpt?hkB4*}llLCD?%=p6g_Z-jSxsru($n1rKxY5Wi0T@F|Zs`0kAy|&H;Up)8^K%St@d(F>y3`3uM`4fQL*f+L)X&E#g_tkVB z9y*(1AG;r0D<(Fs2W$Z><>$|X`|o%V0$Tz5Mmr~LH@@~3An#KQr(WWAq2O(7EsB2j0l>=~4&T2PTrt39>f|GUJgDW? zSMLU#2e`ssI9rH$YGT*V`4B$8imkan>FxsD??KPI*8J%az#~|_K0S+@JPx?vmfe>D z&-vbPHK2Kr@vj~D86Z!2>XwydK(BH2Uh=ptNWDa^zIp)gMlglH^^ya~%Nsr!(mWVp zsn-E}uo{^<7XmC5F?tA{g*sVi-eTIo!f#+&!WeM{i+8fnZDR3Xd{M)kcIVud7Cx$k zW4#h`-xqv*b6QE{kDPjtg|`Y37W#a}Wzj*tSoTy#4Y4JTn7x^hTS*J8U=1pY{&WU) zW(M^Er+#1e>wn3|N_V?j#p`B{v=9F$8~ zGdOt^4LezQoM%AKnev=P5=08BI4G+Isk+rX@v`wCYdFHoAkxZnI_+TM9H;y`MQ0=^ znF(?x2WC(;PWg(Z^FAeY`h`mVn{$?BnsFWEdcTl4LI09Lx*G@!=TX_l8$~U7H{cdi z_@(jxxadc1A{n|#%sg5WKUtIH-Dy2A<>Ex=M!7w`OGhK(pgSqYMc#r6r0md~78ahA z%Pjn!$-=)XXtk=i)Zm@R5#fhDTHojrJ$NA#YBSPY;d^pDc-sc<=9m=zN@BALS?BfhWGYm()_*t~o zG0QNwp`cY%wW?O7+eS{eQ3>&oz@lF);*r832FaBzg2E6M{WNzEZbjF^4D^o@lGjw) zA(Dgk<&IUM5jn`BSrlZJdttNae4ZA+4$+$QQtcA?(q%a?4YC?uc~L4qtmv<$0E?cm zSoAvuZH#7XZjE%+uBmX;i(m8rXXHv0O6@YwPRxtn>Z&3;b|5=C9;I09Q=XOB;!$g- zOixXv-DQGoN{+id$60J`*&GdKP_25#bgDa}!rC^;Y|ku0%=N82Icj=V##EKXeu#%Q zOcxrr3hH@oS5OsDuTbhyu38cp(ui(I%;LoJ^)F-Uo(TNGE zCy;bLScxCYWtMopKA||p#3+~e$s_WZI3>CC;PCpxm3UWf8q?+Env+pab8@b2qAB?7 zkMZ&G8p&&h7hmISkF~M&T94#$fiALea@lJP zN=&02gKwpE)`-J!hn23Xnq%SJj5YSvU(K96m2YOwlr~x>mUt#H@S@RZ6!}XLYusIA zjhJeB74JD_-fn3@o0()nm8;5QT*A%b+%4l3h&3K98f$ER5u%ND;pW?4&@8f>zoLyj zv4e=l2eDa8uY3KewgcOb zUVOW6%R?JWpHpJjDYp%;AJ~#DJv2Bx#7e_i;DJq>H}-Gp9~|!Q%MJ`?2ifqz!~OpO DXq++K diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index 82ff6a76b0..d6cb532a22 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -500,22 +500,26 @@ contract ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents { return 0; } - // /// @notice Function to mint token with the given tokenUri. - // /// @dev `tokenId` should be obtained with `nextTokenId` method, - // /// unlike standard, you can't specify it manually - // /// @param to The new owner - // /// @param tokenId ID of the minted NFT - // /// @param tokenUri Token URI that would be stored in the NFT properties - // /// @dev EVM selector for this function is: 0x50bb4e7f, - // /// or in textual repr: mintWithTokenURI(address,uint256,string) - // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) public returns (bool) { - // require(false, stub_error); - // to; - // tokenId; - // tokenUri; - // dummy = 0; - // return false; - // } + /// @notice Function to mint token with the given tokenUri. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted NFT + /// @param tokenUri Token URI that would be stored in the NFT properties + /// @dev EVM selector for this function is: 0x50bb4e7f, + /// or in textual repr: mintWithTokenURI(address,uint256,string) + function mintWithTokenURI( + address to, + uint256 tokenId, + string memory tokenUri + ) public returns (bool) { + require(false, stub_error); + to; + tokenId; + tokenUri; + dummy = 0; + return false; + } /// @dev Not implemented /// @dev EVM selector for this function is: 0x7d64bcb4, @@ -585,6 +589,7 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { dummy; return 0; } + // /// @notice Function to mint multiple tokens. // /// @dev `tokenIds` should be an array of consecutive numbers and first number // /// should be obtained with `nextTokenId` method @@ -600,21 +605,20 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { // return false; // } - // /// @notice Function to mint multiple tokens with the given tokenUris. - // /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // /// numbers and first number should be obtained with `nextTokenId` method - // /// @param to The new owner - // /// @param tokens array of pairs of token ID and token URI for minted tokens - // /// @dev EVM selector for this function is: 0x36543006, - // /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) - // function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) public returns (bool) { - // require(false, stub_error); - // to; - // tokens; - // dummy = 0; - // return false; - // } - + /// @notice Function to mint multiple tokens with the given tokenUris. + /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + /// numbers and first number should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokens array of pairs of token ID and token URI for minted tokens + /// @dev EVM selector for this function is: 0x36543006, + /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) + function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) public returns (bool) { + require(false, stub_error); + to; + tokens; + dummy = 0; + return false; + } } /// @dev anonymous struct diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 8f36ac549d..3b03119bbc 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -536,7 +536,7 @@ impl RefungibleHandle { /// @param to The new owner /// @param tokenId ID of the minted RFT /// @param tokenUri Token URI that would be stored in the RFT properties - #[solidity(hide, rename_selector = "mintWithTokenURI")] + #[solidity(/*hide,*/ rename_selector = "mintWithTokenURI")] #[weight(>::create_item())] fn mint_with_token_uri_check_id( &mut self, @@ -748,7 +748,7 @@ impl RefungibleHandle { /// numbers and first number should be obtained with `nextTokenId` method /// @param to The new owner /// @param tokens array of pairs of token ID and token URI for minted tokens - #[solidity(hide, rename_selector = "mintBulkWithTokenURI")] + #[solidity(/*hide,*/ rename_selector = "mintBulkWithTokenURI")] #[weight(>::create_multiple_items(tokens.len() as u32))] fn mint_bulk_with_token_uri( &mut self, diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index b37de5d021d35fe2eacb2151787e45f031ed5b99..6a8fc4c7d8f606e4a7c1dfa7045d7d0ff8ac463e 100644 GIT binary patch literal 4301 zcmaJ^dvH`&8Na8S-Rv{XLJ|tgm@V|d9~9`=1zT_$psi?Yd$W>Vm|M#^+3-k*S3{u1 z$mG6uH)+OrcN1P(JAj=cI*zSihf1|}Dnb?OR4V9H3NyAkv^tEogA5wt@0@e*W*4iQv#&Sa7?`an9a^90!;>bgE`u>P zG?TemHE)r2jVe>Auizx6Pi>(j?mE%Dl;KCwsERJZTql2b=`G(gM*&2X{bK!C@qb(*a*t!zDzO9Hq+LRQc!{ z)sZ(OhAEA1UTEF?M&^4IqZGX`UC*txANg~fk<(c{xAXVkTntzT_?uhCHpH270PuXz zj)j0^O?0BYH<9Ef94n%E&+aT+tptHz5#f$FLMqAJsvN&*%iAd z{=x|%R?qES*#Bd|j7PO~`xh3$vnL>+Z^wsk0zT+MP~8K#qw5v;;CmJ@e|*}n0LK8! z?{z}rggaae{GW=YZ8O{ExK!Iut#tq|dCE5WZu>Sgd>>RCf?+F%KRfhyH+Gx%nRf#I z4YNJ7UcVhC-0t!6Y`9_{|IFfdKy@Bek9R(Wu!6x2*vz9n=i=-Ju3^cp_3Hq+JL<8A z`vGrtAsBuHNcXq&0KN{GOW*t{21>uKGO$=2xf0;iE)WM8#C_MeHCzSwHVja z&|?P=1M)J8-*JBdkhxTyWY`u%Jx9jhI0(26ME<8=%LDRC@c-7QxiG-uZvj4!*}&Ml zKENYc>}8ZM^Yt>{runpv1@6Q4^FNo-6if~>pDiZW@X3?d_-*Y@b2H!jgk!zrb3PJu zd~rfZ{RTdIh56qXEX=pFJj&V>zDkICDkLbRtaBZdo^F= zc=aecyJmEzMhf@W?_+@*c&zkxQ?_`7O9ZQo9$hv_*(s-q8#jbJ#SH7(!qK+{CtH^poOyrqY z3XV*LpHTmgihj}}+}BNFrcthVB~6lcCgebsgX4oM<@)rLjv{ShfqUg9kw>lqF55S$ znFZXA$^xrQ7MPpSM#|y@g>@dqQd@J%&ZxWH9%zWQjdx)8ud2j@5cwee%v zG#jTt-N`H-7I1hV(&F8Y^PkXGoPGaIeHql3J!;o-leSu9605(l#w?+unbptA;t?FI zexWBBJCp_9#I?Xk+caqv2#JGKbp_BQt`$j(ETBq>-#AFgDWxl6z;SEkd8F!fNpGe~ zDkqoW@brF5F0%SVd9wg**D_j3Rm*Bw+;9}5UAK`gacyDsf5_sJlP3mgFIWWGBdq=> z+&XU6hY$quMMBb=N?S!_P}SV7G9)5yNmP`A@N*+n#z^zt8EWw9Xk-zZIvI3pxAa$Ok&`&|!tp>RSjM4{9!@Zbbp|E*LR!LcWT zqvLMJg2!Cm;EAF&Afq#)(zXIYEG5M`*KQX4pkNlO1E`i=T{_kCMXoFqmc({V3PMR& zNoaP_bd`*%Dhn;dB@zNr+hvSC&((@i38O5f?#NNgJ4>U;*ma(Tp7g}(w(y$^8Rj)3 zMyQ20xC?Inle})hgkF@KX2ne5YUrdV@a+Q9EJ_8zfIu%8p${a5T3tQA6J_+H{^)n!7$b6hRq1)kZs;6jHdMc5KvE~$(n?$kxOvBK-zxfBccvG6vN zh5m`o=I$Tr$L>g=@Nl0si1W0?jroS;$mfY>;r7cSv85w!m@|Z0DPuSZv1s@sq7l zw5qg)tV%&g-tmOJmlstvqO!<8MA`D4hAq`5s)N$11ai^QCYLdqtkgVjJJpr!R%6uN z`z*T5a?2kDQMFTrye=uvM%yt+VKR$ul@of3MXgFP@UJvc2PUzIW1$WPcpXF!NaC_h z%9?4T5TYltEP7N1$V~Hjd<8iydJyN*&g;@vX-UzGQq07@5vGmHSr&^_IxLPV(TQ{8 z_!B9Px&2SCZoXbY#Fj`AD2U3j)XZWlJi%SIiCxWG_bBgvZYOZ#7jyextyQs|9`pWc zt61y>-UUURMQf0!K*hzF*Z{a{#(w9OT{TNpfyOR-3dXOeluZ~(v~V8S%MD6QV>pls;Q@{eEE(4S=u-$gqa z$M>w6wws&LVN9}1m9xqa=WvoZ%?f<8H$0a$mfQRek|)j}E*(P|%_7*AnmW37k4!QT z=CuP|-J92JSutZ$a)0Sdmv>)#>8=M}Tr@cR^I7ED;VW#{eM<+YT}>+ySgjcy)n6w^>%Mt{U0jGm6`wm literal 3840 zcmaJ^3vgUj8NP>oKZ@CqY>AsOYsyp^r93oXA>y`7fdPfPYqDGBqMnmYXoGDiX$;iZ z_C7Z)O6Trwnzlp7Y0FHpgQErOP}J#wNL#h)K%sQhKE{?u2XRKxPVE@tch0?cb5oJc z?B+Y?{O`wk(9<+mp!2D!X$8Aay8MrH$3jYgq)uDM@1Ki`{CTw%=(-Y>)G0;olgJN> zO8K5U#~!AqGgK*=bj(5&911u$cj{9K(4F1c#U zMTK_gDX!-Y=z%dbt7U12MQEs9BQ#rS;%m>AWEF&BRwt0HX=46pN!NNQAs{&bgJqe2 zi;9+~1b?|qKog=blt6F+-wqaA+A~_re!8rxQ^n`>C{$O7DL_Rpbqc zVN#Qu7aF{=i3R3k)J0FXtK|p3u;@=IM)sG~^5)}DECLJy{^6>rl_@6e0z5Um_7=eJ zxUhu<_W+)=&b{2iLfwGp_nq1Yco*Qssjoan%m} zdY54M(=UAr@O4kjy#2!`QtYxvK(%;s#d5&w0O`*3Fksw;VBk)b3!nT1OyB|PAD=gg z+4X?S%zNJwHj0jP#9-+TEG>EQ5go7>@ZJ?i-UclD^0nP*L zmd||~kbAPo_}Z5N7XmIe7hDb)@x(;0Z2k`nJ&UC)ew^z9Jm5k%Y;z08#sFW(?3L*` zNUDfy=QUd{0{+`C24n77?CVec1dta*>Y61Lz|Xi;ePojBZUe@MZ)A)S>PT%8E)Z| zqiEq=-fnH>T}(Jus{#9cLB|(ogoOXaM->*T3lq<%q>BeO>5{iA4#kKS$A^_=m&ZfR>&}LZkcfcPu%p&AQnPCX;>M=Jf@efh zc#wI7XUt77KJu~_nH8?Y_h(W5m5)48j`7~ek>VvPndX!`oiO91$oJiz`5k>TgK!54 z3#~+ElR1$~UJW?lBz~U!KPviBi*R4niC#cS;wP(tY;^BA zjo=)R61dDjb1MtG`yUI>(OKw3QK{F&c?at}3Vsft^tCQggQqirHZ2W-;W^H{{~-1q z-?=U8YD7Yr+I4nss3r~9bd~9IZ3zoftg@s@8 zWTU@WxCh6xRxoMSs1T9@>2X&A&Ej~^8ssJ_Rr$$Js&=)|a1h6yVeuG5q7J>@Rh2n; z*DS>m*MAnd!O|;GXBCyIEZ5|kxN1mRUNw;kaerVDTvf7~MKqGH7zBwSEP|reaA{zX z5vYOuaY71;OgltyP_W#v8YChXSrm(e$Z{)87U{-RBM*@uIabPDB3`PK4%ENMhL>KX zs^Qithk-@jF<9iMMP-6!>vo-V)i23#)b(G~04L-^BudQ+k51I}-{`6#I;Jl=DsEXU zy2RBI&5s)!obc3TnyU~*)1g@A8qT646@Aki=3vCk)u{k>l(WgBv&yDM@ zmI+yA(Sx|pp}SDHHH=>4dc~-U(O)QaN48wsT%AD9F7YjPnJYGyK)B&Kgv8o-*@zL! zAqR)S&Ho%;w`OA94yQh2r*Jmb<4L3yWLi`U!U2h1IAWs?h3qe=nKZ{XJIiRd=~;c| z%WTZON3hs0oy>kz-HK#3;v4&?XWx`1e5}hXo)AHF{HHl#Dy8^0s}JG}T+aB-jTG=c z@CVinPW(QPw9jy}fxGbklulfAU9I5$U2(cU?&e?X5iKT`{aC%$x`R+m5GtfzR6(v03~WHpWSQEykzO$&JoQ zv^jEo$>j~4aNjK~(cRbyuv>~Pqs(_Wk*`G2VOIT{gtwU{R=Y0Gj&0&GXPPA@O&!I@ z_m~OZrf$KyaZNn);dUMNxL@1-Fsu7RD)?9nLEwRSYVkycrfzuSy-O;#)e&o-7^-*~lI1?oK7tSM!@LJV;y(eMUI zZZGlo5=%Z?Vo7v0oyHSLFPN>ZNWV@dWoK6UF6Xeb*mo;<9kJvaC9TKg2O-kC5hve) zqGFIO{Pi}mZ7UC?_!K|b)jzoEfz?Ypo3r)9KiqWo;I?l*I)BS=?*H5O-u&WQFZ}9U z&r+$Hdh&`_k1HGcS3k6(e47;gnDn`k<%6rU<%fnwhFN(e3p}`T)rx_Y14APN{n^2x L><}9n93A*C8c0Yi diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index ab2a9df35a..b8509fe1f0 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -498,22 +498,26 @@ contract ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents { return 0; } - // /// @notice Function to mint token with the given tokenUri. - // /// @dev `tokenId` should be obtained with `nextTokenId` method, - // /// unlike standard, you can't specify it manually - // /// @param to The new owner - // /// @param tokenId ID of the minted RFT - // /// @param tokenUri Token URI that would be stored in the RFT properties - // /// @dev EVM selector for this function is: 0x50bb4e7f, - // /// or in textual repr: mintWithTokenURI(address,uint256,string) - // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) public returns (bool) { - // require(false, stub_error); - // to; - // tokenId; - // tokenUri; - // dummy = 0; - // return false; - // } + /// @notice Function to mint token with the given tokenUri. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted RFT + /// @param tokenUri Token URI that would be stored in the RFT properties + /// @dev EVM selector for this function is: 0x50bb4e7f, + /// or in textual repr: mintWithTokenURI(address,uint256,string) + function mintWithTokenURI( + address to, + uint256 tokenId, + string memory tokenUri + ) public returns (bool) { + require(false, stub_error); + to; + tokenId; + tokenUri; + dummy = 0; + return false; + } /// @dev Not implemented /// @dev EVM selector for this function is: 0x7d64bcb4, @@ -601,20 +605,20 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { // return false; // } - // /// @notice Function to mint multiple tokens with the given tokenUris. - // /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // /// numbers and first number should be obtained with `nextTokenId` method - // /// @param to The new owner - // /// @param tokens array of pairs of token ID and token URI for minted tokens - // /// @dev EVM selector for this function is: 0x36543006, - // /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) - // function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) public returns (bool) { - // require(false, stub_error); - // to; - // tokens; - // dummy = 0; - // return false; - // } + /// @notice Function to mint multiple tokens with the given tokenUris. + /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + /// numbers and first number should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokens array of pairs of token ID and token URI for minted tokens + /// @dev EVM selector for this function is: 0x36543006, + /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) + function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) public returns (bool) { + require(false, stub_error); + to; + tokens; + dummy = 0; + return false; + } /// Returns EVM address for refungible token /// diff --git a/tests/src/eth/api/UniqueNFT.sol b/tests/src/eth/api/UniqueNFT.sol index 718b3ac0b6..d6e21e5117 100644 --- a/tests/src/eth/api/UniqueNFT.sol +++ b/tests/src/eth/api/UniqueNFT.sol @@ -332,15 +332,19 @@ interface ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents { /// or in textual repr: mintWithTokenURI(address,string) function mintWithTokenURI(address to, string memory tokenUri) external returns (uint256); - // /// @notice Function to mint token with the given tokenUri. - // /// @dev `tokenId` should be obtained with `nextTokenId` method, - // /// unlike standard, you can't specify it manually - // /// @param to The new owner - // /// @param tokenId ID of the minted NFT - // /// @param tokenUri Token URI that would be stored in the NFT properties - // /// @dev EVM selector for this function is: 0x50bb4e7f, - // /// or in textual repr: mintWithTokenURI(address,uint256,string) - // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) external returns (bool); + /// @notice Function to mint token with the given tokenUri. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted NFT + /// @param tokenUri Token URI that would be stored in the NFT properties + /// @dev EVM selector for this function is: 0x50bb4e7f, + /// or in textual repr: mintWithTokenURI(address,uint256,string) + function mintWithTokenURI( + address to, + uint256 tokenId, + string memory tokenUri + ) external returns (bool); /// @dev Not implemented /// @dev EVM selector for this function is: 0x7d64bcb4, @@ -384,6 +388,7 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { /// @dev EVM selector for this function is: 0x75794a3c, /// or in textual repr: nextTokenId() function nextTokenId() external view returns (uint256); + // /// @notice Function to mint multiple tokens. // /// @dev `tokenIds` should be an array of consecutive numbers and first number // /// should be obtained with `nextTokenId` method @@ -393,15 +398,14 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { // /// or in textual repr: mintBulk(address,uint256[]) // function mintBulk(address to, uint256[] memory tokenIds) external returns (bool); - // /// @notice Function to mint multiple tokens with the given tokenUris. - // /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // /// numbers and first number should be obtained with `nextTokenId` method - // /// @param to The new owner - // /// @param tokens array of pairs of token ID and token URI for minted tokens - // /// @dev EVM selector for this function is: 0x36543006, - // /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) - // function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) external returns (bool); - + /// @notice Function to mint multiple tokens with the given tokenUris. + /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + /// numbers and first number should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokens array of pairs of token ID and token URI for minted tokens + /// @dev EVM selector for this function is: 0x36543006, + /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) + function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) external returns (bool); } /// @dev anonymous struct diff --git a/tests/src/eth/api/UniqueRefungible.sol b/tests/src/eth/api/UniqueRefungible.sol index 2cb52a5fa5..8ae0f75529 100644 --- a/tests/src/eth/api/UniqueRefungible.sol +++ b/tests/src/eth/api/UniqueRefungible.sol @@ -330,15 +330,19 @@ interface ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents { /// or in textual repr: mintWithTokenURI(address,string) function mintWithTokenURI(address to, string memory tokenUri) external returns (uint256); - // /// @notice Function to mint token with the given tokenUri. - // /// @dev `tokenId` should be obtained with `nextTokenId` method, - // /// unlike standard, you can't specify it manually - // /// @param to The new owner - // /// @param tokenId ID of the minted RFT - // /// @param tokenUri Token URI that would be stored in the RFT properties - // /// @dev EVM selector for this function is: 0x50bb4e7f, - // /// or in textual repr: mintWithTokenURI(address,uint256,string) - // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) external returns (bool); + /// @notice Function to mint token with the given tokenUri. + /// @dev `tokenId` should be obtained with `nextTokenId` method, + /// unlike standard, you can't specify it manually + /// @param to The new owner + /// @param tokenId ID of the minted RFT + /// @param tokenUri Token URI that would be stored in the RFT properties + /// @dev EVM selector for this function is: 0x50bb4e7f, + /// or in textual repr: mintWithTokenURI(address,uint256,string) + function mintWithTokenURI( + address to, + uint256 tokenId, + string memory tokenUri + ) external returns (bool); /// @dev Not implemented /// @dev EVM selector for this function is: 0x7d64bcb4, @@ -394,14 +398,14 @@ interface ERC721UniqueExtensions is Dummy, ERC165 { // /// or in textual repr: mintBulk(address,uint256[]) // function mintBulk(address to, uint256[] memory tokenIds) external returns (bool); - // /// @notice Function to mint multiple tokens with the given tokenUris. - // /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - // /// numbers and first number should be obtained with `nextTokenId` method - // /// @param to The new owner - // /// @param tokens array of pairs of token ID and token URI for minted tokens - // /// @dev EVM selector for this function is: 0x36543006, - // /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) - // function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) external returns (bool); + /// @notice Function to mint multiple tokens with the given tokenUris. + /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + /// numbers and first number should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokens array of pairs of token ID and token URI for minted tokens + /// @dev EVM selector for this function is: 0x36543006, + /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) + function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) external returns (bool); /// Returns EVM address for refungible token /// diff --git a/tests/src/eth/nonFungibleAbi.json b/tests/src/eth/nonFungibleAbi.json index 475fafde5a..35941ba33b 100644 --- a/tests/src/eth/nonFungibleAbi.json +++ b/tests/src/eth/nonFungibleAbi.json @@ -266,6 +266,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { + "components": [ + { "internalType": "uint256", "name": "field_0", "type": "uint256" }, + { "internalType": "string", "name": "field_1", "type": "string" } + ], + "internalType": "struct Tuple6[]", + "name": "tokens", + "type": "tuple[]" + } + ], + "name": "mintBulkWithTokenURI", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, @@ -276,6 +294,17 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, + { "internalType": "string", "name": "tokenUri", "type": "string" } + ], + "name": "mintWithTokenURI", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "mintingFinished", diff --git a/tests/src/eth/reFungibleAbi.json b/tests/src/eth/reFungibleAbi.json index be3e7524a7..603cd206d5 100644 --- a/tests/src/eth/reFungibleAbi.json +++ b/tests/src/eth/reFungibleAbi.json @@ -266,6 +266,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { + "components": [ + { "internalType": "uint256", "name": "field_0", "type": "uint256" }, + { "internalType": "string", "name": "field_1", "type": "string" } + ], + "internalType": "struct Tuple6[]", + "name": "tokens", + "type": "tuple[]" + } + ], + "name": "mintBulkWithTokenURI", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, @@ -276,6 +294,17 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, + { "internalType": "string", "name": "tokenUri", "type": "string" } + ], + "name": "mintWithTokenURI", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "mintingFinished", From 49ed2a2797e242cbc034a0c7a9a4983d72e47171 Mon Sep 17 00:00:00 2001 From: Alex Saft Date: Fri, 14 Oct 2022 22:45:09 +0300 Subject: [PATCH 1153/1274] fix: hide mintWithTokenURI and temporary unhide mintBulk --- pallets/nonfungible/src/erc.rs | 4 +- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4274 -> 4339 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 64 ++++++++---------- pallets/refungible/src/erc.rs | 4 +- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4301 -> 4366 bytes .../refungible/src/stubs/UniqueRefungible.sol | 64 ++++++++---------- tests/src/eth/api/UniqueNFT.sol | 38 +++++------ tests/src/eth/api/UniqueRefungible.sol | 38 +++++------ tests/src/eth/nonFungibleAbi.json | 21 +++--- tests/src/eth/reFungibleAbi.json | 21 +++--- 10 files changed, 118 insertions(+), 136 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index e562baa5c0..c8664415c7 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -510,7 +510,7 @@ impl NonfungibleHandle { /// @param to The new owner /// @param tokenId ID of the minted NFT /// @param tokenUri Token URI that would be stored in the NFT properties - #[solidity(/*hide,*/ rename_selector = "mintWithTokenURI")] + #[solidity(hide, rename_selector = "mintWithTokenURI")] #[weight(>::create_item())] fn mint_with_token_uri_check_id( &mut self, @@ -668,7 +668,7 @@ impl NonfungibleHandle { /// should be obtained with `nextTokenId` method /// @param to The new owner /// @param tokenIds IDs of the minted NFTs - #[solidity(hide)] + // #[solidity(hide)] #[weight(>::create_multiple_items(token_ids.len() as u32))] fn mint_bulk(&mut self, caller: caller, to: address, token_ids: Vec) -> Result { let caller = T::CrossAccountId::from_eth(caller); diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index a3b4cc228e482d511ef52ab73e7975cee8b82e84..c87e5e30b39a2d592542f144563aa618ac8caf1e 100644 GIT binary patch delta 1716 zcmah}U5Fc16wck*{LF8XZnEu~v^&{t)!G+rjkZ!HxV0!NIEHOv87=p^rBGO`SfvGP zH}jY554DrrwX_I=LQ7YQ+KpmCE0n&}t)eJZUu*@76_o1Yi>RyKJ9j2bd@&1|{m%K$ zIo~;RP8JHk71HoKSSrI?Va+hg?$eRfr)SeAKuxsgUaLbWzd|Ha3- z&B<-^bGtIA_b{BETU z=;O8c2J&cMj-LUyXfOg*vkpKRs&H@s4qBk!0idaA_&C27aQHlbr*d}{MrzACO5AUu zgn<9#bK9TtO|fkzF;#RzAeo?D=T>A<;zj1QiY*PQHYh?s{z^HnW~PbvM3C+zeo|N^ ze!!rH5|{9#Ff{rj!*(aiph188LA=l~rvQq5U(x3@4e#u1-_^dbk+F;hnR0^;d<7D=`?ewyb|PWSMEn)z~(aIGat9)*fZd=K6=&nh!Pmua8Zw;E{9o0fRM|+d}nRmoWBOS5QtPoh8&?y+mQit8l9z~ z`sI~=26@;v$>Mt3k2Uh?swY1{>SYJU0y1>SWqafnITd*yzN)Or&IaB&Hc)aX#FI|0 z8aWquE;ww|#PgYVUUcx}luO?3Ll|0VPu)@wxQr)~>S`tLV`W{a1pOhP7dM~GrO8Q7 zTKz3ecdV4bA>}!IB{}>sxkF%NkaDt$l+Q_H{|wao&9a@%!f4I}$24Y*%#w>xT@^<3 zI$eBav1*LjCMdfOaHj!M&f-$4u>Q-D$kz|jFg*7ly~Z(N^wS=o5+<-2}8`orAY X;NrQr4)5N-Z(@8Tl1Ss3)b0NQ_dF@; delta 1762 zcmZuxYiL_#81C1!NzN^oHHntC=Cs{SidBDPZt9Q1HXL5M!?7fkBl>-|GGy}tMJ7Yd zxo4reo#d-i84SgLqYh_L+*(B^h|ob5L=lzAbO`$+ZVcv+GT-l9%88g0^5wlfdEe)I zpIjgQXgH65!xJjrigm+Ky{Ef!ub<7ogSs={FD;^9QC3-=tmjELU(;vUSNe8hXLj$G zhs^@%c@2E~4_*9o=~BW$*(+6zBvwe`*&Votq;Ar=-YrAhnQxjTrkF3Sc398Rk9$XV z{S^0c4|P};SUt%QG3{eLA6ncknokyHg`Rjp>Snw^*cP|^SRyJHo{ZNCr{k756|YOH zw3&Q#<_yb-syhb}ug0sT`#LPbtoKN-7?2XTL?1IEO!|iIObvHS*Ql1-%nlZU? zF*uf1Q;TTWF!Du``nHCip zMio5aqDo8AO=v28A;?fjdX2u!k38~MVA~ap;F%amu-3WW5Qob*%n)ZmQ3xkv*#+1_ zRcnJa&X9ep1=fS~3O`bRBC34G_Pb#;!fkios1fc4NxoDC+It6pZZG^LJs^wk3o-dY z)+D_s+`esB;4&Jhr8IEaLYoNxSm>(|9ur@(!wgpPHm!M0vH93|_HuMi5!$9$EsKZ7>t#ou&{;fRweeHaz4 zY)F)i`(}%-Wb;GP&r$e~|26>&e>FRhFVt||Dzz2Ov2sR&WbUP<+~~f^8b(HeWM*q5 za~xE2tKTh|s$DFCkW6$!3A|nNhKglR#$B4r1dwUgj49hhs^=iDiAd%}YUGCREPnpu w>3`hwC&&7ZJauq=us*$d;QZM1SEV(5dGgb~<*l=GFC3cL-IdPL)!g=f0kW(&?EnA( diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.sol b/pallets/nonfungible/src/stubs/UniqueNFT.sol index d6cb532a22..94710c62c7 100644 --- a/pallets/nonfungible/src/stubs/UniqueNFT.sol +++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol @@ -500,26 +500,22 @@ contract ERC721UniqueMintable is Dummy, ERC165, ERC721UniqueMintableEvents { return 0; } - /// @notice Function to mint token with the given tokenUri. - /// @dev `tokenId` should be obtained with `nextTokenId` method, - /// unlike standard, you can't specify it manually - /// @param to The new owner - /// @param tokenId ID of the minted NFT - /// @param tokenUri Token URI that would be stored in the NFT properties - /// @dev EVM selector for this function is: 0x50bb4e7f, - /// or in textual repr: mintWithTokenURI(address,uint256,string) - function mintWithTokenURI( - address to, - uint256 tokenId, - string memory tokenUri - ) public returns (bool) { - require(false, stub_error); - to; - tokenId; - tokenUri; - dummy = 0; - return false; - } + // /// @notice Function to mint token with the given tokenUri. + // /// @dev `tokenId` should be obtained with `nextTokenId` method, + // /// unlike standard, you can't specify it manually + // /// @param to The new owner + // /// @param tokenId ID of the minted NFT + // /// @param tokenUri Token URI that would be stored in the NFT properties + // /// @dev EVM selector for this function is: 0x50bb4e7f, + // /// or in textual repr: mintWithTokenURI(address,uint256,string) + // function mintWithTokenURI(address to, uint256 tokenId, string memory tokenUri) public returns (bool) { + // require(false, stub_error); + // to; + // tokenId; + // tokenUri; + // dummy = 0; + // return false; + // } /// @dev Not implemented /// @dev EVM selector for this function is: 0x7d64bcb4, @@ -590,20 +586,20 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { return 0; } - // /// @notice Function to mint multiple tokens. - // /// @dev `tokenIds` should be an array of consecutive numbers and first number - // /// should be obtained with `nextTokenId` method - // /// @param to The new owner - // /// @param tokenIds IDs of the minted NFTs - // /// @dev EVM selector for this function is: 0x44a9945e, - // /// or in textual repr: mintBulk(address,uint256[]) - // function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) { - // require(false, stub_error); - // to; - // tokenIds; - // dummy = 0; - // return false; - // } + /// @notice Function to mint multiple tokens. + /// @dev `tokenIds` should be an array of consecutive numbers and first number + /// should be obtained with `nextTokenId` method + /// @param to The new owner + /// @param tokenIds IDs of the minted NFTs + /// @dev EVM selector for this function is: 0x44a9945e, + /// or in textual repr: mintBulk(address,uint256[]) + function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) { + require(false, stub_error); + to; + tokenIds; + dummy = 0; + return false; + } /// @notice Function to mint multiple tokens with the given tokenUris. /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive diff --git a/pallets/refungible/src/erc.rs b/pallets/refungible/src/erc.rs index 3b03119bbc..c4893255ba 100644 --- a/pallets/refungible/src/erc.rs +++ b/pallets/refungible/src/erc.rs @@ -536,7 +536,7 @@ impl RefungibleHandle { /// @param to The new owner /// @param tokenId ID of the minted RFT /// @param tokenUri Token URI that would be stored in the RFT properties - #[solidity(/*hide,*/ rename_selector = "mintWithTokenURI")] + #[solidity(hide, rename_selector = "mintWithTokenURI")] #[weight(>::create_item())] fn mint_with_token_uri_check_id( &mut self, @@ -705,7 +705,7 @@ impl RefungibleHandle { /// should be obtained with `nextTokenId` method /// @param to The new owner /// @param tokenIds IDs of the minted RFTs - #[solidity(hide)] + // #[solidity(hide)] #[weight(>::create_multiple_items(token_ids.len() as u32))] fn mint_bulk(&mut self, caller: caller, to: address, token_ids: Vec) -> Result { let caller = T::CrossAccountId::from_eth(caller); diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index 6a8fc4c7d8f606e4a7c1dfa7045d7d0ff8ac463e..ed7c8a2ac676c6af6709f41328e1b4815729a618 100644 GIT binary patch delta 1796 zcmZuxU2IfE6yE7}f9`L0Dg9$xx-Bhekhx3nLGEcyT-knoBN&l z&Y5%Od}o$=&h{qJO_a@{%}6(loO>{oxO*`<3mTdR7v{ku(6o2#$}dUW&|lC;*e6*C zKhyNW+{`QMapNqty?FVAxv(0xK_d1?Uc=$*IBf4kjW{lovyuL;=a}sn4v%}b(K=+1 ztC39;_iJr}R)@}0)Yub5^kPl6ECeT^d-en_=Q@uCC=sP?h7>p1dlUL)_u z+QBe69_y#?cVeCN{YC64Fud?{Y#wZYD1_2x5r7;@qwWsWZGlz?fHH(+LFfY;$qiv} z&)xzG>1!H}@3(NgKd;T8G;s;Y5C~yj^CH;cbuBpls!xm_Fg+r5qpQd+daG{|D0Xf8 zEC{w(vL*qJ{zX%SC|d-XGStl^jdG1MAdcT5Z;QPzg*mn}2+${+3LBIqbog@$G@xJJ zPC7pe0eiG>Gbo7_D?xZQDpW*LbV zEJX`?#$g91e#(}NHLVErGhy0uFx5=0-}qK6F5&10d2P}J86!7E-zCp$xw`)F+_Xgn z<8{uQ203WwV7UnBAB%M8pne|04yp|LqX+2LDMT6|KgpZaVV)h93QSPsZ>9C1bd=j{ zfVvG(Y{rt!4SEJk6~DB+Mz0wZDZAyA2`u1R25=`WT9kB=lPfl;Xr|2y{;ptU%p5bg zHgK`@IeA^}OiC-k)~j60WS5ZI>giNRx>I6pmbdyGd57akft`3kRAB70}MrqN2|?}H{it8Uo;8~3YA8Y^+G%9`Be-|J+k3~;}H zWym_DWc@6ZA@Y^l2}a2cwR6nkMx&}&k2)JrFW4rPJ)6N9Hq2hHs&ZEr|92mMJh5`y zp%;heT%m)ftPs@HHK8hgY_*jiFr7PP1*L7uq%&DFP3qGDGy7jAyJXn4qFXr>viBJX zm_{eP9;{X!t8{!Ptkw$D94ldjv3jO3GQ8*15p*-<)TYoe1;%=;E*7wQkE9bV zoA0rB(^NZYH;qDCk&T49Trl?8Cdj!CaHjxPuMjQK^W?(^Kb$=I@u`6~F5SL$YkBC) i(}`{UL>dQgIaok-8M!dha~ii3v>defOO2 zoO{kUt>QO@K6nF`D{u_zhEZwnj!CB$`;LJ%;vby_umaM``CYX>v}RP*r|DnZi9ect z=8OI2AnG|rxEE%x{L;A{w}HgOsv3%4Lvj0I*n^k>+)9j&Oi=C}6yNJ{d%Dm;{B2@G z?XM`8+TDdt5Y$r$6+NwHfY|kZWa4BrgUd$|GZ4+^wnmY67H^`m-!AuFG?Du%iumy^ z^h1}-9{gGF&Z#XlB5aN6x~4E2%@&p@x_}ZTe@Iazcq-ulg`eozHI%qq)$k|DVIbgr z$x-q=p3ITwQgR#!otw!8P%wxSI63!n_}LTV!z#owj2 zh*c7$|EnQp%0kRIPP5s3Euea*OhQ#P5!?a8IO?H^O?n4DJ z%NVo89juS-5(MO1&c9b$Ilj1O&MHv`lM5dW@E=q1Ek;ix_k*T43u&$~8o zHPa@u;xDO)Kj&Y^tWdsfgErz%RW<#v;(c7jZ7aSZ%a%iX=YREO?rok9o4@0;NZ{~4 zVvbmST{<_r)hCUv@dz)6p);(`sFHgy5y& z3TxJot7wiT8F3`;RHt`sJMb2~k##B%KOwCZ-cTVh29a1(k$4&-DKmDOUhI%jfpS}h zF|AI0DxOr0N!tXKwgcKtfW$-ixKy}*e(uFvM_122^z7o}&DNKjz-ng&9eH}9xpt-Y X%5$Ihe?9Z|-r4Di7?Z{~rA_| Date: Sat, 15 Oct 2022 03:26:36 +0300 Subject: [PATCH 1154/1274] test: fixed and improved tests for ERC721Metadata compatible collections. WIP, 1 test still fails --- tests/src/eth/base.test.ts | 77 ++++---- tests/src/eth/collectionProperties.test.ts | 99 ++++++---- tests/src/eth/collectionSponsoring.test.ts | 74 +++----- .../src/eth/fractionalizer/Fractionalizer.sol | 3 +- .../eth/fractionalizer/fractionalizer.test.ts | 50 ++--- tests/src/eth/nesting/nest.test.ts | 175 +++++++----------- tests/src/eth/nonFungible.test.ts | 50 +++-- tests/src/eth/payable.test.ts | 15 +- tests/src/eth/proxy/UniqueNFTProxy.sol | 13 +- tests/src/eth/proxy/nonFungibleProxy.test.ts | 15 +- tests/src/eth/reFungible.test.ts | 80 ++++---- tests/src/eth/reFungibleToken.test.ts | 33 ++-- tests/src/eth/util/playgrounds/unique.dev.ts | 39 ++-- 13 files changed, 328 insertions(+), 395 deletions(-) diff --git a/tests/src/eth/base.test.ts b/tests/src/eth/base.test.ts index c3c9a7fbcb..89a44c8d11 100644 --- a/tests/src/eth/base.test.ts +++ b/tests/src/eth/base.test.ts @@ -23,7 +23,7 @@ import {EthUniqueHelper, itEth, usingEthPlaygrounds, expect} from './util/playgr describe('Contract calls', () => { let donor: IKeyringPair; - before(async function() { + before(async function () { await usingEthPlaygrounds(async (_helper, privateKey) => { donor = privateKey('//Alice'); }); @@ -40,7 +40,12 @@ describe('Contract calls', () => { itEth('Balance transfer fee is less than 0.2 UNQ', async ({helper}) => { const userA = await helper.eth.createAccountWithBalance(donor); const userB = helper.eth.createAccount(); - const cost = await helper.eth.calculateFee({Ethereum: userA}, () => helper.getWeb3().eth.sendTransaction({from: userA, to: userB, value: '1000000', gas: helper.eth.DEFAULT_GAS})); + const cost = await helper.eth.calculateFee({Ethereum: userA}, () => helper.getWeb3().eth.sendTransaction({ + from: userA, + to: userB, + value: '1000000', + gas: helper.eth.DEFAULT_GAS + })); const balanceB = await helper.balance.getEthereum(userB); expect(cost - balanceB < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))).to.be.true; }); @@ -69,67 +74,59 @@ describe('Contract calls', () => { describe('ERC165 tests', async () => { // https://eips.ethereum.org/EIPS/eip-165 - let collection: number; + let erc721MetadataCompatibleNftCollectionId: number; + let simpleNftCollectionId: number; let minter: string; - function contract(helper: EthUniqueHelper): Contract { - return helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection), 'nft', minter); + const BASE_URI = 'base/'; + + async function checkInterface(helper: EthUniqueHelper, interfaceId: string, simpleResult: boolean, compatibleResult: boolean) { + const simple = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(simpleNftCollectionId), 'nft', minter); + const compatible = helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(erc721MetadataCompatibleNftCollectionId), 'nft', minter); + + expect(await simple.methods.supportsInterface(interfaceId).call()).to.equal(simpleResult, `empty (not ERC721Metadata compatible) NFT collection returns not ${simpleResult}`); + expect(await compatible.methods.supportsInterface(interfaceId).call()).to.equal(compatibleResult, `ERC721Metadata compatible NFT collection returns not ${compatibleResult}`); } before(async () => { await usingEthPlaygrounds(async (helper, privateKey) => { const donor = privateKey('//Alice'); - const [alice] = await helper.arrange.createAccounts([10n], donor); - ({collectionId: collection} = await helper.nft.mintCollection( - alice, - { - name: 'test', - description: 'test', - tokenPrefix: 'test', - properties: [{key: 'ERC721Metadata', value: '1'}], - tokenPropertyPermissions: [{ - key: 'URI', - permission: { - mutable: true, - collectionAdmin: true, - tokenOwner: false, - }, - }], - }, - )); - minter = helper.eth.createAccount(); + minter = await helper.eth.createAccountWithBalance(donor); + + simpleNftCollectionId = (await helper.eth.createNFTCollection(minter, 'n', 'd', 'p')).collectionId; + erc721MetadataCompatibleNftCollectionId = (await helper.eth.createERC721MetadataCompatibleNFTCollection(minter, 'n', 'd', 'p', BASE_URI)).collectionId; }); }); - itEth('interfaceID == 0xffffffff always false', async ({helper}) => { - expect(await contract(helper).methods.supportsInterface('0xffffffff').call()).to.be.false; + itEth('nonexistent interfaceID - 0xffffffff - always false', async ({helper}) => { + await checkInterface(helper, '0xffffffff', false, false); }); - itEth('ERC721 support', async ({helper}) => { - expect(await contract(helper).methods.supportsInterface('0x780e9d63').call()).to.be.true; + itEth('ERC721 - 0x780e9d63 - support', async ({helper}) => { + await checkInterface(helper, '0x780e9d63', true, true); }); - itEth('ERC721Metadata support', async ({helper}) => { - expect(await contract(helper).methods.supportsInterface('0x5b5e139f').call()).to.be.true; + itEth('ERC721Metadata - 0x5b5e139f - support', async ({helper}) => { + await checkInterface(helper, '0x5b5e139f', false, true); }); - itEth('ERC721Mintable support', async ({helper}) => { - expect(await contract(helper).methods.supportsInterface('0x68ccfe89').call()).to.be.true; + itEth('ERC721UniqueMintable - 0x476ff149 - support', async ({helper}) => { + await checkInterface(helper, '0x476ff149', true, true); }); - itEth('ERC721Enumerable support', async ({helper}) => { - expect(await contract(helper).methods.supportsInterface('0x780e9d63').call()).to.be.true; + itEth('ERC721Enumerable - 0x780e9d63 - support', async ({helper}) => { + await checkInterface(helper, '0x780e9d63', true, true); }); - itEth('ERC721UniqueExtensions support', async ({helper}) => { - expect(await contract(helper).methods.supportsInterface('0xd74d154f').call()).to.be.true; + itEth('ERC721UniqueExtensions - 0x4468500d - support', async ({helper}) => { + await checkInterface(helper, '0x4468500d', true, true); }); - itEth('ERC721Burnable support', async ({helper}) => { - expect(await contract(helper).methods.supportsInterface('0x42966c68').call()).to.be.true; + itEth('ERC721Burnable - 0x42966c68 - support', async ({helper}) => { + await checkInterface(helper, '0x42966c68', true, true); }); - itEth('ERC165 support', async ({helper}) => { - expect(await contract(helper).methods.supportsInterface('0x01ffc9a7').call()).to.be.true; + itEth('ERC165 - 0x01ffc9a7 - support', async ({helper}) => { + await checkInterface(helper, '0x01ffc9a7', true, true); }); }); diff --git a/tests/src/eth/collectionProperties.test.ts b/tests/src/eth/collectionProperties.test.ts index 840f7ed90e..e19ceb74c5 100644 --- a/tests/src/eth/collectionProperties.test.ts +++ b/tests/src/eth/collectionProperties.test.ts @@ -1,6 +1,7 @@ -import {itEth, usingEthPlaygrounds, expect} from './util/playgrounds'; +import {itEth, usingEthPlaygrounds, expect, EthUniqueHelper} from './util/playgrounds'; import {IKeyringPair} from '@polkadot/types/types'; import {Pallets} from '../util/playgrounds'; +import {IProperty, ITokenPropertyPermission} from "../util/playgrounds/types"; describe('EVM collection properties', () => { let donor: IKeyringPair; @@ -65,52 +66,82 @@ describe('Supports ERC721Metadata', () => { }); }); - itEth('ERC721Metadata property can be set for NFT collection', async({helper}) => { + const checkERC721Metadata = async (helper: EthUniqueHelper, mode: 'nft' | 'rft') => { const caller = await helper.eth.createAccountWithBalance(donor); - const tokenPropertyPermissions = [{ - key: 'URI', - permission: { - mutable: true, - collectionAdmin: true, - tokenOwner: false, - }, - }]; - const collection = await helper.nft.mintCollection(donor, {name: 'col', description: 'descr', tokenPrefix: 'COL', tokenPropertyPermissions}); + const bruh = await helper.eth.createAccountWithBalance(donor); - await collection.addAdmin(donor, {Ethereum: caller}); - const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller); + const BASE_URI = 'base/' + const SUFFIX = 'suffix1' + const URI = 'uri1' - await contract.methods.setCollectionProperty('ERC721Metadata', Buffer.from('1')).send({from: caller}); + const collectionHelpers = helper.ethNativeContract.collectionHelpers(caller); + const creatorMethod = mode === 'rft' ? 'createRFTCollection' : 'createNFTCollection' - expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.true; + const {collectionId, collectionAddress} = await helper.eth[creatorMethod](caller, 'n', 'd', 'p') - await contract.methods.setCollectionProperty('ERC721Metadata', Buffer.from('0')).send({from: caller}); + const contract = helper.ethNativeContract.collectionById(collectionId, mode, caller); + await contract.methods.addCollectionAdmin(bruh).send(); // to check that admin will work too + const collection1 = await helper.nft.getCollectionObject(collectionId); + const data1 = await collection1.getData() + expect(data1?.raw.flags.erc721metadata).to.be.false; expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.false; - }); - itEth.ifWithPallets('ERC721Metadata property can be set for RFT collection', [Pallets.ReFungible], async({helper}) => { - const caller = await helper.eth.createAccountWithBalance(donor); - const tokenPropertyPermissions = [{ - key: 'URI', - permission: { - mutable: true, - collectionAdmin: true, - tokenOwner: false, - }, - }]; - const collection = await helper.rft.mintCollection(donor, {name: 'col', description: 'descr', tokenPrefix: 'COL', tokenPropertyPermissions}); + await collectionHelpers.methods.makeCollectionERC721MetadataCompatible(collectionAddress, BASE_URI) + .send({from: bruh}); - await collection.addAdmin(donor, {Ethereum: caller}); + expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.true; - const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'nft', caller); + const collection2 = await helper.nft.getCollectionObject(collectionId); + const data2 = await collection2.getData() + expect(data2?.raw.flags.erc721metadata).to.be.true; - await contract.methods.setCollectionProperty('ERC721Metadata', Buffer.from('1')).send({from: caller}); + const TPPs = data2?.raw.tokenPropertyPermissions + expect(TPPs?.length).to.equal(2); - expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.true; + expect(TPPs.find((tpp: ITokenPropertyPermission) => { + return tpp.key === "URI" && tpp.permission.mutable && tpp.permission.collectionAdmin && !tpp.permission.tokenOwner + })).to.be.not.null - await contract.methods.setCollectionProperty('ERC721Metadata', Buffer.from('0')).send({from: caller}); + expect(TPPs.find((tpp: ITokenPropertyPermission) => { + return tpp.key === "URISuffix" && tpp.permission.mutable && tpp.permission.collectionAdmin && !tpp.permission.tokenOwner + })).to.be.not.null - expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.false; + expect(data2?.raw.properties?.find((property: IProperty) => { + return property.key === "baseURI" && property.value === BASE_URI + })).to.be.not.null + + const token1Result = await contract.methods.mint(bruh).send(); + const tokenId1 = token1Result.events.Transfer.returnValues.tokenId; + + expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI); + + await contract.methods.setProperty(tokenId1, "URISuffix", Buffer.from(SUFFIX)).send(); + expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI + SUFFIX); + + await contract.methods.setProperty(tokenId1, "URI", Buffer.from(URI)).send(); + expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(URI); + + await contract.methods.deleteProperty(tokenId1, "URI").send(); + expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI + SUFFIX); + + const token2Result = await contract.methods.mintWithTokenURI(bruh, URI).send(); + const tokenId2 = token2Result.events.Transfer.returnValues.tokenId; + + expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(URI); + + await contract.methods.deleteProperty(tokenId2, "URI").send(); + expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(BASE_URI); + + await contract.methods.setProperty(tokenId2, "URISuffix", Buffer.from(SUFFIX)).send(); + expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(BASE_URI + SUFFIX); + } + + itEth('ERC721Metadata property can be set for NFT collection', async({helper}) => { + await checkERC721Metadata(helper, 'nft'); + }); + + itEth.ifWithPallets('ERC721Metadata property can be set for RFT collection', [Pallets.ReFungible], async({helper}) => { + await checkERC721Metadata(helper, 'rft'); }); }); diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index 98b6282403..abb41f36e3 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -33,9 +33,8 @@ describe('evm collection sponsoring', () => { await collection.addToAllowList(alice, {Ethereum: minter}); - const nextTokenId = await contract.methods.nextTokenId().call(); - expect(nextTokenId).to.equal('1'); - const result = await contract.methods.mint(minter, nextTokenId).send(); + const result = await contract.methods.mint(minter).send(); + const events = helper.eth.normalizeEvents(result.events); expect(events).to.be.deep.equal([ { @@ -44,7 +43,7 @@ describe('evm collection sponsoring', () => { args: { from: '0x0000000000000000000000000000000000000000', to: minter, - tokenId: nextTokenId, + tokenId: '1', }, }, ]); @@ -62,11 +61,11 @@ describe('evm collection sponsoring', () => { // expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; // result = await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner}); // expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.true; - + // const confirmTx = await api.tx.unique.confirmSponsorship(collectionId); // await submitTransactionAsync(sponsor, confirmTx); // expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; - + // const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner}); // expect(bigIntToSub(api, BigInt(sponsorTuple[1]))).to.be.eq(sponsor.address); // }); @@ -83,28 +82,26 @@ describe('evm collection sponsoring', () => { expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner}); expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.true; - + await collectionEvm.methods.confirmCollectionSponsorship().send({from: sponsor}); expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; - + await collectionEvm.methods.removeCollectionSponsor().send({from: owner}); - + const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner}); expect(sponsorTuple.field_0).to.be.eq('0x0000000000000000000000000000000000000000'); }); itEth('Sponsoring collection from evm address via access list', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelpers.methods.createERC721MetadataCompatibleNFTCollection('Sponsor collection', '1', '1', '').send({value: Number(2n * nominal)}); - const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); - const collectionId = helper.ethAddress.extractCollectionId(collectionIdAddress); + const {collectionId, collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'Sponsor collection', '1', '1', ''); + const collection = helper.nft.getCollectionObject(collectionId); const sponsor = await helper.eth.createAccountWithBalance(donor); - const collectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner}); + await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner}); let collectionData = (await collection.getData())!; expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true)); await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); @@ -133,23 +130,17 @@ describe('evm collection sponsoring', () => { const sponsorBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor)); { - const nextTokenId = await collectionEvm.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - const result = await collectionEvm.methods.mintWithTokenURI( - user, - nextTokenId, - 'Test URI', - ).send({from: user}); + const result = await collectionEvm.methods.mintWithTokenURI(user, 'Test URI').send({from: user}); const events = helper.eth.normalizeEvents(result.events); expect(events).to.be.deep.equal([ { - address: collectionIdAddress, + address: collectionAddress, event: 'Transfer', args: { from: '0x0000000000000000000000000000000000000000', to: user, - tokenId: nextTokenId, + tokenId: '1', }, }, ]); @@ -173,10 +164,10 @@ describe('evm collection sponsoring', () => { // const collectionEvm = evmCollection(web3, owner, collectionIdAddress); // await collectionEvm.methods.setCollectionSponsorSubstrate(sponsor.addressRaw).send({from: owner}); - + // const confirmTx = await api.tx.unique.confirmSponsorship(collectionId); // await submitTransactionAsync(sponsor, confirmTx); - + // const user = createEthAccount(web3); // const nextTokenId = await collectionEvm.methods.nextTokenId().call(); // expect(nextTokenId).to.be.equal('1'); @@ -221,39 +212,32 @@ describe('evm collection sponsoring', () => { itEth('Check that transaction via EVM spend money from sponsor address', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); - let result = await collectionHelpers.methods.createERC721MetadataCompatibleNFTCollection('Sponsor collection', '1', '1', '').send({value: Number(2n * nominal)}); - const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); - const collectionId = helper.ethAddress.extractCollectionId(collectionIdAddress); + const {collectionAddress, collectionId} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner,'Sponsor collection', '1', '1', ''); const collection = helper.nft.getCollectionObject(collectionId); const sponsor = await helper.eth.createAccountWithBalance(donor); - const collectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner); + const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - result = await collectionEvm.methods.setCollectionSponsor(sponsor).send(); + await collectionEvm.methods.setCollectionSponsor(sponsor).send(); let collectionData = (await collection.getData())!; expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true)); await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); - const sponsorCollection = helper.ethNativeContract.collection(collectionIdAddress, 'nft', sponsor); + const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'nft', sponsor); await sponsorCollection.methods.confirmCollectionSponsorship().send(); collectionData = (await collection.getData())!; expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true)); const user = helper.eth.createAccount(); await collectionEvm.methods.addCollectionAdmin(user).send(); - + const ownerBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner)); const sponsorBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor)); - const userCollectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', user); - const nextTokenId = await userCollectionEvm.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - result = await userCollectionEvm.methods.mintWithTokenURI( - user, - nextTokenId, - 'Test URI', - ).send(); + const userCollectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', user); + + let result = await userCollectionEvm.methods.mintWithTokenURI(user, 'Test URI',).send(); + const tokenId = result.events.Transfer.returnValues.tokenId; const events = helper.eth.normalizeEvents(result.events); const address = helper.ethAddress.fromCollectionId(collectionId); @@ -265,12 +249,12 @@ describe('evm collection sponsoring', () => { args: { from: '0x0000000000000000000000000000000000000000', to: user, - tokenId: nextTokenId, + tokenId: '1', }, }, ]); - expect(await userCollectionEvm.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); - + expect(await userCollectionEvm.methods.tokenURI(tokenId).call()).to.be.equal('Test URI'); + const ownerBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner)); expect(ownerBalanceAfter).to.be.eq(ownerBalanceBefore); const sponsorBalanceAfter = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor)); diff --git a/tests/src/eth/fractionalizer/Fractionalizer.sol b/tests/src/eth/fractionalizer/Fractionalizer.sol index 29f40621ac..bc40e4219a 100644 --- a/tests/src/eth/fractionalizer/Fractionalizer.sol +++ b/tests/src/eth/fractionalizer/Fractionalizer.sol @@ -124,8 +124,7 @@ contract Fractionalizer { address rftTokenAddress; UniqueRefungibleToken rftTokenContract; if (nft2rftMapping[_collection][_token] == 0) { - rftTokenId = rftCollectionContract.nextTokenId(); - rftCollectionContract.mint(address(this), rftTokenId); + rftTokenId = rftCollectionContract.mint(address(this)); rftTokenAddress = rftCollectionContract.tokenContractAddress(rftTokenId); nft2rftMapping[_collection][_token] = rftTokenId; rft2nftMapping[rftTokenAddress] = Token(_collection, _token); diff --git a/tests/src/eth/fractionalizer/fractionalizer.test.ts b/tests/src/eth/fractionalizer/fractionalizer.test.ts index dd75ac149e..da8d5dc50c 100644 --- a/tests/src/eth/fractionalizer/fractionalizer.test.ts +++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts @@ -64,8 +64,8 @@ const mintRFTToken = async (helper: EthUniqueHelper, owner: string, fractionaliz }> => { const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); - const nftTokenId = await nftContract.methods.nextTokenId().call(); - await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); + const mintResult = await nftContract.methods.mint(owner).send({from: owner}); + const nftTokenId = mintResult.events.Transfer.returnValues.tokenId; await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, true).send({from: owner}); await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send({from: owner}); @@ -148,8 +148,8 @@ describe('Fractionalizer contract usage', () => { const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); - const nftTokenId = await nftContract.methods.nextTokenId().call(); - await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); + const mintResult = await nftContract.methods.mint(owner).send({from: owner}); + const nftTokenId = mintResult.events.Transfer.returnValues.tokenId; const {contract: fractionalizer} = await initContract(helper, owner); @@ -280,8 +280,8 @@ describe('Negative Integration Tests for fractionalizer', () => { const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); - const nftTokenId = await nftContract.methods.nextTokenId().call(); - await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); + const mintResult = await nftContract.methods.mint(owner).send({from: owner}); + const nftTokenId = mintResult.events.Transfer.returnValues.tokenId; const fractionalizer = await deployContract(helper, owner); @@ -295,8 +295,8 @@ describe('Negative Integration Tests for fractionalizer', () => { const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); - const nftTokenId = await nftContract.methods.nextTokenId().call(); - await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); + const mintResult = await nftContract.methods.mint(owner).send({from: owner}); + const nftTokenId = mintResult.events.Transfer.returnValues.tokenId; await nftContract.methods.transfer(nftOwner, 1).send({from: owner}); @@ -312,8 +312,8 @@ describe('Negative Integration Tests for fractionalizer', () => { const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); - const nftTokenId = await nftContract.methods.nextTokenId().call(); - await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); + const mintResult = await nftContract.methods.mint(owner).send({from: owner}); + const nftTokenId = mintResult.events.Transfer.returnValues.tokenId; const {contract: fractionalizer} = await initContract(helper, owner); @@ -327,8 +327,8 @@ describe('Negative Integration Tests for fractionalizer', () => { const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); - const nftTokenId = await nftContract.methods.nextTokenId().call(); - await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); + const mintResult = await nftContract.methods.mint(owner).send({from: owner}); + const nftTokenId = mintResult.events.Transfer.returnValues.tokenId; const {contract: fractionalizer} = await initContract(helper, owner); @@ -343,9 +343,9 @@ describe('Negative Integration Tests for fractionalizer', () => { const fractionalizer = await deployContract(helper, owner); const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT'); const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner); - const rftTokenId = await refungibleContract.methods.nextTokenId().call(); - await refungibleContract.methods.mint(owner, rftTokenId).send({from: owner}); - + const mintResult = await refungibleContract.methods.mint(owner).send({from: owner}); + const rftTokenId = mintResult.events.Transfer.returnValues.tokenId; + await expect(fractionalizer.methods.rft2nft(rftCollection.collectionAddress, rftTokenId).call({from: owner})) .to.be.rejectedWith(/RFT collection is not set$/g); }); @@ -356,9 +356,9 @@ describe('Negative Integration Tests for fractionalizer', () => { const {contract: fractionalizer} = await initContract(helper, owner); const rftCollection = await helper.eth.createRFTCollection(owner, 'rft', 'RFT collection', 'RFT'); const refungibleContract = helper.ethNativeContract.collection(rftCollection.collectionAddress, 'rft', owner); - const rftTokenId = await refungibleContract.methods.nextTokenId().call(); - await refungibleContract.methods.mint(owner, rftTokenId).send({from: owner}); - + const mintResult = await refungibleContract.methods.mint(owner).send({from: owner}); + const rftTokenId = mintResult.events.Transfer.returnValues.tokenId; + await expect(fractionalizer.methods.rft2nft(rftCollection.collectionAddress, rftTokenId).call()) .to.be.rejectedWith(/Wrong RFT collection$/g); }); @@ -373,9 +373,9 @@ describe('Negative Integration Tests for fractionalizer', () => { await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send({from: owner}); await fractionalizer.methods.setRFTCollection(rftCollection.collectionAddress).send({from: owner}); - const rftTokenId = await refungibleContract.methods.nextTokenId().call(); - await refungibleContract.methods.mint(owner, rftTokenId).send({from: owner}); - + const mintResult = await refungibleContract.methods.mint(owner).send({from: owner}); + const rftTokenId = mintResult.events.Transfer.returnValues.tokenId; + await expect(fractionalizer.methods.rft2nft(rftCollection.collectionAddress, rftTokenId).call()) .to.be.rejectedWith(/No corresponding NFT token found$/g); }); @@ -386,7 +386,7 @@ describe('Negative Integration Tests for fractionalizer', () => { const {contract: fractionalizer, rftCollectionAddress} = await initContract(helper, owner); const {rftTokenAddress} = await mintRFTToken(helper, owner, fractionalizer, 100n); - + const {tokenId} = helper.ethAddress.extractTokenId(rftTokenAddress); const refungibleTokenContract = helper.ethNativeContract.rftToken(rftTokenAddress, owner); await refungibleTokenContract.methods.transfer(receiver, 50).send({from: owner}); @@ -420,7 +420,7 @@ describe('Negative Integration Tests for fractionalizer', () => { await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftToken.tokenId, 100).call()) .to.be.rejectedWith(/TransferNotAllowed$/g); }); - + itEth('fractionalize NFT with RFT transfers disallowed', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor, 20n); @@ -434,8 +434,8 @@ describe('Negative Integration Tests for fractionalizer', () => { const nftCollection = await helper.eth.createNFTCollection(owner, 'nft', 'NFT collection', 'NFT'); const nftContract = helper.ethNativeContract.collection(nftCollection.collectionAddress, 'nft', owner); - const nftTokenId = await nftContract.methods.nextTokenId().call(); - await nftContract.methods.mint(owner, nftTokenId).send({from: owner}); + const mintResult = await nftContract.methods.mint(owner).send({from: owner}); + const nftTokenId = mintResult.events.Transfer.returnValues.tokenId; await fractionalizer.methods.setNftCollectionIsAllowed(nftCollection.collectionAddress, true).send({from: owner}); await nftContract.methods.approve(fractionalizer.options.address, nftTokenId).send({from: owner}); diff --git a/tests/src/eth/nesting/nest.test.ts b/tests/src/eth/nesting/nest.test.ts index e2b3f2061f..2190004462 100644 --- a/tests/src/eth/nesting/nest.test.ts +++ b/tests/src/eth/nesting/nest.test.ts @@ -29,74 +29,53 @@ describe('EVM nesting tests group', () => { itEth('NFT: allows an Owner to nest/unnest their token', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const {collectionId, contract} = await createNestingCollection(helper, owner); - - // Create a token to be nested - const targetNFTTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint( - owner, - targetNFTTokenId, - ).send({from: owner}); - + + // Create a token to be nested to + const mintingTargetNFTTokenIdResult = await contract.methods.mint(owner).send({from: owner}); + const targetNFTTokenId = mintingTargetNFTTokenIdResult.events.Transfer.returnValues.tokenId; const targetNftTokenAddress = helper.ethAddress.fromTokenId(collectionId, targetNFTTokenId); - + // Create a nested token - const firstTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint( - targetNftTokenAddress, - firstTokenId, - ).send({from: owner}); - + const mintingFirstTokenIdResult = await contract.methods.mint(targetNftTokenAddress).send({from: owner}); + const firstTokenId = mintingFirstTokenIdResult.events.Transfer.returnValues.tokenId; expect(await contract.methods.ownerOf(firstTokenId).call()).to.be.equal(targetNftTokenAddress); - + // Create a token to be nested and nest - const secondTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint( - owner, - secondTokenId, - ).send({from: owner}); - + const mintingSecondTokenIdResult = await contract.methods.mint(owner).send({from: owner}); + const secondTokenId = mintingSecondTokenIdResult.events.Transfer.returnValues.tokenId; + await contract.methods.transfer(targetNftTokenAddress, secondTokenId).send({from: owner}); - expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(targetNftTokenAddress); - + // Unnest token back await contract.methods.transferFrom(targetNftTokenAddress, owner, secondTokenId).send({from: owner}); expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(owner); }); - + itEth('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - + const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(helper, owner); const {collectionAddress: collectionAddressB, contract: contractB} = await createNestingCollection(helper, owner); await contractA.methods.setCollectionNesting(true, [collectionAddressA, collectionAddressB]).send({from: owner}); - + // Create a token to nest into - const targetNftTokenId = await contractA.methods.nextTokenId().call(); - await contractA.methods.mint( - owner, - targetNftTokenId, - ).send({from: owner}); + const mintingtargetNftTokenIdResult = await contractA.methods.mint(owner).send({from: owner}); + const targetNftTokenId = mintingtargetNftTokenIdResult.events.Transfer.returnValues.tokenId; const nftTokenAddressA1 = helper.ethAddress.fromTokenId(collectionIdA, targetNftTokenId); - + // Create a token for nesting in the same collection as the target - const nftTokenIdA = await contractA.methods.nextTokenId().call(); - await contractA.methods.mint( - owner, - nftTokenIdA, - ).send({from: owner}); - + const mintingTokenIdAResult = await contractA.methods.mint(owner).send({from: owner}); + const nftTokenIdA = mintingTokenIdAResult.events.Transfer.returnValues.tokenId; + // Create a token for nesting in a different collection - const nftTokenIdB = await contractB.methods.nextTokenId().call(); - await contractB.methods.mint( - owner, - nftTokenIdB, - ).send({from: owner}); - + const mintingTokenIdBResult = await contractB.methods.mint(owner).send({from: owner}); + const nftTokenIdB = mintingTokenIdBResult.events.Transfer.returnValues.tokenId; + // Nest await contractA.methods.transfer(nftTokenAddressA1, nftTokenIdA).send({from: owner}); expect(await contractA.methods.ownerOf(nftTokenIdA).call()).to.be.equal(nftTokenAddressA1); - + await contractB.methods.transfer(nftTokenAddressA1, nftTokenIdB).send({from: owner}); expect(await contractB.methods.ownerOf(nftTokenIdB).call()).to.be.equal(nftTokenAddressA1); }); @@ -105,112 +84,88 @@ describe('EVM nesting tests group', () => { describe('Negative Test: EVM Nesting', async() => { itEth('NFT: disallows to nest token if nesting is disabled', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - + const {collectionId, contract} = await createNestingCollection(helper, owner); await contract.methods.setCollectionNesting(false).send({from: owner}); - + // Create a token to nest into - const targetNftTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint( - owner, - targetNftTokenId, - ).send({from: owner}); - - const targetNftTokenAddress = helper.ethAddress.fromTokenId(collectionId, targetNftTokenId); - + const mintingTargetTokenIdResult = await contract.methods.mint(owner).send({from: owner}); + const targetTokenId = mintingTargetTokenIdResult.events.Transfer.returnValues.tokenId; + const targetNftTokenAddress = helper.ethAddress.fromTokenId(collectionId, targetTokenId); + // Create a token to nest - const nftTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint( - owner, - nftTokenId, - ).send({from: owner}); - + const mintingNftTokenIdResult = await contract.methods.mint(owner).send({from: owner}); + const nftTokenId = mintingNftTokenIdResult.events.Transfer.returnValues.tokenId; + // Try to nest await expect(contract.methods .transfer(targetNftTokenAddress, nftTokenId) .call({from: owner})).to.be.rejectedWith('UserIsNotAllowedToNest'); }); - + itEth('NFT: disallows a non-Owner to nest someone else\'s token', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const malignant = await helper.eth.createAccountWithBalance(donor); - + const {collectionId, contract} = await createNestingCollection(helper, owner); - + // Mint a token - const targetTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint( - owner, - targetTokenId, - ).send({from: owner}); + const mintingTargetTokenIdResult = await contract.methods.mint(owner).send({from: owner}); + const targetTokenId = mintingTargetTokenIdResult.events.Transfer.returnValues.tokenId; const targetTokenAddress = helper.ethAddress.fromTokenId(collectionId, targetTokenId); - + // Mint a token belonging to a different account - const tokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint( - malignant, - tokenId, - ).send({from: owner}); - + const mintingTokenIdResult = await contract.methods.mint(malignant).send({from: owner}); + const tokenId = mintingTokenIdResult.events.Transfer.returnValues.tokenId; + // Try to nest one token in another as a non-owner account await expect(contract.methods .transfer(targetTokenAddress, tokenId) .call({from: malignant})).to.be.rejectedWith('UserIsNotAllowedToNest'); }); - + itEth('NFT: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const malignant = await helper.eth.createAccountWithBalance(donor); - + const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(helper, owner); const {collectionAddress: collectionAddressB, contract: contractB} = await createNestingCollection(helper, owner); - + await contractA.methods.setCollectionNesting(true, [collectionAddressA, collectionAddressB]).send({from: owner}); - + // Create a token in one collection - const nftTokenIdA = await contractA.methods.nextTokenId().call(); - await contractA.methods.mint( - owner, - nftTokenIdA, - ).send({from: owner}); + const mintingTokenIdAResult = await contractA.methods.mint(owner).send({from: owner}); + const nftTokenIdA = mintingTokenIdAResult.events.Transfer.returnValues.tokenId; const nftTokenAddressA = helper.ethAddress.fromTokenId(collectionIdA, nftTokenIdA); - - // Create a token in another collection belonging to someone else - const nftTokenIdB = await contractB.methods.nextTokenId().call(); - await contractB.methods.mint( - malignant, - nftTokenIdB, - ).send({from: owner}); - + + // Create a token in another collection + const mintingTokenIdBResult = await contractB.methods.mint(malignant).send({from: owner}); + const nftTokenIdB = mintingTokenIdBResult.events.Transfer.returnValues.tokenId; + // Try to drag someone else's token into the other collection and nest await expect(contractB.methods .transfer(nftTokenAddressA, nftTokenIdB) .call({from: malignant})).to.be.rejectedWith('UserIsNotAllowedToNest'); }); - + itEth('NFT: disallows to nest token in an unlisted collection', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); - + const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(helper, owner); const {contract: contractB} = await createNestingCollection(helper, owner); - + await contractA.methods.setCollectionNesting(true, [collectionAddressA]).send({from: owner}); - + // Create a token in one collection - const nftTokenIdA = await contractA.methods.nextTokenId().call(); - await contractA.methods.mint( - owner, - nftTokenIdA, - ).send({from: owner}); + const mintingTokenIdAResult = await contractA.methods.mint(owner).send({from: owner}); + const nftTokenIdA = mintingTokenIdAResult.events.Transfer.returnValues.tokenId; const nftTokenAddressA = helper.ethAddress.fromTokenId(collectionIdA, nftTokenIdA); - + // Create a token in another collection - const nftTokenIdB = await contractB.methods.nextTokenId().call(); - await contractB.methods.mint( - owner, - nftTokenIdB, - ).send({from: owner}); - + const mintingTokenIdBResult = await contractB.methods.mint(owner).send({from: owner}); + const nftTokenIdB = mintingTokenIdBResult.events.Transfer.returnValues.tokenId; + + // Try to nest into a token in the other collection, disallowed in the first await expect(contractB.methods .transfer(nftTokenAddressA, nftTokenIdB) diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 3d378443e4..e638d7c867 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -29,7 +29,7 @@ describe('NFT: Information getting', () => { [alice] = await helper.arrange.createAccounts([10n], donor); }); }); - + itEth('totalSupply', async ({helper}) => { const collection = await helper.nft.mintCollection(alice, {}); await collection.mintToken(alice); @@ -95,26 +95,23 @@ describe('Check ERC721 token URI for NFT', () => { const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'Mint collection', 'a', 'b', baseUri); const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - - const nextTokenId = await contract.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - const result = await contract.methods.mint( - receiver, - nextTokenId, - ).send(); + + const result = await contract.methods.mint(receiver).send(); + const tokenId = result.events.Transfer.returnValues.tokenId; + expect(tokenId).to.be.equal('1'); if (propertyKey && propertyValue) { // Set URL or suffix - await contract.methods.setProperty(nextTokenId, propertyKey, Buffer.from(propertyValue)).send(); + await contract.methods.setProperty(tokenId, propertyKey, Buffer.from(propertyValue)).send(); } const event = result.events.Transfer; expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000'); expect(event.returnValues.to).to.be.equal(receiver); - expect(event.returnValues.tokenId).to.be.equal(nextTokenId); + expect(event.returnValues.tokenId).to.be.equal(tokenId); - return {contract, nextTokenId}; + return {contract, nextTokenId: tokenId}; } itEth('Empty tokenURI', async ({helper}) => { @@ -156,22 +153,17 @@ describe('NFT: Plain calls', () => { const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'Mint collection', '6', '6', ''); const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - const nextTokenId = await contract.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - const result = await contract.methods.mintWithTokenURI( - receiver, - nextTokenId, - 'Test URI', - ).send(); + const result = await contract.methods.mintWithTokenURI(receiver, 'Test URI').send(); + const tokenId = result.events.Transfer.returnValues.tokenId; + expect(tokenId).to.be.equal('1'); const event = result.events.Transfer; expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000'); expect(event.returnValues.to).to.be.equal(receiver); - expect(event.returnValues.tokenId).to.be.equal(nextTokenId); - expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); + expect(await contract.methods.tokenURI(tokenId).call()).to.be.equal('Test URI'); // TODO: this wont work right now, need release 919000 first // await helper.methods.setOffchainSchema(collectionIdAddress, 'https://offchain-service.local/token-info/{id}').send(); @@ -224,7 +216,7 @@ describe('NFT: Plain calls', () => { { const result = await contract.methods.burn(tokenId).send({from: caller}); - + const event = result.events.Transfer; expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.from).to.be.equal(caller); @@ -330,7 +322,7 @@ describe('NFT: Fees', () => { [alice] = await helper.arrange.createAccounts([10n], donor); }); }); - + itEth('approve() call fee is less than 0.2UNQ', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const spender = helper.eth.createAccount(); @@ -409,7 +401,7 @@ describe('NFT: Substrate calls', () => { const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); const contract = helper.ethNativeContract.collection(collectionAddress, 'nft'); - + const events: any = []; contract.events.allEvents((_: any, event: any) => { events.push(event); @@ -433,7 +425,7 @@ describe('NFT: Substrate calls', () => { const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); const contract = helper.ethNativeContract.collection(collectionAddress, 'nft'); - + const events: any = []; contract.events.allEvents((_: any, event: any) => { events.push(event); @@ -459,14 +451,14 @@ describe('NFT: Substrate calls', () => { const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); const contract = helper.ethNativeContract.collection(collectionAddress, 'nft'); - + const events: any = []; contract.events.allEvents((_: any, event: any) => { events.push(event); }); await token.transferFrom(bob, {Substrate: alice.address}, {Ethereum: receiver}); - + const event = events[0]; expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.from).to.be.equal(helper.address.substrateToEth(alice.address)); @@ -482,14 +474,14 @@ describe('NFT: Substrate calls', () => { const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); const contract = helper.ethNativeContract.collection(collectionAddress, 'nft'); - + const events: any = []; contract.events.allEvents((_: any, event: any) => { events.push(event); }); await token.transfer(alice, {Ethereum: receiver}); - + const event = events[0]; expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.from).to.be.equal(helper.address.substrateToEth(alice.address)); @@ -558,4 +550,4 @@ describe('Common metadata', () => { const symbol = await contract.methods.symbol().call(); expect(symbol).to.equal('CHANGE'); }); -}); \ No newline at end of file +}); diff --git a/tests/src/eth/payable.test.ts b/tests/src/eth/payable.test.ts index de2077acb8..18f0d8ab35 100644 --- a/tests/src/eth/payable.test.ts +++ b/tests/src/eth/payable.test.ts @@ -118,7 +118,7 @@ describe('EVM transaction fees', () => { const deployer = await helper.eth.createAccountWithBalance(donor); const caller = await helper.eth.createAccountWithBalance(donor); const contract = await helper.eth.deployFlipper(deployer); - + const initialCallerBalance = await helper.balance.getEthereum(caller); await contract.methods.flip().send({from: caller}); const finalCallerBalance = await helper.balance.getEthereum(caller); @@ -129,7 +129,7 @@ describe('EVM transaction fees', () => { const deployer = await helper.eth.createAccountWithBalance(donor); const caller = await helper.eth.createAccountWithBalance(donor); const contract = await deployProxyContract(helper, deployer); - + const initialCallerBalance = await helper.balance.getEthereum(caller); const initialContractBalance = await helper.balance.getEthereum(contract.options.address); await contract.methods.flip().send({from: caller}); @@ -138,7 +138,7 @@ describe('EVM transaction fees', () => { expect(finalCallerBalance < initialCallerBalance).to.be.true; expect(finalContractBalance == initialContractBalance).to.be.true; }); - + itEth('Fee for nested calls to native methods is withdrawn from the user', async({helper}) => { const CONTRACT_BALANCE = 2n * helper.balance.getOneTokenNominal(); @@ -155,7 +155,7 @@ describe('EVM transaction fees', () => { expect(finalCallerBalance < initialCallerBalance).to.be.true; expect(finalContractBalance == initialContractBalance).to.be.true; }); - + itEth('Fee for nested calls to create*Collection methods is withdrawn from the user and from the contract', async({helper}) => { const CONTRACT_BALANCE = 2n * helper.balance.getOneTokenNominal(); const deployer = await helper.eth.createAccountWithBalance(donor); @@ -176,7 +176,7 @@ describe('EVM transaction fees', () => { const BIG_FEE = 3n * helper.balance.getOneTokenNominal(); const caller = await helper.eth.createAccountWithBalance(donor); const collectionHelper = helper.ethNativeContract.collectionHelpers(caller); - + await expect(collectionHelper.methods.createNFTCollection('A', 'B', 'C').call({value: Number(SMALL_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); await expect(collectionHelper.methods.createNFTCollection('A', 'B', 'C').call({value: Number(BIG_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); }); @@ -186,7 +186,7 @@ describe('EVM transaction fees', () => { const BIG_FEE = 3n * helper.balance.getOneTokenNominal(); const caller = await helper.eth.createAccountWithBalance(donor); const collectionHelper = helper.ethNativeContract.collectionHelpers(caller); - + await expect(collectionHelper.methods.createRFTCollection('A', 'B', 'C').call({value: Number(SMALL_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); await expect(collectionHelper.methods.createRFTCollection('A', 'B', 'C').call({value: Number(BIG_FEE)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)'); }); @@ -235,8 +235,7 @@ describe('EVM transaction fees', () => { function mintNftToken(address collectionAddress) external { UniqueNFT collection = UniqueNFT(collectionAddress); - uint256 tokenId = collection.nextTokenId(); - collection.mint(msg.sender, tokenId); + uint256 tokenId = collection.mint(msg.sender); emit TokenMinted(tokenId); } diff --git a/tests/src/eth/proxy/UniqueNFTProxy.sol b/tests/src/eth/proxy/UniqueNFTProxy.sol index 3ba29fd98e..aaddf07d61 100644 --- a/tests/src/eth/proxy/UniqueNFTProxy.sol +++ b/tests/src/eth/proxy/UniqueNFTProxy.sol @@ -120,20 +120,19 @@ contract UniqueNFTProxy is UniqueNFT { return proxied.mintingFinished(); } - function mint(address to, uint256 tokenId) + function mint(address to) external override - returns (bool) + returns (uint256) { - return proxied.mint(to, tokenId); + return proxied.mint(to); } function mintWithTokenURI( address to, - uint256 tokenId, string memory tokenUri - ) external override returns (bool) { - return proxied.mintWithTokenURI(to, tokenId, tokenUri); + ) external override returns (uint256) { + return proxied.mintWithTokenURI(to, tokenUri); } function finishMinting() external override returns (bool) { @@ -169,7 +168,7 @@ contract UniqueNFTProxy is UniqueNFT { return proxied.mintBulk(to, tokenIds); } - function mintBulkWithTokenURI(address to, Tuple0[] memory tokens) + function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) external override returns (bool) diff --git a/tests/src/eth/proxy/nonFungibleProxy.test.ts b/tests/src/eth/proxy/nonFungibleProxy.test.ts index 111696e43c..c1ae4afa24 100644 --- a/tests/src/eth/proxy/nonFungibleProxy.test.ts +++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts @@ -111,13 +111,10 @@ describe('NFT (Via EVM proxy): Plain calls', () => { await collectionEvmOwned.methods.addCollectionAdmin(contract.options.address).send(); { - const nextTokenId = await contract.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - const result = await contract.methods.mintWithTokenURI( - receiver, - nextTokenId, - 'Test URI', - ).send({from: caller}); + const result = await contract.methods.mintWithTokenURI(receiver, 'Test URI').send({from: caller}); + const tokenId = result.events.Transfer.returnValues.tokenId; + expect(tokenId).to.be.equal('1'); + const events = helper.eth.normalizeEvents(result.events); events[0].address = events[0].address.toLocaleLowerCase(); @@ -128,12 +125,12 @@ describe('NFT (Via EVM proxy): Plain calls', () => { args: { from: '0x0000000000000000000000000000000000000000', to: receiver, - tokenId: nextTokenId, + tokenId, }, }, ]); - expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); + expect(await contract.methods.tokenURI(tokenId).call()).to.be.equal('Test URI'); } }); diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index cb5b4bb9b6..0fba000734 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -33,8 +33,9 @@ describe('Refungible: Information getting', () => { const caller = await helper.eth.createAccountWithBalance(donor); const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'TotalSupply', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); - const nextTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint(caller, nextTokenId).send(); + + await contract.methods.mint(caller).send(); + const totalSupply = await contract.methods.totalSupply().call(); expect(totalSupply).to.equal('1'); }); @@ -44,18 +45,9 @@ describe('Refungible: Information getting', () => { const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'BalanceOf', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); - { - const nextTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint(caller, nextTokenId).send(); - } - { - const nextTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint(caller, nextTokenId).send(); - } - { - const nextTokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint(caller, nextTokenId).send(); - } + await contract.methods.mint(caller).send(); + await contract.methods.mint(caller).send(); + await contract.methods.mint(caller).send(); const balance = await contract.methods.balanceOf(caller).call(); expect(balance).to.equal('3'); @@ -66,8 +58,8 @@ describe('Refungible: Information getting', () => { const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'OwnerOf', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); - const tokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint(caller, tokenId).send(); + const result = await contract.methods.mint(caller).send(); + const tokenId = result.events.Transfer.returnValues.tokenId; const owner = await contract.methods.ownerOf(tokenId).call(); expect(owner).to.equal(caller); @@ -79,8 +71,8 @@ describe('Refungible: Information getting', () => { const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'OwnerOf-AfterBurn', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); - const tokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint(caller, tokenId).send(); + const result = await contract.methods.mint(caller).send(); + const tokenId = result.events.Transfer.returnValues.tokenId; const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller); await tokenContract.methods.repartition(2).send(); @@ -98,8 +90,8 @@ describe('Refungible: Information getting', () => { const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'Partial-OwnerOf', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); - const tokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint(caller, tokenId).send(); + const result = await contract.methods.mint(caller).send(); + const tokenId = result.events.Transfer.returnValues.tokenId; const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller); await tokenContract.methods.repartition(2).send(); @@ -126,22 +118,17 @@ describe('Refungible: Plain calls', () => { const receiver = helper.eth.createAccount(); const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, 'Minty', '6', '6', ''); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); - - const nextTokenId = await contract.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - const result = await contract.methods.mintWithTokenURI( - receiver, - nextTokenId, - 'Test URI', - ).send(); + + const result = await contract.methods.mintWithTokenURI(receiver, 'Test URI').send(); const event = result.events.Transfer; expect(event.address).to.equal(collectionAddress); expect(event.returnValues.from).to.equal('0x0000000000000000000000000000000000000000'); expect(event.returnValues.to).to.equal(receiver); - expect(event.returnValues.tokenId).to.equal(nextTokenId); + const tokenId = event.returnValues.tokenId; + expect(tokenId).to.be.equal('1'); - expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI'); + expect(await contract.methods.tokenURI(tokenId).call()).to.be.equal('Test URI'); }); itEth('Can perform mintBulk()', async ({helper}) => { @@ -182,8 +169,8 @@ describe('Refungible: Plain calls', () => { const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Burny', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); - const tokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint(caller, tokenId).send(); + const result = await contract.methods.mint(caller).send(); + const tokenId = result.events.Transfer.returnValues.tokenId; { const result = await contract.methods.burn(tokenId).send(); const event = result.events.Transfer; @@ -200,9 +187,10 @@ describe('Refungible: Plain calls', () => { const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'TransferFromy', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); - const tokenId = await contract.methods.nextTokenId().call(); + const result = await contract.methods.mint(caller).send(); + const tokenId = result.events.Transfer.returnValues.tokenId; + const tokenAddress = helper.ethAddress.fromTokenId(collectionId, tokenId); - await contract.methods.mint(caller, tokenId).send(); const tokenContract = helper.ethNativeContract.rftToken(tokenAddress, caller); await tokenContract.methods.repartition(15).send(); @@ -244,12 +232,12 @@ describe('Refungible: Plain calls', () => { const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Transferry', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); - const tokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint(caller, tokenId).send(); + const result = await contract.methods.mint(caller).send(); + const tokenId = result.events.Transfer.returnValues.tokenId; { const result = await contract.methods.transfer(receiver, tokenId).send(); - + const event = result.events.Transfer; expect(event.address).to.equal(collectionAddress); expect(event.returnValues.from).to.equal(caller); @@ -274,8 +262,8 @@ describe('Refungible: Plain calls', () => { const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'Transferry-Partial-to-Full', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); - const tokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint(caller, tokenId).send(); + const result = await contract.methods.mint(caller).send(); + const tokenId = result.events.Transfer.returnValues.tokenId; const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller); @@ -301,8 +289,8 @@ describe('Refungible: Plain calls', () => { const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'Transferry-Full-to-Partial', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); - const tokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint(caller, tokenId).send(); + const result = await contract.methods.mint(caller).send(); + const tokenId = result.events.Transfer.returnValues.tokenId; const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller); @@ -339,8 +327,8 @@ describe('RFT: Fees', () => { const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Feeful-Transfer-From', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); - const tokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint(caller, tokenId).send(); + const result = await contract.methods.mint(caller).send(); + const tokenId = result.events.Transfer.returnValues.tokenId; const cost = await helper.eth.recordCallFee(caller, () => contract.methods.transferFrom(caller, receiver, tokenId).send()); expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); @@ -353,8 +341,8 @@ describe('RFT: Fees', () => { const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Feeful-Transfer', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); - const tokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint(caller, tokenId).send(); + const result = await contract.methods.mint(caller).send(); + const tokenId = result.events.Transfer.returnValues.tokenId; const cost = await helper.eth.recordCallFee(caller, () => contract.methods.transfer(receiver, tokenId).send()); expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); @@ -394,7 +382,7 @@ describe('Common metadata', () => { tokenPropertyPermissions, }, ); - + const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'rft', caller); const name = await contract.methods.name().call(); expect(name).to.equal('Leviathan'); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index 91ecaebccd..539ca4695b 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -82,26 +82,22 @@ describe('Check ERC721 token URI for ReFungible', () => { const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, 'Mint collection', 'a', 'b', baseUri); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); - - const nextTokenId = await contract.methods.nextTokenId().call(); - expect(nextTokenId).to.be.equal('1'); - const result = await contract.methods.mint( - receiver, - nextTokenId, - ).send(); - if (propertyKey && propertyValue) { - // Set URL or suffix - await contract.methods.setProperty(nextTokenId, propertyKey, Buffer.from(propertyValue)).send(); - } + const result = await contract.methods.mint(receiver).send(); const event = result.events.Transfer; + const tokenId = event.returnValues.tokenId; + expect(tokenId).to.be.equal('1'); expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000'); expect(event.returnValues.to).to.be.equal(receiver); - expect(event.returnValues.tokenId).to.be.equal(nextTokenId); - return {contract, nextTokenId}; + if (propertyKey && propertyValue) { + // Set URL or suffix + await contract.methods.setProperty(tokenId, propertyKey, Buffer.from(propertyValue)).send(); + } + + return {contract, nextTokenId: tokenId}; } itEth('Empty tokenURI', async ({helper}) => { @@ -295,8 +291,8 @@ describe('Refungible: Plain calls', () => { const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'Devastation', '6', '6'); const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller); - const tokenId = await contract.methods.nextTokenId().call(); - await contract.methods.mint(caller, tokenId).send(); + const result = await contract.methods.mint(caller).send(); + const tokenId = result.events.Transfer.returnValues.tokenId; const tokenAddress = helper.ethAddress.fromTokenId(collectionId, tokenId); const tokenContract = helper.ethNativeContract.rftToken(tokenAddress, caller); @@ -479,9 +475,10 @@ describe('ERC 1633 implementation', () => { const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(owner, 'Sands', '', 'GRAIN'); const collectionContract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner); - - const tokenId = await collectionContract.methods.nextTokenId().call(); - await collectionContract.methods.mint(owner, tokenId).send(); + + const result = await collectionContract.methods.mint(owner).send(); + const tokenId = result.events.Transfer.returnValues.tokenId; + const tokenAddress = helper.ethAddress.fromTokenId(collectionId, tokenId); const tokenContract = helper.ethNativeContract.rftToken(tokenAddress, owner); diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index a7e4aa5b22..2c89e939d0 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -43,12 +43,12 @@ class ContractGroup extends EthGroupBase { if(!imports) return function(path: string) { return {error: `File not found: ${path}`}; }; - + const knownImports = {} as {[key: string]: string}; for(const imp of imports) { knownImports[imp.solPath] = (await readFile(imp.fsPath)).toString(); } - + return function(path: string) { if(path in knownImports) return {contents: knownImports[path]}; return {error: `File not found: ${path}`}; @@ -71,7 +71,7 @@ class ContractGroup extends EthGroupBase { }, }, }), {import: await this.findImports(imports)})).contracts[`${name}.sol`][name]; - + return { abi: out.abi, object: '0x' + out.evm.bytecode.object, @@ -94,7 +94,7 @@ class ContractGroup extends EthGroupBase { } } - + class NativeContractGroup extends EthGroupBase { contractHelpers(caller: string): Contract { @@ -145,14 +145,14 @@ class EthGroup extends EthGroupBase { async createAccountWithBalance(donor: IKeyringPair, amount=1000n) { const account = this.createAccount(); await this.transferBalanceFromSubstrate(donor, account, amount); - + return account; } async transferBalanceFromSubstrate(donor: IKeyringPair, recepient: string, amount=1000n, inTokens=true) { return await this.helper.balance.transferToSubstrate(donor, evmToAddress(recepient), amount * (inTokens ? this.helper.balance.getOneTokenNominal() : 1n)); } - + async getCollectionCreationFee(signer: string) { const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); return await collectionHelper.methods.collectionCreationFee().call(); @@ -177,7 +177,7 @@ class EthGroup extends EthGroupBase { async createNFTCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{collectionId: number, collectionAddress: string}> { const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice(); const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); - + const result = await collectionHelper.methods.createNFTCollection(name, description, tokenPrefix).send({value: Number(collectionCreationPrice)}); const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); @@ -187,13 +187,11 @@ class EthGroup extends EthGroupBase { } async createERC721MetadataCompatibleNFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string}> { - const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice(); const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); - - const result = await collectionHelper.methods.createERC721MetadataCompatibleNFTCollection(name, description, tokenPrefix, baseUri).send({value: Number(collectionCreationPrice)}); - const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); - const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress); + const {collectionId, collectionAddress} = await this.createNFTCollection(signer, name, description, tokenPrefix) + + await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send(); return {collectionId, collectionAddress}; } @@ -201,7 +199,7 @@ class EthGroup extends EthGroupBase { async createRFTCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{collectionId: number, collectionAddress: string}> { const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice(); const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); - + const result = await collectionHelper.methods.createRFTCollection(name, description, tokenPrefix).send({value: Number(collectionCreationPrice)}); const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); @@ -211,13 +209,11 @@ class EthGroup extends EthGroupBase { } async createERC721MetadataCompatibleRFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string}> { - const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice(); const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); - - const result = await collectionHelper.methods.createERC721MetadataCompatibleRFTCollection(name, description, tokenPrefix, baseUri).send({value: Number(collectionCreationPrice)}); - const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); - const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress); + const {collectionId, collectionAddress} = await this.createRFTCollection(signer, name, description, tokenPrefix) + + await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send(); return {collectionId, collectionAddress}; } @@ -312,7 +308,7 @@ class EthGroup extends EthGroupBase { }; return await this.helper.arrange.calculcateFee(address, wrappedCode); } -} +} class EthAddressGroup extends EthGroupBase { extractCollectionId(address: string): number { @@ -343,8 +339,8 @@ class EthAddressGroup extends EthGroupBase { normalizeAddress(address: string): string { return '0x' + address.substring(address.length - 40); } -} - +} + export type EthUniqueHelperConstructor = new (...args: any[]) => EthUniqueHelper; export class EthUniqueHelper extends DevUniqueHelper { @@ -396,4 +392,3 @@ export class EthUniqueHelper extends DevUniqueHelper { return newHelper; } } - \ No newline at end of file From e26460b66f05d356ed494aecca413ce3f3420c11 Mon Sep 17 00:00:00 2001 From: Alex Saft Date: Sun, 16 Oct 2022 00:06:28 +0300 Subject: [PATCH 1155/1274] test: fixed nonFungibleProxy: rolled back to proxy contract mintWithTokenURI version --- tests/src/eth/proxy/nonFungibleProxy.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/src/eth/proxy/nonFungibleProxy.test.ts b/tests/src/eth/proxy/nonFungibleProxy.test.ts index c1ae4afa24..80d4ac1e26 100644 --- a/tests/src/eth/proxy/nonFungibleProxy.test.ts +++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts @@ -111,7 +111,8 @@ describe('NFT (Via EVM proxy): Plain calls', () => { await collectionEvmOwned.methods.addCollectionAdmin(contract.options.address).send(); { - const result = await contract.methods.mintWithTokenURI(receiver, 'Test URI').send({from: caller}); + const nextTokenId = await contract.methods.nextTokenId().call() + const result = await contract.methods.mintWithTokenURI(receiver, nextTokenId, 'Test URI').send({from: caller}); const tokenId = result.events.Transfer.returnValues.tokenId; expect(tokenId).to.be.equal('1'); From 2f992d2992c8893824b38538c2101155456bec47 Mon Sep 17 00:00:00 2001 From: Alex Saft Date: Mon, 17 Oct 2022 18:42:55 +0300 Subject: [PATCH 1156/1274] feat: solidity: renamed setOwner to changeCollectionOwner, hidden (soft deprecated) createNonfungibleCollection for createNFTCollection --- pallets/common/src/erc.rs | 1 + .../src/stubs/ContractHelpers.raw | Bin 1848 -> 1848 bytes pallets/fungible/src/stubs/UniqueFungible.raw | Bin 3219 -> 3219 bytes pallets/fungible/src/stubs/UniqueFungible.sol | 8 ++--- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4339 -> 4339 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 8 ++--- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4366 -> 4366 bytes .../refungible/src/stubs/UniqueRefungible.sol | 8 ++--- .../src/stubs/UniqueRefungibleToken.raw | Bin 1556 -> 1556 bytes pallets/unique/src/eth/mod.rs | 1 + .../src/eth/stubs/CollectionHelpers.raw | Bin 1529 -> 1502 bytes .../src/eth/stubs/CollectionHelpers.sol | 34 ++++++++---------- tests/src/eth/api/CollectionHelpers.sol | 20 +++++------ tests/src/eth/api/UniqueFungible.sol | 8 ++--- tests/src/eth/api/UniqueNFT.sol | 8 ++--- tests/src/eth/api/UniqueRefungible.sol | 8 ++--- tests/src/eth/collectionHelpersAbi.json | 11 ------ tests/src/eth/fungibleAbi.json | 18 +++++----- tests/src/eth/nonFungibleAbi.json | 18 +++++----- tests/src/eth/reFungibleAbi.json | 18 +++++----- 20 files changed, 76 insertions(+), 93 deletions(-) diff --git a/pallets/common/src/erc.rs b/pallets/common/src/erc.rs index ed30511ff6..5a5121a265 100644 --- a/pallets/common/src/erc.rs +++ b/pallets/common/src/erc.rs @@ -592,6 +592,7 @@ where /// /// @dev Owner can be changed only by current owner /// @param newOwner new owner account + #[solidity(rename_selector = "changeCollectionOwner")] fn set_owner(&mut self, caller: caller, new_owner: address) -> Result { self.consume_store_writes(1)?; diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw index 256cf98065c43a3eafc4b8b2894c91a251e408cb..cf9f50574e403b7c7e362033d1b132b82df32fb8 100644 GIT binary patch delta 53 zcmV-50LuTk4!91m=LRVxohpX6w=di)3V!N)zb4Yv1GC)wGi`vAx^<3TFCm#^b8l>8 LLjVX7lMn|elg}1t delta 53 zcmV-50LuTk4!91m=LRV$@pH+tiP$|`qz!HzQchy8 LLjVX6lMn|eq2(6c diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index 266c3e176e6ba4311e9ee41fadadea560ca08182..b90e012e3774d13accc0032fb1695536711894b2 100644 GIT binary patch delta 913 zcmY*WT}TvB7mhp)jb2pn}D|`B7*d?mcI|bH2Yzz0|wV$g&(q zo7v%Uj*G;jna=}nN{9t-f6RtU2s;+RdGVYYkB)G)v%tTDYGi5dC#V_$jy=#?0QLdA zS{-V#ypEw6og6A6%p!!sdVd!{&4G~S7r-;Uo3&1{!Aa`n-0fE33&+Ci@VjcKu$c!O zuffsM_9X`J1Hd-<>vgA{(6ZYLFiD5FI$yb`a03VhiSK>mS%7l@tDjxkpmW?KCQJMI z1J%Noq7t^3u-!*7PsArCYbWe+lc52Vt<(E_y?gDyK#s2PU9PO-LOEI~_*l4Fg&HQi zh=r#NJ&c;Abc6_LBAla96zE(6vIIm?ai}MqlHtyaZ9AV38nV3PZY7;yFzBw{NOgBlT5pj%;v7D&D$eReQoFd0=d z_LdTHHiAROEio4~zk=C~8X95*<#&I-t@$)~ QdGunmGfyg_!v%-_0Yz3g+yDRo delta 872 zcmX|;T}TvB7>0Ld_RJaAVl{tiR&qC%G8MB8Hu^DL6GBLGGThY$kcA<%JN*Qs2z%Iu~c2Z_fLEf5T)Z&s6a| z&sa6zH_WqGywm)C`c)ydaq{EsdceULamCYWyt7}}aUbF}Q1w4gtrSwB3UKhQ76NPs zybz4+vb`BY@aehF`IMW5tH=wl45(!gR0+U(y`u@d0$|rDlLc?BUAT8&{Q`XUXA4_- z!0{4f)wr%3a2_yJ^P>mwD`1VXd!gXx5{3-n>?wE4z;mTuSuBQ$&uN7PBXIi#>zZbxehktX@}F3dkD_P z+`r|gmU?>M4|Juz%pJcm3 diff --git a/pallets/fungible/src/stubs/UniqueFungible.sol b/pallets/fungible/src/stubs/UniqueFungible.sol index 53c60f531d..91d55ee0e4 100644 --- a/pallets/fungible/src/stubs/UniqueFungible.sol +++ b/pallets/fungible/src/stubs/UniqueFungible.sol @@ -18,7 +18,7 @@ contract ERC165 is Dummy { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0x3e1e8083 +/// @dev the ERC-165 identifier for this interface is 0x62e22290 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -296,9 +296,9 @@ contract Collection is Dummy, ERC165 { /// /// @dev Owner can be changed only by current owner /// @param newOwner new owner account - /// @dev EVM selector for this function is: 0x13af4035, - /// or in textual repr: setOwner(address) - function setOwner(address newOwner) public { + /// @dev EVM selector for this function is: 0x4f53e226, + /// or in textual repr: changeCollectionOwner(address) + function changeCollectionOwner(address newOwner) public { require(false, stub_error); newOwner; dummy = 0; diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index c87e5e30b39a2d592542f144563aa618ac8caf1e..c9f0bd002a567902dc391ac5abb38d5f9c26a789 100644 GIT binary patch delta 1131 zcmY*XTWHf@6!vertV!CrOXu7=?ag^%tgAu?lR4|{We$yXw#=yHpCF1CM7+(Rrb*gv zcCxm=I7LAp^}!47K~a2I5!44!7zjR$!Mx#<%7l%9;`y7l)+B`Qa?bhBImwKB#{ICx zWHJwvR#SGRc{rl%&wT28X~zKN10IxIx?7 z4X_8`M%`Bd&`#miBL@NY6}qG61NVT{dU8)MKz}*lwjMuAHkj-Db)okIQ2PUD6v80W z02eQ^P3C9vw2aO}77MEP$%)CaL9-X3Ir6k@Y5U`_gqdE<^t8!l%r*VTFlBR?IYd2+ zo3dkh#!ZqcwzhM+G`{?2X@pQ#nl0QZjTEMG9tpE6h2jCi6d7WBO~TaJC)UH*6nTLx z>v5*K7F%TESTxKu+yrJ%g(XogbI2}~3QO>7%0b20 z0Qa*{Xr8ERp~qrK(xR2Mn12^h z0x`M?zMopr-%=bYml@evkA`YM9m%VhAH{4kEDfqC5Dg8%JCVzJQ1qXVB(*p)=2DX= zB<_vQ{s@*ys)mZt~sgShmifI+C4H z6tBU;HbYPXSlCmT%4civ4j6hyM;S@gVJzW#L<^`PDx`Fj!h%8$+m=*5E7X6X+^-RIx#`rP;U*6f=5 XHg)9LwejpS^ViomkNzOp%GG}Xk9>X> delta 1138 zcmY*WTSyd9820S!jyp5nbt~D@btN(?wPK1wXf^90g$B_z9hGwuB+DYAdy#Why_sEGIb-?GqI$9a2wk=x9)uK+igIk$j`RLHcLgGn* z+i+=M4>h<=ga5O(R6@K5!EL-b)&uYiz->>D834~`PT0^|%R`R=uxtocGr&6K$4P*l z0PD@}W`Mf^Hdxhp0K=KAeZIrB-kR(!eE@5-p{(X`R|l>4F0L)U7m=a&2heQjTukd- z+%kCz;54X97Ue<%=X&8am;a=Py_G1xgK(`Iu$TDzqAKz7^tP{T=WBpm#tXq2y#ynLov6CL3@JpQKi6d&dWamcW^ zq5$!Cvjq^o(I9>?s={O8ER3y~2|S3I?l3TKXz1U(!b^&!@Typ0VghLCFN1py-dY}e!=9o8w1*_J-5#*lV_!{w!Dq!`p&u1drQgg+NmhYcj_ zEhF%cJE@6({(HJFCx}kdcutu|%BMGSDhJoI(}+}OIx9-Tb+vi#Xm^lyu_6oMavjBr ziPX;oO(xPYclM~N>n+%qOeBK_GEu_RQDWG%)0bFr%0emCu;510c)KYZEw+%Iuuy_X zSE-V_tY9)T%O^Gq4GBS-&Q*MDIsUxWXgn?F?e~PLoaTU(}VPGS}aTG-XXxvkp; zY^VAS8%DBM^cfLR#q`XUBBr<@^5c`~LsjdVRgV=OreS z`7!mI-fT2KZWNo7-;ce^B>;sCF~y6`XD;lk0FFUATNo_WB)WzvLanrt@oUKrW_^}_ zMdk5qVj2Qd)ziKvdY9SNtpRXfhuZGf=VX9`0P7BXE7p1#?JGh*EFB@5HD)8+f`8y9s09FGmYuIc7SQRmBtSjelHeuF+wz__@ z3#R=}!(76o0J`$*Q;^WM=qtH72had_%!x2B1oy|KdclJT(;wyu z(@B{2GQmvPk4u>~xQtx_26;wZa8_vA)iksI(VdwOmL|B=QpVcCe98X^_JFw94!>P$ z#d8Z9J!L89jDdKL4qGB7JU3!rk;~XcAwv+<9wx_0*e<%4TgMIRheX(iw1acuS2_(5 zc7jsQTf@%i1vMZb_=EY3lnvSWbjr%b!ZZx#LqN?l;R0DOeNs&7x`y;&z6ra(Q%s_Wzi{Hp<|ogjNl3d_Dky=dENMs zUQ?0amQc?sf=}uNF+lLS^h(0K1TQT!5l`gHNI`K$Lh&mKtN{<`=A?>}ysX0d@MxnF zkn6QVTt#t$Z-;rYKeX^AL&A*Y}7C0I~kn3g|FAUivF-PGPc+hD&Y(=F3#q7!2#wzJvtip9&(Hh3-}`>&T=rh}KCZV| zs8tfQyso8I<8piU^YOQ(7@)LHUKQo`p1yrerP%5M>zpqV&@AGj{HTXCQ$a0xhN>>| zJ?~m5#+FA=)N<|gNpgeQJ*WW)j)J!5-uO{~*8%Q*bzT8@H`hLVsDXxL8Y~Thbpl|M z@UzsRhpJ%r;WmJK+Hz$~dC5vKrYgX5 zPDVm-+AkC8d&=z_qw@oh;6W|lVAon|+j{FK{!HJpdXaY*mh8!;K@G%5>juTAjfYZ+r(o8TLPSv_W+|6nlEMTfbZ$aIh? zy3N9LOxxF&Qniv>QK^zL%=8*pfazljX8bV`9;viWlGK#$ULygns{W~2!@Nu({VX8q+JC!sac6tF@@wylvLwFBTi7?m@4LG zF?}Z{4l5{>h>pO2T2C$I{hwDxlPP2@ri`MfphksE3c(L^@NNn6gdkW2_z+K#)56!0 z*ESz_(3l7Faq`Vpx%sR?RV39UP|AsU)ez(m=Cipy0`>~u6GP9cC@U(ew#ZyO8B(H} zFs7n0%s(Ti>{X5*x&D8W`coo}Y$bVbpD8e|Bw%-uTZK+EH$78GTiidtFZB067^u5C f_37isrPdc09P?E-$Cqu@Un~!Qhp(@Y1;@631;T*$ diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index f02e12a6cb..754a2b7474 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -91,7 +91,7 @@ contract TokenProperties is Dummy, ERC165 { } /// @title A contract that allows you to work with collections. -/// @dev the ERC-165 identifier for this interface is 0x3e1e8083 +/// @dev the ERC-165 identifier for this interface is 0x62e22290 contract Collection is Dummy, ERC165 { /// Set collection property. /// @@ -369,9 +369,9 @@ contract Collection is Dummy, ERC165 { /// /// @dev Owner can be changed only by current owner /// @param newOwner new owner account - /// @dev EVM selector for this function is: 0x13af4035, - /// or in textual repr: setOwner(address) - function setOwner(address newOwner) public { + /// @dev EVM selector for this function is: 0x4f53e226, + /// or in textual repr: changeCollectionOwner(address) + function changeCollectionOwner(address newOwner) public { require(false, stub_error); newOwner; dummy = 0; diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.raw b/pallets/refungible/src/stubs/UniqueRefungibleToken.raw index e31434a4746be17b8f396df77cb331dff46649ab..47db4b89fb7a58e39c74f00ed969f60f29088251 100644 GIT binary patch delta 53 zcmV-50LuTA43rG8!v!hx1^Z-&h2EaI<_@ex3IK9~#o7GB6*)AU1Ej0YWQh}Gb8l>8 LLjVX7lk5d3nHm=p delta 53 zcmV-50LuTA43rG8!v!h%a~XbIRFi8 LLjVX6lk5d3uU8n= diff --git a/pallets/unique/src/eth/mod.rs b/pallets/unique/src/eth/mod.rs index 2724e6c0ea..b5248d0a37 100644 --- a/pallets/unique/src/eth/mod.rs +++ b/pallets/unique/src/eth/mod.rs @@ -184,6 +184,7 @@ where /// @return address Address of the newly created collection #[weight(>::create_collection())] #[deprecated(note = "mathod was renamed to `create_nft_collection`, prefer it instead")] + #[solidity(hide)] fn create_nonfungible_collection( &mut self, caller: caller, diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index b09c8c190a6eb843b2642f3430bc9a056cabfc3d..16cd1598a2ee4a4a6729d45baf3b4355630b486f 100644 GIT binary patch delta 841 zcmZ9JPiPZC6vpT6Bvq_JQnMRFqm2qhJqVVjq8?iGpm>lm=&p7zGe+tkL=U214`ydK z*;GW_&6HlG*qe%|RH*2wilO8f(X%uhme7Ts`!D)%1SP(3`+p znF_4;=_U$^&rPB+9jEmzVQ;C?gH_EmjR9gxNw#$P9>crES7lQolrj#Y8M}zvR0e0o zMx0!0g(jjx2=RBN29QlV9B5Sn8YRI2KIXs$VX-CTA8tny*gJ;`u z?!=Oko0r^tjpOox9G-J&rZfZ~J(M+K5_ezh4JSDNO;C)m&Xj!F83G2Qx;ac}#)Yg; zY8jMk4WiT}1fhK^h&v%cm~!8>%Ylhtku+4r^+?kE)Y$&TVaik8^rgE4|6*{N5x3MK z+*Y#PFojP@g;YGU@*45ZItP|5&BV7zd;Fw93yxMHX32?h%!(tLSF%gkFXs)8#RlW6I#iiZF|9DaXxBT#9L-4$E0wLemkWUy=HrKNw6P>h4jlyiAc13L&=*`-4}Z)SJ3 zy39D+$%7U_P!M?$@g{chAZ$s8BuvN%DX=nxsN8-tv%A(j2EKXk`+eW{`@LDJ`dJlX z%Pb|cW~K`vTRgZh5i)T)p>sUO&7`Y_DV zQ-HHe;XJ_a0AIJ?o(OYX1Mow~)iWM}A^nf0_u}H*6ZpObN12X|OQqUu&nXucRE?oD z@Dh52BLRkhC5|3&WVNvX$JZ5&<5opusZJ{r5i*No7wa~))-{f%N<4Dbqc99>JVq@$ z>QOm*sQA+FD$-v$`s_-RRaaV3G}P@=HY=2}J3Z!C5P-+4?E>26=gO#ZJ!ZutA0+!->5 zA?uW)270}y}R%lBP%}L zwj_5B@Q;~UcM#-v$%qC`PUaQOh8!l|3M`--+EgaBWR09_<-7>gwVyBT;!(pZb;qll zGDDdz!LT73pcyl&b2_N9v>6?dw5%BtlvCTm!M!!lRfb{Y^rgz_nsYQ5X Date: Mon, 17 Oct 2022 18:53:36 +0300 Subject: [PATCH 1157/1274] fix: fixed tests --- tests/src/eth/collectionAdmin.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/src/eth/collectionAdmin.test.ts b/tests/src/eth/collectionAdmin.test.ts index 42039d7465..4d4a9fb937 100644 --- a/tests/src/eth/collectionAdmin.test.ts +++ b/tests/src/eth/collectionAdmin.test.ts @@ -282,7 +282,7 @@ describe('Change owner tests', () => { const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - await collectionEvm.methods.setOwner(newOwner).send(); + await collectionEvm.methods.changeCollectionOwner(newOwner).send(); expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.false; expect(await collectionEvm.methods.isOwnerOrAdmin(newOwner).call()).to.be.true; @@ -293,7 +293,7 @@ describe('Change owner tests', () => { const newOwner = await helper.eth.createAccountWithBalance(donor); const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - const cost = await recordEthFee(helper, owner, () => collectionEvm.methods.setOwner(newOwner).send()); + const cost = await recordEthFee(helper, owner, () => collectionEvm.methods.changeCollectionOwner(newOwner).send()); expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))); expect(cost > 0); }); @@ -304,7 +304,7 @@ describe('Change owner tests', () => { const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - await expect(collectionEvm.methods.setOwner(newOwner).send({from: newOwner})).to.be.rejected; + await expect(collectionEvm.methods.changeCollectionOwner(newOwner).send({from: newOwner})).to.be.rejected; expect(await collectionEvm.methods.isOwnerOrAdmin(newOwner).call()).to.be.false; }); }); From 5930cd35155c6e59174ca8dec80327f120e065c2 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Fri, 14 Oct 2022 13:49:10 +0000 Subject: [PATCH 1158/1274] tests(util): fix t isDevNoderying to access discarded blocks --- tests/src/util/playgrounds/unique.dev.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 52ad51d902..0aceed7f06 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -260,8 +260,13 @@ class ArrangeGroup { }; isDevNode = async () => { - const block1 = await this.helper.callRpc('api.rpc.chain.getBlock', [await this.helper.callRpc('api.rpc.chain.getBlockHash', [1])]); - const block2 = await this.helper.callRpc('api.rpc.chain.getBlock', [await this.helper.callRpc('api.rpc.chain.getBlockHash', [2])]); + let blockNumber = (await this.helper.callRpc('api.query.system.number')).toJSON(); + if (blockNumber == 0) { + await this.helper.wait.newBlocks(1); + blockNumber = (await this.helper.callRpc('api.query.system.number')).toJSON(); + } + const block2 = await this.helper.callRpc('api.rpc.chain.getBlock', [await this.helper.callRpc('api.rpc.chain.getBlockHash', [blockNumber])]); + const block1 = await this.helper.callRpc('api.rpc.chain.getBlock', [await this.helper.callRpc('api.rpc.chain.getBlockHash', [blockNumber - 1])]); const findCreationDate = async (block: any) => { const humanBlock = block.toHuman(); let date; From 35dd1a696a4f27594730f217687a39099ae938b7 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Tue, 18 Oct 2022 09:37:50 +0000 Subject: [PATCH 1159/1274] Change CI workflows for parallel tests --- .docker/Dockerfile-parachain-node-only | 2 +- .docker/docker-compose.tmp-node.j2 | 2 + .env | 25 ++-- .../workflows/forkless-update-nodata_v2.yml | 46 ++++++- .github/workflows/market-test_v2.yml | 2 +- .github/workflows/node-only-update_v2.yml | 118 ++++++++++++++++-- 6 files changed, 167 insertions(+), 28 deletions(-) diff --git a/.docker/Dockerfile-parachain-node-only b/.docker/Dockerfile-parachain-node-only index 9c38cf4c0b..37c3ed642d 100644 --- a/.docker/Dockerfile-parachain-node-only +++ b/.docker/Dockerfile-parachain-node-only @@ -80,7 +80,7 @@ RUN apt-get -y update && \ nvm install v16.16.0 && \ nvm use v16.16.0 -RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/runtime-upgrade-testing +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b unique-network RUN export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ diff --git a/.docker/docker-compose.tmp-node.j2 b/.docker/docker-compose.tmp-node.j2 index 9fa8b80ff8..485ac0c337 100644 --- a/.docker/docker-compose.tmp-node.j2 +++ b/.docker/docker-compose.tmp-node.j2 @@ -24,9 +24,11 @@ services: expose: - 9944 - 9933 + - 9844 ports: - 127.0.0.1:9944:9944 - 127.0.0.1:9933:9933 + - 127.0.0.1:9844:9844 logging: options: max-size: "1m" diff --git a/.env b/.env index 03843b6eba..bab6261462 100644 --- a/.env +++ b/.env @@ -2,26 +2,25 @@ RUST_TOOLCHAIN=nightly-2022-07-24 POLKADOT_BUILD_BRANCH=release-v0.9.29 POLKADOT_MAINNET_BRANCH=release-v0.9.26 +STATEMINT_BUILD_BRANCH=release-parachains-v9230 +ACALA_BUILD_BRANCH=2.9.2 +MOONBEAM_BUILD_BRANCH=runtime-1701 + UNIQUE_MAINNET_TAG=v924010 +UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443 KUSAMA_MAINNET_BRANCH=release-v0.9.26 +STATEMINE_BUILD_BRANCH=parachains-v9270 +KARURA_BUILD_BRANCH=2.9.1 +MOONRIVER_BUILD_BRANCH=runtime-1701 + QUARTZ_MAINNET_TAG=quartz-v924012-2 +QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 UNQWND_MAINNET_BRANCH=release-v0.9.24 +WESTMINT_BUILD_BRANCH=parachains-v9270 +OPAL_MAINNET_TAG=v924010 OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443 -QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 -UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443 POLKADOT_LAUNCH_BRANCH=unique-network - -KARURA_BUILD_BRANCH=2.9.1 -ACALA_BUILD_BRANCH=2.9.2 - -MOONRIVER_BUILD_BRANCH=runtime-1701 -MOONBEAM_BUILD_BRANCH=runtime-1701 - -STATEMINE_BUILD_BRANCH=parachains-v9270 -STATEMINT_BUILD_BRANCH=release-parachains-v9230 -WESTMINT_BUILD_BRANCH=parachains-v9270 - diff --git a/.github/workflows/forkless-update-nodata_v2.yml b/.github/workflows/forkless-update-nodata_v2.yml index b0d7298559..1435d8960e 100644 --- a/.github/workflows/forkless-update-nodata_v2.yml +++ b/.github/workflows/forkless-update-nodata_v2.yml @@ -33,7 +33,7 @@ jobs: uses: xom9ikk/dotenv@v1.0.2 - name: Create Execution matrix - uses: fabiocaccamo/create-matrix-action@v2 + uses: CertainLach/create-matrix-action@v3 id: create_matrix with: matrix: | @@ -161,6 +161,50 @@ jobs: - name: Show docker logs if: success() || failure() run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}/node-parachain.log' + + - name: Run Parellel tests + working-directory: tests + run: | + yarn install + yarn add mochawesome + node scripts/readyness.js + echo "Ready to start tests" + yarn polkadot-types + NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW} + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Test Report Parallel + uses: phoenix-actions/test-reporting@v8 + id: test-report-parallel + if: success() || failure() # run this step even if previous step failed + with: + name: Report Parallel tests results - ${{ matrix.network }} # Name of the check run which will be created + path: tests/mochawesome-report/test-parallel-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' + + - name: Run Sequential tests + working-directory: tests + run: | + yarn install + yarn add mochawesome + node scripts/readyness.js + echo "Ready to start tests" + yarn polkadot-types + NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW} + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Test Report Sequential + uses: phoenix-actions/test-reporting@v8 + id: test-report-sequential + if: success() || failure() # run this step even if previous step failed + with: + name: Report Sequential tests results - ${{ matrix.network }} # Name of the check run which will be created + path: tests/mochawesome-report/test-sequential-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' - name: Stop running containers if: always() # run this step always diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index a81c7d0365..d9409e4f1f 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -11,7 +11,7 @@ jobs: market_test: # The type of runner that the job will run on runs-on: [self-hosted-ci,large] - timeout-minutes: 1380 + timeout-minutes: 360 name: ${{ matrix.network }} diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 5c46d0641f..baa1784c03 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -32,11 +32,11 @@ jobs: uses: xom9ikk/dotenv@v1.0.2 - name: Create Execution matrix - uses: fabiocaccamo/create-matrix-action@v2 + uses: CertainLach/create-matrix-action@v3 id: create_matrix with: matrix: | - network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}} network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} @@ -49,7 +49,7 @@ jobs: - timeout-minutes: 1380 + timeout-minutes: 2880 # 48 hours for execution jobs. name: ${{ matrix.network }} @@ -162,7 +162,6 @@ jobs: ref: ${{ matrix.mainnet_branch }} #Checking out head commit path: ${{ matrix.mainnet_branch }} - - name: Run tests before Node Parachain upgrade working-directory: ${{ matrix.mainnet_branch }}/tests run: | @@ -174,7 +173,7 @@ jobs: env: RPC_URL: http://127.0.0.1:9933/ - - name: Test Report Before Node upgrade + - name: Upload Test Report Before Node upgrade uses: phoenix-actions/test-reporting@v8 id: test-report-before if: success() || failure() # run this step even if previous step failed @@ -184,14 +183,67 @@ jobs: reporter: mochawesome-json fail-on-error: 'false' - - name: Send SIGUSR1 to polkadotlaunch process + + # TODO uncomment thease steps after the merge + #- name: Run Parallel tests before Node Parachain upgrade + # working-directory: ${{ matrix.mainnet_branch }}/tests + # run: | + # yarn install + # yarn add mochawesome + # echo "Ready to start tests" + # yarn polkadot-types + # NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW} + # env: + # RPC_URL: http://127.0.0.1:9933/ + + #- name: Upload Parallel Test Report Before Node upgrade + # uses: phoenix-actions/test-reporting@v8 + # id: test-parallel-report-before + # if: success() || failure() # run this step even if previous step failed + # with: + # name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created + # path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-parallel-*.json # Path to test results + # reporter: mochawesome-json + # fail-on-error: 'false' + + # - name: Run Sequential tests before Node Parachain upgrade + # if: success() || failure() + # working-directory: ${{ matrix.mainnet_branch }}/tests + # run: NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW} + # env: + # RPC_URL: http://127.0.0.1:9933/ + + # - name: Upload Sequential Test Report Before Node upgrade + # uses: phoenix-actions/test-reporting@v8 + # id: test-sequential-report-before + # if: success() || failure() # run this step even if previous step failed + # with: + # name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created + # path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-sequential-*.json # Path to test results + # reporter: mochawesome-json + # fail-on-error: 'false' + + - name: Send SIGUSR1 to polkadot-launch process if: success() || failure() run: | #Get PID of polkadot-launch + ContainerID=$(docker ps -aqf "name=node-parachain") PID=$(docker exec node-parachain pidof 'polkadot-launch') echo "Polkadot-launch PID: $PID" #Send SIGUSR1 signal to $PID docker exec node-parachain kill -SIGUSR1 ${PID} + echo "SIGUSR1 sent to Polkadot-launch PID: $PID" + docker logs ${ContainerID} + + - name: Get chain logs in case of docker image crashed after Polkadot Launch restart + if: failure() # run this step only at failure + run: | + docker exec node-parachain cat /polkadot-launch/9944.log + docker exec node-parachain cat /polkadot-launch/9945.log + docker exec node-parachain cat /polkadot-launch/alice.log + docker exec node-parachain cat /polkadot-launch/eve.log + docker exec node-parachain cat /polkadot-launch/dave.log + docker exec node-parachain cat /polkadot-launch/charlie.log # 🌗 All parachain collators restarted with the new binaries. - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade. @@ -238,9 +290,10 @@ jobs: echo "Halting script" exit 0 shell: bash - + + ## TODO: Remove next two blocks before switch to Parrallel & Sequental tests. Uncoment commented blocks. - name: Run tests after Node Parachain upgrade - working-directory: tests + working-directory: ${{ matrix.mainnet_branch }}/tests run: | yarn install yarn add mochawesome @@ -257,10 +310,50 @@ jobs: if: success() || failure() # run this step even if previous step failed with: name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created - path: tests/mochawesome-report/test-*.json # Path to test results + path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' + # TODO uncomment thease steps after the merge + #- name: Run Parallel tests after Node Parachain upgrade + # working-directory: ${{ matrix.mainnet_branch }}/tests + # run: | + # yarn install + # yarn add mochawesome + # node scripts/readyness.js + # echo "Ready to start tests" + # yarn polkadot-types + # NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW} + # env: + # RPC_URL: http://127.0.0.1:9933/ + + #- name: Test Report Parallel After Node upgrade + # uses: phoenix-actions/test-reporting@v8 + # id: test-report-parallel-after + # if: success() || failure() # run this step even if previous step failed + # with: + # name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created + # path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-parallel-*.json # Path to test results + # reporter: mochawesome-json + # fail-on-error: 'false' + + #- name: Run Sequential tests after Node Parachain upgrade + # if: success() || failure() + # working-directory: ${{ matrix.mainnet_branch }}/tests + # run: NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW} + # env: + # RPC_URL: http://127.0.0.1:9933/ + + #- name: Upload Sequential Test Report After Node upgrade + # uses: phoenix-actions/test-reporting@v8 + # id: test-sequential-report-after + # if: success() || failure() # run this step even if previous step failed + # with: + # name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created + # path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-sequential-*.json # Path to test results + # reporter: mochawesome-json + # fail-on-error: 'false' + - name: Stop running containers if: always() # run this step always @@ -273,6 +366,7 @@ jobs: docker system prune -f docker image prune -f -a - - name: Clean Workspace - if: always() - uses: AutoModality/action-clean@v1.1.0 + - name: Remove repo at the end + if: always() # run this step always + run: | + ls -ls ./ From 926d99f263fda94ea09fe26269bfbc97eb6a6db9 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 18 Oct 2022 12:39:07 +0300 Subject: [PATCH 1160/1274] Update ci-develop.yml --- .github/workflows/ci-develop.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index 68770be110..e3e047bf9e 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -29,6 +29,14 @@ jobs: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'xcm')) }} uses: ./.github/workflows/xcm.yml secrets: inherit # pass all secrets + + forkless: + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }} + uses: ./.github/workflows/forkless.yml + + node-only-update: + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }} + uses: ./.github/workflows/node-only-update_v2.yml codestyle: if: github.event.pull_request.draft == false From 1e798b8dc244afe7437a4471a8a3d04a77959f5a Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Tue, 18 Oct 2022 10:14:43 +0000 Subject: [PATCH 1161/1274] Update .env --- .env | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/.env b/.env index bab6261462..802a44ce21 100644 --- a/.env +++ b/.env @@ -1,26 +1,22 @@ RUST_TOOLCHAIN=nightly-2022-07-24 POLKADOT_BUILD_BRANCH=release-v0.9.29 -POLKADOT_MAINNET_BRANCH=release-v0.9.26 -STATEMINT_BUILD_BRANCH=release-parachains-v9230 -ACALA_BUILD_BRANCH=2.9.2 -MOONBEAM_BUILD_BRANCH=runtime-1701 - +POLKADOT_MAINNET_BRANCH=release-v0.9.28 +STATEMINT_BUILD_BRANCH=release-parachains-v9271 +ACALA_BUILD_BRANCH=2.9.6 +MOONBEAM_BUILD_BRANCH=v0.26.1 UNIQUE_MAINNET_TAG=v924010 UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443 -KUSAMA_MAINNET_BRANCH=release-v0.9.26 -STATEMINE_BUILD_BRANCH=parachains-v9270 -KARURA_BUILD_BRANCH=2.9.1 -MOONRIVER_BUILD_BRANCH=runtime-1701 - +KUSAMA_MAINNET_BRANCH=release-v0.9.29 +STATEMINE_BUILD_BRANCH=parachains-v9271 +KARURA_BUILD_BRANCH=2.9.5-karura +MOONRIVER_BUILD_BRANCH=v0.26.1 QUARTZ_MAINNET_TAG=quartz-v924012-2 QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 -UNQWND_MAINNET_BRANCH=release-v0.9.24 - -WESTMINT_BUILD_BRANCH=parachains-v9270 -OPAL_MAINNET_TAG=v924010 +UNQWND_MAINNET_BRANCH=release-v0.9.30 +WESTMINT_BUILD_BRANCH=parachains-v9290 +OPAL_MAINNET_TAG=quartz-v924012-2-opal-runtime-feature OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443 - POLKADOT_LAUNCH_BRANCH=unique-network From 699e6682b875135f41bd1741117b1b4059ff3138 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Tue, 18 Oct 2022 10:26:21 +0000 Subject: [PATCH 1162/1274] Use OPAL_MAINNET_TAG for Opal worflows --- .github/workflows/execution-matrix.yml | 2 +- .github/workflows/forkless-update-data_v2.yml | 2 +- .github/workflows/forkless-update-nodata_v2.yml | 2 +- .github/workflows/generate-execution-matrix.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/execution-matrix.yml b/.github/workflows/execution-matrix.yml index d4c84df10d..821fdb276a 100644 --- a/.github/workflows/execution-matrix.yml +++ b/.github/workflows/execution-matrix.yml @@ -36,7 +36,7 @@ jobs: id: create_matrix with: matrix: | - network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} diff --git a/.github/workflows/forkless-update-data_v2.yml b/.github/workflows/forkless-update-data_v2.yml index f096e8c8d8..e40c8119d7 100644 --- a/.github/workflows/forkless-update-data_v2.yml +++ b/.github/workflows/forkless-update-data_v2.yml @@ -36,7 +36,7 @@ jobs: id: create_matrix with: matrix: | - network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} diff --git a/.github/workflows/forkless-update-nodata_v2.yml b/.github/workflows/forkless-update-nodata_v2.yml index 1435d8960e..bb154ab4b0 100644 --- a/.github/workflows/forkless-update-nodata_v2.yml +++ b/.github/workflows/forkless-update-nodata_v2.yml @@ -37,7 +37,7 @@ jobs: id: create_matrix with: matrix: | - network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}} network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} diff --git a/.github/workflows/generate-execution-matrix.yml b/.github/workflows/generate-execution-matrix.yml index 48d7ae8e6f..a73bf1885e 100644 --- a/.github/workflows/generate-execution-matrix.yml +++ b/.github/workflows/generate-execution-matrix.yml @@ -40,6 +40,6 @@ jobs: id: create_matrix with: matrix: | - network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}} network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}} network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}} From 96e8a212d410d8830d85773ca047476dacae4c78 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 18 Oct 2022 20:17:47 +0700 Subject: [PATCH 1163/1274] change build branch name for karura --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 802a44ce21..3b592e7b72 100644 --- a/.env +++ b/.env @@ -10,7 +10,7 @@ UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443 KUSAMA_MAINNET_BRANCH=release-v0.9.29 STATEMINE_BUILD_BRANCH=parachains-v9271 -KARURA_BUILD_BRANCH=2.9.5-karura +KARURA_BUILD_BRANCH=release-karura-2.9.5 MOONRIVER_BUILD_BRANCH=v0.26.1 QUARTZ_MAINNET_TAG=quartz-v924012-2 QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 From d934a63caf2f3f96bee3bff2c44ff9e8a03d63f4 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Tue, 18 Oct 2022 13:20:42 +0000 Subject: [PATCH 1164/1274] Use node-version 16 --- .github/workflows/forkless-update-nodata_v2.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-nodata_v2.yml b/.github/workflows/forkless-update-nodata_v2.yml index bb154ab4b0..89937945b1 100644 --- a/.github/workflows/forkless-update-nodata_v2.yml +++ b/.github/workflows/forkless-update-nodata_v2.yml @@ -100,6 +100,9 @@ jobs: - name: Show launch-config-forkless configuration run: cat .docker/launch-config-forkless-nodata.json + - uses: actions/setup-node@v3 + with: + node-version: 16 - name: Build the stack run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300 @@ -162,7 +165,7 @@ jobs: if: success() || failure() run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}/node-parachain.log' - - name: Run Parellel tests + - name: Run Parallel tests working-directory: tests run: | yarn install From 59122b62538d0b6b59dba4537ef29b2a4b53d78f Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 18 Oct 2022 16:21:16 +0300 Subject: [PATCH 1165/1274] Update ci-develop.yml --- .github/workflows/ci-develop.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index 68770be110..b121f2af07 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -29,6 +29,10 @@ jobs: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'xcm')) }} uses: ./.github/workflows/xcm.yml secrets: inherit # pass all secrets + + node-only-update: + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'para')) }} + uses: ./.github/workflows/node-only-update_v3.yml codestyle: if: github.event.pull_request.draft == false From 97722e5740465ab3864e2018792a5e81d4089335 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 18 Oct 2022 13:29:32 +0000 Subject: [PATCH 1166/1274] Fix: add parallel Alice --- tests/src/eth/proxyContract.test.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/src/eth/proxyContract.test.ts b/tests/src/eth/proxyContract.test.ts index 17ad5028c3..06ae24c0e7 100644 --- a/tests/src/eth/proxyContract.test.ts +++ b/tests/src/eth/proxyContract.test.ts @@ -15,16 +15,15 @@ // along with Unique Network. If not, see . import {IKeyringPair} from '@polkadot/types/types'; -import {GAS_ARGS} from './util/helpers'; -import {itEth, expect, usingEthPlaygrounds, EthUniqueHelper} from './util/playgrounds'; +import {itEth, expect, usingEthPlaygrounds, EthUniqueHelper} from './util'; describe('EVM payable contracts', () => { let donor: IKeyringPair; before(async function() { await usingEthPlaygrounds(async (_, privateKey) => { - donor = privateKey('//Alice'); + donor = await privateKey({filename: __filename}); }); }); @@ -34,7 +33,7 @@ describe('EVM payable contracts', () => { const proxyContract = await deployProxyContract(helper, deployer); const realContractV1 = await deployRealContractV1(helper, deployer); - const realContractV1proxy = new helper.web3!.eth.Contract(realContractV1.options.jsonInterface, proxyContract.options.address, {from: caller, ...GAS_ARGS}); + const realContractV1proxy = new helper.web3!.eth.Contract(realContractV1.options.jsonInterface, proxyContract.options.address, {from: caller, gas: helper.eth.DEFAULT_GAS}); await proxyContract.methods.updateVersion(realContractV1.options.address).send(); await realContractV1proxy.methods.flip().send(); @@ -46,7 +45,7 @@ describe('EVM payable contracts', () => { expect(value1).to.be.equal(true); const realContractV2 = await deployRealContractV2(helper, deployer); - const realContractV2proxy = new helper.web3!.eth.Contract(realContractV2.options.jsonInterface, proxyContract.options.address, {from: caller, ...GAS_ARGS}); + const realContractV2proxy = new helper.web3!.eth.Contract(realContractV2.options.jsonInterface, proxyContract.options.address, {from: caller, gas: helper.eth.DEFAULT_GAS}); await proxyContract.methods.updateVersion(realContractV2.options.address).send(); await realContractV2proxy.methods.flip().send(); From 4be0263bf8f8123bea03ebb028a33851c8424bb4 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 18 Oct 2022 16:30:01 +0300 Subject: [PATCH 1167/1274] Create node-only-update_v3.yml --- .github/workflows/node-only-update_v3.yml | 189 ++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 .github/workflows/node-only-update_v3.yml diff --git a/.github/workflows/node-only-update_v3.yml b/.github/workflows/node-only-update_v3.yml new file mode 100644 index 0000000000..6de1e2c913 --- /dev/null +++ b/.github/workflows/node-only-update_v3.yml @@ -0,0 +1,189 @@ +name: nodes-only update + +# Controls when the action will run. +on: + workflow_call: +#Define Workflow variables + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + nodes-execution-matrix: + + name: execution matrix + + runs-on: self-hosted-ci + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: fabiocaccamo/create-matrix-action@v2 + id: create_matrix + with: + matrix: | + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} + + nodes-only-update: + needs: nodes-execution-matrix + # The type of runner that the job will run on + runs-on: [self-hosted-ci,large] + + + + timeout-minutes: 1380 + + name: ${{ matrix.network }} + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.nodes-execution-matrix.outputs.matrix)}} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-node.j2 + output_file: .docker/docker-compose.node.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }} + MAINNET_TAG=${{ matrix.mainnet_tag }} + MAINNET_BRANCH=${{ matrix.mainnet_branch }} + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + BRANCH=${{ github.head_ref }} + - name: Show build configuration + run: cat .docker/docker-compose.node.${{ matrix.network }}.yml + + - name: Generate launch-config-forkless-nodata.json + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/forkless-config/launch-config-forkless-nodata.j2 + output_file: .docker/launch-config-forkless-nodata.json + variables: | + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + + - name: Show launch-config-forkless configuration + run: cat .docker/launch-config-forkless-nodata.json + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate --timeout 300 + + # 🚀 POLKADOT LAUNCH COMPLETE 🚀 + - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade. + if: success() + run: | + counter=160 + function check_container_status { + docker inspect -f {{.State.Running}} node-parachain + } + function do_docker_logs { + docker logs --details node-parachain 2>&1 + } + function is_started { + if [ "$(check_container_status)" == "true" ]; then + echo "Container: node-parachain RUNNING"; + echo "Check Docker logs" + DOCKER_LOGS=$(do_docker_logs) + if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then + echo "🚀 POLKADOT LAUNCH COMPLETE 🚀" + return 0 + else + echo "Message not found in logs output, repeating..." + return 1 + fi + else + echo "Container node-parachain NOT RUNNING" + echo "Halting all future checks" + exit 1 + fi + echo "something goes wrong" + exit 1 + } + while ! is_started; do + echo "Waiting for special message in log files " + sleep 30s + counter=$(( $counter - 1 )) + echo "Counter: $counter" + if [ "$counter" -gt "0" ]; then + continue + else + break + fi + done + echo "Halting script" + exit 0 + shell: bash + + - name: Run Parallel tests on Node Parachain + working-directory: ${{ matrix.mainnet_branch }}/tests + run: | + yarn install + yarn add mochawesome + echo "Ready to start tests" + yarn polkadot-types + NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW} + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Parallel Tests report + uses: phoenix-actions/test-reporting@v8 + id: test-report-parallel + if: success() || failure() # run this step even if previous step failed + with: + name: Parallel Tests report - ${{ matrix.network }} # Name of the check run which will be created + path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-parallel-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" down --volumes + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f -a + docker system prune -f + docker image prune -f -a + + - name: List files in Workspace + if: always() + uses: | + ls -la ./ From 4078c21db01769d01dbab8d679a138694d83f25b Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 18 Oct 2022 16:37:25 +0300 Subject: [PATCH 1168/1274] Update node-only-update_v3.yml --- .github/workflows/node-only-update_v3.yml | 33 +++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/node-only-update_v3.yml b/.github/workflows/node-only-update_v3.yml index 6de1e2c913..1a031c1bdd 100644 --- a/.github/workflows/node-only-update_v3.yml +++ b/.github/workflows/node-only-update_v3.yml @@ -1,4 +1,4 @@ -name: nodes-only update +name: Parallele tests # Controls when the action will run. on: @@ -83,6 +83,7 @@ jobs: FEATURE=${{ matrix.features }} RUNTIME=${{ matrix.runtime }} BRANCH=${{ github.head_ref }} + - name: Show build configuration run: cat .docker/docker-compose.node.${{ matrix.network }}.yml @@ -171,6 +172,27 @@ jobs: path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-parallel-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' + + - name: Run Sequential tests on Node Parachain + working-directory: ${{ matrix.mainnet_branch }}/tests + run: | + yarn install + yarn add mochawesome + echo "Ready to start tests" + yarn polkadot-types + NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW} + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Sequential Tests report + uses: phoenix-actions/test-reporting@v8 + id: test-report-sequential + if: success() || failure() # run this step even if previous step failed + with: + name: Parallel Tests report - ${{ matrix.network }} # Name of the check run which will be created + path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-sequential-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' - name: Stop running containers if: always() # run this step always @@ -183,7 +205,8 @@ jobs: docker system prune -f docker image prune -f -a - - name: List files in Workspace - if: always() - uses: | - ls -la ./ +# - name: List files in Workspace +# if: always() +# uses: | +# ls -la ./ +# From 56cf47cd9e34a09e33ac608003ad1084b6a90b24 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Tue, 4 Oct 2022 22:30:04 +0300 Subject: [PATCH 1169/1274] new line --- .docker/Dockerfile-try-runtime | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index 4622407a8d..ed1d5fc696 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -46,5 +46,4 @@ RUN echo "Requested features: $FEATURE\n" && \ echo "Fork from: $REPLICA_FROM\n" && \ cargo build --features=$FEATURE --release - -CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $REPLICA_FROM +CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime --no-spec-name-check on-runtime-upgrade live --uri $REPLICA_FROM From 1158d75a10cd6f4a5733920a5c4823f5bce6181d Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 18 Oct 2022 13:59:27 +0000 Subject: [PATCH 1170/1274] fix: transaction_version --- runtime/opal/src/lib.rs | 2 +- runtime/quartz/src/lib.rs | 2 +- runtime/unique/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index d62bbd951f..d237eb6eaa 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -53,7 +53,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_version: 929030, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 3, + transaction_version: 2, state_version: 0, }; diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index f72939ee00..c9e67a7cdf 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -53,7 +53,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_version: 929030, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 3, + transaction_version: 2, state_version: 0, }; diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index aac1dab3e4..c9a28d8d3d 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -53,7 +53,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_version: 929030, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 3, + transaction_version: 2, state_version: 0, }; From e5efe227b4188505fdf5b14d1666021e65a59c94 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 18 Oct 2022 14:00:08 +0000 Subject: [PATCH 1171/1274] fix: Cargo.lock --- Cargo.lock | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index ee89308fab..3ee64e3714 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6710,6 +6710,24 @@ dependencies = [ "up-sponsorship", ] +[[package]] +name = "pallet-unique-scheduler-v2" +version = "0.1.0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-preimage", + "parity-scale-codec 3.2.1", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "substrate-test-utils", +] + [[package]] name = "pallet-utility" version = "4.0.0-dev" From 36f508b5e7e7c6a1e1a8f035b67dc1be4197cb57 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:16:29 +0300 Subject: [PATCH 1172/1274] Update Dockerfile-parachain-upgrade --- .docker/Dockerfile-parachain-upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index ef86bd66c0..d16cd35809 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -81,7 +81,7 @@ RUN apt-get -y update && \ nvm install v16.16.0 && \ nvm use v16.16.0 -RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/runtime-upgrade-testing +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b unique-network RUN export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ From 491951b54830371b41cd67a842eae0e530673bf3 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:18:20 +0300 Subject: [PATCH 1173/1274] Create launch-config-node-update-only-v3.j2 --- .../launch-config-node-update-only-v3.j2 | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 .docker/forkless-config/launch-config-node-update-only-v3.j2 diff --git a/.docker/forkless-config/launch-config-node-update-only-v3.j2 b/.docker/forkless-config/launch-config-node-update-only-v3.j2 new file mode 100644 index 0000000000..3d326dd096 --- /dev/null +++ b/.docker/forkless-config/launch-config-node-update-only-v3.j2 @@ -0,0 +1,127 @@ +{ + "relaychain": { + "bin": "/polkadot/target/release/polkadot", + "upgradeBin": "/polkadot/target/release/polkadot", + "upgradeWasm": "/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm", + "chain": "rococo-local", + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "/unique-chain/current/release/unique-collator", + "upgradeBin": "/unique-chain/target/release/unique-collator", + "upgradeWasm": "/unique-chain/target/release/wbuild/{{ FEATURE }}/{{ RUNTIME }}_runtime.compact.compressed.wasm", + "id": "1000", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace", + "--ws-max-connections=1000" + ] + }, + { + "port": 31201, + "wsPort": 9945, + "rpcPort": 9934, + "name": "bob", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace", + "--ws-max-connections=1000" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [], + "finalization": false +} From 4dd77f91b674c032ad560881cfb04c04878acb36 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:19:06 +0300 Subject: [PATCH 1174/1274] Update node-only-update_v3.yml --- .github/workflows/node-only-update_v3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-only-update_v3.yml b/.github/workflows/node-only-update_v3.yml index 1a031c1bdd..66672ff1e3 100644 --- a/.github/workflows/node-only-update_v3.yml +++ b/.github/workflows/node-only-update_v3.yml @@ -90,7 +90,7 @@ jobs: - name: Generate launch-config-forkless-nodata.json uses: cuchi/jinja2-action@v1.2.0 with: - template: .docker/forkless-config/launch-config-forkless-nodata.j2 + template: .docker/forkless-config/launch-config-node-update-only-v3.j2 output_file: .docker/launch-config-forkless-nodata.json variables: | FEATURE=${{ matrix.features }} From fa301e976ee71ade5a36a93cec240eb4bb23c5fd Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:23:53 +0300 Subject: [PATCH 1175/1274] Revert "[DON'T MERGE] Rapid parallel start" --- .docker/Dockerfile-parachain-upgrade | 2 +- .../launch-config-node-update-only-v3.j2 | 127 ----------- .github/workflows/ci-develop.yml | 7 +- .github/workflows/node-only-update_v3.yml | 212 ------------------ 4 files changed, 2 insertions(+), 346 deletions(-) delete mode 100644 .docker/forkless-config/launch-config-node-update-only-v3.j2 delete mode 100644 .github/workflows/node-only-update_v3.yml diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index d16cd35809..ef86bd66c0 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -81,7 +81,7 @@ RUN apt-get -y update && \ nvm install v16.16.0 && \ nvm use v16.16.0 -RUN git clone https://github.com/uniquenetwork/polkadot-launch -b unique-network +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/runtime-upgrade-testing RUN export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ diff --git a/.docker/forkless-config/launch-config-node-update-only-v3.j2 b/.docker/forkless-config/launch-config-node-update-only-v3.j2 deleted file mode 100644 index 3d326dd096..0000000000 --- a/.docker/forkless-config/launch-config-node-update-only-v3.j2 +++ /dev/null @@ -1,127 +0,0 @@ -{ - "relaychain": { - "bin": "/polkadot/target/release/polkadot", - "upgradeBin": "/polkadot/target/release/polkadot", - "upgradeWasm": "/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm", - "chain": "rococo-local", - "nodes": [ - { - "name": "alice", - "wsPort": 9844, - "rpcPort": 9843, - "port": 30444, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "bob", - "wsPort": 9855, - "rpcPort": 9854, - "port": 30555, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "charlie", - "wsPort": 9866, - "rpcPort": 9865, - "port": 30666, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "dave", - "wsPort": 9877, - "rpcPort": 9876, - "port": 30777, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - }, - { - "name": "eve", - "wsPort": 9888, - "rpcPort": 9887, - "port": 30888, - "flags": [ - "-lparachain::candidate_validation=debug", - "-lxcm=trace", - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external" - ] - } - ], - "genesis": { - "runtime": { - "runtime_genesis_config": { - "parachainsConfiguration": { - "config": { - "validation_upgrade_frequency": 1, - "validation_upgrade_delay": 1 - } - } - } - } - } - }, - "parachains": [ - { - "bin": "/unique-chain/current/release/unique-collator", - "upgradeBin": "/unique-chain/target/release/unique-collator", - "upgradeWasm": "/unique-chain/target/release/wbuild/{{ FEATURE }}/{{ RUNTIME }}_runtime.compact.compressed.wasm", - "id": "1000", - "balance": "1000000000000000000000000", - "nodes": [ - { - "port": 31200, - "wsPort": 9944, - "rpcPort": 9933, - "name": "alice", - "flags": [ - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external", - "-lxcm=trace", - "--ws-max-connections=1000" - ] - }, - { - "port": 31201, - "wsPort": 9945, - "rpcPort": 9934, - "name": "bob", - "flags": [ - "--rpc-cors=all", - "--unsafe-rpc-external", - "--unsafe-ws-external", - "-lxcm=trace", - "--ws-max-connections=1000" - ] - } - ] - } - ], - "simpleParachains": [], - "hrmpChannels": [], - "finalization": false -} diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index 27ff62d695..e3e047bf9e 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -33,15 +33,10 @@ jobs: forkless: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }} uses: ./.github/workflows/forkless.yml - + node-only-update: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }} uses: ./.github/workflows/node-only-update_v2.yml - - parallel_and_sequential_tests: - if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'para')) }} - uses: ./.github/workflows/node-only-update_v3.yml - codestyle: if: github.event.pull_request.draft == false diff --git a/.github/workflows/node-only-update_v3.yml b/.github/workflows/node-only-update_v3.yml deleted file mode 100644 index 66672ff1e3..0000000000 --- a/.github/workflows/node-only-update_v3.yml +++ /dev/null @@ -1,212 +0,0 @@ -name: Parallele tests - -# Controls when the action will run. -on: - workflow_call: -#Define Workflow variables - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - nodes-execution-matrix: - - name: execution matrix - - runs-on: self-hosted-ci - outputs: - matrix: ${{ steps.create_matrix.outputs.matrix }} - - steps: - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Create Execution matrix - uses: fabiocaccamo/create-matrix-action@v2 - id: create_matrix - with: - matrix: | - network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} - network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} - network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} - - nodes-only-update: - needs: nodes-execution-matrix - # The type of runner that the job will run on - runs-on: [self-hosted-ci,large] - - - - timeout-minutes: 1380 - - name: ${{ matrix.network }} - - continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. - - strategy: - matrix: - include: ${{fromJson(needs.nodes-execution-matrix.outputs.matrix)}} - - steps: - - - name: Clean Workspace - uses: AutoModality/action-clean@v1.1.0 - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} #Checking out head commit - - - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 - - - name: Generate ENV related extend file for docker-compose - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/docker-compose.tmp-node.j2 - output_file: .docker/docker-compose.node.${{ matrix.network }}.yml - variables: | - REPO_URL=${{ github.server_url }}/${{ github.repository }}.git - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} - POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }} - MAINNET_TAG=${{ matrix.mainnet_tag }} - MAINNET_BRANCH=${{ matrix.mainnet_branch }} - FEATURE=${{ matrix.features }} - RUNTIME=${{ matrix.runtime }} - BRANCH=${{ github.head_ref }} - - - name: Show build configuration - run: cat .docker/docker-compose.node.${{ matrix.network }}.yml - - - name: Generate launch-config-forkless-nodata.json - uses: cuchi/jinja2-action@v1.2.0 - with: - template: .docker/forkless-config/launch-config-node-update-only-v3.j2 - output_file: .docker/launch-config-forkless-nodata.json - variables: | - FEATURE=${{ matrix.features }} - RUNTIME=${{ matrix.runtime }} - - - name: Show launch-config-forkless configuration - run: cat .docker/launch-config-forkless-nodata.json - - - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Build the stack - run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate --timeout 300 - - # 🚀 POLKADOT LAUNCH COMPLETE 🚀 - - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade. - if: success() - run: | - counter=160 - function check_container_status { - docker inspect -f {{.State.Running}} node-parachain - } - function do_docker_logs { - docker logs --details node-parachain 2>&1 - } - function is_started { - if [ "$(check_container_status)" == "true" ]; then - echo "Container: node-parachain RUNNING"; - echo "Check Docker logs" - DOCKER_LOGS=$(do_docker_logs) - if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then - echo "🚀 POLKADOT LAUNCH COMPLETE 🚀" - return 0 - else - echo "Message not found in logs output, repeating..." - return 1 - fi - else - echo "Container node-parachain NOT RUNNING" - echo "Halting all future checks" - exit 1 - fi - echo "something goes wrong" - exit 1 - } - while ! is_started; do - echo "Waiting for special message in log files " - sleep 30s - counter=$(( $counter - 1 )) - echo "Counter: $counter" - if [ "$counter" -gt "0" ]; then - continue - else - break - fi - done - echo "Halting script" - exit 0 - shell: bash - - - name: Run Parallel tests on Node Parachain - working-directory: ${{ matrix.mainnet_branch }}/tests - run: | - yarn install - yarn add mochawesome - echo "Ready to start tests" - yarn polkadot-types - NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW} - env: - RPC_URL: http://127.0.0.1:9933/ - - - name: Parallel Tests report - uses: phoenix-actions/test-reporting@v8 - id: test-report-parallel - if: success() || failure() # run this step even if previous step failed - with: - name: Parallel Tests report - ${{ matrix.network }} # Name of the check run which will be created - path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-parallel-*.json # Path to test results - reporter: mochawesome-json - fail-on-error: 'false' - - - name: Run Sequential tests on Node Parachain - working-directory: ${{ matrix.mainnet_branch }}/tests - run: | - yarn install - yarn add mochawesome - echo "Ready to start tests" - yarn polkadot-types - NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW} - env: - RPC_URL: http://127.0.0.1:9933/ - - - name: Sequential Tests report - uses: phoenix-actions/test-reporting@v8 - id: test-report-sequential - if: success() || failure() # run this step even if previous step failed - with: - name: Parallel Tests report - ${{ matrix.network }} # Name of the check run which will be created - path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-sequential-*.json # Path to test results - reporter: mochawesome-json - fail-on-error: 'false' - - - name: Stop running containers - if: always() # run this step always - run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" down --volumes - - - name: Remove builder cache - if: always() # run this step always - run: | - docker builder prune -f -a - docker system prune -f - docker image prune -f -a - -# - name: List files in Workspace -# if: always() -# uses: | -# ls -la ./ -# From 5f01d0ec4a383ee33c88d0c6e30fbd1a020f2ad3 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:37:05 +0300 Subject: [PATCH 1176/1274] Create launch-config-node-update-only-v3.j2 --- .../launch-config-node-update-only-v3.j2 | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 .docker/forkless-config/launch-config-node-update-only-v3.j2 diff --git a/.docker/forkless-config/launch-config-node-update-only-v3.j2 b/.docker/forkless-config/launch-config-node-update-only-v3.j2 new file mode 100644 index 0000000000..3d326dd096 --- /dev/null +++ b/.docker/forkless-config/launch-config-node-update-only-v3.j2 @@ -0,0 +1,127 @@ +{ + "relaychain": { + "bin": "/polkadot/target/release/polkadot", + "upgradeBin": "/polkadot/target/release/polkadot", + "upgradeWasm": "/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm", + "chain": "rococo-local", + "nodes": [ + { + "name": "alice", + "wsPort": 9844, + "rpcPort": 9843, + "port": 30444, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "bob", + "wsPort": 9855, + "rpcPort": 9854, + "port": 30555, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "charlie", + "wsPort": 9866, + "rpcPort": 9865, + "port": 30666, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "dave", + "wsPort": 9877, + "rpcPort": 9876, + "port": 30777, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + }, + { + "name": "eve", + "wsPort": 9888, + "rpcPort": 9887, + "port": 30888, + "flags": [ + "-lparachain::candidate_validation=debug", + "-lxcm=trace", + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external" + ] + } + ], + "genesis": { + "runtime": { + "runtime_genesis_config": { + "parachainsConfiguration": { + "config": { + "validation_upgrade_frequency": 1, + "validation_upgrade_delay": 1 + } + } + } + } + } + }, + "parachains": [ + { + "bin": "/unique-chain/current/release/unique-collator", + "upgradeBin": "/unique-chain/target/release/unique-collator", + "upgradeWasm": "/unique-chain/target/release/wbuild/{{ FEATURE }}/{{ RUNTIME }}_runtime.compact.compressed.wasm", + "id": "1000", + "balance": "1000000000000000000000000", + "nodes": [ + { + "port": 31200, + "wsPort": 9944, + "rpcPort": 9933, + "name": "alice", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace", + "--ws-max-connections=1000" + ] + }, + { + "port": 31201, + "wsPort": 9945, + "rpcPort": 9934, + "name": "bob", + "flags": [ + "--rpc-cors=all", + "--unsafe-rpc-external", + "--unsafe-ws-external", + "-lxcm=trace", + "--ws-max-connections=1000" + ] + } + ] + } + ], + "simpleParachains": [], + "hrmpChannels": [], + "finalization": false +} From 1df905c95b6548429b49d5e0f14d75198fff3438 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:37:53 +0300 Subject: [PATCH 1177/1274] Create node-only-update_v3.yml --- .github/workflows/node-only-update_v3.yml | 212 ++++++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 .github/workflows/node-only-update_v3.yml diff --git a/.github/workflows/node-only-update_v3.yml b/.github/workflows/node-only-update_v3.yml new file mode 100644 index 0000000000..66672ff1e3 --- /dev/null +++ b/.github/workflows/node-only-update_v3.yml @@ -0,0 +1,212 @@ +name: Parallele tests + +# Controls when the action will run. +on: + workflow_call: +#Define Workflow variables + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + nodes-execution-matrix: + + name: execution matrix + + runs-on: self-hosted-ci + outputs: + matrix: ${{ steps.create_matrix.outputs.matrix }} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Create Execution matrix + uses: fabiocaccamo/create-matrix-action@v2 + id: create_matrix + with: + matrix: | + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} + + nodes-only-update: + needs: nodes-execution-matrix + # The type of runner that the job will run on + runs-on: [self-hosted-ci,large] + + + + timeout-minutes: 1380 + + name: ${{ matrix.network }} + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.nodes-execution-matrix.outputs.matrix)}} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-node.j2 + output_file: .docker/docker-compose.node.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }} + MAINNET_TAG=${{ matrix.mainnet_tag }} + MAINNET_BRANCH=${{ matrix.mainnet_branch }} + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + BRANCH=${{ github.head_ref }} + + - name: Show build configuration + run: cat .docker/docker-compose.node.${{ matrix.network }}.yml + + - name: Generate launch-config-forkless-nodata.json + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/forkless-config/launch-config-node-update-only-v3.j2 + output_file: .docker/launch-config-forkless-nodata.json + variables: | + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + + - name: Show launch-config-forkless configuration + run: cat .docker/launch-config-forkless-nodata.json + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate --timeout 300 + + # 🚀 POLKADOT LAUNCH COMPLETE 🚀 + - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade. + if: success() + run: | + counter=160 + function check_container_status { + docker inspect -f {{.State.Running}} node-parachain + } + function do_docker_logs { + docker logs --details node-parachain 2>&1 + } + function is_started { + if [ "$(check_container_status)" == "true" ]; then + echo "Container: node-parachain RUNNING"; + echo "Check Docker logs" + DOCKER_LOGS=$(do_docker_logs) + if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then + echo "🚀 POLKADOT LAUNCH COMPLETE 🚀" + return 0 + else + echo "Message not found in logs output, repeating..." + return 1 + fi + else + echo "Container node-parachain NOT RUNNING" + echo "Halting all future checks" + exit 1 + fi + echo "something goes wrong" + exit 1 + } + while ! is_started; do + echo "Waiting for special message in log files " + sleep 30s + counter=$(( $counter - 1 )) + echo "Counter: $counter" + if [ "$counter" -gt "0" ]; then + continue + else + break + fi + done + echo "Halting script" + exit 0 + shell: bash + + - name: Run Parallel tests on Node Parachain + working-directory: ${{ matrix.mainnet_branch }}/tests + run: | + yarn install + yarn add mochawesome + echo "Ready to start tests" + yarn polkadot-types + NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW} + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Parallel Tests report + uses: phoenix-actions/test-reporting@v8 + id: test-report-parallel + if: success() || failure() # run this step even if previous step failed + with: + name: Parallel Tests report - ${{ matrix.network }} # Name of the check run which will be created + path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-parallel-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' + + - name: Run Sequential tests on Node Parachain + working-directory: ${{ matrix.mainnet_branch }}/tests + run: | + yarn install + yarn add mochawesome + echo "Ready to start tests" + yarn polkadot-types + NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW} + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Sequential Tests report + uses: phoenix-actions/test-reporting@v8 + id: test-report-sequential + if: success() || failure() # run this step even if previous step failed + with: + name: Parallel Tests report - ${{ matrix.network }} # Name of the check run which will be created + path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-sequential-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" down --volumes + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f -a + docker system prune -f + docker image prune -f -a + +# - name: List files in Workspace +# if: always() +# uses: | +# ls -la ./ +# From 7671be6aad419e2a1f0f4c0313f9fe552af7f8f2 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:38:27 +0300 Subject: [PATCH 1178/1274] Update ci-develop.yml --- .github/workflows/ci-develop.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index e3e047bf9e..544868f0e8 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -37,6 +37,10 @@ jobs: node-only-update: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }} uses: ./.github/workflows/node-only-update_v2.yml + + parallel_and_sequential_tests: + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'para')) }} + uses: ./.github/workflows/node-only-update_v3.yml codestyle: if: github.event.pull_request.draft == false From 450f13af06cbdc60125c5a36ca5ccff7d353ffbb Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:39:09 +0300 Subject: [PATCH 1179/1274] Update Dockerfile-parachain-upgrade --- .docker/Dockerfile-parachain-upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index ef86bd66c0..d16cd35809 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -81,7 +81,7 @@ RUN apt-get -y update && \ nvm install v16.16.0 && \ nvm use v16.16.0 -RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/runtime-upgrade-testing +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b unique-network RUN export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ From be1f14fd7756397ad432d113934558d34cfbd63d Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 18 Oct 2022 18:23:24 +0300 Subject: [PATCH 1180/1274] Update node-only-update_v3.yml --- .github/workflows/node-only-update_v3.yml | 164 ++++++++++++++++++++-- 1 file changed, 156 insertions(+), 8 deletions(-) diff --git a/.github/workflows/node-only-update_v3.yml b/.github/workflows/node-only-update_v3.yml index 66672ff1e3..78911f9fed 100644 --- a/.github/workflows/node-only-update_v3.yml +++ b/.github/workflows/node-only-update_v3.yml @@ -34,11 +34,11 @@ jobs: id: create_matrix with: matrix: | - network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} + network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}} network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}} network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}} - nodes-only-update: + parallel-test: needs: nodes-execution-matrix # The type of runner that the job will run on runs-on: [self-hosted-ci,large] @@ -47,7 +47,7 @@ jobs: timeout-minutes: 1380 - name: ${{ matrix.network }} + name: ${{ matrix.network }} - parallel continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. @@ -205,8 +205,156 @@ jobs: docker system prune -f docker image prune -f -a -# - name: List files in Workspace -# if: always() -# uses: | -# ls -la ./ -# + - name: List files in Workspace + if: always() + uses: ls -la ./ + + sequential-test: + needs: nodes-execution-matrix + # The type of runner that the job will run on + runs-on: [self-hosted-ci,large] + + + + timeout-minutes: 1380 + + name: ${{ matrix.network }} - sequential + + continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. + + strategy: + matrix: + include: ${{fromJson(needs.nodes-execution-matrix.outputs.matrix)}} + + steps: + + - name: Clean Workspace + uses: AutoModality/action-clean@v1.1.0 + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} #Checking out head commit + + - name: Read .env file + uses: xom9ikk/dotenv@v1.0.2 + + - name: Generate ENV related extend file for docker-compose + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/docker-compose.tmp-node.j2 + output_file: .docker/docker-compose.node.${{ matrix.network }}.yml + variables: | + REPO_URL=${{ github.server_url }}/${{ github.repository }}.git + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }} + POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }} + MAINNET_TAG=${{ matrix.mainnet_tag }} + MAINNET_BRANCH=${{ matrix.mainnet_branch }} + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + BRANCH=${{ github.head_ref }} + + - name: Show build configuration + run: cat .docker/docker-compose.node.${{ matrix.network }}.yml + + - name: Generate launch-config-forkless-nodata.json + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/forkless-config/launch-config-node-update-only-v3.j2 + output_file: .docker/launch-config-forkless-nodata.json + variables: | + FEATURE=${{ matrix.features }} + RUNTIME=${{ matrix.runtime }} + + - name: Show launch-config-forkless configuration + run: cat .docker/launch-config-forkless-nodata.json + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate --timeout 300 + + # 🚀 POLKADOT LAUNCH COMPLETE 🚀 + - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade. + if: success() + run: | + counter=160 + function check_container_status { + docker inspect -f {{.State.Running}} node-parachain + } + function do_docker_logs { + docker logs --details node-parachain 2>&1 + } + function is_started { + if [ "$(check_container_status)" == "true" ]; then + echo "Container: node-parachain RUNNING"; + echo "Check Docker logs" + DOCKER_LOGS=$(do_docker_logs) + if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then + echo "🚀 POLKADOT LAUNCH COMPLETE 🚀" + return 0 + else + echo "Message not found in logs output, repeating..." + return 1 + fi + else + echo "Container node-parachain NOT RUNNING" + echo "Halting all future checks" + exit 1 + fi + echo "something goes wrong" + exit 1 + } + while ! is_started; do + echo "Waiting for special message in log files " + sleep 30s + counter=$(( $counter - 1 )) + echo "Counter: $counter" + if [ "$counter" -gt "0" ]; then + continue + else + break + fi + done + echo "Halting script" + exit 0 + shell: bash + + - name: Run Sequential tests on Node Parachain + working-directory: ${{ matrix.mainnet_branch }}/tests + run: | + yarn install + yarn add mochawesome + echo "Ready to start tests" + yarn polkadot-types + NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW} + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Sequential Tests report + uses: phoenix-actions/test-reporting@v8 + id: test-report-sequential + if: success() || failure() # run this step even if previous step failed + with: + name: Parallel Tests report - ${{ matrix.network }} # Name of the check run which will be created + path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-sequential-*.json # Path to test results + reporter: mochawesome-json + fail-on-error: 'false' + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" down --volumes + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f -a + docker system prune -f + docker image prune -f -a + + - name: List files in Workspace + if: always() + uses: ls -la ./ From 2fc4ab68b72c7beea00b51abaf1b0a05b33f1776 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 18 Oct 2022 18:40:20 +0300 Subject: [PATCH 1181/1274] Update node-only-update_v3.yml --- .github/workflows/node-only-update_v3.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node-only-update_v3.yml b/.github/workflows/node-only-update_v3.yml index 78911f9fed..ffdaafb53a 100644 --- a/.github/workflows/node-only-update_v3.yml +++ b/.github/workflows/node-only-update_v3.yml @@ -207,7 +207,7 @@ jobs: - name: List files in Workspace if: always() - uses: ls -la ./ + run: ls -la ./ sequential-test: needs: nodes-execution-matrix @@ -357,4 +357,4 @@ jobs: - name: List files in Workspace if: always() - uses: ls -la ./ + run: ls -la ./ From e3ab829f07f9cbaa71f7bf85c69b5da32ea2be47 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Tue, 18 Oct 2022 21:38:04 +0300 Subject: [PATCH 1182/1274] Update node-only-update_v3.yml --- .github/workflows/node-only-update_v3.yml | 30 ++++------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/.github/workflows/node-only-update_v3.yml b/.github/workflows/node-only-update_v3.yml index ffdaafb53a..703019d3e9 100644 --- a/.github/workflows/node-only-update_v3.yml +++ b/.github/workflows/node-only-update_v3.yml @@ -153,7 +153,7 @@ jobs: shell: bash - name: Run Parallel tests on Node Parachain - working-directory: ${{ matrix.mainnet_branch }}/tests + working-directory: tests run: | yarn install yarn add mochawesome @@ -169,31 +169,11 @@ jobs: if: success() || failure() # run this step even if previous step failed with: name: Parallel Tests report - ${{ matrix.network }} # Name of the check run which will be created - path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-parallel-*.json # Path to test results + path: tests/mochawesome-report/test-parallel-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' - - name: Run Sequential tests on Node Parachain - working-directory: ${{ matrix.mainnet_branch }}/tests - run: | - yarn install - yarn add mochawesome - echo "Ready to start tests" - yarn polkadot-types - NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW} - env: - RPC_URL: http://127.0.0.1:9933/ - - - name: Sequential Tests report - uses: phoenix-actions/test-reporting@v8 - id: test-report-sequential - if: success() || failure() # run this step even if previous step failed - with: - name: Parallel Tests report - ${{ matrix.network }} # Name of the check run which will be created - path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-sequential-*.json # Path to test results - reporter: mochawesome-json - fail-on-error: 'false' - + - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" down --volumes @@ -324,7 +304,7 @@ jobs: shell: bash - name: Run Sequential tests on Node Parachain - working-directory: ${{ matrix.mainnet_branch }}/tests + working-directory: tests run: | yarn install yarn add mochawesome @@ -340,7 +320,7 @@ jobs: if: success() || failure() # run this step even if previous step failed with: name: Parallel Tests report - ${{ matrix.network }} # Name of the check run which will be created - path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-sequential-*.json # Path to test results + path: tests/mochawesome-report/test-sequential-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' From 31d4f1eb4806d1d22f15f70e282d838133a13673 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 10:07:10 +0300 Subject: [PATCH 1183/1274] Update forkless-update-nodata_v2.yml --- .github/workflows/forkless-update-nodata_v2.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/forkless-update-nodata_v2.yml b/.github/workflows/forkless-update-nodata_v2.yml index 89937945b1..8ac595d704 100644 --- a/.github/workflows/forkless-update-nodata_v2.yml +++ b/.github/workflows/forkless-update-nodata_v2.yml @@ -189,6 +189,7 @@ jobs: - name: Run Sequential tests working-directory: tests + if: success() || failure() run: | yarn install yarn add mochawesome From 3a7bee5fca4ce730436563c0cecf70e8af9bad18 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Wed, 19 Oct 2022 07:29:38 +0000 Subject: [PATCH 1184/1274] Fix eslint errors --- tests/src/eth/base.test.ts | 2 +- tests/src/eth/collectionProperties.test.ts | 40 ++++++++++---------- tests/src/eth/collectionSponsoring.test.ts | 2 +- tests/src/eth/proxy/nonFungibleProxy.test.ts | 2 +- tests/src/eth/util/playgrounds/unique.dev.ts | 4 +- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/tests/src/eth/base.test.ts b/tests/src/eth/base.test.ts index ecde040373..efd0db0f03 100644 --- a/tests/src/eth/base.test.ts +++ b/tests/src/eth/base.test.ts @@ -44,7 +44,7 @@ describe('Contract calls', () => { from: userA, to: userB, value: '1000000', - gas: helper.eth.DEFAULT_GAS + gas: helper.eth.DEFAULT_GAS, })); const balanceB = await helper.balance.getEthereum(userB); expect(cost - balanceB < BigInt(0.2 * Number(helper.balance.getOneTokenNominal()))).to.be.true; diff --git a/tests/src/eth/collectionProperties.test.ts b/tests/src/eth/collectionProperties.test.ts index d0ae110fdb..94c1d7c648 100644 --- a/tests/src/eth/collectionProperties.test.ts +++ b/tests/src/eth/collectionProperties.test.ts @@ -87,20 +87,20 @@ describe('Supports ERC721Metadata', () => { const caller = await helper.eth.createAccountWithBalance(donor); const bruh = await helper.eth.createAccountWithBalance(donor); - const BASE_URI = 'base/' - const SUFFIX = 'suffix1' - const URI = 'uri1' + const BASE_URI = 'base/'; + const SUFFIX = 'suffix1'; + const URI = 'uri1'; const collectionHelpers = helper.ethNativeContract.collectionHelpers(caller); - const creatorMethod = mode === 'rft' ? 'createRFTCollection' : 'createNFTCollection' + const creatorMethod = mode === 'rft' ? 'createRFTCollection' : 'createNFTCollection'; - const {collectionId, collectionAddress} = await helper.eth[creatorMethod](caller, 'n', 'd', 'p') + const {collectionId, collectionAddress} = await helper.eth[creatorMethod](caller, 'n', 'd', 'p'); const contract = helper.ethNativeContract.collectionById(collectionId, mode, caller); await contract.methods.addCollectionAdmin(bruh).send(); // to check that admin will work too const collection1 = await helper.nft.getCollectionObject(collectionId); - const data1 = await collection1.getData() + const data1 = await collection1.getData(); expect(data1?.raw.flags.erc721metadata).to.be.false; expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.false; @@ -110,36 +110,36 @@ describe('Supports ERC721Metadata', () => { expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.true; const collection2 = await helper.nft.getCollectionObject(collectionId); - const data2 = await collection2.getData() + const data2 = await collection2.getData(); expect(data2?.raw.flags.erc721metadata).to.be.true; - const TPPs = data2?.raw.tokenPropertyPermissions + const TPPs = data2?.raw.tokenPropertyPermissions; expect(TPPs?.length).to.equal(2); expect(TPPs.find((tpp: ITokenPropertyPermission) => { - return tpp.key === "URI" && tpp.permission.mutable && tpp.permission.collectionAdmin && !tpp.permission.tokenOwner - })).to.be.not.null + return tpp.key === 'URI' && tpp.permission.mutable && tpp.permission.collectionAdmin && !tpp.permission.tokenOwner; + })).to.be.not.null; expect(TPPs.find((tpp: ITokenPropertyPermission) => { - return tpp.key === "URISuffix" && tpp.permission.mutable && tpp.permission.collectionAdmin && !tpp.permission.tokenOwner - })).to.be.not.null + return tpp.key === 'URISuffix' && tpp.permission.mutable && tpp.permission.collectionAdmin && !tpp.permission.tokenOwner; + })).to.be.not.null; expect(data2?.raw.properties?.find((property: IProperty) => { - return property.key === "baseURI" && property.value === BASE_URI - })).to.be.not.null + return property.key === 'baseURI' && property.value === BASE_URI; + })).to.be.not.null; const token1Result = await contract.methods.mint(bruh).send(); const tokenId1 = token1Result.events.Transfer.returnValues.tokenId; expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI); - await contract.methods.setProperty(tokenId1, "URISuffix", Buffer.from(SUFFIX)).send(); + await contract.methods.setProperty(tokenId1, 'URISuffix', Buffer.from(SUFFIX)).send(); expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI + SUFFIX); - await contract.methods.setProperty(tokenId1, "URI", Buffer.from(URI)).send(); + await contract.methods.setProperty(tokenId1, 'URI', Buffer.from(URI)).send(); expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(URI); - await contract.methods.deleteProperty(tokenId1, "URI").send(); + await contract.methods.deleteProperty(tokenId1, 'URI').send(); expect(await contract.methods.tokenURI(tokenId1).call()).to.equal(BASE_URI + SUFFIX); const token2Result = await contract.methods.mintWithTokenURI(bruh, URI).send(); @@ -147,12 +147,12 @@ describe('Supports ERC721Metadata', () => { expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(URI); - await contract.methods.deleteProperty(tokenId2, "URI").send(); + await contract.methods.deleteProperty(tokenId2, 'URI').send(); expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(BASE_URI); - await contract.methods.setProperty(tokenId2, "URISuffix", Buffer.from(SUFFIX)).send(); + await contract.methods.setProperty(tokenId2, 'URISuffix', Buffer.from(SUFFIX)).send(); expect(await contract.methods.tokenURI(tokenId2).call()).to.equal(BASE_URI + SUFFIX); - } + }; itEth('ERC721Metadata property can be set for NFT collection', async({helper}) => { await checkERC721Metadata(helper, 'nft'); diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index 78519b9a3f..df04d80d8d 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -247,7 +247,7 @@ describe('evm collection sponsoring', () => { const userCollectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', user); - let result = await userCollectionEvm.methods.mintWithTokenURI(user, 'Test URI',).send(); + const result = await userCollectionEvm.methods.mintWithTokenURI(user, 'Test URI').send(); const tokenId = result.events.Transfer.returnValues.tokenId; const events = helper.eth.normalizeEvents(result.events); diff --git a/tests/src/eth/proxy/nonFungibleProxy.test.ts b/tests/src/eth/proxy/nonFungibleProxy.test.ts index f840392818..dc05394088 100644 --- a/tests/src/eth/proxy/nonFungibleProxy.test.ts +++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts @@ -111,7 +111,7 @@ describe('NFT (Via EVM proxy): Plain calls', () => { await collectionEvmOwned.methods.addCollectionAdmin(contract.options.address).send(); { - const nextTokenId = await contract.methods.nextTokenId().call() + const nextTokenId = await contract.methods.nextTokenId().call(); const result = await contract.methods.mintWithTokenURI(receiver, nextTokenId, 'Test URI').send({from: caller}); const tokenId = result.events.Transfer.returnValues.tokenId; expect(tokenId).to.be.equal('1'); diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index 32ed18a819..f3c070336f 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -189,7 +189,7 @@ class EthGroup extends EthGroupBase { async createERC721MetadataCompatibleNFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string}> { const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); - const {collectionId, collectionAddress} = await this.createNFTCollection(signer, name, description, tokenPrefix) + const {collectionId, collectionAddress} = await this.createNFTCollection(signer, name, description, tokenPrefix); await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send(); @@ -211,7 +211,7 @@ class EthGroup extends EthGroupBase { async createERC721MetadataCompatibleRFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{collectionId: number, collectionAddress: string}> { const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer); - const {collectionId, collectionAddress} = await this.createRFTCollection(signer, name, description, tokenPrefix) + const {collectionId, collectionAddress} = await this.createRFTCollection(signer, name, description, tokenPrefix); await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send(); From 6878b4fe823928456763e9d7537ae24e21d9de02 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 10:51:59 +0300 Subject: [PATCH 1185/1274] Update ci-develop.yml --- .github/workflows/ci-develop.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index 544868f0e8..8f03193f44 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -1,14 +1,18 @@ +# Workflow which controls starts nested workflows. name: develop +# Triger: PR at 'develop' branch with following types of events. on: pull_request: branches: [ 'develop' ] types: [ opened, reopened, synchronize, ready_for_review, converted_to_draft ] +#Concurency group for control execution queue over github runners. concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true +# List of a jobs included into Workflow. jobs: yarn-test-dev: From 0e2b41963beca3a12d8c2328d60bfc5d22908334 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 10:52:12 +0300 Subject: [PATCH 1186/1274] Update ci-master.yml --- .github/workflows/ci-master.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index 9e704cf3f3..437d4b2614 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -1,14 +1,18 @@ +# Workflow which controls starts nested workflows. name: master +# Triger: PR at 'master' branch with following types of events. on: pull_request: branches: [ 'master' ] types: [ opened, reopened, synchronize, ready_for_review ] +#Concurency group for control execution queue over github runners. concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true +# List of a jobs included into Workflow. jobs: unit-test: @@ -29,4 +33,4 @@ jobs: secrets: inherit # pass all secrets codestyle: - uses: ./.github/workflows/codestyle_v2.yml \ No newline at end of file + uses: ./.github/workflows/codestyle_v2.yml From 584bade5244ccd9159545caf6d18595602afebc1 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 10:54:01 +0300 Subject: [PATCH 1187/1274] Update ci-master.yml --- .github/workflows/ci-master.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index 437d4b2614..ce13aea4c2 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -26,11 +26,11 @@ jobs: canary: uses: ./.github/workflows/canary.yml - secrets: inherit # pass all secrets + secrets: inherit # pass all secrets from initial workflow to nested xcm: uses: ./.github/workflows/xcm.yml - secrets: inherit # pass all secrets + secrets: inherit # pass all secrets from initial workflow to nested codestyle: uses: ./.github/workflows/codestyle_v2.yml From ce804864f04fffee00444f60886b414bd283796a Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 10:55:48 +0300 Subject: [PATCH 1188/1274] Update ci-develop.yml --- .github/workflows/ci-develop.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index 8f03193f44..8dae35471f 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -16,40 +16,40 @@ concurrency: jobs: yarn-test-dev: - if: github.event.pull_request.draft == false + if: github.event.pull_request.draft == false # Conditional check for draft per job. uses: ./.github/workflows/dev-build-tests_v2.yml unit-test: - if: github.event.pull_request.draft == false + if: github.event.pull_request.draft == false # Conditional check for draft per job. uses: ./.github/workflows/unit-test_v2.yml canary: - if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'canary')) }} + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'canary')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/canary.yml - secrets: inherit # pass all secrets + secrets: inherit # pass all secrets from initial workflow to nested xcm: - if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'xcm')) }} + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'xcm')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/xcm.yml - secrets: inherit # pass all secrets + secrets: inherit # pass all secrets from initial workflow to nested forkless: - if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }} + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/forkless.yml node-only-update: - if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }} + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/node-only-update_v2.yml parallel_and_sequential_tests: - if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'para')) }} + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'para')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/node-only-update_v3.yml codestyle: - if: github.event.pull_request.draft == false + if: github.event.pull_request.draft == false # Conditional check for draft per job. uses: ./.github/workflows/codestyle_v2.yml yarn_eslint: - if: github.event.pull_request.draft == false + if: github.event.pull_request.draft == false # Conditional check for draft per job. uses: ./.github/workflows/test_codestyle_v2.yml From 3e00f5b51d80dc64fbe127313aa738080a38e9de Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 10:59:41 +0300 Subject: [PATCH 1189/1274] Update codestyle_v2.yml --- .github/workflows/codestyle_v2.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/codestyle_v2.yml b/.github/workflows/codestyle_v2.yml index 3ecce37b21..93a5438d00 100644 --- a/.github/workflows/codestyle_v2.yml +++ b/.github/workflows/codestyle_v2.yml @@ -1,5 +1,8 @@ +# Nested workflow for checks related to formatting Rust code + name: cargo fmt +# Triger: only call from main workflow(re-usable workflows) on: workflow_call: From 3896cd11a5dca5d7c135e8e4447a4bf2d0ae5f34 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 19 Oct 2022 08:35:13 +0000 Subject: [PATCH 1190/1274] fix: Cargo.lock --- Cargo.lock | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3ee64e3714..ee89308fab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6710,24 +6710,6 @@ dependencies = [ "up-sponsorship", ] -[[package]] -name = "pallet-unique-scheduler-v2" -version = "0.1.0" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-preimage", - "parity-scale-codec 3.2.1", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "substrate-test-utils", -] - [[package]] name = "pallet-utility" version = "4.0.0-dev" From f921c0198e5114fba100c9cc3b63998d26c1e43b Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Wed, 19 Oct 2022 08:35:42 +0000 Subject: [PATCH 1191/1274] tests: remove scheduler from required pallets + fix some lint warnings --- tests/src/eth/base.test.ts | 4 +--- tests/src/eth/collectionProperties.test.ts | 13 ++++++------- tests/src/eth/util/index.ts | 4 ++-- tests/src/pallet-presence.test.ts | 4 ++-- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/tests/src/eth/base.test.ts b/tests/src/eth/base.test.ts index efd0db0f03..5a2287181e 100644 --- a/tests/src/eth/base.test.ts +++ b/tests/src/eth/base.test.ts @@ -14,8 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -import {Contract} from 'web3-eth-contract'; - import {IKeyringPair} from '@polkadot/types/types'; import {EthUniqueHelper, itEth, usingEthPlaygrounds, expect} from './util'; @@ -93,7 +91,7 @@ describe('ERC165 tests', async () => { const donor = await privateKey({filename: __filename}); const [alice] = await helper.arrange.createAccounts([10n], donor); ({collectionId: simpleNftCollectionId} = await helper.nft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'})); - minter = helper.eth.createAccount(); + minter = await helper.eth.createAccountWithBalance(donor); ({collectionId: erc721MetadataCompatibleNftCollectionId} = await helper.eth.createERC721MetadataCompatibleNFTCollection(minter, 'n', 'd', 'p', BASE_URI)); }); }); diff --git a/tests/src/eth/collectionProperties.test.ts b/tests/src/eth/collectionProperties.test.ts index 94c1d7c648..6829627da2 100644 --- a/tests/src/eth/collectionProperties.test.ts +++ b/tests/src/eth/collectionProperties.test.ts @@ -18,7 +18,6 @@ import {itEth, usingEthPlaygrounds, expect, EthUniqueHelper} from './util'; import {Pallets} from '../util'; import {IProperty, ITokenPropertyPermission} from '../util/playgrounds/types'; import {IKeyringPair} from '@polkadot/types/types'; -import {Contract} from 'web3-eth-contract'; describe('EVM collection properties', () => { let donor: IKeyringPair; @@ -99,7 +98,7 @@ describe('Supports ERC721Metadata', () => { const contract = helper.ethNativeContract.collectionById(collectionId, mode, caller); await contract.methods.addCollectionAdmin(bruh).send(); // to check that admin will work too - const collection1 = await helper.nft.getCollectionObject(collectionId); + const collection1 = helper.nft.getCollectionObject(collectionId); const data1 = await collection1.getData(); expect(data1?.raw.flags.erc721metadata).to.be.false; expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.false; @@ -109,18 +108,18 @@ describe('Supports ERC721Metadata', () => { expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.true; - const collection2 = await helper.nft.getCollectionObject(collectionId); + const collection2 = helper.nft.getCollectionObject(collectionId); const data2 = await collection2.getData(); expect(data2?.raw.flags.erc721metadata).to.be.true; - const TPPs = data2?.raw.tokenPropertyPermissions; - expect(TPPs?.length).to.equal(2); + const propertyPermissions = data2?.raw.tokenPropertyPermissions; + expect(propertyPermissions?.length).to.equal(2); - expect(TPPs.find((tpp: ITokenPropertyPermission) => { + expect(propertyPermissions.find((tpp: ITokenPropertyPermission) => { return tpp.key === 'URI' && tpp.permission.mutable && tpp.permission.collectionAdmin && !tpp.permission.tokenOwner; })).to.be.not.null; - expect(TPPs.find((tpp: ITokenPropertyPermission) => { + expect(propertyPermissions.find((tpp: ITokenPropertyPermission) => { return tpp.key === 'URISuffix' && tpp.permission.mutable && tpp.permission.collectionAdmin && !tpp.permission.tokenOwner; })).to.be.not.null; diff --git a/tests/src/eth/util/index.ts b/tests/src/eth/util/index.ts index 0974417006..67e9b6c881 100644 --- a/tests/src/eth/util/index.ts +++ b/tests/src/eth/util/index.ts @@ -14,7 +14,7 @@ export {EthUniqueHelper} from './playgrounds/unique.dev'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; import chaiLike from 'chai-like'; -import {getTestSeed, requirePalletsOrSkip} from '../../util'; +import {getTestSeed, MINIMUM_DONOR_FUND, requirePalletsOrSkip} from '../../util'; chai.use(chaiAsPromised); chai.use(chaiLike); @@ -43,7 +43,7 @@ export const usingEthPlaygrounds = async (code: (helper: EthUniqueHelper, privat else { const actualSeed = getTestSeed(seed.filename); let account = helper.util.fromSeed(actualSeed, ss58Format); - if (await helper.balance.getSubstrate(account.address) == 0n) { + if (await helper.balance.getSubstrate(account.address) < MINIMUM_DONOR_FUND) { console.warn(`${path.basename(seed.filename)}: Not enough funds present on the filename account. Using the default one as the donor instead.`); account = helper.util.fromSeed('//Alice', ss58Format); } diff --git a/tests/src/pallet-presence.test.ts b/tests/src/pallet-presence.test.ts index 524e122369..502c711b97 100644 --- a/tests/src/pallet-presence.test.ts +++ b/tests/src/pallet-presence.test.ts @@ -62,7 +62,7 @@ describe('Pallet presence', () => { const chain = await helper.callRpc('api.rpc.system.chain', []); const refungible = 'refungible'; - const scheduler = 'scheduler'; + // const scheduler = 'scheduler'; const foreignAssets = 'foreignassets'; const rmrkPallets = ['rmrkcore', 'rmrkequip']; const appPromotion = 'apppromotion'; @@ -70,7 +70,7 @@ describe('Pallet presence', () => { if (chain.eq('OPAL by UNIQUE')) { requiredPallets.push( refungible, - scheduler, + // scheduler, foreignAssets, appPromotion, ...rmrkPallets, From ef903e501305e13ab30555955e3fd53eaa9e924a Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 11:42:47 +0300 Subject: [PATCH 1192/1274] Update dev-build-tests_v2.yml --- .github/workflows/dev-build-tests_v2.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev-build-tests_v2.yml b/.github/workflows/dev-build-tests_v2.yml index 02a0859d93..c102d7cd83 100644 --- a/.github/workflows/dev-build-tests_v2.yml +++ b/.github/workflows/dev-build-tests_v2.yml @@ -1,8 +1,9 @@ +# Integration test in --dev mode +# https://cryptousetech.atlassian.net/browse/CI-12 name: yarn test dev -# Controls when the action will run. +# Triger: only call from main workflow(re-usable workflows) on: - # Triggers the workflow on push or pull request events but only for the master branch workflow_call: @@ -101,4 +102,4 @@ jobs: run: | docker builder prune -f -a docker system prune -f - docker image prune -f -a \ No newline at end of file + docker image prune -f -a From 7fce581821a30b430a4251a1fc0840b5b4d1a1f2 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 11:49:29 +0300 Subject: [PATCH 1193/1274] Update forkless-update-data_v2.yml --- .github/workflows/forkless-update-data_v2.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/forkless-update-data_v2.yml b/.github/workflows/forkless-update-data_v2.yml index e40c8119d7..2bf3a7c254 100644 --- a/.github/workflows/forkless-update-data_v2.yml +++ b/.github/workflows/forkless-update-data_v2.yml @@ -1,12 +1,11 @@ -# Controls when the action will run. +# Forkless update with data replication +# https://cryptousetech.atlassian.net/browse/CI-42 + +# Triger: only call from main workflow(re-usable workflows) on: workflow_call: -#Define Workflow variables -env: - REPO_URL: ${{ github.server_url }}/${{ github.repository }} - # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -163,3 +162,10 @@ jobs: - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down --volumes + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f -a + docker system prune -f + docker image prune -f -a From 9fbaca1b2badec77de0366cbf80249eeccdc3b39 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 11:49:54 +0300 Subject: [PATCH 1194/1274] Update forkless-update-nodata_v2.yml --- .github/workflows/forkless-update-nodata_v2.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/forkless-update-nodata_v2.yml b/.github/workflows/forkless-update-nodata_v2.yml index 8ac595d704..9cd17dfe5a 100644 --- a/.github/workflows/forkless-update-nodata_v2.yml +++ b/.github/workflows/forkless-update-nodata_v2.yml @@ -1,6 +1,7 @@ +# Forkless update without data replication +# https://cryptousetech.atlassian.net/browse/CI-41 - -# Controls when the action will run. +# Triger: only call from main workflow(re-usable workflows) on: workflow_call: From 011415104ad1cf595f78dd5a273b6eeda8512c97 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 11:52:31 +0300 Subject: [PATCH 1195/1274] Update forkless-update-nodata_v2.yml --- .github/workflows/forkless-update-nodata_v2.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/forkless-update-nodata_v2.yml b/.github/workflows/forkless-update-nodata_v2.yml index 9cd17dfe5a..d74c4f2d84 100644 --- a/.github/workflows/forkless-update-nodata_v2.yml +++ b/.github/workflows/forkless-update-nodata_v2.yml @@ -214,3 +214,10 @@ jobs: - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f -a + docker system prune -f + docker image prune -f -a From 64f6966cbc6d4fddf201552f21faf1e2bb6a336d Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 11:56:03 +0300 Subject: [PATCH 1196/1274] Update forkless.yml --- .github/workflows/forkless.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/forkless.yml b/.github/workflows/forkless.yml index 819a4decfa..e974c9c4cf 100644 --- a/.github/workflows/forkless.yml +++ b/.github/workflows/forkless.yml @@ -1,3 +1,5 @@ +# Intermediate Nested Workflow for calling subworkflows as a parallel tasks. + name: Nesting Forkless on: From 151b57cbf0f3f80ae3bb5f78cdb4ff5ee4f63818 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 11:58:21 +0300 Subject: [PATCH 1197/1274] Update market-test_v2.yml --- .github/workflows/market-test_v2.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index ac5f17e407..382961f256 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -1,3 +1,6 @@ +#https://cryptousetech.atlassian.net/browse/CI-37 +# Nested workflow for lunching Market e2e tests from external repository https://github.com/UniqueNetwork/market-e2e-tests + name: market api tests # Controls when the action will run. @@ -22,14 +25,8 @@ jobs: include: - network: "opal" features: "opal-runtime" -# - network: "quartz" -# features: "quartz-runtime" -# - network: "unique" -# features: "unique-runtime" steps: - - - name: Clean Workspace uses: AutoModality/action-clean@v1.1.0 @@ -188,10 +185,3 @@ jobs: run: | docker builder prune -f docker system prune -f - - - name: Clean Workspace - if: always() - uses: AutoModality/action-clean@v1.1.0 - - - From 81331e51fe4c480564826cdc4b428b0767a6af24 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 12:02:57 +0300 Subject: [PATCH 1198/1274] Update try-runtime_v2.yml --- .github/workflows/try-runtime_v2.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/try-runtime_v2.yml b/.github/workflows/try-runtime_v2.yml index b50a2505b3..82cf085377 100644 --- a/.github/workflows/try-runtime_v2.yml +++ b/.github/workflows/try-runtime_v2.yml @@ -1,3 +1,7 @@ +# Try-runtime checks +# https://cryptousetech.atlassian.net/browse/CI-38 + +# Triger: only call from main workflow(re-usable workflows) on: workflow_call: @@ -66,3 +70,10 @@ jobs: - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-try-runtime.yml" -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" down + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f -a + docker system prune -f + docker image prune -f -a From 828b3e3482901bde1d5f23369f85a99fc5faed88 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 12:05:56 +0300 Subject: [PATCH 1199/1274] Update node-only-update_v2.yml --- .github/workflows/node-only-update_v2.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index fd029f0b2d..01ab548f58 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -1,11 +1,12 @@ +# https://cryptousetech.atlassian.net/browse/CI-85 +# Node only update with restart polkadot-launch process. + name: nodes-only update -# Controls when the action will run. +# Triger: only call from main workflow(re-usable workflows) on: workflow_call: -#Define Workflow variables -env: - REPO_URL: ${{ github.server_url }}/${{ github.repository }} + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: From 3a245f000699393448ac7b30bd82a2cb62404789 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 12:20:25 +0300 Subject: [PATCH 1200/1274] Update node-only-update_v3.yml --- .github/workflows/node-only-update_v3.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node-only-update_v3.yml b/.github/workflows/node-only-update_v3.yml index 703019d3e9..be28b05494 100644 --- a/.github/workflows/node-only-update_v3.yml +++ b/.github/workflows/node-only-update_v3.yml @@ -1,6 +1,7 @@ +# Test workflow for debug parallel and sequental tests in scope of execution time reducing. name: Parallele tests -# Controls when the action will run. +# Triger: only call from main workflow(re-usable workflows) on: workflow_call: #Define Workflow variables From 4f01d22c81db3fa18a3b79e3c462f6f7ab1d4282 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 12:21:06 +0300 Subject: [PATCH 1201/1274] Update test_codestyle_v2.yml --- .github/workflows/test_codestyle_v2.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test_codestyle_v2.yml b/.github/workflows/test_codestyle_v2.yml index a2b08d1c2e..2d5ee97873 100644 --- a/.github/workflows/test_codestyle_v2.yml +++ b/.github/workflows/test_codestyle_v2.yml @@ -1,5 +1,8 @@ +# Yarn Eslint over tests +# name: yarn eslint +# Triger: only call from main workflow(re-usable workflows) on: workflow_call: From 8d846806d507f37b256cc02e6731ef9cbc4838db Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 12:22:35 +0300 Subject: [PATCH 1202/1274] Update unit-test_v2.yml --- .github/workflows/unit-test_v2.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit-test_v2.yml b/.github/workflows/unit-test_v2.yml index 7a586d10e1..191cee5d89 100644 --- a/.github/workflows/unit-test_v2.yml +++ b/.github/workflows/unit-test_v2.yml @@ -1,8 +1,9 @@ +# Re-Usable Workflow for lanching Unit tests name: unit tests # Controls when the action will run. +# Triger: only call from main workflow(re-usable workflows) on: - # Triggers the workflow on push or pull request events but only for the master branch workflow_call: # A workflow run is made up of one or more jobs that can run sequentially or in parallel @@ -49,3 +50,10 @@ jobs: - name: Stop running containers if: always() # run this step always run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" down + + - name: Remove builder cache + if: always() # run this step always + run: | + docker builder prune -f -a + docker system prune -f + docker image prune -f -a From efa1195717a8709f0accba496fd4047bfa7b302d Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 19 Oct 2022 10:25:59 +0000 Subject: [PATCH 1203/1274] feat: hide mintBulk methods Signed-off-by: Yaroslav Bolyukin --- pallets/nonfungible/src/erc.rs | 4 +- pallets/nonfungible/src/stubs/UniqueNFT.raw | Bin 4339 -> 3813 bytes pallets/nonfungible/src/stubs/UniqueNFT.sol | 56 +++++++++--------- pallets/refungible/src/erc.rs | 4 +- .../refungible/src/stubs/UniqueRefungible.raw | Bin 4366 -> 3840 bytes .../refungible/src/stubs/UniqueRefungible.sol | 56 +++++++++--------- .../src/stubs/UniqueRefungibleToken.raw | Bin 1556 -> 1563 bytes tests/src/eth/api/UniqueNFT.sol | 34 +++++------ tests/src/eth/api/UniqueRefungible.sol | 34 +++++------ tests/src/eth/nonFungibleAbi.json | 28 --------- tests/src/eth/reFungibleAbi.json | 28 --------- 11 files changed, 94 insertions(+), 150 deletions(-) diff --git a/pallets/nonfungible/src/erc.rs b/pallets/nonfungible/src/erc.rs index c8664415c7..677efc6c0d 100644 --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -668,7 +668,7 @@ impl NonfungibleHandle { /// should be obtained with `nextTokenId` method /// @param to The new owner /// @param tokenIds IDs of the minted NFTs - // #[solidity(hide)] + #[solidity(hide)] #[weight(>::create_multiple_items(token_ids.len() as u32))] fn mint_bulk(&mut self, caller: caller, to: address, token_ids: Vec) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -705,7 +705,7 @@ impl NonfungibleHandle { /// numbers and first number should be obtained with `nextTokenId` method /// @param to The new owner /// @param tokens array of pairs of token ID and token URI for minted tokens - #[solidity(/*hide,*/ rename_selector = "mintBulkWithTokenURI")] + #[solidity(hide, rename_selector = "mintBulkWithTokenURI")] #[weight(>::create_multiple_items(tokens.len() as u32))] fn mint_bulk_with_token_uri( &mut self, diff --git a/pallets/nonfungible/src/stubs/UniqueNFT.raw b/pallets/nonfungible/src/stubs/UniqueNFT.raw index c9f0bd002a567902dc391ac5abb38d5f9c26a789..7447cb23a347a5320eb0f405cc53b27ad9fee36f 100644 GIT binary patch literal 3813 zcmaJ^3vg7`8NR2ReMih9*_dvIECkW13Nji6blL<anBlICHc1jzVTHDFA9j(k%N*n2S&bc?aX|0>t z&3FFuzaQt^OV7}bJY7t6!^pcm%A6PIz7>=JDGOZ_zrQPJ>UDY}&^1M>=u?{7qmU;H zTIsem!}rrO8LH%IC#}oVMO2y6C^3u{*G%i+?!>Y=^ z1Y*;2s zi>hOhoJN&q8Y;V)mgY1ij+<$6x*>N0a*E?S-CRyrG*fs+wiS1lNzUvZwaF;*S|P3t zFUcM7(lNR3WKVI#AvvLUr<~VE%JoaZm-lrH&y~OQ8?O(yQbm*=-0nY>8q)vVfTs)Fa>&ssPYyezk zFPQ^|2@c0Mt_O9#uO@cs+<(L8*Rj=i=Ri4b6^h|xpnEY!wA^RK6MEc_OxC5#bQKwQp3*9zi4IZ?x$cI4c~Mn0;9 zW4#h`&k8=iIin=t)zukum%-HpP98f z#aAy+d-72du{A-7*bio{&PsV1l&_lyJL7sBhuO@Ed&w^%2zC%_g7MWV9oIpw=X06k^qmZnUq@ItkIL3xCThvM z0k@dKFOC1lML%v6$SsGOo*_^lfG`u7mKXG z9c<)nnzhP=q`>;Tr-5d1hi5Hv163;gdM6dPlAjI`cbnz#97O&m`OWr<%Gujz8IF4K zvuKlJmSJu~L93{0Rjo?5jht?y65=6&MQJCFh$&r2+Jv8O7Q8L@WC9Mn|W zQ6@;4}fyzY?kMt|K+Lz7+{bEVVM@$qzbe%j$rlU+g@v!=4-i(+16tJ4nAm6YP&taB~-wlDea^tAER1ZT*LuYQilTHo~F9?1?v z7g;#D?6n3ZrqO~k!Ak3_9*5x$D_vDJ$HKcAtM8qDHFNS*zL_~w+DMsL;t9pTi$=Xs zapfJ-lGzQ}}RyZ~x|dw%oCBZuVD&;|`*BkF0y#MlL z>!0uZV03x2*1V{9%Y7S5H!HD=m1~FA_ixFT?i&~yWTl}jaQ~*w8~Zl(4Gi`5X8Q-S L18k`O!M^_hv|cOa literal 4339 zcmai1dvH|M8Q;^*z8}qEvVfaumWQ+*i%@m3h}t0N*ka}GHrdr)buQ!7%+p9Xpj_8tCtwbMNj(YrC7f z`JHpV^S!_CoJ&vBt^%DyHC-<_y}s6?boW9^fP6C@1HXSSs>-!mJJ9?R^=T8T((5C8 zi)#6f+lC&Zr!&-7po?isfzGDB36&CE?{JK?2KwF-eZojr6_sXHz+2bF{PB{Z_fSGW@*)&g z6#f)dJx>X~T^YYFSf4L};5?q|iYm-#)$tRtx-s#MqH5vaCa96sXs4NiC2d%}4a!)M zOy-po+a!6F`leHV#mRI`Pg7z$nW=UU_8rGQpY16ZF z6>PQgu0>D0065p9dU*ZUZ-8YFfx*y*fBXS(nF~Rc0^G3T5Nz<9fcDFm|6bUjm1}SJ zf@8xR&IVNPgX)o4U01nO>tDU!5sHe$mmbB^FF^HR@1xuwF98nt=ll@xb`F2F?*l;Y z#x=W*FS`V5zwn#S177rWo)`M+eJS>t8mN};8@m^9KH&0|ubu^rx)2+_2Usr5_#9Mt z7I4MztnHZH3wXb^{9V9$G&mcK*I?q(A;7=75H_3voR&@?$imMv=kB*8efZ9$aRHrHm=c;d!Km@kmpKj?kyF- zTV1MNvc(cZtxPVx@(iE~qQK_EHXsjo;B~+1!XQii5pV>v!HJW8z+EL2EG%RGyO_Uw z0c~NyFQUc*XaGJ;4lsYem|Vsu_oKSI@=kj@FL1)KR`oj{3Oc^nU=k|u(GOVQh}gpX zk5wHOI>{#wxhz8;h$YdOc4z!fH7&S;w3$(O#-tHf!+*Z6$$#DPeDjXT6_Z9x?w3YM z-kyn(Hzg%Ey|Oj~_#yMn(VE zBAlTa#3&$L@sl-3!D;Y;C)L_B3 zqB>d=$0W4#DDIIIdQRl$>5PB6p5_df%K7H=yXn-2jt&lK{_WyttzooIg}D7CJS_My zcSOOFY2RrO+KB`1lhh|beZr%5H8*IdNv5#iKPRarWVEwTqJ&56U?JQUBxh783qFUl zUoTiRYgPzJfi&kbpjq48xpapo*N}@W zw8b_mkoHzlttv`QsflZhPtR)>!X@q|Ec9XtHyNAgBwsNJqDNQ=X{HFDLpg*L{@`Y& zZGsz(Qo{pRWsyog_?=6)SZF7v>QM^&r2qZ!}pr zT2#kqcGMXqxluR%8kke7!c7lTNo(e6Fx_gHuHkyd!jF5LHV>N{rR}2%?Wz!XN>c20 zm1E)k6=S&BJxYyR0a+T=>|r77s3f)~IXL{5C*-|h!xb{7C@g#t_dqa2=GGJziF2`H zRK@6WO5Ks8)V5W}5D!iqrEmrqdd`UKmlR5KuE5uBrErf%j+gL=ELLbBgOucz!egh&fJ8pq6-Zcc>#UPtqvMM?q`r)xRUC`*=$0Y zs9XQGO;i&XSQdS)q~&bfo>_D~XQof66{0=qN6wN>mtl6RJIkUwSa77MZZt?vFKoi^ zu-NsJ`uZ=oj__&}<)3;bd2K1$sQ*io`jPOHEZNvJ zX)KG)kU7pPS8K{&u1@SmNo1i3>7;TQi`^k7v>c1wU3U?G{Se+Uh)En1-r2~#6C0Am zHH*|#!-9KayGmxxDDVl~>m3%;(1f>r%!+y$#twQazSL0hQ<_Vo+GAe)dDrH}+hlY+ z;c|?pO}7$0X>|N*NmMsFzC=#I=y?AB8696Ei6TO}58*pKtV>_+GiMQ8PRM zakN8m?}{I(_f8x_qQ{mm;UmHuf7?~CxvhH1kRWo=J)_*FoN)7>C1zO$Dw;RtG2Y(X zF5p&j!o90b)+*8MYL%ePTCv1x-T{SUMO%>ly&lhmSO1AIFP_a?xHB59E-~)OIBbhB zjw&p1Of)neR5aTz(KjepNO}MrEtf-m RefungibleHandle { /// should be obtained with `nextTokenId` method /// @param to The new owner /// @param tokenIds IDs of the minted RFTs - // #[solidity(hide)] + #[solidity(hide)] #[weight(>::create_multiple_items(token_ids.len() as u32))] fn mint_bulk(&mut self, caller: caller, to: address, token_ids: Vec) -> Result { let caller = T::CrossAccountId::from_eth(caller); @@ -748,7 +748,7 @@ impl RefungibleHandle { /// numbers and first number should be obtained with `nextTokenId` method /// @param to The new owner /// @param tokens array of pairs of token ID and token URI for minted tokens - #[solidity(/*hide,*/ rename_selector = "mintBulkWithTokenURI")] + #[solidity(hide, rename_selector = "mintBulkWithTokenURI")] #[weight(>::create_multiple_items(tokens.len() as u32))] fn mint_bulk_with_token_uri( &mut self, diff --git a/pallets/refungible/src/stubs/UniqueRefungible.raw b/pallets/refungible/src/stubs/UniqueRefungible.raw index db7f13e84a9d1152c4927eeb6e1f25ae626d4742..c0925d1e31a490fcb6e30758abad16038ad2aeb3 100644 GIT binary patch literal 3840 zcmaJ^4U8059iQjkelPU)a<_2q#oOLB_)!ap9+md2OAQq%wzFGqw`BZy@Aj^64P5DQ zQt3&VnVs2#Ha4@n*DDRA0W?L@#8AWtY8o3-uSV3gSlXz3#8xS(Ce>O(iO2bS@6GJZ zY3*Ki@AuyOe}B9WdVyy1bP?4JBk%Mp^Z!8iub>1->2gf`{;8m;pVQlbmKLd^Pitzw zLVi%tN_VXudyrm8QzcJV(xyDUfhyA)C5F-Am?<6f{YARdOjT8lX3Sz>L3)eCV_0j5c8*trqM?U0m<_) zSXKGApcy$z@Rv;o3?ceT5d>H8y}6*ljb;NsQEMG0zFN>M{M!vPGCJ)nC*eseR#(Fq z3!2H2qH32(PNPaY4OEq1n?ajLAK%DdO7 zj=Ui;OlfxWLYtO1v%n&Zdgz4?y>$QQSN<`{$nm0HdgArHD*>ATe|N+5<|I=N0-hh) zaVy|=T-eH*4g+4YFTL2xg1vy3kDWgTxCZd*^w{kn=##pn7%VNu(&;<SFBYs_kWwmV=v%vVA1ygyE**D;eP<~ zFmBmze#Rvj`NYYO1HS5sSrY!@eM$C_hd{OJg@;VQrGWH6Y6LLmLNIWrO8M(Q1`~LI z2FAN5F}o9RgLU^`0UPFXF&KXtOLyP%=S5-(aMP)afF-|PjKiQ>GWxakfNg-i>ZOMP zx%n&0UtbG&BjD}U;`z|~K8KT=Hez;#CnmD6<=-&$O)M?QpBV#u-i2V80$iAyhfIoK zcHQ*kRlv6~+kJe5&%W;$gE99k`i(VD)8H!s&4nSBd>L>HW<%5G0)USc(UsV;Sl~7mSh1WovEV<^NWpwTQ!sfC3*5yg zL#=#r8(KJ2~ADwMj@{t>s5Ym^+( z$NX#2lm0bH=|wSm&QBS;!#|3L{Cq-6({n6%gvUeAnQ}u$NJKzt*imZ+sX4Vgabr_q zO>c;#@F4RD&l(?ReB@@@l{Vr||RS|54EoTZH?%Nz6P-5fU4PHnG+Km(hhUUq6 z|3U0KzOy-;!i09>1R@(|+>eno&E^Hrx}%6M3*E-!k#|ipaafWT7Mk?*`Pjg61T04c z3k#j}WTU@WXdRAcBX7}6xk5-1q_4XYXa>i7rc7?8N|m4dr0P`j4F_@Tm2Dn_a75CZ zJyn&H_smfocKv7JWwu#?I=i4%Rkfzp#8pEva=L{~i2DNzxG!V60AZ%!Y?7Q39W zTN>Hnec+F|8@JeckF>w+CJJ}q|Ea2&F3F4v?%x&J{jmvmu1EAt?3p5qJtMkar@=H5 z9{Y(^M#N>$SJ5V`L!6I zMkhBqC*CgQ`0~yhIPSh%SiHBf6JWO#TSkfRa3YoQf@IeHn}oNS#KuxNM1tS73e?UnwR& z=}|8GZ%SEV$Zi=sm$lBI#56jvCzMkUS^OYG zdUxaG!`rP)p5(8$iKq7PK#EV{+QEULE%$A`x2q+Sy>9jL?)Q%N#`bnC{KA?L8DIU* z(y!E36{n)#UpuwTIy12KflZ|^DUs`x&yH>!+L|dnFg!ZKN~0Ozq0L)14Q?JB9vvLW O3=L<7+33)=!T$gsB;uXf1tC&{w1TuTX>i++YFiAU#g^JADbUyoF{MC=ZKw^Uv;=UjT0wr1%xs_A;x>F_mPpnLA21jskpG4TFlPF3#Knt^8KsZSeGl@1?y zEvFV9eW-seJ)5GwES*p5vUDo-ji{99`UJ;FYM}4P(`SujNl|IqXw?0fG4r*%CRcVT zB}d7rbfS^qa!x@Gl%Z)oO()uf)=$t0O&1&a+QGb{fl$mE1iW=!%%8{`dOIZqBtM73 zio&0qs<%;sUu(**3)WZjAh?QWc20#EjXGW-YcVDs$*C6p+X6Mx8l7k+V98jlJ_Kbf zNG2_L#WqQsN`2$0zv!eUj89TxJE?JYJNBKxKA-I=J-(PMsfN&uY|L*ik~X7#$Rb1V zYl%1(v?NQQrEPHC$I6Jczxz#W_#5C4*I)Z3;5&fF`g4B*L9e%$>+G`K znfTGK1Y51JYtFMj1>@mIy z_%UGb9Y>}^h3TH6JQ^A9u7w`yRAv@_d*NvS6Q+8nXJ&z-2gYi~SJ@EF^2H-Bv=CO~a0an5} zSGo8dNEpBphgjm4%{RaGFyI=%1=fr>U<-#kRz3;1$&}A^su+lka@-8sH?%PC3-eXIpC7xR!>N z?SDf=M=K=me4q%(T&fPT%@RYcKyJLVA8tELz6`_oMvkzn@cmnB2nrmY7`5Cy$}d%QS%)hpN)F3<3Qi2!i#*RWp8 zN1nNYbye)^qbRxZJbHqaRNfoK1Q#!e@u{5hlne;Yp0QV2{PVfDX2)Z>qe zIP*-wk?G?n)E80F|FsD7HG>#gq$^%&gJhj5ABb{rd~l&$o|e&&q+?lNo-7i1a4tGRWyxVa86FL!R-)E_>fclC@?P_k&i6&`c4L6TcOUP(u4R_@6 zh#jn9j>j1l$^!4=TA*hwnl_7sBtWXT3}_nHinK{)Q(uYSI7rDUWh-vLackP#Qw^G= zH!>xKlS_Aaa=$AVS;GO_C_>uxoLW+pvQic|9G~8%SqPW7wy=gj>MQ=h7|K@CK$TQ3~EB6;Lw5O`6nh4?Hho z;WO{f+V&^IXHOT6%q;$7_N{Z zMPZ@wxFUifGPjJ;bS_qmN*HA*bw`d;-d-9)JX~p>WubPD?J`SvfiqdjGeV3I=~kGF z-TWu_y6F&lLGCmvY6??B`#gpRi>7NSoB@WOGeXBCg;JX<@U>eh+@qnt=JALuR%m?+ zDak8^$4-+02}fNi;bu>5Twfu><05nke@#;914yC)o=;6I{GdCRVd14Lyx3r&-=lB2 z)j{i#`zd4>ZmT+Ro-?6L*sXutCaQ_MEel`DYZ)6CYZe~j%=8hpNVMnu$XT*w3}%1e z&a&`97TA|lHyb3QXSd)zAa?z_vVQu7t-KmVxfokXRe=r+Kc=$%>OEt zPNy)vScH7Nn=@LuFP>>xmr#Ba&;n0B$0(Cq?6(p7U`A~T82fQuDFPQ znF#L~#3YUh?`-DYiR_TXWs8(m!-9Jv!+A4fWcdWH{0@t}geJWGQ&v>UFmlpU@k~|4 zFK8~+YL9yH=Utl@FE_ecLeVd~Orv+(VtG(u(FLMVI5CR2RpcY3H7Ub=5$*Ig_Ef5j z_n+F@aq~aw=0A(>G~I&xtZ$>kl3&HQ(W7z#zKx#vf4+_WT@sJ-EsF(Z%GbC!`p;3N z8T*plS1nC$TdY;ive?6w7LBt`wDQ6Y{D~}zEq4{H?cQF_#Z0;A9))i2k9qws_Nrx| zaq!+h#Ji~5Y+Q%M4u7szUi@Pp)oR6JmwBTVjuqWU9wU{siN{=H;z=)UYPZzXKzz1G z+4^ZpnK+1=iF3tTtW#p>6VS5Fq{iYs_=-1^Wkt13e8jW(^ObLSJ4@v!ygi~06p4w# zNE01jq;V8JzMfh9aGu34AtX2OL2P8L=4Lc8gX~b`tZysd;iPdK7I{C3pUdluEq;ly ziL(W_mg70qB&d8<8QQf|77lmj^}U_lJ{`{ey05D< O-Mu=!n)P+B@A@w}imhn? diff --git a/pallets/refungible/src/stubs/UniqueRefungible.sol b/pallets/refungible/src/stubs/UniqueRefungible.sol index 754a2b7474..7471a4c9f5 100644 --- a/pallets/refungible/src/stubs/UniqueRefungible.sol +++ b/pallets/refungible/src/stubs/UniqueRefungible.sol @@ -586,35 +586,35 @@ contract ERC721UniqueExtensions is Dummy, ERC165 { return 0; } - /// @notice Function to mint multiple tokens. - /// @dev `tokenIds` should be an array of consecutive numbers and first number - /// should be obtained with `nextTokenId` method - /// @param to The new owner - /// @param tokenIds IDs of the minted RFTs - /// @dev EVM selector for this function is: 0x44a9945e, - /// or in textual repr: mintBulk(address,uint256[]) - function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) { - require(false, stub_error); - to; - tokenIds; - dummy = 0; - return false; - } + // /// @notice Function to mint multiple tokens. + // /// @dev `tokenIds` should be an array of consecutive numbers and first number + // /// should be obtained with `nextTokenId` method + // /// @param to The new owner + // /// @param tokenIds IDs of the minted RFTs + // /// @dev EVM selector for this function is: 0x44a9945e, + // /// or in textual repr: mintBulk(address,uint256[]) + // function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) { + // require(false, stub_error); + // to; + // tokenIds; + // dummy = 0; + // return false; + // } - /// @notice Function to mint multiple tokens with the given tokenUris. - /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive - /// numbers and first number should be obtained with `nextTokenId` method - /// @param to The new owner - /// @param tokens array of pairs of token ID and token URI for minted tokens - /// @dev EVM selector for this function is: 0x36543006, - /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) - function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) public returns (bool) { - require(false, stub_error); - to; - tokens; - dummy = 0; - return false; - } + // /// @notice Function to mint multiple tokens with the given tokenUris. + // /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive + // /// numbers and first number should be obtained with `nextTokenId` method + // /// @param to The new owner + // /// @param tokens array of pairs of token ID and token URI for minted tokens + // /// @dev EVM selector for this function is: 0x36543006, + // /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[]) + // function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) public returns (bool) { + // require(false, stub_error); + // to; + // tokens; + // dummy = 0; + // return false; + // } /// Returns EVM address for refungible token /// diff --git a/pallets/refungible/src/stubs/UniqueRefungibleToken.raw b/pallets/refungible/src/stubs/UniqueRefungibleToken.raw index 47db4b89fb7a58e39c74f00ed969f60f29088251..a0b8de43a9d99582ea3bc81185c27f6a26d3e8f8 100644 GIT binary patch delta 463 zcmYjKO-S5O5YFT!P*8E#nw7=H4Ry7aBA!(6wCd5zGiahd3iD8eQbCLLDEgADKP*T# zZ}A5`>A_o}co7j4dKUEN(UYe_LFmn0P1J?Xz%cX8_fxLluTS6|<}K{RRUxc^>;HZw zJOKNo48s7&@>Xq!8~Lbyga(---Hlx~<1oaPN*`*R3`!&!_#u}`M>LNJ=7dNZTwQWd z!MwK)U@?kWz-&4d1|eV`WJsl{HFq9Hl+_9=1=MEI7O@MYDUzPO;#~dhakVI?w6^j4 z8uZtXAe)7hs}(d0@N$(X=6&c5Xc%{FhNkPsUL;!+_P8(9|6T*~N=s+P-U#GN9A>i; z<>VWhe(Wq&J(t{eaK%f7loh;$Ae@}Ye!YF=+CdP_oZLHHOGb%L>9v$=`G$dds|(xo z6;+DDLNhQ?VQV5`aIMY}W4;SkP=H_)IC-#{2RoE9THf2GwX&;+GhY{G7biY6nP=hF uNb&NsSpK`L`AfIQY@`DrG5u-@B=zXQ3n_C86+99+=m?%L1(e~Rf>aYpSTo6 z&_#3+C&5h|ba2+iI*A~-6kJp^wYtcK%jKMN&pE}0orVxTVoJjv%vhG@Gx_y2dY3BWa3ocAK9%)gScvi)kc;PV7 Date: Wed, 19 Oct 2022 10:35:29 +0000 Subject: [PATCH 1204/1274] build: bump spec_version to v929031 --- runtime/opal/src/lib.rs | 2 +- runtime/quartz/src/lib.rs | 2 +- runtime/unique/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index d237eb6eaa..c48cb034b9 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -50,7 +50,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 929030, + spec_version: 929031, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index c9e67a7cdf..3fa1da4544 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -50,7 +50,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 929030, + spec_version: 929031, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index c9a28d8d3d..6cb7a6ce1c 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -50,7 +50,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 929030, + spec_version: 929031, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, From 1889107dcf3d84ea0bf57a0a2d0a19b2d5aaae4f Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 14:32:04 +0300 Subject: [PATCH 1205/1274] Update ci-master.yml --- .github/workflows/ci-master.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index ce13aea4c2..ede417e011 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -1,3 +1,4 @@ +# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2587656193/CI+Master # Workflow which controls starts nested workflows. name: master From 0590524f57619d1bfe646bd1ece35ac07c03cc7c Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 14:32:39 +0300 Subject: [PATCH 1206/1274] Update ci-develop.yml --- .github/workflows/ci-develop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index 8dae35471f..f1f090c0b5 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -1,3 +1,4 @@ +# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586869783/CI+Develop # Workflow which controls starts nested workflows. name: develop From d00cfc7e15f69b7d22fa8b27ae788aae9fa62e9c Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 14:51:40 +0300 Subject: [PATCH 1207/1274] Update forkless-update-data_v2.yml --- .github/workflows/forkless-update-data_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-data_v2.yml b/.github/workflows/forkless-update-data_v2.yml index 2bf3a7c254..17f587db8a 100644 --- a/.github/workflows/forkless-update-data_v2.yml +++ b/.github/workflows/forkless-update-data_v2.yml @@ -1,5 +1,5 @@ # Forkless update with data replication -# https://cryptousetech.atlassian.net/browse/CI-42 +# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586869792/Forkless+update+with+data # Triger: only call from main workflow(re-usable workflows) on: From da7eb7164b8170f0925983c71ee4a7a16d421880 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 14:54:51 +0300 Subject: [PATCH 1208/1274] Update forkless-update-nodata_v2.yml --- .github/workflows/forkless-update-nodata_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/forkless-update-nodata_v2.yml b/.github/workflows/forkless-update-nodata_v2.yml index d74c4f2d84..914471bcef 100644 --- a/.github/workflows/forkless-update-nodata_v2.yml +++ b/.github/workflows/forkless-update-nodata_v2.yml @@ -1,5 +1,5 @@ +# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586837021/Forkless+update+without+data # Forkless update without data replication -# https://cryptousetech.atlassian.net/browse/CI-41 # Triger: only call from main workflow(re-usable workflows) on: From ddd0063a18f744ba2911d64652751dc9bdc27c13 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 14:55:22 +0300 Subject: [PATCH 1209/1274] Update market-test_v2.yml --- .github/workflows/market-test_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index 382961f256..789e365ddf 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -1,4 +1,4 @@ -#https://cryptousetech.atlassian.net/browse/CI-37 +# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586509375/Market+e2e+test # Nested workflow for lunching Market e2e tests from external repository https://github.com/UniqueNetwork/market-e2e-tests name: market api tests From 1ddbdca943fb1280d8df4407c0fa41dadf2a39e1 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 14:58:01 +0300 Subject: [PATCH 1210/1274] Update codestyle_v2.yml --- .github/workflows/codestyle_v2.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codestyle_v2.yml b/.github/workflows/codestyle_v2.yml index 93a5438d00..19b3d227e0 100644 --- a/.github/workflows/codestyle_v2.yml +++ b/.github/workflows/codestyle_v2.yml @@ -1,3 +1,4 @@ +# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586837012/Code+style+testing # Nested workflow for checks related to formatting Rust code name: cargo fmt From 6f5274088ac4b2c58855d1e37cb38b6331385a8f Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 14:58:58 +0300 Subject: [PATCH 1211/1274] Update test_codestyle_v2.yml --- .github/workflows/test_codestyle_v2.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_codestyle_v2.yml b/.github/workflows/test_codestyle_v2.yml index 2d5ee97873..22bc9b7854 100644 --- a/.github/workflows/test_codestyle_v2.yml +++ b/.github/workflows/test_codestyle_v2.yml @@ -1,3 +1,4 @@ +# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586804253/Yarn+eslint # Yarn Eslint over tests # name: yarn eslint From 59a4694917f3b4e2924bb57173e4bf464fad2260 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 14:59:37 +0300 Subject: [PATCH 1212/1274] Update node-only-update_v2.yml --- .github/workflows/node-only-update_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 01ab548f58..01f94e0ab3 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -1,4 +1,4 @@ -# https://cryptousetech.atlassian.net/browse/CI-85 +# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586837028/Nodes+only+update # Node only update with restart polkadot-launch process. name: nodes-only update From 229420a9c3a2fb9634a2fe2d06e403ee530ef5e0 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 15:11:16 +0300 Subject: [PATCH 1213/1274] Update dev-build-tests_v2.yml --- .github/workflows/dev-build-tests_v2.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/dev-build-tests_v2.yml b/.github/workflows/dev-build-tests_v2.yml index c102d7cd83..1f5c18dba8 100644 --- a/.github/workflows/dev-build-tests_v2.yml +++ b/.github/workflows/dev-build-tests_v2.yml @@ -1,5 +1,5 @@ # Integration test in --dev mode -# https://cryptousetech.atlassian.net/browse/CI-12 +# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586411104/Integration+tests name: yarn test dev # Triger: only call from main workflow(re-usable workflows) @@ -7,10 +7,6 @@ on: workflow_call: -#Define Workflow variables -env: - REPO_URL: ${{ github.server_url }}/${{ github.repository }} - # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: From ba47a5f085085f041e9c406a18681d4d8ae16b94 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 15:17:20 +0300 Subject: [PATCH 1214/1274] Update unit-test_v2.yml --- .github/workflows/unit-test_v2.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit-test_v2.yml b/.github/workflows/unit-test_v2.yml index 191cee5d89..8b2aad4ca5 100644 --- a/.github/workflows/unit-test_v2.yml +++ b/.github/workflows/unit-test_v2.yml @@ -1,3 +1,4 @@ +# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586738699/Unit+Tests # Re-Usable Workflow for lanching Unit tests name: unit tests From 5815ea594662cb0ebe5710cf7e44caf60157695b Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 15:20:41 +0300 Subject: [PATCH 1215/1274] Update forkless-update-nodata_v2.yml --- .github/workflows/forkless-update-nodata_v2.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/forkless-update-nodata_v2.yml b/.github/workflows/forkless-update-nodata_v2.yml index 914471bcef..2c3fe93685 100644 --- a/.github/workflows/forkless-update-nodata_v2.yml +++ b/.github/workflows/forkless-update-nodata_v2.yml @@ -6,10 +6,6 @@ on: workflow_call: -#Define Workflow variables -env: - REPO_URL: ${{ github.server_url }}/${{ github.repository }} - # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: execution-marix: From 53dab706dcdcaf7b30705c905e2bbb6349330f28 Mon Sep 17 00:00:00 2001 From: Alex <12645087+lzadjsf@users.noreply.github.com> Date: Wed, 19 Oct 2022 15:22:36 +0300 Subject: [PATCH 1216/1274] Update try-runtime_v2.yml --- .github/workflows/try-runtime_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/try-runtime_v2.yml b/.github/workflows/try-runtime_v2.yml index 82cf085377..85b0ed4424 100644 --- a/.github/workflows/try-runtime_v2.yml +++ b/.github/workflows/try-runtime_v2.yml @@ -1,5 +1,5 @@ # Try-runtime checks -# https://cryptousetech.atlassian.net/browse/CI-38 +# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2587656213/Try+runtime # Triger: only call from main workflow(re-usable workflows) on: From e2c15fa0a5da624eafd6a997d28c4504ecc98097 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Oct 2022 09:52:22 +0000 Subject: [PATCH 1217/1274] test: skip refungible mintBulk Signed-off-by: Yaroslav Bolyukin --- tests/src/eth/reFungible.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 3ed4e3c7ba..ed6067bf6f 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -131,7 +131,7 @@ describe('Refungible: Plain calls', () => { expect(await contract.methods.tokenURI(tokenId).call()).to.be.equal('Test URI'); }); - itEth('Can perform mintBulk()', async ({helper}) => { + itEth.skip('Can perform mintBulk()', async ({helper}) => { const owner = await helper.eth.createAccountWithBalance(donor); const receiver = helper.eth.createAccount(); const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, 'MintBulky', '6', '6', ''); From abb171fa79dc0fd2b037270b627fd1a62cd35443 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 20 Oct 2022 17:37:24 +0700 Subject: [PATCH 1218/1274] change name for xcm jobs --- .github/workflows/xcm.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index ac77d00ad6..1129b4eaed 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -52,7 +52,7 @@ jobs: timeout-minutes: 600 - name: ${{ matrix.network }} + name: ${{ matrix.network }}-build continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. @@ -276,7 +276,7 @@ jobs: timeout-minutes: 600 - name: ${{ matrix.network }} + name: ${{ matrix.network }}-tests continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. From 418c48a0f82834aad330f6324ad3a87a6e47c4b3 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 20 Oct 2022 17:39:10 +0700 Subject: [PATCH 1219/1274] change mainnet branch --- .env | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 3b592e7b72..a90b1c3d83 100644 --- a/.env +++ b/.env @@ -5,18 +5,18 @@ POLKADOT_MAINNET_BRANCH=release-v0.9.28 STATEMINT_BUILD_BRANCH=release-parachains-v9271 ACALA_BUILD_BRANCH=2.9.6 MOONBEAM_BUILD_BRANCH=v0.26.1 -UNIQUE_MAINNET_TAG=v924010 +UNIQUE_MAINNET_TAG=v924010-old-tests-fixes UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443 KUSAMA_MAINNET_BRANCH=release-v0.9.29 STATEMINE_BUILD_BRANCH=parachains-v9271 KARURA_BUILD_BRANCH=release-karura-2.9.5 MOONRIVER_BUILD_BRANCH=v0.26.1 -QUARTZ_MAINNET_TAG=quartz-v924012-2 +QUARTZ_MAINNET_TAG=quartz-v924012-2-old-tests-fixes QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 UNQWND_MAINNET_BRANCH=release-v0.9.30 WESTMINT_BUILD_BRANCH=parachains-v9290 -OPAL_MAINNET_TAG=quartz-v924012-2-opal-runtime-feature +OPAL_MAINNET_TAG=quartz-v924012-2-old-tests-fixes OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443 POLKADOT_LAUNCH_BRANCH=unique-network From 44caa591c6e9fa799eb157a70f26f33351853b70 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 20 Oct 2022 17:51:47 +0700 Subject: [PATCH 1220/1274] change jobs name for forkless --- .github/workflows/forkless-update-data_v2.yml | 4 ++-- .github/workflows/forkless-update-nodata_v2.yml | 2 +- .github/workflows/try-runtime_v2.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/forkless-update-data_v2.yml b/.github/workflows/forkless-update-data_v2.yml index 2bf3a7c254..ca802102b3 100644 --- a/.github/workflows/forkless-update-data_v2.yml +++ b/.github/workflows/forkless-update-data_v2.yml @@ -11,7 +11,7 @@ jobs: execution-marix: - name: execution matrix + name: Prepare execution matrix runs-on: self-hosted-ci outputs: @@ -45,7 +45,7 @@ jobs: runs-on: [self-hosted-ci,large] timeout-minutes: 1380 - name: ${{ matrix.network }} + name: ${{ matrix.network }}-data strategy: matrix: include: ${{fromJson(needs.execution-marix.outputs.matrix)}} diff --git a/.github/workflows/forkless-update-nodata_v2.yml b/.github/workflows/forkless-update-nodata_v2.yml index d74c4f2d84..b6272f8993 100644 --- a/.github/workflows/forkless-update-nodata_v2.yml +++ b/.github/workflows/forkless-update-nodata_v2.yml @@ -50,7 +50,7 @@ jobs: timeout-minutes: 1380 - name: ${{ matrix.network }} + name: ${{ matrix.network }}-nodata continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. diff --git a/.github/workflows/try-runtime_v2.yml b/.github/workflows/try-runtime_v2.yml index 82cf085377..dfa3ff8ac9 100644 --- a/.github/workflows/try-runtime_v2.yml +++ b/.github/workflows/try-runtime_v2.yml @@ -11,7 +11,7 @@ jobs: # The type of runner that the job will run on runs-on: self-hosted-ci - name: ${{ matrix.network }} + name: ${{ matrix.network }}-try-runtime continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. From fc9c3458db70f341a2a5ba95429f55bc6c67a245 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 20 Oct 2022 18:33:27 +0700 Subject: [PATCH 1221/1274] update xom9ikk@dotenv to v2 --- .github/workflows/dev-build-tests_v2.yml | 2 +- .github/workflows/execution-matrix.yml | 2 +- .github/workflows/forkless-update-data_v2.yml | 4 ++-- .github/workflows/forkless-update-nodata_v2.yml | 4 ++-- .github/workflows/generate-execution-matrix.yml | 2 +- .github/workflows/market-test_v2.yml | 4 ++-- .github/workflows/node-only-update_v2.yml | 4 ++-- .github/workflows/testnet-build.yml | 4 ++-- .github/workflows/try-runtime_v2.yml | 2 +- .github/workflows/unit-test_v2.yml | 2 +- .github/workflows/xcm.yml | 6 +++--- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/dev-build-tests_v2.yml b/.github/workflows/dev-build-tests_v2.yml index 02a0859d93..7870747c83 100644 --- a/.github/workflows/dev-build-tests_v2.yml +++ b/.github/workflows/dev-build-tests_v2.yml @@ -44,7 +44,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 diff --git a/.github/workflows/execution-matrix.yml b/.github/workflows/execution-matrix.yml index d4c84df10d..8a737bc3e9 100644 --- a/.github/workflows/execution-matrix.yml +++ b/.github/workflows/execution-matrix.yml @@ -29,7 +29,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Create Execution matrix uses: CertainLach/create-matrix-action@v3 diff --git a/.github/workflows/forkless-update-data_v2.yml b/.github/workflows/forkless-update-data_v2.yml index f096e8c8d8..80e04d72a0 100644 --- a/.github/workflows/forkless-update-data_v2.yml +++ b/.github/workflows/forkless-update-data_v2.yml @@ -29,7 +29,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Create Execution matrix uses: CertainLach/create-matrix-action@v3 @@ -64,7 +64,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 diff --git a/.github/workflows/forkless-update-nodata_v2.yml b/.github/workflows/forkless-update-nodata_v2.yml index b0d7298559..737f92e7e1 100644 --- a/.github/workflows/forkless-update-nodata_v2.yml +++ b/.github/workflows/forkless-update-nodata_v2.yml @@ -30,7 +30,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Create Execution matrix uses: fabiocaccamo/create-matrix-action@v2 @@ -67,7 +67,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 diff --git a/.github/workflows/generate-execution-matrix.yml b/.github/workflows/generate-execution-matrix.yml index 48d7ae8e6f..b752472afe 100644 --- a/.github/workflows/generate-execution-matrix.yml +++ b/.github/workflows/generate-execution-matrix.yml @@ -33,7 +33,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Create Execution matrix uses: CertainLach/create-matrix-action@v3 diff --git a/.github/workflows/market-test_v2.yml b/.github/workflows/market-test_v2.yml index a81c7d0365..6fe066f1d9 100644 --- a/.github/workflows/market-test_v2.yml +++ b/.github/workflows/market-test_v2.yml @@ -48,7 +48,7 @@ jobs: ref: 'master' - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Copy qa-tests/.env.example to qa-tests/.env working-directory: qa-tests @@ -138,7 +138,7 @@ jobs: run: cat .env - name: Read qa -test .env file Before market start - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 with: path: qa-tests/ diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 5c46d0641f..6508c78a68 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -29,7 +29,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Create Execution matrix uses: fabiocaccamo/create-matrix-action@v2 @@ -70,7 +70,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 diff --git a/.github/workflows/testnet-build.yml b/.github/workflows/testnet-build.yml index 7ffd44f64f..41a382efad 100644 --- a/.github/workflows/testnet-build.yml +++ b/.github/workflows/testnet-build.yml @@ -45,7 +45,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Create Execution matrix uses: fabiocaccamo/create-matrix-action@v2 @@ -85,7 +85,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 diff --git a/.github/workflows/try-runtime_v2.yml b/.github/workflows/try-runtime_v2.yml index b50a2505b3..617d1e128f 100644 --- a/.github/workflows/try-runtime_v2.yml +++ b/.github/workflows/try-runtime_v2.yml @@ -35,7 +35,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 diff --git a/.github/workflows/unit-test_v2.yml b/.github/workflows/unit-test_v2.yml index 7a586d10e1..ce7c9266cb 100644 --- a/.github/workflows/unit-test_v2.yml +++ b/.github/workflows/unit-test_v2.yml @@ -29,7 +29,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index ac77d00ad6..3d0ba76d30 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -33,7 +33,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Create Execution matrix uses: fabiocaccamo/create-matrix-action@v2 @@ -74,7 +74,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Log in to Docker Hub uses: docker/login-action@v2.0.0 @@ -298,7 +298,7 @@ jobs: ref: ${{ github.head_ref }} #Checking out head commit - name: Read .env file - uses: xom9ikk/dotenv@v1.0.2 + uses: xom9ikk/dotenv@v2 - name: Generate ENV related extend file for docker-compose uses: cuchi/jinja2-action@v1.2.0 From 320ccba8654a2080f1a8318c2cb09a8d42ddc069 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Oct 2022 11:54:09 +0000 Subject: [PATCH 1222/1274] test: upgrade polkadot.js Signed-off-by: Yaroslav Bolyukin --- tests/package.json | 50 +-- tests/yarn.lock | 842 +++++++++++++++++++++------------------------ 2 files changed, 413 insertions(+), 479 deletions(-) diff --git a/tests/package.json b/tests/package.json index 51b9815e7a..271b96e1c8 100644 --- a/tests/package.json +++ b/tests/package.json @@ -4,30 +4,30 @@ "description": "Unique Chain Tests", "main": "", "devDependencies": { - "@polkadot/ts": "0.4.22", - "@polkadot/typegen": "9.5.1", - "@types/chai": "^4.3.1", + "@polkadot/typegen": "9.5.2", + "@types/chai": "^4.3.3", "@types/chai-as-promised": "^7.1.5", "@types/chai-like": "^1.1.1", "@types/mocha": "^10.0.0", - "@types/node": "^17.0.35", - "@typescript-eslint/eslint-plugin": "^5.26.0", - "@typescript-eslint/parser": "^5.26.0", + "@types/node": "^18.11.2", + "@typescript-eslint/eslint-plugin": "^5.40.1", + "@typescript-eslint/parser": "^5.40.1", "chai": "^4.3.6", - "eslint": "^8.16.0", - "mocha": "^10.0.0", - "ts-node": "^10.8.0", - "typescript": "^4.7.2" + "eslint": "^8.25.0", + "mocha": "^10.1.0", + "ts-node": "^10.9.1", + "typescript": "^4.8.4" }, "mocha": { "timeout": 9999999, - "require": ["ts-node/register"] + "require": [ + "ts-node/register" + ] }, "scripts": { "lint": "eslint --ext .ts,.js src/", "fix": "eslint --ext .ts,.js src/ --fix", "setup": "ts-node ./src/util/globalSetup.ts", - "test": "yarn setup && mocha --timeout 9999999 -r ts-node/register './src/**/*.*test.ts'", "testParallelFull": "yarn testParallel && yarn testSequential", "testParallel": "yarn setup && mocha --parallel --timeout 9999999 -r ts-node/register './src/**/*.test.ts'", @@ -39,7 +39,6 @@ "testEthMarketplace": "yarn setup && mocha --timeout 9999999 -r ts-node/register './**/eth/marketplace/**/*.*test.ts'", "testEvent": "yarn setup && mocha --timeout 9999999 -r ts-node/register ./src/check-event/*.*test.ts", "testRmrk": "yarn setup && mocha --timeout 9999999 -r ts-node/register ./**/rmrk/*.*test.ts", - "testEthPayable": "mocha --timeout 9999999 -r ts-node/register './**/eth/payable.test.ts'", "testEthTokenProperties": "mocha --timeout 9999999 -r ts-node/register ./**/eth/tokenProperties.test.ts", "testEvmCoder": "mocha --timeout 9999999 -r ts-node/register './**/eth/evmCoder.test.ts'", @@ -94,17 +93,14 @@ "testEthFT": "mocha --timeout 9999999 -r ts-node/register ./**/eth/fungible.test.ts", "testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts", "testPromotion": "yarn setup && mocha --timeout 9999999 -r ts-node/register ./**/app-promotion.test.ts", - "testXcmUnique": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmUnique.test.ts", "testXcmQuartz": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmQuartz.test.ts", "testXcmOpal": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmOpal.test.ts", "testXcmTransferAcala": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferAcala.test.ts acalaId=2000 uniqueId=5000", "testXcmTransferStatemine": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferStatemine.test.ts statemineId=1000 uniqueId=5000", "testXcmTransferMoonbeam": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferMoonbeam.test.ts", - "load": "mocha --timeout 9999999 -r ts-node/register './**/*.load.ts'", "loadTransfer": "ts-node src/transfer.nload.ts", - "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", "polkadot-types-from-defs": "ts-node ./node_modules/.bin/polkadot-types-from-defs --endpoint src/interfaces/metadata.json --input src/interfaces/ --package .", "polkadot-types-from-chain": "ts-node ./node_modules/.bin/polkadot-types-from-chain --endpoint src/interfaces/metadata.json --output src/interfaces/ --package .", @@ -114,28 +110,12 @@ "license": "SEE LICENSE IN ../LICENSE", "homepage": "", "dependencies": { - "@polkadot/api": "9.5.1", - "@polkadot/api-contract": "9.5.1", - "@polkadot/util-crypto": "10.1.10", - "bignumber.js": "^9.1.0", + "@polkadot/api": "9.5.2", + "@polkadot/util-crypto": "10.1.11", "chai-as-promised": "^7.1.1", "chai-like": "^1.1.1", "find-process": "^1.4.7", "solc": "0.8.17", - "web3": "^1.7.3" - }, - "standard": { - "globals": [ - "it", - "assert", - "beforeEach", - "afterEach", - "describe", - "contract", - "artifacts" - ] - }, - "resolutions": { - "simple-get": "^4.0.1" + "web3": "^1.8.0" } } diff --git a/tests/yarn.lock b/tests/yarn.lock index 865c2c5e09..a1bafaaf5e 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -23,30 +23,30 @@ integrity sha512-CHIGpJcUQ5lU9KrPHTjBMhVwQG6CQjxfg36fGXl3qk/Gik1WwWachaXFuo0uCWJT/mStOKtcbFJCaVLihC1CMw== "@babel/core@^7.19.3": - version "7.19.3" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.3.tgz#2519f62a51458f43b682d61583c3810e7dcee64c" - integrity sha512-WneDJxdsjEvyKtXKsaBGbDeiyOjR5vYq4HcShxnIbG0qixpoHjI3MqeZM9NDvsojNCEBItQE4juOo/bU6e72gQ== + version "7.19.6" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.6.tgz#7122ae4f5c5a37c0946c066149abd8e75f81540f" + integrity sha512-D2Ue4KHpc6Ys2+AxpIx1BZ8+UegLLLE2p3KJEuJRKmokHOtl49jQ5ny1773KsGLZs8MQvBidAF6yWUJxRqtKtg== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.19.3" + "@babel/generator" "^7.19.6" "@babel/helper-compilation-targets" "^7.19.3" - "@babel/helper-module-transforms" "^7.19.0" - "@babel/helpers" "^7.19.0" - "@babel/parser" "^7.19.3" + "@babel/helper-module-transforms" "^7.19.6" + "@babel/helpers" "^7.19.4" + "@babel/parser" "^7.19.6" "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.3" - "@babel/types" "^7.19.3" + "@babel/traverse" "^7.19.6" + "@babel/types" "^7.19.4" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.1" semver "^6.3.0" -"@babel/generator@^7.19.3", "@babel/generator@^7.19.4": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.4.tgz#60050cf3f0a593d7b2471b4be4f62a56b949237f" - integrity sha512-5T2lY5vXqS+5UEit/5TwcIUeCnwgCljcF8IQRT6XRQPBrvLeq5V8W+URv+GvwoF3FP8tkhp++evVyDzkDGzNmA== +"@babel/generator@^7.19.6": + version "7.19.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.6.tgz#9e481a3fe9ca6261c972645ae3904ec0f9b34a1d" + integrity sha512-oHGRUQeoX1QrKeJIKVe0hwjGqNnVYsM5Nep5zo0uE0m42sLH+Fsd2pStJ5sRM1bNyTUUoz0pe2lTeMJrb/taTA== dependencies: "@babel/types" "^7.19.4" "@jridgewell/gen-mapping" "^0.3.2" @@ -89,21 +89,21 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz#309b230f04e22c58c6a2c0c0c7e50b216d350c30" - integrity sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ== +"@babel/helper-module-transforms@^7.19.6": + version "7.19.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.19.6.tgz#6c52cc3ac63b70952d33ee987cbee1c9368b533f" + integrity sha512-fCmcfQo/KYr/VXXDIyd3CBGZ6AFhPFy1TfSEJ+PilGVlQT6jcbqtHAM4C1EciRqMza7/TpOUZliuSH+U6HAhJw== dependencies: "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.18.6" + "@babel/helper-simple-access" "^7.19.4" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.18.6" + "@babel/helper-validator-identifier" "^7.19.1" "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.0" - "@babel/types" "^7.19.0" + "@babel/traverse" "^7.19.6" + "@babel/types" "^7.19.4" -"@babel/helper-simple-access@^7.18.6": +"@babel/helper-simple-access@^7.19.4": version "7.19.4" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.19.4.tgz#be553f4951ac6352df2567f7daa19a0ee15668e7" integrity sha512-f9Xq6WqBFqaDfbCzn2w85hwklswz5qsKlh7f08w4Y9yhJHpnNC0QemtSkK5YyOY8kPGvyiwdzZksGUhnGdaUIg== @@ -132,7 +132,7 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== -"@babel/helpers@^7.19.0": +"@babel/helpers@^7.19.4": version "7.19.4" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.19.4.tgz#42154945f87b8148df7203a25c31ba9a73be46c5" integrity sha512-G+z3aOx2nfDHwX/kyVii5fJq+bgscg89/dJNWpYeKeBv3v9xX8EIabmx1k6u9LS04H7nROFVRVK+e3k0VHp+sw== @@ -150,10 +150,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.18.10", "@babel/parser@^7.19.3", "@babel/parser@^7.19.4": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.4.tgz#03c4339d2b8971eb3beca5252bafd9b9f79db3dc" - integrity sha512-qpVT7gtuOLjWeDTKLkJ6sryqLliBaFpAtGeqw5cs5giLldvh+Ch0plqnUMKoVAUS6ZEueQQiZV+p5pxtPitEsA== +"@babel/parser@^7.18.10", "@babel/parser@^7.19.6": + version "7.19.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.6.tgz#b923430cb94f58a7eae8facbffa9efd19130e7f8" + integrity sha512-h1IUp81s2JYJ3mRkdxJgs4UvmSsRvDrx5ICSJbPvtWYv5i1nTBGcBpnog+89rAFMwvvru6E5NUHdBe01UeSzYA== "@babel/register@^7.18.9": version "7.18.9" @@ -166,7 +166,7 @@ pirates "^4.0.5" source-map-support "^0.5.16" -"@babel/runtime@^7.18.9", "@babel/runtime@^7.19.0": +"@babel/runtime@^7.18.9", "@babel/runtime@^7.19.4": version "7.19.4" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.19.4.tgz#a42f814502ee467d55b38dd1c256f53a7b885c78" integrity sha512-EXpLCrk55f+cYqmHsSR+yD/0gAIMxxA9QK9lnQWzhMCvt+YmoBN7Zx94s++Kv0+unHk39vxNO8t+CMA2WSS3wA== @@ -182,23 +182,23 @@ "@babel/parser" "^7.18.10" "@babel/types" "^7.18.10" -"@babel/traverse@^7.19.0", "@babel/traverse@^7.19.3", "@babel/traverse@^7.19.4": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.4.tgz#f117820e18b1e59448a6c1fa9d0ff08f7ac459a8" - integrity sha512-w3K1i+V5u2aJUOXBFFC5pveFLmtq1s3qcdDNC2qRI6WPBQIDaKFqXxDEqDO/h1dQ3HjsZoZMyIy6jGLq0xtw+g== +"@babel/traverse@^7.19.4", "@babel/traverse@^7.19.6": + version "7.19.6" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.6.tgz#7b4c865611df6d99cb131eec2e8ac71656a490dc" + integrity sha512-6l5HrUCzFM04mfbG09AagtYyR2P0B71B1wN7PfSPiksDPz2k5H9CBC1tcZpz2M8OxbKTPccByoOJ22rUKbpmQQ== dependencies: "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.19.4" + "@babel/generator" "^7.19.6" "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-function-name" "^7.19.0" "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.19.4" + "@babel/parser" "^7.19.6" "@babel/types" "^7.19.4" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.19.3", "@babel/types@^7.19.4": +"@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.19.4": version "7.19.4" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.19.4.tgz#0dd5c91c573a202d600490a35b33246fed8a41c7" integrity sha512-M5LK7nAeS6+9j7hAq+b3fQs+pNfUtTGq+yFFfHnauFA8zQtLRfmuipmsKDKKLuyG+wC8ABW43A153YNawNTEtw== @@ -482,9 +482,9 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping@^0.3.9": - version "0.3.16" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.16.tgz#a7982f16c18cae02be36274365433e5b49d7b23f" - integrity sha512-LCQ+NeThyJ4k1W2d+vIKdxuSt9R3pQSZ4P92m7EakaYuXcVWbHuT5bjNcqLd4Rdgi6xYWYDvBJZJLZSLanjDcA== + version "0.3.17" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" + integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== dependencies: "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" @@ -520,263 +520,242 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@polkadot/api-augment@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-9.5.1.tgz#f4ae75837782dd09c2f7468f78c17626c359797d" - integrity sha512-9NQ2miIKVJvyhR2Zhk0XcHA+pgnWhQ0815lqcq0kz9ny5JHUFeGlNtxECw7AEnxoiC81EqpfWkOHpJpfiIcOmw== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/api-base" "9.5.1" - "@polkadot/rpc-augment" "9.5.1" - "@polkadot/types" "9.5.1" - "@polkadot/types-augment" "9.5.1" - "@polkadot/types-codec" "9.5.1" - "@polkadot/util" "^10.1.10" - -"@polkadot/api-base@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-9.5.1.tgz#f6084ebd21c4c43e3c11a7d638621d27162c5fcc" - integrity sha512-3qsMsIhYbU3zp+YnP5h6Hg98y3B+FrxgPW7r2Uk6Kp1uSPmIzhMCyGuxur/BAcDVbd3KME+zWLHJDYOdyhuUwQ== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/rpc-core" "9.5.1" - "@polkadot/types" "9.5.1" - "@polkadot/util" "^10.1.10" +"@polkadot/api-augment@9.5.2": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-9.5.2.tgz#55168dd112517028fea5f2ab9c54ea627e43ac3a" + integrity sha512-dH6QMY8Z3zI6CrgSU3eSe6f0KWDb5PYGztg/FXGPrjh7Vjic7syWZ1LD6zaHJAFWDp80BEdEXfqr4lConrCKGg== + dependencies: + "@babel/runtime" "^7.19.4" + "@polkadot/api-base" "9.5.2" + "@polkadot/rpc-augment" "9.5.2" + "@polkadot/types" "9.5.2" + "@polkadot/types-augment" "9.5.2" + "@polkadot/types-codec" "9.5.2" + "@polkadot/util" "^10.1.11" + +"@polkadot/api-base@9.5.2": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-9.5.2.tgz#ac0a6b5546a54bcc753ac55c9f033caa9f8b4e5c" + integrity sha512-BBsH9SLB1FHgjdiU32cZX1puL3Eh8IjOJHjRsO/5SdttciQhF5g/u/m/mM/55qnlXmffI9s2Jre18G0XtVU9Aw== + dependencies: + "@babel/runtime" "^7.19.4" + "@polkadot/rpc-core" "9.5.2" + "@polkadot/types" "9.5.2" + "@polkadot/util" "^10.1.11" rxjs "^7.5.7" -"@polkadot/api-contract@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/api-contract/-/api-contract-9.5.1.tgz#ba45c9150610477f5d05509414f7330b6175ecdd" - integrity sha512-BfI1Yi2R0eZ076F4v4UZklQ+8WS0g8QZ9g2716FoNTGGYogUeMQ/8gZWIJaAyylCypN/ucNLdpSmSTnhR59jCw== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/api" "9.5.1" - "@polkadot/types" "9.5.1" - "@polkadot/types-codec" "9.5.1" - "@polkadot/types-create" "9.5.1" - "@polkadot/util" "^10.1.10" - "@polkadot/util-crypto" "^10.1.10" +"@polkadot/api-derive@9.5.2": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-9.5.2.tgz#c0412cfc13fa71f93b315d126b12b5ab38e6438c" + integrity sha512-kWn12dlqfIES1trNLd3O1i2qa4T97v/co1VMCgVstICwCt3+mGZgpxkMqQqPiWHagKEVeBNoAn+h8eOiQlbujA== + dependencies: + "@babel/runtime" "^7.19.4" + "@polkadot/api" "9.5.2" + "@polkadot/api-augment" "9.5.2" + "@polkadot/api-base" "9.5.2" + "@polkadot/rpc-core" "9.5.2" + "@polkadot/types" "9.5.2" + "@polkadot/types-codec" "9.5.2" + "@polkadot/util" "^10.1.11" + "@polkadot/util-crypto" "^10.1.11" rxjs "^7.5.7" -"@polkadot/api-derive@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-9.5.1.tgz#8542b989c34249df5ec3b836ec10b910897620df" - integrity sha512-fKlKQe8WZ3jrm44w/zptMofljW5qj+jZxnryK08CAH/MINlZArPfCtn+EJla2ND9aTnRMUWlEBtytyCPImI/Hg== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/api" "9.5.1" - "@polkadot/api-augment" "9.5.1" - "@polkadot/api-base" "9.5.1" - "@polkadot/rpc-core" "9.5.1" - "@polkadot/types" "9.5.1" - "@polkadot/types-codec" "9.5.1" - "@polkadot/util" "^10.1.10" - "@polkadot/util-crypto" "^10.1.10" - rxjs "^7.5.7" - -"@polkadot/api@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-9.5.1.tgz#3501dac23bf82986dfe0a8c22857eb86610eca61" - integrity sha512-A2i/+mCl6cbFJ84ExMcWosUDfq0gVvzyKftkbRMs0oDzvHVVucTm0nCCzBgi/ltvSsFq8oJQ4pVqNTfT/IXgeQ== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/api-augment" "9.5.1" - "@polkadot/api-base" "9.5.1" - "@polkadot/api-derive" "9.5.1" - "@polkadot/keyring" "^10.1.10" - "@polkadot/rpc-augment" "9.5.1" - "@polkadot/rpc-core" "9.5.1" - "@polkadot/rpc-provider" "9.5.1" - "@polkadot/types" "9.5.1" - "@polkadot/types-augment" "9.5.1" - "@polkadot/types-codec" "9.5.1" - "@polkadot/types-create" "9.5.1" - "@polkadot/types-known" "9.5.1" - "@polkadot/util" "^10.1.10" - "@polkadot/util-crypto" "^10.1.10" +"@polkadot/api@9.5.2": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-9.5.2.tgz#cef83928e47c393fbebf2788bc86841b6ab37a41" + integrity sha512-iEF/E8vQan3fHmIEl3bX7Yn/1jQLlvSDwPOxiQdj4tIcF36HX6vCbkdhQKRif0CNYES58TA9EKFiCNg81k+kXw== + dependencies: + "@babel/runtime" "^7.19.4" + "@polkadot/api-augment" "9.5.2" + "@polkadot/api-base" "9.5.2" + "@polkadot/api-derive" "9.5.2" + "@polkadot/keyring" "^10.1.11" + "@polkadot/rpc-augment" "9.5.2" + "@polkadot/rpc-core" "9.5.2" + "@polkadot/rpc-provider" "9.5.2" + "@polkadot/types" "9.5.2" + "@polkadot/types-augment" "9.5.2" + "@polkadot/types-codec" "9.5.2" + "@polkadot/types-create" "9.5.2" + "@polkadot/types-known" "9.5.2" + "@polkadot/util" "^10.1.11" + "@polkadot/util-crypto" "^10.1.11" eventemitter3 "^4.0.7" rxjs "^7.5.7" -"@polkadot/keyring@^10.1.10": - version "10.1.10" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-10.1.10.tgz#f9d97ab528e612df4820e0df1837faae51c15904" - integrity sha512-crKYBbwmPcFoTP6mby2+o1QWsjAyi5QlKzU8tXuXOApP6SBuqmDujIuLOKNG2vZoftNdVldsVL0WmKVYtBeuQg== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/util" "10.1.10" - "@polkadot/util-crypto" "10.1.10" - -"@polkadot/networks@10.1.10", "@polkadot/networks@^10.1.10": - version "10.1.10" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.1.10.tgz#421ce200f8b26759edd1d9d9408d934527f5b455" - integrity sha512-Db78t2XnFIZbdSdu1aFuj3/1cNwcSzG/+wNrpCQ9dPhnGPy5S1GVbmU8pyxTftPKdTFc+8RdBr+5bc0d5ijGiA== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/util" "10.1.10" - "@substrate/ss58-registry" "^1.31.0" - -"@polkadot/rpc-augment@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-9.5.1.tgz#a4d8d7c6132375c9f4d50c7cb4c6813ff700937f" - integrity sha512-7Qm6oIoVIqv6VOaIqDal45hUTb3TVZ58S3zkSr60p/dPMlGCaFMcojtfcQErHtCW0hgvzFNsDl9ShpXRcPWu7g== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/rpc-core" "9.5.1" - "@polkadot/types" "9.5.1" - "@polkadot/types-codec" "9.5.1" - "@polkadot/util" "^10.1.10" - -"@polkadot/rpc-core@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-9.5.1.tgz#7c327d735b742aaaee856bce6288331d0b2b042f" - integrity sha512-8CXgBVTEUjeuN5VOwS6MjTeqpN+9qrNJAAwNEba36/72g6Wgg3flza11kx0luQ6OLPVgCM7OcAjZ17p16phXDA== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/rpc-augment" "9.5.1" - "@polkadot/rpc-provider" "9.5.1" - "@polkadot/types" "9.5.1" - "@polkadot/util" "^10.1.10" +"@polkadot/keyring@^10.1.11": + version "10.1.11" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-10.1.11.tgz#a3fed011b0c8826ea2097e04f7189e9be66fbf98" + integrity sha512-Nv8cZaOA/KbdslDMTklJ58+y+UPpic3+oMQoozuq48Ccjv7WeW2BX47XM/RNE8nYFg6EHa6Whfm4IFaFb8s7ag== + dependencies: + "@babel/runtime" "^7.19.4" + "@polkadot/util" "10.1.11" + "@polkadot/util-crypto" "10.1.11" + +"@polkadot/networks@10.1.11", "@polkadot/networks@^10.1.11": + version "10.1.11" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.1.11.tgz#96a5d6c80228f4beada9154cca0f60a63198e7f4" + integrity sha512-4FfOVETXwh6PL6wd6fYJMkRSQKm+xUw3vR5rHqcAnB696FpMFPPErc6asgZ9lYMyzNJRY3yG86HQpFhtCv1nGA== + dependencies: + "@babel/runtime" "^7.19.4" + "@polkadot/util" "10.1.11" + "@substrate/ss58-registry" "^1.33.0" + +"@polkadot/rpc-augment@9.5.2": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-9.5.2.tgz#739cc3ed2f86f4318432e38381a2cc780dc64f1e" + integrity sha512-QAcunC7p/T4xy6e4m0Q1c9tiVYxnm+S9o10tmtx0K4qXzrc/4I2/tsw3nEGi3BzJhvMpFondSQGcJ3gyLwpmVA== + dependencies: + "@babel/runtime" "^7.19.4" + "@polkadot/rpc-core" "9.5.2" + "@polkadot/types" "9.5.2" + "@polkadot/types-codec" "9.5.2" + "@polkadot/util" "^10.1.11" + +"@polkadot/rpc-core@9.5.2": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-9.5.2.tgz#1a00868038b6c07fe8f58bd0a6cc9519d14001cc" + integrity sha512-4PbNz0GEp3FXYOnsS7mDHZy9DNVBOl56fq8vs09rLkEkrrvGkHmCvabEEWL7OPbwBzwzsCxdgI+IdkVTUKXPkQ== + dependencies: + "@babel/runtime" "^7.19.4" + "@polkadot/rpc-augment" "9.5.2" + "@polkadot/rpc-provider" "9.5.2" + "@polkadot/types" "9.5.2" + "@polkadot/util" "^10.1.11" rxjs "^7.5.7" -"@polkadot/rpc-provider@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-9.5.1.tgz#1857b655a461820025b85cf3a7e7a58066ede137" - integrity sha512-CxyEo1SzwbcByUsrW5RUm5GTLNK7yjmVlTMseex8zQLO4+4erqUoQzr6TTIPSt4LWyk+TjbZdtGtlt7p6i2nJg== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/keyring" "^10.1.10" - "@polkadot/types" "9.5.1" - "@polkadot/types-support" "9.5.1" - "@polkadot/util" "^10.1.10" - "@polkadot/util-crypto" "^10.1.10" - "@polkadot/x-fetch" "^10.1.10" - "@polkadot/x-global" "^10.1.10" - "@polkadot/x-ws" "^10.1.10" +"@polkadot/rpc-provider@9.5.2": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-9.5.2.tgz#3e38ea4c3639180f12270b6fe8cbcabf728aaf1d" + integrity sha512-Sn2jfvAsvQcl35o0up8JR/XbDMS/3YVDEN2sFuzXtiD77W2njukItbZT+BolfAW+biAUs3bNomump5k/YLiLKg== + dependencies: + "@babel/runtime" "^7.19.4" + "@polkadot/keyring" "^10.1.11" + "@polkadot/types" "9.5.2" + "@polkadot/types-support" "9.5.2" + "@polkadot/util" "^10.1.11" + "@polkadot/util-crypto" "^10.1.11" + "@polkadot/x-fetch" "^10.1.11" + "@polkadot/x-global" "^10.1.11" + "@polkadot/x-ws" "^10.1.11" "@substrate/connect" "0.7.14" eventemitter3 "^4.0.7" mock-socket "^9.1.5" nock "^13.2.9" -"@polkadot/ts@0.4.22": - version "0.4.22" - resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.4.22.tgz#f97f6a2134fda700d79ddd03ff39b96de384438d" - integrity sha512-iEo3iaWxCnLiQOYhoXu9pCnBuG9QdCCBfMJoVLgO+66dFnfjnXIc0gb6wEcTFPpJRc1QmC8JP+3xJauQ0pXwOQ== - dependencies: - "@types/chrome" "^0.0.171" - -"@polkadot/typegen@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/typegen/-/typegen-9.5.1.tgz#deb74a4bbabd205d68f2b3d59793b3234cfc8c00" - integrity sha512-SKLiXHUpSCBop8dd1P/LCN2R5GpM41QSOmRyNVnhgOKPtmB/vxS2pVNvMDl7dOhQkANCO6E2CWZiIPeWlu/G7Q== +"@polkadot/typegen@9.5.2": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@polkadot/typegen/-/typegen-9.5.2.tgz#b4f3b5eca69c70cc496c8cd3b7804df32282c336" + integrity sha512-DIiicI3VzbqkfjthvHhLYCaElkaKB/qM+P0mGDmb3+NgttJQsH2Sqy/zsT/mjr07hAB1gXf4dhCmj0QQBiR1og== dependencies: "@babel/core" "^7.19.3" "@babel/register" "^7.18.9" - "@babel/runtime" "^7.19.0" - "@polkadot/api" "9.5.1" - "@polkadot/api-augment" "9.5.1" - "@polkadot/rpc-augment" "9.5.1" - "@polkadot/rpc-provider" "9.5.1" - "@polkadot/types" "9.5.1" - "@polkadot/types-augment" "9.5.1" - "@polkadot/types-codec" "9.5.1" - "@polkadot/types-create" "9.5.1" - "@polkadot/types-support" "9.5.1" - "@polkadot/util" "^10.1.10" - "@polkadot/util-crypto" "^10.1.10" - "@polkadot/x-ws" "^10.1.10" + "@babel/runtime" "^7.19.4" + "@polkadot/api" "9.5.2" + "@polkadot/api-augment" "9.5.2" + "@polkadot/rpc-augment" "9.5.2" + "@polkadot/rpc-provider" "9.5.2" + "@polkadot/types" "9.5.2" + "@polkadot/types-augment" "9.5.2" + "@polkadot/types-codec" "9.5.2" + "@polkadot/types-create" "9.5.2" + "@polkadot/types-support" "9.5.2" + "@polkadot/util" "^10.1.11" + "@polkadot/util-crypto" "^10.1.11" + "@polkadot/x-ws" "^10.1.11" handlebars "^4.7.7" websocket "^1.0.34" yargs "^17.6.0" -"@polkadot/types-augment@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-9.5.1.tgz#907d05da7cf0891cdf6d59e2387a3394a978a5c9" - integrity sha512-1AzQpGe5bGttYbbjR1UhV19htsFjgqJ651eyT3YdRqo1hotZ2GwTCkGXuTJtcmQQH9G09xUUwS3nx8WsSyQ70A== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/types" "9.5.1" - "@polkadot/types-codec" "9.5.1" - "@polkadot/util" "^10.1.10" - -"@polkadot/types-codec@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-9.5.1.tgz#d0c04a9f7dd8337dce4fe806e634c4ef99f954cc" - integrity sha512-7Dy8TeApu4lN8DqdMZLuh34ocdHQh9jzAob6cQl1fl1ypOiCO/SwPjFkj0Xnhh7QQz9X9w63jZzbaFR3PPT+0g== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/util" "^10.1.10" - "@polkadot/x-bigint" "^10.1.10" - -"@polkadot/types-create@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-9.5.1.tgz#06f71f08b3c68fb3bbdabe838325c955384d59bd" - integrity sha512-pUQ1U0mho5aKRdi4iR9DP9ldIoj9U+ApHIeYyxkBY8RexMQOpkt8PZfpFhg4z2H5vZj/sgNIBXq65HjXuyu+9w== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/types-codec" "9.5.1" - "@polkadot/util" "^10.1.10" - -"@polkadot/types-known@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-9.5.1.tgz#0eb596078733a96f2cff3d5b4258966f4a6e4a5a" - integrity sha512-SedfPDxJREYPATa7X2Fv26z6UVPYv6v9Z9P4nulnC6Yl8C2+Q4A/VIqTtgsJc0DU1YT3gM8ofVxircfHqqRVNA== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/networks" "^10.1.10" - "@polkadot/types" "9.5.1" - "@polkadot/types-codec" "9.5.1" - "@polkadot/types-create" "9.5.1" - "@polkadot/util" "^10.1.10" - -"@polkadot/types-support@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-9.5.1.tgz#5383cd84375aedd67bf0ccd2fa230d811f4b9dc9" - integrity sha512-mjenEGNT/ReY1xFexb37NDgV7QHHBBfWt31ZQMZKDkQL+R2P0rXFpmitcE3eOCV3oY4mf+GaU2N/ZfnsFl3tPQ== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/util" "^10.1.10" - -"@polkadot/types@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-9.5.1.tgz#5f3891ce45d8d78aa0b5bc65d7517d98342699b0" - integrity sha512-xuhYq+O4JRl2iqLVEwKVHnfOA9AfwoNlHzrFx2DChDcIWdmgmUDASq9TkZhBP+jx81SieMH7iTf4zY6UwPKYQw== - dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/keyring" "^10.1.10" - "@polkadot/types-augment" "9.5.1" - "@polkadot/types-codec" "9.5.1" - "@polkadot/types-create" "9.5.1" - "@polkadot/util" "^10.1.10" - "@polkadot/util-crypto" "^10.1.10" +"@polkadot/types-augment@9.5.2": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-9.5.2.tgz#d9e77756b0e36455d708f5af8265ef011ddf8d91" + integrity sha512-LDJdv/84sECwA0R5lK85/orxjoozJe3+2jeLjRiKr8S6qm9XRfz0wLCSF866kpSGBZ4B1dYBUhzjoSu95y2Jug== + dependencies: + "@babel/runtime" "^7.19.4" + "@polkadot/types" "9.5.2" + "@polkadot/types-codec" "9.5.2" + "@polkadot/util" "^10.1.11" + +"@polkadot/types-codec@9.5.2": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-9.5.2.tgz#345c38ccef17651b8cabd159a42810893b5e7e44" + integrity sha512-FJPjE3ceTGTcadeC8d5C+aSR8SLKuQrXKIBmMNBky+WwzEo0vufRqxFWcPLxAOEeeUPgBXS967tP15+UU4psGA== + dependencies: + "@babel/runtime" "^7.19.4" + "@polkadot/util" "^10.1.11" + "@polkadot/x-bigint" "^10.1.11" + +"@polkadot/types-create@9.5.2": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-9.5.2.tgz#a85dcb794ea11e5d528baa34b65e57cfafc905cf" + integrity sha512-YbplL8K0LqUEHoV3FgZ5B83oVV67KGbLXsWHVVaUZBPsmtXJXrbBfSyJgl/80I2n4lXEBmg3sFAYMbaSTvL05A== + dependencies: + "@babel/runtime" "^7.19.4" + "@polkadot/types-codec" "9.5.2" + "@polkadot/util" "^10.1.11" + +"@polkadot/types-known@9.5.2": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-9.5.2.tgz#a71fd08932b1643bbf346321472ed48ab1ade215" + integrity sha512-iNaGOF6dGiTvy3Ns8Z7WNjYD1SGnZiapDAKPH4brPuJqMpN6/FxYpfPSSOKx+IJEamsdINcaggb87eWyPxH8CA== + dependencies: + "@babel/runtime" "^7.19.4" + "@polkadot/networks" "^10.1.11" + "@polkadot/types" "9.5.2" + "@polkadot/types-codec" "9.5.2" + "@polkadot/types-create" "9.5.2" + "@polkadot/util" "^10.1.11" + +"@polkadot/types-support@9.5.2": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-9.5.2.tgz#f2990d19cbd78c24e5b7116466fb1d89f93a8ca7" + integrity sha512-Zdbl5fvGQjUkyE1r67vhyPEqLUwlZ35GCnkoobY9MgN6gylhSjNue/shpG4uGsEjWVQL7GkFkrPiwtzDArVilg== + dependencies: + "@babel/runtime" "^7.19.4" + "@polkadot/util" "^10.1.11" + +"@polkadot/types@9.5.2": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-9.5.2.tgz#33ab2caea08f084141a01038adbe53ed69ab7d9c" + integrity sha512-6C5xzOrMK+fu0JMOlSO+8dPDhpwKPOaKMv3v5BMvBEWtDNKM81/QQoAoYT7DSVXq/V16icSFxPs9IWC+6Qq5ag== + dependencies: + "@babel/runtime" "^7.19.4" + "@polkadot/keyring" "^10.1.11" + "@polkadot/types-augment" "9.5.2" + "@polkadot/types-codec" "9.5.2" + "@polkadot/types-create" "9.5.2" + "@polkadot/util" "^10.1.11" + "@polkadot/util-crypto" "^10.1.11" rxjs "^7.5.7" -"@polkadot/util-crypto@10.1.10", "@polkadot/util-crypto@^10.1.10": - version "10.1.10" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.1.10.tgz#ae00c794dda6a2f5e40cdaaa87987312461dc59f" - integrity sha512-w9h/wf4wZXeUkRnihhnfqlaKuoQtrjkjK3C5liCQkr9vx5zOsmg/nMSDP8UUFJX0msPPYpFeNvzn7oDIs6qSZA== +"@polkadot/util-crypto@10.1.11", "@polkadot/util-crypto@^10.1.11": + version "10.1.11" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.1.11.tgz#e59bdc8e1e2bd98a115e2e2ed45461e68a14a48c" + integrity sha512-wG63frIMAR5T/HXGM0SFNzZZdk7qDBsfLXfn6PIZiXCCCsdEYPzS5WltB7fkhicYpbePJ7VgdCAddj1l4IcGyg== dependencies: - "@babel/runtime" "^7.19.0" + "@babel/runtime" "^7.19.4" "@noble/hashes" "1.1.3" "@noble/secp256k1" "1.7.0" - "@polkadot/networks" "10.1.10" - "@polkadot/util" "10.1.10" + "@polkadot/networks" "10.1.11" + "@polkadot/util" "10.1.11" "@polkadot/wasm-crypto" "^6.3.1" - "@polkadot/x-bigint" "10.1.10" - "@polkadot/x-randomvalues" "10.1.10" + "@polkadot/x-bigint" "10.1.11" + "@polkadot/x-randomvalues" "10.1.11" "@scure/base" "1.1.1" ed2curve "^0.3.0" tweetnacl "^1.0.3" -"@polkadot/util@10.1.10", "@polkadot/util@^10.1.10": - version "10.1.10" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.1.10.tgz#dc79c93d70e699e8cc1b09e636af7e4a64c5f0f0" - integrity sha512-BQoTfSxZ3BWAgWDjgKBVdyw1AJGaoOeAidCA+LZcHV6wlMu5643AZPUnoMrW413MbbpxsIhJXtNttqOwjo8MjA== +"@polkadot/util@10.1.11", "@polkadot/util@^10.1.11": + version "10.1.11" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.1.11.tgz#22bcdabbd7a0d266417f6569cc655f516d371a82" + integrity sha512-6m51lw6g6ilqO/k4BQY7rD0lYM9NCnC4FiM7CEEUc7j8q86qxdcZ88zdNldkhNsTIQnfmCtkK3GRzZW6VYrbUw== dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/x-bigint" "10.1.10" - "@polkadot/x-global" "10.1.10" - "@polkadot/x-textdecoder" "10.1.10" - "@polkadot/x-textencoder" "10.1.10" + "@babel/runtime" "^7.19.4" + "@polkadot/x-bigint" "10.1.11" + "@polkadot/x-global" "10.1.11" + "@polkadot/x-textdecoder" "10.1.11" + "@polkadot/x-textencoder" "10.1.11" "@types/bn.js" "^5.1.1" bn.js "^5.2.1" @@ -831,62 +810,62 @@ dependencies: "@babel/runtime" "^7.18.9" -"@polkadot/x-bigint@10.1.10", "@polkadot/x-bigint@^10.1.10": - version "10.1.10" - resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.1.10.tgz#97dcccda2e24776aad3ae49f3268c03332138246" - integrity sha512-4Jt0BO0WTby6r9A2DgkDxf/LFaICQHvSl1VSFtBf0Z0GV2n4OxkBX5x/1bdEdGEvYT5rM7RbR3xI7EL+W1ixHA== +"@polkadot/x-bigint@10.1.11", "@polkadot/x-bigint@^10.1.11": + version "10.1.11" + resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.1.11.tgz#7d62ce10cccd55b86a415342db95b9feeb099776" + integrity sha512-TC4KZ+ni/SJhcf/LIwD49C/kwvACu0nCchETNO+sAfJ7COXZwHDUJXVXmwN5PgkQxwsWsKKuJmzR/Fi1bgMWnQ== dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/x-global" "10.1.10" + "@babel/runtime" "^7.19.4" + "@polkadot/x-global" "10.1.11" -"@polkadot/x-fetch@^10.1.10": - version "10.1.10" - resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-10.1.10.tgz#6551e44211cf21a1ca076eedc4676754345e1504" - integrity sha512-LvTxAN6GaJzfgZ74WFYPZrIkMEThpX5u7O4ILiExcJt87E19cSWlYSHDa5n+OLjUpq0lBV2ueF90iUblt6aHpg== +"@polkadot/x-fetch@^10.1.11": + version "10.1.11" + resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-10.1.11.tgz#8f579bb166096c977acff91a40b3848fb5581900" + integrity sha512-WtyUr9itVD9BLnxCUloJ1iwrXOY/lnlEShEYKHcSm6MIHtbJolePd3v1+o5mOX+bdDbHXhPZnH8anCCqDNDRqg== dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/x-global" "10.1.10" + "@babel/runtime" "^7.19.4" + "@polkadot/x-global" "10.1.11" "@types/node-fetch" "^2.6.2" node-fetch "^3.2.10" -"@polkadot/x-global@10.1.10", "@polkadot/x-global@^10.1.10": - version "10.1.10" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.1.10.tgz#eedf63f1f3918c7f2bd8ef0907e051783f1a626e" - integrity sha512-WFfgaZSrzPlKLdnOus2mIFGzUbSDIQK6RMCfFfM9SmF3DkoxN40z5Nkni4PztfKr22stlkhmhnX/Lp/NxpuT6Q== +"@polkadot/x-global@10.1.11", "@polkadot/x-global@^10.1.11": + version "10.1.11" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.1.11.tgz#37dda3ef1cebfd14c68c69279ae6521957817866" + integrity sha512-bWz5gdcELy6+xfr27R1GE5MPX4nfVlchzHQH+DR6OBbSi9g/PeycQAvFB6IkTmP+YEbNNtIpxnSP37zoUaG3xw== dependencies: - "@babel/runtime" "^7.19.0" + "@babel/runtime" "^7.19.4" -"@polkadot/x-randomvalues@10.1.10": - version "10.1.10" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.1.10.tgz#a10f98f2c4d744612b68ee697e43f1e4d6e1f89a" - integrity sha512-KM4sCI/DNLIXlmnkeJIuYvh3pPuWvnkbR1a6TUB12J1izUJ+uGV+cAFRR4/EZk3oEsG/Tgivbs56meEOo3ws5A== +"@polkadot/x-randomvalues@10.1.11": + version "10.1.11" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.1.11.tgz#f9e088f8b400770d3e53ba9e0c0f0d464047f89e" + integrity sha512-V2V37f5hoM5B32eCpGw87Lwstin2+ArXhOZ8ENKncbQLXzbF9yTODueDoA5Vt0MJCs2CDP9cyiCYykcanqVkxg== dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/x-global" "10.1.10" + "@babel/runtime" "^7.19.4" + "@polkadot/x-global" "10.1.11" -"@polkadot/x-textdecoder@10.1.10": - version "10.1.10" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.1.10.tgz#a6d0010b092bdefc69c70dcb34d76ec8993980b2" - integrity sha512-cAk37faYXx8IICeaq/tdl+aiIXwo3SLrx9XNoQqhX02g+SEs3ARM7zJcohj/p8ynWAI+ezNcsKn1wh174nquHw== +"@polkadot/x-textdecoder@10.1.11": + version "10.1.11" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.1.11.tgz#314c79e27545a41fe0494a26196bf2dff5cfcb5d" + integrity sha512-QZqie04SR6pAj260PaLBfZUGXWKI357t4ROVJhpaj06qc1zrk1V8Mwkr49+WzjAPFEOqo70HWnzXmPNCH4dQiw== dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/x-global" "10.1.10" + "@babel/runtime" "^7.19.4" + "@polkadot/x-global" "10.1.11" -"@polkadot/x-textencoder@10.1.10": - version "10.1.10" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.1.10.tgz#35b2e778b3dbb6816bb37f1848b772c4cd3c43d1" - integrity sha512-Auaql6BL5UHtWakZUQyj4y/BrM0tm4bYG5vXCMQCA1Gg0ky+46DhgpRrAQ9F7NNgWg1A6dA2I9KuAA4BTbNx0w== +"@polkadot/x-textencoder@10.1.11": + version "10.1.11" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.1.11.tgz#23b18b3ffbc649572728aa37d7787432bb3a03b5" + integrity sha512-UX+uV9AbDID81waaG/NvTkkf7ZNVW7HSHaddgbWjQEVW2Ex4ByccBarY5jEi6cErEPKfzCamKhgXflu0aV9LWw== dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/x-global" "10.1.10" + "@babel/runtime" "^7.19.4" + "@polkadot/x-global" "10.1.11" -"@polkadot/x-ws@^10.1.10": - version "10.1.10" - resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-10.1.10.tgz#27b55a988a0f60db7f79fed8268802406f522813" - integrity sha512-JxDgfm0ox2XPAtdTeJXYl6qq7LY/KOPi69wRpFMczWaYUsZubO6EiRzgzjuFlHY4/oxfjS/D+YbzcjefTxHz6g== +"@polkadot/x-ws@^10.1.11": + version "10.1.11" + resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-10.1.11.tgz#7431ad72064d56519d4293278f03ae97b9ea9271" + integrity sha512-EUbL/R1A/NxYf6Rnb1M7U9yeTuo5r4y2vcQllE5aBLaQ0cFnRykHzlmZlVX1E7O5uy3lYVdxWC7sNgxItIWkWA== dependencies: - "@babel/runtime" "^7.19.0" - "@polkadot/x-global" "10.1.10" + "@babel/runtime" "^7.19.4" + "@polkadot/x-global" "10.1.11" "@types/websocket" "^1.0.5" websocket "^1.0.34" @@ -922,10 +901,10 @@ pako "^2.0.4" ws "^8.8.1" -"@substrate/ss58-registry@^1.31.0": - version "1.31.0" - resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.31.0.tgz#489e3a496081dc3ee7ef5ef2eb513962d5d29351" - integrity sha512-OSOmdjaq9foXfHBy9aLVMwGheygvsiZlv4dggnLOYOuhSmNCsSB/PaW4DBz+/tSdK1Fo9+ZiFW6cF24RA+m0sw== +"@substrate/ss58-registry@^1.33.0": + version "1.33.0" + resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.33.0.tgz#b93218fc86405769716b02f0ce5e61df221b37ae" + integrity sha512-DztMuMcEfu+tJrtIQIIp5gO8/XJZ8N8UwPObDCSNgrp7trtSkPJAUFB9qXaReXtN9UvTcVBMTWk6VPfFi04Wkg== "@szmarczak/http-timer@^4.0.5": version "4.0.6" @@ -992,36 +971,11 @@ dependencies: "@types/chai" "*" -"@types/chai@*", "@types/chai@^4.3.1": +"@types/chai@*", "@types/chai@^4.3.3": version "4.3.3" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.3.tgz#3c90752792660c4b562ad73b3fbd68bf3bc7ae07" integrity sha512-hC7OMnszpxhZPduX+m+nrx+uFoLkWOMiR4oa/AZF3MuSETYTZmFfJAHqZEM8MVlvfG7BEUcgvtwoCTxBp6hm3g== -"@types/chrome@^0.0.171": - version "0.0.171" - resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.171.tgz#6ee9aca52fabbe645372088fcc86b33cff33fcba" - integrity sha512-CnCwFKI3COygib3DNJrCjePeoU2OCDGGbUcmftXtQ3loMABsLgwpG8z+LxV4kjQJFzmJDqOyhCSsbY9yyEfapQ== - dependencies: - "@types/filesystem" "*" - "@types/har-format" "*" - -"@types/filesystem@*": - version "0.0.32" - resolved "https://registry.yarnpkg.com/@types/filesystem/-/filesystem-0.0.32.tgz#307df7cc084a2293c3c1a31151b178063e0a8edf" - integrity sha512-Yuf4jR5YYMR2DVgwuCiP11s0xuVRyPKmz8vo6HBY3CGdeMj8af93CFZX+T82+VD1+UqHOxTq31lO7MI7lepBtQ== - dependencies: - "@types/filewriter" "*" - -"@types/filewriter@*": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@types/filewriter/-/filewriter-0.0.29.tgz#a48795ecadf957f6c0d10e0c34af86c098fa5bee" - integrity sha512-BsPXH/irW0ht0Ji6iw/jJaK8Lj3FJemon2gvEqHKpCdDCeemHa+rI3WBGq5z7cDMZgoLjY40oninGxqk+8NzNQ== - -"@types/har-format@*": - version "1.2.9" - resolved "https://registry.yarnpkg.com/@types/har-format/-/har-format-1.2.9.tgz#b9b3a9bfc33a078e7d898a00b09662910577f4a4" - integrity sha512-rffW6MhQ9yoa75bdNi+rjZBAvu2HhehWJXlhuWXnWdENeuKe82wUgAwxYOb7KRKKmxYN+D/iRKd2NDQMLqlUmg== - "@types/http-cache-semantics@*": version "4.0.1" resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" @@ -1033,11 +987,11 @@ integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== "@types/keyv@*": - version "3.1.4" - resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6" - integrity sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg== + version "4.2.0" + resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-4.2.0.tgz#65b97868ab757906f2dbb653590d7167ad023fa0" + integrity sha512-xoBtGl5R9jeKUhc8ZqeYaRDx04qqJ10yhhXYGmJ4Jr8qKpvMsDQQrNUvF/wUJ4klOtmJeJM+p2Xo3zp9uaC3tw== dependencies: - "@types/node" "*" + keyv "*" "@types/mocha@^10.0.0": version "10.0.0" @@ -1052,21 +1006,16 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*": - version "18.8.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.8.3.tgz#ce750ab4017effa51aed6a7230651778d54e327c" - integrity sha512-0os9vz6BpGwxGe9LOhgP/ncvYN5Tx1fNcd2TM3rD/aCGBkysb+ZWpXEocG24h6ZzOi13+VB8HndAQFezsSOw1w== +"@types/node@*", "@types/node@^18.11.2": + version "18.11.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.2.tgz#c59b7641832531264fda3f1ba610362dc9a7dfc8" + integrity sha512-BWN3M23gLO2jVG8g/XHIRFWiiV4/GckeFIqbU/C4V3xpoBBWSMk4OZomouN0wCkfQFPqgZikyLr7DOYDysIkkw== "@types/node@^12.12.6": version "12.20.55" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== -"@types/node@^17.0.35": - version "17.0.45" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.45.tgz#2c0fafd78705e7a18b7906b5201a522719dc5190" - integrity sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw== - "@types/pbkdf2@^3.0.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" @@ -1088,6 +1037,11 @@ dependencies: "@types/node" "*" +"@types/semver@^7.3.12": + version "7.3.12" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.12.tgz#920447fdd78d76b19de0438b7f60df3c4a80bf1c" + integrity sha512-WwA1MW0++RfXmCr12xeYOOC5baSC9mSb0ZqCquFzKhcoF4TvHu5MKOuXsncgZcpVFhB1pXd5hZmM0ryAoCp12A== + "@types/websocket@^1.0.5": version "1.0.5" resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.5.tgz#3fb80ed8e07f88e51961211cd3682a3a4a81569c" @@ -1095,91 +1049,88 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@^5.26.0": - version "5.39.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.39.0.tgz#778b2d9e7f293502c7feeea6c74dca8eb3e67511" - integrity sha512-xVfKOkBm5iWMNGKQ2fwX5GVgBuHmZBO1tCRwXmY5oAIsPscfwm2UADDuNB8ZVYCtpQvJK4xpjrK7jEhcJ0zY9A== +"@typescript-eslint/eslint-plugin@^5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.40.1.tgz#3203a6ff396b1194083faaa6e5110c401201d7d5" + integrity sha512-FsWboKkWdytGiXT5O1/R9j37YgcjO8MKHSUmWnIEjVaz0krHkplPnYi7mwdb+5+cs0toFNQb0HIrN7zONdIEWg== dependencies: - "@typescript-eslint/scope-manager" "5.39.0" - "@typescript-eslint/type-utils" "5.39.0" - "@typescript-eslint/utils" "5.39.0" + "@typescript-eslint/scope-manager" "5.40.1" + "@typescript-eslint/type-utils" "5.40.1" + "@typescript-eslint/utils" "5.40.1" debug "^4.3.4" ignore "^5.2.0" regexpp "^3.2.0" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.26.0": - version "5.39.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.39.0.tgz#93fa0bc980a3a501e081824f6097f7ca30aaa22b" - integrity sha512-PhxLjrZnHShe431sBAGHaNe6BDdxAASDySgsBCGxcBecVCi8NQWxQZMcizNA4g0pN51bBAn/FUfkWG3SDVcGlA== +"@typescript-eslint/parser@^5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.40.1.tgz#e7f8295dd8154d0d37d661ddd8e2f0ecfdee28dd" + integrity sha512-IK6x55va5w4YvXd4b3VrXQPldV9vQTxi5ov+g4pMANsXPTXOcfjx08CRR1Dfrcc51syPtXHF5bgLlMHYFrvQtg== dependencies: - "@typescript-eslint/scope-manager" "5.39.0" - "@typescript-eslint/types" "5.39.0" - "@typescript-eslint/typescript-estree" "5.39.0" + "@typescript-eslint/scope-manager" "5.40.1" + "@typescript-eslint/types" "5.40.1" + "@typescript-eslint/typescript-estree" "5.40.1" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.39.0": - version "5.39.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.39.0.tgz#873e1465afa3d6c78d8ed2da68aed266a08008d0" - integrity sha512-/I13vAqmG3dyqMVSZPjsbuNQlYS082Y7OMkwhCfLXYsmlI0ca4nkL7wJ/4gjX70LD4P8Hnw1JywUVVAwepURBw== +"@typescript-eslint/scope-manager@5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.40.1.tgz#a7a5197dfd234622a2421ea590ee0ccc02e18dfe" + integrity sha512-jkn4xsJiUQucI16OLCXrLRXDZ3afKhOIqXs4R3O+M00hdQLKR58WuyXPZZjhKLFCEP2g+TXdBRtLQ33UfAdRUg== dependencies: - "@typescript-eslint/types" "5.39.0" - "@typescript-eslint/visitor-keys" "5.39.0" + "@typescript-eslint/types" "5.40.1" + "@typescript-eslint/visitor-keys" "5.40.1" -"@typescript-eslint/type-utils@5.39.0": - version "5.39.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.39.0.tgz#0a8c00f95dce4335832ad2dc6bc431c14e32a0a6" - integrity sha512-KJHJkOothljQWzR3t/GunL0TPKY+fGJtnpl+pX+sJ0YiKTz3q2Zr87SGTmFqsCMFrLt5E0+o+S6eQY0FAXj9uA== +"@typescript-eslint/type-utils@5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.40.1.tgz#091e4ce3bebbdb68f4980bae9dee2e4e1725f601" + integrity sha512-DLAs+AHQOe6n5LRraXiv27IYPhleF0ldEmx6yBqBgBLaNRKTkffhV1RPsjoJBhVup2zHxfaRtan8/YRBgYhU9Q== dependencies: - "@typescript-eslint/typescript-estree" "5.39.0" - "@typescript-eslint/utils" "5.39.0" + "@typescript-eslint/typescript-estree" "5.40.1" + "@typescript-eslint/utils" "5.40.1" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.39.0": - version "5.39.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.39.0.tgz#f4e9f207ebb4579fd854b25c0bf64433bb5ed78d" - integrity sha512-gQMZrnfEBFXK38hYqt8Lkwt8f4U6yq+2H5VDSgP/qiTzC8Nw8JO3OuSUOQ2qW37S/dlwdkHDntkZM6SQhKyPhw== +"@typescript-eslint/types@5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.40.1.tgz#de37f4f64de731ee454bb2085d71030aa832f749" + integrity sha512-Icg9kiuVJSwdzSQvtdGspOlWNjVDnF3qVIKXdJ103o36yRprdl3Ge5cABQx+csx960nuMF21v8qvO31v9t3OHw== -"@typescript-eslint/typescript-estree@5.39.0": - version "5.39.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.39.0.tgz#c0316aa04a1a1f4f7f9498e3c13ef1d3dc4cf88b" - integrity sha512-qLFQP0f398sdnogJoLtd43pUgB18Q50QSA+BTE5h3sUxySzbWDpTSdgt4UyxNSozY/oDK2ta6HVAzvGgq8JYnA== +"@typescript-eslint/typescript-estree@5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.40.1.tgz#9a7d25492f02c69882ce5e0cd1857b0c55645d72" + integrity sha512-5QTP/nW5+60jBcEPfXy/EZL01qrl9GZtbgDZtDPlfW5zj/zjNrdI2B5zMUHmOsfvOr2cWqwVdWjobCiHcedmQA== dependencies: - "@typescript-eslint/types" "5.39.0" - "@typescript-eslint/visitor-keys" "5.39.0" + "@typescript-eslint/types" "5.40.1" + "@typescript-eslint/visitor-keys" "5.40.1" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.39.0": - version "5.39.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.39.0.tgz#b7063cca1dcf08d1d21b0d91db491161ad0be110" - integrity sha512-+DnY5jkpOpgj+EBtYPyHRjXampJfC0yUZZzfzLuUWVZvCuKqSdJVC8UhdWipIw7VKNTfwfAPiOWzYkAwuIhiAg== +"@typescript-eslint/utils@5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.40.1.tgz#3204fb73a559d3b7bab7dc9d3c44487c2734a9ca" + integrity sha512-a2TAVScoX9fjryNrW6BZRnreDUszxqm9eQ9Esv8n5nXApMW0zeANUYlwh/DED04SC/ifuBvXgZpIK5xeJHQ3aw== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.39.0" - "@typescript-eslint/types" "5.39.0" - "@typescript-eslint/typescript-estree" "5.39.0" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.40.1" + "@typescript-eslint/types" "5.40.1" + "@typescript-eslint/typescript-estree" "5.40.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" + semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.39.0": - version "5.39.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.39.0.tgz#8f41f7d241b47257b081ddba5d3ce80deaae61e2" - integrity sha512-yyE3RPwOG+XJBLrhvsxAidUgybJVQ/hG8BhiJo0k8JSAYfk/CshVcxf0HwP4Jt7WZZ6vLmxdo1p6EyN3tzFTkg== +"@typescript-eslint/visitor-keys@5.40.1": + version "5.40.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.40.1.tgz#f3d2bf5af192f4432b84cec6fdcb387193518754" + integrity sha512-A2DGmeZ+FMja0geX5rww+DpvILpwo1OsiQs0M+joPWJYsiEFBLsH0y1oFymPNul6Z5okSmHpP4ivkc2N0Cgfkw== dependencies: - "@typescript-eslint/types" "5.39.0" + "@typescript-eslint/types" "5.40.1" eslint-visitor-keys "^3.3.0" -"@ungap/promise-all-settled@1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" - integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== - abortcontroller-polyfill@^1.7.3: version "1.7.5" resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz#6738495f4e901fbb57b6c0611d0c75f76c485bed" @@ -1346,7 +1297,7 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -bignumber.js@^9.0.0, bignumber.js@^9.1.0: +bignumber.js@^9.0.0: version "9.1.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.0.tgz#8d340146107fe3a6cb8d40699643c302e8773b62" integrity sha512-4LwHK4nfDOraBCtst+wOWIHbu1vhvAPJK8g8nROd4iuc3PSEjWif/qwbkh8jwCJz6yDBvtU4KPynETgrfh7y3A== @@ -1535,9 +1486,9 @@ buffer@^5.0.5, buffer@^5.5.0, buffer@^5.6.0: ieee754 "^1.1.13" bufferutil@^4.0.1: - version "4.0.6" - resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.6.tgz#ebd6c67c7922a0e902f053e5d8be5ec850e48433" - integrity sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw== + version "4.0.7" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.7.tgz#60c0d19ba2c992dd8273d3f73772ffc894c153ad" + integrity sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw== dependencies: node-gyp-build "^4.3.0" @@ -1588,9 +1539,9 @@ camelcase@^6.0.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001400: - version "1.0.30001418" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001418.tgz#5f459215192a024c99e3e3a53aac310fc7cf24e6" - integrity sha512-oIs7+JL3K9JRQ3jPZjlH6qyYDp+nBTCais7hjh0s+fuBwufc7uZ7hPYMXrDOJhV360KGMTcczMRObk0/iMqZRg== + version "1.0.30001422" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001422.tgz#f2d7c6202c49a8359e6e35add894d88ef93edba1" + integrity sha512-hSesn02u1QacQHhaxl/kNMZwqVG35Sz/8DgvmgedxSH8z9UUpcDYSPYgsj3x5dQNRcNp6BwpSfQfVzYUTm+fog== caseless@~0.12.0: version "0.12.0" @@ -1800,11 +1751,9 @@ content-type@~1.0.4: integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== convert-source-map@^1.7.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" - integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== - dependencies: - safe-buffer "~5.1.1" + version "1.9.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" + integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== cookie-signature@1.0.6: version "1.0.6" @@ -1947,6 +1896,13 @@ decode-uri-component@^0.2.0: resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og== +decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + integrity sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA== + dependencies: + mimic-response "^1.0.0" + decompress-response@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" @@ -2061,9 +2017,9 @@ ee-first@1.1.1: integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== electron-to-chromium@^1.4.251: - version "1.4.276" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.276.tgz#17837b19dafcc43aba885c4689358b298c19b520" - integrity sha512-EpuHPqu8YhonqLBXHoU6hDJCD98FCe6KDoet3/gY1qsQ6usjJoHqBH2YIVs8FXaAtHwVL8Uqa/fsYao/vq9VWQ== + version "1.4.284" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592" + integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA== elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.3, elliptic@^6.5.4: version "6.5.4" @@ -2218,7 +2174,7 @@ eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@^8.16.0: +eslint@^8.25.0: version "8.25.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.25.0.tgz#00eb962f50962165d0c4ee3327708315eaa8058b" integrity sha512-DVlJOZ4Pn50zcKW5bYH7GQK/9MsoQG2d5eDH0ebEkE8PbgzTTmtt/VTH9GGJ4BfeZCpBLqFfvsjX35UacUL83A== @@ -3324,7 +3280,7 @@ keccak@^3.0.0: node-gyp-build "^4.2.0" readable-stream "^3.6.0" -keyv@^4.0.0: +keyv@*, keyv@^4.0.0: version "4.5.0" resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.0.tgz#dbce9ade79610b6e641a9a65f2f6499ba06b9bc6" integrity sha512-2YvuMsA+jnFGtBareKqgANOEKe1mk3HKiXu2fRmAfyxG0MJAywNhi5ttWA3PMjl4NmpyjZNbFifR2vNjW1znfA== @@ -3523,9 +3479,9 @@ minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: brace-expansion "^1.1.7" minimist@^1.2.5, minimist@^1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== + version "1.2.7" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" + integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== minipass@^2.6.0, minipass@^2.9.0: version "2.9.0" @@ -3561,12 +3517,11 @@ mkdirp@^0.5.5: dependencies: minimist "^1.2.6" -mocha@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.0.0.tgz#205447d8993ec755335c4b13deba3d3a13c4def9" - integrity sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA== +mocha@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.1.0.tgz#dbf1114b7c3f9d0ca5de3133906aea3dfc89ef7a" + integrity sha512-vUF7IYxEoN7XhQpFLxQAEMtE4W91acW4B6En9l97MwE9stL1A9gusXfoHZCLVHDUJ/7V5+lbCM6yMqzo5vNymg== dependencies: - "@ungap/promise-all-settled" "1.1.2" ansi-colors "4.1.1" browser-stdout "1.3.1" chokidar "3.5.3" @@ -4106,9 +4061,9 @@ readdirp@~3.6.0: picomatch "^2.2.1" regenerator-runtime@^0.13.4: - version "0.13.9" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" - integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== + version "0.13.10" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz#ed07b19616bcbec5da6274ebc75ae95634bfc2ee" + integrity sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw== regexp.prototype.flags@^1.4.3: version "1.4.3" @@ -4218,7 +4173,7 @@ safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, s resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@~5.1.0: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== @@ -4366,12 +4321,12 @@ simple-concat@^1.0.0: resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== -simple-get@^2.7.0, simple-get@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543" - integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA== +simple-get@^2.7.0: + version "2.8.2" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.2.tgz#5708fb0919d440657326cd5fe7d2599d07705019" + integrity sha512-Ijd/rV5o+mSBBs4F/x9oDPtTx9Zb6X9brmnXvMW4J7IR15ngi9q5xxqWBKU744jTZiaXtxaPL7uHG6vtN8kUkw== dependencies: - decompress-response "^6.0.0" + decompress-response "^3.3.0" once "^1.3.1" simple-concat "^1.0.0" @@ -4582,7 +4537,7 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== -ts-node@^10.8.0: +ts-node@^10.9.1: version "10.9.1" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== @@ -4677,7 +4632,7 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@^4.7.2: +typescript@^4.8.4: version "4.8.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== @@ -4733,9 +4688,9 @@ url-set-query@^1.0.0: integrity sha512-3AChu4NiXquPfeckE5R5cGdiHCMWJx1dwCWOmWIL4KHAziJNOFIYJlpGFeKDvwLPHovZRCxK3cYlwzqI9Vp+Gg== utf-8-validate@^5.0.2: - version "5.0.9" - resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.9.tgz#ba16a822fbeedff1a58918f2a6a6b36387493ea3" - integrity sha512-Yek7dAy0v3Kl0orwMlvi7TPtiCNrdfHNd7Gcc/pLq4BLXqfAmd0J7OWMizUQnTTJsyjKn02mU7anqwfmUP4J8Q== + version "5.0.10" + resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.10.tgz#d7d10ea39318171ca982718b6b96a8d2442571a2" + integrity sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ== dependencies: node-gyp-build "^4.3.0" @@ -4750,15 +4705,14 @@ util-deprecate@^1.0.1: integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== util@^0.12.0: - version "0.12.4" - resolved "https://registry.yarnpkg.com/util/-/util-0.12.4.tgz#66121a31420df8f01ca0c464be15dfa1d1850253" - integrity sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw== + version "0.12.5" + resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" + integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== dependencies: inherits "^2.0.3" is-arguments "^1.0.4" is-generator-function "^1.0.7" is-typed-array "^1.1.3" - safe-buffer "^5.1.2" which-typed-array "^1.1.2" utils-merge@1.0.1: @@ -5022,7 +4976,7 @@ web3-utils@1.8.0: randombytes "^2.1.0" utf8 "3.0.0" -web3@^1.7.3: +web3@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/web3/-/web3-1.8.0.tgz#3ca5f0b32de6a1f626407740411219035b5fde64" integrity sha512-sldr9stK/SALSJTgI/8qpnDuBJNMGjVR84hJ+AcdQ+MLBGLMGsCDNubCoyO6qgk1/Y9SQ7ignegOI/7BPLoiDA== From 8410b5104b6b692f7f05d18934cb676d6557343b Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Oct 2022 11:54:18 +0000 Subject: [PATCH 1223/1274] test: regenerate types Signed-off-by: Yaroslav Bolyukin --- tests/src/interfaces/augment-types.ts | 3 +- tests/src/interfaces/default/types.ts | 6 ++ tests/src/interfaces/lookup.ts | 99 ++++++++++++++------------- tests/src/interfaces/registry.ts | 3 +- tests/src/interfaces/types-lookup.ts | 96 ++++++++++++++------------ 5 files changed, 114 insertions(+), 93 deletions(-) diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index 3891771381..bc3d07e8e1 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassWeight, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassWeight, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsRpcCollectionFlags, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; @@ -1317,6 +1317,7 @@ declare module '@polkadot/types/types/registry' { UpDataStructsPropertyPermission: UpDataStructsPropertyPermission; UpDataStructsPropertyScope: UpDataStructsPropertyScope; UpDataStructsRpcCollection: UpDataStructsRpcCollection; + UpDataStructsRpcCollectionFlags: UpDataStructsRpcCollectionFlags; UpDataStructsSponsoringRateLimit: UpDataStructsSponsoringRateLimit; UpDataStructsSponsorshipStateAccountId32: UpDataStructsSponsorshipStateAccountId32; UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: UpDataStructsSponsorshipStateBasicCrossAccountIdRepr; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index 4c6e18b78e..cab4135cc5 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -2987,7 +2987,13 @@ export interface UpDataStructsRpcCollection extends Struct { readonly tokenPropertyPermissions: Vec; readonly properties: Vec; readonly readOnly: bool; + readonly flags: UpDataStructsRpcCollectionFlags; +} + +/** @name UpDataStructsRpcCollectionFlags */ +export interface UpDataStructsRpcCollectionFlags extends Struct { readonly foreign: bool; + readonly erc721metadata: bool; } /** @name UpDataStructsSponsoringRateLimit */ diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index b72630896c..819e40de66 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -3268,10 +3268,17 @@ export default { tokenPropertyPermissions: 'Vec', properties: 'Vec', readOnly: 'bool', - foreign: 'bool' + flags: 'UpDataStructsRpcCollectionFlags' }, /** - * Lookup409: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup409: up_data_structs::RpcCollectionFlags + **/ + UpDataStructsRpcCollectionFlags: { + foreign: 'bool', + erc721metadata: 'bool' + }, + /** + * Lookup410: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -3281,7 +3288,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup410: rmrk_traits::nft::NftInfo> + * Lookup411: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -3291,14 +3298,14 @@ export default { pending: 'bool' }, /** - * Lookup412: rmrk_traits::nft::RoyaltyInfo + * Lookup413: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup413: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup414: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -3307,14 +3314,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup414: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup415: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup415: rmrk_traits::base::BaseInfo> + * Lookup416: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -3322,92 +3329,92 @@ export default { symbol: 'Bytes' }, /** - * Lookup416: rmrk_traits::nft::NftChild + * Lookup417: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup418: pallet_common::pallet::Error + * Lookup419: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup420: pallet_fungible::pallet::Error + * Lookup421: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup421: pallet_refungible::ItemData + * Lookup422: pallet_refungible::ItemData **/ PalletRefungibleItemData: { constData: 'Bytes' }, /** - * Lookup426: pallet_refungible::pallet::Error + * Lookup427: pallet_refungible::pallet::Error **/ PalletRefungibleError: { _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup427: pallet_nonfungible::ItemData> + * Lookup428: pallet_nonfungible::ItemData> **/ PalletNonfungibleItemData: { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup429: up_data_structs::PropertyScope + * Lookup430: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { _enum: ['None', 'Rmrk'] }, /** - * Lookup431: pallet_nonfungible::pallet::Error + * Lookup432: pallet_nonfungible::pallet::Error **/ PalletNonfungibleError: { _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup432: pallet_structure::pallet::Error + * Lookup433: pallet_structure::pallet::Error **/ PalletStructureError: { _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup433: pallet_rmrk_core::pallet::Error + * Lookup434: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** - * Lookup435: pallet_rmrk_equip::pallet::Error + * Lookup436: pallet_rmrk_equip::pallet::Error **/ PalletRmrkEquipError: { _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] }, /** - * Lookup441: pallet_app_promotion::pallet::Error + * Lookup442: pallet_app_promotion::pallet::Error **/ PalletAppPromotionError: { _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'SponsorNotSet', 'IncorrectLockedBalanceOperation'] }, /** - * Lookup442: pallet_foreign_assets::module::Error + * Lookup443: pallet_foreign_assets::module::Error **/ PalletForeignAssetsModuleError: { _enum: ['BadLocation', 'MultiLocationExisted', 'AssetIdNotExists', 'AssetIdExisted'] }, /** - * Lookup445: pallet_evm::pallet::Error + * Lookup446: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup448: fp_rpc::TransactionStatus + * Lookup449: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -3419,11 +3426,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup450: ethbloom::Bloom + * Lookup451: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup452: ethereum::receipt::ReceiptV3 + * Lookup453: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -3433,7 +3440,7 @@ export default { } }, /** - * Lookup453: ethereum::receipt::EIP658ReceiptData + * Lookup454: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -3442,7 +3449,7 @@ export default { logs: 'Vec' }, /** - * Lookup454: ethereum::block::Block + * Lookup455: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -3450,7 +3457,7 @@ export default { ommers: 'Vec' }, /** - * Lookup455: ethereum::header::Header + * Lookup456: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -3470,23 +3477,23 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup456: ethereum_types::hash::H64 + * Lookup457: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup461: pallet_ethereum::pallet::Error + * Lookup462: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup462: pallet_evm_coder_substrate::pallet::Error + * Lookup463: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup463: up_data_structs::SponsorshipState> + * Lookup464: up_data_structs::SponsorshipState> **/ UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: { _enum: { @@ -3496,25 +3503,25 @@ export default { } }, /** - * Lookup464: pallet_evm_contract_helpers::SponsoringModeT + * Lookup465: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup470: pallet_evm_contract_helpers::pallet::Error + * Lookup471: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission', 'NoPendingSponsor', 'TooManyMethodsHaveSponsoredLimit'] }, /** - * Lookup471: pallet_evm_migration::pallet::Error + * Lookup472: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup473: sp_runtime::MultiSignature + * Lookup474: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3524,47 +3531,47 @@ export default { } }, /** - * Lookup474: sp_core::ed25519::Signature + * Lookup475: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup476: sp_core::sr25519::Signature + * Lookup477: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup477: sp_core::ecdsa::Signature + * Lookup478: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup480: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup481: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup481: frame_system::extensions::check_tx_version::CheckTxVersion + * Lookup482: frame_system::extensions::check_tx_version::CheckTxVersion **/ FrameSystemExtensionsCheckTxVersion: 'Null', /** - * Lookup482: frame_system::extensions::check_genesis::CheckGenesis + * Lookup483: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup485: frame_system::extensions::check_nonce::CheckNonce + * Lookup486: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup486: frame_system::extensions::check_weight::CheckWeight + * Lookup487: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup487: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup488: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup488: opal_runtime::Runtime + * Lookup489: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup489: pallet_ethereum::FakeTransactionFinalizer + * Lookup490: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index 8357683f1a..a71554d8a7 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassWeight, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassWeight, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsRpcCollectionFlags, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { interface InterfaceTypes { @@ -232,6 +232,7 @@ declare module '@polkadot/types/types/registry' { UpDataStructsPropertyPermission: UpDataStructsPropertyPermission; UpDataStructsPropertyScope: UpDataStructsPropertyScope; UpDataStructsRpcCollection: UpDataStructsRpcCollection; + UpDataStructsRpcCollectionFlags: UpDataStructsRpcCollectionFlags; UpDataStructsSponsoringRateLimit: UpDataStructsSponsoringRateLimit; UpDataStructsSponsorshipStateAccountId32: UpDataStructsSponsorshipStateAccountId32; UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: UpDataStructsSponsorshipStateBasicCrossAccountIdRepr; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index cf8c465ed0..e21e5d6df4 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -3438,10 +3438,16 @@ declare module '@polkadot/types/lookup' { readonly tokenPropertyPermissions: Vec; readonly properties: Vec; readonly readOnly: bool; + readonly flags: UpDataStructsRpcCollectionFlags; + } + + /** @name UpDataStructsRpcCollectionFlags (409) */ + interface UpDataStructsRpcCollectionFlags extends Struct { readonly foreign: bool; + readonly erc721metadata: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (409) */ + /** @name RmrkTraitsCollectionCollectionInfo (410) */ interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; @@ -3450,7 +3456,7 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (410) */ + /** @name RmrkTraitsNftNftInfo (411) */ interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; @@ -3459,13 +3465,13 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (412) */ + /** @name RmrkTraitsNftRoyaltyInfo (413) */ interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (413) */ + /** @name RmrkTraitsResourceResourceInfo (414) */ interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; @@ -3473,26 +3479,26 @@ declare module '@polkadot/types/lookup' { readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (414) */ + /** @name RmrkTraitsPropertyPropertyInfo (415) */ interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (415) */ + /** @name RmrkTraitsBaseBaseInfo (416) */ interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (416) */ + /** @name RmrkTraitsNftNftChild (417) */ interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (418) */ + /** @name PalletCommonError (419) */ interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; @@ -3531,7 +3537,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (420) */ + /** @name PalletFungibleError (421) */ interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; @@ -3541,12 +3547,12 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (421) */ + /** @name PalletRefungibleItemData (422) */ interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } - /** @name PalletRefungibleError (426) */ + /** @name PalletRefungibleError (427) */ interface PalletRefungibleError extends Enum { readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isWrongRefungiblePieces: boolean; @@ -3556,19 +3562,19 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletNonfungibleItemData (427) */ + /** @name PalletNonfungibleItemData (428) */ interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (429) */ + /** @name UpDataStructsPropertyScope (430) */ interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; readonly type: 'None' | 'Rmrk'; } - /** @name PalletNonfungibleError (431) */ + /** @name PalletNonfungibleError (432) */ interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; @@ -3576,7 +3582,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (432) */ + /** @name PalletStructureError (433) */ interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; @@ -3585,7 +3591,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletRmrkCoreError (433) */ + /** @name PalletRmrkCoreError (434) */ interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; @@ -3609,7 +3615,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } - /** @name PalletRmrkEquipError (435) */ + /** @name PalletRmrkEquipError (436) */ interface PalletRmrkEquipError extends Enum { readonly isPermissionError: boolean; readonly isNoAvailableBaseId: boolean; @@ -3621,7 +3627,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; } - /** @name PalletAppPromotionError (441) */ + /** @name PalletAppPromotionError (442) */ interface PalletAppPromotionError extends Enum { readonly isAdminNotSet: boolean; readonly isNoPermission: boolean; @@ -3632,7 +3638,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'IncorrectLockedBalanceOperation'; } - /** @name PalletForeignAssetsModuleError (442) */ + /** @name PalletForeignAssetsModuleError (443) */ interface PalletForeignAssetsModuleError extends Enum { readonly isBadLocation: boolean; readonly isMultiLocationExisted: boolean; @@ -3641,7 +3647,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted'; } - /** @name PalletEvmError (445) */ + /** @name PalletEvmError (446) */ interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; @@ -3652,7 +3658,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (448) */ + /** @name FpRpcTransactionStatus (449) */ interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; @@ -3663,10 +3669,10 @@ declare module '@polkadot/types/lookup' { readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (450) */ + /** @name EthbloomBloom (451) */ interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (452) */ + /** @name EthereumReceiptReceiptV3 (453) */ interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; @@ -3677,7 +3683,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (453) */ + /** @name EthereumReceiptEip658ReceiptData (454) */ interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; @@ -3685,14 +3691,14 @@ declare module '@polkadot/types/lookup' { readonly logs: Vec; } - /** @name EthereumBlock (454) */ + /** @name EthereumBlock (455) */ interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (455) */ + /** @name EthereumHeader (456) */ interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; @@ -3711,24 +3717,24 @@ declare module '@polkadot/types/lookup' { readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (456) */ + /** @name EthereumTypesHashH64 (457) */ interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (461) */ + /** @name PalletEthereumError (462) */ interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (462) */ + /** @name PalletEvmCoderSubstrateError (463) */ interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (463) */ + /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (464) */ interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3738,7 +3744,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name PalletEvmContractHelpersSponsoringModeT (464) */ + /** @name PalletEvmContractHelpersSponsoringModeT (465) */ interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; @@ -3746,7 +3752,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (470) */ + /** @name PalletEvmContractHelpersError (471) */ interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly isNoPendingSponsor: boolean; @@ -3754,14 +3760,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'NoPermission' | 'NoPendingSponsor' | 'TooManyMethodsHaveSponsoredLimit'; } - /** @name PalletEvmMigrationError (471) */ + /** @name PalletEvmMigrationError (472) */ interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (473) */ + /** @name SpRuntimeMultiSignature (474) */ interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; @@ -3772,37 +3778,37 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (474) */ + /** @name SpCoreEd25519Signature (475) */ interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (476) */ + /** @name SpCoreSr25519Signature (477) */ interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (477) */ + /** @name SpCoreEcdsaSignature (478) */ interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (480) */ + /** @name FrameSystemExtensionsCheckSpecVersion (481) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckTxVersion (481) */ + /** @name FrameSystemExtensionsCheckTxVersion (482) */ type FrameSystemExtensionsCheckTxVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (482) */ + /** @name FrameSystemExtensionsCheckGenesis (483) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (485) */ + /** @name FrameSystemExtensionsCheckNonce (486) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (486) */ + /** @name FrameSystemExtensionsCheckWeight (487) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (487) */ + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (488) */ interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (488) */ + /** @name OpalRuntimeRuntime (489) */ type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (489) */ + /** @name PalletEthereumFakeTransactionFinalizer (490) */ type PalletEthereumFakeTransactionFinalizer = Null; } // declare module From 8e0e4b0aac489de3815f75451d27c3815d5ec067 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Oct 2022 13:12:52 +0000 Subject: [PATCH 1224/1274] ci: fix live chain git references Signed-off-by: Yaroslav Bolyukin --- .env | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 3b592e7b72..a90b1c3d83 100644 --- a/.env +++ b/.env @@ -5,18 +5,18 @@ POLKADOT_MAINNET_BRANCH=release-v0.9.28 STATEMINT_BUILD_BRANCH=release-parachains-v9271 ACALA_BUILD_BRANCH=2.9.6 MOONBEAM_BUILD_BRANCH=v0.26.1 -UNIQUE_MAINNET_TAG=v924010 +UNIQUE_MAINNET_TAG=v924010-old-tests-fixes UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443 KUSAMA_MAINNET_BRANCH=release-v0.9.29 STATEMINE_BUILD_BRANCH=parachains-v9271 KARURA_BUILD_BRANCH=release-karura-2.9.5 MOONRIVER_BUILD_BRANCH=v0.26.1 -QUARTZ_MAINNET_TAG=quartz-v924012-2 +QUARTZ_MAINNET_TAG=quartz-v924012-2-old-tests-fixes QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443 UNQWND_MAINNET_BRANCH=release-v0.9.30 WESTMINT_BUILD_BRANCH=parachains-v9290 -OPAL_MAINNET_TAG=quartz-v924012-2-opal-runtime-feature +OPAL_MAINNET_TAG=quartz-v924012-2-old-tests-fixes OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443 POLKADOT_LAUNCH_BRANCH=unique-network From 6a048d7eaf42c0ea712368e67911510b507f2ade Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 21 Oct 2022 17:29:15 +0700 Subject: [PATCH 1225/1274] rename node-only-update_v3 to integration-tests --- .github/workflows/ci-develop.yml | 6 +++--- .../{node-only-update_v3.yml => integration-tests.yml} | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) rename .github/workflows/{node-only-update_v3.yml => integration-tests.yml} (99%) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index f1f090c0b5..de1d80e000 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -40,12 +40,12 @@ jobs: uses: ./.github/workflows/forkless.yml node-only-update: - if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }} # Conditional check for draft & labels per job. + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'node-only-update')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/node-only-update_v2.yml parallel_and_sequential_tests: - if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'para')) }} # Conditional check for draft & labels per job. - uses: ./.github/workflows/node-only-update_v3.yml + if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'integration')) }} # Conditional check for draft & labels per job. + uses: ./.github/workflows/integration-tests.yml codestyle: if: github.event.pull_request.draft == false # Conditional check for draft per job. diff --git a/.github/workflows/node-only-update_v3.yml b/.github/workflows/integration-tests.yml similarity index 99% rename from .github/workflows/node-only-update_v3.yml rename to .github/workflows/integration-tests.yml index be28b05494..1fe61eef77 100644 --- a/.github/workflows/node-only-update_v3.yml +++ b/.github/workflows/integration-tests.yml @@ -1,5 +1,5 @@ # Test workflow for debug parallel and sequental tests in scope of execution time reducing. -name: Parallele tests +name: Integration tests # Triger: only call from main workflow(re-usable workflows) on: @@ -195,8 +195,6 @@ jobs: # The type of runner that the job will run on runs-on: [self-hosted-ci,large] - - timeout-minutes: 1380 name: ${{ matrix.network }} - sequential From 92cf6f17adaa72991842c5f69f7d15d28622ca23 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Oct 2022 19:46:38 +0000 Subject: [PATCH 1226/1274] build: upgrade polkadot to v0.9.30 Signed-off-by: Yaroslav Bolyukin --- .docker/additional/xcm-rococo/.env | 2 +- .env | 2 +- Cargo.lock | 1958 ++++++++++------- Cargo.toml | 20 + README.md | 2 +- client/rpc/Cargo.toml | 12 +- crates/evm-coder/Cargo.toml | 6 +- node/cli/Cargo.toml | 133 +- node/cli/src/cli.rs | 1 + node/cli/src/command.rs | 9 +- node/cli/src/service.rs | 18 +- node/rpc/Cargo.toml | 64 +- pallets/app-promotion/Cargo.toml | 22 +- pallets/app-promotion/src/lib.rs | 4 +- pallets/common/Cargo.toml | 16 +- pallets/common/src/dispatch.rs | 2 +- pallets/common/src/lib.rs | 4 +- pallets/configuration/Cargo.toml | 14 +- pallets/evm-coder-substrate/Cargo.toml | 14 +- pallets/evm-contract-helpers/Cargo.toml | 16 +- pallets/evm-contract-helpers/src/lib.rs | 2 +- .../src/stubs/ContractHelpers.raw | Bin 1848 -> 1848 bytes pallets/evm-migration/Cargo.toml | 18 +- pallets/evm-transaction-payment/Cargo.toml | 22 +- pallets/foreign-assets/Cargo.toml | 29 +- pallets/foreign-assets/src/lib.rs | 4 +- pallets/fungible/Cargo.toml | 14 +- pallets/fungible/src/stubs/UniqueFungible.raw | Bin 3219 -> 3226 bytes pallets/inflation/Cargo.toml | 20 +- pallets/inflation/src/tests.rs | 8 +- pallets/nonfungible/Cargo.toml | 14 +- pallets/nonfungible/src/lib.rs | 2 +- pallets/proxy-rmrk-core/Cargo.toml | 14 +- pallets/proxy-rmrk-core/src/lib.rs | 2 +- pallets/proxy-rmrk-equip/Cargo.toml | 14 +- pallets/proxy-rmrk-equip/src/lib.rs | 2 +- pallets/refungible/Cargo.toml | 14 +- pallets/scheduler/Cargo.toml | 20 +- pallets/scheduler/src/lib.rs | 50 +- pallets/structure/Cargo.toml | 10 +- pallets/structure/src/lib.rs | 6 +- pallets/unique/Cargo.toml | 16 +- .../src/eth/stubs/CollectionHelpers.raw | Bin 1502 -> 1502 bytes pallets/unique/src/lib.rs | 4 +- primitives/app_promotion_rpc/Cargo.toml | 10 +- primitives/common/Cargo.toml | 16 +- primitives/data-structs/Cargo.toml | 12 +- primitives/rmrk-rpc/Cargo.toml | 8 +- primitives/rpc/Cargo.toml | 10 +- runtime/common/config/ethereum.rs | 8 +- runtime/common/config/orml.rs | 11 +- .../common/config/pallets/app_promotion.rs | 4 +- .../common/config/pallets/foreign_asset.rs | 4 +- runtime/common/config/pallets/mod.rs | 10 +- runtime/common/config/pallets/rmrk.rs | 6 +- runtime/common/config/pallets/scheduler.rs | 6 +- runtime/common/config/parachain.rs | 4 +- runtime/common/config/substrate.rs | 23 +- runtime/common/config/xcm/mod.rs | 42 +- .../common/ethereum/self_contained_call.rs | 22 +- runtime/common/mod.rs | 10 +- runtime/common/runtime_apis.rs | 2 +- runtime/common/tests/xcm.rs | 16 +- runtime/opal/Cargo.toml | 144 +- runtime/quartz/Cargo.toml | 144 +- runtime/tests/Cargo.toml | 26 +- runtime/tests/src/lib.rs | 22 +- runtime/tests/src/tests.rs | 172 +- runtime/unique/Cargo.toml | 142 +- 69 files changed, 1876 insertions(+), 1602 deletions(-) diff --git a/.docker/additional/xcm-rococo/.env b/.docker/additional/xcm-rococo/.env index 41356b6460..2458f34215 100644 --- a/.docker/additional/xcm-rococo/.env +++ b/.docker/additional/xcm-rococo/.env @@ -1,7 +1,7 @@ RUST_TOOLCHAIN=nightly-2022-07-24 UNIQUE_BRANCH="develop" -POLKADOT_BUILD_BRANCH=release-v0.9.29 +POLKADOT_BUILD_BRANCH=release-v0.9.30 KARURA_BUILD_BRANCH=2.9.1 ACALA_BUILD_BRANCH=2.9.2 diff --git a/.env b/.env index a90b1c3d83..cdb56a584e 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ RUST_TOOLCHAIN=nightly-2022-07-24 -POLKADOT_BUILD_BRANCH=release-v0.9.29 +POLKADOT_BUILD_BRANCH=release-v0.9.30 POLKADOT_MAINNET_BRANCH=release-v0.9.28 STATEMINT_BUILD_BRANCH=release-parachains-v9271 diff --git a/Cargo.lock b/Cargo.lock index ee89308fab..409d075463 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,7 +43,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ "cfg-if 1.0.0", - "cipher", + "cipher 0.3.0", "cpufeatures", "opaque-debug 0.3.0", ] @@ -56,7 +56,7 @@ checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" dependencies = [ "aead", "aes", - "cipher", + "cipher 0.3.0", "ctr", "ghash", "subtle", @@ -135,6 +135,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "array-bytes" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a913633b0c922e6b745072795f50d90ebea78ba31a57e2ac8c2fc7b50950949" + [[package]] name = "arrayref" version = "0.3.6" @@ -322,9 +328,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "async-trait" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" +checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" dependencies = [ "proc-macro2", "quote", @@ -404,7 +410,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.29.0", + "object", "rustc-demangle", ] @@ -432,6 +438,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64ct" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" + [[package]] name = "beef" version = "0.5.2" @@ -444,14 +456,14 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "async-trait", "beefy-primitives", "fnv", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", - "hex", "log", "parity-scale-codec 3.2.1", "parking_lot 0.12.1", @@ -461,6 +473,7 @@ dependencies = [ "sc-finality-grandpa", "sc-keystore", "sc-network", + "sc-network-common", "sc-network-gossip", "sc-utils", "sp-api", @@ -480,11 +493,11 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "beefy-gadget", "beefy-primitives", - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee", "log", "parity-scale-codec 3.2.1", @@ -500,7 +513,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "beefy-primitives", "sp-api", @@ -509,7 +522,7 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -645,7 +658,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "block-padding 0.1.5", + "block-padding", "byte-tools", "byteorder", "generic-array 0.12.4", @@ -657,7 +670,6 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "block-padding 0.2.1", "generic-array 0.14.6", ] @@ -679,12 +691,6 @@ dependencies = [ "byte-tools", ] -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - [[package]] name = "blocking" version = "1.2.0" @@ -754,9 +760,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.0" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "byte-slice-cast" @@ -882,7 +888,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" dependencies = [ "cfg-if 1.0.0", - "cipher", + "cipher 0.3.0", "cpufeatures", "zeroize", ] @@ -895,7 +901,7 @@ checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" dependencies = [ "aead", "chacha20", - "cipher", + "cipher 0.3.0", "poly1305", "zeroize", ] @@ -937,6 +943,16 @@ dependencies = [ "generic-array 0.14.6", ] +[[package]] +name = "cipher" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e" +dependencies = [ + "crypto-common", + "inout", +] + [[package]] name = "ckb-merkle-mountain-range" version = "0.3.2" @@ -1017,11 +1033,21 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "comfy-table" -version = "6.1.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85914173c2f558d61613bfbbf1911f14e630895087a7ed2fafc0f5319e1536e7" +checksum = "7b3d16bb3da60be2f7c7acfc438f2ae6f3496897ce68c291d0509bb67b4e248e" dependencies = [ "strum", "strum_macros", @@ -1100,19 +1126,21 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.85.3" +version = "0.88.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "749d0d6022c9038dccf480bdde2a38d435937335bf2bb0f14e815d94517cdce8" +checksum = "44409ccf2d0f663920cab563d2b79fcd6b2e9a2bcc6e929fef76c8f82ad6c17a" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.85.3" +version = "0.88.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94370cc7b37bf652ccd8bb8f09bd900997f7ccf97520edfc75554bb5c4abbea" +checksum = "98de2018ad96eb97f621f7d6b900a0cc661aec8d02ea4a50e56ecb48e5a2fcaf" dependencies = [ + "arrayvec 0.7.2", + "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", @@ -1127,33 +1155,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.85.3" +version = "0.88.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a3cea8fdab90e44018c5b9a1dfd460d8ee265ac354337150222a354628bdb6" +checksum = "5287ce36e6c4758fbaf298bd1a8697ad97a4f2375a3d1b61142ea538db4877e5" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.85.3" +version = "0.88.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ac72f76f2698598951ab26d8c96eaa854810e693e7dd52523958b5909fde6b2" +checksum = "2855c24219e2f08827f3f4ffb2da92e134ae8d8ecc185b11ec8f9878cf5f588e" [[package]] name = "cranelift-entity" -version = "0.85.3" +version = "0.88.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09eaeacfcd2356fe0e66b295e8f9d59fdd1ac3ace53ba50de14d628ec902f72d" +checksum = "0b65673279d75d34bf11af9660ae2dbd1c22e6d28f163f5c72f4e1dc56d56103" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.85.3" +version = "0.88.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba69c9980d5ffd62c18a2bde927855fcd7c8dc92f29feaf8636052662cbd99c" +checksum = "3ed2b3d7a4751163f6c4a349205ab1b7d9c00eecf19dcea48592ef1f7688eefc" dependencies = [ "cranelift-codegen", "log", @@ -1163,15 +1191,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.85.3" +version = "0.88.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2920dc1e05cac40304456ed3301fde2c09bd6a9b0210bcfa2f101398d628d5b" +checksum = "3be64cecea9d90105fc6a2ba2d003e98c867c1d6c4c86cc878f97ad9fb916293" [[package]] name = "cranelift-native" -version = "0.85.3" +version = "0.88.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04dfa45f9b2a6f587c564d6b63388e00cd6589d2df6ea2758cf79e1a13285e6" +checksum = "c4a03a6ac1b063e416ca4b93f6247978c991475e8271465340caa6f92f3c16a4" dependencies = [ "cranelift-codegen", "libc", @@ -1180,9 +1208,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.85.3" +version = "0.88.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31a46513ae6f26f3f267d8d75b5373d555fbbd1e68681f348d99df43f747ec54" +checksum = "c699873f7b30bc5f20dd03a796b4183e073a46616c91704792ec35e45d13f913" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1306,9 +1334,9 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", "syn", @@ -1320,7 +1348,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" dependencies = [ - "cipher", + "cipher 0.3.0", ] [[package]] @@ -1337,7 +1365,7 @@ dependencies = [ [[package]] name = "cumulus-client-cli" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "clap", "parity-scale-codec 3.2.1", @@ -1352,13 +1380,13 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.24", + "futures 0.3.25", "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "polkadot-node-primitives", @@ -1376,12 +1404,12 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "async-trait", "cumulus-client-consensus-common", "cumulus-primitives-core", - "futures 0.3.24", + "futures 0.3.25", "parity-scale-codec 3.2.1", "sc-client-api", "sc-consensus", @@ -1405,12 +1433,12 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "async-trait", "cumulus-relay-chain-interface", "dyn-clone", - "futures 0.3.24", + "futures 0.3.25", "parity-scale-codec 3.2.1", "polkadot-primitives", "sc-client-api", @@ -1426,12 +1454,12 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "async-trait", "cumulus-relay-chain-interface", "derive_more", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "parity-scale-codec 3.2.1", "parking_lot 0.12.1", @@ -1451,11 +1479,11 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "parity-scale-codec 3.2.1", "polkadot-node-primitives", @@ -1475,7 +1503,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -1503,7 +1531,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "frame-executive", "frame-support", @@ -1521,7 +1549,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-dmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1539,7 +1567,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -1570,7 +1598,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1581,7 +1609,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1598,7 +1626,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1616,7 +1644,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "frame-support", "parity-scale-codec 3.2.1", @@ -1632,7 +1660,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1655,10 +1683,10 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", - "futures 0.3.24", + "futures 0.3.25", "parity-scale-codec 3.2.1", "sp-inherents", "sp-std", @@ -1668,7 +1696,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1688,12 +1716,12 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "polkadot-cli", "polkadot-client", @@ -1717,12 +1745,12 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "async-trait", "cumulus-primitives-core", "derive_more", - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee-core", "parity-scale-codec 3.2.1", "parking_lot 0.12.1", @@ -1740,13 +1768,13 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "async-trait", "backoff", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "jsonrpsee", "parity-scale-codec 3.2.1", @@ -1767,7 +1795,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", "parity-scale-codec 3.2.1", @@ -1816,6 +1844,50 @@ dependencies = [ "zeroize", ] +[[package]] +name = "cxx" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f83d0ebf42c6eafb8d7c52f7e5f2d3003b89c7aa4fd2b79229209459a849af8" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07d050484b55975889284352b0ffc2ecbda25c0c55978017c132b29ba0818a86" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d2199b00553eda8012dfec8d3b1c75fce747cf27c169a270b3b99e3448ab78" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb67a6de1f602736dd7eaead0080cf3435df806c61b24b13328db128c58868f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "data-encoding" version = "2.3.2" @@ -1963,9 +2035,9 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "dtoa" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6053ff46b5639ceb91756a85a4c8914668393a03170efd79c8884a529d80656" +checksum = "f8a6eee2d5d0d113f015688310da018bd1d864d86bd567c8fca9c266889e1bfa" [[package]] name = "dyn-clonable" @@ -2180,7 +2252,7 @@ dependencies = [ "rlp-derive", "scale-info", "serde", - "sha3 0.10.5", + "sha3", "triehash", ] @@ -2209,7 +2281,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "evm" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.29#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.30#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "auto_impl", "environmental", @@ -2223,7 +2295,7 @@ dependencies = [ "rlp", "scale-info", "serde", - "sha3 0.10.5", + "sha3", ] [[package]] @@ -2249,14 +2321,14 @@ dependencies = [ "hex", "proc-macro2", "quote", - "sha3 0.10.5", + "sha3", "syn", ] [[package]] name = "evm-core" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.29#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.30#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "parity-scale-codec 3.2.1", "primitive-types", @@ -2267,7 +2339,7 @@ dependencies = [ [[package]] name = "evm-gasometer" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.29#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.30#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "environmental", "evm-core", @@ -2278,13 +2350,13 @@ dependencies = [ [[package]] name = "evm-runtime" version = "0.35.0" -source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.29#e9252ed42dc26fc85b6703b1ba50660a08209e55" +source = "git+https://github.com/uniquenetwork/evm?branch=unique-polkadot-v0.9.30#e9252ed42dc26fc85b6703b1ba50660a08209e55" dependencies = [ "auto_impl", "environmental", "evm-core", "primitive-types", - "sha3 0.10.5", + "sha3", ] [[package]] @@ -2293,7 +2365,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", ] [[package]] @@ -2370,7 +2442,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" dependencies = [ "async-trait", "fc-db", @@ -2389,7 +2461,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -2405,12 +2477,12 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" dependencies = [ "fc-db", "fp-consensus", "fp-rpc", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "log", "sc-client-api", @@ -2422,7 +2494,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" dependencies = [ "ethereum", "ethereum-types", @@ -2431,7 +2503,7 @@ dependencies = [ "fc-rpc-core", "fp-rpc", "fp-storage", - "futures 0.3.24", + "futures 0.3.25", "hex", "jsonrpsee", "libsecp256k1", @@ -2464,7 +2536,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" dependencies = [ "ethereum", "ethereum-types", @@ -2506,14 +2578,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" +checksum = "4b9663d381d07ae25dc88dbdf27df458faa83a9b25336bcac83d5e452b5fc9d3" dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2523,7 +2595,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b22349c6a11563a202d95772a68e0fcf56119e74ea8a2a19cf2301460fcd0df5" dependencies = [ "either", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "log", "num-traits", @@ -2587,7 +2659,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", ] @@ -2604,7 +2676,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" dependencies = [ "ethereum", "parity-scale-codec 3.2.1", @@ -2616,7 +2688,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" dependencies = [ "evm", "frame-support", @@ -2630,7 +2702,7 @@ dependencies = [ [[package]] name = "fp-evm-mapping" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" dependencies = [ "frame-support", "sp-core", @@ -2639,7 +2711,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" dependencies = [ "ethereum", "ethereum-types", @@ -2656,7 +2728,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" dependencies = [ "ethereum", "frame-support", @@ -2672,7 +2744,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" dependencies = [ "parity-scale-codec 3.2.1", ] @@ -2680,7 +2752,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -2703,9 +2775,10 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "Inflector", + "array-bytes", "chrono", "clap", "comfy-table", @@ -2715,7 +2788,6 @@ dependencies = [ "gethostname", "handlebars", "hash-db", - "hex", "itertools", "kvdb", "lazy_static", @@ -2754,7 +2826,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2765,7 +2837,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2781,7 +2853,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -2810,7 +2882,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "bitflags", "frame-metadata", @@ -2835,13 +2907,14 @@ dependencies = [ "sp-state-machine", "sp-std", "sp-tracing", + "sp-weights", "tt-call", ] [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "Inflector", "cfg-expr", @@ -2855,7 +2928,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2867,7 +2940,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "proc-macro2", "quote", @@ -2877,7 +2950,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "log", @@ -2889,12 +2962,13 @@ dependencies = [ "sp-runtime", "sp-std", "sp-version", + "sp-weights", ] [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -2909,7 +2983,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "sp-api", @@ -2918,7 +2992,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "parity-scale-codec 3.2.1", @@ -2981,9 +3055,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" dependencies = [ "futures-channel", "futures-core", @@ -2996,9 +3070,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", "futures-sink", @@ -3006,15 +3080,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" [[package]] name = "futures-executor" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" dependencies = [ "futures-core", "futures-task", @@ -3024,9 +3098,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" [[package]] name = "futures-lite" @@ -3045,9 +3119,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ "proc-macro2", "quote", @@ -3067,15 +3141,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" [[package]] name = "futures-task" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" [[package]] name = "futures-timer" @@ -3085,9 +3159,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures 0.1.31", "futures-channel", @@ -3248,9 +3322,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.3.4" +version = "4.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56b224eaa4987c03c30b251de7ef0c15a6a59f34222905850dbc3026dfb24d5f" +checksum = "433e4ab33f1213cdc25b5fa45c76881240cfe79284cf2b395e8b9e312a30a2fd" dependencies = [ "log", "pest", @@ -3275,15 +3349,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -3376,7 +3441,7 @@ checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", - "itoa 1.0.3", + "itoa", ] [[package]] @@ -3423,7 +3488,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.3", + "itoa", "pin-project-lite 0.2.9", "socket2", "tokio", @@ -3449,17 +3514,28 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.50" +version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd911b35d940d2bd0bea0f9100068e5b97b51a1cbe13d13382f132e0365257a0" +checksum = "f5a6ef98976b22b3b7f2f3a806f858cb862044cfa66805aa3ad84cb3d3b785ed" dependencies = [ "android_system_properties", "core-foundation-sys", + "iana-time-zone-haiku", "js-sys", "wasm-bindgen", "winapi", ] +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + [[package]] name = "idna" version = "0.2.3" @@ -3500,7 +3576,7 @@ dependencies = [ "async-io", "core-foundation", "fnv", - "futures 0.3.24", + "futures 0.3.25", "if-addrs", "ipnet", "log", @@ -3554,10 +3630,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", - "hashbrown 0.12.3", + "hashbrown", "serde", ] +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array 0.14.6", +] + [[package]] name = "instant" version = "0.1.12" @@ -3582,12 +3667,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "io-lifetimes" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec58677acfea8a15352d42fc87d11d63596ade9239e0a7c9352914417515dbe6" - [[package]] name = "io-lifetimes" version = "0.7.3" @@ -3629,15 +3708,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[package]] -name = "itoa" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" [[package]] name = "jobserver" @@ -3821,8 +3894,8 @@ checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" [[package]] name = "kusama-runtime" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -3849,6 +3922,7 @@ dependencies = [ "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", "pallet-elections-phragmen", + "pallet-fast-unstake", "pallet-gilt", "pallet-grandpa", "pallet-identity", @@ -3914,8 +3988,8 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-support", "polkadot-primitives", @@ -3986,9 +4060,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.134" +version = "0.2.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb" +checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" [[package]] name = "libloading" @@ -4023,7 +4097,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81327106887e42d004fbdab1fef93675be2e2e07c1b95fce45e2cc813485611d" dependencies = [ "bytes", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "getrandom 0.2.7", "instant", @@ -4067,15 +4141,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4decc51f3573653a9f4ecacb31b1b922dd20c25a6322bb15318ec04287ec46f9" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "instant", "libp2p-core", "libp2p-request-response", "libp2p-swarm", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.8.5", ] @@ -4090,7 +4164,7 @@ dependencies = [ "ed25519-dalek", "either", "fnv", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "instant", "lazy_static", @@ -4101,8 +4175,8 @@ dependencies = [ "multistream-select", "parking_lot 0.12.1", "pin-project", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.8.5", "ring", "rw-stream-sink", @@ -4121,7 +4195,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0183dc2a3da1fbbf85e5b6cf51217f55b14f5daea0c455a9536eef646bfec71" dependencies = [ "flate2", - "futures 0.3.24", + "futures 0.3.25", "libp2p-core", ] @@ -4132,7 +4206,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6cbf54723250fa5d521383be789bf60efdabe6bacfb443f87da261019a49b4b5" dependencies = [ "async-std-resolver", - "futures 0.3.24", + "futures 0.3.25", "libp2p-core", "log", "parking_lot 0.12.1", @@ -4148,12 +4222,12 @@ checksum = "98a4b6ffd53e355775d24b76f583fdda54b3284806f678499b57913adb94f231" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.24", + "futures 0.3.25", "libp2p-core", "libp2p-swarm", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.7.3", "smallvec", ] @@ -4169,15 +4243,15 @@ dependencies = [ "byteorder", "bytes", "fnv", - "futures 0.3.24", + "futures 0.3.25", "hex_fmt", "instant", "libp2p-core", "libp2p-swarm", "log", "prometheus-client", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.7.3", "regex", "sha2 0.10.6", @@ -4193,14 +4267,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c50b585518f8efd06f93ac2f976bd672e17cdac794644b3117edd078e96bda06" dependencies = [ "asynchronous-codec", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "libp2p-core", "libp2p-swarm", "log", "lru 0.7.8", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "prost-codec", "smallvec", "thiserror", @@ -4218,14 +4292,14 @@ dependencies = [ "bytes", "either", "fnv", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "instant", "libp2p-core", "libp2p-swarm", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.7.3", "sha2 0.10.6", "smallvec", @@ -4244,7 +4318,7 @@ dependencies = [ "async-io", "data-encoding", "dns-parser", - "futures 0.3.24", + "futures 0.3.25", "if-watch", "lazy_static", "libp2p-core", @@ -4280,7 +4354,7 @@ checksum = "61fd1b20638ec209c5075dfb2e8ce6a7ea4ec3cd3ad7b77f7a477c06d53322e2" dependencies = [ "asynchronous-codec", "bytes", - "futures 0.3.24", + "futures 0.3.25", "libp2p-core", "log", "nohash-hasher", @@ -4298,12 +4372,12 @@ checksum = "762408cb5d84b49a600422d7f9a42c18012d8da6ebcd570f9a4a4290ba41fb6f" dependencies = [ "bytes", "curve25519-dalek 3.2.0", - "futures 0.3.24", + "futures 0.3.25", "lazy_static", "libp2p-core", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.8.5", "sha2 0.10.6", "snow", @@ -4318,7 +4392,7 @@ version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "100a6934ae1dbf8a693a4e7dd1d730fd60b774dafc45688ed63b554497c6c925" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "instant", "libp2p-core", @@ -4336,27 +4410,27 @@ checksum = "be27bf0820a6238a4e06365b096d428271cce85a129cf16f2fe9eb1610c4df86" dependencies = [ "asynchronous-codec", "bytes", - "futures 0.3.24", + "futures 0.3.25", "libp2p-core", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "unsigned-varint", "void", ] [[package]] name = "libp2p-pnet" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1a458bbda880107b5b36fcb9b5a1ef0c329685da0e203ed692a8ebe64cc92c" +checksum = "1a5a702574223aa55d8878bdc8bf55c84a6086f87ddaddc28ce730b4caa81538" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "log", "pin-project", - "rand 0.7.3", + "rand 0.8.5", "salsa20", - "sha3 0.9.1", + "sha3", ] [[package]] @@ -4368,15 +4442,15 @@ dependencies = [ "asynchronous-codec", "bytes", "either", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "instant", "libp2p-core", "libp2p-swarm", "log", "pin-project", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "prost-codec", "rand 0.8.5", "smallvec", @@ -4393,14 +4467,14 @@ checksum = "9511c9672ba33284838e349623319c8cad2d18cfad243ae46c6b7e8a2982ea4e" dependencies = [ "asynchronous-codec", "bimap", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "instant", "libp2p-core", "libp2p-swarm", "log", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.8.5", "sha2 0.10.6", "thiserror", @@ -4416,7 +4490,7 @@ checksum = "508a189e2795d892c8f5c1fa1e9e0b1845d32d7b0b249dbf7b05b18811361843" dependencies = [ "async-trait", "bytes", - "futures 0.3.24", + "futures 0.3.25", "instant", "libp2p-core", "libp2p-swarm", @@ -4434,7 +4508,7 @@ checksum = "95ac5be6c2de2d1ff3f7693fda6faf8a827b1f3e808202277783fea9f527d114" dependencies = [ "either", "fnv", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "instant", "libp2p-core", @@ -4463,7 +4537,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a6771dc19aa3c65d6af9a8c65222bfc8fcd446630ddca487acd161fa6096f3b" dependencies = [ "async-io", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "if-watch", "ipnet", @@ -4480,7 +4554,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d125e3e5f0d58f3c6ac21815b20cf4b6a88b8db9dc26368ea821838f4161fd4d" dependencies = [ "async-std", - "futures 0.3.24", + "futures 0.3.25", "libp2p-core", "log", ] @@ -4491,7 +4565,7 @@ version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec894790eec3c1608f8d1a8a0bdf0dbeb79ed4de2dce964222011c2896dfa05a" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -4506,7 +4580,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9808e57e81be76ff841c106b4c5974fb4d41a233a7bdd2afbf1687ac6def3818" dependencies = [ "either", - "futures 0.3.24", + "futures 0.3.25", "futures-rustls", "libp2p-core", "log", @@ -4524,7 +4598,7 @@ version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6dea686217a06072033dc025631932810e2f6ad784e4fafa42e27d311c7a81c" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "libp2p-core", "parking_lot 0.12.1", "thiserror", @@ -4605,6 +4679,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "link-cplusplus" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +dependencies = [ + "cc", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -4630,12 +4713,6 @@ dependencies = [ "statrs", ] -[[package]] -name = "linux-raw-sys" -version = "0.0.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5284f00d480e1c39af34e72f8ad60b94f47007e3481cd3b731c1d67190ddc7b7" - [[package]] name = "linux-raw-sys" version = "0.0.46" @@ -4678,7 +4755,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" dependencies = [ - "hashbrown 0.12.3", + "hashbrown", ] [[package]] @@ -4687,7 +4764,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" dependencies = [ - "hashbrown 0.12.3", + "hashbrown", ] [[package]] @@ -4766,11 +4843,11 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memfd" -version = "0.4.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6627dc657574b49d6ad27105ed671822be56e0d2547d413bfbf3e8d8fa92e7a" +checksum = "480b5a5de855d11ff13195950bdc8b98b5e942ef47afc447f6615cdcc4e15d80" dependencies = [ - "libc", + "rustix", ] [[package]] @@ -4798,7 +4875,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" dependencies = [ "hash-db", - "hashbrown 0.12.3", + "hashbrown", "parity-util-mem", ] @@ -4813,9 +4890,9 @@ dependencies = [ [[package]] name = "memory_units" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" [[package]] name = "merlin" @@ -4835,7 +4912,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "rand 0.8.5", "thrift", ] @@ -4864,15 +4941,9 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.36.1", ] -[[package]] -name = "more-asserts" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" - [[package]] name = "multiaddr" version = "0.14.0" @@ -4915,7 +4986,7 @@ dependencies = [ "digest 0.10.5", "multihash-derive", "sha2 0.10.6", - "sha3 0.10.5", + "sha3", "unsigned-varint", ] @@ -4946,7 +5017,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "363a84be6453a70e63513660f4894ef815daf88e3356bffcda9ca27d810ce83b" dependencies = [ "bytes", - "futures 0.3.24", + "futures 0.3.25", "log", "pin-project", "smallvec", @@ -5042,7 +5113,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ "bytes", - "futures 0.3.24", + "futures 0.3.25", "log", "netlink-packet-core", "netlink-sys", @@ -5058,7 +5129,7 @@ checksum = "92b654097027250401127914afb37cb1f311df6610a9891ff07a757e94199027" dependencies = [ "async-io", "bytes", - "futures 0.3.24", + "futures 0.3.25", "libc", "log", ] @@ -5107,6 +5178,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-complex" version = "0.4.2" @@ -5118,12 +5200,12 @@ dependencies = [ [[package]] name = "num-format" -version = "0.4.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bafe4179722c2894288ee77a9f044f02811c86af699344c498b0840c698a2465" +checksum = "54b862ff8df690cf089058c98b183676a7ed0f974cc08b426800093227cbff3b" dependencies = [ - "arrayvec 0.4.12", - "itoa 0.4.8", + "arrayvec 0.7.2", + "itoa", ] [[package]] @@ -5143,7 +5225,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" dependencies = [ "autocfg", - "num-bigint", + "num-bigint 0.2.6", "num-integer", "num-traits", ] @@ -5155,6 +5237,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", + "num-bigint 0.4.3", "num-integer", "num-traits", ] @@ -5188,24 +5271,15 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.28.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" -dependencies = [ - "crc32fast", - "hashbrown 0.11.2", - "indexmap", - "memchr", -] - [[package]] name = "object" version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ + "crc32fast", + "hashbrown", + "indexmap", "memchr", ] @@ -5217,7 +5291,7 @@ checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" [[package]] name = "opal-runtime" -version = "0.9.29" +version = "0.9.30" dependencies = [ "app-promotion-rpc", "cumulus-pallet-aura-ext", @@ -5329,11 +5403,11 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "orchestra" version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", "dyn-clonable", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "orchestra-proc-macro", "pin-project", @@ -5345,7 +5419,7 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "expander 0.0.6", "itertools", @@ -5368,7 +5442,7 @@ dependencies = [ [[package]] name = "orml-tokens" version = "0.4.1-dev" -source = "git+https://github.com/UniqueNetwork/open-runtime-module-library?branch=polkadot-v0.9.29#2caeb6621a59cbf37829d6a80bc2b89195959d45" +source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.30#4020ff64cfcad3dcc7f4f090cc9bc7699a78cc9c" dependencies = [ "frame-support", "frame-system", @@ -5383,7 +5457,7 @@ dependencies = [ [[package]] name = "orml-traits" version = "0.4.1-dev" -source = "git+https://github.com/UniqueNetwork/open-runtime-module-library?branch=polkadot-v0.9.29#2caeb6621a59cbf37829d6a80bc2b89195959d45" +source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.30#4020ff64cfcad3dcc7f4f090cc9bc7699a78cc9c" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -5401,7 +5475,7 @@ dependencies = [ [[package]] name = "orml-utilities" version = "0.4.1-dev" -source = "git+https://github.com/UniqueNetwork/open-runtime-module-library?branch=polkadot-v0.9.29#2caeb6621a59cbf37829d6a80bc2b89195959d45" +source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.30#4020ff64cfcad3dcc7f4f090cc9bc7699a78cc9c" dependencies = [ "frame-support", "parity-scale-codec 3.2.1", @@ -5415,7 +5489,7 @@ dependencies = [ [[package]] name = "orml-vesting" version = "0.4.1-dev" -source = "git+https://github.com/UniqueNetwork/open-runtime-module-library?branch=polkadot-v0.9.29#2caeb6621a59cbf37829d6a80bc2b89195959d45" +source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.30#4020ff64cfcad3dcc7f4f090cc9bc7699a78cc9c" dependencies = [ "frame-support", "frame-system", @@ -5430,7 +5504,7 @@ dependencies = [ [[package]] name = "orml-xcm-support" version = "0.4.1-dev" -source = "git+https://github.com/UniqueNetwork/open-runtime-module-library?branch=polkadot-v0.9.29#2caeb6621a59cbf37829d6a80bc2b89195959d45" +source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.30#4020ff64cfcad3dcc7f4f090cc9bc7699a78cc9c" dependencies = [ "frame-support", "orml-traits", @@ -5444,7 +5518,7 @@ dependencies = [ [[package]] name = "orml-xtokens" version = "0.4.1-dev" -source = "git+https://github.com/UniqueNetwork/open-runtime-module-library?branch=polkadot-v0.9.29#2caeb6621a59cbf37829d6a80bc2b89195959d45" +source = "git+https://github.com/uniquenetwork/open-runtime-module-library?branch=polkadot-v0.9.30#4020ff64cfcad3dcc7f4f090cc9bc7699a78cc9c" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -5505,7 +5579,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -5521,7 +5595,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -5537,7 +5611,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -5552,7 +5626,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5576,7 +5650,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5596,7 +5670,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5611,7 +5685,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" dependencies = [ "fp-evm", "frame-support", @@ -5626,7 +5700,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "beefy-primitives", "frame-support", @@ -5642,13 +5716,13 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "beefy-merkle-tree", "beefy-primitives", "frame-support", "frame-system", - "hex", "log", "pallet-beefy", "pallet-mmr", @@ -5665,7 +5739,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5683,7 +5757,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5702,7 +5776,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5756,7 +5830,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5772,13 +5846,14 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", "frame-support", "frame-system", "log", + "pallet-election-provider-support-benchmarking", "parity-scale-codec 3.2.1", "rand 0.7.3", "scale-info", @@ -5795,7 +5870,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5808,7 +5883,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5826,7 +5901,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" dependencies = [ "ethereum", "ethereum-types", @@ -5846,7 +5921,7 @@ dependencies = [ "rlp", "scale-info", "serde", - "sha3 0.10.5", + "sha3", "sp-io", "sp-runtime", "sp-std", @@ -5855,7 +5930,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.29#852f994e82f9e5718dde75e8c4d877db5a44dd45" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" dependencies = [ "evm", "fp-evm", @@ -5872,7 +5947,7 @@ dependencies = [ "rlp", "scale-info", "serde", - "sha3 0.10.5", + "sha3", "sp-core", "sp-io", "sp-runtime", @@ -5956,6 +6031,27 @@ dependencies = [ "up-sponsorship", ] +[[package]] +name = "pallet-fast-unstake" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-balances", + "pallet-staking", + "pallet-timestamp", + "parity-scale-codec 3.2.1", + "scale-info", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + [[package]] name = "pallet-foreign-assets" version = "0.1.0" @@ -6008,7 +6104,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6023,7 +6119,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6046,7 +6142,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6062,7 +6158,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6082,7 +6178,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6118,7 +6214,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6135,7 +6231,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -6153,7 +6249,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "jsonrpsee", "parity-scale-codec 3.2.1", @@ -6168,7 +6264,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6183,7 +6279,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -6200,7 +6296,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6212,6 +6308,7 @@ dependencies = [ "parity-scale-codec 3.2.1", "scale-info", "sp-runtime", + "sp-runtime-interface", "sp-staking", "sp-std", ] @@ -6219,7 +6316,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "sp-api", @@ -6251,7 +6348,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -6268,7 +6365,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6291,7 +6388,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6307,7 +6404,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6322,7 +6419,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -6336,7 +6433,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6415,7 +6512,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6431,7 +6528,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -6452,7 +6549,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6468,7 +6565,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -6482,7 +6579,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6505,7 +6602,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6516,7 +6613,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "sp-arithmetic", @@ -6540,7 +6637,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -6554,7 +6651,7 @@ dependencies = [ [[package]] name = "pallet-template-transaction-payment" version = "3.0.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.29#2917e3c58a51d3654788326197cb3e1eab7febae" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.30#39dd82158d6caa9d89105441bf2f7111a6e686e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6574,7 +6671,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6592,7 +6689,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6611,7 +6708,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-support", "frame-system", @@ -6627,7 +6724,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6642,7 +6739,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "pallet-transaction-payment", "parity-scale-codec 3.2.1", @@ -6653,7 +6750,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6713,7 +6810,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6729,7 +6826,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6743,8 +6840,8 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-support", "frame-system", @@ -6761,8 +6858,8 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-benchmarking", "frame-support", @@ -6779,7 +6876,7 @@ dependencies = [ [[package]] name = "parachain-info" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.29#2fa95572487cfcf8dbe6941bf93545c39d47f784" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.30#7b1fc0ed107fe42bb7e6a5dfefb586f4c3ae4328" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -6875,7 +6972,7 @@ checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" dependencies = [ "cfg-if 1.0.0", "ethereum-types", - "hashbrown 0.12.3", + "hashbrown", "impl-trait-for-tuples", "lru 0.7.8", "parity-util-mem-derive", @@ -6907,9 +7004,9 @@ dependencies = [ [[package]] name = "parity-wasm" -version = "0.42.2" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" @@ -6935,7 +7032,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.3", + "parking_lot_core 0.9.4", ] [[package]] @@ -6954,15 +7051,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -7093,6 +7190,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + [[package]] name = "pkg-config" version = "0.3.25" @@ -7107,10 +7215,10 @@ checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" [[package]] name = "polkadot-approval-distribution" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7122,10 +7230,10 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7136,12 +7244,12 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "derive_more", "fatality", - "futures 0.3.24", + "futures 0.3.25", "lru 0.7.8", "parity-scale-codec 3.2.1", "polkadot-erasure-coding", @@ -7159,11 +7267,11 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "fatality", - "futures 0.3.24", + "futures 0.3.25", "lru 0.7.8", "parity-scale-codec 3.2.1", "polkadot-erasure-coding", @@ -7180,12 +7288,12 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "clap", "frame-benchmarking-cli", - "futures 0.3.24", + "futures 0.3.25", "log", "polkadot-client", "polkadot-node-core-pvf", @@ -7206,8 +7314,8 @@ dependencies = [ [[package]] name = "polkadot-client" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "beefy-primitives", "frame-benchmarking", @@ -7246,12 +7354,12 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "always-assert", "fatality", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -7267,8 +7375,8 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "parity-scale-codec 3.2.1", "parity-util-mem", @@ -7280,12 +7388,12 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "derive_more", "fatality", - "futures 0.3.24", + "futures 0.3.25", "lru 0.7.8", "parity-scale-codec 3.2.1", "polkadot-erasure-coding", @@ -7303,8 +7411,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "parity-scale-codec 3.2.1", "polkadot-node-primitives", @@ -7317,10 +7425,10 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-subsystem", @@ -7337,14 +7445,14 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "always-assert", "async-trait", "bytes", "fatality", - "futures 0.3.24", + "futures 0.3.25", "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "polkadot-node-network-protocol", @@ -7361,10 +7469,10 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "parity-scale-codec 3.2.1", "polkadot-erasure-coding", "polkadot-node-primitives", @@ -7379,12 +7487,12 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bitvec 1.0.1", "derive_more", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "kvdb", "lru 0.7.8", @@ -7408,11 +7516,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bitvec 1.0.1", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "kvdb", "parity-scale-codec 3.2.1", @@ -7428,12 +7536,12 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bitvec 1.0.1", "fatality", - "futures 0.3.24", + "futures 0.3.25", "polkadot-erasure-coding", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7447,10 +7555,10 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", @@ -7462,11 +7570,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "parity-scale-codec 3.2.1", "polkadot-node-core-pvf", "polkadot-node-primitives", @@ -7480,10 +7588,10 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", @@ -7495,10 +7603,10 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "kvdb", "parity-scale-codec 3.2.1", @@ -7512,11 +7620,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "fatality", - "futures 0.3.24", + "futures 0.3.25", "kvdb", "lru 0.7.8", "parity-scale-codec 3.2.1", @@ -7531,11 +7639,11 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "polkadot-node-subsystem", "polkadot-primitives", @@ -7548,12 +7656,12 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bitvec 1.0.1", "fatality", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7566,19 +7674,19 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "always-assert", "assert_matches", "async-process", "async-std", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "parity-scale-codec 3.2.1", "pin-project", "polkadot-core-primitives", - "polkadot-node-subsystem-util", + "polkadot-node-metrics", "polkadot-parachain", "rand 0.8.5", "rayon", @@ -7598,10 +7706,10 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7614,10 +7722,10 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "memory-lru", "parity-util-mem", "polkadot-node-subsystem", @@ -7630,8 +7738,8 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-std", "lazy_static", @@ -7648,11 +7756,11 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bs58", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "log", "parity-scale-codec 3.2.1", @@ -7667,13 +7775,13 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", "derive_more", "fatality", - "futures 0.3.24", + "futures 0.3.25", "hex", "parity-scale-codec 3.2.1", "polkadot-node-jaeger", @@ -7682,6 +7790,7 @@ dependencies = [ "rand 0.8.5", "sc-authority-discovery", "sc-network", + "sc-network-common", "strum", "thiserror", "tracing-gum", @@ -7689,11 +7798,11 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bounded-vec", - "futures 0.3.24", + "futures 0.3.25", "parity-scale-codec 3.2.1", "polkadot-parachain", "polkadot-primitives", @@ -7711,8 +7820,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -7721,12 +7830,12 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", "derive_more", - "futures 0.3.24", + "futures 0.3.25", "orchestra", "polkadot-node-jaeger", "polkadot-node-network-protocol", @@ -7744,13 +7853,13 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", "derive_more", "fatality", - "futures 0.3.24", + "futures 0.3.25", "itertools", "kvdb", "lru 0.7.8", @@ -7777,11 +7886,11 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "lru 0.7.8", "orchestra", @@ -7800,8 +7909,8 @@ dependencies = [ [[package]] name = "polkadot-parachain" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "derive_more", "frame-support", @@ -7817,8 +7926,8 @@ dependencies = [ [[package]] name = "polkadot-performance-test" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "env_logger", "kusama-runtime", @@ -7832,8 +7941,8 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bitvec 1.0.1", "frame-system", @@ -7862,8 +7971,8 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "beefy-gadget", "beefy-gadget-rpc", @@ -7894,8 +8003,8 @@ dependencies = [ [[package]] name = "polkadot-runtime" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -7921,6 +8030,7 @@ dependencies = [ "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", "pallet-elections-phragmen", + "pallet-fast-unstake", "pallet-grandpa", "pallet-identity", "pallet-im-online", @@ -7982,8 +8092,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -8029,8 +8139,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-support", "polkadot-primitives", @@ -8041,8 +8151,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bs58", "parity-scale-codec 3.2.1", @@ -8053,8 +8163,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "bitflags", "bitvec 1.0.1", @@ -8096,15 +8206,15 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "async-trait", "beefy-gadget", "beefy-primitives", "frame-support", "frame-system-rpc-runtime-api", - "futures 0.3.24", + "futures 0.3.25", "hex-literal", "kusama-runtime", "kvdb", @@ -8200,12 +8310,12 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "arrayvec 0.5.2", "fatality", - "futures 0.3.24", + "futures 0.3.25", "indexmap", "parity-scale-codec 3.2.1", "polkadot-node-network-protocol", @@ -8221,8 +8331,8 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "parity-scale-codec 3.2.1", "polkadot-primitives", @@ -8231,8 +8341,8 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -8292,12 +8402,12 @@ dependencies = [ [[package]] name = "polkadot-test-service" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-benchmarking", "frame-system", - "futures 0.3.24", + "futures 0.3.25", "hex", "pallet-balances", "pallet-staking", @@ -8404,12 +8514,12 @@ dependencies = [ [[package]] name = "prioritized-metered-channel" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "coarsetime", "crossbeam-queue", "derive_more", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "nanorand", "thiserror", @@ -8453,9 +8563,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.46" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] @@ -8481,7 +8591,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1abe0255c04d15f571427a2d1e00099016506cf3297b53853acd2b7eb87825" dependencies = [ "dtoa", - "itoa 1.0.3", + "itoa", "owning_ref", "prometheus-client-derive-text-encode", ] @@ -8504,7 +8614,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.10.1", +] + +[[package]] +name = "prost" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "399c3c31cdec40583bb68f0b18403400d01ec4289c383aa047560439952c4dd7" +dependencies = [ + "bytes", + "prost-derive 0.11.0", ] [[package]] @@ -8522,8 +8642,28 @@ dependencies = [ "log", "multimap", "petgraph", - "prost", - "prost-types", + "prost 0.10.4", + "prost-types 0.10.1", + "regex", + "tempfile", + "which", +] + +[[package]] +name = "prost-build" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f835c582e6bd972ba8347313300219fed5bfa52caf175298d860b61ff6069bb" +dependencies = [ + "bytes", + "heck", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph", + "prost 0.11.0", + "prost-types 0.11.1", "regex", "tempfile", "which", @@ -8537,7 +8677,7 @@ checksum = "00af1e92c33b4813cc79fda3f2dbf56af5169709be0202df730e9ebc3e4cd007" dependencies = [ "asynchronous-codec", "bytes", - "prost", + "prost 0.10.4", "thiserror", "unsigned-varint", ] @@ -8555,6 +8695,19 @@ dependencies = [ "syn", ] +[[package]] +name = "prost-derive" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7345d5f0e08c0536d7ac7229952590239e77abf0a0100a1b1d890add6ea96364" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "prost-types" version = "0.10.1" @@ -8562,7 +8715,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" dependencies = [ "bytes", - "prost", + "prost 0.10.4", +] + +[[package]] +name = "prost-types" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dfaa718ad76a44b3415e6c4d53b17c8f99160dcb3a99b10470fce8ad43f6e3e" +dependencies = [ + "bytes", + "prost 0.11.0", ] [[package]] @@ -8576,7 +8739,7 @@ dependencies = [ [[package]] name = "quartz-runtime" -version = "0.9.29" +version = "0.9.30" dependencies = [ "app-promotion-rpc", "cumulus-pallet-aura-ext", @@ -8864,24 +9027,24 @@ dependencies = [ "derive_more", "fs-err", "itertools", - "static_init", + "static_init 0.5.2", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed13bcd201494ab44900a96490291651d200730904221832b9547d24a87d332b" +checksum = "12a733f1746c929b4913fe48f8697fcf9c55e3304ba251a79ffb41adfeaf49c2" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5234cd6063258a5e32903b53b1b6ac043a0541c8adc1f610f67b0326c7a578fa" +checksum = "5887de4a01acafd221861463be6113e6e87275e79804e56779f4cdc131c60368" dependencies = [ "proc-macro2", "quote", @@ -8890,9 +9053,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.2.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a8d23b35d7177df3b9d31ed8a9ab4bf625c668be77a319d4f5efd4a5257701c" +checksum = "d43a209257d978ef079f3d446331d0f1794f5e0fc19b306a199983857833a779" dependencies = [ "fxhash", "log", @@ -8926,22 +9089,10 @@ version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" -[[package]] -name = "region" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0" -dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", -] - [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "env_logger", "jsonrpsee", @@ -9055,8 +9206,8 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -9074,23 +9225,37 @@ dependencies = [ "pallet-balances", "pallet-beefy", "pallet-beefy-mmr", + "pallet-bounties", + "pallet-child-bounties", "pallet-collective", + "pallet-democracy", + "pallet-elections-phragmen", + "pallet-gilt", "pallet-grandpa", + "pallet-identity", "pallet-im-online", "pallet-indices", "pallet-membership", "pallet-mmr", "pallet-multisig", "pallet-offences", + "pallet-preimage", "pallet-proxy", + "pallet-recovery", + "pallet-scheduler", "pallet-session", + "pallet-society", "pallet-staking", "pallet-sudo", "pallet-timestamp", + "pallet-tips", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", "pallet-utility", + "pallet-vesting", "pallet-xcm", + "pallet-xcm-benchmarks", "parity-scale-codec 3.2.1", "polkadot-parachain", "polkadot-primitives", @@ -9116,6 +9281,7 @@ dependencies = [ "sp-std", "sp-transaction-pool", "sp-version", + "static_assertions", "substrate-wasm-builder", "xcm", "xcm-builder", @@ -9124,8 +9290,8 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-support", "polkadot-primitives", @@ -9136,9 +9302,9 @@ dependencies = [ [[package]] name = "rpassword" -version = "7.0.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b763cb66df1c928432cc35053f8bd4cec3335d8559fc16010017d16b3c1680" +checksum = "20c9f5d2a0c3e2ea729ab3706d22217177770654c3ef5056b68b69d07332d3f5" dependencies = [ "libc", "winapi", @@ -9151,7 +9317,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" dependencies = [ "async-global-executor", - "futures 0.3.24", + "futures 0.3.25", "log", "netlink-packet-route", "netlink-proto", @@ -9195,20 +9361,6 @@ dependencies = [ "semver 1.0.14", ] -[[package]] -name = "rustix" -version = "0.33.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938a344304321a9da4973b9ff4f9f8db9caf4597dfd9dda6a60b523340a0fff0" -dependencies = [ - "bitflags", - "errno", - "io-lifetimes 0.5.3", - "libc", - "linux-raw-sys 0.0.42", - "winapi", -] - [[package]] name = "rustix" version = "0.35.11" @@ -9217,17 +9369,17 @@ checksum = "fbb2fda4666def1433b1b05431ab402e42a1084285477222b72d6c564c417cef" dependencies = [ "bitflags", "errno", - "io-lifetimes 0.7.3", + "io-lifetimes", "libc", - "linux-raw-sys 0.0.46", - "windows-sys", + "linux-raw-sys", + "windows-sys 0.36.1", ] [[package]] name = "rustls" -version = "0.20.6" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" dependencies = [ "log", "ring", @@ -9268,7 +9420,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "pin-project", "static_assertions", ] @@ -9290,11 +9442,11 @@ dependencies = [ [[package]] name = "salsa20" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0fbb5f676da676c260ba276a8f43a8dc67cf02d1438423aeb1c677a7212686" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" dependencies = [ - "cipher", + "cipher 0.4.3", ] [[package]] @@ -9309,7 +9461,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "sp-core", @@ -9320,17 +9472,17 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "ip_network", "libp2p", "log", "parity-scale-codec 3.2.1", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.7.3", "sc-client-api", "sc-network-common", @@ -9347,9 +9499,9 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "log", "parity-scale-codec 3.2.1", @@ -9370,7 +9522,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "sc-client-api", @@ -9386,7 +9538,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "impl-trait-for-tuples", "memmap2", @@ -9403,7 +9555,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9414,13 +9566,13 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "chrono", "clap", "fdlimit", - "futures 0.3.24", - "hex", + "futures 0.3.25", "libp2p", "log", "names", @@ -9432,6 +9584,7 @@ dependencies = [ "sc-client-db", "sc-keystore", "sc-network", + "sc-network-common", "sc-service", "sc-telemetry", "sc-tracing", @@ -9453,10 +9606,10 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "fnv", - "futures 0.3.24", + "futures 0.3.25", "hash-db", "log", "parity-scale-codec 3.2.1", @@ -9481,7 +9634,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "hash-db", "kvdb", @@ -9506,10 +9659,10 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "libp2p", "log", @@ -9530,10 +9683,10 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "log", "parity-scale-codec 3.2.1", "sc-block-builder", @@ -9559,14 +9712,14 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "fork-tree", - "futures 0.3.24", + "futures 0.3.25", "log", "merlin", - "num-bigint", + "num-bigint 0.2.6", "num-rational 0.2.4", "num-traits", "parity-scale-codec 3.2.1", @@ -9601,9 +9754,9 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee", "sc-consensus-babe", "sc-consensus-epochs", @@ -9623,7 +9776,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "fork-tree", "parity-scale-codec 3.2.1", @@ -9636,11 +9789,11 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "assert_matches", "async-trait", - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee", "log", "parity-scale-codec 3.2.1", @@ -9670,10 +9823,10 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "log", "parity-scale-codec 3.2.1", @@ -9688,14 +9841,13 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-timestamp", "thiserror", ] [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "lazy_static", "lru 0.7.8", @@ -9722,7 +9874,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "environmental", "parity-scale-codec 3.2.1", @@ -9738,7 +9890,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -9753,16 +9905,15 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "cfg-if 1.0.0", "libc", "log", "once_cell", "parity-scale-codec 3.2.1", - "parity-wasm 0.42.2", - "rustix 0.33.7", - "rustix 0.35.11", + "parity-wasm 0.45.0", + "rustix", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -9774,16 +9925,16 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "ahash", + "array-bytes", "async-trait", "dyn-clone", "finality-grandpa", "fork-tree", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", - "hex", "log", "parity-scale-codec 3.2.1", "parking_lot 0.12.1", @@ -9815,10 +9966,10 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "finality-grandpa", - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee", "log", "parity-scale-codec 3.2.1", @@ -9836,10 +9987,10 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "ansi_term", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "log", "parity-util-mem", @@ -9853,10 +10004,10 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "async-trait", - "hex", "parking_lot 0.12.1", "serde_json", "sp-application-crypto", @@ -9868,8 +10019,9 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "async-trait", "asynchronous-codec", "bitflags", @@ -9878,9 +10030,8 @@ dependencies = [ "either", "fnv", "fork-tree", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", - "hex", "ip_network", "libp2p", "linked-hash-map", @@ -9890,8 +10041,7 @@ dependencies = [ "parity-scale-codec 3.2.1", "parking_lot 0.12.1", "pin-project", - "prost", - "prost-build", + "prost 0.10.4", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -9910,22 +10060,43 @@ dependencies = [ "substrate-prometheus-endpoint", "thiserror", "unsigned-varint", - "void", "zeroize", ] +[[package]] +name = "sc-network-bitswap" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +dependencies = [ + "cid", + "futures 0.3.25", + "libp2p", + "log", + "prost 0.11.0", + "prost-build 0.11.1", + "sc-client-api", + "sc-network-common", + "sp-blockchain", + "sp-runtime", + "thiserror", + "unsigned-varint", + "void", +] + [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "bitflags", "bytes", - "futures 0.3.24", + "futures 0.3.25", + "futures-timer", "libp2p", + "linked_hash_set", "parity-scale-codec 3.2.1", - "prost-build", + "prost-build 0.10.4", "sc-consensus", "sc-peerset", "serde", @@ -9934,16 +10105,17 @@ dependencies = [ "sp-consensus", "sp-finality-grandpa", "sp-runtime", + "substrate-prometheus-endpoint", "thiserror", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "ahash", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "libp2p", "log", @@ -9958,15 +10130,15 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ - "futures 0.3.24", - "hex", + "array-bytes", + "futures 0.3.25", "libp2p", "log", "parity-scale-codec 3.2.1", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "sc-client-api", "sc-network-common", "sc-peerset", @@ -9979,17 +10151,17 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "fork-tree", - "futures 0.3.24", - "hex", + "futures 0.3.25", "libp2p", "log", "lru 0.7.8", "parity-scale-codec 3.2.1", - "prost", - "prost-build", + "prost 0.10.4", + "prost-build 0.10.4", "sc-client-api", "sc-consensus", "sc-network-common", @@ -10004,16 +10176,35 @@ dependencies = [ "thiserror", ] +[[package]] +name = "sc-network-transactions" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +dependencies = [ + "array-bytes", + "futures 0.3.25", + "hex", + "libp2p", + "log", + "parity-scale-codec 3.2.1", + "pin-project", + "sc-network-common", + "sc-peerset", + "sp-consensus", + "sp-runtime", + "substrate-prometheus-endpoint", +] + [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "bytes", "fnv", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", - "hex", "hyper", "hyper-rustls", "libp2p", @@ -10037,9 +10228,9 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "libp2p", "log", "sc-utils", @@ -10050,7 +10241,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -10059,9 +10250,9 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "hash-db", "jsonrpsee", "log", @@ -10089,9 +10280,9 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee", "log", "parity-scale-codec 3.2.1", @@ -10112,9 +10303,9 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee", "log", "serde_json", @@ -10125,12 +10316,12 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "directories", "exit-future", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "hash-db", "jsonrpsee", @@ -10149,9 +10340,11 @@ dependencies = [ "sc-informant", "sc-keystore", "sc-network", + "sc-network-bitswap", "sc-network-common", "sc-network-light", "sc-network-sync", + "sc-network-transactions", "sc-offchain", "sc-rpc", "sc-rpc-server", @@ -10181,6 +10374,7 @@ dependencies = [ "sp-transaction-storage-proof", "sp-trie", "sp-version", + "static_init 1.0.3", "substrate-prometheus-endpoint", "tempfile", "thiserror", @@ -10192,7 +10386,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -10206,7 +10400,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "jsonrpsee", "parity-scale-codec 3.2.1", @@ -10225,9 +10419,9 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "libc", "log", "rand 0.7.3", @@ -10244,10 +10438,10 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "chrono", - "futures 0.3.24", + "futures 0.3.25", "libp2p", "log", "parking_lot 0.12.1", @@ -10262,7 +10456,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "ansi_term", "atty", @@ -10293,7 +10487,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10304,9 +10498,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "linked-hash-map", "log", @@ -10330,9 +10524,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "log", "serde", "sp-blockchain", @@ -10343,9 +10537,9 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "lazy_static", "log", @@ -10386,7 +10580,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ "lazy_static", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -10413,6 +10607,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "scratch" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" + [[package]] name = "sct" version = "0.7.0" @@ -10431,6 +10631,7 @@ checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" dependencies = [ "der", "generic-array 0.14.6", + "pkcs8", "subtle", "zeroize", ] @@ -10446,9 +10647,9 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7058dc8eaf3f2810d7828680320acda0b25a288f6d288e19278e249bbf74226b" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" dependencies = [ "cc", ] @@ -10540,11 +10741,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.85" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" dependencies = [ - "itoa 1.0.3", + "itoa", "ryu", "serde", ] @@ -10620,21 +10821,9 @@ dependencies = [ [[package]] name = "sha3" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" -dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "keccak", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sha3" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2904bea16a1ae962b483322a1c7b81d976029203aea1f461e51cd7705db7ba9" +checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" dependencies = [ "digest 0.10.5", "keccak", @@ -10713,8 +10902,8 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "enumn", "parity-scale-codec 3.2.1", @@ -10780,7 +10969,7 @@ dependencies = [ "base64", "bytes", "flate2", - "futures 0.3.24", + "futures 0.3.25", "httparse", "log", "rand 0.8.5", @@ -10790,7 +10979,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "hash-db", "log", @@ -10808,7 +10997,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "blake2", "proc-macro-crate", @@ -10820,7 +11009,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -10833,7 +11022,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "integer-sqrt", "num-traits", @@ -10848,7 +11037,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -10861,7 +11050,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "parity-scale-codec 3.2.1", @@ -10873,7 +11062,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "sp-api", @@ -10885,9 +11074,9 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "log", "lru 0.7.8", "parity-scale-codec 3.2.1", @@ -10903,10 +11092,10 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "futures-timer", "log", "parity-scale-codec 3.2.1", @@ -10922,7 +11111,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "parity-scale-codec 3.2.1", @@ -10940,7 +11129,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "merlin", @@ -10963,7 +11152,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -10977,7 +11166,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -10990,18 +11179,18 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "base58", "bitflags", - "blake2-rfc", + "blake2", "byteorder", "dyn-clonable", "ed25519-zebra", - "futures 0.3.24", + "futures 0.3.25", "hash-db", "hash256-std-hasher", - "hex", "impl-serde", "lazy_static", "libsecp256k1", @@ -11036,13 +11225,13 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "blake2", "byteorder", "digest 0.10.5", "sha2 0.10.6", - "sha3 0.10.5", + "sha3", "sp-std", "twox-hash", ] @@ -11050,7 +11239,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "proc-macro2", "quote", @@ -11061,7 +11250,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -11070,7 +11259,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "proc-macro2", "quote", @@ -11080,7 +11269,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "environmental", "parity-scale-codec 3.2.1", @@ -11091,7 +11280,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "finality-grandpa", "log", @@ -11109,7 +11298,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -11123,10 +11312,10 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "bytes", - "futures 0.3.24", + "futures 0.3.25", "hash-db", "libsecp256k1", "log", @@ -11149,7 +11338,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "lazy_static", "sp-core", @@ -11160,10 +11349,10 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", - "futures 0.3.24", + "futures 0.3.25", "merlin", "parity-scale-codec 3.2.1", "parking_lot 0.12.1", @@ -11177,7 +11366,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "thiserror", "zstd", @@ -11186,7 +11375,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -11201,7 +11390,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11215,7 +11404,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "sp-api", "sp-core", @@ -11225,7 +11414,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "backtrace", "lazy_static", @@ -11235,7 +11424,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "rustc-hash", "serde", @@ -11245,7 +11434,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "either", "hash256-std-hasher", @@ -11262,12 +11451,13 @@ dependencies = [ "sp-core", "sp-io", "sp-std", + "sp-weights", ] [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -11285,7 +11475,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "Inflector", "proc-macro-crate", @@ -11297,7 +11487,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "parity-scale-codec 3.2.1", @@ -11311,7 +11501,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11325,7 +11515,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "scale-info", @@ -11336,7 +11526,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "hash-db", "log", @@ -11358,12 +11548,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "impl-serde", "parity-scale-codec 3.2.1", @@ -11376,7 +11566,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "log", "sp-core", @@ -11389,7 +11579,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "futures-timer", @@ -11405,7 +11595,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "sp-std", @@ -11417,7 +11607,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "sp-api", "sp-runtime", @@ -11426,7 +11616,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "async-trait", "log", @@ -11442,11 +11632,11 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "ahash", "hash-db", - "hashbrown 0.12.3", + "hashbrown", "lazy_static", "lru 0.7.8", "memory-db", @@ -11465,11 +11655,11 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "impl-serde", "parity-scale-codec 3.2.1", - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", "scale-info", "serde", "sp-core-hashing-proc-macro", @@ -11482,7 +11672,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "parity-scale-codec 3.2.1", "proc-macro2", @@ -11493,7 +11683,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "impl-trait-for-tuples", "log", @@ -11503,17 +11693,43 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "sp-weights" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec 3.2.1", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic", + "sp-core", + "sp-debug-derive", + "sp-std", +] + [[package]] name = "spin" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "ss58-registry" -version = "1.31.0" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de151faef619cb7b5c26b32d42bc7ddccac0d202beb7a84344b44e9232b92f7" +checksum = "3ab7554f8a8b6f8d71cd5a8e6536ef116e2ce0504cf97ebf16311d58065dc8a6" dependencies = [ "Inflector", "num-format", @@ -11545,7 +11761,22 @@ dependencies = [ "cfg_aliases", "libc", "parking_lot 0.11.2", - "static_init_macro", + "static_init_macro 0.5.0", +] + +[[package]] +name = "static_init" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" +dependencies = [ + "bitflags", + "cfg_aliases", + "libc", + "parking_lot 0.11.2", + "parking_lot_core 0.8.5", + "static_init_macro 1.0.2", + "winapi", ] [[package]] @@ -11561,6 +11792,19 @@ dependencies = [ "syn", ] +[[package]] +name = "static_init_macro" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a2595fc3aa78f2d0e45dd425b22282dd863273761cc77780914b2cf3003acf" +dependencies = [ + "cfg_aliases", + "memchr", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "statrs" version = "0.15.0" @@ -11626,7 +11870,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "platforms", ] @@ -11634,10 +11878,10 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee", "log", "parity-scale-codec 3.2.1", @@ -11655,7 +11899,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "futures-util", "hyper", @@ -11668,7 +11912,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "jsonrpsee", "log", @@ -11689,11 +11933,11 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ + "array-bytes", "async-trait", - "futures 0.3.24", - "hex", + "futures 0.3.25", "parity-scale-codec 3.2.1", "sc-client-api", "sc-client-db", @@ -11715,9 +11959,9 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "substrate-test-utils-derive", "tokio", ] @@ -11725,7 +11969,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11736,7 +11980,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "ansi_term", "build-helper", @@ -11758,9 +12002,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.101" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e90cde112c4b9690b8cbe810cba9ddd8bc1d7472e2cae317b69e9438c1cba7d2" +checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" dependencies = [ "proc-macro2", "quote", @@ -11837,8 +12081,8 @@ dependencies = [ [[package]] name = "test-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-support", "polkadot-primitives", @@ -11968,7 +12212,7 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" dependencies = [ - "itoa 1.0.3", + "itoa", "libc", "num_threads", "time-macros", @@ -12067,9 +12311,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6edf2d6bc038a43d31353570e27270603f4648d18f5ed10c0e179abe43255af" +checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" dependencies = [ "futures-core", "pin-project-lite 0.2.9", @@ -12108,9 +12352,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.36" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if 1.0.0", "pin-project-lite 0.2.9", @@ -12120,9 +12364,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", @@ -12131,9 +12375,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", "valuable", @@ -12151,8 +12395,8 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -12162,8 +12406,8 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "expander 0.0.6", "proc-macro-crate", @@ -12223,7 +12467,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" dependencies = [ "hash-db", - "hashbrown 0.12.3", + "hashbrown", "log", "rustc-hex", "smallvec", @@ -12300,7 +12544,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.30#a3ed0119c45cdd0d571ad34e5b3ee7518c8cef8d" dependencies = [ "clap", "frame-try-runtime", @@ -12402,9 +12646,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" [[package]] name = "unicode-normalization" @@ -12429,7 +12673,7 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unique-node" -version = "0.9.29" +version = "0.9.30" dependencies = [ "app-promotion-rpc", "clap", @@ -12453,7 +12697,7 @@ dependencies = [ "fp-rpc", "frame-benchmarking", "frame-benchmarking-cli", - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee", "log", "opal-runtime", @@ -12527,7 +12771,7 @@ dependencies = [ "fc-rpc-core", "fp-rpc", "fp-storage", - "futures 0.3.24", + "futures 0.3.25", "jsonrpsee", "pallet-common", "pallet-ethereum", @@ -12568,7 +12812,7 @@ dependencies = [ [[package]] name = "unique-runtime" -version = "0.9.29" +version = "0.9.30" dependencies = [ "app-promotion-rpc", "cumulus-pallet-aura-ext", @@ -12689,7 +12933,7 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "up-common" -version = "0.9.29" +version = "0.9.30" dependencies = [ "fp-rpc", "frame-support", @@ -12736,7 +12980,7 @@ dependencies = [ [[package]] name = "up-sponsorship" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.29#2917e3c58a51d3654788326197cb3e1eab7febae" +source = "git+https://github.com/uniquenetwork/pallet-sponsoring?branch=polkadot-v0.9.30#39dd82158d6caa9d89105441bf2f7111a6e686e5" dependencies = [ "impl-trait-for-tuples", ] @@ -12910,11 +13154,11 @@ dependencies = [ [[package]] name = "wasm-instrument" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "962e5b0401bbb6c887f54e69b8c496ea36f704df65db73e81fd5ff8dc3e63a9f" +checksum = "aa1dafb3e60065305741e83db35c6c2584bb3725b692b5b66148a38d72ace6cd" dependencies = [ - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", ] [[package]] @@ -12923,7 +13167,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "js-sys", "parking_lot 0.11.2", "pin-utils", @@ -12934,58 +13178,63 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.9.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca00c5147c319a8ec91ec1a0edbec31e566ce2c9cc93b3f9bb86a9efd0eb795d" +checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" dependencies = [ - "downcast-rs", - "libc", - "libm", - "memory_units", - "num-rational 0.2.4", - "num-traits", - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", "wasmi-validation", + "wasmi_core", ] [[package]] name = "wasmi-validation" -version = "0.4.1" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" +dependencies = [ + "parity-wasm 0.45.0", +] + +[[package]] +name = "wasmi_core" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "165343ecd6c018fc09ebcae280752702c9a2ef3e6f8d02f1cfcbdb53ef6d7937" +checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" dependencies = [ - "parity-wasm 0.42.2", + "downcast-rs", + "libm", + "memory_units", + "num-rational 0.4.1", + "num-traits", ] [[package]] name = "wasmparser" -version = "0.85.0" +version = "0.89.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "570460c58b21e9150d2df0eaaedbb7816c34bcec009ae0dcc976e40ba81463e7" +checksum = "ab5d3e08b13876f96dd55608d03cd4883a0545884932d5adf11925876c96daef" dependencies = [ "indexmap", ] [[package]] name = "wasmtime" -version = "0.38.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f50eadf868ab6a04b7b511460233377d0bfbb92e417b2f6a98b98fef2e098f5" +checksum = "f1f511c4917c83d04da68333921107db75747c4e11a2f654a8e909cc5e0520dc" dependencies = [ "anyhow", - "backtrace", "bincode", "cfg-if 1.0.0", "indexmap", - "lazy_static", "libc", "log", - "object 0.28.4", + "object", "once_cell", "paste", "psm", "rayon", - "region", "serde", "target-lexicon", "wasmparser", @@ -12994,14 +13243,23 @@ dependencies = [ "wasmtime-environ", "wasmtime-jit", "wasmtime-runtime", - "winapi", + "windows-sys 0.36.1", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39bf3debfe744bf19dd3732990ce6f8c0ced7439e2370ba4e1d8f5a3660a3178" +dependencies = [ + "cfg-if 1.0.0", ] [[package]] name = "wasmtime-cache" -version = "0.38.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1df23c642e1376892f3b72f311596976979cbf8b85469680cdd3a8a063d12a2" +checksum = "ece42fa4676a263f7558cdaaf5a71c2592bebcbac22a0580e33cf3406c103da2" dependencies = [ "anyhow", "base64", @@ -13009,19 +13267,19 @@ dependencies = [ "directories-next", "file-per-thread-logger", "log", - "rustix 0.33.7", + "rustix", "serde", "sha2 0.9.9", "toml", - "winapi", + "windows-sys 0.36.1", "zstd", ] [[package]] name = "wasmtime-cranelift" -version = "0.38.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f264ff6b4df247d15584f2f53d009fbc90032cfdc2605b52b961bffc71b6eccd" +checksum = "058217e28644b012bdcdf0e445f58d496d78c2e0b6a6dd93558e701591dad705" dependencies = [ "anyhow", "cranelift-codegen", @@ -13031,8 +13289,7 @@ dependencies = [ "cranelift-wasm", "gimli", "log", - "more-asserts", - "object 0.28.4", + "object", "target-lexicon", "thiserror", "wasmparser", @@ -13041,17 +13298,16 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "0.38.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "839d2820e4b830f4b9e7aa08d4c0acabf4a5036105d639f6dfa1c6891c73bdc6" +checksum = "c7af06848df28b7661471d9a80d30a973e0f401f2e3ed5396ad7e225ed217047" dependencies = [ "anyhow", "cranelift-entity", "gimli", "indexmap", "log", - "more-asserts", - "object 0.28.4", + "object", "serde", "target-lexicon", "thiserror", @@ -13061,9 +13317,9 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "0.38.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef0a0bcbfa18b946d890078ba0e1bc76bcc53eccfb40806c0020ec29dcd1bd49" +checksum = "9028fb63a54185b3c192b7500ef8039c7bb8d7f62bfc9e7c258483a33a3d13bb" dependencies = [ "addr2line", "anyhow", @@ -13072,38 +13328,36 @@ dependencies = [ "cpp_demangle", "gimli", "log", - "object 0.28.4", - "region", + "object", "rustc-demangle", - "rustix 0.33.7", + "rustix", "serde", "target-lexicon", "thiserror", "wasmtime-environ", "wasmtime-jit-debug", "wasmtime-runtime", - "winapi", + "windows-sys 0.36.1", ] [[package]] name = "wasmtime-jit-debug" -version = "0.38.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4779d976206c458edd643d1ac622b6c37e4a0800a8b1d25dfbf245ac2f2cac" +checksum = "25e82d4ef93296785de7efca92f7679dc67fe68a13b625a5ecc8d7503b377a37" dependencies = [ - "lazy_static", - "object 0.28.4", - "rustix 0.33.7", + "object", + "once_cell", + "rustix", ] [[package]] name = "wasmtime-runtime" -version = "0.38.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7eb6ffa169eb5dcd18ac9473c817358cd57bc62c244622210566d473397954a" +checksum = "9f0e9bea7d517d114fe66b930b2124ee086516ee93eeebfd97f75f366c5b0553" dependencies = [ "anyhow", - "backtrace", "cc", "cfg-if 1.0.0", "indexmap", @@ -13112,21 +13366,21 @@ dependencies = [ "mach", "memfd", "memoffset", - "more-asserts", + "paste", "rand 0.8.5", - "region", - "rustix 0.33.7", + "rustix", "thiserror", + "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", - "winapi", + "windows-sys 0.36.1", ] [[package]] name = "wasmtime-types" -version = "0.38.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d932b0ac5336f7308d869703dd225610a6a3aeaa8e968c52b43eed96cefb1c2" +checksum = "69b83e93ed41b8fdc936244cfd5e455480cf1eca1fd60c78a0040038b4ce5075" dependencies = [ "cranelift-entity", "serde", @@ -13174,8 +13428,8 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "beefy-primitives", "bitvec 1.0.1", @@ -13199,6 +13453,7 @@ dependencies = [ "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", "pallet-elections-phragmen", + "pallet-fast-unstake", "pallet-grandpa", "pallet-identity", "pallet-im-online", @@ -13263,8 +13518,8 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-support", "polkadot-primitives", @@ -13347,6 +13602,27 @@ dependencies = [ "windows_x86_64_msvc 0.36.1", ] +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + [[package]] name = "windows_aarch64_msvc" version = "0.34.0" @@ -13359,6 +13635,12 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + [[package]] name = "windows_i686_gnu" version = "0.34.0" @@ -13371,6 +13653,12 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + [[package]] name = "windows_i686_msvc" version = "0.34.0" @@ -13383,6 +13671,12 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + [[package]] name = "windows_x86_64_gnu" version = "0.34.0" @@ -13395,6 +13689,18 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + [[package]] name = "windows_x86_64_msvc" version = "0.34.0" @@ -13407,6 +13713,12 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + [[package]] name = "winreg" version = "0.7.0" @@ -13444,8 +13756,8 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "derivative", "impl-trait-for-tuples", @@ -13458,8 +13770,8 @@ dependencies = [ [[package]] name = "xcm-builder" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-support", "frame-system", @@ -13478,8 +13790,8 @@ dependencies = [ [[package]] name = "xcm-executor" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "frame-benchmarking", "frame-support", @@ -13496,8 +13808,8 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "0.9.29" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +version = "0.9.30" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.30#064536093f5ff70d867f4bbce8d4c41a406d317a" dependencies = [ "Inflector", "proc-macro2", @@ -13511,7 +13823,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "log", "nohash-hasher", "parking_lot 0.12.1", diff --git a/Cargo.toml b/Cargo.toml index bf2405fe80..2137963a08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,3 +14,23 @@ members = [ default-members = ['node/*', 'runtime/opal'] [profile.release] panic = 'unwind' + +[workspace.dependencies.orml-vesting] +git = "https://github.com/uniquenetwork/open-runtime-module-library" +branch = "polkadot-v0.9.30" +default-features = false + +[workspace.dependencies.orml-xtokens] +git = "https://github.com/uniquenetwork/open-runtime-module-library" +branch = "polkadot-v0.9.30" +default-features = false + +[workspace.dependencies.orml-tokens] +git = "https://github.com/uniquenetwork/open-runtime-module-library" +branch = "polkadot-v0.9.30" +default-features = false + +[workspace.dependencies.orml-traits] +git = "https://github.com/uniquenetwork/open-runtime-module-library" +branch = "polkadot-v0.9.30" +default-features = false diff --git a/README.md b/README.md index cb8c607dae..c5c96c544f 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ git checkout feature/runtime-upgrade-testing ``` git clone https://github.com/paritytech/polkadot.git cd polkadot -git checkout release-v0.9.29 +git checkout release-v0.9.30 cargo build --release ``` diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index d071affdb8..c33a55967c 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -14,9 +14,9 @@ codec = { package = "parity-scale-codec", version = "3.1.2" } jsonrpsee = { version = "0.15.1", features = ["server", "macros"] } anyhow = "1.0.57" -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } diff --git a/crates/evm-coder/Cargo.toml b/crates/evm-coder/Cargo.toml index a559dc7e6c..5dcdc03330 100644 --- a/crates/evm-coder/Cargo.toml +++ b/crates/evm-coder/Cargo.toml @@ -11,10 +11,10 @@ evm-coder-procedural = { path = "./procedural" } primitive-types = { version = "0.11.1", default-features = false } # Evm doesn't have reexports for log and others ethereum = { version = "0.12.0", default-features = false } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } # Error types for execution -evm-core = { default-features = false , git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.29" } +evm-core = { default-features = false , git = "https://github.com/uniquenetwork/evm", branch = "unique-polkadot-v0.9.30" } # We have tuple-heavy code in solidity.rs impl-trait-for-tuples = "0.2.2" diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index a227a4a016..3c32b00684 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -3,7 +3,7 @@ [build-dependencies.substrate-build-script-utils] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" ################################################################################ # Substrate Dependecies @@ -16,158 +16,158 @@ version = '3.1.2' [dependencies.frame-benchmarking] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-benchmarking-cli] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.try-runtime-cli] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-transaction-payment-rpc] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.substrate-prometheus-endpoint] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-basic-authorship] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-chain-spec] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-cli] features = ['wasmtime'] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-client-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-consensus] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-consensus-aura] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-executor] features = ['wasmtime'] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-finality-grandpa] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-keystore] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-rpc] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-rpc-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-service] features = ['wasmtime'] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-telemetry] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-transaction-pool] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-tracing] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-sysinfo] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-block-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-blockchain] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-consensus] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-consensus-aura] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-core] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-finality-grandpa] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-inherents] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-keystore] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-offchain] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-runtime] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-session] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-timestamp] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-transaction-pool] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-trie] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.substrate-frame-rpc-system] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sc-network] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.serde] features = ['derive'] @@ -178,76 +178,76 @@ version = '1.0.68' [dependencies.sc-consensus-manual-seal] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" ################################################################################ # Cumulus dependencies [dependencies.cumulus-client-consensus-aura] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.cumulus-client-consensus-common] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.cumulus-client-collator] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.cumulus-client-cli] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.cumulus-client-network] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.cumulus-primitives-parachain-inherent] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.cumulus-client-service] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.cumulus-relay-chain-interface] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.cumulus-relay-chain-inprocess-interface] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.cumulus-relay-chain-rpc-interface] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" ################################################################################ # Polkadot dependencies [dependencies.polkadot-primitives] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" [dependencies.polkadot-service] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" [dependencies.polkadot-cli] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" [dependencies.polkadot-test-service] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" ################################################################################ @@ -277,7 +277,7 @@ path = "../../primitives/rpc" [dependencies.pallet-transaction-payment-rpc-runtime-api] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" ################################################################################ # Package @@ -291,7 +291,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'unique-node' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = "0.9.29" +version = "0.9.30" [[bin]] name = 'unique-collator' @@ -309,16 +309,16 @@ clap = "3.1.2" jsonrpsee = { version = "0.15.1", features = ["server", "macros"] } tokio = { version = "1.19.2", features = ["time"] } -fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fc-rpc-core = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fc-consensus = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fc-mapping-sync = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fc-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fc-db = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fp-rpc = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } unique-rpc = { default-features = false, path = "../rpc" } -app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} +app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false } rmrk-rpc = { path = "../../primitives/rmrk-rpc" } [features] @@ -328,6 +328,7 @@ runtime-benchmarks = [ 'quartz-runtime?/runtime-benchmarks', 'opal-runtime/runtime-benchmarks', 'polkadot-service/runtime-benchmarks', + 'sc-service/runtime-benchmarks', ] try-runtime = [ 'unique-runtime?/try-runtime', diff --git a/node/cli/src/cli.rs b/node/cli/src/cli.rs index 8133de2f34..62bab20472 100644 --- a/node/cli/src/cli.rs +++ b/node/cli/src/cli.rs @@ -52,6 +52,7 @@ pub enum Subcommand { /// The custom benchmark subcommmand benchmarking runtime pallets. #[clap(subcommand)] + #[cfg(feature = "runtime-benchmarks")] Benchmark(frame_benchmarking_cli::BenchmarkCmd), /// Try runtime diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index 27180a071c..211e6b6b75 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -371,19 +371,14 @@ pub fn run() -> Result<()> { cmd.run(&*spec) }) } + #[cfg(feature = "runtime-benchmarks")] Some(Subcommand::Benchmark(cmd)) => { use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE}; let runner = cli.create_runner(cmd)?; // Switch on the concrete benchmark sub-command- match cmd { BenchmarkCmd::Pallet(cmd) => { - if cfg!(feature = "runtime-benchmarks") { - runner.sync_run(|config| cmd.run::(config)) - } else { - Err("Benchmarking wasn't enabled when building the node. \ - You can enable it with `--features runtime-benchmarks`." - .into()) - } + runner.sync_run(|config| cmd.run::(config)) } BenchmarkCmd::Block(cmd) => runner.sync_run(|config| { let partials = new_partial::< diff --git a/node/cli/src/service.rs b/node/cli/src/service.rs index deab655b17..6972adcd1d 100644 --- a/node/cli/src/service.rs +++ b/node/cli/src/service.rs @@ -438,7 +438,7 @@ where let transaction_pool = params.transaction_pool.clone(); let import_queue = cumulus_client_service::SharedImportQueue::new(params.import_queue); - let (network, system_rpc_tx, start_network) = + let (network, system_rpc_tx, tx_handler_controller, start_network) = sc_service::build_network(sc_service::BuildNetworkParams { config: ¶chain_config, client: client.clone(), @@ -521,6 +521,7 @@ where network: network.clone(), system_rpc_tx, telemetry: telemetry.as_mut(), + tx_handler_controller, })?; if let Some(hwbench) = hwbench { @@ -538,7 +539,9 @@ where let announce_block = { let network = network.clone(); - Arc::new(move |hash, data| network.announce_block(hash, data)) + Arc::new(Box::new(move |hash, data| { + network.announce_block(hash, data) + })) }; let relay_chain_slot_duration = Duration::from_secs(6); @@ -623,7 +626,6 @@ where _, _, _, - _, >(cumulus_client_consensus_aura::ImportQueueParams { block_import: client.clone(), client: client.clone(), @@ -636,10 +638,9 @@ where slot_duration, ); - Ok((time, slot)) + Ok((slot, time)) }, registry: config.prometheus_registry(), - can_author_with: sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), spawner: &task_manager.spawn_essential_handle(), telemetry, }) @@ -747,7 +748,7 @@ where "Failed to create parachain inherent", ) })?; - Ok((time, slot, parachain_inherent)) + Ok((slot, time, parachain_inherent)) } }, block_import: client.clone(), @@ -861,7 +862,7 @@ where prometheus_registry.clone(), )); - let (network, system_rpc_tx, network_starter) = + let (network, system_rpc_tx, tx_handler_controller, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, client: client.clone(), @@ -952,12 +953,14 @@ where current_para_block, relay_offset: 1000, relay_blocks_per_para_block: 2, + para_blocks_per_relay_epoch: 0, xcm_config: cumulus_primitives_parachain_inherent::MockXcmConfig::new( &*client_for_xcm, block, Default::default(), Default::default(), ), + relay_randomness_config: (), raw_downward_messages: vec![], raw_horizontal_messages: vec![], }; @@ -1034,6 +1037,7 @@ where system_rpc_tx, config, telemetry: None, + tx_handler_controller, })?; network_starter.start_network(); diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index c6fa1b7fbb..1bfa18bf3e 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -13,40 +13,40 @@ targets = ["x86_64-unknown-linux-gnu"] futures = { version = "0.3.17", features = ["compat"] } jsonrpsee = { version = "0.15.1", features = ["server", "macros"] } # pallet-contracts-rpc = { git = 'https://github.com/paritytech/substrate', branch = 'master' } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } tokio = { version = "1.19.2", features = ["macros", "sync"] } -pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fp-storage = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } pallet-common = { default-features = false, path = "../../pallets/common" } up-common = { path = "../../primitives/common" } diff --git a/pallets/app-promotion/Cargo.toml b/pallets/app-promotion/Cargo.toml index cfec3e80ef..6e42ebc522 100644 --- a/pallets/app-promotion/Cargo.toml +++ b/pallets/app-promotion/Cargo.toml @@ -48,17 +48,17 @@ scale-info = { version = "2.0.1", default-features = false, features = [ # Substrate Dependencies codec = { default-features = false, features = ['derive'], package = 'parity-scale-codec', version = '3.1.2' } -frame-benchmarking = {default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-balances ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-timestamp ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-randomness-collective-flip ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm ={ default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -sp-std ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-io ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-benchmarking = {default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-balances ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-timestamp ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-randomness-collective-flip ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-evm ={ default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +sp-std ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-io ={ default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } serde = { default-features = false, features = ['derive'], version = '1.0.130' } ################################################################################ diff --git a/pallets/app-promotion/src/lib.rs b/pallets/app-promotion/src/lib.rs index 2c03a6ffc0..d87ad33e0b 100644 --- a/pallets/app-promotion/src/lib.rs +++ b/pallets/app-promotion/src/lib.rs @@ -27,7 +27,7 @@ //! The App Promotion pallet allows fund holders to stake at a certain daily rate of return. //! The mechanics implemented in the pallet allow it to act as a sponsor for collections / contracts, //! the list of which is set by the pallet administrator. -//! +//! //! //! ## Interface //! The pallet provides interfaces for funds, collection/contract operations (see [types] module). @@ -146,7 +146,7 @@ pub mod pallet { type RelayBlockNumberProvider: BlockNumberProvider; /// Events compatible with [`frame_system::Config::Event`]. - type Event: IsType<::Event> + From>; + type RuntimeEvent: IsType<::RuntimeEvent> + From>; } #[pallet::pallet] diff --git a/pallets/common/Cargo.toml b/pallets/common/Cargo.toml index 17bbfdb3b2..645e45bb75 100644 --- a/pallets/common/Cargo.toml +++ b/pallets/common/Cargo.toml @@ -11,18 +11,18 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } ethereum = { version = "0.12.0", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } serde = { version = "1.0.130", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/common/src/dispatch.rs b/pallets/common/src/dispatch.rs index dbafded39e..3a75e52599 100644 --- a/pallets/common/src/dispatch.rs +++ b/pallets/common/src/dispatch.rs @@ -5,7 +5,7 @@ use frame_support::{ DispatchResultWithPostInfo, PostDispatchInfo, Weight, DispatchErrorWithPostInfo, DispatchResult, }, - weights::Pays, + dispatch::Pays, traits::Get, }; use sp_runtime::DispatchError; diff --git a/pallets/common/src/lib.rs b/pallets/common/src/lib.rs index 90586777de..008a057d61 100644 --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -62,7 +62,7 @@ use frame_support::{ dispatch::{DispatchErrorWithPostInfo, DispatchResultWithPostInfo, Weight, PostDispatchInfo}, ensure, traits::{Imbalance, Get, Currency, WithdrawReasons, ExistenceRequirement}, - weights::Pays, + dispatch::Pays, transactional, }; use pallet_evm::GasWeightMapping; @@ -363,7 +363,7 @@ pub mod pallet { type WeightInfo: WeightInfo; /// Events compatible with [`frame_system::Config::Event`]. - type Event: IsType<::Event> + From>; + type RuntimeEvent: IsType<::RuntimeEvent> + From>; /// Handler of accounts and payment. type Currency: Currency; diff --git a/pallets/configuration/Cargo.toml b/pallets/configuration/Cargo.toml index c833e13a41..4065654fba 100644 --- a/pallets/configuration/Cargo.toml +++ b/pallets/configuration/Cargo.toml @@ -10,13 +10,13 @@ parity-scale-codec = { version = "3.1.5", features = [ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } smallvec = "1.6.1" [features] diff --git a/pallets/evm-coder-substrate/Cargo.toml b/pallets/evm-coder-substrate/Cargo.toml index 67677c4bc0..a24f275296 100644 --- a/pallets/evm-coder-substrate/Cargo.toml +++ b/pallets/evm-coder-substrate/Cargo.toml @@ -8,15 +8,15 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } ethereum = { version = "0.12.0", default-features = false } evm-coder = { default-features = false, path = "../../crates/evm-coder" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } up-data-structs = { default-features = false, path = "../../primitives/data-structs" } [dependencies.codec] diff --git a/pallets/evm-contract-helpers/Cargo.toml b/pallets/evm-contract-helpers/Cargo.toml index f58b026b23..287044a30e 100644 --- a/pallets/evm-contract-helpers/Cargo.toml +++ b/pallets/evm-contract-helpers/Cargo.toml @@ -12,16 +12,16 @@ log = { default-features = false, version = "0.4.14" } ethereum = { version = "0.12.0", default-features = false } # Substrate -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } # Unique -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.30" } # Locals evm-coder = { default-features = false, path = '../../crates/evm-coder' } diff --git a/pallets/evm-contract-helpers/src/lib.rs b/pallets/evm-contract-helpers/src/lib.rs index 0d046d14f9..7cd363cc19 100644 --- a/pallets/evm-contract-helpers/src/lib.rs +++ b/pallets/evm-contract-helpers/src/lib.rs @@ -44,7 +44,7 @@ pub mod pallet { frame_system::Config + pallet_evm_coder_substrate::Config + pallet_evm::account::Config { /// Overarching event type. - type Event: IsType<::Event> + From>; + type RuntimeEvent: IsType<::RuntimeEvent> + From>; /// Address, under which magic contract will be available type ContractAddress: Get; diff --git a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.raw index cf9f50574e403b7c7e362033d1b132b82df32fb8..23965de27548bc9ca3cd44c6bc6bfe6309422031 100644 GIT binary patch delta 53 zcmV-50LuTk4!91m=LRVd9HEvtnTd}SupFRb8M>VUQ7?+>(3#K_TRQ@L(Wc^Lb8l>8 LLjVX5lMn|eRH+o= delta 53 zcmV-50LuTk4!91m=LRVxohpX6w=di)3V!N)zb4Yv1GC)wGi`vAx^<3TFCm#^b8l>8 LLjVX7lMn|elg}1t diff --git a/pallets/evm-migration/Cargo.toml b/pallets/evm-migration/Cargo.toml index 2535746082..9419937983 100644 --- a/pallets/evm-migration/Cargo.toml +++ b/pallets/evm-migration/Cargo.toml @@ -8,15 +8,15 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } [dependencies.codec] default-features = false diff --git a/pallets/evm-transaction-payment/Cargo.toml b/pallets/evm-transaction-payment/Cargo.toml index 8ce830c8ff..7f7bae15ce 100644 --- a/pallets/evm-transaction-payment/Cargo.toml +++ b/pallets/evm-transaction-payment/Cargo.toml @@ -8,17 +8,17 @@ edition = "2021" scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fp-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.30" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } [dependencies.codec] default-features = false diff --git a/pallets/foreign-assets/Cargo.toml b/pallets/foreign-assets/Cargo.toml index 44ffdccf31..7537889406 100644 --- a/pallets/foreign-assets/Cargo.toml +++ b/pallets/foreign-assets/Cargo.toml @@ -9,28 +9,27 @@ log = { version = "0.4.16", default-features = false } serde = { version = "1.0.136", optional = true } scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } pallet-common = { default-features = false, path = '../common' } pallet-fungible = { default-features = false, path = '../fungible' } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false } -#orml-tokens = { git = 'https://github.com/UniqueNetwork/open-runtime-module-library', branch = 'unique-polkadot-v0.9.24', version = "0.4.1-dev", default-features = false } -orml-tokens = { git = "https://github.com/UniqueNetwork/open-runtime-module-library", branch = "polkadot-v0.9.29", version = "0.4.1-dev", default-features = false } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30", default-features = false } +xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30", default-features = false } +xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.30", default-features = false } +orml-tokens.workspace = true +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } [dev-dependencies] serde_json = "1.0.68" hex = { version = "0.4" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } [features] default = ["std"] diff --git a/pallets/foreign-assets/src/lib.rs b/pallets/foreign-assets/src/lib.rs index b6c42be20e..8021267186 100644 --- a/pallets/foreign-assets/src/lib.rs +++ b/pallets/foreign-assets/src/lib.rs @@ -180,13 +180,13 @@ pub mod module { + pallet_balances::Config { /// The overarching event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// Currency type for withdraw and balance storage. type Currency: Currency; /// Required origin for registering asset. - type RegisterOrigin: EnsureOrigin; + type RegisterOrigin: EnsureOrigin; /// Weight information for the extrinsics in this module. type WeightInfo: WeightInfo; diff --git a/pallets/fungible/Cargo.toml b/pallets/fungible/Cargo.toml index 57cfce8623..8669d9e75a 100644 --- a/pallets/fungible/Cargo.toml +++ b/pallets/fungible/Cargo.toml @@ -11,19 +11,19 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' } ethereum = { version = "0.12.0", default-features = false } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } diff --git a/pallets/fungible/src/stubs/UniqueFungible.raw b/pallets/fungible/src/stubs/UniqueFungible.raw index b90e012e3774d13accc0032fb1695536711894b2..6a25cedd15c322f06bca5cd8cad668bcf52310ac 100644 GIT binary patch delta 1248 zcmZuwS!h#H5Y27ha+4HmtqG>FZR%FFq9CTOXrv-lRIX9-q)+i)7o;e-mWmXcw41S(1Tmo(3!HzU`l6Y8(7)8W-2i`&R0v5Yrl^6DYu2Sl$9+M z2(_J`kmfYK9qq$XiB(@>4fFTXg0-a(|5O1flKvChCSr$K`JkXHAf;;I8t{7bU+3-e zBJ_e^lBdcqQaYvlhCBi65ArPd9k28>7)DiyN#8ZxsD@s8Sc}V+{fgtyj5*%83JPn44_CPa}I%j->%=@X99!#5fC2> z2tws3)O7@g#?n@%d|Zer3U3I8W-7HVkp&$XC{xXp*{&lUXUcM>EHRn<1SXU(@Gol3 zJn9DXHp=U!Jr>Gb)o8-*DO5Zvf(A6LWSQInNy?dwXnq;4K|6UHj!qnQ)0y(jhCoWs z6Q;bSu?!Nh9G=t^)R-D9G|kjHT5lJ0f!={Xr8~qll9pv57*CzcU*X2?Hm{&`+Opz> zLdq90W|}74G1V>?Va7+)Neg+@vtFipF$-H@>Z+8^iKr0I5f^dCMUW9`)JMgf=NS{& zY!qdJE=Ne7AxZQQYesJf=e&F#?Ip^e}CbE!Y8OS+qL3R`FbGuBw6 zoCPBMPH=K-vqq6Io(0xuEYJz8za!bOnY2S8coin?!E7wSs$~rJF~Mp?68>CXjd^}6N^M!xbA8$-O~Fm*~nKUO6=UP zVF~xn>)Q{?M=6o;gOHDuL@DLR{*p)u`J?!ub>6u%?0SDpbDrni=bZDLb2iD6QSy#- zsbmT%7>4Th25Pt5jGjg4&aG?cSa3`zuhU=;4KANWLR4sH-J#ZTUxs7ibso*5!8trb z>Sc#Q9ofMV*ze&HZX6LkWgkMbmq{a1_&^~?#ZD^bOe#Ewo`q9+9XuzZ=X%X1vXE;T$UR_18>qO(|Dt50l5W~#0lBD= zE_3AY z<@Az5#X*vG5TEljo|p}3RDw0H21zMFT5K2~87FDrp;cEg4b`$N1pP@__7P`Vdn$sV zBbJpb3yGh>@<4%fSq^Vi+QmBL#L^>`Jn2l)I)JFOFt0O(=jS}7U~;`1eunbbGwE^l zo7avB+BTx%XLeLhpfBu-JaNjHzoo%V7=2h#oUL$pCi^C*Cav^CK8=BjF^YSA0M>!G zSJuJW!%Z`e`S?H6@okOb%f4Br%JH(D_;_9~oKW~S z!`s2ep=2>`s&+#I5#T0IDn1%G40oD#(}@>#^Tp(M>vwM3ylzndN7;_rwm%38cyRy# diff --git a/pallets/inflation/Cargo.toml b/pallets/inflation/Cargo.toml index 3202e22d73..b4d4e6dc56 100644 --- a/pallets/inflation/Cargo.toml +++ b/pallets/inflation/Cargo.toml @@ -44,37 +44,37 @@ version = '3.1.2' default-features = false optional = true git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.serde] default-features = false @@ -84,17 +84,17 @@ version = '1.0.130' [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies] scale-info = { version = "2.0.1", default-features = false, features = [ diff --git a/pallets/inflation/src/tests.rs b/pallets/inflation/src/tests.rs index 3ce875f299..5ce553c2ad 100644 --- a/pallets/inflation/src/tests.rs +++ b/pallets/inflation/src/tests.rs @@ -47,7 +47,7 @@ impl pallet_balances::Config for Test { type AccountStore = System; type Balance = u64; type DustRemoval = (); - type Event = (); + type RuntimeEvent = (); type ExistentialDeposit = ExistentialDeposit; type WeightInfo = (); type MaxLocks = MaxLocks; @@ -79,8 +79,8 @@ impl frame_system::Config for Test { type BlockWeights = (); type BlockLength = (); type DbWeight = (); - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -88,7 +88,7 @@ impl frame_system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = (); + type RuntimeEvent = (); type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; diff --git a/pallets/nonfungible/Cargo.toml b/pallets/nonfungible/Cargo.toml index ce03c95126..a392482e60 100644 --- a/pallets/nonfungible/Cargo.toml +++ b/pallets/nonfungible/Cargo.toml @@ -11,19 +11,19 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' } ethereum = { version = "0.12.0", default-features = false } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } diff --git a/pallets/nonfungible/src/lib.rs b/pallets/nonfungible/src/lib.rs index 2387721474..4da741500f 100644 --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -97,7 +97,7 @@ use frame_support::{ storage::with_transaction, pallet_prelude::DispatchResultWithPostInfo, pallet_prelude::Weight, - weights::{PostDispatchInfo, Pays}, + dispatch::{PostDispatchInfo, Pays}, }; use up_data_structs::{ AccessMode, CollectionId, CollectionFlags, CustomDataLimit, TokenId, CreateCollectionData, diff --git a/pallets/proxy-rmrk-core/Cargo.toml b/pallets/proxy-rmrk-core/Cargo.toml index c0443d01ae..16bd4c987f 100644 --- a/pallets/proxy-rmrk-core/Cargo.toml +++ b/pallets/proxy-rmrk-core/Cargo.toml @@ -11,17 +11,17 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } pallet-structure = { default-features = false, path = "../../pallets/structure" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", diff --git a/pallets/proxy-rmrk-core/src/lib.rs b/pallets/proxy-rmrk-core/src/lib.rs index 666ae1f43c..33db5f30b0 100644 --- a/pallets/proxy-rmrk-core/src/lib.rs +++ b/pallets/proxy-rmrk-core/src/lib.rs @@ -197,7 +197,7 @@ pub mod pallet { frame_system::Config + pallet_common::Config + pallet_nonfungible::Config + account::Config { /// Overarching event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The weight information of this pallet. type WeightInfo: WeightInfo; diff --git a/pallets/proxy-rmrk-equip/Cargo.toml b/pallets/proxy-rmrk-equip/Cargo.toml index da8986cd9a..c786411b6a 100644 --- a/pallets/proxy-rmrk-equip/Cargo.toml +++ b/pallets/proxy-rmrk-equip/Cargo.toml @@ -11,16 +11,16 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } pallet-common = { default-features = false, path = '../common' } pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } rmrk-traits = { default-features = false, path = "../../primitives/rmrk-traits" } scale-info = { version = "2.0.1", default-features = false, features = [ "derive", diff --git a/pallets/proxy-rmrk-equip/src/lib.rs b/pallets/proxy-rmrk-equip/src/lib.rs index c8d4e4f6d5..82b2719626 100644 --- a/pallets/proxy-rmrk-equip/src/lib.rs +++ b/pallets/proxy-rmrk-equip/src/lib.rs @@ -163,7 +163,7 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config + pallet_rmrk_core::Config { /// Overarching event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The weight information of this pallet. type WeightInfo: WeightInfo; diff --git a/pallets/refungible/Cargo.toml b/pallets/refungible/Cargo.toml index 029a592322..93de8f9923 100644 --- a/pallets/refungible/Cargo.toml +++ b/pallets/refungible/Cargo.toml @@ -11,17 +11,17 @@ package = 'parity-scale-codec' version = '3.1.2' [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } pallet-common = { default-features = false, path = '../common' } pallet-structure = { default-features = false, path = '../structure' } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } struct-versioning = { path = "../../crates/struct-versioning" } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } diff --git a/pallets/scheduler/Cargo.toml b/pallets/scheduler/Cargo.toml index 52edbbe389..5e9cff8247 100644 --- a/pallets/scheduler/Cargo.toml +++ b/pallets/scheduler/Cargo.toml @@ -16,20 +16,20 @@ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.29' } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.30' } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } -up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29" } +up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.30" } log = { version = "0.4.16", default-features = false } [dev-dependencies] -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } [features] default = ["std"] diff --git a/pallets/scheduler/src/lib.rs b/pallets/scheduler/src/lib.rs index ead4fc0a39..57bbf00bfb 100644 --- a/pallets/scheduler/src/lib.rs +++ b/pallets/scheduler/src/lib.rs @@ -86,13 +86,13 @@ use sp_runtime::{ use sp_std::{borrow::Borrow, cmp::Ordering, marker::PhantomData, prelude::*}; use frame_support::{ - dispatch::{DispatchError, DispatchResult, Dispatchable, Parameter}, + dispatch::{DispatchError, DispatchResult, Dispatchable, Parameter, GetDispatchInfo}, traits::{ schedule::{self, DispatchTime, MaybeHashed}, NamedReservableCurrency, EnsureOrigin, Get, IsType, OriginTrait, PrivilegeCmp, StorageVersion, }, - weights::{GetDispatchInfo, Weight}, + weights::{Weight}, }; pub use weights::WeightInfo; @@ -104,7 +104,8 @@ pub type TaskAddress = (BlockNumber, u32); pub const MAX_TASK_ID_LENGTH_IN_BYTES: u8 = 16; type ScheduledId = [u8; MAX_TASK_ID_LENGTH_IN_BYTES as usize]; -pub type CallOrHashOf = MaybeHashed<::Call, ::Hash>; +pub type CallOrHashOf = + MaybeHashed<::RuntimeCall, ::Hash>; /// Information regarding an item to be executed in the future. #[cfg_attr(any(feature = "std", test), derive(PartialEq, Eq))] @@ -209,12 +210,12 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// The overarching event type. - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The aggregated origin which the dispatch will take. - type Origin: OriginTrait + type RuntimeOrigin: OriginTrait + From - + IsType<::Origin>; + + IsType<::RuntimeOrigin>; /// The caller origin, overarching type of all pallets origins. type PalletsOrigin: From> + Codec + Clone + Eq + TypeInfo; @@ -222,9 +223,11 @@ pub mod pallet { type Currency: NamedReservableCurrency; /// The aggregated call type. - type Call: Parameter - + Dispatchable::Origin, PostInfo = PostDispatchInfo> - + GetDispatchInfo + type RuntimeCall: Parameter + + Dispatchable< + RuntimeOrigin = ::RuntimeOrigin, + PostInfo = PostDispatchInfo, + > + GetDispatchInfo + From>; /// The maximum weight that may be scheduled per block for any dispatchables of less @@ -233,7 +236,7 @@ pub mod pallet { type MaximumWeight: Get; /// Required origin to schedule or cancel calls. - type ScheduleOrigin: EnsureOrigin<::Origin>; + type ScheduleOrigin: EnsureOrigin<::RuntimeOrigin>; /// Compare the privileges of origins. /// @@ -271,7 +274,7 @@ pub mod pallet { fn reserve_balance( id: ScheduledId, sponsor: ::AccountId, - call: ::Call, + call: ::RuntimeCall, count: u32, ) -> Result<(), DispatchError>; @@ -279,13 +282,13 @@ pub mod pallet { fn pay_for_call( id: ScheduledId, sponsor: ::AccountId, - call: ::Call, + call: ::RuntimeCall, ) -> Result; /// Resolve the call dispatch, including any post-dispatch operations. fn dispatch_call( signer: T::AccountId, - function: ::Call, + function: ::RuntimeCall, ) -> Result< Result>, TransactionValidityError, @@ -404,9 +407,10 @@ pub mod pallet { let periodic = s.maybe_periodic.is_some(); let call_weight = call.get_dispatch_info().weight; let mut item_weight = T::WeightInfo::item(periodic, named, Some(resolved)); - let origin = - <::Origin as From>::from(s.origin.clone()) - .into(); + let origin = <::RuntimeOrigin as From>::from( + s.origin.clone(), + ) + .into(); if ensure_signed(origin).is_ok() { // Weights of Signed dispatches expect their signing account to be whitelisted. item_weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1)); @@ -420,7 +424,7 @@ pub mod pallet { let test_weight = total_weight .saturating_add(call_weight) .saturating_add(item_weight); - if !hard_deadline && order > 0 && test_weight > limit { + if !hard_deadline && order > 0 && test_weight.all_gt(limit) { // Cannot be scheduled this block - postpone until next. total_weight.saturating_accrue(T::WeightInfo::item(false, named, None)); if let Some(ref id) = s.maybe_id { @@ -436,8 +440,10 @@ pub mod pallet { } let sender = ensure_signed( - <::Origin as From>::from(s.origin.clone()) - .into(), + <::RuntimeOrigin as From>::from( + s.origin.clone(), + ) + .into(), ) .unwrap(); @@ -514,7 +520,7 @@ pub mod pallet { call: Box>, ) -> DispatchResult { T::ScheduleOrigin::ensure_origin(origin.clone())?; - let origin = ::Origin::from(origin); + let origin = ::RuntimeOrigin::from(origin); Self::do_schedule_named( id, DispatchTime::At(when), @@ -530,7 +536,7 @@ pub mod pallet { #[pallet::weight(::WeightInfo::cancel_named(T::MaxScheduledPerBlock::get()))] pub fn cancel_named(origin: OriginFor, id: ScheduledId) -> DispatchResult { T::ScheduleOrigin::ensure_origin(origin.clone())?; - let origin = ::Origin::from(origin); + let origin = ::RuntimeOrigin::from(origin); Self::do_cancel_named(Some(origin.caller().clone()), id)?; Ok(()) } @@ -550,7 +556,7 @@ pub mod pallet { call: Box>, ) -> DispatchResult { T::ScheduleOrigin::ensure_origin(origin.clone())?; - let origin = ::Origin::from(origin); + let origin = ::RuntimeOrigin::from(origin); Self::do_schedule_named( id, DispatchTime::After(after), diff --git a/pallets/structure/Cargo.toml b/pallets/structure/Cargo.toml index 712adb5ed9..167c9e1962 100644 --- a/pallets/structure/Cargo.toml +++ b/pallets/structure/Cargo.toml @@ -4,10 +4,10 @@ version = "0.1.2" edition = "2021" [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } pallet-common = { path = "../common", default-features = false } parity-scale-codec = { version = "3.1.2", default-features = false, features = [ "derive", @@ -16,7 +16,7 @@ scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } up-data-structs = { path = "../../primitives/data-structs", default-features = false } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } [features] default = ["std"] diff --git a/pallets/structure/src/lib.rs b/pallets/structure/src/lib.rs index 825e9acb12..043d7bd453 100644 --- a/pallets/structure/src/lib.rs +++ b/pallets/structure/src/lib.rs @@ -97,8 +97,10 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config + pallet_common::Config { type WeightInfo: weights::WeightInfo; - type Event: IsType<::Event> + From>; - type Call: Parameter + UnfilteredDispatchable + GetDispatchInfo; + type RuntimeEvent: IsType<::RuntimeEvent> + From>; + type RuntimeCall: Parameter + + UnfilteredDispatchable + + GetDispatchInfo; } #[pallet::pallet] diff --git a/pallets/unique/Cargo.toml b/pallets/unique/Cargo.toml index 470f102d8f..2a4580876f 100644 --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -60,37 +60,37 @@ version = '3.1.2' default-features = false optional = true git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" ################################################################################ # Local Dependencies @@ -99,7 +99,7 @@ up-data-structs = { default-features = false, path = "../../primitives/data-stru scale-info = { version = "2.0.1", default-features = false, features = [ "derive", ] } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } pallet-common = { default-features = false, path = "../common" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } pallet-evm-coder-substrate = { default-features = false, path = '../../pallets/evm-coder-substrate' } diff --git a/pallets/unique/src/eth/stubs/CollectionHelpers.raw b/pallets/unique/src/eth/stubs/CollectionHelpers.raw index 16cd1598a2ee4a4a6729d45baf3b4355630b486f..7d9a32abc1b6dfc1b07abedc4b1f9cb7f7d73c85 100644 GIT binary patch delta 53 zcmV-50LuT~3*HN`jRh$!y|;W2*DkwmO$6fB%rK7W?!0B^ZB|HJDUu0Ak}-c|b8l>8 LLjVX5lePsYmz@@( delta 53 zcmV-50LuT~3*HN`jRh&WzxD0FM~GXEYEEfT{TBBY?IxBDuiLh@t^5<97&2O9b8l>8 LLjVX7lePsY&1V=g diff --git a/pallets/unique/src/lib.rs b/pallets/unique/src/lib.rs index de710baa51..496aebb416 100644 --- a/pallets/unique/src/lib.rs +++ b/pallets/unique/src/lib.rs @@ -122,7 +122,7 @@ decl_error! { /// Configuration trait of this pallet. pub trait Config: system::Config + pallet_common::Config + Sized + TypeInfo { /// Overarching event type. - type Event: From> + Into<::Event>; + type RuntimeEvent: From> + Into<::RuntimeEvent>; /// Weight information for extrinsics in this pallet. type WeightInfo: WeightInfo; @@ -273,7 +273,7 @@ decl_module! { /// Type alias to Pallet, to be used by construct_runtime. pub struct Module for enum Call where - origin: T::Origin + origin: T::RuntimeOrigin { type Error = Error; diff --git a/primitives/app_promotion_rpc/Cargo.toml b/primitives/app_promotion_rpc/Cargo.toml index 32ff478fe6..13189ea573 100644 --- a/primitives/app_promotion_rpc/Cargo.toml +++ b/primitives/app_promotion_rpc/Cargo.toml @@ -10,11 +10,11 @@ up-data-structs = { default-features = false, path = '../data-structs' } codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [ "derive", ] } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } [features] default = ["std"] diff --git a/primitives/common/Cargo.toml b/primitives/common/Cargo.toml index 96c13d54fc..08dcd7ab3a 100644 --- a/primitives/common/Cargo.toml +++ b/primitives/common/Cargo.toml @@ -6,7 +6,7 @@ homepage = 'https://unique.network' license = 'All Rights Reserved' name = 'up-common' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = "0.9.29" +version = "0.9.30" [features] default = ['std'] @@ -23,34 +23,34 @@ std = [ [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.fp-rpc] default-features = false git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.29" +branch = "unique-polkadot-v0.9.30" [dependencies.pallet-evm] default-features = false git = "https://github.com/uniquenetwork/frontier" -branch = "unique-polkadot-v0.9.29" +branch = "unique-polkadot-v0.9.30" diff --git a/primitives/data-structs/Cargo.toml b/primitives/data-structs/Cargo.toml index 07310329ac..5c01ad43fe 100644 --- a/primitives/data-structs/Cargo.toml +++ b/primitives/data-structs/Cargo.toml @@ -18,14 +18,14 @@ codec = { package = "parity-scale-codec", version = "3.1.2", default-features = serde = { version = "1.0.130", features = [ 'derive', ], default-features = false, optional = true } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } derivative = { version = "2.2.0", features = ["use_core"] } struct-versioning = { path = "../../crates/struct-versioning" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } rmrk-traits = { default-features = false, path = "../rmrk-traits" } bondrewd = { version = "0.1.14", features = ["derive"], default-features = false } diff --git a/primitives/rmrk-rpc/Cargo.toml b/primitives/rmrk-rpc/Cargo.toml index c779b5464e..874fccdc61 100644 --- a/primitives/rmrk-rpc/Cargo.toml +++ b/primitives/rmrk-rpc/Cargo.toml @@ -8,10 +8,10 @@ edition = "2021" codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ "derive", ] } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } serde = { version = "1.0.130", default-features = false, features = ["derive"] } rmrk-traits = { default-features = false, path = "../rmrk-traits" } diff --git a/primitives/rpc/Cargo.toml b/primitives/rpc/Cargo.toml index 3a230c0ceb..43b647aeff 100644 --- a/primitives/rpc/Cargo.toml +++ b/primitives/rpc/Cargo.toml @@ -10,11 +10,11 @@ up-data-structs = { default-features = false, path = '../data-structs' } codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false, features = [ "derive", ] } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } [features] default = ["std"] diff --git a/runtime/common/config/ethereum.rs b/runtime/common/config/ethereum.rs index 6c17185530..8ee74a9711 100644 --- a/runtime/common/config/ethereum.rs +++ b/runtime/common/config/ethereum.rs @@ -10,7 +10,7 @@ use crate::{ dispatch::CollectionDispatchT, ethereum::sponsoring::EvmSponsorshipHandler, config::sponsoring::DefaultSponsoringRateLimit, DealWithFees, }, - Runtime, Aura, Balances, Event, ChainId, + Runtime, Aura, Balances, RuntimeEvent, ChainId, }; use pallet_evm::{EnsureAddressTruncated, HashedAddressMapping}; use up_common::constants::*; @@ -75,7 +75,7 @@ impl pallet_evm::Config for Runtime { type PrecompilesType = (); type PrecompilesValue = (); type Currency = Balances; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnMethodCall = ( pallet_evm_migration::OnMethodCall, pallet_evm_contract_helpers::HelpersOnMethodCall, @@ -95,7 +95,7 @@ impl pallet_evm_migration::Config for Runtime { } impl pallet_ethereum::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type StateRoot = pallet_ethereum::IntermediateStateRoot; } @@ -112,7 +112,7 @@ parameter_types! { } impl pallet_evm_contract_helpers::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ContractAddress = HelpersContractAddress; type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit; } diff --git a/runtime/common/config/orml.rs b/runtime/common/config/orml.rs index 7b4d0c6c1a..28b96b0b16 100644 --- a/runtime/common/config/orml.rs +++ b/runtime/common/config/orml.rs @@ -28,7 +28,7 @@ use xcm_executor::XcmExecutor; use sp_std::{vec, vec::Vec}; use pallet_foreign_assets::{CurrencyId, NativeCurrency}; use crate::{ - Runtime, Event, RelayChainBlockNumberProvider, + Runtime, RuntimeEvent, RelayChainBlockNumberProvider, runtime_common::config::{ xcm::{ SelfLocation, Weigher, XcmConfig, Ancestry, @@ -96,7 +96,7 @@ impl Convert for AccountIdToMultiLocation { } impl orml_vesting::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = pallet_balances::Pallet; type MinVestedTransfer = MinVestedTransfer; type VestedTransferOrigin = EnsureSigned; @@ -106,13 +106,16 @@ impl orml_vesting::Config for Runtime { } impl orml_tokens::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type Amount = Amount; type CurrencyId = CurrencyId; type WeightInfo = (); type ExistentialDeposits = ExistentialDeposits; type OnDust = orml_tokens::TransferDust; + type OnSlash = (); + type OnTransfer = (); + type OnDeposit = (); type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; // TODO: Add all module accounts @@ -124,7 +127,7 @@ impl orml_tokens::Config for Runtime { } impl orml_xtokens::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Balance = Balance; type CurrencyId = CurrencyId; type CurrencyIdConvert = CurrencyIdConvert; diff --git a/runtime/common/config/pallets/app_promotion.rs b/runtime/common/config/pallets/app_promotion.rs index 114660af35..e59bb1743f 100644 --- a/runtime/common/config/pallets/app_promotion.rs +++ b/runtime/common/config/pallets/app_promotion.rs @@ -16,7 +16,7 @@ use crate::{ runtime_common::config::pallets::{TreasuryAccountId, RelayChainBlockNumberProvider}, - Runtime, Balances, BlockNumber, Unique, Event, EvmContractHelpers, + Runtime, Balances, BlockNumber, Unique, RuntimeEvent, EvmContractHelpers, }; use frame_support::{parameter_types, PalletId}; @@ -59,5 +59,5 @@ impl pallet_app_promotion::Config for Runtime { // type Day = Day; type Nominal = Nominal; type IntervalIncome = IntervalIncome; - type Event = Event; + type RuntimeEvent = RuntimeEvent; } diff --git a/runtime/common/config/pallets/foreign_asset.rs b/runtime/common/config/pallets/foreign_asset.rs index b83c188b0f..a93e3679fc 100644 --- a/runtime/common/config/pallets/foreign_asset.rs +++ b/runtime/common/config/pallets/foreign_asset.rs @@ -1,8 +1,8 @@ -use crate::{Runtime, Event, Balances}; +use crate::{Runtime, RuntimeEvent, Balances}; use up_common::types::AccountId; impl pallet_foreign_assets::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type RegisterOrigin = frame_system::EnsureRoot; type WeightInfo = pallet_foreign_assets::weights::SubstrateWeight; diff --git a/runtime/common/config/pallets/mod.rs b/runtime/common/config/pallets/mod.rs index 6b56d865fb..48e34bcd09 100644 --- a/runtime/common/config/pallets/mod.rs +++ b/runtime/common/config/pallets/mod.rs @@ -23,7 +23,7 @@ use crate::{ weights::CommonWeights, RelayChainBlockNumberProvider, }, - Runtime, Event, Call, Balances, + Runtime, RuntimeEvent, RuntimeCall, Balances, }; use frame_support::traits::{ConstU32, ConstU64}; use up_common::{ @@ -53,7 +53,7 @@ parameter_types! { impl pallet_common::Config for Runtime { type WeightInfo = pallet_common::weights::SubstrateWeight; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type CollectionCreationPrice = CollectionCreationPrice; type TreasuryAccountId = TreasuryAccountId; @@ -65,8 +65,8 @@ impl pallet_common::Config for Runtime { } impl pallet_structure::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type WeightInfo = pallet_structure::weights::SubstrateWeight; } @@ -93,7 +93,7 @@ impl pallet_inflation::Config for Runtime { } impl pallet_unique::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = pallet_unique::weights::SubstrateWeight; type CommonWeightInfo = CommonWeights; type RefungibleExtensionsWeightInfo = CommonWeights; diff --git a/runtime/common/config/pallets/rmrk.rs b/runtime/common/config/pallets/rmrk.rs index 4fe0740cf6..0f5cfcd066 100644 --- a/runtime/common/config/pallets/rmrk.rs +++ b/runtime/common/config/pallets/rmrk.rs @@ -14,14 +14,14 @@ // You should have received a copy of the GNU General Public License // along with Unique Network. If not, see . -use crate::{Runtime, Event}; +use crate::{Runtime, RuntimeEvent}; impl pallet_proxy_rmrk_core::Config for Runtime { type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight; - type Event = Event; + type RuntimeEvent = RuntimeEvent; } impl pallet_proxy_rmrk_equip::Config for Runtime { type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight; - type Event = Event; + type RuntimeEvent = RuntimeEvent; } diff --git a/runtime/common/config/pallets/scheduler.rs b/runtime/common/config/pallets/scheduler.rs index effcb78d3b..fb5dd293a3 100644 --- a/runtime/common/config/pallets/scheduler.rs +++ b/runtime/common/config/pallets/scheduler.rs @@ -43,11 +43,11 @@ impl PrivilegeCmp for OriginPrivilegeCmp { } impl pallet_unique_scheduler::Config for Runtime { - type Event = Event; - type Origin = Origin; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; type Currency = Balances; type PalletsOrigin = OriginCaller; - type Call = Call; + type RuntimeCall = RuntimeCall; type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureSigned; type MaxScheduledPerBlock = MaxScheduledPerBlock; diff --git a/runtime/common/config/parachain.rs b/runtime/common/config/parachain.rs index 0e6fc516c1..5618e4bb17 100644 --- a/runtime/common/config/parachain.rs +++ b/runtime/common/config/parachain.rs @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . use frame_support::{weights::Weight, parameter_types}; -use crate::{Runtime, Event, XcmpQueue, DmpQueue}; +use crate::{Runtime, RuntimeEvent, XcmpQueue, DmpQueue}; use up_common::constants::*; parameter_types! { @@ -24,7 +24,7 @@ parameter_types! { } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type SelfParaId = parachain_info::Pallet; type OnSystemEvent = (); // type DownwardMessageHandlers = cumulus_primitives_utility::UnqueuedDmpAsParent< diff --git a/runtime/common/config/substrate.rs b/runtime/common/config/substrate.rs index 268990cbbf..0b4362e391 100644 --- a/runtime/common/config/substrate.rs +++ b/runtime/common/config/substrate.rs @@ -18,8 +18,9 @@ use frame_support::{ traits::{Everything, ConstU32, NeverEnsureOrigin}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}, - DispatchClass, ConstantMultiplier, + ConstantMultiplier, }, + dispatch::DispatchClass, parameter_types, PalletId, }; use sp_runtime::{ @@ -32,8 +33,8 @@ use frame_system::{ EnsureRoot, }; use crate::{ - runtime_common::DealWithFees, Runtime, Event, Call, Origin, PalletInfo, System, Balances, - Treasury, SS58Prefix, Version, + runtime_common::DealWithFees, Runtime, RuntimeEvent, RuntimeCall, RuntimeOrigin, PalletInfo, + System, Balances, Treasury, SS58Prefix, Version, }; use up_common::{types::*, constants::*}; @@ -79,11 +80,11 @@ impl frame_system::Config for Runtime { /// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block. type BlockWeights = RuntimeBlockWeights; /// The aggregated dispatch type that is available for extrinsics. - type Call = Call; + type RuntimeCall = RuntimeCall; /// The weight of database operations that the runtime can invoke. type DbWeight = RocksDbWeight; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The type for hashing blocks and tries. type Hash = Hash; /// The hashing algorithm used. @@ -100,7 +101,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; /// The ubiquitous origin type. - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; /// This type is being generated by `construct_runtime!`. type PalletInfo = PalletInfo; /// This is used as an identifier of the chain. 42 is the generic substrate prefix. @@ -140,7 +141,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = Treasury; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -154,7 +155,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type LengthToFee = ConstantMultiplier; type OperationalFeeMultiplier = OperationalFeeMultiplier; @@ -188,7 +189,7 @@ impl pallet_treasury::Config for Runtime { type ApproveOrigin = EnsureRoot; type RejectOrigin = EnsureRoot; type SpendOrigin = NeverEnsureOrigin; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSlash = (); type ProposalBond = ProposalBond; type ProposalBondMinimum = ProposalBondMinimum; @@ -202,8 +203,8 @@ impl pallet_treasury::Config for Runtime { } impl pallet_sudo::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; } parameter_types! { diff --git a/runtime/common/config/xcm/mod.rs b/runtime/common/config/xcm/mod.rs index 8a21151f69..199fdac373 100644 --- a/runtime/common/config/xcm/mod.rs +++ b/runtime/common/config/xcm/mod.rs @@ -31,8 +31,8 @@ use xcm_builder::{ use xcm_executor::{Config, XcmExecutor, traits::ShouldExecute}; use sp_std::{marker::PhantomData, vec::Vec}; use crate::{ - Runtime, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue, - xcm_barrier::Barrier, + Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, ParachainInfo, ParachainSystem, PolkadotXcm, + XcmpQueue, xcm_barrier::Barrier, }; use up_common::types::AccountId; @@ -54,7 +54,7 @@ use xcm_assets::{AssetTransactors, IsReserve, Trader}; parameter_types! { pub const RelayLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Polkadot; - pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); @@ -76,7 +76,7 @@ pub type LocationToAccountId = ( ); /// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = (SignedToAccountId32,); +pub type LocalOriginToLocation = (SignedToAccountId32,); /// The means for routing XCM messages which are not for local execution into the right message /// queues. @@ -94,21 +94,21 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, + SovereignSignedViaLocation, // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when // recognised. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when // recognised. - SiblingParachainAsNative, + SiblingParachainAsNative, // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a // transaction from the Root origin. - ParentAsSuperuser, + ParentAsSuperuser, // Native signed account converter; this just converts an `AccountId32` origin into a normal // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); pub trait TryPass { @@ -202,14 +202,14 @@ impl>> TryPass for DenyExchangeWithUnknownLocation } } -pub type Weigher = FixedWeightBounds; +pub type Weigher = FixedWeightBounds; pub struct XcmConfig(PhantomData); impl Config for XcmConfig where T: pallet_configuration::Config, { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; // How to withdraw and deposit an asset. type AssetTransactor = AssetTransactors; @@ -228,30 +228,30 @@ where } impl pallet_xcm::Config for Runtime { - type Event = Event; - type SendXcmOrigin = EnsureXcmOrigin; + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor>; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor>; } impl cumulus_pallet_xcmp_queue::Config for Runtime { type WeightInfo = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor>; type ChannelInfo = ParachainSystem; type VersionWrapper = (); @@ -261,7 +261,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor>; type ExecuteOverweightOrigin = frame_system::EnsureRoot; } diff --git a/runtime/common/ethereum/self_contained_call.rs b/runtime/common/ethereum/self_contained_call.rs index b2bea68fc3..2fd80c1e61 100644 --- a/runtime/common/ethereum/self_contained_call.rs +++ b/runtime/common/ethereum/self_contained_call.rs @@ -19,21 +19,21 @@ use sp_runtime::{ traits::{Dispatchable, DispatchInfoOf, PostDispatchInfoOf}, transaction_validity::{TransactionValidityError, TransactionValidity}, }; -use crate::{Origin, Call}; +use crate::{RuntimeOrigin, RuntimeCall}; -impl fp_self_contained::SelfContainedCall for Call { +impl fp_self_contained::SelfContainedCall for RuntimeCall { type SignedInfo = H160; fn is_self_contained(&self) -> bool { match self { - Call::Ethereum(call) => call.is_self_contained(), + RuntimeCall::Ethereum(call) => call.is_self_contained(), _ => false, } } fn check_self_contained(&self) -> Option> { match self { - Call::Ethereum(call) => call.check_self_contained(), + RuntimeCall::Ethereum(call) => call.check_self_contained(), _ => None, } } @@ -41,11 +41,11 @@ impl fp_self_contained::SelfContainedCall for Call { fn validate_self_contained( &self, info: &Self::SignedInfo, - dispatch_info: &DispatchInfoOf, + dispatch_info: &DispatchInfoOf, len: usize, ) -> Option { match self { - Call::Ethereum(call) => call.validate_self_contained(info, dispatch_info, len), + RuntimeCall::Ethereum(call) => call.validate_self_contained(info, dispatch_info, len), _ => None, } } @@ -55,7 +55,7 @@ impl fp_self_contained::SelfContainedCall for Call { info: &Self::SignedInfo, ) -> Option> { match self { - Call::Ethereum(call) => call.pre_dispatch_self_contained(info), + RuntimeCall::Ethereum(call) => call.pre_dispatch_self_contained(info), _ => None, } } @@ -65,9 +65,11 @@ impl fp_self_contained::SelfContainedCall for Call { info: Self::SignedInfo, ) -> Option>> { match self { - call @ Call::Ethereum(pallet_ethereum::Call::transact { .. }) => Some(call.dispatch( - Origin::from(pallet_ethereum::RawOrigin::EthereumTransaction(info)), - )), + call @ RuntimeCall::Ethereum(pallet_ethereum::Call::transact { .. }) => { + Some(call.dispatch(RuntimeOrigin::from( + pallet_ethereum::RawOrigin::EthereumTransaction(info), + ))) + } _ => None, } } diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index 7021ae2276..93222355eb 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -42,7 +42,10 @@ use sp_std::vec::Vec; #[cfg(feature = "std")] use sp_version::NativeVersion; -use crate::{Runtime, Call, Balances, Treasury, Aura, Signature, AllPalletsWithSystem, InherentDataExt}; +use crate::{ + Runtime, RuntimeCall, Balances, Treasury, Aura, Signature, AllPalletsWithSystem, + InherentDataExt, +}; use up_common::types::{AccountId, BlockNumber}; #[macro_export] @@ -94,10 +97,11 @@ pub type SignedExtra = ( /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = - fp_self_contained::UncheckedExtrinsic; + fp_self_contained::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = fp_self_contained::CheckedExtrinsic; +pub type CheckedExtrinsic = + fp_self_contained::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index 1296f610d3..cb7558cd1f 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -558,7 +558,7 @@ macro_rules! impl_common_runtime_apis { fn extrinsic_filter(xts: Vec<::Extrinsic>) -> Vec { xts.into_iter().filter_map(|xt| match xt.0.function { - Call::Ethereum(pallet_ethereum::Call::transact { transaction }) => Some(transaction), + RuntimeCall::Ethereum(pallet_ethereum::Call::transact { transaction }) => Some(transaction), _ => None }).collect() } diff --git a/runtime/common/tests/xcm.rs b/runtime/common/tests/xcm.rs index ef9efe1d51..405a7ce843 100644 --- a/runtime/common/tests/xcm.rs +++ b/runtime/common/tests/xcm.rs @@ -17,7 +17,7 @@ use xcm_executor::traits::ShouldExecute; use xcm::latest::prelude::*; use logtest::Logger; -use crate::Call; +use crate::RuntimeCall; use super::new_test_ext; fn catch_xcm_barrier_log(logger: &mut Logger, expected_msg: &str) -> Result<(), String> { @@ -51,7 +51,7 @@ pub fn barrier_denies_transact(logger: &mut Logger) { call: fake_encoded_call.into(), }; - let mut xcm_program = Xcm::(vec![transact_inst]); + let mut xcm_program = Xcm::(vec![transact_inst]); let max_weight = 100_000; let mut weight_credit = 100_000_000; @@ -69,7 +69,7 @@ pub fn barrier_denies_transact(logger: &mut Logger) { fn xcm_execute( self_para_id: u32, location: &MultiLocation, - xcm: &mut Xcm, + xcm: &mut Xcm, ) -> Result<(), ()> { new_test_ext(self_para_id).execute_with(|| { let max_weight = 100_000; @@ -87,7 +87,7 @@ fn make_multiassets(location: &MultiLocation) -> MultiAssets { multiasset.into() } -fn make_transfer_reserve_asset(location: &MultiLocation) -> Xcm { +fn make_transfer_reserve_asset(location: &MultiLocation) -> Xcm { let assets = make_multiassets(location); let inst = TransferReserveAsset { assets, @@ -95,10 +95,10 @@ fn make_transfer_reserve_asset(location: &MultiLocation) -> Xcm { xcm: Xcm(vec![]), }; - Xcm::(vec![inst]) + Xcm::(vec![inst]) } -fn make_deposit_reserve_asset(location: &MultiLocation) -> Xcm { +fn make_deposit_reserve_asset(location: &MultiLocation) -> Xcm { let assets = make_multiassets(location); let inst = DepositReserveAsset { assets: assets.into(), @@ -107,14 +107,14 @@ fn make_deposit_reserve_asset(location: &MultiLocation) -> Xcm { xcm: Xcm(vec![]), }; - Xcm::(vec![inst]) + Xcm::(vec![inst]) } fn expect_transfer_location_denied( logger: &mut Logger, self_para_id: u32, location: &MultiLocation, - xcm: &mut Xcm, + xcm: &mut Xcm, ) -> Result<(), String> { let result = xcm_execute::(self_para_id, location, xcm); diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index 7ef6441f19..b2bcbca279 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -10,7 +10,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'opal-runtime' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = "0.9.29" +version = "0.9.30" [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] @@ -112,7 +112,6 @@ std = [ 'pallet-transaction-payment/std', 'pallet-transaction-payment-rpc-runtime-api/std', 'pallet-treasury/std', - # 'pallet-vesting/std', 'pallet-evm/std', 'pallet-evm-migration/std', 'pallet-evm-contract-helpers/std', @@ -165,7 +164,7 @@ std = [ "orml-tokens/std", "orml-xtokens/std", "orml-traits/std", - "pallet-foreign-assets/std" + "pallet-foreign-assets/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] opal-runtime = ['refungible', 'rmrk', 'app-promotion', 'foreign-assets'] @@ -189,39 +188,39 @@ version = '3.1.2' default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-try-runtime] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-executive] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-system-benchmarking] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-system-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.hex-literal] optional = true @@ -236,12 +235,12 @@ version = '1.0.130' [dependencies.pallet-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" # Contracts specific packages # [dependencies.pallet-contracts] @@ -265,102 +264,97 @@ branch = "polkadot-v0.9.29" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-sudo] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-transaction-payment] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-treasury] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" - -# [dependencies.pallet-vesting] -# default-features = false -# git = 'https://github.com/paritytech/substrate' -# branch = 'master' +branch = "polkadot-v0.9.30" [dependencies.sp-arithmetic] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-block-builder] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-inherents] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-offchain] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-session] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-transaction-pool] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-version] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.smallvec] version = '1.6.1' @@ -371,46 +365,46 @@ version = '1.6.1' [dependencies.parachain-info] default-features = false git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.cumulus-pallet-aura-ext] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-pallet-parachain-system] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-pallet-xcm] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-pallet-dmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-pallet-xcmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-primitives-utility] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-primitives-timestamp] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false ################################################################################ @@ -418,57 +412,38 @@ default-features = false [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" default-features = false [dependencies.xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" default-features = false [dependencies.xcm-builder] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" default-features = false [dependencies.xcm-executor] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" default-features = false [dependencies.pallet-xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" -default-features = false - -[dependencies.orml-vesting] -git = "https://github.com/UniqueNetwork/open-runtime-module-library" -branch = "polkadot-v0.9.29" -version = "0.4.1-dev" -default-features = false - -[dependencies.orml-xtokens] -git = "https://github.com/UniqueNetwork/open-runtime-module-library" -branch = "polkadot-v0.9.29" -version = "0.4.1-dev" -default-features = false - -[dependencies.orml-tokens] -git = "https://github.com/UniqueNetwork/open-runtime-module-library" -branch = "polkadot-v0.9.29" -version = "0.4.1-dev" -default-features = false - -[dependencies.orml-traits] -git = "https://github.com/UniqueNetwork/open-runtime-module-library" -branch = "polkadot-v0.9.29" -version = "0.4.1-dev" +branch = "release-v0.9.30" default-features = false ################################################################################ # local dependencies [dependencies] +orml-vesting.workspace = true +orml-xtokens.workspace = true +orml-tokens.workspace = true +orml-traits.workspace = true + log = { version = "0.4.16", default-features = false } up-common = { path = "../../primitives/common", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ @@ -477,9 +452,9 @@ scale-info = { version = "2.0.1", default-features = false, features = [ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } -app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} +app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false } rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } @@ -492,19 +467,18 @@ pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungib pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" } pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } -# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.30", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.29' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.30' } pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" } ################################################################################ @@ -523,4 +497,4 @@ version = "2.0.0" [build-dependencies.substrate-wasm-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index 8597bdb60b..ffdbd68eee 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -10,7 +10,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'quartz-runtime' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.9.29' +version = '0.9.30' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] @@ -111,7 +111,6 @@ std = [ 'pallet-transaction-payment/std', 'pallet-transaction-payment-rpc-runtime-api/std', 'pallet-treasury/std', - # 'pallet-vesting/std', 'pallet-evm/std', 'pallet-evm-migration/std', 'pallet-evm-contract-helpers/std', @@ -163,7 +162,7 @@ std = [ "orml-tokens/std", "orml-xtokens/std", "orml-traits/std", - "pallet-foreign-assets/std" + "pallet-foreign-assets/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] quartz-runtime = ['refungible'] @@ -186,39 +185,39 @@ version = '3.1.2' default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-try-runtime] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-executive] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-system-benchmarking] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-system-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.hex-literal] optional = true @@ -233,12 +232,12 @@ version = '1.0.130' [dependencies.pallet-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" # Contracts specific packages # [dependencies.pallet-contracts] @@ -262,102 +261,97 @@ branch = "polkadot-v0.9.29" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-sudo] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-transaction-payment] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-treasury] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" - -# [dependencies.pallet-vesting] -# default-features = false -# git = 'https://github.com/paritytech/substrate' -# branch = 'master' +branch = "polkadot-v0.9.30" [dependencies.sp-arithmetic] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-block-builder] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-inherents] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-offchain] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-session] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-transaction-pool] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-version] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.smallvec] version = '1.6.1' @@ -368,46 +362,46 @@ version = '1.6.1' [dependencies.parachain-info] default-features = false git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.cumulus-pallet-aura-ext] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-pallet-parachain-system] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-pallet-xcm] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-pallet-dmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-pallet-xcmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-primitives-utility] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-primitives-timestamp] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false ################################################################################ @@ -415,54 +409,29 @@ default-features = false [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" default-features = false [dependencies.xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" default-features = false [dependencies.xcm-builder] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" default-features = false [dependencies.xcm-executor] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" default-features = false [dependencies.pallet-xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" -default-features = false - -[dependencies.orml-vesting] -git = "https://github.com/UniqueNetwork/open-runtime-module-library" -branch = "polkadot-v0.9.29" -version = "0.4.1-dev" -default-features = false - -[dependencies.orml-xtokens] -git = "https://github.com/UniqueNetwork/open-runtime-module-library" -branch = "polkadot-v0.9.29" -version = "0.4.1-dev" -default-features = false - -[dependencies.orml-tokens] -git = "https://github.com/UniqueNetwork/open-runtime-module-library" -branch = "polkadot-v0.9.29" -version = "0.4.1-dev" +branch = "release-v0.9.30" default-features = false -[dependencies.orml-traits] -git = "https://github.com/UniqueNetwork/open-runtime-module-library" -branch = "polkadot-v0.9.29" -version = "0.4.1-dev" -default-features = false - - ################################################################################ # RMRK dependencies @@ -475,6 +444,11 @@ path = "../../primitives/rmrk-rpc" # local dependencies [dependencies] +orml-vesting.workspace = true +orml-xtokens.workspace = true +orml-tokens.workspace = true +orml-traits.workspace = true + log = { version = "0.4.16", default-features = false } up-common = { path = "../../primitives/common", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ @@ -483,8 +457,8 @@ scale-info = { version = "2.0.1", default-features = false, features = [ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } -app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } pallet-inflation = { path = '../../pallets/inflation', default-features = false } pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false } up-data-structs = { path = '../../primitives/data-structs', default-features = false } @@ -498,18 +472,18 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.30", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.29' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.30' } pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" } ################################################################################ @@ -528,4 +502,4 @@ version = "2.0.0" [build-dependencies.substrate-wasm-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" diff --git a/runtime/tests/Cargo.toml b/runtime/tests/Cargo.toml index 27319c64fc..3497f9b392 100644 --- a/runtime/tests/Cargo.toml +++ b/runtime/tests/Cargo.toml @@ -11,22 +11,22 @@ refungible = [] [dependencies] up-data-structs = { default-features = false, path = '../../primitives/data-structs' } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } pallet-common = { path = '../../pallets/common' } pallet-structure = { path = '../../pallets/structure' } @@ -43,4 +43,4 @@ parity-scale-codec = { version = "3.1.2", default-features = false, features = [ scale-info = "*" evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29" } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.30" } diff --git a/runtime/tests/src/lib.rs b/runtime/tests/src/lib.rs index ee33bc1858..5c673517bf 100644 --- a/runtime/tests/src/lib.rs +++ b/runtime/tests/src/lib.rs @@ -80,13 +80,13 @@ parameter_types! { } impl system::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -112,7 +112,7 @@ parameter_types! { } //frame_system::Module; impl pallet_balances::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type AccountStore = System; type Balance = u64; type DustRemoval = (); @@ -128,7 +128,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = CurrencyAdapter, ()>; type LengthToFee = IdentityFee; type WeightToFee = IdentityFee; @@ -205,12 +205,12 @@ parameter_types! { } impl pallet_ethereum::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type StateRoot = pallet_ethereum::IntermediateStateRoot; } impl pallet_evm::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type FeeCalculator = (); type GasWeightMapping = (); type CallOrigin = EnsureAddressNever; @@ -233,7 +233,7 @@ impl pallet_evm_coder_substrate::Config for Test {} impl pallet_common::Config for Test { type WeightInfo = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type CollectionCreationPrice = CollectionCreationPrice; type TreasuryAccountId = TreasuryAccountId; @@ -252,8 +252,8 @@ impl pallet_evm::account::Config for Test { impl pallet_structure::Config for Test { type WeightInfo = (); - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; } impl pallet_fungible::Config for Test { type WeightInfo = (); @@ -273,7 +273,7 @@ parameter_types! { } impl pallet_unique::Config for Test { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = (); type CommonWeightInfo = CommonWeights; type RefungibleExtensionsWeightInfo = CommonWeights; diff --git a/runtime/tests/src/tests.rs b/runtime/tests/src/tests.rs index f57546c2d0..c064a7d2f6 100644 --- a/runtime/tests/src/tests.rs +++ b/runtime/tests/src/tests.rs @@ -15,7 +15,7 @@ // along with Unique Network. If not, see . // Tests to be written here -use crate::{Test, TestCrossAccountId, CollectionCreationPrice, Origin, Unique, new_test_ext}; +use crate::{Test, TestCrossAccountId, CollectionCreationPrice, RuntimeOrigin, Unique, new_test_ext}; use up_data_structs::{ COLLECTION_NUMBER_LIMIT, CollectionId, CreateItemData, CreateFungibleData, CreateNftData, CreateReFungibleData, MAX_DECIMAL_POINTS, COLLECTION_ADMINS_LIMIT, TokenId, @@ -32,13 +32,13 @@ use pallet_unique::Error as UniqueError; fn add_balance(user: u64, value: u64) { const DONOR_USER: u64 = 999; assert_ok!(>::set_balance( - Origin::root(), + RuntimeOrigin::root(), DONOR_USER, value, 0 )); assert_ok!(>::force_transfer( - Origin::root(), + RuntimeOrigin::root(), DONOR_USER, user, value @@ -110,7 +110,7 @@ fn create_test_collection_for_owner( ..Default::default() }; - let origin1 = Origin::signed(owner); + let origin1 = RuntimeOrigin::signed(owner); assert_ok!(Unique::create_collection_ex(origin1, data)); let saved_col_name: Vec = "Test1\0".encode_utf16().collect::>(); @@ -179,7 +179,7 @@ fn create_test_collection(mode: &CollectionMode, id: CollectionId) -> Collection } fn create_test_item(collection_id: CollectionId, data: &CreateItemData) { - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_ok!(Unique::create_item( origin1, collection_id, @@ -199,7 +199,7 @@ fn account(sub: u64) -> TestCrossAccountId { fn check_not_sufficient_founds() { new_test_ext().execute_with(|| { let acc: u64 = 1; - >::set_balance(Origin::root(), acc, 0, 0).unwrap(); + >::set_balance(RuntimeOrigin::root(), acc, 0, 0).unwrap(); let name: Vec = "Test1\0".encode_utf16().collect::>(); let description: Vec = "TestDescription1\0".encode_utf16().collect::>(); @@ -214,7 +214,7 @@ fn check_not_sufficient_founds() { ..Default::default() }; - let result = Unique::create_collection_ex(Origin::signed(acc), data); + let result = Unique::create_collection_ex(RuntimeOrigin::signed(acc), data); assert_err!(result, >::NotSufficientFounds); }); } @@ -234,7 +234,7 @@ fn create_fungible_collection_fails_with_large_decimal_numbers() { ..Default::default() }; - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_noop!( Unique::create_collection_ex(origin1, data), UniqueError::::CollectionDecimalPointLimitExceeded @@ -264,7 +264,7 @@ fn create_nft_multiple_items() { new_test_ext().execute_with(|| { create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); let items_data = vec![default_nft_data(), default_nft_data(), default_nft_data()]; @@ -306,7 +306,7 @@ fn create_multiple_refungible_items() { new_test_ext().execute_with(|| { create_test_collection(&CollectionMode::ReFungible, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); let items_data = vec![ default_re_fungible_data(), @@ -358,7 +358,7 @@ fn create_fungible_item() { // create_test_collection(&CollectionMode::Fungible(3), CollectionId(1)); -// let origin1 = Origin::signed(1); +// let origin1 = RuntimeOrigin::signed(1); // let items_data = vec![default_fungible_data(), default_fungible_data(), default_fungible_data()]; @@ -382,8 +382,8 @@ fn transfer_fungible_item() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::Fungible(3), CollectionId(1)); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); let data = default_fungible_data(); create_test_item(collection_id, &data.into()); @@ -457,8 +457,8 @@ fn transfer_refungible_item() { ); // Account 1 transfers all 1023 pieces of RFT 1 to account 2 - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); assert_ok!(Unique::transfer( origin1, account(2), @@ -571,7 +571,7 @@ fn transfer_nft_item() { true ); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); // default scenario assert_ok!(Unique::transfer( origin1, @@ -615,7 +615,7 @@ fn transfer_nft_item_wrong_value() { true ); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_noop!( Unique::transfer(origin1, account(2), CollectionId(1), TokenId(1), 2) @@ -641,7 +641,7 @@ fn transfer_nft_item_zero_value() { true ); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); // Transferring 0 amount works on NFT... assert_ok!(Unique::transfer( @@ -671,8 +671,8 @@ fn nft_approve_and_transfer_from() { let data = default_nft_data(); create_test_item(collection_id, &data.into()); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); assert_eq!( >::get((collection_id, account(1))), @@ -729,8 +729,8 @@ fn nft_approve_and_transfer_from_allow_list() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); // Create NFT 1 for account 1 let data = default_nft_data(); @@ -803,8 +803,8 @@ fn refungible_approve_and_transfer_from() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::ReFungible, CollectionId(1)); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); // Create RFT 1 in 1023 pieces for account 1 let data = default_re_fungible_data(); @@ -920,8 +920,8 @@ fn fungible_approve_and_transfer_from() { let data = default_fungible_data(); create_test_item(collection_id, &data.into()); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); assert_ok!(Unique::set_collection_permissions( origin1.clone(), @@ -1010,7 +1010,7 @@ fn change_collection_owner() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_ok!(Unique::change_collection_owner(origin1, collection_id, 2)); assert_eq!( >::get(collection_id) @@ -1026,7 +1026,7 @@ fn destroy_collection() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_ok!(Unique::destroy_collection(origin1, collection_id)); }); } @@ -1036,7 +1036,7 @@ fn burn_nft_item() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); let data = default_nft_data(); create_test_item(collection_id, &data.into()); @@ -1066,7 +1066,7 @@ fn burn_same_nft_item_twice() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); let data = default_nft_data(); create_test_item(collection_id, &data.into()); @@ -1103,7 +1103,7 @@ fn burn_fungible_item() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::Fungible(3), CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_ok!(Unique::add_collection_admin( origin1.clone(), collection_id, @@ -1143,7 +1143,7 @@ fn burn_fungible_item_with_token_id() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::Fungible(3), CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_ok!(Unique::add_collection_admin( origin1.clone(), collection_id, @@ -1170,7 +1170,7 @@ fn burn_fungible_item_with_token_id() { fn burn_refungible_item() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::ReFungible, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_ok!(Unique::set_collection_permissions( origin1.clone(), @@ -1230,7 +1230,7 @@ fn add_collection_admin() { new_test_ext().execute_with(|| { let collection1_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); // Add collection admins assert_ok!(Unique::add_collection_admin( @@ -1265,7 +1265,7 @@ fn remove_collection_admin() { new_test_ext().execute_with(|| { let collection1_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); // Add collection admins 2 and 3 assert_ok!(Unique::add_collection_admin( @@ -1376,7 +1376,7 @@ fn approve() { let data = default_nft_data(); create_test_item(collection_id, &data.into()); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); // approve assert_ok!(Unique::approve( @@ -1397,8 +1397,8 @@ fn approve() { fn transfer_from() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); let data = default_nft_data(); create_test_item(collection_id, &data.into()); @@ -1472,7 +1472,7 @@ fn owner_can_add_address_to_allow_list() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_ok!(Unique::add_to_allow_list( origin1, collection_id, @@ -1489,8 +1489,8 @@ fn owner_can_add_address_to_allow_list() { fn admin_can_add_address_to_allow_list() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); assert_ok!(Unique::add_collection_admin( origin1, @@ -1514,7 +1514,7 @@ fn nonprivileged_user_cannot_add_address_to_allow_list() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin2 = Origin::signed(2); + let origin2 = RuntimeOrigin::signed(2); assert_noop!( Unique::add_to_allow_list(origin2, collection_id, account(3)), CommonError::::NoPermission @@ -1525,7 +1525,7 @@ fn nonprivileged_user_cannot_add_address_to_allow_list() { #[test] fn nobody_can_add_address_to_allow_list_of_nonexisting_collection() { new_test_ext().execute_with(|| { - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_noop!( Unique::add_to_allow_list(origin1, CollectionId(1), account(2)), @@ -1539,7 +1539,7 @@ fn nobody_can_add_address_to_allow_list_of_deleted_collection() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_ok!(Unique::destroy_collection(origin1.clone(), collection_id)); assert_noop!( Unique::add_to_allow_list(origin1, collection_id, account(2)), @@ -1553,7 +1553,7 @@ fn nobody_can_add_address_to_allow_list_of_deleted_collection() { fn address_is_already_added_to_allow_list() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_ok!(Unique::add_to_allow_list( origin1.clone(), @@ -1577,7 +1577,7 @@ fn owner_can_remove_address_from_allow_list() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_ok!(Unique::add_to_allow_list( origin1.clone(), collection_id, @@ -1599,8 +1599,8 @@ fn owner_can_remove_address_from_allow_list() { fn admin_can_remove_address_from_allow_list() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); // Owner adds admin assert_ok!(Unique::add_collection_admin( @@ -1633,8 +1633,8 @@ fn admin_can_remove_address_from_allow_list() { fn nonprivileged_user_cannot_remove_address_from_allow_list() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); assert_ok!(Unique::add_to_allow_list( origin1, @@ -1655,7 +1655,7 @@ fn nonprivileged_user_cannot_remove_address_from_allow_list() { #[test] fn nobody_can_remove_address_from_allow_list_of_nonexisting_collection() { new_test_ext().execute_with(|| { - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_noop!( Unique::remove_from_allow_list(origin1, CollectionId(1), account(2)), @@ -1668,8 +1668,8 @@ fn nobody_can_remove_address_from_allow_list_of_nonexisting_collection() { fn nobody_can_remove_address_from_allow_list_of_deleted_collection() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); // Add account 2 to allow list assert_ok!(Unique::add_to_allow_list( @@ -1706,7 +1706,7 @@ fn nobody_can_remove_address_from_allow_list_of_deleted_collection() { fn address_is_already_removed_from_allow_list() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_ok!(Unique::add_to_allow_list( origin1.clone(), @@ -1740,7 +1740,7 @@ fn allow_list_test_1() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); let data = default_nft_data(); create_test_item(collection_id, &data.into()); @@ -1772,7 +1772,7 @@ fn allow_list_test_1() { fn allow_list_test_2() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); let data = default_nft_data(); create_test_item(collection_id, &data.into()); @@ -1837,7 +1837,7 @@ fn allow_list_test_3() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); let data = default_nft_data(); create_test_item(collection_id, &data.into()); @@ -1870,7 +1870,7 @@ fn allow_list_test_4() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); let data = default_nft_data(); create_test_item(collection_id, &data.into()); @@ -1935,7 +1935,7 @@ fn allow_list_test_5() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); let data = default_nft_data(); create_test_item(collection_id, &data.into()); @@ -1962,7 +1962,7 @@ fn allow_list_test_6() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); let data = default_nft_data(); create_test_item(collection_id, &data.into()); @@ -1996,7 +1996,7 @@ fn allow_list_test_7() { let data = default_nft_data(); create_test_item(collection_id, &data.into()); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_ok!(Unique::set_collection_permissions( origin1.clone(), @@ -2037,7 +2037,7 @@ fn allow_list_test_8() { let data = default_nft_data(); create_test_item(collection_id, &data.into()); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); // Toggle Allow List mode and add accounts 1 and 2 assert_ok!(Unique::set_collection_permissions( @@ -2090,7 +2090,7 @@ fn allow_list_test_8() { fn allow_list_test_9() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_ok!(Unique::set_collection_permissions( origin1.clone(), @@ -2113,8 +2113,8 @@ fn allow_list_test_10() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); assert_ok!(Unique::set_collection_permissions( origin1.clone(), @@ -2147,8 +2147,8 @@ fn allow_list_test_11() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); assert_ok!(Unique::set_collection_permissions( origin1.clone(), @@ -2184,8 +2184,8 @@ fn allow_list_test_12() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); assert_ok!(Unique::set_collection_permissions( origin1.clone(), @@ -2216,7 +2216,7 @@ fn allow_list_test_13() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_ok!(Unique::set_collection_permissions( origin1.clone(), @@ -2239,8 +2239,8 @@ fn allow_list_test_14() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); assert_ok!(Unique::set_collection_permissions( origin1.clone(), @@ -2273,8 +2273,8 @@ fn allow_list_test_15() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); assert_ok!(Unique::set_collection_permissions( origin1.clone(), @@ -2305,8 +2305,8 @@ fn allow_list_test_16() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); - let origin2 = Origin::signed(2); + let origin1 = RuntimeOrigin::signed(1); + let origin2 = RuntimeOrigin::signed(2); assert_ok!(Unique::set_collection_permissions( origin1.clone(), @@ -2353,7 +2353,7 @@ fn create_max_collections() { #[test] fn total_number_collections_bound_neg() { new_test_ext().execute_with(|| { - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); for i in 1..=COLLECTION_NUMBER_LIMIT { create_test_collection(&CollectionMode::NFT, CollectionId(i)); @@ -2397,7 +2397,7 @@ fn owned_tokens_bound_neg() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); for _ in 1..=MAX_TOKEN_OWNERSHIP { let data = default_nft_data(); @@ -2419,7 +2419,7 @@ fn collection_admins_bound() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); assert_ok!(Unique::add_collection_admin( origin1.clone(), @@ -2440,7 +2440,7 @@ fn collection_admins_bound_neg() { new_test_ext().execute_with(|| { let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); for i in 0..COLLECTION_ADMINS_LIMIT { assert_ok!(Unique::add_collection_admin( @@ -2464,7 +2464,7 @@ fn collection_admins_bound_neg() { #[test] fn collection_transfer_flag_works() { new_test_ext().execute_with(|| { - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); assert_ok!(Unique::set_transfers_enabled_flag( @@ -2484,7 +2484,7 @@ fn collection_transfer_flag_works() { true ); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); // default scenario assert_ok!(Unique::transfer( @@ -2516,7 +2516,7 @@ fn collection_transfer_flag_works() { #[test] fn collection_transfer_flag_works_neg() { new_test_ext().execute_with(|| { - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); let collection_id = create_test_collection(&CollectionMode::NFT, CollectionId(1)); assert_ok!(Unique::set_transfers_enabled_flag( @@ -2536,7 +2536,7 @@ fn collection_transfer_flag_works_neg() { true ); - let origin1 = Origin::signed(1); + let origin1 = RuntimeOrigin::signed(1); // default scenario assert_noop!( @@ -2569,8 +2569,8 @@ fn collection_sponsoring() { // default_limits(); let user1 = 1_u64; let user2 = 777_u64; - let origin1 = Origin::signed(user1); - let origin2 = Origin::signed(user2); + let origin1 = RuntimeOrigin::signed(user1); + let origin2 = RuntimeOrigin::signed(user2); let account2 = account(user2); let collection_id = diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index b721a28b57..79a98b33da 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -10,7 +10,7 @@ homepage = 'https://unique.network' license = 'GPLv3' name = 'unique-runtime' repository = 'https://github.com/UniqueNetwork/unique-chain' -version = '0.9.29' +version = '0.9.30' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] @@ -112,7 +112,6 @@ std = [ 'pallet-transaction-payment/std', 'pallet-transaction-payment-rpc-runtime-api/std', 'pallet-treasury/std', - # 'pallet-vesting/std', 'pallet-evm/std', 'pallet-evm-migration/std', 'pallet-evm-contract-helpers/std', @@ -164,7 +163,7 @@ std = [ "orml-tokens/std", "orml-xtokens/std", "orml-traits/std", - "pallet-foreign-assets/std" + "pallet-foreign-assets/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] unique-runtime = [] @@ -187,39 +186,39 @@ version = '3.1.2' default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-try-runtime] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-executive] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-support] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-system] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-system-benchmarking] default-features = false git = "https://github.com/paritytech/substrate" optional = true -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.frame-system-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.hex-literal] optional = true @@ -234,12 +233,12 @@ version = '1.0.130' [dependencies.pallet-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-balances] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" # Contracts specific packages # [dependencies.pallet-contracts] @@ -263,102 +262,97 @@ branch = "polkadot-v0.9.29" [dependencies.pallet-randomness-collective-flip] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-sudo] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-timestamp] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-transaction-payment] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.pallet-treasury] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" - -# [dependencies.pallet-vesting] -# default-features = false -# git = 'https://github.com/paritytech/substrate' -# branch = 'master' +branch = "polkadot-v0.9.30" [dependencies.sp-arithmetic] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-api] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-block-builder] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-core] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-consensus-aura] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-inherents] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-io] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-offchain] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-runtime] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-session] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-std] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-transaction-pool] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.sp-version] default-features = false git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.smallvec] version = '1.6.1' @@ -369,46 +363,46 @@ version = '1.6.1' [dependencies.parachain-info] default-features = false git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" [dependencies.cumulus-pallet-aura-ext] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-pallet-parachain-system] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-primitives-core] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-pallet-xcm] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-pallet-dmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-pallet-xcmp-queue] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-primitives-utility] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false [dependencies.cumulus-primitives-timestamp] git = "https://github.com/paritytech/cumulus" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" default-features = false ################################################################################ @@ -416,56 +410,38 @@ default-features = false [dependencies.polkadot-parachain] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" default-features = false [dependencies.xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" default-features = false [dependencies.xcm-builder] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" default-features = false [dependencies.xcm-executor] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" +branch = "release-v0.9.30" default-features = false [dependencies.pallet-xcm] git = "https://github.com/paritytech/polkadot" -branch = "release-v0.9.29" -default-features = false - -[dependencies.orml-vesting] -git = "https://github.com/UniqueNetwork/open-runtime-module-library" -branch = "polkadot-v0.9.29" -version = "0.4.1-dev" +branch = "release-v0.9.30" default-features = false -[dependencies.orml-xtokens] -git = "https://github.com/UniqueNetwork/open-runtime-module-library" -branch = "polkadot-v0.9.29" -version = "0.4.1-dev" -default-features = false - -[dependencies.orml-tokens] -git = "https://github.com/UniqueNetwork/open-runtime-module-library" -branch = "polkadot-v0.9.29" -version = "0.4.1-dev" -default-features = false - -[dependencies.orml-traits] -git = "https://github.com/UniqueNetwork/open-runtime-module-library" -branch = "polkadot-v0.9.29" -version = "0.4.1-dev" -default-features = false ################################################################################ # local dependencies [dependencies] +orml-vesting.workspace = true +orml-xtokens.workspace = true +orml-tokens.workspace = true +orml-traits.workspace = true + log = { version = "0.4.16", default-features = false } up-common = { path = "../../primitives/common", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ @@ -474,7 +450,7 @@ scale-info = { version = "2.0.1", default-features = false, features = [ derivative = "2.2.0" pallet-unique = { path = '../../pallets/unique', default-features = false } up-rpc = { path = "../../primitives/rpc", default-features = false } -app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false} +app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false } rmrk-rpc = { path = "../../primitives/rmrk-rpc", default-features = false } pallet-inflation = { path = '../../pallets/inflation', default-features = false } pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false } @@ -489,19 +465,19 @@ pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" } pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false } # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } -pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.29", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } +pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.30", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" } pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false } pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false } pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false } pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" } -pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } -fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.29" } +pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } +fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" } evm-coder = { default-features = false, path = '../../crates/evm-coder' } -up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.29' } +up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.30' } pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" } ################################################################################ @@ -520,4 +496,4 @@ version = "2.0.0" [build-dependencies.substrate-wasm-builder] git = "https://github.com/paritytech/substrate" -branch = "polkadot-v0.9.29" +branch = "polkadot-v0.9.30" From 9179b1d40a94e8728f49d0458ac1bab92de76456 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Oct 2022 19:46:56 +0000 Subject: [PATCH 1227/1274] test: regenerate types Signed-off-by: Yaroslav Bolyukin --- tests/src/interfaces/augment-api-consts.ts | 22 +- tests/src/interfaces/augment-api-errors.ts | 22 - tests/src/interfaces/augment-api-events.ts | 29 +- tests/src/interfaces/augment-api-query.ts | 20 +- tests/src/interfaces/augment-api-tx.ts | 26 +- tests/src/interfaces/augment-types.ts | 28 +- tests/src/interfaces/default/types.ts | 201 +------ tests/src/interfaces/lookup.ts | 653 +++++++-------------- tests/src/interfaces/registry.ts | 28 +- tests/src/interfaces/types-lookup.ts | 554 +++++++---------- tests/update_types.sh | 5 - 11 files changed, 480 insertions(+), 1108 deletions(-) diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index 2251b9f1f2..4c63d4c7af 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -8,8 +8,8 @@ import '@polkadot/api-base/types/consts'; import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types'; import type { Option, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { Codec } from '@polkadot/types-codec/types'; -import type { Perbill, Permill, Weight } from '@polkadot/types/interfaces/runtime'; -import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion, XcmV1MultiLocation } from '@polkadot/types/lookup'; +import type { Perbill, Permill } from '@polkadot/types/interfaces/runtime'; +import type { FrameSupportPalletId, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, XcmV1MultiLocation } from '@polkadot/types/lookup'; export type __AugmentedConst = AugmentedConst; @@ -92,22 +92,6 @@ declare module '@polkadot/api-base/types/consts' { **/ [key: string]: Codec; }; - scheduler: { - /** - * The maximum weight that may be scheduled per block for any dispatchables of less - * priority than `schedule::HARD_DEADLINE`. - **/ - maximumWeight: Weight & AugmentedConst; - /** - * The maximum number of scheduled calls in the queue for a single block. - * Not strictly enforced, but used for weight estimation. - **/ - maxScheduledPerBlock: u32 & AugmentedConst; - /** - * Generic const - **/ - [key: string]: Codec; - }; system: { /** * Maximum number of block number to block hash mappings to keep (oldest pruned first). @@ -124,7 +108,7 @@ declare module '@polkadot/api-base/types/consts' { /** * The weight of runtime database operations the runtime can invoke. **/ - dbWeight: FrameSupportWeightsRuntimeDbWeight & AugmentedConst; + dbWeight: SpWeightsRuntimeDbWeight & AugmentedConst; /** * The designated SS58 prefix of this chain. * diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 08a2157a7a..36754eb3fd 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -636,28 +636,6 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; - scheduler: { - /** - * Failed to schedule a call - **/ - FailedToSchedule: AugmentedError; - /** - * Cannot find the scheduled call. - **/ - NotFound: AugmentedError; - /** - * Reschedule failed because it does not change scheduled time. - **/ - RescheduleNoChange: AugmentedError; - /** - * Given target block number is in the past. - **/ - TargetBlockNumberInPast: AugmentedError; - /** - * Generic error - **/ - [key: string]: AugmentedError; - }; structure: { /** * While nesting, reached the breadth limit of nesting, exceeding the provided budget. diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index dd50d96a48..7e5bbca87e 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -7,9 +7,8 @@ import '@polkadot/api-base/types/events'; import type { ApiTypes, AugmentedEvent } from '@polkadot/api-base/types'; import type { Bytes, Null, Option, Result, U256, U8aFixed, bool, u128, u32, u64, u8 } from '@polkadot/types-codec'; -import type { ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256, Weight } from '@polkadot/types/interfaces/runtime'; -import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetMultiAssets, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; +import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportDispatchDispatchInfo, FrameSupportTokensMiscBalanceStatus, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetMultiAssets, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; export type __AugmentedEvent = AugmentedEvent; @@ -467,28 +466,6 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; - scheduler: { - /** - * The call for the provided hash was not found so the task has been aborted. - **/ - CallLookupFailed: AugmentedEvent, id: Option, error: FrameSupportScheduleLookupError], { task: ITuple<[u32, u32]>, id: Option, error: FrameSupportScheduleLookupError }>; - /** - * Canceled some task. - **/ - Canceled: AugmentedEvent; - /** - * Dispatched some task. - **/ - Dispatched: AugmentedEvent, id: Option, result: Result], { task: ITuple<[u32, u32]>, id: Option, result: Result }>; - /** - * Scheduled some task. - **/ - Scheduled: AugmentedEvent; - /** - * Generic event - **/ - [key: string]: AugmentedEvent; - }; structure: { /** * Executed call on behalf of the token. @@ -525,11 +502,11 @@ declare module '@polkadot/api-base/types/events' { /** * An extrinsic failed. **/ - ExtrinsicFailed: AugmentedEvent; + ExtrinsicFailed: AugmentedEvent; /** * An extrinsic completed successfully. **/ - ExtrinsicSuccess: AugmentedEvent; + ExtrinsicSuccess: AugmentedEvent; /** * An account was reaped. **/ diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index a495706000..e2b9bf45a8 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -6,10 +6,10 @@ import '@polkadot/api-base/types/storage'; import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types'; -import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; +import type { BTreeMap, Bytes, Option, U256, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256, Weight } from '@polkadot/types/interfaces/runtime'; -import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportDispatchPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup'; import type { Observable } from '@polkadot/types/types'; export type __AugmentedQuery = AugmentedQuery unknown>; @@ -670,20 +670,6 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; - scheduler: { - /** - * Items to be executed, indexed by the block number that they should be executed on. - **/ - agenda: AugmentedQuery Observable>>, [u32]> & QueryableStorageEntry; - /** - * Lookup from identity to the block number and index of the task. - **/ - lookup: AugmentedQuery Observable>>, [U8aFixed]> & QueryableStorageEntry; - /** - * Generic query - **/ - [key: string]: QueryableStorageEntry; - }; structure: { /** * Generic query @@ -716,7 +702,7 @@ declare module '@polkadot/api-base/types/storage' { /** * The current weight for the block. **/ - blockWeight: AugmentedQuery Observable, []> & QueryableStorageEntry; + blockWeight: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Digest of the current block, also part of the block header. **/ diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index 7911b3c0f7..a42bd7bbf4 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -6,10 +6,10 @@ import '@polkadot/api-base/types/submittable'; import type { ApiTypes, AugmentedSubmittable, SubmittableExtrinsic, SubmittableExtrinsicFunction } from '@polkadot/api-base/types'; -import type { Bytes, Compact, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; +import type { Bytes, Compact, Option, U256, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill, Weight } from '@polkadot/types/interfaces/runtime'; -import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, FrameSupportScheduleMaybeHashed, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartEquippableList, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartEquippableList, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; export type __AugmentedSubmittable = AugmentedSubmittable<() => unknown>; export type __SubmittableExtrinsic = SubmittableExtrinsic; @@ -821,28 +821,6 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; - scheduler: { - /** - * Cancel a named scheduled task. - **/ - cancelNamed: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed]>; - /** - * Schedule a named task. - **/ - scheduleNamed: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; - /** - * Schedule a named task after a delay. - * - * # - * Same as [`schedule_named`](Self::schedule_named). - * # - **/ - scheduleNamedAfter: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; - /** - * Generic tx - **/ - [key: string]: SubmittableExtrinsicFunction; - }; structure: { /** * Generic tx diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index bc3d07e8e1..7486c19f89 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassWeight, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsRpcCollectionFlags, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchDispatchClass, FrameSupportDispatchDispatchInfo, FrameSupportDispatchPays, FrameSupportDispatchPerDispatchClassU32, FrameSupportDispatchPerDispatchClassWeight, FrameSupportDispatchPerDispatchClassWeightsPerClass, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsRpcCollectionFlags, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; @@ -328,7 +328,6 @@ declare module '@polkadot/types/types/registry' { CumulusPalletXcmCall: CumulusPalletXcmCall; CumulusPalletXcmError: CumulusPalletXcmError; CumulusPalletXcmEvent: CumulusPalletXcmEvent; - CumulusPalletXcmOrigin: CumulusPalletXcmOrigin; CumulusPalletXcmpQueueCall: CumulusPalletXcmpQueueCall; CumulusPalletXcmpQueueError: CumulusPalletXcmpQueueError; CumulusPalletXcmpQueueEvent: CumulusPalletXcmpQueueEvent; @@ -518,18 +517,14 @@ declare module '@polkadot/types/types/registry' { ForkTreePendingChange: ForkTreePendingChange; ForkTreePendingChangeNode: ForkTreePendingChangeNode; FpRpcTransactionStatus: FpRpcTransactionStatus; - FrameSupportDispatchRawOrigin: FrameSupportDispatchRawOrigin; + FrameSupportDispatchDispatchClass: FrameSupportDispatchDispatchClass; + FrameSupportDispatchDispatchInfo: FrameSupportDispatchDispatchInfo; + FrameSupportDispatchPays: FrameSupportDispatchPays; + FrameSupportDispatchPerDispatchClassU32: FrameSupportDispatchPerDispatchClassU32; + FrameSupportDispatchPerDispatchClassWeight: FrameSupportDispatchPerDispatchClassWeight; + FrameSupportDispatchPerDispatchClassWeightsPerClass: FrameSupportDispatchPerDispatchClassWeightsPerClass; FrameSupportPalletId: FrameSupportPalletId; - FrameSupportScheduleLookupError: FrameSupportScheduleLookupError; - FrameSupportScheduleMaybeHashed: FrameSupportScheduleMaybeHashed; FrameSupportTokensMiscBalanceStatus: FrameSupportTokensMiscBalanceStatus; - FrameSupportWeightsDispatchClass: FrameSupportWeightsDispatchClass; - FrameSupportWeightsDispatchInfo: FrameSupportWeightsDispatchInfo; - FrameSupportWeightsPays: FrameSupportWeightsPays; - FrameSupportWeightsPerDispatchClassU32: FrameSupportWeightsPerDispatchClassU32; - FrameSupportWeightsPerDispatchClassWeight: FrameSupportWeightsPerDispatchClassWeight; - FrameSupportWeightsPerDispatchClassWeightsPerClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; - FrameSupportWeightsRuntimeDbWeight: FrameSupportWeightsRuntimeDbWeight; FrameSystemAccountInfo: FrameSystemAccountInfo; FrameSystemCall: FrameSystemCall; FrameSystemError: FrameSystemError; @@ -774,7 +769,6 @@ declare module '@polkadot/types/types/registry' { OffenceDetails: OffenceDetails; Offender: Offender; OldV1SessionInfo: OldV1SessionInfo; - OpalRuntimeOriginCaller: OpalRuntimeOriginCaller; OpalRuntimeRuntime: OpalRuntimeRuntime; OpaqueCall: OpaqueCall; OpaqueKeyOwnershipProof: OpaqueKeyOwnershipProof; @@ -841,7 +835,6 @@ declare module '@polkadot/types/types/registry' { PalletEthereumError: PalletEthereumError; PalletEthereumEvent: PalletEthereumEvent; PalletEthereumFakeTransactionFinalizer: PalletEthereumFakeTransactionFinalizer; - PalletEthereumRawOrigin: PalletEthereumRawOrigin; PalletEventMetadataLatest: PalletEventMetadataLatest; PalletEventMetadataV14: PalletEventMetadataV14; PalletEvmAccountBasicCrossAccountIdRepr: PalletEvmAccountBasicCrossAccountIdRepr; @@ -896,15 +889,10 @@ declare module '@polkadot/types/types/registry' { PalletUniqueCall: PalletUniqueCall; PalletUniqueError: PalletUniqueError; PalletUniqueRawEvent: PalletUniqueRawEvent; - PalletUniqueSchedulerCall: PalletUniqueSchedulerCall; - PalletUniqueSchedulerError: PalletUniqueSchedulerError; - PalletUniqueSchedulerEvent: PalletUniqueSchedulerEvent; - PalletUniqueSchedulerScheduledV3: PalletUniqueSchedulerScheduledV3; PalletVersion: PalletVersion; PalletXcmCall: PalletXcmCall; PalletXcmError: PalletXcmError; PalletXcmEvent: PalletXcmEvent; - PalletXcmOrigin: PalletXcmOrigin; ParachainDispatchOrigin: ParachainDispatchOrigin; ParachainInherentData: ParachainInherentData; ParachainProposal: ParachainProposal; @@ -1178,7 +1166,6 @@ declare module '@polkadot/types/types/registry' { SpCoreEcdsaSignature: SpCoreEcdsaSignature; SpCoreEd25519Signature: SpCoreEd25519Signature; SpCoreSr25519Signature: SpCoreSr25519Signature; - SpCoreVoid: SpCoreVoid; SpecVersion: SpecVersion; SpRuntimeArithmeticError: SpRuntimeArithmeticError; SpRuntimeDigest: SpRuntimeDigest; @@ -1190,6 +1177,7 @@ declare module '@polkadot/types/types/registry' { SpRuntimeTransactionalError: SpRuntimeTransactionalError; SpTrieStorageProof: SpTrieStorageProof; SpVersionRuntimeVersion: SpVersionRuntimeVersion; + SpWeightsRuntimeDbWeight: SpWeightsRuntimeDbWeight; Sr25519Signature: Sr25519Signature; StakingLedger: StakingLedger; StakingLedgerTo223: StakingLedgerTo223; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index cab4135cc5..afc77911ab 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -153,14 +153,6 @@ export interface CumulusPalletXcmEvent extends Enum { readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; } -/** @name CumulusPalletXcmOrigin */ -export interface CumulusPalletXcmOrigin extends Enum { - readonly isRelay: boolean; - readonly isSiblingParachain: boolean; - readonly asSiblingParachain: u32; - readonly type: 'Relay' | 'SiblingParachain'; -} - /** @name CumulusPalletXcmpQueueCall */ export interface CumulusPalletXcmpQueueCall extends Enum { readonly isServiceOverweight: boolean; @@ -501,88 +493,57 @@ export interface FpRpcTransactionStatus extends Struct { readonly logsBloom: EthbloomBloom; } -/** @name FrameSupportDispatchRawOrigin */ -export interface FrameSupportDispatchRawOrigin extends Enum { - readonly isRoot: boolean; - readonly isSigned: boolean; - readonly asSigned: AccountId32; - readonly isNone: boolean; - readonly type: 'Root' | 'Signed' | 'None'; -} - -/** @name FrameSupportPalletId */ -export interface FrameSupportPalletId extends U8aFixed {} - -/** @name FrameSupportScheduleLookupError */ -export interface FrameSupportScheduleLookupError extends Enum { - readonly isUnknown: boolean; - readonly isBadFormat: boolean; - readonly type: 'Unknown' | 'BadFormat'; -} - -/** @name FrameSupportScheduleMaybeHashed */ -export interface FrameSupportScheduleMaybeHashed extends Enum { - readonly isValue: boolean; - readonly asValue: Call; - readonly isHash: boolean; - readonly asHash: H256; - readonly type: 'Value' | 'Hash'; -} - -/** @name FrameSupportTokensMiscBalanceStatus */ -export interface FrameSupportTokensMiscBalanceStatus extends Enum { - readonly isFree: boolean; - readonly isReserved: boolean; - readonly type: 'Free' | 'Reserved'; -} - -/** @name FrameSupportWeightsDispatchClass */ -export interface FrameSupportWeightsDispatchClass extends Enum { +/** @name FrameSupportDispatchDispatchClass */ +export interface FrameSupportDispatchDispatchClass extends Enum { readonly isNormal: boolean; readonly isOperational: boolean; readonly isMandatory: boolean; readonly type: 'Normal' | 'Operational' | 'Mandatory'; } -/** @name FrameSupportWeightsDispatchInfo */ -export interface FrameSupportWeightsDispatchInfo extends Struct { +/** @name FrameSupportDispatchDispatchInfo */ +export interface FrameSupportDispatchDispatchInfo extends Struct { readonly weight: Weight; - readonly class: FrameSupportWeightsDispatchClass; - readonly paysFee: FrameSupportWeightsPays; + readonly class: FrameSupportDispatchDispatchClass; + readonly paysFee: FrameSupportDispatchPays; } -/** @name FrameSupportWeightsPays */ -export interface FrameSupportWeightsPays extends Enum { +/** @name FrameSupportDispatchPays */ +export interface FrameSupportDispatchPays extends Enum { readonly isYes: boolean; readonly isNo: boolean; readonly type: 'Yes' | 'No'; } -/** @name FrameSupportWeightsPerDispatchClassU32 */ -export interface FrameSupportWeightsPerDispatchClassU32 extends Struct { +/** @name FrameSupportDispatchPerDispatchClassU32 */ +export interface FrameSupportDispatchPerDispatchClassU32 extends Struct { readonly normal: u32; readonly operational: u32; readonly mandatory: u32; } -/** @name FrameSupportWeightsPerDispatchClassWeight */ -export interface FrameSupportWeightsPerDispatchClassWeight extends Struct { +/** @name FrameSupportDispatchPerDispatchClassWeight */ +export interface FrameSupportDispatchPerDispatchClassWeight extends Struct { readonly normal: Weight; readonly operational: Weight; readonly mandatory: Weight; } -/** @name FrameSupportWeightsPerDispatchClassWeightsPerClass */ -export interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { +/** @name FrameSupportDispatchPerDispatchClassWeightsPerClass */ +export interface FrameSupportDispatchPerDispatchClassWeightsPerClass extends Struct { readonly normal: FrameSystemLimitsWeightsPerClass; readonly operational: FrameSystemLimitsWeightsPerClass; readonly mandatory: FrameSystemLimitsWeightsPerClass; } -/** @name FrameSupportWeightsRuntimeDbWeight */ -export interface FrameSupportWeightsRuntimeDbWeight extends Struct { - readonly read: u64; - readonly write: u64; +/** @name FrameSupportPalletId */ +export interface FrameSupportPalletId extends U8aFixed {} + +/** @name FrameSupportTokensMiscBalanceStatus */ +export interface FrameSupportTokensMiscBalanceStatus extends Enum { + readonly isFree: boolean; + readonly isReserved: boolean; + readonly type: 'Free' | 'Reserved'; } /** @name FrameSystemAccountInfo */ @@ -651,12 +612,12 @@ export interface FrameSystemError extends Enum { export interface FrameSystemEvent extends Enum { readonly isExtrinsicSuccess: boolean; readonly asExtrinsicSuccess: { - readonly dispatchInfo: FrameSupportWeightsDispatchInfo; + readonly dispatchInfo: FrameSupportDispatchDispatchInfo; } & Struct; readonly isExtrinsicFailed: boolean; readonly asExtrinsicFailed: { readonly dispatchError: SpRuntimeDispatchError; - readonly dispatchInfo: FrameSupportWeightsDispatchInfo; + readonly dispatchInfo: FrameSupportDispatchDispatchInfo; } & Struct; readonly isCodeUpdated: boolean; readonly isNewAccount: boolean; @@ -705,14 +666,14 @@ export interface FrameSystemLastRuntimeUpgradeInfo extends Struct { /** @name FrameSystemLimitsBlockLength */ export interface FrameSystemLimitsBlockLength extends Struct { - readonly max: FrameSupportWeightsPerDispatchClassU32; + readonly max: FrameSupportDispatchPerDispatchClassU32; } /** @name FrameSystemLimitsBlockWeights */ export interface FrameSystemLimitsBlockWeights extends Struct { readonly baseBlock: Weight; readonly maxBlock: Weight; - readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; + readonly perClass: FrameSupportDispatchPerDispatchClassWeightsPerClass; } /** @name FrameSystemLimitsWeightsPerClass */ @@ -732,21 +693,6 @@ export interface FrameSystemPhase extends Enum { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } -/** @name OpalRuntimeOriginCaller */ -export interface OpalRuntimeOriginCaller extends Enum { - readonly isSystem: boolean; - readonly asSystem: FrameSupportDispatchRawOrigin; - readonly isVoid: boolean; - readonly asVoid: SpCoreVoid; - readonly isPolkadotXcm: boolean; - readonly asPolkadotXcm: PalletXcmOrigin; - readonly isCumulusXcm: boolean; - readonly asCumulusXcm: CumulusPalletXcmOrigin; - readonly isEthereum: boolean; - readonly asEthereum: PalletEthereumRawOrigin; - readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; -} - /** @name OpalRuntimeRuntime */ export interface OpalRuntimeRuntime extends Null {} @@ -1357,13 +1303,6 @@ export interface PalletEthereumEvent extends Enum { /** @name PalletEthereumFakeTransactionFinalizer */ export interface PalletEthereumFakeTransactionFinalizer extends Null {} -/** @name PalletEthereumRawOrigin */ -export interface PalletEthereumRawOrigin extends Enum { - readonly isEthereumTransaction: boolean; - readonly asEthereumTransaction: H160; - readonly type: 'EthereumTransaction'; -} - /** @name PalletEvmAccountBasicCrossAccountIdRepr */ export interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { readonly isSubstrate: boolean; @@ -2278,76 +2217,6 @@ export interface PalletUniqueRawEvent extends Enum { readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet'; } -/** @name PalletUniqueSchedulerCall */ -export interface PalletUniqueSchedulerCall extends Enum { - readonly isScheduleNamed: boolean; - readonly asScheduleNamed: { - readonly id: U8aFixed; - readonly when: u32; - readonly maybePeriodic: Option>; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; - } & Struct; - readonly isCancelNamed: boolean; - readonly asCancelNamed: { - readonly id: U8aFixed; - } & Struct; - readonly isScheduleNamedAfter: boolean; - readonly asScheduleNamedAfter: { - readonly id: U8aFixed; - readonly after: u32; - readonly maybePeriodic: Option>; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; - } & Struct; - readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; -} - -/** @name PalletUniqueSchedulerError */ -export interface PalletUniqueSchedulerError extends Enum { - readonly isFailedToSchedule: boolean; - readonly isNotFound: boolean; - readonly isTargetBlockNumberInPast: boolean; - readonly isRescheduleNoChange: boolean; - readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; -} - -/** @name PalletUniqueSchedulerEvent */ -export interface PalletUniqueSchedulerEvent extends Enum { - readonly isScheduled: boolean; - readonly asScheduled: { - readonly when: u32; - readonly index: u32; - } & Struct; - readonly isCanceled: boolean; - readonly asCanceled: { - readonly when: u32; - readonly index: u32; - } & Struct; - readonly isDispatched: boolean; - readonly asDispatched: { - readonly task: ITuple<[u32, u32]>; - readonly id: Option; - readonly result: Result; - } & Struct; - readonly isCallLookupFailed: boolean; - readonly asCallLookupFailed: { - readonly task: ITuple<[u32, u32]>; - readonly id: Option; - readonly error: FrameSupportScheduleLookupError; - } & Struct; - readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; -} - -/** @name PalletUniqueSchedulerScheduledV3 */ -export interface PalletUniqueSchedulerScheduledV3 extends Struct { - readonly maybeId: Option; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; - readonly maybePeriodic: Option>; - readonly origin: OpalRuntimeOriginCaller; -} - /** @name PalletXcmCall */ export interface PalletXcmCall extends Enum { readonly isSend: boolean; @@ -2465,15 +2334,6 @@ export interface PalletXcmEvent extends Enum { readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail'; } -/** @name PalletXcmOrigin */ -export interface PalletXcmOrigin extends Enum { - readonly isXcm: boolean; - readonly asXcm: XcmV1MultiLocation; - readonly isResponse: boolean; - readonly asResponse: XcmV1MultiLocation; - readonly type: 'Xcm' | 'Response'; -} - /** @name PhantomTypeUpDataStructs */ export interface PhantomTypeUpDataStructs extends Vec> {} @@ -2694,9 +2554,6 @@ export interface SpCoreEd25519Signature extends U8aFixed {} /** @name SpCoreSr25519Signature */ export interface SpCoreSr25519Signature extends U8aFixed {} -/** @name SpCoreVoid */ -export interface SpCoreVoid extends Null {} - /** @name SpRuntimeArithmeticError */ export interface SpRuntimeArithmeticError extends Enum { readonly isUnderflow: boolean; @@ -2796,6 +2653,12 @@ export interface SpVersionRuntimeVersion extends Struct { readonly stateVersion: u8; } +/** @name SpWeightsRuntimeDbWeight */ +export interface SpWeightsRuntimeDbWeight extends Struct { + readonly read: u64; + readonly write: u64; +} + /** @name UpDataStructsAccessMode */ export interface UpDataStructsAccessMode extends Enum { readonly isNormal: boolean; diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 819e40de66..1179efb57b 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -24,9 +24,9 @@ export default { feeFrozen: 'u128' }, /** - * Lookup7: frame_support::weights::PerDispatchClass + * Lookup7: frame_support::dispatch::PerDispatchClass **/ - FrameSupportWeightsPerDispatchClassWeight: { + FrameSupportDispatchPerDispatchClassWeight: { normal: 'Weight', operational: 'Weight', mandatory: 'Weight' @@ -54,7 +54,7 @@ export default { } }, /** - * Lookup17: frame_system::EventRecord + * Lookup17: frame_system::EventRecord **/ FrameSystemEventRecord: { phase: 'FrameSystemPhase', @@ -67,11 +67,11 @@ export default { FrameSystemEvent: { _enum: { ExtrinsicSuccess: { - dispatchInfo: 'FrameSupportWeightsDispatchInfo', + dispatchInfo: 'FrameSupportDispatchDispatchInfo', }, ExtrinsicFailed: { dispatchError: 'SpRuntimeDispatchError', - dispatchInfo: 'FrameSupportWeightsDispatchInfo', + dispatchInfo: 'FrameSupportDispatchDispatchInfo', }, CodeUpdated: 'Null', NewAccount: { @@ -90,23 +90,23 @@ export default { } }, /** - * Lookup20: frame_support::weights::DispatchInfo + * Lookup20: frame_support::dispatch::DispatchInfo **/ - FrameSupportWeightsDispatchInfo: { + FrameSupportDispatchDispatchInfo: { weight: 'Weight', - class: 'FrameSupportWeightsDispatchClass', - paysFee: 'FrameSupportWeightsPays' + class: 'FrameSupportDispatchDispatchClass', + paysFee: 'FrameSupportDispatchPays' }, /** - * Lookup21: frame_support::weights::DispatchClass + * Lookup21: frame_support::dispatch::DispatchClass **/ - FrameSupportWeightsDispatchClass: { + FrameSupportDispatchDispatchClass: { _enum: ['Normal', 'Operational', 'Mandatory'] }, /** - * Lookup22: frame_support::weights::Pays + * Lookup22: frame_support::dispatch::Pays **/ - FrameSupportWeightsPays: { + FrameSupportDispatchPays: { _enum: ['Yes', 'No'] }, /** @@ -674,11 +674,11 @@ export default { } }, /** - * Lookup68: xcm::v2::Xcm + * Lookup68: xcm::v2::Xcm **/ XcmV2Xcm: 'Vec', /** - * Lookup70: xcm::v2::Instruction + * Lookup70: xcm::v2::Instruction **/ XcmV2Instruction: { _enum: { @@ -1004,38 +1004,7 @@ export default { } }, /** - * Lookup93: pallet_unique_scheduler::pallet::Event - **/ - PalletUniqueSchedulerEvent: { - _enum: { - Scheduled: { - when: 'u32', - index: 'u32', - }, - Canceled: { - when: 'u32', - index: 'u32', - }, - Dispatched: { - task: '(u32,u32)', - id: 'Option<[u8;16]>', - result: 'Result', - }, - CallLookupFailed: { - task: '(u32,u32)', - id: 'Option<[u8;16]>', - error: 'FrameSupportScheduleLookupError' - } - } - }, - /** - * Lookup96: frame_support::traits::schedule::LookupError - **/ - FrameSupportScheduleLookupError: { - _enum: ['Unknown', 'BadFormat'] - }, - /** - * Lookup97: pallet_common::pallet::Event + * Lookup93: pallet_common::pallet::Event **/ PalletCommonEvent: { _enum: { @@ -1053,7 +1022,7 @@ export default { } }, /** - * Lookup100: pallet_structure::pallet::Event + * Lookup96: pallet_structure::pallet::Event **/ PalletStructureEvent: { _enum: { @@ -1061,7 +1030,7 @@ export default { } }, /** - * Lookup101: pallet_rmrk_core::pallet::Event + * Lookup97: pallet_rmrk_core::pallet::Event **/ PalletRmrkCoreEvent: { _enum: { @@ -1138,7 +1107,7 @@ export default { } }, /** - * Lookup102: rmrk_traits::nft::AccountIdOrCollectionNftTuple + * Lookup98: rmrk_traits::nft::AccountIdOrCollectionNftTuple **/ RmrkTraitsNftAccountIdOrCollectionNftTuple: { _enum: { @@ -1147,7 +1116,7 @@ export default { } }, /** - * Lookup107: pallet_rmrk_equip::pallet::Event + * Lookup103: pallet_rmrk_equip::pallet::Event **/ PalletRmrkEquipEvent: { _enum: { @@ -1162,7 +1131,7 @@ export default { } }, /** - * Lookup108: pallet_app_promotion::pallet::Event + * Lookup104: pallet_app_promotion::pallet::Event **/ PalletAppPromotionEvent: { _enum: { @@ -1173,7 +1142,7 @@ export default { } }, /** - * Lookup109: pallet_foreign_assets::module::Event + * Lookup105: pallet_foreign_assets::module::Event **/ PalletForeignAssetsModuleEvent: { _enum: { @@ -1198,7 +1167,7 @@ export default { } }, /** - * Lookup110: pallet_foreign_assets::module::AssetMetadata + * Lookup106: pallet_foreign_assets::module::AssetMetadata **/ PalletForeignAssetsModuleAssetMetadata: { name: 'Bytes', @@ -1207,7 +1176,7 @@ export default { minimalBalance: 'u128' }, /** - * Lookup111: pallet_evm::pallet::Event + * Lookup107: pallet_evm::pallet::Event **/ PalletEvmEvent: { _enum: { @@ -1221,7 +1190,7 @@ export default { } }, /** - * Lookup112: ethereum::log::Log + * Lookup108: ethereum::log::Log **/ EthereumLog: { address: 'H160', @@ -1229,7 +1198,7 @@ export default { data: 'Bytes' }, /** - * Lookup116: pallet_ethereum::pallet::Event + * Lookup112: pallet_ethereum::pallet::Event **/ PalletEthereumEvent: { _enum: { @@ -1237,7 +1206,7 @@ export default { } }, /** - * Lookup117: evm_core::error::ExitReason + * Lookup113: evm_core::error::ExitReason **/ EvmCoreErrorExitReason: { _enum: { @@ -1248,13 +1217,13 @@ export default { } }, /** - * Lookup118: evm_core::error::ExitSucceed + * Lookup114: evm_core::error::ExitSucceed **/ EvmCoreErrorExitSucceed: { _enum: ['Stopped', 'Returned', 'Suicided'] }, /** - * Lookup119: evm_core::error::ExitError + * Lookup115: evm_core::error::ExitError **/ EvmCoreErrorExitError: { _enum: { @@ -1276,13 +1245,13 @@ export default { } }, /** - * Lookup122: evm_core::error::ExitRevert + * Lookup118: evm_core::error::ExitRevert **/ EvmCoreErrorExitRevert: { _enum: ['Reverted'] }, /** - * Lookup123: evm_core::error::ExitFatal + * Lookup119: evm_core::error::ExitFatal **/ EvmCoreErrorExitFatal: { _enum: { @@ -1293,7 +1262,7 @@ export default { } }, /** - * Lookup124: pallet_evm_contract_helpers::pallet::Event + * Lookup120: pallet_evm_contract_helpers::pallet::Event **/ PalletEvmContractHelpersEvent: { _enum: { @@ -1303,7 +1272,7 @@ export default { } }, /** - * Lookup125: frame_system::Phase + * Lookup121: frame_system::Phase **/ FrameSystemPhase: { _enum: { @@ -1313,14 +1282,14 @@ export default { } }, /** - * Lookup127: frame_system::LastRuntimeUpgradeInfo + * Lookup124: frame_system::LastRuntimeUpgradeInfo **/ FrameSystemLastRuntimeUpgradeInfo: { specVersion: 'Compact', specName: 'Text' }, /** - * Lookup128: frame_system::pallet::Call + * Lookup125: frame_system::pallet::Call **/ FrameSystemCall: { _enum: { @@ -1358,23 +1327,23 @@ export default { } }, /** - * Lookup133: frame_system::limits::BlockWeights + * Lookup130: frame_system::limits::BlockWeights **/ FrameSystemLimitsBlockWeights: { baseBlock: 'Weight', maxBlock: 'Weight', - perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass' + perClass: 'FrameSupportDispatchPerDispatchClassWeightsPerClass' }, /** - * Lookup134: frame_support::weights::PerDispatchClass + * Lookup131: frame_support::dispatch::PerDispatchClass **/ - FrameSupportWeightsPerDispatchClassWeightsPerClass: { + FrameSupportDispatchPerDispatchClassWeightsPerClass: { normal: 'FrameSystemLimitsWeightsPerClass', operational: 'FrameSystemLimitsWeightsPerClass', mandatory: 'FrameSystemLimitsWeightsPerClass' }, /** - * Lookup135: frame_system::limits::WeightsPerClass + * Lookup132: frame_system::limits::WeightsPerClass **/ FrameSystemLimitsWeightsPerClass: { baseExtrinsic: 'Weight', @@ -1383,28 +1352,28 @@ export default { reserved: 'Option' }, /** - * Lookup137: frame_system::limits::BlockLength + * Lookup134: frame_system::limits::BlockLength **/ FrameSystemLimitsBlockLength: { - max: 'FrameSupportWeightsPerDispatchClassU32' + max: 'FrameSupportDispatchPerDispatchClassU32' }, /** - * Lookup138: frame_support::weights::PerDispatchClass + * Lookup135: frame_support::dispatch::PerDispatchClass **/ - FrameSupportWeightsPerDispatchClassU32: { + FrameSupportDispatchPerDispatchClassU32: { normal: 'u32', operational: 'u32', mandatory: 'u32' }, /** - * Lookup139: frame_support::weights::RuntimeDbWeight + * Lookup136: sp_weights::RuntimeDbWeight **/ - FrameSupportWeightsRuntimeDbWeight: { + SpWeightsRuntimeDbWeight: { read: 'u64', write: 'u64' }, /** - * Lookup140: sp_version::RuntimeVersion + * Lookup137: sp_version::RuntimeVersion **/ SpVersionRuntimeVersion: { specName: 'Text', @@ -1417,13 +1386,13 @@ export default { stateVersion: 'u8' }, /** - * Lookup145: frame_system::pallet::Error + * Lookup142: frame_system::pallet::Error **/ FrameSystemError: { _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] }, /** - * Lookup146: polkadot_primitives::v2::PersistedValidationData + * Lookup143: polkadot_primitives::v2::PersistedValidationData **/ PolkadotPrimitivesV2PersistedValidationData: { parentHead: 'Bytes', @@ -1432,19 +1401,19 @@ export default { maxPovSize: 'u32' }, /** - * Lookup149: polkadot_primitives::v2::UpgradeRestriction + * Lookup146: polkadot_primitives::v2::UpgradeRestriction **/ PolkadotPrimitivesV2UpgradeRestriction: { _enum: ['Present'] }, /** - * Lookup150: sp_trie::storage_proof::StorageProof + * Lookup147: sp_trie::storage_proof::StorageProof **/ SpTrieStorageProof: { trieNodes: 'BTreeSet' }, /** - * Lookup152: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot + * Lookup149: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot **/ CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: { dmqMqcHead: 'H256', @@ -1453,7 +1422,7 @@ export default { egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>' }, /** - * Lookup155: polkadot_primitives::v2::AbridgedHrmpChannel + * Lookup152: polkadot_primitives::v2::AbridgedHrmpChannel **/ PolkadotPrimitivesV2AbridgedHrmpChannel: { maxCapacity: 'u32', @@ -1464,7 +1433,7 @@ export default { mqcHead: 'Option' }, /** - * Lookup156: polkadot_primitives::v2::AbridgedHostConfiguration + * Lookup153: polkadot_primitives::v2::AbridgedHostConfiguration **/ PolkadotPrimitivesV2AbridgedHostConfiguration: { maxCodeSize: 'u32', @@ -1478,14 +1447,14 @@ export default { validationUpgradeDelay: 'u32' }, /** - * Lookup162: polkadot_core_primitives::OutboundHrmpMessage + * Lookup159: polkadot_core_primitives::OutboundHrmpMessage **/ PolkadotCorePrimitivesOutboundHrmpMessage: { recipient: 'u32', data: 'Bytes' }, /** - * Lookup163: cumulus_pallet_parachain_system::pallet::Call + * Lookup160: cumulus_pallet_parachain_system::pallet::Call **/ CumulusPalletParachainSystemCall: { _enum: { @@ -1504,7 +1473,7 @@ export default { } }, /** - * Lookup164: cumulus_primitives_parachain_inherent::ParachainInherentData + * Lookup161: cumulus_primitives_parachain_inherent::ParachainInherentData **/ CumulusPrimitivesParachainInherentParachainInherentData: { validationData: 'PolkadotPrimitivesV2PersistedValidationData', @@ -1513,27 +1482,27 @@ export default { horizontalMessages: 'BTreeMap>' }, /** - * Lookup166: polkadot_core_primitives::InboundDownwardMessage + * Lookup163: polkadot_core_primitives::InboundDownwardMessage **/ PolkadotCorePrimitivesInboundDownwardMessage: { sentAt: 'u32', msg: 'Bytes' }, /** - * Lookup169: polkadot_core_primitives::InboundHrmpMessage + * Lookup166: polkadot_core_primitives::InboundHrmpMessage **/ PolkadotCorePrimitivesInboundHrmpMessage: { sentAt: 'u32', data: 'Bytes' }, /** - * Lookup172: cumulus_pallet_parachain_system::pallet::Error + * Lookup169: cumulus_pallet_parachain_system::pallet::Error **/ CumulusPalletParachainSystemError: { _enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized'] }, /** - * Lookup174: pallet_balances::BalanceLock + * Lookup171: pallet_balances::BalanceLock **/ PalletBalancesBalanceLock: { id: '[u8;8]', @@ -1541,26 +1510,26 @@ export default { reasons: 'PalletBalancesReasons' }, /** - * Lookup175: pallet_balances::Reasons + * Lookup172: pallet_balances::Reasons **/ PalletBalancesReasons: { _enum: ['Fee', 'Misc', 'All'] }, /** - * Lookup178: pallet_balances::ReserveData + * Lookup175: pallet_balances::ReserveData **/ PalletBalancesReserveData: { id: '[u8;16]', amount: 'u128' }, /** - * Lookup180: pallet_balances::Releases + * Lookup177: pallet_balances::Releases **/ PalletBalancesReleases: { _enum: ['V1_0_0', 'V2_0_0'] }, /** - * Lookup181: pallet_balances::pallet::Call + * Lookup178: pallet_balances::pallet::Call **/ PalletBalancesCall: { _enum: { @@ -1593,13 +1562,13 @@ export default { } }, /** - * Lookup184: pallet_balances::pallet::Error + * Lookup181: pallet_balances::pallet::Error **/ PalletBalancesError: { _enum: ['VestingBalance', 'LiquidityRestrictions', 'InsufficientBalance', 'ExistentialDeposit', 'KeepAlive', 'ExistingVestingSchedule', 'DeadAccount', 'TooManyReserves'] }, /** - * Lookup186: pallet_timestamp::pallet::Call + * Lookup183: pallet_timestamp::pallet::Call **/ PalletTimestampCall: { _enum: { @@ -1609,13 +1578,13 @@ export default { } }, /** - * Lookup188: pallet_transaction_payment::Releases + * Lookup185: pallet_transaction_payment::Releases **/ PalletTransactionPaymentReleases: { _enum: ['V1Ancient', 'V2'] }, /** - * Lookup189: pallet_treasury::Proposal + * Lookup186: pallet_treasury::Proposal **/ PalletTreasuryProposal: { proposer: 'AccountId32', @@ -1624,7 +1593,7 @@ export default { bond: 'u128' }, /** - * Lookup192: pallet_treasury::pallet::Call + * Lookup189: pallet_treasury::pallet::Call **/ PalletTreasuryCall: { _enum: { @@ -1648,17 +1617,17 @@ export default { } }, /** - * Lookup195: frame_support::PalletId + * Lookup192: frame_support::PalletId **/ FrameSupportPalletId: '[u8;8]', /** - * Lookup196: pallet_treasury::pallet::Error + * Lookup193: pallet_treasury::pallet::Error **/ PalletTreasuryError: { _enum: ['InsufficientProposersBalance', 'InvalidIndex', 'TooManyApprovals', 'InsufficientPermission', 'ProposalNotApproved'] }, /** - * Lookup197: pallet_sudo::pallet::Call + * Lookup194: pallet_sudo::pallet::Call **/ PalletSudoCall: { _enum: { @@ -1682,7 +1651,7 @@ export default { } }, /** - * Lookup199: orml_vesting::module::Call + * Lookup196: orml_vesting::module::Call **/ OrmlVestingModuleCall: { _enum: { @@ -1701,7 +1670,7 @@ export default { } }, /** - * Lookup201: orml_xtokens::module::Call + * Lookup198: orml_xtokens::module::Call **/ OrmlXtokensModuleCall: { _enum: { @@ -1744,7 +1713,7 @@ export default { } }, /** - * Lookup202: xcm::VersionedMultiAsset + * Lookup199: xcm::VersionedMultiAsset **/ XcmVersionedMultiAsset: { _enum: { @@ -1753,7 +1722,7 @@ export default { } }, /** - * Lookup205: orml_tokens::module::Call + * Lookup202: orml_tokens::module::Call **/ OrmlTokensModuleCall: { _enum: { @@ -1787,7 +1756,7 @@ export default { } }, /** - * Lookup206: cumulus_pallet_xcmp_queue::pallet::Call + * Lookup203: cumulus_pallet_xcmp_queue::pallet::Call **/ CumulusPalletXcmpQueueCall: { _enum: { @@ -1836,7 +1805,7 @@ export default { } }, /** - * Lookup207: pallet_xcm::pallet::Call + * Lookup204: pallet_xcm::pallet::Call **/ PalletXcmCall: { _enum: { @@ -1890,7 +1859,7 @@ export default { } }, /** - * Lookup208: xcm::VersionedXcm + * Lookup205: xcm::VersionedXcm **/ XcmVersionedXcm: { _enum: { @@ -1900,7 +1869,7 @@ export default { } }, /** - * Lookup209: xcm::v0::Xcm + * Lookup206: xcm::v0::Xcm **/ XcmV0Xcm: { _enum: { @@ -1954,7 +1923,7 @@ export default { } }, /** - * Lookup211: xcm::v0::order::Order + * Lookup208: xcm::v0::order::Order **/ XcmV0Order: { _enum: { @@ -1997,7 +1966,7 @@ export default { } }, /** - * Lookup213: xcm::v0::Response + * Lookup210: xcm::v0::Response **/ XcmV0Response: { _enum: { @@ -2005,7 +1974,7 @@ export default { } }, /** - * Lookup214: xcm::v1::Xcm + * Lookup211: xcm::v1::Xcm **/ XcmV1Xcm: { _enum: { @@ -2064,7 +2033,7 @@ export default { } }, /** - * Lookup216: xcm::v1::order::Order + * Lookup213: xcm::v1::order::Order **/ XcmV1Order: { _enum: { @@ -2109,7 +2078,7 @@ export default { } }, /** - * Lookup218: xcm::v1::Response + * Lookup215: xcm::v1::Response **/ XcmV1Response: { _enum: { @@ -2118,11 +2087,11 @@ export default { } }, /** - * Lookup232: cumulus_pallet_xcm::pallet::Call + * Lookup229: cumulus_pallet_xcm::pallet::Call **/ CumulusPalletXcmCall: 'Null', /** - * Lookup233: cumulus_pallet_dmp_queue::pallet::Call + * Lookup230: cumulus_pallet_dmp_queue::pallet::Call **/ CumulusPalletDmpQueueCall: { _enum: { @@ -2133,7 +2102,7 @@ export default { } }, /** - * Lookup234: pallet_inflation::pallet::Call + * Lookup231: pallet_inflation::pallet::Call **/ PalletInflationCall: { _enum: { @@ -2143,7 +2112,7 @@ export default { } }, /** - * Lookup235: pallet_unique::Call + * Lookup232: pallet_unique::Call **/ PalletUniqueCall: { _enum: { @@ -2275,7 +2244,7 @@ export default { } }, /** - * Lookup240: up_data_structs::CollectionMode + * Lookup237: up_data_structs::CollectionMode **/ UpDataStructsCollectionMode: { _enum: { @@ -2285,7 +2254,7 @@ export default { } }, /** - * Lookup241: up_data_structs::CreateCollectionData + * Lookup238: up_data_structs::CreateCollectionData **/ UpDataStructsCreateCollectionData: { mode: 'UpDataStructsCollectionMode', @@ -2300,13 +2269,13 @@ export default { properties: 'Vec' }, /** - * Lookup243: up_data_structs::AccessMode + * Lookup240: up_data_structs::AccessMode **/ UpDataStructsAccessMode: { _enum: ['Normal', 'AllowList'] }, /** - * Lookup245: up_data_structs::CollectionLimits + * Lookup242: up_data_structs::CollectionLimits **/ UpDataStructsCollectionLimits: { accountTokenOwnershipLimit: 'Option', @@ -2320,7 +2289,7 @@ export default { transfersEnabled: 'Option' }, /** - * Lookup247: up_data_structs::SponsoringRateLimit + * Lookup244: up_data_structs::SponsoringRateLimit **/ UpDataStructsSponsoringRateLimit: { _enum: { @@ -2329,7 +2298,7 @@ export default { } }, /** - * Lookup250: up_data_structs::CollectionPermissions + * Lookup247: up_data_structs::CollectionPermissions **/ UpDataStructsCollectionPermissions: { access: 'Option', @@ -2337,7 +2306,7 @@ export default { nesting: 'Option' }, /** - * Lookup252: up_data_structs::NestingPermissions + * Lookup249: up_data_structs::NestingPermissions **/ UpDataStructsNestingPermissions: { tokenOwner: 'bool', @@ -2345,18 +2314,18 @@ export default { restricted: 'Option' }, /** - * Lookup254: up_data_structs::OwnerRestrictedSet + * Lookup251: up_data_structs::OwnerRestrictedSet **/ UpDataStructsOwnerRestrictedSet: 'BTreeSet', /** - * Lookup259: up_data_structs::PropertyKeyPermission + * Lookup256: up_data_structs::PropertyKeyPermission **/ UpDataStructsPropertyKeyPermission: { key: 'Bytes', permission: 'UpDataStructsPropertyPermission' }, /** - * Lookup260: up_data_structs::PropertyPermission + * Lookup257: up_data_structs::PropertyPermission **/ UpDataStructsPropertyPermission: { mutable: 'bool', @@ -2364,14 +2333,14 @@ export default { tokenOwner: 'bool' }, /** - * Lookup263: up_data_structs::Property + * Lookup260: up_data_structs::Property **/ UpDataStructsProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup266: up_data_structs::CreateItemData + * Lookup263: up_data_structs::CreateItemData **/ UpDataStructsCreateItemData: { _enum: { @@ -2381,26 +2350,26 @@ export default { } }, /** - * Lookup267: up_data_structs::CreateNftData + * Lookup264: up_data_structs::CreateNftData **/ UpDataStructsCreateNftData: { properties: 'Vec' }, /** - * Lookup268: up_data_structs::CreateFungibleData + * Lookup265: up_data_structs::CreateFungibleData **/ UpDataStructsCreateFungibleData: { value: 'u128' }, /** - * Lookup269: up_data_structs::CreateReFungibleData + * Lookup266: up_data_structs::CreateReFungibleData **/ UpDataStructsCreateReFungibleData: { pieces: 'u128', properties: 'Vec' }, /** - * Lookup272: up_data_structs::CreateItemExData> + * Lookup269: up_data_structs::CreateItemExData> **/ UpDataStructsCreateItemExData: { _enum: { @@ -2411,14 +2380,14 @@ export default { } }, /** - * Lookup274: up_data_structs::CreateNftExData> + * Lookup271: up_data_structs::CreateNftExData> **/ UpDataStructsCreateNftExData: { properties: 'Vec', owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup281: up_data_structs::CreateRefungibleExSingleOwner> + * Lookup278: up_data_structs::CreateRefungibleExSingleOwner> **/ UpDataStructsCreateRefungibleExSingleOwner: { user: 'PalletEvmAccountBasicCrossAccountIdRepr', @@ -2426,47 +2395,14 @@ export default { properties: 'Vec' }, /** - * Lookup283: up_data_structs::CreateRefungibleExMultipleOwners> + * Lookup280: up_data_structs::CreateRefungibleExMultipleOwners> **/ UpDataStructsCreateRefungibleExMultipleOwners: { users: 'BTreeMap', properties: 'Vec' }, /** - * Lookup284: pallet_unique_scheduler::pallet::Call - **/ - PalletUniqueSchedulerCall: { - _enum: { - schedule_named: { - id: '[u8;16]', - when: 'u32', - maybePeriodic: 'Option<(u32,u32)>', - priority: 'u8', - call: 'FrameSupportScheduleMaybeHashed', - }, - cancel_named: { - id: '[u8;16]', - }, - schedule_named_after: { - id: '[u8;16]', - after: 'u32', - maybePeriodic: 'Option<(u32,u32)>', - priority: 'u8', - call: 'FrameSupportScheduleMaybeHashed' - } - } - }, - /** - * Lookup286: frame_support::traits::schedule::MaybeHashed - **/ - FrameSupportScheduleMaybeHashed: { - _enum: { - Value: 'Call', - Hash: 'H256' - } - }, - /** - * Lookup287: pallet_configuration::pallet::Call + * Lookup281: pallet_configuration::pallet::Call **/ PalletConfigurationCall: { _enum: { @@ -2479,15 +2415,15 @@ export default { } }, /** - * Lookup289: pallet_template_transaction_payment::Call + * Lookup283: pallet_template_transaction_payment::Call **/ PalletTemplateTransactionPaymentCall: 'Null', /** - * Lookup290: pallet_structure::pallet::Call + * Lookup284: pallet_structure::pallet::Call **/ PalletStructureCall: 'Null', /** - * Lookup291: pallet_rmrk_core::pallet::Call + * Lookup285: pallet_rmrk_core::pallet::Call **/ PalletRmrkCoreCall: { _enum: { @@ -2578,7 +2514,7 @@ export default { } }, /** - * Lookup297: rmrk_traits::resource::ResourceTypes, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup291: rmrk_traits::resource::ResourceTypes, sp_core::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceTypes: { _enum: { @@ -2588,7 +2524,7 @@ export default { } }, /** - * Lookup299: rmrk_traits::resource::BasicResource> + * Lookup293: rmrk_traits::resource::BasicResource> **/ RmrkTraitsResourceBasicResource: { src: 'Option', @@ -2597,7 +2533,7 @@ export default { thumb: 'Option' }, /** - * Lookup301: rmrk_traits::resource::ComposableResource, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup295: rmrk_traits::resource::ComposableResource, sp_core::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceComposableResource: { parts: 'Vec', @@ -2608,7 +2544,7 @@ export default { thumb: 'Option' }, /** - * Lookup302: rmrk_traits::resource::SlotResource> + * Lookup296: rmrk_traits::resource::SlotResource> **/ RmrkTraitsResourceSlotResource: { base: 'u32', @@ -2619,7 +2555,7 @@ export default { thumb: 'Option' }, /** - * Lookup305: pallet_rmrk_equip::pallet::Call + * Lookup299: pallet_rmrk_equip::pallet::Call **/ PalletRmrkEquipCall: { _enum: { @@ -2640,7 +2576,7 @@ export default { } }, /** - * Lookup308: rmrk_traits::part::PartType, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup302: rmrk_traits::part::PartType, sp_core::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPartPartType: { _enum: { @@ -2649,7 +2585,7 @@ export default { } }, /** - * Lookup310: rmrk_traits::part::FixedPart> + * Lookup304: rmrk_traits::part::FixedPart> **/ RmrkTraitsPartFixedPart: { id: 'u32', @@ -2657,7 +2593,7 @@ export default { src: 'Bytes' }, /** - * Lookup311: rmrk_traits::part::SlotPart, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup305: rmrk_traits::part::SlotPart, sp_core::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPartSlotPart: { id: 'u32', @@ -2666,7 +2602,7 @@ export default { z: 'u32' }, /** - * Lookup312: rmrk_traits::part::EquippableList> + * Lookup306: rmrk_traits::part::EquippableList> **/ RmrkTraitsPartEquippableList: { _enum: { @@ -2676,7 +2612,7 @@ export default { } }, /** - * Lookup314: rmrk_traits::theme::Theme, sp_runtime::bounded::bounded_vec::BoundedVec>, S>> + * Lookup308: rmrk_traits::theme::Theme, sp_core::bounded::bounded_vec::BoundedVec>, S>> **/ RmrkTraitsTheme: { name: 'Bytes', @@ -2684,14 +2620,14 @@ export default { inherit: 'bool' }, /** - * Lookup316: rmrk_traits::theme::ThemeProperty> + * Lookup310: rmrk_traits::theme::ThemeProperty> **/ RmrkTraitsThemeThemeProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup318: pallet_app_promotion::pallet::Call + * Lookup312: pallet_app_promotion::pallet::Call **/ PalletAppPromotionCall: { _enum: { @@ -2720,7 +2656,7 @@ export default { } }, /** - * Lookup320: pallet_foreign_assets::module::Call + * Lookup314: pallet_foreign_assets::module::Call **/ PalletForeignAssetsModuleCall: { _enum: { @@ -2737,7 +2673,7 @@ export default { } }, /** - * Lookup321: pallet_evm::pallet::Call + * Lookup315: pallet_evm::pallet::Call **/ PalletEvmCall: { _enum: { @@ -2780,7 +2716,7 @@ export default { } }, /** - * Lookup325: pallet_ethereum::pallet::Call + * Lookup319: pallet_ethereum::pallet::Call **/ PalletEthereumCall: { _enum: { @@ -2790,7 +2726,7 @@ export default { } }, /** - * Lookup326: ethereum::transaction::TransactionV2 + * Lookup320: ethereum::transaction::TransactionV2 **/ EthereumTransactionTransactionV2: { _enum: { @@ -2800,7 +2736,7 @@ export default { } }, /** - * Lookup327: ethereum::transaction::LegacyTransaction + * Lookup321: ethereum::transaction::LegacyTransaction **/ EthereumTransactionLegacyTransaction: { nonce: 'U256', @@ -2812,7 +2748,7 @@ export default { signature: 'EthereumTransactionTransactionSignature' }, /** - * Lookup328: ethereum::transaction::TransactionAction + * Lookup322: ethereum::transaction::TransactionAction **/ EthereumTransactionTransactionAction: { _enum: { @@ -2821,7 +2757,7 @@ export default { } }, /** - * Lookup329: ethereum::transaction::TransactionSignature + * Lookup323: ethereum::transaction::TransactionSignature **/ EthereumTransactionTransactionSignature: { v: 'u64', @@ -2829,7 +2765,7 @@ export default { s: 'H256' }, /** - * Lookup331: ethereum::transaction::EIP2930Transaction + * Lookup325: ethereum::transaction::EIP2930Transaction **/ EthereumTransactionEip2930Transaction: { chainId: 'u64', @@ -2845,14 +2781,14 @@ export default { s: 'H256' }, /** - * Lookup333: ethereum::transaction::AccessListItem + * Lookup327: ethereum::transaction::AccessListItem **/ EthereumTransactionAccessListItem: { address: 'H160', storageKeys: 'Vec' }, /** - * Lookup334: ethereum::transaction::EIP1559Transaction + * Lookup328: ethereum::transaction::EIP1559Transaction **/ EthereumTransactionEip1559Transaction: { chainId: 'u64', @@ -2869,7 +2805,7 @@ export default { s: 'H256' }, /** - * Lookup335: pallet_evm_migration::pallet::Call + * Lookup329: pallet_evm_migration::pallet::Call **/ PalletEvmMigrationCall: { _enum: { @@ -2887,32 +2823,32 @@ export default { } }, /** - * Lookup338: pallet_sudo::pallet::Error + * Lookup332: pallet_sudo::pallet::Error **/ PalletSudoError: { _enum: ['RequireSudo'] }, /** - * Lookup340: orml_vesting::module::Error + * Lookup334: orml_vesting::module::Error **/ OrmlVestingModuleError: { _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded'] }, /** - * Lookup341: orml_xtokens::module::Error + * Lookup335: orml_xtokens::module::Error **/ OrmlXtokensModuleError: { _enum: ['AssetHasNoReserve', 'NotCrossChainTransfer', 'InvalidDest', 'NotCrossChainTransferableCurrency', 'UnweighableMessage', 'XcmExecutionFailed', 'CannotReanchor', 'InvalidAncestry', 'InvalidAsset', 'DestinationNotInvertible', 'BadVersion', 'DistinctReserveForAssetAndFee', 'ZeroFee', 'ZeroAmount', 'TooManyAssetsBeingSent', 'AssetIndexNonExistent', 'FeeNotEnough', 'NotSupportedMultiLocation', 'MinXcmFeeNotDefined'] }, /** - * Lookup344: orml_tokens::BalanceLock + * Lookup338: orml_tokens::BalanceLock **/ OrmlTokensBalanceLock: { id: '[u8;8]', amount: 'u128' }, /** - * Lookup346: orml_tokens::AccountData + * Lookup340: orml_tokens::AccountData **/ OrmlTokensAccountData: { free: 'u128', @@ -2920,20 +2856,20 @@ export default { frozen: 'u128' }, /** - * Lookup348: orml_tokens::ReserveData + * Lookup342: orml_tokens::ReserveData **/ OrmlTokensReserveData: { id: 'Null', amount: 'u128' }, /** - * Lookup350: orml_tokens::module::Error + * Lookup344: orml_tokens::module::Error **/ OrmlTokensModuleError: { _enum: ['BalanceTooLow', 'AmountIntoBalanceFailed', 'LiquidityRestrictions', 'MaxLocksExceeded', 'KeepAlive', 'ExistentialDeposit', 'DeadAccount', 'TooManyReserves'] }, /** - * Lookup352: cumulus_pallet_xcmp_queue::InboundChannelDetails + * Lookup346: cumulus_pallet_xcmp_queue::InboundChannelDetails **/ CumulusPalletXcmpQueueInboundChannelDetails: { sender: 'u32', @@ -2941,19 +2877,19 @@ export default { messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>' }, /** - * Lookup353: cumulus_pallet_xcmp_queue::InboundState + * Lookup347: cumulus_pallet_xcmp_queue::InboundState **/ CumulusPalletXcmpQueueInboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup356: polkadot_parachain::primitives::XcmpMessageFormat + * Lookup350: polkadot_parachain::primitives::XcmpMessageFormat **/ PolkadotParachainPrimitivesXcmpMessageFormat: { _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals'] }, /** - * Lookup359: cumulus_pallet_xcmp_queue::OutboundChannelDetails + * Lookup353: cumulus_pallet_xcmp_queue::OutboundChannelDetails **/ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: 'u32', @@ -2963,13 +2899,13 @@ export default { lastIndex: 'u16' }, /** - * Lookup360: cumulus_pallet_xcmp_queue::OutboundState + * Lookup354: cumulus_pallet_xcmp_queue::OutboundState **/ CumulusPalletXcmpQueueOutboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup362: cumulus_pallet_xcmp_queue::QueueConfigData + * Lookup356: cumulus_pallet_xcmp_queue::QueueConfigData **/ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: 'u32', @@ -2980,29 +2916,29 @@ export default { xcmpMaxIndividualWeight: 'Weight' }, /** - * Lookup364: cumulus_pallet_xcmp_queue::pallet::Error + * Lookup358: cumulus_pallet_xcmp_queue::pallet::Error **/ CumulusPalletXcmpQueueError: { _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit'] }, /** - * Lookup365: pallet_xcm::pallet::Error + * Lookup359: pallet_xcm::pallet::Error **/ PalletXcmError: { _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed'] }, /** - * Lookup366: cumulus_pallet_xcm::pallet::Error + * Lookup360: cumulus_pallet_xcm::pallet::Error **/ CumulusPalletXcmError: 'Null', /** - * Lookup367: cumulus_pallet_dmp_queue::ConfigData + * Lookup361: cumulus_pallet_dmp_queue::ConfigData **/ CumulusPalletDmpQueueConfigData: { maxIndividual: 'Weight' }, /** - * Lookup368: cumulus_pallet_dmp_queue::PageIndexData + * Lookup362: cumulus_pallet_dmp_queue::PageIndexData **/ CumulusPalletDmpQueuePageIndexData: { beginUsed: 'u32', @@ -3010,184 +2946,19 @@ export default { overweightCount: 'u64' }, /** - * Lookup371: cumulus_pallet_dmp_queue::pallet::Error + * Lookup365: cumulus_pallet_dmp_queue::pallet::Error **/ CumulusPalletDmpQueueError: { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup375: pallet_unique::Error + * Lookup369: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup378: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> - **/ - PalletUniqueSchedulerScheduledV3: { - maybeId: 'Option<[u8;16]>', - priority: 'u8', - call: 'FrameSupportScheduleMaybeHashed', - maybePeriodic: 'Option<(u32,u32)>', - origin: 'OpalRuntimeOriginCaller' - }, - /** - * Lookup379: opal_runtime::OriginCaller - **/ - OpalRuntimeOriginCaller: { - _enum: { - system: 'FrameSupportDispatchRawOrigin', - __Unused1: 'Null', - __Unused2: 'Null', - __Unused3: 'Null', - Void: 'SpCoreVoid', - __Unused5: 'Null', - __Unused6: 'Null', - __Unused7: 'Null', - __Unused8: 'Null', - __Unused9: 'Null', - __Unused10: 'Null', - __Unused11: 'Null', - __Unused12: 'Null', - __Unused13: 'Null', - __Unused14: 'Null', - __Unused15: 'Null', - __Unused16: 'Null', - __Unused17: 'Null', - __Unused18: 'Null', - __Unused19: 'Null', - __Unused20: 'Null', - __Unused21: 'Null', - __Unused22: 'Null', - __Unused23: 'Null', - __Unused24: 'Null', - __Unused25: 'Null', - __Unused26: 'Null', - __Unused27: 'Null', - __Unused28: 'Null', - __Unused29: 'Null', - __Unused30: 'Null', - __Unused31: 'Null', - __Unused32: 'Null', - __Unused33: 'Null', - __Unused34: 'Null', - __Unused35: 'Null', - __Unused36: 'Null', - __Unused37: 'Null', - __Unused38: 'Null', - __Unused39: 'Null', - __Unused40: 'Null', - __Unused41: 'Null', - __Unused42: 'Null', - __Unused43: 'Null', - __Unused44: 'Null', - __Unused45: 'Null', - __Unused46: 'Null', - __Unused47: 'Null', - __Unused48: 'Null', - __Unused49: 'Null', - __Unused50: 'Null', - PolkadotXcm: 'PalletXcmOrigin', - CumulusXcm: 'CumulusPalletXcmOrigin', - __Unused53: 'Null', - __Unused54: 'Null', - __Unused55: 'Null', - __Unused56: 'Null', - __Unused57: 'Null', - __Unused58: 'Null', - __Unused59: 'Null', - __Unused60: 'Null', - __Unused61: 'Null', - __Unused62: 'Null', - __Unused63: 'Null', - __Unused64: 'Null', - __Unused65: 'Null', - __Unused66: 'Null', - __Unused67: 'Null', - __Unused68: 'Null', - __Unused69: 'Null', - __Unused70: 'Null', - __Unused71: 'Null', - __Unused72: 'Null', - __Unused73: 'Null', - __Unused74: 'Null', - __Unused75: 'Null', - __Unused76: 'Null', - __Unused77: 'Null', - __Unused78: 'Null', - __Unused79: 'Null', - __Unused80: 'Null', - __Unused81: 'Null', - __Unused82: 'Null', - __Unused83: 'Null', - __Unused84: 'Null', - __Unused85: 'Null', - __Unused86: 'Null', - __Unused87: 'Null', - __Unused88: 'Null', - __Unused89: 'Null', - __Unused90: 'Null', - __Unused91: 'Null', - __Unused92: 'Null', - __Unused93: 'Null', - __Unused94: 'Null', - __Unused95: 'Null', - __Unused96: 'Null', - __Unused97: 'Null', - __Unused98: 'Null', - __Unused99: 'Null', - __Unused100: 'Null', - Ethereum: 'PalletEthereumRawOrigin' - } - }, - /** - * Lookup380: frame_support::dispatch::RawOrigin - **/ - FrameSupportDispatchRawOrigin: { - _enum: { - Root: 'Null', - Signed: 'AccountId32', - None: 'Null' - } - }, - /** - * Lookup381: pallet_xcm::pallet::Origin - **/ - PalletXcmOrigin: { - _enum: { - Xcm: 'XcmV1MultiLocation', - Response: 'XcmV1MultiLocation' - } - }, - /** - * Lookup382: cumulus_pallet_xcm::pallet::Origin - **/ - CumulusPalletXcmOrigin: { - _enum: { - Relay: 'Null', - SiblingParachain: 'u32' - } - }, - /** - * Lookup383: pallet_ethereum::RawOrigin - **/ - PalletEthereumRawOrigin: { - _enum: { - EthereumTransaction: 'H160' - } - }, - /** - * Lookup384: sp_core::Void - **/ - SpCoreVoid: 'Null', - /** - * Lookup385: pallet_unique_scheduler::pallet::Error - **/ - PalletUniqueSchedulerError: { - _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] - }, - /** - * Lookup386: up_data_structs::Collection + * Lookup370: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -3201,7 +2972,7 @@ export default { flags: '[u8;1]' }, /** - * Lookup387: up_data_structs::SponsorshipState + * Lookup371: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipStateAccountId32: { _enum: { @@ -3211,7 +2982,7 @@ export default { } }, /** - * Lookup389: up_data_structs::Properties + * Lookup373: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -3219,15 +2990,15 @@ export default { spaceLimit: 'u32' }, /** - * Lookup390: up_data_structs::PropertiesMap> + * Lookup374: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** - * Lookup395: up_data_structs::PropertiesMap + * Lookup379: up_data_structs::PropertiesMap **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup402: up_data_structs::CollectionStats + * Lookup386: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -3235,18 +3006,18 @@ export default { alive: 'u32' }, /** - * Lookup403: up_data_structs::TokenChild + * Lookup387: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup404: PhantomType::up_data_structs + * Lookup388: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup406: up_data_structs::TokenData> + * Lookup390: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -3254,7 +3025,7 @@ export default { pieces: 'u128' }, /** - * Lookup408: up_data_structs::RpcCollection + * Lookup392: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -3271,14 +3042,14 @@ export default { flags: 'UpDataStructsRpcCollectionFlags' }, /** - * Lookup409: up_data_structs::RpcCollectionFlags + * Lookup393: up_data_structs::RpcCollectionFlags **/ UpDataStructsRpcCollectionFlags: { foreign: 'bool', erc721metadata: 'bool' }, /** - * Lookup410: rmrk_traits::collection::CollectionInfo, sp_runtime::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup394: rmrk_traits::collection::CollectionInfo, sp_core::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -3288,7 +3059,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup411: rmrk_traits::nft::NftInfo> + * Lookup395: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -3298,14 +3069,14 @@ export default { pending: 'bool' }, /** - * Lookup413: rmrk_traits::nft::RoyaltyInfo + * Lookup397: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup414: rmrk_traits::resource::ResourceInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup398: rmrk_traits::resource::ResourceInfo, sp_core::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -3314,14 +3085,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup415: rmrk_traits::property::PropertyInfo, sp_runtime::bounded::bounded_vec::BoundedVec> + * Lookup399: rmrk_traits::property::PropertyInfo, sp_core::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup416: rmrk_traits::base::BaseInfo> + * Lookup400: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -3329,92 +3100,92 @@ export default { symbol: 'Bytes' }, /** - * Lookup417: rmrk_traits::nft::NftChild + * Lookup401: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup419: pallet_common::pallet::Error + * Lookup403: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup421: pallet_fungible::pallet::Error + * Lookup405: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup422: pallet_refungible::ItemData + * Lookup406: pallet_refungible::ItemData **/ PalletRefungibleItemData: { constData: 'Bytes' }, /** - * Lookup427: pallet_refungible::pallet::Error + * Lookup411: pallet_refungible::pallet::Error **/ PalletRefungibleError: { _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup428: pallet_nonfungible::ItemData> + * Lookup412: pallet_nonfungible::ItemData> **/ PalletNonfungibleItemData: { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup430: up_data_structs::PropertyScope + * Lookup414: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { _enum: ['None', 'Rmrk'] }, /** - * Lookup432: pallet_nonfungible::pallet::Error + * Lookup416: pallet_nonfungible::pallet::Error **/ PalletNonfungibleError: { _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup433: pallet_structure::pallet::Error + * Lookup417: pallet_structure::pallet::Error **/ PalletStructureError: { _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup434: pallet_rmrk_core::pallet::Error + * Lookup418: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** - * Lookup436: pallet_rmrk_equip::pallet::Error + * Lookup420: pallet_rmrk_equip::pallet::Error **/ PalletRmrkEquipError: { _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] }, /** - * Lookup442: pallet_app_promotion::pallet::Error + * Lookup426: pallet_app_promotion::pallet::Error **/ PalletAppPromotionError: { _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'SponsorNotSet', 'IncorrectLockedBalanceOperation'] }, /** - * Lookup443: pallet_foreign_assets::module::Error + * Lookup427: pallet_foreign_assets::module::Error **/ PalletForeignAssetsModuleError: { _enum: ['BadLocation', 'MultiLocationExisted', 'AssetIdNotExists', 'AssetIdExisted'] }, /** - * Lookup446: pallet_evm::pallet::Error + * Lookup430: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup449: fp_rpc::TransactionStatus + * Lookup433: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -3426,11 +3197,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup451: ethbloom::Bloom + * Lookup435: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup453: ethereum::receipt::ReceiptV3 + * Lookup437: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -3440,7 +3211,7 @@ export default { } }, /** - * Lookup454: ethereum::receipt::EIP658ReceiptData + * Lookup438: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -3449,7 +3220,7 @@ export default { logs: 'Vec' }, /** - * Lookup455: ethereum::block::Block + * Lookup439: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -3457,7 +3228,7 @@ export default { ommers: 'Vec' }, /** - * Lookup456: ethereum::header::Header + * Lookup440: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -3477,23 +3248,23 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup457: ethereum_types::hash::H64 + * Lookup441: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup462: pallet_ethereum::pallet::Error + * Lookup446: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup463: pallet_evm_coder_substrate::pallet::Error + * Lookup447: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup464: up_data_structs::SponsorshipState> + * Lookup448: up_data_structs::SponsorshipState> **/ UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: { _enum: { @@ -3503,25 +3274,25 @@ export default { } }, /** - * Lookup465: pallet_evm_contract_helpers::SponsoringModeT + * Lookup449: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup471: pallet_evm_contract_helpers::pallet::Error + * Lookup455: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission', 'NoPendingSponsor', 'TooManyMethodsHaveSponsoredLimit'] }, /** - * Lookup472: pallet_evm_migration::pallet::Error + * Lookup456: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup474: sp_runtime::MultiSignature + * Lookup458: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3531,47 +3302,47 @@ export default { } }, /** - * Lookup475: sp_core::ed25519::Signature + * Lookup459: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup477: sp_core::sr25519::Signature + * Lookup461: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup478: sp_core::ecdsa::Signature + * Lookup462: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup481: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup465: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup482: frame_system::extensions::check_tx_version::CheckTxVersion + * Lookup466: frame_system::extensions::check_tx_version::CheckTxVersion **/ FrameSystemExtensionsCheckTxVersion: 'Null', /** - * Lookup483: frame_system::extensions::check_genesis::CheckGenesis + * Lookup467: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup486: frame_system::extensions::check_nonce::CheckNonce + * Lookup470: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup487: frame_system::extensions::check_weight::CheckWeight + * Lookup471: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup488: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup472: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup489: opal_runtime::Runtime + * Lookup473: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup490: pallet_ethereum::FakeTransactionFinalizer + * Lookup474: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index a71554d8a7..4f55938a94 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassWeight, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsRpcCollectionFlags, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchDispatchClass, FrameSupportDispatchDispatchInfo, FrameSupportDispatchPays, FrameSupportDispatchPerDispatchClassU32, FrameSupportDispatchPerDispatchClassWeight, FrameSupportDispatchPerDispatchClassWeightsPerClass, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsRpcCollectionFlags, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { interface InterfaceTypes { @@ -21,7 +21,6 @@ declare module '@polkadot/types/types/registry' { CumulusPalletXcmCall: CumulusPalletXcmCall; CumulusPalletXcmError: CumulusPalletXcmError; CumulusPalletXcmEvent: CumulusPalletXcmEvent; - CumulusPalletXcmOrigin: CumulusPalletXcmOrigin; CumulusPalletXcmpQueueCall: CumulusPalletXcmpQueueCall; CumulusPalletXcmpQueueError: CumulusPalletXcmpQueueError; CumulusPalletXcmpQueueEvent: CumulusPalletXcmpQueueEvent; @@ -51,18 +50,14 @@ declare module '@polkadot/types/types/registry' { EvmCoreErrorExitRevert: EvmCoreErrorExitRevert; EvmCoreErrorExitSucceed: EvmCoreErrorExitSucceed; FpRpcTransactionStatus: FpRpcTransactionStatus; - FrameSupportDispatchRawOrigin: FrameSupportDispatchRawOrigin; + FrameSupportDispatchDispatchClass: FrameSupportDispatchDispatchClass; + FrameSupportDispatchDispatchInfo: FrameSupportDispatchDispatchInfo; + FrameSupportDispatchPays: FrameSupportDispatchPays; + FrameSupportDispatchPerDispatchClassU32: FrameSupportDispatchPerDispatchClassU32; + FrameSupportDispatchPerDispatchClassWeight: FrameSupportDispatchPerDispatchClassWeight; + FrameSupportDispatchPerDispatchClassWeightsPerClass: FrameSupportDispatchPerDispatchClassWeightsPerClass; FrameSupportPalletId: FrameSupportPalletId; - FrameSupportScheduleLookupError: FrameSupportScheduleLookupError; - FrameSupportScheduleMaybeHashed: FrameSupportScheduleMaybeHashed; FrameSupportTokensMiscBalanceStatus: FrameSupportTokensMiscBalanceStatus; - FrameSupportWeightsDispatchClass: FrameSupportWeightsDispatchClass; - FrameSupportWeightsDispatchInfo: FrameSupportWeightsDispatchInfo; - FrameSupportWeightsPays: FrameSupportWeightsPays; - FrameSupportWeightsPerDispatchClassU32: FrameSupportWeightsPerDispatchClassU32; - FrameSupportWeightsPerDispatchClassWeight: FrameSupportWeightsPerDispatchClassWeight; - FrameSupportWeightsPerDispatchClassWeightsPerClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; - FrameSupportWeightsRuntimeDbWeight: FrameSupportWeightsRuntimeDbWeight; FrameSystemAccountInfo: FrameSystemAccountInfo; FrameSystemCall: FrameSystemCall; FrameSystemError: FrameSystemError; @@ -78,7 +73,6 @@ declare module '@polkadot/types/types/registry' { FrameSystemLimitsBlockWeights: FrameSystemLimitsBlockWeights; FrameSystemLimitsWeightsPerClass: FrameSystemLimitsWeightsPerClass; FrameSystemPhase: FrameSystemPhase; - OpalRuntimeOriginCaller: OpalRuntimeOriginCaller; OpalRuntimeRuntime: OpalRuntimeRuntime; OrmlTokensAccountData: OrmlTokensAccountData; OrmlTokensBalanceLock: OrmlTokensBalanceLock; @@ -111,7 +105,6 @@ declare module '@polkadot/types/types/registry' { PalletEthereumError: PalletEthereumError; PalletEthereumEvent: PalletEthereumEvent; PalletEthereumFakeTransactionFinalizer: PalletEthereumFakeTransactionFinalizer; - PalletEthereumRawOrigin: PalletEthereumRawOrigin; PalletEvmAccountBasicCrossAccountIdRepr: PalletEvmAccountBasicCrossAccountIdRepr; PalletEvmCall: PalletEvmCall; PalletEvmCoderSubstrateError: PalletEvmCoderSubstrateError; @@ -158,14 +151,9 @@ declare module '@polkadot/types/types/registry' { PalletUniqueCall: PalletUniqueCall; PalletUniqueError: PalletUniqueError; PalletUniqueRawEvent: PalletUniqueRawEvent; - PalletUniqueSchedulerCall: PalletUniqueSchedulerCall; - PalletUniqueSchedulerError: PalletUniqueSchedulerError; - PalletUniqueSchedulerEvent: PalletUniqueSchedulerEvent; - PalletUniqueSchedulerScheduledV3: PalletUniqueSchedulerScheduledV3; PalletXcmCall: PalletXcmCall; PalletXcmError: PalletXcmError; PalletXcmEvent: PalletXcmEvent; - PalletXcmOrigin: PalletXcmOrigin; PhantomTypeUpDataStructs: PhantomTypeUpDataStructs; PolkadotCorePrimitivesInboundDownwardMessage: PolkadotCorePrimitivesInboundDownwardMessage; PolkadotCorePrimitivesInboundHrmpMessage: PolkadotCorePrimitivesInboundHrmpMessage; @@ -196,7 +184,6 @@ declare module '@polkadot/types/types/registry' { SpCoreEcdsaSignature: SpCoreEcdsaSignature; SpCoreEd25519Signature: SpCoreEd25519Signature; SpCoreSr25519Signature: SpCoreSr25519Signature; - SpCoreVoid: SpCoreVoid; SpRuntimeArithmeticError: SpRuntimeArithmeticError; SpRuntimeDigest: SpRuntimeDigest; SpRuntimeDigestDigestItem: SpRuntimeDigestDigestItem; @@ -207,6 +194,7 @@ declare module '@polkadot/types/types/registry' { SpRuntimeTransactionalError: SpRuntimeTransactionalError; SpTrieStorageProof: SpTrieStorageProof; SpVersionRuntimeVersion: SpVersionRuntimeVersion; + SpWeightsRuntimeDbWeight: SpWeightsRuntimeDbWeight; UpDataStructsAccessMode: UpDataStructsAccessMode; UpDataStructsCollection: UpDataStructsCollection; UpDataStructsCollectionLimits: UpDataStructsCollectionLimits; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index e21e5d6df4..fc9d25389b 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -28,8 +28,8 @@ declare module '@polkadot/types/lookup' { readonly feeFrozen: u128; } - /** @name FrameSupportWeightsPerDispatchClassWeight (7) */ - interface FrameSupportWeightsPerDispatchClassWeight extends Struct { + /** @name FrameSupportDispatchPerDispatchClassWeight (7) */ + interface FrameSupportDispatchPerDispatchClassWeight extends Struct { readonly normal: Weight; readonly operational: Weight; readonly mandatory: Weight; @@ -65,12 +65,12 @@ declare module '@polkadot/types/lookup' { interface FrameSystemEvent extends Enum { readonly isExtrinsicSuccess: boolean; readonly asExtrinsicSuccess: { - readonly dispatchInfo: FrameSupportWeightsDispatchInfo; + readonly dispatchInfo: FrameSupportDispatchDispatchInfo; } & Struct; readonly isExtrinsicFailed: boolean; readonly asExtrinsicFailed: { readonly dispatchError: SpRuntimeDispatchError; - readonly dispatchInfo: FrameSupportWeightsDispatchInfo; + readonly dispatchInfo: FrameSupportDispatchDispatchInfo; } & Struct; readonly isCodeUpdated: boolean; readonly isNewAccount: boolean; @@ -89,23 +89,23 @@ declare module '@polkadot/types/lookup' { readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked'; } - /** @name FrameSupportWeightsDispatchInfo (20) */ - interface FrameSupportWeightsDispatchInfo extends Struct { + /** @name FrameSupportDispatchDispatchInfo (20) */ + interface FrameSupportDispatchDispatchInfo extends Struct { readonly weight: Weight; - readonly class: FrameSupportWeightsDispatchClass; - readonly paysFee: FrameSupportWeightsPays; + readonly class: FrameSupportDispatchDispatchClass; + readonly paysFee: FrameSupportDispatchPays; } - /** @name FrameSupportWeightsDispatchClass (21) */ - interface FrameSupportWeightsDispatchClass extends Enum { + /** @name FrameSupportDispatchDispatchClass (21) */ + interface FrameSupportDispatchDispatchClass extends Enum { readonly isNormal: boolean; readonly isOperational: boolean; readonly isMandatory: boolean; readonly type: 'Normal' | 'Operational' | 'Mandatory'; } - /** @name FrameSupportWeightsPays (22) */ - interface FrameSupportWeightsPays extends Enum { + /** @name FrameSupportDispatchPays (22) */ + interface FrameSupportDispatchPays extends Enum { readonly isYes: boolean; readonly isNo: boolean; readonly type: 'Yes' | 'No'; @@ -1132,41 +1132,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Substrate' | 'Ethereum'; } - /** @name PalletUniqueSchedulerEvent (93) */ - interface PalletUniqueSchedulerEvent extends Enum { - readonly isScheduled: boolean; - readonly asScheduled: { - readonly when: u32; - readonly index: u32; - } & Struct; - readonly isCanceled: boolean; - readonly asCanceled: { - readonly when: u32; - readonly index: u32; - } & Struct; - readonly isDispatched: boolean; - readonly asDispatched: { - readonly task: ITuple<[u32, u32]>; - readonly id: Option; - readonly result: Result; - } & Struct; - readonly isCallLookupFailed: boolean; - readonly asCallLookupFailed: { - readonly task: ITuple<[u32, u32]>; - readonly id: Option; - readonly error: FrameSupportScheduleLookupError; - } & Struct; - readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed'; - } - - /** @name FrameSupportScheduleLookupError (96) */ - interface FrameSupportScheduleLookupError extends Enum { - readonly isUnknown: boolean; - readonly isBadFormat: boolean; - readonly type: 'Unknown' | 'BadFormat'; - } - - /** @name PalletCommonEvent (97) */ + /** @name PalletCommonEvent (93) */ interface PalletCommonEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; @@ -1193,14 +1159,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; } - /** @name PalletStructureEvent (100) */ + /** @name PalletStructureEvent (96) */ interface PalletStructureEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: Result; readonly type: 'Executed'; } - /** @name PalletRmrkCoreEvent (101) */ + /** @name PalletRmrkCoreEvent (97) */ interface PalletRmrkCoreEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: { @@ -1290,7 +1256,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; } - /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (102) */ + /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (98) */ interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { readonly isAccountId: boolean; readonly asAccountId: AccountId32; @@ -1299,7 +1265,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'AccountId' | 'CollectionAndNftTuple'; } - /** @name PalletRmrkEquipEvent (107) */ + /** @name PalletRmrkEquipEvent (103) */ interface PalletRmrkEquipEvent extends Enum { readonly isBaseCreated: boolean; readonly asBaseCreated: { @@ -1314,7 +1280,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BaseCreated' | 'EquippablesUpdated'; } - /** @name PalletAppPromotionEvent (108) */ + /** @name PalletAppPromotionEvent (104) */ interface PalletAppPromotionEvent extends Enum { readonly isStakingRecalculation: boolean; readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>; @@ -1327,7 +1293,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'StakingRecalculation' | 'Stake' | 'Unstake' | 'SetAdmin'; } - /** @name PalletForeignAssetsModuleEvent (109) */ + /** @name PalletForeignAssetsModuleEvent (105) */ interface PalletForeignAssetsModuleEvent extends Enum { readonly isForeignAssetRegistered: boolean; readonly asForeignAssetRegistered: { @@ -1354,7 +1320,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ForeignAssetRegistered' | 'ForeignAssetUpdated' | 'AssetRegistered' | 'AssetUpdated'; } - /** @name PalletForeignAssetsModuleAssetMetadata (110) */ + /** @name PalletForeignAssetsModuleAssetMetadata (106) */ interface PalletForeignAssetsModuleAssetMetadata extends Struct { readonly name: Bytes; readonly symbol: Bytes; @@ -1362,7 +1328,7 @@ declare module '@polkadot/types/lookup' { readonly minimalBalance: u128; } - /** @name PalletEvmEvent (111) */ + /** @name PalletEvmEvent (107) */ interface PalletEvmEvent extends Enum { readonly isLog: boolean; readonly asLog: EthereumLog; @@ -1381,21 +1347,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; } - /** @name EthereumLog (112) */ + /** @name EthereumLog (108) */ interface EthereumLog extends Struct { readonly address: H160; readonly topics: Vec; readonly data: Bytes; } - /** @name PalletEthereumEvent (116) */ + /** @name PalletEthereumEvent (112) */ interface PalletEthereumEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; readonly type: 'Executed'; } - /** @name EvmCoreErrorExitReason (117) */ + /** @name EvmCoreErrorExitReason (113) */ interface EvmCoreErrorExitReason extends Enum { readonly isSucceed: boolean; readonly asSucceed: EvmCoreErrorExitSucceed; @@ -1408,7 +1374,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; } - /** @name EvmCoreErrorExitSucceed (118) */ + /** @name EvmCoreErrorExitSucceed (114) */ interface EvmCoreErrorExitSucceed extends Enum { readonly isStopped: boolean; readonly isReturned: boolean; @@ -1416,7 +1382,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Stopped' | 'Returned' | 'Suicided'; } - /** @name EvmCoreErrorExitError (119) */ + /** @name EvmCoreErrorExitError (115) */ interface EvmCoreErrorExitError extends Enum { readonly isStackUnderflow: boolean; readonly isStackOverflow: boolean; @@ -1437,13 +1403,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; } - /** @name EvmCoreErrorExitRevert (122) */ + /** @name EvmCoreErrorExitRevert (118) */ interface EvmCoreErrorExitRevert extends Enum { readonly isReverted: boolean; readonly type: 'Reverted'; } - /** @name EvmCoreErrorExitFatal (123) */ + /** @name EvmCoreErrorExitFatal (119) */ interface EvmCoreErrorExitFatal extends Enum { readonly isNotSupported: boolean; readonly isUnhandledInterrupt: boolean; @@ -1454,7 +1420,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; } - /** @name PalletEvmContractHelpersEvent (124) */ + /** @name PalletEvmContractHelpersEvent (120) */ interface PalletEvmContractHelpersEvent extends Enum { readonly isContractSponsorSet: boolean; readonly asContractSponsorSet: ITuple<[H160, AccountId32]>; @@ -1465,7 +1431,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ContractSponsorSet' | 'ContractSponsorshipConfirmed' | 'ContractSponsorRemoved'; } - /** @name FrameSystemPhase (125) */ + /** @name FrameSystemPhase (121) */ interface FrameSystemPhase extends Enum { readonly isApplyExtrinsic: boolean; readonly asApplyExtrinsic: u32; @@ -1474,13 +1440,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } - /** @name FrameSystemLastRuntimeUpgradeInfo (127) */ + /** @name FrameSystemLastRuntimeUpgradeInfo (124) */ interface FrameSystemLastRuntimeUpgradeInfo extends Struct { readonly specVersion: Compact; readonly specName: Text; } - /** @name FrameSystemCall (128) */ + /** @name FrameSystemCall (125) */ interface FrameSystemCall extends Enum { readonly isFillBlock: boolean; readonly asFillBlock: { @@ -1522,21 +1488,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent'; } - /** @name FrameSystemLimitsBlockWeights (133) */ + /** @name FrameSystemLimitsBlockWeights (130) */ interface FrameSystemLimitsBlockWeights extends Struct { readonly baseBlock: Weight; readonly maxBlock: Weight; - readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass; + readonly perClass: FrameSupportDispatchPerDispatchClassWeightsPerClass; } - /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (134) */ - interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct { + /** @name FrameSupportDispatchPerDispatchClassWeightsPerClass (131) */ + interface FrameSupportDispatchPerDispatchClassWeightsPerClass extends Struct { readonly normal: FrameSystemLimitsWeightsPerClass; readonly operational: FrameSystemLimitsWeightsPerClass; readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name FrameSystemLimitsWeightsPerClass (135) */ + /** @name FrameSystemLimitsWeightsPerClass (132) */ interface FrameSystemLimitsWeightsPerClass extends Struct { readonly baseExtrinsic: Weight; readonly maxExtrinsic: Option; @@ -1544,25 +1510,25 @@ declare module '@polkadot/types/lookup' { readonly reserved: Option; } - /** @name FrameSystemLimitsBlockLength (137) */ + /** @name FrameSystemLimitsBlockLength (134) */ interface FrameSystemLimitsBlockLength extends Struct { - readonly max: FrameSupportWeightsPerDispatchClassU32; + readonly max: FrameSupportDispatchPerDispatchClassU32; } - /** @name FrameSupportWeightsPerDispatchClassU32 (138) */ - interface FrameSupportWeightsPerDispatchClassU32 extends Struct { + /** @name FrameSupportDispatchPerDispatchClassU32 (135) */ + interface FrameSupportDispatchPerDispatchClassU32 extends Struct { readonly normal: u32; readonly operational: u32; readonly mandatory: u32; } - /** @name FrameSupportWeightsRuntimeDbWeight (139) */ - interface FrameSupportWeightsRuntimeDbWeight extends Struct { + /** @name SpWeightsRuntimeDbWeight (136) */ + interface SpWeightsRuntimeDbWeight extends Struct { readonly read: u64; readonly write: u64; } - /** @name SpVersionRuntimeVersion (140) */ + /** @name SpVersionRuntimeVersion (137) */ interface SpVersionRuntimeVersion extends Struct { readonly specName: Text; readonly implName: Text; @@ -1574,7 +1540,7 @@ declare module '@polkadot/types/lookup' { readonly stateVersion: u8; } - /** @name FrameSystemError (145) */ + /** @name FrameSystemError (142) */ interface FrameSystemError extends Enum { readonly isInvalidSpecName: boolean; readonly isSpecVersionNeedsToIncrease: boolean; @@ -1585,7 +1551,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name PolkadotPrimitivesV2PersistedValidationData (146) */ + /** @name PolkadotPrimitivesV2PersistedValidationData (143) */ interface PolkadotPrimitivesV2PersistedValidationData extends Struct { readonly parentHead: Bytes; readonly relayParentNumber: u32; @@ -1593,18 +1559,18 @@ declare module '@polkadot/types/lookup' { readonly maxPovSize: u32; } - /** @name PolkadotPrimitivesV2UpgradeRestriction (149) */ + /** @name PolkadotPrimitivesV2UpgradeRestriction (146) */ interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { readonly isPresent: boolean; readonly type: 'Present'; } - /** @name SpTrieStorageProof (150) */ + /** @name SpTrieStorageProof (147) */ interface SpTrieStorageProof extends Struct { readonly trieNodes: BTreeSet; } - /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (152) */ + /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (149) */ interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { readonly dmqMqcHead: H256; readonly relayDispatchQueueSize: ITuple<[u32, u32]>; @@ -1612,7 +1578,7 @@ declare module '@polkadot/types/lookup' { readonly egressChannels: Vec>; } - /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (155) */ + /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (152) */ interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { readonly maxCapacity: u32; readonly maxTotalSize: u32; @@ -1622,7 +1588,7 @@ declare module '@polkadot/types/lookup' { readonly mqcHead: Option; } - /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (156) */ + /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (153) */ interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { readonly maxCodeSize: u32; readonly maxHeadDataSize: u32; @@ -1635,13 +1601,13 @@ declare module '@polkadot/types/lookup' { readonly validationUpgradeDelay: u32; } - /** @name PolkadotCorePrimitivesOutboundHrmpMessage (162) */ + /** @name PolkadotCorePrimitivesOutboundHrmpMessage (159) */ interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { readonly recipient: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemCall (163) */ + /** @name CumulusPalletParachainSystemCall (160) */ interface CumulusPalletParachainSystemCall extends Enum { readonly isSetValidationData: boolean; readonly asSetValidationData: { @@ -1662,7 +1628,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade'; } - /** @name CumulusPrimitivesParachainInherentParachainInherentData (164) */ + /** @name CumulusPrimitivesParachainInherentParachainInherentData (161) */ interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { readonly validationData: PolkadotPrimitivesV2PersistedValidationData; readonly relayChainState: SpTrieStorageProof; @@ -1670,19 +1636,19 @@ declare module '@polkadot/types/lookup' { readonly horizontalMessages: BTreeMap>; } - /** @name PolkadotCorePrimitivesInboundDownwardMessage (166) */ + /** @name PolkadotCorePrimitivesInboundDownwardMessage (163) */ interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { readonly sentAt: u32; readonly msg: Bytes; } - /** @name PolkadotCorePrimitivesInboundHrmpMessage (169) */ + /** @name PolkadotCorePrimitivesInboundHrmpMessage (166) */ interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { readonly sentAt: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemError (172) */ + /** @name CumulusPalletParachainSystemError (169) */ interface CumulusPalletParachainSystemError extends Enum { readonly isOverlappingUpgrades: boolean; readonly isProhibitedByPolkadot: boolean; @@ -1695,14 +1661,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized'; } - /** @name PalletBalancesBalanceLock (174) */ + /** @name PalletBalancesBalanceLock (171) */ interface PalletBalancesBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; readonly reasons: PalletBalancesReasons; } - /** @name PalletBalancesReasons (175) */ + /** @name PalletBalancesReasons (172) */ interface PalletBalancesReasons extends Enum { readonly isFee: boolean; readonly isMisc: boolean; @@ -1710,20 +1676,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'Fee' | 'Misc' | 'All'; } - /** @name PalletBalancesReserveData (178) */ + /** @name PalletBalancesReserveData (175) */ interface PalletBalancesReserveData extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name PalletBalancesReleases (180) */ + /** @name PalletBalancesReleases (177) */ interface PalletBalancesReleases extends Enum { readonly isV100: boolean; readonly isV200: boolean; readonly type: 'V100' | 'V200'; } - /** @name PalletBalancesCall (181) */ + /** @name PalletBalancesCall (178) */ interface PalletBalancesCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1760,7 +1726,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; } - /** @name PalletBalancesError (184) */ + /** @name PalletBalancesError (181) */ interface PalletBalancesError extends Enum { readonly isVestingBalance: boolean; readonly isLiquidityRestrictions: boolean; @@ -1773,7 +1739,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves'; } - /** @name PalletTimestampCall (186) */ + /** @name PalletTimestampCall (183) */ interface PalletTimestampCall extends Enum { readonly isSet: boolean; readonly asSet: { @@ -1782,14 +1748,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Set'; } - /** @name PalletTransactionPaymentReleases (188) */ + /** @name PalletTransactionPaymentReleases (185) */ interface PalletTransactionPaymentReleases extends Enum { readonly isV1Ancient: boolean; readonly isV2: boolean; readonly type: 'V1Ancient' | 'V2'; } - /** @name PalletTreasuryProposal (189) */ + /** @name PalletTreasuryProposal (186) */ interface PalletTreasuryProposal extends Struct { readonly proposer: AccountId32; readonly value: u128; @@ -1797,7 +1763,7 @@ declare module '@polkadot/types/lookup' { readonly bond: u128; } - /** @name PalletTreasuryCall (192) */ + /** @name PalletTreasuryCall (189) */ interface PalletTreasuryCall extends Enum { readonly isProposeSpend: boolean; readonly asProposeSpend: { @@ -1824,10 +1790,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval'; } - /** @name FrameSupportPalletId (195) */ + /** @name FrameSupportPalletId (192) */ interface FrameSupportPalletId extends U8aFixed {} - /** @name PalletTreasuryError (196) */ + /** @name PalletTreasuryError (193) */ interface PalletTreasuryError extends Enum { readonly isInsufficientProposersBalance: boolean; readonly isInvalidIndex: boolean; @@ -1837,7 +1803,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved'; } - /** @name PalletSudoCall (197) */ + /** @name PalletSudoCall (194) */ interface PalletSudoCall extends Enum { readonly isSudo: boolean; readonly asSudo: { @@ -1860,7 +1826,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs'; } - /** @name OrmlVestingModuleCall (199) */ + /** @name OrmlVestingModuleCall (196) */ interface OrmlVestingModuleCall extends Enum { readonly isClaim: boolean; readonly isVestedTransfer: boolean; @@ -1880,7 +1846,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor'; } - /** @name OrmlXtokensModuleCall (201) */ + /** @name OrmlXtokensModuleCall (198) */ interface OrmlXtokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1927,7 +1893,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'TransferMultiasset' | 'TransferWithFee' | 'TransferMultiassetWithFee' | 'TransferMulticurrencies' | 'TransferMultiassets'; } - /** @name XcmVersionedMultiAsset (202) */ + /** @name XcmVersionedMultiAsset (199) */ interface XcmVersionedMultiAsset extends Enum { readonly isV0: boolean; readonly asV0: XcmV0MultiAsset; @@ -1936,7 +1902,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1'; } - /** @name OrmlTokensModuleCall (205) */ + /** @name OrmlTokensModuleCall (202) */ interface OrmlTokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1973,7 +1939,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'TransferAll' | 'TransferKeepAlive' | 'ForceTransfer' | 'SetBalance'; } - /** @name CumulusPalletXcmpQueueCall (206) */ + /** @name CumulusPalletXcmpQueueCall (203) */ interface CumulusPalletXcmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { @@ -2009,7 +1975,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight'; } - /** @name PalletXcmCall (207) */ + /** @name PalletXcmCall (204) */ interface PalletXcmCall extends Enum { readonly isSend: boolean; readonly asSend: { @@ -2071,7 +2037,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets'; } - /** @name XcmVersionedXcm (208) */ + /** @name XcmVersionedXcm (205) */ interface XcmVersionedXcm extends Enum { readonly isV0: boolean; readonly asV0: XcmV0Xcm; @@ -2082,7 +2048,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1' | 'V2'; } - /** @name XcmV0Xcm (209) */ + /** @name XcmV0Xcm (206) */ interface XcmV0Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -2145,7 +2111,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom'; } - /** @name XcmV0Order (211) */ + /** @name XcmV0Order (208) */ interface XcmV0Order extends Enum { readonly isNull: boolean; readonly isDepositAsset: boolean; @@ -2193,14 +2159,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV0Response (213) */ + /** @name XcmV0Response (210) */ interface XcmV0Response extends Enum { readonly isAssets: boolean; readonly asAssets: Vec; readonly type: 'Assets'; } - /** @name XcmV1Xcm (214) */ + /** @name XcmV1Xcm (211) */ interface XcmV1Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -2269,7 +2235,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion'; } - /** @name XcmV1Order (216) */ + /** @name XcmV1Order (213) */ interface XcmV1Order extends Enum { readonly isNoop: boolean; readonly isDepositAsset: boolean; @@ -2319,7 +2285,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV1Response (218) */ + /** @name XcmV1Response (215) */ interface XcmV1Response extends Enum { readonly isAssets: boolean; readonly asAssets: XcmV1MultiassetMultiAssets; @@ -2328,10 +2294,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'Assets' | 'Version'; } - /** @name CumulusPalletXcmCall (232) */ + /** @name CumulusPalletXcmCall (229) */ type CumulusPalletXcmCall = Null; - /** @name CumulusPalletDmpQueueCall (233) */ + /** @name CumulusPalletDmpQueueCall (230) */ interface CumulusPalletDmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { @@ -2341,7 +2307,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight'; } - /** @name PalletInflationCall (234) */ + /** @name PalletInflationCall (231) */ interface PalletInflationCall extends Enum { readonly isStartInflation: boolean; readonly asStartInflation: { @@ -2350,7 +2316,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'StartInflation'; } - /** @name PalletUniqueCall (235) */ + /** @name PalletUniqueCall (232) */ interface PalletUniqueCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -2508,7 +2474,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; } - /** @name UpDataStructsCollectionMode (240) */ + /** @name UpDataStructsCollectionMode (237) */ interface UpDataStructsCollectionMode extends Enum { readonly isNft: boolean; readonly isFungible: boolean; @@ -2517,7 +2483,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateCollectionData (241) */ + /** @name UpDataStructsCreateCollectionData (238) */ interface UpDataStructsCreateCollectionData extends Struct { readonly mode: UpDataStructsCollectionMode; readonly access: Option; @@ -2531,14 +2497,14 @@ declare module '@polkadot/types/lookup' { readonly properties: Vec; } - /** @name UpDataStructsAccessMode (243) */ + /** @name UpDataStructsAccessMode (240) */ interface UpDataStructsAccessMode extends Enum { readonly isNormal: boolean; readonly isAllowList: boolean; readonly type: 'Normal' | 'AllowList'; } - /** @name UpDataStructsCollectionLimits (245) */ + /** @name UpDataStructsCollectionLimits (242) */ interface UpDataStructsCollectionLimits extends Struct { readonly accountTokenOwnershipLimit: Option; readonly sponsoredDataSize: Option; @@ -2551,7 +2517,7 @@ declare module '@polkadot/types/lookup' { readonly transfersEnabled: Option; } - /** @name UpDataStructsSponsoringRateLimit (247) */ + /** @name UpDataStructsSponsoringRateLimit (244) */ interface UpDataStructsSponsoringRateLimit extends Enum { readonly isSponsoringDisabled: boolean; readonly isBlocks: boolean; @@ -2559,43 +2525,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'SponsoringDisabled' | 'Blocks'; } - /** @name UpDataStructsCollectionPermissions (250) */ + /** @name UpDataStructsCollectionPermissions (247) */ interface UpDataStructsCollectionPermissions extends Struct { readonly access: Option; readonly mintMode: Option; readonly nesting: Option; } - /** @name UpDataStructsNestingPermissions (252) */ + /** @name UpDataStructsNestingPermissions (249) */ interface UpDataStructsNestingPermissions extends Struct { readonly tokenOwner: bool; readonly collectionAdmin: bool; readonly restricted: Option; } - /** @name UpDataStructsOwnerRestrictedSet (254) */ + /** @name UpDataStructsOwnerRestrictedSet (251) */ interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} - /** @name UpDataStructsPropertyKeyPermission (259) */ + /** @name UpDataStructsPropertyKeyPermission (256) */ interface UpDataStructsPropertyKeyPermission extends Struct { readonly key: Bytes; readonly permission: UpDataStructsPropertyPermission; } - /** @name UpDataStructsPropertyPermission (260) */ + /** @name UpDataStructsPropertyPermission (257) */ interface UpDataStructsPropertyPermission extends Struct { readonly mutable: bool; readonly collectionAdmin: bool; readonly tokenOwner: bool; } - /** @name UpDataStructsProperty (263) */ + /** @name UpDataStructsProperty (260) */ interface UpDataStructsProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name UpDataStructsCreateItemData (266) */ + /** @name UpDataStructsCreateItemData (263) */ interface UpDataStructsCreateItemData extends Enum { readonly isNft: boolean; readonly asNft: UpDataStructsCreateNftData; @@ -2606,23 +2572,23 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateNftData (267) */ + /** @name UpDataStructsCreateNftData (264) */ interface UpDataStructsCreateNftData extends Struct { readonly properties: Vec; } - /** @name UpDataStructsCreateFungibleData (268) */ + /** @name UpDataStructsCreateFungibleData (265) */ interface UpDataStructsCreateFungibleData extends Struct { readonly value: u128; } - /** @name UpDataStructsCreateReFungibleData (269) */ + /** @name UpDataStructsCreateReFungibleData (266) */ interface UpDataStructsCreateReFungibleData extends Struct { readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateItemExData (272) */ + /** @name UpDataStructsCreateItemExData (269) */ interface UpDataStructsCreateItemExData extends Enum { readonly isNft: boolean; readonly asNft: Vec; @@ -2635,60 +2601,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; } - /** @name UpDataStructsCreateNftExData (274) */ + /** @name UpDataStructsCreateNftExData (271) */ interface UpDataStructsCreateNftExData extends Struct { readonly properties: Vec; readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsCreateRefungibleExSingleOwner (281) */ + /** @name UpDataStructsCreateRefungibleExSingleOwner (278) */ interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { readonly user: PalletEvmAccountBasicCrossAccountIdRepr; readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateRefungibleExMultipleOwners (283) */ + /** @name UpDataStructsCreateRefungibleExMultipleOwners (280) */ interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { readonly users: BTreeMap; readonly properties: Vec; } - /** @name PalletUniqueSchedulerCall (284) */ - interface PalletUniqueSchedulerCall extends Enum { - readonly isScheduleNamed: boolean; - readonly asScheduleNamed: { - readonly id: U8aFixed; - readonly when: u32; - readonly maybePeriodic: Option>; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; - } & Struct; - readonly isCancelNamed: boolean; - readonly asCancelNamed: { - readonly id: U8aFixed; - } & Struct; - readonly isScheduleNamedAfter: boolean; - readonly asScheduleNamedAfter: { - readonly id: U8aFixed; - readonly after: u32; - readonly maybePeriodic: Option>; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; - } & Struct; - readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter'; - } - - /** @name FrameSupportScheduleMaybeHashed (286) */ - interface FrameSupportScheduleMaybeHashed extends Enum { - readonly isValue: boolean; - readonly asValue: Call; - readonly isHash: boolean; - readonly asHash: H256; - readonly type: 'Value' | 'Hash'; - } - - /** @name PalletConfigurationCall (287) */ + /** @name PalletConfigurationCall (281) */ interface PalletConfigurationCall extends Enum { readonly isSetWeightToFeeCoefficientOverride: boolean; readonly asSetWeightToFeeCoefficientOverride: { @@ -2701,13 +2633,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride'; } - /** @name PalletTemplateTransactionPaymentCall (289) */ + /** @name PalletTemplateTransactionPaymentCall (283) */ type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletStructureCall (290) */ + /** @name PalletStructureCall (284) */ type PalletStructureCall = Null; - /** @name PalletRmrkCoreCall (291) */ + /** @name PalletRmrkCoreCall (285) */ interface PalletRmrkCoreCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -2813,7 +2745,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; } - /** @name RmrkTraitsResourceResourceTypes (297) */ + /** @name RmrkTraitsResourceResourceTypes (291) */ interface RmrkTraitsResourceResourceTypes extends Enum { readonly isBasic: boolean; readonly asBasic: RmrkTraitsResourceBasicResource; @@ -2824,7 +2756,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Basic' | 'Composable' | 'Slot'; } - /** @name RmrkTraitsResourceBasicResource (299) */ + /** @name RmrkTraitsResourceBasicResource (293) */ interface RmrkTraitsResourceBasicResource extends Struct { readonly src: Option; readonly metadata: Option; @@ -2832,7 +2764,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceComposableResource (301) */ + /** @name RmrkTraitsResourceComposableResource (295) */ interface RmrkTraitsResourceComposableResource extends Struct { readonly parts: Vec; readonly base: u32; @@ -2842,7 +2774,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceSlotResource (302) */ + /** @name RmrkTraitsResourceSlotResource (296) */ interface RmrkTraitsResourceSlotResource extends Struct { readonly base: u32; readonly src: Option; @@ -2852,7 +2784,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name PalletRmrkEquipCall (305) */ + /** @name PalletRmrkEquipCall (299) */ interface PalletRmrkEquipCall extends Enum { readonly isCreateBase: boolean; readonly asCreateBase: { @@ -2874,7 +2806,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; } - /** @name RmrkTraitsPartPartType (308) */ + /** @name RmrkTraitsPartPartType (302) */ interface RmrkTraitsPartPartType extends Enum { readonly isFixedPart: boolean; readonly asFixedPart: RmrkTraitsPartFixedPart; @@ -2883,14 +2815,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'FixedPart' | 'SlotPart'; } - /** @name RmrkTraitsPartFixedPart (310) */ + /** @name RmrkTraitsPartFixedPart (304) */ interface RmrkTraitsPartFixedPart extends Struct { readonly id: u32; readonly z: u32; readonly src: Bytes; } - /** @name RmrkTraitsPartSlotPart (311) */ + /** @name RmrkTraitsPartSlotPart (305) */ interface RmrkTraitsPartSlotPart extends Struct { readonly id: u32; readonly equippable: RmrkTraitsPartEquippableList; @@ -2898,7 +2830,7 @@ declare module '@polkadot/types/lookup' { readonly z: u32; } - /** @name RmrkTraitsPartEquippableList (312) */ + /** @name RmrkTraitsPartEquippableList (306) */ interface RmrkTraitsPartEquippableList extends Enum { readonly isAll: boolean; readonly isEmpty: boolean; @@ -2907,20 +2839,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'All' | 'Empty' | 'Custom'; } - /** @name RmrkTraitsTheme (314) */ + /** @name RmrkTraitsTheme (308) */ interface RmrkTraitsTheme extends Struct { readonly name: Bytes; readonly properties: Vec; readonly inherit: bool; } - /** @name RmrkTraitsThemeThemeProperty (316) */ + /** @name RmrkTraitsThemeThemeProperty (310) */ interface RmrkTraitsThemeThemeProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name PalletAppPromotionCall (318) */ + /** @name PalletAppPromotionCall (312) */ interface PalletAppPromotionCall extends Enum { readonly isSetAdminAddress: boolean; readonly asSetAdminAddress: { @@ -2954,7 +2886,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers'; } - /** @name PalletForeignAssetsModuleCall (320) */ + /** @name PalletForeignAssetsModuleCall (314) */ interface PalletForeignAssetsModuleCall extends Enum { readonly isRegisterForeignAsset: boolean; readonly asRegisterForeignAsset: { @@ -2971,7 +2903,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset'; } - /** @name PalletEvmCall (321) */ + /** @name PalletEvmCall (315) */ interface PalletEvmCall extends Enum { readonly isWithdraw: boolean; readonly asWithdraw: { @@ -3016,7 +2948,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name PalletEthereumCall (325) */ + /** @name PalletEthereumCall (319) */ interface PalletEthereumCall extends Enum { readonly isTransact: boolean; readonly asTransact: { @@ -3025,7 +2957,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transact'; } - /** @name EthereumTransactionTransactionV2 (326) */ + /** @name EthereumTransactionTransactionV2 (320) */ interface EthereumTransactionTransactionV2 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumTransactionLegacyTransaction; @@ -3036,7 +2968,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumTransactionLegacyTransaction (327) */ + /** @name EthereumTransactionLegacyTransaction (321) */ interface EthereumTransactionLegacyTransaction extends Struct { readonly nonce: U256; readonly gasPrice: U256; @@ -3047,7 +2979,7 @@ declare module '@polkadot/types/lookup' { readonly signature: EthereumTransactionTransactionSignature; } - /** @name EthereumTransactionTransactionAction (328) */ + /** @name EthereumTransactionTransactionAction (322) */ interface EthereumTransactionTransactionAction extends Enum { readonly isCall: boolean; readonly asCall: H160; @@ -3055,14 +2987,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Call' | 'Create'; } - /** @name EthereumTransactionTransactionSignature (329) */ + /** @name EthereumTransactionTransactionSignature (323) */ interface EthereumTransactionTransactionSignature extends Struct { readonly v: u64; readonly r: H256; readonly s: H256; } - /** @name EthereumTransactionEip2930Transaction (331) */ + /** @name EthereumTransactionEip2930Transaction (325) */ interface EthereumTransactionEip2930Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -3077,13 +3009,13 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name EthereumTransactionAccessListItem (333) */ + /** @name EthereumTransactionAccessListItem (327) */ interface EthereumTransactionAccessListItem extends Struct { readonly address: H160; readonly storageKeys: Vec; } - /** @name EthereumTransactionEip1559Transaction (334) */ + /** @name EthereumTransactionEip1559Transaction (328) */ interface EthereumTransactionEip1559Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -3099,7 +3031,7 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name PalletEvmMigrationCall (335) */ + /** @name PalletEvmMigrationCall (329) */ interface PalletEvmMigrationCall extends Enum { readonly isBegin: boolean; readonly asBegin: { @@ -3118,13 +3050,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'Begin' | 'SetData' | 'Finish'; } - /** @name PalletSudoError (338) */ + /** @name PalletSudoError (332) */ interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: 'RequireSudo'; } - /** @name OrmlVestingModuleError (340) */ + /** @name OrmlVestingModuleError (334) */ interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; @@ -3135,7 +3067,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name OrmlXtokensModuleError (341) */ + /** @name OrmlXtokensModuleError (335) */ interface OrmlXtokensModuleError extends Enum { readonly isAssetHasNoReserve: boolean; readonly isNotCrossChainTransfer: boolean; @@ -3159,26 +3091,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined'; } - /** @name OrmlTokensBalanceLock (344) */ + /** @name OrmlTokensBalanceLock (338) */ interface OrmlTokensBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name OrmlTokensAccountData (346) */ + /** @name OrmlTokensAccountData (340) */ interface OrmlTokensAccountData extends Struct { readonly free: u128; readonly reserved: u128; readonly frozen: u128; } - /** @name OrmlTokensReserveData (348) */ + /** @name OrmlTokensReserveData (342) */ interface OrmlTokensReserveData extends Struct { readonly id: Null; readonly amount: u128; } - /** @name OrmlTokensModuleError (350) */ + /** @name OrmlTokensModuleError (344) */ interface OrmlTokensModuleError extends Enum { readonly isBalanceTooLow: boolean; readonly isAmountIntoBalanceFailed: boolean; @@ -3191,21 +3123,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (352) */ + /** @name CumulusPalletXcmpQueueInboundChannelDetails (346) */ interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (353) */ + /** @name CumulusPalletXcmpQueueInboundState (347) */ interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (356) */ + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (350) */ interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; @@ -3213,7 +3145,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (359) */ + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (353) */ interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; @@ -3222,14 +3154,14 @@ declare module '@polkadot/types/lookup' { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (360) */ + /** @name CumulusPalletXcmpQueueOutboundState (354) */ interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (362) */ + /** @name CumulusPalletXcmpQueueQueueConfigData (356) */ interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; @@ -3239,7 +3171,7 @@ declare module '@polkadot/types/lookup' { readonly xcmpMaxIndividualWeight: Weight; } - /** @name CumulusPalletXcmpQueueError (364) */ + /** @name CumulusPalletXcmpQueueError (358) */ interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; @@ -3249,7 +3181,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (365) */ + /** @name PalletXcmError (359) */ interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; @@ -3267,29 +3199,29 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (366) */ + /** @name CumulusPalletXcmError (360) */ type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (367) */ + /** @name CumulusPalletDmpQueueConfigData (361) */ interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: Weight; } - /** @name CumulusPalletDmpQueuePageIndexData (368) */ + /** @name CumulusPalletDmpQueuePageIndexData (362) */ interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (371) */ + /** @name CumulusPalletDmpQueueError (365) */ interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (375) */ + /** @name PalletUniqueError (369) */ interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; @@ -3298,75 +3230,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name PalletUniqueSchedulerScheduledV3 (378) */ - interface PalletUniqueSchedulerScheduledV3 extends Struct { - readonly maybeId: Option; - readonly priority: u8; - readonly call: FrameSupportScheduleMaybeHashed; - readonly maybePeriodic: Option>; - readonly origin: OpalRuntimeOriginCaller; - } - - /** @name OpalRuntimeOriginCaller (379) */ - interface OpalRuntimeOriginCaller extends Enum { - readonly isSystem: boolean; - readonly asSystem: FrameSupportDispatchRawOrigin; - readonly isVoid: boolean; - readonly isPolkadotXcm: boolean; - readonly asPolkadotXcm: PalletXcmOrigin; - readonly isCumulusXcm: boolean; - readonly asCumulusXcm: CumulusPalletXcmOrigin; - readonly isEthereum: boolean; - readonly asEthereum: PalletEthereumRawOrigin; - readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; - } - - /** @name FrameSupportDispatchRawOrigin (380) */ - interface FrameSupportDispatchRawOrigin extends Enum { - readonly isRoot: boolean; - readonly isSigned: boolean; - readonly asSigned: AccountId32; - readonly isNone: boolean; - readonly type: 'Root' | 'Signed' | 'None'; - } - - /** @name PalletXcmOrigin (381) */ - interface PalletXcmOrigin extends Enum { - readonly isXcm: boolean; - readonly asXcm: XcmV1MultiLocation; - readonly isResponse: boolean; - readonly asResponse: XcmV1MultiLocation; - readonly type: 'Xcm' | 'Response'; - } - - /** @name CumulusPalletXcmOrigin (382) */ - interface CumulusPalletXcmOrigin extends Enum { - readonly isRelay: boolean; - readonly isSiblingParachain: boolean; - readonly asSiblingParachain: u32; - readonly type: 'Relay' | 'SiblingParachain'; - } - - /** @name PalletEthereumRawOrigin (383) */ - interface PalletEthereumRawOrigin extends Enum { - readonly isEthereumTransaction: boolean; - readonly asEthereumTransaction: H160; - readonly type: 'EthereumTransaction'; - } - - /** @name SpCoreVoid (384) */ - type SpCoreVoid = Null; - - /** @name PalletUniqueSchedulerError (385) */ - interface PalletUniqueSchedulerError extends Enum { - readonly isFailedToSchedule: boolean; - readonly isNotFound: boolean; - readonly isTargetBlockNumberInPast: boolean; - readonly isRescheduleNoChange: boolean; - readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; - } - - /** @name UpDataStructsCollection (386) */ + /** @name UpDataStructsCollection (370) */ interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3379,7 +3243,7 @@ declare module '@polkadot/types/lookup' { readonly flags: U8aFixed; } - /** @name UpDataStructsSponsorshipStateAccountId32 (387) */ + /** @name UpDataStructsSponsorshipStateAccountId32 (371) */ interface UpDataStructsSponsorshipStateAccountId32 extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3389,43 +3253,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (389) */ + /** @name UpDataStructsProperties (373) */ interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (390) */ + /** @name UpDataStructsPropertiesMapBoundedVec (374) */ interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (395) */ + /** @name UpDataStructsPropertiesMapPropertyPermission (379) */ interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (402) */ + /** @name UpDataStructsCollectionStats (386) */ interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (403) */ + /** @name UpDataStructsTokenChild (387) */ interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (404) */ + /** @name PhantomTypeUpDataStructs (388) */ interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (406) */ + /** @name UpDataStructsTokenData (390) */ interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (408) */ + /** @name UpDataStructsRpcCollection (392) */ interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3441,13 +3305,13 @@ declare module '@polkadot/types/lookup' { readonly flags: UpDataStructsRpcCollectionFlags; } - /** @name UpDataStructsRpcCollectionFlags (409) */ + /** @name UpDataStructsRpcCollectionFlags (393) */ interface UpDataStructsRpcCollectionFlags extends Struct { readonly foreign: bool; readonly erc721metadata: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (410) */ + /** @name RmrkTraitsCollectionCollectionInfo (394) */ interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; @@ -3456,7 +3320,7 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (411) */ + /** @name RmrkTraitsNftNftInfo (395) */ interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; @@ -3465,13 +3329,13 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (413) */ + /** @name RmrkTraitsNftRoyaltyInfo (397) */ interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (414) */ + /** @name RmrkTraitsResourceResourceInfo (398) */ interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; @@ -3479,26 +3343,26 @@ declare module '@polkadot/types/lookup' { readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (415) */ + /** @name RmrkTraitsPropertyPropertyInfo (399) */ interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (416) */ + /** @name RmrkTraitsBaseBaseInfo (400) */ interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (417) */ + /** @name RmrkTraitsNftNftChild (401) */ interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (419) */ + /** @name PalletCommonError (403) */ interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; @@ -3537,7 +3401,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (421) */ + /** @name PalletFungibleError (405) */ interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; @@ -3547,12 +3411,12 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (422) */ + /** @name PalletRefungibleItemData (406) */ interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } - /** @name PalletRefungibleError (427) */ + /** @name PalletRefungibleError (411) */ interface PalletRefungibleError extends Enum { readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isWrongRefungiblePieces: boolean; @@ -3562,19 +3426,19 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletNonfungibleItemData (428) */ + /** @name PalletNonfungibleItemData (412) */ interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (430) */ + /** @name UpDataStructsPropertyScope (414) */ interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; readonly type: 'None' | 'Rmrk'; } - /** @name PalletNonfungibleError (432) */ + /** @name PalletNonfungibleError (416) */ interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; @@ -3582,7 +3446,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (433) */ + /** @name PalletStructureError (417) */ interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; @@ -3591,7 +3455,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletRmrkCoreError (434) */ + /** @name PalletRmrkCoreError (418) */ interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; @@ -3615,7 +3479,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } - /** @name PalletRmrkEquipError (436) */ + /** @name PalletRmrkEquipError (420) */ interface PalletRmrkEquipError extends Enum { readonly isPermissionError: boolean; readonly isNoAvailableBaseId: boolean; @@ -3627,7 +3491,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; } - /** @name PalletAppPromotionError (442) */ + /** @name PalletAppPromotionError (426) */ interface PalletAppPromotionError extends Enum { readonly isAdminNotSet: boolean; readonly isNoPermission: boolean; @@ -3638,7 +3502,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'IncorrectLockedBalanceOperation'; } - /** @name PalletForeignAssetsModuleError (443) */ + /** @name PalletForeignAssetsModuleError (427) */ interface PalletForeignAssetsModuleError extends Enum { readonly isBadLocation: boolean; readonly isMultiLocationExisted: boolean; @@ -3647,7 +3511,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted'; } - /** @name PalletEvmError (446) */ + /** @name PalletEvmError (430) */ interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; @@ -3658,7 +3522,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (449) */ + /** @name FpRpcTransactionStatus (433) */ interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; @@ -3669,10 +3533,10 @@ declare module '@polkadot/types/lookup' { readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (451) */ + /** @name EthbloomBloom (435) */ interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (453) */ + /** @name EthereumReceiptReceiptV3 (437) */ interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; @@ -3683,7 +3547,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (454) */ + /** @name EthereumReceiptEip658ReceiptData (438) */ interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; @@ -3691,14 +3555,14 @@ declare module '@polkadot/types/lookup' { readonly logs: Vec; } - /** @name EthereumBlock (455) */ + /** @name EthereumBlock (439) */ interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (456) */ + /** @name EthereumHeader (440) */ interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; @@ -3717,24 +3581,24 @@ declare module '@polkadot/types/lookup' { readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (457) */ + /** @name EthereumTypesHashH64 (441) */ interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (462) */ + /** @name PalletEthereumError (446) */ interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (463) */ + /** @name PalletEvmCoderSubstrateError (447) */ interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (464) */ + /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (448) */ interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3744,7 +3608,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name PalletEvmContractHelpersSponsoringModeT (465) */ + /** @name PalletEvmContractHelpersSponsoringModeT (449) */ interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; @@ -3752,7 +3616,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (471) */ + /** @name PalletEvmContractHelpersError (455) */ interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly isNoPendingSponsor: boolean; @@ -3760,14 +3624,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'NoPermission' | 'NoPendingSponsor' | 'TooManyMethodsHaveSponsoredLimit'; } - /** @name PalletEvmMigrationError (472) */ + /** @name PalletEvmMigrationError (456) */ interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (474) */ + /** @name SpRuntimeMultiSignature (458) */ interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; @@ -3778,37 +3642,37 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (475) */ + /** @name SpCoreEd25519Signature (459) */ interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (477) */ + /** @name SpCoreSr25519Signature (461) */ interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (478) */ + /** @name SpCoreEcdsaSignature (462) */ interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (481) */ + /** @name FrameSystemExtensionsCheckSpecVersion (465) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckTxVersion (482) */ + /** @name FrameSystemExtensionsCheckTxVersion (466) */ type FrameSystemExtensionsCheckTxVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (483) */ + /** @name FrameSystemExtensionsCheckGenesis (467) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (486) */ + /** @name FrameSystemExtensionsCheckNonce (470) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (487) */ + /** @name FrameSystemExtensionsCheckWeight (471) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (488) */ + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (472) */ interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (489) */ + /** @name OpalRuntimeRuntime (473) */ type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (490) */ + /** @name PalletEthereumFakeTransactionFinalizer (474) */ type PalletEthereumFakeTransactionFinalizer = Null; } // declare module diff --git a/tests/update_types.sh b/tests/update_types.sh index e007e7b6fb..4afdc7afcd 100755 --- a/tests/update_types.sh +++ b/tests/update_types.sh @@ -12,8 +12,3 @@ rsync -ar --exclude .gitignore src/interfaces/ unique-types-js for file in unique-types-js/augment-* unique-types-js/**/types.ts unique-types-js/registry.ts; do sed -i '1s;^;//@ts-nocheck\n;' $file done - -pushd unique-types-js -git add . -git commit -m "chore: regenerate types" -popd From e24479d326782f6fef392381b8ceaca8c064a678 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Oct 2022 19:50:22 +0000 Subject: [PATCH 1228/1274] ci: fix builder image reference Signed-off-by: Yaroslav Bolyukin --- .env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index cdb56a584e..b0ff06dcb0 100644 --- a/.env +++ b/.env @@ -1,14 +1,14 @@ RUST_TOOLCHAIN=nightly-2022-07-24 POLKADOT_BUILD_BRANCH=release-v0.9.30 -POLKADOT_MAINNET_BRANCH=release-v0.9.28 +POLKADOT_MAINNET_BRANCH=release-v0.9.29 STATEMINT_BUILD_BRANCH=release-parachains-v9271 ACALA_BUILD_BRANCH=2.9.6 MOONBEAM_BUILD_BRANCH=v0.26.1 UNIQUE_MAINNET_TAG=v924010-old-tests-fixes UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443 -KUSAMA_MAINNET_BRANCH=release-v0.9.29 +KUSAMA_MAINNET_BRANCH=release-v0.9.30 STATEMINE_BUILD_BRANCH=parachains-v9271 KARURA_BUILD_BRANCH=release-karura-2.9.5 MOONRIVER_BUILD_BRANCH=v0.26.1 From 91cf06e25a1b0284d33fca9a89599bf71f45619a Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Oct 2022 20:07:59 +0000 Subject: [PATCH 1229/1274] ci: install protoc Substrate now requires it Signed-off-by: Yaroslav Bolyukin --- .docker/Dockerfile-acala.j2 | 2 +- .docker/Dockerfile-chain-dev | 4 ++-- .docker/Dockerfile-chain-dev-unit | 4 ++-- .docker/Dockerfile-cumulus.j2 | 2 +- .docker/Dockerfile-moonbeam.j2 | 4 ++-- .docker/Dockerfile-parachain | 2 +- .docker/Dockerfile-parachain-node-only | 2 +- .docker/Dockerfile-parachain-upgrade | 2 +- .docker/Dockerfile-parachain-upgrade-data | 2 +- .docker/Dockerfile-testnet.j2 | 4 +--- .docker/Dockerfile-try-runtime | 4 ++-- .docker/Dockerfile-xcm.j2 | 3 +-- .docker/additional/xcm-rococo/Dockerfile-xcm-opal-rococo | 4 +--- .../additional/xcm-rococo/Dockerfile-xcm-quartz-rococo | 4 +--- .../additional/xcm-rococo/Dockerfile-xcm-unique-rococo | 4 +--- .github/workflows/codestyle_v2.yml | 8 ++++---- README.md | 2 +- 17 files changed, 24 insertions(+), 33 deletions(-) diff --git a/.docker/Dockerfile-acala.j2 b/.docker/Dockerfile-acala.j2 index b4f5a36772..dd980e8f2a 100644 --- a/.docker/Dockerfile-acala.j2 +++ b/.docker/Dockerfile-acala.j2 @@ -8,7 +8,7 @@ ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ apt-get clean && \ rm -r /var/lib/apt/lists/* diff --git a/.docker/Dockerfile-chain-dev b/.docker/Dockerfile-chain-dev index cf6018446a..b475af82a2 100644 --- a/.docker/Dockerfile-chain-dev +++ b/.docker/Dockerfile-chain-dev @@ -11,7 +11,7 @@ ENV PATH="/cargo-home/bin:$PATH" RUN echo "$FEATURE\n" && echo "$RUST_TOOLCHAIN\n" -RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake +RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake protobuf-compiler RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none @@ -20,7 +20,7 @@ RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup default $RUST_TOOLCHAIN && \ rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN -RUN mkdir /dev_chain +RUN mkdir /dev_chain COPY . /dev_chain WORKDIR /dev_chain diff --git a/.docker/Dockerfile-chain-dev-unit b/.docker/Dockerfile-chain-dev-unit index 7cacee5c5c..033e5407e0 100644 --- a/.docker/Dockerfile-chain-dev-unit +++ b/.docker/Dockerfile-chain-dev-unit @@ -3,7 +3,7 @@ FROM ubuntu:20.04 ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Etc/UTC -RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake +RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake protobuf-compiler ENV CARGO_HOME="/cargo-home" ENV PATH="/cargo-home/bin:$PATH" @@ -18,7 +18,7 @@ RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup default $RUST_TOOLCHAIN && \ rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN -RUN mkdir /dev_chain +RUN mkdir /dev_chain COPY . /dev_chain WORKDIR /dev_chain diff --git a/.docker/Dockerfile-cumulus.j2 b/.docker/Dockerfile-cumulus.j2 index 522e6ab8b8..8caa44d0bf 100644 --- a/.docker/Dockerfile-cumulus.j2 +++ b/.docker/Dockerfile-cumulus.j2 @@ -8,7 +8,7 @@ ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ apt-get clean && \ rm -r /var/lib/apt/lists/* diff --git a/.docker/Dockerfile-moonbeam.j2 b/.docker/Dockerfile-moonbeam.j2 index c5ef2a6865..ee422d1ab7 100644 --- a/.docker/Dockerfile-moonbeam.j2 +++ b/.docker/Dockerfile-moonbeam.j2 @@ -8,7 +8,7 @@ ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ apt-get clean && \ rm -r /var/lib/apt/lists/* @@ -38,4 +38,4 @@ RUN git clone -b {{ MOONBEAM_BUILD_BRANCH }} --depth 1 https://github.com/PureSt FROM ubuntu:20.04 as builder-moonbeam -COPY --from=builder-moonbeam-bin /unique_parachain/moonbeam/target/release/moonbeam /unique_parachain/moonbeam/target/release/moonbeam \ No newline at end of file +COPY --from=builder-moonbeam-bin /unique_parachain/moonbeam/target/release/moonbeam /unique_parachain/moonbeam/target/release/moonbeam diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index a8b1cf7009..d90769e7e5 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -11,7 +11,7 @@ ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang protobuf-compiler && \ apt-get clean && \ rm -r /var/lib/apt/lists/* diff --git a/.docker/Dockerfile-parachain-node-only b/.docker/Dockerfile-parachain-node-only index 37c3ed642d..2fbb44a858 100644 --- a/.docker/Dockerfile-parachain-node-only +++ b/.docker/Dockerfile-parachain-node-only @@ -11,7 +11,7 @@ ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang protobuf-compiler && \ apt-get clean && \ rm -r /var/lib/apt/lists/* diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index ef86bd66c0..1bc4abeb9f 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -11,7 +11,7 @@ ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang protobuf-compiler && \ apt-get clean && \ rm -r /var/lib/apt/lists/* diff --git a/.docker/Dockerfile-parachain-upgrade-data b/.docker/Dockerfile-parachain-upgrade-data index dd73f5a618..da88b19a58 100644 --- a/.docker/Dockerfile-parachain-upgrade-data +++ b/.docker/Dockerfile-parachain-upgrade-data @@ -11,7 +11,7 @@ ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang protobuf-compiler && \ apt-get clean && \ rm -r /var/lib/apt/lists/* diff --git a/.docker/Dockerfile-testnet.j2 b/.docker/Dockerfile-testnet.j2 index 594e882b9a..fdc52ff8d8 100644 --- a/.docker/Dockerfile-testnet.j2 +++ b/.docker/Dockerfile-testnet.j2 @@ -8,7 +8,7 @@ ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ apt-get clean && \ rm -r /var/lib/apt/lists/* @@ -71,5 +71,3 @@ CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ yarn start launch-config.json - - \ No newline at end of file diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index ed1d5fc696..2b717ca526 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -12,7 +12,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang protobuf-compiler && \ apt-get clean && \ rm -r /var/lib/apt/lists/* @@ -45,5 +45,5 @@ WORKDIR /unique_parachain RUN echo "Requested features: $FEATURE\n" && \ echo "Fork from: $REPLICA_FROM\n" && \ cargo build --features=$FEATURE --release - + CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime --no-spec-name-check on-runtime-upgrade live --uri $REPLICA_FROM diff --git a/.docker/Dockerfile-xcm.j2 b/.docker/Dockerfile-xcm.j2 index 5631546a48..b4f01c323e 100644 --- a/.docker/Dockerfile-xcm.j2 +++ b/.docker/Dockerfile-xcm.j2 @@ -8,7 +8,7 @@ ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ apt-get clean && \ rm -r /var/lib/apt/lists/* @@ -82,4 +82,3 @@ CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ yarn start launch-config-xcm-{{ NETWORK }}.json - diff --git a/.docker/additional/xcm-rococo/Dockerfile-xcm-opal-rococo b/.docker/additional/xcm-rococo/Dockerfile-xcm-opal-rococo index 3efcf46cc5..e7f4f14f1f 100644 --- a/.docker/additional/xcm-rococo/Dockerfile-xcm-opal-rococo +++ b/.docker/additional/xcm-rococo/Dockerfile-xcm-opal-rococo @@ -13,7 +13,7 @@ ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ apt-get clean && \ rm -r /var/lib/apt/lists/* @@ -85,5 +85,3 @@ CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ yarn start ${LAUNCH_CONFIG_FILE} - - diff --git a/.docker/additional/xcm-rococo/Dockerfile-xcm-quartz-rococo b/.docker/additional/xcm-rococo/Dockerfile-xcm-quartz-rococo index e94b5f9221..335fb8162c 100644 --- a/.docker/additional/xcm-rococo/Dockerfile-xcm-quartz-rococo +++ b/.docker/additional/xcm-rococo/Dockerfile-xcm-quartz-rococo @@ -13,7 +13,7 @@ ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ apt-get clean && \ rm -r /var/lib/apt/lists/* @@ -89,5 +89,3 @@ CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ yarn start ${LAUNCH_CONFIG_FILE} - - diff --git a/.docker/additional/xcm-rococo/Dockerfile-xcm-unique-rococo b/.docker/additional/xcm-rococo/Dockerfile-xcm-unique-rococo index 5675be4b30..92ed31d6a0 100644 --- a/.docker/additional/xcm-rococo/Dockerfile-xcm-unique-rococo +++ b/.docker/additional/xcm-rococo/Dockerfile-xcm-unique-rococo @@ -13,7 +13,7 @@ ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ apt-get clean && \ rm -r /var/lib/apt/lists/* @@ -89,5 +89,3 @@ CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ yarn start ${LAUNCH_CONFIG_FILE} - - diff --git a/.github/workflows/codestyle_v2.yml b/.github/workflows/codestyle_v2.yml index 3ecce37b21..f9df6fb407 100644 --- a/.github/workflows/codestyle_v2.yml +++ b/.github/workflows/codestyle_v2.yml @@ -15,7 +15,7 @@ jobs: toolchain: nightly default: true target: wasm32-unknown-unknown - components: rustfmt, clippy + components: rustfmt, clippy - name: Run cargo fmt run: cargo fmt -- --check # In that mode it returns only exit code. - name: Cargo fmt state @@ -26,12 +26,12 @@ jobs: clippy: if: ${{ false }} runs-on: self-hosted-ci - + steps: - + - uses: actions/checkout@v3 - name: Install substrate dependencies - run: sudo apt-get install libssl-dev pkg-config libclang-dev clang + run: sudo apt-get install libssl-dev pkg-config libclang-dev clang protobuf-compiler - name: Install latest nightly uses: actions-rs/toolchain@v1 with: diff --git a/README.md b/README.md index c5c96c544f..69c3ea1917 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ so that we can keep the builds stable. 1. Install Rust: ```bash -sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang make cmake +sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang make cmake protobuf-compiler curl https://sh.rustup.rs -sSf | sh ``` From a9a8d71503b7dc92bd2b77a01f4c934c3f66a8c6 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Oct 2022 20:48:06 +0000 Subject: [PATCH 1230/1274] build: enable cargo workspace-inheritance Signed-off-by: Yaroslav Bolyukin --- Cargo.toml | 2 ++ pallets/foreign-assets/Cargo.toml | 10 +++++++--- runtime/opal/Cargo.toml | 2 ++ runtime/quartz/Cargo.toml | 2 ++ runtime/unique/Cargo.toml | 2 ++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2137963a08..72e5e76207 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,5 @@ +cargo-features = ["workspace-inheritance"] + [workspace] resolver = "2" members = [ diff --git a/pallets/foreign-assets/Cargo.toml b/pallets/foreign-assets/Cargo.toml index 7537889406..a7362bc5d3 100644 --- a/pallets/foreign-assets/Cargo.toml +++ b/pallets/foreign-assets/Cargo.toml @@ -1,3 +1,5 @@ +cargo-features = ["workspace-inheritance"] + [package] name = "pallet-foreign-assets" version = "0.1.0" @@ -7,10 +9,12 @@ edition = "2021" [dependencies] log = { version = "0.4.16", default-features = false } serde = { version = "1.0.136", optional = true } -scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.0.1", default-features = false, features = [ + "derive", +] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30", default-features = false } up-data-structs = { default-features = false, path = '../../primitives/data-structs' } @@ -46,7 +50,7 @@ std = [ "pallet-common/std", "pallet-balances/std", "pallet-fungible/std", - "orml-tokens/std" + "orml-tokens/std", ] try-runtime = ["frame-support/try-runtime"] runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks'] diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index b2bcbca279..c510b1ea2d 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -1,6 +1,8 @@ ################################################################################ # Package +cargo-features = ["workspace-inheritance"] + [package] authors = ['Unique Network '] build = 'build.rs' diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index ffdbd68eee..a3c5ae9ad6 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -1,6 +1,8 @@ ################################################################################ # Package +cargo-features = ["workspace-inheritance"] + [package] authors = ['Unique Network '] build = 'build.rs' diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 79a98b33da..0ff20cc0c4 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -1,6 +1,8 @@ ################################################################################ # Package +cargo-features = ["workspace-inheritance"] + [package] authors = ['Unique Network '] build = 'build.rs' From 7025e37260da6687618b711bdfd7d61663200ea0 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 20 Oct 2022 21:12:07 +0000 Subject: [PATCH 1231/1274] ci: upgrade chainql Signed-off-by: Yaroslav Bolyukin --- .docker/Dockerfile-parachain-upgrade-data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile-parachain-upgrade-data b/.docker/Dockerfile-parachain-upgrade-data index da88b19a58..27c2c5ae4e 100644 --- a/.docker/Dockerfile-parachain-upgrade-data +++ b/.docker/Dockerfile-parachain-upgrade-data @@ -71,7 +71,7 @@ FROM rust-builder as builder-chainql RUN mkdir chainql WORKDIR /chainql -RUN git clone -b v0.1.0 --depth 1 https://github.com/CertainLach/chainql.git . && \ +RUN git clone -b v0.2.0 --depth 1 https://github.com/CertainLach/chainql.git . && \ cargo build --release # ===== RUN ====== From 23f963dcddfc2fcc9d4c06f3850dc8521f70e054 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Fri, 21 Oct 2022 16:22:39 +0700 Subject: [PATCH 1232/1274] deleted builds for polkadot & chainql instead copy from ready image --- .docker/Dockerfile-parachain | 21 ++++---------- .docker/Dockerfile-parachain-node-only | 22 ++++---------- .docker/Dockerfile-parachain-upgrade | 20 +++---------- .docker/Dockerfile-parachain-upgrade-data | 35 ++++++----------------- .docker/Dockerfile-polkadot.j2 | 2 +- 5 files changed, 25 insertions(+), 75 deletions(-) diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index d90769e7e5..aec05e9c8f 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -42,23 +42,13 @@ WORKDIR /unique_parachain RUN git clone $REPO_URL -b $BRANCH . && \ cargo build --features=$FEATURE --$PROFILE -# ===== BUILD POLKADOT ===== -FROM rust-builder as builder-polkadot - -ARG POLKADOT_BUILD_BRANCH= -ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH - - -WORKDIR /unique_parachain - -RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ - cd polkadot && \ - cargo build --release - # ===== RUN ====== FROM ubuntu:20.04 +ARG POLKADOT_BUILD_BRANCH= +ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH + RUN apt-get -y update && \ apt-get -y install curl git && \ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \ @@ -76,12 +66,13 @@ RUN export NVM_DIR="$HOME/.nvm" && \ yarn install COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ - COPY --from=builder-unique /unique_parachain/launch-config.json /polkadot-launch/launch-config.json +COPY --from=uniquenetwork/builder-polkadot:$POLKADOT_BUILD_BRANCH /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ yarn start launch-config.json + + diff --git a/.docker/Dockerfile-parachain-node-only b/.docker/Dockerfile-parachain-node-only index 2fbb44a858..810ab09271 100644 --- a/.docker/Dockerfile-parachain-node-only +++ b/.docker/Dockerfile-parachain-node-only @@ -52,25 +52,14 @@ WORKDIR /unique_parachain RUN cargo build --features=$FEATURE --$PROFILE -# ===== BUILD POLKADOT ===== -FROM rust-builder as builder-polkadot - -ARG POLKADOT_BUILD_BRANCH= -ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH - - -WORKDIR /unique_parachain - -RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ - cd polkadot && \ - cargo build --release - # ===== RUN ====== FROM ubuntu:20.04 ARG RUNTIME= ENV RUNTIME $RUNTIME +ARG POLKADOT_BUILD_BRANCH= +ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH RUN apt-get -y update && \ apt-get -y install curl git && \ @@ -89,15 +78,16 @@ RUN export NVM_DIR="$HOME/.nvm" && \ yarn install RUN echo "$RUNTIME" +RUN echo "$POLKADOT_BUILD_BRANCH" COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm +COPY --from=uniquenetwork/builder-polkadot:$POLKADOT_BUILD_BRANCH /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ yarn start launch-config.json --test-upgrade-parachains -w -n + + diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index 1bc4abeb9f..5787ba8f0a 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -53,25 +53,14 @@ WORKDIR /unique_parachain RUN cargo build --features=$FEATURE --$PROFILE -# ===== BUILD POLKADOT ===== -FROM rust-builder as builder-polkadot - -ARG POLKADOT_BUILD_BRANCH= -ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH - - -WORKDIR /unique_parachain - -RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ - cd polkadot && \ - cargo build --release - # ===== RUN ====== FROM ubuntu:20.04 ARG RUNTIME= ENV RUNTIME $RUNTIME +ARG POLKADOT_BUILD_BRANCH= +ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH RUN apt-get -y update && \ apt-get -y install curl git && \ @@ -90,13 +79,12 @@ RUN export NVM_DIR="$HOME/.nvm" && \ yarn install RUN echo "$RUNTIME" +RUN echo "$POLKADOT_BUILD_BRANCH" COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm +COPY --from=uniquenetwork/builder-polkadot:$POLKADOT_BUILD_BRANCH /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ diff --git a/.docker/Dockerfile-parachain-upgrade-data b/.docker/Dockerfile-parachain-upgrade-data index 27c2c5ae4e..b830f2daf7 100644 --- a/.docker/Dockerfile-parachain-upgrade-data +++ b/.docker/Dockerfile-parachain-upgrade-data @@ -53,33 +53,16 @@ WORKDIR /unique_parachain RUN cargo build --features=$FEATURE --$PROFILE -# ===== BUILD POLKADOT ===== -FROM rust-builder as builder-polkadot - -ARG POLKADOT_BUILD_BRANCH= -ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH - -WORKDIR /unique_parachain - -RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \ - cd polkadot && \ - cargo build --release - -# ===== BUILD CHAINQL ===== -FROM rust-builder as builder-chainql - -RUN mkdir chainql -WORKDIR /chainql - -RUN git clone -b v0.2.0 --depth 1 https://github.com/CertainLach/chainql.git . && \ - cargo build --release - # ===== RUN ====== FROM ubuntu:20.04 ARG RUNTIME= ENV RUNTIME $RUNTIME +ARG REPLICA_FROM= +ENV REPLICA_FROM=$REPLICA_FROM +ARG POLKADOT_BUILD_BRANCH= +ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH RUN apt-get -y update && \ apt-get -y install curl git && \ @@ -98,18 +81,16 @@ RUN export NVM_DIR="$HOME/.nvm" && \ yarn install RUN echo "$RUNTIME" +RUN echo "$REPLICA_FROM" +RUN echo "$POLKADOT_BUILD_BRANCH" COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ -COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm -COPY --from=builder-chainql /chainql/target/release/chainql /chainql/target/release/ +COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/ -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm +COPY --from=uniquenetwork/builder-polkadot:$POLKADOT_BUILD_BRANCH /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -ARG REPLICA_FROM= -ENV REPLICA_FROM=$REPLICA_FROM CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" REPLICA_FROM && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ diff --git a/.docker/Dockerfile-polkadot.j2 b/.docker/Dockerfile-polkadot.j2 index 8a071ab339..93306dd4d3 100644 --- a/.docker/Dockerfile-polkadot.j2 +++ b/.docker/Dockerfile-polkadot.j2 @@ -8,7 +8,7 @@ ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && \ - apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \ + apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \ apt-get clean && \ rm -r /var/lib/apt/lists/* From 460ecccc290493b372bdbb85deea5d09cea94c1e Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 21 Oct 2022 13:35:19 +0000 Subject: [PATCH 1233/1274] fix: benchmarks --- pallets/fungible/src/benchmarking.rs | 4 +++- pallets/refungible/src/benchmarking.rs | 4 +++- pallets/scheduler/src/benchmarking.rs | 4 ++-- pallets/structure/src/benchmarking.rs | 16 +++++++++++----- runtime/common/runtime_apis.rs | 8 ++++---- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/pallets/fungible/src/benchmarking.rs b/pallets/fungible/src/benchmarking.rs index 8977138a19..430436bb37 100644 --- a/pallets/fungible/src/benchmarking.rs +++ b/pallets/fungible/src/benchmarking.rs @@ -31,7 +31,9 @@ fn create_collection( create_collection_raw( owner, CollectionMode::Fungible(0), - |owner: T::CrossAccountId, data| >::init_collection(owner.clone(), owner, data), + |owner: T::CrossAccountId, data| { + >::init_collection(owner.clone(), owner, data, Default::default()) + }, FungibleHandle::cast, ) } diff --git a/pallets/refungible/src/benchmarking.rs b/pallets/refungible/src/benchmarking.rs index b64c8e761b..15d793fe07 100644 --- a/pallets/refungible/src/benchmarking.rs +++ b/pallets/refungible/src/benchmarking.rs @@ -62,7 +62,9 @@ fn create_collection( create_collection_raw( owner, CollectionMode::ReFungible, - |owner: T::CrossAccountId, data| >::init_collection(owner.clone(), owner, data), + |owner: T::CrossAccountId, data| { + >::init_collection(owner.clone(), owner, data, Default::default()) + }, RefungibleHandle::cast, ) } diff --git a/pallets/scheduler/src/benchmarking.rs b/pallets/scheduler/src/benchmarking.rs index 9906998512..eb60ce2791 100644 --- a/pallets/scheduler/src/benchmarking.rs +++ b/pallets/scheduler/src/benchmarking.rs @@ -93,9 +93,9 @@ fn fill_schedule( Ok(()) } -fn call_and_hash(i: u32) -> (::Call, T::Hash) { +fn call_and_hash(i: u32) -> (::RuntimeCall, T::Hash) { // Essentially a no-op call. - let call: ::Call = frame_system::Call::remark { remark: i.encode() }.into(); + let call: ::RuntimeCall = frame_system::Call::remark { remark: i.encode() }.into(); let hash = T::Hashing::hash_of(&call); (call, hash) } diff --git a/pallets/structure/src/benchmarking.rs b/pallets/structure/src/benchmarking.rs index 667a6e8f7e..022ddd024d 100644 --- a/pallets/structure/src/benchmarking.rs +++ b/pallets/structure/src/benchmarking.rs @@ -19,7 +19,8 @@ use super::*; use frame_benchmarking::{benchmarks, account}; use frame_support::traits::{Currency, Get}; use up_data_structs::{ - CreateCollectionData, CollectionMode, CreateItemData, CreateNftData, budget::Unlimited, + CreateCollectionData, CollectionMode, CreateItemData, CollectionFlags, CreateNftData, + budget::Unlimited, }; use pallet_common::Config as CommonConfig; use pallet_evm::account::CrossAccountId; @@ -32,10 +33,15 @@ benchmarks! { let caller_cross = T::CrossAccountId::from_sub(caller.clone()); ::Currency::deposit_creating(&caller, T::CollectionCreationPrice::get()); - T::CollectionDispatch::create(caller_cross.clone(), caller_cross.clone(), CreateCollectionData { - mode: CollectionMode::NFT, - ..Default::default() - })?; + T::CollectionDispatch::create( + caller_cross.clone(), + caller_cross.clone(), + CreateCollectionData { + mode: CollectionMode::NFT, + ..Default::default() + }, + CollectionFlags::default(), + )?; let dispatch = T::CollectionDispatch::dispatch(CollectionHandle::try_get(CollectionId(1))?); let dispatch = dispatch.as_dyn(); diff --git a/runtime/common/runtime_apis.rs b/runtime/common/runtime_apis.rs index cb7558cd1f..8a33141ba2 100644 --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -683,8 +683,8 @@ macro_rules! impl_common_runtime_apis { #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] list_benchmark!(list, extra, pallet_refungible, Refungible); - #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] - list_benchmark!(list, extra, pallet_unique_scheduler, Scheduler); + // #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] + // list_benchmark!(list, extra, pallet_unique_scheduler, Scheduler); #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] list_benchmark!(list, extra, pallet_proxy_rmrk_core, RmrkCore); @@ -743,8 +743,8 @@ macro_rules! impl_common_runtime_apis { #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] add_benchmark!(params, batches, pallet_refungible, Refungible); - #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] - add_benchmark!(params, batches, pallet_unique_scheduler, Scheduler); + // #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] + // add_benchmark!(params, batches, pallet_unique_scheduler, Scheduler); #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] add_benchmark!(params, batches, pallet_proxy_rmrk_core, RmrkCore); From e059b84eff4bf1a636ec060b4e9e933a61192c46 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 21 Oct 2022 15:01:03 +0000 Subject: [PATCH 1234/1274] fix: frontier Cargo.lock --- Cargo.lock | 70 +++++++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 409d075463..60c51a0ffa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.7", + "getrandom 0.2.8", "once_cell", "version_check", ] @@ -108,9 +108,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.65" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" +checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" [[package]] name = "app-promotion-rpc" @@ -392,7 +392,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" dependencies = [ "futures-core", - "getrandom 0.2.7", + "getrandom 0.2.8", "instant", "pin-project-lite 0.2.9", "rand 0.8.5", @@ -434,9 +434,9 @@ checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64ct" @@ -2442,7 +2442,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#65930cb2982258bee67b73a1f017711f6f4aa0a4" dependencies = [ "async-trait", "fc-db", @@ -2461,7 +2461,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#65930cb2982258bee67b73a1f017711f6f4aa0a4" dependencies = [ "fp-storage", "kvdb-rocksdb", @@ -2477,7 +2477,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#65930cb2982258bee67b73a1f017711f6f4aa0a4" dependencies = [ "fc-db", "fp-consensus", @@ -2494,7 +2494,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#65930cb2982258bee67b73a1f017711f6f4aa0a4" dependencies = [ "ethereum", "ethereum-types", @@ -2536,7 +2536,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#65930cb2982258bee67b73a1f017711f6f4aa0a4" dependencies = [ "ethereum", "ethereum-types", @@ -2676,7 +2676,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#65930cb2982258bee67b73a1f017711f6f4aa0a4" dependencies = [ "ethereum", "parity-scale-codec 3.2.1", @@ -2688,7 +2688,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#65930cb2982258bee67b73a1f017711f6f4aa0a4" dependencies = [ "evm", "frame-support", @@ -2702,7 +2702,7 @@ dependencies = [ [[package]] name = "fp-evm-mapping" version = "0.1.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#65930cb2982258bee67b73a1f017711f6f4aa0a4" dependencies = [ "frame-support", "sp-core", @@ -2711,7 +2711,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#65930cb2982258bee67b73a1f017711f6f4aa0a4" dependencies = [ "ethereum", "ethereum-types", @@ -2728,7 +2728,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#65930cb2982258bee67b73a1f017711f6f4aa0a4" dependencies = [ "ethereum", "frame-support", @@ -2744,7 +2744,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#65930cb2982258bee67b73a1f017711f6f4aa0a4" dependencies = [ "parity-scale-codec 3.2.1", ] @@ -3229,9 +3229,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if 1.0.0", "libc", @@ -4099,7 +4099,7 @@ dependencies = [ "bytes", "futures 0.3.25", "futures-timer", - "getrandom 0.2.7", + "getrandom 0.2.8", "instant", "lazy_static", "libp2p-autonat", @@ -5685,7 +5685,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#65930cb2982258bee67b73a1f017711f6f4aa0a4" dependencies = [ "fp-evm", "frame-support", @@ -5901,7 +5901,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#65930cb2982258bee67b73a1f017711f6f4aa0a4" dependencies = [ "ethereum", "ethereum-types", @@ -5930,7 +5930,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#0ba6acff2003ee4798050120d006242949968dac" +source = "git+https://github.com/uniquenetwork/frontier?branch=unique-polkadot-v0.9.30#65930cb2982258bee67b73a1f017711f6f4aa0a4" dependencies = [ "evm", "fp-evm", @@ -8572,9 +8572,9 @@ dependencies = [ [[package]] name = "prometheus" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c8babc29389186697fe5a2a4859d697825496b83db5d0b65271cdc0488e88c" +checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" dependencies = [ "cfg-if 1.0.0", "fnv", @@ -8928,7 +8928,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.7", + "getrandom 0.2.8", ] [[package]] @@ -9013,7 +9013,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.7", + "getrandom 0.2.8", "redox_syscall", "thiserror", ] @@ -9153,9 +9153,9 @@ dependencies = [ [[package]] name = "rlp" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "999508abb0ae792aabed2460c45b89106d97fe4adac593bdaef433c2605847b5" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ "bytes", "rustc-hex", @@ -10721,18 +10721,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.145" +version = "1.0.146" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" +checksum = "6df50b7a60a0ad48e1b42eb38373eac8ff785d619fb14db917b4e63d5439361f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.145" +version = "1.0.146" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" +checksum = "a714fd32ba1d66047ce7d53dabd809e9922d538f9047de13cc4cffca47b36205" dependencies = [ "proc-macro2", "quote", @@ -12002,9 +12002,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.102" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" dependencies = [ "proc-macro2", "quote", From 1856e28a79995c03b6734f7d7ef32dafda39f090 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Sun, 23 Oct 2022 18:04:07 +0000 Subject: [PATCH 1235/1274] fix: try-runtime workflow --- .docker/Dockerfile-try-runtime | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index 2b717ca526..888ed2c0db 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -46,4 +46,4 @@ RUN echo "Requested features: $FEATURE\n" && \ echo "Fork from: $REPLICA_FROM\n" && \ cargo build --features=$FEATURE --release -CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime --no-spec-name-check on-runtime-upgrade live --uri $REPLICA_FROM +CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime --no-spec-check-panic on-runtime-upgrade live --uri $REPLICA_FROM From 4778ac77048c901256adda3bb6f08b83dc76d592 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 24 Oct 2022 12:42:22 +0700 Subject: [PATCH 1236/1274] fix ci --- .docker/Dockerfile-parachain | 4 ++-- .docker/Dockerfile-parachain-node-only | 5 ++++- .docker/Dockerfile-parachain-upgrade | 4 +++- .docker/Dockerfile-parachain-upgrade-data | 6 ++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index aec05e9c8f..27864b38a3 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -57,7 +57,7 @@ RUN apt-get -y update && \ nvm install v16.16.0 && \ nvm use v16.16.0 -RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/runtime-upgrade-testing +RUN git clone https://github.com/uniquenetwork/polkadot-launch -b unique-network RUN export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ @@ -68,7 +68,7 @@ RUN export NVM_DIR="$HOME/.nvm" && \ COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ COPY --from=builder-unique /unique_parachain/launch-config.json /polkadot-launch/launch-config.json -COPY --from=uniquenetwork/builder-polkadot:$POLKADOT_BUILD_BRANCH /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ diff --git a/.docker/Dockerfile-parachain-node-only b/.docker/Dockerfile-parachain-node-only index 810ab09271..babea68ee6 100644 --- a/.docker/Dockerfile-parachain-node-only +++ b/.docker/Dockerfile-parachain-node-only @@ -82,8 +82,11 @@ RUN echo "$POLKADOT_BUILD_BRANCH" COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm + +COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm -COPY --from=uniquenetwork/builder-polkadot:$POLKADOT_BUILD_BRANCH /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index f30b7d1cf1..452195fd05 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -83,8 +83,10 @@ RUN echo "$POLKADOT_BUILD_BRANCH" COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm -COPY --from=uniquenetwork/builder-polkadot:$POLKADOT_BUILD_BRANCH /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ diff --git a/.docker/Dockerfile-parachain-upgrade-data b/.docker/Dockerfile-parachain-upgrade-data index b830f2daf7..76c7c0bca9 100644 --- a/.docker/Dockerfile-parachain-upgrade-data +++ b/.docker/Dockerfile-parachain-upgrade-data @@ -72,7 +72,7 @@ RUN apt-get -y update && \ nvm install v16.16.0 && \ nvm use v16.16.0 -RUN git clone https://github.com/uniquenetwork/polkadot-launch.git -b feature/parachain-forking +RUN git clone https://github.com/uniquenetwork/polkadot-launch.git -b unique-network RUN export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ @@ -86,10 +86,12 @@ RUN echo "$POLKADOT_BUILD_BRANCH" COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/ COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ +COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/ -COPY --from=uniquenetwork/builder-polkadot:$POLKADOT_BUILD_BRANCH /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" REPLICA_FROM && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ From d88860d86765eba02da91cb2dbd7a73ced6fc841 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Mon, 24 Oct 2022 08:29:27 +0000 Subject: [PATCH 1237/1274] tests(eth-rft): fix double contract event checking --- tests/src/eth/reFungible.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index ed6067bf6f..0e6ad142e3 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -201,6 +201,7 @@ describe('Refungible: Plain calls', () => { tokenEvents.push(event); }); const result = await contract.methods.transferFrom(caller, receiver, tokenId).send(); + if (tokenEvents.length == 0) await helper.wait.newBlocks(1); let event = result.events.Transfer; expect(event.address).to.equal(collectionAddress); From 5487ee73ea6afbda94f5ec5a6a093e90aa1e247c Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 24 Oct 2022 17:45:45 +0700 Subject: [PATCH 1238/1274] fix copy from build tag for polkadot --- .docker/Dockerfile-parachain | 7 ++++--- .docker/Dockerfile-parachain-node-only | 8 +++++--- .docker/Dockerfile-parachain-upgrade | 7 +++++-- .docker/Dockerfile-parachain-upgrade-data | 7 +++++-- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.docker/Dockerfile-parachain b/.docker/Dockerfile-parachain index 27864b38a3..9175e71466 100644 --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -1,3 +1,6 @@ +ARG POLKADOT_BUILD_BRANCH +FROM uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} as polkadot + # ===== Rust builder ===== FROM ubuntu:20.04 as rust-builder LABEL maintainer="Unique.Network" @@ -36,7 +39,6 @@ ARG FEATURE= ARG REPO_URL= ARG BRANCH= - WORKDIR /unique_parachain RUN git clone $REPO_URL -b $BRANCH . && \ @@ -68,11 +70,10 @@ RUN export NVM_DIR="$HOME/.nvm" && \ COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/ COPY --from=builder-unique /unique_parachain/launch-config.json /polkadot-launch/launch-config.json -COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ cd /polkadot-launch && \ yarn start launch-config.json - diff --git a/.docker/Dockerfile-parachain-node-only b/.docker/Dockerfile-parachain-node-only index babea68ee6..a5610a669f 100644 --- a/.docker/Dockerfile-parachain-node-only +++ b/.docker/Dockerfile-parachain-node-only @@ -1,3 +1,6 @@ +ARG POLKADOT_BUILD_BRANCH +FROM uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} as polkadot + # ===== Rust builder ===== FROM ubuntu:20.04 as rust-builder LABEL maintainer="Unique.Network" @@ -84,9 +87,8 @@ COPY --from=builder-unique-current /unique_parachain/target/release/unique-colla COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm -COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm - +COPY --from=polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ diff --git a/.docker/Dockerfile-parachain-upgrade b/.docker/Dockerfile-parachain-upgrade index 452195fd05..96b46360d6 100644 --- a/.docker/Dockerfile-parachain-upgrade +++ b/.docker/Dockerfile-parachain-upgrade @@ -1,3 +1,6 @@ +ARG POLKADOT_BUILD_BRANCH +FROM uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} as polkadot + # ===== Rust builder ===== FROM ubuntu:20.04 as rust-builder LABEL maintainer="Unique.Network" @@ -85,8 +88,8 @@ COPY --from=builder-unique-current /unique_parachain/target/release/unique-colla COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/ COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/"$RUNTIME"-runtime/"$RUNTIME"_runtime.compact.compressed.wasm -COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm +COPY --from=polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm CMD export NVM_DIR="$HOME/.nvm" && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ diff --git a/.docker/Dockerfile-parachain-upgrade-data b/.docker/Dockerfile-parachain-upgrade-data index 76c7c0bca9..85e0851218 100644 --- a/.docker/Dockerfile-parachain-upgrade-data +++ b/.docker/Dockerfile-parachain-upgrade-data @@ -1,3 +1,6 @@ +ARG POLKADOT_BUILD_BRANCH +FROM uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} as polkadot + # ===== Rust builder ===== FROM ubuntu:20.04 as rust-builder LABEL maintainer="Unique.Network" @@ -90,8 +93,8 @@ COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/"$RUNT COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/ -COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ -COPY --from=uniquenetwork/builder-polkadot:${POLKADOT_BUILD_BRANCH} /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm +COPY --from=polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/ +COPY --from=polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" REPLICA_FROM && \ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ From bb1e6df8df0367e5feadb6675cc980bb71d9abbb Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 24 Oct 2022 17:35:06 +0200 Subject: [PATCH 1239/1274] chore: upgrade spec_version Signed-off-by: Yaroslav Bolyukin --- runtime/opal/src/lib.rs | 2 +- runtime/quartz/src/lib.rs | 2 +- runtime/unique/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index c48cb034b9..8aa91629c8 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -50,7 +50,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 929031, + spec_version: 930031, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index 3fa1da4544..c4fbc9dbb1 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -50,7 +50,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 929031, + spec_version: 930031, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index 6cb7a6ce1c..986809c385 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -50,7 +50,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 929031, + spec_version: 930031, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, From b0bbfdbb357a88d0f55ddad5a1d35e6fc0557eab Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 26 Oct 2022 14:59:06 +0200 Subject: [PATCH 1240/1274] fix: runtime api versioning for CollectionRpc Signed-off-by: Yaroslav Bolyukin (cherry picked from commit 6fd4079cd35596b2848133ed5d430fe081426418) --- client/rpc/src/lib.rs | 5 ++++- primitives/data-structs/src/lib.rs | 2 ++ primitives/rpc/src/lib.rs | 12 +++++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index d6e3663201..d777f0af05 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -557,7 +557,10 @@ where pass_method!(allowlist(collection: CollectionId) -> Vec, unique_api); pass_method!(allowed(collection: CollectionId, user: CrossAccountId) -> bool, unique_api); pass_method!(last_token_id(collection: CollectionId) -> TokenId, unique_api); - pass_method!(collection_by_id(collection: CollectionId) -> Option>, unique_api); + pass_method!( + collection_by_id(collection: CollectionId) -> Option>, unique_api; + changed_in 3, collection_by_id_before_version_3(collection) => |value| value.map(|coll| coll.into()) + ); pass_method!(collection_stats() -> CollectionStats, unique_api); pass_method!(next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Option, unique_api); pass_method!(effective_collection_limits(collection_id: CollectionId) -> Option, unique_api); diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index b99a6e9cde..8ab1293c28 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -447,6 +447,7 @@ pub struct RpcCollectionFlags { } /// Collection parameters, used in RPC calls (see [`Collection`] for the storage version). +#[struct_versioning::versioned(version = 2, upper)] #[derive(Encode, Decode, Clone, PartialEq, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct RpcCollection { @@ -484,6 +485,7 @@ pub struct RpcCollection { pub read_only: bool, /// Extra collection flags + #[version(2.., upper(RpcCollectionFlags {foreign: false, erc721metadata: false}))] pub flags: RpcCollectionFlags, } diff --git a/primitives/rpc/src/lib.rs b/primitives/rpc/src/lib.rs index a173d52b7c..bb0244e16a 100644 --- a/primitives/rpc/src/lib.rs +++ b/primitives/rpc/src/lib.rs @@ -16,9 +16,11 @@ #![cfg_attr(not(feature = "std"), no_std)] +extern crate alloc; + use up_data_structs::{ CollectionId, TokenId, RpcCollection, CollectionStats, CollectionLimits, Property, - PropertyKeyPermission, TokenData, TokenChild, + PropertyKeyPermission, TokenData, TokenChild, RpcCollectionVersion1, }; use sp_std::vec::Vec; @@ -28,15 +30,12 @@ use sp_runtime::DispatchError; type Result = core::result::Result; sp_api::decl_runtime_apis! { - #[api_version(2)] + #[api_version(3)] /// Trait for generate rpc. pub trait UniqueApi where AccountId: Decode, CrossAccountId: pallet_evm::account::CrossAccountId, { - #[changed_in(2)] - fn token_owner(collection: CollectionId, token: TokenId) -> Result; - /// Get number of tokens in collection owned by account. fn account_tokens(collection: CollectionId, account: CrossAccountId) -> Result>; @@ -110,6 +109,9 @@ sp_api::decl_runtime_apis! { /// Get collection by id. fn collection_by_id(collection: CollectionId) -> Result>>; + #[changed_in(3)] + fn collection_by_id(collection: CollectionId) -> Result>>; + /// Get collection stats. fn collection_stats() -> Result; From ba9d059f2b05c22bbf4d8e4833fa0ce9f4e0cff3 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 26 Oct 2022 16:43:44 +0200 Subject: [PATCH 1241/1274] build: bump spec_version to v930032 Signed-off-by: Yaroslav Bolyukin (cherry picked from commit 1c7179877b5fb1eacf86c5ecf607317d11999675) --- runtime/opal/src/lib.rs | 2 +- runtime/quartz/src/lib.rs | 2 +- runtime/unique/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/opal/src/lib.rs b/runtime/opal/src/lib.rs index 8aa91629c8..65edd5b179 100644 --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -50,7 +50,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 930031, + spec_version: 930032, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/runtime/quartz/src/lib.rs b/runtime/quartz/src/lib.rs index c4fbc9dbb1..5c4be978fe 100644 --- a/runtime/quartz/src/lib.rs +++ b/runtime/quartz/src/lib.rs @@ -50,7 +50,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 930031, + spec_version: 930032, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/runtime/unique/src/lib.rs b/runtime/unique/src/lib.rs index 986809c385..161af85d65 100644 --- a/runtime/unique/src/lib.rs +++ b/runtime/unique/src/lib.rs @@ -50,7 +50,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!(RUNTIME_NAME), impl_name: create_runtime_str!(RUNTIME_NAME), authoring_version: 1, - spec_version: 930031, + spec_version: 930032, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, From c5c711e0c837f59937cc6cb4603c1b4aed113972 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 28 Oct 2022 12:29:04 +0200 Subject: [PATCH 1242/1274] fix: runtime api versioning for TokenData Signed-off-by: Yaroslav Bolyukin (cherry picked from commit ba2c7d200136d2c732c710e19b452c073672ff91) --- client/rpc/src/lib.rs | 15 +++++++++------ primitives/data-structs/src/lib.rs | 2 ++ primitives/rpc/src/lib.rs | 9 ++++++++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/client/rpc/src/lib.rs b/client/rpc/src/lib.rs index d777f0af05..21cfe32a87 100644 --- a/client/rpc/src/lib.rs +++ b/client/rpc/src/lib.rs @@ -545,13 +545,16 @@ where keys: Option> ) -> Vec, unique_api); - pass_method!(token_data( - collection: CollectionId, - token_id: TokenId, + pass_method!( + token_data( + collection: CollectionId, + token_id: TokenId, - #[map(|keys| string_keys_to_bytes_keys(keys))] - keys: Option>, - ) -> TokenData, unique_api); + #[map(|keys| string_keys_to_bytes_keys(keys))] + keys: Option>, + ) -> TokenData, unique_api; + changed_in 3, token_data_before_version_3(collection, token_id, string_keys_to_bytes_keys(keys)) => |value| value.into() + ); pass_method!(adminlist(collection: CollectionId) -> Vec, unique_api); pass_method!(allowlist(collection: CollectionId) -> Vec, unique_api); diff --git a/primitives/data-structs/src/lib.rs b/primitives/data-structs/src/lib.rs index 8ab1293c28..6ea7ce09c7 100644 --- a/primitives/data-structs/src/lib.rs +++ b/primitives/data-structs/src/lib.rs @@ -221,6 +221,7 @@ impl TryFrom for TokenId { } /// Token data. +#[struct_versioning::versioned(version = 2, upper)] #[derive(Encode, Decode, Clone, PartialEq, TypeInfo)] #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] pub struct TokenData { @@ -231,6 +232,7 @@ pub struct TokenData { pub owner: Option, /// Token pieces. + #[version(2.., upper(0))] pub pieces: u128, } diff --git a/primitives/rpc/src/lib.rs b/primitives/rpc/src/lib.rs index bb0244e16a..21bf5fefcc 100644 --- a/primitives/rpc/src/lib.rs +++ b/primitives/rpc/src/lib.rs @@ -20,7 +20,7 @@ extern crate alloc; use up_data_structs::{ CollectionId, TokenId, RpcCollection, CollectionStats, CollectionLimits, Property, - PropertyKeyPermission, TokenData, TokenChild, RpcCollectionVersion1, + PropertyKeyPermission, TokenData, TokenChild, RpcCollectionVersion1, TokenDataVersion1, }; use sp_std::vec::Vec; @@ -77,6 +77,13 @@ sp_api::decl_runtime_apis! { keys: Option>> ) -> Result>; + #[changed_in(3)] + fn token_data( + collection: CollectionId, + token_id: TokenId, + keys: Option>> + ) -> Result>; + /// Total number of tokens in collection. fn total_supply(collection: CollectionId) -> Result; From 6ba6dce73b493756f3af2361af8a3691f5c7669c Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Thu, 27 Oct 2022 13:12:15 +0000 Subject: [PATCH 1243/1274] chore: add log of recent changes to migrations --- migrations.md | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 migrations.md diff --git a/migrations.md b/migrations.md new file mode 100644 index 0000000000..d3b9573904 --- /dev/null +++ b/migrations.md @@ -0,0 +1,80 @@ +# **930031 < 929030** + +No migration changes. + +# **930030 < 929031** + +No migration changes. + +# **929031 < 929030** + +No migration changes. + +# **929030 < 927030** + +### **pallet-common** + +* Replaced returned weight `0` with `Weight::zero()` + +### **pallet-nonfungible** + +* Replaced returned weight `0` with `Weight::zero()` + +### **pallet-refungible** + +* Replaced returned weight `0` with `Weight::zero()` + +### **pallet-unique** + +* Replaced returned weight `0` with `Weight::zero()` + +# **927030 < 927020** + +No migration changes. + +# **927020 < 924020** + +No migration changes. + +# **924020 < 924012** + +### **pallet-refungible**: + +* Removed the previous migration: + * bump of the storage version to 1 +* Added: + * cleaning all storage of now-redundant **TokenData** if the storage version is below 2 + * bump of the storage version to 2 + +# **924012 < 924011** + +### **pallet-unique:** + +* Removed the previous migration: + * forceful cleaning all storage of **VariableMetaDataBasket**, cache for sponosoring setting deprecated variable metadata + +# **924011 < 924010** + +### **pallet-common:** + +* Removed the previous migration: + * all collections from **Collection** version 1 to version 2, if the storage version is below 1: + * displacing _offchain_schema, variable_on_chain_schema, const_on_chain_schema, schema_version_ into _properties_ + * displacing _acccess, mint_mode_ into _permissions.access, permissions.mint_mode_ + * adding _external_collection_ flag +* Added forceful bump of the storage version to 1 + +### **pallet-nonfungible:** + +* Removed the previous migration: + * all items from nonfungible **ItemData** version 1 to version 2, if the storage version is below 1: + * displacing _const_data, variable_data_ into _properties_ + * adding permission for the collection admin to set the immutable __old_constData_ property +* Added forceful bump of the storage version to 1 + +### **pallet-refungible:** + +* Removed the previous migration: + * all items from refungible **ItemData** version 1 to version 2, if the storage version is below 1: + * removing _variable_data_ +* Added forceful bump of the storage version to 1 \ No newline at end of file From fe9e681a6a7d091cc5547ca2f5e3702dc404c639 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Thu, 27 Oct 2022 13:19:46 +0000 Subject: [PATCH 1244/1274] chore: fix versions in migrations.md --- migrations.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migrations.md b/migrations.md index d3b9573904..39e137951f 100644 --- a/migrations.md +++ b/migrations.md @@ -1,8 +1,8 @@ -# **930031 < 929030** +# **930032 < 930031** No migration changes. -# **930030 < 929031** +# **930031 < 929031** No migration changes. From 30efbfde1e3ad413b468fccc7d1a12f7735a6f98 Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Thu, 27 Oct 2022 13:33:52 +0000 Subject: [PATCH 1245/1274] chore (migrations doc): clarity and readability --- migrations.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/migrations.md b/migrations.md index 39e137951f..01791d40e7 100644 --- a/migrations.md +++ b/migrations.md @@ -43,38 +43,38 @@ No migration changes. * Removed the previous migration: * bump of the storage version to 1 * Added: - * cleaning all storage of now-redundant **TokenData** if the storage version is below 2 + * if the storage version is below 2, cleaning of all storage of now-redundant **TokenData** * bump of the storage version to 2 # **924012 < 924011** ### **pallet-unique:** -* Removed the previous migration: - * forceful cleaning all storage of **VariableMetaDataBasket**, cache for sponosoring setting deprecated variable metadata +* Removed the previous migration of: + * unconditional cleaning of all storage of **VariableMetaDataBasket** (cache for sponosoring setting deprecated variable metadata) # **924011 < 924010** ### **pallet-common:** -* Removed the previous migration: - * all collections from **Collection** version 1 to version 2, if the storage version is below 1: +* Removed the previous migration of: + * if the storage version is below 1, all collections from storage **CollectionById** of struct **Collection** version 1 to version 2, consisting of: * displacing _offchain_schema, variable_on_chain_schema, const_on_chain_schema, schema_version_ into _properties_ * displacing _acccess, mint_mode_ into _permissions.access, permissions.mint_mode_ * adding _external_collection_ flag -* Added forceful bump of the storage version to 1 +* Added unconditional bump of the storage version to 1 ### **pallet-nonfungible:** -* Removed the previous migration: - * all items from nonfungible **ItemData** version 1 to version 2, if the storage version is below 1: +* Removed the previous migration of: + * if the storage version is below 1, all items from storage **TokenData** of struct **ItemData** version 1 to version 2, consisting of: * displacing _const_data, variable_data_ into _properties_ * adding permission for the collection admin to set the immutable __old_constData_ property -* Added forceful bump of the storage version to 1 +* Added unconditional bump of the storage version to 1 ### **pallet-refungible:** -* Removed the previous migration: - * all items from refungible **ItemData** version 1 to version 2, if the storage version is below 1: +* Removed the previous migration of: + * if the storage version is below 1, all items from storage **TokenData** of struct **ItemData** version 1 to version 2, consisting of: * removing _variable_data_ -* Added forceful bump of the storage version to 1 \ No newline at end of file +* Added unconditional bump of the storage version to 1 \ No newline at end of file From b6b25ca3102a2e3ab52098dadf4f24ee75485dc3 Mon Sep 17 00:00:00 2001 From: Farhad Hakimov Date: Fri, 28 Oct 2022 11:17:25 +0300 Subject: [PATCH 1246/1274] Update migrations.md --- migrations.md | 69 +++++++++------------------------------------------ 1 file changed, 12 insertions(+), 57 deletions(-) diff --git a/migrations.md b/migrations.md index 01791d40e7..70aeeb7fd2 100644 --- a/migrations.md +++ b/migrations.md @@ -1,59 +1,4 @@ -# **930032 < 930031** - -No migration changes. - -# **930031 < 929031** - -No migration changes. - -# **929031 < 929030** - -No migration changes. - -# **929030 < 927030** - -### **pallet-common** - -* Replaced returned weight `0` with `Weight::zero()` - -### **pallet-nonfungible** - -* Replaced returned weight `0` with `Weight::zero()` - -### **pallet-refungible** - -* Replaced returned weight `0` with `Weight::zero()` - -### **pallet-unique** - -* Replaced returned weight `0` with `Weight::zero()` - -# **927030 < 927020** - -No migration changes. - -# **927020 < 924020** - -No migration changes. - -# **924020 < 924012** - -### **pallet-refungible**: - -* Removed the previous migration: - * bump of the storage version to 1 -* Added: - * if the storage version is below 2, cleaning of all storage of now-redundant **TokenData** - * bump of the storage version to 2 - -# **924012 < 924011** - -### **pallet-unique:** - -* Removed the previous migration of: - * unconditional cleaning of all storage of **VariableMetaDataBasket** (cache for sponosoring setting deprecated variable metadata) - -# **924011 < 924010** +# **930032 < 924010** ### **pallet-common:** @@ -63,6 +8,7 @@ No migration changes. * displacing _acccess, mint_mode_ into _permissions.access, permissions.mint_mode_ * adding _external_collection_ flag * Added unconditional bump of the storage version to 1 +* Replaced returned weight `0` with `Weight::zero()` ### **pallet-nonfungible:** @@ -71,10 +17,19 @@ No migration changes. * displacing _const_data, variable_data_ into _properties_ * adding permission for the collection admin to set the immutable __old_constData_ property * Added unconditional bump of the storage version to 1 +* Replaced returned weight `0` with `Weight::zero()` ### **pallet-refungible:** * Removed the previous migration of: * if the storage version is below 1, all items from storage **TokenData** of struct **ItemData** version 1 to version 2, consisting of: * removing _variable_data_ -* Added unconditional bump of the storage version to 1 \ No newline at end of file +* Added: + * if the storage version is below 2, cleaning of all storage of now-redundant **TokenData** + * unconditional bump of the storage version to 2 +* Replaced returned weight `0` with `Weight::zero()` + +### **pallet-unique:** + +* Removed the previous migration of: + * unconditional cleaning of all storage of **VariableMetaDataBasket** (cache for sponosoring setting deprecated variable metadata) From 72ea3e6a05dd1effd9fe2893ecaa14062515e8c1 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Thu, 27 Oct 2022 15:43:50 +0000 Subject: [PATCH 1247/1274] Add eslint-plugin-mocha --- tests/.eslintrc.json | 7 ++++++- tests/package.json | 1 + tests/yarn.lock | 13 +++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/.eslintrc.json b/tests/.eslintrc.json index cd5befb885..eb6fabc601 100644 --- a/tests/.eslintrc.json +++ b/tests/.eslintrc.json @@ -13,7 +13,8 @@ "sourceType": "module" }, "plugins": [ - "@typescript-eslint" + "@typescript-eslint", + "mocha" ], "rules": { "indent": [ @@ -42,6 +43,10 @@ "avoidEscape": true } ], + "require-await": 2, + "mocha/no-async-describe": "error", + "mocha/no-nested-tests": "error", + "mocha/no-synchronous-tests": "error", "semi": [ "error", "always" diff --git a/tests/package.json b/tests/package.json index 271b96e1c8..ef99764115 100644 --- a/tests/package.json +++ b/tests/package.json @@ -14,6 +14,7 @@ "@typescript-eslint/parser": "^5.40.1", "chai": "^4.3.6", "eslint": "^8.25.0", + "eslint-plugin-mocha": "^10.1.0", "mocha": "^10.1.0", "ts-node": "^10.9.1", "typescript": "^4.8.4" diff --git a/tests/yarn.lock b/tests/yarn.lock index a1bafaaf5e..157cfc567e 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -2141,6 +2141,14 @@ escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== +eslint-plugin-mocha@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-10.1.0.tgz#69325414f875be87fb2cb00b2ef33168d4eb7c8d" + integrity sha512-xLqqWUF17llsogVOC+8C6/jvQ+4IoOREbN7ZCHuOHuD6cT5cDD4h7f2LgsZuzMAiwswWE21tO7ExaknHVDrSkw== + dependencies: + eslint-utils "^3.0.0" + rambda "^7.1.0" + eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" @@ -4014,6 +4022,11 @@ quick-lru@^5.1.1: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== +rambda@^7.1.0: + version "7.3.0" + resolved "https://registry.yarnpkg.com/rambda/-/rambda-7.3.0.tgz#90e440ead53030a216093865d8d97997a80868ca" + integrity sha512-RFVofZYaG2TaVcxjnM0ejdVWf/59rFq1f57OGnjP3GT/bthzFw0GVr5rkP9PKbVlEuF/Y7bOVPLfiiYfxq/EWQ== + randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" From a3c1e782c7b787f172438309437116ced149c3bb Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Fri, 28 Oct 2022 14:37:50 +0000 Subject: [PATCH 1248/1274] Fix test --- tests/src/rmrk/addResource.seqtest.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/src/rmrk/addResource.seqtest.ts b/tests/src/rmrk/addResource.seqtest.ts index 0e59c39719..eb661268a8 100644 --- a/tests/src/rmrk/addResource.seqtest.ts +++ b/tests/src/rmrk/addResource.seqtest.ts @@ -431,7 +431,5 @@ describe('integration test: add NFT resource', () => { }); - after(() => { - after(async() => { await api.disconnect(); }); - }); + after(async() => { await api.disconnect(); }); }); From 6cb35123f154c9ab1c14dcddc1e274952e2c4ba0 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Mon, 31 Oct 2022 08:54:33 +0000 Subject: [PATCH 1249/1274] Wait node producing blocks before all tests --- tests/src/util/globalSetup.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/src/util/globalSetup.ts b/tests/src/util/globalSetup.ts index 9a83082baa..123db156b7 100644 --- a/tests/src/util/globalSetup.ts +++ b/tests/src/util/globalSetup.ts @@ -9,13 +9,16 @@ import {promises as fs} from 'fs'; const globalSetup = async (): Promise => { await usingPlaygrounds(async (helper, privateKey) => { try { - // 1. Create donors for test files + // 1. Wait node producing blocks + await helper.wait.newBlocks(1); + + // 2. Create donors for test files await fundFilenamesWithRetries(3) .then((result) => { if (!result) Promise.reject(); }); - // 2. Set up App Promotion admin + // 3. Set up App Promotion admin const missingPallets = helper.fetchMissingPalletNames([Pallets.AppPromotion]); if (missingPallets.length === 0) { const superuser = await privateKey('//Alice'); From 073e2c771abcec037ed213386adcadf4281343e2 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Mon, 31 Oct 2022 17:18:06 +0700 Subject: [PATCH 1250/1274] add waiting for first block before tests in node_only_update workflow --- .github/workflows/node-only-update_v2.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index f81f33b52e..a5d8ddb48f 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -166,6 +166,7 @@ jobs: run: | yarn install yarn add mochawesome + node scripts/readyness.js echo "Ready to start tests" yarn polkadot-types NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-before-${NOW} @@ -297,6 +298,7 @@ jobs: run: | yarn install yarn add mochawesome + node scripts/readyness.js echo "Ready to start tests" yarn polkadot-types NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-after-${NOW} From c126e9a55a538c19ac7c1d7217b35ec33ce2e109 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Mon, 31 Oct 2022 11:18:36 +0000 Subject: [PATCH 1251/1274] Wait new blocks with timeout --- tests/src/util/playgrounds/unique.dev.ts | 40 +++++++++++++++++++----- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 0aceed7f06..e43c82d873 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -344,12 +344,31 @@ class WaitGroup { this.helper = helper; } + sleep(milliseconds: number) { + return new Promise((resolve) => setTimeout(resolve, milliseconds)); + } + + private async waitWithTimeout(promise: Promise, timeout: number) { + let isBlock = false; + promise.then(() => isBlock = true).catch(() => isBlock = true); + let totalTime = 0; + const step = 100; + while(!isBlock) { + console.log('Waiting...'); + await this.sleep(step); + totalTime += step; + if(totalTime >= timeout) throw Error('Blocks production failed'); + } + return promise; + } + /** * Wait for specified number of blocks * @param blocksCount number of blocks to wait * @returns */ - async newBlocks(blocksCount = 1): Promise { + async newBlocks(blocksCount = 1, timeout?: number): Promise { + timeout = timeout ?? blocksCount * 60_000; // eslint-disable-next-line no-async-promise-executor const promise = new Promise(async (resolve) => { const unsubscribe = await this.helper.getApi().rpc.chain.subscribeNewHeads(() => { @@ -361,25 +380,30 @@ class WaitGroup { } }); }); + await this.waitWithTimeout(promise, timeout); return promise; } - async forParachainBlockNumber(blockNumber: bigint) { + async forParachainBlockNumber(blockNumber: bigint, timeout?: number) { + timeout = timeout ?? 300_000; // eslint-disable-next-line no-async-promise-executor - return new Promise(async (resolve) => { - const unsubscribe = await this.helper.getApi().rpc.chain.subscribeNewHeads(async (data: any) => { + const promise = new Promise(async (resolve) => { + const unsubscribe = await this.helper.getApi().rpc.chain.subscribeNewHeads((data: any) => { if (data.number.toNumber() >= blockNumber) { unsubscribe(); resolve(); } }); }); + await this.waitWithTimeout(promise, timeout); + return promise; } - async forRelayBlockNumber(blockNumber: bigint) { + async forRelayBlockNumber(blockNumber: bigint, timeout?: number) { + timeout = timeout ?? 300_000; // eslint-disable-next-line no-async-promise-executor - return new Promise(async (resolve) => { - const unsubscribe = await this.helper.getApi().query.parachainSystem.validationData(async (data: any) => { + const promise = new Promise(async (resolve) => { + const unsubscribe = await this.helper.getApi().query.parachainSystem.validationData((data: any) => { if (data.value.relayParentNumber.toNumber() >= blockNumber) { // @ts-ignore unsubscribe(); @@ -387,6 +411,8 @@ class WaitGroup { } }); }); + await this.waitWithTimeout(promise, timeout); + return promise; } async event(maxBlocksToWait: number, eventSection: string, eventMethod: string) { From ae0b56d622f78f9a46f877efec8021666200c98e Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Mon, 31 Oct 2022 11:26:18 +0000 Subject: [PATCH 1252/1274] Remove console.log --- tests/src/util/playgrounds/unique.dev.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index e43c82d873..4bcb0b044b 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -354,7 +354,6 @@ class WaitGroup { let totalTime = 0; const step = 100; while(!isBlock) { - console.log('Waiting...'); await this.sleep(step); totalTime += step; if(totalTime >= timeout) throw Error('Blocks production failed'); From af79e0c9814a0575b0b67008088dfd64c913dd60 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Mon, 31 Oct 2022 11:55:41 +0000 Subject: [PATCH 1253/1274] Increase initial timeout --- tests/src/util/globalSetup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/util/globalSetup.ts b/tests/src/util/globalSetup.ts index 123db156b7..b15b264b9d 100644 --- a/tests/src/util/globalSetup.ts +++ b/tests/src/util/globalSetup.ts @@ -10,7 +10,7 @@ const globalSetup = async (): Promise => { await usingPlaygrounds(async (helper, privateKey) => { try { // 1. Wait node producing blocks - await helper.wait.newBlocks(1); + await helper.wait.newBlocks(1, 600_000); // 2. Create donors for test files await fundFilenamesWithRetries(3) From 161eb3b8b309515b508d93338d8cc163b1158671 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 3 Nov 2022 00:21:13 +0700 Subject: [PATCH 1254/1274] add extended logs for parachain (cherry picked from commit 5b95a036dde98beceac62bd58d5766a053285bdb) --- .docker/forkless-config/launch-config-forkless-data.j2 | 4 ++-- .docker/forkless-config/launch-config-forkless-nodata.j2 | 4 ++-- .docker/forkless-config/launch-config-node-update-only-v3.j2 | 4 ++-- .docker/xcm-config/launch-config-xcm-opal.json | 1 + .docker/xcm-config/launch-config-xcm-quartz.json | 1 + .docker/xcm-config/launch-config-xcm-unique.json | 1 + 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.docker/forkless-config/launch-config-forkless-data.j2 b/.docker/forkless-config/launch-config-forkless-data.j2 index 7b52cd723b..a1f8f8d728 100644 --- a/.docker/forkless-config/launch-config-forkless-data.j2 +++ b/.docker/forkless-config/launch-config-forkless-data.j2 @@ -108,7 +108,7 @@ "--rpc-cors=all", "--unsafe-rpc-external", "--unsafe-ws-external", - "-lxcm=trace" + "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug" ] }, { @@ -120,7 +120,7 @@ "--rpc-cors=all", "--unsafe-rpc-external", "--unsafe-ws-external", - "-lxcm=trace" + "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug" ] } ] diff --git a/.docker/forkless-config/launch-config-forkless-nodata.j2 b/.docker/forkless-config/launch-config-forkless-nodata.j2 index 71ccf2da38..c68dac082c 100644 --- a/.docker/forkless-config/launch-config-forkless-nodata.j2 +++ b/.docker/forkless-config/launch-config-forkless-nodata.j2 @@ -101,7 +101,7 @@ "--rpc-cors=all", "--unsafe-rpc-external", "--unsafe-ws-external", - "-lxcm=trace", + "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug", "--ws-max-connections=1000" ] }, @@ -114,7 +114,7 @@ "--rpc-cors=all", "--unsafe-rpc-external", "--unsafe-ws-external", - "-lxcm=trace", + "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug", "--ws-max-connections=1000" ] } diff --git a/.docker/forkless-config/launch-config-node-update-only-v3.j2 b/.docker/forkless-config/launch-config-node-update-only-v3.j2 index 3d326dd096..460c9a4053 100644 --- a/.docker/forkless-config/launch-config-node-update-only-v3.j2 +++ b/.docker/forkless-config/launch-config-node-update-only-v3.j2 @@ -101,7 +101,7 @@ "--rpc-cors=all", "--unsafe-rpc-external", "--unsafe-ws-external", - "-lxcm=trace", + "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug", "--ws-max-connections=1000" ] }, @@ -114,7 +114,7 @@ "--rpc-cors=all", "--unsafe-rpc-external", "--unsafe-ws-external", - "-lxcm=trace", + "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug", "--ws-max-connections=1000" ] } diff --git a/.docker/xcm-config/launch-config-xcm-opal.json b/.docker/xcm-config/launch-config-xcm-opal.json index b74af89925..6711dbad57 100644 --- a/.docker/xcm-config/launch-config-xcm-opal.json +++ b/.docker/xcm-config/launch-config-xcm-opal.json @@ -91,6 +91,7 @@ "name": "alice", "flags": [ "--unsafe-rpc-external", + "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug", "--unsafe-ws-external" ] } diff --git a/.docker/xcm-config/launch-config-xcm-quartz.json b/.docker/xcm-config/launch-config-xcm-quartz.json index b26f10c456..14b1280911 100644 --- a/.docker/xcm-config/launch-config-xcm-quartz.json +++ b/.docker/xcm-config/launch-config-xcm-quartz.json @@ -90,6 +90,7 @@ "rpcPort": 9933, "name": "alice", "flags": [ + "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug", "--unsafe-rpc-external", "--unsafe-ws-external" ] diff --git a/.docker/xcm-config/launch-config-xcm-unique.json b/.docker/xcm-config/launch-config-xcm-unique.json index 2118e2ce08..6acb25461d 100644 --- a/.docker/xcm-config/launch-config-xcm-unique.json +++ b/.docker/xcm-config/launch-config-xcm-unique.json @@ -90,6 +90,7 @@ "rpcPort": 9933, "name": "alice", "flags": [ + "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug", "--unsafe-rpc-external", "--unsafe-ws-external" ] From 37d3ed97edeb5904a62017e012974dba632bcc10 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 1 Nov 2022 12:59:23 +0100 Subject: [PATCH 1255/1274] ci: log try-runtime stats Signed-off-by: Yaroslav Bolyukin (cherry picked from commit d0df7cbf5a62dbad0c94ede8344197d57ada13bb) --- .docker/Dockerfile-try-runtime | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile-try-runtime b/.docker/Dockerfile-try-runtime index 888ed2c0db..65442d8dbe 100644 --- a/.docker/Dockerfile-try-runtime +++ b/.docker/Dockerfile-try-runtime @@ -46,4 +46,4 @@ RUN echo "Requested features: $FEATURE\n" && \ echo "Fork from: $REPLICA_FROM\n" && \ cargo build --features=$FEATURE --release -CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime --no-spec-check-panic on-runtime-upgrade live --uri $REPLICA_FROM +CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime -ltry-runtime::cli=debug --no-spec-check-panic on-runtime-upgrade live --uri $REPLICA_FROM From ed2940451b5d0fc77fde2f6554a2a984fd34191c Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Mon, 31 Oct 2022 18:24:52 +0000 Subject: [PATCH 1256/1274] Wait up to 30 minutes for the block by default (cherry picked from commit 26798c366c4f863e68da20bf911147dc5c310c8c) --- tests/src/util/playgrounds/unique.dev.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 4bcb0b044b..0fb41c8f33 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -384,7 +384,7 @@ class WaitGroup { } async forParachainBlockNumber(blockNumber: bigint, timeout?: number) { - timeout = timeout ?? 300_000; + timeout = timeout ?? 30 * 60 * 1000; // eslint-disable-next-line no-async-promise-executor const promise = new Promise(async (resolve) => { const unsubscribe = await this.helper.getApi().rpc.chain.subscribeNewHeads((data: any) => { @@ -399,7 +399,7 @@ class WaitGroup { } async forRelayBlockNumber(blockNumber: bigint, timeout?: number) { - timeout = timeout ?? 300_000; + timeout = timeout ?? 30 * 60 * 1000; // eslint-disable-next-line no-async-promise-executor const promise = new Promise(async (resolve) => { const unsubscribe = await this.helper.getApi().query.parachainSystem.validationData((data: any) => { From d2da62f7829e0561a3a89cccf2295538e7fea450 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 7 Nov 2022 12:18:53 +0000 Subject: [PATCH 1257/1274] feat: pallet maintenance (cherry picked from commit 9a601ff5844d629a609bc7c9f052fd2d76051f37) --- Cargo.lock | 15 +++ pallets/maintenance/Cargo.toml | 35 +++++++ pallets/maintenance/src/benchmarking.rs | 37 ++++++++ pallets/maintenance/src/lib.rs | 80 ++++++++++++++++ pallets/maintenance/src/weights.rs | 67 +++++++++++++ runtime/common/config/pallets/mod.rs | 5 + runtime/common/construct_runtime/mod.rs | 2 + runtime/common/maintenance.rs | 119 ++++++++++++++++++++++++ runtime/common/mod.rs | 2 + runtime/common/scheduler.rs | 8 +- runtime/opal/Cargo.toml | 5 + runtime/quartz/Cargo.toml | 4 + runtime/unique/Cargo.toml | 4 + tests/src/pallet-presence.test.ts | 1 + 14 files changed, 381 insertions(+), 3 deletions(-) create mode 100644 pallets/maintenance/Cargo.toml create mode 100644 pallets/maintenance/src/benchmarking.rs create mode 100644 pallets/maintenance/src/lib.rs create mode 100644 pallets/maintenance/src/weights.rs create mode 100644 runtime/common/maintenance.rs diff --git a/Cargo.lock b/Cargo.lock index 60c51a0ffa..1c82c79cdf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5337,6 +5337,7 @@ dependencies = [ "pallet-foreign-assets", "pallet-fungible", "pallet-inflation", + "pallet-maintenance", "pallet-nonfungible", "pallet-randomness-collective-flip", "pallet-refungible", @@ -6211,6 +6212,18 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-maintenance" +version = "0.1.0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.2.1", + "scale-info", + "sp-std", +] + [[package]] name = "pallet-membership" version = "4.0.0-dev" @@ -8785,6 +8798,7 @@ dependencies = [ "pallet-foreign-assets", "pallet-fungible", "pallet-inflation", + "pallet-maintenance", "pallet-nonfungible", "pallet-randomness-collective-flip", "pallet-refungible", @@ -12858,6 +12872,7 @@ dependencies = [ "pallet-foreign-assets", "pallet-fungible", "pallet-inflation", + "pallet-maintenance", "pallet-nonfungible", "pallet-randomness-collective-flip", "pallet-refungible", diff --git a/pallets/maintenance/Cargo.toml b/pallets/maintenance/Cargo.toml new file mode 100644 index 0000000000..3b19834ca3 --- /dev/null +++ b/pallets/maintenance/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "pallet-maintenance" +version = "0.1.0" +authors = ["Unique Network "] +edition = "2021" +license = "GPLv3" +homepage = "https://unique.network" +repository = "https://github.com/UniqueNetwork/unique-chain" +description = "Unique Maintenance pallet" +readme = "README.md" + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" } + +[features] +default = ["std"] +std = [ + "codec/std", + "scale-info/std", + "frame-support/std", + "frame-system/std", + "frame-benchmarking/std", + "sp-std/std", +] +runtime-benchmarks = [ + "frame-benchmarking", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", +] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/maintenance/src/benchmarking.rs b/pallets/maintenance/src/benchmarking.rs new file mode 100644 index 0000000000..a07b3ea429 --- /dev/null +++ b/pallets/maintenance/src/benchmarking.rs @@ -0,0 +1,37 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use super::*; +use crate::{Pallet as Maintenance, Config}; + +use frame_benchmarking::benchmarks; +use frame_system::RawOrigin; +use frame_support::ensure; + +benchmarks! { + enable { + }: _(RawOrigin::Root) + verify { + ensure!(>::get(), "didn't enable the MM"); + } + + disable { + Maintenance::::enable(RawOrigin::Root.into())?; + }: _(RawOrigin::Root) + verify { + ensure!(!>::get(), "didn't disable the MM"); + } +} diff --git a/pallets/maintenance/src/lib.rs b/pallets/maintenance/src/lib.rs new file mode 100644 index 0000000000..6d08840d64 --- /dev/null +++ b/pallets/maintenance/src/lib.rs @@ -0,0 +1,80 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +#![cfg_attr(not(feature = "std"), no_std)] + +pub use pallet::*; + +#[cfg(feature = "runtime-benchmarks")] +pub mod benchmarking; + +pub mod weights; + +#[frame_support::pallet] +pub mod pallet { + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + use crate::weights::WeightInfo; + + #[pallet::config] + pub trait Config: frame_system::Config { + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type WeightInfo: WeightInfo; + } + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + MaintenanceEnabled, + MaintenanceDisabled, + } + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); + + #[pallet::storage] + #[pallet::getter(fn is_enabled)] + pub type Enabled = StorageValue<_, bool, ValueQuery>; + + #[pallet::error] + pub enum Error {} + + #[pallet::call] + impl Pallet { + #[pallet::weight(::WeightInfo::enable())] + pub fn enable(origin: OriginFor) -> DispatchResult { + ensure_root(origin)?; + + >::set(true); + + Self::deposit_event(Event::MaintenanceEnabled); + + Ok(()) + } + + #[pallet::weight(::WeightInfo::disable())] + pub fn disable(origin: OriginFor) -> DispatchResult { + ensure_root(origin)?; + + >::set(false); + + Self::deposit_event(Event::MaintenanceDisabled); + + Ok(()) + } + } +} diff --git a/pallets/maintenance/src/weights.rs b/pallets/maintenance/src/weights.rs new file mode 100644 index 0000000000..7eca8fe93c --- /dev/null +++ b/pallets/maintenance/src/weights.rs @@ -0,0 +1,67 @@ +// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs + +//! Autogenerated weights for pallet_maintenance +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-11-01, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 + +// Executed Command: +// target/release/unique-collator +// benchmark +// pallet +// --pallet +// pallet-maintenance +// --wasm-execution +// compiled +// --extrinsic +// * +// --template +// .maintain/frame-weight-template.hbs +// --steps=50 +// --repeat=80 +// --heap-pages=4096 +// --output=./pallets/maintenance/src/weights.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for pallet_maintenance. +pub trait WeightInfo { + fn enable() -> Weight; + fn disable() -> Weight; +} + +/// Weights for pallet_maintenance using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + // Storage: Maintenance Enabled (r:0 w:1) + fn enable() -> Weight { + Weight::from_ref_time(7_367_000) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Maintenance Enabled (r:0 w:1) + fn disable() -> Weight { + Weight::from_ref_time(7_273_000) + .saturating_add(T::DbWeight::get().writes(1)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + // Storage: Maintenance Enabled (r:0 w:1) + fn enable() -> Weight { + Weight::from_ref_time(7_367_000) + .saturating_add(RocksDbWeight::get().writes(1)) + } + // Storage: Maintenance Enabled (r:0 w:1) + fn disable() -> Weight { + Weight::from_ref_time(7_273_000) + .saturating_add(RocksDbWeight::get().writes(1)) + } +} diff --git a/runtime/common/config/pallets/mod.rs b/runtime/common/config/pallets/mod.rs index 48e34bcd09..21efae6b35 100644 --- a/runtime/common/config/pallets/mod.rs +++ b/runtime/common/config/pallets/mod.rs @@ -103,3 +103,8 @@ impl pallet_configuration::Config for Runtime { type DefaultWeightToFeeCoefficient = ConstU32<{ up_common::constants::WEIGHT_TO_FEE_COEFF }>; type DefaultMinGasPrice = ConstU64<{ up_common::constants::MIN_GAS_PRICE }>; } + +impl pallet_maintenance::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = pallet_maintenance::weights::SubstrateWeight; +} diff --git a/runtime/common/construct_runtime/mod.rs b/runtime/common/construct_runtime/mod.rs index ea7c14a41c..db32f7d245 100644 --- a/runtime/common/construct_runtime/mod.rs +++ b/runtime/common/construct_runtime/mod.rs @@ -93,6 +93,8 @@ macro_rules! construct_runtime { EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage, Event} = 151, EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152, EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153, + + Maintenance: pallet_maintenance::{Pallet, Call, Storage, Event} = 154, } } } diff --git a/runtime/common/maintenance.rs b/runtime/common/maintenance.rs new file mode 100644 index 0000000000..26413554aa --- /dev/null +++ b/runtime/common/maintenance.rs @@ -0,0 +1,119 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +use scale_info::TypeInfo; +use codec::{Encode, Decode}; +use up_common::types::AccountId; +use crate::{RuntimeCall, Maintenance}; + +use sp_runtime::{ + traits::{DispatchInfoOf, SignedExtension}, + transaction_validity::{ + TransactionValidity, ValidTransaction, InvalidTransaction, TransactionValidityError, + }, +}; + +#[derive(Debug, Encode, Decode, PartialEq, Eq, Clone, TypeInfo)] +pub struct CheckMaintenance; + +impl SignedExtension for CheckMaintenance { + type AccountId = AccountId; + type Call = RuntimeCall; + type AdditionalSigned = (); + type Pre = (); + + const IDENTIFIER: &'static str = "CheckMaintenance"; + + fn additional_signed(&self) -> Result { + Ok(()) + } + + fn pre_dispatch( + self, + who: &Self::AccountId, + call: &Self::Call, + info: &DispatchInfoOf, + len: usize, + ) -> Result { + self.validate(who, call, info, len).map(|_| ()) + } + + fn validate( + &self, + _who: &Self::AccountId, + call: &Self::Call, + _info: &DispatchInfoOf, + _len: usize, + ) -> TransactionValidity { + if Maintenance::is_enabled() { + match call { + RuntimeCall::EvmMigration(_) + | RuntimeCall::EVM(_) + | RuntimeCall::Ethereum(_) + | RuntimeCall::Inflation(_) + | RuntimeCall::Maintenance(_) + | RuntimeCall::Structure(_) + | RuntimeCall::Unique(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), + + #[cfg(feature = "scheduler")] + RuntimeCall::Scheduler(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), + + #[cfg(feature = "rmrk")] + RuntimeCall::RmrkCore(_) | RuntimeCall::RmrkEquip(_) => { + Err(TransactionValidityError::Invalid(InvalidTransaction::Call)) + } + + #[cfg(feature = "app-promotion")] + RuntimeCall::AppPromotion(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), + + #[cfg(feature = "foreign-assets")] + RuntimeCall::ForeignAssets(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), + + #[cfg(feature = "pallet-test-utils")] + RuntimeCall::TestUtils(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), + + _ => Ok(ValidTransaction::default()), + } + } else { + Ok(ValidTransaction::default()) + } + } + + fn pre_dispatch_unsigned( + call: &Self::Call, + info: &DispatchInfoOf, + len: usize, + ) -> Result<(), TransactionValidityError> { + Self::validate_unsigned(call, info, len).map(|_| ()) + } + + fn validate_unsigned( + call: &Self::Call, + _info: &DispatchInfoOf, + _len: usize, + ) -> TransactionValidity { + if Maintenance::is_enabled() { + match call { + RuntimeCall::EVM(_) | RuntimeCall::Ethereum(_) | RuntimeCall::EvmMigration(_) => { + Err(TransactionValidityError::Invalid(InvalidTransaction::Call)) + } + _ => Ok(ValidTransaction::default()), + } + } else { + Ok(ValidTransaction::default()) + } + } +} diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index 93222355eb..86aaa94a54 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -20,6 +20,7 @@ pub mod dispatch; pub mod ethereum; pub mod instance; pub mod runtime_apis; +pub mod maintenance; #[cfg(feature = "scheduler")] pub mod scheduler; @@ -90,6 +91,7 @@ pub type SignedExtra = ( frame_system::CheckEra, frame_system::CheckNonce, frame_system::CheckWeight, + maintenance::CheckMaintenance, ChargeTransactionPayment, //pallet_contract_helpers::ContractHelpersExtension, pallet_ethereum::FakeTransactionFinalizer, diff --git a/runtime/common/scheduler.rs b/runtime/common/scheduler.rs index 6a6d341ed4..7c0e3104fe 100644 --- a/runtime/common/scheduler.rs +++ b/runtime/common/scheduler.rs @@ -24,7 +24,8 @@ use sp_runtime::{ transaction_validity::TransactionValidityError, DispatchErrorWithPostInfo, DispatchError, }; -use crate::{Runtime, Call, Origin, Balances, ChargeTransactionPayment}; +use codec::Encode; +use crate::{Runtime, Call, Origin, Balances, ChargeTransactionPayment, maintenance}; use up_common::types::{AccountId, Balance}; use fp_self_contained::SelfContainedCall; use pallet_unique_scheduler::DispatchCall; @@ -36,6 +37,8 @@ pub type SignedExtraScheduler = ( frame_system::CheckEra, frame_system::CheckNonce, frame_system::CheckWeight, + maintenance::CheckMaintenance, + ChargeTransactionPayment, ); fn get_signed_extras(from: ::AccountId) -> SignedExtraScheduler { @@ -47,8 +50,7 @@ fn get_signed_extras(from: ::AccountId) -> Sign from, )), frame_system::CheckWeight::::new(), - // sponsoring transaction logic - // pallet_charge_transaction::ChargeTransactionPayment::::new(0), + maintenance::CheckMaintenance, ) } diff --git a/runtime/opal/Cargo.toml b/runtime/opal/Cargo.toml index c510b1ea2d..2daa9a8cbf 100644 --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -45,6 +45,7 @@ runtime-benchmarks = [ 'pallet-xcm/runtime-benchmarks', 'sp-runtime/runtime-benchmarks', 'xcm-builder/runtime-benchmarks', + 'pallet-maintenance/runtime-benchmarks', ] try-runtime = [ 'frame-try-runtime', @@ -88,6 +89,7 @@ try-runtime = [ 'pallet-evm-contract-helpers/try-runtime', 'pallet-evm-transaction-payment/try-runtime', 'pallet-evm-migration/try-runtime', + 'pallet-maintenance/try-runtime', ] std = [ 'codec/std', @@ -167,6 +169,8 @@ std = [ "orml-xtokens/std", "orml-traits/std", "pallet-foreign-assets/std", + + 'pallet-maintenance/std', ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] opal-runtime = ['refungible', 'rmrk', 'app-promotion', 'foreign-assets'] @@ -482,6 +486,7 @@ fp-self-contained = { default-features = false, git = "https://github.com/unique evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.30' } pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" } +pallet-maintenance = { default-features = false, path = "../../pallets/maintenance" } ################################################################################ # Other Dependencies diff --git a/runtime/quartz/Cargo.toml b/runtime/quartz/Cargo.toml index a3c5ae9ad6..958890dd0a 100644 --- a/runtime/quartz/Cargo.toml +++ b/runtime/quartz/Cargo.toml @@ -44,6 +44,7 @@ runtime-benchmarks = [ 'pallet-xcm/runtime-benchmarks', 'sp-runtime/runtime-benchmarks', 'xcm-builder/runtime-benchmarks', + 'pallet-maintenance/runtime-benchmarks', ] try-runtime = [ 'frame-try-runtime', @@ -87,6 +88,7 @@ try-runtime = [ 'pallet-evm-contract-helpers/try-runtime', 'pallet-evm-transaction-payment/try-runtime', 'pallet-evm-migration/try-runtime', + 'pallet-maintenance/try-runtime', ] std = [ 'codec/std', @@ -165,6 +167,7 @@ std = [ "orml-xtokens/std", "orml-traits/std", "pallet-foreign-assets/std", + "pallet-maintenance/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] quartz-runtime = ['refungible'] @@ -487,6 +490,7 @@ fp-self-contained = { default-features = false, git = "https://github.com/unique evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.30' } pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" } +pallet-maintenance = { default-features = false, path = "../../pallets/maintenance" } ################################################################################ # Other Dependencies diff --git a/runtime/unique/Cargo.toml b/runtime/unique/Cargo.toml index 0ff20cc0c4..2c63a3ac42 100644 --- a/runtime/unique/Cargo.toml +++ b/runtime/unique/Cargo.toml @@ -45,6 +45,7 @@ runtime-benchmarks = [ 'sp-runtime/runtime-benchmarks', 'xcm-builder/runtime-benchmarks', 'up-data-structs/runtime-benchmarks', + 'pallet-maintenance/runtime-benchmarks', ] try-runtime = [ 'frame-try-runtime', @@ -88,6 +89,7 @@ try-runtime = [ 'pallet-evm-contract-helpers/try-runtime', 'pallet-evm-transaction-payment/try-runtime', 'pallet-evm-migration/try-runtime', + 'pallet-maintenance/try-runtime', ] std = [ 'codec/std', @@ -166,6 +168,7 @@ std = [ "orml-xtokens/std", "orml-traits/std", "pallet-foreign-assets/std", + "pallet-maintenance/std", ] limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing'] unique-runtime = [] @@ -481,6 +484,7 @@ fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenet evm-coder = { default-features = false, path = '../../crates/evm-coder' } up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.30' } pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" } +pallet-maintenance = { default-features = false, path = "../../pallets/maintenance" } ################################################################################ # Other Dependencies diff --git a/tests/src/pallet-presence.test.ts b/tests/src/pallet-presence.test.ts index 502c711b97..69b7a92a17 100644 --- a/tests/src/pallet-presence.test.ts +++ b/tests/src/pallet-presence.test.ts @@ -47,6 +47,7 @@ const requiredPallets = [ 'configuration', 'tokens', 'xtokens', + 'maintenance', ]; // Pallets that depend on consensus and governance configuration From 36417c70f3eab7a50a0d262347fe0b5d05e86901 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 7 Nov 2022 12:20:03 +0000 Subject: [PATCH 1258/1274] fix: cargo fmt (cherry picked from commit e9b69c5d6a9152f6a222a9049d9e5ef4814cde30) --- runtime/common/maintenance.rs | 22 +++++++++++++--------- runtime/common/mod.rs | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/runtime/common/maintenance.rs b/runtime/common/maintenance.rs index 26413554aa..e4d062bbaf 100644 --- a/runtime/common/maintenance.rs +++ b/runtime/common/maintenance.rs @@ -21,7 +21,7 @@ use crate::{RuntimeCall, Maintenance}; use sp_runtime::{ traits::{DispatchInfoOf, SignedExtension}, - transaction_validity::{ + transaction_validity::{ TransactionValidity, ValidTransaction, InvalidTransaction, TransactionValidityError, }, }; @@ -68,22 +68,26 @@ impl SignedExtension for CheckMaintenance { | RuntimeCall::Structure(_) | RuntimeCall::Unique(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), - #[cfg(feature = "scheduler")] - RuntimeCall::Scheduler(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), + #[cfg(feature = "scheduler")] + RuntimeCall::Scheduler(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), #[cfg(feature = "rmrk")] RuntimeCall::RmrkCore(_) | RuntimeCall::RmrkEquip(_) => { Err(TransactionValidityError::Invalid(InvalidTransaction::Call)) } - #[cfg(feature = "app-promotion")] - RuntimeCall::AppPromotion(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), + #[cfg(feature = "app-promotion")] + RuntimeCall::AppPromotion(_) => { + Err(TransactionValidityError::Invalid(InvalidTransaction::Call)) + } - #[cfg(feature = "foreign-assets")] - RuntimeCall::ForeignAssets(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), + #[cfg(feature = "foreign-assets")] + RuntimeCall::ForeignAssets(_) => { + Err(TransactionValidityError::Invalid(InvalidTransaction::Call)) + } - #[cfg(feature = "pallet-test-utils")] - RuntimeCall::TestUtils(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), + #[cfg(feature = "pallet-test-utils")] + RuntimeCall::TestUtils(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), _ => Ok(ValidTransaction::default()), } diff --git a/runtime/common/mod.rs b/runtime/common/mod.rs index 86aaa94a54..29e5106259 100644 --- a/runtime/common/mod.rs +++ b/runtime/common/mod.rs @@ -19,8 +19,8 @@ pub mod construct_runtime; pub mod dispatch; pub mod ethereum; pub mod instance; -pub mod runtime_apis; pub mod maintenance; +pub mod runtime_apis; #[cfg(feature = "scheduler")] pub mod scheduler; From b88e1a7d4950f77d8a955bc6577d8178db90075b Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Mon, 7 Nov 2022 15:00:10 +0000 Subject: [PATCH 1259/1274] tests(maintenance) (cherry picked from commit 7495d2ae3303ddf918b974baf8a388171c426ef1) --- tests/package.json | 9 +- tests/src/maintenanceMode.seqtest.ts | 264 +++++++++++++++++++++++ tests/src/util/playgrounds/unique.dev.ts | 4 + 3 files changed, 273 insertions(+), 4 deletions(-) create mode 100644 tests/src/maintenanceMode.seqtest.ts diff --git a/tests/package.json b/tests/package.json index ef99764115..df0c555348 100644 --- a/tests/package.json +++ b/tests/package.json @@ -70,7 +70,7 @@ "testBurnItem": "mocha --timeout 9999999 -r ts-node/register ./**/burnItem.test.ts", "testAdminTransferAndBurn": "mocha --timeout 9999999 -r ts-node/register ./**/adminTransferAndBurn.test.ts", "testSetPermissions": "mocha --timeout 9999999 -r ts-node/register ./**/setPermissions.test.ts", - "testCreditFeesToTreasury": "mocha --timeout 9999999 -r ts-node/register ./**/creditFeesToTreasury.test.ts", + "testCreditFeesToTreasury": "mocha --timeout 9999999 -r ts-node/register ./**/creditFeesToTreasury.seqtest.ts", "testContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/eth/contractSponsoring.test.ts", "testEnableContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/enableContractSponsoring.test.ts", "testRemoveFromContractAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/removeFromContractAllowList.test.ts", @@ -78,8 +78,9 @@ "testSetOffchainSchema": "mocha --timeout 9999999 -r ts-node/register ./**/setOffchainSchema.test.ts", "testNextSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/nextSponsoring.test.ts", "testOverflow": "mocha --timeout 9999999 -r ts-node/register ./**/overflow.test.ts", - "testInflation": "mocha --timeout 9999999 -r ts-node/register ./**/inflation.test.ts", - "testScheduler": "mocha --timeout 9999999 -r ts-node/register ./**/scheduler.test.ts", + "testMaintenance": "mocha --timeout 9999999 -r ts-node/register ./**/maintenanceMode.seqtest.ts", + "testInflation": "mocha --timeout 9999999 -r ts-node/register ./**/inflation.seqtest.ts", + "testScheduler": "mocha --timeout 9999999 -r ts-node/register ./**/scheduler.seqtest.ts", "testSchedulingEVM": "mocha --timeout 9999999 -r ts-node/register ./**/eth/scheduling.test.ts", "testPalletPresence": "mocha --timeout 9999999 -r ts-node/register ./**/pallet-presence.test.ts", "testBlockProduction": "mocha --timeout 9999999 -r ts-node/register ./**/block-production.test.ts", @@ -93,7 +94,7 @@ "testFT": "mocha --timeout 9999999 -r ts-node/register ./**/fungible.test.ts", "testEthFT": "mocha --timeout 9999999 -r ts-node/register ./**/eth/fungible.test.ts", "testRPC": "mocha --timeout 9999999 -r ts-node/register ./**/rpc.test.ts", - "testPromotion": "yarn setup && mocha --timeout 9999999 -r ts-node/register ./**/app-promotion.test.ts", + "testPromotion": "yarn setup && mocha --timeout 9999999 -r ts-node/register ./**/app-promotion.*test.ts", "testXcmUnique": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmUnique.test.ts", "testXcmQuartz": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmQuartz.test.ts", "testXcmOpal": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmOpal.test.ts", diff --git a/tests/src/maintenanceMode.seqtest.ts b/tests/src/maintenanceMode.seqtest.ts new file mode 100644 index 0000000000..20dc95027f --- /dev/null +++ b/tests/src/maintenanceMode.seqtest.ts @@ -0,0 +1,264 @@ +// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. +// This file is part of Unique Network. + +// Unique Network is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Unique Network is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Unique Network. If not, see . + +import {IKeyringPair} from '@polkadot/types/types'; +import {ApiPromise} from '@polkadot/api'; +import {expect, itSub, Pallets, usingPlaygrounds} from './util'; +import {itEth} from './eth/util'; + +async function maintenanceEnabled(api: ApiPromise): Promise { + return (await api.query.maintenance.enabled()).toJSON() as boolean; +} + +describe('Integration Test: Maintenance Mode', () => { + let superuser: IKeyringPair; + let donor: IKeyringPair; + let bob: IKeyringPair; + + before(async () => { + await usingPlaygrounds(async (helper, privateKey) => { + superuser = await privateKey('//Alice'); + donor = await privateKey({filename: __filename}); + [bob] = await helper.arrange.createAccounts([100n], donor); + + if (await maintenanceEnabled(helper.getApi())) { + console.warn('\tMaintenance mode was left enabled BEFORE the test suite! Disabling it now.'); + await expect(helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', [])).to.be.fulfilled; + } + }); + }); + + itSub('Allows superuser to enable and disable maintenance mode - and disallows anyone else', async ({helper}) => { + // Make sure non-sudo can't enable maintenance mode + await expect(helper.executeExtrinsic(superuser, 'api.tx.maintenance.enable', []), 'on commoner enabling MM').to.be.rejected; //With(/NoPermission/); + + // Set maintenance mode + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []); + expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true; + + // Make sure non-sudo can't disable maintenance mode + await expect(helper.executeExtrinsic(bob, 'api.tx.maintenance.disable', []), 'on commoner disabling MM').to.be.rejected; //With(/NoPermission/); + + // Disable maintenance mode + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []); + expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false; + }); + + itSub('MM blocks unique pallet calls', async ({helper}) => { + // Can create an NFT collection before enabling the MM + const nftCollection = await helper.nft.mintCollection(bob, { + tokenPropertyPermissions: [{key: 'test', permission: { + collectionAdmin: true, + tokenOwner: true, + mutable: true, + }}], + }); + + // Can mint an NFT before enabling the MM + const nft = await nftCollection.mintToken(bob); + + // Can create an FT collection before enabling the MM + const ftCollection = await helper.ft.mintCollection(superuser); + + // Can mint an FT before enabling the MM + await expect(ftCollection.mint(superuser)).to.be.fulfilled; + + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []); + expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true; + + // Unable to create a collection when the MM is enabled + await expect(helper.nft.mintCollection(superuser), 'cudo forbidden stuff').to.be.rejected; + + // Unable to set token properties when the MM is enabled + await expect(nft.setProperties( + bob, + [{key: 'test', value: 'test-val'}], + )).to.be.rejected; + + // Unable to mint an NFT when the MM is enabled + await expect(nftCollection.mintToken(superuser)).to.be.rejected; + + // Unable to mint an FT when the MM is enabled + await expect(ftCollection.mint(superuser)).to.be.rejected; + + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []); + expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false; + + // Can create a collection after disabling the MM + await expect(helper.nft.mintCollection(bob), 'MM is disabled, the collection should be created').to.be.fulfilled; + + // Can set token properties after disabling the MM + await nft.setProperties(bob, [{key: 'test', value: 'test-val'}]); + + // Can mint an NFT after disabling the MM + await nftCollection.mintToken(bob); + + // Can mint an FT after disabling the MM + await ftCollection.mint(superuser); + }); + + itSub.ifWithPallets('MM blocks unique pallet calls (Re-Fungible)', [Pallets.ReFungible], async ({helper}) => { + // Can create an RFT collection before enabling the MM + const rftCollection = await helper.rft.mintCollection(superuser); + + // Can mint an RFT before enabling the MM + await expect(rftCollection.mintToken(superuser)).to.be.fulfilled; + + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []); + expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true; + + // Unable to mint an RFT when the MM is enabled + await expect(rftCollection.mintToken(superuser)).to.be.rejected; + + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []); + expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false; + + // Can mint an RFT after disabling the MM + await rftCollection.mintToken(superuser); + }); + + itSub('MM allows native token transfers and RPC calls', async ({helper}) => { + // We can use RPC before the MM is enabled + const totalCount = await helper.collection.getTotalCount(); + + // We can transfer funds before the MM is enabled + await expect(helper.balance.transferToSubstrate(superuser, bob.address, 2n)).to.be.fulfilled; + + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []); + expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true; + + // RPCs work while in maintenance + expect(await helper.collection.getTotalCount()).to.be.deep.equal(totalCount); + + // We still able to transfer funds + await expect(helper.balance.transferToSubstrate(bob, superuser.address, 1n)).to.be.fulfilled; + + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []); + expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false; + + // RPCs work after maintenance + expect(await helper.collection.getTotalCount()).to.be.deep.equal(totalCount); + + // Transfers work after maintenance + await expect(helper.balance.transferToSubstrate(bob, superuser.address, 1n)).to.be.fulfilled; + }); + + itSub.ifWithPallets('MM blocks scheduled calls and the scheduler itself', [Pallets.Scheduler], async ({helper}) => { + const collection = await helper.nft.mintCollection(bob); + + const nftBeforeMM = await collection.mintToken(bob); + const nftDuringMM = await collection.mintToken(bob); + const nftAfterMM = await collection.mintToken(bob); + + const scheduledIdBeforeMM = '0x' + '0'.repeat(31) + '0'; + const scheduledIdDuringMM = '0x' + '0'.repeat(31) + '1'; + const scheduledIdBunkerThroughMM = '0x' + '0'.repeat(31) + '2'; + const scheduledIdAttemptDuringMM = '0x' + '0'.repeat(31) + '3'; + const scheduledIdAfterMM = '0x' + '0'.repeat(31) + '4'; + + const blocksToWait = 6; + + // Scheduling works before the maintenance + await nftBeforeMM.scheduleAfter(scheduledIdBeforeMM, blocksToWait) + .transfer(bob, {Substrate: superuser.address}); + + await helper.wait.newBlocks(blocksToWait + 1); + expect(await nftBeforeMM.getOwner()).to.be.deep.equal({Substrate: superuser.address}); + + // Schedule a transaction that should occur *during* the maintenance + await nftDuringMM.scheduleAfter(scheduledIdDuringMM, blocksToWait) + .transfer(bob, {Substrate: superuser.address}); + + // Schedule a transaction that should occur *after* the maintenance + await nftDuringMM.scheduleAfter(scheduledIdBunkerThroughMM, blocksToWait * 2) + .transfer(bob, {Substrate: superuser.address}); + + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []); + expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true; + + await helper.wait.newBlocks(blocksToWait + 1); + // The owner should NOT change since the scheduled transaction should be rejected + expect(await nftDuringMM.getOwner()).to.be.deep.equal({Substrate: bob.address}); + + // Any attempts to schedule a tx during the MM should be rejected + await expect(nftDuringMM.scheduleAfter(scheduledIdAttemptDuringMM, blocksToWait) + .transfer(bob, {Substrate: superuser.address})).to.be.rejected; + + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []); + expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false; + + // Scheduling works after the maintenance + await nftAfterMM.scheduleAfter(scheduledIdAfterMM, blocksToWait) + .transfer(bob, {Substrate: superuser.address}); + + await helper.wait.newBlocks(blocksToWait + 1); + + expect(await nftAfterMM.getOwner()).to.be.deep.equal({Substrate: superuser.address}); + // The owner of the token scheduled for transaction *before* maintenance should now change *after* maintenance + expect(await nftDuringMM.getOwner()).to.be.deep.equal({Substrate: superuser.address}); + }); + + itEth('Disallows Ethereum transactions to execute while in maintenance', async ({helper}) => { + const owner = await helper.eth.createAccountWithBalance(donor); + const receiver = helper.eth.createAccount(); + + const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'A', 'B', 'C', ''); + + // Set maintenance mode + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []); + expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true; + + const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + const tokenId = await contract.methods.nextTokenId().call(); + expect(tokenId).to.be.equal('1'); + + /*const result = */ + await contract.methods.mintWithTokenURI( + receiver, + 'Test URI', + ).send(); + /*const expectedTokenId = result.events.Transfer.returnValues.tokenId; + expect(expectedTokenId).to.be.equal(tokenId);*/ + + await expect(contract.methods.ownerOf(tokenId).call()).rejectedWith(/token not found/); + + // Disable maintenance mode + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []); + expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false; + }); + + itSub('Allows to enable and disable MM repeatedly', async ({helper}) => { + // Set maintenance mode + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []); + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []); + expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true; + + // Disable maintenance mode + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []); + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []); + expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false; + }); + + afterEach(async () => { + await usingPlaygrounds(async helper => { + if (await maintenanceEnabled(helper.getApi())) { + console.warn('\tMaintenance mode was left enabled AFTER a test has finished! Be careful. Disabling it now.'); + await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []); + } + expect(await maintenanceEnabled(helper.getApi()), 'Disastrous! Exited the test suite with maintenance mode on.').to.be.false; + }); + }); +}); \ No newline at end of file diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 0fb41c8f33..7094f9f773 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -82,6 +82,10 @@ export class DevUniqueHelper extends UniqueHelper { extrinsic: {}, payload: {}, }, + CheckMaintenance: { + extrinsic: {}, + payload: {}, + }, FakeTransactionFinalizer: { extrinsic: {}, payload: {}, From 415593c86397b0b0d82ac62bf78a0aaee83cf05a Mon Sep 17 00:00:00 2001 From: Fahrrader Date: Mon, 7 Nov 2022 15:00:31 +0000 Subject: [PATCH 1260/1274] tests(interfaces): update for maintenance (cherry picked from commit d1c56867774820c4034ad7e6e0513afad3429713) --- tests/src/interfaces/augment-api-consts.ts | 18 +- tests/src/interfaces/augment-api-errors.ts | 36 ++ tests/src/interfaces/augment-api-events.ts | 45 +- tests/src/interfaces/augment-api-query.ts | 33 +- tests/src/interfaces/augment-api-tx.ts | 47 +- tests/src/interfaces/augment-types.ts | 21 +- tests/src/interfaces/default/types.ts | 203 +++++++ tests/src/interfaces/lookup.ts | 674 +++++++++++++++------ tests/src/interfaces/registry.ts | 21 +- tests/src/interfaces/types-lookup.ts | 586 ++++++++++++------ 10 files changed, 1292 insertions(+), 392 deletions(-) diff --git a/tests/src/interfaces/augment-api-consts.ts b/tests/src/interfaces/augment-api-consts.ts index 4c63d4c7af..a8f8862d3b 100644 --- a/tests/src/interfaces/augment-api-consts.ts +++ b/tests/src/interfaces/augment-api-consts.ts @@ -8,7 +8,7 @@ import '@polkadot/api-base/types/consts'; import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types'; import type { Option, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { Codec } from '@polkadot/types-codec/types'; -import type { Perbill, Permill } from '@polkadot/types/interfaces/runtime'; +import type { Perbill, Permill, Weight } from '@polkadot/types/interfaces/runtime'; import type { FrameSupportPalletId, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, XcmV1MultiLocation } from '@polkadot/types/lookup'; export type __AugmentedConst = AugmentedConst; @@ -92,6 +92,22 @@ declare module '@polkadot/api-base/types/consts' { **/ [key: string]: Codec; }; + scheduler: { + /** + * The maximum weight that may be scheduled per block for any dispatchables of less + * priority than `schedule::HARD_DEADLINE`. + **/ + maximumWeight: Weight & AugmentedConst; + /** + * The maximum number of scheduled calls in the queue for a single block. + * Not strictly enforced, but used for weight estimation. + **/ + maxScheduledPerBlock: u32 & AugmentedConst; + /** + * Generic const + **/ + [key: string]: Codec; + }; system: { /** * Maximum number of block number to block hash mappings to keep (oldest pruned first). diff --git a/tests/src/interfaces/augment-api-errors.ts b/tests/src/interfaces/augment-api-errors.ts index 36754eb3fd..2b43272d31 100644 --- a/tests/src/interfaces/augment-api-errors.ts +++ b/tests/src/interfaces/augment-api-errors.ts @@ -374,6 +374,12 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; + maintenance: { + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; nonfungible: { /** * Unable to burn NFT with children @@ -636,6 +642,28 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; + scheduler: { + /** + * Failed to schedule a call + **/ + FailedToSchedule: AugmentedError; + /** + * Cannot find the scheduled call. + **/ + NotFound: AugmentedError; + /** + * Reschedule failed because it does not change scheduled time. + **/ + RescheduleNoChange: AugmentedError; + /** + * Given target block number is in the past. + **/ + TargetBlockNumberInPast: AugmentedError; + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; structure: { /** * While nesting, reached the breadth limit of nesting, exceeding the provided budget. @@ -702,6 +730,14 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; + testUtils: { + TestPalletDisabled: AugmentedError; + TriggerRollback: AugmentedError; + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; tokens: { /** * Cannot convert Amount into Balance type diff --git a/tests/src/interfaces/augment-api-events.ts b/tests/src/interfaces/augment-api-events.ts index 7e5bbca87e..5901edc289 100644 --- a/tests/src/interfaces/augment-api-events.ts +++ b/tests/src/interfaces/augment-api-events.ts @@ -7,8 +7,9 @@ import '@polkadot/api-base/types/events'; import type { ApiTypes, AugmentedEvent } from '@polkadot/api-base/types'; import type { Bytes, Null, Option, Result, U256, U8aFixed, bool, u128, u32, u64, u8 } from '@polkadot/types-codec'; +import type { ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256, Weight } from '@polkadot/types/interfaces/runtime'; -import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportDispatchDispatchInfo, FrameSupportTokensMiscBalanceStatus, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetMultiAssets, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; +import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportDispatchDispatchInfo, FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetMultiAssets, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; export type __AugmentedEvent = AugmentedEvent; @@ -285,6 +286,14 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; + maintenance: { + MaintenanceDisabled: AugmentedEvent; + MaintenanceEnabled: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; parachainSystem: { /** * Downward messages were processed using the given weight. @@ -466,6 +475,32 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; + scheduler: { + /** + * The call for the provided hash was not found so the task has been aborted. + **/ + CallLookupFailed: AugmentedEvent, id: Option, error: FrameSupportScheduleLookupError], { task: ITuple<[u32, u32]>, id: Option, error: FrameSupportScheduleLookupError }>; + /** + * Canceled some task. + **/ + Canceled: AugmentedEvent; + /** + * Dispatched some task. + **/ + Dispatched: AugmentedEvent, id: Option, result: Result], { task: ITuple<[u32, u32]>, id: Option, result: Result }>; + /** + * Scheduled task's priority has changed + **/ + PriorityChanged: AugmentedEvent; + /** + * Scheduled some task. + **/ + Scheduled: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; structure: { /** * Executed call on behalf of the token. @@ -524,6 +559,14 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; + testUtils: { + ShouldRollback: AugmentedEvent; + ValueIsSet: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; tokens: { /** * A balance was set by root. diff --git a/tests/src/interfaces/augment-api-query.ts b/tests/src/interfaces/augment-api-query.ts index e2b9bf45a8..2e642e7fda 100644 --- a/tests/src/interfaces/augment-api-query.ts +++ b/tests/src/interfaces/augment-api-query.ts @@ -6,10 +6,10 @@ import '@polkadot/api-base/types/storage'; import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types'; -import type { BTreeMap, Bytes, Option, U256, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; +import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H160, H256, Weight } from '@polkadot/types/interfaces/runtime'; -import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportDispatchPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportDispatchPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup'; import type { Observable } from '@polkadot/types/types'; export type __AugmentedQuery = AugmentedQuery unknown>; @@ -389,6 +389,13 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; + maintenance: { + enabled: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; nonfungible: { /** * Amount of tokens owned by an account in a collection. @@ -670,6 +677,20 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; + scheduler: { + /** + * Items to be executed, indexed by the block number that they should be executed on. + **/ + agenda: AugmentedQuery Observable>>, [u32]> & QueryableStorageEntry; + /** + * Lookup from identity to the block number and index of the task. + **/ + lookup: AugmentedQuery Observable>>, [U8aFixed]> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; structure: { /** * Generic query @@ -772,6 +793,14 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; + testUtils: { + enabled: AugmentedQuery Observable, []> & QueryableStorageEntry; + testValue: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; timestamp: { /** * Did the timestamp get updated in this block? diff --git a/tests/src/interfaces/augment-api-tx.ts b/tests/src/interfaces/augment-api-tx.ts index a42bd7bbf4..08a298b8e2 100644 --- a/tests/src/interfaces/augment-api-tx.ts +++ b/tests/src/interfaces/augment-api-tx.ts @@ -6,10 +6,10 @@ import '@polkadot/api-base/types/submittable'; import type { ApiTypes, AugmentedSubmittable, SubmittableExtrinsic, SubmittableExtrinsicFunction } from '@polkadot/api-base/types'; -import type { Bytes, Compact, Option, U256, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; +import type { Bytes, Compact, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill, Weight } from '@polkadot/types/interfaces/runtime'; -import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartEquippableList, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, FrameSupportScheduleMaybeHashed, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartEquippableList, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; export type __AugmentedSubmittable = AugmentedSubmittable<() => unknown>; export type __SubmittableExtrinsic = SubmittableExtrinsic; @@ -332,6 +332,14 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; + maintenance: { + disable: AugmentedSubmittable<() => SubmittableExtrinsic, []>; + enable: AugmentedSubmittable<() => SubmittableExtrinsic, []>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; parachainSystem: { authorizeUpgrade: AugmentedSubmittable<(codeHash: H256 | string | Uint8Array) => SubmittableExtrinsic, [H256]>; enactAuthorizedUpgrade: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes]>; @@ -821,6 +829,29 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; + scheduler: { + /** + * Cancel a named scheduled task. + **/ + cancelNamed: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed]>; + changeNamedPriority: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u8]>; + /** + * Schedule a named task. + **/ + scheduleNamed: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: Option | null | Uint8Array | u8 | AnyNumber, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, Option, FrameSupportScheduleMaybeHashed]>; + /** + * Schedule a named task after a delay. + * + * # + * Same as [`schedule_named`](Self::schedule_named). + * # + **/ + scheduleNamedAfter: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | Uint8Array | ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], priority: Option | null | Uint8Array | u8 | AnyNumber, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32, Option>, Option, FrameSupportScheduleMaybeHashed]>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; structure: { /** * Generic tx @@ -954,6 +985,18 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; + testUtils: { + enable: AugmentedSubmittable<() => SubmittableExtrinsic, []>; + incTestValue: AugmentedSubmittable<() => SubmittableExtrinsic, []>; + justTakeFee: AugmentedSubmittable<() => SubmittableExtrinsic, []>; + selfCancelingInc: AugmentedSubmittable<(id: U8aFixed | string | Uint8Array, maxTestValue: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [U8aFixed, u32]>; + setTestValue: AugmentedSubmittable<(value: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; + setTestValueAndRollback: AugmentedSubmittable<(value: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; timestamp: { /** * Set the current time. diff --git a/tests/src/interfaces/augment-types.ts b/tests/src/interfaces/augment-types.ts index 7486c19f89..86e965ba4d 100644 --- a/tests/src/interfaces/augment-types.ts +++ b/tests/src/interfaces/augment-types.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchDispatchClass, FrameSupportDispatchDispatchInfo, FrameSupportDispatchPays, FrameSupportDispatchPerDispatchClassU32, FrameSupportDispatchPerDispatchClassWeight, FrameSupportDispatchPerDispatchClassWeightsPerClass, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsRpcCollectionFlags, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchDispatchClass, FrameSupportDispatchDispatchInfo, FrameSupportDispatchPays, FrameSupportDispatchPerDispatchClassU32, FrameSupportDispatchPerDispatchClassWeight, FrameSupportDispatchPerDispatchClassWeightsPerClass, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletMaintenanceCall, PalletMaintenanceError, PalletMaintenanceEvent, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTestUtilsCall, PalletTestUtilsError, PalletTestUtilsEvent, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsRpcCollectionFlags, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default'; import type { Data, StorageKey } from '@polkadot/types'; import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; @@ -328,6 +328,7 @@ declare module '@polkadot/types/types/registry' { CumulusPalletXcmCall: CumulusPalletXcmCall; CumulusPalletXcmError: CumulusPalletXcmError; CumulusPalletXcmEvent: CumulusPalletXcmEvent; + CumulusPalletXcmOrigin: CumulusPalletXcmOrigin; CumulusPalletXcmpQueueCall: CumulusPalletXcmpQueueCall; CumulusPalletXcmpQueueError: CumulusPalletXcmpQueueError; CumulusPalletXcmpQueueEvent: CumulusPalletXcmpQueueEvent; @@ -523,7 +524,10 @@ declare module '@polkadot/types/types/registry' { FrameSupportDispatchPerDispatchClassU32: FrameSupportDispatchPerDispatchClassU32; FrameSupportDispatchPerDispatchClassWeight: FrameSupportDispatchPerDispatchClassWeight; FrameSupportDispatchPerDispatchClassWeightsPerClass: FrameSupportDispatchPerDispatchClassWeightsPerClass; + FrameSupportDispatchRawOrigin: FrameSupportDispatchRawOrigin; FrameSupportPalletId: FrameSupportPalletId; + FrameSupportScheduleLookupError: FrameSupportScheduleLookupError; + FrameSupportScheduleMaybeHashed: FrameSupportScheduleMaybeHashed; FrameSupportTokensMiscBalanceStatus: FrameSupportTokensMiscBalanceStatus; FrameSystemAccountInfo: FrameSystemAccountInfo; FrameSystemCall: FrameSystemCall; @@ -769,7 +773,9 @@ declare module '@polkadot/types/types/registry' { OffenceDetails: OffenceDetails; Offender: Offender; OldV1SessionInfo: OldV1SessionInfo; + OpalRuntimeOriginCaller: OpalRuntimeOriginCaller; OpalRuntimeRuntime: OpalRuntimeRuntime; + OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance: OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance; OpaqueCall: OpaqueCall; OpaqueKeyOwnershipProof: OpaqueKeyOwnershipProof; OpaqueMetadata: OpaqueMetadata; @@ -835,6 +841,7 @@ declare module '@polkadot/types/types/registry' { PalletEthereumError: PalletEthereumError; PalletEthereumEvent: PalletEthereumEvent; PalletEthereumFakeTransactionFinalizer: PalletEthereumFakeTransactionFinalizer; + PalletEthereumRawOrigin: PalletEthereumRawOrigin; PalletEventMetadataLatest: PalletEventMetadataLatest; PalletEventMetadataV14: PalletEventMetadataV14; PalletEvmAccountBasicCrossAccountIdRepr: PalletEvmAccountBasicCrossAccountIdRepr; @@ -856,6 +863,9 @@ declare module '@polkadot/types/types/registry' { PalletFungibleError: PalletFungibleError; PalletId: PalletId; PalletInflationCall: PalletInflationCall; + PalletMaintenanceCall: PalletMaintenanceCall; + PalletMaintenanceError: PalletMaintenanceError; + PalletMaintenanceEvent: PalletMaintenanceEvent; PalletMetadataLatest: PalletMetadataLatest; PalletMetadataV14: PalletMetadataV14; PalletNonfungibleError: PalletNonfungibleError; @@ -879,6 +889,9 @@ declare module '@polkadot/types/types/registry' { PalletSudoEvent: PalletSudoEvent; PalletTemplateTransactionPaymentCall: PalletTemplateTransactionPaymentCall; PalletTemplateTransactionPaymentChargeTransactionPayment: PalletTemplateTransactionPaymentChargeTransactionPayment; + PalletTestUtilsCall: PalletTestUtilsCall; + PalletTestUtilsError: PalletTestUtilsError; + PalletTestUtilsEvent: PalletTestUtilsEvent; PalletTimestampCall: PalletTimestampCall; PalletTransactionPaymentEvent: PalletTransactionPaymentEvent; PalletTransactionPaymentReleases: PalletTransactionPaymentReleases; @@ -889,10 +902,15 @@ declare module '@polkadot/types/types/registry' { PalletUniqueCall: PalletUniqueCall; PalletUniqueError: PalletUniqueError; PalletUniqueRawEvent: PalletUniqueRawEvent; + PalletUniqueSchedulerCall: PalletUniqueSchedulerCall; + PalletUniqueSchedulerError: PalletUniqueSchedulerError; + PalletUniqueSchedulerEvent: PalletUniqueSchedulerEvent; + PalletUniqueSchedulerScheduledV3: PalletUniqueSchedulerScheduledV3; PalletVersion: PalletVersion; PalletXcmCall: PalletXcmCall; PalletXcmError: PalletXcmError; PalletXcmEvent: PalletXcmEvent; + PalletXcmOrigin: PalletXcmOrigin; ParachainDispatchOrigin: ParachainDispatchOrigin; ParachainInherentData: ParachainInherentData; ParachainProposal: ParachainProposal; @@ -1166,6 +1184,7 @@ declare module '@polkadot/types/types/registry' { SpCoreEcdsaSignature: SpCoreEcdsaSignature; SpCoreEd25519Signature: SpCoreEd25519Signature; SpCoreSr25519Signature: SpCoreSr25519Signature; + SpCoreVoid: SpCoreVoid; SpecVersion: SpecVersion; SpRuntimeArithmeticError: SpRuntimeArithmeticError; SpRuntimeDigest: SpRuntimeDigest; diff --git a/tests/src/interfaces/default/types.ts b/tests/src/interfaces/default/types.ts index afc77911ab..7e6ce66ff5 100644 --- a/tests/src/interfaces/default/types.ts +++ b/tests/src/interfaces/default/types.ts @@ -153,6 +153,14 @@ export interface CumulusPalletXcmEvent extends Enum { readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward'; } +/** @name CumulusPalletXcmOrigin */ +export interface CumulusPalletXcmOrigin extends Enum { + readonly isRelay: boolean; + readonly isSiblingParachain: boolean; + readonly asSiblingParachain: u32; + readonly type: 'Relay' | 'SiblingParachain'; +} + /** @name CumulusPalletXcmpQueueCall */ export interface CumulusPalletXcmpQueueCall extends Enum { readonly isServiceOverweight: boolean; @@ -536,9 +544,34 @@ export interface FrameSupportDispatchPerDispatchClassWeightsPerClass extends Str readonly mandatory: FrameSystemLimitsWeightsPerClass; } +/** @name FrameSupportDispatchRawOrigin */ +export interface FrameSupportDispatchRawOrigin extends Enum { + readonly isRoot: boolean; + readonly isSigned: boolean; + readonly asSigned: AccountId32; + readonly isNone: boolean; + readonly type: 'Root' | 'Signed' | 'None'; +} + /** @name FrameSupportPalletId */ export interface FrameSupportPalletId extends U8aFixed {} +/** @name FrameSupportScheduleLookupError */ +export interface FrameSupportScheduleLookupError extends Enum { + readonly isUnknown: boolean; + readonly isBadFormat: boolean; + readonly type: 'Unknown' | 'BadFormat'; +} + +/** @name FrameSupportScheduleMaybeHashed */ +export interface FrameSupportScheduleMaybeHashed extends Enum { + readonly isValue: boolean; + readonly asValue: Call; + readonly isHash: boolean; + readonly asHash: H256; + readonly type: 'Value' | 'Hash'; +} + /** @name FrameSupportTokensMiscBalanceStatus */ export interface FrameSupportTokensMiscBalanceStatus extends Enum { readonly isFree: boolean; @@ -693,9 +726,27 @@ export interface FrameSystemPhase extends Enum { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } +/** @name OpalRuntimeOriginCaller */ +export interface OpalRuntimeOriginCaller extends Enum { + readonly isSystem: boolean; + readonly asSystem: FrameSupportDispatchRawOrigin; + readonly isVoid: boolean; + readonly asVoid: SpCoreVoid; + readonly isPolkadotXcm: boolean; + readonly asPolkadotXcm: PalletXcmOrigin; + readonly isCumulusXcm: boolean; + readonly asCumulusXcm: CumulusPalletXcmOrigin; + readonly isEthereum: boolean; + readonly asEthereum: PalletEthereumRawOrigin; + readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; +} + /** @name OpalRuntimeRuntime */ export interface OpalRuntimeRuntime extends Null {} +/** @name OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance */ +export interface OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance extends Null {} + /** @name OrmlTokensAccountData */ export interface OrmlTokensAccountData extends Struct { readonly free: u128; @@ -1303,6 +1354,13 @@ export interface PalletEthereumEvent extends Enum { /** @name PalletEthereumFakeTransactionFinalizer */ export interface PalletEthereumFakeTransactionFinalizer extends Null {} +/** @name PalletEthereumRawOrigin */ +export interface PalletEthereumRawOrigin extends Enum { + readonly isEthereumTransaction: boolean; + readonly asEthereumTransaction: H160; + readonly type: 'EthereumTransaction'; +} + /** @name PalletEvmAccountBasicCrossAccountIdRepr */ export interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum { readonly isSubstrate: boolean; @@ -1543,6 +1601,23 @@ export interface PalletInflationCall extends Enum { readonly type: 'StartInflation'; } +/** @name PalletMaintenanceCall */ +export interface PalletMaintenanceCall extends Enum { + readonly isEnable: boolean; + readonly isDisable: boolean; + readonly type: 'Enable' | 'Disable'; +} + +/** @name PalletMaintenanceError */ +export interface PalletMaintenanceError extends Null {} + +/** @name PalletMaintenanceEvent */ +export interface PalletMaintenanceEvent extends Enum { + readonly isMaintenanceEnabled: boolean; + readonly isMaintenanceDisabled: boolean; + readonly type: 'MaintenanceEnabled' | 'MaintenanceDisabled'; +} + /** @name PalletNonfungibleError */ export interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; @@ -1911,6 +1986,41 @@ export interface PalletTemplateTransactionPaymentCall extends Null {} /** @name PalletTemplateTransactionPaymentChargeTransactionPayment */ export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} +/** @name PalletTestUtilsCall */ +export interface PalletTestUtilsCall extends Enum { + readonly isEnable: boolean; + readonly isSetTestValue: boolean; + readonly asSetTestValue: { + readonly value: u32; + } & Struct; + readonly isSetTestValueAndRollback: boolean; + readonly asSetTestValueAndRollback: { + readonly value: u32; + } & Struct; + readonly isIncTestValue: boolean; + readonly isSelfCancelingInc: boolean; + readonly asSelfCancelingInc: { + readonly id: U8aFixed; + readonly maxTestValue: u32; + } & Struct; + readonly isJustTakeFee: boolean; + readonly type: 'Enable' | 'SetTestValue' | 'SetTestValueAndRollback' | 'IncTestValue' | 'SelfCancelingInc' | 'JustTakeFee'; +} + +/** @name PalletTestUtilsError */ +export interface PalletTestUtilsError extends Enum { + readonly isTestPalletDisabled: boolean; + readonly isTriggerRollback: boolean; + readonly type: 'TestPalletDisabled' | 'TriggerRollback'; +} + +/** @name PalletTestUtilsEvent */ +export interface PalletTestUtilsEvent extends Enum { + readonly isValueIsSet: boolean; + readonly isShouldRollback: boolean; + readonly type: 'ValueIsSet' | 'ShouldRollback'; +} + /** @name PalletTimestampCall */ export interface PalletTimestampCall extends Enum { readonly isSet: boolean; @@ -2217,6 +2327,87 @@ export interface PalletUniqueRawEvent extends Enum { readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet'; } +/** @name PalletUniqueSchedulerCall */ +export interface PalletUniqueSchedulerCall extends Enum { + readonly isScheduleNamed: boolean; + readonly asScheduleNamed: { + readonly id: U8aFixed; + readonly when: u32; + readonly maybePeriodic: Option>; + readonly priority: Option; + readonly call: FrameSupportScheduleMaybeHashed; + } & Struct; + readonly isCancelNamed: boolean; + readonly asCancelNamed: { + readonly id: U8aFixed; + } & Struct; + readonly isScheduleNamedAfter: boolean; + readonly asScheduleNamedAfter: { + readonly id: U8aFixed; + readonly after: u32; + readonly maybePeriodic: Option>; + readonly priority: Option; + readonly call: FrameSupportScheduleMaybeHashed; + } & Struct; + readonly isChangeNamedPriority: boolean; + readonly asChangeNamedPriority: { + readonly id: U8aFixed; + readonly priority: u8; + } & Struct; + readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter' | 'ChangeNamedPriority'; +} + +/** @name PalletUniqueSchedulerError */ +export interface PalletUniqueSchedulerError extends Enum { + readonly isFailedToSchedule: boolean; + readonly isNotFound: boolean; + readonly isTargetBlockNumberInPast: boolean; + readonly isRescheduleNoChange: boolean; + readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; +} + +/** @name PalletUniqueSchedulerEvent */ +export interface PalletUniqueSchedulerEvent extends Enum { + readonly isScheduled: boolean; + readonly asScheduled: { + readonly when: u32; + readonly index: u32; + } & Struct; + readonly isCanceled: boolean; + readonly asCanceled: { + readonly when: u32; + readonly index: u32; + } & Struct; + readonly isPriorityChanged: boolean; + readonly asPriorityChanged: { + readonly when: u32; + readonly index: u32; + readonly priority: u8; + } & Struct; + readonly isDispatched: boolean; + readonly asDispatched: { + readonly task: ITuple<[u32, u32]>; + readonly id: Option; + readonly result: Result; + } & Struct; + readonly isCallLookupFailed: boolean; + readonly asCallLookupFailed: { + readonly task: ITuple<[u32, u32]>; + readonly id: Option; + readonly error: FrameSupportScheduleLookupError; + } & Struct; + readonly type: 'Scheduled' | 'Canceled' | 'PriorityChanged' | 'Dispatched' | 'CallLookupFailed'; +} + +/** @name PalletUniqueSchedulerScheduledV3 */ +export interface PalletUniqueSchedulerScheduledV3 extends Struct { + readonly maybeId: Option; + readonly priority: u8; + readonly call: FrameSupportScheduleMaybeHashed; + readonly maybePeriodic: Option>; + readonly origin: OpalRuntimeOriginCaller; +} + /** @name PalletXcmCall */ export interface PalletXcmCall extends Enum { readonly isSend: boolean; @@ -2334,6 +2525,15 @@ export interface PalletXcmEvent extends Enum { readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail'; } +/** @name PalletXcmOrigin */ +export interface PalletXcmOrigin extends Enum { + readonly isXcm: boolean; + readonly asXcm: XcmV1MultiLocation; + readonly isResponse: boolean; + readonly asResponse: XcmV1MultiLocation; + readonly type: 'Xcm' | 'Response'; +} + /** @name PhantomTypeUpDataStructs */ export interface PhantomTypeUpDataStructs extends Vec> {} @@ -2554,6 +2754,9 @@ export interface SpCoreEd25519Signature extends U8aFixed {} /** @name SpCoreSr25519Signature */ export interface SpCoreSr25519Signature extends U8aFixed {} +/** @name SpCoreVoid */ +export interface SpCoreVoid extends Null {} + /** @name SpRuntimeArithmeticError */ export interface SpRuntimeArithmeticError extends Enum { readonly isUnderflow: boolean; diff --git a/tests/src/interfaces/lookup.ts b/tests/src/interfaces/lookup.ts index 1179efb57b..9f38ea791f 100644 --- a/tests/src/interfaces/lookup.ts +++ b/tests/src/interfaces/lookup.ts @@ -1004,7 +1004,43 @@ export default { } }, /** - * Lookup93: pallet_common::pallet::Event + * Lookup93: pallet_unique_scheduler::pallet::Event + **/ + PalletUniqueSchedulerEvent: { + _enum: { + Scheduled: { + when: 'u32', + index: 'u32', + }, + Canceled: { + when: 'u32', + index: 'u32', + }, + PriorityChanged: { + when: 'u32', + index: 'u32', + priority: 'u8', + }, + Dispatched: { + task: '(u32,u32)', + id: 'Option<[u8;16]>', + result: 'Result', + }, + CallLookupFailed: { + task: '(u32,u32)', + id: 'Option<[u8;16]>', + error: 'FrameSupportScheduleLookupError' + } + } + }, + /** + * Lookup96: frame_support::traits::schedule::LookupError + **/ + FrameSupportScheduleLookupError: { + _enum: ['Unknown', 'BadFormat'] + }, + /** + * Lookup97: pallet_common::pallet::Event **/ PalletCommonEvent: { _enum: { @@ -1022,7 +1058,7 @@ export default { } }, /** - * Lookup96: pallet_structure::pallet::Event + * Lookup100: pallet_structure::pallet::Event **/ PalletStructureEvent: { _enum: { @@ -1030,7 +1066,7 @@ export default { } }, /** - * Lookup97: pallet_rmrk_core::pallet::Event + * Lookup101: pallet_rmrk_core::pallet::Event **/ PalletRmrkCoreEvent: { _enum: { @@ -1107,7 +1143,7 @@ export default { } }, /** - * Lookup98: rmrk_traits::nft::AccountIdOrCollectionNftTuple + * Lookup102: rmrk_traits::nft::AccountIdOrCollectionNftTuple **/ RmrkTraitsNftAccountIdOrCollectionNftTuple: { _enum: { @@ -1116,7 +1152,7 @@ export default { } }, /** - * Lookup103: pallet_rmrk_equip::pallet::Event + * Lookup107: pallet_rmrk_equip::pallet::Event **/ PalletRmrkEquipEvent: { _enum: { @@ -1131,7 +1167,7 @@ export default { } }, /** - * Lookup104: pallet_app_promotion::pallet::Event + * Lookup108: pallet_app_promotion::pallet::Event **/ PalletAppPromotionEvent: { _enum: { @@ -1142,7 +1178,7 @@ export default { } }, /** - * Lookup105: pallet_foreign_assets::module::Event + * Lookup109: pallet_foreign_assets::module::Event **/ PalletForeignAssetsModuleEvent: { _enum: { @@ -1167,7 +1203,7 @@ export default { } }, /** - * Lookup106: pallet_foreign_assets::module::AssetMetadata + * Lookup110: pallet_foreign_assets::module::AssetMetadata **/ PalletForeignAssetsModuleAssetMetadata: { name: 'Bytes', @@ -1176,7 +1212,7 @@ export default { minimalBalance: 'u128' }, /** - * Lookup107: pallet_evm::pallet::Event + * Lookup111: pallet_evm::pallet::Event **/ PalletEvmEvent: { _enum: { @@ -1190,7 +1226,7 @@ export default { } }, /** - * Lookup108: ethereum::log::Log + * Lookup112: ethereum::log::Log **/ EthereumLog: { address: 'H160', @@ -1198,7 +1234,7 @@ export default { data: 'Bytes' }, /** - * Lookup112: pallet_ethereum::pallet::Event + * Lookup116: pallet_ethereum::pallet::Event **/ PalletEthereumEvent: { _enum: { @@ -1206,7 +1242,7 @@ export default { } }, /** - * Lookup113: evm_core::error::ExitReason + * Lookup117: evm_core::error::ExitReason **/ EvmCoreErrorExitReason: { _enum: { @@ -1217,13 +1253,13 @@ export default { } }, /** - * Lookup114: evm_core::error::ExitSucceed + * Lookup118: evm_core::error::ExitSucceed **/ EvmCoreErrorExitSucceed: { _enum: ['Stopped', 'Returned', 'Suicided'] }, /** - * Lookup115: evm_core::error::ExitError + * Lookup119: evm_core::error::ExitError **/ EvmCoreErrorExitError: { _enum: { @@ -1245,13 +1281,13 @@ export default { } }, /** - * Lookup118: evm_core::error::ExitRevert + * Lookup122: evm_core::error::ExitRevert **/ EvmCoreErrorExitRevert: { _enum: ['Reverted'] }, /** - * Lookup119: evm_core::error::ExitFatal + * Lookup123: evm_core::error::ExitFatal **/ EvmCoreErrorExitFatal: { _enum: { @@ -1262,7 +1298,7 @@ export default { } }, /** - * Lookup120: pallet_evm_contract_helpers::pallet::Event + * Lookup124: pallet_evm_contract_helpers::pallet::Event **/ PalletEvmContractHelpersEvent: { _enum: { @@ -1272,7 +1308,19 @@ export default { } }, /** - * Lookup121: frame_system::Phase + * Lookup125: pallet_maintenance::pallet::Event + **/ + PalletMaintenanceEvent: { + _enum: ['MaintenanceEnabled', 'MaintenanceDisabled'] + }, + /** + * Lookup126: pallet_test_utils::pallet::Event + **/ + PalletTestUtilsEvent: { + _enum: ['ValueIsSet', 'ShouldRollback'] + }, + /** + * Lookup127: frame_system::Phase **/ FrameSystemPhase: { _enum: { @@ -1282,14 +1330,14 @@ export default { } }, /** - * Lookup124: frame_system::LastRuntimeUpgradeInfo + * Lookup129: frame_system::LastRuntimeUpgradeInfo **/ FrameSystemLastRuntimeUpgradeInfo: { specVersion: 'Compact', specName: 'Text' }, /** - * Lookup125: frame_system::pallet::Call + * Lookup130: frame_system::pallet::Call **/ FrameSystemCall: { _enum: { @@ -1327,7 +1375,7 @@ export default { } }, /** - * Lookup130: frame_system::limits::BlockWeights + * Lookup135: frame_system::limits::BlockWeights **/ FrameSystemLimitsBlockWeights: { baseBlock: 'Weight', @@ -1335,7 +1383,7 @@ export default { perClass: 'FrameSupportDispatchPerDispatchClassWeightsPerClass' }, /** - * Lookup131: frame_support::dispatch::PerDispatchClass + * Lookup136: frame_support::dispatch::PerDispatchClass **/ FrameSupportDispatchPerDispatchClassWeightsPerClass: { normal: 'FrameSystemLimitsWeightsPerClass', @@ -1343,7 +1391,7 @@ export default { mandatory: 'FrameSystemLimitsWeightsPerClass' }, /** - * Lookup132: frame_system::limits::WeightsPerClass + * Lookup137: frame_system::limits::WeightsPerClass **/ FrameSystemLimitsWeightsPerClass: { baseExtrinsic: 'Weight', @@ -1352,13 +1400,13 @@ export default { reserved: 'Option' }, /** - * Lookup134: frame_system::limits::BlockLength + * Lookup139: frame_system::limits::BlockLength **/ FrameSystemLimitsBlockLength: { max: 'FrameSupportDispatchPerDispatchClassU32' }, /** - * Lookup135: frame_support::dispatch::PerDispatchClass + * Lookup140: frame_support::dispatch::PerDispatchClass **/ FrameSupportDispatchPerDispatchClassU32: { normal: 'u32', @@ -1366,14 +1414,14 @@ export default { mandatory: 'u32' }, /** - * Lookup136: sp_weights::RuntimeDbWeight + * Lookup141: sp_weights::RuntimeDbWeight **/ SpWeightsRuntimeDbWeight: { read: 'u64', write: 'u64' }, /** - * Lookup137: sp_version::RuntimeVersion + * Lookup142: sp_version::RuntimeVersion **/ SpVersionRuntimeVersion: { specName: 'Text', @@ -1386,13 +1434,13 @@ export default { stateVersion: 'u8' }, /** - * Lookup142: frame_system::pallet::Error + * Lookup147: frame_system::pallet::Error **/ FrameSystemError: { _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered'] }, /** - * Lookup143: polkadot_primitives::v2::PersistedValidationData + * Lookup148: polkadot_primitives::v2::PersistedValidationData **/ PolkadotPrimitivesV2PersistedValidationData: { parentHead: 'Bytes', @@ -1401,19 +1449,19 @@ export default { maxPovSize: 'u32' }, /** - * Lookup146: polkadot_primitives::v2::UpgradeRestriction + * Lookup151: polkadot_primitives::v2::UpgradeRestriction **/ PolkadotPrimitivesV2UpgradeRestriction: { _enum: ['Present'] }, /** - * Lookup147: sp_trie::storage_proof::StorageProof + * Lookup152: sp_trie::storage_proof::StorageProof **/ SpTrieStorageProof: { trieNodes: 'BTreeSet' }, /** - * Lookup149: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot + * Lookup154: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot **/ CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: { dmqMqcHead: 'H256', @@ -1422,7 +1470,7 @@ export default { egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>' }, /** - * Lookup152: polkadot_primitives::v2::AbridgedHrmpChannel + * Lookup157: polkadot_primitives::v2::AbridgedHrmpChannel **/ PolkadotPrimitivesV2AbridgedHrmpChannel: { maxCapacity: 'u32', @@ -1433,7 +1481,7 @@ export default { mqcHead: 'Option' }, /** - * Lookup153: polkadot_primitives::v2::AbridgedHostConfiguration + * Lookup158: polkadot_primitives::v2::AbridgedHostConfiguration **/ PolkadotPrimitivesV2AbridgedHostConfiguration: { maxCodeSize: 'u32', @@ -1447,14 +1495,14 @@ export default { validationUpgradeDelay: 'u32' }, /** - * Lookup159: polkadot_core_primitives::OutboundHrmpMessage + * Lookup164: polkadot_core_primitives::OutboundHrmpMessage **/ PolkadotCorePrimitivesOutboundHrmpMessage: { recipient: 'u32', data: 'Bytes' }, /** - * Lookup160: cumulus_pallet_parachain_system::pallet::Call + * Lookup165: cumulus_pallet_parachain_system::pallet::Call **/ CumulusPalletParachainSystemCall: { _enum: { @@ -1473,7 +1521,7 @@ export default { } }, /** - * Lookup161: cumulus_primitives_parachain_inherent::ParachainInherentData + * Lookup166: cumulus_primitives_parachain_inherent::ParachainInherentData **/ CumulusPrimitivesParachainInherentParachainInherentData: { validationData: 'PolkadotPrimitivesV2PersistedValidationData', @@ -1482,27 +1530,27 @@ export default { horizontalMessages: 'BTreeMap>' }, /** - * Lookup163: polkadot_core_primitives::InboundDownwardMessage + * Lookup168: polkadot_core_primitives::InboundDownwardMessage **/ PolkadotCorePrimitivesInboundDownwardMessage: { sentAt: 'u32', msg: 'Bytes' }, /** - * Lookup166: polkadot_core_primitives::InboundHrmpMessage + * Lookup171: polkadot_core_primitives::InboundHrmpMessage **/ PolkadotCorePrimitivesInboundHrmpMessage: { sentAt: 'u32', data: 'Bytes' }, /** - * Lookup169: cumulus_pallet_parachain_system::pallet::Error + * Lookup174: cumulus_pallet_parachain_system::pallet::Error **/ CumulusPalletParachainSystemError: { _enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized'] }, /** - * Lookup171: pallet_balances::BalanceLock + * Lookup176: pallet_balances::BalanceLock **/ PalletBalancesBalanceLock: { id: '[u8;8]', @@ -1510,26 +1558,26 @@ export default { reasons: 'PalletBalancesReasons' }, /** - * Lookup172: pallet_balances::Reasons + * Lookup177: pallet_balances::Reasons **/ PalletBalancesReasons: { _enum: ['Fee', 'Misc', 'All'] }, /** - * Lookup175: pallet_balances::ReserveData + * Lookup180: pallet_balances::ReserveData **/ PalletBalancesReserveData: { id: '[u8;16]', amount: 'u128' }, /** - * Lookup177: pallet_balances::Releases + * Lookup182: pallet_balances::Releases **/ PalletBalancesReleases: { _enum: ['V1_0_0', 'V2_0_0'] }, /** - * Lookup178: pallet_balances::pallet::Call + * Lookup183: pallet_balances::pallet::Call **/ PalletBalancesCall: { _enum: { @@ -1562,13 +1610,13 @@ export default { } }, /** - * Lookup181: pallet_balances::pallet::Error + * Lookup186: pallet_balances::pallet::Error **/ PalletBalancesError: { _enum: ['VestingBalance', 'LiquidityRestrictions', 'InsufficientBalance', 'ExistentialDeposit', 'KeepAlive', 'ExistingVestingSchedule', 'DeadAccount', 'TooManyReserves'] }, /** - * Lookup183: pallet_timestamp::pallet::Call + * Lookup188: pallet_timestamp::pallet::Call **/ PalletTimestampCall: { _enum: { @@ -1578,13 +1626,13 @@ export default { } }, /** - * Lookup185: pallet_transaction_payment::Releases + * Lookup190: pallet_transaction_payment::Releases **/ PalletTransactionPaymentReleases: { _enum: ['V1Ancient', 'V2'] }, /** - * Lookup186: pallet_treasury::Proposal + * Lookup191: pallet_treasury::Proposal **/ PalletTreasuryProposal: { proposer: 'AccountId32', @@ -1593,7 +1641,7 @@ export default { bond: 'u128' }, /** - * Lookup189: pallet_treasury::pallet::Call + * Lookup194: pallet_treasury::pallet::Call **/ PalletTreasuryCall: { _enum: { @@ -1617,17 +1665,17 @@ export default { } }, /** - * Lookup192: frame_support::PalletId + * Lookup197: frame_support::PalletId **/ FrameSupportPalletId: '[u8;8]', /** - * Lookup193: pallet_treasury::pallet::Error + * Lookup198: pallet_treasury::pallet::Error **/ PalletTreasuryError: { _enum: ['InsufficientProposersBalance', 'InvalidIndex', 'TooManyApprovals', 'InsufficientPermission', 'ProposalNotApproved'] }, /** - * Lookup194: pallet_sudo::pallet::Call + * Lookup199: pallet_sudo::pallet::Call **/ PalletSudoCall: { _enum: { @@ -1651,7 +1699,7 @@ export default { } }, /** - * Lookup196: orml_vesting::module::Call + * Lookup201: orml_vesting::module::Call **/ OrmlVestingModuleCall: { _enum: { @@ -1670,7 +1718,7 @@ export default { } }, /** - * Lookup198: orml_xtokens::module::Call + * Lookup203: orml_xtokens::module::Call **/ OrmlXtokensModuleCall: { _enum: { @@ -1713,7 +1761,7 @@ export default { } }, /** - * Lookup199: xcm::VersionedMultiAsset + * Lookup204: xcm::VersionedMultiAsset **/ XcmVersionedMultiAsset: { _enum: { @@ -1722,7 +1770,7 @@ export default { } }, /** - * Lookup202: orml_tokens::module::Call + * Lookup207: orml_tokens::module::Call **/ OrmlTokensModuleCall: { _enum: { @@ -1756,7 +1804,7 @@ export default { } }, /** - * Lookup203: cumulus_pallet_xcmp_queue::pallet::Call + * Lookup208: cumulus_pallet_xcmp_queue::pallet::Call **/ CumulusPalletXcmpQueueCall: { _enum: { @@ -1805,7 +1853,7 @@ export default { } }, /** - * Lookup204: pallet_xcm::pallet::Call + * Lookup209: pallet_xcm::pallet::Call **/ PalletXcmCall: { _enum: { @@ -1859,7 +1907,7 @@ export default { } }, /** - * Lookup205: xcm::VersionedXcm + * Lookup210: xcm::VersionedXcm **/ XcmVersionedXcm: { _enum: { @@ -1869,7 +1917,7 @@ export default { } }, /** - * Lookup206: xcm::v0::Xcm + * Lookup211: xcm::v0::Xcm **/ XcmV0Xcm: { _enum: { @@ -1923,7 +1971,7 @@ export default { } }, /** - * Lookup208: xcm::v0::order::Order + * Lookup213: xcm::v0::order::Order **/ XcmV0Order: { _enum: { @@ -1966,7 +2014,7 @@ export default { } }, /** - * Lookup210: xcm::v0::Response + * Lookup215: xcm::v0::Response **/ XcmV0Response: { _enum: { @@ -1974,7 +2022,7 @@ export default { } }, /** - * Lookup211: xcm::v1::Xcm + * Lookup216: xcm::v1::Xcm **/ XcmV1Xcm: { _enum: { @@ -2033,7 +2081,7 @@ export default { } }, /** - * Lookup213: xcm::v1::order::Order + * Lookup218: xcm::v1::order::Order **/ XcmV1Order: { _enum: { @@ -2078,7 +2126,7 @@ export default { } }, /** - * Lookup215: xcm::v1::Response + * Lookup220: xcm::v1::Response **/ XcmV1Response: { _enum: { @@ -2087,11 +2135,11 @@ export default { } }, /** - * Lookup229: cumulus_pallet_xcm::pallet::Call + * Lookup234: cumulus_pallet_xcm::pallet::Call **/ CumulusPalletXcmCall: 'Null', /** - * Lookup230: cumulus_pallet_dmp_queue::pallet::Call + * Lookup235: cumulus_pallet_dmp_queue::pallet::Call **/ CumulusPalletDmpQueueCall: { _enum: { @@ -2102,7 +2150,7 @@ export default { } }, /** - * Lookup231: pallet_inflation::pallet::Call + * Lookup236: pallet_inflation::pallet::Call **/ PalletInflationCall: { _enum: { @@ -2112,7 +2160,7 @@ export default { } }, /** - * Lookup232: pallet_unique::Call + * Lookup237: pallet_unique::Call **/ PalletUniqueCall: { _enum: { @@ -2244,7 +2292,7 @@ export default { } }, /** - * Lookup237: up_data_structs::CollectionMode + * Lookup242: up_data_structs::CollectionMode **/ UpDataStructsCollectionMode: { _enum: { @@ -2254,7 +2302,7 @@ export default { } }, /** - * Lookup238: up_data_structs::CreateCollectionData + * Lookup243: up_data_structs::CreateCollectionData **/ UpDataStructsCreateCollectionData: { mode: 'UpDataStructsCollectionMode', @@ -2269,13 +2317,13 @@ export default { properties: 'Vec' }, /** - * Lookup240: up_data_structs::AccessMode + * Lookup245: up_data_structs::AccessMode **/ UpDataStructsAccessMode: { _enum: ['Normal', 'AllowList'] }, /** - * Lookup242: up_data_structs::CollectionLimits + * Lookup247: up_data_structs::CollectionLimits **/ UpDataStructsCollectionLimits: { accountTokenOwnershipLimit: 'Option', @@ -2289,7 +2337,7 @@ export default { transfersEnabled: 'Option' }, /** - * Lookup244: up_data_structs::SponsoringRateLimit + * Lookup249: up_data_structs::SponsoringRateLimit **/ UpDataStructsSponsoringRateLimit: { _enum: { @@ -2298,7 +2346,7 @@ export default { } }, /** - * Lookup247: up_data_structs::CollectionPermissions + * Lookup252: up_data_structs::CollectionPermissions **/ UpDataStructsCollectionPermissions: { access: 'Option', @@ -2306,7 +2354,7 @@ export default { nesting: 'Option' }, /** - * Lookup249: up_data_structs::NestingPermissions + * Lookup254: up_data_structs::NestingPermissions **/ UpDataStructsNestingPermissions: { tokenOwner: 'bool', @@ -2314,18 +2362,18 @@ export default { restricted: 'Option' }, /** - * Lookup251: up_data_structs::OwnerRestrictedSet + * Lookup256: up_data_structs::OwnerRestrictedSet **/ UpDataStructsOwnerRestrictedSet: 'BTreeSet', /** - * Lookup256: up_data_structs::PropertyKeyPermission + * Lookup261: up_data_structs::PropertyKeyPermission **/ UpDataStructsPropertyKeyPermission: { key: 'Bytes', permission: 'UpDataStructsPropertyPermission' }, /** - * Lookup257: up_data_structs::PropertyPermission + * Lookup262: up_data_structs::PropertyPermission **/ UpDataStructsPropertyPermission: { mutable: 'bool', @@ -2333,14 +2381,14 @@ export default { tokenOwner: 'bool' }, /** - * Lookup260: up_data_structs::Property + * Lookup265: up_data_structs::Property **/ UpDataStructsProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup263: up_data_structs::CreateItemData + * Lookup268: up_data_structs::CreateItemData **/ UpDataStructsCreateItemData: { _enum: { @@ -2350,26 +2398,26 @@ export default { } }, /** - * Lookup264: up_data_structs::CreateNftData + * Lookup269: up_data_structs::CreateNftData **/ UpDataStructsCreateNftData: { properties: 'Vec' }, /** - * Lookup265: up_data_structs::CreateFungibleData + * Lookup270: up_data_structs::CreateFungibleData **/ UpDataStructsCreateFungibleData: { value: 'u128' }, /** - * Lookup266: up_data_structs::CreateReFungibleData + * Lookup271: up_data_structs::CreateReFungibleData **/ UpDataStructsCreateReFungibleData: { pieces: 'u128', properties: 'Vec' }, /** - * Lookup269: up_data_structs::CreateItemExData> + * Lookup274: up_data_structs::CreateItemExData> **/ UpDataStructsCreateItemExData: { _enum: { @@ -2380,14 +2428,14 @@ export default { } }, /** - * Lookup271: up_data_structs::CreateNftExData> + * Lookup276: up_data_structs::CreateNftExData> **/ UpDataStructsCreateNftExData: { properties: 'Vec', owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup278: up_data_structs::CreateRefungibleExSingleOwner> + * Lookup283: up_data_structs::CreateRefungibleExSingleOwner> **/ UpDataStructsCreateRefungibleExSingleOwner: { user: 'PalletEvmAccountBasicCrossAccountIdRepr', @@ -2395,14 +2443,51 @@ export default { properties: 'Vec' }, /** - * Lookup280: up_data_structs::CreateRefungibleExMultipleOwners> + * Lookup285: up_data_structs::CreateRefungibleExMultipleOwners> **/ UpDataStructsCreateRefungibleExMultipleOwners: { users: 'BTreeMap', properties: 'Vec' }, /** - * Lookup281: pallet_configuration::pallet::Call + * Lookup286: pallet_unique_scheduler::pallet::Call + **/ + PalletUniqueSchedulerCall: { + _enum: { + schedule_named: { + id: '[u8;16]', + when: 'u32', + maybePeriodic: 'Option<(u32,u32)>', + priority: 'Option', + call: 'FrameSupportScheduleMaybeHashed', + }, + cancel_named: { + id: '[u8;16]', + }, + schedule_named_after: { + id: '[u8;16]', + after: 'u32', + maybePeriodic: 'Option<(u32,u32)>', + priority: 'Option', + call: 'FrameSupportScheduleMaybeHashed', + }, + change_named_priority: { + id: '[u8;16]', + priority: 'u8' + } + } + }, + /** + * Lookup289: frame_support::traits::schedule::MaybeHashed + **/ + FrameSupportScheduleMaybeHashed: { + _enum: { + Value: 'Call', + Hash: 'H256' + } + }, + /** + * Lookup290: pallet_configuration::pallet::Call **/ PalletConfigurationCall: { _enum: { @@ -2415,15 +2500,15 @@ export default { } }, /** - * Lookup283: pallet_template_transaction_payment::Call + * Lookup292: pallet_template_transaction_payment::Call **/ PalletTemplateTransactionPaymentCall: 'Null', /** - * Lookup284: pallet_structure::pallet::Call + * Lookup293: pallet_structure::pallet::Call **/ PalletStructureCall: 'Null', /** - * Lookup285: pallet_rmrk_core::pallet::Call + * Lookup294: pallet_rmrk_core::pallet::Call **/ PalletRmrkCoreCall: { _enum: { @@ -2514,7 +2599,7 @@ export default { } }, /** - * Lookup291: rmrk_traits::resource::ResourceTypes, sp_core::bounded::bounded_vec::BoundedVec> + * Lookup300: rmrk_traits::resource::ResourceTypes, sp_core::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceTypes: { _enum: { @@ -2524,7 +2609,7 @@ export default { } }, /** - * Lookup293: rmrk_traits::resource::BasicResource> + * Lookup302: rmrk_traits::resource::BasicResource> **/ RmrkTraitsResourceBasicResource: { src: 'Option', @@ -2533,7 +2618,7 @@ export default { thumb: 'Option' }, /** - * Lookup295: rmrk_traits::resource::ComposableResource, sp_core::bounded::bounded_vec::BoundedVec> + * Lookup304: rmrk_traits::resource::ComposableResource, sp_core::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceComposableResource: { parts: 'Vec', @@ -2544,7 +2629,7 @@ export default { thumb: 'Option' }, /** - * Lookup296: rmrk_traits::resource::SlotResource> + * Lookup305: rmrk_traits::resource::SlotResource> **/ RmrkTraitsResourceSlotResource: { base: 'u32', @@ -2555,7 +2640,7 @@ export default { thumb: 'Option' }, /** - * Lookup299: pallet_rmrk_equip::pallet::Call + * Lookup308: pallet_rmrk_equip::pallet::Call **/ PalletRmrkEquipCall: { _enum: { @@ -2576,7 +2661,7 @@ export default { } }, /** - * Lookup302: rmrk_traits::part::PartType, sp_core::bounded::bounded_vec::BoundedVec> + * Lookup311: rmrk_traits::part::PartType, sp_core::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPartPartType: { _enum: { @@ -2585,7 +2670,7 @@ export default { } }, /** - * Lookup304: rmrk_traits::part::FixedPart> + * Lookup313: rmrk_traits::part::FixedPart> **/ RmrkTraitsPartFixedPart: { id: 'u32', @@ -2593,7 +2678,7 @@ export default { src: 'Bytes' }, /** - * Lookup305: rmrk_traits::part::SlotPart, sp_core::bounded::bounded_vec::BoundedVec> + * Lookup314: rmrk_traits::part::SlotPart, sp_core::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPartSlotPart: { id: 'u32', @@ -2602,7 +2687,7 @@ export default { z: 'u32' }, /** - * Lookup306: rmrk_traits::part::EquippableList> + * Lookup315: rmrk_traits::part::EquippableList> **/ RmrkTraitsPartEquippableList: { _enum: { @@ -2612,7 +2697,7 @@ export default { } }, /** - * Lookup308: rmrk_traits::theme::Theme, sp_core::bounded::bounded_vec::BoundedVec>, S>> + * Lookup317: rmrk_traits::theme::Theme, sp_core::bounded::bounded_vec::BoundedVec>, S>> **/ RmrkTraitsTheme: { name: 'Bytes', @@ -2620,14 +2705,14 @@ export default { inherit: 'bool' }, /** - * Lookup310: rmrk_traits::theme::ThemeProperty> + * Lookup319: rmrk_traits::theme::ThemeProperty> **/ RmrkTraitsThemeThemeProperty: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup312: pallet_app_promotion::pallet::Call + * Lookup321: pallet_app_promotion::pallet::Call **/ PalletAppPromotionCall: { _enum: { @@ -2656,7 +2741,7 @@ export default { } }, /** - * Lookup314: pallet_foreign_assets::module::Call + * Lookup322: pallet_foreign_assets::module::Call **/ PalletForeignAssetsModuleCall: { _enum: { @@ -2673,7 +2758,7 @@ export default { } }, /** - * Lookup315: pallet_evm::pallet::Call + * Lookup323: pallet_evm::pallet::Call **/ PalletEvmCall: { _enum: { @@ -2716,7 +2801,7 @@ export default { } }, /** - * Lookup319: pallet_ethereum::pallet::Call + * Lookup327: pallet_ethereum::pallet::Call **/ PalletEthereumCall: { _enum: { @@ -2726,7 +2811,7 @@ export default { } }, /** - * Lookup320: ethereum::transaction::TransactionV2 + * Lookup328: ethereum::transaction::TransactionV2 **/ EthereumTransactionTransactionV2: { _enum: { @@ -2736,7 +2821,7 @@ export default { } }, /** - * Lookup321: ethereum::transaction::LegacyTransaction + * Lookup329: ethereum::transaction::LegacyTransaction **/ EthereumTransactionLegacyTransaction: { nonce: 'U256', @@ -2748,7 +2833,7 @@ export default { signature: 'EthereumTransactionTransactionSignature' }, /** - * Lookup322: ethereum::transaction::TransactionAction + * Lookup330: ethereum::transaction::TransactionAction **/ EthereumTransactionTransactionAction: { _enum: { @@ -2757,7 +2842,7 @@ export default { } }, /** - * Lookup323: ethereum::transaction::TransactionSignature + * Lookup331: ethereum::transaction::TransactionSignature **/ EthereumTransactionTransactionSignature: { v: 'u64', @@ -2765,7 +2850,7 @@ export default { s: 'H256' }, /** - * Lookup325: ethereum::transaction::EIP2930Transaction + * Lookup333: ethereum::transaction::EIP2930Transaction **/ EthereumTransactionEip2930Transaction: { chainId: 'u64', @@ -2781,14 +2866,14 @@ export default { s: 'H256' }, /** - * Lookup327: ethereum::transaction::AccessListItem + * Lookup335: ethereum::transaction::AccessListItem **/ EthereumTransactionAccessListItem: { address: 'H160', storageKeys: 'Vec' }, /** - * Lookup328: ethereum::transaction::EIP1559Transaction + * Lookup336: ethereum::transaction::EIP1559Transaction **/ EthereumTransactionEip1559Transaction: { chainId: 'u64', @@ -2805,7 +2890,7 @@ export default { s: 'H256' }, /** - * Lookup329: pallet_evm_migration::pallet::Call + * Lookup337: pallet_evm_migration::pallet::Call **/ PalletEvmMigrationCall: { _enum: { @@ -2823,32 +2908,58 @@ export default { } }, /** - * Lookup332: pallet_sudo::pallet::Error + * Lookup340: pallet_maintenance::pallet::Call + **/ + PalletMaintenanceCall: { + _enum: ['enable', 'disable'] + }, + /** + * Lookup341: pallet_test_utils::pallet::Call + **/ + PalletTestUtilsCall: { + _enum: { + enable: 'Null', + set_test_value: { + value: 'u32', + }, + set_test_value_and_rollback: { + value: 'u32', + }, + inc_test_value: 'Null', + self_canceling_inc: { + id: '[u8;16]', + maxTestValue: 'u32', + }, + just_take_fee: 'Null' + } + }, + /** + * Lookup342: pallet_sudo::pallet::Error **/ PalletSudoError: { _enum: ['RequireSudo'] }, /** - * Lookup334: orml_vesting::module::Error + * Lookup344: orml_vesting::module::Error **/ OrmlVestingModuleError: { _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded'] }, /** - * Lookup335: orml_xtokens::module::Error + * Lookup345: orml_xtokens::module::Error **/ OrmlXtokensModuleError: { _enum: ['AssetHasNoReserve', 'NotCrossChainTransfer', 'InvalidDest', 'NotCrossChainTransferableCurrency', 'UnweighableMessage', 'XcmExecutionFailed', 'CannotReanchor', 'InvalidAncestry', 'InvalidAsset', 'DestinationNotInvertible', 'BadVersion', 'DistinctReserveForAssetAndFee', 'ZeroFee', 'ZeroAmount', 'TooManyAssetsBeingSent', 'AssetIndexNonExistent', 'FeeNotEnough', 'NotSupportedMultiLocation', 'MinXcmFeeNotDefined'] }, /** - * Lookup338: orml_tokens::BalanceLock + * Lookup348: orml_tokens::BalanceLock **/ OrmlTokensBalanceLock: { id: '[u8;8]', amount: 'u128' }, /** - * Lookup340: orml_tokens::AccountData + * Lookup350: orml_tokens::AccountData **/ OrmlTokensAccountData: { free: 'u128', @@ -2856,20 +2967,20 @@ export default { frozen: 'u128' }, /** - * Lookup342: orml_tokens::ReserveData + * Lookup352: orml_tokens::ReserveData **/ OrmlTokensReserveData: { id: 'Null', amount: 'u128' }, /** - * Lookup344: orml_tokens::module::Error + * Lookup354: orml_tokens::module::Error **/ OrmlTokensModuleError: { _enum: ['BalanceTooLow', 'AmountIntoBalanceFailed', 'LiquidityRestrictions', 'MaxLocksExceeded', 'KeepAlive', 'ExistentialDeposit', 'DeadAccount', 'TooManyReserves'] }, /** - * Lookup346: cumulus_pallet_xcmp_queue::InboundChannelDetails + * Lookup356: cumulus_pallet_xcmp_queue::InboundChannelDetails **/ CumulusPalletXcmpQueueInboundChannelDetails: { sender: 'u32', @@ -2877,19 +2988,19 @@ export default { messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>' }, /** - * Lookup347: cumulus_pallet_xcmp_queue::InboundState + * Lookup357: cumulus_pallet_xcmp_queue::InboundState **/ CumulusPalletXcmpQueueInboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup350: polkadot_parachain::primitives::XcmpMessageFormat + * Lookup360: polkadot_parachain::primitives::XcmpMessageFormat **/ PolkadotParachainPrimitivesXcmpMessageFormat: { _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals'] }, /** - * Lookup353: cumulus_pallet_xcmp_queue::OutboundChannelDetails + * Lookup363: cumulus_pallet_xcmp_queue::OutboundChannelDetails **/ CumulusPalletXcmpQueueOutboundChannelDetails: { recipient: 'u32', @@ -2899,13 +3010,13 @@ export default { lastIndex: 'u16' }, /** - * Lookup354: cumulus_pallet_xcmp_queue::OutboundState + * Lookup364: cumulus_pallet_xcmp_queue::OutboundState **/ CumulusPalletXcmpQueueOutboundState: { _enum: ['Ok', 'Suspended'] }, /** - * Lookup356: cumulus_pallet_xcmp_queue::QueueConfigData + * Lookup366: cumulus_pallet_xcmp_queue::QueueConfigData **/ CumulusPalletXcmpQueueQueueConfigData: { suspendThreshold: 'u32', @@ -2916,29 +3027,29 @@ export default { xcmpMaxIndividualWeight: 'Weight' }, /** - * Lookup358: cumulus_pallet_xcmp_queue::pallet::Error + * Lookup368: cumulus_pallet_xcmp_queue::pallet::Error **/ CumulusPalletXcmpQueueError: { _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit'] }, /** - * Lookup359: pallet_xcm::pallet::Error + * Lookup369: pallet_xcm::pallet::Error **/ PalletXcmError: { _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed'] }, /** - * Lookup360: cumulus_pallet_xcm::pallet::Error + * Lookup370: cumulus_pallet_xcm::pallet::Error **/ CumulusPalletXcmError: 'Null', /** - * Lookup361: cumulus_pallet_dmp_queue::ConfigData + * Lookup371: cumulus_pallet_dmp_queue::ConfigData **/ CumulusPalletDmpQueueConfigData: { maxIndividual: 'Weight' }, /** - * Lookup362: cumulus_pallet_dmp_queue::PageIndexData + * Lookup372: cumulus_pallet_dmp_queue::PageIndexData **/ CumulusPalletDmpQueuePageIndexData: { beginUsed: 'u32', @@ -2946,19 +3057,184 @@ export default { overweightCount: 'u64' }, /** - * Lookup365: cumulus_pallet_dmp_queue::pallet::Error + * Lookup375: cumulus_pallet_dmp_queue::pallet::Error **/ CumulusPalletDmpQueueError: { _enum: ['Unknown', 'OverLimit'] }, /** - * Lookup369: pallet_unique::Error + * Lookup379: pallet_unique::Error **/ PalletUniqueError: { _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection'] }, /** - * Lookup370: up_data_structs::Collection + * Lookup382: pallet_unique_scheduler::ScheduledV3, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32> + **/ + PalletUniqueSchedulerScheduledV3: { + maybeId: 'Option<[u8;16]>', + priority: 'u8', + call: 'FrameSupportScheduleMaybeHashed', + maybePeriodic: 'Option<(u32,u32)>', + origin: 'OpalRuntimeOriginCaller' + }, + /** + * Lookup383: opal_runtime::OriginCaller + **/ + OpalRuntimeOriginCaller: { + _enum: { + system: 'FrameSupportDispatchRawOrigin', + __Unused1: 'Null', + __Unused2: 'Null', + __Unused3: 'Null', + Void: 'SpCoreVoid', + __Unused5: 'Null', + __Unused6: 'Null', + __Unused7: 'Null', + __Unused8: 'Null', + __Unused9: 'Null', + __Unused10: 'Null', + __Unused11: 'Null', + __Unused12: 'Null', + __Unused13: 'Null', + __Unused14: 'Null', + __Unused15: 'Null', + __Unused16: 'Null', + __Unused17: 'Null', + __Unused18: 'Null', + __Unused19: 'Null', + __Unused20: 'Null', + __Unused21: 'Null', + __Unused22: 'Null', + __Unused23: 'Null', + __Unused24: 'Null', + __Unused25: 'Null', + __Unused26: 'Null', + __Unused27: 'Null', + __Unused28: 'Null', + __Unused29: 'Null', + __Unused30: 'Null', + __Unused31: 'Null', + __Unused32: 'Null', + __Unused33: 'Null', + __Unused34: 'Null', + __Unused35: 'Null', + __Unused36: 'Null', + __Unused37: 'Null', + __Unused38: 'Null', + __Unused39: 'Null', + __Unused40: 'Null', + __Unused41: 'Null', + __Unused42: 'Null', + __Unused43: 'Null', + __Unused44: 'Null', + __Unused45: 'Null', + __Unused46: 'Null', + __Unused47: 'Null', + __Unused48: 'Null', + __Unused49: 'Null', + __Unused50: 'Null', + PolkadotXcm: 'PalletXcmOrigin', + CumulusXcm: 'CumulusPalletXcmOrigin', + __Unused53: 'Null', + __Unused54: 'Null', + __Unused55: 'Null', + __Unused56: 'Null', + __Unused57: 'Null', + __Unused58: 'Null', + __Unused59: 'Null', + __Unused60: 'Null', + __Unused61: 'Null', + __Unused62: 'Null', + __Unused63: 'Null', + __Unused64: 'Null', + __Unused65: 'Null', + __Unused66: 'Null', + __Unused67: 'Null', + __Unused68: 'Null', + __Unused69: 'Null', + __Unused70: 'Null', + __Unused71: 'Null', + __Unused72: 'Null', + __Unused73: 'Null', + __Unused74: 'Null', + __Unused75: 'Null', + __Unused76: 'Null', + __Unused77: 'Null', + __Unused78: 'Null', + __Unused79: 'Null', + __Unused80: 'Null', + __Unused81: 'Null', + __Unused82: 'Null', + __Unused83: 'Null', + __Unused84: 'Null', + __Unused85: 'Null', + __Unused86: 'Null', + __Unused87: 'Null', + __Unused88: 'Null', + __Unused89: 'Null', + __Unused90: 'Null', + __Unused91: 'Null', + __Unused92: 'Null', + __Unused93: 'Null', + __Unused94: 'Null', + __Unused95: 'Null', + __Unused96: 'Null', + __Unused97: 'Null', + __Unused98: 'Null', + __Unused99: 'Null', + __Unused100: 'Null', + Ethereum: 'PalletEthereumRawOrigin' + } + }, + /** + * Lookup384: frame_support::dispatch::RawOrigin + **/ + FrameSupportDispatchRawOrigin: { + _enum: { + Root: 'Null', + Signed: 'AccountId32', + None: 'Null' + } + }, + /** + * Lookup385: pallet_xcm::pallet::Origin + **/ + PalletXcmOrigin: { + _enum: { + Xcm: 'XcmV1MultiLocation', + Response: 'XcmV1MultiLocation' + } + }, + /** + * Lookup386: cumulus_pallet_xcm::pallet::Origin + **/ + CumulusPalletXcmOrigin: { + _enum: { + Relay: 'Null', + SiblingParachain: 'u32' + } + }, + /** + * Lookup387: pallet_ethereum::RawOrigin + **/ + PalletEthereumRawOrigin: { + _enum: { + EthereumTransaction: 'H160' + } + }, + /** + * Lookup388: sp_core::Void + **/ + SpCoreVoid: 'Null', + /** + * Lookup389: pallet_unique_scheduler::pallet::Error + **/ + PalletUniqueSchedulerError: { + _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange'] + }, + /** + * Lookup390: up_data_structs::Collection **/ UpDataStructsCollection: { owner: 'AccountId32', @@ -2972,7 +3248,7 @@ export default { flags: '[u8;1]' }, /** - * Lookup371: up_data_structs::SponsorshipState + * Lookup391: up_data_structs::SponsorshipState **/ UpDataStructsSponsorshipStateAccountId32: { _enum: { @@ -2982,7 +3258,7 @@ export default { } }, /** - * Lookup373: up_data_structs::Properties + * Lookup393: up_data_structs::Properties **/ UpDataStructsProperties: { map: 'UpDataStructsPropertiesMapBoundedVec', @@ -2990,15 +3266,15 @@ export default { spaceLimit: 'u32' }, /** - * Lookup374: up_data_structs::PropertiesMap> + * Lookup394: up_data_structs::PropertiesMap> **/ UpDataStructsPropertiesMapBoundedVec: 'BTreeMap', /** - * Lookup379: up_data_structs::PropertiesMap + * Lookup399: up_data_structs::PropertiesMap **/ UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap', /** - * Lookup386: up_data_structs::CollectionStats + * Lookup406: up_data_structs::CollectionStats **/ UpDataStructsCollectionStats: { created: 'u32', @@ -3006,18 +3282,18 @@ export default { alive: 'u32' }, /** - * Lookup387: up_data_structs::TokenChild + * Lookup407: up_data_structs::TokenChild **/ UpDataStructsTokenChild: { token: 'u32', collection: 'u32' }, /** - * Lookup388: PhantomType::up_data_structs + * Lookup408: PhantomType::up_data_structs **/ PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]', /** - * Lookup390: up_data_structs::TokenData> + * Lookup410: up_data_structs::TokenData> **/ UpDataStructsTokenData: { properties: 'Vec', @@ -3025,7 +3301,7 @@ export default { pieces: 'u128' }, /** - * Lookup392: up_data_structs::RpcCollection + * Lookup412: up_data_structs::RpcCollection **/ UpDataStructsRpcCollection: { owner: 'AccountId32', @@ -3042,14 +3318,14 @@ export default { flags: 'UpDataStructsRpcCollectionFlags' }, /** - * Lookup393: up_data_structs::RpcCollectionFlags + * Lookup413: up_data_structs::RpcCollectionFlags **/ UpDataStructsRpcCollectionFlags: { foreign: 'bool', erc721metadata: 'bool' }, /** - * Lookup394: rmrk_traits::collection::CollectionInfo, sp_core::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> + * Lookup414: rmrk_traits::collection::CollectionInfo, sp_core::bounded::bounded_vec::BoundedVec, sp_core::crypto::AccountId32> **/ RmrkTraitsCollectionCollectionInfo: { issuer: 'AccountId32', @@ -3059,7 +3335,7 @@ export default { nftsCount: 'u32' }, /** - * Lookup395: rmrk_traits::nft::NftInfo> + * Lookup415: rmrk_traits::nft::NftInfo> **/ RmrkTraitsNftNftInfo: { owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple', @@ -3069,14 +3345,14 @@ export default { pending: 'bool' }, /** - * Lookup397: rmrk_traits::nft::RoyaltyInfo + * Lookup417: rmrk_traits::nft::RoyaltyInfo **/ RmrkTraitsNftRoyaltyInfo: { recipient: 'AccountId32', amount: 'Permill' }, /** - * Lookup398: rmrk_traits::resource::ResourceInfo, sp_core::bounded::bounded_vec::BoundedVec> + * Lookup418: rmrk_traits::resource::ResourceInfo, sp_core::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsResourceResourceInfo: { id: 'u32', @@ -3085,14 +3361,14 @@ export default { pendingRemoval: 'bool' }, /** - * Lookup399: rmrk_traits::property::PropertyInfo, sp_core::bounded::bounded_vec::BoundedVec> + * Lookup419: rmrk_traits::property::PropertyInfo, sp_core::bounded::bounded_vec::BoundedVec> **/ RmrkTraitsPropertyPropertyInfo: { key: 'Bytes', value: 'Bytes' }, /** - * Lookup400: rmrk_traits::base::BaseInfo> + * Lookup420: rmrk_traits::base::BaseInfo> **/ RmrkTraitsBaseBaseInfo: { issuer: 'AccountId32', @@ -3100,92 +3376,92 @@ export default { symbol: 'Bytes' }, /** - * Lookup401: rmrk_traits::nft::NftChild + * Lookup421: rmrk_traits::nft::NftChild **/ RmrkTraitsNftNftChild: { collectionId: 'u32', nftId: 'u32' }, /** - * Lookup403: pallet_common::pallet::Error + * Lookup423: pallet_common::pallet::Error **/ PalletCommonError: { _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal'] }, /** - * Lookup405: pallet_fungible::pallet::Error + * Lookup425: pallet_fungible::pallet::Error **/ PalletFungibleError: { _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup406: pallet_refungible::ItemData + * Lookup426: pallet_refungible::ItemData **/ PalletRefungibleItemData: { constData: 'Bytes' }, /** - * Lookup411: pallet_refungible::pallet::Error + * Lookup431: pallet_refungible::pallet::Error **/ PalletRefungibleError: { _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed'] }, /** - * Lookup412: pallet_nonfungible::ItemData> + * Lookup432: pallet_nonfungible::ItemData> **/ PalletNonfungibleItemData: { owner: 'PalletEvmAccountBasicCrossAccountIdRepr' }, /** - * Lookup414: up_data_structs::PropertyScope + * Lookup434: up_data_structs::PropertyScope **/ UpDataStructsPropertyScope: { _enum: ['None', 'Rmrk'] }, /** - * Lookup416: pallet_nonfungible::pallet::Error + * Lookup436: pallet_nonfungible::pallet::Error **/ PalletNonfungibleError: { _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren'] }, /** - * Lookup417: pallet_structure::pallet::Error + * Lookup437: pallet_structure::pallet::Error **/ PalletStructureError: { _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound'] }, /** - * Lookup418: pallet_rmrk_core::pallet::Error + * Lookup438: pallet_rmrk_core::pallet::Error **/ PalletRmrkCoreError: { _enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId'] }, /** - * Lookup420: pallet_rmrk_equip::pallet::Error + * Lookup440: pallet_rmrk_equip::pallet::Error **/ PalletRmrkEquipError: { _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart'] }, /** - * Lookup426: pallet_app_promotion::pallet::Error + * Lookup446: pallet_app_promotion::pallet::Error **/ PalletAppPromotionError: { _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'SponsorNotSet', 'IncorrectLockedBalanceOperation'] }, /** - * Lookup427: pallet_foreign_assets::module::Error + * Lookup447: pallet_foreign_assets::module::Error **/ PalletForeignAssetsModuleError: { _enum: ['BadLocation', 'MultiLocationExisted', 'AssetIdNotExists', 'AssetIdExisted'] }, /** - * Lookup430: pallet_evm::pallet::Error + * Lookup450: pallet_evm::pallet::Error **/ PalletEvmError: { _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce'] }, /** - * Lookup433: fp_rpc::TransactionStatus + * Lookup453: fp_rpc::TransactionStatus **/ FpRpcTransactionStatus: { transactionHash: 'H256', @@ -3197,11 +3473,11 @@ export default { logsBloom: 'EthbloomBloom' }, /** - * Lookup435: ethbloom::Bloom + * Lookup455: ethbloom::Bloom **/ EthbloomBloom: '[u8;256]', /** - * Lookup437: ethereum::receipt::ReceiptV3 + * Lookup457: ethereum::receipt::ReceiptV3 **/ EthereumReceiptReceiptV3: { _enum: { @@ -3211,7 +3487,7 @@ export default { } }, /** - * Lookup438: ethereum::receipt::EIP658ReceiptData + * Lookup458: ethereum::receipt::EIP658ReceiptData **/ EthereumReceiptEip658ReceiptData: { statusCode: 'u8', @@ -3220,7 +3496,7 @@ export default { logs: 'Vec' }, /** - * Lookup439: ethereum::block::Block + * Lookup459: ethereum::block::Block **/ EthereumBlock: { header: 'EthereumHeader', @@ -3228,7 +3504,7 @@ export default { ommers: 'Vec' }, /** - * Lookup440: ethereum::header::Header + * Lookup460: ethereum::header::Header **/ EthereumHeader: { parentHash: 'H256', @@ -3248,23 +3524,23 @@ export default { nonce: 'EthereumTypesHashH64' }, /** - * Lookup441: ethereum_types::hash::H64 + * Lookup461: ethereum_types::hash::H64 **/ EthereumTypesHashH64: '[u8;8]', /** - * Lookup446: pallet_ethereum::pallet::Error + * Lookup466: pallet_ethereum::pallet::Error **/ PalletEthereumError: { _enum: ['InvalidSignature', 'PreLogExists'] }, /** - * Lookup447: pallet_evm_coder_substrate::pallet::Error + * Lookup467: pallet_evm_coder_substrate::pallet::Error **/ PalletEvmCoderSubstrateError: { _enum: ['OutOfGas', 'OutOfFund'] }, /** - * Lookup448: up_data_structs::SponsorshipState> + * Lookup468: up_data_structs::SponsorshipState> **/ UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: { _enum: { @@ -3274,25 +3550,35 @@ export default { } }, /** - * Lookup449: pallet_evm_contract_helpers::SponsoringModeT + * Lookup469: pallet_evm_contract_helpers::SponsoringModeT **/ PalletEvmContractHelpersSponsoringModeT: { _enum: ['Disabled', 'Allowlisted', 'Generous'] }, /** - * Lookup455: pallet_evm_contract_helpers::pallet::Error + * Lookup475: pallet_evm_contract_helpers::pallet::Error **/ PalletEvmContractHelpersError: { _enum: ['NoPermission', 'NoPendingSponsor', 'TooManyMethodsHaveSponsoredLimit'] }, /** - * Lookup456: pallet_evm_migration::pallet::Error + * Lookup476: pallet_evm_migration::pallet::Error **/ PalletEvmMigrationError: { _enum: ['AccountNotEmpty', 'AccountIsNotMigrating'] }, /** - * Lookup458: sp_runtime::MultiSignature + * Lookup477: pallet_maintenance::pallet::Error + **/ + PalletMaintenanceError: 'Null', + /** + * Lookup478: pallet_test_utils::pallet::Error + **/ + PalletTestUtilsError: { + _enum: ['TestPalletDisabled', 'TriggerRollback'] + }, + /** + * Lookup480: sp_runtime::MultiSignature **/ SpRuntimeMultiSignature: { _enum: { @@ -3302,47 +3588,51 @@ export default { } }, /** - * Lookup459: sp_core::ed25519::Signature + * Lookup481: sp_core::ed25519::Signature **/ SpCoreEd25519Signature: '[u8;64]', /** - * Lookup461: sp_core::sr25519::Signature + * Lookup483: sp_core::sr25519::Signature **/ SpCoreSr25519Signature: '[u8;64]', /** - * Lookup462: sp_core::ecdsa::Signature + * Lookup484: sp_core::ecdsa::Signature **/ SpCoreEcdsaSignature: '[u8;65]', /** - * Lookup465: frame_system::extensions::check_spec_version::CheckSpecVersion + * Lookup487: frame_system::extensions::check_spec_version::CheckSpecVersion **/ FrameSystemExtensionsCheckSpecVersion: 'Null', /** - * Lookup466: frame_system::extensions::check_tx_version::CheckTxVersion + * Lookup488: frame_system::extensions::check_tx_version::CheckTxVersion **/ FrameSystemExtensionsCheckTxVersion: 'Null', /** - * Lookup467: frame_system::extensions::check_genesis::CheckGenesis + * Lookup489: frame_system::extensions::check_genesis::CheckGenesis **/ FrameSystemExtensionsCheckGenesis: 'Null', /** - * Lookup470: frame_system::extensions::check_nonce::CheckNonce + * Lookup492: frame_system::extensions::check_nonce::CheckNonce **/ FrameSystemExtensionsCheckNonce: 'Compact', /** - * Lookup471: frame_system::extensions::check_weight::CheckWeight + * Lookup493: frame_system::extensions::check_weight::CheckWeight **/ FrameSystemExtensionsCheckWeight: 'Null', /** - * Lookup472: pallet_template_transaction_payment::ChargeTransactionPayment + * Lookup494: opal_runtime::runtime_common::maintenance::CheckMaintenance + **/ + OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance: 'Null', + /** + * Lookup495: pallet_template_transaction_payment::ChargeTransactionPayment **/ PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact', /** - * Lookup473: opal_runtime::Runtime + * Lookup496: opal_runtime::Runtime **/ OpalRuntimeRuntime: 'Null', /** - * Lookup474: pallet_ethereum::FakeTransactionFinalizer + * Lookup497: pallet_ethereum::FakeTransactionFinalizer **/ PalletEthereumFakeTransactionFinalizer: 'Null' }; diff --git a/tests/src/interfaces/registry.ts b/tests/src/interfaces/registry.ts index 4f55938a94..f22d0712d5 100644 --- a/tests/src/interfaces/registry.ts +++ b/tests/src/interfaces/registry.ts @@ -5,7 +5,7 @@ // this is required to allow for ambient/previous definitions import '@polkadot/types/types/registry'; -import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchDispatchClass, FrameSupportDispatchDispatchInfo, FrameSupportDispatchPays, FrameSupportDispatchPerDispatchClassU32, FrameSupportDispatchPerDispatchClassWeight, FrameSupportDispatchPerDispatchClassWeightsPerClass, FrameSupportPalletId, FrameSupportTokensMiscBalanceStatus, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletXcmCall, PalletXcmError, PalletXcmEvent, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsRpcCollectionFlags, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; +import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchDispatchClass, FrameSupportDispatchDispatchInfo, FrameSupportDispatchPays, FrameSupportDispatchPerDispatchClassU32, FrameSupportDispatchPerDispatchClassWeight, FrameSupportDispatchPerDispatchClassWeightsPerClass, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckTxVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletMaintenanceCall, PalletMaintenanceError, PalletMaintenanceEvent, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTestUtilsCall, PalletTestUtilsError, PalletTestUtilsEvent, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsRpcCollectionFlags, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup'; declare module '@polkadot/types/types/registry' { interface InterfaceTypes { @@ -21,6 +21,7 @@ declare module '@polkadot/types/types/registry' { CumulusPalletXcmCall: CumulusPalletXcmCall; CumulusPalletXcmError: CumulusPalletXcmError; CumulusPalletXcmEvent: CumulusPalletXcmEvent; + CumulusPalletXcmOrigin: CumulusPalletXcmOrigin; CumulusPalletXcmpQueueCall: CumulusPalletXcmpQueueCall; CumulusPalletXcmpQueueError: CumulusPalletXcmpQueueError; CumulusPalletXcmpQueueEvent: CumulusPalletXcmpQueueEvent; @@ -56,7 +57,10 @@ declare module '@polkadot/types/types/registry' { FrameSupportDispatchPerDispatchClassU32: FrameSupportDispatchPerDispatchClassU32; FrameSupportDispatchPerDispatchClassWeight: FrameSupportDispatchPerDispatchClassWeight; FrameSupportDispatchPerDispatchClassWeightsPerClass: FrameSupportDispatchPerDispatchClassWeightsPerClass; + FrameSupportDispatchRawOrigin: FrameSupportDispatchRawOrigin; FrameSupportPalletId: FrameSupportPalletId; + FrameSupportScheduleLookupError: FrameSupportScheduleLookupError; + FrameSupportScheduleMaybeHashed: FrameSupportScheduleMaybeHashed; FrameSupportTokensMiscBalanceStatus: FrameSupportTokensMiscBalanceStatus; FrameSystemAccountInfo: FrameSystemAccountInfo; FrameSystemCall: FrameSystemCall; @@ -73,7 +77,9 @@ declare module '@polkadot/types/types/registry' { FrameSystemLimitsBlockWeights: FrameSystemLimitsBlockWeights; FrameSystemLimitsWeightsPerClass: FrameSystemLimitsWeightsPerClass; FrameSystemPhase: FrameSystemPhase; + OpalRuntimeOriginCaller: OpalRuntimeOriginCaller; OpalRuntimeRuntime: OpalRuntimeRuntime; + OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance: OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance; OrmlTokensAccountData: OrmlTokensAccountData; OrmlTokensBalanceLock: OrmlTokensBalanceLock; OrmlTokensModuleCall: OrmlTokensModuleCall; @@ -105,6 +111,7 @@ declare module '@polkadot/types/types/registry' { PalletEthereumError: PalletEthereumError; PalletEthereumEvent: PalletEthereumEvent; PalletEthereumFakeTransactionFinalizer: PalletEthereumFakeTransactionFinalizer; + PalletEthereumRawOrigin: PalletEthereumRawOrigin; PalletEvmAccountBasicCrossAccountIdRepr: PalletEvmAccountBasicCrossAccountIdRepr; PalletEvmCall: PalletEvmCall; PalletEvmCoderSubstrateError: PalletEvmCoderSubstrateError; @@ -123,6 +130,9 @@ declare module '@polkadot/types/types/registry' { PalletForeignAssetsNativeCurrency: PalletForeignAssetsNativeCurrency; PalletFungibleError: PalletFungibleError; PalletInflationCall: PalletInflationCall; + PalletMaintenanceCall: PalletMaintenanceCall; + PalletMaintenanceError: PalletMaintenanceError; + PalletMaintenanceEvent: PalletMaintenanceEvent; PalletNonfungibleError: PalletNonfungibleError; PalletNonfungibleItemData: PalletNonfungibleItemData; PalletRefungibleError: PalletRefungibleError; @@ -141,6 +151,9 @@ declare module '@polkadot/types/types/registry' { PalletSudoEvent: PalletSudoEvent; PalletTemplateTransactionPaymentCall: PalletTemplateTransactionPaymentCall; PalletTemplateTransactionPaymentChargeTransactionPayment: PalletTemplateTransactionPaymentChargeTransactionPayment; + PalletTestUtilsCall: PalletTestUtilsCall; + PalletTestUtilsError: PalletTestUtilsError; + PalletTestUtilsEvent: PalletTestUtilsEvent; PalletTimestampCall: PalletTimestampCall; PalletTransactionPaymentEvent: PalletTransactionPaymentEvent; PalletTransactionPaymentReleases: PalletTransactionPaymentReleases; @@ -151,9 +164,14 @@ declare module '@polkadot/types/types/registry' { PalletUniqueCall: PalletUniqueCall; PalletUniqueError: PalletUniqueError; PalletUniqueRawEvent: PalletUniqueRawEvent; + PalletUniqueSchedulerCall: PalletUniqueSchedulerCall; + PalletUniqueSchedulerError: PalletUniqueSchedulerError; + PalletUniqueSchedulerEvent: PalletUniqueSchedulerEvent; + PalletUniqueSchedulerScheduledV3: PalletUniqueSchedulerScheduledV3; PalletXcmCall: PalletXcmCall; PalletXcmError: PalletXcmError; PalletXcmEvent: PalletXcmEvent; + PalletXcmOrigin: PalletXcmOrigin; PhantomTypeUpDataStructs: PhantomTypeUpDataStructs; PolkadotCorePrimitivesInboundDownwardMessage: PolkadotCorePrimitivesInboundDownwardMessage; PolkadotCorePrimitivesInboundHrmpMessage: PolkadotCorePrimitivesInboundHrmpMessage; @@ -184,6 +202,7 @@ declare module '@polkadot/types/types/registry' { SpCoreEcdsaSignature: SpCoreEcdsaSignature; SpCoreEd25519Signature: SpCoreEd25519Signature; SpCoreSr25519Signature: SpCoreSr25519Signature; + SpCoreVoid: SpCoreVoid; SpRuntimeArithmeticError: SpRuntimeArithmeticError; SpRuntimeDigest: SpRuntimeDigest; SpRuntimeDigestDigestItem: SpRuntimeDigestDigestItem; diff --git a/tests/src/interfaces/types-lookup.ts b/tests/src/interfaces/types-lookup.ts index fc9d25389b..eb47894d6a 100644 --- a/tests/src/interfaces/types-lookup.ts +++ b/tests/src/interfaces/types-lookup.ts @@ -1132,7 +1132,47 @@ declare module '@polkadot/types/lookup' { readonly type: 'Substrate' | 'Ethereum'; } - /** @name PalletCommonEvent (93) */ + /** @name PalletUniqueSchedulerEvent (93) */ + interface PalletUniqueSchedulerEvent extends Enum { + readonly isScheduled: boolean; + readonly asScheduled: { + readonly when: u32; + readonly index: u32; + } & Struct; + readonly isCanceled: boolean; + readonly asCanceled: { + readonly when: u32; + readonly index: u32; + } & Struct; + readonly isPriorityChanged: boolean; + readonly asPriorityChanged: { + readonly when: u32; + readonly index: u32; + readonly priority: u8; + } & Struct; + readonly isDispatched: boolean; + readonly asDispatched: { + readonly task: ITuple<[u32, u32]>; + readonly id: Option; + readonly result: Result; + } & Struct; + readonly isCallLookupFailed: boolean; + readonly asCallLookupFailed: { + readonly task: ITuple<[u32, u32]>; + readonly id: Option; + readonly error: FrameSupportScheduleLookupError; + } & Struct; + readonly type: 'Scheduled' | 'Canceled' | 'PriorityChanged' | 'Dispatched' | 'CallLookupFailed'; + } + + /** @name FrameSupportScheduleLookupError (96) */ + interface FrameSupportScheduleLookupError extends Enum { + readonly isUnknown: boolean; + readonly isBadFormat: boolean; + readonly type: 'Unknown' | 'BadFormat'; + } + + /** @name PalletCommonEvent (97) */ interface PalletCommonEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>; @@ -1159,14 +1199,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet'; } - /** @name PalletStructureEvent (96) */ + /** @name PalletStructureEvent (100) */ interface PalletStructureEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: Result; readonly type: 'Executed'; } - /** @name PalletRmrkCoreEvent (97) */ + /** @name PalletRmrkCoreEvent (101) */ interface PalletRmrkCoreEvent extends Enum { readonly isCollectionCreated: boolean; readonly asCollectionCreated: { @@ -1256,7 +1296,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet'; } - /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (98) */ + /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (102) */ interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum { readonly isAccountId: boolean; readonly asAccountId: AccountId32; @@ -1265,7 +1305,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'AccountId' | 'CollectionAndNftTuple'; } - /** @name PalletRmrkEquipEvent (103) */ + /** @name PalletRmrkEquipEvent (107) */ interface PalletRmrkEquipEvent extends Enum { readonly isBaseCreated: boolean; readonly asBaseCreated: { @@ -1280,7 +1320,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BaseCreated' | 'EquippablesUpdated'; } - /** @name PalletAppPromotionEvent (104) */ + /** @name PalletAppPromotionEvent (108) */ interface PalletAppPromotionEvent extends Enum { readonly isStakingRecalculation: boolean; readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>; @@ -1293,7 +1333,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'StakingRecalculation' | 'Stake' | 'Unstake' | 'SetAdmin'; } - /** @name PalletForeignAssetsModuleEvent (105) */ + /** @name PalletForeignAssetsModuleEvent (109) */ interface PalletForeignAssetsModuleEvent extends Enum { readonly isForeignAssetRegistered: boolean; readonly asForeignAssetRegistered: { @@ -1320,7 +1360,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ForeignAssetRegistered' | 'ForeignAssetUpdated' | 'AssetRegistered' | 'AssetUpdated'; } - /** @name PalletForeignAssetsModuleAssetMetadata (106) */ + /** @name PalletForeignAssetsModuleAssetMetadata (110) */ interface PalletForeignAssetsModuleAssetMetadata extends Struct { readonly name: Bytes; readonly symbol: Bytes; @@ -1328,7 +1368,7 @@ declare module '@polkadot/types/lookup' { readonly minimalBalance: u128; } - /** @name PalletEvmEvent (107) */ + /** @name PalletEvmEvent (111) */ interface PalletEvmEvent extends Enum { readonly isLog: boolean; readonly asLog: EthereumLog; @@ -1347,21 +1387,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw'; } - /** @name EthereumLog (108) */ + /** @name EthereumLog (112) */ interface EthereumLog extends Struct { readonly address: H160; readonly topics: Vec; readonly data: Bytes; } - /** @name PalletEthereumEvent (112) */ + /** @name PalletEthereumEvent (116) */ interface PalletEthereumEvent extends Enum { readonly isExecuted: boolean; readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>; readonly type: 'Executed'; } - /** @name EvmCoreErrorExitReason (113) */ + /** @name EvmCoreErrorExitReason (117) */ interface EvmCoreErrorExitReason extends Enum { readonly isSucceed: boolean; readonly asSucceed: EvmCoreErrorExitSucceed; @@ -1374,7 +1414,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal'; } - /** @name EvmCoreErrorExitSucceed (114) */ + /** @name EvmCoreErrorExitSucceed (118) */ interface EvmCoreErrorExitSucceed extends Enum { readonly isStopped: boolean; readonly isReturned: boolean; @@ -1382,7 +1422,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Stopped' | 'Returned' | 'Suicided'; } - /** @name EvmCoreErrorExitError (115) */ + /** @name EvmCoreErrorExitError (119) */ interface EvmCoreErrorExitError extends Enum { readonly isStackUnderflow: boolean; readonly isStackOverflow: boolean; @@ -1403,13 +1443,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode'; } - /** @name EvmCoreErrorExitRevert (118) */ + /** @name EvmCoreErrorExitRevert (122) */ interface EvmCoreErrorExitRevert extends Enum { readonly isReverted: boolean; readonly type: 'Reverted'; } - /** @name EvmCoreErrorExitFatal (119) */ + /** @name EvmCoreErrorExitFatal (123) */ interface EvmCoreErrorExitFatal extends Enum { readonly isNotSupported: boolean; readonly isUnhandledInterrupt: boolean; @@ -1420,7 +1460,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other'; } - /** @name PalletEvmContractHelpersEvent (120) */ + /** @name PalletEvmContractHelpersEvent (124) */ interface PalletEvmContractHelpersEvent extends Enum { readonly isContractSponsorSet: boolean; readonly asContractSponsorSet: ITuple<[H160, AccountId32]>; @@ -1431,7 +1471,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'ContractSponsorSet' | 'ContractSponsorshipConfirmed' | 'ContractSponsorRemoved'; } - /** @name FrameSystemPhase (121) */ + /** @name PalletMaintenanceEvent (125) */ + interface PalletMaintenanceEvent extends Enum { + readonly isMaintenanceEnabled: boolean; + readonly isMaintenanceDisabled: boolean; + readonly type: 'MaintenanceEnabled' | 'MaintenanceDisabled'; + } + + /** @name PalletTestUtilsEvent (126) */ + interface PalletTestUtilsEvent extends Enum { + readonly isValueIsSet: boolean; + readonly isShouldRollback: boolean; + readonly type: 'ValueIsSet' | 'ShouldRollback'; + } + + /** @name FrameSystemPhase (127) */ interface FrameSystemPhase extends Enum { readonly isApplyExtrinsic: boolean; readonly asApplyExtrinsic: u32; @@ -1440,13 +1494,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization'; } - /** @name FrameSystemLastRuntimeUpgradeInfo (124) */ + /** @name FrameSystemLastRuntimeUpgradeInfo (129) */ interface FrameSystemLastRuntimeUpgradeInfo extends Struct { readonly specVersion: Compact; readonly specName: Text; } - /** @name FrameSystemCall (125) */ + /** @name FrameSystemCall (130) */ interface FrameSystemCall extends Enum { readonly isFillBlock: boolean; readonly asFillBlock: { @@ -1488,21 +1542,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent'; } - /** @name FrameSystemLimitsBlockWeights (130) */ + /** @name FrameSystemLimitsBlockWeights (135) */ interface FrameSystemLimitsBlockWeights extends Struct { readonly baseBlock: Weight; readonly maxBlock: Weight; readonly perClass: FrameSupportDispatchPerDispatchClassWeightsPerClass; } - /** @name FrameSupportDispatchPerDispatchClassWeightsPerClass (131) */ + /** @name FrameSupportDispatchPerDispatchClassWeightsPerClass (136) */ interface FrameSupportDispatchPerDispatchClassWeightsPerClass extends Struct { readonly normal: FrameSystemLimitsWeightsPerClass; readonly operational: FrameSystemLimitsWeightsPerClass; readonly mandatory: FrameSystemLimitsWeightsPerClass; } - /** @name FrameSystemLimitsWeightsPerClass (132) */ + /** @name FrameSystemLimitsWeightsPerClass (137) */ interface FrameSystemLimitsWeightsPerClass extends Struct { readonly baseExtrinsic: Weight; readonly maxExtrinsic: Option; @@ -1510,25 +1564,25 @@ declare module '@polkadot/types/lookup' { readonly reserved: Option; } - /** @name FrameSystemLimitsBlockLength (134) */ + /** @name FrameSystemLimitsBlockLength (139) */ interface FrameSystemLimitsBlockLength extends Struct { readonly max: FrameSupportDispatchPerDispatchClassU32; } - /** @name FrameSupportDispatchPerDispatchClassU32 (135) */ + /** @name FrameSupportDispatchPerDispatchClassU32 (140) */ interface FrameSupportDispatchPerDispatchClassU32 extends Struct { readonly normal: u32; readonly operational: u32; readonly mandatory: u32; } - /** @name SpWeightsRuntimeDbWeight (136) */ + /** @name SpWeightsRuntimeDbWeight (141) */ interface SpWeightsRuntimeDbWeight extends Struct { readonly read: u64; readonly write: u64; } - /** @name SpVersionRuntimeVersion (137) */ + /** @name SpVersionRuntimeVersion (142) */ interface SpVersionRuntimeVersion extends Struct { readonly specName: Text; readonly implName: Text; @@ -1540,7 +1594,7 @@ declare module '@polkadot/types/lookup' { readonly stateVersion: u8; } - /** @name FrameSystemError (142) */ + /** @name FrameSystemError (147) */ interface FrameSystemError extends Enum { readonly isInvalidSpecName: boolean; readonly isSpecVersionNeedsToIncrease: boolean; @@ -1551,7 +1605,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered'; } - /** @name PolkadotPrimitivesV2PersistedValidationData (143) */ + /** @name PolkadotPrimitivesV2PersistedValidationData (148) */ interface PolkadotPrimitivesV2PersistedValidationData extends Struct { readonly parentHead: Bytes; readonly relayParentNumber: u32; @@ -1559,18 +1613,18 @@ declare module '@polkadot/types/lookup' { readonly maxPovSize: u32; } - /** @name PolkadotPrimitivesV2UpgradeRestriction (146) */ + /** @name PolkadotPrimitivesV2UpgradeRestriction (151) */ interface PolkadotPrimitivesV2UpgradeRestriction extends Enum { readonly isPresent: boolean; readonly type: 'Present'; } - /** @name SpTrieStorageProof (147) */ + /** @name SpTrieStorageProof (152) */ interface SpTrieStorageProof extends Struct { readonly trieNodes: BTreeSet; } - /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (149) */ + /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (154) */ interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct { readonly dmqMqcHead: H256; readonly relayDispatchQueueSize: ITuple<[u32, u32]>; @@ -1578,7 +1632,7 @@ declare module '@polkadot/types/lookup' { readonly egressChannels: Vec>; } - /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (152) */ + /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (157) */ interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct { readonly maxCapacity: u32; readonly maxTotalSize: u32; @@ -1588,7 +1642,7 @@ declare module '@polkadot/types/lookup' { readonly mqcHead: Option; } - /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (153) */ + /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (158) */ interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct { readonly maxCodeSize: u32; readonly maxHeadDataSize: u32; @@ -1601,13 +1655,13 @@ declare module '@polkadot/types/lookup' { readonly validationUpgradeDelay: u32; } - /** @name PolkadotCorePrimitivesOutboundHrmpMessage (159) */ + /** @name PolkadotCorePrimitivesOutboundHrmpMessage (164) */ interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct { readonly recipient: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemCall (160) */ + /** @name CumulusPalletParachainSystemCall (165) */ interface CumulusPalletParachainSystemCall extends Enum { readonly isSetValidationData: boolean; readonly asSetValidationData: { @@ -1628,7 +1682,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade'; } - /** @name CumulusPrimitivesParachainInherentParachainInherentData (161) */ + /** @name CumulusPrimitivesParachainInherentParachainInherentData (166) */ interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct { readonly validationData: PolkadotPrimitivesV2PersistedValidationData; readonly relayChainState: SpTrieStorageProof; @@ -1636,19 +1690,19 @@ declare module '@polkadot/types/lookup' { readonly horizontalMessages: BTreeMap>; } - /** @name PolkadotCorePrimitivesInboundDownwardMessage (163) */ + /** @name PolkadotCorePrimitivesInboundDownwardMessage (168) */ interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct { readonly sentAt: u32; readonly msg: Bytes; } - /** @name PolkadotCorePrimitivesInboundHrmpMessage (166) */ + /** @name PolkadotCorePrimitivesInboundHrmpMessage (171) */ interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct { readonly sentAt: u32; readonly data: Bytes; } - /** @name CumulusPalletParachainSystemError (169) */ + /** @name CumulusPalletParachainSystemError (174) */ interface CumulusPalletParachainSystemError extends Enum { readonly isOverlappingUpgrades: boolean; readonly isProhibitedByPolkadot: boolean; @@ -1661,14 +1715,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized'; } - /** @name PalletBalancesBalanceLock (171) */ + /** @name PalletBalancesBalanceLock (176) */ interface PalletBalancesBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; readonly reasons: PalletBalancesReasons; } - /** @name PalletBalancesReasons (172) */ + /** @name PalletBalancesReasons (177) */ interface PalletBalancesReasons extends Enum { readonly isFee: boolean; readonly isMisc: boolean; @@ -1676,20 +1730,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'Fee' | 'Misc' | 'All'; } - /** @name PalletBalancesReserveData (175) */ + /** @name PalletBalancesReserveData (180) */ interface PalletBalancesReserveData extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name PalletBalancesReleases (177) */ + /** @name PalletBalancesReleases (182) */ interface PalletBalancesReleases extends Enum { readonly isV100: boolean; readonly isV200: boolean; readonly type: 'V100' | 'V200'; } - /** @name PalletBalancesCall (178) */ + /** @name PalletBalancesCall (183) */ interface PalletBalancesCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1726,7 +1780,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve'; } - /** @name PalletBalancesError (181) */ + /** @name PalletBalancesError (186) */ interface PalletBalancesError extends Enum { readonly isVestingBalance: boolean; readonly isLiquidityRestrictions: boolean; @@ -1739,7 +1793,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves'; } - /** @name PalletTimestampCall (183) */ + /** @name PalletTimestampCall (188) */ interface PalletTimestampCall extends Enum { readonly isSet: boolean; readonly asSet: { @@ -1748,14 +1802,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Set'; } - /** @name PalletTransactionPaymentReleases (185) */ + /** @name PalletTransactionPaymentReleases (190) */ interface PalletTransactionPaymentReleases extends Enum { readonly isV1Ancient: boolean; readonly isV2: boolean; readonly type: 'V1Ancient' | 'V2'; } - /** @name PalletTreasuryProposal (186) */ + /** @name PalletTreasuryProposal (191) */ interface PalletTreasuryProposal extends Struct { readonly proposer: AccountId32; readonly value: u128; @@ -1763,7 +1817,7 @@ declare module '@polkadot/types/lookup' { readonly bond: u128; } - /** @name PalletTreasuryCall (189) */ + /** @name PalletTreasuryCall (194) */ interface PalletTreasuryCall extends Enum { readonly isProposeSpend: boolean; readonly asProposeSpend: { @@ -1790,10 +1844,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval'; } - /** @name FrameSupportPalletId (192) */ + /** @name FrameSupportPalletId (197) */ interface FrameSupportPalletId extends U8aFixed {} - /** @name PalletTreasuryError (193) */ + /** @name PalletTreasuryError (198) */ interface PalletTreasuryError extends Enum { readonly isInsufficientProposersBalance: boolean; readonly isInvalidIndex: boolean; @@ -1803,7 +1857,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved'; } - /** @name PalletSudoCall (194) */ + /** @name PalletSudoCall (199) */ interface PalletSudoCall extends Enum { readonly isSudo: boolean; readonly asSudo: { @@ -1826,7 +1880,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs'; } - /** @name OrmlVestingModuleCall (196) */ + /** @name OrmlVestingModuleCall (201) */ interface OrmlVestingModuleCall extends Enum { readonly isClaim: boolean; readonly isVestedTransfer: boolean; @@ -1846,7 +1900,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor'; } - /** @name OrmlXtokensModuleCall (198) */ + /** @name OrmlXtokensModuleCall (203) */ interface OrmlXtokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1893,7 +1947,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'TransferMultiasset' | 'TransferWithFee' | 'TransferMultiassetWithFee' | 'TransferMulticurrencies' | 'TransferMultiassets'; } - /** @name XcmVersionedMultiAsset (199) */ + /** @name XcmVersionedMultiAsset (204) */ interface XcmVersionedMultiAsset extends Enum { readonly isV0: boolean; readonly asV0: XcmV0MultiAsset; @@ -1902,7 +1956,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1'; } - /** @name OrmlTokensModuleCall (202) */ + /** @name OrmlTokensModuleCall (207) */ interface OrmlTokensModuleCall extends Enum { readonly isTransfer: boolean; readonly asTransfer: { @@ -1939,7 +1993,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transfer' | 'TransferAll' | 'TransferKeepAlive' | 'ForceTransfer' | 'SetBalance'; } - /** @name CumulusPalletXcmpQueueCall (203) */ + /** @name CumulusPalletXcmpQueueCall (208) */ interface CumulusPalletXcmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { @@ -1975,7 +2029,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight'; } - /** @name PalletXcmCall (204) */ + /** @name PalletXcmCall (209) */ interface PalletXcmCall extends Enum { readonly isSend: boolean; readonly asSend: { @@ -2037,7 +2091,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets'; } - /** @name XcmVersionedXcm (205) */ + /** @name XcmVersionedXcm (210) */ interface XcmVersionedXcm extends Enum { readonly isV0: boolean; readonly asV0: XcmV0Xcm; @@ -2048,7 +2102,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'V0' | 'V1' | 'V2'; } - /** @name XcmV0Xcm (206) */ + /** @name XcmV0Xcm (211) */ interface XcmV0Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -2111,7 +2165,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom'; } - /** @name XcmV0Order (208) */ + /** @name XcmV0Order (213) */ interface XcmV0Order extends Enum { readonly isNull: boolean; readonly isDepositAsset: boolean; @@ -2159,14 +2213,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV0Response (210) */ + /** @name XcmV0Response (215) */ interface XcmV0Response extends Enum { readonly isAssets: boolean; readonly asAssets: Vec; readonly type: 'Assets'; } - /** @name XcmV1Xcm (211) */ + /** @name XcmV1Xcm (216) */ interface XcmV1Xcm extends Enum { readonly isWithdrawAsset: boolean; readonly asWithdrawAsset: { @@ -2235,7 +2289,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion'; } - /** @name XcmV1Order (213) */ + /** @name XcmV1Order (218) */ interface XcmV1Order extends Enum { readonly isNoop: boolean; readonly isDepositAsset: boolean; @@ -2285,7 +2339,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution'; } - /** @name XcmV1Response (215) */ + /** @name XcmV1Response (220) */ interface XcmV1Response extends Enum { readonly isAssets: boolean; readonly asAssets: XcmV1MultiassetMultiAssets; @@ -2294,10 +2348,10 @@ declare module '@polkadot/types/lookup' { readonly type: 'Assets' | 'Version'; } - /** @name CumulusPalletXcmCall (229) */ + /** @name CumulusPalletXcmCall (234) */ type CumulusPalletXcmCall = Null; - /** @name CumulusPalletDmpQueueCall (230) */ + /** @name CumulusPalletDmpQueueCall (235) */ interface CumulusPalletDmpQueueCall extends Enum { readonly isServiceOverweight: boolean; readonly asServiceOverweight: { @@ -2307,7 +2361,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ServiceOverweight'; } - /** @name PalletInflationCall (231) */ + /** @name PalletInflationCall (236) */ interface PalletInflationCall extends Enum { readonly isStartInflation: boolean; readonly asStartInflation: { @@ -2316,7 +2370,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'StartInflation'; } - /** @name PalletUniqueCall (232) */ + /** @name PalletUniqueCall (237) */ interface PalletUniqueCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -2474,7 +2528,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition'; } - /** @name UpDataStructsCollectionMode (237) */ + /** @name UpDataStructsCollectionMode (242) */ interface UpDataStructsCollectionMode extends Enum { readonly isNft: boolean; readonly isFungible: boolean; @@ -2483,7 +2537,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateCollectionData (238) */ + /** @name UpDataStructsCreateCollectionData (243) */ interface UpDataStructsCreateCollectionData extends Struct { readonly mode: UpDataStructsCollectionMode; readonly access: Option; @@ -2497,14 +2551,14 @@ declare module '@polkadot/types/lookup' { readonly properties: Vec; } - /** @name UpDataStructsAccessMode (240) */ + /** @name UpDataStructsAccessMode (245) */ interface UpDataStructsAccessMode extends Enum { readonly isNormal: boolean; readonly isAllowList: boolean; readonly type: 'Normal' | 'AllowList'; } - /** @name UpDataStructsCollectionLimits (242) */ + /** @name UpDataStructsCollectionLimits (247) */ interface UpDataStructsCollectionLimits extends Struct { readonly accountTokenOwnershipLimit: Option; readonly sponsoredDataSize: Option; @@ -2517,7 +2571,7 @@ declare module '@polkadot/types/lookup' { readonly transfersEnabled: Option; } - /** @name UpDataStructsSponsoringRateLimit (244) */ + /** @name UpDataStructsSponsoringRateLimit (249) */ interface UpDataStructsSponsoringRateLimit extends Enum { readonly isSponsoringDisabled: boolean; readonly isBlocks: boolean; @@ -2525,43 +2579,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'SponsoringDisabled' | 'Blocks'; } - /** @name UpDataStructsCollectionPermissions (247) */ + /** @name UpDataStructsCollectionPermissions (252) */ interface UpDataStructsCollectionPermissions extends Struct { readonly access: Option; readonly mintMode: Option; readonly nesting: Option; } - /** @name UpDataStructsNestingPermissions (249) */ + /** @name UpDataStructsNestingPermissions (254) */ interface UpDataStructsNestingPermissions extends Struct { readonly tokenOwner: bool; readonly collectionAdmin: bool; readonly restricted: Option; } - /** @name UpDataStructsOwnerRestrictedSet (251) */ + /** @name UpDataStructsOwnerRestrictedSet (256) */ interface UpDataStructsOwnerRestrictedSet extends BTreeSet {} - /** @name UpDataStructsPropertyKeyPermission (256) */ + /** @name UpDataStructsPropertyKeyPermission (261) */ interface UpDataStructsPropertyKeyPermission extends Struct { readonly key: Bytes; readonly permission: UpDataStructsPropertyPermission; } - /** @name UpDataStructsPropertyPermission (257) */ + /** @name UpDataStructsPropertyPermission (262) */ interface UpDataStructsPropertyPermission extends Struct { readonly mutable: bool; readonly collectionAdmin: bool; readonly tokenOwner: bool; } - /** @name UpDataStructsProperty (260) */ + /** @name UpDataStructsProperty (265) */ interface UpDataStructsProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name UpDataStructsCreateItemData (263) */ + /** @name UpDataStructsCreateItemData (268) */ interface UpDataStructsCreateItemData extends Enum { readonly isNft: boolean; readonly asNft: UpDataStructsCreateNftData; @@ -2572,23 +2626,23 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'ReFungible'; } - /** @name UpDataStructsCreateNftData (264) */ + /** @name UpDataStructsCreateNftData (269) */ interface UpDataStructsCreateNftData extends Struct { readonly properties: Vec; } - /** @name UpDataStructsCreateFungibleData (265) */ + /** @name UpDataStructsCreateFungibleData (270) */ interface UpDataStructsCreateFungibleData extends Struct { readonly value: u128; } - /** @name UpDataStructsCreateReFungibleData (266) */ + /** @name UpDataStructsCreateReFungibleData (271) */ interface UpDataStructsCreateReFungibleData extends Struct { readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateItemExData (269) */ + /** @name UpDataStructsCreateItemExData (274) */ interface UpDataStructsCreateItemExData extends Enum { readonly isNft: boolean; readonly asNft: Vec; @@ -2601,26 +2655,65 @@ declare module '@polkadot/types/lookup' { readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners'; } - /** @name UpDataStructsCreateNftExData (271) */ + /** @name UpDataStructsCreateNftExData (276) */ interface UpDataStructsCreateNftExData extends Struct { readonly properties: Vec; readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsCreateRefungibleExSingleOwner (278) */ + /** @name UpDataStructsCreateRefungibleExSingleOwner (283) */ interface UpDataStructsCreateRefungibleExSingleOwner extends Struct { readonly user: PalletEvmAccountBasicCrossAccountIdRepr; readonly pieces: u128; readonly properties: Vec; } - /** @name UpDataStructsCreateRefungibleExMultipleOwners (280) */ + /** @name UpDataStructsCreateRefungibleExMultipleOwners (285) */ interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct { readonly users: BTreeMap; readonly properties: Vec; } - /** @name PalletConfigurationCall (281) */ + /** @name PalletUniqueSchedulerCall (286) */ + interface PalletUniqueSchedulerCall extends Enum { + readonly isScheduleNamed: boolean; + readonly asScheduleNamed: { + readonly id: U8aFixed; + readonly when: u32; + readonly maybePeriodic: Option>; + readonly priority: Option; + readonly call: FrameSupportScheduleMaybeHashed; + } & Struct; + readonly isCancelNamed: boolean; + readonly asCancelNamed: { + readonly id: U8aFixed; + } & Struct; + readonly isScheduleNamedAfter: boolean; + readonly asScheduleNamedAfter: { + readonly id: U8aFixed; + readonly after: u32; + readonly maybePeriodic: Option>; + readonly priority: Option; + readonly call: FrameSupportScheduleMaybeHashed; + } & Struct; + readonly isChangeNamedPriority: boolean; + readonly asChangeNamedPriority: { + readonly id: U8aFixed; + readonly priority: u8; + } & Struct; + readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter' | 'ChangeNamedPriority'; + } + + /** @name FrameSupportScheduleMaybeHashed (289) */ + interface FrameSupportScheduleMaybeHashed extends Enum { + readonly isValue: boolean; + readonly asValue: Call; + readonly isHash: boolean; + readonly asHash: H256; + readonly type: 'Value' | 'Hash'; + } + + /** @name PalletConfigurationCall (290) */ interface PalletConfigurationCall extends Enum { readonly isSetWeightToFeeCoefficientOverride: boolean; readonly asSetWeightToFeeCoefficientOverride: { @@ -2633,13 +2726,13 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride'; } - /** @name PalletTemplateTransactionPaymentCall (283) */ + /** @name PalletTemplateTransactionPaymentCall (292) */ type PalletTemplateTransactionPaymentCall = Null; - /** @name PalletStructureCall (284) */ + /** @name PalletStructureCall (293) */ type PalletStructureCall = Null; - /** @name PalletRmrkCoreCall (285) */ + /** @name PalletRmrkCoreCall (294) */ interface PalletRmrkCoreCall extends Enum { readonly isCreateCollection: boolean; readonly asCreateCollection: { @@ -2745,7 +2838,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource'; } - /** @name RmrkTraitsResourceResourceTypes (291) */ + /** @name RmrkTraitsResourceResourceTypes (300) */ interface RmrkTraitsResourceResourceTypes extends Enum { readonly isBasic: boolean; readonly asBasic: RmrkTraitsResourceBasicResource; @@ -2756,7 +2849,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Basic' | 'Composable' | 'Slot'; } - /** @name RmrkTraitsResourceBasicResource (293) */ + /** @name RmrkTraitsResourceBasicResource (302) */ interface RmrkTraitsResourceBasicResource extends Struct { readonly src: Option; readonly metadata: Option; @@ -2764,7 +2857,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceComposableResource (295) */ + /** @name RmrkTraitsResourceComposableResource (304) */ interface RmrkTraitsResourceComposableResource extends Struct { readonly parts: Vec; readonly base: u32; @@ -2774,7 +2867,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name RmrkTraitsResourceSlotResource (296) */ + /** @name RmrkTraitsResourceSlotResource (305) */ interface RmrkTraitsResourceSlotResource extends Struct { readonly base: u32; readonly src: Option; @@ -2784,7 +2877,7 @@ declare module '@polkadot/types/lookup' { readonly thumb: Option; } - /** @name PalletRmrkEquipCall (299) */ + /** @name PalletRmrkEquipCall (308) */ interface PalletRmrkEquipCall extends Enum { readonly isCreateBase: boolean; readonly asCreateBase: { @@ -2806,7 +2899,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable'; } - /** @name RmrkTraitsPartPartType (302) */ + /** @name RmrkTraitsPartPartType (311) */ interface RmrkTraitsPartPartType extends Enum { readonly isFixedPart: boolean; readonly asFixedPart: RmrkTraitsPartFixedPart; @@ -2815,14 +2908,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'FixedPart' | 'SlotPart'; } - /** @name RmrkTraitsPartFixedPart (304) */ + /** @name RmrkTraitsPartFixedPart (313) */ interface RmrkTraitsPartFixedPart extends Struct { readonly id: u32; readonly z: u32; readonly src: Bytes; } - /** @name RmrkTraitsPartSlotPart (305) */ + /** @name RmrkTraitsPartSlotPart (314) */ interface RmrkTraitsPartSlotPart extends Struct { readonly id: u32; readonly equippable: RmrkTraitsPartEquippableList; @@ -2830,7 +2923,7 @@ declare module '@polkadot/types/lookup' { readonly z: u32; } - /** @name RmrkTraitsPartEquippableList (306) */ + /** @name RmrkTraitsPartEquippableList (315) */ interface RmrkTraitsPartEquippableList extends Enum { readonly isAll: boolean; readonly isEmpty: boolean; @@ -2839,20 +2932,20 @@ declare module '@polkadot/types/lookup' { readonly type: 'All' | 'Empty' | 'Custom'; } - /** @name RmrkTraitsTheme (308) */ + /** @name RmrkTraitsTheme (317) */ interface RmrkTraitsTheme extends Struct { readonly name: Bytes; readonly properties: Vec; readonly inherit: bool; } - /** @name RmrkTraitsThemeThemeProperty (310) */ + /** @name RmrkTraitsThemeThemeProperty (319) */ interface RmrkTraitsThemeThemeProperty extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name PalletAppPromotionCall (312) */ + /** @name PalletAppPromotionCall (321) */ interface PalletAppPromotionCall extends Enum { readonly isSetAdminAddress: boolean; readonly asSetAdminAddress: { @@ -2886,7 +2979,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers'; } - /** @name PalletForeignAssetsModuleCall (314) */ + /** @name PalletForeignAssetsModuleCall (322) */ interface PalletForeignAssetsModuleCall extends Enum { readonly isRegisterForeignAsset: boolean; readonly asRegisterForeignAsset: { @@ -2903,7 +2996,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset'; } - /** @name PalletEvmCall (315) */ + /** @name PalletEvmCall (323) */ interface PalletEvmCall extends Enum { readonly isWithdraw: boolean; readonly asWithdraw: { @@ -2948,7 +3041,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2'; } - /** @name PalletEthereumCall (319) */ + /** @name PalletEthereumCall (327) */ interface PalletEthereumCall extends Enum { readonly isTransact: boolean; readonly asTransact: { @@ -2957,7 +3050,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Transact'; } - /** @name EthereumTransactionTransactionV2 (320) */ + /** @name EthereumTransactionTransactionV2 (328) */ interface EthereumTransactionTransactionV2 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumTransactionLegacyTransaction; @@ -2968,7 +3061,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumTransactionLegacyTransaction (321) */ + /** @name EthereumTransactionLegacyTransaction (329) */ interface EthereumTransactionLegacyTransaction extends Struct { readonly nonce: U256; readonly gasPrice: U256; @@ -2979,7 +3072,7 @@ declare module '@polkadot/types/lookup' { readonly signature: EthereumTransactionTransactionSignature; } - /** @name EthereumTransactionTransactionAction (322) */ + /** @name EthereumTransactionTransactionAction (330) */ interface EthereumTransactionTransactionAction extends Enum { readonly isCall: boolean; readonly asCall: H160; @@ -2987,14 +3080,14 @@ declare module '@polkadot/types/lookup' { readonly type: 'Call' | 'Create'; } - /** @name EthereumTransactionTransactionSignature (323) */ + /** @name EthereumTransactionTransactionSignature (331) */ interface EthereumTransactionTransactionSignature extends Struct { readonly v: u64; readonly r: H256; readonly s: H256; } - /** @name EthereumTransactionEip2930Transaction (325) */ + /** @name EthereumTransactionEip2930Transaction (333) */ interface EthereumTransactionEip2930Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -3009,13 +3102,13 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name EthereumTransactionAccessListItem (327) */ + /** @name EthereumTransactionAccessListItem (335) */ interface EthereumTransactionAccessListItem extends Struct { readonly address: H160; readonly storageKeys: Vec; } - /** @name EthereumTransactionEip1559Transaction (328) */ + /** @name EthereumTransactionEip1559Transaction (336) */ interface EthereumTransactionEip1559Transaction extends Struct { readonly chainId: u64; readonly nonce: U256; @@ -3031,7 +3124,7 @@ declare module '@polkadot/types/lookup' { readonly s: H256; } - /** @name PalletEvmMigrationCall (329) */ + /** @name PalletEvmMigrationCall (337) */ interface PalletEvmMigrationCall extends Enum { readonly isBegin: boolean; readonly asBegin: { @@ -3050,13 +3143,41 @@ declare module '@polkadot/types/lookup' { readonly type: 'Begin' | 'SetData' | 'Finish'; } - /** @name PalletSudoError (332) */ + /** @name PalletMaintenanceCall (340) */ + interface PalletMaintenanceCall extends Enum { + readonly isEnable: boolean; + readonly isDisable: boolean; + readonly type: 'Enable' | 'Disable'; + } + + /** @name PalletTestUtilsCall (341) */ + interface PalletTestUtilsCall extends Enum { + readonly isEnable: boolean; + readonly isSetTestValue: boolean; + readonly asSetTestValue: { + readonly value: u32; + } & Struct; + readonly isSetTestValueAndRollback: boolean; + readonly asSetTestValueAndRollback: { + readonly value: u32; + } & Struct; + readonly isIncTestValue: boolean; + readonly isSelfCancelingInc: boolean; + readonly asSelfCancelingInc: { + readonly id: U8aFixed; + readonly maxTestValue: u32; + } & Struct; + readonly isJustTakeFee: boolean; + readonly type: 'Enable' | 'SetTestValue' | 'SetTestValueAndRollback' | 'IncTestValue' | 'SelfCancelingInc' | 'JustTakeFee'; + } + + /** @name PalletSudoError (342) */ interface PalletSudoError extends Enum { readonly isRequireSudo: boolean; readonly type: 'RequireSudo'; } - /** @name OrmlVestingModuleError (334) */ + /** @name OrmlVestingModuleError (344) */ interface OrmlVestingModuleError extends Enum { readonly isZeroVestingPeriod: boolean; readonly isZeroVestingPeriodCount: boolean; @@ -3067,7 +3188,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded'; } - /** @name OrmlXtokensModuleError (335) */ + /** @name OrmlXtokensModuleError (345) */ interface OrmlXtokensModuleError extends Enum { readonly isAssetHasNoReserve: boolean; readonly isNotCrossChainTransfer: boolean; @@ -3091,26 +3212,26 @@ declare module '@polkadot/types/lookup' { readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined'; } - /** @name OrmlTokensBalanceLock (338) */ + /** @name OrmlTokensBalanceLock (348) */ interface OrmlTokensBalanceLock extends Struct { readonly id: U8aFixed; readonly amount: u128; } - /** @name OrmlTokensAccountData (340) */ + /** @name OrmlTokensAccountData (350) */ interface OrmlTokensAccountData extends Struct { readonly free: u128; readonly reserved: u128; readonly frozen: u128; } - /** @name OrmlTokensReserveData (342) */ + /** @name OrmlTokensReserveData (352) */ interface OrmlTokensReserveData extends Struct { readonly id: Null; readonly amount: u128; } - /** @name OrmlTokensModuleError (344) */ + /** @name OrmlTokensModuleError (354) */ interface OrmlTokensModuleError extends Enum { readonly isBalanceTooLow: boolean; readonly isAmountIntoBalanceFailed: boolean; @@ -3123,21 +3244,21 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves'; } - /** @name CumulusPalletXcmpQueueInboundChannelDetails (346) */ + /** @name CumulusPalletXcmpQueueInboundChannelDetails (356) */ interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct { readonly sender: u32; readonly state: CumulusPalletXcmpQueueInboundState; readonly messageMetadata: Vec>; } - /** @name CumulusPalletXcmpQueueInboundState (347) */ + /** @name CumulusPalletXcmpQueueInboundState (357) */ interface CumulusPalletXcmpQueueInboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name PolkadotParachainPrimitivesXcmpMessageFormat (350) */ + /** @name PolkadotParachainPrimitivesXcmpMessageFormat (360) */ interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum { readonly isConcatenatedVersionedXcm: boolean; readonly isConcatenatedEncodedBlob: boolean; @@ -3145,7 +3266,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals'; } - /** @name CumulusPalletXcmpQueueOutboundChannelDetails (353) */ + /** @name CumulusPalletXcmpQueueOutboundChannelDetails (363) */ interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct { readonly recipient: u32; readonly state: CumulusPalletXcmpQueueOutboundState; @@ -3154,14 +3275,14 @@ declare module '@polkadot/types/lookup' { readonly lastIndex: u16; } - /** @name CumulusPalletXcmpQueueOutboundState (354) */ + /** @name CumulusPalletXcmpQueueOutboundState (364) */ interface CumulusPalletXcmpQueueOutboundState extends Enum { readonly isOk: boolean; readonly isSuspended: boolean; readonly type: 'Ok' | 'Suspended'; } - /** @name CumulusPalletXcmpQueueQueueConfigData (356) */ + /** @name CumulusPalletXcmpQueueQueueConfigData (366) */ interface CumulusPalletXcmpQueueQueueConfigData extends Struct { readonly suspendThreshold: u32; readonly dropThreshold: u32; @@ -3171,7 +3292,7 @@ declare module '@polkadot/types/lookup' { readonly xcmpMaxIndividualWeight: Weight; } - /** @name CumulusPalletXcmpQueueError (358) */ + /** @name CumulusPalletXcmpQueueError (368) */ interface CumulusPalletXcmpQueueError extends Enum { readonly isFailedToSend: boolean; readonly isBadXcmOrigin: boolean; @@ -3181,7 +3302,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit'; } - /** @name PalletXcmError (359) */ + /** @name PalletXcmError (369) */ interface PalletXcmError extends Enum { readonly isUnreachable: boolean; readonly isSendFailure: boolean; @@ -3199,29 +3320,29 @@ declare module '@polkadot/types/lookup' { readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed'; } - /** @name CumulusPalletXcmError (360) */ + /** @name CumulusPalletXcmError (370) */ type CumulusPalletXcmError = Null; - /** @name CumulusPalletDmpQueueConfigData (361) */ + /** @name CumulusPalletDmpQueueConfigData (371) */ interface CumulusPalletDmpQueueConfigData extends Struct { readonly maxIndividual: Weight; } - /** @name CumulusPalletDmpQueuePageIndexData (362) */ + /** @name CumulusPalletDmpQueuePageIndexData (372) */ interface CumulusPalletDmpQueuePageIndexData extends Struct { readonly beginUsed: u32; readonly endUsed: u32; readonly overweightCount: u64; } - /** @name CumulusPalletDmpQueueError (365) */ + /** @name CumulusPalletDmpQueueError (375) */ interface CumulusPalletDmpQueueError extends Enum { readonly isUnknown: boolean; readonly isOverLimit: boolean; readonly type: 'Unknown' | 'OverLimit'; } - /** @name PalletUniqueError (369) */ + /** @name PalletUniqueError (379) */ interface PalletUniqueError extends Enum { readonly isCollectionDecimalPointLimitExceeded: boolean; readonly isConfirmUnsetSponsorFail: boolean; @@ -3230,7 +3351,75 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection'; } - /** @name UpDataStructsCollection (370) */ + /** @name PalletUniqueSchedulerScheduledV3 (382) */ + interface PalletUniqueSchedulerScheduledV3 extends Struct { + readonly maybeId: Option; + readonly priority: u8; + readonly call: FrameSupportScheduleMaybeHashed; + readonly maybePeriodic: Option>; + readonly origin: OpalRuntimeOriginCaller; + } + + /** @name OpalRuntimeOriginCaller (383) */ + interface OpalRuntimeOriginCaller extends Enum { + readonly isSystem: boolean; + readonly asSystem: FrameSupportDispatchRawOrigin; + readonly isVoid: boolean; + readonly isPolkadotXcm: boolean; + readonly asPolkadotXcm: PalletXcmOrigin; + readonly isCumulusXcm: boolean; + readonly asCumulusXcm: CumulusPalletXcmOrigin; + readonly isEthereum: boolean; + readonly asEthereum: PalletEthereumRawOrigin; + readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum'; + } + + /** @name FrameSupportDispatchRawOrigin (384) */ + interface FrameSupportDispatchRawOrigin extends Enum { + readonly isRoot: boolean; + readonly isSigned: boolean; + readonly asSigned: AccountId32; + readonly isNone: boolean; + readonly type: 'Root' | 'Signed' | 'None'; + } + + /** @name PalletXcmOrigin (385) */ + interface PalletXcmOrigin extends Enum { + readonly isXcm: boolean; + readonly asXcm: XcmV1MultiLocation; + readonly isResponse: boolean; + readonly asResponse: XcmV1MultiLocation; + readonly type: 'Xcm' | 'Response'; + } + + /** @name CumulusPalletXcmOrigin (386) */ + interface CumulusPalletXcmOrigin extends Enum { + readonly isRelay: boolean; + readonly isSiblingParachain: boolean; + readonly asSiblingParachain: u32; + readonly type: 'Relay' | 'SiblingParachain'; + } + + /** @name PalletEthereumRawOrigin (387) */ + interface PalletEthereumRawOrigin extends Enum { + readonly isEthereumTransaction: boolean; + readonly asEthereumTransaction: H160; + readonly type: 'EthereumTransaction'; + } + + /** @name SpCoreVoid (388) */ + type SpCoreVoid = Null; + + /** @name PalletUniqueSchedulerError (389) */ + interface PalletUniqueSchedulerError extends Enum { + readonly isFailedToSchedule: boolean; + readonly isNotFound: boolean; + readonly isTargetBlockNumberInPast: boolean; + readonly isRescheduleNoChange: boolean; + readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange'; + } + + /** @name UpDataStructsCollection (390) */ interface UpDataStructsCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3243,7 +3432,7 @@ declare module '@polkadot/types/lookup' { readonly flags: U8aFixed; } - /** @name UpDataStructsSponsorshipStateAccountId32 (371) */ + /** @name UpDataStructsSponsorshipStateAccountId32 (391) */ interface UpDataStructsSponsorshipStateAccountId32 extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3253,43 +3442,43 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name UpDataStructsProperties (373) */ + /** @name UpDataStructsProperties (393) */ interface UpDataStructsProperties extends Struct { readonly map: UpDataStructsPropertiesMapBoundedVec; readonly consumedSpace: u32; readonly spaceLimit: u32; } - /** @name UpDataStructsPropertiesMapBoundedVec (374) */ + /** @name UpDataStructsPropertiesMapBoundedVec (394) */ interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap {} - /** @name UpDataStructsPropertiesMapPropertyPermission (379) */ + /** @name UpDataStructsPropertiesMapPropertyPermission (399) */ interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap {} - /** @name UpDataStructsCollectionStats (386) */ + /** @name UpDataStructsCollectionStats (406) */ interface UpDataStructsCollectionStats extends Struct { readonly created: u32; readonly destroyed: u32; readonly alive: u32; } - /** @name UpDataStructsTokenChild (387) */ + /** @name UpDataStructsTokenChild (407) */ interface UpDataStructsTokenChild extends Struct { readonly token: u32; readonly collection: u32; } - /** @name PhantomTypeUpDataStructs (388) */ + /** @name PhantomTypeUpDataStructs (408) */ interface PhantomTypeUpDataStructs extends Vec> {} - /** @name UpDataStructsTokenData (390) */ + /** @name UpDataStructsTokenData (410) */ interface UpDataStructsTokenData extends Struct { readonly properties: Vec; readonly owner: Option; readonly pieces: u128; } - /** @name UpDataStructsRpcCollection (392) */ + /** @name UpDataStructsRpcCollection (412) */ interface UpDataStructsRpcCollection extends Struct { readonly owner: AccountId32; readonly mode: UpDataStructsCollectionMode; @@ -3305,13 +3494,13 @@ declare module '@polkadot/types/lookup' { readonly flags: UpDataStructsRpcCollectionFlags; } - /** @name UpDataStructsRpcCollectionFlags (393) */ + /** @name UpDataStructsRpcCollectionFlags (413) */ interface UpDataStructsRpcCollectionFlags extends Struct { readonly foreign: bool; readonly erc721metadata: bool; } - /** @name RmrkTraitsCollectionCollectionInfo (394) */ + /** @name RmrkTraitsCollectionCollectionInfo (414) */ interface RmrkTraitsCollectionCollectionInfo extends Struct { readonly issuer: AccountId32; readonly metadata: Bytes; @@ -3320,7 +3509,7 @@ declare module '@polkadot/types/lookup' { readonly nftsCount: u32; } - /** @name RmrkTraitsNftNftInfo (395) */ + /** @name RmrkTraitsNftNftInfo (415) */ interface RmrkTraitsNftNftInfo extends Struct { readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple; readonly royalty: Option; @@ -3329,13 +3518,13 @@ declare module '@polkadot/types/lookup' { readonly pending: bool; } - /** @name RmrkTraitsNftRoyaltyInfo (397) */ + /** @name RmrkTraitsNftRoyaltyInfo (417) */ interface RmrkTraitsNftRoyaltyInfo extends Struct { readonly recipient: AccountId32; readonly amount: Permill; } - /** @name RmrkTraitsResourceResourceInfo (398) */ + /** @name RmrkTraitsResourceResourceInfo (418) */ interface RmrkTraitsResourceResourceInfo extends Struct { readonly id: u32; readonly resource: RmrkTraitsResourceResourceTypes; @@ -3343,26 +3532,26 @@ declare module '@polkadot/types/lookup' { readonly pendingRemoval: bool; } - /** @name RmrkTraitsPropertyPropertyInfo (399) */ + /** @name RmrkTraitsPropertyPropertyInfo (419) */ interface RmrkTraitsPropertyPropertyInfo extends Struct { readonly key: Bytes; readonly value: Bytes; } - /** @name RmrkTraitsBaseBaseInfo (400) */ + /** @name RmrkTraitsBaseBaseInfo (420) */ interface RmrkTraitsBaseBaseInfo extends Struct { readonly issuer: AccountId32; readonly baseType: Bytes; readonly symbol: Bytes; } - /** @name RmrkTraitsNftNftChild (401) */ + /** @name RmrkTraitsNftNftChild (421) */ interface RmrkTraitsNftNftChild extends Struct { readonly collectionId: u32; readonly nftId: u32; } - /** @name PalletCommonError (403) */ + /** @name PalletCommonError (423) */ interface PalletCommonError extends Enum { readonly isCollectionNotFound: boolean; readonly isMustBeTokenOwner: boolean; @@ -3401,7 +3590,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal'; } - /** @name PalletFungibleError (405) */ + /** @name PalletFungibleError (425) */ interface PalletFungibleError extends Enum { readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isFungibleItemsHaveNoId: boolean; @@ -3411,12 +3600,12 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletRefungibleItemData (406) */ + /** @name PalletRefungibleItemData (426) */ interface PalletRefungibleItemData extends Struct { readonly constData: Bytes; } - /** @name PalletRefungibleError (411) */ + /** @name PalletRefungibleError (431) */ interface PalletRefungibleError extends Enum { readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isWrongRefungiblePieces: boolean; @@ -3426,19 +3615,19 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed'; } - /** @name PalletNonfungibleItemData (412) */ + /** @name PalletNonfungibleItemData (432) */ interface PalletNonfungibleItemData extends Struct { readonly owner: PalletEvmAccountBasicCrossAccountIdRepr; } - /** @name UpDataStructsPropertyScope (414) */ + /** @name UpDataStructsPropertyScope (434) */ interface UpDataStructsPropertyScope extends Enum { readonly isNone: boolean; readonly isRmrk: boolean; readonly type: 'None' | 'Rmrk'; } - /** @name PalletNonfungibleError (416) */ + /** @name PalletNonfungibleError (436) */ interface PalletNonfungibleError extends Enum { readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean; readonly isNonfungibleItemsHaveNoAmount: boolean; @@ -3446,7 +3635,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren'; } - /** @name PalletStructureError (417) */ + /** @name PalletStructureError (437) */ interface PalletStructureError extends Enum { readonly isOuroborosDetected: boolean; readonly isDepthLimit: boolean; @@ -3455,7 +3644,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound'; } - /** @name PalletRmrkCoreError (418) */ + /** @name PalletRmrkCoreError (438) */ interface PalletRmrkCoreError extends Enum { readonly isCorruptedCollectionType: boolean; readonly isRmrkPropertyKeyIsTooLong: boolean; @@ -3479,7 +3668,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId'; } - /** @name PalletRmrkEquipError (420) */ + /** @name PalletRmrkEquipError (440) */ interface PalletRmrkEquipError extends Enum { readonly isPermissionError: boolean; readonly isNoAvailableBaseId: boolean; @@ -3491,7 +3680,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart'; } - /** @name PalletAppPromotionError (426) */ + /** @name PalletAppPromotionError (446) */ interface PalletAppPromotionError extends Enum { readonly isAdminNotSet: boolean; readonly isNoPermission: boolean; @@ -3502,7 +3691,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'IncorrectLockedBalanceOperation'; } - /** @name PalletForeignAssetsModuleError (427) */ + /** @name PalletForeignAssetsModuleError (447) */ interface PalletForeignAssetsModuleError extends Enum { readonly isBadLocation: boolean; readonly isMultiLocationExisted: boolean; @@ -3511,7 +3700,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted'; } - /** @name PalletEvmError (430) */ + /** @name PalletEvmError (450) */ interface PalletEvmError extends Enum { readonly isBalanceLow: boolean; readonly isFeeOverflow: boolean; @@ -3522,7 +3711,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce'; } - /** @name FpRpcTransactionStatus (433) */ + /** @name FpRpcTransactionStatus (453) */ interface FpRpcTransactionStatus extends Struct { readonly transactionHash: H256; readonly transactionIndex: u32; @@ -3533,10 +3722,10 @@ declare module '@polkadot/types/lookup' { readonly logsBloom: EthbloomBloom; } - /** @name EthbloomBloom (435) */ + /** @name EthbloomBloom (455) */ interface EthbloomBloom extends U8aFixed {} - /** @name EthereumReceiptReceiptV3 (437) */ + /** @name EthereumReceiptReceiptV3 (457) */ interface EthereumReceiptReceiptV3 extends Enum { readonly isLegacy: boolean; readonly asLegacy: EthereumReceiptEip658ReceiptData; @@ -3547,7 +3736,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Legacy' | 'Eip2930' | 'Eip1559'; } - /** @name EthereumReceiptEip658ReceiptData (438) */ + /** @name EthereumReceiptEip658ReceiptData (458) */ interface EthereumReceiptEip658ReceiptData extends Struct { readonly statusCode: u8; readonly usedGas: U256; @@ -3555,14 +3744,14 @@ declare module '@polkadot/types/lookup' { readonly logs: Vec; } - /** @name EthereumBlock (439) */ + /** @name EthereumBlock (459) */ interface EthereumBlock extends Struct { readonly header: EthereumHeader; readonly transactions: Vec; readonly ommers: Vec; } - /** @name EthereumHeader (440) */ + /** @name EthereumHeader (460) */ interface EthereumHeader extends Struct { readonly parentHash: H256; readonly ommersHash: H256; @@ -3581,24 +3770,24 @@ declare module '@polkadot/types/lookup' { readonly nonce: EthereumTypesHashH64; } - /** @name EthereumTypesHashH64 (441) */ + /** @name EthereumTypesHashH64 (461) */ interface EthereumTypesHashH64 extends U8aFixed {} - /** @name PalletEthereumError (446) */ + /** @name PalletEthereumError (466) */ interface PalletEthereumError extends Enum { readonly isInvalidSignature: boolean; readonly isPreLogExists: boolean; readonly type: 'InvalidSignature' | 'PreLogExists'; } - /** @name PalletEvmCoderSubstrateError (447) */ + /** @name PalletEvmCoderSubstrateError (467) */ interface PalletEvmCoderSubstrateError extends Enum { readonly isOutOfGas: boolean; readonly isOutOfFund: boolean; readonly type: 'OutOfGas' | 'OutOfFund'; } - /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (448) */ + /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (468) */ interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum { readonly isDisabled: boolean; readonly isUnconfirmed: boolean; @@ -3608,7 +3797,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed'; } - /** @name PalletEvmContractHelpersSponsoringModeT (449) */ + /** @name PalletEvmContractHelpersSponsoringModeT (469) */ interface PalletEvmContractHelpersSponsoringModeT extends Enum { readonly isDisabled: boolean; readonly isAllowlisted: boolean; @@ -3616,7 +3805,7 @@ declare module '@polkadot/types/lookup' { readonly type: 'Disabled' | 'Allowlisted' | 'Generous'; } - /** @name PalletEvmContractHelpersError (455) */ + /** @name PalletEvmContractHelpersError (475) */ interface PalletEvmContractHelpersError extends Enum { readonly isNoPermission: boolean; readonly isNoPendingSponsor: boolean; @@ -3624,14 +3813,24 @@ declare module '@polkadot/types/lookup' { readonly type: 'NoPermission' | 'NoPendingSponsor' | 'TooManyMethodsHaveSponsoredLimit'; } - /** @name PalletEvmMigrationError (456) */ + /** @name PalletEvmMigrationError (476) */ interface PalletEvmMigrationError extends Enum { readonly isAccountNotEmpty: boolean; readonly isAccountIsNotMigrating: boolean; readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating'; } - /** @name SpRuntimeMultiSignature (458) */ + /** @name PalletMaintenanceError (477) */ + type PalletMaintenanceError = Null; + + /** @name PalletTestUtilsError (478) */ + interface PalletTestUtilsError extends Enum { + readonly isTestPalletDisabled: boolean; + readonly isTriggerRollback: boolean; + readonly type: 'TestPalletDisabled' | 'TriggerRollback'; + } + + /** @name SpRuntimeMultiSignature (480) */ interface SpRuntimeMultiSignature extends Enum { readonly isEd25519: boolean; readonly asEd25519: SpCoreEd25519Signature; @@ -3642,37 +3841,40 @@ declare module '@polkadot/types/lookup' { readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa'; } - /** @name SpCoreEd25519Signature (459) */ + /** @name SpCoreEd25519Signature (481) */ interface SpCoreEd25519Signature extends U8aFixed {} - /** @name SpCoreSr25519Signature (461) */ + /** @name SpCoreSr25519Signature (483) */ interface SpCoreSr25519Signature extends U8aFixed {} - /** @name SpCoreEcdsaSignature (462) */ + /** @name SpCoreEcdsaSignature (484) */ interface SpCoreEcdsaSignature extends U8aFixed {} - /** @name FrameSystemExtensionsCheckSpecVersion (465) */ + /** @name FrameSystemExtensionsCheckSpecVersion (487) */ type FrameSystemExtensionsCheckSpecVersion = Null; - /** @name FrameSystemExtensionsCheckTxVersion (466) */ + /** @name FrameSystemExtensionsCheckTxVersion (488) */ type FrameSystemExtensionsCheckTxVersion = Null; - /** @name FrameSystemExtensionsCheckGenesis (467) */ + /** @name FrameSystemExtensionsCheckGenesis (489) */ type FrameSystemExtensionsCheckGenesis = Null; - /** @name FrameSystemExtensionsCheckNonce (470) */ + /** @name FrameSystemExtensionsCheckNonce (492) */ interface FrameSystemExtensionsCheckNonce extends Compact {} - /** @name FrameSystemExtensionsCheckWeight (471) */ + /** @name FrameSystemExtensionsCheckWeight (493) */ type FrameSystemExtensionsCheckWeight = Null; - /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (472) */ + /** @name OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance (494) */ + type OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance = Null; + + /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (495) */ interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact {} - /** @name OpalRuntimeRuntime (473) */ + /** @name OpalRuntimeRuntime (496) */ type OpalRuntimeRuntime = Null; - /** @name PalletEthereumFakeTransactionFinalizer (474) */ + /** @name PalletEthereumFakeTransactionFinalizer (497) */ type PalletEthereumFakeTransactionFinalizer = Null; } // declare module From 378dd83e391b751379d0117ae90bfeaaa7abda2a Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 7 Nov 2022 15:47:22 +0000 Subject: [PATCH 1261/1274] fix: check maintenance in self-contained (cherry picked from commit ff8cf82e5d8a40c36d3e2cf7dec4f04953a41cef) --- .../common/ethereum/self_contained_call.rs | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/runtime/common/ethereum/self_contained_call.rs b/runtime/common/ethereum/self_contained_call.rs index 2fd80c1e61..2b26d07af7 100644 --- a/runtime/common/ethereum/self_contained_call.rs +++ b/runtime/common/ethereum/self_contained_call.rs @@ -17,9 +17,9 @@ use sp_core::H160; use sp_runtime::{ traits::{Dispatchable, DispatchInfoOf, PostDispatchInfoOf}, - transaction_validity::{TransactionValidityError, TransactionValidity}, + transaction_validity::{TransactionValidityError, TransactionValidity, InvalidTransaction}, }; -use crate::{RuntimeOrigin, RuntimeCall}; +use crate::{RuntimeOrigin, RuntimeCall, Maintenance}; impl fp_self_contained::SelfContainedCall for RuntimeCall { type SignedInfo = H160; @@ -33,7 +33,15 @@ impl fp_self_contained::SelfContainedCall for RuntimeCall { fn check_self_contained(&self) -> Option> { match self { - RuntimeCall::Ethereum(call) => call.check_self_contained(), + RuntimeCall::Ethereum(call) => { + if Maintenance::is_enabled() { + Some(Err(TransactionValidityError::Invalid( + InvalidTransaction::Call, + ))) + } else { + call.check_self_contained() + } + } _ => None, } } @@ -45,7 +53,15 @@ impl fp_self_contained::SelfContainedCall for RuntimeCall { len: usize, ) -> Option { match self { - RuntimeCall::Ethereum(call) => call.validate_self_contained(info, dispatch_info, len), + RuntimeCall::Ethereum(call) => { + if Maintenance::is_enabled() { + Some(Err(TransactionValidityError::Invalid( + InvalidTransaction::Call, + ))) + } else { + call.validate_self_contained(info, dispatch_info, len) + } + } _ => None, } } From b11ecafdf21380334da1fc73a484ea64428f67fe Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 7 Nov 2022 15:47:43 +0000 Subject: [PATCH 1262/1274] fix: allow maintenance calls during maintenance (cherry picked from commit 4a26571f324772b3e8f28be654dbb5a9137ca1a8) --- runtime/common/maintenance.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/common/maintenance.rs b/runtime/common/maintenance.rs index e4d062bbaf..970e483c68 100644 --- a/runtime/common/maintenance.rs +++ b/runtime/common/maintenance.rs @@ -64,7 +64,6 @@ impl SignedExtension for CheckMaintenance { | RuntimeCall::EVM(_) | RuntimeCall::Ethereum(_) | RuntimeCall::Inflation(_) - | RuntimeCall::Maintenance(_) | RuntimeCall::Structure(_) | RuntimeCall::Unique(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), From efb00c5e46087aa4172aebc075e0f4473a122a7c Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 7 Nov 2022 15:48:03 +0000 Subject: [PATCH 1263/1274] fix: maintenance tests (cherry picked from commit 6954756c537025a07ed058d32a79e7cc81369214) --- tests/src/maintenanceMode.seqtest.ts | 34 +++++++++++++++------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/tests/src/maintenanceMode.seqtest.ts b/tests/src/maintenanceMode.seqtest.ts index 20dc95027f..bd0a3175d7 100644 --- a/tests/src/maintenanceMode.seqtest.ts +++ b/tests/src/maintenanceMode.seqtest.ts @@ -43,14 +43,16 @@ describe('Integration Test: Maintenance Mode', () => { itSub('Allows superuser to enable and disable maintenance mode - and disallows anyone else', async ({helper}) => { // Make sure non-sudo can't enable maintenance mode - await expect(helper.executeExtrinsic(superuser, 'api.tx.maintenance.enable', []), 'on commoner enabling MM').to.be.rejected; //With(/NoPermission/); + await expect(helper.executeExtrinsic(superuser, 'api.tx.maintenance.enable', []), 'on commoner enabling MM') + .to.be.rejectedWith(/BadOrigin/); // Set maintenance mode await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []); expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true; // Make sure non-sudo can't disable maintenance mode - await expect(helper.executeExtrinsic(bob, 'api.tx.maintenance.disable', []), 'on commoner disabling MM').to.be.rejected; //With(/NoPermission/); + await expect(helper.executeExtrinsic(bob, 'api.tx.maintenance.disable', []), 'on commoner disabling MM') + .to.be.rejectedWith(/BadOrigin/); // Disable maintenance mode await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []); @@ -80,19 +82,22 @@ describe('Integration Test: Maintenance Mode', () => { expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true; // Unable to create a collection when the MM is enabled - await expect(helper.nft.mintCollection(superuser), 'cudo forbidden stuff').to.be.rejected; + await expect(helper.nft.mintCollection(superuser), 'cudo forbidden stuff') + .to.be.rejectedWith(/Invalid Transaction: Transaction call is not expected/); // Unable to set token properties when the MM is enabled await expect(nft.setProperties( bob, [{key: 'test', value: 'test-val'}], - )).to.be.rejected; + )).to.be.rejectedWith(/Invalid Transaction: Transaction call is not expected/); // Unable to mint an NFT when the MM is enabled - await expect(nftCollection.mintToken(superuser)).to.be.rejected; + await expect(nftCollection.mintToken(superuser)) + .to.be.rejectedWith(/Invalid Transaction: Transaction call is not expected/); // Unable to mint an FT when the MM is enabled - await expect(ftCollection.mint(superuser)).to.be.rejected; + await expect(ftCollection.mint(superuser)) + .to.be.rejectedWith(/Invalid Transaction: Transaction call is not expected/); await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []); expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false; @@ -121,7 +126,8 @@ describe('Integration Test: Maintenance Mode', () => { expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true; // Unable to mint an RFT when the MM is enabled - await expect(rftCollection.mintToken(superuser)).to.be.rejected; + await expect(rftCollection.mintToken(superuser)) + .to.be.rejectedWith(/Invalid Transaction: Transaction call is not expected/); await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []); expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false; @@ -195,7 +201,8 @@ describe('Integration Test: Maintenance Mode', () => { // Any attempts to schedule a tx during the MM should be rejected await expect(nftDuringMM.scheduleAfter(scheduledIdAttemptDuringMM, blocksToWait) - .transfer(bob, {Substrate: superuser.address})).to.be.rejected; + .transfer(bob, {Substrate: superuser.address})) + .to.be.rejectedWith(/Invalid Transaction: Transaction call is not expected/); await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []); expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false; @@ -225,13 +232,8 @@ describe('Integration Test: Maintenance Mode', () => { const tokenId = await contract.methods.nextTokenId().call(); expect(tokenId).to.be.equal('1'); - /*const result = */ - await contract.methods.mintWithTokenURI( - receiver, - 'Test URI', - ).send(); - /*const expectedTokenId = result.events.Transfer.returnValues.tokenId; - expect(expectedTokenId).to.be.equal(tokenId);*/ + await expect(contract.methods.mintWithTokenURI(receiver, 'Test URI').send()) + .to.be.rejectedWith(/submit transaction to pool failed: Pool\(InvalidTransaction\(InvalidTransaction::Call\)\)/); await expect(contract.methods.ownerOf(tokenId).call()).rejectedWith(/token not found/); @@ -261,4 +263,4 @@ describe('Integration Test: Maintenance Mode', () => { expect(await maintenanceEnabled(helper.getApi()), 'Disastrous! Exited the test suite with maintenance mode on.').to.be.false; }); }); -}); \ No newline at end of file +}); From 2152d2760ecd75744f532f1ac8268246e1c9aa22 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Wed, 9 Nov 2022 23:38:15 +0700 Subject: [PATCH 1264/1274] add upload chain logs like artefact for node-only-update --- .github/workflows/node-only-update_v2.yml | 27 +++++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index a5d8ddb48f..9fd534176d 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -237,15 +237,28 @@ jobs: echo "SIGUSR1 sent to Polkadot-launch PID: $PID" docker logs ${ContainerID} - - name: Get chain logs in case of docker image crashed after Polkadot Launch restart + - name: Tail chain logs in case of docker image crashed after Polkadot Launch restart if: failure() # run this step only at failure run: | - docker exec node-parachain cat /polkadot-launch/9944.log - docker exec node-parachain cat /polkadot-launch/9945.log - docker exec node-parachain cat /polkadot-launch/alice.log - docker exec node-parachain cat /polkadot-launch/eve.log - docker exec node-parachain cat /polkadot-launch/dave.log - docker exec node-parachain cat /polkadot-launch/charlie.log + docker exec node-parachain tail -n 1000 /polkadot-launch/9944.log + docker exec node-parachain tail -n 1000 /polkadot-launch/9945.log + docker exec node-parachain tail -n 1000 /polkadot-launch/alice.log + + - name: copy chain log files from container to the host + if: success() || failure() # run this step even if previous step failed + run: | + mkdir /tmp/node-only-update + docker cp node-parachain:/polkadot-launch/9944.log /tmp/node-only-update/ + docker cp node-parachain:/polkadot-launch/9945.log /tmp/node-only-update/ + docker cp node-parachain:/polkadot-launch/alice.log /tmp/node-only-update/ + + - name: Upload chain log files + if: success() || failure() + uses: actions/upload-artifact@v3 + with: + name: node-only-update-chain-logs + path: /tmp/node-only-update/ + if-no-files-found: warn - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade. if: success() From 2950189001911f44ed7c1783ef27b9ccb5ac5448 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 10 Nov 2022 00:42:07 +0700 Subject: [PATCH 1265/1274] add personal token for reports node-only-update --- .github/workflows/node-only-update_v2.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 9fd534176d..3df7d2b4ea 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -182,6 +182,7 @@ jobs: path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-before-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' + token: ${{ secrets.CORE_GITHUB_TOKEN }} # TODO uncomment thease steps after the merge #- name: Run Parallel tests before Node Parachain upgrade @@ -327,6 +328,7 @@ jobs: path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-after-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' + token: ${{ secrets.CORE_GITHUB_TOKEN }} # TODO uncomment thease steps after the merge #- name: Run Parallel tests after Node Parachain upgrade From 99e96ade858a708232982d9dd16055a84dbc3904 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Thu, 10 Nov 2022 08:04:39 +0000 Subject: [PATCH 1266/1274] Disable tests and use rococo --- .docker/forkless-config/launch-config-forkless-nodata.j2 | 2 +- .github/workflows/node-only-update_v2.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.docker/forkless-config/launch-config-forkless-nodata.j2 b/.docker/forkless-config/launch-config-forkless-nodata.j2 index c68dac082c..460c9a4053 100644 --- a/.docker/forkless-config/launch-config-forkless-nodata.j2 +++ b/.docker/forkless-config/launch-config-forkless-nodata.j2 @@ -3,7 +3,7 @@ "bin": "/polkadot/target/release/polkadot", "upgradeBin": "/polkadot/target/release/polkadot", "upgradeWasm": "/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm", - "chain": "westend-local", + "chain": "rococo-local", "nodes": [ { "name": "alice", diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 3df7d2b4ea..fbd761507e 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -169,7 +169,7 @@ jobs: node scripts/readyness.js echo "Ready to start tests" yarn polkadot-types - NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-before-${NOW} + NOW=$(date +%s) && yarn testConnection --reporter mochawesome --reporter-options reportFilename=test-before-${NOW} env: RPC_URL: http://127.0.0.1:9933/ @@ -315,7 +315,7 @@ jobs: node scripts/readyness.js echo "Ready to start tests" yarn polkadot-types - NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-after-${NOW} + NOW=$(date +%s) && yarn testConnection --reporter mochawesome --reporter-options reportFilename=test-after-${NOW} env: RPC_URL: http://127.0.0.1:9933/ From c05077755aba07e562b1bb393f74b3750e9c25b6 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Thu, 10 Nov 2022 08:08:56 +0000 Subject: [PATCH 1267/1274] Add release branch to run workflow --- .github/workflows/ci-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index de1d80e000..ecc3708718 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -5,7 +5,7 @@ name: develop # Triger: PR at 'develop' branch with following types of events. on: pull_request: - branches: [ 'develop' ] + branches: [ 'develop', 'release-v930032' ] types: [ opened, reopened, synchronize, ready_for_review, converted_to_draft ] #Concurency group for control execution queue over github runners. From 9b6554406bf27cb3b86af91a2199c3091485385e Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Thu, 10 Nov 2022 08:33:52 +0000 Subject: [PATCH 1268/1274] Run full test suite after node upgrade --- .github/workflows/node-only-update_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index fbd761507e..736151b0dd 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -315,7 +315,7 @@ jobs: node scripts/readyness.js echo "Ready to start tests" yarn polkadot-types - NOW=$(date +%s) && yarn testConnection --reporter mochawesome --reporter-options reportFilename=test-after-${NOW} + NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-after-${NOW} env: RPC_URL: http://127.0.0.1:9933/ From 4470b17015b39e8542b4f6f2165354555da19887 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Thu, 10 Nov 2022 08:37:26 +0000 Subject: [PATCH 1269/1274] Run tests if failure and use GITHUB_TOKEN --- .github/workflows/node-only-update_v2.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 736151b0dd..65f666ed20 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -182,7 +182,7 @@ jobs: path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-before-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' - token: ${{ secrets.CORE_GITHUB_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} # TODO uncomment thease steps after the merge #- name: Run Parallel tests before Node Parachain upgrade @@ -308,6 +308,7 @@ jobs: ## TODO: Remove next two blocks before switch to Parrallel & Sequental tests. Uncoment commented blocks. - name: Run tests after Node Parachain upgrade + if: success() || failure() # run this step even if previous step failed working-directory: ${{ matrix.mainnet_branch }}/tests run: | yarn install @@ -328,7 +329,7 @@ jobs: path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-after-*.json # Path to test results reporter: mochawesome-json fail-on-error: 'false' - token: ${{ secrets.CORE_GITHUB_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} # TODO uncomment thease steps after the merge #- name: Run Parallel tests after Node Parachain upgrade From b2672a13b4ea2849c28c8023a30283da134dba30 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 10 Nov 2022 17:32:20 +0700 Subject: [PATCH 1270/1274] add different ports for parachains --- .../launch-config-forkless-data.j2 | 6 ++++- .../launch-config-forkless-nodata.j2 | 6 ++++- .../launch-config-node-update-only-v3.j2 | 6 ++++- .github/workflows/ci-develop.yml | 24 +++++++++---------- .github/workflows/node-only-update_v2.yml | 2 +- 5 files changed, 28 insertions(+), 16 deletions(-) diff --git a/.docker/forkless-config/launch-config-forkless-data.j2 b/.docker/forkless-config/launch-config-forkless-data.j2 index a1f8f8d728..7f56597fc4 100644 --- a/.docker/forkless-config/launch-config-forkless-data.j2 +++ b/.docker/forkless-config/launch-config-forkless-data.j2 @@ -108,7 +108,11 @@ "--rpc-cors=all", "--unsafe-rpc-external", "--unsafe-ws-external", - "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug" + "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug", + "--", + "--port=31335", + "--ws-port=9745", + "--rpc-port=9734" ] }, { diff --git a/.docker/forkless-config/launch-config-forkless-nodata.j2 b/.docker/forkless-config/launch-config-forkless-nodata.j2 index 460c9a4053..9b111697a1 100644 --- a/.docker/forkless-config/launch-config-forkless-nodata.j2 +++ b/.docker/forkless-config/launch-config-forkless-nodata.j2 @@ -102,7 +102,11 @@ "--unsafe-rpc-external", "--unsafe-ws-external", "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug", - "--ws-max-connections=1000" + "--ws-max-connections=1000", + "--", + "--port=31335", + "--ws-port=9745", + "--rpc-port=9734" ] }, { diff --git a/.docker/forkless-config/launch-config-node-update-only-v3.j2 b/.docker/forkless-config/launch-config-node-update-only-v3.j2 index 460c9a4053..9b111697a1 100644 --- a/.docker/forkless-config/launch-config-node-update-only-v3.j2 +++ b/.docker/forkless-config/launch-config-node-update-only-v3.j2 @@ -102,7 +102,11 @@ "--unsafe-rpc-external", "--unsafe-ws-external", "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug", - "--ws-max-connections=1000" + "--ws-max-connections=1000", + "--", + "--port=31335", + "--ws-port=9745", + "--rpc-port=9734" ] }, { diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index ecc3708718..9ba72d126d 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -16,14 +16,14 @@ concurrency: # List of a jobs included into Workflow. jobs: - yarn-test-dev: - if: github.event.pull_request.draft == false # Conditional check for draft per job. - uses: ./.github/workflows/dev-build-tests_v2.yml + # yarn-test-dev: + # if: github.event.pull_request.draft == false # Conditional check for draft per job. + # uses: ./.github/workflows/dev-build-tests_v2.yml - unit-test: - if: github.event.pull_request.draft == false # Conditional check for draft per job. - uses: ./.github/workflows/unit-test_v2.yml + # unit-test: + # if: github.event.pull_request.draft == false # Conditional check for draft per job. + # uses: ./.github/workflows/unit-test_v2.yml canary: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'canary')) }} # Conditional check for draft & labels per job. @@ -47,10 +47,10 @@ jobs: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'integration')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/integration-tests.yml - codestyle: - if: github.event.pull_request.draft == false # Conditional check for draft per job. - uses: ./.github/workflows/codestyle_v2.yml + # codestyle: + # if: github.event.pull_request.draft == false # Conditional check for draft per job. + # uses: ./.github/workflows/codestyle_v2.yml - yarn_eslint: - if: github.event.pull_request.draft == false # Conditional check for draft per job. - uses: ./.github/workflows/test_codestyle_v2.yml + # yarn_eslint: + # if: github.event.pull_request.draft == false # Conditional check for draft per job. + # uses: ./.github/workflows/test_codestyle_v2.yml diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 65f666ed20..5c67df04c9 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -248,7 +248,7 @@ jobs: - name: copy chain log files from container to the host if: success() || failure() # run this step even if previous step failed run: | - mkdir /tmp/node-only-update + mkdir -p /tmp/node-only-update docker cp node-parachain:/polkadot-launch/9944.log /tmp/node-only-update/ docker cp node-parachain:/polkadot-launch/9945.log /tmp/node-only-update/ docker cp node-parachain:/polkadot-launch/alice.log /tmp/node-only-update/ From e696116feb68a007fc0a4fcaed79a6e76b74d601 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 10 Nov 2022 18:40:46 +0700 Subject: [PATCH 1271/1274] add 9945 port for parachains --- .docker/docker-compose.tmp-node.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.docker/docker-compose.tmp-node.j2 b/.docker/docker-compose.tmp-node.j2 index 485ac0c337..69da0764db 100644 --- a/.docker/docker-compose.tmp-node.j2 +++ b/.docker/docker-compose.tmp-node.j2 @@ -23,10 +23,12 @@ services: read_only: true expose: - 9944 + - 9945 - 9933 - 9844 ports: - 127.0.0.1:9944:9944 + - 127.0.0.1:9945:9945 - 127.0.0.1:9933:9933 - 127.0.0.1:9844:9844 logging: From 7c1d5c647b1d5adb1ce617a50bbbfdd93165c0b2 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 10 Nov 2022 19:33:24 +0700 Subject: [PATCH 1272/1274] add 9747 port for parachains --- .docker/forkless-config/launch-config-forkless-nodata.j2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.docker/forkless-config/launch-config-forkless-nodata.j2 b/.docker/forkless-config/launch-config-forkless-nodata.j2 index 9b111697a1..c96a34f7bf 100644 --- a/.docker/forkless-config/launch-config-forkless-nodata.j2 +++ b/.docker/forkless-config/launch-config-forkless-nodata.j2 @@ -119,7 +119,11 @@ "--unsafe-rpc-external", "--unsafe-ws-external", "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug", - "--ws-max-connections=1000" + "--ws-max-connections=1000", + "--", + "--port=31337", + "--ws-port=9747", + "--rpc-port=9737" ] } ] From d5b272411f47a0075badb1b708909c3cd823bd98 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 10 Nov 2022 21:37:38 +0700 Subject: [PATCH 1273/1274] set timeout for logs and disable second logs report --- .github/workflows/node-only-update_v2.yml | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 5c67df04c9..0703ccca9d 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -230,12 +230,12 @@ jobs: ContainerID=$(docker ps -aqf "name=node-parachain") PID=$(docker exec node-parachain pidof 'polkadot-launch') sleep 30s - echo -e "Show logs of node-parachain container.\n" - docker logs ${ContainerID} echo -e "\n" echo -e "Restart polkadot-launch process: $PID\n" docker exec node-parachain kill -SIGUSR1 ${PID} echo "SIGUSR1 sent to Polkadot-launch PID: $PID" + sleep 60s + echo -e "Show logs of node-parachain container.\n" docker logs ${ContainerID} - name: Tail chain logs in case of docker image crashed after Polkadot Launch restart @@ -320,16 +320,16 @@ jobs: env: RPC_URL: http://127.0.0.1:9933/ - - name: Test Report After Node upgrade - uses: phoenix-actions/test-reporting@v8 - id: test-report-after - if: success() || failure() # run this step even if previous step failed - with: - name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created - path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-after-*.json # Path to test results - reporter: mochawesome-json - fail-on-error: 'false' - token: ${{ secrets.GITHUB_TOKEN }} + # - name: Test Report After Node upgrade + # uses: phoenix-actions/test-reporting@v8 + # id: test-report-after + # if: success() || failure() # run this step even if previous step failed + # with: + # name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created + # path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-after-*.json # Path to test results + # reporter: mochawesome-json + # fail-on-error: 'false' + # token: ${{ secrets.GITHUB_TOKEN }} # TODO uncomment thease steps after the merge #- name: Run Parallel tests after Node Parachain upgrade From 271642fdf620feed0fc0b0564dfc48d77f082292 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Thu, 10 Nov 2022 21:49:24 +0700 Subject: [PATCH 1274/1274] delete artifacts --- .../launch-config-forkless-nodata.j2 | 2 +- .github/workflows/ci-develop.yml | 26 +++++++++---------- .github/workflows/node-only-update_v2.yml | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.docker/forkless-config/launch-config-forkless-nodata.j2 b/.docker/forkless-config/launch-config-forkless-nodata.j2 index c96a34f7bf..2dc476f4b8 100644 --- a/.docker/forkless-config/launch-config-forkless-nodata.j2 +++ b/.docker/forkless-config/launch-config-forkless-nodata.j2 @@ -3,7 +3,7 @@ "bin": "/polkadot/target/release/polkadot", "upgradeBin": "/polkadot/target/release/polkadot", "upgradeWasm": "/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm", - "chain": "rococo-local", + "chain": "westend-local", "nodes": [ { "name": "alice", diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index 9ba72d126d..de1d80e000 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -5,7 +5,7 @@ name: develop # Triger: PR at 'develop' branch with following types of events. on: pull_request: - branches: [ 'develop', 'release-v930032' ] + branches: [ 'develop' ] types: [ opened, reopened, synchronize, ready_for_review, converted_to_draft ] #Concurency group for control execution queue over github runners. @@ -16,14 +16,14 @@ concurrency: # List of a jobs included into Workflow. jobs: - # yarn-test-dev: - # if: github.event.pull_request.draft == false # Conditional check for draft per job. - # uses: ./.github/workflows/dev-build-tests_v2.yml + yarn-test-dev: + if: github.event.pull_request.draft == false # Conditional check for draft per job. + uses: ./.github/workflows/dev-build-tests_v2.yml - # unit-test: - # if: github.event.pull_request.draft == false # Conditional check for draft per job. - # uses: ./.github/workflows/unit-test_v2.yml + unit-test: + if: github.event.pull_request.draft == false # Conditional check for draft per job. + uses: ./.github/workflows/unit-test_v2.yml canary: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'canary')) }} # Conditional check for draft & labels per job. @@ -47,10 +47,10 @@ jobs: if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'integration')) }} # Conditional check for draft & labels per job. uses: ./.github/workflows/integration-tests.yml - # codestyle: - # if: github.event.pull_request.draft == false # Conditional check for draft per job. - # uses: ./.github/workflows/codestyle_v2.yml + codestyle: + if: github.event.pull_request.draft == false # Conditional check for draft per job. + uses: ./.github/workflows/codestyle_v2.yml - # yarn_eslint: - # if: github.event.pull_request.draft == false # Conditional check for draft per job. - # uses: ./.github/workflows/test_codestyle_v2.yml + yarn_eslint: + if: github.event.pull_request.draft == false # Conditional check for draft per job. + uses: ./.github/workflows/test_codestyle_v2.yml diff --git a/.github/workflows/node-only-update_v2.yml b/.github/workflows/node-only-update_v2.yml index 0703ccca9d..129b4cd6e9 100644 --- a/.github/workflows/node-only-update_v2.yml +++ b/.github/workflows/node-only-update_v2.yml @@ -169,7 +169,7 @@ jobs: node scripts/readyness.js echo "Ready to start tests" yarn polkadot-types - NOW=$(date +%s) && yarn testConnection --reporter mochawesome --reporter-options reportFilename=test-before-${NOW} + NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-before-${NOW} env: RPC_URL: http://127.0.0.1:9933/